summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2013-04-18 18:26:28 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2013-04-23 22:20:31 +0200
commitb9337e22ce1dbf2eba0e8c8db294ae99f4111f91 (patch)
tree53ee1bd3dfd213815a21579151983cb997922b05 /include
parentf4e1642a1761d5eab6ccdd89928869c2b2f1528a (diff)
execute move of global headers
see https://gerrit.libreoffice.org/#/c/3367/ and Change-Id: I00c96fa77d04b33a6f8c8cd3490dfcd9bdc9e84a for details Change-Id: I199a75bc4042af20817265d5ef85b1134a96ff5a
Diffstat (limited to 'include')
-rw-r--r--include/animations/animationnodehelper.hxx124
-rw-r--r--include/apple_remote/RemoteControl.h113
-rw-r--r--include/apple_remote/RemoteMainController.h52
-rw-r--r--include/avmedia/avmediadllapi.h34
-rw-r--r--include/avmedia/mediaitem.hxx132
-rw-r--r--include/avmedia/mediaplayer.hxx76
-rw-r--r--include/avmedia/mediatoolbox.hxx60
-rw-r--r--include/avmedia/mediawindow.hxx123
-rw-r--r--include/basebmp/accessor.hxx113
-rw-r--r--include/basebmp/accessoradapters.hxx520
-rw-r--r--include/basebmp/accessorfunctors.hxx181
-rw-r--r--include/basebmp/accessortraits.hxx124
-rw-r--r--include/basebmp/basebmpdllapi.h32
-rw-r--r--include/basebmp/bitmapdevice.hxx719
-rw-r--r--include/basebmp/clippedlinerenderer.hxx411
-rw-r--r--include/basebmp/color.hxx93
-rw-r--r--include/basebmp/colorblendaccessoradapter.hxx142
-rw-r--r--include/basebmp/colormisc.hxx185
-rw-r--r--include/basebmp/colortraits.hxx144
-rw-r--r--include/basebmp/compositeiterator.hxx361
-rw-r--r--include/basebmp/debug.hxx57
-rw-r--r--include/basebmp/drawmodes.hxx49
-rw-r--r--include/basebmp/endian.hxx51
-rw-r--r--include/basebmp/fillimage.hxx63
-rw-r--r--include/basebmp/genericcolorimageaccessor.hxx76
-rw-r--r--include/basebmp/greylevelformats.hxx129
-rw-r--r--include/basebmp/iteratortraits.hxx49
-rw-r--r--include/basebmp/metafunctions.hxx226
-rw-r--r--include/basebmp/nonstandarditerator.hxx39
-rw-r--r--include/basebmp/packedpixeliterator.hxx671
-rw-r--r--include/basebmp/paletteformats.hxx139
-rw-r--r--include/basebmp/paletteimageaccessor.hxx162
-rw-r--r--include/basebmp/pixelformatadapters.hxx102
-rw-r--r--include/basebmp/pixeliterator.hxx349
-rw-r--r--include/basebmp/polypolygonrenderer.hxx360
-rw-r--r--include/basebmp/rgb24pixelformats.hxx92
-rw-r--r--include/basebmp/rgbmaskpixelformats.hxx331
-rw-r--r--include/basebmp/scaleimage.hxx189
-rw-r--r--include/basebmp/scanlineformats.hxx57
-rw-r--r--include/basebmp/stridedarrayiterator.hxx108
-rw-r--r--include/basebmp/tools.hxx85
-rw-r--r--include/basegfx/basegfxdllapi.h42
-rw-r--r--include/basegfx/color/bcolor.hxx229
-rw-r--r--include/basegfx/color/bcolormodifier.hxx137
-rw-r--r--include/basegfx/color/bcolortools.hxx52
-rw-r--r--include/basegfx/curve/b2dbeziertools.hxx57
-rw-r--r--include/basegfx/curve/b2dcubicbezier.hxx200
-rw-r--r--include/basegfx/matrix/b2dhommatrix.hxx139
-rw-r--r--include/basegfx/matrix/b2dhommatrixtools.hxx225
-rw-r--r--include/basegfx/matrix/b3dhommatrix.hxx155
-rw-r--r--include/basegfx/numeric/ftools.hxx198
-rw-r--r--include/basegfx/pixel/bpixel.hxx217
-rw-r--r--include/basegfx/point/b2dpoint.hxx146
-rw-r--r--include/basegfx/point/b2ipoint.hxx117
-rw-r--r--include/basegfx/point/b3dpoint.hxx145
-rw-r--r--include/basegfx/point/b3ipoint.hxx129
-rw-r--r--include/basegfx/polygon/b2dlinegeometry.hxx141
-rw-r--r--include/basegfx/polygon/b2dpolygon.hxx230
-rw-r--r--include/basegfx/polygon/b2dpolygonclipper.hxx70
-rw-r--r--include/basegfx/polygon/b2dpolygoncutandtouch.hxx58
-rw-r--r--include/basegfx/polygon/b2dpolygontools.hxx442
-rw-r--r--include/basegfx/polygon/b2dpolygontriangulator.hxx43
-rw-r--r--include/basegfx/polygon/b2dpolypolygon.hxx137
-rw-r--r--include/basegfx/polygon/b2dpolypolygoncutter.hxx153
-rw-r--r--include/basegfx/polygon/b2dpolypolygonfillrule.hxx54
-rw-r--r--include/basegfx/polygon/b2dpolypolygontools.hxx236
-rw-r--r--include/basegfx/polygon/b2dtrapezoid.hxx124
-rw-r--r--include/basegfx/polygon/b3dpolygon.hxx130
-rw-r--r--include/basegfx/polygon/b3dpolygontools.hxx135
-rw-r--r--include/basegfx/polygon/b3dpolypolygon.hxx117
-rw-r--r--include/basegfx/polygon/b3dpolypolygontools.hxx133
-rw-r--r--include/basegfx/range/b1drange.hxx174
-rw-r--r--include/basegfx/range/b1ibox.hxx164
-rw-r--r--include/basegfx/range/b1irange.hxx169
-rw-r--r--include/basegfx/range/b2dconnectedranges.hxx257
-rw-r--r--include/basegfx/range/b2dpolyrange.hxx94
-rw-r--r--include/basegfx/range/b2drange.hxx320
-rw-r--r--include/basegfx/range/b2drangeclipper.hxx45
-rw-r--r--include/basegfx/range/b2drectangle.hxx36
-rw-r--r--include/basegfx/range/b2ibox.hxx261
-rw-r--r--include/basegfx/range/b2irange.hxx287
-rw-r--r--include/basegfx/range/b2irectangle.hxx36
-rw-r--r--include/basegfx/range/b3drange.hxx273
-rw-r--r--include/basegfx/range/b3irange.hxx240
-rw-r--r--include/basegfx/range/basicbox.hxx127
-rw-r--r--include/basegfx/range/basicrange.hxx278
-rw-r--r--include/basegfx/raster/bpixelraster.hxx99
-rw-r--r--include/basegfx/raster/bzpixelraster.hxx90
-rw-r--r--include/basegfx/raster/rasterconvert3d.hxx340
-rw-r--r--include/basegfx/tools/b2dclipstate.hxx94
-rw-r--r--include/basegfx/tools/canvastools.hxx205
-rw-r--r--include/basegfx/tools/gradienttools.hxx405
-rw-r--r--include/basegfx/tools/keystoplerp.hxx92
-rw-r--r--include/basegfx/tools/lerp.hxx51
-rw-r--r--include/basegfx/tools/rectcliptools.hxx96
-rw-r--r--include/basegfx/tools/tools.hxx102
-rw-r--r--include/basegfx/tools/unopolypolygon.hxx110
-rw-r--r--include/basegfx/tools/unotools.hxx40
-rw-r--r--include/basegfx/tools/zoomtools.hxx50
-rw-r--r--include/basegfx/tuple/b2dtuple.hxx352
-rw-r--r--include/basegfx/tuple/b2i64tuple.hxx305
-rw-r--r--include/basegfx/tuple/b2ituple.hxx208
-rw-r--r--include/basegfx/tuple/b3dtuple.hxx421
-rw-r--r--include/basegfx/tuple/b3i64tuple.hxx336
-rw-r--r--include/basegfx/tuple/b3ituple.hxx335
-rw-r--r--include/basegfx/vector/b2dsize.hxx36
-rw-r--r--include/basegfx/vector/b2dvector.hxx254
-rw-r--r--include/basegfx/vector/b2enums.hxx70
-rw-r--r--include/basegfx/vector/b2isize.hxx36
-rw-r--r--include/basegfx/vector/b2ivector.hxx146
-rw-r--r--include/basegfx/vector/b3dvector.hxx322
-rw-r--r--include/basegfx/vector/b3ivector.hxx249
-rw-r--r--include/basic/basicdllapi.h23
-rw-r--r--include/basic/basicmanagerrepository.hxx142
-rw-r--r--include/basic/basmgr.hxx238
-rw-r--r--include/basic/basrdll.hxx52
-rw-r--r--include/basic/global.hxx28
-rw-r--r--include/basic/modsizeexceeded.hxx55
-rw-r--r--include/basic/sbdef.hxx68
-rw-r--r--include/basic/sberrors.hxx418
-rw-r--r--include/basic/sbmeth.hxx91
-rw-r--r--include/basic/sbmod.hxx164
-rw-r--r--include/basic/sbobjmod.hxx104
-rw-r--r--include/basic/sbprop.hxx67
-rw-r--r--include/basic/sbstar.hxx183
-rw-r--r--include/basic/sbstdobj.hxx136
-rw-r--r--include/basic/sbuno.hxx42
-rw-r--r--include/basic/sbx.hxx280
-rw-r--r--include/basic/sbxbase.hxx52
-rw-r--r--include/basic/sbxcore.hxx152
-rw-r--r--include/basic/sbxdef.hxx311
-rw-r--r--include/basic/sbxfac.hxx43
-rw-r--r--include/basic/sbxform.hxx173
-rw-r--r--include/basic/sbxmeth.hxx40
-rw-r--r--include/basic/sbxobj.hxx96
-rw-r--r--include/basic/sbxprop.hxx44
-rw-r--r--include/basic/sbxvar.hxx356
-rw-r--r--include/basic/vbahelper.hxx99
-rw-r--r--include/canvas/base/bitmapcanvasbase.hxx128
-rw-r--r--include/canvas/base/bufferedgraphicdevicebase.hxx276
-rw-r--r--include/canvas/base/cachedprimitivebase.hxx117
-rw-r--r--include/canvas/base/canvasbase.hxx474
-rw-r--r--include/canvas/base/canvascustomspritebase.hxx271
-rw-r--r--include/canvas/base/canvascustomspritehelper.hxx287
-rw-r--r--include/canvas/base/disambiguationhelper.hxx81
-rw-r--r--include/canvas/base/graphicdevicebase.hxx382
-rw-r--r--include/canvas/base/integerbitmapbase.hxx145
-rw-r--r--include/canvas/base/sprite.hxx116
-rw-r--r--include/canvas/base/spritecanvasbase.hxx193
-rw-r--r--include/canvas/base/spritesurface.hxx70
-rw-r--r--include/canvas/canvastools.hxx587
-rw-r--r--include/canvas/canvastoolsdllapi.h35
-rw-r--r--include/canvas/debug.hxx59
-rw-r--r--include/canvas/elapsedtime.hxx173
-rw-r--r--include/canvas/parametricpolypolygon.hxx161
-rw-r--r--include/canvas/propertysethelper.hxx152
-rw-r--r--include/canvas/rendering/bitmap.hxx314
-rw-r--r--include/canvas/rendering/icachedprimitive.hxx60
-rw-r--r--include/canvas/rendering/icolorbuffer.hxx88
-rw-r--r--include/canvas/rendering/irendermodule.hxx143
-rw-r--r--include/canvas/rendering/isurface.hxx82
-rw-r--r--include/canvas/rendering/isurfaceproxy.hxx107
-rw-r--r--include/canvas/rendering/isurfaceproxymanager.hxx74
-rw-r--r--include/canvas/spriteredrawmanager.hxx429
-rw-r--r--include/canvas/vclwrapper.hxx141
-rw-r--r--include/canvas/verbosetrace.hxx32
-rw-r--r--include/canvas/verifyinput.hxx667
-rw-r--r--include/codemaker/codemaker.hxx38
-rw-r--r--include/codemaker/commoncpp.hxx63
-rw-r--r--include/codemaker/commonjava.hxx42
-rw-r--r--include/codemaker/exceptiontree.hxx120
-rw-r--r--include/codemaker/generatedtypeset.hxx73
-rw-r--r--include/codemaker/global.hxx135
-rw-r--r--include/codemaker/options.hxx75
-rw-r--r--include/codemaker/typemanager.hxx76
-rw-r--r--include/codemaker/unotype.hxx91
-rw-r--r--include/comphelper/ChainablePropertySet.hxx138
-rw-r--r--include/comphelper/ChainablePropertySetInfo.hxx69
-rw-r--r--include/comphelper/IdPropArrayHelper.hxx117
-rw-r--r--include/comphelper/InlineContainer.hxx143
-rw-r--r--include/comphelper/MasterPropertySet.hxx143
-rw-r--r--include/comphelper/MasterPropertySetInfo.hxx59
-rw-r--r--include/comphelper/PropertyInfoHash.hxx65
-rw-r--r--include/comphelper/SelectionMultiplex.hxx105
-rw-r--r--include/comphelper/SettingsHelper.hxx113
-rw-r--r--include/comphelper/TypeGeneration.hxx122
-rw-r--r--include/comphelper/accessiblecomponenthelper.hxx140
-rw-r--r--include/comphelper/accessiblecontexthelper.hxx345
-rw-r--r--include/comphelper/accessibleeventnotifier.hxx161
-rw-r--r--include/comphelper/accessiblekeybindinghelper.hxx75
-rw-r--r--include/comphelper/accessibleselectionhelper.hxx124
-rw-r--r--include/comphelper/accessibletexthelper.hxx178
-rw-r--r--include/comphelper/accessiblewrapper.hxx410
-rw-r--r--include/comphelper/accimplaccess.hxx141
-rw-r--r--include/comphelper/anycompare.hxx219
-rw-r--r--include/comphelper/anytostring.hxx43
-rw-r--r--include/comphelper/asyncnotification.hxx184
-rw-r--r--include/comphelper/attributelist.hxx66
-rw-r--r--include/comphelper/basicio.hxx99
-rw-r--r--include/comphelper/broadcasthelper.hxx63
-rw-r--r--include/comphelper/classids.hxx388
-rw-r--r--include/comphelper/comphelperdllapi.h33
-rw-r--r--include/comphelper/componentbase.hxx154
-rw-r--r--include/comphelper/componentcontext.hxx243
-rw-r--r--include/comphelper/componentguard.hxx63
-rw-r--r--include/comphelper/componentmodule.hxx261
-rw-r--r--include/comphelper/configuration.hxx331
-rw-r--r--include/comphelper/configurationhelper.hxx240
-rw-r--r--include/comphelper/container.hxx80
-rw-r--r--include/comphelper/containermultiplexer.hxx106
-rw-r--r--include/comphelper/docpasswordhelper.hxx353
-rw-r--r--include/comphelper/docpasswordrequest.hxx122
-rw-r--r--include/comphelper/documentconstants.hxx171
-rw-r--r--include/comphelper/documentinfo.hxx51
-rw-r--r--include/comphelper/embeddedobjectcontainer.hxx181
-rw-r--r--include/comphelper/enumhelper.hxx143
-rw-r--r--include/comphelper/eventattachermgr.hxx52
-rw-r--r--include/comphelper/evtlistenerhlp.hxx50
-rw-r--r--include/comphelper/evtmethodhelper.hxx32
-rw-r--r--include/comphelper/extract.hxx158
-rw-r--r--include/comphelper/fileformat.h34
-rw-r--r--include/comphelper/flagguard.hxx78
-rw-r--r--include/comphelper/genericpropertyset.hxx34
-rw-r--r--include/comphelper/guarding.hxx56
-rw-r--r--include/comphelper/ihwrapnofilter.hxx99
-rw-r--r--include/comphelper/implbase_var.hxx436
-rw-r--r--include/comphelper/implementationreference.hxx267
-rw-r--r--include/comphelper/interaction.hxx161
-rw-r--r--include/comphelper/listenernotification.hxx298
-rw-r--r--include/comphelper/logging.hxx726
-rw-r--r--include/comphelper/make_shared_from_uno.hxx68
-rw-r--r--include/comphelper/makesequence.hxx80
-rw-r--r--include/comphelper/mediadescriptor.hxx310
-rw-r--r--include/comphelper/mimeconfighelper.hxx141
-rw-r--r--include/comphelper/namecontainer.hxx35
-rw-r--r--include/comphelper/namedvaluecollection.hxx376
-rw-r--r--include/comphelper/newarray.hxx51
-rw-r--r--include/comphelper/numberedcollection.hxx176
-rw-r--r--include/comphelper/numbers.hxx67
-rw-r--r--include/comphelper/officeresourcebundle.hxx94
-rw-r--r--include/comphelper/ofopxmlhelper.hxx130
-rw-r--r--include/comphelper/optional.hxx81
-rw-r--r--include/comphelper/oslfile2streamwrap.hxx89
-rw-r--r--include/comphelper/processfactory.hxx84
-rw-r--r--include/comphelper/propagg.hxx325
-rw-r--r--include/comphelper/proparrhlp.hxx175
-rw-r--r--include/comphelper/property.hxx205
-rw-r--r--include/comphelper/propertybag.hxx227
-rw-r--r--include/comphelper/propertycontainer.hxx90
-rw-r--r--include/comphelper/propertycontainerhelper.hxx203
-rw-r--r--include/comphelper/propertysethelper.hxx91
-rw-r--r--include/comphelper/propertysetinfo.hxx87
-rw-r--r--include/comphelper/propertystatecontainer.hxx114
-rw-r--r--include/comphelper/propmultiplex.hxx109
-rw-r--r--include/comphelper/propstate.hxx105
-rw-r--r--include/comphelper/proxyaggregation.hxx221
-rw-r--r--include/comphelper/scoped_disposing_ptr.hxx160
-rw-r--r--include/comphelper/scopeguard.hxx64
-rw-r--r--include/comphelper/seekableinput.hxx77
-rw-r--r--include/comphelper/seqstream.hxx139
-rw-r--r--include/comphelper/sequence.hxx369
-rw-r--r--include/comphelper/sequenceashashmap.hxx313
-rw-r--r--include/comphelper/sequenceasvector.hxx247
-rw-r--r--include/comphelper/servicedecl.hxx409
-rw-r--r--include/comphelper/servicehelper.hxx107
-rw-r--r--include/comphelper/serviceinfohelper.hxx54
-rw-r--r--include/comphelper/sharedmutex.hxx86
-rw-r--r--include/comphelper/stillreadwriteinteraction.hxx56
-rw-r--r--include/comphelper/stl_types.hxx273
-rw-r--r--include/comphelper/stlunosequence.hxx81
-rw-r--r--include/comphelper/storagehelper.hxx200
-rw-r--r--include/comphelper/streamsection.hxx78
-rw-r--r--include/comphelper/string.hxx466
-rw-r--r--include/comphelper/synchronousdispatch.hxx66
-rw-r--r--include/comphelper/syntaxhighlight.hxx162
-rw-r--r--include/comphelper/types.hxx174
-rw-r--r--include/comphelper/uno3.hxx275
-rw-r--r--include/comphelper/unwrapargs.hxx138
-rw-r--r--include/comphelper/weak.hxx56
-rw-r--r--include/comphelper/weakbag.hxx86
-rw-r--r--include/comphelper/weakeventlistener.hxx182
-rw-r--r--include/comphelper/xmltools.hxx28
-rw-r--r--include/connectivity/BlobHelper.hxx44
-rw-r--r--include/connectivity/CommonTools.hxx215
-rw-r--r--include/connectivity/ConnectionWrapper.hxx92
-rw-r--r--include/connectivity/DriversConfig.hxx80
-rw-r--r--include/connectivity/FValue.hxx539
-rw-r--r--include/connectivity/IParseContext.hxx104
-rw-r--r--include/connectivity/OSubComponent.hxx86
-rw-r--r--include/connectivity/PColumn.hxx154
-rw-r--r--include/connectivity/ParameterCont.hxx52
-rw-r--r--include/connectivity/SQLStatementHelper.hxx43
-rw-r--r--include/connectivity/StdTypeDefs.hxx40
-rw-r--r--include/connectivity/TColumnsHelper.hxx63
-rw-r--r--include/connectivity/TIndex.hxx49
-rw-r--r--include/connectivity/TIndexColumns.hxx44
-rw-r--r--include/connectivity/TIndexes.hxx50
-rw-r--r--include/connectivity/TKey.hxx47
-rw-r--r--include/connectivity/TKeyColumns.hxx44
-rw-r--r--include/connectivity/TKeys.hxx59
-rw-r--r--include/connectivity/TTableHelper.hxx166
-rw-r--r--include/connectivity/conncleanup.hxx90
-rw-r--r--include/connectivity/dbcharset.hxx164
-rw-r--r--include/connectivity/dbconversion.hxx213
-rw-r--r--include/connectivity/dbexception.hxx353
-rw-r--r--include/connectivity/dbmetadata.hxx192
-rw-r--r--include/connectivity/dbtools.hxx787
-rw-r--r--include/connectivity/dbtoolsdllapi.hxx35
-rw-r--r--include/connectivity/filtermanager.hxx123
-rw-r--r--include/connectivity/formattedcolumnvalue.hxx110
-rw-r--r--include/connectivity/parameters.hxx417
-rw-r--r--include/connectivity/paramwrapper.hxx200
-rw-r--r--include/connectivity/predicateinput.hxx125
-rw-r--r--include/connectivity/sdbcx/IRefreshable.hxx59
-rw-r--r--include/connectivity/sdbcx/VCatalog.hxx125
-rw-r--r--include/connectivity/sdbcx/VCollection.hxx237
-rw-r--r--include/connectivity/sdbcx/VColumn.hxx118
-rw-r--r--include/connectivity/sdbcx/VDescriptor.hxx95
-rw-r--r--include/connectivity/sdbcx/VGroup.hxx103
-rw-r--r--include/connectivity/sdbcx/VIndex.hxx106
-rw-r--r--include/connectivity/sdbcx/VIndexColumn.hxx65
-rw-r--r--include/connectivity/sdbcx/VKey.hxx121
-rw-r--r--include/connectivity/sdbcx/VKeyColumn.hxx67
-rw-r--r--include/connectivity/sdbcx/VTable.hxx141
-rw-r--r--include/connectivity/sdbcx/VTypeDef.hxx40
-rw-r--r--include/connectivity/sdbcx/VUser.hxx100
-rw-r--r--include/connectivity/sdbcx/VView.hxx101
-rw-r--r--include/connectivity/sqlerror.hxx317
-rw-r--r--include/connectivity/sqliterator.hxx356
-rw-r--r--include/connectivity/sqlnode.hxx466
-rw-r--r--include/connectivity/sqlparse.hxx253
-rw-r--r--include/connectivity/standardsqlstate.hxx68
-rw-r--r--include/connectivity/statementcomposer.hxx102
-rw-r--r--include/connectivity/virtualdbtools.hxx371
-rw-r--r--include/connectivity/warningscontainer.hxx102
-rw-r--r--include/cosv/bstream.hxx143
-rw-r--r--include/cosv/comdline.hxx63
-rw-r--r--include/cosv/comfunc.hxx67
-rw-r--r--include/cosv/csv_env.hxx148
-rw-r--r--include/cosv/csv_ostream.hxx127
-rw-r--r--include/cosv/csv_precomp.h40
-rw-r--r--include/cosv/dirchain.hxx146
-rw-r--r--include/cosv/file.hxx114
-rw-r--r--include/cosv/openclose.hxx137
-rw-r--r--include/cosv/persist.hxx98
-rw-r--r--include/cosv/ploc.hxx106
-rw-r--r--include/cosv/ploc_dir.hxx109
-rw-r--r--include/cosv/plocroot.hxx73
-rw-r--r--include/cosv/std_outp.hxx123
-rw-r--r--include/cosv/str_types.hxx85
-rw-r--r--include/cosv/streamstr.hxx310
-rw-r--r--include/cosv/string.hxx501
-rw-r--r--include/cosv/stringdata.hxx128
-rw-r--r--include/cosv/tpl/dyn.hxx232
-rw-r--r--include/cosv/tpl/processor.hxx129
-rw-r--r--include/cosv/tpl/swelist.hxx362
-rw-r--r--include/cosv/tpl/tpltools.hxx154
-rw-r--r--include/cosv/tpl/vvector.hxx535
-rw-r--r--include/cosv/x.hxx64
-rw-r--r--include/cppcanvas/basegfxfactory.hxx89
-rw-r--r--include/cppcanvas/bitmap.hxx74
-rw-r--r--include/cppcanvas/bitmapcanvas.hxx60
-rw-r--r--include/cppcanvas/canvas.hxx106
-rw-r--r--include/cppcanvas/canvasgraphic.hxx157
-rw-r--r--include/cppcanvas/color.hxx89
-rw-r--r--include/cppcanvas/cppcanvasdllapi.h30
-rw-r--r--include/cppcanvas/customsprite.hxx47
-rw-r--r--include/cppcanvas/font.hxx55
-rw-r--r--include/cppcanvas/polypolygon.hxx87
-rw-r--r--include/cppcanvas/renderer.hxx144
-rw-r--r--include/cppcanvas/sprite.hxx110
-rw-r--r--include/cppcanvas/spritecanvas.hxx76
-rw-r--r--include/cppcanvas/text.hxx45
-rw-r--r--include/cppcanvas/vclfactory.hxx102
-rw-r--r--include/drawinglayer/XShapeDumper.hxx71
-rw-r--r--include/drawinglayer/animation/animationtiming.hxx141
-rw-r--r--include/drawinglayer/attribute/fillbitmapattribute.hxx84
-rw-r--r--include/drawinglayer/attribute/fillgradientattribute.hxx107
-rw-r--r--include/drawinglayer/attribute/fillhatchattribute.hxx98
-rw-r--r--include/drawinglayer/attribute/fontattribute.hxx98
-rw-r--r--include/drawinglayer/attribute/lineattribute.hxx85
-rw-r--r--include/drawinglayer/attribute/linestartendattribute.hxx81
-rw-r--r--include/drawinglayer/attribute/materialattribute3d.hxx85
-rw-r--r--include/drawinglayer/attribute/sdrallattribute3d.hxx76
-rw-r--r--include/drawinglayer/attribute/sdrfillattribute.hxx87
-rw-r--r--include/drawinglayer/attribute/sdrfillbitmapattribute.hxx96
-rw-r--r--include/drawinglayer/attribute/sdrlightattribute3d.hxx83
-rw-r--r--include/drawinglayer/attribute/sdrlightingattribute3d.hxx87
-rw-r--r--include/drawinglayer/attribute/sdrlineattribute.hxx91
-rw-r--r--include/drawinglayer/attribute/sdrlinestartendattribute.hxx90
-rw-r--r--include/drawinglayer/attribute/sdrobjectattribute3d.hxx99
-rw-r--r--include/drawinglayer/attribute/sdrsceneattribute3d.hxx82
-rw-r--r--include/drawinglayer/attribute/sdrshadowattribute.hxx81
-rw-r--r--include/drawinglayer/attribute/strokeattribute.hxx75
-rw-r--r--include/drawinglayer/drawinglayerdllapi.h24
-rw-r--r--include/drawinglayer/geometry/viewinformation2d.hxx181
-rw-r--r--include/drawinglayer/geometry/viewinformation3d.hxx175
-rw-r--r--include/drawinglayer/primitive2d/animatedprimitive2d.hxx171
-rw-r--r--include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx86
-rw-r--r--include/drawinglayer/primitive2d/baseprimitive2d.hxx296
-rw-r--r--include/drawinglayer/primitive2d/bitmapprimitive2d.hxx80
-rw-r--r--include/drawinglayer/primitive2d/borderlineprimitive2d.hxx144
-rw-r--r--include/drawinglayer/primitive2d/clippedborderlineprimitive2d.hxx67
-rw-r--r--include/drawinglayer/primitive2d/controlprimitive2d.hxx113
-rw-r--r--include/drawinglayer/primitive2d/cropprimitive2d.hxx102
-rw-r--r--include/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx78
-rw-r--r--include/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx121
-rw-r--r--include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx111
-rw-r--r--include/drawinglayer/primitive2d/embedded3dprimitive2d.hxx122
-rw-r--r--include/drawinglayer/primitive2d/epsprimitive2d.hxx81
-rw-r--r--include/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx88
-rw-r--r--include/drawinglayer/primitive2d/fillgradientprimitive2d.hxx109
-rw-r--r--include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx89
-rw-r--r--include/drawinglayer/primitive2d/graphicprimitive2d.hxx95
-rw-r--r--include/drawinglayer/primitive2d/gridprimitive2d.hxx119
-rw-r--r--include/drawinglayer/primitive2d/groupprimitive2d.hxx95
-rw-r--r--include/drawinglayer/primitive2d/helplineprimitive2d.hxx114
-rw-r--r--include/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx64
-rw-r--r--include/drawinglayer/primitive2d/invertprimitive2d.hxx59
-rw-r--r--include/drawinglayer/primitive2d/markerarrayprimitive2d.hxx88
-rw-r--r--include/drawinglayer/primitive2d/maskprimitive2d.hxx79
-rw-r--r--include/drawinglayer/primitive2d/mediaprimitive2d.hxx97
-rw-r--r--include/drawinglayer/primitive2d/metafileprimitive2d.hxx94
-rw-r--r--include/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx79
-rw-r--r--include/drawinglayer/primitive2d/objectinfoprimitive2d.hxx73
-rw-r--r--include/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx104
-rw-r--r--include/drawinglayer/primitive2d/patternfillprimitive2d.hxx81
-rw-r--r--include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx83
-rw-r--r--include/drawinglayer/primitive2d/polygonprimitive2d.hxx310
-rw-r--r--include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx382
-rw-r--r--include/drawinglayer/primitive2d/primitivetools2d.hxx192
-rw-r--r--include/drawinglayer/primitive2d/sceneprimitive2d.hxx159
-rw-r--r--include/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx71
-rw-r--r--include/drawinglayer/primitive2d/shadowprimitive2d.hxx88
-rw-r--r--include/drawinglayer/primitive2d/structuretagprimitive2d.hxx71
-rw-r--r--include/drawinglayer/primitive2d/svggradientprimitive2d.hxx413
-rw-r--r--include/drawinglayer/primitive2d/textbreakuphelper.hxx84
-rw-r--r--include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx147
-rw-r--r--include/drawinglayer/primitive2d/texteffectprimitive2d.hxx106
-rw-r--r--include/drawinglayer/primitive2d/textenumsprimitive2d.hxx104
-rw-r--r--include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx212
-rw-r--r--include/drawinglayer/primitive2d/textlayoutdevice.hxx155
-rw-r--r--include/drawinglayer/primitive2d/textlineprimitive2d.hxx84
-rw-r--r--include/drawinglayer/primitive2d/textprimitive2d.hxx181
-rw-r--r--include/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx152
-rw-r--r--include/drawinglayer/primitive2d/transformprimitive2d.hxx84
-rw-r--r--include/drawinglayer/primitive2d/transparenceprimitive2d.hxx88
-rw-r--r--include/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx76
-rw-r--r--include/drawinglayer/primitive2d/wallpaperprimitive2d.hxx87
-rw-r--r--include/drawinglayer/primitive2d/wrongspellprimitive2d.hxx92
-rw-r--r--include/drawinglayer/primitive3d/baseprimitive3d.hxx213
-rw-r--r--include/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx55
-rw-r--r--include/drawinglayer/primitive3d/groupprimitive3d.hxx81
-rw-r--r--include/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx86
-rw-r--r--include/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx66
-rw-r--r--include/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx69
-rw-r--r--include/drawinglayer/primitive3d/polygonprimitive3d.hxx129
-rw-r--r--include/drawinglayer/primitive3d/polygontubeprimitive3d.hxx108
-rw-r--r--include/drawinglayer/primitive3d/polypolygonprimitive3d.hxx83
-rw-r--r--include/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx69
-rw-r--r--include/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx98
-rw-r--r--include/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx137
-rw-r--r--include/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx129
-rw-r--r--include/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx147
-rw-r--r--include/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx81
-rw-r--r--include/drawinglayer/primitive3d/sdrprimitive3d.hxx88
-rw-r--r--include/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx80
-rw-r--r--include/drawinglayer/primitive3d/shadowprimitive3d.hxx84
-rw-r--r--include/drawinglayer/primitive3d/textureprimitive3d.hxx230
-rw-r--r--include/drawinglayer/primitive3d/transformprimitive3d.hxx74
-rw-r--r--include/drawinglayer/processor2d/baseprocessor2d.hxx196
-rw-r--r--include/drawinglayer/processor2d/canvasprocessor.hxx122
-rw-r--r--include/drawinglayer/processor2d/contourextractor2d.hxx68
-rw-r--r--include/drawinglayer/processor2d/hittestprocessor2d.hxx108
-rw-r--r--include/drawinglayer/processor2d/linegeometryextractor2d.hxx66
-rw-r--r--include/drawinglayer/processor2d/objectinfoextractor2d.hxx61
-rw-r--r--include/drawinglayer/processor2d/processorfromoutputdevice.hxx55
-rw-r--r--include/drawinglayer/processor2d/textaspolygonextractor2d.hxx98
-rw-r--r--include/drawinglayer/processor2d/vclmetafileprocessor2d.hxx151
-rw-r--r--include/drawinglayer/processor2d/vclpixelprocessor2d.hxx63
-rw-r--r--include/drawinglayer/processor2d/vclprocessor2d.hxx136
-rw-r--r--include/drawinglayer/processor3d/baseprocessor3d.hxx75
-rw-r--r--include/drawinglayer/processor3d/cutfindprocessor3d.hxx91
-rw-r--r--include/drawinglayer/processor3d/defaultprocessor3d.hxx158
-rw-r--r--include/drawinglayer/processor3d/geometry2dextractor.hxx75
-rw-r--r--include/drawinglayer/processor3d/shadow3dextractor.hxx110
-rw-r--r--include/drawinglayer/processor3d/zbufferprocessor3d.hxx113
-rw-r--r--include/drawinglayer/texture/texture.hxx260
-rw-r--r--include/drawinglayer/texture/texture3d.hxx159
-rw-r--r--include/drawinglayer/tools/converters.hxx47
-rw-r--r--include/editeng/AccessibleComponentBase.hxx141
-rw-r--r--include/editeng/AccessibleContextBase.hxx388
-rw-r--r--include/editeng/AccessibleEditableTextPara.hxx386
-rw-r--r--include/editeng/AccessibleImageBullet.hxx219
-rw-r--r--include/editeng/AccessibleParaManager.hxx334
-rw-r--r--include/editeng/AccessibleSelectionBase.hxx67
-rw-r--r--include/editeng/AccessibleStaticTextBase.hxx277
-rw-r--r--include/editeng/AccessibleStringWrap.hxx57
-rw-r--r--include/editeng/LatinLookupTree.hxx74
-rw-r--r--include/editeng/LatinTreeNode.hxx48
-rw-r--r--include/editeng/LookupTree.hxx95
-rw-r--r--include/editeng/Node.hxx102
-rw-r--r--include/editeng/SpellPortions.hxx89
-rw-r--r--include/editeng/TreeHead.hxx49
-rw-r--r--include/editeng/UnoForbiddenCharsTable.hxx59
-rw-r--r--include/editeng/acorrcfg.hxx121
-rw-r--r--include/editeng/adjustitem.hxx130
-rw-r--r--include/editeng/autokernitem.hxx61
-rw-r--r--include/editeng/blinkitem.hxx59
-rw-r--r--include/editeng/borderline.hxx169
-rw-r--r--include/editeng/boxitem.hxx226
-rw-r--r--include/editeng/brushitem.hxx125
-rw-r--r--include/editeng/bulletitem.hxx146
-rw-r--r--include/editeng/charhiddenitem.hxx53
-rw-r--r--include/editeng/charreliefitem.hxx68
-rw-r--r--include/editeng/charrotateitem.hxx81
-rw-r--r--include/editeng/charscaleitem.hxx67
-rw-r--r--include/editeng/charsetcoloritem.hxx66
-rw-r--r--include/editeng/cmapitem.hxx76
-rw-r--r--include/editeng/colritem.hxx82
-rw-r--r--include/editeng/contouritem.hxx58
-rw-r--r--include/editeng/crossedoutitem.hxx79
-rw-r--r--include/editeng/editdata.hxx368
-rw-r--r--include/editeng/editeng.hxx586
-rw-r--r--include/editeng/editengdllapi.h34
-rw-r--r--include/editeng/editerr.hxx30
-rw-r--r--include/editeng/editids.hrc236
-rw-r--r--include/editeng/editobj.hxx130
-rw-r--r--include/editeng/editrids.hrc395
-rw-r--r--include/editeng/editstat.hxx139
-rw-r--r--include/editeng/editund2.hxx67
-rw-r--r--include/editeng/editview.hxx247
-rw-r--r--include/editeng/edtdlg.hxx102
-rw-r--r--include/editeng/eedata.hxx65
-rw-r--r--include/editeng/eeitem.hxx97
-rw-r--r--include/editeng/eeitemid.hxx129
-rw-r--r--include/editeng/eerdll.hxx55
-rw-r--r--include/editeng/emphasismarkitem.hxx73
-rw-r--r--include/editeng/escapementitem.hxx101
-rw-r--r--include/editeng/fhgtitem.hxx103
-rw-r--r--include/editeng/fieldupdater.hxx47
-rw-r--r--include/editeng/flditem.hxx420
-rw-r--r--include/editeng/flstitem.hxx70
-rw-r--r--include/editeng/fontitem.hxx98
-rw-r--r--include/editeng/forbiddencharacterstable.hxx56
-rw-r--r--include/editeng/forbiddenruleitem.hxx60
-rw-r--r--include/editeng/formatbreakitem.hxx90
-rw-r--r--include/editeng/frmdir.hxx53
-rw-r--r--include/editeng/frmdiritem.hxx68
-rw-r--r--include/editeng/fwdtitem.hxx98
-rw-r--r--include/editeng/hangulhanja.hxx288
-rw-r--r--include/editeng/hngpnctitem.hxx60
-rw-r--r--include/editeng/hyphenzoneitem.hxx93
-rw-r--r--include/editeng/itemtype.hxx64
-rw-r--r--include/editeng/justifyitem.hxx119
-rw-r--r--include/editeng/keepitem.hxx65
-rw-r--r--include/editeng/kernitem.hxx67
-rw-r--r--include/editeng/langitem.hxx71
-rw-r--r--include/editeng/lcolitem.hxx54
-rw-r--r--include/editeng/lineitem.hxx75
-rw-r--r--include/editeng/lrspitem.hxx165
-rw-r--r--include/editeng/lspcitem.hxx107
-rw-r--r--include/editeng/macros.hxx17
-rw-r--r--include/editeng/measfld.hxx57
-rw-r--r--include/editeng/memberids.hrc185
-rw-r--r--include/editeng/mutxhelp.hxx37
-rw-r--r--include/editeng/nhypitem.hxx53
-rw-r--r--include/editeng/nlbkitem.hxx56
-rw-r--r--include/editeng/numdef.hxx23
-rw-r--r--include/editeng/numitem.hxx356
-rw-r--r--include/editeng/opaqitem.hxx68
-rw-r--r--include/editeng/optitems.hxx102
-rw-r--r--include/editeng/orphitem.hxx61
-rw-r--r--include/editeng/outliner.hxx1001
-rw-r--r--include/editeng/outlobj.hxx93
-rw-r--r--include/editeng/paperinf.hxx67
-rw-r--r--include/editeng/paragraphdata.hxx64
-rw-r--r--include/editeng/paravertalignitem.hxx69
-rw-r--r--include/editeng/pbinitem.hxx68
-rw-r--r--include/editeng/pgrditem.hxx55
-rw-r--r--include/editeng/pmdlitem.hxx77
-rw-r--r--include/editeng/postitem.hxx76
-rw-r--r--include/editeng/prntitem.hxx70
-rw-r--r--include/editeng/protitem.hxx90
-rw-r--r--include/editeng/prszitem.hxx59
-rw-r--r--include/editeng/rsiditem.hxx43
-rw-r--r--include/editeng/scriptspaceitem.hxx61
-rw-r--r--include/editeng/scripttypeitem.hxx82
-rw-r--r--include/editeng/shaditem.hxx98
-rw-r--r--include/editeng/shdditem.hxx61
-rw-r--r--include/editeng/sizeitem.hxx74
-rw-r--r--include/editeng/spltitem.hxx68
-rw-r--r--include/editeng/splwrap.hxx151
-rw-r--r--include/editeng/svxacorr.hxx441
-rw-r--r--include/editeng/svxenum.hxx239
-rw-r--r--include/editeng/svxfont.hxx119
-rw-r--r--include/editeng/svxrtf.hxx424
-rw-r--r--include/editeng/swafopt.hxx134
-rw-r--r--include/editeng/tstpitem.hxx161
-rw-r--r--include/editeng/twolinesitem.hxx77
-rw-r--r--include/editeng/txtrange.hxx112
-rw-r--r--include/editeng/udlnitem.hxx119
-rw-r--r--include/editeng/ulspitem.hxx104
-rw-r--r--include/editeng/unoedhlp.hxx161
-rw-r--r--include/editeng/unoedprx.hxx176
-rw-r--r--include/editeng/unoedsrc.hxx540
-rw-r--r--include/editeng/unofdesc.hxx46
-rw-r--r--include/editeng/unofield.hxx113
-rw-r--r--include/editeng/unofored.hxx93
-rw-r--r--include/editeng/unoforou.hxx122
-rw-r--r--include/editeng/unoipset.hxx78
-rw-r--r--include/editeng/unolingu.hxx192
-rw-r--r--include/editeng/unonames.hxx43
-rw-r--r--include/editeng/unonrule.hxx87
-rw-r--r--include/editeng/unopracc.hxx66
-rw-r--r--include/editeng/unoprnms.hxx372
-rw-r--r--include/editeng/unotext.hxx661
-rw-r--r--include/editeng/unoviwou.hxx57
-rw-r--r--include/editeng/wghtitem.hxx76
-rw-r--r--include/editeng/widwitem.hxx61
-rw-r--r--include/editeng/writingmodeitem.hxx57
-rw-r--r--include/editeng/wrlmitem.hxx62
-rw-r--r--include/editeng/xmlcnitm.hxx83
-rw-r--r--include/filter/dllapi.h40
-rw-r--r--include/filter/msfilter/countryid.hxx311
-rw-r--r--include/filter/msfilter/dffpropset.hxx70
-rw-r--r--include/filter/msfilter/dffrecordheader.hxx63
-rw-r--r--include/filter/msfilter/escherex.hxx1721
-rw-r--r--include/filter/msfilter/mscodec.hxx370
-rw-r--r--include/filter/msfilter/msdffimp.hxx809
-rw-r--r--include/filter/msfilter/msfilterdllapi.h35
-rw-r--r--include/filter/msfilter/msocximex.hxx106
-rw-r--r--include/filter/msfilter/msoleexp.hxx53
-rw-r--r--include/filter/msfilter/mstoolbar.hxx359
-rw-r--r--include/filter/msfilter/msvbahelper.hxx106
-rw-r--r--include/filter/msfilter/rtfutil.hxx52
-rw-r--r--include/filter/msfilter/svdfppt.hxx1564
-rw-r--r--include/filter/msfilter/svxmsbas.hxx75
-rw-r--r--include/filter/msfilter/util.hxx81
-rw-r--r--include/formula/ExternalReferenceHelper.hxx41
-rw-r--r--include/formula/FormulaCompiler.hxx388
-rw-r--r--include/formula/FormulaOpCodeMapperObj.hxx84
-rw-r--r--include/formula/IControlReferenceHandler.hxx42
-rw-r--r--include/formula/IFunctionDescription.hxx170
-rw-r--r--include/formula/compiler.hrc423
-rw-r--r--include/formula/errorcodes.hxx119
-rw-r--r--include/formula/formdata.hxx83
-rw-r--r--include/formula/formula.hxx142
-rw-r--r--include/formula/formuladllapi.h34
-rw-r--r--include/formula/formulahelper.hxx80
-rw-r--r--include/formula/funcutl.hxx109
-rw-r--r--include/formula/grammar.hxx242
-rw-r--r--include/formula/omoduleclient.hxx43
-rw-r--r--include/formula/opcode.hxx420
-rw-r--r--include/formula/token.hxx428
-rw-r--r--include/formula/tokenarray.hxx287
-rw-r--r--include/framework/actiontriggerhelper.hxx67
-rw-r--r--include/framework/addonmenu.hxx127
-rw-r--r--include/framework/addonsoptions.hxx350
-rw-r--r--include/framework/bmkmenu.hxx69
-rw-r--r--include/framework/configimporter.hxx47
-rw-r--r--include/framework/documentundoguard.hxx63
-rw-r--r--include/framework/eventsconfiguration.hxx43
-rw-r--r--include/framework/framelistanalyzer.hxx195
-rw-r--r--include/framework/fwedllapi.h34
-rw-r--r--include/framework/iguard.hxx54
-rw-r--r--include/framework/imageproducer.hxx50
-rw-r--r--include/framework/imutex.hxx53
-rw-r--r--include/framework/interaction.hxx103
-rw-r--r--include/framework/menuconfiguration.hxx107
-rw-r--r--include/framework/menuextensionsupplier.hxx43
-rw-r--r--include/framework/preventduplicateinteraction.hxx236
-rw-r--r--include/framework/sfxhelperfunctions.hxx97
-rw-r--r--include/framework/statusbarconfiguration.hxx53
-rw-r--r--include/framework/titlehelper.hxx206
-rw-r--r--include/framework/toolboxconfiguration.hxx52
-rw-r--r--include/framework/undomanagerhelper.hxx159
-rw-r--r--include/i18nlangtag/i18nlangtagdllapi.h34
-rw-r--r--include/i18nlangtag/lang.h568
-rw-r--r--include/i18nlangtag/languagetag.hxx400
-rw-r--r--include/i18nlangtag/mslangid.hxx309
-rw-r--r--include/i18nutil/casefolding.hxx79
-rw-r--r--include/i18nutil/i18nutildllapi.h34
-rw-r--r--include/i18nutil/oneToOneMapping.hxx85
-rw-r--r--include/i18nutil/paper.hxx148
-rw-r--r--include/i18nutil/scripttypedetector.hxx38
-rw-r--r--include/i18nutil/unicode.hxx63
-rw-r--r--include/i18nutil/widthfolding.hxx54
-rw-r--r--include/jvmaccess/classpath.hxx139
-rw-r--r--include/jvmaccess/jvmaccessdllapi.h24
-rw-r--r--include/jvmaccess/unovirtualmachine.hxx104
-rw-r--r--include/jvmaccess/virtualmachine.hxx151
-rw-r--r--include/jvmfwk/framework.h835
-rw-r--r--include/jvmfwk/jvmfwkdllapi.h24
-rw-r--r--include/jvmfwk/jvmfwkplugindllapi.h24
-rw-r--r--include/jvmfwk/vendorplugin.h258
-rw-r--r--include/linguistic/hyphdta.hxx136
-rw-r--r--include/linguistic/lngdllapi.h35
-rw-r--r--include/linguistic/lngprophelp.hxx360
-rw-r--r--include/linguistic/lngprops.hxx55
-rw-r--r--include/linguistic/misc.hxx215
-rw-r--r--include/linguistic/spelldta.hxx117
-rw-r--r--include/o3tl/compat_functional.hxx151
-rw-r--r--include/o3tl/cow_wrapper.hxx322
-rw-r--r--include/o3tl/heap_ptr.hxx305
-rw-r--r--include/o3tl/lazy_update.hxx265
-rw-r--r--include/o3tl/range.hxx183
-rw-r--r--include/o3tl/sorted_vector.hxx237
-rw-r--r--include/o3tl/vector_pool.hxx123
-rw-r--r--include/oox/core/binarycodec.hxx316
-rw-r--r--include/oox/core/contexthandler.hxx117
-rw-r--r--include/oox/core/contexthandler2.hxx272
-rw-r--r--include/oox/core/fastparser.hxx97
-rw-r--r--include/oox/core/fasttokenhandler.hxx67
-rw-r--r--include/oox/core/filterbase.hxx293
-rw-r--r--include/oox/core/filterdetect.hxx162
-rw-r--r--include/oox/core/fragmenthandler.hxx131
-rw-r--r--include/oox/core/fragmenthandler2.hxx121
-rw-r--r--include/oox/core/recordparser.hxx90
-rw-r--r--include/oox/core/relations.hxx103
-rw-r--r--include/oox/core/relationshandler.hxx54
-rw-r--r--include/oox/core/xmlfilterbase.hxx256
-rw-r--r--include/oox/dllapi.h33
-rw-r--r--include/oox/drawingml/chart/axiscontext.hxx120
-rw-r--r--include/oox/drawingml/chart/axisconverter.hxx64
-rw-r--r--include/oox/drawingml/chart/axismodel.hxx105
-rw-r--r--include/oox/drawingml/chart/chartcontextbase.hxx95
-rw-r--r--include/oox/drawingml/chart/chartconverter.hxx104
-rw-r--r--include/oox/drawingml/chart/chartdrawingfragment.hxx115
-rw-r--r--include/oox/drawingml/chart/chartspaceconverter.hxx57
-rw-r--r--include/oox/drawingml/chart/chartspacefragment.hxx55
-rw-r--r--include/oox/drawingml/chart/chartspacemodel.hxx72
-rw-r--r--include/oox/drawingml/chart/converterbase.hxx153
-rw-r--r--include/oox/drawingml/chart/datasourcecontext.hxx94
-rw-r--r--include/oox/drawingml/chart/datasourceconverter.hxx71
-rw-r--r--include/oox/drawingml/chart/datasourcemodel.hxx65
-rw-r--r--include/oox/drawingml/chart/modelbase.hxx134
-rw-r--r--include/oox/drawingml/chart/objectformatter.hxx157
-rw-r--r--include/oox/drawingml/chart/plotareacontext.hxx83
-rw-r--r--include/oox/drawingml/chart/plotareaconverter.hxx103
-rw-r--r--include/oox/drawingml/chart/plotareamodel.hxx87
-rw-r--r--include/oox/drawingml/chart/seriescontext.hxx266
-rw-r--r--include/oox/drawingml/chart/seriesconverter.hxx167
-rw-r--r--include/oox/drawingml/chart/seriesmodel.hxx237
-rw-r--r--include/oox/drawingml/chart/titlecontext.hxx83
-rw-r--r--include/oox/drawingml/chart/titleconverter.hxx106
-rw-r--r--include/oox/drawingml/chart/titlemodel.hxx89
-rw-r--r--include/oox/drawingml/chart/typegroupcontext.hxx164
-rw-r--r--include/oox/drawingml/chart/typegroupconverter.hxx198
-rw-r--r--include/oox/drawingml/chart/typegroupmodel.hxx96
-rw-r--r--include/oox/drawingml/clrscheme.hxx62
-rw-r--r--include/oox/drawingml/clrschemecontext.hxx62
-rw-r--r--include/oox/drawingml/color.hxx144
-rw-r--r--include/oox/drawingml/colorchoicecontext.hxx80
-rw-r--r--include/oox/drawingml/connectorshapecontext.hxx41
-rw-r--r--include/oox/drawingml/customshapegeometry.hxx71
-rw-r--r--include/oox/drawingml/customshapeproperties.hxx189
-rw-r--r--include/oox/drawingml/diagram/diagram.hxx58
-rw-r--r--include/oox/drawingml/drawingmltypes.hxx200
-rw-r--r--include/oox/drawingml/effectproperties.hxx53
-rw-r--r--include/oox/drawingml/effectpropertiescontext.hxx41
-rw-r--r--include/oox/drawingml/embeddedwavaudiofile.hxx51
-rw-r--r--include/oox/drawingml/fillproperties.hxx152
-rw-r--r--include/oox/drawingml/fillpropertiesgroupcontext.hxx208
-rw-r--r--include/oox/drawingml/graphicshapecontext.hxx110
-rw-r--r--include/oox/drawingml/guidcontext.hxx43
-rw-r--r--include/oox/drawingml/lineproperties.hxx74
-rw-r--r--include/oox/drawingml/linepropertiescontext.hxx52
-rw-r--r--include/oox/drawingml/objectdefaultcontext.hxx43
-rw-r--r--include/oox/drawingml/scene3dcontext.hxx47
-rw-r--r--include/oox/drawingml/shape.hxx273
-rw-r--r--include/oox/drawingml/shape3dproperties.hxx125
-rw-r--r--include/oox/drawingml/shapecontext.hxx53
-rw-r--r--include/oox/drawingml/shapegroupcontext.hxx46
-rw-r--r--include/oox/drawingml/shapepropertiescontext.hxx43
-rw-r--r--include/oox/drawingml/shapepropertymap.hxx147
-rw-r--r--include/oox/drawingml/shapestylecontext.hxx45
-rw-r--r--include/oox/drawingml/spdefcontext.hxx42
-rw-r--r--include/oox/drawingml/table/tablebackgroundstylecontext.hxx47
-rw-r--r--include/oox/drawingml/table/tablecell.hxx115
-rw-r--r--include/oox/drawingml/table/tablecellcontext.hxx48
-rw-r--r--include/oox/drawingml/table/tablecontext.hxx48
-rw-r--r--include/oox/drawingml/table/tablepartstylecontext.hxx47
-rw-r--r--include/oox/drawingml/table/tableproperties.hxx80
-rw-r--r--include/oox/drawingml/table/tablerow.hxx49
-rw-r--r--include/oox/drawingml/table/tablerowcontext.hxx49
-rw-r--r--include/oox/drawingml/table/tablestyle.hxx85
-rw-r--r--include/oox/drawingml/table/tablestylecellstylecontext.hxx48
-rw-r--r--include/oox/drawingml/table/tablestylecontext.hxx49
-rw-r--r--include/oox/drawingml/table/tablestylelist.hxx54
-rw-r--r--include/oox/drawingml/table/tablestylelistfragmenthandler.hxx56
-rw-r--r--include/oox/drawingml/table/tablestylepart.hxx73
-rw-r--r--include/oox/drawingml/table/tablestyletextstylecontext.hxx49
-rw-r--r--include/oox/drawingml/textbody.hxx73
-rw-r--r--include/oox/drawingml/textbodycontext.hxx63
-rw-r--r--include/oox/drawingml/textbodyproperties.hxx56
-rw-r--r--include/oox/drawingml/textbodypropertiescontext.hxx47
-rw-r--r--include/oox/drawingml/textcharacterproperties.hxx84
-rw-r--r--include/oox/drawingml/textcharacterpropertiescontext.hxx48
-rw-r--r--include/oox/drawingml/textfield.hxx62
-rw-r--r--include/oox/drawingml/textfieldcontext.hxx52
-rw-r--r--include/oox/drawingml/textfont.hxx73
-rw-r--r--include/oox/drawingml/textliststyle.hxx61
-rw-r--r--include/oox/drawingml/textliststylecontext.hxx45
-rw-r--r--include/oox/drawingml/textparagraph.hxx73
-rw-r--r--include/oox/drawingml/textparagraphproperties.hxx128
-rw-r--r--include/oox/drawingml/textparagraphpropertiescontext.hxx58
-rw-r--r--include/oox/drawingml/textrun.hxx62
-rw-r--r--include/oox/drawingml/textspacing.hxx69
-rw-r--r--include/oox/drawingml/theme.hxx116
-rw-r--r--include/oox/drawingml/themeelementscontext.hxx51
-rw-r--r--include/oox/drawingml/themefragmenthandler.hxx55
-rw-r--r--include/oox/drawingml/transform2dcontext.hxx52
-rw-r--r--include/oox/dump/dffdumper.hxx70
-rw-r--r--include/oox/dump/dumperbase.hxx1871
-rw-r--r--include/oox/dump/oledumper.hxx905
-rw-r--r--include/oox/dump/pptxdumper.hxx71
-rw-r--r--include/oox/dump/xlsbdumper.hxx136
-rw-r--r--include/oox/export/chartexport.hxx204
-rw-r--r--include/oox/export/drawingml.hxx160
-rw-r--r--include/oox/export/shapes.hxx170
-rw-r--r--include/oox/export/utils.hxx59
-rw-r--r--include/oox/export/vmlexport.hxx132
-rw-r--r--include/oox/helper/attributelist.hxx170
-rw-r--r--include/oox/helper/binaryinputstream.hxx438
-rw-r--r--include/oox/helper/binaryoutputstream.hxx189
-rw-r--r--include/oox/helper/binarystreambase.hxx187
-rw-r--r--include/oox/helper/containerhelper.hxx410
-rw-r--r--include/oox/helper/graphichelper.hxx168
-rw-r--r--include/oox/helper/helper.hxx334
-rw-r--r--include/oox/helper/modelobjecthelper.hxx125
-rw-r--r--include/oox/helper/progressbar.hxx138
-rw-r--r--include/oox/helper/propertymap.hxx111
-rw-r--r--include/oox/helper/propertyset.hxx146
-rw-r--r--include/oox/helper/refmap.hxx185
-rw-r--r--include/oox/helper/refvector.hxx195
-rw-r--r--include/oox/helper/storagebase.hxx191
-rw-r--r--include/oox/helper/textinputstream.hxx122
-rw-r--r--include/oox/helper/zipstorage.hxx88
-rw-r--r--include/oox/mathml/export.hxx40
-rw-r--r--include/oox/mathml/import.hxx46
-rw-r--r--include/oox/mathml/importutils.hxx254
-rw-r--r--include/oox/ole/axbinaryreader.hxx257
-rw-r--r--include/oox/ole/axbinarywriter.hxx194
-rw-r--r--include/oox/ole/axcontrol.hxx1031
-rw-r--r--include/oox/ole/axcontrolfragment.hxx74
-rw-r--r--include/oox/ole/axfontdata.hxx81
-rw-r--r--include/oox/ole/olehelper.hxx203
-rw-r--r--include/oox/ole/oleobjecthelper.hxx79
-rw-r--r--include/oox/ole/olestorage.hxx110
-rw-r--r--include/oox/ole/vbacontrol.hxx205
-rw-r--r--include/oox/ole/vbahelper.hxx98
-rw-r--r--include/oox/ole/vbainputstream.hxx74
-rw-r--r--include/oox/ole/vbamodule.hxx109
-rw-r--r--include/oox/ole/vbaproject.hxx206
-rw-r--r--include/oox/ppt/animationspersist.hxx126
-rw-r--r--include/oox/ppt/backgroundproperties.hxx44
-rw-r--r--include/oox/ppt/comments.hxx139
-rw-r--r--include/oox/ppt/customshowlistcontext.hxx53
-rw-r--r--include/oox/ppt/dgmimport.hxx62
-rw-r--r--include/oox/ppt/dgmlayout.hxx63
-rw-r--r--include/oox/ppt/headerfooter.hxx45
-rw-r--r--include/oox/ppt/layoutfragmenthandler.hxx42
-rw-r--r--include/oox/ppt/pptgraphicshapecontext.hxx40
-rw-r--r--include/oox/ppt/pptimport.hxx91
-rw-r--r--include/oox/ppt/pptshape.hxx73
-rw-r--r--include/oox/ppt/pptshapecontext.hxx40
-rw-r--r--include/oox/ppt/pptshapegroupcontext.hxx56
-rw-r--r--include/oox/ppt/pptshapepropertiescontext.hxx40
-rw-r--r--include/oox/ppt/presentationfragmenthandler.hxx72
-rw-r--r--include/oox/ppt/slidefragmenthandler.hxx60
-rw-r--r--include/oox/ppt/slidemastertextstylescontext.hxx45
-rw-r--r--include/oox/ppt/slidepersist.hxx161
-rw-r--r--include/oox/ppt/slidetimingcontext.hxx48
-rw-r--r--include/oox/ppt/slidetransition.hxx72
-rw-r--r--include/oox/ppt/slidetransitioncontext.hxx52
-rw-r--r--include/oox/ppt/soundactioncontext.hxx55
-rw-r--r--include/oox/ppt/timenode.hxx128
-rw-r--r--include/oox/ppt/timenodelistcontext.hxx65
-rw-r--r--include/oox/token/namespacemap.hxx43
-rw-r--r--include/oox/token/propertynames.hxx43
-rw-r--r--include/oox/token/tokenmap.hxx73
-rw-r--r--include/oox/vml/vmldrawing.hxx213
-rw-r--r--include/oox/vml/vmldrawingfragment.hxx60
-rw-r--r--include/oox/vml/vmlformatting.hxx248
-rw-r--r--include/oox/vml/vmlinputstream.hxx98
-rw-r--r--include/oox/vml/vmlshape.hxx439
-rw-r--r--include/oox/vml/vmlshapecontainer.hxx153
-rw-r--r--include/oox/vml/vmlshapecontext.hxx188
-rw-r--r--include/oox/vml/vmltextbox.hxx104
-rw-r--r--include/oox/vml/vmltextboxcontext.hxx78
-rw-r--r--include/package/Deflater.hxx65
-rw-r--r--include/package/Inflater.hxx57
-rw-r--r--include/package/packagedllapi.hxx22
-rw-r--r--include/registry/reader.h603
-rw-r--r--include/registry/reader.hxx624
-rw-r--r--include/registry/reflread.hxx513
-rw-r--r--include/registry/refltype.hxx80
-rw-r--r--include/registry/reflwrit.hxx350
-rw-r--r--include/registry/regdllapi.h33
-rw-r--r--include/registry/registry.h456
-rw-r--r--include/registry/registry.hxx1257
-rw-r--r--include/registry/regtype.h168
-rw-r--r--include/registry/types.h334
-rw-r--r--include/registry/version.h69
-rw-r--r--include/registry/writer.h262
-rw-r--r--include/registry/writer.hxx291
-rw-r--r--include/rsc/rsc-vcl-shared-types.hxx133
-rw-r--r--include/rsc/rscsfx.hxx56
-rw-r--r--include/sax/fastattribs.hxx85
-rw-r--r--include/sax/fshelper.hxx199
-rw-r--r--include/sax/saxdllapi.h33
-rw-r--r--include/sax/tools/converter.hxx206
-rw-r--r--include/sax/tools/documenthandleradapter.hxx254
-rw-r--r--include/sfx2/DocumentMetadataAccess.hxx208
-rw-r--r--include/sfx2/Metadatable.hxx181
-rw-r--r--include/sfx2/QuerySaveDocument.hxx38
-rw-r--r--include/sfx2/XmlIdRegistry.hxx84
-rw-r--r--include/sfx2/app.hxx278
-rw-r--r--include/sfx2/appuno.hxx108
-rw-r--r--include/sfx2/basedlgs.hxx238
-rw-r--r--include/sfx2/bindings.hxx248
-rw-r--r--include/sfx2/brokenpackageint.hxx48
-rw-r--r--include/sfx2/chalign.hxx57
-rw-r--r--include/sfx2/checkin.hxx35
-rw-r--r--include/sfx2/childwin.hxx370
-rw-r--r--include/sfx2/cntids.hrc49
-rw-r--r--include/sfx2/controlwrapper.hxx644
-rw-r--r--include/sfx2/ctrlitem.hxx100
-rw-r--r--include/sfx2/dialogs.hrc30
-rw-r--r--include/sfx2/dinfdlg.hxx501
-rw-r--r--include/sfx2/dinfedt.hxx40
-rw-r--r--include/sfx2/dispatch.hxx308
-rw-r--r--include/sfx2/dllapi.h36
-rw-r--r--include/sfx2/docfac.hxx125
-rw-r--r--include/sfx2/docfile.hxx286
-rw-r--r--include/sfx2/docfilt.hxx126
-rw-r--r--include/sfx2/docinf.hxx74
-rw-r--r--include/sfx2/docinsert.hxx71
-rw-r--r--include/sfx2/dockwin.hxx130
-rw-r--r--include/sfx2/docmacromode.hxx328
-rw-r--r--include/sfx2/docstoragemodifylistener.hxx86
-rw-r--r--include/sfx2/doctempl.hxx139
-rw-r--r--include/sfx2/event.hxx136
-rw-r--r--include/sfx2/evntconf.hxx120
-rw-r--r--include/sfx2/fcontnr.hxx153
-rw-r--r--include/sfx2/filedlghelper.hxx262
-rw-r--r--include/sfx2/frame.hxx290
-rw-r--r--include/sfx2/frmdescr.hxx259
-rw-r--r--include/sfx2/frmhtml.hxx47
-rw-r--r--include/sfx2/frmhtmlw.hxx82
-rw-r--r--include/sfx2/genlink.hxx50
-rw-r--r--include/sfx2/hintpost.hxx68
-rw-r--r--include/sfx2/htmlmode.hxx32
-rw-r--r--include/sfx2/imagemgr.hxx34
-rw-r--r--include/sfx2/imgmgr.hxx53
-rw-r--r--include/sfx2/infobar.hxx83
-rw-r--r--include/sfx2/ipclient.hxx95
-rw-r--r--include/sfx2/itemconnect.hxx578
-rw-r--r--include/sfx2/itemwrapper.hxx206
-rw-r--r--include/sfx2/linkmgr.hxx195
-rw-r--r--include/sfx2/linksrc.hxx121
-rw-r--r--include/sfx2/lnkbase.hxx176
-rw-r--r--include/sfx2/macropg.hxx137
-rw-r--r--include/sfx2/mailmodelapi.hxx136
-rw-r--r--include/sfx2/mgetempl.hxx93
-rw-r--r--include/sfx2/mieclip.hxx56
-rw-r--r--include/sfx2/minfitem.hxx72
-rw-r--r--include/sfx2/mnuitem.hxx121
-rw-r--r--include/sfx2/mnumgr.hxx111
-rw-r--r--include/sfx2/module.hxx115
-rw-r--r--include/sfx2/msg.hxx333
-rw-r--r--include/sfx2/msgpool.hxx84
-rw-r--r--include/sfx2/navigat.hxx55
-rw-r--r--include/sfx2/new.hxx75
-rw-r--r--include/sfx2/newstyle.hxx56
-rw-r--r--include/sfx2/objface.hxx125
-rw-r--r--include/sfx2/objitem.hxx47
-rw-r--r--include/sfx2/objsh.hxx824
-rw-r--r--include/sfx2/opengrf.hxx58
-rw-r--r--include/sfx2/passwd.hxx123
-rw-r--r--include/sfx2/printer.hxx75
-rw-r--r--include/sfx2/printopt.hxx109
-rw-r--r--include/sfx2/prnmon.hxx60
-rw-r--r--include/sfx2/progress.hxx74
-rw-r--r--include/sfx2/querystatus.hxx55
-rw-r--r--include/sfx2/request.hxx125
-rw-r--r--include/sfx2/securitypage.hxx49
-rw-r--r--include/sfx2/sfx.hrc289
-rw-r--r--include/sfx2/sfxbasecontroller.hxx386
-rw-r--r--include/sfx2/sfxbasemodel.hxx1554
-rw-r--r--include/sfx2/sfxcommands.h70
-rw-r--r--include/sfx2/sfxdefs.hxx27
-rw-r--r--include/sfx2/sfxdlg.hxx158
-rw-r--r--include/sfx2/sfxhelp.hxx65
-rw-r--r--include/sfx2/sfxhtml.hxx112
-rw-r--r--include/sfx2/sfxmodelfactory.hxx67
-rw-r--r--include/sfx2/sfxresid.hxx37
-rw-r--r--include/sfx2/sfxsids.hrc753
-rw-r--r--include/sfx2/sfxstatuslistener.hxx88
-rw-r--r--include/sfx2/sfxuno.hxx638
-rw-r--r--include/sfx2/shell.hxx371
-rw-r--r--include/sfx2/signaturestate.hxx38
-rw-r--r--include/sfx2/stbitem.hxx142
-rw-r--r--include/sfx2/styfitem.hxx99
-rw-r--r--include/sfx2/styledlg.hxx52
-rw-r--r--include/sfx2/tabdlg.hxx306
-rw-r--r--include/sfx2/tabpage.hrc33
-rw-r--r--include/sfx2/taskpane.hxx233
-rw-r--r--include/sfx2/tbxctrl.hxx412
-rw-r--r--include/sfx2/templateabstractview.hxx147
-rw-r--r--include/sfx2/templatecontaineritem.hxx46
-rw-r--r--include/sfx2/templateinfodlg.hxx50
-rw-r--r--include/sfx2/templatelocalview.hxx104
-rw-r--r--include/sfx2/templatelocnames.hrc54
-rw-r--r--include/sfx2/templateproperties.hxx29
-rw-r--r--include/sfx2/templateremoteview.hxx48
-rw-r--r--include/sfx2/templaterepository.hxx46
-rw-r--r--include/sfx2/templateviewitem.hxx61
-rw-r--r--include/sfx2/templdlg.hxx84
-rw-r--r--include/sfx2/thumbnailview.hxx332
-rw-r--r--include/sfx2/thumbnailviewitem.hxx134
-rw-r--r--include/sfx2/titledockwin.hxx161
-rw-r--r--include/sfx2/tplpitem.hxx51
-rw-r--r--include/sfx2/unoctitm.hxx198
-rw-r--r--include/sfx2/userinputinterception.hxx75
-rw-r--r--include/sfx2/viewfac.hxx61
-rw-r--r--include/sfx2/viewfrm.hxx335
-rw-r--r--include/sfx2/viewsh.hxx343
-rw-r--r--include/sfx2/zoomitem.hxx83
-rw-r--r--include/shell/kde_headers.h99
-rw-r--r--include/shell/tde_defines.h109
-rw-r--r--include/shell/tde_headers.h97
-rw-r--r--include/sot/exchange.hxx224
-rw-r--r--include/sot/factory.hxx76
-rw-r--r--include/sot/filelist.hxx65
-rw-r--r--include/sot/formats.hxx182
-rw-r--r--include/sot/object.hxx307
-rw-r--r--include/sot/sotdata.hxx57
-rw-r--r--include/sot/sotdllapi.h34
-rw-r--r--include/sot/stg.hxx366
-rw-r--r--include/sot/storage.hxx223
-rw-r--r--include/sot/storinfo.hxx61
-rw-r--r--include/store/store.h405
-rw-r--r--include/store/store.hxx605
-rw-r--r--include/store/storedllapi.h32
-rw-r--r--include/store/types.h160
-rw-r--r--include/svl/PasswordHelper.hxx46
-rw-r--r--include/svl/adrparse.hxx78
-rw-r--r--include/svl/aeitem.hxx63
-rw-r--r--include/svl/asiancfg.hxx70
-rw-r--r--include/svl/brdcst.hxx68
-rw-r--r--include/svl/broadcast.hxx58
-rw-r--r--include/svl/cenumitm.hxx170
-rw-r--r--include/svl/cintitem.hxx274
-rw-r--r--include/svl/cjkoptions.hxx70
-rw-r--r--include/svl/cntwall.hxx71
-rw-r--r--include/svl/cntwids.hrc208
-rw-r--r--include/svl/converter.hxx36
-rw-r--r--include/svl/ctloptions.hxx87
-rw-r--r--include/svl/ctypeitm.hxx73
-rw-r--r--include/svl/custritm.hxx85
-rw-r--r--include/svl/dateitem.hxx76
-rw-r--r--include/svl/documentlockfile.hxx63
-rw-r--r--include/svl/eitem.hxx62
-rw-r--r--include/svl/filenotation.hxx64
-rw-r--r--include/svl/filerec.hxx1031
-rw-r--r--include/svl/flagitem.hxx69
-rw-r--r--include/svl/folderrestriction.hxx47
-rw-r--r--include/svl/fstathelper.hxx59
-rw-r--r--include/svl/globalnameitem.hxx52
-rw-r--r--include/svl/hint.hxx59
-rw-r--r--include/svl/ilstitem.hxx56
-rw-r--r--include/svl/imageitm.hxx51
-rw-r--r--include/svl/inethist.hxx125
-rw-r--r--include/svl/inettype.hxx304
-rw-r--r--include/svl/instrm.hxx73
-rw-r--r--include/svl/intitem.hxx163
-rw-r--r--include/svl/isethint.hxx45
-rw-r--r--include/svl/itemiter.hxx61
-rw-r--r--include/svl/itempool.hxx259
-rw-r--r--include/svl/itemprop.hxx203
-rw-r--r--include/svl/itemset.hxx191
-rw-r--r--include/svl/languageoptions.hxx113
-rw-r--r--include/svl/lckbitem.hxx56
-rw-r--r--include/svl/listener.hxx58
-rw-r--r--include/svl/listeneriter.hxx65
-rw-r--r--include/svl/lngmisc.hxx56
-rw-r--r--include/svl/lockfilecommon.hxx69
-rw-r--r--include/svl/lstner.hxx69
-rw-r--r--include/svl/macitem.hxx215
-rw-r--r--include/svl/mailenum.hxx88
-rw-r--r--include/svl/memberid.hrc61
-rw-r--r--include/svl/metitem.hxx46
-rw-r--r--include/svl/nfkeytab.hxx122
-rw-r--r--include/svl/nfsymbol.hxx63
-rw-r--r--include/svl/nfversi.hxx64
-rw-r--r--include/svl/nranges.hxx65
-rw-r--r--include/svl/numuno.hxx92
-rw-r--r--include/svl/ondemand.hxx384
-rw-r--r--include/svl/outstrm.hxx59
-rw-r--r--include/svl/ownlist.hxx90
-rw-r--r--include/svl/pickerhistoryaccess.hxx45
-rw-r--r--include/svl/poolcach.hxx62
-rw-r--r--include/svl/poolitem.hxx415
-rw-r--r--include/svl/ptitem.hxx70
-rw-r--r--include/svl/rectitem.hxx69
-rw-r--r--include/svl/restrictedpaths.hxx75
-rw-r--r--include/svl/rngitem.hxx83
-rw-r--r--include/svl/sfontitm.hxx207
-rw-r--r--include/svl/sharecontrolfile.hxx77
-rw-r--r--include/svl/slstitm.hxx73
-rw-r--r--include/svl/smplhint.hxx93
-rw-r--r--include/svl/solar.hrc207
-rw-r--r--include/svl/srchdefs.hxx42
-rw-r--r--include/svl/srchitem.hxx287
-rw-r--r--include/svl/stritem.hxx48
-rw-r--r--include/svl/strmadpt.hxx127
-rw-r--r--include/svl/style.hrc34
-rw-r--r--include/svl/style.hxx386
-rw-r--r--include/svl/stylepool.hxx91
-rw-r--r--include/svl/stylesheetuser.hxx38
-rw-r--r--include/svl/svdde.hxx416
-rw-r--r--include/svl/svl.hrc114
-rw-r--r--include/svl/svldllapi.h34
-rw-r--r--include/svl/szitem.hxx68
-rw-r--r--include/svl/undo.hxx474
-rw-r--r--include/svl/urihelper.hxx165
-rw-r--r--include/svl/urlbmk.hxx62
-rw-r--r--include/svl/urlfilter.hxx56
-rw-r--r--include/svl/visitem.hxx87
-rw-r--r--include/svl/whiter.hxx48
-rw-r--r--include/svl/xmlement.hxx34
-rw-r--r--include/svl/zforlist.hxx1037
-rw-r--r--include/svl/zformat.hxx712
-rw-r--r--include/svtools/AccessibleBrowseBoxObjType.hxx52
-rw-r--r--include/svtools/DocumentInfoPreview.hxx73
-rw-r--r--include/svtools/DocumentToGraphicRenderer.hxx62
-rw-r--r--include/svtools/GraphicExportOptionsDialog.hxx78
-rw-r--r--include/svtools/PlaceEditDialog.hxx92
-rw-r--r--include/svtools/QueryFolderName.hxx57
-rw-r--r--include/svtools/ServerDetailsControls.hxx148
-rw-r--r--include/svtools/acceleratorexecute.hxx246
-rw-r--r--include/svtools/accessibilityoptions.hxx72
-rw-r--r--include/svtools/accessiblefactory.hxx184
-rw-r--r--include/svtools/accessibletable.hxx203
-rw-r--r--include/svtools/accessibletableprovider.hxx241
-rw-r--r--include/svtools/addresstemplate.hxx144
-rw-r--r--include/svtools/apearcfg.hxx97
-rw-r--r--include/svtools/asynclink.hxx66
-rw-r--r--include/svtools/bindablecontrolhelper.hxx52
-rw-r--r--include/svtools/borderhelper.hxx47
-rw-r--r--include/svtools/brwbox.hxx831
-rw-r--r--include/svtools/brwhead.hxx46
-rw-r--r--include/svtools/calendar.hxx451
-rw-r--r--include/svtools/cliplistener.hxx54
-rw-r--r--include/svtools/collatorres.hxx42
-rw-r--r--include/svtools/colorcfg.hxx138
-rw-r--r--include/svtools/colrdlg.hxx60
-rw-r--r--include/svtools/contextmenuhelper.hxx116
-rw-r--r--include/svtools/controldims.hrc93
-rw-r--r--include/svtools/ctrlbox.hxx552
-rw-r--r--include/svtools/ctrltool.hxx241
-rw-r--r--include/svtools/dialogclosedlistener.hxx69
-rw-r--r--include/svtools/dialogcontrolling.hxx293
-rw-r--r--include/svtools/editbrowsebox.hxx685
-rw-r--r--include/svtools/editimplementation.hxx144
-rw-r--r--include/svtools/editsyntaxhighlighter.hxx56
-rw-r--r--include/svtools/ehdl.hxx77
-rw-r--r--include/svtools/embedhlp.hxx124
-rw-r--r--include/svtools/embedtransfer.hxx57
-rw-r--r--include/svtools/extcolorcfg.hxx111
-rw-r--r--include/svtools/extensionlistbox.hxx98
-rw-r--r--include/svtools/filechangedchecker.hxx54
-rw-r--r--include/svtools/filectrl.hxx96
-rw-r--r--include/svtools/filedlg2.hrc23
-rw-r--r--include/svtools/fileurlbox.hxx68
-rw-r--r--include/svtools/fileview.hxx258
-rw-r--r--include/svtools/fmtfield.hxx319
-rw-r--r--include/svtools/fontsubstconfig.hxx61
-rw-r--r--include/svtools/framestatuslistener.hxx101
-rw-r--r--include/svtools/generictoolboxcontroller.hxx61
-rw-r--r--include/svtools/genericunodialog.hxx185
-rw-r--r--include/svtools/grfmgr.hxx624
-rw-r--r--include/svtools/headbar.hxx377
-rw-r--r--include/svtools/helpid.hrc97
-rw-r--r--include/svtools/helpopt.hxx65
-rw-r--r--include/svtools/htmlcfg.hxx94
-rw-r--r--include/svtools/htmlkywd.hxx796
-rw-r--r--include/svtools/htmlout.hxx118
-rw-r--r--include/svtools/htmltokn.h561
-rw-r--r--include/svtools/hyperlabel.hxx87
-rw-r--r--include/svtools/imagemgr.hrc147
-rw-r--r--include/svtools/imagemgr.hxx79
-rw-r--r--include/svtools/imageresourceaccess.hxx81
-rw-r--r--include/svtools/imap.hxx151
-rw-r--r--include/svtools/imapcirc.hxx75
-rw-r--r--include/svtools/imapobj.hxx145
-rw-r--r--include/svtools/imappoly.hxx81
-rw-r--r--include/svtools/imaprect.hxx73
-rw-r--r--include/svtools/imgdef.hxx36
-rw-r--r--include/svtools/indexentryres.hxx42
-rw-r--r--include/svtools/inetimg.hxx78
-rw-r--r--include/svtools/inettbc.hxx97
-rw-r--r--include/svtools/insdlg.hxx79
-rw-r--r--include/svtools/itemdel.hxx30
-rw-r--r--include/svtools/ivctrl.hxx353
-rw-r--r--include/svtools/javacontext.hxx82
-rw-r--r--include/svtools/javainteractionhandler.hxx75
-rw-r--r--include/svtools/langhelp.hxx30
-rw-r--r--include/svtools/langtab.hxx57
-rw-r--r--include/svtools/localresaccess.hxx75
-rw-r--r--include/svtools/menuoptions.hxx128
-rw-r--r--include/svtools/miscopt.hxx150
-rw-r--r--include/svtools/optionsdrawinglayer.hxx198
-rw-r--r--include/svtools/parhtml.hxx289
-rw-r--r--include/svtools/parrtf.hxx85
-rw-r--r--include/svtools/place.hxx42
-rw-r--r--include/svtools/popupmenucontrollerbase.hxx131
-rw-r--r--include/svtools/popupwindowcontroller.hxx79
-rw-r--r--include/svtools/printoptions.hxx120
-rw-r--r--include/svtools/prnsetup.hxx93
-rw-r--r--include/svtools/restartdialog.hxx47
-rw-r--r--include/svtools/roadmap.hxx123
-rw-r--r--include/svtools/roadmapwizard.hxx246
-rw-r--r--include/svtools/rtfkeywd.hxx1212
-rw-r--r--include/svtools/rtfout.hxx58
-rw-r--r--include/svtools/rtftoken.h1265
-rw-r--r--include/svtools/ruler.hxx802
-rw-r--r--include/svtools/sampletext.hxx49
-rw-r--r--include/svtools/scriptedtext.hxx95
-rw-r--r--include/svtools/scrwin.hxx93
-rw-r--r--include/svtools/sfxecode.hxx113
-rw-r--r--include/svtools/slidesorterbaropt.hxx98
-rw-r--r--include/svtools/soerr.hxx74
-rw-r--r--include/svtools/sores.hxx103
-rw-r--r--include/svtools/statusbarcontroller.hxx141
-rw-r--r--include/svtools/stdctrl.hxx41
-rw-r--r--include/svtools/stdmenu.hxx161
-rw-r--r--include/svtools/stringtransfer.hxx76
-rw-r--r--include/svtools/svlbitm.hxx257
-rw-r--r--include/svtools/svmedit.hxx45
-rw-r--r--include/svtools/svmedit2.hxx46
-rw-r--r--include/svtools/svparser.hxx278
-rw-r--r--include/svtools/svtabbx.hxx255
-rw-r--r--include/svtools/svtdllapi.h34
-rw-r--r--include/svtools/svtools.hrc324
-rw-r--r--include/svtools/svtresid.hxx38
-rw-r--r--include/svtools/svxbox.hxx178
-rw-r--r--include/svtools/tabbar.hxx557
-rw-r--r--include/svtools/table/defaultinputhandler.hxx65
-rw-r--r--include/svtools/table/gridtablerenderer.hxx121
-rw-r--r--include/svtools/table/tablecontrol.hxx218
-rw-r--r--include/svtools/table/tablecontrolinterface.hxx257
-rw-r--r--include/svtools/table/tableinputhandler.hxx73
-rw-r--r--include/svtools/table/tablemodel.hxx539
-rw-r--r--include/svtools/table/tablerenderer.hxx285
-rw-r--r--include/svtools/table/tablesort.hxx89
-rw-r--r--include/svtools/table/tabletypes.hxx64
-rw-r--r--include/svtools/templatefoldercache.hxx102
-rw-r--r--include/svtools/templdlg.hxx81
-rw-r--r--include/svtools/textwindowpeer.hxx65
-rw-r--r--include/svtools/toolbarmenu.hxx140
-rw-r--r--include/svtools/toolboxcontroller.hxx162
-rw-r--r--include/svtools/toolpanel/decklayouter.hxx99
-rw-r--r--include/svtools/toolpanel/drawerlayouter.hxx97
-rw-r--r--include/svtools/toolpanel/paneltabbar.hxx96
-rw-r--r--include/svtools/toolpanel/refbase.hxx75
-rw-r--r--include/svtools/toolpanel/tabalignment.hxx42
-rw-r--r--include/svtools/toolpanel/tabitemcontent.hxx43
-rw-r--r--include/svtools/toolpanel/tablayouter.hxx99
-rw-r--r--include/svtools/toolpanel/toolpanel.hxx138
-rw-r--r--include/svtools/toolpanel/toolpaneldeck.hxx194
-rw-r--r--include/svtools/toolpanelopt.hxx99
-rw-r--r--include/svtools/transfer.hxx521
-rw-r--r--include/svtools/treelist.hxx366
-rw-r--r--include/svtools/treelistbox.hxx806
-rwxr-xr-xinclude/svtools/treelistentries.hxx20
-rw-r--r--include/svtools/treelistentry.hxx104
-rw-r--r--include/svtools/unitconv.hxx54
-rw-r--r--include/svtools/unoevent.hxx320
-rw-r--r--include/svtools/unoimap.hxx39
-rw-r--r--include/svtools/urlcontrol.hxx53
-rw-r--r--include/svtools/valueset.hxx391
-rw-r--r--include/svtools/viewdataentry.hxx81
-rw-r--r--include/svtools/wizardmachine.hxx385
-rw-r--r--include/svtools/wizdlg.hxx301
-rw-r--r--include/svtools/xwindowitem.hxx58
-rw-r--r--include/svx/AccessibleControlShape.hxx210
-rw-r--r--include/svx/AccessibleGraphicShape.hxx117
-rw-r--r--include/svx/AccessibleOLEShape.hxx123
-rw-r--r--include/svx/AccessibleShape.hxx397
-rw-r--r--include/svx/AccessibleShapeInfo.hxx103
-rw-r--r--include/svx/AccessibleShapeTreeInfo.hxx197
-rw-r--r--include/svx/AccessibleTableShape.hxx126
-rw-r--r--include/svx/AccessibleTextHelper.hxx425
-rw-r--r--include/svx/ActionDescriptionProvider.hxx59
-rw-r--r--include/svx/ChildrenManager.hxx210
-rw-r--r--include/svx/DescriptionGenerator.hxx200
-rw-r--r--include/svx/EnhancedCustomShape2d.hxx228
-rw-r--r--include/svx/EnhancedCustomShapeFunctionParser.hxx208
-rw-r--r--include/svx/EnhancedCustomShapeGeometry.hxx95
-rw-r--r--include/svx/EnhancedCustomShapeTypeNames.hxx33
-rw-r--r--include/svx/IAccessibleParent.hxx89
-rw-r--r--include/svx/IAccessibleViewForwarder.hxx126
-rw-r--r--include/svx/IAccessibleViewForwarderListener.hxx70
-rw-r--r--include/svx/ParseContext.hxx80
-rw-r--r--include/svx/ShapeTypeHandler.hxx220
-rw-r--r--include/svx/SmartTagCtl.hxx78
-rw-r--r--include/svx/SmartTagItem.hxx87
-rw-r--r--include/svx/SmartTagMgr.hxx226
-rw-r--r--include/svx/SpellDialogChildWindow.hxx119
-rw-r--r--include/svx/SvxShapeTypes.hxx75
-rw-r--r--include/svx/UnoNamespaceMap.hxx36
-rw-r--r--include/svx/XPropertyTable.hxx39
-rw-r--r--include/svx/algitem.hxx122
-rw-r--r--include/svx/anchorid.hxx36
-rw-r--r--include/svx/bmpmask.hxx181
-rw-r--r--include/svx/camera3d.hxx78
-rw-r--r--include/svx/charmap.hxx134
-rw-r--r--include/svx/charthelper.hxx52
-rw-r--r--include/svx/checklbx.hxx81
-rw-r--r--include/svx/chrtitem.hxx334
-rw-r--r--include/svx/clipboardctl.hxx58
-rw-r--r--include/svx/clipfmtitem.hxx57
-rw-r--r--include/svx/colrctrl.hxx135
-rw-r--r--include/svx/compressgraphicdialog.hxx95
-rw-r--r--include/svx/connctrl.hxx66
-rw-r--r--include/svx/contdlg.hxx98
-rw-r--r--include/svx/ctredlin.hxx391
-rw-r--r--include/svx/cube3d.hxx88
-rw-r--r--include/svx/dataaccessdescriptor.hxx136
-rw-r--r--include/svx/databaselocationinput.hxx88
-rw-r--r--include/svx/databaseregistrationui.hxx47
-rw-r--r--include/svx/dbaexchange.hxx290
-rw-r--r--include/svx/dbaobjectex.hxx78
-rw-r--r--include/svx/dbcharsethelper.hxx59
-rw-r--r--include/svx/dbtoolsclient.hxx204
-rw-r--r--include/svx/def3d.hxx48
-rw-r--r--include/svx/deflt3d.hxx129
-rw-r--r--include/svx/dialcontrol.hxx140
-rw-r--r--include/svx/dialmgr.hxx39
-rw-r--r--include/svx/dialogs.hrc1031
-rw-r--r--include/svx/dlgctl3d.hxx204
-rw-r--r--include/svx/dlgctrl.hxx449
-rw-r--r--include/svx/dlgutil.hxx40
-rw-r--r--include/svx/drawitem.hxx213
-rw-r--r--include/svx/dstribut_enum.hxx42
-rw-r--r--include/svx/e3ditem.hxx65
-rw-r--r--include/svx/e3dsceneupdater.hxx68
-rw-r--r--include/svx/e3dundo.hxx112
-rw-r--r--include/svx/extedit.hxx53
-rw-r--r--include/svx/exthelpid.hrc34
-rw-r--r--include/svx/extrud3d.hxx102
-rw-r--r--include/svx/extrusionbar.hxx55
-rw-r--r--include/svx/extrusioncolorcontrol.hxx50
-rw-r--r--include/svx/f3dchild.hxx44
-rw-r--r--include/svx/fillctrl.hxx99
-rw-r--r--include/svx/flagsdef.hxx97
-rw-r--r--include/svx/float3d.hxx291
-rw-r--r--include/svx/fmdmod.hxx40
-rw-r--r--include/svx/fmdpage.hxx67
-rw-r--r--include/svx/fmglob.hxx59
-rw-r--r--include/svx/fmgridcl.hxx206
-rw-r--r--include/svx/fmgridif.hxx544
-rw-r--r--include/svx/fmmodel.hxx93
-rw-r--r--include/svx/fmobjfac.hxx44
-rw-r--r--include/svx/fmpage.hxx82
-rw-r--r--include/svx/fmresids.hrc227
-rw-r--r--include/svx/fmsearch.hxx77
-rw-r--r--include/svx/fmshell.hxx181
-rw-r--r--include/svx/fmsrccfg.hxx147
-rw-r--r--include/svx/fmsrcimp.hxx390
-rw-r--r--include/svx/fmtools.hxx225
-rw-r--r--include/svx/fmview.hxx164
-rw-r--r--include/svx/fntctl.hxx58
-rw-r--r--include/svx/fntctrl.hxx97
-rw-r--r--include/svx/fntszctl.hxx58
-rw-r--r--include/svx/fontlb.hxx105
-rw-r--r--include/svx/fontwork.hxx182
-rw-r--r--include/svx/fontworkbar.hxx55
-rw-r--r--include/svx/fontworkgallery.hxx124
-rw-r--r--include/svx/formatpaintbrushctrl.hxx67
-rw-r--r--include/svx/framebordertype.hxx58
-rw-r--r--include/svx/framelink.hxx699
-rw-r--r--include/svx/framelinkarray.hxx479
-rw-r--r--include/svx/frmdirlbox.hxx97
-rw-r--r--include/svx/frmsel.hxx202
-rw-r--r--include/svx/galbrws.hxx89
-rw-r--r--include/svx/galctrl.hxx167
-rw-r--r--include/svx/gallery.hxx120
-rw-r--r--include/svx/gallery1.hxx171
-rw-r--r--include/svx/galmisc.hxx223
-rw-r--r--include/svx/galtheme.hxx225
-rw-r--r--include/svx/globl3d.hxx42
-rw-r--r--include/svx/grafctrl.hxx183
-rw-r--r--include/svx/graphctl.hxx160
-rw-r--r--include/svx/graphichelper.hxx40
-rw-r--r--include/svx/grfcrop.hxx74
-rw-r--r--include/svx/grfflt.hxx61
-rw-r--r--include/svx/gridctrl.hxx606
-rw-r--r--include/svx/hdft.hxx127
-rw-r--r--include/svx/helperhittest3d.hxx102
-rw-r--r--include/svx/hlnkitem.hxx103
-rw-r--r--include/svx/hyperdlg.hxx49
-rw-r--r--include/svx/ifaceids.hxx38
-rw-r--r--include/svx/imapdlg.hxx180
-rw-r--r--include/svx/insctrl.hxx51
-rw-r--r--include/svx/ipolypolygoneditorcontroller.hxx72
-rw-r--r--include/svx/itemwin.hxx186
-rw-r--r--include/svx/itextprovider.hxx42
-rw-r--r--include/svx/langbox.hxx93
-rw-r--r--include/svx/lathe3d.hxx114
-rw-r--r--include/svx/layctrl.hxx69
-rw-r--r--include/svx/lboxctrl.hxx77
-rw-r--r--include/svx/linectrl.hxx168
-rw-r--r--include/svx/linkwarn.hxx47
-rw-r--r--include/svx/measctrl.hxx59
-rw-r--r--include/svx/modctrl.hxx59
-rw-r--r--include/svx/msdffdef.hxx1184
-rw-r--r--include/svx/numfmtsh.hxx229
-rw-r--r--include/svx/numinf.hxx87
-rw-r--r--include/svx/numvset.hxx117
-rw-r--r--include/svx/obj3d.hxx319
-rw-r--r--include/svx/objfac3d.hxx50
-rw-r--r--include/svx/ofaitem.hxx78
-rw-r--r--include/svx/optgenrl.hxx42
-rw-r--r--include/svx/optgrid.hxx170
-rw-r--r--include/svx/orienthelper.hxx121
-rw-r--r--include/svx/pagectrl.hxx164
-rw-r--r--include/svx/pageitem.hxx134
-rw-r--r--include/svx/paraprev.hxx102
-rw-r--r--include/svx/passwd.hxx71
-rw-r--r--include/svx/pfiledlg.hxx51
-rw-r--r--include/svx/polygn3d.hxx72
-rw-r--r--include/svx/polypolygoneditor.hxx68
-rw-r--r--include/svx/polysc3d.hxx45
-rw-r--r--include/svx/postattr.hxx122
-rw-r--r--include/svx/prtqry.hxx34
-rw-r--r--include/svx/pszctrl.hxx51
-rw-r--r--include/svx/rectenum.hxx40
-rw-r--r--include/svx/relfld.hxx55
-rw-r--r--include/svx/rotmodit.hxx62
-rw-r--r--include/svx/rubydialog.hxx177
-rw-r--r--include/svx/ruler.hxx259
-rw-r--r--include/svx/rulritem.hxx278
-rw-r--r--include/svx/scene3d.hxx239
-rw-r--r--include/svx/sdangitm.hxx49
-rw-r--r--include/svx/sdasaitm.hxx71
-rw-r--r--include/svx/sdasitm.hxx132
-rw-r--r--include/svx/sderitm.hxx36
-rw-r--r--include/svx/sdgcoitm.hxx80
-rw-r--r--include/svx/sdgcpitm.hxx48
-rw-r--r--include/svx/sdggaitm.hxx49
-rw-r--r--include/svx/sdginitm.hxx46
-rw-r--r--include/svx/sdgluitm.hxx63
-rw-r--r--include/svx/sdgmoitm.hxx56
-rw-r--r--include/svx/sdgtritm.hxx45
-rw-r--r--include/svx/sdmetitm.hxx51
-rw-r--r--include/svx/sdooitm.hxx48
-rw-r--r--include/svx/sdprcitm.hxx65
-rw-r--r--include/svx/sdr/animation/animationstate.hxx75
-rw-r--r--include/svx/sdr/animation/objectanimator.hxx49
-rw-r--r--include/svx/sdr/animation/scheduler.hxx148
-rw-r--r--include/svx/sdr/attribute/sdrfilltextattribute.hxx65
-rw-r--r--include/svx/sdr/attribute/sdrformtextattribute.hxx83
-rw-r--r--include/svx/sdr/attribute/sdrformtextoutlineattribute.hxx74
-rw-r--r--include/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx69
-rw-r--r--include/svx/sdr/attribute/sdrlineshadowtextattribute.hxx67
-rw-r--r--include/svx/sdr/attribute/sdrshadowtextattribute.hxx64
-rw-r--r--include/svx/sdr/attribute/sdrtextattribute.hxx122
-rw-r--r--include/svx/sdr/contact/displayinfo.hxx107
-rw-r--r--include/svx/sdr/contact/objectcontact.hxx221
-rw-r--r--include/svx/sdr/contact/objectcontactofobjlistpainter.hxx145
-rw-r--r--include/svx/sdr/contact/objectcontactofpageview.hxx144
-rw-r--r--include/svx/sdr/contact/viewcontact.hxx168
-rw-r--r--include/svx/sdr/contact/viewcontactofe3d.hxx109
-rw-r--r--include/svx/sdr/contact/viewcontactofe3dcube.hxx61
-rw-r--r--include/svx/sdr/contact/viewcontactofe3dextrude.hxx61
-rw-r--r--include/svx/sdr/contact/viewcontactofe3dlathe.hxx61
-rw-r--r--include/svx/sdr/contact/viewcontactofe3dpolygon.hxx61
-rw-r--r--include/svx/sdr/contact/viewcontactofe3dscene.hxx114
-rw-r--r--include/svx/sdr/contact/viewcontactofe3dsphere.hxx61
-rw-r--r--include/svx/sdr/contact/viewcontactofgraphic.hxx86
-rw-r--r--include/svx/sdr/contact/viewcontactofgroup.hxx67
-rw-r--r--include/svx/sdr/contact/viewcontactofmasterpagedescriptor.hxx77
-rw-r--r--include/svx/sdr/contact/viewcontactofpageobj.hxx68
-rw-r--r--include/svx/sdr/contact/viewcontactofsdrcaptionobj.hxx62
-rw-r--r--include/svx/sdr/contact/viewcontactofsdrcircobj.hxx62
-rw-r--r--include/svx/sdr/contact/viewcontactofsdredgeobj.hxx62
-rw-r--r--include/svx/sdr/contact/viewcontactofsdrmeasureobj.hxx62
-rw-r--r--include/svx/sdr/contact/viewcontactofsdrmediaobj.hxx83
-rw-r--r--include/svx/sdr/contact/viewcontactofsdrobj.hxx96
-rw-r--r--include/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx65
-rw-r--r--include/svx/sdr/contact/viewcontactofsdrole2obj.hxx77
-rw-r--r--include/svx/sdr/contact/viewcontactofsdrpage.hxx303
-rw-r--r--include/svx/sdr/contact/viewcontactofsdrpathobj.hxx62
-rw-r--r--include/svx/sdr/contact/viewcontactofsdrrectobj.hxx62
-rw-r--r--include/svx/sdr/contact/viewcontactoftextobj.hxx57
-rw-r--r--include/svx/sdr/contact/viewcontactofunocontrol.hxx92
-rw-r--r--include/svx/sdr/contact/viewcontactofvirtobj.hxx62
-rw-r--r--include/svx/sdr/contact/viewobjectcontact.hxx147
-rw-r--r--include/svx/sdr/contact/viewobjectcontactofe3d.hxx74
-rw-r--r--include/svx/sdr/contact/viewobjectcontactofe3dscene.hxx54
-rw-r--r--include/svx/sdr/contact/viewobjectcontactofgraphic.hxx73
-rw-r--r--include/svx/sdr/contact/viewobjectcontactofgroup.hxx54
-rw-r--r--include/svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx57
-rw-r--r--include/svx/sdr/contact/viewobjectcontactofpageobj.hxx63
-rw-r--r--include/svx/sdr/contact/viewobjectcontactofsdrmediaobj.hxx66
-rw-r--r--include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx62
-rw-r--r--include/svx/sdr/contact/viewobjectcontactofsdrole2obj.hxx54
-rw-r--r--include/svx/sdr/contact/viewobjectcontactofsdrpage.hxx238
-rw-r--r--include/svx/sdr/contact/viewobjectcontactofunocontrol.hxx131
-rw-r--r--include/svx/sdr/contact/viewobjectcontactredirector.hxx66
-rw-r--r--include/svx/sdr/event/eventhandler.hxx132
-rw-r--r--include/svx/sdr/overlay/overlayanimatedbitmapex.hxx92
-rw-r--r--include/svx/sdr/overlay/overlaybitmapex.hxx66
-rw-r--r--include/svx/sdr/overlay/overlaycrosshair.hxx51
-rw-r--r--include/svx/sdr/overlay/overlayhatchrect.hxx71
-rw-r--r--include/svx/sdr/overlay/overlayhelpline.hxx60
-rw-r--r--include/svx/sdr/overlay/overlayline.hxx59
-rw-r--r--include/svx/sdr/overlay/overlaymanager.hxx151
-rw-r--r--include/svx/sdr/overlay/overlaymanagerbuffered.hxx98
-rw-r--r--include/svx/sdr/overlay/overlayobject.hxx196
-rw-r--r--include/svx/sdr/overlay/overlayobjectcell.hxx62
-rw-r--r--include/svx/sdr/overlay/overlayobjectlist.hxx78
-rw-r--r--include/svx/sdr/overlay/overlaypolypolygon.hxx58
-rw-r--r--include/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx62
-rw-r--r--include/svx/sdr/overlay/overlayrollingrectangle.hxx75
-rw-r--r--include/svx/sdr/overlay/overlayselection.hxx87
-rw-r--r--include/svx/sdr/overlay/overlaytools.hxx270
-rw-r--r--include/svx/sdr/overlay/overlaytriangle.hxx62
-rw-r--r--include/svx/sdr/primitive2d/primitiveFactory2d.hxx76
-rw-r--r--include/svx/sdr/primitive2d/sdrattributecreator.hxx133
-rw-r--r--include/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx79
-rw-r--r--include/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx68
-rw-r--r--include/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx89
-rw-r--r--include/svx/sdr/primitive2d/sdrdecompositiontools.hxx80
-rw-r--r--include/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx112
-rw-r--r--include/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx76
-rw-r--r--include/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx125
-rw-r--r--include/svx/sdr/primitive2d/sdrole2primitive2d.hxx70
-rw-r--r--include/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx80
-rw-r--r--include/svx/sdr/primitive2d/sdrpathprimitive2d.hxx72
-rw-r--r--include/svx/sdr/primitive2d/sdrprimitivetools.hxx49
-rw-r--r--include/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx81
-rw-r--r--include/svx/sdr/primitive2d/sdrtextprimitive2d.hxx338
-rw-r--r--include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx56
-rw-r--r--include/svx/sdr/primitive3d/sdrattributecreator3d.hxx55
-rw-r--r--include/svx/sdr/properties/attributeproperties.hxx96
-rw-r--r--include/svx/sdr/properties/captionproperties.hxx67
-rw-r--r--include/svx/sdr/properties/circleproperties.hxx67
-rw-r--r--include/svx/sdr/properties/connectorproperties.hxx63
-rw-r--r--include/svx/sdr/properties/customshapeproperties.hxx86
-rw-r--r--include/svx/sdr/properties/defaultproperties.hxx104
-rw-r--r--include/svx/sdr/properties/e3dcompoundproperties.hxx71
-rw-r--r--include/svx/sdr/properties/e3dextrudeproperties.hxx58
-rw-r--r--include/svx/sdr/properties/e3dlatheproperties.hxx58
-rw-r--r--include/svx/sdr/properties/e3dproperties.hxx64
-rw-r--r--include/svx/sdr/properties/e3dsceneproperties.hxx88
-rw-r--r--include/svx/sdr/properties/e3dsphereproperties.hxx57
-rw-r--r--include/svx/sdr/properties/emptyproperties.hxx96
-rw-r--r--include/svx/sdr/properties/graphicproperties.hxx67
-rw-r--r--include/svx/sdr/properties/groupproperties.hxx121
-rw-r--r--include/svx/sdr/properties/itemsettools.hxx68
-rw-r--r--include/svx/sdr/properties/measureproperties.hxx67
-rw-r--r--include/svx/sdr/properties/oleproperties.hxx58
-rw-r--r--include/svx/sdr/properties/pageproperties.hxx73
-rw-r--r--include/svx/sdr/properties/properties.hxx193
-rw-r--r--include/svx/sdr/properties/rectangleproperties.hxx61
-rw-r--r--include/svx/sdr/properties/textproperties.hxx93
-rw-r--r--include/svx/sdr/table/tabledesign.hxx48
-rw-r--r--include/svx/sdrhittesthelper.hxx68
-rw-r--r--include/svx/sdrmasterpagedescriptor.hxx94
-rw-r--r--include/svx/sdrobjectfilter.hxx51
-rw-r--r--include/svx/sdrobjectuser.hxx56
-rw-r--r--include/svx/sdrpageuser.hxx56
-rw-r--r--include/svx/sdrpagewindow.hxx131
-rw-r--r--include/svx/sdrpaintwindow.hxx151
-rw-r--r--include/svx/sdshcitm.hxx36
-rw-r--r--include/svx/sdshitm.hxx36
-rw-r--r--include/svx/sdshtitm.hxx36
-rw-r--r--include/svx/sdsxyitm.hxx45
-rw-r--r--include/svx/sdtaaitm.hxx41
-rw-r--r--include/svx/sdtacitm.hxx34
-rw-r--r--include/svx/sdtaditm.hxx55
-rw-r--r--include/svx/sdtagitm.hxx45
-rw-r--r--include/svx/sdtaiitm.hxx39
-rw-r--r--include/svx/sdtaitm.hxx82
-rw-r--r--include/svx/sdtakitm.hxx97
-rw-r--r--include/svx/sdtayitm.hxx38
-rw-r--r--include/svx/sdtcfitm.hxx36
-rw-r--r--include/svx/sdtditm.hxx54
-rw-r--r--include/svx/sdtfchim.hxx47
-rw-r--r--include/svx/sdtfsitm.hxx67
-rw-r--r--include/svx/sdtmfitm.hxx63
-rw-r--r--include/svx/sdynitm.hxx46
-rw-r--r--include/svx/selctrl.hxx46
-rw-r--r--include/svx/selectioncontroller.hxx79
-rw-r--r--include/svx/shapeproperty.hxx51
-rw-r--r--include/svx/shapepropertynotifier.hxx141
-rw-r--r--include/svx/simptabl.hxx157
-rw-r--r--include/svx/sphere3d.hxx80
-rw-r--r--include/svx/srchdlg.hxx282
-rw-r--r--include/svx/stddlg.hxx43
-rw-r--r--include/svx/strarray.hxx40
-rw-r--r--include/svx/subtoolboxcontrol.hxx48
-rw-r--r--include/svx/svdattr.hxx57
-rw-r--r--include/svx/svdattrx.hxx71
-rw-r--r--include/svx/svdcrtv.hxx200
-rw-r--r--include/svx/svddef.hxx306
-rw-r--r--include/svx/svddrag.hxx184
-rw-r--r--include/svx/svddrgmt.hxx320
-rw-r--r--include/svx/svddrgv.hxx302
-rw-r--r--include/svx/svdedtv.hxx450
-rw-r--r--include/svx/svdedxv.hxx292
-rw-r--r--include/svx/svdetc.hxx266
-rw-r--r--include/svx/svdfield.hxx29
-rw-r--r--include/svx/svdglev.hxx111
-rw-r--r--include/svx/svdglob.hxx48
-rw-r--r--include/svx/svdglue.hxx147
-rw-r--r--include/svx/svdhdl.hxx515
-rw-r--r--include/svx/svdhlpln.hxx107
-rw-r--r--include/svx/svditer.hxx79
-rw-r--r--include/svx/svdlayer.hxx171
-rw-r--r--include/svx/svdmark.hxx298
-rw-r--r--include/svx/svdmodel.hxx712
-rw-r--r--include/svx/svdmrkv.hxx500
-rw-r--r--include/svx/svdoashp.hxx263
-rw-r--r--include/svx/svdoattr.hxx83
-rw-r--r--include/svx/svdobj.hxx1135
-rw-r--r--include/svx/svdocapt.hxx161
-rw-r--r--include/svx/svdocirc.hxx146
-rw-r--r--include/svx/svdoedge.hxx434
-rw-r--r--include/svx/svdograf.hxx203
-rw-r--r--include/svx/svdogrp.hxx118
-rw-r--r--include/svx/svdomeas.hxx210
-rw-r--r--include/svx/svdomedia.hxx88
-rw-r--r--include/svx/svdoole2.hxx195
-rw-r--r--include/svx/svdopage.hxx70
-rw-r--r--include/svx/svdopath.hxx193
-rw-r--r--include/svx/svdorect.hxx126
-rw-r--r--include/svx/svdotable.hxx326
-rw-r--r--include/svx/svdotext.hxx595
-rw-r--r--include/svx/svdouno.hxx155
-rw-r--r--include/svx/svdoutl.hxx52
-rw-r--r--include/svx/svdovirt.hxx157
-rw-r--r--include/svx/svdpage.hxx605
-rw-r--r--include/svx/svdpagv.hxx268
-rw-r--r--include/svx/svdpntv.hxx554
-rw-r--r--include/svx/svdpoev.hxx99
-rw-r--r--include/svx/svdpool.hxx54
-rw-r--r--include/svx/svdsnpv.hxx330
-rw-r--r--include/svx/svdsob.hxx117
-rw-r--r--include/svx/svdstr.hrc718
-rw-r--r--include/svx/svdtext.hxx82
-rw-r--r--include/svx/svdtrans.hxx304
-rw-r--r--include/svx/svdtypes.hxx162
-rw-r--r--include/svx/svdundo.hxx879
-rw-r--r--include/svx/svdview.hxx324
-rw-r--r--include/svx/svdviter.hxx98
-rw-r--r--include/svx/svdxcgv.hxx133
-rw-r--r--include/svx/svx3ditems.hxx371
-rw-r--r--include/svx/svxcommands.h154
-rw-r--r--include/svx/svxdlg.hxx499
-rw-r--r--include/svx/svxdllapi.h34
-rw-r--r--include/svx/svxerr.hxx96
-rw-r--r--include/svx/svxgrahicitem.hxx48
-rw-r--r--include/svx/svxids.hrc950
-rw-r--r--include/svx/svxitems.hrc117
-rw-r--r--include/svx/swframeexample.hxx95
-rw-r--r--include/svx/swframeposstrings.hxx87
-rw-r--r--include/svx/swframevalidation.hxx80
-rw-r--r--include/svx/sxallitm.hxx63
-rw-r--r--include/svx/sxcaitm.hxx52
-rw-r--r--include/svx/sxcecitm.hxx87
-rw-r--r--include/svx/sxcgitm.hxx37
-rw-r--r--include/svx/sxciaitm.hxx45
-rw-r--r--include/svx/sxcikitm.hxx49
-rw-r--r--include/svx/sxcllitm.hxx52
-rw-r--r--include/svx/sxctitm.hxx46
-rw-r--r--include/svx/sxekitm.hxx52
-rw-r--r--include/svx/sxelditm.hxx58
-rw-r--r--include/svx/sxenditm.hxx72
-rw-r--r--include/svx/sxfiitm.hxx48
-rw-r--r--include/svx/sxlayitm.hxx50
-rw-r--r--include/svx/sxlogitm.hxx45
-rw-r--r--include/svx/sxmbritm.hxx40
-rw-r--r--include/svx/sxmfsitm.hxx36
-rw-r--r--include/svx/sxmkitm.hxx49
-rw-r--r--include/svx/sxmlhitm.hxx79
-rw-r--r--include/svx/sxmoitm.hxx35
-rw-r--r--include/svx/sxmovitm.hxx45
-rw-r--r--include/svx/sxmsitm.hxx37
-rw-r--r--include/svx/sxmspitm.hxx45
-rw-r--r--include/svx/sxmsuitm.hxx34
-rw-r--r--include/svx/sxmtaitm.hxx45
-rw-r--r--include/svx/sxmtfitm.hxx52
-rw-r--r--include/svx/sxmtpitm.hxx71
-rw-r--r--include/svx/sxmtritm.hxx43
-rw-r--r--include/svx/sxmuitm.hxx48
-rw-r--r--include/svx/sxoneitm.hxx63
-rw-r--r--include/svx/sxonitm.hxx38
-rw-r--r--include/svx/sxopitm.hxx42
-rw-r--r--include/svx/sxraitm.hxx36
-rw-r--r--include/svx/sxreaitm.hxx48
-rw-r--r--include/svx/sxreoitm.hxx48
-rw-r--r--include/svx/sxroaitm.hxx36
-rw-r--r--include/svx/sxrooitm.hxx36
-rw-r--r--include/svx/sxsaitm.hxx36
-rw-r--r--include/svx/sxsalitm.hxx45
-rw-r--r--include/svx/sxsiitm.hxx37
-rw-r--r--include/svx/sxsoitm.hxx45
-rw-r--r--include/svx/sxtraitm.hxx63
-rw-r--r--include/svx/tabarea.hxx52
-rw-r--r--include/svx/tabline.hxx53
-rw-r--r--include/svx/tbcontrl.hxx389
-rw-r--r--include/svx/tbxalign.hxx48
-rw-r--r--include/svx/tbxcolor.hxx64
-rw-r--r--include/svx/tbxcolorupdate.hxx76
-rw-r--r--include/svx/tbxctl.hxx55
-rw-r--r--include/svx/tbxcustomshapes.hxx61
-rw-r--r--include/svx/tbxdraw.hxx66
-rw-r--r--include/svx/txencbox.hxx107
-rw-r--r--include/svx/txenctab.hxx44
-rw-r--r--include/svx/ucsubset.hrc255
-rw-r--r--include/svx/ucsubset.hxx80
-rw-r--r--include/svx/unoapi.hxx97
-rw-r--r--include/svx/unofill.hxx37
-rw-r--r--include/svx/unomaster.hxx62
-rw-r--r--include/svx/unomid.hxx108
-rw-r--r--include/svx/unomod.hxx62
-rw-r--r--include/svx/unomodel.hxx101
-rw-r--r--include/svx/unopage.hxx144
-rw-r--r--include/svx/unopool.hxx90
-rw-r--r--include/svx/unoprov.hxx122
-rw-r--r--include/svx/unoshape.hxx868
-rw-r--r--include/svx/unoshcol.hxx92
-rw-r--r--include/svx/unoshprp.hxx537
-rw-r--r--include/svx/unoshtxt.hxx91
-rw-r--r--include/svx/verttexttbxctrl.hxx57
-rw-r--r--include/svx/view3d.hxx266
-rw-r--r--include/svx/viewlayoutitem.hxx55
-rw-r--r--include/svx/viewpt3d.hxx116
-rw-r--r--include/svx/wrapfield.hxx51
-rw-r--r--include/svx/xattr.hxx38
-rw-r--r--include/svx/xbitmap.hxx66
-rw-r--r--include/svx/xbtmpit.hxx75
-rw-r--r--include/svx/xcolit.hxx61
-rw-r--r--include/svx/xdash.hxx71
-rw-r--r--include/svx/xdef.hxx97
-rw-r--r--include/svx/xenum.hxx53
-rw-r--r--include/svx/xexch.hxx59
-rw-r--r--include/svx/xfillit.hxx42
-rw-r--r--include/svx/xfillit0.hxx57
-rw-r--r--include/svx/xflasit.hxx48
-rw-r--r--include/svx/xflbckit.hxx52
-rw-r--r--include/svx/xflbmpit.hxx48
-rw-r--r--include/svx/xflbmsli.hxx44
-rw-r--r--include/svx/xflbmsxy.hxx70
-rw-r--r--include/svx/xflbmtit.hxx44
-rw-r--r--include/svx/xflboxy.hxx60
-rw-r--r--include/svx/xflbstit.hxx44
-rw-r--r--include/svx/xflbtoxy.hxx60
-rw-r--r--include/svx/xflclit.hxx56
-rw-r--r--include/svx/xflftrit.hxx62
-rw-r--r--include/svx/xflgrit.hxx67
-rw-r--r--include/svx/xflhtit.hxx67
-rw-r--r--include/svx/xfltrit.hxx48
-rw-r--r--include/svx/xftadit.hxx49
-rw-r--r--include/svx/xftdiit.hxx44
-rw-r--r--include/svx/xftmrit.hxx44
-rw-r--r--include/svx/xftouit.hxx43
-rw-r--r--include/svx/xftsfit.hxx48
-rw-r--r--include/svx/xftshcit.hxx46
-rw-r--r--include/svx/xftshit.hxx49
-rw-r--r--include/svx/xftshtit.hxx43
-rw-r--r--include/svx/xftshxy.hxx60
-rw-r--r--include/svx/xftstit.hxx44
-rw-r--r--include/svx/xgrad.hxx83
-rw-r--r--include/svx/xgrscit.hxx48
-rw-r--r--include/svx/xhatch.hxx59
-rw-r--r--include/svx/xit.hxx76
-rw-r--r--include/svx/xlineit.hxx46
-rw-r--r--include/svx/xlineit0.hxx52
-rw-r--r--include/svx/xlinjoit.hxx54
-rw-r--r--include/svx/xlnasit.hxx49
-rw-r--r--include/svx/xlncapit.hxx55
-rw-r--r--include/svx/xlnclit.hxx52
-rw-r--r--include/svx/xlndsit.hxx69
-rw-r--r--include/svx/xlnedcit.hxx49
-rw-r--r--include/svx/xlnedit.hxx65
-rw-r--r--include/svx/xlnedwit.hxx52
-rw-r--r--include/svx/xlnstcit.hxx49
-rw-r--r--include/svx/xlnstit.hxx65
-rw-r--r--include/svx/xlnstwit.hxx52
-rw-r--r--include/svx/xlntrit.hxx48
-rw-r--r--include/svx/xlnwtit.hxx49
-rw-r--r--include/svx/xmleohlp.hxx148
-rw-r--r--include/svx/xmlexchg.hxx95
-rw-r--r--include/svx/xmlgrhlp.hxx158
-rw-r--r--include/svx/xmlsecctrl.hxx51
-rw-r--r--include/svx/xoutbmp.hxx73
-rw-r--r--include/svx/xpoly.hxx181
-rw-r--r--include/svx/xpool.hxx54
-rw-r--r--include/svx/xsetit.hxx45
-rw-r--r--include/svx/xsflclit.hxx50
-rw-r--r--include/svx/xtable.hxx501
-rw-r--r--include/svx/xtextit.hxx41
-rw-r--r--include/svx/xtextit0.hxx66
-rw-r--r--include/svx/zoom_def.hxx29
-rw-r--r--include/svx/zoomctrl.hxx48
-rw-r--r--include/svx/zoomsliderctrl.hxx53
-rw-r--r--include/svx/zoomslideritem.hxx60
-rw-r--r--include/test/beans/xpropertyset.hxx70
-rw-r--r--include/test/bootstrapfixture.hxx56
-rw-r--r--include/test/container/xelementaccess.hxx35
-rw-r--r--include/test/container/xindexaccess.hxx36
-rw-r--r--include/test/container/xnamecontainer.hxx38
-rw-r--r--include/test/container/xnamed.hxx35
-rw-r--r--include/test/container/xnamereplace.hxx39
-rw-r--r--include/test/sheet/cellproperties.hxx32
-rw-r--r--include/test/sheet/datapilotfield.hxx34
-rw-r--r--include/test/sheet/tableautoformatfield.hxx30
-rw-r--r--include/test/sheet/xcellrangedata.hxx32
-rw-r--r--include/test/sheet/xcellrangereferrer.hxx36
-rw-r--r--include/test/sheet/xcellrangesquery.hxx40
-rw-r--r--include/test/sheet/xdatabaserange.hxx37
-rw-r--r--include/test/sheet/xdatapilotdescriptor.hxx50
-rw-r--r--include/test/sheet/xdatapilotfieldgrouping.hxx32
-rw-r--r--include/test/sheet/xdatapilottable.hxx36
-rw-r--r--include/test/sheet/xdatapilottable2.hxx55
-rw-r--r--include/test/sheet/xgoalseek.hxx31
-rw-r--r--include/test/sheet/xnamedrange.hxx58
-rw-r--r--include/test/sheet/xnamedranges.hxx65
-rw-r--r--include/test/sheet/xprintareas.hxx59
-rw-r--r--include/test/sheet/xsheetannotation.hxx60
-rw-r--r--include/test/sheet/xsheetannotations.hxx56
-rw-r--r--include/test/sheet/xsheetoutline.hxx57
-rw-r--r--include/test/sheet/xspreadsheetdocument.hxx35
-rw-r--r--include/test/sheet/xspreadsheets2.hxx84
-rw-r--r--include/test/testdllapi.hxx33
-rw-r--r--include/test/text/xtext.hxx39
-rw-r--r--include/test/text/xtextcontent.hxx38
-rw-r--r--include/test/text/xtextfield.hxx31
-rw-r--r--include/test/unoapi_test.hxx41
-rw-r--r--include/test/util/xreplaceable.hxx38
-rw-r--r--include/test/util/xsearchable.hxx37
-rw-r--r--include/test/xmldiff.hxx16
-rw-r--r--include/toolkit/awt/animatedimagespeer.hxx99
-rw-r--r--include/toolkit/awt/scrollabledialog.hxx83
-rw-r--r--include/toolkit/awt/vclxaccessiblecomponent.hxx155
-rw-r--r--include/toolkit/awt/vclxbitmap.hxx80
-rw-r--r--include/toolkit/awt/vclxcontainer.hxx76
-rw-r--r--include/toolkit/awt/vclxdevice.hxx118
-rw-r--r--include/toolkit/awt/vclxfont.hxx89
-rw-r--r--include/toolkit/awt/vclxgraphics.hxx130
-rw-r--r--include/toolkit/awt/vclxmenu.hxx184
-rw-r--r--include/toolkit/awt/vclxpointer.hxx78
-rw-r--r--include/toolkit/awt/vclxprinter.hxx219
-rw-r--r--include/toolkit/awt/vclxregion.hxx89
-rw-r--r--include/toolkit/awt/vclxspinbutton.hxx93
-rw-r--r--include/toolkit/awt/vclxsystemdependentwindow.hxx60
-rw-r--r--include/toolkit/awt/vclxtabpagecontainer.hxx81
-rw-r--r--include/toolkit/awt/vclxtabpagemodel.hxx73
-rw-r--r--include/toolkit/awt/vclxtoolkit.hxx206
-rw-r--r--include/toolkit/awt/vclxtopwindow.hxx114
-rw-r--r--include/toolkit/awt/vclxwindow.hxx235
-rw-r--r--include/toolkit/awt/vclxwindows.hxx1242
-rw-r--r--include/toolkit/awt/xsimpleanimation.hxx70
-rw-r--r--include/toolkit/awt/xthrobber.hxx73
-rw-r--r--include/toolkit/controls/accessiblecontrolcontext.hxx129
-rw-r--r--include/toolkit/controls/animatedimages.hxx138
-rw-r--r--include/toolkit/controls/controlmodelcontainerbase.hxx271
-rw-r--r--include/toolkit/controls/dialogcontrol.hxx268
-rw-r--r--include/toolkit/controls/eventcontainer.hxx131
-rw-r--r--include/toolkit/controls/formattedcontrol.hxx124
-rw-r--r--include/toolkit/controls/geometrycontrolmodel.hxx262
-rw-r--r--include/toolkit/controls/geometrycontrolmodel_impl.hxx82
-rw-r--r--include/toolkit/controls/roadmapcontrol.hxx200
-rw-r--r--include/toolkit/controls/roadmapentry.hxx83
-rw-r--r--include/toolkit/controls/spinningprogress.hxx62
-rw-r--r--include/toolkit/controls/stdtabcontroller.hxx87
-rw-r--r--include/toolkit/controls/stdtabcontrollermodel.hxx138
-rw-r--r--include/toolkit/controls/tabpagecontainer.hxx139
-rw-r--r--include/toolkit/controls/tabpagemodel.hxx89
-rw-r--r--include/toolkit/controls/tkscrollbar.hxx118
-rw-r--r--include/toolkit/controls/tksimpleanimation.hxx95
-rw-r--r--include/toolkit/controls/tkspinbutton.hxx121
-rw-r--r--include/toolkit/controls/tkthrobber.hxx103
-rw-r--r--include/toolkit/controls/unocontrol.hxx237
-rw-r--r--include/toolkit/controls/unocontrolbase.hxx62
-rw-r--r--include/toolkit/controls/unocontrolcontainer.hxx160
-rw-r--r--include/toolkit/controls/unocontrolcontainermodel.hxx59
-rw-r--r--include/toolkit/controls/unocontrolmodel.hxx186
-rw-r--r--include/toolkit/controls/unocontrols.hxx1518
-rw-r--r--include/toolkit/dllapi.h34
-rw-r--r--include/toolkit/helper/accessibilityclient.hxx66
-rw-r--r--include/toolkit/helper/accessiblefactory.hxx134
-rw-r--r--include/toolkit/helper/convert.hxx61
-rw-r--r--include/toolkit/helper/emptyfontdescriptor.hxx49
-rw-r--r--include/toolkit/helper/externallock.hxx38
-rw-r--r--include/toolkit/helper/formpdfexport.hxx55
-rw-r--r--include/toolkit/helper/imagealign.hxx53
-rw-r--r--include/toolkit/helper/listenermultiplexer.hxx268
-rw-r--r--include/toolkit/helper/macros.hxx305
-rw-r--r--include/toolkit/helper/mutexandbroadcasthelper.hxx44
-rw-r--r--include/toolkit/helper/mutexhelper.hxx44
-rw-r--r--include/toolkit/helper/property.hxx254
-rw-r--r--include/toolkit/helper/servicenames.hxx118
-rw-r--r--include/toolkit/helper/tkresmgr.hxx71
-rw-r--r--include/toolkit/helper/unopropertyarrayhelper.hxx58
-rw-r--r--include/toolkit/helper/unowrapper.hxx86
-rw-r--r--include/toolkit/helper/vclunohelper.hxx155
-rw-r--r--include/toolkit/unohlp.hxx3
-rw-r--r--include/tools/StringListResource.hxx50
-rw-r--r--include/tools/appendunixshellword.hxx47
-rw-r--r--include/tools/b3dtrans.hxx259
-rw-r--r--include/tools/bigint.hxx311
-rw-r--r--include/tools/cachestr.hxx67
-rw-r--r--include/tools/color.hxx215
-rw-r--r--include/tools/config.hxx81
-rw-r--r--include/tools/contnr.hxx33
-rw-r--r--include/tools/date.hxx152
-rw-r--r--include/tools/datetime.hxx112
-rw-r--r--include/tools/debug.hxx496
-rw-r--r--include/tools/diagnose_ex.h186
-rw-r--r--include/tools/errcode.hxx313
-rw-r--r--include/tools/errinf.hxx181
-rw-r--r--include/tools/extendapplicationenvironment.hxx35
-rw-r--r--include/tools/fldunit.hxx29
-rw-r--r--include/tools/fontenum.hxx125
-rw-r--r--include/tools/fract.hxx143
-rw-r--r--include/tools/gen.hxx692
-rw-r--r--include/tools/getprocessworkingdir.hxx40
-rw-r--r--include/tools/globname.hxx108
-rw-r--r--include/tools/helpers.hxx29
-rw-r--r--include/tools/inetmime.hxx1261
-rw-r--r--include/tools/inetmsg.hxx518
-rw-r--r--include/tools/inetstrm.hxx222
-rw-r--r--include/tools/line.hxx59
-rw-r--r--include/tools/lineend.hxx33
-rw-r--r--include/tools/link.hxx144
-rw-r--r--include/tools/mapunit.hxx30
-rw-r--r--include/tools/mempool.hxx106
-rw-r--r--include/tools/multisel.hxx186
-rw-r--r--include/tools/pathutils.hxx87
-rw-r--r--include/tools/poly.hxx285
-rw-r--r--include/tools/postsys.h234
-rw-r--r--include/tools/presys.h34
-rw-r--r--include/tools/pstm.hxx245
-rw-r--r--include/tools/rc.h216
-rw-r--r--include/tools/rc.hxx96
-rw-r--r--include/tools/rcid.h125
-rw-r--r--include/tools/ref.hxx256
-rw-r--r--include/tools/resary.hxx61
-rw-r--r--include/tools/resid.hxx156
-rw-r--r--include/tools/resmgr.hxx223
-rw-r--r--include/tools/rtti.hxx125
-rw-r--r--include/tools/shl.hxx88
-rw-r--r--include/tools/simplerm.hxx83
-rw-r--r--include/tools/solar.h154
-rw-r--r--include/tools/solarmutex.hxx38
-rw-r--r--include/tools/stream.hxx779
-rw-r--r--include/tools/string.hxx411
-rw-r--r--include/tools/svborder.hxx98
-rw-r--r--include/tools/tempfile.hxx66
-rw-r--r--include/tools/tenccvt.hxx58
-rw-r--r--include/tools/time.hxx136
-rw-r--r--include/tools/tools.h32
-rw-r--r--include/tools/toolsdllapi.h34
-rw-r--r--include/tools/unqidx.hxx73
-rw-r--r--include/tools/urlobj.hxx1783
-rw-r--r--include/tools/vcompat.hxx56
-rw-r--r--include/tools/vector2d.hxx107
-rw-r--r--include/tools/weakbase.h146
-rw-r--r--include/tools/weakbase.hxx176
-rw-r--r--include/tools/wintypes.hxx325
-rw-r--r--include/tools/wldcrd.hxx62
-rw-r--r--include/tools/zcodec.hxx110
-rw-r--r--include/touch/touch.h44
-rw-r--r--include/tubes/collaboration.hxx50
-rw-r--r--include/tubes/conference.hxx83
-rw-r--r--include/tubes/constants.h54
-rw-r--r--include/tubes/file-transfer-helper.h125
-rw-r--r--include/tubes/manager.hxx155
-rw-r--r--include/tubes/tubesdllapi.h16
-rw-r--r--include/ucbhelper/activedatasink.hxx69
-rw-r--r--include/ucbhelper/activedatastreamer.hxx64
-rw-r--r--include/ucbhelper/cancelcommandexecution.hxx104
-rw-r--r--include/ucbhelper/commandenvironment.hxx94
-rw-r--r--include/ucbhelper/content.hxx719
-rw-r--r--include/ucbhelper/contenthelper.hxx504
-rw-r--r--include/ucbhelper/contentidentifier.hxx84
-rw-r--r--include/ucbhelper/contentinfo.hxx162
-rw-r--r--include/ucbhelper/fd_inputstream.hxx130
-rw-r--r--include/ucbhelper/fileidentifierconverter.hxx114
-rw-r--r--include/ucbhelper/getcomponentcontext.hxx47
-rw-r--r--include/ucbhelper/interactionrequest.hxx721
-rw-r--r--include/ucbhelper/interceptedinteraction.hxx334
-rw-r--r--include/ucbhelper/macros.hxx761
-rw-r--r--include/ucbhelper/propertyvalueset.hxx275
-rw-r--r--include/ucbhelper/providerhelper.hxx278
-rw-r--r--include/ucbhelper/proxydecider.hxx138
-rw-r--r--include/ucbhelper/registerucb.hxx122
-rw-r--r--include/ucbhelper/resultset.hxx573
-rw-r--r--include/ucbhelper/resultsethelper.hxx204
-rw-r--r--include/ucbhelper/resultsetmetadata.hxx470
-rw-r--r--include/ucbhelper/simpleauthenticationrequest.hxx149
-rw-r--r--include/ucbhelper/simplecertificatevalidationrequest.hxx63
-rw-r--r--include/ucbhelper/simpleinteractionrequest.hxx90
-rw-r--r--include/ucbhelper/simpleioerrorrequest.hxx69
-rw-r--r--include/ucbhelper/simplenameclashresolverequest.hxx77
-rw-r--r--include/ucbhelper/std_inputstream.hxx115
-rw-r--r--include/ucbhelper/std_outputstream.hxx71
-rw-r--r--include/ucbhelper/ucbhelperdllapi.h34
-rw-r--r--include/udm/html/htmlitem.hxx342
-rw-r--r--include/udm/xml/xmlitem.hxx339
-rw-r--r--include/unoidl/detail/dllapi.hxx26
-rw-r--r--include/unoidl/detail/unoidldllapi.hxx26
-rw-r--r--include/unoidl/legacyprovider.hxx48
-rw-r--r--include/unoidl/unoidl.hxx642
-rw-r--r--include/unoidl/unoidlprovider.hxx60
-rw-r--r--include/unotest/bootstrapfixturebase.hxx81
-rw-r--r--include/unotest/detail/unotestdllapi.hxx34
-rw-r--r--include/unotest/filters-test.hxx74
-rw-r--r--include/unotest/gettestargument.hxx39
-rw-r--r--include/unotest/macros_test.hxx40
-rw-r--r--include/unotest/officeconnection.hxx64
-rw-r--r--include/unotest/toabsolutefileurl.hxx39
-rw-r--r--include/unotest/uniquepipename.hxx37
-rw-r--r--include/unotools/accessiblerelationsethelper.hxx153
-rw-r--r--include/unotools/accessiblestatesethelper.hxx161
-rw-r--r--include/unotools/atom.hxx70
-rw-r--r--include/unotools/bootstrap.hxx120
-rw-r--r--include/unotools/calendarwrapper.hxx131
-rw-r--r--include/unotools/caserotate.hxx34
-rw-r--r--include/unotools/charclass.hxx225
-rw-r--r--include/unotools/closeveto.hxx60
-rw-r--r--include/unotools/cmdoptions.hxx167
-rw-r--r--include/unotools/collatorwrapper.hxx74
-rw-r--r--include/unotools/compatibility.hxx240
-rw-r--r--include/unotools/componentresmodule.hxx180
-rw-r--r--include/unotools/configitem.hxx195
-rw-r--r--include/unotools/configmgr.hxx93
-rw-r--r--include/unotools/confignode.hxx325
-rw-r--r--include/unotools/configpaths.hxx170
-rw-r--r--include/unotools/configvaluecontainer.hxx183
-rw-r--r--include/unotools/datetime.hxx59
-rw-r--r--include/unotools/defaultoptions.hxx47
-rw-r--r--include/unotools/desktopterminationobserver.hxx72
-rw-r--r--include/unotools/digitgroupingiterator.hxx198
-rw-r--r--include/unotools/docinfohelper.hxx40
-rw-r--r--include/unotools/dynamicmenuoptions.hxx138
-rw-r--r--include/unotools/eventcfg.hxx113
-rw-r--r--include/unotools/eventlisteneradapter.hxx64
-rw-r--r--include/unotools/extendedsecurityoptions.hxx121
-rw-r--r--include/unotools/fltrcfg.hxx91
-rw-r--r--include/unotools/fontcfg.hxx221
-rw-r--r--include/unotools/fontcvt.hxx73
-rw-r--r--include/unotools/fontdefs.hxx95
-rw-r--r--include/unotools/fontoptions.hxx129
-rw-r--r--include/unotools/historyoptions.hxx204
-rw-r--r--include/unotools/idhelper.hxx199
-rw-r--r--include/unotools/intlwrapper.hxx98
-rw-r--r--include/unotools/itemholderbase.hxx104
-rw-r--r--include/unotools/lingucfg.hxx228
-rw-r--r--include/unotools/linguprops.hxx114
-rw-r--r--include/unotools/localedatawrapper.hxx362
-rw-r--r--include/unotools/localfilehelper.hxx60
-rw-r--r--include/unotools/localisationoptions.hxx136
-rw-r--r--include/unotools/misccfg.hxx57
-rw-r--r--include/unotools/moduleoptions.hxx206
-rw-r--r--include/unotools/nativenumberwrapper.hxx64
-rw-r--r--include/unotools/numberformatcodewrapper.hxx68
-rw-r--r--include/unotools/options.hxx95
-rw-r--r--include/unotools/optionsdlg.hxx47
-rw-r--r--include/unotools/pathoptions.hxx130
-rw-r--r--include/unotools/printwarningoptions.hxx121
-rw-r--r--include/unotools/progresshandlerwrap.hxx50
-rw-r--r--include/unotools/readwritemutexguard.hxx106
-rw-r--r--include/unotools/saveopt.hxx129
-rw-r--r--include/unotools/searchopt.hxx111
-rw-r--r--include/unotools/securityoptions.hxx261
-rw-r--r--include/unotools/sharedunocomponent.hxx364
-rw-r--r--include/unotools/streamhelper.hxx78
-rw-r--r--include/unotools/streamsection.hxx78
-rw-r--r--include/unotools/streamwrap.hxx173
-rw-r--r--include/unotools/syslocale.hxx79
-rw-r--r--include/unotools/syslocaleoptions.hxx177
-rw-r--r--include/unotools/tempfile.hxx154
-rw-r--r--include/unotools/textsearch.hxx186
-rw-r--r--include/unotools/transliterationwrapper.hxx133
-rw-r--r--include/unotools/ucbhelper.hxx76
-rw-r--r--include/unotools/ucblockbytes.hxx198
-rw-r--r--include/unotools/ucbstreamhelper.hxx73
-rw-r--r--include/unotools/unotoolsdllapi.h34
-rw-r--r--include/unotools/useroptions.hxx97
-rw-r--r--include/unotools/viewoptions.hxx318
-rw-r--r--include/unotools/xmlaccelcfg.hxx110
-rw-r--r--include/vbahelper/helperdecl.hxx49
-rw-r--r--include/vbahelper/vbaaccesshelper.hxx73
-rw-r--r--include/vbahelper/vbaapplicationbase.hxx69
-rw-r--r--include/vbahelper/vbacollectionimpl.hxx352
-rw-r--r--include/vbahelper/vbadialogbase.hxx45
-rw-r--r--include/vbahelper/vbadialogsbase.hxx45
-rw-r--r--include/vbahelper/vbadllapi.h34
-rw-r--r--include/vbahelper/vbadocumentbase.hxx65
-rw-r--r--include/vbahelper/vbadocumentsbase.hxx60
-rw-r--r--include/vbahelper/vbaeventshelperbase.hxx184
-rw-r--r--include/vbahelper/vbafontbase.hxx96
-rw-r--r--include/vbahelper/vbaglobalbase.hxx45
-rw-r--r--include/vbahelper/vbahelper.hxx256
-rw-r--r--include/vbahelper/vbahelperinterface.hxx185
-rw-r--r--include/vbahelper/vbapagesetupbase.hxx61
-rw-r--r--include/vbahelper/vbapropvalue.hxx54
-rw-r--r--include/vbahelper/vbashape.hxx109
-rw-r--r--include/vbahelper/vbashaperange.hxx82
-rw-r--r--include/vbahelper/vbashapes.hxx74
-rw-r--r--include/vbahelper/vbatextframe.hxx61
-rw-r--r--include/vbahelper/vbawindowbase.hxx76
-rw-r--r--include/vcl/FilterConfigItem.hxx87
-rw-r--r--include/vcl/GraphicNativeMetadata.hxx39
-rw-r--r--include/vcl/GraphicNativeTransform.hxx42
-rw-r--r--include/vcl/ImageListProvider.hxx51
-rw-r--r--include/vcl/abstdlg.hxx84
-rw-r--r--include/vcl/accel.hxx105
-rw-r--r--include/vcl/alpha.hxx149
-rw-r--r--include/vcl/animate.hxx238
-rw-r--r--include/vcl/apptypes.hxx51
-rw-r--r--include/vcl/bitmap.hxx896
-rw-r--r--include/vcl/bitmapex.hxx389
-rw-r--r--include/vcl/bmpacc.hxx454
-rw-r--r--include/vcl/btndlg.hxx105
-rw-r--r--include/vcl/builder.hxx365
-rw-r--r--include/vcl/button.hxx574
-rw-r--r--include/vcl/canvastools.hxx175
-rw-r--r--include/vcl/cmdevt.hxx466
-rw-r--r--include/vcl/combobox.h31
-rw-r--r--include/vcl/combobox.hxx227
-rw-r--r--include/vcl/configsettings.hxx66
-rw-r--r--include/vcl/controllayout.hxx79
-rw-r--r--include/vcl/ctrl.hxx195
-rw-r--r--include/vcl/cursor.hxx114
-rw-r--r--include/vcl/cvtgrf.hxx57
-rw-r--r--include/vcl/cvtsvm.hxx102
-rw-r--r--include/vcl/decoview.hxx102
-rw-r--r--include/vcl/dialog.hxx185
-rw-r--r--include/vcl/displayconnectiondispatch.hxx46
-rw-r--r--include/vcl/dllapi.h40
-rw-r--r--include/vcl/dndhelp.hxx119
-rw-r--r--include/vcl/dockingarea.hxx59
-rw-r--r--include/vcl/dockwin.hxx420
-rw-r--r--include/vcl/edit.hxx265
-rw-r--r--include/vcl/embeddedfontshelper.hxx89
-rw-r--r--include/vcl/event.hxx522
-rw-r--r--include/vcl/evntpost.hxx51
-rw-r--r--include/vcl/extoutdevdata.hxx41
-rw-r--r--include/vcl/field.hxx832
-rw-r--r--include/vcl/fixed.hxx208
-rw-r--r--include/vcl/fixedhyper.hxx127
-rw-r--r--include/vcl/floatwin.hxx152
-rw-r--r--include/vcl/fltcall.hxx68
-rw-r--r--include/vcl/fntstyle.hxx47
-rw-r--r--include/vcl/font.hxx137
-rw-r--r--include/vcl/fontcapabilities.hxx204
-rw-r--r--include/vcl/fontmanager.hxx578
-rw-r--r--include/vcl/fpicker.hrc36
-rw-r--r--include/vcl/gdimtf.hxx248
-rw-r--r--include/vcl/gfxlink.hxx180
-rw-r--r--include/vcl/gradient.hxx118
-rw-r--r--include/vcl/graph.h74
-rw-r--r--include/vcl/graph.hxx201
-rw-r--r--include/vcl/graphicfilter.hxx325
-rw-r--r--include/vcl/graphictools.hxx348
-rw-r--r--include/vcl/group.hxx61
-rw-r--r--include/vcl/hatch.hxx89
-rw-r--r--include/vcl/help.hxx120
-rw-r--r--include/vcl/helper.hxx59
-rw-r--r--include/vcl/i18nhelp.hxx87
-rw-r--r--include/vcl/image.hxx145
-rw-r--r--include/vcl/imagerepository.hxx68
-rw-r--r--include/vcl/imgctrl.hxx57
-rw-r--r--include/vcl/impdel.hxx81
-rw-r--r--include/vcl/inputctx.hxx82
-rw-r--r--include/vcl/introwin.hxx44
-rw-r--r--include/vcl/jobdata.hxx85
-rw-r--r--include/vcl/jobset.hxx74
-rw-r--r--include/vcl/keycod.hxx132
-rw-r--r--include/vcl/keycodes.hxx186
-rw-r--r--include/vcl/layout.hxx702
-rw-r--r--include/vcl/lazydelete.hxx299
-rw-r--r--include/vcl/lineinfo.hxx127
-rw-r--r--include/vcl/longcurr.hxx134
-rw-r--r--include/vcl/lstbox.h57
-rw-r--r--include/vcl/lstbox.hxx250
-rw-r--r--include/vcl/mapmod.hxx110
-rw-r--r--include/vcl/menu.hxx494
-rw-r--r--include/vcl/menubtn.hxx98
-rw-r--r--include/vcl/metaact.hxx1319
-rw-r--r--include/vcl/metric.hxx152
-rw-r--r--include/vcl/mnemonic.hxx82
-rw-r--r--include/vcl/mnemonicengine.hxx154
-rw-r--r--include/vcl/morebtn.hxx88
-rw-r--r--include/vcl/msgbox.hxx172
-rw-r--r--include/vcl/octree.hxx127
-rw-r--r--include/vcl/oldprintadaptor.hxx46
-rw-r--r--include/vcl/outdev.hxx1170
-rw-r--r--include/vcl/pdfextoutdevdata.hxx492
-rw-r--r--include/vcl/pdfwriter.hxx1310
-rw-r--r--include/vcl/pngread.hxx64
-rw-r--r--include/vcl/pngwrite.hxx61
-rw-r--r--include/vcl/pointr.hxx53
-rw-r--r--include/vcl/popupmenuwindow.hxx44
-rw-r--r--include/vcl/ppdparser.hxx311
-rw-r--r--include/vcl/prgsbar.hxx89
-rw-r--r--include/vcl/print.hxx688
-rw-r--r--include/vcl/printerinfomanager.hxx239
-rw-r--r--include/vcl/prntypes.hxx89
-rw-r--r--include/vcl/ptrstyle.hxx134
-rw-r--r--include/vcl/quickselectionengine.hxx94
-rw-r--r--include/vcl/regband.hxx142
-rw-r--r--include/vcl/region.hxx155
-rw-r--r--include/vcl/salbtype.hxx887
-rw-r--r--include/vcl/salctype.hxx71
-rw-r--r--include/vcl/salgtype.hxx84
-rw-r--r--include/vcl/salnativewidgets.hxx476
-rw-r--r--include/vcl/scopedbitmapaccess.hxx94
-rw-r--r--include/vcl/scrbar.hxx166
-rw-r--r--include/vcl/seleng.hxx232
-rw-r--r--include/vcl/settings.hxx1104
-rw-r--r--include/vcl/slider.hxx122
-rw-r--r--include/vcl/solarmutex.hxx71
-rw-r--r--include/vcl/sound.hxx39
-rw-r--r--include/vcl/spin.h38
-rw-r--r--include/vcl/spin.hxx110
-rw-r--r--include/vcl/spinfld.hxx111
-rw-r--r--include/vcl/split.hxx116
-rw-r--r--include/vcl/splitwin.hxx241
-rw-r--r--include/vcl/status.hxx198
-rw-r--r--include/vcl/stdtext.hxx47
-rw-r--r--include/vcl/strhelper.hxx74
-rw-r--r--include/vcl/svapp.hxx538
-rw-r--r--include/vcl/svgdata.hxx86
-rw-r--r--include/vcl/syschild.hxx65
-rw-r--r--include/vcl/sysdata.hxx272
-rw-r--r--include/vcl/syswin.hxx270
-rw-r--r--include/vcl/tabctrl.hxx208
-rw-r--r--include/vcl/tabdlg.hxx64
-rw-r--r--include/vcl/tabpage.hxx65
-rw-r--r--include/vcl/taskpanelist.hxx48
-rw-r--r--include/vcl/textdata.hxx172
-rw-r--r--include/vcl/texteng.hxx322
-rw-r--r--include/vcl/textview.hxx208
-rw-r--r--include/vcl/threadex.hxx261
-rw-r--r--include/vcl/throbber.hxx94
-rw-r--r--include/vcl/timer.hxx81
-rw-r--r--include/vcl/toolbox.hxx606
-rw-r--r--include/vcl/txtattr.hxx227
-rw-r--r--include/vcl/unohelp.hxx63
-rw-r--r--include/vcl/unohelp2.hxx77
-rw-r--r--include/vcl/unowrap.hxx86
-rw-r--r--include/vcl/vclenum.hxx137
-rw-r--r--include/vcl/vclevent.hxx289
-rw-r--r--include/vcl/vclmain.hxx27
-rw-r--r--include/vcl/vclmedit.hxx142
-rw-r--r--include/vcl/virdev.hxx142
-rw-r--r--include/vcl/waitobj.hxx47
-rw-r--r--include/vcl/wall.hxx133
-rw-r--r--include/vcl/window.hxx1279
-rw-r--r--include/vcl/wmf.hxx70
-rw-r--r--include/vcl/wrkwin.hxx105
-rw-r--r--include/vcl/xtextedt.hxx69
-rw-r--r--include/xmloff/DashStyle.hxx66
-rw-r--r--include/xmloff/DocumentSettingsContext.hxx57
-rw-r--r--include/xmloff/EnumPropertyHdl.hxx46
-rw-r--r--include/xmloff/GradientStyle.hxx68
-rw-r--r--include/xmloff/HatchStyle.hxx65
-rw-r--r--include/xmloff/ImageStyle.hxx54
-rw-r--r--include/xmloff/MarkerStyle.hxx67
-rw-r--r--include/xmloff/NamedBoolPropertyHdl.hxx56
-rw-r--r--include/xmloff/PageMasterStyleMap.hxx168
-rw-r--r--include/xmloff/ProgressBarHelper.hxx70
-rw-r--r--include/xmloff/PropertySetInfoHash.hxx59
-rw-r--r--include/xmloff/PropertySetInfoKey.hxx61
-rw-r--r--include/xmloff/SchXMLExportHelper.hxx67
-rw-r--r--include/xmloff/SchXMLImportHelper.hxx153
-rw-r--r--include/xmloff/SchXMLSeriesHelper.hxx73
-rw-r--r--include/xmloff/SettingsExportHelper.hxx104
-rw-r--r--include/xmloff/SinglePropertySetInfoCache.hxx73
-rw-r--r--include/xmloff/WordWrapPropertyHdl.hxx47
-rw-r--r--include/xmloff/XMLBase64ImportContext.hxx57
-rw-r--r--include/xmloff/XMLCharContext.hxx65
-rw-r--r--include/xmloff/XMLConstantsPropertyHandler.hxx63
-rw-r--r--include/xmloff/XMLEmbeddedObjectExportFilter.hxx85
-rw-r--r--include/xmloff/XMLEventExport.hxx133
-rw-r--r--include/xmloff/XMLEventsImportContext.hxx131
-rw-r--r--include/xmloff/XMLFilterServiceNames.h40
-rw-r--r--include/xmloff/XMLFontAutoStylePool.hxx73
-rw-r--r--include/xmloff/XMLFontStylesContext.hxx89
-rw-r--r--include/xmloff/XMLGraphicsDefaultStyle.hxx56
-rw-r--r--include/xmloff/XMLPageExport.hxx105
-rw-r--r--include/xmloff/XMLSettingsExportContext.hxx62
-rw-r--r--include/xmloff/XMLShapeStyleContext.hxx70
-rw-r--r--include/xmloff/XMLStringVector.hxx32
-rw-r--r--include/xmloff/XMLTextListAutoStylePool.hxx77
-rw-r--r--include/xmloff/XMLTextMasterPageContext.hxx89
-rw-r--r--include/xmloff/XMLTextMasterPageExport.hxx68
-rw-r--r--include/xmloff/XMLTextMasterStylesContext.hxx55
-rw-r--r--include/xmloff/XMLTextShapeImportHelper.hxx51
-rw-r--r--include/xmloff/XMLTextShapeStyleContext.hxx66
-rw-r--r--include/xmloff/XMLTextTableContext.hxx53
-rw-r--r--include/xmloff/animationexport.hxx53
-rw-r--r--include/xmloff/animexp.hxx45
-rw-r--r--include/xmloff/attrlist.hxx86
-rw-r--r--include/xmloff/contextid.hxx48
-rw-r--r--include/xmloff/controlpropertyhdl.hxx136
-rw-r--r--include/xmloff/dllapi.h34
-rw-r--r--include/xmloff/families.hxx110
-rw-r--r--include/xmloff/formlayerexport.hxx189
-rw-r--r--include/xmloff/formlayerimport.hxx136
-rw-r--r--include/xmloff/i18nmap.hxx73
-rw-r--r--include/xmloff/maptype.hxx68
-rw-r--r--include/xmloff/nmspmap.hxx170
-rw-r--r--include/xmloff/numehelp.hxx116
-rw-r--r--include/xmloff/odffields.hxx53
-rw-r--r--include/xmloff/prhdlfac.hxx103
-rw-r--r--include/xmloff/prstylei.hxx99
-rw-r--r--include/xmloff/settingsstore.hxx59
-rw-r--r--include/xmloff/shapeexport.hxx331
-rw-r--r--include/xmloff/shapeimport.hxx426
-rw-r--r--include/xmloff/styleexp.hxx127
-rw-r--r--include/xmloff/table/XMLTableExport.hxx106
-rw-r--r--include/xmloff/table/XMLTableImport.hxx72
-rw-r--r--include/xmloff/txtimp.hxx725
-rw-r--r--include/xmloff/txtimppr.hxx75
-rw-r--r--include/xmloff/txtparae.hxx728
-rw-r--r--include/xmloff/txtprmap.hxx204
-rw-r--r--include/xmloff/txtstyli.hxx112
-rw-r--r--include/xmloff/uniref.hxx224
-rw-r--r--include/xmloff/unoatrcn.hxx79
-rw-r--r--include/xmloff/unointerfacetouniqueidentifiermapper.hxx77
-rw-r--r--include/xmloff/xformsexport.hxx54
-rw-r--r--include/xmloff/xformsimport.hxx79
-rw-r--r--include/xmloff/xmlaustp.hxx124
-rw-r--r--include/xmloff/xmlcnimp.hxx74
-rw-r--r--include/xmloff/xmlement.hxx51
-rw-r--r--include/xmloff/xmlerror.hxx147
-rw-r--r--include/xmloff/xmlevent.hxx145
-rw-r--r--include/xmloff/xmlexp.hxx659
-rw-r--r--include/xmloff/xmlexppr.hxx188
-rw-r--r--include/xmloff/xmlictxt.hxx101
-rw-r--r--include/xmloff/xmlimp.hxx525
-rw-r--r--include/xmloff/xmlimppr.hxx192
-rw-r--r--include/xmloff/xmlmetae.hxx120
-rw-r--r--include/xmloff/xmlmetai.hxx69
-rw-r--r--include/xmloff/xmlmultiimagehelper.hxx59
-rw-r--r--include/xmloff/xmlnmspe.hxx106
-rw-r--r--include/xmloff/xmlnume.hxx94
-rw-r--r--include/xmloff/xmlnumfe.hxx134
-rw-r--r--include/xmloff/xmlnumfi.hxx214
-rw-r--r--include/xmloff/xmlnumi.hxx104
-rw-r--r--include/xmloff/xmlprcon.hxx70
-rw-r--r--include/xmloff/xmlprhdl.hxx58
-rw-r--r--include/xmloff/xmlprmap.hxx181
-rw-r--r--include/xmloff/xmlreg.hxx36
-rw-r--r--include/xmloff/xmlscripti.hxx54
-rw-r--r--include/xmloff/xmlstyle.hxx265
-rw-r--r--include/xmloff/xmltabe.hxx53
-rw-r--r--include/xmloff/xmltkmap.hxx59
-rw-r--r--include/xmloff/xmltoken.hxx3212
-rw-r--r--include/xmloff/xmltypes.hxx283
-rw-r--r--include/xmloff/xmluconv.hxx230
-rw-r--r--include/xmlreader/README28
-rw-r--r--include/xmlreader/detail/xmlreaderdllapi.hxx35
-rw-r--r--include/xmlreader/pad.hxx53
-rw-r--r--include/xmlreader/span.hxx79
-rw-r--r--include/xmlreader/xmlreader.hxx193
-rw-r--r--include/xmlscript/xml_helper.hxx139
-rw-r--r--include/xmlscript/xmldlg_imexp.hxx81
-rw-r--r--include/xmlscript/xmllib_imexp.hxx88
-rw-r--r--include/xmlscript/xmlmod_imexp.hxx59
-rw-r--r--include/xmlscript/xmlns.h39
-rw-r--r--include/xmlscript/xmlscriptdllapi.h33
2384 files changed, 357820 insertions, 0 deletions
diff --git a/include/animations/animationnodehelper.hxx b/include/animations/animationnodehelper.hxx
new file mode 100644
index 000000000000..d6f000d5dd40
--- /dev/null
+++ b/include/animations/animationnodehelper.hxx
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_ANIMATIONS_ANIMATIONNODEHELPER_HXX
+#define INCLUDED_ANIMATIONS_ANIMATIONNODEHELPER_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/animations/XAnimationNode.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/container/XEnumeration.hpp>
+
+#include <vector>
+
+/* Declaration and definition of AnimationNode helper */
+
+namespace anim
+{
+ // TODO(Q1): this could possibly be implemented with a somewhat
+ // more lightweight template, by having the actual worker receive
+ // only a function pointer, and a thin templated wrapper around
+ // that which converts member functions into that.
+
+ /** Apply given functor to every animation node child.
+
+ @param xNode
+ Parent node
+
+ @param rFunctor
+ Functor to apply. The functor must have an appropriate
+ operator()( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::animations::XAnimationNode >& ) member.
+
+ @return true, if the functor was successfully applied to
+ all children, false otherwise.
+ */
+ template< typename Functor > inline bool for_each_childNode( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode,
+ Functor& rFunctor )
+ {
+ try
+ {
+ // get an XEnumerationAccess to the children
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess >
+ xEnumerationAccess( xNode,
+ ::com::sun::star::uno::UNO_QUERY_THROW );
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >
+ xEnumeration( xEnumerationAccess->createEnumeration(),
+ ::com::sun::star::uno::UNO_QUERY_THROW );
+
+ while( xEnumeration->hasMoreElements() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >
+ xChildNode( xEnumeration->nextElement(),
+ ::com::sun::star::uno::UNO_QUERY_THROW );
+
+ rFunctor( xChildNode );
+ }
+
+ return true;
+ }
+ catch( ::com::sun::star::uno::Exception& )
+ {
+ return false;
+ }
+ }
+
+
+ /** pushes the given node to the given vector and recursivly calls itself for each child node.
+ */
+ inline void create_deep_vector( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode,
+ std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > >& rVector )
+ {
+ rVector.push_back( xNode );
+
+ try
+ {
+ // get an XEnumerationAccess to the children
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess >
+ xEnumerationAccess( xNode,
+ ::com::sun::star::uno::UNO_QUERY );
+
+ if( xEnumerationAccess.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >
+ xEnumeration( xEnumerationAccess->createEnumeration(),
+ ::com::sun::star::uno::UNO_QUERY );
+
+ if( xEnumeration.is() )
+ {
+ while( xEnumeration->hasMoreElements() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >
+ xChildNode( xEnumeration->nextElement(),
+ ::com::sun::star::uno::UNO_QUERY_THROW );
+
+ create_deep_vector( xChildNode, rVector );
+ }
+ }
+ }
+ }
+ catch( ::com::sun::star::uno::Exception& )
+ {
+ }
+ }
+}
+
+#endif /* INCLUDED_ANIMATIONS_ANIMATIONNODEHELPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/apple_remote/RemoteControl.h b/include/apple_remote/RemoteControl.h
new file mode 100644
index 000000000000..6e2c67765890
--- /dev/null
+++ b/include/apple_remote/RemoteControl.h
@@ -0,0 +1,113 @@
+/* -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*****************************************************************************
+ * RemoteControl.h
+ * RemoteControlWrapper
+ *
+ * Created by Martin Kahr on 11.03.06 under a MIT-style license.
+ * Copyright (c) 2006 martinkahr.com. All rights reserved.
+ *
+ * Code modified and adapted to OpenOffice.org
+ * by Eric Bachard on 11.08.2008 under the same License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED “AS ISâ€, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ *****************************************************************************/
+
+#import <Cocoa/Cocoa.h>
+
+// notifaction names that are being used to signal that an application wants to
+// have access to the remote control device or if the application has finished
+// using the remote control device
+extern NSString* REQUEST_FOR_REMOTE_CONTROL_NOTIFCATION;
+extern NSString* FINISHED_USING_REMOTE_CONTROL_NOTIFICATION;
+
+// keys used in user objects for distributed notifications
+extern NSString* kRemoteControlDeviceName;
+extern NSString* kApplicationIdentifier;
+extern NSString* kTargetApplicationIdentifier;
+
+// we have a 6 bit offset to make a hold event out of a normal event
+#define EVENT_TO_HOLD_EVENT_OFFSET 6
+
+@class RemoteControl;
+
+typedef enum _RemoteControlEventIdentifier {
+ // normal events
+ kRemoteButtonPlus =1<<1,
+ kRemoteButtonMinus =1<<2,
+ kRemoteButtonMenu =1<<3,
+ kRemoteButtonPlay =1<<4,
+ kRemoteButtonRight =1<<5,
+ kRemoteButtonLeft =1<<6,
+
+ // hold events
+ kRemoteButtonPlus_Hold =1<<7,
+ kRemoteButtonMinus_Hold =1<<8,
+ kRemoteButtonMenu_Hold =1<<9,
+ kRemoteButtonPlay_Hold =1<<10,
+ kRemoteButtonRight_Hold =1<<11,
+ kRemoteButtonLeft_Hold =1<<12,
+
+ // special events (not supported by all devices)
+ kRemoteControl_Switched =1<<13,
+
+ // New values for the "metallic" Remote (2009 model)
+ kMetallicRemote2009ButtonPlay =1<<14,
+ kMetallicRemote2009ButtonMiddlePlay =1<<15
+
+} RemoteControlEventIdentifier;
+
+@interface NSObject(RemoteControlDelegate)
+
+- (void) sendRemoteButtonEvent: (RemoteControlEventIdentifier) event pressedDown: (BOOL) pressedDown remoteControl: (RemoteControl*) remoteControl;
+
+@end
+
+/*
+ Base Interface for Remote Control devices
+*/
+@interface RemoteControl : NSObject {
+ id delegate;
+}
+
+// returns nil if the remote control device is not available
+- (id) initWithDelegate: (id) remoteControlDelegate;
+
+- (void) setListeningToRemote: (BOOL) value;
+- (BOOL) isListeningToRemote;
+
+- (BOOL) isOpenInExclusiveMode;
+- (void) setOpenInExclusiveMode: (BOOL) value;
+
+- (void) startListening: (id) sender;
+- (void) stopListening: (id) sender;
+
+// is this remote control sending the given event?
+- (BOOL) sendsEventForButtonIdentifier: (RemoteControlEventIdentifier) identifier;
+
+// sending of notifications between applications
++ (void) sendFinishedNotifcationForAppIdentifier: (NSString*) identifier;
++ (void) sendRequestForRemoteControlNotification;
+
+// name of the device
++ (const char*) remoteControlDeviceName;
+
+@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/apple_remote/RemoteMainController.h b/include/apple_remote/RemoteMainController.h
new file mode 100644
index 000000000000..5fde4639c155
--- /dev/null
+++ b/include/apple_remote/RemoteMainController.h
@@ -0,0 +1,52 @@
+/* -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*****************************************************************************
+ * RemoteMainController.h
+ *
+ *
+ * Created by Martin Kahr on 11.03.06 under a MIT-style license.
+ * Copyright (c) 2006 martinkahr.com. All rights reserved.
+ *
+ * Code modified and adapted to OpenOffice.org
+ * by Eric Bachard on 11.08.2008 under the same License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED “AS ISâ€, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ *****************************************************************************/
+
+#import <Cocoa/Cocoa.h>
+
+#define AppleRemoteControlEvent 15
+
+@class RemoteControl;
+@class MultiClickRemoteBehavior;
+
+//static void sendTheEvent( unichar, int );
+
+@interface MainController : NSObject {
+@public // else remoteControl is not reachable from GetSalData()->mpMainController
+ RemoteControl* remoteControl;
+@private
+ MultiClickRemoteBehavior* remoteControlBehavior;
+}
+- (RemoteControl*) remoteControl;
+- (MultiClickRemoteBehavior*) remoteBehavior;
+
+@end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/avmedia/avmediadllapi.h b/include/avmedia/avmediadllapi.h
new file mode 100644
index 000000000000..351b82854a7f
--- /dev/null
+++ b/include/avmedia/avmediadllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_AVMEDIADLLAPI_H
+#define INCLUDED_AVMEDIADLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(AVMEDIA_DLLIMPLEMENTATION)
+#define AVMEDIA_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define AVMEDIA_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define AVMEDIA_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_AVMEDIADLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/avmedia/mediaitem.hxx b/include/avmedia/mediaitem.hxx
new file mode 100644
index 000000000000..f14281999307
--- /dev/null
+++ b/include/avmedia/mediaitem.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 AVMEDIA_MEDIAITEM_HXX
+#define AVMEDIA_MEDIAITEM_HXX
+
+#include <boost/scoped_ptr.hpp>
+
+#include <tools/rtti.hxx>
+#include <svl/poolitem.hxx>
+#include <com/sun/star/media/ZoomLevel.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <avmedia/avmediadllapi.h>
+
+#define AVMEDIA_SETMASK_NONE ((sal_uInt32)(0x00000000))
+#define AVMEDIA_SETMASK_STATE ((sal_uInt32)(0x00000001))
+#define AVMEDIA_SETMASK_DURATION ((sal_uInt32)(0x00000002))
+#define AVMEDIA_SETMASK_TIME ((sal_uInt32)(0x00000004))
+#define AVMEDIA_SETMASK_LOOP ((sal_uInt32)(0x00000008))
+#define AVMEDIA_SETMASK_MUTE ((sal_uInt32)(0x00000010))
+#define AVMEDIA_SETMASK_VOLUMEDB ((sal_uInt32)(0x00000020))
+#define AVMEDIA_SETMASK_ZOOM ((sal_uInt32)(0x00000040))
+#define AVMEDIA_SETMASK_URL ((sal_uInt32)(0x00000080))
+#define AVMEDIA_SETMASK_ALL ((sal_uInt32)(0xffffffff))
+
+class SvStream;
+
+namespace avmedia
+{
+
+//---------------
+// - MediaState -
+// --------------
+
+enum MediaState
+{
+ MEDIASTATE_STOP = 0,
+ MEDIASTATE_PLAY = 1,
+ MEDIASTATE_PLAYFFW = 2,
+ MEDIASTATE_PAUSE = 3
+};
+
+// -------------
+// - MediaItem -
+// -------------
+
+class AVMEDIA_DLLPUBLIC MediaItem : public SfxPoolItem
+{
+public:
+ TYPEINFO();
+
+ explicit MediaItem( sal_uInt16 const i_nWhich = 0,
+ sal_uInt32 const nMaskSet = AVMEDIA_SETMASK_NONE );
+ MediaItem( const MediaItem& rMediaItem );
+ virtual ~MediaItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreUnit,
+ SfxMapUnit ePresUnit,
+ OUString& rText,
+ const IntlWrapper *pIntl ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ void merge( const MediaItem& rMediaItem );
+
+ sal_uInt32 getMaskSet() const;
+
+ void setState( MediaState eState );
+ MediaState getState() const;
+
+ void setDuration( double fDuration );
+ double getDuration() const;
+
+ void setTime( double fTime );
+ double getTime() const;
+
+ void setLoop( bool bLoop );
+ bool isLoop() const;
+
+ void setMute( bool bMute );
+ bool isMute() const;
+
+ void setVolumeDB( sal_Int16 nDB );
+ sal_Int16 getVolumeDB() const;
+
+ void setZoom( ::com::sun::star::media::ZoomLevel eZoom );
+ ::com::sun::star::media::ZoomLevel getZoom() const;
+
+ void setURL( const OUString& rURL,
+ OUString const*const pTempURL);
+ const OUString& getURL() const;
+
+ const OUString& getTempURL() const;
+
+private:
+
+ struct Impl;
+ ::boost::scoped_ptr<Impl> m_pImpl;
+};
+
+typedef ::avmedia::MediaItem avmedia_MediaItem;
+
+bool AVMEDIA_DLLPUBLIC EmbedMedia(
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>
+ const& xModel,
+ OUString const& rSourceURL,
+ OUString & o_rEmbeddedURL);
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/avmedia/mediaplayer.hxx b/include/avmedia/mediaplayer.hxx
new file mode 100644
index 000000000000..b823f7c63b67
--- /dev/null
+++ b/include/avmedia/mediaplayer.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 _AVMEDIA_MEDIACHILD_HXX
+#define _AVMEDIA_MEDIACHILD_HXX
+
+#include <sfx2/ctrlitem.hxx>
+#include <sfx2/dockwin.hxx>
+#include <avmedia/avmediadllapi.h>
+
+#define AVMEDIA_MEDIAWINDOW() \
+(static_cast< ::avmedia::MediaFloater* >( ( \
+SfxViewFrame::Current() && SfxViewFrame::Current()->GetChildWindow(::avmedia::MediaPlayer::GetChildWindowId())) ? \
+SfxViewFrame::Current()->GetChildWindow(::avmedia::MediaPlayer::GetChildWindowId())->GetWindow() : \
+NULL))
+
+namespace avmedia
+{
+
+class AVMEDIA_DLLPUBLIC MediaPlayer : public SfxChildWindow
+{
+public:
+ MediaPlayer( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
+ ~MediaPlayer();
+
+ SFX_DECL_CHILDWINDOW_WITHID( MediaPlayer );
+};
+
+class MediaWindow;
+
+class AVMEDIA_DLLPUBLIC MediaFloater : public SfxDockingWindow
+{
+public:
+
+ MediaFloater( SfxBindings* pBindings, SfxChildWindow* pCW, Window* pParent );
+ ~MediaFloater();
+
+ void setURL( const OUString& rURL, bool bPlayImmediately );
+ const OUString& getURL() const;
+
+ void dispatchCurrentURL();
+
+protected:
+
+ virtual void Resize();
+ virtual void ToggleFloatingMode();
+
+private:
+
+ MediaWindow* mpMediaWindow;
+ Size maLastSize;
+
+ AVMEDIA_DLLPRIVATE void implInit();
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/avmedia/mediatoolbox.hxx b/include/avmedia/mediatoolbox.hxx
new file mode 100644
index 000000000000..570167024aff
--- /dev/null
+++ b/include/avmedia/mediatoolbox.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 _AVMEDIA_MEDIATOOLBOX_HXX
+#define _AVMEDIA_MEDIATOOLBOX_HXX
+
+#include <svl/lstner.hxx>
+#include <sfx2/tbxctrl.hxx>
+#include <avmedia/avmediadllapi.h>
+
+namespace avmedia
+{
+
+// -------------------------------
+// - SvxGrafFilterToolBoxControl -
+// -------------------------------
+
+class MediaItem;
+
+class AVMEDIA_DLLPUBLIC MediaToolBoxControl : public SfxToolBoxControl
+{
+ friend class MediaToolBoxControl_Impl;
+
+public:
+
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ MediaToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbX );
+ ~MediaToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual Window* CreateItemWindow( Window* pParent );
+
+private:
+
+ AVMEDIA_DLLPRIVATE void implUpdateMediaControl();
+ AVMEDIA_DLLPRIVATE void implExecuteMediaControl( const MediaItem& rItem );
+};
+
+}
+
+#endif // _AVMEDIA_MEDIATOOLBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/avmedia/mediawindow.hxx b/include/avmedia/mediawindow.hxx
new file mode 100644
index 000000000000..a5cb5dc8e7a8
--- /dev/null
+++ b/include/avmedia/mediawindow.hxx
@@ -0,0 +1,123 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _AVMEDIA_MEDIAWINDOW_HXX
+#define _AVMEDIA_MEDIAWINDOW_HXX
+
+#include <memory>
+#include <vector>
+#include <tools/gen.hxx>
+#include <com/sun/star/media/ZoomLevel.hpp>
+#include <com/sun/star/media/XPlayer.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <avmedia/avmediadllapi.h>
+
+#define AVMEDIA_FRAMEGRABBER_DEFAULTFRAME -1.0
+
+class Window;
+class KeyEvent;
+class MouseEvent;
+class CommandEvent;
+class PopupMenu;
+class Pointer;
+struct AcceptDropEvent;
+struct ExecuteDropEvent;
+
+
+namespace avmedia
+{
+ typedef ::std::vector< ::std::pair< OUString, OUString > > FilterNameVector;
+
+ class MediaItem;
+
+ namespace priv { class MediaWindowImpl; }
+
+ class AVMEDIA_DLLPUBLIC MediaWindow
+ {
+ public:
+ MediaWindow( Window* parent, bool bInternalMediaControl );
+ virtual ~MediaWindow();
+
+ void setURL( const OUString& rURL );
+ const OUString& getURL() const;
+
+ bool isValid() const;
+ Size getPreferredSize() const;
+
+ Window* getWindow() const;
+
+ void setPosSize( const Rectangle& rNewRect );
+
+ void setPointer( const Pointer& rPointer );
+
+ bool start();
+
+ void updateMediaItem( MediaItem& rItem ) const;
+ void executeMediaItem( const MediaItem& rItem );
+
+ void show();
+ void hide();
+
+ public:
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void KeyUp( const KeyEvent& rKEvt );
+
+ virtual void Command( const CommandEvent& rCEvt );
+
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+
+ public:
+
+ static void getMediaFilters( FilterNameVector& rFilterNameVector );
+ /// @param o_pbLink if not 0, this is an "insert" dialog: display link
+ /// checkbox and store its state in *o_pbLink
+ static bool executeMediaURLDialog( Window* pParent,
+ OUString& rURL, bool *const o_pbLink );
+ static void executeFormatErrorBox( Window* pParent );
+ static bool isMediaURL( const OUString& rURL, bool bDeep = false, Size* pPreferredSizePixel = NULL );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > createPlayer( const OUString& rURL );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > grabFrame( const OUString& rURL,
+ bool bAllowToCreateReplacementGraphic = false,
+ double fMediaTime = AVMEDIA_FRAMEGRABBER_DEFAULTFRAME );
+
+ private:
+
+ // default: disabled copy/assignment
+ AVMEDIA_DLLPRIVATE MediaWindow(const MediaWindow&);
+ AVMEDIA_DLLPRIVATE MediaWindow& operator =( const MediaWindow& );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxIFace;
+ priv::MediaWindowImpl* mpImpl;
+ };
+}
+
+#endif // _AVMEDIA_MEDIAWINDOW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/accessor.hxx b/include/basebmp/accessor.hxx
new file mode 100644
index 000000000000..0ef3b5716465
--- /dev/null
+++ b/include/basebmp/accessor.hxx
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_ACCESSOR_HXX
+#define INCLUDED_BASEBMP_ACCESSOR_HXX
+
+#include <vigra/numerictraits.hxx>
+
+namespace basebmp
+{
+
+/** Standard accessor type
+
+ Accesses the iterator values the standard way (i.e. via
+ *operator()/operator[])
+ */
+template<typename ValueType> class StandardAccessor
+{
+public:
+ typedef ValueType value_type;
+
+ // -------------------------------------------------------
+
+ template< class Iterator >
+ value_type operator()(Iterator const& i) const
+ {
+ return *i;
+ }
+
+ template< class Iterator, class Difference >
+ value_type operator()(Iterator const& i, Difference const& diff) const
+ {
+ return i[diff];
+ }
+
+ // -------------------------------------------------------
+
+ template< typename V, class Iterator >
+ void set(V const& value, Iterator const& i) const
+ {
+ *i = vigra::detail::RequiresExplicitCast<value_type>::cast(value);
+ }
+
+ template< typename V, class Iterator, class Difference >
+ void set(V const& value, Iterator const& i, Difference const& diff) const
+ {
+ i[diff] = vigra::detail::RequiresExplicitCast<value_type>::cast(value);
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+/** Non-standard accessor type
+
+ Uses getter/setter methods at the given iterator type, to access
+ the underlying values.
+ */
+template<typename ValueType> class NonStandardAccessor
+{
+public:
+ typedef ValueType value_type;
+
+ // -------------------------------------------------------
+
+ template< class Iterator >
+ value_type operator()(Iterator const& i) const
+ {
+ return i.get();
+ }
+
+ template< class Iterator, class Difference >
+ value_type operator()(Iterator const& i, Difference const& diff) const
+ {
+ return i.get(diff);
+ }
+
+ // -------------------------------------------------------
+
+ template< typename V, class Iterator >
+ void set(V const& value, Iterator const& i) const
+ {
+ i.set( vigra::detail::RequiresExplicitCast<value_type>::cast(value) );
+ }
+
+ template< typename V, class Iterator, class Difference >
+ void set(V const& value, Iterator const& i, Difference const& diff) const
+ {
+ i.set( vigra::detail::RequiresExplicitCast<value_type>::cast(value),
+ diff );
+ }
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_ACCESSOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/accessoradapters.hxx b/include/basebmp/accessoradapters.hxx
new file mode 100644
index 000000000000..f4a05dc331c2
--- /dev/null
+++ b/include/basebmp/accessoradapters.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_BASEBMP_ACCESSORADAPTERS_HXX
+#define INCLUDED_BASEBMP_ACCESSORADAPTERS_HXX
+
+#include <vigra/numerictraits.hxx>
+
+namespace basebmp
+{
+
+/** Interpose given accessor's set and get methods with two unary
+ functors.
+
+ @tpl WrappedAccessor
+ Wrapped type must provide the usual get and set accessor methods,
+ with the usual signatures (see StandardAccessor for a conforming
+ example).
+
+ @tpl GetterFunctor
+ An Adaptable Unary Function (i.e. providing result_type and
+ argument_type typedefs)
+
+ @tpl SetterFunctor
+ An Adaptable Unary Function (i.e. providing result_type and
+ argument_type typedefs)
+ */
+template< class WrappedAccessor,
+ typename GetterFunctor,
+ typename SetterFunctor > class UnaryFunctionAccessorAdapter
+{
+public:
+ typedef typename GetterFunctor::result_type value_type;
+ typedef typename SetterFunctor::argument_type argument_type;
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+// making all members public, if no member template friends
+private:
+ template<class A, typename G, typename S> friend class UnaryFunctionAccessorAdapter;
+#endif
+
+ // we don't derive from wrapped type, to avoid ambiguities
+ // regarding templatized getter/setter methods.
+ WrappedAccessor maAccessor;
+ GetterFunctor maGetterFunctor;
+ SetterFunctor maSetterFunctor;
+
+public:
+ UnaryFunctionAccessorAdapter() :
+ maAccessor(),
+ maGetterFunctor(),
+ maSetterFunctor()
+ {}
+
+ template< class A > explicit
+ UnaryFunctionAccessorAdapter( UnaryFunctionAccessorAdapter< A,
+ GetterFunctor,
+ SetterFunctor > const& rSrc ) :
+ maAccessor( rSrc.maAccessor ),
+ maGetterFunctor( rSrc.maGetterFunctor ),
+ maSetterFunctor( rSrc.maSetterFunctor )
+ {}
+
+ template< class T > explicit UnaryFunctionAccessorAdapter( T const& accessor ) :
+ maAccessor( accessor ),
+ maGetterFunctor(),
+ maSetterFunctor()
+ {}
+
+ template< class T > UnaryFunctionAccessorAdapter( T accessor,
+ GetterFunctor getterFunctor,
+ SetterFunctor setterFunctor) :
+ maAccessor( accessor ),
+ maGetterFunctor( getterFunctor ),
+ maSetterFunctor( setterFunctor )
+ {}
+
+ // -------------------------------------------------------
+
+ WrappedAccessor const& getWrappedAccessor() const { return maAccessor; }
+ WrappedAccessor& getWrappedAccessor() { return maAccessor; }
+
+ // -------------------------------------------------------
+
+ value_type getter(typename GetterFunctor::argument_type v) const
+ {
+ return maGetterFunctor(v);
+ }
+ typename SetterFunctor::result_type setter(argument_type v) const
+ {
+ return maSetterFunctor(v);
+ }
+
+ // -------------------------------------------------------
+
+ template< class Iterator >
+ value_type operator()(Iterator const& i) const
+ {
+ return maGetterFunctor( maAccessor(i) );
+ }
+
+ template< class Iterator, class Difference >
+ value_type operator()(Iterator const& i, Difference const& diff) const
+ {
+ return maGetterFunctor( maAccessor(i,diff) );
+ }
+
+ // -------------------------------------------------------
+
+ template< typename V, class Iterator >
+ void set(V const& value, Iterator const& i) const
+ {
+ maAccessor.set(
+ maSetterFunctor(
+ vigra::detail::RequiresExplicitCast<argument_type>::cast(value) ),
+ i );
+ }
+
+ template< typename V, class Iterator, class Difference >
+ void set(V const& value, Iterator const& i, Difference const& diff) const
+ {
+ maAccessor.set(
+ maSetterFunctor(
+ vigra::detail::RequiresExplicitCast<argument_type>::cast(value) ),
+ i,
+ diff );
+ }
+
+};
+
+//-----------------------------------------------------------------------------
+
+/** Interpose given accessor's set methods with a binary function,
+ taking both old and new value.
+
+ The wrappee's getter methods kept as-is.
+
+ @tpl WrappedAccessor
+ Wrapped type must provide the usual get and set accessor methods,
+ with the usual signatures (see StandardAccessor for a conforming
+ example). Furthermore, must provide a nested typedef value_type.
+
+ @tpl SetterFunctor
+ An adaptable binary function (i.e. providing nested typedefs for
+ result_type and first and second argument type)
+ */
+template< class WrappedAccessor,
+ typename SetterFunctor > class BinarySetterFunctionAccessorAdapter
+{
+public:
+ typedef typename WrappedAccessor::value_type value_type;
+ typedef typename SetterFunctor::second_argument_type argument_type;
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+// making all members public, if no member template friends
+private:
+ template<class A, typename S> friend class BinarySetterFunctionAccessorAdapter;
+#endif
+
+ WrappedAccessor maAccessor;
+ SetterFunctor maFunctor;
+
+public:
+ BinarySetterFunctionAccessorAdapter() :
+ maAccessor(),
+ maFunctor()
+ {}
+
+ template< class A > explicit
+ BinarySetterFunctionAccessorAdapter(
+ BinarySetterFunctionAccessorAdapter< A,
+ SetterFunctor > const& rSrc ) :
+ maAccessor( rSrc.maAccessor ),
+ maFunctor( rSrc.maFunctor )
+ {}
+
+ template< class T > explicit BinarySetterFunctionAccessorAdapter( T const& accessor ) :
+ maAccessor( accessor ),
+ maFunctor()
+ {}
+
+ template< class T > BinarySetterFunctionAccessorAdapter( T accessor,
+ SetterFunctor functor ) :
+ maAccessor( accessor ),
+ maFunctor( functor )
+ {}
+
+ // -------------------------------------------------------
+
+ WrappedAccessor const& getWrappedAccessor() const { return maAccessor; }
+ WrappedAccessor& getWrappedAccessor() { return maAccessor; }
+
+ // -------------------------------------------------------
+
+ typename SetterFunctor::result_type setter(
+ typename SetterFunctor::first_argument_type v1,
+ argument_type v2 ) const
+ {
+ return maSetterFunctor(v1,v2);
+ }
+
+ // -------------------------------------------------------
+
+ template< class Iterator >
+ value_type operator()(Iterator const& i) const
+ {
+ return maAccessor(i);
+ }
+
+ template< class Iterator, class Difference >
+ value_type operator()(Iterator const& i, Difference const& diff) const
+ {
+ return maAccessor(i,diff);
+ }
+
+ // -------------------------------------------------------
+
+ template< typename V, class Iterator >
+ void set(V const& value, Iterator const& i) const
+ {
+ maAccessor.set(
+ maFunctor(maAccessor(i),
+ vigra::detail::RequiresExplicitCast<argument_type>::cast(value)),
+ i );
+ }
+
+ template< typename V, class Iterator, class Difference >
+ void set(V const& value, Iterator const& i, Difference const& diff) const
+ {
+ maAccessor.set(
+ maFunctor(maAccessor(i,diff),
+ vigra::detail::RequiresExplicitCast<argument_type>::cast(value)),
+ i,
+ diff );
+ }
+
+};
+
+//-----------------------------------------------------------------------------
+
+/** Write through a CompositeIterator's first wrapped iterator, by
+ piping the first wrapped iterator value, the second iterator
+ value, and the specified new value through a ternary function.
+
+ Passed iterator must fulfill the CompositeIterator concept. Note
+ that the getter/setter methods are not templatized regarding the
+ iterator type, to make the mask calculation optimization below
+ safe (see the maskedAccessor template metafunction below)
+
+ @tpl WrappedAccessor1
+ Wrapped type must provide the usual get and set accessor methods,
+ with the usual signatures (see StandardAccessor for a conforming
+ example). Furthermore, the type must provide a nested typedef
+ value_type (the selection of WrappedAccessor1 as the provider for
+ that typedef is rather arbitrary. Could have been
+ WrappedAccessor2, too. So sue me)
+
+ @tpl Functor
+ An adaptable ternary function (i.e. providing nested typedefs for
+ result_type and first, second and third argument type)
+ */
+template< class WrappedAccessor1,
+ class WrappedAccessor2,
+ typename Functor > class TernarySetterFunctionAccessorAdapter
+{
+public:
+ typedef typename WrappedAccessor1::value_type value_type;
+ typedef typename Functor::third_argument_type argument_type;
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+// making all members public, if no member template friends
+private:
+ template<class A1, class A2, typename F> friend class TernarySetterFunctionAccessorAdapter;
+#endif
+
+ WrappedAccessor1 ma1stAccessor;
+ WrappedAccessor2 ma2ndAccessor;
+ Functor maFunctor;
+
+public:
+ TernarySetterFunctionAccessorAdapter() :
+ ma1stAccessor(),
+ ma2ndAccessor(),
+ maFunctor()
+ {}
+
+ template< class T > explicit TernarySetterFunctionAccessorAdapter( T const& accessor ) :
+ ma1stAccessor( accessor ),
+ ma2ndAccessor(),
+ maFunctor()
+ {}
+
+ template< class A1, class A2 > explicit
+ TernarySetterFunctionAccessorAdapter(
+ TernarySetterFunctionAccessorAdapter< A1,
+ A2,
+ Functor > const& rSrc ) :
+ ma1stAccessor( rSrc.ma1stAccessor ),
+ ma2ndAccessor( rSrc.ma2ndAccessor ),
+ maFunctor( rSrc.maFunctor )
+ {}
+
+ template< class T1, class T2 >
+ TernarySetterFunctionAccessorAdapter( T1 accessor1,
+ T2 accessor2 ) :
+ ma1stAccessor( accessor1 ),
+ ma2ndAccessor( accessor2 ),
+ maFunctor()
+ {}
+
+ template< class T1, class T2 >
+ TernarySetterFunctionAccessorAdapter( T1 accessor1,
+ T2 accessor2,
+ Functor func ) :
+ ma1stAccessor( accessor1 ),
+ ma2ndAccessor( accessor2 ),
+ maFunctor( func )
+ {}
+
+ // -------------------------------------------------------
+
+ WrappedAccessor1 const& get1stWrappedAccessor() const { return ma1stAccessor; }
+ WrappedAccessor1& get1stWrappedAccessor() { return ma1stAccessor; }
+
+ WrappedAccessor2 const& get2ndWrappedAccessor() const { return ma2ndAccessor; }
+ WrappedAccessor2& get2ndWrappedAccessor() { return ma2ndAccessor; }
+
+ // -------------------------------------------------------
+
+ typename Functor::result_type setter(
+ typename Functor::first_argument_type v1,
+ typename Functor::second_argument_type v2,
+ argument_type v3 ) const
+ {
+ return maSetterFunctor(v1,v2,v3);
+ }
+
+ // -------------------------------------------------------
+
+ template< class Iterator >
+ value_type operator()(Iterator const& i) const
+ {
+ return ma1stAccessor(i.first());
+ }
+
+ template< class Iterator, class Difference >
+ value_type operator()(Iterator const& i, Difference const& diff) const
+ {
+ return ma1stAccessor(i.second(),diff);
+ }
+
+ // -------------------------------------------------------
+
+ template< typename V, class Iterator >
+ void set(V const& value, Iterator const& i) const
+ {
+ ma1stAccessor.set(
+ maFunctor(ma1stAccessor(i.first()),
+ ma2ndAccessor(i.second()),
+ vigra::detail::RequiresExplicitCast<argument_type>::cast(value)),
+ i.first() );
+ }
+
+ template< typename V, class Iterator, class Difference >
+ void set(V const& value, Iterator const& i, Difference const& diff) const
+ {
+ ma1stAccessor.set(
+ maFunctor(ma1stAccessor(i.first(), diff),
+ ma2ndAccessor(i.second(),diff),
+ vigra::detail::RequiresExplicitCast<argument_type>::cast(value)),
+ i.first(),
+ diff );
+ }
+
+};
+
+//-----------------------------------------------------------------------------
+
+/** Access two distinct images simultaneously
+
+ Passed iterator must fulfill the CompositeIterator concept
+ (i.e. wrap the two image's iterators into one
+ CompositeIterator). The getter and setter methods expect and
+ return a pair of values, with types equal to the two accessors
+ value types
+
+ @tpl WrappedAccessor1
+ Wrapped type must provide the usual get and set accessor methods,
+ with the usual signatures (see StandardAccessor for a conforming
+ example). Furthermore, the type must provide a nested typedef
+ value_type.
+
+ @tpl WrappedAccessor2
+ Wrapped type must provide the usual get and set accessor methods,
+ with the usual signatures (see StandardAccessor for a conforming
+ example). Furthermore, the type must provide a nested typedef
+ value_type.
+ */
+template< class WrappedAccessor1,
+ class WrappedAccessor2 > class JoinImageAccessorAdapter
+{
+public:
+ // TODO(F3): Need numeric traits and a few free functions to
+ // actually calculate with a pair (semantic: apply every operation
+ // individually to the contained types)
+ typedef std::pair<typename WrappedAccessor1::value_type,
+ typename WrappedAccessor2::value_type> value_type;
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+// making all members public, if no member template friends
+private:
+ template<class A1, class A2> friend class JoinImageAccessorAdapter;
+#endif
+
+ WrappedAccessor1 ma1stAccessor;
+ WrappedAccessor2 ma2ndAccessor;
+
+public:
+ JoinImageAccessorAdapter() :
+ ma1stAccessor(),
+ ma2ndAccessor()
+ {}
+
+ template< class T > explicit JoinImageAccessorAdapter( T const& accessor ) :
+ ma1stAccessor( accessor ),
+ ma2ndAccessor()
+ {}
+
+ template< class A1, class A2 > explicit
+ JoinImageAccessorAdapter(
+ JoinImageAccessorAdapter< A1,
+ A2 > const& rSrc ) :
+ ma1stAccessor( rSrc.ma1stAccessor ),
+ ma2ndAccessor( rSrc.ma2ndAccessor )
+ {}
+
+ template< class T1, class T2 >
+ JoinImageAccessorAdapter( T1 accessor1,
+ T2 accessor2 ) :
+ ma1stAccessor( accessor1 ),
+ ma2ndAccessor( accessor2 )
+ {}
+
+ // -------------------------------------------------------
+
+ WrappedAccessor1 const& get1stWrappedAccessor() const { return ma1stAccessor; }
+ WrappedAccessor1& get1stWrappedAccessor() { return ma1stAccessor; }
+
+ WrappedAccessor2 const& get2ndWrappedAccessor() const { return ma2ndAccessor; }
+ WrappedAccessor2& get2ndWrappedAccessor() { return ma2ndAccessor; }
+
+ // -------------------------------------------------------
+
+ template< class Iterator >
+ value_type operator()(Iterator const& i) const
+ {
+ return std::make_pair(ma1stAccessor(i.first()),
+ ma2ndAccessor(i.second()));
+ }
+
+ template< class Iterator, class Difference >
+ value_type operator()(Iterator const& i, Difference const& diff) const
+ {
+ return std::make_pair(ma1stAccessor(i.first(),diff),
+ ma2ndAccessor(i.second(),diff));
+ }
+
+ // -------------------------------------------------------
+
+ template< typename V, class Iterator >
+ void set(V const& value, Iterator const& i) const
+ {
+ ma1stAccessor.set(
+ vigra::detail::RequiresExplicitCast<typename WrappedAccessor1::value_type>::cast(
+ value.first),
+ i.first() );
+ ma2ndAccessor.set(
+ vigra::detail::RequiresExplicitCast<typename WrappedAccessor2::value_type>::cast(
+ value.second),
+ i.second() );
+ }
+
+ template< typename V, class Iterator, class Difference >
+ void set(V const& value, Iterator const& i, Difference const& diff) const
+ {
+ ma1stAccessor.set(
+ vigra::detail::RequiresExplicitCast<typename WrappedAccessor1::value_type>::cast(
+ value.first),
+ i.first(),
+ diff );
+ ma2ndAccessor.set(
+ vigra::detail::RequiresExplicitCast<typename WrappedAccessor2::value_type>::cast(
+ value.second),
+ i.second(),
+ diff );
+ }
+
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_ACCESSORADAPTERS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/accessorfunctors.hxx b/include/basebmp/accessorfunctors.hxx
new file mode 100644
index 000000000000..58550b010512
--- /dev/null
+++ b/include/basebmp/accessorfunctors.hxx
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_ACCESSORFUNCTORS_HXX
+#define INCLUDED_BASEBMP_ACCESSORFUNCTORS_HXX
+
+#include <osl/diagnose.h>
+#include <basebmp/metafunctions.hxx>
+
+#include <functional>
+
+namespace basebmp
+{
+
+// Some common accessor functors
+// ------------------------------------------------------------
+
+
+/// combine two values via XOR
+template< typename T > struct XorFunctor : public std::binary_function<T,T,T>
+{
+ T operator()( T v1, T v2 ) const { return v1 ^ v2; }
+};
+
+//-----------------------------------------------------------------------------
+
+/// Base class, passing on the arg types
+template< typename T, typename M > struct MaskFunctorBase :
+ public TernaryFunctorBase<T,M,T,T> {};
+
+
+/** Let a mask flag decide between two values
+
+ @tpl polarity
+ Mask polarity. When true, a false in the mask denotes
+ transparency, i.e. the original value will display. And vice
+ versa.
+ */
+template< typename T,
+ typename M,
+ bool polarity > struct GenericOutputMaskFunctor : public MaskFunctorBase<T,M>
+{
+ /// Ternary mask operation - selects v1 for !m == polarity, v2 otherwise
+ T operator()( T v1, M m, T v2 ) const
+ {
+ return !m == polarity ? v1 : v2;
+ }
+};
+
+/** Let a mask bit decide between two values (specialization for
+ integer mask types)
+ */
+template< typename T,
+ typename M,
+ bool polarity > struct IntegerOutputMaskFunctor;
+template< typename T,
+ typename M > struct IntegerOutputMaskFunctor<T,M,true> : public MaskFunctorBase<T,M>
+{
+ /** Mask v with state of m
+
+ @return v2, if m != 0, v1 otherwise.
+ */
+ T operator()( T v1, M m, T v2 ) const
+ {
+ typedef typename make_unsigned<T>::type unsigned_T;
+
+ // mask will be 0, iff m == 0, and 1 otherwise
+ const T mask( unsigned_cast<T>(m | -m) >> (sizeof(unsigned_T)*8 - 1) );
+ return v1*(M)(1-mask) + v2*mask;
+ }
+};
+template< typename T,
+ typename M > struct IntegerOutputMaskFunctor<T,M,false> : public MaskFunctorBase<T,M>
+{
+ /** Mask v with state of m
+
+ @return v2, if m != 0, v1 otherwise.
+ */
+ T operator()( T v1, M m, T v2 ) const
+ {
+ typedef typename make_unsigned<T>::type unsigned_T;
+
+ // mask will be 0, iff m == 0, and 1 otherwise
+ const T mask( unsigned_cast<T>(m | -m) >> (sizeof(unsigned_T)*8 - 1) );
+ return v1*mask + v2*(M)(1-mask);
+ }
+};
+
+/** Let a mask bit decide between two values (specialization for
+ binary-valued mask types)
+ */
+template< typename T, typename M, bool polarity > struct FastIntegerOutputMaskFunctor;
+template< typename T, typename M > struct FastIntegerOutputMaskFunctor<T,M,true> :
+ public MaskFunctorBase<T,M>
+{
+ /// Specialization, only valid if mask can only attain 0 or 1
+ T operator()( T v1, M m, T v2 ) const
+ {
+ OSL_ASSERT(m<=1);
+
+ return v1*(M)(1-m) + v2*m;
+ }
+};
+template< typename T, typename M > struct FastIntegerOutputMaskFunctor<T,M,false> :
+ public MaskFunctorBase<T,M>
+{
+ /// Specialization, only valid if mask can only attain 0 or 1
+ T operator()( T v1, M m, T v2 ) const
+ {
+ OSL_ASSERT(m<=1);
+
+ return v1*m + v2*(M)(1-m);
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+/** Split a pair value from a JoinImageAccessorAdapter into its
+ individual values, and pass it on to a ternary functor
+
+ This wrapper is an adaptable binary functor, and can thus be used
+ with a BinarySetterFunctionAccessorAdapter. Useful e.g. for
+ out-of-image alpha channel, or a masked image.
+
+ @tpl Functor
+ An adaptable ternary functor (as can e.g. be passed to the
+ TernarySetterFunctionAccessorAdapter)
+ */
+template< typename Functor > struct BinaryFunctorSplittingWrapper :
+ public std::binary_function<typename Functor::first_argument_type,
+ std::pair<typename Functor::third_argument_type,
+ typename Functor::second_argument_type>,
+ typename Functor::result_type>
+{
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+// making all members public, if no member template friends
+private:
+ template<class A> friend struct BinaryFunctorSplittingWrapper;
+#endif
+ Functor maFunctor;
+
+public:
+ BinaryFunctorSplittingWrapper() : maFunctor() {}
+
+ template< class A > explicit
+ BinaryFunctorSplittingWrapper(
+ BinaryFunctorSplittingWrapper<A> const& src ) : maFunctor(src.maFunctor) {}
+
+ template< class F > explicit
+ BinaryFunctorSplittingWrapper( F const& func ) : maFunctor(func) {}
+
+ typename Functor::result_type operator()(
+ typename Functor::first_argument_type v1,
+ std::pair< typename Functor::third_argument_type,
+ typename Functor::second_argument_type > const& v2 ) const
+ {
+ return maFunctor( v1, v2.second, v2.first );
+ }
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_ACCESSORFUNCTORS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/accessortraits.hxx b/include/basebmp/accessortraits.hxx
new file mode 100644
index 000000000000..4ce9e6926e35
--- /dev/null
+++ b/include/basebmp/accessortraits.hxx
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_ACCESSORTRAITS_HXX
+#define INCLUDED_BASEBMP_ACCESSORTRAITS_HXX
+
+#include <basebmp/accessorfunctors.hxx>
+#include <basebmp/accessoradapters.hxx>
+#include <basebmp/metafunctions.hxx>
+
+#include <functional>
+
+namespace basebmp
+{
+
+struct FastMask;
+struct NoFastMask;
+
+/// Metafunction to select output mask functor from iterator and mask value type
+template< typename T, typename M, bool polarity, typename DUMMY > struct outputMaskFunctorSelector : public
+ ifBothScalarIntegral< T, M,
+ IntegerOutputMaskFunctor< T, M, polarity >,
+ GenericOutputMaskFunctor< T, M, polarity > >
+{
+};
+template< typename T, typename M, bool polarity > struct outputMaskFunctorSelector< T, M, polarity, FastMask > : public
+ ifBothScalarIntegral< T, M,
+ FastIntegerOutputMaskFunctor< T, M, polarity >,
+ GenericOutputMaskFunctor< T, M, polarity > >
+{
+};
+
+/** Metafunction providing a point of configuration for iterators
+ capable of employing the fast output mask functor.
+
+ Specialize this metafunction for your case, and pass FastMask to
+ the outputMaskFunctorSelector.
+ */
+template< class Accessor,
+ class MaskAccessor,
+ class Iterator,
+ class MaskIterator,
+ bool polarity > struct maskedAccessorSelector
+{
+ typedef TernarySetterFunctionAccessorAdapter<
+ Accessor,
+ MaskAccessor,
+ typename outputMaskFunctorSelector<
+ typename Accessor::value_type,
+ typename MaskAccessor::value_type,
+ polarity,
+ NoFastMask > ::type >
+ type;
+};
+
+//-----------------------------------------------------------------------------
+
+/** Traits template for Accessor
+
+ Provides wrapped types for color lookup, raw pixel access, xor and
+ mask accessors.
+ */
+template< class Accessor > struct AccessorTraits
+{
+ /// value type of described accessor
+ typedef typename Accessor::value_type value_type;
+
+ /// Retrieve stand-alone color lookup function for given Accessor type
+ typedef project2nd< Accessor, value_type > color_lookup;
+
+ /// Retrieve raw pixel data accessor for given Accessor type
+ typedef Accessor raw_accessor;
+
+ /// Retrieve wrapped accessor for XOR setter access
+ typedef BinarySetterFunctionAccessorAdapter<
+ Accessor,
+ XorFunctor< value_type > > xor_accessor;
+
+ /** Retrieve masked accessor for given types
+
+ A masked accessor works like a filter, where the mask gates
+ the accessor's setter methods (if the mask contains a 0 at a
+ given iterator position, the original value is
+ preserved. Otherwise, the new value gets set).
+
+ @attention be careful when retrieving a masked accessor for a
+ set of types, and using it for a different one - there are
+ partial specializations that take an optimized functor for
+ certain mask accessors.
+ */
+ template< class MaskAccessor,
+ class Iterator,
+ class MaskIterator,
+ bool polarity > struct masked_accessor :
+ public maskedAccessorSelector< Accessor,
+ MaskAccessor,
+ Iterator,
+ MaskIterator,
+ polarity >
+ {};
+
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_ACCESSORTRAITS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/basebmpdllapi.h b/include/basebmp/basebmpdllapi.h
new file mode 100644
index 000000000000..c44eee01ce7b
--- /dev/null
+++ b/include/basebmp/basebmpdllapi.h
@@ -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_BASEBMP_BASEBMPDLLAPI_H
+#define INCLUDED_BASEBMP_BASEBMPDLLAPI_H
+
+#if defined BASEBMP_DLLIMPLEMENTATION
+#define BASEBMP_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define BASEBMP_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define BASEBMP_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_BASEBMP_BASEBMPDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/bitmapdevice.hxx b/include/basebmp/bitmapdevice.hxx
new file mode 100644
index 000000000000..941b01c840c3
--- /dev/null
+++ b/include/basebmp/bitmapdevice.hxx
@@ -0,0 +1,719 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_BITMAPDEVICE_HXX
+#define INCLUDED_BASEBMP_BITMAPDEVICE_HXX
+
+#include <sal/types.h>
+#include <basebmp/drawmodes.hxx>
+#include <basebmp/basebmpdllapi.h>
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/shared_array.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include <boost/noncopyable.hpp>
+#include <vector>
+
+namespace basegfx
+{
+ class B2IPoint;
+ class B2DPoint;
+ class B2IVector;
+ class B2IBox;
+ class B2DPolygon;
+ class B2DPolyPolygon;
+}
+
+namespace basebmp
+{
+
+// Temporary. Use like the tools color object
+class Color;
+typedef boost::shared_ptr< class BitmapDevice > BitmapDeviceSharedPtr;
+typedef boost::shared_ptr< struct IBitmapDeviceDamageTracker > IBitmapDeviceDamageTrackerSharedPtr;
+typedef boost::shared_array< sal_uInt8 > RawMemorySharedArray;
+typedef boost::shared_ptr< const std::vector<Color> > PaletteMemorySharedVector;
+
+struct ImplBitmapDevice;
+
+/// Interface for getting damage tracking events
+struct IBitmapDeviceDamageTracker
+{
+ /// gets called when said region is clobbered
+ virtual void damaged(const basegfx::B2IBox& rDamageRect) const = 0;
+
+protected:
+ ~IBitmapDeviceDamageTracker() {}
+};
+
+/** Definition of BitmapDevice interface
+
+ Use the createBitmapDevice() function to create instances.
+
+ Implementation note: the clip mask and bitmap parameter instances
+ of BitmapDevice that are passed to individual BitmapDevice
+ instances work best with 1 bit grey masks for the clip and a
+ format matching that of the target BitmapDevice for the other
+ parameters. The alpha mask passed to the drawMaskedColor() methods
+ works best when given as an eight bit grey bitmap. Everything else
+ is accepted, but potentially slow.
+ */
+class BASEBMP_DLLPUBLIC BitmapDevice : public boost::enable_shared_from_this<BitmapDevice>,
+ private boost::noncopyable
+{
+public:
+ /** Query size of device in pixel columns (X) and rows (Y, "scanlines")
+ */
+ basegfx::B2IVector getSize() const;
+
+ /** Query whether buffer starts with 0th scanline
+
+ @return true, if the buffer memory starts with the 0th
+ scanline, and false if it starts with the last one. The latter
+ is e.g. the typical scan line ordering for the Windows BMP
+ format.
+ */
+ bool isTopDown() const;
+
+ /** Query the size of the whole frame buffer
+
+ @ return the size of the whole frame buffer, the same as
+ getSize() unless this is a "subset" device.
+ */
+ basegfx::B2IVector getBufferSize() const;
+
+ /** Query type of scanline memory format
+ */
+ sal_Int32 getScanlineFormat() const;
+
+ /** Query byte offset to get from scanline n to scanline n+1
+
+ @return the scanline stride in bytes.
+ */
+ sal_Int32 getScanlineStride() const;
+
+ /** Get pointer to frame buffer
+
+ @return a shared ptr to the bitmap buffer memory. As this is a
+ shared ptr, you can freely store and use the pointer, even
+ after this object has been deleted.
+ */
+ RawMemorySharedArray getBuffer() const;
+
+ /// Query current damage tracking object (if any)
+ IBitmapDeviceDamageTrackerSharedPtr getDamageTracker() const;
+
+ /** Set new damage tracking object
+
+ @param rDamage
+ Object implementing the IBitmapDeviceDamageTracker interface -
+ everytime some area of the surface gets clobbered, that object
+ gets notified.
+ */
+ void setDamageTracker( const IBitmapDeviceDamageTrackerSharedPtr& rDamage );
+
+ /** Get pointer to palette
+
+ The returned pointer is const on purpose, since the
+ BitmapDevice might internally cache lookup information. Don't
+ modify the returned data, unless you want to enter the realm
+ of completely undefined behaviour.
+
+ @return shared pointer to vector of Color entries.
+ */
+ PaletteMemorySharedVector getPalette() const;
+
+ /** Clear whole device with given color
+
+ This method works like a fill with the given color value,
+ resulting in a bitmap uniformly colored in fillColor.
+ */
+ void clear( Color fillColor );
+
+ /** Set given pixel to specified color
+
+ @param rPt
+ Pixel to set
+
+ @param pixelColor
+ Color value to set the pixel to
+
+ @param drawMode
+ Draw mode to use when changing the pixel value
+ */
+ void setPixel( const basegfx::B2IPoint& rPt,
+ Color pixelColor,
+ DrawMode drawMode );
+
+ /** Set given pixel to specified color
+
+ @param rPt
+ Pixel to set
+
+ @param pixelColor
+ Color value to set the pixel to
+
+ @param drawMode
+ Draw mode to use when changing the pixel value
+
+ @param rClip
+ Clip mask to use. If the clip mask is 1 at the given pixel
+ position, no change will take place.
+ */
+ void setPixel( const basegfx::B2IPoint& rPt,
+ Color pixelColor,
+ DrawMode drawMode,
+ const BitmapDeviceSharedPtr& rClip );
+
+ /** Get color value at given pixel
+ */
+ Color getPixel( const basegfx::B2IPoint& rPt );
+
+ /** Get underlying pixel data value at given position
+
+ This method returns the raw pixel data. In the case of
+ paletted bitmaps, this is the palette index, not the final
+ color value.
+ */
+ sal_uInt32 getPixelData( const basegfx::B2IPoint& rPt );
+
+ /** Draw a line
+
+ @param rPt1
+ Start point of the line
+
+ @param rPt2
+ End point of the line. If the analytical line from rP1 to rPt2
+ (with the actual pixel positions assumed to be the center of
+ the pixel) is exactly in the middle between two pixel, this
+ method always selects the pixel closer to rPt1.
+
+ @param lineColor
+ Color value to draw the line with
+
+ @param drawMode
+ Draw mode to use when changing the pixel value
+ */
+ void drawLine( const basegfx::B2IPoint& rPt1,
+ const basegfx::B2IPoint& rPt2,
+ Color lineColor,
+ DrawMode drawMode );
+
+ /** Draw a line
+
+ @param rPt1
+ Start point of the line
+
+ @param rPt2
+ End point of the line. If the analytical line from rP1 to rPt2
+ (with the actual pixel positions assumed to be the center of
+ the pixel) is exactly in the middle between two pixel, this
+ method always selects the pixel closer to rPt1.
+
+ @param lineColor
+ Color value to draw the line with
+
+ @param drawMode
+ Draw mode to use when changing the pixel value
+
+ @param rClip
+ Clip mask to use. Pixel where the corresponding clip mask
+ pixel is 1 will not be modified.
+ */
+ void drawLine( const basegfx::B2IPoint& rPt1,
+ const basegfx::B2IPoint& rPt2,
+ Color lineColor,
+ DrawMode drawMode,
+ const BitmapDeviceSharedPtr& rClip );
+
+ /** Draw a polygon
+
+ @param rPoly
+ Polygon to draw. Depending on the value returned by rPoly's
+ isClosed() method, the resulting line polygon will be drawn
+ closed or not.
+
+ @param lineColor
+ Color value to draw the polygon with
+
+ @param drawMode
+ Draw mode to use when changing pixel values
+ */
+ void drawPolygon( const basegfx::B2DPolygon& rPoly,
+ Color lineColor,
+ DrawMode drawMode );
+
+ /** Draw a polygon
+
+ @param rPoly
+ Polygon to draw. Depending on the value returned by rPoly's
+ isClosed() method, the resulting line polygon will be drawn
+ closed or not.
+
+ @param lineColor
+ Color value to draw the polygon with
+
+ @param drawMode
+ Draw mode to use when changing pixel values
+
+ @param rClip
+ Clip mask to use. Pixel where the corresponding clip mask
+ pixel is 1 will not be modified.
+ */
+ void drawPolygon( const basegfx::B2DPolygon& rPoly,
+ Color lineColor,
+ DrawMode drawMode,
+ const BitmapDeviceSharedPtr& rClip );
+
+ /** Fill a poly-polygon
+
+ @param rPoly
+ Poly-polygon to fill. Regardless of the value returned by
+ rPoly's isClosed() method, the resulting filled poly-polygon
+ is always considered closed. As usual, when filling a shape,
+ the rightmost and bottommost pixel are not filled, compared to
+ the drawPolygon() method. For example, the rectangle
+ (0,0),(1,1) will have four pixel set, when drawn via
+ drawPolygon(), and only one pixel, when filled via
+ fillPolyPolygon().
+
+ @param fillColor
+ Color value to fill the poly-polygon with
+
+ @param drawMode
+ Draw mode to use when changing pixel values
+ */
+ void fillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly,
+ Color fillColor,
+ DrawMode drawMode );
+
+ /** Fill a poly-polygon
+
+ @param rPoly
+ Poly-polygon to fill. Regardless of the value returned by
+ rPoly's isClosed() method, the resulting filled poly-polygon
+ is always considered closed. As usual, when filling a shape,
+ the rightmost and bottommost pixel are not filled, compared to
+ the drawPolygon() method. For example, the rectangle
+ (0,0),(1,1) will have four pixel set, when drawn via
+ drawPolygon(), and only one pixel, when filled via
+ fillPolyPolygon().
+
+ @param fillColor
+ Color value to fill the poly-polygon with
+
+ @param drawMode
+ Draw mode to use when changing pixel values
+
+ @param rClip
+ Clip mask to use. Pixel where the corresponding clip mask
+ pixel is 1 will not be modified.
+ */
+ void fillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly,
+ Color fillColor,
+ DrawMode drawMode,
+ const BitmapDeviceSharedPtr& rClip );
+
+ /** Draw another bitmap into this device
+
+ @param rSrcBitmap
+ Bitmap to render into this one. It is permitted that source
+ and destination bitmap are the same.
+
+ @param rSrcRect
+ Rectangle within the source bitmap to take the pixel from.
+
+ @param rDstRect
+ Rectangle in the destination bitmap to put the pixel
+ into. Source and destination rectangle are permitted to have
+ differing sizes; this method will scale the source pixel
+ accordingly. Please note that both source and destination
+ rectangle are interpreted excluding the rightmost pixel column
+ and the bottommost pixel row, this is much like polygon
+ filling. As a result, filling a given rectangle with
+ fillPolyPolygon(), and using the same rectangle as the
+ destination rectangle of this method, will affect exactly the
+ same set of pixel.
+
+ @param drawMode
+ Draw mode to use when changing pixel values
+ */
+ void drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
+ const basegfx::B2IBox& rSrcRect,
+ const basegfx::B2IBox& rDstRect,
+ DrawMode drawMode );
+
+ /** Draw another bitmap into this device
+
+ @param rSrcBitmap
+ Bitmap to render into this one. It is permitted that source
+ and destination bitmap are the same.
+
+ @param rSrcRect
+ Rectangle within the source bitmap to take the pixel from.
+
+ @param rDstRect
+ Rectangle in the destination bitmap to put the pixel
+ into. Source and destination rectangle are permitted to have
+ differing sizes; this method will scale the source pixel
+ accordingly. Please note that both source and destination
+ rectangle are interpreted excluding the rightmost pixel column
+ and the bottommost pixel row, this is much like polygon
+ filling. As a result, filling a given rectangle with
+ fillPolyPolygon(), and using the same rectangle as the
+ destination rectangle of this method, will affect exactly the
+ same set of pixel.
+
+ @param drawMode
+ Draw mode to use when changing pixel values
+
+ @param rClip
+ Clip mask to use. Pixel where the corresponding clip mask
+ pixel is 1 will not be modified.
+ */
+ void drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
+ const basegfx::B2IBox& rSrcRect,
+ const basegfx::B2IBox& rDstRect,
+ DrawMode drawMode,
+ const BitmapDeviceSharedPtr& rClip );
+
+ /** Draw a color with an alpha-modulation bitmap into this device
+
+ This method takes a fixed color value, and an alpha mask. For
+ each pixel in the alpha mask, the given color value is blended
+ with the corresponding alpha value against the content of this
+ object.
+
+ @param aSrcColor
+ Color value to use for blending
+
+ @param rAlphaMask
+ Alpha mask to use for blending. It is permitted that alpha
+ mask and this bitmap are the same object.
+
+ @param rSrcRect
+ Rectangle within the alpha mask to take the pixel from.
+ Please note that the destination rectangle is interpreted
+ excluding the rightmost pixel column and the bottommost pixel
+ row, this is much like polygon filling. As a result, filling a
+ given rectangle with fillPolyPolygon(), and using the same
+ rectangle as the source rectangle of this method, will affect
+ exactly the same set of pixel.
+
+ @param rDstPoint
+ Destination point, where to start placing the pixel from the
+ source rectangle
+ */
+ void drawMaskedColor( Color aSrcColor,
+ const BitmapDeviceSharedPtr& rAlphaMask,
+ const basegfx::B2IBox& rSrcRect,
+ const basegfx::B2IPoint& rDstPoint );
+
+ /** Draw a color with an alpha-modulation bitmap into this device
+
+ This method takes a fixed color value, and an alpha mask. For
+ each pixel in the alpha mask, the given color value is blended
+ with the corresponding alpha value against the content of this
+ object.
+
+ @param aSrcColor
+ Color value to use for blending
+
+ @param rAlphaMask
+ Alpha mask to use for blending. It is permitted that alpha
+ mask and this bitmap are the same object.
+
+ @param rSrcRect
+ Rectangle within the alpha mask to take the pixel from.
+ Please note that the destination rectangle is interpreted
+ excluding the rightmost pixel column and the bottommost pixel
+ row, this is much like polygon filling. As a result, filling a
+ given rectangle with fillPolyPolygon(), and using the same
+ rectangle as the source rectangle of this method, will affect
+ exactly the same set of pixel.
+
+ @param rDstPoint
+ Destination point, where to start placing the pixel from the
+ source rectangle
+
+ @param rClip
+ Clip mask to use. Pixel where the corresponding clip mask
+ pixel is 1 will not be modified.
+ */
+ void drawMaskedColor( Color aSrcColor,
+ const BitmapDeviceSharedPtr& rAlphaMask,
+ const basegfx::B2IBox& rSrcRect,
+ const basegfx::B2IPoint& rDstPoint,
+ const BitmapDeviceSharedPtr& rClip );
+
+ /** Draw another bitmap through a mask into this device
+
+ This method renders a source bitmap into this device, much
+ like the drawBitmap() method. The only difference is the
+ additional mask parameter, which operates much like an
+ additional clip mask: pixel with value zero in this mask
+ result in destination pixel not being modified.
+
+ @param rSrcBitmap
+ Bitmap to render into this one. It is permitted that source
+ and destination bitmap are the same.
+
+ @param rMask
+ Bitmap to use as a mask. Pixel with value != zero in this mask
+ will result in destination pixel not being affected by the
+ blit operation.
+
+ @param rSrcRect
+ Rectangle within the source bitmap to take the pixel from.
+
+ @param rDstRect
+ Rectangle in the destination bitmap to put the pixel
+ into. Source and destination rectangle are permitted to have
+ differing sizes; this method will scale the source pixel
+ accordingly. Please note that both source and destination
+ rectangle are interpreted excluding the rightmost pixel column
+ and the bottommost pixel row, this is much like polygon
+ filling. As a result, filling a given rectangle with
+ fillPolyPolygon(), and using the same rectangle as the
+ destination rectangle of this method, will affect exactly the
+ same set of pixel.
+
+ @param drawMode
+ Draw mode to use when changing pixel values
+ */
+ void drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
+ const BitmapDeviceSharedPtr& rMask,
+ const basegfx::B2IBox& rSrcRect,
+ const basegfx::B2IBox& rDstRect,
+ DrawMode drawMode );
+
+ /** Draw another bitmap through a mask into this device
+
+ This method renders a source bitmap into this device, much
+ like the drawBitmap() method. The only difference is the
+ additional mask parameter, which operates much like an
+ additional clip mask: pixel with value != zero in this mask
+ result in destination pixel not being modified.
+
+ @param rSrcBitmap
+ Bitmap to render into this one. It is permitted that source
+ and destination bitmap are the same.
+
+ @param rMask
+ Bitmap to use as a mask. Pixel with value != zero in this mask
+ will result in destination pixel not being affected by the
+ blit operation.
+
+ @param rSrcRect
+ Rectangle within the source bitmap to take the pixel from.
+
+ @param rDstRect
+ Rectangle in the destination bitmap to put the pixel
+ into. Source and destination rectangle are permitted to have
+ differing sizes; this method will scale the source pixel
+ accordingly. Please note that both source and destination
+ rectangle are interpreted excluding the rightmost pixel column
+ and the bottommost pixel row, this is much like polygon
+ filling. As a result, filling a given rectangle with
+ fillPolyPolygon(), and using the same rectangle as the
+ destination rectangle of this method, will affect exactly the
+ same set of pixel.
+
+ @param drawMode
+ Draw mode to use when changing pixel values
+
+ @param rClip
+ Clip mask to use. Pixel where the corresponding clip mask
+ pixel is 1 will not be modified.
+ */
+ void drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
+ const BitmapDeviceSharedPtr& rMask,
+ const basegfx::B2IBox& rSrcRect,
+ const basegfx::B2IBox& rDstRect,
+ DrawMode drawMode,
+ const BitmapDeviceSharedPtr& rClip );
+
+protected:
+ BASEBMP_DLLPRIVATE BitmapDevice( const basegfx::B2IBox& rBounds,
+ const basegfx::B2IVector& rBufferSize,
+ sal_Int32 nScanlineFormat,
+ sal_Int32 nScanlineStride,
+ sal_uInt8* pFirstScanline,
+ const RawMemorySharedArray& rMem,
+ const PaletteMemorySharedVector& rPalette );
+ BASEBMP_DLLPRIVATE virtual ~BitmapDevice();
+
+private:
+ BASEBMP_DLLPRIVATE virtual bool isCompatibleBitmap( const BitmapDeviceSharedPtr& bmp ) const = 0;
+ BASEBMP_DLLPRIVATE virtual bool isCompatibleClipMask( const BitmapDeviceSharedPtr& bmp ) const = 0;
+ BASEBMP_DLLPRIVATE virtual bool isCompatibleAlphaMask( const BitmapDeviceSharedPtr& bmp ) const = 0;
+
+ BASEBMP_DLLPRIVATE virtual void clear_i( Color fillColor,
+ const basegfx::B2IBox& rBounds ) = 0;
+
+ BASEBMP_DLLPRIVATE virtual void setPixel_i( const basegfx::B2IPoint& rPt,
+ Color lineColor,
+ DrawMode drawMode ) = 0;
+ BASEBMP_DLLPRIVATE virtual void setPixel_i( const basegfx::B2IPoint& rPt,
+ Color lineColor,
+ DrawMode drawMode,
+ const BitmapDeviceSharedPtr& rClip ) = 0;
+
+ BASEBMP_DLLPRIVATE virtual Color getPixel_i( const basegfx::B2IPoint& rPt ) = 0;
+
+ BASEBMP_DLLPRIVATE virtual sal_uInt32 getPixelData_i( const basegfx::B2IPoint& rPt ) = 0;
+
+ BASEBMP_DLLPRIVATE virtual void drawLine_i( const basegfx::B2IPoint& rPt1,
+ const basegfx::B2IPoint& rPt2,
+ const basegfx::B2IBox& rBounds,
+ Color lineColor,
+ DrawMode drawMode ) = 0;
+ BASEBMP_DLLPRIVATE virtual void drawLine_i( const basegfx::B2IPoint& rPt1,
+ const basegfx::B2IPoint& rPt2,
+ const basegfx::B2IBox& rBounds,
+ Color lineColor,
+ DrawMode drawMode,
+ const BitmapDeviceSharedPtr& rClip ) = 0;
+
+ BASEBMP_DLLPRIVATE virtual void drawPolygon_i( const basegfx::B2DPolygon& rPoly,
+ const basegfx::B2IBox& rBounds,
+ Color lineColor,
+ DrawMode drawMode ) = 0;
+ BASEBMP_DLLPRIVATE virtual void drawPolygon_i( const basegfx::B2DPolygon& rPoly,
+ const basegfx::B2IBox& rBounds,
+ Color lineColor,
+ DrawMode drawMode,
+ const BitmapDeviceSharedPtr& rClip ) = 0;
+
+ BASEBMP_DLLPRIVATE virtual void fillPolyPolygon_i( const basegfx::B2DPolyPolygon& rPoly,
+ Color fillColor,
+ DrawMode drawMode,
+ const basegfx::B2IBox& rBounds ) = 0;
+ BASEBMP_DLLPRIVATE virtual void fillPolyPolygon_i( const basegfx::B2DPolyPolygon& rPoly,
+ Color fillColor,
+ DrawMode drawMode,
+ const basegfx::B2IBox& rBounds,
+ const BitmapDeviceSharedPtr& rClip ) = 0;
+
+ // must work with *this == rSrcBitmap!
+ BASEBMP_DLLPRIVATE virtual void drawBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap,
+ const basegfx::B2IBox& rSrcRect,
+ const basegfx::B2IBox& rDstRect,
+ DrawMode drawMode ) = 0;
+ BASEBMP_DLLPRIVATE virtual void drawBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap,
+ const basegfx::B2IBox& rSrcRect,
+ const basegfx::B2IBox& rDstRect,
+ DrawMode drawMode,
+ const BitmapDeviceSharedPtr& rClip ) = 0;
+
+ // must work with *this == rSrcBitmap!
+ BASEBMP_DLLPRIVATE virtual void drawMaskedColor_i( Color rSrcColor,
+ const BitmapDeviceSharedPtr& rAlphaMask,
+ const basegfx::B2IBox& rSrcRect,
+ const basegfx::B2IPoint& rDstPoint ) = 0;
+ BASEBMP_DLLPRIVATE virtual void drawMaskedColor_i( Color rSrcColor,
+ const BitmapDeviceSharedPtr& rAlphaMask,
+ const basegfx::B2IBox& rSrcRect,
+ const basegfx::B2IPoint& rDstPoint,
+ const BitmapDeviceSharedPtr& rClip ) = 0;
+
+ // must work with *this == rSrcBitmap!
+ BASEBMP_DLLPRIVATE virtual void drawMaskedBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap,
+ const BitmapDeviceSharedPtr& rMask,
+ const basegfx::B2IBox& rSrcRect,
+ const basegfx::B2IBox& rDstRect,
+ DrawMode drawMode ) = 0;
+ BASEBMP_DLLPRIVATE virtual void drawMaskedBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap,
+ const BitmapDeviceSharedPtr& rMask,
+ const basegfx::B2IBox& rSrcRect,
+ const basegfx::B2IBox& rDstRect,
+ DrawMode drawMode,
+ const BitmapDeviceSharedPtr& rClip ) = 0;
+
+ BASEBMP_DLLPRIVATE virtual IBitmapDeviceDamageTrackerSharedPtr getDamageTracker_i() const = 0;
+ BASEBMP_DLLPRIVATE virtual void setDamageTracker_i( const IBitmapDeviceDamageTrackerSharedPtr& rDamage ) = 0;
+
+ BitmapDeviceSharedPtr getGenericRenderer() const;
+
+ boost::scoped_ptr< ImplBitmapDevice > mpImpl;
+};
+
+/** Function to create a BitmapDevice for given scanline format
+ */
+BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC createBitmapDevice( const basegfx::B2IVector& rSize,
+ bool bTopDown,
+ sal_Int32 nScanlineFormat );
+
+/** Function to create a BitmapDevice for given scanline format
+ with the given palette
+
+ Note: the provided palette must have sufficient size, to satisfy
+ lookups for the whole range of pixel values from the specified
+ format.
+ */
+BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC createBitmapDevice( const basegfx::B2IVector& rSize,
+ bool bTopDown,
+ sal_Int32 nScanlineFormat,
+ const PaletteMemorySharedVector& rPalette );
+
+/** Function to create a BitmapDevice for given scanline format
+ from the given piece of raw memory and palette
+
+ Note: the provided memory must have sufficient size, to store the
+ image of the specified area and format.
+ */
+BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC createBitmapDevice( const basegfx::B2IVector& rSize,
+ bool bTopDown,
+ sal_Int32 nScanlineFormat,
+ const RawMemorySharedArray& rMem,
+ const PaletteMemorySharedVector& rPalette );
+
+
+/** Function to retrieve a subsetted BitmapDevice to the same
+ memory.
+
+ Note that there is no coordinate system translation or offsetting
+ involved.
+
+ This method creates a second bitmap device instance, which renders
+ to the same memory as the original, with the same pixel coordinate
+ pairs refering to the same pixels in the memory buffer, but with
+ rendering clipped to a rectangular area. Useful to implement
+ rectangular clips (usually faster than setting up a 1bpp clip
+ mask).
+
+ */
+BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC subsetBitmapDevice( const BitmapDeviceSharedPtr& rProto,
+ const basegfx::B2IBox& rSubset );
+
+/** Function to clone a BitmapDevice from a given prototype.
+
+ All attributes (like scanline format and top-down state) are
+ copied, only the size can be varied. Note that the prototype's
+ bitmap content is <em>not</em> copied, only a palette (if any).
+ */
+BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC cloneBitmapDevice( const basegfx::B2IVector& rSize,
+ const BitmapDeviceSharedPtr& rProto );
+
+}
+
+#endif /* INCLUDED_BASEBMP_BITMAPDEVICE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/clippedlinerenderer.hxx b/include/basebmp/clippedlinerenderer.hxx
new file mode 100644
index 000000000000..92ca167730f5
--- /dev/null
+++ b/include/basebmp/clippedlinerenderer.hxx
@@ -0,0 +1,411 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_CLIPPEDLINERENDERER_HXX
+#define INCLUDED_BASEBMP_CLIPPEDLINERENDERER_HXX
+
+#include <basegfx/tools/rectcliptools.hxx>
+#include <basegfx/point/b2ipoint.hxx>
+#include <basegfx/range/b2ibox.hxx>
+
+#include <vigra/diff2d.hxx>
+#include <vigra/iteratortraits.hxx>
+
+namespace basebmp
+{
+
+// factored-out bresenham setup code, which is used from two different
+// places in renderClippedLine() below. Admittedly messy for the long
+// parameter list...
+inline bool prepareClip( sal_Int32 a1,
+ sal_Int32 a2,
+ sal_Int32 b1,
+ sal_Int32 da,
+ sal_Int32 db,
+ sal_Int32& o_as,
+ sal_Int32& o_bs,
+ int sa,
+ int sb,
+ sal_Int32& io_rem,
+ int& o_n,
+ sal_uInt32 clipCode1,
+ sal_uInt32 clipCount1,
+ sal_uInt32 clipCode2,
+ sal_uInt32 clipCount2,
+ sal_Int32 aMin,
+ sal_uInt32 aMinFlag,
+ sal_Int32 aMax,
+ sal_uInt32 aMaxFlag,
+ sal_Int32 bMin,
+ sal_uInt32 bMinFlag,
+ sal_Int32 bMax,
+ sal_uInt32 bMaxFlag,
+ bool bRoundTowardsPt2,
+ bool& o_bUseAlternateBresenham )
+{
+ int ca(0), cb(0);
+ if( clipCode1 )
+ {
+ if( clipCode1 & aMinFlag )
+ {
+ ca = 2*db*(aMin - a1);
+ o_as = aMin;
+ }
+ else if( clipCode1 & aMaxFlag )
+ {
+ ca = 2*db*(a1 - aMax);
+ o_as = aMax;
+ }
+
+ if( clipCode1 & bMinFlag )
+ {
+ cb = 2*da*(bMin - b1);
+ o_bs = bMin;
+ }
+ else if( clipCode1 & bMaxFlag )
+ {
+ cb = 2*da*(b1 - bMax);
+ o_bs = bMax;
+ }
+
+ if( clipCount1 == 2 )
+ clipCode1 &= (ca + da < cb + !bRoundTowardsPt2) ? ~(aMinFlag|aMaxFlag) : ~(bMinFlag|bMaxFlag);
+
+ if( clipCode1 & (aMinFlag|aMaxFlag) )
+ {
+ cb = (ca + da - !bRoundTowardsPt2) / (2*da);
+
+ if( sb >= 0 )
+ {
+ o_bs = b1 + cb;
+ if( o_bs > bMax )
+ return false; // fully clipped
+ }
+ else
+ {
+ o_bs = b1 - cb;
+ if( o_bs < bMin )
+ return false; // fully clipped
+ }
+
+ io_rem += ca - 2*da*cb;
+ }
+ else
+ {
+ ca = (cb - da + 2*db - bRoundTowardsPt2) / (2*db);
+ if( sa >= 0 )
+ {
+ o_as = a1 + ca;
+ if( o_as > aMax )
+ return false; // fully clipped
+ }
+ else
+ {
+ o_as = a1 - ca;
+ if( o_as < aMin )
+ return false; // fully clipped
+ }
+
+ io_rem += 2*db*ca - cb;
+ }
+ }
+ else
+ {
+ o_as = a1; o_bs = b1;
+ }
+
+ if( clipCode2 )
+ {
+ if( clipCount2 == 2 )
+ {
+ ca = 2*db*((clipCode2 & aMinFlag) ? a1 - aMin : aMax - a1);
+ cb = 2*da*((clipCode2 & bMinFlag) ? b1 - bMin : bMax - b1);
+ clipCode2 &= (cb + da < ca + bRoundTowardsPt2) ? ~(aMinFlag|aMaxFlag) : ~(bMinFlag|bMaxFlag);
+ }
+
+ if( clipCode2 & (aMinFlag|aMaxFlag) )
+ o_n = (clipCode2 & aMinFlag) ? o_as - aMin : aMax - o_as;
+ else
+ {
+ o_n = (clipCode2 & bMinFlag) ? o_bs - bMin : bMax - o_bs;
+ o_bUseAlternateBresenham = true;
+ }
+ }
+ else
+ o_n = (a2 >= o_as) ? a2 - o_as : o_as - a2;
+
+ return true; // at least one pixel to render
+}
+
+
+/** Render line to image iterators, clip against given rectangle
+
+ This method renders a line from aPt1 to aPt2, clipped against
+ rClipRect (the clipping will take place pixel-perfect, i.e. as if
+ the original bresenham-rendered line would have been clipped each
+ pixel individually. No slight shifts compared to unclipped lines).
+
+ @param aPt1
+ Start point of the line
+
+ @param aPt2
+ End point of the line
+
+ @param rClipRect
+ Rectangle to clip against
+
+ @param color
+ Color value to render the line with
+
+ @param begin
+ left-top image iterator
+
+ @param end
+ right-bottom image iterator
+
+ @param acc
+ Image accessor
+
+ @param bRoundTowardsPt2
+ Rounding mode to use. Giving false here results in line pixel tend
+ towards pt1, i.e. when a pixel exactly hits the middle between two
+ pixel, the pixel closer to pt1 will be chosen. Giving true here
+ makes renderClippedLine() choose pt2 in those cases.
+ */
+template< class Iterator, class Accessor >
+void renderClippedLine( basegfx::B2IPoint aPt1,
+ basegfx::B2IPoint aPt2,
+ const basegfx::B2IBox& rClipRect,
+ typename Accessor::value_type color,
+ Iterator begin,
+ Accessor acc,
+ bool bRoundTowardsPt2=false )
+{
+ // Algorithm according to Steven Eker's 'Pixel-perfect line clipping',
+ // Graphics Gems V, pp. 314-322
+ sal_uInt32 clipCode1 = basegfx::tools::getCohenSutherlandClipFlags(aPt1,
+ rClipRect);
+ sal_uInt32 clipCode2 = basegfx::tools::getCohenSutherlandClipFlags(aPt2,
+ rClipRect);
+
+ if( clipCode1 & clipCode2 )
+ return; // line fully clipped away, both endpoints share a half-plane
+
+ sal_uInt32 clipCount1 = basegfx::tools::getNumberOfClipPlanes(clipCode1);
+ sal_uInt32 clipCount2 = basegfx::tools::getNumberOfClipPlanes(clipCode2);
+
+ if( (clipCode1 != 0 && clipCode2 == 0)
+ || (clipCount1 == 2 && clipCount2 == 1) )
+ {
+ std::swap(clipCount2,clipCount1);
+ std::swap(clipCode2,clipCode1);
+ std::swap(aPt1,aPt2);
+ bRoundTowardsPt2 = !bRoundTowardsPt2;
+ }
+
+ const sal_Int32 x1 = aPt1.getX();
+ const sal_Int32 x2 = aPt2.getX();
+ const sal_Int32 y1 = aPt1.getY();
+ const sal_Int32 y2 = aPt2.getY();
+
+ // TODO(E1): This might overflow
+ sal_Int32 adx = x2 - x1;
+ int sx = 1;
+ if( adx < 0 )
+ {
+ adx *= -1;
+ sx = -1;
+ }
+
+ // TODO(E1): This might overflow
+ sal_Int32 ady = y2 - y1;
+ int sy = 1;
+ if( ady < 0 )
+ {
+ ady *= -1;
+ sy = -1;
+ }
+
+ int n = 0;
+ sal_Int32 xs = x1;
+ sal_Int32 ys = y1;
+ bool bUseAlternateBresenham=false;
+ if( adx >= ady )
+ {
+ // semi-horizontal line
+ sal_Int32 rem = 2*ady - adx - !bRoundTowardsPt2;
+
+ if( !prepareClip(x1, x2, y1, adx, ady, xs, ys, sx, sy,
+ rem, n, clipCode1, clipCount1, clipCode2, clipCount2,
+ rClipRect.getMinX(), basegfx::tools::RectClipFlags::LEFT,
+ rClipRect.getMaxX()-1, basegfx::tools::RectClipFlags::RIGHT,
+ rClipRect.getMinY(), basegfx::tools::RectClipFlags::TOP,
+ rClipRect.getMaxY()-1, basegfx::tools::RectClipFlags::BOTTOM,
+ bRoundTowardsPt2, bUseAlternateBresenham ) )
+ return; // line fully clipped away, no active pixel inside rect
+
+ Iterator currIter( begin + vigra::Diff2D(0,ys) );
+ typename vigra::IteratorTraits<Iterator>::row_iterator
+ rowIter( currIter.rowIterator() + xs );
+
+ adx *= 2;
+ ady *= 2;
+
+ if( bUseAlternateBresenham )
+ {
+ while(true)
+ {
+ acc.set(color, rowIter);
+
+ if( rem >= 0 )
+ {
+ // this is intended - we clip endpoint against y
+ // plane, so n here denotes y range to render
+ if( --n < 0 )
+ break;
+
+ ys += sy;
+ xs += sx;
+ rem -= adx;
+
+ currIter.y += sy;
+ rowIter = currIter.rowIterator() + xs;
+ }
+ else
+ {
+ xs += sx;
+ rowIter += sx;
+ }
+
+ rem += ady;
+ }
+ }
+ else
+ {
+ while(true)
+ {
+ acc.set(color, rowIter);
+
+ if( --n < 0 )
+ break;
+
+ if( rem >= 0 )
+ {
+ ys += sy;
+ xs += sx;
+ rem -= adx;
+
+ currIter.y += sy;
+ rowIter = currIter.rowIterator() + xs;
+ }
+ else
+ {
+ xs += sx;
+ rowIter += sx;
+ }
+
+ rem += ady;
+ }
+ }
+ }
+ else
+ {
+ // semi-vertical line
+ sal_Int32 rem = 2*adx - ady - !bRoundTowardsPt2;
+
+ if( !prepareClip(y1, y2, x1, ady, adx, ys, xs, sy, sx,
+ rem, n, clipCode1, clipCount1, clipCode2, clipCount2,
+ rClipRect.getMinY(), basegfx::tools::RectClipFlags::TOP,
+ rClipRect.getMaxY()-1, basegfx::tools::RectClipFlags::BOTTOM,
+ rClipRect.getMinX(), basegfx::tools::RectClipFlags::LEFT,
+ rClipRect.getMaxX()-1, basegfx::tools::RectClipFlags::RIGHT,
+ bRoundTowardsPt2, bUseAlternateBresenham ) )
+ return; // line fully clipped away, no active pixel inside rect
+
+ Iterator currIter( begin + vigra::Diff2D(xs,0) );
+ typename vigra::IteratorTraits<Iterator>::column_iterator
+ colIter( currIter.columnIterator() + ys );
+
+ adx *= 2;
+ ady *= 2;
+
+ if( bUseAlternateBresenham )
+ {
+ while(true)
+ {
+ acc.set(color, colIter);
+
+ if( rem >= 0 )
+ {
+ // this is intended - we clip endpoint against x
+ // plane, so n here denotes x range to render
+ if( --n < 0 )
+ break;
+
+ xs += sx;
+ ys += sy;
+ rem -= ady;
+
+ currIter.x += sx;
+ colIter = currIter.columnIterator() + ys;
+ }
+ else
+ {
+ ys += sy;
+ colIter += sy;
+ }
+
+ rem += adx;
+ }
+ }
+ else
+ {
+ while(true)
+ {
+ acc.set(color, colIter);
+
+ if( --n < 0 )
+ break;
+
+ if( rem >= 0 )
+ {
+ xs += sx;
+ ys += sy;
+ rem -= ady;
+
+ currIter.x += sx;
+ colIter = currIter.columnIterator() + ys;
+ }
+ else
+ {
+ ys += sy;
+ colIter += sy;
+ }
+
+ rem += adx;
+ }
+ }
+ }
+}
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_CLIPPEDLINERENDERER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/color.hxx b/include/basebmp/color.hxx
new file mode 100644
index 000000000000..52451fff7fed
--- /dev/null
+++ b/include/basebmp/color.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_BASEBMP_COLOR_HXX
+#define INCLUDED_BASEBMP_COLOR_HXX
+
+#include <sal/types.h>
+#include <rtl/math.hxx>
+
+namespace basebmp
+{
+
+class Color
+{
+private:
+ sal_uInt32 mnColor;
+
+public:
+ typedef sal_uInt32 value_type;
+ typedef sal_uInt8 component_type;
+
+ Color() : mnColor(0) {}
+ explicit Color( sal_uInt32 nVal ) : mnColor(nVal) {}
+ Color( sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue ) :
+ mnColor( ((sal_uInt32)nRed << 16) | ((sal_uInt32)nGreen << 8) | nBlue )
+ {}
+
+ void setRed( sal_uInt8 nRed ) { mnColor &= ~0x00FF0000UL; mnColor |= (sal_uInt32)nRed << 16; }
+ void setGreen( sal_uInt8 nGreen ) { mnColor &= ~0x0000FF00UL; mnColor |= (sal_uInt32)nGreen << 8; }
+ void setBlue( sal_uInt8 nBlue ) { mnColor &= ~0x000000FFUL; mnColor |= nBlue; }
+
+ void setGrey( sal_uInt8 nGreyVal ) { mnColor = (sal_uInt32)nGreyVal << 16 | (sal_uInt32)nGreyVal << 8 | nGreyVal; }
+
+ sal_uInt8 getRed() const { return 0xFF & (sal_uInt8)(mnColor >> 16); }
+ sal_uInt8 getGreen() const { return 0xFF & (sal_uInt8)(mnColor >> 8); }
+ sal_uInt8 getBlue() const { return 0xFF & (sal_uInt8)mnColor; }
+
+ sal_uInt8 getGreyscale() const { return (sal_uInt8)((getBlue()*28UL +
+ getGreen()*151 +
+ getRed()*77) / 256); }
+
+ sal_uInt32 toInt32() const { return mnColor; }
+
+ bool operator!() const { return mnColor == 0; }
+ Color operator&( sal_uInt32 nMask ) const { return Color(mnColor & nMask); }
+ Color operator^( Color col ) const { return Color(col.getRed()^getRed(),
+ col.getGreen()^getGreen(),
+ col.getBlue()^getBlue()); }
+ Color operator-( Color col ) const { return Color((sal_uInt8)abs((int)getRed()-col.getRed()),
+ (sal_uInt8)abs((int)getGreen()-col.getGreen()),
+ (sal_uInt8)abs((int)getBlue()-col.getBlue())); }
+ Color operator+( Color col ) const { return Color(getRed()+col.getRed(),
+ getGreen()+col.getGreen(),
+ getBlue()+col.getBlue()); }
+ Color operator*( Color col ) const { return Color((sal_uInt8)((sal_uInt32)col.getRed()*getRed()/SAL_MAX_UINT8),
+ (sal_uInt8)((sal_uInt32)col.getGreen()*getGreen()/SAL_MAX_UINT8),
+ (sal_uInt8)((sal_uInt32)col.getBlue()*getBlue()/SAL_MAX_UINT8)); }
+ Color operator*( sal_uInt8 n ) const { return Color((sal_uInt8)((sal_uInt32)n*getRed()/SAL_MAX_UINT8),
+ (sal_uInt8)((sal_uInt32)n*getGreen()/SAL_MAX_UINT8),
+ (sal_uInt8)((sal_uInt32)n*getBlue()/SAL_MAX_UINT8)); }
+ Color operator*( double n ) const { return Color((sal_uInt8)(n*getRed()+.5),
+ (sal_uInt8)(n*getGreen()+.5),
+ (sal_uInt8)(n*getBlue()+.5)); }
+ bool operator==( const Color& rhs ) const { return (getRed()==rhs.getRed() &&
+ getGreen()==rhs.getGreen() &&
+ getBlue()==rhs.getBlue()); }
+ bool operator!=( const Color& rhs ) const { return !(*this==rhs); }
+ double magnitude() const { return sqrt((double)getRed()*getRed()
+ + getGreen()*getGreen()
+ + getBlue()*getBlue()); }
+};
+
+} // namespace vigra
+
+#endif /* INCLUDED_BASEBMP_COLOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/colorblendaccessoradapter.hxx b/include/basebmp/colorblendaccessoradapter.hxx
new file mode 100644
index 000000000000..c4511c709844
--- /dev/null
+++ b/include/basebmp/colorblendaccessoradapter.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_BASEBMP_COLORBLENDACCESSORADAPTER_HXX
+#define INCLUDED_BASEBMP_COLORBLENDACCESSORADAPTER_HXX
+
+#include <basebmp/colortraits.hxx>
+
+namespace basebmp
+{
+
+/** Accessor adapter that blends input value against fixed color value
+
+ Used to blend an alpha mask 'through' a fixed color value into the
+ destination.
+
+ The getter functors return a constant value (usually the zero of
+ the value type, this preserves the original destination content
+ when blitting through a mask) - there really isn't no other
+ sensible default behaviour for these methods.
+ */
+template< class WrappedAccessor,
+ typename AlphaType,
+ bool polarity > class ConstantColorBlendSetterAccessorAdapter
+{
+public:
+ typedef AlphaType alpha_type;
+ typedef AlphaType value_type;
+ typedef typename WrappedAccessor::value_type color_type;
+
+private:
+ typename ColorTraits< color_type >::
+ template blend_functor<alpha_type,polarity>::type maFunctor;
+ WrappedAccessor maWrappee;
+ color_type maBlendColor;
+ value_type maGetterValue;
+
+public:
+ ConstantColorBlendSetterAccessorAdapter() :
+ maFunctor(),
+ maWrappee(),
+ maBlendColor(),
+ maGetterValue()
+ {}
+
+ template< class T > explicit ConstantColorBlendSetterAccessorAdapter( T acc ) :
+ maFunctor(),
+ maWrappee(acc),
+ maBlendColor(),
+ maGetterValue()
+ {}
+
+ template< class T > ConstantColorBlendSetterAccessorAdapter( T acc,
+ color_type col ) :
+ maFunctor(),
+ maWrappee(acc),
+ maBlendColor(col),
+ maGetterValue()
+ {}
+
+ template< class T > ConstantColorBlendSetterAccessorAdapter( T acc,
+ color_type col,
+ value_type val ) :
+ maFunctor(),
+ maWrappee(acc),
+ maBlendColor(col),
+ maGetterValue(val)
+ {}
+
+ // -------------------------------------------------------
+
+ void setColor( color_type col ) { maBlendColor=col; }
+ color_type getColor() { return maBlendColor; }
+ void setGetterValue( value_type val ) { maGetterValue=val; }
+ value_type getGetterValue() { return maGetterValue; }
+
+ // -------------------------------------------------------
+
+ WrappedAccessor const& getWrappedAccessor() const { return maWrappee; }
+ WrappedAccessor& getWrappedAccessor() { return maWrappee; }
+
+ // -------------------------------------------------------
+
+ /// @return constant value, regardless of iterator content
+ template< typename IteratorType > value_type operator()(SAL_UNUSED_PARAMETER IteratorType const& ) const
+ {
+ return maGetterValue;
+ }
+ /// @return constant value, regardless of iterator content
+ template< typename IteratorType, class Difference >
+ value_type operator()(SAL_UNUSED_PARAMETER IteratorType const& , SAL_UNUSED_PARAMETER Difference const& ) const
+ {
+ return maGetterValue;
+ }
+
+ // -------------------------------------------------------
+
+ template< typename V, typename IteratorType >
+ void set(V const& value, IteratorType const& i) const
+ {
+ maWrappee.set(
+ maFunctor(
+ vigra::detail::RequiresExplicitCast<alpha_type>::cast(value),
+ maWrappee(i),
+ maBlendColor),
+ i );
+ }
+
+ template< typename V, typename IteratorType, class Difference >
+ void set(V const& value, IteratorType const& i, Difference const& diff) const
+ {
+ maWrappee.set(
+ maFunctor(
+ vigra::detail::RequiresExplicitCast<alpha_type>::cast(value),
+ maWrappee(i,diff),
+ maBlendColor),
+ i,
+ diff );
+ }
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_COLORBLENDACCESSORADAPTER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/colormisc.hxx b/include/basebmp/colormisc.hxx
new file mode 100644
index 000000000000..d2142968d3ba
--- /dev/null
+++ b/include/basebmp/colormisc.hxx
@@ -0,0 +1,185 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_COLORMISC_HXX
+#define INCLUDED_BASEBMP_COLORMISC_HXX
+
+#include <osl/diagnose.h>
+#include <basebmp/color.hxx>
+#include <basebmp/colortraits.hxx>
+#include <basebmp/accessortraits.hxx>
+#include <vigra/mathutil.hxx>
+
+// Contents of this header moved out of color.hxx, as it is not useful
+// for the general public (drags in vigra and other template
+// functionality, that shouldn't be necessary for the ordinary client
+// of BitmapDevice etc.)
+
+namespace basebmp
+{
+
+template< bool polarity > struct ColorBitmaskOutputMaskFunctor;
+template<> struct ColorBitmaskOutputMaskFunctor<true> : MaskFunctorBase<Color,sal_uInt8>
+{
+ Color operator()( Color v1, sal_uInt8 m, Color v2 ) const
+ {
+ OSL_ASSERT(m<=1);
+
+ return Color(v1.toInt32()*(sal_uInt8)(1-m) + v2.toInt32()*m);
+ }
+};
+template<> struct ColorBitmaskOutputMaskFunctor<false> : MaskFunctorBase<Color,sal_uInt8>
+{
+ Color operator()( Color v1, sal_uInt8 m, Color v2 ) const
+ {
+ OSL_ASSERT(m<=1);
+
+ return Color(v1.toInt32()*m + v2.toInt32()*(sal_uInt8)(1-m));
+ }
+};
+
+/// Specialized output mask functor for Color value type
+template<bool polarity> struct outputMaskFunctorSelector< Color, sal_uInt8, polarity, FastMask >
+{
+ typedef ColorBitmaskOutputMaskFunctor<polarity> type;
+};
+
+template< bool polarity > struct ColorBlendFunctor8
+ : public TernaryFunctorBase<sal_uInt8,Color,Color,Color>
+{
+ Color operator()( sal_uInt8 alpha,
+ Color v1,
+ Color v2 ) const
+ {
+ alpha = polarity ? alpha : 255 - alpha;
+
+ const sal_uInt8 v1_red( v1.getRed() );
+ const sal_uInt8 v1_green( v1.getGreen() );
+ const sal_uInt8 v1_blue( v1.getBlue() );
+
+ // using '>> 8' instead of '/ 0x100' is ill-advised (shifted
+ // value might be negative). Better rely on decent optimizer
+ // here...
+ return Color(((((sal_Int32)v2.getRed() - v1_red)*alpha) / 0x100) + v1_red,
+ ((((sal_Int32)v2.getGreen() - v1_green)*alpha) / 0x100) + v1_green,
+ ((((sal_Int32)v2.getBlue() - v1_blue)*alpha) / 0x100) + v1_blue);
+ }
+};
+
+template< bool polarity > struct ColorBlendFunctor32
+ : public TernaryFunctorBase<Color,Color,Color,Color>
+{
+ Color operator()( Color input,
+ Color v1,
+ Color v2 ) const
+ {
+ sal_uInt8 alpha = input.getGreyscale();
+ alpha = polarity ? alpha : 255 - alpha;
+
+ const sal_uInt8 v1_red( v1.getRed() );
+ const sal_uInt8 v1_green( v1.getGreen() );
+ const sal_uInt8 v1_blue( v1.getBlue() );
+
+ // using '>> 8' instead of '/ 0x100' is ill-advised (shifted
+ // value might be negative). Better rely on decent optimizer
+ // here...
+ return Color(((((sal_Int32)v2.getRed() - v1_red)*alpha) / 0x100) + v1_red,
+ ((((sal_Int32)v2.getGreen() - v1_green)*alpha) / 0x100) + v1_green,
+ ((((sal_Int32)v2.getBlue() - v1_blue)*alpha) / 0x100) + v1_blue);
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+template<> struct ColorTraits< Color >
+{
+ /// @return number of color channels
+ static int numChannels() { return 3; }
+
+ /// Type of a color component (i.e. the type of an individual channel)
+ typedef sal_uInt8 component_type;
+
+ /// Metafunction to select blend functor from color and alpha type
+ template< typename AlphaType, bool polarity > struct blend_functor;
+
+ /// Calculate normalized distance between color c1 and c2
+ static inline double distance( const Color& c1,
+ const Color& c2 )
+ {
+ return (c1 - c2).magnitude();
+ }
+
+ static inline component_type toGreyscale( const Color& c )
+ {
+ return c.getGreyscale();
+ }
+
+ static inline Color fromGreyscale( component_type c )
+ {
+ return Color(c,c,c);
+ }
+};
+
+/// The version for plain 8 bit alpha
+template<bool polarity> struct ColorTraits< Color >::blend_functor< sal_uInt8, polarity >
+{
+ typedef ColorBlendFunctor8<polarity> type;
+};
+
+/// The version taking grey value of a Color
+template<bool polarity> struct ColorTraits< Color >::blend_functor< Color, polarity >
+{
+ typedef ColorBlendFunctor32<polarity> type;
+};
+
+} // namespace basebmp
+
+namespace vigra
+{
+
+template<>
+struct NumericTraits<basebmp::Color>
+{
+ typedef basebmp::Color Type;
+ typedef basebmp::Color Promote;
+ typedef basebmp::Color RealPromote;
+ typedef std::complex<basebmp::Color> ComplexPromote;
+ typedef sal_uInt8 ValueType;
+
+ typedef VigraTrueType isIntegral;
+ typedef VigraFalseType isScalar;
+ typedef VigraTrueType isSigned;
+ typedef VigraTrueType isOrdered;
+ typedef VigraFalseType isComplex;
+
+ static Type zero() { return Type(); }
+ static Type one() { return Type(0x01010101); }
+ static Type nonZero() { return Type(0x01010101); }
+
+ static Promote toPromote(const Type& v) { return v; }
+ static RealPromote toRealPromote(const Type& v) { return v; }
+ static Type fromPromote(const Promote& v) { return v; }
+ static Type fromRealPromote(const RealPromote& v) { return v; }
+};
+
+} // namespace vigra
+
+#endif /* INCLUDED_BASEBMP_COLORMISC_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/colortraits.hxx b/include/basebmp/colortraits.hxx
new file mode 100644
index 000000000000..bcbc8f9b259d
--- /dev/null
+++ b/include/basebmp/colortraits.hxx
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_COLORTRAITS_HXX
+#define INCLUDED_BASEBMP_COLORTRAITS_HXX
+
+#include <basebmp/accessoradapters.hxx>
+#include <basebmp/metafunctions.hxx>
+
+#include <vigra/mathutil.hxx>
+
+namespace basebmp
+{
+
+/** Functor template, to calculate alpha blending between two
+ values. Float case.
+
+ @tpl polarity
+ When true, 0 means fully transparent, and 1 fully opaque. And vice
+ versa.
+ */
+template< typename ValueType,
+ typename AlphaType,
+ bool polarity > struct BlendFunctor;
+template< typename ValueType,
+ typename AlphaType > struct BlendFunctor<ValueType,AlphaType,true>
+ : public TernaryFunctorBase<AlphaType,ValueType,ValueType,ValueType>
+{
+ ValueType operator()( AlphaType alpha,
+ ValueType v1,
+ ValueType v2 ) const
+ {
+ const typename vigra::NumericTraits<AlphaType>::RealPromote fAlpha(
+ vigra::NumericTraits<AlphaType>::toRealPromote(alpha));
+ return (vigra::NumericTraits<AlphaType>::one()-fAlpha)*v1 + fAlpha*v2;
+ }
+};
+template< typename ValueType,
+ typename AlphaType > struct BlendFunctor<ValueType,AlphaType,false>
+ : public TernaryFunctorBase<AlphaType,ValueType,ValueType,ValueType>
+{
+ ValueType operator()( AlphaType alpha,
+ ValueType v1,
+ ValueType v2 ) const
+ {
+ const typename vigra::NumericTraits<AlphaType>::RealPromote fAlpha(
+ vigra::NumericTraits<AlphaType>::toRealPromote(alpha));
+ return fAlpha*v1 + (vigra::NumericTraits<AlphaType>::one()-fAlpha)*v2;
+ }
+};
+
+/** Functor template, to calculate alpha blending between two
+ values. Integer case.
+
+ @tpl polarity
+ When true, 0 means fully transparent, and 1 fully opaque. And vice
+ versa.
+ */
+template< typename ValueType,
+ typename AlphaType,
+ bool polarity > struct IntegerBlendFunctor;
+template< typename ValueType,
+ typename AlphaType > struct IntegerBlendFunctor<ValueType,AlphaType,true>
+ : public TernaryFunctorBase<AlphaType,ValueType,ValueType,ValueType>
+{
+ ValueType operator()( AlphaType alpha,
+ ValueType v1,
+ ValueType v2 ) const
+ {
+ return (vigra::NumericTraits<AlphaType>::toPromote(
+ vigra::NumericTraits<AlphaType>::max()-alpha)*v1 + alpha*v2) /
+ vigra::NumericTraits<AlphaType>::max();
+ }
+};
+template< typename ValueType,
+ typename AlphaType > struct IntegerBlendFunctor<ValueType,AlphaType,false>
+ : public TernaryFunctorBase<AlphaType,ValueType,ValueType,ValueType>
+{
+ ValueType operator()( AlphaType alpha,
+ ValueType v1,
+ ValueType v2 ) const
+ {
+ return (alpha*v1 +
+ vigra::NumericTraits<AlphaType>::toPromote(
+ vigra::NumericTraits<AlphaType>::max()-alpha)*v2) /
+ vigra::NumericTraits<AlphaType>::max();
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+template< typename ColorType > struct ColorTraits
+{
+ /// Metafunction to select blend functor from color and alpha type
+ template< typename AlphaType, bool polarity > struct blend_functor : public
+ ifScalarIntegral< AlphaType,
+ IntegerBlendFunctor< ColorType, AlphaType, polarity >,
+ BlendFunctor< ColorType, AlphaType, polarity > > {};
+
+ /// @return number of color channels
+ static int numChannels() { return 1; }
+
+ /// Type of a color component (i.e. the type of an individual channel)
+ typedef ColorType component_type;
+
+ /// Calculate normalized distance between color c1 and c2
+ static inline vigra::NormTraits<ColorType> distance( ColorType c1,
+ ColorType c2 )
+ {
+ return vigra::norm(c1 - c2);
+ }
+
+ static inline component_type toGreyscale( ColorType c )
+ {
+ return c;
+ }
+
+ static inline ColorType fromGreyscale( component_type c )
+ {
+ return c;
+ }
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_COLORTRAITS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/compositeiterator.hxx b/include/basebmp/compositeiterator.hxx
new file mode 100644
index 000000000000..4fb9c10f0bb4
--- /dev/null
+++ b/include/basebmp/compositeiterator.hxx
@@ -0,0 +1,361 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_COMPOSITEITERATOR_HXX
+#define INCLUDED_BASEBMP_COMPOSITEITERATOR_HXX
+
+#include <sal/types.h>
+#include <osl/diagnose.h>
+
+#include <basebmp/nonstandarditerator.hxx>
+#include <vigra/tuple.hxx>
+#include <vigra/iteratortraits.hxx>
+
+
+namespace basebmp
+{
+
+namespace detail
+{
+ template< typename T1, typename T2 > class ArithmeticProxy
+ {
+ public:
+ ArithmeticProxy(T1& val1, T2& val2) :
+ mpVal1( &val1 ),
+ mpVal2( &val2 )
+ {}
+
+ void operator++() { ++(*mpVal1); ++(*mpVal2); }
+ void operator++(int) { (*mpVal1)++; (*mpVal2)++; }
+ void operator--() { --(*mpVal1); --(*mpVal2); }
+ void operator--(int) { (*mpVal1)--; (*mpVal2)--; }
+ void operator+=(int d) {*mpVal1+=d; *mpVal2+=d; }
+ void operator-=(int d) {*mpVal1-=d; *mpVal2-=d; }
+
+ bool operator==(ArithmeticProxy const & rhs) const
+ { return *mpVal1==*rhs.mpVal1 && *mpVal2==*rhs.mpVal2; }
+
+ bool operator!=(ArithmeticProxy const & rhs) const
+ { return *mpVal1!=*rhs.mpVal1 || *mpVal2!=*rhs.mpVal2; }
+
+ bool operator<(ArithmeticProxy const & rhs) const
+ { return *mpVal1<*rhs.mpVal1 && *mpVal2<*rhs.mpVal2; }
+
+ bool operator<=(ArithmeticProxy const & rhs) const
+ { return *mpVal1<=*rhs.mpVal1 && *mpVal2<=*rhs.mpVal2; }
+
+ bool operator>(ArithmeticProxy const & rhs) const
+ { return *mpVal1>*rhs.mpVal1 && *mpVal2>*rhs.mpVal2; }
+
+ bool operator>=(ArithmeticProxy const & rhs) const
+ { return *mpVal1>=*rhs.mpVal1 && *mpVal2>=*rhs.mpVal2; }
+
+ int operator-(ArithmeticProxy const & rhs) const
+ { return *mpVal1 - *rhs.mpVal1; }
+
+ private:
+ T1* mpVal1;
+ T2* mpVal2;
+ };
+
+ template< typename Iterator1,
+ typename Iterator2,
+ typename ValueType,
+ typename DifferenceType,
+ typename IteratorCategory,
+ class Derived >
+ class CompositeIteratorBase : public NonStandardIterator
+ {
+ public:
+ typedef Iterator1 iterator1_type;
+ typedef Iterator2 iterator2_type;
+ typedef ValueType value_type;
+ typedef DifferenceType difference_type;
+ typedef IteratorCategory iterator_category;
+
+ protected:
+ iterator1_type maIter1;
+ iterator2_type maIter2;
+
+ private:
+ bool equal(CompositeIteratorBase const & rhs) const
+ {
+ return (maIter1 == rhs.maIter1) && (maIter2 == rhs.maIter2);
+ }
+
+ public:
+ CompositeIteratorBase() :
+ maIter1(),
+ maIter2()
+ {}
+
+ CompositeIteratorBase( const iterator1_type& rIter1, const iterator2_type& rIter2 ) :
+ maIter1( rIter1 ),
+ maIter2( rIter2 )
+ {}
+
+ bool operator==(Derived const & rhs) const
+ {
+ return equal(rhs);
+ }
+
+ bool operator!=(Derived const & rhs) const
+ {
+ return !equal(rhs);
+ }
+
+ difference_type operator-(Derived const & rhs) const
+ {
+ OSL_ASSERT( maIter1 - rhs.maIter1 == maIter2 - rhs.maIter2 );
+ return maIter1 - rhs.maIter1;
+ }
+
+ Derived & operator+=(difference_type const & s)
+ {
+ maIter1 += s;
+ maIter2 += s;
+ return static_cast<Derived&>(*this);
+ }
+
+ Derived & operator-=(difference_type const & s)
+ {
+ maIter1 -= s;
+ maIter2 -= s;
+ return static_cast<Derived&>(*this);
+ }
+
+ Derived operator+(difference_type const & s) const
+ {
+ Derived ret(static_cast<Derived const&>(*this));
+ ret += s;
+ return ret;
+ }
+
+ Derived operator-(difference_type const & s) const
+ {
+ Derived ret(static_cast<Derived const&>(*this));
+ ret -= s;
+ return ret;
+ }
+
+ Derived& operator++()
+ {
+ ++maIter1;
+ ++maIter2;
+ return static_cast<Derived&>(*this);
+ }
+
+ Derived& operator--()
+ {
+ --maIter1;
+ --maIter2;
+ return static_cast<Derived&>(*this);
+ }
+
+ Derived operator++(int)
+ {
+ Derived ret(static_cast<Derived const&>(*this));
+ ++maIter1;
+ ++maIter2;
+ return ret;
+ }
+
+ Derived operator--(int)
+ {
+ Derived ret(static_cast<Derived const&>(*this));
+ --maIter1;
+ --maIter2;
+ return ret;
+ }
+
+ value_type get() const
+ {
+ return value_type(maIter1.get(),
+ maIter2.get());
+ }
+
+ value_type get(difference_type const & d) const
+ {
+ return value_type(maIter1.get(d),
+ maIter2.get(d));
+ }
+
+ void set( value_type v ) const
+ {
+ maIter1.set(v);
+ maIter2.set(v);
+ }
+
+ void set( value_type v, difference_type const & d ) const
+ {
+ maIter1.set(v,d);
+ maIter2.set(v,d);
+ }
+
+ const iterator1_type& first() const { return maIter1; }
+ iterator1_type& first() { return maIter1; }
+
+ const iterator2_type& second() const { return maIter2; }
+ iterator2_type& second() { return maIter2; }
+ };
+}
+
+/** Provide the composition of two 1D image iterators
+
+ Use this template to compose two iterators into one (e.g. image
+ and mask). Operations are transitive, e.g. operator== only returns
+ true, if both wrapped iterator operator== have yielded true.
+
+ Note that both iterators must have compatible difference types. To
+ avoid funny effects, iterator ranges given by a CompositeIterator
+ should consist of wrapped iterators of similar range
+ */
+template< typename Iterator1,
+ typename Iterator2,
+ typename ValueType,
+ typename DifferenceType,
+ typename IteratorCategory >
+class CompositeIterator1D :
+ public detail::CompositeIteratorBase< Iterator1,
+ Iterator2,
+ ValueType,
+ DifferenceType,
+ IteratorCategory,
+ CompositeIterator1D<Iterator1,
+ Iterator2,
+ ValueType,
+ DifferenceType,
+ IteratorCategory> >
+{
+ typedef detail::CompositeIteratorBase< Iterator1,
+ Iterator2,
+ ValueType,
+ DifferenceType,
+ IteratorCategory,
+ CompositeIterator1D<Iterator1,
+ Iterator2,
+ ValueType,
+ DifferenceType,
+ IteratorCategory> > base_type;
+public:
+ CompositeIterator1D() :
+ base_type()
+ {}
+
+ CompositeIterator1D( const Iterator1& rIter1,
+ const Iterator2& rIter2 ) :
+ base_type( rIter1, rIter2 )
+ {}
+};
+
+/** Provide the composition of two 2D image iterators
+
+ Use this template to compose two iterators into one (e.g. image
+ and mask). Operations are transitive, e.g. operator== only returns
+ true, if both wrapped iterator operator== have yielded true.
+
+ Note that both iterators must have compatible difference types. To
+ avoid funny effects, iterator ranges given by a CompositeIterator
+ should consist of wrapped iterators of similar range
+ */
+template< typename Iterator1, typename Iterator2 > class CompositeIterator2D :
+ public detail::CompositeIteratorBase< Iterator1,
+ Iterator2,
+ std::pair<
+ typename vigra::IteratorTraits<Iterator1>::value_type,
+ typename vigra::IteratorTraits<Iterator2>::value_type >,
+ typename vigra::IteratorTraits<Iterator1>::difference_type,
+ typename vigra::IteratorTraits<Iterator1>::iterator_category,
+ CompositeIterator2D<Iterator1, Iterator2> >
+{
+ typedef detail::CompositeIteratorBase< Iterator1,
+ Iterator2,
+ std::pair<
+ typename vigra::IteratorTraits<Iterator1>::value_type,
+ typename vigra::IteratorTraits<Iterator2>::value_type >,
+ typename vigra::IteratorTraits<Iterator1>::difference_type,
+ typename vigra::IteratorTraits<Iterator1>::iterator_category,
+ CompositeIterator2D<Iterator1, Iterator2> > base_type;
+public:
+ typedef CompositeIterator1D< typename Iterator1::row_iterator,
+ typename Iterator2::row_iterator,
+ typename base_type::value_type,
+ int,
+ typename base_type::iterator_category > row_iterator;
+ typedef CompositeIterator1D< typename Iterator1::column_iterator,
+ typename Iterator2::column_iterator,
+ typename base_type::value_type,
+ int,
+ typename base_type::iterator_category > column_iterator;
+
+ typedef detail::ArithmeticProxy< typename Iterator1::MoveX,
+ typename Iterator2::MoveX > MoveX;
+ typedef detail::ArithmeticProxy< typename Iterator1::MoveY,
+ typename Iterator2::MoveY > MoveY;
+
+ MoveX x;
+ MoveY y;
+
+ CompositeIterator2D() :
+ base_type(),
+ x(this->maIter1.x,this->maIter2.x),
+ y(this->maIter1.y,this->maIter2.y)
+ {}
+
+ CompositeIterator2D( const Iterator1& rIter1, const Iterator2& rIter2 ) :
+ base_type( rIter1, rIter2 ),
+ x(this->maIter1.x,this->maIter2.x),
+ y(this->maIter1.y,this->maIter2.y)
+ {}
+
+ CompositeIterator2D( const CompositeIterator2D& rOld ) :
+ base_type(rOld),
+ x(this->maIter1.x,this->maIter2.x),
+ y(this->maIter1.y,this->maIter2.y)
+ {}
+
+ CompositeIterator2D& operator=( const CompositeIterator2D& rNew )
+ {
+ this->maIter1 = rNew.maIter1;
+ this->maIter2 = rNew.maIter2;
+
+ x = MoveX(this->maIter1.x,
+ this->maIter2.x);
+ y = MoveY(this->maIter1.y,
+ this->maIter2.y);
+ }
+
+ row_iterator rowIterator() const
+ {
+ return row_iterator(this->maIter1.rowIterator(),
+ this->maIter2.rowIterator());
+ }
+
+ column_iterator columnIterator() const
+ {
+ return column_iterator(this->maIter1.columnIterator(),
+ this->maIter2.columnIterator());
+ }
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_COMPOSITEITERATOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/debug.hxx b/include/basebmp/debug.hxx
new file mode 100644
index 000000000000..688daf41c834
--- /dev/null
+++ b/include/basebmp/debug.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_BASEBMP_DEBUG_HXX
+#define INCLUDED_BASEBMP_DEBUG_HXX
+
+#include <iostream>
+#include <boost/shared_ptr.hpp>
+#include <basebmp/basebmpdllapi.h>
+
+namespace basebmp
+{
+ class BitmapDevice;
+
+ /** Dump content of BitmapDevice to given output stream.
+
+ @param rDevice
+ Device whose content should be dumped.
+
+ @param rOutputStream
+ Stream to write output to.
+
+ Used in vcl/headless/svpgdi.cxx when OSL_DEBUG_LEVEL > 2
+
+ Use like this:
+<pre>
+ #include <basebmp/debug.hxx>
+ #include <iostream>
+ #include <fstream>
+
+ std::ofstream output("/tmp/my_test.dump");
+ debugDump( pMyDevice, output );
+</pre>
+ */
+ void BASEBMP_DLLPUBLIC debugDump( const boost::shared_ptr< BitmapDevice >& rDevice,
+ ::std::ostream& rOutputStream );
+}
+
+#endif /* INCLUDED_BASEBMP_DEBUG_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/drawmodes.hxx b/include/basebmp/drawmodes.hxx
new file mode 100644
index 000000000000..a5f98ed3d418
--- /dev/null
+++ b/include/basebmp/drawmodes.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_BASEBMP_DRAWMODES_HXX
+#define INCLUDED_BASEBMP_DRAWMODES_HXX
+
+/* Definition of Draw modes */
+
+namespace basebmp
+{
+ enum DrawMode
+ {
+ /** Default draw mode, which simply renders pixel in the
+ requested color
+ */
+ DrawMode_PAINT,
+
+ /** XOR draw mode, which XORs each existing pixel value with
+ the new color.
+
+ The result of this XOR operation strongly depends on the
+ underlying pixel format, as it is defined by the bitwise
+ XOR of the (potentially palette-looked-up) color value and
+ the existing pixel content (being it true color or a
+ palette index).
+ */
+ DrawMode_XOR
+ };
+}
+
+#endif /* INCLUDED_BASEBMP_DRAWMODES_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/endian.hxx b/include/basebmp/endian.hxx
new file mode 100644
index 000000000000..22c32b6077ac
--- /dev/null
+++ b/include/basebmp/endian.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_BASEBMP_ENDIAN_HXX
+#define INCLUDED_BASEBMP_ENDIAN_HXX
+
+#include <osl/endian.h>
+
+namespace basebmp
+{
+
+/// Swap the order of bytes for the given POD type
+template< typename T > inline T byteSwap( T );
+
+#define BASEBMP_BYTE_SWAP(Type,SwapFunc) \
+ template<> inline Type byteSwap<Type>( Type v ) \
+ { \
+ return SwapFunc(v); \
+ }
+
+// byteSwap<T> shall fail for any type T not in the list below
+BASEBMP_BYTE_SWAP(sal_Int8,)
+BASEBMP_BYTE_SWAP(sal_uInt8,)
+BASEBMP_BYTE_SWAP(sal_Int16,OSL_SWAPWORD)
+BASEBMP_BYTE_SWAP(sal_uInt16,OSL_SWAPWORD)
+BASEBMP_BYTE_SWAP(sal_Int32,OSL_SWAPDWORD)
+BASEBMP_BYTE_SWAP(sal_uInt32,OSL_SWAPDWORD)
+
+#undef BASEBMP_BYTE_SWAP
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_ENDIAN_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/fillimage.hxx b/include/basebmp/fillimage.hxx
new file mode 100644
index 000000000000..815ec32539bf
--- /dev/null
+++ b/include/basebmp/fillimage.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_BASEBMP_FILLIMAGE_HXX
+#define INCLUDED_BASEBMP_FILLIMAGE_HXX
+
+#include <vigra/tuple.hxx>
+#include <vigra/iteratortraits.hxx>
+
+namespace basebmp
+{
+
+template< class DestIterator, class DestAccessor, typename T >
+void fillImage( DestIterator begin,
+ DestIterator end,
+ DestAccessor ad,
+ T fillVal )
+{
+ const int width ( end.x - begin.x );
+ const int height( end.y - begin.y );
+
+ for( int y=0; y<height; ++y, ++begin.y )
+ {
+ typename vigra::IteratorTraits<DestIterator>::row_iterator
+ rowIter( begin.rowIterator() );
+ const typename vigra::IteratorTraits<DestIterator>::row_iterator
+ rowEnd( rowIter + width );
+
+ // TODO(P2): Provide specialized span fill methods on the
+ // iterator/accessor
+ while( rowIter != rowEnd )
+ ad.set(fillVal, rowIter++);
+ }
+}
+
+template< class DestIterator, class DestAccessor, typename T >
+inline void fillImage( vigra::triple<DestIterator,DestIterator,DestAccessor> const& src,
+ T fillVal )
+{
+ fillImage(src.first,src.second,src.third,fillVal);
+}
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_FILLIMAGE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/genericcolorimageaccessor.hxx b/include/basebmp/genericcolorimageaccessor.hxx
new file mode 100644
index 000000000000..5aaa95327176
--- /dev/null
+++ b/include/basebmp/genericcolorimageaccessor.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_BASEBMP_GENERICCOLORIMAGEACCESSOR_HXX
+#define INCLUDED_BASEBMP_GENERICCOLORIMAGEACCESSOR_HXX
+
+#include <basebmp/color.hxx>
+#include <basebmp/bitmapdevice.hxx>
+
+namespace basebmp
+{
+ /** Access a BitmapDevice generically
+
+ This accessor deals with an opaque BitmapDevice generically,
+ via getPixel()/setPixel() at the published interface.
+ */
+ class GenericColorImageAccessor
+ {
+ BitmapDeviceSharedPtr mpDevice;
+ DrawMode meDrawMode;
+
+ public:
+ typedef Color value_type;
+
+ explicit GenericColorImageAccessor( BitmapDeviceSharedPtr const& rTarget ) :
+ mpDevice(rTarget),
+ meDrawMode(DrawMode_PAINT)
+ {}
+
+ GenericColorImageAccessor( BitmapDeviceSharedPtr const& rTarget,
+ DrawMode eDrawMode ) :
+ mpDevice(rTarget),
+ meDrawMode(eDrawMode)
+ {}
+
+ template< typename Iterator >
+ Color operator()( Iterator const& i ) const
+ { return mpDevice->getPixel( basegfx::B2IPoint( i->x,i->y ) ); }
+
+ template< typename Iterator, typename Difference >
+ Color operator()( Iterator const& i, Difference const& diff) const
+ { return mpDevice->getPixel( basegfx::B2IPoint( i[diff]->x,
+ i[diff]->y ) ); }
+
+ template< typename Iterator >
+ void set(Color const& value, Iterator const& i) const
+ { return mpDevice->setPixel( basegfx::B2IPoint( i->x,i->y ),
+ value, meDrawMode ); }
+
+ template< class Iterator, class Difference >
+ void set(value_type const& value, Iterator const& i, Difference const& diff) const
+ { return mpDevice->setPixel( basegfx::B2IPoint( i[diff]->x,
+ i[diff]->y ),
+ value, meDrawMode ); }
+ };
+}
+
+#endif /* INCLUDED_BASEBMP_GENERICCOLORIMAGEACCESSOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/greylevelformats.hxx b/include/basebmp/greylevelformats.hxx
new file mode 100644
index 000000000000..3fcd90fcda5f
--- /dev/null
+++ b/include/basebmp/greylevelformats.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_BASEBMP_GREYLEVELFORMATS_HXX
+#define INCLUDED_BASEBMP_GREYLEVELFORMATS_HXX
+
+#include <basebmp/color.hxx>
+#include <basebmp/colortraits.hxx>
+#include <basebmp/accessor.hxx>
+#include <basebmp/pixeliterator.hxx>
+#include <basebmp/packedpixeliterator.hxx>
+#include <basebmp/pixelformatadapters.hxx>
+#include <basebmp/metafunctions.hxx>
+
+#include <vigra/numerictraits.hxx>
+#include <vigra/metaprogramming.hxx>
+
+#include <functional>
+
+namespace basebmp
+{
+
+template< typename PixelType,
+ typename ColorType,
+ int UsedRange > struct GreylevelGetter :
+ public std::unary_function<PixelType, ColorType>
+{
+ ColorType operator()( PixelType const& c ) const
+ {
+ return ColorTraits<ColorType>::fromGreyscale(
+ vigra::NumericTraits<PixelType>::toPromote(c) *
+ vigra::NumericTraits<PixelType>::maxConst / UsedRange );
+ }
+};
+
+template< typename PixelType,
+ typename ColorType,
+ int UsedRange > struct GreylevelSetter :
+ public std::unary_function<ColorType, PixelType>
+{
+ PixelType operator()( ColorType const& c ) const
+ {
+ return vigra::NumericTraits<PixelType>::toPromote(
+ ColorTraits<ColorType>::toGreyscale(c)) *
+ UsedRange /
+ vigra::NumericTraits<PixelType>::maxConst;
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+template< class Iterator,
+ class Accessor,
+ int UsedRange > struct PixelFormatTraitsTemplate_Greylevel
+{
+ typedef typename Iterator::value_type pixel_type;
+
+ typedef GreylevelGetter<pixel_type,
+ Color,
+ UsedRange> getter_type;
+ typedef GreylevelSetter<pixel_type,
+ Color,
+ UsedRange> setter_type;
+
+ typedef Iterator iterator_type;
+ typedef Accessor raw_accessor_type;
+ typedef AccessorSelector<
+ getter_type,
+ setter_type > accessor_selector;
+};
+
+template< int BitsPerPixel,
+ bool MsbFirst > struct PixelFormatTraitsTemplate_PackedGreylevel :
+ public PixelFormatTraitsTemplate_Greylevel<
+ PackedPixelIterator< sal_uInt8,
+ BitsPerPixel,
+ true >,
+ NonStandardAccessor< sal_uInt8 >,
+ (1UL << BitsPerPixel)-1 >
+{};
+
+//-----------------------------------------------------------------------------
+
+// 1bpp MSB
+typedef PixelFormatTraitsTemplate_PackedGreylevel<1, true> PixelFormatTraits_GREY1_MSB;
+
+// 1bpp LSB
+typedef PixelFormatTraitsTemplate_PackedGreylevel<1, false> PixelFormatTraits_GREY1_LSB;
+BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_GREY1_MSB::getter_type,
+ PixelFormatTraits_GREY1_MSB::setter_type);
+
+
+// 4bpp MSB
+typedef PixelFormatTraitsTemplate_PackedGreylevel<4, true> PixelFormatTraits_GREY4_MSB;
+
+// 4bpp LSB
+typedef PixelFormatTraitsTemplate_PackedGreylevel<4, false> PixelFormatTraits_GREY4_LSB;
+BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_GREY4_MSB::getter_type,
+ PixelFormatTraits_GREY4_MSB::setter_type);
+
+// 8bpp
+typedef PixelFormatTraitsTemplate_Greylevel<
+ PixelIterator< sal_uInt8 >,
+ StandardAccessor< sal_uInt8 >,
+ 255 > PixelFormatTraits_GREY8;
+BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_GREY8::getter_type,
+ PixelFormatTraits_GREY8::setter_type);
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_GREYLEVELFORMATS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/iteratortraits.hxx b/include/basebmp/iteratortraits.hxx
new file mode 100644
index 000000000000..5d87df7d5a85
--- /dev/null
+++ b/include/basebmp/iteratortraits.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_BASEBMP_ITERATORTRAITS_HXX
+#define INCLUDED_BASEBMP_ITERATORTRAITS_HXX
+
+#include <basebmp/accessor.hxx>
+#include <basebmp/nonstandarditerator.hxx>
+
+namespace basebmp
+{
+
+template< class Iterator > struct IteratorTraits
+{
+ /// VigraTrueType, if iterator does not provide *operator()/operator[] methods
+ typedef typename vigra::IsDerivedFrom<Iterator,NonStandardIterator>::result
+ isNonStandardIterator;
+
+ /// Retrieve default accessor for this iterator (and given value type)
+ template< typename ValueType > struct defaultAccessor : public
+ // select according to non-standardness of iterator type
+ vigra::If< isNonStandardIterator,
+ NonStandardAccessor< ValueType >,
+ StandardAccessor< ValueType > >
+ {};
+
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_ITERATORTRAITS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/metafunctions.hxx b/include/basebmp/metafunctions.hxx
new file mode 100644
index 000000000000..e451dce8e4d9
--- /dev/null
+++ b/include/basebmp/metafunctions.hxx
@@ -0,0 +1,226 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_METAFUNCTIONS_HXX
+#define INCLUDED_BASEBMP_METAFUNCTIONS_HXX
+
+#include <boost/mpl/integral_c.hpp>
+#include <vigra/metaprogramming.hxx>
+#include <vigra/numerictraits.hxx>
+
+#include <functional>
+
+namespace basebmp
+{
+
+// TODO(Q3): move to generic place (o3tl?)
+
+/** template meta function: add const qualifier to 2nd type, if given
+ 1st type has it
+*/
+template<typename A, typename B> struct clone_const
+{
+ typedef B type;
+};
+template<typename A, typename B> struct clone_const<const A,B>
+{
+ typedef const B type;
+};
+
+/** template meta function: add const qualifier to plain type (if not
+ already there)
+ */
+template <typename T> struct add_const
+{
+ typedef const T type;
+};
+template <typename T> struct add_const<const T>
+{
+ typedef const T type;
+};
+
+/// template meta function: remove const qualifier from plain type
+template <typename T> struct remove_const
+{
+ typedef T type;
+};
+template <typename T> struct remove_const<const T>
+{
+ typedef T type;
+};
+
+//--------------------------------------------------------------
+
+/// Base class for an adaptable ternary functor
+template< typename A1, typename A2, typename A3, typename R > struct TernaryFunctorBase
+{
+ typedef A1 first_argument_type;
+ typedef A2 second_argument_type;
+ typedef A3 third_argument_type;
+ typedef R result_type;
+};
+
+//--------------------------------------------------------------
+
+/** template meta function: ensure that given integer type is unsigned
+
+ If given integer type is already unsigned, return as-is -
+ otherwise, convert to unsigned type of same or greater range.
+ */
+template< typename T > struct make_unsigned;
+
+#define BASEBMP_MAKE_UNSIGNED(T,U) \
+ template<> struct make_unsigned<T> { \
+ typedef U type; \
+ };
+
+BASEBMP_MAKE_UNSIGNED(signed char,unsigned char)
+BASEBMP_MAKE_UNSIGNED(unsigned char,unsigned char)
+BASEBMP_MAKE_UNSIGNED(short,unsigned short)
+BASEBMP_MAKE_UNSIGNED(unsigned short,unsigned short)
+BASEBMP_MAKE_UNSIGNED(int,unsigned int)
+BASEBMP_MAKE_UNSIGNED(unsigned int,unsigned int)
+BASEBMP_MAKE_UNSIGNED(long,unsigned long)
+BASEBMP_MAKE_UNSIGNED(unsigned long,unsigned long)
+
+#undef BASEBMP_MAKE_UNSIGNED
+
+/// cast integer to unsigned type of similar size
+template< typename T > inline typename make_unsigned<T>::type unsigned_cast( T value )
+{
+ return static_cast< typename make_unsigned<T>::type >(value);
+}
+
+//--------------------------------------------------------------
+
+/// returns true, if given number is strictly less than 0
+template< typename T > inline bool is_negative( T x )
+{
+ return x < 0;
+}
+
+/// Overload for ints (branch-free)
+inline bool is_negative( int x )
+{
+ // force logic shift (result for signed shift right is undefined)
+ return static_cast<unsigned int>(x) >> (sizeof(int)*8-1);
+}
+
+//--------------------------------------------------------------
+
+/// Results in VigraTrueType, if T is of integer type and scalar
+template< typename T, typename trueCase, typename falseCase >
+struct ifScalarIntegral
+{
+ typedef
+ typename vigra::If<
+ typename vigra::NumericTraits< T >::isIntegral,
+ typename vigra::If<
+ typename vigra::NumericTraits< T >::isScalar,
+ trueCase,
+ falseCase >::type,
+ falseCase >::type type;
+};
+
+/// Results in VigraTrueType, if T is of non-integer type and scalar
+template< typename T, typename trueCase, typename falseCase >
+struct ifScalarNonIntegral
+{
+ typedef
+ typename vigra::If<
+ typename vigra::NumericTraits< T >::isIntegral,
+ falseCase,
+ typename vigra::If<
+ typename vigra::NumericTraits< T >::isScalar,
+ trueCase,
+ falseCase >::type >::type type;
+};
+
+/// Results in VigraTrueType, if both T1 and T2 are of integer type and scalar
+template< typename T1, typename T2, typename trueCase, typename falseCase >
+struct ifBothScalarIntegral
+{
+ typedef
+ typename ifScalarIntegral<
+ T1,
+ typename ifScalarIntegral<
+ T2,
+ trueCase,
+ falseCase >::type,
+ falseCase >::type type;
+};
+
+//--------------------------------------------------------------
+
+/// Count number of trailing zeros
+template< unsigned int val > struct numberOfTrailingZeros
+{
+ enum { next = val >> 1 };
+ enum { value = vigra::IfBool< (val & 1) == 0,
+ numberOfTrailingZeros<next>,
+ boost::mpl::integral_c< int,-1 > > ::type::value + 1 };
+};
+
+template<> struct numberOfTrailingZeros<0>
+{
+ enum { value = 0 };
+};
+
+//--------------------------------------------------------------
+
+/// Count number of one bits
+template< unsigned int val > struct bitcount
+{
+ enum { next = val >> 1 };
+ enum { value = bitcount<next>::value + (val & 1) };
+};
+
+template<> struct bitcount<0>
+{
+ enum { value = 0 };
+};
+
+//--------------------------------------------------------------
+
+/// Shift left for positive shift value, and right otherwise
+template< typename T > inline T shiftLeft( T v, int shift )
+{
+ return shift > 0 ? v << shift : v >> (-shift);
+}
+
+/// Shift right for positive shift value, and left otherwise
+template< typename T > inline T shiftRight( T v, int shift )
+{
+ return shift > 0 ? v >> shift : v << (-shift);
+}
+
+//--------------------------------------------------------------
+
+/// Replace non-std project2nd from SGI extensions
+template< typename T1, typename T2 >
+struct project2nd : public std::binary_function<T1, T2, T2>
+{
+ T2 operator() (const T1&, const T2& v) const { return v; }
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_METAFUNCTIONS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/nonstandarditerator.hxx b/include/basebmp/nonstandarditerator.hxx
new file mode 100644
index 000000000000..ff51c59afcee
--- /dev/null
+++ b/include/basebmp/nonstandarditerator.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_BASEBMP_NONSTANDARDITERATOR_HXX
+#define INCLUDED_BASEBMP_NONSTANDARDITERATOR_HXX
+
+#include <vigra/metaprogramming.hxx>
+
+namespace basebmp
+{
+ /// Base class defining pointer and reference types as VigraFalseType
+ struct NonStandardIterator
+ {
+ typedef vigra::VigraFalseType reference;
+ typedef vigra::VigraFalseType index_reference;
+ typedef vigra::VigraFalseType pointer;
+ };
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_NONSTANDARDITERATOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/packedpixeliterator.hxx b/include/basebmp/packedpixeliterator.hxx
new file mode 100644
index 000000000000..89a88506bbcd
--- /dev/null
+++ b/include/basebmp/packedpixeliterator.hxx
@@ -0,0 +1,671 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_PACKEDPIXELITERATOR_HXX
+#define INCLUDED_BASEBMP_PACKEDPIXELITERATOR_HXX
+
+#include <basebmp/metafunctions.hxx>
+#include <basebmp/stridedarrayiterator.hxx>
+#include <basebmp/nonstandarditerator.hxx>
+#include <basebmp/accessortraits.hxx>
+
+#include <boost/static_assert.hpp>
+#include <vigra/metaprogramming.hxx>
+#include <vigra/diff2d.hxx>
+
+namespace basebmp
+{
+
+/// Get bitmask for data at given intra-word position, for given bit depth
+template< typename value_type,
+ int bits_per_pixel,
+ bool MsbFirst,
+ typename difference_type >
+inline value_type get_mask( difference_type d )
+{
+ BOOST_STATIC_ASSERT(bits_per_pixel > 0);
+ BOOST_STATIC_ASSERT(sizeof(value_type)*8 % bits_per_pixel == 0);
+ BOOST_STATIC_ASSERT(sizeof(value_type)*8 / bits_per_pixel > 1);
+ BOOST_STATIC_ASSERT(vigra::TypeTraits<value_type>::isPOD::asBool);
+
+ const unsigned int nIntraWordPositions( sizeof(value_type)*8 / bits_per_pixel );
+
+ // create bits_per_pixel 1s shift to intra-word position
+ return ((~(~0 << bits_per_pixel)) << bits_per_pixel*(MsbFirst ?
+ (nIntraWordPositions-1 - (d % nIntraWordPositions)) :
+ (d % nIntraWordPositions)));
+}
+
+template< int num_intraword_positions, int bits_per_pixel, bool MsbFirst, typename difference_type > inline difference_type get_shift( difference_type remainder )
+{
+ return bits_per_pixel*(MsbFirst ?
+ (num_intraword_positions - 1 - remainder) :
+ remainder);
+}
+
+template< typename Valuetype,
+ int bits_per_pixel,
+ bool MsbFirst > class PackedPixelColumnIterator : public NonStandardIterator
+{
+public:
+ // no reference, no index_reference type here
+ typedef Valuetype value_type;
+ typedef int difference_type;
+ typedef image_traverser_tag iterator_category;
+
+ typedef typename remove_const<value_type>::type mask_type;
+ typedef value_type* pointer;
+ typedef StridedArrayIterator< value_type > MoveY;
+
+ enum {
+ /** The number of pixel within a single value_type value
+ */
+ num_intraword_positions=sizeof(value_type)*8/bits_per_pixel,
+ /** Bit mask for one pixel (least significant bits)
+ */
+ bit_mask=~(~0 << bits_per_pixel)
+ };
+
+private:
+ MoveY y;
+ mask_type mask_;
+ difference_type shift_;
+
+ void inc()
+ {
+ ++y;
+ }
+
+ void dec()
+ {
+ --y;
+ }
+
+ bool equal( PackedPixelColumnIterator const & rhs ) const
+ {
+ return rhs.y == y;
+ }
+
+ bool less( PackedPixelColumnIterator const & rhs ) const
+ {
+ return y < rhs.y;
+ }
+
+public:
+ PackedPixelColumnIterator() :
+ y(0),
+ mask_( get_mask<value_type, bits_per_pixel, MsbFirst, difference_type>(0) ),
+ shift_( get_shift<num_intraword_positions, bits_per_pixel, MsbFirst, difference_type>(0) )
+ {}
+
+ PackedPixelColumnIterator( const MoveY& base, difference_type remainder ) :
+ y(base),
+ mask_( get_mask<value_type, bits_per_pixel, MsbFirst>(remainder) ),
+ shift_( get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder) )
+ {}
+
+ PackedPixelColumnIterator& operator+=( difference_type d )
+ {
+ y += d;
+ return *this;
+ }
+
+ PackedPixelColumnIterator& operator-=( difference_type d )
+ {
+ y -= d;
+ return *this;
+ }
+
+ PackedPixelColumnIterator operator+( difference_type d )
+ {
+ PackedPixelColumnIterator res(*this);
+ res += d;
+ return res;
+ }
+
+ PackedPixelColumnIterator operator-( difference_type d )
+ {
+ PackedPixelColumnIterator res(*this);
+ res -= d;
+ return res;
+ }
+
+ PackedPixelColumnIterator& operator++()
+ {
+ inc();
+ return *this;
+ }
+
+ PackedPixelColumnIterator& operator--()
+ {
+ dec();
+ return *this;
+ }
+
+ PackedPixelColumnIterator operator++(int)
+ {
+ PackedPixelColumnIterator res(*this);
+ inc();
+ return res;
+ }
+
+ PackedPixelColumnIterator operator--(int)
+ {
+ PackedPixelColumnIterator res(*this);
+ dec();
+ return res;
+ }
+
+ bool operator==(PackedPixelColumnIterator const & rhs) const
+ {
+ return equal( rhs );
+ }
+
+ bool operator!=(PackedPixelColumnIterator const & rhs) const
+ {
+ return !equal( rhs );
+ }
+
+ bool operator<(PackedPixelColumnIterator const & rhs) const
+ {
+ return less(rhs);
+ }
+
+ bool operator<=(PackedPixelColumnIterator const & rhs) const
+ {
+ return !rhs.less(*this);
+ }
+
+ bool operator>(PackedPixelColumnIterator const & rhs) const
+ {
+ return rhs.less(*this);
+ }
+
+ bool operator>=(PackedPixelColumnIterator const & rhs) const
+ {
+ return !less(rhs);
+ }
+
+ difference_type operator-(PackedPixelColumnIterator const & rhs) const
+ {
+ return y - rhs.y;
+ }
+
+ value_type get() const
+ {
+ return unsigned_cast<value_type>(*y() & mask_) >> shift_;
+ }
+
+ value_type get(difference_type d) const
+ {
+ return unsigned_cast<value_type>(*y(d) & mask_) >> shift_;
+ }
+
+ void set( value_type v ) const
+ {
+ const value_type pixel_value( (v << shift_) & mask_ );
+ *y() = (*y() & ~mask_) | pixel_value;
+ }
+
+ void set( value_type v, difference_type d ) const
+ {
+ const value_type pixel_value( (v << shift_) & mask_ );
+ *y(d) = (*y(d) & ~mask_) | pixel_value;
+ }
+};
+
+template< typename Valuetype,
+ int bits_per_pixel,
+ bool MsbFirst > class PackedPixelRowIterator : public NonStandardIterator
+{
+public:
+ // no reference, no index_reference type here
+ typedef Valuetype value_type;
+ typedef int difference_type;
+ typedef image_traverser_tag iterator_category;
+
+ typedef typename remove_const<value_type>::type mask_type;
+ typedef value_type* pointer;
+
+ enum {
+ /** The number of pixel within a single value_type value
+ */
+ num_intraword_positions=sizeof(value_type)*8/bits_per_pixel,
+ /** Bit mask for one pixel (least significant bits)
+ */
+ bit_mask=~(~0 << bits_per_pixel)
+ };
+
+private:
+ pointer data_;
+ mask_type mask_;
+ difference_type remainder_;
+
+ void update_mask()
+ {
+ mask_ = get_mask<value_type, bits_per_pixel, MsbFirst>(remainder_);
+ }
+
+ void inc()
+ {
+ const difference_type newValue( remainder_ + 1 );
+ const difference_type data_offset( newValue / num_intraword_positions );
+
+ data_ += data_offset;
+ remainder_ = newValue % num_intraword_positions;
+
+ const mask_type shifted_mask(
+ MsbFirst ?
+ unsigned_cast<mask_type>(mask_) >> bits_per_pixel :
+ mask_ << bits_per_pixel );
+
+ // data_offset is 0 for shifted mask, and 1 for wrapped-around mask
+ mask_ = (1-data_offset)*shifted_mask + data_offset*(MsbFirst ?
+ bit_mask << bits_per_pixel*(num_intraword_positions-1) :
+ bit_mask);
+ }
+
+ void dec()
+ {
+ const difference_type newValue( remainder_ - 1 );
+ const bool isNegative( is_negative(newValue) );
+ const difference_type newRemainder( newValue % num_intraword_positions );
+
+ // calc data_ += newValue / num_intraword_positions;
+ // remainder_ = newRemainder;
+ // for newValue >= 0, and
+ // data_ += newValue / num_intraword_positions - 1;
+ // remainder_ = num_intraword_positions - newRemainder;
+ // (to force remainder_ to be positive).
+ // This is branch-free, if is_negative() is branch-free
+ const difference_type data_offset( newValue / num_intraword_positions - isNegative );
+ data_ += data_offset;
+ remainder_ = newRemainder + isNegative*num_intraword_positions;
+
+ const mask_type shifted_mask(
+ MsbFirst ?
+ mask_ << bits_per_pixel :
+ unsigned_cast<mask_type>(mask_) >> bits_per_pixel );
+
+ // data_offset is 0 for shifted mask, and 1 for wrapped-around mask
+ mask_ = (1-data_offset)*shifted_mask + data_offset*(MsbFirst ?
+ bit_mask :
+ bit_mask << bits_per_pixel*(num_intraword_positions-1));
+ }
+
+ bool equal( PackedPixelRowIterator const & rhs ) const
+ {
+ return rhs.data_ == data_ && rhs.remainder_ == remainder_;
+ }
+
+ bool less( PackedPixelRowIterator const & rhs ) const
+ {
+ return data_ == rhs.data_ ?
+ (remainder_ < rhs.remainder_) :
+ (data_ < rhs.data_);
+ }
+
+public:
+ PackedPixelRowIterator() :
+ data_(0),
+ mask_( get_mask<value_type, bits_per_pixel, MsbFirst, difference_type>(0) ),
+ remainder_(0)
+ {}
+
+ explicit PackedPixelRowIterator( pointer base, int x ) :
+ data_(base),
+ mask_(0),
+ remainder_(x % num_intraword_positions)
+ {
+ update_mask();
+ }
+
+ PackedPixelRowIterator& operator+=( difference_type d )
+ {
+ const difference_type newValue( remainder_ + d );
+ const bool isNegative( is_negative(newValue) );
+ const difference_type newRemainder( newValue % num_intraword_positions );
+
+ // calc data_ += newValue / num_intraword_positions;
+ // remainder_ = newRemainder;
+ // for newValue >= 0, and
+ // data_ += newValue / num_intraword_positions - 1;
+ // remainder_ = newRemainder + num_intraword_positions;
+ // (to force remainder_ to be positive).
+ // This is branch-free, if is_negative() is branch-free
+ data_ += newValue / num_intraword_positions - isNegative;
+ remainder_ = newRemainder + isNegative*num_intraword_positions;
+ update_mask();
+
+ return *this;
+ }
+
+ PackedPixelRowIterator& operator-=( difference_type d )
+ {
+ // forward to operator+= - which has to cope with negative
+ // values, anyway.
+ return *this += -d;
+ }
+
+ PackedPixelRowIterator operator+( difference_type d )
+ {
+ PackedPixelRowIterator res(*this);
+ res += d;
+ return res;
+ }
+
+ PackedPixelRowIterator operator-( difference_type d )
+ {
+ PackedPixelRowIterator res(*this);
+ res -= d;
+ return res;
+ }
+
+ PackedPixelRowIterator& operator++()
+ {
+ inc();
+ return *this;
+ }
+
+ PackedPixelRowIterator& operator--()
+ {
+ dec();
+ return *this;
+ }
+
+ PackedPixelRowIterator operator++(int)
+ {
+ PackedPixelRowIterator res(*this);
+ inc();
+ return res;
+ }
+
+ PackedPixelRowIterator operator--(int)
+ {
+ PackedPixelRowIterator res(*this);
+ dec();
+ return res;
+ }
+
+ bool operator==(PackedPixelRowIterator const & rhs) const
+ {
+ return equal( rhs );
+ }
+
+ bool operator!=(PackedPixelRowIterator const & rhs) const
+ {
+ return !equal( rhs );
+ }
+
+ bool operator<(PackedPixelRowIterator const & rhs) const
+ {
+ return less(rhs);
+ }
+
+ bool operator<=(PackedPixelRowIterator const & rhs) const
+ {
+ return !rhs.less(*this);
+ }
+
+ bool operator>(PackedPixelRowIterator const & rhs) const
+ {
+ return rhs.less(*this);
+ }
+
+ bool operator>=(PackedPixelRowIterator const & rhs) const
+ {
+ return !less(rhs);
+ }
+
+ difference_type operator-(PackedPixelRowIterator const & rhs) const
+ {
+ return (data_ - rhs.data_)*num_intraword_positions + (remainder_ - rhs.remainder_);
+ }
+
+ value_type get() const
+ {
+ return unsigned_cast<value_type>(*data_ & mask_) >>
+ get_shift<num_intraword_positions,
+ bits_per_pixel,
+ MsbFirst>(remainder_);
+ }
+
+ value_type get(difference_type d) const
+ {
+ PackedPixelRowIterator tmp(*this);
+ tmp += d;
+ return tmp.get();
+ }
+
+ void set( value_type v ) const
+ {
+ const value_type pixel_value(
+ (v <<
+ get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder_))
+ & mask_ );
+ *data_ = (*data_ & ~mask_) | pixel_value;
+ }
+
+ void set( value_type v, difference_type d ) const
+ {
+ PackedPixelRowIterator tmp(*this);
+ tmp += d;
+ tmp.set(v);
+ }
+};
+
+/** 2D image iterator for packed pixel formats
+
+ This iterator can be used for image formats that pack more than
+ one pixel into an machine data type (like one bit per pixel, eight
+ of which packed into one char)
+ */
+template< typename Valuetype,
+ int bits_per_pixel,
+ bool MsbFirst > class PackedPixelIterator : public NonStandardIterator
+{
+public:
+ // no reference, no index_reference type here
+ typedef Valuetype value_type;
+ typedef vigra::Diff2D difference_type;
+ typedef image_traverser_tag iterator_category;
+ typedef PackedPixelRowIterator<value_type,
+ bits_per_pixel,
+ MsbFirst> row_iterator;
+ typedef PackedPixelColumnIterator<value_type,
+ bits_per_pixel,
+ MsbFirst> column_iterator;
+
+ typedef value_type* pointer;
+ typedef int MoveX;
+ typedef StridedArrayIterator< value_type > MoveY;
+
+ enum {
+ /** The number of pixel within a single value_type value
+ */
+ num_intraword_positions=sizeof(value_type)*8/bits_per_pixel,
+ /** Bit mask for one pixel (least significant bits)
+ */
+ bit_mask=~(~0 << bits_per_pixel)
+ };
+
+ // TODO(F2): direction of iteration (ImageIterator can be made to
+ // run backwards)
+
+private:
+ pointer current() const
+ {
+ return y() + (x / num_intraword_positions);
+ }
+
+ pointer current(int dx, int dy) const
+ {
+ return y(dy) + ((x+dx)/num_intraword_positions);
+ }
+
+ bool equal(PackedPixelIterator const & rhs) const
+ {
+ return (x == rhs.x) && (y == rhs.y);
+ }
+
+public:
+ PackedPixelIterator() :
+ x(0),
+ y(0)
+ {}
+
+ PackedPixelIterator(pointer base, int ystride) :
+ x(0),
+ y(ystride,base)
+ {}
+
+ bool operator==(PackedPixelIterator const & rhs) const
+ {
+ return equal(rhs);
+ }
+
+ bool operator!=(PackedPixelIterator const & rhs) const
+ {
+ return !equal(rhs);
+ }
+
+ difference_type operator-(PackedPixelIterator const & rhs) const
+ {
+ return difference_type(x - rhs.x, y - rhs.y);
+ }
+
+ MoveX x;
+ MoveY y;
+
+ PackedPixelIterator & operator+=(difference_type const & s)
+ {
+ x += s.x;
+ y += s.y;
+ return *this;
+ }
+
+ PackedPixelIterator & operator-=(difference_type const & s)
+ {
+ x -= s.x;
+ y -= s.y;
+ return *this;
+ }
+
+ PackedPixelIterator operator+(difference_type const & s) const
+ {
+ PackedPixelIterator ret(*this);
+ ret += s;
+ return ret;
+ }
+
+ PackedPixelIterator operator-(difference_type const & s) const
+ {
+ PackedPixelIterator ret(*this);
+ ret -= s;
+ return ret;
+ }
+
+ row_iterator rowIterator() const
+ {
+ return row_iterator(current(),x);
+ }
+
+ column_iterator columnIterator() const
+ {
+ return column_iterator(MoveY(y,
+ x / num_intraword_positions),
+ x % num_intraword_positions);
+ }
+
+ value_type get() const
+ {
+ const int remainder( x % num_intraword_positions );
+
+ return (unsigned_cast<value_type>(*current() &
+ get_mask<value_type, bits_per_pixel, MsbFirst>(remainder))
+ >> get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder));
+ }
+
+ value_type get(difference_type const & d) const
+ {
+ const int remainder( x(d.x) % num_intraword_positions );
+
+ return (unsigned_cast<value_type>(*current(d.x,d.y) &
+ get_mask<value_type, bits_per_pixel, MsbFirst>(remainder))
+ >> get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder));
+ }
+
+ void set( value_type v ) const
+ {
+ const int remainder( x % num_intraword_positions );
+ const int mask( get_mask<value_type, bits_per_pixel, MsbFirst>(remainder) );
+ const value_type pixel_value(
+ (v <<
+ get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder))
+ & mask );
+ pointer p = current();
+ *p = (*p & ~mask) | pixel_value;
+ }
+
+ void set( value_type v, difference_type const & d ) const
+ {
+ const int remainder( (x + d.x) % num_intraword_positions );
+ const int mask( get_mask<value_type, bits_per_pixel, MsbFirst>(remainder) );
+ const value_type pixel_value(
+ (v <<
+ get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder))
+ & mask );
+ pointer p = current(d.x,d.y);
+ *p = (*p & ~mask) | pixel_value;
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+// partial specialization for the accessor traits masked_accessor
+// selector metafunction - can employ fast mask functor for the 1bpp
+// case.
+template< class Accessor,
+ class MaskAccessor,
+ class Iterator,
+ bool polarity,
+ bool MsbFirst > struct maskedAccessorSelector< Accessor,
+ MaskAccessor,
+ Iterator,
+ PackedPixelIterator< typename MaskAccessor::value_type,
+ 1,
+ MsbFirst >,
+ polarity >
+{
+ typedef TernarySetterFunctionAccessorAdapter<
+ Accessor,
+ MaskAccessor,
+ typename outputMaskFunctorSelector<
+ typename Accessor::value_type,
+ typename MaskAccessor::value_type,
+ polarity,
+ FastMask>::type >
+ type;
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_PACKEDPIXELITERATOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/paletteformats.hxx b/include/basebmp/paletteformats.hxx
new file mode 100644
index 000000000000..5c2c58d49b94
--- /dev/null
+++ b/include/basebmp/paletteformats.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_BASEBMP_PACKEDPIXELFORMATS_HXX
+#define INCLUDED_BASEBMP_PACKEDPIXELFORMATS_HXX
+
+#include <basebmp/color.hxx>
+#include <basebmp/colortraits.hxx>
+#include <basebmp/accessor.hxx>
+#include <basebmp/pixeliterator.hxx>
+#include <basebmp/packedpixeliterator.hxx>
+#include <basebmp/pixelformatadapters.hxx>
+#include <basebmp/paletteimageaccessor.hxx>
+#include <basebmp/metafunctions.hxx>
+
+#include <vigra/numerictraits.hxx>
+#include <vigra/metaprogramming.hxx>
+
+namespace basebmp
+{
+
+//-----------------------------------------------------------------------------
+
+/** Lookup index value for given color value in a PaletteImageAccessor
+ */
+template< class Accessor > struct ColorLookup
+{
+ typename Accessor::data_type operator()( const Accessor& acc,
+ typename Accessor::value_type v ) const
+ {
+ return acc.lookup(v);
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+// partial specialization of AccessorTraits for PaletteAccessor
+template< class Accessor, typename ColorType > struct AccessorTraits<
+ PaletteImageAccessor< Accessor, ColorType > >
+{
+ /// value type of described accessor
+ typedef typename PaletteImageAccessor< Accessor, ColorType >::value_type value_type;
+
+ /// Retrieve stand-alone color lookup function for given Accessor type
+ typedef ColorLookup< PaletteImageAccessor< Accessor, ColorType > > color_lookup;
+
+ /// Retrieve raw pixel data accessor for given Accessor type
+ typedef Accessor raw_accessor;
+
+ /** accessor for XOR setter access is disabled, since the results
+ * are usually completely unintended - you'll usually want to
+ * wrap an xor_accessor with a PaletteAccessor, not the other way
+ * around.
+ */
+ typedef vigra::VigraFalseType xor_accessor;
+
+ /** accessor for masked setter access is disabled, since the
+ * results are usually completely unintended - you'll usually
+ * want to wrap a masked_accessor with a PaletteAccessor, not the
+ * other way around.
+ */
+ template< class MaskAccessor,
+ class Iterator,
+ class MaskIterator > struct masked_accessor
+ {
+ typedef vigra::VigraFalseType type;
+ };
+};
+
+//-----------------------------------------------------------------------------
+
+template< typename ColorType > struct PaletteAccessorSelector
+{
+ template< class Accessor > struct wrap_accessor
+ {
+ typedef PaletteImageAccessor< Accessor, ColorType > type;
+ };
+};
+
+//-----------------------------------------------------------------------------
+
+template< class Iterator,
+ class Accessor > struct PixelFormatTraitsTemplate_Palette
+{
+ typedef typename Iterator::value_type pixel_type;
+ typedef Iterator iterator_type;
+ typedef Accessor raw_accessor_type;
+ typedef PaletteAccessorSelector<Color> accessor_selector;
+};
+
+template< int BitsPerPixel,
+ bool MsbFirst > struct PixelFormatTraitsTemplate_PackedPalette :
+ public PixelFormatTraitsTemplate_Palette<
+ PackedPixelIterator< sal_uInt8,
+ BitsPerPixel,
+ MsbFirst >,
+ NonStandardAccessor< sal_uInt8 > >
+{};
+
+//-----------------------------------------------------------------------------
+
+// 1bpp MSB
+typedef PixelFormatTraitsTemplate_PackedPalette<1, true> PixelFormatTraits_PAL1_MSB;
+
+// 1bpp LSB
+typedef PixelFormatTraitsTemplate_PackedPalette<1, false> PixelFormatTraits_PAL1_LSB;
+
+// 4bpp MSB
+typedef PixelFormatTraitsTemplate_PackedPalette<4, true> PixelFormatTraits_PAL4_MSB;
+
+// 4bpp LSB
+typedef PixelFormatTraitsTemplate_PackedPalette<4, false> PixelFormatTraits_PAL4_LSB;
+
+// 8bpp
+typedef PixelFormatTraitsTemplate_Palette<
+ PixelIterator< sal_uInt8 >,
+ StandardAccessor< sal_uInt8 > > PixelFormatTraits_PAL8;
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_PACKEDPIXELFORMATS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/paletteimageaccessor.hxx b/include/basebmp/paletteimageaccessor.hxx
new file mode 100644
index 000000000000..6f0164e64af6
--- /dev/null
+++ b/include/basebmp/paletteimageaccessor.hxx
@@ -0,0 +1,162 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_PALETTEIMAGEACCESSOR_HXX
+#define INCLUDED_BASEBMP_PALETTEIMAGEACCESSOR_HXX
+
+#include <basebmp/colortraits.hxx>
+#include <basebmp/accessortraits.hxx>
+
+#include <vigra/numerictraits.hxx>
+#include <vigra/metaprogramming.hxx>
+
+#include <algorithm>
+#include <functional>
+
+namespace basebmp
+{
+
+/** Access pixel data via palette indirection
+
+ @tpl Accessor
+ Raw accessor, to be used to actually access the pixel values
+
+ @tpl ColorType
+ The color value type to use - e.g. the palette is an array of that
+ type
+ */
+template< class Accessor, typename ColorType > class PaletteImageAccessor
+{
+public:
+ typedef typename Accessor::value_type data_type;
+ typedef ColorType value_type;
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+// making all members public, if no member template friends
+private:
+ template<class A, typename C> friend class PaletteImageAccessor;
+#endif
+
+ Accessor maAccessor;
+ const value_type* mpPalette;
+ std::size_t mnNumEntries;
+
+public:
+ PaletteImageAccessor() :
+ maAccessor(),
+ mpPalette(0),
+ mnNumEntries(0)
+ {}
+
+ template< class A > explicit
+ PaletteImageAccessor( PaletteImageAccessor<A,ColorType> const& rSrc ) :
+ maAccessor( rSrc.maAccessor ),
+ mpPalette( rSrc.mpPalette ),
+ mnNumEntries( rSrc.mnNumEntries )
+ {}
+
+ PaletteImageAccessor( const value_type* pPalette,
+ std::size_t numEntries ) :
+ maAccessor(),
+ mpPalette(pPalette),
+ mnNumEntries(numEntries)
+ {}
+
+ template< class T > PaletteImageAccessor( T accessor,
+ const value_type* pPalette,
+ std::size_t numEntries ) :
+ maAccessor(accessor),
+ mpPalette(pPalette),
+ mnNumEntries(numEntries)
+ {}
+
+ // -------------------------------------------------------
+
+ Accessor const& getWrappedAccessor() const { return maAccessor; }
+ Accessor& getWrappedAccessor() { return maAccessor; }
+
+ // -------------------------------------------------------
+
+ data_type lookup(value_type const& v) const
+ {
+ // TODO(P3): use table-based/octree approach here!
+ const value_type* best_entry;
+ const value_type* palette_end( mpPalette+mnNumEntries );
+ if( (best_entry=std::find( mpPalette, palette_end, v)) != palette_end )
+ return best_entry-mpPalette;
+
+ const value_type* curr_entry( mpPalette );
+ best_entry = curr_entry;
+ while( curr_entry != palette_end )
+ {
+ if( ColorTraits<value_type>::distance(*curr_entry,
+ *best_entry)
+ > ColorTraits<value_type>::distance(*curr_entry,
+ v) )
+ {
+ best_entry = curr_entry;
+ }
+
+ ++curr_entry;
+ }
+
+ return best_entry-mpPalette;
+ }
+
+ // -------------------------------------------------------
+
+ template< class Iterator >
+ value_type operator()(Iterator const& i) const
+ {
+ return mpPalette[ maAccessor(i) ];
+ }
+
+ template< class Iterator, class Difference >
+ value_type operator()(Iterator const& i, Difference const& diff) const
+ {
+ return mpPalette[ maAccessor(i,diff) ];
+ }
+
+ // -------------------------------------------------------
+
+ template< typename V, class Iterator >
+ void set(V const& value, Iterator const& i) const
+ {
+ maAccessor.set(
+ lookup(
+ vigra::detail::RequiresExplicitCast<value_type>::cast(value) ),
+ i );
+ }
+
+ template< typename V, class Iterator, class Difference >
+ void set(V const& value, Iterator const& i, Difference const& diff) const
+ {
+ maAccessor.set(
+ lookup(
+ vigra::detail::RequiresExplicitCast<value_type>::cast(value) ),
+ i,
+ diff );
+ }
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_PALETTEIMAGEACCESSOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/pixelformatadapters.hxx b/include/basebmp/pixelformatadapters.hxx
new file mode 100644
index 000000000000..09cc9368394d
--- /dev/null
+++ b/include/basebmp/pixelformatadapters.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_BASEBMP_PIXELFORMATADAPTERS_HXX
+#define INCLUDED_BASEBMP_PIXELFORMATADAPTERS_HXX
+
+#include <basebmp/accessortraits.hxx>
+#include <basebmp/accessoradapters.hxx>
+
+#include <vigra/metaprogramming.hxx>
+
+namespace basebmp
+{
+
+// convenience functionality, providing everything necessary for a new
+// pixel format. simply plug in two conversion functors from/to a
+// common color format.
+
+/** Accessor selection metafunction, used to wrap a given accessor
+ with one converting between the pixel and color types
+
+ Use the nested template's typedef type, to retrieve an
+ AccessorAdapter which operates on a pixel value accessor, and
+ provides color values to the outside.
+
+ Nested like this, to avoid template template parameters at other
+ places: an instantiated version of AccessorSelector can be passed
+ to other templates, which in turn can invoke the nested meta
+ function.
+ */
+template< typename Getter,
+ typename Setter > struct AccessorSelector
+{
+ template< typename Accessor > struct wrap_accessor
+ {
+ typedef UnaryFunctionAccessorAdapter< Accessor,
+ Getter,
+ Setter > type;
+ };
+};
+
+//-----------------------------------------------------------------------------
+
+/** Convert color value to pixel data type
+ */
+template< class Accessor, typename DataType > struct ColorConvert
+{
+ DataType operator()( const Accessor& acc,
+ typename Accessor::value_type v ) const
+ {
+ return acc.setter(v);
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+/** Macro generates partial specialization for color-conversion
+ UnaryFunctionAccessorAdapter, and the given getter/setter functors
+ */
+#define BASEBMP_SPECIALIZE_ACCESSORTRAITS(Getter,Setter) \
+template< class Accessor > struct AccessorTraits< \
+ UnaryFunctionAccessorAdapter< Accessor, \
+ Getter, \
+ Setter > > \
+{ \
+ typedef typename Accessor::value_type data_type; \
+ typedef UnaryFunctionAccessorAdapter< \
+ Accessor, \
+ Getter, \
+ Setter > accessor_type; \
+ typedef typename accessor_type::value_type value_type; \
+ typedef ColorConvert< accessor_type, \
+ data_type > color_lookup; \
+ typedef Accessor raw_accessor; \
+ typedef vigra::VigraFalseType xor_accessor; \
+ template< class MaskAccessor, \
+ class Iterator, \
+ class MaskIterator > struct masked_accessor\
+ { typedef vigra::VigraFalseType type; }; \
+}
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_PIXELFORMATADAPTERS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/pixeliterator.hxx b/include/basebmp/pixeliterator.hxx
new file mode 100644
index 000000000000..e629af275dd9
--- /dev/null
+++ b/include/basebmp/pixeliterator.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_BASEBMP_PIXELITERATOR_HXX
+#define INCLUDED_BASEBMP_PIXELITERATOR_HXX
+
+#include <basebmp/metafunctions.hxx>
+#include <basebmp/stridedarrayiterator.hxx>
+
+#include <vigra/metaprogramming.hxx>
+#include <vigra/diff2d.hxx>
+
+namespace basebmp
+{
+
+template< typename Valuetype > class PixelColumnIterator
+{
+public:
+ typedef Valuetype value_type;
+ typedef Valuetype& reference;
+ typedef reference index_reference;
+ typedef Valuetype* pointer;
+ typedef int difference_type;
+ typedef image_traverser_tag iterator_category;
+
+ typedef StridedArrayIterator< value_type > MoveY;
+
+private:
+ MoveY y;
+
+ bool equal( PixelColumnIterator const & rhs ) const
+ {
+ return rhs.y == y;
+ }
+
+ bool less( PixelColumnIterator const & rhs ) const
+ {
+ return y < rhs.y;
+ }
+
+public:
+ PixelColumnIterator() :
+ y(0)
+ {}
+
+ explicit PixelColumnIterator( const MoveY& pos ) :
+ y(pos)
+ {}
+
+ PixelColumnIterator( const MoveY& pos, int x ) :
+ y(pos,x)
+ {}
+
+ PixelColumnIterator& operator+=( difference_type d )
+ {
+ y += d;
+ return *this;
+ }
+
+ PixelColumnIterator& operator-=( difference_type d )
+ {
+ y -= d;
+ return *this;
+ }
+
+ PixelColumnIterator operator+( difference_type d )
+ {
+ PixelColumnIterator res(*this);
+ res += d;
+ return res;
+ }
+
+ PixelColumnIterator operator-( difference_type d )
+ {
+ PixelColumnIterator res(*this);
+ res -= d;
+ return res;
+ }
+
+ PixelColumnIterator& operator++()
+ {
+ ++y;
+ return *this;
+ }
+
+ PixelColumnIterator& operator--()
+ {
+ --y;
+ return *this;
+ }
+
+ PixelColumnIterator operator++(int)
+ {
+ PixelColumnIterator res(*this);
+ ++y;
+ return res;
+ }
+
+ PixelColumnIterator operator--(int)
+ {
+ PixelColumnIterator res(*this);
+ --y;
+ return res;
+ }
+
+ bool operator==(PixelColumnIterator const & rhs) const
+ {
+ return equal( rhs );
+ }
+
+ bool operator!=(PixelColumnIterator const & rhs) const
+ {
+ return !equal( rhs );
+ }
+
+ bool operator<(PixelColumnIterator const & rhs) const
+ {
+ return less(rhs);
+ }
+
+ bool operator<=(PixelColumnIterator const & rhs) const
+ {
+ return !rhs.less(*this);
+ }
+
+ bool operator>(PixelColumnIterator const & rhs) const
+ {
+ return rhs.less(*this);
+ }
+
+ bool operator>=(PixelColumnIterator const & rhs) const
+ {
+ return !less(rhs);
+ }
+
+ difference_type operator-(PixelColumnIterator const & rhs) const
+ {
+ return y - rhs.y;
+ }
+
+ value_type get() const
+ {
+ return *y();
+ }
+
+ value_type get(difference_type d) const
+ {
+ return *y(d);
+ }
+
+ void set( value_type v ) const
+ {
+ *y() = v;
+ }
+
+ void set( value_type v, difference_type d ) const
+ {
+ *y(d) = v;
+ }
+
+ reference operator*() const
+ {
+ return *y();
+ }
+
+ pointer operator->() const
+ {
+ return y();
+ }
+
+ reference operator[](difference_type d) const
+ {
+ return *y(d);
+ }
+
+ reference operator()(int dy) const
+ {
+ return *y(dy);
+ }
+};
+
+template< typename Valuetype > class PixelIterator
+{
+public:
+ typedef Valuetype value_type;
+ typedef Valuetype& reference;
+ typedef reference index_reference;
+ typedef Valuetype* pointer;
+ typedef vigra::Diff2D difference_type;
+ typedef image_traverser_tag iterator_category;
+ typedef pointer row_iterator;
+ typedef PixelColumnIterator<value_type> column_iterator;
+
+ typedef int MoveX;
+ typedef StridedArrayIterator< value_type > MoveY;
+
+ // TODO(F2): direction of iteration (ImageIterator can be made to
+ // run backwards)
+
+private:
+ bool equal(PixelIterator const & rhs) const
+ {
+ return (x == rhs.x) && (y == rhs.y);
+ }
+
+ pointer current() const
+ {
+ return y() + x;
+ }
+
+ pointer current(int dx, int dy) const
+ {
+ return y(dy) + x+dx;
+ }
+
+public:
+ PixelIterator() :
+ x(0),
+ y(0)
+ {}
+
+ PixelIterator(pointer base, int ystride) :
+ x(0),
+ y(ystride,base)
+ {}
+
+ bool operator==(PixelIterator const & rhs) const
+ {
+ return equal(rhs);
+ }
+
+ bool operator!=(PixelIterator const & rhs) const
+ {
+ return !equal(rhs);
+ }
+
+ difference_type operator-(PixelIterator const & rhs) const
+ {
+ return difference_type(x - rhs.x, y - rhs.y);
+ }
+
+ MoveX x;
+ MoveY y;
+
+ PixelIterator & operator+=(difference_type const & s)
+ {
+ x += s.x;
+ y += s.y;
+ return *this;
+ }
+
+ PixelIterator & operator-=(difference_type const & s)
+ {
+ x -= s.x;
+ y -= s.y;
+ return *this;
+ }
+
+ PixelIterator operator+(difference_type const & s) const
+ {
+ PixelIterator ret(*this);
+ ret += s;
+ return ret;
+ }
+
+ PixelIterator operator-(difference_type const & s) const
+ {
+ PixelIterator ret(*this);
+ ret -= s;
+ return ret;
+ }
+
+ row_iterator rowIterator() const
+ {
+ return row_iterator(y()+x);
+ }
+
+ column_iterator columnIterator() const
+ {
+ return column_iterator(y,x);
+ }
+
+ value_type get() const
+ {
+ return *current();
+ }
+
+ value_type get(difference_type const & d) const
+ {
+ return *current(d.y, d.x);
+ }
+
+ void set( value_type v ) const
+ {
+ *current() = v;
+ }
+
+ void set( value_type v, difference_type const & d ) const
+ {
+ *current(d.y,d.x) = v;
+ }
+
+ reference operator*() const
+ {
+ return *current();
+ }
+
+ pointer operator->() const
+ {
+ return current();
+ }
+
+ reference operator[]( const vigra::Diff2D& d ) const
+ {
+ return *current(d.x,d.y);
+ }
+
+ reference operator()(int dx, int dy) const
+ {
+ return *current(dx,dy);
+ }
+
+ pointer operator[](int dy) const
+ {
+ return y(dy) + x;
+ }
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_PIXELITERATOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/polypolygonrenderer.hxx b/include/basebmp/polypolygonrenderer.hxx
new file mode 100644
index 000000000000..80f73ac01279
--- /dev/null
+++ b/include/basebmp/polypolygonrenderer.hxx
@@ -0,0 +1,360 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_POLYPOLYGONRENDERER_HXX
+#define INCLUDED_BASEBMP_POLYPOLYGONRENDERER_HXX
+
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/range/b2ibox.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <basegfx/polygon/b2dpolypolygonfillrule.hxx>
+#include <basegfx/numeric/ftools.hxx>
+
+#include <vigra/diff2d.hxx>
+#include <vigra/iteratortraits.hxx>
+
+#include <vector>
+
+
+namespace basebmp
+{
+ namespace detail
+ {
+ /// convert int32 to 32:32 fixed point
+ inline sal_Int64 toFractional( sal_Int32 v ) { return (sal_Int64)v << 32; }
+ /// convert double to 32:32 fixed point
+ inline sal_Int64 toFractional( double v ) { return (sal_Int64)(v*SAL_MAX_UINT32 + (v < 0.0 ? -0.5 : 0.5 )); }
+ /// convert 32:32 fixed point to int32 (truncate)
+ inline sal_Int32 toInteger( sal_Int64 v ) { return (sal_Int32)(v < 0 ? ~((~v) >> 32) : v >> 32); }
+ /// convert 32:32 fixed point to int32 (properly rounded)
+ inline sal_Int32 toRoundedInteger( sal_Int64 v ) { return toInteger(v) + (sal_Int32)((v&0x80000000) >> 31); }
+
+ /** internal vertex store -
+
+ Different from B2DPoint, since we don't need floating
+ point coords, but orientation of vertex and y counter
+ */
+ struct Vertex
+ {
+ sal_Int32 mnYCounter;
+ sal_Int64 mnX;
+ sal_Int64 mnXDelta;
+
+ bool mbDownwards; // needed for nonzero winding rule
+ // fills
+
+ Vertex() :
+ mnYCounter(0),
+ mnX(0),
+ mnXDelta(0),
+ mbDownwards(true)
+ {}
+ Vertex( basegfx::B2DPoint const& rPt1,
+ basegfx::B2DPoint const& rPt2,
+ bool bDownwards ) :
+ mnYCounter( basegfx::fround(rPt2.getY()) -
+ basegfx::fround(rPt1.getY()) ),
+ mnX( toFractional( basegfx::fround(rPt1.getX()) )),
+ mnXDelta( toFractional(
+ ((rPt2.getX() - rPt1.getX()) /
+ (double)mnYCounter) )),
+ mbDownwards(bDownwards)
+ {}
+ };
+
+ typedef std::vector< std::vector<Vertex> > VectorOfVectorOfVertices;
+ typedef std::vector< Vertex* > VectorOfVertexPtr;
+
+ /// non-templated setup of GET
+ sal_uInt32 setupGlobalEdgeTable( VectorOfVectorOfVertices& rGET,
+ basegfx::B2DPolyPolygon const& rPoly,
+ sal_Int32 nMinY );
+ /// sort rAETSrc, copy not-yet-ended edges over to rAETDest
+ void sortAET( VectorOfVertexPtr& rAETSrc,
+ VectorOfVertexPtr& rAETDest );
+
+ /// For the STL algorithms
+ struct RasterConvertVertexComparator
+ {
+ RasterConvertVertexComparator() {}
+
+ bool operator()( const Vertex& rLHS,
+ const Vertex& rRHS ) const
+ {
+ return rLHS.mnX < rRHS.mnX;
+ }
+
+ bool operator()( const Vertex* pLHS,
+ const Vertex* pRHS ) const
+ {
+ return pLHS->mnX < pRHS->mnX;
+ }
+ };
+
+ } // namespace detail
+
+
+ /** Raster-convert a poly-polygon.
+
+ This algorithm does not perform antialiasing, and thus
+ internally works with integer vertex coordinates.
+
+ @param begin
+ Left, top edge of the destination bitmap. This position is
+ considered (0,0) relative to all polygon vertices
+
+ @param ad
+ Accessor to set pixel values
+
+ @param fillColor
+ Color to use for filling
+
+ @param rClipRect
+ Clipping rectangle, relative to the begin iterator. No pixel outside
+ this clip rect will be modified.
+
+ @param rPoly
+ Polygon to fill
+ */
+ template< class DestIterator, class DestAccessor, typename T >
+ void renderClippedPolyPolygon( DestIterator begin,
+ DestAccessor ad,
+ T fillColor,
+ const basegfx::B2IBox& rClipRect,
+ basegfx::B2DPolyPolygon const& rPoly,
+ basegfx::FillRule eFillRule )
+ {
+ const sal_Int32 nClipX1( std::max((sal_Int32)0,rClipRect.getMinX()) );
+ const sal_Int32 nClipX2( rClipRect.getMaxX() );
+ const sal_Int32 nClipY1( std::max((sal_Int32)0,rClipRect.getMinY()) );
+ const sal_Int32 nClipY2( rClipRect.getMaxY() );
+ const sal_Int64 nClipX1_frac( detail::toFractional(nClipX1) );
+ const sal_Int64 nClipX2_frac( detail::toFractional(nClipX2) );
+
+ basegfx::B2DRange const aPolyBounds( basegfx::tools::getRange(rPoly) );
+
+ const sal_Int32 nMinY( basegfx::fround(aPolyBounds.getMinY()) );
+ const sal_Int32 nMaxY(
+ std::min(
+ nClipY2-1,
+ basegfx::fround(aPolyBounds.getMaxY())));
+
+ if( nMinY > nMaxY )
+ return; // really, nothing to do then.
+
+ detail::VectorOfVectorOfVertices aGET; // the Global Edge Table
+ aGET.resize( nMaxY - nMinY + 1 );
+
+ sal_uInt32 const nVertexCount(
+ detail::setupGlobalEdgeTable( aGET, rPoly, nMinY ) );
+
+
+ // Perform actual scan conversion
+ //----------------------------------------------------------------------
+
+ if( aGET.empty() )
+ return;
+
+ detail::VectorOfVertexPtr aAET1; // the Active Edge Table
+ detail::VectorOfVertexPtr aAET2;
+ detail::VectorOfVertexPtr* pAET = &aAET1;
+ detail::VectorOfVertexPtr* pAETOther = &aAET2;
+ aAET1.reserve( nVertexCount );
+ aAET2.reserve( nVertexCount );
+
+ // current scanline - initially, points to first scanline
+ // within the clip rect, or to the polygon's first scanline
+ // (whichever is greater)
+ DestIterator aScanline( begin +
+ vigra::Diff2D(
+ 0,
+ std::max(nMinY,
+ nClipY1)) );
+ detail::RasterConvertVertexComparator aComp;
+
+
+ // now process each of the nMaxY - nMinY + 1 scanlines
+ // ------------------------------------------------------------
+
+ for( sal_Int32 y=nMinY; y <= nMaxY; ++y )
+ {
+ if( !aGET[y-nMinY].empty() )
+ {
+ // merge AET with current scanline's new vertices (both
+ // are already correctly sorted)
+ detail::VectorOfVectorOfVertices::value_type::iterator vertex=aGET[y-nMinY].begin();
+ detail::VectorOfVectorOfVertices::value_type::iterator const end=aGET[y-nMinY].end();
+ while( vertex != end )
+ {
+ // find insertion pos by binary search, and put ptr
+ // into active edge vector
+ pAET->insert( std::lower_bound( pAET->begin(),
+ pAET->end(),
+ &(*vertex),
+ aComp ),
+ &(*vertex) );
+
+ ++vertex;
+ }
+ }
+
+ // with less than two active edges, no fill visible
+ if( pAET->size() >= 2 )
+ {
+ typename vigra::IteratorTraits<DestIterator>::row_iterator
+ rowIter( aScanline.rowIterator() );
+
+ // process each span in current scanline, with
+ // even-odd fill rule
+ detail::VectorOfVertexPtr::iterator currVertex( pAET->begin() );
+ detail::VectorOfVertexPtr::iterator const lastVertex( pAET->end()-1 );
+ sal_uInt32 nCrossedEdges(0);
+ sal_Int32 nWindingNumber(0);
+ while( currVertex != lastVertex )
+ {
+ // TODO(P1): might be worth a try to extend the
+ // size()==2 case also to the actual filling
+ // here. YMMV.
+ detail::Vertex& rV1( **currVertex );
+ detail::Vertex const& rV2( **++currVertex );
+
+ nWindingNumber += -1 + 2*rV1.mbDownwards;
+
+ // calc fill status for both rules. might save a
+ // few percent runtime to specialize here...
+ const bool bEvenOddFill(
+ eFillRule == basegfx::FillRule_EVEN_ODD && !(nCrossedEdges & 0x01) );
+ const bool bNonZeroWindingFill(
+ eFillRule == basegfx::FillRule_NONZERO_WINDING_NUMBER && nWindingNumber != 0 );
+
+ // is span visible?
+ if( (bEvenOddFill || bNonZeroWindingFill) &&
+ y >= nClipY1 &&
+ rV1.mnX < nClipX2_frac &&
+ rV2.mnX > nClipX1_frac )
+ {
+ // clip span to horizontal bounds
+ sal_Int32 const nStartX(
+ std::max( nClipX1,
+ std::min( nClipX2-1,
+ detail::toRoundedInteger(rV1.mnX) )));
+ sal_Int32 const nEndX(
+ std::max( nClipX1,
+ std::min( nClipX2,
+ detail::toRoundedInteger(rV2.mnX) )));
+
+ typename vigra::IteratorTraits<DestIterator>::row_iterator
+ currPix( rowIter + nStartX);
+ typename vigra::IteratorTraits<DestIterator>::row_iterator
+ rowEnd( rowIter + nEndX );
+
+ // TODO(P2): Provide specialized span fill methods on the
+ // iterator/accessor
+ while( currPix != rowEnd )
+ ad.set(fillColor, currPix++);
+ }
+
+ // step vertices
+ rV1.mnX += rV1.mnXDelta;
+ --rV1.mnYCounter;
+
+ ++nCrossedEdges;
+ }
+
+ // step vertex also for the last one
+ detail::Vertex& rLastV( **currVertex );
+ rLastV.mnX += rLastV.mnXDelta;
+ --rLastV.mnYCounter;
+
+
+ // prune AET from ended edges, and keep it sorted
+ // ---------------------------------------------------------
+
+ pAETOther->clear();
+ if( pAET->size() == 2 )
+ {
+ // the case of exactly two active edges is both
+ // sufficiently common (all 'simple' polygons have
+ // it), and further more would complicate the
+ // generic case below (which works with a sliding
+ // triple of vertices).
+ if( !aComp(*(*pAET)[0], *(*pAET)[1]) )
+ std::swap(*(*pAET)[0], *(*pAET)[1]);
+
+ if( (*pAET)[0]->mnYCounter > 0 )
+ pAETOther->push_back( (*pAET)[0] );
+ if( (*pAET)[1]->mnYCounter > 0 )
+ pAETOther->push_back( (*pAET)[1] );
+ }
+ else
+ {
+ bool bFallbackTaken(false);
+ currVertex = pAET->begin();
+ detail::VectorOfVertexPtr::iterator prevVertex( currVertex );
+ while( currVertex != lastVertex )
+ {
+ // try to get away with one linear swoop and
+ // simple neighbor swapping. this is an
+ // overwhelmingly common case - polygons with
+ // excessively crisscrossing edges (which on
+ // top of that cross more than one other edge
+ // per scanline) are seldom. And even if we
+ // get such a beast here, this extra loop has
+ // still only linear cost
+ if( aComp(**(currVertex+1),**currVertex) )
+ {
+ std::swap(*currVertex, *(currVertex+1));
+
+ if( aComp(**currVertex,**prevVertex) )
+ {
+ // one swap was not sufficient -
+ // fallback to generic sort algo, then
+ detail::sortAET(*pAET, *pAETOther);
+ bFallbackTaken = true;
+ break;
+ }
+ }
+
+ if( (*currVertex)->mnYCounter > 0 )
+ pAETOther->push_back( *currVertex );
+
+ prevVertex = currVertex++;
+ }
+
+ // don't forget to add last vertex (loop above
+ // only deals with n-1 vertices)
+ if( !bFallbackTaken && (*currVertex)->mnYCounter > 0 )
+ pAETOther->push_back( *currVertex );
+ }
+
+ std::swap( pAET, pAETOther );
+ }
+
+ if( y >= nClipY1 )
+ ++aScanline.y;
+ }
+ }
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_POLYPOLYGONRENDERER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/rgb24pixelformats.hxx b/include/basebmp/rgb24pixelformats.hxx
new file mode 100644
index 000000000000..c4f460cc5e10
--- /dev/null
+++ b/include/basebmp/rgb24pixelformats.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_BASEBMP_RGB24PIXELFORMATS_HXX
+#define INCLUDED_BASEBMP_RGB24PIXELFORMATS_HXX
+
+#include <basebmp/color.hxx>
+#include <basebmp/accessor.hxx>
+#include <basebmp/pixeliterator.hxx>
+#include <basebmp/pixelformatadapters.hxx>
+
+#include <vigra/rgbvalue.hxx>
+
+#include <functional>
+
+namespace basebmp
+{
+
+template< typename PixelType, typename ColorType > struct RGBValueGetter :
+ public std::unary_function<PixelType, ColorType>
+{
+ ColorType operator()( PixelType const& c ) const
+ {
+ return ColorType(c.red(),c.green(),c.blue());
+ }
+};
+
+template< typename PixelType, typename ColorType > struct RGBValueSetter :
+ public std::unary_function<ColorType, PixelType>
+{
+ PixelType operator()( ColorType const& c ) const
+ {
+ PixelType res;
+ res.setRed(c.getRed());
+ res.setGreen(c.getGreen());
+ res.setBlue(c.getBlue());
+ return res;
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+template< typename PixelType > struct PixelFormatTraitsTemplate_RGBValue
+{
+ typedef PixelType pixel_type;
+
+ typedef RGBValueGetter<pixel_type,
+ Color> getter_type;
+ typedef RGBValueSetter<pixel_type,
+ Color> setter_type;
+
+ typedef PixelIterator<pixel_type> iterator_type;
+ typedef StandardAccessor<pixel_type> raw_accessor_type;
+ typedef AccessorSelector<
+ getter_type, setter_type> accessor_selector;
+};
+
+//-----------------------------------------------------------------------------
+
+// 24bpp RGB
+typedef PixelFormatTraitsTemplate_RGBValue<
+ vigra::RGBValue<sal_uInt8> > PixelFormatTraits_RGB24;
+BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_RGB24::getter_type,
+ PixelFormatTraits_RGB24::setter_type);
+
+// 24bpp BGR
+typedef PixelFormatTraitsTemplate_RGBValue<
+ vigra::RGBValue<sal_uInt8,2,1,0> > PixelFormatTraits_BGR24;
+BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_BGR24::getter_type,
+ PixelFormatTraits_BGR24::setter_type);
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_RGB24PIXELFORMATS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/rgbmaskpixelformats.hxx b/include/basebmp/rgbmaskpixelformats.hxx
new file mode 100644
index 000000000000..19cf65f97e0d
--- /dev/null
+++ b/include/basebmp/rgbmaskpixelformats.hxx
@@ -0,0 +1,331 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_RGBMASKPIXELFORMATS_HXX
+#define INCLUDED_BASEBMP_RGBMASKPIXELFORMATS_HXX
+
+#include <basebmp/color.hxx>
+#include <basebmp/colortraits.hxx>
+#include <basebmp/accessor.hxx>
+#include <basebmp/pixeliterator.hxx>
+#include <basebmp/pixelformatadapters.hxx>
+#include <basebmp/metafunctions.hxx>
+#include <basebmp/endian.hxx>
+
+#include <vigra/numerictraits.hxx>
+#include <vigra/metaprogramming.hxx>
+
+#include <functional>
+
+namespace basebmp
+{
+
+/** Base class operating on RGB truecolor mask pixel
+
+ Use this template, if you have an (integer) pixel type, and three
+ bitmasks denoting where the channel bits are.
+
+ @tpl PixelType
+ Input pixel type to operate on
+
+ @tpl ColorType
+ Underlying color type, to convert the pixel values into
+
+ @tpl RedMask
+ Bitmask, to access the red bits in the data type
+
+ @tpl GreenMask
+ Bitmask, to access the green bits in the data type
+
+ @tpl BlueMask
+ Bitmask, to access the blue bits in the data type
+
+ @tpl SwapBytes
+ When true, the final pixel values will be byte-swapped before
+ passed on.
+ */
+template< typename PixelType,
+ typename ColorType,
+ unsigned int RedMask,
+ unsigned int GreenMask,
+ unsigned int BlueMask,
+ bool SwapBytes > struct RGBMaskFunctorBase
+{
+ typedef PixelType pixel_type;
+ typedef ColorType color_type;
+ typedef typename make_unsigned<pixel_type>::type unsigned_pixel_type;
+ typedef typename ColorTraits<ColorType>::component_type component_type;
+
+ // calc corrective shifts for all three channels in advance
+ enum {
+ red_shift = numberOfTrailingZeros<RedMask>::value,
+ green_shift = numberOfTrailingZeros<GreenMask>::value,
+ blue_shift = numberOfTrailingZeros<BlueMask>::value,
+
+ red_bits = bitcount<RedMask>::value,
+ green_bits = bitcount<GreenMask>::value,
+ blue_bits = bitcount<BlueMask>::value
+ };
+};
+
+template< typename PixelType,
+ typename ColorType,
+ unsigned int RedMask,
+ unsigned int GreenMask,
+ unsigned int BlueMask,
+ bool SwapBytes > struct RGBMaskGetter :
+ public RGBMaskFunctorBase<PixelType,
+ ColorType,
+ RedMask,
+ GreenMask,
+ BlueMask,
+ SwapBytes>,
+ public std::unary_function<PixelType, ColorType>
+{
+ typedef RGBMaskFunctorBase<PixelType,
+ ColorType,
+ RedMask,
+ GreenMask,
+ BlueMask,
+ SwapBytes> base_type;
+
+ ColorType operator()( PixelType v ) const
+ {
+ v = SwapBytes ? byteSwap(v) : v;
+
+ const typename base_type::unsigned_pixel_type red (v & RedMask);
+ const typename base_type::unsigned_pixel_type green(v & GreenMask);
+ const typename base_type::unsigned_pixel_type blue (v & BlueMask);
+
+ // shift color nibbles to right-aligend position. ORing it
+ // channel value shifted twice the number of channel bits, to
+ // spread the value into the component_type range
+ ColorType res( (shiftRight(red,
+ base_type::red_shift-8*
+ (signed)sizeof(typename base_type::component_type)+
+ base_type::red_bits)) |
+ (shiftRight(red,
+ base_type::red_shift-8*
+ (signed)sizeof(typename base_type::component_type)+
+ 2*base_type::red_bits)),
+
+ (shiftRight(green,
+ base_type::green_shift-8*
+ (signed)sizeof(typename base_type::component_type)+
+ base_type::green_bits)) |
+ (shiftRight(green,
+ base_type::green_shift-8*
+ (signed)sizeof(typename base_type::component_type)+
+ 2*base_type::green_bits)),
+
+ (shiftRight(blue,
+ base_type::blue_shift-8*
+ (signed)sizeof(typename base_type::component_type)+
+ base_type::blue_bits)) |
+ (shiftRight(blue,
+ base_type::blue_shift-8*
+ (signed)sizeof(typename base_type::component_type)+
+ 2*base_type::blue_bits)) );
+ return res;
+ }
+};
+
+template< typename PixelType,
+ typename ColorType,
+ unsigned int RedMask,
+ unsigned int GreenMask,
+ unsigned int BlueMask,
+ bool SwapBytes > struct RGBMaskSetter :
+ public RGBMaskFunctorBase<PixelType,
+ ColorType,
+ RedMask,
+ GreenMask,
+ BlueMask,
+ SwapBytes>,
+ public std::unary_function<ColorType, PixelType>
+{
+ typedef RGBMaskFunctorBase<PixelType,
+ ColorType,
+ RedMask,
+ GreenMask,
+ BlueMask,
+ SwapBytes> base_type;
+
+ PixelType operator()( ColorType const& c ) const
+ {
+ const typename base_type::unsigned_pixel_type red (c.getRed());
+ const typename base_type::unsigned_pixel_type green(c.getGreen());
+ const typename base_type::unsigned_pixel_type blue (c.getBlue());
+
+ typename base_type::unsigned_pixel_type res(
+ (shiftLeft(red,
+ base_type::red_shift-8*
+ (signed)sizeof(typename base_type::component_type)+
+ base_type::red_bits) & RedMask) |
+ (shiftLeft(green,
+ base_type::green_shift-8*
+ (signed)sizeof(typename base_type::component_type)+
+ base_type::green_bits) & GreenMask) |
+ (shiftLeft(blue,
+ base_type::blue_shift-8*
+ (signed)sizeof(typename base_type::component_type)+
+ base_type::blue_bits) & BlueMask) );
+
+ return SwapBytes ? byteSwap(res) : res;
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+template< typename PixelType,
+ unsigned int RedMask,
+ unsigned int GreenMask,
+ unsigned int BlueMask,
+ bool SwapBytes > struct PixelFormatTraitsTemplate_RGBMask
+{
+ typedef PixelType pixel_type;
+
+ typedef RGBMaskGetter<pixel_type,
+ Color,
+ RedMask,
+ GreenMask,
+ BlueMask,
+ SwapBytes> getter_type;
+ typedef RGBMaskSetter<pixel_type,
+ Color,
+ RedMask,
+ GreenMask,
+ BlueMask,
+ SwapBytes> setter_type;
+
+ typedef PixelIterator<pixel_type> iterator_type;
+ typedef StandardAccessor<pixel_type> raw_accessor_type;
+ typedef AccessorSelector<
+ getter_type, setter_type> accessor_selector;
+};
+
+//-----------------------------------------------------------------------------
+
+// Hopefully this is an understandable plaintext explanation that matches
+// reality...
+
+// BASEBMP_TRUECOLORMASK_LSB_SWAP means that on a big-endian platform, a pixel
+// value when viewed as an integer (16 or 32 bits) has to be byte-swapped for
+// the channels to match the masks. Or equivalently (I think), on a big-endian
+// platform, the masks need to be byte-swapped to be correct.
+
+// I.e. on a litte-endian platform the masks work as such.
+
+// BASEBMP_TRUECOLORMASK_MSB_SWAP means the opposite. The masks work as such
+// on big-endian platforms, on little-endian platforms the pixel needs to be
+// byte-swapped for the masks to work.
+
+// So in a sense these two names are "backward". It sounds to me as if
+// BASEBMP_TRUECOLORMASK_LSB_SWAP would mean "when on LSB, swap" ;)
+
+#ifdef OSL_LITENDIAN
+# define BASEBMP_TRUECOLORMASK_LSB_SWAP false
+# define BASEBMP_TRUECOLORMASK_MSB_SWAP true
+#else
+# ifdef OSL_BIGENDIAN
+# define BASEBMP_TRUECOLORMASK_LSB_SWAP true
+# define BASEBMP_TRUECOLORMASK_MSB_SWAP false
+# else
+# error Undetermined endianness!
+# endif
+#endif
+
+//-----------------------------------------------------------------------------
+
+// 16bpp MSB RGB
+typedef PixelFormatTraitsTemplate_RGBMask<
+ sal_uInt16,
+ 0xF800,
+ 0x07E0,
+ 0x001F,
+ BASEBMP_TRUECOLORMASK_MSB_SWAP > PixelFormatTraits_RGB16_565_MSB;
+BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_RGB16_565_MSB::getter_type,
+ PixelFormatTraits_RGB16_565_MSB::setter_type);
+
+// 16bpp LSB RGB
+typedef PixelFormatTraitsTemplate_RGBMask<
+ sal_uInt16,
+ 0xF800,
+ 0x07E0,
+ 0x001F,
+ BASEBMP_TRUECOLORMASK_LSB_SWAP > PixelFormatTraits_RGB16_565_LSB;
+BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_RGB16_565_LSB::getter_type,
+ PixelFormatTraits_RGB16_565_LSB::setter_type);
+
+
+// 32bpp formats
+
+// The intent is that the order of channel names in the names of the 32bpp
+// format typedefs below correspond to the order of the channel bytes in
+// memory, if I understand correctly.... I think the point with the below
+// formats is that the channel byte order in memory is the same regardless of
+// platform byte order.
+
+// This one used to be called PixelFormatTraits_RGB32_888.
+
+typedef PixelFormatTraitsTemplate_RGBMask<
+ sal_uInt32,
+ 0x00FF0000,
+ 0x0000FF00,
+ 0x000000FF,
+ BASEBMP_TRUECOLORMASK_LSB_SWAP > PixelFormatTraits_BGRX32_8888;
+BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_BGRX32_8888::getter_type,
+ PixelFormatTraits_BGRX32_8888::setter_type);
+
+// This one used to be called PixelFormatTraits_BGR32_888.
+
+typedef PixelFormatTraitsTemplate_RGBMask<
+ sal_uInt32,
+ 0x00FF0000,
+ 0x0000FF00,
+ 0x000000FF,
+ BASEBMP_TRUECOLORMASK_MSB_SWAP > PixelFormatTraits_XRGB32_8888;
+BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_XRGB32_8888::getter_type,
+ PixelFormatTraits_XRGB32_8888::setter_type);
+
+// The following two ones were added for Android needs and for completeness
+
+typedef PixelFormatTraitsTemplate_RGBMask<
+ sal_uInt32,
+ 0xFF000000,
+ 0x00FF0000,
+ 0x0000FF00,
+ BASEBMP_TRUECOLORMASK_LSB_SWAP > PixelFormatTraits_XBGR32_8888;
+BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_XBGR32_8888::getter_type,
+ PixelFormatTraits_XBGR32_8888::setter_type);
+
+typedef PixelFormatTraitsTemplate_RGBMask<
+ sal_uInt32,
+ 0xFF000000,
+ 0x00FF0000,
+ 0x0000FF00,
+ BASEBMP_TRUECOLORMASK_MSB_SWAP > PixelFormatTraits_RGBX32_8888;
+BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_RGBX32_8888::getter_type,
+ PixelFormatTraits_RGBX32_8888::setter_type);
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_RGBMASKPIXELFORMATS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/scaleimage.hxx b/include/basebmp/scaleimage.hxx
new file mode 100644
index 000000000000..fc9022357fe6
--- /dev/null
+++ b/include/basebmp/scaleimage.hxx
@@ -0,0 +1,189 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_SCALEIMAGE_HXX
+#define INCLUDED_BASEBMP_SCALEIMAGE_HXX
+
+#include <osl/diagnose.h>
+
+#include <vigra/tuple.hxx>
+#include <vigra/copyimage.hxx>
+#include <vigra/basicimage.hxx>
+#include <vigra/iteratortraits.hxx>
+
+namespace basebmp
+{
+
+template< class SourceIter, class SourceAcc,
+ class DestIter, class DestAcc >
+void scaleLine( SourceIter s_begin,
+ SourceIter s_end,
+ SourceAcc s_acc,
+ DestIter d_begin,
+ DestIter d_end,
+ DestAcc d_acc )
+{
+ const int src_width = s_end - s_begin;
+ const int dest_width = d_end - d_begin;
+
+ OSL_ASSERT( src_width > 0 && dest_width > 0 );
+
+ if( src_width >= dest_width )
+ {
+ // shrink
+ int rem = 0;
+ while( s_begin != s_end )
+ {
+ if( rem >= 0 )
+ {
+ d_acc.set( s_acc(s_begin), d_begin );
+
+ rem -= src_width;
+ ++d_begin;
+ }
+
+ rem += dest_width;
+ ++s_begin;
+ }
+ }
+ else
+ {
+ // enlarge
+ int rem = -dest_width;
+ while( d_begin != d_end )
+ {
+ if( rem >= 0 )
+ {
+ rem -= dest_width;
+ ++s_begin;
+ }
+
+ d_acc.set( s_acc(s_begin), d_begin );
+
+ rem += src_width;
+ ++d_begin;
+ }
+ }
+}
+
+/** Scale an image using zero order interpolation (pixel replication)
+
+ Source and destination range must be at least one pixel wide and
+ high.
+
+ @param s_begin
+ Start iterator for source image
+
+ @param s_end
+ End iterator for source image
+
+ @param s_acc
+ Source accessor
+
+ @param d_begin
+ Start iterator for destination image
+
+ @param d_end
+ End iterator for destination image
+
+ @param d_acc
+ Destination accessor
+
+ @param bMustCopy
+ When true, scaleImage always copies source, even when doing 1:1
+ copy
+ */
+template< class SourceIter, class SourceAcc,
+ class DestIter, class DestAcc >
+void scaleImage( SourceIter s_begin,
+ SourceIter s_end,
+ SourceAcc s_acc,
+ DestIter d_begin,
+ DestIter d_end,
+ DestAcc d_acc,
+ bool bMustCopy=false )
+{
+ const int src_width ( s_end.x - s_begin.x );
+ const int src_height( s_end.y - s_begin.y );
+
+ const int dest_width ( d_end.x - d_begin.x );
+ const int dest_height( d_end.y - d_begin.y );
+
+ if( !bMustCopy &&
+ src_width == dest_width &&
+ src_height == dest_height )
+ {
+ // no scaling involved, can simply copy
+ vigra::copyImage( s_begin, s_end, s_acc,
+ d_begin, d_acc );
+ return;
+ }
+
+ typedef vigra::BasicImage<typename SourceAcc::value_type> TmpImage;
+ typedef typename TmpImage::traverser TmpImageIter;
+
+ TmpImage tmp_image(src_width,
+ dest_height);
+ TmpImageIter t_begin = tmp_image.upperLeft();
+
+ // scale in y direction
+ for( int x=0; x<src_width; ++x, ++s_begin.x, ++t_begin.x )
+ {
+ typename SourceIter::column_iterator s_cbegin = s_begin.columnIterator();
+ typename TmpImageIter::column_iterator t_cbegin = t_begin.columnIterator();
+
+ scaleLine(s_cbegin, s_cbegin+src_height, s_acc,
+ t_cbegin, t_cbegin+dest_height, tmp_image.accessor());
+ }
+
+ t_begin = tmp_image.upperLeft();
+
+ // scale in x direction
+ for( int y=0; y<dest_height; ++y, ++d_begin.y, ++t_begin.y )
+ {
+ typename DestIter::row_iterator d_rbegin = d_begin.rowIterator();
+ typename TmpImageIter::row_iterator t_rbegin = t_begin.rowIterator();
+
+ scaleLine(t_rbegin, t_rbegin+src_width, tmp_image.accessor(),
+ d_rbegin, d_rbegin+dest_width, d_acc);
+ }
+}
+
+/** Scale an image, range tuple version
+
+ @param bMustCopy
+ When true, scaleImage always copies source, even when doing 1:1
+ copy
+ */
+template< class SourceIter, class SourceAcc,
+ class DestIter, class DestAcc >
+inline void scaleImage( vigra::triple<SourceIter,SourceIter,SourceAcc> const& src,
+ vigra::triple<DestIter,DestIter,DestAcc> const& dst,
+ bool bMustCopy=false )
+{
+ scaleImage(src.first,src.second,src.third,
+ dst.first,dst.second,dst.third,
+ bMustCopy);
+}
+
+}
+
+#endif /* INCLUDED_BASEBMP_SCALEIMAGE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/scanlineformats.hxx b/include/basebmp/scanlineformats.hxx
new file mode 100644
index 000000000000..a1708980b5ac
--- /dev/null
+++ b/include/basebmp/scanlineformats.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_BASEBMP_SCANLINEFORMATS_HXX
+#define INCLUDED_BASEBMP_SCANLINEFORMATS_HXX
+
+#include <sal/types.h>
+
+/* Definition of Scanline formats */
+
+namespace basebmp { namespace Format
+{
+ static const sal_Int32 NONE = 0;
+ static const sal_Int32 ONE_BIT_MSB_GREY = (sal_Int32)0x01;
+ static const sal_Int32 ONE_BIT_LSB_GREY = (sal_Int32)0x02;
+ static const sal_Int32 ONE_BIT_MSB_PAL = (sal_Int32)0x03;
+ static const sal_Int32 ONE_BIT_LSB_PAL = (sal_Int32)0x04;
+ static const sal_Int32 FOUR_BIT_MSB_GREY = (sal_Int32)0x05;
+ static const sal_Int32 FOUR_BIT_LSB_GREY = (sal_Int32)0x06;
+ static const sal_Int32 FOUR_BIT_MSB_PAL = (sal_Int32)0x07;
+ static const sal_Int32 FOUR_BIT_LSB_PAL = (sal_Int32)0x08;
+ static const sal_Int32 EIGHT_BIT_PAL = (sal_Int32)0x09;
+ static const sal_Int32 EIGHT_BIT_GREY = (sal_Int32)0x0A;
+ static const sal_Int32 SIXTEEN_BIT_LSB_TC_MASK = (sal_Int32)0x0B;
+ static const sal_Int32 SIXTEEN_BIT_MSB_TC_MASK = (sal_Int32)0x0C;
+ static const sal_Int32 TWENTYFOUR_BIT_TC_MASK = (sal_Int32)0x0D;
+ static const sal_Int32 THIRTYTWO_BIT_TC_MASK = (sal_Int32)0x0E;
+ // The order of the channels code letters indicates the order of the
+ // channel bytes in memory, I think
+ static const sal_Int32 THIRTYTWO_BIT_TC_MASK_BGRA = THIRTYTWO_BIT_TC_MASK;
+ static const sal_Int32 THIRTYTWO_BIT_TC_MASK_ARGB = (sal_Int32)0x0F;
+ static const sal_Int32 THIRTYTWO_BIT_TC_MASK_ABGR = (sal_Int32)0x10;
+ static const sal_Int32 THIRTYTWO_BIT_TC_MASK_RGBA = (sal_Int32)0x11;
+ static const sal_Int32 MAX = (sal_Int32)0x11;
+
+ const char *formatName(sal_Int32 nScanlineFormat);
+} }
+
+#endif /* INCLUDED_BASEBMP_SCANLINEFORMATS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/stridedarrayiterator.hxx b/include/basebmp/stridedarrayiterator.hxx
new file mode 100644
index 000000000000..6f5772e527c6
--- /dev/null
+++ b/include/basebmp/stridedarrayiterator.hxx
@@ -0,0 +1,108 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEBMP_STRIDEDARRAYITERATOR_HXX
+#define INCLUDED_BASEBMP_STRIDEDARRAYITERATOR_HXX
+
+#include <basebmp/metafunctions.hxx>
+
+namespace basebmp
+{
+
+/** Like vigra::StridedArrayIterator
+
+ Changed semantics re. DirectionSelector<StridedArrayTag>: stride
+ now counts in <em>raw</em> bytes
+
+ Adapts given ptr, in a way that iterator increments move forward
+ in strided steps. Stride can, by the way, also be negative
+ */
+template< typename T > class StridedArrayIterator
+{
+public:
+ typedef typename clone_const<T, unsigned char>::type internal_type;
+
+ /** Create iterator
+
+ @param stride
+
+ Stride in bytes. Given value should better match memory layout
+ of T, as memory gets reinterpret-casted.
+ */
+ explicit StridedArrayIterator(int stride, T* ptr = 0) :
+ stride_(stride),
+ current_(reinterpret_cast<internal_type*>(ptr))
+ {}
+
+ /** Copy from other StridedArrayIterator, plus given offset
+
+ @param offset
+ Offset in bytes
+ */
+ StridedArrayIterator( StridedArrayIterator const& rSrc,
+ int offset ) :
+ stride_(rSrc.stride_),
+ current_(reinterpret_cast<internal_type*>(
+ reinterpret_cast<T*>(rSrc.current_)+offset))
+ {}
+
+ void operator++() {current_ += stride_; }
+ void operator++(int) {current_ += stride_; }
+ void operator--() {current_ -= stride_; }
+ void operator--(int) {current_ -= stride_; }
+ void operator+=(int dy) {current_ += dy*stride_; }
+ void operator-=(int dy) {current_ -= dy*stride_; }
+
+ int operator-(StridedArrayIterator const & rhs) const
+ { return (current_ - rhs.current_) / stride_; }
+
+ bool operator==(StridedArrayIterator const & rhs) const
+ { return current_ == rhs.current_; }
+
+ bool operator!=(StridedArrayIterator const & rhs) const
+ { return current_ != rhs.current_; }
+
+ bool operator<(StridedArrayIterator const & rhs) const
+ { return *this - rhs < 0; }
+
+ bool operator<=(StridedArrayIterator const & rhs) const
+ { return *this - rhs <= 0; }
+
+ bool operator>(StridedArrayIterator const & rhs) const
+ { return *this - rhs > 0; }
+
+ bool operator>=(StridedArrayIterator const & rhs) const
+ { return *this - rhs >= 0; }
+
+ T* operator()() const
+ { return reinterpret_cast<T*>(current_); }
+
+ T* operator()(int d) const
+ { return reinterpret_cast<T*>(current_ + d*stride_); }
+
+private:
+ int stride_;
+ internal_type* current_;
+};
+
+} // namespace basebmp
+
+#endif /* INCLUDED_BASEBMP_STRIDEDARRAYITERATOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/tools.hxx b/include/basebmp/tools.hxx
new file mode 100644
index 000000000000..31854a1d5e25
--- /dev/null
+++ b/include/basebmp/tools.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_BASEBMP_TOOLS_HXX
+#define INCLUDED_BASEBMP_TOOLS_HXX
+
+#include <basegfx/range/b2ibox.hxx>
+#include <basegfx/point/b2ipoint.hxx>
+#include <vigra/tuple.hxx>
+#include <vigra/diff2d.hxx>
+
+namespace basebmp
+{
+ inline vigra::Diff2D topLeft( const basegfx::B2IBox& rRange )
+ { return vigra::Diff2D(rRange.getMinX(),rRange.getMinY()); }
+
+ inline vigra::Diff2D bottomRight( const basegfx::B2IBox& rRange )
+ { return vigra::Diff2D(rRange.getMaxX(),rRange.getMaxY()); }
+
+ template< class Iterator, class Accessor >
+ inline vigra::triple<Iterator,Iterator,Accessor>
+ destIterRange(Iterator const& begin,
+ Accessor const& accessor,
+ const basegfx::B2IBox& rRange)
+ {
+ return vigra::triple<Iterator,Iterator,Accessor>(
+ begin + topLeft(rRange),
+ begin + bottomRight(rRange),
+ accessor);
+ }
+
+ template< class Iterator, class Accessor >
+ inline vigra::triple<Iterator,Iterator,Accessor>
+ srcIterRange(Iterator const& begin,
+ Accessor const& accessor,
+ const basegfx::B2IBox& rRange)
+ {
+ return vigra::triple<Iterator,Iterator,Accessor>(
+ begin + topLeft(rRange),
+ begin + bottomRight(rRange),
+ accessor);
+ }
+
+ template< class Iterator, class Accessor >
+ inline vigra::pair<Iterator,Accessor>
+ srcIter(Iterator const& begin,
+ Accessor const& accessor,
+ const basegfx::B2IPoint& rPt)
+ {
+ return vigra::pair<Iterator,Accessor>(
+ begin + vigra::Diff2D(rPt.getX(),rPt.getY()),
+ accessor);
+ }
+
+ template< class Iterator, class Accessor >
+ inline vigra::pair<Iterator,Accessor>
+ destIter(Iterator const& begin,
+ Accessor const& accessor,
+ const basegfx::B2IPoint& rPt)
+ {
+ return vigra::pair<Iterator,Accessor>(
+ begin + vigra::Diff2D(rPt.getX(),rPt.getY()),
+ accessor);
+ }
+}
+
+#endif /* INCLUDED_BASEBMP_TOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/basegfxdllapi.h b/include/basegfx/basegfxdllapi.h
new file mode 100644
index 000000000000..b71f0755d277
--- /dev/null
+++ b/include/basegfx/basegfxdllapi.h
@@ -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_BASEGFXDLLAPI_H
+#define INCLUDED_BASEGFXDLLAPI_H
+
+#if defined BASEGFX_STATICLIBRARY
+
+#define BASEGFX_DLLPUBLIC
+#define BASEGFX_DLLPRIVATE
+
+#else /*BASEGFX_STATICLIBRARY*/
+
+#if defined BASEGFX_DLLIMPLEMENTATION
+#define BASEGFX_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define BASEGFX_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define BASEGFX_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /*BASEGFX_STATICLIBRARY*/
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/color/bcolor.hxx b/include/basegfx/color/bcolor.hxx
new file mode 100644
index 000000000000..9b91e212ec89
--- /dev/null
+++ b/include/basegfx/color/bcolor.hxx
@@ -0,0 +1,229 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_COLOR_BCOLOR_HXX
+#define _BGFX_COLOR_BCOLOR_HXX
+
+#include <basegfx/tuple/b3dtuple.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <vector>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace com { namespace sun { namespace star { namespace rendering {
+ class XGraphicDevice;
+}}}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ /** Base Color class with three double values
+
+ This class derives all operators and common handling for
+ a 3D data class from B3DTuple. All necessary extensions
+ which are special for colors will be added here.
+
+ @see B3DTuple
+ */
+ class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED BColor : public B3DTuple
+ {
+ public:
+ /** Create a Color with red, green and blue components from [0.0 to 1.0]
+
+ The color is initialized to (0.0, 0.0, 0.0)
+ */
+ BColor()
+ : B3DTuple()
+ {}
+
+ /** Create a 3D Color
+
+ @param fRed
+ @param fGreen
+ @param fBlue
+ These parameters are used to initialize the red, green and blue intensities of the color
+ */
+ BColor(double fRed, double fGreen, double fBlue)
+ : B3DTuple(fRed, fGreen, fBlue)
+ {}
+
+ /** Create a 3D Color
+
+ @param fLuminosity
+ The parameter is used to initialize the red, green and blue intensities of the color
+ */
+ explicit BColor(double fLuminosity)
+ : B3DTuple(fLuminosity, fLuminosity, fLuminosity)
+ {}
+
+ /** Create a copy of a Color
+
+ @param rVec
+ The Color which will be copied.
+ */
+ BColor(const BColor& rVec)
+ : B3DTuple(rVec)
+ {}
+
+ /** constructor with tuple to allow copy-constructing
+ from B3DTuple-based classes
+ */
+ BColor(const ::basegfx::B3DTuple& rTuple)
+ : B3DTuple(rTuple)
+ {}
+
+ ~BColor()
+ {}
+
+ // data access read
+ double getRed() const { return mfX; }
+ double getGreen() const { return mfY; }
+ double getBlue() const { return mfZ; }
+
+ // data access write
+ void setRed(double fNew) { mfX = fNew; }
+ void setGreen(double fNew) { mfY = fNew; }
+ void setBlue(double fNew) { mfZ = fNew; }
+
+ /** *=operator to allow usage from BColor, too
+ */
+ BColor& operator*=( const BColor& rPnt )
+ {
+ mfX *= rPnt.mfX;
+ mfY *= rPnt.mfY;
+ mfZ *= rPnt.mfZ;
+ return *this;
+ }
+
+ /** *=operator to allow usage from BColor, too
+ */
+ BColor& operator*=(double t)
+ {
+ mfX *= t;
+ mfY *= t;
+ mfZ *= t;
+ return *this;
+ }
+
+ /** assignment operator to allow assigning the results
+ of B3DTuple calculations
+ */
+ BColor& operator=( const ::basegfx::B3DTuple& rVec )
+ {
+ mfX = rVec.getX();
+ mfY = rVec.getY();
+ mfZ = rVec.getZ();
+ return *this;
+ }
+
+ // blend to another color using luminance
+ void blend(const BColor& rColor)
+ {
+ const double fLuminance(luminance());
+ mfX = rColor.getRed() * fLuminance;
+ mfY = rColor.getGreen() * fLuminance;
+ mfZ = rColor.getBlue() * fLuminance;
+ }
+
+ // luminance
+ double luminance() const
+ {
+ const double fRedWeight(77.0 / 256.0); // 0.30
+ const double fGreenWeight(151.0 / 256.0); // 0.59
+ const double fBlueWeight(28.0 / 256.0); // 0.11
+
+ return (mfX * fRedWeight + mfY * fGreenWeight + mfZ * fBlueWeight);
+ }
+
+ // distances in color space
+ double getDistanceRed(const BColor& rColor) const { return (getRed() > rColor.getRed() ? getRed() - rColor.getRed() : rColor.getRed() - getRed()); }
+ double getDistanceGreen(const BColor& rColor) const { return (getGreen() > rColor.getGreen() ? getGreen() - rColor.getGreen() : rColor.getGreen() - getGreen()); }
+ double getDistanceBlue(const BColor& rColor) const { return (getBlue() > rColor.getBlue() ? getBlue() - rColor.getBlue() : rColor.getBlue() - getBlue()); }
+
+ double getDistance(const BColor& rColor) const
+ {
+ const double fDistR(getDistanceRed(rColor));
+ const double fDistG(getDistanceGreen(rColor));
+ const double fDistB(getDistanceBlue(rColor));
+
+ return sqrt(fDistR * fDistR + fDistG * fDistG + fDistB * fDistB);
+ }
+
+ double getMinimumDistance(const BColor& rColor) const
+ {
+ const double fDistR(getDistanceRed(rColor));
+ const double fDistG(getDistanceGreen(rColor));
+ const double fDistB(getDistanceBlue(rColor));
+
+ double fRetval(fDistR < fDistG ? fDistR : fDistG);
+ return (fRetval < fDistB ? fRetval : fDistB);
+ }
+
+ double getMaximumDistance(const BColor& rColor) const
+ {
+ const double fDistR(getDistanceRed(rColor));
+ const double fDistG(getDistanceGreen(rColor));
+ const double fDistB(getDistanceBlue(rColor));
+
+ double fRetval(fDistR > fDistG ? fDistR : fDistG);
+ return (fRetval > fDistB ? fRetval : fDistB);
+ }
+
+ // clamp color to [0.0..1.0] values in all three intensity components
+ void clamp()
+ {
+ mfX = basegfx::clamp(mfX, 0.0, 1.0);
+ mfY = basegfx::clamp(mfY, 0.0, 1.0);
+ mfZ = basegfx::clamp(mfZ, 0.0, 1.0);
+ }
+
+ void invert()
+ {
+ mfX = 1.0 - mfX;
+ mfY = 1.0 - mfY;
+ mfZ = 1.0 - mfZ;
+ }
+
+ static const BColor& getEmptyBColor()
+ {
+ return (const BColor&) ::basegfx::B3DTuple::getEmptyTuple();
+ }
+
+ com::sun::star::uno::Sequence< double > colorToDoubleSequence(const com::sun::star::uno::Reference< com::sun::star::rendering::XGraphicDevice >& /*xGraphicDevice*/) const
+ {
+ com::sun::star::uno::Sequence< double > aRet(4);
+ double* pRet = aRet.getArray();
+
+ pRet[0] = mfX;
+ pRet[1] = mfY;
+ pRet[2] = mfZ;
+ pRet[3] = 1.0;
+
+ return aRet;
+ }
+ };
+} // end of namespace basegfx
+
+#endif /* _BGFX_COLOR_BCOLOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/color/bcolormodifier.hxx b/include/basegfx/color/bcolormodifier.hxx
new file mode 100644
index 000000000000..4b6f04efc8e9
--- /dev/null
+++ b/include/basegfx/color/bcolormodifier.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 _BGFX_COLOR_BCOLORMODIFIER_HXX
+#define _BGFX_COLOR_BCOLORMODIFIER_HXX
+
+#include <basegfx/color/bcolor.hxx>
+#include <vector>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ /** Descriptor for type of color modification
+ */
+ enum BColorModifyMode
+ {
+ BCOLORMODIFYMODE_REPLACE, // replace all color with local color
+ BCOLORMODIFYMODE_INTERPOLATE, // interpolate color between given and local with local value
+ BCOLORMODIFYMODE_GRAY, // convert color to gray
+ BCOLORMODIFYMODE_BLACKANDWHITE, // convert color to B&W, local value is treshhold
+ BCOLORMODIFYMODE_INVERT, // invert color
+ BCOLORMODIFYMODE_LUMINANCE_TO_ALPHA // convert color to alpha value (used for Svg Mask)
+ };
+
+ /** Class to hold a color, value and mode for a color modification. Color modification is
+ done calling the getModifiedColor() method
+ */
+ class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED BColorModifier
+ {
+ protected:
+ ::basegfx::BColor maBColor;
+ double mfValue;
+ BColorModifyMode meMode;
+
+ public:
+ BColorModifier(
+ const ::basegfx::BColor& rBColor,
+ double fValue = 0.5,
+ BColorModifyMode eMode = BCOLORMODIFYMODE_REPLACE)
+ : maBColor(rBColor),
+ mfValue(fValue),
+ meMode(eMode)
+ {}
+
+ // compare operator(s)
+ bool operator==(const BColorModifier& rCompare) const
+ {
+ return (maBColor == rCompare.maBColor && mfValue == rCompare.mfValue && meMode == rCompare.meMode);
+ }
+
+ bool operator!=(const BColorModifier& rCompare) const
+ {
+ return !(operator==(rCompare));
+ }
+
+ // data access
+ const ::basegfx::BColor& getBColor() const { return maBColor; }
+ double getValue() const { return mfValue; }
+ BColorModifyMode getMode() const { return meMode; }
+
+ // compute modified color
+ ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const;
+ };
+
+ /** Class to hold a stack of BColorModifiers and to get the modified color with
+ applying all existing entry changes
+ */
+ class BASEGFX_DLLPUBLIC BColorModifierStack
+ {
+ protected:
+ ::std::vector< BColorModifier > maBColorModifiers;
+
+ public:
+ sal_uInt32 count() const
+ {
+ return maBColorModifiers.size();
+ }
+
+ const BColorModifier& getBColorModifier(sal_uInt32 nIndex) const
+ {
+ OSL_ENSURE(nIndex < count(), "BColorModifierStack: Access out of range (!)");
+ return maBColorModifiers[nIndex];
+ }
+
+ ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& rSource) const
+ {
+ if(count())
+ {
+ ::basegfx::BColor aRetval(rSource);
+ ::std::vector< BColorModifier >::const_iterator aEnd(maBColorModifiers.end());
+
+ while(aEnd != maBColorModifiers.begin())
+ {
+ aRetval = (--aEnd)->getModifiedColor(aRetval);
+ }
+
+ return aRetval;
+ }
+ else
+ {
+ return rSource;
+ }
+ }
+
+ void push(const BColorModifier& rNew)
+ {
+ maBColorModifiers.push_back(rNew);
+ }
+
+ void pop()
+ {
+ maBColorModifiers.pop_back();
+ }
+ };
+} // end of namespace basegfx
+
+#endif // _BGFX_COLOR_BCOLORMODIFIER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/color/bcolortools.hxx b/include/basegfx/color/bcolortools.hxx
new file mode 100644
index 000000000000..42ac7aafb3cc
--- /dev/null
+++ b/include/basegfx/color/bcolortools.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 _BGFX_COLOR_BCOLORTOOLS_HXX
+#define _BGFX_COLOR_BCOLORTOOLS_HXX
+
+#include <sal/types.h>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ class BColor;
+
+ namespace tools
+ {
+ /// Transform from RGB to HSL
+ BASEGFX_DLLPUBLIC BColor rgb2hsl(const BColor& rRGBColor);
+ /// Transform from HSL to RGB
+ BASEGFX_DLLPUBLIC BColor hsl2rgb(const BColor& rHSLColor);
+
+ /// Transform from RGB to HSV
+ BASEGFX_DLLPUBLIC BColor rgb2hsv(const BColor& rRGBColor);
+ /// Transform from HSV to RGB
+ BASEGFX_DLLPUBLIC BColor hsv2rgb(const BColor& rHSVColor);
+
+ /// Transform from Rec. 709 RGB (D65 white point) into CIE XYZ
+ BASEGFX_DLLPUBLIC BColor rgb2ciexyz( const BColor& rRGBColor );
+
+ }
+} // end of namespace basegfx
+
+#endif /* _BGFX_COLOR_BCOLORTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/curve/b2dbeziertools.hxx b/include/basegfx/curve/b2dbeziertools.hxx
new file mode 100644
index 000000000000..f52f00a1912f
--- /dev/null
+++ b/include/basegfx/curve/b2dbeziertools.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 _BGFX_CURVE_B2DBEZIERTOOLS_HXX
+#define _BGFX_CURVE_B2DBEZIERTOOLS_HXX
+
+#include <sal/types.h>
+#include <vector>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx
+{
+ class B2DCubicBezier;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ class BASEGFX_DLLPUBLIC B2DCubicBezierHelper
+ {
+ private:
+ ::std::vector< double > maLengthArray;
+ sal_uInt32 mnEdgeCount;
+
+ public:
+ explicit B2DCubicBezierHelper(const B2DCubicBezier& rBase, sal_uInt32 nDivisions = 9);
+
+ double getLength() const { if(!maLengthArray.empty()) return maLengthArray[maLengthArray.size() - 1]; else return 0.0; }
+ double distanceToRelative(double fDistance) const;
+ };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif /* _BGFX_CURVE_B2DBEZIERTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/curve/b2dcubicbezier.hxx b/include/basegfx/curve/b2dcubicbezier.hxx
new file mode 100644
index 000000000000..003a1970bb0a
--- /dev/null
+++ b/include/basegfx/curve/b2dcubicbezier.hxx
@@ -0,0 +1,200 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_CURVE_B2DCUBICBEZIER_HXX
+#define _BGFX_CURVE_B2DCUBICBEZIER_HXX
+
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace basegfx
+{
+ class B2DPolygon;
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ class BASEGFX_DLLPUBLIC B2DCubicBezier
+ {
+ B2DPoint maStartPoint;
+ B2DPoint maEndPoint;
+ B2DPoint maControlPointA;
+ B2DPoint maControlPointB;
+
+ public:
+ B2DCubicBezier();
+ B2DCubicBezier(const B2DCubicBezier& rBezier);
+ B2DCubicBezier(const B2DPoint& rStart, const B2DPoint& rControlPointA, const B2DPoint& rControlPointB, const B2DPoint& rEnd);
+ ~B2DCubicBezier();
+
+ // assignment operator
+ B2DCubicBezier& operator=(const B2DCubicBezier& rBezier);
+
+ // compare operators
+ bool operator==(const B2DCubicBezier& rBezier) const;
+ bool operator!=(const B2DCubicBezier& rBezier) const;
+ bool equal(const B2DCubicBezier& rBezier) const;
+
+ // test if vectors are used
+ bool isBezier() const;
+
+ // test if contained bezier is trivial and reset vectors accordingly
+ void testAndSolveTrivialBezier();
+
+ /** get length of edge
+
+ This method handles beziers and simple edges. For
+ beziers, the deviation describes the maximum allowed
+ deviation from the real edge length. The default
+ allows a deviation of 1% from the correct length.
+
+ For beziers, there is no direct way to get the length,
+ thus this method may subdivide the bezier edge and may
+ not be cheap.
+
+ @param fDeviation
+ The maximal allowed deviation between correct length
+ and bezier edge length
+
+ @return
+ The length of the edge
+ */
+ double getLength(double fDeviation = 0.01) const;
+
+ // get distance between start and end point
+ double getEdgeLength() const;
+
+ // get length of control polygon
+ double getControlPolygonLength() const;
+
+ // data interface
+ B2DPoint getStartPoint() const { return maStartPoint; }
+ void setStartPoint(const B2DPoint& rValue) { maStartPoint = rValue; }
+
+ B2DPoint getEndPoint() const { return maEndPoint; }
+ void setEndPoint(const B2DPoint& rValue) { maEndPoint = rValue; }
+
+ B2DPoint getControlPointA() const { return maControlPointA; }
+ void setControlPointA(const B2DPoint& rValue) { maControlPointA = rValue; }
+
+ B2DPoint getControlPointB() const { return maControlPointB; }
+ void setControlPointB(const B2DPoint& rValue) { maControlPointB = rValue; }
+
+ /** get the tangent in point t
+
+ This method handles all the exceptions, e.g. when control point
+ A is equal to start point and/or control point B is equal to end
+ point
+
+ @param t
+ The bezier index in the range [0.0 .. 1.0]. It will be truncated.
+
+ @return
+ The tangent vector in point t
+ */
+ B2DVector getTangent(double t) const;
+
+ /** adaptive subdivide by angle criteria
+ no start point is added, but all necessary created edges
+ and the end point
+ #i37443# allow the criteria to get unsharp in recursions
+ */
+ void adaptiveSubdivideByAngle(B2DPolygon& rTarget, double fAngleBound, bool bAllowUnsharpen) const;
+
+ /** #i37443# adaptive subdivide by nCount subdivisions
+ no start point is added, but all necessary created edges
+ and the end point
+ */
+ void adaptiveSubdivideByCount(B2DPolygon& rTarget, sal_uInt32 nCount) const;
+
+ /** Subdivide cubic bezier segment.
+
+ This function adaptively subdivides the bezier
+ segment into as much straight line segments as necessary,
+ such that the maximal orthogonal distance from any of the
+ segments to the true curve is less than the given error
+ value.
+ No start point is added, but all necessary created edges
+ and the end point
+
+ @param rPoly
+ Output polygon. The subdivided bezier segment is added to
+ this polygon via B2DPolygon::append().
+
+ @param rCurve
+ The cubic bezier curve to subdivide
+
+ @param fDistanceBound
+ Bound on the maximal distance of the approximation to the
+ true curve.
+ */
+ void adaptiveSubdivideByDistance(B2DPolygon& rTarget, double fDistanceBound) const;
+
+ // get point at given relative position
+ B2DPoint interpolatePoint(double t) const;
+
+ // calculate the smallest distance from given point to this cubic bezier segment
+ // and return the value. The relative position on the segment is returned in rCut.
+ double getSmallestDistancePointToBezierSegment(const B2DPoint& rTestPoint, double& rCut) const;
+
+ // do a split at position t and fill both resulting segments
+ void split(double t, B2DCubicBezier* pBezierA, B2DCubicBezier* pBezierB) const;
+
+ // extract snippet from fStart to fEnd from this bezier
+ B2DCubicBezier snippet(double fStart, double fEnd) const;
+
+ // get range including conrol points
+ B2DRange getRange() const;
+
+ /** Get the minimum extremum position t
+
+ @param rfResult
+ Will be changed and set to a eventually found split value which should be in the
+ range [0.0 .. 1.0]. It will be the smallest current extremum; there may be more
+
+ @return
+ Returns true if there was at least one extremum found
+ */
+ bool getMinimumExtremumPosition(double& rfResult) const;
+
+ /** Get all extremum pos of this segment
+
+ This method will calculate all extremum positions of the segment
+ and add them to rResults if they are in the range ]0.0 .. 1.0[
+
+ @param rResults
+ The vector of doubles where the results will be added. Evtl.
+ existing contents will be removed since an empty vector is a
+ necessary result to express that there are no extreme positions
+ anymore. Since there is an upper maximum of 4 values, it makes
+ sense to use reserve(4) at the vector as preparation.
+ */
+ void getAllExtremumPositions(::std::vector< double >& rResults) const;
+ };
+} // end of namespace basegfx
+
+#endif /* _BGFX_CURVE_B2DCUBICBEZIER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/matrix/b2dhommatrix.hxx b/include/basegfx/matrix/b2dhommatrix.hxx
new file mode 100644
index 000000000000..30204b91fad5
--- /dev/null
+++ b/include/basegfx/matrix/b2dhommatrix.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 _BGFX_MATRIX_B2DHOMMATRIX_HXX
+#define _BGFX_MATRIX_B2DHOMMATRIX_HXX
+
+#include <sal/types.h>
+#include <o3tl/cow_wrapper.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ class B2DTuple;
+ class Impl2DHomMatrix;
+
+ class BASEGFX_DLLPUBLIC B2DHomMatrix
+ {
+ public:
+ typedef o3tl::cow_wrapper< Impl2DHomMatrix > ImplType;
+
+ private:
+ ImplType mpImpl;
+
+ public:
+ B2DHomMatrix();
+ B2DHomMatrix(const B2DHomMatrix& rMat);
+ ~B2DHomMatrix();
+
+ /** constructor to allow setting all needed values for a 3x2 matrix at once. The
+ parameter f_0x1 e.g. is the same as using set(0, 1, f)
+ */
+ B2DHomMatrix(double f_0x0, double f_0x1, double f_0x2, double f_1x0, double f_1x1, double f_1x2);
+
+ double get(sal_uInt16 nRow, sal_uInt16 nColumn) const;
+ void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue);
+
+ /** allow setting all needed values for a 3x2 matrix in one call. The
+ parameter f_0x1 e.g. is the same as using set(0, 1, f)
+ */
+ void set3x2(double f_0x0, double f_0x1, double f_0x2, double f_1x0, double f_1x1, double f_1x2);
+
+ // test if last line is default to see if last line needs to be
+ // involved in calculations
+ bool isLastLineDefault() const;
+
+ // reset to a standard matrix
+ bool isIdentity() const;
+ void identity();
+
+ bool isInvertible() const;
+ bool invert();
+
+ void rotate(double fRadiant);
+
+ void translate(double fX, double fY);
+
+ void scale(double fX, double fY);
+
+ // Shearing-Matrices
+ void shearX(double fSx);
+ void shearY(double fSy);
+
+ B2DHomMatrix& operator+=(const B2DHomMatrix& rMat);
+ B2DHomMatrix& operator-=(const B2DHomMatrix& rMat);
+
+ bool operator==(const B2DHomMatrix& rMat) const;
+ bool operator!=(const B2DHomMatrix& rMat) const;
+
+ B2DHomMatrix& operator*=(double fValue);
+ B2DHomMatrix& operator/=(double fValue);
+
+ // matrix multiplication from the left to the local
+ B2DHomMatrix& operator*=(const B2DHomMatrix& rMat);
+
+ // assignment operator
+ B2DHomMatrix& operator=(const B2DHomMatrix& rMat);
+
+ // Help routine to decompose given homogen 3x3 matrix to components. A correction of
+ // the components is done to avoid inaccuracies.
+ bool decompose(B2DTuple& rScale, B2DTuple& rTranslate, double& rRotate, double& rShearX) const;
+ };
+
+ // addition, subtraction
+ inline B2DHomMatrix operator+(const B2DHomMatrix& rMatA, const B2DHomMatrix& rMatB)
+ {
+ B2DHomMatrix aSum(rMatA);
+ aSum += rMatB;
+ return aSum;
+ }
+
+ inline B2DHomMatrix operator-(const B2DHomMatrix& rMatA, const B2DHomMatrix& rMatB)
+ {
+ B2DHomMatrix aDiv(rMatA);
+ aDiv -= rMatB;
+ return aDiv;
+ }
+
+ // multiplication, division by a constant
+ inline B2DHomMatrix operator*(const B2DHomMatrix& rMat, double fValue)
+ {
+ B2DHomMatrix aNew(rMat);
+ aNew *= fValue;
+ return aNew;
+ }
+
+ inline B2DHomMatrix operator/(const B2DHomMatrix& rMat, double fValue)
+ {
+ B2DHomMatrix aNew(rMat);
+ aNew *= 1.0 / fValue;
+ return aNew;
+ }
+
+ inline B2DHomMatrix operator*(const B2DHomMatrix& rMatA, const B2DHomMatrix& rMatB)
+ {
+ B2DHomMatrix aMul(rMatB);
+ aMul *= rMatA;
+ return aMul;
+ }
+} // end of namespace basegfx
+
+#endif /* _BGFX_MATRIX_B2DHOMMATRIX_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/matrix/b2dhommatrixtools.hxx b/include/basegfx/matrix/b2dhommatrixtools.hxx
new file mode 100644
index 000000000000..ed255360f831
--- /dev/null
+++ b/include/basegfx/matrix/b2dhommatrixtools.hxx
@@ -0,0 +1,225 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_MATRIX_B2DHOMMATRIXTOOLS_HXX
+#define _BGFX_MATRIX_B2DHOMMATRIXTOOLS_HXX
+
+#include <sal/types.h>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+
+///////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace tools
+ {
+ /** If the rotation angle is an approximate multiple of pi/2,
+ force fSin/fCos to -1/0/1, to maintain orthogonality (which
+ might also be advantageous for the other cases, but: for
+ multiples of pi/2, the exact values _can_ be attained. It
+ would be largely unintuitive, if a 180 degrees rotation
+ would introduce slight roundoff errors, instead of exactly
+ mirroring the coordinate system)
+ */
+ BASEGFX_DLLPUBLIC void createSinCosOrthogonal(double& o_rSin, double& rCos, double fRadiant);
+
+ /** Tooling methods for on-the-fly matrix generation e.g. for inline
+ multiplications
+ */
+ BASEGFX_DLLPUBLIC B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY);
+ BASEGFX_DLLPUBLIC B2DHomMatrix createShearXB2DHomMatrix(double fShearX);
+ BASEGFX_DLLPUBLIC B2DHomMatrix createShearYB2DHomMatrix(double fShearY);
+ BASEGFX_DLLPUBLIC B2DHomMatrix createRotateB2DHomMatrix(double fRadiant);
+ BASEGFX_DLLPUBLIC B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY);
+
+ /// inline versions for parameters as tuples
+ inline B2DHomMatrix createScaleB2DHomMatrix(const B2DTuple& rScale)
+ {
+ return createScaleB2DHomMatrix(rScale.getX(), rScale.getY());
+ }
+
+ inline B2DHomMatrix createTranslateB2DHomMatrix(const B2DTuple& rTranslate)
+ {
+ return createTranslateB2DHomMatrix(rTranslate.getX(), rTranslate.getY());
+ }
+
+ /** Tooling methods for faster completely combined matrix creation
+ when scale, shearX, rotation and translation needs to be done in
+ exactly that order. It's faster since it direcly calculates
+ each matrix value based on a symbolic calculation of the three
+ matrix multiplications.
+ Inline versions for parameters as tuples added, too.
+ */
+ BASEGFX_DLLPUBLIC B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(
+ double fScaleX, double fScaleY,
+ double fShearX,
+ double fRadiant,
+ double fTranslateX, double fTranslateY);
+ inline B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(
+ const B2DTuple& rScale,
+ double fShearX,
+ double fRadiant,
+ const B2DTuple& rTranslate)
+ {
+ return createScaleShearXRotateTranslateB2DHomMatrix(
+ rScale.getX(), rScale.getY(),
+ fShearX,
+ fRadiant,
+ rTranslate.getX(), rTranslate.getY());
+ }
+
+ BASEGFX_DLLPUBLIC B2DHomMatrix createShearXRotateTranslateB2DHomMatrix(
+ double fShearX,
+ double fRadiant,
+ double fTranslateX, double fTranslateY);
+ inline B2DHomMatrix createShearXRotateTranslateB2DHomMatrix(
+ double fShearX,
+ double fRadiant,
+ const B2DTuple& rTranslate)
+ {
+ return createShearXRotateTranslateB2DHomMatrix(
+ fShearX,
+ fRadiant,
+ rTranslate.getX(), rTranslate.getY());
+ }
+
+ BASEGFX_DLLPUBLIC B2DHomMatrix createScaleTranslateB2DHomMatrix(
+ double fScaleX, double fScaleY,
+ double fTranslateX, double fTranslateY);
+ inline B2DHomMatrix createScaleTranslateB2DHomMatrix(
+ const B2DTuple& rScale,
+ const B2DTuple& rTranslate)
+ {
+ return createScaleTranslateB2DHomMatrix(
+ rScale.getX(), rScale.getY(),
+ rTranslate.getX(), rTranslate.getY());
+ }
+
+ /// special for the often used case of rotation around a point
+ BASEGFX_DLLPUBLIC B2DHomMatrix createRotateAroundPoint(
+ double fPointX, double fPointY,
+ double fRadiant);
+ inline B2DHomMatrix createRotateAroundPoint(
+ const B2DTuple& rPoint,
+ double fRadiant)
+ {
+ return createRotateAroundPoint(
+ rPoint.getX(), rPoint.getY(),
+ fRadiant);
+ }
+
+ } // end of namespace tools
+} // end of namespace basegfx
+
+///////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace tools
+ {
+ class BASEGFX_DLLPUBLIC B2DHomMatrixBufferedDecompose
+ {
+ private:
+ B2DVector maScale;
+ B2DVector maTranslate;
+ double mfRotate;
+ double mfShearX;
+
+ public:
+ B2DHomMatrixBufferedDecompose(const B2DHomMatrix& rB2DHomMatrix = B2DHomMatrix())
+ : maScale(),
+ maTranslate(),
+ mfRotate(0.0),
+ mfShearX(0.0)
+ {
+ rB2DHomMatrix.decompose(maScale, maTranslate, mfRotate, mfShearX);
+ }
+
+ // data access
+ B2DHomMatrix getB2DHomMatrix() const
+ {
+ return createScaleShearXRotateTranslateB2DHomMatrix(
+ maScale, mfShearX, mfRotate, maTranslate);
+ }
+
+ const B2DVector& getScale() const { return maScale; }
+ const B2DVector& getTranslate() const { return maTranslate; }
+ double getRotate() const { return mfRotate; }
+ double getShearX() const { return mfShearX; }
+ };
+ } // end of namespace tools
+} // end of namespace basegfx
+
+///////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace tools
+ {
+ class BASEGFX_DLLPUBLIC B2DHomMatrixBufferedOnDemandDecompose
+ {
+ private:
+ B2DHomMatrix maB2DHomMatrix;
+ B2DVector maScale;
+ B2DVector maTranslate;
+ double mfRotate;
+ double mfShearX;
+
+ // bitfield
+ unsigned mbDecomposed : 1;
+
+ void impCheckDecompose()
+ {
+ if(!mbDecomposed)
+ {
+ maB2DHomMatrix.decompose(maScale, maTranslate, mfRotate, mfShearX);
+ mbDecomposed = true;
+ }
+ }
+
+ public:
+ B2DHomMatrixBufferedOnDemandDecompose(const B2DHomMatrix& rB2DHomMatrix = B2DHomMatrix())
+ : maB2DHomMatrix(rB2DHomMatrix),
+ maScale(),
+ maTranslate(),
+ mfRotate(0.0),
+ mfShearX(0.0),
+ mbDecomposed(false)
+ {
+ }
+
+ // data access
+ const B2DHomMatrix& getB2DHomMatrix() const { return maB2DHomMatrix; }
+ const B2DVector& getScale() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return maScale; }
+ const B2DVector& getTranslate() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return maTranslate; }
+ double getRotate() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return mfRotate; }
+ double getShearX() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return mfShearX; }
+ };
+ } // end of namespace tools
+
+} // end of namespace basegfx
+
+///////////////////////////////////////////////////////////////////////////////
+
+#endif /* _BGFX_MATRIX_B2DHOMMATRIXTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/matrix/b3dhommatrix.hxx b/include/basegfx/matrix/b3dhommatrix.hxx
new file mode 100644
index 000000000000..037d400d674f
--- /dev/null
+++ b/include/basegfx/matrix/b3dhommatrix.hxx
@@ -0,0 +1,155 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_MATRIX_B3DHOMMATRIX_HXX
+#define _BGFX_MATRIX_B3DHOMMATRIX_HXX
+
+#include <sal/types.h>
+#include <basegfx/point/b3dpoint.hxx>
+#include <basegfx/vector/b3dvector.hxx>
+#include <o3tl/cow_wrapper.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ class B3DTuple;
+ class Impl3DHomMatrix;
+
+ class BASEGFX_DLLPUBLIC B3DHomMatrix
+ {
+ public:
+ typedef o3tl::cow_wrapper< Impl3DHomMatrix > ImplType;
+
+ private:
+ ImplType mpImpl;
+
+ public:
+ B3DHomMatrix();
+ B3DHomMatrix(const B3DHomMatrix& rMat);
+ ~B3DHomMatrix();
+
+ double get(sal_uInt16 nRow, sal_uInt16 nColumn) const;
+ void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue);
+
+ // test if last line is default to see if last line needs to be
+ // involved in calculations
+ bool isLastLineDefault() const;
+
+ bool isIdentity() const;
+ /// Reset to the identity matrix
+ void identity();
+
+ /// Invert the matrix (if possible)
+ bool invert();
+
+ /// Calc the matrix determinant
+ double determinant() const;
+
+ /// Rotation
+ void rotate(double fAngleX,double fAngleY,double fAngleZ);
+
+ /// Translation
+ void translate(double fX, double fY, double fZ);
+
+ /// Scaling
+ void scale(double fX, double fY, double fZ);
+
+ // Shearing-Matrices
+ void shearXY(double fSx, double fSy);
+ void shearXZ(double fSx, double fSz);
+
+ // Projection matrices, used for converting between eye and
+ // clip coordinates
+ void frustum(double fLeft = -1.0, double fRight = 1.0,
+ double fBottom = -1.0, double fTop = 1.0,
+ double fNear = 0.001, double fFar = 1.0);
+
+ void ortho(double fLeft = -1.0, double fRight = 1.0,
+ double fBottom = -1.0, double fTop = 1.0,
+ double fNear = 0.0, double fFar = 1.0);
+
+ // build orientation matrix
+ void orientation(
+ B3DPoint aVRP = B3DPoint(0.0,0.0,1.0),
+ B3DVector aVPN = B3DVector(0.0,0.0,1.0),
+ B3DVector aVUV = B3DVector(0.0,1.0,0.0));
+
+ // addition, subtraction
+ B3DHomMatrix& operator+=(const B3DHomMatrix& rMat);
+ B3DHomMatrix& operator-=(const B3DHomMatrix& rMat);
+
+ // comparison
+ bool operator==(const B3DHomMatrix& rMat) const;
+ bool operator!=(const B3DHomMatrix& rMat) const;
+
+ // multiplication, division by constant value
+ B3DHomMatrix& operator*=(double fValue);
+ B3DHomMatrix& operator/=(double fValue);
+
+ // matrix multiplication (from the left)
+ B3DHomMatrix& operator*=(const B3DHomMatrix& rMat);
+
+ // assignment operator
+ B3DHomMatrix& operator=(const B3DHomMatrix& rMat);
+
+ // decomposition
+ bool decompose(B3DTuple& rScale, B3DTuple& rTranslate, B3DTuple& rRotate, B3DTuple& rShear) const;
+ };
+
+ // addition, subtraction
+ inline B3DHomMatrix operator+(const B3DHomMatrix& rMatA, const B3DHomMatrix& rMatB)
+ {
+ B3DHomMatrix aSum(rMatA);
+ aSum += rMatB;
+ return aSum;
+ }
+
+ inline B3DHomMatrix operator-(const B3DHomMatrix& rMatA, const B3DHomMatrix& rMatB)
+ {
+ B3DHomMatrix aDiv(rMatA);
+ aDiv -= rMatB;
+ return aDiv;
+ }
+
+ // multiplication, division by constant value
+ inline B3DHomMatrix operator*(const B3DHomMatrix& rMat, double fValue)
+ {
+ B3DHomMatrix aNew(rMat);
+ aNew *= fValue;
+ return aNew;
+ }
+
+ inline B3DHomMatrix operator/(const B3DHomMatrix& rMat, double fValue)
+ {
+ B3DHomMatrix aNew(rMat);
+ aNew *= 1.0 / fValue;
+ return aNew;
+ }
+
+ inline B3DHomMatrix operator*(const B3DHomMatrix& rMatA, const B3DHomMatrix& rMatB)
+ {
+ B3DHomMatrix aMul(rMatB);
+ aMul *= rMatA;
+ return aMul;
+ }
+} // end of namespace basegfx
+
+#endif /* _BGFX_MATRIX_B3DHOMMATRIX_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/numeric/ftools.hxx b/include/basegfx/numeric/ftools.hxx
new file mode 100644
index 000000000000..70dcabe1a190
--- /dev/null
+++ b/include/basegfx/numeric/ftools.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 _BGFX_NUMERIC_FTOOLS_HXX
+#define _BGFX_NUMERIC_FTOOLS_HXX
+
+#include <rtl/math.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// standard PI defines from solar.h, but we do not want to link against tools
+
+#ifndef F_PI
+#define F_PI M_PI
+#endif
+#ifndef F_PI2
+#define F_PI2 M_PI_2
+#endif
+#ifndef F_PI4
+#define F_PI4 M_PI_4
+#endif
+#ifndef F_PI180
+#define F_PI180 (M_PI/180.0)
+#endif
+#ifndef F_PI1800
+#define F_PI1800 (M_PI/1800.0)
+#endif
+#ifndef F_PI18000
+#define F_PI18000 (M_PI/18000.0)
+#endif
+#ifndef F_2PI
+#define F_2PI (2.0*M_PI)
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+// fTools defines
+
+namespace basegfx
+{
+ /** Round double to nearest integer
+
+ @return the nearest integer
+ */
+ inline sal_Int32 fround( double fVal )
+ {
+ return fVal > 0.0 ? static_cast<sal_Int32>( fVal + .5 ) : -static_cast<sal_Int32>( -fVal + .5 );
+ }
+
+ /** Round double to nearest integer
+
+ @return the nearest 64 bit integer
+ */
+ inline sal_Int64 fround64( double fVal )
+ {
+ return fVal > 0.0 ? static_cast<sal_Int64>( fVal + .5 ) : -static_cast<sal_Int64>( -fVal + .5 );
+ }
+
+ /** Prune a small epsilon range around zero.
+
+ Use this method e.g. for calculating scale values. There, it
+ is usually advisable not to set a scaling to 0.0, because that
+ yields singular transformation matrices.
+
+ @param fVal
+ An arbitrary, but finite and valid number
+
+ @return either fVal, or a small value slightly above (when
+ fVal>0) or below (when fVal<0) zero.
+ */
+ inline double pruneScaleValue( double fVal )
+ {
+ // old version used ::std::min/max, but this collides if min is defined as preprocessor
+ // macro which is the case e.g with windows.h headers. The simplest way to avoid this is to
+ // just use the full comparison. I keep the original here, maybe there will be a better
+ // solution some day.
+ //
+ //return fVal < 0.0 ?
+ // (::std::min(fVal,-0.00001)) :
+ // (::std::max(fVal,0.00001));
+
+ if(fVal < 0.0)
+ return (fVal < -0.00001 ? fVal : -0.00001);
+ else
+ return (fVal > 0.00001 ? fVal : 0.00001);
+ }
+
+ /** clamp given value against given minimum and maximum values
+ */
+ template <class T> inline const T& clamp(const T& value, const T& minimum, const T& maximum)
+ {
+ if(value < minimum)
+ {
+ return minimum;
+ }
+ else if(value > maximum)
+ {
+ return maximum;
+ }
+ else
+ {
+ return value;
+ }
+ }
+
+ /** Convert value from degrees to radians
+ */
+ inline double deg2rad( double v )
+ {
+ // divide first, to get exact values for v being a multiple of
+ // 90 degrees
+ return v / 90.0 * M_PI_2;
+ }
+
+ /** Convert value radians to degrees
+ */
+ inline double rad2deg( double v )
+ {
+ // divide first, to get exact values for v being a multiple of
+ // pi/2
+ return v / M_PI_2 * 90.0;
+ }
+
+
+ class BASEGFX_DLLPUBLIC fTools
+ {
+ /// Threshold value for equalZero()
+ static double mfSmallValue;
+
+ public:
+ /// Get threshold value for equalZero and friends
+ static double getSmallValue() { return mfSmallValue; }
+ /// Set threshold value for equalZero and friends
+ static void setSmallValue(const double& rfNew) { mfSmallValue = rfNew; }
+
+ /// Compare against small value
+ static bool equalZero(const double& rfVal)
+ {
+ return (fabs(rfVal) <= getSmallValue());
+ }
+
+ /// Compare against given small value
+ static bool equalZero(const double& rfVal, const double& rfSmallValue)
+ {
+ return (fabs(rfVal) <= rfSmallValue);
+ }
+
+ static bool equal(const double& rfValA, const double& rfValB)
+ {
+ // changed to approxEqual usage for better numerical correctness
+ return rtl::math::approxEqual(rfValA, rfValB);
+ }
+
+ static bool equal(const double& rfValA, const double& rfValB, const double& rfSmallValue)
+ {
+ return (fabs(rfValA - rfValB) <= rfSmallValue);
+ }
+
+ static bool less(const double& rfValA, const double& rfValB)
+ {
+ return (rfValA < rfValB && !equal(rfValA, rfValB));
+ }
+
+ static bool lessOrEqual(const double& rfValA, const double& rfValB)
+ {
+ return (rfValA < rfValB || equal(rfValA, rfValB));
+ }
+
+ static bool more(const double& rfValA, const double& rfValB)
+ {
+ return (rfValA > rfValB && !equal(rfValA, rfValB));
+ }
+
+ static bool moreOrEqual(const double& rfValA, const double& rfValB)
+ {
+ return (rfValA > rfValB || equal(rfValA, rfValB));
+ }
+ };
+} // end of namespace basegfx
+
+#endif /* _BGFX_NUMERIC_FTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/pixel/bpixel.hxx b/include/basegfx/pixel/bpixel.hxx
new file mode 100644
index 000000000000..a2c59101fa78
--- /dev/null
+++ b/include/basegfx/pixel/bpixel.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 _BGFX_PIXEL_BPIXEL_HXX
+#define _BGFX_PIXEL_BPIXEL_HXX
+
+#include <sal/types.h>
+#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ class BASEGFX_DLLPUBLIC BPixel
+ {
+ protected:
+ union
+ {
+ struct
+ {
+ // bitfield
+ unsigned mnR : 8; // red intensity
+ unsigned mnG : 8; // green intensity
+ unsigned mnB : 8; // blue intensity
+ unsigned mnO : 8; // opacity, 0 == full transparence
+ } maRGBO;
+
+ struct
+ {
+ // bitfield
+ unsigned mnValue : 32; // all values
+ } maCombinedRGBO;
+ } maPixelUnion;
+
+ public:
+ BPixel()
+ {
+ maPixelUnion.maCombinedRGBO.mnValue = 0L;
+ }
+
+ // use explicit here to make sure everyone knows what he is doing. Values range from
+ // 0..255 integer here.
+ explicit BPixel(sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue, sal_uInt8 nOpacity)
+ {
+ maPixelUnion.maRGBO.mnR = nRed;
+ maPixelUnion.maRGBO.mnG = nGreen;
+ maPixelUnion.maRGBO.mnB = nBlue;
+ maPixelUnion.maRGBO.mnO = nOpacity;
+ }
+
+ // constructor from BColor which uses double precision color, so change it
+ // to local integer format. It will also be clamped here.
+ BPixel(const BColor& rColor, sal_uInt8 nOpacity)
+ {
+ maPixelUnion.maRGBO.mnR = sal_uInt8((rColor.getRed() * 255.0) + 0.5);
+ maPixelUnion.maRGBO.mnG = sal_uInt8((rColor.getGreen() * 255.0) + 0.5);
+ maPixelUnion.maRGBO.mnB = sal_uInt8((rColor.getBlue() * 255.0) + 0.5);
+ maPixelUnion.maRGBO.mnO = nOpacity;
+ }
+
+ // copy constructor
+ BPixel(const BPixel& rPixel)
+ {
+ maPixelUnion.maCombinedRGBO.mnValue = rPixel.maPixelUnion.maCombinedRGBO.mnValue;
+ }
+
+ ~BPixel()
+ {}
+
+ // assignment operator
+ BPixel& operator=( const BPixel& rPixel )
+ {
+ maPixelUnion.maCombinedRGBO.mnValue = rPixel.maPixelUnion.maCombinedRGBO.mnValue;
+ return *this;
+ }
+
+ // data access read
+ sal_uInt8 getRed() const { return maPixelUnion.maRGBO.mnR; }
+ sal_uInt8 getGreen() const { return maPixelUnion.maRGBO.mnG; }
+ sal_uInt8 getBlue() const { return maPixelUnion.maRGBO.mnB; }
+ sal_uInt8 getOpacity() const { return maPixelUnion.maRGBO.mnO; }
+ sal_uInt32 getRedGreenBlueOpacity() const { return maPixelUnion.maCombinedRGBO.mnValue; }
+
+ // data access write
+ void setRed(sal_uInt8 nNew) { maPixelUnion.maRGBO.mnR = nNew; }
+ void setGreen(sal_uInt8 nNew) { maPixelUnion.maRGBO.mnG = nNew; }
+ void setBlue(sal_uInt8 nNew) { maPixelUnion.maRGBO.mnB = nNew; }
+ void setOpacity(sal_uInt8 nNew) { maPixelUnion.maRGBO.mnO = nNew; }
+ void setRedGreenBlueOpacity(sal_uInt32 nRedGreenBlueOpacity) { maPixelUnion.maCombinedRGBO.mnValue = nRedGreenBlueOpacity; }
+ void setRedGreenBlue(sal_uInt8 nR, sal_uInt8 nG, sal_uInt8 nB) { maPixelUnion.maRGBO.mnR = nR; maPixelUnion.maRGBO.mnG = nG; maPixelUnion.maRGBO.mnB = nB; }
+
+ // comparators
+ bool isInvisible() const { return (0 == maPixelUnion.maRGBO.mnO); }
+ bool isVisible() const { return (0 != maPixelUnion.maRGBO.mnO); }
+ bool isEmpty() const { return isInvisible(); }
+ bool isUsed() const { return isVisible(); }
+
+ bool operator==( const BPixel& rPixel ) const
+ {
+ return (rPixel.maPixelUnion.maCombinedRGBO.mnValue == maPixelUnion.maCombinedRGBO.mnValue);
+ }
+
+ bool operator!=( const BPixel& rPixel ) const
+ {
+ return (rPixel.maPixelUnion.maCombinedRGBO.mnValue != maPixelUnion.maCombinedRGBO.mnValue);
+ }
+
+ // empty element
+ static const BPixel& getEmptyBPixel();
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ // external operators
+
+ inline BPixel minimum(const BPixel& rTupA, const BPixel& rTupB)
+ {
+ BPixel aMin(
+ (rTupB.getRed() < rTupA.getRed()) ? rTupB.getRed() : rTupA.getRed(),
+ (rTupB.getGreen() < rTupA.getGreen()) ? rTupB.getGreen() : rTupA.getGreen(),
+ (rTupB.getBlue() < rTupA.getBlue()) ? rTupB.getBlue() : rTupA.getBlue(),
+ (rTupB.getOpacity() < rTupA.getOpacity()) ? rTupB.getOpacity() : rTupA.getOpacity());
+ return aMin;
+ }
+
+ inline BPixel maximum(const BPixel& rTupA, const BPixel& rTupB)
+ {
+ BPixel aMax(
+ (rTupB.getRed() > rTupA.getRed()) ? rTupB.getRed() : rTupA.getRed(),
+ (rTupB.getGreen() > rTupA.getGreen()) ? rTupB.getGreen() : rTupA.getGreen(),
+ (rTupB.getBlue() > rTupA.getBlue()) ? rTupB.getBlue() : rTupA.getBlue(),
+ (rTupB.getOpacity() > rTupA.getOpacity()) ? rTupB.getOpacity() : rTupA.getOpacity());
+ return aMax;
+ }
+
+ inline BPixel interpolate(const BPixel& rOld1, const BPixel& rOld2, double t)
+ {
+ if(rOld1 == rOld2)
+ {
+ return rOld1;
+ }
+ else if(0.0 >= t)
+ {
+ return rOld1;
+ }
+ else if(1.0 <= t)
+ {
+ return rOld2;
+ }
+ else
+ {
+ const sal_uInt32 nFactor(fround(256.0 * t));
+ const sal_uInt32 nNegFac(256L - nFactor);
+ return BPixel(
+ (sal_uInt8)(((sal_uInt32)rOld1.getRed() * nNegFac + (sal_uInt32)rOld2.getRed() * nFactor) >> 8L),
+ (sal_uInt8)(((sal_uInt32)rOld1.getGreen() * nNegFac + (sal_uInt32)rOld2.getGreen() * nFactor) >> 8L),
+ (sal_uInt8)(((sal_uInt32)rOld1.getBlue() * nNegFac + (sal_uInt32)rOld2.getBlue() * nFactor) >> 8L),
+ (sal_uInt8)(((sal_uInt32)rOld1.getOpacity() * nNegFac + (sal_uInt32)rOld2.getOpacity() * nFactor) >> 8L));
+ }
+ }
+
+ inline BPixel average(const BPixel& rOld1, const BPixel& rOld2)
+ {
+ if(rOld1 == rOld2)
+ {
+ return rOld1;
+ }
+ else
+ {
+ return BPixel(
+ (sal_uInt8)(((sal_uInt32)rOld1.getRed() + (sal_uInt32)rOld2.getRed()) >> 1L),
+ (sal_uInt8)(((sal_uInt32)rOld1.getGreen() + (sal_uInt32)rOld2.getGreen()) >> 1L),
+ (sal_uInt8)(((sal_uInt32)rOld1.getBlue() + (sal_uInt32)rOld2.getBlue()) >> 1L),
+ (sal_uInt8)(((sal_uInt32)rOld1.getOpacity() + (sal_uInt32)rOld2.getOpacity()) >> 1L));
+ }
+ }
+
+ inline BPixel average(const BPixel& rOld1, const BPixel& rOld2, const BPixel& rOld3)
+ {
+ if(rOld1 == rOld2 && rOld2 == rOld3)
+ {
+ return rOld1;
+ }
+ else
+ {
+ return BPixel(
+ (sal_uInt8)(((sal_uInt32)rOld1.getRed() + (sal_uInt32)rOld2.getRed() + (sal_uInt32)rOld3.getRed()) / 3L),
+ (sal_uInt8)(((sal_uInt32)rOld1.getGreen() + (sal_uInt32)rOld2.getGreen() + (sal_uInt32)rOld3.getGreen()) / 3L),
+ (sal_uInt8)(((sal_uInt32)rOld1.getBlue() + (sal_uInt32)rOld2.getBlue() + (sal_uInt32)rOld3.getBlue()) / 3L),
+ (sal_uInt8)(((sal_uInt32)rOld1.getOpacity() + (sal_uInt32)rOld2.getOpacity() + (sal_uInt32)rOld3.getOpacity()) / 3L));
+ }
+ }
+} // end of namespace basegfx
+
+#endif /* _BGFX_PIXEL_BPIXEL_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/point/b2dpoint.hxx b/include/basegfx/point/b2dpoint.hxx
new file mode 100644
index 000000000000..ef73c8ab46c9
--- /dev/null
+++ b/include/basegfx/point/b2dpoint.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 _BGFX_POINT_B2DPOINT_HXX
+#define _BGFX_POINT_B2DPOINT_HXX
+
+#include <basegfx/tuple/b2dtuple.hxx>
+#include <basegfx/point/b2ipoint.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ // predeclaration
+ class B2DHomMatrix;
+
+ /** Base Point class with two double values
+
+ This class derives all operators and common handling for
+ a 2D data class from B2DTuple. All necessary extensions
+ which are special for points will be added here.
+
+ @see B2DTuple
+ */
+ class SAL_WARN_UNUSED B2DPoint : public ::basegfx::B2DTuple
+ {
+ public:
+ /** Create a 2D Point
+
+ The point is initialized to (0.0, 0.0)
+ */
+ B2DPoint()
+ : B2DTuple()
+ {}
+
+ /** Create a 2D Point
+
+ @param fX
+ This parameter is used to initialize the X-coordinate
+ of the 2D Point.
+
+ @param fY
+ This parameter is used to initialize the Y-coordinate
+ of the 2D Point.
+ */
+ B2DPoint(double fX, double fY)
+ : B2DTuple(fX, fY)
+ {}
+
+ /** Create a copy of a 2D Point
+
+ @param rPoint
+ The 2D Point which will be copied.
+ */
+ B2DPoint(const B2DPoint& rPoint)
+ : B2DTuple(rPoint)
+ {}
+
+ /** Create a copy of a 2D Point
+
+ @param rPoint
+ The 2D Point which will be copied.
+ */
+ explicit B2DPoint(const ::basegfx::B2IPoint& rPoint)
+ : B2DTuple(rPoint)
+ {}
+
+ /** constructor with tuple to allow copy-constructing
+ from B2DTuple-based classes
+ */
+ B2DPoint(const ::basegfx::B2DTuple& rTuple)
+ : B2DTuple(rTuple)
+ {}
+
+ ~B2DPoint()
+ {}
+
+ /** *=operator to allow usage from B2DPoint, too
+ */
+ B2DPoint& operator*=( const B2DPoint& rPnt )
+ {
+ mfX *= rPnt.mfX;
+ mfY *= rPnt.mfY;
+ return *this;
+ }
+
+ /** *=operator to allow usage from B2DPoint, too
+ */
+ B2DPoint& operator*=(double t)
+ {
+ mfX *= t;
+ mfY *= t;
+ return *this;
+ }
+
+ /** assignment operator to allow assigning the results
+ of B2DTuple calculations
+ */
+ BASEGFX_DLLPUBLIC B2DPoint& operator=( const ::basegfx::B2DTuple& rPoint );
+
+ /** Transform point by given transformation matrix.
+
+ The translational components of the matrix are, in
+ contrast to B2DVector, applied.
+ */
+ BASEGFX_DLLPUBLIC B2DPoint& operator*=( const ::basegfx::B2DHomMatrix& rMat );
+
+ static const B2DPoint& getEmptyPoint()
+ {
+ return (const B2DPoint&) ::basegfx::B2DTuple::getEmptyTuple();
+ }
+ };
+
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ /** Transform B2DPoint by given transformation matrix.
+
+ Since this is a Point, translational components of the
+ matrix are used.
+ */
+ BASEGFX_DLLPUBLIC B2DPoint operator*( const B2DHomMatrix& rMat, const B2DPoint& rPoint );
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif /* _BGFX_POINT_B2DPOINT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/point/b2ipoint.hxx b/include/basegfx/point/b2ipoint.hxx
new file mode 100644
index 000000000000..33b225a2a36d
--- /dev/null
+++ b/include/basegfx/point/b2ipoint.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 _BGFX_POINT_B2IPOINT_HXX
+#define _BGFX_POINT_B2IPOINT_HXX
+
+#include <basegfx/tuple/b2ituple.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ // predeclaration
+ class B2DHomMatrix;
+
+ /** Base Point class with two sal_Int32 values
+
+ This class derives all operators and common handling for
+ a 2D data class from B2ITuple. All necessary extensions
+ which are special for points will be added here.
+
+ @see B2ITuple
+ */
+ class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED B2IPoint : public ::basegfx::B2ITuple
+ {
+ public:
+ /** Create a 2D Point
+
+ The point is initialized to (0, 0)
+ */
+ B2IPoint()
+ : B2ITuple()
+ {}
+
+ /** Create a 2D Point
+
+ @param nX
+ This parameter is used to initialize the X-coordinate
+ of the 2D Point.
+
+ @param nY
+ This parameter is used to initialize the Y-coordinate
+ of the 2D Point.
+ */
+ B2IPoint(sal_Int32 nX, sal_Int32 nY)
+ : B2ITuple(nX, nY)
+ {}
+
+ /** Create a copy of a 2D Point
+
+ @param rPoint
+ The 2D Point which will be copied.
+ */
+ B2IPoint(const B2IPoint& rPoint)
+ : B2ITuple(rPoint)
+ {}
+
+ /** constructor with tuple to allow copy-constructing
+ from B2ITuple-based classes
+ */
+ B2IPoint(const ::basegfx::B2ITuple& rTuple)
+ : B2ITuple(rTuple)
+ {}
+
+ ~B2IPoint()
+ {}
+
+ /** *=operator to allow usage from B2IPoint, too
+ */
+ B2IPoint& operator*=( const B2IPoint& rPnt )
+ {
+ mnX *= rPnt.mnX;
+ mnY *= rPnt.mnY;
+ return *this;
+ }
+
+ /** *=operator to allow usage from B2IPoint, too
+ */
+ B2IPoint& operator*=(sal_Int32 t)
+ {
+ mnX *= t;
+ mnY *= t;
+ return *this;
+ }
+
+ /** assignment operator to allow assigning the results
+ of B2ITuple calculations
+ */
+ B2IPoint& operator=( const ::basegfx::B2ITuple& rPoint );
+
+ /** Transform point by given transformation matrix.
+
+ The translational components of the matrix are, in
+ contrast to B2DVector, applied.
+ */
+ B2IPoint& operator*=( const ::basegfx::B2DHomMatrix& rMat );
+ };
+} // end of namespace basegfx
+
+#endif /* _BGFX_POINT_B2IPOINT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/point/b3dpoint.hxx b/include/basegfx/point/b3dpoint.hxx
new file mode 100644
index 000000000000..391bc128b9fb
--- /dev/null
+++ b/include/basegfx/point/b3dpoint.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 _BGFX_POINT_B3DPOINT_HXX
+#define _BGFX_POINT_B3DPOINT_HXX
+
+#include <basegfx/tuple/b3dtuple.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ // predeclaration
+ class B3DHomMatrix;
+
+ /** Base Point class with three double values
+
+ This class derives all operators and common handling for
+ a 3D data class from B3DTuple. All necessary extensions
+ which are special for points will be added here.
+
+ @see B3DTuple
+ */
+ class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED B3DPoint : public ::basegfx::B3DTuple
+ {
+ public:
+ /** Create a 3D Point
+
+ The point is initialized to (0.0, 0.0, 0.0)
+ */
+ B3DPoint()
+ : B3DTuple()
+ {}
+
+ /** Create a 3D Point
+
+ @param fX
+ This parameter is used to initialize the X-coordinate
+ of the 3D Point.
+
+ @param fY
+ This parameter is used to initialize the Y-coordinate
+ of the 3D Point.
+
+ @param fZ
+ This parameter is used to initialize the Z-coordinate
+ of the 3D Point.
+ */
+ B3DPoint(double fX, double fY, double fZ)
+ : B3DTuple(fX, fY, fZ)
+ {}
+
+ /** Create a copy of a 3D Point
+
+ @param rVec
+ The 3D Point which will be copied.
+ */
+ B3DPoint(const B3DPoint& rVec)
+ : B3DTuple(rVec)
+ {}
+
+ /** constructor with tuple to allow copy-constructing
+ from B3DTuple-based classes
+ */
+ B3DPoint(const ::basegfx::B3DTuple& rTuple)
+ : B3DTuple(rTuple)
+ {}
+
+ ~B3DPoint()
+ {}
+
+ /** *=operator to allow usage from B3DPoint, too
+ */
+ B3DPoint& operator*=( const B3DPoint& rPnt )
+ {
+ mfX *= rPnt.mfX;
+ mfY *= rPnt.mfY;
+ mfZ *= rPnt.mfZ;
+ return *this;
+ }
+
+ /** *=operator to allow usage from B3DPoint, too
+ */
+ B3DPoint& operator*=(double t)
+ {
+ mfX *= t;
+ mfY *= t;
+ mfZ *= t;
+ return *this;
+ }
+
+ /** assignment operator to allow assigning the results
+ of B3DTuple calculations
+ */
+ B3DPoint& operator=( const ::basegfx::B3DTuple& rVec )
+ {
+ mfX = rVec.getX();
+ mfY = rVec.getY();
+ mfZ = rVec.getZ();
+ return *this;
+ }
+
+ /** Transform point by given transformation matrix.
+
+ The translational components of the matrix are, in
+ contrast to B3DVector, applied.
+ */
+ B3DPoint& operator*=( const ::basegfx::B3DHomMatrix& rMat );
+
+ static const B3DPoint& getEmptyPoint()
+ {
+ return (const B3DPoint&) ::basegfx::B3DTuple::getEmptyTuple();
+ }
+ };
+
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ /** Transform B3DPoint by given transformation matrix.
+
+ Since this is a Point, translational components of the
+ matrix are used.
+ */
+ BASEGFX_DLLPUBLIC B3DPoint operator*( const B3DHomMatrix& rMat, const B3DPoint& rPoint );
+
+} // end of namespace basegfx
+
+#endif /* _BGFX_POINT_B3DPOINT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/point/b3ipoint.hxx b/include/basegfx/point/b3ipoint.hxx
new file mode 100644
index 000000000000..e80514c13de2
--- /dev/null
+++ b/include/basegfx/point/b3ipoint.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 _BGFX_POINT_B3IPOINT_HXX
+#define _BGFX_POINT_B3IPOINT_HXX
+
+#include <basegfx/tuple/b3ituple.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ // predeclaration
+ class B3DHomMatrix;
+
+ /** Base Point class with three sal_Int32 values
+
+ This class derives all operators and common handling for
+ a 3D data class from B3ITuple. All necessary extensions
+ which are special for points will be added here.
+
+ @see B3ITuple
+ */
+ class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED B3IPoint : public ::basegfx::B3ITuple
+ {
+ public:
+ /** Create a 3D Point
+
+ The point is initialized to (0, 0, 0)
+ */
+ B3IPoint()
+ : B3ITuple()
+ {}
+
+ /** Create a 3D Point
+
+ @param nX
+ This parameter is used to initialize the X-coordinate
+ of the 3D Point.
+
+ @param nY
+ This parameter is used to initialize the Y-coordinate
+ of the 3D Point.
+
+ @param nZ
+ This parameter is used to initialize the Z-coordinate
+ of the 3D Point.
+ */
+ B3IPoint(sal_Int32 nX, sal_Int32 nY, sal_Int32 nZ)
+ : B3ITuple(nX, nY, nZ)
+ {}
+
+ /** Create a copy of a 3D Point
+
+ @param rVec
+ The 3D Point which will be copied.
+ */
+ B3IPoint(const B3IPoint& rVec)
+ : B3ITuple(rVec)
+ {}
+
+ /** constructor with tuple to allow copy-constructing
+ from B3ITuple-based classes
+ */
+ B3IPoint(const ::basegfx::B3ITuple& rTuple)
+ : B3ITuple(rTuple)
+ {}
+
+ ~B3IPoint()
+ {}
+
+ /** *=operator to allow usage from B3IPoint, too
+ */
+ B3IPoint& operator*=( const B3IPoint& rPnt )
+ {
+ mnX *= rPnt.mnX;
+ mnY *= rPnt.mnY;
+ mnZ *= rPnt.mnZ;
+ return *this;
+ }
+
+ /** *=operator to allow usage from B3IPoint, too
+ */
+ B3IPoint& operator*=(sal_Int32 t)
+ {
+ mnX *= t;
+ mnY *= t;
+ mnZ *= t;
+ return *this;
+ }
+
+ /** assignment operator to allow assigning the results
+ of B3ITuple calculations
+ */
+ B3IPoint& operator=( const ::basegfx::B3ITuple& rVec )
+ {
+ mnX = rVec.getX();
+ mnY = rVec.getY();
+ mnZ = rVec.getZ();
+ return *this;
+ }
+
+ /** Transform point by given transformation matrix.
+
+ The translational components of the matrix are, in
+ contrast to B3DVector, applied.
+ */
+ B3IPoint& operator*=( const ::basegfx::B3DHomMatrix& rMat );
+ };
+} // end of namespace basegfx
+
+#endif /* _BGFX_POINT_B3IPOINT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b2dlinegeometry.hxx b/include/basegfx/polygon/b2dlinegeometry.hxx
new file mode 100644
index 000000000000..934158f88a2f
--- /dev/null
+++ b/include/basegfx/polygon/b2dlinegeometry.hxx
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_POLYGON_B2DLINEGEOMETRY_HXX
+#define _BGFX_POLYGON_B2DLINEGEOMETRY_HXX
+
+#include <sal/types.h>
+#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace tools
+ {
+ /** Create line start/end geometry element, mostly arrows and things like that.
+
+ @param rCandidate
+ The polygon which needs to get that line ends and needs to have two points
+ at least.
+
+ @param rArrow
+ The line start/end geometry. It is assumed that the tip is pointing
+ upwards. Result will be rotated and scaled to fit.
+
+ @param bStart
+ describes if creation is for start or end of candidate.
+
+ @param fWidth
+ defines the size of the element, it's describing the target width in X
+ of the arrow.
+
+ @param fDockingPosition needs to be in [0.0 ..1.0] range, where 0.0 means
+ that the tip of the arrow will be aligned with the polygon start, 1.0 means
+ the bottom. The default of 0.5 describes a centered arrow.
+
+ @param pConsumedLength
+ Using this parameter it is possible to get back how much from the candidate
+ geometry is overlapped by the created element (consumed).
+
+ @param fCandidateLength
+ This should contain the length of rCandidate to allow work without
+ again calculating the length (which may be expensive with beziers). If 0.0 is
+ given, the length is calculated on demand.
+
+ @return
+ The Line start and end polygon, correctly rotated and scaled
+ */
+ BASEGFX_DLLPUBLIC B2DPolyPolygon createAreaGeometryForLineStartEnd(
+ const B2DPolygon& rCandidate,
+ const B2DPolyPolygon& rArrow,
+ bool bStart,
+ double fWidth,
+ double fCandidateLength = 0.0, // 0.0 -> calculate self
+ double fDockingPosition = 0.5, // 0->top, 1->bottom
+ double* pConsumedLength = 0L);
+
+ /** create filled polygon geometry for lines with a line width
+
+ This method will create bezier based, fillable polygons which
+ will resample the curve if it was extended for the given half
+ line width. It will remove extrema positions from contained
+ bezier segments and get as close as possible and defined by
+ the given parameters to the ideal result.
+
+ It will check edges for trivial bezier to avoid unnecessary
+ bezier polygons. Care is taken to produce the in-between
+ polygon points (the ones original on the source poygon) since
+ it has showed that without those, the raster converters leave
+ non-filled gaps.
+
+ @param rCandidate
+ The source polygon defining the hairline polygon path
+
+ @param fHalfLineWidth
+ The width of the line to one side
+
+ @param eJoin
+ The LineJoin if the edges meeting in a point do not have a C1
+ or C2 continuity
+
+ @param eCap
+ The kind of cap, which is added to the line.
+
+ @param fMaxAllowedAngle
+ Allows to hand over the maximum allowed angle between an edge and
+ it's control vectors. The smaller, the more subdivisions will be
+ needed to create the filled geometry. Allowed range is cropped to
+ [F_PI2 .. 0.01 * F_PI2].
+
+ @param fMaxPartOfEdge
+ Allows to influence from with relative length of a control vector
+ compared to it's edge a split is forced. The smaller, the more
+ subdivisions will be needed to create the filled geometry. Allowed
+ range is cropped to [1.0 .. 0.01]
+
+ @praram fMiterMinimumAngle
+ The minimum wanted angle between two edges when edge rounding
+ is using miter. When an edge is smaller than this (tighter)
+ the usual fallback to bevel is used. Allowed range is cropped
+ to [F_PI .. 0.01 * F_PI].
+
+ @return
+ The PolyPolygon containing the geometry of the extended line by
+ it's line width. Contains bezier segments and edge roundings as
+ needed and defined.
+ */
+ BASEGFX_DLLPUBLIC B2DPolyPolygon createAreaGeometry(
+ const B2DPolygon& rCandidate,
+ double fHalfLineWidth,
+ B2DLineJoin eJoin = B2DLINEJOIN_ROUND,
+ com::sun::star::drawing::LineCap eCap = com::sun::star::drawing::LineCap_BUTT,
+ double fMaxAllowedAngle = (12.5 * F_PI180),
+ double fMaxPartOfEdge = 0.4,
+ double fMiterMinimumAngle = (15.0 * F_PI180));
+ } // end of namespace tools
+} // end of namespace basegfx
+
+#endif /* _BGFX_POLYGON_B2DLINEGEOMETRY_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b2dpolygon.hxx b/include/basegfx/polygon/b2dpolygon.hxx
new file mode 100644
index 000000000000..7c854fdc8a0e
--- /dev/null
+++ b/include/basegfx/polygon/b2dpolygon.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 _BGFX_POLYGON_B2DPOLYGON_HXX
+#define _BGFX_POLYGON_B2DPOLYGON_HXX
+
+#include <sal/types.h>
+#include <o3tl/cow_wrapper.hxx>
+#include <basegfx/vector/b2enums.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+class ImplB2DPolygon;
+
+namespace basegfx
+{
+ class B2DPolygon;
+ class B2DPoint;
+ class B2DVector;
+ class B2DHomMatrix;
+ class B2DCubicBezier;
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ class BASEGFX_DLLPUBLIC B2DPolygon
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImplB2DPolygon > ImplType;
+
+ private:
+ // internal data.
+ ImplType mpPolygon;
+
+ public:
+ /// diverse constructors
+ B2DPolygon();
+ B2DPolygon(const B2DPolygon& rPolygon);
+ B2DPolygon(const B2DPolygon& rPolygon, sal_uInt32 nIndex, sal_uInt32 nCount);
+ ~B2DPolygon();
+
+ /// assignment operator
+ B2DPolygon& operator=(const B2DPolygon& rPolygon);
+
+ /// unshare this polygon with all internally shared instances
+ void makeUnique();
+
+ /// compare operators
+ bool operator==(const B2DPolygon& rPolygon) const;
+ bool operator!=(const B2DPolygon& rPolygon) const;
+
+ /// member count
+ sal_uInt32 count() const;
+
+ /// Coordinate interface
+ basegfx::B2DPoint getB2DPoint(sal_uInt32 nIndex) const;
+ void setB2DPoint(sal_uInt32 nIndex, const basegfx::B2DPoint& rValue);
+
+ /// Coordinate insert/append
+ void insert(sal_uInt32 nIndex, const basegfx::B2DPoint& rPoint, sal_uInt32 nCount = 1);
+ void append(const basegfx::B2DPoint& rPoint, sal_uInt32 nCount);
+ void append(const basegfx::B2DPoint& rPoint);
+ void reserve(sal_uInt32 nCount);
+
+ /// Basic ControlPoint interface
+ basegfx::B2DPoint getPrevControlPoint(sal_uInt32 nIndex) const;
+ basegfx::B2DPoint getNextControlPoint(sal_uInt32 nIndex) const;
+ void setPrevControlPoint(sal_uInt32 nIndex, const basegfx::B2DPoint& rValue);
+ void setNextControlPoint(sal_uInt32 nIndex, const basegfx::B2DPoint& rValue);
+ void setControlPoints(sal_uInt32 nIndex, const basegfx::B2DPoint& rPrev, const basegfx::B2DPoint& rNext);
+
+ /// ControlPoint resets
+ void resetPrevControlPoint(sal_uInt32 nIndex);
+ void resetNextControlPoint(sal_uInt32 nIndex);
+ void resetControlPoints();
+
+ /// Bezier segment append with control points. The current last polygon point is implicitly taken as start point.
+ void appendBezierSegment(const basegfx::B2DPoint& rNextControlPoint, const basegfx::B2DPoint& rPrevControlPoint, const basegfx::B2DPoint& rPoint);
+
+ /// ControlPoint checks
+ bool areControlPointsUsed() const;
+ bool isPrevControlPointUsed(sal_uInt32 nIndex) const;
+ bool isNextControlPointUsed(sal_uInt32 nIndex) const;
+ B2VectorContinuity getContinuityInPoint(sal_uInt32 nIndex) const;
+
+ /** bezier segment access
+
+ This method also works when it is no bezier segment at all and will fill
+ the given B2DCubicBezier as needed.
+ In any case, the given B2DCubicBezier will be filled, if necessary with
+ the single start point (if no valid edge exists).
+
+ @param nIndex
+ Index of the addressed edge's start point
+
+ @param rTarget
+ The B2DCubicBezier to be filled. It's data WILL be changed.
+ */
+ void getBezierSegment(sal_uInt32 nIndex, B2DCubicBezier& rTarget) const;
+
+ /** Default adaptive subdivision access
+
+ This method will return a default adapive subdivision of the polygon.
+ If the polygon does not contain any bezier curve segments, it will
+ just return itself.
+
+ The subdivision is created on first request and buffered, so when using
+ this subdivision You have the guarantee for fast accesses for multiple
+ usages. It is intended for tooling usage for tasks which would be hard
+ to accomplish on bezier segments (e.g. isInEpsilonRange).
+
+ The current default subdivision uses adaptiveSubdivideByCount with 9
+ subdivisions which gives 10 edges and 11 points per segment and is
+ usually pretty usable for processing purposes. There is no parameter
+ passing here ATM but it may be changed on demand. If needed, a TYPE
+ and PARAMETER (both defaulted) may be added to allow for switching
+ between the different kinds of subdivisiond and passing them one
+ parameter.
+
+ The lifetime of the buffered subdivision is based on polygon changes.
+ When changing the polygon, it will be flushed. It is buffered at the
+ refcounted implementation class, so it will survive copy by value and
+ combinations in PolyPolygons.
+
+ @return
+ The default (and buffered) subdivision of this polygon. It may
+ be this polygon itself when it has no bezier segments. It is guaranteed
+ to have no more bezier segments
+ */
+ B2DPolygon getDefaultAdaptiveSubdivision() const;
+
+ /** Get the B2DRange (Rectangle dimensions) of this B2DPolygon
+
+ A polygon may have up to three ranges:
+
+ (a) the range of the polygon points
+ (b) the range of the polygon points and control points
+ (c) the outer range of the subdivided bezier curve
+
+ Ranges (a) and (c) are produced by tools::getRange(); resp. this
+ getB2DRange(). tools::getRangeWithControlPoints handles case (b).
+
+ To get range (c) a simple solution would be to subdivide the polygon
+ and use getRange() on it. Since subdivision is expensive and decreases
+ the polygon quality, i added this new method. It will use a
+ methodology suggested by HDU. First, it gets the range (a).
+ Then it iterates over the bezier segments and for each it
+ first tests if the outer range of the bezier segment is already
+ contained in the result range.
+
+ The subdivision itself uses getAllExtremumPositions() to only
+ calculate extremum points and to expand the result accordingly.
+ Thus it calculates maximal four extremum points on the bezier
+ segment, no split is used at all.
+
+ @return
+ The outer range of the bezier curve/polygon
+ */
+ B2DRange getB2DRange() const;
+
+ /** append other 2D polygons
+
+ The default (nIndex ==0 && nCount == 0) will append
+ the whole rPoly
+
+ @param rPoly
+ The source polygon
+
+ @param nIndex
+ The index to the first point of rPoly to append
+
+ @param nCount
+ The number of points to append from rPoly, starting
+ from nIndex. If zero, as much as possibel is appended
+ */
+ void append(const B2DPolygon& rPoly, sal_uInt32 nIndex = 0, sal_uInt32 nCount = 0);
+
+ /// remove points
+ void remove(sal_uInt32 nIndex, sal_uInt32 nCount = 1);
+
+ /// clear all points
+ void clear();
+
+ /// closed state interface
+ bool isClosed() const;
+ void setClosed(bool bNew);
+
+ /// flip polygon direction
+ void flip();
+
+ /// test if Polygon has double points
+ bool hasDoublePoints() const;
+
+ /// remove double points, at the begin/end and follow-ups, too
+ void removeDoublePoints();
+
+ /// apply transformation given in matrix form
+ void transform(const basegfx::B2DHomMatrix& rMatrix);
+ };
+
+ // typedef for a vector of B2DPolygons
+ typedef ::std::vector< B2DPolygon > B2DPolygonVector;
+
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif /* _BGFX_POLYGON_B2DPOLYGON_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b2dpolygonclipper.hxx b/include/basegfx/polygon/b2dpolygonclipper.hxx
new file mode 100644
index 000000000000..197958e45a00
--- /dev/null
+++ b/include/basegfx/polygon/b2dpolygonclipper.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 _BGFX_POLYPOLYGON_B2DPOLYGONCLIPPER_HXX
+#define _BGFX_POLYPOLYGON_B2DPOLYGONCLIPPER_HXX
+
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ // predefinitions
+ class B2DRange;
+
+ namespace tools
+ {
+ // This method clips the given PolyPolygon against a horizontal or vertical axis (parallell to X or Y axis). The axis is
+ // defined by bParallelToXAxis (true -> it's parallel to the X-Axis of the coordinate system, else to the Y-Axis) and the
+ // fValueOnOtherAxis (gives the translation to the coordinate system axis). For example, when You want to define
+ // a clip axis parallel to X.Axis and 100 above it, use bParallelToXAxis = true and fValueOnOtherAxis = 100.
+ // The value bAboveAxis defines on which side the return value will be (true -> above X, right of Y).
+ // The switch bStroke decides if the polygon is interpreted as area (false) or strokes (true).
+ BASEGFX_DLLPUBLIC B2DPolyPolygon clipPolyPolygonOnParallelAxis(const B2DPolyPolygon& rCandidate, bool bParallelToXAxis, bool bAboveAxis, double fValueOnOtherAxis, bool bStroke);
+ BASEGFX_DLLPUBLIC B2DPolyPolygon clipPolygonOnParallelAxis(const B2DPolygon& rCandidate, bool bParallelToXAxis, bool bAboveAxis, double fValueOnOtherAxis, bool bStroke);
+
+ // Clip the given PolyPolygon against the given range. bInside defines if the result will contain the
+ // parts which are contained in the range or vice versa.
+ // The switch bStroke decides if the polygon is interpreted as area (false) or strokes (true).
+ BASEGFX_DLLPUBLIC B2DPolyPolygon clipPolyPolygonOnRange(const B2DPolyPolygon& rCandidate, const B2DRange& rRange, bool bInside, bool bStroke);
+ BASEGFX_DLLPUBLIC B2DPolyPolygon clipPolygonOnRange(const B2DPolygon& rCandidate, const B2DRange& rRange, bool bInside, bool bStroke);
+
+ // Clip given PolyPolygon against given clipping polygon.
+ // The switch bStroke decides if the polygon is interpreted as area (false) or strokes (true).
+ // With stroke polygons, You get all line snippets inside rCip.
+ // With filled polygons, You get all PolyPolygon parts which were inside rClip.
+ // The switch bInside decides if the parts inside the clip polygon or outside shall be created.
+ // The clip polygon is always assumed closed, even when it's isClosed() is false.
+ BASEGFX_DLLPUBLIC B2DPolyPolygon clipPolyPolygonOnPolyPolygon(const B2DPolyPolygon& rCandidate, const B2DPolyPolygon& rClip, bool bInside, bool bStroke);
+ BASEGFX_DLLPUBLIC B2DPolyPolygon clipPolygonOnPolyPolygon(const B2DPolygon& rCandidate, const B2DPolyPolygon& rClip, bool bInside, bool bStroke);
+
+ // clip the given polygon against the given range. the resulting polygon will always contain
+ // the inside parts which will always be interpreted as areas. the incoming polygon is expected
+ // to be a simple triangle list. the result is also a simple triangle list.
+ BASEGFX_DLLPUBLIC B2DPolygon clipTriangleListOnRange( const B2DPolygon& rCandidate, const B2DRange& rRange );
+
+ } // end of namespace tools
+} // end of namespace basegfx
+
+#endif /* _BGFX_POLYPOLYGON_B2DPOLYGONCLIPPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b2dpolygoncutandtouch.hxx b/include/basegfx/polygon/b2dpolygoncutandtouch.hxx
new file mode 100644
index 000000000000..05f8e0e0cb3a
--- /dev/null
+++ b/include/basegfx/polygon/b2dpolygoncutandtouch.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 _BGFX_POLYGON_CUTANDTOUCH_HXX
+#define _BGFX_POLYGON_CUTANDTOUCH_HXX
+
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace tools
+ {
+ // look for self-intersections and self-touches (points on an edge) in given polygon and add
+ // extra points there. Result will have no touches or intersections on an edge, only on points
+ BASEGFX_DLLPUBLIC B2DPolygon addPointsAtCutsAndTouches(const B2DPolygon& rCandidate);
+
+ // look for polypolygon-intersections and polypolygon-touches (point of poly A on an edge of poly B) in given PolyPolygon and add
+ // extra points there. Result will have no touches or intersections between contained polygons on an edge, only on points. For
+ // convenience, the correction for self-intersections for each member polygon will be used, too.
+ // Changed: Self intersections are searched by default, but may be switched off by 2nd parameter.
+ BASEGFX_DLLPUBLIC B2DPolyPolygon addPointsAtCutsAndTouches(const B2DPolyPolygon& rCandidate, bool bSelfIntersections = true);
+
+ // look for intersections of rCandidate with the edge from rStart to rEnd and add extra points there.
+ // Points are only added in the range of the edge, not on the endless vector.
+ BASEGFX_DLLPUBLIC B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate, const B2DPoint& rStart, const B2DPoint& rEnd);
+
+ // look for intersections of rCandidate with the mask Polygon and add extra points there.
+ // The mask polygon is assumed to be closed, even when it's not explicitly.
+ BASEGFX_DLLPUBLIC B2DPolygon addPointsAtCuts(const B2DPolygon& rCandidate, const B2DPolyPolygon& rMask);
+
+ } // end of namespace tools
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif /* _BGFX_POLYGON_CUTANDTOUCH_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b2dpolygontools.hxx b/include/basegfx/polygon/b2dpolygontools.hxx
new file mode 100644
index 000000000000..dce479847d65
--- /dev/null
+++ b/include/basegfx/polygon/b2dpolygontools.hxx
@@ -0,0 +1,442 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+#define _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX
+
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/range/b2drectangle.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b3dpolygon.hxx>
+#include <vector>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ // predefinitions
+ class B2DPolygon;
+ class B2DRange;
+
+ namespace tools
+ {
+ // B2DPolygon tools
+
+ // open/close with point add/remove and control point corrections
+ BASEGFX_DLLPUBLIC void openWithGeometryChange(B2DPolygon& rCandidate);
+ BASEGFX_DLLPUBLIC void closeWithGeometryChange(B2DPolygon& rCandidate);
+
+ /** Check if given polygon is closed.
+
+ This is kind of a 'classic' method to support old polygon
+ definitions. Those old polygon definitions define the
+ closed state of the polygon using identical start and
+ endpoints. This method corrects this (removes double
+ start/end points) and sets the Closed()-state of the
+ polygon correctly.
+ */
+ BASEGFX_DLLPUBLIC void checkClosed(B2DPolygon& rCandidate);
+
+ // Get successor and predecessor indices. Returning the same index means there
+ // is none. Same for successor.
+ BASEGFX_DLLPUBLIC sal_uInt32 getIndexOfPredecessor(sal_uInt32 nIndex, const B2DPolygon& rCandidate);
+ BASEGFX_DLLPUBLIC sal_uInt32 getIndexOfSuccessor(sal_uInt32 nIndex, const B2DPolygon& rCandidate);
+
+ // Get orientation of Polygon
+ BASEGFX_DLLPUBLIC B2VectorOrientation getOrientation(const B2DPolygon& rCandidate);
+
+ // isInside tests for B2dPoint and other B2dPolygon. On border is not inside as long as
+ // not true is given in bWithBorder flag.
+ BASEGFX_DLLPUBLIC bool isInside(const B2DPolygon& rCandidate, const B2DPoint& rPoint, bool bWithBorder = false);
+ BASEGFX_DLLPUBLIC bool isInside(const B2DPolygon& rCandidate, const B2DPolygon& rPolygon, bool bWithBorder = false);
+
+ /** Get the range of a polygon
+
+ This method creates the outer range of the subdivided bezier curve.
+ For detailed discussion see B2DPolygon::getB2DRange()
+
+ @param rCandidate
+ The B2DPolygon eventually containing bezier segments
+
+ @return
+ The outer range of the bezier curve
+ */
+ BASEGFX_DLLPUBLIC B2DRange getRange(const B2DPolygon& rCandidate);
+
+ // get signed area of polygon
+ BASEGFX_DLLPUBLIC double getSignedArea(const B2DPolygon& rCandidate);
+
+ // get area of polygon
+ BASEGFX_DLLPUBLIC double getArea(const B2DPolygon& rCandidate);
+
+ /** get length of polygon edge from point nIndex to nIndex + 1 */
+ BASEGFX_DLLPUBLIC double getEdgeLength(const B2DPolygon& rCandidate, sal_uInt32 nIndex);
+
+ /** get length of polygon */
+ BASEGFX_DLLPUBLIC double getLength(const B2DPolygon& rCandidate);
+
+ // get position on polygon for absolute given distance. If
+ // length is given, it is assumed the correct polygon length, if 0.0 it is calculated
+ // using getLength(...)
+ BASEGFX_DLLPUBLIC B2DPoint getPositionAbsolute(const B2DPolygon& rCandidate, double fDistance, double fLength = 0.0);
+
+ // get position on polygon for relative given distance in range [0.0 .. 1.0]. If
+ // length is given, it is assumed the correct polygon length, if 0.0 it is calculated
+ // using getLength(...)
+ BASEGFX_DLLPUBLIC B2DPoint getPositionRelative(const B2DPolygon& rCandidate, double fDistance, double fLength = 0.0);
+
+ // get a snippet from given polygon for absolute distances. The polygon is assumed
+ // to be opened (not closed). fFrom and fTo need to be in range [0.0 .. fLength], where
+ // fTo >= fFrom. If length is given, it is assumed the correct polygon length,
+ // if 0.0 it is calculated using getLength(...)
+ BASEGFX_DLLPUBLIC B2DPolygon getSnippetAbsolute(const B2DPolygon& rCandidate, double fFrom, double fTo, double fLength = 0.0);
+
+ // Continuity check for point with given index
+ BASEGFX_DLLPUBLIC B2VectorContinuity getContinuityInPoint(const B2DPolygon& rCandidate, sal_uInt32 nIndex);
+
+ // Subdivide all contained curves. Use distanceBound value if given.
+ BASEGFX_DLLPUBLIC B2DPolygon adaptiveSubdivideByDistance(const B2DPolygon& rCandidate, double fDistanceBound = 0.0);
+
+ // Subdivide all contained curves. Use angleBound value if given.
+ BASEGFX_DLLPUBLIC B2DPolygon adaptiveSubdivideByAngle(const B2DPolygon& rCandidate, double fAngleBound = 0.0);
+
+ // #i37443# Subdivide all contained curves.
+ BASEGFX_DLLPUBLIC B2DPolygon adaptiveSubdivideByCount(const B2DPolygon& rCandidate, sal_uInt32 nCount = 0L);
+
+ // Definitions for the cut flags used from the findCut methods
+ typedef sal_uInt16 CutFlagValue;
+
+ #define CUTFLAG_NONE (0x0000)
+ #define CUTFLAG_LINE (0x0001)
+ #define CUTFLAG_START1 (0x0002)
+ #define CUTFLAG_START2 (0x0004)
+ #define CUTFLAG_END1 (0x0008)
+ #define CUTFLAG_END2 (0x0010)
+ #define CUTFLAG_ALL (CUTFLAG_LINE|CUTFLAG_START1|CUTFLAG_START2|CUTFLAG_END1|CUTFLAG_END2)
+ #define CUTFLAG_DEFAULT (CUTFLAG_LINE|CUTFLAG_START2|CUTFLAG_END2)
+
+ // This version works with two points and vectors to define the
+ // edges for the cut test.
+ BASEGFX_DLLPUBLIC CutFlagValue findCut(
+ const B2DPoint& rEdge1Start, const B2DVector& rEdge1Delta,
+ const B2DPoint& rEdge2Start, const B2DVector& rEdge2Delta,
+ CutFlagValue aCutFlags = CUTFLAG_DEFAULT,
+ double* pCut1 = 0L, double* pCut2 = 0L);
+
+ // test if point is on the given edge in range ]0.0..1.0[ without
+ // the start/end points. If so, return true and put the parameter
+ // value in pCut (if provided)
+ BASEGFX_DLLPUBLIC bool isPointOnEdge(
+ const B2DPoint& rPoint,
+ const B2DPoint& rEdgeStart,
+ const B2DVector& rEdgeDelta,
+ double* pCut = 0L);
+
+ /** Apply given LineDashing to given polygon
+
+ This method is used to cut down line polygons to the needed
+ pieces when a dashing needs to be applied.
+ It is now capable of keeping contained bezier segments.
+ It is also capable of delivering line and non-line portions
+ depending on what target polygons You provide. This is useful
+ e.g. for dashed lines with two colors.
+ If the last and the first snippet in one of the results have
+ a common start/end ppoint, they will be merged to achieve as
+ view as needed result line snippets. This is also relevant for
+ further processing the results.
+
+ @param rCandidate
+ The polygon based on which the snippets will be created.
+
+ @param rDotDashArray
+ The line pattern given as array of length values
+
+ @param pLineTarget
+ The target for line snippets, e.g. the first entry will be
+ a line segment with length rDotDashArray[0]. The given
+ polygon will be emptied as preparation.
+
+ @param pGapTarget
+ The target for gap snippets, e.g. the first entry will be
+ a line segment with length rDotDashArray[1]. The given
+ polygon will be emptied as preparation.
+
+ @param fFullDashDotLen
+ The sumed-up length of the rDotDashArray. If zero, it will
+ be calculated internally.
+ */
+ BASEGFX_DLLPUBLIC void applyLineDashing(
+ const B2DPolygon& rCandidate,
+ const ::std::vector<double>& rDotDashArray,
+ B2DPolyPolygon* pLineTarget,
+ B2DPolyPolygon* pGapTarget = 0,
+ double fFullDashDotLen = 0.0);
+
+ // test if point is inside epsilon-range around an edge defined
+ // by the two given points. Can be used for HitTesting. The epsilon-range
+ // is defined to be the rectangle centered to the given edge, using height
+ // 2 x fDistance, and the circle around both points with radius fDistance.
+ BASEGFX_DLLPUBLIC bool isInEpsilonRange(const B2DPoint& rEdgeStart, const B2DPoint& rEdgeEnd, const B2DPoint& rTestPosition, double fDistance);
+
+ // test if point is inside epsilon-range around the given Polygon. Can be used
+ // for HitTesting. The epsilon-range is defined to be the rectangle centered
+ // to the given edge, using height 2 x fDistance, and the circle around both points
+ // with radius fDistance.
+ BASEGFX_DLLPUBLIC bool isInEpsilonRange(const B2DPolygon& rCandidate, const B2DPoint& rTestPosition, double fDistance);
+
+ /** Create a polygon from a rectangle.
+
+ @param rRect
+ The rectangle which describes the polygon size
+
+ @param fRadiusX
+ @param fRadiusY
+ Radius of the edge rounding, relative to the rectangle size. 0.0 means no
+ rounding, 1.0 will lead to an ellipse
+ */
+ BASEGFX_DLLPUBLIC B2DPolygon createPolygonFromRect( const B2DRectangle& rRect, double fRadiusX, double fRadiusY );
+
+ /** Create a polygon from a rectangle.
+ */
+ BASEGFX_DLLPUBLIC B2DPolygon createPolygonFromRect( const B2DRectangle& rRect );
+
+ /** Create the unit polygon
+ */
+ BASEGFX_DLLPUBLIC B2DPolygon createUnitPolygon();
+
+ /** Create a circle polygon with given radius.
+
+ This method creates a circle approximation consisting of
+ four cubic bezier segments, which approximate the given
+ circle with an error of less than 0.5 percent.
+
+ @param rCenter
+ Center point of the circle
+
+ @param fRadius
+ Radius of the circle
+ */
+ BASEGFX_DLLPUBLIC B2DPolygon createPolygonFromCircle( const B2DPoint& rCenter, double fRadius );
+
+ /// create half circle centered on (0,0) from [0 .. F_PI]
+ B2DPolygon createHalfUnitCircle();
+
+ /** create a polygon which describes the unit circle and close it
+
+ @param nStartQuadrant
+ To be able to rebuild the old behaviour where the circles started at bottom,
+ this parameter is used. Default is 0 which is the first quadrant and the
+ polygon's start point will be the rightmost one. When using e.g. 1, the
+ first created quadrant will start at the YMax-position (with Y down on screens,
+ this is the lowest one). This is needed since when lines are dashed, toe old
+ geometry started at bottom point, else it would look different.
+ */
+ BASEGFX_DLLPUBLIC B2DPolygon createPolygonFromUnitCircle(sal_uInt32 nStartQuadrant = 0);
+
+ /** Create an ellipse polygon with given radii.
+
+ This method creates an ellipse approximation consisting of
+ four cubic bezier segments, which approximate the given
+ ellipse with an error of less than 0.5 percent.
+
+ @param rCenter
+ Center point of the circle
+
+ @param fRadiusX
+ Radius of the ellipse in X direction
+
+ @param fRadiusY
+ Radius of the ellipse in Y direction
+ */
+ BASEGFX_DLLPUBLIC B2DPolygon createPolygonFromEllipse( const B2DPoint& rCenter, double fRadiusX, double fRadiusY );
+
+ /** Create an unit ellipse polygon with the given angles, from start to end
+ */
+ BASEGFX_DLLPUBLIC B2DPolygon createPolygonFromEllipseSegment( const B2DPoint& rCenter, double fRadiusX, double fRadiusY, double fStart, double fEnd );
+
+ BASEGFX_DLLPUBLIC B2DPolygon createPolygonFromUnitEllipseSegment( double fStart, double fEnd );
+
+ /** Predicate whether a given polygon is a rectangle.
+
+ @param rPoly
+ Polygon to check
+
+ @return true, if the polygon describes a rectangle
+ (polygon is closed, and the points are either cw or ccw
+ enumerations of a rectangle's vertices). Note that
+ intermediate points and duplicate points are ignored.
+ */
+ BASEGFX_DLLPUBLIC bool isRectangle( const B2DPolygon& rPoly );
+
+ // create 3d polygon from given 2d polygon. The given fZCoordinate is used to expand the
+ // third coordinate.
+ BASEGFX_DLLPUBLIC B3DPolygon createB3DPolygonFromB2DPolygon(const B2DPolygon& rCandidate, double fZCoordinate = 0.0);
+
+ // create 2d PolyPolygon from given 3d PolyPolygon. All coordinates are transformed using the given
+ // matrix and the resulting x,y is used to form the new polygon.
+ BASEGFX_DLLPUBLIC B2DPolygon createB2DPolygonFromB3DPolygon(const B3DPolygon& rCandidate, const B3DHomMatrix& rMat);
+
+ // calculate the smallest distance to given edge and return. The relative position on the edge is returned in Cut.
+ // That position is in the range [0.0 .. 1.0] and the returned distance is adapted accordingly to the start or end
+ // point of the edge
+ BASEGFX_DLLPUBLIC double getSmallestDistancePointToEdge(const B2DPoint& rPointA, const B2DPoint& rPointB, const B2DPoint& rTestPoint, double& rCut);
+
+ // for each contained edge calculate the smallest distance. Return the index to the smallest
+ // edge in rEdgeIndex. The relative position on the edge is returned in rCut.
+ // If nothing was found (e.g. empty input plygon), DBL_MAX is returned.
+ BASEGFX_DLLPUBLIC double getSmallestDistancePointToPolygon(const B2DPolygon& rCandidate, const B2DPoint& rTestPoint, sal_uInt32& rEdgeIndex, double& rCut);
+
+ // distort single point. rOriginal describes the original range, where the given points describe the distorted corresponding points.
+ BASEGFX_DLLPUBLIC B2DPoint distort(const B2DPoint& rCandidate, const B2DRange& rOriginal, const B2DPoint& rTopLeft, const B2DPoint& rTopRight, const B2DPoint& rBottomLeft, const B2DPoint& rBottomRight);
+
+ // distort polygon. rOriginal describes the original range, where the given points describe the distorted corresponding points.
+ BASEGFX_DLLPUBLIC B2DPolygon distort(const B2DPolygon& rCandidate, const B2DRange& rOriginal, const B2DPoint& rTopLeft, const B2DPoint& rTopRight, const B2DPoint& rBottomLeft, const B2DPoint& rBottomRight);
+
+ // expand all segments (which are not yet) to curve segments. This is done with setting the control
+ // vectors on the 1/3 resp. 2/3 distances on each segment.
+ BASEGFX_DLLPUBLIC B2DPolygon expandToCurve(const B2DPolygon& rCandidate);
+
+ // expand given segment to curve segment. This is done with setting the control
+ // vectors on the 1/3 resp. 2/3 distances. The return value describes if a change took place.
+ BASEGFX_DLLPUBLIC bool expandToCurveInPoint(B2DPolygon& rCandidate, sal_uInt32 nIndex);
+
+ // set continuity for given index. If not a curve, nothing will change. Non-curve points are not changed, too.
+ // The return value describes if a change took place.
+ BASEGFX_DLLPUBLIC bool setContinuityInPoint(B2DPolygon& rCandidate, sal_uInt32 nIndex, B2VectorContinuity eContinuity);
+
+ // test if polygon contains neutral points. A neutral point is one whos orientation is neutral
+ // e.g. positioned on the edge of it's predecessor and successor
+ BASEGFX_DLLPUBLIC bool hasNeutralPoints(const B2DPolygon& rCandidate);
+
+ // remove neutral points. A neutral point is one whos orientation is neutral
+ // e.g. positioned on the edge of it's predecessor and successor
+ BASEGFX_DLLPUBLIC B2DPolygon removeNeutralPoints(const B2DPolygon& rCandidate);
+
+ // tests if polygon is convex
+ BASEGFX_DLLPUBLIC bool isConvex(const B2DPolygon& rCandidate);
+
+ // calculates the orientation at edge nIndex
+ BASEGFX_DLLPUBLIC B2VectorOrientation getOrientationForIndex(const B2DPolygon& rCandidate, sal_uInt32 nIndex);
+
+ // calculates if given point is on given line, taking care of the numerical epsilon
+ BASEGFX_DLLPUBLIC bool isPointOnLine(const B2DPoint& rStart, const B2DPoint& rEnd, const B2DPoint& rCandidate, bool bWithPoints = false);
+
+ // calculates if given point is on given polygon, taking care of the numerical epsilon. Uses
+ // isPointOnLine internally
+ BASEGFX_DLLPUBLIC bool isPointOnPolygon(const B2DPolygon& rCandidate, const B2DPoint& rPoint, bool bWithPoints = true);
+
+ // test if candidate is inside triangle
+ BASEGFX_DLLPUBLIC bool isPointInTriangle(const B2DPoint& rA, const B2DPoint& rB, const B2DPoint& rC, const B2DPoint& rCandidate, bool bWithBorder = false);
+
+ // test if candidateA and candidateB are on the same side of the given line
+ BASEGFX_DLLPUBLIC bool arePointsOnSameSideOfLine(const B2DPoint& rStart, const B2DPoint& rEnd, const B2DPoint& rCandidateA, const B2DPoint& rCandidateB, bool bWithLine = false);
+
+ // add triangles for given rCandidate to rTarget. For each triangle, 3 points will be added to rCandidate.
+ // All triangles will go from the start point of rCandidate to two consecutive points, building (rCandidate.count() - 2)
+ // triangles.
+ BASEGFX_DLLPUBLIC void addTriangleFan(const B2DPolygon& rCandidate, B2DPolygon& rTarget);
+
+ // grow for polygon. Move all geometry in each point in the direction of the normal in that point
+ // with the given amount. Value may be negative.
+ BASEGFX_DLLPUBLIC B2DPolygon growInNormalDirection(const B2DPolygon& rCandidate, double fValue);
+
+ // force all sub-polygons to a point count of nSegments
+ BASEGFX_DLLPUBLIC B2DPolygon reSegmentPolygon(const B2DPolygon& rCandidate, sal_uInt32 nSegments);
+
+ // create polygon state at t from 0.0 to 1.0 between the two polygons. Both polygons must have the same
+ // organisation, e.g. same amount of points
+ BASEGFX_DLLPUBLIC B2DPolygon interpolate(const B2DPolygon& rOld1, const B2DPolygon& rOld2, double t);
+
+ // #i76891# Try to remove existing curve segments if they are simply edges
+ BASEGFX_DLLPUBLIC B2DPolygon simplifyCurveSegments(const B2DPolygon& rCandidate);
+
+ // makes the given indexed point the new polygon start point. To do that, the points in the
+ // polygon will be rotated. This is only valid for closed polygons, for non-closed ones
+ // an assertion will be triggered
+ BASEGFX_DLLPUBLIC B2DPolygon makeStartPoint(const B2DPolygon& rCandidate, sal_uInt32 nIndexOfNewStatPoint);
+
+ /** create edges of given length along given B2DPolygon
+
+ @param rCandidate
+ The polygon to move along. Points at the given polygon are created, starting
+ at position fStart and stopping at less or equal to fEnd. The closed state is
+ preserved.
+ The polygon is subdivided if curve segments are included. That subdivision is the base
+ for the newly created points.
+ If the source is closed, the indirectly existing last edge may NOT have the
+ given length.
+ If the source is open, all edges will have the given length. You may use the last
+ point of the original when You want to add the last edge Yourself.
+
+ @param fLength
+ The length of the created edges. If less or equal zero, an empty polygon is returned.
+
+ @param fStart
+ The start distance for the first to be generated point. Use 0.0 to get the
+ original start point. Negative values are truncated to 0.0.
+
+ @param fEnd
+ The maximum distance for the last point. No more points behind this distance will be created.
+ Use 0.0 to proccess the whole polygon. Negative values are truncated to 0.0. It also
+ needs to be more or equal to fStart, else it is truncated to fStart.
+
+ @return
+ The newly created polygon
+ */
+ BASEGFX_DLLPUBLIC B2DPolygon createEdgesOfGivenLength(const B2DPolygon& rCandidate, double fLength, double fStart = 0.0, double fEnd = 0.0);
+
+ /** Create Waveline along given polygon
+ The implementation is based on createEdgesOfGivenLength and creates a curve
+ segment with the given dimensions for each created line segment. The polygon
+ is treated as if opened (closed state will be ignored) and only for whole
+ edges a curve segment will be created (no rest handling)
+
+ @param rCandidate
+ The polygon along which the waveline will be created
+
+ @param fWaveWidth
+ The length of a single waveline curve segment
+
+ @param fgWaveHeight
+ The height of the waveline (amplitude)
+ */
+ BASEGFX_DLLPUBLIC B2DPolygon createWaveline(const B2DPolygon& rCandidate, double fWaveWidth, double fWaveHeight);
+
+ /** snap some polygon coordinates to discrete coordinates
+
+ This method allows to snap some polygon points to discrete (integer) values
+ which equals e.g. a snap to discrete coordinates. It will snap points of
+ horizontal and vertical edges
+
+ @param rCandidate
+ The source polygon
+
+ @return
+ The modified version of the source polygon
+ */
+ BASEGFX_DLLPUBLIC B2DPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolygon& rCandidate);
+
+ } // end of namespace tools
+} // end of namespace basegfx
+
+#endif /* _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b2dpolygontriangulator.hxx b/include/basegfx/polygon/b2dpolygontriangulator.hxx
new file mode 100644
index 000000000000..5af34ae1ecd2
--- /dev/null
+++ b/include/basegfx/polygon/b2dpolygontriangulator.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 _BGFX_POLYGON_B2DPOLYGONTRIANGULATOR_HXX
+#define _BGFX_POLYGON_B2DPOLYGONTRIANGULATOR_HXX
+
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace triangulator
+ {
+ // triangulate given polygon
+ BASEGFX_DLLPUBLIC ::basegfx::B2DPolygon triangulate(const ::basegfx::B2DPolygon& rCandidate);
+
+ // triangulate given PolyPolygon
+ BASEGFX_DLLPUBLIC ::basegfx::B2DPolygon triangulate(const ::basegfx::B2DPolyPolygon& rCandidate);
+
+ } // end of namespace triangulator
+} // end of namespace basegfx
+
+#endif /* _BGFX_POLYGON_B2DPOLYGONTRIANGULATOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b2dpolypolygon.hxx b/include/basegfx/polygon/b2dpolypolygon.hxx
new file mode 100644
index 000000000000..cd22644ab8ce
--- /dev/null
+++ b/include/basegfx/polygon/b2dpolypolygon.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 _BGFX_POLYGON_B2DPOLYPOLYGON_HXX
+#define _BGFX_POLYGON_B2DPOLYPOLYGON_HXX
+
+#include <sal/types.h>
+#include <o3tl/cow_wrapper.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/basegfxdllapi.h>
+#include <vector>
+
+// predeclarations
+class ImplB2DPolyPolygon;
+
+namespace basegfx
+{
+ class B2DPolygon;
+ class B2DHomMatrix;
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ class BASEGFX_DLLPUBLIC B2DPolyPolygon
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImplB2DPolyPolygon > ImplType;
+
+ private:
+ ImplType mpPolyPolygon;
+
+ public:
+ B2DPolyPolygon();
+ B2DPolyPolygon(const B2DPolyPolygon& rPolyPolygon);
+ explicit B2DPolyPolygon(const B2DPolygon& rPolygon);
+ ~B2DPolyPolygon();
+
+ // assignment operator
+ B2DPolyPolygon& operator=(const B2DPolyPolygon& rPolyPolygon);
+
+ /// unshare this poly-polygon (and all included polygons) with all internally shared instances
+ void makeUnique();
+
+ // compare operators
+ bool operator==(const B2DPolyPolygon& rPolyPolygon) const;
+ bool operator!=(const B2DPolyPolygon& rPolyPolygon) const;
+
+ // polygon interface
+ sal_uInt32 count() const;
+
+ B2DPolygon getB2DPolygon(sal_uInt32 nIndex) const;
+ void setB2DPolygon(sal_uInt32 nIndex, const B2DPolygon& rPolygon);
+
+ // test for curve
+ bool areControlPointsUsed() const;
+
+ // insert/append single polygon
+ void insert(sal_uInt32 nIndex, const B2DPolygon& rPolygon, sal_uInt32 nCount = 1);
+ void append(const B2DPolygon& rPolygon, sal_uInt32 nCount = 1);
+
+ /** Default adaptive subdivision access
+
+ For details refer to B2DPolygon::getDefaultAdaptiveSubdivision()
+
+ @return
+ The default subdivision of this polygon
+ */
+ B2DPolyPolygon getDefaultAdaptiveSubdivision() const;
+
+ /** Get the B2DRange (Rectangle dimensions) of this B2DPolyPolygon
+
+ For details refer to B2DPolygon::getB2DRange()
+
+ @return
+ The outer range of the bezier curve/polygon
+ */
+ B2DRange getB2DRange() const;
+
+ // insert/append multiple polygons
+ void insert(sal_uInt32 nIndex, const B2DPolyPolygon& rPolyPolygon);
+ void append(const B2DPolyPolygon& rPolyPolygon);
+
+ // remove
+ void remove(sal_uInt32 nIndex, sal_uInt32 nCount = 1);
+
+ // reset to empty state
+ void clear();
+
+ // closed state
+ bool isClosed() const;
+ void setClosed(bool bNew);
+
+ // flip polygon direction
+ void flip();
+
+ // test if PolyPolygon has double points
+ bool hasDoublePoints() const;
+
+ // remove double points, at the begin/end and follow-ups, too
+ void removeDoublePoints();
+
+ // apply transformation given in matrix form to the polygon
+ void transform(const basegfx::B2DHomMatrix& rMatrix);
+
+ // polygon iterators (same iterator validity conditions as for vector)
+ const B2DPolygon* begin() const;
+ const B2DPolygon* end() const;
+ B2DPolygon* begin();
+ B2DPolygon* end();
+ };
+
+ // typedef for a vector of B2DPolyPolygons
+ typedef ::std::vector< B2DPolyPolygon > B2DPolyPolygonVector;
+
+} // end of namespace basegfx
+
+#endif /* _BGFX_POLYGON_B2DPOLYPOLYGON_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b2dpolypolygoncutter.hxx b/include/basegfx/polygon/b2dpolypolygoncutter.hxx
new file mode 100644
index 000000000000..31bd8b6279f9
--- /dev/null
+++ b/include/basegfx/polygon/b2dpolypolygoncutter.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 _BGFX_POLYGON_B2DPOLYPOLYGONCUTTER_HXX
+#define _BGFX_POLYGON_B2DPOLYPOLYGONCUTTER_HXX
+
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace tools
+ {
+ /** Solve all crossovers (aka self-intersections) in a polyPolygon.
+
+ This re-layouts all contained polygons so that the result
+ will contain only non-cutting polygons. For that reason,
+ points will be added at crossover and touch points and the
+ single Polygons may be re-combined. The orientations of
+ the contained polygons in not changed but used as
+ topological information. Self crossovers of the contained
+ sub-polygons are implicitely handled, but to not lose the
+ topological information, it may be necessary to remove
+ self-intersections of the contained sub-polygons in a
+ preparing step and to explicitly correct their
+ orientations.
+ */
+ BASEGFX_DLLPUBLIC B2DPolyPolygon solveCrossovers(const B2DPolyPolygon& rCandidate);
+
+ /** Solve all crossovers (aka self-intersections) in a Polygon
+
+ Same as above, but for single polygons. Result will be
+ free of self-intersections. When result contains multiple
+ polygons, it may be necessary to rearrange their
+ orientations since holes may have been created (use
+ correctOrientations eventually).
+ */
+ BASEGFX_DLLPUBLIC B2DPolyPolygon solveCrossovers(const B2DPolygon& rCandidate);
+
+ /** Strip neutral polygons from PolyPolygon.
+
+ Neutral polygons are ones who's orientation is neutral, so
+ normally they have no volume -> just closed paths. A
+ polygon with the same positive and negative oriented
+ volume is also neutral, so this may not be wanted. It is
+ safe to call with self-intersection-free polygons, though
+ (that's where it's mostly used).
+ */
+ BASEGFX_DLLPUBLIC B2DPolyPolygon stripNeutralPolygons(const B2DPolyPolygon& rCandidate);
+
+ /** Remove unnecessary/non-displayed polygons.
+
+ Works only correct with self-intersection-free
+ polygons. For each polygon, the depth for the PolyPolygon
+ is calculated. The orientation is used to identify holes.
+ Start value for holes is -1, for polygons it's zero. Ech
+ time a polygon is contained in another one, it's depth is
+ increased when inside a polygon, decreased when inside a
+ hole. The result is a depth which e.g. is -1 for holes
+ outside everything, 1 for a polygon covered by another
+ polygon and zero for e.g. holes in a polygon or polygons
+ outside everythig else. In the 2nd step, all polygons
+ with depth other than zero are removed. If bKeepAboveZero
+ is used, all polygons < 1 are removed. The bKeepAboveZero
+ mode is useful for clipping, e.g. just append one polygon
+ to another and use this mode -> only parts where two
+ polygons overlapped will be kept. In combination with
+ correct orientation of the input orientations and the
+ SolveCrossover calls this can be combined for logical
+ polygon operations or polygon clipping.
+ */
+ BASEGFX_DLLPUBLIC B2DPolyPolygon stripDispensablePolygons(const B2DPolyPolygon& rCandidate, bool bKeepAboveZero = false);
+
+ /** Emulate nonzero winding rule filling.
+
+ Geometrically convert PolyPolygons which are proposed to
+ use nonzero fill rule to a representation where evenodd
+ paint will give the same result. To do this all
+ intersections and self-intersections get solved (the
+ polygons will be rearranged if needed). Then all polygons
+ which are inside another one with the same orientation get
+ deleted
+ */
+ BASEGFX_DLLPUBLIC B2DPolyPolygon createNonzeroConform(const B2DPolyPolygon& rCandidate);
+
+ // For convenience: The four basic operations OR, XOR, AND and DIFF for
+ // two PolyPolygons. These are combinations of the above methods. To not be forced
+ // to do evtl. already done preparations twice, You have to do the operations Yourself.
+ //
+ // A source preparation consists of preparing it to be seen as XOR-Rule PolyPolygon,
+ // so it is freed of intersections, self-intersections and the orientations are corrected.
+ // Important is that it will define the same areas as before, but is intersection-free.
+ // As an example think about a single polygon looping in itself and having holes. To
+ // topologically correctly handle this, it is necessary to remove all intersections and
+ // to correct the orientations. The orientation of the isolated holes e.g. will be negative.
+ // Topologically it is necessary to prepare each polygon which is seen as entity. It is
+ // not sufficient just to concatenate them and prepare the result, this may be topologically
+ // different since the simple concatenation will be seen as XOR. To work correctly, You
+ // may need to OR those polygons.
+
+ /// prep for ops - solve self-intersections and intersections, remove neutral parts and check orientations.
+ BASEGFX_DLLPUBLIC B2DPolyPolygon prepareForPolygonOperation(const B2DPolygon& rCandidate);
+ /// prep for ops - solve self-intersections and intersections, remove neutral parts and check orientations.
+ BASEGFX_DLLPUBLIC B2DPolyPolygon prepareForPolygonOperation(const B2DPolyPolygon& rCandidate);
+
+ /// OR: Return all areas where CandidateA or CandidateB exist
+ BASEGFX_DLLPUBLIC B2DPolyPolygon solvePolygonOperationOr(const B2DPolyPolygon& rCandidateA, const B2DPolyPolygon& rCandidateB);
+
+ /// XOR: Return all areas where CandidateA or CandidateB exist, but not both
+ BASEGFX_DLLPUBLIC B2DPolyPolygon solvePolygonOperationXor(const B2DPolyPolygon& rCandidateA, const B2DPolyPolygon& rCandidateB);
+
+ /// AND: Return all areas where CandidateA and CandidateB exist
+ BASEGFX_DLLPUBLIC B2DPolyPolygon solvePolygonOperationAnd(const B2DPolyPolygon& rCandidateA, const B2DPolyPolygon& rCandidateB);
+
+ /// DIFF: Return all areas where CandidateA is not covered by CandidateB (cut B out of A)
+ BASEGFX_DLLPUBLIC B2DPolyPolygon solvePolygonOperationDiff(const B2DPolyPolygon& rCandidateA, const B2DPolyPolygon& rCandidateB);
+
+ /** merge all single PolyPolygons to a single, OR-ed PolyPolygon
+
+ @param rInput
+ The source PolyPolygons
+
+ @return A single PolyPolygon containing the Or-merged result
+ */
+ BASEGFX_DLLPUBLIC B2DPolyPolygon mergeToSinglePolyPolygon(const B2DPolyPolygonVector& rInput);
+
+ } // end of namespace tools
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+
+#endif /* _BGFX_POLYGON_B2DPOLYPOLYGONCUTTER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b2dpolypolygonfillrule.hxx b/include/basegfx/polygon/b2dpolypolygonfillrule.hxx
new file mode 100644
index 000000000000..390dd9bac9f0
--- /dev/null
+++ b/include/basegfx/polygon/b2dpolypolygonfillrule.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 _BGFX_POLYGON_B2DPOLYPOLYGONFILLRULE_HXX
+#define _BGFX_POLYGON_B2DPOLYPOLYGONFILLRULE_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ /** Fill rule to use for poly-polygon filling.
+
+ The fill rule determines which areas are inside, and which are
+ outside the poly-polygon.
+ */
+ enum FillRule
+ {
+ /** Areas, for which a scanline has crossed an odd number of
+ vertices, are regarded 'inside', the remainder 'outside'
+ of the poly-polygon.
+ */
+ FillRule_EVEN_ODD,
+
+ /** For each edge a scanline crosses, a current winding number
+ is updated. Downward edges count +1, upward edges count
+ -1. If the total accumulated winding number for one area
+ is not zero, this area is regarded 'inside', otherwise,
+ 'outside'.
+ */
+ FillRule_NONZERO_WINDING_NUMBER
+ };
+}
+
+#endif /* _BGFX_POLYGON_B2DPOLYPOLYGONFILLRULE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b2dpolypolygontools.hxx b/include/basegfx/polygon/b2dpolypolygontools.hxx
new file mode 100644
index 000000000000..29ae3e042133
--- /dev/null
+++ b/include/basegfx/polygon/b2dpolypolygontools.hxx
@@ -0,0 +1,236 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX
+#define _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX
+
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b3dpolypolygon.hxx>
+#include <vector>
+#include <basegfx/basegfxdllapi.h>
+
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ // predefinitions
+ class B2DPolyPolygon;
+ class B2DRange;
+
+ namespace tools
+ {
+ // B2DPolyPolygon tools
+
+ // Check and evtl. correct orientations of all contained Polygons so that
+ // the orientations of contained polygons will variate to express areas and
+ // holes
+ BASEGFX_DLLPUBLIC B2DPolyPolygon correctOrientations(const B2DPolyPolygon& rCandidate);
+
+ // make sure polygon with index 0L is not a hole. This may evtl. change the
+ // sequence of polygons, but allows to use polygon with index 0L to
+ // get the correct normal for the whole polyPolygon
+ BASEGFX_DLLPUBLIC B2DPolyPolygon correctOutmostPolygon(const B2DPolyPolygon& rCandidate);
+
+ // Subdivide all contained curves. Use distanceBound value if given.
+ BASEGFX_DLLPUBLIC B2DPolyPolygon adaptiveSubdivideByDistance(const B2DPolyPolygon& rCandidate, double fDistanceBound = 0.0);
+
+ // Subdivide all contained curves. Use distanceBound value if given. Else, a convenient one
+ // is created.
+ BASEGFX_DLLPUBLIC B2DPolyPolygon adaptiveSubdivideByAngle(const B2DPolyPolygon& rCandidate, double fAngleBound = 0.0);
+
+ // Subdivide all contained curves. Use nCount divisions if given. Else, a convenient one
+ // is created.
+ BASEGFX_DLLPUBLIC B2DPolyPolygon adaptiveSubdivideByCount(const B2DPolyPolygon& rCandidate, sal_uInt32 nCount = 0L);
+
+ // isInside test for B2dPoint. On border is not inside as long as not true is given
+ // in bWithBorder flag. It is assumed that the orientations of the given polygon are correct.
+ BASEGFX_DLLPUBLIC bool isInside(const B2DPolyPolygon& rCandidate, const B2DPoint& rPoint, bool bWithBorder = false);
+
+ /** Get the range of a polyPolygon
+
+ For detailed description look at getRange(const B2DPolygon&).
+ This method just expands by the range of every sub-Polygon.
+
+ @param rCandidate
+ The B2DPolyPolygon eventually containing bezier segments
+
+ @return
+ The outer range of the polygon
+ */
+ BASEGFX_DLLPUBLIC B2DRange getRange(const B2DPolyPolygon& rCandidate);
+
+ /** Apply given LineDashing to given polyPolygon
+
+ For a description see applyLineDashing in b2dpolygontoos.hxx
+ */
+ BASEGFX_DLLPUBLIC void applyLineDashing(
+ const B2DPolyPolygon& rCandidate,
+ const ::std::vector<double>& rDotDashArray,
+ B2DPolyPolygon* pLineTarget,
+ B2DPolyPolygon* pGapTarget = 0,
+ double fFullDashDotLen = 0.0);
+
+ // test if point is inside epsilon-range around the given PolyPolygon. Can be used
+ // for HitTesting. The epsilon-range is defined to be the tube around the PolyPolygon
+ // with distance fDistance and rounded edges (start and end point).
+ BASEGFX_DLLPUBLIC bool isInEpsilonRange(const B2DPolyPolygon& rCandidate, const B2DPoint& rTestPosition, double fDistance);
+
+ /** Read poly-polygon from SVG.
+
+ This function imports a poly-polygon from an SVG-D
+ attribute.
+
+ @param o_rPolyPoly
+ The output poly-polygon
+
+ @param rSvgDAttribute
+ A valid SVG-D attribute string
+
+ @param rWrongPositionAfterZ
+ Indicates wheter the generator interprets wrongly
+ the position in the path after Z or z elements
+ https://bugs.freedesktop.org/show_bug.cgi?id=47406
+
+ @return true, if the string was successfully parsed
+ */
+ BASEGFX_DLLPUBLIC bool importFromSvgD( B2DPolyPolygon& o_rPolyPoly,
+ const OUString& rSvgDAttribute, bool bWrongPositionAfterZ = false );
+
+ /** Read poly-polygon from SVG.
+
+ This function imports a poly-polygon from an SVG points
+ attribute (a plain list of coordinate pairs).
+
+ @param o_rPoly
+ The output polygon. Note that svg:points can only define a
+ single polygon
+
+ @param rSvgPointsAttribute
+ A valid SVG points attribute string
+
+ @return true, if the string was successfully parsed
+ */
+ BASEGFX_DLLPUBLIC bool importFromSvgPoints( B2DPolygon& o_rPoly,
+ const OUString& rSvgPointsAttribute );
+
+
+ // grow for polyPolygon. Move all geometry in each point in the direction of the normal in that point
+ // with the given amount. Value may be negative.
+ BASEGFX_DLLPUBLIC B2DPolyPolygon growInNormalDirection(const B2DPolyPolygon& rCandidate, double fValue);
+
+ // This method will correct a pair of polyPolygons where the goal is to keep same point count
+ // to allow direct point association and also to remove self-intersections produced by shrinks.
+ // This method will eventually change both polyPolygons to reach that goal because there are cases
+ // where it is necessary to add new cut points to the original
+ BASEGFX_DLLPUBLIC void correctGrowShrinkPolygonPair(B2DPolyPolygon& rOriginal, B2DPolyPolygon& rGrown);
+
+ // force all sub-polygons to a point count of nSegments
+ BASEGFX_DLLPUBLIC B2DPolyPolygon reSegmentPolyPolygon(const B2DPolyPolygon& rCandidate, sal_uInt32 nSegments);
+
+ // create polygon state at t from 0.0 to 1.0 between the two polygons. Both polygons must have the same
+ // organisation, e.g. same amount of polygons
+ BASEGFX_DLLPUBLIC B2DPolyPolygon interpolate(const B2DPolyPolygon& rOld1, const B2DPolyPolygon& rOld2, double t);
+
+ // create 3d PolyPolygon from given 2d PolyPolygon. The given fZCoordinate is used to expand the
+ // third coordinate.
+ BASEGFX_DLLPUBLIC B3DPolyPolygon createB3DPolyPolygonFromB2DPolyPolygon(const B2DPolyPolygon& rCandidate, double fZCoordinate = 0.0);
+
+ // create 2d PolyPolygon from given 3d PolyPolygon. All coordinates are transformed using the given
+ // matrix and the resulting x,y is used to form the new polygon.
+ BASEGFX_DLLPUBLIC B2DPolyPolygon createB2DPolyPolygonFromB3DPolyPolygon(const B3DPolyPolygon& rCandidate, const B3DHomMatrix& rMat);
+
+ // for each contained edge in each contained polygon calculate the smallest distance. Return the index to the smallest
+ // edge in rEdgeIndex and the index to the polygon in rPolygonIndex. The relative position on the edge is returned in rCut.
+ // If nothing was found (e.g. empty input plygon), DBL_MAX is returned.
+ BASEGFX_DLLPUBLIC double getSmallestDistancePointToPolyPolygon(const B2DPolyPolygon& rCandidate, const B2DPoint& rTestPoint, sal_uInt32& rPolygonIndex, sal_uInt32& rEdgeIndex, double& rCut);
+
+ // distort PolyPolygon. rOriginal describes the original range, where the given points describe the distorted
+ // corresponding points.
+ BASEGFX_DLLPUBLIC B2DPolyPolygon distort(const B2DPolyPolygon& rCandidate, const B2DRange& rOriginal, const B2DPoint& rTopLeft, const B2DPoint& rTopRight, const B2DPoint& rBottomLeft, const B2DPoint& rBottomRight);
+
+ // expand all segments (which are not yet) to curve segments. This is done with setting the control
+ // vectors on the 1/3 resp. 2/3 distances on each segment.
+ BASEGFX_DLLPUBLIC B2DPolyPolygon expandToCurve(const B2DPolyPolygon& rCandidate);
+
+ /** Predicate whether a given poly-polygon is a rectangle.
+
+ @param rPoly
+ PolyPolygon to check
+
+ @return true, if the poly-polygon describes a rectangle
+ (contains exactly one polygon, polygon is closed, and the
+ points are either cw or ccw enumerations of a rectangle's
+ vertices). Note that intermediate points and duplicate
+ points are ignored.
+ */
+ BASEGFX_DLLPUBLIC bool isRectangle( const B2DPolyPolygon& rPoly );
+
+ /** Export poly-polygon to SVG.
+
+ This function exports a poly-polygon into an SVG-D
+ statement. Currently, output of relative point sequences
+ is not yet supported (might cause slightly larger output)
+
+ @param rPolyPoly
+ The poly-polygon to export
+
+ @param bUseRelativeCoordinates
+ When true, all coordinate values are exported as relative
+ to the current position. This tends to save some space,
+ since fewer digits needs to be written.
+
+ @param bDetectQuadraticBeziers
+ When true, the export tries to detect cubic bezier
+ segments in the input polygon, which can be represented by
+ quadratic bezier segments. Note that the generated string
+ causes versions prior to OOo2.0 to crash.
+
+ @return the generated SVG-D statement (the XML d attribute
+ value alone, without any "<path ...>" or "d="...")
+ */
+ BASEGFX_DLLPUBLIC OUString exportToSvgD( const B2DPolyPolygon& rPolyPoly,
+ bool bUseRelativeCoordinates=true,
+ bool bDetectQuadraticBeziers=true );
+
+ // #i76891# Try to remove existing curve segments if they are simply edges
+ BASEGFX_DLLPUBLIC B2DPolyPolygon simplifyCurveSegments(const B2DPolyPolygon& rCandidate);
+
+ /** snap some polygon coordinates to discrete coordinates
+
+ This method allows to snap some polygon points to discrete (integer) values
+ which equals e.g. a snap to discrete coordinates. It will snap points of
+ horizontal and vertical edges
+
+ @param rCandidate
+ The source polygon
+
+ @return
+ The modified version of the source polygon
+ */
+ BASEGFX_DLLPUBLIC B2DPolyPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolyPolygon& rCandidate);
+
+ } // end of namespace tools
+} // end of namespace basegfx
+
+#endif /* _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b2dtrapezoid.hxx b/include/basegfx/polygon/b2dtrapezoid.hxx
new file mode 100644
index 000000000000..43ee9fb37f6c
--- /dev/null
+++ b/include/basegfx/polygon/b2dtrapezoid.hxx
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_POLYGON_B2DTRAPEZOID_HXX
+#define _BGFX_POLYGON_B2DTRAPEZOID_HXX
+
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <vector>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ // class to hold a single trapezoid
+ class BASEGFX_DLLPUBLIC B2DTrapezoid
+ {
+ private:
+ // Geometry data. YValues are down-oriented, this means bottom should
+ // be bigger than top to be below it. The constructor implementation
+ // guarantees:
+ //
+ // - mfBottomY >= mfTopY
+ // - mfTopXRight >= mfTopXLeft
+ // - mfBottomXRight >= mfBottomXLeft
+ double mfTopXLeft;
+ double mfTopXRight;
+ double mfTopY;
+ double mfBottomXLeft;
+ double mfBottomXRight;
+ double mfBottomY;
+
+ public:
+ // constructor
+ B2DTrapezoid(
+ const double& rfTopXLeft,
+ const double& rfTopXRight,
+ const double& rfTopY,
+ const double& rfBottomXLeft,
+ const double& rfBottomXRight,
+ const double& rfBottomY);
+
+ // data read access
+ const double& getTopXLeft() const { return mfTopXLeft; }
+ const double& getTopXRight() const { return mfTopXRight; }
+ const double& getTopY() const { return mfTopY; }
+ const double& getBottomXLeft() const { return mfBottomXLeft; }
+ const double& getBottomXRight() const { return mfBottomXRight; }
+ const double& getBottomY() const { return mfBottomY; }
+
+ // convenience method to get content as Polygon
+ B2DPolygon getB2DPolygon() const;
+ };
+
+ typedef ::std::vector< B2DTrapezoid > B2DTrapezoidVector;
+
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace tools
+ {
+ // convert SourcePolyPolygon to trapezoids. The trapezoids will be appended to
+ // ro_Result. ro_Result will not be cleared. If SourcePolyPolygon contains curves,
+ // it's default AdaptiveSubdivision will be used.
+ // CAUTION: Trapezoids are oreintation-dependent in the sense that the upper and lower
+ // lines have to be parallel to the X-Axis, thus this subdivision is NOT simply usable
+ // for primitive decompositions. To use it, the shear and rotate parts of the
+ // involved transformations HAVE to be taken into account.
+ BASEGFX_DLLPUBLIC void trapezoidSubdivide(
+ B2DTrapezoidVector& ro_Result,
+ const B2DPolyPolygon& rSourcePolyPolygon);
+
+ // directly create trapezoids from given edge. Depending on the given geometry,
+ // none up to three trapezoids will be created
+ BASEGFX_DLLPUBLIC void createLineTrapezoidFromEdge(
+ B2DTrapezoidVector& ro_Result,
+ const B2DPoint& rPointA,
+ const B2DPoint& rPointB,
+ double fLineWidth = 1.0);
+
+ // create trapezoids for all edges of the given polygon. The closed state of
+ // the polygon is taken into account. If curves are contaned, the default
+ // AdaptiveSubdivision will be used.
+ BASEGFX_DLLPUBLIC void createLineTrapezoidFromB2DPolygon(
+ B2DTrapezoidVector& ro_Result,
+ const B2DPolygon& rPolygon,
+ double fLineWidth = 1.0);
+
+ // create trapezoids for all edges of the given polyPolygon. The closed state of
+ // the PolyPolygon is taken into account. If curves are contaned, the default
+ // AdaptiveSubdivision will be used.
+ BASEGFX_DLLPUBLIC void createLineTrapezoidFromB2DPolyPolygon(
+ B2DTrapezoidVector& ro_Result,
+ const B2DPolyPolygon& rPolyPolygon,
+ double fLineWidth = 1.0);
+
+ } // end of namespace tools
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif /* _BGFX_POLYGON_B2DTRAPEZOID_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b3dpolygon.hxx b/include/basegfx/polygon/b3dpolygon.hxx
new file mode 100644
index 000000000000..7199eea9684c
--- /dev/null
+++ b/include/basegfx/polygon/b3dpolygon.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 _BGFX_POLYGON_B3DPOLYGON_HXX
+#define _BGFX_POLYGON_B3DPOLYGON_HXX
+
+#include <sal/types.h>
+#include <o3tl/cow_wrapper.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+class ImplB3DPolygon;
+
+namespace basegfx
+{
+ class B3DPolygon;
+ class B3DPoint;
+ class B3DHomMatrix;
+ class B3DVector;
+ class B2DPoint;
+ class B2DHomMatrix;
+ class BColor;
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ class BASEGFX_DLLPUBLIC B3DPolygon
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImplB3DPolygon > ImplType;
+
+ private:
+ // internal data.
+ ImplType mpPolygon;
+
+ public:
+ B3DPolygon();
+ B3DPolygon(const B3DPolygon& rPolygon);
+ ~B3DPolygon();
+
+ // assignment operator
+ B3DPolygon& operator=(const B3DPolygon& rPolygon);
+
+ // compare operators
+ bool operator==(const B3DPolygon& rPolygon) const;
+ bool operator!=(const B3DPolygon& rPolygon) const;
+
+ // member count
+ sal_uInt32 count() const;
+
+ // Coordinate interface
+ B3DPoint getB3DPoint(sal_uInt32 nIndex) const;
+ void setB3DPoint(sal_uInt32 nIndex, const B3DPoint& rValue);
+
+ // Coordinate append
+ void append(const B3DPoint& rPoint, sal_uInt32 nCount = 1);
+
+ // BColor interface
+ BColor getBColor(sal_uInt32 nIndex) const;
+ void setBColor(sal_uInt32 nIndex, const BColor& rValue);
+ bool areBColorsUsed() const;
+ void clearBColors();
+
+ // Normals interface
+ B3DVector getNormal() const; // plane normal
+ B3DVector getNormal(sal_uInt32 nIndex) const; // normal in each point
+ void setNormal(sal_uInt32 nIndex, const B3DVector& rValue);
+ void transformNormals(const B3DHomMatrix& rMatrix);
+ bool areNormalsUsed() const;
+ void clearNormals();
+
+ // TextureCoordinate interface
+ B2DPoint getTextureCoordinate(sal_uInt32 nIndex) const;
+ void setTextureCoordinate(sal_uInt32 nIndex, const B2DPoint& rValue);
+ void transformTextureCoordiantes(const B2DHomMatrix& rMatrix);
+ bool areTextureCoordinatesUsed() const;
+ void clearTextureCoordinates();
+
+ // append other 2D polygons
+ void append(const B3DPolygon& rPoly, sal_uInt32 nIndex = 0, sal_uInt32 nCount = 0);
+
+ // remove
+ void remove(sal_uInt32 nIndex, sal_uInt32 nCount = 1);
+
+ // clear all points
+ void clear();
+
+ // closed state
+ bool isClosed() const;
+ void setClosed(bool bNew);
+
+ // flip polygon direction
+ void flip();
+
+ // test if Polygon has double points
+ bool hasDoublePoints() const;
+
+ // remove double points, at the begin/end and follow-ups, too
+ void removeDoublePoints();
+
+ // apply transformation given in matrix form to the polygon
+ void transform(const B3DHomMatrix& rMatrix);
+ };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+
+#endif /* _BGFX_POLYGON_B3DPOLYGON_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b3dpolygontools.hxx b/include/basegfx/polygon/b3dpolygontools.hxx
new file mode 100644
index 000000000000..9ed32b42fb90
--- /dev/null
+++ b/include/basegfx/polygon/b3dpolygontools.hxx
@@ -0,0 +1,135 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_POLYGON_B3DPOLYGONTOOLS_HXX
+#define _BGFX_POLYGON_B3DPOLYGONTOOLS_HXX
+
+#include <basegfx/point/b3dpoint.hxx>
+#include <basegfx/vector/b3dvector.hxx>
+#include <basegfx/polygon/b3dpolypolygon.hxx>
+#include <basegfx/vector/b2enums.hxx>
+#include <vector>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ // predefinitions
+ class B3DPolygon;
+ class B3DRange;
+
+ namespace tools
+ {
+ // B3DPolygon tools
+
+ /** Check if given polygon is closed. This is kind of a
+ 'classic' method to support old polygon definitions.
+ Those old polygon definitions define the closed state
+ of the polygon using identical start and endpoints. This
+ method corrects this (removes double start/end points)
+ and sets the Closed()-state of the polygon correctly.
+ */
+ BASEGFX_DLLPUBLIC void checkClosed(B3DPolygon& rCandidate);
+
+ // Get successor and predecessor indices. Returning the same index means there
+ // is none. Same for successor.
+ BASEGFX_DLLPUBLIC sal_uInt32 getIndexOfSuccessor(sal_uInt32 nIndex, const B3DPolygon& rCandidate);
+
+ // get size of polygon. Control vectors are included in that ranges.
+ BASEGFX_DLLPUBLIC B3DRange getRange(const B3DPolygon& rCandidate);
+
+ // get normal vector of polygon
+ BASEGFX_DLLPUBLIC B3DVector getNormal(const B3DPolygon& rCandidate);
+
+ // get area of polygon
+ BASEGFX_DLLPUBLIC double getArea(const ::basegfx::B3DPolygon& rCandidate);
+
+ // get length of polygon
+ BASEGFX_DLLPUBLIC double getLength(const B3DPolygon& rCandidate);
+
+ /** Apply given LineDashing to given polygon
+
+ For a description see applyLineDashing in b2dpolygontoos.hxx
+ */
+ BASEGFX_DLLPUBLIC void applyLineDashing(
+ const B3DPolygon& rCandidate,
+ const ::std::vector<double>& rDotDashArray,
+ B3DPolyPolygon* pLineTarget,
+ B3DPolyPolygon* pGapTarget = 0,
+ double fFullDashDotLen = 0.0);
+
+ /** Create/replace normals for given 3d geometry with default normals from given center to outside.
+ rCandidate: the 3d geometry to change
+ rCenter: the center of the 3d geometry
+ */
+ BASEGFX_DLLPUBLIC B3DPolygon applyDefaultNormalsSphere( const B3DPolygon& rCandidate, const B3DPoint& rCenter);
+
+ /** invert normals for given 3d geometry.
+ */
+ BASEGFX_DLLPUBLIC B3DPolygon invertNormals( const B3DPolygon& rCandidate);
+
+ /** Create/replace texture coordinates for given 3d geometry with parallel projected one
+ rRange: the full range of the 3d geometry
+ If bChangeX, x texture coordinate will be recalculated.
+ If bChangeY, y texture coordinate will be recalculated.
+ */
+ BASEGFX_DLLPUBLIC B3DPolygon applyDefaultTextureCoordinatesParallel( const B3DPolygon& rCandidate, const B3DRange& rRange, bool bChangeX = true, bool bChangeY = true);
+
+ /** Create/replace texture coordinates for given 3d geometry with spherical one
+ rCenter: the centre of the used 3d geometry
+ If bChangeX, x texture coordinate will be recalculated.
+ If bChangeY, y texture coordinate will be recalculated.
+ */
+ BASEGFX_DLLPUBLIC B3DPolygon applyDefaultTextureCoordinatesSphere( const B3DPolygon& rCandidate, const B3DPoint& rCenter, bool bChangeX = true, bool bChangeY = true);
+
+ // isInside tests for B3DPoint. On border is not inside as long as not true is given in bWithBorder flag.
+ BASEGFX_DLLPUBLIC bool isInside(const B3DPolygon& rCandidate, const B3DPoint& rPoint, bool bWithBorder = false);
+
+ // calculates if given point is on given line, taking care of the numerical epsilon
+ BASEGFX_DLLPUBLIC bool isPointOnLine(const B3DPoint& rStart, const B3DPoint& rEnd, const B3DPoint& rCandidate, bool bWithPoints = false);
+
+ // calculates if given point is on given polygon, taking care of the numerical epsilon. Uses
+ // isPointOnLine internally
+ BASEGFX_DLLPUBLIC bool isPointOnPolygon(const B3DPolygon& rCandidate, const B3DPoint& rPoint, bool bWithPoints = true);
+
+ // helper to get a fCut position between a plane (given with normal and a point)
+ // and a line given by start and end point
+ BASEGFX_DLLPUBLIC bool getCutBetweenLineAndPlane(const B3DVector& rPlaneNormal, const B3DPoint& rPlanePoint, const B3DPoint& rEdgeStart, const B3DPoint& rEdgeEnd, double& fCut);
+
+ /** snap some polygon coordinates to discrete coordinates
+
+ This method allows to snap some polygon points to discrete (integer) values
+ which equals e.g. a snap to discrete coordinates. It will snap points of
+ horizontal and vertical edges
+
+ @param rCandidate
+ The source polygon
+
+ @return
+ The modified version of the source polygon
+ */
+ BASEGFX_DLLPUBLIC B3DPolygon snapPointsOfHorizontalOrVerticalEdges(const B3DPolygon& rCandidate);
+
+ } // end of namespace tools
+} // end of namespace basegfx
+
+#endif /* _BGFX_POLYGON_B3DPOLYGONTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b3dpolypolygon.hxx b/include/basegfx/polygon/b3dpolypolygon.hxx
new file mode 100644
index 000000000000..d67da6ad690b
--- /dev/null
+++ b/include/basegfx/polygon/b3dpolypolygon.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 _BGFX_POLYGON_B3DPOLYPOLYGON_HXX
+#define _BGFX_POLYGON_B3DPOLYPOLYGON_HXX
+
+#include <sal/types.h>
+#include <o3tl/cow_wrapper.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+// predeclarations
+class ImplB3DPolyPolygon;
+
+namespace basegfx
+{
+ class B3DPolygon;
+ class B3DHomMatrix;
+ class B2DHomMatrix;
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ class BASEGFX_DLLPUBLIC B3DPolyPolygon
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImplB3DPolyPolygon > ImplType;
+
+ private:
+ ImplType mpPolyPolygon;
+
+ public:
+ B3DPolyPolygon();
+ B3DPolyPolygon(const B3DPolyPolygon& rPolyPolygon);
+ explicit B3DPolyPolygon(const B3DPolygon& rPolygon);
+ ~B3DPolyPolygon();
+
+ // assignment operator
+ B3DPolyPolygon& operator=(const B3DPolyPolygon& rPolyPolygon);
+
+ // compare operators
+ bool operator==(const B3DPolyPolygon& rPolyPolygon) const;
+ bool operator!=(const B3DPolyPolygon& rPolyPolygon) const;
+
+ // polygon interface
+ sal_uInt32 count() const;
+
+ // B3DPolygon interface
+ B3DPolygon getB3DPolygon(sal_uInt32 nIndex) const;
+ void setB3DPolygon(sal_uInt32 nIndex, const B3DPolygon& rPolygon);
+
+ // BColor interface
+ bool areBColorsUsed() const;
+ void clearBColors();
+
+ // Normals interface
+ void transformNormals(const B3DHomMatrix& rMatrix);
+ bool areNormalsUsed() const;
+ void clearNormals();
+
+ // TextureCoordinate interface
+ void transformTextureCoordiantes(const B2DHomMatrix& rMatrix);
+ bool areTextureCoordinatesUsed() const;
+ void clearTextureCoordinates();
+
+ // append single polygon
+ void append(const B3DPolygon& rPolygon, sal_uInt32 nCount = 1);
+
+ // append multiple polygons
+ void append(const B3DPolyPolygon& rPolyPolygon);
+
+ // remove
+ void remove(sal_uInt32 nIndex, sal_uInt32 nCount = 1);
+
+ // reset to empty state
+ void clear();
+
+ // flip polygon direction
+ void flip();
+
+ // test if PolyPolygon has double points
+ bool hasDoublePoints() const;
+
+ // remove double points, at the begin/end and follow-ups, too
+ void removeDoublePoints();
+
+ // apply transformation given in matrix form to the polygon
+ void transform(const basegfx::B3DHomMatrix& rMatrix);
+
+ // polygon iterators (same iterator validity conditions as for vector)
+ const B3DPolygon* begin() const;
+ const B3DPolygon* end() const;
+ B3DPolygon* begin();
+ B3DPolygon* end();
+ };
+} // end of namespace basegfx
+
+#endif /* _BGFX_POLYGON_B3DPOLYPOLYGON_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/polygon/b3dpolypolygontools.hxx b/include/basegfx/polygon/b3dpolypolygontools.hxx
new file mode 100644
index 000000000000..a50167f9b4de
--- /dev/null
+++ b/include/basegfx/polygon/b3dpolypolygontools.hxx
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_POLYPOLYGON_B3DPOLYGONTOOLS_HXX
+#define _BGFX_POLYPOLYGON_B3DPOLYGONTOOLS_HXX
+
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <vector>
+#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/point/b3dpoint.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ // predefinitions
+ class B3DPolyPolygon;
+ class B3DRange;
+
+ namespace tools
+ {
+ // B3DPolyPolygon tools
+
+ // get size of PolyPolygon. Control vectors are included in that ranges.
+ BASEGFX_DLLPUBLIC B3DRange getRange(const B3DPolyPolygon& rCandidate);
+
+ /** Create a unit 3D line polyPolygon which defines a cube.
+ */
+ BASEGFX_DLLPUBLIC B3DPolyPolygon createUnitCubePolyPolygon();
+
+ /** Create a unit 3D fill polyPolygon which defines a cube.
+ */
+ BASEGFX_DLLPUBLIC B3DPolyPolygon createUnitCubeFillPolyPolygon();
+
+ /** Create a 3D line polyPolygon from a B3DRange which defines a cube.
+ */
+ BASEGFX_DLLPUBLIC B3DPolyPolygon createCubePolyPolygonFromB3DRange( const B3DRange& rRange);
+
+ /** Create a 3D fill polyPolygon from a B3DRange which defines a cube.
+ */
+ BASEGFX_DLLPUBLIC B3DPolyPolygon createCubeFillPolyPolygonFromB3DRange( const B3DRange& rRange);
+
+ /** Create a unit 3D line polyPolygon which defines a sphere with the given count of hor and ver segments.
+ Result will be centered at (0.0, 0.0, 0.0) and sized [-1.0 .. 1.0] in all dimensions.
+ If nHorSeg == 0 and/or nVerSeg == 0, a default will be calculated to have a step at least each 15 degrees.
+ With VerStart, VerStop and hor range in cartesian may be specified to create a partial sphere only.
+ */
+ BASEGFX_DLLPUBLIC B3DPolyPolygon createUnitSpherePolyPolygon(
+ sal_uInt32 nHorSeg = 0L, sal_uInt32 nVerSeg = 0L,
+ double fVerStart = F_PI2, double fVerStop = -F_PI2,
+ double fHorStart = 0.0, double fHorStop = F_2PI);
+
+ /** Create a 3D line polyPolygon from a B3DRange which defines a sphere with the given count of hor and ver segments.
+ If nHorSeg == 0 and/or nVerSeg == 0, a default will be calculated to have a step at least each 15 degrees.
+ With VerStart, VerStop and hor range in cartesian may be specified to create a partial sphere only.
+ */
+ BASEGFX_DLLPUBLIC B3DPolyPolygon createSpherePolyPolygonFromB3DRange(
+ const B3DRange& rRange,
+ sal_uInt32 nHorSeg = 0L, sal_uInt32 nVerSeg = 0L,
+ double fVerStart = F_PI2, double fVerStop = -F_PI2,
+ double fHorStart = 0.0, double fHorStop = F_2PI);
+
+ /** same as createUnitSpherePolyPolygon, but creates filled polygons (closed and oriented)
+ There is one extra, the bool bNormals defines if normals will be set, default is false
+ */
+ BASEGFX_DLLPUBLIC B3DPolyPolygon createUnitSphereFillPolyPolygon(
+ sal_uInt32 nHorSeg = 0L, sal_uInt32 nVerSeg = 0L,
+ bool bNormals = false,
+ double fVerStart = F_PI2, double fVerStop = -F_PI2,
+ double fHorStart = 0.0, double fHorStop = F_2PI);
+
+ /** same as createSpherePolyPolygonFromB3DRange, but creates filled polygons (closed and oriented)
+ There is one extra, the bool bNormals defines if normals will be set, default is false
+ */
+ BASEGFX_DLLPUBLIC B3DPolyPolygon createSphereFillPolyPolygonFromB3DRange(
+ const B3DRange& rRange,
+ sal_uInt32 nHorSeg = 0L, sal_uInt32 nVerSeg = 0L,
+ bool bNormals = false,
+ double fVerStart = F_PI2, double fVerStop = -F_PI2,
+ double fHorStart = 0.0, double fHorStop = F_2PI);
+
+ /** Create/replace normals for given 3d geometry with default normals from given center to outside.
+ rCandidate: the 3d geometry to change
+ rCenter: the center of the 3d geometry
+ */
+ BASEGFX_DLLPUBLIC B3DPolyPolygon applyDefaultNormalsSphere( const B3DPolyPolygon& rCandidate, const B3DPoint& rCenter);
+
+ /** invert normals for given 3d geometry.
+ */
+ BASEGFX_DLLPUBLIC B3DPolyPolygon invertNormals( const B3DPolyPolygon& rCandidate);
+
+ /** Create/replace texture coordinates for given 3d geometry with parallel projected one
+ rRange: the full range of the 3d geometry
+ If bChangeX, x texture coordinate will be recalculated.
+ If bChangeY, y texture coordinate will be recalculated.
+ */
+ BASEGFX_DLLPUBLIC B3DPolyPolygon applyDefaultTextureCoordinatesParallel( const B3DPolyPolygon& rCandidate, const B3DRange& rRange, bool bChangeX = true, bool bChangeY = true);
+
+ /** Create/replace texture coordinates for given 3d geometry with spherical one
+ rCenter: the centre of the used 3d geometry
+ If bChangeX, x texture coordinate will be recalculated.
+ If bChangeY, y texture coordinate will be recalculated.
+ */
+ BASEGFX_DLLPUBLIC B3DPolyPolygon applyDefaultTextureCoordinatesSphere( const B3DPolyPolygon& rCandidate, const B3DPoint& rCenter, bool bChangeX = true, bool bChangeY = true);
+
+ // isInside test for B3DPoint. On border is not inside as long as not true is given
+ // in bWithBorder flag. It is assumed that the orientations of the given polygon are correct.
+ BASEGFX_DLLPUBLIC bool isInside(const B3DPolyPolygon& rCandidate, const B3DPoint& rPoint, bool bWithBorder = false);
+
+ } // end of namespace tools
+} // end of namespace basegfx
+
+#endif /* _BGFX_POLYPOLYGON_B3DPOLYGONTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b1drange.hxx b/include/basegfx/range/b1drange.hxx
new file mode 100644
index 000000000000..ffe704a1b845
--- /dev/null
+++ b/include/basegfx/range/b1drange.hxx
@@ -0,0 +1,174 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_RANGE_B1DRANGE_HXX
+#define _BGFX_RANGE_B1DRANGE_HXX
+
+#include <basegfx/range/basicrange.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+
+namespace basegfx
+{
+ class B1IRange;
+
+ /** A one-dimensional interval over doubles
+
+ This is a set of real numbers, bounded by a lower and an upper
+ value. All inbetween values are included in the set (see also
+ http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
+
+ The set is closed, i.e. the upper and the lower bound are
+ included (if you're used to the notation - we're talking about
+ [a,b] here, compared to half-open [a,b) or open intervals
+ (a,b)).
+
+ That means, isInside(val) will return true also for values of
+ val=a or val=b.
+ */
+ class B1DRange
+ {
+ ::basegfx::BasicRange< double, DoubleTraits > maRange;
+
+ public:
+ B1DRange() {}
+
+ /// Create degenerate interval consisting of a single double number
+ explicit B1DRange(double fStartValue)
+ : maRange(fStartValue)
+ {
+ }
+
+ /// Create proper interval between the two given double values
+ B1DRange(double fStartValue1, double fStartValue2)
+ : maRange(fStartValue1)
+ {
+ expand(fStartValue2);
+ }
+
+ /** Check if the interval set is empty
+
+ @return false, if no value is in this set - having a
+ single value included will already return true.
+ */
+ bool isEmpty() const
+ {
+ return maRange.isEmpty();
+ }
+
+ /// reset the object to empty state again, clearing all values
+ void reset()
+ {
+ maRange.reset();
+ }
+
+ bool operator==( const B1DRange& rRange ) const
+ {
+ return (maRange == rRange.maRange);
+ }
+
+ bool operator!=( const B1DRange& rRange ) const
+ {
+ return (maRange != rRange.maRange);
+ }
+
+ bool equal(const B1DRange& rRange) const
+ {
+ return (maRange.equal(rRange.maRange));
+ }
+
+ /// get lower bound of the set. returns arbitrary values for empty sets.
+ double getMinimum() const
+ {
+ return maRange.getMinimum();
+ }
+
+ /// get upper bound of the set. returns arbitrary values for empty sets.
+ double getMaximum() const
+ {
+ return maRange.getMaximum();
+ }
+
+ /// return difference between upper and lower value. returns 0 for empty sets.
+ double getRange() const
+ {
+ return maRange.getRange();
+ }
+
+ /// return middle of upper and lower value. returns 0 for empty sets.
+ double getCenter() const
+ {
+ return maRange.getCenter();
+ }
+
+ /// yields true if value is contained in set
+ bool isInside(double fValue) const
+ {
+ return maRange.isInside(fValue);
+ }
+
+ /// yields true if rRange is inside, or equal to set
+ bool isInside(const B1DRange& rRange) const
+ {
+ return maRange.isInside(rRange.maRange);
+ }
+
+ /// yields true if rRange at least partly inside set
+ bool overlaps(const B1DRange& rRange) const
+ {
+ return maRange.overlaps(rRange.maRange);
+ }
+
+ /// yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal
+ bool overlapsMore(const B1DRange& rRange) const
+ {
+ return maRange.overlapsMore(rRange.maRange);
+ }
+
+ /// add fValue to the set, expanding as necessary
+ void expand(double fValue)
+ {
+ maRange.expand(fValue);
+ }
+
+ /// add rRange to the set, expanding as necessary
+ void expand(const B1DRange& rRange)
+ {
+ maRange.expand(rRange.maRange);
+ }
+
+ /// calc set intersection
+ void intersect(const B1DRange& rRange)
+ {
+ maRange.intersect(rRange.maRange);
+ }
+
+ /// grow set by fValue on both sides
+ void grow(double fValue)
+ {
+ maRange.grow(fValue);
+ }
+ };
+
+} // end of namespace basegfx
+
+
+#endif /* _BGFX_RANGE_B1DRANGE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b1ibox.hxx b/include/basegfx/range/b1ibox.hxx
new file mode 100644
index 000000000000..7c81e37c1288
--- /dev/null
+++ b/include/basegfx/range/b1ibox.hxx
@@ -0,0 +1,164 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_RANGE_B1IBOX_HXX
+#define _BGFX_RANGE_B1IBOX_HXX
+
+#include <basegfx/range/basicbox.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+
+namespace basegfx
+{
+ /** A one-dimensional interval over integers
+
+ This is most easily depicted as a set of integers, bounded by
+ a lower and an upper value - but excluding the upper
+ value. All inbetween values are included in the set (see also
+ http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
+
+ The set is half-open, i.e. the lower bound is included, the
+ upper bound not (if you're used to the notation - we're
+ talking about [a,b) here, compared to closed [a,b] or fully
+ open intervals (a,b)).
+
+ If you don't need a half-open interval, check B1IRange.
+
+ That means, isInside(val) will return true also for values of
+ val=a, but not for val=b.
+
+ @see B1IRange
+ */
+ class B1IBox
+ {
+ ::basegfx::BasicBox maRange;
+
+ public:
+ B1IBox() {}
+
+ /// Create degenerate interval that's still empty
+ explicit B1IBox(sal_Int32 nStartValue)
+ : maRange(nStartValue)
+ {
+ }
+
+ /// Create proper interval between the two given values
+ B1IBox(sal_Int32 nStartValue1, sal_Int32 nStartValue2)
+ : maRange(nStartValue1)
+ {
+ expand(nStartValue2);
+ }
+
+ /** Check if the interval set is empty
+
+ @return false, if no value is in this set - having a
+ single value included will still return false.
+ */
+ bool isEmpty() const
+ {
+ return maRange.isEmpty();
+ }
+
+ /// reset the object to empty state again, clearing all values
+ void reset()
+ {
+ maRange.reset();
+ }
+
+ bool operator==( const B1IBox& rBox ) const
+ {
+ return (maRange == rBox.maRange);
+ }
+
+ bool operator!=( const B1IBox& rBox ) const
+ {
+ return (maRange != rBox.maRange);
+ }
+
+ /// get lower bound of the set. returns arbitrary values for empty sets.
+ sal_Int32 getMinimum() const
+ {
+ return maRange.getMinimum();
+ }
+
+ /// get upper bound of the set. returns arbitrary values for empty sets.
+ sal_Int32 getMaximum() const
+ {
+ return maRange.getMaximum();
+ }
+
+ /// return difference between upper and lower value. returns 0 for empty sets.
+ Int32Traits::DifferenceType getRange() const
+ {
+ return maRange.getRange();
+ }
+
+ /// return middle of upper and lower value. returns 0 for empty sets.
+ double getCenter() const
+ {
+ return maRange.getCenter();
+ }
+
+ /// yields true if value is contained in set
+ bool isInside(sal_Int32 nValue) const
+ {
+ return maRange.isInside(nValue);
+ }
+
+ /// yields true if rRange is inside, or equal to set
+ bool isInside(const B1IBox& rBox) const
+ {
+ return maRange.isInside(rBox.maRange);
+ }
+
+ /// yields true if rRange at least partly inside set
+ bool overlaps(const B1IBox& rBox) const
+ {
+ return maRange.overlaps(rBox.maRange);
+ }
+
+ /// add nValue to the set, expanding as necessary
+ void expand(sal_Int32 nValue)
+ {
+ maRange.expand(nValue);
+ }
+
+ /// add rBox to the set, expanding as necessary
+ void expand(const B1IBox& rBox)
+ {
+ maRange.expand(rBox.maRange);
+ }
+
+ /// calc set intersection
+ void intersect(const B1IBox& rBox)
+ {
+ maRange.intersect(rBox.maRange);
+ }
+
+ /// grow set by nValue on both sides
+ void grow(sal_Int32 nValue)
+ {
+ maRange.grow(nValue);
+ }
+ };
+} // end of namespace basegfx
+
+#endif /* _BGFX_RANGE_B1IBOX_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b1irange.hxx b/include/basegfx/range/b1irange.hxx
new file mode 100644
index 000000000000..0ba5878fb0c8
--- /dev/null
+++ b/include/basegfx/range/b1irange.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 _BGFX_RANGE_B1IRANGE_HXX
+#define _BGFX_RANGE_B1IRANGE_HXX
+
+#include <basegfx/range/basicrange.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+
+namespace basegfx
+{
+ /** A one-dimensional interval over integers
+
+ This is a set of real numbers, bounded by a lower and an upper
+ value. All inbetween values are included in the set (see also
+ http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
+
+ Probably you rather want B1IBox for integers.
+
+ The set is closed, i.e. the upper and the lower bound are
+ included (if you're used to the notation - we're talking about
+ [a,b] here, compared to half-open [a,b) or open intervals
+ (a,b)).
+
+ That means, isInside(val) will return true also for values of
+ val=a or val=b.
+
+ @see B1IBox
+ */
+ class B1IRange
+ {
+ ::basegfx::BasicRange< sal_Int32, Int32Traits > maRange;
+
+ public:
+ B1IRange() {}
+
+ /// Create degenerate interval consisting of a single double number
+ explicit B1IRange(sal_Int32 nStartValue)
+ : maRange(nStartValue)
+ {
+ }
+
+ /// Create proper interval between the two given values
+ B1IRange(sal_Int32 nStartValue1, sal_Int32 nStartValue2)
+ : maRange(nStartValue1)
+ {
+ expand(nStartValue2);
+ }
+
+ /** Check if the interval set is empty
+
+ @return false, if no value is in this set - having a
+ single value included will already return true.
+ */
+ bool isEmpty() const
+ {
+ return maRange.isEmpty();
+ }
+
+ /// reset the object to empty state again, clearing all values
+ void reset()
+ {
+ maRange.reset();
+ }
+
+ bool operator==( const B1IRange& rRange ) const
+ {
+ return (maRange == rRange.maRange);
+ }
+
+ bool operator!=( const B1IRange& rRange ) const
+ {
+ return (maRange != rRange.maRange);
+ }
+
+ /// get lower bound of the set. returns arbitrary values for empty sets.
+ sal_Int32 getMinimum() const
+ {
+ return maRange.getMinimum();
+ }
+
+ /// get upper bound of the set. returns arbitrary values for empty sets.
+ sal_Int32 getMaximum() const
+ {
+ return maRange.getMaximum();
+ }
+
+ /// return difference between upper and lower value. returns 0 for empty sets.
+ Int32Traits::DifferenceType getRange() const
+ {
+ return maRange.getRange();
+ }
+
+ /// return middle of upper and lower value. returns 0 for empty sets.
+ double getCenter() const
+ {
+ return maRange.getCenter();
+ }
+
+ /// yields true if value is contained in set
+ bool isInside(sal_Int32 nValue) const
+ {
+ return maRange.isInside(nValue);
+ }
+
+ /// yields true if rRange is inside, or equal to set
+ bool isInside(const B1IRange& rRange) const
+ {
+ return maRange.isInside(rRange.maRange);
+ }
+
+ /// yields true if rRange at least partly inside set
+ bool overlaps(const B1IRange& rRange) const
+ {
+ return maRange.overlaps(rRange.maRange);
+ }
+
+ /// yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal
+ bool overlapsMore(const B1IRange& rRange) const
+ {
+ return maRange.overlapsMore(rRange.maRange);
+ }
+
+ /// add nValue to the set, expanding as necessary
+ void expand(sal_Int32 nValue)
+ {
+ maRange.expand(nValue);
+ }
+
+ /// add rRange to the set, expanding as necessary
+ void expand(const B1IRange& rRange)
+ {
+ maRange.expand(rRange.maRange);
+ }
+
+ /// calc set intersection
+ void intersect(const B1IRange& rRange)
+ {
+ maRange.intersect(rRange.maRange);
+ }
+
+ /// grow set by nValue on both sides
+ void grow(sal_Int32 nValue)
+ {
+ maRange.grow(nValue);
+ }
+ };
+} // end of namespace basegfx
+
+#endif /* _BGFX_RANGE_B1IRANGE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b2dconnectedranges.hxx b/include/basegfx/range/b2dconnectedranges.hxx
new file mode 100644
index 000000000000..f1d65196bd8f
--- /dev/null
+++ b/include/basegfx/range/b2dconnectedranges.hxx
@@ -0,0 +1,257 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_RANGE_B2DCONNECTEDRANGES_HXX
+#define _BGFX_RANGE_B2DCONNECTEDRANGES_HXX
+
+#include <osl/diagnose.h>
+#include <basegfx/range/b2drange.hxx>
+#include <list>
+#include <utility>
+#include <algorithm>
+
+
+namespace basegfx
+{
+ /** Calculate connected ranges from input ranges.
+
+ This template constructs a list of connected ranges from the
+ given input ranges. That is, the output will contain a set of
+ ranges, itself containing a number of input ranges, which will
+ be mutually non-intersecting.
+
+ Example:
+ <code>
+ -------------------
+ | -------|
+ | | ||
+ | --- | ||
+ | | | -------| --------
+ | | +--------- | | |
+ | --+ | | | |
+ | | | | --------
+ | ---------- |
+ -------------------
+ </code
+
+ Here, the outer rectangles represent the output
+ ranges. Contained are the input rectangles that comprise these
+ output ranges.
+
+ @tpl UserData
+ User data to be stored along with the range, to later identify
+ which range went into which connected component. Must be
+ assignable, default- and copy-constructible.
+ */
+ template< typename UserData > class B2DConnectedRanges
+ {
+ public:
+ /// Type of the basic entity (rect + user data)
+ typedef ::std::pair< B2DRange, UserData > ComponentType;
+ typedef ::std::list< ComponentType > ComponentListType;
+
+ /// List of (intersecting) components, plus overall bounds
+ struct ConnectedComponents
+ {
+ ComponentListType maComponentList;
+ B2DRange maTotalBounds;
+ };
+
+ typedef ::std::list< ConnectedComponents > ConnectedComponentsType;
+
+
+ /// Create the range calculator
+ B2DConnectedRanges() :
+ maDisjunctAggregatesList(),
+ maTotalBounds()
+ {
+ }
+
+ /** Query total bounds of all added ranges.
+
+ @return the union bound rect over all added ranges.
+ */
+ B2DRange getBounds() const
+ {
+ return maTotalBounds;
+ }
+
+ /** Add an additional range.
+
+ This method integrates a new range into the connected
+ ranges lists. The method has a worst-case time complexity
+ of O(n^2), with n denoting the number of already added
+ ranges (typically, for well-behaved input, it is O(n)
+ though).
+ */
+ void addRange( const B2DRange& rRange,
+ const UserData& rUserData )
+ {
+ // check whether fast path is possible: if new range is
+ // outside accumulated total range, can add it as a
+ // separate component right away.
+ const bool bNotOutsideEverything(
+ maTotalBounds.overlaps( rRange ) );
+
+ // update own global bounds range
+ maTotalBounds.expand( rRange );
+
+ // assemble anything intersecting with rRange into
+ // this new connected component
+ ConnectedComponents aNewConnectedComponent;
+
+ // as at least rRange will be a member of
+ // aNewConnectedComponent (will be added below), can
+ // preset the overall bounds here.
+ aNewConnectedComponent.maTotalBounds = rRange;
+
+
+ //
+ // STAGE 1: Search for intersecting maDisjunctAggregatesList entries
+ // =================================================================
+ //
+
+ // if rRange is empty, it will intersect with no
+ // maDisjunctAggregatesList member. Thus, we can safe us
+ // the check.
+ // if rRange is outside all other rectangle, skip here,
+ // too
+ if( bNotOutsideEverything &&
+ !rRange.isEmpty() )
+ {
+ typename ConnectedComponentsType::iterator aCurrAggregate;
+ typename ConnectedComponentsType::iterator aLastAggregate;
+
+ // flag, determining whether we touched one or more of
+ // the maDisjunctAggregatesList entries. _If_ we did,
+ // we have to repeat the intersection process, because
+ // these changes might have generated new
+ // intersections.
+ bool bSomeAggregatesChanged;
+
+ // loop, until bSomeAggregatesChanged stays false
+ do
+ {
+ // only continue loop if 'intersects' branch below was hit
+ bSomeAggregatesChanged = false;
+
+ // iterate over all current members of maDisjunctAggregatesList
+ for( aCurrAggregate=maDisjunctAggregatesList.begin(),
+ aLastAggregate=maDisjunctAggregatesList.end();
+ aCurrAggregate != aLastAggregate; )
+ {
+ // first check if current component's bounds
+ // are empty. This ensures that distinct empty
+ // components are not merged into one
+ // aggregate. As a matter of fact, they have
+ // no position and size.
+
+ if( !aCurrAggregate->maTotalBounds.isEmpty() &&
+ aCurrAggregate->maTotalBounds.overlaps(
+ aNewConnectedComponent.maTotalBounds ) )
+ {
+ // union the intersecting
+ // maDisjunctAggregatesList element into
+ // aNewConnectedComponent
+
+ // calc union bounding box
+ aNewConnectedComponent.maTotalBounds.expand( aCurrAggregate->maTotalBounds );
+
+ // extract all aCurrAggregate components
+ // to aNewConnectedComponent
+ aNewConnectedComponent.maComponentList.splice(
+ aNewConnectedComponent.maComponentList.end(),
+ aCurrAggregate->maComponentList );
+
+ // remove and delete aCurrAggregate entry
+ // from list (we've gutted it's content
+ // above). list::erase() will update our
+ // iterator with the predecessor here.
+ aCurrAggregate = maDisjunctAggregatesList.erase( aCurrAggregate );
+
+ // at least one aggregate changed, need to rescan everything
+ bSomeAggregatesChanged = true;
+ }
+ else
+ {
+ aCurrAggregate++;
+ }
+ }
+ }
+ while( bSomeAggregatesChanged );
+ }
+
+ //
+ // STAGE 2: Add newly generated connected component list element
+ // =============================================================
+ //
+
+ // add new component to the end of the component list
+ aNewConnectedComponent.maComponentList.push_back(
+ ComponentType( rRange, rUserData ) );
+
+ // do some consistency checks (aka post conditions)
+ OSL_ENSURE( !aNewConnectedComponent.maComponentList.empty(),
+ "B2DConnectedRanges::addRange(): empty aggregate list" );
+ OSL_ENSURE( !aNewConnectedComponent.maTotalBounds.isEmpty() ||
+ (aNewConnectedComponent.maTotalBounds.isEmpty() &&
+ aNewConnectedComponent.maComponentList.size() == 1),
+ "B2DConnectedRanges::addRange(): empty ranges must be solitary");
+
+ // add aNewConnectedComponent as a new entry to
+ // maDisjunctAggregatesList
+ maDisjunctAggregatesList.push_back( aNewConnectedComponent );
+ }
+
+ /** Apply a functor to each of the disjunct component
+ aggregates.
+
+ @param aFunctor
+ Functor to apply. Must provide an operator( const ConnectedComponents& ).
+
+ @return a copy of the functor, as applied to all aggregates.
+ */
+ template< typename UnaryFunctor > UnaryFunctor forEachAggregate( UnaryFunctor aFunctor ) const
+ {
+ return ::std::for_each( maDisjunctAggregatesList.begin(),
+ maDisjunctAggregatesList.end(),
+ aFunctor );
+ }
+
+ private:
+ // default: disabled copy/assignment
+ B2DConnectedRanges(const B2DConnectedRanges&);
+ B2DConnectedRanges& operator=( const B2DConnectedRanges& );
+
+ /** Current list of disjunct sets of connected components
+
+ Each entry corresponds to one of the top-level rectangles
+ in the drawing above.
+ */
+ ConnectedComponentsType maDisjunctAggregatesList;
+
+ /** Global bound rect over all added ranges.
+ */
+ B2DRange maTotalBounds;
+ };
+}
+
+#endif /* _BGFX_RANGE_B2DCONNECTEDRANGES_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b2dpolyrange.hxx b/include/basegfx/range/b2dpolyrange.hxx
new file mode 100644
index 000000000000..b910062d11a3
--- /dev/null
+++ b/include/basegfx/range/b2dpolyrange.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 _BGFX_RANGE_B2DPOLYRANGE_HXX
+#define _BGFX_RANGE_B2DPOLYRANGE_HXX
+
+#include <o3tl/cow_wrapper.hxx>
+#include <boost/tuple/tuple.hpp>
+#include <basegfx/vector/b2enums.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ class B2DTuple;
+ class B2DRange;
+ class B2DPolyPolygon;
+ class ImplB2DPolyRange;
+
+ /** Multiple ranges in one object.
+
+ This class combines multiple ranges in one object, providing a
+ total, enclosing range for it.
+
+ You can use this class e.g. when updating views containing
+ rectangular objects. Add each modified object to a
+ B2DMultiRange, then test each viewable object against
+ intersection with the multi range.
+
+ Similar in spirit to the poly-polygon vs. polygon relationship.
+
+ Note that comparable to polygons, a poly-range can also
+ contain 'holes' - this is encoded via polygon orientation at
+ the poly-polygon, and via explicit flags for the poly-range.
+ */
+ class BASEGFX_DLLPUBLIC B2DPolyRange
+ {
+ public:
+ typedef boost::tuple<B2DRange,B2VectorOrientation> ElementType ;
+
+ B2DPolyRange();
+ ~B2DPolyRange();
+
+ /** Create a multi range with exactly one containing range
+ */
+ B2DPolyRange( const B2DPolyRange& );
+ B2DPolyRange& operator=( const B2DPolyRange& );
+
+ bool operator==(const B2DPolyRange&) const;
+ bool operator!=(const B2DPolyRange&) const;
+
+ /// Number of included ranges
+ sal_uInt32 count() const;
+
+ ElementType getElement(sal_uInt32 nIndex) const;
+
+ // insert/append a single range
+ void appendElement(const B2DRange& rRange, B2VectorOrientation eOrient, sal_uInt32 nCount = 1);
+
+ void clear();
+
+ /** Test whether given range overlaps one or more of the
+ included ranges. Does *not* use overall range, but checks
+ individually.
+ */
+ bool overlaps( const B2DRange& rRange ) const;
+
+ /** Request a poly-polygon with solved cross-overs
+ */
+ B2DPolyPolygon solveCrossovers() const;
+
+ private:
+ o3tl::cow_wrapper< ImplB2DPolyRange > mpImpl;
+ };
+}
+
+#endif /* _BGFX_RANGE_B2DPOLYRANGE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b2drange.hxx b/include/basegfx/range/b2drange.hxx
new file mode 100644
index 000000000000..1f3884c1c9ce
--- /dev/null
+++ b/include/basegfx/range/b2drange.hxx
@@ -0,0 +1,320 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_RANGE_B2DRANGE_HXX
+#define _BGFX_RANGE_B2DRANGE_HXX
+
+#include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/tuple/b2dtuple.hxx>
+#include <basegfx/range/basicrange.hxx>
+#include <vector>
+#include <basegfx/basegfxdllapi.h>
+
+
+namespace basegfx
+{
+ // predeclarations
+ class B2IRange;
+ class B2DHomMatrix;
+
+ /** A two-dimensional interval over doubles
+
+ This is a set of real numbers, bounded by a lower and an upper
+ pair. All inbetween values are included in the set (see also
+ http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
+
+ The set is closed, i.e. the upper and the lower bound are
+ included (if you're used to the notation - we're talking about
+ [a,b] here, compared to half-open [a,b) or open intervals
+ (a,b)).
+
+ That means, isInside(val) will return true also for values of
+ val=a or val=b.
+
+ @see B1DRange
+ */
+ class B2DRange
+ {
+ public:
+ typedef double ValueType;
+ typedef DoubleTraits TraitsType;
+
+ B2DRange() {}
+
+ /// Create degenerate interval consisting of a single point
+ explicit B2DRange(const B2DTuple& rTuple)
+ : maRangeX(rTuple.getX()),
+ maRangeY(rTuple.getY())
+ {
+ }
+
+ /// Create proper interval between the two given double pairs
+ B2DRange(double x1,
+ double y1,
+ double x2,
+ double y2)
+ : maRangeX(x1),
+ maRangeY(y1)
+ {
+ maRangeX.expand(x2);
+ maRangeY.expand(y2);
+ }
+
+ /// Create proper interval between the two given points
+ B2DRange(const B2DTuple& rTuple1,
+ const B2DTuple& rTuple2)
+ : maRangeX(rTuple1.getX()),
+ maRangeY(rTuple1.getY())
+ {
+ expand( rTuple2 );
+ }
+
+ BASEGFX_DLLPUBLIC explicit B2DRange(const B2IRange& rRange);
+
+ /** Check if the interval set is empty
+
+ @return false, if no value is in this set - having a
+ single point included will already return true.
+ */
+ bool isEmpty() const
+ {
+ return (
+ maRangeX.isEmpty()
+ || maRangeY.isEmpty()
+ );
+ }
+
+ /// reset the object to empty state again, clearing all values
+ void reset()
+ {
+ maRangeX.reset();
+ maRangeY.reset();
+ }
+
+ bool operator==( const B2DRange& rRange ) const
+ {
+ return (maRangeX == rRange.maRangeX
+ && maRangeY == rRange.maRangeY);
+ }
+
+ bool operator!=( const B2DRange& rRange ) const
+ {
+ return (maRangeX != rRange.maRangeX
+ || maRangeY != rRange.maRangeY);
+ }
+
+ bool equal(const B2DRange& rRange) const
+ {
+ return (maRangeX.equal(rRange.maRangeX)
+ && maRangeY.equal(rRange.maRangeY));
+ }
+
+ /// get lower bound of the set. returns arbitrary values for empty sets.
+ double getMinX() const
+ {
+ return maRangeX.getMinimum();
+ }
+
+ /// get lower bound of the set. returns arbitrary values for empty sets.
+ double getMinY() const
+ {
+ return maRangeY.getMinimum();
+ }
+
+ /// get upper bound of the set. returns arbitrary values for empty sets.
+ double getMaxX() const
+ {
+ return maRangeX.getMaximum();
+ }
+
+ /// get upper bound of the set. returns arbitrary values for empty sets.
+ double getMaxY() const
+ {
+ return maRangeY.getMaximum();
+ }
+
+ /// return difference between upper and lower X value. returns 0 for empty sets.
+ double getWidth() const
+ {
+ return maRangeX.getRange();
+ }
+
+ /// return difference between upper and lower Y value. returns 0 for empty sets.
+ double getHeight() const
+ {
+ return maRangeY.getRange();
+ }
+
+ /// get lower bound of the set. returns arbitrary values for empty sets.
+ B2DPoint getMinimum() const
+ {
+ return B2DPoint(
+ maRangeX.getMinimum(),
+ maRangeY.getMinimum()
+ );
+ }
+
+ /// get upper bound of the set. returns arbitrary values for empty sets.
+ B2DPoint getMaximum() const
+ {
+ return B2DPoint(
+ maRangeX.getMaximum(),
+ maRangeY.getMaximum()
+ );
+ }
+
+ /// return difference between upper and lower point. returns (0,0) for empty sets.
+ B2DVector getRange() const
+ {
+ return B2DVector(
+ maRangeX.getRange(),
+ maRangeY.getRange()
+ );
+ }
+
+ /// return center point of set. returns (0,0) for empty sets.
+ B2DPoint getCenter() const
+ {
+ return B2DPoint(
+ maRangeX.getCenter(),
+ maRangeY.getCenter()
+ );
+ }
+
+ /// return center X value of set. returns 0 for empty sets.
+ double getCenterX() const
+ {
+ return maRangeX.getCenter();
+ }
+
+ /// return center Y value of set. returns 0 for empty sets.
+ double getCenterY() const
+ {
+ return maRangeY.getCenter();
+ }
+
+ /// yields true if given point is contained in set
+ bool isInside(const B2DTuple& rTuple) const
+ {
+ return (
+ maRangeX.isInside(rTuple.getX())
+ && maRangeY.isInside(rTuple.getY())
+ );
+ }
+
+ /// yields true if rRange is inside, or equal to set
+ bool isInside(const B2DRange& rRange) const
+ {
+ return (
+ maRangeX.isInside(rRange.maRangeX)
+ && maRangeY.isInside(rRange.maRangeY)
+ );
+ }
+
+ /// yields true if rRange at least partly inside set
+ bool overlaps(const B2DRange& rRange) const
+ {
+ return (
+ maRangeX.overlaps(rRange.maRangeX)
+ && maRangeY.overlaps(rRange.maRangeY)
+ );
+ }
+
+ /// yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal
+ bool overlapsMore(const B2DRange& rRange) const
+ {
+ return (
+ maRangeX.overlapsMore(rRange.maRangeX)
+ && maRangeY.overlapsMore(rRange.maRangeY)
+ );
+ }
+
+ /// add point to the set, expanding as necessary
+ void expand(const B2DTuple& rTuple)
+ {
+ maRangeX.expand(rTuple.getX());
+ maRangeY.expand(rTuple.getY());
+ }
+
+ /// add rRange to the set, expanding as necessary
+ void expand(const B2DRange& rRange)
+ {
+ maRangeX.expand(rRange.maRangeX);
+ maRangeY.expand(rRange.maRangeY);
+ }
+
+ /// calc set intersection
+ void intersect(const B2DRange& rRange)
+ {
+ maRangeX.intersect(rRange.maRangeX);
+ maRangeY.intersect(rRange.maRangeY);
+ }
+
+ /// grow set by fValue on all sides
+ void grow(double fValue)
+ {
+ maRangeX.grow(fValue);
+ maRangeY.grow(fValue);
+ }
+
+ BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix& rMatrix);
+
+ private:
+ typedef ::basegfx::BasicRange< ValueType, TraitsType > MyBasicRange;
+
+ MyBasicRange maRangeX;
+ MyBasicRange maRangeY;
+ };
+
+ /** Round double to nearest integer for 2D range
+
+ @return the nearest integer for this range
+ */
+ BASEGFX_DLLPUBLIC B2IRange fround(const B2DRange& rRange);
+
+ /** Compute the set difference of the two given ranges
+
+ This method calculates the symmetric difference (aka XOR)
+ between the two given ranges, and returning the resulting
+ ranges. Thus, the result will contain all areas where one, but
+ not both ranges lie.
+
+ @param o_rResult
+ Result vector. The up to four difference ranges are returned
+ within this vector
+
+ @param rFirst
+ The first range
+
+ @param rSecond
+ The second range
+
+ @return the input vector
+ */
+ BASEGFX_DLLPUBLIC ::std::vector< B2DRange >& computeSetDifference( ::std::vector< B2DRange >& o_rResult,
+ const B2DRange& rFirst,
+ const B2DRange& rSecond );
+
+} // end of namespace basegfx
+
+
+#endif /* _BGFX_RANGE_B2DRANGE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b2drangeclipper.hxx b/include/basegfx/range/b2drangeclipper.hxx
new file mode 100644
index 000000000000..99bc8763369d
--- /dev/null
+++ b/include/basegfx/range/b2drangeclipper.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 _BGFX_RANGE_B2DRANGECLIPPER_HXX
+#define _BGFX_RANGE_B2DRANGECLIPPER_HXX
+
+#include <basegfx/range/b2dpolyrange.hxx>
+#include <vector>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ namespace tools
+ {
+ /** Extract poly-polygon w/o self-intersections from poly-range
+
+ Similar to the solveCrossovers(const B2DPolyPolygon&)
+ method, this one calculates a self-intersection-free
+ poly-polygon with the same topology, and encoding
+ inside/outsidedness via polygon orientation and layering.
+ */
+ BASEGFX_DLLPUBLIC B2DPolyPolygon solveCrossovers(const std::vector<B2DRange>& rRanges,
+ const std::vector<B2VectorOrientation>& rOrientations);
+ }
+}
+
+#endif /* _BGFX_RANGE_B2DRANGECLIPPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b2drectangle.hxx b/include/basegfx/range/b2drectangle.hxx
new file mode 100644
index 000000000000..8d4715d64410
--- /dev/null
+++ b/include/basegfx/range/b2drectangle.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 _BGFX_RANGE_B2DRECTANGLE_HXX
+#define _BGFX_RANGE_B2DRECTANGLE_HXX
+
+#include <basegfx/range/b2drange.hxx>
+
+namespace basegfx
+{
+ // syntactic sugar: a B2DRange exactly models a Rectangle, thus,
+ // for interface clarity, we provide an alias name
+
+ /// Alias name for interface clarity (not everybody is aware of the identity)
+ typedef B2DRange B2DRectangle;
+}
+
+#endif /* _BGFX_RANGE_B2DRECTANGLE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b2ibox.hxx b/include/basegfx/range/b2ibox.hxx
new file mode 100644
index 000000000000..7c182a4ab327
--- /dev/null
+++ b/include/basegfx/range/b2ibox.hxx
@@ -0,0 +1,261 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_RANGE_B2IBOX_HXX
+#define _BGFX_RANGE_B2IBOX_HXX
+
+#include <basegfx/point/b2ipoint.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/tuple/b2ituple.hxx>
+#include <basegfx/tuple/b2i64tuple.hxx>
+#include <basegfx/range/basicbox.hxx>
+#include <vector>
+#include <basegfx/basegfxdllapi.h>
+
+
+namespace basegfx
+{
+ /** A two-dimensional interval over integers
+
+ This is most easily depicted as a set of integers, bounded by
+ a lower and an upper value - but excluding the upper
+ value. All inbetween values are included in the set (see also
+ http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
+
+ The set is half-open, i.e. the lower bound is included, the
+ upper bound not (if you're used to the notation - we're
+ talking about [a,b) here, compared to closed [a,b] or fully
+ open intervals (a,b)).
+
+ If you don't need a half-open interval, check B2IRange.
+
+ That means, isInside(val) will return true also for values of
+ val=a, but not for val=b.
+
+ Alternatively, consider this a rectangle, where the rightmost
+ pixel column and the bottommost pixel row are excluded - this
+ is much like polygon filling. As a result, filling a given
+ rectangle with basebmp::BitmapDevice::fillPolyPolygon(), will
+ affect exactly the same set of pixel as isInside() would
+ return true for.
+
+ @see B2IRange
+ */
+ class B2IBox
+ {
+ public:
+ typedef sal_Int32 ValueType;
+ typedef Int32Traits TraitsType;
+
+ B2IBox() {}
+
+ /// Create degenerate interval that's still empty
+ explicit B2IBox(const B2ITuple& rTuple)
+ : maRangeX(rTuple.getX()),
+ maRangeY(rTuple.getY())
+ {
+ }
+
+ /// Create proper interval between the two given points
+ B2IBox(sal_Int32 x1,
+ sal_Int32 y1,
+ sal_Int32 x2,
+ sal_Int32 y2) :
+ maRangeX(x1),
+ maRangeY(y1)
+ {
+ maRangeX.expand(x2);
+ maRangeY.expand(y2);
+ }
+
+ /// Create proper interval between the two given points
+ B2IBox(const B2ITuple& rTuple1,
+ const B2ITuple& rTuple2) :
+ maRangeX(rTuple1.getX()),
+ maRangeY(rTuple1.getY())
+ {
+ expand( rTuple2 );
+ }
+
+ /** Check if the interval set is empty
+
+ @return false, if no value is in this set - having a
+ single value included will still return false.
+ */
+ bool isEmpty() const
+ {
+ return maRangeX.isEmpty() || maRangeY.isEmpty();
+ }
+
+ /// reset the object to empty state again, clearing all values
+ void reset()
+ {
+ maRangeX.reset();
+ maRangeY.reset();
+ }
+
+ bool operator==( const B2IBox& rBox ) const
+ {
+ return (maRangeX == rBox.maRangeX
+ && maRangeY == rBox.maRangeY);
+ }
+
+ bool operator!=( const B2IBox& rBox ) const
+ {
+ return (maRangeX != rBox.maRangeX
+ || maRangeY != rBox.maRangeY);
+ }
+
+ /// get lower bound of the set. returns arbitrary values for empty sets.
+ sal_Int32 getMinX() const
+ {
+ return maRangeX.getMinimum();
+ }
+
+ /// get lower bound of the set. returns arbitrary values for empty sets.
+ sal_Int32 getMinY() const
+ {
+ return maRangeY.getMinimum();
+ }
+
+ /// get upper bound of the set. returns arbitrary values for empty sets.
+ sal_Int32 getMaxX() const
+ {
+ return maRangeX.getMaximum();
+ }
+
+ /// get upper bound of the set. returns arbitrary values for empty sets.
+ sal_Int32 getMaxY() const
+ {
+ return maRangeY.getMaximum();
+ }
+
+ /// return difference between upper and lower X value. returns 0 for empty sets.
+ sal_Int64 getWidth() const
+ {
+ return maRangeX.getRange();
+ }
+
+ /// return difference between upper and lower Y value. returns 0 for empty sets.
+ sal_Int64 getHeight() const
+ {
+ return maRangeY.getRange();
+ }
+
+ /// get lower bound of the set. returns arbitrary values for empty sets.
+ B2IPoint getMinimum() const
+ {
+ return B2IPoint(
+ maRangeX.getMinimum(),
+ maRangeY.getMinimum()
+ );
+ }
+
+ /// get upper bound of the set. returns arbitrary values for empty sets.
+ B2IPoint getMaximum() const
+ {
+ return B2IPoint(
+ maRangeX.getMaximum(),
+ maRangeY.getMaximum()
+ );
+ }
+
+ /// return difference between upper and lower value. returns (0,0) for empty sets.
+ B2I64Tuple getRange() const
+ {
+ return B2I64Tuple(
+ maRangeX.getRange(),
+ maRangeY.getRange()
+ );
+ }
+
+ /// return center point of set. returns (0,0) for empty sets.
+ B2DPoint getCenter() const
+ {
+ return B2DPoint(
+ maRangeX.getCenter(),
+ maRangeY.getCenter()
+ );
+ }
+
+ /// yields true if point is contained in set
+ bool isInside(const B2ITuple& rTuple) const
+ {
+ return (
+ maRangeX.isInside(rTuple.getX())
+ && maRangeY.isInside(rTuple.getY())
+ );
+ }
+
+ /// yields true if rBox is inside, or equal to set
+ bool isInside(const B2IBox& rBox) const
+ {
+ return (
+ maRangeX.isInside(rBox.maRangeX)
+ && maRangeY.isInside(rBox.maRangeY)
+ );
+ }
+
+ /// yields true if rBox at least partly inside set
+ bool overlaps(const B2IBox& rBox) const
+ {
+ return (
+ maRangeX.overlaps(rBox.maRangeX)
+ && maRangeY.overlaps(rBox.maRangeY)
+ );
+ }
+
+ /// add point to the set, expanding as necessary
+ void expand(const B2ITuple& rTuple)
+ {
+ maRangeX.expand(rTuple.getX());
+ maRangeY.expand(rTuple.getY());
+ }
+
+ /// add rBox to the set, expanding as necessary
+ void expand(const B2IBox& rBox)
+ {
+ maRangeX.expand(rBox.maRangeX);
+ maRangeY.expand(rBox.maRangeY);
+ }
+
+ /// calc set intersection
+ void intersect(const B2IBox& rBox)
+ {
+ maRangeX.intersect(rBox.maRangeX);
+ maRangeY.intersect(rBox.maRangeY);
+ }
+
+ /// grow set by nValue on all sides
+ void grow(sal_Int32 nValue)
+ {
+ maRangeX.grow(nValue);
+ maRangeY.grow(nValue);
+ }
+
+ private:
+ BasicBox maRangeX;
+ BasicBox maRangeY;
+ };
+
+} // end of namespace basegfx
+
+#endif /* _BGFX_RANGE_B2IBOX_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b2irange.hxx b/include/basegfx/range/b2irange.hxx
new file mode 100644
index 000000000000..60f9fc79fa67
--- /dev/null
+++ b/include/basegfx/range/b2irange.hxx
@@ -0,0 +1,287 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_RANGE_B2IRANGE_HXX
+#define _BGFX_RANGE_B2IRANGE_HXX
+
+#include <basegfx/point/b2ipoint.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/tuple/b2ituple.hxx>
+#include <basegfx/tuple/b2i64tuple.hxx>
+#include <basegfx/range/basicrange.hxx>
+#include <vector>
+#include <basegfx/basegfxdllapi.h>
+
+
+namespace basegfx
+{
+ /** A two-dimensional interval over integers
+
+ This is a set of real numbers, bounded by a lower and an upper
+ pair. All inbetween values are included in the set (see also
+ http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
+
+ Probably you rather want B2IBox for integers.
+
+ The set is closed, i.e. the upper and the lower bound are
+ included (if you're used to the notation - we're talking about
+ [a,b] here, compared to half-open [a,b) or open intervals
+ (a,b)).
+
+ That means, isInside(val) will return true also for values of
+ val=a or val=b.
+
+ @see B2IBox
+ */
+ class B2IRange
+ {
+ public:
+ typedef sal_Int32 ValueType;
+ typedef Int32Traits TraitsType;
+
+ B2IRange() {}
+
+ /// Create degenerate interval consisting of a single point
+ explicit B2IRange(const B2ITuple& rTuple)
+ : maRangeX(rTuple.getX()),
+ maRangeY(rTuple.getY())
+ {
+ }
+
+ /// Create proper interval between the two given integer pairs
+ B2IRange(sal_Int32 x1,
+ sal_Int32 y1,
+ sal_Int32 x2,
+ sal_Int32 y2)
+ : maRangeX(x1),
+ maRangeY(y1)
+ {
+ maRangeX.expand(x2);
+ maRangeY.expand(y2);
+ }
+
+ /// Create proper interval between the two given points
+ B2IRange(const B2ITuple& rTuple1,
+ const B2ITuple& rTuple2)
+ : maRangeX(rTuple1.getX()),
+ maRangeY(rTuple1.getY())
+ {
+ expand( rTuple2 );
+ }
+
+ /** Check if the interval set is empty
+
+ @return false, if no value is in this set - having a
+ single point included will already return true.
+ */
+ bool isEmpty() const
+ {
+ return maRangeX.isEmpty() || maRangeY.isEmpty();
+ }
+
+ /// reset the object to empty state again, clearing all values
+ void reset()
+ {
+ maRangeX.reset();
+ maRangeY.reset();
+ }
+
+ bool operator==( const B2IRange& rRange ) const
+ {
+ return (maRangeX == rRange.maRangeX
+ && maRangeY == rRange.maRangeY);
+ }
+
+ bool operator!=( const B2IRange& rRange ) const
+ {
+ return (maRangeX != rRange.maRangeX
+ || maRangeY != rRange.maRangeY);
+ }
+
+ /// get lower bound of the set. returns arbitrary values for empty sets.
+ sal_Int32 getMinX() const
+ {
+ return maRangeX.getMinimum();
+ }
+
+ /// get lower bound of the set. returns arbitrary values for empty sets.
+ sal_Int32 getMinY() const
+ {
+ return maRangeY.getMinimum();
+ }
+
+ /// get upper bound of the set. returns arbitrary values for empty sets.
+ sal_Int32 getMaxX() const
+ {
+ return maRangeX.getMaximum();
+ }
+
+ /// get upper bound of the set. returns arbitrary values for empty sets.
+ sal_Int32 getMaxY() const
+ {
+ return maRangeY.getMaximum();
+ }
+
+ /// return difference between upper and lower X value. returns 0 for empty sets.
+ sal_Int64 getWidth() const
+ {
+ return maRangeX.getRange();
+ }
+
+ /// return difference between upper and lower Y value. returns 0 for empty sets.
+ sal_Int64 getHeight() const
+ {
+ return maRangeY.getRange();
+ }
+
+ /// get lower bound of the set. returns arbitrary values for empty sets.
+ B2IPoint getMinimum() const
+ {
+ return B2IPoint(
+ maRangeX.getMinimum(),
+ maRangeY.getMinimum()
+ );
+ }
+
+ /// get upper bound of the set. returns arbitrary values for empty sets.
+ B2IPoint getMaximum() const
+ {
+ return B2IPoint(
+ maRangeX.getMaximum(),
+ maRangeY.getMaximum()
+ );
+ }
+
+ /// return difference between upper and lower point. returns (0,0) for empty sets.
+ B2I64Tuple getRange() const
+ {
+ return B2I64Tuple(
+ maRangeX.getRange(),
+ maRangeY.getRange()
+ );
+ }
+
+ /// return center point of set. returns (0,0) for empty sets.
+ B2DPoint getCenter() const
+ {
+ return B2DPoint(
+ maRangeX.getCenter(),
+ maRangeY.getCenter()
+ );
+ }
+
+ /// yields true if given point is contained in set
+ bool isInside(const B2ITuple& rTuple) const
+ {
+ return (
+ maRangeX.isInside(rTuple.getX())
+ && maRangeY.isInside(rTuple.getY())
+ );
+ }
+
+ /// yields true if rRange is inside, or equal to set
+ bool isInside(const B2IRange& rRange) const
+ {
+ return (
+ maRangeX.isInside(rRange.maRangeX)
+ && maRangeY.isInside(rRange.maRangeY)
+ );
+ }
+
+ /// yields true if rRange at least partly inside set
+ bool overlaps(const B2IRange& rRange) const
+ {
+ return (
+ maRangeX.overlaps(rRange.maRangeX)
+ && maRangeY.overlaps(rRange.maRangeY)
+ );
+ }
+
+ /// yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal
+ bool overlapsMore(const B2IRange& rRange) const
+ {
+ return (
+ maRangeX.overlapsMore(rRange.maRangeX)
+ && maRangeY.overlapsMore(rRange.maRangeY)
+ );
+ }
+
+ /// add point to the set, expanding as necessary
+ void expand(const B2ITuple& rTuple)
+ {
+ maRangeX.expand(rTuple.getX());
+ maRangeY.expand(rTuple.getY());
+ }
+
+ /// add rRange to the set, expanding as necessary
+ void expand(const B2IRange& rRange)
+ {
+ maRangeX.expand(rRange.maRangeX);
+ maRangeY.expand(rRange.maRangeY);
+ }
+
+ /// calc set intersection
+ void intersect(const B2IRange& rRange)
+ {
+ maRangeX.intersect(rRange.maRangeX);
+ maRangeY.intersect(rRange.maRangeY);
+ }
+
+ /// grow set by nValue on all sides
+ void grow(sal_Int32 nValue)
+ {
+ maRangeX.grow(nValue);
+ maRangeY.grow(nValue);
+ }
+
+ private:
+ typedef ::basegfx::BasicRange< ValueType, TraitsType > MyBasicRange;
+
+ MyBasicRange maRangeX;
+ MyBasicRange maRangeY;
+ };
+
+ /** Compute the set difference of the two given ranges
+
+ This method calculates the symmetric difference (aka XOR)
+ between the two given ranges, and returning the resulting
+ ranges. Thus, the result will contain all areas where one, but
+ not both ranges lie.
+
+ @param o_rResult
+ Result vector. The up to four difference ranges are returned
+ within this vector
+
+ @param rFirst
+ The first range
+
+ @param rSecond
+ The second range
+
+ @return the input vector
+ */
+ BASEGFX_DLLPUBLIC ::std::vector< B2IRange >& computeSetDifference( ::std::vector< B2IRange >& o_rResult,
+ const B2IRange& rFirst,
+ const B2IRange& rSecond );
+
+} // end of namespace basegfx
+
+#endif /* _BGFX_RANGE_B2IRANGE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b2irectangle.hxx b/include/basegfx/range/b2irectangle.hxx
new file mode 100644
index 000000000000..40792732ab1d
--- /dev/null
+++ b/include/basegfx/range/b2irectangle.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 _BGFX_RANGE_B2IRECTANGLE_HXX
+#define _BGFX_RANGE_B2IRECTANGLE_HXX
+
+#include <basegfx/range/b2irange.hxx>
+
+namespace basegfx
+{
+ // syntactic sugar: a B2IRange exactly models a Rectangle, thus,
+ // for interface clarity, we provide an alias name
+
+ /// Alias name for interface clarity (not everybody is aware of the identity)
+ typedef B2IRange B2IRectangle;
+}
+
+#endif /* _BGFX_RANGE_B2IRECTANGLE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b3drange.hxx b/include/basegfx/range/b3drange.hxx
new file mode 100644
index 000000000000..7b17f04e4964
--- /dev/null
+++ b/include/basegfx/range/b3drange.hxx
@@ -0,0 +1,273 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_RANGE_B3DRANGE_HXX
+#define _BGFX_RANGE_B3DRANGE_HXX
+
+#include <basegfx/vector/b3dvector.hxx>
+#include <basegfx/point/b3dpoint.hxx>
+#include <basegfx/tuple/b3dtuple.hxx>
+#include <basegfx/range/basicrange.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ // predeclarations
+ class B3IRange;
+ class B3DHomMatrix;
+
+ class B3DRange
+ {
+ typedef ::basegfx::BasicRange< double, DoubleTraits > MyBasicRange;
+
+ MyBasicRange maRangeX;
+ MyBasicRange maRangeY;
+ MyBasicRange maRangeZ;
+
+ public:
+ B3DRange() {}
+
+ explicit B3DRange(const B3DTuple& rTuple)
+ : maRangeX(rTuple.getX()),
+ maRangeY(rTuple.getY()),
+ maRangeZ(rTuple.getZ())
+ {
+ }
+
+ B3DRange(double x1,
+ double y1,
+ double z1,
+ double x2,
+ double y2,
+ double z2)
+ : maRangeX(x1),
+ maRangeY(y1),
+ maRangeZ(z1)
+ {
+ maRangeX.expand(x2);
+ maRangeY.expand(y2);
+ maRangeZ.expand(z2);
+ }
+
+ B3DRange(const B3DTuple& rTuple1,
+ const B3DTuple& rTuple2)
+ : maRangeX(rTuple1.getX()),
+ maRangeY(rTuple1.getY()),
+ maRangeZ(rTuple1.getZ())
+ {
+ expand(rTuple2);
+ }
+
+ bool isEmpty() const
+ {
+ return (
+ maRangeX.isEmpty()
+ || maRangeY.isEmpty()
+ || maRangeZ.isEmpty()
+ );
+ }
+
+ void reset()
+ {
+ maRangeX.reset();
+ maRangeY.reset();
+ maRangeZ.reset();
+ }
+
+ bool operator==( const B3DRange& rRange ) const
+ {
+ return (maRangeX == rRange.maRangeX
+ && maRangeY == rRange.maRangeY
+ && maRangeZ == rRange.maRangeZ);
+ }
+
+ bool operator!=( const B3DRange& rRange ) const
+ {
+ return (maRangeX != rRange.maRangeX
+ || maRangeY != rRange.maRangeY
+ || maRangeZ != rRange.maRangeZ);
+ }
+
+ bool equal(const B3DRange& rRange) const
+ {
+ return (maRangeX.equal(rRange.maRangeX)
+ && maRangeY.equal(rRange.maRangeY)
+ && maRangeZ.equal(rRange.maRangeZ));
+ }
+
+ double getMinX() const
+ {
+ return maRangeX.getMinimum();
+ }
+
+ double getMinY() const
+ {
+ return maRangeY.getMinimum();
+ }
+
+ double getMinZ() const
+ {
+ return maRangeZ.getMinimum();
+ }
+
+ double getMaxX() const
+ {
+ return maRangeX.getMaximum();
+ }
+
+ double getMaxY() const
+ {
+ return maRangeY.getMaximum();
+ }
+
+ double getMaxZ() const
+ {
+ return maRangeZ.getMaximum();
+ }
+
+ double getWidth() const
+ {
+ return maRangeX.getRange();
+ }
+
+ double getHeight() const
+ {
+ return maRangeY.getRange();
+ }
+
+ double getDepth() const
+ {
+ return maRangeZ.getRange();
+ }
+
+ B3DPoint getMinimum() const
+ {
+ return B3DPoint(
+ maRangeX.getMinimum(),
+ maRangeY.getMinimum(),
+ maRangeZ.getMinimum()
+ );
+ }
+
+ B3DPoint getMaximum() const
+ {
+ return B3DPoint(
+ maRangeX.getMaximum(),
+ maRangeY.getMaximum(),
+ maRangeZ.getMaximum()
+ );
+ }
+
+ B3DVector getRange() const
+ {
+ return B3DVector(
+ maRangeX.getRange(),
+ maRangeY.getRange(),
+ maRangeZ.getRange()
+ );
+ }
+
+ B3DPoint getCenter() const
+ {
+ return B3DPoint(
+ maRangeX.getCenter(),
+ maRangeY.getCenter(),
+ maRangeZ.getCenter()
+ );
+ }
+
+ double getCenterX() const
+ {
+ return maRangeX.getCenter();
+ }
+
+ double getCenterY() const
+ {
+ return maRangeY.getCenter();
+ }
+
+ double getCenterZ() const
+ {
+ return maRangeZ.getCenter();
+ }
+
+ bool isInside(const B3DTuple& rTuple) const
+ {
+ return (
+ maRangeX.isInside(rTuple.getX())
+ && maRangeY.isInside(rTuple.getY())
+ && maRangeZ.isInside(rTuple.getZ())
+ );
+ }
+
+ bool isInside(const B3DRange& rRange) const
+ {
+ return (
+ maRangeX.isInside(rRange.maRangeX)
+ && maRangeY.isInside(rRange.maRangeY)
+ && maRangeZ.isInside(rRange.maRangeZ)
+ );
+ }
+
+ bool overlaps(const B3DRange& rRange) const
+ {
+ return (
+ maRangeX.overlaps(rRange.maRangeX)
+ && maRangeY.overlaps(rRange.maRangeY)
+ && maRangeZ.overlaps(rRange.maRangeZ)
+ );
+ }
+
+ void expand(const B3DTuple& rTuple)
+ {
+ maRangeX.expand(rTuple.getX());
+ maRangeY.expand(rTuple.getY());
+ maRangeZ.expand(rTuple.getZ());
+ }
+
+ void expand(const B3DRange& rRange)
+ {
+ maRangeX.expand(rRange.maRangeX);
+ maRangeY.expand(rRange.maRangeY);
+ maRangeZ.expand(rRange.maRangeZ);
+ }
+
+ void intersect(const B3DRange& rRange)
+ {
+ maRangeX.intersect(rRange.maRangeX);
+ maRangeY.intersect(rRange.maRangeY);
+ maRangeZ.intersect(rRange.maRangeZ);
+ }
+
+ void grow(double fValue)
+ {
+ maRangeX.grow(fValue);
+ maRangeY.grow(fValue);
+ maRangeZ.grow(fValue);
+ }
+
+ BASEGFX_DLLPUBLIC void transform(const B3DHomMatrix& rMatrix);
+ };
+
+} // end of namespace basegfx
+
+
+#endif /* _BGFX_RANGE_B3DRANGE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/b3irange.hxx b/include/basegfx/range/b3irange.hxx
new file mode 100644
index 000000000000..558c2abb4d62
--- /dev/null
+++ b/include/basegfx/range/b3irange.hxx
@@ -0,0 +1,240 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_RANGE_B3IRANGE_HXX
+#define _BGFX_RANGE_B3IRANGE_HXX
+
+#include <basegfx/point/b3ipoint.hxx>
+#include <basegfx/point/b3dpoint.hxx>
+#include <basegfx/tuple/b3ituple.hxx>
+#include <basegfx/tuple/b3i64tuple.hxx>
+#include <basegfx/range/basicrange.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ class B3IRange
+ {
+ typedef ::basegfx::BasicRange< sal_Int32, Int32Traits > MyBasicRange;
+
+ MyBasicRange maRangeX;
+ MyBasicRange maRangeY;
+ MyBasicRange maRangeZ;
+
+ public:
+ B3IRange() {}
+
+ explicit B3IRange(const B3ITuple& rTuple)
+ : maRangeX(rTuple.getX()),
+ maRangeY(rTuple.getY()),
+ maRangeZ(rTuple.getZ())
+ {
+ }
+
+ B3IRange(sal_Int32 x1,
+ sal_Int32 y1,
+ sal_Int32 z1,
+ sal_Int32 x2,
+ sal_Int32 y2,
+ sal_Int32 z2)
+ : maRangeX(x1),
+ maRangeY(y1),
+ maRangeZ(z1)
+ {
+ maRangeX.expand(x2);
+ maRangeY.expand(y2);
+ maRangeZ.expand(z2);
+ }
+
+ B3IRange(const B3ITuple& rTuple1,
+ const B3ITuple& rTuple2)
+ : maRangeX(rTuple1.getX()),
+ maRangeY(rTuple1.getY()),
+ maRangeZ(rTuple1.getZ())
+ {
+ expand(rTuple2);
+ }
+
+ bool isEmpty() const
+ {
+ return maRangeX.isEmpty() || maRangeY.isEmpty() || maRangeZ.isEmpty();
+ }
+
+ void reset()
+ {
+ maRangeX.reset();
+ maRangeY.reset();
+ maRangeZ.reset();
+ }
+
+ bool operator==( const B3IRange& rRange ) const
+ {
+ return (maRangeX == rRange.maRangeX
+ && maRangeY == rRange.maRangeY
+ && maRangeZ == rRange.maRangeZ);
+ }
+
+ bool operator!=( const B3IRange& rRange ) const
+ {
+ return (maRangeX != rRange.maRangeX
+ || maRangeY != rRange.maRangeY
+ || maRangeZ != rRange.maRangeZ);
+ }
+
+ sal_Int32 getMinX() const
+ {
+ return maRangeX.getMinimum();
+ }
+
+ sal_Int32 getMinY() const
+ {
+ return maRangeY.getMinimum();
+ }
+
+ sal_Int32 getMinZ() const
+ {
+ return maRangeZ.getMinimum();
+ }
+
+ sal_Int32 getMaxX() const
+ {
+ return maRangeX.getMaximum();
+ }
+
+ sal_Int32 getMaxY() const
+ {
+ return maRangeY.getMaximum();
+ }
+
+ sal_Int32 getMaxZ() const
+ {
+ return maRangeZ.getMaximum();
+ }
+
+ sal_Int64 getWidth() const
+ {
+ return maRangeX.getRange();
+ }
+
+ sal_Int64 getHeight() const
+ {
+ return maRangeY.getRange();
+ }
+
+ sal_Int64 getDepth() const
+ {
+ return maRangeZ.getRange();
+ }
+
+ B3IPoint getMinimum() const
+ {
+ return B3IPoint(
+ maRangeX.getMinimum(),
+ maRangeY.getMinimum(),
+ maRangeZ.getMinimum()
+ );
+ }
+
+ B3IPoint getMaximum() const
+ {
+ return B3IPoint(
+ maRangeX.getMaximum(),
+ maRangeY.getMaximum(),
+ maRangeZ.getMaximum()
+ );
+ }
+
+ B3I64Tuple getRange() const
+ {
+ return B3I64Tuple(
+ maRangeX.getRange(),
+ maRangeY.getRange(),
+ maRangeZ.getRange()
+ );
+ }
+
+ B3DPoint getCenter() const
+ {
+ return B3DPoint(
+ maRangeX.getCenter(),
+ maRangeY.getCenter(),
+ maRangeZ.getCenter()
+ );
+ }
+
+ bool isInside(const B3ITuple& rTuple) const
+ {
+ return (
+ maRangeX.isInside(rTuple.getX())
+ && maRangeY.isInside(rTuple.getY())
+ && maRangeZ.isInside(rTuple.getZ())
+ );
+ }
+
+ bool isInside(const B3IRange& rRange) const
+ {
+ return (
+ maRangeX.isInside(rRange.maRangeX)
+ && maRangeY.isInside(rRange.maRangeY)
+ && maRangeZ.isInside(rRange.maRangeZ)
+ );
+ }
+
+ bool overlaps(const B3IRange& rRange) const
+ {
+ return (
+ maRangeX.overlaps(rRange.maRangeX)
+ && maRangeY.overlaps(rRange.maRangeY)
+ && maRangeZ.overlaps(rRange.maRangeZ)
+ );
+ }
+
+ void expand(const B3ITuple& rTuple)
+ {
+ maRangeX.expand(rTuple.getX());
+ maRangeY.expand(rTuple.getY());
+ maRangeZ.expand(rTuple.getZ());
+ }
+
+ void expand(const B3IRange& rRange)
+ {
+ maRangeX.expand(rRange.maRangeX);
+ maRangeY.expand(rRange.maRangeY);
+ maRangeZ.expand(rRange.maRangeZ);
+ }
+
+ void intersect(const B3IRange& rRange)
+ {
+ maRangeX.intersect(rRange.maRangeX);
+ maRangeY.intersect(rRange.maRangeY);
+ maRangeZ.intersect(rRange.maRangeZ);
+ }
+
+ void grow(sal_Int32 nValue)
+ {
+ maRangeX.grow(nValue);
+ maRangeY.grow(nValue);
+ maRangeZ.grow(nValue);
+ }
+ };
+} // end of namespace basegfx
+
+#endif /* _BGFX_RANGE_B3IRANGE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/basicbox.hxx b/include/basegfx/range/basicbox.hxx
new file mode 100644
index 000000000000..bab84c17f89a
--- /dev/null
+++ b/include/basegfx/range/basicbox.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 _BGFX_RANGE_BASICBOX_HXX
+#define _BGFX_RANGE_BASICBOX_HXX
+
+#include <basegfx/range/basicrange.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+
+namespace basegfx
+{
+ /** Explicitely different from BasicRange, handling the inside predicates
+ differently.
+
+ This is modelled after how polygon fill algorithms set pixel -
+ typically excluding rightmost and bottommost ones.
+ */
+ class BasicBox : public BasicRange< sal_Int32, Int32Traits >
+ {
+ typedef BasicRange< sal_Int32, Int32Traits > Base;
+ public:
+ BasicBox() {}
+
+ explicit BasicBox( sal_Int32 nValue ) :
+ Base( nValue )
+ {
+ }
+
+ bool isEmpty() const
+ {
+ return mnMinimum >= mnMaximum;
+ }
+
+ double getCenter() const
+ {
+ if(isEmpty())
+ {
+ return 0.0;
+ }
+ else
+ {
+ return ((mnMaximum + mnMinimum - 1.0) / 2.0);
+ }
+ }
+
+ using Base::isInside;
+
+ bool isInside(sal_Int32 nValue) const
+ {
+ if(isEmpty())
+ {
+ return false;
+ }
+ else
+ {
+ return (nValue >= mnMinimum) && (nValue < mnMaximum);
+ }
+ }
+
+ using Base::overlaps;
+
+ bool overlaps(const BasicBox& rBox) const
+ {
+ if(isEmpty())
+ {
+ return false;
+ }
+ else
+ {
+ if(rBox.isEmpty())
+ {
+ return false;
+ }
+ else
+ {
+ return !((rBox.mnMaximum <= mnMinimum) || (rBox.mnMinimum >= mnMaximum));
+ }
+ }
+ }
+
+ void grow(sal_Int32 nValue)
+ {
+ if(!isEmpty())
+ {
+ bool bLessThanZero(nValue < 0);
+
+ if(nValue > 0 || bLessThanZero)
+ {
+ mnMinimum -= nValue;
+ mnMaximum += nValue;
+
+ if(bLessThanZero)
+ {
+ // test if range did collapse
+ if(mnMinimum > mnMaximum)
+ {
+ // if yes, collapse to center
+ mnMinimum = mnMaximum = ((mnMaximum + mnMinimum - 1) / 2);
+ }
+ }
+ }
+ }
+ }
+ };
+
+} // end of namespace basegfx
+
+#endif /* _BGFX_RANGE_BASICBOX_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/range/basicrange.hxx b/include/basegfx/range/basicrange.hxx
new file mode 100644
index 000000000000..51b5593ae61d
--- /dev/null
+++ b/include/basegfx/range/basicrange.hxx
@@ -0,0 +1,278 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_RANGE_BASICRANGE_HXX
+#define _BGFX_RANGE_BASICRANGE_HXX
+
+#include <sal/types.h>
+#include <float.h>
+#include <basegfx/numeric/ftools.hxx>
+
+
+namespace basegfx
+{
+ template< typename T, typename Traits > class BasicRange
+ {
+ protected:
+ T mnMinimum;
+ T mnMaximum;
+
+ public:
+ typedef T ValueType;
+ typedef Traits TraitsType;
+
+ BasicRange() :
+ mnMinimum(Traits::maxVal()),
+ mnMaximum(Traits::minVal())
+ {
+ }
+
+ explicit BasicRange( T nValue ) :
+ mnMinimum(nValue),
+ mnMaximum(nValue)
+ {
+ }
+
+ void reset()
+ {
+ mnMinimum = Traits::maxVal();
+ mnMaximum = Traits::minVal();
+ }
+
+ bool isEmpty() const
+ {
+ return Traits::maxVal() == mnMinimum;
+ }
+
+ T getMinimum() const { return mnMinimum; }
+ T getMaximum() const { return mnMaximum; }
+
+ double getCenter() const
+ {
+ if(isEmpty())
+ {
+ return 0.0;
+ }
+ else
+ {
+ return ((mnMaximum + mnMinimum) / 2.0);
+ }
+ }
+
+ bool isInside(T nValue) const
+ {
+ if(isEmpty())
+ {
+ return false;
+ }
+ else
+ {
+ return (nValue >= mnMinimum) && (nValue <= mnMaximum);
+ }
+ }
+
+ bool isInside(const BasicRange& rRange) const
+ {
+ if(isEmpty())
+ {
+ return false;
+ }
+ else
+ {
+ if(rRange.isEmpty())
+ {
+ return false;
+ }
+ else
+ {
+ return (rRange.mnMinimum >= mnMinimum) && (rRange.mnMaximum <= mnMaximum);
+ }
+ }
+ }
+
+ bool overlaps(const BasicRange& rRange) const
+ {
+ if(isEmpty())
+ {
+ return false;
+ }
+ else
+ {
+ if(rRange.isEmpty())
+ {
+ return false;
+ }
+ else
+ {
+ return !((rRange.mnMaximum < mnMinimum) || (rRange.mnMinimum > mnMaximum));
+ }
+ }
+ }
+
+ bool overlapsMore(const BasicRange& rRange) const
+ {
+ if(isEmpty() || rRange.isEmpty())
+ return false;
+ // returns true if the overlap is more than just a touching at the limits
+ return ((rRange.mnMaximum > mnMinimum) && (rRange.mnMinimum < mnMaximum));
+ }
+
+ bool operator==( const BasicRange& rRange ) const
+ {
+ return (mnMinimum == rRange.mnMinimum && mnMaximum == rRange.mnMaximum);
+ }
+
+ bool operator!=( const BasicRange& rRange ) const
+ {
+ return (mnMinimum != rRange.mnMinimum || mnMaximum != rRange.mnMaximum);
+ }
+
+ bool equal(const BasicRange& rRange) const
+ {
+ return (
+ fTools::equal(mnMinimum, rRange.mnMinimum) &&
+ fTools::equal(mnMaximum, rRange.mnMaximum));
+ }
+
+ void expand(T nValue)
+ {
+ if(isEmpty())
+ {
+ mnMinimum = mnMaximum = nValue;
+ }
+ else
+ {
+ if(nValue < mnMinimum)
+ {
+ mnMinimum = nValue;
+ }
+
+ if(nValue > mnMaximum)
+ {
+ mnMaximum = nValue;
+ }
+ }
+ }
+
+ void expand(const BasicRange& rRange)
+ {
+ if(isEmpty())
+ {
+ mnMinimum = rRange.mnMinimum;
+ mnMaximum = rRange.mnMaximum;
+ }
+ else
+ {
+ if(!rRange.isEmpty())
+ {
+ if(rRange.mnMinimum < mnMinimum)
+ {
+ mnMinimum = rRange.mnMinimum;
+ }
+
+ if(rRange.mnMaximum > mnMaximum)
+ {
+ mnMaximum = rRange.mnMaximum;
+ }
+ }
+ }
+ }
+
+ void intersect(const BasicRange& rRange)
+ {
+ // here, overlaps also tests all isEmpty() conditions already.
+ if( !overlaps( rRange ) )
+ {
+ reset();
+ }
+ else
+ {
+ if(rRange.mnMinimum > mnMinimum)
+ {
+ mnMinimum = rRange.mnMinimum;
+ }
+
+ if(rRange.mnMaximum < mnMaximum)
+ {
+ mnMaximum = rRange.mnMaximum;
+ }
+ }
+ }
+
+ void grow(T nValue)
+ {
+ if(!isEmpty())
+ {
+ bool bLessThanZero(nValue < 0);
+
+ if(nValue > 0 || bLessThanZero)
+ {
+ mnMinimum -= nValue;
+ mnMaximum += nValue;
+
+ if(bLessThanZero)
+ {
+ // test if range did collapse
+ if(mnMinimum > mnMaximum)
+ {
+ // if yes, collapse to center
+ mnMinimum = mnMaximum = (mnMinimum + mnMaximum) / 2;
+ }
+ }
+ }
+ }
+ }
+
+ typename Traits::DifferenceType getRange() const
+ {
+ if(isEmpty())
+ {
+ return Traits::neutral();
+ }
+ else
+ {
+ return (mnMaximum - mnMinimum);
+ }
+ }
+ };
+
+ // some pre-fabricated traits
+ struct DoubleTraits
+ {
+ static double minVal() { return DBL_MIN; };
+ static double maxVal() { return DBL_MAX; };
+ static double neutral() { return 0.0; };
+
+ typedef double DifferenceType;
+ };
+
+ struct Int32Traits
+ {
+ static sal_Int32 minVal() { return SAL_MIN_INT32; };
+ static sal_Int32 maxVal() { return SAL_MAX_INT32; };
+ static sal_Int32 neutral() { return 0L; };
+
+ typedef sal_Int64 DifferenceType;
+ };
+
+} // end of namespace basegfx
+
+#endif /* _BGFX_RANGE_BASICRANGE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/raster/bpixelraster.hxx b/include/basegfx/raster/bpixelraster.hxx
new file mode 100644
index 000000000000..ed7ac931d805
--- /dev/null
+++ b/include/basegfx/raster/bpixelraster.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 _BGFX_RASTER_BPIXELRASTER_HXX
+#define _BGFX_RASTER_BPIXELRASTER_HXX
+
+#include <algorithm>
+#include <string.h>
+#include <sal/types.h>
+#include <basegfx/pixel/bpixel.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ class BPixelRaster
+ {
+ private:
+ // do not allow copy constructor and assignment operator
+ BPixelRaster(const BPixelRaster&);
+ BPixelRaster& operator=(const BPixelRaster&);
+
+ protected:
+ sal_uInt32 mnWidth;
+ sal_uInt32 mnHeight;
+ sal_uInt32 mnCount;
+ BPixel* mpContent;
+
+ public:
+ // reset
+ void reset()
+ {
+ memset(mpContent, 0, sizeof(BPixel) * mnCount);
+ }
+
+ // constructor/destructor
+ BPixelRaster(sal_uInt32 nWidth, sal_uInt32 nHeight)
+ : mnWidth(nWidth),
+ mnHeight(nHeight),
+ mnCount(nWidth * nHeight),
+ mpContent(new BPixel[mnCount])
+ {
+ reset();
+ }
+
+ ~BPixelRaster()
+ {
+ delete [] mpContent;
+ }
+
+ // coordinate calcs between X/Y and span
+ sal_uInt32 getIndexFromXY(sal_uInt32 nX, sal_uInt32 nY) const { return (nX + (nY * mnWidth)); }
+ sal_uInt32 getXFromIndex(sal_uInt32 nIndex) const { return (nIndex % mnWidth); }
+ sal_uInt32 getYFromIndex(sal_uInt32 nIndex) const { return (nIndex / mnWidth); }
+
+ // data access read
+ sal_uInt32 getWidth() const { return mnWidth; }
+ sal_uInt32 getHeight() const { return mnHeight; }
+ sal_uInt32 getCount() const { return mnCount; }
+
+ // data access read only
+ const BPixel& getBPixel(sal_uInt32 nIndex) const
+ {
+ assert(nIndex < mnCount); //Access out of range
+ return mpContent[nIndex];
+ }
+
+ // data access read/write
+ BPixel& getBPixel(sal_uInt32 nIndex)
+ {
+ assert(nIndex < mnCount); //Access out of range
+ return mpContent[nIndex];
+ }
+ };
+} // end of namespace basegfx
+
+#endif /* _BGFX_RASTER_BPIXELRASTER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/raster/bzpixelraster.hxx b/include/basegfx/raster/bzpixelraster.hxx
new file mode 100644
index 000000000000..ddd4f1e56cb0
--- /dev/null
+++ b/include/basegfx/raster/bzpixelraster.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_RASTER_BZPIXELRASTER_HXX
+#define _BGFX_RASTER_BZPIXELRASTER_HXX
+
+#include <basegfx/raster/bpixelraster.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ class BZPixelRaster : public BPixelRaster
+ {
+ protected:
+ // additionally, host a ZBuffer
+ sal_uInt16* mpZBuffer;
+
+ public:
+ // reset
+ void resetZ()
+ {
+ reset();
+ memset(mpZBuffer, 0, sizeof(sal_uInt16) * mnCount);
+ }
+
+ // constructor/destructor
+ BZPixelRaster(sal_uInt32 nWidth, sal_uInt32 nHeight)
+ : BPixelRaster(nWidth, nHeight),
+ mpZBuffer(new sal_uInt16[mnCount])
+ {
+ memset(mpZBuffer, 0, sizeof(sal_uInt16) * mnCount);
+ }
+
+ ~BZPixelRaster()
+ {
+ delete [] mpZBuffer;
+ }
+
+ // data access read only
+ const sal_uInt16& getZ(sal_uInt32 nIndex) const
+ {
+#ifdef DBG_UTIL
+ if(nIndex >= mnCount)
+ {
+ OSL_FAIL("getZ: Access out of range (!)");
+ return mpZBuffer[0L];
+ }
+#endif
+ return mpZBuffer[nIndex];
+ }
+
+ // data access read/write
+ sal_uInt16& getZ(sal_uInt32 nIndex)
+ {
+#ifdef DBG_UTIL
+ if(nIndex >= mnCount)
+ {
+ OSL_FAIL("getZ: Access out of range (!)");
+ return mpZBuffer[0L];
+ }
+#endif
+ return mpZBuffer[nIndex];
+ }
+ };
+} // end of namespace basegfx
+
+#endif /* _BGFX_RASTER_BZPIXELRASTER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/raster/rasterconvert3d.hxx b/include/basegfx/raster/rasterconvert3d.hxx
new file mode 100644
index 000000000000..1bfbe20b1cf0
--- /dev/null
+++ b/include/basegfx/raster/rasterconvert3d.hxx
@@ -0,0 +1,340 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_RASTER_RASTERCONVERT3D_HXX
+#define _BGFX_RASTER_RASTERCONVERT3D_HXX
+
+#include <sal/types.h>
+#include <vector>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/vector/b3dvector.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace basegfx
+{
+ class B3DPolygon;
+ class B3DPolyPolygon;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// interpolators for double precision
+
+namespace basegfx
+{
+ class ip_single
+ {
+ private:
+ double mfVal;
+ double mfInc;
+
+ public:
+ ip_single()
+ : mfVal(0.0),
+ mfInc(0.0)
+ {}
+
+ ip_single(double fVal, double fInc)
+ : mfVal(fVal),
+ mfInc(fInc)
+ {}
+
+ double getVal() const { return mfVal; }
+ double getInc() const { return mfInc; }
+
+ void increment(double fStep) { mfVal += fStep * mfInc; }
+ };
+} // end of namespace basegfx
+
+namespace basegfx
+{
+ class ip_double
+ {
+ private:
+ ip_single maX;
+ ip_single maY;
+
+ public:
+ ip_double()
+ : maX(),
+ maY()
+ {}
+
+ ip_double(double fXVal, double fXInc, double fYVal, double fYInc)
+ : maX(fXVal, fXInc),
+ maY(fYVal, fYInc)
+ {}
+
+ const ip_single& getX() const { return maX; }
+ const ip_single& getY() const { return maY; }
+
+ void increment(double fStep) { maX.increment(fStep); maY.increment(fStep); }
+ };
+} // end of namespace basegfx
+
+namespace basegfx
+{
+ class ip_triple
+ {
+ private:
+ ip_single maX;
+ ip_single maY;
+ ip_single maZ;
+
+ public:
+ ip_triple()
+ : maX(),
+ maY(),
+ maZ()
+ {}
+
+ ip_triple(double fXVal, double fXInc, double fYVal, double fYInc, double fZVal, double fZInc)
+ : maX(fXVal, fXInc),
+ maY(fYVal, fYInc),
+ maZ(fZVal, fZInc)
+ {}
+
+ const ip_single& getX() const { return maX; }
+ const ip_single& getY() const { return maY; }
+ const ip_single& getZ() const { return maZ; }
+
+ void increment(double fStep) { maX.increment(fStep); maY.increment(fStep); maZ.increment(fStep); }
+ };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+// InterpolatorProvider3D to have a common source for allocating interpolators
+// which may then be addressed using the index to the vectors
+
+namespace basegfx
+{
+ #define SCANLINE_EMPTY_INDEX (0xffffffff)
+
+ class InterpolatorProvider3D
+ {
+ private:
+ ::std::vector< ip_triple > maColorInterpolators;
+ ::std::vector< ip_triple > maNormalInterpolators;
+ ::std::vector< ip_double > maTextureInterpolators;
+ ::std::vector< ip_triple > maInverseTextureInterpolators;
+
+ protected:
+ sal_uInt32 addColorInterpolator(const BColor& rA, const BColor& rB, double fInvYDelta)
+ {
+ B3DVector aDelta(rB.getRed() - rA.getRed(), rB.getGreen() - rA.getGreen(), rB.getBlue() - rA.getBlue());
+ aDelta *= fInvYDelta;
+ maColorInterpolators.push_back(ip_triple(rA.getRed(), aDelta.getX(), rA.getGreen(), aDelta.getY(), rA.getBlue(), aDelta.getZ()));
+ return (maColorInterpolators.size() - 1L);
+ }
+
+ sal_uInt32 addNormalInterpolator(const B3DVector& rA, const B3DVector& rB, double fInvYDelta)
+ {
+ B3DVector aDelta(rB.getX() - rA.getX(), rB.getY() - rA.getY(), rB.getZ() - rA.getZ());
+ aDelta *= fInvYDelta;
+ maNormalInterpolators.push_back(ip_triple(rA.getX(), aDelta.getX(), rA.getY(), aDelta.getY(), rA.getZ(), aDelta.getZ()));
+ return (maNormalInterpolators.size() - 1L);
+ }
+
+ sal_uInt32 addTextureInterpolator(const B2DPoint& rA, const B2DPoint& rB, double fInvYDelta)
+ {
+ B2DVector aDelta(rB.getX() - rA.getX(), rB.getY() - rA.getY());
+ aDelta *= fInvYDelta;
+ maTextureInterpolators.push_back(ip_double(rA.getX(), aDelta.getX(), rA.getY(), aDelta.getY()));
+ return (maTextureInterpolators.size() - 1L);
+ }
+
+ sal_uInt32 addInverseTextureInterpolator(const B2DPoint& rA, const B2DPoint& rB, double fZEyeA, double fZEyeB, double fInvYDelta)
+ {
+ const double fInvZEyeA(fTools::equalZero(fZEyeA) ? fZEyeA : 1.0 / fZEyeA);
+ const double fInvZEyeB(fTools::equalZero(fZEyeB) ? fZEyeB : 1.0 / fZEyeB);
+ const B2DPoint aInvA(rA * fInvZEyeA);
+ const B2DPoint aInvB(rB * fInvZEyeB);
+ double fZDelta(fInvZEyeB - fInvZEyeA);
+ B2DVector aDelta(aInvB.getX() - aInvA.getX(), aInvB.getY() - aInvA.getY());
+
+ fZDelta *= fInvYDelta;
+ aDelta *= fInvYDelta;
+
+ maInverseTextureInterpolators.push_back(ip_triple(aInvA.getX(), aDelta.getX(), aInvA.getY(), aDelta.getY(), fInvZEyeA, fZDelta));
+ return (maInverseTextureInterpolators.size() - 1L);
+ }
+
+ void reset()
+ {
+ maColorInterpolators.clear();
+ maNormalInterpolators.clear();
+ maTextureInterpolators.clear();
+ maInverseTextureInterpolators.clear();
+ }
+
+ public:
+ InterpolatorProvider3D() {}
+
+ ::std::vector< ip_triple >& getColorInterpolators() { return maColorInterpolators; }
+ ::std::vector< ip_triple >& getNormalInterpolators() { return maNormalInterpolators; }
+ ::std::vector< ip_double >& getTextureInterpolators() { return maTextureInterpolators; }
+ ::std::vector< ip_triple >& getInverseTextureInterpolators() { return maInverseTextureInterpolators; }
+ };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+// RasterConversionLineEntry3D for Raterconversion of 3D PolyPolygons
+
+namespace basegfx
+{
+ class RasterConversionLineEntry3D
+ {
+ private:
+ ip_single maX;
+ ip_single maZ;
+ sal_Int32 mnY;
+ sal_uInt32 mnCount;
+
+ sal_uInt32 mnColorIndex;
+ sal_uInt32 mnNormalIndex;
+ sal_uInt32 mnTextureIndex;
+ sal_uInt32 mnInverseTextureIndex;
+
+ public:
+ RasterConversionLineEntry3D(const double& rfX, const double& rfDeltaX, const double& rfZ, const double& rfDeltaZ, sal_Int32 nY, sal_uInt32 nCount)
+ : maX(rfX, rfDeltaX),
+ maZ(rfZ, rfDeltaZ),
+ mnY(nY),
+ mnCount(nCount),
+ mnColorIndex(SCANLINE_EMPTY_INDEX),
+ mnNormalIndex(SCANLINE_EMPTY_INDEX),
+ mnTextureIndex(SCANLINE_EMPTY_INDEX),
+ mnInverseTextureIndex(SCANLINE_EMPTY_INDEX)
+ {}
+
+ void setColorIndex(sal_uInt32 nIndex) { mnColorIndex = nIndex; }
+ void setNormalIndex(sal_uInt32 nIndex) { mnNormalIndex = nIndex; }
+ void setTextureIndex(sal_uInt32 nIndex) { mnTextureIndex = nIndex; }
+ void setInverseTextureIndex(sal_uInt32 nIndex) { mnInverseTextureIndex = nIndex; }
+
+ bool operator<(const RasterConversionLineEntry3D& rComp) const
+ {
+ if(mnY == rComp.mnY)
+ {
+ return maX.getVal() < rComp.maX.getVal();
+ }
+
+ return mnY < rComp.mnY;
+ }
+
+ bool decrementRasterConversionLineEntry3D(sal_uInt32 nStep)
+ {
+ if(nStep >= mnCount)
+ {
+ return false;
+ }
+ else
+ {
+ mnCount -= nStep;
+ return true;
+ }
+ }
+
+ void incrementRasterConversionLineEntry3D(sal_uInt32 nStep, InterpolatorProvider3D& rProvider)
+ {
+ const double fStep((double)nStep);
+ maX.increment(fStep);
+ maZ.increment(fStep);
+ mnY += nStep;
+
+ if(SCANLINE_EMPTY_INDEX != mnColorIndex)
+ {
+ rProvider.getColorInterpolators()[mnColorIndex].increment(fStep);
+ }
+
+ if(SCANLINE_EMPTY_INDEX != mnNormalIndex)
+ {
+ rProvider.getNormalInterpolators()[mnNormalIndex].increment(fStep);
+ }
+
+ if(SCANLINE_EMPTY_INDEX != mnTextureIndex)
+ {
+ rProvider.getTextureInterpolators()[mnTextureIndex].increment(fStep);
+ }
+
+ if(SCANLINE_EMPTY_INDEX != mnInverseTextureIndex)
+ {
+ rProvider.getInverseTextureInterpolators()[mnInverseTextureIndex].increment(fStep);
+ }
+ }
+
+ // data read access
+ const ip_single& getX() const { return maX; }
+ sal_Int32 getY() const { return mnY; }
+ const ip_single& getZ() const { return maZ; }
+ sal_uInt32 getColorIndex() const { return mnColorIndex; }
+ sal_uInt32 getNormalIndex() const { return mnNormalIndex; }
+ sal_uInt32 getTextureIndex() const { return mnTextureIndex; }
+ sal_uInt32 getInverseTextureIndex() const { return mnInverseTextureIndex; }
+ };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+// the basic RaterConverter itself. Only one method needs to be overloaded. The
+// class itself is strictly virtual
+
+namespace basegfx
+{
+ class BASEGFX_DLLPUBLIC RasterConverter3D : public InterpolatorProvider3D
+ {
+ private:
+ // the line entries for an area conversion run
+ ::std::vector< RasterConversionLineEntry3D > maLineEntries;
+
+ struct lineComparator
+ {
+ bool operator()(const RasterConversionLineEntry3D* pA, const RasterConversionLineEntry3D* pB)
+ {
+ OSL_ENSURE(pA && pB, "lineComparator: empty pointer (!)");
+ return pA->getX().getVal() < pB->getX().getVal();
+ }
+ };
+
+ void addArea(const B3DPolygon& rFill, const B3DHomMatrix* pViewToEye);
+ void addArea(const B3DPolyPolygon& rFill, const B3DHomMatrix* pViewToEye);
+ void addEdge(const B3DPolygon& rFill, sal_uInt32 a, sal_uInt32 b, const B3DHomMatrix* pViewToEye);
+
+ void rasterconvertB3DArea(sal_Int32 nStartLine, sal_Int32 nStopLine);
+ void rasterconvertB3DEdge(const B3DPolygon& rLine, sal_uInt32 nA, sal_uInt32 nB, sal_Int32 nStartLine, sal_Int32 nStopLine, sal_uInt16 nLineWidth);
+
+ virtual void processLineSpan(const RasterConversionLineEntry3D& rA, const RasterConversionLineEntry3D& rB, sal_Int32 nLine, sal_uInt32 nSpanCount) = 0;
+
+ public:
+ RasterConverter3D();
+ virtual ~RasterConverter3D();
+
+ void rasterconvertB3DPolyPolygon(const B3DPolyPolygon& rFill, const B3DHomMatrix* pViewToEye, sal_Int32 nStartLine, sal_Int32 nStopLine);
+ void rasterconvertB3DPolygon(const B3DPolygon& rLine, sal_Int32 nStartLine, sal_Int32 nStopLine, sal_uInt16 nLineWidth);
+ };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif /* _BGFX_RASTER_RASTERCONVERT3D_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tools/b2dclipstate.hxx b/include/basegfx/tools/b2dclipstate.hxx
new file mode 100644
index 000000000000..f1d750ae636b
--- /dev/null
+++ b/include/basegfx/tools/b2dclipstate.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 _BGFX_TOOLS_CLIPSTATE_HXX
+#define _BGFX_TOOLS_CLIPSTATE_HXX
+
+#include <sal/types.h>
+#include <o3tl/cow_wrapper.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ class B2DRange;
+ class B2DPolyRange;
+ class B2DPolygon;
+ class B2DPolyPolygon;
+
+ namespace tools
+ {
+ class ImplB2DClipState;
+
+ /** This class provides an optimized, symbolic clip state for graphical output
+
+ Having a current 'clip' state is a common attribute of
+ almost all graphic output APIs, most of which internally
+ represent it via a list of rectangular bands. In contrast,
+ this implementation purely uses symbolic clips, but in a
+ quite efficient manner, deferring actual evaluation until
+ a clip representation is requested, and using faster code
+ paths for common special cases (like all-rectangle clips)
+ */
+ class BASEGFX_DLLPUBLIC B2DClipState
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImplB2DClipState > ImplType;
+
+ private:
+ ImplType mpImpl;
+
+ public:
+ /// Init clip, in 'cleared' state - everything is visible
+ B2DClipState();
+ ~B2DClipState();
+ B2DClipState( const B2DClipState& );
+ explicit B2DClipState( const B2DPolyPolygon& );
+ B2DClipState& operator=( const B2DClipState& );
+
+ /// Set clip to 'null' - nothing is visible
+ void makeNull();
+
+ /// returns true when clip is 'cleared' - everything is visible
+ bool isCleared() const;
+
+ bool operator==(const B2DClipState&) const;
+ bool operator!=(const B2DClipState&) const;
+
+ void unionRange(const B2DRange& );
+ void unionPolyPolygon(const B2DPolyPolygon& );
+
+ void intersectRange(const B2DRange& );
+ void intersectPolyPolygon(const B2DPolyPolygon& );
+
+ void subtractRange(const B2DRange& );
+ void subtractPolyPolygon(const B2DPolyPolygon& );
+
+ void xorRange(const B2DRange& );
+ void xorPolyPolygon(const B2DPolyPolygon& );
+
+ B2DPolyPolygon getClipPoly() const;
+ };
+ }
+}
+
+#endif // _BGFX_TOOLS_CLIPSTATE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tools/canvastools.hxx b/include/basegfx/tools/canvastools.hxx
new file mode 100644
index 000000000000..819a62e47b28
--- /dev/null
+++ b/include/basegfx/tools/canvastools.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 _BGFX_TOOLS_CANVASTOOLS_HXX
+#define _BGFX_TOOLS_CANVASTOOLS_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+
+namespace com { namespace sun { namespace star { namespace geometry
+{
+ struct AffineMatrix2D;
+ struct AffineMatrix3D;
+ struct Matrix2D;
+ struct RealPoint2D;
+ struct RealSize2D;
+ struct RealRectangle2D;
+ struct RealRectangle3D;
+ struct IntegerPoint2D;
+ struct IntegerSize2D;
+ struct IntegerRectangle2D;
+ struct RealBezierSegment2D;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace rendering
+{
+ class XGraphicDevice;
+ class XPolyPolygon2D;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace awt
+{
+ struct Point;
+ struct Size;
+ struct Rectangle;
+} } } }
+
+namespace basegfx
+{
+ class B2DHomMatrix;
+ class B3DHomMatrix;
+ class B2DVector;
+ class B2DPoint;
+ class B2DRange;
+ class B3DRange;
+ class B2IBox;
+ class B2IVector;
+ class B2IPoint;
+ class B2IRange;
+ class B2DPolygon;
+ class B2DPolyPolygon;
+
+ namespace unotools
+ {
+ // Polygon conversions
+ // ===================================================================
+
+ BASEGFX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >
+ xPolyPolygonFromB2DPolygon( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice,
+ const ::basegfx::B2DPolygon& rPoly );
+
+ BASEGFX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >
+ xPolyPolygonFromB2DPolyPolygon( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice,
+ const ::basegfx::B2DPolyPolygon& rPolyPoly );
+
+
+ BASEGFX_DLLPUBLIC ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::geometry::RealBezierSegment2D > >
+ bezierSequenceSequenceFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly );
+
+ BASEGFX_DLLPUBLIC ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::geometry::RealPoint2D > >
+ pointSequenceSequenceFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly );
+
+ BASEGFX_DLLPUBLIC ::basegfx::B2DPolygon polygonFromPoint2DSequence(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::geometry::RealPoint2D >& rPoints );
+
+ BASEGFX_DLLPUBLIC ::basegfx::B2DPolyPolygon polyPolygonFromPoint2DSequenceSequence(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > >& rPoints );
+
+ BASEGFX_DLLPUBLIC ::basegfx::B2DPolygon polygonFromBezier2DSequence(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::geometry::RealBezierSegment2D >& rPoints );
+
+ BASEGFX_DLLPUBLIC ::basegfx::B2DPolyPolygon polyPolygonFromBezier2DSequenceSequence(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& rPoints );
+
+ BASEGFX_DLLPUBLIC ::basegfx::B2DPolyPolygon b2DPolyPolygonFromXPolyPolygon2D(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XPolyPolygon2D >& rPoly );
+
+ // Matrix conversions
+ // ===================================================================
+
+ BASEGFX_DLLPUBLIC ::com::sun::star::geometry::AffineMatrix2D&
+ affineMatrixFromHomMatrix( ::com::sun::star::geometry::AffineMatrix2D& matrix,
+ const ::basegfx::B2DHomMatrix& transform);
+
+ BASEGFX_DLLPUBLIC ::com::sun::star::geometry::AffineMatrix3D& affineMatrixFromHomMatrix3D(
+ ::com::sun::star::geometry::AffineMatrix3D& matrix,
+ const ::basegfx::B3DHomMatrix& transform);
+
+ BASEGFX_DLLPUBLIC ::basegfx::B2DHomMatrix&
+ homMatrixFromAffineMatrix( ::basegfx::B2DHomMatrix& transform,
+ const ::com::sun::star::geometry::AffineMatrix2D& matrix );
+
+ BASEGFX_DLLPUBLIC ::basegfx::B3DHomMatrix homMatrixFromAffineMatrix3D( const ::com::sun::star::geometry::AffineMatrix3D& matrix );
+
+ BASEGFX_DLLPUBLIC ::com::sun::star::geometry::Matrix2D&
+ matrixFromHomMatrix( ::com::sun::star::geometry::Matrix2D& matrix,
+ const ::basegfx::B2DHomMatrix& transform);
+
+ BASEGFX_DLLPUBLIC ::basegfx::B2DHomMatrix&
+ homMatrixFromMatrix( ::basegfx::B2DHomMatrix& transform,
+ const ::com::sun::star::geometry::Matrix2D& matrix );
+
+ // Geometry conversions
+ // ===================================================================
+
+ BASEGFX_DLLPUBLIC ::com::sun::star::geometry::RealSize2D size2DFromB2DSize( const ::basegfx::B2DVector& );
+ BASEGFX_DLLPUBLIC ::com::sun::star::geometry::RealPoint2D point2DFromB2DPoint( const ::basegfx::B2DPoint& );
+ BASEGFX_DLLPUBLIC ::com::sun::star::geometry::RealRectangle2D rectangle2DFromB2DRectangle( const ::basegfx::B2DRange& );
+ BASEGFX_DLLPUBLIC ::com::sun::star::geometry::RealRectangle3D rectangle3DFromB3DRectangle( const ::basegfx::B3DRange& );
+
+ BASEGFX_DLLPUBLIC ::basegfx::B2DPoint b2DPointFromRealPoint2D( const ::com::sun::star::geometry::RealPoint2D& );
+ BASEGFX_DLLPUBLIC ::basegfx::B2DRange b2DRectangleFromRealRectangle2D( const ::com::sun::star::geometry::RealRectangle2D& );
+ BASEGFX_DLLPUBLIC ::basegfx::B3DRange b3DRectangleFromRealRectangle3D( const ::com::sun::star::geometry::RealRectangle3D& );
+
+ BASEGFX_DLLPUBLIC ::com::sun::star::geometry::IntegerSize2D integerSize2DFromB2ISize( const ::basegfx::B2IVector& );
+
+ BASEGFX_DLLPUBLIC ::basegfx::B2IVector b2ISizeFromIntegerSize2D( const ::com::sun::star::geometry::IntegerSize2D& );
+ BASEGFX_DLLPUBLIC ::basegfx::B2IRange b2IRectangleFromIntegerRectangle2D( const ::com::sun::star::geometry::IntegerRectangle2D& );
+
+ BASEGFX_DLLPUBLIC ::basegfx::B2IRange b2IRectangleFromAwtRectangle( const ::com::sun::star::awt::Rectangle& );
+
+ // Geometry comparisons
+ // ===================================================================
+
+ /** Return smalltest integer range, which completely contains
+ given floating point range.
+
+ @param rRange
+ Input range. Values must be within the representable
+ bounds of sal_Int32
+
+ @return the closest integer range, which completely
+ contains rRange.
+ */
+ BASEGFX_DLLPUBLIC ::basegfx::B2IRange b2ISurroundingRangeFromB2DRange( const ::basegfx::B2DRange& rRange );
+
+ /** Return smalltest integer box, which completely contains
+ given floating point range.
+
+ @param rRange
+ Input range. Values must be within the representable
+ bounds of sal_Int32
+
+ @return the closest integer box, which completely contains
+ rRange. Note that this box will contain all pixel affected
+ by a polygon fill operation over the input range.
+ */
+ BASEGFX_DLLPUBLIC ::basegfx::B2IBox b2ISurroundingBoxFromB2DRange( const ::basegfx::B2DRange& rRange );
+
+ /** Return smalltest B2DRange with integer values, which
+ completely contains given floating point range.
+
+ @param rRange
+ Input range.
+
+ @return the closest B2DRange with integer coordinates,
+ which completely contains rRange.
+ */
+ BASEGFX_DLLPUBLIC ::basegfx::B2DRange b2DSurroundingIntegerRangeFromB2DRange( const ::basegfx::B2DRange& rRange );
+
+ }
+}
+
+#endif /* _BGFX_TOOLS_CANVASTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tools/gradienttools.hxx b/include/basegfx/tools/gradienttools.hxx
new file mode 100644
index 000000000000..aa7479d2c369
--- /dev/null
+++ b/include/basegfx/tools/gradienttools.hxx
@@ -0,0 +1,405 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_TOOLS_GRADIENTTOOLS_HXX
+#define _BGFX_TOOLS_GRADIENTTOOLS_HXX
+
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+#include <vector>
+#include <algorithm>
+
+namespace basegfx
+{
+ /** Gradient definition as used in ODF 1.2
+
+ This struct collects all data necessary for rendering ODF
+ 1.2-compatible gradients. Use the createXXXODFGradientInfo()
+ methods below for initializing from ODF attributes.
+ */
+ struct BASEGFX_DLLPUBLIC ODFGradientInfo
+ {
+ /** transformation mapping from [0,1]^2 texture coordinate
+ space to [0,1]^2 shape coordinate space
+ */
+ B2DHomMatrix maTextureTransform;
+
+ /** transformation mapping from [0,1]^2 shape coordinate space
+ to [0,1]^2 texture coordinate space. This is the
+ transformation commonly used to create gradients from a
+ scanline rasterizer (put shape u/v coordinates into it, get
+ texture s/t coordinates out of it)
+ */
+ B2DHomMatrix maBackTextureTransform;
+
+ /** Aspect ratio of the gradient. Only used in drawinglayer
+ for generating nested gradient polygons currently. Already
+ catered for in the transformations above.
+ */
+ double mfAspectRatio;
+
+ /** Requested gradient steps to render. See the
+ implementations of the getXXXGradientAlpha() methods below,
+ the semantic differs slightly for the different gradient
+ types.
+ */
+ sal_uInt32 mnSteps;
+ };
+
+ namespace tools
+ {
+ /** Create matrix for ODF's linear gradient definition
+
+ Note that odf linear gradients are varying in y direction.
+
+ @param o_rGradientInfo
+ Receives the calculated texture transformation matrix (for
+ use with standard [0,1]x[0,1] texture coordinates)
+
+ @param rTargetArea
+ Output area, needed for aspect ratio calculations and
+ texture transformation
+
+ @param nSteps
+ Number of gradient steps (from ODF)
+
+ @param fBorder
+ Width of gradient border (from ODF)
+
+ @param fAngle
+ Gradient angle (from ODF)
+ */
+ BASEGFX_DLLPUBLIC ODFGradientInfo& createLinearODFGradientInfo(ODFGradientInfo& o_rGradientInfo,
+ const B2DRange& rTargetArea,
+ sal_uInt32 nSteps,
+ double fBorder,
+ double fAngle);
+
+ /** Calculate linear gradient blend value
+
+ This method generates you the lerp alpha value for
+ blending linearly between gradient start and end color,
+ according to the formula (startCol*(1.0-alpha) + endCol*alpha)
+
+ @param rUV
+ Current uv coordinate. Values outside [0,1] will be
+ clamped. Assumes gradient color varies along the y axis.
+
+ @param rGradInfo
+ Gradient info, for transformation and number of steps
+ */
+ inline double getLinearGradientAlpha(const B2DPoint& rUV,
+ const ODFGradientInfo& rGradInfo )
+ {
+ const B2DPoint aCoor(rGradInfo.maBackTextureTransform * rUV);
+ const double t(clamp(aCoor.getY(), 0.0, 1.0));
+ const sal_uInt32 nSteps(rGradInfo.mnSteps);
+
+ if(nSteps > 2L && nSteps < 128L)
+ return floor(t * nSteps) / double(nSteps + 1L);
+
+ return t;
+ }
+
+ /** Create matrix for ODF's axial gradient definition
+
+ Note that odf axial gradients are varying in y
+ direction. Note further that you can map the axial
+ gradient to a linear gradient (in case you want or need to
+ avoid an extra gradient renderer), by using
+ createLinearODFGradientInfo() instead, shifting the
+ resulting texture transformation by 0.5 to the top and
+ appending the same stop colors again, but mirrored.
+
+ @param o_rGradientInfo
+ Receives the calculated texture transformation matrix (for
+ use with standard [0,1]x[0,1] texture coordinates)
+
+ @param rTargetArea
+ Output area, needed for aspect ratio calculations and
+ texture transformation
+
+ @param nSteps
+ Number of gradient steps (from ODF)
+
+ @param fBorder
+ Width of gradient border (from ODF)
+
+ @param fAngle
+ Gradient angle (from ODF)
+ */
+ BASEGFX_DLLPUBLIC ODFGradientInfo& createAxialODFGradientInfo(ODFGradientInfo& o_rGradientInfo,
+ const B2DRange& rTargetArea,
+ sal_uInt32 nSteps,
+ double fBorder,
+ double fAngle);
+
+ /** Calculate axial gradient blend value
+
+ This method generates you the lerp alpha value for
+ blending linearly between gradient start and end color,
+ according to the formula (startCol*(1.0-alpha) + endCol*alpha)
+
+ @param rUV
+ Current uv coordinate. Values outside [0,1] will be
+ clamped. Assumes gradient color varies along the y axis.
+
+ @param rGradInfo
+ Gradient info, for transformation and number of steps
+ */
+ inline double getAxialGradientAlpha(const B2DPoint& rUV,
+ const ODFGradientInfo& rGradInfo )
+ {
+ const B2DPoint aCoor(rGradInfo.maBackTextureTransform * rUV);
+ const double t(clamp(fabs(aCoor.getY()), 0.0, 1.0));
+ const sal_uInt32 nSteps(rGradInfo.mnSteps);
+ const double fInternalSteps((nSteps * 2L) - 1L);
+
+ if(nSteps > 2L && nSteps < 128L)
+ return floor(((t * fInternalSteps) + 1.0) / 2.0) / double(nSteps - 1L);
+
+ return t;
+ }
+
+ /** Create matrix for ODF's radial gradient definition
+
+ @param o_rGradientInfo
+ Receives the calculated texture transformation matrix (for
+ use with standard [0,1]x[0,1] texture coordinates)
+
+ @param rTargetArea
+ Output area, needed for aspect ratio calculations and
+ texture transformation
+
+ @param rOffset
+ Gradient offset value (from ODF)
+
+ @param nSteps
+ Number of gradient steps (from ODF)
+
+ @param fBorder
+ Width of gradient border (from ODF)
+
+ @param fAngle
+ Gradient angle (from ODF)
+ */
+ BASEGFX_DLLPUBLIC ODFGradientInfo& createRadialODFGradientInfo(ODFGradientInfo& o_rGradientInfo,
+ const B2DRange& rTargetArea,
+ const B2DVector& rOffset,
+ sal_uInt32 nSteps,
+ double fBorder);
+
+ /** Calculate radial gradient blend value
+
+ This method generates you the lerp alpha value for
+ blending linearly between gradient start and end color,
+ according to the formula (startCol*(1.0-alpha) + endCol*alpha)
+
+ @param rUV
+ Current uv coordinate. Values outside [0,1] will be
+ clamped.
+
+ @param rGradInfo
+ Gradient info, for transformation and number of steps
+ */
+ inline double getRadialGradientAlpha(const B2DPoint& rUV,
+ const ODFGradientInfo& rGradInfo )
+ {
+ const B2DPoint aCoor(rGradInfo.maBackTextureTransform * rUV);
+ const double fDist(
+ clamp(aCoor.getX() * aCoor.getX() + aCoor.getY() * aCoor.getY(),
+ 0.0,
+ 1.0));
+
+ const double t(1.0 - sqrt(fDist));
+ const sal_uInt32 nSteps(rGradInfo.mnSteps);
+
+ if(nSteps > 2L && nSteps < 128L)
+ return floor(t * nSteps) / double(nSteps - 1L);
+
+ return t;
+ }
+
+ /** Create matrix for ODF's elliptical gradient definition
+
+ @param o_rGradientInfo
+ Receives the calculated texture transformation matrix (for
+ use with standard [0,1]x[0,1] texture coordinates)
+
+ @param rTargetArea
+ Output area, needed for aspect ratio calculations and
+ texture transformation
+
+ @param rOffset
+ Gradient offset value (from ODF)
+
+ @param nSteps
+ Number of gradient steps (from ODF)
+
+ @param fBorder
+ Width of gradient border (from ODF)
+
+ @param fAngle
+ Gradient angle (from ODF)
+ */
+ BASEGFX_DLLPUBLIC ODFGradientInfo& createEllipticalODFGradientInfo(ODFGradientInfo& o_rGradientInfo,
+ const B2DRange& rTargetArea,
+ const B2DVector& rOffset,
+ sal_uInt32 nSteps,
+ double fBorder,
+ double fAngle);
+
+ /** Calculate elliptical gradient blend value
+
+ This method generates you the lerp alpha value for
+ blending linearly between gradient start and end color,
+ according to the formula (startCol*(1.0-alpha) + endCol*alpha)
+
+ @param rUV
+ Current uv coordinate. Values outside [0,1] will be
+ clamped.
+
+ @param rGradInfo
+ Gradient info, for transformation and number of steps
+ */
+ inline double getEllipticalGradientAlpha(const B2DPoint& rUV,
+ const ODFGradientInfo& rGradInfo )
+ {
+ return getRadialGradientAlpha(rUV,rGradInfo); // only matrix setup differs
+ }
+
+ /** Create matrix for ODF's square gradient definition
+
+ @param o_rGradientInfo
+ Receives the calculated texture transformation matrix (for
+ use with standard [0,1]x[0,1] texture coordinates)
+
+ @param rTargetArea
+ Output area, needed for aspect ratio calculations and
+ texture transformation
+
+ @param rOffset
+ Gradient offset value (from ODF)
+
+ @param nSteps
+ Number of gradient steps (from ODF)
+
+ @param fBorder
+ Width of gradient border (from ODF)
+
+ @param fAngle
+ Gradient angle (from ODF)
+ */
+ BASEGFX_DLLPUBLIC ODFGradientInfo& createSquareODFGradientInfo(ODFGradientInfo& o_rGradientInfo,
+ const B2DRange& rTargetArea,
+ const B2DVector& rOffset,
+ sal_uInt32 nSteps,
+ double fBorder,
+ double fAngle);
+
+ /** Calculate square gradient blend value
+
+ This method generates you the lerp alpha value for
+ blending linearly between gradient start and end color,
+ according to the formula (startCol*(1.0-alpha) + endCol*alpha)
+
+ @param rUV
+ Current uv coordinate. Values outside [0,1] will be
+ clamped.
+
+ @param rGradInfo
+ Gradient info, for transformation and number of steps
+ */
+ inline double getSquareGradientAlpha(const B2DPoint& rUV,
+ const ODFGradientInfo& rGradInfo )
+ {
+ const B2DPoint aCoor(rGradInfo.maBackTextureTransform * rUV);
+ const double fAbsX(fabs(aCoor.getX()));
+ const double fAbsY(fabs(aCoor.getY()));
+
+ if(fTools::moreOrEqual(fAbsX, 1.0) || fTools::moreOrEqual(fAbsY, 1.0))
+ return 0.0;
+
+ const double t(1.0 - (fAbsX > fAbsY ? fAbsX : fAbsY));
+ const sal_uInt32 nSteps(rGradInfo.mnSteps);
+
+ if(nSteps > 2L && nSteps < 128L)
+ return floor(t * nSteps) / double(nSteps - 1L);
+
+ return t;
+ }
+
+ /** Create matrix for ODF's rectangular gradient definition
+
+ @param o_rGradientInfo
+ Receives the calculated texture transformation matrix (for
+ use with standard [0,1]x[0,1] texture coordinates)
+
+ @param rTargetArea
+ Output area, needed for aspect ratio calculations and
+ texture transformation
+
+ @param rOffset
+ Gradient offset value (from ODF)
+
+ @param nSteps
+ Number of gradient steps (from ODF)
+
+ @param fBorder
+ Width of gradient border (from ODF)
+
+ @param fAngle
+ Gradient angle (from ODF)
+ */
+ BASEGFX_DLLPUBLIC ODFGradientInfo& createRectangularODFGradientInfo(ODFGradientInfo& o_rGradientInfo,
+ const B2DRange& rTargetArea,
+ const B2DVector& rOffset,
+ sal_uInt32 nSteps,
+ double fBorder,
+ double fAngle);
+
+ /** Calculate rectangular gradient blend value
+
+ This method generates you the lerp alpha value for
+ blending linearly between gradient start and end color,
+ according to the formula (startCol*(1.0-alpha) + endCol*alpha)
+
+ @param rUV
+ Current uv coordinate. Values outside [0,1] will be
+ clamped.
+
+ @param rGradInfo
+ Gradient info, for transformation and number of steps
+ */
+ inline double getRectangularGradientAlpha(const B2DPoint& rUV,
+ const ODFGradientInfo& rGradInfo )
+ {
+ return getSquareGradientAlpha(rUV, rGradInfo); // only matrix setup differs
+ }
+ }
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tools/keystoplerp.hxx b/include/basegfx/tools/keystoplerp.hxx
new file mode 100644
index 000000000000..8d6d41af63d9
--- /dev/null
+++ b/include/basegfx/tools/keystoplerp.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 _BGFX_TOOLS_KEYSTOPLERP_HXX
+#define _BGFX_TOOLS_KEYSTOPLERP_HXX
+
+#include <basegfx/numeric/ftools.hxx>
+#include <vector>
+#include <basegfx/basegfxdllapi.h>
+
+namespace com{ namespace sun{ namespace star{ namespace uno {
+ template<typename T> class Sequence;
+}}}}
+
+namespace basegfx
+{
+ namespace tools
+ {
+ /** Lerp in a vector of key stops
+
+ This class holds a key stop vector and provides the
+ functionality to lerp inside it. Useful e.g. for
+ multi-stop gradients, or the SMIL key time activity.
+
+ For those, given a global [0,1] lerp alpha, one need to
+ find the suitable bucket index from key stop vector, and
+ then calculate the relative alpha between the two buckets
+ found.
+ */
+ class BASEGFX_DLLPUBLIC KeyStopLerp
+ {
+ public:
+ typedef std::pair<std::ptrdiff_t,double> ResultType;
+
+ /** Create lerper with given vector of stops
+
+ @param rKeyStops
+
+ Vector of stops, must contain at least two elements
+ (though preferrably more, otherwise you probably don't
+ need key stop lerping in the first place). All
+ elements must be of monotonically increasing value.
+ */
+ explicit KeyStopLerp( const std::vector<double>& rKeyStops );
+
+ /** Create lerper with given sequence of stops
+
+ @param rKeyStops
+
+ Sequence of stops, must contain at least two elements
+ (though preferrably more, otherwise you probably don't
+ need key stop lerping in the first place). All
+ elements must be of monotonically increasing value.
+ */
+ explicit KeyStopLerp( const ::com::sun::star::uno::Sequence<double>& rKeyStops );
+
+ /** Find two nearest bucket index & interpolate
+
+ @param fAlpha
+ Find bucket index i, with keyStops[i] < fAlpha <=
+ keyStops[i+1]. Return new alpha value in [0,1),
+ proportional to fAlpha's position between keyStops[i]
+ and keyStops[i+1]
+ */
+ ResultType lerp(double fAlpha) const;
+
+ private:
+ std::vector<double> maKeyStops;
+ mutable std::ptrdiff_t mnLastIndex;
+ };
+ }
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tools/lerp.hxx b/include/basegfx/tools/lerp.hxx
new file mode 100644
index 000000000000..a0c0d714a295
--- /dev/null
+++ b/include/basegfx/tools/lerp.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 _BGFX_TOOLS_LERP_HXX
+#define _BGFX_TOOLS_LERP_HXX
+
+#include <sal/types.h>
+
+namespace basegfx
+{
+ namespace tools
+ {
+ /** Generic linear interpolator
+
+ @tpl ValueType
+ Must have operator+ and operator* defined, and should
+ have value semantics.
+
+ @param t
+ As usual, t must be in the [0,1] range
+ */
+ template< typename ValueType > ValueType lerp( const ValueType& rFrom,
+ const ValueType& rTo,
+ double t )
+ {
+ // This is only to suppress a double->int warning. All other
+ // types should be okay here.
+ return static_cast<ValueType>( (1.0-t)*rFrom + t*rTo );
+ }
+ }
+}
+
+#endif /* _BGFX_TOOLS_LERP_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tools/rectcliptools.hxx b/include/basegfx/tools/rectcliptools.hxx
new file mode 100644
index 000000000000..3d5f77e18e0e
--- /dev/null
+++ b/include/basegfx/tools/rectcliptools.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_TOOLS_RECTCLIPTOOLS_HXX
+#define _BGFX_TOOLS_RECTCLIPTOOLS_HXX
+
+#include <sal/types.h>
+#include <basegfx/range/b2ibox.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace tools
+ {
+ namespace RectClipFlags
+ {
+ static const sal_uInt32 LEFT = (sal_Int32)0x01;
+ static const sal_uInt32 RIGHT = (sal_Int32)0x02;
+ static const sal_uInt32 TOP = (sal_Int32)0x04;
+ static const sal_uInt32 BOTTOM = (sal_Int32)0x08;
+ }
+
+ /** Calc clip mask for Cohen-Sutherland rectangle clip
+
+ This function returns a clip mask used for the
+ Cohen-Sutherland rectangle clip method, where one or more
+ of the lower four bits are set, if the given point is
+ outside one or more of the four half planes defining the
+ rectangle (see RectClipFlags for possible values)
+ */
+ template< class Point, class Rect > inline
+ sal_uInt32 getCohenSutherlandClipFlags( const Point& rP,
+ const Rect& rR )
+ {
+ // maxY | minY | maxX | minX
+ sal_uInt32 clip = (rP.getX() < rR.getMinX()) << 0;
+ clip |= (rP.getX() > rR.getMaxX()) << 1;
+ clip |= (rP.getY() < rR.getMinY()) << 2;
+ clip |= (rP.getY() > rR.getMaxY()) << 3;
+ return clip;
+ }
+
+ /// Cohen-Sutherland mask calculation - overload for boxes.
+ template< class Point > inline
+ sal_uInt32 getCohenSutherlandClipFlags( const Point& rP,
+ const B2IBox& rB )
+ {
+ // maxY | minY | maxX | minX
+ sal_uInt32 clip = (rP.getX() < rB.getMinX()) << 0;
+ clip |= (rP.getX() >= rB.getMaxX()) << 1;
+ clip |= (rP.getY() < rB.getMinY()) << 2;
+ clip |= (rP.getY() >= rB.getMaxY()) << 3;
+ return clip;
+ }
+
+ /** Determine number of clip planes hit by given clip mask
+
+ This method returns the number of one bits in the four
+ least significant bits of the argument, which amounts to
+ the number of clip planes hit within the
+ getCohenSutherlandClipFlags() method.
+ */
+ inline sal_uInt32 getNumberOfClipPlanes( sal_uInt32 nFlags )
+ {
+ // classic bit count algo, see e.g. Reingold, Nievergelt,
+ // Deo: Combinatorial Algorithms, Theory and Practice,
+ // Prentice-Hall 1977
+ nFlags = (nFlags & 0x05) + ((nFlags >> 1) & 0x05);
+ nFlags = (nFlags & 0x03) + (nFlags >> 2); // no need for &
+ // 0x03, can't
+ // overflow
+ return nFlags;
+ }
+ }
+}
+
+#endif // _BGFX_TOOLS_RECTCLIPTOOLS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tools/tools.hxx b/include/basegfx/tools/tools.hxx
new file mode 100644
index 000000000000..c1fa0940ae35
--- /dev/null
+++ b/include/basegfx/tools/tools.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 _BGFX_TOOLS_TOOLS_HXX
+#define _BGFX_TOOLS_TOOLS_HXX
+
+#include <sal/types.h>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ class B2DPoint;
+ class B2DRange;
+
+ namespace tools
+ {
+ /** Expand given parallelogram, such that it extends beyond
+ bound rect in a given direction.
+
+ This method is useful when e.g. generating one-dimensional
+ gradients, such as linear or axial gradients: those
+ gradients vary only in one direction, the other has
+ constant color. Most of the time, those gradients extends
+ infinitely in the direction with the constant color, but
+ practically, one always has a limiting bound rect into
+ which the gradient is painted. The method at hand now
+ extends a given parallelogram (e.g. the transformed
+ bounding box of a gradient) virtually into infinity to the
+ top and to the bottom (i.e. normal to the line io_rLeftTop
+ io_rRightTop), such that the given rectangle is guaranteed
+ to be covered in that direction.
+
+ @attention There might be some peculiarities with this
+ method, that might limit its usage to the described
+ gradients. One of them is the fact that when determining
+ how far the parallelogram has to be extended to the top or
+ the bottom, the upper and lower border are assumed to be
+ infinite lines.
+
+ @param io_rLeftTop
+ Left, top edge of the parallelogramm. Note that this need
+ not be the left, top edge geometrically, it's just used
+ when determining the extension direction. Thus, it's
+ perfectly legal to affine-transform a rectangle, and given
+ the transformed point here. On method return, this
+ parameter will contain the adapted output.
+
+ @param io_rLeftBottom
+ Left, bottom edge of the parallelogramm. Note that this need
+ not be the left, bottom edge geometrically, it's just used
+ when determining the extension direction. Thus, it's
+ perfectly legal to affine-transform a rectangle, and given
+ the transformed point here. On method return, this
+ parameter will contain the adapted output.
+
+ @param io_rRightTop
+ Right, top edge of the parallelogramm. Note that this need
+ not be the right, top edge geometrically, it's just used
+ when determining the extension direction. Thus, it's
+ perfectly legal to affine-transform a rectangle, and given
+ the transformed point here. On method return, this
+ parameter will contain the adapted output.
+
+ @param io_rRightBottom
+ Right, bottom edge of the parallelogramm. Note that this need
+ not be the right, bottom edge geometrically, it's just used
+ when determining the extension direction. Thus, it's
+ perfectly legal to affine-transform a rectangle, and given
+ the transformed point here. On method return, this
+ parameter will contain the adapted output.
+
+ @param rFitTarget
+ The rectangle to fit the parallelogram into.
+ */
+ BASEGFX_DLLPUBLIC void infiniteLineFromParallelogram( ::basegfx::B2DPoint& io_rLeftTop,
+ ::basegfx::B2DPoint& io_rLeftBottom,
+ ::basegfx::B2DPoint& io_rRightTop,
+ ::basegfx::B2DPoint& io_rRightBottom,
+ const ::basegfx::B2DRange& rFitTarget );
+
+ }
+}
+
+#endif /* _BGFX_TOOLS_TOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tools/unopolypolygon.hxx b/include/basegfx/tools/unopolypolygon.hxx
new file mode 100644
index 000000000000..72ed9418663a
--- /dev/null
+++ b/include/basegfx/tools/unopolypolygon.hxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEGFX_UNOPOLYPOLYGON_HXX
+#define INCLUDED_BASEGFX_UNOPOLYPOLYGON_HXX
+
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/compbase3.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/rendering/FillRule.hpp>
+#include <com/sun/star/rendering/XLinePolyPolygon2D.hpp>
+#include <com/sun/star/rendering/XBezierPolyPolygon2D.hpp>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/basegfxdllapi.h>
+#include <boost/utility.hpp>
+
+
+namespace basegfx
+{
+namespace unotools
+{
+ typedef ::cppu::WeakComponentImplHelper3<
+ ::com::sun::star::rendering::XLinePolyPolygon2D,
+ ::com::sun::star::rendering::XBezierPolyPolygon2D,
+ ::com::sun::star::lang::XServiceInfo > UnoPolyPolygonBase;
+
+ class BASEGFX_DLLPUBLIC UnoPolyPolygon
+ : private cppu::BaseMutex
+ , private boost::noncopyable
+ , public UnoPolyPolygonBase
+ {
+ public:
+ explicit UnoPolyPolygon( const B2DPolyPolygon& );
+
+ // XPolyPolygon2D
+ virtual void SAL_CALL addPolyPolygon( const ::com::sun::star::geometry::RealPoint2D& position, const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& polyPolygon ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getNumberOfPolygons( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getNumberOfPolygonPoints( ::sal_Int32 polygon ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::rendering::FillRule SAL_CALL getFillRule( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFillRule( ::com::sun::star::rendering::FillRule fillRule ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isClosed( ::sal_Int32 index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setClosed( ::sal_Int32 index, ::sal_Bool closedState ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XLinePolyPolygon2D
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > > SAL_CALL getPoints( ::sal_Int32 nPolygonIndex, ::sal_Int32 nNumberOfPolygons, ::sal_Int32 nPointIndex, ::sal_Int32 nNumberOfPoints ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPoints( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > >& points, ::sal_Int32 nPolygonIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::geometry::RealPoint2D SAL_CALL getPoint( ::sal_Int32 nPolygonIndex, ::sal_Int32 nPointIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPoint( const ::com::sun::star::geometry::RealPoint2D& point, ::sal_Int32 nPolygonIndex, ::sal_Int32 nPointIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XBezierPolyPolygon2D
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > > SAL_CALL getBezierSegments( ::sal_Int32 nPolygonIndex, ::sal_Int32 nNumberOfPolygons, ::sal_Int32 nPointIndex, ::sal_Int32 nNumberOfPoints ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setBezierSegments( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& points, ::sal_Int32 nPolygonIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::geometry::RealBezierSegment2D SAL_CALL getBezierSegment( ::sal_Int32 nPolygonIndex, ::sal_Int32 nPointIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setBezierSegment( const ::com::sun::star::geometry::RealBezierSegment2D& point, ::sal_Int32 nPolygonIndex, ::sal_Int32 nPointIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
+
+ B2DPolyPolygon getPolyPolygon() const;
+
+ protected:
+ /// Check whether index is a valid polygon index
+ void checkIndex( sal_Int32 nIndex ) const // throw (::com::sun::star::lang::IndexOutOfBoundsException);
+ {
+ if( nIndex < 0 || nIndex >= static_cast<sal_Int32>(maPolyPoly.count()) )
+ throw ::com::sun::star::lang::IndexOutOfBoundsException();
+ }
+
+ B2DPolyPolygon getSubsetPolyPolygon( sal_Int32 nPolygonIndex,
+ sal_Int32 nNumberOfPolygons,
+ sal_Int32 nPointIndex,
+ sal_Int32 nNumberOfPoints ) const;
+
+ /// Get cow copy of internal polygon. not thread-safe outside this object.
+ B2DPolyPolygon getPolyPolygonUnsafe() const
+ {
+ return maPolyPoly;
+ }
+
+ /// Called whenever internal polypolygon gets modified
+ virtual void modifying() const {}
+
+ private:
+ B2DPolyPolygon maPolyPoly;
+ ::com::sun::star::rendering::FillRule meFillRule;
+ };
+}
+}
+
+#endif /* INCLUDED_BASEGFX_UNOPOLYPOLYGON_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tools/unotools.hxx b/include/basegfx/tools/unotools.hxx
new file mode 100644
index 000000000000..c95eb5361f5c
--- /dev/null
+++ b/include/basegfx/tools/unotools.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/.
+ */
+
+#ifndef INCLUDED_BASEGFX_UNOTOOLS_HXX
+#define INCLUDED_BASEGFX_UNOTOOLS_HXX
+
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/compbase3.hxx>
+#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/rendering/FillRule.hpp>
+#include <com/sun/star/rendering/XLinePolyPolygon2D.hpp>
+#include <com/sun/star/rendering/XBezierPolyPolygon2D.hpp>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+
+namespace basegfx
+{
+class B2DPolyPolygon;
+
+namespace unotools
+{
+
+ BASEGFX_DLLPUBLIC B2DPolyPolygon polyPolygonBezierToB2DPolyPolygon(const ::com::sun::star::drawing::PolyPolygonBezierCoords& rSourcePolyPolygon)
+ throw( ::com::sun::star::lang::IllegalArgumentException );
+
+ BASEGFX_DLLPUBLIC void b2DPolyPolygonToPolyPolygonBezier( const B2DPolyPolygon& rPolyPoly,
+ ::com::sun::star::drawing::PolyPolygonBezierCoords& rRetval );
+}
+}
+
+#endif /* INCLUDED_BASEGFX_UNOTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tools/zoomtools.hxx b/include/basegfx/tools/zoomtools.hxx
new file mode 100644
index 000000000000..44d9052a2552
--- /dev/null
+++ b/include/basegfx/tools/zoomtools.hxx
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Tim Hardeck <thardeck@suse.com>
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef _BGFX_TOOLS_ZOOMTOOLS_HXX
+#define _BGFX_TOOLS_ZOOMTOOLS_HXX
+
+#include <sal/types.h>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ /** This namespace provides functions for optimized geometric zooming
+ */
+ namespace zoomtools
+ {
+ BASEGFX_DLLPUBLIC long zoomOut(long nCurrent);
+ BASEGFX_DLLPUBLIC long zoomIn(long nCurrent);
+ }
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tuple/b2dtuple.hxx b/include/basegfx/tuple/b2dtuple.hxx
new file mode 100644
index 000000000000..380ba8adf493
--- /dev/null
+++ b/include/basegfx/tuple/b2dtuple.hxx
@@ -0,0 +1,352 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_TUPLE_B2DTUPLE_HXX
+#define _BGFX_TUPLE_B2DTUPLE_HXX
+
+#include <sal/types.h>
+#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ // predeclarations
+ class B2ITuple;
+
+ /** Base class for all Points/Vectors with two double values
+
+ This class provides all methods common to Point
+ avd Vector classes which are derived from here.
+
+ @derive Use this class to implement Points or Vectors
+ which are based on two double values
+ */
+ class SAL_WARN_UNUSED B2DTuple
+ {
+ protected:
+ double mfX;
+ double mfY;
+
+ public:
+ /** Create a 2D Tuple
+
+ The tuple is initialized to (0.0, 0.0)
+ */
+ B2DTuple()
+ : mfX(0.0),
+ mfY(0.0)
+ {}
+
+ /** Create a 2D Tuple
+
+ @param fX
+ This parameter is used to initialize the X-coordinate
+ of the 2D Tuple.
+
+ @param fY
+ This parameter is used to initialize the Y-coordinate
+ of the 2D Tuple.
+ */
+ B2DTuple(double fX, double fY)
+ : mfX( fX ),
+ mfY( fY )
+ {}
+
+ /** Create a copy of a 2D Tuple
+
+ @param rTup
+ The 2D Tuple which will be copied.
+ */
+ B2DTuple(const B2DTuple& rTup)
+ : mfX( rTup.mfX ),
+ mfY( rTup.mfY )
+ {}
+
+ /** Create a copy of a 2D integer Tuple
+
+ @param rTup
+ The 2D Tuple which will be copied.
+ */
+ BASEGFX_DLLPUBLIC explicit B2DTuple(const B2ITuple& rTup);
+
+ ~B2DTuple()
+ {}
+
+ /// Get X-Coordinate of 2D Tuple
+ double getX() const
+ {
+ return mfX;
+ }
+
+ /// Get Y-Coordinate of 2D Tuple
+ double getY() const
+ {
+ return mfY;
+ }
+
+ /// Set X-Coordinate of 2D Tuple
+ void setX(double fX)
+ {
+ mfX = fX;
+ }
+
+ /// Set Y-Coordinate of 2D Tuple
+ void setY(double fY)
+ {
+ mfY = fY;
+ }
+
+ /// Array-access to 2D Tuple
+ const double& operator[] (int nPos) const
+ {
+ // Here, normally one if(...) should be used. In the assumption that
+ // both double members can be accessed as an array a shortcut is used here.
+ // if(0 == nPos) return mfX; return mfY;
+ return *((&mfX) + nPos);
+ }
+
+ /// Array-access to 2D Tuple
+ double& operator[] (int nPos)
+ {
+ // Here, normally one if(...) should be used. In the assumption that
+ // both double members can be accessed as an array a shortcut is used here.
+ // if(0 == nPos) return mfX; return mfY;
+ return *((&mfX) + nPos);
+ }
+
+ // comparators with tolerance
+ //////////////////////////////////////////////////////////////////////
+
+ bool equalZero() const
+ {
+ return (this == &getEmptyTuple() ||
+ (fTools::equalZero(mfX) && fTools::equalZero(mfY)));
+ }
+
+ bool equalZero(const double& rfSmallValue) const
+ {
+ return (this == &getEmptyTuple() ||
+ (fTools::equalZero(mfX, rfSmallValue) && fTools::equalZero(mfY, rfSmallValue)));
+ }
+
+ bool equal(const B2DTuple& rTup) const
+ {
+ return (
+ this == &rTup ||
+ (fTools::equal(mfX, rTup.mfX) &&
+ fTools::equal(mfY, rTup.mfY)));
+ }
+
+ bool equal(const B2DTuple& rTup, const double& rfSmallValue) const
+ {
+ return (
+ this == &rTup ||
+ (fTools::equal(mfX, rTup.mfX, rfSmallValue) &&
+ fTools::equal(mfY, rTup.mfY, rfSmallValue)));
+ }
+
+ // operators
+ //////////////////////////////////////////////////////////////////////
+
+ B2DTuple& operator+=( const B2DTuple& rTup )
+ {
+ mfX += rTup.mfX;
+ mfY += rTup.mfY;
+ return *this;
+ }
+
+ B2DTuple& operator-=( const B2DTuple& rTup )
+ {
+ mfX -= rTup.mfX;
+ mfY -= rTup.mfY;
+ return *this;
+ }
+
+ B2DTuple& operator/=( const B2DTuple& rTup )
+ {
+ mfX /= rTup.mfX;
+ mfY /= rTup.mfY;
+ return *this;
+ }
+
+ B2DTuple& operator*=( const B2DTuple& rTup )
+ {
+ mfX *= rTup.mfX;
+ mfY *= rTup.mfY;
+ return *this;
+ }
+
+ B2DTuple& operator*=(double t)
+ {
+ mfX *= t;
+ mfY *= t;
+ return *this;
+ }
+
+ B2DTuple& operator/=(double t)
+ {
+ const double fVal(1.0 / t);
+ mfX *= fVal;
+ mfY *= fVal;
+ return *this;
+ }
+
+ B2DTuple operator-(void) const
+ {
+ return B2DTuple(-mfX, -mfY);
+ }
+
+ bool operator==( const B2DTuple& rTup ) const
+ {
+ return equal(rTup);
+ }
+
+ bool operator!=( const B2DTuple& rTup ) const
+ {
+ return !equal(rTup);
+ }
+
+ B2DTuple& operator=( const B2DTuple& rTup )
+ {
+ mfX = rTup.mfX;
+ mfY = rTup.mfY;
+ return *this;
+ }
+
+ BASEGFX_DLLPUBLIC static const B2DTuple& getEmptyTuple();
+ };
+
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ inline B2DTuple minimum(const B2DTuple& rTupA, const B2DTuple& rTupB)
+ {
+ B2DTuple aMin(
+ (rTupB.getX() < rTupA.getX()) ? rTupB.getX() : rTupA.getX(),
+ (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY());
+ return aMin;
+ }
+
+ inline B2DTuple maximum(const B2DTuple& rTupA, const B2DTuple& rTupB)
+ {
+ B2DTuple aMax(
+ (rTupB.getX() > rTupA.getX()) ? rTupB.getX() : rTupA.getX(),
+ (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY());
+ return aMax;
+ }
+
+ inline B2DTuple absolute(const B2DTuple& rTup)
+ {
+ B2DTuple aAbs(
+ (0.0 > rTup.getX()) ? -rTup.getX() : rTup.getX(),
+ (0.0 > rTup.getY()) ? -rTup.getY() : rTup.getY());
+ return aAbs;
+ }
+
+ inline B2DTuple interpolate(const B2DTuple& rOld1, const B2DTuple& rOld2, double t)
+ {
+ B2DTuple aInt(
+ ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(),
+ ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY());
+ return aInt;
+ }
+
+ inline B2DTuple average(const B2DTuple& rOld1, const B2DTuple& rOld2)
+ {
+ B2DTuple aAvg(
+ (rOld1.getX() + rOld2.getX()) * 0.5,
+ (rOld1.getY() + rOld2.getY()) * 0.5);
+ return aAvg;
+ }
+
+ inline B2DTuple average(const B2DTuple& rOld1, const B2DTuple& rOld2, const B2DTuple& rOld3)
+ {
+ B2DTuple aAvg(
+ (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0),
+ (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0));
+ return aAvg;
+ }
+
+ inline B2DTuple operator+(const B2DTuple& rTupA, const B2DTuple& rTupB)
+ {
+ B2DTuple aSum(rTupA);
+ aSum += rTupB;
+ return aSum;
+ }
+
+ inline B2DTuple operator-(const B2DTuple& rTupA, const B2DTuple& rTupB)
+ {
+ B2DTuple aSub(rTupA);
+ aSub -= rTupB;
+ return aSub;
+ }
+
+ inline B2DTuple operator/(const B2DTuple& rTupA, const B2DTuple& rTupB)
+ {
+ B2DTuple aDiv(rTupA);
+ aDiv /= rTupB;
+ return aDiv;
+ }
+
+ inline B2DTuple operator*(const B2DTuple& rTupA, const B2DTuple& rTupB)
+ {
+ B2DTuple aMul(rTupA);
+ aMul *= rTupB;
+ return aMul;
+ }
+
+ inline B2DTuple operator*(const B2DTuple& rTup, double t)
+ {
+ B2DTuple aNew(rTup);
+ aNew *= t;
+ return aNew;
+ }
+
+ inline B2DTuple operator*(double t, const B2DTuple& rTup)
+ {
+ B2DTuple aNew(rTup);
+ aNew *= t;
+ return aNew;
+ }
+
+ inline B2DTuple operator/(const B2DTuple& rTup, double t)
+ {
+ B2DTuple aNew(rTup);
+ aNew /= t;
+ return aNew;
+ }
+
+ inline B2DTuple operator/(double t, const B2DTuple& rTup)
+ {
+ B2DTuple aNew(t, t);
+ B2DTuple aTmp(rTup);
+ aNew /= aTmp;
+ return aNew;
+ }
+
+ /** Round double to nearest integer for 2D tuple
+
+ @return the nearest integer for this tuple
+ */
+ BASEGFX_DLLPUBLIC B2ITuple fround(const B2DTuple& rTup);
+} // end of namespace basegfx
+
+#endif /* _BGFX_TUPLE_B2DTUPLE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tuple/b2i64tuple.hxx b/include/basegfx/tuple/b2i64tuple.hxx
new file mode 100644
index 000000000000..debb4cabe578
--- /dev/null
+++ b/include/basegfx/tuple/b2i64tuple.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 _BGFX_TUPLE_B2I64TUPLE_HXX
+#define _BGFX_TUPLE_B2I64TUPLE_HXX
+
+#include <sal/types.h>
+#include <basegfx/tuple/b2dtuple.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+
+namespace basegfx
+{
+ /** Base class for all Points/Vectors with two sal_Int64 values
+
+ This class provides all methods common to Point
+ avd Vector classes which are derived from here.
+
+ @derive Use this class to implement Points or Vectors
+ which are based on two sal_Int64 values
+ */
+ class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED B2I64Tuple
+ {
+ protected:
+ sal_Int64 mnX;
+ sal_Int64 mnY;
+
+ public:
+ /** Create a 2D Tuple
+
+ The tuple is initialized to (0, 0)
+ */
+ B2I64Tuple()
+ : mnX(0),
+ mnY(0)
+ {}
+
+ /** Create a 2D Tuple
+
+ @param fX
+ This parameter is used to initialize the X-coordinate
+ of the 2D Tuple.
+
+ @param fY
+ This parameter is used to initialize the Y-coordinate
+ of the 2D Tuple.
+ */
+ B2I64Tuple(sal_Int64 fX, sal_Int64 fY)
+ : mnX( fX ),
+ mnY( fY )
+ {}
+
+ /** Create a copy of a 2D Tuple
+
+ @param rTup
+ The 2D Tuple which will be copied.
+ */
+ B2I64Tuple(const B2I64Tuple& rTup)
+ : mnX( rTup.mnX ),
+ mnY( rTup.mnY )
+ {}
+
+ ~B2I64Tuple()
+ {}
+
+ /// Get X-Coordinate of 2D Tuple
+ sal_Int64 getX() const
+ {
+ return mnX;
+ }
+
+ /// Get Y-Coordinate of 2D Tuple
+ sal_Int64 getY() const
+ {
+ return mnY;
+ }
+
+ /// Set X-Coordinate of 2D Tuple
+ void setX(sal_Int64 fX)
+ {
+ mnX = fX;
+ }
+
+ /// Set Y-Coordinate of 2D Tuple
+ void setY(sal_Int64 fY)
+ {
+ mnY = fY;
+ }
+
+ /// Array-access to 2D Tuple
+ const sal_Int64& operator[] (int nPos) const
+ {
+ // Here, normally one if(...) should be used. In the assumption that
+ // both sal_Int64 members can be accessed as an array a shortcut is used here.
+ // if(0 == nPos) return mnX; return mnY;
+ return *((&mnX) + nPos);
+ }
+
+ /// Array-access to 2D Tuple
+ sal_Int64& operator[] (int nPos)
+ {
+ // Here, normally one if(...) should be used. In the assumption that
+ // both sal_Int64 members can be accessed as an array a shortcut is used here.
+ // if(0 == nPos) return mnX; return mnY;
+ return *((&mnX) + nPos);
+ }
+
+ // operators
+ //////////////////////////////////////////////////////////////////////
+
+ B2I64Tuple& operator+=( const B2I64Tuple& rTup )
+ {
+ mnX += rTup.mnX;
+ mnY += rTup.mnY;
+ return *this;
+ }
+
+ B2I64Tuple& operator-=( const B2I64Tuple& rTup )
+ {
+ mnX -= rTup.mnX;
+ mnY -= rTup.mnY;
+ return *this;
+ }
+
+ B2I64Tuple& operator/=( const B2I64Tuple& rTup )
+ {
+ mnX /= rTup.mnX;
+ mnY /= rTup.mnY;
+ return *this;
+ }
+
+ B2I64Tuple& operator*=( const B2I64Tuple& rTup )
+ {
+ mnX *= rTup.mnX;
+ mnY *= rTup.mnY;
+ return *this;
+ }
+
+ B2I64Tuple& operator*=(sal_Int64 t)
+ {
+ mnX *= t;
+ mnY *= t;
+ return *this;
+ }
+
+ B2I64Tuple& operator/=(sal_Int64 t)
+ {
+ mnX /= t;
+ mnY /= t;
+ return *this;
+ }
+
+ B2I64Tuple operator-(void) const
+ {
+ return B2I64Tuple(-mnX, -mnY);
+ }
+
+ bool equalZero() const { return mnX == 0 && mnY == 0; }
+
+ bool operator==( const B2I64Tuple& rTup ) const
+ {
+ return this == &rTup || (rTup.mnX == mnX && rTup.mnY == mnY);
+ }
+
+ bool operator!=( const B2I64Tuple& rTup ) const
+ {
+ return !(*this == rTup);
+ }
+
+ B2I64Tuple& operator=( const B2I64Tuple& rTup )
+ {
+ mnX = rTup.mnX;
+ mnY = rTup.mnY;
+ return *this;
+ }
+ };
+
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ inline B2I64Tuple minimum(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB)
+ {
+ B2I64Tuple aMin(
+ (rTupB.getX() < rTupA.getX()) ? rTupB.getX() : rTupA.getX(),
+ (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY());
+ return aMin;
+ }
+
+ inline B2I64Tuple maximum(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB)
+ {
+ B2I64Tuple aMax(
+ (rTupB.getX() > rTupA.getX()) ? rTupB.getX() : rTupA.getX(),
+ (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY());
+ return aMax;
+ }
+
+ inline B2I64Tuple absolute(const B2I64Tuple& rTup)
+ {
+ B2I64Tuple aAbs(
+ (0 > rTup.getX()) ? -rTup.getX() : rTup.getX(),
+ (0 > rTup.getY()) ? -rTup.getY() : rTup.getY());
+ return aAbs;
+ }
+
+ inline B2DTuple interpolate(const B2I64Tuple& rOld1, const B2I64Tuple& rOld2, double t)
+ {
+ B2DTuple aInt(
+ ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(),
+ ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY());
+ return aInt;
+ }
+
+ inline B2DTuple average(const B2I64Tuple& rOld1, const B2I64Tuple& rOld2)
+ {
+ B2DTuple aAvg(
+ (rOld1.getX() + rOld2.getX()) * 0.5,
+ (rOld1.getY() + rOld2.getY()) * 0.5);
+ return aAvg;
+ }
+
+ inline B2DTuple average(const B2I64Tuple& rOld1, const B2I64Tuple& rOld2, const B2I64Tuple& rOld3)
+ {
+ B2DTuple aAvg(
+ (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0),
+ (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0));
+ return aAvg;
+ }
+
+ inline B2I64Tuple operator+(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB)
+ {
+ B2I64Tuple aSum(rTupA);
+ aSum += rTupB;
+ return aSum;
+ }
+
+ inline B2I64Tuple operator-(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB)
+ {
+ B2I64Tuple aSub(rTupA);
+ aSub -= rTupB;
+ return aSub;
+ }
+
+ inline B2I64Tuple operator/(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB)
+ {
+ B2I64Tuple aDiv(rTupA);
+ aDiv /= rTupB;
+ return aDiv;
+ }
+
+ inline B2I64Tuple operator*(const B2I64Tuple& rTupA, const B2I64Tuple& rTupB)
+ {
+ B2I64Tuple aMul(rTupA);
+ aMul *= rTupB;
+ return aMul;
+ }
+
+ inline B2I64Tuple operator*(const B2I64Tuple& rTup, sal_Int64 t)
+ {
+ B2I64Tuple aNew(rTup);
+ aNew *= t;
+ return aNew;
+ }
+
+ inline B2I64Tuple operator*(sal_Int64 t, const B2I64Tuple& rTup)
+ {
+ B2I64Tuple aNew(rTup);
+ aNew *= t;
+ return aNew;
+ }
+
+ inline B2I64Tuple operator/(const B2I64Tuple& rTup, sal_Int64 t)
+ {
+ B2I64Tuple aNew(rTup);
+ aNew /= t;
+ return aNew;
+ }
+
+ inline B2I64Tuple operator/(sal_Int64 t, const B2I64Tuple& rTup)
+ {
+ B2I64Tuple aNew(t, t);
+ B2I64Tuple aTmp(rTup);
+ aNew /= aTmp;
+ return aNew;
+ }
+} // end of namespace basegfx
+
+#endif /* _BGFX_TUPLE_B2I64TUPLE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tuple/b2ituple.hxx b/include/basegfx/tuple/b2ituple.hxx
new file mode 100644
index 000000000000..41203a0c58c4
--- /dev/null
+++ b/include/basegfx/tuple/b2ituple.hxx
@@ -0,0 +1,208 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_TUPLE_B2ITUPLE_HXX
+#define _BGFX_TUPLE_B2ITUPLE_HXX
+
+#include <sal/types.h>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ /** Base class for all Points/Vectors with two sal_Int32 values
+
+ This class provides all methods common to Point
+ avd Vector classes which are derived from here.
+
+ @derive Use this class to implement Points or Vectors
+ which are based on two sal_Int32 values
+ */
+ class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED B2ITuple
+ {
+ protected:
+ sal_Int32 mnX;
+ sal_Int32 mnY;
+
+ public:
+ /** Create a 2D Tuple
+
+ The tuple is initialized to (0, 0)
+ */
+ B2ITuple()
+ : mnX(0),
+ mnY(0)
+ {}
+
+ /** Create a 2D Tuple
+
+ @param fX
+ This parameter is used to initialize the X-coordinate
+ of the 2D Tuple.
+
+ @param fY
+ This parameter is used to initialize the Y-coordinate
+ of the 2D Tuple.
+ */
+ B2ITuple(sal_Int32 fX, sal_Int32 fY)
+ : mnX( fX ),
+ mnY( fY )
+ {}
+
+ /** Create a copy of a 2D Tuple
+
+ @param rTup
+ The 2D Tuple which will be copied.
+ */
+ B2ITuple(const B2ITuple& rTup)
+ : mnX( rTup.mnX ),
+ mnY( rTup.mnY )
+ {}
+
+ ~B2ITuple()
+ {}
+
+ /// Get X-Coordinate of 2D Tuple
+ sal_Int32 getX() const
+ {
+ return mnX;
+ }
+
+ /// Get Y-Coordinate of 2D Tuple
+ sal_Int32 getY() const
+ {
+ return mnY;
+ }
+
+ /// Set X-Coordinate of 2D Tuple
+ void setX(sal_Int32 fX)
+ {
+ mnX = fX;
+ }
+
+ /// Set Y-Coordinate of 2D Tuple
+ void setY(sal_Int32 fY)
+ {
+ mnY = fY;
+ }
+
+ /// Array-access to 2D Tuple
+ const sal_Int32& operator[] (int nPos) const
+ {
+ // Here, normally one if(...) should be used. In the assumption that
+ // both sal_Int32 members can be accessed as an array a shortcut is used here.
+ // if(0 == nPos) return mnX; return mnY;
+ return *((&mnX) + nPos);
+ }
+
+ /// Array-access to 2D Tuple
+ sal_Int32& operator[] (int nPos)
+ {
+ // Here, normally one if(...) should be used. In the assumption that
+ // both sal_Int32 members can be accessed as an array a shortcut is used here.
+ // if(0 == nPos) return mnX; return mnY;
+ return *((&mnX) + nPos);
+ }
+
+ // operators
+ //////////////////////////////////////////////////////////////////////
+
+ B2ITuple& operator+=( const B2ITuple& rTup )
+ {
+ mnX += rTup.mnX;
+ mnY += rTup.mnY;
+ return *this;
+ }
+
+ B2ITuple& operator-=( const B2ITuple& rTup )
+ {
+ mnX -= rTup.mnX;
+ mnY -= rTup.mnY;
+ return *this;
+ }
+
+ B2ITuple& operator/=( const B2ITuple& rTup )
+ {
+ mnX /= rTup.mnX;
+ mnY /= rTup.mnY;
+ return *this;
+ }
+
+ B2ITuple& operator*=( const B2ITuple& rTup )
+ {
+ mnX *= rTup.mnX;
+ mnY *= rTup.mnY;
+ return *this;
+ }
+
+ B2ITuple& operator*=(sal_Int32 t)
+ {
+ mnX *= t;
+ mnY *= t;
+ return *this;
+ }
+
+ B2ITuple& operator/=(sal_Int32 t)
+ {
+ mnX /= t;
+ mnY /= t;
+ return *this;
+ }
+
+ B2ITuple operator-(void) const
+ {
+ return B2ITuple(-mnX, -mnY);
+ }
+
+ bool equalZero() const { return mnX == 0 && mnY == 0; }
+
+ bool operator==( const B2ITuple& rTup ) const
+ {
+ return this == &rTup || (rTup.mnX == mnX && rTup.mnY == mnY);
+ }
+
+ bool operator!=( const B2ITuple& rTup ) const
+ {
+ return !(*this == rTup);
+ }
+
+ B2ITuple& operator=( const B2ITuple& rTup )
+ {
+ mnX = rTup.mnX;
+ mnY = rTup.mnY;
+ return *this;
+ }
+ };
+
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+ class B2DTuple;
+
+ BASEGFX_DLLPUBLIC B2ITuple operator+(const B2ITuple& rTupA, const B2ITuple& rTupB);
+ BASEGFX_DLLPUBLIC B2ITuple operator-(const B2ITuple& rTupA, const B2ITuple& rTupB);
+ BASEGFX_DLLPUBLIC B2ITuple operator/(const B2ITuple& rTupA, const B2ITuple& rTupB);
+ BASEGFX_DLLPUBLIC B2ITuple operator*(const B2ITuple& rTupA, const B2ITuple& rTupB);
+ BASEGFX_DLLPUBLIC B2ITuple operator*(const B2ITuple& rTup, sal_Int32 t);
+ BASEGFX_DLLPUBLIC B2ITuple operator*(sal_Int32 t, const B2ITuple& rTup);
+ BASEGFX_DLLPUBLIC B2ITuple operator/(const B2ITuple& rTup, sal_Int32 t);
+ BASEGFX_DLLPUBLIC B2ITuple operator/(sal_Int32 t, const B2ITuple& rTup);
+} // end of namespace basegfx
+
+#endif /* _BGFX_TUPLE_B2ITUPLE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tuple/b3dtuple.hxx b/include/basegfx/tuple/b3dtuple.hxx
new file mode 100644
index 000000000000..1eb4dd38de09
--- /dev/null
+++ b/include/basegfx/tuple/b3dtuple.hxx
@@ -0,0 +1,421 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_TUPLE_B3DTUPLE_HXX
+#define _BGFX_TUPLE_B3DTUPLE_HXX
+
+#include <sal/types.h>
+#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ // predeclarations
+ class B3ITuple;
+
+ /** Base class for all Points/Vectors with three double values
+
+ This class provides all methods common to Point
+ avd Vector classes which are derived from here.
+
+ @derive Use this class to implement Points or Vectors
+ which are based on three double values
+ */
+ class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED B3DTuple
+ {
+ protected:
+ double mfX;
+ double mfY;
+ double mfZ;
+
+ public:
+ /** Create a 3D Tuple
+
+ The tuple is initialized to (0.0, 0.0, 0.0)
+ */
+ B3DTuple()
+ : mfX(0.0),
+ mfY(0.0),
+ mfZ(0.0)
+ {}
+
+ /** Create a 3D Tuple
+
+ @param fX
+ This parameter is used to initialize the X-coordinate
+ of the 3D Tuple.
+
+ @param fY
+ This parameter is used to initialize the Y-coordinate
+ of the 3D Tuple.
+
+ @param fZ
+ This parameter is used to initialize the Z-coordinate
+ of the 3D Tuple.
+ */
+ B3DTuple(double fX, double fY, double fZ)
+ : mfX(fX),
+ mfY(fY),
+ mfZ(fZ)
+ {}
+
+ /** Create a copy of a 3D Tuple
+
+ @param rTup
+ The 3D Tuple which will be copied.
+ */
+ B3DTuple(const B3DTuple& rTup)
+ : mfX( rTup.mfX ),
+ mfY( rTup.mfY ),
+ mfZ( rTup.mfZ )
+ {}
+
+ ~B3DTuple()
+ {}
+
+ /// get X-Coordinate of 3D Tuple
+ double getX() const
+ {
+ return mfX;
+ }
+
+ /// get Y-Coordinate of 3D Tuple
+ double getY() const
+ {
+ return mfY;
+ }
+
+ /// get Z-Coordinate of 3D Tuple
+ double getZ() const
+ {
+ return mfZ;
+ }
+
+ /// set X-Coordinate of 3D Tuple
+ void setX(double fX)
+ {
+ mfX = fX;
+ }
+
+ /// set Y-Coordinate of 3D Tuple
+ void setY(double fY)
+ {
+ mfY = fY;
+ }
+
+ /// set Z-Coordinate of 3D Tuple
+ void setZ(double fZ)
+ {
+ mfZ = fZ;
+ }
+
+ /// Array-access to 3D Tuple
+ const double& operator[] (int nPos) const
+ {
+ // Here, normally two if(...)'s should be used. In the assumption that
+ // both double members can be accessed as an array a shortcut is used here.
+ // if(0 == nPos) return mfX; if(1 == nPos) return mfY; return mfZ;
+ return *((&mfX) + nPos);
+ }
+
+ /// Array-access to 3D Tuple
+ double& operator[] (int nPos)
+ {
+ // Here, normally two if(...)'s should be used. In the assumption that
+ // both double members can be accessed as an array a shortcut is used here.
+ // if(0 == nPos) return mfX; if(1 == nPos) return mfY; return mfZ;
+ return *((&mfX) + nPos);
+ }
+
+ // comparators with tolerance
+ //////////////////////////////////////////////////////////////////////
+
+ bool equalZero() const
+ {
+ return (this == &getEmptyTuple() ||
+ (::basegfx::fTools::equalZero(mfX)
+ && ::basegfx::fTools::equalZero(mfY)
+ && ::basegfx::fTools::equalZero(mfZ)));
+ }
+
+ bool equalZero(const double& rfSmallValue) const
+ {
+ return (this == &getEmptyTuple() ||
+ (::basegfx::fTools::equalZero(mfX, rfSmallValue)
+ && ::basegfx::fTools::equalZero(mfY, rfSmallValue)
+ && ::basegfx::fTools::equalZero(mfZ, rfSmallValue)));
+ }
+
+ bool equal(const B3DTuple& rTup) const
+ {
+ return (
+ this == &rTup ||
+ (::basegfx::fTools::equal(mfX, rTup.mfX) &&
+ ::basegfx::fTools::equal(mfY, rTup.mfY) &&
+ ::basegfx::fTools::equal(mfZ, rTup.mfZ)));
+ }
+
+ bool equal(const B3DTuple& rTup, const double& rfSmallValue) const
+ {
+ return (
+ this == &rTup ||
+ (::basegfx::fTools::equal(mfX, rTup.mfX, rfSmallValue) &&
+ ::basegfx::fTools::equal(mfY, rTup.mfY, rfSmallValue) &&
+ ::basegfx::fTools::equal(mfZ, rTup.mfZ, rfSmallValue)));
+ }
+
+ // operators
+ //////////////////////////////////////////////////////////////////////
+
+ B3DTuple& operator+=( const B3DTuple& rTup )
+ {
+ mfX += rTup.mfX;
+ mfY += rTup.mfY;
+ mfZ += rTup.mfZ;
+ return *this;
+ }
+
+ B3DTuple& operator-=( const B3DTuple& rTup )
+ {
+ mfX -= rTup.mfX;
+ mfY -= rTup.mfY;
+ mfZ -= rTup.mfZ;
+ return *this;
+ }
+
+ B3DTuple& operator/=( const B3DTuple& rTup )
+ {
+ mfX /= rTup.mfX;
+ mfY /= rTup.mfY;
+ mfZ /= rTup.mfZ;
+ return *this;
+ }
+
+ B3DTuple& operator*=( const B3DTuple& rTup )
+ {
+ mfX *= rTup.mfX;
+ mfY *= rTup.mfY;
+ mfZ *= rTup.mfZ;
+ return *this;
+ }
+
+ B3DTuple& operator*=(double t)
+ {
+ mfX *= t;
+ mfY *= t;
+ mfZ *= t;
+ return *this;
+ }
+
+ B3DTuple& operator/=(double t)
+ {
+ const double fVal(1.0 / t);
+ mfX *= fVal;
+ mfY *= fVal;
+ mfZ *= fVal;
+ return *this;
+ }
+
+ B3DTuple operator-(void) const
+ {
+ return B3DTuple(-mfX, -mfY, -mfZ);
+ }
+
+ bool operator==( const B3DTuple& rTup ) const
+ {
+ return equal(rTup);
+ }
+
+ bool operator!=( const B3DTuple& rTup ) const
+ {
+ return !equal(rTup);
+ }
+
+ B3DTuple& operator=( const B3DTuple& rTup )
+ {
+ mfX = rTup.mfX;
+ mfY = rTup.mfY;
+ mfZ = rTup.mfZ;
+ return *this;
+ }
+
+ void correctValues(const double fCompareValue = 0.0)
+ {
+ if(0.0 == fCompareValue)
+ {
+ if(::basegfx::fTools::equalZero(mfX))
+ {
+ mfX = 0.0;
+ }
+
+ if(::basegfx::fTools::equalZero(mfY))
+ {
+ mfY = 0.0;
+ }
+
+ if(::basegfx::fTools::equalZero(mfZ))
+ {
+ mfZ = 0.0;
+ }
+ }
+ else
+ {
+ if(::basegfx::fTools::equal(mfX, fCompareValue))
+ {
+ mfX = fCompareValue;
+ }
+
+ if(::basegfx::fTools::equal(mfY, fCompareValue))
+ {
+ mfY = fCompareValue;
+ }
+
+ if(::basegfx::fTools::equal(mfZ, fCompareValue))
+ {
+ mfZ = fCompareValue;
+ }
+ }
+ }
+
+ static const B3DTuple& getEmptyTuple();
+ };
+
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ inline B3DTuple minimum(const B3DTuple& rTupA, const B3DTuple& rTupB)
+ {
+ B3DTuple aMin(
+ (rTupB.getX() < rTupA.getX()) ? rTupB.getX() : rTupA.getX(),
+ (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY(),
+ (rTupB.getZ() < rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ());
+ return aMin;
+ }
+
+ inline B3DTuple maximum(const B3DTuple& rTupA, const B3DTuple& rTupB)
+ {
+ B3DTuple aMax(
+ (rTupB.getX() > rTupA.getX()) ? rTupB.getX() : rTupA.getX(),
+ (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY(),
+ (rTupB.getZ() > rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ());
+ return aMax;
+ }
+
+ inline B3DTuple absolute(const B3DTuple& rTup)
+ {
+ B3DTuple aAbs(
+ (0.0 > rTup.getX()) ? -rTup.getX() : rTup.getX(),
+ (0.0 > rTup.getY()) ? -rTup.getY() : rTup.getY(),
+ (0.0 > rTup.getZ()) ? -rTup.getZ() : rTup.getZ());
+ return aAbs;
+ }
+
+ inline B3DTuple interpolate(const B3DTuple& rOld1, const B3DTuple& rOld2, double t)
+ {
+ B3DTuple aInt(
+ ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(),
+ ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY(),
+ ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ());
+ return aInt;
+ }
+
+ inline B3DTuple average(const B3DTuple& rOld1, const B3DTuple& rOld2)
+ {
+ B3DTuple aAvg(
+ (rOld1.getX() + rOld2.getX()) * 0.5,
+ (rOld1.getY() + rOld2.getY()) * 0.5,
+ (rOld1.getZ() + rOld2.getZ()) * 0.5);
+ return aAvg;
+ }
+
+ inline B3DTuple average(const B3DTuple& rOld1, const B3DTuple& rOld2, const B3DTuple& rOld3)
+ {
+ B3DTuple aAvg(
+ (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0),
+ (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0),
+ (rOld1.getZ() + rOld2.getZ() + rOld3.getZ()) * (1.0 / 3.0));
+ return aAvg;
+ }
+
+ inline B3DTuple operator+(const B3DTuple& rTupA, const B3DTuple& rTupB)
+ {
+ B3DTuple aSum(rTupA);
+ aSum += rTupB;
+ return aSum;
+ }
+
+ inline B3DTuple operator-(const B3DTuple& rTupA, const B3DTuple& rTupB)
+ {
+ B3DTuple aSub(rTupA);
+ aSub -= rTupB;
+ return aSub;
+ }
+
+ inline B3DTuple operator/(const B3DTuple& rTupA, const B3DTuple& rTupB)
+ {
+ B3DTuple aDiv(rTupA);
+ aDiv /= rTupB;
+ return aDiv;
+ }
+
+ inline B3DTuple operator*(const B3DTuple& rTupA, const B3DTuple& rTupB)
+ {
+ B3DTuple aMul(rTupA);
+ aMul *= rTupB;
+ return aMul;
+ }
+
+ inline B3DTuple operator*(const B3DTuple& rTup, double t)
+ {
+ B3DTuple aNew(rTup);
+ aNew *= t;
+ return aNew;
+ }
+
+ inline B3DTuple operator*(double t, const B3DTuple& rTup)
+ {
+ B3DTuple aNew(rTup);
+ aNew *= t;
+ return aNew;
+ }
+
+ inline B3DTuple operator/(const B3DTuple& rTup, double t)
+ {
+ B3DTuple aNew(rTup);
+ aNew /= t;
+ return aNew;
+ }
+
+ inline B3DTuple operator/(double t, const B3DTuple& rTup)
+ {
+ B3DTuple aNew(rTup);
+ aNew /= t;
+ return aNew;
+ }
+
+ /** Round double to nearest integer for 3D tuple
+
+ @return the nearest integer for this tuple
+ */
+ BASEGFX_DLLPUBLIC B3ITuple fround(const B3DTuple& rTup);
+} // end of namespace basegfx
+
+#endif /* _BGFX_TUPLE_B3DTUPLE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tuple/b3i64tuple.hxx b/include/basegfx/tuple/b3i64tuple.hxx
new file mode 100644
index 000000000000..bcc1acaee6b1
--- /dev/null
+++ b/include/basegfx/tuple/b3i64tuple.hxx
@@ -0,0 +1,336 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_TUPLE_B3I64TUPLE_HXX
+#define _BGFX_TUPLE_B3I64TUPLE_HXX
+
+#include <sal/types.h>
+#include <basegfx/tuple/b3dtuple.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+
+namespace basegfx
+{
+ /** Base class for all Points/Vectors with three sal_Int64 values
+
+ This class provides all methods common to Point
+ avd Vector classes which are derived from here.
+
+ @derive Use this class to implement Points or Vectors
+ which are based on three sal_Int64 values
+ */
+ class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED B3I64Tuple
+ {
+ protected:
+ sal_Int64 mnX;
+ sal_Int64 mnY;
+ sal_Int64 mnZ;
+
+ public:
+ /** Create a 3D Tuple
+
+ The tuple is initialized to (0, 0, 0)
+ */
+ B3I64Tuple()
+ : mnX(0),
+ mnY(0),
+ mnZ(0)
+ {}
+
+ /** Create a 3D Tuple
+
+ @param nX
+ This parameter is used to initialize the X-coordinate
+ of the 3D Tuple.
+
+ @param nY
+ This parameter is used to initialize the Y-coordinate
+ of the 3D Tuple.
+
+ @param nZ
+ This parameter is used to initialize the Z-coordinate
+ of the 3D Tuple.
+ */
+ B3I64Tuple(sal_Int64 nX, sal_Int64 nY, sal_Int64 nZ)
+ : mnX(nX),
+ mnY(nY),
+ mnZ(nZ)
+ {}
+
+ /** Create a copy of a 3D Tuple
+
+ @param rTup
+ The 3D Tuple which will be copied.
+ */
+ B3I64Tuple(const B3I64Tuple& rTup)
+ : mnX( rTup.mnX ),
+ mnY( rTup.mnY ),
+ mnZ( rTup.mnZ )
+ {}
+
+ ~B3I64Tuple()
+ {}
+
+ /// get X-Coordinate of 3D Tuple
+ sal_Int64 getX() const
+ {
+ return mnX;
+ }
+
+ /// get Y-Coordinate of 3D Tuple
+ sal_Int64 getY() const
+ {
+ return mnY;
+ }
+
+ /// get Z-Coordinate of 3D Tuple
+ sal_Int64 getZ() const
+ {
+ return mnZ;
+ }
+
+ /// set X-Coordinate of 3D Tuple
+ void setX(sal_Int64 nX)
+ {
+ mnX = nX;
+ }
+
+ /// set Y-Coordinate of 3D Tuple
+ void setY(sal_Int64 nY)
+ {
+ mnY = nY;
+ }
+
+ /// set Z-Coordinate of 3D Tuple
+ void setZ(sal_Int64 nZ)
+ {
+ mnZ = nZ;
+ }
+
+ /// Array-access to 3D Tuple
+ const sal_Int64& operator[] (int nPos) const
+ {
+ // Here, normally two if(...)'s should be used. In the assumption that
+ // both sal_Int64 members can be accessed as an array a shortcut is used here.
+ // if(0 == nPos) return mnX; if(1 == nPos) return mnY; return mnZ;
+ return *((&mnX) + nPos);
+ }
+
+ /// Array-access to 3D Tuple
+ sal_Int64& operator[] (int nPos)
+ {
+ // Here, normally two if(...)'s should be used. In the assumption that
+ // both sal_Int64 members can be accessed as an array a shortcut is used here.
+ // if(0 == nPos) return mnX; if(1 == nPos) return mnY; return mnZ;
+ return *((&mnX) + nPos);
+ }
+
+ // operators
+ //////////////////////////////////////////////////////////////////////
+
+ B3I64Tuple& operator+=( const B3I64Tuple& rTup )
+ {
+ mnX += rTup.mnX;
+ mnY += rTup.mnY;
+ mnZ += rTup.mnZ;
+ return *this;
+ }
+
+ B3I64Tuple& operator-=( const B3I64Tuple& rTup )
+ {
+ mnX -= rTup.mnX;
+ mnY -= rTup.mnY;
+ mnZ -= rTup.mnZ;
+ return *this;
+ }
+
+ B3I64Tuple& operator/=( const B3I64Tuple& rTup )
+ {
+ mnX /= rTup.mnX;
+ mnY /= rTup.mnY;
+ mnZ /= rTup.mnZ;
+ return *this;
+ }
+
+ B3I64Tuple& operator*=( const B3I64Tuple& rTup )
+ {
+ mnX *= rTup.mnX;
+ mnY *= rTup.mnY;
+ mnZ *= rTup.mnZ;
+ return *this;
+ }
+
+ B3I64Tuple& operator*=(sal_Int64 t)
+ {
+ mnX *= t;
+ mnY *= t;
+ mnZ *= t;
+ return *this;
+ }
+
+ B3I64Tuple& operator/=(sal_Int64 t)
+ {
+ mnX /= t;
+ mnY /= t;
+ mnZ /= t;
+ return *this;
+ }
+
+ B3I64Tuple operator-(void) const
+ {
+ return B3I64Tuple(-mnX, -mnY, -mnZ);
+ }
+
+ bool operator==( const B3I64Tuple& rTup ) const
+ {
+ return this == &rTup || (rTup.mnX == mnX && rTup.mnY == mnY && rTup.mnZ == mnZ);
+ }
+
+ bool operator!=( const B3I64Tuple& rTup ) const
+ {
+ return !(*this == rTup);
+ }
+
+ B3I64Tuple& operator=( const B3I64Tuple& rTup )
+ {
+ mnX = rTup.mnX;
+ mnY = rTup.mnY;
+ mnZ = rTup.mnZ;
+ return *this;
+ }
+ };
+
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ inline B3I64Tuple minimum(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB)
+ {
+ B3I64Tuple aMin(
+ (rTupB.getX() < rTupA.getX()) ? rTupB.getX() : rTupA.getX(),
+ (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY(),
+ (rTupB.getZ() < rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ());
+ return aMin;
+ }
+
+ inline B3I64Tuple maximum(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB)
+ {
+ B3I64Tuple aMax(
+ (rTupB.getX() > rTupA.getX()) ? rTupB.getX() : rTupA.getX(),
+ (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY(),
+ (rTupB.getZ() > rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ());
+ return aMax;
+ }
+
+ inline B3I64Tuple absolute(const B3I64Tuple& rTup)
+ {
+ B3I64Tuple aAbs(
+ (0 > rTup.getX()) ? -rTup.getX() : rTup.getX(),
+ (0 > rTup.getY()) ? -rTup.getY() : rTup.getY(),
+ (0 > rTup.getZ()) ? -rTup.getZ() : rTup.getZ());
+ return aAbs;
+ }
+
+ inline B3DTuple interpolate(const B3I64Tuple& rOld1, const B3I64Tuple& rOld2, double t)
+ {
+ B3DTuple aInt(
+ ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(),
+ ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY(),
+ ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ());
+ return aInt;
+ }
+
+ inline B3DTuple average(const B3I64Tuple& rOld1, const B3I64Tuple& rOld2)
+ {
+ B3DTuple aAvg(
+ (rOld1.getX() + rOld2.getX()) * 0.5,
+ (rOld1.getY() + rOld2.getY()) * 0.5,
+ (rOld1.getZ() + rOld2.getZ()) * 0.5);
+ return aAvg;
+ }
+
+ inline B3DTuple average(const B3I64Tuple& rOld1, const B3I64Tuple& rOld2, const B3I64Tuple& rOld3)
+ {
+ B3DTuple aAvg(
+ (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0),
+ (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0),
+ (rOld1.getZ() + rOld2.getZ() + rOld3.getZ()) * (1.0 / 3.0));
+ return aAvg;
+ }
+
+ inline B3I64Tuple operator+(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB)
+ {
+ B3I64Tuple aSum(rTupA);
+ aSum += rTupB;
+ return aSum;
+ }
+
+ inline B3I64Tuple operator-(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB)
+ {
+ B3I64Tuple aSub(rTupA);
+ aSub -= rTupB;
+ return aSub;
+ }
+
+ inline B3I64Tuple operator/(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB)
+ {
+ B3I64Tuple aDiv(rTupA);
+ aDiv /= rTupB;
+ return aDiv;
+ }
+
+ inline B3I64Tuple operator*(const B3I64Tuple& rTupA, const B3I64Tuple& rTupB)
+ {
+ B3I64Tuple aMul(rTupA);
+ aMul *= rTupB;
+ return aMul;
+ }
+
+ inline B3I64Tuple operator*(const B3I64Tuple& rTup, sal_Int64 t)
+ {
+ B3I64Tuple aNew(rTup);
+ aNew *= t;
+ return aNew;
+ }
+
+ inline B3I64Tuple operator*(sal_Int64 t, const B3I64Tuple& rTup)
+ {
+ B3I64Tuple aNew(rTup);
+ aNew *= t;
+ return aNew;
+ }
+
+ inline B3I64Tuple operator/(const B3I64Tuple& rTup, sal_Int64 t)
+ {
+ B3I64Tuple aNew(rTup);
+ aNew /= t;
+ return aNew;
+ }
+
+ inline B3I64Tuple operator/(sal_Int64 t, const B3I64Tuple& rTup)
+ {
+ B3I64Tuple aNew(t, t, t);
+ B3I64Tuple aTmp(rTup);
+ aNew /= aTmp;
+ return aNew;
+ }
+} // end of namespace basegfx
+
+#endif /* _BGFX_TUPLE_B3I64TUPLE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/tuple/b3ituple.hxx b/include/basegfx/tuple/b3ituple.hxx
new file mode 100644
index 000000000000..49fb24634ed4
--- /dev/null
+++ b/include/basegfx/tuple/b3ituple.hxx
@@ -0,0 +1,335 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_TUPLE_B3ITUPLE_HXX
+#define _BGFX_TUPLE_B3ITUPLE_HXX
+
+#include <sal/types.h>
+#include <basegfx/tuple/b3dtuple.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ /** Base class for all Points/Vectors with three sal_Int32 values
+
+ This class provides all methods common to Point
+ avd Vector classes which are derived from here.
+
+ @derive Use this class to implement Points or Vectors
+ which are based on three sal_Int32 values
+ */
+ class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED B3ITuple
+ {
+ protected:
+ sal_Int32 mnX;
+ sal_Int32 mnY;
+ sal_Int32 mnZ;
+
+ public:
+ /** Create a 3D Tuple
+
+ The tuple is initialized to (0, 0, 0)
+ */
+ B3ITuple()
+ : mnX(0),
+ mnY(0),
+ mnZ(0)
+ {}
+
+ /** Create a 3D Tuple
+
+ @param nX
+ This parameter is used to initialize the X-coordinate
+ of the 3D Tuple.
+
+ @param nY
+ This parameter is used to initialize the Y-coordinate
+ of the 3D Tuple.
+
+ @param nZ
+ This parameter is used to initialize the Z-coordinate
+ of the 3D Tuple.
+ */
+ B3ITuple(sal_Int32 nX, sal_Int32 nY, sal_Int32 nZ)
+ : mnX(nX),
+ mnY(nY),
+ mnZ(nZ)
+ {}
+
+ /** Create a copy of a 3D Tuple
+
+ @param rTup
+ The 3D Tuple which will be copied.
+ */
+ B3ITuple(const B3ITuple& rTup)
+ : mnX( rTup.mnX ),
+ mnY( rTup.mnY ),
+ mnZ( rTup.mnZ )
+ {}
+
+ ~B3ITuple()
+ {}
+
+ /// get X-Coordinate of 3D Tuple
+ sal_Int32 getX() const
+ {
+ return mnX;
+ }
+
+ /// get Y-Coordinate of 3D Tuple
+ sal_Int32 getY() const
+ {
+ return mnY;
+ }
+
+ /// get Z-Coordinate of 3D Tuple
+ sal_Int32 getZ() const
+ {
+ return mnZ;
+ }
+
+ /// set X-Coordinate of 3D Tuple
+ void setX(sal_Int32 nX)
+ {
+ mnX = nX;
+ }
+
+ /// set Y-Coordinate of 3D Tuple
+ void setY(sal_Int32 nY)
+ {
+ mnY = nY;
+ }
+
+ /// set Z-Coordinate of 3D Tuple
+ void setZ(sal_Int32 nZ)
+ {
+ mnZ = nZ;
+ }
+
+ /// Array-access to 3D Tuple
+ const sal_Int32& operator[] (int nPos) const
+ {
+ // Here, normally two if(...)'s should be used. In the assumption that
+ // both sal_Int32 members can be accessed as an array a shortcut is used here.
+ // if(0 == nPos) return mnX; if(1 == nPos) return mnY; return mnZ;
+ return *((&mnX) + nPos);
+ }
+
+ /// Array-access to 3D Tuple
+ sal_Int32& operator[] (int nPos)
+ {
+ // Here, normally two if(...)'s should be used. In the assumption that
+ // both sal_Int32 members can be accessed as an array a shortcut is used here.
+ // if(0 == nPos) return mnX; if(1 == nPos) return mnY; return mnZ;
+ return *((&mnX) + nPos);
+ }
+
+ // operators
+ //////////////////////////////////////////////////////////////////////
+
+ B3ITuple& operator+=( const B3ITuple& rTup )
+ {
+ mnX += rTup.mnX;
+ mnY += rTup.mnY;
+ mnZ += rTup.mnZ;
+ return *this;
+ }
+
+ B3ITuple& operator-=( const B3ITuple& rTup )
+ {
+ mnX -= rTup.mnX;
+ mnY -= rTup.mnY;
+ mnZ -= rTup.mnZ;
+ return *this;
+ }
+
+ B3ITuple& operator/=( const B3ITuple& rTup )
+ {
+ mnX /= rTup.mnX;
+ mnY /= rTup.mnY;
+ mnZ /= rTup.mnZ;
+ return *this;
+ }
+
+ B3ITuple& operator*=( const B3ITuple& rTup )
+ {
+ mnX *= rTup.mnX;
+ mnY *= rTup.mnY;
+ mnZ *= rTup.mnZ;
+ return *this;
+ }
+
+ B3ITuple& operator*=(sal_Int32 t)
+ {
+ mnX *= t;
+ mnY *= t;
+ mnZ *= t;
+ return *this;
+ }
+
+ B3ITuple& operator/=(sal_Int32 t)
+ {
+ mnX /= t;
+ mnY /= t;
+ mnZ /= t;
+ return *this;
+ }
+
+ B3ITuple operator-(void) const
+ {
+ return B3ITuple(-mnX, -mnY, -mnZ);
+ }
+
+ bool operator==( const B3ITuple& rTup ) const
+ {
+ return this == &rTup || (rTup.mnX == mnX && rTup.mnY == mnY && rTup.mnZ == mnZ);
+ }
+
+ bool operator!=( const B3ITuple& rTup ) const
+ {
+ return !(*this == rTup);
+ }
+
+ B3ITuple& operator=( const B3ITuple& rTup )
+ {
+ mnX = rTup.mnX;
+ mnY = rTup.mnY;
+ mnZ = rTup.mnZ;
+ return *this;
+ }
+ };
+
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ inline B3ITuple minimum(const B3ITuple& rTupA, const B3ITuple& rTupB)
+ {
+ B3ITuple aMin(
+ (rTupB.getX() < rTupA.getX()) ? rTupB.getX() : rTupA.getX(),
+ (rTupB.getY() < rTupA.getY()) ? rTupB.getY() : rTupA.getY(),
+ (rTupB.getZ() < rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ());
+ return aMin;
+ }
+
+ inline B3ITuple maximum(const B3ITuple& rTupA, const B3ITuple& rTupB)
+ {
+ B3ITuple aMax(
+ (rTupB.getX() > rTupA.getX()) ? rTupB.getX() : rTupA.getX(),
+ (rTupB.getY() > rTupA.getY()) ? rTupB.getY() : rTupA.getY(),
+ (rTupB.getZ() > rTupA.getZ()) ? rTupB.getZ() : rTupA.getZ());
+ return aMax;
+ }
+
+ inline B3ITuple absolute(const B3ITuple& rTup)
+ {
+ B3ITuple aAbs(
+ (0 > rTup.getX()) ? -rTup.getX() : rTup.getX(),
+ (0 > rTup.getY()) ? -rTup.getY() : rTup.getY(),
+ (0 > rTup.getZ()) ? -rTup.getZ() : rTup.getZ());
+ return aAbs;
+ }
+
+ inline B3DTuple interpolate(const B3ITuple& rOld1, const B3ITuple& rOld2, double t)
+ {
+ B3DTuple aInt(
+ ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(),
+ ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY(),
+ ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ());
+ return aInt;
+ }
+
+ inline B3DTuple average(const B3ITuple& rOld1, const B3ITuple& rOld2)
+ {
+ B3DTuple aAvg(
+ (rOld1.getX() + rOld2.getX()) * 0.5,
+ (rOld1.getY() + rOld2.getY()) * 0.5,
+ (rOld1.getZ() + rOld2.getZ()) * 0.5);
+ return aAvg;
+ }
+
+ inline B3DTuple average(const B3ITuple& rOld1, const B3ITuple& rOld2, const B3ITuple& rOld3)
+ {
+ B3DTuple aAvg(
+ (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0),
+ (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0),
+ (rOld1.getZ() + rOld2.getZ() + rOld3.getZ()) * (1.0 / 3.0));
+ return aAvg;
+ }
+
+ inline B3ITuple operator+(const B3ITuple& rTupA, const B3ITuple& rTupB)
+ {
+ B3ITuple aSum(rTupA);
+ aSum += rTupB;
+ return aSum;
+ }
+
+ inline B3ITuple operator-(const B3ITuple& rTupA, const B3ITuple& rTupB)
+ {
+ B3ITuple aSub(rTupA);
+ aSub -= rTupB;
+ return aSub;
+ }
+
+ inline B3ITuple operator/(const B3ITuple& rTupA, const B3ITuple& rTupB)
+ {
+ B3ITuple aDiv(rTupA);
+ aDiv /= rTupB;
+ return aDiv;
+ }
+
+ inline B3ITuple operator*(const B3ITuple& rTupA, const B3ITuple& rTupB)
+ {
+ B3ITuple aMul(rTupA);
+ aMul *= rTupB;
+ return aMul;
+ }
+
+ inline B3ITuple operator*(const B3ITuple& rTup, sal_Int32 t)
+ {
+ B3ITuple aNew(rTup);
+ aNew *= t;
+ return aNew;
+ }
+
+ inline B3ITuple operator*(sal_Int32 t, const B3ITuple& rTup)
+ {
+ B3ITuple aNew(rTup);
+ aNew *= t;
+ return aNew;
+ }
+
+ inline B3ITuple operator/(const B3ITuple& rTup, sal_Int32 t)
+ {
+ B3ITuple aNew(rTup);
+ aNew /= t;
+ return aNew;
+ }
+
+ inline B3ITuple operator/(sal_Int32 t, const B3ITuple& rTup)
+ {
+ B3ITuple aNew(t, t, t);
+ B3ITuple aTmp(rTup);
+ aNew /= aTmp;
+ return aNew;
+ }
+} // end of namespace basegfx
+
+#endif /* _BGFX_TUPLE_B3ITUPLE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/vector/b2dsize.hxx b/include/basegfx/vector/b2dsize.hxx
new file mode 100644
index 000000000000..bde343b46685
--- /dev/null
+++ b/include/basegfx/vector/b2dsize.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 _BGFX_VECTOR_B2DSIZE_HXX
+#define _BGFX_VECTOR_B2DSIZE_HXX
+
+#include <basegfx/vector/b2dvector.hxx>
+
+namespace basegfx
+{
+ // syntactic sugar: a B2DVector exactly models a Size object,
+ // thus, for interface clarity, we provide an alias name
+
+ /// Alias name for interface clarity (not everybody is aware of the identity)
+ typedef B2DVector B2DSize;
+}
+
+#endif /* _BGFX_VECTOR_B2DSIZE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/vector/b2dvector.hxx b/include/basegfx/vector/b2dvector.hxx
new file mode 100644
index 000000000000..99489eb7169c
--- /dev/null
+++ b/include/basegfx/vector/b2dvector.hxx
@@ -0,0 +1,254 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_VECTOR_B2DVECTOR_HXX
+#define _BGFX_VECTOR_B2DVECTOR_HXX
+
+#include <basegfx/tuple/b2dtuple.hxx>
+#include <basegfx/vector/b2ivector.hxx>
+#include <basegfx/vector/b2enums.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ // predeclaration
+ class B2DHomMatrix;
+
+ /** Base Point class with two double values
+
+ This class derives all operators and common handling for
+ a 2D data class from B2DTuple. All necessary extensions
+ which are special for 2D Vectors are added here.
+
+ @see B2DTuple
+ */
+ class BASEGFX_DLLPUBLIC B2DVector : public ::basegfx::B2DTuple
+ {
+ public:
+ /** Create a 2D Vector
+
+ The vector is initialized to (0.0, 0.0)
+ */
+ B2DVector()
+ : B2DTuple()
+ {}
+
+ /** Create a 2D Vector
+
+ @param fX
+ This parameter is used to initialize the X-coordinate
+ of the 2D Vector.
+
+ @param fY
+ This parameter is used to initialize the Y-coordinate
+ of the 2D Vector.
+ */
+ B2DVector(double fX, double fY)
+ : B2DTuple(fX, fY)
+ {}
+
+ /** Create a copy of a 2D Vector
+
+ @param rVec
+ The 2D Vector which will be copied.
+ */
+ B2DVector(const B2DVector& rVec)
+ : B2DTuple(rVec)
+ {}
+
+ /** Create a copy of a 2D Vector
+
+ @param rVec
+ The 2D Vector which will be copied.
+ */
+ explicit B2DVector(const ::basegfx::B2IVector& rVec)
+ : B2DTuple(rVec)
+ {}
+
+ /** constructor with tuple to allow copy-constructing
+ from B2DTuple-based classes
+ */
+ B2DVector(const ::basegfx::B2DTuple& rTuple)
+ : B2DTuple(rTuple)
+ {}
+
+ ~B2DVector()
+ {}
+
+ /** *=operator to allow usage from B2DVector, too
+ */
+ B2DVector& operator*=( const B2DVector& rPnt )
+ {
+ mfX *= rPnt.mfX;
+ mfY *= rPnt.mfY;
+ return *this;
+ }
+
+ /** *=operator to allow usage from B2DVector, too
+ */
+ B2DVector& operator*=(double t)
+ {
+ mfX *= t;
+ mfY *= t;
+ return *this;
+ }
+
+ /** assignment operator to allow assigning the results
+ of B2DTuple calculations
+ */
+ B2DVector& operator=( const ::basegfx::B2DTuple& rVec );
+
+ /** Calculate the length of this 2D Vector
+
+ @return The Length of the 2D Vector
+ */
+ double getLength() const;
+
+ /** Set the length of this 2D Vector
+
+ @param fLen
+ The to be achieved length of the 2D Vector
+ */
+ B2DVector& setLength(double fLen);
+
+ /** Normalize this 2D Vector
+
+ The length of the 2D Vector is set to 1.0
+ */
+ B2DVector& normalize();
+
+ /** Calculate the Scalar with another 2D Vector
+
+ @param rVec
+ The second 2D Vector
+
+ @return
+ The Scalar value of the two involved 2D Vectors
+ */
+ double scalar( const B2DVector& rVec ) const;
+
+ /** Calculate the length of the cross product with another 2D Vector
+
+ In 2D, returning an actual vector does not make much
+ sense here. The magnitude, although, can be readily
+ used for tasks such as angle calculations, since for
+ the returned value, the following equation holds:
+ retVal = getLength(this)*getLength(rVec)*sin(theta),
+ with theta being the angle between the two vectors.
+
+ @param rVec
+ The second 2D Vector
+
+ @return
+ The length of the cross product of the two involved 2D Vectors
+ */
+ double cross( const B2DVector& rVec ) const;
+
+ /** Calculate the Angle with another 2D Vector
+
+ @param rVec
+ The second 2D Vector
+
+ @return
+ The Angle value of the two involved 2D Vectors in -pi/2 < return < pi/2
+ */
+ double angle( const B2DVector& rVec ) const;
+
+ /** Transform vector by given transformation matrix.
+
+ Since this is a vector, translational components of the
+ matrix are disregarded.
+ */
+ B2DVector& operator*=( const B2DHomMatrix& rMat );
+
+ static const B2DVector& getEmptyVector();
+ };
+
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ /** Calculate the orientation to another 2D Vector
+
+ @param rVecA
+ The first 2D Vector
+
+ @param rVecB
+ The second 2D Vector
+
+ @return
+ The mathematical Orientation of the two involved 2D Vectors
+ */
+ BASEGFX_DLLPUBLIC B2VectorOrientation getOrientation( const B2DVector& rVecA, const B2DVector& rVecB );
+
+ /** Calculate a perpendicular 2D Vector to the given one
+
+ @param rVec
+ The source 2D Vector
+
+ @attention This only works if the given 2D Vector is normalized.
+
+ @return
+ A 2D Vector perpendicular to the one given in parameter rVec
+ */
+ BASEGFX_DLLPUBLIC B2DVector getPerpendicular( const B2DVector& rNormalizedVec );
+
+ /** Calculate a perpendicular 2D Vector to the given one,
+ normalize the given one as preparation
+
+ @param rVec
+ The source 2D Vector
+
+ @return
+ A normalized 2D Vector perpendicular to the one given in parameter rVec
+ */
+ BASEGFX_DLLPUBLIC B2DVector getNormalizedPerpendicular( const B2DVector& rVec );
+
+ /** Test two vectors which need not to be normalized for parallelism
+
+ @param rVecA
+ The first 2D Vector
+
+ @param rVecB
+ The second 2D Vector
+
+ @return
+ bool if the two values are parallel. Also true if
+ one of the vectors is empty.
+ */
+ BASEGFX_DLLPUBLIC bool areParallel( const B2DVector& rVecA, const B2DVector& rVecB );
+
+ /** Transform vector by given transformation matrix.
+
+ Since this is a vector, translational components of the
+ matrix are disregarded.
+ */
+ BASEGFX_DLLPUBLIC B2DVector operator*( const B2DHomMatrix& rMat, const B2DVector& rVec );
+
+ /** Test continuity between given vectors.
+
+ The two given vectors are assumed to describe control points on a
+ common point. Calculate if there is a continuity between them.
+ */
+ BASEGFX_DLLPUBLIC B2VectorContinuity getContinuity( const B2DVector& rBackVector, const B2DVector& rForwardVector );
+
+} // end of namespace basegfx
+
+#endif /* _BGFX_VECTOR_B2DVECTOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/vector/b2enums.hxx b/include/basegfx/vector/b2enums.hxx
new file mode 100644
index 000000000000..abbf4cfaf546
--- /dev/null
+++ b/include/basegfx/vector/b2enums.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 _BGFX_VECTOR_B2ENUMS_HXX
+#define _BGFX_VECTOR_B2ENUMS_HXX
+
+#include <sal/types.h>
+
+namespace basegfx
+{
+ /** Descriptor for the mathematical orientations of two 2D Vectors
+ */
+ enum B2VectorOrientation
+ {
+ /// mathematically positive oriented
+ ORIENTATION_POSITIVE = 0,
+
+ /// mathematically negative oriented
+ ORIENTATION_NEGATIVE,
+
+ /// mathematically neutral, thus parallel
+ ORIENTATION_NEUTRAL
+ };
+
+ /** Descriptor for the mathematical continuity of two 2D Vectors
+ */
+ enum B2VectorContinuity
+ {
+ /// none
+ CONTINUITY_NONE = 0,
+
+ /// mathematically negative oriented
+ CONTINUITY_C1,
+
+ /// mathematically neutral, thus parallel
+ CONTINUITY_C2
+ };
+
+ /** Descriptor for possible line joins between two line segments
+ */
+ enum B2DLineJoin
+ {
+ B2DLINEJOIN_NONE, // no rounding
+ B2DLINEJOIN_MIDDLE, // calc middle value between joints
+ B2DLINEJOIN_BEVEL, // join edges with line
+ B2DLINEJOIN_MITER, // extend till cut
+ B2DLINEJOIN_ROUND // create arc
+ };
+
+} // end of namespace basegfx
+
+#endif /* _BGFX_VECTOR_B2ENUMS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/vector/b2isize.hxx b/include/basegfx/vector/b2isize.hxx
new file mode 100644
index 000000000000..4a2fe2228661
--- /dev/null
+++ b/include/basegfx/vector/b2isize.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 _BGFX_VECTOR_B2ISIZE_HXX
+#define _BGFX_VECTOR_B2ISIZE_HXX
+
+#include <basegfx/vector/b2ivector.hxx>
+
+namespace basegfx
+{
+ // syntactic sugar: a B2IVector exactly models a Size object,
+ // thus, for interface clarity, we provide an alias name
+
+ /// Alias name for interface clarity (not everybody is aware of the identity)
+ typedef B2IVector B2ISize;
+}
+
+#endif /* _BGFX_VECTOR_B2ISIZE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/vector/b2ivector.hxx b/include/basegfx/vector/b2ivector.hxx
new file mode 100644
index 000000000000..63ce2ae28fba
--- /dev/null
+++ b/include/basegfx/vector/b2ivector.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 _BGFX_VECTOR_B2IVECTOR_HXX
+#define _BGFX_VECTOR_B2IVECTOR_HXX
+
+#include <basegfx/tuple/b2ituple.hxx>
+#include <basegfx/vector/b2enums.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ // predeclaration
+ class B2DHomMatrix;
+
+ /** Base Point class with two sal_Int32 values
+
+ This class derives all operators and common handling for
+ a 2D data class from B2ITuple. All necessary extensions
+ which are special for 2D Vectors are added here.
+
+ @see B2ITuple
+ */
+ class BASEGFX_DLLPUBLIC B2IVector : public ::basegfx::B2ITuple
+ {
+ public:
+ /** Create a 2D Vector
+
+ The vector is initialized to (0, 0)
+ */
+ B2IVector()
+ : B2ITuple()
+ {}
+
+ /** Create a 2D Vector
+
+ @param nX
+ This parameter is used to initialize the X-coordinate
+ of the 2D Vector.
+
+ @param nY
+ This parameter is used to initialize the Y-coordinate
+ of the 2D Vector.
+ */
+ B2IVector(sal_Int32 nX, sal_Int32 nY)
+ : B2ITuple(nX, nY)
+ {}
+
+ /** Create a copy of a 2D Vector
+
+ @param rVec
+ The 2D Vector which will be copied.
+ */
+ B2IVector(const B2IVector& rVec)
+ : B2ITuple(rVec)
+ {}
+
+ /** constructor with tuple to allow copy-constructing
+ from B2ITuple-based classes
+ */
+ B2IVector(const ::basegfx::B2ITuple& rTuple)
+ : B2ITuple(rTuple)
+ {}
+
+ ~B2IVector()
+ {}
+
+ /** *=operator to allow usage from B2IVector, too
+ */
+ B2IVector& operator*=( const B2IVector& rPnt )
+ {
+ mnX *= rPnt.mnX;
+ mnY *= rPnt.mnY;
+ return *this;
+ }
+
+ /** *=operator to allow usage from B2IVector, too
+ */
+ B2IVector& operator*=(sal_Int32 t)
+ {
+ mnX *= t;
+ mnY *= t;
+ return *this;
+ }
+
+ /** assignment operator to allow assigning the results
+ of B2ITuple calculations
+ */
+ B2IVector& operator=( const ::basegfx::B2ITuple& rVec );
+
+ /** Set the length of this 2D Vector
+
+ @param fLen
+ The to be achieved length of the 2D Vector
+ */
+ B2IVector& setLength(double fLen);
+
+ /** Calculate the Scalar with another 2D Vector
+
+ @param rVec
+ The second 2D Vector
+
+ @return
+ The Scalar value of the two involved 2D Vectors
+ */
+ double scalar( const B2IVector& rVec ) const;
+
+ /** Transform vector by given transformation matrix.
+
+ Since this is a vector, translational components of the
+ matrix are disregarded.
+ */
+ B2IVector& operator*=( const B2DHomMatrix& rMat );
+ };
+
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ /** Transform vector by given transformation matrix.
+
+ Since this is a vector, translational components of the
+ matrix are disregarded.
+ */
+ BASEGFX_DLLPUBLIC B2IVector operator*( const B2DHomMatrix& rMat, const B2IVector& rVec );
+
+} // end of namespace basegfx
+
+#endif /* _BGFX_VECTOR_B2IVECTOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/vector/b3dvector.hxx b/include/basegfx/vector/b3dvector.hxx
new file mode 100644
index 000000000000..99f23bc7b6d3
--- /dev/null
+++ b/include/basegfx/vector/b3dvector.hxx
@@ -0,0 +1,322 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_VECTOR_B3DVECTOR_HXX
+#define _BGFX_VECTOR_B3DVECTOR_HXX
+
+#include <basegfx/tuple/b3dtuple.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ // predeclaration
+ class B3DHomMatrix;
+
+ /** Base Point class with three double values
+
+ This class derives all operators and common handling for
+ a 3D data class from B3DTuple. All necessary extensions
+ which are special for 3D Vectors are added here.
+
+ @see B3DTuple
+ */
+ class BASEGFX_DLLPUBLIC B3DVector : public ::basegfx::B3DTuple
+ {
+ public:
+ /** Create a 3D Vector
+
+ The vector is initialized to (0.0, 0.0, 0.0)
+ */
+ B3DVector()
+ : B3DTuple()
+ {}
+
+ /** Create a 3D Vector
+
+ @param fX
+ This parameter is used to initialize the X-coordinate
+ of the 3D Vector.
+
+ @param fY
+ This parameter is used to initialize the Y-coordinate
+ of the 3D Vector.
+
+ @param fZ
+ This parameter is used to initialize the Z-coordinate
+ of the 3D Vector.
+ */
+ B3DVector(double fX, double fY, double fZ)
+ : B3DTuple(fX, fY, fZ)
+ {}
+
+ /** Create a copy of a 3D Vector
+
+ @param rVec
+ The 3D Vector which will be copied.
+ */
+ B3DVector(const B3DVector& rVec)
+ : B3DTuple(rVec)
+ {}
+
+ /** constructor with tuple to allow copy-constructing
+ from B3DTuple-based classes
+ */
+ B3DVector(const ::basegfx::B3DTuple& rTuple)
+ : B3DTuple(rTuple)
+ {}
+
+ ~B3DVector()
+ {}
+
+ /** *=operator to allow usage from B3DVector, too
+ */
+ B3DVector& operator*=( const B3DVector& rPnt )
+ {
+ mfX *= rPnt.mfX;
+ mfY *= rPnt.mfY;
+ mfZ *= rPnt.mfZ;
+ return *this;
+ }
+
+ /** *=operator to allow usage from B3DVector, too
+ */
+ B3DVector& operator*=(double t)
+ {
+ mfX *= t;
+ mfY *= t;
+ mfZ *= t;
+ return *this;
+ }
+
+ /** assignment operator to allow assigning the results
+ of B3DTuple calculations
+ */
+ B3DVector& operator=( const ::basegfx::B3DTuple& rVec )
+ {
+ mfX = rVec.getX();
+ mfY = rVec.getY();
+ mfZ = rVec.getZ();
+ return *this;
+ }
+
+ /** Calculate the length of this 3D Vector
+
+ @return The Length of the 3D Vector
+ */
+ double getLength(void) const
+ {
+ double fLen(scalar(*this));
+ if((0.0 == fLen) || (1.0 == fLen))
+ return fLen;
+ return sqrt(fLen);
+ }
+
+ /** Calculate the length in the XY-Plane for this 3D Vector
+
+ @return The XY-Plane Length of the 3D Vector
+ */
+ double getXYLength(void) const
+ {
+ double fLen((mfX * mfX) + (mfY * mfY));
+ if((0.0 == fLen) || (1.0 == fLen))
+ return fLen;
+ return sqrt(fLen);
+ }
+
+ /** Calculate the length in the XZ-Plane for this 3D Vector
+
+ @return The XZ-Plane Length of the 3D Vector
+ */
+ double getXZLength(void) const
+ {
+ double fLen((mfX * mfX) + (mfZ * mfZ)); // #i73040#
+ if((0.0 == fLen) || (1.0 == fLen))
+ return fLen;
+ return sqrt(fLen);
+ }
+
+ /** Calculate the length in the YZ-Plane for this 3D Vector
+
+ @return The YZ-Plane Length of the 3D Vector
+ */
+ double getYZLength(void) const
+ {
+ double fLen((mfY * mfY) + (mfZ * mfZ));
+ if((0.0 == fLen) || (1.0 == fLen))
+ return fLen;
+ return sqrt(fLen);
+ }
+
+ /** Set the length of this 3D Vector
+
+ @param fLen
+ The to be achieved length of the 3D Vector
+ */
+ B3DVector& setLength(double fLen)
+ {
+ double fLenNow(scalar(*this));
+
+ if(!::basegfx::fTools::equalZero(fLenNow))
+ {
+ const double fOne(1.0);
+
+ if(!::basegfx::fTools::equal(fOne, fLenNow))
+ {
+ fLen /= sqrt(fLenNow);
+ }
+
+ mfX *= fLen;
+ mfY *= fLen;
+ mfZ *= fLen;
+ }
+
+ return *this;
+ }
+
+ /** Normalize this 3D Vector
+
+ The length of the 3D Vector is set to 1.0
+ */
+ B3DVector& normalize();
+
+ /** Test if this 3D Vector is normalized
+
+ @return
+ true if lenth of vector is equal to 1.0
+ false else
+ */
+ bool isNormalized() const
+ {
+ const double fOne(1.0);
+ const double fScalar(scalar(*this));
+
+ return (::basegfx::fTools::equal(fOne, fScalar));
+ }
+
+ /** get a 3D Vector which is perpendicular to this and a given 3D Vector
+
+ @attention This only works if this and the given 3D Vector are
+ both normalized.
+
+ @param rNormalizedVec
+ A normalized 3D Vector.
+
+ @return
+ A 3D Vector perpendicular to this and the given one
+ */
+ B3DVector getPerpendicular(const B3DVector& rNormalizedVec) const;
+
+ /** Calculate the Scalar product
+
+ This method calculates the Scalar product between this
+ and the given 3D Vector.
+
+ @param rVec
+ A second 3D Vector.
+
+ @return
+ The Scalar Product of two 3D Vectors
+ */
+ double scalar(const B3DVector& rVec) const
+ {
+ return ((mfX * rVec.mfX) + (mfY * rVec.mfY) + (mfZ * rVec.mfZ));
+ }
+
+ /** Transform vector by given transformation matrix.
+
+ Since this is a vector, translational components of the
+ matrix are disregarded.
+ */
+ B3DVector& operator*=( const B3DHomMatrix& rMat );
+
+ static const B3DVector& getEmptyVector()
+ {
+ return (const B3DVector&) ::basegfx::B3DTuple::getEmptyTuple();
+ }
+ };
+
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ /** get a 3D Vector which is in 2D (ignoring
+ the Z-Coordinate) perpendicular to a given 3D Vector
+
+ @attention This only works if the given 3D Vector is normalized.
+
+ @param rNormalizedVec
+ A normalized 3D Vector.
+
+ @return
+ A 3D Vector perpendicular to the given one in X,Y (2D).
+ */
+ inline B3DVector getPerpendicular2D( const B3DVector& rNormalizedVec )
+ {
+ B3DVector aPerpendicular(-rNormalizedVec.getY(), rNormalizedVec.getX(), rNormalizedVec.getZ());
+ return aPerpendicular;
+ }
+
+ /** Test two vectors which need not to be normalized for parallelism
+
+ @param rVecA
+ The first 3D Vector
+
+ @param rVecB
+ The second 3D Vector
+
+ @return
+ bool if the two values are parallel. Also true if
+ one of the vectors is empty.
+ */
+ BASEGFX_DLLPUBLIC bool areParallel( const B3DVector& rVecA, const B3DVector& rVecB );
+
+ /** Transform vector by given transformation matrix.
+
+ Since this is a vector, translational components of the
+ matrix are disregarded.
+ */
+ BASEGFX_DLLPUBLIC B3DVector operator*( const B3DHomMatrix& rMat, const B3DVector& rVec );
+
+ /** Calculate the Cross Product of two 3D Vectors
+
+ @param rVecA
+ A first 3D Vector.
+
+ @param rVecB
+ A second 3D Vector.
+
+ @return
+ The Cross Product of both 3D Vectors
+ */
+ inline B3DVector cross(const B3DVector& rVecA, const B3DVector& rVecB)
+ {
+ B3DVector aVec(
+ rVecA.getY() * rVecB.getZ() - rVecA.getZ() * rVecB.getY(),
+ rVecA.getZ() * rVecB.getX() - rVecA.getX() * rVecB.getZ(),
+ rVecA.getX() * rVecB.getY() - rVecA.getY() * rVecB.getX());
+ return aVec;
+ }
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif /* _BGFX_VECTOR_B3DVECTOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/vector/b3ivector.hxx b/include/basegfx/vector/b3ivector.hxx
new file mode 100644
index 000000000000..8248ade15cb0
--- /dev/null
+++ b/include/basegfx/vector/b3ivector.hxx
@@ -0,0 +1,249 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _BGFX_VECTOR_B3IVECTOR_HXX
+#define _BGFX_VECTOR_B3IVECTOR_HXX
+
+#include <basegfx/tuple/b3ituple.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+ // predeclaration
+ class B3DHomMatrix;
+
+ /** Base Point class with three sal_Int32 values
+
+ This class derives all operators and common handling for
+ a 3D data class from B3ITuple. All necessary extensions
+ which are special for 3D Vectors are added here.
+
+ @see B3ITuple
+ */
+ class BASEGFX_DLLPUBLIC B3IVector : public ::basegfx::B3ITuple
+ {
+ public:
+ /** Create a 3D Vector
+
+ The vector is initialized to (0, 0, 0)
+ */
+ B3IVector()
+ : B3ITuple()
+ {}
+
+ /** Create a 3D Vector
+
+ @param nX
+ This parameter is used to initialize the X-coordinate
+ of the 3D Vector.
+
+ @param nY
+ This parameter is used to initialize the Y-coordinate
+ of the 3D Vector.
+
+ @param nZ
+ This parameter is used to initialize the Z-coordinate
+ of the 3D Vector.
+ */
+ B3IVector(sal_Int32 nX, sal_Int32 nY, sal_Int32 nZ)
+ : B3ITuple(nX, nY, nZ)
+ {}
+
+ /** Create a copy of a 3D Vector
+
+ @param rVec
+ The 3D Vector which will be copied.
+ */
+ B3IVector(const B3IVector& rVec)
+ : B3ITuple(rVec)
+ {}
+
+ /** constructor with tuple to allow copy-constructing
+ from B3ITuple-based classes
+ */
+ B3IVector(const ::basegfx::B3ITuple& rTuple)
+ : B3ITuple(rTuple)
+ {}
+
+ ~B3IVector()
+ {}
+
+ /** *=operator to allow usage from B3IVector, too
+ */
+ B3IVector& operator*=( const B3IVector& rPnt )
+ {
+ mnX *= rPnt.mnX;
+ mnY *= rPnt.mnY;
+ mnZ *= rPnt.mnZ;
+ return *this;
+ }
+
+ /** *=operator to allow usage from B3IVector, too
+ */
+ B3IVector& operator*=(sal_Int32 t)
+ {
+ mnX *= t;
+ mnY *= t;
+ mnZ *= t;
+ return *this;
+ }
+
+ /** assignment operator to allow assigning the results
+ of B3ITuple calculations
+ */
+ B3IVector& operator=( const ::basegfx::B3ITuple& rVec )
+ {
+ mnX = rVec.getX();
+ mnY = rVec.getY();
+ mnZ = rVec.getZ();
+ return *this;
+ }
+
+ /** Calculate the length of this 3D Vector
+
+ @return The Length of the 3D Vector
+ */
+ double getLength(void) const
+ {
+ double fLen(scalar(*this));
+ if((0 == fLen) || (1.0 == fLen))
+ return fLen;
+ return sqrt(fLen);
+ }
+
+ /** Calculate the length in the XY-Plane for this 3D Vector
+
+ @return The XY-Plane Length of the 3D Vector
+ */
+ double getXYLength(void) const
+ {
+ double fLen((mnX * mnX) + (mnY * mnY));
+ if((0 == fLen) || (1.0 == fLen))
+ return fLen;
+ return sqrt(fLen);
+ }
+
+ /** Calculate the length in the XZ-Plane for this 3D Vector
+
+ @return The XZ-Plane Length of the 3D Vector
+ */
+ double getXZLength(void) const
+ {
+ double fLen((mnX * mnZ) + (mnY * mnZ));
+ if((0 == fLen) || (1.0 == fLen))
+ return fLen;
+ return sqrt(fLen);
+ }
+
+ /** Calculate the length in the YZ-Plane for this 3D Vector
+
+ @return The YZ-Plane Length of the 3D Vector
+ */
+ double getYZLength(void) const
+ {
+ double fLen((mnY * mnY) + (mnZ * mnZ));
+ if((0 == fLen) || (1.0 == fLen))
+ return fLen;
+ return sqrt(fLen);
+ }
+
+ /** Set the length of this 3D Vector
+
+ @param fLen
+ The to be achieved length of the 3D Vector
+ */
+ B3IVector& setLength(double fLen)
+ {
+ double fLenNow(scalar(*this));
+
+ if(!::basegfx::fTools::equalZero(fLenNow))
+ {
+ const double fOne(1.0);
+
+ if(!::basegfx::fTools::equal(fOne, fLenNow))
+ {
+ fLen /= sqrt(fLenNow);
+ }
+
+ mnX = fround(mnX*fLen);
+ mnY = fround(mnY*fLen);
+ mnZ = fround(mnZ*fLen);
+ }
+
+ return *this;
+ }
+
+ /** Calculate the Scalar product
+
+ This method calculates the Scalar product between this
+ and the given 3D Vector.
+
+ @param rVec
+ A second 3D Vector.
+
+ @return
+ The Scalar Product of two 3D Vectors
+ */
+ double scalar(const B3IVector& rVec) const
+ {
+ return ((mnX * rVec.mnX) + (mnY * rVec.mnY) + (mnZ * rVec.mnZ));
+ }
+
+ /** Transform vector by given transformation matrix.
+
+ Since this is a vector, translational components of the
+ matrix are disregarded.
+ */
+ B3IVector& operator*=( const B3DHomMatrix& rMat );
+ };
+
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ /** Transform vector by given transformation matrix.
+
+ Since this is a vector, translational components of the
+ matrix are disregarded.
+ */
+ BASEGFX_DLLPUBLIC B3IVector operator*( const B3DHomMatrix& rMat, const B3IVector& rVec );
+
+ /** Calculate the Cross Product of two 3D Vectors
+
+ @param rVecA
+ A first 3D Vector.
+
+ @param rVecB
+ A second 3D Vector.
+
+ @return
+ The Cross Product of both 3D Vectors
+ */
+ inline B3IVector cross(const B3IVector& rVecA, const B3IVector& rVecB)
+ {
+ B3IVector aVec(
+ rVecA.getY() * rVecB.getZ() - rVecA.getZ() * rVecB.getY(),
+ rVecA.getZ() * rVecB.getX() - rVecA.getX() * rVecB.getZ(),
+ rVecA.getX() * rVecB.getY() - rVecA.getY() * rVecB.getX());
+ return aVec;
+ }
+} // end of namespace basegfx
+
+#endif /* _BGFX_VECTOR_B3DVECTOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/basicdllapi.h b/include/basic/basicdllapi.h
new file mode 100644
index 000000000000..5c5c4647cd4c
--- /dev/null
+++ b/include/basic/basicdllapi.h
@@ -0,0 +1,23 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_BASICDLLAPI_H
+#define INCLUDED_BASICDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(BASIC_DLLIMPLEMENTATION)
+#define BASIC_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define BASIC_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define BASIC_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_BASICDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/basicmanagerrepository.hxx b/include/basic/basicmanagerrepository.hxx
new file mode 100644
index 000000000000..411aeadb8545
--- /dev/null
+++ b/include/basic/basicmanagerrepository.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 BASICMANAGERREPOSITORY_HXX
+#define BASICMANAGERREPOSITORY_HXX
+
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include "basicdllapi.h"
+
+class BasicManager;
+
+//........................................................................
+namespace basic
+{
+//........................................................................
+
+ //====================================================================
+ //= BasicManagerRepository
+ //====================================================================
+ /** specifies a callback for instances which are interested in BasicManagers
+ created by the BasicManagerRepository.
+ */
+ class BASIC_DLLPUBLIC SAL_NO_VTABLE BasicManagerCreationListener
+ {
+ public:
+ /** is called when a BasicManager has been created
+
+ @param _rxForDocument
+ denotes the document for which the BasicManager has been created. If this is <NULL/>,
+ then the BasicManager is the application-wide BasicManager.
+
+ @param _pBasicManager
+ denotes the BasicManager which has been created. The listener might for instance
+ decide to add global variables to it, or otherwise initialize it.
+ */
+ virtual void onBasicManagerCreated(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxForDocument,
+ BasicManager& _rBasicManager
+ ) = 0;
+
+ protected:
+ ~BasicManagerCreationListener() {}
+ };
+
+ //====================================================================
+ //= BasicManagerRepository
+ //====================================================================
+ class BASIC_DLLPUBLIC BasicManagerRepository
+ {
+ public:
+ /** returns the BasicManager belonging to the given document
+
+ If the BasicManager does not yet exist, it is created. In this case, if the application's
+ BasicManager does not yet exist, it is also created. This is necessary since
+ the application's BasicManager acts as parent for all document's BasicManagers.
+
+ If you're interested in this case - the implicit creation of the application's BasicManager -,
+ then you need to register as BasicManagerCreationListener.
+
+ @param _rxDocumentModel
+ denotes the document model whose BasicManager is to be retrieved. Must not be <NULL/>.
+ The document should support the XDocumentPropertiesSupplier
+ interface, for retrieving
+ its title, which is needed in some error conditions.
+ Also it <em>must</em> support the XStorageBasedDocument interface, since we
+ must be able to retrieve the document's storage. If this interface is <em>not</em>
+ supported, creating a new BasicManager will certainly fail.
+
+ @return
+ the BasicManager for this model.
+
+ @attention
+ The returned BasicManager instances is owned by the repository. In particular,
+ you are not allowed to delete it. Instead, the given model is observed: As soon
+ as it's closed, the associated BasicManager is deleted.
+ */
+ static BasicManager* getDocumentBasicManager(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxDocumentModel
+ );
+
+ /** returns the application-wide BasicManager
+
+ @param _bCreate
+ determines whether the BasicManager should be created (<TRUE/>) if it
+ does not yet exist.
+
+ @attention
+ If the BasicManager is newly created, then it is still owned by the repository.
+ In particular, you are not allowed to delete it. Instead, call resetApplicationBasicManager
+ to release the BasicManager.
+ */
+ static BasicManager* getApplicationBasicManager( bool _bCreate );
+
+ /** resets the application-wide BasicManager to <NULL/>
+ */
+ static void resetApplicationBasicManager();
+
+ /** registers a BasicManagerCreationListener instance which is notified whenever
+ the repository creates a BasicManager instance.
+
+ Note that this listener is <em>not</em> called when somebody else
+ creates BasicManager instances.
+
+ If the same listener is registered multiple times, it is also notified
+ multiple times, and needs to be revoked once for each registration.
+ */
+ static void registerCreationListener(
+ BasicManagerCreationListener& _rListener
+ );
+
+ /** reveokes a BasicManagerCreationListener instance which has previously
+ been registered to be notified about created BasicManager instances.
+ */
+ static void revokeCreationListener(
+ BasicManagerCreationListener& _rListener
+ );
+ };
+
+//........................................................................
+} // namespace basic
+//........................................................................
+
+#endif // BASICMANAGERREPOSITORY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/basmgr.hxx b/include/basic/basmgr.hxx
new file mode 100644
index 000000000000..12bca4779565
--- /dev/null
+++ b/include/basic/basmgr.hxx
@@ -0,0 +1,238 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _BASMGR_HXX
+#define _BASMGR_HXX
+
+#include <svl/brdcst.hxx>
+#include <basic/sbstar.hxx>
+#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
+#include <com/sun/star/script/XStarBasicAccess.hpp>
+#include "basicdllapi.h"
+#include <vector>
+
+// Basic XML Import/Export
+BASIC_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::script::XStarBasicAccess >
+ getStarBasicAccess( BasicManager* pMgr );
+
+class SotStorage;
+
+#define BASERR_REASON_OPENSTORAGE 0x0001
+#define BASERR_REASON_OPENLIBSTORAGE 0x0002
+#define BASERR_REASON_OPENMGRSTREAM 0x0004
+#define BASERR_REASON_OPENLIBSTREAM 0x0008
+#define BASERR_REASON_LIBNOTFOUND 0x0010
+#define BASERR_REASON_STORAGENOTFOUND 0x0020
+#define BASERR_REASON_BASICLOADERROR 0x0040
+#define BASERR_REASON_NOSTORAGENAME 0x0080
+
+#define BASERR_REASON_STDLIB 0x0100
+
+class BASIC_DLLPUBLIC BasicError
+{
+private:
+ sal_uIntPtr nErrorId;
+ sal_uInt16 nReason;
+ OUString aErrStr;
+
+public:
+ BasicError( const BasicError& rErr );
+ BasicError( sal_uIntPtr nId, sal_uInt16 nR, const OUString& rErrStr );
+
+ sal_uIntPtr GetErrorId() const { return nErrorId; }
+ sal_uInt16 GetReason() const { return nReason; }
+ OUString GetErrorStr() { return aErrStr; }
+
+ void SetErrorId( sal_uIntPtr n ) { nErrorId = n; }
+ void SetReason( sal_uInt16 n ) { nReason = n; }
+ void SetErrorStr( const OUString& rStr) { aErrStr = rStr; }
+};
+
+class BasicLibs;
+class ErrorManager;
+class BasicLibInfo;
+
+namespace basic { class BasicManagerCleaner; }
+
+// Library password handling for 5.0 documents
+class BASIC_DLLPUBLIC OldBasicPassword
+{
+public:
+ virtual void setLibraryPassword( const OUString& rLibraryName, const OUString& rPassword ) = 0;
+ virtual OUString getLibraryPassword( const OUString& rLibraryName ) = 0;
+ virtual void clearLibraryPassword( const OUString& rLibraryName ) = 0;
+ virtual sal_Bool hasLibraryPassword( const OUString& rLibraryName ) = 0;
+
+protected:
+ ~OldBasicPassword() {}
+};
+
+struct LibraryContainerInfo
+{
+ ::com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer > mxScriptCont;
+ ::com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer > mxDialogCont;
+ OldBasicPassword* mpOldBasicPassword;
+
+ LibraryContainerInfo()
+ :mpOldBasicPassword( NULL )
+ {
+ }
+
+ LibraryContainerInfo
+ (
+ com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer > xScriptCont,
+ com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer > xDialogCont,
+ OldBasicPassword* pOldBasicPassword
+ )
+ : mxScriptCont( xScriptCont )
+ , mxDialogCont( xDialogCont )
+ , mpOldBasicPassword( pOldBasicPassword )
+ {}
+};
+
+struct BasicManagerImpl;
+
+
+#define LIB_NOTFOUND 0xFFFF
+
+class BASIC_DLLPUBLIC BasicManager : public SfxBroadcaster
+{
+ friend class LibraryContainer_Impl;
+ friend class StarBasicAccess_Impl;
+ friend class BasMgrContainerListenerImpl;
+ friend class ::basic::BasicManagerCleaner;
+
+private:
+ BasicLibs* pLibs;
+ std::vector<BasicError> aErrors;
+
+ OUString aName;
+ OUString maStorageName;
+ bool mbDocMgr;
+
+ BasicManagerImpl* mpImpl;
+
+ BASIC_DLLPRIVATE void Init();
+
+protected:
+ sal_Bool ImpLoadLibrary( BasicLibInfo* pLibInfo ) const;
+ sal_Bool ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStorage, sal_Bool bInfosOnly = sal_False );
+ void ImpCreateStdLib( StarBASIC* pParentFromStdLib );
+ void ImpMgrNotLoaded( const OUString& rStorageName );
+ BasicLibInfo* CreateLibInfo();
+ void LoadBasicManager( SotStorage& rStorage, const OUString& rBaseURL, sal_Bool bLoadBasics = sal_True );
+ void LoadOldBasicManager( SotStorage& rStorage );
+ sal_Bool ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) const;
+ sal_Bool ImplEncryptStream( SvStream& rStream ) const;
+ BasicLibInfo* FindLibInfo( StarBASIC* pBasic ) const;
+ void CheckModules( StarBASIC* pBasic, sal_Bool bReference ) const;
+ ~BasicManager();
+
+public:
+ TYPEINFO();
+ BasicManager( SotStorage& rStorage, const OUString& rBaseURL, StarBASIC* pParentFromStdLib = NULL, OUString* pLibPath = NULL, bool bDocMgr = false );
+ BasicManager( StarBASIC* pStdLib, OUString* pLibPath = NULL, bool bDocMgr = false );
+
+ /** deletes the given BasicManager instance
+
+ This method is necessary since normally, BasicManager instances are owned by the BasicManagerRepository,
+ and expected to be deleted by the repository only. However, there exists quite some legacy code,
+ which needs to explicitly delete a BasicManager itself. This code must not use the (protected)
+ destructor, but LegacyDeleteBasicManager.
+ */
+ static void LegacyDeleteBasicManager( BasicManager*& _rpManager );
+
+ void SetStorageName( const OUString& rName ) { maStorageName = rName; }
+ OUString GetStorageName() const { return maStorageName; }
+ void SetName( const OUString& rName ) { aName = rName; }
+ OUString GetName() const { return aName; }
+
+
+ sal_uInt16 GetLibCount() const;
+ StarBASIC* GetLib( sal_uInt16 nLib ) const;
+ StarBASIC* GetLib( const OUString& rName ) const;
+ sal_uInt16 GetLibId( const OUString& rName ) const;
+
+ OUString GetLibName( sal_uInt16 nLib );
+
+ /** announces the library containers which belong to this BasicManager
+
+ The method will automatically add two global constants, BasicLibraries and DialogLibraries,
+ to the BasicManager.
+ */
+ void SetLibraryContainerInfo( const LibraryContainerInfo& rInfo );
+
+ const ::com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer >&
+ GetDialogLibraryContainer() const;
+ const ::com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer >&
+ GetScriptLibraryContainer() const;
+
+ sal_Bool LoadLib( sal_uInt16 nLib );
+ sal_Bool RemoveLib( sal_uInt16 nLib, sal_Bool bDelBasicFromStorage );
+
+ // Modify-Flag will be reset only during save.
+ sal_Bool IsBasicModified() const;
+
+ std::vector<BasicError>& GetErrors();
+
+ /** sets a global constant in the basic library, referring to some UNO object, to a new value.
+
+ If a constant with this name already existed before, its value is changed, and the old constant is
+ returned. If it does not yet exist, it is newly created, and inserted into the basic library.
+ */
+ ::com::sun::star::uno::Any
+ SetGlobalUNOConstant( const sal_Char* _pAsciiName, const ::com::sun::star::uno::Any& _rValue );
+
+ /** retrieves a global constant in the basic library, referring to some UNO object, returns true if a value is found ( value is in aOut ) false otherwise. */
+ bool GetGlobalUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut );
+ /** determines whether there are password-protected modules whose size exceedes the
+ legacy module size
+ @param _out_rModuleNames
+ takes the names of modules whose size exceeds the legacy limit
+ */
+ bool LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequence< OUString >& _out_rModuleNames );
+ bool HasExeCode( const OUString& );
+ /// determines whether the Basic Manager has a given macro, given by fully qualified name
+ bool HasMacro( OUString const& i_fullyQualifiedName ) const;
+ /// executes a given macro
+ ErrCode ExecuteMacro( OUString const& i_fullyQualifiedName, SbxArray* i_arguments, SbxValue* i_retValue );
+ /// executes a given macro
+ ErrCode ExecuteMacro( OUString const& i_fullyQualifiedName, OUString const& i_commaSeparatedArgs, SbxValue* i_retValue );
+
+private:
+ BASIC_DLLPRIVATE sal_Bool IsReference( sal_uInt16 nLib );
+
+ BASIC_DLLPRIVATE sal_Bool SetLibName( sal_uInt16 nLib, const OUString& rName );
+
+ BASIC_DLLPRIVATE StarBASIC* GetStdLib() const;
+ BASIC_DLLPRIVATE StarBASIC* AddLib( SotStorage& rStorage, const OUString& rLibName, sal_Bool bReference );
+ BASIC_DLLPRIVATE sal_Bool RemoveLib( sal_uInt16 nLib );
+ BASIC_DLLPRIVATE sal_Bool HasLib( const OUString& rName ) const;
+
+ BASIC_DLLPRIVATE StarBASIC* CreateLibForLibContainer( const OUString& rLibName,
+ const com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer >&
+ xScriptCont );
+ // For XML import/export:
+ BASIC_DLLPRIVATE StarBASIC* CreateLib( const OUString& rLibName );
+ BASIC_DLLPRIVATE StarBASIC* CreateLib( const OUString& rLibName, const OUString& Password,
+ const OUString& LinkTargetURL );
+};
+
+#endif //_BASMGR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/basrdll.hxx b/include/basic/basrdll.hxx
new file mode 100644
index 000000000000..20edde65b9cd
--- /dev/null
+++ b/include/basic/basrdll.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 _BASRDLL_HXX
+#define _BASRDLL_HXX
+
+class ResMgr;
+
+#include <vcl/accel.hxx>
+#include "basicdllapi.h"
+
+class BASIC_DLLPUBLIC BasicDLL
+{
+private:
+ ResMgr* pBasResMgr;
+
+ bool bDebugMode;
+ bool bBreakEnabled;
+
+public:
+ BasicDLL();
+ ~BasicDLL();
+
+ ResMgr* GetBasResMgr() const { return pBasResMgr; }
+
+ static void BasicBreak();
+
+ static void EnableBreak( bool bEnable );
+ static void SetDebugMode( bool bDebugMode );
+};
+
+#define BASIC_DLL() (*(BasicDLL**)GetAppData( SHL_BASIC ) )
+
+#endif //_BASRDLL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/global.hxx b/include/basic/global.hxx
new file mode 100644
index 000000000000..e63029da5785
--- /dev/null
+++ b/include/basic/global.hxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ */
+
+#ifndef BASIC_SBGLOBAL_HXX
+#define BASIC_SBGLOBAL_HXX
+
+namespace utl {
+ class TransliterationWrapper;
+}
+
+class SbGlobal
+{
+public:
+ static utl::TransliterationWrapper& GetTransliteration();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/modsizeexceeded.hxx b/include/basic/modsizeexceeded.hxx
new file mode 100644
index 000000000000..05dd70b4b66d
--- /dev/null
+++ b/include/basic/modsizeexceeded.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 _BASIC_MODSIZEEXCEEDED_HXX
+#define _BASIC_MODSIZEEXCEEDED_HXX
+
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include "basicdllapi.h"
+
+class BASIC_DLLPUBLIC ModuleSizeExceeded : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionRequest >
+{
+ // C++ interface
+ public:
+ ModuleSizeExceeded( const com::sun::star::uno::Sequence<OUString>& sModules );
+
+ sal_Bool isAbort() const;
+ sal_Bool isApprove() const;
+
+ // UNO interface
+ public:
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() throw( ::com::sun::star::uno::RuntimeException ) { return m_lContinuations; }
+ com::sun::star::uno::Any SAL_CALL getRequest() throw( com::sun::star::uno::RuntimeException )
+ {
+ return m_aRequest;
+ }
+
+ // member
+ private:
+ OUString m_sMods;
+ com::sun::star::uno::Any m_aRequest;
+ com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > > m_lContinuations;
+ com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > m_xAbort;
+ com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation> m_xApprove;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbdef.hxx b/include/basic/sbdef.hxx
new file mode 100644
index 000000000000..2bc29cbb08c3
--- /dev/null
+++ b/include/basic/sbdef.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 _SB_SBDEF_HXX
+#define _SB_SBDEF_HXX
+
+#include <basic/sbxdef.hxx>
+#include <rtl/ustring.hxx>
+#include "basicdllapi.h"
+
+// Returns type name for Basic type, array flag is ignored
+// implementation: basic/source/runtime/methods.cxx
+BASIC_DLLPUBLIC OUString getBasicTypeName( SbxDataType eType );
+
+// Returns type name for Basic objects, especially
+// important for SbUnoObj instances
+// implementation: basic/source/classes/sbunoobj.cxx
+class SbxObject;
+BASIC_DLLPUBLIC OUString getBasicObjectTypeName( SbxObject* pObj );
+
+// Allows Basic IDE to set watch mode to suppress errors
+// implementation: basic/source/runtime/runtime.cxx
+BASIC_DLLPUBLIC void setBasicWatchMode( bool bOn );
+
+// Debug Flags:
+#define SbDEBUG_BREAK 0x0001 // Break-Callback
+#define SbDEBUG_STEPINTO 0x0002 // Single Step-Callback
+#define SbDEBUG_STEPOVER 0x0004 // Additional flag Step Over
+#define SbDEBUG_CONTINUE 0x0008 // Do not change flags
+#define SbDEBUG_STEPOUT 0x0010 // Leave Sub
+
+#define SBXID_BASIC 0x6273 // sb: StarBASIC
+#define SBXID_BASICMOD 0x6d62 // bm: StarBASIC Module
+#define SBXID_BASICPROP 0x7262 // pr: StarBASIC Property
+#define SBXID_BASICMETHOD 0x6d65 // me: StarBASIC Method
+#define SBXID_JSCRIPTMOD 0x6a62 // jm: JavaScript Module
+#define SBXID_JSCRIPTMETH 0x6a64 // jm: JavaScript Module
+
+#define SBX_HINT_BASICSTART SFX_HINT_USER04
+#define SBX_HINT_BASICSTOP SFX_HINT_USER05
+
+enum PropertyMode
+{
+ PROPERTY_MODE_NONE,
+ PROPERTY_MODE_GET,
+ PROPERTY_MODE_LET,
+ PROPERTY_MODE_SET
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sberrors.hxx b/include/basic/sberrors.hxx
new file mode 100644
index 000000000000..f287f3afca88
--- /dev/null
+++ b/include/basic/sberrors.hxx
@@ -0,0 +1,418 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SB_SBERRORS_HXX
+#define _SB_SBERRORS_HXX
+
+#include <basic/sbxdef.hxx>
+
+#ifndef __RSC
+typedef sal_uIntPtr SbError;
+#endif
+
+// Mapping to SbxError
+#define ERRCODE_BASIC_SYNTAX ERRCODE_SBX_SYNTAX // unspecified syntax error
+#define ERRCODE_BASIC_BAD_ARGUMENT ERRCODE_SBX_NOTIMP // Invalid procedure call
+#define ERRCODE_BASIC_MATH_OVERFLOW ERRCODE_SBX_OVERFLOW // Overflow
+#define ERRCODE_BASIC_OUT_OF_RANGE ERRCODE_SBX_BOUNDS // Subscript out of range
+#define ERRCODE_BASIC_ZERODIV ERRCODE_SBX_ZERODIV // Division by zero
+#define ERRCODE_BASIC_CONVERSION ERRCODE_SBX_CONVERSION // Type mismatch
+#define ERRCODE_BASIC_BAD_PARAMETER ERRCODE_SBX_BAD_PARAMETER // Invalid Parameter
+#define ERRCODE_BASIC_PROC_UNDEFINED ERRCODE_SBX_PROC_UNDEFINED // Sub or Function not defined
+#define ERRCODE_BASIC_INTERNAL_ERROR ERRCODE_SBX_ERROR // internal error
+#define ERRCODE_BASIC_NO_OBJECT ERRCODE_SBX_NO_OBJECT // Object variable not set
+#define ERRCODE_BASIC_CANNOT_LOAD ERRCODE_SBX_CANNOT_LOAD // Can't load module
+#define ERRCODE_BASIC_BAD_INDEX ERRCODE_SBX_BAD_INDEX // Invalid object index
+#define ERRCODE_BASIC_NO_ACTIVE_OBJECT ERRCODE_SBX_NO_ACTIVE_OBJECT // No active view or document
+#define ERRCODE_BASIC_BAD_PROP_VALUE ERRCODE_SBX_BAD_PROP_VALUE // Bad property value
+#define ERRCODE_BASIC_PROP_READONLY ERRCODE_SBX_PROP_READONLY // Property is read only
+#define ERRCODE_BASIC_PROP_WRITEONLY ERRCODE_SBX_PROP_WRITEONLY // Property is write only
+#define ERRCODE_BASIC_INVALID_OBJECT ERRCODE_SBX_INVALID_OBJECT // Invalid object reference
+#define ERRCODE_BASIC_NO_METHOD ERRCODE_SBX_NO_METHOD // Property or method not found
+#define ERRCODE_BASIC_INVALID_USAGE_OBJECT ERRCODE_SBX_INVALID_USAGE_OBJECT // Invalid usee of object
+#define ERRCODE_BASIC_NO_OLE ERRCODE_SBX_NO_OLE // Class does not support OLE
+#define ERRCODE_BASIC_BAD_METHOD ERRCODE_SBX_BAD_METHOD // Object doesn't support method
+#define ERRCODE_BASIC_OLE_ERROR ERRCODE_SBX_OLE_ERROR // OLE Automation error
+#define ERRCODE_BASIC_BAD_ACTION ERRCODE_SBX_BAD_ACTION // Object doesn't support this action
+#define ERRCODE_BASIC_NO_NAMED_ARGS ERRCODE_SBX_NO_NAMED_ARGS // Object doesn't support named args
+#define ERRCODE_BASIC_BAD_LOCALE ERRCODE_SBX_BAD_LOCALE // Object doesn't support current locale setting
+#define ERRCODE_BASIC_NAMED_NOT_FOUND ERRCODE_SBX_NAMED_NOT_FOUND // Named argument not found
+#define ERRCODE_BASIC_NOT_OPTIONAL ERRCODE_SBX_NOT_OPTIONAL // Argument not optional
+#define ERRCODE_BASIC_WRONG_ARGS ERRCODE_SBX_WRONG_ARGS // Wrong number of arguments
+#define ERRCODE_BASIC_NOT_A_COLL ERRCODE_SBX_NOT_A_COLL // Object not a collection
+
+// Append Basic specific error messages to ERRCODE_AREA_SBX
+#define ERRCODE_BASIC_NO_GOSUB ((LAST_SBX_ERROR_ID+1UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Return without Gosub
+#define ERRCODE_BASIC_REDO_FROM_START ((LAST_SBX_ERROR_ID+2UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Redo form start (SB internal)
+#define ERRCODE_BASIC_NO_MEMORY ((LAST_SBX_ERROR_ID+3UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Out of memory
+#define ERRCODE_BASIC_ALREADY_DIM ((LAST_SBX_ERROR_ID+4UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Array already dimensioned
+#define ERRCODE_BASIC_DUPLICATE_DEF ((LAST_SBX_ERROR_ID+5UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Duplicate definition
+#define ERRCODE_BASIC_VAR_UNDEFINED ((LAST_SBX_ERROR_ID+6UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Variable undefined (SB)
+#define ERRCODE_BASIC_USER_ABORT ((LAST_SBX_ERROR_ID+7UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // User interrupt occurred
+#define ERRCODE_BASIC_BAD_RESUME ((LAST_SBX_ERROR_ID+8UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Resume without error
+#define ERRCODE_BASIC_STACK_OVERFLOW ((LAST_SBX_ERROR_ID+9UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Out of stack space
+#define ERRCODE_BASIC_BAD_DLL_LOAD ((LAST_SBX_ERROR_ID+10UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Error in loading DLL
+#define ERRCODE_BASIC_BAD_DLL_CALL ((LAST_SBX_ERROR_ID+11UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Bad DLL calling convention
+#define ERRCODE_BASIC_BAD_CHANNEL ((LAST_SBX_ERROR_ID+12UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Bad file name or number
+#define ERRCODE_BASIC_FILE_NOT_FOUND ((LAST_SBX_ERROR_ID+13UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // File not found
+#define ERRCODE_BASIC_BAD_FILE_MODE ((LAST_SBX_ERROR_ID+14UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Bad file mode
+#define ERRCODE_BASIC_FILE_ALREADY_OPEN ((LAST_SBX_ERROR_ID+15UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // File already open
+#define ERRCODE_BASIC_IO_ERROR ((LAST_SBX_ERROR_ID+16UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Device I/O error
+#define ERRCODE_BASIC_FILE_EXISTS ((LAST_SBX_ERROR_ID+17UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // File already exists
+#define ERRCODE_BASIC_BAD_RECORD_LENGTH ((LAST_SBX_ERROR_ID+18UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // bad record length
+#define ERRCODE_BASIC_DISK_FULL ((LAST_SBX_ERROR_ID+19UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // disk full
+#define ERRCODE_BASIC_READ_PAST_EOF ((LAST_SBX_ERROR_ID+20UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Input past end of file
+#define ERRCODE_BASIC_BAD_RECORD_NUMBER ((LAST_SBX_ERROR_ID+21UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Bad record number
+#define ERRCODE_BASIC_TOO_MANY_FILES ((LAST_SBX_ERROR_ID+22UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Too many files
+#define ERRCODE_BASIC_NO_DEVICE ((LAST_SBX_ERROR_ID+23UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Device not available
+#define ERRCODE_BASIC_ACCESS_DENIED ((LAST_SBX_ERROR_ID+24UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Permission denied
+#define ERRCODE_BASIC_NOT_READY ((LAST_SBX_ERROR_ID+25UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Disk not ready
+#define ERRCODE_BASIC_NOT_IMPLEMENTED ((LAST_SBX_ERROR_ID+26UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Feature not implemented
+#define ERRCODE_BASIC_DIFFERENT_DRIVE ((LAST_SBX_ERROR_ID+27UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // No rename with different drive
+#define ERRCODE_BASIC_ACCESS_ERROR ((LAST_SBX_ERROR_ID+28UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Path/File access error
+#define ERRCODE_BASIC_PATH_NOT_FOUND ((LAST_SBX_ERROR_ID+29UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Path not found
+#define ERRCODE_BASIC_BAD_PATTERN ((LAST_SBX_ERROR_ID+30UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Invalid pattern string
+#define ERRCODE_BASIC_IS_NULL ((LAST_SBX_ERROR_ID+31UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Invalid use of Null
+
+// DDE messages from 250-299
+#define ERRCODE_BASIC_DDE_ERROR ((LAST_SBX_ERROR_ID+32UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_WAITINGACK ((LAST_SBX_ERROR_ID+33UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_OUTOFCHANNELS ((LAST_SBX_ERROR_ID+34UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_NO_RESPONSE ((LAST_SBX_ERROR_ID+35UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_MULT_RESPONSES ((LAST_SBX_ERROR_ID+36UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_CHANNEL_LOCKED ((LAST_SBX_ERROR_ID+37UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_NOTPROCESSED ((LAST_SBX_ERROR_ID+38UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_TIMEOUT ((LAST_SBX_ERROR_ID+39UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_USER_INTERRUPT ((LAST_SBX_ERROR_ID+40UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_BUSY ((LAST_SBX_ERROR_ID+41UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_NO_DATA ((LAST_SBX_ERROR_ID+42UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_WRONG_DATA_FORMAT ((LAST_SBX_ERROR_ID+43UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_PARTNER_QUIT ((LAST_SBX_ERROR_ID+44UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_CONV_CLOSED ((LAST_SBX_ERROR_ID+45UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_NO_CHANNEL ((LAST_SBX_ERROR_ID+46UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_INVALID_LINK ((LAST_SBX_ERROR_ID+47UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_QUEUE_OVERFLOW ((LAST_SBX_ERROR_ID+48UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_LINK_ALREADY_EST ((LAST_SBX_ERROR_ID+49UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_LINK_INV_TOPIC ((LAST_SBX_ERROR_ID+50UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_DLL_NOT_FOUND ((LAST_SBX_ERROR_ID+51UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+
+#define ERRCODE_BASIC_NEEDS_OBJECT ((LAST_SBX_ERROR_ID+52UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Object required
+#define ERRCODE_BASIC_BAD_ORDINAL ((LAST_SBX_ERROR_ID+53UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Invalid ordinal
+#define ERRCODE_BASIC_DLLPROC_NOT_FOUND ((LAST_SBX_ERROR_ID+54UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Specified DLL function not found
+#define ERRCODE_BASIC_BAD_CLIPBD_FORMAT ((LAST_SBX_ERROR_ID+55UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Invalid clipboard format
+
+// Debugger messages from 700-799
+
+#define ERRCODE_BASIC_PROPERTY_NOT_FOUND ((LAST_SBX_ERROR_ID+56UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Class not have property
+#define ERRCODE_BASIC_METHOD_NOT_FOUND ((LAST_SBX_ERROR_ID+57UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Class does not have method
+#define ERRCODE_BASIC_ARG_MISSING ((LAST_SBX_ERROR_ID+58UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Missing required argument
+#define ERRCODE_BASIC_BAD_NUMBER_OF_ARGS ((LAST_SBX_ERROR_ID+59UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Bad number of arguments
+#define ERRCODE_BASIC_METHOD_FAILED ((LAST_SBX_ERROR_ID+60UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Method failed
+#define ERRCODE_BASIC_SETPROP_FAILED ((LAST_SBX_ERROR_ID+61UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Unable to set property
+#define ERRCODE_BASIC_GETPROP_FAILED ((LAST_SBX_ERROR_ID+62UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Unable to get property
+
+// Compiler Errors (do not occure at runtime)
+// These IDs can shift at any time
+
+#define ERRCODE_BASIC_UNEXPECTED ((LAST_SBX_ERROR_ID+63UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Unexpected symbol: xx
+#define ERRCODE_BASIC_EXPECTED ((LAST_SBX_ERROR_ID+64UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Expected: xx
+#define ERRCODE_BASIC_SYMBOL_EXPECTED ((LAST_SBX_ERROR_ID+65UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Symbol expected
+#define ERRCODE_BASIC_VAR_EXPECTED ((LAST_SBX_ERROR_ID+66UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Variable expected
+#define ERRCODE_BASIC_LABEL_EXPECTED ((LAST_SBX_ERROR_ID+67UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Label expected
+#define ERRCODE_BASIC_LVALUE_EXPECTED ((LAST_SBX_ERROR_ID+68UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Lvalue expected
+#define ERRCODE_BASIC_VAR_DEFINED ((LAST_SBX_ERROR_ID+69UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Variable xxx already defined
+#define ERRCODE_BASIC_PROC_DEFINED ((LAST_SBX_ERROR_ID+70UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Procedure xx already defined
+#define ERRCODE_BASIC_LABEL_DEFINED ((LAST_SBX_ERROR_ID+71UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Label xxx already defined
+#define ERRCODE_BASIC_UNDEF_VAR ((LAST_SBX_ERROR_ID+72UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Variable xx undefined
+#define ERRCODE_BASIC_UNDEF_ARRAY ((LAST_SBX_ERROR_ID+73UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Array or function xx undefined
+#define ERRCODE_BASIC_UNDEF_PROC ((LAST_SBX_ERROR_ID+74UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Procedure xxx undefined
+#define ERRCODE_BASIC_UNDEF_LABEL ((LAST_SBX_ERROR_ID+75UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Label xxx undefined
+#define ERRCODE_BASIC_UNDEF_TYPE ((LAST_SBX_ERROR_ID+76UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Unknown user defined type xxx
+#define ERRCODE_BASIC_BAD_EXIT ((LAST_SBX_ERROR_ID+77UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Exit XXX expected
+#define ERRCODE_BASIC_BAD_BLOCK ((LAST_SBX_ERROR_ID+78UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Unterminated statement block: missing XX
+#define ERRCODE_BASIC_BAD_BRACKETS ((LAST_SBX_ERROR_ID+79UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Parentheses do not match
+#define ERRCODE_BASIC_BAD_DECLARATION ((LAST_SBX_ERROR_ID+80UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Symbol xx defined differently
+#define ERRCODE_BASIC_BAD_PARAMETERS ((LAST_SBX_ERROR_ID+81UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Parameters do not match
+#define ERRCODE_BASIC_BAD_CHAR_IN_NUMBER ((LAST_SBX_ERROR_ID+82UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Bad character in number
+#define ERRCODE_BASIC_MUST_HAVE_DIMS ((LAST_SBX_ERROR_ID+83UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Array needs dimensioning
+#define ERRCODE_BASIC_NO_IF ((LAST_SBX_ERROR_ID+84UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Else/Endif without If
+#define ERRCODE_BASIC_NOT_IN_SUBR ((LAST_SBX_ERROR_ID+85UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // xxx not allowed within a sub
+#define ERRCODE_BASIC_NOT_IN_MAIN ((LAST_SBX_ERROR_ID+86UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // xxx not allowed outside a sub
+#define ERRCODE_BASIC_WRONG_DIMS ((LAST_SBX_ERROR_ID+87UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Dimensions do not match
+#define ERRCODE_BASIC_BAD_OPTION ((LAST_SBX_ERROR_ID+88UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Unknown option: xxx
+#define ERRCODE_BASIC_CONSTANT_REDECLARED ((LAST_SBX_ERROR_ID+89UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Constant xx redeclared
+#define ERRCODE_BASIC_PROG_TOO_LARGE ((LAST_SBX_ERROR_ID+90UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Program is too large
+#define ERRCODE_BASIC_NO_STRINGS_ARRAYS ((LAST_SBX_ERROR_ID+91UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER)
+
+#define ERRCODE_BASIC_EXCEPTION ((LAST_SBX_ERROR_ID+92UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+
+#define ERRCODE_BASMGR_STDLIBOPEN (LAST_SBX_ERROR_ID+93UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_STDLIBSAVE (LAST_SBX_ERROR_ID+94UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_LIBLOAD (LAST_SBX_ERROR_ID+95UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_LIBCREATE (LAST_SBX_ERROR_ID+96UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_LIBSAVE (LAST_SBX_ERROR_ID+97UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_LIBDEL (LAST_SBX_ERROR_ID+98UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_MGROPEN (LAST_SBX_ERROR_ID+99UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_MGRSAVE (LAST_SBX_ERROR_ID+100UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_REMOVELIB (LAST_SBX_ERROR_ID+101UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_UNLOADLIB (LAST_SBX_ERROR_ID+102UL) | ERRCODE_AREA_SBX
+
+#define ERRCODE_BASIC_ARRAY_FIX ((LAST_SBX_ERROR_ID+104UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // This array is fixed
+#define ERRCODE_BASIC_STRING_OVERFLOW ((LAST_SBX_ERROR_ID+105UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Out of string space
+#define ERRCODE_BASIC_EXPR_TOO_COMPLEX ((LAST_SBX_ERROR_ID+106UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Expression too complex
+#define ERRCODE_BASIC_OPER_NOT_PERFORM ((LAST_SBX_ERROR_ID+107UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Can't perform requested operation
+#define ERRCODE_BASIC_TOO_MANY_DLL ((LAST_SBX_ERROR_ID+108UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Too many dll application clients
+#define ERRCODE_BASIC_LOOP_NOT_INIT ((LAST_SBX_ERROR_ID+109UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // For loop not initialized
+
+#define ERRCODE_BASIC_COMPAT ((LAST_SBX_ERROR_ID+103UL)| ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME)
+
+// Map old codes to new codes
+#define SbERR_SYNTAX ERRCODE_BASIC_SYNTAX
+#define SbERR_NO_GOSUB ERRCODE_BASIC_NO_GOSUB
+#define SbERR_REDO_FROM_START ERRCODE_BASIC_REDO_FROM_START
+#define SbERR_BAD_ARGUMENT ERRCODE_BASIC_BAD_ARGUMENT
+#define SbERR_MATH_OVERFLOW ERRCODE_BASIC_MATH_OVERFLOW
+#define SbERR_NO_MEMORY ERRCODE_BASIC_NO_MEMORY
+#define SbERR_ALREADY_DIM ERRCODE_BASIC_ALREADY_DIM
+#define SbERR_OUT_OF_RANGE ERRCODE_BASIC_OUT_OF_RANGE
+#define SbERR_DUPLICATE_DEF ERRCODE_BASIC_DUPLICATE_DEF
+#define SbERR_ZERODIV ERRCODE_BASIC_ZERODIV
+#define SbERR_VAR_UNDEFINED ERRCODE_BASIC_VAR_UNDEFINED
+#define SbERR_CONVERSION ERRCODE_BASIC_CONVERSION
+#define SbERR_BAD_PARAMETER ERRCODE_BASIC_BAD_PARAMETER
+#define SbERR_USER_ABORT ERRCODE_BASIC_USER_ABORT
+#define SbERR_BAD_RESUME ERRCODE_BASIC_BAD_RESUME
+#define SbERR_STACK_OVERFLOW ERRCODE_BASIC_STACK_OVERFLOW
+#define SbERR_PROC_UNDEFINED ERRCODE_BASIC_PROC_UNDEFINED
+#define SbERR_BAD_DLL_LOAD ERRCODE_BASIC_BAD_DLL_LOAD
+#define SbERR_BAD_DLL_CALL ERRCODE_BASIC_BAD_DLL_CALL
+#define SbERR_INTERNAL_ERROR ERRCODE_BASIC_INTERNAL_ERROR
+#define SbERR_BAD_CHANNEL ERRCODE_BASIC_BAD_CHANNEL
+#define SbERR_FILE_NOT_FOUND ERRCODE_BASIC_FILE_NOT_FOUND
+#define SbERR_BAD_FILE_MODE ERRCODE_BASIC_BAD_FILE_MODE
+#define SbERR_FILE_ALREADY_OPEN ERRCODE_BASIC_FILE_ALREADY_OPEN
+#define SbERR_IO_ERROR ERRCODE_BASIC_IO_ERROR
+#define SbERR_FILE_EXISTS ERRCODE_BASIC_FILE_EXISTS
+#define SbERR_BAD_RECORD_LENGTH ERRCODE_BASIC_BAD_RECORD_LENGTH
+#define SbERR_DISK_FULL ERRCODE_BASIC_DISK_FULL
+#define SbERR_READ_PAST_EOF ERRCODE_BASIC_READ_PAST_EOF
+#define SbERR_BAD_RECORD_NUMBER ERRCODE_BASIC_BAD_RECORD_NUMBER
+#define SbERR_TOO_MANY_FILES ERRCODE_BASIC_TOO_MANY_FILES
+#define SbERR_NO_DEVICE ERRCODE_BASIC_NO_DEVICE
+#define SbERR_ACCESS_DENIED ERRCODE_BASIC_ACCESS_DENIED
+#define SbERR_NOT_READY ERRCODE_BASIC_NOT_READY
+#define SbERR_NOT_IMPLEMENTED ERRCODE_BASIC_NOT_IMPLEMENTED
+#define SbERR_DIFFERENT_DRIVE ERRCODE_BASIC_DIFFERENT_DRIVE
+#define SbERR_ACCESS_ERROR ERRCODE_BASIC_ACCESS_ERROR
+#define SbERR_PATH_NOT_FOUND ERRCODE_BASIC_PATH_NOT_FOUND
+#define SbERR_NO_OBJECT ERRCODE_BASIC_NO_OBJECT
+#define SbERR_BAD_PATTERN ERRCODE_BASIC_BAD_PATTERN
+#define SBERR_IS_NULL ERRCODE_BASIC_IS_NULL
+#define SbERR_DDE_ERROR ERRCODE_BASIC_DDE_ERROR
+#define SbERR_DDE_WAITINGACK ERRCODE_BASIC_DDE_WAITINGACK
+#define SbERR_DDE_OUTOFCHANNELS ERRCODE_BASIC_DDE_OUTOFCHANNELS
+#define SbERR_DDE_NO_RESPONSE ERRCODE_BASIC_DDE_NO_RESPONSE
+#define SbERR_DDE_MULT_RESPONSES ERRCODE_BASIC_DDE_MULT_RESPONSES
+#define SbERR_DDE_CHANNEL_LOCKED ERRCODE_BASIC_DDE_CHANNEL_LOCKED
+#define SbERR_DDE_NOTPROCESSED ERRCODE_BASIC_DDE_NOTPROCESSED
+#define SbERR_DDE_TIMEOUT ERRCODE_BASIC_DDE_TIMEOUT
+#define SbERR_DDE_USER_INTERRUPT ERRCODE_BASIC_DDE_USER_INTERRUPT
+#define SbERR_DDE_BUSY ERRCODE_BASIC_DDE_BUSY
+#define SbERR_DDE_NO_DATA ERRCODE_BASIC_DDE_NO_DATA
+#define SbERR_DDE_WRONG_DATA_FORMAT ERRCODE_BASIC_DDE_WRONG_DATA_FORMAT
+#define SbERR_DDE_PARTNER_QUIT ERRCODE_BASIC_DDE_PARTNER_QUIT
+#define SbERR_DDE_CONV_CLOSED ERRCODE_BASIC_DDE_CONV_CLOSED
+#define SbERR_DDE_NO_CHANNEL ERRCODE_BASIC_DDE_NO_CHANNEL
+#define SbERR_DDE_INVALID_LINK ERRCODE_BASIC_DDE_INVALID_LINK
+#define SbERR_DDE_QUEUE_OVERFLOW ERRCODE_BASIC_DDE_QUEUE_OVERFLOW
+#define SbERR_DDE_LINK_ALREADY_EST ERRCODE_BASIC_DDE_LINK_ALREADY_EST
+#define SbERR_DDE_LINK_INV_TOPIC ERRCODE_BASIC_DDE_LINK_INV_TOPIC
+#define SbERR_DDE_DLL_NOT_FOUND ERRCODE_BASIC_DDE_DLL_NOT_FOUND
+#define SbERR_CANNOT_LOAD ERRCODE_BASIC_CANNOT_LOAD
+#define SbERR_BAD_INDEX ERRCODE_BASIC_BAD_INDEX
+#define SbERR_NO_ACTIVE_OBJECT ERRCODE_BASIC_NO_ACTIVE_OBJECT
+#define SbERR_BAD_PROP_VALUE ERRCODE_BASIC_BAD_PROP_VALUE
+#define SbERR_PROP_READONLY ERRCODE_BASIC_PROP_READONLY
+#define SbERR_PROP_WRITEONLY ERRCODE_BASIC_PROP_WRITEONLY
+#define SbERR_INVALID_OBJECT ERRCODE_BASIC_INVALID_OBJECT
+#define SbERR_NO_METHOD ERRCODE_BASIC_NO_METHOD
+#define SbERR_NEEDS_OBJECT ERRCODE_BASIC_NEEDS_OBJECT
+#define SbERR_INVALID_USAGE_OBJECT ERRCODE_BASIC_INVALID_USAGE_OBJECT
+#define SbERR_NO_OLE ERRCODE_BASIC_NO_OLE
+#define SbERR_BAD_METHOD ERRCODE_BASIC_BAD_METHOD
+#define SbERR_OLE_ERROR ERRCODE_BASIC_OLE_ERROR
+#define SbERR_BAD_ACTION ERRCODE_BASIC_BAD_ACTION
+#define SbERR_NO_NAMED_ARGS ERRCODE_BASIC_NO_NAMED_ARGS
+#define SbERR_BAD_LOCALE ERRCODE_BASIC_BAD_LOCALE
+#define SbERR_NAMED_NOT_FOUND ERRCODE_BASIC_NAMED_NOT_FOUND
+#define SbERR_NOT_OPTIONAL ERRCODE_BASIC_NOT_OPTIONAL
+#define SbERR_WRONG_ARGS ERRCODE_BASIC_WRONG_ARGS
+#define SbERR_NOT_A_COLL ERRCODE_BASIC_NOT_A_COLL
+#define SbERR_BAD_ORDINAL ERRCODE_BASIC_BAD_ORDINAL
+#define SbERR_DLLPROC_NOT_FOUND ERRCODE_BASIC_DLLPROC_NOT_FOUND
+#define SbERR_BAD_CLIPBD_FORMAT ERRCODE_BASIC_BAD_CLIPBD_FORMAT
+#define SbERR_PROPERTY_NOT_FOUND ERRCODE_BASIC_PROPERTY_NOT_FOUND
+#define SbERR_METHOD_NOT_FOUND ERRCODE_BASIC_METHOD_NOT_FOUND
+#define SbERR_ARG_MISSING ERRCODE_BASIC_ARG_MISSING
+#define SbERR_BAD_NUMBER_OF_ARGS ERRCODE_BASIC_BAD_NUMBER_OF_ARGS
+#define SbERR_METHOD_FAILED ERRCODE_BASIC_METHOD_FAILED
+#define SbERR_SETPROP_FAILED ERRCODE_BASIC_SETPROP_FAILED
+#define SbERR_GETPROP_FAILED ERRCODE_BASIC_GETPROP_FAILED
+#define SbERR_UNEXPECTED ERRCODE_BASIC_UNEXPECTED
+#define SbERR_EXPECTED ERRCODE_BASIC_EXPECTED
+#define SbERR_SYMBOL_EXPECTED ERRCODE_BASIC_SYMBOL_EXPECTED
+#define SbERR_VAR_EXPECTED ERRCODE_BASIC_VAR_EXPECTED
+#define SbERR_LABEL_EXPECTED ERRCODE_BASIC_LABEL_EXPECTED
+#define SbERR_LVALUE_EXPECTED ERRCODE_BASIC_LVALUE_EXPECTED
+#define SbERR_VAR_DEFINED ERRCODE_BASIC_VAR_DEFINED
+#define SbERR_PROC_DEFINED ERRCODE_BASIC_PROC_DEFINED
+#define SbERR_LABEL_DEFINED ERRCODE_BASIC_LABEL_DEFINED
+#define SbERR_UNDEF_VAR ERRCODE_BASIC_UNDEF_VAR
+#define SbERR_UNDEF_ARRAY ERRCODE_BASIC_UNDEF_ARRAY
+#define SbERR_UNDEF_PROC ERRCODE_BASIC_UNDEF_PROC
+#define SbERR_UNDEF_LABEL ERRCODE_BASIC_UNDEF_LABEL
+#define SbERR_UNDEF_TYPE ERRCODE_BASIC_UNDEF_TYPE
+#define SbERR_BAD_EXIT ERRCODE_BASIC_BAD_EXIT
+#define SbERR_BAD_BLOCK ERRCODE_BASIC_BAD_BLOCK
+#define SbERR_BAD_BRACKETS ERRCODE_BASIC_BAD_BRACKETS
+#define SbERR_BAD_DECLARATION ERRCODE_BASIC_BAD_DECLARATION
+#define SbERR_BAD_PARAMETERS ERRCODE_BASIC_BAD_PARAMETERS
+#define SbERR_BAD_CHAR_IN_NUMBER ERRCODE_BASIC_BAD_CHAR_IN_NUMBER
+#define SbERR_MUST_HAVE_DIMS ERRCODE_BASIC_MUST_HAVE_DIMS
+#define SbERR_NO_IF ERRCODE_BASIC_NO_IF
+#define SbERR_NOT_IN_SUBR ERRCODE_BASIC_NOT_IN_SUBR
+#define SbERR_NOT_IN_MAIN ERRCODE_BASIC_NOT_IN_MAIN
+#define SbERR_WRONG_DIMS ERRCODE_BASIC_WRONG_DIMS
+#define SbERR_BAD_OPTION ERRCODE_BASIC_BAD_OPTION
+#define SbERR_CONSTANT_REDECLARED ERRCODE_BASIC_CONSTANT_REDECLARED
+#define SbERR_PROG_TOO_LARGE ERRCODE_BASIC_PROG_TOO_LARGE
+#define SbERR_NO_STRINGS_ARRAYS ERRCODE_BASIC_NO_STRINGS_ARRAYS
+#define SbERR_BASIC_EXCEPTION ERRCODE_BASIC_EXCEPTION
+#define SbERR_BASIC_COMPAT ERRCODE_BASIC_COMPAT
+#define SbERR_BASIC_ARRAY_FIX ERRCODE_BASIC_ARRAY_FIX
+#define SbERR_BASIC_STRING_OVERFLOW ERRCODE_BASIC_STRING_OVERFLOW
+#define SbERR_BASIC_EXPR_TOO_COMPLEX ERRCODE_BASIC_EXPR_TOO_COMPLEX
+#define SbERR_BASIC_OPER_NOT_PERFORM ERRCODE_BASIC_OPER_NOT_PERFORM
+#define SbERR_BASIC_TOO_MANY_DLL ERRCODE_BASIC_TOO_MANY_DLL
+#define SbERR_BASIC_LOOP_NOT_INIT ERRCODE_BASIC_LOOP_NOT_INIT
+
+// Grid messages from 30000-30999
+// OLE messages from 31000-31999
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbmeth.hxx b/include/basic/sbmeth.hxx
new file mode 100644
index 000000000000..9d4afbc37a24
--- /dev/null
+++ b/include/basic/sbmeth.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 _SB_SBMETH_HXX
+#define _SB_SBMETH_HXX
+
+#include <tools/errcode.hxx>
+#include <basic/sbxmeth.hxx>
+#include <basic/sbdef.hxx>
+#include "basicdllapi.h"
+
+class SbModule;
+
+class BASIC_DLLPUBLIC SbMethod : public SbxMethod
+{
+ friend class SbiRuntime;
+ friend class SbiFactory;
+ friend class SbModule;
+ friend class SbClassModuleObject;
+ friend class SbiCodeGen;
+ friend class SbJScriptMethod;
+ friend class SbIfaceMapperMethod;
+
+ SbxVariable* mCaller; // caller
+ SbModule* pMod;
+ sal_uInt16 nDebugFlags;
+ sal_uInt16 nLine1, nLine2;
+ sal_uInt32 nStart;
+ sal_Bool bInvalid;
+ SbxArrayRef refStatics;
+ BASIC_DLLPRIVATE SbMethod( const OUString&, SbxDataType, SbModule* );
+ BASIC_DLLPRIVATE SbMethod( const SbMethod& );
+ virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
+ virtual sal_Bool StoreData( SvStream& ) const;
+ virtual ~SbMethod();
+
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMETHOD,2);
+ TYPEINFO();
+ virtual SbxInfo* GetInfo();
+ SbxArray* GetStatics();
+ void ClearStatics();
+ SbModule* GetModule() { return pMod; }
+ sal_uInt32 GetId() const { return nStart; }
+ sal_uInt16 GetDebugFlags() { return nDebugFlags; }
+ void SetDebugFlags( sal_uInt16 n ) { nDebugFlags = n; }
+ void GetLineRange( sal_uInt16&, sal_uInt16& );
+
+ // Interface to execute a method from the applications
+ virtual ErrCode Call( SbxValue* pRet = NULL, SbxVariable* pCaller = NULL );
+ virtual void Broadcast( sal_uIntPtr nHintId );
+};
+
+SV_DECL_IMPL_REF(SbMethod)
+
+class BASIC_DLLPUBLIC SbIfaceMapperMethod : public SbMethod
+{
+ friend class SbiRuntime;
+
+ SbMethodRef mxImplMeth;
+
+public:
+ TYPEINFO();
+ SbIfaceMapperMethod( const OUString& rName, SbMethod* pImplMeth )
+ : SbMethod( rName, pImplMeth->GetType(), NULL )
+ , mxImplMeth( pImplMeth )
+ {}
+ virtual ~SbIfaceMapperMethod();
+ SbMethod* getImplMethod( void )
+ { return mxImplMeth; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbmod.hxx b/include/basic/sbmod.hxx
new file mode 100644
index 000000000000..f94e2c9e8a36
--- /dev/null
+++ b/include/basic/sbmod.hxx
@@ -0,0 +1,164 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SB_SBMOD_HXX
+#define _SB_SBMOD_HXX
+
+#include <com/sun/star/script/XInvocation.hpp>
+#include <basic/sbdef.hxx>
+#include <basic/sbxobj.hxx>
+#include <basic/sbxdef.hxx>
+#include <rtl/ustring.hxx>
+#include <vector>
+#include <deque>
+#include <boost/utility.hpp>
+#include "basicdllapi.h"
+
+class SbMethod;
+class SbProperty;
+class SbiRuntime;
+typedef std::deque< sal_uInt16 > SbiBreakpoints;
+class SbiImage;
+class SbProcedureProperty;
+class SbIfaceMapperMethod;
+class SbClassModuleObject;
+
+class ModuleInitDependencyMap;
+struct ClassModuleRunInitItem;
+struct SbClassData;
+
+class BASIC_DLLPUBLIC SbModule : public SbxObject, private ::boost::noncopyable
+{
+ friend class SbiCodeGen;
+ friend class SbMethod;
+ friend class SbiRuntime;
+ friend class StarBASIC;
+ friend class SbClassModuleObject;
+
+ std::vector< OUString > mModuleVariableNames;
+
+ BASIC_DLLPRIVATE void implClearIfVarDependsOnDeletedBasic( SbxVariable* pVar, StarBASIC* pDeletedBasic );
+
+protected:
+ com::sun::star::uno::Reference< com::sun::star::script::XInvocation > mxWrapper;
+ OUString aOUSource;
+ OUString aComment;
+ SbiImage* pImage; // the Image
+ SbiBreakpoints* pBreaks; // Breakpoints
+ SbClassData* pClassData;
+ bool mbVBACompat;
+ sal_Int32 mnType;
+ SbxObjectRef pDocObject; // an impl object ( used by Document Modules )
+ bool bIsProxyModule;
+
+ static void implProcessModuleRunInit( ModuleInitDependencyMap& rMap, ClassModuleRunInitItem& rItem );
+ void StartDefinitions();
+ SbMethod* GetMethod( const OUString&, SbxDataType );
+ SbProperty* GetProperty( const OUString&, SbxDataType );
+ SbProcedureProperty* GetProcedureProperty( const OUString&, SbxDataType );
+ SbIfaceMapperMethod* GetIfaceMapperMethod( const OUString&, SbMethod* );
+ void EndDefinitions( sal_Bool=sal_False );
+ sal_uInt16 Run( SbMethod* );
+ void RunInit();
+ void ClearPrivateVars();
+ void ClearVarsDependingOnDeletedBasic( StarBASIC* pDeletedBasic );
+ void GlobalRunInit( bool bBasicStart ); // for all modules
+ void GlobalRunDeInit( void );
+ const sal_uInt8* FindNextStmnt( const sal_uInt8*, sal_uInt16&, sal_uInt16& ) const;
+ const sal_uInt8* FindNextStmnt( const sal_uInt8*, sal_uInt16&, sal_uInt16&,
+ sal_Bool bFollowJumps, const SbiImage* pImg=NULL ) const;
+ virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
+ virtual sal_Bool StoreData( SvStream& ) const;
+ virtual sal_Bool LoadCompleted();
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+ void handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rHint );
+ virtual ~SbModule();
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMOD,2);
+ TYPEINFO();
+ SbModule( const OUString&, sal_Bool bCompat = sal_False );
+ virtual void SetParent( SbxObject* );
+ virtual void Clear();
+
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
+
+ virtual const OUString& GetSource() const;
+ const OUString& GetSource32() const;
+ const OUString& GetComment() const { return aComment; }
+ virtual void SetSource( const OUString& r );
+ void SetSource32( const OUString& r );
+
+ virtual sal_Bool Compile();
+ virtual sal_Bool IsCompiled() const;
+ const SbxObject* FindType( OUString aTypeName ) const;
+
+ virtual sal_Bool IsBreakable( sal_uInt16 nLine ) const;
+ virtual sal_Bool IsBP( sal_uInt16 nLine ) const;
+ virtual sal_Bool SetBP( sal_uInt16 nLine );
+ virtual sal_Bool ClearBP( sal_uInt16 nLine );
+ virtual void ClearAllBP();
+
+ // Store only image, no source (needed for new password protection)
+ sal_Bool StoreBinaryData( SvStream& );
+ sal_Bool StoreBinaryData( SvStream&, sal_uInt16 nVer );
+ sal_Bool LoadBinaryData( SvStream&, sal_uInt16 nVer );
+ sal_Bool LoadBinaryData( SvStream& );
+ sal_Bool ExceedsLegacyModuleSize();
+ void fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg = NULL ) const;
+ bool HasExeCode();
+ bool IsVBACompat() const;
+ void SetVBACompat( bool bCompat );
+ sal_Int32 GetModuleType() { return mnType; }
+ void SetModuleType( sal_Int32 nType ) { mnType = nType; }
+ bool isProxyModule() { return bIsProxyModule; }
+ void AddVarName( const OUString& aName );
+ void RemoveVars();
+ ::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > GetUnoModule();
+ bool createCOMWrapperForIface( ::com::sun::star::uno::Any& o_rRetAny, SbClassModuleObject* pProxyClassModuleObject );
+};
+
+SV_DECL_IMPL_REF(SbModule)
+
+// Object class for instances of class modules
+class BASIC_DLLPUBLIC SbClassModuleObject : public SbModule
+{
+ SbModule* mpClassModule;
+ bool mbInitializeEventDone;
+
+public:
+ TYPEINFO();
+ SbClassModuleObject( SbModule* pClassModule );
+ ~SbClassModuleObject();
+
+ // Overridden to support NameAccess etc.
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
+
+ virtual void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& );
+
+ SbModule* getClassModule( void )
+ { return mpClassModule; }
+
+ void triggerInitializeEvent( void );
+ void triggerTerminateEvent( void );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbobjmod.hxx b/include/basic/sbobjmod.hxx
new file mode 100644
index 000000000000..14ca48681688
--- /dev/null
+++ b/include/basic/sbobjmod.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 _SB_OBJMOD_HXX
+#define _SB_OBJMOD_HXX
+
+#include <rtl/ref.hxx>
+#include <basic/sbmod.hxx>
+#include <basic/sbstar.hxx>
+#include <com/sun/star/script/ModuleInfo.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/awt/XDialog.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include "basicdllapi.h"
+
+// Basic-Module for excel object.
+
+class BASIC_DLLPUBLIC SbObjModule : public SbModule
+{
+protected:
+ virtual ~SbObjModule();
+
+public:
+ TYPEINFO();
+ SbObjModule( const OUString& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVbaCompatible );
+ virtual SbxVariable* Find( const OUString& rName, SbxClassType t );
+
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+
+ using SbxValue::GetObject;
+ SbxVariable* GetObject();
+ void SetUnoObject( const com::sun::star::uno::Any& aObj )throw ( com::sun::star::uno::RuntimeException ) ;
+};
+
+class FormObjEventListenerImpl;
+
+class BASIC_DLLPUBLIC SbUserFormModule : public SbObjModule
+{
+ com::sun::star::script::ModuleInfo m_mInfo;
+ ::rtl::Reference< FormObjEventListenerImpl > m_DialogListener;
+ css::uno::Reference<css::awt::XDialog> m_xDialog;
+ css::uno::Reference<css::frame::XModel> m_xModel;
+ OUString sFormName;
+ bool mbInit;
+
+//protected:
+ virtual void InitObject();
+public:
+ TYPEINFO();
+ SbUserFormModule( const OUString& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat );
+ virtual ~SbUserFormModule();
+ virtual SbxVariable* Find( const OUString& rName, SbxClassType t );
+ void ResetApiObj( bool bTriggerTerminateEvent = true );
+ void Unload();
+ void Load();
+ void triggerMethod( const OUString& );
+ void triggerMethod( const OUString&, css::uno::Sequence< css::uno::Any >& );
+ void triggerActivateEvent();
+ void triggerDeactivateEvent();
+ void triggerInitializeEvent();
+ void triggerTerminateEvent();
+ void triggerLayoutEvent();
+ void triggerResizeEvent();
+
+ bool getInitState( void )
+ { return mbInit; }
+ void setInitState( bool bInit )
+ { mbInit = bInit; }
+
+ class SbUserFormModuleInstance* CreateInstance();
+};
+
+class BASIC_DLLPUBLIC SbUserFormModuleInstance : public SbUserFormModule
+{
+ SbUserFormModule* m_pParentModule;
+
+public:
+ SbUserFormModuleInstance( SbUserFormModule* pParentModule, const OUString& rName,
+ const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat );
+
+ virtual sal_Bool IsClass( const OUString& ) const;
+ virtual SbxVariable* Find( const OUString& rName, SbxClassType t );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbprop.hxx b/include/basic/sbprop.hxx
new file mode 100644
index 000000000000..463fd5d41c73
--- /dev/null
+++ b/include/basic/sbprop.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 _SB_SBPROPERTY_HXX
+#define _SB_SBPROPERTY_HXX
+
+#include <basic/sbxprop.hxx>
+#include <basic/sbdef.hxx>
+#include "basicdllapi.h"
+
+class SbModule;
+
+class BASIC_DLLPUBLIC SbProperty : public SbxProperty
+{
+ friend class SbiFactory;
+ friend class SbModule;
+ friend class SbProcedureProperty;
+ SbModule* pMod;
+ sal_Bool bInvalid;
+ BASIC_DLLPRIVATE SbProperty( const OUString&, SbxDataType, SbModule* );
+ virtual ~SbProperty();
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICPROP,1);
+ TYPEINFO();
+ SbModule* GetModule() { return pMod; }
+};
+
+SV_DECL_IMPL_REF(SbProperty)
+
+class BASIC_DLLPUBLIC SbProcedureProperty : public SbxProperty
+{
+ bool mbSet; // Flag for set command
+
+ virtual ~SbProcedureProperty();
+
+public:
+ SbProcedureProperty( const OUString& r, SbxDataType t )
+ : SbxProperty( r, t ) // , pMod( p )
+ , mbSet( false )
+ {}
+ TYPEINFO();
+
+ bool isSet( void )
+ { return mbSet; }
+ void setSet( bool bSet )
+ { mbSet = bSet; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx
new file mode 100644
index 000000000000..c84b62494169
--- /dev/null
+++ b/include/basic/sbstar.hxx
@@ -0,0 +1,183 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SB_SBSTAR_HXX
+#define _SB_SBSTAR_HXX
+
+#include <basic/sbx.hxx>
+#include <basic/sbxobj.hxx>
+#include <rtl/ustring.hxx>
+#include <osl/mutex.hxx>
+#include <tools/link.hxx>
+
+#include <basic/sbdef.hxx>
+#include <basic/sberrors.hxx>
+#include <com/sun/star/script/ModuleInfo.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include "basicdllapi.h"
+
+class SbModule; // completed module
+class SbiInstance; // runtime instance
+class SbiRuntime; // currently running procedure
+class SbiImage; // compiled image
+class BasicLibInfo; // info block for basic manager
+class SbMethod;
+class BasicManager;
+class DocBasicItem;
+
+class BASIC_DLLPUBLIC StarBASIC : public SbxObject
+{
+ friend class SbiScanner;
+ friend class SbiExpression; // Access to RTL
+ friend class SbiInstance;
+ friend class SbiRuntime;
+ friend class DocBasicItem;
+
+ SbxArrayRef pModules; // List of all modules
+ SbxObjectRef pRtl; // Runtime Library
+ SbxArrayRef xUnoListeners; // Listener handled by CreateUnoListener
+
+ // Handler-Support:
+ Link aErrorHdl; // Error handler
+ Link aBreakHdl; // Breakpoint handler
+ bool bNoRtl; // if true: do not search RTL
+ bool bBreak; // if true: Break, otherwise Step
+ bool bDocBasic;
+ bool bVBAEnabled;
+ BasicLibInfo* pLibInfo; // Info block for basic manager
+ bool bQuit;
+
+ SbxObjectRef pVBAGlobals;
+ BASIC_DLLPRIVATE SbxObject* getVBAGlobals( );
+
+ BASIC_DLLPRIVATE void implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic );
+
+protected:
+ sal_Bool CError( SbError, const OUString&, sal_Int32, sal_Int32, sal_Int32 );
+private:
+ BASIC_DLLPRIVATE sal_Bool RTError( SbError, sal_Int32, sal_Int32, sal_Int32 );
+ BASIC_DLLPRIVATE sal_Bool RTError( SbError, const OUString& rMsg, sal_Int32, sal_Int32, sal_Int32 );
+ BASIC_DLLPRIVATE sal_uInt16 BreakPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
+ BASIC_DLLPRIVATE sal_uInt16 StepPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
+ virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
+ virtual sal_Bool StoreData( SvStream& ) const;
+
+protected:
+ virtual sal_Bool ErrorHdl();
+ virtual sal_uInt16 BreakHdl();
+ virtual ~StarBASIC();
+
+public:
+
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASIC,1);
+ TYPEINFO();
+
+ StarBASIC( StarBASIC* pParent = NULL, bool bIsDocBasic = false );
+
+ // #51727 SetModified overridden so that the Modfied-State is
+ // not delivered to Parent.
+ virtual void SetModified( sal_Bool );
+
+ void* operator new( size_t );
+ void operator delete( void* );
+
+ virtual void Insert( SbxVariable* );
+ using SbxObject::Remove;
+ virtual void Remove( SbxVariable* );
+ virtual void Clear();
+
+ BasicLibInfo* GetLibInfo() { return pLibInfo; }
+ void SetLibInfo( BasicLibInfo* p ) { pLibInfo = p; }
+
+ // Compiler-Interface
+ SbModule* MakeModule( const OUString& rName, const OUString& rSrc );
+ SbModule* MakeModule32( const OUString& rName, const OUString& rSrc );
+ SbModule* MakeModule32( const OUString& rName, const com::sun::star::script::ModuleInfo& mInfo, const OUString& rSrc );
+ sal_Bool Compile( SbModule* );
+ static void Stop();
+ static void Error( SbError );
+ static void Error( SbError, const OUString& rMsg );
+ static void FatalError( SbError );
+ static void FatalError( SbError, const OUString& rMsg );
+ static bool IsRunning();
+ static SbError GetErrBasic();
+ // #66536 make additional message accessible by RTL function Error
+ static OUString GetErrorMsg();
+ static sal_Int32 GetErl();
+
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
+ virtual sal_Bool Call( const OUString&, SbxArray* = NULL );
+
+ SbxArray* GetModules() { return pModules; }
+ SbxObject* GetRtl() { return pRtl; }
+ SbModule* FindModule( const OUString& );
+ // Run init code of all modules (including the inserted Doc-Basics)
+ void InitAllModules( StarBASIC* pBasicNotToInit = NULL );
+ void DeInitAllModules( void );
+ void ClearAllModuleVars( void );
+
+ // Calls for error and break handler
+ static sal_uInt16 GetLine();
+ static sal_uInt16 GetCol1();
+ static sal_uInt16 GetCol2();
+ static void SetErrorData( SbError nCode, sal_uInt16 nLine,
+ sal_uInt16 nCol1, sal_uInt16 nCol2 );
+
+ // Specific to error handler
+ static void MakeErrorText( SbError, const OUString& aMsg );
+ static const OUString& GetErrorText();
+ static SbError GetErrorCode();
+ static bool IsCompilerError();
+ static sal_uInt16 GetVBErrorCode( SbError nError );
+ static SbError GetSfxFromVBError( sal_uInt16 nError );
+ bool IsBreak() const { return bBreak; }
+
+ static Link GetGlobalErrorHdl();
+ static void SetGlobalErrorHdl( const Link& rNewHdl );
+ Link GetErrorHdl() const { return aErrorHdl; }
+ void SetErrorHdl( const Link& r ) { aErrorHdl = r; }
+
+ static void SetGlobalBreakHdl( const Link& rNewHdl );
+ Link GetBreakHdl() const { return aBreakHdl; }
+ void SetBreakHdl( const Link& r ) { aBreakHdl = r; }
+
+ SbxArrayRef getUnoListeners( void );
+
+ static SbxBase* FindSBXInCurrentScope( const OUString& rName );
+ static SbMethod* GetActiveMethod( sal_uInt16 nLevel = 0 );
+ static SbModule* GetActiveModule();
+ void SetVBAEnabled( bool bEnabled );
+ bool isVBAEnabled();
+
+ SbxObjectRef getRTL( void ) { return pRtl; }
+ bool IsDocBasic() { return bDocBasic; }
+ SbxVariable* VBAFind( const OUString& rName, SbxClassType t );
+ bool GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut );
+ void QuitAndExitApplication();
+ bool IsQuitApplication() { return bQuit; };
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
+ GetModelFromBasic( SbxObject* pBasic );
+};
+
+SV_DECL_IMPL_REF(StarBASIC)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbstdobj.hxx b/include/basic/sbstdobj.hxx
new file mode 100644
index 000000000000..75a5a6ecb452
--- /dev/null
+++ b/include/basic/sbstdobj.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 _SBSTDOBJ1_HXX
+#define _SBSTDOBJ1_HXX
+
+#include <basic/sbxobj.hxx>
+#include <vcl/graph.hxx>
+#include <basic/sbxfac.hxx>
+#include "basicdllapi.h"
+
+//--------------------
+// class SbStdFactory
+//--------------------
+class BASIC_DLLPUBLIC SbStdFactory : public SbxFactory
+{
+public:
+ SbStdFactory();
+
+ virtual SbxObject* CreateObject( const OUString& rClassName );
+};
+
+//--------------------
+// class SbStdPicture
+//--------------------
+class BASIC_DLLPUBLIC SbStdPicture : public SbxObject
+{
+protected:
+ Graphic aGraphic;
+
+ ~SbStdPicture();
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+
+ void PropType( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite );
+ void PropWidth( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite );
+ void PropHeight( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite );
+
+public:
+ TYPEINFO();
+
+ SbStdPicture();
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
+
+ Graphic GetGraphic() const { return aGraphic; }
+ void SetGraphic( const Graphic& rGrf ) { aGraphic = rGrf; }
+};
+
+//-----------------
+// class SbStdFont
+//-----------------
+class BASIC_DLLPUBLIC SbStdFont : public SbxObject
+{
+protected:
+ sal_Bool bBold;
+ sal_Bool bItalic;
+ sal_Bool bStrikeThrough;
+ sal_Bool bUnderline;
+ sal_uInt16 nSize;
+ OUString aName;
+
+ ~SbStdFont();
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+
+ void PropBold( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite );
+ void PropItalic( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite );
+ void PropStrikeThrough( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite );
+ void PropUnderline( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite );
+ void PropSize( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite );
+ void PropName( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite );
+
+public:
+ TYPEINFO();
+
+ SbStdFont();
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
+
+ void SetBold( sal_Bool bB ) { bBold = bB; }
+ sal_Bool IsBold() const { return bBold; }
+ void SetItalic( sal_Bool bI ) { bItalic = bI; }
+ sal_Bool IsItalic() const { return bItalic; }
+ void SetStrikeThrough( sal_Bool bS ) { bStrikeThrough = bS; }
+ sal_Bool IsStrikeThrough() const { return bStrikeThrough; }
+ void SetUnderline( sal_Bool bU ) { bUnderline = bU; }
+ sal_Bool IsUnderline() const { return bUnderline; }
+ void SetSize( sal_uInt16 nS ) { nSize = nS; }
+ sal_uInt16 GetSize() const { return nSize; }
+ void SetFontName( const OUString& rName ) { aName = rName; }
+ OUString GetFontName() const { return aName; }
+};
+
+//----------------------
+// class SbStdClipboard
+//----------------------
+class BASIC_DLLPUBLIC SbStdClipboard : public SbxObject
+{
+protected:
+
+ ~SbStdClipboard();
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+
+ void MethClear( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite );
+ void MethGetData( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite );
+ void MethGetFormat( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite );
+ void MethGetText( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite );
+ void MethSetData( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite );
+ void MethSetText( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite );
+
+public:
+ TYPEINFO();
+
+ SbStdClipboard();
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbuno.hxx b/include/basic/sbuno.hxx
new file mode 100644
index 000000000000..55d487a48b75
--- /dev/null
+++ b/include/basic/sbuno.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 _SB_SBUNO_HXX
+#define _SB_SBUNO_HXX
+
+#include <basic/sbxobj.hxx>
+#include "basicdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace uno { class Any; }}}}
+
+// Returns a SbxObject that wrapps an Uno Interface
+// Implementation in basic/source/classes/sbunoobj.cxx
+BASIC_DLLPUBLIC SbxObjectRef GetSbUnoObject( const OUString& aName, const com::sun::star::uno::Any& aUnoObj_ );
+
+// Force creation of all properties for debugging
+BASIC_DLLPUBLIC void createAllObjectProperties( SbxObject* pObj );
+BASIC_DLLPUBLIC void SetSbUnoObjectDfltPropName( SbxObject* pObj );
+
+BASIC_DLLPUBLIC ::com::sun::star::uno::Any sbxToUnoValue( SbxVariable* pVar );
+
+BASIC_DLLPUBLIC void unoToSbxValue( SbxVariable* pVar, const ::com::sun::star::uno::Any& aValue );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbx.hxx b/include/basic/sbx.hxx
new file mode 100644
index 000000000000..d5fba159e510
--- /dev/null
+++ b/include/basic/sbx.hxx
@@ -0,0 +1,280 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SBXCLASS_HXX
+#define _SBXCLASS_HXX
+
+#include "tools/ref.hxx"
+#include "svl/smplhint.hxx"
+#include "svl/lstner.hxx"
+
+#include <basic/sbxdef.hxx>
+#include <basic/sbxform.hxx>
+#include <basic/sbxobj.hxx>
+#include <basic/sbxprop.hxx>
+#include <basic/sbxmeth.hxx>
+#include "basicdllapi.h"
+
+#include <boost/ptr_container/ptr_vector.hpp>
+
+class SvStream;
+class SbxBase;
+class SbxVariable;
+class SbxProperty;
+class SbxMethod;
+class SbxObject;
+class SbxArray;
+class SbxDimArray;
+class SbxFactory;
+
+class SfxBroadcaster;
+
+// Parameter information
+struct SbxParamInfo
+{
+ const OUString aName; // Name of the parameter
+ SbxBaseRef aTypeRef; // Object, if object type
+ SbxDataType eType; // Data type
+ sal_uInt16 nFlags; // Flag-Bits
+ sal_uInt32 nUserData; // IDs etc.
+ SbxParamInfo( const OUString& s, SbxDataType t, sal_uInt16 n, SbxBase* b = NULL )
+ : aName( s ), aTypeRef( b ), eType( t ), nFlags( n ), nUserData( 0 ) {}
+ ~SbxParamInfo() {}
+};
+
+typedef boost::ptr_vector<SbxParamInfo> SbxParams;
+
+class BASIC_DLLPUBLIC SbxInfo : public SvRefBase
+{
+ friend class SbxVariable;
+ friend class SbMethod;
+
+ OUString aComment;
+ OUString aHelpFile;
+ sal_uInt32 nHelpId;
+ SbxParams aParams;
+
+protected:
+ sal_Bool LoadData( SvStream&, sal_uInt16 );
+ sal_Bool StoreData( SvStream& ) const;
+ virtual ~SbxInfo();
+public:
+ SbxInfo();
+ SbxInfo( const OUString&, sal_uInt32 );
+
+ void AddParam( const OUString&, SbxDataType, sal_uInt16=SBX_READ );
+ const SbxParamInfo* GetParam( sal_uInt16 n ) const; // index starts with 1!
+ const OUString& GetComment() const { return aComment; }
+ const OUString& GetHelpFile() const { return aHelpFile; }
+ sal_uInt32 GetHelpId() const { return nHelpId; }
+
+ void SetComment( const OUString& r ) { aComment = r; }
+ void SetHelpFile( const OUString& r ) { aHelpFile = r; }
+ void SetHelpId( sal_uInt32 nId ) { nHelpId = nId; }
+};
+
+class BASIC_DLLPUBLIC SbxHint : public SfxSimpleHint
+{
+ SbxVariable* pVar;
+public:
+ TYPEINFO();
+ SbxHint( sal_uIntPtr n, SbxVariable* v ) : SfxSimpleHint( n ), pVar( v ) {}
+ SbxVariable* GetVar() const { return pVar; }
+};
+
+// SbxAlias is an alias for a var or object
+class BASIC_DLLPUBLIC SbxAlias : public SbxVariable, public SfxListener
+{
+ SbxVariableRef xAlias;
+ virtual ~SbxAlias();
+ virtual void Broadcast( sal_uIntPtr );
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+public:
+ SbxAlias( const SbxAlias& );
+ SbxAlias& operator=( const SbxAlias& );
+};
+
+// SbxArray is an unidimensional, dynamic Array
+// The variables convert from SbxVariablen. Put()/Insert() into the
+// declared datatype, if they are not SbxVARIANT.
+
+class SbxVarRefs;
+class SbxVariableRef;
+
+class BASIC_DLLPUBLIC SbxArray : public SbxBase
+{
+// #100883 Method to set method directly to parameter array
+ friend class SbMethod;
+ friend class SbClassModuleObject;
+ friend SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj );
+ BASIC_DLLPRIVATE void PutDirect( SbxVariable* pVar, sal_uInt32 nIdx );
+
+ SbxVarRefs* pData; // The variables
+
+protected:
+ SbxDataType eType; // Data type of the array
+ virtual ~SbxArray();
+ virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
+ virtual sal_Bool StoreData( SvStream& ) const;
+
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_ARRAY,1);
+ TYPEINFO();
+ SbxArray( SbxDataType=SbxVARIANT );
+ SbxArray( const SbxArray& );
+ SbxArray& operator=( const SbxArray& );
+ virtual void Clear();
+ sal_uInt16 Count() const;
+ virtual SbxDataType GetType() const;
+ virtual SbxClassType GetClass() const;
+ SbxVariableRef& GetRef( sal_uInt16 );
+ SbxVariable* Get( sal_uInt16 );
+ void Put( SbxVariable*, sal_uInt16 );
+ void Insert( SbxVariable*, sal_uInt16 );
+ void Remove( sal_uInt16 );
+ void Remove( SbxVariable* );
+ void Merge( SbxArray* );
+ const OUString& GetAlias( sal_uInt16 );
+ void PutAlias( const OUString&, sal_uInt16 );
+ SbxVariable* FindUserData( sal_uInt32 nUserData );
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
+
+ // Additional methods for 32-bit indices
+ sal_uInt32 Count32() const;
+ SbxVariableRef& GetRef32( sal_uInt32 );
+ SbxVariable* Get32( sal_uInt32 );
+ void Put32( SbxVariable*, sal_uInt32 );
+ void Insert32( SbxVariable*, sal_uInt32 );
+ void Remove32( sal_uInt32 );
+};
+
+// SbxDimArray is an array that can dimensioned using BASIC conventions.
+struct SbxDim;
+
+class BASIC_DLLPUBLIC SbxDimArray : public SbxArray
+{
+ SbxDim* pFirst, *pLast; // Links to Dimension table
+ short nDim; // Number of dimensions
+ BASIC_DLLPRIVATE void AddDimImpl32( sal_Int32, sal_Int32, sal_Bool bAllowSize0 );
+ bool mbHasFixedSize;
+protected:
+ sal_uInt16 Offset( const short* );
+ sal_uInt32 Offset32( const sal_Int32* );
+ sal_uInt32 Offset32( SbxArray* );
+ virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
+ virtual sal_Bool StoreData( SvStream& ) const;
+ virtual ~SbxDimArray();
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_DIMARRAY,1);
+ TYPEINFO();
+ SbxDimArray( SbxDataType=SbxVARIANT );
+ SbxDimArray( const SbxDimArray& );
+ SbxDimArray& operator=( const SbxDimArray& );
+ virtual void Clear();
+ using SbxArray::GetRef;
+ using SbxArray::Get;
+ SbxVariable* Get( const short* );
+ using SbxArray::Put;
+ void Put( SbxVariable*, const short* );
+ SbxVariable* Get( SbxArray* );
+
+ short GetDims() const;
+ void AddDim( short, short );
+ void unoAddDim( short, short );
+ sal_Bool GetDim( short, short&, short& ) const;
+
+ using SbxArray::GetRef32;
+ using SbxArray::Get32;
+ SbxVariable* Get32( const sal_Int32* );
+ using SbxArray::Put32;
+ void Put32( SbxVariable*, const sal_Int32* );
+ void AddDim32( sal_Int32, sal_Int32 );
+ void unoAddDim32( sal_Int32, sal_Int32 );
+ sal_Bool GetDim32( sal_Int32, sal_Int32&, sal_Int32& ) const;
+ bool hasFixedSize() { return mbHasFixedSize; };
+ void setHasFixedSize( bool bHasFixedSize ) {mbHasFixedSize = bHasFixedSize; };
+};
+
+class BASIC_DLLPUBLIC SbxCollection : public SbxObject
+{
+ BASIC_DLLPRIVATE void Initialize();
+protected:
+ virtual ~SbxCollection();
+ virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+ // Overridable methods (why not pure virtual?):
+ virtual void CollAdd( SbxArray* pPar );
+ virtual void CollItem( SbxArray* pPar );
+ virtual void CollRemove( SbxArray* pPar );
+
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_COLLECTION,1);
+ TYPEINFO();
+ SbxCollection( const OUString& rClassname );
+ SbxCollection( const SbxCollection& );
+ SbxCollection& operator=( const SbxCollection& );
+ virtual SbxVariable* FindUserData( sal_uInt32 nUserData );
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
+ virtual void Clear();
+};
+
+class BASIC_DLLPUBLIC SbxStdCollection : public SbxCollection
+{
+protected:
+ OUString aElemClass;
+ sal_Bool bAddRemoveOk;
+ virtual ~SbxStdCollection();
+ virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
+ virtual sal_Bool StoreData( SvStream& ) const;
+ virtual void CollAdd( SbxArray* pPar );
+ virtual void CollRemove( SbxArray* pPar );
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_FIXCOLLECTION,1);
+ TYPEINFO();
+ SbxStdCollection( const OUString& rClassname, const OUString& rElemClass, sal_Bool=sal_True );
+ SbxStdCollection( const SbxStdCollection& );
+ SbxStdCollection& operator=( const SbxStdCollection& );
+ virtual void Insert( SbxVariable* );
+ const OUString& GetElementClass() const { return aElemClass; }
+};
+
+SV_IMPL_REF(SbxBase)
+
+SV_IMPL_REF(SbxVariable)
+
+#ifndef SBX_ARRAY_DECL_DEFINED
+#define SBX_ARRAY_DECL_DEFINED
+SV_DECL_REF(SbxArray)
+#endif
+SV_IMPL_REF(SbxArray)
+
+#ifndef SBX_INFO_DECL_DEFINED
+#define SBX_INFO_DECL_DEFINED
+SV_DECL_REF(SbxInfo)
+#endif
+SV_IMPL_REF(SbxInfo)
+
+SV_DECL_REF(SbxDimArray)
+SV_IMPL_REF(SbxDimArray)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbxbase.hxx b/include/basic/sbxbase.hxx
new file mode 100644
index 000000000000..16484ee929d8
--- /dev/null
+++ b/include/basic/sbxbase.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 _SBXBASE_HXX
+#define _SBXBASE_HXX
+
+#include <i18nlangtag/lang.h>
+#include <basic/sbxdef.hxx>
+#include "basicdllapi.h"
+#include <boost/ptr_container/ptr_vector.hpp>
+
+class SbxFactory;
+class SbxVariable;
+class SbxBasicFormater;
+
+typedef boost::ptr_vector<SbxFactory> SbxFacs;
+
+// AppData structure for SBX:
+struct SbxAppData
+{
+ SbxError eSbxError; // Error code
+ SbxFacs aFacs; // Factories
+ SbxBasicFormater *pBasicFormater; // Pointer to Format()-Command helper class
+
+ LanguageType eBasicFormaterLangType;
+ // It might be useful to store this class 'global' because some string reosurces are saved here
+
+ SbxAppData() : eSbxError( SbxERR_OK ), aFacs(), pBasicFormater( NULL ) {}
+ ~SbxAppData();
+};
+
+BASIC_DLLPUBLIC SbxAppData& GetSbxData_Impl();
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbxcore.hxx b/include/basic/sbxcore.hxx
new file mode 100644
index 000000000000..4c71d1a5b977
--- /dev/null
+++ b/include/basic/sbxcore.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 _SBXCORE_HXX
+#define _SBXCORE_HXX
+
+#include <tools/rtti.hxx>
+#include <tools/ref.hxx>
+#include <tools/debug.hxx>
+
+#include <basic/sbxdef.hxx>
+#include "basicdllapi.h"
+
+class SvStream;
+
+// The following Macro defines four (five) necessary methods within a
+// SBX object. LoadPrivateData() and StorePrivateData() must be implemented.
+// They are necessary for loading/storing the data of derived classes.
+// Load() and Store() must not be overridden.
+
+// This version of the Macros does not define Load/StorePrivateData()-methods
+#define SBX_DECL_PERSIST_NODATA( nCre, nSbxId, nVer ) \
+ virtual sal_uInt32 GetCreator() const { return nCre; } \
+ virtual sal_uInt16 GetVersion() const { return nVer; } \
+ virtual sal_uInt16 GetSbxId() const { return nSbxId; }
+
+// This version of the macro defines Load/StorePrivateData()-methods
+#define SBX_DECL_PERSIST( nCre, nSbxId, nVer ) \
+ virtual sal_Bool LoadPrivateData( SvStream&, sal_uInt16 ); \
+ virtual sal_Bool StorePrivateData( SvStream& ) const; \
+ SBX_DECL_PERSIST_NODATA( nCre, nSbxId, nVer )
+
+class SbxBase;
+class SbxFactory;
+class SbxObject;
+
+DBG_NAMEEX_VISIBILITY(SbxBase, BASIC_DLLPUBLIC)
+
+class BASIC_DLLPUBLIC SbxBase : virtual public SvRefBase
+{
+ virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
+ virtual sal_Bool StoreData( SvStream& ) const;
+protected:
+ sal_uInt16 nFlags; // Flag-Bits
+
+ SbxBase();
+ SbxBase( const SbxBase& );
+ SbxBase& operator=( const SbxBase& );
+ virtual ~SbxBase();
+ SBX_DECL_PERSIST(0,0,0);
+public:
+ TYPEINFO();
+ inline void SetFlags( sal_uInt16 n );
+ inline sal_uInt16 GetFlags() const;
+ inline void SetFlag( sal_uInt16 n );
+ inline void ResetFlag( sal_uInt16 n );
+ inline sal_Bool IsSet( sal_uInt16 n ) const;
+ inline sal_Bool IsReset( sal_uInt16 n ) const;
+ inline sal_Bool CanRead() const;
+ inline sal_Bool CanWrite() const;
+ inline sal_Bool IsModified() const;
+ inline sal_Bool IsConst() const;
+ inline sal_Bool IsHidden() const;
+ inline sal_Bool IsVisible() const;
+
+ virtual sal_Bool IsFixed() const;
+ virtual void SetModified( sal_Bool );
+
+ virtual SbxDataType GetType() const;
+ virtual SbxClassType GetClass() const;
+
+ virtual void Clear();
+
+ static SbxBase* Load( SvStream& );
+ static void Skip( SvStream& );
+ sal_Bool Store( SvStream& );
+ virtual sal_Bool LoadCompleted();
+ virtual sal_Bool StoreCompleted();
+
+ static SbxError GetError();
+ static void SetError( SbxError );
+ static sal_Bool IsError();
+ static void ResetError();
+
+ // Set the factory for Load/Store/Create
+ static void AddFactory( SbxFactory* );
+ static void RemoveFactory( SbxFactory* );
+
+ static SbxBase* Create( sal_uInt16, sal_uInt32=SBXCR_SBX );
+ static SbxObject* CreateObject( const OUString& );
+};
+
+SV_DECL_REF(SbxBase)
+
+inline void SbxBase::SetFlags( sal_uInt16 n )
+{ //DBG_CHKTHIS( SbxBase, 0 );
+ nFlags = n; }
+
+inline sal_uInt16 SbxBase::GetFlags() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return nFlags; }
+
+inline void SbxBase::SetFlag( sal_uInt16 n )
+{ //DBG_CHKTHIS( SbxBase, 0 );
+ nFlags |= n; }
+
+inline void SbxBase::ResetFlag( sal_uInt16 n )
+{ //DBG_CHKTHIS( SbxBase, 0 );
+ nFlags &= ~n; }
+
+inline sal_Bool SbxBase::IsSet( sal_uInt16 n ) const
+{ DBG_CHKTHIS( SbxBase, 0 ); return sal_Bool( ( nFlags & n ) != 0 ); }
+
+inline sal_Bool SbxBase::IsReset( sal_uInt16 n ) const
+{ DBG_CHKTHIS( SbxBase, 0 ); return sal_Bool( ( nFlags & n ) == 0 ); }
+
+inline sal_Bool SbxBase::CanRead() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_READ ); }
+
+inline sal_Bool SbxBase::CanWrite() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_WRITE ); }
+
+inline sal_Bool SbxBase::IsModified() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_MODIFIED ); }
+
+inline sal_Bool SbxBase::IsConst() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_CONST ); }
+
+inline sal_Bool SbxBase::IsHidden() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_HIDDEN ); }
+
+inline sal_Bool SbxBase::IsVisible() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return IsReset( SBX_INVISIBLE ); }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbxdef.hxx b/include/basic/sbxdef.hxx
new file mode 100644
index 000000000000..781a71b3b430
--- /dev/null
+++ b/include/basic/sbxdef.hxx
@@ -0,0 +1,311 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#ifndef _SBXDEF_HXX
+#define _SBXDEF_HXX
+
+
+#ifndef __RSC
+#include <tools/solar.h>
+#include "tools/errcode.hxx"
+
+enum SbxClassType { // SBX-class-IDs (order is important!)
+ SbxCLASS_DONTCARE = 1, // don't care (search, not 0 due to StarBASIC)
+ SbxCLASS_ARRAY, // Array of SbxVariables
+ SbxCLASS_VALUE, // simple value
+ SbxCLASS_VARIABLE, // Variable (from here there is Broadcaster)
+ SbxCLASS_METHOD, // Method (Function or Sub)
+ SbxCLASS_PROPERTY, // Property
+ SbxCLASS_OBJECT // Object
+};
+
+enum SbxDataType {
+ SbxEMPTY = 0, // * Uninitialized
+ SbxNULL = 1, // * Contains no valid data
+ SbxINTEGER = 2, // * Integer (sal_Int16)
+ SbxLONG = 3, // * Long integer (sal_Int32)
+ SbxSINGLE = 4, // * Single-precision floating point number (float)
+ SbxDOUBLE = 5, // * Double-precision floating point number (double)
+ SbxCURRENCY = 6, // Currency (sal_Int64)
+ SbxDATE = 7, // * Date (double)
+ SbxSTRING = 8, // * String (StarView)
+ SbxOBJECT = 9, // * SbxBase object pointer
+ SbxERROR = 10, // * Error (sal_uInt16)
+ SbxBOOL = 11, // * Boolean (0 or -1)
+
+ SbxVARIANT = 12, // * Display for variant datatype
+ SbxDATAOBJECT = 13, // * Common data object w/o ref count
+
+ SbxCHAR = 16, // * signed char
+ SbxBYTE = 17, // * unsigned char
+ SbxUSHORT = 18, // * unsigned short (sal_uInt16)
+ SbxULONG = 19, // * unsigned long (sal_uInt32)
+
+//deprecated: // old 64bit types kept for backward compatibility in file I/O
+ SbxLONG64 = 20, // moved to SbxSALINT64 as 64bit int
+ SbxULONG64 = 21, // moved to SbxSALUINT64 as 64bit int
+
+ SbxINT = 22, // * signed machine-dependent int
+ SbxUINT = 23, // * unsigned machine-dependent int
+
+ SbxVOID = 24, // * no value (= SbxEMPTY)
+ SbxHRESULT = 25, // HRESULT
+ SbxPOINTER = 26, // generic pointer
+ SbxDIMARRAY = 27, // dimensioned array
+ SbxCARRAY = 28, // C style array
+ SbxUSERDEF = 29, // user defined
+ SbxLPSTR = 30, // * null terminated string
+
+ SbxLPWSTR = 31, // wide null terminated string
+ SbxCoreSTRING = 32, // from 1997-4-10 for GetCoreString(), only for converting<
+
+ SbxWSTRING = 33, // from 2000-10-4 Reimplemented for backwards compatibility (#78919)
+ SbxWCHAR = 34, // from 2000-10-4 Reimplemented for backwards compatibility (#78919)
+ SbxSALINT64 = 35, // for currency internal, signed 64-bit int and UNO hyper
+ SbxSALUINT64= 36, // for currency internal, unsigned 64-bit int and UNO unsigned hyper
+ SbxDECIMAL = 37, // for UNO/automation Decimal
+
+ SbxVECTOR = 0x1000, // simple counted array
+ SbxARRAY = 0x2000, // array
+ SbxBYREF = 0x4000, // access by reference
+
+ SbxSV1 = 128, // first defined data type for StarView
+ SbxMEMORYSTREAM, // SvMemoryStream
+ SbxSTORAGE, // SvStorage
+
+ SbxUSER1 = 256, // first user defined data type
+ SbxUSERn = 2047 // last user defined data type
+};
+
+const sal_uInt32 SBX_TYPE_WITH_EVENTS_FLAG = 0x10000;
+const sal_uInt32 SBX_TYPE_DIM_AS_NEW_FLAG = 0x20000;
+const sal_uInt32 SBX_FIXED_LEN_STRING_FLAG = 0x10000; // same value as above as no conflict possible
+const sal_uInt32 SBX_TYPE_VAR_TO_DIM_FLAG = 0x40000;
+
+enum SbxOperator {
+ // Arithmetical:
+ SbxEXP, // this ^ var
+ SbxMUL, // this * var
+ SbxDIV, // this / var
+ SbxMOD, // this MOD var (max INT32!)
+ SbxPLUS, // this + var
+ SbxMINUS, // this - var
+ SbxNEG, // -this (var is ignored)
+ SbxIDIV, // this / var (both operands max. sal_Int32!)
+ // Boolean operators (max sal_Int32!):
+ // Boolean operators (TODO deprecate this limit: max INT32!)
+ SbxAND, // this & var
+ SbxOR, // this | var
+ SbxXOR, // this ^ var
+ SbxEQV, // ~this ^ var
+ SbxIMP, // ~this | var
+ SbxNOT, // ~this (var is ignored)
+
+ // String concatenation:
+ SbxCAT, // this & var (VBA: this + var)
+
+ // Comparisons:
+ SbxEQ, // this = var
+ SbxNE, // this <> var
+ SbxLT, // this < var
+ SbxGT, // this > var
+ SbxLE, // this <= var
+ SbxGE // this >= var
+};
+
+enum SbxNameType { // Type of the questioned name of a variable
+ SbxNAME_NONE, // plain name
+ SbxNAME_SHORT, // Name(A,B)
+ SbxNAME_SHORT_TYPES, // Name%(A%,B$)
+ SbxNAME_LONG_TYPES // Name(A As Integer, B As String) As Integer
+};
+
+// from 1996/3/20: New error messages
+typedef sal_uIntPtr SbxError; // Preserve old type
+
+#endif
+
+
+// New error codes per define
+#define ERRCODE_SBX_OK ERRCODE_NONE // processed
+
+#define ERRCODE_SBX_SYNTAX (1UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_COMPILER)
+#define ERRCODE_SBX_NOTIMP (2UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_NOTSUPPORTED)
+#define ERRCODE_SBX_OVERFLOW (3UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // overflow
+#define ERRCODE_SBX_BOUNDS (4UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // Invalid array index
+#define ERRCODE_SBX_ZERODIV (5UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // Division by zero
+#define ERRCODE_SBX_CONVERSION (6UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // wrong data type
+#define ERRCODE_SBX_BAD_PARAMETER (7UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // invalid Parameter
+#define ERRCODE_SBX_PROC_UNDEFINED (8UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Sub or Func not def
+#define ERRCODE_SBX_ERROR (9UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_UNKNOWN) // generic object error
+#define ERRCODE_SBX_NO_OBJECT (10UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Object var not object
+#define ERRCODE_SBX_CANNOT_LOAD (11UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_CREATE) // Object init/load fail
+#define ERRCODE_SBX_BAD_INDEX (12UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // Invalid object index
+#define ERRCODE_SBX_NO_ACTIVE_OBJECT (13UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_ACCESS) // Object not active
+#define ERRCODE_SBX_BAD_PROP_VALUE (14UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Bad property value
+#define ERRCODE_SBX_PROP_READONLY (15UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_READ) // Property is read only
+#define ERRCODE_SBX_PROP_WRITEONLY (16UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_WRITE) // Property is write only
+#define ERRCODE_SBX_INVALID_OBJECT (17UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_ACCESS) // Invalid object reference
+#define ERRCODE_SBX_NO_METHOD (18UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Property oder Methode unbekannt
+#define ERRCODE_SBX_INVALID_USAGE_OBJECT (19UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_ACCESS) // Invalid object usage
+#define ERRCODE_SBX_NO_OLE (20UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_ACCESS) // No OLE-Object
+#define ERRCODE_SBX_BAD_METHOD (21UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Method not supported
+#define ERRCODE_SBX_OLE_ERROR (22UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // OLE Automation Error
+#define ERRCODE_SBX_BAD_ACTION (23UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_NOTSUPPORTED) // Action not supported
+#define ERRCODE_SBX_NO_NAMED_ARGS (24UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // No named arguments
+#define ERRCODE_SBX_BAD_LOCALE (25UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_NOTSUPPORTED) // Locale not supported
+#define ERRCODE_SBX_NAMED_NOT_FOUND (26UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Unknown named argument
+#define ERRCODE_SBX_NOT_OPTIONAL (27UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Argument not optional
+#define ERRCODE_SBX_WRONG_ARGS (28UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // Invalid number of arguments
+#define ERRCODE_SBX_NOT_A_COLL (29UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Object contains no elements
+#define LAST_SBX_ERROR_ID 29UL
+
+#ifndef __RSC
+
+// Map old codes to new ones
+#define SbxERR_OK ERRCODE_SBX_OK
+#define SbxERR_SYNTAX ERRCODE_SBX_SYNTAX
+#define SbxERR_NOTIMP ERRCODE_SBX_NOTIMP
+#define SbxERR_OVERFLOW ERRCODE_SBX_OVERFLOW
+#define SbxERR_BOUNDS ERRCODE_SBX_BOUNDS
+#define SbxERR_ZERODIV ERRCODE_SBX_ZERODIV
+#define SbxERR_CONVERSION ERRCODE_SBX_CONVERSION
+#define SbxERR_BAD_PARAMETER ERRCODE_SBX_BAD_PARAMETER
+#define SbxERR_PROC_UNDEFINED ERRCODE_SBX_PROC_UNDEFINED
+#define SbxERR_ERROR ERRCODE_SBX_ERROR
+#define SbxERR_NO_OBJECT ERRCODE_SBX_NO_OBJECT
+#define SbxERR_CANNOT_LOAD ERRCODE_SBX_CANNOT_LOAD
+#define SbxERR_BAD_INDEX ERRCODE_SBX_BAD_INDEX
+#define SbxERR_NO_ACTIVE_OBJECT ERRCODE_SBX_NO_ACTIVE_OBJECT
+#define SbxERR_BAD_PROP_VALUE ERRCODE_SBX_BAD_PROP_VALUE
+#define SbxERR_PROP_READONLY ERRCODE_SBX_PROP_READONLY
+#define SbxERR_PROP_WRITEONLY ERRCODE_SBX_PROP_WRITEONLY
+#define SbxERR_INVALID_OBJECT ERRCODE_SBX_INVALID_OBJECT
+#define SbxERR_NO_METHOD ERRCODE_SBX_NO_METHOD
+#define SbxERR_INVALID_USAGE_OBJECT ERRCODE_SBX_INVALID_USAGE_OBJECT
+#define SbxERR_NO_OLE ERRCODE_SBX_NO_OLE
+#define SbxERR_BAD_METHOD ERRCODE_SBX_BAD_METHOD
+#define SbxERR_OLE_ERROR ERRCODE_SBX_OLE_ERROR
+#define SbxERR_BAD_ACTION ERRCODE_SBX_BAD_ACTION
+#define SbxERR_NO_NAMED_ARGS ERRCODE_SBX_NO_NAMED_ARGS
+#define SbxERR_BAD_LOCALE ERRCODE_SBX_BAD_LOCALE
+#define SbxERR_NAMED_NOT_FOUND ERRCODE_SBX_NAMED_NOT_FOUND
+#define SbxERR_NOT_OPTIONAL ERRCODE_SBX_NOT_OPTIONAL
+#define SbxERR_WRONG_ARGS ERRCODE_SBX_WRONG_ARGS
+#define SbxERR_NOT_A_COLL ERRCODE_SBX_NOT_A_COLL
+
+
+// Flag-Bits:
+#define SBX_READ 0x0001 // Read permission
+#define SBX_WRITE 0x0002 // Write permission
+#define SBX_READWRITE 0x0003 // Read/Write permission
+#define SBX_DONTSTORE 0x0004 // Don't store object
+#define SBX_MODIFIED 0x0008 // Object was changed
+#define SBX_FIXED 0x0010 // Fixed data type (SbxVariable)
+#define SBX_CONST 0x0020 // Definition of const value
+#define SBX_OPTIONAL 0x0040 // Parameter is optional
+#define SBX_HIDDEN 0x0080 // Element is invisible
+#define SBX_INVISIBLE 0x0100 // Element is not found by Find()
+#define SBX_EXTSEARCH 0x0200 // Object is searched completely
+#define SBX_EXTFOUND 0x0400 // Variable was found through extended search
+#define SBX_GBLSEARCH 0x0800 // Global search via Parents
+#define SBX_RESERVED 0x1000 // reserved
+#define SBX_PRIVATE 0x1000 // #110004, #112015, cannot conflict with SBX_RESERVED
+#define SBX_NO_BROADCAST 0x2000 // No broadcast on Get/Put
+#define SBX_REFERENCE 0x4000 // Parameter is Reference (DLL-call)
+#define SBX_NO_MODIFY 0x8000 // SetModified is suppressed
+#define SBX_WITH_EVENTS 0x0080 // Same value as unused SBX_HIDDEN
+#define SBX_DIM_AS_NEW 0x0800 // Same value as SBX_GBLSEARCH, cannot conflict as one
+ // is used for objects, the other for variables only
+#define SBX_VAR_TO_DIM 0x2000 // Same value as SBX_NO_BROADCAST, cannot conflict as
+ // used for variables without broadcaster only
+
+// Broadcaster-IDs:
+#define SBX_HINT_DYING SFX_HINT_DYING
+#define SBX_HINT_DATAWANTED SFX_HINT_USER00
+#define SBX_HINT_DATACHANGED SFX_HINT_DATACHANGED
+#define SBX_HINT_CONVERTED SFX_HINT_USER01
+#define SBX_HINT_INFOWANTED SFX_HINT_USER02
+#define SBX_HINT_OBJECTCHANGED SFX_HINT_USER03
+
+// List of all creators for Load/Store
+
+#define SBXCR_SBX 0x20584253 // SBX(blank)
+
+// List of predefined SBX-IDs. New SBX-IDs must be precisly defined so that
+// they are unique within the Stream and appropriate Factory.
+
+#define SBXID_VALUE 0x4E4E // NN: SbxValue
+#define SBXID_VARIABLE 0x4156 // VA: SbxVariable
+#define SBXID_ARRAY 0x5241 // AR: SbxArray
+#define SBXID_DIMARRAY 0x4944 // DI: SbxDimArray
+#define SBXID_OBJECT 0x424F // OB: SbxObject
+#define SBXID_COLLECTION 0x4F43 // CO: SbxCollection
+#define SBXID_FIXCOLLECTION 0x4346 // FC: SbxStdCollection
+#define SBXID_METHOD 0x454D // ME: SbxMethod
+#define SBXID_PROPERTY 0x5250 // PR: SbxProperty
+
+// StarBASIC restricts the base data type to different intervals.
+// These intervals are fixed to create 'portability and independent
+// of the implementation. Only type double is greedy and takes
+// what it gets.
+
+#define SbxMAXCHAR ((sal_Unicode)65535)
+#define SbxMINCHAR (0)
+#define SbxMAXBYTE ( 255)
+#define SbxMAXINT ( 32767)
+#define SbxMININT (-32768)
+#define SbxMAXUINT ((sal_uInt16) 65535)
+#define SbxMAXLNG ( 2147483647)
+#define SbxMINLNG ((sal_Int32)(-2147483647-1))
+#define SbxMAXULNG ((sal_uInt32) 0xffffffff)
+
+#define SbxMAXSALUINT64 SAL_MAX_UINT64
+#define SbxMAXSALINT64 SAL_MAX_INT64
+#define SbxMINSALINT64 SAL_MIN_INT64
+
+ // Currency stored as SbxSALINT64 == sal_Int64
+ // value range limits are ~(2^63 - 1)/10000
+ // fixed precision has 4 digits right of decimal pt
+#define CURRENCY_FACTOR (10000)
+#define CURRENCY_FACTOR_SQUARE (100000000)
+
+// TODO effective MAX/MINCURR limits:
+// true value ( 922337203685477.5807) is too precise for correct comparison to 64bit double
+#define SbxMAXCURR ( 922337203685477.5807)
+#define SbxMINCURR (-922337203685477.5808)
+
+#define SbxMAXSNG ( 3.402823e+38)
+#define SbxMINSNG (-3.402823e+38)
+#define SbxMAXSNG2 ( 1.175494351e-38)
+#define SbxMINSNG2 (-1.175494351e-38)
+
+// Max valid offset index of a Sbx-Array (due to 64K limit)
+#define SBX_MAXINDEX 0x3FF0
+#define SBX_MAXINDEX32 SbxMAXLNG
+
+// The numeric values of sal_True and FALSE
+enum SbxBOOL { SbxFALSE = 0, SbxTRUE = -1 };
+
+#endif //ifndef __RSC
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbxfac.hxx b/include/basic/sbxfac.hxx
new file mode 100644
index 000000000000..33035cf45c9b
--- /dev/null
+++ b/include/basic/sbxfac.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 __SBX_SBX_FACTORY_HXX
+#define __SBX_SBX_FACTORY_HXX
+
+#include <basic/sbxdef.hxx>
+#include <rtl/ustring.hxx>
+#include "basicdllapi.h"
+
+class SbxBase;
+class SbxObject;
+
+class BASIC_DLLPUBLIC SbxFactory
+{
+ bool bHandleLast; // true: Factory is asked at last because of its expensiveness
+public:
+ virtual ~SbxFactory();
+ SbxFactory( bool bLast=false ) { bHandleLast = bLast; }
+ bool IsHandleLast( void ) { return bHandleLast; }
+ virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX );
+ virtual SbxObject* CreateObject( const OUString& );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbxform.hxx b/include/basic/sbxform.hxx
new file mode 100644
index 000000000000..589f3ec24fd0
--- /dev/null
+++ b/include/basic/sbxform.hxx
@@ -0,0 +1,173 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SBXFORM_HXX
+#define _SBXFORM_HXX
+
+//====================================================================
+// Implementation class for Basic command: Format$( d,formatStr )
+//====================================================================
+/*
+ Grammar of format string (a try):
+ -----------------------------------------------
+
+ format_string := {\special_char} general_format | scientific_format {\special_char} {;format_string}
+ general_format := {#[,]}{0[,]}[.{0}{#}]
+ scientific_format := {0}[.{0}{#}](e | E)(+ | -){#}{0}
+
+ percent_char := '%'
+ special_char := \char | + | - | ( | ) | $ | space_char
+ char := all_ascii_chars
+ space_char := ' '
+
+ {} repeated multiple times (incl. zero times)
+ [] exactly one or zero times
+ () parenthesis, e.g. (e | E) means e or E times
+
+ Additional predefined formats for the format string:
+ "General Number"
+ "Currency"
+ "Fixed"
+ "Standard"
+ "Percent"
+ "Scientific"
+ "Yes/No"
+ "True/False"
+ "On/Off"
+
+ Note: invalid format string are ignored just as in VisualBasic, the output is
+ probably 'undefined'. ASCII letters are outputted directly.
+
+ Constraints in VisualBasic:
+ - the exponent (scientific syntax) has a maximum of three digits!
+
+ Constraints of new implementation:
+ - the '+' sign is not allowed as wildcard in the mantissa
+
+ TODO:
+ - Date formatting
+ Wildcards are: 'h', 'm', 's', 'y'
+ predefined String-Constants/Commands:
+ "AMPM", "Long Date", "Long Time"
+*/
+
+/*
+ There are two possibilities to get the number of digits of a number:
+
+ a) use sprintf()
+ b) use log10() and pow() digit
+*/
+#define _with_sprintf // use a)
+
+#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
+#include "basicdllapi.h"
+
+class BASIC_DLLPUBLIC SbxBasicFormater {
+ public:
+ // Constructor takes signs for decimal point, thousand separation sign
+ // and necessary resource strings.
+ SbxBasicFormater( sal_Unicode _cDecPoint, sal_Unicode _cThousandSep,
+ OUString _sOnStrg,
+ OUString _sOffStrg,
+ OUString _sYesStrg,
+ OUString _sNoStrg,
+ OUString _sTrueStrg,
+ OUString _sFalseStrg,
+ OUString _sCurrencyStrg,
+ OUString _sCurrencyFormatStrg );
+
+ /* Basic command: Format$( number,format-string )
+
+ Parameter:
+ dNumber : number to be formated
+ sFormatStrg : the Format-String, e.g. ###0.0###
+
+ Return value:
+ String containing the formatted output
+ */
+ OUString BasicFormat( double dNumber, OUString sFormatStrg );
+ OUString BasicFormatNull( OUString sFormatStrg );
+
+ static sal_Bool isBasicFormat( OUString sFormatStrg );
+
+ private:
+ BASIC_DLLPRIVATE inline void ShiftString( OUStringBuffer& sStrg, sal_uInt16 nStartPos );
+ BASIC_DLLPRIVATE void AppendDigit( OUStringBuffer& sStrg, short nDigit );
+ BASIC_DLLPRIVATE void LeftShiftDecimalPoint( OUStringBuffer& sStrg );
+ BASIC_DLLPRIVATE void StrRoundDigit( OUStringBuffer& sStrg, short nPos, sal_Bool& bOverflow );
+ BASIC_DLLPRIVATE void StrRoundDigit( OUStringBuffer& sStrg, short nPos );
+ BASIC_DLLPRIVATE void ParseBack( OUStringBuffer& sStrg, const OUString& sFormatStrg,
+ short nFormatPos );
+#ifdef _with_sprintf
+ // Methods for string conversion with sprintf():
+ BASIC_DLLPRIVATE void InitScan( double _dNum );
+ BASIC_DLLPRIVATE void InitExp( double _dNewExp );
+ BASIC_DLLPRIVATE short GetDigitAtPosScan( short nPos, sal_Bool& bFoundFirstDigit );
+ BASIC_DLLPRIVATE short GetDigitAtPosExpScan( double dNewExponent, short nPos,
+ sal_Bool& bFoundFirstDigit );
+ BASIC_DLLPRIVATE short GetDigitAtPosExpScan( short nPos, sal_Bool& bFoundFirstDigit );
+#else
+ // Methods for direct 'calculation' with log10() and pow():
+ BASIC_DLLPRIVATE short GetDigitAtPos( double dNumber, short nPos, double& dNextNumber,
+ sal_Bool& bFoundFirstDigit );
+ BASIC_DLLPRIVATE short RoundDigit( double dNumber );
+#endif
+ BASIC_DLLPRIVATE OUString GetPosFormatString( const OUString& sFormatStrg, sal_Bool & bFound );
+ BASIC_DLLPRIVATE OUString GetNegFormatString( const OUString& sFormatStrg, sal_Bool & bFound );
+ BASIC_DLLPRIVATE OUString Get0FormatString( const OUString& sFormatStrg, sal_Bool & bFound );
+ BASIC_DLLPRIVATE OUString GetNullFormatString( const OUString& sFormatStrg, sal_Bool & bFound );
+ BASIC_DLLPRIVATE short AnalyseFormatString( const OUString& sFormatStrg,
+ short& nNoOfDigitsLeft, short& nNoOfDigitsRight,
+ short& nNoOfOptionalDigitsLeft,
+ short& nNoOfExponentDigits,
+ short& nNoOfOptionalExponentDigits,
+ sal_Bool& bPercent, sal_Bool& bCurrency, sal_Bool& bScientific,
+ sal_Bool& bGenerateThousandSeparator,
+ short& nMultipleThousandSeparators );
+ BASIC_DLLPRIVATE void ScanFormatString( double dNumber, const OUString& sFormatStrg,
+ OUString& sReturnStrg, sal_Bool bCreateSign );
+
+ //*** Data ***
+ sal_Unicode cDecPoint; // sign for the decimal point
+ sal_Unicode cThousandSep; // sign for thousand delimiter
+ // Text for output:
+ OUString sOnStrg;
+ OUString sOffStrg;
+ OUString sYesStrg;
+ OUString sNoStrg;
+ OUString sTrueStrg;
+ OUString sFalseStrg;
+ OUString sCurrencyStrg;
+ OUString sCurrencyFormatStrg;
+
+ //*** temporary data for scan loop ***
+ //-----------------------------------------------
+ // String containing the number in scientific format
+ OUString sSciNumStrg;
+ // String containing the exponent of the number
+ OUString sNumExpStrg;
+ double dNum; // the number that is scanned
+ short nNumExp; // the exponent of the number
+ short nExpExp; // the number of digits in the exponent
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbxmeth.hxx b/include/basic/sbxmeth.hxx
new file mode 100644
index 000000000000..227c00cbad88
--- /dev/null
+++ b/include/basic/sbxmeth.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 __SBX_SBXMETHOD_HXX
+#define __SBX_SBXMETHOD_HXX
+
+#include <basic/sbxvar.hxx>
+#include "basicdllapi.h"
+
+class BASIC_DLLPUBLIC SbxMethod : public SbxVariable
+{
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_METHOD,1);
+ TYPEINFO();
+ SbxMethod( const OUString& r, SbxDataType t );
+ SbxMethod( const SbxMethod& r );
+ ~SbxMethod();
+ SbxMethod& operator=( const SbxMethod& r ) { SbxVariable::operator=( r ); return *this; }
+ virtual SbxClassType GetClass() const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbxobj.hxx b/include/basic/sbxobj.hxx
new file mode 100644
index 000000000000..2dc4aa735513
--- /dev/null
+++ b/include/basic/sbxobj.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SBX_SBXOBJECT_HXX
+#define _SBX_SBXOBJECT_HXX
+
+#include <svl/lstner.hxx>
+#include <basic/sbxvar.hxx>
+#include "basicdllapi.h"
+
+
+class SbxProperty;
+
+class BASIC_DLLPUBLIC SbxObject : public SbxVariable, public SfxListener
+{
+ BASIC_DLLPRIVATE SbxArray* FindVar( SbxVariable*, sal_uInt16& );
+protected:
+ SbxArrayRef pMethods; // Methods
+ SbxArrayRef pProps; // Properties
+ SbxArrayRef pObjs; // Objects
+ SbxProperty* pDfltProp; // Default-Property
+ OUString aClassName; // Classname
+ OUString aDfltPropName;
+ virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
+ virtual sal_Bool StoreData( SvStream& ) const;
+ virtual ~SbxObject();
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_OBJECT,1);
+ TYPEINFO();
+ SbxObject( const OUString& rClassname );
+ SbxObject( const SbxObject& );
+ SbxObject& operator=( const SbxObject& );
+ virtual SbxDataType GetType() const;
+ virtual SbxClassType GetClass() const;
+ virtual void Clear();
+
+ virtual sal_Bool IsClass( const OUString& ) const;
+ const OUString& GetClassName() const { return aClassName; }
+ void SetClassName( const OUString &rNew ) { aClassName = rNew; }
+ // Default-Property
+ SbxProperty* GetDfltProperty();
+ void SetDfltProperty( const OUString& r );
+ // Search for an element
+ virtual SbxVariable* FindUserData( sal_uInt32 nUserData );
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
+ SbxVariable* FindQualified( const OUString&, SbxClassType );
+ // Quick-Call-Interface for Methods
+ virtual sal_Bool Call( const OUString&, SbxArray* = NULL );
+ // Execution of DDE-Commands
+ SbxVariable* Execute( const OUString& );
+ // Manage elements
+ virtual sal_Bool GetAll( SbxClassType ) { return sal_True; }
+ SbxVariable* Make( const OUString&, SbxClassType, SbxDataType );
+ virtual SbxObject* MakeObject( const OUString&, const OUString& );
+ virtual void Insert( SbxVariable* );
+ // AB 23.4.1997, Optimization, Insertion without check for duplicate Entries and
+ // without Broadcasts, only used in SO2/auto.cxx
+ void QuickInsert( SbxVariable* );
+ virtual void Remove( const OUString&, SbxClassType );
+ virtual void Remove( SbxVariable* );
+
+ // Macro-Recording
+ virtual OUString GenerateSource( const OUString &rLinePrefix,
+ const SbxObject *pRelativeTo );
+ // Direct access on arrays
+ SbxArray* GetMethods() { return pMethods; }
+ SbxArray* GetProperties() { return pProps; }
+ SbxArray* GetObjects() { return pObjs; }
+ // Debugging
+ void Dump( SvStream&, sal_Bool bDumpAll=sal_False );
+};
+
+SV_DECL_REF(SbxObject)
+SV_IMPL_REF(SbxObject)
+
+#endif /* _SBX_SBXOBJECT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbxprop.hxx b/include/basic/sbxprop.hxx
new file mode 100644
index 000000000000..89d774d4967f
--- /dev/null
+++ b/include/basic/sbxprop.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 __SBX_SBXPROPERTY_HXX
+#define __SBX_SBXPROPERTY_HXX
+
+#include <basic/sbxvar.hxx>
+#include "basicdllapi.h"
+
+class BASIC_DLLPUBLIC SbxProperty : public SbxVariable
+{
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_PROPERTY,1);
+ TYPEINFO();
+ SbxProperty( const OUString& r, SbxDataType t );
+ SbxProperty( const SbxProperty& r ) : SvRefBase( r ), SbxVariable( r ) {}
+ virtual ~SbxProperty();
+ SbxProperty& operator=( const SbxProperty& r )
+ { SbxVariable::operator=( r ); return *this; }
+ virtual SbxClassType GetClass() const;
+};
+
+SV_DECL_REF(SbxProperty)
+SV_IMPL_REF(SbxProperty)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/sbxvar.hxx b/include/basic/sbxvar.hxx
new file mode 100644
index 000000000000..4d4a8b625bc3
--- /dev/null
+++ b/include/basic/sbxvar.hxx
@@ -0,0 +1,356 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SBXVAR_HXX
+#define SBXVAR_HXX
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/bridge/oleautomation/Decimal.hpp>
+#include <basic/sbxcore.hxx>
+#include "basicdllapi.h"
+
+
+class SbxDecimal;
+
+struct SbxValues
+{
+ union {
+ sal_uInt8 nByte;
+ sal_uInt16 nUShort;
+ sal_Unicode nChar;
+ sal_Int16 nInteger;
+ sal_uInt32 nULong;
+ sal_Int32 nLong;
+ unsigned int nUInt;
+ int nInt;
+ sal_uInt64 uInt64;
+ sal_Int64 nInt64;
+
+ float nSingle;
+ double nDouble;
+
+ OUString* pOUString;
+ SbxDecimal* pDecimal;
+
+ SbxBase* pObj;
+
+ sal_uInt8* pByte;
+ sal_uInt16* pUShort;
+ sal_Unicode* pChar;
+ sal_Int16* pInteger;
+ sal_uInt32* pULong;
+ sal_Int32* pLong;
+ unsigned int* pUInt;
+ int* pInt;
+ sal_uInt64* puInt64;
+ sal_Int64* pnInt64;
+
+ float* pSingle;
+ double* pDouble;
+
+ void* pData;
+ };
+ SbxDataType eType;
+
+ SbxValues(): pData( NULL ), eType(SbxEMPTY) {}
+ SbxValues( SbxDataType e ): eType(e) {}
+ SbxValues( char _nChar ): nChar( _nChar ), eType(SbxCHAR) {}
+ SbxValues( sal_uInt8 _nByte ): nByte( _nByte ), eType(SbxBYTE) {}
+ SbxValues( short _nInteger ): nInteger( _nInteger ), eType(SbxINTEGER ) {}
+ SbxValues( long _nLong ): nLong( _nLong ), eType(SbxLONG) {}
+ SbxValues( sal_uInt16 _nUShort ): nUShort( _nUShort ), eType(SbxUSHORT) {}
+ SbxValues( sal_uIntPtr _nULong ): nULong( _nULong ), eType(SbxULONG) {}
+ SbxValues( int _nInt ): nInt( _nInt ), eType(SbxINT) {}
+ SbxValues( unsigned int _nUInt ): nUInt( _nUInt ), eType(SbxUINT) {}
+ SbxValues( float _nSingle ): nSingle( _nSingle ), eType(SbxSINGLE) {}
+ SbxValues( double _nDouble ): nDouble( _nDouble ), eType(SbxDOUBLE) {}
+ SbxValues( const OUString* _pString ): pOUString( (OUString*)_pString ), eType(SbxSTRING) {}
+ SbxValues( SbxBase* _pObj ): pObj( _pObj ), eType(SbxOBJECT) {}
+ SbxValues( sal_Unicode* _pChar ): pChar( _pChar ), eType(SbxLPSTR) {}
+ SbxValues( void* _pData ): pData( _pData ), eType(SbxPOINTER) {}
+
+};
+
+class BASIC_DLLPUBLIC SbxValue : public SbxBase
+{
+ // #55226 Transport additional infos
+ BASIC_DLLPRIVATE SbxValue* TheRealValue( sal_Bool bObjInObjError ) const;
+ BASIC_DLLPRIVATE SbxValue* TheRealValue() const;
+protected:
+ SbxValues aData; // Data
+ OUString aPic; // Picture-String
+ OUString aToolString; // tool string copy
+
+ virtual void Broadcast( sal_uIntPtr ); // Broadcast-Call
+ virtual ~SbxValue();
+ virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
+ virtual sal_Bool StoreData( SvStream& ) const;
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_VALUE,1);
+ TYPEINFO();
+ SbxValue();
+ SbxValue( SbxDataType, void* = NULL );
+ SbxValue( const SbxValue& );
+ SbxValue& operator=( const SbxValue& );
+ virtual void Clear();
+ virtual sal_Bool IsFixed() const;
+
+ sal_Bool IsInteger() const { return sal_Bool( GetType() == SbxINTEGER ); }
+ sal_Bool IsLong() const { return sal_Bool( GetType() == SbxLONG ); }
+ sal_Bool IsSingle() const { return sal_Bool( GetType() == SbxSINGLE ); }
+ sal_Bool IsDouble() const { return sal_Bool( GetType() == SbxDOUBLE ); }
+ sal_Bool IsString() const { return sal_Bool( GetType() == SbxSTRING ); }
+ sal_Bool IsDate() const { return sal_Bool( GetType() == SbxDATE ); }
+ sal_Bool IsCurrency()const { return sal_Bool( GetType() == SbxCURRENCY ); }
+ sal_Bool IsObject() const { return sal_Bool( GetType() == SbxOBJECT ); }
+ sal_Bool IsDataObject()const{return sal_Bool( GetType() == SbxDATAOBJECT);}
+ sal_Bool IsBool() const { return sal_Bool( GetType() == SbxBOOL ); }
+ sal_Bool IsErr() const { return sal_Bool( GetType() == SbxERROR ); }
+ sal_Bool IsEmpty() const { return sal_Bool( GetType() == SbxEMPTY ); }
+ sal_Bool IsNull() const { return sal_Bool( GetType() == SbxNULL ); }
+ sal_Bool IsChar() const { return sal_Bool( GetType() == SbxCHAR ); }
+ sal_Bool IsByte() const { return sal_Bool( GetType() == SbxBYTE ); }
+ sal_Bool IsUShort() const { return sal_Bool( GetType() == SbxUSHORT ); }
+ sal_Bool IsULong() const { return sal_Bool( GetType() == SbxULONG ); }
+ sal_Bool IsInt() const { return sal_Bool( GetType() == SbxINT ); }
+ sal_Bool IsUInt() const { return sal_Bool( GetType() == SbxUINT ); }
+ sal_Bool IspChar() const { return sal_Bool( GetType() == SbxLPSTR ); }
+ sal_Bool IsNumeric() const;
+ sal_Bool IsNumericRTL() const; // #41692 Interface for Basic
+ sal_Bool ImpIsNumeric( bool bOnlyIntntl ) const; // Implementation
+
+ virtual SbxClassType GetClass() const;
+ virtual SbxDataType GetType() const;
+ SbxDataType GetFullType() const;
+ sal_Bool SetType( SbxDataType );
+
+ virtual sal_Bool Get( SbxValues& ) const;
+ const SbxValues& GetValues_Impl() const { return aData; }
+ virtual sal_Bool Put( const SbxValues& );
+
+ inline SbxValues * data() { return &aData; }
+
+ sal_Unicode GetChar() const;
+ sal_Int16 GetInteger() const;
+ sal_Int32 GetLong() const;
+ sal_Int64 GetInt64() const;
+ sal_uInt64 GetUInt64() const;
+
+ sal_Int64 GetCurrency() const;
+ SbxDecimal* GetDecimal() const;
+
+ float GetSingle() const;
+ double GetDouble() const;
+ double GetDate() const;
+
+ sal_Bool GetBool() const;
+ const OUString& GetCoreString() const;
+ OUString GetOUString() const;
+
+ SbxBase* GetObject() const;
+ sal_uInt8 GetByte() const;
+ sal_uInt16 GetUShort() const;
+ sal_uInt32 GetULong() const;
+
+ sal_Bool PutInteger( sal_Int16 );
+ sal_Bool PutLong( sal_Int32 );
+ sal_Bool PutSingle( float );
+ sal_Bool PutDouble( double );
+ sal_Bool PutDate( double );
+ sal_Bool PutBool( sal_Bool );
+ sal_Bool PutErr( sal_uInt16 );
+ sal_Bool PutStringExt( const OUString& ); // with extended analysis (International, "sal_True"/"sal_False")
+ sal_Bool PutInt64( sal_Int64 );
+ sal_Bool PutUInt64( sal_uInt64 );
+ sal_Bool PutString( const OUString& );
+ sal_Bool PutChar( sal_Unicode );
+ sal_Bool PutByte( sal_uInt8 );
+ sal_Bool PutUShort( sal_uInt16 );
+ sal_Bool PutULong( sal_uInt32 );
+ sal_Bool PutEmpty();
+ sal_Bool PutNull();
+
+ // Special methods
+ sal_Bool PutDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec );
+ sal_Bool PutDecimal( SbxDecimal* pDecimal ); // This function is needed for Windows build, don't remove
+ sal_Bool fillAutomationDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec );
+ sal_Bool PutCurrency( const sal_Int64& );
+ // Interface for CDbl in Basic
+ static SbxError ScanNumIntnl( const OUString& rSrc, double& nVal, bool bSingle = false );
+
+ sal_Bool PutObject( SbxBase* );
+
+ virtual sal_Bool Convert( SbxDataType );
+ virtual sal_Bool Compute( SbxOperator, const SbxValue& );
+ virtual sal_Bool Compare( SbxOperator, const SbxValue& ) const;
+ sal_Bool Scan( const OUString&, sal_uInt16* = NULL );
+ void Format( OUString&, const OUString* = NULL ) const;
+
+ // The following operators are definied for easier handling.
+ // TODO: Ensure error conditions (overflow, conversions)
+ // are taken into consideration in Compute and Compare
+
+ inline int operator ==( const SbxValue& ) const;
+ inline int operator !=( const SbxValue& ) const;
+ inline int operator <( const SbxValue& ) const;
+ inline int operator >( const SbxValue& ) const;
+ inline int operator <=( const SbxValue& ) const;
+ inline int operator >=( const SbxValue& ) const;
+
+ inline SbxValue& operator *=( const SbxValue& );
+ inline SbxValue& operator /=( const SbxValue& );
+ inline SbxValue& operator %=( const SbxValue& );
+ inline SbxValue& operator +=( const SbxValue& );
+ inline SbxValue& operator -=( const SbxValue& );
+ inline SbxValue& operator &=( const SbxValue& );
+ inline SbxValue& operator |=( const SbxValue& );
+ inline SbxValue& operator ^=( const SbxValue& );
+};
+
+inline int SbxValue::operator==( const SbxValue& r ) const
+{ return Compare( SbxEQ, r ); }
+
+inline int SbxValue::operator!=( const SbxValue& r ) const
+{ return Compare( SbxNE, r ); }
+
+inline int SbxValue::operator<( const SbxValue& r ) const
+{ return Compare( SbxLT, r ); }
+
+inline int SbxValue::operator>( const SbxValue& r ) const
+{ return Compare( SbxGT, r ); }
+
+inline int SbxValue::operator<=( const SbxValue& r ) const
+{ return Compare( SbxLE, r ); }
+
+inline int SbxValue::operator>=( const SbxValue& r ) const
+{ return Compare( SbxGE, r ); }
+
+inline SbxValue& SbxValue::operator*=( const SbxValue& r )
+{ Compute( SbxMUL, r ); return *this; }
+
+inline SbxValue& SbxValue::operator/=( const SbxValue& r )
+{ Compute( SbxDIV, r ); return *this; }
+
+inline SbxValue& SbxValue::operator%=( const SbxValue& r )
+{ Compute( SbxMOD, r ); return *this; }
+
+inline SbxValue& SbxValue::operator+=( const SbxValue& r )
+{ Compute( SbxPLUS, r ); return *this; }
+
+inline SbxValue& SbxValue::operator-=( const SbxValue& r )
+{ Compute( SbxMINUS, r ); return *this; }
+
+inline SbxValue& SbxValue::operator&=( const SbxValue& r )
+{ Compute( SbxAND, r ); return *this; }
+
+inline SbxValue& SbxValue::operator|=( const SbxValue& r )
+{ Compute( SbxOR, r ); return *this; }
+
+inline SbxValue& SbxValue::operator^=( const SbxValue& r )
+{ Compute( SbxXOR, r ); return *this; }
+
+class SbxArray;
+class SbxInfo;
+
+#ifndef SBX_ARRAY_DECL_DEFINED
+#define SBX_ARRAY_DECL_DEFINED
+SV_DECL_REF(SbxArray)
+#endif
+
+#ifndef SBX_INFO_DECL_DEFINED
+#define SBX_INFO_DECL_DEFINED
+SV_DECL_REF(SbxInfo)
+#endif
+
+class SfxBroadcaster;
+
+class SbxVariableImpl;
+class StarBASIC;
+
+class BASIC_DLLPUBLIC SbxVariable : public SbxValue
+{
+ friend class SbMethod;
+
+ SbxVariableImpl* mpSbxVariableImpl; // Impl data
+ SfxBroadcaster* pCst; // Broadcaster, if needed
+ OUString maName; // Name, if available
+ SbxArrayRef mpPar; // Parameter-Array, if set
+ sal_uInt16 nHash; // Hash-ID for search
+
+ BASIC_DLLPRIVATE SbxVariableImpl* getImpl( void );
+
+protected:
+ SbxInfoRef pInfo; // Probably called information
+ sal_uIntPtr nUserData; // User data for Call()
+ SbxObject* pParent; // Currently attached object
+ virtual ~SbxVariable();
+ virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
+ virtual sal_Bool StoreData( SvStream& ) const;
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_VARIABLE,2);
+ TYPEINFO();
+ SbxVariable();
+ SbxVariable( SbxDataType, void* = NULL );
+ SbxVariable( const SbxVariable& );
+ SbxVariable& operator=( const SbxVariable& );
+
+ void Dump( SvStream&, sal_Bool bDumpAll=sal_False );
+
+ virtual void SetName( const OUString& );
+ virtual const OUString& GetName( SbxNameType = SbxNAME_NONE ) const;
+ sal_uInt16 GetHashCode() const { return nHash; }
+
+ virtual void SetModified( sal_Bool );
+
+ sal_uIntPtr GetUserData() const { return nUserData; }
+ void SetUserData( sal_uIntPtr n ) { nUserData = n; }
+
+ virtual SbxDataType GetType() const;
+ virtual SbxClassType GetClass() const;
+
+ // Parameter-Interface
+ virtual SbxInfo* GetInfo();
+ void SetInfo( SbxInfo* p );
+ void SetParameters( SbxArray* p );
+ SbxArray* GetParameters() const;
+
+ // Sfx-Broadcasting-Support:
+ // Due to data reduction and better DLL-hierarchie currently via casting
+ SfxBroadcaster& GetBroadcaster();
+ sal_Bool IsBroadcaster() const { return sal_Bool( pCst != NULL ); }
+ virtual void Broadcast( sal_uIntPtr nHintId );
+
+ inline const SbxObject* GetParent() const { return pParent; }
+ SbxObject* GetParent();
+ virtual void SetParent( SbxObject* );
+
+ const OUString& GetDeclareClassName( void );
+ void SetDeclareClassName( const OUString& );
+ void SetComListener( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xComListener,
+ StarBASIC* pParentBasic );
+ void ClearComListener( void );
+
+ static sal_uInt16 MakeHashCode( const OUString& rName );
+};
+
+SV_DECL_REF(SbxVariable)
+
+#endif // SBXVAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/vbahelper.hxx b/include/basic/vbahelper.hxx
new file mode 100644
index 000000000000..c18b67b63cd1
--- /dev/null
+++ b/include/basic/vbahelper.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 BASIC_VBAHELPR_HXX
+#define BASIC_VBAHELPR_HXX
+
+#include <com/sun/star/container/XEnumeration.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <rtl/ustring.hxx>
+#include "basicdllapi.h"
+
+namespace basic {
+namespace vba {
+
+/* This header contains public helper functions for VBA used from this module
+ and from other VBA implementation modules such as vbahelper.
+ */
+
+// ============================================================================
+
+/** Locks or unlocks the controllers of all documents that have the same type
+ as the specified document.
+
+ First, the global module manager (com.sun.star.frame.ModuleManager) is
+ asked for the type of the passed model, and all open documents with the
+ same type will be locked or unlocked.
+
+ @param rxModel
+ A document model determining the type of the documents to be locked or
+ unlocked.
+
+ @param bLockControllers
+ Passing true will lock all controllers, passing false will unlock them.
+ */
+BASIC_DLLPUBLIC void lockControllersOfAllDocuments(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel,
+ sal_Bool bLockControllers );
+
+// ============================================================================
+
+/** Enables or disables the container windows of all controllers of all
+ documents that have the same type as the specified document.
+
+ First, the global module manager (com.sun.star.frame.ModuleManager) is
+ asked for the type of the passed model, and the container windows of all
+ open documents with the same type will be enabled or disabled.
+
+ @param rxModel
+ A document model determining the type of the documents to be enabled or
+ disabled.
+
+ @param bEnableWindows
+ Passing true will enable all container windows of all controllers,
+ passing false will disable them.
+ */
+BASIC_DLLPUBLIC void enableContainerWindowsOfAllDocuments(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel,
+ sal_Bool bEnableWindows );
+
+// ============================================================================
+
+/** Registers the passed path as working directory for the application the
+ passed document belongs to.
+
+ @param rxModel
+ A document model determining the type of the application whose working
+ directory has been changed.
+
+ @param rPath
+ The new working directory.
+ */
+BASIC_DLLPUBLIC void registerCurrentDirectory(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel,
+ const OUString& rPath );
+
+// ============================================================================
+
+} // namespace vba
+} // namespace basic
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/base/bitmapcanvasbase.hxx b/include/canvas/base/bitmapcanvasbase.hxx
new file mode 100644
index 000000000000..5c1376b0632b
--- /dev/null
+++ b/include/canvas/base/bitmapcanvasbase.hxx
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_BITMAPCANVASBASE_HXX
+#define INCLUDED_CANVAS_BITMAPCANVASBASE_HXX
+
+#include <canvas/base/canvasbase.hxx>
+#include <com/sun/star/rendering/XBitmapCanvas.hpp>
+
+namespace canvas
+{
+ /** Helper template to handle XBitmapCanvas method forwarding to
+ BitmapCanvasHelper
+
+ Use this helper to handle the XBitmapCanvas part of your
+ implementation.
+
+ @tpl Base
+ Base class to use, most probably one of the
+ WeakComponentImplHelperN templates with the appropriate
+ interfaces. At least XBitmapCanvas should be among them (why
+ else would you use this template, then?). Base class must have
+ an Base( const Mutex& ) constructor (like the
+ WeakComponentImplHelperN templates have).
+
+ @tpl CanvasHelper
+ Canvas helper implementation for the backend in question
+
+ @tpl Mutex
+ Lock strategy to use. Defaults to using the
+ OBaseMutex-provided lock. Everytime one of the methods is
+ entered, an object of type Mutex is created with m_aMutex as
+ the sole parameter, and destroyed again when the method scope
+ is left.
+
+ @tpl UnambiguousBase
+ Optional unambiguous base class for XInterface of Base. It's
+ sometimes necessary to specify this parameter, e.g. if Base
+ derives from multiple UNO interface (were each provides its
+ own version of XInterface, making the conversion ambiguous)
+
+ @see CanvasBase for further contractual requirements towards
+ the CanvasHelper type, and some examples.
+ */
+ template< class Base,
+ class CanvasHelper,
+ class Mutex=::osl::MutexGuard,
+ class UnambiguousBase=::com::sun::star::uno::XInterface > class BitmapCanvasBase :
+ public CanvasBase< Base, CanvasHelper, Mutex, UnambiguousBase >
+ {
+ public:
+ typedef CanvasBase< Base, CanvasHelper, Mutex, UnambiguousBase > BaseType;
+
+ // XBitmapCanvas
+ virtual void SAL_CALL copyRect( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas >& sourceCanvas,
+ const ::com::sun::star::geometry::RealRectangle2D& sourceRect,
+ const ::com::sun::star::rendering::ViewState& sourceViewState,
+ const ::com::sun::star::rendering::RenderState& sourceRenderState,
+ const ::com::sun::star::geometry::RealRectangle2D& destRect,
+ const ::com::sun::star::rendering::ViewState& destViewState,
+ const ::com::sun::star::rendering::RenderState& destRenderState ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(sourceCanvas, sourceRect, sourceViewState, sourceRenderState,
+ destRect, destViewState, destRenderState,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< typename BaseType::UnambiguousBaseType* >(this));
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ BaseType::mbSurfaceDirty = true;
+ BaseType::maCanvasHelper.modifying();
+
+ BaseType::maCanvasHelper.copyRect( this,
+ sourceCanvas,
+ sourceRect,
+ sourceViewState,
+ sourceRenderState,
+ destRect,
+ destViewState,
+ destRenderState );
+ }
+
+ // XBitmap
+ virtual ::com::sun::star::geometry::IntegerSize2D SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maCanvasHelper.getSize();
+ }
+
+ virtual ::sal_Bool SAL_CALL hasAlpha( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maCanvasHelper.hasAlpha();
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > SAL_CALL getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize,
+ sal_Bool beFast ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maCanvasHelper.getScaledBitmap( newSize, beFast );
+ }
+
+ };
+}
+
+#endif /* INCLUDED_CANVAS_BITMAPCANVASBASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/base/bufferedgraphicdevicebase.hxx b/include/canvas/base/bufferedgraphicdevicebase.hxx
new file mode 100644
index 000000000000..2713e0ea11bb
--- /dev/null
+++ b/include/canvas/base/bufferedgraphicdevicebase.hxx
@@ -0,0 +1,276 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_BUFFEREDGRAPHICDEVICEBASE_HXX
+#define INCLUDED_CANVAS_BUFFEREDGRAPHICDEVICEBASE_HXX
+
+#include <com/sun/star/awt/XWindow2.hpp>
+#include <com/sun/star/awt/XTopWindow.hpp>
+#include <com/sun/star/awt/XWindowListener.hpp>
+
+#include <canvas/canvastools.hxx>
+#include <canvas/base/graphicdevicebase.hxx>
+
+
+/* Definition of BufferedGraphicDeviceBase class */
+
+namespace canvas
+{
+ /** Helper template base class for XGraphicDevice implementations
+ on windows.
+
+ Use this base class if your target device is a
+ window. Additionally to GraphicDeviceBase, this template
+ provides an implementation of the awt::XWindowListener
+ interface, to receive notifications about state changes of the
+ associated window.
+
+ @tpl Base
+ Base class to use, most probably one of the
+ WeakComponentImplHelperN templates with the appropriate
+ interfaces. At least XGraphicDevice should be among them (why else
+ would you use this template, then?). Base class must have an
+ Base( const Mutex& ) constructor (like the
+ WeakComponentImplHelperN templates have). As the very least,
+ the base class must be derived from uno::XInterface, as some
+ error reporting mechanisms rely on that.
+
+ @tpl DeviceHelper
+ Device helper implementation for the backend in question. This
+ object will be held as a member of this template class, and
+ basically gets forwarded all XGraphicDevice API calls that
+ could not be handled generically.
+
+ @tpl Mutex
+ Lock strategy to use. Defaults to using the
+ OBaseMutex-provided lock. Everytime one of the methods is
+ entered, an object of type Mutex is created with m_aMutex as
+ the sole parameter, and destroyed again when the method scope
+ is left.
+
+ @tpl UnambiguousBase
+ Optional unambiguous base class for XInterface of Base. It's
+ sometimes necessary to specify this parameter, e.g. if Base
+ derives from multiple UNO interface (were each provides its
+ own version of XInterface, making the conversion ambiguous)
+ */
+ template< class Base,
+ class DeviceHelper,
+ class Mutex=::osl::MutexGuard,
+ class UnambiguousBase=::com::sun::star::uno::XInterface > class BufferedGraphicDeviceBase :
+ public GraphicDeviceBase< Base, DeviceHelper, Mutex, UnambiguousBase >
+ {
+ public:
+ typedef GraphicDeviceBase< Base, DeviceHelper, Mutex, UnambiguousBase > BaseType;
+ typedef BufferedGraphicDeviceBase OurType;
+ typedef Mutex MutexType;
+
+ BufferedGraphicDeviceBase() :
+ mxWindow(),
+ maBounds(),
+ mbIsVisible( false ),
+ mbIsTopLevel( false )
+ {
+ BaseType::maPropHelper.addProperties( PropertySetHelper::MakeMap
+ ("Window",
+ boost::bind(&OurType::getXWindow,
+ this)));
+ }
+
+ // XGraphicDevice
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBufferController > SAL_CALL getBufferController( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ return this;
+ }
+
+ // XBufferController
+ virtual ::sal_Int32 SAL_CALL createBuffers( ::sal_Int32 nBuffers ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyRange( nBuffers, (sal_Int32)1 );
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maDeviceHelper.createBuffers( nBuffers );
+ }
+
+ virtual void SAL_CALL destroyBuffers( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ BaseType::maDeviceHelper.destroyBuffers();
+ }
+
+ virtual ::sal_Bool SAL_CALL showBuffer( ::sal_Bool bUpdateAll ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maDeviceHelper.showBuffer( mbIsVisible, bUpdateAll );
+ }
+
+ virtual ::sal_Bool SAL_CALL switchBuffer( ::sal_Bool bUpdateAll ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maDeviceHelper.switchBuffer( mbIsVisible, bUpdateAll );
+ }
+
+
+ /** Set corresponding canvas window
+
+ Use this method to set the window this canvas displays
+ on. Comes in handy when the canvas needs to adapt size or
+ output position to the changing window.
+
+ Whenever the bounds of the window change, <code>void
+ notifySizeUpdate( const awt::Rectangle& rBounds )</code>
+ is called, with rBounds the window bound rect relative to
+ the frame window.
+ */
+ void setWindow( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::awt::XWindow2 >& rWindow )
+ {
+ if( mxWindow.is() )
+ mxWindow->removeWindowListener( this );
+
+ mxWindow = rWindow;
+
+ if( mxWindow.is() )
+ {
+ mbIsVisible = mxWindow->isVisible();
+ mbIsTopLevel =
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindow >(
+ mxWindow,
+ ::com::sun::star::uno::UNO_QUERY ).is();
+
+ maBounds = transformBounds( mxWindow->getPosSize() );
+ mxWindow->addWindowListener( this );
+ }
+ }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow2 > getWindow() const
+ {
+ return mxWindow;
+ }
+
+ ::com::sun::star::uno::Any getXWindow() const
+ {
+ return ::com::sun::star::uno::makeAny(mxWindow);
+ }
+
+ virtual void disposeThis()
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ if( mxWindow.is() )
+ {
+ mxWindow->removeWindowListener(this);
+ mxWindow.clear();
+ }
+
+ // pass on to base class
+ BaseType::disposeThis();
+ }
+
+ ::com::sun::star::awt::Rectangle transformBounds( const ::com::sun::star::awt::Rectangle& rBounds )
+ {
+ // notifySizeUpdate's bounds are relative to the toplevel
+ // window
+ if( !mbIsTopLevel )
+ return tools::getAbsoluteWindowRect(
+ rBounds,
+ mxWindow );
+ else
+ return ::com::sun::star::awt::Rectangle( 0,0,rBounds.Width,rBounds.Height );
+ }
+
+ void boundsChanged( const ::com::sun::star::awt::WindowEvent& e )
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ const ::com::sun::star::awt::Rectangle& rNewBounds(
+ transformBounds(
+ ::com::sun::star::awt::Rectangle( e.X,
+ e.Y,
+ e.Width,
+ e.Height )));
+
+ if( rNewBounds.X != maBounds.X ||
+ rNewBounds.Y != maBounds.Y ||
+ rNewBounds.Width != maBounds.Width ||
+ rNewBounds.Height != maBounds.Height )
+ {
+ maBounds = rNewBounds;
+ BaseType::maDeviceHelper.notifySizeUpdate( maBounds );
+ }
+ }
+
+ // XWindowListener
+ virtual void disposeEventSource( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ if( Source.Source == mxWindow )
+ mxWindow.clear();
+
+ BaseType::disposeEventSource(Source);
+ }
+
+ virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ boundsChanged( e );
+ }
+
+ virtual void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ boundsChanged( e );
+ }
+
+ virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ mbIsVisible = true;
+ }
+
+ virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ mbIsVisible = false;
+ }
+
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow2 > mxWindow;
+
+ /// Current bounds of the owning Window
+ ::com::sun::star::awt::Rectangle maBounds;
+
+ /// True, if the window this canvas is contained in, is visible
+ bool mbIsVisible;
+
+ private:
+ /// True, if the window this canvas is contained in, is a toplevel window
+ bool mbIsTopLevel;
+ };
+}
+
+#endif /* INCLUDED_CANVAS_BUFFEREDGRAPHICDEVICEBASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/base/cachedprimitivebase.hxx b/include/canvas/base/cachedprimitivebase.hxx
new file mode 100644
index 000000000000..8c7e1579f1e2
--- /dev/null
+++ b/include/canvas/base/cachedprimitivebase.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_CANVAS_CACHEDPRIMITIVEBASE_HXX
+#define INCLUDED_CANVAS_CACHEDPRIMITIVEBASE_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/rendering/XCachedPrimitive.hpp>
+#include <com/sun/star/rendering/ViewState.hpp>
+#include <cppuhelper/compbase2.hxx>
+#include <comphelper/broadcasthelper.hxx>
+
+#include <canvas/canvastoolsdllapi.h>
+
+/* Definition of CachedPrimitiveBase class */
+
+namespace canvas
+{
+ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XCachedPrimitive,
+ ::com::sun::star::lang::XServiceInfo > CachedPrimitiveBase_Base;
+
+ /** Base class, providing common functionality for implementers of
+ the XCachedPrimitive interface.
+ */
+ class CANVASTOOLS_DLLPUBLIC CachedPrimitiveBase : public CachedPrimitiveBase_Base,
+ public ::comphelper::OBaseMutex
+ {
+ public:
+
+ /** Create an XCachedPrimitive for given target canvas
+
+ @param rUsedViewState
+ The viewstate the original object was rendered with
+
+ @param rTarget
+ The target canvas the repaint should happen on.
+
+ @param bFailForChangedViewTransform
+ When true, derived classes will never receive doRedraw()
+ calls with dissimilar view transformations and
+ bSameViewTransform set to false. This is useful for cached
+ objects where re-transforming the generated output is not
+ desirable, e.g. for hinted font output.
+ */
+ CachedPrimitiveBase( const ::com::sun::star::rendering::ViewState& rUsedViewState,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XCanvas >& rTarget,
+ bool bFailForChangedViewTransform );
+
+ /// Dispose all internal references
+ virtual void SAL_CALL disposing();
+
+ // XCachedPrimitive
+ virtual ::sal_Int8 SAL_CALL redraw( const ::com::sun::star::rendering::ViewState& aState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ ~CachedPrimitiveBase(); // we're a ref-counted UNO class. _We_ destroy ourselves.
+
+ private:
+ CachedPrimitiveBase( const CachedPrimitiveBase& );
+ CachedPrimitiveBase& operator=( const CachedPrimitiveBase& );
+
+ /** Actually perform the requested redraw.
+
+ Clients must override this method, instead of the public
+ redraw() one.
+
+ @param rNewState
+ The viewstate to redraw with
+
+ @param rOldState
+ The viewstate this cache object was created with.
+
+ @param rTargetCanvas
+ Target canvas to render to.
+
+ @param bSameViewTransform
+ When true, rNewState and rOldState have the same transformation.
+ */
+ virtual ::sal_Int8 doRedraw( const ::com::sun::star::rendering::ViewState& rNewState,
+ const ::com::sun::star::rendering::ViewState& rOldState,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XCanvas >& rTargetCanvas,
+ bool bSameViewTransform ) = 0;
+
+ ::com::sun::star::rendering::ViewState maUsedViewState;
+ ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas > mxTarget;
+ const bool mbFailForChangedViewTransform;
+ };
+}
+
+#endif /* INCLUDED_CANVAS_CACHEDPRIMITIVEBASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/base/canvasbase.hxx b/include/canvas/base/canvasbase.hxx
new file mode 100644
index 000000000000..f7844fd219de
--- /dev/null
+++ b/include/canvas/base/canvasbase.hxx
@@ -0,0 +1,474 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_CANVASBASE_HXX
+#define INCLUDED_CANVAS_CANVASBASE_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/rendering/TextDirection.hpp>
+#include <osl/mutex.hxx>
+#include <canvas/verifyinput.hxx>
+
+
+namespace canvas
+{
+ /** Helper template to handle XCanvas method forwarding to CanvasHelper
+
+ Use this helper to handle the XCanvas part of your
+ implementation. In theory, we could have provided CanvasHelper
+ and CanvasBase as a single template, but that would duplicate
+ a lot of code now residing in CanvasHelper only.
+
+ This template basically interposes itself between the full
+ interface you implement (i.e. not restricted to XCanvas. The
+ problem with UNO partial interface implementation actually is,
+ that you cannot do it the plain way, since deriving from a
+ common base subclass always introduces the whole set of pure
+ virtuals, that your baseclass helper just overrided) and your
+ implementation class. You then only have to implement the
+ functionality <em>besides</em> XCanvas.
+
+ <pre>
+ Example:
+ typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::rendering::XSpriteCanvas,
+ ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XServiceName > CanvasBase_Base;
+ typedef ::canvas::internal::CanvasBase< CanvasBase_Base, CanvasHelper > ExampleCanvas_Base;
+
+ class ExampleCanvas : public ExampleCanvas_Base,
+ public SpriteSurface,
+ public RepaintTarget
+ {
+ };
+ </pre>
+
+ @tpl Base
+ Base class to use, most probably one of the
+ WeakComponentImplHelperN templates with the appropriate
+ interfaces. At least XCanvas should be among them (why else
+ would you use this template, then?). Base class must have an
+ Base( const Mutex& ) constructor (like the
+ WeakComponentImplHelperN templates have). As the very least,
+ the base class must be derived from uno::XInterface, as some
+ error reporting mechanisms rely on that.
+
+ @tpl CanvasHelper
+ Canvas helper implementation for the backend in question. This
+ object will be held as a member of this template class, and
+ basically gets forwarded all XCanvas API calls. Furthermore,
+ everytime the canvas API semantically changes the content of
+ the canvas, CanvasHelper::modifying() will get called
+ (<em>before</em> the actual modification takes place).
+
+ @tpl Mutex
+ Lock strategy to use. Defaults to using the
+ OBaseMutex-provided lock. Everytime one of the methods is
+ entered, an object of type Mutex is created with m_aMutex as
+ the sole parameter, and destroyed again when the method scope
+ is left.
+
+ @tpl UnambiguousBase
+ Optional unambiguous base class for XInterface of Base. It's
+ sometimes necessary to specify this parameter, e.g. if Base
+ derives from multiple UNO interface (were each provides its
+ own version of XInterface, making the conversion ambiguous)
+ */
+ template< class Base,
+ class CanvasHelper,
+ class Mutex=::osl::MutexGuard,
+ class UnambiguousBase=::com::sun::star::uno::XInterface > class CanvasBase :
+ public Base
+ {
+ public:
+ typedef Base BaseType;
+ typedef CanvasHelper HelperType;
+ typedef Mutex MutexType;
+ typedef UnambiguousBase UnambiguousBaseType;
+
+ /** Create CanvasBase
+ */
+ CanvasBase() :
+ maCanvasHelper(),
+ mbSurfaceDirty( true )
+ {
+ }
+
+ virtual void disposeThis()
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ maCanvasHelper.disposing();
+
+ // pass on to base class
+ BaseType::disposeThis();
+ }
+
+ // XCanvas
+ virtual void SAL_CALL clear() throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ maCanvasHelper.clear();
+ }
+
+ virtual void SAL_CALL drawPoint( const ::com::sun::star::geometry::RealPoint2D& aPoint,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(aPoint, viewState, renderState,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ maCanvasHelper.drawPoint( this, aPoint, viewState, renderState );
+ }
+
+ virtual void SAL_CALL drawLine( const ::com::sun::star::geometry::RealPoint2D& aStartPoint,
+ const ::com::sun::star::geometry::RealPoint2D& aEndPoint,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(aStartPoint, aEndPoint, viewState, renderState,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ maCanvasHelper.drawLine( this, aStartPoint, aEndPoint, viewState, renderState );
+ }
+
+ virtual void SAL_CALL drawBezier( const ::com::sun::star::geometry::RealBezierSegment2D& aBezierSegment,
+ const ::com::sun::star::geometry::RealPoint2D& aEndPoint,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(aBezierSegment, aEndPoint, viewState, renderState,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ maCanvasHelper.drawBezier( this, aBezierSegment, aEndPoint, viewState, renderState );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
+ drawPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(xPolyPolygon, viewState, renderState,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ return maCanvasHelper.drawPolyPolygon( this, xPolyPolygon, viewState, renderState );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
+ strokePolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(xPolyPolygon, viewState, renderState, strokeAttributes,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ return maCanvasHelper.strokePolyPolygon( this, xPolyPolygon, viewState, renderState, strokeAttributes );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
+ strokeTexturedPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >& textures,
+ const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(xPolyPolygon, viewState, renderState, strokeAttributes,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ return maCanvasHelper.strokeTexturedPolyPolygon( this, xPolyPolygon, viewState, renderState, textures, strokeAttributes );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
+ strokeTextureMappedPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >& textures,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::geometry::XMapping2D >& xMapping,
+ const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(xPolyPolygon, viewState, renderState, textures, xMapping, strokeAttributes,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ return maCanvasHelper.strokeTextureMappedPolyPolygon( this, xPolyPolygon, viewState, renderState, textures, xMapping, strokeAttributes );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > SAL_CALL
+ queryStrokeShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(xPolyPolygon, viewState, renderState, strokeAttributes,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ return maCanvasHelper.queryStrokeShapes( this, xPolyPolygon, viewState, renderState, strokeAttributes );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
+ fillPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(xPolyPolygon, viewState, renderState,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ return maCanvasHelper.fillPolyPolygon( this, xPolyPolygon, viewState, renderState );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
+ fillTexturedPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >& textures ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(xPolyPolygon, viewState, renderState, textures,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ return maCanvasHelper.fillTexturedPolyPolygon( this, xPolyPolygon, viewState, renderState, textures );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
+ fillTextureMappedPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >& textures,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::geometry::XMapping2D >& xMapping ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(xPolyPolygon, viewState, renderState, textures, xMapping,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ return maCanvasHelper.fillTextureMappedPolyPolygon( this, xPolyPolygon, viewState, renderState, textures, xMapping );
+ }
+
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > SAL_CALL
+ createFont( const ::com::sun::star::rendering::FontRequest& fontRequest,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& extraFontProperties,
+ const ::com::sun::star::geometry::Matrix2D& fontMatrix ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(fontRequest,
+ // dummy, to keep argPos in sync
+ fontRequest,
+ fontMatrix,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maCanvasHelper.createFont( this, fontRequest, extraFontProperties, fontMatrix );
+ }
+
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::FontInfo > SAL_CALL
+ queryAvailableFonts( const ::com::sun::star::rendering::FontInfo& aFilter,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aFontProperties ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(aFilter,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maCanvasHelper.queryAvailableFonts( this, aFilter, aFontProperties );
+ }
+
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
+ drawText( const ::com::sun::star::rendering::StringContext& text,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont >& xFont,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ sal_Int8 textDirection ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(xFont, viewState, renderState,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+ tools::verifyRange( textDirection,
+ ::com::sun::star::rendering::TextDirection::WEAK_LEFT_TO_RIGHT,
+ ::com::sun::star::rendering::TextDirection::STRONG_RIGHT_TO_LEFT );
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ return maCanvasHelper.drawText( this, text, xFont, viewState, renderState, textDirection );
+ }
+
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
+ drawTextLayout( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XTextLayout >& layoutetText,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(layoutetText, viewState, renderState,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ return maCanvasHelper.drawTextLayout( this, layoutetText, viewState, renderState );
+ }
+
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
+ drawBitmap( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >& xBitmap,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(xBitmap, viewState, renderState,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ return maCanvasHelper.drawBitmap( this, xBitmap, viewState, renderState );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
+ drawBitmapModulated( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >& xBitmap,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(xBitmap, viewState, renderState,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ mbSurfaceDirty = true;
+ maCanvasHelper.modifying();
+
+ return maCanvasHelper.drawBitmapModulated( this, xBitmap, viewState, renderState );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice > SAL_CALL
+ getDevice() throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maCanvasHelper.getDevice();
+ }
+
+ protected:
+ ~CanvasBase() {} // we're a ref-counted UNO class. _We_ destroy ourselves.
+
+ HelperType maCanvasHelper;
+ mutable bool mbSurfaceDirty;
+
+ private:
+ CanvasBase( const CanvasBase& );
+ CanvasBase& operator=( const CanvasBase& );
+ };
+}
+
+#endif /* INCLUDED_CANVAS_CANVASBASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/base/canvascustomspritebase.hxx b/include/canvas/base/canvascustomspritebase.hxx
new file mode 100644
index 000000000000..7c1b5508bb4e
--- /dev/null
+++ b/include/canvas/base/canvascustomspritebase.hxx
@@ -0,0 +1,271 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_CANVASCUSTOMSPRITEBASE_HXX
+#define INCLUDED_CANVAS_CANVASCUSTOMSPRITEBASE_HXX
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/rendering/XCustomSprite.hpp>
+#include <com/sun/star/rendering/XPolyPolygon2D.hpp>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <canvas/base/integerbitmapbase.hxx>
+#include <canvas/base/sprite.hxx>
+
+#include <boost/utility.hpp>
+
+
+namespace canvas
+{
+ /** Helper template to handle XCustomSprite method forwarding to
+ CanvasCustomSpriteHelper
+
+ Use this helper to handle the XCustomSprite part of your
+ implementation.
+
+ @tpl Base
+ Base class to use, most probably one of the
+ WeakComponentImplHelperN templates with the appropriate
+ interfaces. At least XCustomSprite and Sprite should be among
+ them (why else would you use this template, then?). Base class
+ must have an Base( const Mutex& ) constructor (like the
+ WeakComponentImplHelperN templates have).
+
+ @tpl SpriteHelper
+ Sprite helper implementation for the backend in question
+
+ @tpl CanvasHelper
+ Canvas helper implementation for the backend in question
+
+ @tpl Mutex
+ Lock strategy to use. Defaults to using the
+ OBaseMutex-provided lock. Everytime one of the methods is
+ entered, an object of type Mutex is created with m_aMutex as
+ the sole parameter, and destroyed again when the method scope
+ is left.
+
+ @tpl UnambiguousBase
+ Optional unambiguous base class for XInterface of Base. It's
+ sometimes necessary to specify this parameter, e.g. if Base
+ derives from multiple UNO interface (were each provides its
+ own version of XInterface, making the conversion ambiguous)
+
+ @see CanvasCustomSpriteHelper for further contractual
+ requirements towards the SpriteHelper type, and some examples.
+ */
+ template< class Base,
+ class SpriteHelper,
+ class CanvasHelper,
+ class Mutex=::osl::MutexGuard,
+ class UnambiguousBase=::com::sun::star::uno::XInterface > class CanvasCustomSpriteBase :
+ public IntegerBitmapBase< Base, CanvasHelper, Mutex, UnambiguousBase >
+ {
+ public:
+ typedef IntegerBitmapBase< Base, CanvasHelper, Mutex, UnambiguousBase > BaseType;
+ typedef SpriteHelper SpriteHelperType;
+
+ CanvasCustomSpriteBase() :
+ maSpriteHelper()
+ {
+ }
+
+ /** Object is being disposed.
+
+ Called from the cppu helper base, to notify disposal of
+ this object. Already releases all internal references.
+
+ @derive when overriding this method in derived classes,
+ <em>always</em> call the base class' method!
+ */
+ virtual void disposeThis()
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maSpriteHelper.disposing();
+
+ // pass on to base class
+ BaseType::disposeThis();
+ }
+
+ // XCanvas: selectively override base's methods here, for opacity tracking
+ virtual void SAL_CALL clear() throw (::com::sun::star::uno::RuntimeException)
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maSpriteHelper.clearingContent( this );
+
+ // and forward to base class, which handles the actual rendering
+ return BaseType::clear();
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
+ drawBitmap( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >& xBitmap,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(xBitmap, viewState, renderState,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< typename BaseType::UnambiguousBaseType* >(this));
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maSpriteHelper.checkDrawBitmap( this, xBitmap, viewState, renderState );
+
+ // and forward to base class, which handles the actual rendering
+ return BaseType::drawBitmap( xBitmap,
+ viewState,
+ renderState );
+ }
+
+ // TODO(F3): If somebody uses the XIntegerBitmap methods to
+ // clear pixel (setting alpha != 1.0 there), or a compositing
+ // mode results in similar alpha, maSpriteHelper might
+ // errorneously report fully opaque sprites. Effectively, all
+ // render methods must be overridden here; or better,
+ // functionality provided at the baseclass.
+
+ // XSprite
+ virtual void SAL_CALL setAlpha( double alpha ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyRange( alpha, 0.0, 1.0 );
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maSpriteHelper.setAlpha( this, alpha );
+ }
+
+ virtual void SAL_CALL move( const ::com::sun::star::geometry::RealPoint2D& aNewPos,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(aNewPos, viewState, renderState,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< typename BaseType::UnambiguousBaseType* >(this));
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maSpriteHelper.move( this, aNewPos, viewState, renderState );
+ }
+
+ virtual void SAL_CALL transform( const ::com::sun::star::geometry::AffineMatrix2D& aTransformation ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(aTransformation,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< typename BaseType::UnambiguousBaseType* >(this));
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maSpriteHelper.transform( this, aTransformation );
+ }
+
+ virtual void SAL_CALL clip( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& aClip ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ // NULL xClip explicitly allowed here (to clear clipping)
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maSpriteHelper.clip( this, aClip );
+ }
+
+ virtual void SAL_CALL setPriority( double nPriority ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maSpriteHelper.setPriority( this, nPriority );
+ }
+
+ virtual void SAL_CALL show() throw (::com::sun::star::uno::RuntimeException)
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maSpriteHelper.show( this );
+ }
+
+ virtual void SAL_CALL hide() throw (::com::sun::star::uno::RuntimeException)
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maSpriteHelper.hide( this );
+ }
+
+ // XCustomSprite
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas > SAL_CALL
+ getContentCanvas() throw (::com::sun::star::uno::RuntimeException)
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return this;
+ }
+
+ // Sprite
+ virtual bool isAreaUpdateOpaque( const ::basegfx::B2DRange& rUpdateArea ) const
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return maSpriteHelper.isAreaUpdateOpaque( rUpdateArea );
+ }
+
+ virtual bool isContentChanged() const
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::mbSurfaceDirty;
+ }
+
+ virtual ::basegfx::B2DPoint getPosPixel() const
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return maSpriteHelper.getPosPixel();
+ }
+
+ virtual ::basegfx::B2DVector getSizePixel() const
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return maSpriteHelper.getSizePixel();
+ }
+
+ virtual ::basegfx::B2DRange getUpdateArea() const
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return maSpriteHelper.getUpdateArea();
+ }
+
+ virtual double getPriority() const
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return maSpriteHelper.getPriority();
+ }
+
+ protected:
+ SpriteHelperType maSpriteHelper;
+ };
+}
+
+#endif /* INCLUDED_CANVAS_CANVASCUSTOMSPRITEBASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/base/canvascustomspritehelper.hxx b/include/canvas/base/canvascustomspritehelper.hxx
new file mode 100644
index 000000000000..2b2fd2d774d8
--- /dev/null
+++ b/include/canvas/base/canvascustomspritehelper.hxx
@@ -0,0 +1,287 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_CANVASCUSTOMSPRITEHELPER_HXX
+#define INCLUDED_CANVAS_CANVASCUSTOMSPRITEHELPER_HXX
+
+#include <com/sun/star/rendering/XCustomSprite.hpp>
+#include <com/sun/star/rendering/XPolyPolygon2D.hpp>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <canvas/base/spritesurface.hxx>
+#include <canvas/canvastoolsdllapi.h>
+
+namespace canvas
+{
+ /* Definition of CanvasCustomSpriteHelper class */
+
+ /** Base class for an XSprite helper implementation - to be used
+ in concert with CanvasCustomSpriteBase
+ */
+ class CANVASTOOLS_DLLPUBLIC CanvasCustomSpriteHelper
+ {
+ public:
+ CanvasCustomSpriteHelper();
+ virtual ~CanvasCustomSpriteHelper() {}
+
+ /** Init helper
+
+ @param rSpriteSize
+ Requested size of the sprite, as passed to the
+ XSpriteCanvas::createCustomSprite() method
+
+ @param rOwningSpriteCanvas
+ The XSpriteCanvas this sprite is displayed on
+ */
+ void init( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
+ const SpriteSurface::Reference& rOwningSpriteCanvas );
+
+ /** Object is being disposed, release all internal references
+
+ @derive when overriding this method in derived classes,
+ <em>always</em> call the base class' method!
+ */
+ void disposing();
+
+ // XCanvas
+ /// need to call this method for XCanvas::clear(), for opacity tracking
+ void clearingContent( const Sprite::Reference& rSprite );
+
+ /// need to call this method for XCanvas::drawBitmap(), for opacity tracking
+ void checkDrawBitmap( const Sprite::Reference& rSprite,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >& xBitmap,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+
+ // XSprite
+ void setAlpha( const Sprite::Reference& rSprite,
+ double alpha );
+ void move( const Sprite::Reference& rSprite,
+ const ::com::sun::star::geometry::RealPoint2D& aNewPos,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+ void transform( const Sprite::Reference& rSprite,
+ const ::com::sun::star::geometry::AffineMatrix2D& aTransformation );
+ void clip( const Sprite::Reference& rSprite,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& aClip );
+ void setPriority( const Sprite::Reference& rSprite,
+ double nPriority );
+ void show( const Sprite::Reference& rSprite );
+ void hide( const Sprite::Reference& rSprite );
+
+ // Sprite
+ bool isAreaUpdateOpaque( const ::basegfx::B2DRange& rUpdateArea ) const;
+ ::basegfx::B2DPoint getPosPixel() const;
+ ::basegfx::B2DVector getSizePixel() const;
+ ::basegfx::B2DRange getUpdateArea() const;
+ double getPriority() const;
+
+ // redraw must be implemented by derived - non sensible default implementation
+ // void redraw( const Sprite::Reference& rSprite,
+ // const ::basegfx::B2DPoint& rPos ) const;
+
+
+ // Helper methods for derived classes
+ // ----------------------------------
+
+ /// Calc sprite update area from given raw sprite bounds
+ ::basegfx::B2DRange getUpdateArea( const ::basegfx::B2DRange& rUntransformedSpriteBounds ) const;
+
+ /// Calc update area for unclipped sprite content
+ ::basegfx::B2DRange getFullSpriteRect() const;
+
+ /** Returns true, if sprite content bitmap is fully opaque.
+
+ This does not take clipping or transformation into
+ account, but only denotes that the sprite bitmap's alpha
+ channel is all 1.0
+ */
+ bool isContentFullyOpaque() const { return mbIsContentFullyOpaque; }
+
+ /// Returns true, if transformation has changed since last transformUpdated() call
+ bool hasAlphaChanged() const { return mbAlphaDirty; }
+
+ /// Returns true, if transformation has changed since last transformUpdated() call
+ bool hasPositionChanged() const { return mbPositionDirty; }
+
+ /// Returns true, if transformation has changed since last transformUpdated() call
+ bool hasTransformChanged() const { return mbTransformDirty; }
+
+ /// Returns true, if transformation has changed since last transformUpdated() call
+ bool hasClipChanged() const { return mbClipDirty; }
+
+ /// Returns true, if transformation has changed since last transformUpdated() call
+ bool hasPrioChanged() const { return mbPrioDirty; }
+
+ /// Returns true, if transformation has changed since last transformUpdated() call
+ bool hasVisibilityChanged() const { return mbVisibilityDirty; }
+
+ /// Retrieve current alpha value
+ double getAlpha() const { return mfAlpha; }
+
+ /// Retrieve current clip
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XPolyPolygon2D >& getClip() const { return mxClipPoly; }
+
+ const ::basegfx::B2DHomMatrix& getTransformation() const { return maTransform; }
+
+ /// Retrieve current activation state
+ bool isActive() const { return mbActive; }
+
+ protected:
+ /** Notifies that caller is again in sync with current alph
+
+ const, but modifies state visible to derived
+ classes. beware of passing this information to the
+ outside!
+ */
+ void alphaUpdated() const { mbAlphaDirty=false; }
+
+ /** Notifies that caller is again in sync with current position
+
+ const, but modifies state visible to derived
+ classes. beware of passing this information to the
+ outside!
+ */
+ void positionUpdated() const { mbPositionDirty=false; }
+
+ /** Notifies that caller is again in sync with current transformation
+
+ const, but modifies state visible to derived
+ classes. beware of passing this information to the
+ outside!
+ */
+ void transformUpdated() const { mbTransformDirty=false; }
+
+ /** Notifies that caller is again in sync with current clip
+
+ const, but modifies state visible to derived
+ classes. beware of passing this information to the
+ outside!
+ */
+ void clipUpdated() const { mbClipDirty=false; }
+
+ /** Notifies that caller is again in sync with current priority
+
+ const, but modifies state visible to derived
+ classes. beware of passing this information to the
+ outside!
+ */
+ void prioUpdated() const { mbPrioDirty=false; }
+
+ /** Notifies that caller is again in sync with current visibility
+
+ const, but modifies state visible to derived
+ classes. beware of passing this information to the
+ outside!
+ */
+ void visibilityUpdated() const { mbVisibilityDirty=false; }
+
+ private:
+ CanvasCustomSpriteHelper( const CanvasCustomSpriteHelper& );
+ CanvasCustomSpriteHelper& operator=( const CanvasCustomSpriteHelper& );
+
+ /** Called to convert an API polygon to a basegfx polygon
+
+ @derive Needs to be provided by backend-specific code
+ */
+ virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D(
+ ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPoly ) const = 0;
+
+ /** Update clip information from current state
+
+ This method recomputes the maCurrClipBounds and
+ mbIsCurrClipRectangle members from the current clip and
+ transformation. IFF the clip changed from rectangular to
+ rectangular again, this method issues a sequence of
+ optimized SpriteSurface::updateSprite() calls.
+
+ @return true, if SpriteSurface::updateSprite() was already
+ called within this method.
+ */
+ bool updateClipState( const Sprite::Reference& rSprite );
+
+ // --------------------------------------------------------------------
+
+ /// Owning sprite canvas
+ SpriteSurface::Reference mpSpriteCanvas;
+
+ /** Currently active clip area.
+
+ This member is either empty, denoting that the current
+ clip shows the full sprite content, or contains a
+ rectangular subarea of the sprite, outside of which
+ the sprite content is fully clipped.
+
+ @see mbIsCurrClipRectangle
+ */
+ ::basegfx::B2DRange maCurrClipBounds;
+
+ // sprite state
+ ::basegfx::B2DPoint maPosition;
+ ::basegfx::B2DVector maSize;
+ ::basegfx::B2DHomMatrix maTransform;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XPolyPolygon2D > mxClipPoly;
+ double mfPriority;
+ double mfAlpha;
+ bool mbActive; // true, if not hidden
+
+ /** If true, denotes that the current sprite clip is a true
+ rectangle, i.e. maCurrClipBounds <em>exactly</em>
+ describes the visible area of the sprite.
+
+ @see maCurrClipBounds
+ */
+ bool mbIsCurrClipRectangle;
+
+ /** Redraw speedup.
+
+ When true, this flag denotes that the current sprite
+ content is fully opaque, thus, that blits to the screen do
+ neither have to take alpha into account, nor prepare any
+ background for the sprite area.
+ */
+ mutable bool mbIsContentFullyOpaque;
+
+ /// True, iff mfAlpha has changed
+ mutable bool mbAlphaDirty;
+
+ /// True, iff maPosition has changed
+ mutable bool mbPositionDirty;
+
+ /// True, iff maTransform has changed
+ mutable bool mbTransformDirty;
+
+ /// True, iff mxClipPoly has changed
+ mutable bool mbClipDirty;
+
+ /// True, iff mnPriority has changed
+ mutable bool mbPrioDirty;
+
+ /// True, iff mbActive has changed
+ mutable bool mbVisibilityDirty;
+ };
+}
+
+#endif /* INCLUDED_CANVAS_CANVASCUSTOMSPRITEHELPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/base/disambiguationhelper.hxx b/include/canvas/base/disambiguationhelper.hxx
new file mode 100644
index 000000000000..f12a61472cd4
--- /dev/null
+++ b/include/canvas/base/disambiguationhelper.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_DISAMBIGUATIONHELPER_HXX
+#define INCLUDED_CANVAS_DISAMBIGUATIONHELPER_HXX
+
+#include <osl/mutex.hxx>
+
+
+/* Definition of the DisambiguationHelper class */
+
+namespace canvas
+{
+ /** Base class, initializing its own baseclass with m_aMutex.
+
+ This is necessary to make the CanvasBase, GraphicDeviceBase,
+ etc. classes freely combinable - letting them perform this
+ initialization would prohibit deriving e.g. CanvasBase from
+ GraphicDeviceBase.
+
+ On top of that, disambiguates XEventListener::disposing and
+ WeakComponentImplHelper::disposing.
+
+ Having two virtual methods with the same name, and not
+ overriding them in every derived class, will hide one of
+ them. Later trying to override the same method, will generate
+ a new vtable slot, and lead to very hard to spot errors.
+ */
+ template< class Base > class DisambiguationHelper : public Base
+ {
+ public:
+ typedef Base BaseType;
+
+ /** Construct DisambiguationHelper
+
+ This method is the whole purpose of this template:
+ initializing a base class with the provided m_aMutex
+ member (the WeakComponentImplHelper templates need that,
+ as they require the lifetime of the mutex to extend
+ theirs).
+ */
+ DisambiguationHelper() :
+ BaseType( m_aMutex )
+ {
+ }
+
+ virtual void SAL_CALL disposing()
+ { disposeThis(); }
+
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException)
+ { disposeEventSource(Source); }
+
+ virtual void disposeThis()
+ {}
+ virtual void disposeEventSource( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException)
+ {}
+
+protected:
+ mutable ::osl::Mutex m_aMutex;
+ };
+}
+
+#endif /* INCLUDED_CANVAS_DISAMBIGUATIONHELPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/base/graphicdevicebase.hxx b/include/canvas/base/graphicdevicebase.hxx
new file mode 100644
index 000000000000..5c3372e3f76a
--- /dev/null
+++ b/include/canvas/base/graphicdevicebase.hxx
@@ -0,0 +1,382 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_GRAPHICDEVICEBASE_HXX
+#define INCLUDED_CANVAS_GRAPHICDEVICEBASE_HXX
+
+#include <rtl/ref.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/util/XUpdatable.hpp>
+#include <com/sun/star/rendering/XGraphicDevice.hpp>
+#include <com/sun/star/rendering/XColorSpace.hpp>
+
+#include <canvas/parametricpolypolygon.hxx>
+#include <canvas/propertysethelper.hxx>
+
+
+/* Definition of GraphicDeviceBase class */
+
+namespace canvas
+{
+ /** Helper template base class for XGraphicDevice implementations.
+
+ This base class provides partial implementations of the
+ XGraphicDevice-related interface, such as XColorSpace.
+
+ This template basically interposes itself between the full
+ interface you implement (i.e. not restricted to XGraphicDevice
+ etc.). The problem with UNO partial interface implementation
+ actually is, that you cannot do it the plain way, since
+ deriving from a common base subclass always introduces the
+ whole set of pure virtuals, that your baseclass helper just
+ overrided) and your implementation class. You then only have
+ to implement the functionality <em>besides</em>
+ XGraphicDevice. If you want to support the optional debug
+ XUpdatable interface, also add that to the base classes
+ (client code will call the corresponding update() method,
+ whenever a burst of animations is over).
+
+ <pre>
+ Example:
+ typedef ::cppu::WeakComponentImplHelper5< ::com::sun::star::rendering::XGraphicDevice,
+ ::com::sun::star::rendering::XColorSpace,
+ ::com::sun::star::rendering::XPropertySet,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base;
+ typedef ::canvas::internal::GraphicDeviceBase< GraphicDeviceBase, DeviceHelper > ExampleDevice_Base;
+
+ class ExampleDevice : public ExampleDevice_Base
+ {
+ };
+ </pre>
+
+ @tpl Base
+ Base class to use, most probably one of the
+ WeakComponentImplHelperN templates with the appropriate
+ interfaces. At least XGraphicDevice should be among them (why else
+ would you use this template, then?). Base class must have an
+ Base( const Mutex& ) constructor (like the
+ WeakComponentImplHelperN templates have). As the very least,
+ the base class must be derived from uno::XInterface, as some
+ error reporting mechanisms rely on that.
+
+ @tpl DeviceHelper
+ Device helper implementation for the backend in question. This
+ object will be held as a member of this template class, and
+ basically gets forwarded all XGraphicDevice API calls that
+ could not be handled generically.
+
+ @tpl Mutex
+ Lock strategy to use. Defaults to using the
+ DisambiguationHelper-provided lock. Everytime one of the methods is
+ entered, an object of type Mutex is created with m_aMutex as
+ the sole parameter, and destroyed again when the method scope
+ is left.
+
+ @tpl UnambiguousBase
+ Optional unambiguous base class for XInterface of Base. It's
+ sometimes necessary to specify this parameter, e.g. if Base
+ derives from multiple UNO interface (were each provides its
+ own version of XInterface, making the conversion ambiguous)
+ */
+ template< class Base,
+ class DeviceHelper,
+ class Mutex=::osl::MutexGuard,
+ class UnambiguousBase=::com::sun::star::uno::XInterface > class GraphicDeviceBase :
+ public Base
+ {
+ public:
+ typedef Base BaseType;
+ typedef DeviceHelper DeviceHelperType;
+ typedef Mutex MutexType;
+ typedef UnambiguousBase UnambiguousBaseType;
+ typedef GraphicDeviceBase ThisType;
+
+ typedef ::rtl::Reference< GraphicDeviceBase > Reference;
+
+ GraphicDeviceBase() :
+ maDeviceHelper(),
+ maPropHelper(),
+ mbDumpScreenContent(false)
+ {
+ maPropHelper.initProperties( PropertySetHelper::MakeMap
+ ("HardwareAcceleration",
+ boost::bind(&DeviceHelper::isAccelerated,
+ boost::ref(maDeviceHelper)))
+ ("DeviceHandle",
+ boost::bind(&DeviceHelper::getDeviceHandle,
+ boost::ref(maDeviceHelper)))
+ ("SurfaceHandle",
+ boost::bind(&DeviceHelper::getSurfaceHandle,
+ boost::ref(maDeviceHelper)))
+ ("DumpScreenContent",
+ boost::bind(&ThisType::getDumpScreenContent,
+ this),
+ boost::bind(&ThisType::setDumpScreenContent,
+ this,
+ _1)));
+ }
+
+ virtual void disposeThis()
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ maDeviceHelper.disposing();
+
+ // pass on to base class
+ BaseType::disposeThis();
+ }
+
+ // XGraphicDevice
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBufferController > SAL_CALL getBufferController( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ return ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBufferController >();
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XColorSpace > SAL_CALL getDeviceColorSpace( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maDeviceHelper.getColorSpace();
+ }
+
+ virtual ::com::sun::star::geometry::RealSize2D SAL_CALL getPhysicalResolution( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maDeviceHelper.getPhysicalResolution();
+ }
+
+ virtual ::com::sun::star::geometry::RealSize2D SAL_CALL getPhysicalSize( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maDeviceHelper.getPhysicalSize();
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XLinePolyPolygon2D > SAL_CALL createCompatibleLinePolyPolygon( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > >& points ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maDeviceHelper.createCompatibleLinePolyPolygon( this, points );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBezierPolyPolygon2D > SAL_CALL createCompatibleBezierPolyPolygon( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& points ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maDeviceHelper.createCompatibleBezierPolyPolygon( this, points );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > SAL_CALL createCompatibleBitmap( const ::com::sun::star::geometry::IntegerSize2D& size ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyBitmapSize(size,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maDeviceHelper.createCompatibleBitmap( this, size );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > SAL_CALL createVolatileBitmap( const ::com::sun::star::geometry::IntegerSize2D& size ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyBitmapSize(size,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maDeviceHelper.createVolatileBitmap( this, size );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > SAL_CALL createCompatibleAlphaBitmap( const ::com::sun::star::geometry::IntegerSize2D& size ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyBitmapSize(size,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maDeviceHelper.createCompatibleAlphaBitmap( this, size );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > SAL_CALL createVolatileAlphaBitmap( const ::com::sun::star::geometry::IntegerSize2D& size ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyBitmapSize(size,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< UnambiguousBaseType* >(this));
+
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maDeviceHelper.createVolatileAlphaBitmap( this, size );
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > SAL_CALL getParametricPolyPolygonFactory( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ return this;
+ }
+
+ virtual ::sal_Bool SAL_CALL hasFullScreenMode( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maDeviceHelper.hasFullScreenMode();
+ }
+
+ virtual ::sal_Bool SAL_CALL enterFullScreenMode( ::sal_Bool bEnter ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ return maDeviceHelper.enterFullScreenMode( bEnter );
+ }
+
+ // XMultiServiceFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
+ {
+ return ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XParametricPolyPolygon2D >(
+ ParametricPolyPolygon::create(this,
+ aServiceSpecifier,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >()));
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString& aServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
+ {
+ return ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XParametricPolyPolygon2D >(
+ ParametricPolyPolygon::create(this,
+ aServiceSpecifier,
+ Arguments));
+ }
+
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ return ParametricPolyPolygon::getAvailableServiceNames();
+ }
+
+
+ // XUpdatable
+ virtual void SAL_CALL update() throw (com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+
+ if( mbDumpScreenContent )
+ maDeviceHelper.dumpScreenContent();
+ }
+
+
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+ return maPropHelper.getPropertySetInfo();
+ }
+
+ virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
+ const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::beans::PropertyVetoException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+ maPropHelper.setPropertyValue( aPropertyName, aValue );
+ }
+
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+ return maPropHelper.getPropertyValue( aPropertyName );
+ }
+
+ virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+ maPropHelper.addPropertyChangeListener( aPropertyName,
+ xListener );
+ }
+
+ virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+ maPropHelper.removePropertyChangeListener( aPropertyName,
+ xListener );
+ }
+
+ virtual void SAL_CALL addVetoableChangeListener( const OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+ maPropHelper.addVetoableChangeListener( aPropertyName,
+ xListener );
+ }
+
+ virtual void SAL_CALL removeVetoableChangeListener( const OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ MutexType aGuard( BaseType::m_aMutex );
+ maPropHelper.removeVetoableChangeListener( aPropertyName,
+ xListener );
+ }
+
+ protected:
+ ~GraphicDeviceBase() {} // we're a ref-counted UNO class. _We_ destroy ourselves.
+
+ ::com::sun::star::uno::Any getDumpScreenContent() const
+ {
+ return ::com::sun::star::uno::makeAny( mbDumpScreenContent );
+ }
+
+ void setDumpScreenContent( const ::com::sun::star::uno::Any& rAny )
+ {
+ // TODO(Q1): this was mbDumpScreenContent =
+ // rAny.get<bool>(), only that gcc3.3 wouldn't eat it
+ rAny >>= mbDumpScreenContent;
+ }
+
+ DeviceHelperType maDeviceHelper;
+ PropertySetHelper maPropHelper;
+ bool mbDumpScreenContent;
+
+ private:
+ GraphicDeviceBase( const GraphicDeviceBase& );
+ GraphicDeviceBase& operator=( const GraphicDeviceBase& );
+ };
+}
+
+#endif /* INCLUDED_CANVAS_GRAPHICDEVICEBASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/base/integerbitmapbase.hxx b/include/canvas/base/integerbitmapbase.hxx
new file mode 100644
index 000000000000..602e18a09eb0
--- /dev/null
+++ b/include/canvas/base/integerbitmapbase.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_CANVAS_INTEGERBITMAPBASE_HXX
+#define INCLUDED_CANVAS_INTEGERBITMAPBASE_HXX
+
+#include <com/sun/star/rendering/XIntegerBitmap.hpp>
+#include <canvas/base/bitmapcanvasbase.hxx>
+
+
+namespace canvas
+{
+ /** Helper template to handle XIntegerBitmap method forwarding to
+ BitmapCanvasHelper
+
+ Use this helper to handle the XIntegerBitmap part of your
+ implementation.
+
+ @tpl Base
+ Base class to use, most probably one of the
+ WeakComponentImplHelperN templates with the appropriate
+ interfaces. At least XIntegerBitmap should be among them (why
+ else would you use this template, then?). Base class must have
+ an Base( const Mutex& ) constructor (like the
+ WeakComponentImplHelperN templates have).
+
+ @tpl CanvasHelper
+ Canvas helper implementation for the backend in question
+
+ @tpl Mutex
+ Lock strategy to use. Defaults to using the
+ OBaseMutex-provided lock. Everytime one of the methods is
+ entered, an object of type Mutex is created with m_aMutex as
+ the sole parameter, and destroyed again when the method scope
+ is left.
+
+ @tpl UnambiguousBase
+ Optional unambiguous base class for XInterface of Base. It's
+ sometimes necessary to specify this parameter, e.g. if Base
+ derives from multiple UNO interface (were each provides its
+ own version of XInterface, making the conversion ambiguous)
+
+ @see CanvasBase for further contractual requirements towards
+ the CanvasHelper type, and some examples.
+ */
+ template< class Base,
+ class CanvasHelper,
+ class Mutex=::osl::MutexGuard,
+ class UnambiguousBase=::com::sun::star::uno::XInterface > class IntegerBitmapBase :
+ public BitmapCanvasBase< Base, CanvasHelper, Mutex, UnambiguousBase >
+ {
+ public:
+ typedef BitmapCanvasBase< Base, CanvasHelper, Mutex, UnambiguousBase > BaseType;
+
+ // XIntegerBitmap
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
+ const ::com::sun::star::geometry::IntegerRectangle2D& rect ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::rendering::VolatileContentDestroyedException, ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(rect,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< typename BaseType::UnambiguousBaseType* >(this));
+ tools::verifyIndexRange(rect, BaseType::getSize() );
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maCanvasHelper.getData( bitmapLayout,
+ rect );
+ }
+
+ virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< sal_Int8 >& data,
+ const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
+ const ::com::sun::star::geometry::IntegerRectangle2D& rect ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(bitmapLayout, rect,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< typename BaseType::UnambiguousBaseType* >(this));
+ tools::verifyIndexRange(rect, BaseType::getSize() );
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ BaseType::mbSurfaceDirty = true;
+ BaseType::maCanvasHelper.modifying();
+
+ BaseType::maCanvasHelper.setData( data, bitmapLayout, rect );
+ }
+
+ virtual void SAL_CALL setPixel( const ::com::sun::star::uno::Sequence< sal_Int8 >& color,
+ const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
+ const ::com::sun::star::geometry::IntegerPoint2D& pos ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(bitmapLayout, pos,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< typename BaseType::UnambiguousBaseType* >(this));
+ tools::verifyIndexRange(pos, BaseType::getSize() );
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ BaseType::mbSurfaceDirty = true;
+ BaseType::maCanvasHelper.modifying();
+
+ BaseType::maCanvasHelper.setPixel( color, bitmapLayout, pos );
+ }
+
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getPixel( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
+ const ::com::sun::star::geometry::IntegerPoint2D& pos ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::rendering::VolatileContentDestroyedException, ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(pos,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< typename BaseType::UnambiguousBaseType* >(this));
+ tools::verifyIndexRange(pos, BaseType::getSize() );
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maCanvasHelper.getPixel( bitmapLayout,
+ pos );
+ }
+
+ virtual ::com::sun::star::rendering::IntegerBitmapLayout SAL_CALL getMemoryLayout( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maCanvasHelper.getMemoryLayout();
+ }
+ };
+}
+
+#endif /* INCLUDED_CANVAS_INTEGERBITMAPBASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/base/sprite.hxx b/include/canvas/base/sprite.hxx
new file mode 100644
index 000000000000..4ebafd57f998
--- /dev/null
+++ b/include/canvas/base/sprite.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_CANVAS_SPRITE_HXX
+#define INCLUDED_CANVAS_SPRITE_HXX
+
+#include <rtl/ref.hxx>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/rendering/XCanvas.hpp>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/vector/b2dsize.hxx>
+
+namespace basegfx
+{
+ class B2DPoint;
+ class B2DVector;
+ class B2DRange;
+}
+
+namespace canvas
+{
+ /* Definition of Sprite interface (as we mix with UNO here, has to
+ be XInterface - reference holders to a Sprite must be able to
+ control lifetime of reference target)
+ */
+
+ /** Helper interface to connect SpriteCanvas with various
+ sprite implementations.
+
+ This interface should be implemented from every sprite class,
+ as it provides essential repaint and update area facilitates.
+
+ @derive typically, each canvas implementation will derive
+ another interface from this one, that adds rendering
+ functionality (which, of course, is impossible here in a
+ generic way)
+ */
+ class Sprite : public ::com::sun::star::lang::XComponent
+ {
+ public:
+ typedef ::rtl::Reference< Sprite > Reference;
+
+ /** Query whether sprite update will fully cover the given area.
+
+ Use this method to determine whether any background
+ content (regardless of static or sprite) needs an update
+ before rendering this sprite.
+
+ @return true, if sprite redraw will fully overwrite given
+ area (and thus, the background need not be redrawn
+ beforehand).
+ */
+ virtual bool isAreaUpdateOpaque( const ::basegfx::B2DRange& rUpdateArea ) const = 0;
+
+ /** Query whether content has changed
+ */
+ virtual bool isContentChanged() const = 0;
+
+ /** Query position of the left, top pixel of the sprite
+ */
+ virtual ::basegfx::B2DPoint getPosPixel() const = 0;
+
+ /** Query size of the sprite in pixel.
+ */
+ virtual ::basegfx::B2DVector getSizePixel() const = 0;
+
+ /** Get area that is currently covered by the sprite
+
+ This area is already adapted to clipping, alpha and
+ transformation state of this sprite.
+ */
+ virtual ::basegfx::B2DRange getUpdateArea() const = 0;
+
+ /** Query sprite priority
+ */
+ virtual double getPriority() const = 0;
+
+ protected:
+ ~Sprite() {}
+ };
+
+ /** Functor providing a StrictWeakOrdering for sprite references
+ */
+ struct SpriteWeakOrder
+ {
+ bool operator()( const Sprite::Reference& rLHS,
+ const Sprite::Reference& rRHS )
+ {
+ const double nPrioL( rLHS->getPriority() );
+ const double nPrioR( rRHS->getPriority() );
+
+ // if prios are equal, tie-break on ptr value
+ return nPrioL == nPrioR ? rLHS.get() < rRHS.get() : nPrioL < nPrioR;
+ }
+ };
+}
+
+#endif /* INCLUDED_CANVAS_SPRITE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/base/spritecanvasbase.hxx b/include/canvas/base/spritecanvasbase.hxx
new file mode 100644
index 000000000000..f892bf4170a7
--- /dev/null
+++ b/include/canvas/base/spritecanvasbase.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_CANVAS_SPRITECANVASBASE_HXX
+#define INCLUDED_CANVAS_SPRITECANVASBASE_HXX
+
+#include <rtl/ref.hxx>
+#include <com/sun/star/rendering/XSpriteCanvas.hpp>
+#include <com/sun/star/rendering/InterpolationMode.hpp>
+#include <canvas/base/integerbitmapbase.hxx>
+#include <canvas/spriteredrawmanager.hxx>
+
+
+namespace canvas
+{
+ /** Helper template to handle XIntegerBitmap method forwarding to
+ BitmapCanvasHelper
+
+ Use this helper to handle the XIntegerBitmap part of your
+ implementation.
+
+ @tpl Base
+ Base class to use, most probably one of the
+ WeakComponentImplHelperN templates with the appropriate
+ interfaces. At least XSpriteCanvas and SpriteSurface should be
+ among them (why else would you use this template, then?). Base
+ class must have an Base( const Mutex& ) constructor (like the
+ WeakComponentImplHelperN templates have).
+
+ @tpl CanvasHelper
+ Canvas helper implementation for the backend in question
+
+ @tpl Mutex
+ Lock strategy to use. Defaults to using the
+ OBaseMutex-provided lock. Everytime one of the methods is
+ entered, an object of type Mutex is created with m_aMutex as
+ the sole parameter, and destroyed again when the method scope
+ is left.
+
+ @tpl UnambiguousBase
+ Optional unambiguous base class for XInterface of Base. It's
+ sometimes necessary to specify this parameter, e.g. if Base
+ derives from multiple UNO interface (were each provides its
+ own version of XInterface, making the conversion ambiguous)
+
+ @see CanvasBase for further contractual requirements towards
+ the CanvasHelper type, and some examples.
+ */
+ template< class Base,
+ class CanvasHelper,
+ class Mutex=::osl::MutexGuard,
+ class UnambiguousBase=::com::sun::star::uno::XInterface > class SpriteCanvasBase :
+ public IntegerBitmapBase< Base, CanvasHelper, Mutex, UnambiguousBase >
+ {
+ public:
+ typedef IntegerBitmapBase< Base, CanvasHelper, Mutex, UnambiguousBase > BaseType;
+ typedef ::rtl::Reference< SpriteCanvasBase > Reference;
+
+ SpriteCanvasBase() :
+ maRedrawManager()
+ {
+ }
+
+ virtual void disposeThis()
+ {
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maRedrawManager.disposing();
+
+ // pass on to base class
+ BaseType::disposeThis();
+ }
+
+ // XSpriteCanvas
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XAnimatedSprite > SAL_CALL createSpriteFromAnimation( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XAnimation >& animation ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(animation,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< typename BaseType::UnambiguousBaseType* >(this));
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maCanvasHelper.createSpriteFromAnimation(animation);
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XAnimatedSprite > SAL_CALL createSpriteFromBitmaps( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > >& animationBitmaps,
+ sal_Int8 interpolationMode ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::rendering::VolatileContentDestroyedException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(animationBitmaps,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< typename BaseType::UnambiguousBaseType* >(this));
+ tools::verifyRange( interpolationMode,
+ ::com::sun::star::rendering::InterpolationMode::NEAREST_NEIGHBOR,
+ ::com::sun::star::rendering::InterpolationMode::BEZIERSPLINE4 );
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maCanvasHelper.createSpriteFromBitmaps(animationBitmaps, interpolationMode);
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCustomSprite > SAL_CALL createCustomSprite( const ::com::sun::star::geometry::RealSize2D& spriteSize ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifySpriteSize(spriteSize,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< typename BaseType::UnambiguousBaseType* >(this));
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maCanvasHelper.createCustomSprite(spriteSize);
+ }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSprite > SAL_CALL createClonedSprite( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSprite >& original ) throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ tools::verifyArgs(original,
+ BOOST_CURRENT_FUNCTION,
+ static_cast< typename BaseType::UnambiguousBaseType* >(this));
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ return BaseType::maCanvasHelper.createClonedSprite(original);
+ }
+
+ // SpriteSurface
+ virtual void showSprite( const Sprite::Reference& rSprite )
+ {
+ OSL_ASSERT( rSprite.is() );
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maRedrawManager.showSprite( rSprite );
+ }
+
+ virtual void hideSprite( const Sprite::Reference& rSprite )
+ {
+ OSL_ASSERT( rSprite.is() );
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maRedrawManager.hideSprite( rSprite );
+ }
+
+ virtual void moveSprite( const Sprite::Reference& rSprite,
+ const ::basegfx::B2DPoint& rOldPos,
+ const ::basegfx::B2DPoint& rNewPos,
+ const ::basegfx::B2DVector& rSpriteSize )
+ {
+ OSL_ASSERT( rSprite.is() );
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maRedrawManager.moveSprite( rSprite, rOldPos, rNewPos, rSpriteSize );
+ }
+
+ virtual void updateSprite( const Sprite::Reference& rSprite,
+ const ::basegfx::B2DPoint& rPos,
+ const ::basegfx::B2DRange& rUpdateArea )
+ {
+ OSL_ASSERT( rSprite.is() );
+
+ typename BaseType::MutexType aGuard( BaseType::m_aMutex );
+
+ maRedrawManager.updateSprite( rSprite, rPos, rUpdateArea );
+ }
+
+ protected:
+ SpriteRedrawManager maRedrawManager;
+ };
+}
+
+#endif /* INCLUDED_CANVAS_SPRITECANVASBASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/base/spritesurface.hxx b/include/canvas/base/spritesurface.hxx
new file mode 100644
index 000000000000..47a0fb24a67d
--- /dev/null
+++ b/include/canvas/base/spritesurface.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_CANVAS_SPRITESURFACE_HXX
+#define INCLUDED_CANVAS_SPRITESURFACE_HXX
+
+#include <canvas/base/sprite.hxx>
+
+namespace canvas
+{
+ /* Definition of the SpriteSurface interface */
+
+ /** Canvas surface containing sprites
+
+ Every canvas surface that contains sprites must implement this
+ interface, when employing the canvas base framework. The
+ methods provided here are used from the individual sprites to
+ notify the canvas about necessary screen updates.
+ */
+ class SpriteSurface : public ::com::sun::star::uno::XInterface
+ {
+ public:
+ typedef ::rtl::Reference< SpriteSurface > Reference;
+
+ /// Sprites should call this from XSprite::show()
+ virtual void showSprite( const Sprite::Reference& rSprite ) = 0;
+
+ /// Sprites should call this from XSprite::hide()
+ virtual void hideSprite( const Sprite::Reference& rSprite ) = 0;
+
+ /// Sprites should call this from XSprite::move()
+ virtual void moveSprite( const Sprite::Reference& rSprite,
+ const ::basegfx::B2DPoint& rOldPos,
+ const ::basegfx::B2DPoint& rNewPos,
+ const ::basegfx::B2DVector& rSpriteSize ) = 0;
+
+ /** Sprites should call this when some part of the content has
+ changed.
+
+ That includes show/hide, i.e. for show, both showSprite()
+ and updateSprite() must be called.
+ */
+ virtual void updateSprite( const Sprite::Reference& rSprite,
+ const ::basegfx::B2DPoint& rPos,
+ const ::basegfx::B2DRange& rUpdateArea ) = 0;
+
+ protected:
+ ~SpriteSurface() {}
+ };
+}
+
+#endif /* INCLUDED_CANVAS_SPRITESURFACE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/canvastools.hxx b/include/canvas/canvastools.hxx
new file mode 100644
index 000000000000..fd6dadd0a791
--- /dev/null
+++ b/include/canvas/canvastools.hxx
@@ -0,0 +1,587 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_CANVASTOOLS_HXX
+#define INCLUDED_CANVAS_CANVASTOOLS_HXX
+
+#include <rtl/math.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <osl/diagnose.h>
+#include <rtl/ustring.hxx>
+
+#include <string.h> // for strcmp
+#include <vector>
+#include <limits>
+#include <algorithm>
+
+#include <canvas/canvastoolsdllapi.h>
+
+namespace basegfx
+{
+ class B2DHomMatrix;
+ class B2DRange;
+ class B2IRange;
+ class B2IPoint;
+ class B2DPolyPolygon;
+}
+
+namespace com { namespace sun { namespace star { namespace geometry
+{
+ struct RealSize2D;
+ struct IntegerSize2D;
+ struct AffineMatrix2D;
+ struct Matrix2D;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace rendering
+{
+ struct RenderState;
+ struct ViewState;
+ struct IntegerBitmapLayout;
+ class XCanvas;
+ struct Texture;
+ class XIntegerBitmapColorSpace;
+ class XPolyPolygon2D;
+
+ bool operator==( const RenderState& rLHS,
+ const RenderState& rRHS );
+
+ bool operator==( const ViewState& rLHS,
+ const ViewState& rRHS );
+} } } }
+
+namespace com { namespace sun { namespace star { namespace awt
+{
+ struct Rectangle;
+ class XWindow2;
+} } } }
+
+class Color;
+
+namespace canvas
+{
+ namespace tools
+ {
+ /** Compute the next highest power of 2 of a 32-bit value
+
+ Code devised by Sean Anderson, in good ole HAKMEM
+ tradition.
+
+ @return 1 << (lg(x - 1) + 1)
+ */
+ inline sal_uInt32 nextPow2( sal_uInt32 x )
+ {
+ --x;
+ x |= x >> 1;
+ x |= x >> 2;
+ x |= x >> 4;
+ x |= x >> 8;
+ x |= x >> 16;
+
+ return ++x;
+ }
+
+ /**
+ *
+ * Count the number of 1-bits of an n-bit value
+ *
+ */
+
+ // mickey's math tricks...
+ inline unsigned int pow2( unsigned int c ) { return 0x1 << c; }
+ inline unsigned int mask( unsigned int c ) { return ((unsigned int)(-1)) / (pow2(pow2(c)) + 1); }
+ inline unsigned int count( unsigned int x, unsigned int c ) { return ((x) & mask(c)) + (((x) >> (pow2(c))) & mask(c)); }
+ template<typename T>
+ inline unsigned int bitcount( T c ) {
+ unsigned int nByteIndex = 0;
+ unsigned int nNumBytes = sizeof(T)<<2;
+ do {
+ c=count(c,nByteIndex++);
+ nNumBytes >>= 1;
+ } while(nNumBytes);
+ return c;
+ }
+ inline sal_uInt32 bitcount32( sal_uInt32 c ) {
+ c=count(c,0);
+ c=count(c,1);
+ c=count(c,2);
+ c=count(c,3);
+ c=count(c,4);
+ return c;
+ }
+
+ /** Round given floating point value down to next integer
+ */
+ inline sal_Int32 roundDown( const double& rVal )
+ {
+ return static_cast< sal_Int32 >( floor( rVal ) );
+ }
+
+ /** Round given floating point value up to next integer
+ */
+ inline sal_Int32 roundUp( const double& rVal )
+ {
+ return static_cast< sal_Int32 >( ceil( rVal ) );
+ }
+
+ /** Create a RealSize2D with both coordinate values set to +infinity
+ */
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::geometry::RealSize2D createInfiniteSize2D();
+
+
+ // View- and RenderState utilities
+ // ===================================================================
+
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::rendering::RenderState&
+ initRenderState( ::com::sun::star::rendering::RenderState& renderState );
+
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::rendering::ViewState&
+ initViewState( ::com::sun::star::rendering::ViewState& viewState );
+
+ CANVASTOOLS_DLLPUBLIC ::basegfx::B2DHomMatrix&
+ getViewStateTransform( ::basegfx::B2DHomMatrix& transform,
+ const ::com::sun::star::rendering::ViewState& viewState );
+
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::rendering::ViewState&
+ setViewStateTransform( ::com::sun::star::rendering::ViewState& viewState,
+ const ::basegfx::B2DHomMatrix& transform );
+
+ CANVASTOOLS_DLLPUBLIC ::basegfx::B2DHomMatrix&
+ getRenderStateTransform( ::basegfx::B2DHomMatrix& transform,
+ const ::com::sun::star::rendering::RenderState& renderState );
+
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::rendering::RenderState&
+ setRenderStateTransform( ::com::sun::star::rendering::RenderState& renderState,
+ const ::basegfx::B2DHomMatrix& transform );
+
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::rendering::RenderState&
+ appendToRenderState( ::com::sun::star::rendering::RenderState& renderState,
+ const ::basegfx::B2DHomMatrix& transform );
+
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::rendering::RenderState&
+ prependToRenderState( ::com::sun::star::rendering::RenderState& renderState,
+ const ::basegfx::B2DHomMatrix& transform );
+
+ CANVASTOOLS_DLLPUBLIC ::basegfx::B2DHomMatrix&
+ mergeViewAndRenderTransform( ::basegfx::B2DHomMatrix& transform,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+
+
+ // Matrix utilities
+ // ===================================================================
+
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::geometry::AffineMatrix2D&
+ setIdentityAffineMatrix2D( ::com::sun::star::geometry::AffineMatrix2D& matrix );
+
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::geometry::Matrix2D&
+ setIdentityMatrix2D( ::com::sun::star::geometry::Matrix2D& matrix );
+
+
+ // Special utilities
+ // ===================================================================
+
+ /** Calc the bounding rectangle of a transformed rectangle.
+
+ The method applies the given transformation to the
+ specified input rectangle, and returns the bounding box of
+ the resulting output area.
+
+ @param o_Rect
+ Output rectangle
+
+ @param i_Rect
+ Input rectangle
+
+ @param i_Transformation
+ Transformation to apply to the input rectangle
+
+ @return a reference to the resulting rectangle
+ */
+ CANVASTOOLS_DLLPUBLIC ::basegfx::B2DRange& calcTransformedRectBounds( ::basegfx::B2DRange& o_Rect,
+ const ::basegfx::B2DRange& i_Rect,
+ const ::basegfx::B2DHomMatrix& i_Transformation );
+
+ /** Calc a transform that maps the upper, left corner of a
+ rectangle to the origin.
+
+ The method is a specialized version of
+ calcRectToRectTransform() (Removed now), mapping the input rectangle's
+ the upper, left corner to the origin, and leaving the size
+ untouched.
+
+ @param o_transform
+ Output parameter, to receive the resulting transformation
+ matrix.
+
+ @param i_srcRect
+ Input parameter, specifies the original source
+ rectangle. The resulting transformation will exactly map
+ the source rectangle's upper, left corner to the origin.
+
+ @param i_transformation
+ The original transformation matrix. This is changed with
+ translations (if necessary), to exactly map the source
+ rectangle to the origin.
+
+ @return a reference to the resulting transformation matrix
+
+ @see calcRectToRectTransform()
+ @see calcTransformedRectBounds()
+ */
+ CANVASTOOLS_DLLPUBLIC ::basegfx::B2DHomMatrix& calcRectToOriginTransform( ::basegfx::B2DHomMatrix& o_transform,
+ const ::basegfx::B2DRange& i_srcRect,
+ const ::basegfx::B2DHomMatrix& i_transformation );
+
+ /** Check whether a given rectangle is within another
+ transformed rectangle.
+
+ This method checks for polygonal containedness, i.e. the
+ transformed rectangle is not represented as an axis-alignd
+ rectangle anymore (like calcTransformedRectBounds()), but
+ polygonal. Thus, the insideness test is based on tight
+ bounds.
+
+ @param rContainedRect
+ This rectangle is checked, whether it is fully within the
+ transformed rTransformRect.
+
+ @param rTransformRect
+ This rectangle is transformed, and then checked whether it
+ fully contains rContainedRect.
+
+ @param rTransformation
+ This transformation is applied to rTransformRect
+ */
+ CANVASTOOLS_DLLPUBLIC bool isInside( const ::basegfx::B2DRange& rContainedRect,
+ const ::basegfx::B2DRange& rTransformRect,
+ const ::basegfx::B2DHomMatrix& rTransformation );
+
+ /** Clip a scroll to the given bound rect
+
+ @param io_rSourceArea
+ Source area to scroll. The resulting clipped source area
+ is returned therein.
+
+ @param io_rDestPoint
+ Destination point of the scroll (upper, left corner of
+ rSourceArea after the scroll). The new, resulting
+ destination point is returned therein.q
+
+ @param o_ClippedAreas
+ Vector of rectangles in the <em>destination</em> area
+ coordinate system, which are clipped away from the source
+ area, and thus need extra updates (i.e. they are not
+ correctly copy from the scroll operation, since there was
+ no information about them in the source).
+
+ @param rBounds
+ Bounds to clip against.
+
+ @return false, if the resulting scroll area is empty
+ */
+ CANVASTOOLS_DLLPUBLIC bool clipScrollArea( ::basegfx::B2IRange& io_rSourceArea,
+ ::basegfx::B2IPoint& io_rDestPoint,
+ ::std::vector< ::basegfx::B2IRange >& o_ClippedAreas,
+ const ::basegfx::B2IRange& rBounds );
+
+ /** Clip a blit between two differently surfaces.
+
+ This method clips source and dest rect for a clip between
+ two differently clipped surfaces, such that the resulting
+ blit rects are fully within both clip areas.
+
+ @param io_rSourceArea
+ Source area of the blit. Returned therein is the computed
+ clipped source area.
+
+ @param io_rDestPoint
+ Dest area of the blit. Returned therein is the computed
+ clipped dest area.
+
+ @param rSourceBounds
+ Clip bounds of the source surface
+
+ @param rDestBounds
+ Clip bounds of the dest surface
+
+ @return false, if the resulting blit is empty, i.e. fully
+ clipped away.
+ */
+ CANVASTOOLS_DLLPUBLIC ::basegfx::B2IRange spritePixelAreaFromB2DRange( const ::basegfx::B2DRange& rRange );
+
+ /** Retrieve various internal properties of the actual canvas implementation.
+
+ This method retrieves a bunch of internal, implementation-
+ and platform-dependent values from the canvas
+ implementation. Among them are for example operating
+ system window handles. The actual layout and content of
+ the returned sequence is dependent on the component
+ implementation, undocumented and subject to change.
+
+ @param i_rxCanvas
+ Input parameter, the canvas representation for which the device information
+ is to be retrieveds
+
+ @param o_rxParams
+ Output parameter, the sequence of Anys that hold the device parameters. Layout is as described above
+
+ @return A reference to the resulting sequence of parameters
+ */
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& getDeviceInfo(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas >& i_rxCanvas,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& o_rxParams );
+
+ /** Return a color space for a default RGBA integer format
+
+ Use this method for dead-simple bitmap implementations,
+ that map all their formats to 8888 RGBA color.
+ */
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XIntegerBitmapColorSpace> getStdColorSpace();
+
+ /** Return a color space for a default RGB integer format
+
+ Use this method for dead-simple bitmap implementations,
+ that map all their formats to 8888 RGB color (the last byte
+ is unused).
+ */
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XIntegerBitmapColorSpace> getStdColorSpaceWithoutAlpha();
+
+ /** Return a memory layout for a default RGBA integer format
+
+ Use this method for dead-simple bitmap implementations,
+ that map all their formats to 8888 RGBA color.
+ */
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::rendering::IntegerBitmapLayout getStdMemoryLayout(
+ const ::com::sun::star::geometry::IntegerSize2D& rBitmapSize );
+
+ /// Convert standard 8888 RGBA color to vcl color
+ CANVASTOOLS_DLLPUBLIC ::Color stdIntSequenceToColor( const ::com::sun::star::uno::Sequence<sal_Int8>& rColor );
+
+ /// Convert standard 8888 RGBA color to vcl color
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::uno::Sequence<sal_Int8> colorToStdIntSequence( const ::Color& rColor );
+
+ // Modeled closely after boost::numeric_cast, only that we
+ // issue some trace output here and throw a RuntimeException
+
+ /** Cast numeric value into another (numeric) data type
+
+ Apart from converting the numeric value, this template
+ also checks if any overflow, underflow, or sign
+ information is lost (if yes, it throws an
+ uno::RuntimeException.
+ */
+ template< typename Target, typename Source > inline Target numeric_cast( Source arg )
+ {
+ // typedefs abbreviating respective trait classes
+ typedef ::std::numeric_limits< Source > SourceLimits;
+ typedef ::std::numeric_limits< Target > TargetLimits;
+
+#undef min
+#undef max
+
+ if( ( arg<0 && !TargetLimits::is_signed) || // loosing the sign here
+ ( SourceLimits::is_signed && arg<TargetLimits::min()) || // underflow will happen
+ ( arg>TargetLimits::max() ) ) // overflow will happen
+ {
+# if OSL_DEBUG_LEVEL > 2
+ OSL_TRACE("numeric_cast detected data loss");
+#endif
+ throw ::com::sun::star::uno::RuntimeException(
+ "numeric_cast detected data loss",
+ NULL );
+ }
+
+ return static_cast<Target>(arg);
+ }
+
+ CANVASTOOLS_DLLPUBLIC ::com::sun::star::awt::Rectangle getAbsoluteWindowRect(
+ const ::com::sun::star::awt::Rectangle& rRect,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow2 >& xWin );
+
+ /** Retrieve for small bound marks around each corner of the given rectangle
+ */
+ CANVASTOOLS_DLLPUBLIC ::basegfx::B2DPolyPolygon getBoundMarksPolyPolygon( const ::basegfx::B2DRange& rRange );
+
+ /** Calculate number of gradient "strips" to generate (takes
+ into account device resolution)
+
+ @param nColorSteps
+ Maximal integer difference between all color stops, needed
+ for smooth gradient color differences
+ */
+ CANVASTOOLS_DLLPUBLIC int calcGradientStepCount( ::basegfx::B2DHomMatrix& rTotalTransform,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ const ::com::sun::star::rendering::Texture& texture,
+ int nColorSteps );
+
+ /** A very simplistic map for ASCII strings and arbitrary value
+ types.
+
+ This class internally references a constant, static array of
+ sorted MapEntries, and performs a binary search to look up
+ values for a given query string. Note that this map is static,
+ i.e. not meant to be extented at runtime.
+
+ @tpl ValueType
+ The value type this map should store, associated with an ASCII
+ string.
+ */
+ template< typename ValueType > class ValueMap
+ {
+ public:
+ struct MapEntry
+ {
+ const char* maKey;
+ ValueType maValue;
+ };
+
+ /** Create a ValueMap for the given array of MapEntries.
+
+ @param pMap
+ Pointer to a <em>static</em> array of MapEntries. Must
+ live longer than this object! Make absolutely sure that
+ the string entries passed via pMap are ASCII-only -
+ everything else might not yield correct string
+ comparisons, and thus will result in undefined behaviour.
+
+ @param nEntries
+ Number of entries for pMap
+
+ @param bCaseSensitive
+ Whether the map query should be performed case sensitive
+ or not. When bCaseSensitive is false, all MapEntry strings
+ must be lowercase!
+ */
+ ValueMap( const MapEntry* pMap,
+ ::std::size_t nEntries,
+ bool bCaseSensitive ) :
+ mpMap( pMap ),
+ mnEntries( nEntries ),
+ mbCaseSensitive( bCaseSensitive )
+ {
+#ifdef DBG_UTIL
+ // Ensure that map entries are sorted (and all lowercase, if this
+ // map is case insensitive)
+ const OString aStr( pMap->maKey );
+ if( !mbCaseSensitive &&
+ aStr != aStr.toAsciiLowerCase() )
+ {
+ OSL_TRACE("ValueMap::ValueMap(): Key %s is not lowercase",
+ pMap->maKey);
+ OSL_FAIL( "ValueMap::ValueMap(): Key is not lowercase" );
+ }
+
+ if( mnEntries > 1 )
+ {
+ for( ::std::size_t i=0; i<mnEntries-1; ++i, ++pMap )
+ {
+ if( !mapComparator(pMap[0], pMap[1]) &&
+ mapComparator(pMap[1], pMap[0]) )
+ {
+ OSL_TRACE("ValueMap::ValueMap(): Map is not sorted, keys %s and %s are wrong",
+ pMap[0].maKey,
+ pMap[1].maKey);
+ OSL_FAIL( "ValueMap::ValueMap(): Map is not sorted" );
+ }
+
+ const OString aStr2( pMap[1].maKey );
+ if( !mbCaseSensitive &&
+ aStr2 != aStr2.toAsciiLowerCase() )
+ {
+ OSL_TRACE("ValueMap::ValueMap(): Key %s is not lowercase",
+ pMap[1].maKey);
+ OSL_FAIL( "ValueMap::ValueMap(): Key is not lowercase" );
+ }
+ }
+ }
+#endif
+ }
+
+ /** Lookup a value for the given query string
+
+ @param rName
+ The string to lookup. If the map was created with the case
+ insensitive flag, the lookup is performed
+ case-insensitive, otherwise, case-sensitive.
+
+ @param o_rResult
+ Output parameter, which receives the value associated with
+ the query string. If no value was found, the referenced
+ object is kept unmodified.
+
+ @return true, if a matching entry was found.
+ */
+ bool lookup( const OUString& rName,
+ ValueType& o_rResult ) const
+ {
+ // rName is required to contain only ASCII characters.
+ // TODO(Q1): Enforce this at upper layers
+ OString aKey( OUStringToOString( mbCaseSensitive ? rName : rName.toAsciiLowerCase(),
+ RTL_TEXTENCODING_ASCII_US ) );
+ MapEntry aSearchKey =
+ {
+ aKey.getStr(),
+ ValueType()
+ };
+
+ const MapEntry* pRes;
+ const MapEntry* pEnd = mpMap+mnEntries;
+ if( (pRes=::std::lower_bound( mpMap,
+ pEnd,
+ aSearchKey,
+ &mapComparator )) != pEnd )
+ {
+ // place to _insert before_ found - is it equal to
+ // the search key?
+ if( strcmp( pRes->maKey, aSearchKey.maKey ) == 0 )
+ {
+ // yep, correct entry found
+ o_rResult = pRes->maValue;
+ return true;
+ }
+ }
+
+ // not found
+ return false;
+ }
+
+ private:
+ static bool mapComparator( const MapEntry& rLHS,
+ const MapEntry& rRHS )
+ {
+ return strcmp( rLHS.maKey,
+ rRHS.maKey ) < 0;
+ }
+
+ const MapEntry* mpMap;
+ ::std::size_t mnEntries;
+ bool mbCaseSensitive;
+ };
+ }
+}
+
+#endif /* INCLUDED_CANVAS_CANVASTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/canvastoolsdllapi.h b/include/canvas/canvastoolsdllapi.h
new file mode 100644
index 000000000000..ad96dec3ea7c
--- /dev/null
+++ b/include/canvas/canvastoolsdllapi.h
@@ -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 _CANVAS_DLLAPI_H
+#define _CANVAS_DLLAPI_H
+
+#include "sal/config.h"
+#include "sal/types.h"
+
+#if defined(CANVASTOOLS_DLLIMPLEMENTATION)
+#define CANVASTOOLS_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define CANVASTOOLS_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define CANVASTOOLS_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/debug.hxx b/include/canvas/debug.hxx
new file mode 100644
index 000000000000..9fc5ad31711f
--- /dev/null
+++ b/include/canvas/debug.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_CANVAS_DEBUG_HXX
+#define INCLUDED_CANVAS_DEBUG_HXX
+
+// shared_ptr debugging
+// --------------------
+
+#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
+
+# include <sal/config.h>
+# include <boost/shared_ptr.hpp>
+
+::std::size_t find_unreachable_objects( bool );
+
+# if OSL_DEBUG_LEVEL > 2
+# include <osl/diagnose.h>
+# define SHARED_PTR_LEFTOVERS(a) OSL_TRACE("%s\n%s: Unreachable objects still use %d bytes\n", \
+ BOOST_CURRENT_FUNCTION, a, \
+ find_unreachable_objects(true) )
+# else
+/** This macro shows how much memory is still used by shared_ptrs
+
+ Use this macro at places in the code where normally all shared_ptr
+ objects should have been deleted. You'll get the number of bytes
+ still contained in those objects, which quite possibly are prevented
+ from deletion by circular references.
+ */
+# define SHARED_PTR_LEFTOVERS(a) OSL_TRACE("%s\n%s: Unreachable objects still use %d bytes\n", \
+ BOOST_CURRENT_FUNCTION, a, \
+ find_unreachable_objects(false) )
+# endif
+
+#else
+
+# define SHARED_PTR_LEFTOVERS(a) ((void)0)
+
+#endif
+
+#endif // ! defined(INCLUDED_CANVAS_DEBUG_HXX)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/elapsedtime.hxx b/include/canvas/elapsedtime.hxx
new file mode 100644
index 000000000000..8248e3408785
--- /dev/null
+++ b/include/canvas/elapsedtime.hxx
@@ -0,0 +1,173 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_ELAPSEDTIME_HXX
+#define INCLUDED_CANVAS_ELAPSEDTIME_HXX
+
+#include <sal/types.h>
+
+#include "boost/shared_ptr.hpp"
+#include <canvas/canvastoolsdllapi.h>
+
+namespace canvas
+{
+ namespace tools
+ {
+ /** Calculate elapsed time.
+
+ This class provides several time-measurement and
+ -management functions. In its simplest use-case, it
+ measures the time from its creation.
+ */
+ class CANVASTOOLS_DLLPUBLIC ElapsedTime
+ {
+ public:
+ /** Create a new ElapsedTime object
+
+ The moment of construction starts the time
+ measurement. That means, a subsequent getElapsedTime()
+ call will return the time difference between object
+ creation and getElapsedTime() call.
+ */
+ ElapsedTime();
+
+ /** Creates a new ElapsedTime object based on another
+ timer.
+
+ The moment of construction starts the time
+ measurement. That means, a subsequent getElapsedTime()
+ call will return the time difference between object
+ creation and getElapsedTime() call. All time values
+ are not taken from the system's time base, but from
+ the provided timer.
+ */
+ ElapsedTime( ::boost::shared_ptr<ElapsedTime> const & pTimeBase );
+
+ /** Reset the time
+
+ The instance of the reset() call starts the time
+ measurement from scratch. That means, a subsequent
+ getElapsedTime() call will return the time difference
+ between reset() and getElapsedTime() call.
+ */
+ void reset();
+
+ /** Query the elapsed time
+
+ This method returns the elapsed time in seconds
+ between either the construction of this object, or the
+ last reset() call, if any (but see the time modulation
+ methods below, for means to modify the otherwise
+ continuous flow of time).
+
+ @return the elapsed time in seconds.
+ */
+ double getElapsedTime() const;
+
+ /** Pauses the running timer.
+
+ This method stops the time, as returned by this
+ object, until continueTimer() is called. During this
+ period, getElapsedTime() will always return the same
+ time value (i.e. the instant when pauseTimer() was
+ called).
+ */
+ void pauseTimer();
+
+ /** Continues the paused timer.
+
+ This method re-enables the time flow, that is, time
+ starts running again for clients calling
+ getElapsedTime(). The (subtle) difference to the
+ holdTimer/releaseTimer() methods below is, that there
+ is no perceived time 'jump' between the pauseTimer()
+ call and the continueTimer() call, i.e. the time
+ starts over with the same value it has stopped on
+ pauseTimer().
+ */
+ void continueTimer();
+
+ /** Adjusts the timer, hold and pause times.
+
+ This method modifies the time as returned by this
+ object by the specified amount. This affects the time
+ as returned by getElapsedTime(), regardless of the
+ mode (e.g. paused, or on hold).
+
+ @param fOffset
+ This value will be added to the current time, i.e. the
+ next call to getElapsedTime() (when performed
+ immediately) will be adjusted by fOffset.
+
+ @param bLimitToLastQueriedTime
+ Limits the given offset to the time that has been
+ taken via getElapsedTime()
+ */
+ void adjustTimer( double fOffset,
+ bool bLimitToLastQueriedTime = true );
+
+ /** Holds the current time.
+
+ This call makes the timer hold the current time
+ (e.g. getElapsedTime() will return the time when
+ holdTimer() was called), while the underlying time is
+ running on. When releaseTimer() is called, the time
+ will 'jump' to the then-current, underlying time. This
+ is equivalent to pressing the "interim time" button on
+ a stop watch, which shows this stopped time, while the
+ clock keeps running internally.
+ */
+ void holdTimer();
+
+ /** Releases a held timer.
+
+ After this call, the timer again returns the running
+ time on getElapsedTime().
+ */
+ void releaseTimer();
+
+ private:
+ static double getSystemTime();
+ double getCurrentTime() const;
+ double getElapsedTimeImpl() const; // does not set m_fLastQueriedTime
+
+ const ::boost::shared_ptr<ElapsedTime> m_pTimeBase;
+
+ /// To validate adjustTimer() calls with bLimitToLastQueriedTime=true
+ mutable double m_fLastQueriedTime;
+
+ /// Start time, from which the difference to the time base is returned
+ double m_fStartTime;
+
+ /// Instant, when last pause or hold started, relative to m_fStartTime
+ double m_fFrozenTime;
+
+ /// True, when in pause mode
+ bool m_bInPauseMode;
+
+ /// True, when in hold mode
+ bool m_bInHoldMode;
+ };
+
+ }
+}
+
+#endif /* INCLUDED_CANVAS_ELAPSEDTIME_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/parametricpolypolygon.hxx b/include/canvas/parametricpolypolygon.hxx
new file mode 100644
index 000000000000..2e8cb7af45fb
--- /dev/null
+++ b/include/canvas/parametricpolypolygon.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_CANVAS_PARAMETRICPOLYPOLYGON_HXX
+#define INCLUDED_CANVAS_PARAMETRICPOLYPOLYGON_HXX
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/rendering/XGraphicDevice.hpp>
+#include <com/sun/star/rendering/XParametricPolyPolygon2D.hpp>
+#include <cppuhelper/compbase2.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+
+#include <boost/utility.hpp>
+#include <canvas/canvastoolsdllapi.h>
+
+namespace basegfx
+{
+ class B2DPolygon;
+ class B2DHomMatrix;
+}
+
+
+/* Definition of ParametricPolyPolygon class */
+
+namespace canvas
+{
+ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XParametricPolyPolygon2D,
+ ::com::sun::star::lang::XServiceInfo > ParametricPolyPolygon_Base;
+
+ class CANVASTOOLS_DLLPUBLIC ParametricPolyPolygon : public ::comphelper::OBaseMutex,
+ public ParametricPolyPolygon_Base,
+ private ::boost::noncopyable
+ {
+ public:
+ enum GradientType
+ {
+ GRADIENT_LINEAR,
+ GRADIENT_ELLIPTICAL,
+ GRADIENT_RECTANGULAR
+ };
+
+ /** Structure of defining values for the ParametricPolyPolygon
+
+ This is used to copy the state of the
+ ParametricPolyPolygon atomically.
+ */
+ struct Values
+ {
+ Values( const ::basegfx::B2DPolygon& rGradientPoly,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& rColors,
+ const ::com::sun::star::uno::Sequence< double >& rStops,
+ double nAspectRatio,
+ GradientType eType ) :
+ maGradientPoly( rGradientPoly ),
+ mnAspectRatio( nAspectRatio ),
+ maColors( rColors ),
+ maStops( rStops ),
+ meType( eType )
+ {
+ }
+
+ /// Polygonal gradient shape (ignored for linear and axial gradient)
+ const ::basegfx::B2DPolygon maGradientPoly;
+
+ /// Aspect ratio of gradient, affects scaling of innermost gradient polygon
+ const double mnAspectRatio;
+
+ /// Gradient colors
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > maColors;
+
+ /// Gradient color stops
+ const ::com::sun::star::uno::Sequence< double > maStops;
+
+ /// Type of gradient to render (as e.g. linear grads are not represented by maGradientPoly)
+ const GradientType meType;
+ };
+
+ static ::com::sun::star::uno::Sequence< OUString > getAvailableServiceNames();
+ static ParametricPolyPolygon* create(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
+ const OUString& rServiceName,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rArgs );
+
+ /// Dispose all internal references
+ virtual void SAL_CALL disposing();
+
+ // XParametricPolyPolygon2D
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > SAL_CALL getOutline( double t ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< double > SAL_CALL getColor( double t ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< double > SAL_CALL getPointColor( const ::com::sun::star::geometry::RealPoint2D& point ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XColorSpace > SAL_CALL getColorSpace() throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
+ /// Query all defining values of this object atomically
+ Values getValues() const;
+
+ protected:
+ ~ParametricPolyPolygon(); // we're a ref-counted UNO class. _We_ destroy ourselves.
+
+ private:
+ static ParametricPolyPolygon* createLinearHorizontalGradient( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice >& rDevice,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& colors,
+ const ::com::sun::star::uno::Sequence< double >& stops );
+ static ParametricPolyPolygon* createEllipticalGradient( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice >& rDevice,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& colors,
+ const ::com::sun::star::uno::Sequence< double >& stops,
+ double fAspect );
+ static ParametricPolyPolygon* createRectangularGradient( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice >& rDevice,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& colors,
+ const ::com::sun::star::uno::Sequence< double >& stops,
+ double fAspect );
+
+ /// Private, because objects can only be created from the static factories
+ ParametricPolyPolygon( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice >& rDevice,
+ const ::basegfx::B2DPolygon& rGradientPoly,
+ GradientType eType,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& colors,
+ const ::com::sun::star::uno::Sequence< double >& stops,
+ double nAspectRatio );
+ ParametricPolyPolygon( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice >& rDevice,
+ GradientType eType,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& colors,
+ const ::com::sun::star::uno::Sequence< double >& stops );
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice > mxDevice;
+
+ /// All defining values of this object
+ const Values maValues;
+ };
+}
+
+#endif /* INCLUDED_CANVAS_PARAMETRICPOLYPOLYGON_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/propertysethelper.hxx b/include/canvas/propertysethelper.hxx
new file mode 100644
index 000000000000..b90d9ef344e5
--- /dev/null
+++ b/include/canvas/propertysethelper.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_CANVAS_PROPERTYSETHELPER_HXX
+#define INCLUDED_CANVAS_PROPERTYSETHELPER_HXX
+
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <canvas/canvastools.hxx>
+
+#include <boost/function.hpp>
+#include <vector>
+#include <memory>
+
+#include <canvas/canvastoolsdllapi.h>
+
+namespace canvas
+{
+ /** Really simplistic XPropertySet helper for properties.
+
+ This class provides easy access to properties, referenced via
+ ASCII strings. The name/property modification callbacks pairs
+ are passed into this class via a vector. Each time a property
+ is set or queried, the corresponding getter or setter callback
+ is called.
+
+ Use this class as a delegate for the corresponding
+ XPropertySet methods, and take care of UNO XInterface and lock
+ handling by yourself.
+
+ The core responsibility of this this class is the name/value
+ mapping for property sets.
+ */
+ class CANVASTOOLS_DLLPUBLIC PropertySetHelper
+ {
+ public:
+ typedef boost::function0< ::com::sun::star::uno::Any > GetterType;
+ typedef boost::function1<void, const ::com::sun::star::uno::Any&> SetterType;
+ struct Callbacks
+ {
+ GetterType getter;
+ SetterType setter;
+ };
+ typedef tools::ValueMap< Callbacks > MapType;
+ typedef std::vector< MapType::MapEntry > InputMap;
+
+ class MakeMap : public InputMap
+ {
+ public:
+ MakeMap(const char* name,
+ const GetterType& getter,
+ const SetterType& setter)
+ {
+ MapType::MapEntry aEntry={name, {getter, setter}};
+ this->push_back(aEntry);
+ }
+ MakeMap(const char* name,
+ const GetterType& getter)
+ {
+ MapType::MapEntry aEntry={name, {getter, SetterType()}};
+ this->push_back(aEntry);
+ }
+ MakeMap& operator()(const char* name,
+ const GetterType& getter,
+ const SetterType& setter)
+ {
+ MapType::MapEntry aEntry={name, {getter, setter}};
+ this->push_back(aEntry);
+ return *this;
+ }
+ MakeMap& operator()(const char* name,
+ const GetterType& getter)
+ {
+ MapType::MapEntry aEntry={name, {getter, SetterType()}};
+ this->push_back(aEntry);
+ return *this;
+ }
+ };
+
+ /** Create helper with zero properties
+ */
+ PropertySetHelper();
+
+ /** Init helper with new name/value map
+
+ @param rMap
+ Vector of name/function pointers. Each name is offered as
+ a property, and reading/writing to this property is passed
+ on to the given function pointer.
+ */
+ void initProperties( const InputMap& rMap );
+
+ /** Add given properties to helper
+
+ @param rMap
+ Vector of name/function pointers. Each name is offered as
+ a property, and reading/writing to this property is passed
+ on to the given function pointer. These name/function
+ pairs are added to the already existing ones.
+ */
+ void addProperties( const InputMap& rMap );
+
+ /** Checks whether the given string corresponds to a valid
+ property name.
+
+ @return true, if the given name maps to a known property.
+ */
+ bool isPropertyName( const OUString& aPropertyName ) const;
+
+ /** Request the currently active map
+ */
+ const InputMap& getPropertyMap() const { return maMapEntries; }
+
+ // XPropertySet implementation
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > getPropertySetInfo() const;
+ void setPropertyValue( const OUString& aPropertyName,
+ const ::com::sun::star::uno::Any& aValue );
+ ::com::sun::star::uno::Any getPropertyValue( const OUString& PropertyName ) const;
+ void addPropertyChangeListener( const OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener );
+ void removePropertyChangeListener( const OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener );
+ void addVetoableChangeListener( const OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& xListener );
+ void removeVetoableChangeListener( const OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& xListener );
+
+ private:
+ std::auto_ptr<MapType> mpMap;
+ InputMap maMapEntries;
+ };
+}
+
+#endif /* INCLUDED_CANVAS_PROPERTYSETHELPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/rendering/bitmap.hxx b/include/canvas/rendering/bitmap.hxx
new file mode 100644
index 000000000000..295057bd832b
--- /dev/null
+++ b/include/canvas/rendering/bitmap.hxx
@@ -0,0 +1,314 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_BITMAP_HXX
+#define INCLUDED_CANVAS_BITMAP_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/rendering/IntegerBitmapLayout.hpp>
+#include <com/sun/star/geometry/IntegerRectangle2D.hpp>
+#include <com/sun/star/geometry/IntegerPoint2D.hpp>
+#include <canvas/rendering/icolorbuffer.hxx>
+#include <canvas/rendering/icachedprimitive.hxx>
+#include <canvas/rendering/isurfaceproxymanager.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <vector>
+
+namespace basegfx
+{
+ class B2IVector;
+ class B2DPoint;
+ class B2DHomMatrix;
+ class B2DPolyPolygon;
+}
+
+namespace canvas
+{
+ class ImplBitmap;
+
+ /** Bitmap class, with XCanvas-like render interface.
+
+ This class provides a bitmap, that can be rendered into,
+ with an interface compatible to XCanvas. Furthermore, the
+ bitmaps held here can optionally be backed by (possibly
+ hw-accelerated) textures.
+ */
+ class Bitmap
+ {
+ public:
+ /** Create bitmap with given size
+
+ @param rSize
+ Size of the bitmap, in pixel
+
+ @param rMgr
+ SurfaceProxyManager, to use for HW acceleration
+
+ @param bWithAlpha
+ When true, the created bitmap will have an alpha channel,
+ false otherwise
+ */
+ Bitmap( const ::basegfx::B2IVector& rSize,
+ const ISurfaceProxyManagerSharedPtr& rMgr,
+ bool bWithAlpha );
+ ~Bitmap();
+
+ /// Query whether this bitmap contains alpha channel information
+ bool hasAlpha() const;
+
+ /// Query size of the bitmap in pixel
+ ::basegfx::B2IVector getSize() const;
+
+ ::com::sun::star::uno::Sequence< sal_Int8 > getData(
+ ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
+ const ::com::sun::star::geometry::IntegerRectangle2D& rect );
+
+ void setData(
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& data,
+ const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
+ const ::com::sun::star::geometry::IntegerRectangle2D& rect );
+
+ void setPixel(
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& color,
+ const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
+ const ::com::sun::star::geometry::IntegerPoint2D& pos );
+
+ ::com::sun::star::uno::Sequence< sal_Int8 > getPixel(
+ ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
+ const ::com::sun::star::geometry::IntegerPoint2D& pos );
+
+ /** Render the bitmap content to associated
+ SurfaceProxyManager's screen.
+
+ @param fAlpha
+ Overall alpha for content
+
+ @param rPos
+ Output position
+
+ @param rTransform
+ Output transformation (does not affect output position)
+ */
+ bool draw( double fAlpha,
+ const ::basegfx::B2DPoint& rPos,
+ const ::basegfx::B2DHomMatrix& rTransform );
+
+ /** Render the bitmap content to associated
+ SurfaceProxyManager's screen.
+
+ @param fAlpha
+ Overall alpha for content
+
+ @param rPos
+ Output position
+
+ @param rArea
+ Subset of the surface to render. Coordinate system are
+ surface area pixel, given area will be clipped to the
+ surface bounds.
+
+ @param rTransform
+ Output transformation (does not affect output position)
+ */
+ bool draw( double fAlpha,
+ const ::basegfx::B2DPoint& rPos,
+ const ::basegfx::B2DRange& rArea,
+ const ::basegfx::B2DHomMatrix& rTransform );
+
+ /** Render the bitmap content to associated
+ SurfaceProxyManager's screen.
+
+ @param fAlpha
+ Overall alpha for content
+
+ @param rPos
+ Output position
+
+ @param rClipPoly
+ Clip polygon for the surface. The clip polygon is also
+ subject to the output transformation.
+
+ @param rTransform
+ Output transformation (does not affect output position)
+ */
+ bool draw( double fAlpha,
+ const ::basegfx::B2DPoint& rPos,
+ const ::basegfx::B2DPolyPolygon& rClipPoly,
+ const ::basegfx::B2DHomMatrix& rTransform );
+
+ /** Clear whole bitmap with given color.
+
+ This method sets every single pixel of the bitmap to the
+ specified color value.
+ */
+ void clear( const ::com::sun::star::uno::Sequence< double >& color );
+
+ void fillB2DPolyPolygon(
+ const ::basegfx::B2DPolyPolygon& rPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+
+
+ // High-level drawing operations (from the XCanvas interface)
+ // ==========================================================
+
+ /// See XCanvas interface
+ void drawPoint( const ::com::sun::star::geometry::RealPoint2D& aPoint,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+ /// See XCanvas interface
+ void drawLine( const ::com::sun::star::geometry::RealPoint2D& aStartPoint,
+ const ::com::sun::star::geometry::RealPoint2D& aEndPoint,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+ /// See XCanvas interface
+ void drawBezier( const ::com::sun::star::geometry::RealBezierSegment2D& aBezierSegment,
+ const ::com::sun::star::geometry::RealPoint2D& aEndPoint,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+ /// See XCanvas interface
+ ICachedPrimitiveSharedPtr drawPolyPolygon(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+
+ /// See XCanvas interface
+ ICachedPrimitiveSharedPtr strokePolyPolygon(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes );
+ /** See XCanvas interface
+
+ @param textureAnnotations
+ Vector of shared pointers to bitmap textures,
+ <em>corresponding</em> in indices to the textures
+ sequence. This is to decouple this interface from the
+ client's XBitmap-implementation class.
+ */
+ ICachedPrimitiveSharedPtr strokeTexturedPolyPolygon(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::rendering::Texture >& textures,
+ const ::std::vector< ::boost::shared_ptr<Bitmap> >& textureAnnotations,
+ const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes );
+ /** See XCanvas interface
+
+ @param textureAnnotations
+ Vector of shared pointers to bitmap textures,
+ <em>corresponding</em> in indices to the textures
+ sequence. This is to decouple this interface from the
+ client's XBitmap-implementation class.
+ */
+ ICachedPrimitiveSharedPtr strokeTextureMappedPolyPolygon(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::rendering::Texture >& textures,
+ const ::std::vector< ::boost::shared_ptr<Bitmap> >& textureAnnotations,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::geometry::XMapping2D >& xMapping,
+ const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes );
+ /// See XCanvas interface
+ ICachedPrimitiveSharedPtr fillPolyPolygon(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+ /** See XCanvas interface
+
+ @param textureAnnotations
+ Vector of shared pointers to bitmap textures,
+ <em>corresponding</em> in indices to the textures
+ sequence. This is to decouple this interface from the
+ client's XBitmap-implementation class.
+ */
+ ICachedPrimitiveSharedPtr fillTexturedPolyPolygon(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::rendering::Texture >& textures,
+ const ::std::vector< ::boost::shared_ptr<Bitmap> >& textureAnnotations );
+ /** See XCanvas interface
+
+ @param textureAnnotations
+ Vector of shared pointers to bitmap textures,
+ <em>corresponding</em> in indices to the textures
+ sequence. This is to decouple this interface from the
+ client's XBitmap-implementation class.
+ */
+ ICachedPrimitiveSharedPtr fillTextureMappedPolyPolygon(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::rendering::Texture >& textures,
+ const ::std::vector< ::boost::shared_ptr<Bitmap> >& textureAnnotations,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::geometry::XMapping2D >& xMapping );
+
+ /// See XCanvas interface
+ ICachedPrimitiveSharedPtr drawBitmap(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XBitmap >& xBitmap,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+ /// See XCanvas interface
+ ICachedPrimitiveSharedPtr drawBitmap(
+ const ::boost::shared_ptr<Bitmap>& rImage,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+
+ /// See XCanvas interface
+ ICachedPrimitiveSharedPtr drawBitmapModulated(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XBitmap >& xBitmap,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+ /// See XCanvas interface
+ ICachedPrimitiveSharedPtr drawBitmapModulated(
+ const ::boost::shared_ptr<Bitmap>& rImage,
+ const ::com::sun::star::rendering::ViewState& viewState,
+ const ::com::sun::star::rendering::RenderState& renderState );
+
+ private:
+ friend class ImplBitmap;
+
+ const ::boost::scoped_ptr< ImplBitmap > mpImpl;
+ };
+
+ typedef ::boost::shared_ptr< Bitmap > BitmapSharedPtr;
+}
+
+#endif /* INCLUDED_CANVAS_BITMAP_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/rendering/icachedprimitive.hxx b/include/canvas/rendering/icachedprimitive.hxx
new file mode 100644
index 000000000000..f15fed3e72e8
--- /dev/null
+++ b/include/canvas/rendering/icachedprimitive.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_CANVAS_ICACHEDPRIMITIVE_HXX
+#define INCLUDED_CANVAS_ICACHEDPRIMITIVE_HXX
+
+#include <sal/types.h>
+
+#include <boost/shared_ptr.hpp>
+
+
+namespace basegfx
+{
+ class B2IRange;
+ class B2IPoint;
+}
+
+namespace canvas
+{
+ /** Objects with this interface are returned from every Bitmap
+ render operation.
+
+ These objects can be used to implement the
+ rendering::XCachedPrimitive interface, which in turn caches
+ render state and objects to facilitate quick redraws.
+ */
+ struct ICachedPrimitive
+ {
+ virtual ~ICachedPrimitive() {}
+
+ /** Redraw the primitive with the given view state
+
+ Note that the primitive will <em>always</em> be redrawn on
+ the bitmap it was created from.
+ */
+ virtual sal_Int8 redraw( const ::com::sun::star::rendering::ViewState& aState ) const = 0;
+ };
+
+ typedef ::boost::shared_ptr< ICachedPrimitive > ICachedPrimitiveSharedPtr;
+}
+
+#endif /* INCLUDED_CANVAS_ICACHEDPRIMITIVE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/rendering/icolorbuffer.hxx b/include/canvas/rendering/icolorbuffer.hxx
new file mode 100644
index 000000000000..4226a9a6d759
--- /dev/null
+++ b/include/canvas/rendering/icolorbuffer.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_ICOLORBUFFER_HXX
+#define INCLUDED_CANVAS_ICOLORBUFFER_HXX
+
+#include <sal/types.h>
+
+#include <boost/shared_ptr.hpp>
+
+
+namespace canvas
+{
+ /** Interface for a raw memory pixel container
+
+ Use this interface to represent a surface of raw pixel (e.g. a
+ bitmap) to the canvas rendering framework.
+ */
+ struct IColorBuffer
+ {
+ /// The underlying pixel format for this buffer
+ enum Format
+ {
+ // 24-bit RGB pixel format, 8 bits per channel.
+ FMT_R8G8B8,
+
+ // 32-bit ARGB pixel format with alpha, 8 bits per channel.
+ FMT_A8R8G8B8,
+
+ // 32-bit RGB pixel format, 8 bits per channel.
+ FMT_X8R8G8B8,
+
+ // for enum to 32bit
+ FMT_UNKNOWN = static_cast<sal_uInt32>(-1)
+ };
+
+ virtual ~IColorBuffer() {}
+
+ /** Get a pointer to the raw memory bits of the pixel
+ */
+ virtual sal_uInt8* lock() const = 0;
+
+ /** unlock previous locked buffer
+ */
+ virtual void unlock() const = 0;
+
+ /** Get width in pixel
+ */
+ virtual sal_uInt32 getWidth() const = 0;
+
+ /** Get height in pixel
+ */
+ virtual sal_uInt32 getHeight() const = 0;
+
+ /** Offset, in bytes, between consecutive scan lines of the bitmap.
+ If the stride is positive, the bitmap is top-down.
+ If the stride is negative, the bitmap is bottom-up.
+ The returned value is only valid while the buffer is locked.
+ */
+ virtual sal_uInt32 getStride() const = 0;
+
+ /** Get format of the color buffer
+ */
+ virtual Format getFormat() const = 0;
+ };
+
+ typedef ::boost::shared_ptr< IColorBuffer > IColorBufferSharedPtr;
+}
+
+#endif /* INCLUDED_CANVAS_ICOLORBUFFER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/rendering/irendermodule.hxx b/include/canvas/rendering/irendermodule.hxx
new file mode 100644
index 000000000000..413320eb85e9
--- /dev/null
+++ b/include/canvas/rendering/irendermodule.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_CANVAS_IRENDERMODULE_HXX
+#define INCLUDED_CANVAS_IRENDERMODULE_HXX
+
+#include <sal/types.h>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/utility.hpp>
+
+
+namespace basegfx
+{
+ class B2DRange;
+ class B2IRange;
+ class B2IVector;
+ class B2IPoint;
+}
+
+namespace canvas
+{
+ struct ISurface;
+
+ struct Vertex
+ {
+ float r,g,b,a;
+ float u,v;
+ float x,y,z;
+ };
+
+ /** Output module interface for backend render implementations.
+
+ Implement this interface for each operating system- or
+ library-specific rendering backend, which needs coupling with
+ the canvas rendering framework (which can be shared between
+ all backend implementations).
+ */
+ struct IRenderModule
+ {
+ /** Type of primitive passed to the render module via
+ pushVertex()
+ */
+ enum PrimitiveType
+ {
+ PRIMITIVE_TYPE_UNKNOWN,
+ PRIMITIVE_TYPE_TRIANGLE,
+ PRIMITIVE_TYPE_QUAD
+ };
+
+ virtual ~IRenderModule() {}
+
+ /// Lock rendermodule against concurrent access
+ virtual void lock() const = 0;
+
+ /// Unlock rendermodule for concurrent access
+ virtual void unlock() const = 0;
+
+ /** Maximal size of VRAM pages available
+
+ This is typically the maximum texture size of the
+ hardware, or some arbitrary limit if the backend is
+ software.
+ */
+ virtual ::basegfx::B2IVector getPageSize() = 0;
+
+ /** Create a (possibly hardware-accelerated) surface
+
+ @return a pointer to a surface, which is an abstraction of
+ a piece of (possibly hardware-accelerated) texture memory.
+ */
+ virtual ::boost::shared_ptr<ISurface> createSurface( const ::basegfx::B2IVector& surfaceSize ) = 0;
+
+ /** Begin rendering the given primitive.
+
+ Each beginPrimitive() call must be matched with an
+ endPrimitive() call.
+ */
+ virtual void beginPrimitive( PrimitiveType eType ) = 0;
+
+ /** Finish rendering a primitive.
+
+ Each beginPrimitive() call must be matched with an
+ endPrimitive() call.
+ */
+ virtual void endPrimitive() = 0;
+
+ /** Add given vertex to current primitive
+
+ After issuing a beginPrimitive(), each pushVertex() adds a
+ vertex to the active primitive.
+ */
+ virtual void pushVertex( const Vertex& vertex ) = 0;
+
+ /** Query error status
+
+ @returns true, if an error occurred during primitive
+ construction.
+ */
+ virtual bool isError() = 0;
+ };
+
+ typedef ::boost::shared_ptr< IRenderModule > IRenderModuleSharedPtr;
+
+ /// Little RAII wrapper for guarding access to IRenderModule interface
+ class RenderModuleGuard : private ::boost::noncopyable
+ {
+ public:
+ explicit RenderModuleGuard( const IRenderModuleSharedPtr& rRenderModule ) :
+ mpRenderModule( rRenderModule )
+ {
+ mpRenderModule->lock();
+ }
+
+ ~RenderModuleGuard()
+ {
+ mpRenderModule->unlock();
+ }
+
+ private:
+ const IRenderModuleSharedPtr mpRenderModule;
+ };
+}
+
+#endif /* INCLUDED_CANVAS_IRENDERMODULE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/rendering/isurface.hxx b/include/canvas/rendering/isurface.hxx
new file mode 100644
index 000000000000..a79faf96a8c8
--- /dev/null
+++ b/include/canvas/rendering/isurface.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_CANVAS_ISURFACE_HXX
+#define INCLUDED_CANVAS_ISURFACE_HXX
+
+#include <sal/types.h>
+
+#include <boost/shared_ptr.hpp>
+
+
+namespace basegfx
+{
+ class B2IRange;
+ class B2IPoint;
+ class B2IVector;
+}
+
+namespace canvas
+{
+ struct IColorBuffer;
+
+ struct ISurface
+ {
+ virtual ~ISurface() {}
+
+ /** Select texture behind this interface to be the current one
+ for primitive output.
+ */
+ virtual bool selectTexture() = 0;
+
+ /** Tells whether the surface is valid or not
+ */
+ virtual bool isValid() = 0;
+
+ /** Update surface content from given IColorBuffer
+
+ This method updates the given subarea of the surface from
+ the given color buffer bits.
+
+ @param rDestPos
+ Position in the surface, where the subset update should
+ have its left, top edge
+
+ @param rSourceRect
+ Size and position of the rectangular subset update in the
+ source color buffer
+
+ @param rSource
+ Source bits to use for the update
+
+ @return true, if the update was successful
+ */
+ virtual bool update( const ::basegfx::B2IPoint& rDestPos,
+ const ::basegfx::B2IRange& rSourceRect,
+ IColorBuffer& rSource ) = 0;
+
+ virtual ::basegfx::B2IVector getSize() = 0;
+ };
+
+ typedef ::boost::shared_ptr< ISurface > ISurfaceSharedPtr;
+}
+
+#endif /* INCLUDED_CANVAS_ISURFACE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/rendering/isurfaceproxy.hxx b/include/canvas/rendering/isurfaceproxy.hxx
new file mode 100644
index 000000000000..f8db605a38d3
--- /dev/null
+++ b/include/canvas/rendering/isurfaceproxy.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_CANVAS_ISURFACEPROXY_HXX
+#define INCLUDED_CANVAS_ISURFACEPROXY_HXX
+
+#include <canvas/rendering/irendermodule.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+namespace basegfx
+{
+ class B2DRange;
+ class B2DPoint;
+ class B2DPolyPolygon;
+ class B2DHomMatrix;
+}
+
+namespace canvas
+{
+ struct ISurfaceProxy
+ {
+ virtual ~ISurfaceProxy() {}
+
+ /** Notify the proxy that the color buffer has changed
+ */
+ virtual void setColorBufferDirty() = 0;
+
+ /** Render the surface content to screen.
+
+ @param fAlpha
+ Overall alpha for content
+
+ @param rPos
+ Output position
+
+ @param rTransform
+ Output transformation (does not affect output position)
+ */
+ virtual bool draw( double fAlpha,
+ const ::basegfx::B2DPoint& rPos,
+ const ::basegfx::B2DHomMatrix& rTransform ) = 0;
+
+ /** Render the surface content to screen.
+
+ @param fAlpha
+ Overall alpha for content
+
+ @param rPos
+ Output position
+
+ @param rArea
+ Subset of the surface to render. Coordinate system are
+ surface area pixel, given area will be clipped to the
+ surface bounds.
+
+ @param rTransform
+ Output transformation (does not affect output position)
+ */
+ virtual bool draw( double fAlpha,
+ const ::basegfx::B2DPoint& rPos,
+ const ::basegfx::B2DRange& rArea,
+ const ::basegfx::B2DHomMatrix& rTransform ) = 0;
+
+ /** Render the surface content to screen.
+
+ @param fAlpha
+ Overall alpha for content
+
+ @param rPos
+ Output position
+
+ @param rClipPoly
+ Clip polygon for the surface. The clip polygon is also
+ subject to the output transformation.
+
+ @param rTransform
+ Output transformation (does not affect output position)
+ */
+ virtual bool draw( double fAlpha,
+ const ::basegfx::B2DPoint& rPos,
+ const ::basegfx::B2DPolyPolygon& rClipPoly,
+ const ::basegfx::B2DHomMatrix& rTransform ) = 0;
+ };
+
+ typedef ::boost::shared_ptr< ISurfaceProxy > ISurfaceProxySharedPtr;
+}
+
+#endif /* INCLUDED_CANVAS_ISURFACEPROXY_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/rendering/isurfaceproxymanager.hxx b/include/canvas/rendering/isurfaceproxymanager.hxx
new file mode 100644
index 000000000000..98c7795a293e
--- /dev/null
+++ b/include/canvas/rendering/isurfaceproxymanager.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_CANVAS_ISURFACEPROXYMANAGER_HXX
+#define INCLUDED_CANVAS_ISURFACEPROXYMANAGER_HXX
+
+#include <canvas/rendering/irendermodule.hxx>
+#include <canvas/rendering/icolorbuffer.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+#include <canvas/canvastoolsdllapi.h>
+
+namespace canvas
+{
+ struct ISurfaceProxy;
+
+ /** Manager interface, which handles surface proxy objects.
+
+ Typically, each canvas instantiation has one
+ SurfaceProxyManager object, to handle their surfaces. Surfaces
+ itself are opaque objects, which encapsulate a framebuffer to
+ render upon, plus an optional (possibly accelerated) texture.
+ */
+ struct ISurfaceProxyManager
+ {
+ virtual ~ISurfaceProxyManager() {}
+
+ /** Create a surface proxy for a color buffer.
+
+ The whole idea is build around the concept that you create
+ some arbitrary buffer which contains the image data and
+ tell the texture manager about it. From there on you can
+ draw into this image using any kind of graphics api you
+ want. In the technical sense we allocate some space in
+ local videomemory or AGP memory which will be filled on
+ demand, which means if there exists any rendering
+ operation that needs to read from this memory location.
+ This method creates a logical hardware surface object
+ which uses the given color buffer as the image source.
+ Internally this texture may even be distributed to several
+ real hardware surfaces.
+ */
+ virtual ::boost::shared_ptr< ISurfaceProxy > createSurfaceProxy(
+ const IColorBufferSharedPtr& pBuffer ) const = 0;
+ };
+
+ typedef ::boost::shared_ptr< ISurfaceProxyManager > ISurfaceProxyManagerSharedPtr;
+
+
+ /** Create a surface proxy for the given render module.
+ */
+ CANVASTOOLS_DLLPUBLIC ISurfaceProxyManagerSharedPtr createSurfaceProxyManager( const IRenderModuleSharedPtr& rRenderModule );
+}
+
+#endif /* INCLUDED_CANVAS_ISURFACEPROXYMANAGER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/spriteredrawmanager.hxx b/include/canvas/spriteredrawmanager.hxx
new file mode 100644
index 000000000000..7609b4f8f4a6
--- /dev/null
+++ b/include/canvas/spriteredrawmanager.hxx
@@ -0,0 +1,429 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_SPRITEREDRAWMANAGER_HXX
+#define INCLUDED_CANVAS_SPRITEREDRAWMANAGER_HXX
+
+#include <basegfx/range/b2dconnectedranges.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/range/b2irange.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <canvas/base/spritesurface.hxx>
+
+#include <list>
+#include <vector>
+#include <algorithm>
+
+#include <boost/utility.hpp>
+#include <boost/bind.hpp>
+
+#include <canvas/canvastoolsdllapi.h>
+
+/* Definition of SpriteRedrawManager class */
+
+namespace canvas
+{
+ /** This class manages smooth SpriteCanvas updates
+
+ Use this class to handle the ::canvas::SpriteSurface methods,
+ that track and process sprite update events. Recorded update
+ events are later grouped by connected areas (i.e. all sprites
+ that somehow overlap over a rectangular area are grouped
+ together); the forEachSpriteArea() method calls the passed
+ functor for each of those connected areas.
+
+ Note that, although this class generally works with IEEE
+ doubles, the calculation of connected areas happens in the
+ integer domain - it is generally expected that repaints can
+ only be divided at pixel boundaries, without causing visible
+ artifacts. Therefore, sprites that touch the same pixel (but
+ don't necessarily have the same floating point coordinates
+ there) will reside in a common sprite area and handled
+ together in the forEachSpriteArea functor call.
+ */
+ class CANVASTOOLS_DLLPUBLIC SpriteRedrawManager : private ::boost::noncopyable
+ {
+ public:
+ /** Data container for the connected components list
+ */
+ class SpriteInfo
+ {
+ public:
+ ~SpriteInfo() {}
+
+ /** Create sprite info
+
+ @param rRef
+ Sprite this info represents (might be the NULL ref)
+
+ @param rTrueUpdateArea
+ True (un-rounded) update area this sprite has recorded
+
+ @param bNeedsUpdate
+ When false, this sprite is not a member of the change
+ record list. Thus, it only needs redraw if within the
+ update area of other, changed sprites.
+
+ @internal
+ */
+ SpriteInfo( const Sprite::Reference& rRef,
+ const ::basegfx::B2DRange& rTrueUpdateArea,
+ bool bNeedsUpdate ) :
+ mpSprite( rRef ),
+ maTrueUpdateArea( rTrueUpdateArea ),
+ mbNeedsUpdate( bNeedsUpdate ),
+ mbIsPureMove( false )
+ {
+ }
+
+ /** Create sprite info, specify move type
+
+ @param rRef
+ Sprite this info represents (might be the NULL ref)
+
+ @param rTrueUpdateArea
+ True (un-rounded) update area this sprite has recorded
+
+ @param bNeedsUpdate
+ When false, this sprite is not a member of the change
+ record list. Thus, it only needs redraw if within the
+ update area of other, changed sprites.
+
+ @param bIsPureMove
+ When true, this sprite is _only_ moved, no other
+ changes happened.
+
+ @internal
+ */
+ SpriteInfo( const Sprite::Reference& rRef,
+ const ::basegfx::B2DRange& rTrueUpdateArea,
+ bool bNeedsUpdate,
+ bool bIsPureMove ) :
+ mpSprite( rRef ),
+ maTrueUpdateArea( rTrueUpdateArea ),
+ mbNeedsUpdate( bNeedsUpdate ),
+ mbIsPureMove( bIsPureMove )
+ {
+ }
+
+ const Sprite::Reference& getSprite() const { return mpSprite; }
+
+ // #i61843# need to return by value here, to be used safely from bind
+ ::basegfx::B2DRange getUpdateArea() const { return maTrueUpdateArea; }
+ bool needsUpdate() const { return mbNeedsUpdate; }
+ bool isPureMove() const { return mbIsPureMove; }
+
+ private:
+ Sprite::Reference mpSprite;
+ ::basegfx::B2DRange maTrueUpdateArea;
+ bool mbNeedsUpdate;
+ bool mbIsPureMove;
+ };
+
+
+ /** Helper struct for SpriteTracer template
+
+ This struct stores change information to a sprite's visual
+ appearance (move, content updated, and the like).
+ */
+ struct SpriteChangeRecord
+ {
+ typedef enum{ none=0, move, update } ChangeType;
+
+ SpriteChangeRecord() :
+ meChangeType( none ),
+ mpAffectedSprite(),
+ maOldPos(),
+ maUpdateArea()
+ {
+ }
+
+ SpriteChangeRecord( const Sprite::Reference& rSprite,
+ const ::basegfx::B2DPoint& rOldPos,
+ const ::basegfx::B2DPoint& rNewPos,
+ const ::basegfx::B2DVector& rSpriteSize ) :
+ meChangeType( move ),
+ mpAffectedSprite( rSprite ),
+ maOldPos( rOldPos ),
+ maUpdateArea( rNewPos.getX(),
+ rNewPos.getY(),
+ rNewPos.getX() + rSpriteSize.getX(),
+ rNewPos.getY() + rSpriteSize.getY() )
+ {
+ }
+
+ SpriteChangeRecord( const Sprite::Reference& rSprite,
+ const ::basegfx::B2DPoint& rPos,
+ const ::basegfx::B2DRange& rUpdateArea ) :
+ meChangeType( update ),
+ mpAffectedSprite( rSprite ),
+ maOldPos( rPos ),
+ maUpdateArea( rUpdateArea )
+ {
+ }
+
+ Sprite::Reference getSprite() const { return mpAffectedSprite; }
+
+ ChangeType meChangeType;
+ Sprite::Reference mpAffectedSprite;
+ ::basegfx::B2DPoint maOldPos;
+ ::basegfx::B2DRange maUpdateArea;
+ };
+
+ typedef ::std::vector< SpriteChangeRecord > VectorOfChangeRecords;
+ typedef ::std::list< Sprite::Reference > ListOfSprites;
+ typedef ::basegfx::B2DConnectedRanges< SpriteInfo > SpriteConnectedRanges;
+ typedef SpriteConnectedRanges::ComponentType AreaComponent;
+ typedef SpriteConnectedRanges::ConnectedComponents UpdateArea;
+ typedef ::std::vector< Sprite::Reference > VectorOfSprites;
+
+ SpriteRedrawManager();
+
+ /** Must be called when user of this object gets
+ disposed. Frees all internal references.
+ */
+ void disposing();
+
+ /** Functor, to be used from forEachSpriteArea
+ */
+ template< typename Functor > struct AreaUpdateCaller
+ {
+ AreaUpdateCaller( Functor& rFunc,
+ const SpriteRedrawManager& rManager ) :
+ mrFunc( rFunc ),
+ mrManager( rManager )
+ {
+ }
+
+ void operator()( const UpdateArea& rUpdateArea )
+ {
+ mrManager.handleArea( mrFunc, rUpdateArea );
+ }
+
+ Functor& mrFunc;
+ const SpriteRedrawManager& mrManager;
+ };
+
+ /** Call given functor for each sprite area that needs an
+ update.
+
+ This method calls the given functor for each update area
+ (calculated from the sprite change records).
+
+ @tpl Functor
+ Must provide the following four methods:
+ <pre>
+ void backgroundPaint( ::basegfx::B2DRange aUpdateRect );
+ void scrollUpdate( ::basegfx::B2DRange& o_rMoveStart,
+ ::basegfx::B2DRange& o_rMoveEnd,
+ UpdateArea aUpdateArea );
+ void opaqueUpdate( const ::basegfx::B2DRange& rTotalArea,
+ const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites );
+ void genericUpdate( const ::basegfx::B2DRange& rTotalArea,
+ const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites );
+ </pre>
+ The backgroundPaint() method is called to simply repaint
+ background content, the scrollUpdate() method is used to
+ scroll a given area, and paint background in the uncovered
+ areas, the opaqueUpdate() method is called when a sprite
+ can be painted in the given area without taking background
+ content into account, and finally, genericUpdate() is
+ called for complex updates, where first the background and
+ then all sprites consecutively have to be repainted.
+ */
+ template< typename Functor > void forEachSpriteArea( Functor& rFunc ) const
+ {
+ SpriteConnectedRanges aUpdateAreas;
+
+ setupUpdateAreas( aUpdateAreas );
+
+ aUpdateAreas.forEachAggregate(
+ AreaUpdateCaller< Functor >( rFunc, *this ) );
+ }
+
+ /** Call given functor for each active sprite.
+
+ This method calls the given functor for each active
+ sprite, in the order of sprite priority.
+
+ @tpl Functor
+ Must provide a Functor::operator( Sprite::Reference& )
+ method.
+ */
+ template< typename Functor > void forEachSprite( const Functor& rFunc ) const
+ {
+ ::std::for_each( maSprites.begin(),
+ maSprites.end(),
+ rFunc );
+ }
+
+ /// Clear sprite change records (typically directly after a screen update)
+ void clearChangeRecords();
+
+ // SpriteSurface interface, is delegated to e.g. from SpriteCanvas
+ void showSprite( const Sprite::Reference& rSprite );
+ void hideSprite( const Sprite::Reference& rSprite );
+ void moveSprite( const Sprite::Reference& rSprite,
+ const ::basegfx::B2DPoint& rOldPos,
+ const ::basegfx::B2DPoint& rNewPos,
+ const ::basegfx::B2DVector& rSpriteSize );
+ void updateSprite( const Sprite::Reference& rSprite,
+ const ::basegfx::B2DPoint& rPos,
+ const ::basegfx::B2DRange& rUpdateArea );
+
+ /** Internal, handles each distinct component for forEachAggregate()
+
+ The reason why this must be public is that it needs to be
+ accessible from the AreaUpdateCaller functor.
+
+ @internal
+ */
+ template< typename Functor > void handleArea( Functor& rFunc,
+ const UpdateArea& rUpdateArea ) const
+ {
+ // check whether this area contains changed sprites at all
+ // (if not, just ignore it)
+ if( areSpritesChanged( rUpdateArea ) )
+ {
+ // at least one of the sprites actually needs an
+ // update - process whole area.
+
+ // check whether this area could be handled special
+ // (background paint, direct update, scroll, etc.)
+ ::basegfx::B2DRange aMoveStart;
+ ::basegfx::B2DRange aMoveEnd;
+ if( rUpdateArea.maComponentList.empty() )
+ {
+ rFunc.backgroundPaint( rUpdateArea.maTotalBounds );
+ }
+ else
+ {
+ // cache number of sprites in this area (it's a
+ // list, and both isAreaUpdateScroll() and
+ // isAreaUpdateOpaque() need it).
+ const ::std::size_t nNumSprites(
+ rUpdateArea.maComponentList.size() );
+
+ if( isAreaUpdateScroll( aMoveStart,
+ aMoveEnd,
+ rUpdateArea,
+ nNumSprites ) )
+ {
+ rFunc.scrollUpdate( aMoveStart,
+ aMoveEnd,
+ rUpdateArea );
+ }
+ else
+ {
+ // potentially, more than a single sprite
+ // involved. Have to sort component lists for
+ // sprite prio.
+ VectorOfSprites aSortedUpdateSprites;
+ SpriteConnectedRanges::ComponentListType::const_iterator aCurr(
+ rUpdateArea.maComponentList.begin() );
+ const SpriteConnectedRanges::ComponentListType::const_iterator aEnd(
+ rUpdateArea.maComponentList.end() );
+ while( aCurr != aEnd )
+ {
+ const Sprite::Reference& rSprite( aCurr->second.getSprite() );
+ if( rSprite.is() )
+ aSortedUpdateSprites.push_back( rSprite );
+
+ ++aCurr;
+ }
+
+ ::std::sort( aSortedUpdateSprites.begin(),
+ aSortedUpdateSprites.end(),
+ SpriteWeakOrder() );
+
+ if( isAreaUpdateOpaque( rUpdateArea,
+ nNumSprites ) )
+ {
+ rFunc.opaqueUpdate( rUpdateArea.maTotalBounds,
+ aSortedUpdateSprites );
+ }
+ else
+ {
+ rFunc.genericUpdate( rUpdateArea.maTotalBounds,
+ aSortedUpdateSprites );
+ }
+ }
+ }
+ }
+ }
+
+ private:
+ /** Central method of this class. Calculates the set of
+ disjunct components that need an update.
+ */
+ void setupUpdateAreas( SpriteConnectedRanges& rUpdateAreas ) const;
+
+ bool areSpritesChanged( const UpdateArea& rUpdateArea ) const;
+
+ bool isAreaUpdateNotOpaque( const ::basegfx::B2DRange& rUpdateRect,
+ const AreaComponent& rComponent ) const;
+
+ bool isAreaUpdateOpaque( const UpdateArea& rUpdateArea,
+ ::std::size_t nNumSprites ) const;
+
+ /** Check whether given update area can be handled by a simple
+ scroll
+
+ @param o_rMoveStart
+ Start rect of the move
+
+ @param o_rMoveEnd
+ End rect of the move. The content must be moved from start
+ to end rect
+
+ @param rUpdateArea
+ Area to check for scroll update optimization
+ */
+ bool isAreaUpdateScroll( ::basegfx::B2DRange& o_rMoveStart,
+ ::basegfx::B2DRange& o_rMoveEnd,
+ const UpdateArea& rUpdateArea,
+ ::std::size_t nNumSprites ) const;
+
+
+ ListOfSprites maSprites; // list of active
+ // sprite
+ // objects. this
+ // list is only
+ // used for full
+ // repaints,
+ // otherwise, we
+ // rely on the
+ // active sprites
+ // itself to notify
+ // us.
+
+ VectorOfChangeRecords maChangeRecords; // vector of
+ // sprites
+ // changes
+ // since last
+ // updateScreen()
+ // call
+ };
+}
+
+#endif /* INCLUDED_CANVAS_SPRITEREDRAWMANAGER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/vclwrapper.hxx b/include/canvas/vclwrapper.hxx
new file mode 100644
index 000000000000..330e88cb88ad
--- /dev/null
+++ b/include/canvas/vclwrapper.hxx
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_VCLWRAPPER_HXX
+#define INCLUDED_CANVAS_VCLWRAPPER_HXX
+
+#include <osl/mutex.hxx>
+#include <vcl/svapp.hxx>
+
+namespace canvas
+{
+ namespace vcltools
+ {
+ /** This helper template wraps VCL objects, and protects
+ object deletion with the Solar mutex. All other operations
+ are unprotected, this must be handled by client code.
+
+ The reason for this template is the fact that VCL objects
+ hold by value in uno::Reference-handled classes are
+ deleted without having the chance to get inbetween and
+ lock the solar mutex.
+
+ This template handles that problem transparently, the only
+ inconvenience is the fact that object member access now
+ has to be performed via operator->, since . is not
+ overloadable.
+
+ Otherwise, the template preserves the value semantics of
+ the wrapped object, that is, copy operations are performed
+ not by copying pointers, but by copying the underlying
+ object. This includes constness, i.e. on a const
+ VCLObject, only const methods of the wrapped object can be
+ called. Simply imagine this to be a value object of type
+ "template argument", with the only peculiarity that
+ member/method access is performed by operator-> instead of
+ the non-existing "operator.".
+ */
+ template< class _Wrappee > class VCLObject
+ {
+ public:
+ typedef _Wrappee Wrappee;
+
+ VCLObject() :
+ mpWrappee( new Wrappee() )
+ {
+ }
+
+ // no explicit here. VCLObjects should be freely
+ // constructible with Wrappees, and AFAIK there is no other
+ // implicit conversion path that could cause harm here
+ VCLObject( Wrappee* pWrappee ) :
+ mpWrappee( pWrappee )
+ {
+ }
+
+ // This object has value semantics, thus, forward copy
+ // to wrappee
+ VCLObject( const VCLObject& rOrig )
+ {
+ if( rOrig.mpWrappee )
+ mpWrappee = new Wrappee( *rOrig.mpWrappee );
+ else
+ mpWrappee = NULL;
+ }
+
+ // This object has value semantics, thus, forward copy
+ // to wrappee
+ VCLObject( const Wrappee& rOrig ) :
+ mpWrappee( new Wrappee( rOrig ) )
+ {
+ }
+
+ // This object has value semantics, thus, forward
+ // assignment to wrappee
+ VCLObject& operator=( const VCLObject& rhs )
+ {
+ if( mpWrappee )
+ {
+ if( rhs.mpWrappee )
+ *mpWrappee = *rhs.mpWrappee;
+ }
+ else
+ {
+ if( rhs.mpWrappee )
+ mpWrappee = new Wrappee( *rhs.mpWrappee );
+ }
+
+ return *this;
+ }
+
+ ~VCLObject()
+ {
+ // This here is the whole purpose of the template:
+ // protecting object deletion with the solar mutex
+ SolarMutexGuard aGuard;
+
+ if( mpWrappee )
+ delete mpWrappee;
+ }
+
+ Wrappee* operator->() { return mpWrappee; }
+ const Wrappee* operator->() const { return mpWrappee; }
+
+ Wrappee& operator*() { return *mpWrappee; }
+ const Wrappee& operator*() const { return *mpWrappee; }
+
+ Wrappee& get() { return *mpWrappee; }
+ const Wrappee& get() const { return *mpWrappee; }
+
+ void swap( VCLObject& rOther )
+ {
+ ::std::swap( mpWrappee, rOther.mpWrappee );
+ }
+
+ private:
+
+ Wrappee* mpWrappee;
+ };
+
+ }
+}
+
+#endif /* INCLUDED_CANVAS_VCLWRAPPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/verbosetrace.hxx b/include/canvas/verbosetrace.hxx
new file mode 100644
index 000000000000..d3810c4deaad
--- /dev/null
+++ b/include/canvas/verbosetrace.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_CANVAS_VERBOSETRACE_HXX
+#define INCLUDED_CANVAS_VERBOSETRACE_HXX
+
+#include "sal/config.h"
+
+#include "sal/detail/log.h"
+
+#define VERBOSE_TRACE(...) \
+ SAL_DETAIL_INFO_IF_FORMAT(true, "canvas.level2", __VA_ARGS__)
+
+#endif /* INCLUDED_CANVAS_VERBOSETRACE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/canvas/verifyinput.hxx b/include/canvas/verifyinput.hxx
new file mode 100644
index 000000000000..07d72b32ff6c
--- /dev/null
+++ b/include/canvas/verifyinput.hxx
@@ -0,0 +1,667 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CANVAS_VERIFYINPUT_HXX
+#define INCLUDED_CANVAS_VERIFYINPUT_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+
+#include <algorithm>
+#include <boost/bind.hpp>
+#include <boost/current_function.hpp>
+
+#include <canvas/canvastoolsdllapi.h>
+
+namespace com { namespace sun { namespace star { namespace geometry
+{
+ struct RealPoint2D;
+ struct RealSize2D;
+ struct RealBezierSegment2D;
+ struct RealRectangle2D;
+ struct AffineMatrix2D;
+ struct Matrix2D;
+ struct IntegerPoint2D;
+ struct IntegerSize2D;
+ struct IntegerRectangle2D;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace rendering
+{
+ struct RenderState;
+ struct StrokeAttributes;
+ struct Texture;
+ struct ViewState;
+ struct IntegerBitmapLayout;
+ struct FontRequest;
+ struct FontInfo;
+ class XCanvas;
+} } } }
+
+
+namespace canvas
+{
+ namespace tools
+ {
+
+ // Input checking facilities
+ // ===================================================================
+
+ // This header provides methods to check all common
+ // css::rendering::* method input parameters against
+ // compliance to the API specification.
+
+ /** Verify that the given transformation contains valid floating point
+ values.
+
+ @param rMatrix
+ Matrix to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::geometry::AffineMatrix2D& rMatrix,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos );
+
+ /** Verify that the given transformation contains valid floating point
+ values.
+
+ @param rMatrix
+ Matrix to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::geometry::Matrix2D& rMatrix,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos );
+
+ /** Verify that the given point contains valid floating point
+ values.
+
+ @param rPoint
+ Point to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::geometry::RealPoint2D& rPoint,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos );
+
+ /** Verify that the given bezier segment contains valid
+ floating point values.
+
+ @param rSegment
+ Segment to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::geometry::RealBezierSegment2D& rSegment,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos );
+
+ /** Verify that the given point contains valid floating point
+ values.
+
+ @param rPoint
+ Point to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::geometry::RealPoint2D& rPoint,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos );
+
+ /** Verify that the given rectangle contains valid floating
+ point values.
+
+ @param rRect
+ Rect to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::geometry::RealRectangle2D& rRect,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos );
+
+ /** Basic check for view state validity.
+
+ @param viewState
+ Viewstate to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::rendering::ViewState& viewState,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos );
+
+ /** Basic check for render state validity.
+
+ @param renderState
+ Renderstate to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @param nMinColorComponents
+ Minimal number of color components available in
+ RenderState::DeviceColor
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::rendering::RenderState& renderState,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos,
+ sal_Int32 nMinColorComponents=0 );
+
+ /** Basic check for stroke attributes validity.
+
+ @param strokeAttributes
+ Attributes to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::rendering::StrokeAttributes& strokeAttributes,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos );
+
+ /** Basic check for texture validity.
+
+ @param texture
+ Texture to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::rendering::Texture& texture,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos );
+
+ /** Basic check for bitmap layout validity.
+
+ @param bitmapLayout
+ Bitmap layout to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos );
+
+ /** Basic check for font info validity.
+
+ @param fontInfo
+ Font info to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::rendering::FontInfo& fontInfo,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos );
+
+ /** Basic check for font request validity.
+
+ @param fontRequest
+ Font request to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyInput( const ::com::sun::star::rendering::FontRequest& fontRequest,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos );
+
+ /** Templatized check for uno::Reference validity.
+
+ @param rRef
+ Reference to check against non-NILness
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ template< class Interface > void verifyInput(
+ const ::com::sun::star::uno::Reference< Interface >& rRef,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos )
+ {
+ (void)pStr; (void)xIf; (void)nArgPos;
+
+ if( !rRef.is() )
+ {
+#if OSL_DEBUG_LEVEL > 0
+ throw ::com::sun::star::lang::IllegalArgumentException(
+ OUString::createFromAscii(pStr) + ": reference is NULL",
+ xIf,
+ nArgPos );
+#else
+ throw ::com::sun::star::lang::IllegalArgumentException();
+#endif
+ }
+ }
+
+ /** Templatized check for content-of-sequence validity.
+
+ @param rSequence
+ Sequence of things to check
+
+ @param xIf
+ The interface that should be reported as the one
+ generating the exception.
+
+ @param nArgPos
+ Argument position on the call site (i.e. the position of
+ the argument, checked here, on the UNO interface
+ method. Counting starts at 0).
+
+ @throws an lang::IllegalArgumentException, if anything is wrong
+ */
+ template< typename SequenceContent > void verifyInput(
+ const ::com::sun::star::uno::Sequence< SequenceContent >& rSequence,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf,
+ ::sal_Int16 nArgPos )
+ {
+ const SequenceContent* pCurr = rSequence.getConstArray();
+ const SequenceContent* pEnd = pCurr + rSequence.getLength();
+ while( pCurr != pEnd )
+ verifyInput( *pCurr++, pStr, xIf, nArgPos );
+ }
+
+ /// Catch-all, to handle cases that DON'T need input checking (i.e. the Integer geometry ones)
+ template< typename T > void verifyInput( const T& /*rDummy*/,
+ const char* /*pStr*/,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& /*xIf*/,
+ ::sal_Int16 /*nArgPos*/ )
+ {
+ }
+
+ // TODO(Q2): Employ some template arglist magic here, to avoid
+ // this duplication of code...
+
+ template< typename Arg0 > void verifyArgs( const Arg0& rArg0,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf )
+ {
+ verifyInput( rArg0, pStr, xIf, 0 );
+ }
+
+ template< typename Arg0,
+ typename Arg1 > void verifyArgs( const Arg0& rArg0,
+ const Arg1& rArg1,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf )
+ {
+ verifyInput( rArg0, pStr, xIf, 0 );
+ verifyInput( rArg1, pStr, xIf, 1 );
+ }
+
+ template< typename Arg0,
+ typename Arg1,
+ typename Arg2 > void verifyArgs( const Arg0& rArg0,
+ const Arg1& rArg1,
+ const Arg2& rArg2,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf )
+ {
+ verifyInput( rArg0, pStr, xIf, 0 );
+ verifyInput( rArg1, pStr, xIf, 1 );
+ verifyInput( rArg2, pStr, xIf, 2 );
+ }
+
+ template< typename Arg0,
+ typename Arg1,
+ typename Arg2,
+ typename Arg3 > void verifyArgs( const Arg0& rArg0,
+ const Arg1& rArg1,
+ const Arg2& rArg2,
+ const Arg3& rArg3,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf )
+ {
+ verifyInput( rArg0, pStr, xIf, 0 );
+ verifyInput( rArg1, pStr, xIf, 1 );
+ verifyInput( rArg2, pStr, xIf, 2 );
+ verifyInput( rArg3, pStr, xIf, 3 );
+ }
+
+ template< typename Arg0,
+ typename Arg1,
+ typename Arg2,
+ typename Arg3,
+ typename Arg4 > void verifyArgs( const Arg0& rArg0,
+ const Arg1& rArg1,
+ const Arg2& rArg2,
+ const Arg3& rArg3,
+ const Arg4& rArg4,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf )
+ {
+ verifyInput( rArg0, pStr, xIf, 0 );
+ verifyInput( rArg1, pStr, xIf, 1 );
+ verifyInput( rArg2, pStr, xIf, 2 );
+ verifyInput( rArg3, pStr, xIf, 3 );
+ verifyInput( rArg4, pStr, xIf, 4 );
+ }
+
+ template< typename Arg0,
+ typename Arg1,
+ typename Arg2,
+ typename Arg3,
+ typename Arg4,
+ typename Arg5 > void verifyArgs( const Arg0& rArg0,
+ const Arg1& rArg1,
+ const Arg2& rArg2,
+ const Arg3& rArg3,
+ const Arg4& rArg4,
+ const Arg5& rArg5,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf )
+ {
+ verifyInput( rArg0, pStr, xIf, 0 );
+ verifyInput( rArg1, pStr, xIf, 1 );
+ verifyInput( rArg2, pStr, xIf, 2 );
+ verifyInput( rArg3, pStr, xIf, 3 );
+ verifyInput( rArg4, pStr, xIf, 4 );
+ verifyInput( rArg5, pStr, xIf, 5 );
+ }
+
+ template< typename Arg0,
+ typename Arg1,
+ typename Arg2,
+ typename Arg3,
+ typename Arg4,
+ typename Arg5,
+ typename Arg6 > void verifyArgs( const Arg0& rArg0,
+ const Arg1& rArg1,
+ const Arg2& rArg2,
+ const Arg3& rArg3,
+ const Arg4& rArg4,
+ const Arg5& rArg5,
+ const Arg6& rArg6,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf )
+ {
+ verifyInput( rArg0, pStr, xIf, 0 );
+ verifyInput( rArg1, pStr, xIf, 1 );
+ verifyInput( rArg2, pStr, xIf, 2 );
+ verifyInput( rArg3, pStr, xIf, 3 );
+ verifyInput( rArg4, pStr, xIf, 4 );
+ verifyInput( rArg5, pStr, xIf, 5 );
+ verifyInput( rArg6, pStr, xIf, 6 );
+ }
+
+
+ /** Range checker, which throws ::com::sun::star::lang::IllegalArgument exception, when
+ range is violated
+ */
+ template< typename NumType > inline void verifyRange( NumType arg, NumType lowerBound, NumType upperBound )
+ {
+ if( arg < lowerBound ||
+ arg > upperBound )
+ {
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ }
+ }
+
+ /** Range checker, which throws ::com::sun::star::lang::IllegalArgument exception, when
+ range is violated
+
+ The checked range is half open, i.e. only bound by the specified value.
+
+ @param arg
+ Arg to check
+
+ @param bound
+ Bound to check against
+
+ @param bLowerBound
+ When true, given bound is the lower bound. When false,
+ given bound is the upper bound.
+ */
+ template< typename NumType > inline void verifyRange( NumType arg, NumType bound, bool bLowerBound=true )
+ {
+ if( (bLowerBound && arg < bound) ||
+ (!bLowerBound && arg > bound) )
+ {
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ }
+ }
+
+ /** Range checker, which throws ::com::sun::star::lang::IndexOutOfBounds exception, when
+ index range is violated
+ */
+ template< typename NumType > inline void verifyIndexRange( NumType arg, NumType lowerBound, NumType upperBound )
+ {
+ if( arg < lowerBound ||
+ arg > upperBound )
+ {
+ throw ::com::sun::star::lang::IndexOutOfBoundsException();
+ }
+ }
+
+ /** Range checker, which throws ::com::sun::star::lang::IndexOutOfBounds exception, when
+ index range is violated
+
+ @param rect
+ Rect to verify
+
+ @param size
+ Given rectangle must be within ((0,0), (size.Width, size.Height))
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyIndexRange( const ::com::sun::star::geometry::IntegerRectangle2D& rect,
+ const ::com::sun::star::geometry::IntegerSize2D& size );
+
+ /** Range checker, which throws ::com::sun::star::lang::IndexOutOfBounds exception, when
+ index range is violated
+
+ @param pos
+ Position to verify
+
+ @param size
+ Given position must be within ((0,0), (size.Width, size.Height))
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyIndexRange( const ::com::sun::star::geometry::IntegerPoint2D& pos,
+ const ::com::sun::star::geometry::IntegerSize2D& size );
+
+ /** Range checker, which throws ::com::sun::star::lang::IndexOutOfBounds exception, when
+ the size is negative or null
+
+ @param size
+ Size to verify
+ */
+ CANVASTOOLS_DLLPUBLIC void verifyBitmapSize( const ::com::sun::star::geometry::IntegerSize2D& size,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf );
+
+ /** Range checker, which throws ::com::sun::star::lang::IndexOutOfBounds exception, when
+ the size is negative or null
+
+ @param size
+ Size to verify
+ */
+ CANVASTOOLS_DLLPUBLIC void verifySpriteSize( const ::com::sun::star::geometry::RealSize2D& size,
+ const char* pStr,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xIf );
+ }
+}
+
+#endif /* INCLUDED_CANVAS_VERIFYINPUT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/codemaker/codemaker.hxx b/include/codemaker/codemaker.hxx
new file mode 100644
index 000000000000..49d1d4b9cea8
--- /dev/null
+++ b/include/codemaker/codemaker.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_CODEMAKER_CODEMAKER_HXX
+#define INCLUDED_CODEMAKER_CODEMAKER_HXX
+
+#include "sal/config.h"
+
+namespace rtl {
+ class OString;
+ class OUString;
+}
+
+namespace codemaker {
+
+rtl::OString convertString(rtl::OUString const & string);
+
+}
+
+#endif // INCLUDED_CODEMAKER_CODEMAKER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/codemaker/commoncpp.hxx b/include/codemaker/commoncpp.hxx
new file mode 100644
index 000000000000..8bff48fc0809
--- /dev/null
+++ b/include/codemaker/commoncpp.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_CODEMAKER_COMMONCPP_HXX
+#define INCLUDED_CODEMAKER_COMMONCPP_HXX
+
+#include "sal/config.h"
+
+#include "codemaker/unotype.hxx"
+
+namespace rtl {
+ class OString;
+ class OUString;
+}
+
+namespace codemaker { namespace cpp {
+
+/** Stick a namespace scope to c++ type
+
+ @param type
+ Undecorated type
+
+ @param ns_alias
+ Use common namespace aliases instead of fully specified (nested)
+ namespace. currently replaces com::sun::star with css.
+ */
+rtl::OString scopedCppName(rtl::OString const & type, bool ns_alias=true);
+
+rtl::OString translateUnoToCppType(
+ codemaker::UnoType::Sort sort, rtl::OUString const & nucleus);
+
+enum IdentifierTranslationMode {
+ ITM_GLOBAL,
+ ITM_NONGLOBAL,
+ ITM_KEYWORDSONLY
+};
+
+rtl::OString translateUnoToCppIdentifier(
+ rtl::OString const & identifier, rtl::OString const & prefix,
+ IdentifierTranslationMode transmode = ITM_GLOBAL,
+ rtl::OString const * forbidden = 0);
+
+} }
+
+#endif // INCLUDED_CODEMAKER_COMMONCPP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/codemaker/commonjava.hxx b/include/codemaker/commonjava.hxx
new file mode 100644
index 000000000000..54d9403cda57
--- /dev/null
+++ b/include/codemaker/commonjava.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_CODEMAKER_COMMONJAVA_HXX
+#define INCLUDED_CODEMAKER_COMMONJAVA_HXX
+
+#include "sal/config.h"
+
+#include "codemaker/unotype.hxx"
+
+namespace rtl { class OString; }
+
+namespace codemaker { namespace java {
+
+rtl::OString translateUnoToJavaType(
+ codemaker::UnoType::Sort sort, rtl::OString const & nucleus,
+ bool referenceType);
+
+rtl::OString translateUnoToJavaIdentifier(
+ rtl::OString const & identifier, rtl::OString const & prefix);
+
+} }
+
+#endif // INCLUDED_CODEMAKER_COMMONJAVA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/codemaker/exceptiontree.hxx b/include/codemaker/exceptiontree.hxx
new file mode 100644
index 000000000000..5392386a3c07
--- /dev/null
+++ b/include/codemaker/exceptiontree.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_CODEMAKER_EXCEPTIONTREE_HXX
+#define INCLUDED_CODEMAKER_EXCEPTIONTREE_HXX
+
+#include "codemaker/global.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/string.hxx"
+
+#include <vector>
+
+class TypeManager;
+
+namespace codemaker {
+
+/**
+ Represents a node of the hierarchy from the ExceptionTree class.
+ */
+struct ExceptionTreeNode {
+ typedef std::vector< ExceptionTreeNode * > Children;
+
+ // Internally used by ExceptionTree:
+ ExceptionTreeNode(rtl::OString const & theName):
+ name(theName), present(false) {}
+
+ // Internally used by ExceptionTree:
+ ~ExceptionTreeNode() { clearChildren(); }
+
+ // Internally used by ExceptionTree:
+ void setPresent() { present = true; clearChildren(); }
+
+ // Internally used by ExceptionTree:
+ ExceptionTreeNode * add(rtl::OString const & theName);
+
+ rtl::OString name;
+ bool present;
+ Children children;
+
+private:
+ ExceptionTreeNode(ExceptionTreeNode &); // not implemented
+ void operator =(ExceptionTreeNode); // not implemented
+
+ void clearChildren();
+};
+
+/**
+ Represents the hierarchy formed by a set of UNO exception types.
+
+ The hierarchy is rooted at com.sun.star.uno.Exception. For each exception E
+ from the given set S, the hierarchy from com.sun.star.uno.Exception to the
+ first supertype E' of E which is itself a member of S is represented (i.e.,
+ subtypes that are hidden by supertypes are pruned from the hierarchy). The
+ exception com.sun.star.uno.RuntimeException and its subtypes are pruned
+ completely from the hierarchy. Each node of the hierarchy is represented by
+ an instance of ExceptionTreeNode, where name gives the name of the UNO
+ exception type, present is true iff the given exception type is a member of
+ the set S, and children contains all the relevant direct subtypes of the
+ given exception type, in no particular order (for nodes other than the root
+ node it holds that children is non-empty iff present is false).
+ */
+class ExceptionTree {
+public:
+ ExceptionTree(): m_root("com.sun.star.uno.Exception") {}
+
+ ~ExceptionTree() {}
+
+ /**
+ Builds the exception hierarchy, by adding one exception type at a time.
+
+ This function can be called more than once for the same exception name.
+
+ @param name the name of a UNO exception type; it is an error if the given
+ name does not represent a UNO exception type
+
+ @param manager a type manager, used to resolve type names; it is an error
+ if different calls to this member function use different, incompatible
+ type managers
+ */
+ void add(
+ rtl::OString const & name,
+ rtl::Reference< TypeManager > const & manager);
+
+ /**
+ Gives access to the resultant exception hierarchy.
+
+ @return a non-null pointer to the root of the exception hierarchy, as
+ formed by all previous calls to add; it is an error if any calls to add
+ follow the first call to getRoot
+ */
+ ExceptionTreeNode const * getRoot() const { return &m_root; }
+
+private:
+ ExceptionTree(ExceptionTree &); // not implemented
+ void operator =(ExceptionTree); // not implemented
+
+ ExceptionTreeNode m_root;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/codemaker/generatedtypeset.hxx b/include/codemaker/generatedtypeset.hxx
new file mode 100644
index 000000000000..3d1a5615b0b1
--- /dev/null
+++ b/include/codemaker/generatedtypeset.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_CODEMAKER_GENERATEDTYPESET_HXX
+#define INCLUDED_CODEMAKER_GENERATEDTYPESET_HXX
+
+#include "rtl/string.hxx"
+
+#include <boost/unordered_set.hpp>
+
+/// @HTML
+
+namespace codemaker {
+
+/**
+ A simple class to track which types have already been processed by a code
+ maker.
+
+ <p>This class is not multi-thread&ndash;safe.</p>
+ */
+class GeneratedTypeSet {
+public:
+ GeneratedTypeSet() {}
+
+ ~GeneratedTypeSet() {}
+
+ /**
+ Add a type to the set of generated types.
+
+ <p>If the type was already present, nothing happens.</p>
+
+ @param type a UNO type registry name
+ */
+ void add(OString const & type) { m_set.insert(type); }
+
+ /**
+ Checks whether a given type has already been generated.
+
+ @param type a UNO type registry name
+
+ @return true iff the given type has already been generated
+ */
+ bool contains(OString const & type) const
+ { return m_set.find(type) != m_set.end(); }
+
+private:
+ GeneratedTypeSet(GeneratedTypeSet &); // not implemented
+ void operator =(GeneratedTypeSet); // not implemented
+
+ boost::unordered_set< OString, OStringHash > m_set;
+};
+
+}
+
+#endif // INCLUDED_CODEMAKER_GENERATEDTYPESET_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/codemaker/global.hxx b/include/codemaker/global.hxx
new file mode 100644
index 000000000000..2c61ce88ec51
--- /dev/null
+++ b/include/codemaker/global.hxx
@@ -0,0 +1,135 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CODEMAKER_GLOBAL_HXX
+#define INCLUDED_CODEMAKER_GLOBAL_HXX
+
+#include <list>
+#include <vector>
+#include <set>
+
+#include <stdio.h>
+
+#include "osl/file.hxx"
+#include "rtl/ustring.hxx"
+#include "rtl/strbuf.hxx"
+
+struct EqualString
+{
+ sal_Bool operator()(const ::rtl::OString& str1, const ::rtl::OString& str2) const
+ {
+ return (str1 == str2);
+ }
+};
+
+struct HashString
+{
+ size_t operator()(const ::rtl::OString& str) const
+ {
+ return str.hashCode();
+ }
+};
+
+struct LessString
+{
+ sal_Bool operator()(const ::rtl::OString& str1, const ::rtl::OString& str2) const
+ {
+ return (str1 < str2);
+ }
+};
+
+typedef ::std::list< ::rtl::OString > StringList;
+typedef ::std::vector< ::rtl::OString > StringVector;
+typedef ::std::set< ::rtl::OString, LessString > StringSet;
+
+//*************************************************************************
+// FileStream
+//*************************************************************************
+enum FileAccessMode
+{
+ FAM_READ, // "r"
+ FAM_WRITE, // "w"
+ FAM_READWRITE_EXIST, // "r+"
+ FAM_READWRITE // "w+"
+};
+
+class FileStream
+{
+public:
+ FileStream();
+ virtual ~FileStream();
+
+ sal_Bool isValid();
+
+ void createTempFile(const ::rtl::OString& sPath);
+ void close();
+
+ ::rtl::OString getName() { return m_name; }
+
+ bool write(void const * buffer, sal_uInt64 size);
+
+ // friend functions
+ friend FileStream &operator<<(FileStream& o, sal_uInt32 i);
+ friend FileStream &operator<<(FileStream& o, char const * s);
+ friend FileStream &operator<<(FileStream& o, ::rtl::OString* s);
+ friend FileStream &operator<<(FileStream& o, const ::rtl::OString& s);
+ friend FileStream &operator<<(FileStream& o, ::rtl::OStringBuffer* s);
+ friend FileStream &operator<<(FileStream& o, const ::rtl::OStringBuffer& s);
+ friend FileStream & operator <<(FileStream & out, rtl::OUString const & s);
+
+private:
+ oslFileHandle m_file;
+ ::rtl::OString m_name;
+};
+
+
+//*************************************************************************
+// Helper functions
+//*************************************************************************
+::rtl::OString getTempDir(const ::rtl::OString& sFileName);
+
+::rtl::OString createFileNameFromType(const ::rtl::OString& destination,
+ const ::rtl::OString type,
+ const ::rtl::OString postfix,
+ sal_Bool bLowerCase=sal_False,
+ const ::rtl::OString prefix="");
+
+sal_Bool fileExists(const ::rtl::OString& fileName);
+sal_Bool makeValidTypeFile(const ::rtl::OString& targetFileName,
+ const ::rtl::OString& tmpFileName,
+ sal_Bool bFileCheck);
+sal_Bool removeTypeFile(const ::rtl::OString& fileName);
+
+::rtl::OUString convertToFileUrl(const ::rtl::OString& fileName);
+
+class CannotDumpException {
+public:
+ CannotDumpException(OUString const & message): message_(message) {}
+
+ virtual ~CannotDumpException() throw ();
+
+ OUString getMessage() const { return message_; }
+
+private:
+ OUString message_;
+};
+
+#endif // INCLUDED_CODEMAKER_GLOBAL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/codemaker/options.hxx b/include/codemaker/options.hxx
new file mode 100644
index 000000000000..4a33e280ca69
--- /dev/null
+++ b/include/codemaker/options.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_CODEMAKER_OPTIONS_HXX
+#define INCLUDED_CODEMAKER_OPTIONS_HXX
+
+#include <boost/unordered_map.hpp>
+
+#include <codemaker/global.hxx>
+
+typedef ::boost::unordered_map
+<
+ ::rtl::OString,
+ ::rtl::OString,
+ HashString,
+ EqualString
+> OptionMap;
+
+class IllegalArgument
+{
+public:
+ IllegalArgument(const ::rtl::OString& msg)
+ : m_message(msg) {}
+
+ ::rtl::OString m_message;
+};
+
+class Options
+{
+public:
+ Options();
+ virtual ~Options();
+
+ virtual sal_Bool initOptions(int ac, char* av[], sal_Bool bCmdFile=sal_False)
+ throw( IllegalArgument ) = 0;
+
+ virtual ::rtl::OString prepareHelp() = 0;
+
+ const ::rtl::OString& getProgramName() const;
+ sal_Bool isValid(const ::rtl::OString& option) const;
+ const ::rtl::OString getOption(const ::rtl::OString& option) const
+ throw( IllegalArgument );
+
+ const StringVector& getInputFiles();
+
+ inline sal_uInt16 getNumberOfExtraInputFiles() const
+ { return (sal_uInt16)m_extra_input_files.size(); }
+ inline const StringVector& getExtraInputFiles() const
+ { return m_extra_input_files; }
+protected:
+ ::rtl::OString m_program;
+ StringVector m_inputFiles;
+ StringVector m_extra_input_files;
+ OptionMap m_options;
+};
+
+#endif // INCLUDED_CODEMAKER_OPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/codemaker/typemanager.hxx b/include/codemaker/typemanager.hxx
new file mode 100644
index 000000000000..fc6aba69ab1d
--- /dev/null
+++ b/include/codemaker/typemanager.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_CODEMAKER_TYPEMANAGER_HXX
+#define INCLUDED_CODEMAKER_TYPEMANAGER_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+#include "codemaker/unotype.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/string.hxx"
+#include "rtl/textenc.h"
+#include "rtl/ustring.hxx"
+#include "salhelper/simplereferenceobject.hxx"
+
+namespace unoidl {
+ class Entity;
+ class Manager;
+ class MapCursor;
+ class Provider;
+}
+
+class TypeManager: public salhelper::SimpleReferenceObject {
+public:
+ TypeManager();
+
+ void loadProvider(OUString const & uri, bool primary);
+
+ bool foundAtPrimaryProvider(OUString const & name) const;
+
+ codemaker::UnoType::Sort getSort(
+ OUString const & name, rtl::Reference< unoidl::Entity > * entity = 0,
+ rtl::Reference< unoidl::MapCursor > * cursor = 0) const;
+
+ codemaker::UnoType::Sort decompose(
+ OUString const & name, bool resolveTypedefs, OUString * nucleus,
+ sal_Int32 * rank, std::vector< OUString > * arguments,
+ rtl::Reference< unoidl::Entity > * entity) const;
+
+private:
+ virtual ~TypeManager();
+
+ rtl::Reference< unoidl::Manager > manager_;
+ std::vector< rtl::Reference< unoidl::Provider > > primaryProviders_;
+};
+
+
+inline OString u2b(OUString const & s) {
+ return OUStringToOString(s, RTL_TEXTENCODING_UTF8);
+}
+
+inline OUString b2u(OString const & s) {
+ return OStringToOUString(s, RTL_TEXTENCODING_UTF8);
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/codemaker/unotype.hxx b/include/codemaker/unotype.hxx
new file mode 100644
index 000000000000..b00de6658a99
--- /dev/null
+++ b/include/codemaker/unotype.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_CODEMAKER_UNOTYPE_HXX
+#define INCLUDED_CODEMAKER_UNOTYPE_HXX
+
+#include "sal/types.h"
+
+#include <vector>
+
+namespace rtl { class OString; }
+
+namespace codemaker {
+
+namespace UnoType {
+ /**
+ An enumeration of all the sorts of relevant UNOIDL entities.
+ */
+ enum Sort {
+ SORT_VOID,
+ SORT_BOOLEAN,
+ SORT_BYTE,
+ SORT_SHORT,
+ SORT_UNSIGNED_SHORT,
+ SORT_LONG,
+ SORT_UNSIGNED_LONG,
+ SORT_HYPER,
+ SORT_UNSIGNED_HYPER,
+ SORT_FLOAT,
+ SORT_DOUBLE,
+ SORT_CHAR,
+ SORT_STRING,
+ SORT_TYPE,
+ SORT_ANY,
+ SORT_SEQUENCE_TYPE,
+ SORT_MODULE,
+ SORT_ENUM_TYPE,
+ SORT_PLAIN_STRUCT_TYPE,
+ SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE,
+ SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE,
+ SORT_EXCEPTION_TYPE,
+ SORT_INTERFACE_TYPE,
+ SORT_TYPEDEF,
+ SORT_CONSTANT_GROUP,
+ SORT_SINGLE_INTERFACE_BASED_SERVICE,
+ SORT_ACCUMULATION_BASED_SERVICE,
+ SORT_INTERFACE_BASED_SINGLETON,
+ SORT_SERVICE_BASED_SINGLETON
+ };
+
+ /**
+ Decomposes a UNO type name or UNO type registry name.
+
+ @param type a binary UNO type name or UNO type registry name
+
+ @param rank if non-null, returns the rank of the denoted UNO type (which
+ is zero for any given type that does not denote a UNO sequence type)
+
+ @param arguments if non-null, the type arguments are stripped from an
+ instantiated polymorphic struct type and returned via this parameter (in
+ the correct order); if null, type arguments are not stripped from
+ instantiated polymorphic struct types
+
+ @return the base part of the given type
+ */
+ rtl::OString decompose(
+ rtl::OString const & type, sal_Int32 * rank = 0,
+ std::vector< rtl::OString > * arguments = 0);
+}
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/ChainablePropertySet.hxx b/include/comphelper/ChainablePropertySet.hxx
new file mode 100644
index 000000000000..2dfe5f3ca256
--- /dev/null
+++ b/include/comphelper/ChainablePropertySet.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 _COMPHELPER_CHAINABLEPROPERTYSET_HXX_
+#define _COMPHELPER_CHAINABLEPROPERTYSET_HXX_
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <comphelper/PropertyInfoHash.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+namespace comphelper
+{
+ class ChainablePropertySetInfo;
+}
+
+/*
+ * A ChainablePropertySet has the following features:
+ *
+ * 1. It implements both the PropertySet and MultiPropertySet interfaces.
+ * 2. It can be 'included' in a MasterPropertySet to seamlessly appear as if
+ * if it's properties were in the master.
+ *
+ * To be used as a base class for PropertySets, the subclass must implement
+ * the 6 protected pure virtual functions. If a mutex is passed to the
+ * constructor, this is locked before any call to _getSingleValue or
+ * _setSingleValue and released after all processing has completed
+ * (including _postSetValues or _postGetValues )
+ *
+ * Any MasterPropertySet implementations that can include an
+ * implementation of a given ChainablePropertySet must be
+ * declared as a 'friend' in the implementation of the ChainablePropertySet.
+ *
+ */
+
+namespace comphelper
+{
+ class COMPHELPER_DLLPUBLIC ChainablePropertySet : public ::com::sun::star::beans::XPropertySet,
+ public ::com::sun::star::beans::XPropertyState,
+ public ::com::sun::star::beans::XMultiPropertySet
+ {
+ friend class MasterPropertySet;
+ protected:
+ ChainablePropertySetInfo *mpInfo;
+ osl::SolarMutex* mpMutex;
+ ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySetInfo > mxInfo;
+
+ virtual void _preSetValues ()
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0;
+ virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0;
+ virtual void _postSetValues ()
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0;
+
+ virtual void _preGetValues ()
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0;
+ virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException ) = 0;
+ virtual void _postGetValues ()
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0;
+
+ virtual void _preGetPropertyState ()
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
+ virtual void _getPropertyState( const comphelper::PropertyInfo& rInfo, ::com::sun::star::beans::PropertyState& rState )
+ throw(::com::sun::star::beans::UnknownPropertyException );
+ virtual void _postGetPropertyState ()
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
+
+ virtual void _setPropertyToDefault( const comphelper::PropertyInfo& rEntry )
+ throw(::com::sun::star::beans::UnknownPropertyException );
+ virtual ::com::sun::star::uno::Any _getPropertyDefault( const comphelper::PropertyInfo& rEntry )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
+
+ public:
+ ChainablePropertySet( comphelper::ChainablePropertySetInfo* pInfo, osl::SolarMutex* pMutex = NULL )
+ throw();
+ virtual ~ChainablePropertySet()
+ throw();
+
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XMultiPropertySet
+ virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
+ throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XPropertyState
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ };
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/ChainablePropertySetInfo.hxx b/include/comphelper/ChainablePropertySetInfo.hxx
new file mode 100644
index 000000000000..ce28803036d5
--- /dev/null
+++ b/include/comphelper/ChainablePropertySetInfo.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 _COMPHELPER_CHAINABLEPROPERTYSETINFO_HXX_
+#define _COMPHELPER_CHAINABLEPROPERTYSETINFO_HXX_
+
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <comphelper/PropertyInfoHash.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/TypeGeneration.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+/*
+ * A ChainablePropertySetInfo is usually initialised with a pointer to the first element
+ * of a null-terminated static table of PropertyInfo structs. This is placed in a hash_map
+ * for fast access
+ *
+ */
+namespace comphelper
+{
+ class COMPHELPER_DLLPUBLIC ChainablePropertySetInfo:
+ public ::cppu::WeakImplHelper1<
+ ::com::sun::star::beans::XPropertySetInfo >
+ {
+ friend class ChainablePropertySet;
+ friend class MasterPropertySet;
+ protected:
+ PropertyInfoHash maMap;
+ com::sun::star::uno::Sequence < com::sun::star::beans::Property > maProperties;
+ public:
+ ChainablePropertySetInfo( PropertyInfo * pMap )
+ throw();
+
+ virtual ~ChainablePropertySetInfo()
+ throw();
+
+ void add( PropertyInfo* pMap, sal_Int32 nCount = -1 )
+ throw();
+ void remove( const OUString& aName )
+ throw();
+
+ // XPropertySetInfo
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::beans::Property SAL_CALL getPropertyByName( const OUString& aName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name )
+ throw(::com::sun::star::uno::RuntimeException);
+ };
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/IdPropArrayHelper.hxx b/include/comphelper/IdPropArrayHelper.hxx
new file mode 100644
index 000000000000..497a39fd500d
--- /dev/null
+++ b/include/comphelper/IdPropArrayHelper.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 COMPHELPER_IDPROPERTYARRAYUSAGEHELPER_HXX
+#define COMPHELPER_IDPROPERTYARRAYUSAGEHELPER_HXX
+
+#include <cppuhelper/component.hxx>
+#include <osl/mutex.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <osl/diagnose.h>
+#include <comphelper/stl_types.hxx>
+#include <rtl/instance.hxx>
+#include <cppuhelper/propshlp.hxx>
+
+namespace cppu { class IPropertyArrayHelper; }
+
+namespace comphelper
+{
+ //************************************************************
+ // OIdPropertyArrayUsageHelper
+ //************************************************************
+ template <typename TYPE> struct OIdPropertyArrayUsageHelperMutex
+ : public rtl::Static< ::osl::Mutex, OIdPropertyArrayUsageHelperMutex<TYPE> > {};
+
+ typedef std::map< sal_Int32, ::cppu::IPropertyArrayHelper*, std::less< sal_Int32 > > OIdPropertyArrayMap;
+ template <class TYPE>
+ class OIdPropertyArrayUsageHelper
+ {
+ protected:
+ static sal_Int32 s_nRefCount;
+ static OIdPropertyArrayMap* s_pMap;
+
+ public:
+ OIdPropertyArrayUsageHelper();
+ virtual ~OIdPropertyArrayUsageHelper()
+ {
+ ::osl::MutexGuard aGuard(OIdPropertyArrayUsageHelperMutex<TYPE>::get());
+ OSL_ENSURE(s_nRefCount > 0, "OIdPropertyArrayUsageHelper::~OIdPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
+ if (!--s_nRefCount)
+ {
+ // delete the element
+ for (OIdPropertyArrayMap::iterator i = s_pMap->begin(); i != s_pMap->end(); ++i)
+ delete (*i).second;
+ delete s_pMap;
+ s_pMap = NULL;
+ }
+ }
+
+ /** call this in the getInfoHelper method of your derived class. The method returns the array helper of the
+ class, which is created if neccessary.
+ */
+ ::cppu::IPropertyArrayHelper* getArrayHelper(sal_Int32 nId);
+
+ protected:
+ /** used to implement the creation of the array helper which is shared amongst all instances of the class.
+ This method needs to be implemented in derived classes.
+ <BR>
+ The method gets called with Mutex acquired.
+ <BR>
+ as long as IPropertyArrayHelper has no virtual destructor, the implementation of ~OPropertyArrayUsageHelper
+ assumes that you created an ::cppu::OPropertyArrayHelper when deleting s_pProps.
+ @return an pointer to the newly created array helper. Must not be NULL.
+ */
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const = 0;
+ };
+
+ //------------------------------------------------------------------
+ template<class TYPE>
+ sal_Int32 OIdPropertyArrayUsageHelper< TYPE >::s_nRefCount = 0;
+
+ template<class TYPE>
+ OIdPropertyArrayMap* OIdPropertyArrayUsageHelper< TYPE >::s_pMap = NULL;
+
+ //------------------------------------------------------------------
+ template <class TYPE>
+ OIdPropertyArrayUsageHelper<TYPE>::OIdPropertyArrayUsageHelper()
+ {
+ ::osl::MutexGuard aGuard(OIdPropertyArrayUsageHelperMutex<TYPE>::get());
+ // create the map if necessary
+ if (s_pMap == NULL)
+ s_pMap = new OIdPropertyArrayMap();
+ ++s_nRefCount;
+ }
+
+ //------------------------------------------------------------------
+ template <class TYPE>
+ ::cppu::IPropertyArrayHelper* OIdPropertyArrayUsageHelper<TYPE>::getArrayHelper(sal_Int32 nId)
+ {
+ OSL_ENSURE(s_nRefCount, "OIdPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !");
+ ::osl::MutexGuard aGuard(OIdPropertyArrayUsageHelperMutex<TYPE>::get());
+ // do we have the array already?
+ if (! (*s_pMap)[nId] )
+ {
+ (*s_pMap)[nId] = createArrayHelper(nId);
+ OSL_ENSURE((*s_pMap)[nId], "OIdPropertyArrayUsageHelper::getArrayHelper : createArrayHelper returned nonsense !");
+ }
+ return (*s_pMap)[nId];
+ }
+}
+#endif // COMPHELPER_IDPROPERTYARRAYUSAGEHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/InlineContainer.hxx b/include/comphelper/InlineContainer.hxx
new file mode 100644
index 000000000000..b23574bbad58
--- /dev/null
+++ b/include/comphelper/InlineContainer.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_COMPHELPER_INLINE_CONTAINER_HXX
+#define INCLUDED_COMPHELPER_INLINE_CONTAINER_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <vector>
+#include <map>
+#include <set>
+
+namespace comphelper
+{
+
+/** Creates a UNO-Sequence which contains an arbitrary number of elements.
+ Notice, that every call of the operator() issues a realloc, so this is not
+ suitable to create very large sequences.
+
+ usage:
+
+ uno::Sequence< t >( MakeSequence< t >( t_1 )( t_2 )...( t_n ) );
+ */
+template < typename T >
+class MakeSequence : public ::com::sun::star::uno::Sequence< T >
+{
+public:
+ explicit MakeSequence(const T &a)
+ : ::com::sun::star::uno::Sequence< T >( 1 )
+ {
+ this->operator[](0) = a;
+ }
+ MakeSequence& operator()(const T &a)
+ {
+ this->realloc( this->getLength() + 1 );
+ this->operator[]( this->getLength() - 1 ) = a;
+ return *this;
+ }
+};
+
+// ----------------------------------------
+
+/** Creates a vector which contains an arbitrary number of elements.
+
+ usage:
+
+ vector< t > aVec( MakeVector< t >( t_1 )( t_2 )...( t_n ) );
+ */
+template < typename T >
+class MakeVector : public ::std::vector< T >
+{
+public:
+ explicit MakeVector(const T &a)
+ : ::std::vector< T >(1, a)
+ {
+ }
+ MakeVector &operator()(const T &a)
+ {
+ this->push_back(a);
+ return *this;
+ }
+};
+
+// ----------------------------------------
+
+/** Creates a set which contains an arbitrary number of elements.
+
+ usage:
+
+ set< t > aSet( MakeSet< t >( t_1 )( t_2 )...( t_n ) );
+ */
+template < typename T >
+class MakeSet : public ::std::set< T >
+{
+public:
+ explicit MakeSet(const T &a)
+ : ::std::set< T >()
+ {
+ this->insert(this->end(), a);
+ }
+ MakeSet &operator()(const T &a)
+ {
+ this->insert(this->end(), a);
+ return *this;
+ }
+};
+
+// ----------------------------------------
+
+/** usage:
+
+ map< k, v > aMap( MakeMap< k, v >
+ ( key_1, value_1 )
+ ( key_2, value_2 )
+ ( key_3, value_3 )
+ ...
+ ( key_n, value_n )
+ );
+ */
+template < typename Key, typename Value >
+class MakeMap : public ::std::map< Key, Value >
+{
+private:
+ typedef typename ::std::map< Key, Value >::value_type value_type;
+public:
+ explicit MakeMap( const Key &k, const Value &v )
+ {
+ this->insert( value_type( k, v ) );
+ }
+ MakeMap &operator()( const Key &k, const Value &v )
+ {
+ this->insert( value_type( k, v ) );
+ return *this;
+ }
+
+ MakeMap &operator()( const MakeMap& rSource )
+ {
+ this->insert(rSource.begin(),rSource.end());
+ return *this;
+ }
+};
+
+} // namespace comphelper
+
+#endif
+// INCLUDED_COMPHELPER_INLINE_CONTAINER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/MasterPropertySet.hxx b/include/comphelper/MasterPropertySet.hxx
new file mode 100644
index 000000000000..266137fdb9b4
--- /dev/null
+++ b/include/comphelper/MasterPropertySet.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 _COMPHELPER_MASTERPROPERTYSETHELPER_HXX_
+#define _COMPHELPER_MASTERPROPERTYSETHELPER_HXX_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <comphelper/PropertyInfoHash.hxx>
+#include "comphelper/comphelperdllapi.h"
+#include <map>
+
+namespace comphelper
+{
+ class MasterPropertySetInfo;
+ class ChainablePropertySet;
+ struct SlaveData
+ {
+ ChainablePropertySet * mpSlave;
+ ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > mxSlave;
+ sal_Bool mbInit;
+ SlaveData ( ChainablePropertySet *pSlave);
+ inline sal_Bool IsInit () { return mbInit;}
+ inline void SetInit ( sal_Bool bInit) { mbInit = bInit; }
+ };
+}
+typedef std::map < sal_uInt8, comphelper::SlaveData* > SlaveMap;
+
+/*
+ * A MasterPropertySet implements all of the features of a ChainablePropertySet
+ * (it is not inherited from ChainablePropertySet to prevent MasterPropertySets
+ * being chained to each other), but also allows properties implemented in
+ * other ChainablePropertySets to be included as 'native' properties in a
+ * given MasterPropertySet implementation. These are registered using the
+ * 'registerSlave' method, and require that the implementation of the
+ * ChainablePropertySet and the implementation of the ChainablePropertySetInfo
+ * both declare the implementation of the MasterPropertySet as a friend.
+ */
+namespace comphelper
+{
+ class COMPHELPER_DLLPUBLIC MasterPropertySet : public ::com::sun::star::beans::XPropertySet,
+ public ::com::sun::star::beans::XPropertyState,
+ public ::com::sun::star::beans::XMultiPropertySet
+ {
+ protected:
+ MasterPropertySetInfo *mpInfo;
+ osl::SolarMutex* mpMutex;
+ sal_uInt8 mnLastId;
+ SlaveMap maSlaveMap;
+ ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySetInfo > mxInfo;
+
+ virtual void _preSetValues ()
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0;
+ virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0;
+ virtual void _postSetValues ()
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0;
+
+ virtual void _preGetValues ()
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0;
+ virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException ) = 0;
+ virtual void _postGetValues ()
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ) = 0;
+
+ virtual void _preGetPropertyState ()
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
+ virtual void _getPropertyState( const comphelper::PropertyInfo& rInfo, ::com::sun::star::beans::PropertyState& rState )
+ throw(::com::sun::star::beans::UnknownPropertyException );
+ virtual void _postGetPropertyState ()
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
+
+ virtual void _setPropertyToDefault( const comphelper::PropertyInfo& rEntry )
+ throw(::com::sun::star::beans::UnknownPropertyException );
+ virtual ::com::sun::star::uno::Any _getPropertyDefault( const comphelper::PropertyInfo& rEntry )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
+
+ public:
+ MasterPropertySet( comphelper::MasterPropertySetInfo* pInfo, ::osl::SolarMutex* pMutex = NULL )
+ throw();
+ virtual ~MasterPropertySet()
+ throw();
+ void registerSlave ( ChainablePropertySet *pNewSet )
+ throw();
+
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XMultiPropertySet
+ virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
+ throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XPropertyState
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ };
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/MasterPropertySetInfo.hxx b/include/comphelper/MasterPropertySetInfo.hxx
new file mode 100644
index 000000000000..d2c772e2c5d5
--- /dev/null
+++ b/include/comphelper/MasterPropertySetInfo.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 _COMPHELPER_MASTERPROPERTYSETINFO_HXX_
+#define _COMPHELPER_MASTERPROPERTYSETINFO_HXX_
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <comphelper/PropertyInfoHash.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/TypeGeneration.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+namespace comphelper
+{
+ class COMPHELPER_DLLPUBLIC MasterPropertySetInfo:
+ public ::cppu::WeakImplHelper1<
+ ::com::sun::star::beans::XPropertySetInfo >
+ {
+ friend class MasterPropertySet;
+ protected:
+ PropertyDataHash maMap;
+ com::sun::star::uno::Sequence < com::sun::star::beans::Property > maProperties;
+ public:
+ MasterPropertySetInfo( PropertyInfo * pMap )
+ throw();
+ virtual ~MasterPropertySetInfo()
+ throw();
+ void add( PropertyInfo* pMap, sal_Int32 nCount = -1, sal_uInt8 nMapId = 0 )
+ throw();
+ void add( PropertyInfoHash &rHash, sal_uInt8 nMapId )
+ throw();
+
+ // XPropertySetInfo
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::beans::Property SAL_CALL getPropertyByName( const OUString& aName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name )
+ throw(::com::sun::star::uno::RuntimeException);
+ };
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/PropertyInfoHash.hxx b/include/comphelper/PropertyInfoHash.hxx
new file mode 100644
index 000000000000..3241560b4a94
--- /dev/null
+++ b/include/comphelper/PropertyInfoHash.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 _COMPHELPER_PROPERTYINFOHASH_HXX_
+#define _COMPHELPER_PROPERTYINFOHASH_HXX_
+
+#include <rtl/ustring.hxx>
+#include <comphelper/TypeGeneration.hxx>
+#include <boost/unordered_map.hpp>
+namespace comphelper
+{
+ struct PropertyInfo
+ {
+ const sal_Char* mpName;
+ sal_uInt16 mnNameLen;
+ sal_Int32 mnHandle;
+ CppuTypes meCppuType;
+ sal_Int16 mnAttributes;
+ sal_uInt8 mnMemberId;
+ };
+ struct PropertyData
+ {
+ sal_uInt8 mnMapId;
+ PropertyInfo *mpInfo;
+ PropertyData ( sal_uInt8 nMapId, PropertyInfo *pInfo )
+ : mnMapId ( nMapId )
+ , mpInfo ( pInfo ) {}
+ };
+ struct eqFunc
+ {
+ sal_Bool operator()( const OUString &r1,
+ const OUString &r2) const
+ {
+ return r1 == r2;
+ }
+ };
+}
+
+typedef boost::unordered_map < OUString,
+ ::comphelper::PropertyInfo*,
+ OUStringHash,
+ ::comphelper::eqFunc > PropertyInfoHash;
+typedef boost::unordered_map < OUString,
+ ::comphelper::PropertyData*,
+ OUStringHash,
+ ::comphelper::eqFunc > PropertyDataHash;
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/SelectionMultiplex.hxx b/include/comphelper/SelectionMultiplex.hxx
new file mode 100644
index 000000000000..56e8375fd215
--- /dev/null
+++ b/include/comphelper/SelectionMultiplex.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_COMPHELPER_SELECTION_MULTIPLEX_HXX
+#define INCLUDED_COMPHELPER_SELECTION_MULTIPLEX_HXX
+
+#include <com/sun/star/view/XSelectionChangeListener.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+//=========================================================================
+//= selection helper classes
+//=========================================================================
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ class OSelectionChangeMultiplexer;
+
+ //==================================================================
+ //= OSelectionChangeListener
+ //==================================================================
+ /// simple listener adapter for selections
+ class COMPHELPER_DLLPUBLIC OSelectionChangeListener
+ {
+ friend class OSelectionChangeMultiplexer;
+
+ OSelectionChangeMultiplexer* m_pAdapter;
+ ::osl::Mutex& m_rMutex;
+
+ public:
+ OSelectionChangeListener(::osl::Mutex& _rMutex)
+ : m_pAdapter(NULL), m_rMutex(_rMutex) { }
+ virtual ~OSelectionChangeListener();
+
+ virtual void _selectionChanged( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual void _disposing(const ::com::sun::star::lang::EventObject& _rSource) throw( ::com::sun::star::uno::RuntimeException);
+
+ protected:
+ // pseudo-private. Making it private now could break compatibility
+ void setAdapter( OSelectionChangeMultiplexer* _pAdapter );
+ };
+
+ //==================================================================
+ //= OSelectionChangeMultiplexer
+ //==================================================================
+ /// multiplexer for selection changes
+ class COMPHELPER_DLLPUBLIC OSelectionChangeMultiplexer :public cppu::WeakImplHelper1< ::com::sun::star::view::XSelectionChangeListener>
+ {
+ friend class OSelectionChangeListener;
+ ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionSupplier> m_xSet;
+ OSelectionChangeListener* m_pListener;
+ sal_Int32 m_nLockCount;
+ sal_Bool m_bListening : 1;
+ sal_Bool m_bAutoSetRelease : 1;
+
+ OSelectionChangeMultiplexer(const OSelectionChangeMultiplexer&);
+ OSelectionChangeMultiplexer& operator=(const OSelectionChangeMultiplexer&);
+ protected:
+ virtual ~OSelectionChangeMultiplexer();
+ public:
+ OSelectionChangeMultiplexer(OSelectionChangeListener* _pListener, const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionSupplier>& _rxSet, sal_Bool _bAutoReleaseSet = sal_True);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException);
+
+ // XSelectionChangeListener
+ virtual void SAL_CALL selectionChanged( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ /// incremental lock
+ void lock();
+ /// incremental unlock
+ void unlock();
+ /// get the lock count
+ sal_Int32 locked() const { return m_nLockCount; }
+
+ void dispose();
+ };
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // INCLUDED_COMPHELPER_SELECTION_MULTIPLEX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/SettingsHelper.hxx b/include/comphelper/SettingsHelper.hxx
new file mode 100644
index 000000000000..d623fa3e5494
--- /dev/null
+++ b/include/comphelper/SettingsHelper.hxx
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_SETTINGSHELPER_HXX_
+#define _COMPHELPER_SETTINGSHELPER_HXX_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/implbase3.hxx>
+
+namespace comphelper
+{
+ class MasterPropertySet;
+ class MasterPropertySetInfo;
+ class ChainablePropertySet;
+ class ChainablePropertySetInfo;
+
+ typedef cppu::WeakImplHelper3
+ <
+ ::com::sun::star::beans::XPropertySet,
+ ::com::sun::star::beans::XMultiPropertySet,
+ ::com::sun::star::lang::XServiceInfo
+ >
+ HelperBaseNoState;
+ template < class ComphelperBase, class ComphelperBaseInfo > class SettingsHelperNoState :
+ public HelperBaseNoState,
+ public ComphelperBase
+ {
+ public:
+ SettingsHelperNoState ( ComphelperBaseInfo *pInfo, ::osl::SolarMutex* pMutex = NULL)
+ : ComphelperBase ( pInfo, pMutex )
+ {}
+ virtual ~SettingsHelperNoState () throw( ) {}
+ com::sun::star::uno::Any SAL_CALL queryInterface( const com::sun::star::uno::Type& aType ) throw (com::sun::star::uno::RuntimeException)
+ { return HelperBaseNoState::queryInterface( aType ); }
+ void SAL_CALL acquire( ) throw ()
+ { HelperBaseNoState::acquire( ); }
+ void SAL_CALL release( ) throw ()
+ { HelperBaseNoState::release( ); }
+
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( )
+ throw(::com::sun::star::uno::RuntimeException)
+ { return ComphelperBase::getPropertySetInfo(); }
+ virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ { ComphelperBase::setPropertyValue ( aPropertyName, aValue ); }
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ { return ComphelperBase::getPropertyValue ( PropertyName ); }
+ virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ { ComphelperBase::addPropertyChangeListener ( aPropertyName, xListener ); }
+ virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ { ComphelperBase::removePropertyChangeListener ( aPropertyName, aListener ); }
+ virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ { ComphelperBase::addVetoableChangeListener ( PropertyName, aListener ); }
+ virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ { ComphelperBase::removeVetoableChangeListener ( PropertyName, aListener ); }
+
+ // XMultiPropertySet
+ virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
+ throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ { ComphelperBase::setPropertyValues ( aPropertyNames, aValues ); }
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames )
+ throw(::com::sun::star::uno::RuntimeException)
+ { return ComphelperBase::getPropertyValues ( aPropertyNames ); }
+ virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
+ throw(::com::sun::star::uno::RuntimeException)
+ { ComphelperBase::addPropertiesChangeListener ( aPropertyNames, xListener ); }
+ virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
+ throw(::com::sun::star::uno::RuntimeException)
+ { ComphelperBase::removePropertiesChangeListener ( xListener ); }
+ virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
+ throw(::com::sun::star::uno::RuntimeException)
+ { ComphelperBase::firePropertiesChangeEvent ( aPropertyNames, xListener ); }
+ };
+ typedef comphelper::SettingsHelperNoState
+ <
+ ::comphelper::MasterPropertySet,
+ ::comphelper::MasterPropertySetInfo
+ >
+ MasterHelperNoState;
+ typedef comphelper::SettingsHelperNoState
+ <
+ ::comphelper::ChainablePropertySet,
+ ::comphelper::ChainablePropertySetInfo
+ >
+ ChainableHelperNoState;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/TypeGeneration.hxx b/include/comphelper/TypeGeneration.hxx
new file mode 100644
index 000000000000..0ced57b31714
--- /dev/null
+++ b/include/comphelper/TypeGeneration.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_TYPEGENERATION_HXX_
+#define _COMPHELPER_TYPEGENERATION_HXX_
+
+#include <sal/types.h>
+#include "comphelper/comphelperdllapi.h"
+
+#define CPPU_E2T(type) ((com::sun::star::uno::Type*)type)
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Type;
+} } } }
+namespace comphelper
+{
+ enum CppuTypes
+ {
+ CPPUTYPE_UNKNOWN, // 0 == unknown == error!!!!
+
+ CPPUTYPE_BOOLEAN, //getBooleanCppuType()
+ CPPUTYPE_INT8, //getCppuType( (sal_Int8*)0 )
+ CPPUTYPE_INT16, //getCppuType( (sal_Int16*)0 )
+ CPPUTYPE_INT32, //getCppuType( (sal_Int32*)0 )
+ CPPUTYPE_DOUBLE, //getCppuType( (double*)0 )
+ CPPUTYPE_FLOAT, //getCppuType( (float*)0 )
+ CPPUTYPE_OUSTRING, //getCppuType( (OUString*)0 )
+
+ CPPUTYPE_FONTSLANT, //getCppuType( (FontSlant*)0 )
+ CPPUTYPE_LOCALE, //getCppuType( (Locale*)0 )
+ CPPUTYPE_PROPERTYVALUE, //getCppuType( (Sequence<PropertyValue>*)0 )
+ CPPUTYPE_PROPERTYVALUES, //getCppuType( (Sequence<PropertyValues>*)0 )
+ CPPUTYPE_BORDERLINE, //getCppuType( (table::BorderLine*)0 )
+ CPPUTYPE_BREAK, //getCppuType( (style::BreakType*)0 )
+ CPPUTYPE_GRAPHICLOC, //getCppuType( (style::GraphicLocation*)0 )
+ CPPUTYPE_DROPCAPFMT, //getCppuType( (style::DropCapFormat*)0 )
+ CPPUTYPE_LINESPACE, //getCppuType( (style::LineSpacing*)0 )
+ CPPUTYPE_AWTSIZE, //getCppuType( (awt::Size*)0 )
+ CPPUTYPE_SHADOWFMT, //getCppuType( (table::ShadowFormat*)0 )
+ CPPUTYPE_TBLCOLSEP, //getCppuType( (Sequence<text::TableColumnSeparator>*)0 )
+ CPPUTYPE_PNTSEQSEQ, //getCppuType( (PointSequenceSequence*)0 )
+ CPPUTYPE_DOCIDXMRK, //getCppuType( (Sequence< Reference< XDocumentIndexMark > >*)0 )
+ CPPUTYPE_SEQINT8, //getCppuType( (Sequence<sal_Int8>*)0 )
+ CPPUTYPE_SEQTABSTOP, //getCppuType( (Sequence<style::TabStop>*)0 )
+ CPPUTYPE_SEQANCHORTYPE, //getCppuType( (Sequence<text::TextContentAnchorType>*)0 )
+ CPPUTYPE_SEQDEPTXTFLD, //getCppuType( (Sequence<Reference<XDependentTextField> >*)0 )
+ CPPUTYPE_TXTCNTANCHOR, //getCppuType( (text::TextContentAnchorType*)0 )
+ CPPUTYPE_WRAPTXTMODE, //getCppuType( (text::WrapTextMode*)0 )
+ CPPUTYPE_LINESTYLE, //getCppuType( (drawing::LineStyle*)0 )
+ CPPUTYPE_COLORMODE, //getCppuType( (drawing::ColorMode*)0 )
+ CPPUTYPE_PAGESTYLELAY, //getCppuType( (style::PageStyleLayout*)0 )
+ CPPUTYPE_VERTALIGN, //getCppuType( (style::VerticalAlignment*)0 )
+ CPPUTYPE_TABLEBORDER, //getCppuType( (table::TableBorder*)0 )
+ CPPUTYPE_TABLEBORDER2, //getCppuType( (table::TableBorder*)0 )
+ CPPUTYPE_GRFCROP, //getCppuType( (text::GraphicCrop*)0 )
+ CPPUTYPE_SECTFILELNK, //getCppuType( (text::SectionFileLink*)0 )
+ CPPUTYPE_PAGENUMTYPE, //getCppuType( (const PageNumberType*)0 )
+ CPPUTYPE_DATETIME, //getCppuType( (util::DateTime*)0 )
+ CPPUTYPE_DATE, //getCppuType( (util::Date*)0 )
+
+ CPPUTYPE_REFINTERFACE, //getCppuType( (Reference<XInterface>*)0 )
+ CPPUTYPE_REFIDXREPL, //getCppuType( (Reference<container::XIndexReplace>*)0 )
+ CPPUTYPE_REFNAMECNT, //getCppuType( (Reference<container::XNameContainer>*)0 )
+ CPPUTYPE_REFTEXTFRAME, //getCppuType( (Reference<text::XTextFrame>*)0 )
+ CPPUTYPE_REFTEXTSECTION, //getCppuType( (Reference<text::XTextSection>*)0 )
+ CPPUTYPE_REFFOOTNOTE, //getCppuType( (Reference<text::XFootnote>*)0 )
+ CPPUTYPE_REFTEXT, //getCppuType( (Reference<text::XText>*)0 )
+ CPPUTYPE_REFTEXTCOL, //getCppuType( (Reference<text::XTextColumns>*)0 )
+
+ CPPUTYPE_REFFORBCHARS, //getCppuType( (Reference<XForbiddenCharacters>*)0)
+ CPPUTYPE_REFIDXCNTNR, //getCppuType( (Reference<XIndexContainer>*)0)
+ CPPUTYPE_REFTEXTCNTNT, //getCppuType( (Reference<XTextContent>*)0)
+ CPPUTYPE_REFBITMAP, //getCppuType( (Reference<awt::XBitmap>*)0)
+ CPPUTYPE_REFNMREPLACE, //getCppuType( (Reference<container::XNameReplace>*)0)
+ CPPUTYPE_REFCELL, //getCppuType( (Reference<table::XCell>*)0)
+ CPPUTYPE_REFDOCINDEX, //getCppuType( (Reference<text::XDocumentIndex>*)0)
+ CPPUTYPE_REFDOCIDXMRK, //getCppuType( (Reference<text::XDocumentIndexMark>*)0)
+ CPPUTYPE_REFTXTFIELD, //getCppuType( (Reference<text::XTextField>*)0)
+ CPPUTYPE_REFTXTRANGE, //getCppuType( (Reference<text::XTextRange>*)0)
+ CPPUTYPE_REFTXTTABLE, //getCppuType( (Reference<text::XTextTable>*)0)
+ CPPUTYPE_AWTPOINT, //getCppuType( (awt::Point*)0 )
+ CPPUTYPE_REFLIBCONTAINER, //getCppuType( (Reference< script::XLibraryContainer >*)0)
+ CPPUTYPE_SEQANY, //getCppuType( (Sequence< uno::Any >*)0)
+ CPPUTYPE_REFRESULTSET, //getCppuType( (Reference< sdbc::XResultSet >*)0)
+ CPPUTYPE_REFCONNECTION, //getCppuType( (Reference< sdbc::XConnection >*)0)
+ CPPUTYPE_REFMODEL, //getCppuType( (Reference< frame::XModel >*)0)
+
+ CPPUTYPE_OUSTRINGS, //getCppuType( (Sequence<OUString>*)0 )
+ CPPUTYPE_REFCOMPONENT, //getCppuType( (Reference< lang::XComponent >*)0 )
+ // #i28749#
+ CPPUTYPE_TRANSFORMATIONINHORIL2R, //getCppuType( (drawing::HomogenMatrix3)* )
+ CPPUTYPE_SEQNAMEDVALUE, //getCppuType( (Sequence<beans::NamedValue>*)0 )
+ CPPUTYPE_REFXGRAPHIC, //getCppuType( Reference< graphic::XGraphic >*)0)
+ CPPUTYPE_TABLEBORDERDISTANCES, //getCppuType( (table::TableBorderDistances*)0 )
+ CPPUTPYE_REFEMBEDDEDOBJECT, // XEmbeddedObject::static_type
+ CPPUTYPE_FILLSTYLE, //getCppuType( (drawing::FillStyle*)0 )
+ CPPUTYPE_GRADIENT, //getCppuType( (awt::Gradient*)0 )
+
+ CPPUTYPE_END
+ };
+ COMPHELPER_DLLPUBLIC void GenerateCppuType (
+ CppuTypes eType, const com::sun::star::uno::Type*& pType );
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessiblecomponenthelper.hxx b/include/comphelper/accessiblecomponenthelper.hxx
new file mode 100644
index 000000000000..d0eabc27b807
--- /dev/null
+++ b/include/comphelper/accessiblecomponenthelper.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 COMPHELPER_ACCESSIBLE_COMPONENT_HELPER_HXX
+#define COMPHELPER_ACCESSIBLE_COMPONENT_HELPER_HXX
+
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+#include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
+#include <comphelper/accessiblecontexthelper.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/uno3.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OCommonAccessibleComponent
+ //=====================================================================
+ /** base class encapsulating common functionality for the helper classes implementing
+ the XAccessibleComponent respectively XAccessibleExtendendComponent
+ */
+ class COMPHELPER_DLLPUBLIC OCommonAccessibleComponent : public OAccessibleContextHelper
+ {
+ protected:
+ OCommonAccessibleComponent();
+ /// see the respective base class ctor for an extensive comment on this, please
+ OCommonAccessibleComponent( IMutex* _pExternalLock );
+ ~OCommonAccessibleComponent();
+
+ protected:
+ /// implements the calculation of the bounding rectangle - still waiting to be overwritten
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+
+ protected:
+ /** non-virtual versions of the methods which can be implemented using <method>implGetBounds</method>
+ note: getLocationOnScreen relies on a valid parent (XAccessibleContext::getParent()->getAccessibleContext()),
+ which itself implements XAccessibleComponent
+ */
+ sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Point SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) throw (::com::sun::star::uno::RuntimeException);
+ };
+
+ //=====================================================================
+ //= OAccessibleComponentHelper
+ //=====================================================================
+
+ struct OAccessibleComponentHelper_Base :
+ public ::cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleComponent >
+ {
+ protected:
+ ~OAccessibleComponentHelper_Base() {}
+ };
+
+ /** a helper class for implementing an AccessibleContext which at the same time
+ supports an XAccessibleComponent interface.
+ */
+ class COMPHELPER_DLLPUBLIC OAccessibleComponentHelper
+ :public OCommonAccessibleComponent
+ ,public OAccessibleComponentHelper_Base
+ {
+ protected:
+ OAccessibleComponentHelper( );
+ /// see the respective base class ctor for an extensive comment on this, please
+ OAccessibleComponentHelper( IMutex* _pExternalLock );
+
+ public:
+ // XInterface
+ DECLARE_XINTERFACE( )
+ DECLARE_XTYPEPROVIDER( )
+
+ // XAccessibleComponent - default implementations
+ virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) throw (::com::sun::star::uno::RuntimeException);
+ };
+
+ //=====================================================================
+ //= OAccessibleExtendedComponentHelper
+ //=====================================================================
+
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ > OAccessibleExtendedComponentHelper_Base;
+
+ /** a helper class for implementing an AccessibleContext which at the same time
+ supports an XAccessibleExtendedComponent interface.
+ */
+ class COMPHELPER_DLLPUBLIC OAccessibleExtendedComponentHelper
+ :public OCommonAccessibleComponent
+ ,public OAccessibleExtendedComponentHelper_Base
+ {
+ protected:
+ OAccessibleExtendedComponentHelper( );
+ /// see the respective base class ctor for an extensive comment on this, please
+ OAccessibleExtendedComponentHelper( IMutex* _pExternalLock );
+
+ public:
+ // XInterface
+ DECLARE_XINTERFACE( )
+ DECLARE_XTYPEPROVIDER( )
+
+ // XAccessibleComponent - default implementations
+ virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) throw (::com::sun::star::uno::RuntimeException);
+ };
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // COMPHELPER_ACCESSIBLE_COMPONENT_HELPER_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessiblecontexthelper.hxx b/include/comphelper/accessiblecontexthelper.hxx
new file mode 100644
index 000000000000..e6c5c10ab20f
--- /dev/null
+++ b/include/comphelper/accessiblecontexthelper.hxx
@@ -0,0 +1,345 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_ACCESSIBLE_CONTEXT_HELPER_HXX
+#define COMPHELPER_ACCESSIBLE_CONTEXT_HELPER_HXX
+
+#include <cppuhelper/compbase2.hxx>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <comphelper/broadcasthelper.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ //=====================================================================
+ //= IMutex
+ //=====================================================================
+
+ // This whole thingie here (own mutex classes and such) is a HACK. I hate the SolarMutex.
+ // See below for more explanations ....
+
+ /** abstract interface for implementing a mutex
+ */
+ class COMPHELPER_DLLPUBLIC IMutex
+ {
+ public:
+ virtual ~IMutex();
+ virtual void acquire() = 0;
+ virtual void release() = 0;
+ };
+
+ //=====================================================================
+ //= OMutexGuard
+ //=====================================================================
+
+ class OMutexGuard
+ {
+ IMutex* m_pMutex;
+ public:
+ inline OMutexGuard( IMutex* _pMutex )
+ :m_pMutex( _pMutex )
+ {
+ if ( m_pMutex )
+ m_pMutex->acquire();
+ }
+
+ inline ~OMutexGuard( )
+ {
+ if ( m_pMutex )
+ m_pMutex->release();
+ }
+ };
+
+ //=====================================================================
+ //= OAccessibleContextHelper
+ //=====================================================================
+
+ class OContextHelper_Impl;
+ typedef ::cppu::WeakAggComponentImplHelper2 < ::com::sun::star::accessibility::XAccessibleContext,
+ ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ > OAccessibleContextHelper_Base;
+
+ /** helper class for implementing an AccessibleContext
+ */
+ class COMPHELPER_DLLPUBLIC OAccessibleContextHelper
+ :public ::comphelper::OBaseMutex
+ ,public OAccessibleContextHelper_Base
+ {
+ private:
+ OContextHelper_Impl* m_pImpl;
+
+ protected:
+ OAccessibleContextHelper( );
+ ~OAccessibleContextHelper( );
+
+ /** ctor
+
+ <p>If you need additional object safety for your class, and want to ensure that your own
+ mutex is locked before the mutex this class provides is, than use this ctor.</p>
+
+ <p>Beware that this is a hack. Unfortunately, OpenOffice.org has two different mutex hierarchies,
+ which are not compatible. In addition, wide parts of the code (especially VCL) is not thread-safe,
+ but instead relies on a <em>single global mutex</em>. As a consequence, components using
+ directly or indirectly such code need to care for this global mutex. Yes, this is as ugly as
+ anything.</p>
+
+ <p>Note that the external lock is used as additional lock, not as the only one. The own mutex of the
+ instance is used for internal actions, and every action which potentially involves external code
+ (for instance every call to a virtual method overridden by derivees) is <em>additionally</em> and
+ <em>first</em> guarded by with the external lock.</p>
+
+ <p>Beware of the lifetime of the lock - you must ensure that the lock exists at least as long as
+ the context does. A good approach to implement the lock may be to derive you own context
+ not only from OAccessibleContextHelper, but also from IMutex.</p>
+
+ <p>One more note. This lock is definitely not used once the dtor is reached. Means whatever
+ the dtor implementation does, it does <em>not</em> guard the external lock. See this as a contract.
+ <br/>You should ensure the same thing for own derivees which do not supply the lock themself,
+ but get them from yet another derivee.</p>
+ @see forgetExternalLock
+ */
+ OAccessibleContextHelper( IMutex* _pExternalLock );
+
+ /** late construction
+ @param _rxAccessible
+ the Accessible object which created this context.
+ <p>If your derived implementation implements the XAccessible (and does not follow the proposed
+ separation of XAccessible from XAccessibleContext), you may pass <code>this</code> here.</p>
+
+ <p>The object is hold weak, so it's life time is not affected.</p>
+
+ <p>The object is needed for performance reasons: for <method>getAccessibleIndexInParent</method>,
+ all children (which are XAccessible's theirself) of our parent have to be asked. If we know our
+ XAccessible, we can compare it with all the children, instead of asking all children for their
+ context and comparing this context with ourself.</p>
+ */
+ void lateInit( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxAccessible );
+
+ /** retrieves the creator previously set with <method>lateInit</method>
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getAccessibleCreator( ) const;
+
+ /** forgets the reference to the external lock, if present.
+
+ <p>This means any further locking will not be guard the external lock anymore, never.</p>
+
+ <p>To be used in derived classes which do not supply the external lock themself, but instead get
+ them passed from own derivees (or clients).</p>
+ */
+ void forgetExternalLock();
+
+ public:
+ // XAccessibleEventBroadcaster
+ virtual void SAL_CALL addAccessibleEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeAccessibleEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleContext - still waiting to be overwritten
+ virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+
+ // XAccessibleContext - default implementations
+ /** default implementation for retrieving the index of this object within the parent
+ <p>This basic implementation here returns the index <code>i</code> of the child for which
+ <code>&lt;parent&gt;.getAccessibleChild( i )</code> equals our creator.</p>
+ */
+ virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException);
+ /** default implementation for retrieving the locale
+ <p>This basic implementation returns the locale of the parent context,
+ as retrieved via getAccessibleParent()->getAccessibleContext.</p>
+ */
+ virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
+
+ public:
+ // helper struct for granting selective access rights
+ struct OAccessControl
+ {
+ friend class OContextEntryGuard;
+ friend class OContextHelper_Impl;
+ friend class OExternalLockGuard;
+ private:
+ OAccessControl() { }
+ };
+
+ // ensures that the object is alive
+ inline void ensureAlive( const OAccessControl& ) const SAL_THROW( ( ::com::sun::star::lang::DisposedException ) );
+ inline IMutex* getExternalLock( const OAccessControl& );
+ inline ::osl::Mutex& GetMutex( const OAccessControl& );
+
+ protected:
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+ protected:
+ // helper
+ /** notifies all AccessibleEventListeners of a certain event
+
+ @precond not too be called with our mutex locked
+ @param _nEventId
+ the id of the even. See AccessibleEventType
+ @param _rOldValue
+ the old value to be notified
+ @param _rNewValue
+ the new value to be notified
+ */
+ virtual void SAL_CALL NotifyAccessibleEvent(
+ const sal_Int16 _nEventId,
+ const ::com::sun::star::uno::Any& _rOldValue,
+ const ::com::sun::star::uno::Any& _rNewValue
+ );
+
+ // life time control
+ /// checks whether the object is alive (returns <TRUE/> then) or disposed
+ sal_Bool isAlive() const;
+ /// checks for beeing alive. If the object is already disposed (i.e. not alive), an exception is thrown.
+ void ensureAlive() const SAL_THROW( ( ::com::sun::star::lang::DisposedException ) );
+
+ /** ensures that the object is disposed.
+ @precond
+ to be called from within the destructor of your derived class only!
+ */
+ void ensureDisposed( );
+
+ /** shortcut for retrieving the context of the parent (returned by getAccessibleParent)
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ implGetParentContext() SAL_THROW( ( ::com::sun::star::uno::RuntimeException ) );
+
+ // access to the base class' broadcast helper/mutex
+ ::cppu::OBroadcastHelper& GetBroadcastHelper() { return rBHelper; }
+ const ::cppu::OBroadcastHelper& GetBroadcastHelper() const { return rBHelper; }
+ ::osl::Mutex& GetMutex() { return m_aMutex; }
+ IMutex* getExternalLock( );
+ };
+
+ //---------------------------------------------------------------------
+ inline void OAccessibleContextHelper::ensureAlive( const OAccessControl& ) const SAL_THROW( ( ::com::sun::star::lang::DisposedException ) )
+ {
+ ensureAlive();
+ }
+
+ //---------------------------------------------------------------------
+ inline IMutex* OAccessibleContextHelper::getExternalLock( const OAccessControl& )
+ {
+ return getExternalLock();
+ }
+
+ //---------------------------------------------------------------------
+ inline ::osl::Mutex& OAccessibleContextHelper::GetMutex( const OAccessControl& )
+ {
+ return GetMutex();
+ }
+
+ //=====================================================================
+ //= OContextEntryGuard
+ //=====================================================================
+ typedef ::osl::ClearableMutexGuard OContextEntryGuard_Base;
+ /** helper class for guarding the entry into OAccessibleContextHelper methods.
+
+ <p>The class has two responsibilities:
+ <ul><li>it locks the mutex of an OAccessibleContextHelper instance, as long as the guard lives</li>
+ <li>it checks if an given OAccessibleContextHelper instance is alive, else an exception is thrown
+ our of the constructor of the guard</li>
+ </ul>
+ <br/>
+ This makes it your first choice (hopefully :) for guarding any interface method implementations of
+ you derived class.
+ </p>
+ */
+ class OContextEntryGuard : public OContextEntryGuard_Base
+ {
+ public:
+ /** constructs the guard
+
+ <p>The given context (it's mutex, respectively) is locked, and an exception is thrown if the context
+ is not alive anymore. In the latter case, of course, the mutex is freed, again.</p>
+
+ @param _pContext
+ the context which shall be guarded
+ @precond <arg>_pContext</arg> != NULL
+ */
+ inline OContextEntryGuard( OAccessibleContextHelper* _pContext );
+
+ /** destructs the guard.
+ <p>The context (it's mutex, respectively) is unlocked.</p>
+ */
+ inline ~OContextEntryGuard();
+ };
+
+ //.....................................................................
+ inline OContextEntryGuard::OContextEntryGuard( OAccessibleContextHelper* _pContext )
+ :OContextEntryGuard_Base( _pContext->GetMutex( OAccessibleContextHelper::OAccessControl() ) )
+ {
+ _pContext->ensureAlive( OAccessibleContextHelper::OAccessControl() );
+ }
+
+ //.....................................................................
+ inline OContextEntryGuard::~OContextEntryGuard()
+ {
+ }
+
+ //=====================================================================
+ //= OExternalLockGuard
+ //=====================================================================
+ class OExternalLockGuard
+ :public OMutexGuard
+ ,public OContextEntryGuard
+ {
+ public:
+ inline OExternalLockGuard( OAccessibleContextHelper* _pContext );
+ inline ~OExternalLockGuard( );
+ };
+
+ //.....................................................................
+ inline OExternalLockGuard::OExternalLockGuard( OAccessibleContextHelper* _pContext )
+ :OMutexGuard( _pContext->getExternalLock( OAccessibleContextHelper::OAccessControl() ) )
+ ,OContextEntryGuard( _pContext )
+ {
+ // #102438#
+ // Only lock the external mutex,
+ // release the ::osl::Mutex of the OAccessibleContextHelper instance.
+ // If you call into another UNO object with locked ::osl::Mutex,
+ // this may lead to dead locks.
+ clear();
+ }
+
+ //.....................................................................
+ inline OExternalLockGuard::~OExternalLockGuard( )
+ {
+ }
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // COMPHELPER_ACCESSIBLE_CONTEXT_HELPER_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessibleeventnotifier.hxx b/include/comphelper/accessibleeventnotifier.hxx
new file mode 100644
index 000000000000..f0a745baa5a8
--- /dev/null
+++ b/include/comphelper/accessibleeventnotifier.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 COMPHELPER_ACCESSIBLE_EVENT_NOTIFIER
+#define COMPHELPER_ACCESSIBLE_EVENT_NOTIFIER
+
+#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
+#include <osl/thread.hxx>
+#include <osl/conditn.hxx>
+#include <cppuhelper/interfacecontainer.h>
+#include "comphelper/comphelperdllapi.h"
+
+#include <map>
+#include <list>
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ //=====================================================================
+ //= AccessibleEventNotifier
+ //=====================================================================
+ class COMPHELPER_DLLPUBLIC AccessibleEventNotifier
+ {
+ // typedefs
+ public:
+ typedef sal_uInt32 TClientId;
+
+ typedef ::std::pair< TClientId, ::com::sun::star::accessibility::AccessibleEventObject >
+ ClientEvent;
+
+ typedef ::cppu::OInterfaceContainerHelper EventListeners;
+ typedef ::std::map< TClientId, EventListeners*, ::std::less< TClientId > > ClientMap;
+
+ protected:
+ AccessibleEventNotifier( ); // never implemented
+ ~AccessibleEventNotifier( ); // never implemented
+
+ private:
+ COMPHELPER_DLLPRIVATE AccessibleEventNotifier( const AccessibleEventNotifier& ); // never implemented!
+ COMPHELPER_DLLPRIVATE AccessibleEventNotifier& operator=( const AccessibleEventNotifier& ); // never implemented!
+
+ public:
+ /** registers a client of this class, means a broadcaster of AccessibleEvents
+
+ <p>No precaution is taken to care for disposal of this component. When the component
+ dies, it <b>must</b> call <member>revokeClient</member> or <member>revokeClientNotifyDisposing</member>
+ explicitly itself.</p>
+ */
+ static TClientId registerClient( );
+
+ /** revokes a broadcaster of AccessibleEvents
+
+ <p>Note that no disposing event is fired when you use this method, the client is simply revoked.
+ You can for instance revoke a client if the last listener for it is revoked, but the client
+ itself is not disposed.<br/>
+ When the client is disposed, you should prefer <member>revokeClientNotifyDisposing</member></p>
+
+ <p>Any possibly pending events for this client are removed from the queue.</p>
+
+ @seealso revokeClientNotifyDisposing
+ */
+ static void revokeClient( const TClientId _nClient );
+
+ /** revokes a client, with additionally notifying a disposing event to all listeners registered for
+ this client
+
+ <p>Any other possibly pending events for this client are removed from the queue</p>
+
+ @param _nClient
+ the id of the client which should be revoked
+ @param _rxEventSource
+ the source to be notified together with the <member scope="com.sun.star.lang">XComponent::disposing</member>
+ call.
+ */
+ static void revokeClientNotifyDisposing(
+ const TClientId _nClient,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxEventSource
+ ) SAL_THROW( ( ) );
+
+ /** registers a listener for the given client
+
+ @param _nClient
+ the id of the client for which a listener should be registered
+ @return
+ the number of event listeners currently registered for this client
+ */
+ static sal_Int32 addEventListener(
+ const TClientId _nClient,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& _rxListener
+ ) SAL_THROW( ( ) );
+
+ /** revokes a listener for the given client
+
+ @param _nClient
+ the id of the client for which a listener should be revoked
+ @return
+ the number of event listeners currently registered for this client
+ */
+ static sal_Int32 removeEventListener(
+ const TClientId _nClient,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& _rxListener
+ ) SAL_THROW( ( ) );
+
+ /** adds an event, which is to be braodcasted, to the queue
+
+ @param _nClient
+ the id of the client which needs to broadcast the event
+ */
+ static void addEvent(
+ const TClientId _nClient,
+ const ::com::sun::star::accessibility::AccessibleEventObject& _rEvent
+ ) SAL_THROW( ( ) );
+
+ private:
+ /// generates a new client id
+ COMPHELPER_DLLPRIVATE static TClientId generateId();
+
+ /** looks up a client in our client map, asserts if it cannot find it or no event thread is present
+
+ @precond
+ to be called with our mutex locked
+
+ @param _nClient
+ the id of the client to loopup
+ @param _rPos
+ out-parameter for the position of the client in the client map
+
+ @return
+ <TRUE/> if and only if the client could be found and <arg>_rPos</arg> has been filled with
+ it's position
+ */
+ COMPHELPER_DLLPRIVATE static sal_Bool implLookupClient( const TClientId _nClient, ClientMap::iterator& _rPos );
+ };
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // COMPHELPER_ACCESSIBLE_EVENT_NOTIFIER
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessiblekeybindinghelper.hxx b/include/comphelper/accessiblekeybindinghelper.hxx
new file mode 100644
index 000000000000..4849b124cf87
--- /dev/null
+++ b/include/comphelper/accessiblekeybindinghelper.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 COMPHELPER_ACCESSIBLE_KEYBINDING_HELPER_HXX
+#define COMPHELPER_ACCESSIBLE_KEYBINDING_HELPER_HXX
+
+#include <com/sun/star/accessibility/XAccessibleKeyBinding.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <osl/mutex.hxx>
+
+#include <vector>
+
+#include "comphelper/comphelperdllapi.h"
+
+//..............................................................................
+namespace comphelper
+{
+//..............................................................................
+
+ //==============================================================================
+ // OAccessibleKeyBindingHelper
+ //==============================================================================
+
+ typedef ::cppu::WeakImplHelper1 < ::com::sun::star::accessibility::XAccessibleKeyBinding
+ > OAccessibleKeyBindingHelper_Base;
+
+ /** a helper class for implementing an accessible keybinding
+ */
+ class COMPHELPER_DLLPUBLIC OAccessibleKeyBindingHelper : public OAccessibleKeyBindingHelper_Base
+ {
+ private:
+ typedef ::std::vector< ::com::sun::star::uno::Sequence< ::com::sun::star::awt::KeyStroke > > KeyBindings;
+
+ KeyBindings m_aKeyBindings;
+
+ protected:
+ ::osl::Mutex m_aMutex;
+
+ virtual ~OAccessibleKeyBindingHelper();
+
+ public:
+ OAccessibleKeyBindingHelper();
+ OAccessibleKeyBindingHelper( const OAccessibleKeyBindingHelper& rHelper );
+
+ void AddKeyBinding( const ::com::sun::star::uno::Sequence< ::com::sun::star::awt::KeyStroke >& rKeyBinding ) throw (::com::sun::star::uno::RuntimeException);
+ void AddKeyBinding( const ::com::sun::star::awt::KeyStroke& rKeyStroke ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleKeyBinding
+ virtual sal_Int32 SAL_CALL getAccessibleKeyBindingCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::awt::KeyStroke > SAL_CALL getAccessibleKeyBinding( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ };
+
+//..............................................................................
+} // namespace comphelper
+//..............................................................................
+
+#endif // COMPHELPER_ACCESSIBLE_KEYBINDING_HELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessibleselectionhelper.hxx b/include/comphelper/accessibleselectionhelper.hxx
new file mode 100644
index 000000000000..e1bb5dd5f1ef
--- /dev/null
+++ b/include/comphelper/accessibleselectionhelper.hxx
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_ACCESSIBLE_SELECTION_HELPER_HXX
+#define COMPHELPER_ACCESSIBLE_SELECTION_HELPER_HXX
+
+#include <comphelper/uno3.hxx>
+#include <comphelper/accessiblecomponenthelper.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+#define ACCESSIBLE_SELECTION_CHILD_ALL ((sal_Int32)-1)
+#define ACCESSIBLE_SELECTION_CHILD_SELF ((sal_Int32)-2)
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OCommonAccessibleSelection
+ //=====================================================================
+ /** base class encapsulating common functionality for the helper classes implementing
+ the XAccessibleSelection
+ */
+ class COMPHELPER_DLLPUBLIC OCommonAccessibleSelection
+ {
+ protected:
+
+ OCommonAccessibleSelection();
+
+ ~OCommonAccessibleSelection();
+
+ protected:
+
+ // access to context - still waiting to be overwritten
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ implGetAccessibleContext()
+ throw ( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
+ virtual sal_Bool
+ implIsSelected( sal_Int32 nAccessibleChildIndex )
+ throw (::com::sun::star::uno::RuntimeException) = 0;
+
+ // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
+ virtual void
+ implSelect( sal_Int32 nAccessibleChildIndex, sal_Bool bSelect )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) = 0;
+
+ protected:
+
+ /** non-virtual versions of the methods which can be implemented using <method>implIsSelected</method> and <method>implSelect</method>
+ */
+ void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ };
+
+ //=====================================================================
+ //= OAccessibleSelectionHelper
+ //=====================================================================
+
+ typedef ::cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleSelection > OAccessibleSelectionHelper_Base;
+
+ /** a helper class for implementing an AccessibleSelection which at the same time
+ supports an XAccessibleSelection interface.
+ */
+ class COMPHELPER_DLLPUBLIC OAccessibleSelectionHelper : public OAccessibleComponentHelper,
+ public OCommonAccessibleSelection,
+ public OAccessibleSelectionHelper_Base
+ {
+ protected:
+
+ /// see the respective base class ctor for an extensive comment on this, please
+ OAccessibleSelectionHelper( IMutex* _pExternalLock );
+
+ // return ourself here by default
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > implGetAccessibleContext() throw ( ::com::sun::star::uno::RuntimeException );
+
+ public:
+
+ // XInterface
+ DECLARE_XINTERFACE( )
+ DECLARE_XTYPEPROVIDER( )
+
+ // XAccessibleSelection - default implementations
+ virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ };
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // COMPHELPER_ACCESSIBLE_SELECTION_HELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessibletexthelper.hxx b/include/comphelper/accessibletexthelper.hxx
new file mode 100644
index 000000000000..ea3f505ee7fe
--- /dev/null
+++ b/include/comphelper/accessibletexthelper.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 COMPHELPER_ACCESSIBLE_TEXT_HELPER_HXX
+#define COMPHELPER_ACCESSIBLE_TEXT_HELPER_HXX
+
+#include <com/sun/star/accessibility/XAccessibleText.hpp>
+#include <com/sun/star/accessibility/TextSegment.hpp>
+#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <com/sun/star/i18n/XCharacterClassification.hpp>
+#include <comphelper/accessiblecomponenthelper.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+
+//..............................................................................
+namespace comphelper
+{
+//..............................................................................
+
+ //==============================================================================
+ // OCommonAccessibleText
+ //==============================================================================
+ /** base class encapsulating common functionality for the helper classes implementing
+ the XAccessibleText
+ */
+ class COMPHELPER_DLLPUBLIC OCommonAccessibleText
+ {
+ private:
+ ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > m_xBreakIter;
+ ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XCharacterClassification > m_xCharClass;
+
+ protected:
+ OCommonAccessibleText();
+ virtual ~OCommonAccessibleText();
+
+ ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > implGetBreakIterator();
+ ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XCharacterClassification > implGetCharacterClassification();
+ sal_Bool implIsValidBoundary( ::com::sun::star::i18n::Boundary& rBoundary, sal_Int32 nLength );
+ virtual sal_Bool implIsValidIndex( sal_Int32 nIndex, sal_Int32 nLength );
+ virtual sal_Bool implIsValidRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex, sal_Int32 nLength );
+ virtual OUString implGetText() = 0;
+ virtual ::com::sun::star::lang::Locale implGetLocale() = 0;
+ virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) = 0;
+ virtual void implGetGlyphBoundary( ::com::sun::star::i18n::Boundary& rBoundary, sal_Int32 nIndex );
+ virtual sal_Bool implGetWordBoundary( ::com::sun::star::i18n::Boundary& rBoundary, sal_Int32 nIndex );
+ virtual void implGetSentenceBoundary( ::com::sun::star::i18n::Boundary& rBoundary, sal_Int32 nIndex );
+ virtual void implGetParagraphBoundary( ::com::sun::star::i18n::Boundary& rBoundary, sal_Int32 nIndex );
+ virtual void implGetLineBoundary( ::com::sun::star::i18n::Boundary& rBoundary, sal_Int32 nIndex );
+
+ /** non-virtual versions of the methods
+ */
+ sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ public:
+
+ /** Helper method, that detects the difference between
+ two strings and returns the deleted selection and
+ the inserted selection if available.
+
+ @returns true if there are differences between the
+ two strings and false if both are equal
+
+ @see ::com::sun::star::accessibility::AccessibleEventId
+ ::com::sun::star::accessibility::TextSegment
+ */
+ static bool implInitTextChangedEvent(
+ const OUString& rOldString,
+ const OUString& rNewString,
+ /*out*/ ::com::sun::star::uno::Any& rDeleted,
+ /*out*/ ::com::sun::star::uno::Any& rInserted); // throw()
+ };
+
+
+ //==============================================================================
+ // OAccessibleTextHelper
+ //==============================================================================
+
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::accessibility::XAccessibleText
+ > OAccessibleTextHelper_Base;
+
+ /** a helper class for implementing an AccessibleExtendedComponent which at the same time
+ supports an XAccessibleText interface
+ */
+ class COMPHELPER_DLLPUBLIC OAccessibleTextHelper : public OAccessibleExtendedComponentHelper,
+ public OCommonAccessibleText,
+ public OAccessibleTextHelper_Base
+ {
+ protected:
+ // see the respective base class ctor for an extensive comment on this, please
+ OAccessibleTextHelper( IMutex* _pExternalLock );
+
+ public:
+ // XInterface
+ DECLARE_XINTERFACE( )
+
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER( )
+
+ // XAccessibleText
+ virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ };
+
+//..............................................................................
+} // namespace comphelper
+//..............................................................................
+
+#endif // COMPHELPER_ACCESSIBLE_TEXT_HELPER_HXX
+
+
+// -----------------------------------------------------------------------------
+//
+// OAccessibleTextHelper is a helper class for implementing the
+// XAccessibleText interface.
+//
+// The following methods have a default implementation:
+//
+// getCharacter
+// getCharacterCount
+// getSelectedText
+// getSelectionStart
+// getSelectionEnd
+// getText
+// getTextRange
+// getTextAtIndex
+// getTextBeforeIndex
+// getTextBehindIndex
+//
+// The following methods must be overriden by derived classes:
+//
+// implGetText
+// implGetLocale
+// implGetSelection
+// getCaretPosition
+// setCaretPosition
+// getCharacterAttributes
+// getCharacterBounds
+// getIndexAtPoint
+// setSelection
+// copyText
+//
+// -----------------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessiblewrapper.hxx b/include/comphelper/accessiblewrapper.hxx
new file mode 100644
index 000000000000..fbd65d638899
--- /dev/null
+++ b/include/comphelper/accessiblewrapper.hxx
@@ -0,0 +1,410 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_ACCESSIBLE_WRAPPER_HXX
+#define COMPHELPER_ACCESSIBLE_WRAPPER_HXX
+
+#include <comphelper/proxyaggregation.hxx>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
+#include <cppuhelper/compbase3.hxx>
+#include <cppuhelper/compbase2.hxx>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/sequence.hxx>
+#include <comphelper/uno3.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/accessibleeventnotifier.hxx>
+#include <comphelper/stl_types.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+//.............................................................................
+namespace comphelper
+{
+//.............................................................................
+
+ //=========================================================================
+ //= OAccessibleWrapper
+ //=========================================================================
+
+ class OAccessibleContextWrapper;
+ class OWrappedAccessibleChildrenManager;
+
+ struct OAccessibleWrapper_Base :
+ public ::cppu::ImplHelper1 < ::com::sun::star::accessibility::XAccessible >
+ {
+ protected:
+ ~OAccessibleWrapper_Base() {}
+ };
+
+ /** a class which aggregates a proxy for an XAccessible, and wrapping the context returned by this
+ XAccessible.
+ */
+ class COMPHELPER_DLLPUBLIC OAccessibleWrapper:public OAccessibleWrapper_Base
+ ,public OComponentProxyAggregation
+
+ {
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ m_xParentAccessible;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessibleContext >
+ m_aContext;
+
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ m_xInnerAccessible;
+
+ public:
+ /** ctor
+ @param _rxContext
+ a service factory
+
+ @param _rxInnerAccessible
+ the object to wrap
+
+ @param _rxParentAccessible
+ The XAccessible which is our parent
+ */
+ OAccessibleWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxInnerAccessible,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParentAccessible
+ );
+ DECLARE_XINTERFACE()
+ DECLARE_XTYPEPROVIDER()
+
+ // returns the context without creating it
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ getContextNoCreate( ) const;
+
+ protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL
+ getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException);
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getParent() const { return m_xParentAccessible; }
+
+ // own overridables
+ virtual OAccessibleContextWrapper* createAccessibleContext(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& _rxInnerContext
+ );
+
+ protected:
+ ~OAccessibleWrapper( );
+
+ private:
+ COMPHELPER_DLLPRIVATE OAccessibleWrapper( ); // never implemented
+ COMPHELPER_DLLPRIVATE OAccessibleWrapper( const OAccessibleWrapper& ); // never implemented
+ COMPHELPER_DLLPRIVATE OAccessibleWrapper& operator=( const OAccessibleWrapper& ); // never implemented
+ };
+
+ //=========================================================================
+ //= OAccessibleContextWrapperHelper
+ //=========================================================================
+
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::accessibility::XAccessibleEventListener
+ > OAccessibleContextWrapperHelper_Base;
+
+ /** Helper for wrapping an XAccessibleContext by aggregating a proxy for it.
+
+ <p>This class does not have own ref counting. In addition, it does not implement
+ the XAccesibleContext interface, but provides all the methods from this interface
+ which must be implemented using the inner context (such as getAccessibleChild*).</p>
+
+ <p>Children of the aggregated XAccessibleContext are wrapped, too.</p>
+
+ <p>AccessibleEvents fired by the inner context are multiplexed, especially, any references to
+ children in such events are translated. This means that even in such events, no un-wrapped object
+ will ever leave this class - if the aggregated context notifies an child event, the child passed
+ to the event is wrapped</p>
+
+ @seealso OAccessibleContextWrapper
+ */
+ class COMPHELPER_DLLPUBLIC OAccessibleContextWrapperHelper
+ :private OComponentProxyAggregationHelper
+ ,public OAccessibleContextWrapperHelper_Base
+ {
+ protected:
+ /// the context we're wrapping (properly typed, in opposite to OComponentProxyAggregationHelper::m_xInner)
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ m_xInnerContext;
+ /// the XAccessible which created this context
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ m_xOwningAccessible;
+ /// the XAccessible which is to be returned in getAccessibleParent
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ m_xParentAccessible;
+
+ OWrappedAccessibleChildrenManager* m_pChildMapper; // for mapping children from our inner context to our callers
+
+ protected:
+ /** ctor
+
+ @param _rxContext
+ a service factory
+
+ @param _rxInnerAccessibleContext
+ the object to wrap
+
+ @param _rxOwningAccessible
+ The XAccessible which created this object. This is necessary because children
+ of our wrapped context meed to be wrapped, too, and if they're asked for a parent,
+ they of course should return the proper parent<br/>
+ The object will be held with a hard reference
+
+ @param _rxParentAccessible
+ The XAccessible to return in the getAccessibleParent call
+ */
+ OAccessibleContextWrapperHelper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ ::cppu::OBroadcastHelper& _rBHelper,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& _rxInnerAccessibleContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxOwningAccessible,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParentAccessible
+ );
+
+ /// to be called from within your ctor - does the aggregation of a proxy for m_xInnerContext
+ void aggregateProxy(
+ oslInterlockedCount& _rRefCount,
+ ::cppu::OWeakObject& _rDelegator
+ );
+
+ protected:
+ // XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER( )
+
+ // XAccessibleContext
+ virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleEventListener
+ virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent/OComponentProxyAggregationHelper
+ virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
+
+ // own overridables
+ /** notify an accessible event which has been translated (if necessary)
+
+ <p>Usually, you derive your clas from both OAccessibleContextWrapperHelper and XAccessibleEventBroadcaster,
+ and simply call all your XAccessibleEventListener with the given event.</p>
+
+ <p>The mutex of the BroadcastHelper passed to the instance's ctor is <em>not</em> locked when calling
+ into this method</p>
+ */
+ virtual void notifyTranslatedEvent( const ::com::sun::star::accessibility::AccessibleEventObject& _rEvent ) throw (::com::sun::star::uno::RuntimeException) = 0;
+
+ protected:
+ ~OAccessibleContextWrapperHelper( );
+
+ OAccessibleContextWrapperHelper( ); // never implemented
+ OAccessibleContextWrapperHelper( const OAccessibleContextWrapperHelper& ); // never implemented
+ OAccessibleContextWrapperHelper& operator=( const OAccessibleContextWrapperHelper& ); // never implemented
+ };
+
+ //=========================================================================
+ //= OAccessibleContextWrapper
+ //=========================================================================
+ typedef ::cppu::PartialWeakComponentImplHelper2< ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ , ::com::sun::star::accessibility::XAccessibleContext
+ > OAccessibleContextWrapper_CBase;
+
+ class COMPHELPER_DLLPUBLIC OAccessibleContextWrapper
+ :public OBaseMutex
+ ,public OAccessibleContextWrapper_CBase
+ ,public OAccessibleContextWrapperHelper
+ {
+ private:
+ ::comphelper::AccessibleEventNotifier::TClientId m_nNotifierClient; // for notifying AccessibleEvents
+
+ public:
+ /** ctor
+
+ @param _rxContext
+ a service factory
+
+ @param _rxInnerAccessibleContext
+ the object to wrap
+
+ @param _rxOwningAccessible
+ The XAccessible which created this object. This is necessary because children
+ of our wrapped context meed to be wrapped, too, and if they're asked for a parent,
+ they of course should return the proper parent<br/>
+ The object will be held with a hard reference
+
+ @param _rxParentAccessible
+ The XAccessible to return in the getAccessibleParent call
+ */
+ OAccessibleContextWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& _rxInnerAccessibleContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxOwningAccessible,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParentAccessible
+ );
+
+ // XInterface
+ DECLARE_XINTERFACE( )
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER( )
+
+ // XAccessibleContext
+ virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleEventBroadcaster
+ virtual void SAL_CALL addAccessibleEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeAccessibleEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // OAccessibleContextWrapper
+ virtual void notifyTranslatedEvent( const ::com::sun::star::accessibility::AccessibleEventObject& _rEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
+ { WeakComponentImplHelperBase::addEventListener(xListener); }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
+ { WeakComponentImplHelperBase::removeEventListener(xListener); }
+
+ // OComponentHelper
+ using OAccessibleContextWrapperHelper::disposing;
+ virtual void SAL_CALL disposing() throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ virtual ~OAccessibleContextWrapper();
+
+ private:
+ COMPHELPER_DLLPRIVATE OAccessibleContextWrapper(); // never implemented
+ COMPHELPER_DLLPRIVATE OAccessibleContextWrapper( const OAccessibleContextWrapper& ); // never implemented
+ COMPHELPER_DLLPRIVATE OAccessibleContextWrapper& operator=( const OAccessibleContextWrapper& ); // never implemented
+ };
+
+ //=========================================================================
+ //= OWrappedAccessibleChildrenManager
+ //=========================================================================
+
+ typedef ::std::map < ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ , ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ , OInterfaceCompare< ::com::sun::star::accessibility::XAccessible >
+ > AccessibleMap;
+ // TODO: think about if we should hold these objects weak
+
+ typedef ::cppu::WeakImplHelper1 < ::com::sun::star::lang::XEventListener
+ > OWrappedAccessibleChildrenManager_Base;
+ /** manages wrapping XAccessible's to XAccessible's
+ */
+ class COMPHELPER_DLLPUBLIC OWrappedAccessibleChildrenManager : public OWrappedAccessibleChildrenManager_Base
+ {
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ m_xContext;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible >
+ m_aOwningAccessible; // the XAccessible which belongs to the XAccessibleContext which we work for
+ AccessibleMap m_aChildrenMap; // for caching children
+ sal_Bool m_bTransientChildren; // are we prohibited to cache our children?
+
+ public:
+ /// ctor
+ OWrappedAccessibleChildrenManager(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
+ );
+
+ /** specifies if the children are to be consideren transient (i.e.: not cached)
+ <p>to be called only once per lifetime</p>
+ */
+ void setTransientChildren( sal_Bool _bSet = sal_True );
+
+ /** sets the XAccessible which belongs to the XAccessibleContext which we work for
+ <p>to be called only once per lifetime</p>
+ */
+ void setOwningAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxAcc );
+
+ /// retrieves a wrapper for the given accessible
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getAccessibleWrapperFor(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxKey,
+ sal_Bool _bCreate = sal_True
+ );
+
+ /// erases the given key from the map (if it is present there)
+ void removeFromCache( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxKey );
+
+ /// invalidates (i.e. empties) the map
+ void invalidateAll( );
+
+ /** disposes (i.e. cleares) the manager
+
+ <p>Note that the XAccessibleContext's of the mapped XAccessible objects are disposed, too.</p>
+ */
+ void dispose();
+
+ /** handles a notification as got from the parent of the children we're managing
+ <p>This applies only to the notifications which have a direct impact on our map.</p>
+ */
+ void handleChildNotification( const ::com::sun::star::accessibility::AccessibleEventObject& _rEvent );
+
+ /** translates events as got from the parent of the children we're managing
+ <p>This applies only to the notifications which deal with child objects which we manage.</p>
+ */
+ void translateAccessibleEvent(
+ const ::com::sun::star::accessibility::AccessibleEventObject& _rEvent,
+ ::com::sun::star::accessibility::AccessibleEventObject& _rTranslatedEvent
+ );
+
+ protected:
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ void implTranslateChildEventValue( const ::com::sun::star::uno::Any& _rInValue, ::com::sun::star::uno::Any& _rOutValue );
+
+ protected:
+ ~OWrappedAccessibleChildrenManager( );
+
+ private:
+ COMPHELPER_DLLPRIVATE OWrappedAccessibleChildrenManager( ); // never implemented
+ COMPHELPER_DLLPRIVATE OWrappedAccessibleChildrenManager( const OWrappedAccessibleChildrenManager& ); // never implemented
+ COMPHELPER_DLLPRIVATE OWrappedAccessibleChildrenManager& operator=( const OWrappedAccessibleChildrenManager& ); // never implemented
+ };
+
+//.............................................................................
+} // namespace accessibility
+//.............................................................................
+
+#endif // COMPHELPER_ACCESSIBLE_WRAPPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accimplaccess.hxx b/include/comphelper/accimplaccess.hxx
new file mode 100644
index 000000000000..3407c5a7b8b4
--- /dev/null
+++ b/include/comphelper/accimplaccess.hxx
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_ACCIMPLACCESS_HXX
+#define COMPHELPER_ACCIMPLACCESS_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+// forward declaration
+namespace com { namespace sun { namespace star { namespace accessibility {
+ class XAccessible;
+ class XAccessibleContext;
+}}}}
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OAccessibleImplementationAccess
+ //=====================================================================
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::lang::XUnoTunnel
+ > OAccImpl_Base;
+ struct OAccImpl_Impl;
+
+ /** This is a helper class which allows accessing several aspects of the implementation
+ of an AccessibleContext.
+
+ <p>For instance, when you want to implement a context which can be re-parented, you:
+ <ul><li>derive your class from <type>OAccessibleImplementationAccess</type></li>
+ <li>use <code>setAccessibleParent( <em>component</em>, <em>new_parent</em> )</code>
+ </ul>
+ </p>
+
+ <p>Another aspect which can be controlled from the outside are states. If you have a class which
+ has only partial control over it's states, you may consider deriving from OAccessibleImplementationAccess.<br/>
+ For instance, say you have an implementation (say component A) which is <em>unable</em> to know or to
+ determine if the represented object is selected, but another component (say B) which uses A (and integrates
+ it into a tree of accessibility components) is.<br/>
+ In this case, if A is derived from OAccessibleImplementationAccess, B can manipulate this
+ foreign-controlled state flag "SELECTED" by using the static helper methods on this class.</p>
+
+ <p>Please note that the support for foreign controlled states is rather restrictive: You can't have states
+ which <em>may be</em> controlled by a foreign instances. This is implied by the fact that a derived
+ class can ask for states which are <em>set</em> only, not for the ones which are <em>reset</em> currently.
+ </p>
+ */
+ class COMPHELPER_DLLPUBLIC OAccessibleImplementationAccess : public OAccImpl_Base
+ {
+ private:
+ OAccImpl_Impl* m_pImpl;
+
+ protected:
+ /// retrieves the parent previously set via <method>setAccessibleParent</method>
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ implGetForeignControlledParent( ) const;
+
+ /** retrieves the set of currently set states which are controlled by a foreign instance
+ @return
+ a bit mask, where a set bit 2^n means that the AccessibleStateType n has been set
+ */
+ sal_Int64 implGetForeignControlledStates( ) const;
+
+ /// sets the accessible parent component
+ virtual void setAccessibleParent(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxAccParent );
+
+ /// sets or resets a bit of the foreign controlled states
+ virtual void setStateBit( const sal_Int16 _nState, const sal_Bool _bSet );
+
+ protected:
+ OAccessibleImplementationAccess( );
+ virtual ~OAccessibleImplementationAccess( );
+
+ // XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& _rIdentifier ) throw (::com::sun::star::uno::RuntimeException);
+
+ public:
+ /** tries to access the implementation of an OAccessibleImplementationAccess derivee which is known as
+ interface only.
+
+ @param _rxComponent
+ is the component which should be examined.
+ @return
+ the pointer to the implementation, if successful. The only known error condition so far
+ is an invalid context (which means it is <NULL/>, or the implementation is not derived
+ from <type>OAccessibleImplementationAccess</type>, or retrieving the implementation failed).
+ */
+ static OAccessibleImplementationAccess* getImplementation(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& _rxComponent
+ );
+
+
+ /** sets the parent for a derived implementation
+
+ @param _rxComponent
+ is the component which's new parent should be set
+ @param _rxNewParent
+ is the new parent of the component
+ @return
+ <TRUE/> in case of success, <FALSE/> otherwise. For error condition please look at
+ <method>getImplementation</method>.
+ */
+ static sal_Bool setAccessibleParent(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& _rxComponent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxNewParent
+ );
+
+
+ private:
+ COMPHELPER_DLLPRIVATE static const ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+ };
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+
+#endif // COMPHELPER_ACCIMPLACCESS_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/anycompare.hxx b/include/comphelper/anycompare.hxx
new file mode 100644
index 000000000000..fb17b7ca67ec
--- /dev/null
+++ b/include/comphelper/anycompare.hxx
@@ -0,0 +1,219 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_ANYCOMPARE_HXX
+#define COMPHELPER_ANYCOMPARE_HXX
+
+#include "comphelper/comphelperdllapi.h"
+
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/i18n/XCollator.hpp>
+
+#include <comphelper/extract.hxx>
+
+#include <functional>
+#include <memory>
+
+//......................................................................................................................
+namespace comphelper
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= IKeyPredicateLess
+ //==================================================================================================================
+ class SAL_NO_VTABLE IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const = 0;
+ virtual ~IKeyPredicateLess() {}
+ };
+
+ //==================================================================================================================
+ //= LessPredicateAdapter
+ //==================================================================================================================
+ struct LessPredicateAdapter : public ::std::binary_function< ::com::sun::star::uno::Any, ::com::sun::star::uno::Any, bool >
+ {
+ LessPredicateAdapter( const IKeyPredicateLess& _predicate )
+ :m_predicate( _predicate )
+ {
+ }
+
+ bool operator()( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ return m_predicate.isLess( _lhs, _rhs );
+ }
+
+ private:
+ IKeyPredicateLess const & m_predicate;
+
+ private:
+ LessPredicateAdapter(); // never implemented
+ };
+
+ //==================================================================================================================
+ //= ScalarPredicateLess
+ //==================================================================================================================
+ template< typename SCALAR >
+ class ScalarPredicateLess : public IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ SCALAR lhs(0), rhs(0);
+ if ( !( _lhs >>= lhs )
+ || !( _rhs >>= rhs )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return lhs < rhs;
+ }
+ };
+
+ //==================================================================================================================
+ //= StringPredicateLess
+ //==================================================================================================================
+ class StringPredicateLess : public IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ OUString lhs, rhs;
+ if ( !( _lhs >>= lhs )
+ || !( _rhs >>= rhs )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return lhs < rhs;
+ }
+ };
+
+ //==================================================================================================================
+ //= StringCollationPredicateLess
+ //==================================================================================================================
+ class StringCollationPredicateLess : public IKeyPredicateLess
+ {
+ public:
+ StringCollationPredicateLess( ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > const & i_collator )
+ :m_collator( i_collator )
+ {
+ }
+
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ OUString lhs, rhs;
+ if ( !( _lhs >>= lhs )
+ || !( _rhs >>= rhs )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return m_collator->compareString( lhs, rhs ) < 0;
+ }
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > const m_collator;
+ };
+
+ //==================================================================================================================
+ //= TypePredicateLess
+ //==================================================================================================================
+ class TypePredicateLess : public IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ ::com::sun::star::uno::Type lhs, rhs;
+ if ( !( _lhs >>= lhs )
+ || !( _rhs >>= rhs )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return lhs.getTypeName() < rhs.getTypeName();
+ }
+ };
+
+ //==================================================================================================================
+ //= EnumPredicateLess
+ //==================================================================================================================
+ class EnumPredicateLess : public IKeyPredicateLess
+ {
+ public:
+ EnumPredicateLess( ::com::sun::star::uno::Type const & _enumType )
+ :m_enumType( _enumType )
+ {
+ }
+
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ sal_Int32 lhs(0), rhs(0);
+ if ( !::cppu::enum2int( lhs, _lhs )
+ || !::cppu::enum2int( rhs, _rhs )
+ || !_lhs.getValueType().equals( m_enumType )
+ || !_rhs.getValueType().equals( m_enumType )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return lhs < rhs;
+ }
+
+ private:
+ ::com::sun::star::uno::Type const m_enumType;
+ };
+
+ //==================================================================================================================
+ //= InterfacePredicateLess
+ //==================================================================================================================
+ class InterfacePredicateLess : public IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ if ( ( _lhs.getValueTypeClass() != ::com::sun::star::uno::TypeClass_INTERFACE )
+ || ( _rhs.getValueTypeClass() != ::com::sun::star::uno::TypeClass_INTERFACE )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > lhs( _lhs, ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > rhs( _rhs, ::com::sun::star::uno::UNO_QUERY );
+ return lhs.get() < rhs.get();
+ }
+ };
+
+ //==================================================================================================================
+ //= getStandardLessPredicate
+ //==================================================================================================================
+ /** creates a default IKeyPredicateLess instance for the given UNO type
+ @param i_type
+ the type for which a predicate instance should be created
+ @param i_collator
+ specifies a collator instance to use, or <NULL/>. If <NULL/>, strings will be compared using the <code>&lt</code>
+ operator, otherwise the collator will be used. The parameter is ignored if <arg>i_type</arg> does not specify
+ the string type.
+ @return
+ a default implementation of IKeyPredicateLess, which is able to compare values of the given type. If no
+ such default implementation is known for the given type, then <NULL/> is returned.
+ */
+ ::std::auto_ptr< IKeyPredicateLess > COMPHELPER_DLLPUBLIC
+ getStandardLessPredicate(
+ ::com::sun::star::uno::Type const & i_type,
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > const & i_collator
+ );
+
+//......................................................................................................................
+} // namespace comphelper
+//......................................................................................................................
+
+#endif // COMPHELPER_ANYCOMPARE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/anytostring.hxx b/include/comphelper/anytostring.hxx
new file mode 100644
index 000000000000..e68779854292
--- /dev/null
+++ b/include/comphelper/anytostring.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_COMPHELPER_ANYTOSTRING_HXX
+#define INCLUDED_COMPHELPER_ANYTOSTRING_HXX
+
+#include "rtl/ustring.hxx"
+#include "com/sun/star/uno/Any.hxx"
+#include "comphelper/comphelperdllapi.h"
+
+namespace comphelper
+{
+
+/** Creates a STRING representation out of an ANY value.
+
+ @param value
+ ANY value
+ @return
+ STRING representation of given ANY value
+*/
+COMPHELPER_DLLPUBLIC OUString anyToString( ::com::sun::star::uno::Any const & value );
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/asyncnotification.hxx b/include/comphelper/asyncnotification.hxx
new file mode 100644
index 000000000000..19c1910dbc8f
--- /dev/null
+++ b/include/comphelper/asyncnotification.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 COMPHELPER_ASYNCNOTIFICATION_HXX
+#define COMPHELPER_ASYNCNOTIFICATION_HXX
+
+#include "sal/config.h"
+
+#include "boost/scoped_ptr.hpp"
+#include "comphelper/comphelperdllapi.h"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+#include "salhelper/thread.hxx"
+
+//........................................................................
+namespace comphelper
+{
+//........................................................................
+
+ //====================================================================
+ //= AnyEvent
+ //====================================================================
+ /** the very basic instance to hold a description of an event
+ */
+ class COMPHELPER_DLLPUBLIC AnyEvent : ::rtl::IReference
+ {
+ private:
+ oslInterlockedCount m_refCount;
+
+ public:
+ AnyEvent();
+
+ virtual oslInterlockedCount SAL_CALL acquire();
+ virtual oslInterlockedCount SAL_CALL release();
+
+ protected:
+ virtual ~AnyEvent();
+
+ private:
+ AnyEvent( AnyEvent& ); // not defined
+ void operator=( AnyEvent& ); // not defined
+ };
+
+ //====================================================================
+ //= typedefs
+ //====================================================================
+ typedef ::rtl::Reference< AnyEvent > AnyEventRef;
+
+ //====================================================================
+ //= IEventProcessor
+ //====================================================================
+ /** an event processor
+
+ @see AsyncEventNotifier
+ */
+ class SAL_NO_VTABLE IEventProcessor
+ {
+ public:
+ /** process a single event
+ */
+ virtual void processEvent( const AnyEvent& _rEvent ) = 0;
+
+ virtual void SAL_CALL acquire() = 0;
+ virtual void SAL_CALL release() = 0;
+
+ protected:
+ ~IEventProcessor() {}
+ };
+
+ //====================================================================
+ //= AsyncEventNotifier
+ //====================================================================
+ struct EventNotifierImpl;
+
+ /** a helper class for notifying events asynchronously
+
+ If you need to notify certain events to external components, you usually should
+ not do this while you have mutexes locked, to prevent multi-threading issues.
+
+ However, you do not always have complete control over all mutex guards on the stack.
+ If, in such a case, the listener notification is one-way, you can decide to do it
+ asynchronously.
+
+ The ->AsyncEventNotifier helps you to process such events asynchronously. Every
+ event is tied to an ->IEventProcessor which is responsible for processing it.
+
+ The AsyncEventNotifier is implemented as a thread itself, which sleeps as long as there are no
+ events in the queue. As soon as you add an event, the thread is woken up, processes the event,
+ and sleeps again.
+ */
+ class COMPHELPER_DLLPUBLIC AsyncEventNotifier: public salhelper::Thread
+ {
+ friend struct EventNotifierImpl;
+
+ private:
+ boost::scoped_ptr< EventNotifierImpl > m_pImpl;
+
+ SAL_DLLPRIVATE virtual ~AsyncEventNotifier();
+
+ // Thread
+ SAL_DLLPRIVATE virtual void execute();
+
+ public:
+ /** constructs a notifier thread
+
+ @param name the thread name, see ::osl_setThreadName; must not be
+ null
+ */
+ AsyncEventNotifier(char const * name);
+
+ /** terminates the thread
+
+ Note that this is a cooporative termination - if you call this from a thread different
+ from the notification thread itself, then it will block until the notification thread
+ finished processing the current event. If you call it from the notification thread
+ itself, it will return immediately, and the thread will be terminated as soon as
+ the current notification is finished.
+ */
+ virtual void SAL_CALL terminate();
+
+ /** adds an event to the queue, together with the instance which is responsible for
+ processing it
+
+ @param _rEvent
+ the event to add to the queue
+ @param _xProcessor
+ the processor for the event.<br/>
+ Beware of life time issues here. If your event processor dies or becomes otherwise
+ nonfunctional, you are responsible for removing all respective events from the queue.
+ You can do this by calling ->removeEventsForProcessor
+ */
+ void addEvent( const AnyEventRef& _rEvent, const ::rtl::Reference< IEventProcessor >& _xProcessor );
+
+ /** removes all events for the given event processor from the queue
+ */
+ void removeEventsForProcessor( const ::rtl::Reference< IEventProcessor >& _xProcessor );
+ };
+
+ //====================================================================
+ //= EventHolder
+ //====================================================================
+ /** AnyEvent derivee holding an foreign event instance
+ */
+ template < typename EVENT_OBJECT >
+ class EventHolder : public AnyEvent
+ {
+ public:
+ typedef EVENT_OBJECT EventObjectType;
+
+ private:
+ EventObjectType m_aEvent;
+
+ public:
+ inline EventHolder( const EventObjectType& _rEvent )
+ :m_aEvent( _rEvent )
+ {
+ }
+
+ inline const EventObjectType& getEventObject() const { return m_aEvent; }
+ };
+
+//........................................................................
+} // namespace comphelper
+//........................................................................
+
+#endif // COMPHELPER_ASYNCNOTIFICATION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/attributelist.hxx b/include/comphelper/attributelist.hxx
new file mode 100644
index 000000000000..dd10e13c70ab
--- /dev/null
+++ b/include/comphelper/attributelist.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 _COMPHELPER_ATTRIBUTE_LIST_HXX
+#define _COMPHELPER_ATTRIBUTE_LIST_HXX
+
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/comphelperdllapi.h>
+
+
+namespace comphelper
+{
+
+struct AttributeList_Impl;
+
+class COMPHELPER_DLLPUBLIC AttributeList : public ::cppu::WeakImplHelper1
+<
+ ::com::sun::star::xml::sax::XAttributeList
+>
+{
+ AttributeList_Impl *m_pImpl;
+public:
+ AttributeList();
+ virtual ~AttributeList();
+
+ // methods that are not contained in any interface
+ void AddAttribute( const OUString &sName , const OUString &sType , const OUString &sValue );
+
+ // ::com::sun::star::xml::sax::XAttributeList
+ virtual sal_Int16 SAL_CALL getLength(void)
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL getNameByIndex(sal_Int16 i)
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL getTypeByIndex(sal_Int16 i)
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL getTypeByName(const OUString& aName)
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL getValueByIndex(sal_Int16 i)
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL getValueByName(const OUString& aName)
+ throw( ::com::sun::star::uno::RuntimeException );
+
+};
+
+} // namespace comphelper
+
+#endif // _COMPHELPER_ATTRIBUTE_LIST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/basicio.hxx b/include/comphelper/basicio.hxx
new file mode 100644
index 000000000000..42eea8076e47
--- /dev/null
+++ b/include/comphelper/basicio.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 _COMPHELPER_BASIC_IO_HXX_
+#define _COMPHELPER_BASIC_IO_HXX_
+
+#include <com/sun/star/io/XPersistObject.hpp>
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+namespace stario = ::com::sun::star::io;
+namespace staruno = ::com::sun::star::uno;
+namespace starawt = ::com::sun::star::awt;
+
+// sal_Bool
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_Bool& _rVal);
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_Bool _bVal);
+
+// OUString
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, OUString& _rStr);
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, const OUString& _rStr);
+
+// sal_Int16
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_Int16& _rValue);
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_Int16 _nValue);
+
+// sal_uInt16
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_uInt16& _rValue);
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_uInt16 _nValue);
+
+// sal_uInt32
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_uInt32& _rValue);
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_uInt32 _nValue);
+
+// sal_Int16
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_Int32& _rValue);
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_Int32 _nValue);
+
+// FontDescriptor
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& InStream, starawt::FontDescriptor& rVal);
+COMPHELPER_DLLPUBLIC const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& OutStream, const starawt::FontDescriptor& rVal);
+
+// sequences
+template <class ELEMENT>
+const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, staruno::Sequence<ELEMENT>& _rSeq)
+{
+ sal_Int32 nLen = _rxInStream->readLong();
+ _rSeq.realloc(nLen);
+ if (nLen)
+ {
+ ELEMENT* pElement = _rSeq.getArray();
+ for (sal_Int32 i=0; i<nLen; ++i, ++pElement)
+ _rxInStream >> *pElement;
+ }
+ return _rxInStream;
+}
+
+template <class ELEMENT>
+const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, const staruno::Sequence<ELEMENT>& _rSeq)
+{
+ sal_Int32 nLen = _rSeq.getLength();
+ _rxOutStream->writeLong(nLen);
+ if (nLen)
+ {
+ const ELEMENT* pElement = _rSeq.getConstArray();
+ for (sal_Int32 i = 0; i < nLen; ++i, ++pElement)
+ _rxOutStream << *pElement;
+ }
+ return _rxOutStream;
+}
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // _COMPHELPER_BASIC_IO_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/broadcasthelper.hxx b/include/comphelper/broadcasthelper.hxx
new file mode 100644
index 000000000000..d8cf69eeb17b
--- /dev/null
+++ b/include/comphelper/broadcasthelper.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 _COMPHELPER_BROADCASTHELPER_HXX_
+#define _COMPHELPER_BROADCASTHELPER_HXX_
+
+#include <osl/mutex.hxx>
+#include <cppuhelper/interfacecontainer.h>
+
+//... namespace comphelper .......................................................
+namespace comphelper
+{
+//.........................................................................
+
+ //==================================================================================
+ //= OMutexAndBroadcastHelper - a class which holds a Mutex and a OBroadcastHelper;
+ //= needed because when deriving from OPropertySetHelper,
+ //= the OBroadcastHelper has to be initialized before
+ //= the OPropertySetHelper
+ //==================================================================================
+ class OMutexAndBroadcastHelper
+ {
+ protected:
+ ::osl::Mutex m_aMutex;
+ ::cppu::OBroadcastHelper m_aBHelper;
+
+ public:
+ OMutexAndBroadcastHelper() : m_aBHelper( m_aMutex ) { }
+
+ ::osl::Mutex& GetMutex() { return m_aMutex; }
+ ::cppu::OBroadcastHelper& GetBroadcastHelper() { return m_aBHelper; }
+ const ::cppu::OBroadcastHelper& GetBroadcastHelper() const { return m_aBHelper; }
+
+ };
+
+ // base class for all classes who are derived from OPropertySet and from OComponent
+ // @deprecated, you should use cppu::BaseMutex instead (cppuhelper/basemutex.hxx)
+
+ class OBaseMutex
+ {
+ protected:
+ mutable ::osl::Mutex m_aMutex;
+ };
+}
+#endif // _COMPHELPER_BROADCASTHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/classids.hxx b/include/comphelper/classids.hxx
new file mode 100644
index 000000000000..39ab6095802e
--- /dev/null
+++ b/include/comphelper/classids.hxx
@@ -0,0 +1,388 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _COMPHELPER_CLASSIDS_HXX
+#define _COMPHELPER_CLASSIDS_HXX
+
+/*
+ * StarWriter
+ */
+
+/* 3.0 */
+
+#define SO3_SW_CLASSID_30 \
+ 0xDC5C7E40L, 0xB35C, 0x101B, 0x99, 0x61, 0x04, \
+ 0x02, 0x1C, 0x00, 0x70, 0x02
+
+/* 4.0 */
+
+#define SO3_SW_CLASSID_40 \
+ 0x8b04e9b0, 0x420e, 0x11d0, 0xa4, 0x5e, 0x0, \
+ 0xa0, 0x24, 0x9d, 0x57, 0xb1
+
+/* 5.0 */
+
+#define SO3_SW_CLASSID_50 \
+ 0xc20cf9d1, 0x85ae, 0x11d1, 0xaa, 0xb4, 0x0, \
+ 0x60, 0x97, 0xda, 0x56, 0x1a
+
+ /* 6.0, 7, 8 */
+
+#define SO3_SW_CLASSID_60 \
+ 0x8BC6B165, 0xB1B2, 0x4EDD, 0xAA, 0x47, 0xDA, \
+ 0xE2, 0xEE, 0x68, 0x9D, 0xD6
+
+ /* ole embed 6.0, 7 */
+
+#define SO3_SW_OLE_EMBED_CLASSID_60 \
+ 0x30a2652a, 0xddf7, 0x45e7, 0xac, 0xa6, 0x3e, \
+ 0xab, 0x26, 0xfc, 0x8a, 0x4e
+
+ /* ole embed 8 */
+
+#define SO3_SW_OLE_EMBED_CLASSID_8 \
+ 0xf616b81f, 0x7bb8, 0x4f22, 0xb8, 0xa5, 0x47, \
+ 0x42, 0x8d, 0x59, 0xf8, 0xad
+
+/* aktuell */
+
+#define SO3_SW_CLASSID SO3_SW_CLASSID_60
+
+/*
+ * StarWriter/Web
+ */
+
+/* 4.0 */
+
+#define SO3_SWWEB_CLASSID_40 \
+ 0xf0caa840, 0x7821, 0x11d0, 0xa4, 0xa7, 0x0, \
+ 0xa0, 0x24, 0x9d, 0x57, 0xb1
+
+/* 5.0 */
+
+#define SO3_SWWEB_CLASSID_50 \
+ 0xc20cf9d2, 0x85ae, 0x11d1, 0xaa, 0xb4, 0x0, \
+ 0x60, 0x97, 0xda, 0x56, 0x1a
+
+/* 6.0, 7, 8 */
+
+#define SO3_SWWEB_CLASSID_60 \
+ 0xA8BBA60C, 0x7C60, 0x4550, 0x91, 0xCE, 0x39, \
+ 0xC3, 0x90, 0x3F, 0xAC, 0x5E
+
+/* aktuell */
+
+#define SO3_SWWEB_CLASSID SO3_SWWEB_CLASSID_60
+
+/*
+ * Globaldokument
+ */
+
+/* 4.0 */
+
+#define SO3_SWGLOB_CLASSID_40 \
+ 0x340ac970, 0xe30d, 0x11d0, 0xa5, 0x3f, 0x0, \
+ 0xa0, 0x24, 0x9d, 0x57, 0xb1
+
+/* 5.0 */
+
+#define SO3_SWGLOB_CLASSID_50 \
+ 0xc20cf9d3, 0x85ae, 0x11d1, 0xaa, 0xb4, 0x0, \
+ 0x60, 0x97, 0xda, 0x56, 0x1a
+
+/* 6.0, 7, 8 */
+
+#define SO3_SWGLOB_CLASSID_60 \
+ 0xB21A0A7C, 0xE403, 0x41FE, 0x95, 0x62, 0xBD, \
+ 0x13, 0xEA, 0x6F, 0x15, 0xA0
+
+/* aktuell */
+
+#define SO3_SWGLOB_CLASSID SO3_SWGLOB_CLASSID_60
+
+//---------------------------------------------------
+
+/*
+ * StarCalc
+ */
+
+/* 3.0 */
+
+#define SO3_SC_CLASSID_30 \
+ 0x3F543FA0L, 0xB6A6, 0x101B, 0x99, 0x61, 0x04, \
+ 0x02, 0x1C, 0x00, 0x70, 0x02
+
+/* 4.0 */
+
+#define SO3_SC_CLASSID_40 \
+ 0x6361d441L, 0x4235, 0x11d0, 0x89, 0xcb, 0x00, \
+ 0x80, 0x29, 0xe4, 0xb0, 0xb1
+
+/* 5.0 */
+
+#define SO3_SC_CLASSID_50 \
+ 0xc6a5b861L, 0x85d6, 0x11d1, 0x89, 0xcb, 0x00, \
+ 0x80, 0x29, 0xe4, 0xb0, 0xb1
+
+/* 6.0 */
+
+#define SO3_SC_CLASSID_60 \
+ 0x47BBB4CB, 0xCE4C, 0x4E80, 0xA5, 0x91, 0x42, \
+ 0xD9, 0xAE, 0x74, 0x95, 0x0F
+
+/* ole embed 6.0, 7 */
+
+#define SO3_SC_OLE_EMBED_CLASSID_60 \
+ 0x7b342dc4, 0x139a, 0x4a46, 0x8a, 0x93, 0xdb, \
+ 0x8, 0x27, 0xcc, 0xee, 0x9c
+
+/* ole embed 8 */
+
+#define SO3_SC_OLE_EMBED_CLASSID_8 \
+ 0x7fa8ae11, 0xb3e3, 0x4d88, 0xaa, 0xbf, 0x25, \
+ 0x55, 0x26, 0xcd, 0x1c, 0xe8
+
+/* aktuell */
+
+#define SO3_SC_CLASSID SO3_SC_CLASSID_60
+
+/****************************************************
+* StarImpress
+****************************************************/
+
+/* 3.0 */
+
+#define SO3_SIMPRESS_CLASSID_30 \
+ 0xAF10AAE0L, 0xB36D, 0x101B, 0x99, 0x61, 0x04, \
+ 0x02, 0x1C, 0x00, 0x70, 0x02
+
+/* 4.0 */
+
+#define SO3_SIMPRESS_CLASSID_40 \
+ 0x12d3cc0L, 0x4216, 0x11d0, 0x89, 0xcb, 0x0, \
+ 0x80, 0x29, 0xe4, 0xb0, 0xb1
+
+/* 5.0 */
+
+#define SO3_SIMPRESS_CLASSID_50 \
+ 0x565c7221L, 0x85bc, 0x11d1, 0x89, 0xd0, 0x0, \
+ 0x80, 0x29, 0xe4, 0xb0, 0xb1
+
+/* 6.0 */
+
+#define SO3_SIMPRESS_CLASSID_60 \
+ 0x9176E48A, 0x637A, 0x4D1F, 0x80, 0x3B, 0x99, \
+ 0xD9, 0xBF, 0xAC, 0x10, 0x47
+
+/* ole embed 6.0, 7 */
+
+#define SO3_SIMPRESS_OLE_EMBED_CLASSID_60 \
+ 0xe5a0b632, 0xdfba, 0x4549, 0x93, 0x46, 0xe4, \
+ 0x14, 0xda, 0x6, 0xe6, 0xf8
+
+/* ole embed 8 */
+
+#define SO3_SIMPRESS_OLE_EMBED_CLASSID_8 \
+ 0xee5d1ea4, 0xd445, 0x4289, 0xb2, 0xfc, 0x55, \
+ 0xfc, 0x93, 0x69, 0x39, 0x17
+
+/* aktuell */
+
+#define SO3_SIMPRESS_CLASSID SO3_SIMPRESS_CLASSID_60
+
+/****************************************************
+* StarDraw
+****************************************************/
+
+/* 5.0 */
+
+#define SO3_SDRAW_CLASSID_50 \
+ 0x2e8905a0L, 0x85bd, 0x11d1, 0x89, 0xd0, 0x0, \
+ 0x80, 0x29, 0xe4, 0xb0, 0xb1
+
+/* 6.0 */
+#define SO3_SDRAW_CLASSID_60 \
+ 0x4BAB8970, 0x8A3B, 0x45B3, 0x99, 0x1C, 0xCB, \
+ 0xEE, 0xAC, 0x6B, 0xD5, 0xE3
+
+/* ole embed 6.0, 7 */
+
+#define SO3_SDRAW_OLE_EMBED_CLASSID_60 \
+ 0x41662fc2, 0xd57, 0x4aff, 0xab, 0x27, 0xad, \
+ 0x2e, 0x12, 0xe7, 0xc2, 0x73
+
+/* ole embed 8 */
+
+#define SO3_SDRAW_OLE_EMBED_CLASSID_8 \
+ 0x448bb771, 0xcfe2, 0x47c4, 0xbc, 0xdf, 0x1f, \
+ 0xbf, 0x37, 0x8e, 0x20, 0x2c
+
+/* aktuell */
+
+#define SO3_SDRAW_CLASSID SO3_SDRAW_CLASSID_60
+
+/****************************************************
+* StarChart
+****************************************************/
+
+/* 3.0 */
+
+#define SO3_SCH_CLASSID_30 \
+ 0xFB9C99E0L, 0x2C6D, 0x101C, 0x8E, 0x2C, 0x00, \
+ 0x00, 0x1B, 0x4C, 0xC7, 0x11
+
+/* 4.0 */
+
+#define SO3_SCH_CLASSID_40 \
+ 0x2b3b7e0L, 0x4225, 0x11d0, 0x89, 0xca, 0x00, \
+ 0x80, 0x29, 0xe4, 0xb0, 0xb1
+
+/* 5.0 */
+
+#define SO3_SCH_CLASSID_50 \
+ 0xbf884321L, 0x85dd, 0x11d1, 0x89, 0xd0, 0x00, \
+ 0x80, 0x29, 0xe4, 0xb0, 0xb1
+
+/* 6.0 */
+
+#define SO3_SCH_CLASSID_60 \
+ 0x12DCAE26, 0x281F, 0x416F, 0xA2, 0x34, 0xC3, \
+ 0x08, 0x61, 0x27, 0x38, 0x2E
+
+/* ole embed 6.0, 7 */
+
+#define SO3_SCH_OLE_EMBED_CLASSID_60 \
+ 0xd415cd93, 0x35c4, 0x4c6f, 0x81, 0x9d, 0xa6, \
+ 0x64, 0xa1, 0xc8, 0x13, 0xae
+
+/* ole embed 8 */
+
+#define SO3_SCH_OLE_EMBED_CLASSID_8 \
+ 0xdd0a57f, 0xcf3b, 0x4fd2, 0xbd, 0xa4, 0x94, \
+ 0x42, 0x71, 0x9b, 0x2a, 0x73
+
+/* aktuell */
+
+#define SO3_SCH_CLASSID SO3_SCH_CLASSID_60
+
+/****************************************************
+* StarImage
+****************************************************/
+
+/* 3.0 */
+
+#define SO3_SIM_CLASSID_30 \
+ 0xEA60C941L, 0x2C6C, 0x101C, 0x8E, 0x2C, 0x00, \
+ 0x00, 0x1B, 0x4C, 0xC7, 0x11
+
+/* 4.0 */
+
+#define SO3_SIM_CLASSID_40 \
+ 0x447BB8A0L, 0x41FB, 0x11D0, 0x89, 0xCA, 0x00, \
+ 0x80, 0x29, 0xE4, 0xB0, 0xB1
+
+/* 5.0 */
+
+#define SO3_SIM_CLASSID_50 \
+ 0x65c68d00L, 0x85de, 0x11d1, 0x89, 0xd0, 0x00, \
+ 0x80, 0x29, 0xe4, 0xb0, 0xb1
+
+/* aktuell */
+
+#define SO3_SIM_CLASSID SO3_SIM_CLASSID_50
+
+/***************************************************
+* StarMath
+***************************************************/
+
+/* 3.0 */
+
+#define SO3_SM_CLASSID_30 \
+ 0xD4590460L, 0x35FD, 0x101C, 0xB1, 0x2A, 0x04, \
+ 0x02, 0x1C, 0x00, 0x70, 0x02
+
+/* 4.0 */
+
+#define SO3_SM_CLASSID_40 \
+ 0x2b3b7e1L, 0x4225, 0x11d0, 0x89, 0xca, 0x00, \
+ 0x80, 0x29, 0xe4, 0xb0, 0xb1
+
+/* 5.0 */
+
+#define SO3_SM_CLASSID_50 \
+ 0xffb5e640L, 0x85de, 0x11d1, 0x89, 0xd0, 0x00, \
+ 0x80, 0x29, 0xe4, 0xb0, 0xb1
+
+/* 6.0, 7, 8 */
+
+#define SO3_SM_CLASSID_60 \
+ 0x078B7ABA, 0x54FC, 0x457F, 0x85, 0x51, 0x61, \
+ 0x47, 0xE7, 0x76, 0xA9, 0x97
+
+/* ole embed 6.0, 7 */
+
+#define SO3_SM_OLE_EMBED_CLASSID_60 \
+ 0xd0484de6, 0xaaee, 0x468a, 0x99, 0x1f, 0x8d, \
+ 0x4b, 0x7, 0x37, 0xb5, 0x7a
+
+/* ole embed 8 */
+
+#define SO3_SM_OLE_EMBED_CLASSID_8 \
+ 0xd2d59cd1, 0xa6a, 0x4d36, 0xae, 0x20, 0x47, \
+ 0x81, 0x70, 0x77, 0xd5, 0x7c
+
+/* aktuell */
+
+#define SO3_SM_CLASSID SO3_SM_CLASSID_60
+
+#define SO3_OUT_CLASSID \
+ 0x970b1e82, 0xcf2d, 0x11cf, 0x89, 0xca, 0x00, \
+ 0x80, 0x29, 0xe4, 0xb0, 0xb1
+
+#define SO3_DUMMY_CLASSID \
+ 0x970b1fff, 0xcf2d, 0x11cf, \
+ 0x89,0xca,0x00,0x80,0x29,0xe4,0xb0,0xb1
+
+#define SO3_APPLET_CLASSID \
+ 0x970b1e81, 0xcf2d, 0x11cf, \
+ 0x89,0xca,0x00,0x80,0x29,0xe4,0xb0,0xb1
+
+#define SO3_PLUGIN_CLASSID \
+ 0x4caa7761, 0x6b8b, 0x11cf, \
+ 0x89,0xca,0x0,0x80,0x29,0xe4,0xb0,0xb1
+
+#define SO3_IFRAME_CLASSID \
+ 0x1a8a6701, 0xde58, 0x11cf, \
+ 0x89, 0xca, 0x0, 0x80, 0x29, 0xe4, 0xb0, 0xb1
+
+#define SO3_GLOBAL_CLASSID \
+ 0x475198a8, 0x694c, 0x4bd8, \
+ 0xb0, 0x2f, 0xd9, 0xb7, 0x6b, 0xcf, 0x31, 0x28
+
+#define SO3_RPT_CLASSID_90 \
+ 0xd7896d52, 0xb7af, 0x4820, \
+ 0x9d, 0xfe, 0xd4, 0x04, 0xd0, 0x15, 0x96, 0x0f
+
+#define SO3_RPT_SCH_CLASSID_90 \
+ 0x80243d39, 0x6741, 0x46c5, \
+ 0x92, 0x6e, 0x06, 0x91, 0x64, 0xff, 0x87, 0xbb
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/comphelperdllapi.h b/include/comphelper/comphelperdllapi.h
new file mode 100644
index 000000000000..88d35f61c359
--- /dev/null
+++ b/include/comphelper/comphelperdllapi.h
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_COMPHELPERDLLAPI_H
+#define INCLUDED_COMPHELPERDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(COMPHELPER_DLLIMPLEMENTATION)
+#define COMPHELPER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define COMPHELPER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define COMPHELPER_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_COMPHELPERDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/componentbase.hxx b/include/comphelper/componentbase.hxx
new file mode 100644
index 000000000000..b4035a60f77b
--- /dev/null
+++ b/include/comphelper/componentbase.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 COMPHELPER_COMPONENTBASE_HXX
+#define COMPHELPER_COMPONENTBASE_HXX
+
+#include "comphelper/comphelperdllapi.h"
+#include <cppuhelper/interfacecontainer.hxx>
+
+//........................................................................
+namespace comphelper
+{
+//........................................................................
+
+ //====================================================================
+ //= ComponentBase
+ //====================================================================
+ class COMPHELPER_DLLPUBLIC ComponentBase
+ {
+ protected:
+ /** creates a ComponentBase instance
+
+ The instance is not initialized. As a consequence, every ComponentMethodGuard instantiated for
+ this component will throw a <type scope="com::sun::star::lang">NotInitializedException</type>,
+ until ->setInitialized() is called.
+ */
+ ComponentBase( ::cppu::OBroadcastHelper& _rBHelper )
+ :m_rBHelper( _rBHelper )
+ ,m_bInitialized( false )
+ {
+ }
+
+ struct NoInitializationNeeded { };
+
+ /** creates a ComponentBase instance
+
+ The instance is already initialized, so there's no need to call setInitialized later on. Use this
+ constructor for component implementations which do not require explicit initialization.
+ */
+ ComponentBase( ::cppu::OBroadcastHelper& _rBHelper, NoInitializationNeeded )
+ :m_rBHelper( _rBHelper )
+ ,m_bInitialized( true )
+ {
+ }
+
+ ~ComponentBase() {}
+
+ /** marks the instance as initialized
+
+ Subsequent instantiations of a ComponentMethodGuard won't throw the NotInitializedException now.
+ */
+ inline void setInitialized() { m_bInitialized = true; }
+
+ public:
+ /// helper struct to grant access to selected public methods to the ComponentMethodGuard class
+ struct GuardAccess { friend class ComponentMethodGuard; private: GuardAccess() { } };
+
+ /// retrieves the component's mutex
+ inline ::osl::Mutex& getMutex( GuardAccess ) { return getMutex(); }
+ /// checks whether the component is already disposed, throws a DisposedException if so.
+ inline void checkDisposed( GuardAccess ) const { impl_checkDisposed_throw(); }
+ /// checks whether the component is already initialized, throws a NotInitializedException if not.
+ inline void checkInitialized( GuardAccess ) const { impl_checkInitialized_throw(); }
+
+ protected:
+ /// retrieves the component's broadcast helper
+ inline ::cppu::OBroadcastHelper& getBroadcastHelper() { return m_rBHelper; }
+ /// retrieves the component's mutex
+ inline ::osl::Mutex& getMutex() { return m_rBHelper.rMutex; }
+ /// determines whether the instance is already disposed
+ inline bool impl_isDisposed() const { return m_rBHelper.bDisposed; }
+
+ /// checks whether the component is already disposed. Throws a DisposedException if so.
+ void impl_checkDisposed_throw() const;
+
+ /// checks whether the component is already initialized. Throws a NotInitializedException if not.
+ void impl_checkInitialized_throw() const;
+
+ /// determines whether the component is already initialized
+ inline bool
+ impl_isInitialized_nothrow() const { return m_bInitialized; }
+
+ /** returns the context to be used when throwing exceptions
+
+ The default implementation returns <NULL/>.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ getComponent() const;
+
+ private:
+ ::cppu::OBroadcastHelper& m_rBHelper;
+ bool m_bInitialized;
+ };
+
+ class ComponentMethodGuard
+ {
+ public:
+ enum MethodType
+ {
+ /// allow the method to be called only when being initialized and not being disposed
+ Default,
+ /// allow the method to be called without being initialized
+ WithoutInit
+
+ };
+
+ ComponentMethodGuard( ComponentBase& _rComponent, const MethodType _eType = Default )
+ :m_aMutexGuard( _rComponent.getMutex( ComponentBase::GuardAccess() ) )
+ {
+ if ( _eType != WithoutInit )
+ _rComponent.checkInitialized( ComponentBase::GuardAccess() );
+ _rComponent.checkDisposed( ComponentBase::GuardAccess() );
+ }
+
+ ~ComponentMethodGuard()
+ {
+ }
+
+ inline void clear()
+ {
+ m_aMutexGuard.clear();
+ }
+ inline void reset()
+ {
+ m_aMutexGuard.reset();
+ }
+
+ private:
+ ::osl::ResettableMutexGuard m_aMutexGuard;
+ };
+
+//........................................................................
+} // namespace ComponentBase
+//........................................................................
+
+#endif // COMPHELPER_COMPONENTBASE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/componentcontext.hxx b/include/comphelper/componentcontext.hxx
new file mode 100644
index 000000000000..d6461502be54
--- /dev/null
+++ b/include/comphelper/componentcontext.hxx
@@ -0,0 +1,243 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_COMPONENTCONTEXT_HXX
+#define COMPHELPER_COMPONENTCONTEXT_HXX
+
+#include <comphelper/comphelperdllapi.h>
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
+//........................................................................
+namespace comphelper
+{
+//........................................................................
+
+ //====================================================================
+ //= ComponentContext
+ //====================================================================
+ /** a helper class for working with a component context
+ */
+ class COMPHELPER_DLLPUBLIC ComponentContext
+ {
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory > m_xORB;
+
+ public:
+ /** constructs an instance
+ @param _rxContext
+ the component context to manage
+ @throws ::com::sun::star::lang::NullPointerException
+ if the given context, or its component factory, are <NULL/>
+ */
+ ComponentContext( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext );
+
+ /** constructs an instance
+ @param _rxLegacyFactory
+ the legacy service factor to obtain the <type scope="com::sun::star::uno">XComponentContext</type> from
+ @throws ::com::sun::star::uno::RuntimeException
+ if the given factory or does not have a DefaultContext property to obtain
+ a component context
+ @throws ::com::sun::star::lang::NullPointerException
+ if the given factory is <NULL/>, or provides a component context being <NULL/>, or provides
+ a component context whose component factory is <NULL/>
+ */
+ ComponentContext( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxLegacyFactory );
+
+ /** returns the ->XComponentContext interface
+ */
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ getUNOContext() const { return m_xContext; }
+
+ /** determines whether the context is not <NULL/>
+ */
+ inline sal_Bool is() const
+ {
+ return m_xContext.is();
+ }
+
+ /** creates a component using our component factory/context
+ @throws ::com::sun::star::uno::Exception
+ @return
+ <TRUE/> if and only if the component could be successfully created
+ */
+ template < typename INTERFACE >
+ bool createComponent( const OUString& _rServiceName, ::com::sun::star::uno::Reference< INTERFACE >& _out_rxComponent ) const
+ {
+ _out_rxComponent.clear();
+ _out_rxComponent = _out_rxComponent.query(
+ m_xORB->createInstanceWithContext( _rServiceName, m_xContext )
+ );
+ return _out_rxComponent.is();
+ }
+
+ /** creates a component using our component factory/context
+ @throws ::com::sun::star::uno::Exception
+ @return
+ <TRUE/> if and only if the component could be successfully created
+ */
+ template < typename INTERFACE >
+ bool createComponent( const sal_Char* _pAsciiServiceName, ::com::sun::star::uno::Reference< INTERFACE >& _out_rxComponent ) const
+ {
+ return createComponent( OUString::createFromAscii( _pAsciiServiceName ), _out_rxComponent );
+ }
+
+ /** creates a component using our component factory/context, passing creation arguments
+ @throws ::com::sun::star::uno::Exception
+ @return
+ <TRUE/> if and only if the component could be successfully created
+ */
+ template < typename INTERFACE >
+ bool createComponentWithArguments( const OUString& _rServiceName, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments, ::com::sun::star::uno::Reference< INTERFACE >& _out_rxComponent ) const
+ {
+ _out_rxComponent.clear();
+ _out_rxComponent = _out_rxComponent.query(
+ m_xORB->createInstanceWithArgumentsAndContext( _rServiceName, _rArguments, m_xContext )
+ );
+ return _out_rxComponent.is();
+ }
+
+ /** creates a component using our component factory/context, passing creation arguments
+ @throws ::com::sun::star::uno::Exception
+ @return
+ <TRUE/> if and only if the component could be successfully created
+ */
+ template < typename INTERFACE >
+ bool createComponentWithArguments( const sal_Char* _pAsciiServiceName, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments, ::com::sun::star::uno::Reference< INTERFACE >& _out_rxComponent ) const
+ {
+ return createComponentWithArguments( OUString::createFromAscii( _pAsciiServiceName ), _rArguments, _out_rxComponent );
+ }
+
+ /** creates a component using our component factory/context
+
+ @throws ::com::sun::star::lang::ServiceNotRegisteredException
+ if the given service is not registered
+ @throws Exception
+ if an exception occurred during creating the component
+ @return
+ the newly created component. Is never <NULL/>.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createComponent( const OUString& _rServiceName ) const;
+
+ /** creates a component using our component factory/context
+
+ @throws ::com::sun::star::lang::ServiceNotRegisteredException
+ if the given service is not registered
+ @throws Exception
+ if an exception occurred during creating the component
+ @return
+ the newly created component. Is never <NULL/>.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createComponent( const sal_Char* _pAsciiServiceName ) const
+ {
+ return createComponent( OUString::createFromAscii( _pAsciiServiceName ) );
+ }
+
+ /** creates a component using our component factory/context, passing creation arguments
+
+ @throws ::com::sun::star::lang::ServiceNotRegisteredException
+ if the given service is not registered
+ @throws Exception
+ if an exception occurred during creating the component
+ @return
+ the newly created component. Is never <NULL/>.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createComponentWithArguments(
+ const OUString& _rServiceName,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments
+ ) const;
+
+ /** creates a component using our component factory/context, passing creation arguments
+
+ @throws ::com::sun::star::lang::ServiceNotRegisteredException
+ if the given service is not registered
+ @throws Exception
+ if an exception occurred during creating the component
+ @return
+ the newly created component. Is never <NULL/>.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createComponentWithArguments(
+ const sal_Char* _pAsciiServiceName,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments
+ ) const
+ {
+ return createComponentWithArguments( OUString::createFromAscii( _pAsciiServiceName ), _rArguments );
+ }
+
+ /** retrieves a singleton instance from the context
+
+ Singletons are collected below the <code>/singletons</code> key in a component context,
+ so accessing them means retrieving the value under <code>/singletons/&lt;instance_name&gt;</code>.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getSingleton( const OUString& _rInstanceName ) const;
+
+ /** retrieves a singleton instance from the context
+
+ Singletons are collected below the <code>/singletons</code> key in a component context,
+ so accessing them means retrieving the value under <code>/singletons/&lt;instance_name&gt;</code>.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getSingleton( const sal_Char* _pAsciiInstanceName ) const
+ {
+ return getSingleton( OUString::createFromAscii( _pAsciiInstanceName ) );
+ }
+
+ /** returns the ->XMultiServiceFactory interface of ->m_xORB, for passing to
+ older code which does not yet support ->XMultiComponentFactory
+ @throws ::com::sun::star::uno::RuntimeException
+ if our our component factory does not support this interface
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
+ getLegacyServiceFactory() const;
+
+ /** retrieves a value from our component context
+ @param _rName
+ the name of the value to retrieve
+ @return
+ the context value with the given name
+ @seealso XComponentContext::getValueByName
+ @seealso getContextValueByAsciiName
+ */
+ ::com::sun::star::uno::Any
+ getContextValueByName( const OUString& _rName ) const;
+
+ /** retrieves a value from our component context, specified by 8-bit ASCII string
+ @param _rName
+ the name of the value to retrieve, as ASCII character string
+ @return
+ the context value with the given name
+ @seealso XComponentContext::getValueByName
+ @seealso getContextValueByName
+ */
+ inline ::com::sun::star::uno::Any
+ getContextValueByAsciiName( const sal_Char* _pAsciiName ) const
+ {
+ return getContextValueByName( OUString::createFromAscii( _pAsciiName ) );
+ }
+
+ };
+
+//........................................................................
+} // namespace comphelper
+//........................................................................
+
+#endif // COMPHELPER_COMPONENTCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/componentguard.hxx b/include/comphelper/componentguard.hxx
new file mode 100644
index 000000000000..eb1cfbcc24a8
--- /dev/null
+++ b/include/comphelper/componentguard.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 COMPHELPER_COMPONENTGUARD_HXX
+#define COMPHELPER_COMPONENTGUARD_HXX
+
+#include <com/sun/star/lang/DisposedException.hpp>
+
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+
+//......................................................................................................................
+namespace comphelper
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ComponentGuard
+ //==================================================================================================================
+ class ComponentGuard
+ {
+ public:
+ ComponentGuard( ::cppu::OWeakObject& i_component, ::cppu::OBroadcastHelper & i_broadcastHelper )
+ :m_aGuard( i_broadcastHelper.rMutex )
+ {
+ if ( i_broadcastHelper.bDisposed )
+ throw ::com::sun::star::lang::DisposedException( OUString(), &i_component );
+ }
+
+ ~ComponentGuard()
+ {
+ }
+
+ void clear() { m_aGuard.clear(); }
+ void reset() { m_aGuard.reset(); }
+
+ private:
+ ::osl::ResettableMutexGuard m_aGuard;
+ };
+
+//......................................................................................................................
+} // namespace comphelper
+//......................................................................................................................
+
+#endif // COMPHELPER_COMPONENTGUARD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/componentmodule.hxx b/include/comphelper/componentmodule.hxx
new file mode 100644
index 000000000000..9ce8a137ede2
--- /dev/null
+++ b/include/comphelper/componentmodule.hxx
@@ -0,0 +1,261 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef COMPHELPER_INC_COMPHELPER_COMPONENTMODULE_HXX
+#define COMPHELPER_INC_COMPHELPER_COMPONENTMODULE_HXX
+
+#include <comphelper/comphelperdllapi.h>
+
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <cppuhelper/factory.hxx>
+
+#include <osl/mutex.hxx>
+
+#include <rtl/string.hxx>
+#include <rtl/instance.hxx>
+
+//........................................................................
+namespace comphelper
+{
+//........................................................................
+
+ /** factory factory declaration
+ */
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleComponentFactory > (SAL_CALL *FactoryInstantiation)
+ (
+ ::cppu::ComponentFactoryFunc _pFactoryFunc,
+ OUString const& _rComponentName,
+ ::com::sun::star::uno::Sequence< OUString > const & _rServiceNames,
+ rtl_ModuleCount*
+ ) SAL_THROW(());
+
+ //=========================================================================
+ //= ComponentDescription
+ //=========================================================================
+ struct COMPHELPER_DLLPUBLIC ComponentDescription
+ {
+ /// the implementation name of the component
+ OUString sImplementationName;
+ /// the services supported by the component implementation
+ ::com::sun::star::uno::Sequence< OUString > aSupportedServices;
+ /** the name under which the component implementation should be registered as singleton,
+ or empty if the component does not implement a singleton.
+ */
+ OUString sSingletonName;
+ /// the function to create an instance of the component
+ ::cppu::ComponentFactoryFunc pComponentCreationFunc;
+ /// the function to create a factory for the component (usually <code>::cppu::createSingleComponentFactory</code>)
+ FactoryInstantiation pFactoryCreationFunc;
+
+ ComponentDescription()
+ :sImplementationName()
+ ,aSupportedServices()
+ ,sSingletonName()
+ ,pComponentCreationFunc( NULL )
+ ,pFactoryCreationFunc( NULL )
+ {
+ }
+
+ ComponentDescription(
+ const OUString& _rImplementationName,
+ const ::com::sun::star::uno::Sequence< OUString >& _rSupportedServices,
+ const OUString& _rSingletonName,
+ ::cppu::ComponentFactoryFunc _pComponentCreationFunc,
+ FactoryInstantiation _pFactoryCreationFunc
+ )
+ :sImplementationName( _rImplementationName )
+ ,aSupportedServices( _rSupportedServices )
+ ,sSingletonName( _rSingletonName )
+ ,pComponentCreationFunc( _pComponentCreationFunc )
+ ,pFactoryCreationFunc( _pFactoryCreationFunc )
+ {
+ }
+ };
+
+ //=========================================================================
+ //= OModule
+ //=========================================================================
+ class OModuleImpl;
+ class COMPHELPER_DLLPUBLIC OModule
+ {
+ private:
+ oslInterlockedCount m_nClients; /// number of registered clients
+ OModuleImpl* m_pImpl; /// impl class. lives as long as at least one client for the module is registered
+
+ protected:
+ mutable ::osl::Mutex m_aMutex; /// access safety
+
+ public:
+ OModule();
+
+ virtual ~OModule();
+
+ /** register a component implementing a service with the given data.
+ @param _rImplementationName
+ the implementation name of the component
+ @param _rServiceNames
+ the services the component supports
+ @param _pCreateFunction
+ a function for creating an instance of the component
+ @param _pFactoryFunction
+ a function for creating a factory for that component
+ */
+ void registerImplementation(
+ const OUString& _rImplementationName,
+ const ::com::sun::star::uno::Sequence< OUString >& _rServiceNames,
+ ::cppu::ComponentFactoryFunc _pCreateFunction,
+ FactoryInstantiation _pFactoryFunction = ::cppu::createSingleComponentFactory );
+
+ /** registers a component given by <type>ComponentDescription</type>
+ */
+ void registerImplementation( const ComponentDescription& _rComp );
+
+ /** creates a Factory for the component with the given implementation name.
+ <p>Usually used from within component_getFactory.<p/>
+ @param _pImplementationName
+ the implementation name of the component
+ @return
+ the XInterface access to a factory for the component
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getComponentFactory(
+ const OUString& _rImplementationName );
+
+ /** version of getComponentFactory which directly takes the char argument you got in your component_getFactory call
+ */
+ void* getComponentFactory( const sal_Char* _pImplementationName );
+
+ public:
+ class ClientAccess { friend class OModuleClient; private: ClientAccess() { } };
+ /// register a client for the module
+ void registerClient( ClientAccess );
+ /// revoke a client for the module
+ void revokeClient( ClientAccess );
+
+ protected:
+ /** called when the first client has been registered
+ @precond
+ <member>m_aMutex</member> is locked
+ */
+ virtual void onFirstClient();
+
+ /** called when the last client has been revoked
+ @precond
+ <member>m_aMutex</member> is locked
+ */
+ virtual void onLastClient();
+
+ private:
+ OModule( const OModule& ); // never implemented
+ OModule& operator=( const OModule& ); // never implemented
+ };
+
+ //=========================================================================
+ //= OModuleClient
+ //=========================================================================
+ /** base class for objects which uses any global module-specific resources
+ */
+ class COMPHELPER_DLLPUBLIC OModuleClient
+ {
+ protected:
+ OModule& m_rModule;
+
+ public:
+ OModuleClient( OModule& _rModule ) :m_rModule( _rModule ) { m_rModule.registerClient( OModule::ClientAccess() ); }
+ ~OModuleClient() { m_rModule.revokeClient( OModule::ClientAccess() ); }
+ };
+
+ //==========================================================================
+ //= OAutoRegistration
+ //==========================================================================
+ template <class TYPE>
+ class OAutoRegistration
+ {
+ public:
+ /** automatically provides all component information to an OModule instance
+ <p>Assumed that the template argument has the three methods
+ <ul>
+ <li><code>static OUString getImplementationName_static()</code><li/>
+ <li><code>static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_static()</code><li/>
+ <li><code>static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&)</code>
+ </li>
+ <ul/>
+ the instantiation of this object will automatically register the class via <member>OModule::registerImplementation</member>.
+ <p/>
+ The factory creation function used is <code>::cppu::createSingleComponentFactory</code>.
+ */
+ OAutoRegistration( OModule& _rModule );
+ };
+
+ template <class TYPE>
+ OAutoRegistration<TYPE>::OAutoRegistration( OModule& _rModule )
+ {
+ _rModule.registerImplementation(
+ TYPE::getImplementationName_static(),
+ TYPE::getSupportedServiceNames_static(),
+ TYPE::Create
+ );
+ }
+
+ //==========================================================================
+ //= OSingletonRegistration
+ //==========================================================================
+ template <class TYPE>
+ class OSingletonRegistration
+ {
+ public:
+ /** automatically provides all component information to an OModule instance,
+ for a singleton component
+
+ <p>Assumed that the template argument has the three methods
+ <ul>
+ <li><code>static OUString getImplementationName_static()</code><li/>
+ <li><code>static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_static()</code><li/>
+ <li><code>static OUString getSingletonName_static()</code></li>
+ <li><code>static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&)</code>
+ </li>
+ <ul/>
+ the instantiation of this object will automatically register the class via <member>OModule::registerImplementation</member>.
+ </p>
+ */
+ OSingletonRegistration( OModule& _rModule );
+ };
+
+ template <class TYPE>
+ //--------------------------------------------------------------------------
+ OSingletonRegistration<TYPE>::OSingletonRegistration( OModule& _rModule )
+ {
+ _rModule.registerImplementation( ComponentDescription(
+ TYPE::getImplementationName_static(),
+ TYPE::getSupportedServiceNames_static(),
+ TYPE::getSingletonName_static(),
+ &TYPE::Create,
+ &::cppu::createSingleComponentFactory
+ ) );
+ }
+
+//........................................................................
+} // namespace comphelper
+//........................................................................
+
+#endif // COMPHELPER_INC_COMPHELPER_COMPONENTMODULE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/configuration.hxx b/include/comphelper/configuration.hxx
new file mode 100644
index 000000000000..8eecc7facd91
--- /dev/null
+++ b/include/comphelper/configuration.hxx
@@ -0,0 +1,331 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_COMPHELPER_CONFIGURATION_HXX
+#define INCLUDED_COMPHELPER_CONFIGURATION_HXX
+
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "boost/optional.hpp"
+#include "boost/shared_ptr.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "comphelper/comphelperdllapi.h"
+#include "comphelper/processfactory.hxx"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star {
+ namespace configuration { class XReadWriteAccess; }
+ namespace container {
+ class XHierarchicalNameAccess;
+ class XHierarchicalNameReplace;
+ class XNameAccess;
+ class XNameContainer;
+ }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace comphelper {
+
+namespace detail { class ConfigurationWrapper; }
+
+/// A batch of configuration changes that is committed as a whole.
+///
+/// Client code needs to call commit explicitly; otherwise the changes are lost
+/// when the instance is destroyed.
+///
+/// This is the only class from this header file that client code should use
+/// directly.
+class COMPHELPER_DLLPUBLIC ConfigurationChanges: private boost::noncopyable {
+public:
+ static boost::shared_ptr< ConfigurationChanges > create(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context = comphelper::getProcessComponentContext());
+
+ ~ConfigurationChanges();
+
+ void commit() const;
+
+private:
+ SAL_DLLPRIVATE ConfigurationChanges(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context);
+
+ SAL_DLLPRIVATE void setPropertyValue(
+ OUString const & path, com::sun::star::uno::Any const & value)
+ const;
+
+ SAL_DLLPRIVATE com::sun::star::uno::Reference<
+ com::sun::star::container::XHierarchicalNameReplace >
+ getGroup(OUString const & path) const;
+
+ SAL_DLLPRIVATE
+ com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >
+ getSet(OUString const & path) const;
+
+ com::sun::star::uno::Reference<
+ com::sun::star::configuration::XReadWriteAccess > access_;
+
+ friend class detail::ConfigurationWrapper;
+};
+
+namespace detail {
+
+/// @internal
+class COMPHELPER_DLLPUBLIC ConfigurationWrapper: private boost::noncopyable {
+public:
+ static ConfigurationWrapper const & get(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context);
+
+ SAL_DLLPRIVATE explicit ConfigurationWrapper(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context);
+
+ SAL_DLLPRIVATE ~ConfigurationWrapper();
+
+ com::sun::star::uno::Any getPropertyValue(OUString const & path) const;
+
+ void setPropertyValue(
+ boost::shared_ptr< ConfigurationChanges > const & batch,
+ OUString const & path, com::sun::star::uno::Any const & value)
+ const;
+
+ com::sun::star::uno::Any getLocalizedPropertyValue(
+ OUString const & path) const;
+
+ void setLocalizedPropertyValue(
+ boost::shared_ptr< ConfigurationChanges > const & batch,
+ OUString const & path, com::sun::star::uno::Any const & value)
+ const;
+
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XHierarchicalNameAccess >
+ getGroupReadOnly(OUString const & path) const;
+
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XHierarchicalNameReplace >
+ getGroupReadWrite(
+ boost::shared_ptr< ConfigurationChanges > const & batch,
+ OUString const & path) const;
+
+ com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >
+ getSetReadOnly(OUString const & path) const;
+
+ com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >
+ getSetReadWrite(
+ boost::shared_ptr< ConfigurationChanges > const & batch,
+ OUString const & path) const;
+
+ boost::shared_ptr< ConfigurationChanges > createChanges() const;
+
+private:
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ context_;
+
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XHierarchicalNameAccess > access_;
+};
+
+/// @internal
+template< typename T > struct Convert: private boost::noncopyable {
+ static com::sun::star::uno::Any toAny(T const & value)
+ { return com::sun::star::uno::makeAny(value); }
+
+ static T fromAny(com::sun::star::uno::Any const & value)
+ { return value.get< T >(); }
+
+private:
+ Convert(); // not defined
+ ~Convert(); // not defined
+};
+
+/// @internal
+template< typename T > struct Convert< boost::optional< T > >:
+ private boost::noncopyable
+{
+ static com::sun::star::uno::Any toAny(boost::optional< T > const & value) {
+ return value
+ ? com::sun::star::uno::makeAny(value.get())
+ : com::sun::star::uno::Any();
+ }
+
+ static boost::optional< T > fromAny(com::sun::star::uno::Any const & value)
+ {
+ return value.hasValue()
+ ? boost::optional< T >(value.get< T >()) : boost::optional< T >();
+ }
+
+private:
+ Convert(); // not defined
+ ~Convert(); // not defined
+};
+
+}
+
+/// A type-safe wrapper around a (non-localized) configuration property.
+///
+/// Automatically generated headers for the various configuration properties
+/// derive from this template and make available its member functions to access
+/// each given configuration property.
+template< typename T, typename U > struct ConfigurationProperty:
+ private boost::noncopyable
+{
+ /// Get the value of the given (non-localized) configuration property.
+ ///
+ /// For nillable properties, U is of type boost::optional<U'>.
+ static U get(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context = comphelper::getProcessComponentContext())
+ {
+ // Folding this into one statement causes a bogus error at least with
+ // Red Hat GCC 4.6.2-1:
+ com::sun::star::uno::Any a(
+ detail::ConfigurationWrapper::get(context).getPropertyValue(
+ T::path()));
+ return detail::Convert< U >::fromAny(a);
+ }
+
+ /// Set the value of the given (non-localized) configuration property, via a
+ /// given changes batch.
+ ///
+ /// For nillable properties, U is of type boost::optional<U'>.
+ static void set(
+ U const & value,
+ boost::shared_ptr< ConfigurationChanges > const & batch,
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context = comphelper::getProcessComponentContext())
+ {
+ detail::ConfigurationWrapper::get(context).setPropertyValue(
+ batch, T::path(), detail::Convert< U >::toAny(value));
+ }
+
+private:
+ ConfigurationProperty(); // not defined
+ ~ConfigurationProperty(); // not defined
+};
+
+/// A type-safe wrapper around a localized configuration property.
+///
+/// Automatically generated headers for the various localized configuration
+/// properties derive from this template and make available its member functions
+/// to access each given localized configuration property.
+template< typename T, typename U > struct ConfigurationLocalizedProperty:
+ private boost::noncopyable
+{
+ /// Get the value of the given localized configuration property, for the
+ /// locale currently set at the
+ /// com.sun.star.configuration.theDefaultProvider.
+ ///
+ /// For nillable properties, U is of type boost::optional<U'>.
+ static U get(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context = comphelper::getProcessComponentContext())
+ {
+ // Folding this into one statement causes a bogus error at least with
+ // Red Hat GCC 4.6.2-1:
+ com::sun::star::uno::Any a(
+ detail::ConfigurationWrapper::get(context).
+ getLocalizedPropertyValue(T::path()));
+ return detail::Convert< U >::fromAny(a);
+ }
+
+ /// Set the value of the given localized configuration property, for the
+ /// locale currently set at the
+ /// com.sun.star.configuration.theDefaultProvider, via a given changes
+ /// batch.
+ ///
+ /// For nillable properties, U is of type boost::optional<U'>.
+ static void set(
+ U const & value,
+ boost::shared_ptr< ConfigurationChanges > const & batch,
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context = comphelper::getProcessComponentContext())
+ {
+ detail::ConfigurationWrapper::get(context).setLocalizedPropertyValue(
+ batch, T::path(), detail::Convert< U >::toAny(value));
+ }
+
+private:
+ ConfigurationLocalizedProperty(); // not defined
+ ~ConfigurationLocalizedProperty(); // not defined
+};
+
+/// A type-safe wrapper around a configuration group.
+///
+/// Automatically generated headers for the various configuration groups derive
+/// from this template and make available its member functions to access each
+/// given configuration group.
+template< typename T > struct ConfigurationGroup: private boost::noncopyable {
+ /// Get read-only access to the given configuration group.
+ static com::sun::star::uno::Reference<
+ com::sun::star::container::XHierarchicalNameAccess >
+ get(com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context = comphelper::getProcessComponentContext())
+ {
+ return detail::ConfigurationWrapper::get(context).getGroupReadOnly(
+ T::path());
+ }
+
+ /// Get read/write access to the given configuration group, storing any
+ /// modifications via the given changes batch.
+ static com::sun::star::uno::Reference<
+ com::sun::star::container::XHierarchicalNameReplace >
+ get(boost::shared_ptr< ConfigurationChanges > const & batch,
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context = comphelper::getProcessComponentContext())
+ {
+ return detail::ConfigurationWrapper::get(context).getGroupReadWrite(
+ batch, T::path());
+ }
+
+private:
+ ConfigurationGroup(); // not defined
+ ~ConfigurationGroup(); // not defined
+};
+
+/// A type-safe wrapper around a configuration set.
+///
+/// Automatically generated headers for the various configuration sets derive
+/// from this template and make available its member functions to access each
+/// given configuration set.
+template< typename T > struct ConfigurationSet: private boost::noncopyable {
+ /// Get read-only access to the given configuration set.
+ static
+ com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >
+ get(com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context = comphelper::getProcessComponentContext())
+ {
+ return detail::ConfigurationWrapper::get(context).getSetReadOnly(
+ T::path());
+ }
+
+ /// Get read/write access to the given configuration set, storing any
+ /// modifications via the given changes batch.
+ static
+ com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >
+ get(boost::shared_ptr< ConfigurationChanges > const & batch,
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context = comphelper::getProcessComponentContext())
+ {
+ return detail::ConfigurationWrapper::get(context).getSetReadWrite(
+ batch, T::path());
+ }
+
+private:
+ ConfigurationSet(); // not defined
+ ~ConfigurationSet(); // not defined
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/configurationhelper.hxx b/include/comphelper/configurationhelper.hxx
new file mode 100644
index 000000000000..b267e4c0c564
--- /dev/null
+++ b/include/comphelper/configurationhelper.hxx
@@ -0,0 +1,240 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_CONFIGURATIONHELPER_HXX_
+#define _COMPHELPER_CONFIGURATIONHELPER_HXX_
+
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
+#include <com/sun/star/util/XChangesBatch.hpp>
+#include <comphelper/sequenceasvector.hxx>
+#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+//_______________________________________________
+// namespaces
+
+namespace comphelper{
+
+
+//-----------------------------------------------
+class COMPHELPER_DLLPUBLIC ConfigurationHelper
+{
+ public:
+
+ //-----------------------------------------------
+ /** specify all possible modes, which can be used to open a configuration access.
+ *
+ * @see openConfig()
+ * @see readDirectKey()
+ * @see writeDirectKey()
+ */
+ enum EConfigurationModes
+ {
+ /// opens configuration in read/write mode (without LAZY writing!)
+ E_STANDARD = 0,
+ /// configuration will be opened readonly
+ E_READONLY = 1,
+ /// all localized nodes will be interpreted as XInterface instead of interpreting it as atomic value nodes
+ E_ALL_LOCALES = 2,
+ /// enable lazy writing
+ E_LAZY_WRITE = 4
+ };
+
+ //-----------------------------------------------
+ /** returns access to the specified configuration package.
+ *
+ * This method should be used, if e.g. more then one request to the same
+ * configuration package is needed. The configuration access can be cached
+ * outside and used inbetween.
+ *
+ * @param rxContext
+ * the uno service manager, which should be used to create the
+ * configuration access.
+ *
+ * @param sPackage
+ * the name of the configuration package.
+ * e.g. <ul>
+ * <li>org.openoffice.Office.Common</li>
+ * <li>org.openoffice.Office.Common/Menu</li>
+ * </ul>
+ *
+ * @param eMode
+ * specify the open mode for the returned configuration access.
+ * It's interpreted as a flag field and can be any useful combination
+ * of values of EConfigurationModes.
+ *
+ * @throw Any exceptions the underlying configuration can throw.
+ * E.g. css::uno::Exception if the configuration could not be opened.
+ */
+ static css::uno::Reference< css::uno::XInterface > openConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+ const OUString& sPackage,
+ sal_Int32 eMode );
+
+ //-----------------------------------------------
+ /** reads the value of an existing(!) configuration key,
+ * which is searched relative to the specified configuration access.
+ *
+ * This method must be used in combination with openConfig().
+ * The cached configuration access must be provided here ... and
+ * all operations are made relativ to this access point.
+ *
+ * @param xCFG
+ * the configuration root, where sRelPath should be interpreted.
+ * as relativ path
+ *
+ * @param sRelPath
+ * path relative to xCFG parameter.
+ *
+ * @param sKey
+ * the configuration node, where we should read the value.
+ *
+ * @return [css.uno.Any]
+ * the value of sKey.
+ *
+ * @throw Any exceptions the underlying configuration can throw.
+ * E.g. css::container::NoSuchElementException if the specified
+ * key does not exists.
+ */
+ static css::uno::Any readRelativeKey(const css::uno::Reference< css::uno::XInterface > xCFG ,
+ const OUString& sRelPath,
+ const OUString& sKey );
+
+ //-----------------------------------------------
+ /** writes a new value for an existing(!) configuration key,
+ * which is searched relative to the specified configuration access.
+ *
+ * This method must be used in combination with openConfig().
+ * The cached configuration access must be provided here ... and
+ * all operations are made relativ to this access point.
+ *
+ * @param xCFG
+ * the configuration root, where sRelPath should be interpreted.
+ * as relativ path
+ *
+ * @param sRelPath
+ * path relative to xCFG parameter.
+ *
+ * @param sKey
+ * the configuration node, where we should write the new value.
+ *
+ * @param aValue
+ * the new value for sKey.
+ *
+ * @throw Any exceptions the underlying configuration can throw.
+ * E.g. css::container::NoSuchElementException if the specified
+ * key does not exists or css::uno::Exception if the provided configuration
+ * access does not allow writing for this key.
+ */
+ static void writeRelativeKey(const css::uno::Reference< css::uno::XInterface > xCFG ,
+ const OUString& sRelPath,
+ const OUString& sKey ,
+ const css::uno::Any& aValue );
+
+ //-----------------------------------------------
+ /** it checks if the specified set node exists ... or create an empty one
+ * otherwise.
+ *
+ * This method must be used in combination with openConfig().
+ * The cached configuration access must be provided here ... and
+ * all operations are made relativ to this access point.
+ *
+ * Further this method must be used only with configuration set's.
+ * Atomic keys can't be "created" ... they "exists everytimes".
+ *
+ * @param xCFG
+ * the configuration root, where sRelPathToSet should be interpreted
+ * as relativ path.
+ *
+ * @param sRelPathToSet
+ * path relative to xCFG parameter.
+ *
+ * @param sSetNode
+ * the set node, which should be checked if its exists ...
+ * or which should be created with default values.
+ *
+ * @return A reference to the found (or new created) set node.
+ * Cant be NULL .. in such case an exception occure !
+ *
+ * @throw Any exceptions the underlying configuration can throw.
+ * E.g. css::uno::Exception if the provided configuration
+ * access does not allow writing for this set.
+ */
+ static css::uno::Reference< css::uno::XInterface > makeSureSetNodeExists(const css::uno::Reference< css::uno::XInterface > xCFG ,
+ const OUString& sRelPathToSet,
+ const OUString& sSetNode );
+
+ //-----------------------------------------------
+ /** commit all changes made on the specified configuration access.
+ *
+ * This method must be used in combination with openConfig().
+ * The cached configuration access must be provided here.
+ *
+ * @param xCFG
+ * the configuration root, where changes should be commited.
+ *
+ * @throw Any exceptions the underlying configuration can throw.
+ * E.g. css::uno::Exception if the provided configuration
+ * access does not allow writing for this set.
+ */
+ static void flush(const css::uno::Reference< css::uno::XInterface >& xCFG);
+
+ //-----------------------------------------------
+ /** does the same then openConfig() & readRelativeKey() together.
+ *
+ * This method should be used for reading one key at one code place only.
+ * Because it opens the specified configuration package, reads the key and
+ * closes the configuration again.
+ *
+ * So its not very useful to use this method for reading multiple keys at the same time.
+ * (Excepting these keys exists inside different configuration packages ...))
+ */
+ static css::uno::Any readDirectKey(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+ const OUString& sPackage,
+ const OUString& sRelPath,
+ const OUString& sKey ,
+ sal_Int32 eMode );
+
+ //-----------------------------------------------
+ /** does the same then openConfig() / writeRelativeKey() & flush() together.
+ *
+ * This method should be used for writing one key at one code place only.
+ * Because it opens the specified configuration package, writes the key, flush
+ * all changes and closes the configuration again.
+ *
+ * So its not very useful to use this method for writing multiple keys at the same time.
+ * (Excepting these keys exists inside different configuration packages ...))
+ */
+ static void writeDirectKey(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+ const OUString& sPackage,
+ const OUString& sRelPath,
+ const OUString& sKey ,
+ const css::uno::Any& aValue ,
+ sal_Int32 eMode );
+};
+
+} // namespace comphelper
+
+#endif // _COMPHELPER_CONFIGURATIONHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/container.hxx b/include/comphelper/container.hxx
new file mode 100644
index 000000000000..d6c5be927873
--- /dev/null
+++ b/include/comphelper/container.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 _COMPHELPER_CONTAINER_HXX_
+#define _COMPHELPER_CONTAINER_HXX_
+
+#include <vector>
+#include "com/sun/star/uno/Reference.hxx"
+#include "comphelper/comphelperdllapi.h"
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+//========================================================================
+//= IndexAccessIterator
+//========================================================================
+/** an iterator that iterates through all elements, starting from an XIndexAccess (pre-order)
+*/
+class COMPHELPER_DLLPUBLIC IndexAccessIterator
+{
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xStartingPoint;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xCurrentObject;
+ // The current object
+ ::std::vector<sal_Int32> m_arrChildIndizies;
+
+ // I'm moving through a tree, but its elements have no GetNextSibling,
+ // so I have to remember where each child is in relation to its parent.
+ // That is the path from the root node to m_xCurrentObject
+
+ OUString m_ustrProperty;
+ // The Name of the requested property
+
+public:
+ IndexAccessIterator(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xStartingPoint);
+
+ virtual ~IndexAccessIterator();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> Next();
+
+ virtual void Invalidate() { m_xCurrentObject = NULL; }
+
+protected:
+ virtual sal_Bool ShouldHandleElement(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& /*rElement*/) { return sal_True; }
+
+ // This can be used to exclude certain elements; elements for which
+ // this function returns sal_True will be simply skipped.
+ // If this element is returned from Next(), then one can get
+ // here get a little more information on the element.
+ // That's why this method is not const.
+ virtual sal_Bool ShouldStepInto(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& /*xContainer*/) const { return sal_True; }
+};
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // _COMPHELPER_CONTAINER_HXX_
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/containermultiplexer.hxx b/include/comphelper/containermultiplexer.hxx
new file mode 100644
index 000000000000..725265e493c6
--- /dev/null
+++ b/include/comphelper/containermultiplexer.hxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_CONTAINERMULTIPLEXER_HXX_
+#define _COMPHELPER_CONTAINERMULTIPLEXER_HXX_
+
+#include <com/sun/star/container/XContainer.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <osl/mutex.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ class OContainerListenerAdapter;
+ //=====================================================================
+ //= OContainerListener
+ //=====================================================================
+ /** a non-UNO container listener
+ <p>Useful if you have a non-refcountable class which should act as container listener.<br/>
+ In this case, derive this class from OContainerListener, and create an adapter
+ <type>OContainerListenerAdapter</type> which multiplexes the changes.</p>
+ */
+ class COMPHELPER_DLLPUBLIC OContainerListener
+ {
+ friend class OContainerListenerAdapter;
+ protected:
+ OContainerListenerAdapter* m_pAdapter;
+ ::osl::Mutex& m_rMutex;
+
+ public:
+ OContainerListener(::osl::Mutex& _rMutex);
+ virtual ~OContainerListener();
+
+ virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _elementRemoved( const ::com::sun::star::container::ContainerEvent& _Event ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _disposing(const ::com::sun::star::lang::EventObject& _rSource) throw( ::com::sun::star::uno::RuntimeException);
+
+ protected:
+ void setAdapter(OContainerListenerAdapter* _pAdapter);
+ };
+
+ //=====================================================================
+ //= OContainerListenerAdapter
+ //=====================================================================
+ class COMPHELPER_DLLPUBLIC OContainerListenerAdapter
+ :public cppu::WeakImplHelper1< ::com::sun::star::container::XContainerListener >
+ {
+ friend class OContainerListener;
+
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer >
+ m_xContainer;
+ OContainerListener* m_pListener;
+ sal_Int32 m_nLockCount;
+
+ virtual ~OContainerListenerAdapter();
+
+ public:
+ OContainerListenerAdapter(OContainerListener* _pListener,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer >& _rxContainer);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException);
+
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+
+ // locking the multiplexer
+ sal_Int32 locked() const { return m_nLockCount; }
+
+ /// dispose the object. No multiplexing anymore
+ void dispose();
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer >&
+ getContainer() const { return m_xContainer; }
+ };
+
+//.........................................................................
+} // namespace dbaui
+//.........................................................................
+
+#endif // _COMPHELPER_CONTAINERMULTIPLEXER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/docpasswordhelper.hxx b/include/comphelper/docpasswordhelper.hxx
new file mode 100644
index 000000000000..24fd868c0735
--- /dev/null
+++ b/include/comphelper/docpasswordhelper.hxx
@@ -0,0 +1,353 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_DOCPASSWORDHELPR_HXX
+#define COMPHELPER_DOCPASSWORDHELPR_HXX
+
+#include <com/sun/star/beans/NamedValue.hpp>
+#include "comphelper/comphelperdllapi.h"
+#include <vector>
+#include "comphelper/docpasswordrequest.hxx"
+
+namespace com { namespace sun { namespace star { namespace task { class XInteractionHandler; } } } }
+namespace com { namespace sun { namespace star { namespace beans { struct PropertyValue; } } } }
+
+namespace comphelper {
+
+class MediaDescriptor;
+
+// ============================================================================
+
+enum DocPasswordVerifierResult
+{
+ DocPasswordVerifierResult_OK,
+ DocPasswordVerifierResult_WRONG_PASSWORD,
+ DocPasswordVerifierResult_ABORT
+};
+
+// ============================================================================
+
+/** Base class for a password verifier used by the DocPasswordHelper class
+ below.
+
+ Users have to implement the virtual functions and pass an instance of the
+ verifier to one of the password request functions.
+ */
+class COMPHELPER_DLLPUBLIC IDocPasswordVerifier
+{
+public:
+ virtual ~IDocPasswordVerifier();
+
+ /** Will be called everytime a password needs to be verified.
+
+ @param rPassword
+ The password to be verified
+
+ @param o_rEncryptionData
+ Output parameter, that is filled with the EncryptionData generated
+ from the password. The data is filled only if the validation was
+ successful.
+
+ @return The result of the verification.
+ - DocPasswordVerifierResult_OK, if and only if the passed password
+ is valid and can be used to process the related document.
+ - DocPasswordVerifierResult_WRONG_PASSWORD, if the password is
+ wrong. The user may be asked again for a new password.
+ - DocPasswordVerifierResult_ABORT, if an unrecoverable error
+ occurred while password verification. The password request loop
+ will be aborted.
+ */
+ virtual DocPasswordVerifierResult verifyPassword( const OUString& rPassword, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData ) = 0;
+
+ /** Will be called everytime an encryption data needs to be verified.
+
+ @param rEncryptionData
+ The data will be validated
+
+ @return The result of the verification.
+ - DocPasswordVerifierResult_OK, if and only if the passed encryption data
+ is valid and can be used to process the related document.
+ - DocPasswordVerifierResult_WRONG_PASSWORD, if the encryption data is
+ wrong.
+ - DocPasswordVerifierResult_ABORT, if an unrecoverable error
+ occured while data verification. The password request loop
+ will be aborted.
+ */
+ virtual DocPasswordVerifierResult verifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData ) = 0;
+
+};
+
+// ============================================================================
+
+/** Helper that asks for a document password and checks its validity.
+ */
+class COMPHELPER_DLLPUBLIC DocPasswordHelper
+{
+public:
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates the information related
+ to "Password to modify" provided by user. The result
+ sequence contains the hash and the algorithm-related
+ info.
+
+ @param aString
+ The string for which the info should be generated
+
+ @return
+ The sequence containing the hash and the algorithm-related info
+ */
+
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
+ GenerateNewModifyPasswordInfo( const OUString& aPassword );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function allows to check whether
+ the "Password to modify" provided by user is the correct one.
+
+ @param aString
+ The string containing the provided password
+
+ @param aInfo
+ The sequence containing the hash and the algorithm-info
+
+ @return
+ <TRUE/> if the password is correct one
+ <FALSE/> otherwise
+ */
+
+ static sal_Bool IsModifyPasswordCorrect(
+ const OUString& aPassword,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aInfo );
+
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates the hash code based on the algorithm
+ specified by MS for "Password to modify" feature of Word.
+
+ @param aString
+ The string for which the hash should be calculated
+
+ @return
+ The hash represented by sal_uInt32
+ */
+
+ static sal_uInt32 GetWordHashAsUINT32(
+ const OUString& aString );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates the hash code based on the algorithm
+ specified by MS for "Password to modify" and passwords related to
+ table protection of Excel.
+
+ @param aString
+ The string for which the hash should be calculated
+
+ @param nEnc
+ The encoding that should be used to generate the 8-bit string
+ before the hash is generated
+
+ @return
+ The hash represented by sal_uInt16
+ */
+
+ static sal_uInt16 GetXLHashAsUINT16(
+ const OUString& aString,
+ rtl_TextEncoding nEnc = RTL_TEXTENCODING_UTF8 );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates the hash code based on the algorithm
+ specified by MS for "Password to modify" and passwords related to
+ table protection.
+
+ @param aString
+ The string for which the hash should be calculated
+
+ @param nEnc
+ The encoding that should be used to generate the 8-bit string
+ before the hash is generated
+
+ @return
+ The hash represented by sequence of bytes in BigEndian form
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GetXLHashAsSequence(
+ const OUString& aString,
+ rtl_TextEncoding nEnc = RTL_TEXTENCODING_UTF8 );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates a random sequence of bytes of
+ requested length.
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GenerateRandomByteSequence(
+ sal_Int32 nLength );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates a byte sequence representing the
+ key digest value used by MSCodec_Std97 codec.
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GenerateStd97Key(
+ const OUString& aPassword,
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aDocId );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates a byte sequence representing the
+ key digest value used by MSCodec_Std97 codec.
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GenerateStd97Key(
+ const sal_uInt16 pPassData[16],
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aDocId );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function tries to request and verify a password to load a
+ protected document.
+
+ First, the list of default passwords will be tried if provided. This is
+ needed by import filters for external file formats that have to check a
+ predefined password in some cases without asking the user for a
+ password. Every password is checked using the passed password verifier.
+
+ If not successful, the passed password of a medium is tried, that has
+ been set e.g. by an API call to load a document. If existing, the
+ password is checked using the passed password verifier.
+
+ If still not successful, the passed interaction handler is used to
+ request a password from the user. This will be repeated until the
+ passed password verifier validates the entered password, or if the user
+ chooses to cancel password input.
+
+ @param rVerifier
+ The password verifier used to check every processed password.
+
+ @param rMediaPassword
+ If not empty, will be passed to the password validator before
+ requesting a password from the user. This password usually should
+ be querried from a media descriptor.
+
+ @param rxInteractHandler
+ The interaction handler that will be used to request a password
+ from the user, e.g. by showing a password input dialog.
+
+ @param rDocumentName
+ The name of the related document that will be shown in the password
+ input dialog.
+
+ @param eRequestType
+ The password request type that will be passed to the
+ DocPasswordRequest object created internally. See
+ docpasswordrequest.hxx for more details.
+
+ @param pDefaultPasswords
+ If not null, contains default passwords that will be tried before a
+ password will be requested from the media descriptor or the user.
+
+ @param pbIsDefaultPassword
+ (output parameter) If not null, the type of the found password will
+ be returned. True means the password has been found in the passed
+ list of default passwords. False means the password has been taken
+ from the rMediaPassword parameter or has been entered by the user.
+
+ @return
+ If not empty, contains the password that has been validated by the
+ passed password verifier. If empty, no valid password has been
+ found, or the user has chossen to cancel password input.
+ */
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestAndVerifyDocPassword(
+ IDocPasswordVerifier& rVerifier,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rMediaEncData,
+ const OUString& rMediaPassword,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::task::XInteractionHandler >& rxInteractHandler,
+ const OUString& rDocumentName,
+ DocPasswordRequestType eRequestType,
+ const ::std::vector< OUString >* pDefaultPasswords = 0,
+ bool* pbIsDefaultPassword = 0 );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function tries to find a password for the document
+ described by the passed media descriptor.
+
+ First, the list of default passwords will be tried if provided. This is
+ needed by import filters for external file formats that have to check a
+ predefined password in some cases without asking the user for a
+ password. Every password is checked using the passed password verifier.
+
+ If not successful, the passed media descriptor is asked for a password,
+ that has been set e.g. by an API call to load a document. If existing,
+ the password is checked using the passed password verifier.
+
+ If still not successful, the interaction handler contained in the
+ passed nmedia descriptor is used to request a password from the user.
+ This will be repeated until the passed password verifier validates the
+ entered password, or if the user chooses to cancel password input.
+
+ @param rVerifier
+ The password verifier used to check every processed password.
+
+ @param rMediaDesc
+ The media descriptor of the document that needs to be opened with
+ a password. If a valid password (that is not contained in the
+ passed list of default passwords) was found, it will be inserted
+ into the "Password" property of this descriptor.
+
+ @param eRequestType
+ The password request type that will be passed to the
+ DocPasswordRequest object created internally. See
+ docpasswordrequest.hxx for more details.
+
+ @param pDefaultPasswords
+ If not null, contains default passwords that will be tried before a
+ password will be requested from the media descriptor or the user.
+
+ @return
+ If not empty, contains the password that has been validated by the
+ passed password verifier. If empty, no valid password has been
+ found, or the user has chossen to cancel password input.
+ */
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestAndVerifyDocPassword(
+ IDocPasswordVerifier& rVerifier,
+ MediaDescriptor& rMediaDesc,
+ DocPasswordRequestType eRequestType,
+ const ::std::vector< OUString >* pDefaultPasswords = 0 );
+
+ // ------------------------------------------------------------------------
+
+private:
+ ~DocPasswordHelper();
+};
+
+// ============================================================================
+
+} // namespace comphelper
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/docpasswordrequest.hxx b/include/comphelper/docpasswordrequest.hxx
new file mode 100644
index 000000000000..54a32f522ae6
--- /dev/null
+++ b/include/comphelper/docpasswordrequest.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_DOCPASSWORDREQUEST_HXX
+#define COMPHELPER_DOCPASSWORDREQUEST_HXX
+
+#include "comphelper/comphelperdllapi.h"
+#include <com/sun/star/task/PasswordRequestMode.hpp>
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/weak.hxx>
+
+
+namespace comphelper {
+
+class AbortContinuation;
+class PasswordContinuation;
+
+// ============================================================================
+
+/** Selects which UNO document password request type to use. */
+enum DocPasswordRequestType
+{
+ DocPasswordRequestType_STANDARD, /// Uses the standard com.sun.star.task.DocumentPasswordRequest request.
+ DocPasswordRequestType_MS /// Uses the com.sun.star.task.DocumentMSPasswordRequest request.
+};
+
+// ============================================================================
+
+class COMPHELPER_DLLPUBLIC SimplePasswordRequest :
+ public ::com::sun::star::task::XInteractionRequest,
+ public ::cppu::OWeakObject
+{
+public:
+ explicit SimplePasswordRequest( com::sun::star::task::PasswordRequestMode eMode );
+ virtual ~SimplePasswordRequest();
+
+ // XInterface / OWeakObject
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
+ sal_Bool isPassword() const;
+
+ OUString getPassword() const;
+
+private:
+ // XInteractionRequest
+ virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() throw( ::com::sun::star::uno::RuntimeException );
+
+private:
+ ::com::sun::star::uno::Any maRequest;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > maContinuations;
+ AbortContinuation * mpAbort;
+ PasswordContinuation * mpPassword;
+};
+
+// ============================================================================
+
+/** Implements the task.XInteractionRequest interface for requesting a password
+ string for a document.
+ */
+class COMPHELPER_DLLPUBLIC DocPasswordRequest :
+ public ::com::sun::star::task::XInteractionRequest,
+ public ::cppu::OWeakObject
+{
+public:
+ explicit DocPasswordRequest(
+ DocPasswordRequestType eType,
+ ::com::sun::star::task::PasswordRequestMode eMode,
+ const OUString& rDocumentName,
+ sal_Bool bPasswordToModify = sal_False );
+ virtual ~DocPasswordRequest();
+
+ // XInterface / OWeakObject
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
+ sal_Bool isPassword() const;
+
+ OUString getPassword() const;
+
+ OUString getPasswordToModify() const;
+ sal_Bool getRecommendReadOnly() const;
+
+private:
+ // XInteractionRequest
+ virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() throw( ::com::sun::star::uno::RuntimeException );
+
+private:
+ ::com::sun::star::uno::Any maRequest;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > maContinuations;
+ AbortContinuation * mpAbort;
+ PasswordContinuation * mpPassword;
+};
+
+// ============================================================================
+
+} // namespace comphelper
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/documentconstants.hxx b/include/comphelper/documentconstants.hxx
new file mode 100644
index 000000000000..2bc00220995f
--- /dev/null
+++ b/include/comphelper/documentconstants.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 _COMPHELPER_DOCUMENTCONSTANTS_HXX
+#define _COMPHELPER_DOCUMENTCONSTANTS_HXX
+
+#include <rtl/ustring.hxx>
+
+// formats of SO6/7
+#define MIMETYPE_VND_SUN_XML_WRITER_ASCII "application/vnd.sun.xml.writer"
+#define MIMETYPE_VND_SUN_XML_WRITER_WEB_ASCII "application/vnd.sun.xml.writer.web"
+#define MIMETYPE_VND_SUN_XML_WRITER_GLOBAL_ASCII "application/vnd.sun.xml.writer.global"
+#define MIMETYPE_VND_SUN_XML_DRAW_ASCII "application/vnd.sun.xml.draw"
+#define MIMETYPE_VND_SUN_XML_IMPRESS_ASCII "application/vnd.sun.xml.impress"
+#define MIMETYPE_VND_SUN_XML_CALC_ASCII "application/vnd.sun.xml.calc"
+#define MIMETYPE_VND_SUN_XML_CHART_ASCII "application/vnd.sun.xml.chart"
+#define MIMETYPE_VND_SUN_XML_MATH_ASCII "application/vnd.sun.xml.math"
+#define MIMETYPE_VND_SUN_XML_BASE_ASCII "application/vnd.sun.xml.base"
+
+#define MIMETYPE_VND_SUN_XML_WRITER OUString( MIMETYPE_VND_SUN_XML_WRITER_ASCII )
+#define MIMETYPE_VND_SUN_XML_WRITER_WEB OUString( MIMETYPE_VND_SUN_XML_WRITER_WEB_ASCII )
+#define MIMETYPE_VND_SUN_XML_WRITER_GLOBAL OUString( MIMETYPE_VND_SUN_XML_WRITER_GLOBAL_ASCII )
+#define MIMETYPE_VND_SUN_XML_DRAW OUString( MIMETYPE_VND_SUN_XML_DRAW_ASCII )
+#define MIMETYPE_VND_SUN_XML_IMPRESS OUString( MIMETYPE_VND_SUN_XML_IMPRESS_ASCII )
+#define MIMETYPE_VND_SUN_XML_CALC OUString( MIMETYPE_VND_SUN_XML_CALC_ASCII )
+#define MIMETYPE_VND_SUN_XML_CHART OUString( MIMETYPE_VND_SUN_XML_CHART_ASCII )
+#define MIMETYPE_VND_SUN_XML_MATH OUString( MIMETYPE_VND_SUN_XML_MATH_ASCII )
+#define MIMETYPE_VND_SUN_XML_BASE OUString( MIMETYPE_VND_SUN_XML_BASE_ASCII )
+
+// template formats of SO6/7
+#define MIMETYPE_VND_SUN_XML_WRITER_TEMPLATE_ASCII "application/vnd.sun.xml.writer.template"
+#define MIMETYPE_VND_SUN_XML_DRAW_TEMPLATE_ASCII "application/vnd.sun.xml.draw.template"
+#define MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE_ASCII "application/vnd.sun.xml.impress.template"
+#define MIMETYPE_VND_SUN_XML_CALC_TEMPLATE_ASCII "application/vnd.sun.xml.calc.template"
+
+#define MIMETYPE_VND_SUN_XML_WRITER_TEMPLATE OUString( MIMETYPE_VND_SUN_XML_WRITER_ASCII )
+#define MIMETYPE_VND_SUN_XML_DRAW_TEMPLATE OUString( MIMETYPE_VND_SUN_XML_DRAW_ASCII )
+#define MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE OUString( MIMETYPE_VND_SUN_XML_IMPRESS_ASCII )
+#define MIMETYPE_VND_SUN_XML_CALC_TEMPLATE OUString( MIMETYPE_VND_SUN_XML_CALC_ASCII )
+
+// formats of SO8
+#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII "application/vnd.oasis.opendocument.text"
+#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII "application/vnd.oasis.opendocument.text-web"
+#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_ASCII "application/vnd.oasis.opendocument.text-master"
+#define MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_ASCII "application/vnd.oasis.opendocument.graphics"
+#define MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII "application/vnd.oasis.opendocument.presentation"
+#define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII "application/vnd.oasis.opendocument.spreadsheet"
+#define MIMETYPE_OASIS_OPENDOCUMENT_CHART_ASCII "application/vnd.oasis.opendocument.chart"
+#define MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII "application/vnd.oasis.opendocument.formula"
+#define MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII "application/vnd.oasis.opendocument.base"
+#define MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII "application/vnd.sun.xml.report"
+#define MIMETYPE_OASIS_OPENDOCUMENT_REPORT_CHART_ASCII "application/vnd.sun.xml.report.chart"
+
+#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT OUString( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB OUString( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL OUString( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_DRAWING OUString( MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION OUString( MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET OUString( MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_CHART OUString( MIMETYPE_OASIS_OPENDOCUMENT_CHART_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_FORMULA OUString( MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_DATABASE OUString( MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_REPORT OUString( MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_REPORT_CHART OUString( MIMETYPE_OASIS_OPENDOCUMENT_REPORT_CHART_ASCII )
+
+// template formats of SO8
+#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII "application/vnd.oasis.opendocument.text-template"
+#define MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII "application/vnd.oasis.opendocument.graphics-template"
+#define MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII "application/vnd.oasis.opendocument.presentation-template"
+#define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII "application/vnd.oasis.opendocument.spreadsheet-template"
+#define MIMETYPE_OASIS_OPENDOCUMENT_CHART_TEMPLATE_ASCII "application/vnd.oasis.opendocument.chart-template"
+#define MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII "application/vnd.oasis.opendocument.formula-template"
+
+#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_CHART_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_CHART_TEMPLATE_ASCII )
+#define MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE OUString( MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII )
+
+// ODF versions
+#define ODFVER_010_TEXT_ASCII "1.0"
+#define ODFVER_011_TEXT_ASCII "1.1"
+#define ODFVER_012_TEXT_ASCII "1.2"
+
+#define ODFVER_010_TEXT OUString( ODFVER_010_TEXT_ASCII )
+#define ODFVER_011_TEXT OUString( ODFVER_011_TEXT_ASCII )
+#define ODFVER_012_TEXT OUString( ODFVER_012_TEXT_ASCII )
+#endif
+
+// filter flags
+// TODO/LATER: The flags should be part of the UNO specification
+
+// Note that these flag bits have parallel names in
+// filter/source/config/cache/constant.hxx. Some of the bits are
+// missing from there, and some have different names. But the meaning
+// is presumably the same, and the values are the same.
+
+// http://www.mail-archive.com/dev@openoffice.org/msg05047.html says:
+
+// I can just sum up what comes into my mind, hope I don't miss one:
+
+// Import - should be self explaining
+// Export - should be self explaining
+// Template - deprecated
+// TemplatePath - filter for a documenttemplate
+// Own - one of the OOo file formats
+// Alien - no zip container based format
+// Preferred - preferred filter for a particular type
+// Asynchron - deprecated, only HTML-filter isn't synchron
+// 3rdPartyFilter - implemented as a UNO component
+// Default - default filter for this document type
+// NotInFileDialog - should be self explaining
+// NotInChooser - as above
+
+// (The 3rdPartyFilter flag is here called StarONE)
+
+// At some point (4.0?) we should drop the duplicate set of names over
+// in filter, and rename the obscure ones to describe their meaning
+// using terms that are understandable.
+
+#define SFX_FILTER_IMPORT 0x00000001L
+#define SFX_FILTER_EXPORT 0x00000002L
+#define SFX_FILTER_TEMPLATE 0x00000004L
+#define SFX_FILTER_INTERNAL 0x00000008L
+#define SFX_FILTER_TEMPLATEPATH 0x00000010L
+#define SFX_FILTER_OWN 0x00000020L
+#define SFX_FILTER_ALIEN 0x00000040L
+#define SFX_FILTER_USESOPTIONS 0x00000080L
+
+#define SFX_FILTER_DEFAULT 0x00000100L
+#define SFX_FILTER_EXECUTABLE 0x00000200L
+#define SFX_FILTER_SUPPORTSSELECTION 0x00000400L
+#define SFX_FILTER_MAPTOAPPPLUG 0x00000800L
+#define SFX_FILTER_NOTINFILEDLG 0x00001000L
+#define SFX_FILTER_NOTINCHOOSER 0x00002000L
+#define SFX_FILTER_ASYNC 0x00004000L
+#define SFX_FILTER_CREATOR 0x00008000L
+#define SFX_FILTER_OPENREADONLY 0x00010000L
+#define SFX_FILTER_MUSTINSTALL 0x00020000L
+#define SFX_FILTER_CONSULTSERVICE 0x00040000L
+
+#define SFX_FILTER_STARONEFILTER 0x00080000L
+#define SFX_FILTER_PACKED 0x00100000L
+
+#define SFX_FILTER_BROWSERPREFERED 0x00400000L
+
+#define SFX_FILTER_ENCRYPTION 0x01000000L
+#define SFX_FILTER_PASSWORDTOMODIFY 0x02000000L
+
+#define SFX_FILTER_PREFERED 0x10000000L
+
+#define SFX_FILTER_VERSION_NONE 0
+#define SFX_FILTER_NOTINSTALLED SFX_FILTER_MUSTINSTALL | SFX_FILTER_CONSULTSERVICE
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/documentinfo.hxx b/include/comphelper/documentinfo.hxx
new file mode 100644
index 000000000000..48bc39a8cc00
--- /dev/null
+++ b/include/comphelper/documentinfo.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 COMPHELPER_DOCUMENTINFO_HXX
+#define COMPHELPER_DOCUMENTINFO_HXX
+
+#include "comphelper/comphelperdllapi.h"
+
+#include <com/sun/star/frame/XModel.hpp>
+
+//........................................................................
+namespace comphelper {
+//........................................................................
+
+ //====================================================================
+ //= DocumentInfo
+ //====================================================================
+ class COMPHELPER_DLLPUBLIC DocumentInfo
+ {
+ public:
+ /** retrieves the UI title of the given document
+ */
+ static OUString getDocumentTitle( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxDocument );
+
+ private:
+ DocumentInfo(); // never implemented
+ };
+
+//........................................................................
+} // namespace comphelper
+//........................................................................
+
+#endif // COMPHELPER_DOCUMENTINFO_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/embeddedobjectcontainer.hxx b/include/comphelper/embeddedobjectcontainer.hxx
new file mode 100644
index 000000000000..0347e12ba2c2
--- /dev/null
+++ b/include/comphelper/embeddedobjectcontainer.hxx
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _COMPHELPER_OBJECTCONTAINER_HXX_
+#define _COMPHELPER_OBJECTCONTAINER_HXX_
+
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+#include <rtl/ustring.hxx>
+
+namespace comphelper
+{
+ class EmbeddedObjectContainer;
+ /** Helper interface to give access to some common object which replace the SfxObjectShell
+ */
+ class SAL_NO_VTABLE IEmbeddedHelper
+ {
+ public:
+ virtual EmbeddedObjectContainer& getEmbeddedObjectContainer() const = 0;
+ virtual com::sun::star::uno::Reference < com::sun::star::embed::XStorage > getStorage() const = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > getInteractionHandler() const = 0;
+ virtual bool isEnableSetModified() const = 0;
+
+ protected:
+ ~IEmbeddedHelper() {}
+ };
+
+struct EmbedImpl;
+class COMPHELPER_DLLPUBLIC EmbeddedObjectContainer
+{
+ EmbedImpl* pImpl;
+
+ ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > Get_Impl( const OUString&,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xCopy);
+
+public:
+ // add an embedded object to the container storage
+ sal_Bool StoreEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, OUString&, sal_Bool );
+
+ // add an embedded object that has been imported from the container storage - should only be called by filters!
+ void AddEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, const OUString& );
+
+ EmbeddedObjectContainer();
+ EmbeddedObjectContainer( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& );
+ EmbeddedObjectContainer( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&,
+ const com::sun::star::uno::Reference < com::sun::star::uno::XInterface >& );
+ ~EmbeddedObjectContainer();
+
+ void SwitchPersistence( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& );
+ sal_Bool CommitImageSubStorage();
+ void ReleaseImageSubStorage();
+
+ OUString CreateUniqueObjectName();
+
+ // get a list of object names that have been added so far
+ com::sun::star::uno::Sequence < OUString > GetObjectNames();
+
+ // check for existence of objects at all
+ sal_Bool HasEmbeddedObjects();
+
+ // check existence of an object - either by identity or by name
+ sal_Bool HasEmbeddedObject( const OUString& );
+ sal_Bool HasEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& );
+ sal_Bool HasInstantiatedEmbeddedObject( const OUString& );
+
+ // get the object name of an object - this is the persist name if the object has persistence
+ OUString GetEmbeddedObjectName( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& );
+
+ // retrieve an embedded object by name that either has been added already or is available in the container storage
+ ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > GetEmbeddedObject( const OUString& );
+
+ // create an object from a ClassId
+ ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >
+ CreateEmbeddedObject( const com::sun::star::uno::Sequence < sal_Int8 >&, OUString& );
+
+ ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >
+ CreateEmbeddedObject( const com::sun::star::uno::Sequence < sal_Int8 >&,
+ const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, OUString& );
+
+ // insert an embedded object into the container - objects persistent representation will be added to the storage
+ sal_Bool InsertEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, OUString& );
+
+ // load an embedded object from a MediaDescriptor and insert it into the container
+ // a new object will be created from the new content and returned
+ ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >
+ InsertEmbeddedObject( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, OUString& );
+
+ // create an embedded link based on a MediaDescriptor and insert it into the container
+ // a new object will be created from the new content and returned
+ ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >
+ InsertEmbeddedLink( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, OUString& );
+
+ // create an object from a stream that contains its persistent representation and insert it as usual (usually called from clipboard)
+ // a new object will be created from the new content and returned
+ ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >
+ InsertEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream >&, OUString& );
+
+ // copy an embedded object into the storage, open the new copy and return it
+ ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > CopyAndGetEmbeddedObject( EmbeddedObjectContainer& rSrc, const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, /* TODO const OUString& aOrigName,*/ OUString& rName );
+
+ // move an embedded object from one container to another one
+ sal_Bool MoveEmbeddedObject( EmbeddedObjectContainer& rSrc, const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, OUString& );
+
+ // remove an embedded object from the container and from the storage; if object can't be closed
+ sal_Bool RemoveEmbeddedObject( const OUString& rName, sal_Bool bClose=sal_True );
+ sal_Bool RemoveEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, sal_Bool bClose=sal_True );
+
+ // close and remove an embedded object from the container without removing it from the storage
+ sal_Bool CloseEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& );
+
+ // move an embedded object to another container (keep the persistent name)
+ sal_Bool MoveEmbeddedObject( const OUString& rName, EmbeddedObjectContainer& );
+
+ // get the stored graphical representation for the object
+ com::sun::star::uno::Reference < com::sun::star::io::XInputStream > GetGraphicStream( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, OUString* pMediaType=0 );
+
+ // get the stored graphical representation by the object name
+ com::sun::star::uno::Reference < com::sun::star::io::XInputStream > GetGraphicStream( const OUString& aName, OUString* pMediaType=0 );
+
+ // add a graphical representation for an object
+ sal_Bool InsertGraphicStream( const com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& rStream, const OUString& rObjectName, const OUString& rMediaType );
+
+ // try to add a graphical representation for an object in optimized way ( might fail )
+ sal_Bool InsertGraphicStreamDirectly( const com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& rStream, const OUString& rObjectName, const OUString& rMediaType );
+
+ // remove a graphical representation for an object
+ sal_Bool RemoveGraphicStream( const OUString& rObjectName );
+
+ // copy the graphical representation from different container
+ sal_Bool TryToCopyGraphReplacement( EmbeddedObjectContainer& rSrc,
+ const OUString& aOrigName,
+ const OUString& aTargetName );
+
+ void CloseEmbeddedObjects();
+ sal_Bool StoreChildren(sal_Bool _bOasisFormat,sal_Bool _bObjectsOnly);
+ sal_Bool StoreAsChildren( sal_Bool _bOasisFormat
+ ,sal_Bool _bCreateEmbedded
+ ,const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& _xStorage);
+
+ static com::sun::star::uno::Reference< com::sun::star::io::XInputStream > GetGraphicReplacementStream(
+ sal_Int64 nViewAspect,
+ const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >&,
+ OUString* pMediaType );
+
+ /** call setPersistentEntry for each embedded object in the container
+ *
+ * \param _xStorage The storeage where to store the objects.
+ * \param _bClearModifedFlag If <TRUE/> then the modifed flag will be set to <FALSE/> otherwise nothing happen.
+ * \return <FALSE/> if no error occurred, otherwise <TRUE/>.
+ */
+ sal_Bool SetPersistentEntries(const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& _xStorage,bool _bClearModifedFlag = true);
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/enumhelper.hxx b/include/comphelper/enumhelper.hxx
new file mode 100644
index 000000000000..9870291b22f5
--- /dev/null
+++ b/include/comphelper/enumhelper.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 _COMPHELPER_ENUMHELPER_HXX_
+#define _COMPHELPER_ENUMHELPER_HXX_
+
+#include <vector>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XEnumeration.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <osl/mutex.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ namespace starcontainer = ::com::sun::star::container;
+ namespace staruno = ::com::sun::star::uno;
+ namespace starlang = ::com::sun::star::lang;
+
+//==================================================================
+//= OEnumerationLock
+//==================================================================
+struct OEnumerationLock
+{
+ public:
+ ::osl::Mutex m_aLock;
+};
+
+//==================================================================
+//= OEnumerationByName
+//==================================================================
+/** provides an <type scope="com.sun.star.container">XEnumeration</type> access based
+ on an object implementing the <type scope="com.sun.star.container">XNameAccess</type> interface
+*/
+class COMPHELPER_DLLPUBLIC OEnumerationByName : private OEnumerationLock
+ , public ::cppu::WeakImplHelper2< starcontainer::XEnumeration ,
+ starlang::XEventListener >
+{
+ staruno::Sequence< OUString > m_aNames;
+ sal_Int32 m_nPos;
+ staruno::Reference< starcontainer::XNameAccess > m_xAccess;
+ sal_Bool m_bListening;
+
+public:
+ OEnumerationByName(const staruno::Reference< starcontainer::XNameAccess >& _rxAccess);
+ OEnumerationByName(const staruno::Reference< starcontainer::XNameAccess >& _rxAccess,
+ const staruno::Sequence< OUString >& _aNames );
+ virtual ~OEnumerationByName();
+
+ virtual sal_Bool SAL_CALL hasMoreElements( ) throw(staruno::RuntimeException);
+ virtual staruno::Any SAL_CALL nextElement( )
+ throw(starcontainer::NoSuchElementException, starlang::WrappedTargetException, staruno::RuntimeException);
+
+ virtual void SAL_CALL disposing(const starlang::EventObject& aEvent) throw(staruno::RuntimeException);
+
+private:
+ COMPHELPER_DLLPRIVATE void impl_startDisposeListening();
+ COMPHELPER_DLLPRIVATE void impl_stopDisposeListening();
+};
+
+//==================================================================
+//= OEnumerationByIndex
+//==================================================================
+/** provides an <type scope="com.sun.star.container">XEnumeration</type> access based
+ on an object implementing the <type scope="com.sun.star.container">XNameAccess</type> interface
+*/
+class COMPHELPER_DLLPUBLIC OEnumerationByIndex : private OEnumerationLock
+ , public ::cppu::WeakImplHelper2< starcontainer::XEnumeration ,
+ starlang::XEventListener >
+{
+ sal_Int32 m_nPos;
+ staruno::Reference< starcontainer::XIndexAccess > m_xAccess;
+ sal_Bool m_bListening;
+
+public:
+ OEnumerationByIndex(const staruno::Reference< starcontainer::XIndexAccess >& _rxAccess);
+ virtual ~OEnumerationByIndex();
+
+ virtual sal_Bool SAL_CALL hasMoreElements( ) throw(staruno::RuntimeException);
+ virtual staruno::Any SAL_CALL nextElement( )
+ throw(starcontainer::NoSuchElementException, starlang::WrappedTargetException, staruno::RuntimeException);
+
+ virtual void SAL_CALL disposing(const starlang::EventObject& aEvent) throw(staruno::RuntimeException);
+
+private:
+ COMPHELPER_DLLPRIVATE void impl_startDisposeListening();
+ COMPHELPER_DLLPRIVATE void impl_stopDisposeListening();
+};
+
+//==================================================================
+//= OAnyEnumeration
+//==================================================================
+/** provides an <type scope="com.sun.star.container">XEnumeration</type>
+ for an outside set vector of Any's.
+
+*/
+class COMPHELPER_DLLPUBLIC OAnyEnumeration : private OEnumerationLock
+ , public ::cppu::WeakImplHelper1< starcontainer::XEnumeration >
+{
+ sal_Int32 m_nPos;
+ staruno::Sequence< staruno::Any > m_lItems;
+
+public:
+ OAnyEnumeration(const staruno::Sequence< staruno::Any >& lItems);
+ virtual ~OAnyEnumeration();
+
+ virtual sal_Bool SAL_CALL hasMoreElements( ) throw(staruno::RuntimeException);
+ virtual staruno::Any SAL_CALL nextElement( )
+ throw(starcontainer::NoSuchElementException, starlang::WrappedTargetException, staruno::RuntimeException);
+
+};
+
+//.........................................................................
+}
+//... namespace comphelper .......................................................
+
+#endif // _COMPHELPER_ENUMHELPER_HXX_
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/eventattachermgr.hxx b/include/comphelper/eventattachermgr.hxx
new file mode 100644
index 000000000000..a525e7c4ea54
--- /dev/null
+++ b/include/comphelper/eventattachermgr.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 _COMPHELPER_EVENTATTACHERMGR_HXX_
+#define _COMPHELPER_EVENTATTACHERMGR_HXX_
+
+#include <com/sun/star/uno/Reference.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+namespace com { namespace sun { namespace star {
+namespace uno {
+ class Exception;
+ class XComponentContext;
+}
+namespace script {
+ class XEventAttacherManager;
+}
+namespace beans {
+ class XIntrospection;
+}
+} } }
+
+
+namespace comphelper
+{
+
+COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::script::XEventAttacherManager >
+createEventAttacherManager(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext )
+ throw( ::com::sun::star::uno::Exception );
+
+}
+
+#endif // _COMPHELPER_EVENTATTACHERMGR_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/evtlistenerhlp.hxx b/include/comphelper/evtlistenerhlp.hxx
new file mode 100644
index 000000000000..c1bb01fa3aa4
--- /dev/null
+++ b/include/comphelper/evtlistenerhlp.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 COMPHELPER_EVENTLISTENERHELPER_HXX
+#define COMPHELPER_EVENTLISTENERHELPER_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <osl/diagnose.h>
+#include <cppuhelper/weakref.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+//........................................................................
+namespace comphelper
+{
+//........................................................................
+
+ //==========================================================================
+ //= OCommandsListener
+ // is helper class to avoid a cycle in refcount between the XEventListener
+ // and the member XEventBroadcaster
+ //==========================================================================
+ class COMPHELPER_DLLPUBLIC OEventListenerHelper : public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener >
+ {
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::lang::XEventListener> m_xListener;
+ public:
+ OEventListenerHelper(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener>& _rxListener);
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+ };
+//........................................................................
+} // namespace comphelper
+//........................................................................
+#endif // COMPHELPER_EVENTLISTENERHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/evtmethodhelper.hxx b/include/comphelper/evtmethodhelper.hxx
new file mode 100644
index 000000000000..7ecf08a0fc57
--- /dev/null
+++ b/include/comphelper/evtmethodhelper.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 COMPHELPER_EVENTMEHODHELPER_HXX
+#define COMPHELPER_EVENMETHODHELPER_HXX
+#include <comphelper/sequence.hxx>
+//........................................................................
+namespace comphelper
+{
+ COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< OUString> getEventMethodsForType(const ::com::sun::star::uno::Type& type);
+//........................................................................
+
+} // namespace comphelper
+//........................................................................
+#endif // COMPHELPER_EVENTMEHODHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/extract.hxx b/include/comphelper/extract.hxx
new file mode 100644
index 000000000000..30cbaaefc6c9
--- /dev/null
+++ b/include/comphelper/extract.hxx
@@ -0,0 +1,158 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _COMPHELPER_EXTRACT_HXX_
+#define _COMPHELPER_EXTRACT_HXX_
+
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/uno/TypeClass.hpp>
+#include <com/sun/star/uno/Type.hxx>
+#include <com/sun/star/uno/Any.hxx>
+#include "cppu/unotype.hxx"
+
+namespace cppu
+{
+
+/**
+ * Sets enum from int32 value. This function does NOT check for valid enum values!
+ *<BR>
+ * @param nEnum int32 enum value
+ * @param rType enum type
+ * @return enum or emoty any.
+ */
+inline ::com::sun::star::uno::Any SAL_CALL int2enum(
+ sal_Int32 nEnum, const ::com::sun::star::uno::Type & rType )
+{
+ if (rType.getTypeClass() == ::com::sun::star::uno::TypeClass_ENUM)
+ {
+ int nVal = nEnum;
+ return ::com::sun::star::uno::Any( &nVal, rType );
+ }
+ return ::com::sun::star::uno::Any();
+}
+
+/**
+ * Sets int32 from enum or int in any.
+ *<BR>
+ * @param rnEnum [out] int32 enum value
+ * @param rAny enum or int
+ * @param sal_True if enum or int value was set else sal_False.
+ */
+inline sal_Bool SAL_CALL enum2int( sal_Int32 & rnEnum, const ::com::sun::star::uno::Any & rAny )
+{
+ if (rAny.getValueTypeClass() == ::com::sun::star::uno::TypeClass_ENUM)
+ {
+ rnEnum = * reinterpret_cast< const int * >( rAny.getValue() );
+ return sal_True;
+ }
+
+ return rAny >>= rnEnum;
+}
+
+/**
+ * Sets int32 from enum or int in any with additional typecheck
+ * <BR>
+ * @param rAny enum or int
+ * @param eRet the enum value as int. If there is not enum of the given type or
+ * a ::com::sun::star::lang::IllegalArgumentException is thrown
+ */
+template< typename E >
+inline void SAL_CALL any2enum( E & eRet, const ::com::sun::star::uno::Any & rAny )
+ throw( ::com::sun::star::lang::IllegalArgumentException )
+{
+ // check for type save enum
+ if (! (rAny >>= eRet))
+ {
+ // if not enum, maybe integer?
+ sal_Int32 nValue = 0;
+ if (! (rAny >>= nValue))
+ throw ::com::sun::star::lang::IllegalArgumentException();
+
+ eRet = (E)nValue;
+ }
+}
+
+/**
+ * Template function to create an uno::Any from an enum
+ *
+ * @DEPRECATED : use makeAny< E >()
+ *
+ */
+template< typename E >
+inline ::com::sun::star::uno::Any SAL_CALL enum2any( E eEnum )
+{
+ return ::com::sun::star::uno::Any( &eEnum, ::cppu::UnoType< E >::get() );
+}
+
+/**
+ * Extracts interface from an any. If given any does not hold the demanded interface,
+ * it will be queried for it.
+ * If no interface is available, the out ref will be cleared.
+ *<BR>
+ * @param rxOut [out] demanded interface
+ * @param rAny interface
+ * @return sal_True if any reference (including the null ref) was retrieved from any else sal_False.
+ */
+template< class T >
+inline sal_Bool SAL_CALL extractInterface(
+ ::com::sun::star::uno::Reference< T > & rxOut,
+ const ::com::sun::star::uno::Any & rAny )
+{
+ rxOut.clear();
+ return (rAny >>= rxOut);
+}
+
+/**
+ * extracts a boolean either as a sal_Bool or an integer from
+ * an any. If there is no sal_Bool or integer inside the any
+ * a ::com::sun::star::lang::IllegalArgumentException is thrown
+ *
+ */
+inline sal_Bool SAL_CALL any2bool( const ::com::sun::star::uno::Any & rAny )
+ throw( ::com::sun::star::lang::IllegalArgumentException )
+{
+ if (rAny.getValueTypeClass() == ::com::sun::star::uno::TypeClass_BOOLEAN)
+ {
+ return *(sal_Bool *)rAny.getValue();
+ }
+ else
+ {
+ sal_Int32 nValue = 0;
+ if (! (rAny >>= nValue))
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return nValue != 0;
+ }
+}
+
+/**
+ * Puts a boolean in an any.
+ *
+ * @DEPRECATED : use makeAny< sal_Bool >()
+ *
+ */
+inline ::com::sun::star::uno::Any SAL_CALL bool2any( sal_Bool bBool )
+{
+ return ::com::sun::star::uno::Any( &bBool, ::getCppuBooleanType() );
+}
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/fileformat.h b/include/comphelper/fileformat.h
new file mode 100644
index 000000000000..dbd3f32a1f9a
--- /dev/null
+++ b/include/comphelper/fileformat.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_FILEFORMAT_H_
+#define _COMPHELPER_FILEFORMAT_H_
+
+/* file format versions *************************************************/
+
+#define SOFFICE_FILEFORMAT_31 3450
+#define SOFFICE_FILEFORMAT_40 3580
+#define SOFFICE_FILEFORMAT_50 5050
+#define SOFFICE_FILEFORMAT_60 6200
+#define SOFFICE_FILEFORMAT_8 6800
+#define SOFFICE_FILEFORMAT_CURRENT SOFFICE_FILEFORMAT_8
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/flagguard.hxx b/include/comphelper/flagguard.hxx
new file mode 100644
index 000000000000..af1f1ea1e4fd
--- /dev/null
+++ b/include/comphelper/flagguard.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 COMPHELPER_FLAGGUARD_HXX
+#define COMPHELPER_FLAGGUARD_HXX
+
+#include "comphelper/scopeguard.hxx"
+
+//......................................................................................................................
+namespace comphelper
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= FlagRestorationGuard
+ //==================================================================================================================
+ class COMPHELPER_DLLPUBLIC FlagRestorationGuard : public ScopeGuard
+ {
+ public:
+ FlagRestorationGuard( bool& i_flagRef, bool i_temporaryValue, exc_handling i_excHandling = IGNORE_EXCEPTIONS )
+ :ScopeGuard( ::boost::bind( RestoreFlag, ::boost::ref( i_flagRef ), !!i_flagRef ), i_excHandling )
+ {
+ i_flagRef = i_temporaryValue;
+ }
+
+ ~FlagRestorationGuard();
+
+ private:
+ static void RestoreFlag( bool& i_flagRef, bool i_originalValue )
+ {
+ i_flagRef = i_originalValue;
+ }
+ };
+
+ //==================================================================================================================
+ //= FlagGuard
+ //==================================================================================================================
+ class COMPHELPER_DLLPUBLIC FlagGuard : public ScopeGuard
+ {
+ public:
+ explicit FlagGuard( bool& i_flagRef, exc_handling i_excHandling = IGNORE_EXCEPTIONS )
+ :ScopeGuard( ::boost::bind( ResetFlag, ::boost::ref( i_flagRef ) ), i_excHandling )
+ {
+ i_flagRef = true;
+ }
+
+ ~FlagGuard();
+
+ private:
+ static void ResetFlag( bool& i_flagRef )
+ {
+ i_flagRef = false;
+ }
+ };
+
+//......................................................................................................................
+} // namespace comphelper
+//......................................................................................................................
+
+#endif // COMPHELPER_FLAGGUARD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/genericpropertyset.hxx b/include/comphelper/genericpropertyset.hxx
new file mode 100644
index 000000000000..e46c30a4cad4
--- /dev/null
+++ b/include/comphelper/genericpropertyset.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_GENERICPROPERTYSET_HXX_
+#define _COMPHELPER_GENERICPROPERTYSET_HXX_
+
+#include <comphelper/propertysetinfo.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+namespace comphelper
+{
+ COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GenericPropertySet_CreateInstance( PropertySetInfo* pInfo );
+}
+
+#endif // _COMPHELPER_GENERICPROPERTYSET_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/guarding.hxx b/include/comphelper/guarding.hxx
new file mode 100644
index 000000000000..3931c0284e31
--- /dev/null
+++ b/include/comphelper/guarding.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 _COMPHELPER_GUARDING_HXX_
+#define _COMPHELPER_GUARDING_HXX_
+
+#include <osl/mutex.hxx>
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+// ===================================================================================================
+// = class MutexRelease -
+// ===================================================================================================
+
+/** opposite of OGuard :)
+ (a mutex is released within the constructor and acquired within the desctructor)
+ use only when you're sure the mutex is acquired !
+*/
+template <class MUTEX>
+class ORelease
+{
+ MUTEX& m_rMutex;
+
+public:
+ ORelease(MUTEX& _rMutex) : m_rMutex(_rMutex) { _rMutex.release(); }
+ ~ORelease() { m_rMutex.acquire(); }
+};
+
+typedef ORelease< ::osl::Mutex > MutexRelease;
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // _COMPHELPER_GUARDING_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/ihwrapnofilter.hxx b/include/comphelper/ihwrapnofilter.hxx
new file mode 100644
index 000000000000..eb0b13957874
--- /dev/null
+++ b/include/comphelper/ihwrapnofilter.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 _COMPHELPER_INTERACTIONHANDLERWRAPPER_HXX_
+#define _COMPHELPER_INTERACTIONHANDLERWRAPPER_HXX_
+
+#include <com/sun/star/task/XInteractionHandler2.hpp>
+#ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XINTERACITONREQUEST_
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_DOUBLEINITIALIZATIONEXCEPTION_
+#include <com/sun/star/frame/DoubleInitializationException.hpp>
+#endif
+
+#include <cppuhelper/implbase2.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+namespace comphelper {
+
+ class COMPHELPER_DLLPUBLIC OIHWrapNoFilterDialog : public ::cppu::WeakImplHelper2
+ < ::com::sun::star::task::XInteractionHandler2
+ , ::com::sun::star::lang::XServiceInfo >
+ {
+ com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > m_xInter;
+
+ public:
+ OIHWrapNoFilterDialog( com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > xInteraction );
+ ~OIHWrapNoFilterDialog();
+
+ static OUString SAL_CALL impl_staticGetImplementationName();
+ static ::com::sun::star::uno::Sequence< OUString > SAL_CALL impl_staticGetSupportedServiceNames();
+
+
+ //____________________________________________________________________________________________________
+ // XInteractionHandler
+ //____________________________________________________________________________________________________
+
+ virtual void SAL_CALL handle( const com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest >& xRequest)
+ throw( com::sun::star::uno::RuntimeException );
+
+ //____________________________________________________________________________________________________
+ // XInteractionHandler2
+ //____________________________________________________________________________________________________
+
+ virtual sal_Bool SAL_CALL handleInteractionRequest( const com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest >& xRequest)
+ throw( com::sun::star::uno::RuntimeException );
+
+ //____________________________________________________________________________________________________
+ // XInitialization
+ //____________________________________________________________________________________________________
+
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+ throw ( ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::frame::DoubleInitializationException ) ;
+
+ //____________________________________________________________________________________________________
+ // XServiceInfo
+ //____________________________________________________________________________________________________
+
+ virtual OUString SAL_CALL getImplementationName()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ };
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/implbase_var.hxx b/include/comphelper/implbase_var.hxx
new file mode 100644
index 000000000000..fee9eb695c08
--- /dev/null
+++ b/include/comphelper/implbase_var.hxx
@@ -0,0 +1,436 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+/** This header generates the following template classes with a variable number
+ of interfaces:
+
+ comphelper::ImplHelper<N> <typename Ifc1, ..., typename Ifc<N> >
+ comphelper::WeakImplHelper<N> <typename Ifc1, ..., typename Ifc<N> >
+ comphelper::WeakComponentImplHelper<N> <typename Ifc1, ...,
+ typename Ifc<N> >
+ comphelper::ImplInheritanceHelper<N> <typename BaseClass,
+ typename Ifc1, ..., typename Ifc<N> >
+
+ as already present in headers cppuhelper/implbase<1-12>.hxx and
+ cppuhelper/compbase<1-12>.hxx.
+ <N> denotes the number of interface types passed as template arguments.
+ Don't use this header for interface numbers up to 12;
+ always use the existing cppuhelper/(impl|comp)base<1-12>.hxx headers
+ for this purpose, which eases debugging.
+
+ Including this header requires a little discipline, because it has no
+ include guards. Please use the following external include guard rule
+ where <N> is the number of interface types:
+
+ #ifndef INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_<N>
+ #define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_<N>
+ #define COMPHELPER_IMPLBASE_INTERFACE_NUMBER <N>
+ #include "comphelper/implbase_var.hxx"
+ #endif
+
+ Additionally you can
+
+ #define COMPHELPER_IMPLBASE_MAX_CTOR_ARGS <N>
+
+ to control the maximum number of templated ctor arguments for the
+ ImplInheritanceHelper<N> classes.
+ The default is a maximum of 6 arguments.
+*/
+
+#ifndef COMPHELPER_IMPLBASE_INTERFACE_NUMBER
+#error "you have to define COMPHELPER_IMPLBASE_INTERFACE_NUMBER prior to including comphelper/implbase_var.hxx!"
+#endif // ! defined(COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+
+#if !defined(COMPHELPER_IMPLBASE_TEST_PHASE) && COMPHELPER_IMPLBASE_INTERFACE_NUMBER <= 12
+#error "include proper header file: cppuhelper/implbase<N>.hxx or cppuhelper/compbase<N>.hxx!"
+#endif
+
+#ifndef COMPHELPER_IMPLBASE_MAX_CTOR_ARGS
+#define COMPHELPER_IMPLBASE_MAX_CTOR_ARGS 6 // default
+#endif
+
+#include "cppuhelper/implbase_ex.hxx"
+#include "rtl/instance.hxx"
+#include "cppuhelper/compbase_ex.hxx"
+
+#include "boost/preprocessor/cat.hpp"
+#include "boost/preprocessor/repetition.hpp"
+#include "boost/preprocessor/arithmetic/add.hpp"
+
+namespace comphelper {
+
+// Suppress warnings about hidden functions in case any of the IfcN has
+// functions named dispose, addEventListener, or removeEventListener:
+#if defined __SUNPRO_CC
+#pragma disable_warn
+#endif
+
+namespace detail {
+
+struct BOOST_PP_CAT(class_data, COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+{
+ sal_Int16 m_nTypes;
+ sal_Bool m_storedTypeRefs;
+ sal_Bool m_storedId;
+ sal_Int8 m_id[16];
+ ::cppu::type_entry m_typeEntries[COMPHELPER_IMPLBASE_INTERFACE_NUMBER + 1];
+};
+
+/// @internal
+template < BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER,
+ typename Ifc), typename Impl >
+struct BOOST_PP_CAT(ImplClassData, COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+{
+ ::cppu::class_data * operator()() {
+ static BOOST_PP_CAT(class_data, COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+ s_cd = {
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER + 1, sal_False, sal_False,
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ {
+#define COMPHELPER_IMPLBASE_classdataList(z_, n_, unused_) \
+{ { BOOST_PP_CAT(Ifc, n_)::static_type }, \
+ reinterpret_cast<sal_IntPtr>( static_cast< BOOST_PP_CAT(Ifc, n_) * >( \
+ reinterpret_cast<Impl *>(16) ) ) - 16 },
+ BOOST_PP_REPEAT(COMPHELPER_IMPLBASE_INTERFACE_NUMBER,
+ COMPHELPER_IMPLBASE_classdataList, ~)
+#undef COMPHELPER_IMPLBASE_classdataList
+ { { ::com::sun::star::lang::XTypeProvider::static_type },
+ reinterpret_cast<sal_IntPtr>(
+ static_cast< ::com::sun::star::lang::XTypeProvider * >(
+ reinterpret_cast<Impl *>(16) ) ) - 16 }
+ }
+ };
+ return reinterpret_cast< ::cppu::class_data * >(&s_cd);
+ }
+};
+
+} // namespace detail
+
+/** Implementation helper implementing interface
+ ::com::sun::star::lang::XTypeProvider and method
+ XInterface::queryInterface(), but no reference counting.
+
+ @derive
+ Inherit from this class giving your interface(s) to be implemented as
+ template argument(s). Your sub class defines method implementations for
+ these interface(s) including acquire()/release() and delegates incoming
+ queryInterface() calls to this base class.
+*/
+template< BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER,
+ typename Ifc) >
+class SAL_NO_VTABLE BOOST_PP_CAT(ImplHelper,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+ : public ::com::sun::star::lang::XTypeProvider,
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, public Ifc)
+{
+ /// @internal
+ struct cd : public ::rtl::StaticAggregate<
+ ::cppu::class_data,
+ BOOST_PP_CAT(detail::ImplClassData,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+ <
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, Ifc),
+ BOOST_PP_CAT(ImplHelper, COMPHELPER_IMPLBASE_INTERFACE_NUMBER)<
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, Ifc)>
+ > > {};
+
+protected:
+ BOOST_PP_CAT(ImplHelper, COMPHELPER_IMPLBASE_INTERFACE_NUMBER)() {}
+ virtual ~BOOST_PP_CAT(ImplHelper, COMPHELPER_IMPLBASE_INTERFACE_NUMBER)() {}
+
+public:
+ virtual ::com::sun::star::uno::Any
+ SAL_CALL queryInterface( ::com::sun::star::uno::Type const& rType )
+ throw (::com::sun::star::uno::RuntimeException)
+ { return ::cppu::ImplHelper_query( rType, cd::get(), this ); }
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
+ SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
+ { return ::cppu::ImplHelper_getTypes( cd::get() ); }
+ virtual ::com::sun::star::uno::Sequence<sal_Int8>
+ SAL_CALL getImplementationId()
+ throw (::com::sun::star::uno::RuntimeException)
+ { return ::cppu::ImplHelper_getImplementationId( cd::get() ); }
+};
+
+/** Implementation helper implementing interfaces
+ ::com::sun::star::lang::XTypeProvider and
+ ::com::sun::star::uno::XInterface
+ which supports weak mechanism to be held weakly
+ (supporting ::com::sun::star::uno::XWeak thru ::cppu::OWeakObject).
+
+ @derive
+ Inherit from this class giving your interface(s) to be implemented as
+ template argument(s). Your sub class defines method implementations for
+ these interface(s).
+*/
+template< BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER,
+ typename Ifc) >
+class SAL_NO_VTABLE BOOST_PP_CAT(WeakImplHelper,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+ : public ::cppu::OWeakObject,
+ public ::com::sun::star::lang::XTypeProvider,
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, public Ifc)
+{
+ /// @internal
+ struct cd : public ::rtl::StaticAggregate<
+ ::cppu::class_data,
+ BOOST_PP_CAT(detail::ImplClassData,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+ <
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, Ifc),
+ BOOST_PP_CAT(WeakImplHelper, COMPHELPER_IMPLBASE_INTERFACE_NUMBER)<
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, Ifc)>
+ > > {};
+
+public:
+ virtual ::com::sun::star::uno::Any
+ SAL_CALL queryInterface( ::com::sun::star::uno::Type const& rType )
+ throw (::com::sun::star::uno::RuntimeException)
+ {
+ return ::cppu::WeakImplHelper_query(
+ rType, cd::get(), this, static_cast<OWeakObject *>(this) );
+ }
+ virtual void SAL_CALL acquire() throw ()
+ { OWeakObject::acquire(); }
+ virtual void SAL_CALL release() throw ()
+ { OWeakObject::release(); }
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
+ SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
+ { return ::cppu::WeakImplHelper_getTypes( cd::get() ); }
+ virtual ::com::sun::star::uno::Sequence<sal_Int8>
+ SAL_CALL getImplementationId()
+ throw (::com::sun::star::uno::RuntimeException)
+ { return ::cppu::ImplHelper_getImplementationId( cd::get() ); }
+};
+
+/** Implementation helper implementing interfaces
+ ::com::sun::star::lang::XTypeProvider and
+ ::com::sun::star::uno::XInterface inherting from a BaseClass.
+
+ All acquire() and release() calls are delegated to the BaseClass.
+ Upon queryInterface(), if a demanded interface is not supported by this
+ class directly, the request is delegated to the BaseClass.
+
+ @attention
+ The BaseClass has to be complete in a sense, that
+ ::com::sun::star::uno::XInterface and
+ ::com::sun::star::lang::XTypeProvider are implemented properly.
+ The BaseClass must have at least one ctor that can be called with
+ COMPHELPER_IMPLBASE_MAX_CTOR_ARGS or fewer arguments.
+
+ @derive
+ Inherit from this class giving your additional interface(s) to be
+ implemented as template argument(s). Your sub class defines method
+ implementations for these interface(s).
+*/
+template <typename BaseClass,
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER,
+ typename Ifc) >
+class SAL_NO_VTABLE BOOST_PP_CAT(ImplInheritanceHelper,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+ : public BaseClass,
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, public Ifc)
+{
+ /// @internal
+ struct cd : public ::rtl::StaticAggregate<
+ ::cppu::class_data,
+ BOOST_PP_CAT(detail::ImplClassData,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+ <
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, Ifc),
+ BOOST_PP_CAT(ImplInheritanceHelper,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)<
+ BaseClass,
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, Ifc)>
+ > > {};
+
+protected:
+#define COMPHELPER_IMPLBASE_templctor_args(z_, n_, unused_) \
+ BOOST_PP_CAT(T, n_) const& BOOST_PP_CAT(arg, n_)
+#define COMPHELPER_IMPLBASE_templctor(z_, n_, classname_) \
+ template< BOOST_PP_ENUM_PARAMS( BOOST_PP_ADD(n_, 1), typename T) > \
+ explicit BOOST_PP_CAT(classname_, COMPHELPER_IMPLBASE_INTERFACE_NUMBER)( \
+ BOOST_PP_ENUM(BOOST_PP_ADD(n_, 1), \
+ COMPHELPER_IMPLBASE_templctor_args, ~) ) \
+ : BaseClass( BOOST_PP_ENUM_PARAMS(BOOST_PP_ADD(n_, 1), arg) ) {}
+
+ BOOST_PP_CAT(ImplInheritanceHelper, COMPHELPER_IMPLBASE_INTERFACE_NUMBER)()
+ : BaseClass() {}
+ BOOST_PP_REPEAT(COMPHELPER_IMPLBASE_MAX_CTOR_ARGS,
+ COMPHELPER_IMPLBASE_templctor, ImplInheritanceHelper)
+
+public:
+ virtual ::com::sun::star::uno::Any
+ SAL_CALL queryInterface( ::com::sun::star::uno::Type const& rType )
+ throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::com::sun::star::uno::Any const aRet(
+ ::cppu::ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
+ if (aRet.hasValue())
+ return aRet;
+ return BaseClass::queryInterface( rType );
+ }
+ virtual void SAL_CALL acquire() throw ()
+ { BaseClass::acquire(); }
+ virtual void SAL_CALL release() throw ()
+ { BaseClass::release(); }
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
+ SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
+ {
+ return ::cppu::ImplInhHelper_getTypes(
+ cd::get(), BaseClass::getTypes() );
+ }
+ virtual ::com::sun::star::uno::Sequence<sal_Int8>
+ SAL_CALL getImplementationId()
+ throw (::com::sun::star::uno::RuntimeException)
+ { return ::cppu::ImplHelper_getImplementationId( cd::get() ); }
+};
+
+// not needed anymore:
+#undef COMPHELPER_IMPLBASE_templctor_args
+#undef COMPHELPER_IMPLBASE_templctor
+
+/** Implementation helper supporting
+ ::com::sun::star::lang::XTypeProvider and
+ ::com::sun::star::lang::XComponent.
+
+ Upon disposing objects of this class, sub-classes receive a disposing()
+ call. Objects of this class can be held weakly, i.e. by a
+ ::com::sun::star::uno::WeakReference.
+
+ @attention
+ The life-cycle of the passed mutex reference has to be longer than objects
+ of this class.
+
+ @derive
+ Inherit from this class giving your interface(s) to be implemented as
+ template argument(s). Your sub class defines method implementations for
+ these interface(s).
+*/
+template < BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER,
+ typename Ifc) >
+class SAL_NO_VTABLE BOOST_PP_CAT(WeakComponentImplHelper,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+ : public ::cppu::WeakComponentImplHelperBase,
+ public ::com::sun::star::lang::XTypeProvider,
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, public Ifc)
+{
+ /// @internal
+ struct cd : public ::rtl::StaticAggregate<
+ ::cppu::class_data,
+ BOOST_PP_CAT(detail::ImplClassData,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+ <
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, Ifc),
+ BOOST_PP_CAT(WeakComponentImplHelper,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)<
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, Ifc)>
+ > > {};
+
+public:
+ BOOST_PP_CAT(WeakComponentImplHelper, COMPHELPER_IMPLBASE_INTERFACE_NUMBER)(
+ ::osl::Mutex & rMutex ) : WeakComponentImplHelperBase(rMutex) {}
+
+ virtual ::com::sun::star::uno::Any
+ SAL_CALL queryInterface( ::com::sun::star::uno::Type const& rType )
+ throw (::com::sun::star::uno::RuntimeException)
+ {
+ return ::cppu::WeakComponentImplHelper_query(
+ rType, cd::get(), this,
+ static_cast< ::cppu::WeakComponentImplHelperBase * >(this) );
+ }
+ virtual void SAL_CALL acquire() throw ()
+ { WeakComponentImplHelperBase::acquire(); }
+ virtual void SAL_CALL release() throw ()
+ { WeakComponentImplHelperBase::release(); }
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
+ SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
+ { return ::cppu::WeakComponentImplHelper_getTypes( cd::get() ); }
+ virtual ::com::sun::star::uno::Sequence<sal_Int8>
+ SAL_CALL getImplementationId()
+ throw (::com::sun::star::uno::RuntimeException)
+ { return ::cppu::ImplHelper_getImplementationId( cd::get() ); }
+
+ // implement XComponent directly avoiding ambiguities:
+ virtual void SAL_CALL dispose()
+ throw (::com::sun::star::uno::RuntimeException)
+ { WeakComponentImplHelperBase::dispose(); }
+ virtual void SAL_CALL addEventListener(
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener>
+ const & xListener ) throw (::com::sun::star::uno::RuntimeException)
+ { WeakComponentImplHelperBase::addEventListener( xListener ); }
+ virtual void SAL_CALL removeEventListener(
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener>
+ const & xListener ) throw (::com::sun::star::uno::RuntimeException)
+ { WeakComponentImplHelperBase::removeEventListener( xListener ); }
+};
+
+template < BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER,
+ typename Ifc) >
+class SAL_NO_VTABLE BOOST_PP_CAT(PartialWeakComponentImplHelper,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+ : public ::cppu::WeakComponentImplHelperBase,
+ public ::com::sun::star::lang::XTypeProvider,
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, public Ifc)
+{
+ /// @internal
+ struct cd : public ::rtl::StaticAggregate<
+ ::cppu::class_data,
+ BOOST_PP_CAT(detail::ImplClassData,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)
+ <
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, Ifc),
+ BOOST_PP_CAT(PartialWeakComponentImplHelper,
+ COMPHELPER_IMPLBASE_INTERFACE_NUMBER)<
+ BOOST_PP_ENUM_PARAMS(COMPHELPER_IMPLBASE_INTERFACE_NUMBER, Ifc)>
+ > > {};
+
+public:
+ BOOST_PP_CAT(PartialWeakComponentImplHelper, COMPHELPER_IMPLBASE_INTERFACE_NUMBER)(
+ ::osl::Mutex & rMutex ) : WeakComponentImplHelperBase(rMutex) {}
+
+ virtual ::com::sun::star::uno::Any
+ SAL_CALL queryInterface( ::com::sun::star::uno::Type const& rType )
+ throw (::com::sun::star::uno::RuntimeException)
+ {
+ return ::cppu::WeakComponentImplHelper_query(
+ rType, cd::get(), this,
+ static_cast< ::cppu::WeakComponentImplHelperBase * >(this) );
+ }
+ virtual void SAL_CALL acquire() throw ()
+ { WeakComponentImplHelperBase::acquire(); }
+ virtual void SAL_CALL release() throw ()
+ { WeakComponentImplHelperBase::release(); }
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
+ SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
+ { return ::cppu::WeakComponentImplHelper_getTypes( cd::get() ); }
+ virtual ::com::sun::star::uno::Sequence<sal_Int8>
+ SAL_CALL getImplementationId()
+ throw (::com::sun::star::uno::RuntimeException)
+ { return ::cppu::ImplHelper_getImplementationId( cd::get() ); }
+};
+
+
+} // namespace comphelper
+
+// undef for multiple use/inclusion of this header:
+#undef COMPHELPER_IMPLBASE_MAX_CTOR_ARGS
+#undef COMPHELPER_IMPLBASE_INTERFACE_NUMBER
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/implementationreference.hxx b/include/comphelper/implementationreference.hxx
new file mode 100644
index 000000000000..7957d6437ff5
--- /dev/null
+++ b/include/comphelper/implementationreference.hxx
@@ -0,0 +1,267 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_IMPLEMENTATIONREFERENCE_HXX
+#define _COMPHELPER_IMPLEMENTATIONREFERENCE_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/XInterface.hpp>
+
+namespace comphelper
+{
+
+ /** Holds a uno::Reference alongside a C++ implementation pointer
+
+ This template is useful to accomplish the following task: the
+ client needs an implementation pointer to an object providing
+ UNO interfaces. It is unsafe to simply store a C++ pointer,
+ because of the automatic UNO lifetime control. It is
+ inconvenient to always cast the UNO interface to the C++
+ implementation, and what's more, it's mostly unclear to the
+ casual code reader.
+
+ Thus, this template nicely encapsulate the stated intention,
+ by holding a uno::Reference internally, and providing simple
+ C++ pointer semantics to the outside. As a differentiator to
+ ::rtl::Reference, this template features a getRef() method,
+ giving you friction-less access to the internal UNO interface,
+ without extra querying.
+
+ By the way, the pointer semantic of this template include
+ transitive constness. That means, if this template's instance
+ is const (e.g. because it is a member of a class which is
+ accessed in a const method), the pointer returned is also
+ const.
+
+ As this template is geared towards fast, internal pointer
+ access, validity of the UNO reference is _not_ checked for
+ every pointer access. The client of this template is
+ responsible to check that, whereever necessary, via the is()
+ method.
+
+ @tpl CppType
+ The C++ type this class should mimick a pointer to (not the
+ pointer type itself!).
+
+ @tpl UnoType
+ The UNO interface type of the object (a uno::Reference to this
+ type is held internally).
+
+ @tpl XIfType
+ An unambiguous derivative of UnoType. This is defaulted to
+ the second template parameter (UnoType), which should normally
+ just work, since one typically has only single inheritance in
+ UNO.<p>
+ Alternatively, when using the
+ ImplementationReference::createFromQuery() method to create an
+ instance, this type can serve a different need: if the
+ provided CppType only derives from XInterface (generally
+ speaking, derives from a UNO interface above UnoType in the
+ class hierarchy), then the default XIfType constitutes a
+ possibly invalid downcast to UnoType. Setting XIfType equal to
+ CppTypes's most derived UNO interface type then solves this
+ problem (which is not as arcane as it seems to be. Just
+ imagine you're providing a C++ abstract interface, which must
+ provide UNO reference semantics. Naturally, you will derive
+ this C++ interface only from XInterface, to reduce the number
+ of ambiguous classes. Even more naturally, it is reasonable to
+ have UnoType be something different from XInterface, governed
+ by the usage of the C++ interface)
+
+ @sample ImplementationReference< MyCppType, XMyInterface >
+
+ @sample ImplementationReference< MyAbstractCppType, XMyInterface, XInterface >
+ for an abstract C++ class
+
+ @see ::rtl::Reference
+
+ */
+ template < class CppType,
+ class UnoType,
+ class XIfType=UnoType > class ImplementationReference
+ {
+ public:
+
+ typedef UnoType UnoInterfaceType;
+ typedef CppType ImplementationType;
+ typedef XIfType UnambiguousXInterfaceType;
+
+ /** Default-construct an ImplementationReference
+
+ Uno reference will be invalid, implementation pointer will
+ be NULL.
+ */
+ ImplementationReference() :
+ mxRef(),
+ mpImpl( NULL )
+ {
+ }
+
+ /** Create an ImplementationReference from C++ pointer.
+
+ This constructor does not perform an explicit
+ QueryInterface on the provided implementation object, but
+ constructs the UNO reference directly from the given
+ pointer. This is the fastest, and most often the best way
+ to create an ImplementationReference. If the conversion
+ between the implementation object and the required UNO
+ interface is ambiguous, provide the third template
+ parameter with a type that can be unambiguously upcasted
+ to the UNO interface (the second template parameter).
+
+ There are cases, however, where performing a
+ QueryInterface is the better, albeit slower choice. In
+ these cases, createFromQuery() should be used.
+
+ @param pImpl
+ Pointer to the C++ implementation type
+
+ @see createFromQuery()
+ */
+ explicit ImplementationReference( ImplementationType* pImpl ) :
+ mxRef( static_cast<UnambiguousXInterfaceType*>(pImpl) ),
+ mpImpl( pImpl )
+ {
+ }
+
+ struct CreateFromQuery { };
+ /** Create an ImplementationReference from C++ pointer
+
+ @param pImpl
+ The pointer to the C++ implementation type, which is
+ queried for the template-parameterized UNO type.
+
+ @param dummy
+ Dummy parameter, to distinguish this contructor from the
+ default unary one (which does not perform a
+ QueryInterface)
+ */
+ ImplementationReference( ImplementationType* pImpl, CreateFromQuery ) :
+ mxRef( static_cast<UnambiguousXInterfaceType*>(pImpl),
+ ::com::sun::star::uno::UNO_QUERY ),
+ mpImpl( pImpl )
+ {
+ }
+
+ /** Factory method to create an ImplementationReference from
+ C++ pointer.
+
+ This is a static version of the constructor which creates
+ an instance of an implementation type which is explicitly
+ queried for the ImplementationReference's
+ template-parameterized UNO type.
+
+ @sample
+ mpRef = mpRef.createFromQuery( new ImplementationType );
+ */
+ static ImplementationReference createFromQuery( ImplementationType* pImpl )
+ {
+ return ImplementationReference( pImpl, CreateFromQuery() );
+ }
+
+ /** Query whether the pointer is still valid.
+
+ Hands off also from the implementation pointer if this
+ returns false!
+ */
+ bool is() const { return mxRef.is(); }
+
+ /** Get a pointer to the implementation object
+
+ Compatibility method to get an auto_ptr-compatible
+ interface
+ */
+ ImplementationType* get() { return mpImpl; }
+ const ImplementationType* get() const { return mpImpl; }
+
+ /** Release all references
+
+ Compatibility method to get an auto_ptr-compatible
+ interface
+ */
+ void reset() { dispose(); }
+
+ /** Release all references
+
+ This method releases the UNO interface reference, and
+ clears the C++ pointer to NULL.
+ */
+ void dispose() { mxRef = NULL; mpImpl=NULL; }
+
+ ImplementationType* operator->() { return mpImpl; }
+ const ImplementationType* operator->() const { return mpImpl; }
+
+ ImplementationType& operator*() { return *mpImpl; }
+ const ImplementationType& operator*() const { return *mpImpl; }
+
+ /// Access to the underlying UNO reference, without extra querying
+ ::com::sun::star::uno::Reference< UnoInterfaceType > getRef() { return mxRef; }
+
+ /// Access to the underlying UNO reference, without extra querying
+ const ::com::sun::star::uno::Reference< UnoInterfaceType >& getRef() const { return mxRef; }
+
+ // default destructor, copy constructor and assignment will do
+ // ~ImplementationReference();
+ // ImplementationReference( const ImplementationReference& );
+ // ImplementationReference& operator= ( const ImplementationReference& );
+
+ /** Comparison operator
+
+ Object identity is defined to be identity of the
+ implementation pointers. This is in general invalid when
+ comparing pointers to UNO objects (ambiguous class
+ hierarchies, optimizations in the bridges, etc.), but okay
+ for raw C++ pointers (which is what's compared herein).
+ */
+ bool operator==( const ImplementationReference& rhs ) const
+ {
+ return mpImpl == rhs.mpImpl;
+ }
+
+ /** less-than operator
+
+ Object order is defined to be the ordering of the
+ implementation pointers. This is in general invalid when
+ comparing pointers to UNO objects (ambiguous class
+ hierarchies, optimizations in the bridges, etc.), but okay
+ for raw C++ pointers (which is what's used herein).
+
+ This ordering complies with STL's strict weak ordering
+ concept.
+ */
+ bool operator<( const ImplementationReference& rhs ) const
+ {
+ return mpImpl < rhs.mpImpl;
+ }
+
+ private:
+
+ // the interface, hard reference to prevent object from vanishing
+ ::com::sun::star::uno::Reference< UnoInterfaceType > mxRef;
+
+ // the c++ object, for our internal stuff
+ ImplementationType* mpImpl;
+
+ };
+
+}
+
+#endif // _COMPHELPER_IMPLEMENTATIONREFERENCE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/interaction.hxx b/include/comphelper/interaction.hxx
new file mode 100644
index 000000000000..bbd925efd3fa
--- /dev/null
+++ b/include/comphelper/interaction.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 _COMPHELPER_INTERACTION_HXX_
+#define _COMPHELPER_INTERACTION_HXX_
+
+#include <comphelper/uno3.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/task/XInteractionApprove.hpp>
+#include <com/sun/star/task/XInteractionDisapprove.hpp>
+#include <com/sun/star/task/XInteractionAbort.hpp>
+#include <com/sun/star/task/XInteractionRetry.hpp>
+#include <com/sun/star/task/XInteractionPassword.hpp>
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ //=========================================================================
+ //= OInteractionSelect
+ //=========================================================================
+ /** base class for concrete XInteractionContinuation implementations.<p/>
+ Instances of the classes maintain a flag indicating if the handler was called.
+ */
+ class OInteractionSelect
+ {
+ sal_Bool m_bSelected : 1; /// indicates if the select event occurred
+
+ protected:
+ OInteractionSelect() : m_bSelected(sal_False) { }
+
+ public:
+ /// determines whether or not this handler was selected
+ sal_Bool wasSelected() const { return m_bSelected; }
+ /// resets the state to "not selected", so you may reuse the handler
+ void reset() { m_bSelected = sal_False; }
+
+ protected:
+ void implSelected() { m_bSelected = sal_True; }
+ };
+
+ //=========================================================================
+ //= OInteraction
+ //=========================================================================
+ /** template for instantiating concret interaction handlers<p/>
+ the template argument must eb an interface derived from XInteractionContinuation
+ */
+ template <class INTERACTION>
+ class OInteraction
+ :public ::cppu::WeakImplHelper1< INTERACTION >
+ ,public OInteractionSelect
+ {
+ public:
+ OInteraction() { }
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select( ) throw(::com::sun::star::uno::RuntimeException);
+ };
+
+ //.........................................................................
+ template <class INTERACTION>
+ void SAL_CALL OInteraction< INTERACTION >::select( ) throw(::com::sun::star::uno::RuntimeException)
+ {
+ implSelected();
+ }
+
+ //=========================================================================
+ //= OInteractionApprove
+ //=========================================================================
+ typedef OInteraction< ::com::sun::star::task::XInteractionApprove > OInteractionApprove;
+
+ //=========================================================================
+ //= OInteractionDispprove
+ //=========================================================================
+ typedef OInteraction< ::com::sun::star::task::XInteractionDisapprove > OInteractionDisapprove;
+
+ //=========================================================================
+ //= OInteractionAbort
+ //=========================================================================
+ typedef OInteraction< ::com::sun::star::task::XInteractionAbort > OInteractionAbort;
+
+ //=========================================================================
+ //= OInteractionRetry
+ //=========================================================================
+ typedef OInteraction< ::com::sun::star::task::XInteractionRetry > OInteractionRetry;
+
+ //=========================================================================
+ //= OInteractionPassword
+ //=========================================================================
+ class COMPHELPER_DLLPUBLIC OInteractionPassword : public OInteraction< ::com::sun::star::task::XInteractionPassword >
+ {
+ public:
+ OInteractionPassword()
+ {
+ }
+
+ OInteractionPassword( const OUString& _rInitialPassword )
+ :m_sPassword( _rInitialPassword )
+ {
+ }
+
+ // XInteractionPassword
+ virtual void SAL_CALL setPassword( const OUString& _Password ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getPassword( ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ OUString m_sPassword;
+ };
+
+ //=========================================================================
+ //= OInteractionRequest
+ //=========================================================================
+ typedef ::cppu::WeakImplHelper1 < ::com::sun::star::task::XInteractionRequest
+ > OInteractionRequest_Base;
+ /** implements an interaction request (<type scope="com.sun.star.task">XInteractionRequest</type>)<p/>
+ at run time, you can freely add any interaction continuation objects
+ */
+ class COMPHELPER_DLLPUBLIC OInteractionRequest : public OInteractionRequest_Base
+ {
+ ::com::sun::star::uno::Any
+ m_aRequest; /// the request we represent
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > >
+ m_aContinuations; /// all registered continuations
+
+ public:
+ OInteractionRequest(const ::com::sun::star::uno::Any& _rRequestDescription);
+
+ /// add a new continuation
+ void addContinuation(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >& _rxContinuation);
+
+ // XInteractionRequest
+ virtual ::com::sun::star::uno::Any SAL_CALL getRequest( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations( ) throw(::com::sun::star::uno::RuntimeException);
+ };
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // _COMPHELPER_INTERACTION_HXX_
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/listenernotification.hxx b/include/comphelper/listenernotification.hxx
new file mode 100644
index 000000000000..21e2ea74723b
--- /dev/null
+++ b/include/comphelper/listenernotification.hxx
@@ -0,0 +1,298 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_INC_COMPHELPER_LISTENERNOTIFICATION_HXX
+#define COMPHELPER_INC_COMPHELPER_LISTENERNOTIFICATION_HXX
+
+#include <cppuhelper/interfacecontainer.hxx>
+
+#include <com/sun/star/lang/XEventListener.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+#include <memory>
+
+//........................................................................
+namespace comphelper
+{
+//........................................................................
+
+ //====================================================================
+ //= OListenerContainer
+ //====================================================================
+ /** abstract base class which manages a listener container, including
+ THB's listener notification pattern which cares for removing listeners
+ which throw an DisposedException upon notification
+
+ Using this class is pretty easy:
+ <ul>
+ <li>Derive from it, and overwrite implNotify.</li>
+ <li>Use <member>impl_addListener</member> and <member>impl_removeListener</member> in your
+ XFoo::addFooListener and XFoo::removeFooListener methods.</li>
+ <li>call <member>impl_notify</member> whenever the event you want to notify happened</li>
+ <li>call <member>disposing</member> upon the disposal of your broadcaster.</li>
+ </ul>
+
+ See <type>OListenerContainerBase</type> for an implementation which even saves
+ you some more work, by doing the casts for you.
+
+ @see http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgId=494345
+ @see OListenerContainerBase
+ */
+ class COMPHELPER_DLLPUBLIC OListenerContainer
+ {
+ private:
+ ::cppu::OInterfaceContainerHelper m_aListeners;
+
+ public:
+ /** sends a XEventObject::disposing notification to all listeners, and clears the
+ listener container
+
+ You'll usually call this from within your own dispose/disposing method
+ */
+ void disposing( const ::com::sun::star::lang::EventObject& _rEventSource );
+
+ /** clears the container without calling <member scope="com::sun::star::lang">XEventListener::disposing</member>
+ at the listeners
+ */
+ void clear();
+
+ /** determines whether the listener container is currently empty
+ */
+ inline bool
+ empty() const SAL_THROW(());
+
+ /** determines the number of elements in the container
+ */
+ inline size_t
+ size() const SAL_THROW(());
+
+ /** creates an iterator for looping through all registered listeners
+ */
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ ::std::auto_ptr< ::cppu::OInterfaceIteratorHelper > createIterator()
+ {
+ ::std::auto_ptr< ::cppu::OInterfaceIteratorHelper > pIterator( new ::cppu::OInterfaceIteratorHelper( m_aListeners ) );
+ return pIterator;
+ }
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+
+ protected:
+ OListenerContainer( ::osl::Mutex& _rMutex );
+
+ virtual ~OListenerContainer();
+
+ void impl_addListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener );
+ void impl_removeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener );
+
+ /** notifies all listeners of the given event, using THB's notification pattern
+
+ internally, this method will call <member>implNotify</member> for every listener
+
+ @return
+ <TRUE/> if all listeners have been notified, <FALSE/> else. The latter can happen
+ if <member>implNotify</member> cancelles the notification loop.
+
+ @see implNotify
+ */
+ bool impl_notify( const ::com::sun::star::lang::EventObject& _rEvent ) SAL_THROW(( ::com::sun::star::uno::Exception ));
+
+ protected:
+ /** call a single listener
+
+ @pure
+
+ @throws ::com::sun::star::uno::Exception
+ if the listener throws an exception during notification. Please don't catch
+ any listener exceptions in your implementation of this method, simply let them
+ pass to the caller.
+
+ @param _rxListener
+ specifies the listener to call. Is guaranteed to not be <NULL/>
+ @param _rEvent
+ the event to broadcast. This is the same as passed to <member>notify</member>, so if
+ your base class knows the type passed into <member>notify</member>, it can safely assume
+ that <arg>_rEvent</arg> is also of this type.
+
+ @return
+ <TRUE/> if the remaining listeners should be called, <FALSE/> if the notification
+ loop should be cancelled
+
+ @see notify
+ */
+ virtual bool implNotify(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener,
+ const ::com::sun::star::lang::EventObject& _rEvent
+ ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) = 0;
+ };
+
+ //====================================================================
+ inline bool OListenerContainer::empty() const SAL_THROW(())
+ {
+ return ( m_aListeners.getLength() == 0 );
+ }
+
+ inline size_t OListenerContainer::size() const SAL_THROW(())
+ {
+ return m_aListeners.getLength();
+ }
+
+ //====================================================================
+ //= OSimpleListenerContainer
+ //====================================================================
+ /** helper class for simple notification of the form LISTENER::METHOD( EVENT )
+
+ This class is not threadsafe!
+
+ @param LISTENER
+ the listener class to call, e.g. <type scope="com::sun::star::lang">XEventListener</type>
+ @param EVENT
+ the event type to notify, e.g. <type scope="com::sun::star::lang">EventObject</type>
+ */
+ template< class LISTENER, class EVENT >
+ class OSimpleListenerContainer : protected OListenerContainer
+ {
+ public:
+ typedef LISTENER ListenerClass;
+ typedef EVENT EventClass;
+ typedef void ( SAL_CALL LISTENER::*NotificationMethod )( const EventClass& );
+
+ private:
+ NotificationMethod m_pNotificationMethod;
+
+ public:
+ OSimpleListenerContainer( ::osl::Mutex& _rMutex )
+ :OListenerContainer( _rMutex )
+ ,m_pNotificationMethod( NULL )
+ {
+ }
+
+ inline void addListener( const ::com::sun::star::uno::Reference< ListenerClass >& _rxListener )
+ {
+ OListenerContainer::impl_addListener( _rxListener.get() );
+ }
+
+ inline void removeListener( const ::com::sun::star::uno::Reference< ListenerClass >& _rxListener )
+ {
+ OListenerContainer::impl_removeListener( _rxListener.get() );
+ }
+
+ // publish some otherwise hidden base functionality
+ using OListenerContainer::disposing;
+ using OListenerContainer::clear;
+ using OListenerContainer::empty;
+ using OListenerContainer::size;
+ using OListenerContainer::createIterator;
+
+ /// typed notification
+ inline bool notify( const EventClass& _rEvent, NotificationMethod _pNotify ) SAL_THROW(( ::com::sun::star::uno::Exception ));
+
+ protected:
+ inline virtual bool implNotify(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener,
+ const ::com::sun::star::lang::EventObject& _rEvent
+ ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
+ };
+
+ //--------------------------------------------------------------------
+ template< class LISTENER, class EVENT >
+ inline bool OSimpleListenerContainer< LISTENER, EVENT >::notify( const EventClass& _rEvent, NotificationMethod _pNotify ) SAL_THROW(( ::com::sun::star::uno::Exception ))
+ {
+ m_pNotificationMethod = _pNotify;
+ bool bRet = OListenerContainer::impl_notify( _rEvent );
+ m_pNotificationMethod = NULL;
+ return bRet;
+ }
+
+ //--------------------------------------------------------------------
+ template< class LISTENER, class EVENT >
+ inline bool OSimpleListenerContainer< LISTENER, EVENT >::implNotify(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener,
+ const ::com::sun::star::lang::EventObject& _rEvent ) SAL_THROW( ( ::com::sun::star::uno::Exception ) )
+ {
+ const EventClass& rTypedEvent( static_cast< const EventClass& >( _rEvent ) );
+ ListenerClass* pTypedListener( static_cast< ListenerClass* >( _rxListener.get() ) );
+ (pTypedListener->*m_pNotificationMethod)( rTypedEvent );
+ return true;
+ }
+
+ //====================================================================
+ //= OListenerContainerBase
+ //====================================================================
+ /** is a specialization of OListenerContainer which saves you some additional type casts,
+ by making the required listener and event types template arguments.
+ */
+ template< class LISTENER, class EVENT >
+ class OListenerContainerBase : public OListenerContainer
+ {
+ public:
+ typedef LISTENER ListenerClass;
+ typedef EVENT EventClass;
+
+ public:
+ inline OListenerContainerBase( ::osl::Mutex& _rMutex ) : OListenerContainer( _rMutex )
+ {
+ }
+
+ inline void addTypedListener( const ::com::sun::star::uno::Reference< ListenerClass >& _rxListener )
+ {
+ OListenerContainer::impl_addListener( _rxListener.get() );
+ }
+
+ inline void removeTypedListener( const ::com::sun::star::uno::Reference< ListenerClass >& _rxListener )
+ {
+ OListenerContainer::impl_removeListener( _rxListener.get() );
+ }
+
+ inline bool notify( const EventClass& _rEvent )
+ {
+ return OListenerContainer::impl_notify( _rEvent );
+ }
+
+ using OListenerContainer::impl_notify;
+
+ protected:
+ inline virtual bool implNotify(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener,
+ const ::com::sun::star::lang::EventObject& _rEvent
+ ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
+
+ virtual bool implTypedNotify(
+ const ::com::sun::star::uno::Reference< ListenerClass >& _rxListener,
+ const EventClass& _rEvent
+ ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) = 0;
+ };
+
+ template< class LISTENER, class EVENT >
+ inline bool OListenerContainerBase< LISTENER, EVENT >::implNotify(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener,
+ const ::com::sun::star::lang::EventObject& _rEvent ) SAL_THROW( ( ::com::sun::star::uno::Exception ) )
+ {
+ return implTypedNotify(
+ ::com::sun::star::uno::Reference< ListenerClass >( static_cast< ListenerClass* >( _rxListener.get() ) ),
+ static_cast< const EventClass& >( _rEvent )
+ );
+ }
+
+//........................................................................
+} // namespace comphelper
+//........................................................................
+
+#endif // COMPHELPER_INC_COMPHELPER_LISTENERNOTIFICATION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/logging.hxx b/include/comphelper/logging.hxx
new file mode 100644
index 000000000000..b6356384af3d
--- /dev/null
+++ b/include/comphelper/logging.hxx
@@ -0,0 +1,726 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_LOGGING_HXX
+#define COMPHELPER_LOGGING_HXX
+
+#include <comphelper/comphelperdllapi.h>
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/logging/XLogHandler.hpp>
+#include <com/sun/star/logging/LogLevel.hpp>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+
+//........................................................................
+namespace comphelper
+{
+//........................................................................
+
+ //====================================================================
+ //= string conversions, employed by the templatized log* members of
+ //= EventLogger
+ //====================================================================
+
+ namespace log { namespace convert
+ {
+ inline const OUString& convertLogArgToString( const OUString& _rValue )
+ {
+ return _rValue;
+ }
+
+ inline OUString convertLogArgToString( const sal_Char* _pAsciiValue )
+ {
+ return OUString::createFromAscii( _pAsciiValue );
+ }
+
+ inline OUString convertLogArgToString( double _nValue ) { return OUString::valueOf( _nValue ); }
+ inline OUString convertLogArgToString( float _nValue ) { return OUString::valueOf( _nValue ); }
+ inline OUString convertLogArgToString( sal_Int64 _nValue ) { return OUString::valueOf( _nValue ); }
+ inline OUString convertLogArgToString( sal_Int32 _nValue ) { return OUString::valueOf( _nValue ); }
+ inline OUString convertLogArgToString( sal_Int16 _nValue ) { return OUString::valueOf( (sal_Int32)_nValue ); }
+ inline OUString convertLogArgToString( sal_Unicode _nValue ) { return OUString::valueOf( _nValue ); }
+ inline OUString convertLogArgToString( sal_Bool _nValue ) { return OUString::valueOf( _nValue ); }
+
+ } } // namespace log::convert
+
+ //====================================================================
+ //= EventLogger
+ //====================================================================
+ class EventLogger_Impl;
+ typedef ::boost::optional< OUString > OptionalString;
+
+ /** encapsulates an <type scope="com::sun::star::logging">XLogger</type>
+
+ The class silences several (unlikely) errors which could potentially happen
+ when working with a logger. Additionally, it provides some convenience methods
+ for logging events.
+
+ You can use this class as follows
+<pre>
+ EventLogger aLogger( xContext, sLoggerName );
+ ....
+ aLogger.log( LogLevel::SEVERE, sSomeMessage );
+ aLogger.logp( LogLevel::CONFIG, "MyClass", "MyMethod", sSomeMessage, SomeParameter1, SomeParameter2, SomeParameter3 );
+</pre>
+
+ The <code>log</code> and <code>logp</code> calls support up to 6 parameters, which can be of
+ arbitrary type. For every parameter, there must exist a function <code>convertLogArgToString</code>
+ which takes an argument of the respective type, and returns a string.
+
+ After a parameter has been converted to a string using the above mentioned
+ <code>convertLogArgToString</code> function, a placeholder $1$ (resp. $2$ resp. $4$ ...)
+ in the message will be replaced with this string, and the resulting message will be logged.
+ */
+ class COMPHELPER_DLLPUBLIC EventLogger
+ {
+ protected:
+ ::boost::shared_ptr< EventLogger_Impl > m_pImpl;
+
+ public:
+ /** creates an <code>EventLogger</code> instance working with a css.logging.XLogger
+ instance given by ASCII name.
+
+ @param _rxContext
+ the component context to create services
+
+ @param _rLoggerName
+ the ASCII name of the logger to create.
+ */
+ EventLogger(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ const sal_Char* _pAsciiLoggerName
+ );
+
+ ~EventLogger();
+
+ public:
+ /// determines whether an event with the given level would be logged
+ bool isLoggable( const sal_Int32 _nLogLevel ) const;
+
+ //----------------------------------------------------------------
+ //- XLogger::log equivalents/wrappers
+ //- string messages
+
+ /// logs a given message, without any arguments, or source class/method names
+ bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, _rMessage );
+ return false;
+ }
+
+ /** logs a given message, replacing a placeholder in the message with an argument
+
+ The function takes, additionally to the log level and the message, an arbitrary
+ argument. This argument is converted to a string using an overloaded function
+ named <code>convertLogArgToString</code>. Then, a placeholder &quot;$1$&quot;
+ is searched in the message string, and replaced with the argument string.
+ */
+ template< typename ARGTYPE1 >
+ bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, _rMessage,
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 2 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2 >
+ bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, _rMessage,
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 3 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
+ bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, _rMessage,
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 4 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
+ bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, _rMessage,
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 5 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
+ bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, _rMessage,
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument5 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 6 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 >
+ bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, _rMessage,
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument5 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument6 ) ) );
+ return false;
+ }
+
+ //----------------------------------------------------------------
+ //- XLogger::log equivalents/wrappers
+ //- ASCII messages
+
+ /// logs a given message, without any arguments, or source class/method names
+ bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ) );
+ return false;
+ }
+
+ /** logs a given message, replacing a placeholder in the message with an argument
+
+ The function takes, additionally to the log level and the message, an arbitrary
+ argument. This argument is converted to a string using an overloaded function
+ named <code>convertLogArgToString</code>. Then, a placeholder &quot;$1$&quot;
+ is searched in the message string, and replaced with the argument string.
+ */
+ template< typename ARGTYPE1 >
+ bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 2 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2 >
+ bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 3 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
+ bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 4 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
+ bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 5 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
+ bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument5 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 6 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 >
+ bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument5 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument6 ) ) );
+ return false;
+ }
+
+ //----------------------------------------------------------------
+ //- XLogger::logp equivalents/wrappers
+ //- string messages
+
+ /// logs a given message, without any arguments, or source class/method names
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage );
+ return false;
+ }
+
+ /** logs a given message, replacing a placeholder in the message with an argument
+
+ The function takes, additionally to the logp level and the message, an arbitrary
+ argument. This argument is converted to a string using an overloaded function
+ named <code>convertLogArgToString</code>. Then, a placeholder &quot;$1$&quot;
+ is searched in the message string, and replaced with the argument string.
+ */
+ template< typename ARGTYPE1 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage, ARGTYPE1 _argument1 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage,
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 2 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage,
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 3 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage,
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 4 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage,
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 5 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage,
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument5 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 6 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage,
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument5 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument6 ) ) );
+ return false;
+ }
+
+ //----------------------------------------------------------------
+ //- XLogger::logp equivalents/wrappers
+ //- ASCII messages
+
+ /// logs a given ASCII message, without any arguments, or source class/method names
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ) );
+ return false;
+ }
+
+ /** logs a given ASCII message, replacing a placeholder in the message with an argument
+
+ The function takes, additionally to the logp level and the message, an arbitrary
+ argument. This argument is converted to a string using an overloaded function
+ named <code>convertLogArgToString</code>. Then, a placeholder &quot;$1$&quot;
+ is searched in the message string, and replaced with the argument string.
+ */
+ template< typename ARGTYPE1 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage, ARGTYPE1 _argument1 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ) );
+ return false;
+ }
+
+ /// logs a given ASCII message, replacing 2 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ) );
+ return false;
+ }
+
+ /// logs a given ASCII message, replacing 3 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ) );
+ return false;
+ }
+
+ /// logs a given ASCII message, replacing 4 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ) );
+ return false;
+ }
+
+ /// logs a given ASCII message, replacing 5 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument5 ) ) );
+ return false;
+ }
+
+ /// logs a given ASCII message, replacing 6 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument5 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument6 ) ) );
+ return false;
+ }
+
+ protected:
+ bool impl_log(
+ const sal_Int32 _nLogLevel,
+ const sal_Char* _pSourceClass,
+ const sal_Char* _pSourceMethod,
+ const OUString& _rMessage,
+ const OptionalString& _rArgument1 = OptionalString(),
+ const OptionalString& _rArgument2 = OptionalString(),
+ const OptionalString& _rArgument3 = OptionalString(),
+ const OptionalString& _rArgument4 = OptionalString(),
+ const OptionalString& _rArgument5 = OptionalString(),
+ const OptionalString& _rArgument6 = OptionalString()
+ ) const;
+ };
+
+ //====================================================================
+ //= ResourceBasedEventLogger
+ //====================================================================
+ struct ResourceBasedEventLogger_Data;
+ /** extends the EventLogger class with functionality to load log messages from
+ a resource bundle.
+ */
+ class COMPHELPER_DLLPUBLIC ResourceBasedEventLogger : public EventLogger
+ {
+ private:
+ ::boost::shared_ptr< ResourceBasedEventLogger_Data > m_pData;
+
+ public:
+ /** creates a resource based event logger
+ @param _rxContext
+ the component context for creating new components
+ @param _pResourceBundleBaseName
+ the ASCII base name of the resource bundle to use. Will be used
+ in conjunction with XResourceBundleLoader::loadResource.
+ @param _pAsciiLoggerName
+ the ASCII name of the logger to work with. If NULL, the office-wide
+ default logger will be used.
+
+ */
+ ResourceBasedEventLogger(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ const sal_Char* _pResourceBundleBaseName,
+ const sal_Char* _pAsciiLoggerName = NULL
+ );
+
+ //----------------------------------------------------------------
+ //- XLogger::log equivalents/wrappers
+ //- resource IDs
+
+ /// logs a given message, without any arguments, or source class/method names
+ bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ) );
+ return false;
+ }
+
+ /** logs a given message, replacing a placeholder in the message with an argument
+
+ The function takes, additionally to the log level and the message, an arbitrary
+ argument. This argument is converted to a string using an overloaded function
+ named <code>convertLogArgToString</code>. Then, a placeholder &quot;$1$&quot;
+ is searched in the message string, and replaced with the argument string.
+ */
+ template< typename ARGTYPE1 >
+ bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 2 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2 >
+ bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 3 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
+ bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 4 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
+ bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 5 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
+ bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument5 ) ) );
+ return false;
+ }
+
+ /// logs a given message, replacing 6 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 >
+ bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument5 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument6 ) ) );
+ return false;
+ }
+
+ //----------------------------------------------------------------
+ //- XLogger::logp equivalents/wrappers
+ //- resource IDs
+
+ /// logs a given ASCII message, without any arguments, or source class/method names
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ) );
+ return false;
+ }
+
+ /** logs a given ASCII message, replacing a placeholder in the message with an argument
+ */
+ template< typename ARGTYPE1 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ) );
+ return false;
+ }
+
+ /// logs a given ASCII message, replacing 2 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ) );
+ return false;
+ }
+
+ /// logs a given ASCII message, replacing 3 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ) );
+ return false;
+ }
+
+ /// logs a given ASCII message, replacing 4 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ) );
+ return false;
+ }
+
+ /// logs a given ASCII message, replacing 5 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument5 ) ) );
+ return false;
+ }
+
+ /// logs a given ASCII message, replacing 6 placeholders in the message with respective values
+ template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 >
+ bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const
+ {
+ if ( isLoggable( _nLogLevel ) )
+ return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ),
+ OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument5 ) ),
+ OptionalString( log::convert::convertLogArgToString( _argument6 ) ) );
+ return false;
+ }
+
+ private:
+ OUString impl_loadStringMessage_nothrow( const sal_Int32 _nMessageResID ) const;
+ };
+
+//........................................................................
+} // namespace comphelper
+//........................................................................
+
+#endif // COMPHELPER_LOGGING_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/make_shared_from_uno.hxx b/include/comphelper/make_shared_from_uno.hxx
new file mode 100644
index 000000000000..2a70094a3f94
--- /dev/null
+++ b/include/comphelper/make_shared_from_uno.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_COMPHELPER_MAKE_SHARED_FROM_UNO_HXX
+#define INCLUDED_COMPHELPER_MAKE_SHARED_FROM_UNO_HXX
+
+#include "boost/shared_ptr.hpp"
+#include <functional>
+
+namespace comphelper {
+
+/// @internal
+namespace detail {
+/// @internal
+template <typename T> struct ReleaseFunc : ::std::unary_function<T *, void> {
+ void operator()( T * p ) const { p->release(); }
+};
+} // namespace detail
+
+/** Makes a boost::shared_ptr from a ref-counted UNO object pointer.
+ This makes sense if the object is used via UNO (implementing some X
+ interface) and also internally using its implementation class, e.g.
+
+ <pre>
+ boost::shared_ptr<MyUnoImpl> const ptr(
+ comphelper::make_shared_from_UNO( new MyUnoImpl ) );
+ ...
+ xUno->callingUno( uno::Reference<XSomeInterface>( ptr.get() ) );
+ ...
+ takeSharedPtr( ptr );
+ ...
+ </pre>
+
+ @attention The shared_ptr operates on a separate reference counter, so
+ weak pointers (boost::weak_ptr) are invalidated when the last
+ shared_ptr is destroyed, although the UNO object may still be
+ alive.
+
+ @param p object pointer
+ @return shared_ptr to object
+*/
+template <typename T>
+inline ::boost::shared_ptr<T> make_shared_from_UNO( T * p )
+{
+ p->acquire();
+ return ::boost::shared_ptr<T>( p, detail::ReleaseFunc<T>() );
+}
+
+} // namespace comphelper
+
+#endif // ! defined(INCLUDED_COMPHELPER_MAKE_SHARED_FROM_UNO_HXX)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/makesequence.hxx b/include/comphelper/makesequence.hxx
new file mode 100644
index 000000000000..bc35657db9a8
--- /dev/null
+++ b/include/comphelper/makesequence.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 COMPHELPER_MAKESEQUENCE_HXX_INCLUDED
+#define COMPHELPER_MAKESEQUENCE_HXX_INCLUDED
+
+#include "com/sun/star/uno/Sequence.hxx"
+#include "boost/preprocessor/cat.hpp"
+#include "boost/preprocessor/repetition.hpp"
+#include "boost/preprocessor/arithmetic/add.hpp"
+
+namespace comphelper {
+
+/** Creates a uno::Sequence out of one parameter.
+*/
+template <typename T>
+inline ::com::sun::star::uno::Sequence<T> makeSequence( T const& element )
+{
+ return ::com::sun::star::uno::Sequence<T>( &element, 1 );
+}
+
+#define COMPHELPER_MAKESEQUENCE_assign(z_, n_, unused_) \
+ p[n_] = BOOST_PP_CAT(element, n_);
+
+/** The following preprocessor repetitions generate functions like
+
+ <pre>
+ template <typename T>
+ inline ::com::sun::star::uno::Sequence<T> makeSequence(
+ T const& element0, T const& element1, ... );
+ </pre>
+
+ which make a sequence out of the passed elements.
+
+ The maximum number of elements can be set by defining
+ COMPHELPER_MAKESEQUENCE_MAX_ARGS; its default is 12.
+*/
+#define COMPHELPER_MAKESEQUENCE_make(z_, n_, unused_) \
+template <typename T> \
+inline ::com::sun::star::uno::Sequence<T> makeSequence( \
+ BOOST_PP_ENUM_PARAMS(n_, T const& element) ) \
+{ \
+ ::com::sun::star::uno::Sequence<T> seq( n_ ); \
+ T * p = seq.getArray(); \
+ BOOST_PP_REPEAT(n_, COMPHELPER_MAKESEQUENCE_assign, ~) \
+ return seq; \
+}
+
+#ifndef COMPHELPER_MAKESEQUENCE_MAX_ARGS
+#define COMPHELPER_MAKESEQUENCE_MAX_ARGS 12
+#endif
+
+BOOST_PP_REPEAT_FROM_TO(2, BOOST_PP_ADD(COMPHELPER_MAKESEQUENCE_MAX_ARGS, 1),
+ COMPHELPER_MAKESEQUENCE_make, ~)
+
+#undef COMPHELPER_MAKESEQUENCE_MAX_ARGS
+#undef COMPHELPER_MAKESEQUENCE_make
+#undef COMPHELPER_MAKESEQUENCE_assign
+
+} // namespace comphelper
+
+#endif // ! defined(COMPHELPER_MAKESEQUENCE_HXX_INCLUDED)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/mediadescriptor.hxx b/include/comphelper/mediadescriptor.hxx
new file mode 100644
index 000000000000..7c7174644292
--- /dev/null
+++ b/include/comphelper/mediadescriptor.hxx
@@ -0,0 +1,310 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_MEDIADESCRIPTOR_HXX_
+#define _COMPHELPER_MEDIADESCRIPTOR_HXX_
+
+#include <comphelper/sequenceashashmap.hxx>
+#include <rtl/ustring.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace io {
+ class XInputStream;
+} } } }
+
+namespace comphelper{
+
+/** @short can be used to work with a <type scope="::com::sun::star::document">MediaDescriptor</type>
+ struct.
+
+ @descr It wraps a ::boost::unordered_map around the Sequence< css::beans::PropertyValue >, which
+ represent the MediaDescriptor item.
+ Further this helper defines often used functions (as e.g. open of the required streams,
+ consistent checks etcpp.) and it defines all useable property names.
+
+ @attention This class isnt threadsafe and must be guarded from outside!
+ */
+class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
+{
+ public:
+
+ //---------------------------------------
+ /** @short these methods can be used to get the different property names
+ as static const OUString values.
+
+ @descr Because definition and declaration of static const class members
+ does not work as expected under windows (under unix it works as well)
+ these way must be used :-(
+ */
+ static const OUString& PROP_ABORTED();
+ static const OUString& PROP_ASTEMPLATE();
+ static const OUString& PROP_COMPONENTDATA();
+ static const OUString& PROP_DOCUMENTSERVICE();
+ static const OUString& PROP_ENCRYPTIONDATA();
+ static const OUString& PROP_FILENAME();
+ static const OUString& PROP_FILTERNAME();
+ static const OUString& PROP_FILTERPROVIDER();
+ static const OUString& PROP_FILTEROPTIONS();
+ static const OUString& PROP_FRAME();
+ static const OUString& PROP_FRAMENAME();
+ static const OUString& PROP_HIDDEN();
+ static const OUString& PROP_INPUTSTREAM();
+ static const OUString& PROP_INTERACTIONHANDLER();
+ static const OUString& PROP_JUMPMARK();
+ static const OUString& PROP_MACROEXECUTIONMODE();
+ static const OUString& PROP_MEDIATYPE();
+ static const OUString& PROP_MINIMIZED();
+ static const OUString& PROP_NOAUTOSAVE();
+ static const OUString& PROP_OPENNEWVIEW();
+ static const OUString& PROP_OUTPUTSTREAM();
+ static const OUString& PROP_PASSWORD();
+ static const OUString& PROP_POSTDATA();
+ static const OUString& PROP_PREVIEW();
+ static const OUString& PROP_READONLY();
+ static const OUString& PROP_REFERRER();
+ static const OUString& PROP_SALVAGEDFILE();
+ static const OUString& PROP_STATUSINDICATOR();
+ static const OUString& PROP_STREAM();
+ static const OUString& PROP_STREAMFOROUTPUT();
+ static const OUString& PROP_TEMPLATENAME();
+ static const OUString& PROP_TITLE();
+ static const OUString& PROP_TYPENAME();
+ static const OUString& PROP_UCBCONTENT();
+ static const OUString& PROP_UPDATEDOCMODE();
+ static const OUString& PROP_URL();
+ static const OUString& PROP_VERSION();
+ static const OUString& PROP_DOCUMENTTITLE();
+ static const OUString& PROP_MODEL();
+ static const OUString& PROP_VIEWONLY();
+ static const OUString& PROP_DOCUMENTBASEURL();
+
+ static const OUString& PROP_DEEPDETECTION();
+
+ //-------------------------------------------
+ // interface
+ public:
+ //---------------------------------------
+ /** @short these ctors do nothing - excepting that they forward
+ the given parameters to the base class ctors.
+
+ @descr The ctros must be overwritten to resolve conflicts with
+ the default ctors of the compiler :-(.
+ */
+ MediaDescriptor();
+ MediaDescriptor(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lSource);
+
+ //---------------------------------------
+ /** @short it checks if the descriptor already has a valid
+ InputStream item and creates a new one, if not.
+
+ @descr This method uses the current items of this MediaDescriptor,
+ to open the stream (as e.g. URL, ReadOnly, PostData etcpp.).
+ It creates a seekable stream and put it into the descriptor.
+
+ A might existing InteractionHandler will be used automaticly,
+ to solve problems!
+
+ In case of local file the system file locking is used.
+
+ @return TRUE, if the stream was already part of the descriptor or could
+ be created as new item. FALSE otherwise.
+ */
+ sal_Bool addInputStream();
+
+ //---------------------------------------
+ /** @short it checks if the descriptor already has a valid
+ InputStream item and creates a new one, if not.
+
+ @descr This method uses the current items of this MediaDescriptor,
+ to open the stream (as e.g. URL, ReadOnly, PostData etcpp.).
+ It creates a seekable stream and put it into the descriptor.
+
+ A might existing InteractionHandler will be used automaticly,
+ to solve problems!
+
+ In case of local file the system file locking is used based on
+ configuration settings.
+
+ @return TRUE, if the stream was already part of the descriptor or could
+ be created as new item. FALSE otherwise.
+ */
+ sal_Bool addInputStreamOwnLock();
+
+ //---------------------------------------
+ /** @short it checks if the descriptor describes a readonly stream.
+
+ @descr The descriptor itself isnt changed doing so.
+ It's only checked if the stream seems to be based
+ of a real readonly file.
+
+ @Attention
+ We dont check the property "ReadOnly" here. Because
+ this property can be set from outside and overwrites
+ the readonly state of the stream.
+ If e.g. the stream could be opened read/write ...
+ but "ReadOnly" property is set to TRUE, this means:
+ show a readonly UI on top of this read/write stream.
+
+ @return TRUE, if the stream must be interpreted as readonly ...
+ FALSE otherwise.
+ */
+ sal_Bool isStreamReadOnly() const;
+
+ //---------------------------------------
+ /** Returns a value from the sequence contained in the property
+ 'ComponentData' of this media descriptor.
+
+ @descr The property 'ComponentData' should be empty, or should
+ contain a value of type sequence<com.sun.star.beans.NamedValue>
+ or sequence<com.sun.star.beans.PropertyValue>.
+
+ @return The value with the specified name, if existing in the
+ sequence of the 'ComponentData' property, otherwise an empty
+ Any.
+ */
+ ::com::sun::star::uno::Any getComponentDataEntry(
+ const OUString& rName ) const;
+
+ //---------------------------------------
+ /** Inserts a value into the sequence contained in the property
+ 'ComponentData' of the media descriptor.
+
+ @descr The property 'ComponentData' should be empty, or should
+ contain a value of type sequence<com.sun.star.beans.NamedValue>
+ or sequence<com.sun.star.beans.PropertyValue>. The passed value
+ will be inserted into the sequence, or, if already existing,
+ will be overwritten.
+
+ @param rName The name of the value to be inserted into the
+ sequence of the 'ComponentData' property.
+
+ @param rValue The value to be inserted into the sequence of the
+ 'ComponentData' property.
+ */
+ void setComponentDataEntry(
+ const OUString& rName,
+ const ::com::sun::star::uno::Any& rValue );
+
+ //---------------------------------------
+ /** Removes a value from the sequence contained in the property
+ 'ComponentData' of the media descriptor.
+
+ @descr The property 'ComponentData' should be empty, or should
+ contain a value of type sequence<com.sun.star.beans.NamedValue>
+ or sequence<com.sun.star.beans.PropertyValue>. The value with
+ the passed name will be removed from the sequence, if existing.
+
+ @param rName The name of the value to be removed from the sequence
+ of the 'ComponentData' property.
+ */
+ void clearComponentDataEntry(
+ const OUString& rName );
+
+ //-------------------------------------------
+ // helper
+ private:
+
+ //---------------------------------------
+ /** @short tries to open a stream by using the given PostData stream.
+
+ @descr The stream is used directly ...
+
+ The MediaDescriptor itself is changed inside this method.
+ Means: the stream is added internal and not returned by a value.
+
+ @param _rxPostData
+ the PostData stream.
+
+ @return TRUE if the stream could be added successfully.
+ Note: If FALSE is returned, the error was already handled inside!
+
+ @throw [css::uno::RuntimeException]
+ if the MediaDescriptor seems to be invalid!
+
+ @throw [css::lang::IllegalArgumentException]
+ if the given PostData stream is <NULL/>.
+ */
+ COMPHELPER_DLLPRIVATE sal_Bool impl_openStreamWithPostData(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& _rxPostData
+ ) throw(::com::sun::star::uno::RuntimeException);
+
+ //---------------------------------------
+ /** @short tries to open a stream by using the given URL.
+
+ @descr First it tries to open the content in r/w mode (if its
+ allowed to do so). Only in case its not allowed or it failed
+ the stream will be tried to open in readonly mode.
+
+ The MediaDescriptor itself is changed inside this method.
+ Means: the stream is added internal and not returned by a value.
+
+ @param sURL
+ the URL for open.
+
+ @param bLockFile
+ specifies whether the file should be locked
+
+ @return TRUE if the stream could be added successfully.
+ Note: If FALSE is returned, the error was already handled inside!
+
+ @throw [css::uno::RuntimeException]
+ if the MediaDescriptor seems to be invalid!
+ */
+ COMPHELPER_DLLPRIVATE sal_Bool impl_openStreamWithURL(
+ const OUString& sURL,
+ sal_Bool bLockFile
+ ) throw(::com::sun::star::uno::RuntimeException);
+
+ //---------------------------------------
+ /** @short some URL parts can make trouble for opening streams (e.g. jumpmarks.)
+ An URL should be "normalized" before its used.
+
+ @param sURL
+ the original URL (e.g. including a jumpmark)
+
+ @return [string]
+ the "normalized" URL (e.g. without jumpmark)
+ */
+ COMPHELPER_DLLPRIVATE OUString impl_normalizeURL(const OUString& sURL);
+
+ //---------------------------------------
+ /** @short it checks if the descriptor already has a valid
+ InputStream item and creates a new one, if not.
+
+ @descr This method uses the current items of this MediaDescriptor,
+ to open the stream (as e.g. URL, ReadOnly, PostData etcpp.).
+ It creates a seekable stream and put it into the descriptor.
+
+ A might existing InteractionHandler will be used automaticly,
+ to solve problems!
+
+ @param bLockFile
+ specifies whether the file should be locked
+
+ @return TRUE, if the stream was already part of the descriptor or could
+ be created as new item. FALSE otherwise.
+ */
+ COMPHELPER_DLLPRIVATE sal_Bool impl_addInputStream( sal_Bool bLockFile );
+};
+
+} // namespace comphelper
+
+#endif // _COMPHELPER_MEDIADESCRIPTOR_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/mimeconfighelper.hxx b/include/comphelper/mimeconfighelper.hxx
new file mode 100644
index 000000000000..6e2b128d5a23
--- /dev/null
+++ b/include/comphelper/mimeconfighelper.hxx
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_MIMECONFIGHELPER_HXX_
+#define _COMPHELPER_MIMECONFIGHELPER_HXX_
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XContainerQuery.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/embed/VerbDescriptor.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+
+namespace comphelper {
+
+class COMPHELPER_DLLPUBLIC MimeConfigurationHelper
+{
+ ::osl::Mutex m_aMutex;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xConfigProvider;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xObjectConfig;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xVerbsConfig;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xMediaTypeConfig;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xFilterFactory;
+
+public:
+
+ MimeConfigurationHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+
+
+ static OUString GetStringClassIDRepresentation( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID );
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GetSequenceClassIDRepresentation( const OUString& aClassID );
+
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
+ GetConfigurationByPath( const OUString& aPath );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetObjConfiguration();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetVerbsConfiguration();
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetMediaTypeConfiguration();
+
+
+ OUString GetDocServiceNameFromFilter( const OUString& aFilterName );
+
+ OUString GetDocServiceNameFromMediaType( const OUString& aMediaType );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetObjPropsFromConfigEntry(
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xObjectProps );
+
+ sal_Bool GetVerbByShortcut( const OUString& aVerbShortcut,
+ ::com::sun::star::embed::VerbDescriptor& aDescriptor );
+
+ OUString GetExplicitlyRegisteredObjClassID( const OUString& aMediaType );
+
+
+ // retrieving object description from configuration
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetObjectPropsByStringClassID(
+ const OUString& aStringClassID );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetObjectPropsByClassID(
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetObjectPropsByMediaType(
+ const OUString& aMediaType );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetObjectPropsByFilter(
+ const OUString& aFilterName );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetObjectPropsByDocumentName(
+ const OUString& aDocumentName );
+
+ // retrieving object factory from configuration
+ OUString GetFactoryNameByStringClassID( const OUString& aStringClassID );
+ OUString GetFactoryNameByClassID( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID );
+ OUString GetFactoryNameByDocumentName( const OUString& aDocName );
+ OUString GetFactoryNameByMediaType( const OUString& aMediaType );
+
+ // typedetection related
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetFilterFactory();
+
+ OUString UpdateMediaDescriptorWithFilterName(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr,
+ sal_Bool bIgnoreType );
+ OUString UpdateMediaDescriptorWithFilterName(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObject );
+#ifdef WNT
+ sal_Int32 GetFilterFlags( const OUString& aFilterName );
+
+ sal_Bool AddFilterNameCheckOwnFile(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr );
+#endif
+
+ OUString GetDefaultFilterFromServiceName( const OUString& aServName, sal_Int32 nVersion );
+
+ OUString GetExportFilterFromImportFilter( const OUString& aImportFilterName );
+
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SearchForFilter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery >& xFilterQuery,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aSearchRequest,
+ sal_Int32 nMustFlags,
+ sal_Int32 nDontFlags );
+
+ static sal_Bool ClassIDsEqual( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID1,
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID2 );
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GetSequenceClassID( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
+ sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11,
+ sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 );
+};
+
+}
+
+#endif // _COMPHELPER_MIMECONFIGHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/namecontainer.hxx b/include/comphelper/namecontainer.hxx
new file mode 100644
index 000000000000..6ac5aff190fb
--- /dev/null
+++ b/include/comphelper/namecontainer.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 _COMPHELPER_NAMECONTAINER_HXX_
+#define _COMPHELPER_NAMECONTAINER_HXX_
+
+#include <com/sun/star/uno/Type.hxx>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+namespace comphelper
+{
+ COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ NameContainer_createInstance( ::com::sun::star::uno::Type aType );
+}
+
+#endif // _COMPHELPER_NAMECONTAINER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/namedvaluecollection.hxx b/include/comphelper/namedvaluecollection.hxx
new file mode 100644
index 000000000000..93b53dd14c6c
--- /dev/null
+++ b/include/comphelper/namedvaluecollection.hxx
@@ -0,0 +1,376 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef COMPHELPER_NAMEDVALUECOLLECTION_HXX
+#define COMPHELPER_NAMEDVALUECOLLECTION_HXX
+
+#include <comphelper/comphelperdllapi.h>
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+
+#include <memory>
+#include <algorithm>
+#include <vector>
+
+//........................................................................
+namespace comphelper
+{
+//........................................................................
+
+ // ====================================================================
+ // = NamedValueCollection
+ // ====================================================================
+ struct NamedValueCollection_Impl;
+ /** a collection of named values, packed in various formats.
+ */
+ class COMPHELPER_DLLPUBLIC NamedValueCollection
+ {
+ private:
+ ::std::auto_ptr< NamedValueCollection_Impl > m_pImpl;
+
+ public:
+ NamedValueCollection();
+
+ NamedValueCollection( const NamedValueCollection& _rCopySource );
+
+ NamedValueCollection& operator=( const NamedValueCollection& i_rCopySource );
+
+ /** constructs a collection
+ @param _rElements
+ the wrapped elements of the collection. The <code>Any</code> might contain a sequence of
+ property values, a sequence of named values, or directly a property value or named value.
+ All other cases are worth an assertion in non-product builds.
+ */
+ NamedValueCollection( const ::com::sun::star::uno::Any& _rElements );
+
+ /** constructs a collection
+ @param _rArguments
+ a sequence of Any's containing either PropertyValue's or NamedValue's.
+ */
+ NamedValueCollection( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments );
+
+ /** constructs a collection
+ @param _rArguments
+ a sequence of PropertyValues's
+ */
+ NamedValueCollection( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArguments );
+
+ /** constructs a collection
+ @param _rArguments
+ a sequence of NamedValue's
+ */
+ NamedValueCollection( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rArguments );
+
+ ~NamedValueCollection();
+
+ inline void assign( const ::com::sun::star::uno::Any& i_rWrappedElements )
+ {
+ impl_assign( i_rWrappedElements );
+ }
+
+ inline void assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments )
+ {
+ impl_assign( _rArguments );
+ }
+
+ inline void assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArguments )
+ {
+ impl_assign( _rArguments );
+ }
+
+ inline void assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rArguments )
+ {
+ impl_assign( _rArguments );
+ }
+
+ inline void clear()
+ {
+ impl_assign( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >() );
+ }
+
+ /** determines whether or not named values can be extracted from the given value
+
+ @return
+ <TRUE/> if and only if the given <code>Any</code> contains a <code>NamedValue</code>, a
+ <code>PropertyValue</code>, or a sequence thereof.
+ */
+ static bool canExtractFrom( ::com::sun::star::uno::Any const & i_value );
+
+ /// returns the number of elements in the collection
+ size_t size() const;
+
+ /// determines whether the collection is empty
+ bool empty() const;
+
+ /** returns the names of all elements in the collection
+ */
+ ::std::vector< OUString >
+ getNames() const;
+
+ /** merges the content of another collection into |this|
+ @param _rAdditionalValues
+ the collection whose values are to be merged
+ @param _bOverwriteExisting
+ defines whether or not elements which are already present in |this|
+ should be overwritten (<TRUE/>) or preserved (<FALSE/>).
+ @return |*this|
+ */
+ NamedValueCollection&
+ merge(
+ const NamedValueCollection& _rAdditionalValues,
+ bool _bOverwriteExisting
+ );
+
+ /** retrieves a value with a given name from the collection, if it is present
+
+ @param _pAsciiValueName
+ the ASCII name of the value to retrieve
+
+ @param _out_rValue
+ is the output parameter taking the desired value upon successful return. If
+ a value with the given name is not present in the collection, or if a wrong-typed
+ value is present, then this parameter will not be touched.
+
+ @return
+ <TRUE/> if there is a value with the given name, which could successfully
+ be extraced. In this case, <arg>_out_rValue</arg> will contain the requested
+ value.<br/>
+ <FALSE/>, if there is no value with the given name.
+ @throws IllegalArgumentException
+ in case there is a value with the given name, but it cannot legally assigned to
+ _out_rValue.
+ */
+ template < typename VALUE_TYPE >
+ bool get_ensureType( const sal_Char* _pAsciiValueName, VALUE_TYPE& _out_rValue ) const
+ {
+ return get_ensureType( OUString::createFromAscii( _pAsciiValueName ), &_out_rValue, ::cppu::UnoType< VALUE_TYPE >::get() );
+ }
+
+ template < typename VALUE_TYPE >
+ bool get_ensureType( const OUString& _rValueName, VALUE_TYPE& _out_rValue ) const
+ {
+ return get_ensureType( _rValueName, &_out_rValue, ::cppu::UnoType< VALUE_TYPE >::get() );
+ }
+
+ /** retrieves a value with a given name, or defaults it to a given value, if its not present
+ in the colllection
+ */
+ template < typename VALUE_TYPE >
+ VALUE_TYPE getOrDefault( const sal_Char* _pAsciiValueName, const VALUE_TYPE& _rDefault ) const
+ {
+ return getOrDefault( OUString::createFromAscii( _pAsciiValueName ), _rDefault );
+ }
+
+ template < typename VALUE_TYPE >
+ VALUE_TYPE getOrDefault( const OUString& _rValueName, const VALUE_TYPE& _rDefault ) const
+ {
+ VALUE_TYPE retVal( _rDefault );
+ get_ensureType( _rValueName, retVal );
+ return retVal;
+ }
+
+ /** retrieves a (untyped) value with a given name
+
+ If the collection does not contain a value with the given name, an empty
+ Any is returned.
+ */
+ const ::com::sun::star::uno::Any& get( const sal_Char* _pAsciiValueName ) const
+ {
+ return get( OUString::createFromAscii( _pAsciiValueName ) );
+ }
+
+ /** retrieves a (untyped) value with a given name
+
+ If the collection does not contain a value with the given name, an empty
+ Any is returned.
+ */
+ const ::com::sun::star::uno::Any& get( const OUString& _rValueName ) const
+ {
+ return impl_get( _rValueName );
+ }
+
+ /// determines whether a value with a given name is present in the collection
+ inline bool has( const sal_Char* _pAsciiValueName ) const
+ {
+ return impl_has( OUString::createFromAscii( _pAsciiValueName ) );
+ }
+
+ /// determines whether a value with a given name is present in the collection
+ inline bool has( const OUString& _rValueName ) const
+ {
+ return impl_has( _rValueName );
+ }
+
+ /** puts a value into the collection
+
+ @return <TRUE/> if and only if a value was already present previously, in
+ which case it has been overwritten.
+ */
+ template < typename VALUE_TYPE >
+ inline bool put( const sal_Char* _pAsciiValueName, const VALUE_TYPE& _rValue )
+ {
+ return impl_put( OUString::createFromAscii( _pAsciiValueName ), ::com::sun::star::uno::makeAny( _rValue ) );
+ }
+
+ /** puts a value into the collection
+
+ @return <TRUE/> if and only if a value was already present previously, in
+ which case it has been overwritten.
+ */
+ template < typename VALUE_TYPE >
+ inline bool put( const OUString& _rValueName, const VALUE_TYPE& _rValue )
+ {
+ return impl_put( _rValueName, ::com::sun::star::uno::makeAny( _rValue ) );
+ }
+
+ inline bool put( const sal_Char* _pAsciiValueName, const ::com::sun::star::uno::Any& _rValue )
+ {
+ return impl_put( OUString::createFromAscii( _pAsciiValueName ), _rValue );
+ }
+
+ inline bool put( const OUString& _rValueName, const ::com::sun::star::uno::Any& _rValue )
+ {
+ return impl_put( _rValueName, _rValue );
+ }
+
+ /** removes the value with the given name from the collection
+
+ @return <TRUE/> if and only if a value with the given name existed in the collection.
+ */
+ inline bool remove( const sal_Char* _pAsciiValueName )
+ {
+ return impl_remove( OUString::createFromAscii( _pAsciiValueName ) );
+ }
+
+ /** removes the value with the given name from the collection
+
+ @return <TRUE/> if and only if a value with the given name existed in the collection.
+ */
+ inline bool remove( const OUString& _rValueName )
+ {
+ return impl_remove( _rValueName );
+ }
+
+ /** transforms the collection to a sequence of PropertyValues
+
+ @return
+ the number of elements in the sequence
+ */
+ sal_Int32 operator >>= ( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _out_rValues ) const;
+
+ /** transforms the collection to a sequence of NamedValues
+
+ @return
+ the number of elements in the sequence
+ */
+ sal_Int32 operator >>= ( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _out_rValues ) const;
+
+ /** transforms the collection into a sequence of PropertyValues
+ */
+ inline ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
+ getPropertyValues() const
+ {
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aValues;
+ *this >>= aValues;
+ return aValues;
+ }
+
+ /** returns a Sequence< Any >, containing PropertyValues
+ */
+ inline ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+ getWrappedPropertyValues() const
+ {
+ return impl_wrap< ::com::sun::star::beans::PropertyValue >();
+ }
+
+ /** returns a Sequence< Any >, containing NamedValues
+ */
+ inline ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+ getWrappedNamedValues() const
+ {
+ return impl_wrap< ::com::sun::star::beans::NamedValue >();
+ }
+
+ /** transforms the collection into a sequence of NamedValues
+ */
+ inline ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ getNamedValues() const
+ {
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > aValues;
+ *this >>= aValues;
+ return aValues;
+ }
+
+ private:
+ void impl_assign( const ::com::sun::star::uno::Any& i_rWrappedElements );
+ void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments );
+ void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArguments );
+ void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rArguments );
+
+ bool get_ensureType(
+ const OUString& _rValueName,
+ void* _pValueLocation,
+ const ::com::sun::star::uno::Type& _rExpectedValueType
+ ) const;
+
+ const ::com::sun::star::uno::Any&
+ impl_get( const OUString& _rValueName ) const;
+
+ bool impl_has( const OUString& _rValueName ) const;
+
+ bool impl_put( const OUString& _rValueName, const ::com::sun::star::uno::Any& _rValue );
+
+ bool impl_remove( const OUString& _rValueName );
+
+ template< class VALUE_TYPE >
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > impl_wrap() const
+ {
+ ::com::sun::star::uno::Sequence< VALUE_TYPE > aValues;
+ *this >>= aValues;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aWrappedValues( aValues.getLength() );
+ ::com::sun::star::uno::Any (* const makeAny)(const VALUE_TYPE&) = ::com::sun::star::uno::makeAny< VALUE_TYPE >;
+ ::std::transform(
+ aValues.getConstArray(),
+ aValues.getConstArray() + aValues.getLength(),
+ aWrappedValues.getArray(),
+ makeAny
+ );
+ return aWrappedValues;
+ }
+ };
+
+//........................................................................
+} // namespace comphelper
+//........................................................................
+
+#endif // COMPHELPER_NAMEDVALUECOLLECTION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/newarray.hxx b/include/comphelper/newarray.hxx
new file mode 100644
index 000000000000..b64095ae8ff4
--- /dev/null
+++ b/include/comphelper/newarray.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 COMPHELPER_NEW_ARRAY_HXX
+#define COMPHELPER_NEW_ARRAY_HXX
+
+#include <limits>
+#include <new>
+#include <stddef.h>
+
+namespace comphelper {
+
+template<typename T> T *
+newArray_null(size_t const n) throw()
+{
+ if (((::std::numeric_limits<size_t>::max)() / sizeof(T)) <= n) {
+ return 0;
+ }
+ return new (::std::nothrow) T[n];
+}
+
+template<typename T> T *
+newArray_ex(size_t const n)
+{
+ if (((::std::numeric_limits<size_t>::max)() / sizeof(T)) <= n) {
+ throw ::std::bad_alloc();
+ }
+ return new T[n];
+}
+
+} // namespace comphelper
+
+#endif // COMPHELPER_NEW_ARRAY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/numberedcollection.hxx b/include/comphelper/numberedcollection.hxx
new file mode 100644
index 000000000000..6a311767658d
--- /dev/null
+++ b/include/comphelper/numberedcollection.hxx
@@ -0,0 +1,176 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_NUMBEREDCOLLECTION_HXX_
+#define _COMPHELPER_NUMBEREDCOLLECTION_HXX_
+
+#include "comphelper/comphelperdllapi.h"
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/frame/XUntitledNumbers.hpp>
+
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+#include <vector>
+#include <boost/unordered_map.hpp>
+
+
+namespace comphelper{
+
+/** @short defines a collection of UNO components, where every component will get it's own unique number.
+
+ @descr Such number will be unique at runtime only ... but it supports fragmentation.
+ Note: This collection uses weak refrences only to know her components.
+ So lifetime of thise components must be controlled outside.
+
+ @threadsafe
+ */
+class COMPHELPER_DLLPUBLIC NumberedCollection : private ::cppu::BaseMutex
+ , public ::cppu::WeakImplHelper1< css::frame::XUntitledNumbers >
+{
+ //-------------------------------------------
+ // types, const
+ private:
+
+ struct TNumberedItem
+ {
+ css::uno::WeakReference< css::uno::XInterface > xItem;
+ ::sal_Int32 nNumber;
+ };
+
+ typedef ::boost::unordered_map<
+ long ,
+ TNumberedItem ,
+ ::boost::hash< long > ,
+ ::std::equal_to< long > > TNumberedItemHash;
+
+ typedef ::std::vector< long > TDeadItemList;
+
+ //-------------------------------------------
+ // interface
+ public:
+
+ //---------------------------------------
+ /** @short lightweight constructor.
+ */
+ NumberedCollection();
+
+ //---------------------------------------
+ /** @short free all internaly used resources.
+ */
+ virtual ~NumberedCollection();
+
+ //---------------------------------------
+ /** set an outside component which uses this container and must be set
+ as source of all broadcasted messages, exceptions.
+
+ It's holded weak only so we do not need any complex dispose sessions.
+
+ Note: Passing NULL as parameter will be allowed. It will reset the internal
+ member reference only.
+
+ @param xOwner
+ the new owner of this collection.
+ */
+ void setOwner (const css::uno::Reference< css::uno::XInterface >& xOwner);
+
+ //---------------------------------------
+ /** set the localized prefix to be used for untitled components.
+
+ Localization has to be done outside. This container will return
+ those value then. There are no further checks. Its up to you to define
+ a suitable string here :-)
+
+ @param sPrefix
+ the new prefix for untitled components.
+ */
+ void setUntitledPrefix(const OUString& sPrefix);
+
+ //---------------------------------------
+ /** @see css.frame.XUntitledNumbers */
+ virtual ::sal_Int32 SAL_CALL leaseNumber(const css::uno::Reference< css::uno::XInterface >& xComponent)
+ throw (css::lang::IllegalArgumentException,
+ css::uno::RuntimeException );
+
+ //---------------------------------------
+ /** @see css.frame.XUntitledNumbers */
+ virtual void SAL_CALL releaseNumber(::sal_Int32 nNumber)
+ throw (css::lang::IllegalArgumentException,
+ css::uno::RuntimeException );
+
+ //---------------------------------------
+ /** @see css.frame.XUntitledNumbers */
+ virtual void SAL_CALL releaseNumberForComponent(const css::uno::Reference< css::uno::XInterface >& xComponent)
+ throw (css::lang::IllegalArgumentException,
+ css::uno::RuntimeException );
+
+ //---------------------------------------
+ /** @see css.frame.XUntitledNumbers */
+ virtual OUString SAL_CALL getUntitledPrefix()
+ throw (css::uno::RuntimeException);
+
+ //-------------------------------------------
+ // internal
+ private:
+
+ //---------------------------------------
+ /** @short trys to find an unique number not already used within this collection.
+
+ @descr It reuses the smalles number which isnt used by any component
+ of this collection. (fragmentation!) If collection is full (means there
+ is no free number) the special value INVALID_NUMBER will be returned.
+
+ @note Those method cant be called within a multithreaded environment ..
+ Because such number wont be "reserved" for the calli of these method
+ it can happen that two calls returns the same number (reasoned by the fact that first calli
+ doesnt used the returned number already.
+
+ So the outside code has to make sure that retrieving and using of those number
+ will be an atomic operation.
+
+ @return an unique number or special value INVALID_NUMBER if collection is full.
+ */
+ ::sal_Int32 impl_searchFreeNumber ();
+
+ void impl_cleanUpDeadItems ( TNumberedItemHash& lItems ,
+ const TDeadItemList& lDeadItems);
+
+ //-------------------------------------------
+ // member
+ private:
+
+ /// localized string to be used for untitled components
+ OUString m_sUntitledPrefix;
+
+ /// cache of all "leased numbers" and its bound components
+ TNumberedItemHash m_lComponents;
+
+ /// used as source of broadcasted messages or exceptions (can be null !)
+ css::uno::WeakReference< css::uno::XInterface > m_xOwner;
+};
+
+} // namespace comphelper
+
+#endif // _COMPHELPER_NUMBEREDCOLLECTION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/numbers.hxx b/include/comphelper/numbers.hxx
new file mode 100644
index 000000000000..b64fe341da4f
--- /dev/null
+++ b/include/comphelper/numbers.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 _COMPHELPER_NUMBERS_HXX_
+#define _COMPHELPER_NUMBERS_HXX_
+
+#include <com/sun/star/util/XNumberFormats.hpp>
+#include <com/sun/star/util/XNumberFormatter.hpp>
+#include <com/sun/star/lang/Locale.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ namespace staruno = ::com::sun::star::uno;
+ namespace starlang = ::com::sun::star::lang;
+ namespace starutil = ::com::sun::star::util;
+
+ /// returns the ::com::sun::star::util::NumberFormat of the given key under the given formats
+ COMPHELPER_DLLPUBLIC sal_Int16 getNumberFormatType(const staruno::Reference<starutil::XNumberFormats>& xFormats, sal_Int32 nKey);
+
+ /// returns the ::com::sun::star::util::NumberFormat of the given key under the given formatter
+ COMPHELPER_DLLPUBLIC sal_Int16 getNumberFormatType(const staruno::Reference<starutil::XNumberFormatter>& xFormatter, sal_Int32 nKey);
+
+ /// returns the decimals of the given numeric number formatunder the given formats
+ COMPHELPER_DLLPUBLIC staruno::Any getNumberFormatDecimals(const staruno::Reference<starutil::XNumberFormats>& xFormats, sal_Int32 nKey);
+
+ /** returns the standard format for the given type and the given _rLocale
+ */
+ sal_Int32 getStandardFormat(
+ const staruno::Reference<starutil::XNumberFormatter>& xFormatter,
+ sal_Int16 nType,
+ const starlang::Locale& _rLocale);
+
+ /** retrieves a the value of a given property for a given format key, relating to a given formatter
+ */
+ COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Any getNumberFormatProperty(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter,
+ sal_Int32 _nKey,
+ const OUString& _rPropertyName
+ );
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // _COMPHELPER_NUMBERS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/officeresourcebundle.hxx b/include/comphelper/officeresourcebundle.hxx
new file mode 100644
index 000000000000..5e6d9e1bccc5
--- /dev/null
+++ b/include/comphelper/officeresourcebundle.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 COMPHELPER_OFFICE_RESOURCE_BUNDLE_HXX
+#define COMPHELPER_OFFICE_RESOURCE_BUNDLE_HXX
+
+#include <comphelper/comphelperdllapi.h>
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <rtl/ustring.hxx>
+
+#include <memory>
+
+//........................................................................
+namespace comphelper
+{
+//........................................................................
+
+ //====================================================================
+ //= OfficeResourceBundle
+ //====================================================================
+ class ResourceBundle_Impl;
+ /** wraps the <type scope="com::sun::star::resource">OfficeResourceAccess</type> service
+ */
+ class COMPHELPER_DLLPUBLIC OfficeResourceBundle
+ {
+ private:
+ ::std::auto_ptr< ResourceBundle_Impl > m_pImpl;
+
+ public:
+ /** constructs a resource bundle with the resource bundle given as 8-bit ASCII name
+
+ This is a convenience constructor only, it does nothing different than the constructor
+ taking an unicode string.
+
+ @param _context
+ the component context to operate in
+ @param _bundleBaseName
+ the base name of the resource file which should be accessed (*without* the SUPD!)
+ @raises ::com::sun::star::lang::NullPointerException
+ if the given component context is <NULL/>
+ */
+ OfficeResourceBundle(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _context,
+ const sal_Char* _bundleBaseAsciiName
+ );
+
+ /** destroys the instance
+ */
+ ~OfficeResourceBundle();
+
+ /** loads the string with the given resource id from the resource bundle
+ @param _resourceId
+ the id of the string to load
+ @return
+ the requested resource string. If no string with the given id exists in the resource bundle,
+ an empty string is returned. In a non-product version, an OSL_ENSURE will notify you of this
+ then.
+ */
+ OUString loadString( sal_Int32 _resourceId ) const;
+
+ /** determines whether the resource bundle has a string with the given id
+ @param _resourceId
+ the id of the string whose existence is to be checked
+ @return
+ <TRUE/> if and only if a string with the given ID exists in the resource
+ bundle.
+ */
+ bool hasString( sal_Int32 _resourceId ) const;
+ };
+
+//........................................................................
+} // namespace comphelper
+//........................................................................
+
+#endif // COMPHELPER_OFFICE_RESOURCE_BUNDLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/ofopxmlhelper.hxx b/include/comphelper/ofopxmlhelper.hxx
new file mode 100644
index 000000000000..e054d0dbc909
--- /dev/null
+++ b/include/comphelper/ofopxmlhelper.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 _COMPHELPER_OFOPXMLHELPER_HXX
+#define _COMPHELPER_OFOPXMLHELPER_HXX
+
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/beans/StringPair.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/comphelperdllapi.h>
+
+
+namespace comphelper
+{
+
+// this helper class is designed to allow to parse ContentType- and Relationship-related information from OfficeOpenXML format
+class COMPHELPER_DLLPUBLIC OFOPXMLHelper : public cppu::WeakImplHelper1 < com::sun::star::xml::sax::XDocumentHandler >
+{
+ sal_uInt16 m_nFormat; // which format to parse
+
+ // Relations info related strings
+ OUString m_aRelListElement;
+ OUString m_aRelElement;
+ OUString m_aIDAttr;
+ OUString m_aTypeAttr;
+ OUString m_aTargetModeAttr;
+ OUString m_aTargetAttr;
+
+ // ContentType related strings
+ OUString m_aTypesElement;
+ OUString m_aDefaultElement;
+ OUString m_aOverrideElement;
+ OUString m_aExtensionAttr;
+ OUString m_aPartNameAttr;
+ OUString m_aContentTypeAttr;
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aResultSeq;
+ ::com::sun::star::uno::Sequence< OUString > m_aElementsSeq; // stack of elements being parsed
+
+ OFOPXMLHelper( sal_uInt16 nFormat ); // must not be created directly
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetParsingResult();
+
+ static COMPHELPER_DLLPRIVATE ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL ReadSequence_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream, const OUString& aStringID, sal_uInt16 nFormat, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext )
+ throw( ::com::sun::star::uno::Exception );
+
+public:
+ ~OFOPXMLHelper();
+
+ // returns sequence of elements, where each element is described by sequence of tags,
+ // where each tag is described by StringPair ( First - name, Second - value )
+ // the first tag of each element sequence must be "Id"
+ static
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >
+ SAL_CALL
+ ReadRelationsInfoSequence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream,
+ const OUString aStreamName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext )
+ throw( ::com::sun::star::uno::Exception );
+
+ // returns sequence containing two entries of type sequence<StringPair>
+ // the first sequence describes "Default" elements, where each element is described
+ // by StringPair object ( First - Extension, Second - ContentType )
+ // the second sequence describes "Override" elements, where each element is described
+ // by StringPair object ( First - PartName, Second - ContentType )
+ static
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >
+ SAL_CALL
+ ReadContentTypeSequence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext )
+ throw( ::com::sun::star::uno::Exception );
+
+ // writes sequence of elements, where each element is described by sequence of tags,
+ // where each tag is described by StringPair ( First - name, Second - value )
+ // the first tag of each element sequence must be "Id"
+ static
+ void SAL_CALL WriteRelationsInfoSequence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutStream,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >& aSequence,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext )
+ throw( ::com::sun::star::uno::Exception );
+
+ // writes two entries of type sequence<StringPair>
+ // the first sequence describes "Default" elements, where each element is described
+ // by StringPair object ( First - Extension, Second - ContentType )
+ // the second sequence describes "Override" elements, where each element is described
+ // by StringPair object ( First - PartName, Second - ContentType )
+ static
+ void SAL_CALL WriteContentSequence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutStream,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aDefaultsSequence,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aOverridesSequence,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext )
+ throw( ::com::sun::star::uno::Exception );
+
+ // XDocumentHandler
+ virtual void SAL_CALL startDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL startElement( const OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endElement( const OUString& aName ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL characters( const OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+};
+
+} // namespace comphelper
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/optional.hxx b/include/comphelper/optional.hxx
new file mode 100644
index 000000000000..031a30328340
--- /dev/null
+++ b/include/comphelper/optional.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_COMPHELPER_OPTIONAL_HXX
+#define INCLUDED_COMPHELPER_OPTIONAL_HXX
+
+#include "com/sun/star/beans/Optional.hpp"
+#include "boost/optional.hpp"
+
+namespace comphelper {
+
+/// Object generators for boost::optional<T>, beans::Optional<T>:
+
+template <typename T>
+inline ::boost::optional<T> make_optional( T const& v )
+{
+ return ::boost::optional<T>(v);
+}
+
+template <typename T>
+inline ::boost::optional<T> make_optional(
+ ::com::sun::star::beans::Optional<T> const& o )
+{
+ if (o.IsPresent)
+ return ::boost::optional<T>(o.Value);
+ else
+ return ::boost::optional<T>();
+}
+
+template <typename T>
+inline ::com::sun::star::beans::Optional<T> makeOptional( T const& v )
+{
+// CPPU_IS_CPP_MAPPING_OF_NON_VOID_UNO_TYPE(T);
+ return ::com::sun::star::beans::Optional<T>(true, v);
+}
+
+template <typename T>
+inline ::com::sun::star::beans::Optional<T> makeOptional(
+ ::boost::optional<T> const& o )
+{
+// CPPU_IS_CPP_MAPPING_OF_NON_VOID_UNO_TYPE(T);
+ if (o)
+ return ::com::sun::star::beans::Optional<T>(true, *o);
+ else
+ return ::com::sun::star::beans::Optional<T>();
+}
+
+inline ::com::sun::star::beans::Optional<sal_Bool> makeOptional(
+ ::boost::optional<bool> const& o )
+{
+ if (o)
+ return ::com::sun::star::beans::Optional<sal_Bool>(true, *o);
+ else
+ return ::com::sun::star::beans::Optional<sal_Bool>();
+}
+
+inline ::com::sun::star::beans::Optional<sal_Bool> makeOptional( bool v )
+{
+ return ::com::sun::star::beans::Optional<sal_Bool>(true, v);
+}
+
+} // namespace comphelper
+
+#endif // ! defined(INCLUDED_COMPHELPER_OPTIONAL_HXX)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/oslfile2streamwrap.hxx b/include/comphelper/oslfile2streamwrap.hxx
new file mode 100644
index 000000000000..f43297b28b43
--- /dev/null
+++ b/include/comphelper/oslfile2streamwrap.hxx
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _COMPHELPER_STREAM_OSLFILEWRAPPER_HXX_
+#define _COMPHELPER_STREAM_OSLFILEWRAPPER_HXX_
+
+#include <osl/mutex.hxx>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <osl/file.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+namespace comphelper
+{
+ namespace stario = ::com::sun::star::io;
+ namespace staruno = ::com::sun::star::uno;
+
+//==================================================================
+// FmUnoIOStream,
+// Stream to read and write data, based on File
+//==================================================================
+class COMPHELPER_DLLPUBLIC OSLInputStreamWrapper : public ::cppu::WeakImplHelper1<stario::XInputStream>
+{
+ ::osl::Mutex m_aMutex;
+ ::osl::File* m_pFile;
+
+public:
+ OSLInputStreamWrapper(::osl::File& _rStream);
+ virtual ~OSLInputStreamWrapper();
+
+// stario::XInputStream
+ virtual sal_Int32 SAL_CALL readBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual sal_Int32 SAL_CALL readSomeBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual sal_Int32 SAL_CALL available() throw(stario::NotConnectedException, staruno::RuntimeException);
+ virtual void SAL_CALL closeInput() throw(stario::NotConnectedException, staruno::RuntimeException);
+};
+
+//==================================================================
+// FmUnoOutStream,
+// data sink for the files
+//==================================================================
+class OSLOutputStreamWrapper : public ::cppu::WeakImplHelper1<stario::XOutputStream>
+{
+public:
+ COMPHELPER_DLLPUBLIC OSLOutputStreamWrapper(::osl::File& _rFile);
+
+private:
+ virtual ~OSLOutputStreamWrapper();
+
+// stario::XOutputStream
+ virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual void SAL_CALL flush() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual void SAL_CALL closeOutput() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+
+ ::osl::File& rFile;
+};
+
+} // namespace comphelper
+
+
+#endif // _COMPHELPER_STREAM_OSLFILEWRAPPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/processfactory.hxx b/include/comphelper/processfactory.hxx
new file mode 100644
index 000000000000..e6833fc49327
--- /dev/null
+++ b/include/comphelper/processfactory.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 _COMPHELPER_PROCESSFACTORY_HXX_
+#define _COMPHELPER_PROCESSFACTORY_HXX_
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace lang {
+ class XMultiServiceFactory;
+} } } }
+
+namespace comphelper
+{
+
+/**
+ * This function set the process service factory.
+ *
+ * @author Juergen Schmidt
+ */
+COMPHELPER_DLLPUBLIC void setProcessServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMgr);
+
+/**
+ * This function gets the process service factory.
+ *
+ * If no service factory is set the function throws a RuntimeException.
+ *
+ * @author Juergen Schmidt
+ */
+COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getProcessServiceFactory();
+
+/** Obtains a component context from a service factory.
+
+ Throws a RuntimeException if no component context can be obtained.
+
+ @param factory may be null
+ @return may be null
+ */
+COMPHELPER_DLLPUBLIC
+com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+getComponentContext(
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ const & factory);
+
+/**
+ * This function gets the process service factory's default component context.
+ *
+ * Throws a RuntimeException if no component context can be obtained.
+ */
+COMPHELPER_DLLPUBLIC
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+getProcessComponentContext();
+
+}
+
+
+extern "C" {
+/// @internal ATTENTION returns ACQUIRED pointer! release it explicitly!
+COMPHELPER_DLLPUBLIC
+::com::sun::star::uno::XComponentContext *
+comphelper_getProcessComponentContext();
+} // extern "C"
+
+#endif // _COMPHELPER_PROCESSFACTORY_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/propagg.hxx b/include/comphelper/propagg.hxx
new file mode 100644
index 000000000000..3a6ca83e36c1
--- /dev/null
+++ b/include/comphelper/propagg.hxx
@@ -0,0 +1,325 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_PROPERTY_AGGREGATION_HXX_
+#define _COMPHELPER_PROPERTY_AGGREGATION_HXX_
+
+#include <com/sun/star/uno/XAggregation.hpp>
+#include <comphelper/propstate.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+#include <map>
+
+//=========================================================================
+//= property helper classes
+//=========================================================================
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+//==================================================================
+//= OPropertyAccessor
+//= internal helper class for OPropertyArrayAggregationHelper
+//==================================================================
+namespace internal
+{
+ struct OPropertyAccessor
+ {
+ sal_Int32 nOriginalHandle;
+ sal_Int32 nPos;
+ bool bAggregate;
+
+ OPropertyAccessor(sal_Int32 _nOriginalHandle, sal_Int32 _nPos, bool _bAggregate)
+ :nOriginalHandle(_nOriginalHandle) ,nPos(_nPos) ,bAggregate(_bAggregate) { }
+ OPropertyAccessor()
+ :nOriginalHandle(-1) ,nPos(-1) ,bAggregate(false) { }
+
+ bool operator==(const OPropertyAccessor& rOb) const { return nPos == rOb.nPos; }
+ bool operator <(const OPropertyAccessor& rOb) const { return nPos < rOb.nPos; }
+ };
+
+ typedef std::map< sal_Int32, OPropertyAccessor, ::std::less< sal_Int32 > > PropertyAccessorMap;
+ typedef PropertyAccessorMap::iterator PropertyAccessorMapIterator;
+ typedef PropertyAccessorMap::const_iterator ConstPropertyAccessorMapIterator;
+}
+
+//==================================================================
+/**
+ * used as callback for a OPropertyArrayAggregationHelper
+ */
+class IPropertyInfoService
+{
+public:
+ /** get the prefered handle for the given property
+ @param _rName the property name
+ @return the handle the property should be refered by, or -1 if there are no
+ preferences for the given property
+ */
+ virtual sal_Int32 getPreferedPropertyId(const OUString& _rName) = 0;
+
+protected:
+ ~IPropertyInfoService() {}
+};
+
+/**
+ * used for implementing an cppu::IPropertyArrayHelper for classes
+ * aggregating property sets
+ */
+
+#define DEFAULT_AGGREGATE_PROPERTY_ID 10000
+//------------------------------------------------------------------
+class COMPHELPER_DLLPUBLIC OPropertyArrayAggregationHelper: public ::cppu::IPropertyArrayHelper
+{
+ friend class OPropertySetAggregationHelper;
+protected:
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property> m_aProperties;
+ internal::PropertyAccessorMap m_aPropertyAccessors;
+
+public:
+ /** construct the object.
+ @param _rProperties the properties of the object doing the aggregation. These properties
+ are used without any checks, so the caller has to ensure that the names and
+ handles are valid.
+ @param _rAggProperties the properties of the aggregate, usually got via an call to getProperties on the
+ XPropertySetInfo of the aggregate.
+ The names of the properties are used without any checks, so the caller has to ensure
+ that there are no doubles.
+ The handles are stored for later quick access, but the outside-handles the
+ aggregate properties get depend from the following two parameters.
+ @param _pInfoService
+ If not NULL, the object pointed to is used to calc handles which should be used
+ for refering the aggregate's properties from outside.
+ If one of the properties returned from the info service conflict with other handles
+ alread present (e.g. through _rProperties), the property is handled as if -1 was returned.
+ If NULL (or, for a special property, a call to getPreferedPropertyId returns -1),
+ the aggregate property(ies) get a new handle which they can be refered by from outside.
+ @param _nFirstAggregateId
+ if the object is about to create new handles for the aggregate properties, it uses
+ id's ascending from this given id.
+ No checks are made if the handle range determined by _nFirstAggregateId conflicts with other
+ handles within _rProperties.
+ */
+ OPropertyArrayAggregationHelper(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property>& _rProperties,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property>& _rAggProperties,
+ IPropertyInfoService* _pInfoService = NULL,
+ sal_Int32 _nFirstAggregateId = DEFAULT_AGGREGATE_PROPERTY_ID);
+
+
+ /// inherited from IPropertyArrayHelper
+ virtual sal_Bool SAL_CALL fillPropertyMembersByHandle( OUString* _pPropName, sal_Int16* _pAttributes,
+ sal_Int32 _nHandle) ;
+
+ /// inherited from IPropertyArrayHelper
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property> SAL_CALL getProperties();
+ /// inherited from IPropertyArrayHelper
+ virtual ::com::sun::star::beans::Property SAL_CALL getPropertyByName(const OUString& _rPropertyName)
+ throw(::com::sun::star::beans::UnknownPropertyException);
+
+ /// inherited from IPropertyArrayHelper
+ virtual sal_Bool SAL_CALL hasPropertyByName(const OUString& _rPropertyName) ;
+ /// inherited from IPropertyArrayHelper
+ virtual sal_Int32 SAL_CALL getHandleByName(const OUString & _rPropertyName);
+ /// inherited from IPropertyArrayHelper
+ virtual sal_Int32 SAL_CALL fillHandles( /*out*/sal_Int32* _pHandles, const ::com::sun::star::uno::Sequence< OUString >& _rPropNames );
+
+ /** returns information about a property of the aggregate.
+ @param _pPropName points to a string to receive the property name. No name is returned if this is NULL.
+ @param _pOriginalHandle points to a sal_Int32 to receive the original property hande. No original handle is returned
+ if this is NULL.
+ @param _nHandle the handle of the property as got by, for instance, fillHandles
+
+ @return sal_True, if _nHandle marks an aggregate property, otherwise sal_False
+ */
+ virtual bool SAL_CALL fillAggregatePropertyInfoByHandle(OUString* _pPropName, sal_Int32* _pOriginalHandle,
+ sal_Int32 _nHandle) const;
+
+ /** returns information about a property given by handle
+ */
+ sal_Bool getPropertyByHandle( sal_Int32 _nHandle, ::com::sun::star::beans::Property& _rProperty ) const;
+
+
+ enum PropertyOrigin
+ {
+ AGGREGATE_PROPERTY,
+ DELEGATOR_PROPERTY,
+ UNKNOWN_PROPERTY
+ };
+ /** prefer this one over the XPropertySetInfo of the aggregate!
+
+ <p>The reason is that OPropertyArrayAggregationHelper is the only instance which really knows
+ which properties of the aggregate are to be exposed. <br/>
+
+ For instance, some derivee of OPropertySetAggregationHelper may decide to create an
+ OPropertyArrayAggregationHelper which contains only a subset of the aggregate properties. This way,
+ some of the aggregate properties may be hidded to the public.<br/>
+
+ When using the XPropertySetInfo of the aggregate set to determine the existence of a property, then this
+ would return false positives.</p>
+ */
+ PropertyOrigin classifyProperty( const OUString& _rName );
+
+protected:
+ const ::com::sun::star::beans::Property* findPropertyByName(const OUString& _rName) const;
+};
+
+//==================================================================
+namespace internal
+{
+ class PropertyForwarder;
+}
+
+/**
+ * helper class for implementing the property-set-related interfaces
+ * for an object doin' aggregation
+ * supports at least XPropertySet and XMultiPropertySet
+ *
+ */
+class COMPHELPER_DLLPUBLIC OPropertySetAggregationHelper :public OPropertyStateHelper
+ ,public ::com::sun::star::beans::XPropertiesChangeListener
+ ,public ::com::sun::star::beans::XVetoableChangeListener
+{
+ friend class internal::PropertyForwarder;
+
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState> m_xAggregateState;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xAggregateSet;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet> m_xAggregateMultiSet;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet> m_xAggregateFastSet;
+
+ internal::PropertyForwarder* m_pForwarder;
+ sal_Bool m_bListening : 1;
+
+public:
+ OPropertySetAggregationHelper( ::cppu::OBroadcastHelper& rBHelper );
+
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& aType) throw(::com::sun::star::uno::RuntimeException);
+
+// XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw (::com::sun::star::uno::RuntimeException);
+
+// XFastPropertySet
+ virtual void SAL_CALL setFastPropertyValue(sal_Int32 nHandle, const ::com::sun::star::uno::Any& aValue) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+// XPropertySet
+ virtual void SAL_CALL addPropertyChangeListener(const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener(const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+// XPropertiesChangeListener
+ virtual void SAL_CALL propertiesChange(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& evt) throw(::com::sun::star::uno::RuntimeException);
+
+// XVetoableChangeListener
+ virtual void SAL_CALL vetoableChange(const ::com::sun::star::beans::PropertyChangeEvent& aEvent) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
+
+// XMultiPropertySet
+ virtual void SAL_CALL setPropertyValues(const ::com::sun::star::uno::Sequence< OUString >& PropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Values) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertiesChangeListener(const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener) throw(::com::sun::star::uno::RuntimeException);
+
+// XPropertyState
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(const OUString& PropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyToDefault(const OUString& PropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault(const OUString& aPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+// OPropertySetHelper
+ /** still waiting to be overwritten ...
+ you <B>must<B/> use an OPropertyArrayAggregationHelper here, as the implementation strongly relies on this.
+ */
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() = 0;
+
+ /** only implemented for "forwarded" properties, every other property must be handled
+ in the derivee, and will assert if passed herein
+ */
+ virtual sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) throw(::com::sun::star::lang::IllegalArgumentException);
+
+ /** only implemented for "forwarded" properties, every other property must be handled
+ in the derivee, and will assert if passed herein
+ */
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) throw ( ::com::sun::star::uno::Exception );
+
+protected:
+ ~OPropertySetAggregationHelper();
+
+ virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const;
+ virtual void SAL_CALL disposing();
+
+ sal_Int32 getOriginalHandle( sal_Int32 _nHandle ) const;
+ OUString getPropertyName( sal_Int32 _nHandle ) const;
+
+ /** declares the property with the given (public) handle as one to be forwarded to the aggregate
+
+ Sometimes, you might want to <em>overwrite</em> properties at the aggregate. That is,
+ though the aggregate implements this property, and still is to hold the property value,
+ you want to do additional handling upon setting the property, but then forward the value
+ to the aggregate.
+
+ Use this method to declare such properties.
+
+ When a "forwarded property" is set from outside, the class first calls
+ <member>forwardingPropertyValue</member> for any preprocessing, then forwards the property
+ value to the aggregate, and then calls <member>forwardedPropertyValue</member>.
+
+ When you declare a property as "forwarded", the class takes care for some multi-threading
+ issues, for instance, it won't fire any property change notifications which result from
+ forwarding a property value, unless it's safe to do so (i.e. unless our mutex is
+ released).
+
+ @see forwardingPropertyValue
+ @see forwardedPropertyValue
+ */
+ void declareForwardedProperty( sal_Int32 _nHandle );
+
+ /** checks whether we're actually forwarding a property value to our aggregate
+
+ @see declareForwardedProperty
+ @see forwardingPropertyValue
+ @see forwardedPropertyValue
+ */
+ bool isCurrentlyForwardingProperty( sal_Int32 _nHandle ) const;
+
+ /** called immediately before a property value which is overwritten in this instance
+ is forwarded to the aggregate
+
+ @see declareForwardedProperty
+ @see forwardedPropertyValue
+ */
+ virtual void SAL_CALL forwardingPropertyValue( sal_Int32 _nHandle );
+
+ /** called immediately after a property value which is overwritten in this instance
+ has been forwarded to the aggregate
+
+ @see declareForwardedProperty
+ @see forwardingPropertyValue
+ */
+ virtual void SAL_CALL forwardedPropertyValue( sal_Int32 _nHandle, bool _bSuccess );
+
+ /// must be called before aggregation, if aggregation is used
+ void setAggregation(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >&) throw( ::com::sun::star::lang::IllegalArgumentException );
+ void startListening();
+};
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // _COMPHELPER_PROPERTY_AGGREGATION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/proparrhlp.hxx b/include/comphelper/proparrhlp.hxx
new file mode 100644
index 000000000000..840213e88427
--- /dev/null
+++ b/include/comphelper/proparrhlp.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 _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_
+#define _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_
+
+#include <comphelper/stl_types.hxx>
+#include <comphelper/propagg.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <osl/mutex.hxx>
+#include <osl/diagnose.h>
+#include <rtl/instance.hxx>
+
+namespace cppu {
+ class IPropertyArrayHelper;
+}
+
+//... namespace comphelper ................................................
+namespace comphelper
+{
+//.........................................................................
+
+ namespace staruno = ::com::sun::star::uno;
+ namespace starbeans = ::com::sun::star::beans;
+
+
+//==================================================================
+
+template <typename TYPE> struct OPropertyArrayUsageHelperMutex
+ : public rtl::Static< ::osl::Mutex, OPropertyArrayUsageHelperMutex<TYPE> > {};
+
+
+template <class TYPE>
+class OPropertyArrayUsageHelper
+{
+protected:
+ static sal_Int32 s_nRefCount;
+ static ::cppu::IPropertyArrayHelper* s_pProps;
+
+public:
+ OPropertyArrayUsageHelper();
+ virtual ~OPropertyArrayUsageHelper()
+ { // ARGHHHHHHH ..... would like to implement this after the class
+ // definition (as we do with all other methods) but SUNPRO 5 compiler
+ // (linker) doesn't like this
+ ::osl::MutexGuard aGuard(OPropertyArrayUsageHelperMutex<TYPE>::get());
+ OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
+ if (!--s_nRefCount)
+ {
+ delete s_pProps;
+ s_pProps = NULL;
+ }
+ }
+
+ /** call this in the getInfoHelper method of your derived class. The method returns the array helper of the
+ class, which is created if neccessary.
+ */
+ ::cppu::IPropertyArrayHelper* getArrayHelper();
+
+protected:
+ /** used to implement the creation of the array helper which is shared amongst all instances of the class.
+ This method needs to be implemented in derived classes.
+ <BR>
+ The method gets called with Mutex acquired.
+ <BR>
+ as long as IPropertyArrayHelper has no virtual destructor, the implementation of ~OPropertyArrayUsageHelper
+ assumes that you created an ::cppu::OPropertyArrayHelper when deleting s_pProps.
+ @return an pointer to the newly created array helper. Must not be NULL.
+ */
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const = 0;
+};
+
+//==================================================================
+/** a OPropertyArrayUsageHelper which will create an OPropertyArrayAggregationHelper
+*/
+template <class TYPE>
+class OAggregationArrayUsageHelper: public OPropertyArrayUsageHelper<TYPE>
+{
+protected:
+ /** overwrite this in your derived class. initialize the two sequences with your and your aggregate's
+ properties.
+ <BR>
+ The method gets called with Mutex acquired.
+ @param _rProps out parameter to be filled with the property descriptions of your own class
+ @param _rAggregateProps out parameter to be filled with the properties of your aggregate.
+ */
+ virtual void fillProperties(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps
+ ) const = 0;
+
+ /** creates an OPropertyArrayAggregationHelper filled with properties for which's initialization
+ fillProperties is called. getInfoService and getFirstAggregateId may be overwritten to determine
+ the additional parameters of the OPropertyArrayAggregationHelper.
+ */
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
+
+ /** the return value is used for the construction of the OPropertyArrayAggregationHelper.
+ Beware of the lifetime of the returned object, as it has to exist 'til the last instance
+ of this class dies.
+ */
+ virtual IPropertyInfoService* getInfoService() const { return NULL; }
+
+ /** the return value is used for the construction of the OPropertyArrayAggregationHelper.
+ */
+ virtual sal_Int32 getFirstAggregateId() const { return DEFAULT_AGGREGATE_PROPERTY_ID; }
+};
+
+//------------------------------------------------------------------
+template<class TYPE>
+sal_Int32 OPropertyArrayUsageHelper< TYPE >::s_nRefCount = 0;
+
+template<class TYPE>
+::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper< TYPE >::s_pProps = NULL;
+
+//------------------------------------------------------------------
+template <class TYPE>
+OPropertyArrayUsageHelper<TYPE>::OPropertyArrayUsageHelper()
+{
+ ::osl::MutexGuard aGuard(OPropertyArrayUsageHelperMutex<TYPE>::get());
+ ++s_nRefCount;
+}
+
+//------------------------------------------------------------------
+template <class TYPE>
+::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper<TYPE>::getArrayHelper()
+{
+ OSL_ENSURE(s_nRefCount, "OPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !");
+ if (!s_pProps)
+ {
+ ::osl::MutexGuard aGuard(OPropertyArrayUsageHelperMutex<TYPE>::get());
+ if (!s_pProps)
+ {
+ s_pProps = createArrayHelper();
+ OSL_ENSURE(s_pProps, "OPropertyArrayUsageHelper::getArrayHelper : createArrayHelper returned nonsense !");
+ }
+ }
+ return s_pProps;
+}
+
+//------------------------------------------------------------------
+template <class TYPE> inline
+::cppu::IPropertyArrayHelper* OAggregationArrayUsageHelper<TYPE>::createArrayHelper() const
+{
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > aProps;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > aAggregateProps;
+ fillProperties(aProps, aAggregateProps);
+ OSL_ENSURE(aProps.getLength(), "OAggregationArrayUsageHelper::createArrayHelper : fillProperties returned nonsense !");
+ return new OPropertyArrayAggregationHelper(aProps, aAggregateProps, getInfoService(), getFirstAggregateId());
+}
+
+//.........................................................................
+}
+//... namespace comphelper ................................................
+
+#endif // _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/property.hxx b/include/comphelper/property.hxx
new file mode 100644
index 000000000000..95fe122d51a6
--- /dev/null
+++ b/include/comphelper/property.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 _COMPHELPER_PROPERTY_HXX_
+#define _COMPHELPER_PROPERTY_HXX_
+
+#include <cppuhelper/proptypehlp.hxx>
+#include <comphelper/extract.hxx>
+#include <com/sun/star/beans/Property.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <functional>
+#include "comphelper/comphelperdllapi.h"
+#include "cppu/unotype.hxx"
+
+//=========================================================================
+//= property helper classes
+//=========================================================================
+
+//... namespace comphelper .......................................................
+namespace comphelper
+{
+//.........................................................................
+
+ namespace starbeans = ::com::sun::star::beans;
+ namespace staruno = ::com::sun::star::uno;
+
+/** compare two properties by name
+*/
+ //--------------------------------------------------------------------------
+ // comparing two property instances
+ struct PropertyCompareByName : public ::std::binary_function< ::com::sun::star::beans::Property, ::com::sun::star::beans::Property, bool >
+ {
+ bool operator() (const ::com::sun::star::beans::Property& x, const ::com::sun::star::beans::Property& y) const
+ {
+ return x.Name.compareTo(y.Name) < 0;// ? true : false;
+ }
+ };
+
+ //--------------------------------------------------------------------------
+ /** compare two properties by name
+ */
+ struct PropertyStringEqualFunctor : ::std::binary_function< ::com::sun::star::beans::Property, OUString, bool >
+ {
+ // ................................................................
+ inline bool operator()( const ::com::sun::star::beans::Property& lhs, const OUString& rhs ) const
+ {
+ return lhs.Name == rhs ;
+ }
+ // ................................................................
+ inline bool operator()( const OUString& lhs, const ::com::sun::star::beans::Property& rhs ) const
+ {
+ return lhs == rhs.Name ;
+ }
+ };
+ //--------------------------------------------------------------------------
+ // comparing two property instances
+ struct PropertyEqualByName : public ::std::binary_function< ::com::sun::star::beans::Property, ::com::sun::star::beans::Property, bool >
+ {
+ bool operator() (const ::com::sun::star::beans::Property& x, const ::com::sun::star::beans::Property& y) const
+ {
+ return x.Name == y.Name ;
+ }
+ };
+
+//------------------------------------------------------------------
+/// remove the property with the given name from the given sequence
+COMPHELPER_DLLPUBLIC void RemoveProperty(staruno::Sequence<starbeans::Property>& seqProps, const OUString& _rPropName);
+
+//------------------------------------------------------------------
+/** within the given property sequence, modify attributes of a special property
+ @param _rProps the sequence of properties to search in
+ @param _sPropName the name of the property which's attributes should be modified
+ @param _nAddAttrib the attributes which should be added
+ @param _nRemoveAttrib the attributes which should be removed
+*/
+COMPHELPER_DLLPUBLIC void ModifyPropertyAttributes(staruno::Sequence<starbeans::Property>& _rProps, const OUString& _sPropName, sal_Int16 _nAddAttrib, sal_Int16 _nRemoveAttrib);
+
+//------------------------------------------------------------------
+/** check if the given set has the given property.
+*/
+COMPHELPER_DLLPUBLIC sal_Bool hasProperty(const OUString& _rName, const staruno::Reference<starbeans::XPropertySet>& _rxSet);
+
+//------------------------------------------------------------------
+/** copy properties between property sets, in compliance with the property
+ attributes of the target object
+*/
+COMPHELPER_DLLPUBLIC void copyProperties(const staruno::Reference<starbeans::XPropertySet>& _rxSource,
+ const staruno::Reference<starbeans::XPropertySet>& _rxDest);
+
+//==================================================================
+//= property conversion helpers
+//==================================================================
+
+/** helper for implementing ::cppu::OPropertySetHelper::convertFastPropertyValue
+ @param _rConvertedValue the conversion result (if successful)
+ @param _rOldValue the old value of the property, calculated from _rCurrentValue
+ @param _rValueToSet the new value which is about to be set
+ @param _rCurrentValue the current value of the property
+ @return sal_True, if the value could be converted and has changed
+ sal_False, if the value could be converted and has not changed
+ @exception InvalidArgumentException thrown if the value could not be converted to the requested type (which is the template argument)
+*/
+template <typename T>
+sal_Bool tryPropertyValue(staruno::Any& /*out*/_rConvertedValue, staruno::Any& /*out*/_rOldValue, const staruno::Any& _rValueToSet, const T& _rCurrentValue)
+{
+ sal_Bool bModified(sal_False);
+ T aNewValue = T();
+ ::cppu::convertPropertyValue(aNewValue, _rValueToSet);
+ if (aNewValue != _rCurrentValue)
+ {
+ _rConvertedValue <<= aNewValue;
+ _rOldValue <<= _rCurrentValue;
+ bModified = sal_True;
+ }
+ return bModified;
+}
+
+/** helper for implementing ::cppu::OPropertySetHelper::convertFastPropertyValue for enum values
+ @param _rConvertedValue the conversion result (if successful)
+ @param _rOldValue the old value of the property, calculated from _rCurrentValue
+ @param _rValueToSet the new value which is about to be set
+ @param _rCurrentValue the current value of the property
+ @return sal_True, if the value could be converted and has changed
+ sal_False, if the value could be converted and has not changed
+ @exception InvalidArgumentException thrown if the value could not be converted to the requested type (which is the template argument)
+*/
+template <class ENUMTYPE>
+sal_Bool tryPropertyValueEnum(staruno::Any& /*out*/_rConvertedValue, staruno::Any& /*out*/_rOldValue, const staruno::Any& _rValueToSet, const ENUMTYPE& _rCurrentValue)
+{
+ if (cppu::getTypeFavourUnsigned(&_rCurrentValue).getTypeClass()
+ != staruno::TypeClass_ENUM)
+ return tryPropertyValue(_rConvertedValue, _rOldValue, _rValueToSet, _rCurrentValue);
+
+ sal_Bool bModified(sal_False);
+ ENUMTYPE aNewValue;
+ ::cppu::any2enum(aNewValue, _rValueToSet);
+ // will throw an exception if not convertible
+
+ if (aNewValue != _rCurrentValue)
+ {
+ _rConvertedValue <<= aNewValue;
+ _rOldValue <<= _rCurrentValue;
+ bModified = sal_True;
+ }
+ return bModified;
+}
+
+/** helper for implementing ::cppu::OPropertySetHelper::convertFastPropertyValue for boolean properties
+ @param _rConvertedValue the conversion result (if successful)
+ @param _rOldValue the old value of the property, calculated from _rCurrentValue
+ @param _rValueToSet the new value which is about to be set
+ @param _rCurrentValue the current value of the property
+ @return sal_True, if the value could be converted and has changed
+ sal_False, if the value could be converted and has not changed
+ @exception InvalidArgumentException thrown if the value could not be converted to a boolean type
+*/
+inline sal_Bool tryPropertyValue(staruno::Any& /*out*/_rConvertedValue, staruno::Any& /*out*/_rOldValue, const staruno::Any& _rValueToSet, sal_Bool _bCurrentValue)
+{
+ sal_Bool bModified(sal_False);
+ sal_Bool bNewValue(sal_False);
+ ::cppu::convertPropertyValue(bNewValue, _rValueToSet);
+ if (bNewValue != _bCurrentValue)
+ {
+ _rConvertedValue.setValue(&bNewValue, ::getBooleanCppuType());
+ _rOldValue.setValue(&_bCurrentValue, ::getBooleanCppuType());
+ bModified = sal_True;
+ }
+ return bModified;
+}
+
+/** helper for implementing ::cppu::OPropertySetHelper::convertFastPropertyValue
+ @param _rConvertedValue the conversion result (if successful)
+ @param _rOldValue the old value of the property, calculated from _rCurrentValue
+ @param _rValueToSet the new value which is about to be set
+ @param _rCurrentValue the current value of the property
+ @param _rExpectedType the type which the property should have (if not void)
+ @return sal_True, if the value could be converted and has changed
+ sal_False, if the value could be converted and has not changed
+ @exception InvalidArgumentException thrown if the value could not be converted to the requested type (which is the template argument)
+*/
+COMPHELPER_DLLPUBLIC sal_Bool tryPropertyValue(staruno::Any& _rConvertedValue, staruno::Any& _rOldValue, const staruno::Any& _rValueToSet, const staruno::Any& _rCurrentValue, const staruno::Type& _rExpectedType);
+
+//.........................................................................
+}
+//... namespace comphelper .......................................................
+
+#endif // _COMPHELPER_PROPERTY_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/propertybag.hxx b/include/comphelper/propertybag.hxx
new file mode 100644
index 000000000000..92c0026ba845
--- /dev/null
+++ b/include/comphelper/propertybag.hxx
@@ -0,0 +1,227 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_PROPERTYBAG_HXX
+#define COMPHELPER_PROPERTYBAG_HXX
+
+#include "comphelper/comphelperdllapi.h"
+#include <comphelper/propertycontainerhelper.hxx>
+
+#include <memory>
+
+//........................................................................
+namespace comphelper
+{
+//........................................................................
+
+ struct PropertyBag_Impl;
+ //====================================================================
+ //= PropertyBag
+ //====================================================================
+ /** provides a bag of properties associated with their values
+
+ This class can, for instance, be used for components which need to implement
+ the com.sun.star.beans.PropertyBag service.
+ */
+ class COMPHELPER_DLLPUBLIC PropertyBag : protected OPropertyContainerHelper
+ {
+ private:
+ ::std::auto_ptr< PropertyBag_Impl > m_pImpl;
+
+ public:
+ PropertyBag();
+ virtual ~PropertyBag();
+
+ /** allow adding property with empty string as name
+ (by default, such names are rejected with IllegalActionException).
+ @param i_isAllowed
+ iff true, empty property name will be allowed
+ */
+ void setAllowEmptyPropertyName(bool i_isAllowed = true);
+
+ /** adds a property to the bag
+
+ The type of the property is determined from its initial value (<code>_rInitialValue</code>).
+
+ @param _rName
+ the name of the new property. Must not be empty unless
+ explicitly allowed with setAllowEmptyPropertyName.
+ @param _nHandle
+ the handle of the new property
+ @param _nAttributes
+ the attributes of the property
+ @param _rInitialValue
+ the initial value of the property. Must not be <NULL/>, to allow
+ determining the property type.
+
+ @throws ::com::sun::star::beans::IllegalTypeException
+ if the initial value is <NULL/>
+ @throws ::com::sun::star::beans::PropertyExistException
+ if the name or the handle are already used
+ @throws ::com::sun::star::beans::IllegalArgumentException
+ if the name is empty
+ */
+ void addProperty(
+ const OUString& _rName,
+ sal_Int32 _nHandle,
+ sal_Int32 _nAttributes,
+ const ::com::sun::star::uno::Any& _rInitialValue
+ );
+
+ /** adds a property to the bag
+
+ The initial value of the property is <NULL/>.
+
+ @param _rName
+ the name of the new property. Must not be empty unless
+ explicitly allowed with setAllowEmptyPropertyName.
+ @param _rType
+ the type of the new property
+ @param _nHandle
+ the handle of the new property
+ @param _nAttributes
+ the attributes of the property
+
+ @throws ::com::sun::star::beans::IllegalTypeException
+ if the initial value is <NULL/>
+ @throws ::com::sun::star::beans::PropertyExistException
+ if the name or the handle are already used
+ @throws ::com::sun::star::beans::IllegalArgumentException
+ if the name is empty
+ */
+ void addVoidProperty(
+ const OUString& _rName,
+ const ::com::sun::star::uno::Type& _rType,
+ sal_Int32 _nHandle,
+ sal_Int32 _nAttributes
+ );
+
+ /** removes a property from the bag
+ @param _rName
+ the name of the to-be-removed property.
+ @throws UnknownPropertyException
+ if the bag does not contain a property with the given name
+ @throws NotRemoveableException
+ if the property with the given name is not removeable, as indicated
+ by the property attributes used in a previous <code>addProperty</code>
+ call.
+ */
+ void removeProperty(
+ const OUString& _rName
+ );
+
+ /** describes all properties in the bag
+ @param _out_rProps
+ takes, upon return, the descriptions of all properties in the bag
+ */
+ inline void describeProperties(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& _out_rProps
+ ) const
+ {
+ OPropertyContainerHelper::describeProperties( _out_rProps );
+ }
+
+ /** retrieves the value of a property given by handle
+ @param _nHandle
+ the handle of the property whose value is to be retrieved
+ @param _out_rValue
+ output parameter taking the property value
+ @throws UnknownPropertyException
+ if the given handle does not denote a property in the bag
+ */
+ void getFastPropertyValue(
+ sal_Int32 _nHandle,
+ ::com::sun::star::uno::Any& _out_rValue
+ ) const;
+
+ /** converts a to-be-set value of a property (given by handle) so that it can
+ be used in subsequent calls to setFastPropertyValue
+ @param _nHandle
+ the handle of the property
+ @param _rNewValue
+ the new value, which should be converted
+ @param _out_rConvertedValue
+ output parameter taking the converted value
+ @param _out_rCurrentValue
+ output parameter taking the current value of the
+ property
+ @throws UnknownPropertyException
+ if the given handle does not denote a property in the bag
+ @throws IllegalArgumentException
+ if the given value cannot be lossless converted into a value
+ for the given property.
+ */
+ bool convertFastPropertyValue(
+ sal_Int32 _nHandle,
+ const ::com::sun::star::uno::Any& _rNewValue,
+ ::com::sun::star::uno::Any& _out_rConvertedValue,
+ ::com::sun::star::uno::Any& _out_rCurrentValue
+ ) const;
+
+ /** sets a new value for a property given by handle
+ @throws UnknownPropertyException
+ if the given handle does not denote a property in the bag
+ */
+ void setFastPropertyValue(
+ sal_Int32 _nHandle,
+ const ::com::sun::star::uno::Any& _rValue
+ );
+
+ /** returns the default value for a property given by handle
+
+ The default value of a property is its initial value, as passed
+ to ->addProperty.
+
+ @param _nHandle
+ handle of the property whose default value is to be obtained
+ @param _out_rValue
+ the default value
+ @throws UnknownPropertyException
+ if the given handle does not denote a property in the bag
+ */
+ void getPropertyDefaultByHandle(
+ sal_Int32 _nHandle,
+ ::com::sun::star::uno::Any& _out_rValue
+ ) const;
+
+ /** determines whether a property with a given name is part of the bag
+ */
+ inline bool hasPropertyByName( const OUString& _rName ) const
+ {
+ return isRegisteredProperty( _rName );
+ }
+
+ /** determines whether a property with a given handle is part of the bag
+ */
+ inline bool hasPropertyByHandle( sal_Int32 _nHandle ) const
+ {
+ return isRegisteredProperty( _nHandle );
+ }
+ protected:
+ using OPropertyContainerHelper::convertFastPropertyValue;
+ using OPropertyContainerHelper::getFastPropertyValue;
+ };
+
+//........................................................................
+} // namespace comphelper
+//........................................................................
+
+#endif // COMPHELPER_PROPERTYBAG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/propertycontainer.hxx b/include/comphelper/propertycontainer.hxx
new file mode 100644
index 000000000000..3d208413a722
--- /dev/null
+++ b/include/comphelper/propertycontainer.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_PROPERTYCONTAINER_HXX_
+#define _COMPHELPER_PROPERTYCONTAINER_HXX_
+
+#include <comphelper/propertycontainerhelper.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <com/sun/star/uno/Type.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+//==========================================================================
+//= OPropertyContainer
+//==========================================================================
+typedef ::cppu::OPropertySetHelper OPropertyContainer_Base;
+/** a OPropertySetHelper implementation which is just a simple container for properties represented
+ by class members, usually in a derived class.
+ <BR>
+ A restriction of this class is that no value conversions are made on a setPropertyValue call. Though
+ the base class supports this with the convertFastPropertyValue method, the OPropertyContainer accepts only
+ values which already have the correct type, it's unable to convert, for instance, a long to a short.
+*/
+class COMPHELPER_DLLPUBLIC OPropertyContainer
+ :public OPropertyContainer_Base
+ ,public OPropertyContainerHelper
+{
+public:
+ // this dtor is needed otherwise we can get a wrong delete operator
+ virtual ~OPropertyContainer();
+
+protected:
+ OPropertyContainer(::cppu::OBroadcastHelper& _rBHelper);
+
+ /// for scripting : the types of the interfaces supported by this class
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException);
+
+// OPropertySetHelper overridables
+ virtual sal_Bool SAL_CALL convertFastPropertyValue(
+ ::com::sun::star::uno::Any & rConvertedValue,
+ ::com::sun::star::uno::Any & rOldValue,
+ sal_Int32 nHandle,
+ const ::com::sun::star::uno::Any& rValue )
+ throw (::com::sun::star::lang::IllegalArgumentException);
+
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
+ sal_Int32 nHandle,
+ const ::com::sun::star::uno::Any& rValue
+ )
+ throw (::com::sun::star::uno::Exception);
+
+ using OPropertyContainer_Base::getFastPropertyValue;
+ virtual void SAL_CALL getFastPropertyValue(
+ ::com::sun::star::uno::Any& rValue,
+ sal_Int32 nHandle
+ ) const;
+
+ // disambiguate a base class method (XFastPropertySet)
+ virtual void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+};
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // _COMPHELPER_PROPERTYCONTAINER_HXX_
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/propertycontainerhelper.hxx b/include/comphelper/propertycontainerhelper.hxx
new file mode 100644
index 000000000000..dacefd8737a6
--- /dev/null
+++ b/include/comphelper/propertycontainerhelper.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 COMPHELPER_PROPERTYCONTAINERHELPER_HXX
+#define COMPHELPER_PROPERTYCONTAINERHELPER_HXX
+
+#include <cppuhelper/propshlp.hxx>
+#include <com/sun/star/uno/Type.hxx>
+#include <com/sun/star/beans/Property.hpp>
+#include <vector>
+#include "comphelper/comphelperdllapi.h"
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+// infos about one single property
+struct COMPHELPER_DLLPUBLIC PropertyDescription
+{
+ // the possibilities where a property holding object may be located
+ enum LocationType
+ {
+ ltDerivedClassRealType, // within the derived class, it's a "real" (non-Any) type
+ ltDerivedClassAnyType, // within the derived class, it's a <type scope="com.sun.star.uno">Any</type>
+ ltHoldMyself // within m_aHoldProperties
+ };
+ // the location of an object holding a property value :
+ union LocationAccess
+ {
+ void* pDerivedClassMember; // a pointer to a member of an object of a derived class
+ sal_Int32 nOwnClassVectorIndex; // an index within m_aHoldProperties
+ };
+
+ ::com::sun::star::beans::Property
+ aProperty;
+ LocationType eLocated; // where is the object containing the value located ?
+ LocationAccess aLocation; // access to the property value
+
+ PropertyDescription()
+ :aProperty( OUString(), -1, ::com::sun::star::uno::Type(), 0 )
+ ,eLocated( ltHoldMyself )
+ {
+ aLocation.nOwnClassVectorIndex = -1;
+ }
+};
+
+//==========================================================================
+//= OPropertyContainerHelper
+//==========================================================================
+/** helper class for managing property values, and implementing most of the X*Property* interfaces
+
+ The property values are usually held in derived classes, but can also be given to the
+ responsibility of this class here.
+
+ For more information, see http://wiki.services.openoffice.org/wiki/Development/Cpp/Helper/PropertyContainerHelper.
+*/
+class COMPHELPER_DLLPUBLIC OPropertyContainerHelper
+{
+ typedef ::std::vector< ::com::sun::star::uno::Any > PropertyContainer;
+ typedef PropertyContainer::iterator PropertyContainerIterator;
+ typedef PropertyContainer::const_iterator ConstPropertyContainerIterator;
+ PropertyContainer m_aHoldProperties;
+ // the properties which are hold by this class' instance, not the derived one's
+
+private:
+ typedef ::std::vector< PropertyDescription > Properties;
+ typedef Properties::iterator PropertiesIterator;
+ typedef Properties::const_iterator ConstPropertiesIterator;
+ Properties m_aProperties;
+
+ sal_Bool m_bUnused;
+
+protected:
+ OPropertyContainerHelper();
+ ~OPropertyContainerHelper();
+
+ /** register a property. The property is represented through a member of the derived class which calls
+ this methdod.
+ @param _rName the name of the property
+ @param _nHandle the handle of the property
+ @param _nAttributes the attributes of the property
+ @param _pPointerToMember the pointer to the member representing the property
+ within the derived class.
+ @param _rMemberType the cppu type of the property represented by the object
+ to which _pPointerToMember points.
+ */
+ void registerProperty(const OUString& _rName, sal_Int32 _nHandle, sal_Int32 _nAttributes,
+ void* _pPointerToMember, const ::com::sun::star::uno::Type& _rMemberType);
+
+
+ /** register a property. The property is represented through a ::com::sun::star::uno::Any member of the
+ derived class which calls this methdod.
+ @param _rName the name of the property
+ @param _nHandle the handle of the property
+ @param _nAttributes the attributes of the property
+ @param _pPointerToMember the pointer to the member representing the property
+ within the derived class, which has to be a ::com::sun::star::uno::Any.
+ @param _rExpectedType the expected type of the property. NOT the type of the object to which
+ _pPointerToMember points (this is always an Any).
+ */
+ void registerMayBeVoidProperty(const OUString& _rName, sal_Int32 _nHandle, sal_Int32 _nAttributes,
+ ::com::sun::star::uno::Any* _pPointerToMember, const ::com::sun::star::uno::Type& _rExpectedType);
+
+ /** register a property. The repository will create an own object holding this property, so there is no
+ need to declare an extra member in your derived class
+ @param _rName the name of the property
+ @param _nHandle the handle of the property
+ @param _nAttributes the attributes of the property
+ @param _rType the type of the property
+ @param _pInitialValue the initial value of the property. May be null if _nAttributes includes
+ the ::com::sun::star::beans::PropertyAttribute::MAYBEVOID flag.
+ Else it must be a pointer to an object of the type described by _rType.
+ */
+ void registerPropertyNoMember(const OUString& _rName, sal_Int32 _nHandle, sal_Int32 _nAttributes,
+ const ::com::sun::star::uno::Type& _rType, const void* _pInitialValue);
+
+ /** revokes a previously registered property
+ @throw com::sun::star::beans::UnknownPropertyException
+ if no property with the given handle is registered
+ */
+ void revokeProperty( sal_Int32 _nHandle );
+
+
+ /// checkes whether a property with the given handle has been registered
+ sal_Bool isRegisteredProperty( sal_Int32 _nHandle ) const;
+
+ /// checkes whether a property with the given name has been registered
+ sal_Bool isRegisteredProperty( const OUString& _rName ) const;
+
+
+ // helper for implementing OPropertySetHelper overridables
+ sal_Bool convertFastPropertyValue(
+ ::com::sun::star::uno::Any & rConvertedValue,
+ ::com::sun::star::uno::Any & rOldValue,
+ sal_Int32 nHandle,
+ const ::com::sun::star::uno::Any& rValue
+ )
+ SAL_THROW((::com::sun::star::lang::IllegalArgumentException));
+
+ void setFastPropertyValue(
+ sal_Int32 nHandle,
+ const ::com::sun::star::uno::Any& rValue
+ )
+ SAL_THROW((::com::sun::star::uno::Exception));
+
+ void getFastPropertyValue(
+ ::com::sun::star::uno::Any& rValue,
+ sal_Int32 nHandle
+ ) const;
+
+// helper
+ /** appends the descriptions of all properties which were registered 'til that moment to the given sequence,
+ keeping the array sorted (by name)
+ @precond
+ the given sequence is already sorted by name
+ @param _rProps
+ initial property sequence which is to be extended
+ */
+ void describeProperties(::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps) const;
+
+ /** retrieves the description for a registered property
+ @throw com::sun::star::beans::UnknownPropertyException
+ if no property with the given name is registered
+ */
+ const ::com::sun::star::beans::Property&
+ getProperty( const OUString& _rName ) const;
+
+private:
+ /// insertion of _rProp into m_aProperties, keeping the sort order
+ COMPHELPER_DLLPRIVATE void implPushBackProperty(const PropertyDescription& _rProp);
+
+ /// search the PropertyDescription for the given handle (within m_aProperties)
+ COMPHELPER_DLLPRIVATE PropertiesIterator searchHandle(sal_Int32 _nHandle);
+
+private:
+ COMPHELPER_DLLPRIVATE OPropertyContainerHelper( const OPropertyContainerHelper& ); // never implemented
+ COMPHELPER_DLLPRIVATE OPropertyContainerHelper& operator=( const OPropertyContainerHelper& ); // never implemented
+};
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // COMPHELPER_PROPERTYCONTAINERHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/propertysethelper.hxx b/include/comphelper/propertysethelper.hxx
new file mode 100644
index 000000000000..ecc600c37d3c
--- /dev/null
+++ b/include/comphelper/propertysethelper.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 _COMPHELPER_PROPERTYSETHELPER_HXX_
+#define _COMPHELPER_PROPERTYSETHELPER_HXX_
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+//=========================================================================
+//= property helper classes
+//=========================================================================
+
+//... namespace comphelper ................................................
+namespace comphelper
+{
+//.........................................................................
+
+class PropertySetInfo;
+struct PropertyMapEntry;
+class PropertySetHelperImpl;
+
+class COMPHELPER_DLLPUBLIC PropertySetHelper : public ::com::sun::star::beans::XPropertySet,
+ public ::com::sun::star::beans::XPropertyState,
+ public ::com::sun::star::beans::XMultiPropertySet
+{
+private:
+ PropertySetHelperImpl* mp;
+
+protected:
+ virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const ::com::sun::star::uno::Any* pValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ) = 0;
+ virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ) = 0;
+
+ virtual void _getPropertyStates( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::beans::PropertyState* pStates ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException );
+ virtual void _setPropertyToDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Any _getPropertyDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
+
+public:
+ PropertySetHelper( comphelper::PropertySetInfo* pInfo ) throw();
+ PropertySetHelper( comphelper::PropertySetInfo* pInfo, __sal_NoAcquire ) throw();
+ virtual ~PropertySetHelper() throw();
+
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XMultiPropertySet
+// virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPropertyState
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+};
+
+//.........................................................................
+}
+//... namespace comphelper..................................................
+
+#endif // _UTL_PROPERTYSETHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/propertysetinfo.hxx b/include/comphelper/propertysetinfo.hxx
new file mode 100644
index 000000000000..e0b863e8f2ca
--- /dev/null
+++ b/include/comphelper/propertysetinfo.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 _COMPHELPER_PROPERTSETINFO_HXX_
+#define _COMPHELPER_PROPERTSETINFO_HXX_
+
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/stl_types.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+//=========================================================================
+//= property helper classes
+//=========================================================================
+
+//... namespace comphelper .......................................................
+namespace comphelper
+{
+//.........................................................................
+
+struct PropertyMapEntry
+{
+ const sal_Char* mpName;
+ sal_uInt16 mnNameLen;
+ sal_Int32 mnHandle;
+ const com::sun::star::uno::Type* mpType;
+ sal_Int16 mnAttributes;
+ sal_uInt8 mnMemberId;
+};
+
+DECLARE_STL_USTRINGACCESS_MAP( PropertyMapEntry*, PropertyMap );
+
+class PropertyMapImpl;
+
+/** this class implements a XPropertySetInfo that is initialized with arrays of PropertyMapEntry.
+ It is used by the class PropertySetHelper.
+*/
+class COMPHELPER_DLLPUBLIC PropertySetInfo : public ::cppu::WeakImplHelper1< ::com::sun::star::beans::XPropertySetInfo >
+{
+private:
+ PropertyMapImpl* mpMap;
+public:
+ PropertySetInfo() throw();
+ PropertySetInfo( PropertyMapEntry* pMap ) throw();
+ virtual ~PropertySetInfo() throw();
+
+ /** returns a stl map with all PropertyMapEntry pointer.<p>
+ The key is the property name.
+ */
+ const PropertyMap* getPropertyMap() const throw();
+
+ /** adds an array of PropertyMapEntry to this instance.<p>
+ The end is marked with a PropertyMapEntry where mpName equals NULL</p>
+ */
+ void add( PropertyMapEntry* pMap ) throw();
+
+ /** removes an already added PropertyMapEntry which string in mpName equals to aName */
+ void remove( const OUString& aName ) throw();
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::beans::Property SAL_CALL getPropertyByName( const OUString& aName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+//.........................................................................
+}
+//... namespace comphelper .......................................................
+
+#endif // _UTL_PROPERTSETINFO_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/propertystatecontainer.hxx b/include/comphelper/propertystatecontainer.hxx
new file mode 100644
index 000000000000..acd368646628
--- /dev/null
+++ b/include/comphelper/propertystatecontainer.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 COMPHELPER_PROPERTYSTATECONTAINER_HXX
+#define COMPHELPER_PROPERTYSTATECONTAINER_HXX
+
+#include <comphelper/propertycontainer.hxx>
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/uno3.hxx>
+#include <osl/diagnose.h>
+#include "comphelper/comphelperdllapi.h"
+
+#include <map>
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OPropertyStateContainer
+ //=====================================================================
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::beans::XPropertyState
+ > OPropertyStateContainer_TBase;
+
+ /** helper implementation for components which have properties with a default
+
+ <p>This class is not intended for direct use, you need to derive from it.</p>
+
+ @see com.sun.star.beans.XPropertyState
+ */
+ class COMPHELPER_DLLPUBLIC OPropertyStateContainer
+ :public OPropertyContainer
+ ,public OPropertyStateContainer_TBase
+ {
+ protected:
+ /** ctor
+ @param _rBHelper
+ help to be used for broadcasting events
+ */
+ OPropertyStateContainer( ::cppu::OBroadcastHelper& _rBHelper );
+
+ // ................................................................
+ // XPropertyState
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // ................................................................
+ // own overridables
+ // these are the impl-methods for the XPropertyState members - they are implemented already by this class,
+ // but you may want to override them for whatever reasons (for instance, if your derived class
+ // supports the AMBIGUOUS state for properties)
+
+ /** get the PropertyState of the property denoted by the given handle
+
+ <p>Already implemented by this base class, no need to override</p>
+ @precond <arg>_nHandle</arg> is a valid property handle
+ */
+ virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle( sal_Int32 _nHandle );
+
+ /** set the property denoted by the given handle to it's default value
+
+ <p>Already implemented by this base class, no need to override</p>
+ @precond <arg>_nHandle</arg> is a valid property handle
+ */
+ virtual void setPropertyToDefaultByHandle( sal_Int32 _nHandle );
+
+ /** get the default value for the property denoted by the given handle
+
+ @precond
+ <arg>_nHandle</arg> is a valid property handle
+ */
+ virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, ::com::sun::star::uno::Any& _rDefault ) const = 0;
+
+ protected:
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException);
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER( )
+
+ protected:
+ /** returns the handle for the given name
+
+ @throw UnknownPropertyException if the given name is not a registered property
+ */
+ sal_Int32 getHandleForName( const OUString& _rPropertyName ) SAL_THROW( ( ::com::sun::star::beans::UnknownPropertyException ) );
+ };
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // COMPHELPER_PROPERTYSTATECONTAINER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/propmultiplex.hxx b/include/comphelper/propmultiplex.hxx
new file mode 100644
index 000000000000..28795e57ce8a
--- /dev/null
+++ b/include/comphelper/propmultiplex.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 _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
+#define _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
+
+#include <comphelper/propstate.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+//=========================================================================
+//= property helper classes
+//=========================================================================
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ class OPropertyChangeMultiplexer;
+
+ //==================================================================
+ //= OPropertyChangeListener
+ //==================================================================
+ /// simple listener adapter for property sets
+ class COMPHELPER_DLLPUBLIC OPropertyChangeListener
+ {
+ friend class OPropertyChangeMultiplexer;
+
+ OPropertyChangeMultiplexer* m_pAdapter;
+ ::osl::Mutex& m_rMutex;
+
+ public:
+ OPropertyChangeListener(::osl::Mutex& _rMutex)
+ : m_pAdapter(NULL), m_rMutex(_rMutex) { }
+ virtual ~OPropertyChangeListener();
+
+ virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException) = 0;
+ virtual void _disposing(const ::com::sun::star::lang::EventObject& _rSource) throw( ::com::sun::star::uno::RuntimeException);
+
+ protected:
+ /** If the derivee also owns the mutex which we know as reference, then call this within your
+ derivee's dtor.
+ */
+ void disposeAdapter();
+
+ // pseudo-private. Making it private now could break compatibility
+ void setAdapter( OPropertyChangeMultiplexer* _pAdapter );
+ };
+
+ //==================================================================
+ //= OPropertyChangeMultiplexer
+ //==================================================================
+ /// multiplexer for property changes
+ class COMPHELPER_DLLPUBLIC OPropertyChangeMultiplexer :public cppu::WeakImplHelper1< ::com::sun::star::beans::XPropertyChangeListener>
+ {
+ friend class OPropertyChangeListener;
+ ::com::sun::star::uno::Sequence< OUString > m_aProperties;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xSet;
+ OPropertyChangeListener* m_pListener;
+ sal_Int32 m_nLockCount;
+ sal_Bool m_bListening : 1;
+ sal_Bool m_bAutoSetRelease : 1;
+
+
+ virtual ~OPropertyChangeMultiplexer();
+ public:
+ OPropertyChangeMultiplexer(OPropertyChangeListener* _pListener, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxSet, sal_Bool _bAutoReleaseSet = sal_True);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException);
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw( ::com::sun::star::uno::RuntimeException);
+
+ /// incremental lock
+ void lock();
+ /// incremental unlock
+ void unlock();
+ /// get the lock count
+ sal_Int32 locked() const { return m_nLockCount; }
+
+ void addProperty(const OUString& aPropertyName);
+ void dispose();
+ };
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/propstate.hxx b/include/comphelper/propstate.hxx
new file mode 100644
index 000000000000..727f40d96824
--- /dev/null
+++ b/include/comphelper/propstate.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 _COMPHELPER_PROPERTY_STATE_HXX_
+#define _COMPHELPER_PROPERTY_STATE_HXX_
+
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+
+#include <cppuhelper/propshlp.hxx>
+#include <cppuhelper/proptypehlp.hxx>
+#include <cppuhelper/weak.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+//=========================================================================
+//= property helper classes
+//=========================================================================
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ //==================================================================
+ //= OPropertyStateHelper
+ //==================================================================
+ /// helper class for implementing property states
+ class COMPHELPER_DLLPUBLIC OPropertyStateHelper :public ::cppu::OPropertySetHelper2
+ ,public ::com::sun::star::beans::XPropertyState
+ {
+ public:
+ OPropertyStateHelper(::cppu::OBroadcastHelper& rBHlp):OPropertySetHelper2(rBHlp) { }
+ OPropertyStateHelper(::cppu::OBroadcastHelper& rBHlp,
+ ::cppu::IEventNotificationHook *i_pFireEvents);
+
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& aType) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPropertyState
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL
+ getPropertyState(const OUString& PropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState> SAL_CALL
+ getPropertyStates(const ::com::sun::star::uno::Sequence< OUString >& aPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL
+ setPropertyToDefault(const OUString& PropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL
+ getPropertyDefault(const OUString& aPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // access via handle
+ virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle);
+ virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle);
+ virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const;
+
+ protected:
+ virtual ~OPropertyStateHelper();
+
+ void firePropertyChange(sal_Int32 nHandle, const ::com::sun::star::uno::Any& aNewValue, const ::com::sun::star::uno::Any& aOldValue);
+
+ protected:
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ };
+
+ //==================================================================
+ //= OPropertyStateHelper
+ //==================================================================
+ class COMPHELPER_DLLPUBLIC OStatefulPropertySet :public ::cppu::OWeakObject
+ ,public ::com::sun::star::lang::XTypeProvider
+ ,public OMutexAndBroadcastHelper // order matters: before OPropertyStateHelper/OPropertySetHelper
+ ,public OPropertyStateHelper
+ {
+ protected:
+ OStatefulPropertySet();
+ virtual ~OStatefulPropertySet();
+
+ protected:
+ DECLARE_XINTERFACE()
+ DECLARE_XTYPEPROVIDER()
+ };
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // _COMPHELPER_PROPERTY_STATE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/proxyaggregation.hxx b/include/comphelper/proxyaggregation.hxx
new file mode 100644
index 000000000000..2c01a7a3587f
--- /dev/null
+++ b/include/comphelper/proxyaggregation.hxx
@@ -0,0 +1,221 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_PROXY_AGGREGATION
+#define COMPHELPER_PROXY_AGGREGATION
+
+#include <com/sun/star/uno/XAggregation.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <cppuhelper/compbase_ex.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+/* class hierarchy herein:
+
+ +-------------------+ helper class for aggregating the proxy to another object
+ | OProxyAggregation | - not ref counted
+ +-------------------+ - no UNO implementation, i.e. not derived from XInterface
+ ^ (neither direct nor indirect)
+ |
+ |
+ +----------------------------------+ helper class for aggregating a proxy to an XComponent
+ | OComponentProxyAggregationHelper | - life time coupling: if the inner component (the "aggregate")
+ +----------------------------------+ is disposed, the outer (the delegator) is disposed, too, and
+ ^ vice versa
+ | - UNO based, implementing XEventListener
+ |
+ +----------------------------+ component aggregating another XComponent
+ | OComponentProxyAggregation | - life time coupling as above
+ +----------------------------+ - ref-counted
+ - implements an XComponent itself
+
+ If you need to
+
+ - wrap a foreign object which is a XComponent
+ => use OComponentProxyAggregation
+ - call componentAggregateProxyFor in your ctor
+ - call implEnsureDisposeInDtor in your dtor
+
+ - wrap a foreign object which is a XComponent, but already have ref-counting mechanisms
+ inherited from somewhere else
+ => use OComponentProxyAggregationHelper
+ - override dispose - don't forget to call the base class' dispose!
+ - call componentAggregateProxyFor in your ctor
+
+ - wrap a foreign object which is no XComponent
+ => use OProxyAggregation
+ - call baseAggregateProxyFor in your ctor
+*/
+
+//.............................................................................
+namespace comphelper
+{
+//.............................................................................
+
+ //=========================================================================
+ //= OProxyAggregation
+ //=========================================================================
+ /** helper class for aggregating a proxy for a foreign object
+ */
+ class OProxyAggregation
+ {
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > m_xProxyAggregate;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider > m_xProxyTypeAccess;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+
+ protected:
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& getComponentContext()
+ {
+ return m_xContext;
+ }
+
+ protected:
+ OProxyAggregation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext );
+ ~OProxyAggregation();
+
+ /// to be called from within your ctor
+ void baseAggregateProxyFor(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent,
+ oslInterlockedCount& _rRefCount,
+ ::cppu::OWeakObject& _rDelegator
+ );
+
+ // XInterface and XTypeProvider
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ OProxyAggregation( ); // never implemented
+ OProxyAggregation( const OProxyAggregation& ); // never implemented
+ OProxyAggregation& operator=( const OProxyAggregation& ); // never implemented
+ };
+
+ //=========================================================================
+ //= OComponentProxyAggregationHelper
+ //=========================================================================
+ /** a helper class for aggregating a proxy to an XComponent
+
+ <p>The object couples the life time of itself and the component: if one of the both
+ dies (in a sense of being disposed), the other one dies, too.</p>
+
+ <p>The class itself does not implement XComponent so you need to forward any XComponent::dispose
+ calls which your derived class gets to the dispose method of this class.</p>
+ */
+
+ class COMPHELPER_DLLPUBLIC OComponentProxyAggregationHelper :public ::cppu::ImplHelper1 < com::sun::star::lang::XEventListener
+ >
+ ,private OProxyAggregation
+ {
+ private:
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::lang::XEventListener
+ > BASE; // prevents some MSVC problems
+
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
+ m_xInner;
+ ::cppu::OBroadcastHelper& m_rBHelper;
+
+ protected:
+ // OProxyAggregation
+ using OProxyAggregation::getComponentContext;
+
+ // XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER( )
+
+ protected:
+ OComponentProxyAggregationHelper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ ::cppu::OBroadcastHelper& _rBHelper
+ );
+ virtual ~OComponentProxyAggregationHelper( );
+
+ /// to be called from within your ctor
+ void componentAggregateProxyFor(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxComponent,
+ oslInterlockedCount& _rRefCount,
+ ::cppu::OWeakObject& _rDelegator
+ );
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
+
+ private:
+ COMPHELPER_DLLPRIVATE OComponentProxyAggregationHelper( ); // never implemented
+ COMPHELPER_DLLPRIVATE OComponentProxyAggregationHelper( const OComponentProxyAggregationHelper& ); // never implemented
+ COMPHELPER_DLLPRIVATE OComponentProxyAggregationHelper& operator=( const OComponentProxyAggregationHelper& ); // never implemented
+ };
+
+ //=========================================================================
+ //= OComponentProxyAggregation
+ //=========================================================================
+ class COMPHELPER_DLLPUBLIC OComponentProxyAggregation :public OBaseMutex
+ ,public cppu::WeakComponentImplHelperBase
+ ,public OComponentProxyAggregationHelper
+ {
+ protected:
+ OComponentProxyAggregation(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxComponent
+ );
+
+ virtual ~OComponentProxyAggregation();
+
+ // XInterface
+ DECLARE_XINTERFACE()
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER()
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing() throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& _rSource ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent/OComponentProxyAggregationHelper
+ virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
+
+ protected:
+ // be called from within the dtor of derived classes
+ void implEnsureDisposeInDtor( );
+
+ private:
+ COMPHELPER_DLLPRIVATE OComponentProxyAggregation( ); // never implemented
+ COMPHELPER_DLLPRIVATE OComponentProxyAggregation( const OComponentProxyAggregation& ); // never implemented
+ COMPHELPER_DLLPRIVATE OComponentProxyAggregation& operator=( const OComponentProxyAggregation& ); // never implemented
+ };
+
+//.............................................................................
+} // namespace comphelper
+//.............................................................................
+
+
+#endif // COMPHELPER_PROXY_AGGREGATION
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/scoped_disposing_ptr.hxx b/include/comphelper/scoped_disposing_ptr.hxx
new file mode 100644
index 000000000000..dabf9f473e92
--- /dev/null
+++ b/include/comphelper/scoped_disposing_ptr.hxx
@@ -0,0 +1,160 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 _SCOPED_DISPOSING_PTR
+#define _SCOPED_DISPOSING_PTR
+
+#include <cppuhelper/implbase1.hxx>
+#include <boost/utility.hpp>
+#include <boost/scoped_ptr.hpp>
+
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/frame/XDesktop.hpp>
+
+// for locking SolarMutex: svapp + mutex
+#include <vcl/svapp.hxx>
+#include <osl/mutex.hxx>
+
+namespace comphelper
+{
+//Similar to boost::scoped_ptr, except additionally releases the ptr on XComponent::disposing and/or XTerminateListener::notifyTermination if supported
+template<class T> class scoped_disposing_ptr : private boost::noncopyable
+{
+private:
+ boost::scoped_ptr<T> m_aItem;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTerminateListener> m_xTerminateListener;
+public:
+ scoped_disposing_ptr( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > &rComponent, T * p = 0 )
+ : m_aItem(p)
+ {
+ m_xTerminateListener = new TerminateListener(rComponent, *this);
+ }
+
+ virtual void reset(T * p = 0)
+ {
+ m_aItem.reset(p);
+ }
+
+ T & operator*() const
+ {
+ return *m_aItem;
+ }
+
+ T * get() const
+ {
+ return m_aItem.get();
+ }
+
+ T * operator->() const
+ {
+ return m_aItem.get();
+ }
+
+ operator bool () const
+ {
+ return static_cast< bool >(m_aItem);
+ }
+
+ virtual ~scoped_disposing_ptr()
+ {
+ reset();
+ }
+private:
+ class TerminateListener : public ::cppu::WeakImplHelper1< ::com::sun::star::frame::XTerminateListener >
+ {
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xComponent;
+ scoped_disposing_ptr<T>& m_rItem;
+ public:
+ TerminateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > &rComponent,
+ scoped_disposing_ptr<T>& rItem) : m_xComponent(rComponent), m_rItem(rItem)
+ {
+ if (m_xComponent.is())
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDesktop> xDesktop(m_xComponent, ::com::sun::star::uno::UNO_QUERY);
+ if (xDesktop.is())
+ xDesktop->addTerminateListener(this);
+ else
+ m_xComponent->addEventListener(this);
+ }
+ }
+
+ ~TerminateListener()
+ {
+ if ( m_xComponent.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDesktop> xDesktop(m_xComponent, ::com::sun::star::uno::UNO_QUERY);
+ if (xDesktop.is())
+ xDesktop->removeTerminateListener(this);
+ else
+ m_xComponent->removeEventListener(this);
+ }
+ }
+
+ private:
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& rEvt )
+ throw (::com::sun::star::uno::RuntimeException)
+ {
+ bool shutDown = (rEvt.Source == m_xComponent);
+
+ if (shutDown && m_xComponent.is())
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDesktop> xDesktop(m_xComponent, ::com::sun::star::uno::UNO_QUERY);
+ if (xDesktop.is())
+ xDesktop->removeTerminateListener(this);
+ else
+ m_xComponent->removeEventListener(this);
+ m_xComponent.clear();
+ }
+
+ if (shutDown)
+ m_rItem.reset();
+ }
+
+ // XTerminateListener
+ virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& )
+ throw(::com::sun::star::frame::TerminationVetoException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ }
+
+ virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& rEvt )
+ throw (::com::sun::star::uno::RuntimeException)
+ {
+ disposing(rEvt);
+ }
+ };
+};
+
+//Something like an OutputDevice requires the SolarMutex to be taken before use
+//for threadsafety. The user can ensure this, except in the case of its dtor
+//being called from reset due to a terminate on the XComponent being called
+//from an aribitrary thread
+template<class T> class scoped_disposing_solar_mutex_reset_ptr
+ : public scoped_disposing_ptr<T>
+{
+public:
+ scoped_disposing_solar_mutex_reset_ptr( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > &rComponent, T * p = 0 )
+ : scoped_disposing_ptr<T>(rComponent, p)
+ {
+ }
+
+ virtual void reset(T * p = 0)
+ {
+ SolarMutexGuard aGuard;
+ scoped_disposing_ptr<T>::reset(p);
+ }
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/scopeguard.hxx b/include/comphelper/scopeguard.hxx
new file mode 100644
index 000000000000..5bc2aafaa781
--- /dev/null
+++ b/include/comphelper/scopeguard.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_COMPHELPER_SCOPEGUARD_HXX
+#define INCLUDED_COMPHELPER_SCOPEGUARD_HXX
+
+#include "comphelper/comphelperdllapi.h"
+#include "boost/function.hpp"
+#include "boost/noncopyable.hpp"
+#include "boost/bind.hpp"
+
+namespace comphelper {
+
+/** ScopeGuard to ease writing exception-safe code.
+ */
+class COMPHELPER_DLLPUBLIC ScopeGuard : private ::boost::noncopyable
+ // noncopyable until we have
+ // good reasons...
+{
+public:
+ enum exc_handling { IGNORE_EXCEPTIONS, ALLOW_EXCEPTIONS };
+
+ /** @param func function object to be executed in dtor
+ @param excHandling switches whether thrown exceptions in dtor will be
+ silently ignored (but OSL_ asserted)
+ */
+ template <typename func_type>
+ explicit ScopeGuard( func_type const & func,
+ exc_handling excHandling = IGNORE_EXCEPTIONS )
+ : m_func( func ), m_excHandling( excHandling ) {}
+
+ ~ScopeGuard();
+
+ /** Dismisses the scope guard, i.e. the function won't
+ be executed.
+ */
+ void dismiss();
+
+private:
+ ::boost::function0<void> m_func; // preferring portable syntax
+ exc_handling const m_excHandling;
+};
+
+} // namespace comphelper
+
+#endif // ! defined(INCLUDED_COMPHELPER_SCOPEGUARD_HXX)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/seekableinput.hxx b/include/comphelper/seekableinput.hxx
new file mode 100644
index 000000000000..02c4997a2cb6
--- /dev/null
+++ b/include/comphelper/seekableinput.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 _COMPHELPER_STREAM_SEEKABLEINPUT_HXX_
+#define _COMPHELPER_STREAM_SEEKABLEINPUT_HXX_
+
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+namespace comphelper
+{
+
+class COMPHELPER_DLLPUBLIC OSeekableInputWrapper : public ::cppu::WeakImplHelper2< ::com::sun::star::io::XInputStream,
+ ::com::sun::star::io::XSeekable >
+{
+ ::osl::Mutex m_aMutex;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xOriginalStream;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xCopyInput;
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable > m_xCopySeek;
+
+private:
+ COMPHELPER_DLLPRIVATE void PrepareCopy_Impl();
+
+public:
+ OSeekableInputWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+
+ virtual ~OSeekableInputWrapper();
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > CheckSeekableCanWrap(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+
+// XInputStream
+ virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL available() throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL closeInput() throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+// XSeekable
+ virtual void SAL_CALL seek( sal_Int64 location ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int64 SAL_CALL getPosition() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int64 SAL_CALL getLength() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+};
+
+} // namespace comphelper
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/seqstream.hxx b/include/comphelper/seqstream.hxx
new file mode 100644
index 000000000000..4f9c9380bfa1
--- /dev/null
+++ b/include/comphelper/seqstream.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 _COMPHELPER_SEQSTREAM_HXX
+#define _COMPHELPER_SEQSTREAM_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <osl/mutex.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+namespace comphelper
+{
+
+ typedef ::com::sun::star::uno::Sequence<sal_Int8> ByteSequence;
+
+//==================================================================
+// SequenceInputStream
+// stream for reading data from a sequence of bytes
+//==================================================================
+
+
+class COMPHELPER_DLLPUBLIC SequenceInputStream
+: public ::cppu::WeakImplHelper2< ::com::sun::star::io::XInputStream, ::com::sun::star::io::XSeekable >
+{
+ ::osl::Mutex m_aMutex;
+ ByteSequence m_aData;
+ sal_Int32 m_nPos;
+
+public:
+ SequenceInputStream(const ByteSequence& rData);
+
+// com::sun::star::io::XInputStream
+ virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence<sal_Int8>& aData, sal_Int32 nBytesToRead )
+ throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException,
+ ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence<sal_Int8>& aData, sal_Int32 nMaxBytesToRead )
+ throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException,
+ ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip )
+ throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException,
+ ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL available( )
+ throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL closeInput( )
+ throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL seek( sal_Int64 location ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int64 SAL_CALL getPosition( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int64 SAL_CALL getLength( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ inline sal_Int32 avail();
+};
+typedef ::cppu::WeakImplHelper1< ::com::sun::star::io::XOutputStream > OSequenceOutputStream_Base;
+
+class OSequenceOutputStream : public OSequenceOutputStream_Base
+{
+protected:
+ ::com::sun::star::uno::Sequence< sal_Int8 >& m_rSequence;
+ double m_nResizeFactor;
+ sal_Int32 m_nMinimumResize;
+ sal_Int32 m_nMaximumResize;
+ sal_Int32 m_nSize;
+ // the size of the virtual stream. This is not the size of the sequence, but the number of bytes written
+ // into the stream at a given moment.
+
+ sal_Bool m_bConnected;
+ // closeOutput has been called ?
+
+ ::osl::Mutex m_aMutex;
+
+protected:
+ ~OSequenceOutputStream() { if (m_bConnected) closeOutput(); }
+
+public:
+ /** constructs the object. Everything written into the stream through the XOutputStream methods will be forwarded
+ to the sequence, reallocating it if neccessary. Writing will start at offset 0 within the sequence.
+ @param _rSeq a reference to the sequence which will be used for output.
+ The caller is responsible for taking care of the lifetime of the stream
+ object and the sequence. If you're in doubt about this, use <code>closeOutput</code>
+ before destroying the sequence
+ @param _nResizeFactor the factor which is used for resizing the sequence when neccessary. In every
+ resize step, the new sequence size will be calculated by multiplying the current
+ size with this factor, rounded off to the next multiple of 4.
+ @param _nMinimumResize the minmal number of bytes which is additionally allocated on resizing
+ @param _nMaximumResize as the growth of the stream size is exponential, you may want to specify a
+ maxmimum amount of memory which the sequence will grow by. If -1 is used,
+ no limit is applied
+ @see closeOutput
+ */
+ OSequenceOutputStream(
+ ::com::sun::star::uno::Sequence< sal_Int8 >& _rSeq,
+ double _nResizeFactor = 1.3,
+ sal_Int32 _nMinimumResize = 128,
+ sal_Int32 _nMaximumResize = -1
+ );
+
+ /// same as XOutputStream::writeBytes (as expected :)
+ virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ /// this is a dummy in this implementation, no buffering is used
+ virtual void SAL_CALL flush( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ /** closes the output stream. In the case of this class, this means that the sequence used for writing is
+ resized to the really used size and not used any further, every subsequent call to one of the XOutputStream
+ methods will throw a <code>NotConnectedException</code>.
+ */
+ virtual void SAL_CALL closeOutput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+};
+
+} // namespace comphelper
+
+#endif //_COMPHELPER_SEQSTREAM_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
new file mode 100644
index 000000000000..ad1e8943b952
--- /dev/null
+++ b/include/comphelper/sequence.hxx
@@ -0,0 +1,369 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#define _COMPHELPER_SEQUENCE_HXX_
+
+#include <algorithm> // copy algorithm
+#include <com/sun/star/uno/Sequence.hxx>
+#include <osl/diagnose.h>
+#include "comphelper/comphelperdllapi.h"
+
+#include <vector>
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ namespace staruno = ::com::sun::star::uno;
+
+ //-------------------------------------------------------------------------
+ /** search the given string within the given sequence, return the positions where it was found.
+ if _bOnlyFirst is sal_True, only the first occurrence will be returned.
+ */
+ COMPHELPER_DLLPUBLIC staruno::Sequence<sal_Int16> findValue(const staruno::Sequence< OUString >& _rList, const OUString& _rValue, sal_Bool _bOnlyFirst = sal_False);
+
+ /** Checks if the name exists
+ *
+ * \param Value The value to search for.
+ * \param _aList The list in which to search for the value.
+ * \return <TRUE/> if the value can be found, otherwise <FALSE/>.
+ */
+ COMPHELPER_DLLPUBLIC sal_Bool existsValue(const OUString& Value,const ::com::sun::star::uno::Sequence< OUString >& _aList);
+
+
+ //-------------------------------------------------------------------------
+ namespace internal
+ {
+ template <class T>
+ void implCopySequence(const T* _pSource, T*& _pDest, sal_Int32 _nSourceLen)
+ {
+ for (sal_Int32 i=0; i<_nSourceLen; ++i, ++_pSource, ++_pDest)
+ *_pDest = *_pSource;
+ }
+ }
+ //-------------------------------------------------------------------------
+ /// concat two sequences
+ template <class T>
+ staruno::Sequence<T> concatSequences(const staruno::Sequence<T>& _rLeft, const staruno::Sequence<T>& _rRight)
+ {
+ sal_Int32 nLeft(_rLeft.getLength()), nRight(_rRight.getLength());
+ const T* pLeft = _rLeft.getConstArray();
+ const T* pRight = _rRight.getConstArray();
+
+ sal_Int32 nReturnLen(nLeft + nRight);
+ staruno::Sequence<T> aReturn(nReturnLen);
+ T* pReturn = aReturn.getArray();
+
+ internal::implCopySequence(pLeft, pReturn, nLeft);
+ internal::implCopySequence(pRight, pReturn, nRight);
+
+ return aReturn;
+ }
+
+ //-------------------------------------------------------------------------
+ /// concat three sequences
+ template <class T>
+ staruno::Sequence<T> concatSequences(const staruno::Sequence<T>& _rLeft, const staruno::Sequence<T>& _rMiddle, const staruno::Sequence<T>& _rRight)
+ {
+ sal_Int32 nLeft(_rLeft.getLength()), nMiddle(_rMiddle.getLength()), nRight(_rRight.getLength());
+ const T* pLeft = _rLeft.getConstArray();
+ const T* pMiddle = _rMiddle.getConstArray();
+ const T* pRight = _rRight.getConstArray();
+
+ sal_Int32 nReturnLen(nLeft + nMiddle + nRight);
+ staruno::Sequence<T> aReturn(nReturnLen);
+ T* pReturn = aReturn.getArray();
+
+ internal::implCopySequence(pLeft, pReturn, nLeft);
+ internal::implCopySequence(pMiddle, pReturn, nMiddle);
+ internal::implCopySequence(pRight, pReturn, nRight);
+
+ return aReturn;
+ }
+
+ //-------------------------------------------------------------------------
+ /// remove a specified element from a sequences
+ template<class T>
+ void removeElementAt(staruno::Sequence<T>& _rSeq, sal_Int32 _nPos)
+ {
+ sal_uInt32 nLength = _rSeq.getLength();
+
+ OSL_ENSURE(0 <= _nPos && (sal_uInt32)_nPos < nLength, "invalid index");
+
+ for (sal_uInt32 i = (sal_uInt32)_nPos + 1; i < nLength; ++i)
+ {
+ _rSeq[i-1] = _rSeq[i];
+ }
+
+ _rSeq.realloc(nLength-1);
+ }
+
+ //=====================================================================
+ //= iterating through sequences
+ //=====================================================================
+ /** a helper class for iterating through a sequence
+ */
+ template <class TYPE>
+ class OSequenceIterator
+ {
+ const TYPE* m_pElements;
+ sal_Int32 m_nLen;
+ const TYPE* m_pCurrent;
+
+ public:
+ /** contrcuct a sequence iterator from a sequence
+ */
+ OSequenceIterator(const ::com::sun::star::uno::Sequence< TYPE >& _rSeq);
+ /** contrcuct a sequence iterator from a Any containing a sequence
+ */
+ OSequenceIterator(const ::com::sun::star::uno::Any& _rSequenceAny);
+
+ sal_Bool hasMoreElements() const;
+ ::com::sun::star::uno::Any nextElement();
+
+ private:
+ void construct(const ::com::sun::star::uno::Sequence< TYPE >& _rSeq);
+ };
+
+ //---------------------------------------------------------------------
+ template <class TYPE>
+ OSequenceIterator<TYPE>::OSequenceIterator(const ::com::sun::star::uno::Sequence< TYPE >& _rSeq)
+ :m_pElements(NULL)
+ ,m_nLen(0)
+ ,m_pCurrent(NULL)
+ {
+ construct(_rSeq);
+ }
+
+ //---------------------------------------------------------------------
+ template <class TYPE>
+ OSequenceIterator<TYPE>::OSequenceIterator(const ::com::sun::star::uno::Any& _rSequenceAny)
+ :m_pElements(NULL)
+ ,m_nLen(0)
+ ,m_pCurrent(NULL)
+ {
+ ::com::sun::star::uno::Sequence< TYPE > aContainer;
+ sal_Bool bSuccess = _rSequenceAny >>= aContainer;
+ OSL_ENSURE(bSuccess, "OSequenceIterator::OSequenceIterator: invalid Any!");
+ (void)bSuccess;
+ construct(aContainer);
+ }
+
+ //---------------------------------------------------------------------
+ template <class TYPE>
+ void OSequenceIterator<TYPE>::construct(const ::com::sun::star::uno::Sequence< TYPE >& _rSeq)
+ {
+ m_pElements = _rSeq.getConstArray();
+ m_nLen = _rSeq.getLength();
+ m_pCurrent = m_pElements;
+ }
+
+ //---------------------------------------------------------------------
+ template <class TYPE>
+ sal_Bool OSequenceIterator<TYPE>::hasMoreElements() const
+ {
+ return m_pCurrent - m_pElements < m_nLen;
+ }
+
+ //---------------------------------------------------------------------
+ template <class TYPE>
+ ::com::sun::star::uno::Any OSequenceIterator<TYPE>::nextElement()
+ {
+ return ::com::sun::star::uno::makeAny(*m_pCurrent++);
+ }
+
+ //-------------------------------------------------------------------------
+ /** Copy from a plain C/C++ array into a Sequence.
+
+ @tpl SrcType
+ Array element type. Must be assignable to DstType
+
+ @tpl DstType
+ Sequence element type. Must be assignable from SrcType
+
+ @param i_pArray
+ Valid pointer to at least num elements of type SrcType
+
+ @param nNum
+ Number of array elements to copy
+
+ @return the resulting Sequence
+
+ @attention when copying from e.g. a double array to a
+ Sequence<int>, no proper rounding will be performed, but the
+ values will be truncated. There's currently no measure to
+ prevent or detect precision loss, overflow or truncation.
+ */
+ template < typename DstType, typename SrcType >
+ ::com::sun::star::uno::Sequence< DstType > arrayToSequence( const SrcType* i_pArray, sal_Int32 nNum )
+ {
+ ::com::sun::star::uno::Sequence< DstType > result( nNum );
+ ::std::copy( i_pArray, i_pArray+nNum, result.getArray() );
+ return result;
+ }
+
+ //-------------------------------------------------------------------------
+ /** Copy from a Sequence into a plain C/C++ array
+
+ @tpl SrcType
+ Sequence element type. Must be assignable to DstType
+
+ @tpl DstType
+ Array element type. Must be assignable from SrcType
+
+ @param io_pArray
+ Valid pointer to at least i_Sequence.getLength() elements of
+ type DstType
+
+ @param i_Sequence
+ Reference to a Sequence of SrcType elements
+
+ @return a pointer to the array
+
+ @attention when copying from e.g. a Sequence<double> to an int
+ array, no proper rounding will be performed, but the values
+ will be truncated. There's currently no measure to prevent or
+ detect precision loss, overflow or truncation.
+ */
+ template < typename DstType, typename SrcType >
+ DstType* sequenceToArray( DstType* io_pArray, const ::com::sun::star::uno::Sequence< SrcType >& i_Sequence )
+ {
+ ::std::copy( i_Sequence.getConstArray(), i_Sequence.getConstArray()+i_Sequence.getLength(), io_pArray );
+ return io_pArray;
+ }
+
+ //-------------------------------------------------------------------------
+ /** Copy from a container into a Sequence
+
+ @tpl SrcType
+ Container type. This type must fulfill the STL container
+ concept, in particular, the size(), begin() and end() methods
+ must be available and have the usual semantics.
+
+ @tpl DstType
+ Sequence element type. Must be assignable from SrcType's
+ elements
+
+ @param i_Container
+ Reference to the input contain with elements of type SrcType
+
+ @return the generated Sequence
+
+ @attention this function always performs a copy. Furthermore,
+ when copying from e.g. a vector<double> to a Sequence<int>, no
+ proper rounding will be performed, but the values will be
+ truncated. There's currently no measure to prevent or detect
+ precision loss, overflow or truncation.
+ */
+ template < typename DstType, typename SrcType >
+ ::com::sun::star::uno::Sequence< DstType > containerToSequence( const SrcType& i_Container )
+ {
+ ::com::sun::star::uno::Sequence< DstType > result( i_Container.size() );
+ ::std::copy( i_Container.begin(), i_Container.end(), result.getArray() );
+ return result;
+ }
+
+ template <typename T>
+ inline ::com::sun::star::uno::Sequence<T> containerToSequence(
+ ::std::vector<T> const& v )
+ {
+ return ::com::sun::star::uno::Sequence<T>(
+ v.empty() ? 0 : &v[0], static_cast<sal_Int32>(v.size()) );
+ }
+
+ //-------------------------------------------------------------------------
+ /** Copy from a Sequence into a container
+
+ @tpl SrcType
+ Sequence element type. Must be assignable to SrcType's
+ elements
+
+ @tpl DstType
+ Container type. This type must fulfill the STL container and
+ sequence concepts, in particular, the begin(), end() and the
+ unary constructor DstType(int) methods must be available and
+ have the usual semantics.
+
+ @param i_Sequence
+ Reference to a Sequence of SrcType elements
+
+ @return the generated container
+
+ @attention this function always performs a copy. Furthermore,
+ when copying from e.g. a Sequence<double> to a vector<int>, no
+ proper rounding will be performed, but the values will be
+ truncated. There's currently no measure to prevent or detect
+ precision loss, overflow or truncation.
+ */
+ template < typename DstType, typename SrcType >
+ DstType sequenceToContainer( const ::com::sun::star::uno::Sequence< SrcType >& i_Sequence )
+ {
+ DstType result( i_Sequence.getLength() );
+ ::std::copy( i_Sequence.getConstArray(), i_Sequence.getConstArray()+i_Sequence.getLength(), result.begin() );
+ return result;
+ }
+ //-------------------------------------------------------------------------
+ /** Copy from a Sequence into an existing container
+
+ This potentially saves a needless extra copy operation over
+ the whole container, as it passes the target object by
+ reference.
+
+ @tpl SrcType
+ Sequence element type. Must be assignable to SrcType's
+ elements
+
+ @tpl DstType
+ Container type. This type must fulfill the STL container and
+ sequence concepts, in particular, the begin(), end() and
+ resize(int) methods must be available and have the usual
+ semantics.
+
+ @param o_Output
+ Reference to the target container
+
+ @param i_Sequence
+ Reference to a Sequence of SrcType elements
+
+ @return a non-const reference to the given container
+
+ @attention this function always performs a copy. Furthermore,
+ when copying from e.g. a Sequence<double> to a vector<int>, no
+ proper rounding will be performed, but the values will be
+ truncated. There's currently no measure to prevent or detect
+ precision loss, overflow or truncation.
+ */
+ template < typename DstType, typename SrcType >
+ DstType& sequenceToContainer( DstType& o_Output, const ::com::sun::star::uno::Sequence< SrcType >& i_Sequence )
+ {
+ o_Output.resize( i_Sequence.getLength() );
+ ::std::copy( i_Sequence.getConstArray(), i_Sequence.getConstArray()+i_Sequence.getLength(), o_Output.begin() );
+ return o_Output;
+ }
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+
+#endif // _COMPHELPER_SEQUENCE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/sequenceashashmap.hxx b/include/comphelper/sequenceashashmap.hxx
new file mode 100644
index 000000000000..0c8353776931
--- /dev/null
+++ b/include/comphelper/sequenceashashmap.hxx
@@ -0,0 +1,313 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_SEQUENCEASHASHMAP_HXX_
+#define _COMPHELPER_SEQUENCEASHASHMAP_HXX_
+
+#include <boost/unordered_map.hpp>
+
+#include <algorithm>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+
+#include <com/sun/star/beans/IllegalTypeException.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+
+namespace comphelper{
+
+
+/** @short Implements a stl hash map on top of some
+ specialized sequence from type PropertyValue
+ or NamedValue.
+
+ @descr That provides the possibility to modify
+ such name sequences very easy ...
+ */
+
+struct SequenceAsHashMapBase : public ::boost::unordered_map<
+ OUString ,
+ ::com::sun::star::uno::Any ,
+ OUStringHash ,
+ ::std::equal_to< OUString > >
+{
+};
+
+class COMPHELPER_DLLPUBLIC SequenceAsHashMap : public SequenceAsHashMapBase
+{
+ //-------------------------------------------
+ public:
+
+ //---------------------------------------
+ /** @short creates an empty hash map.
+ */
+ SequenceAsHashMap();
+
+ //---------------------------------------
+ /** @see operator<<(const ::com::sun::star::uno::Any&)
+ */
+ SequenceAsHashMap(const ::com::sun::star::uno::Any& aSource);
+
+ //---------------------------------------
+ /** @see operator<<(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >&)
+ */
+ SequenceAsHashMap(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& lSource);
+
+ //---------------------------------------
+ /** @see operator<<(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >&)
+ */
+ SequenceAsHashMap(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lSource);
+
+ //---------------------------------------
+ /** @see operator<<(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >&)
+ */
+ SequenceAsHashMap(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& lSource);
+
+ //---------------------------------------
+ /** @short not realy used but maybe useful :-)
+ */
+ ~SequenceAsHashMap();
+
+ //---------------------------------------
+ /** @short fill this map from the given
+ any, which of course must contain
+ a suitable sequence of element types
+ "css.beans.PropertyValue" or "css.beans.NamedValue".
+
+ @attention If the given Any is an empty one
+ (if its set to VOID), no exception
+ is thrown. In such case this instance will
+ be created as an empty one too!
+
+ @param aSource
+ contains the new items for this map.
+
+ @throw An <type scope="com::sun::star::beans">IllegalTypeException</type>
+ is thrown, if the given any does not contain a suitable sequence ...
+ but not if its a VOID Any!
+ */
+ void operator<<(const ::com::sun::star::uno::Any& aSource);
+
+ //---------------------------------------
+ /** @short fill this map from the given
+ sequence, where every Any must contain
+ an item from type "css.beans.PropertyValue"
+ "css.beans.NamedValue".
+
+ @param lSource
+ contains the new items for this map.
+
+ @throw An <type scope="com::sun::star::beans">IllegalTypeException</type>
+ is thrown, if the given any sequence
+ uses wrong types for its items. VOID Any will be ignored!
+ */
+ void operator<<(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& lSource);
+
+ //---------------------------------------
+ /** @short fill this map from the given
+ PropertyValue sequence.
+
+ @param lSource
+ contains the new items for this map.
+ */
+ void operator<<(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lSource);
+
+ //---------------------------------------
+ /** @short fill this map from the given
+ NamedValue sequence.
+
+ @param lSource
+ contains the new items for this map.
+ */
+ void operator<<(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& lSource);
+
+ //---------------------------------------
+ /** @short converts this map instance to an
+ PropertyValue sequence.
+
+ @param lDestination
+ target sequence for converting.
+ */
+ void operator>>(::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lDestination) const;
+
+ //---------------------------------------
+ /** @short converts this map instance to an
+ NamedValue sequence.
+
+ @param lDestination
+ target sequence for converting.
+ */
+ void operator>>(::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& lDestination) const;
+
+ //---------------------------------------
+ /** @short return this map instance as an
+ Any, which can be
+ used in const environments only.
+
+ @descr Its made const to prevent using of the
+ return value directly as an in/out parameter!
+ usage: myMethod(stlDequeAdapter.getAsAnyList());
+
+ @param bAsPropertyValue
+ switch between using of PropertyValue or NamedValue as
+ value type.
+
+ @return A const Any, which
+ contains all items of this map.
+ */
+ const ::com::sun::star::uno::Any getAsConstAny(::sal_Bool bAsPropertyValue) const;
+
+ //---------------------------------------
+ /** @short return this map instance to as a
+ NamedValue sequence, which can be
+ used in const environments only.
+
+ @descr Its made const to prevent using of the
+ return value directly as an in/out parameter!
+ usage: myMethod(stlDequeAdapter.getAsNamedValueList());
+
+ @return A const sequence of type NamedValue, which
+ contains all items of this map.
+ */
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > getAsConstNamedValueList() const;
+
+ //---------------------------------------
+ /** @short return this map instance to as a
+ PropertyValue sequence, which can be
+ used in const environments only.
+
+ @descr Its made const to prevent using of the
+ return value directly as an in/out parameter!
+ usage: myMethod(stlDequeAdapter.getAsPropertyValueList());
+
+ @return A const sequence of type PropertyValue, which
+ contains all items of this map.
+ */
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > getAsConstPropertyValueList() const;
+
+ //---------------------------------------
+ /** @short check if the specified item exists
+ and return its (unpacked!) value or it returns the
+ specified default value otherwise.
+
+ @descr If a value should be extracted only in case
+ the requsted property exists realy (without creating
+ of new items as it the index operator of a
+ has_map does!) this method can be used.
+
+ @param sKey
+ key name of the item.
+
+ @param aDefault
+ the default value, which is returned
+ if the specified item could not
+ be found.
+
+ @return The (unpacked!) value of the specified property or
+ the given default value otherwise.
+
+ @attention "unpacked" means the Any content of every iterator->second!
+ */
+ template< class TValueType >
+ TValueType getUnpackedValueOrDefault(const OUString& sKey ,
+ const TValueType& aDefault) const
+ {
+ const_iterator pIt = find(sKey);
+ if (pIt == end())
+ return aDefault;
+
+ TValueType aValue = TValueType();
+ if (!(pIt->second >>= aValue))
+ return aDefault;
+
+ return aValue;
+ }
+
+ //---------------------------------------
+ /** @short creates a new item with the specified
+ name and value only in case such item name
+ does not already exist.
+
+ @descr To check if the property already exists only
+ her name is used for compare. Its value isnt
+ checked!
+
+ @param sKey
+ key name of the property.
+
+ @param aValue
+ the new (unpacked!) value.
+ Note: This value will be transformed to an Any
+ internaly, because only Any values can be
+ part of a PropertyValue or NamedValue structure.
+
+ @return TRUE if this property was added as new item;
+ FALSE if it already exists.
+ */
+ template< class TValueType >
+ sal_Bool createItemIfMissing(const OUString& sKey ,
+ const TValueType& aValue)
+ {
+ if (find(sKey) == end())
+ {
+ (*this)[sKey] = ::com::sun::star::uno::makeAny(aValue);
+ return sal_True;
+ }
+
+ return sal_False;
+ }
+
+ //---------------------------------------
+ /** @short check if all items of given map
+ exists in these called map also.
+
+ @descr Every item of the given map must exists
+ with same name and value inside these map.
+ But these map can contain additional items
+ which are not part of the search-map.
+
+ @param rCheck
+ the map containing all items for checking.
+
+ @return
+ TRUE if all items of Rcheck could be found
+ in these map; FALSE otherwise.
+ */
+ sal_Bool match(const SequenceAsHashMap& rCheck) const;
+
+ //---------------------------------------
+ /** @short merge all values from the given map into
+ this one.
+
+ @descr Existing items will be overwritten ...
+ missing items will be created new ...
+ but non specified items will stay alive !
+
+ @param rSource
+ the map containing all items for the update.
+ */
+ void update(const SequenceAsHashMap& rSource);
+};
+
+} // namespace comphelper
+
+#endif // _COMPHELPER_SEQUENCEASHASHMAP_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/sequenceasvector.hxx b/include/comphelper/sequenceasvector.hxx
new file mode 100644
index 000000000000..305eba9245ff
--- /dev/null
+++ b/include/comphelper/sequenceasvector.hxx
@@ -0,0 +1,247 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_SEQUENCEASVECTOR_HXX_
+#define _COMPHELPER_SEQUENCEASVECTOR_HXX_
+
+#include <vector>
+#include <algorithm>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <com/sun/star/beans/IllegalTypeException.hpp>
+
+
+namespace comphelper{
+
+
+/** @short Implements a stl vector on top of any
+ uno sequence.
+
+ @descr That provides the possibility to modify
+ sequences very easy ...
+ Of course this can be useful only, if
+ count of modifications is high, so copying
+ of the sequence make sense!
+ */
+template< class TElementType >
+class SequenceAsVector : public ::std::vector< TElementType >
+{
+ //-------------------------------------------
+ // types
+
+ public:
+
+ //---------------------------------------
+ /** @short When inheriting from a template using typename is generally required when using
+ types from the base! */
+ typedef typename ::std::vector< TElementType >::const_iterator const_iterator;
+
+ //---------------------------------------
+ /** @short When inheriting from a template using typename is generally required when using
+ types from the base! */
+ typedef typename ::std::vector< TElementType >::iterator iterator;
+
+ //-------------------------------------------
+ // interface
+ public:
+
+ //---------------------------------------
+ /** @short default ctor, to create an empty list.
+ */
+ SequenceAsVector()
+ {}
+
+ //---------------------------------------
+ /** @short default dtor
+ */
+ ~SequenceAsVector()
+ {}
+
+ //---------------------------------------
+ /** @short creates a new vector with the given length.
+
+ @param nLength
+ the number of elements for the new vector.
+ */
+ explicit SequenceAsVector(sal_Int32 nLength) :
+ ::std::vector< TElementType >( static_cast< size_t >( nLength ) )
+ {
+ }
+
+ //---------------------------------------
+ /** @short creates a new deque from the given uno sequence.
+
+ @param lSource
+ contains the new items for this deque.
+ */
+ SequenceAsVector(const ::com::sun::star::uno::Sequence< TElementType >& lSource)
+ {
+ (*this) << lSource;
+ }
+
+ //---------------------------------------
+ /** @short creates a new instance from the given Any, which
+ of course must contain a valid sequence using the
+ right element type for every item.
+
+ @attention If the given Any is an empty one
+ (if its set to VOID), no exception
+ is thrown. In such case this instance will
+ be created as an empty one too!
+
+ @param aSource
+ this any must contain a suitable sequence. :-)
+
+ @throw A <type scope="com::sun::star::beans">IllegalTypeException</type>
+ if an unsupported element inside this Any
+ is given. An empty Any reset this instance!
+ */
+ SequenceAsVector(const ::com::sun::star::uno::Any& aSource)
+ {
+ (*this) << aSource;
+ }
+
+ //---------------------------------------
+ /** @short fill this instance from the given uno sequence.
+
+ @param lSource
+ contains the new items for this deque.
+ */
+ void operator<<(const ::com::sun::star::uno::Sequence< TElementType >& lSource)
+ {
+ this->clear();
+
+ sal_Int32 c = lSource.getLength();
+ const TElementType* pSource = lSource.getConstArray();
+
+ for (sal_Int32 i=0; i<c; ++i)
+ this->push_back(pSource[i]);
+ }
+
+ //---------------------------------------
+ /** @short fill this instance from the given Any, which
+ of course must contain a valid sequence using the
+ right element type for every item.
+
+ @attention If the given Any is an empty one
+ (if its set to VOID), no exception
+ is thrown. In such case this instance will
+ be created as an empty one too!
+
+ @param aSource
+ this any must contain a suitable sequence. :-)
+
+ @throw A <type scope="com::sun::star::beans">IllegalTypeException</type>
+ if an unsupported element inside this Any
+ is given. An empty Any reset this instance!
+ */
+ void operator<<(const ::com::sun::star::uno::Any& aSource)
+ {
+ // An empty Any reset this instance!
+ if (!aSource.hasValue())
+ {
+ this->clear();
+ return;
+ }
+
+ ::com::sun::star::uno::Sequence< TElementType > lSource;
+ if (!(aSource >>= lSource))
+ throw ::com::sun::star::beans::IllegalTypeException(
+ OUString("SequenceAsVector operator<<(Any) was called with an unsupported Any type."),
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >());
+
+ (*this) << lSource;
+ }
+
+ //---------------------------------------
+ /** @short converts this instance to an uno sequence.
+
+ @param lDestination
+ target sequence for converting.
+ */
+ void operator>>(::com::sun::star::uno::Sequence< TElementType >& lDestination) const
+ {
+ sal_Int32 c = (sal_Int32)this->size();
+ lDestination.realloc(c);
+ TElementType* pDestination = lDestination.getArray();
+
+ sal_Int32 i = 0;
+ for (typename std::vector<TElementType>::const_iterator pThis = this->begin();
+ pThis != this->end() ;
+ ++pThis )
+ {
+ pDestination[i] = *pThis;
+ ++i;
+ }
+ }
+
+ //---------------------------------------
+ /** @short converts this instance to an uno any
+ which contains a suitable sequence
+ of items of this stl struct.
+
+ @param aDestination
+ target any for converting.
+ */
+ void operator>>(::com::sun::star::uno::Any& aDestination) const
+ {
+ sal_Int32 c = (sal_Int32)this->size();
+ ::com::sun::star::uno::Sequence< TElementType > lDestination(c);
+ TElementType* pDestination = lDestination.getArray();
+
+ sal_Int32 i = 0;
+ for (typename std::vector<TElementType>::const_iterator pThis = this->begin();
+ pThis != this->end() ;
+ ++pThis )
+ {
+ pDestination[i] = *pThis;
+ ++i;
+ }
+
+ aDestination <<= lDestination;
+ }
+
+ //---------------------------------------
+ /** @short converts this deque to a suitable uno
+ sequence which contains all items.
+
+ @attention It return a const sequence to prevent
+ the outside code against using of this
+ return value as [in/]out parameter for
+ direct function calls!
+ Of course it can be casted to non const
+ ... but then its a problem of the outside
+ code :-)
+
+ @return A (const!) sequence, which contains all items of
+ this deque.
+ */
+ const ::com::sun::star::uno::Sequence< TElementType > getAsConstList() const
+ {
+ ::com::sun::star::uno::Sequence< TElementType > lDestination;
+ (*this) >> lDestination;
+ return lDestination;
+ }
+};
+
+} // namespace comphelper
+
+#endif // _COMPHELPER_SEQUENCEASVECTOR_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/servicedecl.hxx b/include/comphelper/servicedecl.hxx
new file mode 100644
index 000000000000..be3b275cf215
--- /dev/null
+++ b/include/comphelper/servicedecl.hxx
@@ -0,0 +1,409 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef COMPHELPER_SERVICEDECL_HXX_INCLUDED
+#define COMPHELPER_SERVICEDECL_HXX_INCLUDED
+
+#include <comphelper/comphelperdllapi.h>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <uno/environment.h>
+#include <boost/utility.hpp>
+#include <boost/function.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/repetition.hpp>
+#include <boost/preprocessor/seq/enum.hpp>
+
+namespace comphelper {
+namespace service_decl {
+
+class ServiceDecl;
+
+namespace detail {
+typedef ::boost::function3<
+ css::uno::Reference<css::uno::XInterface> /* return */,
+ ServiceDecl const&,
+ css::uno::Sequence<css::uno::Any> const&,
+ css::uno::Reference<css::uno::XComponentContext> const&> CreateFuncF;
+}
+
+/** Class to declare a service implementation. There is no need to implement
+ lang::XServiceInfo nor lang::XInitialization anymore.
+ The declaration can be done in various ways, the (simplest) form is
+
+ <pre>
+ class MyClass : public cppu::WeakImplHelper2<XInterface1, XInterface2> {
+ public:
+ MyClass( uno::Reference<uno::XComponentContext> const& xContext )
+ [...]
+ };
+ [...]
+ namespace sdecl = comphelper::service_decl;
+ sdecl::ServiceDecl const myDecl(
+ sdecl::class_<MyClass>(),
+ "my.unique.implementation.name",
+ "MyServiceSpec1;MyServiceSpec2" );
+ </pre>
+
+ If the service demands initialization by arguments, the implementation
+ class has to define a constructor taking both arguments and component
+ context:
+
+ <pre>
+ class MyClass : public cppu::WeakImplHelper2<XInterface1, XInterface2> {
+ public:
+ MyClass( uno::Sequence<uno::Any> const& args,
+ uno::Reference<uno:XComponentContext> const& xContext )
+ [...]
+ };
+ [...]
+ namespace sdecl = comphelper::service_decl;
+ sdecl::ServiceDecl const myDecl(
+ sdecl::class_<MyClass, sdecl::with_args<true> >(),
+ "my.unique.implementation.name",
+ "MyServiceSpec1;MyServiceSpec2" );
+ </pre>
+
+ Additionally, there is the possibility to process some code after creation,
+ e.g. to add the newly created object as a listener or perform aggregation
+ (C++-UNO only):
+
+ <pre>
+ uno::Reference<uno::XInterface> somePostProcCode( MyClass * p );
+ [...]
+ namespace sdecl = comphelper::service_decl;
+ sdecl::ServiceDecl const myDecl(
+ sdecl::class_<MyClass, ... >(&somePostProcCode),
+ "my.unique.implementation.name",
+ "MyServiceSpec1;MyServiceSpec2" );
+ </pre>
+
+ In the latter case, somePostProcCode gets the yet unacquired "raw" pointer.
+*/
+class COMPHELPER_DLLPUBLIC ServiceDecl : private ::boost::noncopyable
+{
+public:
+ /** Ctor for multiple supported service names.
+
+ @param implClass implementation class description
+ @param pImplName implementation name
+ @param pSupportedServiceNames supported service names
+ @param cDelim delimiter for supported service names
+ */
+ template <typename ImplClassT>
+ ServiceDecl( ImplClassT const& implClass,
+ char const* pImplName,
+ char const* pSupportedServiceNames, char cDelim = ';' )
+ : m_createFunc(implClass.m_createFunc),
+ m_pImplName(pImplName),
+ m_pServiceNames(pSupportedServiceNames),
+ m_cDelim(cDelim) {}
+
+ /// @internal gets called by component_getFactoryHelper()
+ void * getFactory( sal_Char const* pImplName ) const;
+
+ /// @return supported service names
+ ::com::sun::star::uno::Sequence< OUString>
+ getSupportedServiceNames() const;
+
+ /// @return whether name is in set of supported service names
+ bool supportsService( OUString const& name ) const;
+
+ /// @return implementation name
+ OUString getImplementationName() const;
+
+private:
+ class Factory;
+ friend class Factory;
+
+ detail::CreateFuncF const m_createFunc;
+ char const* const m_pImplName;
+ char const* const m_pServiceNames;
+ char const m_cDelim;
+};
+
+/** To specify whether the implementation class expects arguments
+ (uno::Sequence<uno::Any>).
+*/
+template <bool> struct with_args;
+
+/// @internal
+namespace detail {
+template <typename ImplT>
+class OwnServiceImpl
+ : public ImplT,
+ private ::boost::noncopyable
+{
+ typedef ImplT BaseT;
+
+public:
+ OwnServiceImpl(
+ ServiceDecl const& rServiceDecl,
+ css::uno::Sequence<css::uno::Any> const& args,
+ css::uno::Reference<css::uno::XComponentContext> const& xContext )
+ :BaseT(args, xContext), m_rServiceDecl(rServiceDecl) {}
+ OwnServiceImpl(
+ ServiceDecl const& rServiceDecl,
+ css::uno::Reference<css::uno::XComponentContext> const& xContext )
+ : BaseT(xContext), m_rServiceDecl(rServiceDecl) {}
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException) {
+ return m_rServiceDecl.getImplementationName();
+ }
+ virtual sal_Bool SAL_CALL supportsService( OUString const& name )
+ throw (css::uno::RuntimeException) {
+ return m_rServiceDecl.supportsService(name);
+ }
+ virtual css::uno::Sequence< OUString>
+ SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException) {
+ return m_rServiceDecl.getSupportedServiceNames();
+ }
+
+private:
+ ServiceDecl const& m_rServiceDecl;
+};
+
+template <typename ImplT>
+class ServiceImpl : public OwnServiceImpl< ::cppu::ImplInheritanceHelper1<ImplT,css::lang::XServiceInfo> >
+{
+typedef OwnServiceImpl< ::cppu::ImplInheritanceHelper1<ImplT,css::lang::XServiceInfo> > ServiceImpl_BASE;
+public:
+ ServiceImpl(
+ ServiceDecl const& rServiceDecl,
+ css::uno::Sequence<css::uno::Any> const& args,
+ css::uno::Reference<css::uno::XComponentContext> const& xContext )
+ : ServiceImpl_BASE(rServiceDecl, args, xContext) {}
+ ServiceImpl(
+ ServiceDecl const& rServiceDecl,
+ css::uno::Reference<css::uno::XComponentContext> const& xContext )
+ : ServiceImpl_BASE(rServiceDecl, xContext) {}
+};
+
+template <typename ServiceImplT>
+struct PostProcessDefault {
+ css::uno::Reference<css::uno::XInterface>
+ operator()( ServiceImplT * p ) const {
+ return static_cast<css::lang::XServiceInfo *>(p);
+ }
+};
+
+template <typename ImplT, typename PostProcessFuncT, typename WithArgsT>
+struct CreateFunc;
+
+template <typename ImplT, typename PostProcessFuncT>
+struct CreateFunc<ImplT, PostProcessFuncT, with_args<false> > {
+ PostProcessFuncT const m_postProcessFunc;
+ explicit CreateFunc( PostProcessFuncT const& postProcessFunc )
+ : m_postProcessFunc(postProcessFunc) {}
+
+ css::uno::Reference<css::uno::XInterface>
+ operator()( ServiceDecl const& rServiceDecl,
+ css::uno::Sequence<css::uno::Any> const&,
+ css::uno::Reference<css::uno::XComponentContext>
+ const& xContext ) const
+ {
+ return m_postProcessFunc(
+ new ImplT( rServiceDecl, xContext ) );
+ }
+};
+
+template <typename ImplT, typename PostProcessFuncT>
+struct CreateFunc<ImplT, PostProcessFuncT, with_args<true> > {
+ PostProcessFuncT const m_postProcessFunc;
+ explicit CreateFunc( PostProcessFuncT const& postProcessFunc )
+ : m_postProcessFunc(postProcessFunc) {}
+
+ css::uno::Reference<css::uno::XInterface>
+ operator()( ServiceDecl const& rServiceDecl,
+ css::uno::Sequence<css::uno::Any> const& args,
+ css::uno::Reference<css::uno::XComponentContext>
+ const& xContext ) const
+ {
+ return m_postProcessFunc(
+ new ImplT( rServiceDecl, args, xContext ) );
+ }
+};
+
+} // namespace detail
+
+/** Defines a service implementation class.
+
+ @tpl ImplT_ service implementation class
+ @WithArgsT whether the implementation class ctor expects arguments
+ (uno::Sequence<uno::Any>, uno::Reference<uno::XComponentContext>)
+ or just (uno::Reference<uno::XComponentContext>)
+*/
+template <typename ImplT_, typename WithArgsT = with_args<false> >
+struct serviceimpl_base {
+ typedef ImplT_ ImplT;
+
+ detail::CreateFuncF const m_createFunc;
+
+ typedef detail::PostProcessDefault<ImplT> PostProcessDefaultT;
+
+ /** Default ctor. Implementation class without args, expecting
+ component context as single argument.
+ */
+ serviceimpl_base() : m_createFunc(
+ detail::CreateFunc<ImplT, PostProcessDefaultT, WithArgsT>(
+ PostProcessDefaultT() ) ) {}
+
+ /** Ctor to pass a post processing function/functor.
+
+ @tpl PostProcessDefaultT let your compiler deduce this
+ @param postProcessFunc function/functor that gets the yet unacquired
+ ImplT_ pointer returning a
+ uno::Reference<uno::XInterface>
+ */
+ template <typename PostProcessFuncT>
+ explicit serviceimpl_base( PostProcessFuncT const& postProcessFunc )
+ : m_createFunc( detail::CreateFunc<ImplT, PostProcessFuncT, WithArgsT>(
+ postProcessFunc ) ) {}
+};
+
+template <typename ImplT_, typename WithArgsT = with_args<false> >
+struct class_ : public serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT >
+{
+ typedef serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT > baseT;
+ /** Default ctor. Implementation class without args, expecting
+ component context as single argument.
+ */
+ class_() : baseT() {}
+ template <typename PostProcessFuncT>
+ /** Ctor to pass a post processing function/functor.
+
+ @tpl PostProcessDefaultT let your compiler deduce this
+ @param postProcessFunc function/functor that gets the yet unacquired
+ ImplT_ pointer returning a
+ uno::Reference<uno::XInterface>
+ */
+ explicit class_( PostProcessFuncT const& postProcessFunc ) : baseT( postProcessFunc ) {}
+};
+
+//
+// component_... helpers with arbitrary service declarations:
+//
+
+#define COMPHELPER_SERVICEDECL_getFactory(z_, n_, unused_) \
+ if (pRet == 0) \
+ pRet = BOOST_PP_CAT(s, n_).getFactory(pImplName);
+
+/** The following preprocessor repetitions generate functions like
+
+ <pre>
+ inline void * component_getFactoryHelper(
+ sal_Char const* pImplName,
+ ::com::sun::star::lang::XMultiServiceFactory *,
+ ::com::sun::star::registry::XRegistryKey * xRegistryKey,
+ ServiceDecl const& s0, ServiceDecl const& s1, ... );
+ </pre>
+
+ which call on the passed service declarations.
+
+ The maximum number of service declarations can be set by defining
+ COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS; its default is 8.
+*/
+#define COMPHELPER_SERVICEDECL_make(z_, n_, unused_) \
+inline void * component_getFactoryHelper( \
+ sal_Char const* pImplName, \
+ ::com::sun::star::lang::XMultiServiceFactory *, \
+ ::com::sun::star::registry::XRegistryKey *, \
+ BOOST_PP_ENUM_PARAMS(n_, ServiceDecl const& s) ) \
+{ \
+ void * pRet = 0; \
+ BOOST_PP_REPEAT(n_, COMPHELPER_SERVICEDECL_getFactory, ~) \
+ return pRet; \
+}
+
+#ifndef COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS
+#define COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS 8
+#endif
+
+BOOST_PP_REPEAT_FROM_TO(1, COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS,
+ COMPHELPER_SERVICEDECL_make, ~)
+
+#undef COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS
+#undef COMPHELPER_SERVICEDECL_make
+#undef COMPHELPER_SERVICEDECL_getFactory
+
+} // namespace service_decl
+} // namespace comphelper
+
+/** The following preprocessor macro generates the C access functions,
+ that are used to initialize and register the components of a
+ shared library object.
+
+ If you have, say, written a lib that contains three distinct
+ components, each with its own ServiceDecl object, you might want
+ to employ the following code:
+
+ <pre>
+ // must reside outside _any_ namespace
+ COMPHELPER_SERVICEDECL_EXPORTS3(yourServiceDecl1,
+ yourServiceDecl2,
+ yourServiceDecl3);
+ </pre>
+
+ For your convenience, the COMPHELPER_SERVICEDECL_EXPORTS<N> macro
+ comes pre-defined up to N=8, if you should need more arguments,
+ call COMPHELPER_SERVICEDECL_make_exports directly, like this:
+
+ <pre>
+ // must reside outside _any_ namespace
+ COMPHELPER_SERVICEDECL_make_exports((yourServiceDecl1)(yourServiceDecl2)...(yourServiceDeclN));
+ </pre>
+
+ Note the missing colons between the bracketed arguments.
+ */
+#define COMPHELPER_SERVICEDECL_make_exports(compName, varargs_ ) \
+extern "C" \
+{ \
+ SAL_DLLPUBLIC_EXPORT void* SAL_CALL compName##_component_getFactory( sal_Char const* pImplName, \
+ ::com::sun::star::lang::XMultiServiceFactory* pServiceManager, \
+ ::com::sun::star::registry::XRegistryKey* pRegistryKey ) \
+ { \
+ return component_getFactoryHelper( pImplName, pServiceManager, \
+ pRegistryKey, \
+ BOOST_PP_SEQ_ENUM(varargs_) ); \
+ } \
+}
+
+#define COMPHELPER_SERVICEDECL_EXPORTS1(compName,comp0_) \
+ COMPHELPER_SERVICEDECL_make_exports(compName,(comp0_))
+#define COMPHELPER_SERVICEDECL_EXPORTS2(compName,comp0_,comp1_) \
+ COMPHELPER_SERVICEDECL_make_exports(compName,(comp0_)(comp1_))
+#define COMPHELPER_SERVICEDECL_EXPORTS3(compName,comp0_,comp1_,comp2_) \
+ COMPHELPER_SERVICEDECL_make_exports(compName,(comp0_)(comp1_)(comp2_))
+#define COMPHELPER_SERVICEDECL_EXPORTS4(compName,comp0_,comp1_,comp2_,comp3_) \
+ COMPHELPER_SERVICEDECL_make_exports(compName,(comp0_)(comp1_)(comp2_)(comp3_))
+#define COMPHELPER_SERVICEDECL_EXPORTS5(compName,comp0_,comp1_,comp2_,comp3_,comp4_) \
+ COMPHELPER_SERVICEDECL_make_exports(compName,(comp0_)(comp1_)(comp2_)(comp3_)(comp4_))
+#define COMPHELPER_SERVICEDECL_EXPORTS6(compName,comp0_,comp1_,comp2_,comp3_,comp4_,comp5_) \
+ COMPHELPER_SERVICEDECL_make_exports(compName,(comp0_)(comp1_)(comp2_)(comp3_)(comp4_)(comp5_))
+#define COMPHELPER_SERVICEDECL_EXPORTS7(compName,comp0_,comp1_,comp2_,comp3_,comp4_,comp5_,comp6_) \
+ COMPHELPER_SERVICEDECL_make_exports(compName,(comp0_)(comp1_)(comp2_)(comp3_)(comp4_)(comp5_)(comp6_))
+#define COMPHELPER_SERVICEDECL_EXPORTS8(compName,comp0_,comp1_,comp2_,comp3_,comp4_,comp5_,comp6_,comp7_) \
+ COMPHELPER_SERVICEDECL_make_exports(compName,(comp0_)(comp1_)(comp2_)(comp3_)(comp4_)(comp5_)(comp6_)(comp7_))
+
+#endif // ! defined(COMPHELPER_SERVICEDECL_HXX_INCLUDED)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/servicehelper.hxx b/include/comphelper/servicehelper.hxx
new file mode 100644
index 000000000000..a861e88db2d7
--- /dev/null
+++ b/include/comphelper/servicehelper.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 _COMPHELPER_SERVICEHELPER_HXX_
+#define _COMPHELPER_SERVICEHELPER_HXX_
+
+#include <rtl/uuid.h>
+#include <rtl/instance.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+
+class UnoTunnelIdInit
+{
+private:
+ ::com::sun::star::uno::Sequence< sal_Int8 > m_aSeq;
+public:
+ UnoTunnelIdInit() : m_aSeq(16)
+ {
+ rtl_createUuid( (sal_uInt8*)m_aSeq.getArray(), 0, sal_True );
+ }
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& getSeq() const { return m_aSeq; }
+};
+
+/** the UNO3_GETIMPLEMENTATION_* macros implement a static helper function
+ that gives access to your implementation for a given interface reference,
+ if possible.
+
+ Example:
+ MyClass* pClass = MyClass::getImplementation( xRef );
+
+ Usage:
+ Put a UNO3_GETIMPLEMENTATION_DECL( classname ) inside your class
+ definitian and UNO3_GETIMPLEMENTATION_IMPL( classname ) inside
+ your cxx file. Your class must inherit ::com::sun::star::uno::XUnoTunnel
+ and export it with queryInterface. Implementation of XUnoTunnel is
+ done by this macro.
+*/
+#define UNO3_GETIMPLEMENTATION_DECL( classname ) \
+ static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); \
+ static classname* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xInt ); \
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+#define UNO3_GETIMPLEMENTATION_BASE_IMPL( classname ) \
+namespace \
+{ \
+ class the##classname##UnoTunnelId : public rtl::Static< UnoTunnelIdInit, the##classname##UnoTunnelId> {}; \
+} \
+const ::com::sun::star::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() throw() \
+{ \
+ return the##classname##UnoTunnelId::get().getSeq(); \
+} \
+\
+classname* classname::getImplementation( const uno::Reference< uno::XInterface >& xInt ) \
+{ \
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xUT( xInt, ::com::sun::star::uno::UNO_QUERY ); \
+ if( xUT.is() ) \
+ return reinterpret_cast<classname*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething( classname::getUnoTunnelId() ))); \
+ else \
+ return NULL; \
+}
+
+#define UNO3_GETIMPLEMENTATION_IMPL( classname )\
+UNO3_GETIMPLEMENTATION_BASE_IMPL(classname)\
+sal_Int64 SAL_CALL classname::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw(::com::sun::star::uno::RuntimeException) \
+{ \
+ if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), \
+ rId.getConstArray(), 16 ) ) \
+ { \
+ return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); \
+ } \
+ return 0; \
+}
+
+#define UNO3_GETIMPLEMENTATION2_IMPL( classname, baseclass )\
+UNO3_GETIMPLEMENTATION_BASE_IMPL(classname)\
+sal_Int64 SAL_CALL classname::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw(::com::sun::star::uno::RuntimeException) \
+{ \
+ if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), \
+ rId.getConstArray(), 16 ) ) \
+ { \
+ return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); \
+ } \
+ else \
+ { \
+ return baseclass::getSomething( rId ); \
+ } \
+}
+
+
+#endif // _COMPHELPER_SERVICEHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/serviceinfohelper.hxx b/include/comphelper/serviceinfohelper.hxx
new file mode 100644
index 000000000000..25169d1043a0
--- /dev/null
+++ b/include/comphelper/serviceinfohelper.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 COMPHELPER_SERVICEINFOHELPER_HXX
+#define COMPHELPER_SERVICEINFOHELPER_HXX
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+namespace comphelper {
+
+/** this class provides a basic helper for classes suporting the XServiceInfo Interface.
+ *
+ * you can overload the <code>getSupprotedServiceNames</code> to implement a XServiceInfo.
+ * you can use the static helper methods to combine your services with that of parent
+ * or aggregatet classes.
+ */
+class COMPHELPER_DLLPUBLIC ServiceInfoHelper : public ::com::sun::star::lang::XServiceInfo
+{
+public:
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // helper
+ static void addToSequence( ::com::sun::star::uno::Sequence< OUString >& rSeq, sal_uInt16 nServices, /* sal_Char* */... ) throw();
+ static sal_Bool SAL_CALL supportsService( const OUString& ServiceName, const ::com::sun::star::uno::Sequence< OUString >& SupportedServices ) throw();
+
+protected:
+ ~ServiceInfoHelper() {}
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/sharedmutex.hxx b/include/comphelper/sharedmutex.hxx
new file mode 100644
index 000000000000..8013e7f404aa
--- /dev/null
+++ b/include/comphelper/sharedmutex.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 COMPHELPER_SHAREDMUTEX_HXX
+#define COMPHELPER_SHAREDMUTEX_HXX
+
+#include "comphelper/comphelperdllapi.h"
+
+#include <osl/mutex.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+//........................................................................
+namespace comphelper
+{
+//........................................................................
+
+ //============================================================
+ //= SharedMutex
+ //============================================================
+ class COMPHELPER_DLLPUBLIC SharedMutex
+ {
+ public:
+ SharedMutex();
+ SharedMutex( const SharedMutex& );
+ SharedMutex& operator=( const SharedMutex& );
+ ~SharedMutex()
+ {
+ }
+
+ inline ::osl::Mutex& getMutex() { return *m_pMutexImpl; }
+ inline operator ::osl::Mutex& () { return *m_pMutexImpl; }
+
+ private:
+ ::boost::shared_ptr< ::osl::Mutex > m_pMutexImpl;
+ };
+
+ //============================================================
+ //= SharedMutexBase
+ //============================================================
+ /** sometimes, it's necessary to have an initialized ::osl::Mutex to pass
+ to some ctor call of your base class. In this case, you can't hold the
+ SharedMutex as member, but you need to move it into another base class,
+ which is initialized before the mutex-requiring class is.
+ */
+ class COMPHELPER_DLLPUBLIC SharedMutexBase
+ {
+ protected:
+ SharedMutexBase()
+ {
+ }
+ ~SharedMutexBase()
+ {
+ }
+
+ protected:
+ ::osl::Mutex& getMutex() const { return m_aMutex; }
+ SharedMutex& getSharedMutex() const { return m_aMutex; }
+
+ private:
+ mutable SharedMutex m_aMutex;
+ };
+
+//........................................................................
+} // namespace comphelper
+//........................................................................
+
+#endif // COMPHELPER_SHAREDMUTEX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/stillreadwriteinteraction.hxx b/include/comphelper/stillreadwriteinteraction.hxx
new file mode 100644
index 000000000000..c6d62e8da9e2
--- /dev/null
+++ b/include/comphelper/stillreadwriteinteraction.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 _COMPHELPER_STILLREADWRITEINTERACTION_HXX_
+#define _COMPHELPER_STRILLREADWRITEINTERACTION_HXX_
+
+#include <ucbhelper/interceptedinteraction.hxx>
+
+#include <com/sun/star/task/XInteractionHandler.hpp>
+
+#include "comphelper/comphelperdllapi.h"
+
+
+namespace comphelper{
+class COMPHELPER_DLLPUBLIC StillReadWriteInteraction : public ::ucbhelper::InterceptedInteraction
+{
+private:
+ static const sal_Int32 HANDLE_INTERACTIVEIOEXCEPTION = 0;
+ static const sal_Int32 HANDLE_UNSUPPORTEDDATASINKEXCEPTION = 1;
+
+ sal_Bool m_bUsed;
+ sal_Bool m_bHandledByMySelf;
+ sal_Bool m_bHandledByInternalHandler;
+
+public:
+ StillReadWriteInteraction(const com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >& xHandler);
+
+ void resetInterceptions();
+ void resetErrorStates();
+ sal_Bool wasWriteError();
+
+private:
+ virtual ucbhelper::InterceptedInteraction::EInterceptionState intercepted(const ::ucbhelper::InterceptedInteraction::InterceptedRequest& aRequest,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xRequest);
+
+};
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/stl_types.hxx b/include/comphelper/stl_types.hxx
new file mode 100644
index 000000000000..cef5afdff3f2
--- /dev/null
+++ b/include/comphelper/stl_types.hxx
@@ -0,0 +1,273 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _COMPHELPER_STLTYPES_HXX_
+#define _COMPHELPER_STLTYPES_HXX_
+
+#include "sal/config.h"
+
+#include <vector>
+#include <map>
+
+#include <stack>
+#include <set>
+
+#include <math.h> // prevent conflict between exception and std::exception
+#include <functional>
+
+
+#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+
+//... namespace comphelper ................................................
+namespace comphelper
+{
+//.........................................................................
+
+//========================================================================
+// comparisation functions
+
+//------------------------------------------------------------------------
+ struct UStringLess : public ::std::binary_function< OUString, OUString, bool>
+{
+ bool operator() (const OUString& x, const OUString& y) const { return x < y ? true : false;} // construct prevents a MSVC6 warning
+};
+//------------------------------------------------------------------------
+struct UStringMixLess : public ::std::binary_function< OUString, OUString, bool>
+{
+ bool m_bCaseSensitive;
+public:
+ UStringMixLess(bool bCaseSensitive = true):m_bCaseSensitive(bCaseSensitive){}
+ bool operator() (const OUString& x, const OUString& y) const
+ {
+ if (m_bCaseSensitive)
+ return rtl_ustr_compare(x.getStr(), y.getStr()) < 0 ? true : false;
+ else
+ return rtl_ustr_compareIgnoreAsciiCase(x.getStr(), y.getStr()) < 0 ? true : false;
+ }
+
+ bool isCaseSensitive() const {return m_bCaseSensitive;}
+};
+//------------------------------------------------------------------------
+struct UStringEqual
+{
+ sal_Bool operator() (const OUString& lhs, const OUString& rhs) const { return lhs.equals( rhs );}
+};
+
+//------------------------------------------------------------------------
+struct UStringIEqual
+{
+ sal_Bool operator() (const OUString& lhs, const OUString& rhs) const { return lhs.equalsIgnoreAsciiCase( rhs );}
+};
+
+//------------------------------------------------------------------------
+class UStringMixEqual
+{
+ sal_Bool m_bCaseSensitive;
+
+public:
+ UStringMixEqual(sal_Bool bCaseSensitive = sal_True):m_bCaseSensitive(bCaseSensitive){}
+ sal_Bool operator() (const OUString& lhs, const OUString& rhs) const
+ {
+ return m_bCaseSensitive ? lhs.equals( rhs ) : lhs.equalsIgnoreAsciiCase( rhs );
+ }
+ sal_Bool isCaseSensitive() const {return m_bCaseSensitive;}
+};
+//------------------------------------------------------------------------
+class TStringMixEqualFunctor : public ::std::binary_function< OUString,OUString,bool>
+{
+ sal_Bool m_bCaseSensitive;
+
+public:
+ TStringMixEqualFunctor(sal_Bool bCaseSensitive = sal_True)
+ :m_bCaseSensitive(bCaseSensitive)
+ {}
+ bool operator() (const OUString& lhs, const OUString& rhs) const
+ {
+ return !!(m_bCaseSensitive ? lhs.equals( rhs ) : lhs.equalsIgnoreAsciiCase( rhs ));
+ }
+ sal_Bool isCaseSensitive() const {return m_bCaseSensitive;}
+};
+//------------------------------------------------------------------------
+class TPropertyValueEqualFunctor : public ::std::binary_function< ::com::sun::star::beans::PropertyValue,OUString,bool>
+{
+public:
+ TPropertyValueEqualFunctor()
+ {}
+ bool operator() (const ::com::sun::star::beans::PropertyValue& lhs, const OUString& rhs) const
+ {
+ return !!(lhs.Name == rhs);
+ }
+};
+//------------------------------------------------------------------------
+class TNamedValueEqualFunctor : public ::std::binary_function< ::com::sun::star::beans::NamedValue,OUString,bool>
+{
+public:
+ TNamedValueEqualFunctor()
+ {}
+ bool operator() (const ::com::sun::star::beans::NamedValue& lhs, const OUString& rhs) const
+ {
+ return !!(lhs.Name == rhs);
+ }
+};
+//------------------------------------------------------------------------
+class UStringMixHash
+{
+ sal_Bool m_bCaseSensitive;
+
+public:
+ UStringMixHash(sal_Bool bCaseSensitive = sal_True):m_bCaseSensitive(bCaseSensitive){}
+ size_t operator() (const OUString& rStr) const
+ {
+ return m_bCaseSensitive ? rStr.hashCode() : rStr.toAsciiUpperCase().hashCode();
+ }
+ sal_Bool isCaseSensitive() const {return m_bCaseSensitive;}
+};
+
+//=====================================================================
+//= OInterfaceCompare
+//=====================================================================
+/** is stl-compliant structure for comparing Reference&lt; &lt;iface&gt; &gt; instances
+*/
+template < class IAFCE >
+struct OInterfaceCompare
+ :public ::std::binary_function < ::com::sun::star::uno::Reference< IAFCE >
+ , ::com::sun::star::uno::Reference< IAFCE >
+ , bool
+ >
+{
+ bool operator() (const ::com::sun::star::uno::Reference< IAFCE >& lhs, const ::com::sun::star::uno::Reference< IAFCE >& rhs) const
+ {
+ return lhs.get() < rhs.get();
+ // this does not make any sense if you see the semantics of the pointer returned by get:
+ // It's a pointer to a point in memory where an interface implementation lies.
+ // But for our purpose (provide a reliable less-operator which can be used with the STL), this is
+ // sufficient ....
+ }
+};
+
+template <class _Tp, class _Arg>
+class mem_fun1_t : public ::std::binary_function<_Tp*,_Arg,void>
+{
+ typedef void (_Tp::*_fun_type)(_Arg);
+public:
+ explicit mem_fun1_t(_fun_type __pf) : _M_f(__pf) {}
+ void operator()(_Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
+private:
+ _fun_type _M_f;
+};
+
+template <class _Tp, class _Arg>
+inline mem_fun1_t<_Tp,_Arg> mem_fun(void (_Tp::*__f)(_Arg))
+{
+ return mem_fun1_t<_Tp,_Arg>(__f);
+}
+
+//.........................................................................
+/** output iterator that appends OUStrings into an OUStringBuffer.
+ */
+class OUStringBufferAppender :
+ public ::std::iterator< ::std::output_iterator_tag, void, void, void, void>
+{
+public:
+ typedef OUStringBufferAppender Self;
+ typedef ::std::output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void reference;
+ typedef void pointer;
+ typedef size_t difference_type;
+
+ OUStringBufferAppender(OUStringBuffer & i_rBuffer)
+ : m_rBuffer(i_rBuffer) { }
+ Self & operator=(OUString const & i_rStr)
+ {
+ m_rBuffer.append( i_rStr );
+ return *this;
+ }
+ Self & operator*() { return *this; } // so operator= works
+ Self & operator++() { return *this; }
+ Self & operator++(int) { return *this; }
+
+private:
+ OUStringBuffer & m_rBuffer;
+};
+
+//.........................................................................
+/** algorithm similar to std::copy, but inserts a separator between elements.
+ */
+template< typename ForwardIter, typename OutputIter, typename T >
+OutputIter intersperse(
+ ForwardIter start, ForwardIter end, OutputIter out, T const & separator)
+{
+ if (start != end) {
+ *out = *start;
+ ++start;
+ ++out;
+ }
+
+ while (start != end) {
+ *out = separator;
+ ++out;
+ *out = *start;
+ ++start;
+ ++out;
+ }
+
+ return out;
+}
+
+//.........................................................................
+}
+//... namespace comphelper ................................................
+
+//==================================================================
+// consistently defining stl-types
+//==================================================================
+
+#define DECLARE_STL_ITERATORS(classname) \
+ typedef classname::iterator classname##Iterator; \
+ typedef classname::const_iterator Const##classname##Iterator \
+
+#define DECLARE_STL_MAP(keytype, valuetype, comparefct, classname) \
+ typedef std::map< keytype, valuetype, comparefct > classname; \
+ DECLARE_STL_ITERATORS(classname) \
+
+#define DECLARE_STL_STDKEY_MAP(keytype, valuetype, classname) \
+ DECLARE_STL_MAP(keytype, valuetype, std::less< keytype >, classname) \
+
+#define DECLARE_STL_VECTOR(valuetyp, classname) \
+ typedef std::vector< valuetyp > classname; \
+ DECLARE_STL_ITERATORS(classname) \
+
+#define DECLARE_STL_USTRINGACCESS_MAP(valuetype, classname) \
+ DECLARE_STL_MAP(OUString, valuetype, ::comphelper::UStringLess, classname) \
+
+#define DECLARE_STL_STDKEY_SET(valuetype, classname) \
+ typedef ::std::set< valuetype > classname; \
+ DECLARE_STL_ITERATORS(classname) \
+
+#define DECLARE_STL_SET(valuetype, comparefct, classname) \
+ typedef ::std::set< valuetype, comparefct > classname; \
+ DECLARE_STL_ITERATORS(classname) \
+
+#endif // _COMPHELPER_STLTYPES_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/stlunosequence.hxx b/include/comphelper/stlunosequence.hxx
new file mode 100644
index 000000000000..c7b776f78d6e
--- /dev/null
+++ b/include/comphelper/stlunosequence.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_STLUNOITERATOR_HXX
+#define _COMPHELPER_STLUNOITERATOR_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <sal/types.h>
+
+
+namespace comphelper
+{
+ /**
+ @short stl-container-like access to an existing ::com::sun::star::uno::Sequence
+ @descr These template functions allows using an existing
+ ::com::sun::star::uno::Sequence using stl algorithms. They provides
+ standard-compliant mutable random access iterators. Because random access
+ iterators are the most generic iterators defined by the stl, any stl algorithm
+ can be applied to the Sequence (excluding algorithms requiring output
+ iterators).
+ <p>
+ Example: (creating a ::std::list from a ::com::sun::star::uno::Sequence)
+ <code>
+ ::com::sun::star::uno::Sequence<sal_Int32> aSeq(10);
+ ::std::list stl_list(stl_begin(aSeq), stl_end(aSeq));
+ </code>
+ <p>
+ Example: (sorting ::com::sun::star::uno::Sequence inplace)
+ <code>
+ ::com::sun::star::uno::Sequence<sal_Int32> aSeq(10);
+ ::std::sort(stl_begin(aSeq), stl_seq.end(aSeq));
+ </code>
+ <p>
+ Example: (counting occurrences of 4711 in a ::com::sun::star::uno::Sequence)
+ <code>
+ ::com::sun::star::uno::Sequence<sal_Int32> aSeq(10);
+ sal_Int32 count = 0;
+ ::std::count(stl_begin(aSeq), stl_end(aSeq), 4711, count);
+ </code>
+ <p>
+
+ @see http://www.sgi.com/tech/stl/Container.html
+ @see http://www.sgi.com/tech/stl/Sequence.html
+ @see http://www.sgi.com/tech/stl/RandomAccessIterator.html
+ */
+
+ template <typename V>
+ V* stl_begin(::com::sun::star::uno::Sequence<V>& rSeq)
+ { return rSeq.getArray(); }
+
+ template <typename V>
+ V* stl_end(::com::sun::star::uno::Sequence<V>& rSeq)
+ { return rSeq.getArray() + rSeq.getLength(); }
+
+ template <typename V>
+ const V* stl_begin(const ::com::sun::star::uno::Sequence<V>& rSeq)
+ { return rSeq.getConstArray(); }
+
+ template <typename V>
+ const V* stl_end(const ::com::sun::star::uno::Sequence<V>& rSeq)
+ { return rSeq.getConstArray() + rSeq.getLength(); }
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/storagehelper.hxx b/include/comphelper/storagehelper.hxx
new file mode 100644
index 000000000000..093038e6e5ed
--- /dev/null
+++ b/include/comphelper/storagehelper.hxx
@@ -0,0 +1,200 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef COMPHELPER_STORAGEHELPER_HXX
+#define COMPHELPER_STORAGEHELPER_HXX
+
+#include <boost/scoped_ptr.hpp>
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+
+#define PACKAGE_STORAGE_FORMAT_STRING OUString( "PackageFormat" )
+#define ZIP_STORAGE_FORMAT_STRING OUString( "ZipFormat" )
+#define OFOPXML_STORAGE_FORMAT_STRING OUString( "OFOPXMLFormat" )
+
+#define PACKAGE_ENCRYPTIONDATA_SHA256UTF8 OUString( "PackageSHA256UTF8EncryptionKey" )
+#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8 OUString( "PackageSHA1UTF8EncryptionKey" )
+#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 OUString( "PackageSHA1MS1252EncryptionKey" )
+
+namespace com { namespace sun { namespace star {
+ namespace beans { struct NamedValue; }
+ namespace embed { class XStorage; }
+ namespace io {
+ class XInputStream;
+ class XOutputStream;
+ class XStream;
+ }
+ namespace lang { class XSingleServiceFactory; }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace comphelper {
+
+// Unfortunately - the impl.s of XStorage like to invalidate all
+// their sub streams and storages when you release references, so
+// it is necessary to keep references to all storages down the
+// path - this is 'beautiful' (TM). So we need this ugly hack:
+class COMPHELPER_DLLPUBLIC LifecycleProxy
+{
+private:
+ class Impl;
+public:
+ ::boost::scoped_ptr<Impl> m_pBadness;
+ LifecycleProxy();
+ ~LifecycleProxy();
+ // commit the storages: necessary for writes to streams to take effect!
+ void commitStorages();
+};
+
+class COMPHELPER_DLLPUBLIC OStorageHelper
+{
+public:
+ static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >
+ GetStorageFactory(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext
+ = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >() )
+ throw ( ::com::sun::star::uno::Exception );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >
+ GetFileSystemStorageFactory(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext
+ = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >() )
+ throw ( ::com::sun::star::uno::Exception );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ GetTemporaryStorage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext
+ = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >() )
+ throw ( ::com::sun::star::uno::Exception );
+
+ /// this one will only return Storage
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ GetStorageFromURL(
+ const OUString& aURL,
+ sal_Int32 nStorageMode,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext
+ = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >() )
+ throw ( ::com::sun::star::uno::Exception );
+
+ /// this one will return either Storage or FileSystemStorage
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ GetStorageFromURL2(
+ const OUString& aURL,
+ sal_Int32 nStorageMode,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext
+ = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >() )
+
+ throw ( ::com::sun::star::uno::Exception );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ GetStorageFromInputStream(
+ const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream >& xStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext
+ = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >() )
+ throw ( ::com::sun::star::uno::Exception );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ GetStorageFromStream(
+ const ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream >& xStream,
+ sal_Int32 nStorageMode = ::com::sun::star::embed::ElementModes::READWRITE,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext
+ = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >() )
+ throw ( ::com::sun::star::uno::Exception );
+
+ static void CopyInputToOutput(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInput,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutput )
+ throw ( ::com::sun::star::uno::Exception );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ GetInputStreamFromURL(
+ const OUString& aURL,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& context )
+ throw ( ::com::sun::star::uno::Exception );
+
+ static void SetCommonStorageEncryptionData(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData )
+ throw ( ::com::sun::star::uno::Exception );
+
+ // the following method supports only storages of OOo formats
+ static sal_Int32 GetXStorageFormat(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage )
+ throw ( ::com::sun::star::uno::Exception );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ GetStorageOfFormatFromURL(
+ const OUString& aFormat,
+ const OUString& aURL,
+ sal_Int32 nStorageMode,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext
+ = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >(),
+ sal_Bool bRepairStorage = sal_False )
+ throw ( ::com::sun::star::uno::Exception );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ GetStorageOfFormatFromInputStream(
+ const OUString& aFormat,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream >& xStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext
+ = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >(),
+ sal_Bool bRepairStorage = sal_False )
+ throw ( ::com::sun::star::uno::Exception );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ GetStorageOfFormatFromStream(
+ const OUString& aFormat,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream >& xStream,
+ sal_Int32 nStorageMode = ::com::sun::star::embed::ElementModes::READWRITE,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext
+ = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >(),
+ sal_Bool bRepairStorage = sal_False )
+ throw ( ::com::sun::star::uno::Exception );
+
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ CreatePackageEncryptionData(
+ const OUString& aPassword );
+
+ static sal_Bool IsValidZipEntryFileName( const OUString& aName, sal_Bool bSlashAllowed );
+ static sal_Bool IsValidZipEntryFileName( const sal_Unicode *pChar, sal_Int32 nLength, sal_Bool bSlashAllowed );
+
+ static sal_Bool PathHasSegment( const OUString& aPath, const OUString& aSegment );
+
+ // Methods to allow easy use of hierachical names inside storages
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetStorageAtPath(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > &xStorage,
+ const OUString& aPath, sal_uInt32 nOpenMode, LifecycleProxy &rNastiness );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetStreamAtPath(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > &xStorage,
+ const OUString& aPath, sal_uInt32 nOpenMode, LifecycleProxy &rNastiness );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetStreamAtPackageURL(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > &xStorage,
+ const OUString& rURL, sal_uInt32 const nOpenMode,
+ LifecycleProxy & rNastiness );
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/streamsection.hxx b/include/comphelper/streamsection.hxx
new file mode 100644
index 000000000000..40ea508f888b
--- /dev/null
+++ b/include/comphelper/streamsection.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 _COMPHELPER_STREAMSECTION_HXX_
+#define _COMPHELPER_STREAMSECTION_HXX_
+
+#include <com/sun/star/io/XMarkableStream.hpp>
+#include <com/sun/star/io/XDataInputStream.hpp>
+#include <com/sun/star/io/XDataOutputStream.hpp>
+#include "comphelper/comphelperdllapi.h"
+
+namespace comphelper
+{
+
+ namespace stario = ::com::sun::star::io;
+ namespace staruno = ::com::sun::star::uno;
+
+/** implements handling for compatibly reading/writing data from/into an input/output stream.
+ data written in a block secured by this class should be readable by older versions which
+ use the same mechanism.
+
+ @author Frank Schoenheit
+ @since 00/26/05
+*/
+
+class COMPHELPER_DLLPUBLIC OStreamSection
+{
+ staruno::Reference< stario::XMarkableStream > m_xMarkStream;
+ staruno::Reference< stario::XDataInputStream > m_xInStream;
+ staruno::Reference< stario::XDataOutputStream > m_xOutStream;
+
+ sal_Int32 m_nBlockStart;
+ sal_Int32 m_nBlockLen;
+
+public:
+ /** starts reading of a "skippable" section of data within the given input stream<BR>
+ @param _rxInput the stream to read from. Must support the
+ <type scope="com::sun::star::io">XMarkableStream</type> interface
+ */
+ OStreamSection(const staruno::Reference< stario::XDataInputStream >& _rxInput);
+
+ /** starts writing of a "skippable" section of data into the given output stream
+ @param _rxOutput the stream the stream to write to. Must support the
+ <type scope="com::sun::star::io">XMarkableStream</type> interface
+ @param _nPresumedLength estimation for the length of the upcoming section. If greater 0, this
+ value will be written as section length and corrected (in the dtor) only if
+ needed. If you know how much bytes you are about to write, you may
+ want to use this param, saving some stream operations this way.
+ */
+ OStreamSection(const staruno::Reference< stario::XDataOutputStream >& _rxOutput, sal_Int32 _nPresumedLength = 0);
+
+ /** dtor. <BR>If constructed for writing, the section "opened" by this object will be "closed".<BR>
+ If constructed for reading, any remaining bytes 'til the end of the section will be skipped.
+ */
+ ~OStreamSection();
+};
+
+} // namespace comphelper
+
+#endif // _COMPHELPER_STREAMSECTION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/string.hxx b/include/comphelper/string.hxx
new file mode 100644
index 000000000000..85b0816b895e
--- /dev/null
+++ b/include/comphelper/string.hxx
@@ -0,0 +1,466 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_COMPHELPER_STRING_HXX
+#define INCLUDED_COMPHELPER_STRING_HXX
+
+#include "sal/config.h"
+
+#include <cstddef>
+#include "comphelper/comphelperdllapi.h"
+#include <sal/types.h>
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/i18n/XCollator.hpp>
+#include <com/sun/star/i18n/XBreakIterator.hpp>
+
+// OUString helper functions that are not widespread or mature enough to
+// go into the stable URE API:
+namespace comphelper { namespace string {
+
+/** Compare an OString to a single char
+
+ @param rIn The input OString
+ @param c The character to compare againsg
+
+ @return true if rIn has one char and its equal to c
+ */
+inline bool equals(const OString& rIn, sal_Char c)
+{ return rIn.getLength() == 1 && rIn[0] == c; }
+
+/** Compare an OUString to a single char
+
+ @param rIn The input OUString
+ @param c The character to compare againsg
+
+ @return true if rIn has one char and its equal to c
+ */
+inline bool equals(const OUString& rIn, sal_Unicode c)
+{ return rIn.getLength() == 1 && rIn[0] == c; }
+
+/** Removes all occurrences of a character from within the source string
+
+ @deprecated Use OString::replaceAll(OString(c), OString())
+ instead.
+
+ @param rIn The input OString
+ @param c The character to be removed
+
+ @return The resulting OString
+ */
+inline OString remove(const OString &rIn,
+ sal_Char c)
+{ return rIn.replaceAll(OString(c), OString()); }
+
+/** Removes all occurrences of a character from within the source string
+
+ @deprecated Use
+ OUString::replaceAll(OUString(c), OUString()) instead.
+
+ @param rIn The input OUString
+ @param c The character to be removed
+
+ @return The resulting OUString
+ */
+inline OUString remove(const OUString &rIn,
+ sal_Unicode c)
+{ return rIn.replaceAll(OUString(c), OUString()); }
+
+/** Strips occurrences of a character from the start of the source string
+
+ @param rIn The input OString
+ @param c The character to be stripped from the start
+
+ @return The resulting OString
+ */
+COMPHELPER_DLLPUBLIC OString stripStart(const OString &rIn,
+ sal_Char c);
+
+/** Strips occurrences of a character from the start of the source string
+
+ @param rIn The input OUString
+ @param c The character to be stripped from the start
+
+ @return The resulting OUString
+ */
+COMPHELPER_DLLPUBLIC OUString stripStart(const OUString &rIn,
+ sal_Unicode c);
+
+/** Strips occurrences of a character from the end of the source string
+
+ @param rIn The input OString
+ @param c The character to be stripped from the end
+
+ @return The resulting OString
+ */
+COMPHELPER_DLLPUBLIC OString stripEnd(const OString &rIn,
+ sal_Char c);
+
+/** Strips occurrences of a character from the end of the source string
+
+ @param rIn The input OUString
+ @param c The character to be stripped from the end
+
+ @return The resulting OUString
+ */
+COMPHELPER_DLLPUBLIC OUString stripEnd(const OUString &rIn,
+ sal_Unicode c);
+
+/** Strips occurrences of a character from the start and end of the source string
+
+ @param rIn The input OString
+ @param c The character to be stripped from the start and end
+
+ @return The resulting OString
+ */
+COMPHELPER_DLLPUBLIC OString strip(const OString &rIn,
+ sal_Char c);
+
+/** Strips occurrences of a character from the start and end of the source string
+
+ @param rIn The input OUString
+ @param c The character to be stripped from the start and end
+
+ @return The resulting OUString
+ */
+COMPHELPER_DLLPUBLIC OUString strip(const OUString &rIn,
+ sal_Unicode c);
+
+/** Returns a token in an OString
+
+ @deprecated Use OString::getToken(nToken, cTok) instead.
+
+ @param rIn the input OString
+ @param nToken the number of the token to return
+ @param cTok the character which seperate the tokens.
+ @return the token if token is negative or doesn't exist an empty token
+ is returned
+*/
+inline OString getToken(const OString &rIn,
+ sal_Int32 nToken, sal_Char cTok) SAL_THROW(())
+{
+ return rIn.getToken(nToken, cTok);
+}
+
+/** Returns a token in an OUString
+
+ @deprecated Use OUString::getToken(nToken, cTok) instead.
+
+ @param rIn the input OUString
+ @param nToken the number of the token to return
+ @param cTok the character which seperate the tokens.
+ @return the token if token is negative or doesn't exist an empty token
+ is returned
+*/
+inline OUString getToken(const OUString &rIn,
+ sal_Int32 nToken, sal_Unicode cTok) SAL_THROW(())
+{
+ return rIn.getToken(nToken, cTok);
+}
+
+/** Returns number of tokens in an OUString
+
+ @param rIn the input OString
+ @param cTok the character which seperate the tokens.
+ @return the number of tokens
+*/
+COMPHELPER_DLLPUBLIC sal_Int32 getTokenCount(const OString &rIn, sal_Char cTok);
+
+/** Returns number of tokens in an OUString
+
+ @param rIn the input OUString
+ @param cTok the character which seperate the tokens.
+ @return the number of tokens
+*/
+COMPHELPER_DLLPUBLIC sal_Int32 getTokenCount(const OUString &rIn, sal_Unicode cTok);
+
+/** Reverse an OUString
+
+ @param rIn the input OUString
+ @return the reversed input
+*/
+COMPHELPER_DLLPUBLIC OUString reverseString(const OUString &rStr);
+
+/** Reverse an OString
+
+ @param rIn the input OString
+ @return the reversed input
+*/
+COMPHELPER_DLLPUBLIC OString reverseString(const OString &rStr);
+
+
+namespace detail
+{
+ template<typename B> B& truncateToLength(B& rBuffer, sal_Int32 nLen)
+ {
+ if (nLen < rBuffer.getLength())
+ rBuffer.remove(nLen, rBuffer.getLength()-nLen);
+ return rBuffer;
+ }
+}
+
+/** Truncate a buffer to a given length.
+
+ If the StringBuffer has more characters than nLength it will be truncated
+ on the right to nLength characters.
+
+ Has no effect if the StringBuffer is <= nLength
+
+ @param rBuf StringBuffer to operate on
+ @param nLength Length to truncate the buffer to
+
+ @return rBuf;
+ */
+COMPHELPER_DLLPUBLIC inline OStringBuffer& truncateToLength(
+ OStringBuffer& rBuffer, sal_Int32 nLength) SAL_THROW(())
+{
+ return detail::truncateToLength(rBuffer, nLength);
+}
+
+COMPHELPER_DLLPUBLIC inline OUStringBuffer& truncateToLength(
+ OUStringBuffer& rBuffer, sal_Int32 nLength) SAL_THROW(())
+{
+ return detail::truncateToLength(rBuffer, nLength);
+}
+
+namespace detail
+{
+ template<typename B, typename U> B& padToLength(B& rBuffer, sal_Int32 nLen,
+ U cFill = '\0')
+ {
+ sal_Int32 nOrigLen = rBuffer.getLength();
+ if (nLen > nOrigLen)
+ {
+ rBuffer.setLength(nLen);
+ for (sal_Int32 i = nOrigLen; i < nLen; ++i)
+ rBuffer[i] = cFill;
+ }
+ return rBuffer;
+ }
+}
+
+/** Pad a buffer to a given length using a given char.
+
+ If the StringBuffer has less characters than nLength it will be expanded on
+ the right to nLength characters, with the expansion filled using cFill.
+
+ Has no effect if the StringBuffer is >= nLength
+
+ @param rBuf StringBuffer to operate on
+ @param nLength Length to pad the buffer to
+ @param cFill character to fill expansion with
+
+ @return rBuf;
+ */
+COMPHELPER_DLLPUBLIC inline OStringBuffer& padToLength(
+ OStringBuffer& rBuffer, sal_Int32 nLength,
+ sal_Char cFill = '\0') SAL_THROW(())
+{
+ return detail::padToLength(rBuffer, nLength, cFill);
+}
+
+COMPHELPER_DLLPUBLIC inline OUStringBuffer& padToLength(
+ OUStringBuffer& rBuffer, sal_Int32 nLength,
+ sal_Unicode cFill = '\0') SAL_THROW(())
+{
+ return detail::padToLength(rBuffer, nLength, cFill);
+}
+
+/** Find any of a list of code units in the string.
+ @param rIn OUString to search
+ @param pChars 0-terminated array of sal_Unicode code units to search for
+ @param nPos start position
+
+ @return position of first occurrence of any of the elements of pChars
+ or -1 if none of the code units occur in the string
+ */
+COMPHELPER_DLLPUBLIC sal_Int32 indexOfAny(OUString const& rIn,
+ sal_Unicode const*const pChars, sal_Int32 const nPos = 0);
+
+/** Convert a sequence of strings to a single comma separated string.
+
+ Note that no escaping of commas or anything fancy is done.
+
+ @param i_rSeq A list of strings to be concatenated.
+
+ @return A single string containing the concatenation of the given
+ list, interspersed with the string ", ".
+ */
+COMPHELPER_DLLPUBLIC OUString convertCommaSeparated(
+ ::com::sun::star::uno::Sequence< OUString > const & i_rSeq);
+
+/** Convert a decimal string to a number.
+
+ The string must be base-10, no sign but can contain any
+ codepoint listed in the "Number, Decimal Digit" Unicode
+ category.
+
+ No verification is made about the validity of the string,
+ passing string not containing decimal digit code points
+ gives unspecified results
+
+ If your string is guaranteed to contain only ASCII digit
+ use OUString::toInt32 instead.
+
+ @param str The string to convert containing only decimal
+ digit codepoints.
+
+ @return The value of the string as an int32.
+ */
+COMPHELPER_DLLPUBLIC sal_uInt32 decimalStringToNumber(
+ OUString const & str );
+
+/** Convert a single comma separated string to a sequence of strings.
+
+ Note that no escaping of commas or anything fancy is done.
+
+ @param i_rString A string containing comma-separated words.
+
+ @return A sequence of strings resulting from splitting the given
+ string at ',' tokens and stripping whitespace.
+ */
+COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< OUString >
+ convertCommaSeparated( OUString const & i_rString );
+
+/**
+ Compares two strings using natural order.
+
+ For non digit characters, the comparison use the same algorithm as
+ rtl_str_compare. When a number is encountered during the comparison,
+ natural order is used. Thus, Heading 10 will be considered as greater
+ than Heading 2. Numerical comparison is done using decimal representation.
+
+ Beware that "MyString 001" and "MyString 1" will be considered as equal
+ since leading 0 are meaningless.
+
+ @param str the object to be compared.
+ @return 0 - if both strings are equal
+ < 0 - if this string is less than the string argument
+ > 0 - if this string is greater than the string argument
+*/
+COMPHELPER_DLLPUBLIC sal_Int32 compareNatural( const OUString &rLHS, const OUString &rRHS,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > &rCollator,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > &rBI,
+ const ::com::sun::star::lang::Locale &rLocale );
+
+class COMPHELPER_DLLPUBLIC NaturalStringSorter
+{
+private:
+ ::com::sun::star::lang::Locale m_aLocale;
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > m_xCollator;
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > m_xBI;
+public:
+ NaturalStringSorter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rContext,
+ const ::com::sun::star::lang::Locale &rLocale);
+ sal_Int32 compare(const OUString &rLHS, const OUString &rRHS) const
+ {
+ return compareNatural(rLHS, rRHS, m_xCollator, m_xBI, m_aLocale);
+ }
+ const ::com::sun::star::lang::Locale& getLocale() const { return m_aLocale; }
+};
+
+/** Determine if an OString contains solely ASCII numeric digits
+
+ @param rString An OString
+
+ @return false if string contains any characters outside
+ the ASCII '0'-'9' range
+ true otherwise, including for empty string
+ */
+COMPHELPER_DLLPUBLIC bool isdigitAsciiString(const OString &rString);
+
+/** Determine if an OUString contains solely ASCII numeric digits
+
+ @param rString An OUString
+
+ @return false if string contains any characters outside
+ the ASCII '0'-'9' range
+ true otherwise, including for empty string
+ */
+COMPHELPER_DLLPUBLIC bool isdigitAsciiString(const OUString &rString);
+
+COMPHELPER_DLLPUBLIC inline bool isdigitAscii(sal_Unicode c)
+{
+ return ((c >= '0') && (c <= '9'));
+}
+
+COMPHELPER_DLLPUBLIC inline bool isxdigitAscii(sal_Unicode c)
+{
+ return isdigitAscii(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f');
+}
+
+COMPHELPER_DLLPUBLIC inline bool islowerAscii(sal_Unicode c)
+{
+ return ((c >= 'a') && (c <= 'z'));
+}
+
+COMPHELPER_DLLPUBLIC inline bool isupperAscii(sal_Unicode c)
+{
+ return ((c >= 'A') && (c <= 'Z'));
+}
+
+COMPHELPER_DLLPUBLIC inline bool isalphaAscii(sal_Unicode c)
+{
+ return islowerAscii(c) || isupperAscii(c);
+}
+
+COMPHELPER_DLLPUBLIC inline bool isalnumAscii(sal_Unicode c)
+{
+ return isalphaAscii(c) || isdigitAscii(c);
+}
+
+//============================================================
+//= a helper for static ascii pseudo-unicode strings
+//============================================================
+struct COMPHELPER_DLLPUBLIC ConstAsciiString
+{
+ const sal_Char* ascii;
+ sal_Int32 length;
+
+ operator OUString() const
+ {
+ return OUString(ascii, length, RTL_TEXTENCODING_ASCII_US);
+ }
+};
+
+} }
+
+#ifdef RTL_FAST_STRING
+// TODO The whole ConstAsciiString class should probably be dumped
+// and replaced with plain 'const char[]'.
+namespace rtl
+{
+template<>
+struct ToStringHelper< comphelper::string::ConstAsciiString >
+ {
+ static int length( const comphelper::string::ConstAsciiString& str ) { return str.length; }
+ static sal_Unicode* addData( sal_Unicode* buffer, const comphelper::string::ConstAsciiString& str ) { return addDataLiteral( buffer, str.ascii, str.length ); }
+ static const bool allowOStringConcat = false;
+ static const bool allowOUStringConcat = true;
+ };
+}
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/synchronousdispatch.hxx b/include/comphelper/synchronousdispatch.hxx
new file mode 100644
index 000000000000..efeffea6b4eb
--- /dev/null
+++ b/include/comphelper/synchronousdispatch.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 _COMPHELPER_SYNCHRONOUSDISPATCH_HXX
+#define _COMPHELPER_SYNCHRONOUSDISPATCH_HXX
+
+#include "comphelper/comphelperdllapi.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XInterface; }
+ namespace lang {
+ class XComponent; }
+} } }
+
+
+//........................................................................
+namespace comphelper
+{
+//........................................................................
+
+ //====================================================================
+ //= SynchronousDispatch
+ //====================================================================
+ /** a helper class for working with the dispatch interface replacing
+ loadComponentFromURL
+ */
+ class SynchronousDispatch
+ {
+ public:
+ static COMPHELPER_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::lang::XComponent > dispatch(
+ const com::sun::star::uno::Reference< com::sun::star::uno::XInterface > &xStartPoint,
+ const OUString &sURL,
+ const OUString &sTarget,
+ const sal_Int32 nFlags,
+ const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > &lArguments );
+ };
+
+//........................................................................
+} // namespace comphelper
+//........................................................................
+
+#endif // _COMPHELPER_SYNCHRONOUSDISPATCH_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/syntaxhighlight.hxx b/include/comphelper/syntaxhighlight.hxx
new file mode 100644
index 000000000000..ef1a9486a6bf
--- /dev/null
+++ b/include/comphelper/syntaxhighlight.hxx
@@ -0,0 +1,162 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _COMPHELPER_SYNTAXHIGHLIGHT_HXX
+#define _COMPHELPER_SYNTAXHIGHLIGHT_HXX
+
+#include <vector>
+#include <rtl/ustring.hxx>
+
+#include <comphelper/comphelperdllapi.h>
+
+
+#if defined CDECL
+#undef CDECL
+#endif
+
+// for the bsearch
+#ifdef WNT
+#define CDECL _cdecl
+#endif
+#if defined(UNX)
+#define CDECL
+#endif
+#ifdef UNX
+#include <sys/resource.h>
+#endif
+
+
+// Token-Typen TT_...
+enum TokenTypes
+{
+ TT_UNKNOWN,
+ TT_IDENTIFIER,
+ TT_WHITESPACE,
+ TT_NUMBER,
+ TT_STRING,
+ TT_EOL,
+ TT_COMMENT,
+ TT_ERROR,
+ TT_OPERATOR,
+ TT_KEYWORDS,
+ TT_PARAMETER
+};
+
+struct HighlightPortion { sal_uInt16 nBegin; sal_uInt16 nEnd; TokenTypes tokenType; };
+
+
+typedef std::vector<HighlightPortion> HighlightPortions;
+
+/////////////////////////////////////////////////////////////////////////
+// Auxiliary class to support JavaScript modules, next to find functions which
+// will later will be used for syntax highlighting
+
+// Flags for character properties
+#define CHAR_START_IDENTIFIER 0x0001
+#define CHAR_IN_IDENTIFIER 0x0002
+#define CHAR_START_NUMBER 0x0004
+#define CHAR_IN_NUMBER 0x0008
+#define CHAR_IN_HEX_NUMBER 0x0010
+#define CHAR_IN_OCT_NUMBER 0x0020
+#define CHAR_START_STRING 0x0040
+#define CHAR_OPERATOR 0x0080
+#define CHAR_SPACE 0x0100
+#define CHAR_EOL 0x0200
+
+#define CHAR_EOF 0x00
+
+
+// Language mode of the Highlighter (possibly to be refined later with keyword
+// lists, C comment flags)
+enum HighlighterLanguage
+{
+ HIGHLIGHT_BASIC,
+ HIGHLIGHT_SQL
+};
+
+class SimpleTokenizer_Impl
+{
+ HighlighterLanguage aLanguage;
+ // Character information tables
+ sal_uInt16 aCharTypeTab[256];
+
+ const sal_Unicode* mpStringBegin;
+ const sal_Unicode* mpActualPos;
+
+ // Lines and columns
+ sal_uInt32 nLine;
+ sal_uInt32 nCol;
+
+ sal_Unicode peekChar( void ) { return *mpActualPos; }
+ sal_Unicode getChar( void ) { nCol++; return *mpActualPos++; }
+
+ // Auxiliary function: testing of the character flags
+ sal_Bool testCharFlags( sal_Unicode c, sal_uInt16 nTestFlags );
+
+ // Get new token, EmptyString == nothing more over there
+ sal_Bool getNextToken( /*out*/TokenTypes& reType,
+ /*out*/const sal_Unicode*& rpStartPos, /*out*/const sal_Unicode*& rpEndPos );
+
+ const char** ppListKeyWords;
+ sal_uInt16 nKeyWordCount;
+
+public:
+ SimpleTokenizer_Impl( HighlighterLanguage aLang = HIGHLIGHT_BASIC );
+ ~SimpleTokenizer_Impl( void );
+
+ sal_uInt16 parseLine( sal_uInt32 nLine, const OUString* aSource );
+ void getHighlightPortions( sal_uInt32 nParseLine, const OUString& rLine,
+ /*out*/HighlightPortions& portions );
+ void setKeyWords( const char** ppKeyWords, sal_uInt16 nCount );
+};
+
+
+//*** SyntaxHighlighter Class ***
+// Concept: the Highlighter will be notified of all changes in the source
+// (notifyChange) and returns the caller the range of lines, which based on the
+// changes, need to be highlighted again. For this the Highlighter marks all
+// lines internally whether or not C comments begin or end.
+class COMPHELPER_DLLPUBLIC SyntaxHighlighter
+{
+ HighlighterLanguage eLanguage;
+ SimpleTokenizer_Impl* m_pSimpleTokenizer;
+ char* m_pKeyWords;
+ sal_uInt16 m_nKeyWordCount;
+
+// void initializeKeyWords( HighlighterLanguage eLanguage );
+
+public:
+ SyntaxHighlighter( void );
+ ~SyntaxHighlighter( void );
+
+ // (Re-)initialize Highlighter. The line-table will be completely erased,
+ // meaning that on completion an empty Source is assumed.
+ // notifyChange() can only be given line 0
+ void initialize( HighlighterLanguage eLanguage_ );
+
+ void notifyChange( sal_uInt32 nLine, sal_Int32 nLineCountDifference,
+ const OUString* pChangedLines, sal_uInt32 nArrayLength);
+
+ void getHighlightPortions( sal_uInt32 nLine, const OUString& rLine,
+ HighlightPortions& pPortions );
+
+ HighlighterLanguage GetLanguage() { return eLanguage;}
+};
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/types.hxx b/include/comphelper/types.hxx
new file mode 100644
index 000000000000..66c6a9e0bcfb
--- /dev/null
+++ b/include/comphelper/types.hxx
@@ -0,0 +1,174 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _COMPHELPER_TYPES_HXX_
+#define _COMPHELPER_TYPES_HXX_
+
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include "comphelper/comphelperdllapi.h"
+#include "cppu/unotype.hxx"
+
+namespace com { namespace sun { namespace star { namespace awt {
+ struct FontDescriptor;
+} } } }
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ namespace staruno = ::com::sun::star::uno;
+ namespace starawt = ::com::sun::star::awt;
+ namespace starlang = ::com::sun::star::lang;
+
+ typedef staruno::Reference< staruno::XInterface > InterfaceRef;
+ typedef staruno::Sequence< OUString > StringSequence;
+
+ //-------------------------------------------------------------------------
+ /** compare the two given Anys
+ The comparison is deep, means if one of the Any's contains an Any which contains an Any ..., this is resolved <br/>
+ Other types recognized currently : FontDescriptor, ::com::sun::star::util::Date/Tim/DateTime, staruno::Sequence<sal_Int8>
+ */
+ COMPHELPER_DLLPUBLIC sal_Bool compare(const staruno::Any& rLeft, const staruno::Any& rRight);
+
+ //-------------------------------------------------------------------------
+ /** compare two FontDescriptor's
+ */
+ COMPHELPER_DLLPUBLIC sal_Bool operator ==(const starawt::FontDescriptor& _rLeft, const starawt::FontDescriptor& _rRight);
+ inline sal_Bool operator !=(const starawt::FontDescriptor& _rLeft, const starawt::FontDescriptor& _rRight)
+ {
+ return !(_rLeft == _rRight);
+ }
+
+ //-------------------------------------------------------------------------
+ /// returns sal_True if objects of the types given are "compatible"
+ COMPHELPER_DLLPUBLIC sal_Bool isAssignableFrom(const staruno::Type& _rAssignable, const staruno::Type& _rFrom);
+
+ //-------------------------------------------------------------------------
+ /** just a small shortcut ...
+ check if a type you have at hand at runtime is equal to another type you have at compile time
+ if all our compiler would accept function calls with explicit template arguments (like
+ isA<classFoo>(runtimeType)), we wouldn't need the second parameter. But unfortunally at
+ least the current solaris compiler doesn't allow this ....
+ So this function is nearly senseless ....
+ */
+ template <class TYPE>
+ sal_Bool isA(const staruno::Type& _rType, TYPE* pDummy)
+ {
+ return _rType.equals(cppu::getTypeFavourUnsigned(pDummy));
+ }
+
+ //-------------------------------------------------------------------------
+ /** check if a type you have at hand at runtime is equal to another type you have at compile time
+ same comment as for the other isA ....
+ */
+ template <class TYPE>
+ sal_Bool isA(const staruno::Any& _rVal, TYPE* pDummy)
+ {
+ return _rVal.getValueType().equals(
+ cppu::getTypeFavourUnsigned(pDummy));
+ }
+
+ //-------------------------------------------------------------------------
+ /** check if a type you have at hand at runtime is equal to another type you have at compile time
+ */
+ template <class TYPE>
+ sal_Bool isAReference(const staruno::Any& _rVal, TYPE*)
+ {
+ return _rVal.getValueType().equals(
+ cppu::getTypeFavourUnsigned(
+ static_cast<staruno::Reference<TYPE>*>(NULL)));
+ }
+
+ //-------------------------------------------------------------------------
+ /** ask the given object for an XComponent interface and dispose on it
+ */
+ template <class TYPE>
+ void disposeComponent(staruno::Reference<TYPE>& _rxComp)
+ {
+ staruno::Reference<starlang::XComponent> xComp(_rxComp, staruno::UNO_QUERY);
+ if (xComp.is())
+ {
+ xComp->dispose();
+ _rxComp = NULL;
+ }
+ }
+ //-------------------------------------------------------------------------
+ template <class TYPE>
+ sal_Bool getImplementation(TYPE*& _pObject, const staruno::Reference< staruno::XInterface >& _rxIFace)
+ {
+ _pObject = NULL;
+ staruno::Reference< starlang::XUnoTunnel > xTunnel(_rxIFace, staruno::UNO_QUERY);
+ if (xTunnel.is())
+ _pObject = reinterpret_cast< TYPE* >(xTunnel->getSomething(TYPE::getUnoTunnelImplementationId()));
+
+ return (_pObject != NULL);
+ }
+
+
+ //-------------------------------------------------------------------------
+ /** get a com::sun::star::awt::FontDescriptor that is fully initialized with
+ the XXX_DONTKNOW enum values (which isn't the case if you instantiate it
+ via the default constructor)
+ */
+ COMPHELPER_DLLPUBLIC starawt::FontDescriptor getDefaultFont();
+
+ /** examine a sequence for the <type scope="com.sun.star.uno">Type</type> of it's elements.
+ */
+ COMPHELPER_DLLPUBLIC staruno::Type getSequenceElementType(const staruno::Type& _rSequenceType);
+
+//=========================================================================
+//= replacement of the former UsrAny.getXXX methods
+
+ // may be used if you need the return value just as temporary, else it's may be too inefficient ....
+
+ // no, we don't use templates here. This would lead to a lot of implicit uses of the conversion methods,
+ // which would be difficult to trace ...
+
+ COMPHELPER_DLLPUBLIC sal_Int64 getINT64(const staruno::Any& _rAny);
+ COMPHELPER_DLLPUBLIC sal_Int32 getINT32(const staruno::Any& _rAny);
+ COMPHELPER_DLLPUBLIC sal_Int16 getINT16(const staruno::Any& _rAny);
+ COMPHELPER_DLLPUBLIC double getDouble(const staruno::Any& _rAny);
+ COMPHELPER_DLLPUBLIC float getFloat(const staruno::Any& _rAny);
+ COMPHELPER_DLLPUBLIC OUString getString(const staruno::Any& _rAny);
+ COMPHELPER_DLLPUBLIC sal_Bool getBOOL(const staruno::Any& _rAny);
+
+ COMPHELPER_DLLPUBLIC sal_Int32 getEnumAsINT32(const staruno::Any& _rAny) throw(starlang::IllegalArgumentException);
+
+//= replacement of some former UsrAny.setXXX methods - can be used with rvalues
+ inline void setBOOL(staruno::Any& _rAny, sal_Bool _b)
+ { _rAny.setValue(&_b, ::getBooleanCppuType()); }
+
+//= extension of ::cppu::makeAny()
+ inline staruno::Any makeBoolAny(sal_Bool _b)
+ { return staruno::Any(&_b, ::getBooleanCppuType()); }
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // _COMPHELPER_TYPES_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/uno3.hxx b/include/comphelper/uno3.hxx
new file mode 100644
index 000000000000..1b83c73f4f25
--- /dev/null
+++ b/include/comphelper/uno3.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 _COMPHELPER_UNO3_HXX_
+#define _COMPHELPER_UNO3_HXX_
+
+#include <osl/interlck.h>
+#include <rtl/instance.hxx>
+#include <comphelper/types.hxx>
+#include <com/sun/star/uno/XAggregation.hpp>
+#include <comphelper/sequence.hxx>
+#include <cppuhelper/typeprovider.hxx>
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+//=========================================================================
+
+ /// manipulate ref counts without calling acquire/release
+ inline oslInterlockedCount increment(oslInterlockedCount& _counter) { return osl_atomic_increment(&_counter); }
+ inline oslInterlockedCount decrement(oslInterlockedCount& _counter) { return osl_atomic_decrement(&_counter); }
+
+//=========================================================================
+
+ /** used for declaring UNO3-Defaults, i.e. acquire/release
+ */
+ #define DECLARE_UNO3_DEFAULTS(classname, baseclass) \
+ virtual void SAL_CALL acquire() throw() { baseclass::acquire(); } \
+ virtual void SAL_CALL release() throw() { baseclass::release(); } \
+ void SAL_CALL PUT_SEMICOLON_AT_THE_END()
+
+ /** used for declaring UNO3-Defaults, i.e. acquire/release if you want to forward all queryInterfaces to the base class,
+ (e.g. if you overload queryAggregation)
+ */
+ #define DECLARE_UNO3_AGG_DEFAULTS(classname, baseclass) \
+ virtual void SAL_CALL acquire() throw() { baseclass::acquire(); } \
+ virtual void SAL_CALL release() throw() { baseclass::release(); } \
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException) \
+ { return baseclass::queryInterface(_rType); } \
+ void SAL_CALL PUT_SEMICOLON_AT_THE_END()
+
+ /** Use this macro to forward XComponent methods to base class
+
+ When using the ::cppu::WeakComponentImplHelper base classes to
+ implement a UNO interface, a problem occurs when the interface
+ itself already derives from XComponent (like e.g. awt::XWindow
+ or awt::XControl): ::cppu::WeakComponentImplHelper is then
+ still abstract. Using this macro in the most derived class
+ definition provides overrides for the XComponent methods,
+ forwarding them to the given baseclass.
+
+ @param classname
+ Name of the class this macro is issued within
+
+ @param baseclass
+ Name of the baseclass that should have the XInterface methods
+ forwarded to - that's usually the WeakComponentImplHelperN base
+
+ @param implhelper
+ Name of the baseclass that should have the XComponent methods
+ forwarded to - in the case of the WeakComponentImplHelper,
+ that would be ::cppu::WeakComponentImplHelperBase
+ */
+ #define DECLARE_UNO3_XCOMPONENT_DEFAULTS(classname, baseclass, implhelper) \
+ virtual void SAL_CALL acquire() throw() { baseclass::acquire(); } \
+ virtual void SAL_CALL release() throw() { baseclass::release(); } \
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ implhelper::dispose(); \
+ } \
+ virtual void SAL_CALL addEventListener( \
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ implhelper::addEventListener(xListener); \
+ } \
+ virtual void SAL_CALL removeEventListener( \
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ implhelper::removeEventListener(xListener); \
+ } \
+ void SAL_CALL PUT_SEMICOLON_AT_THE_END()
+
+
+ /** Use this macro to forward XComponent methods to base class
+
+ When using the ::cppu::WeakComponentImplHelper base classes to
+ implement a UNO interface, a problem occurs when the interface
+ itself already derives from XComponent (like e.g. awt::XWindow
+ or awt::XControl): ::cppu::WeakComponentImplHelper is then
+ still abstract. Using this macro in the most derived class
+ definition provides overrides for the XComponent methods,
+ forwarding them to the given baseclass.
+
+ @param classname
+ Name of the class this macro is issued within
+
+ @param baseclass
+ Name of the baseclass that should have the XInterface methods
+ forwarded to - that's usually the WeakComponentImplHelperN base
+
+ @param implhelper
+ Name of the baseclass that should have the XComponent methods
+ forwarded to - in the case of the WeakComponentImplHelper,
+ that would be ::cppu::WeakComponentImplHelperBase
+ */
+ #define DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS(classname, baseclass, implhelper) \
+ virtual void SAL_CALL acquire() throw() { baseclass::acquire(); } \
+ virtual void SAL_CALL release() throw() { baseclass::release(); } \
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException) \
+ { return baseclass::queryInterface(_rType); } \
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ implhelper::dispose(); \
+ } \
+ virtual void SAL_CALL addEventListener( \
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ implhelper::addEventListener(xListener); \
+ } \
+ virtual void SAL_CALL removeEventListener( \
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ implhelper::removeEventListener(xListener); \
+ } \
+ void SAL_CALL PUT_SEMICOLON_AT_THE_END()
+
+
+ //=====================================================================
+ //= deriving from multiple XInterface-derived classes
+ //=====================================================================
+ //= forwarding/merging XInterface funtionality
+ //=====================================================================
+ #define DECLARE_XINTERFACE( ) \
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL acquire() throw(); \
+ virtual void SAL_CALL release() throw();
+
+ #define IMPLEMENT_FORWARD_REFCOUNT( classname, refcountbase ) \
+ void SAL_CALL classname::acquire() throw() { refcountbase::acquire(); } \
+ void SAL_CALL classname::release() throw() { refcountbase::release(); }
+
+ #define IMPLEMENT_FORWARD_XINTERFACE2( classname, refcountbase, baseclass2 ) \
+ IMPLEMENT_FORWARD_REFCOUNT( classname, refcountbase ) \
+ ::com::sun::star::uno::Any SAL_CALL classname::queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ ::com::sun::star::uno::Any aReturn = refcountbase::queryInterface( _rType ); \
+ if ( !aReturn.hasValue() ) \
+ aReturn = baseclass2::queryInterface( _rType ); \
+ return aReturn; \
+ }
+
+ #define IMPLEMENT_FORWARD_XINTERFACE3( classname, refcountbase, baseclass2, baseclass3 ) \
+ IMPLEMENT_FORWARD_REFCOUNT( classname, refcountbase ) \
+ ::com::sun::star::uno::Any SAL_CALL classname::queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ ::com::sun::star::uno::Any aReturn = refcountbase::queryInterface( _rType ); \
+ if ( !aReturn.hasValue() ) \
+ { \
+ aReturn = baseclass2::queryInterface( _rType ); \
+ if ( !aReturn.hasValue() ) \
+ aReturn = baseclass3::queryInterface( _rType ); \
+ } \
+ return aReturn; \
+ }
+
+ //=====================================================================
+ //= forwarding/merging XTypeProvider funtionality
+ //=====================================================================
+ #define DECLARE_XTYPEPROVIDER( ) \
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException); \
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException);
+
+ #define IMPLEMENT_GET_IMPLEMENTATION_ID( classname ) \
+ namespace \
+ { \
+ class the##classname##ImplementationId : public rtl::Static< ::cppu::OImplementationId, the##classname##ImplementationId> {}; \
+ } \
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL classname::getImplementationId( ) throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ return the##classname##ImplementationId::get().getImplementationId(); \
+ }
+
+ #define IMPLEMENT_FORWARD_XTYPEPROVIDER2( classname, baseclass1, baseclass2 ) \
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL classname::getTypes( ) throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ return ::comphelper::concatSequences( \
+ baseclass1::getTypes(), \
+ baseclass2::getTypes() \
+ ); \
+ } \
+ \
+ IMPLEMENT_GET_IMPLEMENTATION_ID( classname )
+
+ #define IMPLEMENT_FORWARD_XTYPEPROVIDER3( classname, baseclass1, baseclass2, baseclass3 ) \
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL classname::getTypes( ) throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ return ::comphelper::concatSequences( \
+ baseclass1::getTypes(), \
+ baseclass2::getTypes(), \
+ baseclass3::getTypes() \
+ ); \
+ } \
+ \
+ IMPLEMENT_GET_IMPLEMENTATION_ID( classname )
+
+//=========================================================================
+
+ /** ask for an iface of an aggregated object
+ usage:<br/>
+ Reference<XFoo> xFoo;<br/>
+ if (query_aggregation(xAggregatedObject, xFoo))<br/>
+ ....
+ */
+ template <class iface>
+ sal_Bool query_aggregation(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >& _rxAggregate, ::com::sun::star::uno::Reference<iface>& _rxOut)
+ {
+ _rxOut = static_cast<iface*>(NULL);
+ if (_rxAggregate.is())
+ {
+ ::com::sun::star::uno::Any aCheck = _rxAggregate->queryAggregation(
+ iface::static_type());
+ if (aCheck.hasValue())
+ _rxOut = *(::com::sun::star::uno::Reference<iface>*)aCheck.getValue();
+ }
+ return _rxOut.is();
+ }
+
+ /** ask for an iface of an object
+ usage:<br/>
+ Reference<XFoo> xFoo;<br/>
+ if (query_interface(xAnything, xFoo))<br/>
+ ....
+ */
+ template <class iface>
+ sal_Bool query_interface(const InterfaceRef& _rxObject, ::com::sun::star::uno::Reference<iface>& _rxOut)
+ {
+ _rxOut = static_cast<iface*>(NULL);
+ if (_rxObject.is())
+ {
+ ::com::sun::star::uno::Any aCheck = _rxObject->queryInterface(
+ iface::static_type());
+ if(aCheck.hasValue())
+ {
+ _rxOut = *(::com::sun::star::uno::Reference<iface>*)aCheck.getValue();
+ return _rxOut.is();
+ }
+ }
+ return sal_False;
+ }
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif // _COMPHELPER_UNO3_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/unwrapargs.hxx b/include/comphelper/unwrapargs.hxx
new file mode 100644
index 000000000000..c4885f3883d9
--- /dev/null
+++ b/include/comphelper/unwrapargs.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 COMPHELPER_UNWRAPARGS_HXX_INCLUDED
+#define COMPHELPER_UNWRAPARGS_HXX_INCLUDED
+
+#include "rtl/ustrbuf.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "boost/optional.hpp"
+#include "boost/preprocessor/cat.hpp"
+#include "boost/preprocessor/repetition.hpp"
+#include "boost/preprocessor/arithmetic/add.hpp"
+#include "cppu/unotype.hxx"
+
+namespace comphelper {
+
+//
+// generating helper functions to unwrap the service's argument sequence:
+//
+
+/// @internal
+namespace detail {
+
+template <typename T>
+inline void extract(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> const& seq,
+ sal_Int32 nArg, T & v,
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>
+ const& xErrorContext )
+{
+ if (nArg >= seq.getLength()) {
+ throw ::com::sun::star::lang::IllegalArgumentException(
+ OUString( "No such argument available!"),
+ xErrorContext, static_cast<sal_Int16>(nArg) );
+ }
+ if (! (seq[nArg] >>= v)) {
+ OUStringBuffer buf;
+ buf.append( "Cannot extract ANY { " );
+ buf.append( seq[nArg].getValueType().getTypeName() );
+ buf.append( " } to " );
+ buf.append( ::cppu::UnoType<T>::get().getTypeName() );
+ buf.append( static_cast<sal_Unicode>('!') );
+ throw ::com::sun::star::lang::IllegalArgumentException(
+ buf.makeStringAndClear(), xErrorContext,
+ static_cast<sal_Int16>(nArg) );
+ }
+}
+
+template <typename T>
+inline void extract(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> const& seq,
+ sal_Int32 nArg, ::boost::optional<T> & v,
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>
+ const& xErrorContext )
+{
+ if (nArg < seq.getLength()) {
+ T t;
+ extract( seq, nArg, t, xErrorContext );
+ v.reset( t );
+ }
+}
+
+} // namespace detail
+
+#define COMPHELPER_UNWRAPARGS_extract(z_, n_, unused_) \
+ detail::extract( seq, n_, BOOST_PP_CAT(v, n_), xErrorContext );
+#define COMPHELPER_UNWRAPARGS_args(z_, n_, unused_) \
+ BOOST_PP_CAT(T, n_) & BOOST_PP_CAT(v, n_)
+
+/** The following preprocessor repetitions generate functions like
+
+ <pre>
+ template <typename T0, typename T1, ...>
+ inline void unwrapArgs(
+ uno::Sequence<uno::Any> const& seq,
+ T0 & v0, T1 & v1, ...,
+ css::uno::Reference<css::uno::XInterface> const& xErrorContext =
+ css::uno::Reference<css::uno::XInterface>() );
+ </pre>
+ (full namespace qualification ::com::sun::star has been omitted
+ for brevity)
+
+ which unwraps the passed sequence's elements, assigning them to the
+ referenced values. Specify optional arguments as boost::optional<T>.
+ If the length of the sequence is greater than the count of arguments,
+ then the latter sequence elements are ignored.
+ If too few arguments are given in the sequence and a missing argument is
+ no boost::optional<T>, then an lang::IllegalArgumentException is thrown
+ with the specified xErrorContext (defaults to null-ref).
+
+ The maximum number of service declarations can be set by defining
+ COMPHELPER_UNWRAPARGS_MAX_ARGS; its default is 12.
+*/
+#define COMPHELPER_UNWRAPARGS_make(z_, n_, unused_) \
+template < BOOST_PP_ENUM_PARAMS( BOOST_PP_ADD(n_, 1), typename T) > \
+inline void unwrapArgs( \
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > const& seq, \
+ BOOST_PP_ENUM(BOOST_PP_ADD(n_, 1), COMPHELPER_UNWRAPARGS_args, ~), \
+ ::com::sun::star::uno::Reference< \
+ ::com::sun::star::uno::XInterface> const& xErrorContext = \
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>() ) \
+{ \
+ BOOST_PP_REPEAT(BOOST_PP_ADD(n_, 1), COMPHELPER_UNWRAPARGS_extract, ~) \
+}
+
+#ifndef COMPHELPER_UNWRAPARGS_MAX_ARGS
+#define COMPHELPER_UNWRAPARGS_MAX_ARGS 12
+#endif
+
+BOOST_PP_REPEAT(COMPHELPER_UNWRAPARGS_MAX_ARGS, COMPHELPER_UNWRAPARGS_make, ~)
+
+#undef COMPHELPER_UNWRAPARGS_MAX_ARGS
+#undef COMPHELPER_UNWRAPARGS_make
+#undef COMPHELPER_UNWRAPARGS_args
+#undef COMPHELPER_UNWRAPARGS_extract
+
+} // namespace comphelper
+
+#endif // ! defined(COMPHELPER_UNWRAPARGS_HXX_INCLUDED)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/weak.hxx b/include/comphelper/weak.hxx
new file mode 100644
index 000000000000..126078adbf59
--- /dev/null
+++ b/include/comphelper/weak.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 _COMPHELPER_WEAK_HXX_
+#define _COMPHELPER_WEAK_HXX_
+
+#include "comphelper/comphelperdllapi.h"
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <cppuhelper/weak.hxx>
+
+namespace comphelper
+{
+/** Base class to implement an UNO object supporting types and weak references, i.e. the object can be held
+ weakly (by a ::com::sun::star::uno::WeakReference).
+ This implementation copes with reference counting. Upon last release(), the virtual dtor
+ is called.
+
+ In addition to the features from cppu::OWeakObject, derivations from this class can
+ also used as a base class for ::cppu::ImplInheritanceHelper?
+*/
+class COMPHELPER_DLLPUBLIC OWeakTypeObject : public ::cppu::OWeakObject, public ::com::sun::star::lang::XTypeProvider
+{
+public:
+ OWeakTypeObject();
+ virtual ~OWeakTypeObject();
+
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException);
+
+};
+
+}
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/weakbag.hxx b/include/comphelper/weakbag.hxx
new file mode 100644
index 000000000000..b654baa2bda4
--- /dev/null
+++ b/include/comphelper/weakbag.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_COMPHELPER_WEAKBAG_HXX
+#define INCLUDED_COMPHELPER_WEAKBAG_HXX
+
+#include "sal/config.h"
+
+#include <list>
+#include "com/sun/star/uno/Reference.hxx"
+#include "cppuhelper/weakref.hxx"
+#include "osl/diagnose.h"
+
+namespace comphelper {
+
+/**
+ A bag of UNO weak references.
+*/
+template< typename T > class WeakBag {
+public:
+ /**
+ Add a new weak reference.
+
+ The implementation keeps the amount of memory consumed linear in the
+ number of living references added, not linear in the number of total
+ references added.
+
+ @param e
+ a non-null reference.
+ */
+ void add(com::sun::star::uno::Reference< T > const & e) {
+ OSL_ASSERT(e.is());
+ for (typename WeakReferenceList::iterator i(m_list.begin()); i != m_list.end();) {
+ if (com::sun::star::uno::Reference< T >(*i).is()) {
+ ++i;
+ } else {
+ i = m_list.erase(i);
+ }
+ }
+ m_list.push_back(com::sun::star::uno::WeakReference< T >(e));
+ }
+
+ /**
+ Remove a living reference.
+
+ @return
+ a living reference, or null if there are none.
+ */
+ com::sun::star::uno::Reference< T > remove() {
+ while (!m_list.empty()) {
+ com::sun::star::uno::Reference< T > r(m_list.front());
+ m_list.pop_front();
+ if (r.is()) {
+ return r;
+ }
+ }
+ return com::sun::star::uno::Reference< T >();
+ }
+
+private:
+ typedef std::list< com::sun::star::uno::WeakReference< T > > WeakReferenceList;
+
+ WeakReferenceList m_list;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/weakeventlistener.hxx b/include/comphelper/weakeventlistener.hxx
new file mode 100644
index 000000000000..33defc8a36c9
--- /dev/null
+++ b/include/comphelper/weakeventlistener.hxx
@@ -0,0 +1,182 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COMPHELPER_WEAKEVENTLISTENER_HXX
+#define COMPHELPER_WEAKEVENTLISTENER_HXX
+
+#include <cppuhelper/compbase1.hxx>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/uno/XWeak.hpp>
+#include <cppuhelper/weakref.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include "comphelper/comphelperdllapi.h"
+
+//.........................................................................
+namespace comphelper
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OWeakListenerAdapterBase
+ //=====================================================================
+ /** (the base for) an adapter which allows to add as listener to a foreign component, without
+ being held hard.
+
+ <p>The idea is that this adapter is added as listener to a foreign component, which usually
+ holds it's listener hard. The adapter itself knows the real listener as weak reference,
+ thus not affecting it's life time.</p>
+ */
+ class OWeakListenerAdapterBase : public OBaseMutex
+ {
+ private:
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface >
+ m_aListener;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ m_xBroadcaster;
+
+ protected:
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ getListener( ) const
+ {
+ return m_aListener.get();
+ }
+
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >&
+ getBroadcaster( ) const
+ {
+ return m_xBroadcaster;
+ }
+
+ inline void resetListener( )
+ {
+ m_aListener.clear();
+ }
+
+
+ protected:
+ inline OWeakListenerAdapterBase(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XWeak >& _rxListener,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxBroadcaster
+ )
+ :m_aListener ( _rxListener )
+ ,m_xBroadcaster ( _rxBroadcaster )
+ {
+ }
+
+ protected:
+ virtual ~OWeakListenerAdapterBase();
+ };
+
+
+ //=====================================================================
+ //= OWeakListenerAdapter
+ //=====================================================================
+ template< class BROADCASTER, class LISTENER >
+ /** yet another base for weak listener adapters, this time with some type safety
+
+ <p>Note that derived classes need to overwrite all virtual methods of their interface
+ except XEventListener::disposing, and forward it to their master listener.</p>
+
+ <p>Addtionally, derived classes need to add themself as listener to the broadcaster,
+ as this can't be done in a generic way</p>
+ */
+ class OWeakListenerAdapter
+ :public ::cppu::WeakComponentImplHelper1 < LISTENER >
+ ,public OWeakListenerAdapterBase
+ {
+ protected:
+ /** ctor
+ <p>Note that derived classes still need to add themself as listener to the broadcaster,
+ as this can't be done in a generic way</p>
+ */
+ OWeakListenerAdapter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XWeak >& _rxListener,
+ const ::com::sun::star::uno::Reference< BROADCASTER >& _rxBroadcaster
+ );
+
+ protected:
+ inline ::com::sun::star::uno::Reference< LISTENER > getListener( ) const
+ {
+ return ::com::sun::star::uno::Reference< LISTENER >( OWeakListenerAdapterBase::getListener(), ::com::sun::star::uno::UNO_QUERY );
+ }
+
+ // XEventListener overridables
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ // OComponentHelper overridables
+ // to be overridden, again - the derived class should revoke the listener from the broadcaster
+ virtual void SAL_CALL disposing( ) = 0;
+ };
+
+ //=====================================================================
+ //= OWeakEventListenerAdapter
+ //=====================================================================
+ typedef OWeakListenerAdapter < ::com::sun::star::lang::XComponent
+ , ::com::sun::star::lang::XEventListener
+ > OWeakEventListenerAdapter_Base;
+ /** the most simple listener adapter: for XEventListeners at XComponents
+ */
+ class COMPHELPER_DLLPUBLIC OWeakEventListenerAdapter : public OWeakEventListenerAdapter_Base
+ {
+ public:
+ OWeakEventListenerAdapter(
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XWeak > _rxListener,
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > _rxBroadcaster
+ );
+
+ // nothing to do except an own ctor - the forwarding of the "disposing" is already done
+ // in the base class
+
+ protected:
+ using OWeakEventListenerAdapter_Base::disposing;
+ virtual void SAL_CALL disposing( );
+ };
+
+ //=====================================================================
+ //= OWeakListenerAdapter
+ //=====================================================================
+ //---------------------------------------------------------------------
+ template< class BROADCASTER, class LISTENER >
+ OWeakListenerAdapter< BROADCASTER, LISTENER >::OWeakListenerAdapter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XWeak >& _rxListener,
+ const ::com::sun::star::uno::Reference< BROADCASTER >& _rxBroadcaster
+ )
+ : ::cppu::WeakComponentImplHelper1< LISTENER >( m_aMutex )
+ , OWeakListenerAdapterBase( _rxListener, _rxBroadcaster )
+ {
+ }
+
+ //---------------------------------------------------------------------
+ template< class BROADCASTER, class LISTENER >
+ void SAL_CALL OWeakListenerAdapter< BROADCASTER, LISTENER >::disposing( const ::com::sun::star::lang::EventObject& _rSource ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::com::sun::star::uno::Reference< LISTENER > xListener( getListener() );
+ if ( xListener.is() )
+ xListener->disposing( _rSource );
+ }
+
+//.........................................................................
+} // namespace comphelper
+//.........................................................................
+
+#endif// COMPHELPER_WEAKEVENTLISTENER_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/xmltools.hxx b/include/comphelper/xmltools.hxx
new file mode 100644
index 000000000000..d8287dd4a89b
--- /dev/null
+++ b/include/comphelper/xmltools.hxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 _XMLCHAFF_HXX
+#define _XMLCHAFF_HXX
+
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <comphelper/comphelperdllapi.h>
+
+namespace comphelper
+{
+ namespace xml
+ {
+ COMPHELPER_DLLPUBLIC OString makeXMLChaff();
+ }
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/BlobHelper.hxx b/include/connectivity/BlobHelper.hxx
new file mode 100644
index 000000000000..6788a17b10df
--- /dev/null
+++ b/include/connectivity/BlobHelper.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 _CONNECTIVITY_BLOBHELPER_HXX_
+#define _CONNECTIVITY_BLOBHELPER_HXX_
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <com/sun/star/sdbc/XBlob.hpp>
+#include <cppuhelper/implbase1.hxx>
+
+namespace connectivity
+{
+ class OOO_DLLPUBLIC_DBTOOLS BlobHelper : public ::cppu::WeakImplHelper1< com::sun::star::sdbc::XBlob >
+ {
+ ::com::sun::star::uno::Sequence< sal_Int8 > m_aValue;
+ public:
+ BlobHelper(const ::com::sun::star::uno::Sequence< sal_Int8 >& _val);
+ private:
+ virtual ::sal_Int64 SAL_CALL length( ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getBytes( ::sal_Int64 pos, ::sal_Int32 length ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int64 SAL_CALL position( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& pattern, ::sal_Int64 start ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int64 SAL_CALL positionOfBlob( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& pattern, ::sal_Int64 start ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ };
+}
+
+#endif //_CONNECTIVITY_BLOBHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/CommonTools.hxx b/include/connectivity/CommonTools.hxx
new file mode 100644
index 000000000000..c13b97dc7050
--- /dev/null
+++ b/include/connectivity/CommonTools.hxx
@@ -0,0 +1,215 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _CONNECTIVITY_COMMONTOOLS_HXX_
+#define _CONNECTIVITY_COMMONTOOLS_HXX_
+
+#include <rtl/ref.hxx>
+#include <rtl/ustring.hxx>
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/uno/Any.hxx>
+#ifndef _VECTOR_
+#include <vector>
+#endif
+#include <cppuhelper/weakref.hxx>
+#include <comphelper/stl_types.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <osl/interlck.h>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace com { namespace sun { namespace star { namespace util {
+ struct Date;
+ struct DateTime;
+ struct Time;
+}
+}}}
+
+#ifdef SOLAR_JAVA
+namespace jvmaccess { class VirtualMachine; }
+#endif
+
+namespace connectivity
+{
+ //------------------------------------------------------------------------------
+ OOO_DLLPUBLIC_DBTOOLS sal_Bool match(const sal_Unicode* pWild, const sal_Unicode* pStr, const sal_Unicode cEscape);
+ inline sal_Bool match(const OUString &rWild, const OUString &rStr, const sal_Unicode cEscape)
+ {
+ return match(rWild.getStr(), rStr.getStr(), cEscape);
+ }
+ //------------------------------------------------------------------------------
+ OOO_DLLPUBLIC_DBTOOLS OUString toDateString(const ::com::sun::star::util::Date& rDate);
+ OOO_DLLPUBLIC_DBTOOLS OUString toTimeString(const ::com::sun::star::util::Time& rTime);
+ OOO_DLLPUBLIC_DBTOOLS OUString toDateTimeString(const ::com::sun::star::util::DateTime& rDateTime);
+
+ // typedefs
+ typedef std::vector< ::com::sun::star::uno::WeakReferenceHelper > OWeakRefArray;
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> OSQLTable;
+
+ DECLARE_STL_MAP(OUString,OSQLTable,comphelper::UStringMixLess, OSQLTables);
+
+ // -------------------------------------------------------------------------
+ // class ORefVector allows reference counting on a std::vector
+ // -------------------------------------------------------------------------
+ template< class VectorVal > class ORefVector
+ {
+ std::vector< VectorVal > m_vector;
+ oslInterlockedCount m_refCount;
+
+ protected:
+ virtual ~ORefVector(){}
+ public:
+ typedef std::vector< VectorVal > Vector;
+
+ ORefVector() : m_refCount(0) {}
+ ORefVector(size_t _st) : m_vector(_st) , m_refCount(0) {}
+ ORefVector(const ORefVector& _rRH) : m_vector(_rRH.m_vector),m_refCount(0)
+ {
+ }
+ ORefVector& operator=(const ORefVector& _rRH)
+ {
+ if ( &_rRH != this )
+ {
+ m_vector = _rRH.m_vector;
+ }
+ return *this;
+ }
+
+ std::vector< VectorVal > & get() { return m_vector; }
+ std::vector< VectorVal > const & get() const { return m_vector; }
+
+ inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
+ { return ::rtl_allocateMemory( nSize ); }
+ inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
+ { ::rtl_freeMemory( pMem ); }
+ inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW(())
+ { return pMem; }
+ inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW(())
+ {}
+
+ void acquire()
+ {
+ osl_atomic_increment( &m_refCount );
+ }
+ void release()
+ {
+ if (! osl_atomic_decrement( &m_refCount ))
+ delete this;
+ }
+
+ };
+ // -------------------------------------------------------------------------
+ // class ORowVector incudes refcounting and initialze himself
+ // with at least one element. This first element is reserved for
+ // the bookmark
+ // -------------------------------------------------------------------------
+ template< class VectorVal > class ORowVector : public ORefVector< VectorVal >
+ {
+ public:
+ ORowVector() : ORefVector< VectorVal >(1){}
+ ORowVector(size_t _st) : ORefVector< VectorVal >(_st+1)
+ {}
+ };
+
+ typedef ORefVector< ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> > OSQLColumns;
+
+ // =======================================================================================
+ // search from __first to __last the column with the name _rVal
+ // when no such column exist __last is returned
+ OOO_DLLPUBLIC_DBTOOLS
+ OSQLColumns::Vector::const_iterator find( OSQLColumns::Vector::const_iterator __first,
+ OSQLColumns::Vector::const_iterator __last,
+ const OUString& _rVal,
+ const ::comphelper::UStringMixEqual& _rCase);
+ // =======================================================================================
+ // search from __first to __last the column with the realname _rVal
+ // when no such column exist __last is returned
+ OOO_DLLPUBLIC_DBTOOLS
+ OSQLColumns::Vector::const_iterator findRealName( OSQLColumns::Vector::const_iterator __first,
+ OSQLColumns::Vector::const_iterator __last,
+ const OUString& _rVal,
+ const ::comphelper::UStringMixEqual& _rCase);
+
+ // =======================================================================================
+ // the first two find methods are much faster than the one below
+ // =======================================================================================
+ // search from __first to __last the column with the property _rProp equals the value _rVal
+ // when no such column exist __last is returned
+ OOO_DLLPUBLIC_DBTOOLS
+ OSQLColumns::Vector::const_iterator find( OSQLColumns::Vector::const_iterator __first,
+ OSQLColumns::Vector::const_iterator __last,
+ const OUString& _rProp,
+ const OUString& _rVal,
+ const ::comphelper::UStringMixEqual& _rCase);
+
+ OOO_DLLPUBLIC_DBTOOLS void checkDisposed(sal_Bool _bThrow) throw ( ::com::sun::star::lang::DisposedException );
+
+#ifdef SOLAR_JAVA
+ /** creates a java virtual machine
+ @param _rxContext
+ The ORB.
+ @return
+ The JavaVM.
+ */
+ OOO_DLLPUBLIC_DBTOOLS ::rtl::Reference< jvmaccess::VirtualMachine > getJavaVM(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext);
+
+ /** return <TRUE/> if the java class exists, otherwise <FALSE/>.
+ @param _pJVM
+ The JavaVM.
+ @param _sClassName
+ The class name to look for.
+ */
+ OOO_DLLPUBLIC_DBTOOLS sal_Bool existsJavaClassByName( const ::rtl::Reference< jvmaccess::VirtualMachine >& _pJVM,const OUString& _sClassName );
+#endif
+}
+
+//==================================================================================
+
+#define DECLARE_SERVICE_INFO() \
+ virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); \
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); \
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \
+
+#define IMPLEMENT_SERVICE_INFO(classname, implasciiname, serviceasciiname) \
+ OUString SAL_CALL classname::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ return OUString::createFromAscii(implasciiname); \
+ } \
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL classname::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \
+ { \
+ ::com::sun::star::uno::Sequence< OUString > aSupported(1); \
+ aSupported[0] = OUString::createFromAscii(serviceasciiname); \
+ return aSupported; \
+ } \
+ sal_Bool SAL_CALL classname::supportsService( const OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) \
+ { \
+ Sequence< OUString > aSupported(getSupportedServiceNames()); \
+ const OUString* pSupported = aSupported.getConstArray(); \
+ const OUString* pEnd = pSupported + aSupported.getLength(); \
+ for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) \
+ ; \
+ \
+ return pSupported != pEnd; \
+ } \
+
+//==================================================================================
+
+#endif // _CONNECTIVITY_COMMONTOOLS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/ConnectionWrapper.hxx b/include/connectivity/ConnectionWrapper.hxx
new file mode 100644
index 000000000000..84a828800a9c
--- /dev/null
+++ b/include/connectivity/ConnectionWrapper.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 _CONNECTIVITY_ZCONNECTIONWRAPPER_HXX_
+#define _CONNECTIVITY_ZCONNECTIONWRAPPER_HXX_
+
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <comphelper/broadcasthelper.hxx>
+#include "connectivity/CommonTools.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+
+ //==========================================================================
+ //= OConnectionWrapper - wraps all methods to the real connection from the driver
+ //= but when disposed it doesn't dispose the real connection
+ //==========================================================================
+ typedef ::cppu::ImplHelper2< ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XUnoTunnel
+ > OConnection_BASE;
+
+ class OOO_DLLPUBLIC_DBTOOLS OConnectionWrapper : public OConnection_BASE
+ {
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > m_xProxyConnection;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider > m_xTypeProvider;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > m_xUnoTunnel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo > m_xServiceInfo;
+
+ virtual ~OConnectionWrapper();
+ void setDelegation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >& _rxProxyConnection,oslInterlockedCount& _rRefCount);
+ void setDelegation(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext
+ ,oslInterlockedCount& _rRefCount);
+ // must be called from derived classes
+ void disposing();
+ public:
+ OConnectionWrapper( );
+
+ // XServiceInfo
+ DECLARE_SERVICE_INFO();
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // com::sun::star::lang::XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+ /** method to create unique ids
+ @param _rURL
+ The URL.
+ @param _rInfo
+ The info property of the datasource. It will be resorted if needed.
+ @param _pBuffer
+ Here we store the digest. Must not NULL.
+ @param _rUserName
+ The user name.
+ @param _rPassword
+ The password.
+ */
+ static void createUniqueId( const OUString& _rURL
+ ,::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo
+ ,sal_uInt8* _pBuffer
+ ,const OUString& _rUserName = OUString()
+ ,const OUString& _rPassword = OUString());
+ };
+}
+#endif // _CONNECTIVITY_ZCONNECTIONWRAPPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/DriversConfig.hxx b/include/connectivity/DriversConfig.hxx
new file mode 100644
index 000000000000..69c28cacbb02
--- /dev/null
+++ b/include/connectivity/DriversConfig.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 CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
+#define CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
+
+#include <comphelper/stl_types.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/uno/Sequence.h>
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <salhelper/singletonref.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <unotools/confignode.hxx>
+
+namespace connectivity
+{
+ typedef struct
+ {
+ ::comphelper::NamedValueCollection aProperties;
+ ::comphelper::NamedValueCollection aFeatures;
+ ::comphelper::NamedValueCollection aMetaData;
+ OUString sDriverFactory;
+ OUString sDriverTypeDisplayName;
+ } TInstalledDriver;
+ DECLARE_STL_USTRINGACCESS_MAP( TInstalledDriver, TInstalledDrivers);
+
+ class DriversConfigImpl
+ {
+ mutable ::utl::OConfigurationTreeRoot m_aInstalled;
+ mutable TInstalledDrivers m_aDrivers;
+ void Load(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB) const;
+ public:
+ DriversConfigImpl();
+
+ const TInstalledDrivers& getInstalledDrivers(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB) const { Load(_rxORB); return m_aDrivers; }
+ };
+ //
+ // Allows to access all driver which are located in the configuration
+ //
+ class OOO_DLLPUBLIC_DBTOOLS DriversConfig
+ {
+ typedef salhelper::SingletonRef<DriversConfigImpl> OSharedConfigNode;
+
+ const ::comphelper::NamedValueCollection& impl_get(const OUString& _sURL,sal_Int32 _nProps) const;
+ public:
+ DriversConfig(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB);
+ ~DriversConfig();
+
+ DriversConfig( const DriversConfig& );
+ DriversConfig& operator=( const DriversConfig& );
+
+ OUString getDriverFactoryName(const OUString& _sUrl) const;
+ OUString getDriverTypeDisplayName(const OUString& _sUrl) const;
+ const ::comphelper::NamedValueCollection& getProperties(const OUString& _sURL) const;
+ const ::comphelper::NamedValueCollection& getFeatures(const OUString& _sURL) const;
+ const ::comphelper::NamedValueCollection& getMetaData(const OUString& _sURL) const;
+ ::com::sun::star::uno::Sequence< OUString > getURLs() const;
+ private:
+ OSharedConfigNode m_aNode;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xORB;
+ };
+}
+#endif // CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/FValue.hxx b/include/connectivity/FValue.hxx
new file mode 100644
index 000000000000..34e73612bfa1
--- /dev/null
+++ b/include/connectivity/FValue.hxx
@@ -0,0 +1,539 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CONNECTIVITY_FILE_VALUE_HXX_
+#define _CONNECTIVITY_FILE_VALUE_HXX_
+
+#include <com/sun/star/sdbc/DataType.hpp>
+#include <com/sun/star/uno/Any.hxx>
+#include <rtl/ustring.hxx>
+#include <salhelper/simplereferenceobject.hxx>
+#include <osl/diagnose.h>
+#include <comphelper/stl_types.hxx>
+#include <rtl/ref.hxx>
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/CommonTools.hxx"
+#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/util/Time.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/sdb/XColumn.hpp>
+
+namespace connectivity
+{
+ namespace detail
+ {
+ class IValueSource;
+ }
+
+ class OOO_DLLPUBLIC_DBTOOLS ORowSetValue
+ {
+ union
+ {
+ bool m_bBool;
+
+ sal_Int8 m_nInt8;
+ sal_uInt8 m_uInt8;
+
+ sal_Int16 m_nInt16;
+ sal_uInt16 m_uInt16;
+
+ sal_Int32 m_nInt32;
+ sal_uInt32 m_uInt32;
+
+ sal_Int64 m_nInt64;
+ sal_uInt64 m_uInt64;
+
+ float m_nFloat;
+ double m_nDouble;
+
+ rtl_uString* m_pString;
+
+ void* m_pValue; // date/time/timestamp/sequence
+ } m_aValue;
+
+ sal_Int32 m_eTypeKind; // the database type
+ bool m_bNull : 1; // value is null
+ bool m_bBound : 1; // is bound
+ bool m_bModified : 1; // value was changed
+ bool m_bSigned : 1; // value is signed
+
+ void free();
+
+ public:
+ ORowSetValue()
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::VARCHAR)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ }
+
+ ORowSetValue(const ORowSetValue& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::VARCHAR)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+
+ ORowSetValue(const OUString& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::VARCHAR)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+
+ ORowSetValue(const double& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::DOUBLE)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+
+ ORowSetValue(const float& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::FLOAT)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+
+ ORowSetValue(const sal_Int8& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::TINYINT)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+
+ ORowSetValue(const sal_uInt8& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::TINYINT)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(false)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+ ORowSetValue(const sal_Int16& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::SMALLINT)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+ ORowSetValue(const sal_uInt16& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::SMALLINT)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(false)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+ ORowSetValue(const sal_Int32& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::INTEGER)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+ ORowSetValue(const sal_uInt32& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::INTEGER)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(false)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+ ORowSetValue(const sal_Int64& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::BIGINT)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+ ORowSetValue(const sal_uInt64& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::BIGINT)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(false)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+
+ ORowSetValue(const bool& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::BIT)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+
+ ORowSetValue(const ::com::sun::star::util::Date& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::DATE)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+
+ ORowSetValue(const ::com::sun::star::util::Time& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::TIME)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+
+ ORowSetValue(const ::com::sun::star::util::DateTime& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::TIMESTAMP)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+
+ ORowSetValue(const ::com::sun::star::uno::Sequence<sal_Int8>& _rRH)
+ :m_eTypeKind(::com::sun::star::sdbc::DataType::LONGVARBINARY)
+ ,m_bNull(true)
+ ,m_bBound(true)
+ ,m_bModified(false)
+ ,m_bSigned(true)
+ {
+ m_aValue.m_pString = NULL;
+ operator=(_rRH);
+ }
+
+ ~ORowSetValue()
+ {
+ free();
+ }
+
+ inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
+ { return ::rtl_allocateMemory( nSize ); }
+ inline static void * SAL_CALL operator new( size_t,void* _pHint ) SAL_THROW(())
+ { return _pHint; }
+ inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
+ { ::rtl_freeMemory( pMem ); }
+ inline static void SAL_CALL operator delete( void *,void* ) SAL_THROW(())
+ { }
+
+ ORowSetValue& operator=(const ORowSetValue& _rRH);
+
+ // simple types
+ ORowSetValue& operator=(const bool _rRH);
+
+ ORowSetValue& operator=(const sal_Int8& _rRH);
+ ORowSetValue& operator=(const sal_uInt8& _rRH);
+
+ ORowSetValue& operator=(const sal_Int16& _rRH);
+ ORowSetValue& operator=(const sal_uInt16& _rRH);
+
+ ORowSetValue& operator=(const sal_Int32& _rRH);
+ ORowSetValue& operator=(const sal_uInt32& _rRH);
+
+ ORowSetValue& operator=(const sal_Int64& _rRH);
+ ORowSetValue& operator=(const sal_uInt64& _rRH);
+
+ ORowSetValue& operator=(const double& _rRH);
+ ORowSetValue& operator=(const float& _rRH);
+
+ // ADT's
+ ORowSetValue& operator=(const ::com::sun::star::util::Date& _rRH);
+ ORowSetValue& operator=(const ::com::sun::star::util::Time& _rRH);
+ ORowSetValue& operator=(const ::com::sun::star::util::DateTime& _rRH);
+
+ ORowSetValue& operator=(const OUString& _rRH);
+ // the type isn't set it will be set to VARCHAR if the type is different change it
+ ORowSetValue& operator=(const ::com::sun::star::uno::Sequence<sal_Int8>& _rRH);
+ // we the possiblity to save a any for bookmarks
+ ORowSetValue& operator=(const ::com::sun::star::uno::Any& _rAny);
+
+ operator bool() const { return isNull() ? false : getBool(); }
+ operator sal_Int8() const { return isNull() ? static_cast<sal_Int8>(0) : getInt8(); }
+ operator sal_uInt8() const { return isNull() ? static_cast<sal_uInt8>(0) : getUInt8(); }
+
+ operator sal_Int16() const { return isNull() ? static_cast<sal_Int16>(0) : getInt16(); }
+ operator sal_uInt16() const { return isNull() ? static_cast<sal_uInt16>(0) : getUInt16(); }
+
+ operator sal_Int32() const { return isNull() ? 0 : getInt32(); }
+ operator sal_uInt32() const { return isNull() ? 0 : getUInt32(); }
+
+ operator sal_Int64() const { return isNull() ? 0 : getLong(); }
+ operator sal_uInt64() const { return isNull() ? 0 : getULong(); }
+
+ operator float() const { return isNull() ? (float)0.0: getFloat(); }
+ operator double() const { return isNull() ? 0.0 : getDouble(); }
+
+ operator OUString() const
+ {
+ return isNull() ? OUString() : getString();
+ }
+
+ operator ::com::sun::star::util::Date() const
+ {
+ return isNull() ? ::com::sun::star::util::Date() : getDate();
+ }
+
+ operator ::com::sun::star::util::Time() const
+ {
+ return isNull() ? ::com::sun::star::util::Time() : getTime();
+ }
+
+ operator ::com::sun::star::util::DateTime() const
+ {
+ return isNull() ? ::com::sun::star::util::DateTime() : getDateTime();
+ }
+
+ operator ::com::sun::star::uno::Sequence<sal_Int8>() const
+ {
+ return isNull() ? ::com::sun::star::uno::Sequence<sal_Int8>() : getSequence();
+ }
+
+ bool operator==(const ORowSetValue& _rRH) const;
+ bool operator!=(const ORowSetValue& _rRH) const
+ {
+ return !( *this == _rRH );
+ }
+
+ bool isNull() const
+ {
+ return m_bNull;
+ }
+ void setNull()
+ {
+ free();
+ m_bNull = true;
+ m_aValue.m_pString = NULL;
+ }
+
+ bool isBound() const { return m_bBound; }
+ void setBound(bool _bBound) { m_bBound = _bBound ? 1 : 0; }
+
+ bool isModified() const { return m_bModified; }
+ void setModified(bool _bMod=true) { m_bModified = _bMod ? 1 : 0; }
+
+ bool isSigned() const { return m_bSigned; }
+ void setSigned(bool _bSig=true);
+
+ sal_Int32 getTypeKind() const { return m_eTypeKind; }
+ void setTypeKind(sal_Int32 _eType);
+
+ // before calling one of this methods, be sure that the value is not null
+ void* getValue() const { OSL_ENSURE(m_bBound,"Value is not bound!");return m_aValue.m_pValue; }
+ bool getBool() const;
+
+ sal_Int8 getInt8() const;
+ sal_uInt8 getUInt8() const;
+
+ sal_Int16 getInt16() const;
+ sal_uInt16 getUInt16() const;
+
+ sal_Int32 getInt32() const;
+ sal_uInt32 getUInt32() const;
+
+ sal_Int64 getLong() const;
+ sal_uInt64 getULong() const;
+
+ double getDouble() const;
+ float getFloat() const;
+
+ OUString getString() const; // makes a automatic conversion if type isn't a string
+ ::com::sun::star::util::Date getDate() const;
+ ::com::sun::star::util::Time getTime() const;
+ ::com::sun::star::util::DateTime getDateTime() const;
+ ::com::sun::star::uno::Sequence<sal_Int8> getSequence() const;
+ // only use for anys
+ ::com::sun::star::uno::Any getAny() const { return *(::com::sun::star::uno::Any*)m_aValue.m_pValue; }
+ ::com::sun::star::uno::Any makeAny() const;
+
+ /**
+ fetches a single value out of the row
+ @param _nPos the current column position
+ @param _nType the type of the current column
+ @param _xRow the row where to fetch the data from
+ */
+ void fill(sal_Int32 _nPos,
+ sal_Int32 _nType,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow);
+
+ /**
+ fetches a single value out of the row
+ @param _nPos the current column position
+ @param _nType the type of the current column
+ @param _bNullable if true then it will be checked if the result could be NULL, otherwise not.
+ @param _xRow the row where to fetch the data from
+ */
+ void fill(sal_Int32 _nPos,
+ sal_Int32 _nType,
+ bool _bNullable,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow);
+
+ void fill(const ::com::sun::star::uno::Any& _rValue);
+
+ void fill( const sal_Int32 _nType,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn );
+
+ private:
+ void impl_fill( const sal_Int32 _nType, bool _bNullable, const detail::IValueSource& _rValueSource );
+ };
+
+ /// ORowSetValueDecorator decorates a ORowSetValue so the value is "refcounted"
+ class OOO_DLLPUBLIC_DBTOOLS ORowSetValueDecorator : public ::salhelper::SimpleReferenceObject
+ {
+ ORowSetValue m_aValue; // my own value
+ public:
+ ORowSetValueDecorator(){m_aValue.setBound(true);}
+ ORowSetValueDecorator(const ORowSetValue& _aValue) : m_aValue(_aValue){m_aValue.setBound(true);}
+ ORowSetValueDecorator& operator=(const ORowSetValue& _aValue);
+
+ inline operator const ORowSetValue&() const { return m_aValue; }
+ inline bool operator ==( const ORowSetValue & _rRH ) { return m_aValue == _rRH; }
+ inline const ORowSetValue& getValue() const { return m_aValue; }
+ inline ORowSetValue& get() { return m_aValue; }
+ inline void setValue(const ORowSetValue& _aValue) { m_aValue = _aValue; }
+ inline void setNull() { m_aValue.setNull(); }
+ inline void setBound(bool _bBound ) { m_aValue.setBound(_bBound);}
+ inline bool isBound( ) const { return m_aValue.isBound();}
+ inline void setTypeKind(sal_Int32 _nType) { m_aValue.setTypeKind(_nType); }
+ inline void setModified(bool _bModified) { m_aValue.setModified(_bModified); }
+
+ };
+ typedef ::rtl::Reference<ORowSetValueDecorator> ORowSetValueDecoratorRef;
+
+ // -------------------------------------------------------------------------
+ /// TSetBound is a unary_function to set the bound value with e.q. for_each call
+ struct OOO_DLLPUBLIC_DBTOOLS TSetBound : ::std::unary_function<ORowSetValue,void>
+ {
+ bool m_bBound;
+ TSetBound(bool _bBound) : m_bBound(_bBound){}
+ void operator()(ORowSetValue& _rValue) const { _rValue.setBound(m_bBound); }
+
+ };
+
+ // -------------------------------------------------------------------------
+ /// TSetBound is a unary_function to set the bound value with e.q. for_each call
+ struct OOO_DLLPUBLIC_DBTOOLS TSetRefBound : ::std::unary_function<ORowSetValueDecoratorRef,void>
+ {
+ bool m_bBound;
+ TSetRefBound(bool _bBound) : m_bBound(_bBound){}
+ void operator()(ORowSetValueDecoratorRef& _rValue) const { _rValue->setBound(m_bBound); }
+
+ };
+
+ // ----------------------------------------------------------------------------
+ // Vector for file based rows
+ // ----------------------------------------------------------------------------
+ template< class VectorVal > class ODeleteVector : public connectivity::ORowVector< VectorVal >
+ {
+ bool m_bDeleted;
+ public:
+ ODeleteVector() : connectivity::ORowVector< VectorVal >() ,m_bDeleted(false) {}
+ ODeleteVector(size_t _st) : connectivity::ORowVector< VectorVal >(_st) ,m_bDeleted(false) {}
+
+ bool isDeleted() const { return m_bDeleted; }
+ void setDeleted(bool _bDeleted) { m_bDeleted = _bDeleted; }
+ };
+
+ typedef ODeleteVector< ORowSetValue > OValueVector;
+
+ class OOO_DLLPUBLIC_DBTOOLS OValueRefVector : public ODeleteVector< ORowSetValueDecoratorRef >
+ {
+ public:
+ OValueRefVector(){}
+ OValueRefVector(size_t _st) : ODeleteVector< ORowSetValueDecoratorRef >(_st)
+ {
+ for(OValueRefVector::Vector::iterator aIter = get().begin() ; aIter != get().end() ;++aIter)
+ *aIter = new ORowSetValueDecorator;
+ }
+ };
+
+#define SQL_NO_PARAMETER (SAL_MAX_UINT32)
+ class OAssignValues : public OValueRefVector
+ {
+ ::std::vector<sal_Int32> m_nParameterIndexes;
+ public:
+ OAssignValues() : m_nParameterIndexes(1,SQL_NO_PARAMETER){}
+ OAssignValues(Vector::size_type n) : OValueRefVector(n),m_nParameterIndexes(n+1,SQL_NO_PARAMETER){}
+
+ void setParameterIndex(sal_Int32 _nId,sal_Int32 _nParameterIndex) { m_nParameterIndexes[_nId] = _nParameterIndex;}
+ sal_Int32 getParameterIndex(sal_Int32 _nId) const { return m_nParameterIndexes[_nId]; }
+ };
+
+ typedef ::rtl::Reference< OAssignValues > ORefAssignValues;
+
+
+
+ typedef ::rtl::Reference< OValueVector > OValueRow;
+ typedef ::rtl::Reference< OValueRefVector > OValueRefRow;
+}
+
+#endif // #ifndef _CONNECTIVITY_FILE_VALUE_HXX_
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/IParseContext.hxx b/include/connectivity/IParseContext.hxx
new file mode 100644
index 000000000000..0352ed8ec39f
--- /dev/null
+++ b/include/connectivity/IParseContext.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 CONNECTIVITY_IPARSECONTEXT_HXX
+#define CONNECTIVITY_IPARSECONTEXT_HXX
+
+namespace connectivity { class OSQLParseNode; }
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ //==========================================================================
+ //= IParseContext
+ //==========================================================================
+ class IParseContext
+ {
+ public:
+ enum ErrorCode
+ {
+ ERROR_NONE = 0,
+ ERROR_GENERAL, // "Syntax error in SQL expression"
+ ERROR_VALUE_NO_LIKE, // "The value #1 can not be used with LIKE."
+ ERROR_FIELD_NO_LIKE, // "LIKE can not be used with this field."
+ ERROR_INVALID_COMPARE, // "The entered criterion can not be compared with this field."
+ ERROR_INVALID_INT_COMPARE, // "The field can not be compared with a number."
+ ERROR_INVALID_DATE_COMPARE, // "The field can not be compared with a date."
+ ERROR_INVALID_REAL_COMPARE, // "The field can not be compared with a floating point number."
+ ERROR_INVALID_TABLE, // "The database does not contain a table named \"#\"."
+ ERROR_INVALID_TABLE_OR_QUERY, // "The database does contain neither a table nor a query named \"#\"."
+ ERROR_INVALID_COLUMN, // "The column \"#1\" is unknown in the table \"#2\"."
+ ERROR_INVALID_TABLE_EXIST, // "The database already contains a table or view with name \"#\"."
+ ERROR_INVALID_QUERY_EXIST // "The database already contains a query with name \"#\".";
+ };
+
+ enum InternationalKeyCode
+ {
+ KEY_NONE = 0,
+ KEY_LIKE,
+ KEY_NOT,
+ KEY_NULL,
+ KEY_TRUE,
+ KEY_FALSE,
+ KEY_IS,
+ KEY_BETWEEN,
+ KEY_OR,
+ KEY_AND,
+ KEY_AVG,
+ KEY_COUNT,
+ KEY_MAX,
+ KEY_MIN,
+ KEY_SUM,
+ KEY_EVERY,
+ KEY_ANY,
+ KEY_SOME,
+ KEY_STDDEV_POP,
+ KEY_STDDEV_SAMP,
+ KEY_VAR_SAMP,
+ KEY_VAR_POP,
+ KEY_COLLECT,
+ KEY_FUSION,
+ KEY_INTERSECTION
+ };
+
+ public:
+ // retrieves language specific error messages
+ virtual OUString getErrorMessage(ErrorCode _eCodes) const = 0;
+
+ // retrieves language specific keyword strings (only ASCII allowed)
+ virtual OString getIntlKeywordAscii(InternationalKeyCode _eKey) const = 0;
+
+ // finds out, if we have an international keyword (only ASCII allowed)
+ virtual InternationalKeyCode getIntlKeyCode(const OString& rToken) const = 0;
+
+ /** get's a locale instance which should be used when parsing in the context specified by this instance
+ <p>if this is not overridden by derived classes, it returns the static default locale.</p>
+ */
+ virtual ::com::sun::star::lang::Locale getPreferredLocale( ) const = 0;
+
+ protected:
+ ~IParseContext() {}
+ };
+}
+
+#endif // CONNECTIVITY_IPARSECONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/OSubComponent.hxx b/include/connectivity/OSubComponent.hxx
new file mode 100644
index 000000000000..2a55aa35c374
--- /dev/null
+++ b/include/connectivity/OSubComponent.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 _CONNECTIVITY_OSUBCOMPONENT_HXX_
+#define _CONNECTIVITY_OSUBCOMPONENT_HXX_
+
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.h>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace com
+{
+ namespace sun
+ {
+ namespace star
+ {
+ namespace lang
+ {
+ class XComponent;
+ }
+ }
+ }
+}
+namespace connectivity
+{
+ OOO_DLLPUBLIC_DBTOOLS
+ void release(oslInterlockedCount& _refCount,
+ ::cppu::OBroadcastHelper& rBHelper,
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
+ ::com::sun::star::lang::XComponent* _pObject);
+ //************************************************************
+ // OSubComponent
+ //************************************************************
+ template <class SELF, class WEAK> class OSubComponent
+ {
+ protected:
+ // the parent must support the tunnel implementation
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent;
+ SELF* m_pDerivedImplementation;
+
+ public:
+ OSubComponent(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParent,
+ SELF* _pDerivedImplementation)
+ :m_xParent(_xParent)
+ ,m_pDerivedImplementation(_pDerivedImplementation)
+ {
+ }
+
+ protected:
+ void dispose_ChildImpl()
+ {
+ // avoid ambiguity
+ ::osl::MutexGuard aGuard( m_pDerivedImplementation->WEAK::rBHelper.rMutex );
+ m_xParent.clear();
+ }
+ void relase_ChildImpl()
+ {
+ ::connectivity::release(m_pDerivedImplementation->m_refCount,
+ m_pDerivedImplementation->WEAK::rBHelper,
+ m_xParent,
+ m_pDerivedImplementation);
+
+ m_pDerivedImplementation->WEAK::release();
+ }
+ };
+}
+#endif // _CONNECTIVITY_OSUBCOMPONENT_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/PColumn.hxx b/include/connectivity/PColumn.hxx
new file mode 100644
index 000000000000..a54cb809ca29
--- /dev/null
+++ b/include/connectivity/PColumn.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 _CONNECTIVITY_PCOLUMN_HXX_
+#define _CONNECTIVITY_PCOLUMN_HXX_
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/sdbcx/VColumn.hxx"
+#include "connectivity/CommonTools.hxx"
+#include <rtl/ref.hxx>
+#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
+#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <comphelper/proparrhlp.hxx>
+
+namespace connectivity
+{
+ namespace parse
+ {
+ class OParseColumn;
+
+ typedef sdbcx::OColumn OParseColumn_BASE;
+ typedef ::comphelper::OPropertyArrayUsageHelper<OParseColumn> OParseColumn_PROP;
+
+ class OOO_DLLPUBLIC_DBTOOLS OParseColumn :
+ public OParseColumn_BASE, public OParseColumn_PROP
+ {
+ OUString m_aRealName;
+ OUString m_sLabel;
+ sal_Bool m_bFunction;
+ sal_Bool m_bDbasePrecisionChanged;
+ sal_Bool m_bAggregateFunction;
+ sal_Bool m_bIsSearchable;
+
+ protected:
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+
+ virtual ~OParseColumn();
+ public:
+ OParseColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,sal_Bool _bCase);
+ OParseColumn(const OUString& _Name,
+ const OUString& _TypeName,
+ const OUString& _DefaultValue,
+ const OUString& _Description,
+ sal_Int32 _IsNullable,
+ sal_Int32 _Precision,
+ sal_Int32 _Scale,
+ sal_Int32 _Type,
+ sal_Bool _IsAutoIncrement,
+ sal_Bool _IsCurrency,
+ sal_Bool _bCase,
+ const OUString& _CatalogName,
+ const OUString& _SchemaName,
+ const OUString& _TableName);
+
+ virtual void construct();
+
+ void setRealName(const OUString& _rName) { m_aRealName = _rName; }
+ void setLabel(const OUString& i_sLabel) { m_sLabel = i_sLabel; }
+ void setTableName(const OUString& _rName) { m_TableName = _rName; }
+ void setFunction(sal_Bool _bFunction) { m_bFunction = _bFunction; }
+ void setAggregateFunction(sal_Bool _bFunction) { m_bAggregateFunction = _bFunction; }
+ void setIsSearchable( sal_Bool _bIsSearchable ) { m_bIsSearchable = _bIsSearchable; }
+ void setDbasePrecisionChanged(sal_Bool _bDbasePrecisionChanged) { m_bDbasePrecisionChanged = _bDbasePrecisionChanged; }
+
+ const OUString& getRealName() const { return m_aRealName; }
+ const OUString& getLabel() const { return m_sLabel; }
+ const OUString& getTableName() const { return m_TableName; }
+ sal_Bool getFunction() const { return m_bFunction; }
+ sal_Bool getDbasePrecisionChanged() const { return m_bDbasePrecisionChanged; }
+
+ public:
+ /** creates a collection of OParseColumn, as described by a result set meta data instance.
+ */
+ static ::rtl::Reference< OSQLColumns >
+ createColumnsForResultSet(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData >& _rxResMetaData,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMetaData,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& i_xQueryColumns
+ );
+
+ DECLARE_STL_USTRINGACCESS_MAP(int,StringMap);
+ /** creates a single OParseColumn, as described by a result set meta data instance.
+ The column names are unique.
+ */
+ static OParseColumn*
+ createColumnForResultSet(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData >& _rxResMetaData,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMetaData,
+ sal_Int32 _nColumnPos,
+ StringMap& _rColumns
+ );
+
+ private:
+ using OParseColumn_BASE::createArrayHelper;
+ };
+
+ class OOrderColumn;
+
+ typedef sdbcx::OColumn OOrderColumn_BASE;
+ typedef ::comphelper::OPropertyArrayUsageHelper<OOrderColumn> OOrderColumn_PROP;
+
+ class OOO_DLLPUBLIC_DBTOOLS OOrderColumn :
+ public OOrderColumn_BASE, public OOrderColumn_PROP
+ {
+ const sal_Bool m_bAscending;
+
+ protected:
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+
+ virtual ~OOrderColumn();
+ public:
+ OOrderColumn(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,
+ const OUString& i_rOriginatingTableName,
+ sal_Bool _bCase,
+ sal_Bool _bAscending
+ );
+
+ OOrderColumn(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,
+ sal_Bool _bCase,
+ sal_Bool _bAscending
+ );
+
+ virtual void construct();
+
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+ private:
+ using OOrderColumn_BASE::createArrayHelper;
+ };
+ }
+}
+
+#endif //_CONNECTIVITY_PCOLUMN_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/ParameterCont.hxx b/include/connectivity/ParameterCont.hxx
new file mode 100644
index 000000000000..0c9c92ee4468
--- /dev/null
+++ b/include/connectivity/ParameterCont.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 CONNECTIVITY_PARAMETERCONTINUATION_HXX_INCLUDED
+#define CONNECTIVITY_PARAMETERCONTINUATION_HXX_INCLUDED
+
+#include <com/sun/star/sdb/XInteractionSupplyParameters.hpp>
+#include <comphelper/interaction.hxx>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace dbtools
+{
+//====================================================================
+ //= OParameterContinuation
+ //====================================================================
+ class OOO_DLLPUBLIC_DBTOOLS OParameterContinuation : public comphelper::OInteraction< ::com::sun::star::sdb::XInteractionSupplyParameters >
+ {
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aValues;
+
+ public:
+ OParameterContinuation() { }
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > getValues() const { return m_aValues; }
+
+ // XInteractionSupplyParameters
+ virtual void SAL_CALL setParameters( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rValues ) throw(::com::sun::star::uno::RuntimeException);
+
+ protected:
+ virtual ~OParameterContinuation() { }
+ private:
+ OParameterContinuation(const OParameterContinuation&);
+ void operator =(const OParameterContinuation&);
+ };
+} // dbtools
+#endif //CONNECTIVITY_PARAMETERCONTINUATION_HXX_INCLUDED
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/SQLStatementHelper.hxx b/include/connectivity/SQLStatementHelper.hxx
new file mode 100644
index 000000000000..8302dae6b5c5
--- /dev/null
+++ b/include/connectivity/SQLStatementHelper.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 _CONNECTIVITY_SQLSTATEMENTHELPER_HXX_
+#define _CONNECTIVITY_SQLSTATEMENTHELPER_HXX_
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <com/sun/star/beans/XPropertySet.hpp>
+//.........................................................................
+namespace dbtools
+{
+ class OOO_DLLPUBLIC_DBTOOLS ISQLStatementHelper
+ {
+ public:
+ virtual void addComment(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,OUStringBuffer& _rOut) = 0;
+
+ protected:
+ ~ISQLStatementHelper() {}
+ };
+
+//.........................................................................
+} // namespace dbtools
+//.........................................................................
+
+#endif // _CONNECTIVITY_SQLSTATEMENTHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/StdTypeDefs.hxx b/include/connectivity/StdTypeDefs.hxx
new file mode 100644
index 000000000000..8751a656d2c0
--- /dev/null
+++ b/include/connectivity/StdTypeDefs.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 CONNECTIVITY_STDTYPEDEFS_HXX
+#define CONNECTIVITY_STDTYPEDEFS_HXX
+
+#include "sal/config.h"
+
+#include <map>
+#include <vector>
+#include "sal/types.h"
+
+
+namespace connectivity
+{
+ typedef ::std::vector< OUString> TStringVector;
+ typedef ::std::vector< sal_Int32> TIntVector;
+ typedef ::std::map<sal_Int32,sal_Int32> TInt2IntMap;
+ typedef ::std::map< OUString,sal_Int32> TString2IntMap;
+ typedef ::std::map< sal_Int32,OUString> TInt2StringMap;
+}
+
+#endif // CONNECTIVITY_STDTYPEDEFS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/TColumnsHelper.hxx b/include/connectivity/TColumnsHelper.hxx
new file mode 100644
index 000000000000..5fe1dd0eb845
--- /dev/null
+++ b/include/connectivity/TColumnsHelper.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 CONNECTIVITY_COLUMNSHELPER_HXX
+#define CONNECTIVITY_COLUMNSHELPER_HXX
+
+#include "connectivity/sdbcx/VCollection.hxx"
+#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ class OTableHelper;
+ class OColumnsHelperImpl;
+ /** contains generell column handling to creat default columns and default sql statements.
+ */
+ class OOO_DLLPUBLIC_DBTOOLS OColumnsHelper : public sdbcx::OCollection
+ {
+ OColumnsHelperImpl* m_pImpl;
+ protected:
+ OTableHelper* m_pTable;
+
+ virtual sdbcx::ObjectType createObject(const OUString& _rName);
+ virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
+ virtual sdbcx::ObjectType appendObject( const OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
+ virtual void dropObject(sal_Int32 _nPos,const OUString _sElementName);
+ public:
+ OColumnsHelper( ::cppu::OWeakObject& _rParent
+ ,sal_Bool _bCase
+ ,::osl::Mutex& _rMutex
+ ,const TStringVector &_rVector
+ ,sal_Bool _bUseHardRef = sal_True
+ );
+ virtual ~OColumnsHelper();
+
+ /** set the parent of the columns. Can also be <NULL/>.
+ @param _pTable
+ The parent.
+ */
+ inline void setParent(OTableHelper* _pTable) { m_pTable = _pTable;}
+ };
+}
+#endif // CONNECTIVITY_COLUMNSHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/TIndex.hxx b/include/connectivity/TIndex.hxx
new file mode 100644
index 000000000000..b8502af9c5ec
--- /dev/null
+++ b/include/connectivity/TIndex.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 CONNECTIVITY_INDEXHELPER_HXX_
+#define CONNECTIVITY_INDEXHELPER_HXX_
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/sdbcx/VIndex.hxx"
+#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
+
+namespace connectivity
+{
+ class OTableHelper;
+ class OOO_DLLPUBLIC_DBTOOLS OIndexHelper : public connectivity::sdbcx::OIndex
+ {
+ OTableHelper* m_pTable;
+ public:
+ virtual void refreshColumns();
+ public:
+ OIndexHelper( OTableHelper* _pTable);
+ OIndexHelper( OTableHelper* _pTable,
+ const OUString& _Name,
+ const OUString& _Catalog,
+ sal_Bool _isUnique,
+ sal_Bool _isPrimaryKeyIndex,
+ sal_Bool _isClustered
+ );
+ inline OTableHelper* getTable() const { return m_pTable; }
+ };
+}
+#endif // CONNECTIVITY_INDEXHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/TIndexColumns.hxx b/include/connectivity/TIndexColumns.hxx
new file mode 100644
index 000000000000..31b0ecfe3ca5
--- /dev/null
+++ b/include/connectivity/TIndexColumns.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 CONNECTIVITY_INDEXCOLUMNSHELPER_HXX
+#define CONNECTIVITY_INDEXCOLUMNSHELPER_HXX
+
+#include "connectivity/sdbcx/VCollection.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ class OIndexHelper;
+ class OOO_DLLPUBLIC_DBTOOLS OIndexColumns : public sdbcx::OCollection
+ {
+ OIndexHelper* m_pIndex;
+ protected:
+ virtual sdbcx::ObjectType createObject(const OUString& _rName);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
+ virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
+ public:
+ OIndexColumns( OIndexHelper* _pIndex,
+ ::osl::Mutex& _rMutex,
+ const ::std::vector< OUString> &_rVector);
+ };
+}
+#endif // CONNECTIVITY_INDEXCOLUMNSHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/TIndexes.hxx b/include/connectivity/TIndexes.hxx
new file mode 100644
index 000000000000..c558c709c8e8
--- /dev/null
+++ b/include/connectivity/TIndexes.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 CONNECTIVITY_INDEXESHELPER_HXX
+#define CONNECTIVITY_INDEXESHELPER_HXX
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/sdbcx/VCollection.hxx"
+#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
+
+namespace connectivity
+{
+ class OTableHelper;
+ class OOO_DLLPUBLIC_DBTOOLS OIndexesHelper : public sdbcx::OCollection
+ {
+ OTableHelper* m_pTable;
+ protected:
+ virtual sdbcx::ObjectType createObject(const OUString& _rName);
+ virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
+ virtual sdbcx::ObjectType appendObject( const OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
+ virtual void dropObject(sal_Int32 _nPos,const OUString _sElementName);
+ public:
+ OIndexesHelper(OTableHelper* _pTable,
+ ::osl::Mutex& _rMutex,
+ const ::std::vector< OUString> &_rVector
+ );
+
+ };
+}
+
+#endif // CONNECTIVITY_INDEXESHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/TKey.hxx b/include/connectivity/TKey.hxx
new file mode 100644
index 000000000000..9b24e41c3126
--- /dev/null
+++ b/include/connectivity/TKey.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 CONNECTIVITY_TKEY_HXX
+#define CONNECTIVITY_TKEY_HXX
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <connectivity/sdbcx/VKey.hxx>
+#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
+
+namespace connectivity
+{
+ class OTableHelper;
+ class OOO_DLLPUBLIC_DBTOOLS OTableKeyHelper : public connectivity::sdbcx::OKey
+ {
+ OTableHelper* m_pTable;
+ public:
+ virtual void refreshColumns();
+ public:
+ OTableKeyHelper( OTableHelper* _pTable);
+ OTableKeyHelper( OTableHelper* _pTable
+ ,const OUString& _Name
+ ,const sdbcx::TKeyProperties& _rProps
+ );
+ inline OTableHelper* getTable() const { return m_pTable; }
+ };
+}
+#endif // CONNECTIVITY_TKEY_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/TKeyColumns.hxx b/include/connectivity/TKeyColumns.hxx
new file mode 100644
index 000000000000..6dbb041805b4
--- /dev/null
+++ b/include/connectivity/TKeyColumns.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 CONNECTIVITY_TKEYCOLUMNS_HXX
+#define CONNECTIVITY_TKEYCOLUMNS_HXX
+
+#include "connectivity/sdbcx/VCollection.hxx"
+#include "connectivity/TKey.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ class OOO_DLLPUBLIC_DBTOOLS OKeyColumnsHelper : public connectivity::sdbcx::OCollection
+ {
+ OTableKeyHelper* m_pKey;
+ protected:
+ virtual sdbcx::ObjectType createObject(const OUString& _rName);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
+ virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
+ public:
+ OKeyColumnsHelper( OTableKeyHelper* _pKey,
+ ::osl::Mutex& _rMutex,
+ const ::std::vector< OUString> &_rVector);
+ };
+}
+#endif // CONNECTIVITY_TKEYCOLUMNS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/TKeys.hxx b/include/connectivity/TKeys.hxx
new file mode 100644
index 000000000000..817b24da3a42
--- /dev/null
+++ b/include/connectivity/TKeys.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 CONNECTIVITY_TKEYS_HXX
+#define CONNECTIVITY_TKEYS_HXX
+
+#include "connectivity/sdbcx/VCollection.hxx"
+#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
+#include "connectivity/TTableHelper.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ typedef sdbcx::OCollection OKeys_BASE;
+ class OOO_DLLPUBLIC_DBTOOLS OKeysHelper : public OKeys_BASE
+ {
+ OTableHelper* m_pTable;
+ protected:
+ virtual sdbcx::ObjectType createObject(const OUString& _rName);
+ virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
+ virtual sdbcx::ObjectType appendObject( const OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
+ virtual void dropObject(sal_Int32 _nPos,const OUString _sElementName);
+
+ virtual OUString getDropForeignKey() const;
+
+ public:
+ OKeysHelper( OTableHelper* _pTable,
+ ::osl::Mutex& _rMutex,
+ const TStringVector& _rVector
+ );
+ inline OTableHelper* getTable() const { return m_pTable; }
+
+ static void cloneDescriptorColumns(
+ const sdbcx::ObjectType& _rSourceDescriptor,
+ const sdbcx::ObjectType& _rDestDescriptor
+ );
+ };
+}
+
+#endif // CONNECTIVITY_TKEYS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/TTableHelper.hxx b/include/connectivity/TTableHelper.hxx
new file mode 100644
index 000000000000..aeb58cb4dd0c
--- /dev/null
+++ b/include/connectivity/TTableHelper.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 CONNECTIVITY_TABLEHELPER_HXX
+#define CONNECTIVITY_TABLEHELPER_HXX
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/sdbcx/VTable.hxx"
+#include "connectivity/sdbcx/VKey.hxx"
+#include "connectivity/StdTypeDefs.hxx"
+#include <comphelper/stl_types.hxx>
+#include <com/sun/star/sdb/tools/XTableRename.hpp>
+#include <com/sun/star/sdb/tools/XTableAlteration.hpp>
+#include <com/sun/star/sdb/tools/XKeyAlteration.hpp>
+#include <com/sun/star/sdb/tools/XIndexAlteration.hpp>
+
+namespace connectivity
+{
+ typedef sal_Int32 OrdinalPosition;
+ struct ColumnDesc
+ {
+ OUString sName;
+ OUString aField6;
+ OUString sField12; // REMARKS
+ OUString sField13;
+ sal_Int32 nField5
+ , nField7
+ , nField9
+ , nField11;
+
+ OrdinalPosition nOrdinalPosition;
+
+ ColumnDesc() {}
+ ColumnDesc( const OUString& _rName
+ , sal_Int32 _nField5
+ , const OUString& _aField6
+ , sal_Int32 _nField7
+ , sal_Int32 _nField9
+ , sal_Int32 _nField11
+ , const OUString& _sField12
+ , const OUString& _sField13
+ ,OrdinalPosition _nPosition )
+ :sName( _rName )
+ ,aField6(_aField6)
+ ,sField12(_sField12)
+ ,sField13(_sField13)
+ ,nField5(_nField5)
+ ,nField7(_nField7)
+ ,nField9(_nField9)
+ ,nField11(_nField11)
+ ,nOrdinalPosition( _nPosition )
+ {
+ }
+ };
+ typedef connectivity::sdbcx::OTable OTable_TYPEDEF;
+
+ OOO_DLLPUBLIC_DBTOOLS OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xColProp);
+
+ DECLARE_STL_USTRINGACCESS_MAP( sdbcx::TKeyProperties , TKeyMap);
+
+ struct OTableHelperImpl;
+
+ class OOO_DLLPUBLIC_DBTOOLS OTableHelper : public OTable_TYPEDEF
+ {
+ ::std::auto_ptr<OTableHelperImpl> m_pImpl;
+
+ void refreshPrimaryKeys(TStringVector& _rKeys);
+ void refreshForeignKeys(TStringVector& _rKeys);
+
+ protected:
+ /** creates the column collection for the table
+ @param _rNames
+ The column names.
+ */
+ virtual sdbcx::OCollection* createColumns(const TStringVector& _rNames) = 0;
+
+ /** creates the key collection for the table
+ @param _rNames
+ The key names.
+ */
+ virtual sdbcx::OCollection* createKeys(const TStringVector& _rNames) = 0;
+
+ /** creates the index collection for the table
+ @param _rNames
+ The index names.
+ */
+ virtual sdbcx::OCollection* createIndexes(const TStringVector& _rNames) = 0;
+
+ /** this function is called upon disposing the component
+ */
+ virtual void SAL_CALL disposing();
+
+ /** The default returns "RENAME TABLE " or "RENAME VIEW " depending on the type.
+ *
+ * \return The start of the rename statement.
+ */
+ virtual OUString getRenameStart() const;
+
+ virtual ~OTableHelper();
+
+ public:
+ virtual void refreshColumns();
+ virtual void refreshKeys();
+ virtual void refreshIndexes();
+
+ const ColumnDesc* getColumnDescription(const OUString& _sName) const;
+
+ public:
+ OTableHelper( sdbcx::OCollection* _pTables,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
+ sal_Bool _bCase);
+ OTableHelper( sdbcx::OCollection* _pTables,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
+ sal_Bool _bCase,
+ const OUString& _Name,
+ const OUString& _Type,
+ const OUString& _Description = OUString(),
+ const OUString& _SchemaName = OUString(),
+ const OUString& _CatalogName = OUString()
+ );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> getMetaData() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection() const;
+
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XRename
+ virtual void SAL_CALL rename( const OUString& newName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
+
+ // XAlterTable
+ virtual void SAL_CALL alterColumnByIndex( sal_Int32 index, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ // XNamed
+ virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
+
+ // helper method to get key properties
+ sdbcx::TKeyProperties getKeyProperties(const OUString& _sName) const;
+ void addKey(const OUString& _sName,const sdbcx::TKeyProperties& _aKeyProperties);
+
+ virtual OUString getTypeCreatePattern() const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XTableRename> getRenameService() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XTableAlteration> getAlterService() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XKeyAlteration> getKeyService() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XIndexAlteration> getIndexService() const;
+ };
+}
+#endif // CONNECTIVITY_TABLEHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/conncleanup.hxx b/include/connectivity/conncleanup.hxx
new file mode 100644
index 000000000000..1eec5ac50f98
--- /dev/null
+++ b/include/connectivity/conncleanup.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CONNECTIVITY_CONNCLEANUP_HXX_
+#define _CONNECTIVITY_CONNCLEANUP_HXX_
+
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/sdbc/XRowSet.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+//.........................................................................
+namespace dbtools
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OAutoConnectionDisposer
+ //=====================================================================
+ typedef ::cppu::WeakImplHelper2 < ::com::sun::star::beans::XPropertyChangeListener,
+ ::com::sun::star::sdbc::XRowSetListener
+ > OAutoConnectionDisposer_Base;
+
+ class OOO_DLLPUBLIC_DBTOOLS OAutoConnectionDisposer : public OAutoConnectionDisposer_Base
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >
+ m_xOriginalConnection;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xRowSet; // needed to add as listener
+ sal_Bool m_bRSListening : 1; // true when we're listening on rowset
+ sal_Bool m_bPropertyListening : 1; // true when we're listening for property changes
+
+ public:
+ /** constructs an object
+ <p>The connection given will be set on the rowset (as ActiveConnection), and the object adds itself as property
+ change listener for the connection. Once somebody sets a new ActiveConnection, the old one (the one given
+ here) will be disposed.</p>
+ */
+ OAutoConnectionDisposer(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection
+ );
+
+ protected:
+ // XPropertyChangeListener
+ virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& _rSource ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XRowSetListener
+ virtual void SAL_CALL cursorMoved( const ::com::sun::star::lang::EventObject& event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowChanged( const ::com::sun::star::lang::EventObject& event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowSetChanged( const ::com::sun::star::lang::EventObject& event ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ void clearConnection();
+
+ void startRowSetListening();
+ void stopRowSetListening();
+ sal_Bool isRowSetListening() const { return m_bRSListening; }
+
+ void startPropertyListening( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxProps );
+ void stopPropertyListening( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxEventSource );
+ sal_Bool isPropertyListening() const { return m_bPropertyListening; }
+ };
+
+//.........................................................................
+} // namespace dbtools
+//.........................................................................
+
+#endif // _CONNECTIVITY_CONNCLEANUP_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/dbcharset.hxx b/include/connectivity/dbcharset.hxx
new file mode 100644
index 000000000000..712c44abddb4
--- /dev/null
+++ b/include/connectivity/dbcharset.hxx
@@ -0,0 +1,164 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _DBHELPER_DBCHARSET_HXX_
+#define _DBHELPER_DBCHARSET_HXX_
+
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include <comphelper/stl_types.hxx>
+#include <rtl/textenc.h>
+#include <rtl/tencinfo.h>
+#include <rtl/ustring.hxx>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+//.........................................................................
+namespace dbtools
+{
+//.........................................................................
+
+ //=========================================================================
+ //= OCharsetMap
+ //=========================================================================
+ /** is a class which translates between different charset representations.
+
+ <p>The set of recognized charsets is very limited: only the ones which are database relevant are
+ implemented at the moment</p>
+
+ <p>Possible representations are:
+ <ul>
+ <li><b>IANA names.</b>
+ Have a look at <A href="http://www.iana.org/assignments/character-sets">this document</A> for
+ more details</li>
+ <li><b>rtl_TextEncoding</b></li>
+ </ul>
+ </p>
+ */
+ class OOO_DLLPUBLIC_DBTOOLS OCharsetMap
+ {
+ protected:
+ DECLARE_STL_STDKEY_SET( rtl_TextEncoding, TextEncBag );
+
+ TextEncBag m_aEncodings;
+
+ public:
+ class CharsetIterator;
+ friend class OCharsetMap::CharsetIterator;
+ typedef CharsetIterator iterator;
+ typedef CharsetIterator const_iterator;
+
+ OCharsetMap();
+ virtual ~OCharsetMap();
+
+ struct IANA { };
+
+ /** find the given text encoding in the map.
+ @return the <em>end</em> iterator if the encoding could not be found.
+ */
+ CharsetIterator find(const rtl_TextEncoding _eEncoding) const;
+ /** find the given IANA name in the map.
+ @return the <em>end</em> iterator if the IANA name could not be found.
+ */
+ CharsetIterator find(const OUString& _rIanaName, const IANA&) const;
+
+ std::size_t size() const { ensureConstructed( ); return m_aEncodings.size(); }
+
+ /// get access to the first element of the charset collection
+ CharsetIterator begin() const;
+ /// get access to the (last + 1st) element of the charset collection
+ CharsetIterator end() const;
+
+ protected:
+ // needed because we want to call a virtual method during construction
+ void lateConstruct();
+ inline void ensureConstructed( ) const { if ( m_aEncodings.empty() ) const_cast< OCharsetMap* >( this )->lateConstruct(); }
+
+ virtual sal_Bool approveEncoding( const rtl_TextEncoding _eEncoding, const rtl_TextEncodingInfo& _rInfo ) const;
+ };
+
+ //-------------------------------------------------------------------------
+ //- CharsetIteratorDerefHelper
+ //-------------------------------------------------------------------------
+ class OOO_DLLPUBLIC_DBTOOLS CharsetIteratorDerefHelper
+ {
+ friend class OCharsetMap::CharsetIterator;
+
+ rtl_TextEncoding m_eEncoding;
+ OUString m_aIanaName;
+
+ public:
+ CharsetIteratorDerefHelper(const CharsetIteratorDerefHelper& _rSource);
+
+ rtl_TextEncoding getEncoding() const { return m_eEncoding; }
+ OUString getIanaName() const { return m_aIanaName; }
+
+ protected:
+ CharsetIteratorDerefHelper( const rtl_TextEncoding _eEncoding, const OUString& _rIanaName );
+
+ };
+
+
+ //-------------------------------------------------------------------------
+ //- OCharsetMap::CharsetIterator
+ //-------------------------------------------------------------------------
+ class OOO_DLLPUBLIC_DBTOOLS OCharsetMap::CharsetIterator
+ {
+ friend class OCharsetMap;
+
+ friend OOO_DLLPUBLIC_DBTOOLS bool operator==(const CharsetIterator& lhs, const CharsetIterator& rhs);
+ friend bool operator!=(const CharsetIterator& lhs, const CharsetIterator& rhs) { return !(lhs == rhs); }
+
+// friend sal_Int32 operator-(const CharsetIterator& lhs, const CharsetIterator& rhs);
+
+ protected:
+ const OCharsetMap* m_pContainer;
+ OCharsetMap::TextEncBag::const_iterator m_aPos;
+
+ public:
+ CharsetIterator(const CharsetIterator& _rSource);
+ ~CharsetIterator();
+
+ CharsetIteratorDerefHelper operator*() const;
+ // no -> operator
+ // this would require us to a) store CharsetIteratorDerefHelper instances ourself so that we
+ // can return a pointer or b) introduce a -> operator on the CharsetIteratorDerefHelper, too.
+
+ /// prefix increment
+ const CharsetIterator& operator++();
+ /// postfix increment
+ const CharsetIterator operator++(int) { CharsetIterator hold(*this); ++*this; return hold; }
+
+ /// prefix decrement
+ const CharsetIterator& operator--();
+ /// postfix decrement
+ const CharsetIterator operator--(int) { CharsetIterator hold(*this); --*this; return hold; }
+
+ protected:
+ CharsetIterator(const OCharsetMap* _pContainer, OCharsetMap::TextEncBag::const_iterator _aPos );
+ };
+
+//.........................................................................
+} // namespace dbtools
+//.........................................................................
+
+#endif // _DBHELPER_DBCHARSET_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/dbconversion.hxx b/include/connectivity/dbconversion.hxx
new file mode 100644
index 000000000000..9536c799ec81
--- /dev/null
+++ b/include/connectivity/dbconversion.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 _DBHELPER_DBCONVERSION_HXX_
+#define _DBHELPER_DBCONVERSION_HXX_
+
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+// forward declarations
+namespace com
+{
+ namespace sun
+ {
+ namespace star
+ {
+ namespace lang
+ {
+ struct Locale;
+ }
+ namespace sdb
+ {
+ class XColumn;
+ class XColumnUpdate;
+ }
+ namespace sdbc
+ {
+ class SQLException;
+ }
+ namespace beans
+ {
+ class XPropertySet;
+ }
+ namespace util
+ {
+ class XNumberFormatter;
+ class XNumberFormatsSupplier;
+ struct Time;
+ struct DateTime;
+ }
+ namespace script
+ {
+ class XTypeConverter;
+ }
+ }
+ }
+}
+
+//.........................................................................
+namespace dbtools
+{
+//.........................................................................
+
+ class OOO_DLLPUBLIC_DBTOOLS DBTypeConversion
+ {
+ public:
+ static ::com::sun::star::util::Date getStandardDate();
+ static void setValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumnUpdate>& xVariant,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& xFormatter,
+ const ::com::sun::star::util::Date& rNullDate,
+ const OUString& rString,
+ sal_Int32 nKey,
+ sal_Int16 nFieldType,
+ sal_Int16 nKeyType) throw(::com::sun::star::lang::IllegalArgumentException);
+
+ static void setValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumnUpdate>& xVariant,
+ const ::com::sun::star::util::Date& rNullDate,
+ const double& rValue,
+ sal_Int16 nKeyType) throw(::com::sun::star::lang::IllegalArgumentException);
+
+ static double getValue( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& xVariant, const ::com::sun::star::util::Date& rNullDate );
+
+ // get the columnvalue as string with a default format given by the column or a default format
+ // for the type
+ static OUString getFormattedValue(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& xFormatter,
+ const ::com::sun::star::lang::Locale& _rLocale,
+ const ::com::sun::star::util::Date& rNullDate);
+
+ static OUString getFormattedValue(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _xColumn,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& xFormatter,
+ const ::com::sun::star::util::Date& rNullDate,
+ sal_Int32 nKey,
+ sal_Int16 nKeyType);
+
+ static ::com::sun::star::util::Date toDate(double dVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
+ static ::com::sun::star::util::Date toDate(const OUString& _sSQLDate);
+ static ::com::sun::star::util::Time toTime(double dVal);
+ static ::com::sun::star::util::Time toTime(const OUString& _sSQLDate);
+ static ::com::sun::star::util::DateTime toDateTime(double dVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
+ static ::com::sun::star::util::DateTime toDateTime(const OUString& _sSQLDate);
+
+
+ // TODO: consider removing getMsFromTime
+ static sal_Int32 getMsFromTime(const ::com::sun::star::util::Time& rVal);
+ static sal_Int64 getNsFromTime(const ::com::sun::star::util::Time& rVal);
+
+ static sal_Int32 toDays(const ::com::sun::star::util::Date& _rVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
+
+ static double toDouble(const ::com::sun::star::util::Date& rVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
+ static double toDouble(const ::com::sun::star::util::Time& rVal);
+ static double toDouble(const ::com::sun::star::util::DateTime& rVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
+
+ static sal_Int32 toINT32(const ::com::sun::star::util::Date& rVal);
+ static sal_Int64 toINT64(const ::com::sun::star::util::Time& rVal);
+
+ static ::com::sun::star::util::Date toDate(sal_Int32 _nVal);
+ static ::com::sun::star::util::Time toTime(sal_Int64 _nVal);
+
+ /** convert a double which is a date value relative to a given fixed date into a date value relative
+ to the standard db null date.
+ */
+ static double toStandardDbDate(const ::com::sun::star::util::Date& _rNullDate, double _rVal) { return _rVal + toDays(_rNullDate); }
+ /** convert a double which is a date value relative to the standard db null date into a date value relative
+ to a given fixed date.
+ */
+ static double toNullDate(const ::com::sun::star::util::Date& _rNullDate, double _rVal) { return _rVal - toDays(_rNullDate); }
+
+ // return the date from the numberformatsupplier or the STANDARD_DATE (1900,1,1)
+ static ::com::sun::star::util::Date getNULLDate(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > &xSupplier);
+
+ // return the date in the format %04d-%02d-%02d
+ static OUString toDateString(const ::com::sun::star::util::Date& rDate);
+ // return the time in the format %02d:%02d:%02d.%09d
+ static OUString toTimeString(const ::com::sun::star::util::Time& rTime);
+ // return the DateTime in the format %04d-%02d-%02d %02d:%02d:%02d.%09d
+ static OUString toDateTimeString(const ::com::sun::star::util::DateTime& _rDateTime);
+ // return the any in an sql standard format
+ static OUString toSQLString(sal_Int32 eType, const ::com::sun::star::uno::Any& _rVal, sal_Bool bQuote,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::script::XTypeConverter >& _rxTypeConverter);
+
+ /** converts a Unicode string into a 8-bit string, using the given encoding
+
+ @param _rSource
+ the source string to convert
+ @param _rDest
+ the destination string
+ @param _eEncoding
+ the encoding to use for the conversion
+
+ @throws com::sun::star::sdbc::SQLException
+ if the given string contains characters which are not convertible using the given encoding
+ The SQLState of the exception will be set to 22018 ("Invalid character value for cast specification")
+
+ @return
+ the length of the converted string
+ */
+ static sal_Int32 convertUnicodeString(
+ const OUString& _rSource,
+ OString& _rDest,
+ rtl_TextEncoding _eEncoding
+ )
+ SAL_THROW((::com::sun::star::sdbc::SQLException));
+
+ /** converts a Unicode string into a 8-bit string, using the given encoding
+
+ @param _rSource
+ the source string to convert
+
+ @param _rDest
+ the destination string
+
+ @param _nMaxLen
+ the maximum length of the destination string
+
+ @param _eEncoding
+ the encoding to use for the conversion
+
+ @throws com::sun::star::sdbc::SQLException
+ if convertUnicodeString, which is called internally, throws such an exception
+
+ @throws com::sun::star::sdbc::SQLException
+ if the conversion results in a string which is longer than _nMaxLen
+
+ @return
+ the length of the converted string
+ */
+ static sal_Int32 convertUnicodeStringToLength(
+ const OUString& _rSource,
+ OString& _rDest,
+ sal_Int32 _nMaxLen,
+ rtl_TextEncoding _eEncoding
+ )
+ SAL_THROW((::com::sun::star::sdbc::SQLException));
+ };
+
+//.........................................................................
+} // namespace dbtools
+//.........................................................................
+
+#endif // _DBHELPER_DBCONVERSION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/dbexception.hxx b/include/connectivity/dbexception.hxx
new file mode 100644
index 000000000000..a84450b607d8
--- /dev/null
+++ b/include/connectivity/dbexception.hxx
@@ -0,0 +1,353 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _DBHELPER_DBEXCEPTION_HXX_
+#define _DBHELPER_DBEXCEPTION_HXX_
+
+#include <com/sun/star/sdbc/SQLException.hpp>
+#include "connectivity/standardsqlstate.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace com
+{
+ namespace sun
+ {
+ namespace star
+ {
+ namespace sdb
+ {
+ class SQLContext;
+ struct SQLErrorEvent;
+ }
+ namespace sdbc
+ {
+ class SQLWarning;
+ }
+ }
+ }
+}
+//.........................................................................
+namespace dbtools
+{
+//.........................................................................
+
+//==============================================================================
+//= Special exception if cancel is pressed in DBA UI
+//==============================================================================
+enum OOoBaseErrorCode
+{
+ ParameterInteractionCancelled = 1
+};
+
+//==============================================================================
+//= SQLExceptionInfo - encapsulating the type info of an SQLException-derived class
+//==============================================================================
+
+class OOO_DLLPUBLIC_DBTOOLS SQLExceptionInfo
+{
+public:
+ enum TYPE { SQL_EXCEPTION, SQL_WARNING, SQL_CONTEXT, UNDEFINED };
+
+private:
+ ::com::sun::star::uno::Any m_aContent;
+ TYPE m_eType; // redundant (could be derived from m_aContent.getValueType())
+
+public:
+ SQLExceptionInfo();
+ SQLExceptionInfo(const ::com::sun::star::sdbc::SQLException& _rError);
+ SQLExceptionInfo(const ::com::sun::star::sdbc::SQLWarning& _rError);
+ SQLExceptionInfo(const ::com::sun::star::sdb::SQLContext& _rError);
+
+ /** convenience constructor
+
+ If your error processing relies on SQLExceptions, and SQLExceptionInfos, you still may
+ need to display an error which consists of a simple message string only.
+ In those cases, you can use this constructor, which behaves as if you would have used
+ an SQLException containing exactly the given error message.
+ */
+ SQLExceptionInfo( const OUString& _rSimpleErrorMessage );
+
+ SQLExceptionInfo(const SQLExceptionInfo& _rCopySource);
+
+ // use for events got via XSQLErrorListener::errorOccured
+ SQLExceptionInfo(const ::com::sun::star::uno::Any& _rError);
+ // use with the Reason member of an SQLErrorEvent or with NextElement of an SQLException
+
+ /** prepends a plain error message to the chain of exceptions
+ @param _rSimpleErrorMessage
+ the error message to prepend
+ @param _pAsciiSQLState
+ the SQLState of the to-be-constructed SQLException, or NULL if this should be defaulted to HY000
+ @param _nErrorCode
+ the ErrorCode of the to-be-constructed SQLException
+ */
+ void prepend( const OUString& _rErrorMessage, const sal_Char* _pAsciiSQLState = NULL, const sal_Int32 _nErrorCode = 0 );
+
+ /** appends a plain message to the chain of exceptions
+ @param _eType
+ the type of exception to append. Must be SQL_EXCEPTION, SQL_WARNING, SQL_CONTEXT, for all other
+ values, the behavior is undefined.
+ @param _rErrorMessage
+ the message to append
+ @param _pAsciiSQLState
+ the SQLState of the exception to append
+ @param _nErrorCode
+ the error code of the exception to append
+ */
+ void append( TYPE _eType, const OUString& _rErrorMessage, const sal_Char* _pAsciiSQLState = NULL, const sal_Int32 _nErrorCode = 0 );
+
+ /** throws (properly typed) the exception contained in the object
+ @precond
+ isValid() returns <TRUE/>
+ @throws SQLException
+ @throws RuntimeException
+ if the instance does not contain an SQLException
+ */
+ void doThrow();
+
+ const SQLExceptionInfo& operator=(const ::com::sun::star::sdbc::SQLException& _rError);
+ const SQLExceptionInfo& operator=(const ::com::sun::star::sdbc::SQLWarning& _rError);
+ const SQLExceptionInfo& operator=(const ::com::sun::star::sdb::SQLContext& _rError);
+ const SQLExceptionInfo& operator=(const ::com::sun::star::sdb::SQLErrorEvent& _rErrorEvent);
+ const SQLExceptionInfo& operator=(const ::com::sun::star::uno::Any& _rCaughtSQLException);
+
+ sal_Bool isKindOf(TYPE _eType) const;
+ // not just a simple comparisation ! e.g. getType() == SQL_CONTEXT implies isKindOf(SQL_EXCEPTION) == sal_True !
+ sal_Bool isValid() const { return m_eType != UNDEFINED; }
+ TYPE getType() const { return m_eType; }
+
+ operator const ::com::sun::star::sdbc::SQLException* () const;
+ operator const ::com::sun::star::sdbc::SQLWarning* () const;
+ operator const ::com::sun::star::sdb::SQLContext* () const;
+
+ const ::com::sun::star::uno::Any& get() const { return m_aContent; }
+
+ void clear()
+ {
+ m_aContent.clear();
+ m_eType = UNDEFINED;
+ }
+
+protected:
+ void implDetermineType();
+};
+
+//==============================================================================
+//= SQLExceptionIteratorHelper - iterating through an SQLException chain
+//==============================================================================
+
+class OOO_DLLPUBLIC_DBTOOLS SQLExceptionIteratorHelper
+{
+protected:
+ const ::com::sun::star::sdbc::SQLException* m_pCurrent;
+ SQLExceptionInfo::TYPE m_eCurrentType;
+
+public:
+ /** constructs an iterator instance from an SQLException
+
+ @param _rChainStart
+ the start of the exception chain to iterate. Must live as long as the iterator
+ instances lives, at least.
+ */
+ SQLExceptionIteratorHelper( const ::com::sun::star::sdbc::SQLException& _rChainStart );
+
+ /** constructs an iterator instance from an SQLExceptionInfo
+
+ @param _rErrorInfo
+ the start of the exception chain to iterate. Must live as long as the iterator
+ instances lives, at least.
+ */
+ SQLExceptionIteratorHelper( const SQLExceptionInfo& _rErrorInfo );
+
+ /** determines whether there are more elements in the exception chain
+ */
+ sal_Bool hasMoreElements() const { return ( m_pCurrent != NULL ); }
+
+ /** returns the type of the current element in the exception chain
+ */
+ SQLExceptionInfo::TYPE currentType() const { return m_eCurrentType; }
+
+ /** retrieves the current element in the chain, or <NULL/> if the chain has been completely
+ traveled.
+ */
+ const ::com::sun::star::sdbc::SQLException* current() const { return m_pCurrent; }
+
+ /** retrieves the current element in the chain, or <NULL/> if the chain has been completely
+ traveled.
+
+ In opposite to the second <member>current</member>, this version allows typed access to
+ the respective SQLException.
+ */
+ void current( SQLExceptionInfo& _out_rInfo ) const;
+
+ /** proceeds to the next element in the chain
+
+ @return the current element in the chain, as <b>before</em> the chain move.
+ */
+ const ::com::sun::star::sdbc::SQLException* next();
+
+ /** proceeds to the next element in the chain
+
+ In opposite to the second <member>current</member>, this version allows typed access to
+ the respective SQLException.
+ */
+ void next( SQLExceptionInfo& _out_rInfo );
+};
+
+//==================================================================================
+//= StandardExceptions
+//==================================================================================
+//----------------------------------------------------------------------------------
+/** returns a standard error string for a given SQLState
+
+ @param _eState
+ describes the state whose description is to retrieve. Must not be SQL_ERROR_UNSPECIFIED.
+ @raises RuntimeException
+ in case of an internal error
+*/
+OOO_DLLPUBLIC_DBTOOLS OUString getStandardSQLState( StandardSQLState _eState );
+
+//----------------------------------------------------------------------------------
+/** returns a standard ASCII string for a given SQLState
+
+ @param _eState
+ describes the state whose description is to retrieve. Must not be SQL_ERROR_UNSPECIFIED.
+ @return
+ a non-<NULL/> pointer to an ASCII character string denoting the requested SQLState
+ @raises RuntimeException
+ in case of an internal error
+*/
+OOO_DLLPUBLIC_DBTOOLS const sal_Char* getStandardSQLStateAscii( StandardSQLState _eState );
+
+//----------------------------------------------------------------------------------
+OOO_DLLPUBLIC_DBTOOLS void throwFunctionNotSupportedException(
+ const OUString& _rMsg,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _Context,
+ const ::com::sun::star::uno::Any& _Next = ::com::sun::star::uno::Any()
+ )
+ throw ( ::com::sun::star::sdbc::SQLException );
+
+//----------------------------------------------------------------------------------
+/** throws an exception with SQL state IM001, saying that a certain function is not supported
+*/
+OOO_DLLPUBLIC_DBTOOLS void throwFunctionNotSupportedException(
+ const sal_Char* _pAsciiFunctionName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
+ const ::com::sun::star::uno::Any* _pNextException = NULL
+ )
+ throw ( ::com::sun::star::sdbc::SQLException );
+
+//----------------------------------------------------------------------------------
+/** throws a function sequence (HY010) exception
+*/
+OOO_DLLPUBLIC_DBTOOLS void throwFunctionSequenceException(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _Context,
+ const ::com::sun::star::uno::Any& _Next = ::com::sun::star::uno::Any()
+ )
+ throw ( ::com::sun::star::sdbc::SQLException );
+
+//----------------------------------------------------------------------------------
+/** throw a invalid index sqlexception
+*/
+OOO_DLLPUBLIC_DBTOOLS void throwInvalidIndexException(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _Context,
+ const ::com::sun::star::uno::Any& _Next = ::com::sun::star::uno::Any()
+ )
+ throw ( ::com::sun::star::sdbc::SQLException );
+
+//----------------------------------------------------------------------------------
+/** throw a generic SQLException, i.e. one with an SQLState of HY000, an ErrorCode of 0 and no NextException
+*/
+OOO_DLLPUBLIC_DBTOOLS void throwGenericSQLException(
+ const OUString& _rMsg,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxSource
+ )
+ throw (::com::sun::star::sdbc::SQLException);
+
+//----------------------------------------------------------------------------------
+/** throw a generic SQLException, i.e. one with an SQLState of HY000, an ErrorCode of 0 and no NextException
+*/
+OOO_DLLPUBLIC_DBTOOLS void throwGenericSQLException(
+ const OUString& _rMsg,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxSource,
+ const ::com::sun::star::uno::Any& _rNextException
+ )
+ throw (::com::sun::star::sdbc::SQLException);
+
+//----------------------------------------------------------------------------------
+/** throw a SQLException with SQLState HYC00 (Optional feature not implemented)
+ @param _pAsciiFeatureName
+ an ASCII description of the feature which is not implemented. It's recommended that the feature
+ name is built from the name of the interface plus its method, for instance "XParameters::updateBinaryStream"
+ @param _rxContext
+ the context of the exception
+ @param _pNextException
+ the next exception to chain into the thrown exception, if any
+*/
+OOO_DLLPUBLIC_DBTOOLS void throwFeatureNotImplementedException(
+ const sal_Char* _pAsciiFeatureName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
+ const ::com::sun::star::uno::Any* _pNextException = NULL
+ )
+ throw (::com::sun::star::sdbc::SQLException);
+
+//----------------------------------------------------------------------------------
+/** throws an SQLException
+*/
+OOO_DLLPUBLIC_DBTOOLS void throwSQLException(
+ const sal_Char* _pAsciiMessage,
+ const sal_Char* _pAsciiState,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
+ const sal_Int32 _nErrorCode = 0,
+ const ::com::sun::star::uno::Any* _pNextException = NULL
+ )
+ throw (::com::sun::star::sdbc::SQLException);
+
+//----------------------------------------------------------------------------------
+/** throws an SQLException
+*/
+OOO_DLLPUBLIC_DBTOOLS void throwSQLException(
+ const sal_Char* _pAsciiMessage,
+ StandardSQLState _eSQLState,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
+ const sal_Int32 _nErrorCode = 0,
+ const ::com::sun::star::uno::Any* _pNextException = NULL
+ )
+ throw (::com::sun::star::sdbc::SQLException);
+
+//----------------------------------------------------------------------------------
+/** throws an SQLException
+*/
+OOO_DLLPUBLIC_DBTOOLS void throwSQLException(
+ const OUString& _rMessage,
+ StandardSQLState _eSQLState,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
+ const sal_Int32 _nErrorCode = 0,
+ const ::com::sun::star::uno::Any* _pNextException = NULL
+ )
+ throw (::com::sun::star::sdbc::SQLException);
+
+//.........................................................................
+} // namespace dbtools
+//.........................................................................
+
+#endif // _DBHELPER_DBEXCEPTION_HXX_
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/dbmetadata.hxx b/include/connectivity/dbmetadata.hxx
new file mode 100644
index 000000000000..565854ba7ed8
--- /dev/null
+++ b/include/connectivity/dbmetadata.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 CONNECTIVITY_INC_CONNECTIVITY_DBMETADATA_HXX
+#define CONNECTIVITY_INC_CONNECTIVITY_DBMETADATA_HXX
+
+#include <com/sun/star/sdbc/XConnection.hpp>
+
+#include <memory>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace comphelper
+{
+ class ComponentContext;
+}
+
+//........................................................................
+namespace dbtools
+{
+//........................................................................
+
+ //====================================================================
+ //= DatabaseMetaData
+ //====================================================================
+ struct DatabaseMetaData_Impl;
+ /** encapsulates meta data about a database/connection which cannot be obtained
+ from the usual XDatabaseMetaData result set.
+
+ Meta data perhaps isn't really the right term ... Some of the methods
+ in this class involved heuristics, some are just a convenient wrapper
+ around more complex ways to obtain the same information.
+
+ @todo
+ Once CWS dba30 is integrated, we could easily add all the meta data
+ which is part of the "Info" property of a data source.
+ */
+ class OOO_DLLPUBLIC_DBTOOLS DatabaseMetaData
+ {
+ private:
+ ::std::auto_ptr< DatabaseMetaData_Impl > m_pImpl;
+
+ public:
+ DatabaseMetaData();
+ /** constructs a DatabaseMetaData instance
+ @param _rxConnection
+ is the connection whose meta data you're interested in.
+ Note that some of the information provided by this class can only be obtained
+ if this connection denotes an application-level connection, i.e. supports
+ the com.sun.star.sdb.Connection service.
+
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ if the given connection is not <NULL/>, but the XDatabaseMetaData provided by it
+ are <NULL/>
+ @throws ::com::sun::star::sdbc::SQLException
+ if obtaining the meta data from the connection throws an SQLException
+ @throws ::com::sun::star::uno::RuntimeException
+ if obtaining the meta data from the connection throws an RuntimeException
+ */
+ DatabaseMetaData(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _connection );
+ DatabaseMetaData( const DatabaseMetaData& _copyFrom );
+ DatabaseMetaData& operator=( const DatabaseMetaData& _copyFrom );
+
+ ~DatabaseMetaData();
+
+ public:
+ /** determines whether or not the instances is based on a valid connection
+
+ As long as this method returns true<TRUE/>, you should expect all other
+ methods throwing an SQLException when called.
+ */
+ bool isConnected() const;
+
+ /** resets the instance so that it's based on a new connection
+ */
+ inline void reset( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _connection )
+ {
+ *this = DatabaseMetaData( _connection );
+ }
+
+ /// wraps XDatabaseMetaData::getIdentifierQuoteString
+ const OUString& getIdentifierQuoteString() const;
+
+ /// wraps XDatabaseMetaData::getCatalogSeparator
+ const OUString& getCatalogSeparator() const;
+
+ /** determines whether the database supports sub queries in the FROM part
+ of a SELECT clause are supported.
+ @throws ::com::sun::star::sdbc::SQLException
+ with SQLState 08003 (connection does not exist) if the instances was
+ default-constructed and does not have a connection, yet.
+ */
+ bool supportsSubqueriesInFrom() const;
+
+ /** checks whether the database supports primary keys
+
+ Since there's no dedicated API to ask a database for this, a heuristics needs to be applied.
+ First, the <code>PrimaryKeySupport<code> settings of the data source is examined. If it is <TRUE/>
+ or <FALSE/>, then value is returned. If it is <NULL/>, then the database meta data are examined
+ for support of core SQL grammar, and the result is returned. The assumption is that a database/driver
+ which supports core SQL grammar usually also supports primary keys, and vice versa. At least, experience
+ shows this is true most of the time.
+ */
+ bool supportsPrimaryKeys() const;
+
+ /** determines whether names in the database should be restricted to SQL-92 identifiers
+
+ Effectively, this method checks the EnableSQL92Check property of the data source settings,
+ if present.
+ */
+ bool restrictIdentifiersToSQL92() const;
+
+ /** determines whether when generating SQL statements, an AS keyword should be generated
+ before a correlation name.
+
+ E.g., it determines whether <code>SELECT * FROM table AS correlation_name</code> or
+ <code>SELECT * FROM table correlation_name</code> is generated.
+ */
+ bool generateASBeforeCorrelationName() const;
+
+ /** should date time be escaped like '2001-01-01' => {D '2001-01-01' }
+ */
+ bool shouldEscapeDateTime() const;
+
+ /** auto increment columns should be automaticly used as primary key.
+ */
+ bool isAutoIncrementPrimaryKey() const;
+
+ /** determines the syntax to use for boolean comparison predicates
+
+ @see ::com::sun::star::sdb::BooleanComparisonMode
+ */
+ sal_Int32
+ getBooleanComparisonMode() const;
+
+ /** determines in relations are supported.
+ *
+ * \return <TRUE/> when relations are supported, otherwise <FALSE/>
+ */
+ bool supportsRelations() const;
+
+ /** determines if column alias names can be used in the order by clause.
+ *
+ * \return <TRUE/> when relations are supported, otherwise <FALSE/>
+ */
+ bool supportsColumnAliasInOrderBy() const;
+
+ /** determines whether user administration is supported for the database
+
+ User administration support is controlled by the availability of the XUsersSupplier
+ interface, and it returning a non-NULL users container.
+
+ @param _rContext
+ the component context we operate in. Might be needed to create the
+ css.sdbc.DriverManager instance.
+ */
+ bool supportsUserAdministration( const ::comphelper::ComponentContext& _rContext ) const;
+
+ /** determines whether in the application UI, empty table folders (aka catalogs/schemas) should be displayed
+ */
+ bool displayEmptyTableFolders() const;
+
+ /** determines that threads are supported.
+ *
+ * \return <TRUE/> when threads are supported, otherwise <FALSE/>
+ */
+ bool supportsThreads() const;
+ };
+
+//........................................................................
+} // namespace dbtools
+//........................................................................
+
+#endif // CONNECTIVITY_INC_CONNECTIVITY_DBMETADATA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/dbtools.hxx b/include/connectivity/dbtools.hxx
new file mode 100644
index 000000000000..9706af6ccb1c
--- /dev/null
+++ b/include/connectivity/dbtools.hxx
@@ -0,0 +1,787 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#define _CONNECTIVITY_DBTOOLS_HXX_
+
+#include <connectivity/dbexception.hxx>
+#include <comphelper/types.hxx>
+#include <com/sun/star/sdbc/DataType.hpp>
+#include <comphelper/stl_types.hxx>
+#include <unotools/sharedunocomponent.hxx>
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/FValue.hxx"
+
+namespace com { namespace sun { namespace star {
+
+namespace sdb {
+ class XSingleSelectQueryComposer;
+ class SQLContext;
+}
+namespace sdbcx {
+ class XTablesSupplier;
+}
+namespace sdbc {
+ class XConnection;
+ class XDatabaseMetaData;
+ class XRowSet;
+ class XDataSource;
+ class SQLException;
+ class XParameters;
+ class XRowUpdate;
+}
+namespace beans {
+ class XPropertySet;
+}
+namespace awt {
+ class XWindow;
+}
+namespace lang {
+ struct Locale;
+ class XMultiServiceFactory;
+ class WrappedTargetException;
+}
+namespace container {
+ class XNameAccess;
+}
+namespace uno {
+ class XComponentContext;
+}
+namespace util {
+ class XNumberFormatTypes;
+ class XNumberFormatsSupplier;
+}
+namespace task {
+ class XInteractionHandler;
+}
+
+} } }
+
+
+//.........................................................................
+namespace dbtools
+{
+ class ISQLStatementHelper;
+ typedef ::utl::SharedUNOComponent< ::com::sun::star::sdbc::XConnection > SharedConnection;
+
+ enum EComposeRule
+ {
+ eInTableDefinitions,
+ eInIndexDefinitions,
+ eInDataManipulation,
+ eInProcedureCalls,
+ eInPrivilegeDefinitions,
+ eComplete
+ };
+//=========================================================================
+ // date conversion
+
+ // calculates the default numberformat for a given datatype and a give language
+ OOO_DLLPUBLIC_DBTOOLS
+ sal_Int32 getDefaultNumberFormat(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xColumn,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes >& _xTypes,
+ const ::com::sun::star::lang::Locale& _rLocale);
+
+ // calculates the default numberformat for a given datatype and a give language
+ // @param _nDataType @see com.sun.star.sdbc.DataType
+ // @param _nScale can be zero
+ OOO_DLLPUBLIC_DBTOOLS
+ sal_Int32 getDefaultNumberFormat(sal_Int32 _nDataType,
+ sal_Int32 _nScale,
+ sal_Bool _bIsCurrency,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes >& _xTypes,
+ const ::com::sun::star::lang::Locale& _rLocale);
+
+//=========================================================================
+
+ /** creates a connection which can be used for the rowset given
+
+ The function tries to obtain a connection for the row set with the following
+ steps (in this order):
+ <nl>
+ <li>If the rowset already has an ActiveConnection (means a non-<NULL/> value vor this property),
+ this one is used.</li>
+ <li>If row set is part of a database form document (see ->isEmbeddedInDatabase),
+ a connection for the respective database is used.</li>
+ <li>If in the parent hierarchy of the row set, there is an object supporting
+ the XConnection interface, this one is returned.</li>
+ <li>If the DataSourceName property of the row set is not empty, a connection for this
+ data source is retrieved.</li>
+ <li>If the URL property of the row set is not empty, an connection for this URL is
+ retrieved from the driver manager.
+ </nl>
+
+ @param _rxRowSet
+ the row set
+
+ @param _rxFactory
+ a service factory, which can be used to create data sources, interaction handler etc (the usual stuff)
+
+ @param _bSetAsActiveConnection
+ If <TRUE/>, the calculated connection is set as ActiveConnection property on the rowset.
+
+ If the connection was newly created by the method, and this parameter is <TRUE/>, then
+ the ownership of the connection is delivered to a temporary object, which observes the
+ row set: As soon as a connection-relevant property of the row set changes, or as soon
+ as somebody else sets another ActiveConnection at the row set, the original
+ connection (the one which this function calculated) is disposed and discarded. At this
+ very moment, also the temporary observer object dies. This way, it is ensured that
+ there's no resource leak from an un-owned connection object.
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> connectRowset(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext,
+ sal_Bool _bSetAsActiveConnection
+ ) SAL_THROW ( ( ::com::sun::star::sdbc::SQLException
+ , ::com::sun::star::lang::WrappedTargetException
+ , ::com::sun::star::uno::RuntimeException ) );
+
+ /** ensures that a row set has a valid ActiveConnection, if possible
+
+ This function does nearly the same as ->connectRowset. In fact, it is to be preferred over
+ ->connectRowset, if possible.
+
+ There are a few differences:
+ <ul><li>If a connection could be determined for the given RowSet, it is always
+ set as ActiveConnection.</li>
+ <li>Definition of the ownership of the created connection allows for more scenarios:
+ <ul><li>If the connection was not newly created, the returned ->SharedConnection
+ instance will not have the ownership, since in this case it's assumed
+ that there already is an instance which has the ownership.</li>
+ <li>If the connection was newly created, and ->_bUseAutoConnectionDisposer
+ is <TRUE/>, then the returned SharedConnection instance will <em>not</em>
+ be the owner of the connection. Instead, the ownership will be delivered
+ to a temporary object as described for connectRowset.</li>
+ <li>If the connection was newly created, and ->_bUseAutoConnectionDisposer
+ is <FALSE/>, then the returned SharedConnection instance will have the
+ ownership of the XConnection.</li>
+ </ul>
+ </li>
+ </ul>
+ */
+ OOO_DLLPUBLIC_DBTOOLS SharedConnection ensureRowSetConnection(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext,
+ bool _bUseAutoConnectionDisposer
+ ) SAL_THROW ( ( ::com::sun::star::sdbc::SQLException
+ , ::com::sun::star::lang::WrappedTargetException
+ , ::com::sun::star::uno::RuntimeException ) );
+
+ /** returns the connection the RowSet is currently working with (which is the ActiveConnection property)
+ */
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet) throw (::com::sun::star::uno::RuntimeException);
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection_withFeedback(
+ const OUString& _rDataSourceName,
+ const OUString& _rUser,
+ const OUString& _rPwd,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext)
+ SAL_THROW ( (::com::sun::star::sdbc::SQLException) );
+
+
+ /** determines whether the given component is part of a document which is an embedded database
+ document (such as a form)
+ */
+ OOO_DLLPUBLIC_DBTOOLS bool isEmbeddedInDatabase(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent,
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxActualConnection
+ );
+
+ /** returns the columns of the named table of the given connection
+ */
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getTableFields(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConn,
+ const OUString& _rName
+ );
+
+ /** returns the primary key columns of the table
+ */
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getPrimaryKeyColumns_throw(
+ const ::com::sun::star::uno::Any& i_aTable
+ );
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getPrimaryKeyColumns_throw(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_xTable
+ );
+
+ /** get fields for a result set given by a "command descriptor"
+
+ <p>A command descriptor here means:
+ <ul><li>a SDB-level connection (<type scope="com.sun.star.sdb">Connection</type></li>
+ <li>a string specifying the name of an object relative to the connection</li>
+ <li>a <type scope="com.sun.star.sdb">CommandType</type> value specifying the type
+ of the object</type></li>
+ </ul>
+ </p>
+
+ @param _rxConnection
+ the connection relative to which the to-be-examined object exists
+
+ @param _nCommandType
+ the type of the object
+
+ @param _rCommand
+ the object. This may be a table name, a query name, or an SQL statement, depending on the value
+ of <arg>_nCommandType</arg>
+
+ @param _rxCollectionOner
+ If (and only if) <arg>CommandType</arg> is CommandType.COMMAND, the fields collection which is returned
+ by this function here is a temporary object. It is kept alive by another object, which is to be
+ created temporarily, too. To ensure that the fields you get are valid as long as you need them,
+ the owner which controls their life time is transfered to this parameter upon return.<br/>
+
+ Your fields live as long as this component lives.<br/>
+
+ Additionally, you are encouraged to dispose this component as soon as you don't need the fields anymore.
+ It depends on the connection's implementation if this is necessary, but the is no guarantee, so to
+ be on the safe side with respect to resource leaks, you should dispose the component.
+
+ @param _pErrorInfo
+ If not <NULL/>, then upon return from the function the instance pointed to by this argument will
+ contain any available error information in case something went wrong.
+
+ @return
+ the container of the columns (aka fields) of the object
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
+ getFieldsByCommandDescriptor(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const sal_Int32 _nCommandType,
+ const OUString& _rCommand,
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxKeepFieldsAlive,
+ SQLExceptionInfo* _pErrorInfo = NULL
+ ) SAL_THROW( ( ) );
+
+
+ /** get fields for a result set given by a "command descriptor"
+
+ <p>A command descriptor here means:
+ <ul><li>a SDB-level connection (<type scope="com.sun.star.sdb">Connection</type></li>
+ <li>a string specifying the name of an object relative to the connection</li>
+ <li>a <type scope="com.sun.star.sdb">CommandType</type> value specifying the type
+ of the object</type></li>
+ </ul>
+ </p>
+
+ @param _rxConnection
+ the connection relative to which the to-be-examined object exists
+
+ @param _nCommandType
+ the type of the object
+
+ @param _rCommand
+ the object. This may be a table name, a query name, or an SQL statement, depending on the value
+ of <arg>_nCommandType</arg>
+
+ @param _pErrorInfo
+ If not <NULL/>, then upon return from the function the instance pointed to by this argument will
+ contain any available error information in case something went wrong.
+
+ @return
+ an array of strings containing the names of the columns (aka fields) of the object
+ */
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Sequence< OUString >
+ getFieldNamesByCommandDescriptor(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const sal_Int32 _nCommandType,
+ const OUString& _rCommand,
+ SQLExceptionInfo* _pErrorInfo = NULL
+ ) SAL_THROW( ( ) );
+
+
+ /** create a new ::com::sun::star::sdbc::SQLContext, fill it with the given descriptions and the given source,
+ and <i>append</i> _rException (i.e. put it into the NextException member of the SQLContext).
+ */
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::sdb::SQLContext prependContextInfo(const ::com::sun::star::sdbc::SQLException& _rException, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext, const OUString& _rContextDescription, const OUString& _rContextDetails );
+
+ OOO_DLLPUBLIC_DBTOOLS
+ ::com::sun::star::sdbc::SQLException prependErrorInfo(
+ const ::com::sun::star::sdbc::SQLException& _rChainedException,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
+ const OUString& _rAdditionalError,
+ const StandardSQLState _eSQLState = SQL_ERROR_UNSPECIFIED,
+ const sal_Int32 _nErrorCode = 0);
+
+ /** search the parent hierachy for a data source.
+ */
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> findDataSource(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParent);
+
+ /** determines the value of a booolean data source setting, given by ASCII name
+
+ @param _rxConnection
+ the connection belonging to the data source whose setting is to be retrieved
+ @param _pAsciiSettingName
+ the ASCII name of the setting
+ */
+ OOO_DLLPUBLIC_DBTOOLS bool getBooleanDataSourceSetting(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const sal_Char* _pAsciiSettingName
+ );
+
+ /** check if a specific property is enabled in the info sequence
+ @deprecated
+ Use getBooleanDataSourceSetting instead, which cares for the default of the property itself,
+ instead of spreading this knowledge through all callers.
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ sal_Bool isDataSourcePropertyEnabled(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xProp
+ ,const OUString& _sProperty,
+ sal_Bool _bDefault = sal_False);
+
+ /** retrieves a particular indirect data source setting
+
+ @param _rxDataSource
+ a data source component
+ @param _pAsciiSettingsName
+ the ASCII name of the setting to obtain
+ @param _rSettingsValue
+ the value of the setting, upon successful return
+
+ @return
+ <FALSE/> if the setting is not present in the <member scope="com::sun::star::sdb">DataSource::Info</member>
+ member of the data source
+ <TRUE/> otherwise
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ bool getDataSourceSetting(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDataSource,
+ const sal_Char* _pAsciiSettingsName,
+ ::com::sun::star::uno::Any& /* [out] */ _rSettingsValue
+ );
+ OOO_DLLPUBLIC_DBTOOLS
+ bool getDataSourceSetting(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDataSource,
+ const OUString& _sSettingsName,
+ ::com::sun::star::uno::Any& /* [out] */ _rSettingsValue
+ );
+
+ OOO_DLLPUBLIC_DBTOOLS OUString getDefaultReportEngineServiceName(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
+
+ /** quote the given name with the given quote string.
+ */
+ OOO_DLLPUBLIC_DBTOOLS OUString quoteName(const OUString& _rQuote, const OUString& _rName);
+
+ /** quote the given table name (which may contain a catalog and a schema) according to the rules provided by the meta data
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ OUString quoteTableName(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _rxMeta
+ , const OUString& _rName
+ ,EComposeRule _eComposeRule);
+
+ /** split a fully qualified table name (including catalog and schema, if appliable) into it's component parts.
+ @param _rxConnMetaData meta data describing the connection where you got the table name from
+ @param _rQualifiedName fully qualified table name
+ @param _rCatalog (out parameter) upon return, contains the catalog name
+ @param _rSchema (out parameter) upon return, contains the schema name
+ @param _rName (out parameter) upon return, contains the table name
+ @param _eComposeRule where do you need the name for
+ */
+ OOO_DLLPUBLIC_DBTOOLS void qualifiedNameComponents(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxConnMetaData,
+ const OUString& _rQualifiedName, OUString& _rCatalog, OUString& _rSchema, OUString& _rName,EComposeRule _eComposeRule);
+
+ /** calculate a NumberFormatsSupplier for use with an given connection
+ @param _rxConn the connection for which the formatter is requested
+ @param _bAllowDefault if the connection (and related components, such as it's parent) cannot supply
+ a formatter, we can ask the DatabaseEnvironment for a default one. This parameter
+ states if this is allowed.
+ @param _rxFactory required (only of _bAllowDefault is sal_True) for creating the DatabaseEnvironment.
+ @return the formatter all object related to the given connection should work with.
+ */
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> getNumberFormats(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConn,
+ sal_Bool _bAllowDefault = sal_False,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>()
+ );
+
+ /** create an <type scope="com::sun::star::sdb">XSingleSelectQueryComposer</type> which represents
+ the current settings (Command/CommandType/Filter/Order) of the given rowset.
+
+ As such an instance can be obtained from a <type scope="com::sun::star::sdb">Connection</type>
+ only the function searches for the connection the RowSet is using via connectRowset.
+ This implies that a connection will be set on the RowSet if needed.
+ (need to changes this sometimes ...)
+ */
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer > getCurrentSettingsComposer(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxRowSetProps,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext
+ );
+
+ /** transfer and translate properties between two FormComponents
+ @param _rxOld the source property set
+ @param _rxNew the destination property set
+ @param _rLocale the locale for converting number related properties
+ */
+ OOO_DLLPUBLIC_DBTOOLS void TransferFormComponentProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxOld,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxNew,
+ const ::com::sun::star::lang::Locale& _rLocale
+ );
+
+ /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::INSERT
+ @param _rxCursorSet the property set
+ */
+ OOO_DLLPUBLIC_DBTOOLS sal_Bool canInsert(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet);
+ /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::UPDATE
+ @param _rxCursorSet the property set
+ */
+ OOO_DLLPUBLIC_DBTOOLS sal_Bool canUpdate(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet);
+ /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::DELETE
+ @param _rxCursorSet the property set
+ */
+ OOO_DLLPUBLIC_DBTOOLS sal_Bool canDelete(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet);
+
+ //----------------------------------------------------------------------------------
+ /** compose a complete table name from it's up to three parts, regarding to the database meta data composing rules
+ */
+ OOO_DLLPUBLIC_DBTOOLS OUString composeTableName( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxMetaData,
+ const OUString& _rCatalog,
+ const OUString& _rSchema,
+ const OUString& _rName,
+ sal_Bool _bQuote,
+ EComposeRule _eComposeRule);
+
+ /** composes a table name for usage in a SELECT statement
+
+ This includes quoting of the table as indicated by the connection's meta data, plus respecting
+ the settings "UseCatalogInSelect" and "UseSchemaInSelect", which might be present
+ in the data source which the connection belongs to.
+ */
+ OOO_DLLPUBLIC_DBTOOLS OUString composeTableNameForSelect(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const OUString& _rCatalog,
+ const OUString& _rSchema,
+ const OUString& _rName );
+
+ /** composes a table name for usage in a SELECT statement
+
+ This includes quoting of the table as indicated by the connection's meta data, plus respecting
+ the settings "UseCatalogInSelect" and "UseSchemaInSelect", which might be present
+ in the data source which the connection belongs to.
+ */
+ OOO_DLLPUBLIC_DBTOOLS OUString composeTableNameForSelect(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable );
+ //----------------------------------------------------------------------------------
+ /** compose the table name out of the property set which must support the properties from the service <member scope= "com::sun::star::sdbcx">table</member>
+ @param _xMetaData
+ The metadata from the connection.
+ @param _xTable
+ The table.
+ */
+ OOO_DLLPUBLIC_DBTOOLS OUString composeTableName(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _xMetaData,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable,
+ EComposeRule _eComposeRule,
+ bool _bSuppressCatalogName,
+ bool _bSuppressSchemaName,
+ bool _bQuote);
+
+ //----------------------------------------------------------------------------------
+ OOO_DLLPUBLIC_DBTOOLS sal_Int32 getSearchColumnFlag( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConn,
+ sal_Int32 _nDataType);
+ // return the datasource for the given datasource name
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> getDataSource(const OUString& _rsDataSourceName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
+
+ /** search for a name that is NOT in the NameAcces
+ @param _rxContainer
+ the NameAccess container to search in
+ @param _rBaseName
+ the base name that should be used to create the new name
+ @param _bStartWithNumber
+ When <TRUE/> the name ends with number even when the name itself doesn't occur in the collection.
+ @return
+ A name which doesn't exist in the collection.
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ OUString createUniqueName(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxContainer,
+ const OUString& _rBaseName,
+ sal_Bool _bStartWithNumber = sal_True);
+
+ /** creates a unique name which is not already used in the given name array
+ */
+ OOO_DLLPUBLIC_DBTOOLS OUString createUniqueName(
+ const ::com::sun::star::uno::Sequence< OUString >& _rNames,
+ const OUString& _rBaseName,
+ sal_Bool _bStartWithNumber = sal_True
+ );
+
+ /** create a name which is a valid SQL 92 identifier name
+ @param _rName the string which should be converted
+ @param _rSpecials @see com.sun.star.sdbc.XDatabaseMetaData.getExtraNameCharacters
+
+ @see isValidSQLName
+ */
+ OOO_DLLPUBLIC_DBTOOLS OUString convertName2SQLName(const OUString& _rName,const OUString& _rSpecials);
+
+ /** checks whether the given name is a valid SQL name
+
+ @param _rName the string which should be converted
+ @param _rSpecials @see com.sun.star.sdbc.XDatabaseMetaData.getExtraNameCharacters
+
+ @see convertName2SQLName
+ */
+ OOO_DLLPUBLIC_DBTOOLS sal_Bool isValidSQLName( const OUString& _rName, const OUString& _rSpecials );
+
+ OOO_DLLPUBLIC_DBTOOLS
+ void showError( const SQLExceptionInfo& _rInfo,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& _pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
+
+ /** implements <method scope="com.sun.star.sdb">XRowUpdate::updateObject</method>
+ <p>The object which is to be set is analyzed, and in case it is a simlpe scalar type for which there
+ is another updateXXX method, this other method is used.</p>
+ @param _rxUpdatedObject
+ the interface to forward all updateXXX calls to (except updateObject)
+ @param _nColumnIndex
+ the column index to update
+ @param _rValue
+ the value to update
+ @return
+ <TRUE/> if the update request was successfully re-routed to one of the other updateXXX methods
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ sal_Bool implUpdateObject( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowUpdate >& _rxUpdatedObject,
+ const sal_Int32 _nColumnIndex,
+ const ::com::sun::star::uno::Any& _rValue) SAL_THROW ( ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) );
+
+
+
+ /** ask the user for parameters if the prepared statement needs some and sets them in the prepared statement
+ @param _xConnection the connection must be able to create <type scope="com::sun::star::sdb">SingleSelectQueryComposer</type>s
+ @param _xPreparedStmt the prepared statement where the parameters could be set when needed
+ @param _aParametersSet contains which parameters have to asked for and which already have set.
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ void askForParameters( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer >& _xComposer,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XParameters>& _xParameters,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxHandler,
+ const ::std::vector<bool, std::allocator<bool> >& _aParametersSet = ::std::vector<bool, std::allocator<bool> >());
+
+ /** call the appropriate set method for the specific sql type @see com::sun::star::sdbc::DataType
+ @param _xParams the parameters where to set the value
+ @param parameterIndex the index of the parameter, 1 based
+ @param x the value to set
+ @param sqlType the corresponding sql type @see com::sun::star::sdbc::DataType
+ @param scale the scale of the sql type can be 0
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ void setObjectWithInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XParameters>& _xParameters,
+ sal_Int32 parameterIndex,
+ const ::com::sun::star::uno::Any& x,
+ sal_Int32 sqlType,
+ sal_Int32 scale=0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+ /** call the appropriate set method for the specific sql type @see com::sun::star::sdbc::DataType
+ @param _xParams the parameters where to set the value
+ @param parameterIndex the index of the parameter, 1 based
+ @param x the value to set
+ @param sqlType the corresponding sql type @see com::sun::star::sdbc::DataType
+ @param scale the scale of the sql type can be 0
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ void setObjectWithInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XParameters>& _xParameters,
+ sal_Int32 parameterIndex,
+ const ::connectivity::ORowSetValue& x,
+ sal_Int32 sqlType,
+ sal_Int32 scale=0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+
+ /** implements <method scope="com.sun.star.sdb">XParameters::setObject</method>
+ <p>The object which is to be set is analyzed, and in case it is a simlpe scalar type for which there
+ is another setXXX method, this other method is used.</p>
+ @param _rxParameters
+ the interface to forward all setXXX calls to (except setObject)
+ @param _nColumnIndex
+ the column index to update
+ @param _rValue
+ the value to update
+ @return
+ <TRUE/> if the update request was successfully re-routed to one of the other updateXXX methods
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ sal_Bool implSetObject( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XParameters>& _rxParameters,
+ const sal_Int32 _nColumnIndex,
+ const ::com::sun::star::uno::Any& _rValue) SAL_THROW ( ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ) );
+
+ /** creates the standard sql create table statement without the key part.
+ @param descriptor
+ The descriptor of the new table.
+ @param _xConnection
+ The connection.
+ @param _bAddScale
+ The scale will also be added when the value is 0.
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ OUString createStandardCreateStatement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
+ ISQLStatementHelper* _pHelper,
+ const OUString& _sCreatePattern = OUString());
+
+ /** creates the standard sql statement for the key part of a create table statement.
+ @param descriptor
+ The descriptor of the new table.
+ @param _xConnection
+ The connection.
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ OUString createStandardKeyStatement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection);
+
+ /** creates the standard sql statement for the column part of a create table statement.
+ @param _pHelper
+ Allow to add special SQL constructs.
+ @param descriptor
+ The descriptor of the column.
+ @param _xConnection
+ The connection.
+ @param _pHelper
+ Allow to add special SQL constructs.
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ OUString createStandardColumnPart( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection
+ ,ISQLStatementHelper* _pHelper = NULL
+ ,const OUString& _sCreatePattern = OUString());
+
+ /** creates a SQL CREATE TABLE statement
+
+ @param descriptor
+ The descriptor of the new table.
+ @param _xConnection
+ The connection.
+ @param _pHelper
+ Allow to add special SQL constructs.
+ @param _sCreatePattern
+
+ @return
+ The CREATE TABLE statement.
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ OUString createSqlCreateTableStatement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection
+ ,ISQLStatementHelper* _pHelper = NULL
+ ,const OUString& _sCreatePattern = OUString());
+
+ /** creates a SDBC column with the help of getColumns.
+ @param _xTable
+ The table.
+ @param _rName
+ The name of the column.
+ @param _bCase
+ Is the column case sensitive.
+ @param _bQueryForInfo
+ If <TRUE/> the autoincrement and currency field will be read from the meta data, otherwise the following parameters will be used instead
+ @param _bIsAutoIncrement
+ <TRUE/> if the column is an autoincrement.
+ @param _bIsCurrency
+ <TRUE/> if the column is a currency field.
+ @param _nDataType
+ The data type of the column.
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>
+ createSDBCXColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
+ const OUString& _rName,
+ sal_Bool _bCase,
+ sal_Bool _bQueryForInfo = sal_True,
+ sal_Bool _bIsAutoIncrement = sal_False,
+ sal_Bool _bIsCurrency = sal_False,
+ sal_Int32 _nDataType = com::sun::star::sdbc::DataType::OTHER);
+
+ /** tries to locate the corresponding DataDefinitionSupplier for the given url and connection
+ @param _rsUrl
+ The URL used to connect to the database.
+ @param _xConnection
+ The connection used to find the correct driver.
+ @param _rxContext
+ Used to create the drivermanager.
+ @return
+ The datadefintion object.
+ */
+ OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier> getDataDefinitionByURLAndConnection(
+ const OUString& _rsUrl,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
+
+ /** returns the table privileges to the given parameters
+ @param _xMetaData
+ The meta data.
+ @param _sCatalog
+ contains the catalog name
+ @param _sSchema
+ contains the schema name
+ @param _sTable
+ contains the table name
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ sal_Int32 getTablePrivileges(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _xMetaData,
+ const OUString& _sCatalog,
+ const OUString& _sSchema,
+ const OUString& _sTable);
+
+ typedef ::std::pair<sal_Bool,sal_Bool> TBoolPair;
+ typedef ::std::pair< TBoolPair,sal_Int32 > ColumnInformation;
+ typedef ::std::multimap< OUString, ColumnInformation, ::comphelper::UStringMixLess> ColumnInformationMap;
+ /** collects the information about auto increment, currency and data type for the given column name.
+ The column must be quoted, * is also valid.
+ @param _xConnection
+ The connection.
+ @param _sComposedTableName
+ The quoted table name. ccc.sss.ttt
+ @param _sName
+ The name of the column, or *
+ @param _rInfo
+ The information about the column(s).
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ void collectColumnInformation( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
+ const OUString& _sComposedTableName,
+ const OUString& _rName,
+ ColumnInformationMap& _rInfo);
+
+
+ /** adds a boolean comparison clause to the given SQL predicate
+
+ @param _rExpression
+ the expression which is to be compared with a boolean value
+ @param _bValue
+ the boolean value which the expression is to be compared with
+ @param _nBooleanComparisonMode
+ the boolean comparison mode to be used. Usually obtained from
+ a css.sdb.DataSource's Settings member.
+ @param _out_rSQLPredicate
+ the buffer to which the comparison predicate will be appended
+ */
+ OOO_DLLPUBLIC_DBTOOLS void getBoleanComparisonPredicate(
+ const OUString& _rExpression,
+ const sal_Bool _bValue,
+ const sal_Int32 _nBooleanComparisonMode,
+ OUStringBuffer& _out_rSQLPredicate
+ );
+
+//.........................................................................
+} // namespace dbtools
+//.........................................................................
+
+#endif // _CONNECTIVITY_DBTOOLS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/dbtoolsdllapi.hxx b/include/connectivity/dbtoolsdllapi.hxx
new file mode 100644
index 000000000000..51210a633092
--- /dev/null
+++ b/include/connectivity/dbtoolsdllapi.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_CONNECTIVITY_DBTOOLSDLLAPI_HXX
+#define INCLUDED_CONNECTIVITY_DBTOOLSDLLAPI_HXX
+
+#include "sal/config.h"
+
+#include "sal/types.h"
+
+#if defined OOO_DLLIMPLEMENTATION_DBTOOLS
+#define OOO_DLLPUBLIC_DBTOOLS SAL_DLLPUBLIC_EXPORT
+#else
+#define OOO_DLLPUBLIC_DBTOOLS SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/filtermanager.hxx b/include/connectivity/filtermanager.hxx
new file mode 100644
index 000000000000..c489a91e5033
--- /dev/null
+++ b/include/connectivity/filtermanager.hxx
@@ -0,0 +1,123 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef CONNECTIVITY_FILTERMANAGER_HXX
+#define CONNECTIVITY_FILTERMANAGER_HXX
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/sdb/XSQLQueryComposer.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+
+#include <rtl/ustrbuf.hxx>
+
+#include <vector>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+//........................................................................
+namespace dbtools
+{
+//........................................................................
+
+ //====================================================================
+ //= FilterManager
+ //====================================================================
+ /** manages the filter of a database component with filter properties
+
+ The idea is that the filter which a database component actually really uses is composed of several single
+ filter components (which all are conjunctive).
+
+ First, there is a component which is visible to the clients of the database component itself - if they ask
+ the database component for the Filter property, they will get this public filter.
+
+ Second, there is an implicit filter, which is (to be) created from the MasterFields and DetailFields
+ property of the database component, if the latter denote columns.<br/>
+ For instance, if there is a link-pair CustomerID->cid, where |CustomerID| is a column of the master
+ database component, and |cid| is a column of the detail database component (the database component we're responsible for), then there will
+ be an implicit filter "cid = :param_cid_link" (or something like this), which is never visible
+ to the clients of the database component, but nevertheless needs to be propagated to the aggregated RowSet.<br/>
+ Actually, this implicit filter is maintained by the FormParameterManager.
+
+ Potentially, there could be more filter components (for instance, you could imagine database component
+ controls which act as live filter, which could be implemented with a third component), but
+ at the moment there are only these two.
+ */
+ class OOO_DLLPUBLIC_DBTOOLS FilterManager
+ {
+ public:
+ enum FilterComponent
+ {
+ fcPublicFilter = 0, // the filter which is to be published as "Filter" property of the database component
+ fcLinkFilter, // the filter part which is implicitly created for a database component when connecting
+ // master and detail database components via column names
+
+ FC_COMPONENT_COUNT // boundary delimiter, not to be used from outside
+ };
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
+ m_xORB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+ m_xComponentAggregate;
+ ::std::vector< OUString > m_aFilterComponents;
+ sal_Bool m_bApplyPublicFilter;
+
+ public:
+ /// ctor
+ explicit FilterManager(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
+ );
+
+ /// late ctor
+ void initialize(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxComponentAggregate );
+
+ /// makes the object forgetting the references to the database component
+ void dispose( );
+
+ const OUString& getFilterComponent( FilterComponent _eWhich ) const;
+ void setFilterComponent( FilterComponent _eWhich, const OUString& _rComponent );
+
+ inline sal_Bool isApplyPublicFilter( ) const { return m_bApplyPublicFilter; }
+ void setApplyPublicFilter( sal_Bool _bApply );
+
+ private:
+ /** retrieves a filter which is a conjunction of all single filter components
+ */
+ OUString getComposedFilter( ) const;
+
+ /** appends one filter component to the statement in our composer
+ */
+ void appendFilterComponent( OUStringBuffer& io_appendTo, const OUString& i_component ) const;
+
+ /// checks whether there is only one (or even no) non-empty filter component
+ bool isThereAtMostOneComponent( OUStringBuffer& o_singleComponent ) const;
+
+ /// returns the index of the first filter component which should be considered when building the composed filter
+ inline sal_Int32 getFirstApplicableFilterIndex() const
+ {
+ return m_bApplyPublicFilter ? fcPublicFilter : fcPublicFilter + 1;
+ }
+ };
+
+//........................................................................
+} // namespacefrm
+//........................................................................
+
+#endif // CONNECTIVITY_FORMFILTERMANAGER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/formattedcolumnvalue.hxx b/include/connectivity/formattedcolumnvalue.hxx
new file mode 100644
index 000000000000..fe5c4dbfff52
--- /dev/null
+++ b/include/connectivity/formattedcolumnvalue.hxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CONNECTIVITY_FORMATTEDCOLUMNVALUE_HXX
+#define CONNECTIVITY_FORMATTEDCOLUMNVALUE_HXX
+
+#include <com/sun/star/sdbc/XRowSet.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/sdb/XColumn.hpp>
+#include <com/sun/star/sdb/XColumnUpdate.hpp>
+#include <com/sun/star/util/XNumberFormatter.hpp>
+
+#include <boost/noncopyable.hpp>
+
+#include <memory>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace comphelper { class ComponentContext; }
+
+//........................................................................
+namespace dbtools
+{
+//........................................................................
+
+ struct FormattedColumnValue_Data;
+ //====================================================================
+ //= FormattedColumnValue
+ //====================================================================
+ /** a class which helps retrieving and setting the value of a database column
+ as formatted string.
+ */
+ class OOO_DLLPUBLIC_DBTOOLS FormattedColumnValue : public ::boost::noncopyable
+ {
+ public:
+ /** constructs an instance
+
+ The format key for the string value exchange is taken from the given column object.
+ If it has a non-<NULL/> property value <code>FormatKey</code>, this key is taken.
+ Otherwise, a default format matching the column type is determined.
+
+ The locale of this fallback format is the current system locale.
+
+ The number formats supplier is determined from the given <code>RowSet</code>, by
+ examining its <code>ActiveConnection</code>.
+ */
+ FormattedColumnValue(
+ const ::comphelper::ComponentContext& _rContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn
+ );
+
+ /** constructs an instance
+
+ The format key for the string value exchange is taken from the given column object.
+ If it has a non-<NULL/> property value <code>FormatKey</code>, this key is taken.
+ Otherwise, a default format matching the column type is determined.
+
+ The locale of this fallback format is the current system locale.
+ */
+ FormattedColumnValue(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& i_rNumberFormatter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_rColumn
+ );
+
+ // note that all methods of this class need to be virtual, since it's
+ // used in a load-on-demand context in module SVX
+
+ virtual ~FormattedColumnValue();
+
+ virtual void clear();
+
+ // access to the details of the formatting we determined
+ virtual sal_Int32 getFormatKey() const;
+ virtual sal_Int32 getFieldType() const;
+ virtual sal_Int16 getKeyType() const;
+ virtual const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >&
+ getColumn() const;
+ virtual const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumnUpdate >&
+ getColumnUpdate() const;
+
+ virtual bool setFormattedValue( const OUString& _rFormattedStringValue ) const;
+ virtual OUString getFormattedValue() const;
+
+ private:
+ ::std::auto_ptr< FormattedColumnValue_Data > m_pData;
+ };
+
+//........................................................................
+} // namespace dbtools
+//........................................................................
+
+#endif // CONNECTIVITY_FORMATTEDCOLUMNVALUE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/parameters.hxx b/include/connectivity/parameters.hxx
new file mode 100644
index 000000000000..9bdbe0e5c3fb
--- /dev/null
+++ b/include/connectivity/parameters.hxx
@@ -0,0 +1,417 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef CONNECTIVITY_PARAMETERS_HXX
+#define CONNECTIVITY_PARAMETERS_HXX
+
+#include <map>
+#include <vector>
+
+#include <com/sun/star/uno/XAggregation.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/form/XDatabaseParameterListener.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/sdbc/XParameters.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/paramwrapper.hxx"
+#include <unotools/sharedunocomponent.hxx>
+#include <comphelper/implementationreference.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+
+//........................................................................
+namespace dbtools
+{
+//........................................................................
+
+ typedef ::utl::SharedUNOComponent< ::com::sun::star::sdb::XSingleSelectQueryComposer, ::utl::DisposableComponent >
+ SharedQueryComposer;
+
+ //====================================================================
+ //= ParameterManager
+ //====================================================================
+ class FilterManager;
+ class OOO_DLLPUBLIC_DBTOOLS ParameterManager
+ {
+ public:
+ /// classifies the origin of the data to fill a parameter
+ enum ParameterClassification
+ {
+ /** parameters which are filled from the master-detail relationship, where the detail
+ name is an explicit parameter name
+ */
+ eLinkedByParamName,
+ /** parameters which are filled from the master-detail relationship, where the detail
+ name is a column name, so an implicit parameter had to be generated for it
+ */
+ eLinkedByColumnName,
+ /** parameters which are filled externally (i.e. by XParameters::setXXX, or by the parameter listeners)
+ */
+ eFilledExternally
+ };
+ /** meta data about an inner parameter
+ */
+ private:
+ struct ParameterMetaData
+ {
+ /// the type of the parameter
+ ParameterClassification eType;
+ /// the column object for this parameter, as returned by the query composer
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+ xComposerColumn;
+ /// the indicies of inner parameters which need to be filled when this concrete parameter is set
+ ::std::vector< sal_Int32 > aInnerIndexes;
+
+ /// default ctor
+ ParameterMetaData()
+ :eType( eFilledExternally )
+ {
+ }
+
+ /// ctor with composer column
+ ParameterMetaData( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn )
+ :eType ( eFilledExternally )
+ ,xComposerColumn ( _rxColumn )
+ {
+ }
+ };
+
+ typedef ::std::map< OUString, ParameterMetaData > ParameterInformation;
+
+ private:
+ ::osl::Mutex& m_rMutex;
+ ::cppu::OInterfaceContainerHelper m_aParameterListeners;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ m_xContext;
+
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::beans::XPropertySet >
+ m_xComponent; // the database component whose parameters we're handling
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >
+ m_xAggregatedRowSet; // the aggregated row set - necessary for unwrapped access to some interfaces
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XParameters >
+ m_xInnerParamUpdate; // write access to the inner parameters
+ SharedQueryComposer m_xComposer; // query composer wrapping the statement which the *aggregate* is based on
+ SharedQueryComposer m_xParentComposer; // query composer wrapping the statement of our parent database component
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >
+ m_xInnerParamColumns; // index access to the parameter columns, as got from the query composer
+
+ ::dbtools::param::ParametersContainerRef
+ m_pOuterParameters; // the container of parameters which still need to be filled in by
+ // external instances
+ sal_Int32 m_nInnerCount; // overall number of parameters as required by the database component's aggregate
+
+ ParameterInformation m_aParameterInformation;
+
+ ::com::sun::star::uno::Sequence< OUString > m_aMasterFields;
+ ::com::sun::star::uno::Sequence< OUString > m_aDetailFields;
+
+ OUString m_sIdentifierQuoteString;
+ OUString m_sSpecialCharacters;
+
+ ::std::vector< bool > m_aParametersVisited;
+
+ bool m_bUpToDate;
+
+ public:
+ /** ctor
+ */
+ explicit ParameterManager(
+ ::osl::Mutex& _rMutex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
+ );
+
+ /// late ctor
+ void initialize(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxComponent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >& _rxComponentAggregate
+ );
+
+ /// makes the object forgetting the references to the database component
+ void dispose( );
+
+ /// clears the instance data
+ void clearAllParameterInformation();
+
+ /// checks whether the parameter information are up-to-date
+ inline bool isUpToDate() const { return m_bUpToDate; }
+
+ /** updates all parameter information represented by the instance
+ */
+ void updateParameterInfo( FilterManager& _rFilterManager );
+
+ /** fills parameter values, as extensive as possible
+
+ <p>In particular, all values which can be filled from the master-detail relationship of
+ between our database component and it's parent are filled in.</p>
+
+ @param _rxCompletionHandler
+ an interaction handler which should be used to fill all parameters which
+ cannot be filled by other means. May be <NULL/>
+ @param _rClearForNotifies
+ the mutex guard to be (temporarily) cleared for notifications
+
+ @precond
+ the instance is alive, i.e. <member>isAlive</member> returns <TRUE/>
+
+ @return
+ <TRUE/> if and only if the parameter filling has <em>not</em> been cancelled by the user
+ */
+ bool fillParameterValues(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler,
+ ::osl::ResettableMutexGuard& _rClearForNotifies
+ );
+
+ /** sets all parameter values to null (via <member>XParameters::setNull</member>)
+
+ @precond
+ the instance is alive, i.e. <member>isAlive</member> returns <TRUE/>
+ */
+ void setAllParametersNull() SAL_THROW( ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ) );
+
+ /** resets all detail columns which are, via a parameter, linked to a master column, to
+ the value of this master column.
+
+ For instance, if the database component is bound to a statement <code>SELECT * from invoice where inv_id = :cid</code>,
+ and there is <em>one</em> master-detail link from
+
+ @precond
+ the instance is alive, i.e. <member>isAlive</member> returns <TRUE/>
+ */
+ void resetParameterValues() SAL_THROW(());
+
+ /** tells the object that it's database component is being disposed
+
+ The object then fires the <member>XEventListener::disposing</member> notification to
+ the parameter listeners
+ */
+ void disposing( const ::com::sun::star::lang::EventObject& _rDisposingEvent );
+
+ /** adds the given listener to the list of parameter listeners
+ */
+ void addParameterListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener >& _rxListener
+ );
+
+ /** removes the given listener from the list of parameter listeners
+ */
+ void removeParameterListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener >& _rxListener
+ );
+
+ // XParameters equivalents
+ void setNull ( sal_Int32 _nIndex, sal_Int32 sqlType);
+ void setObjectNull ( sal_Int32 _nIndex, sal_Int32 sqlType, const OUString& typeName);
+ void setBoolean ( sal_Int32 _nIndex, sal_Bool x);
+ void setByte ( sal_Int32 _nIndex, sal_Int8 x);
+ void setShort ( sal_Int32 _nIndex, sal_Int16 x);
+ void setInt ( sal_Int32 _nIndex, sal_Int32 x);
+ void setLong ( sal_Int32 _nIndex, sal_Int64 x);
+ void setFloat ( sal_Int32 _nIndex, float x);
+ void setDouble ( sal_Int32 _nIndex, double x);
+ void setString ( sal_Int32 _nIndex, const OUString& x);
+ void setBytes ( sal_Int32 _nIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x);
+ void setDate ( sal_Int32 _nIndex, const ::com::sun::star::util::Date& x);
+ void setTime ( sal_Int32 _nIndex, const ::com::sun::star::util::Time& x);
+ void setTimestamp ( sal_Int32 _nIndex, const ::com::sun::star::util::DateTime& x);
+ void setBinaryStream ( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x, sal_Int32 length);
+ void setCharacterStream ( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x, sal_Int32 length);
+ void setObject ( sal_Int32 _nIndex, const ::com::sun::star::uno::Any& x);
+ void setObjectWithInfo ( sal_Int32 _nIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale);
+ void setRef ( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef>& x);
+ void setBlob ( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob>& x);
+ void setClob ( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob>& x);
+ void setArray ( sal_Int32 _nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray>& x);
+ void clearParameters();
+
+ private:
+ /// checkes whether the object is already initialized, and not yet disposed
+ inline bool isAlive() const { return m_xComponent.get().is() && m_xInnerParamUpdate.is(); }
+
+ /** creates a filter expression from a master-detail link where the detail denotes a column name
+ */
+ OUString
+ createFilterConditionFromColumnLink(
+ const OUString& /* [in] */ _rMasterColumn,
+ const OUString& /* [in] */ _rDetailColumn,
+ OUString& /* [out] */ _rNewParamName
+ );
+
+ /** initializes our query composer, and the collection of inner parameter columns
+
+ @param _rxComponent
+ the database component to initialize from. Must not be <NULL/>
+ @return
+ <TRUE/> if and only if the initialization was successful
+
+ @postcond
+ if and only if <TRUE/> is returned, then <member>m_xInnerParamColumns</member> contains the collection of
+ inner parameters
+ */
+ bool initializeComposerByComponent(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxComponent
+ );
+
+ /** collects initial meta information about inner parameters (i.e. it initially fills
+ <member>m_aParameterInformation</member>).
+
+ @param _bSecondRun
+ if <TRUE/>, this is the second run, because we ourself previously extended the filter of
+ the RowSet
+
+ @precond
+ <member>m_xInnerParamColumns</member> is not <NULL/>
+ */
+ void collectInnerParameters( bool _bSecondRun );
+
+ /** analyzes the master-detail links for our database component, and initializes m_aMasterFields and m_aDetailFields
+
+ @param _rFilterManager
+ the filter manager of the database component
+ @param _rColumnsInLinkDetails
+ will be set to <TRUE/> if and only if there were link pairs where the detail field denoted
+ a column name of our database component
+
+ @precond
+ the instance is alive, i.e. <member>isAlive</member> returns <TRUE/>
+ */
+ void analyzeFieldLinks( FilterManager& _rFilterManager, bool& /* [out] */ _rColumnsInLinkDetails );
+
+ /** classifies the link pairs
+
+ @param _rxParentColumns
+ the columns of the parent database component
+
+ @param _rxColumns
+ the columns of our own database component
+
+ @param _out_rAdditionalFilterComponents
+ the additional filter components which are required for master-detail relationships where
+ the detail part denotes a column name. In such a case, an additional filter needs to be created,
+ containing a new parameter.
+
+ @precond
+ <member>m_aMasterFields</member> and <member>m_aDetailFields</member> have the same length
+ */
+ void classifyLinks(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxParentColumns,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxColumns,
+ ::std::vector< OUString >& _out_rAdditionalFilterComponents
+ ) SAL_THROW(( ::com::sun::star::uno::Exception ));
+
+ /** finalizes our <member>m_pOuterParameters</member> so that it can be used for
+ external parameter listeners
+
+ @precond
+ <member>m_pOuterParameters</member> is <NULL/>
+ @precond
+ <member>m_xInnerParamUpdate</member> is not <NULL/>
+ */
+ void createOuterParameters();
+
+ /** fills in the parameters values which result from the master-detail relationship
+ between the database component and it's parent
+
+ @param _rxParentColumns
+ the columns of the parameter database component. Must not be <NULL/>
+ @precond
+ the instance is alive, i.e. <member>isAlive</member> returns <TRUE/>
+ */
+ void fillLinkedParameters(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxParentColumns
+ );
+
+ /** completes all missing parameters via an interaction handler
+
+ @precond
+ the instance is alive, i.e. <member>isAlive</member> returns <TRUE/>
+
+ @return
+ <TRUE/> if and only if the parameter filling has <em>not</em> been cancelled by the user
+ */
+ bool completeParameters(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > _rxConnection
+ );
+
+ /** asks the parameter listeners to fill in final values
+
+ @precond
+ the instance is alive, i.e. <member>isAlive</member> returns <TRUE/>
+
+ @return
+ <TRUE/> if and only if the parameter filling has <em>not</em> been cancelled by the user
+ */
+ bool consultParameterListeners( ::osl::ResettableMutexGuard& _rClearForNotifies );
+
+ /** mark an externally filled parameter asvisited
+ */
+ void externalParameterVisited( sal_Int32 _nIndex );
+
+ private:
+ /** retrieves the columns of the parent database component
+
+ @precond
+ the instance is alive, i.e. <member>isAlive</member> returns <TRUE/>
+ @return
+ <TRUE/> if and only if the columns could be successfully retrieved
+ */
+ bool getParentColumns(
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& /* [out] */ _out_rxParentColumns,
+ bool _bFromComposer
+ );
+
+ /** retrieves the columns of our database component
+
+ @param _bFromComposer
+ if <TRUE/>, the columns are obtained from the composer, else from the living database component itself
+ @return
+ <TRUE/> if and only if the columns could be successfully retrieved
+ */
+ bool getColumns(
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& /* [out] */ _rxColumns,
+ bool _bFromComposer
+ ) SAL_THROW(( ::com::sun::star::uno::Exception ));
+
+ /** retrieves the active connection of the database component
+ */
+ bool getConnection(
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& /* [out] */ _rxConnection
+ );
+
+ /** caches some info about the connection of our database component
+ */
+ void cacheConnectionInfo() SAL_THROW(( ));
+
+ private:
+ ParameterManager(); // never implemented
+ ParameterManager( const ParameterManager& ); // never implemented
+ ParameterManager& operator=( const ParameterManager& ); // never implemented
+ };
+
+//........................................................................
+} // namespacefrm
+//........................................................................
+
+#endif // CONNECTIVITY_PARAMETERS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/paramwrapper.hxx b/include/connectivity/paramwrapper.hxx
new file mode 100644
index 000000000000..69347e9c4e6d
--- /dev/null
+++ b/include/connectivity/paramwrapper.hxx
@@ -0,0 +1,200 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CONNECTIVITY_PARAMWRAPPER_HXX
+#define CONNECTIVITY_PARAMWRAPPER_HXX
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <connectivity/FValue.hxx>
+
+#include <com/sun/star/sdbc/XParameters.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/sdb/XSingleSelectQueryAnalyzer.hpp>
+
+#include <comphelper/uno3.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <cppuhelper/compbase2.hxx>
+
+#include <memory>
+#include <vector>
+
+//........................................................................
+namespace dbtools
+{
+namespace param
+{
+//........................................................................
+
+ //====================================================================
+ //= ParameterWrapper
+ //====================================================================
+ /** wraps a parameter column as got from an SQLQueryComposer, so that it has an additional
+ property "Value", which is forwarded to an XParameters interface
+ */
+ class OOO_DLLPUBLIC_DBTOOLS ParameterWrapper :public ::cppu::OWeakObject
+ ,public ::comphelper::OMutexAndBroadcastHelper
+ ,public ::cppu::OPropertySetHelper
+ {
+ private:
+ typedef ::cppu::OWeakObject UnoBase;
+ typedef ::cppu::OPropertySetHelper PropertyBase;
+
+ private:
+ /// the most recently set value of the parameter
+ ::connectivity::ORowSetValue m_aValue;
+ /// the positions (in our m_xValueDestination) at which the value should be set (0-based!)
+ ::std::vector< sal_Int32 > m_aIndexes;
+
+ /// the "delegator" column to which standard property requests are forwarded
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xDelegator;
+ /// the property set info for our delegator
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > m_xDelegatorPSI;
+ /// the component taking the value
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XParameters > m_xValueDestination;
+ /// helper for implementing XPropertySetInfo
+ ::std::auto_ptr< ::cppu::OPropertyArrayHelper > m_pInfoHelper;
+
+
+ public:
+ const ::connectivity::ORowSetValue& Value() const { return m_aValue; }
+ ::connectivity::ORowSetValue& Value() { return m_aValue; }
+
+ public:
+ ParameterWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn
+ );
+
+ ParameterWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XParameters >& _rxAllParameters,
+ const ::std::vector< sal_Int32 >& _rIndexes
+ );
+
+ DECLARE_XINTERFACE()
+ DECLARE_XTYPEPROVIDER()
+
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ // OPropertySetHelper
+ virtual sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw( ::com::sun::star::lang::IllegalArgumentException );
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw( ::com::sun::star::uno::Exception );
+ virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
+
+ // pseudo-XComponent
+ virtual void SAL_CALL dispose();
+
+ protected:
+ virtual ~ParameterWrapper();
+
+ // disambiguations
+ using ::cppu::OPropertySetHelper::getFastPropertyValue;
+
+ private:
+ OUString impl_getPseudoAggregatePropertyName( sal_Int32 _nHandle ) const;
+
+ private:
+ ParameterWrapper(); // not implemented
+ };
+
+ //====================================================================
+ //= ParameterWrapperContainer
+ //====================================================================
+ typedef ::std::vector< ::rtl::Reference< ParameterWrapper > > Parameters;
+
+ //====================================================================
+ //= ParameterWrapperContainer
+ //====================================================================
+ typedef ::cppu::WeakComponentImplHelper2 < ::com::sun::star::container::XIndexAccess
+ , ::com::sun::star::container::XEnumerationAccess
+ > ParameterWrapperContainer_Base;
+
+ /// class for the parameter event @see approveParameter
+ class OOO_DLLPUBLIC_DBTOOLS ParameterWrapperContainer :
+ public ParameterWrapperContainer_Base
+ {
+ private:
+ ::osl::Mutex m_aMutex;
+ Parameters m_aParameters;
+
+ protected:
+ virtual ~ParameterWrapperContainer();
+
+ public:
+ /** creates an empty container
+ */
+ ParameterWrapperContainer();
+
+ /** creates a container from a SingleSelectQuerAnalyzer's parameter columns
+
+ Note that here, the simple constructor of the ParameterWrapper will be used, which does not
+ use a XParameters instance to forward values to, but only remembers the values itself.
+ */
+ ParameterWrapperContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer >& _rxComposer );
+
+ // ::com::sun::star::container::XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL hasElements() throw( ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::container::XEnumerationAccess
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration() throw( ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::container::XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 _rIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
+
+ public:
+ const Parameters& getParameters() { return m_aParameters; }
+
+ const ::connectivity::ORowSetValue& operator[]( size_t _index ) const { return m_aParameters[ _index ]->Value(); }
+ ::connectivity::ORowSetValue& operator[]( size_t _index ) { return m_aParameters[ _index ]->Value(); }
+
+ /** adds an ParameterWrapper to the end of the array
+ */
+ void push_back( ParameterWrapper* _pParameter )
+ {
+ m_aParameters.push_back( _pParameter );
+ }
+
+ size_t size() const { return m_aParameters.size(); }
+
+ protected:
+ // XComponent
+ virtual void SAL_CALL disposing();
+
+ private:
+ void impl_checkDisposed_throw();
+ };
+
+ //====================================================================
+ //= ParametersContainer
+ //====================================================================
+ typedef ::rtl::Reference< ParameterWrapperContainer > ParametersContainerRef;
+
+//........................................................................
+} } // namespace dbtools::param
+//........................................................................
+
+#endif // CONNECTIVITY_PARAMWRAPPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/predicateinput.hxx b/include/connectivity/predicateinput.hxx
new file mode 100644
index 000000000000..629419c9719d
--- /dev/null
+++ b/include/connectivity/predicateinput.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 CONNECTIVITY_PREDICATEINPUT_HXX
+#define CONNECTIVITY_PREDICATEINPUT_HXX
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/util/XNumberFormatter.hpp>
+#include <com/sun/star/i18n/XLocaleData4.hpp>
+#include <connectivity/sqlparse.hxx>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+//.........................................................................
+namespace dbtools
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OPredicateInputController
+ //=====================================================================
+ /** A class which allows input of an SQL predicate for a row set column
+ into a edit field.
+ */
+ class OOO_DLLPUBLIC_DBTOOLS OPredicateInputController
+ {
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >
+ m_xConnection;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >
+ m_xFormatter;
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData4 >
+ m_xLocaleData;
+
+ ::connectivity::OSQLParser
+ m_aParser;
+
+ public:
+ OPredicateInputController(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const ::connectivity::IParseContext* _pParseContext = NULL
+ );
+
+ /** transforms a "raw" predicate value (usually obtained from a user input) into a valid predicate for the given column
+ @param _rPredicateValue
+ The text to normalize.
+ @param _rxField
+ The field for which the text should be a predicate value.
+ @param _pErrorMessage
+ If not <NULL/>, and a parsing error occurs, the error message will be copied to the string the argument
+ points to.
+ */
+ sal_Bool normalizePredicateString(
+ OUString& _rPredicateValue,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField,
+ OUString* _pErrorMessage = NULL
+ ) const;
+
+ /** get's a value of the predicate which can be used in a WHERE clause.
+ @param _rPredicateValue
+ the value which has been normalized using normalizePredicateString
+ @param _rxField
+ is the field for which a predicate is to be entered
+ @param _bForStatementUse
+ If <TRUE/>, the returned value can be used in an SQL statement. If <FALSE/>, it can be used
+ for instance for setting parameter values.
+ @param _pErrorMessage
+ If not <NULL/>, and a parsing error occurs, the error message will be copied to the string the argument
+ points to.
+ @see normalizePredicateString
+ */
+ OUString getPredicateValue(
+ const OUString& _rPredicateValue,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & _rxField,
+ sal_Bool _bForStatementUse,
+ OUString* _pErrorMessage = NULL
+ ) const;
+
+ OUString getPredicateValue(
+ const OUString& _sField
+ , const OUString& _rPredicateValue
+ , sal_Bool _bForStatementUse
+ , OUString* _pErrorMessage = NULL) const;
+
+ private:
+ ::connectivity::OSQLParseNode* implPredicateTree(
+ OUString& _rErrorMessage,
+ const OUString& _rStatement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & _rxField
+ ) const;
+
+ sal_Bool getSeparatorChars(
+ const ::com::sun::star::lang::Locale& _rLocale,
+ sal_Unicode& _rDecSep,
+ sal_Unicode& _rThdSep
+ ) const;
+
+ OUString implParseNode(::connectivity::OSQLParseNode* pParseNode,sal_Bool _bForStatementUse) const;
+ };
+
+//.........................................................................
+} // namespace dbtools
+//.........................................................................
+
+#endif // CONNECTIVITY_PREDICATEINPUT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/IRefreshable.hxx b/include/connectivity/sdbcx/IRefreshable.hxx
new file mode 100644
index 000000000000..629b2b3137b5
--- /dev/null
+++ b/include/connectivity/sdbcx/IRefreshable.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 _CONNECTIVITY_SDBCX_IREFRESHABLE_HXX_
+#define _CONNECTIVITY_SDBCX_IREFRESHABLE_HXX_
+
+#include "connectivity/CommonTools.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE IRefreshableGroups
+ {
+ public:
+ virtual void refreshGroups() = 0;
+
+ protected:
+ ~IRefreshableGroups() {}
+ };
+
+ class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE IRefreshableUsers
+ {
+ public:
+ virtual void refreshUsers() = 0;
+
+ protected:
+ ~IRefreshableUsers() {}
+ };
+
+ class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE IRefreshableColumns
+ {
+ public:
+ virtual void refreshColumns() = 0;
+
+ protected:
+ ~IRefreshableColumns() {}
+ };
+ }
+}
+#endif //_CONNECTIVITY_SDBCX_IREFRESHABLE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VCatalog.hxx b/include/connectivity/sdbcx/VCatalog.hxx
new file mode 100644
index 000000000000..14840400b385
--- /dev/null
+++ b/include/connectivity/sdbcx/VCatalog.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 _CONNECTIVITY_SDBCX_CATALOG_HXX_
+#define _CONNECTIVITY_SDBCX_CATALOG_HXX_
+
+#include <osl/diagnose.h>
+#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
+#include <com/sun/star/sdbcx/XViewsSupplier.hpp>
+#include <com/sun/star/sdbcx/XUsersSupplier.hpp>
+#include <com/sun/star/sdbcx/XGroupsSupplier.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <cppuhelper/compbase5.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include "connectivity/CommonTools.hxx"
+#include "connectivity/OSubComponent.hxx"
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/StdTypeDefs.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+
+ class OCollection;
+ // OCatalog is a general catalog class
+ // other drivers can be derived their catalog from this class when they want to support sdbcx
+ // it holds already tables, views, groups and users
+
+ typedef ::cppu::WeakComponentImplHelper5< ::com::sun::star::sdbcx::XTablesSupplier,
+ ::com::sun::star::sdbcx::XViewsSupplier,
+ ::com::sun::star::sdbcx::XUsersSupplier,
+ ::com::sun::star::sdbcx::XGroupsSupplier,
+ ::com::sun::star::lang::XServiceInfo> OCatalog_BASE;
+
+
+ class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE OCatalog :
+ public OCatalog_BASE,
+ public IRefreshableGroups,
+ public IRefreshableUsers,
+ public connectivity::OSubComponent<OCatalog, OCatalog_BASE>
+ {
+ friend class connectivity::OSubComponent<OCatalog, OCatalog_BASE>;
+ protected:
+
+ ::osl::Mutex m_aMutex;
+
+ // this members are deleted when the dtor is called
+ // they are hold weak
+ OCollection* m_pTables;
+ OCollection* m_pViews;
+ OCollection* m_pGroups;
+ OCollection* m_pUsers;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData; // just to make things easier
+
+ /** builds the name which should be used to access the object later on in the collection.
+ Will only be called in fillNames.
+ @param _xRow
+ The current row from the resultset given to fillNames.
+ */
+ virtual OUString buildName( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >& _xRow);
+
+ /** fills a vector with the necessary names which can be used in combination with the collections.
+ For each row buildName will be called.
+ @param _xResult
+ The resultset which should be used to fill the names. Will be disposed after return and set to NULL.
+ @param _rNames
+ The vector who will be filled.
+ */
+ void fillNames(::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& _xResult,TStringVector& _rNames);
+
+ public:
+ OCatalog(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> &_xConnection);
+ virtual ~OCatalog();
+
+ DECLARE_SERVICE_INFO();
+
+ // refreshTables is called when the method getTables had been called
+ // the member m_pTables has to be created
+ virtual void refreshTables() = 0;
+ // refreshViews is called when the method getViews had been called
+ virtual void refreshViews() = 0;
+
+ // the other refresh methods come from base classes IRefreshableGroups and IRefreshableUsers
+
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ // XInterface
+ void SAL_CALL acquire() throw();
+ void SAL_CALL release() throw();
+ // XTablesSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTables( ) throw(::com::sun::star::uno::RuntimeException);
+ // XViewsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getViews( ) throw(::com::sun::star::uno::RuntimeException);
+ // XUsersSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getUsers( ) throw(::com::sun::star::uno::RuntimeException);
+ // XGroupsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getGroups( ) throw(::com::sun::star::uno::RuntimeException);
+
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_CATALOG_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VCollection.hxx b/include/connectivity/sdbcx/VCollection.hxx
new file mode 100644
index 000000000000..e30075f009e9
--- /dev/null
+++ b/include/connectivity/sdbcx/VCollection.hxx
@@ -0,0 +1,237 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CONNECTIVITY_SDBCX_COLLECTION_HXX_
+#define _CONNECTIVITY_SDBCX_COLLECTION_HXX_
+
+#include <cppuhelper/implbase10.hxx>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/container/XEnumeration.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/util/XRefreshable.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <com/sun/star/sdbcx/XAppend.hpp>
+#include <com/sun/star/sdbcx/XDrop.hpp>
+#include <com/sun/star/sdbc/XColumnLocate.hpp>
+#include <comphelper/stl_types.hxx>
+#include <cppuhelper/interfacecontainer.h>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include "connectivity/CommonTools.hxx"
+#include <com/sun/star/container/XContainer.hpp>
+#include "connectivity/StdTypeDefs.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <memory>
+
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+
+ // the class OCollection is base class for collections :-)
+ typedef ::cppu::ImplHelper10< ::com::sun::star::container::XNameAccess,
+ ::com::sun::star::container::XIndexAccess,
+ ::com::sun::star::container::XEnumerationAccess,
+ ::com::sun::star::container::XContainer,
+ ::com::sun::star::sdbc::XColumnLocate,
+ ::com::sun::star::util::XRefreshable,
+ ::com::sun::star::sdbcx::XDataDescriptorFactory,
+ ::com::sun::star::sdbcx::XAppend,
+ ::com::sun::star::sdbcx::XDrop,
+ ::com::sun::star::lang::XServiceInfo> OCollectionBase;
+
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > ObjectType;
+
+ class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE IObjectCollection
+ {
+ public:
+ virtual ~IObjectCollection();
+ virtual void reserve(size_t nLength) = 0;
+ virtual bool exists(const OUString& _sName ) = 0;
+ virtual bool empty() = 0;
+ virtual void swapAll() = 0;
+ virtual void swap() = 0;
+ virtual void clear() = 0;
+ virtual void reFill(const TStringVector &_rVector) = 0;
+ virtual void insert(const OUString& _sName,const ObjectType& _xObject) = 0;
+ virtual bool rename(const OUString _sOldName,const OUString _sNewName) = 0;
+ virtual sal_Int32 size() = 0;
+ virtual ::com::sun::star::uno::Sequence< OUString > getElementNames() = 0;
+ virtual OUString getName(sal_Int32 _nIndex) = 0;
+ virtual void disposeAndErase(sal_Int32 _nIndex) = 0;
+ virtual void disposeElements() = 0;
+ virtual sal_Int32 findColumn( const OUString& columnName ) = 0;
+ virtual OUString findColumnAtIndex( sal_Int32 _nIndex) = 0;
+ virtual ObjectType getObject(sal_Int32 _nIndex) = 0;
+ virtual ObjectType getObject(const OUString& columnName) = 0;
+ virtual void setObject(sal_Int32 _nIndex,const ObjectType& _xObject) = 0;
+ virtual sal_Bool isCaseSensitive() const = 0;
+ };
+ //************************************************************
+ // OCollection
+ //************************************************************
+ class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE OCollection :
+ public OCollectionBase
+ {
+ protected:
+ ::std::auto_ptr<IObjectCollection> m_pElements;
+
+ ::cppu::OInterfaceContainerHelper m_aContainerListeners;
+ ::cppu::OInterfaceContainerHelper m_aRefreshListeners;
+
+ protected:
+ ::cppu::OWeakObject& m_rParent; // parent of the collection
+ ::osl::Mutex& m_rMutex; // mutex of the parent
+ sal_Bool m_bUseIndexOnly; // is only TRUE when only an indexaccess is needed
+
+ // the implementing class should refresh their elements
+ virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException) = 0;
+
+ // will be called when a object was requested by one of the accessing methods like getByIndex
+ virtual ObjectType createObject(const OUString& _rName) = 0;
+
+ // will be called when a new object should be generated by a call of createDataDescriptor
+ // the returned object is empty will be filled outside and added to the collection
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
+
+ /** appends an object described by a descriptor, under a given name
+ @param _rForName
+ is the name under which the object should be appended. Guaranteed to not be empty.
+ This is passed for convenience only, since it's the result of a call of
+ getNameForObject for the given descriptor
+ @param descriptor
+ describes the object to append
+ @return
+ the new object which is to be inserted into the collection. This might be the result
+ of a call of <code>createObject( _rForName )</code>, or a clone of the descriptor.
+ */
+ virtual ObjectType appendObject( const OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
+
+ // called when XDrop was called
+ virtual void dropObject(sal_Int32 _nPos,const OUString _sElementName);
+
+ /** returns the name for the object. The default implementation ask for the property NAME. If this doesn't satisfy, it has to be overloaded.
+ @param _xObject The object where the name should be extracted.
+ @return The name of the object.
+ */
+ virtual OUString getNameForObject(const ObjectType& _xObject);
+
+ /** clones the given descriptor
+
+ The method calls createDescriptor to create a new, empty descriptor, and then copies all properties from
+ _descriptor to the new object, which is returned.
+
+ This method might come handy in derived classes for implementing appendObject, when the object
+ is not actually appended to any backend (e.g. for the columns collection of a descriptor object itself,
+ where there is not yet a database backend to append the column to).
+ */
+ ObjectType cloneDescriptor( const ObjectType& _descriptor );
+
+ OCollection(::cppu::OWeakObject& _rParent,
+ sal_Bool _bCase,
+ ::osl::Mutex& _rMutex,
+ const TStringVector &_rVector,
+ sal_Bool _bUseIndexOnly = sal_False,
+ sal_Bool _bUseHardRef = sal_True);
+
+ /** clear the name map
+ <p>Does <em>not</em> dispose the objects hold by the collection.</p>
+ */
+ void clear_NoDispose();
+
+ /** insert a new element into the collection
+ */
+ void insertElement(const OUString& _sElementName,const ObjectType& _xElement);
+
+ /** return the name of element at index _nIndex
+ */
+ inline OUString getElementName(sal_Int32 _nIndex)
+ {
+ return m_pElements->findColumnAtIndex(_nIndex);
+ }
+
+
+ /** return the object, if not existent it creates it.
+ @param _nIndex
+ The index of the object to create.
+ @return ObjectType
+ */
+ ObjectType getObject(sal_Int32 _nIndex);
+
+ public:
+ virtual ~OCollection();
+ DECLARE_SERVICE_INFO();
+
+ void reFill(const TStringVector &_rVector);
+ inline sal_Bool isCaseSensitive() const { return m_pElements->isCaseSensitive(); }
+ void renameObject(const OUString _sOldName,const OUString _sNewName);
+
+ // only the name is identical to ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ // dispatch the refcounting to the parent
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::container::XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XNameAccess
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ // XEnumerationAccess
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw(::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::util::XRefreshable
+ virtual void SAL_CALL refresh( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ // XDataDescriptorFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor( ) throw(::com::sun::star::uno::RuntimeException);
+ // XAppend
+ virtual void SAL_CALL appendByDescriptor( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
+ // XDrop
+ virtual void SAL_CALL dropByName( const OUString& elementName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dropByIndex( sal_Int32 index ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ // XColumnLocate
+ virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::container::XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ private:
+ void notifyElementRemoved(const OUString& _sName);
+ void disposeElements();
+ void dropImpl(sal_Int32 _nIndex,sal_Bool _bReallyDrop = sal_True);
+ };
+ }
+}
+#endif // _CONNECTIVITY_SDBCX_COLLECTION_HXX_
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VColumn.hxx b/include/connectivity/sdbcx/VColumn.hxx
new file mode 100644
index 000000000000..42cddc51c041
--- /dev/null
+++ b/include/connectivity/sdbcx/VColumn.hxx
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _CONNECTIVITY_SDBCX_COLUMN_HXX_
+#define _CONNECTIVITY_SDBCX_COLUMN_HXX_
+
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+#include <comphelper/IdPropArrayHelper.hxx>
+#include <cppuhelper/compbase2.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include "connectivity/CommonTools.hxx"
+#include <comphelper/broadcasthelper.hxx>
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ class OColumn;
+ typedef ::comphelper::OIdPropertyArrayUsageHelper<OColumn> OColumn_PROP;
+
+ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::container::XNamed,
+ ::com::sun::star::lang::XServiceInfo> OColumnDescriptor_BASE;
+ typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XDataDescriptorFactory > OColumn_BASE;
+
+
+ class OOO_DLLPUBLIC_DBTOOLS OColumn :
+ public comphelper::OBaseMutex,
+ public OColumn_BASE,
+ public OColumnDescriptor_BASE,
+ public OColumn_PROP,
+ public ODescriptor
+ {
+ protected:
+ OUString m_TypeName;
+ OUString m_Description;
+ OUString m_DefaultValue;
+
+ sal_Int32 m_IsNullable;
+ sal_Int32 m_Precision;
+ sal_Int32 m_Scale;
+ sal_Int32 m_Type;
+
+ sal_Bool m_IsAutoIncrement;
+ sal_Bool m_IsRowVersion;
+ sal_Bool m_IsCurrency;
+
+ OUString m_CatalogName;
+ OUString m_SchemaName;
+ OUString m_TableName;
+
+ using OColumnDescriptor_BASE::rBHelper;
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ virtual ~OColumn();
+ public:
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ OColumn( sal_Bool _bCase);
+ OColumn( const OUString& _Name,
+ const OUString& _TypeName,
+ const OUString& _DefaultValue,
+ const OUString& _Description,
+ sal_Int32 _IsNullable,
+ sal_Int32 _Precision,
+ sal_Int32 _Scale,
+ sal_Int32 _Type,
+ sal_Bool _IsAutoIncrement,
+ sal_Bool _IsRowVersion,
+ sal_Bool _IsCurrency,
+ sal_Bool _bCase,
+ const OUString& _CatalogName,
+ const OUString& _SchemaName,
+ const OUString& _TableName);
+
+ DECLARE_SERVICE_INFO();
+ //XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ // ODescriptor
+ virtual void construct();
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XNamed
+ virtual OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ // XDataDescriptorFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor( ) throw(::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_COLUMN_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VDescriptor.hxx b/include/connectivity/sdbcx/VDescriptor.hxx
new file mode 100644
index 000000000000..aa04b5229ac9
--- /dev/null
+++ b/include/connectivity/sdbcx/VDescriptor.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 _CONNECTIVITY_SDBCX_DESCRIPTOR_HXX_
+#define _CONNECTIVITY_SDBCX_DESCRIPTOR_HXX_
+
+#include <comphelper/propertycontainer.hxx>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/typeprovider.hxx>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <comphelper/stl_types.hxx>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ // =========================================================================
+ // = ODescriptor
+ // =========================================================================
+ typedef ::comphelper::OPropertyContainer ODescriptor_PBASE;
+ class OOO_DLLPUBLIC_DBTOOLS ODescriptor
+ :public ODescriptor_PBASE
+ ,public ::com::sun::star::lang::XUnoTunnel
+ {
+ protected:
+ OUString m_Name;
+
+ /** helper for derived classes to implement OPropertyArrayUsageHelper::createArrayHelper
+
+ This method just calls describeProperties, and flags all properties as READONLY if and
+ only if we do *not* act as descriptor, but as final object.
+
+ @seealso isNew
+ */
+ ::cppu::IPropertyArrayHelper* doCreateArrayHelper() const;
+
+ private:
+ comphelper::UStringMixEqual m_aCase;
+ sal_Bool m_bNew;
+
+ public:
+ ODescriptor(::cppu::OBroadcastHelper& _rBHelper,sal_Bool _bCase, sal_Bool _bNew = sal_False);
+
+ virtual ~ODescriptor();
+
+ sal_Bool isNew() const { return m_bNew; }
+ sal_Bool getNew() const { return m_bNew; }
+ virtual void setNew(sal_Bool _bNew);
+
+ sal_Bool isCaseSensitive() const { return m_aCase.isCaseSensitive(); }
+
+ virtual void construct();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // compare
+ inline sal_Bool operator == ( const OUString & _rRH )
+ {
+ return m_aCase(m_Name,_rRH);
+ }
+
+ // com::sun::star::lang::XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+
+ static ODescriptor* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxSomeComp );
+ // retrieves the ODescriptor implementation of a given UNO component, and returns its ->isNew flag
+ static sal_Bool isNew( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDescriptor );
+ };
+ }
+
+}
+#endif // _CONNECTIVITY_SDBCX_DESCRIPTOR_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VGroup.hxx b/include/connectivity/sdbcx/VGroup.hxx
new file mode 100644
index 000000000000..6e4ba2355d62
--- /dev/null
+++ b/include/connectivity/sdbcx/VGroup.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 _CONNECTIVITY_SDBCX_GROUP_HXX_
+#define _CONNECTIVITY_SDBCX_GROUP_HXX_
+
+#include <osl/diagnose.h>
+
+
+#include <com/sun/star/sdbcx/XUsersSupplier.hpp>
+#include <com/sun/star/sdbcx/XAuthorizable.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+#include <comphelper/proparrhlp.hxx>
+#include <cppuhelper/compbase4.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include "connectivity/sdbcx/VCollection.hxx"
+#include <comphelper/propertycontainer.hxx>
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ typedef OCollection OUsers;
+
+ typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::sdbcx::XUsersSupplier,
+ ::com::sun::star::sdbcx::XAuthorizable,
+ ::com::sun::star::container::XNamed,
+ ::com::sun::star::lang::XServiceInfo> OGroup_BASE;
+
+ class OOO_DLLPUBLIC_DBTOOLS OGroup :
+ public comphelper::OBaseMutex,
+ public OGroup_BASE,
+ public IRefreshableUsers,
+ public ::comphelper::OPropertyArrayUsageHelper<OGroup>,
+ public ODescriptor
+ {
+ protected:
+ OUsers* m_pUsers;
+
+ using OGroup_BASE::rBHelper;
+
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+ public:
+ OGroup(sal_Bool _bCase);
+ OGroup( const OUString& _Name,sal_Bool _bCase);
+ virtual ~OGroup();
+ DECLARE_SERVICE_INFO();
+
+ // XInterface
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ //XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XUsersSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getUsers( ) throw(::com::sun::star::uno::RuntimeException);
+ // XAuthorizable
+ virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+ // XNamed
+ virtual OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_GROUP_HXX_
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VIndex.hxx b/include/connectivity/sdbcx/VIndex.hxx
new file mode 100644
index 000000000000..3e50ddf9459c
--- /dev/null
+++ b/include/connectivity/sdbcx/VIndex.hxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CONNECTIVITY_SDBCX_INDEX_HXX_
+#define _CONNECTIVITY_SDBCX_INDEX_HXX_
+
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+#include <comphelper/IdPropArrayHelper.hxx>
+#include <cppuhelper/compbase2.hxx>
+#include "connectivity/CommonTools.hxx"
+#include <comphelper/broadcasthelper.hxx>
+#include "connectivity/sdbcx/VTypeDef.hxx"
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/implbase1.hxx>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ class OCollection;
+ class OIndex;
+ typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XDataDescriptorFactory > OIndex_BASE;
+ typedef ::comphelper::OIdPropertyArrayUsageHelper<OIndex> OIndex_PROP;
+
+ class OOO_DLLPUBLIC_DBTOOLS OIndex :
+ public comphelper::OBaseMutex,
+ public ODescriptor_BASE,
+ public IRefreshableColumns,
+ public OIndex_PROP,
+ public ODescriptor,
+ public OIndex_BASE
+ {
+ protected:
+ OUString m_Catalog;
+ sal_Bool m_IsUnique;
+ sal_Bool m_IsPrimaryKeyIndex;
+ sal_Bool m_IsClustered;
+
+ OCollection* m_pColumns;
+
+ using ODescriptor_BASE::rBHelper;
+ virtual void refreshColumns();
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ public:
+ OIndex(sal_Bool _bCase);
+ OIndex( const OUString& _Name,
+ const OUString& _Catalog,
+ sal_Bool _isUnique,
+ sal_Bool _isPrimaryKeyIndex,
+ sal_Bool _isClustered,
+ sal_Bool _bCase);
+
+ virtual ~OIndex( );
+
+ DECLARE_SERVICE_INFO();
+
+ //XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ // ODescriptor
+ virtual void construct();
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XColumnsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XNamed
+ virtual OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ // XDataDescriptorFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor( ) throw(::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_INDEX_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VIndexColumn.hxx b/include/connectivity/sdbcx/VIndexColumn.hxx
new file mode 100644
index 000000000000..a4de9e6bf5bd
--- /dev/null
+++ b/include/connectivity/sdbcx/VIndexColumn.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 _CONNECTIVITY_SDBCX_INDEXCOLUMN_HXX_
+#define _CONNECTIVITY_SDBCX_INDEXCOLUMN_HXX_
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/sdbcx/VColumn.hxx"
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ class OIndexColumn;
+ typedef ::comphelper::OIdPropertyArrayUsageHelper<OIndexColumn> OIndexColumn_PROP;
+
+ class OOO_DLLPUBLIC_DBTOOLS OIndexColumn :
+ public OColumn, public OIndexColumn_PROP
+ {
+ protected:
+ sal_Bool m_IsAscending;
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ public:
+ OIndexColumn( sal_Bool _bCase);
+ OIndexColumn( sal_Bool _IsAscending,
+ const OUString& _Name,
+ const OUString& _TypeName,
+ const OUString& _DefaultValue,
+ sal_Int32 _IsNullable,
+ sal_Int32 _Precision,
+ sal_Int32 _Scale,
+ sal_Int32 _Type,
+ sal_Bool _IsAutoIncrement,
+ sal_Bool _IsRowVersion,
+ sal_Bool _IsCurrency,
+ sal_Bool _bCase,
+ const OUString& _CatalogName,
+ const OUString& _SchemaName,
+ const OUString& _TableName);
+
+ virtual void construct();
+ DECLARE_SERVICE_INFO();
+ };
+ }
+}
+#endif // _CONNECTIVITY_SDBCX_INDEXCOLUMN_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VKey.hxx b/include/connectivity/sdbcx/VKey.hxx
new file mode 100644
index 000000000000..24d85dfb2614
--- /dev/null
+++ b/include/connectivity/sdbcx/VKey.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 _CONNECTIVITY_SDBCX_KEY_HXX_
+#define _CONNECTIVITY_SDBCX_KEY_HXX_
+
+
+#include <comphelper/IdPropArrayHelper.hxx>
+#include "connectivity/CommonTools.hxx"
+#include <comphelper/broadcasthelper.hxx>
+#include "connectivity/sdbcx/VTypeDef.hxx"
+#include <com/sun/star/container/XNamed.hpp>
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <boost/shared_ptr.hpp>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+
+ struct OOO_DLLPUBLIC_DBTOOLS KeyProperties
+ {
+ ::std::vector< OUString> m_aKeyColumnNames;
+ OUString m_ReferencedTable;
+ sal_Int32 m_Type;
+ sal_Int32 m_UpdateRule;
+ sal_Int32 m_DeleteRule;
+ KeyProperties(const OUString& _ReferencedTable,
+ sal_Int32 _Type,
+ sal_Int32 _UpdateRule,
+ sal_Int32 _DeleteRule)
+ :m_ReferencedTable(_ReferencedTable),
+ m_Type(_Type),
+ m_UpdateRule(_UpdateRule),
+ m_DeleteRule(_DeleteRule)
+ {}
+ KeyProperties():m_Type(0),m_UpdateRule(0),m_DeleteRule(0){}
+ };
+ typedef ::boost::shared_ptr< KeyProperties > TKeyProperties;
+ typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XDataDescriptorFactory > OKey_BASE;
+ class OCollection;
+
+ class OOO_DLLPUBLIC_DBTOOLS OKey :
+ public comphelper::OBaseMutex,
+ public ODescriptor_BASE,
+ public IRefreshableColumns,
+ public ::comphelper::OIdPropertyArrayUsageHelper<OKey>,
+ public ODescriptor,
+ public OKey_BASE
+ {
+ protected:
+ TKeyProperties m_aProps;
+ OCollection* m_pColumns;
+
+ using ODescriptor_BASE::rBHelper;
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+ public:
+ OKey(sal_Bool _bCase);
+ OKey(const OUString& _Name,const TKeyProperties& _rProps,sal_Bool _bCase);
+ /*OKey( const OUString& _Name,
+ const OUString& _ReferencedTable,
+ sal_Int32 _Type,
+ sal_Int32 _UpdateRule,
+ sal_Int32 _DeleteRule,
+ sal_Bool _bCase);*/
+
+ virtual ~OKey( );
+
+ DECLARE_SERVICE_INFO();
+ //XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ // ODescriptor
+ virtual void construct();
+
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing();
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XColumnsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XNamed
+ virtual OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ // XDataDescriptorFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor( ) throw(::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_KEY_HXX_
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VKeyColumn.hxx b/include/connectivity/sdbcx/VKeyColumn.hxx
new file mode 100644
index 000000000000..b22ea3247941
--- /dev/null
+++ b/include/connectivity/sdbcx/VKeyColumn.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 _CONNECTIVITY_SDBCX_KEYCOLUMN_HXX_
+#define _CONNECTIVITY_SDBCX_KEYCOLUMN_HXX_
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/sdbcx/VColumn.hxx"
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ class OKeyColumn;
+ typedef ::comphelper::OIdPropertyArrayUsageHelper<OKeyColumn> OKeyColumn_PROP;
+
+ class OOO_DLLPUBLIC_DBTOOLS OKeyColumn :
+ public OColumn, public OKeyColumn_PROP
+ {
+ protected:
+ OUString m_ReferencedColumn;
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ public:
+ OKeyColumn(sal_Bool _bCase);
+ OKeyColumn( const OUString& _ReferencedColumn,
+ const OUString& _Name,
+ const OUString& _TypeName,
+ const OUString& _DefaultValue,
+ sal_Int32 _IsNullable,
+ sal_Int32 _Precision,
+ sal_Int32 _Scale,
+ sal_Int32 _Type,
+ sal_Bool _IsAutoIncrement,
+ sal_Bool _IsRowVersion,
+ sal_Bool _IsCurrency,
+ sal_Bool _bCase,
+ const OUString& _CatalogName,
+ const OUString& _SchemaName,
+ const OUString& _TableName);
+ // just to make it not inline
+ virtual ~OKeyColumn();
+
+ virtual void construct();
+ DECLARE_SERVICE_INFO();
+ };
+ }
+}
+#endif // _CONNECTIVITY_SDBCX_KEYCOLUMN_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VTable.hxx b/include/connectivity/sdbcx/VTable.hxx
new file mode 100644
index 000000000000..0be41a9cd22f
--- /dev/null
+++ b/include/connectivity/sdbcx/VTable.hxx
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CONNECTIVITY_SDBCX_TABLE_HXX_
+#define _CONNECTIVITY_SDBCX_TABLE_HXX_
+
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
+#include <com/sun/star/sdbcx/XRename.hpp>
+#include <com/sun/star/sdbcx/XAlterTable.hpp>
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
+#include <comphelper/IdPropArrayHelper.hxx>
+#include <cppuhelper/compbase4.hxx>
+#include <cppuhelper/implbase4.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <com/sun/star/container/XNamed.hpp>
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/CommonTools.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+
+ class OTable;
+ class OCollection;
+
+ typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::sdbcx::XColumnsSupplier,
+ ::com::sun::star::sdbcx::XKeysSupplier,
+ ::com::sun::star::container::XNamed,
+ ::com::sun::star::lang::XServiceInfo> OTableDescriptor_BASE;
+
+ typedef ::cppu::ImplHelper4< ::com::sun::star::sdbcx::XDataDescriptorFactory,
+ ::com::sun::star::sdbcx::XIndexesSupplier,
+ ::com::sun::star::sdbcx::XRename,
+ ::com::sun::star::sdbcx::XAlterTable > OTable_BASE;
+
+ typedef ::comphelper::OIdPropertyArrayUsageHelper<OTable> OTable_PROP;
+
+
+ class OOO_DLLPUBLIC_DBTOOLS OTable :
+ public comphelper::OBaseMutex,
+ public OTable_BASE,
+ public OTableDescriptor_BASE,
+ public IRefreshableColumns,
+ public OTable_PROP,
+ public ODescriptor
+ {
+ protected:
+ OUString m_CatalogName;
+ OUString m_SchemaName;
+ OUString m_Description;
+ OUString m_Type;
+
+ OCollection* m_pKeys;
+ OCollection* m_pColumns;
+ OCollection* m_pIndexes;
+ OCollection* m_pTables; // must hold his own container to notify him when renaming
+
+ using OTableDescriptor_BASE::rBHelper;
+
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 _nId ) const;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+ public:
+ OTable( OCollection* _pTables,
+ sal_Bool _bCase);
+ OTable( OCollection* _pTables,
+ sal_Bool _bCase,
+ const OUString& _Name,
+ const OUString& _Type,
+ const OUString& _Description = OUString(),
+ const OUString& _SchemaName = OUString(),
+ const OUString& _CatalogName = OUString());
+
+ virtual ~OTable();
+
+ DECLARE_SERVICE_INFO();
+ //XInterface
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ODescriptor
+ virtual void construct();
+ virtual void refreshColumns();
+ virtual void refreshKeys();
+ virtual void refreshIndexes();
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XColumnsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException);
+ // XKeysSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getKeys( ) throw(::com::sun::star::uno::RuntimeException);
+ // XNamed
+ virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ // XDataDescriptorFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor( void ) throw(::com::sun::star::uno::RuntimeException);
+ // XIndexesSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getIndexes( ) throw(::com::sun::star::uno::RuntimeException);
+ // XRename
+ virtual void SAL_CALL rename( const OUString& newName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
+ // XAlterTable
+ virtual void SAL_CALL alterColumnByName( const OUString& colName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL alterColumnByIndex( sal_Int32 index, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // helper method
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> getMetaData() const;
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_TABLE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VTypeDef.hxx b/include/connectivity/sdbcx/VTypeDef.hxx
new file mode 100644
index 000000000000..08019f9174da
--- /dev/null
+++ b/include/connectivity/sdbcx/VTypeDef.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 _CONNECTIVITY_SDBCX_TYPEDEF_HXX_
+#define _CONNECTIVITY_SDBCX_TYPEDEF_HXX_
+
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <cppuhelper/compbase3.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbcx::XColumnsSupplier,
+ ::com::sun::star::container::XNamed,
+ ::com::sun::star::lang::XServiceInfo> ODescriptor_BASE;
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_TYPEDEF_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VUser.hxx b/include/connectivity/sdbcx/VUser.hxx
new file mode 100644
index 000000000000..01bafc0d177c
--- /dev/null
+++ b/include/connectivity/sdbcx/VUser.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 _CONNECTIVITY_SDBCX_USER_HXX_
+#define _CONNECTIVITY_SDBCX_USER_HXX_
+
+#include <osl/diagnose.h>
+#include <com/sun/star/sdbcx/XUser.hpp>
+#include <com/sun/star/sdbcx/XGroupsSupplier.hpp>
+#include <comphelper/proparrhlp.hxx>
+#include <cppuhelper/compbase4.hxx>
+#include "connectivity/CommonTools.hxx"
+#include <comphelper/broadcasthelper.hxx>
+#include "connectivity/sdbcx/VCollection.hxx"
+#include <com/sun/star/container/XNamed.hpp>
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ typedef OCollection OGroups;
+
+ typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::sdbcx::XUser,
+ ::com::sun::star::sdbcx::XGroupsSupplier,
+ ::com::sun::star::container::XNamed,
+ ::com::sun::star::lang::XServiceInfo> OUser_BASE;
+
+ class OOO_DLLPUBLIC_DBTOOLS OUser :
+ public comphelper::OBaseMutex,
+ public OUser_BASE,
+ public IRefreshableGroups,
+ public ::comphelper::OPropertyArrayUsageHelper<OUser>,
+ public ODescriptor
+ {
+ protected:
+ OGroups* m_pGroups;
+
+ using OUser_BASE::rBHelper;
+
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+ public:
+ OUser(sal_Bool _bCase);
+ OUser(const OUString& _Name,sal_Bool _bCase);
+
+ virtual ~OUser( );
+
+ DECLARE_SERVICE_INFO();
+
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ //XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XUser
+ virtual void SAL_CALL changePassword( const OUString& objPassword, const OUString& newPassword ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ // XAuthorizable
+ virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ // XGroupsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getGroups( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XNamed
+ virtual OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_USER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sdbcx/VView.hxx b/include/connectivity/sdbcx/VView.hxx
new file mode 100644
index 000000000000..6134ddc4bb69
--- /dev/null
+++ b/include/connectivity/sdbcx/VView.hxx
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CONNECTIVITY_SDBCX_VIEW_HXX_
+#define _CONNECTIVITY_SDBCX_VIEW_HXX_
+
+#include <osl/diagnose.h>
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
+#include <comphelper/proparrhlp.hxx>
+#include <cppuhelper/compbase1.hxx>
+#include "connectivity/CommonTools.hxx"
+#include <cppuhelper/interfacecontainer.h>
+#include <com/sun/star/container/XNamed.hpp>
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <comphelper/IdPropArrayHelper.hxx>
+#include <cppuhelper/implbase2.hxx>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+
+ typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::container::XNamed> OView_BASE;
+
+
+
+ class OOO_DLLPUBLIC_DBTOOLS OView :
+ public ::comphelper::OMutexAndBroadcastHelper,
+ public OView_BASE,
+ public ::comphelper::OIdPropertyArrayUsageHelper<OView>,
+ public ODescriptor
+ {
+ protected:
+ OUString m_CatalogName;
+ OUString m_SchemaName;
+ OUString m_Command;
+ sal_Int32 m_CheckOption;
+ // need for the getName method
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
+
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+
+ public:
+ DECLARE_SERVICE_INFO();
+
+ OView(sal_Bool _bCase,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData);
+ OView( sal_Bool _bCase,
+ const OUString& _rName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData,
+ sal_Int32 _nCheckOption = 0,
+ const OUString& _rCommand = OUString(),
+ const OUString& _rSchemaName = OUString(),
+ const OUString& _rCatalogName = OUString());
+ virtual ~OView();
+
+ // ODescriptor
+ virtual void construct();
+
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XNamed
+ virtual OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const OUString& ) throw(::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_VIEW_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sqlerror.hxx b/include/connectivity/sqlerror.hxx
new file mode 100644
index 000000000000..ccad18a88d0f
--- /dev/null
+++ b/include/connectivity/sqlerror.hxx
@@ -0,0 +1,317 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CONNECTIVITY_SQLERROR_HXX
+#define CONNECTIVITY_SQLERROR_HXX
+
+#include <com/sun/star/sdbc/SQLException.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+//........................................................................
+namespace connectivity
+{
+//........................................................................
+
+ //====================================================================
+ //= ErrorCondition
+ //====================================================================
+ /** the type of error codes to be used in SQLExceptions
+
+ @see com::sun::star::sdbc::SQLException::ErrorCode
+ */
+ typedef ::sal_Int32 ErrorCode;
+
+ /** error condition values as defined in <type scope="com::sun::star::sdb">ErrorCondition</type>
+ */
+ typedef ::sal_Int32 ErrorCondition;
+
+ //====================================================================
+ //= SQLError
+ //====================================================================
+ class SQLError_Impl;
+
+ /** a class which provides helpers for working with SQLErrors
+
+ In particular, this class provides vendor-specific error codes (where
+ the vendor is OpenOffice.org Base), which can be used in OOo's various
+ database drivers, and checked in application-level code, to properly
+ recognize highly specific error conditions.
+
+ @see ::com::sun::star::sdb::ErrorCondition
+ */
+ class OOO_DLLPUBLIC_DBTOOLS SQLError
+ {
+ public:
+ // --------------------------------------------------------------------
+ // - optional
+ // --------------------------------------------------------------------
+ /** convenience wrapper around boost::optional, allowing implicit construction
+ */
+ class ParamValue : public ::boost::optional< OUString >
+ {
+ typedef ::boost::optional< OUString > base_type;
+
+ public:
+ ParamValue( ) : base_type( ) { }
+ ParamValue( OUString const& val ) : base_type( val ) { }
+ ParamValue( ParamValue const& rhs ) : base_type( (base_type const&)rhs ) { }
+
+ bool is() const { return !base_type::operator!(); }
+ };
+
+
+ public:
+ explicit SQLError( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & _rxContext );
+ ~SQLError();
+
+ /** returns the message associated with a given error condition, after (optionally) replacing
+ a placeholder with a given string
+
+ Some error messages need to contain references to runtime-dependent data (say, the
+ name of a concrete table in the database), which in the resource file's strings are
+ represented by a placeholder, namely $1$, $2, and so on. This method allows to
+ retrieve such an error message, and replace upo to 3 placeholders with their concrete
+ values.
+
+ In a non-product build, assertions will fire if the number of placeholders in the
+ message's resource string does not match the number of passed parameter values.
+
+ As specified in the <type scope="com::sun::star::sdb">ErrorCondition</type> type,
+ error messages thrown by core components of OpenOffice.org Base will contain
+ a standardized prefix &quot;[OOoBase]&quot; in every message.
+
+ @param _rParamValue1
+ the value which the placeholder $1$ should be replaced with. If this value is
+ not present (see <code>::boost::optional::operator !</code>), then no replacement
+ will happen, and <code>_rParamValue2</code> and <code>_rParamValue3</code> will be
+ ignored.
+
+ @param _rParamValue2
+ the value which the placeholder $2$ should be replaced with. If this value is
+ not present (see <code>::boost::optional::operator !</code>), then no replacement
+ will happen, and <code>_rParamValue3</code> will be ignored.
+
+ @param _rParamValue1
+ the value which the placeholder $1$ should be replaced with. If this value is
+ not present (see <code>::boost::optional::operator !</code>), then no replacement
+ will happen.
+
+ @see ::com::sun::star::sdb::ErrorCondition
+ */
+ OUString getErrorMessage(
+ const ErrorCondition _eCondition,
+ const ParamValue& _rParamValue1 = ParamValue(),
+ const ParamValue& _rParamValue2 = ParamValue(),
+ const ParamValue& _rParamValue3 = ParamValue()
+ ) const;
+
+ /** returns the error code associated with a given error condition
+
+ @see getErrorMessage
+ @see ::com::sun::star::sdb::ErrorCondition
+ @see ::com::sun::star::sdbc::SQLException::ErrorCode
+ */
+ static ErrorCode
+ getErrorCode( const ErrorCondition _eCondition );
+
+ /** returns the prefix which is used for OpenOffice.org Base's error messages
+
+ As specified in the <type scope="com::sun::star::sdb">ErrorCondition</type> type,
+ error messages thrown by core components of OpenOffice.org Base will
+ contain a standardized prefix in every message. <code>getBaseErrorMessagePrefix</code>
+ returns this prefix, so clients of such error messages might decide to strip this
+ prefix before presenting the message to the user, or use it to determine
+ whether a concrete error has been raised by a OpenOffice.org core component.
+ */
+ static const OUString&
+ getMessagePrefix();
+
+
+ /** throws an SQLException describing the given error condition
+
+ The thrown SQLException will contain the OOo-specific error code which derives
+ from the given error condition, and the error message associated with that condition.
+
+ @param _eCondition
+ the ErrorCondition which hit you
+
+ @param _rxContext
+ the context in which the error occurred. This will be filled in as
+ <member scope="com::sun::star::uno">Exception::Context</member> member.
+
+ @param _rParamValue1
+ a runtime-dependent value which should be filled into the error message
+ which is associated with <arg>_eCondition</arg>, replacing the first placeholder
+ in this message.
+
+ @param _rParamValue2
+ a runtime-dependent value which should be filled into the error message
+ which is associated with <arg>_eCondition</arg>, replacing the second placeholder
+ in this message.
+
+ @param _rParamValue3
+ a runtime-dependent value which should be filled into the error message
+ which is associated with <arg>_eCondition</arg>, replacing the third placeholder
+ in this message.
+
+ @see getErrorMessage
+ @see getErrorCode
+ */
+ void raiseException(
+ const ErrorCondition _eCondition,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
+ const ParamValue& _rParamValue1 = ParamValue(),
+ const ParamValue& _rParamValue2 = ParamValue(),
+ const ParamValue& _rParamValue3 = ParamValue()
+ ) const;
+
+ /** throws an SQLException describing the given error condition
+
+ The thrown SQLException will contain the OOo-specific error code which derives
+ from the given error condition, and the error message associated with that condition.
+
+ Note: You should prefer the version of <type>raiseException</type> which takes
+ an additional <type>Context</type> parameter, since this allows clients of your
+ exception to examine where the error occurred.
+
+ @param _eCondition
+ the ErrorCondition which hit you
+
+ @param _rParamValue1
+ a runtime-dependent value which should be filled into the error message
+ which is associated with <arg>_eCondition</arg>, replacing the first placeholder
+ in this message.
+
+ @param _rParamValue2
+ a runtime-dependent value which should be filled into the error message
+ which is associated with <arg>_eCondition</arg>, replacing the second placeholder
+ in this message.
+
+ @param _rParamValue3
+ a runtime-dependent value which should be filled into the error message
+ which is associated with <arg>_eCondition</arg>, replacing the third placeholder
+ in this message.
+
+ @see getErrorMessage
+ @see getErrorCode
+ */
+ void raiseException(
+ const ErrorCondition _eCondition,
+ const ParamValue& _rParamValue1 = ParamValue(),
+ const ParamValue& _rParamValue2 = ParamValue(),
+ const ParamValue& _rParamValue3 = ParamValue()
+ ) const;
+
+ /** raises a typed exception, that is, a UNO exception which is derived from
+ <type scope="com::sun::star::sdbc">SQLException</type>
+
+ @param _eCondition
+ the ErrorCondition which hit you
+
+ @param _rxContext
+ the context in which the error occurred. This will be filled in as
+ <member scope="com::sun::star::uno">Exception::Context</member> member.
+
+ @param _rExceptionType
+ the type of the exception to throw. This type <em>must</em> specify
+ an exception class derived from <type scope="com::sun::star::sdbc">SQLException</type>.
+
+ @param _rParamValue1
+ a runtime-dependent value which should be filled into the error message
+ which is associated with <arg>_eCondition</arg>, replacing the first placeholder
+ in this message.
+
+ @param _rParamValue2
+ a runtime-dependent value which should be filled into the error message
+ which is associated with <arg>_eCondition</arg>, replacing the second placeholder
+ in this message.
+
+ @param _rParamValue3
+ a runtime-dependent value which should be filled into the error message
+ which is associated with <arg>_eCondition</arg>, replacing the third placeholder
+ in this message.
+
+ @throws ::std::bad_cast
+ if <arg>_rExceptionType</arg> does not specify an exception class derived from
+ <type scope="com::sun::star::sdbc">SQLException</type>.
+
+ @see getErrorMessage
+ @see getErrorCode
+ */
+ void raiseTypedException(
+ const ErrorCondition _eCondition,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
+ const ::com::sun::star::uno::Type& _rExceptionType,
+ const ParamValue& _rParamValue1 = ParamValue(),
+ const ParamValue& _rParamValue2 = ParamValue(),
+ const ParamValue& _rParamValue3 = ParamValue()
+ ) const;
+
+ /** retrieves an <code>SQLException</code> object which contains information about
+ the given error condition
+
+ @param _eCondition
+ the ErrorCondition which hit you
+
+ @param _rxContext
+ the context in which the error occurred. This will be filled in as
+ <member scope="com::sun::star::uno">Exception::Context</member> member.
+
+ @param _rParamValue1
+ a runtime-dependent value which should be filled into the error message
+ which is associated with <arg>_eCondition</arg>, replacing the first placeholder
+ in this message.
+
+ @param _rParamValue2
+ a runtime-dependent value which should be filled into the error message
+ which is associated with <arg>_eCondition</arg>, replacing the second placeholder
+ in this message.
+
+ @param _rParamValue3
+ a runtime-dependent value which should be filled into the error message
+ which is associated with <arg>_eCondition</arg>, replacing the third placeholder
+ in this message.
+
+ @see getErrorMessage
+ @see getErrorCode
+ */
+ ::com::sun::star::sdbc::SQLException
+ getSQLException(
+ const ErrorCondition _eCondition,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
+ const ParamValue& _rParamValue1 = ParamValue(),
+ const ParamValue& _rParamValue2 = ParamValue(),
+ const ParamValue& _rParamValue3 = ParamValue()
+ ) const;
+
+ private:
+ ::boost::shared_ptr< SQLError_Impl > m_pImpl;
+ };
+
+//........................................................................
+} // namespace connectivity
+//........................................................................
+
+#endif // CONNECTIVITY_SQLERROR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sqliterator.hxx b/include/connectivity/sqliterator.hxx
new file mode 100644
index 000000000000..ee967dd7d7a3
--- /dev/null
+++ b/include/connectivity/sqliterator.hxx
@@ -0,0 +1,356 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _CONNECTIVITY_PARSE_SQLITERATOR_HXX_
+#define _CONNECTIVITY_PARSE_SQLITERATOR_HXX_
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/sqlnode.hxx"
+#include <connectivity/IParseContext.hxx>
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <com/sun/star/sdbc/DataType.hpp>
+#include <com/sun/star/sdbc/SQLWarning.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include "connectivity/CommonTools.hxx"
+#include <rtl/ref.hxx>
+#include <cppuhelper/weak.hxx>
+
+#include <map>
+#include <memory>
+#include <vector>
+
+namespace connectivity
+{
+
+ class OSQLParseNode;
+ class OSQLParser;
+
+ typedef ::std::pair<const OSQLParseNode*,const OSQLParseNode* > TNodePair;
+
+ enum OSQLStatementType {
+ SQL_STATEMENT_UNKNOWN,
+ SQL_STATEMENT_SELECT,
+ SQL_STATEMENT_INSERT,
+ SQL_STATEMENT_UPDATE,
+ SQL_STATEMENT_DELETE,
+ SQL_STATEMENT_ODBC_CALL,
+ SQL_STATEMENT_CREATE_TABLE
+ };
+
+ struct OSQLParseTreeIteratorImpl;
+
+ class OOO_DLLPUBLIC_DBTOOLS OSQLParseTreeIterator
+ {
+ private:
+ ::com::sun::star::sdbc::SQLException m_aErrors; // conatins the error while iterating through the statement
+ const OSQLParseNode* m_pParseTree; // current ParseTree
+ const OSQLParser& m_rParser; // if set used for general error messages from the context
+ OSQLStatementType m_eStatementType;
+ ::rtl::Reference<OSQLColumns> m_aSelectColumns; // all columns from the Select clause
+ ::rtl::Reference<OSQLColumns> m_aParameters; // all parameters
+ ::rtl::Reference<OSQLColumns> m_aGroupColumns; // the group by columns
+ ::rtl::Reference<OSQLColumns> m_aOrderColumns; // the order by columns
+ ::rtl::Reference<OSQLColumns> m_aCreateColumns; // the columns for Create table clause
+
+ ::std::auto_ptr< OSQLParseTreeIteratorImpl > m_pImpl;
+
+ void traverseParameter(const OSQLParseNode* _pParseNode,const OSQLParseNode* _pColumnRef,const OUString& _aColumnName, OUString& _aTableRange, const OUString& _rColumnAlias);
+ // inserts a table into the map
+ void traverseOneTableName( OSQLTables& _rTables,const OSQLParseNode * pTableName, const OUString & rTableRange );
+ void traverseSearchCondition(OSQLParseNode * pSearchCondition);
+ void traverseOnePredicate(
+ OSQLParseNode * pColumnRef,
+ OUString& aValue,
+ OSQLParseNode * pParameter);
+ void traverseByColumnNames(const OSQLParseNode* pSelectNode,sal_Bool _bOrder);
+ void traverseParameters(const OSQLParseNode* pSelectNode);
+
+ const OSQLParseNode* getTableNode( OSQLTables& _rTables, const OSQLParseNode* pTableRef, OUString& aTableRange );
+ void getQualified_join( OSQLTables& _rTables, const OSQLParseNode *pTableRef, OUString& aTableRange );
+ void getSelect_statement(OSQLTables& _rTables,const OSQLParseNode* pSelect);
+ OUString getUniqueColumnName(const OUString & rColumnName) const;
+
+ /** finds the column with a given name, belonging to a given table, in a given tables collection
+ @param _rTables
+ the tables collection to look in
+ @param rColumnName
+ the column name to look for
+ @param rTableRange
+ the table alias name; if empty, look in all tables
+ @return
+ the desired column object, or <NULL/> if no such column could be found
+ */
+ static ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > findColumn(
+ const OSQLTables& _rTables, const OUString & rColumnName, OUString & rTableRange );
+
+ /** finds a column with a given name, belonging to a given table
+ @param rColumnName
+ the column name to look for
+ @param rTableRange
+ the table alias name; if empty, look in all tables
+ @param _bLookInSubTables
+ <TRUE/> if and only if not only our direct tables, but also our sub tables (from sub selects)
+ should be searched
+ @return
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > findColumn(
+ const OUString & rColumnName, OUString & rTableRange, bool _bLookInSubTables );
+
+ protected:
+ void setSelectColumnName(::rtl::Reference<OSQLColumns>& _rColumns,const OUString & rColumnName,const OUString & rColumnAlias, const OUString & rTableRange,sal_Bool bFkt=sal_False,sal_Int32 _nType = com::sun::star::sdbc::DataType::VARCHAR,sal_Bool bAggFkt=sal_False);
+ void appendColumns(::rtl::Reference<OSQLColumns>& _rColumns,const OUString& _rTableAlias,const OSQLTable& _rTable);
+ // Other member variables that should be available in the "set" functions
+ // can be defined in the derived class. They can be initialized
+ // in its constructor and, after the "traverse" routines have been used,
+ // they can be queried using other functions.
+
+
+ private:
+ OSQLParseTreeIterator(); // never implemented
+ OSQLParseTreeIterator(const OSQLParseTreeIterator & rIter); // never implemented
+
+ public:
+ OSQLParseTreeIterator(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxTables,
+ const OSQLParser& _rParser,
+ const OSQLParseNode* pRoot = NULL );
+ ~OSQLParseTreeIterator();
+
+ inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
+ { return ::rtl_allocateMemory( nSize ); }
+ inline static void * SAL_CALL operator new( size_t,void* _pHint ) SAL_THROW(())
+ { return _pHint; }
+ inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
+ { ::rtl_freeMemory( pMem ); }
+ inline static void SAL_CALL operator delete( void *,void* ) SAL_THROW(())
+ { }
+
+ void dispose();
+ bool isCaseSensitive() const;
+ // The parse tree to be analysed/traversed:
+ // If NULL is passed, the current parse tree will be deleted and the error status cleared.
+ void setParseTree(const OSQLParseNode * pNewParseTree);
+// void setParser(const OSQLParser* _pParser) { m_pParser = _pParser; }
+ const OSQLParseNode * getParseTree() const { return m_pParseTree; };
+
+ // subtrees in case of a select statement
+ const OSQLParseNode* getWhereTree() const;
+ const OSQLParseNode* getOrderTree() const;
+ const OSQLParseNode* getGroupByTree() const;
+ const OSQLParseNode* getHavingTree() const;
+
+ const OSQLParseNode* getSimpleWhereTree() const;
+ const OSQLParseNode* getSimpleOrderTree() const;
+ const OSQLParseNode* getSimpleGroupByTree() const;
+ const OSQLParseNode* getSimpleHavingTree() const;
+
+ /** returns the errors which occurred during parsing.
+
+ The returned object contains a chain (via SQLException::NextException) of SQLExceptions.
+ */
+ inline const ::com::sun::star::sdbc::SQLException& getErrors() const { return m_aErrors; }
+ inline bool hasErrors() const { return !m_aErrors.Message.isEmpty(); }
+
+ // statement type (already set in setParseTree):
+ OSQLStatementType getStatementType() const { return m_eStatementType; }
+
+ /** traverses the complete statement tree, and fills all our data with
+ the information obatined during traversal.
+
+ Implemented by calling the single traverse* methods in the proper
+ order (depending on the statement type).
+ */
+ void traverseAll();
+
+ enum TraversalParts
+ {
+ Parameters = 0x0001,
+ TableNames = 0x0002,
+ SelectColumns = 0x0006, // note that this includes TableNames. No SelectColumns without TableNames
+
+ // Those are not implemented currently
+ // GroupColumns = 0x0008,
+ // OrderColumns = 0x0010,
+ // SelectColumns = 0x0020,
+ // CreateColumns = 0x0040,
+
+ All = 0xFFFF
+ };
+ /** traverses selected parts of the statement tree, and fills our data with
+ the information obtained during traversal
+
+ @param _nIncludeMask
+ set of TraversalParts bits, specifying which information is to be collected.
+ Note TraversalParts is currently not
+ */
+ void traverseSome( sal_uInt32 _nIncludeMask );
+
+ // The TableRangeMap contains all tables associated with the range name found first.
+ const OSQLTables& getTables() const;
+
+ ::rtl::Reference<OSQLColumns> getSelectColumns() const { return m_aSelectColumns;}
+ ::rtl::Reference<OSQLColumns> getGroupColumns() const { return m_aGroupColumns;}
+ ::rtl::Reference<OSQLColumns> getOrderColumns() const { return m_aOrderColumns;}
+ ::rtl::Reference<OSQLColumns> getParameters() const { return m_aParameters; }
+ ::rtl::Reference<OSQLColumns> getCreateColumns() const { return m_aCreateColumns;}
+
+ /** return the columname and the table range
+ @param _pColumnRef
+ The column ref parse node.
+ @param _rColumnName
+ The column name to be set.
+ @param _rTableRange
+ The table range to be set.
+ */
+ void getColumnRange( const OSQLParseNode* _pColumnRef,
+ OUString &_rColumnName,
+ OUString& _rTableRange) const;
+
+ /** retrieves a column's name, table range, and alias
+
+ @param _pColumnRef
+ The column_ref parse node.
+ @param _out_rColumnName
+ The column name to be set.
+ @param _out_rTableRange
+ The table range to be set.
+ @param _out_rColumnAliasIfPresent
+ If the column specified by _pColumnRef is part of the select columns, and contains a column alias there,
+ this alias is returned here.
+ */
+ void getColumnRange( const OSQLParseNode* _pColumnRef,
+ OUString& _out_rColumnName,
+ OUString& _out_rTableRange,
+ OUString& _out_rColumnAliasIfPresent
+ ) const;
+
+ /** return the alias name of a column
+ @param _pDerivedColumn
+ The parse node where SQL_ISRULE(_pDerivedColumn,derived_column) must be true
+ @return
+ The alias name of the column or an empty string.
+ */
+ static OUString getColumnAlias(const OSQLParseNode* _pDerivedColumn);
+
+ /** return the columname and the table range
+ @param _pColumnRef
+ The column ref parse node.
+ @param _xMetaData
+ The database meta data.
+ @param _rColumnName
+ The column name to be set.
+ @param _rTableRange
+ The table range to be set.
+ */
+ static void getColumnRange( const OSQLParseNode* _pColumnRef,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ OUString &_rColumnName,
+ OUString& _rTableRange);
+
+ // empty if ambiguous
+ sal_Bool getColumnTableRange(const OSQLParseNode* pNode, OUString &rTableRange) const;
+
+ // return true when the tableNode is a rule like catalog_name, schema_name or table_name
+ sal_Bool isTableNode(const OSQLParseNode* _pTableNode) const;
+
+ // tries to find the correct type of the function
+ sal_Int32 getFunctionReturnType(const OSQLParseNode* _pNode );
+
+ // returns a lis of all joined columns
+ ::std::vector< TNodePair >& getJoinConditions() const;
+
+ private:
+ /** traverses the list of table names, and filles _rTables
+ */
+ bool traverseTableNames( OSQLTables& _rTables );
+
+ /// traverses columns in a SELECT statement
+ bool traverseSelectColumnNames(const OSQLParseNode* pSelectNode);
+ /// traverses columns in a CREATE TABLE statement
+ void traverseCreateColumns(const OSQLParseNode* pSelectNode);
+
+ bool traverseOrderByColumnNames(const OSQLParseNode* pSelectNode);
+ bool traverseGroupByColumnNames(const OSQLParseNode* pSelectNode);
+
+ bool traverseSelectionCriteria(const OSQLParseNode* pSelectNode);
+
+ private:
+ /** constructs a new iterator, which inherits some of the settings from a parent iterator
+ */
+ OSQLParseTreeIterator(
+ const OSQLParseTreeIterator& _rParentIterator,
+ const OSQLParser& _rParser,
+ const OSQLParseNode* pRoot );
+
+ /** creates a table object and inserts it into our tables collection
+
+ only used when we're iterating through a CREATE TABLE statement
+ */
+ OSQLTable impl_createTableObject(
+ const OUString& rTableName, const OUString& rCatalogName, const OUString& rSchemaName );
+
+ /** locates a record source (a table or query) with the given name
+ */
+ OSQLTable impl_locateRecordSource(
+ const OUString& _rComposedName
+ );
+
+ /** implementation for both traverseAll and traverseSome
+ */
+ void impl_traverse( sal_uInt32 _nIncludeMask );
+
+ /** retrieves the parameter columns of the given query
+ */
+ void impl_getQueryParameterColumns( const OSQLTable& _rQuery );
+
+ void setOrderByColumnName(const OUString & rColumnName, OUString & rTableRange, sal_Bool bAscending);
+ void setGroupByColumnName(const OUString & rColumnName, OUString & rTableRange);
+
+ private:
+ /** appends an SQLException corresponding to the given error code to our error collection
+
+ @param _eError
+ the code of the error which occurred
+ @param _pReplaceToken1
+ if not <NULL/>, the first occurrence of '#' in the error message will be replaced
+ with the given token
+ @param _pReplaceToken2
+ if not <NULL/>, and if _rReplaceToken1 is not <NULL/>, the second occurrence of '#'
+ in the error message will be replaced with _rReplaceToken2
+ */
+ void impl_appendError( IParseContext::ErrorCode _eError,
+ const OUString* _pReplaceToken1 = NULL, const OUString* _pReplaceToken2 = NULL );
+
+ /** appends an SQLException corresponding to the given error code to our error collection
+ */
+ void impl_appendError( const ::com::sun::star::sdbc::SQLException& _rError );
+
+ /** resets our errors
+ */
+ inline void impl_resetErrors()
+ {
+ m_aErrors = ::com::sun::star::sdbc::SQLException();
+ }
+ void impl_fillJoinConditions(const OSQLParseNode* i_pJoinCondition);
+ };
+}
+
+#endif // _CONNECTIVITY_PARSE_SQLITERATOR_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sqlnode.hxx b/include/connectivity/sqlnode.hxx
new file mode 100644
index 000000000000..f988f78e7e14
--- /dev/null
+++ b/include/connectivity/sqlnode.hxx
@@ -0,0 +1,466 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _CONNECTIVITY_SQLNODE_HXX
+#define _CONNECTIVITY_SQLNODE_HXX
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/dbmetadata.hxx"
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/util/XNumberFormatTypes.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <vector>
+#include <functional>
+#include <set>
+#include <boost/shared_ptr.hpp>
+#include <rtl/ustrbuf.hxx>
+
+// forward declarations
+namespace com
+{
+ namespace sun
+ {
+ namespace star
+ {
+ namespace beans
+ {
+ class XPropertySet;
+ }
+ namespace util
+ {
+ class XNumberFormatter;
+ }
+ namespace container
+ {
+ class XNameAccess;
+ }
+ }
+ }
+}
+
+#define ORDER_BY_CHILD_POS 5
+#define TABLE_EXPRESSION_CHILD_COUNT 9
+
+namespace connectivity
+{
+ class OSQLParser;
+ class OSQLParseNode;
+ class IParseContext;
+
+ typedef ::std::vector< OSQLParseNode* > OSQLParseNodes;
+
+ enum SQLNodeType {SQL_NODE_RULE, SQL_NODE_LISTRULE, SQL_NODE_COMMALISTRULE,
+ SQL_NODE_KEYWORD, SQL_NODE_COMPARISON, SQL_NODE_NAME,
+ SQL_NODE_STRING, SQL_NODE_INTNUM, SQL_NODE_APPROXNUM,
+ SQL_NODE_EQUAL,SQL_NODE_LESS,SQL_NODE_GREAT,SQL_NODE_LESSEQ,SQL_NODE_GREATEQ,SQL_NODE_NOTEQUAL,
+ SQL_NODE_PUNCTUATION, SQL_NODE_AMMSC, SQL_NODE_ACCESS_DATE,SQL_NODE_DATE,SQL_NODE_CONCAT};
+
+ typedef ::std::set< OUString > QueryNameSet;
+ //==================================================================
+ //= SQLParseNodeParameter
+ //==================================================================
+ struct OOO_DLLPUBLIC_DBTOOLS SQLParseNodeParameter
+ {
+ const ::com::sun::star::lang::Locale& rLocale;
+ ::dbtools::DatabaseMetaData aMetaData;
+ OSQLParser* pParser;
+ ::boost::shared_ptr< QueryNameSet > pSubQueryHistory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > xFormatter;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xField;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xQueries; // see bParseToSDBCLevel
+ const IParseContext& m_rContext;
+ sal_Char cDecSep;
+ bool bQuote : 1; /// should we quote identifiers?
+ bool bInternational : 1; /// should we internationalize keywords and placeholders?
+ bool bPredicate : 1; /// are we going to parse a mere predicate?
+ bool bParseToSDBCLevel : 1; /// should we create an SDBC-level statement (e.g. with substituted sub queries)?
+
+ SQLParseNodeParameter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _xFormatter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xField,
+ const ::com::sun::star::lang::Locale& _rLocale,
+ const IParseContext* _pContext,
+ bool _bIntl,
+ bool _bQuote,
+ sal_Char _cDecSep,
+ bool _bPredicate,
+ bool _bParseToSDBC
+ );
+ ~SQLParseNodeParameter();
+ };
+
+ //==========================================================================
+ //= OSQLParseNode
+ //==========================================================================
+ class OOO_DLLPUBLIC_DBTOOLS OSQLParseNode
+ {
+ friend class OSQLParser;
+
+ OSQLParseNodes m_aChildren;
+ OSQLParseNode* m_pParent; // pParent for reverse linkage in the tree
+ OUString m_aNodeValue; // token name, or empty in case of rules,
+ // or OUString in case of
+ // OUString, INT, etc.
+ SQLNodeType m_eNodeType; // see above
+ sal_uInt32 m_nNodeID; // ::com::sun::star::chaos::Rule ID (if IsRule())
+ // or Token ID (if !IsRule())
+ // ::com::sun::star::chaos::Rule IDs and Token IDs can't
+ // be distinguished by their values,
+ // IsRule has to be used for that!
+ public:
+ enum Rule
+ {
+ UNKNOWN_RULE = 0, // ID indicating that a node is no rule with a matching Rule-enum value (see getKnownRuleID)
+ // we make sure it is 0 so that it is the default-constructor value of this enum
+ // and std::map<foo,Rule>::operator[](bar) default-inserts UNKNOWN_RULE rather than select_statement (!)
+ select_statement,
+ table_exp,
+ table_ref_commalist,
+ table_ref,
+ catalog_name,
+ schema_name,
+ table_name,
+ opt_column_commalist,
+ column_commalist,
+ column_ref_commalist,
+ column_ref,
+ opt_order_by_clause,
+ ordering_spec_commalist,
+ ordering_spec,
+ opt_asc_desc,
+ where_clause,
+ opt_where_clause,
+ search_condition,
+ comparison_predicate,
+ between_predicate,
+ like_predicate,
+ opt_escape,
+ test_for_null,
+ scalar_exp_commalist,
+ scalar_exp,
+ parameter_ref,
+ parameter,
+ general_set_fct,
+ range_variable,
+ column,
+ delete_statement_positioned,
+ delete_statement_searched,
+ update_statement_positioned,
+ update_statement_searched,
+ assignment_commalist,
+ assignment,
+ values_or_query_spec,
+ insert_statement,
+ insert_atom_commalist,
+ insert_atom,
+ predicate_check,
+ from_clause,
+ qualified_join,
+ cross_union,
+ select_sublist,
+ derived_column,
+ column_val,
+ set_fct_spec,
+ boolean_term,
+ boolean_primary,
+ num_value_exp,
+ join_type,
+ position_exp,
+ extract_exp,
+ length_exp,
+ char_value_fct,
+ odbc_call_spec,
+ in_predicate,
+ existence_test,
+ unique_test,
+ all_or_any_predicate,
+ named_columns_join,
+ join_condition,
+ joined_table,
+ boolean_factor,
+ sql_not,
+ boolean_test,
+ manipulative_statement,
+ subquery,
+ value_exp_commalist,
+ odbc_fct_spec,
+ union_statement,
+ outer_join_type,
+ char_value_exp,
+ term,
+ value_exp_primary,
+ value_exp,
+ selection,
+ fold,
+ char_substring_fct,
+ factor,
+ base_table_def,
+ base_table_element_commalist,
+ data_type,
+ column_def,
+ table_node,
+ as_clause,
+ opt_as,
+ op_column_commalist,
+ table_primary_as_range_column,
+ datetime_primary,
+ concatenation,
+ char_factor,
+ bit_value_fct,
+ comparison_predicate_part_2,
+ parenthesized_boolean_value_expression,
+ character_string_type,
+ other_like_predicate_part_2,
+ between_predicate_part_2,
+ cast_spec,
+ rule_count // last value
+ };
+
+ // must be ascii encoding for the value
+ OSQLParseNode(const sal_Char* _pValueStr,
+ SQLNodeType _eNodeType,
+ sal_uInt32 _nNodeID = 0);
+
+ OSQLParseNode(const OString& _rValue,
+ SQLNodeType eNewNodeType,
+ sal_uInt32 nNewNodeID=0);
+
+ OSQLParseNode(const OUString& _rValue,
+ SQLNodeType _eNodeType,
+ sal_uInt32 _nNodeID = 0);
+
+ // copies the respective ParseNode
+ OSQLParseNode(const OSQLParseNode& rParseNode);
+ OSQLParseNode& operator=(const OSQLParseNode& rParseNode);
+
+ sal_Bool operator==(OSQLParseNode& rParseNode) const;
+
+ // destructor destructs the tree recursively
+ virtual ~OSQLParseNode();
+
+ OSQLParseNode* getParent() const {return m_pParent;};
+
+ void setParent(OSQLParseNode* pParseNode) {m_pParent = pParseNode;};
+
+ size_t count() const {return m_aChildren.size();};
+ inline OSQLParseNode* getChild(sal_uInt32 nPos) const;
+
+ void append(OSQLParseNode* pNewSubTree);
+ void insert(sal_uInt32 nPos, OSQLParseNode* pNewSubTree);
+
+ OSQLParseNode* replace(OSQLParseNode* pOldSubTree, OSQLParseNode* pNewSubTree);
+
+ OSQLParseNode* removeAt(sal_uInt32 nPos);
+
+ void replaceNodeValue(const OUString& rTableAlias,const OUString& rColumnName);
+
+ /** parses the node to a string which can be passed to a driver's connection for execution
+
+ Any particles of the parse tree which represent application-level features - such
+ as queries appearing in the FROM part - are substituted, so that the resulting statement can
+ be executed at an SDBC-level connection.
+
+ @param _out_rString
+ is an output parameter taking the resulting SQL statement
+
+ @param _rxConnection
+ the connection relative to which to parse. This must be an SDB-level connection (e.g.
+ support the XQueriesSupplier interface) for the method to be able to do all necessary
+ substitutions.
+
+ @param _rParser
+ the SQLParser used to create the node. This is needed in case we need to parse
+ sub queries which are present in the SQL statement - those sub queries need to be parsed,
+ too, to check whether they contain nested sub queries.
+
+ @param _pErrorHolder
+ takes the error which occurred while generating the statement, if any. Might be <NULL/>,
+ in this case the error is not reported back, and can only be recognized by examing the
+ return value.
+
+ @return
+ <TRUE/> if and only if the parsing was successful.<br/>
+
+ Currently, there's only one condition how this method can fail: If it contains a nested
+ query which causes a cycle. E.g., consider a statement <code>SELECT * from "foo"</code>,
+ where <code>foo</code> is a query defined as <code>SELECT * FROM "bar"</code>, where
+ <code>bar</code> is defined as <code>SELECT * FROM "foo"</code>. This statement obviously
+ cannot be parsed to an executable statement.
+
+ If this method returns <FALSE/>, you're encouraged to check and handle the error in
+ <arg>_pErrorHolder</arg>.
+ */
+ bool parseNodeToExecutableStatement( OUString& _out_rString,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ OSQLParser& _rParser,
+ ::com::sun::star::sdbc::SQLException* _pErrorHolder ) const;
+
+ void parseNodeToStr(OUString& rString,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const IParseContext* pContext = NULL,
+ sal_Bool _bIntl = sal_False,
+ sal_Bool _bQuote= sal_True) const;
+
+ // quoted and internationalised
+ void parseNodeToPredicateStr(OUString& rString,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter,
+ const ::com::sun::star::lang::Locale& rIntl,
+ sal_Char _cDec,
+ const IParseContext* pContext = NULL ) const;
+
+ void parseNodeToPredicateStr(OUString& rString,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & _xField,
+ const ::com::sun::star::lang::Locale& rIntl,
+ sal_Char _cDec,
+ const IParseContext* pContext = NULL ) const;
+
+ OSQLParseNode* getByRule(OSQLParseNode::Rule eRule) const;
+
+#if OSL_DEBUG_LEVEL > 1
+ // shows the ParseTree with tabs and linefeeds
+ void showParseTree( OUString& rString ) const;
+ void showParseTree( OUStringBuffer& _inout_rBuf, sal_uInt32 nLevel ) const;
+#endif
+
+ SQLNodeType getNodeType() const {return m_eNodeType;};
+
+ // RuleId returns the RuleID of the node's rule (only if IsRule())
+ sal_uInt32 getRuleID() const {return m_nNodeID;}
+
+ /** returns the ID of the rule represented by the node
+ If the node does not represent a rule, UNKNOWN_RULE is returned
+ */
+ Rule getKnownRuleID() const;
+
+ // returns the TokenId of the node's token (only if !isRule())
+ sal_uInt32 getTokenID() const {return m_nNodeID;}
+
+ // IsRule tests whether a node is a rule (NonTerminal)
+ // ATTENTION: rules can be leaves, for example empty lists
+ sal_Bool isRule() const
+ { return (m_eNodeType == SQL_NODE_RULE) || (m_eNodeType == SQL_NODE_LISTRULE)
+ || (m_eNodeType == SQL_NODE_COMMALISTRULE);}
+
+ // IsToken tests whether a Node is a Token (Terminal but not a rule)
+ sal_Bool isToken() const {return !isRule();}
+
+ const OUString& getTokenValue() const {return m_aNodeValue;}
+
+ void setTokenValue(const OUString& rString) { if (isToken()) m_aNodeValue = rString;}
+
+ sal_Bool isLeaf() const {return m_aChildren.empty();}
+
+ // negate only a searchcondition, any other rule could cause a gpf
+ static void negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_Bool bNegate=sal_False);
+
+ // normalize a logic form
+ // e.q. (a or b) and (c or d) <=> a and c or a and d or b and c or b and d
+ static void disjunctiveNormalForm(OSQLParseNode*& pSearchCondition);
+
+ // Simplifies logic expressions
+ // a and a = a
+ // a or a = a
+ // a and ( a + b) = a
+ // a or a and b = a
+ static void absorptions(OSQLParseNode*& pSearchCondition);
+
+ // erase unnecessary braces
+ static void eraseBraces(OSQLParseNode*& pSearchCondition);
+
+ // makes the logic formula a little smaller
+ static void compress(OSQLParseNode*& pSearchCondition);
+ // return the catalog, schema and tablename form this node
+ // _pTableNode must be a rule of that above or a SQL_TOKEN_NAME
+ static sal_Bool getTableComponents(const OSQLParseNode* _pTableNode,
+ ::com::sun::star::uno::Any &_rCatalog,
+ OUString &_rSchema,
+ OUString &_rTable
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData);
+
+ // substitute all occurrences of :var or [name] into the dynamic parameter ?
+ // _pNode will be modified if parameters exists
+ static void substituteParameterNames(OSQLParseNode* _pNode);
+
+ /** return a table range when it exists.
+ */
+ static OUString getTableRange(const OSQLParseNode* _pTableRef);
+
+ protected:
+ // ParseNodeToStr concatenates all Tokens (leaves) of the ParseNodes.
+ void parseNodeToStr(OUString& rString,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & _xField,
+ const ::com::sun::star::lang::Locale& rIntl,
+ const IParseContext* pContext,
+ bool _bIntl,
+ bool _bQuote,
+ sal_Char _cDecSep,
+ bool _bPredicate,
+ bool _bSubstitute) const;
+
+ private:
+ void impl_parseNodeToString_throw( OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const;
+ void impl_parseLikeNodeToString_throw( OUStringBuffer& rString, const SQLParseNodeParameter& rParam ) const;
+ void impl_parseTableRangeNodeToString_throw( OUStringBuffer& rString, const SQLParseNodeParameter& rParam ) const;
+
+ /** parses a table_name node into a SQL statement particle.
+ @return
+ <TRUE/> if and only if parsing was successful, <FALSE/> if default handling should
+ be applied.
+ */
+ bool impl_parseTableNameNodeToString_throw( OUStringBuffer& rString, const SQLParseNodeParameter& rParam ) const;
+
+ sal_Bool addDateValue(OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const;
+ OUString convertDateTimeString(const SQLParseNodeParameter& rParam, const OUString& rString) const;
+ OUString convertDateString(const SQLParseNodeParameter& rParam, const OUString& rString) const;
+ OUString convertTimeString(const SQLParseNodeParameter& rParam, const OUString& rString) const;
+ void parseLeaf(OUStringBuffer& rString, const SQLParseNodeParameter& rParam) const;
+ };
+
+ //-----------------------------------------------------------------------------
+ inline OSQLParseNode* OSQLParseNode::getChild(sal_uInt32 nPos) const
+ {
+ OSL_ENSURE(nPos < m_aChildren.size(), "Invalid Position");
+
+ // return m_aChildren[nPos];
+ return m_aChildren.at(nPos);
+ }
+
+ // utilities to query for a specific rule, token or punctuation
+ #define SQL_ISRULE(pParseNode, eRule) ((pParseNode)->isRule() && (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::eRule))
+ #define SQL_ISRULEOR2(pParseNode, e1, e2) ((pParseNode)->isRule() && ( \
+ (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e1) || \
+ (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e2)))
+ #define SQL_ISRULEOR3(pParseNode, e1, e2, e3) ((pParseNode)->isRule() && ( \
+ (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e1) || \
+ (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e2) || \
+ (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e3)))
+ #define SQL_ISTOKEN(pParseNode, token) ((pParseNode)->isToken() && (pParseNode)->getTokenID() == SQL_TOKEN_##token)
+ #define SQL_ISTOKENOR2(pParseNode, tok0, tok1) ((pParseNode)->isToken() && ( (pParseNode)->getTokenID() == SQL_TOKEN_##tok0 || (pParseNode)->getTokenID() == SQL_TOKEN_##tok1 ))
+ #define SQL_ISTOKENOR3(pParseNode, tok0, tok1, tok2) ((pParseNode)->isToken() && ( (pParseNode)->getTokenID() == SQL_TOKEN_##tok0 || (pParseNode)->getTokenID() == SQL_TOKEN_##tok1 || (pParseNode)->getTokenID() == SQL_TOKEN_##tok2 ))
+ #define SQL_ISPUNCTUATION(pParseNode, aString) ((pParseNode)->getNodeType() == SQL_NODE_PUNCTUATION && !(pParseNode)->getTokenValue().compareToAscii(aString))
+}
+
+#endif //_CONNECTIVITY_SQLNODE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/sqlparse.hxx b/include/connectivity/sqlparse.hxx
new file mode 100644
index 000000000000..892d3ecb8db5
--- /dev/null
+++ b/include/connectivity/sqlparse.hxx
@@ -0,0 +1,253 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _CONNECTIVITY_SQLPARSE_HXX
+#define _CONNECTIVITY_SQLPARSE_HXX
+
+#include <com/sun/star/uno/Reference.h>
+#include <osl/mutex.hxx>
+#include <connectivity/sqlnode.hxx>
+#ifndef DISABLE_DBCONNECTIVITY
+#ifndef YYBISON
+#ifndef FLEX_SCANNER
+#include "sqlbison.hxx"
+#endif
+#endif
+#endif
+#include <com/sun/star/i18n/XCharacterClassification.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/i18n/XLocaleData4.hpp>
+#include "connectivity/IParseContext.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/sqlerror.hxx"
+#include <salhelper/singletonref.hxx>
+
+#include <map>
+
+// forward declarations
+namespace com
+{
+ namespace sun
+ {
+ namespace star
+ {
+ namespace beans
+ {
+ class XPropertySet;
+ }
+ namespace util
+ {
+ class XNumberFormatter;
+ }
+ namespace lang
+ {
+ struct Locale;
+ }
+ }
+ }
+}
+namespace connectivity
+{
+ class OSQLScanner;
+ class SQLError;
+
+ //==========================================================================
+ //= OParseContext
+ //==========================================================================
+ class OOO_DLLPUBLIC_DBTOOLS OParseContext : public IParseContext
+ {
+ public:
+ OParseContext();
+
+ virtual ~OParseContext();
+ // retrieves language specific error messages
+ virtual OUString getErrorMessage(ErrorCode _eCodes) const;
+
+ // retrieves language specific keyword strings (only ASCII allowed)
+ virtual OString getIntlKeywordAscii(InternationalKeyCode _eKey) const;
+
+ // finds out, if we have an international keyword (only ASCII allowed)
+ virtual InternationalKeyCode getIntlKeyCode(const OString& rToken) const;
+
+ // determines the default international setting
+ static const ::com::sun::star::lang::Locale& getDefaultLocale();
+
+ /** get's a locale instance which should be used when parsing in the context specified by this instance
+ <p>if this is not overridden by derived classes, it returns the static default locale.</p>
+ */
+ virtual ::com::sun::star::lang::Locale getPreferredLocale( ) const;
+ };
+
+ //==========================================================================
+ // OSQLParseNodesContainer
+ // grabage collection of nodes
+ //==========================================================================
+ class OSQLParseNodesContainer
+ {
+ ::osl::Mutex m_aMutex;
+ ::std::vector< OSQLParseNode* > m_aNodes;
+ public:
+ OSQLParseNodesContainer();
+ ~OSQLParseNodesContainer();
+
+ void push_back(OSQLParseNode* _pNode);
+ void erase(OSQLParseNode* _pNode);
+ void clear();
+ void clearAndDelete();
+ };
+
+ typedef salhelper::SingletonRef<OSQLParseNodesContainer> OSQLParseNodesGarbageCollector;
+
+ //==========================================================================
+ //= OSQLParser
+ //==========================================================================
+ struct OSQLParser_Data
+ {
+ ::com::sun::star::lang::Locale aLocale;
+ ::connectivity::SQLError aErrors;
+
+ OSQLParser_Data( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext )
+ :aErrors( _rxContext )
+ {
+ }
+ };
+
+ /** Parser for SQL92
+ */
+ class OOO_DLLPUBLIC_DBTOOLS OSQLParser
+ {
+ friend class OSQLParseNode;
+ friend class OSQLInternalNode;
+ friend struct SQLParseNodeParameter;
+
+ private:
+ typedef ::std::map< sal_uInt32, OSQLParseNode::Rule > RuleIDMap;
+ // static parts for parsers
+ static sal_uInt32 s_nRuleIDs[OSQLParseNode::rule_count + 1];
+ static RuleIDMap s_aReverseRuleIDLookup;
+ static OParseContext s_aDefaultContext;
+
+ static OSQLScanner* s_pScanner;
+ static OSQLParseNodesGarbageCollector* s_pGarbageCollector;
+ static sal_Int32 s_nRefCount;
+
+ // information on the current parse action
+ const IParseContext* m_pContext;
+ OSQLParseNode* m_pParseTree; // result from parsing
+ ::std::auto_ptr< OSQLParser_Data >
+ m_pData;
+ OUString m_sFieldName; // current field name for a predicate
+ OUString m_sErrorMessage;// current error msg
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+ m_xField; // current field
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >
+ m_xFormatter; // current number formatter
+ sal_Int32 m_nFormatKey; // numberformat, which should be used
+ sal_Int32 m_nDateFormatKey;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification> m_xCharClass;
+ static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData4> s_xLocaleData;
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData> xDummy; // can be deleted after 627
+
+ // convert a string into double trim it to scale of _nscale and than transform it back to string
+ OUString stringToDouble(const OUString& _rValue,sal_Int16 _nScale);
+ OSQLParseNode* buildDate(sal_Int32 _nType,OSQLParseNode*& pLiteral);
+ bool extractDate(OSQLParseNode* pLiteral,double& _rfValue);
+ void killThousandSeparator(OSQLParseNode* pLiteral);
+ OSQLParseNode* convertNode(sal_Int32 nType,OSQLParseNode*& pLiteral);
+ // makes a string out of a number, pLiteral will be deleted
+ OSQLParseNode* buildNode_STR_NUM(OSQLParseNode*& pLiteral);
+ OSQLParseNode* buildNode_Date(const double& fValue, sal_Int32 nType);
+
+ static ::osl::Mutex& getMutex();
+
+ public:
+ // if NULL, a default context will be used
+ // the context must live as long as the parser
+ OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const IParseContext* _pContext = NULL);
+ ~OSQLParser();
+
+ // Parsing an SQLStatement
+ OSQLParseNode* parseTree(OUString& rErrorMessage,
+ const OUString& rStatement,
+ sal_Bool bInternational = sal_False);
+
+ // Check a Predicate
+ OSQLParseNode* predicateTree(OUString& rErrorMessage, const OUString& rStatement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xField);
+
+ // Access to the context
+ const IParseContext& getContext() const {return *m_pContext;}
+
+ /// access to the SQLError instance owned by this parser
+ const SQLError& getErrorHelper() const;
+
+ // TokenIDToStr: token name belonging to a token number.
+ static OString TokenIDToStr(sal_uInt32 nTokenID, const IParseContext* pContext = NULL);
+
+#if OSL_DEBUG_LEVEL > 1
+ // (empty string if not found)
+ static OUString RuleIDToStr(sal_uInt32 nRuleID);
+#endif
+
+ // StrToRuleID calculates the RuleID for a OUString (that is, ::com::sun::star::sdbcx::Index in yytname)
+ // (0 if not found). The search for an ID based on a String is
+ // extremely inefficient (sequential search for OUString)!
+ static sal_uInt32 StrToRuleID(const OString & rValue);
+
+ static OSQLParseNode::Rule RuleIDToRule( sal_uInt32 _nRule );
+
+ // RuleId with enum, far more efficient
+ static sal_uInt32 RuleID(OSQLParseNode::Rule eRule);
+ // compares the _sFunctionName with all known function names and return the DataType of the return value
+ static sal_Int32 getFunctionReturnType(const OUString& _sFunctionName, const IParseContext* pContext = NULL);
+
+ // returns the type for a parameter in a given function name
+ static sal_Int32 getFunctionParameterType(sal_uInt32 _nTokenId,sal_uInt32 _nPos);
+
+ void error(const sal_Char *fmt);
+ int SQLlex();
+#ifdef YYBISON
+ void setParseTree(OSQLParseNode * pNewParseTree);
+
+ // Is the parse in a special mode?
+ // Predicate chack is used to check a condition for a field
+ sal_Bool inPredicateCheck() const {return m_xField.is();}
+ const OUString& getFieldName() const {return m_sFieldName;}
+
+ void reduceLiteral(OSQLParseNode*& pLiteral, sal_Bool bAppendBlank);
+ // does not change the pLiteral argument
+ sal_Int16 buildNode(OSQLParseNode*& pAppend,OSQLParseNode* pCompare,OSQLParseNode* pLiteral,OSQLParseNode* pLiteral2);
+
+ sal_Int16 buildComparsionRule(OSQLParseNode*& pAppend,OSQLParseNode* pLiteral);
+ // pCompre will be deleted if it is not used
+ sal_Int16 buildPredicateRule(OSQLParseNode*& pAppend,OSQLParseNode* pLiteral,OSQLParseNode*& pCompare,OSQLParseNode* pLiteral2 = NULL);
+
+ sal_Int16 buildLikeRule(OSQLParseNode*& pAppend,OSQLParseNode*& pLiteral,const OSQLParseNode* pEscape);
+ sal_Int16 buildStringNodes(OSQLParseNode*& pLiteral);
+#else
+#endif
+ };
+}
+
+
+#endif //_CONNECTIVITY_SQLPARSE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/standardsqlstate.hxx b/include/connectivity/standardsqlstate.hxx
new file mode 100644
index 000000000000..fb896d1a8af8
--- /dev/null
+++ b/include/connectivity/standardsqlstate.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 CONNECTIVITY_STANDARD_SQL_STATE_HXX
+#define CONNECTIVITY_STANDARD_SQL_STATE_HXX
+
+//.........................................................................
+namespace dbtools
+{
+//.........................................................................
+
+ //----------------------------------------------------------------------------------
+ /** standard SQLStates to be used with an SQLException
+
+ Extend this list whenever you need a new state ...
+
+ @see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcodbc_error_codes.asp
+ */
+ enum StandardSQLState
+ {
+ SQL_WRONG_PARAMETER_NUMBER, // 07001
+ SQL_INVALID_DESCRIPTOR_INDEX, // 07009
+ SQL_UNABLE_TO_CONNECT, // 08001
+ SQL_NUMERIC_OUT_OF_RANGE, // 22003
+ SQL_INVALID_DATE_TIME, // 22007
+ SQL_INVALID_CURSOR_STATE, // 24000
+ SQL_TABLE_OR_VIEW_EXISTS, // 42S01
+ SQL_TABLE_OR_VIEW_NOT_FOUND, // 42S02
+ SQL_INDEX_ESISTS, // 42S11
+ SQL_INDEX_NOT_FOUND, // 42S12
+ SQL_COLUMN_EXISTS, // 42S21
+ SQL_COLUMN_NOT_FOUND, // 42S22
+ SQL_GENERAL_ERROR, // HY000
+ SQL_INVALID_SQL_DATA_TYPE, // HY004
+ SQL_OPERATION_CANCELED, // HY008
+ SQL_FUNCTION_SEQUENCE_ERROR, // HY010
+ SQL_INVALID_CURSOR_POSITION, // HY109
+ SQL_INVALID_BOOKMARK_VALUE, // HY111
+ SQL_FEATURE_NOT_IMPLEMENTED, // HYC00
+ SQL_FUNCTION_NOT_SUPPORTED, // IM001
+ SQL_CONNECTION_DOES_NOT_EXIST, // 08003
+
+ SQL_ERROR_UNSPECIFIED = SAL_MAX_ENUM // special value indicating that an SQLState is not to be specified
+ };
+
+//.........................................................................
+} // namespace dbtools
+//.........................................................................
+
+#endif // CONNECTIVITY_STANDARD_SQL_STATE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/statementcomposer.hxx b/include/connectivity/statementcomposer.hxx
new file mode 100644
index 000000000000..56b10ebd0d11
--- /dev/null
+++ b/include/connectivity/statementcomposer.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 CONNECTIVITY_STATEMENTCOMPOSER_HXX
+#define CONNECTIVITY_STATEMENTCOMPOSER_HXX
+
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
+
+#include <boost/noncopyable.hpp>
+
+#include <memory>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+//........................................................................
+namespace dbtools
+{
+//........................................................................
+
+ //====================================================================
+ //= StatementComposer
+ //====================================================================
+ struct StatementComposer_Data;
+ /** a class which is able to compose queries (SELECT statements) from a command and a command type
+ */
+ class OOO_DLLPUBLIC_DBTOOLS StatementComposer : public ::boost::noncopyable
+ {
+ ::std::auto_ptr< StatementComposer_Data > m_pData;
+
+ public:
+ /** constructs an instance
+
+ @param _rxConnection
+ the connection to work with. Must not be <NULL/>.
+ */
+ StatementComposer(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const OUString& _rCommand,
+ const sal_Int32 _nCommandType,
+ const sal_Bool _bEscapeProcessing
+ );
+
+ ~StatementComposer();
+
+ /** controls whether or not the instance disposes its XSingleSelectQueryComposer upon
+ destruction
+
+ Unless you explicitly call this method with the parameter being <TRUE/>,
+ the XSingleSelectQueryComposer will be disposed when the StatementComposer
+ instance is destroyed.
+ */
+ void setDisposeComposer( bool _bDoDispose );
+
+ void setFilter( const OUString& _rFilter );
+ void setOrder( const OUString& _rOrder );
+
+ /** returns the composer which has been fed with the current settings
+
+ @throws ::com::sun::star::sdbc::SQLException
+ if such an exception occurs while creating the composer
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer >
+ getComposer();
+
+ /** returns the composer statement
+
+ Effectively, this is equivalent to calling getComposer, and asking the composer
+ for its Query attribute.
+
+ @throws ::com::sun::star::sdbc::SQLException
+ if such an exception occurs while creating the composer
+ */
+ OUString
+ getQuery();
+
+ private:
+ StatementComposer(); // not implemented
+ };
+
+//........................................................................
+} // namespace dbtools
+//........................................................................
+
+#endif // CONNECTIVITY_STATEMENTCOMPOSER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/virtualdbtools.hxx b/include/connectivity/virtualdbtools.hxx
new file mode 100644
index 000000000000..352c98d7a8c4
--- /dev/null
+++ b/include/connectivity/virtualdbtools.hxx
@@ -0,0 +1,371 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CONNECTIVITY_VIRTUAL_DBTOOLS_HXX
+#define CONNECTIVITY_VIRTUAL_DBTOOLS_HXX
+
+#include <rtl/ref.hxx>
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/sdbc/SQLException.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <vector>
+#include <memory>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+//========================================================================
+//= forward declarations
+//========================================================================
+namespace com {
+ namespace sun {
+ namespace star {
+ namespace util {
+ class XNumberFormatter;
+ class XNumberFormatTypes;
+ class XNumberFormatsSupplier;
+ }
+ namespace beans {
+ class XPropertySet;
+ }
+ namespace lang {
+ class XMultiServiceFactory;
+ class XComponent;
+ class WrappedTargetException;
+ struct Locale;
+ }
+ namespace sdbc {
+ class XDatabaseMetaData;
+ class XConnection;
+ class XRowSet;
+ class XDataSource;
+ }
+ namespace sdb {
+ class XColumn;
+ class SQLContext;
+ }
+ namespace uno {
+ class XComponentContext;
+ }
+ namespace container {
+ class XNameAccess;
+ }
+ }
+ }
+}
+
+namespace dbtools {
+ class SQLExceptionInfo;
+ class FormattedColumnValue;
+}
+
+namespace comphelper {
+ class ComponentContext;
+}
+
+//========================================================================
+//= entry into this library
+//========================================================================
+/** this is the entry point for the load-on-call usage of the DBTOOLS
+ library.
+ <p>When you need one of the simple objects in this library, load the lib
+ and call this method. The returned pointer is a pointer to an IDataAccessToolsFactory
+ instance, which is acquired <em>once</em>.</p>
+ @return
+ a pointer to an object implementing the IDataAccessToolsFactory interface,
+ aquired exactly <em>once</em>.
+*/
+extern "C" OOO_DLLPUBLIC_DBTOOLS void* SAL_CALL createDataAccessToolsFactory();
+
+//========================================================================
+//=
+//========================================================================
+//........................................................................
+namespace connectivity
+{
+//........................................................................
+
+ class IParseContext;
+ //....................................................................
+ namespace simple
+ {
+ //....................................................................
+
+ typedef void* (SAL_CALL * createDataAccessToolsFactoryFunction)( );
+
+ //================================================================
+ //= IDataAccessTools
+ //================================================================
+ class OOO_DLLPUBLIC_DBTOOLS IDataAccessTools : public ::rtl::IReference
+ {
+ public:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection_withFeedback(
+ const OUString& _rDataSourceName,
+ const OUString& _rUser,
+ const OUString& _rPwd,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext
+ ) const SAL_THROW ( (::com::sun::star::sdbc::SQLException) ) = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> connectRowset(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext,
+ sal_Bool _bSetAsActiveConnection
+ ) const SAL_THROW ( ( ::com::sun::star::sdbc::SQLException
+ , ::com::sun::star::lang::WrappedTargetException
+ , ::com::sun::star::uno::RuntimeException ) ) = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getRowSetConnection(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet)
+ const SAL_THROW ( (::com::sun::star::uno::RuntimeException) ) = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> getNumberFormats(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConn,
+ sal_Bool _bAllowDefault
+ ) const = 0;
+
+ virtual sal_Int32 getDefaultNumberFormat(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes >& _rxTypes,
+ const ::com::sun::star::lang::Locale& _rLocale
+ ) const = 0;
+
+ virtual void TransferFormComponentProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxOld,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxNew,
+ const ::com::sun::star::lang::Locale& _rLocale
+ ) const = 0;
+
+ virtual OUString quoteName(
+ const OUString& _rQuote,
+ const OUString& _rName
+ ) const = 0;
+
+ virtual OUString composeTableNameForSelect(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const OUString& _rCatalog,
+ const OUString& _rSchema,
+ const OUString& _rName
+ ) const = 0;
+
+ virtual OUString composeTableNameForSelect(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable
+ ) const = 0;
+
+ virtual ::com::sun::star::sdb::SQLContext prependContextInfo(
+ ::com::sun::star::sdbc::SQLException& _rException,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext,
+ const OUString& _rContextDescription,
+ const OUString& _rContextDetails
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > getDataSource(
+ const OUString& _rsRegisteredName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
+ getFieldsByCommandDescriptor(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const sal_Int32 _nCommandType,
+ const OUString& _rCommand,
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxKeepFieldsAlive,
+ ::dbtools::SQLExceptionInfo* _pErrorInfo = NULL
+ ) SAL_THROW( ( ) ) = 0;
+
+ virtual ::com::sun::star::uno::Sequence< OUString >
+ getFieldNamesByCommandDescriptor(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const sal_Int32 _nCommandType,
+ const OUString& _rCommand,
+ ::dbtools::SQLExceptionInfo* _pErrorInfo = NULL
+ ) SAL_THROW( ( ) ) = 0;
+
+ /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::INSERT
+ @param _rxCursorSet the property set
+ */
+ virtual sal_Bool canInsert(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const = 0;
+
+ /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::UPDATE
+ @param _rxCursorSet the property set
+ */
+ virtual sal_Bool canUpdate(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const = 0;
+
+ /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::DELETE
+ @param _rxCursorSet the property set
+ */
+ virtual sal_Bool canDelete(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const = 0;
+
+ /** determines whether the given component is part of a document which is an embedded database
+ document (such as a form)
+ */
+ virtual bool isEmbeddedInDatabase(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent,
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxActualConnection
+ ) = 0;
+
+ protected:
+ ~IDataAccessTools() {}
+ };
+
+ //================================================================
+ //= IDataAccessCharSet
+ //================================================================
+ /** simple wrapper for the <type>OCharsetMap</type>
+ */
+ class OOO_DLLPUBLIC_DBTOOLS IDataAccessCharSet :
+ public ::rtl::IReference
+ {
+ // to be extended if necessary ....
+ public:
+ /** enumerates all supported char sets
+ @return the number of charsets supported
+ */
+ virtual sal_Int32 getSupportedTextEncodings(
+ ::std::vector< rtl_TextEncoding >& /* [out] */ _rEncs
+ ) const = 0;
+
+ protected:
+ ~IDataAccessCharSet() {}
+ };
+
+ //================================================================
+ //= IDataAccessTypeConversion
+ //================================================================
+ class OOO_DLLPUBLIC_DBTOOLS IDataAccessTypeConversion :
+ public ::rtl::IReference
+ {
+ public:
+ virtual ::com::sun::star::util::Date getStandardDate() const = 0;
+
+ virtual double getValue(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _rxVariant,
+ const ::com::sun::star::util::Date& rNullDate ) const = 0;
+
+ virtual OUString getFormattedValue(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter,
+ const ::com::sun::star::util::Date& _rNullDate,
+ sal_Int32 _nKey,
+ sal_Int16 _nKeyType) const = 0;
+
+ virtual OUString getFormattedValue(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& _rxFormatter,
+ const ::com::sun::star::lang::Locale& _rLocale,
+ const ::com::sun::star::util::Date& _rNullDate
+ ) const = 0;
+
+ protected:
+ ~IDataAccessTypeConversion() {}
+ };
+
+ //================================================================
+ //= ISQLParseNode
+ //================================================================
+ /** a simple version of the OSQLParseNode, with all methods beeing virtual
+ */
+ class OOO_DLLPUBLIC_DBTOOLS ISQLParseNode : public ::rtl::IReference
+ {
+ public:
+ virtual void parseNodeToStr(OUString& _rString,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const IParseContext* _pContext
+ ) const = 0;
+
+ virtual void parseNodeToPredicateStr(OUString& _rString,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField,
+ const ::com::sun::star::lang::Locale& _rIntl,
+ const sal_Char _cDecSeparator,
+ const IParseContext* _pContext
+ ) const = 0;
+
+ protected:
+ ~ISQLParseNode() {}
+ };
+
+ //================================================================
+ //= ISQLParser
+ //================================================================
+ /** a simple version of the OSQLParser, with all methods beeing virtual
+ */
+ class OOO_DLLPUBLIC_DBTOOLS ISQLParser : public ::rtl::IReference
+ {
+ public:
+ virtual ::rtl::Reference< ISQLParseNode > predicateTree(
+ OUString& rErrorMessage,
+ const OUString& rStatement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField
+ ) const = 0;
+
+ virtual const IParseContext& getContext() const = 0;
+
+ protected:
+ ~ISQLParser() {}
+ };
+
+ //================================================================
+ //= IDataAccessToolsFactory
+ //================================================================
+ /** the main factory for runtime-loadable tools in the DBTOOLS library
+ */
+ class OOO_DLLPUBLIC_DBTOOLS IDataAccessToolsFactory :
+ public ::rtl::IReference
+ {
+ public:
+ /// creates a simple version of the class OSQLParser
+ virtual ::rtl::Reference< ISQLParser > createSQLParser(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const IParseContext* _pContext
+ ) const = 0;
+
+ /// creates a helper for charset related functionality (<type>OCharsetMap</type>)
+ virtual ::rtl::Reference< IDataAccessCharSet > createCharsetHelper( ) const = 0;
+
+ /// creates a simple version of the DBTypeConversion helper
+ virtual ::rtl::Reference< IDataAccessTypeConversion > getTypeConversionHelper() = 0;
+
+ /// creates a helper which can be used to access the static methods in dbtools.hxx
+ virtual ::rtl::Reference< IDataAccessTools > getDataAccessTools() = 0;
+
+ virtual ::std::auto_ptr< ::dbtools::FormattedColumnValue > createFormattedColumnValue(
+ const ::comphelper::ComponentContext& _rContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn
+ ) = 0;
+
+ protected:
+ ~IDataAccessToolsFactory() {}
+ };
+
+ //....................................................................
+ } // namespace simple
+ //....................................................................
+
+//........................................................................
+} // namespace connectivity
+//........................................................................
+
+#endif // CONNECTIVITY_VIRTUAL_DBTOOLS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/connectivity/warningscontainer.hxx b/include/connectivity/warningscontainer.hxx
new file mode 100644
index 000000000000..5a013f9a5145
--- /dev/null
+++ b/include/connectivity/warningscontainer.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 DBTOOLS_WARNINGSCONTAINER_HXX
+#define DBTOOLS_WARNINGSCONTAINER_HXX
+
+#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
+#include <com/sun/star/sdb/SQLContext.hpp>
+
+#include "connectivity/dbtoolsdllapi.hxx"
+
+//.........................................................................
+namespace dbtools
+{
+//.........................................................................
+
+ //=====================================================================
+ //= IWarningsContainer
+ //=====================================================================
+ class SAL_NO_VTABLE IWarningsContainer
+ {
+ public:
+ virtual void appendWarning(const ::com::sun::star::sdbc::SQLException& _rWarning) = 0;
+ virtual void appendWarning(const ::com::sun::star::sdbc::SQLWarning& _rWarning) = 0;
+ virtual void appendWarning(const ::com::sun::star::sdb::SQLContext& _rContext) = 0;
+
+ protected:
+ ~IWarningsContainer() {}
+ };
+
+ //====================================================================
+ //= WarningsContainer
+ //====================================================================
+ /** helper class for implementing XWarningsSupplier, which mixes own warnings with
+ warnings obtained from an external instance
+ */
+ class OOO_DLLPUBLIC_DBTOOLS WarningsContainer : public IWarningsContainer
+ {
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XWarningsSupplier > m_xExternalWarnings;
+ ::com::sun::star::uno::Any m_aOwnWarnings;
+
+ public:
+ WarningsContainer() { }
+ WarningsContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XWarningsSupplier >& _rxExternalWarnings )
+ :m_xExternalWarnings( _rxExternalWarnings )
+ {
+ }
+ virtual ~WarningsContainer();
+
+ void setExternalWarnings( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XWarningsSupplier >& _rxExternalWarnings )
+ {
+ m_xExternalWarnings = _rxExternalWarnings;
+ }
+
+ // convenience
+ /** appends an SQLWarning instance to the chain
+ @param _rWarning
+ the warning message
+ @param _pAsciiSQLState
+ the SQLState of the warning
+ @param _rxContext
+ the context of the warning
+ */
+ void appendWarning(
+ const OUString& _rWarning,
+ const sal_Char* _pAsciiSQLState,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext );
+
+ // IWarningsContainer
+ virtual void appendWarning(const ::com::sun::star::sdbc::SQLException& _rWarning);
+ virtual void appendWarning(const ::com::sun::star::sdbc::SQLWarning& _rWarning);
+ virtual void appendWarning(const ::com::sun::star::sdb::SQLContext& _rContext);
+
+ // XWarningsSupplier equivalents
+ ::com::sun::star::uno::Any SAL_CALL getWarnings( ) const;
+ void SAL_CALL clearWarnings( );
+ };
+
+//.........................................................................
+} // namespace dbtools
+//.........................................................................
+
+#endif // DBTOOLS_WARNINGSCONTAINER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/bstream.hxx b/include/cosv/bstream.hxx
new file mode 100644
index 000000000000..2d943bc02ce6
--- /dev/null
+++ b/include/cosv/bstream.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 CSV_BSTREAM_HXX
+#define CSV_BSTREAM_HXX
+
+#include <string.h>
+#include <cosv/string.hxx>
+
+
+namespace csv
+{
+
+
+enum seek_dir
+{
+ beg = 0,
+ cur = 1,
+ end = 2
+};
+
+
+class bistream
+{
+ public:
+ // LIFECYCLE
+ virtual ~bistream() {}
+
+ // OPERATIONS
+ /// @return Number of actually read bytes.
+ uintt read(
+ void * out_pDest,
+ uintt i_nNrofBytes);
+ // INQUIRY
+ /** @return True, if already one try to read had failed.
+ There is no guarantee, that it returns true, if end of data
+ is just reached.
+ Though it will return false, if there is still somemething
+ to read.
+ */
+ bool eod() const;
+
+ private:
+ virtual uintt do_read(
+ void * out_pDest,
+ uintt i_nNrofBytes) = 0;
+ virtual bool inq_eod() const = 0;
+};
+
+
+class bostream
+{
+ public:
+ // LIFECYCLE
+ virtual ~bostream() {}
+
+ // OPERATIONS
+ /// @return Number of actually written bytes.
+ uintt write(
+ const void * i_pSrc,
+ uintt i_nNrofBytes);
+ /// @return Number of actually written bytes.
+ uintt write(
+ const char * i_pSrc );
+ /// @return Number of actually written bytes.
+ uintt write(
+ const String & i_pSrc );
+ private:
+ virtual uintt do_write(
+ const void * i_pSrc,
+ uintt i_nNrofBytes) = 0;
+};
+
+
+class bstream : public bistream,
+ public bostream
+{
+ public:
+ uintt seek(
+ intt i_nDistanceFromBegin,
+ seek_dir i_eStartPoint = ::csv::beg );
+ uintt position() const;
+
+ private:
+ virtual uintt do_seek(
+ intt i_nDistance,
+ seek_dir i_eStartPoint = ::csv::beg ) = 0;
+ virtual uintt inq_position() const = 0;
+};
+
+
+// IMPLEMENTATION
+inline uintt
+bistream::read( void * o_pDest,
+ uintt i_nNrofBytes)
+ { return do_read(o_pDest, i_nNrofBytes); }
+inline bool
+bistream::eod() const
+ { return inq_eod(); }
+
+inline uintt
+bostream::write( const void * i_pSrc,
+ uintt i_nNrofBytes)
+ { return do_write( i_pSrc, i_nNrofBytes ); }
+inline uintt
+bostream::write( const char * i_sSrc )
+ { return write( i_sSrc, strlen(i_sSrc) ); }
+inline uintt
+bostream::write( const String & i_sSrc )
+ { return write( i_sSrc.c_str(), i_sSrc.length() ); }
+
+inline uintt
+bstream::seek( intt i_nDistance,
+ seek_dir i_eStartPoint )
+ { return do_seek( i_nDistance, i_eStartPoint ); }
+inline uintt
+bstream::position() const
+ { return inq_position(); }
+
+
+
+} // namespace csv
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/comdline.hxx b/include/cosv/comdline.hxx
new file mode 100644
index 000000000000..80ebc763b9d9
--- /dev/null
+++ b/include/cosv/comdline.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 CSV_COMDLINE_HXX
+#define CSV_COMDLINE_HXX
+// KORR_DEPRECATED_3.0
+// Replace by cosv/commandline.hxx.
+
+
+namespace csv
+{
+
+class CommandLine_Ifc
+{
+ public:
+ virtual ~CommandLine_Ifc() {}
+
+ void Init(
+ int argc,
+ char * argv[] );
+ void PrintUse() const;
+ bool CheckParameters() const;
+
+ private:
+ virtual void do_Init(
+ int argc,
+ char * argv[] ) = 0;
+
+ virtual void do_PrintUse() const = 0;
+ virtual bool inq_CheckParameters() const = 0;
+};
+
+inline void
+CommandLine_Ifc::Init( int argc,
+ char * argv[] )
+ { do_Init( argc, argv ); }
+inline void
+CommandLine_Ifc::PrintUse() const
+ { do_PrintUse(); }
+
+} // namespace csv
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/comfunc.hxx b/include/cosv/comfunc.hxx
new file mode 100644
index 000000000000..a294d81f2aae
--- /dev/null
+++ b/include/cosv/comfunc.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 CSV_COMFUNC_HXX
+#define CSV_COMFUNC_HXX
+
+#include <stdlib.h>
+
+
+
+
+namespace csv
+{
+ class String;
+
+
+// min, max and range functions
+template <class E>
+inline E max(E in1, E in2);
+template <class E>
+inline E min(E in1, E in2);
+template <class E>
+inline bool in_range(E low, E val, E high); // return low <= val < high;
+
+
+// string functions
+inline const char * valid_str(const char * str);
+inline bool no_str(const char * str); // return !str || !strlen(str)
+
+
+// IMPLEMENTATION
+template <class E>
+inline E
+max(E in1, E in2) { return in1 < in2 ? in2 : in1; }
+template <class E>
+inline E
+min(E in1, E in2) { return in1 < in2 ? in1 : in2; }
+template <class E>
+inline bool
+in_range(E low, E val, E high) { return low <= val AND val < high; }
+
+inline const char *
+valid_str(const char * str) { return str != 0 ? str : ""; }
+inline bool
+no_str(const char * str) { return str != 0 ? *str == '\0' : true; }
+
+} // namespace csv
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/csv_env.hxx b/include/cosv/csv_env.hxx
new file mode 100644
index 000000000000..f49ed54ea464
--- /dev/null
+++ b/include/cosv/csv_env.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 CSV_CSV_ENV_HXX
+#define CSV_CSV_ENV_HXX
+
+
+
+//******* Include c-language-types ************//
+// size_t, wchar_t
+#include <stdlib.h>
+
+
+
+//******* Builtin types of exact length ************//
+
+// Exact length builtin types
+typedef signed char INT8;
+typedef unsigned char UINT8;
+typedef short INT16;
+typedef unsigned short UINT16;
+typedef long INT32;
+typedef unsigned long UINT32;
+typedef float REAL32;
+typedef double REAL64;
+
+
+// Additional builtin types
+typedef INT32 intt; // standard sized integer.
+typedef UINT32 uintt; // standard sized unsigned integer.
+typedef REAL64 real; // standard sized real.
+
+// Constants
+// ---------
+// Zero-pointer for use in ellipsed (...) parameter lists which expect a
+// pointer which may have another size than an int.
+// Must be a define to be used in precompiled headers:
+#define NIL ((void*)0)
+// char '\0'
+#define NULCH '\0'
+
+
+
+// Boolesche Operatoren
+#define AND &&
+#define OR ||
+#define NOT !
+
+// Macro for distinguishing dynamic allocated pointers from
+// referencing pointers
+#define DYN // Exact specification: DYN has to be used if and only if:
+ // 1. DYN specifies a class member pointer or reference variable and
+ // the class must free the referenced memory.
+ // 2. DYN specifies a pointer or reference (return-) parameter of a function
+ // and for in-parameters the function or its class
+ // must free the referenced memory, the parameter is then called
+ // a let-parameter.
+ // For out- and inout-parameters
+ // or return values the caller of the function hast to
+ // free the referenced memory.
+ //
+ // It is irrelevant who allocated the memory!
+ //
+ // DYN - variables use the prefixes "dp" or "dr" instead of "p" or "r".
+
+
+//****** Assertions ******//
+
+namespace csv
+{
+void PerformAssertion(
+ const char * condition,
+ const char * file,
+ unsigned line );
+}
+
+// Programming by contract
+#ifndef CSV_NO_ASSERTIONS
+
+#ifdef CSV_USE_CSV_ASSERTIONS
+#define csv_assert(x) ( (x) ? (void)(0) : ::csv::PerformAssertion( #x, __FILE__, __LINE__) )
+#else
+
+// Save NDEBUG state
+#ifdef NDEBUG
+#define CSV_CSV_ENV_HXX_HAD_NDEBUG
+#undef NDEBUG
+#endif
+
+#if OSL_DEBUG_LEVEL == 0
+#define NDEBUG
+#endif
+#include <assert.h>
+
+#define csv_assert(x) assert(x);
+
+// Restore NDEBUG state
+#ifdef CSV_CSV_ENV_HXX_HAD_NDEBUG
+#define NDEBUG
+#else
+#undef NDEBUG
+#endif
+
+#endif
+
+#else // #ifndef CSV_NO_ASSERTIONS else
+
+#define csv_assert(x)
+
+#endif // end ifndef CSV_NO_ASSERTIONS else
+
+
+
+/* Additional Programming Conventions
+
+1. see above at "#define DYN"
+2. function parameters get one of these prefixes:
+ - i_ := Function uses only the value, but must not change a referenced variable.
+ - o_ := Parameter is undefined until function has set it.
+ Parametere must be set by the function.
+ - io_ := Function may use and change the referenced variable.
+ - pass_ := Funktion may use and change the referenced variable and HAS TO free the
+ associated memory.
+3. Global constants get the prefix 'C_', global variables the prefix 'G_'.
+4. Static members end with an underscore '_'.
+
+*/
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/csv_ostream.hxx b/include/cosv/csv_ostream.hxx
new file mode 100644
index 000000000000..911fcb8c799e
--- /dev/null
+++ b/include/cosv/csv_ostream.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 CSV_CSV_OSTREAM_HXX
+#define CSV_CSV_OSTREAM_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+ // PARAMETERS
+
+
+
+#ifndef CSV_NO_IOSTREAMS
+
+#include <iostream>
+
+
+namespace csv
+{
+
+typedef std::ios ios;
+typedef std::ostream ostream;
+
+} // namespace csv
+
+
+#else
+
+#include <cosv/tpl/dyn.hxx>
+
+namespace csv
+{
+
+class StreamStr;
+
+class ios
+{
+ public:
+ enum seek_dir
+ {
+ beg=0,
+ cur=1,
+ end=2
+ };
+};
+
+class ostream : public ios
+{
+ public:
+ typedef ostream self;
+
+ virtual ~ostream();
+
+ self & operator<<(
+ const char * i_s );
+ self & operator<<(
+ char i_c );
+ self & operator<<(
+ unsigned char i_c );
+ self & operator<<(
+ signed char i_c );
+
+ self & operator<<(
+ short i_n );
+ self & operator<<(
+ unsigned short i_n );
+ self & operator<<(
+ int i_n );
+ self & operator<<(
+ unsigned int i_n );
+ self & operator<<(
+ long i_n );
+ self & operator<<(
+ unsigned long i_n );
+
+ self & operator<<(
+ float i_n );
+ self & operator<<(
+ double i_n );
+
+ self & seekp(
+ intt i_nOffset,
+ seek_dir i_eStart = ios::beg );
+ protected:
+ ostream(
+ uintt i_nStartSize );
+ const StreamStr & Data() const;
+
+ private:
+ Dyn<StreamStr> pData;
+};
+
+
+
+inline const StreamStr &
+ostream::Data() const
+ { return *pData; }
+
+
+} // namespace csv
+
+
+#endif
+
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/csv_precomp.h b/include/cosv/csv_precomp.h
new file mode 100644
index 000000000000..78f1378cda61
--- /dev/null
+++ b/include/cosv/csv_precomp.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 __CSV_PRECOMP_H_06071998__
+#define __CSV_PRECOMP_H_06071998__
+
+
+
+
+#define CSV_USE_CSV_ASSERTIONS
+#include <cosv/csv_env.hxx>
+
+#include <cosv/comfunc.hxx>
+#include <cosv/string.hxx>
+#include <cosv/streamstr.hxx>
+#include <cosv/std_outp.hxx>
+#include <cosv/tpl/dyn.hxx>
+
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/dirchain.hxx b/include/cosv/dirchain.hxx
new file mode 100644
index 000000000000..980937212690
--- /dev/null
+++ b/include/cosv/dirchain.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 CSV_DIRCHAIN_HXX
+#define CSV_DIRCHAIN_HXX
+
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+#include <cosv/string.hxx>
+ // PARAMETERS
+#include <cosv/csv_ostream.hxx>
+
+#include <cosv/persist.hxx>
+#include <cosv/tpl/tpltools.hxx>
+
+
+
+namespace csv
+{
+ class bostream;
+
+namespace ploc
+{
+
+
+class DirectoryChain
+{
+ public:
+ DirectoryChain();
+ DirectoryChain(
+ const DirectoryChain &
+ i_rDC );
+ ~DirectoryChain();
+
+ // OPERATORS
+ DirectoryChain & operator=(
+ const DirectoryChain &
+ i_rDC );
+ DirectoryChain & operator+=(
+ const String & i_sName );
+ DirectoryChain & operator+=(
+ const DirectoryChain &
+ i_rDC );
+ DirectoryChain & operator-=(
+ uintt i_nLevelsUp );
+
+ // OPERATIONS
+ void Set(
+ const char * i_sPath,
+ bool i_bPathIsAlwaysDir = false,
+ const char * i_sDelimiter = Delimiter() );
+ void PushBack(
+ const String & i_sName );
+ void PushBack(
+ const DirectoryChain &
+ i_sPath );
+ void PopBack(
+ uintt i_nCount = 1 );
+
+ // INQUIRY
+ uintt Size() const;
+
+ StringVector::const_iterator
+ Begin() const;
+ StringVector::const_iterator
+ End() const;
+
+ const String & Front() const;
+ const String & Back() const;
+
+ void Get(
+ bostream & o_rPath,
+ const char * i_sDelimiter ) const;
+ private:
+ StringVector aPath;
+};
+
+
+// IMPLEMENTATION
+inline
+DirectoryChain::DirectoryChain( const DirectoryChain & i_rDC )
+ { PushBack(i_rDC); }
+
+ // OPERATORS
+inline DirectoryChain &
+DirectoryChain::operator=( const DirectoryChain & i_rDC )
+ { csv::erase_container(aPath); PushBack(i_rDC); return *this; }
+inline DirectoryChain &
+DirectoryChain::operator+=( const String & i_sName )
+ { PushBack(i_sName); return *this; }
+inline DirectoryChain &
+DirectoryChain::operator+=( const DirectoryChain & i_rDC )
+ { PushBack(i_rDC); return *this; }
+inline DirectoryChain &
+DirectoryChain::operator-=( uintt i_nLevelsUp )
+ { PopBack(i_nLevelsUp); return *this; }
+inline uintt
+DirectoryChain::Size() const
+ { return aPath.size(); }
+
+inline StringVector::const_iterator
+DirectoryChain::Begin() const
+ { return aPath.begin(); }
+inline StringVector::const_iterator
+DirectoryChain::End() const
+ { return aPath.end(); }
+inline const String &
+DirectoryChain::Front() const
+ { return aPath.empty() ? String::Null_() : aPath.front(); }
+inline const String &
+DirectoryChain::Back() const
+ { return aPath.empty() ? String::Null_() : aPath.back(); }
+
+
+} // namespace ploc
+} // namespace csv
+
+inline csv::bostream &
+operator<<( csv::bostream & o_rOut,
+ const csv::ploc::DirectoryChain & i_rSubPath )
+{
+ i_rSubPath.Get(o_rOut, csv::ploc::Delimiter());
+ return o_rOut;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/file.hxx b/include/cosv/file.hxx
new file mode 100644
index 000000000000..86c880e73184
--- /dev/null
+++ b/include/cosv/file.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 CSV_FILE_HXX
+#define CSV_FILE_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <cosv/bstream.hxx>
+#include <cosv/openclose.hxx>
+ // COMPONENTS
+#include <stdio.h>
+#include <cosv/string.hxx>
+ // PARAMETERS
+#include <cosv/persist.hxx>
+#include <cosv/ploc.hxx>
+
+
+namespace csv
+{
+
+
+/** @task
+ File is a class representing a file.
+*/
+class File : public bstream,
+ public OpenClose,
+ public ploc::Persistent
+{
+ public:
+ // LIFECYCLE
+ File(
+ const char * i_sLocation,
+ uintt in_nMode = CFM_RW );
+ File(
+ const String & i_sLocation,
+ uintt in_nMode = CFM_RW );
+ virtual ~File();
+
+ // INQUIRY
+ uintt Mode() const;
+
+ private:
+ enum E_LastIO
+ {
+ io_none = 0,
+ io_read,
+ io_write
+ };
+
+ // Interface bistream:
+ virtual uintt do_read(
+ void * out_pDest,
+ uintt i_nNrofBytes);
+ virtual bool inq_eod() const;
+ // Interface bostream:
+ virtual uintt do_write(
+ const void * i_pSrc,
+ uintt i_nNrofBytes);
+ // Interface bstream:
+ virtual uintt do_seek(
+ intt i_nDistance,
+ seek_dir i_eStartPoint = ::csv::beg );
+ virtual uintt inq_position() const;
+ // Interface OpenClose:
+ virtual bool do_open(
+ uintt in_nOpenModeInfo );
+ virtual void do_close();
+ virtual bool inq_is_open() const;
+ // Interface Persistent:
+ virtual const ploc::Path &
+ inq_MyPath() const;
+ // DATA
+ ploc::Path aPath;
+ FILE * pStream;
+
+ uintt nMode; /// RWMode, OpenMode and ShareMode.
+ E_LastIO eLastIO;
+};
+
+
+
+// IMPLEMENTATION
+
+inline uintt
+File::Mode() const
+ { return nMode; }
+
+
+} // namespace csv
+
+
+
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/openclose.hxx b/include/cosv/openclose.hxx
new file mode 100644
index 000000000000..c65ce5b753e2
--- /dev/null
+++ b/include/cosv/openclose.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 CSV_OPENCLOSE_HXX
+#define CSV_OPENCLOSE_HXX
+
+
+namespace csv
+{
+
+// Open modes for storages:
+enum E_RWMode
+{
+ rwDefault = 0x0000, // Keep old settings. If there are none, set default.
+ rwRead = 0x0001, // Reads only
+ rwWrite = 0x0002, // Writes only
+ rwReadWrite = 0x0003 // Reads and writes.
+};
+
+enum E_OpenMode
+{
+ omCreateIfNecessary = 0x0000, // Creates a new file only, if file does not exist.
+ omCreateNot = 0x0010, // Open fails, if file does not exist.
+ omCreate = 0x0020 // Existing file will be deleted.
+};
+enum E_ShareMode
+{
+ shmShareNot = 0x0000, // Allow others nothing
+ shmShareRead = 0x0004, // Allow others to read
+ shmShareAll = 0x000C // Allow others to read and write
+};
+
+/** Constants for filemode combinations
+ These combinations are the only ones, guaranteed to be supported.
+*/
+const UINT32 CFM_RW = rwReadWrite;
+const UINT32 CFM_CREATE =
+ static_cast< UINT32 >(rwReadWrite) | static_cast< UINT32 >(omCreate);
+const UINT32 CFM_READ =
+ static_cast< UINT32 >(rwRead) | static_cast< UINT32 >(omCreateNot) |
+ static_cast< UINT32 >(shmShareRead);
+
+
+
+class OpenClose
+{
+ public:
+ virtual ~OpenClose() {}
+
+ bool open(
+ UINT32 in_nOpenModeInfo = 0 ); /// Combination of values of E_RWMode and E_ShareMode und E_OpenMode. 0 := Keep existing mode.
+ void close();
+
+ bool is_open() const;
+
+ private:
+ virtual bool do_open(
+ UINT32 in_nOpenModeInfo ) = 0;
+ virtual void do_close() = 0;
+ virtual bool inq_is_open() const = 0;
+};
+
+
+
+class OpenCloseGuard
+{
+ public:
+ OpenCloseGuard(
+ OpenClose & i_rOpenClose,
+ UINT32 i_nOpenModeInfo = 0 );
+ ~OpenCloseGuard();
+ operator bool() const;
+
+ private:
+ // Forbidden:
+ OpenCloseGuard(OpenCloseGuard&);
+ OpenCloseGuard & operator=(OpenCloseGuard&);
+
+ // DATA
+ OpenClose & rOpenClose;
+};
+
+
+// IMPLEMENTATION
+
+inline bool
+OpenClose::open( UINT32 i_nOpenModeInfo )
+ { return do_open(i_nOpenModeInfo); }
+inline void
+OpenClose::close()
+ { do_close(); }
+inline bool
+OpenClose::is_open() const
+ { return inq_is_open(); }
+
+inline
+OpenCloseGuard::OpenCloseGuard( OpenClose & i_rOpenClose,
+ UINT32 i_nOpenModeInfo )
+ : rOpenClose(i_rOpenClose)
+ { rOpenClose.open(i_nOpenModeInfo); }
+inline
+OpenCloseGuard::~OpenCloseGuard()
+ { if (rOpenClose.is_open()) rOpenClose.close(); }
+inline
+OpenCloseGuard::operator bool() const
+ { return rOpenClose.is_open(); }
+
+
+
+
+} // namespace csv
+
+
+
+
+
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/persist.hxx b/include/cosv/persist.hxx
new file mode 100644
index 000000000000..13ac4b5dab68
--- /dev/null
+++ b/include/cosv/persist.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 CSV_PERSIST_HXX
+#define CSV_PERSIST_HXX
+
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+#include <cosv/string.hxx>
+ // PARAMETERS
+
+
+namespace csv
+{
+namespace ploc
+{
+
+class Path;
+
+
+inline const char *
+Delimiter()
+{
+#ifdef WNT
+ return "\\";
+#elif defined(UNX)
+ return "/";
+#else
+#error For using csv::ploc there has to be defined: WNT or UNX.
+#endif
+}
+
+
+
+class Persistent
+{
+ public:
+ virtual ~Persistent() {}
+
+ const Path & MyPath() const;
+ /// @return all paths without completing delimiter, even directories.
+ const char * StrPath() const;
+ bool Exists() const;
+
+ protected:
+ Persistent();
+ void InvalidatePath();
+
+ private:
+ virtual const Path &
+ inq_MyPath() const = 0;
+ // DATA
+ mutable StreamStr sPath;
+};
+
+
+
+// IMPLEMENTATION
+
+inline
+Persistent::Persistent()
+ : sPath(30) { }
+inline const Path &
+Persistent::MyPath() const
+ { return inq_MyPath(); }
+inline void
+Persistent::InvalidatePath()
+ { sPath.clear(); }
+
+
+
+} // namespace csv
+} // namespace ploc
+
+
+#endif
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/ploc.hxx b/include/cosv/ploc.hxx
new file mode 100644
index 000000000000..81f952de5223
--- /dev/null
+++ b/include/cosv/ploc.hxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CSV_PLOC_HXX
+#define CSV_PLOC_HXX
+
+// USED SERVICES
+#include <cosv/string.hxx>
+#include <cosv/plocroot.hxx>
+#include <cosv/dirchain.hxx>
+#include <cosv/tpl/dyn.hxx>
+#include <cosv/csv_ostream.hxx>
+
+
+
+
+namespace csv
+{
+ class bostream;
+
+namespace ploc
+{
+ class Root;
+
+
+/** Represents a path in the file system.
+
+ The path can be relative or absolute and in Unix- or Windows-syntax.
+*/
+class Path
+{
+ public:
+
+ // LIFECYCLE
+ explicit Path(
+ const char * i_sPath = ".", /// Dirs have to be ended with a '\\ or '/'.
+ bool i_bPathIsAlwaysDir = false, /// This overrides a missing Delimiter at the end of the i_sPath, if true.
+ const char * i_sDelimiter = Delimiter() );
+ Path(
+ const Path & i_rPath );
+ ~Path();
+ // OPERATORS
+ Path & operator=(
+ const Path & i_rPath );
+ // OPERATIONS
+ void Set(
+ const char * i_sPath,
+ bool i_bPathIsAlwaysDir = false,
+ const char * i_sDelimiter = Delimiter() );
+ void SetFile( // If there is already a file, that is exchanged.
+ const String & i_sName );
+ // INQUIRY
+ const Root & RootDir() const { return *pRoot; }
+ const DirectoryChain &
+ DirChain() const { return aPath; }
+ const String & File() const { return sFile; }
+ bool IsValid() const;
+ bool IsDirectory() const { return sFile.length() == 0; }
+ bool IsFile() const { return sFile.length() > 0; }
+
+ /// Directories have a delimiter at the end, files not.
+ void Get(
+ bostream & o_rPath ) const;
+ // ACCESS
+ DirectoryChain & DirChain() { return aPath; }
+
+ private:
+ Dyn<Root> pRoot;
+ DirectoryChain aPath;
+ String sFile;
+};
+
+
+
+
+} // namespace ploc
+} // namespace csv
+
+/// Directories produce a delimiter at the end, files not.
+inline csv::bostream &
+operator<<( csv::bostream & o_rOut,
+ const csv::ploc::Path & i_rPath )
+{
+ i_rPath.Get(o_rOut);
+ return o_rOut;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/ploc_dir.hxx b/include/cosv/ploc_dir.hxx
new file mode 100644
index 000000000000..e6c8f04538f2
--- /dev/null
+++ b/include/cosv/ploc_dir.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 CSV_PLOCDIR_HXX
+#define CSV_PLOCDIR_HXX
+
+
+// USED SERVICES
+ // BASE CLASSES
+#include <cosv/persist.hxx>
+ // COMPONENTS
+#include <cosv/ploc.hxx>
+ // PARAMETERS
+
+namespace csv
+{
+namespace ploc
+{
+
+class DirectoryChain;
+
+enum E_Recursivity
+{
+ flat,
+ recursive
+};
+
+class Directory : public Persistent
+{
+ public:
+ // LIFECYCLE
+ Directory();
+ Directory(
+ const Path & i_rLocation );
+ Directory(
+ const char * i_rLocation );
+ Directory(
+ const Directory & i_rDir );
+ virtual ~Directory();
+
+ // OPERATORS
+ Directory & operator+=(
+ const String & i_sName );
+ Directory & operator+=(
+ const DirectoryChain &
+ i_sDirChain );
+ Directory & operator-=(
+ uintt i_nLevels );
+
+ // OPERATIONS
+ bool PhysicalCreate(
+ bool i_bCreateParentsIfNecessary = true ) const;
+
+ // INQUIRY
+ void GetContainedDirectories(
+ StringVector & o_rResult ) const;
+ /** @param i_sFilter
+ Currently only filters of the form "*.ending" or "*.*"
+ (the default) are processed correctly under UNIX. Under WNT this
+ restriction does not apply.
+ */
+ void GetContainedFiles(
+ StringVector & o_rResult,
+ const char * i_sFilter = "*.*",
+ E_Recursivity i_eRecursivity = flat ) const;
+ private:
+ // Interface Peristent:
+ virtual const Path &
+ inq_MyPath() const;
+
+ // Locals:
+ /** @return
+ true, if parent(!) directory exists or could be created.
+ false, if this is a root directory.
+ */
+ bool Check_Parent() const;
+ bool PhysicalCreate_Dir(
+ const char * i_sStr ) const;
+ // DATA
+ Path aPath;
+};
+
+
+
+} // namespace ploc
+} // namespace csv
+
+
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/plocroot.hxx b/include/cosv/plocroot.hxx
new file mode 100644
index 000000000000..b079f04b1b9f
--- /dev/null
+++ b/include/cosv/plocroot.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 CSV_PLOCROOT_HXX
+#define CSV_PLOCROOT_HXX
+
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+#include <cosv/string.hxx>
+ // PARAMETERS
+#include <cosv/csv_ostream.hxx>
+#include <cosv/persist.hxx>
+
+
+namespace csv
+{
+
+class bostream;
+
+
+namespace ploc
+{
+
+
+class Root
+{
+ public:
+ virtual ~Root();
+
+ static DYN Root * Create_(
+ const char * & o_sPathAfterRoot,
+ const char * i_sPath,
+ const char * i_sDelimiter = Delimiter() );
+
+ virtual void Get( /// Does not add a '\0' at the end,
+ ostream & o_rPath ) const = 0;
+ virtual void Get( /// Does not add a '\0' at the end.
+ bostream & so_rPath ) const = 0;
+ virtual DYN Root * CreateCopy() const = 0;
+ virtual const char *
+ OwnDelimiter() const = 0;
+};
+
+
+
+} // namespace ploc
+} // namespace csv
+
+
+
+#endif
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/std_outp.hxx b/include/cosv/std_outp.hxx
new file mode 100644
index 000000000000..08fe179e16ab
--- /dev/null
+++ b/include/cosv/std_outp.hxx
@@ -0,0 +1,123 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CSV_STD_OUTP_HXX
+#define CSV_STD_OUTP_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+#include <cosv/csv_ostream.hxx>
+ // PARAMETERS
+
+
+
+
+namespace csv
+{
+
+#ifdef CSV_NO_IOSTREAMS
+class redirect_out : public ostream
+{
+ public:
+ virtual ~redirect_out() {}
+
+ static void set_(
+ redirect_out & o_rStdOut,
+ redirect_out & o_rStdErr )
+ { pStdOut_ = &o_rStdOut;
+ pStdErr_ = &o_rStdErr; }
+
+ static redirect_out &
+ std_() { return *pStdOut_; }
+ static redirect_out &
+ err_() { return *pStdErr_; }
+ static bool useme_() { return pStdOut_ != 0; }
+
+ private:
+ // DATA
+ static redirect_out *
+ pStdOut_;
+ static redirect_out *
+ pStdErr_;
+};
+#endif // defined(CSV_NO_IOSTREAMS)
+
+
+inline ostream &
+Cout()
+{
+
+#ifndef CSV_NO_IOSTREAMS
+// return redirect_out::useme_()
+// ? (ostream&)( redirect_out::std_() )
+// : (ostream&)( std::cout );
+ return (ostream&)( std::cout );
+#else
+ csv_assert( redirect_out::useme_() );
+ return redirect_out::std_();
+#endif
+}
+
+inline ostream &
+Cerr()
+{
+#ifndef CSV_NO_IOSTREAMS
+// return redirect_out::useme_()
+// ? (ostream&)( redirect_out::err_() )
+// : (ostream&)( std::cerr );
+ return (ostream&)( std::cerr );
+#else
+ csv_assert( redirect_out::useme_() );
+ return redirect_out::err_();
+#endif
+}
+
+
+
+typedef void (*F_FLUSHING_FUNC)(ostream&);
+
+void Endl( ostream& );
+
+void Flush( ostream& );
+
+
+} // namespace csv
+
+
+
+inline csv::ostream &
+operator<<( csv::ostream & io_rStream,
+ csv::F_FLUSHING_FUNC i_fFlushingFunc )
+{
+#ifndef CSV_NO_IOSTREAMS
+// (*i_fFlushingFunc)( io_rStream, csv::redirect_out::useme_(), 0 );
+ (*i_fFlushingFunc)( io_rStream );
+#else
+ csv_assert( csv::redirect_out::useme_() );
+ (*i_fFlushingFunc)( io_rStream, true, 0 );
+#endif
+ return io_rStream;
+}
+
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/str_types.hxx b/include/cosv/str_types.hxx
new file mode 100644
index 000000000000..ecf9c997c271
--- /dev/null
+++ b/include/cosv/str_types.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 COSV_STR_TYPES_HXX
+#define COSV_STR_TYPES_HXX
+
+
+namespace csv
+{
+
+/** Provides some generally used constants.
+*/
+struct str
+{
+ public:
+ typedef ::size_t position;
+ typedef ::size_t size;
+
+ static const position npos = -1;
+ static const size maxsize = -1;
+
+ enum insert_mode
+ {
+ overwrite = 0,
+ insert = 1
+ };
+};
+
+
+/** Is used for string comparisons.
+
+ @collab String
+ @collab various csv::compare(...) functions
+*/
+class CharOrder_Table
+{
+ public:
+ /** @precond
+ Parameter i_pCharWeightsArray
+ must have size of 256.
+ */
+ CharOrder_Table(
+ const int * i_pCharWeightsArray );
+
+ /** @return the weight of the char i_c.
+ @precond
+ Even with unusual implementations, where char has more than 8 bit,
+ there must be true: 0 <= i_c < 256.
+ */
+ int operator()(
+ char i_c ) const;
+ private:
+ int cWeights[256];
+};
+
+
+// IMPLEMENTATION
+
+inline int
+CharOrder_Table::operator()( char i_c ) const
+ { return cWeights[ UINT8(i_c) ]; }
+
+
+
+} // namespace csv
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/streamstr.hxx b/include/cosv/streamstr.hxx
new file mode 100644
index 000000000000..ec13f8ec63c6
--- /dev/null
+++ b/include/cosv/streamstr.hxx
@@ -0,0 +1,310 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CSV_STREAMSTR_HXX
+#define CSV_STREAMSTR_HXX
+
+#include "sal/config.h"
+
+#include "sal/types.h"
+
+// BASE CLASSES
+#include <cosv/bstream.hxx>
+// USED SERVICES
+#include <cosv/str_types.hxx>
+#include <string.h>
+
+
+
+
+namespace csv
+{
+ class String;
+
+
+void c_str(); // Dummy needed for StreamStr::operator<<(StreamStr::F_CSTR);
+
+
+/** A string buffer class for all kinds of string manipulation.
+*/
+class StreamStr : public bostream
+{
+ public:
+ typedef StreamStr self;
+
+ typedef str::size size_type;
+ typedef str::position position_type;
+ typedef intt seek_type;
+ typedef str::insert_mode insert_mode;
+
+ typedef const char * const_iterator;
+ typedef char * iterator;
+
+ typedef void (*F_CSTR)();
+
+
+ /** Represents an area within a string.
+ */
+ struct Area
+ {
+ typedef str::size size_type;
+
+ Area(
+ const char * i_str = "",
+ size_type i_nLength = str::maxsize )
+ : sStr(i_str),
+ nLength( i_nLength == str::maxsize
+ ? strlen(i_str)
+ : i_nLength ) {}
+ const char * sStr;
+ size_type nLength;
+ };
+
+ // LIFECYCLE
+ StreamStr(
+ size_type i_nCapacity );
+ /// Copies also insert_mode and current position.
+ StreamStr(
+ const self & i_rOther );
+ ~StreamStr();
+
+ // OPERATORS
+ /// Copies also insert_mode and current position.
+ self & operator=(
+ const self & i_rOther );
+
+ self & operator<<(
+ const char * i_s );
+ self & operator<<(
+ const String & i_s );
+ self & operator<<(
+ char i_c );
+ self & operator<<(
+ unsigned char i_c );
+ self & operator<<(
+ signed char i_c );
+
+ self & operator<<(
+ short i_n );
+ self & operator<<(
+ unsigned short i_n );
+ self & operator<<(
+ int i_n );
+ self & operator<<(
+ unsigned int i_n );
+ self & operator<<(
+ long i_n );
+ self & operator<<(
+ unsigned long i_n );
+
+ self & operator<<(
+ float i_n );
+ self & operator<<(
+ double i_n );
+
+ /** This operator is used to finish a sequence of streaming
+ oeprators by returning the c-string of the complete string.
+
+ @return The same as ->c_str().
+
+ @example
+ csv::StreamStr s(100);
+ const char *
+ fullname = s << qualifier() << "::" << name() << csv::c_str;
+ */
+ const char * operator<<(
+ F_CSTR i_f );
+
+ const char & operator[](
+ position_type i_nPosition ) const;
+ char & operator[](
+ position_type i_nPosition );
+
+ // OPERATIONS
+ void resize(
+ size_type i_nMinimumCapacity );
+
+ void clear();
+
+ /** Sets start point for the next operator<<() call.
+ if the intended position is not reachable, nothing happens.
+ */
+ self & seekp(
+ seek_type i_nCount,
+ seek_dir i_eDirection = ::csv::beg );
+ self & reset() { return seekp(0); }
+ /** Sets the insertion mode of all and only the operator<<() calls.
+
+ Default is str::overwrite:
+ str::overwrite: seekp() always sets the cur end of the string.
+ operator<<() calls push the end of the string forward.
+ str::insert: seekp() only sets the insertion point.
+ operator<<() calls insert their text at the tellp()
+ position and keep the rest of the string. tellp() is
+ then after the inserted text, on the beginning of the
+ rest of the string.
+ */
+ self & set_insert_mode(
+ insert_mode i_eMode );
+
+ void pop_front(
+ size_type i_nCount );
+ void pop_back(
+ size_type i_nCount );
+
+ /// Works like operator<<(). Does the same as Perl's join().
+ self & operator_join(
+ std::vector<String>::const_iterator
+ i_rBegin,
+ std::vector<String>::const_iterator
+ i_rEnd,
+ const char * i_sLink );
+ /// Works like operator<<()
+ self & operator_add_substr(
+ const char * i_sText,
+ size_type i_nLength );
+ /// Works like operator<<()
+ self & operator_add_token(
+ const char * i_sText,
+ char i_cDelimiter );
+ /// Works like operator<<()
+ self & operator_read_line(
+ bstream & i_src );
+
+ void strip_front_whitespace(); /// removes space, tab and crlf.
+ void strip_back_whitespace();
+ void strip_frontback_whitespace();
+
+ void replace_all(
+ char i_cCarToSearch,
+ char i_cReplacement );
+
+ // INQUIRY
+ const char * c_str() const;
+ const char * data() const;
+
+ bool empty() const;
+ size_type size() const;
+ size_type length() const;
+
+ size_type capacity() const;
+
+ position_type tellp() const;
+
+ const_iterator begin() const;
+ const_iterator cur() const;
+ const_iterator end() const;
+
+ // ACCESS
+ iterator begin();
+ iterator cur();
+ iterator end();
+
+ private:
+ // Interface bostream
+ virtual UINT32 do_write(
+ const void * i_pSrc,
+ UINT32 i_nNrofBytes);
+ // Locals
+ void ProvideAddingSize(
+ size_type i_nSize2Add );
+ /// Resizes with the factor 2.0 (under 128), 1.5 or until i_nMinimumCapacity, whatever is bigger.
+ void Resize(
+ size_type i_nMinimumCapacity = 0 );
+ void Advance(
+ size_type i_nAddedSize );
+ void MoveData(
+ char * i_pStart,
+ char * i_pEnd,
+ seek_type i_nDiff );
+ // DATA
+ size_type nCapacity1; /// Capacity of characters to contain + 1 for terminating 0.
+ DYN char * dpData;
+ char * pEnd;
+ char * pCur;
+ insert_mode eMode;
+};
+
+
+
+class StreamStrLock
+{
+ public:
+ StreamStrLock(
+ uintt i_nMinimalSize );
+ ~StreamStrLock();
+
+ StreamStr & operator()() { return *pStr; }
+
+ private:
+ StreamStr * pStr;
+};
+
+// IMPLEMENTATION
+
+inline const char *
+StreamStr::operator<<( SAL_UNUSED_PARAMETER F_CSTR )
+ { return dpData; }
+inline void
+StreamStr::clear()
+ { pEnd = pCur = dpData; *pEnd = '\0'; }
+inline const char *
+StreamStr::c_str() const
+ { return dpData; }
+inline const char *
+StreamStr::data() const
+ { return dpData; }
+inline bool
+StreamStr::empty() const
+ { return dpData == pEnd; }
+inline StreamStr::size_type
+StreamStr::size() const
+ { return pEnd - dpData; }
+inline StreamStr::size_type
+StreamStr::length() const
+ { return size(); }
+inline StreamStr::size_type
+StreamStr::capacity() const
+ { return nCapacity1-1; }
+inline StreamStr::position_type
+StreamStr::tellp() const
+ { return size_type(pCur-dpData); }
+inline StreamStr::const_iterator
+StreamStr::begin() const
+ { return dpData; }
+inline StreamStr::const_iterator
+StreamStr::cur() const
+ { return pCur; }
+inline StreamStr::const_iterator
+StreamStr::end() const
+ { return pEnd; }
+inline StreamStr::iterator
+StreamStr::begin()
+ { return dpData; }
+inline StreamStr::iterator
+StreamStr::cur()
+ { return pCur; }
+inline StreamStr::iterator
+StreamStr::end()
+ { return pEnd; }
+
+} // namespace csv
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/string.hxx b/include/cosv/string.hxx
new file mode 100644
index 000000000000..756aa9a1492c
--- /dev/null
+++ b/include/cosv/string.hxx
@@ -0,0 +1,501 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COSV_STRING_HXX
+#define COSV_STRING_HXX
+
+// USED SERVICES
+#include <string.h>
+#include <cosv/stringdata.hxx>
+#include <cosv/str_types.hxx>
+#include <cosv/csv_ostream.hxx>
+#include <vector>
+
+
+
+
+namespace csv
+{
+
+
+/** The Simple String:
+ It is used to just hold short to middle long texts as
+ data, which are constant at most times. They are reference
+ counted, so they are space efficient and have constant time
+ copy semantics.
+
+ For all compare() functions the return value is like in strcmp().
+
+ @attention
+ The present version of this class is NOT thread safe.
+*/
+
+
+class String
+{
+ public:
+ typedef String self;
+
+ typedef str::size size_type;
+ typedef str::position position_type;
+
+ typedef const char * const_iterator;
+
+ // LIFECYCLE
+ String();
+
+ /// Intentionally not explicit, smooth casting is intended.
+ String(
+ const char * i_str );
+ /// @precond i_nLength <= strlen(i_str) or i_nLength == str::maxsize.
+ String(
+ const char * i_str,
+ size_type i_nLength );
+
+ /** @precond i_itBegin and i_itEnd are in the same valid
+ memory-area, such that zero to finite times repetition of
+ ++i_itBegin leads to i_itBegin == i_itEnd.
+ */
+ String(
+ const_iterator i_itBegin,
+ const_iterator i_itEnd );
+
+ String(
+ const self & i_rStr );
+
+ ~String();
+ // OPERATORS
+ self & operator=(
+ const self & i_rStr );
+ self & operator=(
+ const char * i_str );
+
+ operator const char * () const;
+
+ bool operator==(
+ const self & i_rStr ) const;
+ bool operator!=(
+ const self & i_rStr ) const;
+ bool operator<(
+ const self & i_rStr ) const;
+ bool operator>(
+ const self & i_rStr ) const;
+ bool operator<=(
+ const self & i_rStr ) const;
+ bool operator>=(
+ const self & i_rStr ) const;
+
+ // OPERATIONS
+ void clear();
+
+ /// @precond i_nLength == str::maxsize OR i_nLength < strlen(i_str) .
+ void assign(
+ const char * i_str,
+ size_type i_nLength );
+ /// Create a string consisting of a sequence of i_nCount times the same char.
+ void assign(
+ size_type i_nCount,
+ char i_c );
+
+ // INQUIRY
+ const char * c_str() const;
+ const char * data() const;
+
+ bool empty() const;
+ size_type size() const;
+ size_type length() const;
+
+ const char & char_at(
+ position_type i_nPosition ) const;
+
+ const_iterator begin() const;
+
+ /// This is inefficient, so shouldn't be used within loops.
+ const_iterator end() const;
+
+ int compare(
+ const self & i_rStr ) const;
+ int compare(
+ const CharOrder_Table &
+ i_rOrder,
+ const self & i_rStr ) const;
+
+//*********** Not yet implemented *********************//
+ position_type rfind(
+ const char * i_strToSearch,
+ position_type i_nSearchStartPosition = str::npos ) const;
+ position_type rfind(
+ char i_charToSearch,
+ position_type i_nSearchStartPosition = str::npos ) const;
+
+ position_type find_first_not_of(
+ const char * i_strToSearch,
+ position_type i_nSearchStartPosition = 0 ) const;
+ position_type find_first_not_of(
+ char i_charToSearch,
+ position_type i_nSearchStartPosition = 0 ) const;
+
+ position_type find_last_not_of(
+ const char * i_strToSearch,
+ position_type i_nSearchStartPosition = str::npos ) const;
+ position_type find_last_not_of(
+ char i_charToSearch,
+ position_type i_nSearchStartPosition = str::npos ) const;
+//*********** end - not yet implemented *****************//
+
+ static const self & Null_();
+ static const char & Nulch_();
+
+ private:
+ struct S_Data
+ {
+ S_Data();
+ /// @precond i_nValidLength <= strlen(i_sData) or i_nValidLength == str::maxsize.
+ explicit S_Data(
+ const char * i_sData,
+ size_type i_nValidLength = str::maxsize );
+ ~S_Data();
+
+ const S_Data * Acquire() const;
+
+ /// Deletes this, if nCount becomes 0.
+ void Release() const;
+
+ StringData<char> aStr;
+ mutable UINT32 nCount;
+
+ private:
+ // Forbidden functions, because this is a refcounted structure.
+ S_Data(const S_Data&);
+ S_Data & operator=(const S_Data&);
+ };
+
+ // Locals
+ const StringData<char> &
+ Str() const;
+
+ // DATA
+ const S_Data * pd;
+};
+
+
+//********** Global compare functions ***************//
+
+ //*** Natural order, no substrings
+
+inline int compare(
+ const String & i_s1,
+ const String & i_s2 );
+inline int compare(
+ const String & i_s1,
+ const char * i_s2 );
+inline int compare(
+ const char * i_s1,
+ const String & i_s2 );
+inline int compare(
+ const char * i_s1,
+ const char * i_s2 );
+
+ //*** Natural order, substrings
+
+int compare(
+ const String & i_s1,
+ csv::str::position i_nStartPosition1,
+ const char * i_s2,
+ csv::str::size i_nLength );
+inline int compare(
+ const char * i_s1,
+ const char * i_s2,
+ csv::str::size i_nLength );
+
+ //*** Defined order, no substrings
+
+inline int compare(
+ const CharOrder_Table & i_rOrder,
+ const String & i_s1,
+ const char * i_s2 );
+inline int compare(
+ const CharOrder_Table & i_rOrder,
+ const char * i_s1,
+ const String & i_s2 );
+int compare(
+ const CharOrder_Table & i_rOrder,
+ const char * i_s1,
+ const char * i_s2 );
+} // namespace csv
+
+
+
+
+//****************** global comparation operators *********************//
+
+inline bool operator==(
+ const csv::String & i_s1,
+ const char * i_s2 );
+inline bool operator!=(
+ const csv::String & i_s1,
+ const char * i_s2 );
+inline bool operator<(
+ const csv::String & i_s1,
+ const char * i_s2 );
+inline bool operator>(
+ const csv::String & i_s1,
+ const char * i_s2 );
+inline bool operator<=(
+ const csv::String & i_s1,
+ const char * i_s2 );
+inline bool operator>=(
+ const csv::String & i_s1,
+ const char * i_s2 );
+
+inline bool operator==(
+ const char * i_s1,
+ const csv::String & i_s2 );
+inline bool operator!=(
+ const char * i_s1,
+ const csv::String & i_s2 );
+inline bool operator<(
+ const char * i_s1,
+ const csv::String & i_s2 );
+inline bool operator>(
+ const char * i_s1,
+ const csv::String & i_s2 );
+inline bool operator<=(
+ const char * i_s1,
+ const csv::String & i_s2 );
+inline bool operator>=(
+ const char * i_s1,
+ const csv::String & i_s2 );
+
+
+//****************** global stream operators *********************//
+
+
+inline csv::ostream &
+operator<<( csv::ostream & o_rOut,
+ const csv::String & i_rSrc );
+
+
+
+
+// IMPLEMENTATION
+namespace csv
+{
+
+
+inline const StringData<char> &
+String::Str() const
+{ return pd->aStr; }
+
+
+inline const char &
+String::char_at( position_type i_nPosition ) const
+{ if ( i_nPosition < Str().Size() )
+ return Str().Data()[i_nPosition];
+ return Nulch_();
+}
+
+inline bool
+String::operator==( const self & i_rStr ) const
+{ return compare(i_rStr) == 0; }
+
+inline bool
+String::operator!=( const self & i_rStr ) const
+{ return compare(i_rStr) != 0; }
+
+inline bool
+String::operator<( const self & i_rStr ) const
+{ return compare(i_rStr) < 0; }
+
+inline bool
+String::operator>( const self & i_rStr ) const
+{ return compare(i_rStr) > 0; }
+
+inline bool
+String::operator<=( const self & i_rStr ) const
+{ return compare(i_rStr) <= 0; }
+
+inline bool
+String::operator>=( const self & i_rStr ) const
+{ return compare(i_rStr) >= 0; }
+
+inline void
+String::clear()
+{ operator=( String::Null_() ); }
+
+inline const char *
+String::c_str() const
+{ return Str().Data(); }
+
+inline
+String::operator const char * () const
+{ return c_str(); }
+
+inline const char *
+String::data() const
+{ return c_str(); }
+
+inline String::size_type
+String::size() const
+{ return Str().Size(); }
+
+inline bool
+String::empty() const
+{ return size() == 0; }
+
+inline String::size_type
+String::length() const
+{ return size(); }
+
+inline String::const_iterator
+String::begin() const
+{ return data(); }
+
+inline String::const_iterator
+String::end() const
+{ return data() + size(); }
+
+
+
+//****************** global compare-functions ********************//
+inline int
+compare( const String & i_s1,
+ const String & i_s2 )
+{ return i_s1.compare(i_s2); }
+
+inline int
+compare( const String & i_s1,
+ const char * i_s2 )
+{ return strcmp(i_s1.c_str(), i_s2); }
+
+inline int
+compare( const char * i_s1,
+ const String & i_s2 )
+{ return strcmp(i_s1, i_s2.c_str()); }
+
+inline int
+compare( const char * i_s1,
+ const char * i_s2 )
+{ return strcmp(i_s1, i_s2); }
+
+inline int
+compare( const char * i_s1,
+ const char * i_s2,
+ str::size i_nLength )
+{ return strncmp( i_s1, i_s2, i_nLength ); }
+
+inline int
+compare( const CharOrder_Table & i_rOrder,
+ const String & i_s1,
+ const char * i_s2 )
+{ return compare( i_rOrder, i_s1.c_str(), i_s2 ); }
+
+inline int
+compare( const CharOrder_Table & i_rOrder,
+ const char * i_s1,
+ const String & i_s2 )
+{ return compare( i_rOrder, i_s1, i_s2.c_str() ); }
+
+
+} // namespace csv
+
+
+inline bool
+operator==( const csv::String & i_s1,
+ const char * i_s2 )
+{ return csv::compare( i_s1, i_s2 ) == 0; }
+
+inline bool
+operator!=( const csv::String & i_s1,
+ const char * i_s2 )
+{ return csv::compare( i_s1, i_s2 ) != 0; }
+
+inline bool
+operator<( const csv::String & i_s1,
+ const char * i_s2 )
+{ return csv::compare( i_s1, i_s2 ) < 0; }
+
+inline bool
+operator>( const csv::String & i_s1,
+ const char * i_s2 )
+{ return csv::compare( i_s1, i_s2 ) > 0; }
+
+inline bool
+operator<=( const csv::String & i_s1,
+ const char * i_s2 )
+{ return csv::compare( i_s1, i_s2 ) <= 0; }
+
+inline bool
+operator>=( const csv::String & i_s1,
+ const char * i_s2 )
+{ return csv::compare( i_s1, i_s2 ) >= 0; }
+
+
+inline bool
+operator==( const char * i_s1,
+ const csv::String & i_s2 )
+{ return csv::compare( i_s1, i_s2 ) == 0; }
+
+inline bool
+operator!=( const char * i_s1,
+ const csv::String & i_s2 )
+{ return csv::compare( i_s1, i_s2 ) != 0; }
+
+inline bool
+operator<( const char * i_s1,
+ const csv::String & i_s2 )
+{ return csv::compare( i_s1, i_s2 ) < 0; }
+
+inline bool
+operator>( const char * i_s1,
+ const csv::String & i_s2 )
+{ return csv::compare( i_s1, i_s2 ) > 0; }
+
+inline bool
+operator<=( const char * i_s1,
+ const csv::String & i_s2 )
+{ return csv::compare( i_s1, i_s2 ) <= 0; }
+
+inline bool
+operator>=( const char * i_s1,
+ const csv::String & i_s2 )
+{ return csv::compare( i_s1, i_s2 ) >= 0; }
+
+
+ //************ global stream operators **************//
+
+
+inline csv::ostream &
+operator<<( csv::ostream & o_rOut,
+ const csv::String & i_rSrc )
+ { o_rOut << i_rSrc.c_str(); return o_rOut; }
+
+
+//****************** typedefs *********************//
+
+namespace csv
+{
+
+typedef std::vector<String> StringVector;
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/stringdata.hxx b/include/cosv/stringdata.hxx
new file mode 100644
index 000000000000..0187cb4265a9
--- /dev/null
+++ b/include/cosv/stringdata.hxx
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef COSV_STRINGDATA_HXX
+#define COSV_STRINGDATA_HXX
+
+
+#include <cosv/str_types.hxx>
+
+
+
+namespace csv
+{
+
+/** @tpl CHAR
+ The expression CHAR(0) has to be valid.
+*/
+template <class CHAR>
+class StringData
+{
+ public:
+ typedef StringData self;
+
+ typedef str::size size_type;
+ typedef str::position position_type;
+
+ // LIFECYCLE
+ StringData();
+ /** @precond i_pData != 0
+ @precond i_nValidLength <= strlen(i_pData)
+ */
+ StringData(
+ const CHAR * i_pData,
+ size_type i_nValidLength );
+ ~StringData();
+ // OPERATORS
+
+ // OPERATIONS
+
+ // INQUIRY
+ const CHAR * Data() const;
+
+ /** @returns the allocated number of CHAR.
+ This may be different from the number of bytes.
+ There is actually allocated one more CHAR,
+ which is guaranteed to be CHAR(0) in all circumstances.
+ */
+ size_type Size() const;
+
+ private:
+ /* Because this is used only within a refcounted structure,
+ these functions are forbidden - at least yet.
+ */
+ StringData(const self&);
+ self & operator=(const self&);
+
+ // DATA
+ DYN CHAR * dpData;
+ size_type nSize; /// The allocated size - 1 (for the finishing 0).
+};
+
+
+
+// IMPLEMENTATION
+
+template <class CHAR>
+StringData<CHAR>::StringData()
+ : dpData( new CHAR[1] ),
+ nSize(0)
+{
+ *dpData = CHAR(0);
+}
+
+template <class CHAR>
+StringData<CHAR>::StringData( const CHAR * i_pData,
+ size_type i_nValidLength )
+ : dpData( new CHAR[i_nValidLength + 1] ),
+ nSize(i_nValidLength)
+{
+ memcpy( dpData, i_pData, i_nValidLength * sizeof(CHAR) );
+ dpData[nSize] = CHAR(0);
+}
+
+template <class CHAR>
+StringData<CHAR>::~StringData()
+{
+ delete [] dpData;
+}
+
+template <class CHAR>
+const CHAR *
+StringData<CHAR>::Data() const
+{
+ return dpData;
+}
+
+template <class CHAR>
+typename StringData<CHAR>::size_type
+StringData<CHAR>::Size() const
+{
+ return nSize;
+}
+
+
+
+} // namespace csv
+
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/tpl/dyn.hxx b/include/cosv/tpl/dyn.hxx
new file mode 100644
index 000000000000..46095c6c3b7c
--- /dev/null
+++ b/include/cosv/tpl/dyn.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 CSV_DYN_HXX
+#define CSV_DYN_HXX
+
+
+
+
+namespace csv
+{
+
+
+/** Dyn owns an object on the heap, which will be automatically
+ deleted in its D'tor.
+
+ Dyn's main purpose is for class members on the heap:
+ You can't forget to delete them in the D'tor. Constness will be transfered
+ to the hold object.
+
+ Dyn forbids the CopyC'tor and operator=(). So you can't incidentally
+ run into problems with compiler defined CopyC'tor or operator=() of the
+ owning class. If you need those, you have to define them explicitly - as
+ you should do anyway with all classes, that own members on the heap.
+
+ Dyn also works with incomplete types.
+ You only need to write
+ class DX;
+ but needn't include #include <DX>.hxx.
+ This is a difference to std::auto_ptr, where it is not absolutely clear
+ if it is allowed to use it with incomplete types.
+
+ You can also use Dyn within function bodies, to make them exception safe.
+
+ @attention
+ If you use Dyn with an incomplete type, the owning class needs to
+ define a non-inline D'tor. Else the compiler will complain.
+*/
+template <class DX>
+class Dyn
+{
+ public:
+ // LIFECYCLE
+ /// From now on, let_dpObject is owned by this Dyn-object.
+ explicit Dyn(
+ DX * let_dpObject = 0);
+ ~Dyn();
+ // OPERATORS
+ /** This deletes a prevoiusly existing dpObject!
+ From now on, let_dpObject is owned by this Dyn-object.
+ */
+ Dyn<DX> & operator=(
+ DX * let_dpObject);
+ /// @return true, if any valid object is hold, false else.
+ operator bool() const;
+
+ const DX * operator->() const;
+ DX * operator->();
+
+ const DX & operator*() const;
+ DX & operator*();
+
+ // OPERATIONS
+ /** @return The hold object on the heap.
+
+ @ATTENTION
+ The caller of the function is responsible to delete
+ the returned object
+
+ @postcond
+ this->dpObject == 0.
+ */
+ DX * Release();
+
+ // INQUIRY
+ /// Shorthand for operator->(), if implicit overloading of -> can not be used.
+ const DX * Ptr() const;
+
+ // ACCESS
+ /// Shorthand for operator->(), if implicit overloading of -> can not be used.
+ DX * Ptr();
+ /// So const objects can return mutable pointers to the owned object.
+ DX * MutablePtr() const;
+
+ private:
+ /* Does NOT set dpObject to zero! Because it is only used
+ internally in situations where dpObject is set immediately
+ after.
+ */
+ void Delete();
+
+ /** Forbidden function!
+ -------------------
+ Help ensure, that classes with
+ dynamic pointers use a selfdefined copy constructor
+ and operator=(). If the default versions of these
+ functions are used, the compiler will throw an error.
+ **/
+ Dyn( const Dyn<DX> & );
+ /** Forbidden function!
+ -------------------
+ Help ensure, that classes with
+ dynamic pointers use a selfdefined copy constructor
+ and operator=(). If the default versions of these
+ functions are used, the compiler will throw an error.
+ **/
+ Dyn<DX> & operator=( const Dyn<DX> & );
+
+ // DATA
+ /// An owned heap object. Needs to be deleted by this class.
+ DX * dpObject;
+};
+
+
+
+
+// IMPLEMENTATION
+template <class DX>
+void
+Dyn<DX>::Delete()
+{
+ if (dpObject != 0)
+ delete dpObject;
+}
+
+template <class DX>
+inline
+Dyn<DX>::Dyn( DX * let_dpObject )
+ : dpObject(let_dpObject) {}
+
+template <class DX>
+inline
+Dyn<DX>::~Dyn()
+{ Delete(); }
+
+
+template <class DX>
+inline Dyn<DX> &
+Dyn<DX>::operator=( DX * let_dpObject )
+{
+ if ( dpObject == let_dpObject )
+ return *this;
+
+ Delete();
+ dpObject = let_dpObject;
+ return *this;
+}
+
+template <class DX>
+inline
+Dyn<DX>::operator bool() const
+{ return dpObject != 0; }
+
+template <class DX>
+inline
+const DX *
+Dyn<DX>::operator->() const
+{ return dpObject; }
+
+template <class DX>
+inline DX *
+Dyn<DX>::operator->()
+{ return dpObject; }
+
+template <class DX>
+inline const DX &
+Dyn<DX>::operator*() const
+{ csv_assert(dpObject != 0);
+ return *dpObject;
+}
+
+template <class DX>
+inline DX &
+Dyn<DX>::operator*()
+{ csv_assert(dpObject != 0);
+ return *dpObject;
+}
+
+template <class DX>
+inline DX *
+Dyn<DX>::Release()
+{ DX * ret = dpObject;
+ dpObject = 0;
+ return ret;
+}
+
+template <class DX>
+inline const DX *
+Dyn<DX>::Ptr() const
+{ return dpObject; }
+
+template <class DX>
+inline DX *
+Dyn<DX>::Ptr()
+{ return dpObject; }
+
+template <class DX>
+inline DX *
+Dyn<DX>::MutablePtr() const
+{ return dpObject; }
+
+} // namespace csv
+
+
+
+
+#ifndef CSV_HIDE_DYN
+#define Dyn ::csv::Dyn
+#endif
+
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/tpl/processor.hxx b/include/cosv/tpl/processor.hxx
new file mode 100644
index 000000000000..a685acd5bed6
--- /dev/null
+++ b/include/cosv/tpl/processor.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 CSV_TPL_PROCESSOR_HXX
+#define CSV_TPL_PROCESSOR_HXX
+
+// USED SERVICES
+
+
+
+
+namespace csv
+{
+
+
+/** Implements an acyclic visitor pattern. This is the abstract
+ base for the classes doing the work (the "visitors").
+*/
+class ProcessorIfc
+{
+ public:
+ virtual ~ProcessorIfc() {}
+};
+
+
+
+/** Implements an acyclic visitor pattern. This is the abstract
+ base for the classes to be processed (the "visitables").
+*/
+class ConstProcessorClient
+{
+ public:
+ virtual ~ConstProcessorClient() {}
+
+ void Accept(
+ ProcessorIfc & io_processor ) const
+ { do_Accept(io_processor); }
+ private:
+ virtual void do_Accept(
+ ProcessorIfc & io_processor ) const = 0;
+};
+
+
+/** Typed base for "visitor" classes, leaving the visited
+ object const.
+
+ @see ProcessorIfc
+ @see Processor<>
+*/
+template <typename X, typename R = void>
+class ConstProcessor
+{
+ public:
+ virtual ~ConstProcessor() {}
+
+ R Process(
+ const X & i_object )
+ { return do_Process(i_object ); }
+ private:
+ virtual R do_Process(
+ const X & i_object ) = 0;
+};
+
+
+/** Typed base for "visitor" classes which may change the visited
+ object.
+
+ @see ProcessorIfc
+ @see ConstProcessor<>
+*/
+template <typename X, typename R = void>
+class Processor
+{
+ public:
+ virtual ~Processor() {}
+
+ R Process(
+ X & i_object )
+ { return do_Process(i_object ); }
+ private:
+ virtual R do_Process(
+ X & i_object ) = 0;
+};
+
+
+template <class C>
+inline void
+CheckedCall( ProcessorIfc & io_processor,
+ const C & i_client )
+{
+ ConstProcessor<C> *
+ pProcessor = dynamic_cast< csv::ConstProcessor<C> * >
+ (&io_processor);
+ if (pProcessor != 0)
+ pProcessor->Process(i_client);
+}
+
+template <class C>
+inline void
+CheckedCall( ProcessorIfc & io_processor,
+ C & io_client )
+{
+ Processor<C> *
+ pProcessor = dynamic_cast< csv::Processor<C> * >
+ (&io_processor);
+ if (pProcessor != 0)
+ pProcessor->Process(io_client);
+}
+
+} // namespace csv
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/tpl/swelist.hxx b/include/cosv/tpl/swelist.hxx
new file mode 100644
index 000000000000..5c64efc29cc2
--- /dev/null
+++ b/include/cosv/tpl/swelist.hxx
@@ -0,0 +1,362 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CSV_SWELIST_HXX
+#define CSV_SWELIST_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+ // PARAMETERS
+#include <cosv/tpl/dyn.hxx>
+
+
+namespace csv
+{
+
+
+template <class XX>
+class SweListElement
+{
+ public:
+ typedef SweListElement<XX> self;
+
+ SweListElement(
+ const XX & in_aObj )
+ : aObj(in_aObj), pNext(0) {}
+
+ const XX & Obj() const { return aObj; }
+ XX & Obj() { return aObj; }
+ self * Next() const { return pNext; }
+
+ void SetNext(
+ self * i_pNext )
+ { pNext = i_pNext; }
+ private:
+ XX aObj;
+ self * pNext;
+};
+
+
+
+template <class XX> class SweListIterator;
+template <class XX> class SweListCIterator;
+
+
+template <class XX>
+class SweList
+{
+ public:
+ // TYPES
+ typedef SweList<XX> self;
+ typedef XX value_type;
+ typedef SweListIterator<XX> iterator;
+ typedef SweListCIterator<XX> const_iterator;
+ private:
+ typedef SweListElement<XX> elem;
+
+ public:
+ // LIFECYCLE
+ SweList() : pTop(0), pTail(0) {}
+ ~SweList() { erase_all(); }
+ // OPERATIONS
+ void push_front(
+ const XX & i_aObj );
+ void pop_front();
+ void push_back(
+ const XX & i_aObj );
+ void erase_all();
+
+ // INQUIRY
+ const_iterator begin() const { return pTop; }
+ iterator begin() { return pTop; }
+ const_iterator end() const { return (elem*)0; }
+ iterator end() { return (elem*)0; }
+ const XX & front() const { return pTop->Obj(); }
+ XX & front() { return pTop->Obj(); }
+ const XX & back() const { return pTail->Obj(); }
+ XX & back() { return pTail->Obj(); }
+
+ bool empty() const { return pTop == 0; }
+ uintt size() const;
+
+
+ private:
+ // Forbiddden methods.
+ SweList(
+ const self & i_rList );
+ self & operator=(
+ const self & i_rList );
+
+ // DATA
+ DYN elem * pTop;
+ elem * pTail;
+};
+
+template <class XX>
+class SweList_dyn
+{
+ public:
+ // TYPES
+ typedef SweList_dyn<XX> self;
+ typedef SweListElement< XX* > elem;
+ typedef SweListIterator< XX* > iterator;
+
+ // LIFECYCLE
+ SweList_dyn() : pTop(0), pTail(0) {}
+ ~SweList_dyn() { erase_all(); }
+ // OPERATIONS
+ void push_front(
+ XX * i_pObj );
+ void push_back(
+ XX * i_pObj );
+ void pop_front();
+ void erase_all();
+
+ // INQUIRY
+ iterator begin() const { return pTop; }
+ iterator end() const { return (elem*)0; }
+ XX * front() const { return pTop->Obj(); }
+ XX * back() const { return pTail->Obj(); }
+
+ bool empty() const { return pTop == 0; }
+ uintt size() const;
+
+ private:
+ // Forbiddden methods.
+ SweList_dyn(
+ const self & i_rList );
+ self & operator=(
+ const self & i_rList );
+
+ DYN elem * pTop;
+ elem * pTail;
+};
+
+
+
+
+template<class XX>
+class SweListIterator
+{
+ public:
+ typedef SweListIterator<XX> self;
+ typedef SweListElement<XX> elem;
+
+ SweListIterator(
+ elem * i_pElem = 0)
+ : pElem(i_pElem) { }
+
+ // OPERATORS
+ XX & operator*() const { return pElem->Obj(); }
+ self & operator++() { if (pElem != 0) pElem = pElem->Next();
+ return *this; }
+ bool operator==(
+ const self & i_rIter ) const
+ { return pElem == i_rIter.pElem; }
+ bool operator!=(
+ const self & i_rIter ) const
+ { return pElem != i_rIter.pElem; }
+ private:
+ friend class SweListCIterator<XX>;
+
+ elem * pElem;
+};
+
+template<class XX>
+class SweListCIterator
+{
+ public:
+ typedef SweListCIterator<XX> self;
+ typedef SweListElement<XX> elem;
+
+ SweListCIterator(
+ const elem * i_pElem = 0)
+ : pElem(i_pElem) { }
+
+ // OPERATORS
+ self & operator=(
+ const SweListIterator<XX> &
+ i_rIter )
+ { pElem = i_rIter.pElem; return *this; }
+
+ const XX & operator*() const { return pElem->Obj(); }
+ self & operator++() { if (pElem != 0) pElem = pElem->Next();
+ return *this; }
+ bool operator==(
+ const self & i_rIter ) const
+ { return pElem == i_rIter.pElem; }
+ bool operator!=(
+ const self & i_rIter ) const
+ { return pElem != i_rIter.pElem; }
+ private:
+ const elem * pElem;
+};
+
+// IMPLEMENTATION
+
+template <class XX>
+void
+SweList<XX>::push_front( const XX & i_aObj )
+{
+ DYN elem * dpNew = new elem(i_aObj);
+ dpNew->SetNext(pTop);
+ pTop = dpNew;
+ if (pTail == 0)
+ pTail = pTop;
+}
+
+template <class XX>
+void
+SweList<XX>::push_back( const XX & i_aObj)
+{
+ if (pTail != 0)
+ {
+ pTail->SetNext(new elem(i_aObj));
+ pTail = pTail->Next();
+ }
+ else
+ {
+ pTop = pTail = new elem(i_aObj);
+ }
+}
+
+template <class XX>
+void
+SweList<XX>::pop_front()
+{
+ if (pTop != 0)
+ {
+ elem * pDel = pTop;
+ pTop = pTop->Next();
+ delete pDel;
+ if (pTop == 0)
+ pTail = 0;
+ }
+}
+
+template <class XX>
+uintt
+SweList<XX>::size() const
+{
+ uintt ret = 0;
+ for ( const_iterator iter = begin();
+ iter != end();
+ ++iter )
+ {
+ ++ret;
+ }
+ return ret;
+}
+
+
+template <class XX>
+void
+SweList<XX>::erase_all()
+{
+ for (pTail = pTop ; pTop != 0; pTail = pTop)
+ {
+ pTop = pTop->Next();
+ delete pTail;
+ }
+ pTop = pTail = 0;
+}
+
+
+template <class XX>
+void
+SweList_dyn<XX>::push_front( XX * i_pObj )
+{
+ DYN elem * dpNew = new elem(i_pObj);
+ dpNew->SetNext(pTop);
+ pTop = dpNew;
+ if (pTail == 0)
+ pTail = pTop;
+}
+
+template <class XX>
+void
+SweList_dyn<XX>::push_back( XX * i_pObj )
+{
+ if (pTail != 0)
+ {
+ pTail->SetNext(new elem(i_pObj));
+ pTail = pTail->Next();
+ }
+ else
+ {
+ pTop = pTail = new elem(i_pObj);
+ }
+}
+
+template <class XX>
+void
+SweList_dyn<XX>::pop_front()
+{
+ if (pTop != 0)
+ {
+ elem * pDel = pTop;
+ pTop = pTop->Next();
+ if (pDel->Obj() != 0)
+ Delete_dyn(pDel->Obj());
+ delete pDel;
+ if (pTop == 0)
+ pTail = 0;
+ }
+}
+
+
+template <class XX>
+void
+SweList_dyn<XX>::erase_all()
+{
+ for (pTail = pTop ; pTop != 0; pTail = pTop)
+ {
+ pTop = pTop->Next();
+ if (pTail->Obj() != 0)
+ {
+ delete pTail->Obj();
+ }
+ delete pTail;
+ }
+ pTop = pTail = 0;
+}
+
+template <class XX>
+uintt
+SweList_dyn<XX>::size() const
+{
+ uintt ret = 0;
+ for ( iterator iter = begin();
+ iter != end();
+ ++iter )
+ {
+ ++ret;
+ }
+ return ret;
+}
+
+
+} // namespace csv
+
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/tpl/tpltools.hxx b/include/cosv/tpl/tpltools.hxx
new file mode 100644
index 000000000000..487a74cf8237
--- /dev/null
+++ b/include/cosv/tpl/tpltools.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 CSV_TPLTOOLS_HXX
+#define CSV_TPLTOOLS_HXX
+
+#include <vector>
+#include <map>
+
+
+
+
+namespace csv
+{
+
+
+template <class COLLECTION>
+inline void erase_container(
+ COLLECTION & o_rCollection );
+
+/// Version for other containers than std::map, with non-pair value_type.
+template <class COLLECTION>
+void erase_container_of_heap_ptrs(
+ COLLECTION & o_rCollection );
+
+
+template <class KEY, class VAL>
+const VAL * find_in_map( /// Usable for all kinds of values
+ const std::map< KEY, VAL > &
+ i_rMap,
+ const KEY & i_rKey );
+
+
+/** @return the value in the map, if it is in there, else 0.
+ @precond VAL has to be convertible to "0".
+*/
+template <class KEY, class VAL>
+VAL value_from_map(
+ const std::map< KEY, VAL > &
+ i_rMap,
+ const KEY & i_rKey );
+
+/** @return the value in the map, if it is in there, else i_notFound.
+*/
+template <class KEY, class VAL>
+VAL value_from_map(
+ const std::map< KEY, VAL > &
+ i_rMap,
+ const KEY & i_rKey,
+ VAL i_notFound );
+
+template <class COLLECTION, class VALUE>
+bool contains(
+ const COLLECTION & i_collection,
+ const VALUE & i_value );
+
+
+
+
+// IMPLEMENTATION
+template <class COLLECTION>
+inline void
+erase_container( COLLECTION & o_rCollection )
+{
+ o_rCollection.erase( o_rCollection.begin(),
+ o_rCollection.end() );
+}
+
+template <class COLLECTION>
+void
+erase_container_of_heap_ptrs( COLLECTION & o_rCollection )
+{
+ typename COLLECTION::iterator itEnd = o_rCollection.end();
+ for ( typename COLLECTION::iterator it = o_rCollection.begin();
+ it != itEnd;
+ ++it )
+ {
+ delete *it;
+ }
+
+ o_rCollection.erase( o_rCollection.begin(),
+ o_rCollection.end() );
+}
+
+template <class KEY, class VAL>
+const VAL *
+find_in_map( const std::map< KEY, VAL > & i_rMap,
+ const KEY & i_rKey )
+{
+ typename std::map< KEY, VAL >::const_iterator
+ ret = i_rMap.find(i_rKey);
+ return ret != i_rMap.end()
+ ? & (*ret).second
+ : (const VAL*)0;
+}
+
+template <class KEY, class VAL>
+VAL
+value_from_map( const std::map< KEY, VAL > & i_rMap,
+ const KEY & i_rKey )
+{
+ typename std::map< KEY, VAL >::const_iterator
+ ret = i_rMap.find(i_rKey);
+ return ret != i_rMap.end()
+ ? (*ret).second
+ : VAL(0);
+}
+
+template <class KEY, class VAL>
+VAL
+value_from_map( const std::map< KEY, VAL > & i_rMap,
+ const KEY & i_rKey,
+ VAL i_notFound )
+{
+ typename std::map< KEY, VAL >::const_iterator
+ ret = i_rMap.find(i_rKey);
+ return ret != i_rMap.end()
+ ? (*ret).second
+ : i_notFound;
+}
+
+template <class COLLECTION, class VALUE>
+bool
+contains( const COLLECTION & i_collection,
+ const VALUE & i_value )
+{
+ return std::find(i_collection.begin(), i_collection.end(), i_value)
+ !=
+ i_collection.end();
+}
+
+
+
+
+} // namespace csv
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/tpl/vvector.hxx b/include/cosv/tpl/vvector.hxx
new file mode 100644
index 000000000000..dec58642bf23
--- /dev/null
+++ b/include/cosv/tpl/vvector.hxx
@@ -0,0 +1,535 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CSV_VVECTOR_HXX
+#define CSV_VVECTOR_HXX
+
+#include <cstddef> // for ptrdiff_t
+
+// USED SERVICES
+#include <vector>
+#include <cosv/tpl/tpltools.hxx>
+
+
+
+
+namespace csv
+{
+namespace vvector
+{
+
+
+template <class TYPE>
+struct delete_ptrs
+{
+ static void Destruct(
+ std::vector< TYPE* > &
+ v)
+ { csv::erase_container_of_heap_ptrs(v); }
+
+ /// @precond ->it is a valid iterator within v
+ static void Erase(
+ std::vector< TYPE* > &
+ v,
+ typename std::vector< TYPE* >::iterator
+ it2erase )
+ { delete *it2erase; v.erase(it2erase); }
+
+ /// @precond ->v.size() > 0
+ static void PopBack(
+ std::vector< TYPE* > &
+ v )
+ { delete v.back(); v.pop_back(); }
+
+ /// @precond ->it is a valid iterator
+ static void ReplacePtr(
+ typename std::vector< TYPE* >::iterator
+ it,
+ DYN TYPE * pass_new )
+ { delete *it; *it = pass_new; }
+};
+
+
+/** One helper class for the ->csv::VirtualVector.
+ Implements a
+*/
+template <class TYPE>
+struct keep_ptrs
+{
+ static void Destruct(std::vector< TYPE* > &)
+ {}
+
+ static void Erase(
+ std::vector< TYPE* > &
+ v,
+ typename std::vector< TYPE* >::iterator
+ it2erase )
+ { v.erase(it2erase); }
+
+ static void PopBack(
+ std::vector< TYPE* > &
+ v )
+ { v.pop_back(); }
+
+ /// @precond ->it is a valid iterator
+ static void ReplacePtr(
+ typename std::vector< TYPE* >::iterator
+ it,
+ TYPE * io_new )
+ { *it = io_new; }
+};
+
+
+} // namespace vvector
+
+
+
+
+/** Implements a vector of different implementations of a base
+ class.
+
+ Implementation has to be by pointers to get the polymorphic
+ behaviour, however access is by references to the base class.
+
+ @tpl XX
+ The common base class of vector elements.
+
+ @tpl PTRDEL
+ Has two possible values:
+ vvector::delete_ptrs<XX> Elements have to be on the heap and
+ are deleted when removed (default).
+ vvector::keep_ptrs<XX> Elements are only referenced and not
+ deleted when removed.
+
+*/
+template <class XX, class PTRDEL = vvector::delete_ptrs<XX> >
+class VirtualVector
+{
+ public:
+ typedef VirtualVector<XX,PTRDEL> self;
+ typedef std::vector< DYN XX* > impl_type;
+ typedef typename impl_type::size_type size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ class const_iterator;
+ class iterator;
+
+ // LIFECYCLE
+ VirtualVector();
+ explicit VirtualVector(
+ int i_size );
+ ~VirtualVector();
+
+ // OPERATORS
+ const XX & operator[](
+ size_type i_pos ) const;
+ XX & operator[](
+ size_type i_pos );
+
+ // OPERATIONS
+ void push_back(
+ DYN XX & i_drElement );
+ void pop_back();
+
+ iterator insert(
+ iterator i_pos,
+ DYN XX & i_drElement );
+ void erase(
+ iterator i_pos );
+ void replace(
+ iterator i_pos,
+ DYN XX & i_drElement );
+ void reserve(
+ size_type i_size );
+
+ // INQUIRY
+ bool empty() const;
+ size_t size() const;
+ const_iterator begin() const;
+ const_iterator end() const;
+ const XX & front() const;
+ const XX & back() const;
+
+ // ACCESS
+ iterator begin();
+ iterator end();
+ XX & front();
+ XX & back();
+
+ private:
+ // Forbidden:
+ VirtualVector(const VirtualVector&);
+ VirtualVector & operator=(const VirtualVector&);
+
+ // DATA
+ std::vector< DYN XX* >
+ aData;
+};
+
+
+
+
+/** Should be usable for all STL algorithms.
+ Implements the Random Access Iterator concept.
+*/
+template <class XX, class PTRDEL>
+class VirtualVector<XX,PTRDEL>::
+ const_iterator
+
+ // This derivation provides type information for the STL
+ // It introduces the types "value_type" and "difference_type".
+ : public std::iterator<std::random_access_iterator_tag,
+ const XX>
+{
+ public:
+ typedef VirtualVector<XX,PTRDEL> my_container;
+ typedef typename my_container::impl_type::const_iterator impl_iterator;
+
+ // LIFECYCLE
+ const_iterator(
+ impl_iterator i_implIter )
+ : itImpl(i_implIter) {}
+
+
+ /////////// STL ITERATOR CONCEPT IMPLEMENTATION //////////////
+
+ // Default Constructible functions:
+ const_iterator()
+ : itImpl() {}
+
+ // Assignable functions:
+ // Assignment and copy constructor use the compiler generated versions.
+
+ // Equality Comparable functions:
+ bool operator==(
+ const_iterator i_other ) const
+ { return itImpl == i_other.itImpl; }
+ bool operator!=(
+ const_iterator i_other ) const
+ { return itImpl != i_other.itImpl; }
+
+ // Trivial Iterator functions:
+ const XX & operator*() const
+ { return *(*itImpl); }
+
+ // Input Iterator functions:
+ const_iterator & operator++()
+ { ++itImpl; return *this; }
+ const_iterator operator++(int)
+ { return const_iterator(itImpl++); }
+
+ // Bidirectional Iterator functions:
+ const_iterator & operator--()
+ { --itImpl; return *this; }
+ const_iterator operator--(int)
+ { return const_iterator(itImpl--); }
+
+ // Less Than Comparable functions:
+ bool operator<(
+ const_iterator i_other ) const
+ { return itImpl < i_other.itImpl; }
+
+ // Random Access Iterator functions:
+ const_iterator & operator+=(
+ difference_type i_diff )
+ { itImpl += i_diff; return *this; }
+ const_iterator operator+(
+ difference_type i_diff ) const
+ { const_iterator ret(itImpl);
+ return ret += i_diff; }
+ const_iterator & operator-=(
+ difference_type i_diff )
+ { itImpl -= i_diff; return *this; }
+ const_iterator operator-(
+ difference_type i_diff ) const
+ { const_iterator ret(itImpl);
+ return ret -= i_diff; }
+ difference_type operator-(
+ const_iterator i_it ) const
+ { return itImpl - i_it.itImpl; }
+ const XX & operator[](
+ difference_type i_index )
+ { return *(*itImpl[i_index]); }
+
+ //////////////////////////////////////////////////////////////////////////
+
+ private:
+ friend class VirtualVector<XX,PTRDEL>;
+ impl_iterator ImplValue() const { return itImpl; }
+
+ // DATA
+ impl_iterator itImpl;
+};
+
+
+
+
+/** Should be usable for all STL algorithms.
+ Implements the Random Access Iterator concept.
+*/
+template <class XX, class PTRDEL>
+class VirtualVector<XX,PTRDEL>::
+ iterator
+
+ // This derivation provides type information for the STL
+ // It introduces the types "value_type" and "difference_type".
+ : public std::iterator<std::random_access_iterator_tag,
+ XX>
+{
+ public:
+ typedef VirtualVector<XX,PTRDEL> my_container;
+ typedef typename my_container::impl_type::iterator impl_iterator;
+
+ // LIFECYCLE
+ iterator(
+ impl_iterator i_implIter )
+ : itImpl(i_implIter) {}
+
+
+ /////////// STL ITERATOR CONCEPT IMPLEMENTATION //////////////
+
+ // Default Constructible functions:
+ iterator()
+ : itImpl() {}
+
+ // Assignable functions:
+ // Assignment and copy constructor use the compiler generated versions.
+
+ // Equality Comparable functions:
+ bool operator==(
+ iterator i_other ) const
+ { return itImpl == i_other.itImpl; }
+ bool operator!=(
+ iterator i_other ) const
+ { return itImpl != i_other.itImpl; }
+
+ // Trivial Iterator functions:
+ XX & operator*() const
+ { return *(*itImpl); }
+
+ // Input Iterator functions:
+ iterator & operator++()
+ { ++itImpl; return *this; }
+ iterator operator++(int)
+ { return iterator(itImpl++); }
+
+ // Bidirectional Iterator functions:
+ iterator & operator--()
+ { --itImpl; return *this; }
+ iterator operator--(int)
+ { return iterator(itImpl--); }
+
+ // Less Than Comparable functions:
+ bool operator<(
+ iterator i_other ) const
+ { return itImpl < i_other.itImpl; }
+
+ // Random Access Iterator functions:
+ iterator & operator+=(
+ difference_type i_diff )
+ { itImpl += i_diff; return *this; }
+ iterator operator+(
+ difference_type i_diff ) const
+ { iterator ret(itImpl);
+ return ret += i_diff; }
+ iterator & operator-=(
+ difference_type i_diff )
+ { itImpl -= i_diff; return *this; }
+ iterator operator-(
+ difference_type i_diff ) const
+ { iterator ret(itImpl);
+ return ret -= i_diff; }
+ difference_type operator-(
+ iterator i_it ) const
+ { return itImpl - i_it.itImpl; }
+ XX & operator[](
+ difference_type i_index )
+ { return *(*itImpl[i_index]); }
+
+ //////////////////////////////////////////////////////////////////////////
+
+ private:
+ friend class VirtualVector<XX,PTRDEL>;
+ impl_iterator ImplValue() const { return itImpl; }
+
+ // DATA
+ impl_iterator itImpl;
+};
+
+
+
+
+// IMPLEMENTATION
+template <class XX, class PTRDEL>
+inline
+VirtualVector<XX,PTRDEL>::VirtualVector()
+ : aData()
+{
+}
+
+template <class XX, class PTRDEL>
+inline
+VirtualVector<XX,PTRDEL>::VirtualVector(int i_size)
+ : aData(i_size, 0)
+{
+}
+
+template <class XX, class PTRDEL>
+inline
+VirtualVector<XX,PTRDEL>::~VirtualVector()
+{
+ PTRDEL::Destruct(aData);
+}
+
+template <class XX, class PTRDEL>
+inline const XX &
+VirtualVector<XX,PTRDEL>::operator[]( size_type i_pos ) const
+{
+ return *aData[i_pos];
+}
+
+template <class XX, class PTRDEL>
+inline XX &
+VirtualVector<XX,PTRDEL>::operator[]( size_type i_pos )
+{
+ return *aData[i_pos];
+}
+
+template <class XX, class PTRDEL>
+inline void
+VirtualVector<XX,PTRDEL>::push_back( DYN XX & i_drElement )
+{
+ aData.push_back(&i_drElement);
+}
+
+template <class XX, class PTRDEL>
+inline void
+VirtualVector<XX,PTRDEL>::pop_back()
+{
+ if (NOT aData.empty())
+ PTRDEL::PopBack(aData);
+}
+
+template <class XX, class PTRDEL>
+inline typename VirtualVector<XX,PTRDEL>::iterator
+VirtualVector<XX,PTRDEL>::insert( iterator i_pos,
+ DYN XX & i_drElement )
+{
+ return iterator(aData.insert(i_pos.ImplValue(), &i_drElement));
+}
+
+template <class XX, class PTRDEL>
+inline void
+VirtualVector<XX,PTRDEL>::erase( iterator i_pos )
+{
+ PTRDEL::Erase(aData, i_pos.ImplValue());
+}
+
+template <class XX, class PTRDEL>
+inline void
+VirtualVector<XX,PTRDEL>::replace( iterator i_pos,
+ DYN XX & i_drElement )
+{
+ PTRDEL::ReplacePtr(*i_pos, &i_drElement);
+}
+
+template <class XX, class PTRDEL>
+inline void
+VirtualVector<XX,PTRDEL>::reserve( size_type i_size )
+{
+ aData.reserve(i_size);
+}
+
+template <class XX, class PTRDEL>
+inline bool
+VirtualVector<XX,PTRDEL>::empty() const
+{
+ return aData.empty();
+}
+
+template <class XX, class PTRDEL>
+inline size_t
+VirtualVector<XX,PTRDEL>::size() const
+{
+ return aData.size();
+}
+
+template <class XX, class PTRDEL>
+inline typename VirtualVector<XX,PTRDEL>::const_iterator
+VirtualVector<XX,PTRDEL>::begin() const
+{
+ return const_iterator(aData.begin());
+}
+
+template <class XX, class PTRDEL>
+inline typename VirtualVector<XX,PTRDEL>::const_iterator
+VirtualVector<XX,PTRDEL>::end() const
+{
+ return const_iterator(aData.end());
+}
+
+template <class XX, class PTRDEL>
+inline const XX &
+VirtualVector<XX,PTRDEL>::front() const
+{
+ return *aData.front();
+}
+
+template <class XX, class PTRDEL>
+inline const XX &
+VirtualVector<XX,PTRDEL>::back() const
+{
+ return *aData.back();
+}
+
+template <class XX, class PTRDEL>
+inline typename VirtualVector<XX,PTRDEL>::iterator
+VirtualVector<XX,PTRDEL>::begin()
+{
+ return iterator(aData.begin());
+}
+
+template <class XX, class PTRDEL>
+inline typename VirtualVector<XX,PTRDEL>::iterator
+VirtualVector<XX,PTRDEL>::end()
+{
+ return iterator(aData.end());
+}
+
+template <class XX, class PTRDEL>
+inline XX &
+VirtualVector<XX,PTRDEL>::front()
+{
+ return *aData.front();
+}
+
+template <class XX, class PTRDEL>
+inline XX &
+VirtualVector<XX,PTRDEL>::back()
+{
+ return *aData.back();
+}
+
+
+
+
+} // namespace csv
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cosv/x.hxx b/include/cosv/x.hxx
new file mode 100644
index 000000000000..755436317a39
--- /dev/null
+++ b/include/cosv/x.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 CSV_X_HXX
+#define CSV_X_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+#include <cosv/string.hxx>
+ // PARAMETERS
+#include <cosv/csv_ostream.hxx>
+
+
+namespace csv
+{
+
+class Exception
+{
+ public:
+ virtual ~Exception() {}
+ virtual void GetInfo(
+ ostream & o_rOutputMedium ) const = 0;
+};
+
+
+class X_Default : public Exception
+{
+ public:
+ X_Default(
+ const char * i_sMessage )
+ : sMessage(i_sMessage) {}
+ virtual void GetInfo( // Implemented in comfunc.cxx
+ ostream & o_rOutputMedium ) const;
+ private:
+ String sMessage;
+};
+
+
+} // namespace csv
+
+
+
+#endif
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/basegfxfactory.hxx b/include/cppcanvas/basegfxfactory.hxx
new file mode 100644
index 000000000000..83acb38c448f
--- /dev/null
+++ b/include/cppcanvas/basegfxfactory.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 _CPPCANVAS_BASEGFXFACTORY_HXX
+#define _CPPCANVAS_BASEGFXFACTORY_HXX
+
+#include <cppcanvas/canvas.hxx>
+#include <cppcanvas/bitmapcanvas.hxx>
+#include <cppcanvas/spritecanvas.hxx>
+#include <cppcanvas/polypolygon.hxx>
+#include <cppcanvas/bitmap.hxx>
+#include <cppcanvas/renderer.hxx>
+#include <cppcanvas/text.hxx>
+#include <cppcanvas/sprite.hxx>
+#include <basegfx/vector/b2isize.hxx>
+
+#include <cppcanvas/cppcanvasdllapi.h>
+
+namespace basegfx
+{
+ class B2DPolygon;
+ class B2DPolyPolygon;
+}
+
+
+/* Definition of BaseGfxFactory class */
+
+namespace cppcanvas
+{
+ /** The BaseGfxFactory creates Canvas objects for various basegfx
+ primitives, such as polygons and bitmaps (not yet
+ implemented).
+
+ Please note that the objects created for a specific Canvas can
+ only be drawn on exactly that canvas. You have to regenerate
+ them for different canvases.
+ */
+ class CPPCANVAS_DLLPUBLIC BaseGfxFactory
+ {
+ public:
+ static BaseGfxFactory& getInstance();
+
+ /** Create a polygon from a ::basegfx::B2DPolygon
+
+ The created polygon initially has the same size in user
+ coordinate space as the source polygon
+ */
+ PolyPolygonSharedPtr createPolyPolygon( const CanvasSharedPtr&, const ::basegfx::B2DPolygon& rPoly ) const;
+
+ /** Create an uninitialized bitmap with the given size
+ */
+ BitmapSharedPtr createBitmap( const CanvasSharedPtr&, const ::basegfx::B2ISize& rSize ) const;
+
+ /** Create an uninitialized alpha bitmap with the given size
+ */
+ BitmapSharedPtr createAlphaBitmap( const CanvasSharedPtr&, const ::basegfx::B2ISize& rSize ) const;
+
+ private:
+ friend struct InitInstance2;
+
+ // singleton
+ BaseGfxFactory();
+
+ // default: disabled copy/assignment
+ BaseGfxFactory(const BaseGfxFactory&);
+ BaseGfxFactory& operator=( const BaseGfxFactory& );
+ };
+
+}
+
+#endif /* _CPPCANVAS_BASEGFXFACTORY_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/bitmap.hxx b/include/cppcanvas/bitmap.hxx
new file mode 100644
index 000000000000..5e542e7220aa
--- /dev/null
+++ b/include/cppcanvas/bitmap.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 _CPPCANVAS_BITMAP_HXX
+#define _CPPCANVAS_BITMAP_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <cppcanvas/canvasgraphic.hxx>
+#include <cppcanvas/bitmapcanvas.hxx>
+
+namespace com { namespace sun { namespace star { namespace rendering
+{
+ class XBitmap;
+} } } }
+
+
+/* Definition of Bitmap interface */
+
+namespace cppcanvas
+{
+
+ /** This interface defines a Bitmap canvas object
+
+ Consider this object part of the view, and not of the model
+ data, as this bitmap can only be painted on its parent canvas
+ */
+ class Bitmap : public virtual CanvasGraphic
+ {
+ public:
+ /** Render to parent canvas, with global alpha.
+
+ This method renders the content to the parent canvas,
+ i.e. the canvas this object was constructed for.
+
+ @param nAlphaModulation
+ Global alpha value, with which each pixel alpha value gets
+ multiplied. For a normal, opaque bitmap, this will make
+ the bitmap appear transparent with the given alpha value
+ (value must be in the range [0,1]).
+
+ @return whether the rendering finished successfully.
+ */
+ virtual bool drawAlphaModulated( double nAlphaModulation ) const = 0;
+
+ virtual BitmapCanvasSharedPtr getBitmapCanvas() const = 0;
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XBitmap > getUNOBitmap() const = 0;
+ };
+
+ typedef ::boost::shared_ptr< ::cppcanvas::Bitmap > BitmapSharedPtr;
+}
+
+#endif /* _CPPCANVAS_BITMAP_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/bitmapcanvas.hxx b/include/cppcanvas/bitmapcanvas.hxx
new file mode 100644
index 000000000000..620182a14e45
--- /dev/null
+++ b/include/cppcanvas/bitmapcanvas.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 _CPPCANVAS_BITMAPCANVAS_HXX
+#define _CPPCANVAS_BITMAPCANVAS_HXX
+
+#include <sal/types.h>
+#include <osl/diagnose.h>
+
+#include <boost/shared_ptr.hpp>
+#include <basegfx/vector/b2isize.hxx>
+#include <cppcanvas/canvas.hxx>
+
+
+/* Definition of BitmapCanvas */
+
+namespace cppcanvas
+{
+ class BitmapCanvas;
+
+ // forward declaration, since cloneBitmapCanvas() also references BitmapCanvas
+ typedef ::boost::shared_ptr< BitmapCanvas > BitmapCanvasSharedPtr;
+
+ /** BitmapCanvas interface
+ */
+ class BitmapCanvas : public virtual Canvas
+ {
+ public:
+ virtual ::basegfx::B2ISize getSize() const = 0;
+
+ // shared_ptr does not allow for covariant return types
+ BitmapCanvasSharedPtr cloneBitmapCanvas() const
+ {
+ BitmapCanvasSharedPtr p( ::boost::dynamic_pointer_cast< BitmapCanvas >(this->clone()) );
+ OSL_ENSURE(p.get(), "BitmapCanvas::cloneBitmapCanvas(): dynamic cast failed");
+ return p;
+ }
+ };
+
+}
+
+#endif /* _CPPCANVAS_BITMAPCANVAS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/canvas.hxx b/include/cppcanvas/canvas.hxx
new file mode 100644
index 000000000000..0a77e7129a43
--- /dev/null
+++ b/include/cppcanvas/canvas.hxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CPPCANVAS_CANVAS_HXX
+#define _CPPCANVAS_CANVAS_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <cppcanvas/font.hxx>
+#include <cppcanvas/color.hxx>
+
+
+namespace basegfx
+{
+ class B2DHomMatrix;
+ class B2DPolyPolygon;
+}
+
+namespace com { namespace sun { namespace star { namespace rendering
+{
+ class XCanvas;
+ struct ViewState;
+} } } }
+
+
+/* Definition of BitmapCanvas */
+
+namespace cppcanvas
+{
+ class PolyPolygon;
+ class Canvas;
+
+ // forward declaration, since PolyPolygon also references Canvas
+ typedef ::boost::shared_ptr< PolyPolygon > PolyPolygonSharedPtr;
+
+ // forward declaration, since cloneCanvas() also references Canvas
+ typedef ::boost::shared_ptr< Canvas > CanvasSharedPtr;
+
+ /** Canvas interface
+ */
+ class Canvas
+ {
+ public:
+ enum
+ {
+ /** Extra pixel used when canvas anti-aliases.
+
+ Enlarge the bounding box of drawing primitives by this
+ amount in both dimensions, and on both sides of the
+ bounds, to account for extra pixel touched outside the
+ actual primitive bounding box, when the canvas
+ performs anti-aliasing.
+ */
+ ANTIALIASING_EXTRA_SIZE=2
+ };
+
+ virtual ~Canvas() {}
+
+ virtual void setTransformation( const ::basegfx::B2DHomMatrix& rMatrix ) = 0;
+ virtual ::basegfx::B2DHomMatrix getTransformation() const = 0;
+
+ virtual void setClip( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0;
+ virtual void setClip() = 0;
+
+ /** Get current clip
+
+ @return NULL, if no clip is set, otherwise the current clip poly-polygon
+ */
+ virtual ::basegfx::B2DPolyPolygon const* getClip() const = 0;
+
+ virtual FontSharedPtr createFont( const OUString& rFontName, const double& rCellSize ) const = 0;
+
+ virtual ColorSharedPtr createColor() const = 0;
+
+ virtual CanvasSharedPtr clone() const = 0;
+ virtual void clear() const = 0;
+
+ // this should be considered private. if RTTI gets enabled
+ // someday, remove that to a separate interface
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XCanvas > getUNOCanvas() const = 0;
+ virtual ::com::sun::star::rendering::ViewState getViewState() const = 0;
+ };
+
+}
+
+#endif /* _CPPCANVAS_CANVAS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/canvasgraphic.hxx b/include/cppcanvas/canvasgraphic.hxx
new file mode 100644
index 000000000000..e496df6aeb33
--- /dev/null
+++ b/include/cppcanvas/canvasgraphic.hxx
@@ -0,0 +1,157 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CPPCANVAS_CANVASGRAPHIC_HXX
+#define _CPPCANVAS_CANVASGRAPHIC_HXX
+
+#include <sal/types.h>
+
+#include <boost/shared_ptr.hpp>
+#include <cppcanvas/color.hxx>
+#include <cppcanvas/canvas.hxx>
+
+namespace basegfx
+{
+ class B2DHomMatrix;
+ class B2DPolyPolygon;
+}
+
+
+/* Definition of CanvasGraphic interface */
+
+namespace cppcanvas
+{
+ // forward declaration, since PolyPolygon also derives from CanvasGraphic
+ typedef ::boost::shared_ptr< class PolyPolygon > PolyPolygonSharedPtr;
+
+
+ /** This interface defines basic properties of
+ objects that can be painted on a Canvas
+ */
+ class CanvasGraphic
+ {
+ public:
+
+ /** These enums determine how the primitive color is combined
+ with the background. When performing this calculations, it
+ is assumed that all color values are premultiplied with
+ the corresponding alpha values (if no alpha is specified,
+ 1.0 is assumed). Then, the following general compositing
+ operation is performed:
+
+ C = Ca * Fa + Cb * Fb
+
+ where C is the result color, Ca and Cb are the input
+ colors, premultiplied with alpha, and Fa and Fb are
+ described for the different composite modes (wherein Aa
+ and Ab denote source and destination alpha, respectively).
+ */
+ enum CompositeOp
+ {
+ /// Clear destination. Fa = Fb = 0.
+ CLEAR,
+
+ /// Copy source as-is to destination. Fa = 1, Fb = 0.
+ SOURCE,
+
+ /// Leave destination as-is. Fa = 0, Fb = 1.
+ DESTINATION,
+
+ /// Copy source over destination. Fa = 1, Fb = 1-Aa.
+ OVER,
+
+ /// Copy source under destination. Fa = 1-Ab, Fb = 1.
+ UNDER,
+
+ /// Copy source to destination, but limited to where the destination is. Fa = Ab, Fb = 0.
+ INSIDE,
+
+ /// Leave destination as is, but only where source was. Fa = 0, Fb = Aa.
+ INSIDE_REVERSE,
+
+ /// Copy source to destination, but limited to where destination is not. Fa = 1-Ab, Fb = 0.
+ OUTSIDE,
+
+ /// Leave destination as is, but only where source has not been. Fa = 0, Fb = 1-Aa.
+ OUTSIDE_REVERSE,
+
+ /// Copy source over destination, but only where destination is. Keep destination. Fa = Ab, Fb = 1-Aa.
+ ATOP,
+
+ /// Copy destination over source, but only where source is. Keep source. Fa = 1-Ab, Fb = Aa.
+ ATOP_REVERSE,
+
+ /// Take only parts where either source or destination, but not both are. Fa = 1-Ab, Fb = 1-Aa.
+ XOR,
+
+ /** simply add contributions of both source and destination. The
+ resulting color values are limited to the permissible color
+ range, and clipped to the maximal value, if exceeded. Fa = 1, Fb = 1.
+ */
+ ADD,
+
+ /// Fa = min(1,(1-Ab)/Aa), Fb = 1
+ SATURATE
+ };
+
+ virtual ~CanvasGraphic() {}
+
+ /** Set object transformation matrix
+ */
+ virtual void setTransformation( const ::basegfx::B2DHomMatrix& rMatrix ) = 0;
+ /** Get object transformation matrix
+ */
+ virtual ::basegfx::B2DHomMatrix getTransformation() const = 0;
+
+ /** Set object clipping polygon
+ */
+ virtual void setClip( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0;
+ /** Clear object clipping polygon
+ */
+ virtual void setClip() = 0;
+ /** Get object clipping polygon
+
+ @return NULL, if no clip is set; otherwise, the current clip poly-polygon is returned
+ */
+ virtual ::basegfx::B2DPolyPolygon const* getClip() const = 0;
+
+ /** Set object composite mode
+ */
+ virtual void setCompositeOp( CompositeOp aOp ) = 0;
+ /** Get object composite mode
+ */
+ virtual CompositeOp getCompositeOp() const = 0;
+
+ /** Render to parent canvas
+
+ This method renders the content to the parent canvas,
+ i.e. the canvas this object was constructed for.
+
+ @return whether the rendering finished successfully.
+ */
+ virtual bool draw() const = 0;
+
+ };
+
+ typedef ::boost::shared_ptr< ::cppcanvas::CanvasGraphic > CanvasGraphicSharedPtr;
+}
+
+#endif /* _CPPCANVAS_CANVASGRAPHIC_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/color.hxx b/include/cppcanvas/color.hxx
new file mode 100644
index 000000000000..6d7dc957286a
--- /dev/null
+++ b/include/cppcanvas/color.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 _CPPCANVAS_COLOR_HXX
+#define _CPPCANVAS_COLOR_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+
+/* Definition of Color class */
+
+namespace cppcanvas
+{
+ class Color
+ {
+ public:
+ /** Color in the sRGB color space, plus alpha channel
+
+ The four bytes of the sal_uInt32 are allocated as follows
+ to the color channels and alpha: 0xRRGGBBAA.
+ */
+ typedef sal_uInt32 IntSRGBA;
+
+ virtual ~Color() {}
+
+ virtual IntSRGBA getIntSRGBA( ::com::sun::star::uno::Sequence< double >& rDeviceColor ) const = 0;
+ virtual ::com::sun::star::uno::Sequence< double > getDeviceColor( IntSRGBA aSRGBA ) const = 0;
+ };
+
+ typedef ::boost::shared_ptr< ::cppcanvas::Color > ColorSharedPtr;
+
+ inline sal_uInt8 getRed( Color::IntSRGBA nCol )
+ {
+ return static_cast<sal_uInt8>( (nCol&0xFF000000U) >> 24U );
+ }
+
+ inline sal_uInt8 getGreen( Color::IntSRGBA nCol )
+ {
+ return static_cast<sal_uInt8>( (nCol&0x00FF0000U) >> 16U );
+ }
+
+ inline sal_uInt8 getBlue( Color::IntSRGBA nCol )
+ {
+ return static_cast<sal_uInt8>( (nCol&0x0000FF00U) >> 8U );
+ }
+
+ inline sal_uInt8 getAlpha( Color::IntSRGBA nCol )
+ {
+ return static_cast<sal_uInt8>( nCol&0x000000FFU );
+ }
+
+ inline Color::IntSRGBA makeColor( sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue, sal_uInt8 nAlpha )
+ {
+ return (nRed << 24U)|(nGreen << 16U)|(nBlue << 8U)|(nAlpha);
+ }
+
+ inline sal_Int32 unMakeColor( sal_uInt8 nAlpha, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
+ {
+ return (nAlpha << 24U)|(nRed << 16U)|(nGreen << 8U)|(nBlue);
+ }
+
+ inline sal_Int32 makeColorARGB( sal_uInt8 nAlpha, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
+ {
+ return (nAlpha << 24U)|(nRed << 16U)|(nGreen << 8U)|(nBlue);
+ }
+
+}
+
+#endif /* _CPPCANVAS_COLOR_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/cppcanvasdllapi.h b/include/cppcanvas/cppcanvasdllapi.h
new file mode 100644
index 000000000000..be641aad8b2b
--- /dev/null
+++ b/include/cppcanvas/cppcanvasdllapi.h
@@ -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_CPPCANVASDLLAPI_H
+#define INCLUDED_CPPCANVASDLLAPI_H
+
+#if defined CPPCANVAS_DLLIMPLEMENTATION
+
+#define CPPCANVAS_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define CPPCANVAS_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define CPPCANVAS_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
diff --git a/include/cppcanvas/customsprite.hxx b/include/cppcanvas/customsprite.hxx
new file mode 100644
index 000000000000..70004e7e5900
--- /dev/null
+++ b/include/cppcanvas/customsprite.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 _CPPCANVAS_CUSTOMSPRITE_HXX
+#define _CPPCANVAS_CUSTOMSPRITE_HXX
+
+#include <sal/types.h>
+
+#include <boost/shared_ptr.hpp>
+#include <cppcanvas/sprite.hxx>
+#include <cppcanvas/canvas.hxx>
+
+
+/* Definition of CustomSprite class */
+
+namespace cppcanvas
+{
+
+ class CustomSprite : public virtual Sprite
+ {
+ public:
+
+ virtual CanvasSharedPtr getContentCanvas() const = 0;
+ };
+
+ typedef ::boost::shared_ptr< ::cppcanvas::CustomSprite > CustomSpriteSharedPtr;
+}
+
+#endif /* _CPPCANVAS_CUSTOMSPRITE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/font.hxx b/include/cppcanvas/font.hxx
new file mode 100644
index 000000000000..967903eaa8e7
--- /dev/null
+++ b/include/cppcanvas/font.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 _CPPCANVAS_FONT_HXX
+#define _CPPCANVAS_FONT_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+
+namespace com { namespace sun { namespace star { namespace rendering
+{
+ class XCanvasFont;
+} } } }
+
+/* Definition of Font class */
+
+namespace cppcanvas
+{
+
+ class Font
+ {
+ public:
+ virtual ~Font() {}
+
+ virtual OUString getName() const = 0;
+ virtual double getCellSize() const = 0;
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XCanvasFont > getUNOFont() const = 0;
+ };
+
+ typedef ::boost::shared_ptr< ::cppcanvas::Font > FontSharedPtr;
+}
+
+#endif /* _CPPCANVAS_FONT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/polypolygon.hxx b/include/cppcanvas/polypolygon.hxx
new file mode 100644
index 000000000000..ccfbb95d3def
--- /dev/null
+++ b/include/cppcanvas/polypolygon.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 _CPPCANVAS_POLYPOLYGON_HXX
+#define _CPPCANVAS_POLYPOLYGON_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <cppcanvas/canvasgraphic.hxx>
+
+namespace basegfx
+{
+ class B2DPolygon;
+ class B2DPolyPolygon;
+}
+
+namespace com { namespace sun { namespace star { namespace rendering
+{
+ class XPolyPolygon2D;
+} } } }
+
+
+/* Definition of PolyPolygon interface */
+
+namespace cppcanvas
+{
+
+ /** This interface defines a PolyPolygon canvas object
+
+ Consider this object part of the view, and not of the model
+ data. Although the given polygon is typically copied and held
+ internally (to facilitate migration to incompatible canvases),
+ ::basegfx::B2DPolygon et al. are ref-counted copy-on-write
+ classes, i.e. memory shouldn't be wasted. On the other hand,
+ the API polygon created internally _does_ necessarily
+ duplicate the data held, but can be easily flushed away via
+ flush().
+ */
+ class PolyPolygon : public virtual CanvasGraphic
+ {
+ public:
+ virtual void addPolygon( const ::basegfx::B2DPolygon& rPoly ) = 0;
+ virtual void addPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly ) = 0;
+
+ /** Set polygon fill color
+ */
+ virtual void setRGBAFillColor( Color::IntSRGBA ) = 0;
+ /** Set polygon line color
+ */
+ virtual void setRGBALineColor( Color::IntSRGBA ) = 0;
+ /** Get polygon fill color
+ */
+ virtual Color::IntSRGBA getRGBAFillColor() const = 0;
+ /** Get polygon line color
+ */
+ virtual Color::IntSRGBA getRGBALineColor() const = 0;
+
+ virtual void setStrokeWidth( const double& rStrokeWidth ) = 0;
+ virtual double getStrokeWidth() const = 0;
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XPolyPolygon2D > getUNOPolyPolygon() const = 0;
+ };
+
+ typedef ::boost::shared_ptr< ::cppcanvas::PolyPolygon > PolyPolygonSharedPtr;
+}
+
+#endif /* _CPPCANVAS_POLYPOLYGON_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/renderer.hxx b/include/cppcanvas/renderer.hxx
new file mode 100644
index 000000000000..e260e9400248
--- /dev/null
+++ b/include/cppcanvas/renderer.hxx
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CPPCANVAS_RENDERER_HXX
+#define _CPPCANVAS_RENDERER_HXX
+
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <cppcanvas/canvasgraphic.hxx>
+#include <cppcanvas/color.hxx>
+
+namespace basegfx
+{
+ class B2DRange;
+}
+
+/* Definition of Renderer interface */
+
+namespace cppcanvas
+{
+
+ class Renderer : public virtual CanvasGraphic
+ {
+ public:
+ /** Render subset of metafile to given canvas
+
+ This method renders the given subset of the content to the
+ associated canvas.
+
+ @param nStartIndex
+ The index of the first action to be rendered (the indices
+ correspond roughly to the action indices of the
+ originating GDIMetaFile. Note, although, that certain
+ actions, e.g. text, accounts for more than one index: a
+ text produces as many addressable indices as it has
+ characters).
+
+ @param nEndIndex
+ The index of the first action _not_ painted anymore,
+ i.e. the action after the last action rendered (the
+ indices correspond roughly to the action indices of the
+ originating GDIMetaFile. Note, although, that certain
+ actions, e.g. text, accounts for more than one index: a
+ text produces as many addressable indices as it has
+ characters).
+
+ @return whether the rendering finished successfully.
+ */
+ virtual bool drawSubset( sal_Int32 nStartIndex,
+ sal_Int32 nEndIndex ) const = 0;
+
+ /** Query bounding box of metafile subset
+
+ This method queries the actual bounding box of the given
+ subset, when rendered on the associated canvas.
+
+ @param nStartIndex
+ The index of the first action to be rendered (the indices
+ correspond roughly to the action indices of the
+ originating GDIMetaFile. Note, although, that certain
+ actions, e.g. text, accounts for more than one index: a
+ text produces as many addressable indices as it has
+ characters).
+
+ @param nEndIndex
+ The index of the first action _not_ painted anymore,
+ i.e. the action after the last action rendered (the
+ indices correspond roughly to the action indices of the
+ originating GDIMetaFile. Note, although, that certain
+ actions, e.g. text, accounts for more than one index: a
+ text produces as many addressable indices as it has
+ characters).
+
+ @return the bounding box of the specified subset
+ */
+ virtual ::basegfx::B2DRange getSubsetArea( sal_Int32 nStartIndex,
+ sal_Int32 nEndIndex ) const = 0;
+
+ /** Parameters for the Renderer
+ */
+ struct Parameters
+ {
+ /// Optionally forces the fill color attribute for all actions
+ ::boost::optional< Color::IntSRGBA > maFillColor;
+
+ /// Optionally forces the line color attribute for all actions
+ ::boost::optional< Color::IntSRGBA > maLineColor;
+
+ /// Optionally forces the text color attribute for all actions
+ ::boost::optional< Color::IntSRGBA > maTextColor;
+
+ /// Optionally forces the given fontname for all text actions
+ ::boost::optional< OUString > maFontName;
+
+ /** Optionally transforms all text output actions with the
+ given matrix (in addition to the overall canvas
+ transformation).
+
+ Note that the matrix given here is applied to the unit
+ rect coordinate system, i.e. the metafile is assumed
+ to be contained in the unit rect.
+ */
+ ::boost::optional< ::basegfx::B2DHomMatrix > maTextTransformation;
+
+ /// Optionally forces the given font weight for all text actions
+ ::boost::optional< sal_Int8 > maFontWeight;
+
+ /// Optionally forces the given font letter form (italics etc.) for all text actions
+ ::boost::optional< sal_Int8 > maFontLetterForm;
+
+ /// Optionally forces the given font proportion (condensed, monospaced etc.) for all text actions
+ ::boost::optional< sal_Int8 > maFontProportion;
+
+ /// Optionally forces underlining for all text actions
+ ::boost::optional< bool > maFontUnderline;
+ };
+ };
+
+ typedef ::boost::shared_ptr< ::cppcanvas::Renderer > RendererSharedPtr;
+}
+
+#endif /* _CPPCANVAS_RENDERER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/sprite.hxx b/include/cppcanvas/sprite.hxx
new file mode 100644
index 000000000000..0e87ff9b9dd1
--- /dev/null
+++ b/include/cppcanvas/sprite.hxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CPPCANVAS_SPRITE_HXX
+#define _CPPCANVAS_SPRITE_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+namespace basegfx
+{
+ class B2DHomMatrix;
+ class B2DPolyPolygon;
+ class B2DPoint;
+}
+
+namespace com { namespace sun { namespace star { namespace rendering
+{
+ class XSprite;
+} } } }
+
+
+/* Definition of Sprite class */
+
+namespace cppcanvas
+{
+
+ class Sprite
+ {
+ public:
+ virtual ~Sprite() {}
+
+ virtual void setAlpha( const double& rAlpha ) = 0;
+
+ /** Set the sprite position on screen
+
+ This method differs from the XSprite::move() insofar, as
+ no viewstate/renderstate transformations are applied to
+ the specified position. The given position is interpreted
+ in device coordinates (i.e. screen pixel)
+ */
+ virtual void movePixel( const ::basegfx::B2DPoint& rNewPos ) = 0;
+
+ /** Set the sprite position on screen
+
+ This method sets the sprite position in the view
+ coordinate system of the parent canvas
+ */
+ virtual void move( const ::basegfx::B2DPoint& rNewPos ) = 0;
+
+ virtual void transform( const ::basegfx::B2DHomMatrix& rMatrix ) = 0;
+
+ /** Set output clipping
+
+ This method differs from the XSprite::clip() insofar, as
+ no viewstate/renderstate transformations are applied to
+ the specified clip polygon. The given polygon is
+ interpreted in device coordinates (i.e. screen pixel)
+ */
+ virtual void setClipPixel( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0;
+
+ /** Set output clipping
+
+ This method applies the clip poly-polygon interpreted in
+ the view coordinate system of the parent canvas.
+ */
+ virtual void setClip( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0;
+
+ virtual void setClip() = 0;
+
+ virtual void show() = 0;
+ virtual void hide() = 0;
+
+ /** Change the sprite priority
+
+ @param fPriority
+ New sprite priority. The higher the priority, the further
+ towards the viewer the sprite appears. That is, sprites
+ with higher priority appear before ones with lower
+ priority.
+ */
+ virtual void setPriority( double fPriority ) = 0;
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XSprite > getUNOSprite() const = 0;
+ };
+
+ typedef ::boost::shared_ptr< ::cppcanvas::Sprite > SpriteSharedPtr;
+}
+
+#endif /* _CPPCANVAS_SPRITE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/spritecanvas.hxx b/include/cppcanvas/spritecanvas.hxx
new file mode 100644
index 000000000000..6a606b331edf
--- /dev/null
+++ b/include/cppcanvas/spritecanvas.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 _CPPCANVAS_SPRITECANVAS_HXX
+#define _CPPCANVAS_SPRITECANVAS_HXX
+
+#include <sal/types.h>
+#include <osl/diagnose.h>
+#include <basegfx/vector/b2dsize.hxx>
+
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+
+
+#include <cppcanvas/bitmapcanvas.hxx>
+#include <cppcanvas/sprite.hxx>
+#include <cppcanvas/customsprite.hxx>
+
+namespace com { namespace sun { namespace star { namespace rendering
+{
+ class XSpriteCanvas;
+} } } }
+
+
+/* Definition of SpriteCanvas */
+
+namespace cppcanvas
+{
+ class SpriteCanvas;
+
+ // forward declaration, since cloneSpriteCanvas() also references SpriteCanvas
+ typedef ::boost::shared_ptr< ::cppcanvas::SpriteCanvas > SpriteCanvasSharedPtr;
+
+ /** SpriteCanvas interface
+ */
+ class SpriteCanvas : public virtual BitmapCanvas, private boost::noncopyable
+ {
+ public:
+ virtual bool updateScreen( bool bUpdateAll ) const = 0;
+
+ virtual CustomSpriteSharedPtr createCustomSprite( const ::basegfx::B2DSize& ) const = 0;
+ virtual SpriteSharedPtr createClonedSprite( const SpriteSharedPtr& ) const = 0;
+
+ // shared_ptr does not allow for covariant return types
+ SpriteCanvasSharedPtr cloneSpriteCanvas() const
+ {
+ SpriteCanvasSharedPtr p( ::boost::dynamic_pointer_cast< SpriteCanvas >(this->clone()) );
+ OSL_ENSURE(p.get(), "SpriteCanvas::cloneSpriteCanvas(): dynamic cast failed");
+ return p;
+ }
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XSpriteCanvas > getUNOSpriteCanvas() const = 0;
+ };
+
+}
+
+#endif /* _CPPCANVAS_SPRITECANVAS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/text.hxx b/include/cppcanvas/text.hxx
new file mode 100644
index 000000000000..4ca53532c282
--- /dev/null
+++ b/include/cppcanvas/text.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 _CPPCANVAS_TEXT_HXX
+#define _CPPCANVAS_TEXT_HXX
+
+#include <boost/shared_ptr.hpp>
+#include <cppcanvas/canvasgraphic.hxx>
+
+
+
+
+/* Definition of Text interface */
+
+namespace cppcanvas
+{
+ class Text : public virtual CanvasGraphic
+ {
+ public:
+ virtual void setFont( const FontSharedPtr& ) = 0;
+ virtual FontSharedPtr getFont() = 0;
+ };
+
+ typedef ::boost::shared_ptr< ::cppcanvas::Text > TextSharedPtr;
+}
+
+#endif /* _CPPCANVAS_TEXT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cppcanvas/vclfactory.hxx b/include/cppcanvas/vclfactory.hxx
new file mode 100644
index 000000000000..b5d2f9612be9
--- /dev/null
+++ b/include/cppcanvas/vclfactory.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 _CPPCANVAS_VCLFACTORY_HXX
+#define _CPPCANVAS_VCLFACTORY_HXX
+
+#include <cppcanvas/canvas.hxx>
+#include <cppcanvas/bitmapcanvas.hxx>
+#include <cppcanvas/spritecanvas.hxx>
+#include <cppcanvas/polypolygon.hxx>
+#include <cppcanvas/bitmap.hxx>
+#include <cppcanvas/renderer.hxx>
+#include <cppcanvas/text.hxx>
+#include <cppcanvas/sprite.hxx>
+
+#include <cppcanvas/cppcanvasdllapi.h>
+
+class Window;
+class Bitmap;
+class BitmapEx;
+class Polygon;
+class PolyPolygon;
+class Size;
+class Graphic;
+class GDIMetaFile;
+class Animation;
+
+namespace com { namespace sun { namespace star { namespace rendering
+{
+ class XBitmapCanvas;
+ class XSpriteCanvas;
+} } } }
+
+/* Definition of VCLFactory class */
+
+namespace cppcanvas
+{
+ /** The VCLFactory creates Canvas objects for various VCL
+ OutputDevice primitives, such as windows, polygons, bitmaps
+ and metafiles.
+
+ Please note that the objects created for a specific Canvas can
+ only be drawn on exactly that canvas. You have to regenerate
+ them for different canvases.
+ */
+ class CPPCANVAS_DLLPUBLIC VCLFactory
+ {
+ public:
+ static VCLFactory& getInstance();
+
+ BitmapCanvasSharedPtr createCanvas( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XBitmapCanvas >& xCanvas );
+
+ SpriteCanvasSharedPtr createSpriteCanvas( const ::Window& rVCLWindow ) const;
+ SpriteCanvasSharedPtr createSpriteCanvas( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XSpriteCanvas >& xCanvas ) const;
+
+ /** Create a bitmap from a VCL Bitmap
+ */
+ BitmapSharedPtr createBitmap( const CanvasSharedPtr&, const ::BitmapEx& rBmpEx ) const;
+
+ /** Create a renderer object from a Metafile
+
+ The created renderer initially draws the metafile
+ one-by-one units large, in user coordinate space
+ */
+ RendererSharedPtr createRenderer( const CanvasSharedPtr& rCanvas,
+ const ::GDIMetaFile& rMtf,
+ const Renderer::Parameters& rParms ) const;
+
+ private:
+ friend struct InitInstance;
+
+ // singleton
+ VCLFactory();
+
+ // default: disabled copy/assignment
+ VCLFactory(const VCLFactory&);
+ VCLFactory& operator=( const VCLFactory& );
+ };
+
+}
+
+#endif /* _CPPCANVAS_VCLFACTORY_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/XShapeDumper.hxx b/include/drawinglayer/XShapeDumper.hxx
new file mode 100644
index 000000000000..a1cd59948362
--- /dev/null
+++ b/include/drawinglayer/XShapeDumper.hxx
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Artur Dorda <artur.dorda+libo@gmail.com> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/awt/Gradient.hpp>
+#include <com/sun/star/drawing/Hatch.hpp>
+#include <com/sun/star/awt/XBitmap.hpp>
+#include <com/sun/star/drawing/RectanglePoint.hpp>
+#include <com/sun/star/drawing/BitmapMode.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/drawing/LineDash.hpp>
+#include <com/sun/star/drawing/LineJoint.hpp>
+#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
+
+#include <com/sun/star/drawing/PolygonKind.hpp>
+
+#include <com/sun/star/drawing/TextFitToSizeType.hpp>
+#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
+#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
+#include <com/sun/star/drawing/TextAnimationDirection.hpp>
+#include <com/sun/star/drawing/TextAnimationKind.hpp>
+#include <com/sun/star/text/WritingMode.hpp>
+
+#include <com/sun/star/drawing/HomogenMatrixLine3.hpp>
+#include <com/sun/star/drawing/HomogenMatrix3.hpp>
+
+#include <com/sun/star/beans/PropertyValue.hpp>
+
+#ifndef XShapeDumper_hxx
+#define XShapeDumper_hxx
+
+class DRAWINGLAYER_DLLPUBLIC XShapeDumper
+{
+
+public:
+ XShapeDumper();
+ OUString dump(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> xPageShapes);
+
+};
+#endif
diff --git a/include/drawinglayer/animation/animationtiming.hxx b/include/drawinglayer/animation/animationtiming.hxx
new file mode 100644
index 000000000000..08ee95090f6c
--- /dev/null
+++ b/include/drawinglayer/animation/animationtiming.hxx
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX
+#define INCLUDED_DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace animation
+ {
+ //////////////////////////////////////////////////////////////////////////////
+
+ class DRAWINGLAYER_DLLPUBLIC AnimationEntry
+ {
+ private:
+ AnimationEntry(const AnimationEntry&);
+ AnimationEntry& operator=(const AnimationEntry& rCandidate);
+
+ public:
+ AnimationEntry();
+ virtual ~AnimationEntry();
+ virtual AnimationEntry* clone() const = 0;
+
+ virtual bool operator==(const AnimationEntry& rCandidate) const = 0;
+ virtual double getDuration() const = 0;
+ virtual double getStateAtTime(double fTime) const = 0;
+ virtual double getNextEventTime(double fTime) const = 0;
+ };
+
+ //////////////////////////////////////////////////////////////////////////////
+
+ class DRAWINGLAYER_DLLPUBLIC AnimationEntryFixed : public AnimationEntry
+ {
+ protected:
+ double mfDuration;
+ double mfState;
+
+ public:
+ AnimationEntryFixed(double fDuration, double fState = 0.0);
+ virtual ~AnimationEntryFixed();
+ virtual AnimationEntry* clone() const;
+
+ virtual bool operator==(const AnimationEntry& rCandidate) const;
+ virtual double getDuration() const;
+ virtual double getStateAtTime(double fTime) const;
+ virtual double getNextEventTime(double fTime) const;
+ };
+
+ //////////////////////////////////////////////////////////////////////////////
+
+ class DRAWINGLAYER_DLLPUBLIC AnimationEntryLinear : public AnimationEntry
+ {
+ protected:
+ double mfDuration;
+ double mfFrequency;
+ double mfStart;
+ double mfStop;
+
+ public:
+ AnimationEntryLinear(double fDuration, double fFrequency = 250.0, double fStart = 0.0, double fStop = 1.0);
+ virtual ~AnimationEntryLinear();
+ virtual AnimationEntry* clone() const;
+
+ virtual bool operator==(const AnimationEntry& rCandidate) const;
+ virtual double getDuration() const;
+ virtual double getStateAtTime(double fTime) const;
+ virtual double getNextEventTime(double fTime) const;
+ };
+
+ //////////////////////////////////////////////////////////////////////////////
+
+ class DRAWINGLAYER_DLLPUBLIC AnimationEntryList : public AnimationEntry
+ {
+ protected:
+ double mfDuration;
+ ::std::vector< AnimationEntry* > maEntries;
+
+ // helpers
+ sal_uInt32 impGetIndexAtTime(double fTime, double &rfAddedTime) const;
+
+ public:
+ AnimationEntryList();
+ virtual ~AnimationEntryList();
+ virtual AnimationEntry* clone() const;
+
+ virtual bool operator==(const AnimationEntry& rCandidate) const;
+ void append(const AnimationEntry& rCandidate);
+ virtual double getDuration() const;
+ virtual double getStateAtTime(double fTime) const;
+ virtual double getNextEventTime(double fTime) const;
+ };
+
+ //////////////////////////////////////////////////////////////////////////////
+
+ class DRAWINGLAYER_DLLPUBLIC AnimationEntryLoop : public AnimationEntryList
+ {
+ protected:
+ sal_uInt32 mnRepeat;
+
+ public:
+ AnimationEntryLoop(sal_uInt32 nRepeat = 0xffffffff);
+ virtual ~AnimationEntryLoop();
+ virtual AnimationEntry* clone() const;
+
+ virtual bool operator==(const AnimationEntry& rCandidate) const;
+ virtual double getDuration() const;
+ virtual double getStateAtTime(double fTime) const;
+ virtual double getNextEventTime(double fTime) const;
+ };
+
+ //////////////////////////////////////////////////////////////////////////////
+ } // end of namespace animation
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/fillbitmapattribute.hxx b/include/drawinglayer/attribute/fillbitmapattribute.hxx
new file mode 100644
index 000000000000..851dc5ed0697
--- /dev/null
+++ b/include/drawinglayer/attribute/fillbitmapattribute.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_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+class BitmapEx;
+
+namespace basegfx {
+ class B2DPoint;
+ class B2DVector;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpFillBitmapAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC FillBitmapAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpFillBitmapAttribute > ImplType;
+
+ private:
+ ImplType mpFillBitmapAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ FillBitmapAttribute(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rTopLeft,
+ const basegfx::B2DVector& rSize,
+ bool bTiling);
+ FillBitmapAttribute(const FillBitmapAttribute& rCandidate);
+ FillBitmapAttribute& operator=(const FillBitmapAttribute& rCandidate);
+ ~FillBitmapAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const FillBitmapAttribute& rCandidate) const;
+
+ // data read access
+ const BitmapEx& getBitmapEx() const;
+ const basegfx::B2DPoint& getTopLeft() const;
+ const basegfx::B2DVector& getSize() const;
+ bool getTiling() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/fillgradientattribute.hxx b/include/drawinglayer/attribute/fillgradientattribute.hxx
new file mode 100644
index 000000000000..e791193651a0
--- /dev/null
+++ b/include/drawinglayer/attribute/fillgradientattribute.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_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpFillGradientAttribute;
+}}
+
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ enum GradientStyle
+ {
+ GRADIENTSTYLE_LINEAR,
+ GRADIENTSTYLE_AXIAL,
+ GRADIENTSTYLE_RADIAL,
+ GRADIENTSTYLE_ELLIPTICAL,
+ GRADIENTSTYLE_SQUARE,
+ GRADIENTSTYLE_RECT
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC FillGradientAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpFillGradientAttribute > ImplType;
+
+ private:
+ ImplType mpFillGradientAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ FillGradientAttribute(
+ GradientStyle eStyle,
+ double fBorder,
+ double fOffsetX,
+ double fOffsetY,
+ double fAngle,
+ const basegfx::BColor& rStartColor,
+ const basegfx::BColor& rEndColor,
+ sal_uInt16 nSteps);
+ FillGradientAttribute();
+ FillGradientAttribute(const FillGradientAttribute& rCandidate);
+ FillGradientAttribute& operator=(const FillGradientAttribute& rCandidate);
+ ~FillGradientAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const FillGradientAttribute& rCandidate) const;
+
+ // data read access
+ GradientStyle getStyle() const;
+ double getBorder() const;
+ double getOffsetX() const;
+ double getOffsetY() const;
+ double getAngle() const;
+ const basegfx::BColor& getStartColor() const;
+ const basegfx::BColor& getEndColor() const;
+ sal_uInt16 getSteps() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/fillhatchattribute.hxx b/include/drawinglayer/attribute/fillhatchattribute.hxx
new file mode 100644
index 000000000000..7e6244be090b
--- /dev/null
+++ b/include/drawinglayer/attribute/fillhatchattribute.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_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpFillHatchAttribute;
+}}
+
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ enum HatchStyle
+ {
+ HATCHSTYLE_SINGLE,
+ HATCHSTYLE_DOUBLE,
+ HATCHSTYLE_TRIPLE
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC FillHatchAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpFillHatchAttribute > ImplType;
+
+ private:
+ ImplType mpFillHatchAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ FillHatchAttribute(
+ HatchStyle eStyle,
+ double fDistance,
+ double fAngle,
+ const basegfx::BColor& rColor,
+ bool bFillBackground);
+ FillHatchAttribute();
+ FillHatchAttribute(const FillHatchAttribute& rCandidate);
+ FillHatchAttribute& operator=(const FillHatchAttribute& rCandidate);
+ ~FillHatchAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const FillHatchAttribute& rCandidate) const;
+
+ // data read access
+ HatchStyle getStyle() const;
+ double getDistance() const;
+ double getAngle() const;
+ const basegfx::BColor& getColor() const;
+ bool isFillBackground() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/fontattribute.hxx b/include/drawinglayer/attribute/fontattribute.hxx
new file mode 100644
index 000000000000..b49ab83b300e
--- /dev/null
+++ b/include/drawinglayer/attribute/fontattribute.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_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+class String;
+
+namespace drawinglayer { namespace attribute {
+ class ImpFontAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ /** FontAttribute class
+
+ This attribute class is able to hold all parameters needed/used
+ to completely define the parametrisation of a text portion.
+ */
+ class DRAWINGLAYER_DLLPUBLIC FontAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpFontAttribute > ImplType;
+
+ private:
+ ImplType mpFontAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ /// TODO: pair kerning and CJK kerning
+ FontAttribute(
+ const String& rFamilyName,
+ const String& rStyleName,
+ sal_uInt16 nWeight,
+ bool bSymbol = false,
+ bool bVertical = false,
+ bool bItalic = false,
+ bool bMonospaced = false,
+ bool bOutline = false,
+ bool bRTL = false,
+ bool bBiDiStrong = false);
+ FontAttribute();
+ FontAttribute(const FontAttribute& rCandidate);
+ FontAttribute& operator=(const FontAttribute& rCandidate);
+ ~FontAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const FontAttribute& rCandidate) const;
+
+ /// data read access
+ const String& getFamilyName() const;
+ const String& getStyleName() const;
+ sal_uInt16 getWeight() const;
+ bool getSymbol() const;
+ bool getVertical() const;
+ bool getItalic() const;
+ bool getOutline() const;
+ bool getRTL() const;
+ bool getBiDiStrong() const;
+ bool getMonospaced() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/lineattribute.hxx b/include/drawinglayer/attribute/lineattribute.hxx
new file mode 100644
index 000000000000..58eb987714e3
--- /dev/null
+++ b/include/drawinglayer/attribute/lineattribute.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_DRAWINGLAYER_ATTRIBUTE_LINEATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINEATTRIBUTE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <basegfx/vector/b2enums.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpLineAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC LineAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpLineAttribute > ImplType;
+
+ private:
+ ImplType mpLineAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ explicit LineAttribute(
+ const basegfx::BColor& rColor,
+ double fWidth = 0.0,
+ basegfx::B2DLineJoin aB2DLineJoin = basegfx::B2DLINEJOIN_ROUND,
+ com::sun::star::drawing::LineCap aLineCap = com::sun::star::drawing::LineCap_BUTT);
+ LineAttribute();
+ LineAttribute(const LineAttribute& rCandidate);
+ LineAttribute& operator=(const LineAttribute& rCandidate);
+ ~LineAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const LineAttribute& rCandidate) const;
+
+ // data read access
+ const basegfx::BColor& getColor() const;
+ double getWidth() const;
+ basegfx::B2DLineJoin getLineJoin() const;
+ com::sun::star::drawing::LineCap getLineCap() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINEATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/linestartendattribute.hxx b/include/drawinglayer/attribute/linestartendattribute.hxx
new file mode 100644
index 000000000000..e02d3565aaf7
--- /dev/null
+++ b/include/drawinglayer/attribute/linestartendattribute.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINESTARTENDATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINESTARTENDATTRIBUTE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class B2DPolyPolygon;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpLineStartEndAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC LineStartEndAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpLineStartEndAttribute > ImplType;
+
+ private:
+ ImplType mpLineStartEndAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ LineStartEndAttribute(
+ double fWidth,
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ bool bCentered);
+ LineStartEndAttribute();
+ LineStartEndAttribute(const LineStartEndAttribute& rCandidate);
+ LineStartEndAttribute& operator=(const LineStartEndAttribute& rCandidate);
+ ~LineStartEndAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const LineStartEndAttribute& rCandidate) const;
+
+ // data read access
+ double getWidth() const;
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const;
+ bool isCentered() const;
+ bool isActive() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINESTARTENDATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/materialattribute3d.hxx b/include/drawinglayer/attribute/materialattribute3d.hxx
new file mode 100644
index 000000000000..9c4d34dce155
--- /dev/null
+++ b/include/drawinglayer/attribute/materialattribute3d.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_DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace attribute {
+ class ImpMaterialAttribute3D;
+}}
+
+namespace basegfx {
+ class BColor;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC MaterialAttribute3D
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpMaterialAttribute3D > ImplType;
+
+ private:
+ ImplType mpMaterialAttribute3D;
+
+ public:
+ // constructors/destructor
+ MaterialAttribute3D(
+ const basegfx::BColor& rColor,
+ const basegfx::BColor& rSpecular,
+ const basegfx::BColor& rEmission,
+ sal_uInt16 nSpecularIntensity);
+ MaterialAttribute3D(const basegfx::BColor& rColor);
+ MaterialAttribute3D();
+ MaterialAttribute3D(const MaterialAttribute3D& rCandidate);
+ ~MaterialAttribute3D();
+
+ // assignment operator
+ MaterialAttribute3D& operator=(const MaterialAttribute3D& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const MaterialAttribute3D& rCandidate) const;
+
+ // data read access
+ const basegfx::BColor& getColor() const;
+ const basegfx::BColor& getSpecular() const;
+ const basegfx::BColor& getEmission() const;
+ sal_uInt16 getSpecularIntensity() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_MATERIALATTRIBUTE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/sdrallattribute3d.hxx b/include/drawinglayer/attribute/sdrallattribute3d.hxx
new file mode 100644
index 000000000000..abd46bf273fe
--- /dev/null
+++ b/include/drawinglayer/attribute/sdrallattribute3d.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_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC SdrLineFillShadowAttribute3D
+ {
+ private:
+ const SdrLineAttribute maLine;
+ const SdrFillAttribute maFill;
+ const SdrLineStartEndAttribute maLineStartEnd;
+ const SdrShadowAttribute maShadow;
+ const FillGradientAttribute maFillFloatTransGradient;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrLineFillShadowAttribute3D(
+ const SdrLineAttribute& rLine,
+ const SdrFillAttribute& rFill,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const FillGradientAttribute& rFillFloatTransGradient);
+ SdrLineFillShadowAttribute3D();
+
+ // compare operator
+ bool operator==(const SdrLineFillShadowAttribute3D& rCandidate) const;
+
+ // data read access
+ const SdrLineAttribute& getLine() const { return maLine; }
+ const SdrFillAttribute& getFill() const { return maFill; }
+ const SdrLineStartEndAttribute& getLineStartEnd() const { return maLineStartEnd; }
+ const SdrShadowAttribute& getShadow() const { return maShadow; }
+ const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; }
+ };
+ } // end of namespace overlay
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/sdrfillattribute.hxx b/include/drawinglayer/attribute/sdrfillattribute.hxx
new file mode 100644
index 000000000000..7fd3d38c224e
--- /dev/null
+++ b/include/drawinglayer/attribute/sdrfillattribute.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_DRAWINGLAYER_ATTRIBUTE_SDRFILLATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLATTRIBUTE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrFillAttribute;
+ class FillGradientAttribute;
+ class FillHatchAttribute;
+ class SdrFillBitmapAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC SdrFillAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpSdrFillAttribute > ImplType;
+
+ private:
+ ImplType mpSdrFillAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrFillAttribute(
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const FillGradientAttribute& rGradient,
+ const FillHatchAttribute& rHatch,
+ const SdrFillBitmapAttribute& rBitmap);
+ SdrFillAttribute();
+ SdrFillAttribute(const SdrFillAttribute& rCandidate);
+ SdrFillAttribute& operator=(const SdrFillAttribute& rCandidate);
+ ~SdrFillAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrFillAttribute& rCandidate) const;
+
+ // data read access
+ double getTransparence() const;
+ const basegfx::BColor& getColor() const;
+ const FillGradientAttribute& getGradient() const;
+ const FillHatchAttribute& getHatch() const;
+ const SdrFillBitmapAttribute& getBitmap() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/sdrfillbitmapattribute.hxx b/include/drawinglayer/attribute/sdrfillbitmapattribute.hxx
new file mode 100644
index 000000000000..78417f3577c9
--- /dev/null
+++ b/include/drawinglayer/attribute/sdrfillbitmapattribute.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+class BitmapEx;
+
+namespace basegfx {
+ class B2DRange;
+ class B2DVector;
+}
+
+namespace drawinglayer { namespace attribute {
+ class FillBitmapAttribute;
+ class ImpSdrFillBitmapAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC SdrFillBitmapAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpSdrFillBitmapAttribute > ImplType;
+
+ private:
+ ImplType mpSdrFillBitmapAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrFillBitmapAttribute(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DVector& rSize,
+ const basegfx::B2DVector& rOffset,
+ const basegfx::B2DVector& rOffsetPosition,
+ const basegfx::B2DVector& rRectPoint,
+ bool bTiling,
+ bool bStretch,
+ bool bLogSize);
+ SdrFillBitmapAttribute();
+ SdrFillBitmapAttribute(const SdrFillBitmapAttribute& rCandidate);
+ SdrFillBitmapAttribute& operator=(const SdrFillBitmapAttribute& rCandidate);
+ ~SdrFillBitmapAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrFillBitmapAttribute& rCandidate) const;
+
+ // data read access
+ const BitmapEx& getBitmapEx() const;
+ const basegfx::B2DVector& getSize() const;
+ const basegfx::B2DVector& getOffset() const;
+ const basegfx::B2DVector& getOffsetPosition() const;
+ const basegfx::B2DVector& getRectPoint() const;
+ bool getTiling() const;
+ bool getStretch() const;
+
+ // FillBitmapAttribute generator
+ FillBitmapAttribute getFillBitmapAttribute(const basegfx::B2DRange& rRange) const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/sdrlightattribute3d.hxx b/include/drawinglayer/attribute/sdrlightattribute3d.hxx
new file mode 100644
index 000000000000..f9e35798cd3e
--- /dev/null
+++ b/include/drawinglayer/attribute/sdrlightattribute3d.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_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+ class B3DVector;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdr3DLightAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC Sdr3DLightAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpSdr3DLightAttribute > ImplType;
+
+ private:
+ ImplType mpSdr3DLightAttribute;
+
+ public:
+ // constructors/destructor
+ Sdr3DLightAttribute(
+ const basegfx::BColor& rColor,
+ const basegfx::B3DVector& rDirection,
+ bool bSpecular);
+ explicit Sdr3DLightAttribute(const basegfx::BColor& rColor);
+ Sdr3DLightAttribute(const Sdr3DLightAttribute& rCandidate);
+ ~Sdr3DLightAttribute();
+
+ // assignment operator
+ Sdr3DLightAttribute& operator=(const Sdr3DLightAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const Sdr3DLightAttribute& rCandidate) const;
+
+ // data read access
+ const basegfx::BColor& getColor() const;
+ const basegfx::B3DVector& getDirection() const;
+ bool getSpecular() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/sdrlightingattribute3d.hxx b/include/drawinglayer/attribute/sdrlightingattribute3d.hxx
new file mode 100644
index 000000000000..0c3bb96b9f70
--- /dev/null
+++ b/include/drawinglayer/attribute/sdrlightingattribute3d.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_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTINGATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTINGATTRIBUTE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+ class B3DVector;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrLightingAttribute;
+ class Sdr3DLightAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC SdrLightingAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpSdrLightingAttribute > ImplType;
+
+ private:
+ ImplType mpSdrLightingAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrLightingAttribute(
+ const basegfx::BColor& rAmbientLight,
+ const ::std::vector< Sdr3DLightAttribute >& rLightVector);
+ SdrLightingAttribute();
+ SdrLightingAttribute(const SdrLightingAttribute& rCandidate);
+ SdrLightingAttribute& operator=(const SdrLightingAttribute& rCandidate);
+ ~SdrLightingAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLightingAttribute& rCandidate) const;
+
+ // data read access
+ const ::std::vector< Sdr3DLightAttribute >& getLightVector() const;
+
+ // color model solver
+ basegfx::BColor solveColorModel(
+ const basegfx::B3DVector& rNormalInEyeCoordinates,
+ const basegfx::BColor& rColor, const basegfx::BColor& rSpecular,
+ const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTINGATTRIBUTE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/sdrlineattribute.hxx b/include/drawinglayer/attribute/sdrlineattribute.hxx
new file mode 100644
index 000000000000..bedbd9f29bb9
--- /dev/null
+++ b/include/drawinglayer/attribute/sdrlineattribute.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_DRAWINGLAYER_ATTRIBUTE_SDRLINEATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINEATTRIBUTE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <basegfx/vector/b2enums.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
+#include <o3tl/cow_wrapper.hxx>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrLineAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC SdrLineAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpSdrLineAttribute > ImplType;
+
+ private:
+ ImplType mpSdrLineAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrLineAttribute(
+ basegfx::B2DLineJoin eJoin,
+ double fWidth,
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ com::sun::star::drawing::LineCap eCap,
+ const ::std::vector< double >& rDotDashArray,
+ double fFullDotDashLen);
+ SdrLineAttribute();
+ SdrLineAttribute(const SdrLineAttribute& rCandidate);
+ SdrLineAttribute& operator=(const SdrLineAttribute& rCandidate);
+ ~SdrLineAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLineAttribute& rCandidate) const;
+
+ // data access
+ basegfx::B2DLineJoin getJoin() const;
+ double getWidth() const;
+ double getTransparence() const;
+ const basegfx::BColor& getColor() const;
+ const ::std::vector< double >& getDotDashArray() const;
+ double getFullDotDashLen() const;
+ com::sun::star::drawing::LineCap getCap() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINEATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/sdrlinestartendattribute.hxx b/include/drawinglayer/attribute/sdrlinestartendattribute.hxx
new file mode 100644
index 000000000000..19c1a5147db0
--- /dev/null
+++ b/include/drawinglayer/attribute/sdrlinestartendattribute.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINESTARTENDATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINESTARTENDATTRIBUTE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class B2DPolyPolygon;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrLineStartEndAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC SdrLineStartEndAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpSdrLineStartEndAttribute > ImplType;
+
+ private:
+ ImplType mpSdrLineStartEndAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrLineStartEndAttribute(
+ const basegfx::B2DPolyPolygon& rStartPolyPolygon,
+ const basegfx::B2DPolyPolygon& rEndPolyPolygon,
+ double fStartWidth,
+ double fEndWidth,
+ bool bStartActive,
+ bool bEndActive,
+ bool bStartCentered,
+ bool bEndCentered);
+ SdrLineStartEndAttribute();
+ SdrLineStartEndAttribute(const SdrLineStartEndAttribute& rCandidate);
+ SdrLineStartEndAttribute& operator=(const SdrLineStartEndAttribute& rCandidate);
+ ~SdrLineStartEndAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLineStartEndAttribute& rCandidate) const;
+
+ // data read access
+ const basegfx::B2DPolyPolygon& getStartPolyPolygon() const;
+ const basegfx::B2DPolyPolygon& getEndPolyPolygon() const;
+ double getStartWidth() const;
+ double getEndWidth() const;
+ bool isStartActive() const;
+ bool isEndActive() const;
+ bool isStartCentered() const;
+ bool isEndCentered() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINESTARTENDATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/sdrobjectattribute3d.hxx b/include/drawinglayer/attribute/sdrobjectattribute3d.hxx
new file mode 100644
index 000000000000..860093a67666
--- /dev/null
+++ b/include/drawinglayer/attribute/sdrobjectattribute3d.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_DRAWINGLAYER_ATTRIBUTE_SDROBJECTATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDROBJECTATTRIBUTE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <com/sun/star/drawing/NormalsKind.hpp>
+#include <com/sun/star/drawing/TextureProjectionMode.hpp>
+#include <com/sun/star/drawing/TextureKind2.hpp>
+#include <com/sun/star/drawing/TextureMode.hpp>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdr3DObjectAttribute;
+ class MaterialAttribute3D;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC Sdr3DObjectAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpSdr3DObjectAttribute > ImplType;
+
+ private:
+ ImplType mpSdr3DObjectAttribute;
+
+ public:
+ // constructors/destructor
+ Sdr3DObjectAttribute(
+ ::com::sun::star::drawing::NormalsKind aNormalsKind,
+ ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX,
+ ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY,
+ ::com::sun::star::drawing::TextureKind2 aTextureKind,
+ ::com::sun::star::drawing::TextureMode aTextureMode,
+ const MaterialAttribute3D& rMaterial,
+ bool bNormalsInvert,
+ bool bDoubleSided,
+ bool bShadow3D,
+ bool bTextureFilter,
+ bool bReducedLineGeometry);
+ Sdr3DObjectAttribute(const Sdr3DObjectAttribute& rCandidate);
+ ~Sdr3DObjectAttribute();
+
+ // assignment operator
+ Sdr3DObjectAttribute& operator=(const Sdr3DObjectAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const Sdr3DObjectAttribute& rCandidate) const;
+
+ // data read access
+ ::com::sun::star::drawing::NormalsKind getNormalsKind() const;
+ ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionX() const;
+ ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionY() const;
+ ::com::sun::star::drawing::TextureKind2 getTextureKind() const;
+ ::com::sun::star::drawing::TextureMode getTextureMode() const;
+ const MaterialAttribute3D& getMaterial() const;
+ bool getNormalsInvert() const;
+ bool getDoubleSided() const;
+ bool getShadow3D() const;
+ bool getTextureFilter() const;
+ bool getReducedLineGeometry() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDROBJECTATTRIBUTE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/sdrsceneattribute3d.hxx b/include/drawinglayer/attribute/sdrsceneattribute3d.hxx
new file mode 100644
index 000000000000..61d4d8a67378
--- /dev/null
+++ b/include/drawinglayer/attribute/sdrsceneattribute3d.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_DRAWINGLAYER_ATTRIBUTE_SDRSCENEATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSCENEATTRIBUTE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <com/sun/star/drawing/ProjectionMode.hpp>
+#include <com/sun/star/drawing/ShadeMode.hpp>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrSceneAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC SdrSceneAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpSdrSceneAttribute > ImplType;
+
+ private:
+ ImplType mpSdrSceneAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrSceneAttribute(
+ double fDistance,
+ double fShadowSlant,
+ ::com::sun::star::drawing::ProjectionMode aProjectionMode,
+ ::com::sun::star::drawing::ShadeMode aShadeMode,
+ bool bTwoSidedLighting);
+ SdrSceneAttribute();
+ SdrSceneAttribute(const SdrSceneAttribute& rCandidate);
+ SdrSceneAttribute& operator=(const SdrSceneAttribute& rCandidate);
+ ~SdrSceneAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrSceneAttribute& rCandidate) const;
+
+ // data read access
+ double getShadowSlant() const;
+ ::com::sun::star::drawing::ProjectionMode getProjectionMode() const;
+ ::com::sun::star::drawing::ShadeMode getShadeMode() const;
+ bool getTwoSidedLighting() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSCENEATTRIBUTE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/sdrshadowattribute.hxx b/include/drawinglayer/attribute/sdrshadowattribute.hxx
new file mode 100644
index 000000000000..ee1f36292505
--- /dev/null
+++ b/include/drawinglayer/attribute/sdrshadowattribute.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+ class B2DVector;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrShadowAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC SdrShadowAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpSdrShadowAttribute > ImplType;
+
+ private:
+ ImplType mpSdrShadowAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrShadowAttribute(
+ const basegfx::B2DVector& rOffset,
+ double fTransparence,
+ const basegfx::BColor& rColor);
+ SdrShadowAttribute();
+ SdrShadowAttribute(const SdrShadowAttribute& rCandidate);
+ SdrShadowAttribute& operator=(const SdrShadowAttribute& rCandidate);
+ ~SdrShadowAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrShadowAttribute& rCandidate) const;
+
+ // data access
+ const basegfx::B2DVector& getOffset() const;
+ double getTransparence() const;
+ const basegfx::BColor& getColor() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/strokeattribute.hxx b/include/drawinglayer/attribute/strokeattribute.hxx
new file mode 100644
index 000000000000..6d4cea978482
--- /dev/null
+++ b/include/drawinglayer/attribute/strokeattribute.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_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <o3tl/cow_wrapper.hxx>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace attribute {
+ class ImpStrokeAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class DRAWINGLAYER_DLLPUBLIC StrokeAttribute
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpStrokeAttribute > ImplType;
+
+ private:
+ ImplType mpStrokeAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ explicit StrokeAttribute(
+ const ::std::vector< double >& rDotDashArray,
+ double fFullDotDashLen = 0.0);
+ StrokeAttribute();
+ StrokeAttribute(const StrokeAttribute& rCandidate);
+ StrokeAttribute& operator=(const StrokeAttribute& rCandidate);
+ ~StrokeAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const StrokeAttribute& rCandidate) const;
+
+ // data read access
+ const ::std::vector< double >& getDotDashArray() const;
+ double getFullDotDashLen() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/drawinglayerdllapi.h b/include/drawinglayer/drawinglayerdllapi.h
new file mode 100644
index 000000000000..0b3983504919
--- /dev/null
+++ b/include/drawinglayer/drawinglayerdllapi.h
@@ -0,0 +1,24 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_DRAWINGLAYER_DRAWINGLAYERDLLAPI_H
+#define INCLUDED_DRAWINGLAYER_DRAWINGLAYERDLLAPI_H
+
+#include <sal/types.h>
+
+#if defined(DRAWINGLAYER_DLLIMPLEMENTATION)
+#define DRAWINGLAYER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define DRAWINGLAYER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define DRAWINGLAYER_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx b/include/drawinglayer/geometry/viewinformation2d.hxx
new file mode 100644
index 000000000000..f8e0d6699448
--- /dev/null
+++ b/include/drawinglayer/geometry/viewinformation2d.hxx
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
+#define INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+// the solaris compiler defines 'sun' as '1'. To avoid that (and to allow
+// pre-declarations of com/sun/star namespace), include sal/config.h here
+// where sun is redefined as 'sun' (so i guess the problem is known).
+#include <sal/config.h>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace geometry {
+ class ImpViewInformation2D;
+}}
+
+namespace basegfx {
+ class B2DHomMatrix;
+ class B2DRange;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace geometry
+ {
+ /** ViewInformation2D class
+
+ This class holds all view-relevant information for a 2d geometry. It works
+ together with UNO API definitions and supports holding a sequence of PropertyValues.
+ The most used data is for convenience offered directly using basegfx tooling classes.
+ It is an implementation to support the sequence of PropertyValues used in a
+ ::com::sun::star::graphic::XPrimitive2D for C++ implementations working with those
+ */
+ class DRAWINGLAYER_DLLPUBLIC ViewInformation2D
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpViewInformation2D, o3tl::ThreadSafeRefCountingPolicy > ImplType;
+
+ private:
+ /// pointer to private implementation class
+ ImplType mpViewInformation2D;
+
+ public:
+ /** Constructor: Create a ViewInformation2D
+
+ @param rObjectTransformation
+ The Transformation from Object to World coordinates (normally logic coordinates).
+
+ @param rViewTransformation
+ The Transformation from World to View coordinates (normally logic coordinates
+ to discrete units, e.g. pixels).
+
+ @param rViewport
+ The visible part of the view in World coordinates. If empty (getViewport().isEmpty())
+ everything is visible. The data is in World coordinates.
+
+ @param rxDrawPage
+ The currently displaqyed page. This information is needed e.g. due to existing PageNumber
+ fields which need to be interpreted.
+
+ @param fViewTime
+ The time the view is defined for. Default is 0.0. This parameter is used e.g. for
+ animated objects
+
+ @param rExtendedParameters
+ A sequence of property values which allows holding various other parameters besides
+ the obvious and needed ones above. For this constructor none of the other parameters
+ should be added as data. The constructor will parse the given parameters and if
+ data for the other parameters is given, the value in rExtendedParameters will
+ be preferred and overwrite the given parameter
+ */
+ ViewInformation2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ const basegfx::B2DHomMatrix& rViewTransformation,
+ const basegfx::B2DRange& rViewport,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage,
+ double fViewTime,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rExtendedParameters);
+
+ /** Constructor: Create a ViewInformation2D
+
+ @param rViewParameters
+ A sequence of property values which allows holding any combination of local and various
+ other parameters. This constructor is feeded completely with a sequence of PropertyValues
+ which will be parsed to be able to offer the most used ones in a convenient way.
+ */
+ explicit ViewInformation2D(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters);
+
+ /// default (empty) constructor
+ ViewInformation2D();
+
+ /// copy constructor
+ ViewInformation2D(const ViewInformation2D& rCandidate);
+
+ /// destructor
+ ~ViewInformation2D();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ /// assignment operator
+ ViewInformation2D& operator=(const ViewInformation2D& rCandidate);
+
+ /// compare operators
+ bool operator==(const ViewInformation2D& rCandidate) const;
+ bool operator!=(const ViewInformation2D& rCandidate) const { return !operator==(rCandidate); }
+
+ /// data access
+ const basegfx::B2DHomMatrix& getObjectTransformation() const;
+ const basegfx::B2DHomMatrix& getViewTransformation() const;
+ const basegfx::B2DRange& getViewport() const;
+ double getViewTime() const;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& getVisualizedPage() const;
+
+ /// On-demand prepared Object to View transformation and it's inerse for convenience
+ const basegfx::B2DHomMatrix& getObjectToViewTransformation() const;
+ const basegfx::B2DHomMatrix& getInverseObjectToViewTransformation() const;
+
+ /// On-demand prepared Viewport in discrete units for convenience
+ const basegfx::B2DRange& getDiscreteViewport() const;
+
+ /** support reduced DisplayQuality, PropertyName is 'ReducedDisplayQuality'. This
+ is used e.g. to allow to lower display quality for OverlayPrimitives and
+ may lead to simpler decompositions in the local create2DDecomposition
+ implementations of the primitives
+ */
+ bool getReducedDisplayQuality() const;
+
+ /** Get the uno::Sequence< beans::PropertyValue > which contains all ViewInformation
+
+ Use this call if You need to extract all contained ViewInformation. The ones
+ directly supported for convenience will be added to the ones only available
+ as PropertyValues. This set completely describes this ViewInformation2D and
+ can be used for complete information transport over UNO API.
+ */
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& getViewInformationSequence() const;
+
+ /** Get the uno::Sequence< beans::PropertyValue > which contains only ViewInformation
+ not offered directly
+
+ Use this call if You only need ViewInformation which is not offered conveniently,
+ but only exists as PropertyValue. This is e.g. used to create partially updated
+ incarnations of ViewInformation2D without losing the only with PropertyValues
+ defined data. It does not contain a complete description.
+ */
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& getExtendedInformationSequence() const;
+ };
+ } // end of namespace geometry
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/geometry/viewinformation3d.hxx b/include/drawinglayer/geometry/viewinformation3d.hxx
new file mode 100644
index 000000000000..86c9a2c16296
--- /dev/null
+++ b/include/drawinglayer/geometry/viewinformation3d.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_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION3D_HXX
+#define INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+// the solaris compiler defines 'sun' as '1'. To avoid that (and to allow
+// pre-declarations of com/sun/star namespace), include sal/config.h here
+// where sun is redefined as 'sun' (so i guess the problem is known).
+#include <sal/config.h>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <o3tl/cow_wrapper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace geometry {
+ class ImpViewInformation3D;
+}}
+
+namespace basegfx {
+ class B3DHomMatrix;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace geometry
+ {
+ /** ViewInformation3D class
+
+ This class holds all view-relevant information for a 3d geometry. It works
+ together with UNO API definitions and supports holding a sequence of PropertyValues.
+ The most used data is for convenience offered directly using basegfx tooling classes.
+ It is an implementation to support the sequence of PropertyValues used in a
+ ::com::sun::star::graphic::XPrimitive3D for C++ implementations working with those
+ */
+ class DRAWINGLAYER_DLLPUBLIC ViewInformation3D
+ {
+ public:
+ typedef o3tl::cow_wrapper< ImpViewInformation3D, o3tl::ThreadSafeRefCountingPolicy > ImplType;
+
+ private:
+ /// pointer to private implementation class
+ ImplType mpViewInformation3D;
+
+ public:
+ /** Constructor: Create a ViewInformation3D
+
+ @param rObjectTransformation
+ The Transformation from Object to World coordinates (normally logic coordinates).
+
+ @param rOrientation
+ A part of the 3D ViewTransformation, the World to Camera coordinates transformation
+ which holds the camera coordinate system.
+
+ @param rProjection
+ A part of the 3D ViewTransformation, the Camera to Device transformation which
+ transforms coordinates to a [0.0 .. 1.0] device range in X,Y and Z. Z may be used
+ as source for for Z-Buffers. This transformation may be e.g. a parallell projection,
+ but also a perspective one and thus may use the last line of the matrix.
+
+ @param rDeviceToView
+ A part of the 3D ViewTransformation, the Device to View transformation which normally
+ translates and scales from [0.0 .. 1.0] range in X,Y and Z to discrete position and
+ size.
+
+ rOrientation, rProjection and rDeviceToView define the 3D transformation pipeline
+ and are normally used multiplied together to have a direct transformation from
+ World to View coordinates
+
+ @param fViewTime
+ The time the view is defined for. Default is 0.0. This parameter is used e.g. for
+ animated objects
+
+ @param rExtendedParameters
+ A sequence of property values which allows holding various other parameters besides
+ the obvious and needed ones above. For this constructor none of the other parameters
+ should be added as data. The constructor will parse the given parameters and if
+ data for the other parameters is given, the value in rExtendedParameters will
+ be preferred and overwrite the given parameter
+ */
+ ViewInformation3D(
+ const basegfx::B3DHomMatrix& rObjectTransformation,
+ const basegfx::B3DHomMatrix& rOrientation,
+ const basegfx::B3DHomMatrix& rProjection,
+ const basegfx::B3DHomMatrix& rDeviceToView,
+ double fViewTime,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rExtendedParameters);
+
+ /** Constructor: Create a ViewInformation3D
+
+ @param rViewParameters
+ A sequence of property values which allows holding any combination of local and various
+ other parameters. This constructor is feeded completely with a sequence of PropertyValues
+ which will be parsed to be able to offer the most used ones in a convenient way.
+ */
+ explicit ViewInformation3D(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters);
+
+ /// default (empty) constructor
+ ViewInformation3D();
+
+ /// copy constructor
+ ViewInformation3D(const ViewInformation3D& rCandidate);
+
+ /// destructor
+ ~ViewInformation3D();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ /// assignment operator
+ ViewInformation3D& operator=(const ViewInformation3D& rCandidate);
+
+ /// compare operators
+ bool operator==(const ViewInformation3D& rCandidate) const;
+ bool operator!=(const ViewInformation3D& rCandidate) const { return !operator==(rCandidate); }
+
+ /// data access
+ const basegfx::B3DHomMatrix& getObjectTransformation() const;
+ const basegfx::B3DHomMatrix& getOrientation() const;
+ const basegfx::B3DHomMatrix& getProjection() const;
+ const basegfx::B3DHomMatrix& getDeviceToView() const;
+ double getViewTime() const;
+
+ /// for convenience, the linear combination of the above four transformations is offered
+ const basegfx::B3DHomMatrix& getObjectToView() const;
+
+ /** Get the uno::Sequence< beans::PropertyValue > which contains all ViewInformation
+
+ Use this call if You need to extract all contained ViewInformation. The ones
+ directly supported for convenience will be added to the ones only available
+ as PropertyValues. This set completely describes this ViewInformation3D and
+ can be used for complete information transport over UNO API.
+ */
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& getViewInformationSequence() const;
+
+ /** Get the uno::Sequence< beans::PropertyValue > which contains only ViewInformation
+ not offered directly
+
+ Use this call if You only need ViewInformation which is not offered conveniently,
+ but only exists as PropertyValue. This is e.g. used to create partially updated
+ incarnations of ViewInformation3D without losing the only with PropertyValues
+ defined data. It does not contain a complete description.
+ */
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& getExtendedInformationSequence() const;
+ };
+ } // end of namespace geometry
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/animatedprimitive2d.hxx b/include/drawinglayer/primitive2d/animatedprimitive2d.hxx
new file mode 100644
index 000000000000..59ee3225dc78
--- /dev/null
+++ b/include/drawinglayer/primitive2d/animatedprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_ANIMATEDPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ANIMATEDPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+namespace drawinglayer { namespace animation {
+ class AnimationEntry;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** AnimatedSwitchPrimitive2D class
+
+ This is the basic class for simple, animated primitives. The basic idea
+ is to have an animation definition (AnimationEntry) who's basic
+ functionality is to return a state value for any given animation time in
+ the range of [0.0 .. 1.0]. Depending on the state, the decomposition
+ calculates an index, which of the members of the child vector is to
+ be visualized.
+
+ An example: For blinking, the Child vector should exist of two entries;
+ for values of [0.0 .. 0.5] the first, else the last entry will be used.
+ This mechanism is not limited to two entries, though.
+ */
+ class DRAWINGLAYER_DLLPUBLIC AnimatedSwitchPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ /**
+ The animation definition which allows translation of a point in time
+ to an animation state [0.0 .. 1.0]. This member contains a cloned
+ definition and is owned by this implementation.
+ */
+ animation::AnimationEntry* mpAnimationEntry;
+
+ /// bitfield
+ /** flag if this is a text or graphic animation. Necessary since SdrViews need to differentiate
+ between both types if they are on/off
+ */
+ unsigned mbIsTextAnimation : 1;
+
+ public:
+ /// constructor
+ AnimatedSwitchPrimitive2D(
+ const animation::AnimationEntry& rAnimationEntry,
+ const Primitive2DSequence& rChildren,
+ bool bIsTextAnimation);
+
+ /// destructor - needed due to mpAnimationEntry
+ virtual ~AnimatedSwitchPrimitive2D();
+
+ /// data read access
+ const animation::AnimationEntry& getAnimationEntry() const { return *mpAnimationEntry; }
+ bool isTextAnimation() const { return mbIsTextAnimation; }
+ bool isGraphicAnimation() const { return !isTextAnimation(); }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+
+ /** The getDecomposition is overloaded here since the decompose is dependent of the point in time,
+ so the default implementation is nut useful here, it needs to be handled locally
+ */
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** AnimatedBlinkPrimitive2D class
+
+ Basically the same mechanism as in AnimatedSwitchPrimitive2D, but the
+ decomposition is specialized in delivering the children in the
+ range [0.0.. 0.5] and an empty sequence else
+ */
+ class DRAWINGLAYER_DLLPUBLIC AnimatedBlinkPrimitive2D : public AnimatedSwitchPrimitive2D
+ {
+ protected:
+ public:
+ /// constructor
+ AnimatedBlinkPrimitive2D(
+ const animation::AnimationEntry& rAnimationEntry,
+ const Primitive2DSequence& rChildren,
+ bool bIsTextAnimation);
+
+ /// create local decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** AnimatedInterpolatePrimitive2D class
+
+ Specialized on multi-step animations based on matrix transformations. The
+ Child sequelce will be embedded in a matrix transformation. That transformation
+ will be linearly combined from the decomposed values and the animation value
+ to allow a smooth animation.
+ */
+ class DRAWINGLAYER_DLLPUBLIC AnimatedInterpolatePrimitive2D : public AnimatedSwitchPrimitive2D
+ {
+ private:
+ /// the transformations
+ std::vector< basegfx::tools::B2DHomMatrixBufferedDecompose > maMatrixStack;
+
+ protected:
+ public:
+ /// constructor
+ AnimatedInterpolatePrimitive2D(
+ const std::vector< basegfx::B2DHomMatrix >& rmMatrixStack,
+ const animation::AnimationEntry& rAnimationEntry,
+ const Primitive2DSequence& rChildren,
+ bool bIsTextAnimation);
+
+ /// create local decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ANIMATEDPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx b/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
new file mode 100644
index 000000000000..3986aba3566b
--- /dev/null
+++ b/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_BACKGROUNDCOLORPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BACKGROUNDCOLORPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// BackgroundColorPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** BackgroundColorPrimitive2D class
+
+ This primitive is defined to fill the whole visible Viewport with
+ the given color (and thus decomposes to a filled polygon). This
+ makes it a view-depnendent primitive by definition. It only has
+ a valid decomposition if a valid Viewport is given in the
+ ViewInformation2D at decomposition time.
+
+ It will try to buffer it's last decomposition using maLastViewport
+ to detect changes in the get2DDecomposition call.
+ */
+ class DRAWINGLAYER_DLLPUBLIC BackgroundColorPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the fill color to use
+ basegfx::BColor maBColor;
+
+ /// the last used viewInformation, used from getDecomposition for buffering
+ basegfx::B2DRange maLastViewport;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ explicit BackgroundColorPrimitive2D(
+ const basegfx::BColor& rBColor);
+
+ /// data read access
+ const basegfx::BColor& getBColor() const { return maBColor; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get B2Drange
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+
+ /// Overload standard getDecomposition call to be view-dependent here
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BACKGROUNDCOLORPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
new file mode 100644
index 000000000000..157c13bb33a8
--- /dev/null
+++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -0,0 +1,296 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <cppuhelper/compbase1.hxx>
+#include <boost/utility.hpp>
+#include <com/sun/star/graphic/XPrimitive2D.hpp>
+#include <comphelper/broadcasthelper.hxx>
+#include <basegfx/range/b2drange.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+/** defines for DeclPrimitrive2DIDBlock and ImplPrimitrive2DIDBlock
+ Added to be able to simply change identification stuff later, e.g. add
+ a identification string and/or ID to the interface and to the implementation
+ ATM used to delclare implement getPrimitive2DID()
+*/
+
+#define DeclPrimitrive2DIDBlock() \
+ virtual sal_uInt32 getPrimitive2DID() const;
+
+#define ImplPrimitrive2DIDBlock(TheClass, TheID) \
+ sal_uInt32 TheClass::getPrimitive2DID() const { return TheID; }
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace geometry {
+ class ViewInformation2D;
+}}
+
+namespace drawinglayer { namespace primitive2d {
+ /// typedefs for basePrimitive2DImplBase, Primitive2DSequence and Primitive2DReference
+ typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive2D > BasePrimitive2DImplBase;
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > Primitive2DReference;
+ typedef ::com::sun::star::uno::Sequence< Primitive2DReference > Primitive2DSequence;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+// basePrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** BasePrimitive2D class
+
+ Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D
+
+ This class is strongly virtual due to the lack of getPrimitiveID() implementation.
+ This is by purpose, this base class shall not be incarnated and be used directly as
+ a XPrimitive2D.
+
+ Is is derived from boost::noncopyable to make clear that a primitive is a read-only
+ instance and copying or changing values is not intended. The idea is to hold all data
+ needed for visualisation of this primitive in unchangeable form.
+
+ It is derived from comphelper::OBaseMutex to have a Mutex at hand; in a base
+ implementation this may not be needed, but e.g. when buffering at last decomposition
+ in a local member, multiple threads may try to decompose at the same time, so locking
+ is needed to avoid race conditions seen from the UNO object implementation.
+
+ A method to get a simplified representation is provided by get2DDecomposition. The
+ default implementation returns an empty sequence. The idea is that processors
+ using this primitive and do not know it, may get the decomposition and process
+ these instead. An example is e.g. a fat line, who's decomposition may contain
+ the geometric representation of that line using filled polygon prmimitives. When
+ the renderer knows how to handle fat lines, he may proccess this primitive directly;
+ if not he can use the decomposition. With this functionality, renderers may operate by
+ knowing only a small set of primitives.
+
+ When a primitive does not implement get2DDecomposition, it is called a 'Basic Primitive' and
+ belongs to the set of primitives which a processor should be able to handle. Practice
+ will define this minimal sets of primitives. When defined and the concept is prooved,
+ unique UNO APIs may be defined/implemented for these set to allow more intense work
+ with primitives using UNO.
+
+ Current Basic 2D Primitives are:
+
+ - BitmapPrimitive2D (bitmap data, evtl. with transparence)
+ - PointArrayPrimitive2D (single points)
+ - PolygonHairlinePrimitive2D (hairline curves/polygons)
+ - PolyPolygonColorPrimitive2D (colored polygons)
+
+ UPDATE: MetafilePrimitive2D (VCL Metafile) is taken off this list since
+ it is implemented with the integration of CWS aw078 into DV300m69.
+
+ All other implemented primitives have a defined decomposition and can thus be
+ decomposed down to this small set.
+
+ A renderer implementing support for this minimal set of primitives can completely
+ render primitive-based visualisations. Of course, he also has to take states into account
+ which are representated by GroupPrimitive2D derivations, see groupprimitive2d.hxx
+
+ To support getting the geometric BoundRect, getB2DRange is used. The default
+ implementation will use the get2DDecomposition result and merge a range from the
+ entries. Thus, an implementation is only necessary for the Basic Primitives, but
+ of course speedups are possible (and are used) by implementing the method at higher-level
+ primitives.
+
+ For primitive identification, getPrimitiveID is used currently in this implementations
+ to allow a fast switch/case processing. This needs a unique identifier mechanism which
+ currently uses defines (see drawinglayer_primitivetypes2d.hxx). For UNO prmitive API
+ it will be needed to add a unique descriptor (Name?) later to the API.
+
+ This base implementation provides mappings from the methods from XPrimitive2D
+ (getDecomposition/getRange) to the appropriate methods in the C++ implementations
+ (get2DDecomposition/getB2DRange). The PropertyValue ViewParameters is converted to
+ the appropriate C++ implementation class ViewInformation2D.
+
+ This base class does not implement any buffering; e.g. buffering the decompositon
+ and/or the range. These may be buffered anytime since the definition is that the primitive
+ is read-only and thus unchangeable. This implies that the decomposition and/or getting
+ the range will lead to the same result as last time, under the precondition that
+ the parameter ViewInformation2D is the same as the last one. This is usually the case
+ for view-independent primitives which are defined by not using ViewInformation2D
+ in their get2DDecomposition/getB2DRange implementations.
+ */
+ class DRAWINGLAYER_DLLPUBLIC BasePrimitive2D
+ : private boost::noncopyable,
+ protected comphelper::OBaseMutex,
+ public BasePrimitive2DImplBase
+ {
+ private:
+ protected:
+ public:
+ // constructor/destructor
+ BasePrimitive2D();
+ virtual ~BasePrimitive2D();
+
+ /** the ==operator is mainly needed to allow testing newly-created primitives against their last
+ incarnation which buffers/holds the made decompositions. The default implementation
+ uses getPrimitive2DID()-calls to test if it's the same ID at last. Overloaded implementation are then
+ based on this implementation
+ */
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+ bool operator!=( const BasePrimitive2D& rPrimitive ) const { return !operator==(rPrimitive); }
+
+ /// The default implementation will use getDecomposition results to create the range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /** provide unique ID for fast identifying of known primitive implementations in renderers. These use
+ the defines from drawinglayer_primitivetypes2d.hxx to define unique IDs.
+ This method is normally defined using DeclPrimitrive2DIDBlock()
+ */
+ virtual sal_uInt32 getPrimitive2DID() const = 0;
+
+ /// The default implementation will return an empty sequence
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ //
+ // Methods from XPrimitive2D
+ //
+
+ /** The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It
+ will construct a ViewInformation2D from the ViewParameters for that purpose
+ */
+ virtual Primitive2DSequence SAL_CALL getDecomposition( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ /** The getRange implementation for UNO API will use getRange from this implementation. It
+ will construct a ViewInformation2D from the ViewParameters for that purpose
+ */
+ virtual ::com::sun::star::geometry::RealRectangle2D SAL_CALL getRange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException );
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// BufferedDecompositionPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** BufferedDecompositionPrimitive2D class
+
+ Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D
+ which want to buffer the decomoposition result
+
+ Buffering the decomposition is the most-used buffering and is thus used my most
+ primitive implementations which support a decomposition as base class.
+
+ The buffering is done by holding the last decomposition in the local parameter
+ maBuffered2DDecomposition. The default implementation of get2DDecomposition checks
+ if maBuffered2DDecomposition is empty. If yes, it uses create2DDecomposition
+ to create the content. In all cases, maBuffered2DDecomposition is returned.
+
+ For view-dependent primitives derived from Primitive2DBufferDecomposition more needs
+ to be done when the decomposition depends on parts of the parameter ViewInformation2D.
+ This defines a standard method for processing these:
+
+ Implement a view-dependent get2DDecomposition doing te following steps:
+ (a) Locally extract needed parameters from ViewInformation2D to new, local parameters
+ (this may be a complete local copy of ViewInformation2D)
+ (b) If a buffered decomposition exists, ckeck if one of the new local parameters
+ differs from the corresponding locally remembered (as member) ones. If yes,
+ clear maBuffered2DDecomposition
+ (d) call baseclass::get2DDecomposition which will use create2DDecomposition
+ to fill maBuffered2DDecomposition if it's empty
+ (e) copy the new local parameters to the corresponding locally remembered ones
+ to identify if a new decomposition is needed at the next call
+ (f) return maBuffered2DDecomposition
+ */
+ class DRAWINGLAYER_DLLPUBLIC BufferedDecompositionPrimitive2D
+ : public BasePrimitive2D
+ {
+ private:
+ /// a sequence used for buffering the last create2DDecomposition() result
+ Primitive2DSequence maBuffered2DDecomposition;
+
+ protected:
+ /** access methods to maBuffered2DDecomposition. The usage of this methods may allow
+ later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
+ implementations for buffering the last decomposition.
+ */
+ const Primitive2DSequence& getBuffered2DDecomposition() const { return maBuffered2DDecomposition; }
+ void setBuffered2DDecomposition(const Primitive2DSequence& rNew) { maBuffered2DDecomposition = rNew; }
+
+ /** method which is to be used to implement the local decomposition of a 2D primitive. The default
+ implementation will just return an empty decomposition
+ */
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ // constructor/destructor
+ BufferedDecompositionPrimitive2D();
+
+ /** The getDecomposition default implementation will on demand use create2DDecomposition() if
+ maBuffered2DDecomposition is empty. It will set maBuffered2DDecomposition to this obtained decomposition
+ to buffer it. If the decomposition is also ViewInformation2D-dependent, this method needs to be
+ overloaded and the ViewInformation2D for the last decomposition need to be remembered, too, and
+ be used in the next call to decide if the buffered decomposition may be reused or not.
+ */
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// tooling
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /// support to handle a sequence of primitives as stl vector and convert it during creation
+ typedef ::std::vector< BasePrimitive2D* > Primitive2DVector;
+ Primitive2DSequence DRAWINGLAYER_DLLPUBLIC Primitive2DVectorToPrimitive2DSequence(const Primitive2DVector& rSource, bool bInvert = false);
+
+ /// get B2DRange from a given Primitive2DReference
+ basegfx::B2DRange DRAWINGLAYER_DLLPUBLIC getB2DRangeFromPrimitive2DReference(const Primitive2DReference& rCandidate, const geometry::ViewInformation2D& aViewInformation);
+
+ /// get B2DRange from a given Primitive2DSequence
+ basegfx::B2DRange DRAWINGLAYER_DLLPUBLIC getB2DRangeFromPrimitive2DSequence(const Primitive2DSequence& rCandidate, const geometry::ViewInformation2D& aViewInformation);
+
+ /** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
+ and using compare operator
+ */
+ bool DRAWINGLAYER_DLLPUBLIC arePrimitive2DReferencesEqual(const Primitive2DReference& rA, const Primitive2DReference& rB);
+
+ /// compare two Primitive2DReferences for equality, uses arePrimitive2DReferencesEqual internally
+ bool DRAWINGLAYER_DLLPUBLIC arePrimitive2DSequencesEqual(const Primitive2DSequence& rA, const Primitive2DSequence& rB);
+
+ /// concatenate sequence
+ void DRAWINGLAYER_DLLPUBLIC appendPrimitive2DSequenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DSequence& rSource);
+
+ /// concatenate single Primitive2D
+ void DRAWINGLAYER_DLLPUBLIC appendPrimitive2DReferenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DReference& rSource);
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx b/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx
new file mode 100644
index 000000000000..fa262bd9fe95
--- /dev/null
+++ b/include/drawinglayer/primitive2d/bitmapprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_BITMAPPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BITMAPPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <vcl/bitmapex.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// BitmapPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** BitmapPrimitive2D class
+
+ This class is the central primitive for Bitmap-based primitives.
+ It provides RGBA-based bitmaps, currently using a BitmapEx from VCL.
+ This may change in the future to any other, maybe more general base
+ class providing 24bit RGBA.
+ */
+ class DRAWINGLAYER_DLLPUBLIC BitmapPrimitive2D : public BasePrimitive2D
+ {
+ private:
+ /// the RGBA Bitmap-data
+ BitmapEx maBitmapEx;
+
+ /** the object transformation from unit coordinates, defining
+ size, shear, rotate and position
+ */
+ basegfx::B2DHomMatrix maTransform;
+
+ public:
+ /// constructor
+ BitmapPrimitive2D(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DHomMatrix& rTransform);
+
+ /// data read access
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BITMAPPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx b/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx
new file mode 100644
index 000000000000..d9ed473851f4
--- /dev/null
+++ b/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BORDERLINEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BORDERLINEPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <svtools/ctrlbox.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** BorderLinePrimitive2D class
+
+ This is the basic primitive to build frames around objects, e.g. tables.
+ It defines a single or double line from Start to nd using the LeftWidth,
+ Distance and RightWidth definitions.
+ The LineStart/End overlap is defined by the Extend(Inner|Outer)(Start|End)
+ definitions.
+ */
+ class DRAWINGLAYER_DLLPUBLIC BorderLinePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the line definition
+ basegfx::B2DPoint maStart;
+ basegfx::B2DPoint maEnd;
+
+ /// the widths of single/double line
+ double mfLeftWidth;
+ double mfDistance;
+ double mfRightWidth;
+
+ /// edge overlap sizes
+ double mfExtendLeftStart;
+ double mfExtendLeftEnd;
+ double mfExtendRightStart;
+ double mfExtendRightEnd;
+
+ /// the line colors
+ basegfx::BColor maRGBColorRight;
+ basegfx::BColor maRGBColorLeft;
+ basegfx::BColor maRGBColorGap;
+ bool mbHasGapColor;
+
+ short mnStyle;
+
+ /// local helpers
+ double getWidth(
+ const geometry::ViewInformation2D& rViewInformation) const;
+
+ bool isSolidLine() const
+ {
+ return (mnStyle==STYLE_SOLID);
+ }
+
+ bool isInsideUsed() const
+ {
+ return !basegfx::fTools::equalZero(mfLeftWidth);
+ }
+
+ bool isOutsideUsed() const
+ {
+ return !basegfx::fTools::equalZero(mfRightWidth);
+ }
+
+ protected:
+ virtual basegfx::B2DPolyPolygon getClipPolygon(
+ const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ BorderLinePrimitive2D(
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
+ double fLeftWidth,
+ double fDistance,
+ double fRightWidth,
+ double fExtendLeftStart,
+ double fExtendLeftEnd,
+ double fExtendRightStart,
+ double fExtendRightEnd,
+ const basegfx::BColor& rRGBColorRight,
+ const basegfx::BColor& rRGBColorLeft,
+ const basegfx::BColor& rRGBColorGap,
+ bool bHasGapColor,
+ const short nStyle );
+
+ /// data read access
+ const basegfx::B2DPoint& getStart() const { return maStart; }
+ const basegfx::B2DPoint& getEnd() const { return maEnd; }
+ double getLeftWidth() const { return mfLeftWidth; }
+ double getDistance() const { return mfDistance; }
+ double getRightWidth() const { return mfRightWidth; }
+ double getExtendLeftStart() const { return mfExtendLeftStart; }
+ double getExtendLeftEnd() const { return mfExtendLeftEnd; }
+ double getExtendRightStart() const { return mfExtendRightStart; }
+ double getExtendRightEnd() const { return mfExtendRightEnd; }
+ const basegfx::BColor& getRGBColorRight () const { return maRGBColorRight; }
+ const basegfx::BColor& getRGBColorLeft () const { return maRGBColorLeft; }
+ const basegfx::BColor& getRGBColorGap () const { return maRGBColorGap; }
+ bool hasGapColor( ) const { return mbHasGapColor; }
+ short getStyle () const { return mnStyle; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BORDERLINEPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/clippedborderlineprimitive2d.hxx b/include/drawinglayer/primitive2d/clippedborderlineprimitive2d.hxx
new file mode 100644
index 000000000000..6db292fd6859
--- /dev/null
+++ b/include/drawinglayer/primitive2d/clippedborderlineprimitive2d.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:
+ *
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_CLIPPEDBORDERLINEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_CLIPPEDBORDERLINEPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/borderlineprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** BorderLinePrimitive2D clipped by the intersection with a provided
+ polygon.
+ */
+ class DRAWINGLAYER_DLLPUBLIC ClippedBorderLinePrimitive2D : public BorderLinePrimitive2D
+ {
+ private:
+ const basegfx::B2DPolygon maIntersection;
+
+ protected:
+ virtual basegfx::B2DPolyPolygon getClipPolygon(
+ const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ ClippedBorderLinePrimitive2D(
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
+ double fLeftWidth,
+ double fDistance,
+ double fRightWidth,
+ const basegfx::B2DPolygon& rIntersection,
+ const basegfx::BColor& rRGBColorRight,
+ const basegfx::BColor& rRGBColorLeft,
+ const basegfx::BColor& rRGBColorGap,
+ bool bHasGapColor,
+ const short nStyle );
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_CLIPPEDBORDERLINEPRIMITIVE2D_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/controlprimitive2d.hxx b/include/drawinglayer/primitive2d/controlprimitive2d.hxx
new file mode 100644
index 000000000000..789b7aa38471
--- /dev/null
+++ b/include/drawinglayer/primitive2d/controlprimitive2d.hxx
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_CONTROLPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_CONTROLPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <com/sun/star/awt/XControlModel.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** ControlPrimitive2D class
+
+ Base class for ControlPrimitive handling. It decoposes to a
+ graphical representation (Bitmap data) of the control. This
+ representation is limited to a quadratic pixel maximum defined
+ in the applicatin settings.
+ */
+ class DRAWINGLAYER_DLLPUBLIC ControlPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// object's base data
+ basegfx::B2DHomMatrix maTransform;
+ com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > mxControlModel;
+
+ /// the created an cached awt::XControl
+ com::sun::star::uno::Reference< com::sun::star::awt::XControl > mxXControl;
+
+ /// the last used scaling, used from getDecomposition for buffering
+ basegfx::B2DVector maLastViewScaling;
+
+ /** used from getXControl() to create a local awt::XControl which is remembered in mxXControl
+ and from thereon always used and returned by getXControl()
+ */
+ void createXControl();
+
+ /// single local decompositions, used from create2DDecomposition()
+ Primitive2DReference createBitmapDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ Primitive2DReference createPlaceholderDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ protected:
+ /// local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ ControlPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& rxControlModel);
+
+ /** constructor with an additional XControl as parameter to allow to hand it over at incarnation time
+ if it exists. This will avoid to create a 2nd one on demand in createXControl()
+ and thus double the XControls.
+ */
+ ControlPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& rxControlModel,
+ const com::sun::star::uno::Reference< com::sun::star::awt::XControl >& rxXControl);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& getControlModel() const { return mxControlModel; }
+
+ /** mxControl access. This will on demand create the awt::XControl using createXControl()
+ if it does not exist. It may already have been created or even handed over at
+ incarnation
+ */
+ const com::sun::star::uno::Reference< com::sun::star::awt::XControl >& getXControl() const;
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+
+ /// Overload standard getDecomposition call to be view-dependent here
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_CONTROLPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/cropprimitive2d.hxx b/include/drawinglayer/primitive2d/cropprimitive2d.hxx
new file mode 100644
index 000000000000..25d044b3231f
--- /dev/null
+++ b/include/drawinglayer/primitive2d/cropprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_CROPPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_CROPPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** CropPrimitive2D class
+
+ Caution: Due to old constraints (old core definitions) the
+ crop distances describe how the uncropped content is defined
+ relative to the current object size. This means that maTransformation
+ describes the rurrent object size (the part of the object visible
+ with the crop applied). To get the original size and orientation
+ of the uncropped content it is necessary to calc back from the
+ current situation (maTransformation) using the crop values
+ to get to the uncropped original content.
+
+ Thus a transformation has to be calculated which will be applied
+ to the already exsisting content to get it to the uncropped state
+ ans then this is masked with the current state (mask polygon
+ created from unit polygon and maTransformation).
+
+ At least in this primitive the units of the crop values are
+ already in the local coordinate system; inthe core these distances
+ are defined relative to the object content size (PrefMapMode
+ and PrefSize of the content)...
+
+ Of course this is a primitive, so feel free to just ignore all that
+ stuff and use the automatically generated decomposition. Sigh.
+ */
+ class DRAWINGLAYER_DLLPUBLIC CropPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ // the transformation already applied to the child geometry
+ basegfx::B2DHomMatrix maTransformation;
+
+ // the crop offsets relative to the range of the unrotated content
+ double mfCropLeft;
+ double mfCropTop;
+ double mfCropRight;
+ double mfCropBottom;
+
+ public:
+ /// constructor
+ CropPrimitive2D(
+ const Primitive2DSequence& rChildren,
+ const basegfx::B2DHomMatrix& rTransformation,
+ double fCropLeft,
+ double fCropTop,
+ double fCropRight,
+ double fCropBottom);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
+ double getCropLeft() const { return mfCropLeft; }
+ double getCropTop() const { return mfCropTop; }
+ double getCropRight() const { return mfCropRight; }
+ double getCropBottom() const { return mfCropBottom; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// local decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_CROPPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx b/include/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx
new file mode 100644
index 000000000000..9b8528057c14
--- /dev/null
+++ b/include/drawinglayer/primitive2d/discretebitmapprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
+#include <vcl/bitmapex.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// DiscreteBitmapPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** DiscreteBitmapPrimitive2D class
+
+ This class defines a view-dependent BitmapPrimitive which has a
+ logic position for the top-left position and is always to be
+ painted in 1:1 pixel resolution. It will never be sheared, rotated
+ or scaled with the view.
+ */
+ class DRAWINGLAYER_DLLPUBLIC DiscreteBitmapPrimitive2D : public ObjectAndViewTransformationDependentPrimitive2D
+ {
+ private:
+ /// the RGBA Bitmap-data
+ BitmapEx maBitmapEx;
+
+ /** the top-left object position */
+ basegfx::B2DPoint maTopLeft;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ DiscreteBitmapPrimitive2D(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rTopLeft);
+
+ /// data read access
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
+ const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx b/include/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx
new file mode 100644
index 000000000000..2c10292b1c59
--- /dev/null
+++ b/include/drawinglayer/primitive2d/discreteshadowprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
+#include <vcl/bitmapex.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// DiscreteShadowPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** DiscreteShadow data class
+
+ */
+ class DRAWINGLAYER_DLLPUBLIC DiscreteShadow
+ {
+ private:
+ /// the original shadow BitmapEx in a special form
+ BitmapEx maBitmapEx;
+
+ /// buffered extracted parts of CombinedShadow for easier usage
+ BitmapEx maTopLeft;
+ BitmapEx maTop;
+ BitmapEx maTopRight;
+ BitmapEx maRight;
+ BitmapEx maBottomRight;
+ BitmapEx maBottom;
+ BitmapEx maBottomLeft;
+ BitmapEx maLeft;
+
+ public:
+ /// constructor
+ explicit DiscreteShadow(const BitmapEx& rBitmapEx);
+
+ /// data read access
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
+
+ /// compare operator
+ bool operator==(const DiscreteShadow& rCompare) const
+ {
+ return getBitmapEx() == rCompare.getBitmapEx();
+ }
+
+ /// helper accesses which create on-demand needed segments
+ const BitmapEx& getTopLeft() const;
+ const BitmapEx& getTop() const;
+ const BitmapEx& getTopRight() const;
+ const BitmapEx& getRight() const;
+ const BitmapEx& getBottomRight() const;
+ const BitmapEx& getBottom() const;
+ const BitmapEx& getBottomLeft() const;
+ const BitmapEx& getLeft() const;
+ };
+
+ /** DiscreteShadowPrimitive2D class
+
+ */
+ class DRAWINGLAYER_DLLPUBLIC DiscreteShadowPrimitive2D : public DiscreteMetricDependentPrimitive2D
+ {
+ private:
+ // the object transformation of the rectangular object
+ basegfx::B2DHomMatrix maTransform;
+
+ // the bitmap shadow data
+ DiscreteShadow maDiscreteShadow;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ DiscreteShadowPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ const DiscreteShadow& rDiscreteShadow);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const DiscreteShadow& getDiscreteShadow() const { return maDiscreteShadow; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
new file mode 100644
index 000000000000..cb8ff0efd0ff
--- /dev/null
+++ b/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.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_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVETYPES2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVETYPES2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// define ranges for other libraries
+
+#define PRIMITIVE2D_ID_RANGE_DRAWINGLAYER (0 << 16)
+#define PRIMITIVE2D_ID_RANGE_SVX (1 << 16)
+#define PRIMITIVE2D_ID_RANGE_SD (2 << 16)
+#define PRIMITIVE2D_ID_RANGE_SW (3 << 16)
+#define PRIMITIVE2D_ID_RANGE_SC (4 << 16)
+
+//////////////////////////////////////////////////////////////////////////////
+// local primitives
+
+#define PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 0)
+#define PRIMITIVE2D_ID_ANIMATEDSWITCHPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 1)
+#define PRIMITIVE2D_ID_ANIMATEDBLINKPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 2)
+#define PRIMITIVE2D_ID_ANIMATEDINTERPOLATEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 3)
+#define PRIMITIVE2D_ID_BACKGROUNDCOLORPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 4)
+#define PRIMITIVE2D_ID_BITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 5)
+#define PRIMITIVE2D_ID_CONTROLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 6)
+#define PRIMITIVE2D_ID_EMBEDDED3DPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 7)
+#define PRIMITIVE2D_ID_FILLBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 8)
+#define PRIMITIVE2D_ID_FILLGRADIENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 9)
+#define PRIMITIVE2D_ID_FILLHATCHPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 10)
+#define PRIMITIVE2D_ID_GRAPHICPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 11)
+#define PRIMITIVE2D_ID_GRIDPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 12)
+#define PRIMITIVE2D_ID_GROUPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 13)
+#define PRIMITIVE2D_ID_HELPLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 14)
+#define PRIMITIVE2D_ID_MARKERARRAYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 15)
+#define PRIMITIVE2D_ID_MASKPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 16)
+#define PRIMITIVE2D_ID_MEDIAPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 17)
+#define PRIMITIVE2D_ID_METAFILEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 18)
+#define PRIMITIVE2D_ID_MODIFIEDCOLORPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 19)
+#define PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 20)
+#define PRIMITIVE2D_ID_POLYGONMARKERPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 21)
+#define PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 22)
+#define PRIMITIVE2D_ID_POLYGONSTROKEARROWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 23)
+#define PRIMITIVE2D_ID_POLYPOLYGONSTROKEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 24)
+#define PRIMITIVE2D_ID_POLYPOLYGONSTROKEARROWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 25)
+#define PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 26)
+#define PRIMITIVE2D_ID_POLYPOLYGONGRADIENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 27)
+#define PRIMITIVE2D_ID_POLYPOLYGONHATCHPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 28)
+#define PRIMITIVE2D_ID_POLYPOLYGONBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 29)
+#define PRIMITIVE2D_ID_SCENEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 30)
+#define PRIMITIVE2D_ID_SHADOWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 31)
+#define PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 32)
+#define PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 33)
+#define PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 34)
+#define PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 35)
+#define PRIMITIVE2D_ID_POINTARRAYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 36)
+#define PRIMITIVE2D_ID_TEXTHIERARCHYFIELDPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 37)
+#define PRIMITIVE2D_ID_TEXTHIERARCHYLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 38)
+#define PRIMITIVE2D_ID_TEXTHIERARCHYPARAGRAPHPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 39)
+#define PRIMITIVE2D_ID_TEXTHIERARCHYBLOCKPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 40)
+#define PRIMITIVE2D_ID_TEXTHIERARCHYEDITPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 41)
+#define PRIMITIVE2D_ID_POLYGONWAVEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 42)
+#define PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 43)
+#define PRIMITIVE2D_ID_TEXTEFFECTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 44)
+#define PRIMITIVE2D_ID_TEXTHIERARCHYBULLETPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 45)
+#define PRIMITIVE2D_ID_POLYPOLYGONHAIRLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 46)
+#define PRIMITIVE2D_ID_EXECUTEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 47)
+#define PRIMITIVE2D_ID_PAGEPREVIEWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 48)
+#define PRIMITIVE2D_ID_STRUCTURETAGPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 49)
+#define PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 50)
+#define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51)
+#define PRIMITIVE2D_ID_HITTESTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 52)
+#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53)
+#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54)
+#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55)
+#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56)
+#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57)
+#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58)
+#define PRIMITIVE2D_ID_EPSPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59)
+#define PRIMITIVE2D_ID_DISCRETESHADOWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60)
+#define PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 61)
+#define PRIMITIVE2D_ID_SVGLINEARGRADIENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 62)
+#define PRIMITIVE2D_ID_SVGRADIALGRADIENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 63)
+#define PRIMITIVE2D_ID_SVGLINEARATOMPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 64)
+#define PRIMITIVE2D_ID_SVGRADIALATOMPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 65)
+#define PRIMITIVE2D_ID_CROPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 66)
+#define PRIMITIVE2D_ID_PATTERNFILLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 67)
+#define PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 68)
+
+#define PRIMITIVE2D_ID_CLIPPEDBORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 68)
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVETYPES2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/embedded3dprimitive2d.hxx b/include/drawinglayer/primitive2d/embedded3dprimitive2d.hxx
new file mode 100644
index 000000000000..d7389bea2bc3
--- /dev/null
+++ b/include/drawinglayer/primitive2d/embedded3dprimitive2d.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EMBEDDED3DPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EMBEDDED3DPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+#include <drawinglayer/geometry/viewinformation3d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// Embedded3DPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** Embedded3DPrimitive2D class
+
+ This is a helper primitive which allows embedding of single 3D
+ primitives to the 2D primitive logic. It will get the scene it's
+ involved and thus the 3D transformation. With this information it
+ is able to provide 2D range data for a 3D primitive.
+
+ This primitive will not be visualized and decomposes to a yellow
+ 2D rectangle to visualize that this should never be visualized
+ */
+ class DRAWINGLAYER_DLLPUBLIC Embedded3DPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the sequence of 3d primitives
+ primitive3d::Primitive3DSequence mxChildren3D;
+
+ /// the 2D scene object transformation
+ basegfx::B2DHomMatrix maObjectTransformation;
+
+ /// the 3D transformations
+ geometry::ViewInformation3D maViewInformation3D;
+
+ /** if the embedded 3D primitives contain shadow, these parameters are needed
+ to extract the shadow wich is a sequence od 2D primitives and may expand
+ the 2D range. Since every single 3D object in a scene may individually
+ have shadow or not, these values need to be provided and prepared. The shadow
+ distance itself (a 2D transformation) is part of the 3D shadow definition
+ */
+ basegfx::B3DVector maLightNormal;
+ double mfShadowSlant;
+ basegfx::B3DRange maScene3DRange;
+
+ /// the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked)
+ Primitive2DSequence maShadowPrimitives;
+
+ /// #i96669# add simple range buffering for this primitive
+ basegfx::B2DRange maB2DRange;
+
+ /// bitfield
+ /** flag if given 3D geometry is already cheched for shadow definitions and 2d shadows
+ are created in maShadowPrimitives
+ */
+ unsigned mbShadow3DChecked : 1;
+
+ /// private helpers
+ bool impGetShadow3D(const geometry::ViewInformation2D& rViewInformation) const;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ Embedded3DPrimitive2D(
+ const primitive3d::Primitive3DSequence& rxChildren3D,
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ const geometry::ViewInformation3D& rViewInformation3D,
+ const basegfx::B3DVector& rLightNormal,
+ double fShadowSlant,
+ const basegfx::B3DRange& rScene3DRange);
+
+ /// data read access
+ const primitive3d::Primitive3DSequence& getChildren3D() const { return mxChildren3D; }
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+ const geometry::ViewInformation3D& getViewInformation3D() const { return maViewInformation3D; }
+ const basegfx::B3DVector& getLightNormal() const { return maLightNormal; }
+ double getShadowSlant() const { return mfShadowSlant; }
+ const basegfx::B3DRange& getScene3DRange() const { return maScene3DRange; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EMBEDDED3DPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/epsprimitive2d.hxx b/include/drawinglayer/primitive2d/epsprimitive2d.hxx
new file mode 100644
index 000000000000..577554481d6e
--- /dev/null
+++ b/include/drawinglayer/primitive2d/epsprimitive2d.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EPSPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EPSPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <vcl/gfxlink.hxx>
+#include <vcl/gdimtf.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** EpsPrimitive2D class */
+ class DRAWINGLAYER_DLLPUBLIC EpsPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the geometry definition
+ basegfx::B2DHomMatrix maEpsTransform;
+
+ /// the Eps content definition
+ GfxLink maGfxLink;
+
+ /// the replacement content definition
+ GDIMetaFile maMetaFile;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ EpsPrimitive2D(
+ const basegfx::B2DHomMatrix& rEpsTransform,
+ const GfxLink& rGfxLink,
+ const GDIMetaFile& rMetaFile);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getEpsTransform() const { return maEpsTransform; }
+ const GfxLink& getGfxLink() const { return maGfxLink; }
+ const GDIMetaFile& getMetaFile() const { return maMetaFile; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get B2Drange
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EPSPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx b/include/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx
new file mode 100644
index 000000000000..0c82458840ad
--- /dev/null
+++ b/include/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLBITMAPPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLBITMAPPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <drawinglayer/attribute/fillbitmapattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// FillbitmapPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** FillBitmapPrimitive2D class
+
+ This class defines a bitmap filling for a rectangular area. The
+ Range is defined by the Transformation, the fill by the FillBitmapAttribute.
+ There, the fill consists of a Bitmap (not transparent) defining the fill data
+ and a Point/Vector pair defining the relative position/size [0.0 .. 1.0]
+ inside the area where the bitmap is positioned. A flag defines then if this
+ is tiled or not.
+
+ Renderers should handle this primitive; it has a geometrically correct
+ decomposition, but on pixel oututs the areas where the tiled pieces are
+ aligned tend to show up (one overlapping or empty pixel)
+ */
+ class DRAWINGLAYER_DLLPUBLIC FillBitmapPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the geometric definition
+ basegfx::B2DHomMatrix maTransformation;
+
+ /// the fill attributes
+ attribute::FillBitmapAttribute maFillBitmap;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ FillBitmapPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransformation,
+ const attribute::FillBitmapAttribute& rFillBitmap);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
+ const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLBITMAPPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/fillgradientprimitive2d.hxx b/include/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
new file mode 100644
index 000000000000..0f6c33ae8f95
--- /dev/null
+++ b/include/drawinglayer/primitive2d/fillgradientprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_FILLGRADIENTPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRADIENTPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx { class B2DPolygon; }
+
+//////////////////////////////////////////////////////////////////////////////
+// FillGradientPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** FillGradientPrimitive2D class
+
+ This class defines a gradient filling for a rectangular area. The
+ Range is defined by the Transformation, the gradient by the FillGradientAttribute.
+
+ The decomposition will deliver the decomposed gradient, e.g. for an ellipse
+ gradient the various ellipses in various color steps will be created.
+
+ I have added functionality to create both versions of filled decompositions:
+ Those who overlap and non-overlapping ones. The overlapping version is the
+ default one since it works with and without AntiAliasing. The non-overlapping
+ version is used in the MetafilePrimitive2D decomposition when the old XOR
+ paint was recorded.
+ */
+ class DRAWINGLAYER_DLLPUBLIC FillGradientPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the geometric definition
+ basegfx::B2DRange maObjectRange;
+
+ /// the gradient definition
+ attribute::FillGradientAttribute maFillGradient;
+
+ /// local helpers
+ void generateMatricesAndColors(
+ std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ std::vector< basegfx::BColor >& rColors) const;
+ Primitive2DSequence createOverlappingFill(
+ const std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ const std::vector< basegfx::BColor >& rColors,
+ const basegfx::B2DPolygon& rUnitPolygon) const;
+ Primitive2DSequence createNonOverlappingFill(
+ const std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ const std::vector< basegfx::BColor >& rColors,
+ const basegfx::B2DPolygon& rUnitPolygon) const;
+
+ protected:
+ /// local helper
+ Primitive2DSequence createFill(bool bOverlapping) const;
+
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ FillGradientPrimitive2D(
+ const basegfx::B2DRange& rObjectRange,
+ const attribute::FillGradientAttribute& rFillGradient);
+
+ /// data read access
+ const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
+ const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRADIENTPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
new file mode 100644
index 000000000000..b0c27ba89107
--- /dev/null
+++ b/include/drawinglayer/primitive2d/fillhatchprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// FillHatchPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** FillHatchPrimitive2D class
+
+ This class defines a hatch filling for a rectangular area. The
+ Range is defined by the Transformation, the hatch by the FillHatchAttribute.
+ If the background is to be filled, a flag in FillHatchAttribute is set and
+ the BColor defines the background color.
+
+ The decomposition will deliver the hatch lines.
+ */
+ class DRAWINGLAYER_DLLPUBLIC FillHatchPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the geometric definition
+ basegfx::B2DRange maObjectRange;
+
+ /// the hatch definition
+ attribute::FillHatchAttribute maFillHatch;
+
+ /// hatch background color (if used)
+ basegfx::BColor maBColor;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ FillHatchPrimitive2D(
+ const basegfx::B2DRange& rObjectRange,
+ const basegfx::BColor& rBColor,
+ const attribute::FillHatchAttribute& rFillHatch);
+
+ /// data read access
+ const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
+ const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
+ const basegfx::BColor& getBColor() const { return maBColor; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/graphicprimitive2d.hxx b/include/drawinglayer/primitive2d/graphicprimitive2d.hxx
new file mode 100644
index 000000000000..75bb6fc99341
--- /dev/null
+++ b/include/drawinglayer/primitive2d/graphicprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_GRAPHICPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRAPHICPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svtools/grfmgr.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** GraphicPrimitive2D class
+
+ Primitive to hold graphics defined by GraphicObject and GraphicAttr
+ combination. This includes MetaFiles and diverse pixel-oriented graphic
+ formats. It even includes animated GIFs, Croppings and other changes
+ defined in GraphicAttr.
+
+ This makes the decomposition contain a wide variety of possibilites,
+ too. From a simple BitmapPrimitive over AnimatedSwitchPrimitive2D,
+ MetafilePrimitive2D (with and without embedding in a masking when e.g.
+ the Metafile is bigger than the geometry) and embeddings in
+ TransformPrimitive2D and MaskPrimitive2D for croppings.
+
+ The primitive geometry area is defined by Transform.
+ */
+ class DRAWINGLAYER_DLLPUBLIC GraphicPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the geometric definition
+ basegfx::B2DHomMatrix maTransform;
+
+ /// the GraphicObject with all it's content possibilities
+ GraphicObject maGraphicObject;
+
+ /// The GraphicAttr with all it's modification possibilities
+ GraphicAttr maGraphicAttr;
+
+ protected:
+ /// local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor(s)
+ GraphicPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ const GraphicObject& rGraphicObject,
+ const GraphicAttr& rGraphicAttr);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const GraphicObject& getGraphicObject() const { return maGraphicObject; }
+ const GraphicAttr& getGraphicAttr() const { return maGraphicAttr; }
+ bool isTransparent() const;
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRAPHICPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/gridprimitive2d.hxx b/include/drawinglayer/primitive2d/gridprimitive2d.hxx
new file mode 100644
index 000000000000..3db300ff4da4
--- /dev/null
+++ b/include/drawinglayer/primitive2d/gridprimitive2d.hxx
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRIDPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRIDPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <vcl/bitmapex.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// GridPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** GridPrimitive2D class
+
+ This primitive is specialized to Grid visualisation. The graphic definition
+ (Transform) contains the whole grid area, but will of course be combined
+ with the visible area (Viewport) when decomposed. Also a reolution-dependent
+ point reduction is used to not create too much grid visualisation data. This
+ makes this primitive highly view-dependent and it dynamically buffers
+ the last decomposition dependent from the Viewport used.
+ */
+ class DRAWINGLAYER_DLLPUBLIC GridPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// The geometry definition for the grid area
+ basegfx::B2DHomMatrix maTransform;
+
+ /// grid layout definitions
+ double mfWidth;
+ double mfHeight;
+ double mfSmallestViewDistance;
+ double mfSmallestSubdivisionViewDistance;
+ sal_uInt32 mnSubdivisionsX;
+ sal_uInt32 mnSubdivisionsY;
+
+ /// Grid color for single-pixel grid points
+ basegfx::BColor maBColor;
+
+ /// The Bitmap (with transparence) for grid cross points
+ BitmapEx maCrossMarker;
+
+ /** the last used object to view transformtion and the last Viewport,
+ used from getDecomposition for decide buffering
+ */
+ basegfx::B2DHomMatrix maLastObjectToViewTransformation;
+ basegfx::B2DRange maLastViewport;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ GridPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ double fWidth,
+ double fHeight,
+ double fSmallestViewDistance,
+ double fSmallestSubdivisionViewDistance,
+ sal_uInt32 nSubdivisionsX,
+ sal_uInt32 nSubdivisionsY,
+ const basegfx::BColor& rBColor,
+ const BitmapEx& rCrossMarker);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ double getWidth() const { return mfWidth; }
+ double getHeight() const { return mfHeight; }
+ double getSmallestViewDistance() const { return mfSmallestViewDistance; }
+ double getSmallestSubdivisionViewDistance() const { return mfSmallestSubdivisionViewDistance; }
+ sal_uInt32 getSubdivisionsX() const { return mnSubdivisionsX; }
+ sal_uInt32 getSubdivisionsY() const { return mnSubdivisionsY; }
+ const basegfx::BColor& getBColor() const { return maBColor; }
+ const BitmapEx& getCrossMarker() const { return maCrossMarker; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get 2d range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+
+ /// Overload standard getDecomposition call to be view-dependent here
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRIDPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/groupprimitive2d.hxx b/include/drawinglayer/primitive2d/groupprimitive2d.hxx
new file mode 100644
index 000000000000..7dab4a628638
--- /dev/null
+++ b/include/drawinglayer/primitive2d/groupprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// GroupPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** GroupPrimitive2D class
+
+ Baseclass for all grouping 2D primitives
+
+ The grouping primitive in it's basic form is capable of holding
+ a child primitive content and returns it on decomposition on default.
+ It is used for two main purposes, but more may apply:
+
+ - to transport extended information, e.g. for text classification,
+ see e.g. TextHierarchy*Primitive2D implementations. Since they
+ decompose to their child content, renderers not aware/interested
+ in that extra information will just ignore these primitives
+
+ - to encapsulate common geometry, e.g. the ShadowPrimitive2D implements
+ applying a generic shadow to a child sequence by adding the needed
+ offset and color stuff in the decomposition
+
+ In most cases the decomposition is straightforward, so by default
+ this primitive will not buffer the result and is not derived from
+ BufferedDecompositionPrimitive2D, but from BasePrimitive2D.
+
+ A renderer has to take GroupPrimitive2D derivations into account which
+ are used to hold a state.
+
+ Current Basic 2D StatePrimitives are:
+
+ - TransparencePrimitive2D (objects with freely defined transparence)
+ - InvertPrimitive2D (for XOR)
+ - MaskPrimitive2D (for masking)
+ - ModifiedColorPrimitive2D (for a stack of color modifications)
+ - TransformPrimitive2D (for a transformation stack)
+ */
+ class DRAWINGLAYER_DLLPUBLIC GroupPrimitive2D : public BasePrimitive2D
+ {
+ private:
+ /// the children. Declared private since this shall never be changed at all after construction
+ Primitive2DSequence maChildren;
+
+ public:
+ /// constructor
+ explicit GroupPrimitive2D(const Primitive2DSequence& rChildren);
+
+ /// data read access
+ const Primitive2DSequence& getChildren() const { return maChildren; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// local decomposition. Implementation will just return children
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GROUPPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/helplineprimitive2d.hxx b/include/drawinglayer/primitive2d/helplineprimitive2d.hxx
new file mode 100644
index 000000000000..c9addb8f3810
--- /dev/null
+++ b/include/drawinglayer/primitive2d/helplineprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_HELPLINEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HELPLINEPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// HelplinePrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** HelplineStyle2D definition
+
+ The available styles of Helplines
+ */
+ enum HelplineStyle2D
+ {
+ HELPLINESTYLE2D_POINT,
+ HELPLINESTYLE2D_LINE
+ };
+
+ /** HelplinePrimitive2D class
+
+ This primitive provides a view-dependent helpline definition. The Helpline
+ is defined by a line equation (Point and vector) and a style. When the style
+ is a line, dependent from Viewport the visible part of that Helpline is
+ constructed. For Point, a cross is constructed. This primitive is highly
+ view-dependent.
+
+ The visualisation uses the two given colors to create a dashed line with
+ the given dash length.
+ */
+ class DRAWINGLAYER_DLLPUBLIC HelplinePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// Helpline geometry definition
+ basegfx::B2DPoint maPosition;
+ basegfx::B2DVector maDirection;
+ HelplineStyle2D meStyle;
+
+ /// Helpline style definition
+ basegfx::BColor maRGBColA;
+ basegfx::BColor maRGBColB;
+ double mfDiscreteDashLength;
+
+ /** the last used object to view transformtion and the last Viewport,
+ used from getDecomposition for decide buffering
+ */
+ basegfx::B2DHomMatrix maLastObjectToViewTransformation;
+ basegfx::B2DRange maLastViewport;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ HelplinePrimitive2D(
+ const basegfx::B2DPoint& rPosition,
+ const basegfx::B2DVector& rDirection,
+ HelplineStyle2D eStyle,
+ const basegfx::BColor& rRGBColA,
+ const basegfx::BColor& aRGBColB,
+ double fDiscreteDashLength);
+
+ /// data read access
+ const basegfx::B2DPoint& getPosition() const { return maPosition; }
+ const basegfx::B2DVector& getDirection() const { return maDirection; }
+ HelplineStyle2D getStyle() const { return meStyle; }
+ const basegfx::BColor& getRGBColA() const { return maRGBColA; }
+ const basegfx::BColor& getRGBColB() const { return maRGBColB; }
+ double getDiscreteDashLength() const { return mfDiscreteDashLength; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+
+ /// Overload standard getDecomposition call to be view-dependent here
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HELPLINEPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx b/include/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx
new file mode 100644
index 000000000000..35c8de40bc4d
--- /dev/null
+++ b/include/drawinglayer/primitive2d/hiddengeometryprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_HIDDENGEOMETRYPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HIDDENGEOMETRYPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ // This primitive is used to represent geometry for non-visible objects,
+ // e.g. a PresObj's outline. To still be able to use primitives for HitTest
+ // functionality, the 2d decompositions will produce an as much as possible
+ // simplified line geometry encapsulated in this primtive when there is no
+ // line geometry. In a further enchanced version this may change to 'if neither
+ // filled nor lines' creation criteria. The whole primitive decomposes to nothing,
+ // so no one not knowing it will be influenced. Only helper processors for hit test
+ // (and maybe BoundRect extractors) will use it and it's children subcontent.
+ class DRAWINGLAYER_DLLPUBLIC HiddenGeometryPrimitive2D : public GroupPrimitive2D
+ {
+ public:
+ explicit HiddenGeometryPrimitive2D(const Primitive2DSequence& rChildren);
+
+ // despite returning an empty decomposition since it's no visualisation data,
+ // range calculation is intended to use hidden geometry, so
+ // the local implementation will return the children's range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// local decomposition. Implementation will return empty Primitive2DSequence
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HIDDENGEOMETRYPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/invertprimitive2d.hxx b/include/drawinglayer/primitive2d/invertprimitive2d.hxx
new file mode 100644
index 000000000000..dfff3d9034ba
--- /dev/null
+++ b/include/drawinglayer/primitive2d/invertprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_INVERTPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_INVERTPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** InvertPrimitive2D class
+
+ This is a helper class which encapsulates geometry that should be
+ painted XOR, e.g. old cursor visualisations. It decomposes to
+ it's content, so when not supporting it, the contained geometry
+ will be visualized normally.
+ Unfortunately this is still needed, but hard to support on various
+ systems. XOR painting needs read access to the target, so modern
+ graphic systems tend to not support it anymore.
+ */
+ class DRAWINGLAYER_DLLPUBLIC InvertPrimitive2D : public GroupPrimitive2D
+ {
+ public:
+ /// constructor
+ explicit InvertPrimitive2D(const Primitive2DSequence& rChildren);
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_INVERTPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/markerarrayprimitive2d.hxx b/include/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
new file mode 100644
index 000000000000..b1bca354e60e
--- /dev/null
+++ b/include/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MARKERARRAYPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MARKERARRAYPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <vcl/bitmapex.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// MarkerArrayPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** MarkerArrayPrimitive2D class
+
+ This primtive defines an array of markers. Their size is defined
+ in pixels and independent from the view transformation which makes
+ this primitive highly view-dependent. It is also transformation
+ invariant, so that the bitmap is always visualized unscaled and
+ unrotated.
+ It is used e.g. for grid position visualisation. The given Bitmap
+ (with transparence) is defined to be visible centered at each of the given
+ positions.
+ It decomposes to the needed number of BitmapPrimitive2D's, so it would
+ be efficient to handle it directly in a renderer.
+ */
+ class DRAWINGLAYER_DLLPUBLIC MarkerArrayPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the positions for the marker
+ std::vector< basegfx::B2DPoint > maPositions;
+
+ /// the marker definintion to visualize
+ BitmapEx maMarker;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ MarkerArrayPrimitive2D(
+ const std::vector< basegfx::B2DPoint >& rPositions,
+ const BitmapEx& rMarker);
+
+ /// data read access
+ const std::vector< basegfx::B2DPoint >& getPositions() const { return maPositions; }
+ const BitmapEx& getMarker() const { return maMarker; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MARKERARRAYPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/maskprimitive2d.hxx b/include/drawinglayer/primitive2d/maskprimitive2d.hxx
new file mode 100644
index 000000000000..af5fcd9177d1
--- /dev/null
+++ b/include/drawinglayer/primitive2d/maskprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** MaskPrimitive2D class
+
+ This is the central masking primitive. It's a grouping
+ primitive and contains a PolyPolygon which defines the visible
+ area. Only visualisation parts of the Child primitive sequence
+ inside of the mask PolyPolygon is defined to be visible.
+
+ This primitive should be handled by a renderer. If it is not handled,
+ it decomposes to it's Child content, and thus the visualisation would
+ contaiun no clips.
+
+ The geometrc range of this primitive is completely defined by the Mask
+ PolyPolygon since by definition nothing outside of the mask is visible.
+ */
+ class DRAWINGLAYER_DLLPUBLIC MaskPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ /// the mask PolyPolygon
+ basegfx::B2DPolyPolygon maMask;
+
+ public:
+ /// constructor
+ MaskPrimitive2D(
+ const basegfx::B2DPolyPolygon& rMask,
+ const Primitive2DSequence& rChildren);
+
+ /// data read access
+ const basegfx::B2DPolyPolygon& getMask() const { return maMask; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/mediaprimitive2d.hxx b/include/drawinglayer/primitive2d/mediaprimitive2d.hxx
new file mode 100644
index 000000000000..df75569ecb64
--- /dev/null
+++ b/include/drawinglayer/primitive2d/mediaprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_MEDIAPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MEDIAPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <vcl/graph.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** MediaPrimitive2D class
+
+ This is a unified primitive for Media visualisation, e.g. animations
+ or sounds. It's geometry is defined by Transform. For conveinience,
+ it also contains a discrete border size (aka Pixels) which will be added
+ if used. This makes it a view-dependent primitive. It also gets a filled
+ background and the decomposition will try to create a graphic representation
+ if te content (defined by the URL), e.g. a still frome for animated stuff.
+ */
+ class DRAWINGLAYER_DLLPUBLIC MediaPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the geometry definition
+ basegfx::B2DHomMatrix maTransform;
+
+ /// the content definition
+ OUString maURL;
+
+ /// style: background color
+ basegfx::BColor maBackgroundColor;
+
+ /// discrete border (in 'pixels')
+ sal_uInt32 mnDiscreteBorder;
+
+ const Graphic maSnapshot;
+
+ protected:
+ /// local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ MediaPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ const OUString& rURL,
+ const basegfx::BColor& rBackgroundColor,
+ sal_uInt32 nDiscreteBorder,
+ const Graphic &rSnapshot);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const OUString& getURL() const { return maURL; }
+ const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
+ sal_uInt32 getDiscreteBorder() const { return mnDiscreteBorder; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MEDIAPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/metafileprimitive2d.hxx b/include/drawinglayer/primitive2d/metafileprimitive2d.hxx
new file mode 100644
index 000000000000..a8e8cf883991
--- /dev/null
+++ b/include/drawinglayer/primitive2d/metafileprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_METAFILEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_METAFILEPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <vcl/gdimtf.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// MetafilePrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** MetafilePrimitive2D class
+
+ This is the MetaFile representing primitive. It's geometry is defined
+ by MetaFileTransform. The content (defined by MetaFile) will be scaled
+ to the geometric definiton by using PrefMapMode and PrefSize of the
+ Metafile.
+
+ It has shown that this not always guarantees that all Metafile content
+ is inside the geometric definition, but this primitive defines that this
+ is the case to allow a getB2DRange implementation. If it cannot be
+ guaranteed that the Metafile is inside the geometric definition, it should
+ be embedded to a MaskPrimitive2D.
+
+ This primitive has no decomposition yet, so when not supported by a renderer,
+ it will not be visualized.
+
+ In the future, a decomposition implementation would be appreciated and would
+ have many advantages; Metafile would no longer have to be rendered by
+ sub-systems and a standard way for converting Metafiles would exist.
+ */
+ class DRAWINGLAYER_DLLPUBLIC MetafilePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the geometry definition
+ basegfx::B2DHomMatrix maMetaFileTransform;
+
+ /// the content definition
+ GDIMetaFile maMetaFile;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ public:
+ /// constructor
+ MetafilePrimitive2D(
+ const basegfx::B2DHomMatrix& rMetaFileTransform,
+ const GDIMetaFile& rMetaFile);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getTransform() const { return maMetaFileTransform; }
+ const GDIMetaFile& getMetaFile() const { return maMetaFile; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_METAFILEPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx b/include/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
new file mode 100644
index 000000000000..7584cfad27b7
--- /dev/null
+++ b/include/drawinglayer/primitive2d/modifiedcolorprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <basegfx/color/bcolormodifier.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** ModifiedColorPrimitive2D class
+
+ This primitive is a grouping primitive and allows to define
+ how the colors of it's child content shall be modified for
+ visualisation. This can be (and is) used e.g. for generic shadow
+ visualisation by forcing all color usages of the contained
+ sub-content to the shadow color.
+
+ For the possibilities of color modifications, please refer
+ to the basegfx::BColorModifier definitions in basegfx. For
+ processing there is tooling in basegfx to build a stack of
+ BColorModifiers to always be able to proccess the correct
+ colors.
+
+ If a renderer does not handle this primitive, the content will
+ be visualized unchanged.
+ */
+ class DRAWINGLAYER_DLLPUBLIC ModifiedColorPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ /// The ColorModifier to use
+ basegfx::BColorModifier maColorModifier;
+
+ public:
+ /// constructor
+ ModifiedColorPrimitive2D(
+ const Primitive2DSequence& rChildren,
+ const basegfx::BColorModifier& rColorModifier);
+
+ /// data read access
+ const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/objectinfoprimitive2d.hxx b/include/drawinglayer/primitive2d/objectinfoprimitive2d.hxx
new file mode 100644
index 000000000000..ec5452773751
--- /dev/null
+++ b/include/drawinglayer/primitive2d/objectinfoprimitive2d.hxx
@@ -0,0 +1,73 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_INFOHIERARCHYPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_INFOHIERARCHYPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <tools/string.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** ObjectInfoPrimitive2D class
+
+ Info hierarchy helper class to hold contents like Name, Title and
+ Description which are valid for the child content, e.g. created for
+ primitives based on DrawingLayer objects or SVG parts. It decomposes
+ to it's content, so all direct renderers may ignore it. May e.g.
+ be used when re-creating graphical content from a sequence of primitives
+ */
+ class DRAWINGLAYER_DLLPUBLIC ObjectInfoPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ OUString maName;
+ OUString maTitle;
+ OUString maDesc;
+
+ public:
+ /// constructor
+ ObjectInfoPrimitive2D(
+ const Primitive2DSequence& rChildren,
+ const OUString& rName,
+ const OUString& rTitle,
+ const OUString& rDesc);
+
+ /// data read access
+ const OUString& getName() const { return maName; }
+ const OUString& getTitle() const { return maTitle; }
+ const OUString& getDesc() const { return maDesc; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_INFOHIERARCHYPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/include/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx b/include/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx
new file mode 100644
index 000000000000..5acdf2157f10
--- /dev/null
+++ b/include/drawinglayer/primitive2d/pagepreviewprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_PAGEPREVIEWPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PAGEPREVIEWPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PagePreviewPrimitive2D class
+
+ This primitive is needed to have the correct XDrawPage as ViewInformation for decomposing
+ the page contents (given as PageContent here) if these contain e.g.
+ view-dependent (in this case XDrawPage-dependent) text fields like PageNumber. If You want
+ those primitives to be visualized correctly, Your renderer needs to locally correct it's
+ ViewInformation2D to reference the new XDrawPage.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PagePreviewPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /** the XDrawPage visualized by this primitive. When we go forward with primitives
+ this will not only be used by the renderers to provide the correct decompose
+ graphic attribute context, but also to completely create the page's sub-content.
+ */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mxDrawPage;
+
+ /// the PageContent
+ Primitive2DSequence maPageContent;
+
+ /// the own geometry
+ basegfx::B2DHomMatrix maTransform;
+
+ /// content width and height
+ double mfContentWidth;
+ double mfContentHeight;
+
+ /// bitfield
+ /// flag to allow keeping the aspect ratio
+ unsigned mbKeepAspectRatio : 1;
+
+ protected:
+ /// local decomposition. Implementation will just return children
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PagePreviewPrimitive2D(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage,
+ const basegfx::B2DHomMatrix& rTransform,
+ double fContentWidth,
+ double fContentHeight,
+ const Primitive2DSequence& rPageContent,
+ bool bKeepAspectRatio);
+
+ /// data read access
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& getXDrawPage() const { return mxDrawPage; }
+ const Primitive2DSequence& getPageContent() const { return maPageContent; }
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ double getContentWidth() const { return mfContentWidth; }
+ double getContentHeight() const { return mfContentHeight; }
+ bool getKeepAspectRatio() const { return mbKeepAspectRatio; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// own getB2DRange
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PAGEPREVIEWPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/patternfillprimitive2d.hxx b/include/drawinglayer/primitive2d/patternfillprimitive2d.hxx
new file mode 100644
index 000000000000..7787d6f6ba28
--- /dev/null
+++ b/include/drawinglayer/primitive2d/patternfillprimitive2d.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PATTERNFILLPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PATTERNFILLPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PatternFillPrimitive2D class
+
+ This primitive allows filling a given PolyPolygon with a pattern
+ defined by a sequence of primitives which are mapped to the unit range.
+ The pattern is defined using a reference range which defines a rectangular
+ area relative to the PolyPolygon (in unit coordinates) which is virtually
+ infinitely repeated.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PatternFillPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ const basegfx::B2DPolyPolygon maMask;
+ const Primitive2DSequence maChildren;
+ const basegfx::B2DRange maReferenceRange;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PatternFillPrimitive2D(
+ const basegfx::B2DPolyPolygon& rMask,
+ const Primitive2DSequence& rChildren,
+ const basegfx::B2DRange& rReferenceRange);
+
+ /// data read access
+ const basegfx::B2DPolyPolygon& getMask() const { return maMask; }
+ const Primitive2DSequence& getChildren() const { return maChildren; }
+ const basegfx::B2DRange& getReferenceRange() const { return maReferenceRange; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PATTERNFILLPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx b/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
new file mode 100644
index 000000000000..8acb5956f60f
--- /dev/null
+++ b/include/drawinglayer/primitive2d/pointarrayprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_POINTARRAYPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POINTARRAYPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// PointArrayPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PointArrayPrimitive2D class
+
+ This primitive defines single,discrete 'pixels' for the given
+ positions in the given color. This makes it view-dependent since
+ the logic size of a 'pixel' depends on the view transformation.
+
+ This is one of the non-decomposable primitives, so a renderer
+ should proccess it (Currently it is only used for grid visualisation,
+ but this may change).
+ */
+ class DRAWINGLAYER_DLLPUBLIC PointArrayPrimitive2D : public BasePrimitive2D
+ {
+ private:
+ /// the array of positions
+ std::vector< basegfx::B2DPoint > maPositions;
+
+ /// the color to use
+ basegfx::BColor maRGBColor;
+
+ /// #i96669# add simple range buffering for this primitive
+ basegfx::B2DRange maB2DRange;
+
+ public:
+ /// constructor
+ PointArrayPrimitive2D(
+ const std::vector< basegfx::B2DPoint >& rPositions,
+ const basegfx::BColor& rRGBColor);
+
+ /// data read access
+ const std::vector< basegfx::B2DPoint >& getPositions() const { return maPositions; }
+ const basegfx::BColor& getRGBColor() const { return maRGBColor; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POINTARRAYPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/polygonprimitive2d.hxx b/include/drawinglayer/primitive2d/polygonprimitive2d.hxx
new file mode 100644
index 000000000000..09e5b29039b3
--- /dev/null
+++ b/include/drawinglayer/primitive2d/polygonprimitive2d.hxx
@@ -0,0 +1,310 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYGONPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYGONPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
+#include <drawinglayer/attribute/linestartendattribute.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// PolygonHairlinePrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolygonHairlinePrimitive2D class
+
+ This primitive defines a Hairline. Since hairlines are view-dependent,
+ this primitive is view-dependent, too.
+
+ This is one of the non-decomposable primitives, so a renderer
+ should proccess it.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolygonHairlinePrimitive2D : public BasePrimitive2D
+ {
+ private:
+ /// the hairline geometry
+ basegfx::B2DPolygon maPolygon;
+
+ /// the hairline color
+ basegfx::BColor maBColor;
+
+ public:
+ /// constructor
+ PolygonHairlinePrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const basegfx::BColor& rBColor);
+
+ /// data read access
+ const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; }
+ const basegfx::BColor& getBColor() const { return maBColor; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// PolygonMarkerPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolygonMarkerPrimitive2D class
+
+ This primitive defines a two-colored marker hairline which is
+ dashed with the given dash length. Since hairlines are view-dependent,
+ this primitive is view-dependent, too.
+
+ It will be decomposed to the needed PolygonHairlinePrimitive2D if
+ not handled directly by a renderer.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolygonMarkerPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the marker hairline geometry
+ basegfx::B2DPolygon maPolygon;
+
+ /// the two colors
+ basegfx::BColor maRGBColorA;
+ basegfx::BColor maRGBColorB;
+
+ /// the dash distance in 'pixels'
+ double mfDiscreteDashLength;
+
+ /// decomposition is view-dependent, remember last InverseObjectToViewTransformation
+ basegfx::B2DHomMatrix maLastInverseObjectToViewTransformation;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolygonMarkerPrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const basegfx::BColor& rRGBColorA,
+ const basegfx::BColor& rRGBColorB,
+ double fDiscreteDashLength);
+
+ /// data read access
+ const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; }
+ const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
+ const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
+ double getDiscreteDashLength() const { return mfDiscreteDashLength; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// PolygonStrokePrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolygonStrokePrimitive2D class
+
+ This primitive defines a line with line width, line join, line color
+ and stroke attributes. It will be decomposed dependent on the definition
+ to the needed primitives, e.g. filled PolyPolygons for fat lines.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolygonStrokePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the line geometry
+ basegfx::B2DPolygon maPolygon;
+
+ /// the line attributes like width, join and color
+ attribute::LineAttribute maLineAttribute;
+
+ /// the line stroking (if used)
+ attribute::StrokeAttribute maStrokeAttribute;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolygonStrokePrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const attribute::LineAttribute& rLineAttribute,
+ const attribute::StrokeAttribute& rStrokeAttribute);
+
+ /// constructor without stroking
+ PolygonStrokePrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const attribute::LineAttribute& rLineAttribute);
+
+ /// data read access
+ const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; }
+ const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
+ const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// PolygonWavePrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolygonWavePrimitive2D class
+
+ This primitive defines a waveline based on a PolygonStrokePrimitive2D
+ where the wave is defined by wave width and wave length.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolygonWavePrimitive2D : public PolygonStrokePrimitive2D
+ {
+ private:
+ /// wave definition
+ double mfWaveWidth;
+ double mfWaveHeight;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolygonWavePrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const attribute::LineAttribute& rLineAttribute,
+ const attribute::StrokeAttribute& rStrokeAttribute,
+ double fWaveWidth,
+ double fWaveHeight);
+
+ /// constructor without stroking
+ PolygonWavePrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const attribute::LineAttribute& rLineAttribute,
+ double fWaveWidth,
+ double fWaveHeight);
+
+ /// data read access
+ double getWaveWidth() const { return mfWaveWidth; }
+ double getWaveHeight() const { return mfWaveHeight; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// PolygonStrokeArrowPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolygonStrokeArrowPrimitive2D class
+
+ This primitive defines a PolygonStrokePrimitive2D which is extended
+ eventually by start and end definitions which are normally used for
+ arrows.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolygonStrokeArrowPrimitive2D : public PolygonStrokePrimitive2D
+ {
+ private:
+ /// geometric definitions for line start and end
+ attribute::LineStartEndAttribute maStart;
+ attribute::LineStartEndAttribute maEnd;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolygonStrokeArrowPrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const attribute::LineAttribute& rLineAttribute,
+ const attribute::StrokeAttribute& rStrokeAttribute,
+ const attribute::LineStartEndAttribute& rStart,
+ const attribute::LineStartEndAttribute& rEnd);
+
+ /// data read access
+ const attribute::LineStartEndAttribute& getStart() const { return maStart; }
+ const attribute::LineStartEndAttribute& getEnd() const { return maEnd; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYGONPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
new file mode 100644
index 000000000000..f53d4cdf5759
--- /dev/null
+++ b/include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
@@ -0,0 +1,382 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/attribute/fillbitmapattribute.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
+#include <drawinglayer/attribute/linestartendattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// PolyPolygonHairlinePrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolyPolygonHairlinePrimitive2D class
+
+ This primitive defines a multi-PolygonHairlinePrimitive2D and is
+ just for convenience. The definition is not different from the single
+ defined PolygonHairlinePrimitive2Ds.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolyPolygonHairlinePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the hairline geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the hairline color
+ basegfx::BColor maBColor;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolyPolygonHairlinePrimitive2D(const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::BColor& rBColor);
+
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ const basegfx::BColor& getBColor() const { return maBColor; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// PolyPolygonMarkerPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolyPolygonMarkerPrimitive2D class
+
+ This primitive defines a multi-PolygonMarkerPrimitive2D and is
+ just for convenience. The definition is not different from the single
+ defined PolygonMarkerPrimitive2Ds.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolyPolygonMarkerPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the marker hairline geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the two colors
+ basegfx::BColor maRGBColorA;
+ basegfx::BColor maRGBColorB;
+
+ /// the dash distance in 'pixels'
+ double mfDiscreteDashLength;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolyPolygonMarkerPrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const basegfx::BColor& rRGBColorA,
+ const basegfx::BColor& rRGBColorB,
+ double fDiscreteDashLength);
+
+ // data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
+ const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
+ double getDiscreteDashLength() const { return mfDiscreteDashLength; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// PolyPolygonStrokePrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolyPolygonStrokePrimitive2D class
+
+ This primitive defines a multi-PolygonStrokePrimitive2D and is
+ just for convenience. The definition is not different from the single
+ defined PolygonStrokePrimitive2Ds.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolyPolygonStrokePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the line geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the line attributes like width, join and color
+ attribute::LineAttribute maLineAttribute;
+
+ /// the line stroking (if used)
+ attribute::StrokeAttribute maStrokeAttribute;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolyPolygonStrokePrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const attribute::LineAttribute& rLineAttribute,
+ const attribute::StrokeAttribute& rStrokeAttribute);
+
+ PolyPolygonStrokePrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const attribute::LineAttribute& rLineAttribute);
+
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
+ const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// PolyPolygonColorPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolyPolygonColorPrimitive2D class
+
+ This primitive defines a PolyPolygon filled with a single color.
+ This is one of the non-decomposable primitives, so a renderer
+ should proccess it.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolyPolygonColorPrimitive2D : public BasePrimitive2D
+ {
+ private:
+ /// the PolyPolygon geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the polygon fill color
+ basegfx::BColor maBColor;
+
+ public:
+ /// constructor
+ PolyPolygonColorPrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const basegfx::BColor& rBColor);
+
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ const basegfx::BColor& getBColor() const { return maBColor; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// PolyPolygonGradientPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolyPolygonColorPrimitive2D class
+
+ This primitive defines a PolyPolygon filled with a gradient. The
+ decomosition will create a MaskPrimitive2D containing a
+ FillGradientPrimitive2D.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolyPolygonGradientPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the PolyPolygon geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the gradient definition
+ attribute::FillGradientAttribute maFillGradient;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolyPolygonGradientPrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const attribute::FillGradientAttribute& rFillGradient);
+
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// PolyPolygonHatchPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolyPolygonHatchPrimitive2D class
+
+ This primitive defines a PolyPolygon filled with a hatch. The
+ decomosition will create a MaskPrimitive2D containing a
+ FillHatchPrimitive2D.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolyPolygonHatchPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the PolyPolygon geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the hatch background color (if used)
+ basegfx::BColor maBackgroundColor;
+
+ /// the hatch definition
+ attribute::FillHatchAttribute maFillHatch;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolyPolygonHatchPrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const basegfx::BColor& rBackgroundColor,
+ const attribute::FillHatchAttribute& rFillHatch);
+
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
+ const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// PolyPolygonBitmapPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolyPolygonBitmapPrimitive2D class
+
+ This primitive defines a PolyPolygon filled with bitmap data
+ (including transparence). The decomosition will create a MaskPrimitive2D
+ containing a FillBitmapPrimitive2D.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolyPolygonBitmapPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the PolyPolygon geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the bitmap fill definition (may include tiling)
+ attribute::FillBitmapAttribute maFillBitmap;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolyPolygonBitmapPrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const attribute::FillBitmapAttribute& rFillBitmap);
+
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/primitivetools2d.hxx b/include/drawinglayer/primitive2d/primitivetools2d.hxx
new file mode 100644
index 000000000000..6ef63f1e916b
--- /dev/null
+++ b/include/drawinglayer/primitive2d/primitivetools2d.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_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVE2DTOOLS_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVE2DTOOLS_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** DiscreteMetricDependentPrimitive2D class
+
+ tooling class for BufferedDecompositionPrimitive2D baseed classes which are view-dependent
+ regarding the size of a discrete unit. The implementation of get2DDecomposition
+ guards the buffered local decomposition and ensures that a create2DDecomposition
+ implementation may use an up-to-date DiscreteUnit accessible using getDiscreteUnit()
+ */
+ class DRAWINGLAYER_DLLPUBLIC DiscreteMetricDependentPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /** the last used fDiscreteUnit definitions for decomposition. Since this
+ is checked and updated from get2DDecomposition() it will be current and
+ usable in create2DDecomposition()
+ */
+ double mfDiscreteUnit;
+
+ public:
+ /// constructor
+ DiscreteMetricDependentPrimitive2D()
+ : BufferedDecompositionPrimitive2D(),
+ mfDiscreteUnit(0.0)
+ {
+ }
+
+ /// data read access
+ double getDiscreteUnit() const { return mfDiscreteUnit; }
+
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** ViewportDependentPrimitive2D class
+
+ tooling class for BufferedDecompositionPrimitive2D baseed classes which are view-dependent
+ regarding the viewport. The implementation of get2DDecomposition
+ guards the buffered local decomposition and ensures that a create2DDecomposition
+ implementation may use an up-to-date Viewport accessible using getViewport()
+ */
+ class DRAWINGLAYER_DLLPUBLIC ViewportDependentPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /** the last used Viewport definition for decomposition. Since this
+ is checked and updated from get2DDecomposition() it will be current and
+ usable in create2DDecomposition()
+ */
+ basegfx::B2DRange maViewport;
+
+ public:
+ /// constructor
+ ViewportDependentPrimitive2D()
+ : BufferedDecompositionPrimitive2D(),
+ maViewport()
+ {
+ }
+
+ /// data read access
+ const basegfx::B2DRange& getViewport() const { return maViewport; }
+
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** ViewTransformationDependentPrimitive2D class
+
+ tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
+ regarding the complete Viewtransformation. The implementation of get2DDecomposition
+ guards the buffered local decomposition and ensures that a create2DDecomposition
+ implementation may use an up-to-date ViewTransformation accessible using getViewTransformation()
+ */
+ class DRAWINGLAYER_DLLPUBLIC ViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /** the last used ViewTransformation definition for decomposition. Since this
+ is checked and updated from get2DDecomposition() it will be current and
+ usable in create2DDecomposition()
+ */
+ basegfx::B2DHomMatrix maViewTransformation;
+
+ public:
+ /// constructor
+ ViewTransformationDependentPrimitive2D()
+ : BufferedDecompositionPrimitive2D(),
+ maViewTransformation()
+ {
+ }
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
+
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** ObjectAndViewTransformationDependentPrimitive2D class
+
+ tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
+ and Object-Transform dependent. The implementation of get2DDecomposition
+ guards the buffered local decomposition and ensures that a create2DDecomposition
+ implementation may use an up-to-date ViewTransformation accessible using getViewTransformation()
+ and an object transformation via getObjectTransformation()
+ */
+ class DRAWINGLAYER_DLLPUBLIC ObjectAndViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /** the last used ViewTransformation and the last ObjectTransformation
+ definition for decomposition. Since this is checked and updated from
+ get2DDecomposition() it will be current and usable in create2DDecomposition()
+ */
+ basegfx::B2DHomMatrix maViewTransformation;
+ basegfx::B2DHomMatrix maObjectTransformation;
+
+ public:
+ /// constructor
+ ObjectAndViewTransformationDependentPrimitive2D()
+ : BufferedDecompositionPrimitive2D(),
+ maViewTransformation(),
+ maObjectTransformation()
+ {
+ }
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVE2DTOOLS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/sceneprimitive2d.hxx b/include/drawinglayer/primitive2d/sceneprimitive2d.hxx
new file mode 100644
index 000000000000..d865ba15161a
--- /dev/null
+++ b/include/drawinglayer/primitive2d/sceneprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_SCENEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SCENEPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+#include <drawinglayer/geometry/viewinformation3d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <vcl/bitmapex.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** ScenePrimitive2D class
+
+ This primitive defines a 3D scene as a 2D primitive and is the anchor point
+ for a 3D visualisation. The decomposition is view-dependent and will try to
+ re-use already rendered 3D content.
+
+ The rendering is done using the default-3D renderer from basegfx which supports
+ AntiAliasing.
+
+ The 2D primitive's geometric range is defined completely by the
+ ObjectTransformation combined with evtl. 2D shadows from the 3D objects. The
+ shadows of 3D objects are 2D polygons, projected with the 3D transformation.
+
+ This is the class a renderer may process directly when he wants to implement
+ an own (e.g. system-specific) 3D renderer.
+ */
+ class DRAWINGLAYER_DLLPUBLIC ScenePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the 3D geometry definition
+ primitive3d::Primitive3DSequence mxChildren3D;
+
+ /// 3D scene attribute set
+ attribute::SdrSceneAttribute maSdrSceneAttribute;
+
+ /// lighting attribute set
+ attribute::SdrLightingAttribute maSdrLightingAttribute;
+
+ /// object transformation for scene for 2D definition
+ basegfx::B2DHomMatrix maObjectTransformation;
+
+ /// scene transformation set and object transformation
+ geometry::ViewInformation3D maViewInformation3D;
+
+ /// the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked)
+ Primitive2DSequence maShadowPrimitives;
+
+ /// bitfield
+ /** flag if given 3D geometry is already cheched for shadow definitions and 2d shadows
+ are created in maShadowPrimitives
+ */
+ unsigned mbShadow3DChecked : 1;
+
+ /// the last used NewDiscreteSize and NewUnitVisiblePart definitions for decomposition
+ double mfOldDiscreteSizeX;
+ double mfOldDiscreteSizeY;
+ basegfx::B2DRange maOldUnitVisiblePart;
+
+ /** the last created BitmapEx, e.g. for fast HitTest. This does not really need
+ memory since BitmapEx is internally RefCounted
+ */
+ BitmapEx maOldRenderedBitmap;
+
+ /// private helpers
+ bool impGetShadow3D(const geometry::ViewInformation2D& rViewInformation) const;
+ void calculateDiscreteSizes(
+ const geometry::ViewInformation2D& rViewInformation,
+ basegfx::B2DRange& rDiscreteRange,
+ basegfx::B2DRange& rVisibleDiscreteRange,
+ basegfx::B2DRange& rUnitVisibleRange) const;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// public helpers
+ /** Geometry extractor. Shadow will be added as in create2DDecomposition, but
+ the 3D content is not converted to a bitmap visualisation but to projected 2D gemetry. This
+ helper is useful e.g. for Contour extraction or HitTests.
+ */
+ Primitive2DSequence getGeometry2D() const;
+ Primitive2DSequence getShadow2D(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /** Fast HitTest which uses the last buffered BitmapEx from the last
+ rendered area if available. The return value describes if the check
+ could be done with the current information, so do NOT use o_rResult
+ when it returns false. o_rResult will be changed on return true and
+ then contains a definitive answer if content of this scene is hit or
+ not. On return false, it is normally necessary to use the geometric
+ HitTest (see CutFindProcessor usages). The given HitPoint
+ has to be in logic coordinates in scene's ObjectCoordinateSystem.
+ */
+ bool tryToCheckLastVisualisationDirectHit(const basegfx::B2DPoint& rLogicHitPoint, bool& o_rResult) const;
+
+ /// constructor
+ ScenePrimitive2D(
+ const primitive3d::Primitive3DSequence& rxChildren3D,
+ const attribute::SdrSceneAttribute& rSdrSceneAttribute,
+ const attribute::SdrLightingAttribute& rSdrLightingAttribute,
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ const geometry::ViewInformation3D& rViewInformation3D);
+
+ /// data read access
+ const primitive3d::Primitive3DSequence& getChildren3D() const { return mxChildren3D; }
+ const attribute::SdrSceneAttribute& getSdrSceneAttribute() const { return maSdrSceneAttribute; }
+ const attribute::SdrLightingAttribute& getSdrLightingAttribute() const { return maSdrLightingAttribute; }
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+ const geometry::ViewInformation3D& getViewInformation3D() const { return maViewInformation3D; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SCENEPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx b/include/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx
new file mode 100644
index 000000000000..5ac29383ff76
--- /dev/null
+++ b/include/drawinglayer/primitive2d/sdrdecompositiontools2d.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_DRAWINGLAYER_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class B2DPolyPolygon;
+ class B2DHomMatrix;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ // helpers to create HitTestPrimitives Line
+ Primitive2DReference DRAWINGLAYER_DLLPUBLIC createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DHomMatrix& rMatrix);
+
+ Primitive2DReference DRAWINGLAYER_DLLPUBLIC createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DPolyPolygon& rPolygon);
+
+ Primitive2DReference DRAWINGLAYER_DLLPUBLIC createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DRange& rRange);
+
+ Primitive2DReference DRAWINGLAYER_DLLPUBLIC createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DRange& rRange,
+ const basegfx::B2DHomMatrix& rMatrix);
+
+ Primitive2DReference DRAWINGLAYER_DLLPUBLIC createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DPolyPolygon& rPolygon,
+ const basegfx::B2DHomMatrix& rMatrix);
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/shadowprimitive2d.hxx b/include/drawinglayer/primitive2d/shadowprimitive2d.hxx
new file mode 100644
index 000000000000..956d1a3e2d76
--- /dev/null
+++ b/include/drawinglayer/primitive2d/shadowprimitive2d.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** ShadowPrimitive2D class
+
+ This primitive defines a generic shadow geometry construction
+ for 2D objects. It decomposes to a TransformPrimitive2D embedded
+ into a ModifiedColorPrimitive2D.
+
+ It's for primtive usage convenience, so that not everyone has
+ to implement the generic shadow construction by himself.
+
+ The same geometry as sequence of primitives is used as geometry and
+ as shadow. Since these are RefCounted Uno-Api objects, no extra objects
+ are needed for the shadow itself; all the local decompositions of the
+ original geometry can be reused from the renderer for shadow visualisation.
+ */
+ class DRAWINGLAYER_DLLPUBLIC ShadowPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ /// the shadow transformation, normally just an offset
+ basegfx::B2DHomMatrix maShadowTransform;
+
+ /// the shadow color to which all geometry is to be forced
+ basegfx::BColor maShadowColor;
+
+ public:
+ /// constructor
+ ShadowPrimitive2D(
+ const basegfx::B2DHomMatrix& rShadowTransform,
+ const basegfx::BColor& rShadowColor,
+ const Primitive2DSequence& rChildren);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; }
+ const basegfx::BColor& getShadowColor() const { return maShadowColor; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// create decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx b/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx
new file mode 100644
index 000000000000..bc2396e5ab23
--- /dev/null
+++ b/include/drawinglayer/primitive2d/structuretagprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_STRUCTURETAGPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_STRUCTURETAGPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <vcl/pdfwriter.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** StructureTagPrimitive2D class
+
+ This class is used to provode simple support for adding grouped
+ pdf writer structured element information like used in sd from
+ unomodel.cxx where a ViewObjectContactRedirector is used to add
+ such information for diverse objects.
+ This primitive encapsulates these and the VCLPdfRenderer uses it
+ to apply the needed infos directly to the pdf export in a compatible
+ way.
+ If a renderer ignores this, it just decomposes to it's child
+ content.
+ */
+ class DRAWINGLAYER_DLLPUBLIC StructureTagPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ /// the PDF structure element this grouping represents
+ vcl::PDFWriter::StructElement maStructureElement;
+
+ public:
+ /// constructor
+ StructureTagPrimitive2D(
+ const vcl::PDFWriter::StructElement& rStructureElement,
+ const Primitive2DSequence& rChildren);
+
+ /// data read access
+ const vcl::PDFWriter::StructElement& getStructureElement() const { return maStructureElement; }
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_STRUCTURETAGPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/svggradientprimitive2d.hxx b/include/drawinglayer/primitive2d/svggradientprimitive2d.hxx
new file mode 100644
index 000000000000..0e7dab93ff14
--- /dev/null
+++ b/include/drawinglayer/primitive2d/svggradientprimitive2d.hxx
@@ -0,0 +1,413 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SVGGRADIENTPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SVGGRADIENTPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// SvgGradientEntry class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /// a single GradientStop defining a color and opacity at a distance
+ class SvgGradientEntry
+ {
+ private:
+ double mfOffset;
+ basegfx::BColor maColor;
+ double mfOpacity;
+
+ public:
+ SvgGradientEntry(double fOffset, const basegfx::BColor& rColor = basegfx::BColor(0.0, 0.0, 0.0), double fOpacity = 1.0)
+ : mfOffset(fOffset),
+ maColor(rColor),
+ mfOpacity(fOpacity)
+ {
+ }
+
+ double getOffset() const { return mfOffset; }
+ const basegfx::BColor& getColor() const { return maColor; }
+ double getOpacity() const { return mfOpacity; }
+
+ bool operator==(const SvgGradientEntry& rCompare) const
+ {
+ return (getOffset() == rCompare.getOffset()
+ && getColor() == getColor()
+ && getOpacity() == getOpacity());
+ }
+
+ bool operator<(const SvgGradientEntry& rCompare) const
+ {
+ return getOffset() < rCompare.getOffset();
+ }
+ };
+
+ typedef ::std::vector< SvgGradientEntry > SvgGradientEntryVector;
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// SvgGradientHelper class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ enum SpreadMethod
+ {
+ Spread_pad = 0,
+ Spread_reflect,
+ Spread_repeat
+ };
+
+ /* helper for linear and radial gradient, both get derived from this
+ to share common definitions and functionality
+ **/
+ class SvgGradientHelper
+ {
+ private:
+ /// geometric definition, the geometry to be filled
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the gradient definition
+ SvgGradientEntryVector maGradientEntries;
+
+ /// start and/or center point
+ basegfx::B2DPoint maStart;
+
+ /// how to spread
+ SpreadMethod maSpreadMethod;
+
+ /// bitfield
+ bool mbPreconditionsChecked : 1;
+ bool mbCreatesContent : 1;
+ bool mbSingleEntry : 1;
+ bool mbFullyOpaque : 1;
+
+ // true = interpret in unit coordinate system -> object aspect ratio will scale result
+ // false = interpret in object coordinate system -> object aspect ratio will not scale result
+ // (related to SVG's gradientUnits (userSpaceOnUse|objectBoundingBox)
+ bool mbUseUnitCoordinates : 1;
+
+ protected:
+ /// local helpers
+ Primitive2DSequence createSingleGradientEntryFill() const;
+ virtual void createAtom(
+ Primitive2DVector& rTargetColor,
+ Primitive2DVector& rTargetOpacity,
+ const SvgGradientEntry& rFrom,
+ const SvgGradientEntry& rTo,
+ sal_Int32 nOffset) const = 0;
+ double createRun(
+ Primitive2DVector& rTargetColor,
+ Primitive2DVector& rTargetOpacity,
+ double fPos,
+ double fMax,
+ const SvgGradientEntryVector& rEntries,
+ sal_Int32 nOffset) const;
+ virtual void checkPreconditions();
+ Primitive2DSequence createResult(
+ const Primitive2DVector& rTargetColor,
+ const Primitive2DVector& rTargetOpacity,
+ const basegfx::B2DHomMatrix& rUnitGradientToObject,
+ bool bInvert = false) const;
+ bool getCreatesContent() const { return mbCreatesContent; }
+ bool getSingleEntry() const { return mbSingleEntry; }
+ void setSingleEntry() { mbSingleEntry = true; }
+ bool getPreconditionsChecked() const { return mbPreconditionsChecked; }
+ bool getFullyOpaque() const { return mbFullyOpaque; }
+
+ public:
+ /// constructor
+ SvgGradientHelper(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const SvgGradientEntryVector& rGradientEntries,
+ const basegfx::B2DPoint& rStart,
+ bool bUseUnitCoordinates,
+ SpreadMethod aSpreadMethod = Spread_pad);
+ virtual ~SvgGradientHelper() {}
+
+ /// data read access
+ const basegfx::B2DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; }
+ const SvgGradientEntryVector& getGradientEntries() const { return maGradientEntries; }
+ const basegfx::B2DPoint& getStart() const { return maStart; }
+ bool getUseUnitCoordinates() const { return mbUseUnitCoordinates; }
+ SpreadMethod getSpreadMethod() const { return maSpreadMethod; }
+
+ /// compare operator
+ bool equalTo(const SvgGradientHelper& rSvgGradientHelper) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// SvgLinearGradientPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /// the basic linear gradient primitive
+ class DRAWINGLAYER_DLLPUBLIC SvgLinearGradientPrimitive2D : public BufferedDecompositionPrimitive2D, public SvgGradientHelper
+ {
+ private:
+ /// the end point for linear gradient
+ basegfx::B2DPoint maEnd;
+
+ protected:
+ /// local helpers
+ virtual void createAtom(
+ Primitive2DVector& rTargetColor,
+ Primitive2DVector& rTargetOpacity,
+ const SvgGradientEntry& rFrom,
+ const SvgGradientEntry& rTo,
+ sal_Int32 nOffset) const;
+ virtual void checkPreconditions();
+
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ SvgLinearGradientPrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const SvgGradientEntryVector& rGradientEntries,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
+ bool bUseUnitCoordinates,
+ SpreadMethod aSpreadMethod = Spread_pad);
+ virtual ~SvgLinearGradientPrimitive2D();
+
+ /// data read access
+ const basegfx::B2DPoint& getEnd() const { return maEnd; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// SvgRadialGradientPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /// the basic radial gradient primitive
+ class DRAWINGLAYER_DLLPUBLIC SvgRadialGradientPrimitive2D : public BufferedDecompositionPrimitive2D, public SvgGradientHelper
+ {
+ private:
+ /// the geometric definition
+ double mfRadius;
+
+ /// Focal only used when focal is set at all, see constructors
+ basegfx::B2DPoint maFocal;
+ basegfx::B2DVector maFocalVector;
+ double maFocalLength;
+
+ // internal helper for case Spread_reflect
+ SvgGradientEntryVector maMirroredGradientEntries;
+
+ /// bitfield
+ bool mbFocalSet : 1;
+
+ /// local helpers
+ const SvgGradientEntryVector& getMirroredGradientEntries() const;
+ void createMirroredGradientEntries();
+
+ protected:
+ /// local helpers
+ virtual void createAtom(
+ Primitive2DVector& rTargetColor,
+ Primitive2DVector& rTargetOpacity,
+ const SvgGradientEntry& rFrom,
+ const SvgGradientEntry& rTo,
+ sal_Int32 nOffset) const;
+ virtual void checkPreconditions();
+
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ SvgRadialGradientPrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const SvgGradientEntryVector& rGradientEntries,
+ const basegfx::B2DPoint& rStart,
+ double fRadius,
+ bool bUseUnitCoordinates,
+ SpreadMethod aSpreadMethod = Spread_pad,
+ const basegfx::B2DPoint* pFocal = 0);
+ virtual ~SvgRadialGradientPrimitive2D();
+
+ /// data read access
+ double getRadius() const { return mfRadius; }
+ const basegfx::B2DPoint& getFocal() const { return maFocal; }
+ bool isFocalSet() const { return mbFocalSet; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// SvgLinearAtomPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /* basic primitive for a single linear GradientRun in unit coordiantes.
+ It's derived from DiscreteMetricDependentPrimitive2D to allow view-dependent
+ decompositions allowing reduced color steps
+ **/
+ class DRAWINGLAYER_DLLPUBLIC SvgLinearAtomPrimitive2D : public DiscreteMetricDependentPrimitive2D
+ {
+ private:
+ /// the geometric definition in unit coordiantes
+ basegfx::BColor maColorA;
+ basegfx::BColor maColorB;
+ double mfOffsetA;
+ double mfOffsetB;
+
+ protected:
+
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ SvgLinearAtomPrimitive2D(
+ const basegfx::BColor& aColorA, double fOffsetA,
+ const basegfx::BColor& aColorB, double fOffsetB);
+
+ /// data read access
+ const basegfx::BColor& getColorA() const { return maColorA; }
+ const basegfx::BColor& getColorB() const { return maColorB; }
+ double getOffsetA() const { return mfOffsetA; }
+ double getOffsetB() const { return mfOffsetB; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// SvgRadialAtomPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /* basic primitive for a single radial GradientRun in unit coordiantes.
+ It's derived from DiscreteMetricDependentPrimitive2D to allow view-dependent
+ decompositions allowing reduced color steps
+ **/
+ class DRAWINGLAYER_DLLPUBLIC SvgRadialAtomPrimitive2D : public DiscreteMetricDependentPrimitive2D
+ {
+ private:
+ /// the geometric definition in unit coordiantes
+ basegfx::BColor maColorA;
+ basegfx::BColor maColorB;
+ double mfScaleA;
+ double mfScaleB;
+
+ // helper to hold translation vectors when given (for focal)
+ struct VectorPair
+ {
+ basegfx::B2DVector maTranslateA;
+ basegfx::B2DVector maTranslateB;
+
+ VectorPair(const basegfx::B2DVector& rTranslateA, const basegfx::B2DVector& rTranslateB)
+ : maTranslateA(rTranslateA),
+ maTranslateB(rTranslateB)
+ {
+ }
+ };
+
+ /// Only used when focal is set
+ VectorPair* mpTranslate;
+
+ protected:
+
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ SvgRadialAtomPrimitive2D(
+ const basegfx::BColor& aColorA, double fScaleA, const basegfx::B2DVector& rTranslateA,
+ const basegfx::BColor& aColorB, double fScaleB, const basegfx::B2DVector& rTranslateB);
+ SvgRadialAtomPrimitive2D(
+ const basegfx::BColor& aColorA, double fScaleA,
+ const basegfx::BColor& aColorB, double fScaleB);
+ virtual ~SvgRadialAtomPrimitive2D();
+
+ /// data read access
+ const basegfx::BColor& getColorA() const { return maColorA; }
+ const basegfx::BColor& getColorB() const { return maColorB; }
+ double getScaleA() const { return mfScaleA; }
+ double getScaleB() const { return mfScaleB; }
+ bool isTranslateSet() const { return (0 != mpTranslate); }
+ basegfx::B2DVector getTranslateA() const { if(mpTranslate) return mpTranslate->maTranslateA; return basegfx::B2DVector(); }
+ basegfx::B2DVector getTranslateB() const { if(mpTranslate) return mpTranslate->maTranslateB; return basegfx::B2DVector(); }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SVGGRADIENTPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/textbreakuphelper.hxx b/include/drawinglayer/primitive2d/textbreakuphelper.hxx
new file mode 100644
index 000000000000..4a3996353a93
--- /dev/null
+++ b/include/drawinglayer/primitive2d/textbreakuphelper.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_DRAWINGLAYER_PRIMITIVE2D_TEXTBREAKUPHELPER_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTBREAKUPHELPER_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ enum BreakupUnit
+ {
+ BreakupUnit_character,
+ BreakupUnit_word,
+ BreakupUnit_sentence
+ };
+
+ class DRAWINGLAYER_DLLPUBLIC TextBreakupHelper
+ {
+ private:
+ const TextSimplePortionPrimitive2D& mrSource;
+ Primitive2DSequence mxResult;
+ TextLayouterDevice maTextLayouter;
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose maDecTrans;
+
+ /// bitfield
+ bool mbNoDXArray : 1;
+
+ /// create a portion from nIndex to nLength and append to rTempResult
+ void breakupPortion(Primitive2DVector& rTempResult, sal_uInt32 nIndex, sal_uInt32 nLength, bool bWordLineMode);
+
+ /// breakup complete primitive
+ void breakup(BreakupUnit aBreakupUnit);
+
+ protected:
+ /// allow user callback to allow changes to the new TextTransformation. Default
+ /// does nothing. Retval defines if a primitive gets created, e.g. return false
+ /// to suppress creation
+ virtual bool allowChange(sal_uInt32 nCount, basegfx::B2DHomMatrix& rNewTransform, sal_uInt32 nIndex, sal_uInt32 nLength);
+
+ /// allow read access to evtl. useful local parts
+ const TextLayouterDevice& getTextLayouter() const { return maTextLayouter; }
+ const basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& getDecTrans() const { return maDecTrans; }
+ const TextSimplePortionPrimitive2D& getSource() const { return mrSource; }
+
+ public:
+ TextBreakupHelper(const TextSimplePortionPrimitive2D& rSource);
+ virtual ~TextBreakupHelper();
+
+ /// get result
+ const Primitive2DSequence& getResult(BreakupUnit aBreakupUnit = BreakupUnit_character) const;
+ };
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTBREAKUPHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx b/include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
new file mode 100644
index 000000000000..506510958848
--- /dev/null
+++ b/include/drawinglayer/primitive2d/textdecoratedprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_TEXTDECORATEDPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTDECORATEDPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace basegfx { namespace tools {
+ class B2DHomMatrixBufferedOnDemandDecompose;
+}}
+
+namespace com { namespace sun { namespace star { namespace i18n {
+ struct Boundary;
+}}}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TextDecoratedPortionPrimitive2D class
+
+ This primitive expands the TextSimplePortionPrimitive2D by common
+ decorations used in the office. It can be decomposed and will create
+ a TextSimplePortionPrimitive2D and all the contained decorations (if used)
+ as geometry.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TextDecoratedPortionPrimitive2D : public TextSimplePortionPrimitive2D
+ {
+ private:
+ /// decoration definitions
+ basegfx::BColor maOverlineColor;
+ basegfx::BColor maTextlineColor;
+ TextLine meFontOverline;
+ TextLine meFontUnderline;
+ TextStrikeout meTextStrikeout;
+ TextEmphasisMark meTextEmphasisMark;
+ TextRelief meTextRelief;
+
+ /// bitfield
+ unsigned mbUnderlineAbove : 1;
+ unsigned mbWordLineMode : 1;
+ unsigned mbEmphasisMarkAbove : 1;
+ unsigned mbEmphasisMarkBelow : 1;
+ unsigned mbShadow : 1;
+
+ /// helper methods
+ void impCreateGeometryContent(
+ std::vector< Primitive2DReference >& rTarget,
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans,
+ const String& rText,
+ xub_StrLen aTextPosition,
+ xub_StrLen aTextLength,
+ const ::std::vector< double >& rDXArray,
+ const attribute::FontAttribute& rFontAttribute) const;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ TextDecoratedPortionPrimitive2D(
+
+ /// TextSimplePortionPrimitive2D parameters
+ const basegfx::B2DHomMatrix& rNewTransform,
+ const String& rText,
+ xub_StrLen aTextPosition,
+ xub_StrLen aTextLength,
+ const ::std::vector< double >& rDXArray,
+ const attribute::FontAttribute& rFontAttribute,
+ const ::com::sun::star::lang::Locale& rLocale,
+ const basegfx::BColor& rFontColor,
+
+ /// local parameters
+ const basegfx::BColor& rOverlineColor,
+ const basegfx::BColor& rTextlineColor,
+ TextLine eFontOverline = TEXT_LINE_NONE,
+ TextLine eFontUnderline = TEXT_LINE_NONE,
+ bool bUnderlineAbove = false,
+ TextStrikeout eTextStrikeout = TEXT_STRIKEOUT_NONE,
+ bool bWordLineMode = false,
+ TextEmphasisMark eTextEmphasisMark = TEXT_EMPHASISMARK_NONE,
+ bool bEmphasisMarkAbove = true,
+ bool bEmphasisMarkBelow = false,
+ TextRelief eTextRelief = TEXT_RELIEF_NONE,
+ bool bShadow = false);
+
+ /// data read access
+ TextLine getFontOverline() const { return meFontOverline; }
+ TextLine getFontUnderline() const { return meFontUnderline; }
+ TextStrikeout getTextStrikeout() const { return meTextStrikeout; }
+ TextEmphasisMark getTextEmphasisMark() const { return meTextEmphasisMark; }
+ TextRelief getTextRelief() const { return meTextRelief; }
+ const basegfx::BColor& getOverlineColor() const { return maOverlineColor; }
+ const basegfx::BColor& getTextlineColor() const { return maTextlineColor; }
+ bool getUnderlineAbove() const { return mbUnderlineAbove; }
+ bool getWordLineMode() const { return mbWordLineMode; }
+ bool getEmphasisMarkAbove() const { return mbEmphasisMarkAbove; }
+ bool getEmphasisMarkBelow() const { return mbEmphasisMarkBelow; }
+ bool getShadow() const { return mbShadow; }
+
+ /// check if this needs to be a TextDecoratedPortionPrimitive2D or
+ /// if a TextSimplePortionPrimitive2D would be suficcient
+ bool decoratedIsNeeded() const;
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTDECORATEDPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/texteffectprimitive2d.hxx b/include/drawinglayer/primitive2d/texteffectprimitive2d.hxx
new file mode 100644
index 000000000000..01fff05473d5
--- /dev/null
+++ b/include/drawinglayer/primitive2d/texteffectprimitive2d.hxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TextEffectStyle2D definition */
+ enum TextEffectStyle2D
+ {
+ TEXTEFFECTSTYLE2D_RELIEF_EMBOSSED_DEFAULT,
+ TEXTEFFECTSTYLE2D_RELIEF_ENGRAVED_DEFAULT,
+ TEXTEFFECTSTYLE2D_RELIEF_EMBOSSED,
+ TEXTEFFECTSTYLE2D_RELIEF_ENGRAVED,
+ TEXTEFFECTSTYLE2D_OUTLINE
+ };
+
+ /** TextEffectPrimitive2D class
+
+ This primitive embeds text primitives (normally, as can be seen can
+ also be used for any other primitives) which have some TextEffect applied
+ and create the needed geometry and embedding on decomposition.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TextEffectPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the text (or other) content
+ Primitive2DSequence maTextContent;
+
+ /// the style to apply, the direction and the rotation center
+ const basegfx::B2DPoint maRotationCenter;
+ double mfDirection;
+ TextEffectStyle2D meTextEffectStyle2D;
+
+ /** the last used object to view transformtion used from getDecomposition
+ for decide buffering
+ */
+ basegfx::B2DHomMatrix maLastObjectToViewTransformation;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// construcor
+ TextEffectPrimitive2D(
+ const Primitive2DSequence& rTextContent,
+ const basegfx::B2DPoint& rRotationCenter,
+ double fDirection,
+ TextEffectStyle2D eTextEffectStyle2D);
+
+ /// data read access
+ const Primitive2DSequence& getTextContent() const { return maTextContent; }
+ const basegfx::B2DPoint& getRotationCenter() const { return maRotationCenter; }
+ double getDirection() const { return mfDirection; }
+ TextEffectStyle2D getTextEffectStyle2D() const { return meTextEffectStyle2D; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /** own get range implementation to solve more effective. Content is by definition displaced
+ by a fixed discrete unit, thus the contained geometry needs only once be asked for it's
+ own basegfx::B2DRange
+ */
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+
+ /// Overload standard getDecomposition call to be view-dependent here
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/textenumsprimitive2d.hxx b/include/drawinglayer/primitive2d/textenumsprimitive2d.hxx
new file mode 100644
index 000000000000..36531e6fce16
--- /dev/null
+++ b/include/drawinglayer/primitive2d/textenumsprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_TEXTENUMSPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTENUMSPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <vcl/vclenum.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TextLine definition
+
+ This is used for both underline and overline
+ */
+ enum TextLine
+ {
+ TEXT_LINE_NONE,
+ TEXT_LINE_SINGLE,
+ TEXT_LINE_DOUBLE,
+ TEXT_LINE_DOTTED,
+ TEXT_LINE_DASH,
+ TEXT_LINE_LONGDASH,
+ TEXT_LINE_DASHDOT,
+ TEXT_LINE_DASHDOTDOT,
+ TEXT_LINE_SMALLWAVE,
+ TEXT_LINE_WAVE,
+ TEXT_LINE_DOUBLEWAVE,
+ TEXT_LINE_BOLD,
+ TEXT_LINE_BOLDDOTTED,
+ TEXT_LINE_BOLDDASH,
+ TEXT_LINE_BOLDLONGDASH,
+ TEXT_LINE_BOLDDASHDOT,
+ TEXT_LINE_BOLDDASHDOTDOT,
+ TEXT_LINE_BOLDWAVE
+ };
+
+ /** helper to convert LineStyle */
+ TextLine DRAWINGLAYER_DLLPUBLIC mapFontUnderlineToTextLine(FontUnderline eLineStyle);
+ FontUnderline DRAWINGLAYER_DLLPUBLIC mapTextLineToFontUnderline(TextLine eLineStyle);
+
+ /** FontStrikeout definition */
+ enum TextStrikeout
+ {
+ TEXT_STRIKEOUT_NONE,
+ TEXT_STRIKEOUT_SINGLE,
+ TEXT_STRIKEOUT_DOUBLE,
+ TEXT_STRIKEOUT_BOLD,
+ TEXT_STRIKEOUT_SLASH,
+ TEXT_STRIKEOUT_X
+ };
+
+ /** helper to convert FontStrikeout */
+ TextStrikeout DRAWINGLAYER_DLLPUBLIC mapFontStrikeoutToTextStrikeout(::FontStrikeout eFontStrikeout);
+ ::FontStrikeout DRAWINGLAYER_DLLPUBLIC mapTextStrikeoutToFontStrikeout(TextStrikeout eFontStrikeout);
+
+ /** TextEmphasisMark definition */
+ enum TextEmphasisMark
+ {
+ TEXT_EMPHASISMARK_NONE,
+ TEXT_EMPHASISMARK_DOT,
+ TEXT_EMPHASISMARK_CIRCLE,
+ TEXT_EMPHASISMARK_DISC,
+ TEXT_EMPHASISMARK_ACCENT
+ };
+
+ /** TextRelief definition */
+ enum TextRelief
+ {
+ TEXT_RELIEF_NONE,
+ TEXT_RELIEF_EMBOSSED,
+ TEXT_RELIEF_ENGRAVED
+ };
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTENUMSPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx b/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
new file mode 100644
index 000000000000..e9fb01f094ff
--- /dev/null
+++ b/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
@@ -0,0 +1,212 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTHIERARCHYPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTHIERARCHYPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <tools/string.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TextHierarchyLinePrimitive2D class
+
+ Text format hierarchy helper class. It decomposes to it's
+ content, so all direct renderers may ignore it. If You need
+ to know more about line hierarchies You may react on it and
+ also need to take care that the source of data uses it.
+
+ This primitive encapsulates text lines.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TextHierarchyLinePrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ public:
+ /// constructor
+ explicit TextHierarchyLinePrimitive2D(const Primitive2DSequence& rChildren);
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TextHierarchyBulletPrimitive2D class
+
+ This primitive encapsulates text bullets.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TextHierarchyBulletPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ public:
+ /// constructor
+ explicit TextHierarchyBulletPrimitive2D(const Primitive2DSequence& rChildren);
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TextHierarchyParagraphPrimitive2D class
+
+ This primitive encapsulates text paragraphs.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TextHierarchyParagraphPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ public:
+ /// constructor
+ explicit TextHierarchyParagraphPrimitive2D(const Primitive2DSequence& rChildren);
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TextHierarchyBlockPrimitive2D class
+
+ This primitive encapsulates text blocks.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TextHierarchyBlockPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ public:
+ /// constructor
+ explicit TextHierarchyBlockPrimitive2D(const Primitive2DSequence& rChildren);
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** FieldType definition */
+ enum FieldType
+ {
+ /** unspecified. If more info is needed for a FieldType,
+ create a new type and it's handling
+ */
+ FIELD_TYPE_COMMON,
+
+ /** uses "FIELD_SEQ_BEGIN;PageField" -> special handling */
+ FIELD_TYPE_PAGE,
+
+ /** uses URL as string -> special handling */
+ FIELD_TYPE_URL
+ };
+
+ /** TextHierarchyFieldPrimitive2D class
+
+ This primitive encapsulates text fields.
+ Also: This type uses a type enum to transport the encapsulated field
+ type. Also added is a String which is type-dependent. E.g. for URL
+ fields, it contains the URL.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TextHierarchyFieldPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ FieldType meType;
+ OUString maString;
+
+ public:
+ /// constructor
+ TextHierarchyFieldPrimitive2D(
+ const Primitive2DSequence& rChildren,
+ const FieldType& rFieldType,
+ const OUString& rString);
+
+ /// data read access
+ FieldType getType() const { return meType; }
+ const OUString& getString() const { return maString; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TextHierarchyEditPrimitive2D class
+
+ #i97628#
+ Primitive to encapsulate text from an active text edit; some
+ renderers need to suppress this output due to painting the
+ edited text in e.g. an OutlinerEditView. It's derived from
+ GroupPrimitive2D, so the implicit decomposition will use the
+ content. To suppress, this primitive needs to be parsed by
+ the renderer without taking any action.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TextHierarchyEditPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ public:
+ /// constructor
+ explicit TextHierarchyEditPrimitive2D(const Primitive2DSequence& rChildren);
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTHIERARCHYPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/textlayoutdevice.hxx b/include/drawinglayer/primitive2d/textlayoutdevice.hxx
new file mode 100644
index 000000000000..a0338a371aad
--- /dev/null
+++ b/include/drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -0,0 +1,155 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_TEXTLAYOUTDEVICE_HXX
+#define INCLUDED_DRAWINGLAYER_TEXTLAYOUTDEVICE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <tools/solar.h>
+#include <tools/poly.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <vector>
+#include <com/sun/star/lang/Locale.hpp>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+class VirtualDevice;
+class Font;
+class String;
+class OutputDevice;
+class GDIMetaFile;
+
+namespace drawinglayer { namespace attribute {
+ class FontAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+// access to one global impTimedRefDev incarnation in namespace drawinglayer::primitive
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TextLayouterDevice class
+
+ This helper class exists to isolate all accesses to VCL
+ text formatting/handling functionality for primitive implementations.
+ When in the future FontHandling may move to an own library independent
+ from VCL, primitives will be prepared.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TextLayouterDevice
+ {
+ /// internally used VirtualDevice
+ VirtualDevice& mrDevice;
+
+ public:
+ /// constructor/destructor
+ TextLayouterDevice();
+ ~TextLayouterDevice();
+
+ /// tooling methods
+ void setFont(const Font& rFont);
+ void setFontAttribute(
+ const attribute::FontAttribute& rFontAttribute,
+ double fFontScaleX,
+ double fFontScaleY,
+ const ::com::sun::star::lang::Locale & rLocale);
+
+ double getTextHeight() const;
+ double getOverlineHeight() const;
+ double getOverlineOffset() const;
+ double getUnderlineHeight() const;
+ double getUnderlineOffset() const;
+ double getStrikeoutOffset() const;
+
+ double getTextWidth(
+ const String& rText,
+ sal_uInt32 nIndex,
+ sal_uInt32 nLength) const;
+
+ bool getTextOutlines(
+ basegfx::B2DPolyPolygonVector&,
+ const String& rText,
+ sal_uInt32 nIndex,
+ sal_uInt32 nLength,
+ const ::std::vector< double >& rDXArray) const;
+
+ basegfx::B2DRange getTextBoundRect(
+ const String& rText,
+ sal_uInt32 nIndex,
+ sal_uInt32 nLength) const;
+
+ double getFontAscent() const;
+ double getFontDescent() const;
+
+ void addTextRectActions(
+ const Rectangle& rRectangle,
+ const String& rText,
+ sal_uInt16 nStyle,
+ GDIMetaFile& rGDIMetaFile) const;
+
+ ::std::vector< double > getTextArray(
+ const String& rText,
+ sal_uInt32 nIndex,
+ sal_uInt32 nLength) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// helper methods for vcl font handling
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** Create a VCL-Font based on the definitions in FontAttribute
+ and the given FontScaling. The FontScaling defines the FontHeight
+ (fFontScaleY) and the FontWidth (fFontScaleX). The combination of
+ both defines FontStretching, where no stretching happens at
+ fFontScaleY == fFontScaleX
+ */
+ Font DRAWINGLAYER_DLLPUBLIC getVclFontFromFontAttribute(
+ const attribute::FontAttribute& rFontAttribute,
+ double fFontScaleX,
+ double fFontScaleY,
+ double fFontRotation,
+ const ::com::sun::star::lang::Locale & rLocale);
+
+ /** Generate FontAttribute DataSet derived from the given VCL-Font.
+ The FontScaling with fFontScaleY, fFontScaleX relationship (see
+ above) will be set in return parameter o_rSize to allow further
+ processing
+ */
+ attribute::FontAttribute DRAWINGLAYER_DLLPUBLIC getFontAttributeFromVclFont(
+ basegfx::B2DVector& o_rSize,
+ const Font& rFont,
+ bool bRTL,
+ bool bBiDiStrong);
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_DRAWINGLAYER_TEXTLAYOUTDEVICE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/textlineprimitive2d.hxx b/include/drawinglayer/primitive2d/textlineprimitive2d.hxx
new file mode 100644
index 000000000000..6bcca85a8bc2
--- /dev/null
+++ b/include/drawinglayer/primitive2d/textlineprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class DRAWINGLAYER_DLLPUBLIC TextLinePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// geometric definitions
+ basegfx::B2DHomMatrix maObjectTransformation;
+ double mfWidth;
+ double mfOffset;
+ double mfHeight;
+
+ /// decoration definitions
+ TextLine meTextLine;
+ basegfx::BColor maLineColor;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ TextLinePrimitive2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ double fWidth,
+ double fOffset,
+ double fHeight,
+ TextLine eTextLine,
+ const basegfx::BColor& rLineColor);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+ double getWidth() const { return mfWidth; }
+ double getOffset() const { return mfOffset; }
+ double getHeight() const { return mfHeight; }
+ TextLine getTextLine() const { return meTextLine; }
+ const basegfx::BColor& getLineColor() const { return maLineColor; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/textprimitive2d.hxx b/include/drawinglayer/primitive2d/textprimitive2d.hxx
new file mode 100644
index 000000000000..5a12e2bc678f
--- /dev/null
+++ b/include/drawinglayer/primitive2d/textprimitive2d.hxx
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <tools/string.hxx>
+#include <vcl/font.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <vector>
+#include <com/sun/star/lang/Locale.hpp>
+#include <drawinglayer/attribute/fontattribute.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+class OutputDevice;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TextSimplePortionPrimitive2D class
+
+ This is the basic primitive for representing a text portion. It contains
+ all needed information. If it is not handled by a renderer, it's decomposition
+ will provide the text PolyPolygon outlines as filled polygons, correctly
+ transformed.
+
+ To get better text quality, it is suggested to handle tis primitive directly
+ in a renderer. In that case, e.g. hintings on the system can be supported.
+
+ @param maTextTransform
+ The text transformation contains the text start position (always baselined)
+ as translation, the FontSize as scale (where width relative to height defines
+ font scaling and width == height means no font scaling) and the font rotation
+ and shear.
+ When shear is used and a renderer does not support it, it may be better to use
+ the decomposition which will do everything correctly. Same is true for mirroring
+ which would be expressed as negative scalings.
+
+ @param rText
+ The text to be used. Only a part may be used, but a bigger part of the string
+ may be necessary for correct layouting (e.g. international)
+
+ @param aTextPosition
+ The index to the first character to use from rText
+
+ @param aTextLength
+ The number of characters to use from rText
+
+ @param rDXArray
+ The distances between the characters. This parameter may be empty, in that case
+ the renderer is responsible to do something useful. If it is given, it has to be of
+ the size aTextLength. Its values are in logical coordinates and describe the
+ distance for each character to use. This is independent from the font width which
+ is given with maTextTransform. The first value is the offset to use from the start
+ point in FontCoordinateSystem X-Direction (given by maTextTransform) to the start
+ point of the second character
+
+ @param rFontAttribute
+ The font definition
+
+ @param rLocale
+ The locale to use
+
+ @param rFontColor
+ The font color to use
+ */
+ class DRAWINGLAYER_DLLPUBLIC TextSimplePortionPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// text transformation (FontCoordinateSystem)
+ basegfx::B2DHomMatrix maTextTransform;
+
+ /// The text, used from maTextPosition up to maTextPosition + maTextLength
+ String maText;
+
+ /// The index from where on maText is used
+ xub_StrLen maTextPosition;
+
+ /// The length for maText usage, starting from maTextPosition
+ xub_StrLen maTextLength;
+
+ /// The DX array in logic units
+ ::std::vector< double > maDXArray;
+
+ /// The font definition
+ attribute::FontAttribute maFontAttribute;
+
+ /// The Locale for the text
+ ::com::sun::star::lang::Locale maLocale;
+
+ /// font color
+ basegfx::BColor maFontColor;
+
+ /// #i96669# internal: add simple range buffering for this primitive
+ basegfx::B2DRange maB2DRange;
+ bool mbFilled; // Whether to fill a given width with the text
+ long mnWidthToFill; // the width to fill
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ TextSimplePortionPrimitive2D(
+ const basegfx::B2DHomMatrix& rNewTransform,
+ const String& rText,
+ xub_StrLen aTextPosition,
+ xub_StrLen aTextLength,
+ const ::std::vector< double >& rDXArray,
+ const attribute::FontAttribute& rFontAttribute,
+ const ::com::sun::star::lang::Locale& rLocale,
+ const basegfx::BColor& rFontColor,
+ bool bFilled = false,
+ long nWidthToFill = 0);
+
+ /// helpers
+ /** get text outlines as polygons and their according ObjectTransformation. Handles all
+ the necessary VCL outline extractins, scaling adaptions and other stuff.
+ */
+ void getTextOutlinesAndTransformation(basegfx::B2DPolyPolygonVector& rTarget, basegfx::B2DHomMatrix& rTransformation) const;
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getTextTransform() const { return maTextTransform; }
+ const String& getText() const { return maText; }
+ xub_StrLen getTextPosition() const { return maTextPosition; }
+ xub_StrLen getTextLength() const { return maTextLength; }
+ const ::std::vector< double >& getDXArray() const { return maDXArray; }
+ const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
+ const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
+ const basegfx::BColor& getFontColor() const { return maFontColor; }
+ bool isFilled() const { return mbFilled; }
+ long getWidthToFill() const { return mnWidthToFill; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+
+ /// small helper to have a compare operator for Locale
+ bool DRAWINGLAYER_DLLPUBLIC LocalesAreEqual(const ::com::sun::star::lang::Locale& rA, const ::com::sun::star::lang::Locale& rB);
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx b/include/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx
new file mode 100644
index 000000000000..216fe740933a
--- /dev/null
+++ b/include/drawinglayer/primitive2d/textstrikeoutprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <drawinglayer/attribute/fontattribute.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class DRAWINGLAYER_DLLPUBLIC BaseTextStrikeoutPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// geometric definitions
+ basegfx::B2DHomMatrix maObjectTransformation;
+ double mfWidth;
+
+ /// decoration definitions
+ basegfx::BColor maFontColor;
+
+ public:
+ /// constructor
+ BaseTextStrikeoutPrimitive2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ double fWidth,
+ const basegfx::BColor& rFontColor);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+ double getWidth() const { return mfWidth; }
+ const basegfx::BColor& getFontColor() const { return maFontColor; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class DRAWINGLAYER_DLLPUBLIC TextCharacterStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D
+ {
+ private:
+ sal_Unicode maStrikeoutChar;
+ attribute::FontAttribute maFontAttribute;
+ ::com::sun::star::lang::Locale maLocale;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ TextCharacterStrikeoutPrimitive2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ double fWidth,
+ const basegfx::BColor& rFontColor,
+ sal_Unicode aStrikeoutChar,
+ const attribute::FontAttribute& rFontAttribute,
+ const ::com::sun::star::lang::Locale& rLocale);
+
+ /// data read access
+ sal_Unicode getStrikeoutChar() const { return maStrikeoutChar; }
+ const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
+ const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class DRAWINGLAYER_DLLPUBLIC TextGeometryStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D
+ {
+ private:
+ double mfHeight;
+ double mfOffset;
+ TextStrikeout meTextStrikeout;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ TextGeometryStrikeoutPrimitive2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ double fWidth,
+ const basegfx::BColor& rFontColor,
+ double fHeight,
+ double fOffset,
+ TextStrikeout eTextStrikeout);
+
+ /// data read access
+ double getHeight() const { return mfHeight; }
+ double getOffset() const { return mfOffset; }
+ TextStrikeout getTextStrikeout() const { return meTextStrikeout; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/transformprimitive2d.hxx b/include/drawinglayer/primitive2d/transformprimitive2d.hxx
new file mode 100644
index 000000000000..e58c530fa71f
--- /dev/null
+++ b/include/drawinglayer/primitive2d/transformprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TransformPrimitive2D class
+
+ This is one of the basic grouping primitives and it provides
+ embedding a sequence of primitives (a geometry) into a
+ transformation. All renderers have to handle this, usually by
+ building a current transformation stack (linear combination)
+ and applying this to all to-be-rendered geometry. If not handling
+ this, the output will be mostly wrong since this primitive is
+ widely used.
+
+ It does transform by embedding an existing geometry into a
+ transformation as Child-content. This allows re-usage of the
+ refcounted Uno-Api primitives and their existung, buffered
+ decompositions.
+
+ It could e.g. be used to show a single object geometry in 1000
+ different, transformed states without the need to create those
+ thousand primitive contents.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TransformPrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ // the transformation to apply to the child geometry
+ basegfx::B2DHomMatrix maTransformation;
+
+ public:
+ /// constructor
+ TransformPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransformation,
+ const Primitive2DSequence& rChildren);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/transparenceprimitive2d.hxx b/include/drawinglayer/primitive2d/transparenceprimitive2d.hxx
new file mode 100644
index 000000000000..1c742da909d3
--- /dev/null
+++ b/include/drawinglayer/primitive2d/transparenceprimitive2d.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TransparencePrimitive2D class
+
+ This is the basic primitive for applying freely defined transparence
+ to freely defined content. The basic idea is to associate a content
+ which is defined as a sequence of primitives and hold as child content
+ in the GroupPrimitive2D with a transparence channel also defined as a sequence
+ of primitives and hold in the transparence member.
+
+ The basic definition is to use the transparence content as transparence-Mask by
+ interpreting the transparence-content not as RGB, but as Luminance transparence mask
+ using the common RGB_to_luminance definition as e.g. used by VCL.
+
+ The defining geometry is the Range of the child primitive sequence,
+ this means the renderers will/shall use this geometric information for
+ rendering, not the transparent one. The transparent one should/will be clipped
+ accordingly.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TransparencePrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ /// The transparence-Mask who's RGB-Values are interpreted as Luminance
+ Primitive2DSequence maTransparence;
+
+ public:
+ /** constructor
+
+ @param rChildren
+ The content which is defined to have a transparency. The
+ range of this primitive is defined by this content
+
+ @param rTransparence
+ The definition of the Transparence-channel for this primitive. It
+ will be interpreted as mask by interpreting as gray values
+ using the common RGB_to_luminance definitions
+ */
+ TransparencePrimitive2D(
+ const Primitive2DSequence& rChildren,
+ const Primitive2DSequence& rTransparence);
+
+ /// data read access
+ const Primitive2DSequence& getTransparence() const { return maTransparence; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx b/include/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx
new file mode 100644
index 000000000000..e30de32107f6
--- /dev/null
+++ b/include/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** UnifiedTransparencePrimitive2D class
+
+ This primitive encapsualtes a child hierarchy and defines
+ that it shall be visualized with the given transparency. That
+ transparency is unique for all contained geometry, so that
+ e.g. overlapping polygons in the child geometry will not show
+ regions of combined transparency, but be all rendered with the
+ defined, single transparency.
+ */
+ class DRAWINGLAYER_DLLPUBLIC UnifiedTransparencePrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ /// the unified transparence
+ double mfTransparence;
+
+ public:
+ /// constructor
+ UnifiedTransparencePrimitive2D(
+ const Primitive2DSequence& rChildren,
+ double fTransparence);
+
+ /// data read access
+ double getTransparence() const { return mfTransparence; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// own getB2DRange implementation to include transparent geometries to BoundRect calculations
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// create decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/wallpaperprimitive2d.hxx b/include/drawinglayer/primitive2d/wallpaperprimitive2d.hxx
new file mode 100644
index 000000000000..0e370b74dab0
--- /dev/null
+++ b/include/drawinglayer/primitive2d/wallpaperprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
+#include <vcl/bitmapex.hxx>
+#include <vcl/wall.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** WallpaperBitmapPrimitive2D class
+
+ This is a specialized primtive for the Wallpaper definitions included in
+ VCL and Metafiles. The extraordinary about the bitmap definition part of
+ the Wallpaper is that it uses PIXEL size of the given Bitmap and not
+ the logic and/or discrete size derived by PrefMapMode/PrefSize methods.
+ To emulate this, a ViewTransformation dependent primitive is needed which
+ takes over the correct scaling(s).
+
+ Since a specialized primitive is needed anyways, i opted to also add the
+ layouting which is dependent from WallpaperStyle; thus it does not need
+ to be handled anywhere else in the future.
+ */
+ class DRAWINGLAYER_DLLPUBLIC WallpaperBitmapPrimitive2D : public ViewTransformationDependentPrimitive2D
+ {
+ private:
+ basegfx::B2DRange maObjectRange;
+ BitmapEx maBitmapEx;
+ WallpaperStyle meWallpaperStyle;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ WallpaperBitmapPrimitive2D(
+ const basegfx::B2DRange& rObjectRange,
+ const BitmapEx& rBitmapEx,
+ WallpaperStyle eWallpaperStyle);
+
+ /// data read access
+ const basegfx::B2DRange& getLocalObjectRange() const { return maObjectRange; }
+ const BitmapEx& getBitmapEx() const { return maBitmapEx ; }
+ WallpaperStyle getWallpaperStyle() const { return meWallpaperStyle; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get B2Drange
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/wrongspellprimitive2d.hxx b/include/drawinglayer/primitive2d/wrongspellprimitive2d.hxx
new file mode 100644
index 000000000000..cafd40f40aa3
--- /dev/null
+++ b/include/drawinglayer/primitive2d/wrongspellprimitive2d.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_DRAWINGLAYER_PRIMITIVE2D_WRONGSPELLPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WRONGSPELLPRIMITIVE2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// WrongSpellPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** WrongSpellPrimitive2D class
+
+ This is a helper primitive to hold evtl. WrongSpell visualisations
+ in the sequence of primitives. The primitive holds this information
+ separated form the TextPortions to where it belongs to tot expand the
+ TextSimplePortionPrimitive2D more as needed.
+
+ A renderer who does not want to visualize this (if contained at all)
+ can detect and ignore this primitive. If it's decomposition is used,
+ it will be visualized as red wavelines.
+
+ The geometric definition defines a line on the X-Axis (no Y-coordinates)
+ which will when transformed by Transformation, create the coordinate data.
+ */
+ class DRAWINGLAYER_DLLPUBLIC WrongSpellPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// geometry definition
+ basegfx::B2DHomMatrix maTransformation;
+ double mfStart;
+ double mfStop;
+
+ /// color (usually red)
+ basegfx::BColor maColor;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ WrongSpellPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransformation,
+ double fStart,
+ double fStop,
+ const basegfx::BColor& rColor);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
+ double getStart() const { return mfStart; }
+ double getStop() const { return mfStop; }
+ const basegfx::BColor& getColor() const { return maColor; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WRONGSPELLPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/baseprimitive3d.hxx b/include/drawinglayer/primitive3d/baseprimitive3d.hxx
new file mode 100644
index 000000000000..974c47d9e485
--- /dev/null
+++ b/include/drawinglayer/primitive3d/baseprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <cppuhelper/compbase1.hxx>
+#include <boost/utility.hpp>
+#include <com/sun/star/graphic/XPrimitive3D.hpp>
+#include <comphelper/broadcasthelper.hxx>
+#include <basegfx/range/b3drange.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+/** defines for DeclPrimitrive3DIDBlock and ImplPrimitrive3DIDBlock
+ Added to be able to simply change identification stuff later, e.g. add
+ a identification string and/or ID to the interface and to the implementation
+ ATM used to delclare implement getPrimitive3DID()
+ */
+
+#define DeclPrimitrive3DIDBlock() \
+ virtual sal_uInt32 getPrimitive3DID() const;
+
+#define ImplPrimitrive3DIDBlock(TheClass, TheID) \
+ sal_uInt32 TheClass::getPrimitive3DID() const { return TheID; }
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace geometry {
+ class ViewInformation3D;
+}}
+
+namespace drawinglayer { namespace primitive3d {
+ /// typedefs for basePrimitive3DImplBase, Primitive3DSequence and Primitive3DReference
+ typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive3D > BasePrimitive3DImplBase;
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive3D > Primitive3DReference;
+ typedef ::com::sun::star::uno::Sequence< Primitive3DReference > Primitive3DSequence;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+// basePrimitive3D class
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** BasePrimitive3D class
+
+ Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D
+
+ The description/functionality is identical with the 2D case in baseprimitive2d.hxx,
+ please see there for detailed information.
+
+ Current Basic 3D Primitives are:
+
+ - PolygonHairlinePrimitive3D (for 3D hairlines)
+ - PolyPolygonMaterialPrimitive3D (for 3D filled plane polygons)
+
+ That's all for 3D!
+ */
+ class DRAWINGLAYER_DLLPUBLIC BasePrimitive3D
+ : private boost::noncopyable,
+ protected comphelper::OBaseMutex,
+ public BasePrimitive3DImplBase
+ {
+ private:
+ protected:
+ public:
+ // constructor/destructor
+ BasePrimitive3D();
+ virtual ~BasePrimitive3D();
+
+ /** the ==operator is mainly needed to allow testing newly-created high level primitives against their last
+ incarnation which buffers/holds the decompositionsThe default implementation
+ uses getPrimitive3DID()-calls to test if it's the same ID at last. Overloaded implementation are then
+ based on this implementation.
+ */
+ virtual bool operator==( const BasePrimitive3D& rPrimitive ) const;
+ bool operator!=( const BasePrimitive3D& rPrimitive ) const { return !operator==(rPrimitive); }
+
+ /** This method is for places where using the C++ implementation directly is possible. The subprocessing
+ and range merging is more efficient when working directly on basegfx::B3DRange. The default implementation
+ will use getDecomposition results to create the range
+ */
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /** provide unique ID for fast identifying of known primitive implementations in renderers. These use
+ the defines from primitivetypes3d.hxx to define unique IDs.
+ */
+ virtual sal_uInt32 getPrimitive3DID() const = 0;
+
+ /// The default implementation returns an empty sequence
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ //
+ // Methods from XPrimitive3D
+ //
+
+ /** The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It
+ will get the ViewInformation from the ViewParameters for that purpose
+ */
+ virtual Primitive3DSequence SAL_CALL getDecomposition( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ /** the getRange default implemenation will use getDecomposition to create the range information from merging
+ getRange results from the single local decomposition primitives.
+ */
+ virtual ::com::sun::star::geometry::RealRectangle3D SAL_CALL getRange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException );
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// BufferedDecompositionPrimitive3D class
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** BufferedDecompositionPrimitive3D class
+
+ Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D
+
+ The description/functionality is identical with the 2D case in baseprimitive2d.hxx,
+ please see there for detailed information
+ */
+ class DRAWINGLAYER_DLLPUBLIC BufferedDecompositionPrimitive3D
+ : public BasePrimitive3D
+ {
+ private:
+ /// a sequence used for buffering the last create3DDecomposition() result
+ Primitive3DSequence maBuffered3DDecomposition;
+
+ protected:
+ /** access methods to maBuffered3DDecomposition. The usage of this methods may allow
+ later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
+ implementations for buffering the last decomposition.
+ */
+ const Primitive3DSequence& getBuffered3DDecomposition() const { return maBuffered3DDecomposition; }
+ void setBuffered3DDecomposition(const Primitive3DSequence& rNew) { maBuffered3DDecomposition = rNew; }
+
+ /** method which is to be used to implement the local decomposition of a 2D primitive. The default
+ implementation will just return an empty decomposition
+ */
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ public:
+ // constructor
+ BufferedDecompositionPrimitive3D();
+
+ /** The getDecomposition default implementation will on demand use create3DDecomposition() if
+ maBuffered3DDecomposition is empty. It will set maBuffered3DDecomposition to this obtained decomposition
+ to buffer it. If the decomposition is also ViewInformation-dependent, this method needs to be
+ overloaded and the ViewInformation for the last decomposition needs to be remembered, too, and
+ be used in the next call to decide if the buffered decomposition may be reused or not.
+ */
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// tooling
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /// get B3DRange from a given Primitive3DReference
+ basegfx::B3DRange DRAWINGLAYER_DLLPUBLIC getB3DRangeFromPrimitive3DReference(const Primitive3DReference& rCandidate, const geometry::ViewInformation3D& aViewInformation);
+
+ /// get range3D from a given Primitive3DSequence
+ basegfx::B3DRange DRAWINGLAYER_DLLPUBLIC getB3DRangeFromPrimitive3DSequence(const Primitive3DSequence& rCandidate, const geometry::ViewInformation3D& aViewInformation);
+
+ /** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
+ and using compare operator
+ */
+ bool DRAWINGLAYER_DLLPUBLIC arePrimitive3DReferencesEqual(const Primitive3DReference& rA, const Primitive3DReference& rB);
+
+ /// compare two Primitive3DReferences for equality, uses arePrimitive3DReferencesEqual internally
+ bool DRAWINGLAYER_DLLPUBLIC arePrimitive3DSequencesEqual(const Primitive3DSequence& rA, const Primitive3DSequence& rB);
+
+ /// concatenate sequence
+ void DRAWINGLAYER_DLLPUBLIC appendPrimitive3DSequenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DSequence& rSource);
+
+ /// concatenate single Primitive3D
+ void DRAWINGLAYER_DLLPUBLIC appendPrimitive3DReferenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DReference& rSource);
+
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_BASEPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx b/include/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx
new file mode 100644
index 000000000000..3be15ad5e8bb
--- /dev/null
+++ b/include/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.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_DRAWINGLAYER_PRIMITIVE3D_PRIMITIVETYPES3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_PRIMITIVETYPES3D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// define ranges for other libraries
+
+#define PRIMITIVE3D_ID_RANGE_DRAWINGLAYER (0 << 16)
+
+//////////////////////////////////////////////////////////////////////////////
+// local primitives
+
+#define PRIMITIVE3D_ID_GROUPPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 0)
+#define PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 1)
+#define PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 2)
+#define PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 3)
+#define PRIMITIVE3D_ID_POLYGONSTROKEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 4)
+#define PRIMITIVE3D_ID_POLYGONTUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 5)
+#define PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 6)
+#define PRIMITIVE3D_ID_SDRCUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 7)
+#define PRIMITIVE3D_ID_SDREXTRUDEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 8)
+#define PRIMITIVE3D_ID_SDRLATHEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 9)
+#define PRIMITIVE3D_ID_SDRPOLYPOLYGONPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 10)
+#define PRIMITIVE3D_ID_SDRSPHEREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 11)
+#define PRIMITIVE3D_ID_SHADOWPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 12)
+#define PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 13)
+#define PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 14)
+#define PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 15)
+#define PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 16)
+#define PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 17)
+#define PRIMITIVE3D_ID_HIDDENGEOMETRYPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 18)
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_PRIMITIVETYPES3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/groupprimitive3d.hxx b/include/drawinglayer/primitive3d/groupprimitive3d.hxx
new file mode 100644
index 000000000000..d8d3f5b77446
--- /dev/null
+++ b/include/drawinglayer/primitive3d/groupprimitive3d.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_GROUPPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_GROUPPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** GroupPrimitive3D class
+
+ Baseclass for all grouping 3D primitives
+
+ The description/functionality is identical with the 2D case in groupprimitive2d.hxx,
+ please see there for detailed information.
+
+ Current Basic 3D StatePrimitives are:
+
+ - ModifiedColorPrimitive3D (for a stack of color modifications)
+ - ShadowPrimitive3D (for 3D objects with shadow; this is a special case
+ since the shadow of a 3D primitive is a 2D primitive set)
+ - TexturePrimitive3D (with the following variations)
+ - GradientTexturePrimitive3D (for 3D gradient fill)
+ - BitmapTexturePrimitive3D (for 3D Bitmap fill)
+ - TransparenceTexturePrimitive3D (for 3D transparence)
+ - HatchTexturePrimitive3D (for 3D hatch fill)
+ - TransformPrimitive3D (for a transformation stack)
+ */
+ class DRAWINGLAYER_DLLPUBLIC GroupPrimitive3D : public BasePrimitive3D
+ {
+ private:
+ /// the children. Declared private since this shall never be changed at all after construction
+ Primitive3DSequence maChildren;
+
+ public:
+ /// constructor
+ explicit GroupPrimitive3D(const Primitive3DSequence& rChildren);
+
+ /// data read access
+ Primitive3DSequence getChildren() const { return maChildren; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive3D& rPrimitive ) const;
+
+ /// local decomposition. Implementation will just return children
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_GROUPPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx b/include/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
new file mode 100644
index 000000000000..981027a1615b
--- /dev/null
+++ b/include/drawinglayer/primitive3d/hatchtextureprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/textureprimitive3d.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** HatchTexturePrimitive3D class
+
+ HatchTexturePrimitive3D is derived from GroupPrimitive3D, but implements
+ a decomposition which is complicated enough for buffering. Since the group
+ primitive has no default buffering, it is necessary here to add a local
+ buffering mechanism for the decomposition
+ */
+ class DRAWINGLAYER_DLLPUBLIC HatchTexturePrimitive3D : public TexturePrimitive3D
+ {
+ private:
+ /// the hatch definition
+ attribute::FillHatchAttribute maHatch;
+
+ /// the buffered decomposed hatch
+ Primitive3DSequence maBuffered3DDecomposition;
+
+ protected:
+ /// helper: local decomposition
+ Primitive3DSequence impCreate3DDecomposition() const;
+
+ /// local access methods to maBufferedDecomposition
+ const Primitive3DSequence& getBuffered3DDecomposition() const { return maBuffered3DDecomposition; }
+ void setBuffered3DDecomposition(const Primitive3DSequence& rNew) { maBuffered3DDecomposition = rNew; }
+
+ public:
+ /// constructor
+ HatchTexturePrimitive3D(
+ const attribute::FillHatchAttribute& rHatch,
+ const Primitive3DSequence& rChildren,
+ const basegfx::B2DVector& rTextureSize,
+ bool bModulate,
+ bool bFilter);
+
+ /// data read access
+ const attribute::FillHatchAttribute& getHatch() const { return maHatch; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// local decomposition.
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx b/include/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx
new file mode 100644
index 000000000000..7fe7359b4824
--- /dev/null
+++ b/include/drawinglayer/primitive3d/hiddengeometryprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_HIDDENGEOMETRYPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HIDDENGEOMETRYPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/groupprimitive3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ // This primitive is used to represent geometry for non-visible objects,
+ // e.g. a 3D cube without fill attributes. To still be able to use
+ // primitives for HitTest functionality, the 3d decompositions produce
+ // an as much as possible simplified fill geometry encapsulated in this
+ // primtive when there is no fill geometry. Currently, the 3d hit test
+ // uses only areas, so maybe in a further enchanced version this will change
+ // to 'if neither filled nor lines' creation criteria. The whole primitive
+ // decomposes to nothing, so no one not knowing it will be influenced. Only
+ // helper processors for hit test (and maybe BoundRect extractors) will
+ // use it and it's children subcontent.
+ class DRAWINGLAYER_DLLPUBLIC HiddenGeometryPrimitive3D : public GroupPrimitive3D
+ {
+ public:
+ explicit HiddenGeometryPrimitive3D(const Primitive3DSequence& rChildren);
+
+ // despite returning an empty decomposition since it's no visualisation data,
+ // range calculation is intended to use hidden geometry, so
+ // the local implementation will return the children's range
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// The default implementation returns an empty sequence
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ // provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HIDDENGEOMETRYPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx b/include/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
new file mode 100644
index 000000000000..0e5fe4329e12
--- /dev/null
+++ b/include/drawinglayer/primitive3d/modifiedcolorprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/groupprimitive3d.hxx>
+#include <basegfx/color/bcolormodifier.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** ModifiedColorPrimitive3D class
+
+ This primitive is a grouping primitive and allows to define
+ how the colors of it's child content shall be modified for
+ visualisation. Please see the ModifiedColorPrimitive2D
+ description for more info.
+ */
+ class DRAWINGLAYER_DLLPUBLIC ModifiedColorPrimitive3D : public GroupPrimitive3D
+ {
+ private:
+ /// The ColorModifier to use
+ basegfx::BColorModifier maColorModifier;
+
+ public:
+ /// constructor
+ ModifiedColorPrimitive3D(
+ const Primitive3DSequence& rChildren,
+ const basegfx::BColorModifier& rColorModifier);
+
+ /// data read access
+ const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/polygonprimitive3d.hxx b/include/drawinglayer/primitive3d/polygonprimitive3d.hxx
new file mode 100644
index 000000000000..62fb60265732
--- /dev/null
+++ b/include/drawinglayer/primitive3d/polygonprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/polygon/b3dpolygon.hxx>
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** PolygonHairlinePrimitive3D class
+
+ This primitive defines a Hairline in 3D. Since hairlines are view-dependent,
+ this primitive is view-dependent, too.
+
+ This is one of the non-decomposable 3D primitives, so a renderer
+ should proccess it.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolygonHairlinePrimitive3D : public BasePrimitive3D
+ {
+ private:
+ /// the hairline geometry
+ basegfx::B3DPolygon maPolygon;
+
+ /// the hairline color
+ basegfx::BColor maBColor;
+
+ public:
+ /// constructor
+ PolygonHairlinePrimitive3D(
+ const basegfx::B3DPolygon& rPolygon,
+ const basegfx::BColor& rBColor);
+
+ /// data read access
+ const basegfx::B3DPolygon& getB3DPolygon() const { return maPolygon; }
+ const basegfx::BColor& getBColor() const { return maBColor; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** PolygonStrokePrimitive3D class
+
+ This primitive defines a 3D line with line width, line join, line color
+ and stroke attributes. It will be decomposed dependent on the definition
+ to the needed primitives, e.g. filled Tubes for fat lines.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolygonStrokePrimitive3D : public BufferedDecompositionPrimitive3D
+ {
+ private:
+ /// the line geometry
+ basegfx::B3DPolygon maPolygon;
+
+ /// the line attributes like width, join and color
+ attribute::LineAttribute maLineAttribute;
+
+ /// the line stroking (if used)
+ attribute::StrokeAttribute maStrokeAttribute;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolygonStrokePrimitive3D(
+ const basegfx::B3DPolygon& rPolygon,
+ const attribute::LineAttribute& rLineAttribute,
+ const attribute::StrokeAttribute& rStrokeAttribute);
+
+ /// data read access
+ basegfx::B3DPolygon getB3DPolygon() const { return maPolygon; }
+ const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
+ const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/polygontubeprimitive3d.hxx b/include/drawinglayer/primitive3d/polygontubeprimitive3d.hxx
new file mode 100644
index 000000000000..56f7dc4b4d4a
--- /dev/null
+++ b/include/drawinglayer/primitive3d/polygontubeprimitive3d.hxx
@@ -0,0 +1,108 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class B3DPolyPolygon;
+ class B3DHomMatrix;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** PolygonStrokePrimitive3D class
+
+ This 3D primitive extends a 3D hairline to a 3D tube which is
+ e.g. used for fat lines in 3D. It's decomposition will create all
+ 3D objects needed for the line tubes and the edge roundings
+ in full 3D.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolygonTubePrimitive3D : public PolygonHairlinePrimitive3D
+ {
+ private:
+ /// hold the last decompositon since it's expensive
+ Primitive3DSequence maLast3DDecomposition;
+
+ /// visualisation parameters
+ double mfRadius;
+ double mfDegreeStepWidth;
+ double mfMiterMinimumAngle;
+ basegfx::B2DLineJoin maLineJoin;
+ com::sun::star::drawing::LineCap maLineCap;
+
+ protected:
+ /** access methods to maLast3DDecomposition. The usage of this methods may allow
+ later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
+ implementations for buffering the last decomposition.
+ */
+ const Primitive3DSequence& getLast3DDecomposition() const { return maLast3DDecomposition; }
+ void setLast3DDecomposition(const Primitive3DSequence& rNew) { maLast3DDecomposition = rNew; }
+
+ /// local decomposition.
+ Primitive3DSequence impCreate3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolygonTubePrimitive3D(
+ const basegfx::B3DPolygon& rPolygon,
+ const basegfx::BColor& rBColor,
+ double fRadius,
+ basegfx::B2DLineJoin aLineJoin,
+ com::sun::star::drawing::LineCap aLineCap,
+ double fDegreeStepWidth = 10.0 * F_PI180,
+ double fMiterMinimumAngle = 15.0 * F_PI180);
+
+ /// data read access
+ double getRadius() const { return mfRadius; }
+ double getDegreeStepWidth() const { return mfDegreeStepWidth; }
+ double getMiterMinimumAngle() const { return mfMiterMinimumAngle; }
+ basegfx::B2DLineJoin getLineJoin() const { return maLineJoin; }
+ com::sun::star::drawing::LineCap getLineCap() const { return maLineCap; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /** local decomposition. Use own buffering since we are not derived from
+ BufferedDecompositionPrimitive3D
+ */
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONTUBEPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/polypolygonprimitive3d.hxx b/include/drawinglayer/primitive3d/polypolygonprimitive3d.hxx
new file mode 100644
index 000000000000..7f916afe978c
--- /dev/null
+++ b/include/drawinglayer/primitive3d/polypolygonprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+#include <basegfx/polygon/b3dpolypolygon.hxx>
+#include <drawinglayer/attribute/materialattribute3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** PolyPolygonMaterialPrimitive3D class
+
+ This primitive defines a planar 3D PolyPolygon filled with a single color.
+ This is one of the non-decomposable primitives, so a renderer
+ should proccess it.
+
+ It is assumed here that the PolyPolgon is a single plane in 3D.
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolyPolygonMaterialPrimitive3D : public BasePrimitive3D
+ {
+ private:
+ /// the PolyPolygon geometry
+ basegfx::B3DPolyPolygon maPolyPolygon;
+
+ /// the fill parameters
+ attribute::MaterialAttribute3D maMaterial;
+
+ /// bitfield
+ unsigned mbDoubleSided : 1;
+
+ public:
+ /// constructor
+ PolyPolygonMaterialPrimitive3D(
+ const basegfx::B3DPolyPolygon& rPolyPolygon,
+ const attribute::MaterialAttribute3D& rMaterial,
+ bool bDoubleSided);
+
+ /// data read access
+ const basegfx::B3DPolyPolygon& getB3DPolyPolygon() const { return maPolyPolygon; }
+ const attribute::MaterialAttribute3D& getMaterial() const { return maMaterial; }
+ bool getDoubleSided() const { return mbDoubleSided; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx b/include/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
new file mode 100644
index 000000000000..513d120c5343
--- /dev/null
+++ b/include/drawinglayer/primitive3d/sdrcubeprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_SDRCUBEPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRCUBEPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/sdrprimitive3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** SdrCubePrimitive3D class
+
+ This 3D primitive expands the SdrPrimitive3D to a 3D cube definition.
+ The cube is implicitely in unit coordinates and the given transformation
+ defines it's geometry in space.
+ */
+ class DRAWINGLAYER_DLLPUBLIC SdrCubePrimitive3D : public SdrPrimitive3D
+ {
+ protected:
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ public:
+ /// constructor
+ SdrCubePrimitive3D(
+ const basegfx::B3DHomMatrix& rTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
+ const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRCUBEPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx b/include/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
new file mode 100644
index 000000000000..ffe0e2cea676
--- /dev/null
+++ b/include/drawinglayer/primitive3d/sdrdecompositiontools3d.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_DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+#include <com/sun/star/drawing/TextureProjectionMode.hpp>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class B3DPolygon;
+ class B3DPolyPolygon;
+ class B3DHomMatrix;
+ class B2DVector;
+}
+
+namespace drawinglayer { namespace attribute {
+ class SdrLineAttribute;
+ class SdrFillAttribute;
+ class Sdr3DObjectAttribute;
+ class FillGradientAttribute;
+ class SdrShadowAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ // #i98295#
+ basegfx::B3DRange DRAWINGLAYER_DLLPUBLIC getRangeFrom3DGeometry(::std::vector< basegfx::B3DPolyPolygon >& rFill);
+ void DRAWINGLAYER_DLLPUBLIC applyNormalsKindSphereTo3DGeometry(::std::vector< basegfx::B3DPolyPolygon >& rFill, const basegfx::B3DRange& rRange);
+ void DRAWINGLAYER_DLLPUBLIC applyNormalsKindFlatTo3DGeometry(::std::vector< basegfx::B3DPolyPolygon >& rFill);
+ void DRAWINGLAYER_DLLPUBLIC applyNormalsInvertTo3DGeometry(::std::vector< basegfx::B3DPolyPolygon >& rFill);
+
+ // #i98314#
+ void DRAWINGLAYER_DLLPUBLIC applyTextureTo3DGeometry(
+ ::com::sun::star::drawing::TextureProjectionMode eModeX,
+ ::com::sun::star::drawing::TextureProjectionMode eModeY,
+ ::std::vector< basegfx::B3DPolyPolygon >& rFill,
+ const basegfx::B3DRange& rRange,
+ const basegfx::B2DVector& rTextureSize);
+
+ Primitive3DSequence DRAWINGLAYER_DLLPUBLIC create3DPolyPolygonLinePrimitives(
+ const basegfx::B3DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B3DHomMatrix& rObjectTransform,
+ const attribute::SdrLineAttribute& rLine);
+
+ Primitive3DSequence DRAWINGLAYER_DLLPUBLIC create3DPolyPolygonFillPrimitives(
+ const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector,
+ const basegfx::B3DHomMatrix& rObjectTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute,
+ const attribute::SdrFillAttribute& rFill,
+ const attribute::FillGradientAttribute& rFillGradient);
+
+ Primitive3DSequence DRAWINGLAYER_DLLPUBLIC createShadowPrimitive3D(
+ const Primitive3DSequence& rSource,
+ const attribute::SdrShadowAttribute& rShadow,
+ bool bShadow3D);
+
+ Primitive3DSequence DRAWINGLAYER_DLLPUBLIC createHiddenGeometryPrimitives3D(
+ const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector,
+ const basegfx::B3DHomMatrix& rObjectTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute);
+
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_DRAWINGLAYER_PRIMITIVE3D_SDRDECOMPOSITIONTOOLS3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx b/include/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx
new file mode 100644
index 000000000000..d741b4c1b223
--- /dev/null
+++ b/include/drawinglayer/primitive3d/sdrextrudelathetools3d.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_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <basegfx/polygon/b3dpolypolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace geometry {
+ class ViewInformation3D;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** SliceType3D definition */
+ enum SliceType3D
+ {
+ SLICETYPE3D_REGULAR, // normal geoemtry Slice3D
+ SLICETYPE3D_FRONTCAP, // front cap
+ SLICETYPE3D_BACKCAP // back cap
+ };
+
+ /// class to hold one Slice3D
+ class DRAWINGLAYER_DLLPUBLIC Slice3D
+ {
+ protected:
+ basegfx::B3DPolyPolygon maPolyPolygon;
+ SliceType3D maSliceType;
+
+ public:
+ Slice3D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const basegfx::B3DHomMatrix& aTransform,
+ SliceType3D aSliceType = SLICETYPE3D_REGULAR)
+ : maPolyPolygon(basegfx::tools::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPolygon)),
+ maSliceType(aSliceType)
+ {
+ maPolyPolygon.transform(aTransform);
+ }
+
+ explicit Slice3D(
+ const basegfx::B3DPolyPolygon& rPolyPolygon,
+ SliceType3D aSliceType = SLICETYPE3D_REGULAR)
+ : maPolyPolygon(rPolyPolygon),
+ maSliceType(aSliceType)
+ {
+ }
+
+ // data access
+ const basegfx::B3DPolyPolygon& getB3DPolyPolygon() const { return maPolyPolygon; }
+ SliceType3D getSliceType() const { return maSliceType; }
+ };
+
+ /// typedef for a group of Slice3Ds
+ typedef ::std::vector< Slice3D > Slice3DVector;
+
+ /// helpers for creation
+ void DRAWINGLAYER_DLLPUBLIC createLatheSlices(
+ Slice3DVector& rSliceVector,
+ const basegfx::B2DPolyPolygon& rSource,
+ double fBackScale,
+ double fDiagonal,
+ double fRotation,
+ sal_uInt32 nSteps,
+ bool bCharacterMode,
+ bool bCloseFront,
+ bool bCloseBack);
+
+ void DRAWINGLAYER_DLLPUBLIC createExtrudeSlices(
+ Slice3DVector& rSliceVector,
+ const basegfx::B2DPolyPolygon& rSource,
+ double fBackScale,
+ double fDiagonal,
+ double fDepth,
+ bool bCharacterMode,
+ bool bCloseFront,
+ bool bCloseBack);
+
+ /// helpers for geometry extraction
+ basegfx::B3DPolyPolygon DRAWINGLAYER_DLLPUBLIC extractHorizontalLinesFromSlice(const Slice3DVector& rSliceVector, bool bCloseHorLines);
+ basegfx::B3DPolyPolygon DRAWINGLAYER_DLLPUBLIC extractVerticalLinesFromSlice(const Slice3DVector& rSliceVector);
+
+ void DRAWINGLAYER_DLLPUBLIC extractPlanesFromSlice(
+ ::std::vector< basegfx::B3DPolyPolygon >& rFill,
+ const Slice3DVector& rSliceVector,
+ bool bCreateNormals,
+ bool bSmoothHorizontalNormals,
+ bool bSmoothNormals,
+ bool bSmoothLids,
+ bool bClosed,
+ double fSmoothNormalsMix,
+ double fSmoothLidsMix,
+ bool bCreateTextureCoordinates,
+ const basegfx::B2DHomMatrix& rTexTransform);
+
+ void DRAWINGLAYER_DLLPUBLIC createReducedOutlines(
+ const geometry::ViewInformation3D& rViewInformation,
+ const basegfx::B3DHomMatrix& rObjectTransform,
+ const basegfx::B3DPolygon& rLoopA,
+ const basegfx::B3DPolygon& rLoopB,
+ basegfx::B3DPolyPolygon& rTarget);
+
+ } // end of namespace overlay
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDELATHETOOLS3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx b/include/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
new file mode 100644
index 000000000000..055e7e71dd4c
--- /dev/null
+++ b/include/drawinglayer/primitive3d/sdrextrudeprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/sdrprimitive3d.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** SdrExtrudePrimitive3D class
+
+ This 3D primitive expands the SdrPrimitive3D to a 3D extrude definition.
+ The given 2D PolyPolygon geometry is imagined as lying on the XY-plane in 3D
+ and gets extruded in Z-Direction by Depth.
+
+ Various possibilities e.g. for creating diagonals (edge roudings in 3D)
+ and similar are given.
+
+ The decomposition will create all necessary 3D planes for visualisation.
+ */
+ class DRAWINGLAYER_DLLPUBLIC SdrExtrudePrimitive3D : public SdrPrimitive3D
+ {
+ private:
+ /// geometry helper for slices
+ basegfx::B2DPolyPolygon maCorrectedPolyPolygon;
+ Slice3DVector maSlices;
+
+ /// primitive geometry data
+ basegfx::B2DPolyPolygon maPolyPolygon;
+ double mfDepth;
+ double mfDiagonal;
+ double mfBackScale;
+
+ /// decomposition data when ReducedLineGeometry is used, see get3DDecomposition
+ geometry::ViewInformation3D* mpLastRLGViewInformation;
+
+ /// bitfield
+ unsigned mbSmoothNormals : 1; // Plane self
+ unsigned mbSmoothHorizontalNormals : 1; // always
+ unsigned mbSmoothLids : 1; // Front/back
+ unsigned mbCharacterMode : 1;
+ unsigned mbCloseFront : 1;
+ unsigned mbCloseBack : 1;
+
+ /// create slices
+ void impCreateSlices();
+
+ /// get (evtl. create) slices
+ const Slice3DVector& getSlices() const;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ public:
+ /// constructor
+ SdrExtrudePrimitive3D(
+ const basegfx::B3DHomMatrix& rTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
+ const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ double fDepth,
+ double fDiagonal,
+ double fBackScale,
+ bool bSmoothNormals,
+ bool bSmoothHorizontalNormals,
+ bool bSmoothLids,
+ bool bCharacterMode,
+ bool bCloseFront,
+ bool bCloseBack);
+ virtual ~SdrExtrudePrimitive3D();
+
+ /// data read access
+ const basegfx::B2DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; }
+ double getDepth() const { return mfDepth; }
+ double getDiagonal() const { return mfDiagonal; }
+ double getBackScale() const { return mfBackScale; }
+ bool getSmoothNormals() const { return mbSmoothNormals; }
+ bool getSmoothHorizontalNormals() const { return mbSmoothHorizontalNormals; }
+ bool getSmoothLids() const { return mbSmoothLids; }
+ bool getCharacterMode() const { return mbCharacterMode; }
+ bool getCloseFront() const { return mbCloseFront; }
+ bool getCloseBack() const { return mbCloseBack; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// Overloaded to allow for reduced line mode to decide if to buffer decomposition or not
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx b/include/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
new file mode 100644
index 000000000000..7632e8e5985c
--- /dev/null
+++ b/include/drawinglayer/primitive3d/sdrlatheprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_SDRLATHEPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRLATHEPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/sdrprimitive3d.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** SdrLathePrimitive3D class
+
+ This 3D primitive expands the SdrPrimitive3D to a 3D rotation definition.
+ The given 2D PolyPolygon geometry is imagined as lying on the XY-plane in 3D
+ and gets rotated around the Y-Axis.
+
+ Various possibilities e.g. for creating diagonals (edge roudings in 3D)
+ and similar are given.
+
+ The decomposition will create all necessary 3D planes for visualisation.
+ */
+ class DRAWINGLAYER_DLLPUBLIC SdrLathePrimitive3D : public SdrPrimitive3D
+ {
+ private:
+ /// geometry helper for slices
+ basegfx::B2DPolyPolygon maCorrectedPolyPolygon;
+ Slice3DVector maSlices;
+
+ /// primitive geometry data
+ basegfx::B2DPolyPolygon maPolyPolygon;
+ sal_uInt32 mnHorizontalSegments;
+ sal_uInt32 mnVerticalSegments;
+ double mfDiagonal;
+ double mfBackScale;
+ double mfRotation;
+
+ /// decomposition data when ReducedLineGeometry is used, see get3DDecomposition
+ geometry::ViewInformation3D* mpLastRLGViewInformation;
+
+ /// bitfield
+ unsigned mbSmoothNormals : 1; // Plane self
+ unsigned mbSmoothHorizontalNormals : 1; // always
+ unsigned mbSmoothLids : 1; // Front/back
+ unsigned mbCharacterMode : 1;
+ unsigned mbCloseFront : 1;
+ unsigned mbCloseBack : 1;
+
+ /// create slices
+ void impCreateSlices();
+
+ /// get (evtl. create) slices
+ const Slice3DVector& getSlices() const;
+
+ protected:
+ /// local helpers
+ void impCreateOutlines(
+ const geometry::ViewInformation3D& rViewInformation,
+ const basegfx::B3DPolygon& rLoopA,
+ const basegfx::B3DPolygon& rLoopB,
+ basegfx::B3DPolyPolygon& rTarget) const;
+
+ bool impHasCutWith(
+ const basegfx::B2DPolygon& rPoly,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd) const;
+
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ public:
+ /// constructor
+ SdrLathePrimitive3D(
+ const basegfx::B3DHomMatrix& rTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
+ const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ sal_uInt32 nHorizontalSegments,
+ sal_uInt32 nVerticalSegments,
+ double fDiagonal,
+ double fBackScale,
+ double fRotation,
+ bool bSmoothNormals,
+ bool bSmoothHorizontalNormals,
+ bool bSmoothLids,
+ bool bCharacterMode,
+ bool bCloseFront,
+ bool bCloseBack);
+ virtual ~SdrLathePrimitive3D();
+
+ /// data read access
+ const basegfx::B2DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; }
+ sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; }
+ sal_uInt32 getVerticalSegments() const { return mnVerticalSegments; }
+ double getDiagonal() const { return mfDiagonal; }
+ double getBackScale() const { return mfBackScale; }
+ double getRotation() const { return mfRotation; }
+ bool getSmoothNormals() const { return mbSmoothNormals; }
+ bool getSmoothHorizontalNormals() const { return mbSmoothHorizontalNormals; }
+ bool getSmoothLids() const { return mbSmoothLids; }
+ bool getCharacterMode() const { return mbCharacterMode; }
+ bool getCloseFront() const { return mbCloseFront; }
+ bool getCloseBack() const { return mbCloseBack; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// Overloaded to allow for reduced line mode to decide if to buffer decomposition or not
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRLATHEPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx b/include/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
new file mode 100644
index 000000000000..2d9976224e6b
--- /dev/null
+++ b/include/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPOLYPOLYGONPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPOLYPOLYGONPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/sdrprimitive3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** SdrPolyPolygonPrimitive3D class
+
+ This 3D primitive defines a PolyPolgon in space which may have
+ Line- and FillStyles and extra 3D surface attributes. It is assumed
+ that the given 3D PolyPolgon (which may contain texture and normal
+ information) is planar in 3D.
+
+ The decomposition will include all needed 3D data for visualisation,
+ including FatLines and fill styles.
+ */
+ class DRAWINGLAYER_DLLPUBLIC SdrPolyPolygonPrimitive3D : public SdrPrimitive3D
+ {
+ private:
+ /// the planar polyPolygon evtl with normals and texture coordinates
+ basegfx::B3DPolyPolygon maPolyPolygon3D;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ public:
+ /// constructor
+ SdrPolyPolygonPrimitive3D(
+ const basegfx::B3DPolyPolygon& rPolyPolygon3D,
+ const basegfx::B3DHomMatrix& rTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
+ const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
+
+ /// data access
+ const basegfx::B3DPolyPolygon& getPolyPolygon3D() const { return maPolyPolygon3D; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPOLYPOLYGONPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/sdrprimitive3d.hxx b/include/drawinglayer/primitive3d/sdrprimitive3d.hxx
new file mode 100644
index 000000000000..6563f5172f67
--- /dev/null
+++ b/include/drawinglayer/primitive3d/sdrprimitive3d.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+#include <basegfx/matrix/b3dhommatrix.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <drawinglayer/attribute/sdrallattribute3d.hxx>
+#include <drawinglayer/primitive3d/sdrextrudelathetools3d.hxx>
+#include <drawinglayer/attribute/sdrobjectattribute3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ /** SdrPrimitive3D class
+
+ Base class for the more complicated geometric primitives, so
+ derive from buffered primitive to allow overloading of
+ create3DDecomposition there.
+ */
+ namespace primitive3d
+ {
+ class DRAWINGLAYER_DLLPUBLIC SdrPrimitive3D : public BufferedDecompositionPrimitive3D
+ {
+ private:
+ /// object surface attributes
+ basegfx::B3DHomMatrix maTransform;
+ basegfx::B2DVector maTextureSize;
+ attribute::SdrLineFillShadowAttribute3D maSdrLFSAttribute;
+ attribute::Sdr3DObjectAttribute maSdr3DObjectAttribute;
+
+ protected:
+ /** Standard implementation for primitive3D which
+ will use maTransform as range and expand by evtl. line width / 2
+ */
+ basegfx::B3DRange getStandard3DRange() const;
+
+ /** implementation for primitive3D which
+ will use given Slice3Ds and expand by evtl. line width / 2
+ */
+ basegfx::B3DRange get3DRangeFromSlices(const Slice3DVector& rSlices) const;
+
+ public:
+ /// constructor
+ SdrPrimitive3D(
+ const basegfx::B3DHomMatrix& rTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
+ const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
+
+ /// data read access
+ const basegfx::B3DHomMatrix& getTransform() const { return maTransform; }
+ const basegfx::B2DVector& getTextureSize() const { return maTextureSize; }
+ const attribute::SdrLineFillShadowAttribute3D& getSdrLFSAttribute() const { return maSdrLFSAttribute; }
+ const attribute::Sdr3DObjectAttribute getSdr3DObjectAttribute() const { return maSdr3DObjectAttribute; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx b/include/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
new file mode 100644
index 000000000000..48e7ee42ceb2
--- /dev/null
+++ b/include/drawinglayer/primitive3d/sdrsphereprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/sdrprimitive3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** SdrSpherePrimitive3D class
+
+ This 3D primitive expands the SdrPrimitive3D to a 3D sphere definition.
+ The sphere is implicitely in unit coordinates and the given transformation
+ defines it's geometry in space.
+ */
+ class DRAWINGLAYER_DLLPUBLIC SdrSpherePrimitive3D : public SdrPrimitive3D
+ {
+ private:
+ /// additional geometry definitions
+ sal_uInt32 mnHorizontalSegments;
+ sal_uInt32 mnVerticalSegments;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ public:
+ /// constructor
+ SdrSpherePrimitive3D(
+ const basegfx::B3DHomMatrix& rTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
+ const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
+ sal_uInt32 nHorizontalSegments,
+ sal_uInt32 nVerticalSegments);
+
+ /// data read access
+ sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; }
+ sal_uInt32 getVerticalSegments() const { return mnVerticalSegments; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/shadowprimitive3d.hxx b/include/drawinglayer/primitive3d/shadowprimitive3d.hxx
new file mode 100644
index 000000000000..76be7e7742f4
--- /dev/null
+++ b/include/drawinglayer/primitive3d/shadowprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/groupprimitive3d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** ShadowPrimitive3D class
+
+ This 3D grouping primitive is used to define a shadow for
+ 3d geometry by embedding it. The shadow of 3D objects are
+ 2D polygons, so the shadow transformation is a 2D transformation.
+
+ If the Shadow3D flag is set, the shadow definition has to be
+ combined with the scene and camera definition to create the correct
+ projected shadow 2D-Polygons.
+ */
+ class DRAWINGLAYER_DLLPUBLIC ShadowPrimitive3D : public GroupPrimitive3D
+ {
+ protected:
+ /// 2D shadow definition
+ basegfx::B2DHomMatrix maShadowTransform;
+ basegfx::BColor maShadowColor;
+ double mfShadowTransparence;
+
+ /// bitfield
+ unsigned mbShadow3D : 1;
+
+ public:
+ /// constructor
+ ShadowPrimitive3D(
+ const basegfx::B2DHomMatrix& rShadowTransform,
+ const basegfx::BColor& rShadowColor,
+ double fShadowTransparence,
+ bool bShadow3D,
+ const Primitive3DSequence& rChildren);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; }
+ const basegfx::BColor& getShadowColor() const { return maShadowColor; }
+ double getShadowTransparence() const { return mfShadowTransparence; }
+ bool getShadow3D() const { return mbShadow3D; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/textureprimitive3d.hxx b/include/drawinglayer/primitive3d/textureprimitive3d.hxx
new file mode 100644
index 000000000000..1ce8e9bcd57c
--- /dev/null
+++ b/include/drawinglayer/primitive3d/textureprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/groupprimitive3d.hxx>
+#include <drawinglayer/attribute/fillbitmapattribute.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** TexturePrimitive3D class
+
+ This 3D grouping primitive is used to define a texture for
+ 3d geometry by embedding it. It is used as bae class for
+ extended texture definitions
+ */
+ class DRAWINGLAYER_DLLPUBLIC TexturePrimitive3D : public GroupPrimitive3D
+ {
+ private:
+ /// texture geometry definition
+ basegfx::B2DVector maTextureSize;
+
+ /// bitfield
+ /// flag if texture shall be modulated with white interpolated color
+ unsigned mbModulate : 1;
+
+ /// flag if texture shall be filtered
+ unsigned mbFilter : 1;
+
+ public:
+ /// constructor
+ TexturePrimitive3D(
+ const Primitive3DSequence& rChildren,
+ const basegfx::B2DVector& rTextureSize,
+ bool bModulate,
+ bool bFilter);
+
+ /// data read access
+ const basegfx::B2DVector& getTextureSize() const { return maTextureSize; }
+ bool getModulate() const { return mbModulate; }
+ bool getFilter() const { return mbFilter; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** UnifiedTransparenceTexturePrimitive3D class
+
+ This 3D primitive expands TexturePrimitive3D to a unified
+ transparence texture definition. All 3D primitives
+ embedded here will be shown with the given transparency.
+ */
+ class DRAWINGLAYER_DLLPUBLIC UnifiedTransparenceTexturePrimitive3D : public TexturePrimitive3D
+ {
+ private:
+ /// transparency definition
+ double mfTransparence;
+
+ public:
+ /// constructor
+ UnifiedTransparenceTexturePrimitive3D(
+ double fTransparence,
+ const Primitive3DSequence& rChildren);
+
+ /// data read access
+ double getTransparence() const { return mfTransparence; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// own getB3DRange implementation to include transparent geometries to BoundRect calculations
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// local decomposition.
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** GradientTexturePrimitive3D class
+
+ This 3D primitive expands TexturePrimitive3D to a gradient texture
+ definition. All 3D primitives embedded here will be shown with the
+ defined gradient.
+ */
+ class DRAWINGLAYER_DLLPUBLIC GradientTexturePrimitive3D : public TexturePrimitive3D
+ {
+ private:
+ /// the gradient definition
+ attribute::FillGradientAttribute maGradient;
+
+ public:
+ /// constructor
+ GradientTexturePrimitive3D(
+ const attribute::FillGradientAttribute& rGradient,
+ const Primitive3DSequence& rChildren,
+ const basegfx::B2DVector& rTextureSize,
+ bool bModulate,
+ bool bFilter);
+
+ /// data read access
+ const attribute::FillGradientAttribute& getGradient() const { return maGradient; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** BitmapTexturePrimitive3D class
+
+ This 3D primitive expands TexturePrimitive3D to a bitmap texture
+ definition. All 3D primitives embedded here will be shown with the
+ defined bitmap (maybe tiled if defined).
+ */
+ class DRAWINGLAYER_DLLPUBLIC BitmapTexturePrimitive3D : public TexturePrimitive3D
+ {
+ private:
+ /// bitmap fill attribute
+ attribute::FillBitmapAttribute maFillBitmapAttribute;
+
+ public:
+ /// constructor
+ BitmapTexturePrimitive3D(
+ const attribute::FillBitmapAttribute& rFillBitmapAttribute,
+ const Primitive3DSequence& rChildren,
+ const basegfx::B2DVector& rTextureSize,
+ bool bModulate,
+ bool bFilter);
+
+ /// data read access
+ const attribute::FillBitmapAttribute& getFillBitmapAttribute() const { return maFillBitmapAttribute; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** TransparenceTexturePrimitive3D class
+
+ This 3D primitive expands TexturePrimitive3D to a transparence texture
+ definition. For transparence definition, a gradient is used. The values in
+ that gradient will be interpreted as luminance Transparence-Values. All 3D
+ primitives embedded here will be shown with the defined transparence.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TransparenceTexturePrimitive3D : public GradientTexturePrimitive3D
+ {
+ public:
+ /// constructor
+ TransparenceTexturePrimitive3D(
+ const attribute::FillGradientAttribute& rGradient,
+ const Primitive3DSequence& rChildren,
+ const basegfx::B2DVector& rTextureSize);
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive3d/transformprimitive3d.hxx b/include/drawinglayer/primitive3d/transformprimitive3d.hxx
new file mode 100644
index 000000000000..85a88a330d77
--- /dev/null
+++ b/include/drawinglayer/primitive3d/transformprimitive3d.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_DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/groupprimitive3d.hxx>
+#include <basegfx/matrix/b3dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** TransformPrimitive3D class
+
+ This is one of the basic grouping 3D primitives and it provides
+ embedding a sequence of primitives (a geometry) into a
+ 3D transformation.
+
+ Please see the description for TransformPrimitive2D since these
+ primitives are pretty similar.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TransformPrimitive3D : public GroupPrimitive3D
+ {
+ private:
+ // the 3D transformation to apply
+ basegfx::B3DHomMatrix maTransformation;
+
+ public:
+ /// constructor
+ TransformPrimitive3D(
+ const basegfx::B3DHomMatrix& rTransformation,
+ const Primitive3DSequence& rChildren);
+
+ /// data read access
+ const basegfx::B3DHomMatrix& getTransformation() const { return maTransformation; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TRANSFORMPRIMITIVE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor2d/baseprocessor2d.hxx b/include/drawinglayer/processor2d/baseprocessor2d.hxx
new file mode 100644
index 000000000000..62a0f874a9ae
--- /dev/null
+++ b/include/drawinglayer/processor2d/baseprocessor2d.hxx
@@ -0,0 +1,196 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_BASEPROCESSOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_BASEPROCESSOR2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** BaseProcessor2D class
+
+ Baseclass for all C++ implementations of instances which process
+ primitives.
+
+ Instances which process primitives can be renderers, but also stuff
+ for HitTests, BoundRect calculations and/or animation processing. The
+ main usage are renderers, but they are supposed to handle any primitive
+ processing.
+
+ The base implementation is constructed with a ViewInformation2D which
+ is accessible throughout the processor implementations. The idea is
+ to construct any processor with a given ViewInformation2D. To be able
+ to handle primitives which need to change the current transformation
+ (as e.g. TransformPrimitive2D) it is allowed for the processor implementation
+ to change tis local value using updateViewInformation.
+
+ The basic processing method is process(..) which gets handed over the
+ sequence of primitives to process. For convenience of the C++ implementations,
+ the default implementation of process(..) maps all accesses to primitives to
+ single calls to processBasePrimitive2D(..) where the primitive in question is
+ already casted to the C++ implementation class.
+
+ The process(..) implementation makes a complete iteration over the given
+ sequence of primitives. If the Primitive is not derived from BasePrimitive2D
+ and thus not part of the C++ implementations, it converts ViewInformation2D
+ to the corresponding API implementation (an uno::Sequence< beans::PropertyValue >)
+ and recursively calls the method process(..) at the primitive with the decomposition
+ derived from that primitive. This is the preparation to handle unknown implementations
+ of the com::sun::star::graphic::XPrimitive2D interface in the future.
+
+ So, to implement a basic processor, it is necessary to overload and implement the
+ processBasePrimitive2D(..) method. A minimal renderer has to support the
+ Basic Primitives (see baseprimitive2d.hxx) and the Grouping Primitives (see
+ groupprimitive2d.hxx). These are (currently):
+
+ Basic Primitives:
+
+ - BitmapPrimitive2D (bitmap data, evtl. with transparence)
+ - PointArrayPrimitive2D (single points)
+ - PolygonHairlinePrimitive2D (hairline curves/polygons)
+ - PolyPolygonColorPrimitive2D (colored polygons)
+
+ Grouping Primitives:
+
+ - TransparencePrimitive2D (objects with freely defined transparence)
+ - InvertPrimitive2D (for XOR)
+ - MaskPrimitive2D (for masking)
+ - ModifiedColorPrimitive2D (for a stack of color modifications)
+ - TransformPrimitive2D (for a transformation stack)
+
+ A processor doing so is a minimal processor. Of course a processor may
+ handle any higher-level prmitive (that has a decomposition implementation)
+ for more direct data access or performance reasons, too.
+
+ The main part of a processBasePrimitive2D implementation is a switch..case
+ construct, looking like the following:
+
+ void foo::processBasePrimitive2D(const BasePrimitive2D& rCandidate)
+ {
+ switch(rCandidate.getPrimitive2DID())
+ {
+ case PRIMITIVE2D_ID_??? :
+ {
+ // process PRIMITIVE2D_ID_??? here...
+
+ ...
+
+ break;
+ }
+
+ ...
+
+ default :
+ {
+ // process recursively
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ break;
+ }
+ }
+ }
+
+ The default case makes the processor work with all complex primitives
+ by recursively using their decomposition.
+
+ You can also add a case for ignoring primitives by using:
+
+ case PRIMITIVE2D_ID_...IGNORE.A.. :
+ case PRIMITIVE2D_ID_...IGNORE.B.. :
+ case PRIMITIVE2D_ID_...IGNORE.C.. :
+ {
+ // ignore these primitives by neither processing nor
+ // recursively processing their decomposition
+ break;
+ }
+
+ Another useful case is embedding the processing of a complex primitive by
+ bracketing it with some actions:
+
+ case PRIMITIVE2D_ID_SOME_TEXT :
+ {
+ // encapsulate e.g. with changing local varibles, e.g.
+ // sometimes it's good to know if a basic primitive is
+ // part of a text, especially when not handling the text
+ // self but by purpose want to handle the decomposed
+ // geometries in the processor
+ startText();
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ endText();
+ break;
+ }
+
+ As an example a processor collecting the outlines of a sequence of primitives
+ only needs to handle some Basic Primitives and create outline and collect
+ outline polygons e.g. for primitives with area like BitmapPrimitive2D (a
+ rectangle) and PolyPolygonColorPrimitive2D. When also handling the Grouping
+ Primitives MaskPrimitive2D (e.g. ignoring it's content, using the mask polyPolygon)
+ and TransformPrimitive2D (to have the correct local transformation), a processor
+ creating the outline can be written using just four (4) primitives. As a tipp, it can
+ be helpful to add many for the purpose not interesting higher level primitives
+ to not force their decomposition to be created and/or parsed.
+ */
+ class DRAWINGLAYER_DLLPUBLIC BaseProcessor2D
+ {
+ private:
+ /// The ViewInformation2D itself. It's private to isolate accesses to it
+ geometry::ViewInformation2D maViewInformation2D;
+
+ protected:
+ /* access method to allow the implementations to change the current
+ ViewInformation2D if needed. This allows isolating these accesses
+ later if needed
+ */
+ void updateViewInformation(const geometry::ViewInformation2D& rViewInformation2D)
+ {
+ maViewInformation2D = rViewInformation2D;
+ }
+
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive2D-based.
+ Default implementation does nothing
+ */
+ virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+
+ public:
+ /// constructor/destructor
+ explicit BaseProcessor2D(const geometry::ViewInformation2D& rViewInformation);
+ virtual ~BaseProcessor2D();
+
+ /// the central processing method
+ virtual void process(const primitive2d::Primitive2DSequence& rSource);
+
+ /// data read access
+ const geometry::ViewInformation2D& getViewInformation2D() const { return maViewInformation2D; }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PROCESSOR2D_BASEPROCESSOR2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor2d/canvasprocessor.hxx b/include/drawinglayer/processor2d/canvasprocessor.hxx
new file mode 100644
index 000000000000..5dea3b450c19
--- /dev/null
+++ b/include/drawinglayer/processor2d/canvasprocessor.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _DRAWINGLAYER_PROCESSOR_CANVASPROCESSOR_HXX
+#define _DRAWINGLAYER_PROCESSOR_CANVASPROCESSOR_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolormodifier.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
+#include <com/sun/star/rendering/ViewState.hpp>
+#include <com/sun/star/rendering/RenderState.hpp>
+#include <i18nlangtag/lang.h>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <vcl/mapmod.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// forward declaration
+
+namespace basegfx {
+ class BColor;
+ class B2DPolygon;
+}
+
+namespace com { namespace sun { namespace star { namespace rendering {
+ class XCanvas;
+ class XPolyPolygon2D;
+}}}}
+
+namespace drawinglayer { namespace primitive2d {
+ class MaskPrimitive2D;
+ class MetafilePrimitive2D;
+ class TextSimplePortionPrimitive2D;
+ class BitmapPrimitive2D;
+ class TransparencePrimitive2D;
+ class PolygonStrokePrimitive2D;
+ class FillBitmapPrimitive2D;
+ class UnifiedTransparencePrimitive2D;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** canvasProcessor2D class
+
+ A basic implementation of a renderer for com::sun::star::rendering::XCanvas
+ as a target
+ */
+ class DRAWINGLAYER_DLLPUBLIC canvasProcessor2D : public BaseProcessor2D
+ {
+ private:
+ // the (current) destination OutDev and canvas
+ OutputDevice* mpOutputDevice;
+ com::sun::star::uno::Reference< com::sun::star::rendering::XCanvas > mxCanvas;
+ com::sun::star::rendering::ViewState maViewState;
+ com::sun::star::rendering::RenderState maRenderState;
+
+ // the modifiedColorPrimitive stack
+ basegfx::BColorModifierStack maBColorModifierStack;
+
+ // SvtOptionsDrawinglayer incarnation to react on diverse settings
+ const SvtOptionsDrawinglayer maDrawinglayerOpt;
+
+ // the current clipping PolyPolygon from MaskPrimitive2D, always in
+ // object coordinates
+ basegfx::B2DPolyPolygon maClipPolyPolygon;
+
+ // determined LanguageType
+ LanguageType meLang;
+
+ // as tooling, the process() implementation takes over API handling and calls this
+ // virtual render method when the primitive implementation is BasePrimitive2D-based.
+ virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+
+ // direct primitive renderer support
+ void impRenderMaskPrimitive2D(const primitive2d::MaskPrimitive2D& rMaskCandidate);
+ void impRenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rMetaCandidate);
+ void impRenderTextSimplePortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate);
+ void impRenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
+ void impRenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransparenceCandidate);
+ void impRenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokePrimitive);
+ void impRenderFillBitmapPrimitive2D(const primitive2d::FillBitmapPrimitive2D& rFillBitmapPrimitive2D);
+ void impRenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate);
+
+ public:
+ canvasProcessor2D(
+ const geometry::ViewInformation2D& rViewInformation,
+ OutputDevice& rOutDev);
+ virtual ~canvasProcessor2D();
+
+ // access to Drawinglayer configuration options
+ const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_DRAWINGLAYER_PROCESSOR_CANVASPROCESSOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor2d/contourextractor2d.hxx b/include/drawinglayer/processor2d/contourextractor2d.hxx
new file mode 100644
index 000000000000..af390a8cd7b7
--- /dev/null
+++ b/include/drawinglayer/processor2d/contourextractor2d.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_DRAWINGLAYER_PROCESSOR2D_CONTOUREXTRACTOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_CONTOUREXTRACTOR2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** ContourExtractor2D class
+
+ A processor who extracts the contour of the primtives feeded to it
+ in the single local PolyPolygon
+ */
+ class DRAWINGLAYER_DLLPUBLIC ContourExtractor2D : public BaseProcessor2D
+ {
+ private:
+ /// the extracted contour
+ basegfx::B2DPolyPolygonVector maExtractedContour;
+
+ /// bitfield
+ bool mbExtractFillOnly : 1;
+
+ /// tooling methods
+ void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+
+ public:
+ explicit ContourExtractor2D(
+ const geometry::ViewInformation2D& rViewInformation,
+ bool bExtractFillOnly);
+
+ virtual ~ContourExtractor2D();
+
+ const basegfx::B2DPolyPolygonVector& getExtractedContour() const { return maExtractedContour; }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_CONTOUREXTRACTOR2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor2d/hittestprocessor2d.hxx b/include/drawinglayer/processor2d/hittestprocessor2d.hxx
new file mode 100644
index 000000000000..fc2ab3252558
--- /dev/null
+++ b/include/drawinglayer/processor2d/hittestprocessor2d.hxx
@@ -0,0 +1,108 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_HITTESTPROCESSOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_HITTESTPROCESSOR2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace basegfx { class B2DPolygon; }
+namespace basegfx { class B2DPolyPolygon; }
+namespace drawinglayer { namespace primitive2d { class ScenePrimitive2D; }}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** HitTestProcessor2D class
+
+ This processor implements a HitTest with the feeded primitives,
+ given tolerance and extras
+ */
+ class DRAWINGLAYER_DLLPUBLIC HitTestProcessor2D : public BaseProcessor2D
+ {
+ private:
+ /// discrete HitTest position
+ basegfx::B2DPoint maDiscreteHitPosition;
+
+ /// discrete HitTolerance
+ double mfDiscreteHitTolerance;
+
+ /// bitfield
+ unsigned mbHit : 1;
+ unsigned mbHitToleranceUsed : 1;
+
+ /* this flag decides if primitives which are embedded to an
+ UnifiedTransparencePrimitive2D and are invisible will be taken into account for
+ HitTesting or not. Those primitives are created for objects which are else
+ completely invisible and normally their content exists of hairline
+ primitives describing the object's contour
+ */
+ unsigned mbUseInvisiblePrimitiveContent : 1;
+
+ /// flag to concentraze on text hits only
+ unsigned mbHitTextOnly : 1;
+
+ /// tooling methods
+ void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+ bool checkHairlineHitWithTolerance(
+ const basegfx::B2DPolygon& rPolygon,
+ double fDiscreteHitTolerance);
+ bool checkFillHitWithTolerance(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ double fDiscreteHitTolerance);
+ void check3DHit(const primitive2d::ScenePrimitive2D& rCandidate);
+
+ public:
+ HitTestProcessor2D(
+ const geometry::ViewInformation2D& rViewInformation,
+ const basegfx::B2DPoint& rLogicHitPosition,
+ double fLogicHitTolerance,
+ bool bHitTextOnly);
+ virtual ~HitTestProcessor2D();
+
+ /// data write access
+ void setUseInvisiblePrimitiveContent(bool bNew)
+ {
+ if((bool)mbUseInvisiblePrimitiveContent != bNew) mbUseInvisiblePrimitiveContent = bNew;
+ }
+
+ /// data read access
+ const basegfx::B2DPoint& getDiscreteHitPosition() const { return maDiscreteHitPosition; }
+ double getDiscreteHitTolerance() const { return mfDiscreteHitTolerance; }
+ bool getHit() const { return mbHit; }
+ bool getHitToleranceUsed() const { return mbHitToleranceUsed; }
+ bool getUseInvisiblePrimitiveContent() const { return mbUseInvisiblePrimitiveContent;}
+ bool getHitTextOnly() const { return mbHitTextOnly; }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_HITTESTPROCESSOR2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor2d/linegeometryextractor2d.hxx b/include/drawinglayer/processor2d/linegeometryextractor2d.hxx
new file mode 100644
index 000000000000..4905f4062c5f
--- /dev/null
+++ b/include/drawinglayer/processor2d/linegeometryextractor2d.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_DRAWINGLAYER_PROCESSOR2D_LINEGEOMETRYEXTRACTOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_LINEGEOMETRYEXTRACTOR2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** LineGeometryExtractor2D class
+
+ This processor can extract the line geometry from feeded primpitives. The
+ hairlines and the fille geometry from fat lines are separated.
+ */
+ class DRAWINGLAYER_DLLPUBLIC LineGeometryExtractor2D : public BaseProcessor2D
+ {
+ private:
+ basegfx::B2DPolygonVector maExtractedHairlines;
+ basegfx::B2DPolyPolygonVector maExtractedLineFills;
+
+ /// bitfield
+ unsigned mbInLineGeometry : 1;
+
+ /// tooling methods
+ void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+
+ public:
+ LineGeometryExtractor2D(const geometry::ViewInformation2D& rViewInformation);
+ virtual ~LineGeometryExtractor2D();
+
+ const basegfx::B2DPolygonVector& getExtractedHairlines() const { return maExtractedHairlines; }
+ const basegfx::B2DPolyPolygonVector& getExtractedLineFills() const { return maExtractedLineFills; }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_LINEGEOMETRYEXTRACTOR2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor2d/objectinfoextractor2d.hxx b/include/drawinglayer/processor2d/objectinfoextractor2d.hxx
new file mode 100644
index 000000000000..42f4fb3970de
--- /dev/null
+++ b/include/drawinglayer/processor2d/objectinfoextractor2d.hxx
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_OBJECTINFOEXTRACTOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_OBJECTINFOEXTRACTOR2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer { namespace primitive2d { class ObjectInfoPrimitive2D; }}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** ObjectInfoPrimitiveExtractor2D class
+
+ A processor to find the first incarnation of ObjectInfoPrimitive2D
+ in a given hierarchy
+ */
+ class DRAWINGLAYER_DLLPUBLIC ObjectInfoPrimitiveExtractor2D : public BaseProcessor2D
+ {
+ private:
+ /// the target
+ const primitive2d::ObjectInfoPrimitive2D* mpFound;
+
+ /// tooling methods
+ void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+
+ public:
+ ObjectInfoPrimitiveExtractor2D(const geometry::ViewInformation2D& rViewInformation);
+ virtual ~ObjectInfoPrimitiveExtractor2D();
+
+ const primitive2d::ObjectInfoPrimitive2D* getResult() const { return mpFound; }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_OBJECTINFOEXTRACTOR2D_HXX
+
+// eof
diff --git a/include/drawinglayer/processor2d/processorfromoutputdevice.hxx b/include/drawinglayer/processor2d/processorfromoutputdevice.hxx
new file mode 100644
index 000000000000..cd149db71e6d
--- /dev/null
+++ b/include/drawinglayer/processor2d/processorfromoutputdevice.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 _PROCESSOR_FROM_OUTPUTDEVICE_HXX
+#define _PROCESSOR_FROM_OUTPUTDEVICE_HXX
+
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include "drawinglayer/drawinglayerdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class OutputDevice;
+
+namespace drawinglayer { namespace processor2d {
+ class BaseProcessor2D;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ // create a mating VCL-Provessor for given OutputDevice. This includes
+ // looking for MetaFile-recording. The returned renderer changes owner,
+ // deletion is duty of the caller
+ DRAWINGLAYER_DLLPUBLIC drawinglayer::processor2d::BaseProcessor2D* createBaseProcessor2DFromOutputDevice(
+ OutputDevice& rTargetOutDev,
+ const drawinglayer::geometry::ViewInformation2D& rViewInformation2D);
+
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_PROCESSOR_FROM_OUTPUTDEVICE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor2d/textaspolygonextractor2d.hxx b/include/drawinglayer/processor2d/textaspolygonextractor2d.hxx
new file mode 100644
index 000000000000..239e624ccced
--- /dev/null
+++ b/include/drawinglayer/processor2d/textaspolygonextractor2d.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_DRAWINGLAYER_PROCESSOR2D_TEXTASPOLYGONEXTRACTOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_TEXTASPOLYGONEXTRACTOR2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/color/bcolormodifier.hxx>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /// helper data structure for returning the result
+ struct DRAWINGLAYER_DLLPUBLIC TextAsPolygonDataNode
+ {
+ private:
+ basegfx::B2DPolyPolygon maB2DPolyPolygon;
+ basegfx::BColor maBColor;
+ bool mbIsFilled;
+
+ public:
+ TextAsPolygonDataNode(
+ const basegfx::B2DPolyPolygon& rB2DPolyPolygon,
+ const basegfx::BColor& rBColor,
+ bool bIsFilled)
+ : maB2DPolyPolygon(rB2DPolyPolygon),
+ maBColor(rBColor),
+ mbIsFilled(bIsFilled)
+ {
+ }
+
+ // data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maB2DPolyPolygon; }
+ const basegfx::BColor& getBColor() const { return maBColor; }
+ bool getIsFilled() const { return mbIsFilled; }
+ };
+
+ /// typedef for a vector of that helper data
+ typedef ::std::vector< TextAsPolygonDataNode > TextAsPolygonDataNodeVector;
+
+ /** TextAsPolygonExtractor2D class
+
+ This processor extracts text in the feeded primitives to filled polygons
+ */
+ class DRAWINGLAYER_DLLPUBLIC TextAsPolygonExtractor2D : public BaseProcessor2D
+ {
+ private:
+ // extraction target
+ TextAsPolygonDataNodeVector maTarget;
+
+ // the modifiedColorPrimitive stack
+ basegfx::BColorModifierStack maBColorModifierStack;
+
+ // flag if we are in a decomposed text
+ sal_uInt32 mnInText;
+
+ // tooling methods
+ void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+
+ public:
+ explicit TextAsPolygonExtractor2D(const geometry::ViewInformation2D& rViewInformation);
+ virtual ~TextAsPolygonExtractor2D();
+
+ // data read access
+ const TextAsPolygonDataNodeVector& getTarget() const { return maTarget; }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_TEXTASPOLYGONEXTRACTOR2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor2d/vclmetafileprocessor2d.hxx b/include/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
new file mode 100644
index 000000000000..fa85105939c8
--- /dev/null
+++ b/include/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLMETAFILEPROCESSOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLMETAFILEPROCESSOR2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor2d/vclprocessor2d.hxx>
+#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// vcl::PDFExtOutDevData support
+
+#include <vcl/pdfextoutdevdata.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+class GDIMetaFile;
+class Rectangle;
+class Gradient;
+class SvtGraphicFill;
+class SvtGraphicStroke;
+
+namespace drawinglayer { namespace attribute {
+ class FillGradientAttribute;
+ class LineAttribute;
+ class StrokeAttribute;
+ class LineStartEndAttribute;
+}}
+
+namespace basegfx {
+ class BColor;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** VclMetafileProcessor2D class
+
+ This processor derived from VclProcessor2D is the base class for rendering
+ all feeded primitives to a classical VCL-Metafile, including all over the
+ time grown extra data in comments and PDF exception data creations. Also
+ printing needs some exception stuff.
+
+ All in all it is needed to emulate the old ::paint output from the old
+ Drawinglayer as long as exporters and/or filters still use the Metafile
+ and the extra-data added to it (which can be seen mostly as 'extensions'
+ or simply as 'hacks').
+ */
+ class DRAWINGLAYER_DLLPUBLIC VclMetafileProcessor2D : public VclProcessor2D
+ {
+ private:
+ /// local helper(s)
+ Rectangle impDumpToMetaFile(
+ const primitive2d::Primitive2DSequence& rContent,
+ GDIMetaFile& o_rContentMetafile);
+ void impConvertFillGradientAttributeToVCLGradient(
+ Gradient& o_rVCLGradient,
+ const attribute::FillGradientAttribute& rFiGrAtt,
+ bool bIsTransparenceGradient);
+ void impStartSvtGraphicFill(SvtGraphicFill* pSvtGraphicFill);
+ void impEndSvtGraphicFill(SvtGraphicFill* pSvtGraphicFill);
+ SvtGraphicStroke* impTryToCreateSvtGraphicStroke(
+ const basegfx::B2DPolygon& rB2DPolygon,
+ const basegfx::BColor* pColor,
+ const attribute::LineAttribute* pLineAttribute,
+ const attribute::StrokeAttribute* pStrokeAttribute,
+ const attribute::LineStartEndAttribute* pStart,
+ const attribute::LineStartEndAttribute* pEnd);
+ void impStartSvtGraphicStroke(SvtGraphicStroke* pSvtGraphicStroke);
+ void impEndSvtGraphicStroke(SvtGraphicStroke* pSvtGraphicStroke);
+
+ /// Convert the fWidth to the same space as its coordinates.
+ double getTransformedLineWidth( double fWidth ) const;
+
+ /// the current clipping PolyPolygon from MaskPrimitive2D
+ basegfx::B2DPolyPolygon maClipPolyPolygon;
+
+ /// the target MetaFile
+ GDIMetaFile* mpMetaFile;
+
+ /* do not allow embedding SvtGraphicFills into each other,
+ use a counter to prevent that
+ */
+ sal_uInt32 mnSvtGraphicFillCount;
+
+ /// same for SvtGraphicStroke
+ sal_uInt32 mnSvtGraphicStrokeCount;
+
+ /* hold the last unified transparence value to have it handy
+ on SvtGraphicStroke creation
+ */
+ double mfCurrentUnifiedTransparence;
+
+ /* break iterator support
+ made static so it only needs to be fetched once, even with many single
+ constructed VclMetafileProcessor2D. It's still incarnated on demand,
+ but exists for OOo runtime now by purpose.
+ */
+ static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > mxBreakIterator;
+
+ /* vcl::PDFExtOutDevData support
+ For the first step, some extra actions at vcl::PDFExtOutDevData need to
+ be emulated with the VclMetafileProcessor2D. These are potentially temporarily
+ since PDF export may use PrimitiveSequences one day directly.
+ */
+ vcl::PDFExtOutDevData* mpPDFExtOutDevData;
+
+ protected:
+ /* the local processor for BasePrinitive2D-Implementation based primitives,
+ called from the common process()-implementation
+ */
+ virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+
+ public:
+ /// constructor/destructor
+ VclMetafileProcessor2D(
+ const geometry::ViewInformation2D& rViewInformation,
+ OutputDevice& rOutDev);
+ virtual ~VclMetafileProcessor2D();
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLMETAFILEPROCESSOR2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor2d/vclpixelprocessor2d.hxx b/include/drawinglayer/processor2d/vclpixelprocessor2d.hxx
new file mode 100644
index 000000000000..c3003f096467
--- /dev/null
+++ b/include/drawinglayer/processor2d/vclpixelprocessor2d.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_DRAWINGLAYER_PROCESSOR2D_VCLPIXELPROCESSOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPIXELPROCESSOR2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor2d/vclprocessor2d.hxx>
+#include <vcl/outdev.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** VclPixelProcessor2D class
+
+ This processor derived from VclProcessor2D is the base class for rendering
+ all feeded primitives to a VCL Window. It is the currently used renderer
+ for all VCL editing output from the DrawingLayer.
+ */
+ class DRAWINGLAYER_DLLPUBLIC VclPixelProcessor2D : public VclProcessor2D
+ {
+ private:
+ protected:
+ /* the local processor for BasePrinitive2D-Implementation based primitives,
+ called from the common process()-implementation
+ */
+ virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+
+ public:
+ /// constructor/destructor
+ VclPixelProcessor2D(
+ const geometry::ViewInformation2D& rViewInformation,
+ OutputDevice& rOutDev);
+ virtual ~VclPixelProcessor2D();
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPIXELPROCESSOR2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor2d/vclprocessor2d.hxx b/include/drawinglayer/processor2d/vclprocessor2d.hxx
new file mode 100644
index 000000000000..32dafbc42b0a
--- /dev/null
+++ b/include/drawinglayer/processor2d/vclprocessor2d.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_DRAWINGLAYER_PROCESSOR2D_VCLPROCESSOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPROCESSOR2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolormodifier.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+class OutputDevice;
+
+namespace drawinglayer { namespace primitive2d {
+ class TextSimplePortionPrimitive2D;
+ class PolygonHairlinePrimitive2D;
+ class BitmapPrimitive2D;
+ class FillBitmapPrimitive2D;
+ class PolyPolygonGradientPrimitive2D;
+ class PolyPolygonBitmapPrimitive2D;
+ class PolyPolygonColorPrimitive2D;
+ class MetafilePrimitive2D;
+ class MaskPrimitive2D;
+ class UnifiedTransparencePrimitive2D;
+ class TransparencePrimitive2D;
+ class TransformPrimitive2D;
+ class MarkerArrayPrimitive2D;
+ class PointArrayPrimitive2D;
+ class ModifiedColorPrimitive2D;
+ class PolygonStrokePrimitive2D;
+ class ControlPrimitive2D;
+ class PagePreviewPrimitive2D;
+ class EpsPrimitive2D;
+ class SvgLinearAtomPrimitive2D;
+ class SvgRadialAtomPrimitive2D;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** VclProcessor2D class
+
+ This processor is the base class for VCL-Based processors. It has no
+ processBasePrimitive2D implementation and thus is not usable directly.
+ */
+ class DRAWINGLAYER_DLLPUBLIC VclProcessor2D : public BaseProcessor2D
+ {
+ protected:
+ // the destination OutDev
+ OutputDevice* mpOutputDevice;
+
+ // the modifiedColorPrimitive stack
+ basegfx::BColorModifierStack maBColorModifierStack;
+
+ // the current transformation. Since VCL pixel renderer transforms to pixels
+ // and VCL MetaFile renderer to World (logic) coordinates, the local
+ // ViewInformation2D cannot directly be used, but needs to be kept up to date
+ basegfx::B2DHomMatrix maCurrentTransformation;
+
+ // SvtOptionsDrawinglayer incarnation to react on diverse settings
+ const SvtOptionsDrawinglayer maDrawinglayerOpt;
+
+ // stack value (increment and decrement) to count how deep we are in
+ // PolygonStrokePrimitive2D's decompositions (normally only one)
+ sal_uInt32 mnPolygonStrokePrimitive2D;
+
+ //////////////////////////////////////////////////////////////////////////////
+ // common VCL rendering support
+
+ void RenderTextSimpleOrDecoratedPortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate);
+ void RenderPolygonHairlinePrimitive2D(const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate, bool bPixelBased);
+ void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
+ void RenderFillBitmapPrimitive2D(const primitive2d::FillBitmapPrimitive2D& rFillBitmapCandidate);
+ void RenderPolyPolygonGradientPrimitive2D(const primitive2d::PolyPolygonGradientPrimitive2D& rPolygonCandidate);
+ void RenderPolyPolygonBitmapPrimitive2D(const primitive2d::PolyPolygonBitmapPrimitive2D& rPolygonCandidate);
+ void RenderPolyPolygonColorPrimitive2D(const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate);
+ void RenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rPolygonCandidate);
+ void RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D& rMaskCandidate);
+ void RenderModifiedColorPrimitive2D(const primitive2d::ModifiedColorPrimitive2D& rModifiedCandidate);
+ void RenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rTransCandidate);
+ void RenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransCandidate);
+ void RenderTransformPrimitive2D(const primitive2d::TransformPrimitive2D& rTransformCandidate);
+ void RenderPagePreviewPrimitive2D(const primitive2d::PagePreviewPrimitive2D& rPagePreviewCandidate);
+ void RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D& rMarkerArrayCandidate);
+ void RenderPointArrayPrimitive2D(const primitive2d::PointArrayPrimitive2D& rPointArrayCandidate);
+ void RenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokeCandidate);
+ void RenderEpsPrimitive2D(const primitive2d::EpsPrimitive2D& rEpsPrimitive2D);
+ void RenderSvgLinearAtomPrimitive2D(const primitive2d::SvgLinearAtomPrimitive2D& rCandidate);
+ void RenderSvgRadialAtomPrimitive2D(const primitive2d::SvgRadialAtomPrimitive2D& rCandidate);
+
+ /////////////////////////////////////////////////////////////////////////////
+ // DrawMode adaption support
+ void adaptLineToFillDrawMode() const;
+ void adaptTextToFillDrawMode() const;
+
+ public:
+ // constructor/destructor
+ VclProcessor2D(
+ const geometry::ViewInformation2D& rViewInformation,
+ OutputDevice& rOutDev);
+ virtual ~VclProcessor2D();
+
+ // access to Drawinglayer configuration options
+ const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPROCESSOR2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor3d/baseprocessor3d.hxx b/include/drawinglayer/processor3d/baseprocessor3d.hxx
new file mode 100644
index 000000000000..834779982ba5
--- /dev/null
+++ b/include/drawinglayer/processor3d/baseprocessor3d.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_DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+#include <drawinglayer/geometry/viewinformation3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor3d
+ {
+ /** BaseProcessor3D class
+
+ Baseclass for all C++ implementations of instances which process
+ primitives.
+
+ Please have a look at baseprocessor2d.hxx for more comments.
+ */
+ class DRAWINGLAYER_DLLPUBLIC BaseProcessor3D
+ {
+ private:
+ geometry::ViewInformation3D maViewInformation3D;
+
+ protected:
+ void updateViewInformation(const geometry::ViewInformation3D& rViewInformation3D)
+ {
+ maViewInformation3D = rViewInformation3D;
+ }
+
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive3D-based.
+ Default implementation does nothing
+ */
+ virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
+
+ public:
+ explicit BaseProcessor3D(const geometry::ViewInformation3D& rViewInformation);
+ virtual ~BaseProcessor3D();
+
+ // the central processing method
+ virtual void process(const primitive3d::Primitive3DSequence& rSource);
+
+ // data access
+ const geometry::ViewInformation3D& getViewInformation3D() const { return maViewInformation3D; }
+ };
+ } // end of namespace processor3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_DRAWINGLAYER_PROCESSOR3D_BASEPROCESSOR3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor3d/cutfindprocessor3d.hxx b/include/drawinglayer/processor3d/cutfindprocessor3d.hxx
new file mode 100644
index 000000000000..2b4714ca3054
--- /dev/null
+++ b/include/drawinglayer/processor3d/cutfindprocessor3d.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_DRAWINGLAYER_PROCESSOR3D_CUTFINDPROCESSOR3D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR3D_CUTFINDPROCESSOR3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor3d/defaultprocessor3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor3d
+ {
+ /** CutFindProcessor class
+
+ This processor extracts all cuts of 3D plane geometries in the feeded primitives
+ with the given cut vector, based on the ViewInformation3D given.
+ */
+ class DRAWINGLAYER_DLLPUBLIC CutFindProcessor : public BaseProcessor3D
+ {
+ private:
+ /// the start and stop point for the cut vector
+ basegfx::B3DPoint maFront;
+ basegfx::B3DPoint maBack;
+
+ /// the found cut points
+ ::std::vector< basegfx::B3DPoint > maResult;
+
+ /* #i102956# the transformation change from TransformPrimitive3D processings
+ needs to be remembered to be able to transform found cuts to the
+ basic coordinate system the processor starts with
+ */
+ basegfx::B3DHomMatrix maCombinedTransform;
+
+ /// bitfield
+ bool mbAnyHit : 1;
+
+ /* this flag decides if primitives which are invisible will be taken into account for
+ HitTesting or not.
+ */
+ bool mbUseInvisiblePrimitiveContent : 1;
+
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive3D-based.
+ */
+ virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
+
+ public:
+ CutFindProcessor(const geometry::ViewInformation3D& rViewInformation,
+ const basegfx::B3DPoint& rFront,
+ const basegfx::B3DPoint& rBack,
+ bool bAnyHit);
+
+ /// data write access
+ void setUseInvisiblePrimitiveContent(bool bNew)
+ {
+ if((bool)mbUseInvisiblePrimitiveContent != bNew) mbUseInvisiblePrimitiveContent = bNew;
+ }
+
+ /// data read access
+ const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return maResult; }
+ bool getAnyHit() const { return mbAnyHit; }
+ bool getUseInvisiblePrimitiveContent() const { return mbUseInvisiblePrimitiveContent;}
+ };
+ } // end of namespace processor3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PROCESSOR3D_CUTFINDPROCESSOR3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor3d/defaultprocessor3d.hxx b/include/drawinglayer/processor3d/defaultprocessor3d.hxx
new file mode 100644
index 000000000000..010fba3b1f1d
--- /dev/null
+++ b/include/drawinglayer/processor3d/defaultprocessor3d.hxx
@@ -0,0 +1,158 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_DEFAULTPROCESSOR3D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR3D_DEFAULTPROCESSOR3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor3d/baseprocessor3d.hxx>
+#include <basegfx/matrix/b3dhommatrix.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/color/bcolormodifier.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
+#include <boost/shared_ptr.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BZPixelRaster;
+ class B3DPolygon;
+ class B3DPolyPolygon;
+}
+
+namespace drawinglayer { namespace attribute {
+ class SdrSceneAttribute;
+ class SdrLightingAttribute;
+ class MaterialAttribute3D;
+}}
+
+namespace drawinglayer { namespace primitive3d {
+ class PolygonHairlinePrimitive3D;
+ class PolyPolygonMaterialPrimitive3D;
+ class GradientTexturePrimitive3D;
+ class HatchTexturePrimitive3D;
+ class BitmapTexturePrimitive3D;
+ class TransformPrimitive3D;
+ class ModifiedColorPrimitive3D;
+}}
+
+namespace drawinglayer { namespace texture {
+ class GeoTexSvx;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor3d
+ {
+ /** DefaultProcessor3D class
+
+ This processor renders all feeded primitives to a 2D raster where for all
+ primitives the two basic methods rasterconvertB3DPolygon for hairlines and
+ rasterconvertB3DPolyPolygon for filled geometry is called. It is a beseclass to
+ e.g. base a Z-Buffer supported renderer on the 3D primitive processing.
+ */
+ class DRAWINGLAYER_DLLPUBLIC DefaultProcessor3D : public BaseProcessor3D
+ {
+ protected:
+ /// read-only scene infos (normal handling, etc...)
+ const attribute::SdrSceneAttribute& mrSdrSceneAttribute;
+
+ /// read-only light infos (lights, etc...)
+ const attribute::SdrLightingAttribute& mrSdrLightingAttribute;
+
+ /// renderer range. Need to be correctly set by the derived implementations
+ /// normally the (0, 0, W, H) range from mpBZPixelRaster
+ basegfx::B2DRange maRasterRange;
+
+ /// the modifiedColorPrimitive stack
+ basegfx::BColorModifierStack maBColorModifierStack;
+
+ /// the current active texture
+ boost::shared_ptr< texture::GeoTexSvx > mpGeoTexSvx;
+
+ /// the current active transparence texture
+ boost::shared_ptr< texture::GeoTexSvx > mpTransparenceGeoTexSvx;
+
+ /// SvtOptionsDrawinglayer incarnation to react on diverse settings
+ const SvtOptionsDrawinglayer maDrawinglayerOpt;
+
+ /// counter for entered transparence textures
+ sal_uInt32 mnTransparenceCounter;
+
+ /// bitfield
+ unsigned mbModulate : 1;
+ unsigned mbFilter : 1;
+ unsigned mbSimpleTextureActive : 1;
+
+ //////////////////////////////////////////////////////////////////////////////
+ // rendering support
+
+ void impRenderGradientTexturePrimitive3D(const primitive3d::GradientTexturePrimitive3D& rPrimitive, bool bTransparence);
+ void impRenderHatchTexturePrimitive3D(const primitive3d::HatchTexturePrimitive3D& rPrimitive);
+ void impRenderBitmapTexturePrimitive3D(const primitive3d::BitmapTexturePrimitive3D& rPrimitive);
+ void impRenderModifiedColorPrimitive3D(const primitive3d::ModifiedColorPrimitive3D& rModifiedCandidate);
+ void impRenderPolygonHairlinePrimitive3D(const primitive3d::PolygonHairlinePrimitive3D& rPrimitive);
+ void impRenderPolyPolygonMaterialPrimitive3D(const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive);
+ void impRenderTransformPrimitive3D(const primitive3d::TransformPrimitive3D& rTransformCandidate);
+
+ //////////////////////////////////////////////////////////////////////////////
+ // rasterconversions for filled and non-filled polygons. These NEED to be
+ // implemented from derivations
+
+ virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const = 0;
+ virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolyPolygon& rFill) const = 0;
+
+ // the processing method for a single, known primitive
+ virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rBasePrimitive);
+
+ public:
+ DefaultProcessor3D(
+ const geometry::ViewInformation3D& rViewInformation,
+ const attribute::SdrSceneAttribute& rSdrSceneAttribute,
+ const attribute::SdrLightingAttribute& rSdrLightingAttribute);
+ virtual ~DefaultProcessor3D();
+
+ /// data read access
+ const attribute::SdrSceneAttribute& getSdrSceneAttribute() const { return mrSdrSceneAttribute; }
+ const attribute::SdrLightingAttribute& getSdrLightingAttribute() const { return mrSdrLightingAttribute; }
+
+ /// data read access renderer stuff
+ const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; }
+ const boost::shared_ptr< texture::GeoTexSvx >& getGeoTexSvx() const { return mpGeoTexSvx; }
+ const boost::shared_ptr< texture::GeoTexSvx >& getTransparenceGeoTexSvx() const { return mpTransparenceGeoTexSvx; }
+ sal_uInt32 getTransparenceCounter() const { return mnTransparenceCounter; }
+ bool getModulate() const { return mbModulate; }
+ bool getFilter() const { return mbFilter; }
+ bool getSimpleTextureActive() const { return mbSimpleTextureActive; }
+
+ /// access to Drawinglayer configuration options
+ const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
+ };
+ } // end of namespace processor3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR3D_DEFAULTPROCESSOR3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor3d/geometry2dextractor.hxx b/include/drawinglayer/processor3d/geometry2dextractor.hxx
new file mode 100644
index 000000000000..d85e6843f54d
--- /dev/null
+++ b/include/drawinglayer/processor3d/geometry2dextractor.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_DRAWINGLAYER_PROCESSOR3D_GEOMETRY2DEXTRACTOR_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR3D_GEOMETRY2DEXTRACTOR_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor3d/baseprocessor3d.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b3dhommatrix.hxx>
+#include <basegfx/color/bcolormodifier.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor3d
+ {
+ /** Geometry2DExtractingProcessor class
+
+ This processor extracts the 2D geometry (projected geometry) of all feeded primitives.
+ It is e.g. used as sub-processor for contour extraction where 3D geometry is only
+ useful as 2D projected geometry.
+ */
+ class DRAWINGLAYER_DLLPUBLIC Geometry2DExtractingProcessor : public BaseProcessor3D
+ {
+ private:
+ /// result holding vector (2D)
+ primitive2d::Primitive2DSequence maPrimitive2DSequence;
+
+ /// object transformation for scene for 2d definition
+ basegfx::B2DHomMatrix maObjectTransformation;
+
+ /// the modifiedColorPrimitive stack
+ basegfx::BColorModifierStack maBColorModifierStack;
+
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive3D-based.
+ */
+ virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
+
+ public:
+ Geometry2DExtractingProcessor(
+ const geometry::ViewInformation3D& rViewInformation,
+ const basegfx::B2DHomMatrix& rObjectTransformation);
+
+ // data read access
+ const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+ const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; }
+ };
+ } // end of namespace processor3d
+} // end of namespace drawinglayer
+
+#endif //INCLUDED_DRAWINGLAYER_PROCESSOR3D_GEOMETRY2DEXTRACTOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor3d/shadow3dextractor.hxx b/include/drawinglayer/processor3d/shadow3dextractor.hxx
new file mode 100644
index 000000000000..183d61271c83
--- /dev/null
+++ b/include/drawinglayer/processor3d/shadow3dextractor.hxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_SHADOW3DEXTRACTOR_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR3D_SHADOW3DEXTRACTOR_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor3d/baseprocessor3d.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b3dhommatrix.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b3dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b3dpolypolygon.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor3d
+ {
+ /** Shadow3DExtractingProcessor class
+
+ This processor extracts the 2D shadow geometry (projected geometry) of all feeded primitives.
+ It is used to create the shadow of 3D objects which consists of 2D geometry. It needs quite
+ some data to do so since we do not only offer flat projected 2D shadow, but also projections
+ dependent on the light source
+ */
+ class DRAWINGLAYER_DLLPUBLIC Shadow3DExtractingProcessor : public BaseProcessor3D
+ {
+ private:
+ /// result holding vector (2D) and target vector for stacking (inited to &maPrimitive2DSequence)
+ primitive2d::Primitive2DVector maPrimitive2DSequence;
+ primitive2d::Primitive2DVector* mpPrimitive2DSequence;
+
+ /// object transformation for scene for 2d definition
+ basegfx::B2DHomMatrix maObjectTransformation;
+
+ /// prepared data (transformations) for 2D/3D shadow calculations
+ basegfx::B3DHomMatrix maWorldToEye;
+ basegfx::B3DHomMatrix maEyeToView;
+ basegfx::B3DVector maLightNormal;
+ basegfx::B3DVector maShadowPlaneNormal;
+ basegfx::B3DPoint maPlanePoint;
+ double mfLightPlaneScalar;
+
+ /* the shadow color used for sub-primitives. Can stay at black since
+ the encapsulating 2d shadow primitive will contain the color
+ */
+ basegfx::BColor maPrimitiveColor;
+
+ /// bitfield
+ /// flag if shadow plane projection preparation leaded to valid results
+ unsigned mbShadowProjectionIsValid : 1;
+
+ /// flag if conversion is switched on
+ unsigned mbConvert : 1;
+
+ /// flag if conversion shall use projection
+ unsigned mbUseProjection : 1;
+
+ /// local helpers
+ basegfx::B2DPolygon impDoShadowProjection(const basegfx::B3DPolygon& rSource);
+ basegfx::B2DPolyPolygon impDoShadowProjection(const basegfx::B3DPolyPolygon& rSource);
+
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive3D-based.
+ */
+ virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
+
+ public:
+ Shadow3DExtractingProcessor(
+ const geometry::ViewInformation3D& rViewInformation,
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ const basegfx::B3DVector& rLightNormal,
+ double fShadowSlant,
+ const basegfx::B3DRange& rContained3DRange);
+ virtual ~Shadow3DExtractingProcessor();
+
+ /// data read access
+ const primitive2d::Primitive2DSequence getPrimitive2DSequence() const;
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+ const basegfx::B3DHomMatrix& getWorldToEye() const { return maWorldToEye; }
+ const basegfx::B3DHomMatrix& getEyeToView() const { return maEyeToView; }
+ };
+ } // end of namespace processor3d
+} // end of namespace drawinglayer
+
+#endif //_DRAWINGLAYER_PROCESSOR3D_SHADOW3DEXTRACTOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/processor3d/zbufferprocessor3d.hxx b/include/drawinglayer/processor3d/zbufferprocessor3d.hxx
new file mode 100644
index 000000000000..8570809b465d
--- /dev/null
+++ b/include/drawinglayer/processor3d/zbufferprocessor3d.hxx
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_ZBUFFERPROCESSOR3D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR3D_ZBUFFERPROCESSOR3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/processor3d/defaultprocessor3d.hxx>
+#include <vcl/bitmapex.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BZPixelRaster;
+}
+
+namespace drawinglayer {
+ namespace attribute {
+ class SdrSceneAttribute;
+ class SdrLightingAttribute;
+ class MaterialAttribute3D;
+ }
+ namespace geometry {
+ class ViewInformation2D;
+ }
+}
+
+class ZBufferRasterConverter3D;
+class RasterPrimitive3D;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor3d
+ {
+ /** ZBufferProcessor3D class
+
+ This 3D renderer derived from DefaultProcessor3D renders all feeded primitives to a 2D
+ raster bitmap using a Z-Buffer based approach. It is able to supersample and to handle
+ transparent content.
+ */
+ class DRAWINGLAYER_DLLPUBLIC ZBufferProcessor3D : public DefaultProcessor3D
+ {
+ private:
+ /// the raster target, a Z-Buffer
+ basegfx::BZPixelRaster* mpBZPixelRaster;
+
+ /// inverse of EyeToView for rasterconversion with evtl. Phong shading
+ basegfx::B3DHomMatrix maInvEyeToView;
+
+ /// The raster converter for Z-Buffer
+ ZBufferRasterConverter3D* mpZBufferRasterConverter3D;
+
+ /* AA value. Defines how many oversámples will be used in X and Y. Values 0, 1
+ will switch it off while e.g. 2 will use 2x2 pixels for each pixel to create
+ */
+ sal_uInt16 mnAntiAlialize;
+
+ /* remembered RasterPrimitive3D's which need to be painted back to front
+ for transparent 3D parts
+ */
+ std::vector< RasterPrimitive3D >* mpRasterPrimitive3Ds;
+
+ //////////////////////////////////////////////////////////////////////////////
+ // rasterconversions for filled and non-filled polygons
+
+ virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const;
+ virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolyPolygon& rFill) const;
+
+ public:
+ ZBufferProcessor3D(
+ const geometry::ViewInformation3D& rViewInformation3D,
+ const geometry::ViewInformation2D& rViewInformation2D,
+ const attribute::SdrSceneAttribute& rSdrSceneAttribute,
+ const attribute::SdrLightingAttribute& rSdrLightingAttribute,
+ double fSizeX,
+ double fSizeY,
+ const basegfx::B2DRange& rVisiblePart,
+ sal_uInt16 nAntiAlialize);
+ virtual ~ZBufferProcessor3D();
+
+ void finish();
+
+ /// get the result as bitmapEx
+ BitmapEx getBitmapEx() const;
+ };
+ } // end of namespace processor3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PROCESSOR3D_ZBUFFERPROCESSOR3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/texture/texture.hxx b/include/drawinglayer/texture/texture.hxx
new file mode 100644
index 000000000000..5d1751d70889
--- /dev/null
+++ b/include/drawinglayer/texture/texture.hxx
@@ -0,0 +1,260 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE_HXX
+#define INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/tools/gradienttools.hxx>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvx
+ {
+ public:
+ GeoTexSvx();
+ virtual ~GeoTexSvx();
+
+ // compare operator
+ virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const;
+ bool operator!=(const GeoTexSvx& rGeoTexSvx) const { return !operator==(rGeoTexSvx); }
+
+ // virtual base methods
+ virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
+ virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
+ virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradient : public GeoTexSvx
+ {
+ protected:
+ basegfx::ODFGradientInfo maGradientInfo;
+ basegfx::B2DRange maTargetRange;
+ basegfx::BColor maStart;
+ basegfx::BColor maEnd;
+ double mfBorder;
+
+ // helpers
+ void impAppendMatrix(::std::vector< basegfx::B2DHomMatrix >& rMatrices, const basegfx::B2DRange& rRange);
+ void impAppendColorsRadial(::std::vector< basegfx::BColor >& rColors);
+
+ public:
+ GeoTexSvxGradient(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder);
+ virtual ~GeoTexSvxGradient();
+
+ // compare operator
+ virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const;
+
+ // virtual base methods
+ virtual void appendColors(::std::vector< basegfx::BColor >& rColors) = 0;
+
+ // data access
+ const basegfx::BColor& getStart() const { return maStart; }
+ const basegfx::BColor& getEnd() const { return maEnd; }
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientLinear : public GeoTexSvxGradient
+ {
+ public:
+ GeoTexSvxGradientLinear(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fAngle);
+ virtual ~GeoTexSvxGradientLinear();
+
+ virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
+ virtual void appendColors(::std::vector< basegfx::BColor >& rColors);
+ virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientAxial : public GeoTexSvxGradient
+ {
+ public:
+ GeoTexSvxGradientAxial(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fAngle);
+ virtual ~GeoTexSvxGradientAxial();
+
+ virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
+ virtual void appendColors(::std::vector< basegfx::BColor >& rColors);
+ virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientRadial : public GeoTexSvxGradient
+ {
+ public:
+ GeoTexSvxGradientRadial(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY);
+ virtual ~GeoTexSvxGradientRadial();
+
+ virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
+ virtual void appendColors(::std::vector< basegfx::BColor >& rColors);
+ virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientElliptical : public GeoTexSvxGradient
+ {
+ public:
+ GeoTexSvxGradientElliptical(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY, double fAngle);
+ virtual ~GeoTexSvxGradientElliptical();
+
+ virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
+ virtual void appendColors(::std::vector< basegfx::BColor >& rColors);
+ virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientSquare : public GeoTexSvxGradient
+ {
+ public:
+ GeoTexSvxGradientSquare(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY, double fAngle);
+ virtual ~GeoTexSvxGradientSquare();
+
+ virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
+ virtual void appendColors(::std::vector< basegfx::BColor >& rColors);
+ virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientRect : public GeoTexSvxGradient
+ {
+ public:
+ GeoTexSvxGradientRect(const basegfx::B2DRange& rTargetRange, const basegfx::BColor& rStart, const basegfx::BColor& rEnd, sal_uInt32 nSteps, double fBorder, double fOffsetX, double fOffsetY, double fAngle);
+ virtual ~GeoTexSvxGradientRect();
+
+ virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
+ virtual void appendColors(::std::vector< basegfx::BColor >& rColors);
+ virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxHatch : public GeoTexSvx
+ {
+ protected:
+ basegfx::B2DHomMatrix maTextureTransform;
+ basegfx::B2DHomMatrix maBackTextureTransform;
+ double mfDistance;
+ double mfAngle;
+ sal_uInt32 mnSteps;
+
+ public:
+ GeoTexSvxHatch(const basegfx::B2DRange& rTargetRange, double fDistance, double fAngle);
+ virtual ~GeoTexSvxHatch();
+
+ // compare operator
+ virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const;
+
+ virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
+ double getDistanceToHatch(const basegfx::B2DPoint& rUV) const;
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxTiled : public GeoTexSvx
+ {
+ protected:
+ basegfx::B2DPoint maTopLeft;
+ basegfx::B2DVector maSize;
+
+ public:
+ GeoTexSvxTiled(const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize);
+ virtual ~GeoTexSvxTiled();
+
+ // compare operator
+ virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const;
+
+ virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_DRAWINGLAYER_TEXTURE_TEXTURE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/texture/texture3d.hxx b/include/drawinglayer/texture/texture3d.hxx
new file mode 100644
index 000000000000..713cea76c928
--- /dev/null
+++ b/include/drawinglayer/texture/texture3d.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_DRAWINGLAYER_TEXTURE_TEXTURE3D_HXX
+#define INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE3D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+
+#include <drawinglayer/texture/texture.hxx>
+#include <vcl/bitmap.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace drawinglayer { namespace primitive3d {
+ class HatchTexturePrimitive3D;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxMono : public GeoTexSvx
+ {
+ protected:
+ basegfx::BColor maSingleColor;
+ double mfOpacity;
+
+ public:
+ GeoTexSvxMono(const basegfx::BColor& rSingleColor, double fOpacity);
+
+ // compare operator
+ virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const;
+ virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
+ virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxBitmap : public GeoTexSvx
+ {
+ protected:
+ Bitmap maBitmap;
+ BitmapReadAccess* mpRead;
+ basegfx::B2DPoint maTopLeft;
+ basegfx::B2DVector maSize;
+ double mfMulX;
+ double mfMulY;
+
+ // helpers
+ bool impIsValid(const basegfx::B2DPoint& rUV, sal_Int32& rX, sal_Int32& rY) const;
+
+ public:
+ GeoTexSvxBitmap(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize);
+ virtual ~GeoTexSvxBitmap();
+ virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
+ virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxBitmapTiled : public GeoTexSvxBitmap
+ {
+ protected:
+ // helpers
+ basegfx::B2DPoint impGetCorrected(const basegfx::B2DPoint& rUV) const
+ {
+ double fX(fmod(rUV.getX() - maTopLeft.getX(), maSize.getX()));
+ double fY(fmod(rUV.getY() - maTopLeft.getY(), maSize.getY()));
+
+ if(fX < 0.0)
+ {
+ fX += maSize.getX();
+ }
+
+ if(fY < 0.0)
+ {
+ fY += maSize.getY();
+ }
+
+ return basegfx::B2DPoint(fX + maTopLeft.getX(), fY + maTopLeft.getY());
+ }
+
+ public:
+ GeoTexSvxBitmapTiled(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize);
+ virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
+ virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace texture
+ {
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxMultiHatch : public GeoTexSvx
+ {
+ protected:
+ basegfx::BColor maColor;
+ double mfLogicPixelSize;
+ GeoTexSvxHatch* mp0;
+ GeoTexSvxHatch* mp1;
+ GeoTexSvxHatch* mp2;
+
+ // bitfield
+ unsigned mbFillBackground : 1;
+
+ // helpers
+ bool impIsOnHatch(const basegfx::B2DPoint& rUV) const;
+
+ public:
+ GeoTexSvxMultiHatch(const primitive3d::HatchTexturePrimitive3D& rPrimitive, double fLogicPixelSize);
+ virtual ~GeoTexSvxMultiHatch();
+ virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
+ virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
+
+ // dada access
+ bool getFillBackground() const { return mbFillBackground; }
+ };
+ } // end of namespace texture
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/tools/converters.hxx b/include/drawinglayer/tools/converters.hxx
new file mode 100644
index 000000000000..5bc9ddbb18e4
--- /dev/null
+++ b/include/drawinglayer/tools/converters.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_DRAWINGLAYER_TOOLS_CONVERTERS_HXX
+#define INCLUDED_DRAWINGLAYER_TOOLS_CONVERTERS_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <vcl/bitmapex.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace tools
+ {
+ BitmapEx DRAWINGLAYER_DLLPUBLIC convertToBitmapEx(
+ const drawinglayer::primitive2d::Primitive2DSequence& rSeq,
+ const geometry::ViewInformation2D& rViewInformation2D,
+ sal_uInt32 nDiscreteWidth,
+ sal_uInt32 nDiscreteHeight,
+ sal_uInt32 nMaxQuadratPixels);
+
+ } // end of namespace tools
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_TOOLS_CONVERTERS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/AccessibleComponentBase.hxx b/include/editeng/AccessibleComponentBase.hxx
new file mode 100644
index 000000000000..ea292e0e439c
--- /dev/null
+++ b/include/editeng/AccessibleComponentBase.hxx
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_EXTENDED_COMPONENT_BASE_HXX
+#define _SVX_ACCESSIBILITY_ACCESSIBLE_EXTENDED_COMPONENT_BASE_HXX
+
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
+#include <com/sun/star/awt/XFocusListener.hpp>
+#include "editeng/editengdllapi.h"
+
+namespace accessibility {
+
+/** @descr
+ This base class provides (will provice) a base implementation of the
+ <type>XAccessibleComponent</type> and the
+ <type>XAccessibleExtendedComponent</type> for all shapes. For
+ more detailed documentation about the methods refer to the interface
+ descriptions of <type>XAccessible</type>,
+ <type>XAccessibleContext</type>, <type>XInterface</type>,
+ <type>XServiceInfo</type>, and <type>XTypeProvider</type>.
+*/
+class EDITENG_DLLPUBLIC AccessibleComponentBase
+ : public ::com::sun::star::accessibility::XAccessibleExtendedComponent
+{
+public:
+ //===== internal ========================================================
+ AccessibleComponentBase (void);
+ virtual ~AccessibleComponentBase (void);
+
+
+ //===== XAccessibleComponent ================================================
+
+ /** The default implementation uses the result of
+ <member>getBounds</member> to determine whether the given point lies
+ inside this object.
+ */
+ virtual sal_Bool SAL_CALL containsPoint (
+ const ::com::sun::star::awt::Point& aPoint)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** The default implementation returns an empty reference.
+ */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > SAL_CALL
+ getAccessibleAtPoint (
+ const ::com::sun::star::awt::Point& aPoint)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** The default implementation returns an empty rectangle.
+ */
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** The default implementation uses the result of
+ <member>getBounds</member> to determine the location.
+ */
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocation (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** The default implementation returns an empty position, i.e. the
+ * result of the default constructor of <type>com::sun::star::awt::Point</type>.
+ */
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** The default implementation uses the result of
+ <member>getBounds</member> to determine the size.
+ */
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** The default implementation ignores this call.
+ */
+ virtual void SAL_CALL addFocusListener (
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::awt::XFocusListener >& xListener)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** The default implementation ignores this call.
+ */
+ virtual void SAL_CALL removeFocusListener (const ::com::sun::star::uno::Reference<
+ ::com::sun::star::awt::XFocusListener >& xListener )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** The default implementation does nothing.
+ */
+ virtual void SAL_CALL grabFocus (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Returns black as the default foreground color.
+ */
+ virtual sal_Int32 SAL_CALL getForeground (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Returns white as the default background color.
+ */
+ virtual sal_Int32 SAL_CALL getBackground (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== XAccessibleExtendedComponent ====================================
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL
+ getFont (void)
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getTitledBorderText (void)
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getToolTipText (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+
+ //===== XTypeProvider ===================================================
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL
+ getTypes (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+};
+
+} // end of namespace accessibility
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/AccessibleContextBase.hxx b/include/editeng/AccessibleContextBase.hxx
new file mode 100644
index 000000000000..574582a68ae1
--- /dev/null
+++ b/include/editeng/AccessibleContextBase.hxx
@@ -0,0 +1,388 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_CONTEXT_BASE_HXX
+#define _SVX_ACCESSIBILITY_ACCESSIBLE_CONTEXT_BASE_HXX
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+#include <com/sun/star/accessibility/XAccessibleStateSet.hpp>
+#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
+#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <cppuhelper/weak.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <osl/mutex.hxx>
+#include <cppuhelper/compbase4.hxx>
+#include <editeng/editengdllapi.h>
+
+
+namespace accessibility {
+
+struct MutexOwner {mutable ::osl::Mutex maMutex;};
+
+/** @descr
+ This base class provides an implementation of the
+ <type>AccessibleContext</type> service. Appart from the
+ <type>XXAccessible<type> and <type>XAccessibleContextContext</type>
+ interfaces it supports the <type>XServiceInfo</type> interface.
+*/
+class EDITENG_DLLPUBLIC AccessibleContextBase
+ : public MutexOwner,
+ public cppu::PartialWeakComponentImplHelper4<
+ ::com::sun::star::accessibility::XAccessible,
+ ::com::sun::star::accessibility::XAccessibleContext,
+ ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
+ ::com::sun::star::lang::XServiceInfo
+ >
+{
+public:
+
+ //===== internal ========================================================
+
+ /** The origin of the accessible name or description.
+ */
+ enum StringOrigin {
+ ManuallySet,
+ FromShape,
+ AutomaticallyCreated,
+ NotSet
+ };
+
+ AccessibleContextBase (
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible>& rxParent,
+ const sal_Int16 aRole);
+ virtual ~AccessibleContextBase (void);
+
+
+ /** Call all accessiblity event listeners to inform them about the
+ specified event.
+ @param aEventId
+ Id of the event type.
+ @param rNewValue
+ New value of the modified attribute. Pass empty structure if
+ not applicable.
+ @param rOldValue
+ Old value of the modified attribute. Pass empty structure if
+ not applicable.
+ */
+ void CommitChange (sal_Int16 aEventId,
+ const ::com::sun::star::uno::Any& rNewValue,
+ const ::com::sun::star::uno::Any& rOldValue);
+
+ /** Set a new description and, provided that the new name differs from
+ the old one, broadcast an accessibility event.
+ @param rsDescription
+ The new description.
+ @param eDescriptionOrigin
+ The origin of the description. This is used to determine
+ whether the given description overrules the existing one. An
+ origin with a lower numerical value overrides one with a higher
+ value.
+ */
+ void SetAccessibleDescription (
+ const OUString& rsDescription,
+ StringOrigin eDescriptionOrigin)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Set a new description and, provided that the new name differs from
+ the old one, broadcast an accessibility event.
+ @param rsName
+ The new name.
+ @param eNameOrigin
+ The origin of the name. This is used to determine whether the
+ given name overrules the existing one. An origin with a lower
+ numerical value overrides one with a higher value.
+ */
+ void SetAccessibleName (
+ const OUString& rsName,
+ StringOrigin eNameOrigin)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Set the specified state (turn it on) and send events to all
+ listeners to inform them of the change.
+
+ @param aState
+ The state to turn on.
+
+ @return
+ If the specified state changed its value due to this call
+ <TRUE/> is returned, otherwise <FALSE/>.
+ */
+ virtual sal_Bool SetState (sal_Int16 aState);
+
+ /** Reset the specified state (turn it off) and send events to all
+ listeners to inform them of the change.
+
+ @param aState
+ The state to turn off.
+
+ @return
+ If the specified state changed its value due to this call
+ <TRUE/> is returned, otherwise <FALSE/>.
+ */
+ virtual sal_Bool ResetState (sal_Int16 aState);
+
+ /** Return the state of the specified state.
+
+ @param aState
+ The state for which to return its value.
+
+ @return
+ A value of <TRUE/> indicates that the state is set. A <FALSE/>
+ value indicates an unset state.
+ */
+ sal_Bool GetState (sal_Int16 aState);
+
+ /** Replace the current relation set with the specified one. Send
+ events for relations that are not in both sets.
+
+ @param rRelationSet
+ The new relation set that replaces the old one.
+ */
+ virtual void SetRelationSet (
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleRelationSet>& rxRelationSet)
+ throw (::com::sun::star::uno::RuntimeException);
+
+
+ //===== XAccessible =====================================================
+
+ /// Return the XAccessibleContext.
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL
+ getAccessibleContext (void) throw (::com::sun::star::uno::RuntimeException);
+
+
+ //===== XAccessibleContext ==============================================
+
+ /// Return the number of currently visible children.
+ virtual sal_Int32 SAL_CALL
+ getAccessibleChildCount (void) throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return the specified child or throw exception.
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
+ getAccessibleChild (sal_Int32 nIndex)
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ /// Return a reference to the parent.
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
+ getAccessibleParent (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return this objects index among the parents children.
+ virtual sal_Int32 SAL_CALL
+ getAccessibleIndexInParent (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return this object's role.
+ virtual sal_Int16 SAL_CALL
+ getAccessibleRole (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return this object's description.
+ virtual OUString SAL_CALL
+ getAccessibleDescription (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return the object's current name.
+ virtual OUString SAL_CALL
+ getAccessibleName (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return NULL to indicate that an empty relation set.
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
+ getAccessibleRelationSet (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return the set of current states.
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
+ getAccessibleStateSet (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Return the parents locale or throw exception if this object has no
+ parent yet/anymore.
+ */
+ virtual ::com::sun::star::lang::Locale SAL_CALL
+ getLocale (void)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::accessibility::IllegalAccessibleComponentStateException);
+
+ //===== XAccessibleEventBroadcaster ========================================
+
+ virtual void SAL_CALL
+ addAccessibleEventListener (
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleEventListener >& xListener)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL
+ removeAccessibleEventListener (
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleEventListener >& xListener)
+ throw (::com::sun::star::uno::RuntimeException);
+
+
+ //===== XServiceInfo ====================================================
+
+ /** Returns an identifier for the implementation of this object.
+ */
+ virtual OUString SAL_CALL
+ getImplementationName (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Return whether the specified service is supported by this class.
+ */
+ virtual sal_Bool SAL_CALL
+ supportsService (const OUString& sServiceName)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Returns a list of all supported services. In this case that is just
+ the AccessibleContext service.
+ */
+ virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL
+ getSupportedServiceNames (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+
+ //===== XTypeProvider ===================================================
+
+ /** Returns a sequence of all supported interfaces.
+ */
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL
+ getTypes (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Returns a implementation id.
+ */
+ virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
+ getImplementationId (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ /** The state set.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleStateSet> mxStateSet;
+
+ /** The relation set. Relations can be set or removed by calling the
+ <member>AddRelation</member> and <member>RemoveRelation</member> methods.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleRelationSet> mxRelationSet;
+
+ // This method is called from the component helper base class while disposing.
+ virtual void SAL_CALL disposing (void);
+
+ /** Create the accessible object's name. This method may be called more
+ than once for a single object.
+ @return
+ The returned string is a unique (among the accessible object's
+ siblings) name.
+ */
+ virtual OUString CreateAccessibleName (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Create the accessible object's descriptive string. May be called
+ more than once.
+ @return
+ Descriptive string. Not necessarily unique.
+ */
+ virtual OUString
+ CreateAccessibleDescription (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ void FireEvent (const ::com::sun::star::accessibility::AccessibleEventObject& aEvent);
+
+ /** Check whether or not the object has been disposed (or is in the
+ state of beeing disposed). If that is the case then
+ DisposedException is thrown to inform the (indirect) caller of the
+ foul deed.
+ */
+ void ThrowIfDisposed (void)
+ throw (::com::sun::star::lang::DisposedException);
+
+ /** Check whether or not the object has been disposed (or is in the
+ state of beeing disposed).
+
+ @return TRUE, if the object is disposed or in the course
+ of being disposed. Otherwise, FALSE is returned.
+ */
+ sal_Bool IsDisposed (void);
+
+ /** sets the role as returned by XaccessibleContext::getAccessibleRole
+
+ <p>Caution: This is only to be used in the construction phase (means within
+ the ctor or late ctor), <em>never</em> when the object is still alive and part
+ of an Accessibility hierarchy.</p>
+ */
+ void SetAccessibleRole( sal_Int16 _nRole );
+
+private:
+ /// Reference to the parent object.
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible> mxParent;
+
+ /** Description of this object. This is not a constant because it can
+ be set from the outside. Furthermore, it changes according the the
+ draw page's display mode.
+ */
+ OUString msDescription;
+
+ /** The origin of the description is used to determine whether new
+ descriptions given to the SetAccessibleDescription is ignored or
+ whether that replaces the old value in msDescription.
+ */
+ StringOrigin meDescriptionOrigin;
+
+ /** Name of this object. It changes according the draw page's
+ display mode.
+ */
+ OUString msName;
+
+ /** The origin of the name is used to determine whether new
+ name given to the SetAccessibleName is ignored or
+ whether that replaces the old value in msName.
+ */
+ StringOrigin meNameOrigin;
+
+ /** client id in the AccessibleEventNotifier queue
+ */
+ sal_uInt32 mnClientId;
+
+ /** This is the role of this object.
+ */
+ sal_Int16 maRole;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/AccessibleEditableTextPara.hxx b/include/editeng/AccessibleEditableTextPara.hxx
new file mode 100644
index 000000000000..5f245d0786f5
--- /dev/null
+++ b/include/editeng/AccessibleEditableTextPara.hxx
@@ -0,0 +1,386 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_ACCESSIBLE_EDITABLE_TEXT_PARA_HXX
+#define _SVX_ACCESSIBLE_EDITABLE_TEXT_PARA_HXX
+
+#include <tools/gen.hxx>
+#include <tools/string.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <cppuhelper/compbase9.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
+#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
+#include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
+#include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp>
+
+#include <comphelper/accessibletexthelper.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include "editeng/AccessibleParaManager.hxx"
+#include "editeng/AccessibleImageBullet.hxx"
+#include "editeng/unoedprx.hxx"
+#include "editeng/editengdllapi.h"
+
+namespace accessibility
+{
+ typedef ::cppu::PartialWeakComponentImplHelper9< ::com::sun::star::accessibility::XAccessible,
+ ::com::sun::star::accessibility::XAccessibleContext,
+ ::com::sun::star::accessibility::XAccessibleComponent,
+ ::com::sun::star::accessibility::XAccessibleEditableText,
+ ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
+ ::com::sun::star::accessibility::XAccessibleTextAttributes,
+ ::com::sun::star::accessibility::XAccessibleHypertext,
+ ::com::sun::star::accessibility::XAccessibleMultiLineText,
+ ::com::sun::star::lang::XServiceInfo > AccessibleTextParaInterfaceBase;
+
+ /** This class implements the actual text paragraphs for the EditEngine/Outliner UAA
+ */
+ class EDITENG_DLLPUBLIC AccessibleEditableTextPara : public ::comphelper::OBaseMutex, public AccessibleTextParaInterfaceBase, public ::comphelper::OCommonAccessibleText
+ {
+
+ protected:
+ // override OCommonAccessibleText methods
+ virtual OUString implGetText();
+ virtual ::com::sun::star::lang::Locale implGetLocale();
+ virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex );
+ virtual void implGetParagraphBoundary( ::com::sun::star::i18n::Boundary& rBoundary, sal_Int32 nIndex );
+ virtual void implGetLineBoundary( ::com::sun::star::i18n::Boundary& rBoundary, sal_Int32 nIndex );
+
+ public:
+ /// Create accessible object for given parent
+ // #i27138#
+ // - add parameter <_pParaManager> (default value NULL)
+ // This has to be the instance of <AccessibleParaManager>, which
+ // created and manages this accessible paragraph.
+ AccessibleEditableTextPara ( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rParent,
+ const AccessibleParaManager* _pParaManager = NULL );
+
+ virtual ~AccessibleEditableTextPara ();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface (const ::com::sun::star::uno::Type & rType) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessible
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleContext
+ virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL getAccessibleRole() throw (::com::sun::star::uno::RuntimeException);
+ /// Maximal length of text returned by getAccessibleDescription()
+ enum { MaxDescriptionLen = 40 };
+ virtual OUString SAL_CALL getAccessibleDescription() throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getAccessibleName() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::lang::Locale SAL_CALL getLocale() throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleEventBroadcaster
+ virtual void SAL_CALL addAccessibleEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeAccessibleEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleComponent
+ virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleText (this comes implicitely inherited by XAccessibleEditableText AND by XAccessibleMultiLineText)
+ virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ /// Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine)
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ /// Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine)
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ /// Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine)
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleEditableText
+ virtual sal_Bool SAL_CALL cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL pasteText( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL deleteText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL insertText( const OUString& sText, sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL replaceText( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const OUString& sReplacement ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL setAttributes( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aAttributeSet ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL setText( const OUString& sText ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleTextAttributes
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getDefaultAttributes( const ::com::sun::star::uno::Sequence< OUString >& RequestedAttributes ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRunAttributes( ::sal_Int32 Index, const ::com::sun::star::uno::Sequence< OUString >& RequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleHypertext
+ virtual ::sal_Int32 SAL_CALL getHyperLinkCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > SAL_CALL getHyperLink( ::sal_Int32 nLinkIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHyperLinkIndex( ::sal_Int32 nCharIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleMultiLineText
+ virtual ::sal_Int32 SAL_CALL getLineNumberAtIndex( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineNumber( ::sal_Int32 nLineNo ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineWithCaret( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getNumberOfLineWithCaret( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName (void) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService (const OUString& sServiceName) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames (void) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceName
+ virtual OUString SAL_CALL getServiceName (void) throw (::com::sun::star::uno::RuntimeException);
+
+ /** Set the current index in the accessibility parent
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ void SetIndexInParent( sal_Int32 nIndex );
+
+ /** Get the current index in the accessibility parent
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ sal_Int32 GetIndexInParent() const;
+
+ /** Set the current paragraph number
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ void SetParagraphIndex( sal_Int32 nIndex );
+
+ /** Query the current paragraph number (0 - nParas-1)
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ sal_Int32 GetParagraphIndex() const SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** Set the edit engine offset
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ void SetEEOffset( const Point& rOffset );
+
+ /** Set the EditEngine offset
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ void SetEditSource( SvxEditSourceAdapter* pEditSource );
+
+ /** Dispose this object
+
+ Notifies and deregisters the listeners, drops all references.
+ */
+ void Dispose();
+
+ /// Calls all Listener objects to tell them the change. Don't hold locks when calling this!
+ virtual void FireEvent(const sal_Int16 nEventId, const ::com::sun::star::uno::Any& rNewValue = ::com::sun::star::uno::Any(), const ::com::sun::star::uno::Any& rOldValue = ::com::sun::star::uno::Any() ) const;
+
+ /// Sets the given state on the internal state set and fires STATE_CHANGE event. Don't hold locks when calling this!
+ void SetState( const sal_Int16 nStateId );
+ /// Unsets the given state on the internal state set and fires STATE_CHANGE event. Don't hold locks when calling this!
+ void UnSetState( const sal_Int16 nStateId );
+
+ static Rectangle LogicToPixel( const Rectangle& rRect, const MapMode& rMapMode, SvxViewForwarder& rForwarder );
+
+ SvxEditSourceAdapter& GetEditSource() const SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** Query the SvxTextForwarder for EditEngine access.
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ SvxAccessibleTextAdapter& GetTextForwarder() const SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** Query the SvxViewForwarder for EditEngine access.
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ SvxViewForwarder& GetViewForwarder() const SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** Query whether a GetEditViewForwarder( sal_False ) will return a forwarder
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ sal_Bool HaveEditView() const;
+
+ /** Query the SvxEditViewForwarder for EditEngine access.
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ SvxAccessibleTextEditViewAdapter& GetEditViewForwarder( sal_Bool bCreate = sal_False ) const SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** Send a TEXT_CHANGED event for this paragraph
+
+ This method internally caters for calculating text
+ differences, and sends the appropriate Anys in the
+ Accessibility::TEXT_CHANGED event
+ */
+ void TextChanged();
+
+ private:
+
+ // declared, but not defined
+ AccessibleEditableTextPara( const AccessibleEditableTextPara& );
+ AccessibleEditableTextPara& operator= ( const AccessibleEditableTextPara& );
+
+ /** Calculate character range of similar attributes
+
+ @param nStartIndex
+ Therein, the start of the character range with the same attributes is returned
+
+ @param nEndIndex
+ Therein, the end (exclusively) of the character range with the same attributes is returned
+
+ @param nIndex
+ The character index at where to look for similar character attributes
+
+ @return sal_False, if the method was not able to determine the range
+ */
+ sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nIndex );
+
+ // syntactic sugar for FireEvent
+ void GotPropertyEvent( const ::com::sun::star::uno::Any& rNewValue, const sal_Int16 nEventId ) const;
+ void LostPropertyEvent( const ::com::sun::star::uno::Any& rOldValue, const sal_Int16 nEventId ) const;
+
+ int getNotifierClientId() const;
+
+ /// Do we have children? This is the case for image bullets
+ sal_Bool HaveChildren();
+
+ const Point& GetEEOffset() const;
+
+ // Get text from forwarder
+ String GetTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) SAL_THROW((::com::sun::star::uno::RuntimeException));
+ sal_uInt16 GetTextLen() const SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** Get the current selection of this paragraph
+
+ @return sal_False, if nothing in this paragraph is selected
+ */
+ sal_Bool GetSelection( sal_uInt16& nStartPos, sal_uInt16& nEndPos ) SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** create selection from Accessible selection.
+
+ */
+ ESelection MakeSelection( sal_Int32 nStartEEIndex, sal_Int32 nEndEEIndex );
+ ESelection MakeSelection( sal_Int32 nEEIndex );
+ ESelection MakeCursor( sal_Int32 nEEIndex );
+
+ // check whether index value is within permitted range
+
+ /// Check whether 0<=nIndex<=n-1
+ void CheckIndex( sal_Int32 nIndex ) SAL_THROW((::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException));
+ /// Check whether 0<=nIndex<=n
+ void CheckPosition( sal_Int32 nIndex ) SAL_THROW((::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException));
+ /// Check whether 0<=nStart<=n and 0<=nEnd<=n
+ void CheckRange( sal_Int32 nStart, sal_Int32 nEnd ) SAL_THROW((::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException));
+
+ // the paragraph index in the edit engine (guarded by solar mutex)
+ sal_Int32 mnParagraphIndex;
+
+ // our current index in the parent (guarded by solar mutex)
+ sal_Int32 mnIndexInParent;
+
+ // the current edit source (guarded by solar mutex)
+ SvxEditSourceAdapter* mpEditSource;
+
+ // the possible child (for image bullets, guarded by solar mutex)
+ typedef WeakCppRef < ::com::sun::star::accessibility::XAccessible, AccessibleImageBullet > WeakBullet;
+ WeakBullet maImageBullet;
+
+ // the last string used for an Accessibility::TEXT_CHANGED event (guarded by solar mutex)
+ OUString maLastTextString;
+
+ // the offset of the underlying EditEngine from the shape/cell (guarded by solar mutex)
+ Point maEEOffset;
+
+ // the current state set (updated from SetState/UnSetState and guarded by solar mutex)
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet;
+
+ /// The shape we're the accessible for (unguarded)
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxParent;
+
+ /// Our listeners (guarded by maMutex)
+ int mnNotifierClientId;
+
+ // Text paragraphs should provide FLOWS_TO and FLOWS_FROM relations (#i27138#)
+ // the paragraph manager, which created this instance - is NULL, if
+ // instance isn't created by AccessibleParaManager.
+ // Needed for method <getAccessibleRelationSet()> to retrieve predecessor
+ // paragraph and the successor paragraph.
+ const AccessibleParaManager* mpParaManager;
+ };
+
+} // end of namespace accessibility
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/AccessibleImageBullet.hxx b/include/editeng/AccessibleImageBullet.hxx
new file mode 100644
index 000000000000..9d852962e9e6
--- /dev/null
+++ b/include/editeng/AccessibleImageBullet.hxx
@@ -0,0 +1,219 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_ACCESSIBLE_IMAGE_BULLET_HXX
+#define _SVX_ACCESSIBLE_IMAGE_BULLET_HXX
+
+#include <tools/gen.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <cppuhelper/implbase5.hxx>
+
+#include <cppuhelper/interfacecontainer.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+#include "editeng/AccessibleParaManager.hxx"
+#include <editeng/unoedsrc.hxx>
+
+namespace accessibility
+{
+ typedef ::cppu::WeakImplHelper5< ::com::sun::star::accessibility::XAccessible,
+ ::com::sun::star::accessibility::XAccessibleContext,
+ ::com::sun::star::accessibility::XAccessibleComponent,
+ ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
+ ::com::sun::star::lang::XServiceInfo > AccessibleImageBulletInterfaceBase;
+
+ /** This class implements the image bullets for the EditEngine/Outliner UAA
+ */
+ class AccessibleImageBullet : public AccessibleImageBulletInterfaceBase
+ {
+
+ public:
+ /// Create accessible object for given parent
+ AccessibleImageBullet ( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rParent );
+
+ virtual ~AccessibleImageBullet ();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface (const ::com::sun::star::uno::Type & rType) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessible
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleContext
+ virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL getAccessibleRole() throw (::com::sun::star::uno::RuntimeException);
+ /// Maximal length of text returned by getAccessibleDescription()
+ enum { MaxDescriptionLen = 40 };
+ virtual OUString SAL_CALL getAccessibleDescription() throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getAccessibleName() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::lang::Locale SAL_CALL getLocale() throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleEventBroadcaster
+ virtual void SAL_CALL addAccessibleEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeAccessibleEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleComponent
+ virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName (void) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService (const OUString& sServiceName) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames (void) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceName
+ virtual OUString SAL_CALL getServiceName (void) throw (::com::sun::star::uno::RuntimeException);
+
+ /** Set the current index in the accessibility parent
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ void SetIndexInParent( sal_Int32 nIndex );
+
+ /** Set the edit engine offset
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ void SetEEOffset( const Point& rOffset );
+
+ /** Set the EditEngine offset
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ void SetEditSource( SvxEditSource* pEditSource );
+
+ /** Dispose this object
+
+ Notifies and deregisters the listeners, drops all references.
+ */
+ void Dispose();
+
+ /** Set the current paragraph number
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ void SetParagraphIndex( sal_Int32 nIndex );
+
+ /** Query the current paragraph number (0 - nParas-1)
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ sal_Int32 GetParagraphIndex() const SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /// Calls all Listener objects to tell them the change. Don't hold locks when calling this!
+ virtual void FireEvent(const sal_Int16 nEventId, const ::com::sun::star::uno::Any& rNewValue = ::com::sun::star::uno::Any(), const ::com::sun::star::uno::Any& rOldValue = ::com::sun::star::uno::Any() ) const;
+
+ private:
+
+ // declared, but not defined
+ AccessibleImageBullet( const AccessibleImageBullet& );
+ AccessibleImageBullet& operator= ( const AccessibleImageBullet& );
+
+ // syntactic sugar for FireEvent
+ void GotPropertyEvent( const ::com::sun::star::uno::Any& rNewValue, const sal_Int16 nEventId ) const;
+ void LostPropertyEvent( const ::com::sun::star::uno::Any& rOldValue, const sal_Int16 nEventId ) const;
+
+ // maintain state set and send STATE_CHANGE events
+ void SetState( const sal_Int16 nStateId );
+ void UnSetState( const sal_Int16 nStateId );
+
+ SvxEditSource& GetEditSource() const SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ int getNotifierClientId() const;
+
+ /** Query the SvxTextForwarder for EditEngine access.
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ SvxTextForwarder& GetTextForwarder() const SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** Query the SvxViewForwarder for EditEngine access.
+
+ @attention This method does not lock the SolarMutex,
+ leaving that to the calling code. This is because only
+ there potential deadlock situations can be resolved. Thus,
+ make sure SolarMutex is locked when calling this.
+ */
+ SvxViewForwarder& GetViewForwarder() const SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ const Point& GetEEOffset() const;
+
+ // the paragraph index in the edit engine (guarded by solar mutex)
+ sal_Int32 mnParagraphIndex;
+
+ // our current index in the parent (guarded by solar mutex)
+ sal_Int32 mnIndexInParent;
+
+ // the current edit source (guarded by solar mutex)
+ SvxEditSource* mpEditSource;
+
+ // the offset of the underlying EditEngine from the shape/cell (guarded by solar mutex)
+ Point maEEOffset;
+
+ // the current state set (updated from SetState/UnSetState and guarded by solar mutex)
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet;
+
+ mutable osl::Mutex maMutex;
+
+ /// The shape we're the accessible for (unguarded)
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxParent;
+
+ /// Our listeners (guarded by maMutex)
+ int mnNotifierClientId;
+ };
+
+} // end of namespace accessibility
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/AccessibleParaManager.hxx b/include/editeng/AccessibleParaManager.hxx
new file mode 100644
index 000000000000..90bc3d8a111d
--- /dev/null
+++ b/include/editeng/AccessibleParaManager.hxx
@@ -0,0 +1,334 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_ACCESSIBLE_PARA_MANAGER_HXX
+#define _SVX_ACCESSIBLE_PARA_MANAGER_HXX
+
+#include <vector>
+#include <algorithm>
+#include <functional>
+#include <utility>
+#include <tools/gen.hxx>
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include "editeng/editengdllapi.h"
+
+class SvxEditSourceAdapter;
+
+namespace accessibility
+{
+ class AccessibleEditableTextPara;
+
+ /** Helper class for WeakCppRef
+
+ This class is returned by WeakChild::get() and contains a hard
+ reference and a reference to the c++ object. This combination
+ prevents the c++ object from destruction during usage. Hold
+ this object only as long as absolutely necessary, prevents
+ referenced object from vanishing otherwise
+ */
+ template < class UnoType, class CppType > class HardCppRef
+ {
+ public:
+
+ typedef UnoType UnoInterfaceType;
+ typedef CppType InterfaceType;
+
+ HardCppRef( const ::com::sun::star::uno::WeakReference< UnoInterfaceType >& xRef, InterfaceType* rImpl ) :
+ mxRef( xRef ),
+ mpImpl( rImpl )
+ {
+ }
+
+ /** Query whether the reference is still valid.
+
+ Hands off also from the implementation pointer if this
+ returns sal_False!
+ */
+ sal_Bool is() const { return mxRef.is(); }
+ InterfaceType* operator->() const { return mpImpl; }
+ InterfaceType& operator*() const { return *mpImpl; }
+ ::com::sun::star::uno::Reference< UnoInterfaceType >& getRef() { return mxRef; }
+ const ::com::sun::star::uno::Reference< UnoInterfaceType >& getRef() const { return mxRef; }
+
+ // default copy constructor and assignment will do
+ // HardCppRef( const HardCppRef& );
+ // HardCppRef& operator= ( const HardCppRef& );
+
+ private:
+
+ // the interface, hard reference to prevent object from vanishing
+ ::com::sun::star::uno::Reference< UnoInterfaceType > mxRef;
+
+ // the c++ object, for our internal stuff
+ InterfaceType* mpImpl;
+
+ };
+
+ /** Helper class for weak object references plus implementation
+
+ This class combines a weak reference (to facilitate automatic
+ object disposal if user drops last reference) and hard
+ reference to the c++ class (for fast access and bypassing of
+ the UNO interface)
+ */
+ template < class UnoType, class CppType > class WeakCppRef
+ {
+ public:
+
+ typedef UnoType UnoInterfaceType;
+ typedef CppType InterfaceType;
+ typedef HardCppRef< UnoInterfaceType, InterfaceType > HardRefType;
+
+ WeakCppRef() : maWeakRef(), maUnsafeRef( NULL ) {}
+ WeakCppRef( InterfaceType& rImpl ) :
+ maWeakRef( ::com::sun::star::uno::Reference< UnoInterfaceType >( rImpl, ::com::sun::star::uno::UNO_QUERY ) ),
+ maUnsafeRef( &rImpl )
+ {
+ }
+
+ WeakCppRef( HardRefType& rImpl ) :
+ maWeakRef( rImpl.getRef() ),
+ maUnsafeRef( rImpl.operator->() )
+ {
+ }
+
+ // get object with c++ object and hard reference (which
+ // prevents the c++ object from destruction during use)
+ HardRefType get() const { return HardRefType( maWeakRef, maUnsafeRef ); }
+
+ // default copy constructor and assignment will do
+ // WeakCppRef( const WeakCppRef& );
+ // WeakCppRef& operator= ( const WeakCppRef& );
+
+ private:
+
+ // the interface, hold weakly
+ ::com::sun::star::uno::WeakReference< UnoInterfaceType > maWeakRef;
+
+ // hard ref to c++ class, _only_ valid if maWeakRef.is() is true
+ InterfaceType* maUnsafeRef;
+ };
+
+
+ /** This class manages the paragraphs of an AccessibleTextHelper
+
+ To facilitate automatic deletion of paragraphs no longer used,
+ this class uses the WeakCppRef helper to hold the objects weakly.
+ */
+ class EDITENG_DLLPUBLIC AccessibleParaManager
+ {
+ public:
+ typedef WeakCppRef < ::com::sun::star::accessibility::XAccessible, AccessibleEditableTextPara > WeakPara;
+ typedef ::std::pair< WeakPara, ::com::sun::star::awt::Rectangle > WeakChild;
+ typedef ::std::pair< ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > , ::com::sun::star::awt::Rectangle > Child;
+ typedef ::std::vector< WeakChild > VectorOfChildren;
+ typedef ::std::vector< sal_Int16 > VectorOfStates;
+
+ AccessibleParaManager();
+ ~AccessibleParaManager();
+
+ /** Sets a vector of additional accessible states.
+
+ The states are passed to every created child object
+ (text paragraph). The state values are defined in
+ com::sun::star::accessibility::AccessibleStateType.
+ */
+ void SetAdditionalChildStates( const VectorOfStates& rChildStates );
+
+ /** Set the number of paragraphs
+
+ @param nNumPara
+ The total number of paragraphs the EditEngine currently
+ has (_not_ the number of currently visible children)
+ */
+ void SetNum( sal_Int32 nNumParas );
+
+ /** Get the number of paragraphs currently possible */
+ sal_uInt32 GetNum() const;
+
+ // iterators
+ VectorOfChildren::iterator begin();
+ VectorOfChildren::iterator end();
+ VectorOfChildren::const_iterator begin() const;
+ VectorOfChildren::const_iterator end() const;
+
+ // dealing with single paragraphs (release reference, return reference etc)
+ void Release( sal_uInt32 nPara );
+ /// Set focus to given child
+ void SetFocus( sal_Int32 nChild );
+
+ void FireEvent( sal_uInt32 nPara,
+ const sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue = ::com::sun::star::uno::Any(),
+ const ::com::sun::star::uno::Any& rOldValue = ::com::sun::star::uno::Any() ) const;
+
+ static sal_Bool IsReferencable( WeakPara::HardRefType aChild );
+ sal_Bool IsReferencable( sal_uInt32 nChild ) const;
+ static void ShutdownPara( const WeakChild& rChild );
+
+ Child CreateChild( sal_Int32 nChild,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& xFrontEnd,
+ SvxEditSourceAdapter& rEditSource,
+ sal_uInt32 nParagraphIndex );
+
+ WeakChild GetChild( sal_uInt32 nParagraphIndex ) const;
+
+ // forwarder to all paragraphs
+ /// Make all children active and editable (or off)
+ void SetActive( sal_Bool bActive = sal_True );
+ /// Set state of all children
+ void SetState( const sal_Int16 nStateId );
+ /// Unset state of all children
+ void UnSetState( const sal_Int16 nStateId );
+ /// Set offset to edit engine for all children
+ void SetEEOffset ( const Point& rOffset );
+ /// Dispose all living children
+ void Dispose ();
+
+ // forwarder to given paragraphs
+ //------------------------------------------------------------------------
+ /** Release the given range of paragraphs
+
+ All ranges have the meaning [start,end), similar to STL
+
+ @param nStartPara
+ Index of paragraph to start with releasing
+
+ @param nEndPara
+ Index of first paragraph to stop with releasing
+ */
+ void Release( sal_uInt32 nStartPara, sal_uInt32 nEndPara );
+
+ /** Fire event for the given range of paragraphs
+
+ All ranges have the meaning [start,end), similar to STL
+
+ @param nStartPara
+ Index of paragraph to start with event firing
+
+ @param nEndPara
+ Index of first paragraph to stop with event firing
+ */
+ void FireEvent( sal_uInt32 nStartPara,
+ sal_uInt32 nEndPara,
+ const sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue = ::com::sun::star::uno::Any(),
+ const ::com::sun::star::uno::Any& rOldValue = ::com::sun::star::uno::Any() ) const;
+
+ /** Functor adapter for ForEach template
+
+ Adapts giving functor such that only the paragraph objects
+ are accessed and the fact that our children are held
+ weakly is hidden
+
+ The functor must provide the following method:
+ void operator() ( AccessibleEditablePara& )
+
+ */
+ template < typename Functor > class WeakChildAdapter : public ::std::unary_function< const WeakChild&, void >
+ {
+ public:
+ WeakChildAdapter( Functor& rFunctor ) : mrFunctor(rFunctor) {}
+ void operator()( const WeakChild& rPara )
+ {
+ // retrieve hard reference from weak one
+ WeakPara::HardRefType aHardRef( rPara.first.get() );
+
+ if( aHardRef.is() )
+ mrFunctor( *aHardRef );
+ }
+
+ private:
+ Functor& mrFunctor;
+ };
+
+ /** Adapter for unary member functions
+
+ Since STL's binder don't work with const& arguments (and
+ BOOST's neither, at least on MSVC), have to provide our
+ own adapter for unary member functions.
+
+ Create with pointer to member function of
+ AccessibleEditableTextPara and the corresponding argument.
+ */
+ template < typename Argument > class MemFunAdapter : public ::std::unary_function< const WeakChild&, void >
+ {
+ public:
+ typedef void (::accessibility::AccessibleEditableTextPara::*FunctionPointer)( Argument );
+
+ MemFunAdapter( FunctionPointer aFunPtr, Argument aArg ) : maFunPtr(aFunPtr), maArg(aArg) {}
+ void operator()( const WeakChild& rPara )
+ {
+ // retrieve hard reference from weak one
+ WeakPara::HardRefType aHardRef( rPara.first.get() );
+
+ if( aHardRef.is() )
+ (*aHardRef.*maFunPtr)( maArg );
+ }
+
+ private:
+ FunctionPointer maFunPtr;
+ Argument maArg;
+ };
+
+ /** Generic algorithm on given paragraphs
+
+ Convenience method, that already adapts the given functor with WeakChildAdapter
+ */
+ template < typename Functor > void ForEach( Functor& rFunctor )
+ {
+ ::std::for_each( begin(), end(), WeakChildAdapter< Functor >(rFunctor) );
+ }
+
+ private:
+ /// Set state on given child
+ void SetState( sal_Int32 nChild, const sal_Int16 nStateId );
+ /// Unset state on given child
+ void UnSetState( sal_Int32 nChild, const sal_Int16 nStateId );
+ /// Init child with default state (as stored in previous SetFocus and SetActive calls)
+ void InitChild( AccessibleEditableTextPara& rChild,
+ SvxEditSourceAdapter& rEditSource,
+ sal_Int32 nChild,
+ sal_uInt32 nParagraphIndex ) const;
+
+ // vector the size of the paragraph number of the underlying EditEngine
+ VectorOfChildren maChildren;
+
+ /// Additional states that will be set at every created child object.
+ VectorOfStates maChildStates;
+
+ // cache EE offset for child creation
+ Point maEEOffset;
+
+ // which child currently has the focus (-1 for none)
+ sal_Int32 mnFocusedChild;
+
+ // whether children are active and editable
+ sal_Bool mbActive;
+ };
+
+} // end of namespace accessibility
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/AccessibleSelectionBase.hxx b/include/editeng/AccessibleSelectionBase.hxx
new file mode 100644
index 000000000000..7935d5dd1ae2
--- /dev/null
+++ b/include/editeng/AccessibleSelectionBase.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 _SVX_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX
+#define _SVX_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX
+
+#include <comphelper/accessibleselectionhelper.hxx>
+#include "editeng/editengdllapi.h"
+
+namespace accessibility
+{
+/** @descr
+ This base class provides a base implementation of the
+ <type>XAccessibleSelection</type> interface.
+ The following methods have to be implemented if this
+ class is used:
+
+ <method>implGetMutex</method>,
+ <method>implGetAccessibleContext</method>,
+ <method>implIsSelected</method>,
+ <method>implSelect</method>,
+*/
+ class EDITENG_DLLPUBLIC AccessibleSelectionBase : public ::comphelper::OCommonAccessibleSelection,
+ public ::com::sun::star::accessibility::XAccessibleSelection
+ {
+ protected:
+
+ virtual ::osl::Mutex& implGetMutex() = 0;
+
+ public:
+
+ // XAccessibleSelection - default implementations
+ virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ public:
+
+ AccessibleSelectionBase();
+ virtual ~AccessibleSelectionBase();
+ };
+
+}
+
+#endif // _SVX_ACCESSIBILITY_ACCESSIBLE_SELECTION_BASE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/AccessibleStaticTextBase.hxx b/include/editeng/AccessibleStaticTextBase.hxx
new file mode 100644
index 000000000000..8ca75d7a5766
--- /dev/null
+++ b/include/editeng/AccessibleStaticTextBase.hxx
@@ -0,0 +1,277 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_ACCESSILE_STATIC_TEXT_BASE_HXX_
+#define _SVX_ACCESSILE_STATIC_TEXT_BASE_HXX_
+
+#include <memory>
+#include <tools/gen.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleText.hpp>
+#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
+#include <com/sun/star/accessibility/TextSegment.hpp>
+#include "editeng/editengdllapi.h"
+
+
+class SvxEditSource;
+class SvxEditViewForwarder;
+
+namespace accessibility
+{
+
+ class AccessibleStaticTextBase_Impl;
+
+ typedef ::cppu::ImplHelper2<
+ ::com::sun::star::accessibility::XAccessibleText,
+ ::com::sun::star::accessibility::XAccessibleTextAttributes > AccessibleStaticTextBase_BASE;
+
+ /** Helper class for objects containing EditEngine/Outliner text
+
+ This class implements the XAccessibleText interface for static
+ text, somewhat similar to the children of the
+ AccessibleTextHelper class. Currently, there are no children,
+ i.e. the whole text is presented in one big chunk. This might
+ change in the future, if a need for image bullets should
+ arise. These, by convention, would be represented as children
+ of the text.
+
+ 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.
+
+ As this class is intended for static (i.e. non-changing) text
+ only, no event broadcasting is necessary. You must handle
+ visibility by yourself, the bounding boxes returned by
+ getCharacterBounds() are relative to your accessibility
+ object.
+
+ @attention All public non-UNO methods (those are the uppercase
+ ones) 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 as a base for objects containing static
+ edit engine text. To avoid overwriting every interface method
+ to intercept derived object defunc state, just set NULL as the
+ edit source. Every interface method will then properly throw
+ an exception.
+ */
+ class EDITENG_DLLPUBLIC AccessibleStaticTextBase : public AccessibleStaticTextBase_BASE
+ {
+
+ public:
+ /** 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.
+
+ */
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ explicit AccessibleStaticTextBase( ::std::auto_ptr< SvxEditSource > pEditSource );
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+ virtual ~AccessibleStaticTextBase();
+
+ private:
+
+ // declared, but not defined
+ EDITENG_DLLPRIVATE AccessibleStaticTextBase( const AccessibleStaticTextBase& );
+ // declared, but not defined
+ EDITENG_DLLPRIVATE AccessibleStaticTextBase& operator= ( const AccessibleStaticTextBase& );
+
+ public:
+ /** Query the current edit source
+
+ @attention This method returns by reference, so you are
+ responsible for serialization (typically, you aquired the
+ solar mutex when calling this method). Thus, the method
+ should only be called from the main office thread.
+
+ */
+ virtual const SvxEditSource& GetEditSource() const SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** Set the current edit source
+
+ @attention You are required to have the solar mutex
+ locked, when calling this method. Thus, the method should
+ only be called from the main office thread.
+
+ The EditSource set here is required to broadcast out the
+ following hints: EDITSOURCE_HINT_PARASMOVED,
+ EDITSOURCE_HINT_SELECTIONCHANGED, TEXT_HINT_MODIFIED,
+ TEXT_HINT_PARAINSERTED, TEXT_HINT_PARAREMOVED,
+ TEXT_HINT_TEXTHEIGHTCHANGED,
+ TEXT_HINT_VIEWSCROLLED. 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 SFX_HINT_DYING hint.
+
+ 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::auto_ptr<SvxEditSource>(NULL)) in
+ your dispose() method.
+
+ @param pEditSource
+ The new edit source to set. Object ownership is transferred
+ from the caller to the callee.
+ */
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ virtual void SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) SAL_THROW((::com::sun::star::uno::RuntimeException));
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+
+ /** Set the event source
+
+ @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.
+ */
+ virtual void SetEventSource( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rInterface );
+
+ /** Get the event source
+
+ @return the interface that is set as the source for
+ accessibility events sent by this object.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetEventSource() const;
+
+ /** Set offset of EditEngine from parent
+
+ @attention You are required to have the solar mutex
+ locked, when calling this method. Thus, the method should
+ only be called from the main office thread.
+
+ If the origin of the underlying EditEngine does
+ not correspond to the upper left corner of the object
+ using this class, you have to specify the offset.
+
+ @param rPoint
+ The offset in screen coordinates (i.e. pixel)
+ */
+ virtual void SetOffset( const Point& rPoint );
+
+ /** Query offset of EditEngine from parent
+
+ @return the offset in screen coordinates (i.e. pixel)
+ */
+ virtual Point GetOffset() const;
+
+ /** Update the visible children
+
+ As this class currently does not represent any content
+ using children, this does nothing at the moment.
+
+ @attention You are required to have the solar mutex
+ locked, when calling this method. Thus, the 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 AccessibleStaticTextHelper isn't notified
+ internally. Normally, there should not be a need to call
+ this method.
+ */
+ virtual void UpdateChildren() SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** 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).
+ */
+ virtual void Dispose();
+
+ // XAccessibleText interface implementation
+ virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException);
+ /// This will only work with a functional SvxEditViewForwarder, i.e. an EditEngine/Outliner in edit mode
+ virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ /// Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine)
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ /// Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine)
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ /// Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine)
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ /// This will only work with a functional SvxEditViewForwarder, i.e. an EditEngine/Outliner in edit mode
+ virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleTextAttributes
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getDefaultAttributes( const ::com::sun::star::uno::Sequence< OUString >& RequestedAttributes ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRunAttributes( sal_Int32 Index, const ::com::sun::star::uno::Sequence< OUString >& RequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // child-related methods from XAccessibleContext
+ virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // child-related methods from XAccessibleComponent
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ Rectangle GetParagraphBoundingBox() const;
+
+ private:
+
+ /// @dyn
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ const std::auto_ptr< AccessibleStaticTextBase_Impl > mpImpl;
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+
+ };
+
+} // end of namespace accessibility
+
+#endif /* _SVX_ACCESSILE_STATIC_TEXT_BASE_HXX_ */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/AccessibleStringWrap.hxx b/include/editeng/AccessibleStringWrap.hxx
new file mode 100644
index 000000000000..cae879f95a1a
--- /dev/null
+++ b/include/editeng/AccessibleStringWrap.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 _ACCESSIBLESTRINGWRAP_HXX
+#define _ACCESSIBLESTRINGWRAP_HXX
+
+#include <sal/types.h>
+#include <tools/string.hxx>
+
+#include <editeng/editengdllapi.h>
+
+class OutputDevice;
+class SvxFont;
+class Rectangle;
+class Point;
+
+//------------------------------------------------------------------------
+//
+// AccessibleStringWrap declaration
+//
+//------------------------------------------------------------------------
+
+class AccessibleStringWrap
+{
+public:
+
+ EDITENG_DLLPUBLIC AccessibleStringWrap( OutputDevice& rDev, SvxFont& rFont, const String& rText );
+
+ EDITENG_DLLPUBLIC sal_Bool GetCharacterBounds( sal_Int32 nIndex, Rectangle& rRect );
+ EDITENG_DLLPUBLIC sal_Int32 GetIndexAtPoint( const Point& rPoint );
+
+private:
+
+ OutputDevice& mrDev;
+ SvxFont& mrFont;
+ String maText;
+};
+
+#endif /* _ACCESSIBLESTRINGWRAP_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/LatinLookupTree.hxx b/include/editeng/LatinLookupTree.hxx
new file mode 100644
index 000000000000..9407780f5b80
--- /dev/null
+++ b/include/editeng/LatinLookupTree.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 LATINLOOKUPTREE_HXX
+#define LATINLOOKUPTREE_HXX
+
+#include <editeng/LookupTree.hxx>
+#include <editeng/TreeHead.hxx>
+#include <editeng/editengdllapi.h>
+
+/**
+ * LatinLookupTree implements a tree that is optimized for storing and looking
+ * up words that mainly consist of roman characters, although any other
+ * language can be handled, too.
+ */
+class EDITENG_DLLPUBLIC LatinLookupTree : public LookupTree, public TreeHead
+{
+public:
+
+ explicit LatinLookupTree(OUString sLanguage);
+ ~LatinLookupTree();
+
+
+ /* =================== Implemented Virtuals From LookupTree =================== */
+ void returnToRoot();
+ void gotoNode(OUString sNode);
+ void advance(const sal_Unicode a);
+ void goBack();
+ void insert(OUString sKey, const int nProbability = 1);
+ void insert(const int nProbability = 1);
+ void remove(OUString sKey);
+ OUString suggestAutoCompletion() const;
+ void clear();
+
+ /* =================== Implemented Virtuals From Node =================== */
+ bool isSeparatedlyHandled(const sal_Unicode cKey) const;
+ Node*& getChildRef(const sal_Unicode cKey, bool bCreatePlaceholder = false);
+ void evaluateSeparateStorage(int& nSuggest, Node*& pSuggest) const;
+ void freeMemory();
+
+
+ /* =================== Implemented Virtual From TreeHead =================== */
+ Node* newNode(Node* pParent, const sal_Unicode cKey, const int nProbability = 0);
+
+ /* =================== Member Variables =================== */
+ // position of lower case letter 'a' within the selected char encoding.
+ static const unsigned int our_nLowerCaseA;
+
+ // position of upper case letter 'A' within the selected char encoding.
+ static const unsigned int our_nUpperCaseA;
+
+private:
+ Node* m_pLeaves[52]; // handles [a-z] and [A-Z]
+};
+
+#endif // LATINLOOKUPTREE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/LatinTreeNode.hxx b/include/editeng/LatinTreeNode.hxx
new file mode 100644
index 000000000000..5e406858697c
--- /dev/null
+++ b/include/editeng/LatinTreeNode.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 LATINTREENODE_HXX
+#define LATINTREENODE_HXX
+
+#include <editeng/Node.hxx>
+
+/**
+ * LatinTreeNode represents a node within a LatinLookupTree. As en external
+ * caller, you should never have to do anything with this class directly.
+ * Use the class LatinLookupTree instead for constructing a new tree.
+ */
+class LatinTreeNode : public Node
+{
+public:
+ explicit LatinTreeNode(TreeHead *pHead, Node* pParent, const sal_Unicode cKey, const int nProbability = 0);
+ ~LatinTreeNode();
+
+ /* =================== Implemented Virtuals From Node =================== */
+ bool isSeparatedlyHandled(const sal_Unicode cKey) const;
+ Node*& getChildRef(const sal_Unicode cKey, bool bCreatePlaceholder = false);
+ void evaluateSeparateStorage(int& nSuggest, Node*& pSuggest) const;
+ void freeMemory();
+
+private:
+ Node* m_pLeaves[26]; // handles [a-z]
+};
+
+#endif // LATINTREENODE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/LookupTree.hxx b/include/editeng/LookupTree.hxx
new file mode 100644
index 000000000000..95abcf25d6f8
--- /dev/null
+++ b/include/editeng/LookupTree.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 LOOKUPTREE_H
+#define LOOKUPTREE_H
+
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+#include <editeng/editengdllapi.h>
+
+/** LookupTree is an interface class that allows for unified access to tree
+ * structures used for storing dictionnary words as well as their respective
+ * probabilities.
+ * It allows you to insert or remove words from the tree, navigate threw the
+ * tree along its branches and request for a suggestion for autocompletion
+ * according to the position within the tree.
+ * It also allows you to attribute a specific language to each tree so that
+ * it is possible to serve the correct auto completions even within a document
+ * that contains content in more than one language.
+ */
+class EDITENG_DLLPUBLIC LookupTree
+{
+public:
+ explicit inline LookupTree(OUString sLanguage);
+ virtual ~LookupTree() {}
+
+ inline OUString language() const;
+
+ // Resets the current item to root.
+ virtual void returnToRoot() = 0;
+
+ // Advances from the root position key by key towards the node keyed with
+ // the last char of sKey.
+ virtual void gotoNode(OUString sNode) = 0;
+
+ // Advances from the current position towards the node keyed with cKey.
+ virtual void advance(const sal_Unicode cKey) = 0;
+
+ // Sets the focus to the parent of the current node. Removes the current
+ // node if it is invalid.
+ virtual void goBack() = 0;
+
+ // Inserts a complete keyword starting from the root node of the tree.
+ // Does not change the current position within the tree.
+ virtual void insert(OUString sKey, const int nProbability = 1) = 0;
+
+ // Inserts a keyword with the given probability at the current position
+ // within the tree. Does not change the current position within the tree.
+ virtual void insert(const int nProbability = 1) = 0;
+
+ // Removes a complete keyword starting from the root node of the tree.
+ // Does not change the current position within the tree.
+ virtual void remove(OUString sKey) = 0;
+
+ // Returns the suggested autocompletion for the current location within
+ // the tree.
+ virtual OUString suggestAutoCompletion() const = 0;
+
+ // Clears the tree and removes any information it contains.
+ virtual void clear() = 0;
+
+
+private:
+ const OUString m_sLanguage; // language handled by this tree
+};
+
+LookupTree::LookupTree(OUString sLanguage) :
+ m_sLanguage( sLanguage )
+{
+}
+
+OUString LookupTree::language() const
+{
+ return m_sLanguage;
+}
+
+#endif // LOOKUPTREE_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/Node.hxx b/include/editeng/Node.hxx
new file mode 100644
index 000000000000..3159e48a99b7
--- /dev/null
+++ b/include/editeng/Node.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 NODE_HXX
+#define NODE_HXX
+
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+#include <list>
+
+class TreeHead;
+
+/**
+ * Node represents a node within a LookupTree. As en external caller, you
+ * should never have to do anything with this class directly.
+ * Use any of the classes derived from LookupTree instead for constructing a
+ * new tree.
+ */
+class Node
+{
+public:
+ //explicit Node(TreeHead* const pHead);
+ explicit Node(TreeHead* const pHead, Node* const pParent = NULL,
+ const sal_Unicode cKey = 0, const int nProbability = 0);
+
+ virtual ~Node();
+
+ // Removes the specified child from this node. Make sure you may remove it
+ // before doing so.
+ void removeChild(Node*& pChild);
+
+ // Inserts a complete keyword starting from this node of the tree.
+ void insertKey(OUString sKey, const int nProbability);
+ // Removes a complete keyword starting from this node of the tree.
+ void removeKey(OUString sKey);
+
+ // Returns the child node keyed with cKey.
+ Node* advanceKey(const sal_Unicode cKey);
+
+ // Use this to inform a parent about its child having changed.
+ // Call this only with nProbability = 0 if you have made sure the node can
+ // be removed.
+ void childHasChanged(Node* pChild, const int nProbability, bool bAllowRemoval = false);
+
+ // Rechose the node that is suggested for auto-completion
+ void reevaluateSuggestion(bool& bNodeProbabilityChanged);
+
+
+ /* =================== Virtuals =================== */
+ virtual bool isSeparatedlyHandled(const sal_Unicode cKey) const = 0;
+
+ // Returns a reference to the pointer to the child node for the requested
+ // char. Returns NULL if no such child could be found.
+ // IMPORTANT: In the latter case, you may NOT overwrite the return value,
+ // if you did not set bCreatePlaceholder to true.
+ virtual Node*& getChildRef(const sal_Unicode cKey, bool bCreatePlaceholder = false) = 0;
+
+ // Sets nSuggest to the highest probability within the subtree and pSuggest
+ // to point to the (first) node with this probability.
+ virtual void evaluateSeparateStorage(int& nSuggest, Node*& pSuggest) const = 0;
+
+ // Removes all child nodes and clears all memory.
+ virtual void freeMemory() = 0;
+
+ /* =================== Member Variables =================== */
+ const sal_Unicode m_cKey; // the char represented by this node
+ int m_nKeyProbability; // the number of occurrences of this key
+
+ // the highest KeyProbability in the tree sprouting from this node
+ int m_nHighestProbaInSubtree;
+
+ Node* const m_pParent; // the parent of this node
+ Node* m_pSuggest; // next node in chain to the suggested autocompletion
+
+ TreeHead* const m_pHead; // head of the tree
+
+ unsigned short m_nChildren; // the number of children of the node
+ std::list<Node*> m_lChildren; // all chars not handled by array
+
+ // Allows returning a reference to a valid Null pointer. May NOT be overwritten.
+ static Node* our_pNodeNullPointer;
+};
+
+#endif // NODE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/SpellPortions.hxx b/include/editeng/SpellPortions.hxx
new file mode 100644
index 000000000000..f96a14b0f557
--- /dev/null
+++ b/include/editeng/SpellPortions.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 SVX_SPELL_PORTIONS_HXX
+#define SVX_SPELL_PORTIONS_HXX
+
+#include <i18nlangtag/lang.h>
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/linguistic2/SingleProofreadingError.hpp>
+#include <com/sun/star/linguistic2/XProofreader.hpp>
+#include <vector>
+
+namespace com{ namespace sun{ namespace star{ namespace linguistic2{
+ class XSpellAlternatives;
+}}}}
+
+namespace svx{
+/** contains a portion of text that has the same language attributes applied
+ and belongs to the same script type.
+ */
+struct SpellPortion
+{
+ /** contains the text of the portion.
+ */
+ OUString sText;
+ /** Marks the portion as field, footnote symbol or any other special content that
+ should be protected against unintentional deletion.
+ */
+ bool bIsField;
+ /** Marks the portion hidden content that should not be touched by spell checking
+ and not be removed like redlines. The creator of the portions has to take care
+ for them.
+ */
+ bool bIsHidden;
+ /** contains the language applied to the text. It has to match the script type.
+ */
+ LanguageType eLanguage;
+ /** for wrong words this reference is filled with the error information otherwise
+ it's an empty reference
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellAlternatives> xAlternatives;
+ /** determines whether the error type is a grammar error
+ */
+ bool bIsGrammarError;
+ /** contains the grammar error information
+ */
+ com::sun::star::linguistic2::SingleProofreadingError aGrammarError;
+ /** provides access to the grammar checker interface
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XProofreader > xGrammarChecker;
+ /** marks portion as to-be-ignored. This is a return parameter.
+ */
+ /** contains the proposed dialog title if the proof reading component provides one.
+ */
+ OUString sDialogTitle;
+
+ bool bIgnoreThisError;
+ SpellPortion() :
+ bIsField(false),
+ bIsHidden(false),
+ eLanguage(LANGUAGE_DONTKNOW),
+ bIsGrammarError(false),
+ bIgnoreThisError(false)
+ {
+ aGrammarError.nErrorStart = aGrammarError.nErrorLength = aGrammarError.nErrorType = 0;
+ }
+};
+typedef std::vector<SpellPortion> SpellPortions;
+}//namespace svx
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/TreeHead.hxx b/include/editeng/TreeHead.hxx
new file mode 100644
index 000000000000..12c8b33c8d66
--- /dev/null
+++ b/include/editeng/TreeHead.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 TREEHEAD_HXX
+#define TREEHEAD_HXX
+
+#include <editeng/Node.hxx>
+
+/**
+ * Represents the root node of a LookupTree.
+ */
+class TreeHead : public Node
+{
+public:
+ explicit inline TreeHead();
+ virtual ~TreeHead() {}
+
+ /* =================== Virtuals =================== */
+ virtual Node* newNode(Node* pParent, const sal_Unicode cKey, const int nProbability = 0) = 0;
+
+ /* =================== Member Variables =================== */
+ Node* m_pCurrent; // current location within the tree
+};
+
+TreeHead::TreeHead() :
+ Node( this ),
+ m_pCurrent( this )
+{
+}
+
+#endif // TREEHEAD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/UnoForbiddenCharsTable.hxx b/include/editeng/UnoForbiddenCharsTable.hxx
new file mode 100644
index 000000000000..9fea61b9084c
--- /dev/null
+++ b/include/editeng/UnoForbiddenCharsTable.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 _SVX_UNOFORBIDDENCHARSTABLE_HXX_
+#define _SVX_UNOFORBIDDENCHARSTABLE_HXX_
+
+#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
+#include <com/sun/star/linguistic2/XSupportedLocales.hpp>
+#include <rtl/ref.hxx>
+
+#include <cppuhelper/implbase2.hxx>
+#include "editeng/editengdllapi.h"
+
+class SvxForbiddenCharactersTable;
+
+class EDITENG_DLLPUBLIC SvxUnoForbiddenCharsTable : public cppu::WeakImplHelper2<
+ com::sun::star::i18n::XForbiddenCharacters,
+ com::sun::star::linguistic2::XSupportedLocales>
+{
+protected:
+ /** this virtual function is called if the forbidden characters are changed */
+ virtual void onChange();
+
+ rtl::Reference<SvxForbiddenCharactersTable> mxForbiddenChars;
+
+public:
+ SvxUnoForbiddenCharsTable(rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars);
+ ~SvxUnoForbiddenCharsTable();
+
+ // XForbiddenCharacters
+ virtual com::sun::star::i18n::ForbiddenCharacters SAL_CALL getForbiddenCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::container::NoSuchElementException, com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasForbiddenCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setForbiddenCharacters( const com::sun::star::lang::Locale& rLocale, const com::sun::star::i18n::ForbiddenCharacters& rForbiddenCharacters ) throw(com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeForbiddenCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
+
+ // XSupportedLocales
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > SAL_CALL getLocales( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasLocale( const ::com::sun::star::lang::Locale& aLocale ) throw (::com::sun::star::uno::RuntimeException);
+};
+
+#endif // _SVX_UNOFORBIDDENCHARSTABLE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/acorrcfg.hxx b/include/editeng/acorrcfg.hxx
new file mode 100644
index 000000000000..3c3321ccfc2d
--- /dev/null
+++ b/include/editeng/acorrcfg.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 _SVXACCFG_HXX
+#define _SVXACCFG_HXX
+
+#include "editeng/editengdllapi.h"
+#include <unotools/configitem.hxx>
+
+class SvxAutoCorrect;
+class SvxAutoCorrCfg;
+class EDITENG_DLLPUBLIC SvxBaseAutoCorrCfg : public utl::ConfigItem
+{
+ SvxAutoCorrCfg& rParent;
+ com::sun::star::uno::Sequence<OUString> GetPropertyNames();
+
+public:
+ SvxBaseAutoCorrCfg(SvxAutoCorrCfg& rParent);
+ ~SvxBaseAutoCorrCfg();
+
+ void Load(sal_Bool bInit);
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames);
+ void SetModified() {ConfigItem::SetModified();}
+};
+
+class EDITENG_DLLPUBLIC SvxSwAutoCorrCfg : public utl::ConfigItem
+{
+ SvxAutoCorrCfg& rParent;
+ com::sun::star::uno::Sequence<OUString> GetPropertyNames();
+
+public:
+ SvxSwAutoCorrCfg(SvxAutoCorrCfg& rParent);
+ ~SvxSwAutoCorrCfg();
+
+ void Load(sal_Bool bInit);
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames);
+ void SetModified() {ConfigItem::SetModified();}
+};
+/*--------------------------------------------------------------------
+ Description: Configuration for Auto Correction
+ --------------------------------------------------------------------*/
+class EDITENG_DLLPUBLIC SvxAutoCorrCfg
+{
+ friend class SvxBaseAutoCorrCfg;
+ friend class SvxSwAutoCorrCfg;
+
+ SvxAutoCorrect* pAutoCorrect;
+
+ SvxBaseAutoCorrCfg aBaseConfig;
+ SvxSwAutoCorrCfg aSwConfig;
+
+ // Flags for Autotext:
+ sal_Bool bFileRel;
+ sal_Bool bNetRel;
+ // Help tip for Autotext as you type
+ sal_Bool bAutoTextTip;
+ sal_Bool bAutoTextPreview;
+ sal_Bool bAutoFmtByInput;
+ sal_Bool bSearchInAllCategories;
+
+public:
+ void SetModified()
+ {
+ aBaseConfig.SetModified();
+ aSwConfig.SetModified();
+ }
+ void Commit()
+ {
+ aBaseConfig.Commit();
+ aSwConfig.Commit();
+ }
+
+ SvxAutoCorrect* GetAutoCorrect() { return pAutoCorrect; }
+ const SvxAutoCorrect* GetAutoCorrect() const { return pAutoCorrect; }
+ // the pointer is transferred to the possession of the ConfigItems!
+ void SetAutoCorrect( SvxAutoCorrect* );
+
+ sal_Bool IsAutoFmtByInput() const { return bAutoFmtByInput; }
+ void SetAutoFmtByInput( sal_Bool bSet ) { bAutoFmtByInput = bSet;aSwConfig.SetModified();}
+
+ sal_Bool IsSaveRelFile() const { return bFileRel; }
+ void SetSaveRelFile( sal_Bool bSet ) { bFileRel = bSet; aSwConfig.SetModified(); }
+
+ sal_Bool IsSaveRelNet() const { return bNetRel; }
+ void SetSaveRelNet( sal_Bool bSet ) { bNetRel = bSet; aSwConfig.SetModified();}
+
+ sal_Bool IsAutoTextPreview() const {return bAutoTextPreview;}
+ void SetAutoTextPreview(sal_Bool bSet) {bAutoTextPreview = bSet; aSwConfig.SetModified();}
+
+ sal_Bool IsAutoTextTip() const { return bAutoTextTip; }
+ void SetAutoTextTip(sal_Bool bSet ) { bAutoTextTip = bSet;aSwConfig.SetModified();}
+
+ sal_Bool IsSearchInAllCategories() const { return bSearchInAllCategories;}
+ void SetSearchInAllCategories(sal_Bool bSet ) { bSearchInAllCategories = bSet; aSwConfig.SetModified(); }
+
+ SvxAutoCorrCfg();
+ virtual ~SvxAutoCorrCfg();
+ static SvxAutoCorrCfg& Get();
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/adjustitem.hxx b/include/editeng/adjustitem.hxx
new file mode 100644
index 000000000000..e19907cd1737
--- /dev/null
+++ b/include/editeng/adjustitem.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 _SVX_ADJITEM_HXX
+#define _SVX_ADJITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/svxenum.hxx>
+#include <editeng/eeitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxAdjustItem ---------------------------------------------------
+
+/*
+[Description]
+This item describes the row orientation.
+*/
+#define ADJUST_LASTBLOCK_VERSION ((sal_uInt16)0x0001)
+
+class EDITENG_DLLPUBLIC SvxAdjustItem : public SfxEnumItemInterface
+{
+ sal_Bool bLeft : 1;
+ sal_Bool bRight : 1;
+ sal_Bool bCenter : 1;
+ sal_Bool bBlock : 1;
+
+ // only activ when bBlock
+ sal_Bool bOneBlock : 1;
+ sal_Bool bLastCenter : 1;
+ sal_Bool bLastBlock : 1;
+
+ friend SvStream& operator<<( SvStream&, SvxAdjustItem& ); //$ ostream
+public:
+ TYPEINFO();
+
+ SvxAdjustItem( const SvxAdjust eAdjst /*= SVX_ADJUST_LEFT*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+ virtual sal_uInt16 GetValueCount() const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetEnumValue() const;
+ virtual void SetEnumValue( sal_uInt16 nNewVal );
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ inline void SetOneWord( const SvxAdjust eType )
+ {
+ bOneBlock = eType == SVX_ADJUST_BLOCK;
+ }
+
+ inline void SetLastBlock( const SvxAdjust eType )
+ {
+ bLastBlock = eType == SVX_ADJUST_BLOCK;
+ bLastCenter = eType == SVX_ADJUST_CENTER;
+ }
+
+ inline void SetAdjust( const SvxAdjust eType )
+ {
+ bLeft = eType == SVX_ADJUST_LEFT;
+ bRight = eType == SVX_ADJUST_RIGHT;
+ bCenter = eType == SVX_ADJUST_CENTER;
+ bBlock = eType == SVX_ADJUST_BLOCK;
+ }
+
+ inline SvxAdjust GetLastBlock() const
+ {
+ SvxAdjust eRet = SVX_ADJUST_LEFT;
+
+ if ( bLastBlock )
+ eRet = SVX_ADJUST_BLOCK;
+ else if( bLastCenter )
+ eRet = SVX_ADJUST_CENTER;
+ return eRet;
+ }
+
+ inline SvxAdjust GetOneWord() const
+ {
+ SvxAdjust eRet = SVX_ADJUST_LEFT;
+
+ if ( bBlock && bOneBlock )
+ eRet = SVX_ADJUST_BLOCK;
+ return eRet;
+ }
+
+ inline SvxAdjust GetAdjust() const
+ {
+ SvxAdjust eRet = SVX_ADJUST_LEFT;
+
+ if ( bRight )
+ eRet = SVX_ADJUST_RIGHT;
+ else if ( bCenter )
+ eRet = SVX_ADJUST_CENTER;
+ else if ( bBlock )
+ eRet = SVX_ADJUST_BLOCK;
+ return eRet;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/autokernitem.hxx b/include/editeng/autokernitem.hxx
new file mode 100644
index 000000000000..6d849dc39d23
--- /dev/null
+++ b/include/editeng/autokernitem.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 _SVX_AKRNITEM_HXX
+#define _SVX_AKRNITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxAutoKernItem -------------------------------------------------
+
+/*
+ [Description]
+ Attribute for Pair-Kerning.
+*/
+
+class EDITENG_DLLPUBLIC SvxAutoKernItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxAutoKernItem( const sal_Bool bAutoKern /*= sal_False*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ inline SvxAutoKernItem& operator=(const SvxAutoKernItem& rAutoKern)
+ {
+ SetValue( rAutoKern.GetValue() );
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/blinkitem.hxx b/include/editeng/blinkitem.hxx
new file mode 100644
index 000000000000..0d495e6e100e
--- /dev/null
+++ b/include/editeng/blinkitem.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 _SVX_BLNKITEM_HXX
+#define _SVX_BLNKITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxBlinkItem -------------------------------------------------
+
+/*
+ [Description]
+ This item describes, whether to flash.
+*/
+
+class EDITENG_DLLPUBLIC SvxBlinkItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxBlinkItem( const sal_Bool bBlink /*= sal_False*/, const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ inline SvxBlinkItem& operator=(const SvxBlinkItem& rBlink) {
+ SetValue(rBlink.GetValue());
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/borderline.hxx b/include/editeng/borderline.hxx
new file mode 100644
index 000000000000..067e216aaa9a
--- /dev/null
+++ b/include/editeng/borderline.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 SVX_BORDERLINE_HXX
+#define SVX_BORDERLINE_HXX
+
+#include <com/sun/star/table/BorderLineStyle.hpp>
+
+#include <tools/color.hxx>
+#include <svl/poolitem.hxx>
+#include <editeng/editengdllapi.h>
+#include <svtools/ctrlbox.hxx>
+
+// Line defaults in twips (former Writer defaults):
+
+#define DEF_LINE_WIDTH_0 1
+#define DEF_LINE_WIDTH_1 20
+#define DEF_LINE_WIDTH_2 50
+#define DEF_LINE_WIDTH_3 80
+#define DEF_LINE_WIDTH_4 100
+#define DEF_LINE_WIDTH_5 10
+
+// ============================================================================
+
+namespace editeng {
+
+ // values from ::com::sun::star::table::BorderLineStyle
+ typedef sal_Int16 SvxBorderStyle;
+
+ // convert border style between Word formats and LO
+ SvxBorderStyle EDITENG_DLLPUBLIC ConvertBorderStyleFromWord(int);
+ /// convert border width in twips between Word formats and LO
+ double EDITENG_DLLPUBLIC ConvertBorderWidthToWord(SvxBorderStyle, double);
+ double EDITENG_DLLPUBLIC ConvertBorderWidthFromWord(SvxBorderStyle,
+ double, int);
+
+ class EDITENG_DLLPUBLIC SvxBorderLine
+ {
+ protected:
+ Color aColor;
+
+ long m_nWidth;
+ bool m_bMirrorWidths;
+ BorderWidthImpl m_aWidthImpl;
+ long m_nMult;
+ long m_nDiv;
+
+ SvxBorderStyle m_nStyle;
+ sal_uInt16 nOutWidth;
+ sal_uInt16 nInWidth;
+ sal_uInt16 nDistance;
+
+ bool m_bUseLeftTop;
+ Color (*m_pColorOutFn)( Color );
+ Color (*m_pColorInFn)( Color );
+ Color (*m_pColorGapFn)( Color );
+
+ public:
+ SvxBorderLine( const Color *pCol = 0,
+ long nWidth = 0, SvxBorderStyle nStyle =
+ ::com::sun::star::table::BorderLineStyle::SOLID,
+ bool bUseLeftTop = false,
+ Color (*pColorOutFn)( Color ) = &darkColor,
+ Color (*pColorInFn)( Color ) = &darkColor,
+ Color (*pColorGapFn)( Color ) = NULL );
+ SvxBorderLine( const SvxBorderLine& r );
+
+ SvxBorderLine& operator=( const SvxBorderLine& r );
+
+ const Color& GetColor() const { return aColor; }
+ Color GetColorOut( bool bLeftOrTop = true ) const;
+ Color GetColorIn( bool bLeftOrTop = true ) const;
+ bool HasGapColor() const { return m_pColorGapFn != NULL; }
+ Color GetColorGap() const;
+
+ void SetWidth( long nWidth = 0 ) { m_nWidth = nWidth; }
+ /** Guess the style and width from the three lines widths values.
+
+ When the value of nStyle is SvxBorderLine::DOUBLE, the style set will be guessed
+ using the three values to match the best possible style among the following:
+ - SvxBorderLine::DOUBLE
+ - SvxBorderLine::THINTHICK_SMALLGAP
+ - SvxBorderLine::THINTHICK_MEDIUMGAP
+ - SvxBorderLine::THINTHICK_LARGEGAP
+ - SvxBorderLine::THICKTHIN_SMALLGAP
+ - SvxBorderLine::THICKTHIN_MEDIUMGAP
+ - SvxBorderLine::THICKTHIN_LARGEGAP
+
+ If no styles matches the width, then the width is set to 0.
+
+ There is one known case that could fit several styles: \a nIn = \a nDist = 0.75 pt,
+ \a nOut = 1.5 pt. This case fits SvxBorderLine::THINTHICK_SMALLGAP and
+ SvxBorderLine::THINTHICK_MEDIUMGAP with a 1.5 pt width and
+ SvxBorderLine::THINTHICK_LARGEGAP with a 0.75 pt width. The same case happens
+ also for thick-thin styles.
+
+ \param nStyle the border style used to guess the width.
+ \param nIn the width of the inner line in 1th pt
+ \param nOut the width of the outer line in 1th pt
+ \param nDist the width of the gap between the lines in 1th pt
+ */
+ void GuessLinesWidths( SvxBorderStyle nStyle, sal_uInt16 nOut, sal_uInt16 nIn = 0, sal_uInt16 nDist = 0 );
+
+ // TODO Hacky method to mirror lines in only a few cases
+ void SetMirrorWidths( bool bMirror = true ) { m_bMirrorWidths = bMirror; }
+ long GetWidth( ) const { return m_nWidth; }
+ sal_uInt16 GetOutWidth() const;
+ sal_uInt16 GetInWidth() const;
+ sal_uInt16 GetDistance() const;
+
+ SvxBorderStyle GetBorderLineStyle() const { return m_nStyle; }
+
+ void SetColor( const Color &rColor ) { aColor = rColor; }
+ void SetColorOutFn( Color (*pColorOutFn)( Color ) ) { m_pColorOutFn = pColorOutFn; }
+ void SetColorInFn( Color (*pColorInFn)( Color ) ) { m_pColorInFn = pColorInFn; }
+ void SetColorGapFn( Color (*pColorGapFn)( Color ) ) { m_pColorGapFn = pColorGapFn; }
+ void SetUseLeftTop( bool bUseLeftTop ) { m_bUseLeftTop = bUseLeftTop; }
+ void SetBorderLineStyle( SvxBorderStyle nNew );
+ void ScaleMetrics( long nMult, long nDiv );
+
+ sal_Bool operator==( const SvxBorderLine &rCmp ) const;
+
+ String GetValueString( SfxMapUnit eSrcUnit, SfxMapUnit eDestUnit,
+ const IntlWrapper* pIntl,
+ sal_Bool bMetricStr = sal_False ) const;
+
+ bool HasPriority( const SvxBorderLine& rOtherLine ) const;
+
+ bool isEmpty() const {
+ return m_aWidthImpl.IsEmpty()
+ || m_nStyle == ::com::sun::star::table::BorderLineStyle::NONE
+ || m_nWidth == 0;
+ }
+ bool isDouble() const { return m_aWidthImpl.IsDouble(); }
+ sal_uInt16 GetScaledWidth() const { return GetOutWidth() + GetInWidth() + GetDistance(); }
+
+ static Color darkColor( Color aMain );
+ static Color lightColor( Color aMain );
+
+ static Color threeDLightColor( Color aMain );
+ static Color threeDMediumColor( Color aMain );
+ static Color threeDDarkColor( Color aMain );
+
+ static BorderWidthImpl getWidthImpl( SvxBorderStyle nStyle );
+ };
+
+// ============================================================================
+
+} // namespace editeng
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/boxitem.hxx b/include/editeng/boxitem.hxx
new file mode 100644
index 000000000000..256663c961e9
--- /dev/null
+++ b/include/editeng/boxitem.hxx
@@ -0,0 +1,226 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_BOXITEM_HXX
+#define _SVX_BOXITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <editeng/borderline.hxx>
+#include <editeng/editengdllapi.h>
+#include <com/sun/star/table/BorderLine2.hpp>
+
+
+// class SvxBoxItem ------------------------------------------------------
+
+/* [Description]
+
+ This item describes a border attribute
+ (all four edges and the inward distance)
+*/
+
+#define BOX_LINE_TOP ((sal_uInt16)0)
+#define BOX_LINE_BOTTOM ((sal_uInt16)1)
+#define BOX_LINE_LEFT ((sal_uInt16)2)
+#define BOX_LINE_RIGHT ((sal_uInt16)3)
+
+/**
+This version causes SvxBoxItem to store the 4 cell spacing distances separately
+when serializing to stream.
+*/
+#define BOX_4DISTS_VERSION ((sal_uInt16)1)
+/**
+This version causes SvxBoxItem to store the styles for its border lines when
+serializing to stream.
+*/
+#define BOX_BORDER_STYLE_VERSION ((sal_uInt16)2)
+
+class EDITENG_DLLPUBLIC SvxBoxItem : public SfxPoolItem
+{
+ editeng::SvxBorderLine *pTop,
+ *pBottom,
+ *pLeft,
+ *pRight;
+ sal_uInt16 nTopDist,
+ nBottomDist,
+ nLeftDist,
+ nRightDist;
+
+public:
+ TYPEINFO();
+
+ explicit SvxBoxItem( const sal_uInt16 nId );
+ SvxBoxItem( const SvxBoxItem &rCpy );
+ ~SvxBoxItem();
+ SvxBoxItem &operator=( const SvxBoxItem& rBox );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ virtual bool ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
+
+ const editeng::SvxBorderLine* GetTop() const { return pTop; }
+ const editeng::SvxBorderLine* GetBottom() const { return pBottom; }
+ const editeng::SvxBorderLine* GetLeft() const { return pLeft; }
+ const editeng::SvxBorderLine* GetRight() const { return pRight; }
+
+ const editeng::SvxBorderLine* GetLine( sal_uInt16 nLine ) const;
+
+ //The Pointers are being copied!
+ void SetLine( const editeng::SvxBorderLine* pNew, sal_uInt16 nLine );
+
+ sal_uInt16 GetDistance( sal_uInt16 nLine ) const;
+ sal_uInt16 GetDistance() const;
+
+ void SetDistance( sal_uInt16 nNew, sal_uInt16 nLine );
+ inline void SetDistance( sal_uInt16 nNew );
+
+ // Line width plus Space plus inward distance
+ //bIgnoreLine = TRUE -> Also return distance, when no Line is set
+ sal_uInt16 CalcLineSpace( sal_uInt16 nLine, sal_Bool bIgnoreLine = sal_False ) const;
+ static com::sun::star::table::BorderLine2 SvxLineToLine( const editeng::SvxBorderLine* pLine, sal_Bool bConvert );
+ static sal_Bool LineToSvxLine(const ::com::sun::star::table::BorderLine& rLine, editeng::SvxBorderLine& rSvxLine, sal_Bool bConvert);
+ static sal_Bool LineToSvxLine(const ::com::sun::star::table::BorderLine2& rLine, editeng::SvxBorderLine& rSvxLine, sal_Bool bConvert);
+};
+
+inline void SvxBoxItem::SetDistance( sal_uInt16 nNew )
+{
+ nTopDist = nBottomDist = nLeftDist = nRightDist = nNew;
+}
+
+// class SvxBoxInfoItem --------------------------------------------------
+
+/* [Description]
+
+ Another item for the border. This item has only limited functionality.
+ On one hand, the general Dialog is told by the item which options it
+ should offer. On the other hand, this attribute may be used to
+ transported the borderline for the inner horizontal and vertical lines.
+*/
+
+#define BOXINFO_LINE_HORI ((sal_uInt16)0)
+#define BOXINFO_LINE_VERT ((sal_uInt16)1)
+
+#define VALID_TOP 0x01
+#define VALID_BOTTOM 0x02
+#define VALID_LEFT 0x04
+#define VALID_RIGHT 0x08
+#define VALID_HORI 0x10
+#define VALID_VERT 0x20
+#define VALID_DISTANCE 0x40
+#define VALID_DISABLE 0x80
+
+class EDITENG_DLLPUBLIC SvxBoxInfoItem : public SfxPoolItem
+{
+ editeng::SvxBorderLine* pHori; //inner horizontal Line
+ editeng::SvxBorderLine* pVert; //inner vertical Line
+
+ bool mbEnableHor; /// true = Enable inner horizontal line.
+ bool mbEnableVer; /// true = Enable inner vertical line.
+
+ /*
+ Currently only for StarWriter: distance inward from SvxBoxItem. If the
+ distance is requested, then the field for the distance from the dialog be
+ activated. nDefDist is regarded as a default value. If any line is
+ turned on or will be turned on it must this distance be set to default.
+ bMinDist indicates whether the user can go below this value or not.
+ With NDIST is the current distance from the app transported back and
+ forth to the dialogue.
+ */
+
+ sal_Bool bDist :1; // TRUE, Unlock Distance.
+ sal_Bool bMinDist :1; // TRUE, Going below minimum Distance is prohibited
+
+ sal_uInt8 nValidFlags; // 0000 0000
+ // ³³³³ ³³³ÀÄ VALID_TOP
+ // ³³³³ ³³ÀÄÄ VALID_BOTTOM
+ // ³³³³ ³ÀÄÄÄ VALID_LEFT
+ // ³³³³ ÀÄÄÄÄ VALID_RIGHT
+ // ³³³ÀÄÄÄÄÄÄ VALID_HORI
+ // ³³ÀÄÄÄÄÄÄÄ VALID_VERT
+ // ³ÀÄÄÄÄÄÄÄÄ VALID_DIST
+ // ÀÄÄÄÄÄÄÄÄÄ VALID_DISABLE
+
+ sal_uInt16 nDefDist; // The default or minimum distance.
+
+public:
+ TYPEINFO();
+
+ explicit SvxBoxInfoItem( const sal_uInt16 nId );
+ SvxBoxInfoItem( const SvxBoxInfoItem &rCpy );
+ ~SvxBoxInfoItem();
+ SvxBoxInfoItem &operator=( const SvxBoxInfoItem &rCpy );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual bool ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
+
+ const editeng::SvxBorderLine* GetHori() const { return pHori; }
+ const editeng::SvxBorderLine* GetVert() const { return pVert; }
+
+ //The Pointers are being copied!
+ void SetLine( const editeng::SvxBorderLine* pNew, sal_uInt16 nLine );
+
+ sal_Bool IsTable() const { return mbEnableHor && mbEnableVer; }
+ void SetTable( sal_Bool bNew ) { mbEnableHor = mbEnableVer = bNew; }
+
+ inline bool IsHorEnabled() const { return mbEnableHor; }
+ inline void EnableHor( bool bEnable ) { mbEnableHor = bEnable; }
+ inline bool IsVerEnabled() const { return mbEnableVer; }
+ inline void EnableVer( bool bEnable ) { mbEnableVer = bEnable; }
+
+ sal_Bool IsDist() const { return bDist; }
+ void SetDist( sal_Bool bNew ) { bDist = bNew; }
+ sal_Bool IsMinDist() const { return bMinDist; }
+ void SetMinDist( sal_Bool bNew ) { bMinDist = bNew; }
+ sal_uInt16 GetDefDist() const { return nDefDist; }
+ void SetDefDist( sal_uInt16 nNew ) { nDefDist = nNew; }
+
+ sal_Bool IsValid( sal_uInt8 nValid ) const
+ { return ( nValidFlags & nValid ) == nValid; }
+ void SetValid( sal_uInt8 nValid, sal_Bool bValid = sal_True )
+ { bValid ? ( nValidFlags |= nValid )
+ : ( nValidFlags &= ~nValid ); }
+ void ResetFlags();
+};
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/brushitem.hxx b/include/editeng/brushitem.hxx
new file mode 100644
index 000000000000..069a3b7f636a
--- /dev/null
+++ b/include/editeng/brushitem.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 _SVX_BRSHITEM_HXX
+#define _SVX_BRSHITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <vcl/wall.hxx>
+#include <tools/link.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxBrushItem ----------------------------------------------------
+
+class Graphic;
+class GraphicObject;
+class CntWallpaperItem;
+
+#define BRUSH_GRAPHIC_VERSION ((sal_uInt16)0x0001)
+
+enum SvxGraphicPosition
+{
+ GPOS_NONE,
+ GPOS_LT, GPOS_MT, GPOS_RT,
+ GPOS_LM, GPOS_MM, GPOS_RM,
+ GPOS_LB, GPOS_MB, GPOS_RB,
+ GPOS_AREA, GPOS_TILED
+};
+
+#define PARA_DEST_PARA 0
+#define PARA_DEST_CHAR 1
+
+class SvxBrushItem_Impl;
+class EDITENG_DLLPUBLIC SvxBrushItem : public SfxPoolItem
+{
+ Color aColor;
+ SvxBrushItem_Impl* pImpl;
+ String* pStrLink;
+ String* pStrFilter;
+ SvxGraphicPosition eGraphicPos;
+ sal_Bool bLoadAgain;
+
+ void ApplyGraphicTransparency_Impl();
+ DECL_STATIC_LINK( SvxBrushItem, DoneHdl_Impl, void *);
+ // wird nur von Create benutzt
+ SvxBrushItem( SvStream& rStrm,
+ sal_uInt16 nVersion, sal_uInt16 nWhich );
+
+public:
+ TYPEINFO();
+
+ explicit SvxBrushItem( sal_uInt16 nWhich );
+ SvxBrushItem( const Color& rColor, sal_uInt16 nWhich );
+
+ SvxBrushItem( const Graphic& rGraphic,
+ SvxGraphicPosition ePos, sal_uInt16 nWhich );
+ SvxBrushItem( const GraphicObject& rGraphicObj,
+ SvxGraphicPosition ePos, sal_uInt16 nWhich );
+ SvxBrushItem( const String& rLink, const String& rFilter,
+ SvxGraphicPosition ePos, sal_uInt16 nWhich );
+ SvxBrushItem( const SvxBrushItem& );
+ SvxBrushItem( const CntWallpaperItem&, sal_uInt16 nWhich );
+
+ ~SvxBrushItem();
+
+public:
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nVersion ) const;
+ virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ const Color& GetColor() const { return aColor; }
+ Color& GetColor() { return aColor; }
+ void SetColor( const Color& rCol) { aColor = rCol; }
+
+ void SetDoneLink( const Link& rLink );
+
+ SvxGraphicPosition GetGraphicPos() const { return eGraphicPos; }
+
+ void PurgeMedium() const;
+
+ const Graphic* GetGraphic() const;
+ const GraphicObject* GetGraphicObject() const;
+ const String* GetGraphicLink() const { return pStrLink; }
+ const String* GetGraphicFilter() const { return pStrFilter; }
+
+ void SetGraphicPos( SvxGraphicPosition eNew );
+ void SetGraphic( const Graphic& rNew );
+ void SetGraphicObject( const GraphicObject& rNewObj );
+ void SetGraphicLink( const String& rNew );
+ void SetGraphicFilter( const String& rNew );
+
+ SvxBrushItem& operator=( const SvxBrushItem& rItem);
+
+ static SvxGraphicPosition WallpaperStyle2GraphicPos( WallpaperStyle eStyle );
+ static WallpaperStyle GraphicPos2WallpaperStyle( SvxGraphicPosition ePos );
+};
+
+#endif // #ifndef _SVX_BRSHITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/bulletitem.hxx b/include/editeng/bulletitem.hxx
new file mode 100644
index 000000000000..345cf3ff7639
--- /dev/null
+++ b/include/editeng/bulletitem.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 _SVX_BULITEM_HXX
+#define _SVX_BULITEM_HXX
+
+#include "editeng/editengdllapi.h"
+
+
+// define ----------------------------------------------------------------
+
+// Styles
+#define BS_ABC_BIG 0
+#define BS_ABC_SMALL 1
+#define BS_ROMAN_BIG 2
+#define BS_ROMAN_SMALL 3
+#define BS_123 4
+#define BS_NONE 5
+#define BS_BULLET 6
+#define BS_BMP 128
+
+// Justification
+#define BJ_HLEFT 0x01
+#define BJ_HRIGHT 0x02
+#define BJ_HCENTER 0x04
+#define BJ_VTOP 0x08
+#define BJ_VBOTTOM 0x10
+#define BJ_VCENTER 0x20
+
+// Valid-Bits
+// First, only the values that are changed by the dialogue ...
+#define VALID_FONTCOLOR 0x0001
+#define VALID_FONTNAME 0x0002
+#define VALID_SYMBOL 0x0004
+#define VALID_BITMAP 0x0008
+#define VALID_SCALE 0x0010
+#define VALID_START 0x0020
+#define VALID_STYLE 0x0040
+#define VALID_PREVTEXT 0x0080
+#define VALID_FOLLOWTEXT 0x0100
+#include <svl/poolitem.hxx>
+#include <vcl/font.hxx>
+#include <svtools/grfmgr.hxx>
+
+// class SvxBulletItem ---------------------------------------------------
+
+class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem
+{
+ Font aFont;
+ GraphicObject* pGraphicObject;
+ String aPrevText;
+ String aFollowText;
+ sal_uInt16 nStart;
+ sal_uInt16 nStyle;
+ long nWidth;
+ sal_uInt16 nScale;
+ sal_Unicode cSymbol;
+ sal_uInt8 nJustify;
+ sal_uInt16 nValidMask; // Only temporary for GetAttribs / setAttribs,
+ // because of the large Bullets
+
+#ifdef _SVX_BULITEM_CXX
+ void SetDefaultFont_Impl();
+ void SetDefaults_Impl();
+#endif
+
+public:
+ TYPEINFO();
+
+ explicit SvxBulletItem( sal_uInt16 nWhich = 0 );
+ explicit SvxBulletItem( SvStream& rStrm, sal_uInt16 nWhich = 0 );
+ SvxBulletItem( const SvxBulletItem& );
+ ~SvxBulletItem();
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nVersion ) const;
+ virtual SvStream& Store( SvStream & , sal_uInt16 nItemVersion ) const;
+
+ String GetFullText() const;
+ sal_Unicode GetSymbol() const { return cSymbol; }
+ String GetPrevText() const { return aPrevText; }
+ String GetFollowText() const { return aFollowText; }
+
+ sal_uInt16 GetStart() const { return nStart; }
+ long GetWidth() const { return nWidth; }
+ sal_uInt16 GetStyle() const { return nStyle; }
+ sal_uInt8 GetJustification() const { return nJustify; }
+ Font GetFont() const { return aFont; }
+ sal_uInt16 GetScale() const { return nScale; }
+
+ const GraphicObject& GetGraphicObject() const;
+ void SetGraphicObject( const GraphicObject& rGraphicObject );
+
+ void SetSymbol( sal_Unicode c) { cSymbol = c; }
+ void SetPrevText( const String& rStr) { aPrevText = rStr;}
+ void SetFollowText(const String& rStr) { aFollowText=rStr;}
+
+ void SetStart( sal_uInt16 nNew ) { nStart = nNew; }
+ void SetWidth( long nNew ) { nWidth = nNew; }
+ void SetStyle( sal_uInt16 nNew ) { nStyle = nNew; }
+ void SetJustification( sal_uInt8 nNew ) { nJustify = nNew; }
+ void SetFont( const Font& rNew) { aFont = rNew; }
+ void SetScale( sal_uInt16 nNew ) { nScale = nNew; }
+
+ virtual sal_uInt16 GetVersion(sal_uInt16 nFileVersion) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ static void StoreFont( SvStream&, const Font& );
+ static Font CreateFont( SvStream&, sal_uInt16 nVer );
+
+ sal_uInt16& GetValidMask() { return nValidMask; }
+ sal_uInt16 GetValidMask() const { return nValidMask; }
+ sal_uInt16 IsValid( sal_uInt16 nFlag ) const { return nValidMask & nFlag; }
+ void SetValid( sal_uInt16 nFlag, sal_Bool bValid )
+ {
+ if ( bValid )
+ nValidMask |= nFlag;
+ else
+ nValidMask &= ~nFlag;
+ }
+ void CopyValidProperties( const SvxBulletItem& rCopyFrom );
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/charhiddenitem.hxx b/include/editeng/charhiddenitem.hxx
new file mode 100644
index 000000000000..651bdc240ef1
--- /dev/null
+++ b/include/editeng/charhiddenitem.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 _SVX_CHARHIDDENITEM_HXX
+#define _SVX_CHARHIDDENITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <svl/eitem.hxx>
+#include "editeng/editengdllapi.h"
+
+// class SvxCharHiddenItem -------------------------------------------------
+/* [Description]
+
+ This item marks text as hidden
+*/
+
+class EDITENG_DLLPUBLIC SvxCharHiddenItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxCharHiddenItem( const sal_Bool bHidden /*= sal_False*/, const sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ inline SvxCharHiddenItem& operator=(const SvxCharHiddenItem& rHidden) {
+ SetValue(rHidden.GetValue());
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/charreliefitem.hxx b/include/editeng/charreliefitem.hxx
new file mode 100644
index 000000000000..5bc6c589d02d
--- /dev/null
+++ b/include/editeng/charreliefitem.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 _SVX_CHARRELIEFITEM_HXX
+#define _SVX_CHARRELIEFITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <vcl/fntstyle.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxCharRotateItem ----------------------------------------------
+
+/* [Description]
+
+ This item defines a character relief and has currently the values
+ emboss, relief.
+*/
+
+class EDITENG_DLLPUBLIC SvxCharReliefItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ SvxCharReliefItem( FontRelief eValue /*= RELIEF_NONE*/,
+ const sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream & rStrm, sal_uInt16 nIVer) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetValueCount() const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ inline SvxCharReliefItem& operator=( const SvxCharReliefItem& rItem )
+ {
+ SetValue( rItem.GetValue() );
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/charrotateitem.hxx b/include/editeng/charrotateitem.hxx
new file mode 100644
index 000000000000..7845ab69ccd8
--- /dev/null
+++ b/include/editeng/charrotateitem.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_CHARROTATEITEM_HXX
+#define _SVX_CHARROTATEITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxCharRotateItem ----------------------------------------------
+
+/* [Description]
+
+ This item defines a character rotation value (0,1 degree). Currently
+ character can only be rotated 90,0 and 270,0 degrees.
+ The flag FitToLine defines only a UI-Information -
+ if true it must also create a SvxCharScaleItem.
+
+*/
+
+class EDITENG_DLLPUBLIC SvxCharRotateItem : public SfxUInt16Item
+{
+ sal_Bool bFitToLine;
+public:
+ TYPEINFO();
+
+ SvxCharRotateItem( sal_uInt16 nValue /*= 0*/,
+ sal_Bool bFitIntoLine /*= sal_False*/,
+ const sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream & rStrm, sal_uInt16 nIVer) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ inline SvxCharRotateItem& operator=( const SvxCharRotateItem& rItem )
+ {
+ SetValue( rItem.GetValue() );
+ SetFitToLine( rItem.IsFitToLine() );
+ return *this;
+ }
+
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ // our currently only degree values
+ void SetTopToBotton() { SetValue( 2700 ); }
+ void SetBottomToTop() { SetValue( 900 ); }
+ sal_Bool IsTopToBotton() const { return 2700 == GetValue(); }
+ sal_Bool IsBottomToTop() const { return 900 == GetValue(); }
+
+ sal_Bool IsFitToLine() const { return bFitToLine; }
+ void SetFitToLine( sal_Bool b ) { bFitToLine = b; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/charscaleitem.hxx b/include/editeng/charscaleitem.hxx
new file mode 100644
index 000000000000..7d9b38761852
--- /dev/null
+++ b/include/editeng/charscaleitem.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 _SVX_CHARSCALEITEM_HXX
+#define _SVX_CHARSCALEITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxCharScaleItem ----------------------------------------------
+
+/* [Description]
+
+ This item defines a character scaling factor as percent value.
+ A value of 100 is identical to 100% and means normal width
+ A value of 50 is identical to 50% and means 1/2 width.
+
+*/
+
+class EDITENG_DLLPUBLIC SvxCharScaleWidthItem : public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+
+ SvxCharScaleWidthItem( sal_uInt16 nValue /*= 100*/,
+ const sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ inline SvxCharScaleWidthItem& operator=(const SvxCharScaleWidthItem& rItem )
+ {
+ SetValue( rItem.GetValue() );
+ return *this;
+ }
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/charsetcoloritem.hxx b/include/editeng/charsetcoloritem.hxx
new file mode 100644
index 000000000000..6fc197fb1394
--- /dev/null
+++ b/include/editeng/charsetcoloritem.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 _SVX_CSCOITEM_HXX
+#define _SVX_CSCOITEM_HXX
+
+#include <tools/string.hxx>
+#include <editeng/colritem.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxCharSetColorItem ---------------------------------------------
+
+/* [Description]
+
+ Is only needed internally in the reader of Writer.
+*/
+
+class EDITENG_DLLPUBLIC SvxCharSetColorItem : public SvxColorItem
+{
+ rtl_TextEncoding eFrom;
+public:
+ TYPEINFO();
+
+ explicit SvxCharSetColorItem( const sal_uInt16 nId );
+ SvxCharSetColorItem( const Color& aColor, const rtl_TextEncoding eFrom,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ inline rtl_TextEncoding& GetCharSet() { return eFrom; }
+ inline rtl_TextEncoding GetCharSet() const { return eFrom; }
+
+ inline SvxCharSetColorItem& operator=(const SvxCharSetColorItem& rColor)
+ {
+ SetValue( rColor.GetValue() );
+ eFrom = rColor.GetCharSet();
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/cmapitem.hxx b/include/editeng/cmapitem.hxx
new file mode 100644
index 000000000000..f7326758befc
--- /dev/null
+++ b/include/editeng/cmapitem.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 _SVX_CMAPITEM_HXX
+#define _SVX_CMAPITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/svxenum.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxCaseMapItem --------------------------------------------------
+
+/* [Description]
+
+ This item describe the font type (uppercase, small caps ,...).
+*/
+
+class EDITENG_DLLPUBLIC SvxCaseMapItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ SvxCaseMapItem( const SvxCaseMap eMap /*= SVX_CASEMAP_NOT_MAPPED*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem + SfxEnumItem
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetValueCount() const;
+
+ // MS VC4.0 kommt durcheinander
+ void SetValue( sal_uInt16 nNewVal )
+ {SfxEnumItem::SetValue(nNewVal); }
+
+ inline SvxCaseMapItem& operator=(const SvxCaseMapItem& rMap)
+ {
+ SetValue( rMap.GetValue() );
+ return *this;
+ }
+
+ // enum cast
+ SvxCaseMap GetCaseMap() const
+ { return (SvxCaseMap)GetValue(); }
+ void SetCaseMap( SvxCaseMap eNew )
+ { SetValue( (sal_uInt16)eNew ); }
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx
new file mode 100644
index 000000000000..954fcd3b6ba0
--- /dev/null
+++ b/include/editeng/colritem.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 _SVX_COLRITEM_HXX
+#define _SVX_COLRITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <tools/color.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxColorItem ----------------------------------------------------
+
+/* [Description]
+
+ This item describes a color.
+*/
+
+#define VERSION_USEAUTOCOLOR 1
+
+class EDITENG_DLLPUBLIC SvxColorItem : public SfxPoolItem
+{
+private:
+ Color mColor;
+
+public:
+ TYPEINFO();
+
+ explicit SvxColorItem( const sal_uInt16 nId );
+ SvxColorItem( const Color& aColor, const sal_uInt16 nId );
+ SvxColorItem( SvStream& rStrm, const sal_uInt16 nId );
+ SvxColorItem( const SvxColorItem& rCopy );
+ ~SvxColorItem();
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ inline SvxColorItem& operator=(const SvxColorItem& rColor)
+ {
+ SetValue( rColor.GetValue() );
+ return *this;
+ }
+
+ const Color& GetValue() const
+ {
+ return mColor;
+ }
+ void SetValue( const Color& rNewCol );
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/contouritem.hxx b/include/editeng/contouritem.hxx
new file mode 100644
index 000000000000..316f21fc774e
--- /dev/null
+++ b/include/editeng/contouritem.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 __EDITENG_CONTOUR_ITEM_HXX__
+#define __EDITENG_CONTOUR_ITEM_HXX__
+
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxContourItem --------------------------------------------------
+
+/* [Description]
+ This item describes, if contour is employed.
+*/
+
+class EDITENG_DLLPUBLIC SvxContourItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxContourItem( const sal_Bool bContoured /*= sal_False*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ inline SvxContourItem& operator=(const SvxContourItem& rCont)
+ {
+ SetValue(rCont.GetValue());
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/crossedoutitem.hxx b/include/editeng/crossedoutitem.hxx
new file mode 100644
index 000000000000..6628609e060e
--- /dev/null
+++ b/include/editeng/crossedoutitem.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 _SVX_CRSDITEM_HXX
+#define _SVX_CRSDITEM_HXX
+
+#include <vcl/vclenum.hxx>
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxCrossedOutItem -----------------------------------------------
+
+/* [Description]
+ This item describes, whether and how it is striked out.
+*/
+
+class EDITENG_DLLPUBLIC SvxCrossedOutItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ SvxCrossedOutItem( const FontStrikeout eSt /*= STRIKEOUT_NONE*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetValueCount() const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ // MS VC4.0 messes things up
+ void SetValue( sal_uInt16 nNewVal )
+ {SfxEnumItem::SetValue(nNewVal); }
+
+ virtual int HasBoolValue() const;
+ virtual sal_Bool GetBoolValue() const;
+ virtual void SetBoolValue( sal_Bool bVal );
+
+ inline SvxCrossedOutItem& operator=(const SvxCrossedOutItem& rCross)
+ {
+ SetValue( rCross.GetValue() );
+ return *this;
+ }
+
+ // enum cast
+ FontStrikeout GetStrikeout() const
+ { return (FontStrikeout)GetValue(); }
+ void SetStrikeout( FontStrikeout eNew )
+ { SetValue( (sal_uInt16)eNew ); }
+};
+
+#endif // #ifndef _SVX_CRSDITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx
new file mode 100644
index 000000000000..9b6d9e7005c3
--- /dev/null
+++ b/include/editeng/editdata.hxx
@@ -0,0 +1,368 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+// MyEDITDATA, wegen exportiertem EditData
+#ifndef _MyEDITDATA_HXX
+#define _MyEDITDATA_HXX
+
+#include <tools/string.hxx>
+#include "editeng/editengdllapi.h"
+
+class SfxItemSet;
+class SfxPoolItem;
+class SvParser;
+class SvxFieldItem;
+
+enum EETextFormat { EE_FORMAT_TEXT = 0x20, EE_FORMAT_RTF, EE_FORMAT_BIN = 0x31, EE_FORMAT_HTML, EE_FORMAT_XML };
+enum EEHorizontalTextDirection { EE_HTEXTDIR_DEFAULT, EE_HTEXTDIR_L2R, EE_HTEXTDIR_R2L };
+enum EESelectionMode { EE_SELMODE_STD, EE_SELMODE_TXTONLY, EE_SELMODE_HIDDEN };
+ // EE_SELMODE_HIDDEN can be used to completely hide the selection. This is useful e.g. when you want show the selection
+ // only as long as your window (which the edit view works on) has the focus
+enum EESpellState { EE_SPELL_OK, EE_SPELL_NOLANGUAGE, EE_SPELL_LANGUAGENOTINSTALLED, EE_SPELL_NOSPELLER, EE_SPELL_ERRORFOUND };
+enum EVAnchorMode {
+ ANCHOR_TOP_LEFT, ANCHOR_VCENTER_LEFT, ANCHOR_BOTTOM_LEFT,
+ ANCHOR_TOP_HCENTER, ANCHOR_VCENTER_HCENTER, ANCHOR_BOTTOM_HCENTER,
+ ANCHOR_TOP_RIGHT, ANCHOR_VCENTER_RIGHT, ANCHOR_BOTTOM_RIGHT };
+
+#define EE_PARA_NOT_FOUND 0xFFFF
+#define EE_PARA_APPEND 0xFFFF
+#define EE_PARA_ALL 0xFFFF
+#define EE_INDEX_NOT_FOUND 0xFFFF
+
+EDITENG_DLLPUBLIC extern const size_t EE_APPEND;
+
+// Error messages for Read / Write Method
+#define EE_READWRITE_OK (SVSTREAM_OK)
+#define EE_READWRITE_WRONGFORMAT (SVSTREAM_ERRBASE_USER+1)
+#define EE_READWRITE_GENERALERROR (SVSTREAM_ERRBASE_USER+2)
+
+#define EDITUNDO_START 100
+#define EDITUNDO_REMOVECHARS 100
+#define EDITUNDO_CONNECTPARAS 101
+#define EDITUNDO_REMOVEFEATURE 102
+#define EDITUNDO_MOVEPARAGRAPHS 103
+#define EDITUNDO_INSERTFEATURE 104
+#define EDITUNDO_SPLITPARA 105
+#define EDITUNDO_INSERTCHARS 106
+#define EDITUNDO_DELCONTENT 107
+#define EDITUNDO_DELETE 108
+#define EDITUNDO_CUT 109
+#define EDITUNDO_PASTE 110
+#define EDITUNDO_INSERT 111
+#define EDITUNDO_SRCHANDREPL 112
+#define EDITUNDO_MOVEPARAS 113
+#define EDITUNDO_PARAATTRIBS 114
+#define EDITUNDO_ATTRIBS 115
+#define EDITUNDO_DRAGANDDROP 116
+#define EDITUNDO_READ 117
+#define EDITUNDO_STYLESHEET 118
+#define EDITUNDO_REPLACEALL 119
+#define EDITUNDO_STRETCH 120
+#define EDITUNDO_RESETATTRIBS 121
+#define EDITUNDO_INDENTBLOCK 122
+#define EDITUNDO_UNINDENTBLOCK 123
+#define EDITUNDO_MARKSELECTION 124
+#define EDITUNDO_TRANSLITERATE 125
+#define EDITUNDO_END 125
+
+#define EDITUNDO_USER 200
+
+class EditView;
+class EditEngine;
+class ImpEditView;
+class ImpEditEngine;
+class EditTextObject;
+class SfxStyleSheet;
+
+#define RGCHK_NONE 0 // No correction of ViusArea when scrolling
+#define RGCHK_NEG 1 // No negative ViusArea when scrolling
+#define RGCHK_PAPERSZ1 2 // VisArea must be within paper width, Text Size
+
+struct EPosition
+{
+ sal_uInt16 nPara;
+ xub_StrLen nIndex;
+
+ EPosition() :
+ nPara( EE_PARA_NOT_FOUND ),
+ nIndex( EE_INDEX_NOT_FOUND )
+ {
+ }
+
+ EPosition( sal_uInt16 nPara_, xub_StrLen nPos_ ) :
+ nPara( nPara_ ),
+ nIndex( nPos_ )
+ {
+ }
+};
+
+struct ESelection
+{
+ sal_uInt16 nStartPara;
+ xub_StrLen nStartPos;
+ sal_uInt16 nEndPara;
+ xub_StrLen nEndPos;
+
+ ESelection() : nStartPara( 0 ), nStartPos( 0 ), nEndPara( 0 ), nEndPos( 0 ) {}
+
+ ESelection( sal_uInt16 nStPara, xub_StrLen nStPos, sal_uInt16 nEPara, xub_StrLen nEPos ) :
+ nStartPara( nStPara ),
+ nStartPos( nStPos ),
+ nEndPara( nEPara ),
+ nEndPos( nEPos )
+ {
+ }
+
+ ESelection( sal_uInt16 nPara, xub_StrLen nPos ) :
+ nStartPara( nPara ),
+ nStartPos( nPos ),
+ nEndPara( nPara ),
+ nEndPos( nPos )
+ {
+ }
+
+ void Adjust();
+ sal_Bool IsEqual( const ESelection& rS ) const;
+ sal_Bool IsLess( const ESelection& rS ) const;
+ sal_Bool IsGreater( const ESelection& rS ) const;
+ sal_Bool IsZero() const;
+ sal_Bool HasRange() const;
+};
+
+inline sal_Bool ESelection::HasRange() const
+{
+ return ( nStartPara != nEndPara ) || ( nStartPos != nEndPos );
+}
+
+inline sal_Bool ESelection::IsZero() const
+{
+ return ( ( nStartPara == 0 ) && ( nStartPos == 0 ) &&
+ ( nEndPara == 0 ) && ( nEndPos == 0 ) );
+}
+
+inline sal_Bool ESelection::IsEqual( const ESelection& rS ) const
+{
+ return ( ( nStartPara == rS.nStartPara ) && ( nStartPos == rS.nStartPos ) &&
+ ( nEndPara == rS.nEndPara ) && ( nEndPos == rS.nEndPos ) );
+}
+
+inline sal_Bool ESelection::IsLess( const ESelection& rS ) const
+{
+ // The selection must be adjusted.
+ // => Only check if end of 'this' < Start of rS
+
+ if ( ( nEndPara < rS.nStartPara ) ||
+ ( ( nEndPara == rS.nStartPara ) && ( nEndPos < rS.nStartPos ) && !IsEqual( rS ) ) )
+ {
+ return sal_True;
+ }
+ return sal_False;
+}
+
+inline sal_Bool ESelection::IsGreater( const ESelection& rS ) const
+{
+ // The selection must be adjusted.
+ // => Only check if end of 'this' < Start of rS
+
+ if ( ( nStartPara > rS.nEndPara ) ||
+ ( ( nStartPara == rS.nEndPara ) && ( nStartPos > rS.nEndPos ) && !IsEqual( rS ) ) )
+ {
+ return sal_True;
+ }
+ return sal_False;
+}
+
+inline void ESelection::Adjust()
+{
+ sal_Bool bSwap = sal_False;
+ if ( nStartPara > nEndPara )
+ bSwap = sal_True;
+ else if ( ( nStartPara == nEndPara ) && ( nStartPos > nEndPos ) )
+ bSwap = sal_True;
+
+ if ( bSwap )
+ {
+ sal_uInt16 nSPar = nStartPara; sal_uInt16 nSPos = nStartPos;
+ nStartPara = nEndPara; nStartPos = nEndPos;
+ nEndPara = nSPar; nEndPos = nSPos;
+ }
+}
+
+struct EDITENG_DLLPUBLIC EFieldInfo
+{
+ SvxFieldItem* pFieldItem;
+ String aCurrentText;
+ EPosition aPosition;
+
+ EFieldInfo();
+ EFieldInfo( const SvxFieldItem& rFieldItem, sal_uInt16 nPara, sal_uInt16 nPos );
+ ~EFieldInfo();
+
+ EFieldInfo( const EFieldInfo& );
+ EFieldInfo& operator= ( const EFieldInfo& );
+};
+
+// -----------------------------------------------------------------------
+
+enum ImportState {
+ RTFIMP_START, RTFIMP_END, // only pParser, nPara, nIndex
+ RTFIMP_NEXTTOKEN, RTFIMP_UNKNOWNATTR, // nToken+nTokenValue
+ RTFIMP_SETATTR, // pAttrs
+ RTFIMP_INSERTTEXT, // aText
+ RTFIMP_INSERTPARA, // -
+ HTMLIMP_START, HTMLIMP_END, // only pParser, nPara, nIndex
+ HTMLIMP_NEXTTOKEN, HTMLIMP_UNKNOWNATTR, // nToken
+ HTMLIMP_SETATTR, // pAttrs
+ HTMLIMP_INSERTTEXT, // aText
+ HTMLIMP_INSERTPARA, HTMLIMP_INSERTFIELD // -
+ };
+
+struct ImportInfo
+{
+ SvParser* pParser;
+ ESelection aSelection;
+ ImportState eState;
+
+ int nToken;
+ short nTokenValue;
+
+ String aText;
+
+ void* pAttrs; // RTF: SvxRTFItemStackType*, HTML: SfxItemSet*
+
+ ImportInfo( ImportState eState, SvParser* pPrsrs, const ESelection& rSel );
+ ~ImportInfo();
+};
+
+struct ParagraphInfos
+{
+ ParagraphInfos()
+ : nParaHeight( 0 )
+ , nLines( 0 )
+ , nFirstLineStartX( 0 )
+ , nFirstLineOffset( 0 )
+ , nFirstLineHeight( 0 )
+ , nFirstLineTextHeight ( 0 )
+ , nFirstLineMaxAscent( 0 )
+ , bValid( 0 )
+ {}
+ sal_uInt16 nParaHeight;
+ sal_uInt16 nLines;
+
+ sal_uInt16 nFirstLineStartX;
+
+ sal_uInt16 nFirstLineOffset;
+ sal_uInt16 nFirstLineHeight;
+ sal_uInt16 nFirstLineTextHeight;
+ sal_uInt16 nFirstLineMaxAscent;
+
+ sal_Bool bValid; // A query during formatting is not valid!
+};
+
+struct EECharAttrib
+{
+ const SfxPoolItem* pAttr;
+
+ sal_uInt16 nPara;
+ xub_StrLen nStart;
+ xub_StrLen nEnd;
+};
+
+struct MoveParagraphsInfo
+{
+ sal_uInt16 nStartPara;
+ sal_uInt16 nEndPara;
+ sal_uInt16 nDestPara;
+
+ MoveParagraphsInfo( sal_uInt16 nS, sal_uInt16 nE, sal_uInt16 nD )
+ { nStartPara = nS; nEndPara = nE; nDestPara = nD; }
+};
+
+#define EE_ACTION_PASTE 1
+#define EE_ACTION_DROP 2
+
+struct PasteOrDropInfos
+{
+ sal_uInt16 nAction;
+ sal_uInt16 nStartPara;
+ sal_uInt16 nEndPara;
+
+ PasteOrDropInfos() : nAction(0), nStartPara(0xFFFF), nEndPara(0xFFFF) {}
+};
+
+enum EENotifyType
+{
+ /// EditEngine text was modified
+ EE_NOTIFY_TEXTMODIFIED,
+
+ /// A paragraph was inserted into the EditEngine
+ EE_NOTIFY_PARAGRAPHINSERTED,
+
+ /// A paragraph was removed from the EditEngine
+ EE_NOTIFY_PARAGRAPHREMOVED,
+
+ /// Multiple paragraphs have been removed from the EditEngine
+ EE_NOTIFY_PARAGRAPHSMOVED,
+
+ /// The height of at least one paragraph has changed
+ EE_NOTIFY_TEXTHEIGHTCHANGED,
+
+ /// The view area of the EditEngine scrolled
+ EE_NOTIFY_TEXTVIEWSCROLLED,
+
+ /// The selection and/or the cursor position has changed
+ EE_NOTIFY_TEXTVIEWSELECTIONCHANGED,
+
+ /** Denotes the beginning of a collected amount of EditEngine
+ notification events. This event itself is not queued, but sent
+ immediately
+ */
+ EE_NOTIFY_BLOCKNOTIFICATION_START,
+
+ /** Denotes the end of a collected amount of EditEngine
+ notification events. After this event, the queue is empty, and
+ a high-level operation such as "insert paragraph" is finished
+ */
+ EE_NOTIFY_BLOCKNOTIFICATION_END,
+
+ /// Denotes the beginning of a high-level action triggered by a key press
+ EE_NOTIFY_INPUT_START,
+
+ /// Denotes the end of a high-level action triggered by a key press
+ EE_NOTIFY_INPUT_END
+};
+
+struct EENotify
+{
+ EENotifyType eNotificationType;
+ EditEngine* pEditEngine;
+ EditView* pEditView;
+
+ sal_uInt16 nParagraph; // only valid in PARAGRAPHINSERTED/EE_NOTIFY_PARAGRAPHREMOVED
+
+ sal_uInt16 nParam1;
+ sal_uInt16 nParam2;
+
+ EENotify( EENotifyType eType )
+ { eNotificationType = eType; pEditEngine = NULL; pEditView = NULL; nParagraph = EE_PARA_NOT_FOUND; nParam1 = 0; nParam2 = 0; }
+};
+
+#endif // _MyEDITDATA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
new file mode 100644
index 000000000000..83ba64342443
--- /dev/null
+++ b/include/editeng/editeng.hxx
@@ -0,0 +1,586 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+// MyEDITENG, due to exported EditEng
+#ifndef _MyEDITENG_HXX
+#define _MyEDITENG_HXX
+
+#include <rtl/ref.hxx>
+#include <vector>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/i18n/WordType.hpp>
+#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
+
+#include <rsc/rscsfx.hxx>
+#include <editeng/editdata.hxx>
+#include <i18nlangtag/lang.h>
+#include "editeng/editengdllapi.h"
+
+#include <tools/rtti.hxx> // due to typedef TypeId
+
+#include <editeng/eedata.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace linguistic2 {
+ class XSpellChecker1;
+ class XHyphenator;
+ }
+ namespace datatransfer {
+ class XTransferable;
+ }
+ namespace lang {
+ struct Locale;
+ }
+}}}
+
+namespace svx {
+struct SpellPortion;
+typedef std::vector<SpellPortion> SpellPortions;
+}
+
+namespace svl { class IUndoManager; }
+namespace basegfx { class B2DPolyPolygon; }
+
+class ImpEditEngine;
+class EditView;
+class OutputDevice;
+class EditUndo;
+class SvxFont;
+class SfxItemPool;
+class SfxStyleSheet;
+class String;
+class SfxStyleSheetPool;
+class SvxSearchItem;
+class SvxFieldItem;
+class SvxCharSetColorItem;
+class SfxUndoAction;
+class MapMode;
+class Color;
+class Font;
+class KeyEvent;
+class PolyPolygon;
+class Size;
+class Point;
+class Rectangle;
+class SvStream;
+class Link;
+class OutputDevice;
+class Window;
+class SfxPoolItem;
+class SvxNumBulletItem;
+class SvxBulletItem;
+class SvxLRSpaceItem;
+class SvKeyValueIterator;
+class SvxForbiddenCharactersTable;
+class SvxNumberFormat;
+class FontList;
+class SvxFieldData;
+class ContentNode;
+class ParaPortion;
+class EditSelection;
+class EditPaM;
+class EditLine;
+class InternalEditStatus;
+class EditSelectionEngine;
+class EditDoc;
+struct PasteOrDropInfos;
+class Range;
+struct EPaM;
+class DeletedNodeInfo;
+class ParaPortionList;
+
+//////////////////////////////////////////////////////////////////////////////
+
+/** values for GetAttribs
+*/
+const sal_uInt8 EditEngineAttribs_All = 0; /// returns all attributes even when theire not set
+const sal_uInt8 EditEngineAttribs_HardAndPara = 1; /// returns all attributes set on paragraph and on portions
+const sal_uInt8 EditEngineAttribs_OnlyHard = 2; /// returns only attributes hard set on portions
+
+#define GETATTRIBS_STYLESHEET (sal_uInt8)0x01
+#define GETATTRIBS_PARAATTRIBS (sal_uInt8)0x02
+#define GETATTRIBS_CHARATTRIBS (sal_uInt8)0x04
+#define GETATTRIBS_ALL (sal_uInt8)0xFF
+
+class EDITENG_DLLPUBLIC EditEngine
+{
+ friend class EditView;
+ friend class ImpEditView;
+ friend class EditDbg;
+ friend class Outliner;
+
+public:
+ typedef std::vector<EditView*> ViewsType;
+
+private:
+ ImpEditEngine* pImpEditEngine;
+
+ EDITENG_DLLPRIVATE EditEngine( const EditEngine& );
+ EDITENG_DLLPRIVATE EditEngine& operator=( const EditEngine& );
+ EDITENG_DLLPRIVATE sal_uInt8 PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pView, Window* pFrameWin = NULL );
+
+ EDITENG_DLLPRIVATE void CursorMoved(ContentNode* pPrevNode);
+ EDITENG_DLLPRIVATE void CheckIdleFormatter();
+ EDITENG_DLLPRIVATE bool IsIdleFormatterActive() const;
+ EDITENG_DLLPRIVATE ParaPortion* FindParaPortion(ContentNode* pNode);
+ EDITENG_DLLPRIVATE const ParaPortion* FindParaPortion(ContentNode* pNode) const;
+ EDITENG_DLLPRIVATE const ParaPortion* GetPrevVisPortion(const ParaPortion* pCurPortion) const;
+
+ EDITENG_DLLPRIVATE com::sun::star::uno::Reference<
+ com::sun::star::datatransfer::XTransferable>
+ CreateTransferable(const EditSelection& rSelection);
+
+ EDITENG_DLLPRIVATE EditSelection InsertText(
+ com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable >& rxDataObj,
+ const String& rBaseURL, const EditPaM& rPaM, bool bUseSpecial);
+
+ EDITENG_DLLPRIVATE EditPaM EndOfWord(
+ const EditPaM& rPaM, sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES);
+
+ EDITENG_DLLPRIVATE EditPaM GetPaM(const Point& aDocPos, bool bSmart = true);
+
+ EDITENG_DLLPRIVATE EditSelection SelectWord(
+ const EditSelection& rCurSelection,
+ sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES,
+ bool bAcceptStartOfWord = true);
+
+ EDITENG_DLLPRIVATE long GetXPos(
+ const ParaPortion* pParaPortion, const EditLine* pLine, sal_uInt16 nIndex, bool bPreferPortionStart = false) const;
+
+ EDITENG_DLLPRIVATE Range GetLineXPosStartEnd(
+ const ParaPortion* pParaPortion, const EditLine* pLine) const;
+
+ EDITENG_DLLPRIVATE sal_uInt16 GetOnePixelInRef() const;
+ EDITENG_DLLPRIVATE InternalEditStatus& GetInternalEditStatus();
+
+ EDITENG_DLLPRIVATE void HandleBeginPasteOrDrop(PasteOrDropInfos& rInfos);
+ EDITENG_DLLPRIVATE void HandleEndPasteOrDrop(PasteOrDropInfos& rInfos);
+ EDITENG_DLLPRIVATE bool HasText() const;
+ EDITENG_DLLPRIVATE const EditSelectionEngine& GetSelectionEngine() const;
+ EDITENG_DLLPRIVATE void SetInSelectionMode(bool b);
+
+protected:
+
+
+public:
+ EditEngine( SfxItemPool* pItemPool );
+ virtual ~EditEngine();
+
+ const SfxItemSet& GetEmptyItemSet();
+
+ void SetDefTab( sal_uInt16 nDefTab );
+
+ void SetRefDevice( OutputDevice* pRefDef );
+ OutputDevice* GetRefDevice() const;
+
+ void SetRefMapMode( const MapMode& rMapMode );
+ MapMode GetRefMapMode();
+
+ void SetUpdateMode( sal_Bool bUpdate );
+ sal_Bool GetUpdateMode() const;
+
+ void SetBackgroundColor( const Color& rColor );
+ Color GetBackgroundColor() const;
+ Color GetAutoColor() const;
+ void EnableAutoColor( sal_Bool b );
+ void ForceAutoColor( sal_Bool b );
+ sal_Bool IsForceAutoColor() const;
+
+ void InsertView(EditView* pEditView, size_t nIndex = EE_APPEND);
+ EditView* RemoveView( EditView* pEditView );
+ EditView* RemoveView(size_t nIndex = EE_APPEND);
+ EditView* GetView(size_t nIndex = 0) const;
+ size_t GetViewCount() const;
+ sal_Bool HasView( EditView* pView ) const;
+ EditView* GetActiveView() const;
+ void SetActiveView(EditView* pView);
+
+ void SetPaperSize( const Size& rSize );
+ const Size& GetPaperSize() const;
+
+ void SetVertical( bool bVertical );
+ bool IsVertical() const;
+
+ void SetFixedCellHeight( sal_Bool bUseFixedCellHeight );
+
+ void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir );
+ EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const;
+
+ sal_uInt16 GetScriptType( const ESelection& rSelection ) const;
+ LanguageType GetLanguage(const EditPaM& rPaM) const;
+ LanguageType GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const;
+
+ void TransliterateText( const ESelection& rSelection, sal_Int32 nTransliterationMode );
+ EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode );
+
+ void SetAsianCompressionMode( sal_uInt16 nCompression );
+
+ void SetKernAsianPunctuation( sal_Bool bEnabled );
+
+ void SetAddExtLeading( sal_Bool b );
+
+ void SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon );
+ void SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B2DPolyPolygon* pLinePolyPolygon);
+ void ClearPolygon();
+
+ const Size& GetMinAutoPaperSize() const;
+ void SetMinAutoPaperSize( const Size& rSz );
+
+ const Size& GetMaxAutoPaperSize() const;
+ void SetMaxAutoPaperSize( const Size& rSz );
+
+ OUString GetText( LineEnd eEnd = LINEEND_LF ) const;
+ String GetText( const ESelection& rSelection, const LineEnd eEnd = LINEEND_LF ) const;
+ sal_uInt32 GetTextLen() const;
+ sal_uInt32 GetTextHeight() const;
+ sal_uInt32 GetTextHeightNTP() const;
+ sal_uInt32 CalcTextWidth();
+
+ String GetText( sal_uInt16 nParagraph ) const;
+ xub_StrLen GetTextLen( sal_uInt16 nParagraph ) const;
+ sal_uInt32 GetTextHeight( sal_uInt16 nParagraph ) const;
+
+ sal_uInt16 GetParagraphCount() const;
+
+ sal_uInt16 GetLineCount( sal_uInt16 nParagraph ) const;
+ xub_StrLen GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
+ void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
+ sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ sal_uInt32 GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine = 0 );
+ ParagraphInfos GetParagraphInfos( sal_uInt16 nPara );
+ sal_uInt16 FindParagraph( long nDocPosY );
+ EPosition FindDocPosition( const Point& rDocPos ) const;
+ Rectangle GetCharacterBounds( const EPosition& rPos ) const;
+
+ String GetWord( sal_uInt16 nPara, xub_StrLen nIndex );
+
+ ESelection GetWord( const ESelection& rSelection, sal_uInt16 nWordType ) const;
+
+ void Clear();
+ void SetText( const OUString& rStr );
+
+ EditTextObject* CreateTextObject();
+ EditTextObject* CreateTextObject( sal_uInt16 nPara, sal_uInt16 nParas = 1 );
+ EditTextObject* CreateTextObject( const ESelection& rESelection );
+ void SetText( const EditTextObject& rTextObject );
+
+ void RemoveParagraph( sal_uInt16 nPara );
+ void InsertParagraph( sal_uInt16 nPara, const EditTextObject& rTxtObj );
+ void InsertParagraph( sal_uInt16 nPara, const String& rText);
+
+ void SetText( sal_uInt16 nPara, const String& rText);
+
+ virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
+ virtual const SfxItemSet& GetParaAttribs( sal_uInt16 nPara ) const;
+
+ void GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const;
+
+ SfxItemSet GetAttribs( sal_uInt16 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags = 0xFF ) const;
+ SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = EditEngineAttribs_All );
+
+ sal_Bool HasParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+ const SfxPoolItem& GetParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich );
+
+ Font GetStandardFont( sal_uInt16 nPara );
+ SvxFont GetStandardSvxFont( sal_uInt16 nPara );
+
+ void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
+
+ void ShowParagraph( sal_uInt16 nParagraph, sal_Bool bShow = sal_True );
+
+ ::svl::IUndoManager&
+ GetUndoManager();
+ void UndoActionStart( sal_uInt16 nId );
+ void UndoActionStart(sal_uInt16 nId, const ESelection& rSel);
+ void UndoActionEnd( sal_uInt16 nId );
+ sal_Bool IsInUndo();
+
+ void EnableUndo( sal_Bool bEnable );
+ sal_Bool IsUndoEnabled();
+
+ /** returns the value last used for bTryMerge while calling ImpEditEngine::InsertUndo
+ This is currently used in a bad but needed hack to get undo actions merged in the
+ OutlineView in impress. Do not use it unless you want to sell your soul too! */
+ bool HasTriedMergeOnLastAddUndo() const;
+
+ void ClearModifyFlag();
+ void SetModified();
+ sal_Bool IsModified() const;
+
+ void SetModifyHdl( const Link& rLink );
+ Link GetModifyHdl() const;
+
+ sal_Bool IsInSelectionMode() const;
+
+ void StripPortions();
+ void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList );
+
+ long GetFirstLineStartX( sal_uInt16 nParagraph );
+ Point GetDocPosTopLeft( sal_uInt16 nParagraph );
+ Point GetDocPos( const Point& rPaperPos ) const;
+ sal_Bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder = 0 );
+
+ // StartDocPos corrresponds to VisArea.TopLeft().
+ void Draw( OutputDevice* pOutDev, const Rectangle& rOutRect );
+ void Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const Point& rStartDocPos );
+ void Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const Point& rStartDocPos, sal_Bool bClip );
+ void Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOrientation = 0 );
+
+// sal_uInt32: Error code of the stream.
+ sal_uLong Read( SvStream& rInput, const String& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = NULL );
+ sal_uLong Write( SvStream& rOutput, EETextFormat );
+
+ void SetStatusEventHdl( const Link& rLink );
+ Link GetStatusEventHdl() const;
+
+ void SetNotifyHdl( const Link& rLink );
+ Link GetNotifyHdl() const;
+
+ void SetImportHdl( const Link& rLink );
+ Link GetImportHdl() const;
+
+ // Do not evaluate font formatting => For Outliner
+ sal_Bool IsFlatMode() const;
+ void SetFlatMode( sal_Bool bFlat );
+
+ void SetControlWord( sal_uInt32 nWord );
+ sal_uInt32 GetControlWord() const;
+
+ void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
+ void QuickRemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich = 0 );
+ void QuickMarkInvalid( const ESelection& rSel );
+ void QuickFormatDoc( sal_Bool bFull = sal_False );
+ void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
+ void QuickInsertLineBreak( const ESelection& rSel );
+ void QuickInsertText( const String& rText, const ESelection& rSel );
+ void QuickDelete( const ESelection& rSel );
+ void QuickMarkToBeRepainted( sal_uInt16 nPara );
+
+ void SetGlobalCharStretching( sal_uInt16 nX = 100, sal_uInt16 nY = 100 );
+ void GetGlobalCharStretching( sal_uInt16& rX, sal_uInt16& rY ) const;
+
+ void SetEditTextObjectPool( SfxItemPool* pPool );
+ SfxItemPool* GetEditTextObjectPool() const;
+
+ void SetStyleSheetPool( SfxStyleSheetPool* pSPool );
+ SfxStyleSheetPool* GetStyleSheetPool();
+
+ void SetStyleSheet(const EditSelection& aSel, SfxStyleSheet* pStyle);
+ void SetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle );
+ const SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara ) const;
+ SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara );
+
+ void SetWordDelimiters( const String& rDelimiters );
+ String GetWordDelimiters() const;
+
+ void EraseVirtualDevice();
+
+ void SetSpeller( ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > &xSpeller );
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 >
+ GetSpeller();
+ void SetHyphenator( ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenator >& xHyph );
+
+ void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars );
+
+ void SetDefaultLanguage( LanguageType eLang );
+ LanguageType GetDefaultLanguage() const;
+
+ sal_Bool HasOnlineSpellErrors() const;
+ void CompleteOnlineSpelling();
+
+ sal_Bool ShouldCreateBigTextObject() const;
+
+ // For fast Pre-Test without view:
+ EESpellState HasSpellErrors();
+ sal_Bool HasText( const SvxSearchItem& rSearchItem );
+
+ //initialize sentence spelling
+ void StartSpelling(EditView& rEditView, sal_Bool bMultipleDoc);
+ //spell and return a sentence
+ bool SpellSentence(EditView& rEditView, ::svx::SpellPortions& rToFill, bool bIsGrammarChecking );
+ // put spell position to start of current sentence
+ void PutSpellingToSentenceStart( EditView& rEditView );
+ //applies a changed sentence
+ void ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bRecheck );
+
+ // for text conversion (see also HasSpellErrors)
+ sal_Bool HasConvertibleTextPortion( LanguageType nLang );
+ virtual sal_Bool ConvertNextDocument();
+
+ bool UpdateFields();
+ bool UpdateFieldsOnly();
+ void RemoveFields( sal_Bool bKeepFieldText, TypeId aType = NULL );
+
+ sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
+ EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
+
+ sal_Bool IsRightToLeft( sal_uInt16 nPara ) const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
+ CreateTransferable( const ESelection& rSelection ) const;
+
+ // MT: Can't create new virtual functions like for ParagraphInserted/Deleted, musst be compatible in SRC638, change later...
+ void SetBeginMovingParagraphsHdl( const Link& rLink );
+ void SetEndMovingParagraphsHdl( const Link& rLink );
+ void SetBeginPasteOrDropHdl( const Link& rLink );
+ void SetEndPasteOrDropHdl( const Link& rLink );
+
+ virtual void PaintingFirstLine( sal_uInt16 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev );
+ virtual void ParagraphInserted( sal_uInt16 nNewParagraph );
+ virtual void ParagraphDeleted( sal_uInt16 nDeletedParagraph );
+ virtual void ParagraphConnected( sal_uInt16 nLeftParagraph, sal_uInt16 nRightParagraph );
+ virtual void ParaAttribsChanged( sal_uInt16 nParagraph );
+ virtual void StyleSheetChanged( SfxStyleSheet* pStyle );
+ virtual void ParagraphHeightChanged( sal_uInt16 nPara );
+
+ virtual void DrawingText(
+ const Point& rStartPos, const String& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, const sal_Int32* pDXArray,
+ const SvxFont& rFont, sal_uInt16 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
+ const EEngineData::WrongSpellVector* pWrongSpellVector,
+ const SvxFieldData* pFieldData,
+ bool bEndOfLine,
+ bool bEndOfParagraph,
+ bool bEndOfBullet,
+ const ::com::sun::star::lang::Locale* pLocale,
+ const Color& rOverlineColor,
+ const Color& rTextLineColor);
+
+ virtual void DrawingTab(
+ const Point& rStartPos, long nWidth, const String& rChar,
+ const SvxFont& rFont, sal_uInt16 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
+ bool bEndOfLine,
+ bool bEndOfParagraph,
+ const Color& rOverlineColor,
+ const Color& rTextLineColor);
+ virtual String GetUndoComment( sal_uInt16 nUndoId ) const;
+ virtual sal_Bool FormattingParagraph( sal_uInt16 nPara );
+ virtual sal_Bool SpellNextDocument();
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
+ virtual void FieldSelected( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
+ virtual String CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos, Color*& rTxtColor, Color*& rFldColor );
+
+ // to be overloaded if access to bullet information needs to be provided
+ virtual const SvxNumberFormat * GetNumberFormat( sal_uInt16 nPara ) const;
+
+ virtual Rectangle GetBulletArea( sal_uInt16 nPara );
+
+ static SfxItemPool* CreatePool( sal_Bool bLoadRefCounts = sal_True );
+ static SfxItemPool& GetGlobalItemPool();
+ static sal_Bool DoesKeyChangeText( const KeyEvent& rKeyEvent );
+ static sal_Bool DoesKeyMoveCursor( const KeyEvent& rKeyEvent );
+ static sal_Bool IsSimpleCharInput( const KeyEvent& rKeyEvent );
+ static void SetFontInfoInItemSet( SfxItemSet& rItemSet, const Font& rFont );
+ static void SetFontInfoInItemSet( SfxItemSet& rItemSet, const SvxFont& rFont );
+ static Font CreateFontFromItemSet( const SfxItemSet& rItemSet, sal_uInt16 nScriptType );
+ static SvxFont CreateSvxFontFromItemSet( const SfxItemSet& rItemSet );
+ static sal_Bool IsPrintable( sal_Unicode c ) { return ( ( c >= 32 ) && ( c != 127 ) ); }
+ static sal_Bool HasValidData( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rTransferable );
+
+ /** sets a link that is called at the beginning of a drag operation at an edit view */
+ void SetBeginDropHdl( const Link& rLink );
+ Link GetBeginDropHdl() const;
+
+ /** sets a link that is called at the end of a drag operation at an edit view */
+ void SetEndDropHdl( const Link& rLink );
+ Link GetEndDropHdl() const;
+
+ /// specifies if auto-correction should capitalize the first word or not (default is on)
+ void SetFirstWordCapitalization( sal_Bool bCapitalize );
+
+ EditDoc& GetEditDoc();
+ const EditDoc& GetEditDoc() const;
+
+ ParaPortionList& GetParaPortions();
+ const ParaPortionList& GetParaPortions() const;
+
+ bool IsFormatted() const;
+ bool IsImportHandlerSet() const;
+ bool IsImportRTFStyleSheetsSet() const;
+
+ void CallImportHandler(ImportInfo& rInfo);
+
+ void ParaAttribsToCharAttribs(ContentNode* pNode);
+
+ EditPaM CreateEditPaM(const EPaM& rEPaM);
+ EditPaM ConnectParagraphs(
+ ContentNode* pLeft, ContentNode* pRight, bool bBackward = false);
+
+ EditPaM InsertField(const EditSelection& rEditSelection, const SvxFieldItem& rFld);
+ EditPaM InsertText(const EditSelection& aCurEditSelection, const String& rStr);
+ EditSelection InsertText(const EditTextObject& rTextObject, const EditSelection& rSel);
+ EditPaM InsertParaBreak(
+ const EditSelection& rEditSelection, bool bKeepEndingAttribs = true);
+ EditPaM InsertLineBreak(const EditSelection& rEditSelection);
+
+ EditPaM CursorLeft(
+ const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = com::sun::star::i18n::CharacterIteratorMode::SKIPCELL);
+ EditPaM CursorRight(
+ const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = com::sun::star::i18n::CharacterIteratorMode::SKIPCELL);
+
+ void SeekCursor(
+ ContentNode* pNode, sal_uInt16 nPos, SvxFont& rFont, OutputDevice* pOut = NULL, sal_uInt16 nIgnoreWhich = 0);
+
+ EditPaM DeleteSelection(const EditSelection& rSel);
+
+ ESelection CreateESelection(const EditSelection& rSel);
+ EditSelection CreateSelection(const ESelection& rSel);
+
+ const SfxItemSet& GetBaseParaAttribs(sal_uInt16 nPara) const;
+ void SetParaAttribsOnly(sal_uInt16 nPara, const SfxItemSet& rSet);
+ void SetAttribs(const EditSelection& rSel, const SfxItemSet& rSet, sal_uInt8 nSpecial = 0);
+
+ String GetSelected(const EditSelection& rSel, const LineEnd eParaSep = LINEEND_LF) const;
+ EditPaM DeleteSelected(const EditSelection& rSel);
+
+ sal_uInt16 GetScriptType(const EditSelection& rSel) const;
+
+ void RemoveParaPortion(size_t nNode);
+
+ void SetCallParaInsertedOrDeleted(bool b);
+ bool IsCallParaInsertedOrDeleted() const;
+
+ void AppendDeletedNodeInfo(DeletedNodeInfo* pInfo);
+ void UpdateSelections();
+
+ void InsertContent(ContentNode* pNode, sal_uInt16 nPos);
+ EditPaM SplitContent(sal_uInt16 nNode, sal_uInt16 nSepPos);
+ EditPaM ConnectContents(sal_uInt16 nLeftNode, bool bBackward);
+
+ EditPaM InsertFeature(const EditSelection& rEditSelection, const SfxPoolItem& rItem);
+
+ EditSelection MoveParagraphs(const Range& rParagraphs, sal_uInt16 nNewPos, EditView* pCurView);
+
+ void RemoveCharAttribs(sal_uInt16 nPara, sal_uInt16 nWhich = 0, bool bRemoveFeatures = false);
+ void RemoveCharAttribs(const EditSelection& rSel, bool bRemoveParaAttribs, sal_uInt16 nWhich = 0);
+
+ ViewsType& GetEditViews();
+ const ViewsType& GetEditViews() const;
+
+ void SetUndoMode(bool b);
+ void FormatAndUpdate(EditView* pCurView = NULL);
+
+ bool Undo(EditView* pView);
+ bool Redo(EditView* pView);
+};
+
+#endif // _MyEDITENG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/editengdllapi.h b/include/editeng/editengdllapi.h
new file mode 100644
index 000000000000..ce764e81fece
--- /dev/null
+++ b/include/editeng/editengdllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_EDITENGDLLAPI_H
+#define INCLUDED_EDITENGDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(EDITENG_DLLIMPLEMENTATION)
+#define EDITENG_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define EDITENG_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define EDITENG_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/editerr.hxx b/include/editeng/editerr.hxx
new file mode 100644
index 000000000000..d262057763e7
--- /dev/null
+++ b/include/editeng/editerr.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 _EDIT_ERR_HRC
+#define _EDIT_ERR_HRC
+
+#include <tools/errcode.hxx>
+
+#define ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS (2UL | ERRCODE_AREA_SVX)
+
+#define ERRCODE_SVX_GRAPHIC_WRONG_FILEFORMAT (8UL | ERRCODE_AREA_SVX | \
+ ERRCODE_CLASS_READ )
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/editids.hrc b/include/editeng/editids.hrc
new file mode 100644
index 000000000000..7dbaae890a51
--- /dev/null
+++ b/include/editeng/editids.hrc
@@ -0,0 +1,236 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _EDIT_SVXIDS_HRC
+#define _EDIT_SVXIDS_HRC
+
+#include <svl/solar.hrc>
+
+#define SID_ATTR_BRUSH ( SID_SVX_START + 1 )
+#define SID_ATTR_TABSTOP ( SID_SVX_START + 2 )
+#define SID_ATTR_TABSTOP_DEFAULTS ( SID_SVX_START + 3 )
+#define SID_ATTR_TABSTOP_POS ( SID_SVX_START + 4 )
+#define SID_ATTR_TABSTOP_OFFSET ( SID_SVX_START + 5 )
+#define SID_ATTR_CHAR ( SID_SVX_START + 6 )
+#define SID_ATTR_CHAR_FONT ( SID_SVX_START + 7 )
+#define SID_ATTR_CHAR_POSTURE ( SID_SVX_START + 8 )
+#define SID_ATTR_CHAR_WEIGHT ( SID_SVX_START + 9 )
+#define SID_ATTR_CHAR_SHADOWED ( SID_SVX_START + 10 )
+#define SID_ATTR_CHAR_WORDLINEMODE ( SID_SVX_START + 11 )
+#define SID_ATTR_CHAR_CONTOUR ( SID_SVX_START + 12 )
+#define SID_ATTR_CHAR_STRIKEOUT ( SID_SVX_START + 13 )
+#define SID_ATTR_CHAR_UNDERLINE ( SID_SVX_START + 14 )
+#define SID_ATTR_CHAR_FONTHEIGHT ( SID_SVX_START + 15 )
+#define SID_ATTR_CHAR_PROPSIZE ( SID_SVX_START + 16 )
+#define SID_ATTR_CHAR_COLOR ( SID_SVX_START + 17 )
+#define SID_ATTR_CHAR_KERNING ( SID_SVX_START + 18 )
+#define SID_ATTR_CHAR_CASEMAP ( SID_SVX_START + 19 )
+#define SID_ATTR_CHAR_LANGUAGE ( SID_SVX_START + 20 )
+#define SID_ATTR_CHAR_ESCAPEMENT ( SID_SVX_START + 21 )
+#define SID_ATTR_CHAR_FONTLIST ( SID_SVX_START + 22 )
+#define SID_ATTR_BORDER_OUTER ( SID_SVX_START + 24 )
+#define SID_ATTR_BORDER_SHADOW ( SID_SVX_START + 25 )
+#define SID_ATTR_PARA ( SID_SVX_START + 26 )
+#define SID_ATTR_PARA_ADJUST ( SID_SVX_START + 27 )
+#define SID_ATTR_PARA_ADJUST_LEFT ( SID_SVX_START + 28 )
+#define SID_ATTR_PARA_ADJUST_RIGHT ( SID_SVX_START + 29 )
+#define SID_ATTR_PARA_ADJUST_CENTER ( SID_SVX_START + 30 )
+#define SID_ATTR_PARA_ADJUST_BLOCK ( SID_SVX_START + 31 )
+#define SID_ATTR_PARA_ADJUST_BLOCKLINE ( SID_SVX_START + 32 )
+#define SID_ATTR_PARA_LINESPACE ( SID_SVX_START + 33 )
+#define SID_ATTR_PARA_LINESPACE_10 ( SID_SVX_START + 34 )
+#define SID_ATTR_PARA_LINESPACE_15 ( SID_SVX_START + 35 )
+#define SID_ATTR_PARA_LINESPACE_20 ( SID_SVX_START + 36 )
+#define SID_ATTR_PARA_PAGEBREAK ( SID_SVX_START + 37 )
+#define SID_ATTR_PARA_HYPHENZONE ( SID_SVX_START + 38 )
+#define SID_ATTR_PARA_SPLIT ( SID_SVX_START + 39 )
+#define SID_ATTR_PARA_ORPHANS ( SID_SVX_START + 40 )
+#define SID_ATTR_PARA_WIDOWS ( SID_SVX_START + 41 )
+#define SID_ATTR_PARA_ULSPACE ( SID_SVX_START + 42 )
+#define SID_ATTR_PARA_LRSPACE ( SID_SVX_START + 43 )
+#define SID_ATTR_LRSPACE ( SID_SVX_START + 48 )
+#define SID_ATTR_ULSPACE ( SID_SVX_START + 49 )
+#define SID_ATTR_CHAR_MAPTYPE ( SID_SVX_START + 64 )
+#define SID_ATTR_PARA_MODEL ( SID_SVX_START + 65 )
+#define SID_ATTR_PARA_KEEP ( SID_SVX_START + 66 )
+#define SID_ATTR_CHAR_AUTOKERN ( SID_SVX_START + 67 )
+#define SID_ATTR_PARA_BULLET ( SID_SVX_START + 250 )
+#define SID_ATTR_PARA_OUTLLEVEL ( SID_SVX_START + 300 )
+#define SID_FIELD ( SID_SVX_START + 363 )
+#define SID_ATTR_PARA_REGISTER ( SID_SVX_START + 413 )
+#define SID_ATTR_PARA_PAGENUM ( SID_SVX_START + 457 )
+#define SID_ATTR_PARA_NUMRULE ( SID_SVX_START + 587 )
+#define SID_ATTR_BRUSH_CHAR ( SID_SVX_START + 591 )
+#define SID_ATTR_NUMBERING_RULE ( SID_SVX_START + 855 )
+#define SID_ATTR_CHAR_CHARSETCOLOR ( SID_SVX_START + 877 )
+#define SID_ATTR_CHAR_CJK_FONT ( SID_SVX_START + 887 )
+#define SID_ATTR_CHAR_CJK_FONTHEIGHT ( SID_SVX_START + 888 )
+#define SID_ATTR_CHAR_CJK_LANGUAGE ( SID_SVX_START + 889 )
+#define SID_ATTR_CHAR_CJK_POSTURE ( SID_SVX_START + 890 )
+#define SID_ATTR_CHAR_CJK_WEIGHT ( SID_SVX_START + 891 )
+#define SID_ATTR_CHAR_CTL_FONT ( SID_SVX_START + 892 )
+#define SID_ATTR_CHAR_CTL_FONTHEIGHT ( SID_SVX_START + 893 )
+#define SID_ATTR_CHAR_CTL_LANGUAGE ( SID_SVX_START + 894 )
+#define SID_ATTR_CHAR_CTL_POSTURE ( SID_SVX_START + 895 )
+#define SID_ATTR_CHAR_CTL_WEIGHT ( SID_SVX_START + 896 )
+#define SID_ATTR_CHAR_TWO_LINES ( SID_SVX_START + 897 )
+#define SID_ATTR_CHAR_CJK_RUBY ( SID_SVX_START + 898 )
+#define SID_ATTR_CHAR_EMPHASISMARK ( SID_SVX_START + 899 )
+#define SID_ATTR_CHAR_SCRIPTTYPE ( SID_SVX_START + 900 )
+#define SID_ATTR_PARA_SCRIPTSPACE ( SID_SVX_START + 901 )
+#define SID_ATTR_PARA_HANGPUNCTUATION ( SID_SVX_START + 902 )
+#define SID_ATTR_PARA_FORBIDDEN_RULES ( SID_SVX_START + 903 )
+#define SID_ATTR_CHAR_VERTICAL ( SID_SVX_START + 905 )
+#define SID_ATTR_CHAR_ROTATED ( SID_SVX_START + 910 )
+#define SID_ATTR_CHAR_SCALEWIDTH ( SID_SVX_START + 911 )
+#define SID_ATTR_CHAR_WIDTH_FIT_TO_LINE ( SID_SVX_START + 919 )
+#define SID_ATTR_CHAR_RELIEF ( SID_SVX_START + 920 )
+#define SID_PARA_VERTALIGN ( SID_SVX_START + 925 )
+#define SID_ATTR_FRAMEDIRECTION ( SID_SVX_START + 944 )
+#define SID_ATTR_PARA_SNAPTOGRID ( SID_SVX_START + 945 )
+#define SID_ATTR_PARA_LRSPACE_VERTICAL ( SID_SVX_START + 947 )
+#define SID_ATTR_PARA_LEFT_TO_RIGHT ( SID_SVX_START + 950 )
+#define SID_ATTR_PARA_RIGHT_TO_LEFT ( SID_SVX_START + 951 )
+#define SID_ATTR_CHAR_HIDDEN ( SID_SVX_START + 989 )
+#define SID_ATTR_CHAR_LATIN_FONT ( SID_SVX_START + 994 )
+#define SID_ATTR_CHAR_LATIN_FONTHEIGHT ( SID_SVX_START + 995 )
+#define SID_ATTR_CHAR_LATIN_LANGUAGE ( SID_SVX_START + 996 )
+#define SID_ATTR_CHAR_LATIN_POSTURE ( SID_SVX_START + 997 )
+#define SID_ATTR_CHAR_LATIN_WEIGHT ( SID_SVX_START + 998 )
+#define SID_ATTR_PARA_OUTLINE_LEVEL ( SID_SVX_START + 1121 )
+#define SID_ATTR_CHAR_PREVIEW_FONT ( SID_SVX_START + 1122 )
+#define SID_ATTR_CHAR_ENDPREVIEW_FONT ( SID_SVX_START + 1123 )
+
+
+// this ID didn't exist prior to the svx split
+#define SID_ATTR_CHAR_OVERLINE ( SID_EDIT_START + 68 )
+#define SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD ( SID_EDIT_START + 69 )
+#define SID_ATTR_ALIGN_VER_JUSTIFY_METHOD ( SID_EDIT_START + 70 )
+#define SID_ATTR_ALIGN_HOR_JUSTIFY ( SID_EDIT_START + 71 )
+#define SID_ATTR_ALIGN_VER_JUSTIFY ( SID_EDIT_START + 72 )
+
+/*
+// planned, but not doable: changing value of SIDs will break code that uses them for WhichRanges
+#define SID_PARA_VERTALIGN ( SID_EDIT_START )
+#define SID_ATTR_BORDER_OUTER ( SID_EDIT_START + 1 )
+#define SID_ATTR_BORDER_SHADOW ( SID_EDIT_START + 2 )
+#define SID_ATTR_BRUSH ( SID_EDIT_START + 3 )
+#define SID_ATTR_BRUSH_CHAR ( SID_EDIT_START + 4 )
+
+
+#define SID_FIELD ( SID_EDIT_START + 7 )
+#define SID_ATTR_FRAMEDIRECTION ( SID_EDIT_START + 8 )
+#define SID_ATTR_PARA ( SID_EDIT_START + 9 )
+#define SID_ATTR_PARA_ADJUST ( SID_EDIT_START + 10 )
+#define SID_ATTR_PARA_ADJUST_LEFT ( SID_EDIT_START + 11 )
+#define SID_ATTR_PARA_BULLET ( SID_EDIT_START + 12 )
+#define SID_ATTR_PARA_OUTLLEVEL ( SID_EDIT_START + 13 )
+#define SID_ATTR_PARA_REGISTER ( SID_EDIT_START + 14 )
+#define SID_ATTR_PARA_PAGENUM ( SID_EDIT_START + 15 )
+#define SID_ATTR_PARA_NUMRULE ( SID_EDIT_START + 16 )
+#define SID_ATTR_PARA_SCRIPTSPACE ( SID_EDIT_START + 17 )
+#define SID_ATTR_PARA_HANGPUNCTUATION ( SID_EDIT_START + 18 )
+#define SID_ATTR_PARA_FORBIDDEN_RULES ( SID_EDIT_START + 19 )
+#define SID_ATTR_PARA_SNAPTOGRID ( SID_EDIT_START + 20 )
+#define SID_ATTR_PARA_LRSPACE_VERTICAL ( SID_EDIT_START + 21 )
+#define SID_ATTR_PARA_LEFT_TO_RIGHT ( SID_EDIT_START + 22 )
+#define SID_ATTR_PARA_RIGHT_TO_LEFT ( SID_EDIT_START + 23 )
+#define SID_ATTR_PARA_OUTLINE_LEVEL ( SID_EDIT_START + 24 )
+#define SID_ATTR_PARA_ADJUST_RIGHT ( SID_EDIT_START + 25 )
+#define SID_ATTR_PARA_ADJUST_CENTER ( SID_EDIT_START + 26 )
+#define SID_ATTR_PARA_ADJUST_BLOCK ( SID_EDIT_START + 27 )
+#define SID_ATTR_PARA_ADJUST_BLOCKLINE ( SID_EDIT_START + 28 )
+#define SID_ATTR_PARA_LINESPACE ( SID_EDIT_START + 29 )
+#define SID_ATTR_PARA_LINESPACE_10 ( SID_EDIT_START + 30 )
+#define SID_ATTR_PARA_LINESPACE_15 ( SID_EDIT_START + 31 )
+#define SID_ATTR_PARA_LINESPACE_20 ( SID_EDIT_START + 32 )
+#define SID_ATTR_PARA_PAGEBREAK ( SID_EDIT_START + 33 )
+#define SID_ATTR_PARA_HYPHENZONE ( SID_EDIT_START + 34 )
+#define SID_ATTR_PARA_SPLIT ( SID_EDIT_START + 35 )
+#define SID_ATTR_PARA_ORPHANS ( SID_EDIT_START + 36 )
+#define SID_ATTR_PARA_WIDOWS ( SID_EDIT_START + 37 )
+#define SID_ATTR_PARA_ULSPACE ( SID_EDIT_START + 38 )
+#define SID_ATTR_PARA_LRSPACE ( SID_EDIT_START + 39 )
+#define SID_ATTR_PARA_MODEL ( SID_EDIT_START + 40 )
+#define SID_ATTR_PARA_KEEP ( SID_EDIT_START + 41 )
+#define SID_ATTR_NUMBERING_RULE ( SID_EDIT_START + 42 )
+#define SID_ATTR_LRSPACE ( SID_EDIT_START + 43 )
+#define SID_ATTR_ULSPACE ( SID_EDIT_START + 44 )
+#define SID_ATTR_TABSTOP ( SID_EDIT_START + 45 )
+#define SID_ATTR_TABSTOP_DEFAULTS ( SID_EDIT_START + 46 )
+#define SID_ATTR_TABSTOP_POS ( SID_EDIT_START + 47 )
+#define SID_ATTR_TABSTOP_OFFSET ( SID_EDIT_START + 48 )
+#define SID_ATTR_CHAR ( SID_EDIT_START + 49 )
+#define SID_ATTR_CHAR_FONT ( SID_EDIT_START + 50 )
+#define SID_ATTR_CHAR_POSTURE ( SID_EDIT_START + 51 )
+#define SID_ATTR_CHAR_WEIGHT ( SID_EDIT_START + 52 )
+#define SID_ATTR_CHAR_SHADOWED ( SID_EDIT_START + 53 )
+#define SID_ATTR_CHAR_WORDLINEMODE ( SID_EDIT_START + 54 )
+#define SID_ATTR_CHAR_CONTOUR ( SID_EDIT_START + 55 )
+#define SID_ATTR_CHAR_STRIKEOUT ( SID_EDIT_START + 56 )
+#define SID_ATTR_CHAR_UNDERLINE ( SID_EDIT_START + 57 )
+#define SID_ATTR_CHAR_FONTHEIGHT ( SID_EDIT_START + 58 )
+#define SID_ATTR_CHAR_PROPSIZE ( SID_EDIT_START + 59 )
+#define SID_ATTR_CHAR_COLOR ( SID_EDIT_START + 60 )
+#define SID_ATTR_CHAR_KERNING ( SID_EDIT_START + 61 )
+#define SID_ATTR_CHAR_CASEMAP ( SID_EDIT_START + 62 )
+#define SID_ATTR_CHAR_LANGUAGE ( SID_EDIT_START + 63 )
+#define SID_ATTR_CHAR_ESCAPEMENT ( SID_EDIT_START + 64 )
+#define SID_ATTR_CHAR_FONTLIST ( SID_EDIT_START + 65 )
+#define SID_ATTR_CHAR_MAPTYPE ( SID_EDIT_START + 66 )
+#define SID_ATTR_CHAR_AUTOKERN ( SID_EDIT_START + 67 )
+#define SID_ATTR_CHAR_OVERLINE ( SID_EDIT_START + 68 )
+#define SID_ATTR_CHAR_CHARSETCOLOR ( SID_EDIT_START + 69 )
+#define SID_ATTR_CHAR_CJK_FONT ( SID_EDIT_START + 70 )
+#define SID_ATTR_CHAR_CJK_FONTHEIGHT ( SID_EDIT_START + 71 )
+#define SID_ATTR_CHAR_CJK_LANGUAGE ( SID_EDIT_START + 72 )
+#define SID_ATTR_CHAR_CJK_POSTURE ( SID_EDIT_START + 73 )
+#define SID_ATTR_CHAR_CJK_WEIGHT ( SID_EDIT_START + 74 )
+#define SID_ATTR_CHAR_CTL_FONT ( SID_EDIT_START + 75 )
+#define SID_ATTR_CHAR_CTL_FONTHEIGHT ( SID_EDIT_START + 76 )
+#define SID_ATTR_CHAR_CTL_LANGUAGE ( SID_EDIT_START + 77 )
+#define SID_ATTR_CHAR_CTL_POSTURE ( SID_EDIT_START + 78 )
+#define SID_ATTR_CHAR_CTL_WEIGHT ( SID_EDIT_START + 79 )
+#define SID_ATTR_CHAR_TWO_LINES ( SID_EDIT_START + 80 )
+#define SID_ATTR_CHAR_CJK_RUBY ( SID_EDIT_START + 81 )
+#define SID_ATTR_CHAR_EMPHASISMARK ( SID_EDIT_START + 82 )
+#define SID_ATTR_CHAR_SCRIPTTYPE ( SID_EDIT_START + 83 )
+#define SID_ATTR_CHAR_VERTICAL ( SID_EDIT_START + 84 )
+#define SID_ATTR_CHAR_ROTATED ( SID_EDIT_START + 85 )
+#define SID_ATTR_CHAR_SCALEWIDTH ( SID_EDIT_START + 86 )
+#define SID_ATTR_CHAR_WIDTH_FIT_TO_LINE ( SID_EDIT_START + 87 )
+#define SID_ATTR_CHAR_RELIEF ( SID_EDIT_START + 88 )
+#define SID_ATTR_CHAR_HIDDEN ( SID_EDIT_START + 89 )
+#define SID_ATTR_CHAR_LATIN_FONT ( SID_EDIT_START + 90 )
+#define SID_ATTR_CHAR_LATIN_FONTHEIGHT ( SID_EDIT_START + 91 )
+#define SID_ATTR_CHAR_LATIN_LANGUAGE ( SID_EDIT_START + 92 )
+#define SID_ATTR_CHAR_LATIN_POSTURE ( SID_EDIT_START + 93 )
+#define SID_ATTR_CHAR_LATIN_WEIGHT ( SID_EDIT_START + 94 )
+*/
+
+#if 94 > (SID_EDIT_END-SID_EDIT_START)
+#error Resource-Ueberlauf in #line, #file
+#endif
+
+#define SID_DRAW_TEXT_VERTICAL SID_ATTR_CHAR_VERTICAL
+
+#endif
+
+// ******************************************************************* EOF
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/editobj.hxx b/include/editeng/editobj.hxx
new file mode 100644
index 000000000000..16bc0be626e5
--- /dev/null
+++ b/include/editeng/editobj.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 _EDITOBJ_HXX
+#define _EDITOBJ_HXX
+
+#include <tools/stream.hxx>
+#include <tools/debug.hxx>
+#include <rsc/rscsfx.hxx>
+#include <svl/itemset.hxx>
+#include "svl/itempool.hxx"
+#include <editeng/eeitem.hxx>
+#include <editeng/editdata.hxx>
+#include "editeng/editengdllapi.h"
+#include "editeng/macros.hxx"
+
+#include <com/sun/star/text/textfield/Type.hpp>
+
+#include <vector>
+
+DBG_NAMEEX( EE_EditTextObject )
+
+class SfxItemPool;
+class SfxStyleSheetPool;
+class SvxFieldItem;
+class SvxFieldData;
+
+namespace editeng {
+
+class FieldUpdater;
+class FieldUpdaterImpl;
+
+}
+
+class EditTextObjectImpl;
+
+class EDITENG_DLLPUBLIC EditTextObject : public SfxItemPoolUser
+{
+ friend class EditTextObjectImpl;
+ friend class editeng::FieldUpdaterImpl;
+ friend class ImpEditEngine;
+
+ EditTextObjectImpl* mpImpl;
+
+ EDITENG_DLLPRIVATE EditTextObject& operator=( const EditTextObject& );
+
+ EditTextObject(); // disabled
+
+ EditTextObject( SfxItemPool* pPool );
+
+ void StoreData( SvStream& rStrm ) const;
+ void CreateData( SvStream& rStrm );
+
+public:
+ EditTextObject( const EditTextObject& r );
+ virtual ~EditTextObject();
+
+ sal_uInt16 GetUserType() const; // For OutlinerMode, it can however not save in compatible format
+ void SetUserType( sal_uInt16 n );
+
+ bool IsVertical() const;
+ void SetVertical( bool bVertical );
+
+ sal_uInt16 GetScriptType() const;
+
+ EditTextObject* Clone() const;
+
+ bool Store( SvStream& rOStream ) const;
+
+ static EditTextObject* Create(
+ SvStream& rIStream, SfxItemPool* pGlobalTextObjectPool = NULL );
+
+ size_t GetParagraphCount() const;
+
+ String GetText(size_t nPara) const;
+
+ void ClearPortionInfo();
+
+ bool HasOnlineSpellErrors() const;
+
+ void GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const;
+
+ bool RemoveCharAttribs( sal_uInt16 nWhich = 0 );
+
+ bool IsFieldObject() const;
+ const SvxFieldItem* GetField() const;
+ const SvxFieldData* GetFieldData(size_t nPara, size_t nPos, sal_Int32 nType) const;
+ bool HasField( sal_Int32 nType = com::sun::star::text::textfield::Type::UNSPECIFIED ) const;
+
+ const SfxItemSet& GetParaAttribs(size_t nPara) const;
+
+ void GetStyleSheet(size_t nPara, String& rName, SfxStyleFamily& eFamily) const;
+ void SetStyleSheet(size_t nPara, const String& rName, const SfxStyleFamily& eFamily);
+ bool ChangeStyleSheets(
+ const XubString& rOldName, SfxStyleFamily eOldFamily, const XubString& rNewName, SfxStyleFamily eNewFamily );
+ void ChangeStyleSheetName( SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName );
+
+ editeng::FieldUpdater GetFieldUpdater();
+
+ bool operator==( const EditTextObject& rCompare ) const;
+
+ // #i102062#
+ bool isWrongListEqual(const EditTextObject& rCompare) const;
+
+ virtual void ObjectInDestruction(const SfxItemPool& rSfxItemPool);
+
+#if DEBUG_EDIT_ENGINE
+ void Dump() const;
+#endif
+};
+
+#endif // _EDITOBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/editrids.hrc b/include/editeng/editrids.hrc
new file mode 100644
index 000000000000..04ec3b6eccc7
--- /dev/null
+++ b/include/editeng/editrids.hrc
@@ -0,0 +1,395 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _EDIT_RIDS_HRC
+#define _EDIT_RIDS_HRC
+
+#include <svl/solar.hrc>
+
+// strings also used in cui
+#define RID_SVXSTR_PAPERBIN_SETTINGS (RID_EDIT_START)
+#define RID_SVXSTR_PAPERBIN (RID_EDIT_START + 1)
+
+#define RID_OUTLUNDO_EXPAND (RID_EDIT_START + 2)
+#define RID_OUTLUNDO_COLLAPSE (RID_EDIT_START + 3)
+#define RID_OUTLUNDO_ATTR (RID_EDIT_START + 4)
+#define RID_OUTLUNDO_INSERT (RID_EDIT_START + 5)
+#define RID_OUTLUNDO_DEPTH (RID_EDIT_START + 6)
+#define RID_OUTLUNDO_HEIGHT (RID_EDIT_START + 7)
+
+// strings for items
+
+#define RID_SVXITEMS_FRMDIR_BEGIN (RID_EDIT_START + 9)
+#define RID_SVXITEMS_FRMDIR_HORI_LEFT_TOP (RID_EDIT_START + 9)
+#define RID_SVXITEMS_FRMDIR_HORI_RIGHT_TOP (RID_EDIT_START + 10)
+#define RID_SVXITEMS_FRMDIR_VERT_TOP_RIGHT (RID_EDIT_START + 11)
+#define RID_SVXITEMS_FRMDIR_VERT_TOP_LEFT (RID_EDIT_START + 12)
+#define RID_SVXITEMS_FRMDIR_ENVIRONMENT (RID_EDIT_START + 13)
+// RID_SVXITEMS_FRMDIR_END (RID_EDIT_START + 14)
+
+#define RID_SVXITEMS_TRUE (RID_EDIT_START + 15)
+#define RID_SVXITEMS_FALSE (RID_EDIT_START + 16)
+#define RID_SVXITEMS_BORDER_COMPLETE (RID_EDIT_START + 17)
+#define RID_SVXITEMS_BORDER_TOP (RID_EDIT_START + 18)
+#define RID_SVXITEMS_BORDER_BOTTOM (RID_EDIT_START + 19)
+#define RID_SVXITEMS_BORDER_LEFT (RID_EDIT_START + 20)
+#define RID_SVXITEMS_BORDER_RIGHT (RID_EDIT_START + 21)
+#define RID_SVXITEMS_BORDER_DISTANCE (RID_EDIT_START + 22)
+#define RID_SVXITEMS_BORDER_NONE (RID_EDIT_START + 23)
+
+#define RID_SVXITEMS_TRANSPARENT_TRUE (RID_EDIT_START + 24)
+#define RID_SVXITEMS_TRANSPARENT_FALSE (RID_EDIT_START + 25)
+#define RID_SVXITEMS_OPAQUE_TRUE (RID_EDIT_START + 26)
+#define RID_SVXITEMS_OPAQUE_FALSE (RID_EDIT_START + 27)
+
+#define RID_SVXITEMS_SHADOW_COMPLETE (RID_EDIT_START + 28)
+#define RID_SVXITEMS_GRAPHIC (RID_EDIT_START + 29)
+#define RID_SVXITEMS_LINES (RID_EDIT_START + 30)
+#define RID_SVXITEMS_ORPHANS_COMPLETE (RID_EDIT_START + 31)
+#define RID_SVXITEMS_WIDOWS_COMPLETE (RID_EDIT_START + 32)
+#define RID_SVXITEMS_PAGEMODEL_COMPLETE (RID_EDIT_START + 33)
+
+#define RID_SVXITEMS_SHADOWED_TRUE (RID_EDIT_START + 34)
+#define RID_SVXITEMS_SHADOWED_FALSE (RID_EDIT_START + 35)
+#define RID_SVXITEMS_AUTOKERN_TRUE (RID_EDIT_START + 36)
+#define RID_SVXITEMS_AUTOKERN_FALSE (RID_EDIT_START + 37)
+#define RID_SVXITEMS_WORDLINE_TRUE (RID_EDIT_START + 38)
+#define RID_SVXITEMS_WORDLINE_FALSE (RID_EDIT_START + 39)
+#define RID_SVXITEMS_CONTOUR_TRUE (RID_EDIT_START + 40)
+#define RID_SVXITEMS_CONTOUR_FALSE (RID_EDIT_START + 41)
+#define RID_SVXITEMS_NOLINEBREAK_TRUE (RID_EDIT_START + 42)
+#define RID_SVXITEMS_NOLINEBREAK_FALSE (RID_EDIT_START + 43)
+#define RID_SVXITEMS_NOHYPHEN_TRUE (RID_EDIT_START + 44)
+#define RID_SVXITEMS_NOHYPHEN_FALSE (RID_EDIT_START + 45)
+#define RID_SVXITEMS_FMTKEEP_TRUE (RID_EDIT_START + 46)
+#define RID_SVXITEMS_FMTKEEP_FALSE (RID_EDIT_START + 47)
+#define RID_SVXITEMS_FMTSPLIT_TRUE (RID_EDIT_START + 48)
+#define RID_SVXITEMS_FMTSPLIT_FALSE (RID_EDIT_START + 49)
+#define RID_SVXITEMS_PRINT_TRUE (RID_EDIT_START + 50)
+#define RID_SVXITEMS_PRINT_FALSE (RID_EDIT_START + 51)
+#define RID_SVXITEMS_PROT_POS_TRUE (RID_EDIT_START + 52)
+#define RID_SVXITEMS_PROT_POS_FALSE (RID_EDIT_START + 53)
+#define RID_SVXITEMS_PROT_SIZE_TRUE (RID_EDIT_START + 54)
+#define RID_SVXITEMS_PROT_SIZE_FALSE (RID_EDIT_START + 55)
+#define RID_SVXITEMS_PROT_CONTENT_TRUE (RID_EDIT_START + 56)
+#define RID_SVXITEMS_PROT_CONTENT_FALSE (RID_EDIT_START + 57)
+#define RID_SVXITEMS_ULSPACE_UPPER (RID_EDIT_START + 58)
+#define RID_SVXITEMS_ULSPACE_LOWER (RID_EDIT_START + 59)
+#define RID_SVXITEMS_LRSPACE_LEFT (RID_EDIT_START + 60)
+#define RID_SVXITEMS_LRSPACE_FLINE (RID_EDIT_START + 62)
+#define RID_SVXITEMS_LRSPACE_RIGHT (RID_EDIT_START + 63)
+#define RID_SVXITEMS_SIZE_WIDTH (RID_EDIT_START + 64)
+#define RID_SVXITEMS_SIZE_HEIGHT (RID_EDIT_START + 65)
+#define RID_SVXITEMS_PAGE_END_TRUE (RID_EDIT_START + 66)
+#define RID_SVXITEMS_PAGE_END_FALSE (RID_EDIT_START + 67)
+#define RID_SVXITEMS_HYPHEN_TRUE (RID_EDIT_START + 68)
+#define RID_SVXITEMS_HYPHEN_FALSE (RID_EDIT_START + 69)
+#define RID_SVXITEMS_HYPHEN_MINLEAD (RID_EDIT_START + 70)
+#define RID_SVXITEMS_HYPHEN_MINTRAIL (RID_EDIT_START + 71)
+#define RID_SVXITEMS_HYPHEN_MAX (RID_EDIT_START + 72)
+#define RID_SVXITEMS_HNGPNCT_OFF (RID_EDIT_START + 73)
+#define RID_SVXITEMS_HNGPNCT_ON (RID_EDIT_START + 74)
+#define RID_SVXITEMS_FORBIDDEN_RULE_OFF (RID_EDIT_START + 75)
+#define RID_SVXITEMS_FORBIDDEN_RULE_ON (RID_EDIT_START + 76)
+#define RID_SVXITEMS_SCRPTSPC_OFF (RID_EDIT_START + 77)
+#define RID_SVXITEMS_SCRPTSPC_ON (RID_EDIT_START + 78)
+#define RID_SVXITEMS_CHARSCALE_OFF (RID_EDIT_START + 79)
+#define RID_SVXITEMS_CHARSCALE (RID_EDIT_START + 80)
+#define RID_SVXITEMS_CHARROTATE_OFF (RID_EDIT_START + 81)
+#define RID_SVXITEMS_CHARROTATE (RID_EDIT_START + 82)
+#define RID_SVXITEMS_CHARROTATE_FITLINE (RID_EDIT_START + 83)
+
+#define RID_SVXITEMS_RELIEF_BEGIN (RID_EDIT_START + 85)
+#define RID_SVXITEMS_RELIEF_NONE (RID_EDIT_START + 85)
+#define RID_SVXITEMS_RELIEF_EMBOSSED (RID_EDIT_START + 86)
+#define RID_SVXITEMS_RELIEF_ENGRAVED (RID_EDIT_START + 87)
+// RID_SVXITEMS_RELIEF_END (RID_EDIT_START + 88)
+
+// HM_ERR
+#define RID_SVXSTR_HMERR_THESAURUS (RID_EDIT_START + 89)
+
+// enum FontEmphasisMark ---------------------------------------------------
+#define RID_SVXITEMS_EMPHASIS_BEGIN_STYLE (RID_EDIT_START + 90)
+#define RID_SVXITEMS_EMPHASIS_NONE_STYLE (RID_EDIT_START + 90)
+#define RID_SVXITEMS_EMPHASIS_DOT_STYLE (RID_EDIT_START + 91)
+#define RID_SVXITEMS_EMPHASIS_CIRCLE_STYLE (RID_EDIT_START + 92)
+#define RID_SVXITEMS_EMPHASIS_DISC_STYLE (RID_EDIT_START + 93)
+#define RID_SVXITEMS_EMPHASIS_ACCENT_STYLE (RID_EDIT_START + 94)
+
+#define RID_SVXITEMS_EMPHASIS_ABOVE_POS (RID_EDIT_START + 95)
+#define RID_SVXITEMS_EMPHASIS_BELOW_POS (RID_EDIT_START + 96)
+
+// enum ESCAPEMENT -------------------------------------------------------
+#define RID_SVXITEMS_ESCAPEMENT_BEGIN (RID_EDIT_START + 97)
+#define RID_SVXITEMS_ESCAPEMENT_OFF (RID_EDIT_START + 97)
+#define RID_SVXITEMS_ESCAPEMENT_SUPER (RID_EDIT_START + 98)
+#define RID_SVXITEMS_ESCAPEMENT_SUB (RID_EDIT_START + 99)
+#define RID_SVXITEMS_ESCAPEMENT_AUTO (RID_EDIT_START + 100)
+
+// enum CASEMAP ----------------------------------------------------------
+#define RID_SVXITEMS_CASEMAP_BEGIN (RID_EDIT_START + 101)
+#define RID_SVXITEMS_CASEMAP_NONE (RID_EDIT_START + 101)
+#define RID_SVXITEMS_CASEMAP_VERSALIEN (RID_EDIT_START + 102)
+#define RID_SVXITEMS_CASEMAP_GEMEINE (RID_EDIT_START + 103)
+#define RID_SVXITEMS_CASEMAP_TITEL (RID_EDIT_START + 104)
+#define RID_SVXITEMS_CASEMAP_KAPITAELCHEN (RID_EDIT_START + 105)
+
+#define RID_SVXITEMS_KERNING_COMPLETE (RID_EDIT_START + 106)
+#define RID_SVXITEMS_KERNING_EXPANDED (RID_EDIT_START + 107)
+#define RID_SVXITEMS_KERNING_CONDENSED (RID_EDIT_START + 108)
+
+#define RID_SVXITEMS_BLINK_TRUE (RID_EDIT_START + 109)
+#define RID_SVXITEMS_BLINK_FALSE (RID_EDIT_START + 110)
+
+#define RID_SVXITEMS_TWOLINES_OFF (RID_EDIT_START + 111)
+#define RID_SVXITEMS_TWOLINES (RID_EDIT_START + 112)
+
+// enum FontStrikeout ----------------------------------------------------
+#define RID_SVXITEMS_STRIKEOUT_BEGIN (RID_EDIT_START + 113)
+#define RID_SVXITEMS_STRIKEOUT_NONE (RID_EDIT_START + 113)
+#define RID_SVXITEMS_STRIKEOUT_SINGLE (RID_EDIT_START + 114)
+#define RID_SVXITEMS_STRIKEOUT_DOUBLE (RID_EDIT_START + 115)
+#define RID_SVXITEMS_STRIKEOUT_BOLD (RID_EDIT_START + 117)
+#define RID_SVXITEMS_STRIKEOUT_SLASH (RID_EDIT_START + 118)
+#define RID_SVXITEMS_STRIKEOUT_X (RID_EDIT_START + 119)
+
+// enum FontUnderline - used for overline --------------------------------
+#define RID_SVXITEMS_OL_BEGIN (RID_EDIT_START + 120)
+#define RID_SVXITEMS_OL_NONE (RID_EDIT_START + 120)
+#define RID_SVXITEMS_OL_SINGLE (RID_EDIT_START + 121)
+#define RID_SVXITEMS_OL_DOUBLE (RID_EDIT_START + 122)
+#define RID_SVXITEMS_OL_DOTTED (RID_EDIT_START + 123)
+#define RID_SVXITEMS_OL_DONTKNOW (RID_EDIT_START + 124)
+#define RID_SVXITEMS_OL_DASH (RID_EDIT_START + 125)
+#define RID_SVXITEMS_OL_LONGDASH (RID_EDIT_START + 126)
+#define RID_SVXITEMS_OL_DASHDOT (RID_EDIT_START + 127)
+#define RID_SVXITEMS_OL_DASHDOTDOT (RID_EDIT_START + 128)
+#define RID_SVXITEMS_OL_SMALLWAVE (RID_EDIT_START + 129)
+#define RID_SVXITEMS_OL_WAVE (RID_EDIT_START + 130)
+#define RID_SVXITEMS_OL_DOUBLEWAVE (RID_EDIT_START + 131)
+#define RID_SVXITEMS_OL_BOLD (RID_EDIT_START + 132)
+#define RID_SVXITEMS_OL_BOLDDOTTED (RID_EDIT_START + 133)
+#define RID_SVXITEMS_OL_BOLDDASH (RID_EDIT_START + 134)
+#define RID_SVXITEMS_OL_BOLDLONGDASH (RID_EDIT_START + 135)
+#define RID_SVXITEMS_OL_BOLDDASHDOT (RID_EDIT_START + 136)
+#define RID_SVXITEMS_OL_BOLDDASHDOTDOT (RID_EDIT_START + 137)
+#define RID_SVXITEMS_OL_BOLDWAVE (RID_EDIT_START + 138)
+
+// enum FontUnderline - used for underline -------------------------------
+#define RID_SVXITEMS_UL_BEGIN (RID_EDIT_START + 139)
+#define RID_SVXITEMS_UL_NONE (RID_EDIT_START + 139)
+#define RID_SVXITEMS_UL_SINGLE (RID_EDIT_START + 140)
+#define RID_SVXITEMS_UL_DOUBLE (RID_EDIT_START + 141)
+#define RID_SVXITEMS_UL_DOTTED (RID_EDIT_START + 142)
+#define RID_SVXITEMS_UL_DONTKNOW (RID_EDIT_START + 143)
+#define RID_SVXITEMS_UL_DASH (RID_EDIT_START + 144)
+#define RID_SVXITEMS_UL_LONGDASH (RID_EDIT_START + 145)
+#define RID_SVXITEMS_UL_DASHDOT (RID_EDIT_START + 146)
+#define RID_SVXITEMS_UL_DASHDOTDOT (RID_EDIT_START + 147)
+#define RID_SVXITEMS_UL_SMALLWAVE (RID_EDIT_START + 148)
+#define RID_SVXITEMS_UL_WAVE (RID_EDIT_START + 149)
+#define RID_SVXITEMS_UL_DOUBLEWAVE (RID_EDIT_START + 150)
+#define RID_SVXITEMS_UL_BOLD (RID_EDIT_START + 151)
+#define RID_SVXITEMS_UL_BOLDDOTTED (RID_EDIT_START + 152)
+#define RID_SVXITEMS_UL_BOLDDASH (RID_EDIT_START + 153)
+#define RID_SVXITEMS_UL_BOLDLONGDASH (RID_EDIT_START + 154)
+#define RID_SVXITEMS_UL_BOLDDASHDOT (RID_EDIT_START + 155)
+#define RID_SVXITEMS_UL_BOLDDASHDOTDOT (RID_EDIT_START + 156)
+#define RID_SVXITEMS_UL_BOLDWAVE (RID_EDIT_START + 157)
+
+// enum FontWeight -------------------------------------------------------
+#define RID_SVXITEMS_WEIGHT_BEGIN (RID_EDIT_START + 158)
+#define RID_SVXITEMS_WEIGHT_DONTKNOW (RID_EDIT_START + 158)
+#define RID_SVXITEMS_WEIGHT_THIN (RID_EDIT_START + 159)
+#define RID_SVXITEMS_WEIGHT_ULTRALIGHT (RID_EDIT_START + 160)
+#define RID_SVXITEMS_WEIGHT_LIGHT (RID_EDIT_START + 161)
+#define RID_SVXITEMS_WEIGHT_SEMILIGHT (RID_EDIT_START + 162)
+#define RID_SVXITEMS_WEIGHT_NORMAL (RID_EDIT_START + 163)
+#define RID_SVXITEMS_WEIGHT_MEDIUM (RID_EDIT_START + 164)
+#define RID_SVXITEMS_WEIGHT_SEMIBOLD (RID_EDIT_START + 165)
+#define RID_SVXITEMS_WEIGHT_BOLD (RID_EDIT_START + 166)
+#define RID_SVXITEMS_WEIGHT_ULTRABOLD (RID_EDIT_START + 167)
+#define RID_SVXITEMS_WEIGHT_BLACK (RID_EDIT_START + 168)
+
+// enum FontItalic -------------------------------------------------------
+#define RID_SVXITEMS_ITALIC_NONE (RID_EDIT_START + 206)
+#define RID_SVXITEMS_ITALIC_OBLIQUE (RID_EDIT_START + 207)
+#define RID_SVXITEMS_ITALIC_NORMAL (RID_EDIT_START + 208)
+
+// enum SvxAdjust -----------------------------------------------------------
+#define RID_SVXITEMS_ADJUST_BEGIN (RID_EDIT_START + 209)
+#define RID_SVXITEMS_ADJUST_LEFT (RID_EDIT_START + 209)
+#define RID_SVXITEMS_ADJUST_RIGHT (RID_EDIT_START + 210)
+#define RID_SVXITEMS_ADJUST_BLOCK (RID_EDIT_START + 211)
+#define RID_SVXITEMS_ADJUST_CENTER (RID_EDIT_START + 212)
+#define RID_SVXITEMS_ADJUST_BLOCKLINE (RID_EDIT_START + 213)
+
+#define RID_SVXITEMS_TAB_DECIMAL_CHAR (RID_EDIT_START + 214)
+#define RID_SVXITEMS_TAB_FILL_CHAR (RID_EDIT_START + 215)
+
+#define RID_SVXITEMS_TAB_ADJUST_BEGIN (RID_EDIT_START + 217)
+#define RID_SVXITEMS_TAB_ADJUST_LEFT (RID_EDIT_START + 217)
+#define RID_SVXITEMS_TAB_ADJUST_RIGHT (RID_EDIT_START + 218)
+#define RID_SVXITEMS_TAB_ADJUST_DECIMAL (RID_EDIT_START + 219)
+#define RID_SVXITEMS_TAB_ADJUST_CENTER (RID_EDIT_START + 220)
+#define RID_SVXITEMS_TAB_ADJUST_DEFAULT (RID_EDIT_START + 221)
+
+// enum SvxBreak ------------------------------------------------------------
+#define RID_SVXITEMS_BREAK_BEGIN (RID_EDIT_START + 222)
+#define RID_SVXITEMS_BREAK_NONE (RID_EDIT_START + 222)
+#define RID_SVXITEMS_BREAK_COLUMN_BEFORE (RID_EDIT_START + 223)
+#define RID_SVXITEMS_BREAK_COLUMN_AFTER (RID_EDIT_START + 224)
+#define RID_SVXITEMS_BREAK_COLUMN_BOTH (RID_EDIT_START + 225)
+#define RID_SVXITEMS_BREAK_PAGE_BEFORE (RID_EDIT_START + 226)
+#define RID_SVXITEMS_BREAK_PAGE_AFTER (RID_EDIT_START + 227)
+#define RID_SVXITEMS_BREAK_PAGE_BOTH (RID_EDIT_START + 228)
+
+// enum SvxShadowLocation ---------------------------------------------------
+#define RID_SVXITEMS_SHADOW_BEGIN (RID_EDIT_START + 229)
+#define RID_SVXITEMS_SHADOW_NONE (RID_EDIT_START + 229)
+#define RID_SVXITEMS_SHADOW_TOPLEFT (RID_EDIT_START + 230)
+#define RID_SVXITEMS_SHADOW_TOPRIGHT (RID_EDIT_START + 231)
+#define RID_SVXITEMS_SHADOW_BOTTOMLEFT (RID_EDIT_START + 232)
+#define RID_SVXITEMS_SHADOW_BOTTOMRIGHT (RID_EDIT_START + 233)
+
+// Border lines
+#define RID_SOLID (RID_EDIT_START + 234)
+#define RID_DOTTED (RID_EDIT_START + 235)
+#define RID_DASHED (RID_EDIT_START + 236)
+#define RID_DOUBLE (RID_EDIT_START + 237)
+#define RID_THINTHICK_SMALLGAP (RID_EDIT_START + 238)
+#define RID_THINTHICK_MEDIUMGAP (RID_EDIT_START + 239)
+#define RID_THINTHICK_LARGEGAP (RID_EDIT_START + 240)
+#define RID_THICKTHIN_SMALLGAP (RID_EDIT_START + 241)
+#define RID_THICKTHIN_MEDIUMGAP (RID_EDIT_START + 242)
+#define RID_THICKTHIN_LARGEGAP (RID_EDIT_START + 243)
+#define RID_EMBOSSED (RID_EDIT_START + 244)
+#define RID_ENGRAVED (RID_EDIT_START + 245)
+#define RID_OUTSET (RID_EDIT_START + 246)
+#define RID_INSET (RID_EDIT_START + 247)
+
+// Metric-Text
+#define RID_SVXITEMS_METRIC_MM (RID_EDIT_START + 250)
+#define RID_SVXITEMS_METRIC_CM (RID_EDIT_START + 251)
+#define RID_SVXITEMS_METRIC_INCH (RID_EDIT_START + 252)
+#define RID_SVXITEMS_METRIC_POINT (RID_EDIT_START + 253)
+#define RID_SVXITEMS_METRIC_TWIP (RID_EDIT_START + 254)
+#define RID_SVXITEMS_METRIC_PIXEL (RID_EDIT_START + 255)
+
+// enum ColorName -----------------------------------------------------------
+#define RID_SVXITEMS_COLOR_BEGIN (RID_EDIT_START + 256)
+#define RID_SVXITEMS_COLOR (RID_EDIT_START + 256)
+#define RID_SVXITEMS_COLOR_BLACK (RID_EDIT_START + 257)
+#define RID_SVXITEMS_COLOR_BLUE (RID_EDIT_START + 258)
+#define RID_SVXITEMS_COLOR_GREEN (RID_EDIT_START + 259)
+#define RID_SVXITEMS_COLOR_CYAN (RID_EDIT_START + 260)
+#define RID_SVXITEMS_COLOR_RED (RID_EDIT_START + 261)
+#define RID_SVXITEMS_COLOR_MAGENTA (RID_EDIT_START + 262)
+#define RID_SVXITEMS_COLOR_BROWN (RID_EDIT_START + 263)
+#define RID_SVXITEMS_COLOR_GRAY (RID_EDIT_START + 264)
+#define RID_SVXITEMS_COLOR_LIGHTGRAY (RID_EDIT_START + 265)
+#define RID_SVXITEMS_COLOR_LIGHTBLUE (RID_EDIT_START + 266)
+#define RID_SVXITEMS_COLOR_LIGHTGREEN (RID_EDIT_START + 267)
+#define RID_SVXITEMS_COLOR_LIGHTCYAN (RID_EDIT_START + 268)
+#define RID_SVXITEMS_COLOR_LIGHTRED (RID_EDIT_START + 269)
+#define RID_SVXITEMS_COLOR_LIGHTMAGENTA (RID_EDIT_START + 270)
+#define RID_SVXITEMS_COLOR_YELLOW (RID_EDIT_START + 271)
+#define RID_SVXITEMS_COLOR_WHITE (RID_EDIT_START + 272)
+#define RID_SVXITEMS_COLOR_MENUBAR (RID_EDIT_START + 273)
+#define RID_SVXITEMS_COLOR_MENUBARTEXT (RID_EDIT_START + 274)
+#define RID_SVXITEMS_COLOR_POPUPMENU (RID_EDIT_START + 275)
+#define RID_SVXITEMS_COLOR_POPUPMENUTEXT (RID_EDIT_START + 276)
+#define RID_SVXITEMS_COLOR_WINDOWTEXT (RID_EDIT_START + 277)
+#define RID_SVXITEMS_COLOR_WINDOWWORKSPACE (RID_EDIT_START + 278)
+#define RID_SVXITEMS_COLOR_HIGHLIGHT (RID_EDIT_START + 279)
+#define RID_SVXITEMS_COLOR_HIGHLIGHTTEXT (RID_EDIT_START + 280)
+#define RID_SVXITEMS_COLOR_3DTEXT (RID_EDIT_START + 281)
+#define RID_SVXITEMS_COLOR_3DFACE (RID_EDIT_START + 282)
+#define RID_SVXITEMS_COLOR_3DLIGHT (RID_EDIT_START + 283)
+#define RID_SVXITEMS_COLOR_3DSHADOW (RID_EDIT_START + 284)
+#define RID_SVXITEMS_COLOR_SCROLLBAR (RID_EDIT_START + 285)
+#define RID_SVXITEMS_COLOR_FIELD (RID_EDIT_START + 286)
+#define RID_SVXITEMS_COLOR_FIELDTEXT (RID_EDIT_START + 287)
+
+
+#define RID_SVXITEMS_PARASNAPTOGRID_ON (RID_EDIT_START + 288)
+#define RID_SVXITEMS_PARASNAPTOGRID_OFF (RID_EDIT_START + 289)
+
+#define RID_SVXITEMS_PARAVERTALIGN_AUTO (RID_EDIT_START + 290)
+#define RID_SVXITEMS_PARAVERTALIGN_BASELINE (RID_EDIT_START + 291)
+#define RID_SVXITEMS_PARAVERTALIGN_TOP (RID_EDIT_START + 292)
+#define RID_SVXITEMS_PARAVERTALIGN_CENTER (RID_EDIT_START + 293)
+#define RID_SVXITEMS_PARAVERTALIGN_BOTTOM (RID_EDIT_START + 294)
+
+#define RID_SVXITEMS_CHARHIDDEN_FALSE (RID_EDIT_START + 295)
+#define RID_SVXITEMS_CHARHIDDEN_TRUE (RID_EDIT_START + 296)
+
+// strings for error messsages in dictionary updates
+#define RID_SVXSTR_DIC_ERR_UNKNOWN (RID_EDIT_START + 297)
+#define RID_SVXSTR_DIC_ERR_FULL (RID_EDIT_START + 298)
+#define RID_SVXSTR_DIC_ERR_READONLY (RID_EDIT_START + 299)
+
+// ResIds fuer HM-QueryBoxen und Error-Strings
+#define RID_SVXQB_BW_CONTINUE (RID_EDIT_START + 300)
+#define RID_SVXQB_CONTINUE (RID_EDIT_START + 301)
+
+// EditEngine
+#define RID_EDITUNDO_DEL (RID_EDIT_START + 302)
+#define RID_EDITUNDO_MOVE (RID_EDIT_START + 303)
+#define RID_EDITUNDO_INSERT (RID_EDIT_START + 304)
+#define RID_EDITUNDO_REPLACE (RID_EDIT_START + 305)
+#define RID_EDITUNDO_SETATTRIBS (RID_EDIT_START + 306)
+#define RID_EDITUNDO_SETSTYLE (RID_EDIT_START + 307)
+#define RID_EDITUNDO_RESETATTRIBS (RID_EDIT_START + 308)
+#define RID_EDITUNDO_INDENT (RID_EDIT_START + 309)
+#define RID_EDITUNDO_TRANSLITERATE (RID_EDIT_START + 310)
+#define RID_MENU_SPELL (RID_EDIT_START + 311)
+#define RID_STR_PARAGRAPH (RID_EDIT_START + 312)
+#define RID_STR_WORD (RID_EDIT_START + 313)
+#define RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION (RID_EDIT_START + 314)
+#define RID_SVXSTR_A11Y_IMAGEBULLET_NAME (RID_EDIT_START + 315)
+
+// enum SvxCellHorJustify
+#define RID_SVXITEMS_HORJUST_STANDARD (RID_EDIT_START + 316)
+#define RID_SVXITEMS_HORJUST_LEFT (RID_EDIT_START + 317)
+#define RID_SVXITEMS_HORJUST_CENTER (RID_EDIT_START + 318)
+#define RID_SVXITEMS_HORJUST_RIGHT (RID_EDIT_START + 319)
+#define RID_SVXITEMS_HORJUST_BLOCK (RID_EDIT_START + 320)
+#define RID_SVXITEMS_HORJUST_REPEAT (RID_EDIT_START + 321)
+
+// enum SvxCellVerJustify
+#define RID_SVXITEMS_VERJUST_STANDARD (RID_EDIT_START + 322)
+#define RID_SVXITEMS_VERJUST_TOP (RID_EDIT_START + 323)
+#define RID_SVXITEMS_VERJUST_CENTER (RID_EDIT_START + 324)
+#define RID_SVXITEMS_VERJUST_BOTTOM (RID_EDIT_START + 325)
+
+// enum SvxCellJustifyMethod
+#define RID_SVXITEMS_JUSTMETHOD_AUTO (RID_EDIT_START + 326)
+#define RID_SVXITEMS_JUSTMETHOD_DISTRIBUTE (RID_EDIT_START + 327)
+
+#if 327 > (RID_EDIT_END-RID_EDIT_START)
+#error Resource-Ueberlauf in #line, #file
+#endif
+
+
+
+#endif
+
+// ******************************************************************* EOF
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx
new file mode 100644
index 000000000000..175267938c91
--- /dev/null
+++ b/include/editeng/editstat.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 _EDITSTAT_HXX
+#define _EDITSTAT_HXX
+
+#include <tools/string.hxx>
+#include <i18nlangtag/lang.h>
+
+#define EE_CNTRL_USECHARATTRIBS 0x00000001 // Use of hard character attributes
+#define EE_CNTRL_USEPARAATTRIBS 0x00000002 // Using paragraph attributes.
+#define EE_CNTRL_CRSRLEFTPARA 0x00000004 // Cursor is moved to another paragraph
+#define EE_CNTRL_DOIDLEFORMAT 0x00000008 // Formatting idle
+#define EE_CNTRL_PASTESPECIAL 0x00000010 // Allow PasteSpecial
+#define EE_CNTRL_AUTOINDENTING 0x00000020 // Automatic indenting
+#define EE_CNTRL_UNDOATTRIBS 0x00000040 // Undo for Attributes....
+#define EE_CNTRL_ONECHARPERLINE 0x00000080 // One character per line
+#define EE_CNTRL_NOCOLORS 0x00000100 // Engine: No Color
+#define EE_CNTRL_OUTLINER 0x00000200 // Special treatment Outliner/Outline mode
+#define EE_CNTRL_OUTLINER2 0x00000400 // Special treatment Outliner/Page
+#define EE_CNTRL_ALLOWBIGOBJS 0x00000800 // Portion info in text object
+#define EE_CNTRL_ONLINESPELLING 0x00001000 // During the edit Spelling
+#define EE_CNTRL_STRETCHING 0x00002000 // Stretch mode
+#define EE_CNTRL_MARKFIELDS 0x00004000 // Mark Fields with color
+#define EE_CNTRL_URLSFXEXECUTE 0x00008000 // !!!OLD!!!: SFX-URL-Execute.
+#define EE_CNTRL_RESTOREFONT 0x00010000 // Restore Font in OutDev
+#define EE_CNTRL_RTFSTYLESHEETS 0x00020000 // Use Stylesheets when imported
+//#define EE_CNTRL_NOREDLINES 0x00040000 // No RedLines when OnlineSpellError /* removed #i91949 */
+#define EE_CNTRL_AUTOCORRECT 0x00080000 // AutoCorrect
+#define EE_CNTRL_AUTOCOMPLETE 0x00100000 // AutoComplete
+#define EE_CNTRL_AUTOPAGESIZEX 0x00200000 // Adjust paper width to Text
+#define EE_CNTRL_AUTOPAGESIZEY 0x00400000 // Adjust paper height to Text
+#define EE_CNTRL_AUTOPAGESIZE (EE_CNTRL_AUTOPAGESIZEX|EE_CNTRL_AUTOPAGESIZEY)
+#define EE_CNTRL_TABINDENTING 0x00800000 // Indent with tab
+#define EE_CNTRL_FORMAT100 0x01000000 // Always format to 100%
+#define EE_CNTRL_ULSPACESUMMATION 0x02000000 // MS Compat: sum SA and SB, not maximum value
+#define EE_CNTRL_ULSPACEFIRSTPARA 0x04000000 // MS Compat: evaluate also at the first paragraph
+
+#define EV_CNTRL_AUTOSCROLL 0x00000001 // Auto scrolling horizontally
+#define EV_CNTRL_BIGSCROLL 0x00000002 // Scroll further to the cursor
+#define EV_CNTRL_ENABLEPASTE 0x00000004 // Enable Paste
+#define EV_CNTRL_SINGLELINEPASTE 0x00000008 // View: Paste in input line ...
+#define EV_CNTRL_OVERWRITE 0x00000010 // Overwrite mode
+#define EV_CNTRL_INVONEMORE 0x00000020 // Invalidate one pixel more
+#define EV_CNTRL_AUTOSIZEX 0x00000040 // Automatically adapt to text width
+#define EV_CNTRL_AUTOSIZEY 0x00000080 // Automatically adapt to Text width
+#define EV_CNTRL_AUTOSIZE (EV_CNTRL_AUTOSIZEX|EV_CNTRL_AUTOSIZEY)
+
+#define EE_STAT_HSCROLL 0x00000001
+#define EE_STAT_VSCROLL 0x00000002
+#define EE_STAT_CURSOROUT 0x00000004
+#define EE_STAT_CRSRMOVEFAIL 0x00000008
+#define EE_STAT_CRSRLEFTPARA 0x00000010
+#define EE_STAT_TEXTWIDTHCHANGED 0x00000020
+#define EE_STAT_TEXTHEIGHTCHANGED 0x00000040
+#define EE_STAT_WRONGWORDCHANGED 0x00000080
+// #define EE_STAT_MODIFIED 0x00000100
+
+/*
+ EE_STAT_CRSRLEFTPARA at the time cursor movement and the enter.
+*/
+
+inline void SetFlags( sal_uLong& rBits, const sal_uInt32 nMask, bool bOn )
+{
+ if ( bOn )
+ rBits |= nMask;
+ else
+ rBits &= ~nMask;
+}
+
+class EditStatus
+{
+protected:
+ sal_uLong nStatusBits;
+ sal_uLong nControlBits;
+ sal_uInt16 nPrevPara; // for EE_STAT_CRSRLEFTPARA
+
+public:
+ EditStatus() { nStatusBits = 0; nControlBits = 0; nPrevPara = 0xFFFF; }
+
+ void Clear() { nStatusBits = 0; }
+ void SetControlBits( sal_uLong nMask, bool bOn )
+ { SetFlags( nControlBits, nMask, bOn ); }
+
+ sal_uLong GetStatusWord() const { return nStatusBits; }
+ sal_uLong& GetStatusWord() { return nStatusBits; }
+
+ sal_uLong GetControlWord() const { return nControlBits; }
+ sal_uLong& GetControlWord() { return nControlBits; }
+
+ sal_uInt16 GetPrevParagraph() const { return nPrevPara; }
+ sal_uInt16& GetPrevParagraph() { return nPrevPara; }
+};
+
+#define SPELLCMD_IGNOREWORD 0x0001
+#define SPELLCMD_STARTSPELLDLG 0x0002
+#define SPELLCMD_ADDTODICTIONARY 0x0003
+#define SPELLCMD_WORDLANGUAGE 0x0004
+#define SPELLCMD_PARALANGUAGE 0x0005
+
+struct SpellCallbackInfo
+{
+ sal_uInt16 nCommand;
+ String aWord;
+ LanguageType eLanguage;
+
+ SpellCallbackInfo( sal_uInt16 nCMD, const String& rWord )
+ : aWord( rWord )
+ {
+ nCommand = nCMD;
+ eLanguage = LANGUAGE_DONTKNOW;
+ }
+
+ SpellCallbackInfo( sal_uInt16 nCMD, LanguageType eLang )
+ {
+ nCommand = nCMD;
+ eLanguage = eLang;
+ }
+};
+
+#endif // _EDITSTAT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/editund2.hxx b/include/editeng/editund2.hxx
new file mode 100644
index 000000000000..2312aee93c79
--- /dev/null
+++ b/include/editeng/editund2.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 _EDITUND2_HXX
+#define _EDITUND2_HXX
+
+#include "editeng/editengdllapi.h"
+#include <svl/undo.hxx>
+
+class EditEngine;
+
+class EDITENG_DLLPRIVATE EditUndoManager : public SfxUndoManager
+{
+ using SfxUndoManager::Undo;
+ using SfxUndoManager::Redo;
+
+ EditEngine* mpEditEngine;
+public:
+ EditUndoManager(EditEngine* pEE);
+
+ virtual sal_Bool Undo();
+ virtual sal_Bool Redo();
+};
+
+// -----------------------------------------------------------------------
+// EditUndo
+// ------------------------------------------------------------------------
+class EDITENG_DLLPUBLIC EditUndo : public SfxUndoAction
+{
+private:
+ sal_uInt16 nId;
+ EditEngine* mpEditEngine;
+
+public:
+ EditUndo(sal_uInt16 nI, EditEngine* pEE);
+ virtual ~EditUndo();
+
+ EditEngine* GetEditEngine();
+
+ virtual void Undo() = 0;
+ virtual void Redo() = 0;
+
+ virtual sal_Bool CanRepeat(SfxRepeatTarget&) const;
+ virtual OUString GetComment() const;
+ virtual sal_uInt16 GetId() const;
+};
+
+#endif // _EDITUND2_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
new file mode 100644
index 000000000000..a2f5ce8a3d65
--- /dev/null
+++ b/include/editeng/editview.hxx
@@ -0,0 +1,247 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+// MyEDITVIEW, due to exported EditView
+#ifndef _MyEDITVIEW_HXX
+#define _MyEDITVIEW_HXX
+
+#include <com/sun/star/i18n/WordType.hpp>
+
+#include <rsc/rscsfx.hxx>
+#include <i18nlangtag/lang.h>
+#include <tools/color.hxx>
+#include <tools/gen.hxx>
+
+class EditEngine;
+class ImpEditEngine;
+class ImpEditView;
+class SvxSearchItem;
+class SvxFieldItem;
+class Window;
+class Pointer;
+class Cursor;
+class KeyEvent;
+class MouseEvent;
+class DropEvent;
+class CommandEvent;
+class Rectangle;
+class Link;
+class Pair;
+class Point;
+class Range;
+class SvStream;
+class SvKeyValueIterator;
+class SfxStyleSheet;
+class Font;
+class FontList;
+class OutputDevice;
+
+#include <editeng/editdata.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include "editeng/editengdllapi.h"
+
+namespace com {
+namespace sun {
+namespace star {
+namespace datatransfer {
+ class XTransferable;
+}
+namespace linguistic2 {
+ class XSpellChecker1;
+ class XLanguageGuessing;
+}
+}}}
+
+class EDITENG_DLLPUBLIC EditView
+{
+ friend class EditEngine;
+ friend class ImpEditEngine;
+ friend class EditSelFunctionSet;
+
+public: // Needed for Undo
+ ImpEditView* GetImpEditView() const { return pImpEditView; }
+ ImpEditEngine* GetImpEditEngine() const;
+
+private:
+ ImpEditView* pImpEditView;
+ String aDicNameSingle;
+
+ EDITENG_DLLPRIVATE EditView( const EditView& );
+ EDITENG_DLLPRIVATE EditView& operator=( const EditView& );
+
+public:
+ EditView( EditEngine* pEng, Window* pWindow );
+ virtual ~EditView();
+
+ void SetEditEngine( EditEngine* pEditEngine );
+ EditEngine* GetEditEngine() const;
+
+ void SetWindow( Window* pWin );
+ Window* GetWindow() const;
+
+ void Paint( const Rectangle& rRect, OutputDevice* pTargetDevice = 0 );
+ void Invalidate();
+ Pair Scroll( long nHorzScroll, long nVertScroll, sal_uInt8 nRangeCheck = RGCHK_NEG );
+
+ void ShowCursor( sal_Bool bGotoCursor = sal_True, sal_Bool bForceVisCursor = sal_True );
+ void HideCursor();
+
+ void SetSelectionMode( EESelectionMode eMode );
+
+ void SetReadOnly( sal_Bool bReadOnly );
+ sal_Bool IsReadOnly() const;
+
+ sal_Bool HasSelection() const;
+ ESelection GetSelection() const;
+ void SetSelection( const ESelection& rNewSel );
+ sal_Bool SelectCurrentWord( sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES );
+
+ sal_Bool IsInsertMode() const;
+ void SetInsertMode( sal_Bool bInsert );
+
+ void ReplaceSelected( const String& rStr );
+ String GetSelected();
+ void DeleteSelected();
+
+ sal_uInt16 GetSelectedScriptType() const;
+
+ // VisArea position of the Output window.
+ // A size change also affects the VisArea
+ void SetOutputArea( const Rectangle& rRect );
+ const Rectangle& GetOutputArea() const;
+
+ // Document position.
+ // A size change also affects the VisArea
+ void SetVisArea( const Rectangle& rRect );
+ const Rectangle& GetVisArea() const;
+
+ const Pointer& GetPointer() const;
+
+ Cursor* GetCursor() const;
+
+ void InsertText( const String& rNew, sal_Bool bSelect = sal_False );
+
+ sal_Bool PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin = NULL );
+
+ sal_Bool MouseButtonUp( const MouseEvent& rMouseEvent );
+ sal_Bool MouseButtonDown( const MouseEvent& rMouseEvent );
+ sal_Bool MouseMove( const MouseEvent& rMouseEvent );
+ void Command( const CommandEvent& rCEvt );
+
+ void Cut();
+ void Copy();
+ void Paste();
+ void PasteSpecial();
+
+ void Undo();
+ void Redo();
+
+ // especially for Oliver Specht
+ Point GetWindowPosTopLeft( sal_uInt16 nParagraph );
+ void MoveParagraphs( Range aParagraphs, sal_uInt16 nNewPos );
+ void MoveParagraphs( long nDiff );
+
+ const SfxItemSet& GetEmptyItemSet();
+ SfxItemSet GetAttribs();
+ void SetAttribs( const SfxItemSet& rSet );
+ void RemoveAttribs( sal_Bool bRemoveParaAttribs = sal_False, sal_uInt16 nWhich = 0 );
+ void RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich = 0 );
+ void RemoveAttribsKeepLanguages( sal_Bool bRemoveParaAttribs = sal_False );
+
+ sal_uLong Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, sal_Bool bSelect = sal_False, SvKeyValueIterator* pHTTPHeaderAttrs = NULL );
+
+ void SetBackgroundColor( const Color& rColor );
+ Color GetBackgroundColor() const;
+
+ void SetControlWord( sal_uInt32 nWord );
+ sal_uInt32 GetControlWord() const;
+
+ EditTextObject* CreateTextObject();
+ void InsertText( const EditTextObject& rTextObject );
+ void InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xDataObj, const String& rBaseURL, sal_Bool bUseSpecial );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > GetTransferable();
+
+ // An EditView, so that when TRUE the update will be free from flickering:
+ void SetEditEngineUpdateMode( sal_Bool bUpdate );
+ void ForceUpdate();
+
+ const SfxStyleSheet* GetStyleSheet() const;
+ SfxStyleSheet* GetStyleSheet();
+
+ void SetAnchorMode( EVAnchorMode eMode );
+ EVAnchorMode GetAnchorMode() const;
+
+ void CompleteAutoCorrect( Window* pFrameWin = NULL );
+
+ EESpellState StartSpeller( sal_Bool bMultipleDoc = sal_False );
+ EESpellState StartThesaurus();
+ sal_uInt16 StartSearchAndReplace( const SvxSearchItem& rSearchItem );
+
+ // for text conversion
+ void StartTextConversion( LanguageType nSrcLang, LanguageType nDestLang, const Font *pDestFont, sal_Int32 nOptions, sal_Bool bIsInteractive, sal_Bool bMultipleDoc );
+ sal_Bool HasConvertibleTextPortion( LanguageType nLang );
+
+ void TransliterateText( sal_Int32 nTransliterationMode );
+
+ sal_Bool IsCursorAtWrongSpelledWord( sal_Bool bMarkIfWrong = sal_False );
+ sal_Bool IsWrongSpelledWordAtPos( const Point& rPosPixel, sal_Bool bMarkIfWrong = sal_False );
+ void ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack = 0 );
+
+ void InsertField( const SvxFieldItem& rFld );
+ const SvxFieldItem* GetFieldUnderMousePointer() const;
+ const SvxFieldItem* GetFieldUnderMousePointer( sal_uInt16& nPara, xub_StrLen& nPos ) const;
+ const SvxFieldItem* GetField( const Point& rPos, sal_uInt16* pnPara = NULL, xub_StrLen* pnPos = NULL ) const;
+
+ const SvxFieldItem* GetFieldAtSelection() const;
+
+ void SetInvalidateMore( sal_uInt16 nPixel );
+ sal_uInt16 GetInvalidateMore() const;
+
+ // grows or shrinks the font height for the current selection
+ void ChangeFontSize( bool bGrow, const FontList* pList );
+
+ static bool ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFontList );
+
+ String GetSurroundingText() const;
+ Selection GetSurroundingTextSelection() const;
+
+ /** Tries to determine the language of 'rText', returning a matching known
+ locale if possible, or a fallback, or LANGUAGE_NONE if nothing found or
+ matched.
+
+ @param bIsParaText
+ If TRUE, rText is a paragraph and the language is obtained by
+ passing the text to xLangGuess.
+ IF FALSE, a language match is tried for, in order,
+ 1. the default document language (non-CTL, non-CJK, aka LATIN)
+ 2. the UI language (Tools->Options->LanguageSettings->Languages User Interface)
+ 3. the locale (Tools->Options->LanguageSettings->Languages Locale)
+ 4. en-US
+ If nothing matched, LANGUAGE_NONE is returned.
+ */
+ static LanguageType CheckLanguage(
+ const OUString &rText,
+ com::sun::star::uno::Reference< com::sun::star::linguistic2::XSpellChecker1 > xSpell,
+ com::sun::star::uno::Reference< com::sun::star::linguistic2::XLanguageGuessing > xLangGuess,
+ bool bIsParaText );
+};
+
+#endif // _MyEDITVIEW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/edtdlg.hxx b/include/editeng/edtdlg.hxx
new file mode 100644
index 000000000000..7c998dfa637b
--- /dev/null
+++ b/include/editeng/edtdlg.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 _EDT_ABSTDLG_HXX
+#define _EDT_ABSTDLG_HXX
+
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <editeng/editengdllapi.h>
+#include <i18nlangtag/lang.h>
+#include <com/sun/star/uno/Reference.hxx>
+#include <vcl/abstdlg.hxx>
+#include <editeng/hangulhanja.hxx>
+
+namespace com { namespace sun { namespace star { namespace linguistic2
+{
+ class XThesaurus;
+ class XHyphenator;
+} } } }
+
+class Window;
+class ResId;
+class Link;
+class SvxSpellWrapper;
+
+class AbstractThesaurusDialog : public VclAbstractDialog
+{
+public:
+ virtual String GetWord() = 0;
+ virtual sal_uInt16 GetLanguage() const = 0;
+ virtual Window* GetWindow() = 0;
+};
+
+class AbstractHyphenWordDialog : public VclAbstractDialog
+{
+public:
+ virtual void SelLeft() = 0;
+ virtual void SelRight() = 0;
+ virtual Window* GetWindow() = 0;
+};
+
+class AbstractHangulHanjaConversionDialog : public VclAbstractTerminatedDialog
+{
+ public:
+ virtual void EnableRubySupport( bool _bVal ) = 0;
+ virtual void SetByCharacter( bool _bByCharacter ) = 0;
+ virtual void SetConversionDirectionState( bool _bTryBothDirections, editeng::HangulHanjaConversion::ConversionDirection _ePrimaryConversionDirection ) = 0;
+ virtual void SetConversionFormat( editeng::HangulHanjaConversion::ConversionFormat _eType ) = 0;
+ virtual void SetOptionsChangedHdl( const Link& _rHdl ) = 0;
+ virtual void SetIgnoreHdl( const Link& _rHdl ) = 0;
+ virtual void SetIgnoreAllHdl( const Link& _rHdl ) = 0;
+ virtual void SetChangeHdl( const Link& _rHdl ) = 0;
+ virtual void SetChangeAllHdl( const Link& _rHdl ) = 0;
+ virtual void SetClickByCharacterHdl( const Link& _rHdl ) = 0;
+ virtual void SetConversionFormatChangedHdl( const Link& _rHdl ) = 0;
+ virtual void SetFindHdl( const Link& _rHdl ) = 0;
+ virtual bool GetUseBothDirections() const= 0;
+ virtual editeng::HangulHanjaConversion::ConversionDirection GetDirection( editeng::HangulHanjaConversion::ConversionDirection _eDefaultDirection ) const = 0;
+ virtual void SetCurrentString(
+ const String& _rNewString,
+ const ::com::sun::star::uno::Sequence< OUString >& _rSuggestions,
+ bool _bOriginatesFromDocument = true )=0;
+ virtual String GetCurrentString( ) const =0;
+ virtual editeng::HangulHanjaConversion::ConversionFormat GetConversionFormat( ) const =0;
+ virtual void FocusSuggestion( )= 0;
+ virtual String GetCurrentSuggestion( ) const =0;
+};
+
+class EDITENG_DLLPUBLIC EditAbstractDialogFactory : virtual public VclAbstractDialogFactory
+{
+public:
+ virtual ~EditAbstractDialogFactory(); // needed for export of vtable
+ static EditAbstractDialogFactory* Create();
+ virtual AbstractThesaurusDialog* CreateThesaurusDialog( Window*, ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XThesaurus > xThesaurus,
+ const String &rWord, sal_Int16 nLanguage ) = 0;
+
+ virtual AbstractHyphenWordDialog* CreateHyphenWordDialog( Window*,
+ const String &rWord, LanguageType nLang,
+ ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > &xHyphen,
+ SvxSpellWrapper* pWrapper ) = 0;
+ virtual AbstractHangulHanjaConversionDialog * CreateHangulHanjaConversionDialog( Window* _pParent,
+ editeng::HangulHanjaConversion::ConversionDirection _ePrimaryDirection ) = 0;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/eedata.hxx b/include/editeng/eedata.hxx
new file mode 100644
index 000000000000..1332c56f4a54
--- /dev/null
+++ b/include/editeng/eedata.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 _EEDATA_HXX
+#define _EEDATA_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// extended data definitions for EditEngine portion stripping (StripPortions()
+// support). These may be mapped to some primitive definitions from Drawinglayer
+// later.
+#include <vector>
+
+namespace EEngineData
+{
+ // spell checking wrong vector containing the redlining data
+ class WrongSpellClass
+ {
+ public:
+ sal_uInt32 nStart;
+ sal_uInt32 nEnd;
+
+ WrongSpellClass(sal_uInt32 nS, sal_uInt32 nE) : nStart(nS), nEnd(nE) {}
+ };
+
+ typedef std::vector< WrongSpellClass > WrongSpellVector;
+
+ // text marking vector containing the EOC, EOW and EOS TEXT definitions
+ enum TextMarkingType
+ {
+ EndOfCaracter = 0,
+ EndOfWord = 1,
+ EndOfSentence = 2
+ };
+
+ class TextMarkingClass
+ {
+ public:
+ TextMarkingType eType;
+ sal_uInt32 nIndex;
+
+ TextMarkingClass(TextMarkingType eT, sal_uInt32 nI) : eType(eT), nIndex(nI) {}
+ };
+
+ typedef std::vector< TextMarkingClass > TextMarkingVector;
+
+} // end of namespace EditEngine
+
+#endif // _EEDATA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/eeitem.hxx b/include/editeng/eeitem.hxx
new file mode 100644
index 000000000000..04ce68ce1ef5
--- /dev/null
+++ b/include/editeng/eeitem.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 EEITEM_HXX
+#define EEITEM_HXX
+
+#include <svl/solar.hrc>
+
+#define EE_ITEMS_START (OWN_ATTR_VALUE_END+1)
+
+// Paragraph attributes:
+#define EE_PARA_START (EE_ITEMS_START+0)
+#define EE_PARA_WRITINGDIR (EE_ITEMS_START+0)
+#define EE_PARA_XMLATTRIBS (EE_ITEMS_START+1)
+#define EE_PARA_HANGINGPUNCTUATION (EE_ITEMS_START+2)
+#define EE_PARA_FORBIDDENRULES (EE_ITEMS_START+3)
+#define EE_PARA_ASIANCJKSPACING (EE_ITEMS_START+4)
+#define EE_PARA_NUMBULLET (EE_ITEMS_START+5)
+#define EE_PARA_HYPHENATE (EE_ITEMS_START+6)
+#define EE_PARA_BULLETSTATE (EE_ITEMS_START+7)
+#define EE_PARA_OUTLLRSPACE (EE_ITEMS_START+8)
+#define EE_PARA_OUTLLEVEL (EE_ITEMS_START+9)
+#define EE_PARA_BULLET (EE_ITEMS_START+10)
+#define EE_PARA_LRSPACE (EE_ITEMS_START+11)
+#define EE_PARA_ULSPACE (EE_ITEMS_START+12)
+#define EE_PARA_SBL (EE_ITEMS_START+13)
+#define EE_PARA_JUST (EE_ITEMS_START+14)
+#define EE_PARA_TABS (EE_ITEMS_START+15)
+#define EE_PARA_JUST_METHOD (EE_ITEMS_START+16)
+#define EE_PARA_VER_JUST (EE_ITEMS_START+17)
+#define EE_PARA_END (EE_ITEMS_START+17)
+
+// Character attributes:
+#define EE_CHAR_START (EE_ITEMS_START+18)
+#define EE_CHAR_COLOR (EE_ITEMS_START+18)
+#define EE_CHAR_FONTINFO (EE_ITEMS_START+19)
+#define EE_CHAR_FONTHEIGHT (EE_ITEMS_START+20)
+#define EE_CHAR_FONTWIDTH (EE_ITEMS_START+21)
+#define EE_CHAR_WEIGHT (EE_ITEMS_START+22)
+#define EE_CHAR_UNDERLINE (EE_ITEMS_START+23)
+#define EE_CHAR_STRIKEOUT (EE_ITEMS_START+24)
+#define EE_CHAR_ITALIC (EE_ITEMS_START+25)
+#define EE_CHAR_OUTLINE (EE_ITEMS_START+26)
+#define EE_CHAR_SHADOW (EE_ITEMS_START+27)
+#define EE_CHAR_ESCAPEMENT (EE_ITEMS_START+28)
+#define EE_CHAR_PAIRKERNING (EE_ITEMS_START+29)
+#define EE_CHAR_KERNING (EE_ITEMS_START+30)
+#define EE_CHAR_WLM (EE_ITEMS_START+31)
+#define EE_CHAR_LANGUAGE (EE_ITEMS_START+32)
+#define EE_CHAR_LANGUAGE_CJK (EE_ITEMS_START+33)
+#define EE_CHAR_LANGUAGE_CTL (EE_ITEMS_START+34)
+#define EE_CHAR_FONTINFO_CJK (EE_ITEMS_START+35)
+#define EE_CHAR_FONTINFO_CTL (EE_ITEMS_START+36)
+#define EE_CHAR_FONTHEIGHT_CJK (EE_ITEMS_START+37)
+#define EE_CHAR_FONTHEIGHT_CTL (EE_ITEMS_START+38)
+#define EE_CHAR_WEIGHT_CJK (EE_ITEMS_START+39)
+#define EE_CHAR_WEIGHT_CTL (EE_ITEMS_START+40)
+#define EE_CHAR_ITALIC_CJK (EE_ITEMS_START+41)
+#define EE_CHAR_ITALIC_CTL (EE_ITEMS_START+42)
+#define EE_CHAR_EMPHASISMARK (EE_ITEMS_START+43)
+#define EE_CHAR_RELIEF (EE_ITEMS_START+44)
+#define EE_CHAR_RUBI_DUMMY (EE_ITEMS_START+45)
+#define EE_CHAR_XMLATTRIBS (EE_ITEMS_START+46)
+#define EE_CHAR_OVERLINE (EE_ITEMS_START+47)
+#define EE_CHAR_END (EE_ITEMS_START+47)
+
+
+#define EE_FEATURE_START (EE_ITEMS_START+48)
+#define EE_FEATURE_TAB (EE_ITEMS_START+48)
+#define EE_FEATURE_LINEBR (EE_ITEMS_START+49)
+#define EE_FEATURE_NOTCONV (EE_ITEMS_START+50)
+#define EE_FEATURE_FIELD (EE_ITEMS_START+51)
+#define EE_FEATURE_END (EE_ITEMS_START+51)
+
+#define EE_ITEMS_END (EE_ITEMS_START+51)
+
+#define EDITITEMCOUNT ( EE_ITEMS_END - EE_ITEMS_START + 1 )
+
+#endif // _EEITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/eeitemid.hxx b/include/editeng/eeitemid.hxx
new file mode 100644
index 000000000000..8230387048ff
--- /dev/null
+++ b/include/editeng/eeitemid.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 _EEITEMID_HXX
+#define _EEITEMID_HXX
+
+#include <editeng/eeitem.hxx>
+
+#ifdef ITEMID_FONT
+#undef ITEMID_FONT
+#endif
+#ifdef ITEMID_FONTHEIGHT
+#undef ITEMID_FONTHEIGHT
+#endif
+#ifdef ITEMID_COLOR
+#undef ITEMID_COLOR
+#endif
+#ifdef ITEMID_WEIGHT
+#undef ITEMID_WEIGHT
+#endif
+#ifdef ITEMID_POSTURE
+#undef ITEMID_POSTURE
+#endif
+#ifdef ITEMID_SHADOWED
+#undef ITEMID_SHADOWED
+#endif
+#ifdef ITEMID_CONTOUR
+#undef ITEMID_CONTOUR
+#endif
+#ifdef ITEMID_CROSSEDOUT
+#undef ITEMID_CROSSEDOUT
+#endif
+#ifdef ITEMID_UNDERLINE
+#undef ITEMID_UNDERLINE
+#endif
+#ifdef ITEMID_OVERLINE
+#undef ITEMID_OVERLINE
+#endif
+#ifdef ITEMID_LANGUAGE
+#undef ITEMID_LANGUAGE
+#endif
+#ifdef ITEMID_ADJUST
+#undef ITEMID_ADJUST
+#endif
+#ifdef ITEMID_WORDLINEMODE
+#undef ITEMID_WORDLINEMODE
+#endif
+#ifdef ITEMID_CHARSETCOLOR
+#undef ITEMID_CHARSETCOLOR
+#endif
+#ifdef ITEMID_SEARCH
+#undef ITEMID_SEARCH
+#endif
+#ifdef ITEMID_BRUSH
+#undef ITEMID_BRUSH
+#endif
+
+// Character Attributes....
+#define ITEMID_FONT EE_CHAR_FONTINFO
+#define ITEMID_POSTURE EE_CHAR_ITALIC
+#define ITEMID_WEIGHT EE_CHAR_WEIGHT
+#define ITEMID_SHADOWED EE_CHAR_SHADOW
+#define ITEMID_CONTOUR EE_CHAR_OUTLINE
+#define ITEMID_CROSSEDOUT EE_CHAR_STRIKEOUT
+#define ITEMID_UNDERLINE EE_CHAR_UNDERLINE
+#define ITEMID_OVERLINE EE_CHAR_OVERLINE
+#define ITEMID_FONTHEIGHT EE_CHAR_FONTHEIGHT
+#define ITEMID_CHARSCALE_W EE_CHAR_FONTWIDTH
+#define ITEMID_COLOR EE_CHAR_COLOR
+#define ITEMID_WORDLINEMODE EE_CHAR_WLM
+#define ITEMID_PROPSIZE 0
+#define ITEMID_CHARSETCOLOR 0 // EE_FEATURE_NOTCONV
+#define ITEMID_CASEMAP 0
+#define ITEMID_LANGUAGE 0
+#define ITEMID_ESCAPEMENT EE_CHAR_ESCAPEMENT
+#define ITEMID_NOLINEBREAK 0
+#define ITEMID_NOHYPHENHERE 0
+#define ITEMID_AUTOKERN EE_CHAR_PAIRKERNING
+#define ITEMID_KERNING EE_CHAR_KERNING
+#define ITEMID_EMPHASISMARK EE_CHAR_EMPHASISMARK
+#define ITEMID_CHARRELIEF EE_CHAR_RELIEF
+
+// Paragraph Attributes
+#define ITEMID_SCRIPTSPACE EE_PARA_ASIANCJKSPACING
+#define ITEMID_ADJUST EE_PARA_JUST
+#define ITEMID_LINESPACING EE_PARA_SBL
+#define ITEMID_WIDOWS 0
+#define ITEMID_ORPHANS 0
+#define ITEMID_HYPHENZONE 0
+
+#define ITEMID_TABSTOP EE_PARA_TABS
+
+#define ITEMID_PAPERBIN 0
+#define ITEMID_LRSPACE EE_PARA_LRSPACE
+#define ITEMID_ULSPACE EE_PARA_ULSPACE
+#define ITEMID_FRAMEDIR EE_PARA_WRITINGDIR
+#define ITEMID_PRINT 0
+#define ITEMID_OPAQUE 0
+#define ITEMID_PROTECT 0
+#define ITEMID_BACKGROUND 0
+#define ITEMID_SHADOW 0
+#define ITEMID_MACRO 0
+#define ITEMID_BOX 0
+#define ITEMID_BOXINFO 0
+#define ITEMID_BRUSH 0
+
+#define ITEMID_FIELD EE_FEATURE_FIELD
+
+#define ITEMID_SEARCH 0
+
+#endif //_EEITEMID_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/eerdll.hxx b/include/editeng/eerdll.hxx
new file mode 100644
index 000000000000..2d6ba34976fa
--- /dev/null
+++ b/include/editeng/eerdll.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 _EERDLL_HXX
+#define _EERDLL_HXX
+
+class GlobalEditData;
+
+#include <tools/resid.hxx>
+#include <tools/shl.hxx>
+#include <editeng/editengdllapi.h>
+
+class EDITENG_DLLPUBLIC EditResId: public ResId
+{
+public:
+ EditResId( sal_uInt16 nId );
+};
+
+class EditDLL
+{
+ ResMgr* pResMgr;
+ GlobalEditData* pGlobalData;
+
+public:
+ EditDLL();
+ ~EditDLL();
+
+ ResMgr* GetResMgr() const { return pResMgr; }
+ GlobalEditData* GetGlobalData() const { return pGlobalData; }
+ static EditDLL& Get();
+};
+
+#define EE_DLL() EditDLL::Get()
+
+#define EE_RESSTR(x) EditResId(x).toString()
+
+#endif //_EERDLL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/emphasismarkitem.hxx b/include/editeng/emphasismarkitem.hxx
new file mode 100644
index 000000000000..1be4b0a7ce7d
--- /dev/null
+++ b/include/editeng/emphasismarkitem.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 _SVX_EMPHITEM_HXX
+#define _SVX_EMPHITEM_HXX
+
+#include <vcl/vclenum.hxx>
+#include <svl/intitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxEmphasisMarkItem ----------------------------------------------
+
+/* [Description]
+
+ This item describes the Font emphasis.
+*/
+
+class EDITENG_DLLPUBLIC SvxEmphasisMarkItem : public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+
+ SvxEmphasisMarkItem( const FontEmphasisMark eVal /*= EMPHASISMARK_NONE*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem + SfxEnumItem
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ inline SvxEmphasisMarkItem& operator=(const SvxEmphasisMarkItem& rItem )
+ {
+ SetValue( rItem.GetValue() );
+ return *this;
+ }
+
+ // enum cast
+ FontEmphasisMark GetEmphasisMark() const
+ { return (FontEmphasisMark)GetValue(); }
+ void SetEmphasisMark( FontEmphasisMark eNew )
+ { SetValue( (sal_uInt16)eNew ); }
+};
+
+#endif // #ifndef _SVX_EMPHITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/escapementitem.hxx b/include/editeng/escapementitem.hxx
new file mode 100644
index 000000000000..53fcb736f971
--- /dev/null
+++ b/include/editeng/escapementitem.hxx
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_ESCPITEM_HXX
+#define _SVX_ESCPITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/svxenum.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxEscapementItem -----------------------------------------------
+
+#define DFLT_ESC_SUPER 33 // 1/3
+#define DFLT_ESC_SUB -33 // also 1/3 previously 8/100
+#define DFLT_ESC_PROP 58
+#define DFLT_ESC_AUTO_SUPER 101
+#define DFLT_ESC_AUTO_SUB -101
+
+/* [Description]
+
+ This item describes the writing position.
+*/
+
+class EDITENG_DLLPUBLIC SvxEscapementItem : public SfxEnumItemInterface
+{
+ short nEsc;
+ sal_uInt8 nProp;
+public:
+ TYPEINFO();
+
+ explicit SvxEscapementItem( const sal_uInt16 nId );
+ SvxEscapementItem( const SvxEscapement eEscape,
+ const sal_uInt16 nId );
+ SvxEscapementItem( const short nEsc, const sal_uInt8 nProp,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ inline void SetEscapement( const SvxEscapement eNew )
+ {
+ if( SVX_ESCAPEMENT_OFF == eNew )
+ nEsc = 0, nProp = 100;
+ else
+ if( SVX_ESCAPEMENT_SUPERSCRIPT == eNew )
+ nEsc = DFLT_ESC_SUPER, nProp = DFLT_ESC_PROP;
+ else
+ nEsc = DFLT_ESC_SUB, nProp = DFLT_ESC_PROP;
+ }
+ inline SvxEscapement GetEscapement() const { return static_cast< SvxEscapement >( GetEnumValue() ); }
+
+ inline short &GetEsc() { return nEsc; }
+ inline short GetEsc() const { return nEsc; }
+
+ inline sal_uInt8 &GetProp() { return nProp; }
+ inline sal_uInt8 GetProp() const { return nProp; }
+
+ inline SvxEscapementItem& operator=(const SvxEscapementItem& rEsc)
+ {
+ nEsc = rEsc.GetEsc();
+ nProp = rEsc.GetProp();
+ return *this;
+ }
+
+ virtual sal_uInt16 GetValueCount() const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetEnumValue() const;
+ virtual void SetEnumValue( sal_uInt16 nNewVal );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/fhgtitem.hxx b/include/editeng/fhgtitem.hxx
new file mode 100644
index 000000000000..60f417428827
--- /dev/null
+++ b/include/editeng/fhgtitem.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 _SVX_FHGTITEM_HXX
+#define _SVX_FHGTITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxFontHeightItem -----------------------------------------------
+
+// Warning: twips values
+
+/* [Description]
+
+ This item describes the font height
+*/
+
+#define FONTHEIGHT_16_VERSION ((sal_uInt16)0x0001)
+#define FONTHEIGHT_UNIT_VERSION ((sal_uInt16)0x0002)
+
+class EDITENG_DLLPUBLIC SvxFontHeightItem : public SfxPoolItem
+{
+ sal_uInt32 nHeight;
+ sal_uInt16 nProp; // default 100%
+ SfxMapUnit ePropUnit; // Percent, Twip, ...
+public:
+ TYPEINFO();
+
+ SvxFontHeightItem( const sal_uLong nSz /*= 240*/, const sal_uInt16 nPropHeight /*= 100*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nItemVersion) const;
+ virtual bool ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
+
+ inline SvxFontHeightItem& operator=(const SvxFontHeightItem& rSize)
+ {
+ SetHeightValue( rSize.GetHeight() );
+ SetProp( rSize.GetProp(), ePropUnit );
+ return *this;
+ }
+
+ void SetHeight( sal_uInt32 nNewHeight, const sal_uInt16 nNewProp = 100,
+ SfxMapUnit eUnit = SFX_MAPUNIT_RELATIVE );
+
+ void SetHeight( sal_uInt32 nNewHeight, sal_uInt16 nNewProp,
+ SfxMapUnit eUnit, SfxMapUnit eCoreUnit );
+
+ sal_uInt32 GetHeight() const { return nHeight; }
+
+ void SetHeightValue( sal_uInt32 nNewHeight )
+ {
+ DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
+ nHeight = nNewHeight;
+ }
+
+ void SetProp( const sal_uInt16 nNewProp,
+ SfxMapUnit eUnit = SFX_MAPUNIT_RELATIVE )
+ {
+ DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
+ nProp = nNewProp;
+ ePropUnit = eUnit;
+ }
+
+ sal_uInt16 GetProp() const { return nProp; }
+
+ SfxMapUnit GetPropUnit() const { return ePropUnit; } // Percent, Twip, ...
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/fieldupdater.hxx b/include/editeng/fieldupdater.hxx
new file mode 100644
index 000000000000..8ddab5ecf91e
--- /dev/null
+++ b/include/editeng/fieldupdater.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/.
+ */
+
+#ifndef __EDITENG_FIELDUPDATER_HXX__
+#define __EDITENG_FIELDUPDATER_HXX__
+
+#include "editengdllapi.h"
+
+class EditTextObject;
+
+namespace editeng {
+
+class FieldUpdaterImpl;
+
+/**
+ * Wrapper for EditTextObject to handle updating of fields without exposing
+ * the internals of EditTextObject structure.
+ */
+class EDITENG_DLLPUBLIC FieldUpdater
+{
+ FieldUpdaterImpl* mpImpl;
+
+ FieldUpdater(); // disabled
+public:
+ FieldUpdater(EditTextObject& rObj);
+ FieldUpdater(const FieldUpdater& r);
+ ~FieldUpdater();
+
+ /**
+ * Set a new table ID to all table fields.
+ *
+ * @param nTab new table ID
+ */
+ void updateTableFields(int nTab);
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/flditem.hxx b/include/editeng/flditem.hxx
new file mode 100644
index 000000000000..37f42a37c217
--- /dev/null
+++ b/include/editeng/flditem.hxx
@@ -0,0 +1,420 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_FLDITEM_HXX
+#define _SVX_FLDITEM_HXX
+
+#include <i18nlangtag/lang.h>
+#include <tools/time.hxx>
+#include <tools/date.hxx>
+#include <svl/poolitem.hxx>
+#include <tools/pstm.hxx>
+#include "editeng/editengdllapi.h"
+
+#include <com/sun/star/text/textfield/Type.hpp>
+
+#include <boost/noncopyable.hpp>
+
+namespace com { namespace sun { namespace star { namespace text {
+
+class XTextContent;
+
+}}}}
+
+class SvNumberFormatter;
+class MetaAction;
+
+// class SvxFieldItem ---------------------------------------------------
+
+
+
+class EDITENG_DLLPUBLIC SvxFieldData : public SvPersistBase
+{
+public:
+ static const sal_Int32 UNKNOWN_FIELD;
+
+ static SvxFieldData* Create(const com::sun::star::uno::Reference<com::sun::star::text::XTextContent>& xContent);
+
+ SV_DECL_PERSIST1( SvxFieldData, SvPersistBase, com::sun::star::text::textfield::Type::UNSPECIFIED)
+
+ SvxFieldData();
+ virtual ~SvxFieldData();
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+
+ virtual MetaAction* createBeginComment() const;
+ virtual MetaAction* createEndComment() const;
+};
+
+/**
+ * This item stores a field (SvxFieldData). The field is controlled by or
+ * belongs to the item. The field itself is determined by a derivation from
+ * SvxFieldData (RTTI)
+ */
+class EDITENG_DLLPUBLIC SvxFieldItem : public SfxPoolItem
+{
+private:
+ SvxFieldData* pField;
+
+ EDITENG_DLLPRIVATE SvxFieldItem( SvxFieldData* pField, const sal_uInt16 nId );
+
+public:
+ TYPEINFO();
+
+ SvxFieldItem( const SvxFieldData& rField, const sal_uInt16 nId );
+ SvxFieldItem( const SvxFieldItem& rItem );
+ ~SvxFieldItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nVer ) const;
+ virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const;
+
+ const SvxFieldData* GetField() const { return pField; }
+ static SvClassManager& GetClassManager();
+};
+
+// =================================================================
+// The following are the derivatives of SvxFieldData ...
+// =================================================================
+
+enum SvxDateType { SVXDATETYPE_FIX, SVXDATETYPE_VAR };
+enum SvxDateFormat { SVXDATEFORMAT_APPDEFAULT = 0, // Set as in App
+ SVXDATEFORMAT_SYSTEM, // Set as in System
+ SVXDATEFORMAT_STDSMALL,
+ SVXDATEFORMAT_STDBIG,
+ SVXDATEFORMAT_A, // 13.02.96
+ SVXDATEFORMAT_B, // 13.02.1996
+ SVXDATEFORMAT_C, // 13.Feb 1996
+ SVXDATEFORMAT_D, // 13.February 1996
+ SVXDATEFORMAT_E, // Tue, 13.February 1996
+ SVXDATEFORMAT_F // Tuesday, 13.February 1996
+ };
+
+class EDITENG_DLLPUBLIC SvxDateField : public SvxFieldData
+{
+ sal_uInt32 nFixDate;
+ SvxDateType eType;
+ SvxDateFormat eFormat;
+
+public:
+ SV_DECL_PERSIST1( SvxDateField, SvxFieldData, com::sun::star::text::textfield::Type::DATE )
+
+ SvxDateField();
+ explicit SvxDateField( const Date& rDate,
+ SvxDateType eType = SVXDATETYPE_VAR,
+ SvxDateFormat eFormat = SVXDATEFORMAT_STDSMALL );
+
+ sal_uInt32 GetFixDate() const { return nFixDate; }
+ void SetFixDate( const Date& rDate ) { nFixDate = rDate.GetDate(); }
+
+ SvxDateType GetType() const { return eType; }
+ void SetType( SvxDateType eTp ) { eType = eTp; }
+
+ SvxDateFormat GetFormat() const { return eFormat; }
+ void SetFormat( SvxDateFormat eFmt ) { eFormat = eFmt; }
+
+ // If eLanguage==LANGUAGE_DONTKNOW the language/country
+ // used in number formatter initialization is taken.
+ OUString GetFormatted( SvNumberFormatter& rFormatter, LanguageType eLanguage ) const;
+ static OUString GetFormatted( Date& rDate, SvxDateFormat eFormat, SvNumberFormatter& rFormatter, LanguageType eLanguage );
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+
+ virtual MetaAction* createBeginComment() const;
+};
+
+
+enum SvxURLFormat { SVXURLFORMAT_APPDEFAULT = 0, // Set as in App
+ SVXURLFORMAT_URL, // Represent URL
+ SVXURLFORMAT_REPR // Constitute repraesentation
+ };
+
+class EDITENG_DLLPUBLIC SvxURLField : public SvxFieldData
+{
+private:
+ SvxURLFormat eFormat;
+ OUString aURL; // URL-Address
+ OUString aRepresentation; // What is shown
+ OUString aTargetFrame; // In what Frame
+
+public:
+ SV_DECL_PERSIST1( SvxURLField, SvxFieldData, com::sun::star::text::textfield::Type::URL )
+
+ SvxURLField();
+ SvxURLField( const OUString& rURL, const OUString& rRepres, SvxURLFormat eFmt = SVXURLFORMAT_URL );
+
+ const OUString& GetURL() const { return aURL; }
+ void SetURL( const OUString& rURL ) { aURL = rURL; }
+
+ const OUString& GetRepresentation() const { return aRepresentation; }
+ void SetRepresentation( const OUString& rRep ) { aRepresentation= rRep; }
+
+ const OUString& GetTargetFrame() const { return aTargetFrame; }
+ void SetTargetFrame( const OUString& rFrm ) { aTargetFrame = rFrm; }
+
+ SvxURLFormat GetFormat() const { return eFormat; }
+ void SetFormat( SvxURLFormat eFmt ) { eFormat = eFmt; }
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+
+ virtual MetaAction* createBeginComment() const;
+};
+
+class EDITENG_DLLPUBLIC SvxPageField : public SvxFieldData
+{
+public:
+ SV_DECL_PERSIST1( SvxPageField, SvxFieldData, com::sun::star::text::textfield::Type::PAGE )
+ SvxPageField();
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+
+ virtual MetaAction* createBeginComment() const;
+};
+
+class EDITENG_DLLPUBLIC SvxPagesField : public SvxFieldData
+{
+public:
+ SV_DECL_PERSIST1( SvxPagesField, SvxFieldData, com::sun::star::text::textfield::Type::PAGES )
+ SvxPagesField();
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+};
+
+class EDITENG_DLLPUBLIC SvxTimeField : public SvxFieldData
+{
+public:
+ SV_DECL_PERSIST1( SvxTimeField, SvxFieldData, com::sun::star::text::textfield::Type::TIME )
+ SvxTimeField();
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+
+ virtual MetaAction* createBeginComment() const;
+};
+
+class EDITENG_DLLPUBLIC SvxFileField : public SvxFieldData
+{
+public:
+ SV_DECL_PERSIST1( SvxFileField, SvxFieldData, com::sun::star::text::textfield::Type::DOCINFO_TITLE )
+ SvxFileField();
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+};
+
+class EDITENG_DLLPUBLIC SvxTableField : public SvxFieldData
+{
+ int mnTab;
+public:
+ SV_DECL_PERSIST1( SvxTableField, SvxFieldData, com::sun::star::text::textfield::Type::TABLE )
+ SvxTableField();
+ explicit SvxTableField(int nTab);
+
+ void SetTab(int nTab);
+ int GetTab() const;
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+};
+
+
+enum SvxTimeType { SVXTIMETYPE_FIX, SVXTIMETYPE_VAR };
+enum SvxTimeFormat { SVXTIMEFORMAT_APPDEFAULT = 0, // Set as in App
+ SVXTIMEFORMAT_SYSTEM, // Set as in System
+ SVXTIMEFORMAT_STANDARD,
+ SVXTIMEFORMAT_24_HM, // 13:49
+ SVXTIMEFORMAT_24_HMS, // 13:49:38
+ SVXTIMEFORMAT_24_HMSH, // 13:49:38.78
+ SVXTIMEFORMAT_12_HM, // 01:49
+ SVXTIMEFORMAT_12_HMS, // 01:49:38
+ SVXTIMEFORMAT_12_HMSH, // 01:49:38.78
+ SVXTIMEFORMAT_AM_HM, // 01:49 PM
+ SVXTIMEFORMAT_AM_HMS, // 01:49:38 PM
+ SVXTIMEFORMAT_AM_HMSH // 01:49:38.78 PM
+ };
+
+class EDITENG_DLLPUBLIC SvxExtTimeField : public SvxFieldData
+{
+private:
+ sal_uInt32 nFixTime;
+ SvxTimeType eType;
+ SvxTimeFormat eFormat;
+
+public:
+ SV_DECL_PERSIST1( SvxExtTimeField, SvxFieldData, com::sun::star::text::textfield::Type::EXTENDED_TIME )
+ SvxExtTimeField();
+ explicit SvxExtTimeField( const Time& rTime,
+ SvxTimeType eType = SVXTIMETYPE_VAR,
+ SvxTimeFormat eFormat = SVXTIMEFORMAT_STANDARD );
+
+ sal_uInt32 GetFixTime() const { return nFixTime; }
+ void SetFixTime( const Time& rTime ) { nFixTime = rTime.GetTime(); }
+
+ SvxTimeType GetType() const { return eType; }
+ void SetType( SvxTimeType eTp ) { eType = eTp; }
+
+ SvxTimeFormat GetFormat() const { return eFormat; }
+ void SetFormat( SvxTimeFormat eFmt ) { eFormat = eFmt; }
+
+ // If eLanguage==LANGUAGE_DONTKNOW the language/country
+ // used in number formatter initialization is taken.
+ OUString GetFormatted( SvNumberFormatter& rFormatter, LanguageType eLanguage ) const;
+ static OUString GetFormatted( Time& rTime, SvxTimeFormat eFormat, SvNumberFormatter& rFormatter, LanguageType eLanguage );
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+
+ virtual MetaAction* createBeginComment() const;
+};
+
+
+enum SvxFileType { SVXFILETYPE_FIX, SVXFILETYPE_VAR };
+enum SvxFileFormat { SVXFILEFORMAT_NAME_EXT = 0, // File name with Extension
+ SVXFILEFORMAT_FULLPATH, // full path
+ SVXFILEFORMAT_PATH, // only path
+ SVXFILEFORMAT_NAME // only file name
+ };
+
+
+
+class EDITENG_DLLPUBLIC SvxExtFileField : public SvxFieldData
+{
+private:
+ OUString aFile;
+ SvxFileType eType;
+ SvxFileFormat eFormat;
+
+public:
+ SV_DECL_PERSIST1( SvxExtFileField, SvxFieldData, com::sun::star::text::textfield::Type::EXTENDED_FILE )
+ SvxExtFileField();
+ explicit SvxExtFileField( const OUString& rString,
+ SvxFileType eType = SVXFILETYPE_VAR,
+ SvxFileFormat eFormat = SVXFILEFORMAT_FULLPATH );
+
+ OUString GetFile() const { return aFile; }
+ void SetFile( const OUString& rString ) { aFile = rString; }
+
+ SvxFileType GetType() const { return eType; }
+ void SetType( SvxFileType eTp ) { eType = eTp; }
+
+ SvxFileFormat GetFormat() const { return eFormat; }
+ void SetFormat( SvxFileFormat eFmt ) { eFormat = eFmt; }
+
+ OUString GetFormatted() const;
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+};
+
+
+enum SvxAuthorType { SVXAUTHORTYPE_FIX, SVXAUTHORTYPE_VAR };
+enum SvxAuthorFormat { SVXAUTHORFORMAT_FULLNAME = 0, // full name
+ SVXAUTHORFORMAT_NAME, // Only Last name
+ SVXAUTHORFORMAT_FIRSTNAME, // Only first name
+ SVXAUTHORFORMAT_SHORTNAME // Initials
+ };
+
+class EDITENG_DLLPUBLIC SvxAuthorField : public SvxFieldData
+{
+private:
+ OUString aName;
+ OUString aFirstName;
+ OUString aShortName;
+ SvxAuthorType eType;
+ SvxAuthorFormat eFormat;
+
+public:
+ SV_DECL_PERSIST1( SvxAuthorField, SvxFieldData, com::sun::star::text::textfield::Type::AUTHOR )
+ SvxAuthorField();
+ SvxAuthorField(
+ const OUString& rFirstName,
+ const OUString& rLastName,
+ const OUString& rShortName,
+ SvxAuthorType eType = SVXAUTHORTYPE_VAR,
+ SvxAuthorFormat eFormat = SVXAUTHORFORMAT_FULLNAME );
+
+ OUString GetName() const { return aName; }
+ void SetName( const OUString& rString ) { aName = rString; }
+
+ OUString GetFirstName() const { return aFirstName; }
+ void SetFirstName( const OUString& rString ) { aFirstName = rString; }
+
+ OUString GetShortName() const { return aShortName; }
+ void SetShortName( const OUString& rString ) { aShortName = rString; }
+
+ SvxAuthorType GetType() const { return eType; }
+ void SetType( SvxAuthorType eTp ) { eType = eTp; }
+
+ SvxAuthorFormat GetFormat() const { return eFormat; }
+ void SetFormat( SvxAuthorFormat eFmt ) { eFormat = eFmt; }
+
+ OUString GetFormatted() const;
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+};
+
+/** this field is used as a placeholder for a header&footer in impress. The actual
+ value is stored at the page */
+class EDITENG_DLLPUBLIC SvxHeaderField : public SvxFieldData
+{
+public:
+ SV_DECL_PERSIST1( SvxHeaderField, SvxFieldData, com::sun::star::text::textfield::Type::PRESENTATION_HEADER )
+ SvxHeaderField();
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+};
+
+/** this field is used as a placeholder for a header&footer in impress. The actual
+ value is stored at the page */
+class EDITENG_DLLPUBLIC SvxFooterField : public SvxFieldData
+{
+public:
+ SV_DECL_PERSIST1( SvxFooterField, SvxFieldData, com::sun::star::text::textfield::Type::PRESENTATION_FOOTER )
+ SvxFooterField();
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+};
+
+/** this field is used as a placeholder for a header&footer in impress. The actual
+ value is stored at the page */
+class EDITENG_DLLPUBLIC SvxDateTimeField : public SvxFieldData
+{
+public:
+ SV_DECL_PERSIST1( SvxDateTimeField, SvxFieldData, com::sun::star::text::textfield::Type::PRESENTATION_DATE_TIME )
+ SvxDateTimeField();
+
+ static OUString GetFormatted( Date& rDate, Time& rTime, int eFormat, SvNumberFormatter& rFormatter, LanguageType eLanguage );
+
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==( const SvxFieldData& ) const;
+};
+
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/flstitem.hxx b/include/editeng/flstitem.hxx
new file mode 100644
index 000000000000..f298732e25e4
--- /dev/null
+++ b/include/editeng/flstitem.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 _SVX_FLSTITEM_HXX
+#define _SVX_FLSTITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include "editeng/editengdllapi.h"
+
+// class SvxFontListItem -------------------------------------------------
+
+class FontList;
+
+/*
+ [Description]
+
+ This item serves as a transport medium for a font list. The font list is
+ not copied and not deleted!
+*/
+
+class EDITENG_DLLPUBLIC SvxFontListItem : public SfxPoolItem
+{
+private:
+ const FontList* pFontList;
+ com::sun::star::uno::Sequence< OUString > aFontNameSeq;
+
+public:
+ TYPEINFO();
+
+ SvxFontListItem( const FontList* pFontLst,
+ const sal_uInt16 nId );
+ SvxFontListItem( const SvxFontListItem& rItem );
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ const FontList* GetFontList() const { return pFontList; }
+};
+
+
+
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/fontitem.hxx b/include/editeng/fontitem.hxx
new file mode 100644
index 000000000000..e9d14755906e
--- /dev/null
+++ b/include/editeng/fontitem.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 _SVX_FONTITEM_HXX
+#define _SVX_FONTITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <tools/string.hxx>
+#include <vcl/font.hxx>
+#include "editeng/editengdllapi.h"
+
+class SvXMLUnitConverter;
+
+// class SvxFontItem -----------------------------------------------------
+
+/* [Description]
+
+ This item describes a Font.
+*/
+
+class EDITENG_DLLPUBLIC SvxFontItem : public SfxPoolItem
+{
+ String aFamilyName;
+ String aStyleName;
+ FontFamily eFamily;
+ FontPitch ePitch;
+ rtl_TextEncoding eTextEncoding;
+
+ static sal_Bool bEnableStoreUnicodeNames;
+
+public:
+ TYPEINFO();
+
+ explicit SvxFontItem( const sal_uInt16 nId );
+ SvxFontItem( const FontFamily eFam, const String& rFamilyName,
+ const String& rStyleName,
+ const FontPitch eFontPitch /*= PITCH_DONTKNOW*/,
+ const rtl_TextEncoding eFontTextEncoding /*= RTL_TEXTENCODING_DONTKNOW*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ // Access methods:
+ void SetFamilyName( const String& rFamilyName ) { aFamilyName = rFamilyName; }
+ inline const String &GetFamilyName() const { return aFamilyName; }
+
+ void SetStyleName(const String &rStyleName ) { aStyleName = rStyleName; }
+ inline const String &GetStyleName() const { return aStyleName; }
+
+ void SetFamily( FontFamily _eFamily ) { eFamily = _eFamily; }
+ inline FontFamily GetFamily() const { return eFamily; }
+
+ void SetPitch(FontPitch _ePitch ) { ePitch = _ePitch; }
+ inline FontPitch GetPitch() const { return ePitch; }
+
+ void SetCharSet(rtl_TextEncoding _eEncoding) { eTextEncoding = _eEncoding; }
+
+ inline rtl_TextEncoding GetCharSet() const { return eTextEncoding; }
+
+ SvxFontItem& operator=(const SvxFontItem& rFont);
+
+ static void EnableStoreUnicodeNames( sal_Bool bEnable );
+
+};
+
+EDITENG_DLLPUBLIC void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian,
+ SvxFontItem& rComplex );
+
+#endif // #ifndef _SVX_FONTITEM_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/forbiddencharacterstable.hxx b/include/editeng/forbiddencharacterstable.hxx
new file mode 100644
index 000000000000..14556fd0ceda
--- /dev/null
+++ b/include/editeng/forbiddencharacterstable.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 _FORBIDDENCHARACTERSTABLE_HXX
+#define _FORBIDDENCHARACTERSTABLE_HXX
+
+#include <salhelper/simplereferenceobject.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/i18n/ForbiddenCharacters.hpp>
+#include "editeng/editengdllapi.h"
+#include <map>
+
+namespace com {
+namespace sun {
+namespace star {
+namespace uno {
+ class XComponentContext;
+}}}}
+
+class EDITENG_DLLPUBLIC SvxForbiddenCharactersTable : public salhelper::SimpleReferenceObject
+{
+public:
+ typedef std::map<sal_uInt16, com::sun::star::i18n::ForbiddenCharacters> Map;
+private:
+ Map maMap;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+
+public:
+ SvxForbiddenCharactersTable( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext);
+ ~SvxForbiddenCharactersTable() {}
+
+ Map& GetMap() { return maMap; }
+ const com::sun::star::i18n::ForbiddenCharacters* GetForbiddenCharacters( sal_uInt16 nLanguage, sal_Bool bGetDefault );
+ void SetForbiddenCharacters( sal_uInt16 nLanguage , const com::sun::star::i18n::ForbiddenCharacters& );
+ void ClearForbiddenCharacters( sal_uInt16 nLanguage );
+};
+
+#endif // _FORBIDDENCHARACTERSTABLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/forbiddenruleitem.hxx b/include/editeng/forbiddenruleitem.hxx
new file mode 100644
index 000000000000..2d15a3d00bf3
--- /dev/null
+++ b/include/editeng/forbiddenruleitem.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 _SVX_FORBIDDENRULEITEM_HXX
+#define _SVX_FORBIDDENRULEITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxForbiddenRuleItem -----------------------------------------
+
+/* [Description]
+
+ This item describe how to handle the last character of a line.
+*/
+
+class EDITENG_DLLPUBLIC SvxForbiddenRuleItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxForbiddenRuleItem( sal_Bool bOn /*= sal_False*/,
+ const sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ inline SvxForbiddenRuleItem& operator=(
+ const SvxForbiddenRuleItem& rItem )
+ {
+ SetValue( rItem.GetValue() );
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/formatbreakitem.hxx b/include/editeng/formatbreakitem.hxx
new file mode 100644
index 000000000000..229e1d05f55f
--- /dev/null
+++ b/include/editeng/formatbreakitem.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_BRKITEM_HXX
+#define _SVX_BRKITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/svxenum.hxx>
+#include <editeng/editengdllapi.h>
+
+
+// class SvxFmtBreakItem -------------------------------------------------
+
+/* [Description]
+
+ This item Describes a wrap-attribute
+ Automatic?, Page or column break, before or after?
+*/
+#define FMTBREAK_NOAUTO ((sal_uInt16)0x0001)
+
+class EDITENG_DLLPUBLIC SvxFmtBreakItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ inline SvxFmtBreakItem( const SvxBreak eBrk /*= SVX_BREAK_NONE*/,
+ const sal_uInt16 nWhich );
+ inline SvxFmtBreakItem( const SvxFmtBreakItem& rBreak );
+ inline SvxFmtBreakItem& operator=( const SvxFmtBreakItem& rCpy );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 ) const;
+ virtual sal_uInt16 GetValueCount() const;
+
+ // MS VC4.0 messes things up
+ void SetValue( sal_uInt16 nNewVal )
+ {SfxEnumItem::SetValue(nNewVal); }
+ SvxBreak GetBreak() const { return SvxBreak( GetValue() ); }
+ void SetBreak( const SvxBreak eNew )
+ { SetValue( (sal_uInt16)eNew ); }
+};
+
+
+inline SvxFmtBreakItem::SvxFmtBreakItem( const SvxBreak eBreak,
+ const sal_uInt16 _nWhich ) :
+ SfxEnumItem( _nWhich, (sal_uInt16)eBreak )
+{}
+
+inline SvxFmtBreakItem::SvxFmtBreakItem( const SvxFmtBreakItem& rBreak ) :
+ SfxEnumItem( rBreak )
+{}
+
+inline SvxFmtBreakItem& SvxFmtBreakItem::operator=(
+ const SvxFmtBreakItem& rBreak )
+{
+ SetValue( rBreak.GetValue() );
+ return *this;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/frmdir.hxx b/include/editeng/frmdir.hxx
new file mode 100644
index 000000000000..f687c32c5610
--- /dev/null
+++ b/include/editeng/frmdir.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 _SVX_FRMDIR_HXX
+#define _SVX_FRMDIR_HXX
+
+// ----------------------------------------------------------------------------
+
+/** Defines possible text directions in frames. */
+enum SvxFrameDirection
+{
+ /** Horizontal, from left to right, from top to bottom
+ (typical for western languages). */
+ FRMDIR_HORI_LEFT_TOP,
+
+ /** Horizontal, from right to left, from top to bottom
+ (typical for ararbic/hebrew languages). */
+ FRMDIR_HORI_RIGHT_TOP,
+
+ /** Vertical, from top to bottom, from right to left
+ (typical for asian languages). */
+ FRMDIR_VERT_TOP_RIGHT,
+
+ /** Vertical, from top to bottom, from left to right
+ (typical for mongol language). */
+ FRMDIR_VERT_TOP_LEFT,
+
+ /** Use the value from the environment, can only be used in frames. */
+ FRMDIR_ENVIRONMENT
+};
+
+// ----------------------------------------------------------------------------
+
+#endif // #ifndef _SVX_FRMDIR_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/frmdiritem.hxx b/include/editeng/frmdiritem.hxx
new file mode 100644
index 000000000000..6ea04dc66f09
--- /dev/null
+++ b/include/editeng/frmdiritem.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 _SVX_FRMDIRITEM_HXX
+#define _SVX_FRMDIRITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <editeng/frmdir.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxFrameDirectionItem ----------------------------------------------
+
+/* [Description]
+
+ This item defines a frame direction, which place the content inside
+ a frame. It exist different kind of directions which are used to the
+ layout text for Western, CJK and CTL languages.
+*/
+
+class EDITENG_DLLPUBLIC SvxFrameDirectionItem : public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+
+ SvxFrameDirectionItem( SvxFrameDirection nValue /*= FRMDIR_HORI_LEFT_TOP*/,
+ sal_uInt16 nWhich );
+ virtual ~SvxFrameDirectionItem();
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream & rStrm, sal_uInt16 nIVer) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ inline SvxFrameDirectionItem& operator=( const SvxFrameDirectionItem& rItem )
+ {
+ SetValue( rItem.GetValue() );
+ return *this;
+ }
+};
+
+#endif // #ifndef _SVX_FRMDIRITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/fwdtitem.hxx b/include/editeng/fwdtitem.hxx
new file mode 100644
index 000000000000..73f897ffc06d
--- /dev/null
+++ b/include/editeng/fwdtitem.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 _SVX_FWDTITEM_HXX
+#define _SVX_FWDTITEM_HXX
+
+#include <svl/poolitem.hxx>
+
+
+// class SvxFontWidthItem -----------------------------------------------
+
+
+/* [Description]
+
+ This item describes the font width.
+*/
+
+class SvxFontWidthItem : public SfxPoolItem
+{
+ sal_uInt16 nWidth; // 0 = default
+ sal_uInt16 nProp; // default 100%
+public:
+ TYPEINFO();
+
+ SvxFontWidthItem( const sal_uInt16 nSz /*= 0*/,
+ const sal_uInt16 nPropWidth /*= 100*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual bool ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
+
+ inline SvxFontWidthItem& operator=(const SvxFontWidthItem& rItem )
+ {
+ SetWidthValue( rItem.GetWidth() );
+ SetProp( rItem.GetProp() );
+ return *this;
+ }
+
+ void SetWidth( sal_uInt16 nNewWidth, const sal_uInt16 nNewProp = 100 )
+ {
+ DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
+ nWidth = sal_uInt16(( (sal_uInt32)nNewWidth * nNewProp ) / 100 );
+ nProp = nNewProp;
+ }
+
+ sal_uInt16 GetWidth() const { return nWidth; }
+
+ void SetWidthValue( sal_uInt16 nNewWidth )
+ {
+ DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
+ nWidth = nNewWidth;
+ }
+
+ void SetProp( const sal_uInt16 nNewProp )
+ {
+ DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
+ nProp = nNewProp;
+ }
+
+ sal_uInt16 GetProp() const { return nProp; }
+};
+
+
+
+
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/hangulhanja.hxx b/include/editeng/hangulhanja.hxx
new file mode 100644
index 000000000000..014dc3e229a9
--- /dev/null
+++ b/include/editeng/hangulhanja.hxx
@@ -0,0 +1,288 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef SVX_HANGUL_HANJA_CONVERSION_HXX
+#define SVX_HANGUL_HANJA_CONVERSION_HXX
+
+#include <vcl/window.hxx>
+#include <memory>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include "editeng/editengdllapi.h"
+#include <i18nlangtag/mslangid.hxx>
+
+//.............................................................................
+namespace editeng
+{
+//.............................................................................
+
+ class HangulHanjaConversion_Impl;
+
+ //=========================================================================
+ //= HangulHanjaConversion
+ //=========================================================================
+ /** encapsulates Hangul-Hanja conversion functionality
+
+ <p>terminology:
+ <ul><li>A <b>text <em>portion</em></b> is some (potentially large) piece of text
+ which is to be analyzed for convertible sub-strings.</li>
+ <li>A <b>text <em>unit</em></b> is a sub string in a text portion, which is
+ to be converted as a whole.</li>
+ </ul>
+ For instance, you could have two independent selections within your document, which are then
+ two text portions. A text unit would be single Hangul/Hanja words within a portion, or even
+ single Hangul syllabills when "replace by character" is enabled.
+ </p>
+ */
+ class EDITENG_DLLPUBLIC HangulHanjaConversion
+ {
+ friend class HangulHanjaConversion_Impl;
+
+ public:
+ enum ReplacementAction
+ {
+ eExchange, // simply exchange one text with another
+ eReplacementBracketed, // keep the original, and put the replacement in brackets after it
+ eOriginalBracketed, // replace the original text, but put it in brackeds after the replacement
+ eReplacementAbove, // keep the original, and put the replacement text as ruby text above it
+ eOriginalAbove, // replace the original text, but put it as ruby text above it
+ eReplacementBelow, // keep the original, and put the replacement text as ruby text below it
+ eOriginalBelow // replace the original text, but put it as ruby text below it
+ };
+
+ enum ConversionType // does not specify direction...
+ {
+ eConvHangulHanja, // Korean Hangul/Hanja conversion
+ eConvSimplifiedTraditional // Chinese simplified / Chinese traditional conversion
+ };
+
+ // Note: conversion direction for eConvSimplifiedTraditional is
+ // specified by source language.
+ // This one is for Hangul/Hanja where source and target language
+ // are the same.
+ enum ConversionDirection
+ {
+ eHangulToHanja,
+ eHanjaToHangul
+ };
+
+ enum ConversionFormat
+ {
+ eSimpleConversion, // used for simplified / traditional Chinese as well
+ eHangulBracketed,
+ eHanjaBracketed,
+ eRubyHanjaAbove,
+ eRubyHanjaBelow,
+ eRubyHangulAbove,
+ eRubyHangulBelow
+ };
+
+ private:
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ ::std::auto_ptr< HangulHanjaConversion_Impl > m_pImpl;
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+
+ // used to set initial values of m_pImpl object from saved ones
+ static bool m_bUseSavedValues; // defines if the followng two values should be used for initialization
+ static bool m_bTryBothDirectionsSave;
+ static ConversionDirection m_ePrimaryConversionDirectionSave;
+
+ // Forbidden and not implemented.
+ HangulHanjaConversion (const HangulHanjaConversion &);
+ HangulHanjaConversion & operator= (const HangulHanjaConversion &);
+
+ public:
+ HangulHanjaConversion(
+ Window* _pUIParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::lang::Locale& _rSourceLocale,
+ const ::com::sun::star::lang::Locale& _rTargetLocale,
+ const Font* _pTargetFont,
+ sal_Int32 nOptions,
+ bool _bIsInteractive
+ );
+
+ virtual ~HangulHanjaConversion( );
+
+ // converts the whole document
+ void ConvertDocument();
+
+ LanguageType GetSourceLanguage() const;
+ LanguageType GetTargetLanguage() const;
+ const Font * GetTargetFont() const;
+ sal_Int32 GetConversionOptions() const;
+ bool IsInteractive() const;
+
+ // chinese text conversion
+ static inline bool IsSimplified( LanguageType nLang );
+ static inline bool IsTraditional( LanguageType nLang );
+ static inline bool IsChinese( LanguageType nLang );
+
+ // used to specify that the conversion direction states from the
+ // last incarnation should be used as
+ // initial conversion direction for the next incarnation.
+ // (A hack used to transport a state information from
+ // one incarnation to the next. Used in Writers text conversion...)
+ static void SetUseSavedConversionDirectionState( bool bVal );
+ static bool IsUseSavedConversionDirectionState();
+
+ protected:
+ /** retrieves the next text portion which is to be analyzed
+
+ <p>pseudo-abstract, needs to be overridden</p>
+
+ @param _rNextPortion
+ upon return, this must contain the next text portion
+ @param _rLangOfPortion
+ upon return, this must contain the language for the found text portion.
+ (necessary for Chinese translation since there are 5 language variants
+ too look for even if the 'source' language usually is only 'simplified'
+ or 'traditional'.)
+ */
+ virtual void GetNextPortion(
+ OUString& /* [out] */ _rNextPortion,
+ LanguageType& /* [out] */ _rLangOfPortion,
+ bool /* [in] */ _bAllowImplicitChangesForNotConvertibleText ) = 0;
+
+ /** announces a new "current unit"
+
+ <p>This will be called whenever it is necessary to interactively ask the user for
+ a conversion. In such a case, a range within the current portion (see <member>GetNextPortion</member>)
+ is presented to the user for chosing a substitution. Additionally, this method is called,
+ so that derived classes can e.g. highlight this text range in a document view.</p>
+
+ <p>Note that the indexes are relative to the most recent replace action. See
+ <member>ReplaceUnit</member> for details.</p>
+
+ @param _nUnitStart
+ the start index of the unit
+
+ @param _nUnitEnd
+ the start index (exclusively!) of the unit.
+
+ @param _bAllowImplicitChangesForNotConvertibleText
+ allows implicit changes other than the text itself for the
+ text parts not being convertible.
+ Used for chinese translation to attribute all not convertible
+ text (e.g. western text, empty paragraphs, spaces, ...) to
+ the target language and target font of the conversion.
+ This is to ensure that after the conversion any new text entered
+ anywhere in the document will have the target language (of course
+ CJK Language only) and target font (CJK font only) set.
+
+ @see GetNextPortion
+ */
+ virtual void HandleNewUnit( const sal_Int32 _nUnitStart, const sal_Int32 _nUnitEnd ) = 0;
+
+ /** replaces a text unit within a text portion with a new text
+
+ <p>pseudo-abstract, needs to be overridden</p>
+
+ <p>Note an important thing about the indicies: They are always relative to the <em>previous
+ call</em> of ReplaceUnit. This means whe you get a call to ReplaceUnit, and replace some text
+ in your document, than you have to remember the document position immediately <em>behind</em>
+ the changed text. In a next call to ReplaceUnit, an index of <em>0</em> will denote exactly
+ this position behind the previous replacement<br/>
+ The reaons for this is that this class here does not know anything about your document structure,
+ so after a replacement took place, it's impossible to address anything in the range from the
+ beginning of the portion up to the replaced text.<br/>
+ In the very first call to ReplaceUnit, an index of <em>0</em> denotes the very first position of
+ the current portion.</p>
+
+ <p>If the language of the text to be replaced is different from
+ the target language (as given by 'GetTargetLanguage') for example
+ when converting simplified Chinese from/to traditional Chinese
+ the language attribute of the new text has to be changed as well,
+ **and** the font is to be set to the default (document) font for
+ that language.</p>
+
+ @param _nUnitStart
+ the start index of the range to replace
+
+ @param _nUnitEnd
+ the end index (exclusively!) of the range to replace. E.g., an index
+ pair (4,5) indicates a range of length 1.
+
+ @param _rOrigText
+ the original text to be replaced (as returned by GetNextPortion).
+ Since in Chinese conversion the original text is needed as well
+ in order to only do the minimal necassry text changes and to keep
+ as much attributes as possible this is supplied here as well.
+
+ @param _rReplaceWith
+ The replacement text
+
+ @param _rOffsets
+ An sequence matching the indices (characters) of _rReplaceWith
+ to the indices of the characters in the original text they are
+ replacing.
+ This is necessary since some portions of the text may get
+ converted in portions of different length than the original.
+ The sequence will be empty if all conversions in the text are
+ of equal length. That is if always the character at index i in
+ _rOffsets is replacing the character at index i in the original
+ text for all valid index values of i.
+
+ @param _eAction
+ replacement action to take
+
+ @param pNewUnitLanguage
+ if the replacement unit is required to have a new language that
+ is specified here. If the language is to be left unchanged this
+ is the 0 pointer.
+ */
+ virtual void ReplaceUnit(
+ const sal_Int32 _nUnitStart, const sal_Int32 _nUnitEnd,
+ const OUString& _rOrigText,
+ const OUString& _rReplaceWith,
+ const ::com::sun::star::uno::Sequence< sal_Int32 > &_rOffsets,
+ ReplacementAction _eAction,
+ LanguageType *pNewUnitLanguage
+ ) = 0;
+
+ /** specifies if rubies are supported by the document implementing
+ this class.
+
+ @return
+ <TRUE/> if rubies are supported.
+ */
+ virtual bool HasRubySupport() const = 0;
+ };
+
+ bool HangulHanjaConversion::IsSimplified( LanguageType nLang )
+ {
+ return MsLangId::isSimplifiedChinese(nLang);
+ }
+
+ bool HangulHanjaConversion::IsTraditional( LanguageType nLang )
+ {
+ return MsLangId::isTraditionalChinese(nLang);
+ }
+
+ bool HangulHanjaConversion::IsChinese( LanguageType nLang )
+ {
+ return MsLangId::isChinese(nLang);
+ }
+//.............................................................................
+} // namespace svx
+//.............................................................................
+
+#endif // SVX_HANGUL_HANJA_CONVERSION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/hngpnctitem.hxx b/include/editeng/hngpnctitem.hxx
new file mode 100644
index 000000000000..4454faab0b76
--- /dev/null
+++ b/include/editeng/hngpnctitem.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 _SVX_HNGPNCTITEM_HXX
+#define _SVX_HNGPNCTITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxHangingPunctuationItem -----------------------------------------
+
+/* [Description]
+
+ This item describe how to handle the last character of a line.
+*/
+
+class EDITENG_DLLPUBLIC SvxHangingPunctuationItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxHangingPunctuationItem( sal_Bool bOn /*= sal_False*/,
+ const sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ inline SvxHangingPunctuationItem& operator=(
+ const SvxHangingPunctuationItem& rItem )
+ {
+ SetValue( rItem.GetValue() );
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/hyphenzoneitem.hxx b/include/editeng/hyphenzoneitem.hxx
new file mode 100644
index 000000000000..3f0682096772
--- /dev/null
+++ b/include/editeng/hyphenzoneitem.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 _SVX_HYZNITEM_HXX
+#define _SVX_HYZNITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxHyphenZoneItem -----------------------------------------------
+
+/* [Description]
+
+ This item describes a hyphenation attribute (automatic?, number of
+ characters at the end of the line and start).
+*/
+
+class EDITENG_DLLPUBLIC SvxHyphenZoneItem : public SfxPoolItem
+{
+ sal_Bool bHyphen: 1;
+ sal_Bool bPageEnd: 1;
+ sal_uInt8 nMinLead;
+ sal_uInt8 nMinTrail;
+ sal_uInt8 nMaxHyphens;
+
+ friend SvStream & operator<<( SvStream & aS, SvxHyphenZoneItem & );
+
+public:
+ TYPEINFO();
+
+ SvxHyphenZoneItem( const sal_Bool bHyph /*= sal_False*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+
+ inline void SetHyphen( const sal_Bool bNew ) { bHyphen = bNew; }
+ inline sal_Bool IsHyphen() const { return bHyphen; }
+
+ inline void SetPageEnd( const sal_Bool bNew ) { bPageEnd = bNew; }
+ inline sal_Bool IsPageEnd() const { return bPageEnd; }
+
+ inline sal_uInt8 &GetMinLead() { return nMinLead; }
+ inline sal_uInt8 GetMinLead() const { return nMinLead; }
+
+ inline sal_uInt8 &GetMinTrail() { return nMinTrail; }
+ inline sal_uInt8 GetMinTrail() const { return nMinTrail; }
+
+ inline sal_uInt8 &GetMaxHyphens() { return nMaxHyphens; }
+ inline sal_uInt8 GetMaxHyphens() const { return nMaxHyphens; }
+
+ inline SvxHyphenZoneItem &operator=( const SvxHyphenZoneItem &rNew )
+ {
+ bHyphen = rNew.IsHyphen();
+ bPageEnd = rNew.IsPageEnd();
+ nMinLead = rNew.GetMinLead();
+ nMinTrail = rNew.GetMinTrail();
+ nMaxHyphens = rNew.GetMaxHyphens();
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/itemtype.hxx b/include/editeng/itemtype.hxx
new file mode 100644
index 000000000000..422cb3b9e22e
--- /dev/null
+++ b/include/editeng/itemtype.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 _SVX_ITEMTYPE_HXX
+#define _SVX_ITEMTYPE_HXX
+
+#include <editeng/editrids.hrc>
+#include <editeng/eerdll.hxx>
+
+// forward ---------------------------------------------------------------
+#include <tools/string.hxx>
+#include <tools/resid.hxx>
+#include <tools/bigint.hxx>
+#include <svl/poolitem.hxx>
+#include <tools/shl.hxx>
+#include "editeng/editengdllapi.h"
+
+class Color;
+class IntlWrapper;
+// static and prototypes -------------------------------------------------
+
+static const sal_Unicode cpDelim[] = { ',' , ' ', '\0' };
+
+EDITENG_DLLPUBLIC String GetSvxString( sal_uInt16 nId );
+EDITENG_DLLPUBLIC String GetMetricText( long nVal, SfxMapUnit eSrcUnit, SfxMapUnit eDestUnit, const IntlWrapper * pIntl );
+String GetColorString( const Color& rCol );
+EDITENG_DLLPUBLIC sal_uInt16 GetMetricId( SfxMapUnit eUnit );
+
+// -----------------------------------------------------------------------
+
+inline String GetBoolString( sal_Bool bVal )
+{
+ return EE_RESSTR(bVal ? RID_SVXITEMS_TRUE : RID_SVXITEMS_FALSE);
+}
+
+// -----------------------------------------------------------------------
+
+inline long Scale( long nVal, long nMult, long nDiv )
+{
+ BigInt aVal( nVal );
+ aVal *= nMult;
+ aVal += nDiv/2;
+ aVal /= nDiv;
+ return aVal;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/justifyitem.hxx b/include/editeng/justifyitem.hxx
new file mode 100644
index 000000000000..cfbdcff00a65
--- /dev/null
+++ b/include/editeng/justifyitem.hxx
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __EDITENG_JUSTIFYITEM_HXX__
+#define __EDITENG_JUSTIFYITEM_HXX__
+
+#include "editeng/editengdllapi.h"
+#include "editeng/svxenum.hxx"
+#include <svl/eitem.hxx>
+#include <sal/types.h>
+
+class EDITENG_DLLPUBLIC SvxHorJustifyItem: public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ explicit SvxHorJustifyItem( const sal_uInt16 nId );
+
+ SvxHorJustifyItem(
+ const SvxCellHorJustify eJustify /*= SVX_HOR_JUSTIFY_STANDARD*/,
+ const sal_uInt16 nId );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual sal_uInt16 GetValueCount() const;
+ virtual String GetValueText( sal_uInt16 nVal ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const;
+
+ inline SvxHorJustifyItem& operator=(const SvxHorJustifyItem& rHorJustify)
+ {
+ SetValue( rHorJustify.GetValue() );
+ return *this;
+ }
+};
+
+//------------------------------------------------------------------------
+
+class EDITENG_DLLPUBLIC SvxVerJustifyItem: public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ explicit SvxVerJustifyItem( const sal_uInt16 nId );
+
+ SvxVerJustifyItem(
+ const SvxCellVerJustify eJustify /*= SVX_VER_JUSTIFY_STANDARD*/,
+ const sal_uInt16 nId );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual sal_uInt16 GetValueCount() const;
+ virtual String GetValueText( sal_uInt16 nVal ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const;
+
+ inline SvxVerJustifyItem& operator=(const SvxVerJustifyItem& rVerJustify)
+ {
+ SetValue( rVerJustify.GetValue() );
+ return *this;
+ }
+};
+
+//------------------------------------------------------------------------
+
+class EDITENG_DLLPUBLIC SvxJustifyMethodItem: public SfxEnumItem
+{
+public:
+ SvxJustifyMethodItem(
+ const SvxCellJustifyMethod eMethod,
+ const sal_uInt16 nId );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual sal_uInt16 GetValueCount() const;
+ virtual String GetValueText( sal_uInt16 nVal ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const;
+
+ SvxJustifyMethodItem& operator=(const SvxJustifyMethodItem& r);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/keepitem.hxx b/include/editeng/keepitem.hxx
new file mode 100644
index 000000000000..57e8fe022af4
--- /dev/null
+++ b/include/editeng/keepitem.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 _SVX_KEEPITEM_HXX
+#define _SVX_KEEPITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+
+// class SvxFmtKeepItem ------------------------------------------------
+
+/* [Description]
+
+ This item describes a logical variable "keep paragraphs together?".
+*/
+
+class EDITENG_DLLPUBLIC SvxFmtKeepItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ inline SvxFmtKeepItem( const sal_Bool bKeep /*= sal_False*/,
+ const sal_uInt16 _nWhich );
+ inline SvxFmtKeepItem& operator=( const SvxFmtKeepItem& rSplit );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 ) const;
+ virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+inline SvxFmtKeepItem::SvxFmtKeepItem( const sal_Bool bKeep, const sal_uInt16 _nWhich ) :
+ SfxBoolItem( _nWhich, bKeep )
+{}
+
+inline SvxFmtKeepItem& SvxFmtKeepItem::operator=( const SvxFmtKeepItem& rKeep )
+{
+ SetValue( rKeep.GetValue() );
+ return *this;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/kernitem.hxx b/include/editeng/kernitem.hxx
new file mode 100644
index 000000000000..1b5f937afc01
--- /dev/null
+++ b/include/editeng/kernitem.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 _SVX_KERNITEM_HXX
+#define _SVX_KERNITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxKerningItem --------------------------------------------------
+
+// Note: Twips value
+// Twips: 0 = no kerning
+
+/* [Description]
+
+ This item describes the kerning.
+*/
+
+class EDITENG_DLLPUBLIC SvxKerningItem : public SfxInt16Item
+{
+public:
+ TYPEINFO();
+
+ SvxKerningItem( const short nKern /*= 0*/, const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual bool ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ inline SvxKerningItem& operator=(const SvxKerningItem& rKern) {
+ SetValue( rKern.GetValue() );
+ return *this;
+ }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/langitem.hxx b/include/editeng/langitem.hxx
new file mode 100644
index 000000000000..e1231cded21c
--- /dev/null
+++ b/include/editeng/langitem.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 _SVX_LANGITEM_HXX
+#define _SVX_LANGITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <i18nlangtag/lang.h>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxLanguageItem -------------------------------------------------
+
+/* [Description]
+
+ This item describes a Language.
+*/
+
+class EDITENG_DLLPUBLIC SvxLanguageItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ SvxLanguageItem( const LanguageType eLang /*= LANGUAGE_GERMAN*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual sal_uInt16 GetValueCount() const;
+
+ inline SvxLanguageItem& operator=(const SvxLanguageItem& rLang)
+ {
+ SetValue( rLang.GetValue() );
+ return *this;
+ }
+
+ // enum cast
+ LanguageType GetLanguage() const
+ { return (LanguageType)GetValue(); }
+ void SetLanguage( const LanguageType eLang )
+ { SetValue( (sal_uInt16)eLang ); }
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/lcolitem.hxx b/include/editeng/lcolitem.hxx
new file mode 100644
index 000000000000..5b97c52d6c6d
--- /dev/null
+++ b/include/editeng/lcolitem.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 _SVX_LCOLITEM_HXX
+#define _SVX_LCOLITEM_HXX
+
+#include <editeng/colritem.hxx>
+#include <editeng/editengdllapi.h>
+
+/*
+ * Dummy item for ToolBox controller:
+ *
+ */
+
+class EDITENG_DLLPUBLIC SvxLineColorItem : public SvxColorItem
+{
+public:
+ TYPEINFO();
+
+ explicit SvxLineColorItem( const sal_uInt16 nId );
+ SvxLineColorItem( const SvxLineColorItem& rCopy );
+ ~SvxLineColorItem();
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * pIntlWrapper = 0 )
+ const;
+
+ inline SvxLineColorItem& operator=(const SvxLineColorItem& rColor)
+ { return (SvxLineColorItem&)SvxColorItem::
+ operator=((const SvxColorItem&)rColor); }
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/lineitem.hxx b/include/editeng/lineitem.hxx
new file mode 100644
index 000000000000..07ad4da38bc5
--- /dev/null
+++ b/include/editeng/lineitem.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 _SVX_BOLNITEM_HXX
+#define _SVX_BOLNITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include "editeng/editengdllapi.h"
+
+
+
+// class SvxLineItem -----------------------------------------------------
+
+
+/*
+[Description]
+This Item transports a editeng::SvxBorderLine.
+*/
+
+namespace editeng {
+ class SvxBorderLine;
+}
+
+class EDITENG_DLLPUBLIC SvxLineItem : public SfxPoolItem
+{
+public:
+ TYPEINFO();
+
+ explicit SvxLineItem( const sal_uInt16 nId );
+ SvxLineItem( const SvxLineItem& rCpy );
+ ~SvxLineItem();
+ SvxLineItem &operator=( const SvxLineItem& rLine );
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual bool ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
+
+ const editeng::SvxBorderLine* GetLine () const { return pLine; }
+ void SetLine ( const editeng::SvxBorderLine *pNew );
+
+private:
+ editeng::SvxBorderLine* pLine;
+};
+
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/lrspitem.hxx b/include/editeng/lrspitem.hxx
new file mode 100644
index 000000000000..a7e95ccb6e63
--- /dev/null
+++ b/include/editeng/lrspitem.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 _SVX_LRSPITEM_HXX
+#define _SVX_LRSPITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <editeng/editengdllapi.h>
+
+
+// class SvxLRSpaceItem --------------------------------------------------
+
+/* [Description]
+
+ Left/Right margin and first line indent
+
+ SvxLRSpaceItem offers two interfaces for views from the left margin and
+ first line indent. The get methods return the member, with the layout also
+ as expected: the left edge shifts to the negative first line indent to the
+ left. The SetTxt/Gettxt methods assume that the left side represents the
+ 0 coordinate for the first line indent:
+
+ UI UI LAYOUT UI/TEXT UI/TEXT (Where?)
+ SetTxtLeft SetTxtFirst GetLeft GetTxtLeft GetTxtFirst (What?)
+ 500 -500 0 500 -500 (How much?)
+ 500 0 500 500 0
+ 500 +500 500 500 +500
+ 700 -500 200 700 -500
+*/
+
+#define LRSPACE_16_VERSION ((sal_uInt16)0x0001)
+#define LRSPACE_TXTLEFT_VERSION ((sal_uInt16)0x0002)
+#define LRSPACE_AUTOFIRST_VERSION ((sal_uInt16)0x0003)
+#define LRSPACE_NEGATIVE_VERSION ((sal_uInt16)0x0004)
+
+class EDITENG_DLLPUBLIC SvxLRSpaceItem : public SfxPoolItem
+{
+ short nFirstLineOfst; // First-line indent _always_ relative to nTxtLeft
+ long nTxtLeft; // We spend a sal_uInt16
+ long nLeftMargin; // nLeft or the negative first-line indent
+ long nRightMargin; // The unproblematic right edge
+
+ sal_uInt16 nPropFirstLineOfst, nPropLeftMargin, nPropRightMargin;
+ sal_Bool bAutoFirst : 1; // Automatic calculation of the first line indent
+
+ void AdjustLeft(); // nLeftMargin and nTxtLeft are being adjusted.
+
+public:
+ TYPEINFO();
+
+ explicit SvxLRSpaceItem( const sal_uInt16 nId );
+ SvxLRSpaceItem( const long nLeft, const long nRight,
+ const long nTLeft /*= 0*/, const short nOfset /*= 0*/,
+ const sal_uInt16 nId );
+ inline SvxLRSpaceItem& operator=( const SvxLRSpaceItem &rCpy );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+ virtual bool ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
+
+ // Die "Layout-Schnittstelle":
+ inline void SetLeft ( const long nL, const sal_uInt16 nProp = 100 );
+ inline void SetRight( const long nR, const sal_uInt16 nProp = 100 );
+
+ // Query/direct setting of the absolute values
+ inline long GetLeft() const { return nLeftMargin; }
+ inline long GetRight() const { return nRightMargin;}
+ inline void SetLeftValue( const long nL ) { nTxtLeft = nLeftMargin = nL; }
+ inline void SetRightValue( const long nR ) { nRightMargin = nR; }
+ inline sal_Bool IsAutoFirst() const { return bAutoFirst; }
+ inline void SetAutoFirst( const sal_Bool bNew ) { bAutoFirst = bNew; }
+
+ // Query/Setting the percentage values
+ inline void SetPropLeft( const sal_uInt16 nProp = 100 )
+ { nPropLeftMargin = nProp; }
+ inline void SetPropRight( const sal_uInt16 nProp = 100 )
+ { nPropRightMargin = nProp;}
+ inline sal_uInt16 GetPropLeft() const { return nPropLeftMargin; }
+ inline sal_uInt16 GetPropRight() const { return nPropRightMargin;}
+
+ // The UI/text interface:
+ inline void SetTxtLeft( const long nL, const sal_uInt16 nProp = 100 );
+ inline long GetTxtLeft() const { return nTxtLeft; }
+
+ inline void SetTxtFirstLineOfst( const short nF, const sal_uInt16 nProp = 100 );
+ inline short GetTxtFirstLineOfst() const { return nFirstLineOfst; }
+ inline void SetPropTxtFirstLineOfst( const sal_uInt16 nProp = 100 )
+ { nPropFirstLineOfst = nProp; }
+ inline sal_uInt16 GetPropTxtFirstLineOfst() const
+ { return nPropFirstLineOfst; }
+ inline void SetTxtFirstLineOfstValue( const short nValue )
+ { nFirstLineOfst = nValue; }
+};
+
+inline SvxLRSpaceItem &SvxLRSpaceItem::operator=( const SvxLRSpaceItem &rCpy )
+{
+ nFirstLineOfst = rCpy.nFirstLineOfst;
+ nTxtLeft = rCpy.nTxtLeft;
+ nLeftMargin = rCpy.nLeftMargin;
+ nRightMargin = rCpy.nRightMargin;
+ nPropFirstLineOfst = rCpy.nPropFirstLineOfst;
+ nPropLeftMargin = rCpy.nPropLeftMargin;
+ nPropRightMargin = rCpy.nPropRightMargin;
+ bAutoFirst = rCpy.bAutoFirst;
+ return *this;
+}
+
+inline void SvxLRSpaceItem::SetLeft( const long nL, const sal_uInt16 nProp )
+{
+ nLeftMargin = (nL * nProp) / 100;
+ nTxtLeft = nLeftMargin;
+ nPropLeftMargin = nProp;
+}
+inline void SvxLRSpaceItem::SetRight( const long nR, const sal_uInt16 nProp )
+{
+ nRightMargin = (nR * nProp) / 100;
+ nPropRightMargin = nProp;
+}
+inline void SvxLRSpaceItem::SetTxtFirstLineOfst( const short nF,
+ const sal_uInt16 nProp )
+{
+ nFirstLineOfst = short((long(nF) * nProp ) / 100);
+ nPropFirstLineOfst = nProp;
+ AdjustLeft();
+}
+
+inline void SvxLRSpaceItem::SetTxtLeft( const long nL, const sal_uInt16 nProp )
+{
+ nTxtLeft = (nL * nProp) / 100;
+ nPropLeftMargin = nProp;
+ AdjustLeft();
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/lspcitem.hxx b/include/editeng/lspcitem.hxx
new file mode 100644
index 000000000000..de0a163e34e6
--- /dev/null
+++ b/include/editeng/lspcitem.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 _SVX_LSPCITEM_HXX
+#define _SVX_LSPCITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/svxenum.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxLineSpacingItem ----------------------------------------------
+
+/* [Description]
+ This item describes the distance between the lines.
+*/
+
+#define LINE_SPACE_DEFAULT_HEIGHT 200
+class EDITENG_DLLPUBLIC SvxLineSpacingItem : public SfxEnumItemInterface
+{
+ friend SvStream& operator<<( SvStream&, SvxLineSpacingItem& ); //$ ostream
+
+ short nInterLineSpace;
+ sal_uInt16 nLineHeight;
+ sal_uInt8 nPropLineSpace;
+ SvxLineSpace eLineSpace;
+ SvxInterLineSpace eInterLineSpace;
+
+public:
+ TYPEINFO();
+
+ // The writer relies on a default height of 200! Actually, I would
+ // initialize all values to 0, but who can ignore the consequences in
+ // writer? => Rather have a crooked vales as the default, but the
+ // programmer sees that there's something special happening.
+
+ SvxLineSpacingItem( sal_uInt16 nHeight /*= LINE_SPACE_DEFAULT_HEIGHT*/, const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+
+ // Methods to query and edit. InterlineSpace is added to the height.
+ inline short GetInterLineSpace() const { return nInterLineSpace; }
+ inline void SetInterLineSpace( const short nSpace )
+ {
+ nInterLineSpace = nSpace;
+ eInterLineSpace = SVX_INTER_LINE_SPACE_FIX;
+ }
+
+ // Determines the absolute or minimum row height.
+ inline sal_uInt16 GetLineHeight() const { return nLineHeight; }
+ inline void SetLineHeight( const sal_uInt16 nHeight )
+ {
+ nLineHeight = nHeight;
+ eLineSpace = SVX_LINE_SPACE_MIN;
+ }
+
+ // To increase or decrease the row height.
+ sal_uInt8 GetPropLineSpace() const { return nPropLineSpace; }
+ inline void SetPropLineSpace( const sal_uInt8 nProp )
+ {
+ nPropLineSpace = nProp;
+ eInterLineSpace = SVX_INTER_LINE_SPACE_PROP;
+ }
+
+ inline SvxLineSpace &GetLineSpaceRule() { return eLineSpace; }
+ inline SvxLineSpace GetLineSpaceRule() const { return eLineSpace; }
+
+ inline SvxInterLineSpace &GetInterLineSpaceRule() { return eInterLineSpace; }
+ inline SvxInterLineSpace GetInterLineSpaceRule() const { return eInterLineSpace; }
+
+ virtual sal_uInt16 GetValueCount() const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetEnumValue() const;
+ virtual void SetEnumValue( sal_uInt16 nNewVal );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/macros.hxx b/include/editeng/macros.hxx
new file mode 100644
index 000000000000..c667cfd6e8b8
--- /dev/null
+++ b/include/editeng/macros.hxx
@@ -0,0 +1,17 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 __EDITENGINE_MACROS_HXX__
+#define __EDITENGINE_MACROS_HXX__
+
+#define DEBUG_EDIT_ENGINE 0
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/measfld.hxx b/include/editeng/measfld.hxx
new file mode 100644
index 000000000000..040560397dd0
--- /dev/null
+++ b/include/editeng/measfld.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 _EDIT_MEASFIELD_HXX
+#define _EDIT_MEASFIELD_HXX
+
+#include <editeng/eeitem.hxx>
+
+#ifndef _FLDITEM_HXX
+#ifndef ITEMID_FIELD
+#include <editeng/editdata.hxx> /* this include is needed due to EE_FEATURE_FIELD */
+#define ITEMID_FIELD EE_FEATURE_FIELD /* is needed for #include <editeng/flditem.hxx> */
+#endif
+#include <editeng/flditem.hxx>
+#endif
+#include "editeng/editengdllapi.h"
+
+#include <com/sun/star/text/textfield/Type.hpp>
+
+class SdrMeasureObj;
+
+enum SdrMeasureFieldKind {SDRMEASUREFIELD_VALUE,SDRMEASUREFIELD_UNIT,SDRMEASUREFIELD_ROTA90BLANCS};
+
+class EDITENG_DLLPUBLIC SdrMeasureField: public SvxFieldData {
+ SdrMeasureFieldKind eMeasureFieldKind;
+public:
+ SV_DECL_PERSIST1(SdrMeasureField,SvxFieldData,com::sun::star::text::textfield::Type::MEASURE)
+ SdrMeasureField(): eMeasureFieldKind(SDRMEASUREFIELD_VALUE) {}
+ SdrMeasureField(SdrMeasureFieldKind eNewKind): eMeasureFieldKind(eNewKind) {}
+ virtual ~SdrMeasureField();
+ virtual SvxFieldData* Clone() const;
+ virtual int operator==(const SvxFieldData&) const;
+ SdrMeasureFieldKind GetMeasureFieldKind() const { return eMeasureFieldKind; }
+ void SetMeasureFieldKind(SdrMeasureFieldKind eNewKind) { eMeasureFieldKind=eNewKind; }
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_SVDFIELD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/memberids.hrc b/include/editeng/memberids.hrc
new file mode 100644
index 000000000000..1dbe7ba9da5f
--- /dev/null
+++ b/include/editeng/memberids.hrc
@@ -0,0 +1,185 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _EDT_UNOMID_HXX
+#define _EDT_UNOMID_HXX
+
+#include <svl/memberid.hrc>
+
+#define MID_LOCATION 0x3c
+#define MID_TRANSPARENT 0x4b
+#define MID_BG_COLOR 0x22
+#define MID_FLAGS 0x2e
+#define MID_DISTANCE 0x29
+#define MID_FG_COLOR 0x2c
+#define MID_OUTER_WIDTH 0x41
+#define MID_INNER_WIDTH 0x35
+#define MID_LINESPACE 0x3b
+#define MID_LINE_STYLE 0x90
+
+
+//NameOrIndex
+#define MID_NAME 16
+#define MID_GRAFURL 32
+
+// SvxPageModelItem
+#define MID_AUTO 1
+
+// SvxTabStop
+#define MID_TABSTOPS 0
+#define MID_STD_TAB 1
+
+//SvxHyphenZoneItem
+#define MID_IS_HYPHEN 0
+#define MID_HYPHEN_MIN_LEAD 1
+#define MID_HYPHEN_MIN_TRAIL 2
+#define MID_HYPHEN_MAX_HYPHENS 3
+
+// SvxBoxInfoItem
+#define MID_HORIZONTAL 1
+#define MID_VERTICAL 2
+#define MID_VALIDFLAGS 4
+
+//AdjustItem
+#define MID_PARA_ADJUST 0
+#define MID_LAST_LINE_ADJUST 1
+#define MID_EXPAND_SINGLE 2
+
+//SvxFontItem
+// Don't use 0 as it used for the whole struct
+#define MID_FONT_FAMILY_NAME 1
+#define MID_FONT_STYLE_NAME 2
+#define MID_FONT_FAMILY 3
+#define MID_FONT_CHAR_SET 4
+#define MID_FONT_PITCH 5
+
+// SvxCharReliefItem
+#define MID_RELIEF 0
+
+//SvxCharRotateItem
+#define MID_ROTATE 0
+#define MID_FITTOLINE 1
+
+//SvxExcapementItem
+#define MID_ESC 0
+#define MID_ESC_HEIGHT 1
+#define MID_AUTO_ESC 2
+
+//SvxFontWidthItem
+#define MID_FONTWIDTH 0
+#define MID_FONTWIDTH_PROP 1
+
+//SvxFontHeightItem
+#define MID_FONTHEIGHT 1
+#define MID_FONTHEIGHT_PROP 2
+#define MID_FONTHEIGHT_DIFF 3
+
+//SvxTextLineItem
+#define MID_TEXTLINED 0
+#define MID_TL_STYLE 1
+#define MID_TL_COLOR 2
+#define MID_TL_HASCOLOR 3
+
+//SvxCrossedOutItem
+#define MID_CROSSED_OUT 0
+#define MID_CROSS_OUT 1
+
+//SvxPostureItem
+#define MID_ITALIC 0
+#define MID_POSTURE 1
+
+//SvxBoolItem
+#define MID_BOLD 0
+#define MID_WEIGHT 1
+
+//SvxLanguageItem
+#define MID_LANG_INT 0
+#define MID_LANG_LOCALE 1
+
+//SvxEmphasisMarkItem
+#define MID_EMPHASIS 0
+
+//SvxTwoLinesItem
+#define MID_TWOLINES 0
+#define MID_START_BRACKET 1
+#define MID_END_BRACKET 2
+
+//ULSpaceItem
+#define MID_UP_MARGIN 3
+#define MID_LO_MARGIN 4
+#define MID_UP_REL_MARGIN 5
+#define MID_LO_REL_MARGIN 6
+#define MID_CTX_MARGIN 7
+
+//LRSpaceItem
+#define MID_L_MARGIN 4
+#define MID_R_MARGIN 5
+#define MID_L_REL_MARGIN 6
+#define MID_R_REL_MARGIN 7
+#define MID_FIRST_LINE_INDENT 8
+#define MID_FIRST_LINE_REL_INDENT 9
+#define MID_FIRST_AUTO 10
+#define MID_TXT_LMARGIN 11
+
+//ProtectItem
+#define MID_PROTECT_CONTENT 0
+#define MID_PROTECT_SIZE 1
+#define MID_PROTECT_POSITION 2
+
+//SvxBoxItem
+#define LEFT_BORDER 1
+#define RIGHT_BORDER 2
+#define TOP_BORDER 3
+#define BOTTOM_BORDER 4
+#define BORDER_DISTANCE 5
+#define LEFT_BORDER_DISTANCE 6
+#define RIGHT_BORDER_DISTANCE 7
+#define TOP_BORDER_DISTANCE 8
+#define BOTTOM_BORDER_DISTANCE 9
+#define MID_LEFT_BORDER 10
+#define MID_RIGHT_BORDER 11
+#define MID_TOP_BORDER 12
+#define MID_BOTTOM_BORDER 13
+#define LINE_STYLE 14
+#define LINE_WIDTH 15
+
+//BrushItem
+#define MID_BACK_COLOR 0
+#define MID_GRAPHIC_POSITION 1
+#define MID_GRAPHIC_LINK 2
+#define MID_GRAPHIC 3
+#define MID_GRAPHIC_TRANSPARENT 4
+#define MID_GRAPHIC_URL 5
+#define MID_GRAPHIC_FILTER 6
+#define MID_GRAPHIC_REPEAT 7
+#define MID_GRAPHIC_TRANSPARENCY 8
+#define MID_BACK_COLOR_R_G_B 9
+#define MID_BACK_COLOR_TRANSPARENCY 10
+
+//SvxFmtBreakItem
+#define MID_BREAK_BEFORE 0
+#define MID_BREAK_AFTER 1
+
+// SvxHorJustifyItem
+#define MID_HORJUST_HORJUST 0
+#define MID_HORJUST_ADJUST 1
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/mutxhelp.hxx b/include/editeng/mutxhelp.hxx
new file mode 100644
index 000000000000..14b36347b74d
--- /dev/null
+++ b/include/editeng/mutxhelp.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 _SVX_MUTXHELP_HXX
+#define _SVX_MUTXHELP_HXX
+
+#include <osl/mutex.hxx>
+
+class SvxMutexHelper
+{
+private:
+ ::osl::Mutex maMutex;
+
+public:
+ ::osl::Mutex& getMutex() { return maMutex; }
+};
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/nhypitem.hxx b/include/editeng/nhypitem.hxx
new file mode 100644
index 000000000000..51942c318bbd
--- /dev/null
+++ b/include/editeng/nhypitem.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 _SVX_NHYPITEM_HXX
+#define _SVX_NHYPITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxNoHyphenItem -------------------------------------------------
+class EDITENG_DLLPUBLIC SvxNoHyphenItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxNoHyphenItem( const sal_Bool bHyphen /*= sal_True*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ inline SvxNoHyphenItem& operator=(const SvxNoHyphenItem& rNHH)
+ {
+ SetValue( rNHH.GetValue() );
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/nlbkitem.hxx b/include/editeng/nlbkitem.hxx
new file mode 100644
index 000000000000..209b0539ba07
--- /dev/null
+++ b/include/editeng/nlbkitem.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 _SVX_NLBKITEM_HXX
+#define _SVX_NLBKITEM_HXX
+
+#include <svl/eitem.hxx>
+#include "editeng/editengdllapi.h"
+
+// class SvxNoLinebreakItem ----------------------------------------------
+class EDITENG_DLLPUBLIC SvxNoLinebreakItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxNoLinebreakItem( const sal_Bool bBreak /*= sal_True*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ inline SvxNoLinebreakItem& operator=(const SvxNoLinebreakItem& rLB)
+ {
+ SetValue( rLB.GetValue() );
+ return *this;
+ }
+};
+
+
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/numdef.hxx b/include/editeng/numdef.hxx
new file mode 100644
index 000000000000..28f94d2d3ae5
--- /dev/null
+++ b/include/editeng/numdef.hxx
@@ -0,0 +1,23 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#define SVX_MAX_NUM 10 // max. possible numbering level
+#define SVX_DEF_BULLET (0xF000 + 149)// Character for lists
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
new file mode 100644
index 000000000000..9f88e79de0ec
--- /dev/null
+++ b/include/editeng/numitem.hxx
@@ -0,0 +1,356 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_NUMITEM_HXX
+#define _SVX_NUMITEM_HXX
+
+#include <tools/link.hxx>
+#include <tools/string.hxx>
+#include <svl/poolitem.hxx>
+#include <editeng/svxenum.hxx>
+#include <tools/gen.hxx>
+#include <editeng/numdef.hxx>
+#include <tools/color.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/style/NumberingType.hpp>
+#include <unotools/fontcvt.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvxBrushItem;
+class Font;
+class Graphic;
+class SvxNodeNum;
+namespace com{namespace sun{ namespace star{
+ namespace text{
+ class XNumberingFormatter;
+ }
+}}}
+
+// -----------------------------------------------------------------------
+//Feature-Flags (only sal_uInt16!)
+#define NUM_CONTINUOUS 0x0001 // consecutive numbers possible?
+#define NUM_CHAR_TEXT_DISTANCE 0x0002 // Distance Symbol<->Text?
+#define NUM_CHAR_STYLE 0x0004 // Character styles?
+#define NUM_BULLET_REL_SIZE 0x0008 // relative bullet size?
+#define NUM_BULLET_COLOR 0x0010 // Bullet color
+#define NUM_SYMBOL_ALIGNMENT 0x0040 // alignment to be shown in the options
+#define NUM_NO_NUMBERS 0x0080 // Numbering are not allowed
+#define NUM_ENABLE_LINKED_BMP 0x0100 // linked bitmaps are available
+#define NUM_ENABLE_EMBEDDED_BMP 0x0200 // embedded bitmaps are available
+
+#define SVX_NO_NUM 200 // Marker for no numbering
+#define SVX_NO_NUMLEVEL 0x20
+
+#define LINK_TOKEN 0x80 //indicate linked bitmaps - for use in dialog only
+class EDITENG_DLLPUBLIC SvxNumberType
+{
+ static sal_Int32 nRefCount;
+ static com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter> xFormatter;
+
+ sal_Int16 nNumType;
+ sal_Bool bShowSymbol; // Also show Symbol ?
+
+public:
+ explicit SvxNumberType(sal_Int16 nType = com::sun::star::style::NumberingType::ARABIC);
+ SvxNumberType(const SvxNumberType& rType);
+ ~SvxNumberType();
+
+ String GetNumStr( sal_uLong nNo ) const;
+ String GetNumStr( sal_uLong nNo, const com::sun::star::lang::Locale& rLocale ) const;
+
+ void SetNumberingType(sal_Int16 nSet) {nNumType = nSet;}
+ sal_Int16 GetNumberingType() const {return nNumType;}
+
+ void SetShowSymbol(sal_Bool bSet) {bShowSymbol = bSet;}
+ sal_Bool IsShowSymbol()const{return bShowSymbol;}
+
+ sal_Bool IsTxtFmt() const
+ {
+ return com::sun::star::style::NumberingType::NUMBER_NONE != nNumType &&
+ com::sun::star::style::NumberingType::CHAR_SPECIAL != nNumType &&
+ com::sun::star::style::NumberingType::BITMAP != nNumType;
+ }
+};
+
+class EDITENG_DLLPUBLIC SvxNumberFormat : public SvxNumberType
+{
+public:
+ enum SvxNumPositionAndSpaceMode
+ {
+ LABEL_WIDTH_AND_POSITION,
+ LABEL_ALIGNMENT
+ };
+ enum LabelFollowedBy
+ {
+ LISTTAB,
+ SPACE,
+ NOTHING
+ };
+
+private:
+ OUString sPrefix;
+ OUString sSuffix;
+
+ SvxAdjust eNumAdjust;
+
+ sal_uInt8 nInclUpperLevels; // Take over numbers from the previous level.
+ sal_uInt16 nStart; // Start of counting
+
+ sal_Unicode cBullet; // Symbol
+ sal_uInt16 nBulletRelSize; // percentage size of bullets
+ Color nBulletColor; // Bullet color
+
+ // mode indicating, if the position and spacing of the list label is
+ // determined by the former attributes (nFirstLineOffset, nAbsLSpace,
+ // nLSpace and nCharTextDistance) called position and spacing via label
+ // width and position (LABEL_WIDTH_AND_POSITION) or by the new attributes
+ // (meLabelFollowedBy, mnListtabPos, mnFirstLineIndent and mnIndentAt)
+ // called position and spacing via label alignment.
+ // Note 1: Attribute <eNumAdjust> is relevant for both modes.
+ // Note 2: The values of the former attributes are treated as 0, if mode
+ // LABEL_ALIGNMENT is active.
+ SvxNumPositionAndSpaceMode mePositionAndSpaceMode;
+
+ short nFirstLineOffset; // First line indent
+ short nAbsLSpace; // Distance Border<->Number
+ short nLSpace; // relative to the previous indentation
+ short nCharTextDistance; // Distance Number<->Text
+
+ // specifies what follows the list label before the text of the first line
+ // of the list item starts
+ LabelFollowedBy meLabelFollowedBy;
+ // specifies an additional list tab stop position for meLabelFollowedBy = LISTTAB
+ long mnListtabPos;
+ // specifies the first line indent
+ long mnFirstLineIndent;
+ // specifies the indent before the text, e.g. in L2R-layout the left margin
+ long mnIndentAt;
+
+ SvxBrushItem* pGraphicBrush;
+ sal_Int16 eVertOrient; // vertical alignment of a bitmap
+
+ Size aGraphicSize; // Always! in 1/100 mm
+ Font* pBulletFont; // Pointer to the bullet font
+
+ String sCharStyleName; // Character Style
+
+ DECL_STATIC_LINK( SvxNumberFormat, GraphicArrived, void * );
+ virtual void NotifyGraphicArrived();
+public:
+ explicit SvxNumberFormat( sal_Int16 nNumberingType,
+ SvxNumPositionAndSpaceMode ePositionAndSpaceMode = LABEL_WIDTH_AND_POSITION );
+ SvxNumberFormat(const SvxNumberFormat& rFormat);
+ SvxNumberFormat( SvStream & rStream );
+
+ virtual ~SvxNumberFormat();
+
+ SvStream& Store(SvStream &rStream, FontToSubsFontConverter pConverter);
+ SvxNumberFormat* Create(SvStream& rStream );
+
+ SvxNumberFormat& operator=( const SvxNumberFormat& );
+ sal_Bool operator==( const SvxNumberFormat& ) const;
+ sal_Bool operator!=( const SvxNumberFormat& rFmt) const {return !(*this == rFmt);}
+
+ void SetNumAdjust(SvxAdjust eSet) {eNumAdjust = eSet;}
+ SvxAdjust GetNumAdjust() const {return eNumAdjust;}
+ void SetPrefix(const OUString& rSet) { sPrefix = rSet;}
+ const OUString& GetPrefix() const { return sPrefix;}
+ void SetSuffix(const OUString& rSet) { sSuffix = rSet;}
+ const OUString& GetSuffix() const { return sSuffix;}
+
+ void SetCharFmtName(const String& rSet){ sCharStyleName = rSet; }
+ virtual const String& GetCharFmtName()const;
+
+ void SetBulletFont(const Font* pFont);
+ const Font* GetBulletFont() const {return pBulletFont;}
+ void SetBulletChar(sal_Unicode cSet){cBullet = cSet;}
+ sal_Unicode GetBulletChar()const {return cBullet;}
+ void SetBulletRelSize(sal_uInt16 nSet) {nBulletRelSize = nSet;}
+ sal_uInt16 GetBulletRelSize() const { return nBulletRelSize;}
+ void SetBulletColor(Color nSet){nBulletColor = nSet;}
+ Color GetBulletColor()const {return nBulletColor;}
+
+ void SetIncludeUpperLevels( sal_uInt8 nSet ) { nInclUpperLevels = nSet;}
+ sal_uInt8 GetIncludeUpperLevels()const { return nInclUpperLevels;}
+ void SetStart(sal_uInt16 nSet) {nStart = nSet;}
+ sal_uInt16 GetStart() const {return nStart;}
+
+ virtual void SetGraphicBrush( const SvxBrushItem* pBrushItem, const Size* pSize = 0, const sal_Int16* pOrient = 0);
+ const SvxBrushItem* GetBrush() const {return pGraphicBrush;}
+ void SetGraphic( const String& rName );
+ virtual void SetVertOrient(sal_Int16 eSet);
+ virtual sal_Int16 GetVertOrient() const;
+ void SetGraphicSize(const Size& rSet) {aGraphicSize = rSet;}
+ const Size& GetGraphicSize() const {return aGraphicSize;}
+
+ SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const;
+ void SetPositionAndSpaceMode( SvxNumPositionAndSpaceMode ePositionAndSpaceMode );
+
+ void SetLSpace(short nSet) {nLSpace = nSet;}
+ short GetLSpace() const;
+ void SetAbsLSpace(short nSet) {nAbsLSpace = nSet;}
+ short GetAbsLSpace() const;
+ void SetFirstLineOffset(short nSet) { nFirstLineOffset = nSet;}
+ short GetFirstLineOffset() const;
+ void SetCharTextDistance(short nSet) { nCharTextDistance = nSet; }
+ short GetCharTextDistance() const;
+
+ void SetLabelFollowedBy( const LabelFollowedBy eLabelFollowedBy );
+ LabelFollowedBy GetLabelFollowedBy() const;
+ void SetListtabPos( const long nListtabPos );
+ long GetListtabPos() const;
+ void SetFirstLineIndent( const long nFirstLineIndent );
+ long GetFirstLineIndent() const;
+ void SetIndentAt( const long nIndentAt );
+ long GetIndentAt() const;
+
+ static Size GetGraphicSizeMM100(const Graphic* pGraphic);
+ static String CreateRomanString( sal_uLong nNo, sal_Bool bUpper );
+};
+
+enum SvxNumRuleType
+{
+ SVX_RULETYPE_NUMBERING,
+ SVX_RULETYPE_OUTLINE_NUMBERING,
+ SVX_RULETYPE_PRESENTATION_NUMBERING,
+ SVX_RULETYPE_END
+};
+
+class EDITENG_DLLPUBLIC SvxNumRule
+{
+ sal_uInt16 nLevelCount; // Number of supported levels
+ sal_uInt32 nFeatureFlags; // What is supported?
+ SvxNumRuleType eNumberingType; // Type of numbering
+ sal_Bool bContinuousNumbering; // sequential numbering
+
+ SvxNumberFormat* aFmts[SVX_MAX_NUM];
+ sal_Bool aFmtsSet[SVX_MAX_NUM]; // Flags indicating valid levels
+
+ static sal_Int32 nRefCount;
+ com::sun::star::lang::Locale aLocale;
+public:
+ SvxNumRule( sal_uLong nFeatures,
+ sal_uInt16 nLevels,
+ sal_Bool bCont,
+ SvxNumRuleType eType = SVX_RULETYPE_NUMBERING,
+ SvxNumberFormat::SvxNumPositionAndSpaceMode
+ eDefaultNumberFormatPositionAndSpaceMode
+ = SvxNumberFormat::LABEL_WIDTH_AND_POSITION );
+ SvxNumRule(const SvxNumRule& rCopy);
+ SvxNumRule(SvStream &rStream);
+ virtual ~SvxNumRule();
+
+ int operator==( const SvxNumRule& ) const;
+ int operator!=( const SvxNumRule& rRule ) const {return !(*this == rRule);}
+
+ SvxNumRule& operator=( const SvxNumRule& );
+
+ SvStream& Store(SvStream &rStream);
+ SvxNumRule* Create(SvStream &rStream);
+ const SvxNumberFormat* Get(sal_uInt16 nLevel)const;
+ const SvxNumberFormat& GetLevel(sal_uInt16 nLevel)const;
+ void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat& rFmt, sal_Bool bIsValid = sal_True);
+ void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat* pFmt);
+
+ sal_Bool IsContinuousNumbering()const
+ {return bContinuousNumbering;}
+ void SetContinuousNumbering(sal_Bool bSet)
+ {bContinuousNumbering = bSet;}
+
+ sal_uInt16 GetLevelCount() const {return nLevelCount;}
+ sal_Bool IsFeatureSupported(sal_uInt32 nFeature) const
+ {return 0 != (nFeatureFlags & nFeature);}
+ sal_uInt32 GetFeatureFlags() const {return nFeatureFlags;}
+ void SetFeatureFlag( sal_uInt32 nFlag, sal_Bool bSet = sal_True ) { if(bSet) nFeatureFlags |= nFlag; else nFeatureFlags &= ~nFlag; }
+
+ String MakeNumString( const SvxNodeNum&, sal_Bool bInclStrings = sal_True ) const;
+
+ SvxNumRuleType GetNumRuleType() const { return eNumberingType; }
+ void SetNumRuleType( const SvxNumRuleType& rType ) { eNumberingType = rType; }
+
+ sal_Bool UnLinkGraphics();
+};
+
+class EDITENG_DLLPUBLIC SvxNumBulletItem : public SfxPoolItem
+{
+ SvxNumRule* pNumRule;
+public:
+ explicit SvxNumBulletItem(SvxNumRule& rRule);
+ SvxNumBulletItem(SvxNumRule& rRule, sal_uInt16 nWhich );
+ SvxNumBulletItem(const SvxNumBulletItem& rCopy);
+ virtual ~SvxNumBulletItem();
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &rStream, sal_uInt16 nItemVersion) const;
+ sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+ virtual SvStream& Store(SvStream &rStream, sal_uInt16 nItemVersion ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ SvxNumRule* GetNumRule() const {return pNumRule;}
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+class SvxNodeNum
+{
+ sal_uInt16 nLevelVal[ SVX_MAX_NUM ]; // Numbers of all levels
+ sal_uInt16 nSetValue; // predetermined number
+ sal_uInt8 nMyLevel; // Current Level
+ sal_Bool bStartNum; // Restart numbering
+
+public:
+ explicit inline SvxNodeNum( sal_uInt8 nLevel = SVX_NO_NUM, sal_uInt16 nSetVal = USHRT_MAX );
+ inline SvxNodeNum& operator=( const SvxNodeNum& rCpy );
+
+ sal_uInt8 GetLevel() const { return nMyLevel; }
+ void SetLevel( sal_uInt8 nVal ) { nMyLevel = nVal; }
+
+ sal_Bool IsStart() const { return bStartNum; }
+ void SetStart( sal_Bool bFlag = sal_True ) { bStartNum = bFlag; }
+
+ sal_uInt16 GetSetValue() const { return nSetValue; }
+ void SetSetValue( sal_uInt16 nVal ) { nSetValue = nVal; }
+
+ const sal_uInt16* GetLevelVal() const { return nLevelVal; }
+ sal_uInt16* GetLevelVal() { return nLevelVal; }
+};
+
+SvxNodeNum::SvxNodeNum( sal_uInt8 nLevel, sal_uInt16 nSetVal )
+ : nSetValue( nSetVal ), nMyLevel( nLevel ), bStartNum( sal_False )
+{
+ memset( nLevelVal, 0, sizeof( nLevelVal ) );
+}
+
+inline SvxNodeNum& SvxNodeNum::operator=( const SvxNodeNum& rCpy )
+{
+ nSetValue = rCpy.nSetValue;
+ nMyLevel = rCpy.nMyLevel;
+ bStartNum = rCpy.bStartNum;
+
+ memcpy( nLevelVal, rCpy.nLevelVal, sizeof( nLevelVal ) );
+ return *this;
+}
+
+SvxNumRule* SvxConvertNumRule( const SvxNumRule* pRule, sal_uInt16 nLevel, SvxNumRuleType eType );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/opaqitem.hxx b/include/editeng/opaqitem.hxx
new file mode 100644
index 000000000000..7780c4237c5d
--- /dev/null
+++ b/include/editeng/opaqitem.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 _SVX_OPAQITEM_HXX
+#define _SVX_OPAQITEM_HXX
+
+#include <svl/eitem.hxx>
+#include "editeng/editengdllapi.h"
+
+class SvXMLUnitConverter;
+
+// class SvxOpaqueItem ---------------------------------------------------
+
+
+/* [Description]
+
+ This item describes a logical variable "Opaque yes or no."
+*/
+
+class EDITENG_DLLPUBLIC SvxOpaqueItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ explicit SvxOpaqueItem( const sal_uInt16 nId , const sal_Bool bOpa = sal_True );
+ inline SvxOpaqueItem &operator=( const SvxOpaqueItem &rCpy );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+inline SvxOpaqueItem::SvxOpaqueItem( const sal_uInt16 nId, const sal_Bool bOpa )
+ : SfxBoolItem( nId, bOpa )
+{}
+
+inline SvxOpaqueItem &SvxOpaqueItem::operator=( const SvxOpaqueItem &rCpy )
+{
+ SetValue( rCpy.GetValue() );
+ return *this;
+}
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/optitems.hxx b/include/editeng/optitems.hxx
new file mode 100644
index 000000000000..34970ebbc42c
--- /dev/null
+++ b/include/editeng/optitems.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 _EDITENG_OPTITEMS_HXX
+#define _EDITENG_OPTITEMS_HXX
+
+#include <svl/poolitem.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <editeng/editengdllapi.h>
+
+// forward ---------------------------------------------------------------
+namespace com { namespace sun { namespace star {
+namespace linguistic2{
+ class XSpellChecker1;
+}}}}
+
+
+// class SfxSpellCheckItem -----------------------------------------------
+
+class EDITENG_DLLPUBLIC SfxSpellCheckItem: public SfxPoolItem
+{
+public:
+ TYPEINFO();
+
+ SfxSpellCheckItem( ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > &xChecker,
+ sal_uInt16 nWhich );
+ SfxSpellCheckItem( const SfxSpellCheckItem& rItem );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 >
+ GetXSpellChecker() const { return xSpellCheck; }
+
+private:
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > xSpellCheck;
+};
+
+
+// class SfxHyphenRegionItem ---------------------------------------------
+
+class EDITENG_DLLPUBLIC SfxHyphenRegionItem: public SfxPoolItem
+{
+ sal_uInt8 nMinLead;
+ sal_uInt8 nMinTrail;
+
+public:
+ TYPEINFO();
+
+ SfxHyphenRegionItem( const sal_uInt16 nId );
+ SfxHyphenRegionItem( const SfxHyphenRegionItem& rItem );
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStrm, sal_uInt16 nVer ) const;
+ virtual SvStream& Store( SvStream& rStrm, sal_uInt16 ) const;
+
+ inline sal_uInt8 &GetMinLead() { return nMinLead; }
+ inline sal_uInt8 GetMinLead() const { return nMinLead; }
+
+ inline sal_uInt8 &GetMinTrail() { return nMinTrail; }
+ inline sal_uInt8 GetMinTrail() const { return nMinTrail; }
+
+ inline SfxHyphenRegionItem& operator=( const SfxHyphenRegionItem& rNew )
+ {
+ nMinLead = rNew.GetMinLead();
+ nMinTrail = rNew.GetMinTrail();
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/orphitem.hxx b/include/editeng/orphitem.hxx
new file mode 100644
index 000000000000..60ef8520c677
--- /dev/null
+++ b/include/editeng/orphitem.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 _SVX_ORPHITEM_HXX
+#define _SVX_ORPHITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxOrphansItem --------------------------------------------------
+
+/* [Description]
+
+ This item describes the number of lines for the orphans system.
+*/
+
+class EDITENG_DLLPUBLIC SvxOrphansItem: public SfxByteItem
+{
+ friend SvStream & operator<<( SvStream & aS, SvxOrphansItem & );
+public:
+ TYPEINFO();
+
+ SvxOrphansItem( const sal_uInt8 nL /*= 0*/, const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ inline SvxOrphansItem& operator=( const SvxOrphansItem& rOrphans )
+ {
+ SetValue( rOrphans.GetValue() );
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
new file mode 100644
index 000000000000..e2f208e9b824
--- /dev/null
+++ b/include/editeng/outliner.hxx
@@ -0,0 +1,1001 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _OUTLINER_HXX
+#define _OUTLINER_HXX
+
+#include <tools/gen.hxx>
+#include <tools/string.hxx>
+
+#include <svl/brdcst.hxx>
+
+#include <editeng/editdata.hxx>
+#include <i18nlangtag/lang.h>
+#include <tools/color.hxx>
+#include <tools/contnr.hxx>
+#include <vcl/graph.hxx>
+#include <tools/link.hxx>
+#include <rsc/rscsfx.hxx>
+#include "editeng/editengdllapi.h"
+#include <com/sun/star/lang/Locale.hpp>
+
+#include <svtools/grfmgr.hxx>
+
+#include <tools/rtti.hxx> // due to typedef TypeId
+#include <vector>
+
+class OutlinerEditEng;
+class Outliner;
+class EditView;
+class EditUndo;
+class ParagraphList;
+class OutlinerParaObject;
+class SvStream;
+class SvxBulletItem;
+class SvxFont;
+class SvxSearchItem;
+class SvxFieldItem;
+class Window;
+class KeyEvent;
+class MouseEvent;
+class Pointer;
+class CommandEvent;
+class MapMode;
+class OutputDevice;
+class PolyPolygon;
+class SfxStyleSheetPool;
+class SfxStyleSheet;
+class SfxItemPool;
+class SfxItemSet;
+class SvxNumBulletItem;
+class SvxNumberFormat;
+class SvxLRSpaceItem;
+class EditEngine;
+class SvKeyValueIterator;
+class SvxForbiddenCharactersTable;
+
+namespace svl
+{
+ class IUndoManager;
+}
+
+#include <com/sun/star/uno/Reference.h>
+
+#include <rtl/ref.hxx>
+#include <editeng/svxfont.hxx>
+#include <editeng/eedata.hxx>
+#include <editeng/paragraphdata.hxx>
+
+class SvxFieldData;
+//////////////////////////////////////////////////////////////////////////////
+
+namespace com { namespace sun { namespace star { namespace linguistic2 {
+ class XSpellChecker1;
+ class XHyphenator;
+}}}}
+namespace svx{
+struct SpellPortion;
+typedef std::vector<SpellPortion> SpellPortions;
+}
+
+namespace basegfx { class B2DPolyPolygon; }
+
+// internal use only!
+#define PARAFLAG_DROPTARGET 0x1000
+#define PARAFLAG_DROPTARGET_EMPTY 0x2000
+#define PARAFLAG_HOLDDEPTH 0x4000
+#define PARAFLAG_SETBULLETTEXT 0x8000
+#define PARAFLAG_ISPAGE 0x0100
+
+// Undo-Action-Ids
+#define OLUNDO_DEPTH EDITUNDO_USER
+// #define OLUNDO_HEIGHT EDITUNDO_USER+1
+#define OLUNDO_EXPAND EDITUNDO_USER+2
+#define OLUNDO_COLLAPSE EDITUNDO_USER+3
+// #define OLUNDO_REMOVE EDITUNDO_USER+4
+#define OLUNDO_ATTR EDITUNDO_USER+5
+#define OLUNDO_INSERT EDITUNDO_USER+6
+// #define OLUNDO_MOVEPARAGRAPHS EDITUNDO_USER+7
+#define OLUNDO_CHECKPARA EDITUNDO_USER+8
+
+class Paragraph : protected ParagraphData
+{
+private:
+ friend class Outliner;
+ friend class ParagraphList;
+ friend class OutlinerView;
+ friend class OutlinerParaObject;
+ friend class OutlinerEditEng;
+ friend class OutlinerUndoCheckPara;
+ friend class OutlinerUndoChangeParaFlags;
+
+ Paragraph& operator=(const Paragraph& rPara );
+
+ sal_uInt16 nFlags;
+ OUString aBulText;
+ Size aBulSize;
+ sal_Bool bVisible;
+
+ sal_Bool IsVisible() const { return bVisible; }
+ void SetText( const OUString& rText ) { aBulText = rText; aBulSize.Width() = -1; }
+ void Invalidate() { aBulSize.Width() = -1; }
+ void SetDepth( sal_Int16 nNewDepth ) { nDepth = nNewDepth; aBulSize.Width() = -1; }
+ const OUString& GetText() const { return aBulText; }
+
+ Paragraph( sal_Int16 nDepth );
+ Paragraph( const Paragraph& );
+ Paragraph( const ParagraphData& );
+ ~Paragraph();
+
+ sal_Int16 GetDepth() const { return nDepth; }
+
+ sal_Int16 GetNumberingStartValue() const { return mnNumberingStartValue; }
+ void SetNumberingStartValue( sal_Int16 nNumberingStartValue );
+
+ sal_Bool IsParaIsNumberingRestart() const { return mbParaIsNumberingRestart; }
+ void SetParaIsNumberingRestart( sal_Bool bParaIsNumberingRestart );
+
+ void SetFlag( sal_uInt16 nFlag ) { nFlags |= nFlag; }
+ void RemoveFlag( sal_uInt16 nFlag ) { nFlags &= ~nFlag; }
+ bool HasFlag( sal_uInt16 nFlag ) const { return (nFlags & nFlag) != 0; }
+};
+
+struct ParaRange
+{
+ sal_uInt16 nStartPara;
+ sal_uInt16 nEndPara;
+
+ ParaRange( sal_uInt16 nS, sal_uInt16 nE ) { nStartPara = nS, nEndPara = nE; }
+
+ void Adjust();
+ sal_uInt16 Len() const { return 1 + ( ( nEndPara > nStartPara ) ? (nEndPara-nStartPara) : (nStartPara-nEndPara) ); }
+};
+
+inline void ParaRange::Adjust()
+{
+ if ( nStartPara > nEndPara )
+ {
+ sal_uInt16 nTmp = nStartPara;
+ nStartPara = nEndPara;
+ nEndPara = nTmp;
+ }
+}
+
+class EDITENG_DLLPUBLIC OutlinerView
+{
+ friend class Outliner;
+
+private:
+
+ Outliner* pOwner;
+ EditView* pEditView;
+
+ // Drag & Drop
+ sal_Bool bBeginDragAtMove_OLDMEMBER;
+ sal_Bool bInDragMode;
+ Point aDDStartPosRef;
+ Point aDDStartPosPix;
+ sal_uLong nDDStartPara;
+ sal_uLong nDDStartParaVisChildCount;
+ sal_uLong nDDCurPara;
+ sal_uInt16 nDDStartDepth;
+ sal_uInt16 nDDCurDepth;
+ sal_uInt16 nDDMaxDepth;
+ sal_Bool bDDChangingDepth;
+ sal_Bool bDDCursorVisible;
+ long* pHorTabArrDoc;
+ long nDDScrollLRBorderWidthWin; // Left Right
+ long nDDScrollTBBorderWidthWin; // Top Bottom
+ long nDDScrollLROffs;
+ long nDDScrollTDOffs;
+
+ void* pDummy;
+ sal_uLong nDummy;
+
+ enum MouseTarget {
+ MouseText = 0,
+ MouseBullet = 1,
+ MouseHypertext = 2, // Outside OutputArea
+ MouseOutside = 3, // Outside OutputArea
+ MouseDontKnow = 4
+ };
+ MouseTarget OLD_ePrevMouseTarget;
+
+#ifdef _OUTLINER_CXX
+
+ EDITENG_DLLPRIVATE void ImplExpandOrCollaps( sal_uInt16 nStartPara, sal_uInt16 nEndPara, sal_Bool bExpand );
+
+ EDITENG_DLLPRIVATE sal_uLong ImpCheckMousePos( const Point& rPosPixel, MouseTarget& reTarget);
+ EDITENG_DLLPRIVATE void ImpToggleExpand( Paragraph* pParentPara );
+ EDITENG_DLLPRIVATE ParaRange ImpGetSelectedParagraphs( sal_Bool bIncludeHiddenChildren );
+
+ EDITENG_DLLPRIVATE Pointer ImpGetMousePointer( MouseTarget eTarget );
+ EDITENG_DLLPRIVATE sal_uInt16 ImpInitPaste( sal_uLong& rStart );
+ EDITENG_DLLPRIVATE void ImpPasted( sal_uLong nStart, sal_uLong nPrevParaCount, sal_uInt16 nSize);
+ EDITENG_DLLPRIVATE sal_uInt16 ImpCalcSelectedPages( sal_Bool bIncludeFirstSelected );
+ EDITENG_DLLPRIVATE sal_Bool ImpIsIndentingPages();
+
+#endif
+
+public:
+ OutlinerView( Outliner* pOut, Window* pWindow );
+ virtual ~OutlinerView();
+
+ EditView& GetEditView() const { return *pEditView; }
+
+ void Scroll( long nHorzScroll, long nVertScroll );
+
+ void Paint( const Rectangle& rRect, OutputDevice* pTargetDevice = 0 );
+ sal_Bool PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin = NULL );
+ sal_Bool MouseButtonDown( const MouseEvent& );
+ sal_Bool MouseButtonUp( const MouseEvent& );
+ sal_Bool MouseMove( const MouseEvent& );
+
+ void ShowCursor( sal_Bool bGotoCursor = sal_True );
+ void HideCursor();
+
+ Outliner* GetOutliner() const { return pOwner; }
+
+ void SetWindow( Window* pWindow );
+ Window* GetWindow() const;
+
+ void SetReadOnly( sal_Bool bReadOnly );
+ sal_Bool IsReadOnly() const;
+
+ void SetOutputArea( const Rectangle& rRect );
+ Rectangle GetOutputArea() const;
+
+ Rectangle GetVisArea() const;
+
+ void CreateSelectionList (std::vector<Paragraph*> &aSelList) ;
+
+ // Retruns the number of selected paragraphs
+ sal_uLong Select( Paragraph* pParagraph,
+ sal_Bool bSelect=sal_True,
+ sal_Bool bWChildren=sal_True);
+
+ String GetSelected() const;
+ void SelectRange( sal_uLong nFirst, sal_uInt16 nCount );
+ void SetAttribs( const SfxItemSet& );
+ void Indent( short nDiff );
+ void AdjustDepth( short nDX ); // Later replace with Indent!
+
+ sal_Bool AdjustHeight( long nDY );
+
+ sal_uLong Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, sal_Bool bSelect = sal_False, SvKeyValueIterator* pHTTPHeaderAttrs = NULL );
+
+ void InsertText( const String& rNew, sal_Bool bSelect = sal_False );
+ void InsertText( const OutlinerParaObject& rParaObj );
+ void Expand();
+ void Collapse();
+ void ExpandAll();
+ void CollapseAll();
+
+ void SetBackgroundColor( const Color& rColor );
+ Color GetBackgroundColor();
+
+ SfxItemSet GetAttribs();
+
+ void Cut();
+ void Copy();
+ void Paste();
+ void PasteSpecial();
+
+ const SfxStyleSheet* GetStyleSheet() const;
+ SfxStyleSheet* GetStyleSheet();
+
+ void SetControlWord( sal_uLong nWord );
+ sal_uLong GetControlWord() const;
+
+ void SetAnchorMode( EVAnchorMode eMode );
+ EVAnchorMode GetAnchorMode() const;
+
+ Pointer GetPointer( const Point& rPosPixel );
+ void Command( const CommandEvent& rCEvt );
+
+ EESpellState StartSpeller( sal_Bool bMultipleDoc = sal_False );
+ EESpellState StartThesaurus();
+ sal_uInt16 StartSearchAndReplace( const SvxSearchItem& rSearchItem );
+
+ // for text conversion
+ void StartTextConversion( LanguageType nSrcLang, LanguageType nDestLang, const Font *pDestFont, sal_Int32 nOptions, sal_Bool bIsInteractive, sal_Bool bMultipleDoc );
+
+ void TransliterateText( sal_Int32 nTransliterationMode );
+
+ ESelection GetSelection();
+
+ sal_uInt16 GetSelectedScriptType() const;
+
+ void SetVisArea( const Rectangle& rRect );
+ void SetSelection( const ESelection& );
+
+ void RemoveAttribs( sal_Bool bRemoveParaAttribs = sal_False, sal_uInt16 nWhich = 0, sal_Bool bKeepLanguages = sal_False );
+ void RemoveAttribsKeepLanguages( sal_Bool bRemoveParaAttribs );
+ sal_Bool HasSelection() const;
+
+ void InsertField( const SvxFieldItem& rFld );
+ const SvxFieldItem* GetFieldUnderMousePointer() const;
+ const SvxFieldItem* GetFieldAtSelection() const;
+
+ /** enables numbering for the selected paragraphs if the numbering of the first paragraph is off
+ or disables numbering for the selected paragraphs if the numbering of the first paragraph is on
+ */
+ void ToggleBullets();
+
+ /** enables numbering for the selected paragraphs that are not enabled and ignore all selected
+ paragraphs that already have numbering enabled.
+ */
+ void EnableBullets();
+
+ sal_Bool IsCursorAtWrongSpelledWord( sal_Bool bMarkIfWrong = sal_False );
+ sal_Bool IsWrongSpelledWordAtPos( const Point& rPosPixel, sal_Bool bMarkIfWrong = sal_False );
+ void ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack = 0 );
+
+ void SetInvalidateMore( sal_uInt16 nPixel );
+ sal_uInt16 GetInvalidateMore() const;
+
+ String GetSurroundingText() const;
+ Selection GetSurroundingTextSelection() const;
+};
+
+
+// some thesaurus functionality to avoid code duplication in different projects...
+bool EDITENG_DLLPUBLIC GetStatusValueForThesaurusFromContext( String &rStatusVal, LanguageType &rLang, const EditView &rEditView );
+void EDITENG_DLLPUBLIC ReplaceTextWithSynonym( EditView &rEditView, const String &rSynonmText );
+
+typedef ::std::vector< OutlinerView* > ViewList;
+
+class EDITENG_DLLPUBLIC DrawPortionInfo
+{
+public:
+ const Point& mrStartPos;
+ const String& mrText;
+ sal_uInt16 mnTextStart;
+ sal_uInt16 mnTextLen;
+ sal_uInt16 mnPara;
+ xub_StrLen mnIndex;
+ const SvxFont& mrFont;
+ const sal_Int32* mpDXArray;
+
+ const EEngineData::WrongSpellVector* mpWrongSpellVector;
+ const SvxFieldData* mpFieldData;
+ const ::com::sun::star::lang::Locale* mpLocale;
+ const Color maOverlineColor;
+ const Color maTextLineColor;
+
+ sal_uInt8 mnBiDiLevel;
+
+ bool mbFilled;
+ long mnWidthToFill;
+
+ // bitfield
+ unsigned mbEndOfLine : 1;
+ unsigned mbEndOfParagraph : 1;
+ unsigned mbEndOfBullet : 1;
+
+ sal_uInt8 GetBiDiLevel() const { return mnBiDiLevel; }
+ sal_Bool IsRTL() const { return mnBiDiLevel % 2 ? sal_True : sal_False; }
+
+ DrawPortionInfo(
+ const Point& rPos,
+ const String& rTxt,
+ sal_uInt16 nTxtStart,
+ sal_uInt16 nTxtLen,
+ const SvxFont& rFnt,
+ sal_uInt16 nPar,
+ xub_StrLen nIdx,
+ const sal_Int32* pDXArr,
+ const EEngineData::WrongSpellVector* pWrongSpellVector,
+ const SvxFieldData* pFieldData,
+ const ::com::sun::star::lang::Locale* pLocale,
+ const Color& rOverlineColor,
+ const Color& rTextLineColor,
+ sal_uInt8 nBiDiLevel,
+ bool bFilled,
+ long nWidthToFill,
+ bool bEndOfLine,
+ bool bEndOfParagraph,
+ bool bEndOfBullet)
+ : mrStartPos(rPos),
+ mrText(rTxt),
+ mnTextStart(nTxtStart),
+ mnTextLen(nTxtLen),
+ mnPara(nPar),
+ mnIndex(nIdx),
+ mrFont(rFnt),
+ mpDXArray(pDXArr),
+ mpWrongSpellVector(pWrongSpellVector),
+ mpFieldData(pFieldData),
+ mpLocale(pLocale),
+ maOverlineColor(rOverlineColor),
+ maTextLineColor(rTextLineColor),
+ mnBiDiLevel(nBiDiLevel),
+ mbFilled( bFilled ),
+ mnWidthToFill( nWidthToFill ),
+ mbEndOfLine(bEndOfLine),
+ mbEndOfParagraph(bEndOfParagraph),
+ mbEndOfBullet(bEndOfBullet)
+ {}
+};
+
+class EDITENG_DLLPUBLIC DrawBulletInfo
+{
+public:
+ const GraphicObject maBulletGraphicObject;
+ Point maBulletPosition;
+ Size maBulletSize;
+
+ DrawBulletInfo(
+ const GraphicObject& rBulletGraphicObject,
+ const Point& rBulletPosition,
+ const Size& rBulletSize)
+ : maBulletGraphicObject(rBulletGraphicObject),
+ maBulletPosition(rBulletPosition),
+ maBulletSize(rBulletSize)
+ {}
+};
+
+struct EDITENG_DLLPUBLIC PaintFirstLineInfo
+{
+ sal_uInt16 mnPara;
+ const Point& mrStartPos;
+ long mnBaseLineY;
+ const Point& mrOrigin;
+ short mnOrientation;
+ OutputDevice* mpOutDev;
+
+ PaintFirstLineInfo( sal_uInt16 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
+ : mnPara( nPara ), mrStartPos( rStartPos ), mnBaseLineY( nBaseLineY ), mrOrigin( rOrigin ), mnOrientation( nOrientation ), mpOutDev( pOutDev )
+ {}
+};
+
+class SdrPage;
+
+class EditFieldInfo
+{
+private:
+ Outliner* pOutliner;
+ const SvxFieldItem& rFldItem;
+
+ Color* pTxtColor;
+ Color* pFldColor;
+
+ String aRepresentation;
+
+ sal_uInt16 nPara;
+ xub_StrLen nPos;
+ sal_Bool bSimpleClick;
+
+ EditFieldInfo();
+ EditFieldInfo( const EditFieldInfo& );
+
+ SdrPage* mpSdrPage;
+
+public:
+ EditFieldInfo( Outliner* pOutl, const SvxFieldItem& rFItem, sal_uInt16 nPa, xub_StrLen nPo )
+ : rFldItem( rFItem )
+ {
+ pOutliner = pOutl;
+ nPara = nPa; nPos = nPo;
+ pTxtColor = 0; pFldColor = 0; bSimpleClick = sal_False;
+ mpSdrPage = 0;
+ }
+ ~EditFieldInfo()
+ {
+ delete pTxtColor;
+ delete pFldColor;
+ }
+
+ Outliner* GetOutliner() const { return pOutliner; }
+
+ const SvxFieldItem& GetField() const { return rFldItem; }
+
+ Color* GetTxtColor() const { return pTxtColor; }
+ void SetTxtColor( const Color& rColor )
+ { delete pTxtColor; pTxtColor = new Color( rColor ); }
+
+ Color* GetFldColor() const { return pFldColor; }
+ void SetFldColor( const Color& rColor )
+ { delete pFldColor; pFldColor = new Color( rColor ); }
+ void ClearFldColor()
+ { delete pFldColor; pFldColor = 0; }
+
+ sal_uInt16 GetPara() const { return nPara; }
+ xub_StrLen GetPos() const { return nPos; }
+
+ sal_Bool IsSimpleClick() const { return bSimpleClick; }
+ void SetSimpleClick( sal_Bool bSimple ) { bSimpleClick = bSimple; }
+
+ const String& GetRepresentation() const { return aRepresentation; }
+ String& GetRepresentation() { return aRepresentation; }
+ void SetRepresentation( const String& rStr ) { aRepresentation = rStr; }
+
+ void SetSdrPage( SdrPage* pPage ) { mpSdrPage = pPage; }
+ SdrPage* GetSdrPage() const { return mpSdrPage; }
+};
+
+struct EBulletInfo
+{
+ sal_Bool bVisible;
+ sal_uInt16 nType; // see SvxNumberType
+ String aText;
+ SvxFont aFont;
+ Graphic aGraphic;
+ sal_uInt16 nParagraph;
+ Rectangle aBounds;
+
+ EBulletInfo() : bVisible( sal_False ), nType( 0 ), nParagraph( EE_PARA_NOT_FOUND ) {}
+};
+
+#define OUTLINERMODE_DONTKNOW 0x0000
+#define OUTLINERMODE_TEXTOBJECT 0x0001
+#define OUTLINERMODE_TITLEOBJECT 0x0002
+#define OUTLINERMODE_OUTLINEOBJECT 0x0003
+#define OUTLINERMODE_OUTLINEVIEW 0x0004
+
+#define OUTLINERMODE_USERMASK 0x00FF
+
+#define OUTLINERMODE_SUBTITLE (0x0100|OUTLINERMODE_TEXTOBJECT)
+#define OUTLINERMODE_NOTE (0x0200|OUTLINERMODE_TEXTOBJECT)
+
+class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster
+{
+ friend class OutlinerView;
+ friend class OutlinerEditEng;
+ friend class OutlinerParaObject;
+ friend class OLUndoExpand;
+ friend class OutlinerUndoChangeDepth;
+ friend class OutlinerUndoCheckPara;
+ friend class OutlinerUndoChangeParaFlags;
+
+ OutlinerEditEng* pEditEngine;
+
+ ParagraphList* pParaList;
+ ViewList aViewList;
+
+ Paragraph* pHdlParagraph;
+ sal_uLong mnFirstSelPage;
+ Link aDrawPortionHdl;
+ Link aDrawBulletHdl;
+ Link aExpandHdl;
+ Link aParaInsertedHdl;
+ Link aParaRemovingHdl;
+ Link aDepthChangedHdl;
+ Link aWidthArrReqHdl;
+ Link aBeginMovingHdl;
+ Link aEndMovingHdl;
+ Link aIndentingPagesHdl;
+ Link aRemovingPagesHdl;
+ Link aFieldClickedHdl;
+ Link aCalcFieldValueHdl;
+ Link maPaintFirstLineHdl;
+ Link maBeginPasteOrDropHdl;
+ Link maEndPasteOrDropHdl;
+
+ sal_Int16 nDepthChangedHdlPrevDepth;
+ sal_uInt16 mnDepthChangeHdlPrevFlags;
+ sal_Int16 nMaxDepth;
+ const sal_Int16 nMinDepth;
+ sal_uInt16 nFirstPage;
+
+ sal_uInt16 nOutlinerMode;
+
+ sal_Bool bIsExpanding; // Only valid in Expand/Collaps-Hdl, reset
+ sal_Bool bFirstParaIsEmpty;
+ sal_Bool bBlockInsCallback;
+ sal_Bool bStrippingPortions;
+ sal_Bool bPasting;
+
+ sal_uLong nDummy;
+
+#ifdef _OUTLINER_CXX
+
+ DECL_LINK( ParaVisibleStateChangedHdl, Paragraph* );
+ DECL_LINK( BeginMovingParagraphsHdl, void* );
+ DECL_LINK( EndMovingParagraphsHdl, MoveParagraphsInfo* );
+ DECL_LINK( BeginPasteOrDropHdl, PasteOrDropInfos* );
+ DECL_LINK( EndPasteOrDropHdl, PasteOrDropInfos* );
+ DECL_LINK( EditEngineNotifyHdl, EENotify* );
+ void ImplCheckParagraphs( sal_uInt16 nStart, sal_uInt16 nEnd );
+ sal_Bool ImplHasBullet( sal_uInt16 nPara ) const;
+ Size ImplGetBulletSize( sal_uInt16 nPara );
+ sal_uInt16 ImplGetNumbering( sal_uInt16 nPara, const SvxNumberFormat* pParaFmt );
+ void ImplCalcBulletText( sal_uInt16 nPara, sal_Bool bRecalcLevel, sal_Bool bRecalcChildren );
+ String ImplGetBulletText( sal_uInt16 nPara );
+ void ImplCheckNumBulletItem( sal_uInt16 nPara );
+ void ImplInitDepth( sal_uInt16 nPara, sal_Int16 nDepth, sal_Bool bCreateUndo, sal_Bool bUndoAction = sal_False );
+ void ImplSetLevelDependendStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pLevelStyle = NULL );
+
+ void ImplBlockInsertionCallbacks( sal_Bool b );
+
+ void ImplCheckStyleSheet( sal_uInt16 nPara, sal_Bool bReplaceExistingStyle );
+ void ImpRecalcBulletIndent( sal_uLong nPara );
+
+ const SvxBulletItem& ImpGetBullet( sal_uLong nPara, sal_uInt16& );
+ void ImpFilterIndents( sal_uLong nFirstPara, sal_uLong nLastPara );
+ bool ImpConvertEdtToOut( sal_uInt32 nPara, EditView* pView = 0 );
+
+ void ImpTextPasted( sal_uLong nStartPara, sal_uInt16 nCount );
+ long ImpCalcMaxBulletWidth( sal_uInt16 nPara, const SvxBulletItem& rBullet );
+ Font ImpCalcBulletFont( sal_uInt16 nPara ) const;
+ Rectangle ImpCalcBulletArea( sal_uInt16 nPara, sal_Bool bAdjust, sal_Bool bReturnPaperPos );
+ long ImpGetTextIndent( sal_uLong nPara );
+ sal_Bool ImpCanIndentSelectedPages( OutlinerView* pCurView );
+ sal_Bool ImpCanDeleteSelectedPages( OutlinerView* pCurView );
+ sal_Bool ImpCanDeleteSelectedPages( OutlinerView* pCurView, sal_uInt16 nFirstPage, sal_uInt16 nPages );
+
+ sal_uInt16 ImplGetOutlinerMode() const { return nOutlinerMode & OUTLINERMODE_USERMASK; }
+ void ImplCheckDepth( sal_Int16& rnDepth ) const;
+#endif
+
+protected:
+ void ParagraphInserted( sal_uInt16 nParagraph );
+ void ParagraphDeleted( sal_uInt16 nParagraph );
+ void ParaAttribsChanged( sal_uInt16 nParagraph );
+
+ virtual void StyleSheetChanged( SfxStyleSheet* pStyle );
+
+ void InvalidateBullet( Paragraph* pPara, sal_uLong nPara );
+ void PaintBullet( sal_uInt16 nPara, const Point& rStartPos,
+ const Point& rOrigin, short nOrientation,
+ OutputDevice* pOutDev );
+
+ // used by OutlinerEditEng. Allows Outliner objects to provide
+ // bullet access to the EditEngine.
+ virtual const SvxNumberFormat* GetNumberFormat( sal_uInt16 nPara ) const;
+
+public:
+
+ Outliner( SfxItemPool* pPool, sal_uInt16 nOutlinerMode );
+ virtual ~Outliner();
+
+ void Init( sal_uInt16 nOutlinerMode );
+ sal_uInt16 GetMode() const { return nOutlinerMode; }
+
+ void SetVertical( sal_Bool bVertical );
+ sal_Bool IsVertical() const;
+
+ void SetFixedCellHeight( sal_Bool bUseFixedCellHeight );
+
+ void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir );
+ EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const;
+
+ sal_uInt16 GetScriptType( const ESelection& rSelection ) const;
+ LanguageType GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const;
+
+ void SetAsianCompressionMode( sal_uInt16 nCompressionMode );
+
+ void SetKernAsianPunctuation( sal_Bool bEnabled );
+
+ void SetAddExtLeading( sal_Bool b );
+
+ size_t InsertView( OutlinerView* pView, size_t nIndex = size_t(-1) );
+ OutlinerView* RemoveView( OutlinerView* pView );
+ OutlinerView* RemoveView( size_t nIndex );
+ OutlinerView* GetView( size_t nIndex ) const;
+ size_t GetViewCount() const;
+
+ Paragraph* Insert( const String& rText, sal_uLong nAbsPos = CONTAINER_APPEND, sal_Int16 nDepth = 0 );
+ void SetText( const OutlinerParaObject& );
+ void AddText( const OutlinerParaObject& );
+ void SetText( const String& rText, Paragraph* pParagraph );
+ String GetText( Paragraph* pPara, sal_uLong nParaCount=1 ) const;
+
+ OutlinerParaObject* CreateParaObject( sal_uInt16 nStartPara = 0, sal_uInt16 nParaCount = 0xFFFF ) const;
+
+ const SfxItemSet& GetEmptyItemSet() const;
+
+ void SetRefMapMode( const MapMode& );
+ MapMode GetRefMapMode() const;
+
+ void SetBackgroundColor( const Color& rColor );
+ Color GetBackgroundColor() const;
+
+ sal_Int16 GetMinDepth() const { return -1; }
+
+ void SetMaxDepth( sal_Int16 nDepth, sal_Bool bCheckParas = sal_False );
+ sal_Int16 GetMaxDepth() const { return nMaxDepth; }
+
+ void SetUpdateMode( sal_Bool bUpdate );
+ sal_Bool GetUpdateMode() const;
+
+ void Clear();
+
+ void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
+
+ sal_uLong GetParagraphCount() const;
+ Paragraph* GetParagraph( sal_uLong nAbsPos ) const;
+
+ sal_Bool HasParent( Paragraph* pParagraph ) const;
+ sal_Bool HasChildren( Paragraph* pParagraph ) const;
+ sal_uLong GetChildCount( Paragraph* pParent ) const;
+ sal_Bool IsExpanded( Paragraph* pPara ) const;
+ Paragraph* GetParent( Paragraph* pParagraph ) const;
+ sal_uLong GetAbsPos( Paragraph* pPara );
+
+ sal_Int16 GetDepth( sal_uLong nPara ) const;
+ void SetDepth( Paragraph* pParagraph, sal_Int16 nNewDepth );
+
+ sal_Bool IsVisible( Paragraph* pPara ) const { return pPara->IsVisible(); }
+
+ void EnableUndo( sal_Bool bEnable );
+ sal_Bool IsUndoEnabled() const;
+ void UndoActionStart( sal_uInt16 nId );
+ void UndoActionEnd( sal_uInt16 nId );
+ void InsertUndo( EditUndo* pUndo );
+ sal_Bool IsInUndo();
+
+ void ClearModifyFlag();
+ sal_Bool IsModified() const;
+
+ Paragraph* GetHdlParagraph() const { return pHdlParagraph; }
+ sal_Bool IsExpanding() const { return bIsExpanding; }
+
+ virtual void ExpandHdl();
+ void SetExpandHdl( const Link& rLink ) { aExpandHdl = rLink; }
+ Link GetExpandHdl() const { return aExpandHdl; }
+
+ virtual void ParagraphInsertedHdl();
+ void SetParaInsertedHdl(const Link& rLink){aParaInsertedHdl=rLink;}
+ Link GetParaInsertedHdl() const { return aParaInsertedHdl; }
+
+ virtual void ParagraphRemovingHdl();
+ void SetParaRemovingHdl(const Link& rLink){aParaRemovingHdl=rLink;}
+ Link GetParaRemovingHdl() const { return aParaRemovingHdl; }
+
+ virtual void DepthChangedHdl();
+ void SetDepthChangedHdl(const Link& rLink){aDepthChangedHdl=rLink;}
+ Link GetDepthChangedHdl() const { return aDepthChangedHdl; }
+ sal_Int16 GetPrevDepth() const { return nDepthChangedHdlPrevDepth; }
+ sal_uInt16 GetPrevFlags() const { return mnDepthChangeHdlPrevFlags; }
+
+ virtual long RemovingPagesHdl( OutlinerView* );
+ void SetRemovingPagesHdl(const Link& rLink){aRemovingPagesHdl=rLink;}
+ Link GetRemovingPagesHdl() const { return aRemovingPagesHdl; }
+ virtual long IndentingPagesHdl( OutlinerView* );
+ void SetIndentingPagesHdl(const Link& rLink){aIndentingPagesHdl=rLink;}
+ Link GetIndentingPagesHdl() const { return aIndentingPagesHdl; }
+ // valid only in the two upper handlers
+ sal_uInt16 GetSelPageCount() const { return nDepthChangedHdlPrevDepth; }
+
+ // valid only in the two upper handlers
+ sal_uLong GetFirstSelPage() const { return mnFirstSelPage; }
+
+ void SetCalcFieldValueHdl(const Link& rLink ) { aCalcFieldValueHdl= rLink; }
+ Link GetCalcFieldValueHdl() const { return aCalcFieldValueHdl; }
+
+ void SetFieldClickedHdl(const Link& rLink ) { aFieldClickedHdl= rLink; }
+ Link GetFieldClickedHdl() const { return aFieldClickedHdl; }
+
+ void SetDrawPortionHdl(const Link& rLink){aDrawPortionHdl=rLink;}
+ Link GetDrawPortionHdl() const { return aDrawPortionHdl; }
+
+ void SetDrawBulletHdl(const Link& rLink){aDrawBulletHdl=rLink;}
+ Link GetDrawBulletHdl() const { return aDrawBulletHdl; }
+
+ void SetPaintFirstLineHdl(const Link& rLink) { maPaintFirstLineHdl = rLink; }
+ Link GetPaintFirstLineHdl() const { return maPaintFirstLineHdl; }
+
+ void SetModifyHdl( const Link& rLink );
+ Link GetModifyHdl() const;
+
+ void SetNotifyHdl( const Link& rLink );
+
+ void SetStatusEventHdl( const Link& rLink );
+ Link GetStatusEventHdl() const;
+
+ void Draw( OutputDevice* pOutDev, const Rectangle& rOutRect );
+ void Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOrientation = 0 );
+
+ const Size& GetPaperSize() const;
+ void SetPaperSize( const Size& rSize );
+
+ void SetFirstPageNumber( sal_uInt16 n ) { nFirstPage = n; }
+ sal_uInt16 GetFirstPageNumber() const { return nFirstPage; }
+
+ void SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon );
+ void SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B2DPolyPolygon* pLinePolyPolygon);
+ void ClearPolygon();
+
+ const Size& GetMinAutoPaperSize() const;
+ void SetMinAutoPaperSize( const Size& rSz );
+
+ const Size& GetMaxAutoPaperSize() const;
+ void SetMaxAutoPaperSize( const Size& rSz );
+
+ void SetDefTab( sal_uInt16 nTab );
+
+ sal_Bool IsFlatMode() const;
+ void SetFlatMode( sal_Bool bFlat );
+
+ void EnableAutoColor( sal_Bool b );
+
+ void ForceAutoColor( sal_Bool b );
+ sal_Bool IsForceAutoColor() const;
+
+ EBulletInfo GetBulletInfo( sal_uInt16 nPara );
+
+ void SetWordDelimiters( const String& rDelimiters );
+ String GetWordDelimiters() const;
+ String GetWord( sal_uInt16 nPara, xub_StrLen nIndex );
+
+ void StripPortions();
+
+ virtual void DrawingText(
+ const Point& rStartPos, const String& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen,
+ const sal_Int32* pDXArray, const SvxFont& rFont, sal_uInt16 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
+ const EEngineData::WrongSpellVector* pWrongSpellVector,
+ const SvxFieldData* pFieldData,
+ bool bEndOfLine,
+ bool bEndOfParagraph,
+ bool bEndOfBullet,
+ const ::com::sun::star::lang::Locale* pLocale,
+ const Color& rOverlineColor,
+ const Color& rTextLineColor);
+
+ virtual void DrawingTab(
+ const Point& rStartPos, long nWidth, const String& rChar,
+ const SvxFont& rFont, sal_uInt16 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
+ bool bEndOfLine,
+ bool bEndOfParagraph,
+ const Color& rOverlineColor,
+ const Color& rTextLineColor);
+
+ Size CalcTextSize();
+ Size CalcTextSizeNTP();
+
+ void SetStyleSheetPool( SfxStyleSheetPool* pSPool );
+ SfxStyleSheetPool* GetStyleSheetPool();
+
+ sal_Bool IsInSelectionMode() const;
+
+ void SetStyleSheet( sal_uLong nPara, SfxStyleSheet* pStyle );
+ SfxStyleSheet* GetStyleSheet( sal_uLong nPara );
+
+ void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& );
+ SfxItemSet GetParaAttribs( sal_uInt16 nPara );
+
+ void Remove( Paragraph* pPara, sal_uLong nParaCount );
+ sal_Bool Expand( Paragraph* );
+ sal_Bool Collapse( Paragraph* );
+
+ void SetParaFlag( Paragraph* pPara, sal_uInt16 nFlag );
+ bool HasParaFlag( const Paragraph* pPara, sal_uInt16 nFlag ) const;
+
+ // Returns an array containing the widths of the Bullet Indentations
+ // Last value must be -1. Is deleted by the outliner.
+ Link GetWidthArrReqHdl() const{ return aWidthArrReqHdl; }
+ void SetWidthArrReqHdl(const Link& rLink){aWidthArrReqHdl=rLink; }
+
+ void SetControlWord( sal_uLong nWord );
+ sal_uLong GetControlWord() const;
+
+ Link GetBeginMovingHdl() const { return aBeginMovingHdl; }
+ void SetBeginMovingHdl(const Link& rLink) {aBeginMovingHdl=rLink;}
+ Link GetEndMovingHdl() const {return aEndMovingHdl;}
+ void SetEndMovingHdl( const Link& rLink){aEndMovingHdl=rLink;}
+
+ sal_uLong GetLineCount( sal_uLong nParagraph ) const;
+ sal_uInt16 GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const;
+ sal_uLong GetLineHeight( sal_uLong nParagraph, sal_uLong nLine = 0 );
+
+ // nFormat must be a value from the enum EETextFormat (due to CLOOKS)
+ sal_uLong Read( SvStream& rInput, const String& rBaseURL, sal_uInt16, SvKeyValueIterator* pHTTPHeaderAttrs = NULL );
+
+ ::svl::IUndoManager&
+ GetUndoManager();
+
+ void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
+ void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
+ void QuickInsertLineBreak( const ESelection& rSel );
+
+ // Only for EditEngine mode
+ void QuickInsertText( const String& rText, const ESelection& rSel );
+ void QuickDelete( const ESelection& rSel );
+ void QuickRemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich = 0 );
+ void QuickFormatDoc( sal_Bool bFull = sal_False );
+
+ sal_Bool UpdateFields();
+ void RemoveFields( sal_Bool bKeepFieldText, TypeId aType = NULL );
+
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
+ virtual void FieldSelected( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
+ virtual String CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos, Color*& rTxtColor, Color*& rFldColor );
+
+ void SetSpeller( ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > &xSpeller );
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 >
+ GetSpeller();
+ void SetHyphenator( ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenator >& xHyph );
+
+ void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars );
+
+ // Depricated
+ void SetDefaultLanguage( LanguageType eLang );
+ LanguageType GetDefaultLanguage() const;
+
+ void CompleteOnlineSpelling();
+
+ EESpellState HasSpellErrors();
+ sal_Bool HasText( const SvxSearchItem& rSearchItem );
+ virtual sal_Bool SpellNextDocument();
+
+ // for text conversion
+ sal_Bool HasConvertibleTextPortion( LanguageType nLang );
+ virtual sal_Bool ConvertNextDocument();
+
+ void SetEditTextObjectPool( SfxItemPool* pPool );
+ SfxItemPool* GetEditTextObjectPool() const;
+
+ void SetRefDevice( OutputDevice* pRefDev );
+ OutputDevice* GetRefDevice() const;
+
+ sal_uLong GetTextHeight() const;
+ sal_uLong GetTextHeight( sal_uLong nParagraph ) const;
+ Point GetDocPosTopLeft( sal_uLong nParagraph );
+ Point GetDocPos( const Point& rPaperPos ) const;
+ sal_Bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder = 0 );
+ sal_Bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder, sal_Bool* pbBuuletPos );
+
+ void SetGlobalCharStretching( sal_uInt16 nX = 100, sal_uInt16 nY = 100 );
+ void GetGlobalCharStretching( sal_uInt16& rX, sal_uInt16& rY ) const;
+ void EraseVirtualDevice();
+
+ sal_Bool ShouldCreateBigTextObject() const;
+
+ const EditEngine& GetEditEngine() const { return *((EditEngine*)pEditEngine); }
+
+ // this is needed for StarOffice Api
+ void SetLevelDependendStyleSheet( sal_uInt16 nPara );
+
+ sal_uInt16 GetOutlinerMode() const { return nOutlinerMode & OUTLINERMODE_USERMASK; }
+
+ void StartSpelling(EditView& rEditView, sal_Bool bMultipleDoc);
+ // spell and return a sentence
+ bool SpellSentence(EditView& rEditView, ::svx::SpellPortions& rToFill, bool bIsGrammarChecking );
+ // put spell position to start of current sentence
+ void PutSpellingToSentenceStart( EditView& rEditView );
+ // applies a changed sentence
+ void ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bRecheck );
+
+ /** sets a link that is called at the beginning of a drag operation at an edit view */
+ void SetBeginDropHdl( const Link& rLink );
+
+ /** sets a link that is called at the end of a drag operation at an edit view */
+ void SetEndDropHdl( const Link& rLink );
+
+ /** sets a link that is called before a drop or paste operation. */
+ void SetBeginPasteOrDropHdl( const Link& rLink );
+ Link GetBeginPasteOrDropHdl() const { return maBeginPasteOrDropHdl; }
+
+ /** sets a link that is called after a drop or paste operation. */
+ void SetEndPasteOrDropHdl( const Link& rLink );
+ Link GetEndPasteOrDropHdl() const { return maEndPasteOrDropHdl; }
+
+ virtual sal_Int16 GetNumberingStartValue( sal_uInt16 nPara );
+ virtual void SetNumberingStartValue( sal_uInt16 nPara, sal_Int16 nNumberingStartValue );
+
+ virtual sal_Bool IsParaIsNumberingRestart( sal_uInt16 nPara );
+ virtual void SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumberingRestart );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/outlobj.hxx b/include/editeng/outlobj.hxx
new file mode 100644
index 000000000000..73eb9b5b96d5
--- /dev/null
+++ b/include/editeng/outlobj.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 _OUTLOBJ_HXX
+#define _OUTLOBJ_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <rsc/rscsfx.hxx>
+#include <editeng/paragraphdata.hxx>
+#include "editeng/editengdllapi.h"
+
+class EditTextObject;
+class ImplOutlinerParaObject;
+
+//////////////////////////////////////////////////////////////////////////////
+
+class EDITENG_DLLPUBLIC OutlinerParaObject
+{
+private:
+ ImplOutlinerParaObject* mpImplOutlinerParaObject;
+
+ void ImplMakeUnique();
+
+public:
+ // constructors/destructor
+ OutlinerParaObject(
+ const EditTextObject& rEditTextObject,
+ const ParagraphDataVector& rParagraphDataVector = ParagraphDataVector(),
+ bool bIsEditDoc = true);
+ OutlinerParaObject(const OutlinerParaObject& rCandidate);
+ ~OutlinerParaObject();
+
+ // assignment operator
+ OutlinerParaObject& operator=(const OutlinerParaObject& rCandidate);
+
+ // compare operator
+ bool operator==(const OutlinerParaObject& rCandidate) const;
+ bool operator!=(const OutlinerParaObject& rCandidate) const { return !operator==(rCandidate); }
+
+ // #i102062#
+ bool isWrongListEqual(const OutlinerParaObject& rCompare) const;
+
+ // outliner mode access
+ sal_uInt16 GetOutlinerMode() const;
+ void SetOutlinerMode(sal_uInt16 nNew);
+
+ // vertical access
+ bool IsVertical() const;
+ void SetVertical(bool bNew);
+
+ // data read access
+ sal_uInt32 Count() const;
+ sal_Int16 GetDepth(sal_uInt16 nPara) const;
+ const EditTextObject& GetTextObject() const;
+ bool IsEditDoc() const;
+ const ParagraphData& GetParagraphData(sal_uInt32 nIndex) const;
+
+ // portion info support
+ void ClearPortionInfo();
+
+ // StyleSheet support
+ bool ChangeStyleSheets(const OUString& rOldName, SfxStyleFamily eOldFamily,
+ const OUString& rNewName, SfxStyleFamily eNewFamily);
+ void ChangeStyleSheetName(SfxStyleFamily eFamily, const OUString& rOldName,
+ const OUString& rNewName);
+ void SetStyleSheets(sal_uInt16 nLevel, const OUString rNewName,
+ const SfxStyleFamily& rNewFamily);
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/paperinf.hxx b/include/editeng/paperinf.hxx
new file mode 100644
index 000000000000..2c53ca554122
--- /dev/null
+++ b/include/editeng/paperinf.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 _SVX_PAPERINF_HXX
+#define _SVX_PAPERINF_HXX
+
+// INCLUDE ---------------------------------------------------------------
+
+#include <vcl/print.hxx>
+#include <vcl/mapmod.hxx>
+#include <editeng/svxenum.hxx>
+#include "editeng/editengdllapi.h"
+
+// forward ---------------------------------------------------------------
+
+class Printer;
+class Size;
+class String;
+
+// class SvxPaperInfo -----------------------------------------------------
+
+class EDITENG_DLLPUBLIC SvxPaperInfo
+{
+public:
+ static Size GetDefaultPaperSize( MapUnit eUnit = MAP_TWIP );
+ static Size GetPaperSize( Paper ePaper, MapUnit eUnit = MAP_TWIP );
+ static Size GetPaperSize( const Printer* pPrinter );
+ static Paper GetSvxPaper( const Size &rSize, MapUnit eUnit = MAP_TWIP, bool bSloppy = sal_False );
+ static long GetSloppyPaperDimension( long nSize, MapUnit eUnit = MAP_TWIP );
+ static String GetName( Paper ePaper );
+};
+
+// INLINE -----------------------------------------------------------------
+
+inline Size &Swap(Size &rSize)
+{
+ const long lVal = rSize.Width();
+ rSize.Width() = rSize.Height();
+ rSize.Height() = lVal;
+ return rSize;
+}
+
+inline Size &LandscapeSwap(Size &rSize)
+{
+ if ( rSize.Height() > rSize.Width() )
+ Swap( rSize );
+ return rSize;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/paragraphdata.hxx b/include/editeng/paragraphdata.hxx
new file mode 100644
index 000000000000..81d12bb00a2f
--- /dev/null
+++ b/include/editeng/paragraphdata.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 _PARAGRAPH_DATA_HXX
+#define _PARAGRAPH_DATA_HXX
+
+#include <tools/solar.h>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// Only for internal use, oder some kind like hPara for the few
+// functions where you need it outside ( eg. moving paragraphs... )
+//
+// Unfortunately NOT only local (formally in outliner.hxx), but also
+// used in outlobj.hxx. Moved to own header
+
+class ParagraphData
+{
+ friend class Paragraph;
+ friend class OutlinerParaObject;
+
+protected:
+ sal_Int16 nDepth;
+ sal_Int16 mnNumberingStartValue;
+ sal_Bool mbParaIsNumberingRestart;
+
+public:
+ ParagraphData( const ParagraphData& );
+ ParagraphData();
+
+ ParagraphData& operator=( const ParagraphData& );
+
+ // compare operator
+ bool operator==(const ParagraphData& rCandidate) const;
+
+ // data read access
+ sal_Int16 getDepth() const { return nDepth; }
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+typedef ::std::vector< ParagraphData > ParagraphDataVector;
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _PARAGRAPH_DATA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/paravertalignitem.hxx b/include/editeng/paravertalignitem.hxx
new file mode 100644
index 000000000000..ab65b8994325
--- /dev/null
+++ b/include/editeng/paravertalignitem.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 _SVX_PARAVERTALIGNITEM_HXX
+#define _SVX_PARAVERTALIGNITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxParaVertAlignItem ----------------------------------------------
+
+/* [Description]
+
+ This item defines the character alignment in the lines of a paragraph.
+ Currently the alignment can be none (i.e. baseline), top, center or bottom.
+
+*/
+
+class EDITENG_DLLPUBLIC SvxParaVertAlignItem : public SfxUInt16Item
+{
+public:
+ enum { AUTOMATIC, BASELINE, TOP, CENTER, BOTTOM };
+ TYPEINFO();
+
+ SvxParaVertAlignItem( sal_uInt16 nValue /*= 0*/,
+ const sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream & rStrm, sal_uInt16 nIVer) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ inline SvxParaVertAlignItem& operator=( const SvxParaVertAlignItem& rItem )
+ {
+ SetValue( rItem.GetValue() );
+ return *this;
+ }
+
+ virtual int operator==( const SfxPoolItem& ) const;
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/pbinitem.hxx b/include/editeng/pbinitem.hxx
new file mode 100644
index 000000000000..38630c78f86c
--- /dev/null
+++ b/include/editeng/pbinitem.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 _SVX_PBINITEM_HXX
+#define _SVX_PBINITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <editeng/editengdllapi.h>
+
+// define ----------------------------------------------------------------
+
+#define PAPERBIN_PRINTER_SETTINGS ((sal_uInt8)0xFF)
+
+// class SvxPaperBinItem -------------------------------------------------
+
+/* [Description]
+
+ This item describes selecting a paper tray of the printer.
+*/
+
+class EDITENG_DLLPUBLIC SvxPaperBinItem : public SfxByteItem
+{
+public:
+ TYPEINFO();
+
+ explicit inline SvxPaperBinItem( const sal_uInt16 nId ,
+ const sal_uInt8 nTray = PAPERBIN_PRINTER_SETTINGS );
+ inline SvxPaperBinItem &operator=( const SvxPaperBinItem &rCpy );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream &, sal_uInt16 ) const;
+ virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+inline SvxPaperBinItem::SvxPaperBinItem( const sal_uInt16 nId, const sal_uInt8 nT )
+ : SfxByteItem( nId, nT )
+{}
+
+inline SvxPaperBinItem &SvxPaperBinItem::operator=(
+ const SvxPaperBinItem &rCpy )
+{
+ SetValue( rCpy.GetValue() );
+ return *this;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/pgrditem.hxx b/include/editeng/pgrditem.hxx
new file mode 100644
index 000000000000..9c4c47cce882
--- /dev/null
+++ b/include/editeng/pgrditem.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 _SVX_PGRDITEM_HXX
+#define _SVX_PGRDITEM_HXX
+
+#include <svl/eitem.hxx>
+#include "editeng/editengdllapi.h"
+
+// class SvxParaGridItem -------------------------------------------------
+
+
+/* [Description]
+
+ Paragraph snap to grid
+*/
+
+class EDITENG_DLLPUBLIC SvxParaGridItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxParaGridItem( const sal_Bool bSnapToGrid /*= sal_True*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/pmdlitem.hxx b/include/editeng/pmdlitem.hxx
new file mode 100644
index 000000000000..55fee950d8f0
--- /dev/null
+++ b/include/editeng/pmdlitem.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 _SVX_PMDLITEM_HXX
+#define _SVX_PMDLITEM_HXX
+
+#include <svl/stritem.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxPageModelItem ------------------------------------------------
+
+/* [Description]
+
+ This item contains a name of a page template.
+*/
+
+class EDITENG_DLLPUBLIC SvxPageModelItem : public SfxStringItem
+{
+private:
+ sal_Bool bAuto;
+
+public:
+ TYPEINFO();
+
+ explicit inline SvxPageModelItem( sal_uInt16 nWh );
+ inline SvxPageModelItem( const String& rModel, sal_Bool bA /*= sal_False*/,
+ sal_uInt16 nWh );
+ inline SvxPageModelItem& operator=( const SvxPageModelItem& rModel );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ sal_Bool IsAuto() const { return bAuto; }
+};
+
+inline SvxPageModelItem::SvxPageModelItem( sal_uInt16 nWh )
+ : bAuto( sal_False )
+{
+ SetWhich( nWh );
+}
+
+inline SvxPageModelItem::SvxPageModelItem( const String& rModel, sal_Bool bA,
+ sal_uInt16 nWh ) :
+ SfxStringItem( nWh, rModel ),
+ bAuto( bA )
+{}
+
+inline SvxPageModelItem& SvxPageModelItem::operator=( const SvxPageModelItem& rModel )
+{
+ SetValue( rModel.GetValue() );
+ return *this;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/postitem.hxx b/include/editeng/postitem.hxx
new file mode 100644
index 000000000000..e547d5a5e438
--- /dev/null
+++ b/include/editeng/postitem.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 _SVX_POSTITEM_HXX
+#define _SVX_POSTITEM_HXX
+
+#include <vcl/vclenum.hxx>
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxPostureItem --------------------------------------------------
+
+/* [Description]
+
+ This item describes the font setting (Italic)
+*/
+
+class EDITENG_DLLPUBLIC SvxPostureItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ SvxPostureItem( const FontItalic ePost /*= ITALIC_NONE*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem + SwEnumItem
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetValueCount() const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual int HasBoolValue() const;
+ virtual sal_Bool GetBoolValue() const;
+ virtual void SetBoolValue( sal_Bool bVal );
+
+ inline SvxPostureItem& operator=(const SvxPostureItem& rPost) {
+ SetValue( rPost.GetValue() );
+ return *this;
+ }
+
+ // enum cast
+ FontItalic GetPosture() const
+ { return (FontItalic)GetValue(); }
+ void SetPosture( FontItalic eNew )
+ { SetValue( (sal_uInt16)eNew ); }
+};
+
+#endif // #ifndef _SVX_POSTITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/prntitem.hxx b/include/editeng/prntitem.hxx
new file mode 100644
index 000000000000..050131953dc3
--- /dev/null
+++ b/include/editeng/prntitem.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 _SVX_PRNTITEM_HXX
+#define _SVX_PRNTITEM_HXX
+
+#include <svl/eitem.hxx>
+#include "editeng/editengdllapi.h"
+
+
+
+// class SvxPrintItem ----------------------------------------------------
+
+
+/* [Description]
+
+ This item describes a logical variable "Print yes or no".
+*/
+
+
+class EDITENG_DLLPUBLIC SvxPrintItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ explicit SvxPrintItem( const sal_uInt16 nId , const sal_Bool bPrt = sal_True );
+ inline SvxPrintItem &operator=( const SvxPrintItem &rCpy );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+inline SvxPrintItem::SvxPrintItem( const sal_uInt16 nId, const sal_Bool bPrt )
+ : SfxBoolItem( nId, bPrt )
+{}
+
+inline SvxPrintItem &SvxPrintItem::operator=( const SvxPrintItem &rCpy )
+{
+ SetValue( rCpy.GetValue() );
+ return *this;
+}
+
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/protitem.hxx b/include/editeng/protitem.hxx
new file mode 100644
index 000000000000..37f2bec77998
--- /dev/null
+++ b/include/editeng/protitem.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_PROTITEM_HXX
+#define _SVX_PROTITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include "editeng/editengdllapi.h"
+
+class SvXMLUnitConverter;
+
+// class SvxProtectItem --------------------------------------------------
+
+
+/* [Description]
+
+ This item describes, if content, size or position should be protected.
+*/
+
+class EDITENG_DLLPUBLIC SvxProtectItem : public SfxPoolItem
+{
+ sal_Bool bCntnt :1; // Content protected
+ sal_Bool bSize :1; // Size protected
+ sal_Bool bPos :1; // Position protected
+
+public:
+ TYPEINFO();
+
+ explicit inline SvxProtectItem( const sal_uInt16 nId );
+ inline SvxProtectItem &operator=( const SvxProtectItem &rCpy );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+
+ sal_Bool IsCntntProtected() const { return bCntnt; }
+ sal_Bool IsSizeProtected() const { return bSize; }
+ sal_Bool IsPosProtected() const { return bPos; }
+ void SetCntntProtect( sal_Bool bNew ) { bCntnt = bNew; }
+ void SetSizeProtect ( sal_Bool bNew ) { bSize = bNew; }
+ void SetPosProtect ( sal_Bool bNew ) { bPos = bNew; }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+inline SvxProtectItem::SvxProtectItem( const sal_uInt16 nId )
+ : SfxPoolItem( nId )
+{
+ bCntnt = bSize = bPos = sal_False;
+}
+
+inline SvxProtectItem &SvxProtectItem::operator=( const SvxProtectItem &rCpy )
+{
+ bCntnt = rCpy.IsCntntProtected();
+ bSize = rCpy.IsSizeProtected();
+ bPos = rCpy.IsPosProtected();
+ return *this;
+}
+
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/prszitem.hxx b/include/editeng/prszitem.hxx
new file mode 100644
index 000000000000..d89669d8eca2
--- /dev/null
+++ b/include/editeng/prszitem.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 _SVX_PRSZITEM_HXX
+#define _SVX_PRSZITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxPropSizeItem -------------------------------------------------
+
+/* [Description]
+
+ This item describes the relative Font Size.
+*/
+
+class EDITENG_DLLPUBLIC SvxPropSizeItem : public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+
+ SvxPropSizeItem( const sal_uInt16 nPercent /*= 100*/,
+ const sal_uInt16 nID );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ inline SvxPropSizeItem& operator=(const SvxPropSizeItem& rPropSize)
+ {
+ SetValue( rPropSize.GetValue() );
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/rsiditem.hxx b/include/editeng/rsiditem.hxx
new file mode 100644
index 000000000000..e98fb8e4e129
--- /dev/null
+++ b/include/editeng/rsiditem.hxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2009 Tzvetelina Tzeneva <tzvetelina@gmail.com> (initial developer) ]
+ */
+#ifndef _SVX_RSIDITEM_HXX
+#define _SVX_RSIDITEM_HXX
+
+#include <svl/intitem.hxx>
+#include "editeng/editengdllapi.h"
+
+//----------------------
+// SvxRsidItem
+//----------------------
+
+class EDITENG_DLLPUBLIC SvxRsidItem : public SfxUInt32Item
+{
+public:
+ TYPEINFO();
+
+ SvxRsidItem( sal_uInt32 nRsid, sal_uInt16 nId ) : SfxUInt32Item( nId, nRsid ) {}
+ SvxRsidItem( SvStream& rIn, sal_uInt16 nId ) : SfxUInt32Item( nId, rIn ) {}
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+#endif // _SVX_RSIDITEM_HXX
diff --git a/include/editeng/scriptspaceitem.hxx b/include/editeng/scriptspaceitem.hxx
new file mode 100644
index 000000000000..f58234baf042
--- /dev/null
+++ b/include/editeng/scriptspaceitem.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 _SVX_SRIPTSPACEITEM_HXX
+#define _SVX_SRIPTSPACEITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxScriptSpaceItem ----------------------------------------------
+
+/* [Description]
+
+ This item describe the script type of the selected text and is only
+ used for the user interface.
+*/
+
+class EDITENG_DLLPUBLIC SvxScriptSpaceItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxScriptSpaceItem( sal_Bool bOn /*= sal_False*/,
+ const sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ inline SvxScriptSpaceItem& operator=(const SvxScriptSpaceItem& rItem )
+ {
+ SetValue( rItem.GetValue() );
+ return *this;
+ }
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/scripttypeitem.hxx b/include/editeng/scripttypeitem.hxx
new file mode 100644
index 000000000000..a50f82d9d951
--- /dev/null
+++ b/include/editeng/scripttypeitem.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 _SVX_SCRIPTTYPEITEM_HXX
+#define _SVX_SCRIPTTYPEITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <svl/languageoptions.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxScriptTypeItem ----------------------------------------------
+
+/* [Description]
+
+ This item describes the script type of the selected text and is only
+ used for the user interface.
+*/
+
+EDITENG_DLLPUBLIC sal_uInt16 GetI18NScriptTypeOfLanguage( sal_uInt16 nLang );
+sal_uInt16 GetItemScriptType( short nI18NType );
+short GetI18NScriptType( sal_uInt16 nItemType );
+
+class EDITENG_DLLPUBLIC SvxScriptTypeItem : public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+
+ explicit SvxScriptTypeItem( sal_uInt16 nType = SCRIPTTYPE_LATIN );
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+};
+
+class EDITENG_DLLPUBLIC SvxScriptSetItem : public SfxSetItem
+{
+public:
+ TYPEINFO();
+
+ SvxScriptSetItem( sal_uInt16 nSlotId, SfxItemPool& rPool );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const;
+
+ static const SfxPoolItem* GetItemOfScriptSet( const SfxItemSet& rSet,
+ sal_uInt16 nWhich );
+ inline const SfxPoolItem* GetItemOfScriptSet( sal_uInt16 _nWhich ) const
+ { return SvxScriptSetItem::GetItemOfScriptSet( GetItemSet(), _nWhich ); }
+
+ static const SfxPoolItem* GetItemOfScript( sal_uInt16 nSlotId, const SfxItemSet& rSet, sal_uInt16 nScript );
+
+ const SfxPoolItem* GetItemOfScript( sal_uInt16 nScript ) const;
+
+ void PutItemForScriptType( sal_uInt16 nScriptType, const SfxPoolItem& rItem );
+
+ static void GetWhichIds( sal_uInt16 nSlotId, const SfxItemSet& rSet, sal_uInt16& rLatin, sal_uInt16& rAsian, sal_uInt16& rComplex);
+
+ void GetWhichIds( sal_uInt16& rLatin, sal_uInt16& rAsian, sal_uInt16& rComplex) const;
+
+ static void GetSlotIds( sal_uInt16 nSlotId, sal_uInt16& rLatin, sal_uInt16& rAsian,
+ sal_uInt16& rComplex );
+ inline void GetSlotIds( sal_uInt16& rLatin, sal_uInt16& rAsian,
+ sal_uInt16& rComplex ) const
+ { GetSlotIds( Which(), rLatin, rAsian, rComplex ); }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/shaditem.hxx b/include/editeng/shaditem.hxx
new file mode 100644
index 000000000000..e76c77a7ec4e
--- /dev/null
+++ b/include/editeng/shaditem.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 _SVX_SHADITEM_HXX
+#define _SVX_SHADITEM_HXX
+
+#include <tools/color.hxx>
+#include <svl/eitem.hxx>
+#include <editeng/svxenum.hxx>
+#include <editeng/editengdllapi.h>
+
+
+// class SvxShadowItem ---------------------------------------------------
+
+/* [Description]
+
+ This item describes the shadow attribute (color, width and position).
+*/
+
+#define SHADOW_TOP ((sal_uInt16)0)
+#define SHADOW_BOTTOM ((sal_uInt16)1)
+#define SHADOW_LEFT ((sal_uInt16)2)
+#define SHADOW_RIGHT ((sal_uInt16)3)
+
+class EDITENG_DLLPUBLIC SvxShadowItem : public SfxEnumItemInterface
+{
+ Color aShadowColor;
+ sal_uInt16 nWidth;
+ SvxShadowLocation eLocation;
+public:
+ TYPEINFO();
+
+ explicit SvxShadowItem( const sal_uInt16 nId ,
+ const Color *pColor = 0, const sal_uInt16 nWidth = 100 /*5pt*/,
+ const SvxShadowLocation eLoc = SVX_SHADOW_NONE );
+
+ inline SvxShadowItem& operator=( const SvxShadowItem& rFmtShadow );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual bool ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
+
+ const Color& GetColor() const { return aShadowColor;}
+ void SetColor( const Color &rNew ) { aShadowColor = rNew; }
+
+ sal_uInt16 GetWidth() const { return nWidth; }
+ SvxShadowLocation GetLocation() const { return eLocation; }
+
+ void SetWidth( sal_uInt16 nNew ) { nWidth = nNew; }
+ void SetLocation( SvxShadowLocation eNew ) { eLocation = eNew; }
+
+ // Calculate width of the shadow on the page.
+ sal_uInt16 CalcShadowSpace( sal_uInt16 nShadow ) const;
+
+ virtual sal_uInt16 GetValueCount() const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetEnumValue() const;
+ virtual void SetEnumValue( sal_uInt16 nNewVal );
+};
+
+inline SvxShadowItem &SvxShadowItem::operator=( const SvxShadowItem& rFmtShadow )
+{
+ aShadowColor = rFmtShadow.aShadowColor;
+ nWidth = rFmtShadow.GetWidth();
+ eLocation = rFmtShadow.GetLocation();
+ return *this;
+}
+
+#endif // #ifndef _SVX_SHADITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/shdditem.hxx b/include/editeng/shdditem.hxx
new file mode 100644
index 000000000000..d738a8794f5f
--- /dev/null
+++ b/include/editeng/shdditem.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 _SVX_SHDDITEM_HXX
+#define _SVX_SHDDITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxShadowedItem -------------------------------------------------
+
+/* [Description]
+
+ This item describes, whether and how it is shaded.
+*/
+
+class EDITENG_DLLPUBLIC SvxShadowedItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxShadowedItem( const sal_Bool bShadowed /*= sal_False*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ inline SvxShadowedItem& operator=(const SvxShadowedItem& rShadow) {
+ SetValue(rShadow.GetValue());
+ return *this;
+ }
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/sizeitem.hxx b/include/editeng/sizeitem.hxx
new file mode 100644
index 000000000000..df70d40c47cf
--- /dev/null
+++ b/include/editeng/sizeitem.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 _SVX_SIZEITEM_HXX
+#define _SVX_SIZEITEM_HXX
+
+#include <tools/gen.hxx>
+#include <svl/poolitem.hxx>
+#include <editeng/editengdllapi.h>
+
+// class SvxSizeItem -----------------------------------------------------
+
+/* [Description]
+
+ This item describes a two-dimensional size.
+*/
+
+class EDITENG_DLLPUBLIC SvxSizeItem : public SfxPoolItem
+{
+
+ Size aSize;
+
+public:
+ TYPEINFO();
+
+ explicit SvxSizeItem( const sal_uInt16 nId );
+ SvxSizeItem( const sal_uInt16 nId, const Size& rSize);
+
+ inline SvxSizeItem& operator=( const SvxSizeItem &rCpy );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual bool ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
+
+ const Size& GetSize() const { return aSize; }
+ void SetSize(const Size& rSize) { aSize = rSize; }
+};
+
+inline SvxSizeItem& SvxSizeItem::operator=( const SvxSizeItem &rCpy )
+{
+ aSize = rCpy.aSize;
+ return *this;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/spltitem.hxx b/include/editeng/spltitem.hxx
new file mode 100644
index 000000000000..a7a0a9f0665c
--- /dev/null
+++ b/include/editeng/spltitem.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 _SVX_SPLTITEM_HXX
+#define _SVX_SPLTITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxFmtSplitItem -------------------------------------------------
+
+/* [Description]
+
+ This item describes a logical variable "split paragraph yes or no".
+*/
+
+class EDITENG_DLLPUBLIC SvxFmtSplitItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+ ~SvxFmtSplitItem();
+
+ inline SvxFmtSplitItem( const sal_Bool bSplit /*= sal_True*/,
+ const sal_uInt16 nWh );
+ inline SvxFmtSplitItem& operator=( const SvxFmtSplitItem& rSplit );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 ) const;
+ virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+inline SvxFmtSplitItem::SvxFmtSplitItem( const sal_Bool bSplit, const sal_uInt16 nWh ) :
+ SfxBoolItem( nWh, bSplit )
+{}
+
+inline SvxFmtSplitItem& SvxFmtSplitItem::operator=(
+ const SvxFmtSplitItem& rSplit )
+{
+ SetValue( rSplit.GetValue() );
+ return *this;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/splwrap.hxx b/include/editeng/splwrap.hxx
new file mode 100644
index 000000000000..d4c9b8da8732
--- /dev/null
+++ b/include/editeng/splwrap.hxx
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_SPLWRAP_HXX
+#define _SVX_SPLWRAP_HXX
+
+#include <editeng/svxenum.hxx>
+#include <tools/string.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include "editeng/editengdllapi.h"
+
+// forward ---------------------------------------------------------------
+
+namespace com { namespace sun { namespace star { namespace linguistic2 {
+ class XDictionary;
+ class XSpellChecker1;
+ class XHyphenator;
+}}}}
+
+class Window;
+
+// misc functions ---------------------------------------------------------------
+
+void EDITENG_DLLPUBLIC SvxPrepareAutoCorrect( String &rOldText, String &rNewText );
+
+/*--------------------------------------------------------------------
+ Description: The SpellWrapper
+ --------------------------------------------------------------------*/
+
+class EDITENG_DLLPUBLIC SvxSpellWrapper {
+private:
+ friend class SvxSpellCheckDialog;
+ friend class SvxHyphenWordDialog;
+ friend struct SvxHyphenWordDialog_Impl;
+
+ Window* pWin;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > xLast; // result of last spelling/hyphenation attempt
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenator > xHyph;
+ sal_uInt16 nOldLang; // Set Language, only call SetLanguage on changes
+ sal_Bool bOtherCntnt : 1; // set => Check special sections initially
+ sal_Bool bDialog : 1; // Is pWin the Svx...Dialog?
+ sal_Bool bHyphen : 1; // Split instead of spell checking
+ sal_Bool bAuto : 1; // AutoCorrect available?
+ sal_Bool bReverse : 1; // Reverse spell check
+ sal_Bool bStartDone : 1; // Beginning already corrected
+ sal_Bool bEndDone : 1; // End part already corrected
+ sal_Bool bStartChk : 1; // Examine the beginning
+ sal_Bool bRevAllowed : 1; // Reverse spell check prohibited
+ sal_Bool bAllRight : 1; // Record wrong words in the dedicated
+ // dictionary and do not start the dialog.
+
+ EDITENG_DLLPRIVATE sal_Bool SpellNext(); // select next area
+ sal_Bool FindSpellError(); // Check for errors (over areas)
+
+public:
+ SvxSpellWrapper( Window* pWn,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > &xSpellChecker,
+ const sal_Bool bStart = sal_False, const sal_Bool bIsAllRight = sal_False,
+ const sal_Bool bOther = sal_False, const sal_Bool bRevAllow = sal_True );
+ SvxSpellWrapper( Window* pWn,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenator > &xHyphenator,
+ const sal_Bool bStart = sal_False, const sal_Bool bOther = sal_False );
+
+ virtual ~SvxSpellWrapper();
+
+ static sal_Int16 CheckSpellLang(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > xSpell,
+ sal_Int16 nLang );
+ static sal_Int16 CheckHyphLang(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenator > xHyph,
+ sal_Int16 nLang );
+
+ static void ShowLanguageErrors();
+
+ void SpellDocument(); // Perform Spell Checking
+ inline sal_Bool IsStartDone(){ return bStartDone; }
+ inline sal_Bool IsEndDone(){ return bEndDone; }
+ inline sal_Bool IsReverse(){ return bReverse; }
+ inline sal_Bool IsDialog(){ return bDialog; } // SvxSpellCheckDialog OnScreen
+ inline sal_Bool IsHyphen(){ return bHyphen; } // Split instead of Spell check
+ inline void SetHyphen( const sal_Bool bNew = sal_True ){ bHyphen = bNew; }
+ inline ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 >
+ GetXSpellChecker() { return xSpell; }
+ inline ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenator >
+ GetXHyphenator() { return xHyph; }
+ inline sal_Bool IsAllRight() { return bAllRight; }
+ inline Window* GetWin() { return pWin; }
+ // can possibly be omitted in ONE_LINGU:
+ inline void SetOldLang( const sal_uInt16 nNew ){ nOldLang = nNew; }
+ // can possibly be omitted in ONE_LINGU:
+ inline void ChangeLanguage( const sal_uInt16 nNew ) // call SetLanguage if needed.
+ { if ( nNew != nOldLang ) { SetLanguage( nNew ); nOldLang = nNew; } }
+ inline void EnableAutoCorrect() { bAuto = sal_True; }
+
+protected:
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >
+ GetLast() { return xLast; }
+ void SetLast(const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &xNewLast)
+ { xLast = xNewLast; }
+ virtual sal_Bool SpellMore(); // examine further documents?
+ virtual sal_Bool HasOtherCnt(); // Are there any special areas?
+ virtual void SpellStart( SvxSpellArea eSpell ); // Preparing the area
+ virtual sal_Bool SpellContinue(); // Check Areas
+ // Result available through GetLast
+ virtual void ReplaceAll( const String &rNewText, sal_Int16 nLanguage ); //Replace word from the replace list
+ virtual void StartThesaurus( const String &rWord, sal_uInt16 nLang );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionary >
+ GetAllRightDic() const;
+ virtual void SpellEnd(); // Finish area
+ virtual void ScrollArea(); // Set ScrollArea
+ // Replace word
+ virtual void ChangeWord( const String& rNewWord, const sal_uInt16 nLang );
+ // Wort via Thesaurus ersetzen
+ virtual void ChangeThesWord( const String& rNewWord );
+ virtual void SetLanguage( const sal_uInt16 nLang ); // Change Language
+ virtual void AutoCorrect( const String& rAktStr, const String& rNewStr );
+ virtual void InsertHyphen( const sal_uInt16 nPos ); // Insert hyphen
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
new file mode 100644
index 000000000000..4f54d8f2f11b
--- /dev/null
+++ b/include/editeng/svxacorr.hxx
@@ -0,0 +1,441 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef EE_SVXACORR_HXX
+#define EE_SVXACORR_HXX
+
+#include <com/sun/star/embed/XStorage.hpp>
+
+#include <o3tl/sorted_vector.hxx>
+#include <tools/rtti.hxx>
+#include <i18nlangtag/lang.h>
+#include <tools/time.hxx>
+#include <tools/date.hxx>
+#include <tools/string.hxx>
+#include <editeng/swafopt.hxx>
+#include "editeng/editengdllapi.h"
+
+#include <map>
+#include <set>
+#include <boost/unordered_map.hpp>
+#include <boost/ptr_container/ptr_map.hpp>
+
+class CharClass;
+class SfxPoolItem;
+class SvxAutoCorrect;
+class SfxObjectShell;
+class SotStorageRef;
+class SotStorage;
+class Window;
+
+struct CompareSvStringsISortDtor
+{
+ bool operator()( String* const& lhs, String* const& rhs ) const
+ {
+ return lhs->CompareIgnoreCaseToAscii( *rhs ) == COMPARE_LESS;
+ }
+};
+
+class SvStringsISortDtor
+ : public o3tl::sorted_vector<String*, CompareSvStringsISortDtor>
+{
+public:
+ ~SvStringsISortDtor() { DeleteAndDestroyAll(); }
+};
+
+// Auto correct flags
+const long CptlSttSntnc = 0x00000001; // Capital letters at the beginning of a sentence
+const long CptlSttWrd = 0x00000002; // not two Capital letters at the beginning of a word
+const long AddNonBrkSpace = 0x00000004; // Add non breaking space before :;?!%
+const long ChgOrdinalNumber = 0x00000008; // Ordinal-Number 1st, 2nd,..
+const long ChgToEnEmDash = 0x00000010; // - -> Endash/Emdash
+const long ChgWeightUnderl = 0x00000020; // * -> Bold, _ -> Underscore
+const long SetINetAttr = 0x00000040; // Set INetAttribut
+const long Autocorrect = 0x00000080; // Call AutoCorrect
+const long ChgQuotes = 0x00000100; // replace double quotes
+const long SaveWordCplSttLst= 0x00000200; // Save Auto correction of Capital letter at beginning of sentence.
+const long SaveWordWrdSttLst= 0x00000400; // Save Auto correction of 2 Capital letter at beginning of word.
+const long IgnoreDoubleSpace= 0x00000800; // Ignore 2 Spaces
+const long ChgSglQuotes = 0x00001000; // Replace simple quotes
+const long CorrectCapsLock = 0x00002000; // Correct accidental use of cAPS LOCK key
+
+const long ChgWordLstLoad = 0x20000000; // Replacement list loaded
+const long CplSttLstLoad = 0x40000000; // Exception list for Capital letters Start loaded
+const long WrdSttLstLoad = 0x80000000; // Exception list for Word Start loaded
+
+// TODO: handle unicodes > U+FFFF and check users of this class
+
+// only a mapping class
+class EDITENG_DLLPUBLIC SvxAutoCorrDoc
+{
+public:
+ SvxAutoCorrDoc() {}
+ virtual ~SvxAutoCorrDoc();
+
+ virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd ) = 0;
+ virtual sal_Bool Insert( xub_StrLen nPos, const String& rTxt ) = 0;
+ virtual sal_Bool Replace( xub_StrLen nPos, const String& rTxt ) = 0;
+ virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt ) = 0;
+
+ virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId,
+ SfxPoolItem& ) = 0;
+
+ virtual sal_Bool SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const String& rURL ) = 0;
+
+ // Return the text of a previous paragraph. This must not be empty!
+ // If no paragraph exits or just an empty one, then return 0.
+ // The flag indicates:
+ // TRUE: before the normal insertion position (TRUE)
+ // FALSE: in which the corrected word was inserted.
+ // (Does not to have to be the same paragraph !!!!)
+ virtual const String* GetPrevPara( sal_Bool bAtNormalPos ) = 0;
+
+ virtual sal_Bool ChgAutoCorrWord( xub_StrLen& rSttPos, xub_StrLen nEndPos,
+ SvxAutoCorrect& rACorrect,
+ const String** ppPara ) = 0;
+ // Is called after the change of the signs by the functions
+ // - FnCptlSttWrd
+ // - FnCptlSttSntnc
+ // As an option, the words can then be inserted into the exception lists.
+ virtual void SaveCpltSttWord( sal_uLong nFlag, xub_StrLen nPos,
+ const String& rExceptWord,
+ sal_Unicode cChar );
+
+ // which language at the position?
+ virtual LanguageType GetLanguage( xub_StrLen nPos, sal_Bool bPrevPara = sal_False ) const;
+};
+
+
+class EDITENG_DLLPUBLIC SvxAutocorrWord
+{
+ String sShort, sLong;
+ sal_Bool bIsTxtOnly; // Is pure ASCII - Text
+public:
+ SvxAutocorrWord( const String& rS, const String& rL, sal_Bool bFlag = sal_True )
+ : sShort( rS ), sLong( rL ), bIsTxtOnly( bFlag )
+ {}
+
+ const String& GetShort() const { return sShort; }
+ const String& GetLong() const { return sLong; }
+ sal_Bool IsTextOnly() const { return bIsTxtOnly; }
+};
+
+struct CompareSvxAutocorrWordList
+{
+ bool operator()( SvxAutocorrWord* const& lhs, SvxAutocorrWord* const& rhs ) const;
+};
+
+typedef std::set<SvxAutocorrWord*, CompareSvxAutocorrWordList> SvxAutocorrWordList_Set;
+typedef ::boost::unordered_map< OUString, SvxAutocorrWord *,
+ OUStringHash > SvxAutocorrWordList_Hash;
+
+class EDITENG_DLLPUBLIC SvxAutocorrWordList
+{
+ // only one of these contains the data
+ mutable SvxAutocorrWordList_Set maSet;
+ mutable SvxAutocorrWordList_Hash maHash; // key is 'Short'
+
+ bool WordMatches(const SvxAutocorrWord *pFnd,
+ const String &rTxt,
+ xub_StrLen &rStt,
+ xub_StrLen nEndPos) const;
+public:
+ // free any objects still in the set
+ ~SvxAutocorrWordList();
+ void DeleteAndDestroyAll();
+ bool Insert(SvxAutocorrWord *pWord);
+ SvxAutocorrWord* FindAndRemove(SvxAutocorrWord *pWord);
+ void LoadEntry(String sWrong, String sRight, sal_Bool bOnlyTxt);
+ bool empty() const;
+
+ typedef std::vector<SvxAutocorrWord *> Content;
+ Content getSortedContent() const;
+
+ const SvxAutocorrWord* SearchWordsInList(const String& rTxt, xub_StrLen& rStt, xub_StrLen nEndPos) const;
+};
+
+class EDITENG_DLLPUBLIC SvxAutoCorrectLanguageLists
+{
+ String sShareAutoCorrFile, sUserAutoCorrFile;
+ // If the AutoCorr file is newer
+ Date aModifiedDate;
+ Time aModifiedTime, aLastCheckTime;
+
+ SvStringsISortDtor* pCplStt_ExcptLst;
+ SvStringsISortDtor* pWrdStt_ExcptLst;
+ SvxAutocorrWordList* pAutocorr_List;
+ SvxAutoCorrect& rAutoCorrect;
+
+ long nFlags;
+
+ sal_Bool IsFileChanged_Imp();
+ void LoadXMLExceptList_Imp( SvStringsISortDtor*& rpLst,
+ const sal_Char* pStrmName,
+ SotStorageRef& rStg);
+ void SaveExceptList_Imp( const SvStringsISortDtor& rLst,
+ const sal_Char* pStrmName,
+ SotStorageRef& rStg,
+ sal_Bool bConvert = sal_False);
+
+ sal_Bool MakeBlocklist_Imp( SotStorage& rStg );
+ void RemoveStream_Imp( const String& rName );
+ void MakeUserStorage_Impl();
+
+public:
+ SvxAutoCorrectLanguageLists( SvxAutoCorrect& rParent,
+ const String& rShareAutoCorrectFile,
+ const String& rUserAutoCorrectFile);
+ ~SvxAutoCorrectLanguageLists();
+
+ // Load, Set, Get - the replacement list
+ SvxAutocorrWordList* LoadAutocorrWordList();
+ void SetAutocorrWordList( SvxAutocorrWordList* pList );
+ const SvxAutocorrWordList* GetAutocorrWordList();
+
+ // Load, Set, Get - the exception list for Capital letter at the
+ // beginning of a sentence
+ SvStringsISortDtor* LoadCplSttExceptList();
+ void SaveCplSttExceptList();
+ void SetCplSttExceptList( SvStringsISortDtor* pList );
+ SvStringsISortDtor* GetCplSttExceptList();
+ sal_Bool AddToCplSttExceptList(const String& rNew);
+
+ // Load, Set, Get the exception list for 2 Capital letters at the
+ // beginning of a word.
+ SvStringsISortDtor* LoadWrdSttExceptList();
+ void SaveWrdSttExceptList();
+ void SetWrdSttExceptList( SvStringsISortDtor* pList );
+ SvStringsISortDtor* GetWrdSttExceptList();
+ sal_Bool AddToWrdSttExceptList(const String& rNew);
+
+ // Save word substitutions:
+ // Store these directly in the storage. The word list is updated
+ // accordingly!
+ // - pure Text
+ sal_Bool PutText( const String& rShort, const String& rLong );
+ // - Text with attribution (only the SWG - SWG format!)
+ sal_Bool PutText( const String& rShort, SfxObjectShell& );
+ // - Deleting an entry
+ sal_Bool DeleteText( const String& rShort );
+ // - Make combined changes in one pass
+ sal_Bool MakeCombinedChanges( std::vector<SvxAutocorrWord>& aNewEntries, std::vector<SvxAutocorrWord>& aDeleteEntries );
+};
+
+class EDITENG_DLLPUBLIC SvxAutoCorrect
+{
+ friend class SvxAutoCorrectLanguageLists;
+
+ String sShareAutoCorrFile, sUserAutoCorrFile;
+
+ SvxSwAutoFmtFlags aSwFlags; // StarWriter AutoFormat Flags
+
+ // all languages in a table
+ boost::ptr_map<LanguageType, SvxAutoCorrectLanguageLists>* pLangTable;
+ std::map<LanguageType, long> aLastFileTable;
+ CharClass* pCharClass;
+
+ bool bRunNext;
+
+ LanguageType eCharClassLang;
+
+ long nFlags;
+ sal_Unicode cStartDQuote, cEndDQuote, cStartSQuote, cEndSQuote,
+ cEmDash, cEnDash;
+
+
+ // private methods
+ SvxAutoCorrectLanguageLists& _GetLanguageList( LanguageType eLang );
+
+ void _GetCharClass( LanguageType eLang );
+
+protected:
+ // - Text with attribution (only the SWG - SWG format!)
+ // rShort is the stream name - encrypted!
+ virtual sal_Bool PutText( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rStg, const String& rFileName, const String& rShort, SfxObjectShell& ,
+ String& );
+
+ // required language in the table add if possible only when the file exists
+ sal_Bool CreateLanguageFile(LanguageType eLang, sal_Bool bNewFile = sal_True);
+ // - Return the replacement text (only for SWG format, all others can be
+ // taken from the word list!)
+ // rShort is the stream name - encrypted!
+public:
+
+ sal_Unicode GetQuote( sal_Unicode cInsChar, sal_Bool bSttQuote,
+ LanguageType eLang ) const;
+ virtual sal_Bool GetLongText( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rStg, const String& rFileName, const String& rShort, String& rLong );
+
+ TYPEINFO();
+
+ SvxAutoCorrect( const String& rShareAutocorrFile,
+ const String& rUserAutocorrFile );
+ SvxAutoCorrect( const SvxAutoCorrect& );
+ virtual ~SvxAutoCorrect();
+
+ // Execute an AutoCorrect.
+ // Returns what has been executed, according to the above flags
+ sal_uLong AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
+ xub_StrLen nPos, sal_Unicode cInsChar, sal_Bool bInsert, Window* pFrameWin = NULL );
+
+ // Return for the autotext expansion the previous word,
+ // AutoCorrect - corresponding algorithm
+ sal_Bool GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, const String& rTxt,
+ xub_StrLen nPos, String& rWord ) const;
+
+ // Search for or or the words in the replacement table.
+ // rText - check in this text the words of the list
+ // rStt - the detected starting position
+ // nEnd - to check position - as of this item forward
+ // rLang - Input: in which language is searched
+ // Output: in which "language list" was it found
+ const SvxAutocorrWord* SearchWordsInList( const String& rTxt,
+ xub_StrLen& rStt, xub_StrLen nEndPos,
+ SvxAutoCorrDoc& rDoc,
+ LanguageType& rLang );
+
+ // Query/Set the Character for the Quote substitution
+ sal_Unicode GetStartSingleQuote() const { return cStartSQuote; }
+ sal_Unicode GetEndSingleQuote() const { return cEndSQuote; }
+ sal_Unicode GetStartDoubleQuote() const { return cStartDQuote; }
+ sal_Unicode GetEndDoubleQuote() const { return cEndDQuote; }
+
+ void SetStartSingleQuote( const sal_Unicode cStart ) { cStartSQuote = cStart; }
+ void SetEndSingleQuote( const sal_Unicode cEnd ) { cEndSQuote = cEnd; }
+ void SetStartDoubleQuote( const sal_Unicode cStart ) { cStartDQuote = cStart; }
+ void SetEndDoubleQuote( const sal_Unicode cEnd ) { cEndDQuote = cEnd; }
+
+ String GetQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos,
+ sal_Unicode cInsChar, sal_Bool bSttQuote );
+ void InsertQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos,
+ sal_Unicode cInsChar, sal_Bool bSttQuote, sal_Bool bIns );
+
+ // Query/Set the name of the AutoCorrect file
+ // the default is "autocorr.dat"
+ String GetAutoCorrFileName( LanguageType eLang = LANGUAGE_SYSTEM,
+ sal_Bool bNewFile = sal_False,
+ sal_Bool bTstUserExist = sal_False ) const;
+
+ // Query/Set the current settings of AutoCorrect
+ long GetFlags() const { return nFlags; }
+ inline SvxSwAutoFmtFlags& GetSwFlags() { return aSwFlags;}
+ sal_Bool IsAutoCorrFlag( long nFlag ) const
+ { return nFlags & nFlag ? sal_True : sal_False; }
+ void SetAutoCorrFlag( long nFlag, sal_Bool bOn = sal_True );
+
+ // Load, Set, Get - the replacement list
+ SvxAutocorrWordList* LoadAutocorrWordList(
+ LanguageType eLang = LANGUAGE_SYSTEM )
+ { return _GetLanguageList( eLang ).LoadAutocorrWordList(); }
+ const SvxAutocorrWordList* GetAutocorrWordList(
+ LanguageType eLang = LANGUAGE_SYSTEM )
+ { return _GetLanguageList( eLang ).GetAutocorrWordList(); }
+
+ // Save word substitutions:
+ // Save these directly in the storage. The word list is updated
+ // accordingly!
+ // - pure Text
+ sal_Bool PutText( const String& rShort, const String& rLong, LanguageType eLang = LANGUAGE_SYSTEM );
+ // - Text with attribution (only in the SWG - SWG format!)
+ sal_Bool PutText( const String& rShort, SfxObjectShell& rShell,
+ LanguageType eLang = LANGUAGE_SYSTEM )
+ { return _GetLanguageList( eLang ).PutText(rShort, rShell ); }
+
+ sal_Bool MakeCombinedChanges( std::vector<SvxAutocorrWord>& aNewEntries,
+ std::vector<SvxAutocorrWord>& aDeleteEntries,
+ LanguageType eLang = LANGUAGE_SYSTEM );
+
+ // Load, Set, Get - the exception list for capital letters at the
+ // beginning of a sentence
+ void SaveCplSttExceptList( LanguageType eLang = LANGUAGE_SYSTEM );
+ SvStringsISortDtor* LoadCplSttExceptList(
+ LanguageType eLang = LANGUAGE_SYSTEM)
+ { return _GetLanguageList( eLang ).LoadCplSttExceptList(); }
+ const SvStringsISortDtor* GetCplSttExceptList(
+ LanguageType eLang = LANGUAGE_SYSTEM )
+ { return _GetLanguageList( eLang ).GetCplSttExceptList(); }
+
+ // Adds a single word. The list will be immediately written to the file!
+ sal_Bool AddCplSttException( const String& rNew,
+ LanguageType eLang = LANGUAGE_SYSTEM );
+
+ // Load, Set, Get the exception list for 2 Capital letters at the
+ // beginning of a word.
+ void SaveWrdSttExceptList( LanguageType eLang = LANGUAGE_SYSTEM );
+ SvStringsISortDtor* LoadWrdSttExceptList(
+ LanguageType eLang = LANGUAGE_SYSTEM )
+ { return _GetLanguageList( eLang ).LoadWrdSttExceptList(); }
+ const SvStringsISortDtor* GetWrdSttExceptList(
+ LanguageType eLang = LANGUAGE_SYSTEM )
+ { return _GetLanguageList( eLang ).GetWrdSttExceptList(); }
+ // Adds a single word. The list will be immediately written to the file!
+ sal_Bool AddWrtSttException( const String& rNew, LanguageType eLang = LANGUAGE_SYSTEM);
+
+ // Search through the Languages for the entry
+ sal_Bool FindInWrdSttExceptList( LanguageType eLang, const String& sWord );
+ sal_Bool FindInCplSttExceptList( LanguageType eLang, const String& sWord,
+ sal_Bool bAbbreviation = sal_False);
+
+ // Methods for the auto-correction
+ sal_Bool FnCptlSttWrd( SvxAutoCorrDoc&, const String&,
+ xub_StrLen nSttPos, xub_StrLen nEndPos,
+ LanguageType eLang = LANGUAGE_SYSTEM );
+ sal_Bool FnChgOrdinalNumber( SvxAutoCorrDoc&, const String&,
+ xub_StrLen nSttPos, xub_StrLen nEndPos,
+ LanguageType eLang = LANGUAGE_SYSTEM );
+ sal_Bool FnChgToEnEmDash( SvxAutoCorrDoc&, const String&,
+ xub_StrLen nSttPos, xub_StrLen nEndPos,
+ LanguageType eLang = LANGUAGE_SYSTEM );
+ sal_Bool FnAddNonBrkSpace( SvxAutoCorrDoc&, const String&,
+ xub_StrLen nSttPos, xub_StrLen nEndPos,
+ LanguageType eLang = LANGUAGE_SYSTEM );
+ sal_Bool FnSetINetAttr( SvxAutoCorrDoc&, const String&,
+ xub_StrLen nSttPos, xub_StrLen nEndPos,
+ LanguageType eLang = LANGUAGE_SYSTEM );
+ sal_Bool FnChgWeightUnderl( SvxAutoCorrDoc&, const String&,
+ xub_StrLen nSttPos, xub_StrLen nEndPos,
+ LanguageType eLang = LANGUAGE_SYSTEM );
+ sal_Bool FnCptlSttSntnc( SvxAutoCorrDoc&, const String&, sal_Bool bNormalPos,
+ xub_StrLen nSttPos, xub_StrLen nEndPos,
+ LanguageType eLang = LANGUAGE_SYSTEM);
+ bool FnCorrectCapsLock( SvxAutoCorrDoc&, const String&,
+ xub_StrLen nSttPos, xub_StrLen nEndPos,
+ LanguageType eLang = LANGUAGE_SYSTEM );
+
+ bool HasRunNext() { return bRunNext; }
+
+ static long GetDefaultFlags();
+
+// returns sal_True for characters where the function
+// 'SvxAutoCorrect::AutoCorrect' should be called.
+// (used to avoid occasional 'collisions' with (Thai) input-sequence-checking)
+ static sal_Bool IsAutoCorrectChar( sal_Unicode cChar );
+
+ sal_Bool NeedsHardspaceAutocorr( sal_Unicode cChar );
+
+ CharClass& GetCharClass( LanguageType eLang )
+ {
+ if( !pCharClass || eLang != eCharClassLang )
+ _GetCharClass( eLang );
+ return *pCharClass;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/svxenum.hxx b/include/editeng/svxenum.hxx
new file mode 100644
index 000000000000..2759bebcd0ea
--- /dev/null
+++ b/include/editeng/svxenum.hxx
@@ -0,0 +1,239 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_SVXENUM_HXX
+#define _SVX_SVXENUM_HXX
+
+// -----------------------------------------------------------------------
+
+enum SvxCaseMap
+{
+ SVX_CASEMAP_NOT_MAPPED,
+ SVX_CASEMAP_VERSALIEN,
+ SVX_CASEMAP_GEMEINE,
+ SVX_CASEMAP_TITEL,
+ SVX_CASEMAP_KAPITAELCHEN,
+ SVX_CASEMAP_END
+};
+
+enum SvxEscapement
+{
+ SVX_ESCAPEMENT_OFF,
+ SVX_ESCAPEMENT_SUPERSCRIPT,
+ SVX_ESCAPEMENT_SUBSCRIPT,
+ SVX_ESCAPEMENT_END
+};
+
+enum SvxShadowLocation
+{
+ SVX_SHADOW_NONE,
+ SVX_SHADOW_TOPLEFT,
+ SVX_SHADOW_TOPRIGHT,
+ SVX_SHADOW_BOTTOMLEFT,
+ SVX_SHADOW_BOTTOMRIGHT,
+ SVX_SHADOW_END
+};
+
+enum SvxTabAdjust
+{
+ SVX_TAB_ADJUST_LEFT = 0,
+ SVX_TAB_ADJUST_RIGHT,
+ SVX_TAB_ADJUST_DECIMAL,
+ SVX_TAB_ADJUST_CENTER,
+ SVX_TAB_ADJUST_DEFAULT,
+ SVX_TAB_ADJUST_END
+};
+
+enum SvxLineSpace
+{
+ SVX_LINE_SPACE_AUTO,
+ SVX_LINE_SPACE_FIX,
+ SVX_LINE_SPACE_MIN,
+ SVX_LINE_SPACE_END
+};
+
+enum SvxInterLineSpace
+{
+ SVX_INTER_LINE_SPACE_OFF,
+ SVX_INTER_LINE_SPACE_PROP,
+ SVX_INTER_LINE_SPACE_FIX,
+ SVX_INTER_LINE_SPACE_END
+};
+
+enum SvxAdjust
+{
+ SVX_ADJUST_LEFT,
+ SVX_ADJUST_RIGHT,
+ SVX_ADJUST_BLOCK,
+ SVX_ADJUST_CENTER,
+ SVX_ADJUST_BLOCKLINE,
+ SVX_ADJUST_END
+};
+
+enum SvxSpecialLineSpace
+{
+ SVX_LINESPACE_USER,
+ SVX_LINESPACE_ONE_LINE,
+ SVX_LINESPACE_ONE_POINT_FIVE_LINES,
+ SVX_LINESPACE_TWO_LINES,
+ SVX_LINESPACE_END
+};
+
+enum SvxBreak
+{
+ SVX_BREAK_NONE,
+ SVX_BREAK_COLUMN_BEFORE,
+ SVX_BREAK_COLUMN_AFTER,
+ SVX_BREAK_COLUMN_BOTH,
+ SVX_BREAK_PAGE_BEFORE,
+ SVX_BREAK_PAGE_AFTER,
+ SVX_BREAK_PAGE_BOTH,
+ SVX_BREAK_END
+};
+
+enum SvxCellHorJustify
+{
+ SVX_HOR_JUSTIFY_STANDARD,
+ SVX_HOR_JUSTIFY_LEFT,
+ SVX_HOR_JUSTIFY_CENTER,
+ SVX_HOR_JUSTIFY_RIGHT,
+ SVX_HOR_JUSTIFY_BLOCK,
+ SVX_HOR_JUSTIFY_REPEAT
+};
+
+enum SvxCellJustifyMethod
+{
+ SVX_JUSTIFY_METHOD_AUTO,
+ SVX_JUSTIFY_METHOD_DISTRIBUTE
+};
+
+enum SvxCellVerJustify
+{
+ SVX_VER_JUSTIFY_STANDARD,
+ SVX_VER_JUSTIFY_TOP,
+ SVX_VER_JUSTIFY_CENTER,
+ SVX_VER_JUSTIFY_BOTTOM,
+ SVX_VER_JUSTIFY_BLOCK
+};
+
+enum SvxCellOrientation
+{
+ SVX_ORIENTATION_STANDARD,
+ SVX_ORIENTATION_TOPBOTTOM,
+ SVX_ORIENTATION_BOTTOMTOP,
+ SVX_ORIENTATION_STACKED
+};
+
+enum SvxDrawToolEnum
+{
+ SVX_SNAP_DRAW_SELECT,
+ //
+ SVX_SNAP_DRAW_LINE,
+ SVX_SNAP_DRAW_RECT,
+ SVX_SNAP_DRAW_ELLIPSE,
+ SVX_SNAP_DRAW_POLYGON_NOFILL,
+ SVX_SNAP_DRAW_BEZIER_NOFILL,
+ SVX_SNAP_DRAW_FREELINE_NOFILL,
+ SVX_SNAP_DRAW_ARC,
+ SVX_SNAP_DRAW_PIE,
+ SVX_SNAP_DRAW_CIRCLECUT,
+ SVX_SNAP_DRAW_TEXT,
+ SVX_SNAP_DRAW_TEXT_VERTICAL,
+ SVX_SNAP_DRAW_TEXT_MARQUEE,
+ SVX_SNAP_DRAW_CAPTION,
+ SVX_SNAP_DRAW_CAPTION_VERTICAL
+};
+
+enum SvxDrawAlignEnum
+{
+ SVX_OBJECT_ALIGN_LEFT,
+ SVX_OBJECT_ALIGN_CENTER,
+ SVX_OBJECT_ALIGN_RIGHT,
+ SVX_OBJECT_ALIGN_UP,
+ SVX_OBJECT_ALIGN_MIDDLE,
+ SVX_OBJECT_ALIGN_DOWN
+};
+
+enum SvxDrawBezierEnum
+{
+ SVX_BEZIER_MOVE,
+ SVX_BEZIER_INSERT,
+ SVX_BEZIER_DELETE,
+ SVX_BEZIER_CUTLINE,
+ SVX_BEZIER_CONVERT,
+ SVX_BEZIER_EDGE,
+ SVX_BEZIER_SMOOTH,
+ SVX_BEZIER_SYMMTR,
+ SVX_BEZIER_CLOSE,
+ SVX_BEZIER_ELIMINATE_POINTS
+};
+
+enum SvxSpellArea
+{
+ SVX_SPELL_BODY = 0,
+ SVX_SPELL_BODY_END,
+ SVX_SPELL_BODY_START,
+ SVX_SPELL_OTHER
+};
+
+enum SvxFrameAnchor
+{
+ SVX_FLY_AT_CNTNT, // Paragraph-based frame
+ SVX_FLY_IN_CNTNT, // Character-based frame
+ SVX_FLY_PAGE // Page-based frame
+};
+
+enum SvxExtNumType
+{
+ SVX_NUM_CHARS_UPPER_LETTER, // Counts from a-z, aa - az, ba - bz, ...
+ SVX_NUM_CHARS_LOWER_LETTER,
+ SVX_NUM_ROMAN_UPPER,
+ SVX_NUM_ROMAN_LOWER,
+ SVX_NUM_ARABIC,
+ SVX_NUM_NUMBER_NONE,
+ SVX_NUM_CHAR_SPECIAL, // Bullet
+ SVX_NUM_PAGEDESC, // Numbering from the page template
+ SVX_NUM_BITMAP,
+ SVX_NUM_CHARS_UPPER_LETTER_N, // Counts from a-z, aa-zz, aaa-zzz
+ SVX_NUM_CHARS_LOWER_LETTER_N,
+ SVX_NUM_TRANSLITERATION,
+ SVX_NUM_NATIVE_NUMBERING,
+ SVX_NUM_FULL_WIDTH_ARABIC,
+ SVX_NUM_CIRCLE_NUMBER,
+ SVX_NUM_NUMBER_LOWER_ZH,
+ SVX_NUM_NUMBER_UPPER_ZH,
+ SVX_NUM_NUMBER_UPPER_ZH_TW,
+ SVX_NUM_TIAN_GAN_ZH,
+ SVX_NUM_DI_ZI_ZH,
+ SVX_NUM_NUMBER_TRADITIONAL_JA,
+ SVX_NUM_AIU_FULLWIDTH_JA,
+ SVX_NUM_AIU_HALFWIDTH_JA,
+ SVX_NUM_IROHA_FULLWIDTH_JA,
+ SVX_NUM_IROHA_HALFWIDTH_JA
+};
+
+enum SvxCompareMode
+{
+ SVX_CMP_AUTO = 0,
+ SVX_CMP_BY_WORD,
+ SVX_CMP_BY_CHAR
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/svxfont.hxx b/include/editeng/svxfont.hxx
new file mode 100644
index 000000000000..858157453aa1
--- /dev/null
+++ b/include/editeng/svxfont.hxx
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_SVXFONT_HXX
+#define _SVX_SVXFONT_HXX
+
+#include <limits.h> // USHRT_MAX
+#include <editeng/svxenum.hxx>
+#include <i18nlangtag/lang.h>
+#include <vcl/font.hxx>
+#include "editeng/editengdllapi.h"
+
+// Percentage of height of lower case small capital letters compared to upper case letters
+// See i#1526# for full explanation
+#define SMALL_CAPS_PERCENTAGE 80
+
+class SvxDoCapitals;
+class OutputDevice;
+class Printer;
+class Point;
+class Rectangle;
+class Size;
+
+class EDITENG_DLLPUBLIC SvxFont : public Font
+{
+ LanguageType eLang; // Language
+ SvxCaseMap eCaseMap; // Text Markup
+ short nEsc; // Degree of Superscript/Subscript
+ sal_uInt8 nPropr; // Degree of reduction of the font height
+ short nKern; // Kerning in Pt
+
+public:
+ SvxFont();
+ SvxFont( const Font &rFont );
+ SvxFont( const SvxFont &rFont );
+
+ // Methods for Superscript/Subscript
+ inline short GetEscapement() const { return nEsc; }
+ inline void SetEscapement( const short nNewEsc ) { nEsc = nNewEsc; }
+
+ inline sal_uInt8 GetPropr() const { return nPropr; }
+ inline void SetPropr( const sal_uInt8 nNewPropr ) { nPropr = nNewPropr; }
+ inline void SetProprRel( const sal_uInt8 nNewPropr )
+ { SetPropr( (sal_uInt8)( (long)nNewPropr * (long)nPropr / 100L ) ); }
+
+ // Kerning
+ inline short GetFixKerning() const { return nKern; }
+ inline void SetFixKerning( const short nNewKern ) { nKern = nNewKern; }
+
+ inline SvxCaseMap GetCaseMap() const { return eCaseMap; }
+ inline void SetCaseMap( const SvxCaseMap eNew ) { eCaseMap = eNew; }
+
+ inline LanguageType GetLanguage() const { return eLang; }
+ inline void SetLanguage( const LanguageType eNewLan )
+ { eLang = eNewLan; Font::SetLanguage(eNewLan); }
+
+ // Is-Methods:
+ inline sal_Bool IsCaseMap() const { return SVX_CASEMAP_NOT_MAPPED != eCaseMap; }
+ inline sal_Bool IsCapital() const { return SVX_CASEMAP_KAPITAELCHEN == eCaseMap; }
+ inline sal_Bool IsKern() const { return 0 != nKern; }
+ inline sal_Bool IsEsc() const { return 0 != nEsc; }
+
+ // Consider Upper case, Lower case letters etc.
+ OUString CalcCaseMap(const OUString &rTxt) const;
+
+ // Handle upper case letters
+ void DoOnCapitals( SvxDoCapitals &rDo,
+ const sal_uInt16 nPartLen = USHRT_MAX ) const;
+
+ void SetPhysFont( OutputDevice *pOut ) const;
+ Font ChgPhysFont( OutputDevice *pOut ) const;
+
+ Size GetCapitalSize( const OutputDevice *pOut, const String &rTxt,
+ const sal_uInt16 nIdx, const sal_uInt16 nLen) const;
+ void DrawCapital( OutputDevice *pOut, const Point &rPos, const String &rTxt,
+ const sal_uInt16 nIdx, const sal_uInt16 nLen ) const;
+
+ Size GetPhysTxtSize( const OutputDevice *pOut, const String &rTxt,
+ const sal_uInt16 nIdx, const sal_uInt16 nLen ) const;
+
+ Size GetPhysTxtSize( const OutputDevice *pOut, const String &rTxt );
+
+ Size GetTxtSize( const OutputDevice *pOut, const String &rTxt,
+ const sal_uInt16 nIdx = 0, const sal_uInt16 nLen = STRING_LEN ) const;
+
+ void QuickDrawText( OutputDevice *pOut, const Point &rPos, const String &rTxt,
+ const sal_uInt16 nIdx = 0, const sal_uInt16 nLen = STRING_LEN, const sal_Int32* pDXArray = NULL ) const;
+
+ Size QuickGetTextSize( const OutputDevice *pOut, const String &rTxt,
+ const sal_uInt16 nIdx, const sal_uInt16 nLen, sal_Int32* pDXArray = NULL ) const;
+
+ void DrawPrev( OutputDevice* pOut, Printer* pPrinter,
+ const Point &rPos, const String &rTxt,
+ const sal_uInt16 nIdx = 0, const sal_uInt16 nLen = STRING_LEN ) const;
+
+ static void DrawArrow( OutputDevice &rOut, const Rectangle& rRect,
+ const Size& rSize, const Color& rCol, sal_Bool bLeft );
+ SvxFont& operator=( const SvxFont& rFont );
+ SvxFont& operator=( const Font& rFont );
+};
+
+#endif // #ifndef _SVX_SVXFONT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/svxrtf.hxx b/include/editeng/svxrtf.hxx
new file mode 100644
index 000000000000..84c00a28634b
--- /dev/null
+++ b/include/editeng/svxrtf.hxx
@@ -0,0 +1,424 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVXRTF_HXX
+#define _SVXRTF_HXX
+
+#include <tools/string.hxx>
+#include <svl/itemset.hxx>
+#include <svtools/parrtf.hxx>
+
+#include <editeng/editengdllapi.h>
+
+#include <deque>
+#include <utility>
+#include <vector>
+#include "boost/ptr_container/ptr_map.hpp"
+#include "boost/ptr_container/ptr_vector.hpp"
+
+class Font;
+class Color;
+class Graphic;
+class DateTime;
+struct SvxRTFStyleType;
+class SvxRTFItemStackType;
+class SvxRTFItemStackList : public boost::ptr_vector<SvxRTFItemStackType> {};
+
+namespace com { namespace sun { namespace star {
+ namespace document {
+ class XDocumentProperties;
+ }
+ namespace util {
+ struct DateTime;
+ }
+} } }
+
+
+// Mapper-Classes for the various requirements on Document positions
+// Swg - NodePosition is a SwIndex, which is used internally
+// EditEngine - ULONG to list of paragraphs
+// .....
+
+class SvxNodeIdx
+{
+public:
+ virtual ~SvxNodeIdx() {}
+ virtual sal_uLong GetIdx() const = 0;
+ virtual SvxNodeIdx* Clone() const = 0; // Cloning itself
+};
+
+class SvxPosition
+{
+public:
+ virtual ~SvxPosition() {}
+
+ virtual sal_uLong GetNodeIdx() const = 0;
+ virtual xub_StrLen GetCntIdx() const = 0;
+
+ virtual SvxPosition* Clone() const = 0; // Cloning itself
+ virtual SvxNodeIdx* MakeNodeIdx() const = 0; // Cloning NodeIndex
+};
+
+
+typedef Color* ColorPtr;
+typedef std::deque< ColorPtr > SvxRTFColorTbl;
+typedef boost::ptr_map<short, Font> SvxRTFFontTbl;
+typedef boost::ptr_map<sal_uInt16, SvxRTFStyleType> SvxRTFStyleTbl;
+
+// SvxRTFItemStack can't be "std::stack< SvxRTFItemStackType* >" type, because
+// the methods are using operator[] in sw/source/filter/rtf/rtftbl.cxx file
+typedef std::deque< SvxRTFItemStackType* > SvxRTFItemStack;
+
+// own helper classes for the RTF Parser
+struct SvxRTFStyleType
+{
+ SfxItemSet aAttrSet; // the attributes of Style (+ derivate!)
+ String sName;
+ sal_uInt16 nBasedOn, nNext;
+ sal_Bool bBasedOnIsSet;
+ sal_uInt8 nOutlineNo;
+ sal_Bool bIsCharFmt;
+
+ SvxRTFStyleType( SfxItemPool& rPool, const sal_uInt16* pWhichRange );
+};
+
+
+// Here are the IDs for all character attributes, which can be detected by
+// SvxParser and can be set in a SfxItemSet. The IDs are set correctly throught
+// the SlotIds from POOL.
+struct RTFPlainAttrMapIds
+{
+ sal_uInt16 nCaseMap,
+ nBgColor,
+ nColor,
+ nContour,
+ nCrossedOut,
+ nEscapement,
+ nFont,
+ nFontHeight,
+ nKering,
+ nLanguage,
+ nPosture,
+ nShadowed,
+ nUnderline,
+ nOverline,
+ nWeight,
+ nWordlineMode,
+ nAutoKerning,
+ nCJKFont,
+ nCJKFontHeight,
+ nCJKLanguage,
+ nCJKPosture,
+ nCJKWeight,
+ nCTLFont,
+ nCTLFontHeight,
+ nCTLLanguage,
+ nCTLPosture,
+ nCTLWeight,
+ nEmphasis,
+ nTwoLines,
+ nCharScaleX,
+ nHorzVert,
+ nRuby,
+ nRelief,
+ nHidden
+ ;
+ RTFPlainAttrMapIds( const SfxItemPool& rPool );
+};
+
+// Here are the IDs for all paragraph attributes, which can be detected by
+// SvxParser and can be set in a SfxItemSet. The IDs are set correctly throught
+// the SlotIds from POOL.
+struct RTFPardAttrMapIds
+{
+ sal_uInt16 nLinespacing,
+ nAdjust,
+ nTabStop,
+ nHyphenzone,
+ nLRSpace,
+ nULSpace,
+ nBrush,
+ nBox,
+ nShadow,
+ nOutlineLvl,
+ nSplit,
+ nKeep,
+ nFontAlign,
+ nScriptSpace,
+ nHangPunct,
+ nForbRule,
+ nDirection
+ ;
+ RTFPardAttrMapIds( const SfxItemPool& rPool );
+};
+
+
+
+// -----------------------------------------------------------------------
+
+
+class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser
+{
+ SvStream &rStrm;
+ SvxRTFColorTbl aColorTbl;
+ SvxRTFFontTbl aFontTbl;
+ SvxRTFStyleTbl aStyleTbl;
+ SvxRTFItemStack aAttrStack;
+ SvxRTFItemStackList aAttrSetList;
+
+ std::vector<sal_uInt16> aPlainMap;
+ std::vector<sal_uInt16> aPardMap;
+ std::vector<sal_uInt16> aWhichMap;
+ String sBaseURL;
+
+ SvxPosition* pInsPos;
+ SfxItemPool* pAttrPool;
+ Color* pDfltColor;
+ Font* pDfltFont;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties> m_xDocProps;
+ SfxItemSet *pRTFDefaults;
+
+ long nVersionNo;
+ int nDfltFont;
+
+ sal_Bool bNewDoc : 1; // sal_False - Reading in an existing
+ sal_Bool bNewGroup : 1; // sal_True - there was an opening parenthesis
+ sal_Bool bIsSetDfltTab : 1; // sal_True - DefTab was loaded
+ sal_Bool bChkStyleAttr : 1; // sal_True - StyleSheets are evaluated
+ sal_Bool bCalcValue : 1; // sal_True - Twip values adapt to App
+ sal_Bool bPardTokenRead : 1; // sal_True - Token \pard was detected
+ sal_Bool bReadDocInfo : 1; // sal_True - DocInfo to read
+ sal_Bool bIsLeftToRightDef : 1; // sal_True - in LeftToRight char run def.
+ // sal_False - in RightToLeft char run def.
+ sal_Bool bIsInReadStyleTab : 1; // sal_True - in ReadStyleTable
+
+ void ClearColorTbl();
+ void ClearFontTbl();
+ void ClearStyleTbl();
+ void ClearAttrStack();
+
+ SvxRTFItemStackType* _GetAttrSet( int bCopyAttr=sal_False ); // Create new ItemStackType:s
+ void _ClearStyleAttr( SvxRTFItemStackType& rStkType );
+
+ // Sets all the attributes that are different from the current
+ void SetAttrSet( SfxItemSet& rAttrSet, SvxPosition& rSttPos );
+ void SetAttrSet( SvxRTFItemStackType &rSet );
+ void SetDefault( int nToken, int nValue );
+
+ // Excecute pard / plain
+ void RTFPardPlain( int bPard, SfxItemSet** ppSet );
+
+ void BuildWhichTbl();
+
+ enum RTF_CharTypeDef
+ {
+ NOTDEF_CHARTYPE,
+ LOW_CHARTYPE,
+ HIGH_CHARTYPE,
+ DOUBLEBYTE_CHARTYPE
+ };
+
+ // set latin/asian/complex character attributes
+ void SetScriptAttr(
+ RTF_CharTypeDef eType, SfxItemSet& rSet, SfxPoolItem& rItem );
+
+protected:
+ virtual void EnterEnvironment();
+ virtual void LeaveEnvironment();
+ virtual void ResetPard();
+ virtual void InsertPara() = 0;
+
+
+ String& DelCharAtEnd( String& rStr, const sal_Unicode cDel );
+
+ // is called for each token that is recognized in CallParser
+ virtual void NextToken( int nToken );
+
+ virtual void ReadBitmapData();
+ virtual void ReadOLEData();
+
+ void ReadStyleTable();
+ void ReadColorTable();
+ void ReadFontTable();
+ void ReadAttr( int nToken, SfxItemSet* pSet );
+ void ReadTabAttr( int nToken, SfxItemSet& rSet );
+
+ // Read Document-Info
+ ::com::sun::star::util::DateTime GetDateTimeStamp( );
+ String& GetTextToEndGroup( String& rStr );
+ virtual void ReadInfo( const sal_Char* pChkForVerNo = 0 );
+
+ inline SfxItemSet& GetAttrSet();
+ // no text yet inserted? (SttPos from the top stack entry!)
+ int IsAttrSttPos();
+ void AttrGroupEnd(); // edit the current, delete from stack
+ void SetAllAttrOfStk(); // end all Attr. and set it into doc
+
+
+ virtual void InsertText() = 0;
+ virtual void MovePos( int bForward = sal_True ) = 0;
+ virtual void SetEndPrevPara( SvxNodeIdx*& rpNodePos,
+ xub_StrLen& rCntPos )=0;
+ virtual void SetAttrInDoc( SvxRTFItemStackType &rSet );
+ // for Tokens, which are not evaluated in ReadAttr
+ virtual void UnknownAttrToken( int nToken, SfxItemSet* pSet );
+
+ // if no-one would like to have any twips
+ virtual void CalcValue();
+
+ SvxRTFParser( SfxItemPool& rAttrPool,
+ SvStream& rIn,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties> i_xDocProps,
+ int bReadNewDoc = sal_True );
+ virtual ~SvxRTFParser();
+
+ int IsNewDoc() const { return bNewDoc; }
+ void SetNewDoc( int bFlag ) { bNewDoc = bFlag; }
+ int IsNewGroup() const { return bNewGroup; }
+ void SetNewGroup( int bFlag ) { bNewGroup = bFlag; }
+ int IsChkStyleAttr() const { return bChkStyleAttr; }
+ void SetChkStyleAttr( int bFlag ) { bChkStyleAttr = bFlag; }
+ int IsCalcValue() const { return bCalcValue; }
+ void SetCalcValue( int bFlag ) { bCalcValue = bFlag; }
+ int IsPardTokenRead() const { return bPardTokenRead; }
+ void SetPardTokenRead( int bFlag ) { bPardTokenRead = bFlag; }
+ int IsReadDocInfo() const { return bReadDocInfo; }
+ void SetReadDocInfo( int bFlag ) { bReadDocInfo = bFlag; }
+
+ // Query/Set the current insert position
+ SvxPosition& GetInsPos() const { return *pInsPos; }
+ void SetInsPos( const SvxPosition& rNew );
+
+ long GetVersionNo() const { return nVersionNo; }
+
+ // Query/Set the mapping IDs for the Pard/Plain attributes
+ //(Set: It is noted in the pointers, which thus does not create a copy)
+ void AddPardAttr( sal_uInt16 nWhich ) { aPardMap.push_back( nWhich ); }
+ void AddPlainAttr( sal_uInt16 nWhich ) { aPlainMap.push_back( nWhich ); }
+
+ SvxRTFStyleTbl& GetStyleTbl() { return aStyleTbl; }
+ SvxRTFItemStack& GetAttrStack() { return aAttrStack; }
+ SvxRTFColorTbl& GetColorTbl() { return aColorTbl; }
+ SvxRTFFontTbl& GetFontTbl() { return aFontTbl; }
+
+ const String& GetBaseURL() const { return sBaseURL; }
+
+public:
+
+ virtual SvParserState CallParser();
+
+ inline const Color& GetColor( size_t nId ) const;
+ const Font& GetFont( sal_uInt16 nId ); // Changes the dflt Font
+
+ virtual int IsEndPara( SvxNodeIdx* pNd, xub_StrLen nCnt ) const = 0;
+
+ // to det a different attribute pool. May only be done prior to CallParser!
+ // The maps are not generated anew!
+ void SetAttrPool( SfxItemPool* pNewPool ) { pAttrPool = pNewPool; }
+ // to set different WhichIds for a different pool.
+ RTFPardAttrMapIds& GetPardMap()
+ { return (RTFPardAttrMapIds&)*aPardMap.begin(); }
+ RTFPlainAttrMapIds& GetPlainMap()
+ { return (RTFPlainAttrMapIds&)*aPlainMap.begin(); }
+ // to be able to assign them from the outside as for example table cells
+ void ReadBorderAttr( int nToken, SfxItemSet& rSet, int bTableDef=sal_False );
+ void ReadBackgroundAttr( int nToken, SfxItemSet& rSet, int bTableDef=sal_False );
+
+ // for asynchronous read from the SvStream
+ virtual void Continue( int nToken );
+
+ // get RTF default ItemSets. Must be used by pard/plain tokens or in
+ // reset of Style-Items
+ const SfxItemSet& GetRTFDefaults();
+ virtual bool UncompressableStackEntry(const SvxRTFItemStackType &rSet) const;
+};
+
+// The stack for the attributes:
+// this class may only be used by SvxRTFParser!
+class EDITENG_DLLPUBLIC SvxRTFItemStackType
+{
+ friend class SvxRTFParser;
+
+ SfxItemSet aAttrSet;
+ SvxNodeIdx *pSttNd, *pEndNd;
+ xub_StrLen nSttCnt, nEndCnt;
+ SvxRTFItemStackList* pChildList;
+ sal_uInt16 nStyleNo;
+
+ SvxRTFItemStackType( SfxItemPool&, const sal_uInt16* pWhichRange,
+ const SvxPosition& );
+
+ void Add( SvxRTFItemStackType* );
+ void Compress( const SvxRTFParser& );
+
+public:
+ SvxRTFItemStackType( const SvxRTFItemStackType&, const SvxPosition&,
+ int bCopyAttr = sal_False );
+ ~SvxRTFItemStackType();
+ //cmc, I'm very suspicios about SetStartPos, it doesn't change
+ //its children's starting position, and the implementation looks
+ //bad, consider this deprecated.
+ void SetStartPos( const SvxPosition& rPos );
+
+ void MoveFullNode(const SvxNodeIdx &rOldNode,
+ const SvxNodeIdx &rNewNode);
+
+ sal_uLong GetSttNodeIdx() const { return pSttNd->GetIdx(); }
+ sal_uLong GetEndNodeIdx() const { return pEndNd->GetIdx(); }
+
+ const SvxNodeIdx& GetSttNode() const { return *pSttNd; }
+ const SvxNodeIdx& GetEndNode() const { return *pEndNd; }
+
+ xub_StrLen GetSttCnt() const { return nSttCnt; }
+ xub_StrLen GetEndCnt() const { return nEndCnt; }
+
+ SfxItemSet& GetAttrSet() { return aAttrSet; }
+ const SfxItemSet& GetAttrSet() const { return aAttrSet; }
+
+ sal_uInt16 StyleNo() const { return nStyleNo; }
+
+ void SetRTFDefaults( const SfxItemSet& rDefaults );
+};
+
+
+// ----------- Inline Implementations --------------
+
+inline const Color& SvxRTFParser::GetColor( size_t nId ) const
+{
+ ColorPtr pColor = (ColorPtr)pDfltColor;
+ if( nId < aColorTbl.size() )
+ pColor = aColorTbl[ nId ];
+ return *pColor;
+}
+
+inline SfxItemSet& SvxRTFParser::GetAttrSet()
+{
+ SvxRTFItemStackType* pTmp;
+ if( bNewGroup || 0 == ( pTmp = aAttrStack.empty() ? 0 : aAttrStack.back()) )
+ pTmp = _GetAttrSet();
+ return pTmp->aAttrSet;
+}
+
+
+#endif
+ //_SVXRTF_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/swafopt.hxx b/include/editeng/swafopt.hxx
new file mode 100644
index 000000000000..684a1838c731
--- /dev/null
+++ b/include/editeng/swafopt.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 EE_SVXSWAFOPT_HXX
+#define EE_SVXSWAFOPT_HXX
+
+#include <o3tl/sorted_vector.hxx>
+
+#include <tools/string.hxx>
+
+#include <vcl/font.hxx>
+#include "editeng/editengdllapi.h"
+
+class SmartTagMgr;
+
+namespace editeng {
+
+class EDITENG_DLLPUBLIC IAutoCompleteString
+{
+private:
+ String m_String;
+public:
+ explicit IAutoCompleteString(String const& rString) : m_String(rString) {}
+ virtual ~IAutoCompleteString() {}
+ String const& GetAutoCompleteString() const { return m_String; }
+};
+
+struct CompareAutoCompleteString
+{
+ bool operator()(IAutoCompleteString *const& lhs,
+ IAutoCompleteString *const& rhs) const
+ {
+ return lhs->GetAutoCompleteString().CompareIgnoreCaseToAscii(
+ rhs->GetAutoCompleteString()) == COMPARE_LESS;
+ }
+};
+
+class SortedAutoCompleteStrings
+ : public o3tl::sorted_vector<IAutoCompleteString*, CompareAutoCompleteString>
+{
+public:
+ ~SortedAutoCompleteStrings() { DeleteAndDestroyAll(); }
+};
+
+} // namespace editeng
+
+// Class of options for AutoFormat
+struct EDITENG_DLLPUBLIC SvxSwAutoFmtFlags
+{
+ Font aBulletFont;
+ Font aByInputBulletFont;
+ /// only valid inside the Dialog!!!
+ const editeng::SortedAutoCompleteStrings * m_pAutoCompleteList;
+ SmartTagMgr* pSmartTagMgr;
+
+ sal_Unicode cBullet;
+ sal_Unicode cByInputBullet;
+
+ sal_uInt16 nAutoCmpltWordLen, nAutoCmpltListLen;
+ sal_uInt16 nAutoCmpltExpandKey;
+
+ sal_uInt8 nRightMargin;
+
+ sal_Bool bAutoCorrect : 1;
+ sal_Bool bCptlSttSntnc : 1;
+ sal_Bool bCptlSttWrd : 1;
+ sal_Bool bChkFontAttr : 1;
+
+ sal_Bool bChgUserColl : 1;
+ sal_Bool bChgEnumNum : 1;
+
+ sal_Bool bAFmtByInput : 1;
+ sal_Bool bDelEmptyNode : 1;
+ sal_Bool bSetNumRule : 1;
+
+ sal_Bool bChgOrdinalNumber : 1;
+ sal_Bool bChgToEnEmDash : 1;
+ sal_Bool bAddNonBrkSpace : 1;
+ sal_Bool bChgWeightUnderl : 1;
+ sal_Bool bSetINetAttr : 1;
+
+ sal_Bool bSetBorder : 1;
+ sal_Bool bCreateTable : 1;
+ sal_Bool bReplaceStyles : 1;
+ sal_Bool bDummy : 1;
+
+ sal_Bool bWithRedlining : 1;
+
+ sal_Bool bRightMargin : 1;
+
+ sal_Bool bAutoCompleteWords : 1;
+ sal_Bool bAutoCmpltCollectWords : 1;
+ sal_Bool bAutoCmpltEndless : 1;
+// -- under NT here starts a new long
+ sal_Bool bAutoCmpltAppendBlanc : 1;
+ sal_Bool bAutoCmpltShowAsTip : 1;
+
+ sal_Bool bAFmtDelSpacesAtSttEnd : 1;
+ sal_Bool bAFmtDelSpacesBetweenLines : 1;
+ sal_Bool bAFmtByInpDelSpacesAtSttEnd : 1;
+ sal_Bool bAFmtByInpDelSpacesBetweenLines : 1;
+
+ sal_Bool bAutoCmpltKeepList : 1;
+
+ // some dummies for any new options
+ sal_Bool bDummy6 : 1,
+ bDummy7 : 1,
+ bDummy8 : 1
+ ;
+
+ SvxSwAutoFmtFlags();
+ SvxSwAutoFmtFlags( const SvxSwAutoFmtFlags& rAFFlags ) { *this = rAFFlags; }
+ SvxSwAutoFmtFlags& operator=( const SvxSwAutoFmtFlags& );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/tstpitem.hxx b/include/editeng/tstpitem.hxx
new file mode 100644
index 000000000000..f8eca761395b
--- /dev/null
+++ b/include/editeng/tstpitem.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 _SVX_TSPTITEM_HXX
+#define _SVX_TSPTITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <editeng/svxenum.hxx>
+#include <editeng/editengdllapi.h>
+#include <o3tl/sorted_vector.hxx>
+
+// class SvxTabStop ------------------------------------------------------
+
+#define SVX_TAB_DEFCOUNT 10
+#define SVX_TAB_DEFDIST 1134 // 2cm in twips
+#define SVX_TAB_NOTFOUND USHRT_MAX
+#define cDfltDecimalChar (sal_Unicode(0x00)) // Get from IntlWrapper
+#define cDfltFillChar (sal_Unicode(' '))
+
+class EDITENG_DLLPUBLIC SvxTabStop
+{
+private:
+ sal_Int32 nTabPos;
+
+ SvxTabAdjust eAdjustment;
+ mutable sal_Unicode m_cDecimal;
+ sal_Unicode cFill;
+
+ EDITENG_DLLPRIVATE friend SvStream& operator<<( SvStream&, SvxTabStop& );
+
+ void fillDecimal() const;
+
+public:
+ SvxTabStop();
+ explicit SvxTabStop( const sal_Int32 nPos,
+ const SvxTabAdjust eAdjst = SVX_TAB_ADJUST_LEFT,
+ const sal_Unicode cDec = cDfltDecimalChar,
+ const sal_Unicode cFil = cDfltFillChar );
+
+ sal_Int32& GetTabPos() { return nTabPos; }
+ sal_Int32 GetTabPos() const { return nTabPos; }
+
+ SvxTabAdjust& GetAdjustment() { return eAdjustment; }
+ SvxTabAdjust GetAdjustment() const { return eAdjustment; }
+
+ sal_Unicode& GetDecimal() { fillDecimal(); return m_cDecimal; }
+ sal_Unicode GetDecimal() const { fillDecimal(); return m_cDecimal; }
+
+ sal_Unicode& GetFill() { return cFill; }
+ sal_Unicode GetFill() const { return cFill; }
+
+ String GetValueString() const;
+
+ // the "old" operator==()
+ sal_Bool IsEqual( const SvxTabStop& rTS ) const
+ {
+ return ( nTabPos == rTS.nTabPos &&
+ eAdjustment == rTS.eAdjustment &&
+ m_cDecimal == rTS.m_cDecimal &&
+ cFill == rTS.cFill );
+ }
+
+ // For the SortedArray:
+ sal_Bool operator==( const SvxTabStop& rTS ) const
+ { return nTabPos == rTS.nTabPos; }
+ sal_Bool operator <( const SvxTabStop& rTS ) const
+ { return nTabPos < rTS.nTabPos; }
+
+ SvxTabStop& operator=( const SvxTabStop& rTS )
+ {
+ nTabPos = rTS.nTabPos;
+ eAdjustment = rTS.eAdjustment;
+ m_cDecimal = rTS.m_cDecimal;
+ cFill = rTS.cFill;
+ return *this;
+ }
+};
+
+// class SvxTabStopItem --------------------------------------------------
+
+typedef o3tl::sorted_vector<SvxTabStop> SvxTabStopArr;
+
+/* [Description]
+
+ This item describes a list of TabStops.
+*/
+
+class EDITENG_DLLPUBLIC SvxTabStopItem : public SfxPoolItem
+{
+ SvxTabStopArr maTabStops;
+
+public:
+ TYPEINFO();
+
+ explicit SvxTabStopItem( sal_uInt16 nWhich );
+ SvxTabStopItem( const sal_uInt16 nTabs,
+ const sal_uInt16 nDist,
+ const SvxTabAdjust eAdjst /*= SVX_TAB_ADJUST_DEFAULT*/,
+ sal_uInt16 nWhich );
+ SvxTabStopItem( const SvxTabStopItem& rTSI );
+
+ // Returns index of the tab or TAB_NOTFOUND
+ sal_uInt16 GetPos( const SvxTabStop& rTab ) const;
+
+ // Returns index of the tab at nPos, or TAB_NOTFOUND
+ sal_uInt16 GetPos( const sal_Int32 nPos ) const;
+
+ // unprivatized:
+ sal_uInt16 Count() const { return maTabStops.size(); }
+ bool Insert( const SvxTabStop& rTab );
+ void Insert( const SvxTabStopItem* pTabs, sal_uInt16 nStart = 0,
+ sal_uInt16 nEnd = USHRT_MAX );
+ void Remove( SvxTabStop& rTab )
+ { maTabStops.erase( rTab ); }
+ void Remove( const sal_uInt16 nPos, const sal_uInt16 nLen = 1 )
+ { maTabStops.erase( maTabStops.begin() + nPos, maTabStops.begin() + nPos + nLen ); }
+
+ // Assignment operator, equality operator (caution: expensive!)
+ SvxTabStopItem& operator=( const SvxTabStopItem& rTSI );
+
+ // this is already included in SfxPoolItem declaration
+ //int operator!=( const SvxTabStopItem& rTSI ) const
+ // { return !( operator==( rTSI ) ); }
+
+ const SvxTabStop& operator[]( const sal_uInt16 nPos ) const
+ { return maTabStops[nPos]; }
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 ) const;
+ virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const;
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/twolinesitem.hxx b/include/editeng/twolinesitem.hxx
new file mode 100644
index 000000000000..dfdddde4b54b
--- /dev/null
+++ b/include/editeng/twolinesitem.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 _SVX_TWOLINESITEM_HXX
+#define _SVX_TWOLINESITEM_HXX
+
+#include <sal/types.h>
+#include <svl/poolitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+class EDITENG_DLLPUBLIC SvxTwoLinesItem : public SfxPoolItem
+{
+ sal_Unicode cStartBracket, cEndBracket;
+ sal_Bool bOn;
+public:
+ TYPEINFO();
+ SvxTwoLinesItem( sal_Bool bOn /*= sal_True*/,
+ sal_Unicode nStartBracket /*= 0*/,
+ sal_Unicode nEndBracket /*= 0*/,
+ sal_uInt16 nId );
+ SvxTwoLinesItem( const SvxTwoLinesItem& rAttr );
+ virtual ~SvxTwoLinesItem();
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVer) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nIVer) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper* pIntl = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFFVer ) const;
+
+ SvxTwoLinesItem& operator=( const SvxTwoLinesItem& rCpy )
+ {
+ SetValue( rCpy.GetValue() );
+ SetStartBracket( rCpy.GetStartBracket() );
+ SetEndBracket( rCpy.GetEndBracket() );
+ return *this;
+ }
+
+ sal_Bool GetValue() const { return bOn; }
+ void SetValue( sal_Bool bFlag ) { bOn = bFlag; }
+
+ sal_Unicode GetStartBracket() const { return cStartBracket; }
+ void SetStartBracket( sal_Unicode c ) { cStartBracket = c; }
+
+ sal_Unicode GetEndBracket() const { return cEndBracket; }
+ void SetEndBracket( sal_Unicode c ) { cEndBracket = c; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/txtrange.hxx b/include/editeng/txtrange.hxx
new file mode 100644
index 000000000000..700db5760ad1
--- /dev/null
+++ b/include/editeng/txtrange.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 _MyTXTRANGE_HXX
+#define _MyTXTRANGE_HXX
+
+#include "editeng/editengdllapi.h"
+#include "tools/solar.h"
+#include "tools/gen.hxx"
+
+#include <deque>
+
+class PolyPolygon;
+class Rectangle;
+
+namespace basegfx {
+ class B2DPolyPolygon;
+}
+
+typedef std::deque<long>* LongDqPtr;
+
+/*************************************************************************
+|*
+|* class TextRanger
+|*
+*************************************************************************/
+class EDITENG_DLLPUBLIC TextRanger
+{
+ //! The RangeCache class is used to cache the result of a single range calculation.
+ struct RangeCache
+ {
+ Range range; //!< Range for which we calculated results.
+ std::deque<long> results; //!< Calculated results for the range.
+ RangeCache(const Range& rng) : range(rng) {};
+ };
+ std::deque<RangeCache> mRangeCache; //!< Cached range calculations.
+ PolyPolygon *mpPolyPolygon; // Surface polygon
+ PolyPolygon *mpLinePolyPolygon; // Line polygon
+ Rectangle *pBound; // Comprehensive rectangle
+ sal_uInt16 nCacheSize; // Cache-Size
+ sal_uInt16 nRight; // Distance Contour-Text
+ sal_uInt16 nLeft; // Distance Text-Contour
+ sal_uInt16 nUpper; // Distance Contour-Text
+ sal_uInt16 nLower; // Distance Text-Contour
+ sal_uInt32 nPointCount; // Number of polygon points
+ sal_Bool bSimple : 1; // Just outside edge
+ sal_Bool bInner : 1; // TRUE: Objekt inline (EditEngine);
+ // FALSE: Objekt flow (StarWriter);
+ sal_Bool bVertical :1; // for vertical writing mode
+ sal_Bool bFlag3 :1;
+ sal_Bool bFlag4 :1;
+ sal_Bool bFlag5 :1;
+ sal_Bool bFlag6 :1;
+ sal_Bool bFlag7 :1;
+ TextRanger( const TextRanger& ); // not implemented
+ const Rectangle& _GetBoundRect();
+public:
+ TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const basegfx::B2DPolyPolygon* pLinePolyPolygon,
+ sal_uInt16 nCacheSize, sal_uInt16 nLeft, sal_uInt16 nRight,
+ sal_Bool bSimple, sal_Bool bInner, sal_Bool bVert = sal_False );
+ ~TextRanger();
+ LongDqPtr GetTextRanges( const Range& rRange );
+ sal_uInt16 GetRight() const { return nRight; }
+ sal_uInt16 GetLeft() const { return nLeft; }
+ sal_uInt16 GetUpper() const { return nUpper; }
+ sal_uInt16 GetLower() const { return nLower; }
+ sal_uInt32 GetPointCount() const { return nPointCount; }
+ sal_Bool IsSimple() const { return bSimple; }
+ sal_Bool IsInner() const { return bInner; }
+ sal_Bool IsVertical() const { return bVertical; }
+ sal_Bool HasBorder() const { return nRight || nLeft; }
+ const PolyPolygon& GetPolyPolygon() const { return *mpPolyPolygon; }
+ const PolyPolygon* GetLinePolygon() const { return mpLinePolyPolygon; }
+ const Rectangle& GetBoundRect()
+ { return pBound ? static_cast< const Rectangle& >(*pBound) : _GetBoundRect(); }
+ void SetUpper( sal_uInt16 nNew ){ nUpper = nNew; }
+ void SetLower( sal_uInt16 nNew ){ nLower = nNew; }
+ void SetVertical( sal_Bool bNew );
+ sal_Bool IsFlag3() const { return bFlag3; }
+ void SetFlag3( sal_Bool bNew ) { bFlag3 = bNew; }
+ sal_Bool IsFlag4() const { return bFlag4; }
+ void SetFlag4( sal_Bool bNew ) { bFlag4 = bNew; }
+ sal_Bool IsFlag5() const { return bFlag5; }
+ void SetFlag5( sal_Bool bNew ) { bFlag5 = bNew; }
+ sal_Bool IsFlag6() const { return bFlag6; }
+ void SetFlag6( sal_Bool bNew ) { bFlag6 = bNew; }
+ sal_Bool IsFlag7() const { return bFlag7; }
+ void SetFlag7( sal_Bool bNew ) { bFlag7 = bNew; }
+};
+
+
+
+#endif // _TXTRANGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/udlnitem.hxx b/include/editeng/udlnitem.hxx
new file mode 100644
index 000000000000..7d1a88dfa81a
--- /dev/null
+++ b/include/editeng/udlnitem.hxx
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_UDLNITEM_HXX
+#define _SVX_UDLNITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <vcl/vclenum.hxx>
+#include <tools/color.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxTextLineItem ------------------------------------------------
+
+/* Value container for underline and overline font effects */
+
+class EDITENG_DLLPUBLIC SvxTextLineItem : public SfxEnumItem
+{
+ Color mColor;
+public:
+ TYPEINFO();
+
+ SvxTextLineItem( const FontUnderline eSt,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetValueCount() const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ // MS VC4.0 messes things up
+ void SetValue( sal_uInt16 nNewVal )
+ {SfxEnumItem::SetValue(nNewVal); }
+ virtual int HasBoolValue() const;
+ virtual sal_Bool GetBoolValue() const;
+ virtual void SetBoolValue( sal_Bool bVal );
+
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ inline SvxTextLineItem& operator=(const SvxTextLineItem& rTextLine)
+ {
+ SetValue( rTextLine.GetValue() );
+ SetColor( rTextLine.GetColor() );
+ return *this;
+ }
+
+ // enum cast
+ FontUnderline GetLineStyle() const
+ { return (FontUnderline)GetValue(); }
+ void SetLineStyle( FontUnderline eNew )
+ { SetValue((sal_uInt16) eNew); }
+
+ const Color& GetColor() const { return mColor; }
+ void SetColor( const Color& rCol ) { mColor = rCol; }
+};
+
+// class SvxUnderlineItem ------------------------------------------------
+
+/* Value container for underline font effects */
+
+class EDITENG_DLLPUBLIC SvxUnderlineItem : public SvxTextLineItem
+{
+public:
+ TYPEINFO();
+
+ SvxUnderlineItem( const FontUnderline eSt,
+ const sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+};
+
+// class SvxOverlineItem ------------------------------------------------
+
+/* Value container for overline font effects */
+
+class EDITENG_DLLPUBLIC SvxOverlineItem : public SvxTextLineItem
+{
+public:
+ TYPEINFO();
+
+ SvxOverlineItem( const FontUnderline eSt,
+ const sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+};
+
+#endif // #ifndef _SVX_UDLNITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/ulspitem.hxx b/include/editeng/ulspitem.hxx
new file mode 100644
index 000000000000..f57c01bb3d3f
--- /dev/null
+++ b/include/editeng/ulspitem.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 _SVX_ULSPITEM_HXX
+#define _SVX_ULSPITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <editeng/editengdllapi.h>
+
+
+// class SvxULSpaceItem --------------------------------------------------
+
+/* [Description]
+
+ This item describes the Upper- and Lower space of a page or paragraph.
+*/
+
+#define ULSPACE_16_VERSION ((sal_uInt16)0x0001)
+
+class EDITENG_DLLPUBLIC SvxULSpaceItem : public SfxPoolItem
+{
+ sal_uInt16 nUpper; // Upper space
+ sal_uInt16 nLower; // Lower space
+ sal_Bool bContext; // Contextual spacing?
+ sal_uInt16 nPropUpper, nPropLower; // relative or absolute (=100%)
+public:
+ TYPEINFO();
+
+ explicit SvxULSpaceItem( const sal_uInt16 nId );
+ SvxULSpaceItem( const sal_uInt16 nUp, const sal_uInt16 nLow,
+ const sal_uInt16 nId );
+ inline SvxULSpaceItem& operator=( const SvxULSpaceItem &rCpy );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+ virtual bool ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
+
+ inline void SetUpper( const sal_uInt16 nU, const sal_uInt16 nProp = 100 );
+ inline void SetLower( const sal_uInt16 nL, const sal_uInt16 nProp = 100 );
+
+ void SetUpperValue( const sal_uInt16 nU ) { nUpper = nU; }
+ void SetLowerValue( const sal_uInt16 nL ) { nLower = nL; }
+ void SetContextValue( const sal_Bool bC ) { bContext = bC; }
+ void SetPropUpper( const sal_uInt16 nU ) { nPropUpper = nU; }
+ void SetPropLower( const sal_uInt16 nL ) { nPropLower = nL; }
+
+ sal_uInt16 GetUpper() const { return nUpper; }
+ sal_uInt16 GetLower() const { return nLower; }
+ sal_Bool GetContext() const { return bContext; }
+ sal_uInt16 GetPropUpper() const { return nPropUpper; }
+ sal_uInt16 GetPropLower() const { return nPropLower; }
+};
+
+inline SvxULSpaceItem &SvxULSpaceItem::operator=( const SvxULSpaceItem &rCpy )
+{
+ nUpper = rCpy.GetUpper();
+ nLower = rCpy.GetLower();
+ bContext = rCpy.GetContext();
+ nPropUpper = rCpy.GetPropUpper();
+ nPropLower = rCpy.GetPropLower();
+ return *this;
+}
+
+inline void SvxULSpaceItem::SetUpper( const sal_uInt16 nU, const sal_uInt16 nProp )
+{
+ nUpper = sal_uInt16((sal_uInt32(nU) * nProp ) / 100); nPropUpper = nProp;
+}
+inline void SvxULSpaceItem::SetLower( const sal_uInt16 nL, const sal_uInt16 nProp )
+{
+ nLower = sal_uInt16((sal_uInt32(nL) * nProp ) / 100); nPropLower = nProp;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unoedhlp.hxx b/include/editeng/unoedhlp.hxx
new file mode 100644
index 000000000000..25cf36f17356
--- /dev/null
+++ b/include/editeng/unoedhlp.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 _SVX_UNOEDHLP_HXX
+#define _SVX_UNOEDHLP_HXX
+
+#include <memory>
+#include <tools/solar.h>
+#include <vcl/textdata.hxx>
+#include <svl/hint.hxx>
+#include <tools/gen.hxx>
+#include "editeng/editengdllapi.h"
+
+struct EENotify;
+class EditEngine;
+
+#define EDITSOURCE_HINT_PARASMOVED 20
+#define EDITSOURCE_HINT_SELECTIONCHANGED 21
+
+/** Extends TextHint by two additional parameters which are necessary
+ for the EDITSOURCE_HINT_PARASMOVED hint. TextHint's value in this
+ case denotes the destination position, the two parameters the
+ start and the end of the moved paragraph range.
+ */
+class EDITENG_DLLPUBLIC SvxEditSourceHint : public TextHint
+{
+private:
+ sal_uLong mnStart;
+ sal_uLong mnEnd;
+
+public:
+ TYPEINFO();
+ SvxEditSourceHint( sal_uLong nId );
+ SvxEditSourceHint( sal_uLong nId, sal_uLong nValue, sal_uLong nStart=0, sal_uLong nEnd=0 );
+
+ sal_uLong GetValue() const;
+ sal_uLong GetStartValue() const;
+ sal_uLong GetEndValue() const;
+};
+
+/** Helper class for common functionality in edit sources
+ */
+class EDITENG_DLLPUBLIC SvxEditSourceHelper
+{
+public:
+
+ /** Translates EditEngine notifications into broadcastable hints
+
+ @param aNotify
+ Notification object send by the EditEngine.
+
+ @return the translated hint
+ */
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ static ::std::auto_ptr<SfxHint> EENotification2Hint( EENotify* aNotify );
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+
+ /** Calculate attribute run for EditEngines
+
+ Please note that the range returned is half-open: [nStartIndex,nEndIndex)
+
+ @param nStartIndex
+ Herein, the start index of the range of similar attributes is returned
+
+ @param nEndIndex
+ Herein, the end index (exclusive) of the range of similar attributes is returned
+
+ @param rEE
+ The EditEngine to query for attributes
+
+ @param nPara
+ The paragraph the following index value is to be interpreted in
+
+ @param nIndex
+ The character index from which the range of similar attributed characters is requested
+
+ @return sal_True, if the range has been successfully determined
+ */
+ static sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE, sal_uInt16 nPara, sal_uInt16 nIndex );
+
+ /** Convert point from edit engine to user coordinate space
+
+ As the edit engine internally keeps vertical text unrotated,
+ all internal edit engine methods return their stuff unrotated,
+ too. This method rotates and shifts given point appropriately,
+ if vertical writing is on.
+
+ @param rPoint
+ Point to transform
+
+ @param rEESize
+ Paper size of the edit engine
+
+ @param bIsVertical
+ Whether output text is vertical or not
+
+ @return the possibly transformed point
+ */
+ static Point EEToUserSpace( const Point& rPoint, const Size& rEESize, bool bIsVertical );
+
+ /** Convert point from user to edit engine coordinate space
+
+ As the edit engine internally keeps vertical text unrotated,
+ all internal edit engine methods return their stuff unrotated,
+ too. This method rotates and shifts given point appropriately,
+ if vertical writing is on.
+
+ @param rPoint
+ Point to transform
+
+ @param rEESize
+ Paper size of the edit engine
+
+ @param bIsVertical
+ Whether output text is vertical or not
+
+ @return the possibly transformed point
+ */
+ static Point UserSpaceToEE( const Point& rPoint, const Size& rEESize, bool bIsVertical );
+
+ /** Convert rect from edit engine to user coordinate space
+
+ As the edit engine internally keeps vertical text unrotated,
+ all internal edit engine methods return their stuff unrotated,
+ too. This method rotates and shifts given rect appropriately,
+ if vertical writing is on.
+
+ @param rRect
+ Rectangle to transform
+
+ @param rEESize
+ Paper size of the edit engine
+
+ @param bIsVertical
+ Whether output text is vertical or not
+
+ @return the possibly transformed rect
+ */
+ static Rectangle EEToUserSpace( const Rectangle& rRect, const Size& rEESize, bool bIsVertical );
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unoedprx.hxx b/include/editeng/unoedprx.hxx
new file mode 100644
index 000000000000..c6e067a6a633
--- /dev/null
+++ b/include/editeng/unoedprx.hxx
@@ -0,0 +1,176 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_UNOEDPRX_HXX
+#define _SVX_UNOEDPRX_HXX
+
+#include <memory>
+#include <svl/brdcst.hxx>
+#include <editeng/unoedsrc.hxx>
+
+#include <editeng/editdata.hxx>
+#include "editeng/editengdllapi.h"
+
+class SvxAccessibleTextAdapter : public SvxTextForwarder
+{
+public:
+ SvxAccessibleTextAdapter();
+ virtual ~SvxAccessibleTextAdapter();
+
+ virtual sal_uInt16 GetParagraphCount() const;
+ virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
+ virtual String GetText( const ESelection& rSel ) const;
+ virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const;
+ virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
+ virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
+ virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
+ virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const;
+
+ virtual sal_uInt16 CalcEditEngineIndex( sal_uInt16 nPara, sal_Int32 nLogicalIndex );
+
+ virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
+ virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+
+ virtual void QuickInsertText( const String& rText, const ESelection& rSel );
+ virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
+ virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
+ virtual void QuickInsertLineBreak( const ESelection& rSel );
+
+ virtual SfxItemPool* GetPool() const;
+
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
+
+ virtual sal_Bool IsValid() const;
+
+ virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
+ virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
+ virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
+ virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
+ virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const;
+ virtual MapMode GetMapMode() const;
+ virtual OutputDevice* GetRefDevice() const;
+ virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
+ virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
+ virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+
+ virtual sal_Bool Delete( const ESelection& );
+ virtual sal_Bool InsertText( const String&, const ESelection& );
+ virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
+ virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const;
+ virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth );
+
+ virtual const SfxItemSet* GetEmptyItemSetPtr();
+
+ // implementation functions for XParagraphAppend and XTextPortionAppend
+ // (not needed for accessibility, only for new import API)
+ virtual void AppendParagraph();
+ virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet );
+
+ //XTextCopy
+ virtual void CopyText(const SvxTextForwarder& rSource);
+
+ void SetForwarder( SvxTextForwarder& );
+ sal_Bool HaveImageBullet( sal_uInt16 nPara ) const;
+ sal_Bool HaveTextBullet( sal_uInt16 nPara ) const;
+
+ /** Query whether all text in given selection is editable
+
+ @return sal_True if every character in the given selection can
+ be changed, and sal_False if e.g. a field or a bullet is
+ contained therein.
+ */
+ sal_Bool IsEditable( const ESelection& rSelection );
+
+private:
+ SvxTextForwarder* mrTextForwarder;
+};
+
+class SvxAccessibleTextEditViewAdapter : public SvxEditViewForwarder
+{
+public:
+
+ SvxAccessibleTextEditViewAdapter();
+ virtual ~SvxAccessibleTextEditViewAdapter();
+
+ // SvxViewForwarder interface
+ virtual sal_Bool IsValid() const;
+ virtual Rectangle GetVisArea() const;
+ virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const;
+ virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const;
+
+ // SvxEditViewForwarder interface
+ virtual sal_Bool GetSelection( ESelection& rSelection ) const;
+ virtual sal_Bool SetSelection( const ESelection& rSelection );
+ virtual sal_Bool Copy();
+ virtual sal_Bool Cut();
+ virtual sal_Bool Paste();
+
+ void SetForwarder( SvxEditViewForwarder&, SvxAccessibleTextAdapter& );
+
+private:
+ SvxEditViewForwarder* mrViewForwarder;
+ SvxAccessibleTextAdapter* mrTextForwarder;
+};
+
+class EDITENG_DLLPUBLIC SvxEditSourceAdapter : public SvxEditSource
+{
+public:
+ SvxEditSourceAdapter();
+ ~SvxEditSourceAdapter();
+
+ virtual SvxEditSource* Clone() const;
+ virtual SvxTextForwarder* GetTextForwarder();
+ SvxAccessibleTextAdapter* GetTextForwarderAdapter(); // covariant return types don't work on MSVC
+ virtual SvxViewForwarder* GetViewForwarder();
+ virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate = sal_False );
+ SvxAccessibleTextEditViewAdapter* GetEditViewForwarderAdapter( sal_Bool bCreate = sal_False ); // covariant return types don't work on MSVC
+ virtual void UpdateData();
+ virtual SfxBroadcaster& GetBroadcaster() const;
+
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ void SetEditSource( ::std::auto_ptr< SvxEditSource > pAdaptee );
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+ sal_Bool IsValid() const;
+
+private:
+ // declared, but not defined
+ SvxEditSourceAdapter( const SvxEditSourceAdapter& );
+ SvxEditSourceAdapter& operator= ( const SvxEditSourceAdapter& );
+
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ ::std::auto_ptr< SvxEditSource > mpAdaptee;
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+
+ SvxAccessibleTextAdapter maTextAdapter;
+ SvxAccessibleTextEditViewAdapter maEditViewAdapter;
+
+ mutable SfxBroadcaster maDummyBroadcaster;
+
+ sal_Bool mbEditSourceValid;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unoedsrc.hxx b/include/editeng/unoedsrc.hxx
new file mode 100644
index 000000000000..9e5bba23e56b
--- /dev/null
+++ b/include/editeng/unoedsrc.hxx
@@ -0,0 +1,540 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_UNOEDSRC_HXX
+#define _SVX_UNOEDSRC_HXX
+
+#include <com/sun/star/accessibility/TextSegment.hpp>
+
+#include <tools/solar.h>
+#include <i18nlangtag/lang.h>
+#include <tools/gen.hxx>
+#include <vcl/mapmod.hxx>
+#include <tools/string.hxx>
+#include <tools/color.hxx>
+#include <svl/poolitem.hxx>
+#include <svl/itempool.hxx>
+#include "editeng/editengdllapi.h"
+
+#include <list>
+
+struct ESelection;
+struct EFieldInfo;
+struct EBulletInfo;
+class OutputDevice;
+class String;
+class SfxItemSet;
+class SvxTextForwarder;
+class SvxViewForwarder;
+class SvxEditViewForwarder;
+class SvxFieldItem;
+class SfxBroadcaster;
+class SvxUnoTextRangeBase;
+
+typedef std::list< SvxUnoTextRangeBase* > SvxUnoTextRangeBaseList;
+
+/** Wrapper class for unified EditEngine/Outliner access
+
+ This class wraps a textual object, which might or might not
+ contain an EditEngine/Outliner. Is used e.g. for filling an
+ EditEngine with the content of a cell, note page or page template.
+*/
+class EDITENG_DLLPUBLIC SvxEditSource
+{
+public:
+ virtual ~SvxEditSource();
+
+ /// Returns a new reference to the same object. This is a shallow copy
+ virtual SvxEditSource* Clone() const = 0;
+
+ /** Query the text forwarder
+
+ @return the text forwarder, or NULL if the underlying object is dead
+ */
+ virtual SvxTextForwarder* GetTextForwarder() = 0;
+
+ /** Query the view forwarder
+
+ @return the view forwarder, or NULL if the underlying object
+ is dead, or if no view is available
+
+ @derive default implementation provided, overriding is optional
+ */
+ virtual SvxViewForwarder* GetViewForwarder();
+
+ /** Query the edit view forwarder
+
+ @param bCreate
+ Determines whether an EditView should be created, if there is
+ none active. If set to sal_True, and the underlying object is
+ not in EditMode, the text forwarder changes and the object is
+ set to EditMode.
+
+ @return the edit view forwarder, or NULL if the underlying
+ object is dead, or if no view is available (if bCreate is
+ sal_False, NULL is also returned if the object is not in
+ EditMode)
+
+ @derive default implementation provided, overriding is optional
+
+ @attention If this method is called with bCreate equal to
+ sal_True, all previously returned text forwarder can become
+ invalid
+ */
+ virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate = sal_False );
+
+ /// Write back data to model
+ virtual void UpdateData() = 0;
+
+ /** Returns broadcaster the underlying edit engine's events are sent from
+
+ @derive default implementation provided, overriding is optional
+ */
+ virtual SfxBroadcaster& GetBroadcaster() const;
+
+ /** adds the given SvxUnoTextRangeBase to the text object
+ capsulated by this SvxEditSource. This allows the text
+ object to inform all created text ranges about changes
+ and also allows to re use already created instances.
+ All SvxUnoTextRangeBase must remove itself with
+ removeRange() before theire deleted. */
+ virtual void addRange( SvxUnoTextRangeBase* pNewRange );
+
+ /** removes the given SvxUnoTextRangeBase from the text
+ object capsulated by this SvxEditSource. This text range
+ will not be informed any longer of changes on the underlying
+ text and will also not re used anymore. */
+ virtual void removeRange( SvxUnoTextRangeBase* pOldRange );
+
+ /** returns a const list of all text ranges that are registered
+ for the underlying text object. */
+ virtual const SvxUnoTextRangeBaseList& getRanges() const;
+};
+
+
+/** Contains an EditEngine or an Outliner and unifies access to them.
+
+ The EditEngine-UNO objects use this class only. To reflect changes
+ not only in the EditEngine, but also in the model data, call
+ SvxEditSource::UpdateData(). This copies back the data to the model's
+ EditTextObject/OutlinerParaObject.
+ */
+class EDITENG_DLLPUBLIC SvxTextForwarder
+{
+public:
+ virtual ~SvxTextForwarder();
+
+ virtual sal_uInt16 GetParagraphCount() const = 0;
+ virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const = 0;
+ virtual String GetText( const ESelection& rSel ) const = 0;
+ virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const = 0;
+ virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const = 0;
+ virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ) = 0;
+ virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ) = 0;
+ virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const = 0;
+
+ virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const = 0;
+ virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const = 0;
+
+ virtual void QuickInsertText( const String& rText, const ESelection& rSel ) = 0;
+ virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) = 0;
+ virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ) = 0;
+ virtual void QuickInsertLineBreak( const ESelection& rSel ) = 0;
+
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ) = 0;
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos ) = 0;
+
+ virtual SfxItemPool* GetPool() const = 0;
+
+ virtual const SfxItemSet* GetEmptyItemSetPtr() = 0;
+
+ // implementation functions for XParagraphAppend and XTextPortionAppend
+ virtual void AppendParagraph() = 0;
+ virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet ) = 0;
+
+ // XTextCopy
+ virtual void CopyText(const SvxTextForwarder& rSource) = 0;
+
+ /** Query state of forwarder
+
+ @return sal_False, if no longer valid
+ */
+ virtual sal_Bool IsValid() const = 0;
+
+ /** Query language of character at given position on the underlying edit engine
+
+ @param nPara[0 .. n-1]
+ Index of paragraph to query language in
+
+ @param nIndex[0 .. m-1]
+ Index of character to query language of
+ */
+ virtual LanguageType GetLanguage( sal_uInt16 nPara, sal_uInt16 nIndex ) const = 0;
+
+ /** Query number of fields in the underlying edit engine
+
+ @param nPara[0 .. n-1]
+ Index of paragraph to query field number in
+ */
+ virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const = 0;
+
+ /** Query information for given field number in the underlying edit engine
+
+ @param nPara[0 .. n-1]
+ Index of paragraph to query field info in
+
+ @param nField[0 .. m-1]
+ Index of field to query information of
+ */
+ virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const = 0;
+
+ /** Query information regarding bullets for given paragraph on the underlying edit engine
+
+ @param nPara[0 .. n-1]
+ Index of paragraph to query bullet info on
+ */
+ virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const = 0;
+
+ /** Query the bounding rectangle of the given character
+
+ @param nPara[0 .. n]
+ Index of paragraph to query the bounds in. <p>The virtual
+ character after the last character of the represented text,
+ i.e. the one at position n is a special case. Because it does
+ not represent an existing character its bounding box is
+ defined in relation to preceding characters. It should be
+ rougly equivalent to the bounding box of some character when
+ inserted at the end of the text. Its height typically being
+ the maximal height of all the characters in the text or the
+ height of the preceding character, its width being at least
+ one pixel so that the bounding box is not degenerate.<br>
+
+ @param nIndex[0 .. m-1]
+ Index of character to query the bounds of
+
+ @return rectangle in logical coordinates, relative to upper
+ left corner of text. The coordinates returned here are to be
+ interpreted in the map mode given by GetMapMode().
+ */
+ virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const = 0;
+
+ /** Query the bounding rectangle of the given paragraph
+
+ @param nPara[0 .. n-1]
+ Index of paragraph to query the bounds of
+
+ @return rectangle in logical coordinates, relative to upper
+ left corner of text. The coordinates returned here are to be
+ interpreted in the map mode given by GetMapMode().
+ */
+ virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const = 0;
+
+ /** Query the map mode of the underlying EditEngine/Outliner
+
+ @return the map mode used on the EditEngine/Outliner. The
+ values returned by GetParaBounds() and GetCharBounds() are to
+ be interpreted in this map mode, the point given to
+ GetIndexAtPoint() is interpreted in this map mode.
+ */
+ virtual MapMode GetMapMode() const = 0;
+
+ /** Query the reference output device of the underlying EditEngine/Outliner
+
+ @return the OutputDevice used from the EditEngine/Outliner to
+ format the text. It should be used when performing e.g. font
+ calculations, since this is usually a printer with fonts and
+ resolution different from the screen.
+ */
+ virtual OutputDevice* GetRefDevice() const = 0;
+
+ /** Query paragraph and character index of the character at the
+ given point. Returns sal_True on success, sal_False otherwise
+
+ @param rPoint
+ Point to query text position of. Is interpreted in logical
+ coordinates, relativ to the upper left corner of the text, and
+ in the map mode given by GetMapMode()
+
+ @param rPara[0 .. n-1]
+ Index of paragraph the point is within
+
+ @param rIndex[0 .. m-1]
+ Index of character the point is over
+
+ @return sal_True, if the point is over any text and both rPara and rIndex are valid
+
+ */
+ virtual sal_Bool GetIndexAtPoint( const Point& rPoint, sal_uInt16& rPara, sal_uInt16& rIndex ) const = 0;
+
+ /** Get the start and the end index of the word at the given index
+
+ An index value on a word leads from the first character of
+ that word up to and including the last space before the next
+ word. The index values returned do not contain any leading or
+ trailing white-space. If the input indices are invalid,
+ sal_False is returned.
+
+ @param nPara[0 .. n-1]
+ Index of paragraph to start the search in
+
+ @param nIndex[0 .. m-1]
+ Index of character to query the search on
+
+ @param rStart
+ Start index (in the same paragraph)
+
+ @param rEnd
+ End index (in the same paragraph), this point to the last
+ character still contained in the query
+
+ @return sal_True, if the result is non-empty
+ */
+ virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& rStart, sal_uInt16& rEnd ) const = 0;
+
+ /** Query range of similar attributes
+
+ Please note that the range returned is half-open: [nStartIndex,nEndIndex)
+
+ @param nStartIndex
+ Herein, the start index of the range of similar attributes is returned
+
+ @param nEndIndex
+ Herein, the end index (exclusive) of the range of similar attributes is returned
+
+ @param nIndex
+ The character index from which the range of similar attributed characters is requested
+
+ @return sal_True, if the range has been successfully determined
+ */
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const = 0;
+
+ /** Query number of lines in the formatted paragraph
+
+ @param nPara[0 .. n-1]
+ Index of paragraph to query number of lines in
+
+ @return number of lines in given paragraph
+
+ */
+ virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const = 0;
+
+ /** Query line length
+
+ @param nPara[0 .. n-1]
+ Index of paragraph to query line length in
+
+ @param nLine[0 .. m-1]
+ Index of line in paragraph to query line length of
+
+ */
+ virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const = 0;
+
+ /** Query bounds of line in paragraph
+
+ @param rStart [output param; 0 .. text_len]
+ The index in the paragraph text that belongs to the chara at the start of the line
+
+ @param rEnd [output param; 0 .. text_len]
+ The index in the paragraph text that follows the last chara in the line
+
+ @param nParagraph[0 .. n-1]
+ Index of paragraph to query line length in
+
+ @param nLine[0 .. m-1]
+ Index of line in paragraph to query line length of
+
+ */
+ virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const = 0;
+
+ /** Query the line number for a index in the paragraphs text
+
+ @param nPara[0 .. n-1]
+ Index of paragraph to query line length in
+
+ @param nIndex[0 .. m-1]
+ Index of of the chara in the paragraph text
+
+ @returns [0 .. k-1]
+ The line number of the chara in the paragraph
+ */
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const = 0;
+
+ /** Delete given text range and reformat text
+
+ @param rSelection
+ The text range to be deleted
+
+ @return sal_True if text has been successfully deleted
+ */
+ virtual sal_Bool Delete( const ESelection& rSelection ) = 0;
+
+ /** Insert/Replace given text in given range and reformat text
+
+ @param rText
+ Text to insert/replace
+
+ @param rSel
+ Selection where text should be replaced. The empty selection inserts
+
+ @return sal_True if text has been successfully inserted
+ */
+ virtual sal_Bool InsertText( const String& rText, const ESelection& rSel ) = 0;
+
+ /** Updates the formatting
+
+ @see EditEngine::QuickFormatDoc() for details
+
+ @return sal_True if text have been successfully reformatted
+ */
+ virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False ) = 0;
+
+ /** Get the outline depth of given paragraph
+
+ @param nPara
+ Index of the paragraph to query the depth of
+
+ @return the outline level of the given paragraph. The range is
+ [0,n), where n is the maximal outline level.
+ */
+ virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const = 0;
+
+ /** Set the outline depth of given paragraph
+
+ @param nPara
+ Index of the paragraph to set the depth of
+
+ @param nNewDepth
+ The depth to set on the given paragraph. The range is
+ [0,n), where n is the maximal outline level.
+
+ @return sal_True, if depth could be successfully set. Reasons for
+ failure are e.g. the text does not support outline level
+ (EditEngine), or the depth range is exceeded.
+ */
+ virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth ) = 0;
+
+ virtual sal_Int16 GetNumberingStartValue( sal_uInt16 nPara );
+ virtual void SetNumberingStartValue( sal_uInt16 nPara, sal_Int16 nNumberingStartValue );
+
+ virtual sal_Bool IsParaIsNumberingRestart( sal_uInt16 nPara );
+ virtual void SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumberingRestart );
+};
+
+/** Encapsulates the document view for the purpose of unified
+ EditEngine/Outliner access.
+
+ This one has to be different from the SvxEditViewForwarder, since
+ the latter is only valid in edit mode.
+ */
+class EDITENG_DLLPUBLIC SvxViewForwarder
+{
+public:
+ virtual ~SvxViewForwarder();
+
+ /** Query state of forwarder
+
+ @return sal_False, if no longer valid
+ */
+ virtual sal_Bool IsValid() const = 0;
+
+ /** Query visible area of the view containing the text
+
+ @return the visible rectangle of the text, i.e. the part of
+ the EditEngine or Outliner that is currently on screen. The
+ values are already in screen coordinates (pixel), and have to
+ be relative to the EditEngine/Outliner's upper left corner.
+ */
+ virtual Rectangle GetVisArea() const = 0;
+
+ /** Convert from logical, EditEngine-relative coordinates to screen coordinates
+
+ @param rPoint
+ Point in logical, EditEngine-relative coordinates.
+
+ @param rMapMode
+ The map mode to interpret the coordinates in.
+
+ @return the point in screen coordinates
+ */
+ virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const = 0;
+
+ /** Convert from screen to logical, EditEngine-relative coordinates
+
+ @param rPoint
+ Point in screen coordinates
+
+ @param rMapMode
+ The map mode to interpret the coordinates in.
+
+ @return the point in logical coordinates.
+ */
+ virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const = 0;
+
+};
+
+
+/** Encapsulates EditView and OutlinerView for the purpose of unified
+ EditEngine/Outliner access
+ */
+class SvxEditViewForwarder : public SvxViewForwarder
+{
+public:
+
+ /** Query current selection.
+
+ @param rSelection
+ Contains the current selection after method call
+
+ @return sal_False, if there is no view or no selection (the empty selection _is_ a selection)
+
+ */
+ virtual sal_Bool GetSelection( ESelection& rSelection ) const = 0;
+
+ /** Set selection in view.
+
+ @param rSelection
+ The selection to set
+
+ @return sal_False, if there is no view or selection is invalid
+ */
+ virtual sal_Bool SetSelection( const ESelection& rSelection ) = 0;
+
+ /** Copy current selection to clipboard.
+
+ @return sal_False if no selection or no view (the empty selection _is_ a selection)
+ */
+ virtual sal_Bool Copy() = 0;
+
+ /** Cut current selection to clipboard.
+
+ @eturn sal_False if no selection or no view (the empty selection _is_ a selection)
+ */
+ virtual sal_Bool Cut() = 0;
+
+ /** Paste clipboard into current selection.
+
+ @return sal_False if no view or no selection (the empty selection _is_ a selection)
+ */
+ virtual sal_Bool Paste() = 0;
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unofdesc.hxx b/include/editeng/unofdesc.hxx
new file mode 100644
index 000000000000..711affaf2c1e
--- /dev/null
+++ b/include/editeng/unofdesc.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 SVX_UNOFDESC_HXX
+#define SVX_UNOFDESC_HXX
+
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/beans/PropertyState.hpp>
+#include <svl/itemset.hxx>
+#include <vcl/font.hxx>
+#include "editeng/editengdllapi.h"
+
+class EDITENG_DLLPUBLIC SvxUnoFontDescriptor
+{
+public:
+ static void ConvertToFont( const ::com::sun::star::awt::FontDescriptor& rDesc, Font& rFont );
+ static void ConvertFromFont( const Font& rFont, ::com::sun::star::awt::FontDescriptor& rDesc );
+
+ static void FillItemSet( const ::com::sun::star::awt::FontDescriptor& rDesc, SfxItemSet& rSet );
+ static void FillFromItemSet( const SfxItemSet& rSet, ::com::sun::star::awt::FontDescriptor& rDesc );
+
+ static void setPropertyToDefault( SfxItemSet& rSet );
+ static ::com::sun::star::uno::Any getPropertyDefault( SfxItemPool* pPool );
+
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unofield.hxx b/include/editeng/unofield.hxx
new file mode 100644
index 000000000000..d496e7217efc
--- /dev/null
+++ b/include/editeng/unofield.hxx
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_UNOFIELD_HXX
+#define _SVX_UNOFIELD_HXX
+
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/text/XTextField.hpp>
+#include <com/sun/star/text/textfield/Type.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/component.hxx>
+#include "editeng/editengdllapi.h"
+
+#include <comphelper/servicehelper.hxx>
+
+#include <editeng/mutxhelp.hxx>
+
+class SvxUnoFieldData_Impl;
+class SfxItemPropertySet;
+class SvxFieldData;
+
+com::sun::star::uno::Reference< com::sun::star::uno::XInterface > EDITENG_DLLPUBLIC SAL_CALL SvxUnoTextCreateTextField(
+ const OUString& ServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+class EDITENG_DLLPUBLIC SvxUnoTextField : public SvxMutexHelper,
+ public ::cppu::OComponentHelper,
+ public ::com::sun::star::text::XTextField,
+ public ::com::sun::star::beans::XPropertySet,
+ public ::com::sun::star::lang::XServiceInfo,
+ public ::com::sun::star::lang::XUnoTunnel
+{
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > mxAnchor;
+ const SfxItemPropertySet* mpPropSet;
+ sal_Int32 mnServiceId;
+ SvxUnoFieldData_Impl* mpImpl;
+
+protected:
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
+
+public:
+ SvxUnoTextField( sal_Int32 nServiceId ) throw();
+ SvxUnoTextField( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xAnchor, const OUString& rPresentation, const SvxFieldData* pFieldData ) throw();
+ virtual ~SvxUnoTextField() throw();
+
+ // Internal
+ SvxFieldData* CreateFieldData() const throw();
+ void SetAnchor( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xAnchor ) { mxAnchor = xAnchor; }
+
+ static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::uno::XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // ::com::sun::star::lang::XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTextField
+ virtual OUString SAL_CALL getPresentation( sal_Bool bShowCommand ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTextContent
+ virtual void SAL_CALL attach( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xTextRange ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+ // XServiceInfo
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unofored.hxx b/include/editeng/unofored.hxx
new file mode 100644
index 000000000000..5c88119f3a8f
--- /dev/null
+++ b/include/editeng/unofored.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 _SVX_UNOFORED_HXX
+#define _SVX_UNOFORED_HXX
+
+#include <editeng/editeng.hxx>
+#include <editeng/unoedsrc.hxx>
+#include "editeng/editengdllapi.h"
+
+// SvxEditEngineForwarder - SvxTextForwarder for EditEngine
+
+class EDITENG_DLLPUBLIC SvxEditEngineForwarder : public SvxTextForwarder
+{
+private:
+ EditEngine& rEditEngine;
+
+public:
+ SvxEditEngineForwarder( EditEngine& rEngine );
+ virtual ~SvxEditEngineForwarder();
+
+ virtual sal_uInt16 GetParagraphCount() const;
+ virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
+ virtual String GetText( const ESelection& rSel ) const;
+ virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = EditEngineAttribs_All ) const;
+ virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
+ virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
+ virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
+ virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const;
+
+ virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
+ virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+
+ virtual void QuickInsertText( const String& rText, const ESelection& rSel );
+ virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
+ virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
+ virtual void QuickInsertLineBreak( const ESelection& rSel );
+
+ virtual SfxItemPool* GetPool() const;
+
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
+ virtual sal_Bool IsValid() const;
+
+ virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
+ virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
+ virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
+ virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
+ virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const;
+ virtual MapMode GetMapMode() const;
+ virtual OutputDevice* GetRefDevice() const;
+ virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
+ virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
+ virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_Bool Delete( const ESelection& );
+ virtual sal_Bool InsertText( const String&, const ESelection& );
+ virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
+ virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const;
+ virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth );
+
+ virtual const SfxItemSet* GetEmptyItemSetPtr();
+
+ // implementation functions for XParagraphAppend and XTextPortionAppend
+ virtual void AppendParagraph();
+ virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet );
+ //XTextCopy
+ virtual void CopyText(const SvxTextForwarder& rSource);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unoforou.hxx b/include/editeng/unoforou.hxx
new file mode 100644
index 000000000000..68ee89160944
--- /dev/null
+++ b/include/editeng/unoforou.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_UNOFOROU_HXX
+#define _SVX_UNOFOROU_HXX
+
+#include <editeng/unoedsrc.hxx>
+#include "editeng/editengdllapi.h"
+
+#include <editeng/editdata.hxx>
+
+class Outliner;
+
+// SvxOutlinerForwarder - SvxTextForwarder for Outliner
+
+class EDITENG_DLLPUBLIC SvxOutlinerForwarder : public SvxTextForwarder
+{
+private:
+ Outliner& rOutliner;
+ sal_Bool bOutlinerText;
+
+ /** this pointer may be null or point to an item set for the attribs of
+ the selection maAttribsSelection */
+ mutable SfxItemSet* mpAttribsCache;
+
+ /** if we have a chached attribute item set, this is the selection of it */
+ mutable ESelection maAttribCacheSelection;
+
+ /** this pointer may be null or point to an item set for the paragraph
+ mnParaAttribsCache */
+ mutable SfxItemSet* mpParaAttribsCache;
+
+ /** if we have a cached para attribute item set, this is the paragraph of it */
+ mutable sal_uInt16 mnParaAttribsCache;
+
+public:
+ SvxOutlinerForwarder( Outliner& rOutl, sal_Bool bOutlText = sal_False );
+ virtual ~SvxOutlinerForwarder();
+
+ virtual sal_uInt16 GetParagraphCount() const;
+ virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
+ virtual String GetText( const ESelection& rSel ) const;
+ virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const;
+ virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
+ virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
+ virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
+ virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const;
+
+ virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
+ virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+
+ virtual void QuickInsertText( const String& rText, const ESelection& rSel );
+ virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
+ virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
+ virtual void QuickInsertLineBreak( const ESelection& rSel );
+
+ virtual SfxItemPool* GetPool() const;
+
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
+
+ virtual sal_Bool IsValid() const;
+
+ Outliner& GetOutliner() const { return rOutliner; }
+
+ virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
+ virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
+ virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
+ virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
+ virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const;
+ virtual MapMode GetMapMode() const;
+ virtual OutputDevice* GetRefDevice() const;
+ virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
+ virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
+ virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nPara, sal_uInt16 nLine ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_Bool Delete( const ESelection& );
+ virtual sal_Bool InsertText( const String&, const ESelection& );
+ virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
+ virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const;
+ virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth );
+ virtual sal_Int16 GetNumberingStartValue( sal_uInt16 nPara );
+ virtual void SetNumberingStartValue( sal_uInt16 nPara, sal_Int16 nNumberingStartValue );
+
+ virtual sal_Bool IsParaIsNumberingRestart( sal_uInt16 nPara );
+ virtual void SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumberingRestart );
+
+ /* this method flushes internal caches for this forwarder */
+ void flushCache();
+
+ virtual const SfxItemSet* GetEmptyItemSetPtr();
+
+ // implementation functions for XParagraphAppend and XTextPortionAppend
+ virtual void AppendParagraph();
+ virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet );
+ //XTextCopy
+ virtual void CopyText(const SvxTextForwarder& rSource);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unoipset.hxx b/include/editeng/unoipset.hxx
new file mode 100644
index 000000000000..584eb367f5a1
--- /dev/null
+++ b/include/editeng/unoipset.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 _SVX_UNOIPSET_HXX_
+#define _SVX_UNOIPSET_HXX_
+
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include "editeng/editengdllapi.h"
+#include <svl/itemprop.hxx>
+#include <vector>
+
+class SdrItemPool;
+class SfxItemSet;
+class SvxShape;
+struct SvxIDPropertyCombine;
+
+#define SFX_METRIC_ITEM (0x40)
+
+class EDITENG_DLLPUBLIC SvxItemPropertySet
+{
+ SfxItemPropertyMap m_aPropertyMap;
+ mutable com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> m_xInfo;
+ const SfxItemPropertyMapEntry* _pMap;
+ ::std::vector< SvxIDPropertyCombine* > aCombineList;
+ sal_Bool mbConvertTwips;
+ SfxItemPool& mrItemPool;
+
+public:
+ SvxItemPropertySet( const SfxItemPropertyMapEntry *pMap, SfxItemPool& rPool, sal_Bool bConvertTwips = sal_False );
+ ~SvxItemPropertySet();
+
+ // Methods, which work directly with the ItemSet
+ ::com::sun::star::uno::Any getPropertyValue( const SfxItemPropertySimpleEntry* pMap, const SfxItemSet& rSet, bool bSearchInParent, bool bDontConvertNegativeValues ) const;
+ void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const ::com::sun::star::uno::Any& rVal, SfxItemSet& rSet, bool bDontConvertNegativeValues ) const;
+
+ // Methods that use Any instead
+ ::com::sun::star::uno::Any getPropertyValue( const SfxItemPropertySimpleEntry* pMap ) const;
+ void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const ::com::sun::star::uno::Any& rVal ) const;
+
+ sal_Bool AreThereOwnUsrAnys() const { return ( aCombineList.empty() ? sal_False : sal_True ); }
+ ::com::sun::star::uno::Any* GetUsrAnyForID(sal_uInt16 nWID) const;
+ void AddUsrAnyForID(const ::com::sun::star::uno::Any& rAny, sal_uInt16 nWID);
+ void ClearAllUsrAny();
+
+ com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > getPropertySetInfo() const;
+ const SfxItemPropertyMapEntry* getPropertyMapEntries() const {return _pMap;}
+ const SfxItemPropertyMap* getPropertyMap()const { return &m_aPropertyMap;}
+ const SfxItemPropertySimpleEntry* getPropertyMapEntry(const OUString &rName) const;
+
+ static com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > getPropertySetInfo( const SfxItemPropertyMapEntry* pMap );
+};
+
+/** converts the given any with a metric to 100th/mm if needed */
+EDITENG_DLLPUBLIC void SvxUnoConvertToMM( const SfxMapUnit eSourceMapUnit, com::sun::star::uno::Any & rMetric ) throw();
+
+/** converts the given any with a metric from 100th/mm to the given metric if needed */
+EDITENG_DLLPUBLIC void SvxUnoConvertFromMM( const SfxMapUnit eDestinationMapUnit, com::sun::star::uno::Any & rMetric ) throw();
+
+#endif // _SVX_UNOIPSET_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unolingu.hxx b/include/editeng/unolingu.hxx
new file mode 100644
index 000000000000..09f570228f95
--- /dev/null
+++ b/include/editeng/unolingu.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 _UNO_LINGU_HXX
+#define _UNO_LINGU_HXX
+
+#include <i18nlangtag/lang.h>
+#include <tools/string.hxx>
+#include <com/sun/star/util/Language.hpp>
+#include <com/sun/star/linguistic2/XLinguServiceManager2.hpp>
+#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
+#include <com/sun/star/linguistic2/XHyphenator.hpp>
+#include <com/sun/star/linguistic2/XThesaurus.hpp>
+#include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include "editeng/editengdllapi.h"
+
+class LinguMgrExitLstnr;
+
+class Window;
+
+///////////////////////////////////////////////////////////////////////////
+
+class EDITENG_DLLPUBLIC LinguMgr
+{
+ friend class LinguMgrExitLstnr;
+
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XLinguServiceManager2 > xLngSvcMgr;
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenator > xHyph;
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XThesaurus > xThes;
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSearchableDictionaryList > xDicList;
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > xProp;
+
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionary > xIgnoreAll;
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionary > xChangeAll;
+
+ static LinguMgrExitLstnr *pExitLstnr;
+ static sal_Bool bExiting;
+
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > GetSpell();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenator > GetHyph();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XThesaurus > GetThes();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSearchableDictionaryList > GetDicList();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > GetProp();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionary > GetStandard();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionary > GetIgnoreAll();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionary > GetChangeAll();
+
+ // disallow access to copy-constructor and assignment-operator
+ LinguMgr(const LinguMgr &);
+ LinguMgr & operator = (const LinguMgr &);
+
+public:
+
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > GetSpellChecker();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenator > GetHyphenator();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XThesaurus > GetThesaurus();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSearchableDictionaryList > GetDictionaryList();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > GetLinguPropertySet();
+
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XLinguServiceManager2 > GetLngSvcMgr();
+
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionary > GetStandardDic();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionary > GetIgnoreAllList();
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionary > GetChangeAllList();
+};
+
+///////////////////////////////////////////////////////////////////////////
+
+namespace com { namespace sun { namespace star { namespace linguistic2 {
+ class XHyphenatedWord;
+}}}}
+
+
+struct SvxAlternativeSpelling
+{
+ String aReplacement;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenatedWord > xHyphWord;
+ sal_Int16 nChangedPos,
+ nChangedLength;
+ sal_Bool bIsAltSpelling;
+
+ inline SvxAlternativeSpelling();
+};
+
+inline SvxAlternativeSpelling::SvxAlternativeSpelling() :
+ nChangedPos(-1), nChangedLength(-1), bIsAltSpelling(sal_False)
+{
+}
+
+
+EDITENG_DLLPUBLIC SvxAlternativeSpelling SvxGetAltSpelling(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenatedWord > & rHyphWord );
+
+
+///////////////////////////////////////////////////////////////////////////
+
+class EDITENG_DLLPUBLIC SvxDicListChgClamp
+{
+private:
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSearchableDictionaryList > xDicList;
+
+ // disallow access to copy-constructor and assignment-operator
+ EDITENG_DLLPRIVATE SvxDicListChgClamp(const SvxDicListChgClamp &);
+ EDITENG_DLLPRIVATE SvxDicListChgClamp & operator = (const SvxDicListChgClamp &);
+
+public:
+ SvxDicListChgClamp( ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSearchableDictionaryList > &rxDicList );
+ ~SvxDicListChgClamp();
+};
+
+///////////////////////////////////////////////////////////////////////////
+
+//TODO: remove those functions or make them inline
+EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > SvxGetSpellChecker();
+EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenator > SvxGetHyphenator();
+EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XThesaurus > SvxGetThesaurus();
+EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSearchableDictionaryList > SvxGetDictionaryList();
+EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > SvxGetLinguPropertySet();
+//TODO: remove argument or provide SvxGetIgnoreAllList with the same one
+EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionary > SvxGetOrCreatePosDic(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSearchableDictionaryList > xDicList );
+EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionary > SvxGetIgnoreAllList();
+EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionary > SvxGetChangeAllList();
+
+///////////////////////////////////////////////////////////////////////////
+// misc functions
+//
+
+EDITENG_DLLPUBLIC short SvxDicError( Window *pParent, sal_Int16 nError );
+
+
+#endif
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unonames.hxx b/include/editeng/unonames.hxx
new file mode 100644
index 000000000000..3a5984452773
--- /dev/null
+++ b/include/editeng/unonames.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/.
+ */
+
+// Common across fields
+#define UNO_TC_PROP_ANCHOR "Anchor"
+#define UNO_TC_PROP_TEXTFIELD_TYPE "TextFieldType"
+#define UNO_TC_PROP_IS_FIXED "IsFixed"
+#define UNO_TC_PROP_CURRENT_PRESENTATION "CurrentPresentation"
+
+// Date & Time
+#define UNO_TC_PROP_IS_DATE "IsDate"
+#define UNO_TC_PROP_DATE_TIME "DateTime"
+#define UNO_TC_PROP_NUMFORMAT "NumberFormat"
+
+// URL
+#define UNO_TC_PROP_URL_FORMAT "Format"
+#define UNO_TC_PROP_URL_REPRESENTATION "Representation"
+#define UNO_TC_PROP_URL_TARGET "TargetFrame"
+#define UNO_TC_PROP_URL "URL"
+
+// Table
+#define UNO_TC_PROP_TABLE_POSITION "TablePosition"
+
+// File
+#define UNO_TC_PROP_FILE_FORMAT "FileFormat"
+
+// Author
+#define UNO_TC_PROP_AUTHOR_CONTENT "Content"
+#define UNO_TC_PROP_AUTHOR_FORMAT "AuthorFormat"
+#define UNO_TC_PROP_AUTHOR_FULLNAME "FullName"
+
+// Measure
+#define UNO_TC_PROP_MEASURE_KIND "Kind"
+
+#define UNO_TR_PROP_SELECTION "Selection"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unonrule.hxx b/include/editeng/unonrule.hxx
new file mode 100644
index 000000000000..985e3e9193bb
--- /dev/null
+++ b/include/editeng/unonrule.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 _SVX_UNONRULE_HXX
+#define _SVX_UNONRULE_HXX
+
+#include <com/sun/star/container/XIndexReplace.hpp>
+#include <com/sun/star/ucb/XAnyCompare.hpp>
+#include "editeng/editengdllapi.h"
+#include <cppuhelper/implbase5.hxx>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
+#include <editeng/numitem.hxx>
+#include <comphelper/servicehelper.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+
+EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > SvxCreateNumRule( const SvxNumRule* pRule ) throw();
+EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > SvxCreateNumRule() throw();
+const SvxNumRule& SvxGetNumRule( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > xRule ) throw( ::com::sun::star::lang::IllegalArgumentException );
+EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompare > SvxCreateNumRuleCompare() throw();
+
+class SvxUnoNumberingRules : public ::cppu::WeakAggImplHelper5< com::sun::star::container::XIndexReplace, com::sun::star::ucb::XAnyCompare,
+ com::sun::star::lang::XUnoTunnel, com::sun::star::util::XCloneable, com::sun::star::lang::XServiceInfo >
+{
+private:
+ SvxNumRule maRule;
+public:
+ SvxUnoNumberingRules( const SvxNumRule& rRule ) throw();
+ virtual ~SvxUnoNumberingRules() throw();
+
+ UNO3_GETIMPLEMENTATION_DECL( SvxUnoNumberingRules )
+
+ //XIndexReplace
+ virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const com::sun::star::uno::Any& Element ) throw(
+ com::sun::star::lang::IllegalArgumentException, com::sun::star::lang::IndexOutOfBoundsException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException);
+
+ //XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw(com::sun::star::uno::RuntimeException) ;
+ virtual com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(com::sun::star::lang::IndexOutOfBoundsException,
+ com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException);
+
+ //XElementAccess
+ virtual com::sun::star::uno::Type SAL_CALL getElementType() throw(com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements() throw(com::sun::star::uno::RuntimeException);
+
+ // XAnyCompare
+ virtual sal_Int16 SAL_CALL compare( const com::sun::star::uno::Any& Any1, const com::sun::star::uno::Any& Any2 ) throw(com::sun::star::uno::RuntimeException);
+
+ // XCloneable
+ virtual com::sun::star::uno::Reference< com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw(com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(com::sun::star::uno::RuntimeException);
+ virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(com::sun::star::uno::RuntimeException);
+
+ // internal
+ com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> getNumberingRuleByIndex( sal_Int32 nIndex) const throw();
+ void setNumberingRuleByIndex( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rProperties, sal_Int32 nIndex) throw( com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException );
+
+ static sal_Int16 Compare( const com::sun::star::uno::Any& rAny1, const com::sun::star::uno::Any& rAny2 );
+
+ const SvxNumRule& getNumRule() const { return maRule; }
+};
+
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unopracc.hxx b/include/editeng/unopracc.hxx
new file mode 100644
index 000000000000..c2d3fdc746f3
--- /dev/null
+++ b/include/editeng/unopracc.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 _SVX_UNOPRACC_HXX
+#define _SVX_UNOPRACC_HXX
+
+#include <editeng/unotext.hxx>
+
+
+class SvxEditSource;
+
+/** Wraps SvxUnoTextRangeBase and provides us with the text properties
+
+ Inherits from SvxUnoTextRangeBase and provides XPropertySet and
+ XMultiPropertySet interfaces. Just set the selection to the
+ required text range and return a reference to a XPropertySet.
+ */
+class SvxAccessibleTextPropertySet : public SvxUnoTextRangeBase,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::cppu::OWeakObject
+{
+public:
+ SvxAccessibleTextPropertySet( const SvxEditSource*, const SvxItemPropertySet* );
+ virtual ~SvxAccessibleTextPropertySet() throw();
+
+ // XTextRange
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
+
+ // uno::XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // lang::XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
+
+ // lang::XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceName
+ OUString SAL_CALL getServiceName() throw (::com::sun::star::uno::RuntimeException);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
new file mode 100644
index 000000000000..38ba3bdb4961
--- /dev/null
+++ b/include/editeng/unoprnms.hxx
@@ -0,0 +1,372 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_UNOPRNMS_HXX
+#define _SVX_UNOPRNMS_HXX
+
+#define UNO_NAME_SHAPE_SIZE "Size"
+#define UNO_NAME_SHAPE_POSITION "Position"
+
+#define UNO_NAME_CHAR_COLOR "CharColor"
+#define UNO_NAME_CHAR_FONT "CharFont"
+#define UNO_NAME_CHAR_HEIGHT "CharHeight"
+#define UNO_NAME_CHAR_POSTURE "CharPosture"
+#define UNO_NAME_CHAR_SHADOWED "CharShadowed"
+#define UNO_NAME_CHAR_UNDERLINE "CharUnderline"
+#define UNO_NAME_CHAR_WEIGHT "CharWeight"
+
+#define UNO_NAME_FILLSTYLE "FillStyle"
+#define UNO_NAME_FILLCOLOR "FillColor"
+#define UNO_NAME_FILLGRADIENT "FillGradient"
+#define UNO_NAME_FILLHATCH "FillHatch"
+#define UNO_NAME_FILLBITMAP "FillBitmap"
+#define UNO_NAME_FILLBACKGROUND "FillBackground"
+#define UNO_NAME_FILLCOLOR_2 "FillColor2"
+
+#define UNO_NAME_EDGEKIND "EdgeKind"
+#define UNO_NAME_EDGELINE1DELTA "EdgeLine1Delta"
+#define UNO_NAME_EDGELINE2DELTA "EdgeLine2Delta"
+#define UNO_NAME_EDGELINE3DELTA "EdgeLine3Delta"
+#define UNO_NAME_EDGENODE1HORZDIST "EdgeNode1HorzDist"
+#define UNO_NAME_EDGENODE1VERTDIST "EdgeNode1VertDist"
+#define UNO_NAME_EDGENODE2HORZDIST "EdgeNode2HorzDist"
+#define UNO_NAME_EDGENODE2VERTDIST "EdgeNode2VertDist"
+
+#define UNO_NAME_FILLBMP_OFFSET_X "FillBitmapOffsetX"
+#define UNO_NAME_FILLBMP_OFFSET_Y "FillBitmapOffsetY"
+#define UNO_NAME_FILLBMP_POSITION_OFFSET_X "FillBitmapPositionOffsetX"
+#define UNO_NAME_FILLBMP_POSITION_OFFSET_Y "FillBitmapPositionOffsetY"
+#define UNO_NAME_FILLBMP_RECTANGLE_POINT "FillBitmapRectanglePoint"
+#define UNO_NAME_FILLBMP_TILE "FillBitmapTile"
+#define UNO_NAME_FILLBMP_STRETCH "FillBitmapStretch"
+#define UNO_NAME_FILLBMP_LOGICAL_SIZE "FillBitmapLogicalSize"
+#define UNO_NAME_FILLBMP_SIZE_X "FillBitmapSizeX"
+#define UNO_NAME_FILLBMP_SIZE_Y "FillBitmapSizeY"
+#define UNO_NAME_FILL_TRANSPARENCE "FillTransparence"
+#define UNO_NAME_FILLBMP_MODE "FillBitmapMode"
+
+#define UNO_NAME_FILL_GRADIENT_STYLE "FillGradientStyle"
+#define UNO_NAME_FILL_GRADIENT_START_COLOR "FillGradientStartColor"
+#define UNO_NAME_FILL_GRADIENT_END_COLOR "FillGradientEndColor"
+#define UNO_NAME_FILL_GRADIENT_ANGLE "FillGradientAngle"
+#define UNO_NAME_FILL_GRADIENT_BORDER "FillGradientBorder"
+#define UNO_NAME_FILL_GRADIENT_OFFSET_X "FillGradientOffsetX"
+#define UNO_NAME_FILL_GRADIENT_OFFSET_Y "FillGradientOffsetY"
+#define UNO_NAME_FILL_GRADIENT_START_INTENSITY "FillGradientStartIntensity"
+#define UNO_NAME_FILL_GRADIENT_END_INTENSITY "FillGradientEndIntensity"
+#define UNO_NAME_FILL_GRADIENT_STEPS "FillGradientSteps"
+
+#define UNO_NAME_FILL_HATCH_STYLE "FillHatchStyle"
+#define UNO_NAME_FILL_HATCH_COLOR "FillHatchColor"
+#define UNO_NAME_FILL_HATCH_DISTANCE "FillHatchDistance"
+#define UNO_NAME_FILL_HATCH_ANGLE "FillHatchAngle"
+
+#define UNO_NAME_LINESTYLE "LineStyle"
+#define UNO_NAME_LINEDASH "LineDash"
+#define UNO_NAME_LINEWIDTH "LineWidth"
+#define UNO_NAME_LINECOLOR "LineColor"
+#define UNO_NAME_LINEJOINT "LineJoint"
+#define UNO_NAME_LINESTART "LineStart"
+#define UNO_NAME_LINEEND "LineEnd"
+#define UNO_NAME_LINESTARTWIDTH "LineStartWidth"
+#define UNO_NAME_LINEENDWIDTH "LineEndWidth"
+#define UNO_NAME_LINESTARTCENTER "LineStartCenter"
+#define UNO_NAME_LINEENDCENTER "LineEndCenter"
+#define UNO_NAME_LINETRANSPARENCE "LineTransparence"
+#define UNO_NAME_LINECAP "LineCap"
+
+#define UNO_NAME_SHADOW "Shadow"
+#define UNO_NAME_SHADOWCOLOR "ShadowColor"
+#define UNO_NAME_SHADOWXDIST "ShadowXDistance"
+#define UNO_NAME_SHADOWYDIST "ShadowYDistance"
+#define UNO_NAME_SHADOWTRANSPARENCE "ShadowTransparence"
+
+#define UNO_NAME_EDGERADIUS "CornerRadius"
+
+#define UNO_NAME_TEXT_MINFRAMEHEIGHT "TextMinimumFrameHeight"
+#define UNO_NAME_TEXT_AUTOGROWHEIGHT "TextAutoGrowHeight"
+#define UNO_NAME_TEXT_FITTOSIZE "TextFitToSize"
+#define UNO_NAME_TEXT_LEFTDIST "TextLeftDistance"
+#define UNO_NAME_TEXT_RIGHTDIST "TextRightDistance"
+#define UNO_NAME_TEXT_UPPERDIST "TextUpperDistance"
+#define UNO_NAME_TEXT_LOWERDIST "TextLowerDistance"
+#define UNO_NAME_TEXT_VERTADJUST "TextVerticalAdjust"
+#define UNO_NAME_TEXT_MAXFRAMEHEIGHT "TextMaximumFrameHeight"
+#define UNO_NAME_TEXT_MINFRAMEWIDTH "TextMinimumFrameWidth"
+#define UNO_NAME_TEXT_MAXFRAMEWIDTH "TextMaximumFrameWidth"
+#define UNO_NAME_TEXT_AUTOGROWWIDTH "TextAutoGrowWidth"
+#define UNO_NAME_TEXT_HORZADJUST "TextHorizontalAdjust"
+#define UNO_NAME_TEXT_ANIKIND "TextAnimationKind"
+#define UNO_NAME_TEXT_ANIDIRECTION "TextAnimationDirection"
+#define UNO_NAME_TEXT_ANISTARTINSIDE "TextAnimationStartInside"
+#define UNO_NAME_TEXT_ANISTOPINSIDE "TextAnimationStopInside"
+#define UNO_NAME_TEXT_ANICOUNT "TextAnimationCount"
+#define UNO_NAME_TEXT_ANIDELAY "TextAnimationDelay"
+#define UNO_NAME_TEXT_ANIAMOUNT "TextAnimationAmount"
+#define UNO_NAME_TEXT_CONTOURFRAME "TextContourFrame"
+#define UNO_NAME_TEXT_WRITINGMODE "TextWritingMode"
+#define UNO_NAME_TEXT_FONTINDEPENDENTLINESPACING "FontIndependentLineSpacing"
+#define UNO_NAME_TEXT_WORDWRAP "TextWordWrap"
+
+#define UNO_NAME_MEASUREKIND "MeasureKind"
+#define UNO_NAME_MEASURETEXTHPOS "MeasureTextHorizontalPosition"
+#define UNO_NAME_MEASURETEXTVPOS "MeasureTextVerticalPosition"
+#define UNO_NAME_MEASURELINEDIST "MeasureLineDistance"
+#define UNO_NAME_MEASUREHELPLINEOVERHANG "MeasureHelpLineOverhang"
+#define UNO_NAME_MEASUREHELPLINEDIST "MeasureHelpLineDistance"
+#define UNO_NAME_MEASUREHELPLINE1LEN "MeasureHelpLine1Length"
+#define UNO_NAME_MEASUREHELPLINE2LEN "MeasureHelpLine2Length"
+#define UNO_NAME_MEASUREBELOWREFEDGE "MeasureBelowReferenceEdge"
+#define UNO_NAME_MEASURETEXTROTA90 "MeasureTextRotate90"
+#define UNO_NAME_MEASURETEXTUPSIDEDOWN "MeasureTextUpsideDown"
+#define UNO_NAME_MEASUREOVERHANG "MeasureOverhang"
+#define UNO_NAME_MEASUREUNIT "MeasureUnit"
+#define UNO_NAME_MEASURESCALE "MeasureScale"
+#define UNO_NAME_MEASURESHOWUNIT "MeasureShowUnit"
+#define UNO_NAME_MEASUREFORMATSTRING "MeasureFormatString"
+#define UNO_NAME_MEASURETEXTAUTOANGLE "MeasureTextAutoAngle"
+#define UNO_NAME_MEASURETEXTAUTOANGLEVIEW "MeasureTextAutoAngleView"
+#define UNO_NAME_MEASURETEXTISFIXEDANGLE "MeasureTextIsFixedAngle"
+#define UNO_NAME_MEASURETEXTFIXEDANGLE "MeasureTextFixedAngle"
+
+#define UNO_NAME_CIRCKIND "CircleKind"
+#define UNO_NAME_CIRCSTARTANGLE "CircleStartAngle"
+#define UNO_NAME_CIRCENDANGLE "CircleEndAngle"
+
+#define UNO_NAME_POLYGONKIND "PolygonKind"
+#define UNO_NAME_POLYPOLYGON "PolyPolygon"
+#define UNO_NAME_POLYPOLYGONBEZIER "PolyPolygonBezier"
+#define UNO_NAME_POLYGON "Polygon"
+
+#define UNO_NAME_MISC_OBJ_ZORDER "ZOrder"
+#define UNO_NAME_MISC_OBJ_MOVEPROTECT "MoveProtect"
+#define UNO_NAME_MISC_OBJ_SIZEPROTECT "SizeProtect"
+#define UNO_NAME_MISC_OBJ_PRINTABLE "Printable"
+#define UNO_NAME_MISC_OBJ_LAYERID "LayerID"
+#define UNO_NAME_MISC_OBJ_LAYERNAME "LayerName"
+#define UNO_NAME_MISC_OBJ_NAME "Name"
+#define UNO_NAME_MISC_OBJ_ROTATEANGLE "RotateAngle"
+#define UNO_NAME_MISC_OBJ_SHEARANGLE "ShearAngle"
+#define UNO_NAME_MISC_OBJ_ROTATION_POINT_X "RotationPointX"
+#define UNO_NAME_MISC_OBJ_ROTATION_POINT_Y "RotationPointY"
+#define UNO_NAME_MISC_OBJ_FRAMERECT "FrameRect"
+#define UNO_NAME_MISC_OBJ_BOUNDRECT "BoundRect"
+
+// #i68101#
+#define UNO_NAME_MISC_OBJ_TITLE "Title"
+#define UNO_NAME_MISC_OBJ_DESCRIPTION "Description"
+
+#define UNO_NAME_GRAPHOBJ_FILLBITMAP "GraphicObjectFillBitmap"
+#define UNO_NAME_GRAPHOBJ_GRAFURL "GraphicURL"
+#define UNO_NAME_GRAPHOBJ_REPLACEMENTGRAFURL "ReplacementGraphicURL"
+#define UNO_NAME_GRAPHOBJ_GRAFSTREAMURL "GraphicStreamURL"
+#define UNO_NAME_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:"
+#define UNO_NAME_GRAPHOBJ_URLPKGPREFIX "vnd.sun.star.Package:"
+#define UNO_NAME_GRAPHOBJ_GRAPHIC "Graphic"
+
+#define UNO_NAME_OLE2_METAFILE "MetaFile"
+#define UNO_NAME_OLE2_PERSISTNAME "PersistName"
+
+#define UNO_NAME_3D_SCENE_PERSPECTIVE "D3DScenePerspective"
+#define UNO_NAME_3D_SCENE_DISTANCE "D3DSceneDistance"
+#define UNO_NAME_3D_SCENE_FOCAL_LENGTH "D3DSceneFocalLength"
+#define UNO_NAME_3D_SCENE_TWO_SIDED_LIGHTING "D3DSceneTwoSidedLighting"
+#define UNO_NAME_3D_SCENE_LIGHTCOLOR_1 "D3DSceneLightColor1"
+#define UNO_NAME_3D_SCENE_LIGHTCOLOR_2 "D3DSceneLightColor2"
+#define UNO_NAME_3D_SCENE_LIGHTCOLOR_3 "D3DSceneLightColor3"
+#define UNO_NAME_3D_SCENE_LIGHTCOLOR_4 "D3DSceneLightColor4"
+#define UNO_NAME_3D_SCENE_LIGHTCOLOR_5 "D3DSceneLightColor5"
+#define UNO_NAME_3D_SCENE_LIGHTCOLOR_6 "D3DSceneLightColor6"
+#define UNO_NAME_3D_SCENE_LIGHTCOLOR_7 "D3DSceneLightColor7"
+#define UNO_NAME_3D_SCENE_LIGHTCOLOR_8 "D3DSceneLightColor8"
+#define UNO_NAME_3D_SCENE_LIGHTON_1 "D3DSceneLightOn1"
+#define UNO_NAME_3D_SCENE_LIGHTON_2 "D3DSceneLightOn2"
+#define UNO_NAME_3D_SCENE_LIGHTON_3 "D3DSceneLightOn3"
+#define UNO_NAME_3D_SCENE_LIGHTON_4 "D3DSceneLightOn4"
+#define UNO_NAME_3D_SCENE_LIGHTON_5 "D3DSceneLightOn5"
+#define UNO_NAME_3D_SCENE_LIGHTON_6 "D3DSceneLightOn6"
+#define UNO_NAME_3D_SCENE_LIGHTON_7 "D3DSceneLightOn7"
+#define UNO_NAME_3D_SCENE_LIGHTON_8 "D3DSceneLightOn8"
+#define UNO_NAME_3D_SCENE_LIGHTDIRECTION_1 "D3DSceneLightDirection1"
+#define UNO_NAME_3D_SCENE_LIGHTDIRECTION_2 "D3DSceneLightDirection2"
+#define UNO_NAME_3D_SCENE_LIGHTDIRECTION_3 "D3DSceneLightDirection3"
+#define UNO_NAME_3D_SCENE_LIGHTDIRECTION_4 "D3DSceneLightDirection4"
+#define UNO_NAME_3D_SCENE_LIGHTDIRECTION_5 "D3DSceneLightDirection5"
+#define UNO_NAME_3D_SCENE_LIGHTDIRECTION_6 "D3DSceneLightDirection6"
+#define UNO_NAME_3D_SCENE_LIGHTDIRECTION_7 "D3DSceneLightDirection7"
+#define UNO_NAME_3D_SCENE_LIGHTDIRECTION_8 "D3DSceneLightDirection8"
+#define UNO_NAME_3D_SCENE_AMBIENTCOLOR "D3DSceneAmbientColor"
+#define UNO_NAME_3D_SCENE_SHADOW_SLANT "D3DSceneShadowSlant"
+#define UNO_NAME_3D_SCENE_SHADE_MODE "D3DSceneShadeMode"
+
+#define UNO_NAME_3D_DOUBLE_SIDED "D3DDoubleSided"
+#define UNO_NAME_3D_NORMALS_KIND "D3DNormalsKind"
+#define UNO_NAME_3D_NORMALS_INVERT "D3DNormalsInvert"
+#define UNO_NAME_3D_TEXTURE_PROJ_X "D3DTextureProjectionX"
+#define UNO_NAME_3D_TEXTURE_PROJ_Y "D3DTextureProjectionY"
+#define UNO_NAME_3D_SHADOW_3D "D3DShadow3D"
+#define UNO_NAME_3D_MAT_COLOR "D3DMaterialColor"
+#define UNO_NAME_3D_MAT_EMISSION "D3DMaterialEmission"
+#define UNO_NAME_3D_MAT_SPECULAR "D3DMaterialSpecular"
+#define UNO_NAME_3D_MAT_SPECULAR_INTENSITY "D3DMaterialSpecularIntensity"
+#define UNO_NAME_3D_TEXTURE_KIND "D3DTextureKind"
+#define UNO_NAME_3D_TEXTURE_MODE "D3DTextureMode"
+#define UNO_NAME_3D_TEXTURE_FILTER "D3DTextureFilter"
+
+// #i28528#
+// Added extra Item (Bool) for chart2 to be able to show reduced line geometry
+#define UNO_NAME_3D_REDUCED_LINE_GEOMETRY "D3DReducedLineGeometry"
+
+#define UNO_NAME_3D_HORZ_SEGS "D3DHorizontalSegments"
+#define UNO_NAME_3D_VERT_SEGS "D3DVerticalSegments"
+
+#define UNO_NAME_3D_PERCENT_DIAGONAL "D3DPercentDiagonal"
+#define UNO_NAME_3D_BACKSCALE "D3DBackscale"
+#define UNO_NAME_3D_LATHE_END_ANGLE "D3DEndAngle"
+
+#define UNO_NAME_3D_EXTRUDE_DEPTH "D3DDepth"
+
+#define UNO_NAME_3D_TRANSFORM_MATRIX "D3DTransformMatrix"
+#define UNO_NAME_3D_CAMERA_GEOMETRY "D3DCameraGeometry"
+#define UNO_NAME_3D_POS "D3DPosition"
+#define UNO_NAME_3D_SIZE "D3DSize"
+#define UNO_NAME_3D_POS_IS_CENTER "D3DPositionIsCenter"
+#define UNO_NAME_3D_POLYPOLYGON3D "D3DPolyPolygon3D"
+#define UNO_NAME_3D_NORMALSPOLYGON3D "D3DNormalsPolygon3D"
+#define UNO_NAME_3D_TEXTUREPOLYGON3D "D3DTexturePolygon3D"
+#define UNO_NAME_3D_LINEONLY "D3DLineOnly"
+
+// New 3D properties which are possible for lathe and extrude 3d objects
+#define UNO_NAME_3D_SMOOTH_NORMALS "D3DSmoothNormals"
+#define UNO_NAME_3D_SMOOTH_LIDS "D3DSmoothLids"
+#define UNO_NAME_3D_CHARACTER_MODE "D3DCharacterMode"
+#define UNO_NAME_3D_CLOSE_FRONT "D3DCloseFront"
+#define UNO_NAME_3D_CLOSE_BACK "D3DCloseBack"
+
+#define UNO_NAME_NUMBERING "NumberingIsNumber"
+#define UNO_NAME_NUMBERING_RULES "NumberingRules"
+#define UNO_NAME_NUMBERING_LEVEL "NumberingLevel"
+
+#define UNO_NAME_NRULE_NUMBERINGTYPE "NumberingType"
+#define UNO_NAME_NRULE_PREFIX "Prefix"
+#define UNO_NAME_NRULE_SUFFIX "Suffix"
+#define UNO_NAME_NRULE_BULLETID "BulletId"
+#define UNO_NAME_NRULE_BULLET_COLOR "BulletColor"
+#define UNO_NAME_NRULE_BULLET_RELSIZE "BulletRelSize"
+#define UNO_NAME_NRULE_BULLET_FONT "BulletFont"
+#define UNO_NAME_NRULE_GRAPHICURL "GraphicURL"
+#define UNO_NAME_NRULE_START_WITH "StartWith"
+#define UNO_NAME_NRULE_LEFT_MARGIN "LeftMargin"
+#define UNO_NAME_NRULE_FIRST_LINE_OFFSET "FirstLineOffset"
+#define UNO_NAME_NRULE_ADJUST "Adjust"
+
+#define UNO_NAME_EDIT_FONT_DESCRIPTOR "FontDescriptor"
+#define UNO_NAME_EDIT_FONT_STYLENAME "FontStyleName"
+
+#define UNO_NAME_EDIT_PARA_ADJUST "ParaAdjust"
+#define UNO_NAME_EDIT_PARA_BMARGIN "ParaBottomMargin"
+#define UNO_NAME_EDIT_PARA_LASTLINEADJ "ParaLastLineAdjust"
+#define UNO_NAME_EDIT_PARA_LMARGIN "ParaLeftMargin"
+#define UNO_NAME_EDIT_PARA_LRPARAMARGIN "ParaLeftRightParaMargin"
+#define UNO_NAME_EDIT_PARA_LINESPACING "ParaLineSpacing"
+#define UNO_NAME_EDIT_PARA_RMARGIN "ParaRightMargin"
+#define UNO_NAME_EDIT_PARA_TAPSTOPS "ParaTabStops"
+#define UNO_NAME_EDIT_PARA_TBMARGIN "ParaTopBottomMargin"
+#define UNO_NAME_EDIT_PARA_TMARGIN "ParaTopMargin"
+#define UNO_NAME_EDIT_PARA_IS_HYPHEN "ParaIsHyphenation"
+#define UNO_NAME_EDIT_PARA_IS_HANGING_PUNCTUATION "ParaIsHangingPunctuation"
+#define UNO_NAME_EDIT_PARA_IS_CHARACTER_DISTANCE "ParaIsCharacterDistance"
+#define UNO_NAME_EDIT_PARA_IS_FORBIDDEN_RULES "ParaIsForbiddenRules"
+#define UNO_NAME_EDIT_PARA_FIRST_LINE_INDENT "ParaFirstLineIndent"
+
+#define UNO_NAME_EDIT_CHAR_HEIGHT "CharHeight"
+#define UNO_NAME_EDIT_CHAR_FONTNAME "CharFontName"
+#define UNO_NAME_EDIT_CHAR_FONTSTYLENAME "CharFontStyleName"
+#define UNO_NAME_EDIT_CHAR_FONTFAMILY "CharFontFamily"
+#define UNO_NAME_EDIT_CHAR_FONTCHARSET "CharFontCharSet"
+#define UNO_NAME_EDIT_CHAR_FONTPITCH "CharFontPitch"
+#define UNO_NAME_EDIT_CHAR_POSTURE "CharPosture"
+#define UNO_NAME_EDIT_CHAR_WEIGHT "CharWeight"
+#define UNO_NAME_EDIT_CHAR_LOCALE "CharLocale"
+
+#define UNO_NAME_EDIT_CHAR_HEIGHT_ASIAN "CharHeightAsian"
+#define UNO_NAME_EDIT_CHAR_FONTNAME_ASIAN "CharFontNameAsian"
+#define UNO_NAME_EDIT_CHAR_FONTSTYLENAME_ASIAN "CharFontStyleNameAsian"
+#define UNO_NAME_EDIT_CHAR_FONTFAMILY_ASIAN "CharFontFamilyAsian"
+#define UNO_NAME_EDIT_CHAR_FONTCHARSET_ASIAN "CharFontCharSetAsian"
+#define UNO_NAME_EDIT_CHAR_FONTPITCH_ASIAN "CharFontPitchAsian"
+#define UNO_NAME_EDIT_CHAR_POSTURE_ASIAN "CharPostureAsian"
+#define UNO_NAME_EDIT_CHAR_WEIGHT_ASIAN "CharWeightAsian"
+#define UNO_NAME_EDIT_CHAR_LOCALE_ASIAN "CharLocaleAsian"
+
+#define UNO_NAME_EDIT_CHAR_HEIGHT_COMPLEX "CharHeightComplex"
+#define UNO_NAME_EDIT_CHAR_FONTNAME_COMPLEX "CharFontNameComplex"
+#define UNO_NAME_EDIT_CHAR_FONTSTYLENAME_COMPLEX "CharFontStyleNameComplex"
+#define UNO_NAME_EDIT_CHAR_FONTFAMILY_COMPLEX "CharFontFamilyComplex"
+#define UNO_NAME_EDIT_CHAR_FONTCHARSET_COMPLEX "CharFontCharSetComplex"
+#define UNO_NAME_EDIT_CHAR_FONTPITCH_COMPLEX "CharFontPitchComplex"
+#define UNO_NAME_EDIT_CHAR_POSTURE_COMPLEX "CharPostureComplex"
+#define UNO_NAME_EDIT_CHAR_WEIGHT_COMPLEX "CharWeightComplex"
+#define UNO_NAME_EDIT_CHAR_LOCALE_COMPLEX "CharLocaleComplex"
+
+#define UNO_NAME_EDIT_CHAR_COLOR "CharColor"
+#define UNO_NAME_EDIT_CHAR_CROSSEDOUT "CharCrossedOut"
+#define UNO_NAME_EDIT_CHAR_STRIKEOUT "CharStrikeout"
+#define UNO_NAME_EDIT_CHAR_ESCAPEMENT "CharEscapement"
+#define UNO_NAME_EDIT_CHAR_FONTNAME "CharFontName"
+#define UNO_NAME_EDIT_CHAR_SHADOWED "CharShadowed"
+#define UNO_NAME_EDIT_CHAR_UNDERLINE "CharUnderline"
+#define UNO_NAME_EDIT_CHAR_OVERLINE "CharOverline"
+
+#define UNO_NAME_BITMAP "Bitmap"
+
+#define UNO_NAME_LINKDISPLAYNAME "LinkDisplayName"
+#define UNO_NAME_LINKDISPLAYBITMAP "LinkDisplayBitmap"
+
+#define UNO_NAME_GRAPHIC_LUMINANCE "AdjustLuminance"
+#define UNO_NAME_GRAPHIC_CONTRAST "AdjustContrast"
+#define UNO_NAME_GRAPHIC_RED "AdjustRed"
+#define UNO_NAME_GRAPHIC_GREEN "AdjustGreen"
+#define UNO_NAME_GRAPHIC_BLUE "AdjustBlue"
+#define UNO_NAME_GRAPHIC_GAMMA "Gamma"
+#define UNO_NAME_GRAPHIC_TRANSPARENCY "Transparency"
+#define UNO_NAME_GRAPHIC_COLOR_MODE "GraphicColorMode"
+#define UNO_NAME_GRAPHIC_GRAPHICCROP "GraphicCrop"
+
+#define UNO_NAME_CUSTOMSHAPE_ADJUSTMENT "CustomShapeAdjustment"
+
+// The following properties are obsolete and can eventually be removed
+#define UNO_NAME_EDIT_FONT_COLOR "FontColor"
+#define UNO_NAME_EDIT_FONT_ESCAPEMENT "FontEscapement"
+#define UNO_NAME_EDIT_FONT_HEIGHT "FontHeight"
+#define UNO_NAME_EDIT_FONT_SHADOWED "FontShadowed"
+#define UNO_NAME_EDIT_FONT_SLANT "FontSlant"
+#define UNO_NAME_EDIT_FONT_STRIKEOUT "FontStrikeout"
+#define UNO_NAME_EDIT_FONT_UNDERLINE "FontUnderline"
+#define UNO_NAME_EDIT_FONT_WEIGHT "FontWeight"
+#define UNO_NAME_EDIT_CHAR_STYLE "CharStyle"
+#define UNO_NAME_EDIT_FONT_FAMILY "FontFamily"
+#define UNO_NAME_EDIT_FONT_NAME "FontName"
+#define UNO_NAME_EDIT_FONT_CHARSET "FontCharset"
+// End of the obsolete properties
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
new file mode 100644
index 000000000000..b5a5e02a8c1b
--- /dev/null
+++ b/include/editeng/unotext.hxx
@@ -0,0 +1,661 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_UNOTEXT_HXX
+#define _SVX_UNOTEXT_HXX
+
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/text/XTextRange.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/text/XTextRangeMover.hpp>
+#include <com/sun/star/text/XTextCursor.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/text/XTextRangeCompare.hpp>
+#include <com/sun/star/beans/XMultiPropertyStates.hpp>
+#include <com/sun/star/text/XTextAppend.hpp>
+#include <com/sun/star/text/XTextCopy.hpp>
+#include <com/sun/star/text/XTextField.hpp>
+#include <com/sun/star/container/XIndexReplace.hpp>
+#include <com/sun/star/awt/FontSlant.hpp>
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/style/LineSpacing.hpp>
+#include <com/sun/star/style/TabStop.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/weakagg.hxx>
+#include <osl/diagnose.hxx>
+#include <osl/mutex.hxx>
+#include <comphelper/servicehelper.hxx>
+#include <tools/link.hxx>
+#include <svl/itemprop.hxx>
+#include <svl/itemset.hxx>
+#include <svl/itempool.hxx>
+#include <svl/solar.hrc>
+#include <editeng/editdata.hxx>
+#include <editeng/unoedsrc.hxx>
+#include <editeng/eeitem.hxx>
+#include <editeng/editengdllapi.h>
+#include <editeng/memberids.hrc>
+
+class SvxItemPropertySet;
+
+#ifndef SEQTYPE
+ #if defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x500)
+ #define SEQTYPE(x) (new ::com::sun::star::uno::Type( x ))
+ #else
+ #define SEQTYPE(x) &(x)
+ #endif
+#endif
+
+#define WID_FONTDESC OWN_ATTR_VALUE_START
+#define WID_NUMLEVEL OWN_ATTR_VALUE_START+1
+#define WID_PORTIONTYPE OWN_ATTR_VALUE_START+2
+#define WID_NUMBERINGSTARTVALUE OWN_ATTR_VALUE_START+3
+#define WID_PARAISNUMBERINGRESTART OWN_ATTR_VALUE_START+4
+
+#define SVX_UNOEDIT_NUMBERING_PROPERTIE \
+ {MAP_CHAR_LEN(UNO_NAME_NUMBERING_RULES), EE_PARA_NUMBULLET, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace>*)0), 0, 0 }, \
+ {MAP_CHAR_LEN(UNO_NAME_NUMBERING), EE_PARA_BULLETSTATE,&::getBooleanCppuType(), 0, 0 }
+
+#define SVX_UNOEDIT_OUTLINER_PROPERTIES \
+ SVX_UNOEDIT_NUMBERING_PROPERTIE, \
+ {MAP_CHAR_LEN(UNO_NAME_NUMBERING_LEVEL), WID_NUMLEVEL, &::getCppuType((const sal_Int16*)0), 0, 0 }, \
+ {MAP_CHAR_LEN("NumberingStartValue"), WID_NUMBERINGSTARTVALUE, &::getCppuType((const sal_Int16*)0), 0, 0 }, \
+ {MAP_CHAR_LEN("ParaIsNumberingRestart"), WID_PARAISNUMBERINGRESTART, &::getBooleanCppuType(), 0, 0 }
+
+#define SVX_UNOEDIT_CHAR_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_HEIGHT), EE_CHAR_FONTHEIGHT, &::getCppuType((const float*)0), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
+ { MAP_CHAR_LEN("CharScaleWidth"), EE_CHAR_FONTWIDTH, &::getCppuType((const sal_Int16*)0), 0, 0 }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTNAME), EE_CHAR_FONTINFO, &::getCppuType((const OUString*)0), 0, MID_FONT_FAMILY_NAME },\
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTSTYLENAME),EE_CHAR_FONTINFO, &::getCppuType((const OUString*)0), 0, MID_FONT_STYLE_NAME }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTFAMILY), EE_CHAR_FONTINFO, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_FAMILY }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTCHARSET), EE_CHAR_FONTINFO, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_CHAR_SET }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTPITCH), EE_CHAR_FONTINFO, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_PITCH }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_POSTURE), EE_CHAR_ITALIC, &::getCppuType((const ::com::sun::star::awt::FontSlant*)0),0, MID_POSTURE }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_WEIGHT), EE_CHAR_WEIGHT, &::getCppuType((const float*)0), 0, MID_WEIGHT }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_LOCALE), EE_CHAR_LANGUAGE, &::getCppuType((const ::com::sun::star::lang::Locale*)0),0, MID_LANG_LOCALE }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_COLOR), EE_CHAR_COLOR, &::getCppuType((const sal_Int32*)0), 0, 0 }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_ESCAPEMENT), EE_CHAR_ESCAPEMENT, &::getCppuType((const sal_Int16*)0), 0, MID_ESC }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_UNDERLINE), EE_CHAR_UNDERLINE, &::getCppuType((const sal_Int16*)0), 0, MID_TL_STYLE }, \
+ { MAP_CHAR_LEN("CharUnderlineColor"), EE_CHAR_UNDERLINE, &::getCppuType((const sal_Int32*)0), 0, MID_TL_COLOR }, \
+ { MAP_CHAR_LEN("CharUnderlineHasColor"), EE_CHAR_UNDERLINE, &::getBooleanCppuType(), 0, MID_TL_HASCOLOR } , \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_OVERLINE), EE_CHAR_OVERLINE, &::getCppuType((const sal_Int16*)0), 0, MID_TL_STYLE }, \
+ { MAP_CHAR_LEN("CharOverlineColor"), EE_CHAR_OVERLINE, &::getCppuType((const sal_Int32*)0), 0, MID_TL_COLOR }, \
+ { MAP_CHAR_LEN("CharOverlineHasColor"), EE_CHAR_OVERLINE, &::getBooleanCppuType(), 0, MID_TL_HASCOLOR } , \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_CROSSEDOUT), EE_CHAR_STRIKEOUT, &::getBooleanCppuType(), 0, MID_CROSSED_OUT }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_STRIKEOUT), EE_CHAR_STRIKEOUT, &::getCppuType((const sal_Int16*)0), 0, MID_CROSS_OUT}, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_SHADOWED), EE_CHAR_SHADOW, &::getBooleanCppuType(), 0, 0 }, \
+ { MAP_CHAR_LEN("CharContoured"), EE_CHAR_OUTLINE, &::getBooleanCppuType(), 0, 0 }, \
+ { MAP_CHAR_LEN("CharEscapementHeight"), EE_CHAR_ESCAPEMENT, &::getCppuType((const sal_Int8*)0), 0, MID_ESC_HEIGHT },\
+ { MAP_CHAR_LEN("CharAutoKerning"), EE_CHAR_PAIRKERNING,&::getBooleanCppuType(), 0, 0 } , \
+ { MAP_CHAR_LEN("CharKerning"), EE_CHAR_KERNING, &::getCppuType((const sal_Int16*)0) , 0, 0 }, \
+ { MAP_CHAR_LEN("CharWordMode"), EE_CHAR_WLM, &::getBooleanCppuType(), 0, 0 }, \
+ { MAP_CHAR_LEN("CharEmphasis"), EE_CHAR_EMPHASISMARK,&::getCppuType((const sal_Int16*)0), 0, MID_EMPHASIS},\
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_HEIGHT_ASIAN), EE_CHAR_FONTHEIGHT_CJK, &::getCppuType((const float*)0), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTNAME_ASIAN), EE_CHAR_FONTINFO_CJK, &::getCppuType((const OUString*)0), 0, MID_FONT_FAMILY_NAME },\
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTSTYLENAME_ASIAN), EE_CHAR_FONTINFO_CJK, &::getCppuType((const OUString*)0), 0, MID_FONT_STYLE_NAME }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTFAMILY_ASIAN), EE_CHAR_FONTINFO_CJK, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_FAMILY }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTCHARSET_ASIAN), EE_CHAR_FONTINFO_CJK, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_CHAR_SET }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTPITCH_ASIAN), EE_CHAR_FONTINFO_CJK, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_PITCH }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_POSTURE_ASIAN), EE_CHAR_ITALIC_CJK, &::getCppuType((const ::com::sun::star::awt::FontSlant*)0),0, MID_POSTURE }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_WEIGHT_ASIAN), EE_CHAR_WEIGHT_CJK, &::getCppuType((const float*)0), 0, MID_WEIGHT }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_LOCALE_ASIAN), EE_CHAR_LANGUAGE_CJK, &::getCppuType((const ::com::sun::star::lang::Locale*)0),0, MID_LANG_LOCALE }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_HEIGHT_COMPLEX), EE_CHAR_FONTHEIGHT_CTL, &::getCppuType((const float*)0), 0, MID_FONTHEIGHT|CONVERT_TWIPS }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTNAME_COMPLEX), EE_CHAR_FONTINFO_CTL, &::getCppuType((const OUString*)0), 0, MID_FONT_FAMILY_NAME },\
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTSTYLENAME_COMPLEX),EE_CHAR_FONTINFO_CTL, &::getCppuType((const OUString*)0), 0, MID_FONT_STYLE_NAME }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTFAMILY_COMPLEX), EE_CHAR_FONTINFO_CTL, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_FAMILY }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTCHARSET_COMPLEX), EE_CHAR_FONTINFO_CTL, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_CHAR_SET }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_FONTPITCH_COMPLEX), EE_CHAR_FONTINFO_CTL, &::getCppuType((const sal_Int16*)0), 0, MID_FONT_PITCH }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_POSTURE_COMPLEX), EE_CHAR_ITALIC_CTL, &::getCppuType((const ::com::sun::star::awt::FontSlant*)0),0, MID_POSTURE }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_WEIGHT_COMPLEX), EE_CHAR_WEIGHT_CTL, &::getCppuType((const float*)0), 0, MID_WEIGHT }, \
+ { MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_LOCALE_COMPLEX), EE_CHAR_LANGUAGE_CTL, &::getCppuType((const ::com::sun::star::lang::Locale*)0),0, MID_LANG_LOCALE }, \
+ { MAP_CHAR_LEN("CharRelief" ), EE_CHAR_RELIEF, &::getCppuType((const sal_Int16*)0), 0, MID_RELIEF }
+
+#define SVX_UNOEDIT_FONT_PROPERTIES \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_FONT_DESCRIPTOR), WID_FONTDESC, &::getCppuType((const ::com::sun::star::awt::FontDescriptor*)0), 0, MID_FONT_FAMILY_NAME }
+
+#define SVX_UNOEDIT_PARA_PROPERTIES \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_ADJUST), EE_PARA_JUST, &::getCppuType((const sal_Int16*)0), 0, MID_PARA_ADJUST }, \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_BMARGIN), EE_PARA_ULSPACE, &::getCppuType((const sal_Int32*)0), 0, MID_LO_MARGIN|SFX_METRIC_ITEM }, \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_IS_HYPHEN), EE_PARA_HYPHENATE, &::getBooleanCppuType(), 0, 0 }, \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_LASTLINEADJ), EE_PARA_JUST, &::getCppuType((const sal_Int16*)0), 0, MID_LAST_LINE_ADJUST }, \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_LMARGIN), EE_PARA_LRSPACE, &::getCppuType((const sal_Int32*)0), 0, MID_TXT_LMARGIN|SFX_METRIC_ITEM }, \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_LINESPACING), EE_PARA_SBL, &::getCppuType((const ::com::sun::star::style::LineSpacing*)0), 0, 0 }, \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_RMARGIN), EE_PARA_LRSPACE, &::getCppuType((const sal_Int32*)0), 0, MID_R_MARGIN|SFX_METRIC_ITEM }, \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_TAPSTOPS), EE_PARA_TABS, SEQTYPE(::getCppuType((const ::com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop >*)0)), 0, 0 }, \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_TMARGIN), EE_PARA_ULSPACE, &::getCppuType((const sal_Int32*)0), 0, MID_UP_MARGIN|SFX_METRIC_ITEM },\
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_FIRST_LINE_INDENT), EE_PARA_LRSPACE, &::getCppuType((const sal_Int32*)0), 0, MID_FIRST_LINE_INDENT|SFX_METRIC_ITEM}, \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_IS_HANGING_PUNCTUATION),EE_PARA_HANGINGPUNCTUATION, &::getBooleanCppuType(), 0 ,0 }, \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_IS_CHARACTER_DISTANCE), EE_PARA_ASIANCJKSPACING, &::getBooleanCppuType(), 0 ,0 }, \
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_IS_FORBIDDEN_RULES), EE_PARA_FORBIDDENRULES, &::getBooleanCppuType(), 0 ,0 },\
+ {MAP_CHAR_LEN("WritingMode"), EE_PARA_WRITINGDIR, &::getCppuType((const sal_Int16*)0), 0, 0 }
+
+class SvxEditSource;
+class SvxTextForwarder;
+class SvxFieldItem;
+class SvxTextEditSource;
+class SvxFieldData;
+struct ESelection;
+
+EDITENG_DLLPUBLIC void GetSelection( struct ESelection& rSel, SvxTextForwarder* pForwarder ) throw();
+EDITENG_DLLPUBLIC void CheckSelection( struct ESelection& rSel, SvxTextForwarder* pForwarder ) throw();
+
+// ====================================================================
+// This class implements a SvxEditSource and SvxTextForwarder and does
+// nothing otherwise
+// ====================================================================
+
+class SvxDummyTextSource : public SvxEditSource, public SvxTextForwarder
+{
+public:
+
+ // SvxEditSource
+ virtual ~SvxDummyTextSource();
+ virtual SvxEditSource* Clone() const;
+ virtual SvxTextForwarder* GetTextForwarder();
+ virtual void UpdateData();
+
+ // SvxTextForwarder
+ virtual sal_uInt16 GetParagraphCount() const;
+ virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
+ virtual String GetText( const ESelection& rSel ) const;
+ virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const;
+ virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
+ virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
+ virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
+ virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const;
+
+ sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
+ sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+
+ virtual SfxItemPool* GetPool() const;
+
+ virtual void QuickInsertText( const String& rText, const ESelection& rSel );
+ virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
+ virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
+ virtual void QuickInsertLineBreak( const ESelection& rSel );
+
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
+
+ virtual sal_Bool IsValid() const;
+
+ virtual void SetNotifyHdl( const Link& );
+ virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
+ virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
+ virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
+ virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
+ virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const;
+ virtual MapMode GetMapMode() const;
+ virtual OutputDevice* GetRefDevice() const;
+ virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
+ virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
+ virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_Bool Delete( const ESelection& );
+ virtual sal_Bool InsertText( const String&, const ESelection& );
+ virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
+ virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const;
+ virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth );
+
+ virtual const SfxItemSet* GetEmptyItemSetPtr();
+
+ // implementation functions for XParagraphAppend and XTextPortionAppend
+ virtual void AppendParagraph();
+ virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet );
+ //XTextCopy
+ virtual void CopyText(const SvxTextForwarder& rSource);
+};
+
+namespace accessibility
+{
+ class AccessibleEditableTextPara;
+}
+
+// ====================================================================
+class EDITENG_DLLPUBLIC SvxUnoTextRangeBase : public ::com::sun::star::text::XTextRange,
+ public ::com::sun::star::beans::XPropertySet,
+ public ::com::sun::star::beans::XMultiPropertySet,
+ public ::com::sun::star::beans::XMultiPropertyStates,
+ public ::com::sun::star::beans::XPropertyState,
+ public ::com::sun::star::lang::XServiceInfo,
+ public ::com::sun::star::text::XTextRangeCompare,
+ public ::com::sun::star::lang::XUnoTunnel,
+ private osl::DebugBase<SvxUnoTextRangeBase>
+
+{
+ friend class SvxUnoTextRangeEnumeration;
+ friend class ::accessibility::AccessibleEditableTextPara;
+
+protected:
+ SvxEditSource* mpEditSource;
+ ESelection maSelection;
+ const SvxItemPropertySet* mpPropSet;
+
+ virtual void SAL_CALL _setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL _getPropertyValue( const OUString& PropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL _setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues, sal_Int32 nPara = -1 ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL _getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, sal_Int32 nPara = -1 ) throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL _getPropertyState( const SfxItemPropertySimpleEntry* pMap, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL _getPropertyState( const OUString& PropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL _getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ // returns true if property found or false if unknown property
+ virtual sal_Bool _getOnePropertyStates(const SfxItemSet* pSet, const SfxItemPropertySimpleEntry* pMap, ::com::sun::star::beans::PropertyState& rState);
+
+ virtual void SAL_CALL _setPropertyToDefault( const OUString& PropertyName, sal_Int32 nPara = -1 ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void _setPropertyToDefault( SvxTextForwarder* pForwarder, const SfxItemPropertySimpleEntry* pMap, sal_Int32 nPara ) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException );
+ void SetEditSource( SvxEditSource* _pEditSource ) throw();
+
+ virtual void getPropertyValue( const SfxItemPropertySimpleEntry* pMap, com::sun::star::uno::Any& rAny, const SfxItemSet& rSet ) throw(::com::sun::star::beans::UnknownPropertyException );
+ virtual void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const com::sun::star::uno::Any& rValue, const ESelection& rSelection, const SfxItemSet& rOldSet, SfxItemSet& rNewSet ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::IllegalArgumentException );
+
+public:
+ SvxUnoTextRangeBase( const SvxItemPropertySet* _pSet ) throw();
+ SvxUnoTextRangeBase( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet ) throw();
+ SvxUnoTextRangeBase( const SvxUnoTextRangeBase& rRange ) throw();
+ virtual ~SvxUnoTextRangeBase() throw();
+
+ // Internal
+ const ESelection& GetSelection() const throw() { CheckSelection( ((SvxUnoTextRangeBase*)this)->maSelection, mpEditSource->GetTextForwarder() ); return maSelection; };
+ void SetSelection( const ESelection& rSelection ) throw();
+
+ virtual void CollapseToStart(void) throw();
+ virtual void CollapseToEnd(void) throw();
+ virtual sal_Bool IsCollapsed(void) throw();
+ virtual sal_Bool GoLeft(sal_Int16 nCount, sal_Bool Expand) throw();
+ virtual sal_Bool GoRight(sal_Int16 nCount, sal_Bool Expand) throw();
+ virtual void GotoStart(sal_Bool Expand) throw();
+ virtual void GotoEnd(sal_Bool Expand) throw();
+
+ //const SfxItemPropertyMapEntry* getPropertyMapEntries() const throw() { return maPropSet.getPropertyMapEntries(); }
+ const SvxItemPropertySet* getPropertySet() const throw() { return mpPropSet; }
+ SvxEditSource* GetEditSource() const throw() { return mpEditSource; }
+
+ static sal_Bool SetPropertyValueHelper( const SfxItemSet& rOldSet, const SfxItemPropertySimpleEntry* pMap, const ::com::sun::star::uno::Any& aValue, SfxItemSet& rNewSet, const ESelection* pSelection = NULL, SvxEditSource* pEditSource = NULL );
+ static sal_Bool GetPropertyValueHelper( SfxItemSet& rSet, const SfxItemPropertySimpleEntry* pMap, ::com::sun::star::uno::Any& aAny, const ESelection* pSelection = NULL, SvxEditSource* pEditSource = NULL ) throw( ::com::sun::star::uno::RuntimeException );
+
+ void attachField( const SvxFieldData* pData ) throw();
+
+ UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextRangeBase )
+
+ // ::com::sun::star::text::XTextRange
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd() throw(::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setString( const OUString& aString ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XMultiPropertySet
+ virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XPropertyState
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertyStates
+ //virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XTextRangeCompare
+ virtual ::sal_Int16 SAL_CALL compareRegionStarts( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR2 ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL compareRegionEnds( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR2 ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_Static( ) SAL_THROW(());
+};
+
+// ====================================================================
+
+class SvxUnoTextBase;
+class EDITENG_DLLPUBLIC SvxUnoTextRange : public SvxUnoTextRangeBase,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::cppu::OWeakAggObject
+{
+ friend class SvxUnoTextRangeEnumeration;
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText;
+ sal_Bool mbPortion;
+
+public:
+ SvxUnoTextRange( const SvxUnoTextBase& rParent, sal_Bool bPortion = sal_False ) throw();
+ virtual ~SvxUnoTextRange() throw();
+
+ // ::com::sun::star::uno::XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // ::com::sun::star::text::XTextRange
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+class EDITENG_DLLPUBLIC SvxUnoTextBase : public SvxUnoTextRangeBase,
+ public ::com::sun::star::text::XTextAppend,
+ public ::com::sun::star::text::XTextCopy,
+ public ::com::sun::star::container::XEnumerationAccess,
+ public ::com::sun::star::text::XTextRangeMover,
+ public ::com::sun::star::lang::XTypeProvider
+{
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText;
+
+public:
+ SvxUnoTextBase( ) throw();
+ SvxUnoTextBase( const SvxItemPropertySet* _pSet ) throw();
+ SvxUnoTextBase( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet, ::com::sun::star::uno::Reference < ::com::sun::star::text::XText > xParent ) throw();
+ SvxUnoTextBase( const SvxUnoTextBase& rText ) throw();
+ virtual ~SvxUnoTextBase() throw();
+
+ UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextBase )
+
+ ESelection InsertField( const SvxFieldItem& rField ) throw();
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getStaticTypes() throw();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createTextCursorBySelection( const ESelection& rSel );
+
+ // ::com::sun::star::uno::XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::text::XSimpleText
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& aTextPosition ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const OUString& aString, sal_Bool bAbsorb ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::text::XText
+ virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent, sal_Bool bAbsorb ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setString( const OUString& aString ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::text::XTextRange
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XEnumerationAccess
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::text::XTextRangeMover
+ virtual void SAL_CALL moveTextRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, sal_Int16 nParagraphs ) throw(::com::sun::star::uno::RuntimeException);
+
+ // com::sun::star::text::XParagraphAppend (new import API)
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL finishParagraph( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& CharacterAndParagraphProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL finishParagraphInsert( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& CharacterAndParagraphProperties, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xInsertPosition ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+
+ // com::sun::star::text::XTextPortionAppend (new import API)
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL appendTextPortion( const OUString& Text, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& CharacterAndParagraphProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL insertTextPortion( const OUString& Text, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& CharacterAndParagraphProperties, const com::sun::star::uno::Reference< com::sun::star::text::XTextRange>& rTextRange ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+
+ // com::sun::star::text::XTextCopy
+ virtual void SAL_CALL copyText( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCopy >& xSource ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_Static( ) SAL_THROW(());
+
+ // ::com::sun::star::lang::XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+// ====================================================================
+class EDITENG_DLLPUBLIC SvxUnoText : public SvxUnoTextBase,
+ public ::cppu::OWeakAggObject
+{
+public:
+ SvxUnoText( ) throw();
+ SvxUnoText( const SvxItemPropertySet* _pSet ) throw();
+ SvxUnoText( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet, ::com::sun::star::uno::Reference < ::com::sun::star::text::XText > xParent ) throw();
+ SvxUnoText( const SvxUnoText& rText ) throw();
+ virtual ~SvxUnoText() throw();
+
+ // Internal
+ static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::uno::XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // ::com::sun::star::lang::XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+// ====================================================================
+
+class SvxUnoTextContentEnumeration : public ::cppu::WeakAggImplHelper1< ::com::sun::star::container::XEnumeration >
+{
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
+ SvxEditSource* mpEditSource;
+ sal_uInt16 mnNextParagraph;
+ const SvxUnoTextBase& mrText;
+
+public:
+ SvxUnoTextContentEnumeration( const SvxUnoTextBase& _rText ) throw();
+ virtual ~SvxUnoTextContentEnumeration() throw();
+
+ // ::com::sun::star::container::XEnumeration
+ virtual sal_Bool SAL_CALL hasMoreElements( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL nextElement( ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+};
+
+// ====================================================================
+#include <com/sun/star/text/XTextContent.hpp>
+
+class SvxUnoTextContent : public SvxUnoTextRangeBase,
+ public ::com::sun::star::text::XTextContent,
+ public ::com::sun::star::container::XEnumerationAccess,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::cppu::OWeakAggObject
+{
+ friend class SvxUnoTextContentEnumeration;
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
+ sal_uInt16 mnParagraph;
+ const SvxUnoTextBase& mrParentText;
+
+ // for xComponent
+ ::osl::Mutex maDisposeContainerMutex;
+ ::cppu::OInterfaceContainerHelper maDisposeListeners;
+ bool mbDisposing;
+
+protected:
+ using SvxUnoTextRangeBase::setPropertyValue;
+ using SvxUnoTextRangeBase::getPropertyValue;
+
+public:
+ SvxUnoTextContent( const SvxUnoTextBase& rText, sal_uInt16 nPara ) throw();
+ SvxUnoTextContent( const SvxUnoTextContent& rContent ) throw();
+ virtual ~SvxUnoTextContent() throw();
+
+ // ::com::sun::star::uno::XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // ::com::sun::star::text::XTextRange
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::text::XTextContent -> ::com::sun::star::lang::XComponent
+ virtual void SAL_CALL attach( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xTextRange ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XEnumerationAccess
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XPropertySet
+ virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XMultiPropertySet
+ virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XPropertyState
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+// ====================================================================
+
+class SvxUnoTextRangeEnumeration : public ::cppu::WeakAggImplHelper1< ::com::sun::star::container::XEnumeration >
+{
+private:
+ SvxEditSource* mpEditSource;
+ ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
+ const SvxUnoTextBase& mrParentText;
+ sal_uInt16 mnParagraph;
+ std::vector<sal_uInt16>* mpPortions;
+ sal_uInt16 mnNextPortion;
+
+public:
+ SvxUnoTextRangeEnumeration( const SvxUnoTextBase& rText, sal_uInt16 nPara ) throw();
+ virtual ~SvxUnoTextRangeEnumeration() throw();
+
+ // ::com::sun::star::container::XEnumeration
+ virtual sal_Bool SAL_CALL hasMoreElements( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL nextElement( ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+};
+
+// ====================================================================
+
+class EDITENG_DLLPUBLIC SvxUnoTextCursor : public SvxUnoTextRangeBase,
+ public ::com::sun::star::text::XTextCursor,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::cppu::OWeakAggObject
+{
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
+
+public:
+ SvxUnoTextCursor( const SvxUnoTextBase& rText ) throw();
+ SvxUnoTextCursor( const SvxUnoTextCursor& rCursor ) throw();
+ virtual ~SvxUnoTextCursor() throw();
+
+ // ::com::sun::star::uno::XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // ::com::sun::star::text::XTextRange
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setString( const OUString& aString ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::text::XTextCursor -> ::com::sun::star::text::XTextRange
+ virtual void SAL_CALL collapseToStart( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL collapseToEnd( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isCollapsed( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL goLeft( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL goRight( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL gotoStart( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL gotoEnd( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL gotoRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+
+};
+
+EDITENG_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet();
+EDITENG_DLLPUBLIC const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap();
+EDITENG_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxTextPortionSvxPropertySet();
+EDITENG_DLLPUBLIC const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap();
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unoviwou.hxx b/include/editeng/unoviwou.hxx
new file mode 100644
index 000000000000..24031f93c847
--- /dev/null
+++ b/include/editeng/unoviwou.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 _SVX_UNOVIWOU_HXX
+#define _SVX_UNOVIWOU_HXX
+
+#include <editeng/unoedsrc.hxx>
+#include <editeng/editengdllapi.h>
+
+class OutlinerView;
+
+/// Specialization for Draw/Impress
+class EDITENG_DLLPUBLIC SvxDrawOutlinerViewForwarder : public SvxEditViewForwarder
+{
+private:
+ OutlinerView& mrOutlinerView;
+ Point maTextShapeTopLeft;
+
+ EDITENG_DLLPRIVATE Point GetTextOffset() const;
+
+public:
+ explicit SvxDrawOutlinerViewForwarder( OutlinerView& rOutl );
+ SvxDrawOutlinerViewForwarder( OutlinerView& rOutl, const Point& rShapePosTopLeft );
+ virtual ~SvxDrawOutlinerViewForwarder();
+
+ virtual sal_Bool IsValid() const;
+
+ virtual Rectangle GetVisArea() const;
+ virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const;
+ virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const;
+
+ virtual sal_Bool GetSelection( ESelection& rSelection ) const;
+ virtual sal_Bool SetSelection( const ESelection& rSelection );
+ virtual sal_Bool Copy();
+ virtual sal_Bool Cut();
+ virtual sal_Bool Paste();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/wghtitem.hxx b/include/editeng/wghtitem.hxx
new file mode 100644
index 000000000000..b10d74361dc8
--- /dev/null
+++ b/include/editeng/wghtitem.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 _SVX_WGHTITEM_HXX
+#define _SVX_WGHTITEM_HXX
+
+#include <vcl/vclenum.hxx>
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxWeightItem ---------------------------------------------------
+
+/* [Description]
+
+ This item describes the font weight.
+*/
+
+class EDITENG_DLLPUBLIC SvxWeightItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ SvxWeightItem( const FontWeight eWght /*= WEIGHT_NORMAL*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem + SfxEnumItem
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetValueCount() const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual int HasBoolValue() const;
+ virtual sal_Bool GetBoolValue() const;
+ virtual void SetBoolValue( sal_Bool bVal );
+
+ inline SvxWeightItem& operator=(const SvxWeightItem& rWeight) {
+ SetValue( rWeight.GetValue() );
+ return *this;
+ }
+
+ // enum cast
+ FontWeight GetWeight() const
+ { return (FontWeight)GetValue(); }
+ void SetWeight( FontWeight eNew )
+ { SetValue( (sal_uInt16)eNew ); }
+};
+
+#endif // #ifndef _SVX_WGHTITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/widwitem.hxx b/include/editeng/widwitem.hxx
new file mode 100644
index 000000000000..8602702a00f7
--- /dev/null
+++ b/include/editeng/widwitem.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 _SVX_WIDWITEM_HXX
+#define _SVX_WIDWITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxWidowsItem ---------------------------------------------------
+
+/* [Description]
+
+ This item describes the number of lines for the widows control.
+*/
+
+class EDITENG_DLLPUBLIC SvxWidowsItem: public SfxByteItem
+{
+ friend SvStream & operator<<( SvStream & aS, SvxWidowsItem & );
+public:
+ TYPEINFO();
+
+ SvxWidowsItem( const sal_uInt8 nL /*= 0*/, const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream &, sal_uInt16 ) const;
+ virtual SvStream& Store( SvStream & , sal_uInt16 nItemVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ inline SvxWidowsItem& operator=( const SvxWidowsItem& rWidows )
+ {
+ SetValue( rWidows.GetValue() );
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/writingmodeitem.hxx b/include/editeng/writingmodeitem.hxx
new file mode 100644
index 000000000000..c1ad81587f42
--- /dev/null
+++ b/include/editeng/writingmodeitem.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 _SVX_WRITINGMODEITEM_HXX
+#define _SVX_WRITINGMODEITEM_HXX
+
+#include <com/sun/star/text/WritingMode.hpp>
+#include <svl/intitem.hxx>
+#include "editeng/editengdllapi.h"
+
+// class SvxWritingModeItem ----------------------------------------------
+
+class EDITENG_DLLPUBLIC SvxWritingModeItem : public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+
+ SvxWritingModeItem( ::com::sun::star::text::WritingMode eValue /*= com::sun::star::text::WritingMode_LR_TB*/,
+ sal_uInt16 nWhich /*= SDRATTR_TEXTDIRECTION*/ );
+ virtual ~SvxWritingModeItem();
+
+ SvxWritingModeItem& operator=( const SvxWritingModeItem& rItem );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream & rStrm, sal_uInt16 nIVer) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+#endif // #ifndef _SVX_WRITINGMODEITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/wrlmitem.hxx b/include/editeng/wrlmitem.hxx
new file mode 100644
index 000000000000..b74b2f406a71
--- /dev/null
+++ b/include/editeng/wrlmitem.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 _SVX_WRLMITEM_HXX
+#define _SVX_WRLMITEM_HXX
+
+#include <svl/eitem.hxx>
+#include <editeng/editengdllapi.h>
+
+class SvXMLUnitConverter;
+
+// class SvxWordLineModeItem ---------------------------------------------
+
+/* [Description]
+
+ This item describes, whether underlined and strikethrough is limited
+ to word boundaries.
+*/
+
+class EDITENG_DLLPUBLIC SvxWordLineModeItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxWordLineModeItem( const sal_Bool bWordLineMode /*= sal_False*/,
+ const sal_uInt16 nId );
+
+ // "pure virtual Methods" from SfxPoolItem
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ inline SvxWordLineModeItem& operator=( const SvxWordLineModeItem& rWLM )
+ {
+ SetValue( rWLM.GetValue() );
+ return *this;
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/xmlcnitm.hxx b/include/editeng/xmlcnitm.hxx
new file mode 100644
index 000000000000..d361ab79c8d0
--- /dev/null
+++ b/include/editeng/xmlcnitm.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 _SVX_XMLCNITM_HXX
+#define _SVX_XMLCNITM_HXX
+
+#include <svl/poolitem.hxx>
+#include "editeng/editengdllapi.h"
+
+class SvXMLNamespaceMap;
+
+//============================================================================
+
+class SvXMLAttrContainerData;
+
+class EDITENG_DLLPUBLIC SvXMLAttrContainerItem: public SfxPoolItem
+{
+ SvXMLAttrContainerData *pImpl;
+
+public:
+ TYPEINFO();
+
+ SvXMLAttrContainerItem( sal_uInt16 nWhich = 0 );
+ SvXMLAttrContainerItem( const SvXMLAttrContainerItem& );
+ virtual ~SvXMLAttrContainerItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ using SfxPoolItem::Compare;
+ virtual int Compare( const SfxPoolItem &rWith ) const;
+
+ virtual SfxItemPresentation GetPresentation(
+ SfxItemPresentation ePresentation,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresentationMetric,
+ OUString &rText,
+ const IntlWrapper *pIntlWrapper = 0 ) const;
+
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxPoolItem *Clone( SfxItemPool * = 0) const
+ { return new SvXMLAttrContainerItem( *this ); }
+
+ sal_Bool AddAttr( const OUString& rLName,
+ const OUString& rValue );
+ sal_Bool AddAttr( const OUString& rPrefix,
+ const OUString& rNamespace,
+ const OUString& rLName,
+ const OUString& rValue );
+
+ sal_uInt16 GetAttrCount() const;
+ OUString GetAttrNamespace( sal_uInt16 i ) const;
+ OUString GetAttrPrefix( sal_uInt16 i ) const;
+ const OUString& GetAttrLName( sal_uInt16 i ) const;
+ const OUString& GetAttrValue( sal_uInt16 i ) const;
+
+ sal_uInt16 GetFirstNamespaceIndex() const;
+ sal_uInt16 GetNextNamespaceIndex( sal_uInt16 nIdx ) const;
+ const OUString& GetNamespace( sal_uInt16 i ) const;
+ const OUString& GetPrefix( sal_uInt16 i ) const;
+};
+
+#endif // _SVX_XMLCNITM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/dllapi.h b/include/filter/dllapi.h
new file mode 100644
index 000000000000..9b94621feedf
--- /dev/null
+++ b/include/filter/dllapi.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 _FILTER_DLLAPI_H
+#define _FILTER_DLLAPI_H
+
+#include "sal/config.h"
+#include "sal/types.h"
+
+#if defined FILTER_DLLIMPLEMENTATION
+#define FILTER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define FILTER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#if defined UNX && ! defined MACOS
+#define FILTER_PLUGIN_PUBLIC FILTER_DLLPUBLIC
+#else
+#define FILTER_PLUGIN_PUBLIC SAL_DLLPRIVATE
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/countryid.hxx b/include/filter/msfilter/countryid.hxx
new file mode 100644
index 000000000000..b70f649b05c3
--- /dev/null
+++ b/include/filter/msfilter/countryid.hxx
@@ -0,0 +1,311 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+// ============================================================================
+
+#ifndef INCLUDED_SVX_COUNTRYID_HXX
+#define INCLUDED_SVX_COUNTRYID_HXX
+
+#include <sal/types.h>
+#include <i18nlangtag/lang.h>
+#include "filter/msfilter/msfilterdllapi.h"
+
+// ----------------------------------------------------------------------------
+
+namespace msfilter {
+
+// Windows Country IDs ========================================================
+
+/** Represents a Windows country ID.
+
+ The country IDs used in Windows are equal to the international calling
+ code of each country, i.e. the code 353 represents Ireland (+353).
+
+ ATTENTION: These country codes are not supposed to be used anywhere in core
+ structures! They shall ONLY be used in the import/export filters for
+ Microsoft Office documents!
+ */
+typedef sal_uInt16 CountryId;
+
+const CountryId COUNTRY_DONTKNOW = 0;
+const CountryId COUNTRY_USA = 1;
+const CountryId COUNTRY_DOMINICAN_REPUBLIC = 1; // NANP
+const CountryId COUNTRY_GUAM = 1; // NANP
+const CountryId COUNTRY_JAMAICA = 1; // NANP
+const CountryId COUNTRY_PUERTO_RICO = 1; // NANP
+const CountryId COUNTRY_TRINIDAD_Y_TOBAGO = 1; // NANP
+const CountryId COUNTRY_CANADA = 2;
+const CountryId COUNTRY_RUSSIA = 7;
+const CountryId COUNTRY_KAZAKHSTAN = 7; // no own ID
+const CountryId COUNTRY_TATARSTAN = 7; // no own ID
+const CountryId COUNTRY_EGYPT = 20;
+const CountryId COUNTRY_SOUTH_AFRICA = 27;
+const CountryId COUNTRY_GREECE = 30;
+const CountryId COUNTRY_NETHERLANDS = 31;
+const CountryId COUNTRY_BELGIUM = 32;
+const CountryId COUNTRY_FRANCE = 33;
+const CountryId COUNTRY_SPAIN = 34;
+const CountryId COUNTRY_HUNGARY = 36;
+const CountryId COUNTRY_ITALY = 39;
+const CountryId COUNTRY_ROMANIA = 40;
+const CountryId COUNTRY_SWITZERLAND = 41;
+const CountryId COUNTRY_AUSTRIA = 43;
+const CountryId COUNTRY_UNITED_KINGDOM = 44;
+const CountryId COUNTRY_DENMARK = 45;
+const CountryId COUNTRY_SWEDEN = 46;
+const CountryId COUNTRY_NORWAY = 47;
+const CountryId COUNTRY_POLAND = 48;
+const CountryId COUNTRY_GERMANY = 49;
+const CountryId COUNTRY_PERU = 51;
+const CountryId COUNTRY_MEXICO = 52;
+const CountryId COUNTRY_CUBA = 53;
+const CountryId COUNTRY_ARGENTINIA = 54;
+const CountryId COUNTRY_BRAZIL = 55;
+const CountryId COUNTRY_CHILE = 56;
+const CountryId COUNTRY_COLOMBIA = 57;
+const CountryId COUNTRY_VENEZUELA = 58;
+const CountryId COUNTRY_MALAYSIA = 60;
+const CountryId COUNTRY_AUSTRALIA = 61;
+const CountryId COUNTRY_INDONESIA = 62;
+const CountryId COUNTRY_PHILIPPINES = 63;
+const CountryId COUNTRY_NEW_ZEALAND = 64;
+const CountryId COUNTRY_SINGAPORE = 65;
+const CountryId COUNTRY_THAILAND = 66;
+const CountryId COUNTRY_JAPAN = 81;
+const CountryId COUNTRY_SOUTH_KOREA = 82;
+const CountryId COUNTRY_VIET_NAM = 84;
+const CountryId COUNTRY_PR_CHINA = 86;
+const CountryId COUNTRY_TIBET = 86; // no own ID
+const CountryId COUNTRY_TURKEY = 90;
+const CountryId COUNTRY_INDIA = 91;
+const CountryId COUNTRY_PAKISTAN = 92;
+const CountryId COUNTRY_AFGHANISTAN = 93;
+const CountryId COUNTRY_SRI_LANKA = 94;
+const CountryId COUNTRY_MYANMAR = 95;
+const CountryId COUNTRY_MOROCCO = 212;
+const CountryId COUNTRY_ALGERIA = 213;
+const CountryId COUNTRY_TUNISIA = 216;
+const CountryId COUNTRY_LIBYA = 218;
+const CountryId COUNTRY_GAMBIA = 220;
+const CountryId COUNTRY_SENEGAL = 221;
+const CountryId COUNTRY_MAURITANIA = 222;
+const CountryId COUNTRY_MALI = 223;
+const CountryId COUNTRY_GUINEA = 224;
+const CountryId COUNTRY_COTE_D_IVOIRE = 225;
+const CountryId COUNTRY_BURKINA_FARSO = 226;
+const CountryId COUNTRY_NIGER = 227;
+const CountryId COUNTRY_TOGO = 228;
+const CountryId COUNTRY_BENIN = 229;
+const CountryId COUNTRY_MAURITIUS = 230;
+const CountryId COUNTRY_LIBERIA = 231;
+const CountryId COUNTRY_SIERRA_LEONE = 232;
+const CountryId COUNTRY_GHANA = 233;
+const CountryId COUNTRY_NIGERIA = 234;
+const CountryId COUNTRY_CHAD = 235;
+const CountryId COUNTRY_CENTRAL_AFR_REP = 236;
+const CountryId COUNTRY_CAMEROON = 237;
+const CountryId COUNTRY_CAPE_VERDE = 238;
+const CountryId COUNTRY_SAO_TOME = 239;
+const CountryId COUNTRY_EQUATORIAL_GUINEA = 240;
+const CountryId COUNTRY_GABON = 241;
+const CountryId COUNTRY_CONGO = 242;
+const CountryId COUNTRY_ZAIRE = 243;
+const CountryId COUNTRY_ANGOLA = 244;
+const CountryId COUNTRY_GUINEA_BISSAU = 245;
+const CountryId COUNTRY_DIEGO_GARCIA = 246;
+const CountryId COUNTRY_ASCENSION_ISLAND = 247;
+const CountryId COUNTRY_SEYCHELLES = 248;
+const CountryId COUNTRY_SUDAN = 249;
+const CountryId COUNTRY_RWANDA = 250;
+const CountryId COUNTRY_ETHIOPIA = 251;
+const CountryId COUNTRY_SOMALIA = 252;
+const CountryId COUNTRY_DJIBOUTI = 253;
+const CountryId COUNTRY_KENYA = 254;
+const CountryId COUNTRY_TANZANIA = 255;
+const CountryId COUNTRY_UGANDA = 256;
+const CountryId COUNTRY_BURUNDI = 257;
+const CountryId COUNTRY_MOZAMBIQUE = 258;
+const CountryId COUNTRY_ZANZIBAR = 259;
+const CountryId COUNTRY_ZAMBIA = 260;
+const CountryId COUNTRY_MADAGASKAR = 261;
+const CountryId COUNTRY_REUNION = 262;
+const CountryId COUNTRY_ZIMBABWE = 263;
+const CountryId COUNTRY_NAMIBIA = 264;
+const CountryId COUNTRY_MALAWI = 265;
+const CountryId COUNTRY_LESOTHO = 266;
+const CountryId COUNTRY_BOTSWANA = 267;
+const CountryId COUNTRY_SWAZILAND = 268;
+const CountryId COUNTRY_COMOROS_MAYOTTE = 269;
+const CountryId COUNTRY_ST_HELENA = 290;
+const CountryId COUNTRY_ERITREA = 291;
+const CountryId COUNTRY_ARUBA = 297;
+const CountryId COUNTRY_FAEROE_ISLANDS = 298;
+const CountryId COUNTRY_GREEN_ISLAND = 299;
+const CountryId COUNTRY_GIBRALTAR = 350;
+const CountryId COUNTRY_PORTUGAL = 351;
+const CountryId COUNTRY_LUXEMBOURG = 352;
+const CountryId COUNTRY_IRELAND = 353;
+const CountryId COUNTRY_ICELAND = 354;
+const CountryId COUNTRY_ALBANIA = 355;
+const CountryId COUNTRY_MALTA = 356;
+const CountryId COUNTRY_CYPRUS = 357;
+const CountryId COUNTRY_FINLAND = 358;
+const CountryId COUNTRY_BULGARIA = 359;
+const CountryId COUNTRY_LITHUANIA = 370;
+const CountryId COUNTRY_LATVIA = 371;
+const CountryId COUNTRY_ESTONIA = 372;
+const CountryId COUNTRY_MOLDOVA = 373;
+const CountryId COUNTRY_ARMENIA = 374;
+const CountryId COUNTRY_BELARUS = 375;
+const CountryId COUNTRY_ANDORRA = 376;
+const CountryId COUNTRY_MONACO = 377;
+const CountryId COUNTRY_SAN_MARINO = 378;
+const CountryId COUNTRY_VATICAN_CITY = 379;
+const CountryId COUNTRY_UKRAINE = 380;
+const CountryId COUNTRY_SERBIA = 381;
+const CountryId COUNTRY_CROATIA = 385;
+const CountryId COUNTRY_SLOVENIA = 386;
+const CountryId COUNTRY_BOSNIA = 387;
+const CountryId COUNTRY_MACEDONIA = 389;
+const CountryId COUNTRY_CZECH = 420;
+const CountryId COUNTRY_SLOVAK = 421;
+const CountryId COUNTRY_LIECHTENSTEIN = 423;
+const CountryId COUNTRY_FALKLAND_ISLANDS = 500;
+const CountryId COUNTRY_BELIZE = 501;
+const CountryId COUNTRY_GUATEMALA = 502;
+const CountryId COUNTRY_EL_SALVADOR = 503;
+const CountryId COUNTRY_HONDURAS = 504;
+const CountryId COUNTRY_NICARAGUA = 505;
+const CountryId COUNTRY_COSTA_RICA = 506;
+const CountryId COUNTRY_PANAMA = 507;
+const CountryId COUNTRY_ST_PIERRE = 508;
+const CountryId COUNTRY_HAITI = 509;
+const CountryId COUNTRY_GUADELOUPE = 590;
+const CountryId COUNTRY_BOLIVIA = 591;
+const CountryId COUNTRY_GUYANA = 592;
+const CountryId COUNTRY_ECUADOR = 593;
+const CountryId COUNTRY_FRENCH_GUIANA = 594;
+const CountryId COUNTRY_PARAGUAY = 595;
+const CountryId COUNTRY_MARTINIQUE = 596;
+const CountryId COUNTRY_SURINAME = 597;
+const CountryId COUNTRY_URUGUAY = 598;
+const CountryId COUNTRY_NETHERL_ANTILLES = 599;
+const CountryId COUNTRY_EAST_TIMOR = 670;
+const CountryId COUNTRY_ANTARCTICA = 672;
+const CountryId COUNTRY_BRUNEI_DARUSSALAM = 673;
+const CountryId COUNTRY_NARUPU = 674;
+const CountryId COUNTRY_PAPUA_NEW_GUINEA = 675;
+const CountryId COUNTRY_TONGA = 676;
+const CountryId COUNTRY_SOLOMON_ISLANDS = 677;
+const CountryId COUNTRY_VANUATU = 678;
+const CountryId COUNTRY_FIJI = 679;
+const CountryId COUNTRY_PALAU = 680;
+const CountryId COUNTRY_WALLIS_AND_FUTUNA = 681;
+const CountryId COUNTRY_COOK_ISLANDS = 682;
+const CountryId COUNTRY_NIUE_ISLAND = 683;
+const CountryId COUNTRY_AMERICAN_SAMOA = 684;
+const CountryId COUNTRY_WESTERN_SAMOA = 685;
+const CountryId COUNTRY_KIRIBATI = 686;
+const CountryId COUNTRY_NEW_CALEDONIA = 687;
+const CountryId COUNTRY_TUVALU = 688;
+const CountryId COUNTRY_FRENCH_POLYNESIA = 689;
+const CountryId COUNTRY_TOKELAU = 690;
+const CountryId COUNTRY_MICRONESIA = 691;
+const CountryId COUNTRY_MARSHALL_ISLANDS = 692;
+const CountryId COUNTRY_NORTH_KOREA = 850;
+const CountryId COUNTRY_HONG_KONG = 852;
+const CountryId COUNTRY_MACAU = 853;
+const CountryId COUNTRY_CAMBODIA = 855;
+const CountryId COUNTRY_LAOS = 856;
+const CountryId COUNTRY_BANGLADESH = 880;
+const CountryId COUNTRY_TAIWAN = 886;
+const CountryId COUNTRY_MALDIVES = 960;
+const CountryId COUNTRY_LEBANON = 961;
+const CountryId COUNTRY_JORDAN = 962;
+const CountryId COUNTRY_SYRIA = 963;
+const CountryId COUNTRY_IRAQ = 964;
+const CountryId COUNTRY_KUWAIT = 965;
+const CountryId COUNTRY_SAUDI_ARABIA = 966;
+const CountryId COUNTRY_YEMEN = 967;
+const CountryId COUNTRY_OMAN = 968;
+const CountryId COUNTRY_PALESTINE = 970;
+const CountryId COUNTRY_UAE = 971;
+const CountryId COUNTRY_ISRAEL = 972;
+const CountryId COUNTRY_BAHRAIN = 973;
+const CountryId COUNTRY_QATAR = 974;
+const CountryId COUNTRY_BHUTAN = 975;
+const CountryId COUNTRY_MONGOLIA = 976;
+const CountryId COUNTRY_NEPAL = 977;
+const CountryId COUNTRY_IRAN = 981;
+const CountryId COUNTRY_TAJIKISTAN = 992;
+const CountryId COUNTRY_TURKMENISTAN = 993;
+const CountryId COUNTRY_AZERBAIJAN = 994;
+const CountryId COUNTRY_GEORGIA = 995;
+const CountryId COUNTRY_KYRGYZSTAN = 996;
+const CountryId COUNTRY_UZBEKISTAN = 998;
+
+// Country ID <-> Language type conversion ====================================
+
+/** Converts a language type to a Windows country ID.
+
+ The function regards the sub type of the passed language, and tries to
+ return the appropriate country, i.e. COUNTRY_IRELAND for
+ LANGUAGE_ENGLISH_EIRE.
+
+ A few countries do not have an own associated country ID. Most of these
+ countries are mapped to another related country, i.e. Kazakhstan is
+ mapped to Russia.
+
+ If no country can be found, the value COUNTRY_DONTKNOW will be returned.
+
+ @param eLanguage
+ A language type, defined in tools/lang.hxx.
+
+ @return
+ The best Windows country ID for the passed language type, or
+ COUNTRY_DONTKNOW on error.
+ */
+MSFILTER_DLLPUBLIC CountryId ConvertLanguageToCountry( LanguageType eLanguage );
+
+/** Converts a Windows country ID to a language type.
+
+ The function returns the most used language for the passed country
+ (hopefully), i.e. LANGUAGE_ENGLISH_EIRE for COUNTRY_IRELAND.
+
+ If the passed country ID is not valid, the value LANGUAGE_DONTKNOW will be
+ returned.
+
+ @param eCountry
+ A Windows country ID, defined above.
+
+ @return
+ The most used language type in the passed country, or LANGUAGE_DONTKNOW
+ on error.
+ */
+MSFILTER_DLLPUBLIC LanguageType ConvertCountryToLanguage( CountryId eCountry );
+
+// ============================================================================
+
+} // namespace svx
+
+// ============================================================================
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/dffpropset.hxx b/include/filter/msfilter/dffpropset.hxx
new file mode 100644
index 000000000000..e4e9e90a5a6e
--- /dev/null
+++ b/include/filter/msfilter/dffpropset.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 _DFFPROPSET_HXX
+#define _DFFPROPSET_HXX
+
+#include <tools/solar.h>
+#include <filter/msfilter/msfilterdllapi.h>
+#include <filter/msfilter/dffrecordheader.hxx>
+#include <tools/stream.hxx>
+#include <vector>
+
+struct DffPropFlags
+{
+ sal_uInt8 bSet : 1;
+ sal_uInt8 bComplex : 1;
+ sal_uInt8 bBlip : 1;
+ sal_uInt8 bSoftAttr : 1;
+};
+
+struct DffPropSetEntry
+{
+ DffPropFlags aFlags;
+ sal_uInt16 nComplexIndexOrFlagsHAttr;
+ sal_uInt32 nContent;
+};
+
+class MSFILTER_DLLPUBLIC DffPropSet
+{
+ private:
+ DffPropSetEntry* mpPropSetEntries;
+ std::vector< sal_uInt32 > maOffsets;
+
+ void ReadPropSet( SvStream&, bool );
+
+ public:
+ explicit DffPropSet();
+ ~DffPropSet();
+
+ inline sal_Bool IsProperty( sal_uInt32 nRecType ) const { return ( mpPropSetEntries[ nRecType & 0x3ff ].aFlags.bSet ); };
+ sal_Bool IsHardAttribute( sal_uInt32 nId ) const;
+ sal_uInt32 GetPropertyValue( sal_uInt32 nId, sal_uInt32 nDefault = 0 ) const;
+ /** Returns a boolean property by its real identifier. */
+ bool GetPropertyBool( sal_uInt32 nId, bool bDefault = false ) const;
+ /** Returns a string property. */
+ OUString GetPropertyString( sal_uInt32 nId, SvStream& rStrm ) const;
+ sal_Bool SeekToContent( sal_uInt32 nRecType, SvStream& rSt ) const;
+ void InitializePropSet( sal_uInt16 nPropSetType ) const;
+
+ friend SvStream& operator>>( SvStream& rIn, DffPropSet& rPropSet );
+ friend SvStream& operator|=( SvStream& rIn, DffPropSet& rPropSet );
+};
+
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/dffrecordheader.hxx b/include/filter/msfilter/dffrecordheader.hxx
new file mode 100644
index 000000000000..ca2fcc368c46
--- /dev/null
+++ b/include/filter/msfilter/dffrecordheader.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 _DFFRECORDHEADER_HXX
+#define _DFFRECORDHEADER_HXX
+
+#include <tools/solar.h>
+#include <tools/stream.hxx>
+#include <filter/msfilter/msfilterdllapi.h>
+#include <svx/msdffdef.hxx>
+
+class MSFILTER_DLLPUBLIC DffRecordHeader
+{
+public:
+ sal_uInt8 nRecVer; // may be DFF_PSFLAG_CONTAINER
+ sal_uInt16 nRecInstance;
+ sal_uInt16 nImpVerInst;
+ sal_uInt16 nRecType;
+ sal_uInt32 nRecLen;
+ sal_uLong nFilePos;
+
+ DffRecordHeader() : nRecVer(0), nRecInstance(0), nImpVerInst(0),
+ nRecType(0), nRecLen(0), nFilePos(0) {}
+ bool IsContainer() const { return nRecVer == DFF_PSFLAG_CONTAINER; }
+ sal_uLong GetRecBegFilePos() const { return nFilePos; }
+ sal_uLong GetRecEndFilePos() const
+ { return nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen; }
+ bool SeekToEndOfRecord(SvStream& rIn) const
+ {
+ sal_Size nPos = nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen;
+ return nPos == rIn.Seek(nPos);
+ }
+ bool SeekToContent(SvStream& rIn) const
+ {
+ sal_Size nPos = nFilePos + DFF_COMMON_RECORD_HEADER_SIZE;
+ return nPos == rIn.Seek(nPos);
+ }
+ bool SeekToBegOfRecord(SvStream& rIn) const
+ {
+ return nFilePos == rIn.Seek(nFilePos);
+ }
+
+ MSFILTER_DLLPUBLIC friend SvStream& operator>>(SvStream& rIn, DffRecordHeader& rRec);
+};
+
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx
new file mode 100644
index 000000000000..b57d269d30b0
--- /dev/null
+++ b/include/filter/msfilter/escherex.hxx
@@ -0,0 +1,1721 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_ESCHEREX_HXX
+#define _SVX_ESCHEREX_HXX
+
+#include <memory>
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include <tools/solar.h>
+#include <tools/gen.hxx>
+#include <tools/stream.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include <svtools/grfmgr.hxx>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyState.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/drawing/BitmapMode.hpp>
+#include <com/sun/star/drawing/Hatch.hpp>
+#include <svx/msdffdef.hxx>
+#include "filter/msfilter/msfilterdllapi.h"
+
+ /*Record Name FBT-Value Instance Contents Wrd Exl PPt Ver*/
+// In the Microsoft documentation the naming scheme is msofbt... instead of ESCHER_...
+#define ESCHER_DggContainer 0xF000 /* per-document data X X X */
+#define ESCHER_Dgg 0xF006 /* an FDGG and several FIDCLs X X X 0 */
+#define ESCHER_CLSID 0xF016 /* the CLSID of the application that put the data on the clipboard C C C 0 */
+#define ESCHER_OPT 0xF00B /* count of properties the document-wide default shape properties X X X 3 */
+#define ESCHER_ColorMRU 0xF11A /* count of colors the colors in the MRU swatch X X X 0 */
+#define ESCHER_SplitMenuColors 0xF11E /* count of colors the colors in the top-level split menus X X X 0 */
+#define ESCHER_BstoreContainer 0xF001 /* count of BLIPs all images in the document (JPEGs, metafiles, etc.) X X X */
+#define ESCHER_BSE 0xF007 /* BLIP type an FBSE (one per BLIP) X X X 2 */
+#define ESCHER_BlipFirst 0xF018 /* range of fbts reserved for various kinds of BLIPs X X X */
+#define ESCHER_BlipLast 0xF117 /* range of fbts reserved for various kinds of BLIPs X X X */
+
+#define ESCHER_DgContainer 0xF002 /* per-sheet/page/slide data X X X */
+#define ESCHER_Dg 0xF008 /* drawing ID an FDG X X X 0 */
+#define ESCHER_RegroupItems 0xF118 /* count of regroup entries several FRITs X X X 0 */
+#define ESCHER_ColorScheme 0xF120 /* count of colors the colors of the source host's color scheme C C 0 */
+#define ESCHER_SpgrContainer 0xF003 /* several SpContainers, the first of which is the group shape itself X X X */
+#define ESCHER_SpContainer 0xF004 /* a shape X X X */
+#define ESCHER_Spgr 0xF009 /* an FSPGR; only present if the shape is a group shape X X X 1 */
+#define ESCHER_Sp 0xF00A /* shape type an FSP X X X 2 */
+//#define ESCHER_OPT 0xF00B /* count of properties a shape property table X X X 3 */
+#define ESCHER_Textbox 0xF00C /* RTF text C C C 0 */
+#define ESCHER_ClientTextbox 0xF00D /* host-defined the text in the textbox, in host-defined format X X X */
+#define ESCHER_Anchor 0xF00E /* a RECT, in 100000ths of an inch C C C 0 */
+#define ESCHER_ChildAnchor 0xF00F /* a RECT, in units relative to the parent group X X X 0 */
+#define ESCHER_ClientAnchor 0xF010 /* host-defined the location of the shape, in a host-defined format X X X */
+#define ESCHER_ClientData 0xF011 /* host-defined host-specific data X X X */
+#define ESCHER_OleObject 0xF11F /* a serialized IStorage for an OLE object C C C 0 */
+#define ESCHER_DeletedPspl 0xF11D /* an FPSPL; only present in top-level deleted shapes X 0 */
+#define ESCHER_SolverContainer 0xF005 /* count of rules the rules governing shapes X X X */
+#define ESCHER_ConnectorRule 0xF012 /* an FConnectorRule X X 1 */
+#define ESCHER_AlignRule 0xF013 /* an FAlignRule X X X 0 */
+#define ESCHER_ArcRule 0xF014 /* an FARCRU X X X 0 */
+#define ESCHER_ClientRule 0xF015 /* host-defined host-defined */
+#define ESCHER_CalloutRule 0xF017 /* an FCORU X X X 0 */
+#define ESCHER_Selection 0xF119 /* an FDGSL followed by the SPIDs of the shapes in the selection X 0 */
+#define ESCHER_UDefProp 0xF122
+
+#define SHAPEFLAG_GROUP 0x001 /* This shape is a group shape */
+#define SHAPEFLAG_CHILD 0x002 /* Not a top-level shape */
+#define SHAPEFLAG_PATRIARCH 0x004 /* This is the topmost group shape. Exactly one of these per drawing. */
+#define SHAPEFLAG_DELETED 0x008 /* The shape has been deleted */
+#define SHAPEFLAG_OLESHAPE 0x010 /* The shape is an OLE object */
+#define SHAPEFLAG_HAVEMASTER 0x020 /* Shape has a hspMaster property */
+#define SHAPEFLAG_FLIPH 0x040 /* Shape is flipped horizontally */
+#define SHAPEFLAG_FLIPV 0x080 /* Shape is flipped vertically */
+#define SHAPEFLAG_CONNECTOR 0x100 /* Connector type of shape */
+#define SHAPEFLAG_HAVEANCHOR 0x200 /* Shape has an anchor of some kind */
+#define SHAPEFLAG_BACKGROUND 0x400 /* Background shape */
+#define SHAPEFLAG_HAVESPT 0x800 /* Shape has a shape type property */
+
+#define ESCHER_ShpInst_Min 0
+#define ESCHER_ShpInst_NotPrimitive ESCHER_ShpInst_Min
+#define ESCHER_ShpInst_Rectangle 1
+#define ESCHER_ShpInst_RoundRectangle 2
+#define ESCHER_ShpInst_Ellipse 3
+#define ESCHER_ShpInst_Diamond 4
+#define ESCHER_ShpInst_IsocelesTriangle 5
+#define ESCHER_ShpInst_RightTriangle 6
+#define ESCHER_ShpInst_Parallelogram 7
+#define ESCHER_ShpInst_Trapezoid 8
+#define ESCHER_ShpInst_Hexagon 9
+#define ESCHER_ShpInst_Octagon 10
+#define ESCHER_ShpInst_Plus 11
+#define ESCHER_ShpInst_Star 12
+#define ESCHER_ShpInst_Arrow 13
+#define ESCHER_ShpInst_ThickArrow 14
+#define ESCHER_ShpInst_HomePlate 15
+#define ESCHER_ShpInst_Cube 16
+#define ESCHER_ShpInst_Balloon 17
+#define ESCHER_ShpInst_Seal 18
+#define ESCHER_ShpInst_Arc 19
+#define ESCHER_ShpInst_Line 20
+#define ESCHER_ShpInst_Plaque 21
+#define ESCHER_ShpInst_Can 22
+#define ESCHER_ShpInst_Donut 23
+#define ESCHER_ShpInst_TextSimple 24
+#define ESCHER_ShpInst_TextOctagon 25
+#define ESCHER_ShpInst_TextHexagon 26
+#define ESCHER_ShpInst_TextCurve 27
+#define ESCHER_ShpInst_TextWave 28
+#define ESCHER_ShpInst_TextRing 29
+#define ESCHER_ShpInst_TextOnCurve 30
+#define ESCHER_ShpInst_TextOnRing 31
+#define ESCHER_ShpInst_StraightConnector1 32
+#define ESCHER_ShpInst_BentConnector2 33
+#define ESCHER_ShpInst_BentConnector3 34
+#define ESCHER_ShpInst_BentConnector4 35
+#define ESCHER_ShpInst_BentConnector5 36
+#define ESCHER_ShpInst_CurvedConnector2 37
+#define ESCHER_ShpInst_CurvedConnector3 38
+#define ESCHER_ShpInst_CurvedConnector4 39
+#define ESCHER_ShpInst_CurvedConnector5 40
+#define ESCHER_ShpInst_Callout1 41
+#define ESCHER_ShpInst_Callout2 42
+#define ESCHER_ShpInst_Callout3 43
+#define ESCHER_ShpInst_AccentCallout1 44
+#define ESCHER_ShpInst_AccentCallout2 45
+#define ESCHER_ShpInst_AccentCallout3 46
+#define ESCHER_ShpInst_BorderCallout1 47
+#define ESCHER_ShpInst_BorderCallout2 48
+#define ESCHER_ShpInst_BorderCallout3 49
+#define ESCHER_ShpInst_AccentBorderCallout1 50
+#define ESCHER_ShpInst_AccentBorderCallout2 51
+#define ESCHER_ShpInst_AccentBorderCallout3 52
+#define ESCHER_ShpInst_Ribbon 53
+#define ESCHER_ShpInst_Ribbon2 54
+#define ESCHER_ShpInst_Chevron 55
+#define ESCHER_ShpInst_Pentagon 56
+#define ESCHER_ShpInst_NoSmoking 57
+#define ESCHER_ShpInst_Seal8 58
+#define ESCHER_ShpInst_Seal16 59
+#define ESCHER_ShpInst_Seal32 60
+#define ESCHER_ShpInst_WedgeRectCallout 61
+#define ESCHER_ShpInst_WedgeRRectCallout 62
+#define ESCHER_ShpInst_WedgeEllipseCallout 63
+#define ESCHER_ShpInst_Wave 64
+#define ESCHER_ShpInst_FoldedCorner 65
+#define ESCHER_ShpInst_LeftArrow 66
+#define ESCHER_ShpInst_DownArrow 67
+#define ESCHER_ShpInst_UpArrow 68
+#define ESCHER_ShpInst_LeftRightArrow 69
+#define ESCHER_ShpInst_UpDownArrow 70
+#define ESCHER_ShpInst_IrregularSeal1 71
+#define ESCHER_ShpInst_IrregularSeal2 72
+#define ESCHER_ShpInst_LightningBolt 73
+#define ESCHER_ShpInst_Heart 74
+#define ESCHER_ShpInst_PictureFrame 75
+#define ESCHER_ShpInst_QuadArrow 76
+#define ESCHER_ShpInst_LeftArrowCallout 77
+#define ESCHER_ShpInst_RightArrowCallout 78
+#define ESCHER_ShpInst_UpArrowCallout 79
+#define ESCHER_ShpInst_DownArrowCallout 80
+#define ESCHER_ShpInst_LeftRightArrowCallout 81
+#define ESCHER_ShpInst_UpDownArrowCallout 82
+#define ESCHER_ShpInst_QuadArrowCallout 83
+#define ESCHER_ShpInst_Bevel 84
+#define ESCHER_ShpInst_LeftBracket 85
+#define ESCHER_ShpInst_RightBracket 86
+#define ESCHER_ShpInst_LeftBrace 87
+#define ESCHER_ShpInst_RightBrace 88
+#define ESCHER_ShpInst_LeftUpArrow 89
+#define ESCHER_ShpInst_BentUpArrow 90
+#define ESCHER_ShpInst_BentArrow 91
+#define ESCHER_ShpInst_Seal24 92
+#define ESCHER_ShpInst_StripedRightArrow 93
+#define ESCHER_ShpInst_NotchedRightArrow 94
+#define ESCHER_ShpInst_BlockArc 95
+#define ESCHER_ShpInst_SmileyFace 96
+#define ESCHER_ShpInst_VerticalScroll 97
+#define ESCHER_ShpInst_HorizontalScroll 98
+#define ESCHER_ShpInst_CircularArrow 99
+#define ESCHER_ShpInst_NotchedCircularArrow 100
+#define ESCHER_ShpInst_UturnArrow 101
+#define ESCHER_ShpInst_CurvedRightArrow 102
+#define ESCHER_ShpInst_CurvedLeftArrow 103
+#define ESCHER_ShpInst_CurvedUpArrow 104
+#define ESCHER_ShpInst_CurvedDownArrow 105
+#define ESCHER_ShpInst_CloudCallout 106
+#define ESCHER_ShpInst_EllipseRibbon 107
+#define ESCHER_ShpInst_EllipseRibbon2 108
+#define ESCHER_ShpInst_FlowChartProcess 109
+#define ESCHER_ShpInst_FlowChartDecision 110
+#define ESCHER_ShpInst_FlowChartInputOutput 111
+#define ESCHER_ShpInst_FlowChartPredefinedProcess 112
+#define ESCHER_ShpInst_FlowChartInternalStorage 113
+#define ESCHER_ShpInst_FlowChartDocument 114
+#define ESCHER_ShpInst_FlowChartMultidocument 115
+#define ESCHER_ShpInst_FlowChartTerminator 116
+#define ESCHER_ShpInst_FlowChartPreparation 117
+#define ESCHER_ShpInst_FlowChartManualInput 118
+#define ESCHER_ShpInst_FlowChartManualOperation 119
+#define ESCHER_ShpInst_FlowChartConnector 120
+#define ESCHER_ShpInst_FlowChartPunchedCard 121
+#define ESCHER_ShpInst_FlowChartPunchedTape 122
+#define ESCHER_ShpInst_FlowChartSummingJunction 123
+#define ESCHER_ShpInst_FlowChartOr 124
+#define ESCHER_ShpInst_FlowChartCollate 125
+#define ESCHER_ShpInst_FlowChartSort 126
+#define ESCHER_ShpInst_FlowChartExtract 127
+#define ESCHER_ShpInst_FlowChartMerge 128
+#define ESCHER_ShpInst_FlowChartOfflineStorage 129
+#define ESCHER_ShpInst_FlowChartOnlineStorage 130
+#define ESCHER_ShpInst_FlowChartMagneticTape 131
+#define ESCHER_ShpInst_FlowChartMagneticDisk 132
+#define ESCHER_ShpInst_FlowChartMagneticDrum 133
+#define ESCHER_ShpInst_FlowChartDisplay 134
+#define ESCHER_ShpInst_FlowChartDelay 135
+#define ESCHER_ShpInst_TextPlainText 136
+#define ESCHER_ShpInst_TextStop 137
+#define ESCHER_ShpInst_TextTriangle 138
+#define ESCHER_ShpInst_TextTriangleInverted 139
+#define ESCHER_ShpInst_TextChevron 140
+#define ESCHER_ShpInst_TextChevronInverted 141
+#define ESCHER_ShpInst_TextRingInside 142
+#define ESCHER_ShpInst_TextRingOutside 143
+#define ESCHER_ShpInst_TextArchUpCurve 144
+#define ESCHER_ShpInst_TextArchDownCurve 145
+#define ESCHER_ShpInst_TextCircleCurve 146
+#define ESCHER_ShpInst_TextButtonCurve 147
+#define ESCHER_ShpInst_TextArchUpPour 148
+#define ESCHER_ShpInst_TextArchDownPour 149
+#define ESCHER_ShpInst_TextCirclePour 150
+#define ESCHER_ShpInst_TextButtonPour 151
+#define ESCHER_ShpInst_TextCurveUp 152
+#define ESCHER_ShpInst_TextCurveDown 153
+#define ESCHER_ShpInst_TextCascadeUp 154
+#define ESCHER_ShpInst_TextCascadeDown 155
+#define ESCHER_ShpInst_TextWave1 156
+#define ESCHER_ShpInst_TextWave2 157
+#define ESCHER_ShpInst_TextWave3 158
+#define ESCHER_ShpInst_TextWave4 159
+#define ESCHER_ShpInst_TextInflate 160
+#define ESCHER_ShpInst_TextDeflate 161
+#define ESCHER_ShpInst_TextInflateBottom 162
+#define ESCHER_ShpInst_TextDeflateBottom 163
+#define ESCHER_ShpInst_TextInflateTop 164
+#define ESCHER_ShpInst_TextDeflateTop 165
+#define ESCHER_ShpInst_TextDeflateInflate 166
+#define ESCHER_ShpInst_TextDeflateInflateDeflate 167
+#define ESCHER_ShpInst_TextFadeRight 168
+#define ESCHER_ShpInst_TextFadeLeft 169
+#define ESCHER_ShpInst_TextFadeUp 170
+#define ESCHER_ShpInst_TextFadeDown 171
+#define ESCHER_ShpInst_TextSlantUp 172
+#define ESCHER_ShpInst_TextSlantDown 173
+#define ESCHER_ShpInst_TextCanUp 174
+#define ESCHER_ShpInst_TextCanDown 175
+#define ESCHER_ShpInst_FlowChartAlternateProcess 176
+#define ESCHER_ShpInst_FlowChartOffpageConnector 177
+#define ESCHER_ShpInst_Callout90 178
+#define ESCHER_ShpInst_AccentCallout90 179
+#define ESCHER_ShpInst_BorderCallout90 180
+#define ESCHER_ShpInst_AccentBorderCallout90 181
+#define ESCHER_ShpInst_LeftRightUpArrow 182
+#define ESCHER_ShpInst_Sun 183
+#define ESCHER_ShpInst_Moon 184
+#define ESCHER_ShpInst_BracketPair 185
+#define ESCHER_ShpInst_BracePair 186
+#define ESCHER_ShpInst_Seal4 187
+#define ESCHER_ShpInst_DoubleWave 188
+#define ESCHER_ShpInst_ActionButtonBlank 189
+#define ESCHER_ShpInst_ActionButtonHome 190
+#define ESCHER_ShpInst_ActionButtonHelp 191
+#define ESCHER_ShpInst_ActionButtonInformation 192
+#define ESCHER_ShpInst_ActionButtonForwardNext 193
+#define ESCHER_ShpInst_ActionButtonBackPrevious 194
+#define ESCHER_ShpInst_ActionButtonEnd 195
+#define ESCHER_ShpInst_ActionButtonBeginning 196
+#define ESCHER_ShpInst_ActionButtonReturn 197
+#define ESCHER_ShpInst_ActionButtonDocument 198
+#define ESCHER_ShpInst_ActionButtonSound 199
+#define ESCHER_ShpInst_ActionButtonMovie 200
+#define ESCHER_ShpInst_HostControl 201
+#define ESCHER_ShpInst_TextBox 202
+#define ESCHER_ShpInst_COUNT 203
+#define ESCHER_ShpInst_Max 0x0FFF
+#define ESCHER_ShpInst_Nil ESCHER_ShpInst_Max
+
+enum ESCHER_BlibType
+{ // GEL provided types...
+ ERROR = 0, // An error occurred during loading
+ UNKNOWN, // An unknown blip type
+ EMF, // Windows Enhanced Metafile
+ WMF, // Windows Metafile
+ PICT, // Macintosh PICT
+ PEG, // JFIF
+ PNG, // PNG
+ DIB, // Windows DIB
+ FirstClient = 32, // First client defined blip type
+ LastClient = 255 // Last client defined blip type
+};
+
+enum ESCHER_FillStyle
+{
+ ESCHER_FillSolid, // Fill with a solid color
+ ESCHER_FillPattern, // Fill with a pattern (bitmap)
+ ESCHER_FillTexture, // A texture (pattern with its own color map)
+ ESCHER_FillPicture, // Center a picture in the shape
+ ESCHER_FillShade, // Shade from start to end points
+ ESCHER_FillShadeCenter, // Shade from bounding rectangle to end point
+ ESCHER_FillShadeShape, // Shade from shape outline to end point
+ ESCHER_FillShadeScale,
+ ESCHER_FillShadeTitle,
+ ESCHER_FillBackground
+};
+
+enum ESCHER_wMode
+{
+ ESCHER_wColor, // only used for predefined shades
+ ESCHER_wAutomatic, // depends on object type
+ ESCHER_wGrayScale, // shades of gray only
+ ESCHER_wLightGrayScale, // shades of light gray only
+ ESCHER_wInverseGray, // dark gray mapped to light gray, etc.
+ ESCHER_wGrayOutline, // pure gray and white
+ ESCHER_wBlackTextLine, // black text and lines, all else grayscale
+ ESCHER_wHighContrast, // pure black and white mode (no grays)
+ ESCHER_wBlack, // solid black msobwWhite, // solid white
+ ESCHER_wDontShow, // object not drawn
+ ESCHER_wNumModes // number of Black and white modes
+};
+
+
+//
+enum ESCHER_ShapePath
+{
+ ESCHER_ShapeLines, // A line of straight segments
+ ESCHER_ShapeLinesClosed, // A closed polygonal object
+ ESCHER_ShapeCurves, // A line of Bezier curve segments
+ ESCHER_ShapeCurvesClosed, // A closed shape with curved edges
+ ESCHER_ShapeComplex // pSegmentInfo must be non-empty
+};
+
+
+enum ESCHER_WrapMode
+{
+ ESCHER_WrapSquare,
+ ESCHER_WrapByPoints,
+ ESCHER_WrapNone,
+ ESCHER_WrapTopBottom,
+ ESCHER_WrapThrough
+};
+
+//
+enum ESCHER_bwMode
+{
+ ESCHER_bwColor, // only used for predefined shades
+ ESCHER_bwAutomatic, // depends on object type
+ ESCHER_bwGrayScale, // shades of gray only
+ ESCHER_bwLightGrayScale, // shades of light gray only
+ ESCHER_bwInverseGray, // dark gray mapped to light gray, etc.
+ ESCHER_bwGrayOutline, // pure gray and white
+ ESCHER_bwBlackTextLine, // black text and lines, all else grayscale
+ ESCHER_bwHighContrast, // pure black and white mode (no grays)
+ ESCHER_bwBlack, // solid black
+ ESCHER_bwWhite, // solid white
+ ESCHER_bwDontShow, // object not drawn
+ ESCHER_bwNumModes // number of Black and white modes
+};
+
+
+enum ESCHER_AnchorText
+{
+ ESCHER_AnchorTop,
+ ESCHER_AnchorMiddle,
+ ESCHER_AnchorBottom,
+ ESCHER_AnchorTopCentered,
+ ESCHER_AnchorMiddleCentered,
+ ESCHER_AnchorBottomCentered,
+ ESCHER_AnchorTopBaseline,
+ ESCHER_AnchorBottomBaseline,
+ ESCHER_AnchorTopCenteredBaseline,
+ ESCHER_AnchorBottomCenteredBaseline
+};
+
+enum ESCHER_cDir
+{
+ ESCHER_cDir0, // Right
+ ESCHER_cDir90, // Down
+ ESCHER_cDir180, // Left
+ ESCHER_cDir270 // Up
+};
+
+// connector style
+enum ESCHER_cxSTYLE
+{
+ ESCHER_cxstyleStraight = 0,
+ ESCHER_cxstyleBent,
+ ESCHER_cxstyleCurved,
+ ESCHER_cxstyleNone
+};
+
+// text flow
+enum ESCHER_txfl
+{
+ ESCHER_txflHorzN, // Horizontal non-@
+ ESCHER_txflTtoBA, // Top to Bottom @-font
+ ESCHER_txflBtoT, // Bottom to Top non-@
+ ESCHER_txflTtoBN, // Top to Bottom non-@
+ ESCHER_txflHorzA, // Horizontal @-font
+ ESCHER_txflVertN // Vertical, non-@
+};
+
+// text direction (needed for Bi-Di support)
+enum ESCHER_txDir
+{
+ ESCHER_txdirLTR, // left-to-right text direction
+ ESCHER_txdirRTL, // right-to-left text direction
+ ESCHER_txdirContext // context text direction
+};
+
+// Callout Type
+enum ESCHER_spcot
+{
+ ESCHER_spcotRightAngle = 1,
+ ESCHER_spcotOneSegment = 2,
+ ESCHER_spcotTwoSegment = 3,
+ ESCHER_spcotThreeSegment= 4
+};
+
+// Callout Angle
+enum ESCHER_spcoa
+{
+ ESCHER_spcoaAny,
+ ESCHER_spcoa30,
+ ESCHER_spcoa45,
+ ESCHER_spcoa60,
+ ESCHER_spcoa90,
+ ESCHER_spcoa0
+};
+
+// Callout Drop
+enum ESCHER_spcod
+{
+ ESCHER_spcodTop,
+ ESCHER_spcodCenter,
+ ESCHER_spcodBottom,
+ ESCHER_spcodSpecified
+};
+
+// FontWork alignment
+enum ESCHER_GeoTextAlign
+{
+ ESCHER_AlignTextStretch, // Stretch each line of text to fit width.
+ ESCHER_AlignTextCenter, // Center text on width.
+ ESCHER_AlignTextLeft, // Left justify.
+ ESCHER_AlignTextRight, // Right justify.
+ ESCHER_AlignTextLetterJust, // Spread letters out to fit width.
+ ESCHER_AlignTextWordJust, // Spread words out to fit width.
+ ESCHER_AlignTextInvalid // Invalid
+};
+
+// flags for pictures
+enum ESCHER_BlipFlags
+{
+ ESCHER_BlipFlagDefault = 0,
+ ESCHER_BlipFlagComment = 0, // Blip name is a comment
+ ESCHER_BlipFlagFile, // Blip name is a file name
+ ESCHER_BlipFlagURL, // Blip name is a full URL
+ ESCHER_BlipFlagType = 3, // Mask to extract type
+ /* Or the following flags with any of the above. */
+ ESCHER_BlipFlagDoNotSave = 4,
+ ESCHER_BlipFlagLinkToFile = 8
+};
+
+//
+enum ESCHER_3DRenderMode
+{
+ ESCHER_FullRender, // Generate a full rendering
+ ESCHER_Wireframe, // Generate a wireframe
+ ESCHER_BoundingCube // Generate a bounding cube
+};
+
+//
+enum ESCHER_xFormType
+{
+ ESCHER_xFormAbsolute, // Apply transform in absolute space centered on shape
+ ESCHER_xFormShape, // Apply transform to shape geometry
+ ESCHER_xFormDrawing // Apply transform in drawing space
+};
+
+//
+enum ESCHER_ShadowType
+{
+ ESCHER_ShadowOffset, // N pixel offset shadow
+ ESCHER_ShadowDouble, // Use second offset too
+ ESCHER_ShadowRich, // Rich perspective shadow (cast relative to shape)
+ ESCHER_ShadowShape, // Rich perspective shadow (cast in shape space)
+ ESCHER_ShadowDrawing, // Perspective shadow cast in drawing space
+ ESCHER_ShadowEmbossOrEngrave
+};
+
+// - the type of a (length) measurement
+enum ESCHER_dzType
+ {
+ ESCHER_dzTypeMin = 0,
+ ESCHER_dzTypeDefault = 0, // Default size, ignore the values
+ ESCHER_dzTypeA = 1, // Values are in EMUs
+ ESCHER_dzTypeV = 2, // Values are in pixels
+ ESCHER_dzTypeShape = 3, // Values are 16.16 fractions of shape size
+ ESCHER_dzTypeFixedAspect = 4, // Aspect ratio is fixed
+ ESCHER_dzTypeAFixed = 5, // EMUs, fixed aspect ratio
+ ESCHER_dzTypeVFixed = 6, // Pixels, fixed aspect ratio
+ ESCHER_dzTypeShapeFixed = 7, // Proportion of shape, fixed aspect ratio
+ ESCHER_dzTypeFixedAspectEnlarge= 8, // Aspect ratio is fixed, favor larger size
+ ESCHER_dzTypeAFixedBig = 9, // EMUs, fixed aspect ratio
+ ESCHER_dzTypeVFixedBig = 10, // Pixels, fixed aspect ratio
+ ESCHER_dzTypeShapeFixedBig= 11, // Proportion of shape, fixed aspect ratio
+ ESCHER_dzTypeMax = 11
+};
+
+// how to interpret the colors in a shaded fill.
+enum ESCHER_ShadeType
+{
+ ESCHER_ShadeNone = 0, // Interpolate without correction between RGBs
+ ESCHER_ShadeGamma = 1, // Apply gamma correction to colors
+ ESCHER_ShadeSigma = 2, // Apply a sigma transfer function to position
+ ESCHER_ShadeBand = 4, // Add a flat band at the start of the shade
+ ESCHER_ShadeOneColor = 8, // This is a one color shade
+
+ /* A parameter for the band or sigma function can be stored in the top
+ 16 bits of the value - this is a proportion of *each* band of the
+ shade to make flat (or the approximate equal value for a sigma
+ function). NOTE: the parameter is not used for the sigma function,
+ instead a built in value is used. This value should not be changed
+ from the default! */
+ ESCHER_ShadeParameterShift = 16,
+ ESCHER_ShadeParameterMask = 0xffff0000,
+
+ ESCHER_ShadeDefault = (ESCHER_ShadeGamma|ESCHER_ShadeSigma|
+ (16384<<ESCHER_ShadeParameterShift))
+};
+
+// compound line style
+enum ESCHER_LineStyle
+{
+ ESCHER_LineSimple, // Single line (of width lineWidth)
+ ESCHER_LineDouble, // Double lines of equal width
+ ESCHER_LineThickThin, // Double lines, one thick, one thin
+ ESCHER_LineThinThick, // Double lines, reverse order
+ ESCHER_LineTriple // Three lines, thin, thick, thin
+};
+
+// how to "fill" the line contour
+enum ESCHER_LineType
+{
+ ESCHER_lineSolidType, // Fill with a solid color
+ ESCHER_linePattern, // Fill with a pattern (bitmap)
+ ESCHER_lineTexture, // A texture (pattern with its own color map)
+ ESCHER_linePicture // Center a picture in the shape
+};
+
+// dashed line style
+enum ESCHER_LineDashing
+{
+ ESCHER_LineSolid, // Solid (continuous) pen
+ ESCHER_LineDashSys, // PS_DASH system dash style
+ ESCHER_LineDotSys, // PS_DOT system dash style
+ ESCHER_LineDashDotSys, // PS_DASHDOT system dash style
+ ESCHER_LineDashDotDotSys, // PS_DASHDOTDOT system dash style
+ ESCHER_LineDotGEL, // square dot style
+ ESCHER_LineDashGEL, // dash style
+ ESCHER_LineLongDashGEL, // long dash style
+ ESCHER_LineDashDotGEL, // dash short dash
+ ESCHER_LineLongDashDotGEL, // long dash short dash
+ ESCHER_LineLongDashDotDotGEL // long dash short dash short dash
+};
+
+// line end effect
+enum ESCHER_LineEnd
+{
+ ESCHER_LineNoEnd,
+ ESCHER_LineArrowEnd,
+ ESCHER_LineArrowStealthEnd,
+ ESCHER_LineArrowDiamondEnd,
+ ESCHER_LineArrowOvalEnd,
+ ESCHER_LineArrowOpenEnd
+};
+
+// size of arrowhead
+enum ESCHER_LineWidth
+{
+ ESCHER_LineNarrowArrow,
+ ESCHER_LineMediumWidthArrow,
+ ESCHER_LineWideArrow
+};
+
+// size of arrowhead
+enum ESCHER_LineEndLenght
+{
+ ESCHER_LineShortArrow,
+ ESCHER_LineMediumLenArrow,
+ ESCHER_LineLongArrow
+};
+
+// line join style.
+enum ESCHER_LineJoin
+{
+ ESCHER_LineJoinBevel, // Join edges by a straight line
+ ESCHER_LineJoinMiter, // Extend edges until they join
+ ESCHER_LineJoinRound // Draw an arc between the two edges
+};
+
+// line cap style (applies to ends of dash segments too).
+enum ESCHER_LineCap
+{
+ ESCHER_LineEndCapRound, // Rounded ends - the default
+ ESCHER_LineEndCapSquare, // Square protrudes by half line width
+ ESCHER_LineEndCapFlat // Line ends at end point
+};
+
+// 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
+// Transform
+#define ESCHER_Prop_Rotation 4 /* Fixed Point 16.16 degrees */
+// Protection
+#define ESCHER_Prop_LockRotation 119 /* sal_Bool No rotation */
+#define ESCHER_Prop_LockAspectRatio 120 /* sal_Bool Don't allow changes in aspect ratio */
+#define ESCHER_Prop_LockPosition 121 /* sal_Bool Don't allow the shape to be moved */
+#define ESCHER_Prop_LockAgainstSelect 122 /* sal_Bool Shape may not be selected */
+#define ESCHER_Prop_LockCropping 123 /* sal_Bool No cropping this shape */
+#define ESCHER_Prop_LockVertices 124 /* sal_Bool Edit Points not allowed */
+#define ESCHER_Prop_LockText 125 /* sal_Bool Do not edit text */
+#define ESCHER_Prop_LockAdjustHandles 126 /* sal_Bool Do not adjust */
+#define ESCHER_Prop_LockAgainstGrouping 127 /* sal_Bool Do not group this shape */
+// Text
+#define ESCHER_Prop_lTxid 128 /* LONG id for the text, value determined by the host */
+#define ESCHER_Prop_dxTextLeft 129 /* LONG margins relative to shape's inscribed */
+#define ESCHER_Prop_dyTextTop 130 /* LONG text rectangle (in EMUs) */
+#define ESCHER_Prop_dxTextRight 131 /* LONG */
+#define ESCHER_Prop_dyTextBottom 132 /* LONG */
+#define ESCHER_Prop_WrapText 133 /* MSOWRAPMODE Wrap text at shape margins */
+#define ESCHER_Prop_scaleText 134 /* LONG Text zoom/scale (used if fFitTextToShape) */
+#define ESCHER_Prop_AnchorText 135 /* ESCHER_AnchorText How to anchor the text */
+#define ESCHER_Prop_txflTextFlow 136 /* MSOTXFL Text flow */
+#define ESCHER_Prop_cdirFont 137 /* MSOCDIR Font rotation */
+#define ESCHER_Prop_hspNext 138 /* MSOHSP ID of the next shape (used by Word for linked textboxes) */
+#define ESCHER_Prop_txdir 139 /* MSOTXDIR Bi-Di Text direction */
+#define ESCHER_Prop_SelectText 187 /* sal_Bool sal_True if single click selects text, sal_False if two clicks */
+#define ESCHER_Prop_AutoTextMargin 188 /* sal_Bool use host's margin calculations */
+#define ESCHER_Prop_RotateText 189 /* sal_Bool Rotate text with shape */
+#define ESCHER_Prop_FitShapeToText 190 /* sal_Bool Size shape to fit text size */
+#define ESCHER_Prop_FitTextToShape 191 /* sal_Bool Size text to fit shape size */
+// GeoText
+#define ESCHER_Prop_gtextUNICODE 192 /* WCHAR* UNICODE text string */
+#define ESCHER_Prop_gtextRTF 193 /* char* RTF text string */
+#define ESCHER_Prop_gtextAlign 194 /* MSOGEOTEXTALIGN alignment on curve */
+#define ESCHER_Prop_gtextSize 195 /* LONG default point size */
+#define ESCHER_Prop_gtextSpacing 196 /* LONG fixed point 16.16 */
+#define ESCHER_Prop_gtextFont 197 /* WCHAR* font family name */
+#define ESCHER_Prop_gtextFReverseRows 240 /* sal_Bool Reverse row order */
+#define ESCHER_Prop_fGtext 241 /* sal_Bool Has text effect */
+#define ESCHER_Prop_gtextFVertical 242 /* sal_Bool Rotate characters */
+#define ESCHER_Prop_gtextFKern 243 /* sal_Bool Kern characters */
+#define ESCHER_Prop_gtextFTight 244 /* sal_Bool Tightening or tracking */
+#define ESCHER_Prop_gtextFStretch 245 /* sal_Bool Stretch to fit shape */
+#define ESCHER_Prop_gtextFShrinkFit 246 /* sal_Bool Char bounding box */
+#define ESCHER_Prop_gtextFBestFit 247 /* sal_Bool Scale text-on-path */
+#define ESCHER_Prop_gtextFNormalize 248 /* sal_Bool Stretch char height */
+#define ESCHER_Prop_gtextFDxMeasure 249 /* sal_Bool Do not measure along path */
+#define ESCHER_Prop_gtextFBold 250 /* sal_Bool Bold font */
+#define ESCHER_Prop_gtextFItalic 251 /* sal_Bool Italic font */
+#define ESCHER_Prop_gtextFUnderline 252 /* sal_Bool Underline font */
+#define ESCHER_Prop_gtextFShadow 253 /* sal_Bool Shadow font */
+#define ESCHER_Prop_gtextFSmallcaps 254 /* sal_Bool Small caps font */
+#define ESCHER_Prop_gtextFStrikethrough 255 /* sal_Bool Strike through font */
+// Blip
+#define ESCHER_Prop_cropFromTop 256 /* LONG 16.16 fraction times total */
+#define ESCHER_Prop_cropFromBottom 257 /* LONG image width or height, */
+#define ESCHER_Prop_cropFromLeft 258 /* LONG as appropriate. */
+#define ESCHER_Prop_cropFromRight 259 /* LONG */
+#define ESCHER_Prop_pib 260 /* IMsoBlip* Blip to display */
+#define ESCHER_Prop_pibName 261 /* WCHAR* Blip file name */
+#define ESCHER_Prop_pibFlags 262 /* MSOBLIPFLAGS Blip flags */
+#define ESCHER_Prop_pictureTransparent 263 /* LONG transparent color (none if ~0UL) */
+#define ESCHER_Prop_pictureContrast 264 /* LONG contrast setting */
+#define ESCHER_Prop_pictureBrightness 265 /* LONG brightness setting */
+#define ESCHER_Prop_pictureGamma 266 /* LONG 16.16 gamma */
+#define ESCHER_Prop_pictureId 267 /* LONG Host-defined ID for OLE objects (usually a pointer) */
+#define ESCHER_Prop_pictureDblCrMod 268 /* MSOCLR Modification used if shape has double shadow */
+#define ESCHER_Prop_pictureFillCrMod 269 /* MSOCLR */
+#define ESCHER_Prop_pictureLineCrMod 270 /* MSOCLR */
+#define ESCHER_Prop_pibPrint 271 /* IMsoBlip* Blip to display when printing */
+#define ESCHER_Prop_pibPrintName 272 /* WCHAR* Blip file name */
+#define ESCHER_Prop_pibPrintFlags 273 /* MSOBLIPFLAGS Blip flags */
+#define ESCHER_Prop_fNoHitTestPicture 316 /* sal_Bool Do not hit test the picture */
+#define ESCHER_Prop_pictureGray 317 /* sal_Bool grayscale display */
+#define ESCHER_Prop_pictureBiLevel 318 /* sal_Bool bi-level display */
+#define ESCHER_Prop_pictureActive 319 /* sal_Bool Server is active (OLE objects only) */
+// Geometry
+#define ESCHER_Prop_geoLeft 320 /* LONG Defines the G (geometry) coordinate space. */
+#define ESCHER_Prop_geoTop 321 /* LONG */
+#define ESCHER_Prop_geoRight 322 /* LONG */
+#define ESCHER_Prop_geoBottom 323 /* LONG */
+#define ESCHER_Prop_shapePath 324 /* MSOSHAPEPATH */
+#define ESCHER_Prop_pVertices 325 /* IMsoArray An array of points, in G units. */
+#define ESCHER_Prop_pSegmentInfo 326 /* IMsoArray */
+#define ESCHER_Prop_adjustValue 327 /* LONG Adjustment values corresponding to */
+#define ESCHER_Prop_adjust2Value 328 /* LONG the positions of the adjust handles */
+#define ESCHER_Prop_adjust3Value 329 /* LONG of the shape. The number of values */
+#define ESCHER_Prop_adjust4Value 330 /* LONG used and their allowable ranges vary */
+#define ESCHER_Prop_adjust5Value 331 /* LONG from shape type to shape type. */
+#define ESCHER_Prop_adjust6Value 332 /* LONG */
+#define ESCHER_Prop_adjust7Value 333 /* LONG */
+#define ESCHER_Prop_adjust8Value 334 /* LONG */
+#define ESCHER_Prop_adjust9Value 335 /* LONG */
+#define ESCHER_Prop_adjust10Value 336 /* LONG */
+#define ESCHER_Prop_fShadowOK 378 /* sal_Bool Shadow may be set */
+#define ESCHER_Prop_f3DOK 379 /* sal_Bool 3D may be set */
+#define ESCHER_Prop_fLineOK 380 /* sal_Bool Line style may be set */
+#define ESCHER_Prop_fGtextOK 381 /* sal_Bool Text effect (FontWork) supported */
+#define ESCHER_Prop_fFillShadeShapeOK 382 /* sal_Bool */
+#define ESCHER_Prop_fFillOK 383 /* sal_Bool OK to fill the shape through the UI or VBA? */
+// FillStyle
+#define ESCHER_Prop_fillType 384 /* ESCHER_FillStyle Type of fill */
+#define ESCHER_Prop_fillColor 385 /* MSOCLR Foreground color */
+#define ESCHER_Prop_fillOpacity 386 /* LONG Fixed 16.16 */
+#define ESCHER_Prop_fillBackColor 387 /* MSOCLR Background color */
+#define ESCHER_Prop_fillBackOpacity 388 /* LONG Shades only */
+#define ESCHER_Prop_fillCrMod 389 /* MSOCLR Modification for BW views */
+#define ESCHER_Prop_fillBlip 390 /* IMsoBlip* Pattern/texture */
+#define ESCHER_Prop_fillBlipName 391 /* WCHAR* Blip file name */
+#define ESCHER_Prop_fillBlipFlags 392 /* MSOBLIPFLAGS Blip flags */
+#define ESCHER_Prop_fillWidth 393 /* LONG How big (A units) to make a metafile texture. */
+#define ESCHER_Prop_fillHeight 394 /* LONG */
+#define ESCHER_Prop_fillAngle 395 /* LONG Fade angle - degrees in 16.16 */
+#define ESCHER_Prop_fillFocus 396 /* LONG Linear shaded fill focus percent */
+#define ESCHER_Prop_fillToLeft 397 /* LONG Fraction 16.16 */
+#define ESCHER_Prop_fillToTop 398 /* LONG Fraction 16.16 */
+#define ESCHER_Prop_fillToRight 399 /* LONG Fraction 16.16 */
+#define ESCHER_Prop_fillToBottom 400 /* LONG Fraction 16.16 */
+#define ESCHER_Prop_fillRectLeft 401 /* LONG For shaded fills, use the specified rectangle */
+#define ESCHER_Prop_fillRectTop 402 /* LONG instead of the shape's bounding rect to */
+#define ESCHER_Prop_fillRectRight 403 /* LONG define how large the fade is going to be. */
+#define ESCHER_Prop_fillRectBottom 404 /* LONG */
+#define ESCHER_Prop_fillDztype 405 /* MSODZTYPE */
+#define ESCHER_Prop_fillShadePreset 406 /* LONG Special shades */
+#define ESCHER_Prop_fillShadeColors 407 /* IMsoArray a preset array of colors */
+#define ESCHER_Prop_fillOriginX 408 /* LONG */
+#define ESCHER_Prop_fillOriginY 409 /* LONG */
+#define ESCHER_Prop_fillShapeOriginX 410 /* LONG */
+#define ESCHER_Prop_fillShapeOriginY 411 /* LONG */
+#define ESCHER_Prop_fillShadeType 412 /* MSOSHADETYPE Type of shading, if a shaded (gradient) fill. */
+#define ESCHER_Prop_fFilled 443 /* sal_Bool Is shape filled? */
+#define ESCHER_Prop_fHitTestFill 444 /* sal_Bool Should we hit test fill? */
+#define ESCHER_Prop_fillShape 445 /* sal_Bool Register pattern on shape */
+#define ESCHER_Prop_fillUseRect 446 /* sal_Bool Use the large rect? */
+#define ESCHER_Prop_fNoFillHitTest 447 /* sal_Bool Hit test a shape as though filled */
+// LineStyle
+#define ESCHER_Prop_lineColor 448 /* MSOCLR Color of line */
+#define ESCHER_Prop_lineOpacity 449 /* LONG Not implemented */
+#define ESCHER_Prop_lineBackColor 450 /* MSOCLR Background color */
+#define ESCHER_Prop_lineCrMod 451 /* MSOCLR Modification for BW views */
+#define ESCHER_Prop_lineType 452 /* MSOLINETYPE Type of line */
+#define ESCHER_Prop_lineFillBlip 453 /* IMsoBlip* Pattern/texture */
+#define ESCHER_Prop_lineFillBlipName 454 /* WCHAR* Blip file name */
+#define ESCHER_Prop_lineFillBlipFlags 455 /* MSOBLIPFLAGS Blip flags */
+#define ESCHER_Prop_lineFillWidth 456 /* LONG How big (A units) to make */
+#define ESCHER_Prop_lineFillHeight 457 /* LONG a metafile texture. */
+#define ESCHER_Prop_lineFillDztype 458 /* MSODZTYPE How to interpret fillWidth/Height numbers. */
+#define ESCHER_Prop_lineWidth 459 /* LONG A units; 1pt == 12700 EMUs */
+#define ESCHER_Prop_lineMiterLimit 460 /* LONG ratio (16.16) of width */
+#define ESCHER_Prop_lineStyle 461 /* MSOLINESTYLE Draw parallel lines? */
+#define ESCHER_Prop_lineDashing 462 /* MSOLINEDASHING Can be overridden by: */
+#define ESCHER_Prop_lineDashStyle 463 /* IMsoArray As Win32 ExtCreatePen */
+#define ESCHER_Prop_lineStartArrowhead 464 /* MSOLINEEND Arrow at start */
+#define ESCHER_Prop_lineEndArrowhead 465 /* MSOLINEEND Arrow at end */
+#define ESCHER_Prop_lineStartArrowWidth 466 /* MSOLINEENDWIDTH Arrow at start */
+#define ESCHER_Prop_lineStartArrowLength 467 /* MSOLINEENDLENGTH Arrow at end */
+#define ESCHER_Prop_lineEndArrowWidth 468 /* MSOLINEENDWIDTH Arrow at start */
+#define ESCHER_Prop_lineEndArrowLength 469 /* MSOLINEENDLENGTH Arrow at end */
+#define ESCHER_Prop_lineJoinStyle 470 /* MSOLINEJOIN How to join lines */
+#define ESCHER_Prop_lineEndCapStyle 471 /* MSOLINECAP How to end lines */
+#define ESCHER_Prop_fArrowheadsOK 507 /* sal_Bool Allow arrowheads if prop. is set */
+#define ESCHER_Prop_fLine 508 /* sal_Bool Any line? */
+#define ESCHER_Prop_fHitTestLine 509 /* sal_Bool Should we hit test lines? */
+#define ESCHER_Prop_lineFillShape 510 /* sal_Bool Register pattern on shape */
+#define ESCHER_Prop_fNoLineDrawDash 511 /* sal_Bool Draw a dashed line if no line */
+// ShadowStyle
+#define ESCHER_Prop_shadowType 512 /* MSOSHADOWTYPE Type of effect */
+#define ESCHER_Prop_shadowColor 513 /* MSOCLR Foreground color */
+#define ESCHER_Prop_shadowHighlight 514 /* MSOCLR Embossed color */
+#define ESCHER_Prop_shadowCrMod 515 /* MSOCLR Modification for BW views */
+#define ESCHER_Prop_shadowOpacity 516 /* LONG Fixed 16.16 */
+#define ESCHER_Prop_shadowOffsetX 517 /* LONG Offset shadow */
+#define ESCHER_Prop_shadowOffsetY 518 /* LONG Offset shadow */
+#define ESCHER_Prop_shadowSecondOffsetX 519 /* LONG Double offset shadow */
+#define ESCHER_Prop_shadowSecondOffsetY 520 /* LONG Double offset shadow */
+#define ESCHER_Prop_shadowScaleXToX 521 /* LONG 16.16 */
+#define ESCHER_Prop_shadowScaleYToX 522 /* LONG 16.16 */
+#define ESCHER_Prop_shadowScaleXToY 523 /* LONG 16.16 */
+#define ESCHER_Prop_shadowScaleYToY 524 /* LONG 16.16 */
+#define ESCHER_Prop_shadowPerspectiveX 525 /* LONG 16.16 / weight */
+#define ESCHER_Prop_shadowPerspectiveY 526 /* LONG 16.16 / weight */
+#define ESCHER_Prop_shadowWeight 527 /* LONG scaling factor */
+#define ESCHER_Prop_shadowOriginX 528 /* LONG */
+#define ESCHER_Prop_shadowOriginY 529 /* LONG */
+#define ESCHER_Prop_fShadow 574 /* sal_Bool Any shadow? */
+#define ESCHER_Prop_fshadowObscured 575 /* sal_Bool Excel5-style shadow */
+// PerspectiveStyle
+#define ESCHER_Prop_perspectiveType 576 /* MSOXFORMTYPE Where transform applies */
+#define ESCHER_Prop_perspectiveOffsetX 577 /* LONG The LONG values define a */
+#define ESCHER_Prop_perspectiveOffsetY 578 /* LONG transformation matrix, */
+#define ESCHER_Prop_perspectiveScaleXToX 579 /* LONG effectively, each value */
+#define ESCHER_Prop_perspectiveScaleYToX 580 /* LONG is scaled by the */
+#define ESCHER_Prop_perspectiveScaleXToY 581 /* LONG perspectiveWeight parameter. */
+#define ESCHER_Prop_perspectiveScaleYToY 582 /* LONG */
+#define ESCHER_Prop_perspectivePerspectiveX 583 /* LONG */
+#define ESCHER_Prop_perspectivePerspectiveY 584 /* LONG */
+#define ESCHER_Prop_perspectiveWeight 585 /* LONG Scaling factor */
+#define ESCHER_Prop_perspectiveOriginX 586 /* LONG */
+#define ESCHER_Prop_perspectiveOriginY 587 /* LONG */
+#define ESCHER_Prop_fPerspective 639 /* sal_Bool On/off */
+// 3D Object
+#define ESCHER_Prop_c3DSpecularAmt 640 /* LONG Fixed-point 16.16 */
+#define ESCHER_Prop_c3DDiffuseAmt 641 /* LONG Fixed-point 16.16 */
+#define ESCHER_Prop_c3DShininess 642 /* LONG Default gives OK results */
+#define ESCHER_Prop_c3DEdgeThickness 643 /* LONG Specular edge thickness */
+#define ESCHER_Prop_c3DExtrudeForward 644 /* LONG Distance of extrusion in EMUs */
+#define ESCHER_Prop_c3DExtrudeBackward 645 /* LONG */
+#define ESCHER_Prop_c3DExtrudePlane 646 /* LONG Extrusion direction */
+#define ESCHER_Prop_c3DExtrusionColor 647 /* MSOCLR Basic color of extruded part of shape; the lighting model used will determine the exact shades used when rendering. */
+#define ESCHER_Prop_c3DCrMod 648 /* MSOCLR Modification for BW views */
+#define ESCHER_Prop_f3D 700 /* sal_Bool Does this shape have a 3D effect? */
+#define ESCHER_Prop_fc3DMetallic 701 /* sal_Bool Use metallic specularity? */
+#define ESCHER_Prop_fc3DUseExtrusionColor 702 /* sal_Bool */
+#define ESCHER_Prop_fc3DLightFace 703 /* sal_Bool */
+// 3D Style
+#define ESCHER_Prop_c3DYRotationAngle 704 /* LONG degrees (16.16) about y axis */
+#define ESCHER_Prop_c3DXRotationAngle 705 /* LONG degrees (16.16) about x axis */
+#define ESCHER_Prop_c3DRotationAxisX 706 /* LONG These specify the rotation axis; */
+#define ESCHER_Prop_c3DRotationAxisY 707 /* LONG only their relative magnitudes */
+#define ESCHER_Prop_c3DRotationAxisZ 708 /* LONG matter. */
+#define ESCHER_Prop_c3DRotationAngle 709 /* LONG degrees (16.16) about axis */
+#define ESCHER_Prop_c3DRotationCenterX 710 /* LONG rotation center x (16.16 or g-units) */
+#define ESCHER_Prop_c3DRotationCenterY 711 /* LONG rotation center y (16.16 or g-units) */
+#define ESCHER_Prop_c3DRotationCenterZ 712 /* LONG rotation center z (absolute (emus)) */
+#define ESCHER_Prop_c3DRenderMode 713 /* MSO3DRENDERMODE Full,wireframe, or bcube */
+#define ESCHER_Prop_c3DTolerance 714 /* LONG pixels (16.16) */
+#define ESCHER_Prop_c3DXViewpoint 715 /* LONG X view point (emus) */
+#define ESCHER_Prop_c3DYViewpoint 716 /* LONG Y view point (emus) */
+#define ESCHER_Prop_c3DZViewpoint 717 /* LONG Z view distance (emus) */
+#define ESCHER_Prop_c3DOriginX 718 /* LONG */
+#define ESCHER_Prop_c3DOriginY 719 /* LONG */
+#define ESCHER_Prop_c3DSkewAngle 720 /* LONG degree (16.16) skew angle */
+#define ESCHER_Prop_c3DSkewAmount 721 /* LONG Percentage skew amount */
+#define ESCHER_Prop_c3DAmbientIntensity 722 /* LONG Fixed point intensity */
+#define ESCHER_Prop_c3DKeyX 723 /* LONG Key light source direc- */
+#define ESCHER_Prop_c3DKeyY 724 /* LONG tion; only their relative */
+#define ESCHER_Prop_c3DKeyZ 725 /* LONG magnitudes matter */
+#define ESCHER_Prop_c3DKeyIntensity 726 /* LONG Fixed point intensity */
+#define ESCHER_Prop_c3DFillX 727 /* LONG Fill light source direc- */
+#define ESCHER_Prop_c3DFillY 728 /* LONG tion; only their relative */
+#define ESCHER_Prop_c3DFillZ 729 /* LONG magnitudes matter */
+#define ESCHER_Prop_c3DFillIntensity 730 /* LONG Fixed point intensity */
+#define ESCHER_Prop_fc3DConstrainRotation 763 /* sal_Bool */
+#define ESCHER_Prop_fc3DRotationCenterAuto 764 /* sal_Bool */
+#define ESCHER_Prop_fc3DParallel 765 /* sal_Bool Parallel projection? */
+#define ESCHER_Prop_fc3DKeyHarsh 766 /* sal_Bool Is key lighting harsh? */
+#define ESCHER_Prop_fc3DFillHarsh 767 /* sal_Bool Is fill lighting harsh? */
+// Shape
+#define ESCHER_Prop_hspMaster 769 /* MSOHSP master shape */
+#define ESCHER_Prop_cxstyle 771 /* MSOCXSTYLE Type of connector */
+#define ESCHER_Prop_bWMode 772 /* ESCHERwMode Settings for modifications to */
+#define ESCHER_Prop_bWModePureBW 773 /* ESCHERwMode be made when in different */
+#define ESCHER_Prop_bWModeBW 774 /* ESCHERwMode forms of black-and-white mode. */
+#define ESCHER_Prop_fOleIcon 826 /* sal_Bool For OLE objects, whether the object is in icon form */
+#define ESCHER_Prop_fPreferRelativeResize 827 /* sal_Bool For UI only. Prefer relative resizing. */
+#define ESCHER_Prop_fLockShapeType 828 /* sal_Bool Lock the shape type (don't allow Change Shape) */
+#define ESCHER_Prop_fDeleteAttachedObject 830 /* sal_Bool */
+#define ESCHER_Prop_fBackground 831 /* sal_Bool If sal_True, this is the background shape. */
+// Callout
+#define ESCHER_Prop_spcot 832 /* MSOSPCOT Callout type */
+#define ESCHER_Prop_dxyCalloutGap 833 /* LONG Distance from box to first point.(EMUs) */
+#define ESCHER_Prop_spcoa 834 /* MSOSPCOA Callout angle */
+#define ESCHER_Prop_spcod 835 /* MSOSPCOD Callout drop type */
+#define ESCHER_Prop_dxyCalloutDropSpecified 836 /* LONG if msospcodSpecified, the actual drop distance */
+#define ESCHER_Prop_dxyCalloutLengthSpecified 837 /* LONG if fCalloutLengthSpecified, the actual distance */
+#define ESCHER_Prop_fCallout 889 /* sal_Bool Is the shape a callout? */
+#define ESCHER_Prop_fCalloutAccentBar 890 /* sal_Bool does callout have accent bar */
+#define ESCHER_Prop_fCalloutTextBorder 891 /* sal_Bool does callout have a text border */
+#define ESCHER_Prop_fCalloutMinusX 892 /* sal_Bool */
+#define ESCHER_Prop_fCalloutMinusY 893 /* sal_Bool */
+#define ESCHER_Prop_fCalloutDropAuto 894 /* sal_Bool If true, then we occasionally invert the drop distance */
+#define ESCHER_Prop_fCalloutLengthSpecified 895 /* sal_Bool if true, we look at dxyCalloutLengthSpecified */
+// GroupShape
+#define ESCHER_Prop_wzName 896 /* WCHAR* Shape Name (present only if explicitly set) */
+#define ESCHER_Prop_wzDescription 897 /* WCHAR* alternate text */
+#define ESCHER_Prop_pihlShape 898 /* IHlink* The hyperlink in the shape. */
+#define ESCHER_Prop_pWrapPolygonVertices 899 /* IMsoArray The polygon that text will be wrapped around (Word) */
+#define ESCHER_Prop_dxWrapDistLeft 900 /* LONG Left wrapping distance from text (Word) */
+#define ESCHER_Prop_dyWrapDistTop 901 /* LONG Top wrapping distance from text (Word) */
+#define ESCHER_Prop_dxWrapDistRight 902 /* LONG Right wrapping distance from text (Word) */
+#define ESCHER_Prop_dyWrapDistBottom 903 /* LONG Bottom wrapping distance from text (Word) */
+#define ESCHER_Prop_lidRegroup 904 /* LONG Regroup ID */
+#define ESCHER_Prop_tableProperties 927
+#define ESCHER_Prop_tableRowProperties 928
+#define ESCHER_Prop_fEditedWrap 953 /* sal_Bool Has the wrap polygon been edited? */
+#define ESCHER_Prop_fBehindDocument 954 /* sal_Bool Word-only (shape is behind text) */
+#define ESCHER_Prop_fOnDblClickNotify 955 /* sal_Bool Notify client on a double click */
+#define ESCHER_Prop_fIsButton 956 /* sal_Bool A button shape (i.e., clicking performs an action). Set for shapes with attached hyperlinks or macros. */
+#define ESCHER_Prop_fOneD 957 /* sal_Bool 1D adjustment */
+#define ESCHER_Prop_fHidden 958 /* sal_Bool Do not display */
+#define ESCHER_Prop_fPrint 959 /* sal_Bool Print this shape */
+
+#define ESCHER_PERSISTENTRY_PREALLOCATE 64
+
+#define ESCHER_Persist_PrivateEntry 0x80000000
+#define ESCHER_Persist_Dgg 0x00010000
+#define ESCHER_Persist_Dg 0x00020000
+#define ESCHER_Persist_CurrentPosition 0x00040000
+#define ESCHER_Persist_Grouping_Snap 0x00050000
+#define ESCHER_Persist_Grouping_Logic 0x00060000
+
+const sal_uInt32 DFF_DGG_CLUSTER_SIZE = 0x00000400; /// Shape IDs per cluster in DGG atom.
+
+// ---------------------------------------------------------------------------------------------
+
+namespace com { namespace sun { namespace star {
+ namespace awt {
+ struct Gradient;
+ }
+ namespace drawing {
+ struct EnhancedCustomShapeAdjustmentValue;
+ class XShape;
+ class XShapes;
+ }
+}}}
+
+struct MSFILTER_DLLPUBLIC EscherConnectorListEntry
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnector;
+ ::com::sun::star::awt::Point maPointA;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToA;
+ ::com::sun::star::awt::Point maPointB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToB;
+
+ sal_uInt32 GetConnectorRule( sal_Bool bFirst );
+
+ EscherConnectorListEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rC,
+ const ::com::sun::star::awt::Point& rPA,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSA ,
+ const ::com::sun::star::awt::Point& rPB,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rSB ) :
+ mXConnector ( rC ),
+ maPointA ( rPA ),
+ mXConnectToA( rSA ),
+ maPointB ( rPB ),
+ mXConnectToB( rSB ) {}
+
+ sal_uInt32 GetClosestPoint( const Polygon& rPoly, const ::com::sun::star::awt::Point& rP );
+};
+
+struct MSFILTER_DLLPUBLIC EscherExContainer
+{
+ sal_uInt32 nContPos;
+ SvStream& rStrm;
+
+ EscherExContainer( SvStream& rSt, const sal_uInt16 nRecType, const sal_uInt16 nInstance = 0 );
+ ~EscherExContainer();
+};
+
+struct MSFILTER_DLLPUBLIC EscherExAtom
+{
+ sal_uInt32 nContPos;
+ SvStream& rStrm;
+
+ EscherExAtom( SvStream& rSt, const sal_uInt16 nRecType, const sal_uInt16 nInstance = 0, const sal_uInt8 nVersion = 0 );
+ ~EscherExAtom();
+};
+
+struct EscherPropertyValueHelper
+{
+ static sal_Bool GetPropertyValue(
+ ::com::sun::star::uno::Any& rAny,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
+ const OUString& rPropertyName,
+ sal_Bool bTestPropertyAvailability = sal_False
+ );
+
+ static ::com::sun::star::beans::PropertyState GetPropertyState(
+ const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > &,
+ const OUString& rPropertyName
+ );
+};
+
+// ---------------------------------------------------------------------------------------------
+
+struct EscherPersistEntry
+{
+ sal_uInt32 mnID;
+ sal_uInt32 mnOffset;
+
+ EscherPersistEntry( sal_uInt32 nId, sal_uInt32 nOffset ) { mnID = nId; mnOffset = nOffset; };
+
+};
+
+// ---------------------------------------------------------------------------------------------
+
+class EscherBlibEntry
+{
+
+ friend class EscherGraphicProvider;
+ friend class EscherEx;
+
+protected:
+
+ sal_uInt32 mnIdentifier[ 4 ];
+ sal_uInt32 mnPictureOffset; // offset to the graphic im PictureStreams
+ sal_uInt32 mnSize; // size of real graphic
+
+ sal_uInt32 mnRefCount; // !! reference count
+ sal_uInt32 mnSizeExtra; // !! size of preceding header
+
+ ESCHER_BlibType meBlibType;
+
+ Size maPrefSize;
+ MapMode maPrefMapMode;
+
+ sal_Bool mbIsEmpty;
+ sal_Bool mbIsNativeGraphicPossible;
+
+public:
+
+ EscherBlibEntry(
+ sal_uInt32 nPictureOffset,
+ const GraphicObject& rObj,
+ const OString& rId,
+ const GraphicAttr* pAttr = NULL
+ );
+
+ ~EscherBlibEntry();
+
+ void WriteBlibEntry( SvStream& rSt, sal_Bool bWritePictureOffset, sal_uInt32 nResize = 0 );
+ sal_Bool IsEmpty() const { return mbIsEmpty; };
+
+ sal_Bool operator==( const EscherBlibEntry& ) const;
+};
+
+// ---------------------------------------------------------------------------------------------
+
+#define _E_GRAPH_PROV_USE_INSTANCES 1
+#define _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES 2
+
+class MSFILTER_DLLPUBLIC EscherGraphicProvider
+{
+ sal_uInt32 mnFlags;
+
+ EscherBlibEntry** mpBlibEntrys;
+ sal_uInt32 mnBlibBufSize;
+ sal_uInt32 mnBlibEntrys;
+
+ OUString maBaseURI;
+
+protected:
+
+ sal_uInt32 ImplInsertBlib( EscherBlibEntry* p_EscherBlibEntry );
+
+public:
+
+ sal_uInt32 GetBlibStoreContainerSize( SvStream* pMergePicStreamBSE = NULL ) const;
+ void WriteBlibStoreContainer( SvStream& rStrm, SvStream* pMergePicStreamBSE = NULL );
+ sal_Bool WriteBlibStoreEntry(SvStream& rStrm, sal_uInt32 nBlipId,
+ sal_Bool bWritePictureOffset, sal_uInt32 nResize = 0);
+ sal_uInt32 GetBlibID(
+ SvStream& rPicOutStream,
+ const OString& rGraphicId,
+ const Rectangle& rBoundRect,
+ const com::sun::star::awt::Rectangle* pVisArea = NULL,
+ const GraphicAttr* pGrafikAttr = NULL
+ );
+ sal_Bool HasGraphics() const { return mnBlibEntrys != 0; };
+
+ void SetNewBlipStreamOffset( sal_Int32 nOffset );
+
+ sal_Bool GetPrefSize( const sal_uInt32 nBlibId, Size& rSize, MapMode& rMapMode );
+
+ void SetBaseURI( const OUString& rBaseURI ) { maBaseURI = rBaseURI; };
+ const OUString& GetBaseURI() { return maBaseURI; };
+
+ EscherGraphicProvider( sal_uInt32 nFlags = _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES );
+ ~EscherGraphicProvider();
+
+};
+
+struct EscherShapeListEntry;
+typedef ::std::vector< EscherShapeListEntry* > EscherShapeList_impl;
+typedef ::std::vector< EscherConnectorListEntry* > EscherConnectorList_impl;
+
+class MSFILTER_DLLPUBLIC EscherSolverContainer
+{
+ EscherShapeList_impl maShapeList;
+ EscherConnectorList_impl maConnectorList;
+
+public:
+
+ sal_uInt32 GetShapeId(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rShape
+ ) const;
+
+ void AddShape(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &,
+ sal_uInt32 nId
+ );
+
+ void AddConnector(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &,
+ const ::com::sun::star::awt::Point& rA,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &,
+ const ::com::sun::star::awt::Point& rB,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConB
+ );
+
+ void WriteSolver( SvStream& );
+
+ EscherSolverContainer(){};
+ ~EscherSolverContainer();
+};
+
+// ---------------------------------------------------------------------------------------------
+
+#define ESCHER_CREATEPOLYGON_LINE 1
+#define ESCHER_CREATEPOLYGON_POLYLINE 2
+#define ESCHER_CREATEPOLYGON_POLYPOLYGON 4
+
+class GraphicAttr;
+class SdrObjCustomShape;
+
+struct EscherPropSortStruct
+{
+ sal_uInt8* pBuf;
+ sal_uInt32 nPropSize;
+ sal_uInt32 nPropValue;
+ sal_uInt16 nPropId;
+};
+
+typedef std::vector< EscherPropSortStruct > EscherProperties;
+
+class MSFILTER_DLLPUBLIC EscherPropertyContainer
+{
+ EscherGraphicProvider* pGraphicProvider;
+ SvStream* pPicOutStrm;
+ Rectangle* pShapeBoundRect;
+
+ EscherPropSortStruct* pSortStruct;
+
+ sal_uInt32 nSortCount;
+ sal_uInt32 nSortBufSize;
+ sal_uInt32 nCountCount;
+ sal_uInt32 nCountSize;
+
+ sal_Bool bHasComplexData;
+ sal_Bool bSuppressRotation;
+
+
+ sal_uInt32 ImplGetColor( const sal_uInt32 rColor, sal_Bool bSwap = sal_True );
+ void ImplCreateGraphicAttributes(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ sal_uInt32 nBlibId,
+ sal_Bool bCreateCroppingAttributes
+ );
+ sal_Bool ImplCreateEmbeddedBmp( const OString& rUniqueId );
+ void ImplInit();
+
+public:
+
+ EscherPropertyContainer();
+ EscherPropertyContainer(
+ EscherGraphicProvider& rGraphicProvider, // the PropertyContainer needs to know
+ SvStream* pPicOutStrm, // the GraphicProvider to be able to write
+ Rectangle& rShapeBoundRect // FillBitmaps or GraphicObjects.
+ ); // under some circumstances the ShapeBoundRect
+ // is adjusted this will happen when rotated
+ // GraphicObjects are saved to PowerPoint
+ ~EscherPropertyContainer();
+
+ void AddOpt( sal_uInt16 nPropertyID, const OUString& rString );
+
+ void AddOpt(
+ sal_uInt16 nPropertyID,
+ sal_uInt32 nPropValue,
+ sal_Bool bBlib = sal_False
+ );
+
+ void AddOpt(
+ sal_uInt16 nPropertyID,
+ sal_Bool bBlib,
+ sal_uInt32 nPropValue,
+ sal_uInt8* pProp,
+ sal_uInt32 nPropSize
+ );
+
+ sal_Bool GetOpt( sal_uInt16 nPropertyID, sal_uInt32& rPropValue ) const;
+
+ sal_Bool GetOpt( sal_uInt16 nPropertyID, EscherPropSortStruct& rPropValue ) const;
+
+ EscherProperties GetOpts() const;
+
+ void Commit( SvStream& rSt, sal_uInt16 nVersion = 3, sal_uInt16 nRecType = ESCHER_OPT );
+
+ sal_Bool CreateShapeProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape
+ );
+ sal_Bool CreateOLEGraphicProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXOleObject
+ );
+
+ /** Creates a complex ESCHER_Prop_fillBlip containing the BLIP directly (for Excel charts). */
+ sal_Bool CreateEmbeddedBitmapProperties(
+ const OUString& rBitmapUrl,
+ ::com::sun::star::drawing::BitmapMode eBitmapMode
+ );
+ /** Creates a complex ESCHER_Prop_fillBlip containing a hatch style (for Excel charts). */
+ sal_Bool CreateEmbeddedHatchProperties(
+ const ::com::sun::star::drawing::Hatch& rHatch,
+ const Color& rBackColor,
+ bool bFillBackground
+ );
+
+ // the GraphicProperties will only be created if a GraphicProvider and PicOutStrm is known
+ // DR: #99897# if no GraphicProvider is present, a complex ESCHER_Prop_fillBlip
+ // will be created, containing the BLIP directly (e.g. for Excel charts).
+ sal_Bool CreateGraphicProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ const OUString& rSource,
+ const sal_Bool bCreateFillBitmap,
+ const sal_Bool bCreateCroppingAttributes = sal_False,
+ const sal_Bool bFillBitmapModeAllowed = sal_True
+ );
+
+ sal_Bool CreatePolygonProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ sal_uInt32 nFlags,
+ sal_Bool bBezier,
+ ::com::sun::star::awt::Rectangle& rGeoRect,
+ Polygon* pPolygon = NULL
+ );
+
+ static sal_uInt32 GetGradientColor(
+ const ::com::sun::star::awt::Gradient* pGradient,
+ sal_uInt32 nStartColor
+ );
+
+ void CreateGradientProperties( const ::com::sun::star::awt::Gradient & rGradient );
+ void CreateGradientProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &
+ );
+ void CreateLineProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
+ sal_Bool bEdge
+ );
+ void CreateFillProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge );
+ void CreateTextProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
+ sal_uInt32 nText,
+ const sal_Bool bIsCustomShape = sal_False,
+ const sal_Bool bIsTextFrame = sal_True
+ );
+
+ sal_Bool CreateConnectorProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
+ EscherSolverContainer& rSolver,
+ ::com::sun::star::awt::Rectangle& rGeoRect,
+ sal_uInt16& rShapeType,
+ sal_uInt16& rShapeFlags
+ );
+
+ // Because shadow properties depends to the line and fillstyle, the CreateShadowProperties method should be called at last.
+ // It activ only when at least a FillStyle or LineStyle is set.
+ sal_Bool CreateShadowProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &
+ );
+
+ // creates all necessary CustomShape properties, this includes also Text-, Shadow-, Fill-, and LineProperties
+ void CreateCustomShapeProperties(
+ const MSO_SPT eShapeType,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &
+ );
+ sal_Bool IsFontWork() const;
+
+ // helper functions which are also used by the escher import
+ static PolyPolygon GetPolyPolygon(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape
+ );
+ static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Any& rSource );
+ static MSO_SPT GetCustomShapeType(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
+ sal_uInt32& nMirrorFlags
+ );
+ static MSO_SPT GetCustomShapeType(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
+ sal_uInt32& nMirrorFlags,
+ OUString& rShapeType
+ );
+
+ // helper functions which are also used in ooxml export
+ static sal_Bool GetLineArrow(
+ const sal_Bool bLineStart,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ ESCHER_LineEnd& reLineEnd,
+ sal_Int32& rnArrowLength,
+ sal_Int32& rnArrowWidth
+ );
+ static sal_Bool IsDefaultObject( SdrObjCustomShape* pCustoShape );
+ static void LookForPolarHandles(
+ const MSO_SPT eShapeType,
+ sal_Int32& nAdjustmentsWhichNeedsToBeConverted
+ );
+ static sal_Bool GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue );
+};
+
+// ---------------------------------------------------------------------------------------------
+
+typedef ::std::vector< EscherPersistEntry* > EscherPersistTable_impl;
+
+class MSFILTER_DLLPUBLIC EscherPersistTable
+{
+
+public:
+ EscherPersistTable_impl maPersistTable;
+
+ sal_Bool PtIsID( sal_uInt32 nID );
+ void PtInsert( sal_uInt32 nID, sal_uInt32 nOfs );
+ sal_uInt32 PtDelete( sal_uInt32 nID );
+ sal_uInt32 PtGetOffsetByID( sal_uInt32 nID );
+ sal_uInt32 PtReplace( sal_uInt32 nID, sal_uInt32 nOfs );
+ sal_uInt32 PtReplaceOrInsert( sal_uInt32 nID, sal_uInt32 nOfs );
+ sal_uInt32 PtGetCount() const { return maPersistTable.size(); };
+
+ EscherPersistTable();
+ virtual ~EscherPersistTable();
+};
+
+// ---------------------------------------------------------------------------------------------
+
+class EscherEx;
+
+/// abstract base class for ESCHER_ClientTextbox, ESCHER_ClientData
+class MSFILTER_DLLPUBLIC EscherExClientRecord_Base
+{
+public:
+ EscherExClientRecord_Base() {}
+ virtual ~EscherExClientRecord_Base();
+
+ /// Application writes the record header
+ /// using rEx.AddAtom(...) followed by
+ /// record data written to rEx.GetStream()
+ virtual void WriteData( EscherEx& rEx ) const = 0;
+};
+
+
+/// abstract base class for ESCHER_ClientAnchor
+class MSFILTER_DLLPUBLIC EscherExClientAnchor_Base
+{
+public:
+ EscherExClientAnchor_Base() {}
+ virtual ~EscherExClientAnchor_Base();
+
+ /// Application writes the record header
+ /// using rEx.AddAtom(...) followed by
+ /// record data written to rEx.GetStream()
+ virtual void WriteData( EscherEx& rEx,
+ const Rectangle& rRect ) = 0;
+};
+
+class InteractionInfo
+{
+ bool mbHasInteraction;
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ std::auto_ptr<SvMemoryStream> mpHyperlinkRecord;
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+ InteractionInfo();
+
+public:
+ InteractionInfo( SvMemoryStream* pStream, bool bInteraction ) : mbHasInteraction( bInteraction )
+ {
+ mpHyperlinkRecord.reset( pStream );
+ }
+ bool hasInteraction() { return mbHasInteraction; }
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ const std::auto_ptr< SvMemoryStream >& getHyperlinkRecord() { return mpHyperlinkRecord; }
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+};
+
+class EscherExHostAppData
+{
+private:
+ EscherExClientAnchor_Base* pClientAnchor;
+ EscherExClientRecord_Base* pClientData;
+ EscherExClientRecord_Base* pClientTextbox;
+ InteractionInfo* pInteractionInfo;
+ // ignore single shape if entire pages are written
+ sal_Bool bDontWriteShape;
+
+public:
+ EscherExHostAppData() : pClientAnchor(0), pClientData(0),
+ pClientTextbox(0), pInteractionInfo(0), bDontWriteShape(sal_False)
+ {}
+
+ void SetInteractionInfo( InteractionInfo* p )
+ { pInteractionInfo = p; }
+ void SetClientAnchor( EscherExClientAnchor_Base* p )
+ { pClientAnchor = p; }
+ void SetClientData( EscherExClientRecord_Base* p )
+ { pClientData = p; }
+ void SetClientTextbox( EscherExClientRecord_Base* p )
+ { pClientTextbox = p; }
+ void SetDontWriteShape( sal_Bool b )
+ { bDontWriteShape = b; }
+ InteractionInfo* GetInteractionInfo() const
+ { return pInteractionInfo; }
+ EscherExClientAnchor_Base* GetClientAnchor() const
+ { return pClientAnchor; }
+ EscherExClientRecord_Base* GetClientData() const
+ { return pClientData; }
+ EscherExClientRecord_Base* GetClientTextbox() const
+ { return pClientTextbox; }
+
+ void WriteClientAnchor( EscherEx& rEx, const Rectangle& rRect )
+ { if( pClientAnchor ) pClientAnchor->WriteData( rEx, rRect ); }
+ void WriteClientData( EscherEx& rEx )
+ { if( pClientData ) pClientData->WriteData( rEx ); }
+ void WriteClientTextbox( EscherEx& rEx )
+ { if( pClientTextbox ) pClientTextbox->WriteData( rEx ); }
+
+ sal_Bool DontWriteShape() const { return bDontWriteShape; }
+};
+
+
+// ============================================================================
+
+/** Instance for global DFF data, shared through various instances of EscherEx. */
+class MSFILTER_DLLPUBLIC EscherExGlobal : public EscherGraphicProvider
+{
+public:
+ explicit EscherExGlobal( sal_uInt32 nGraphicProvFlags = _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES );
+ virtual ~EscherExGlobal();
+
+ /** Returns a new drawing ID for a new drawing container (DGCONTAINER). */
+ sal_uInt32 GenerateDrawingId();
+ /** Creates and returns a new shape identifier, updates the internal shape
+ counters and registers the identifier in the DGG cluster table.
+ @param nDrawingId Drawing identifier has to be passed to be able to
+ generate shape identifiers for multiple drawings simultaniously. */
+ sal_uInt32 GenerateShapeId( sal_uInt32 nDrawingId, bool bIsInSpgr );
+ /** Returns the number of shapes in the current drawing, based on number of
+ calls to the GenerateShapeId() function. */
+ sal_uInt32 GetDrawingShapeCount( sal_uInt32 nDrawingId ) const;
+ /** Returns the last shape identifier generated by the GenerateShapeId()
+ function. */
+ sal_uInt32 GetLastShapeId( sal_uInt32 nDrawingId ) const;
+
+ /** Sets the flag indicating that the DGGCONTAINER exists. */
+ inline void SetDggContainer() { mbHasDggCont = true; }
+ /** Sets the flag indicating that the DGGCONTAINER exists. */
+ inline bool HasDggContainer() const { return mbHasDggCont; }
+ /** Returns the total size of the DGG atom (including header). */
+ sal_uInt32 GetDggAtomSize() const;
+ /** Writes the complete DGG atom to the passed stream (overwrites existing data!). */
+ void WriteDggAtom( SvStream& rStrm ) const;
+
+ /** Called if a picture shall be written and no picture stream is set at
+ class ImplEscherExSdr.
+
+ On first invokation, this function calls the virtual member function
+ ImplQueryPictureStream(). The return value will be cached internally
+ for subsequent calls and for the GetPictureStream() function.
+ */
+ SvStream* QueryPictureStream();
+
+ /** Returns the picture stream if existing (queried), otherwise null. */
+ inline SvStream* GetPictureStream() { return mpPicStrm; }
+
+private:
+ /** Derived classes may implement to create a new stream used to store the
+ picture data.
+
+ The implementation has to take care about lifetime of the returned
+ stream (it will not be destructed automatically). This function is
+ called exactly once. The return value will be cached internally for
+ repeated calls of the public QueryPictureStream() function.
+ */
+ virtual SvStream* ImplQueryPictureStream();
+
+private:
+ struct ClusterEntry
+ {
+ sal_uInt32 mnDrawingId; /// Identifier of drawing this cluster belongs to (one-based index into maDrawingInfos).
+ sal_uInt32 mnNextShapeId; /// Next free shape identifier in this cluster.
+ inline explicit ClusterEntry( sal_uInt32 nDrawingId ) : mnDrawingId( nDrawingId ), mnNextShapeId( 0 ) {}
+ };
+ typedef ::std::vector< ClusterEntry > ClusterTable;
+
+ struct DrawingInfo
+ {
+ sal_uInt32 mnClusterId; /// Currently used cluster (one-based index into maClusterTable).
+ sal_uInt32 mnShapeCount; /// Current number of shapes in this drawing.
+ sal_uInt32 mnLastShapeId; /// Last shape identifier generated for this drawing.
+ inline explicit DrawingInfo( sal_uInt32 nClusterId ) : mnClusterId( nClusterId ), mnShapeCount( 0 ), mnLastShapeId( 0 ) {}
+ };
+ typedef ::std::vector< DrawingInfo > DrawingInfoVector;
+
+ ClusterTable maClusterTable; /// List with cluster IDs (used object IDs in drawings).
+ DrawingInfoVector maDrawingInfos; /// Data about all used drawings.
+ SvStream* mpPicStrm; /// Cached result of ImplQueryPictureStream().
+ bool mbHasDggCont; /// True = the DGGCONTAINER has been initialized.
+ bool mbPicStrmQueried; /// True = ImplQueryPictureStream() has been called.
+};
+
+typedef ::boost::shared_ptr< EscherExGlobal > EscherExGlobalRef;
+
+// ---------------------------------------------------------------------------------------------
+
+class SdrObject;
+class SdrPage;
+class ImplEscherExSdr;
+
+class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable
+{
+ protected:
+ typedef ::std::auto_ptr< ImplEscherExSdr > ImplEscherExSdrPtr;
+
+ EscherExGlobalRef mxGlobal;
+ ImplEscherExSdrPtr mpImplEscherExSdr;
+ SvStream* mpOutStrm;
+ bool mbOwnsStrm;
+ sal_uInt32 mnStrmStartOfs;
+ std::vector< sal_uInt32 > mOffsets;
+ std::vector< sal_uInt16 > mRecTypes;
+
+ sal_uInt32 mnCurrentDg;
+ sal_uInt32 mnCountOfs;
+
+ sal_uInt32 mnGroupLevel;
+ sal_uInt16 mnHellLayerId;
+
+ sal_Bool mbEscherSpgr;
+ sal_Bool mbEscherDg;
+ sal_Bool mbOleEmf; // OLE is EMF instead of WMF
+
+
+ virtual sal_Bool DoSeek( sal_uInt32 nKey );
+
+public:
+ explicit EscherEx( const EscherExGlobalRef& rxGlobal, SvStream* pOutStrm );
+ virtual ~EscherEx();
+
+ /** Creates and returns a new shape identifier, updates the internal shape
+ counters and registers the identifier in the DGG cluster table. */
+ inline sal_uInt32 GenerateShapeId() { return mxGlobal->GenerateShapeId( mnCurrentDg, mbEscherSpgr ); }
+
+ /** Returns the graphic provider from the global object that has been
+ passed to the constructor.
+ */
+ inline EscherGraphicProvider& GetGraphicProvider() { return *mxGlobal; }
+
+ /** Called if a picture shall be written and no picture stream is set at
+ class ImplEscherExSdr.
+ */
+ inline SvStream* QueryPictureStream() { return mxGlobal->QueryPictureStream(); }
+
+ /// Inserts internal data into the EscherStream, this process
+ /// may and has to be executed only once
+ /// If pPicStreamMergeBSE is known, the BLIPs from this stream are being
+ /// merged into the MsofbtBSE Records of the EscherStream like it's
+ /// required for Excel (and maybe Word?)
+ virtual void Flush( SvStream* pPicStreamMergeBSE = NULL );
+
+ /** Inserts the passed number of bytes at the current position of the
+ output stream.
+
+ Inserts dummy bytes and moves all following stream data, and updates
+ all internal stream offsets stored in the PersistTable and the affected
+ container sizes, which makes this operation very expensive. (!)
+
+ @param nBytes The number of bytes to be inserted into the stream.
+
+ @param bExpandEndOfAtom If set to true, an atom that currently ends
+ exactly at the current stream position will be expanded to include
+ the inserted data. If set to false, an atom that currently ends
+ exactly at the current stream position will not be expanded to
+ include the inserted data (used to insert e.g. a new atom after an
+ existing atom). Note that containers that end exactly at the
+ current stream position are always expanded to include the inserted
+ data.
+ */
+ void InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom );
+
+ void InsertPersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset ); // It is not being checked if this key is already in the PersistantTable
+ void ReplacePersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset );
+ sal_uInt32 GetPersistOffset( sal_uInt32 nKey );
+ sal_Bool SeekToPersistOffset( sal_uInt32 nKey );
+ virtual sal_Bool InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue ); // nValue is being inserted into the Stream where it's appropriate (overwrite modus), without that the
+ // current StreamPosition changes
+
+ SvStream& GetStream() const { return *mpOutStrm; }
+ sal_uLong GetStreamPos() const { return mpOutStrm->Tell(); }
+
+ // features during the creation of the following Containers:
+ //
+ // ESCHER_DggContainer: a EscherDgg Atom is automatically being created and managed
+ // ESCHER_DgContainer: a EscherDg Atom is automatically being created and managed
+ // ESCHER_SpgrContainer:
+ // ESCHER_SpContainer:
+
+ virtual void OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance = 0 );
+ virtual void CloseContainer();
+
+ virtual void BeginAtom();
+ virtual void EndAtom( sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
+ virtual void AddAtom( sal_uInt32 nAtomSitze, sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
+ virtual void AddChildAnchor( const Rectangle& rRectangle );
+ virtual void AddClientAnchor( const Rectangle& rRectangle );
+
+ virtual sal_uInt32 EnterGroup( const OUString& rShapeName, const Rectangle* pBoundRect = 0 );
+ sal_uInt32 EnterGroup( const Rectangle* pBoundRect = NULL );
+ sal_uInt32 GetGroupLevel() const { return mnGroupLevel; };
+ virtual sal_Bool SetGroupSnapRect( sal_uInt32 nGroupLevel, const Rectangle& rRect );
+ virtual sal_Bool SetGroupLogicRect( sal_uInt32 nGroupLevel, const Rectangle& rRect );
+ virtual void LeaveGroup();
+
+ // a ESCHER_Sp is being written ( a ESCHER_DgContainer has to be opened for this purpose!)
+ virtual void AddShape( sal_uInt32 nShpInstance, sal_uInt32 nFlagIds, sal_uInt32 nShapeID = 0 );
+
+ virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
+
+ sal_uInt32 GetColor( const sal_uInt32 nColor, sal_Bool bSwap = sal_True );
+ sal_uInt32 GetColor( const Color& rColor, sal_Bool bSwap = sal_True );
+
+ // ...Sdr... implemented in eschesdo.cxx
+
+ void AddSdrPage( const SdrPage& rPage );
+ void AddUnoShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
+
+ /// returns the ShapeID
+ sal_uInt32 AddSdrObject( const SdrObject& rObj );
+
+ /// If objects are written through AddSdrObject the
+ /// SolverContainer has to be written, and maybe some
+ /// maintenance to be done.
+ void EndSdrObjectPage();
+
+ /// Called before a shape is written, application supplies
+ /// ClientRecords. May set AppData::bDontWriteShape so the
+ /// shape is ignored.
+ virtual EscherExHostAppData* StartShape(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape,
+ const Rectangle* pChildAnchor );
+
+ /// Called after a shape is written to inform the application
+ /// of the resulted shape type and ID.
+ virtual void EndShape( sal_uInt16 nShapeType, sal_uInt32 nShapeID );
+
+ /// Called before an AdditionalText EnterGroup occurs.
+ /// The current shape will be written in three parts:
+ /// a group shape, the shape itself, and an extra textbox shape.
+ /// The complete flow is:
+ /// StartShape sets HostData1.
+ /// EnterAdditionalTextGroup sets HostData2, App may modify
+ /// HostData1 and keep track of the change.
+ /// The group shape is written with HostData2.
+ /// Another StartShape with the same (!) object sets HostData3.
+ /// The current shape is written with HostData3.
+ /// EndShape is called for the current shape.
+ /// Another StartShape with the same (!) object sets HostData4.
+ /// The textbox shape is written with HostData4.
+ /// EndShape is called for the textbox shape.
+ /// EndShape is called for the group shape, this provides
+ /// the same functionality as an ordinary recursive group.
+ virtual EscherExHostAppData* EnterAdditionalTextGroup();
+
+ /// Called if an ESCHER_Prop_lTxid shall be written
+ virtual sal_uInt32 QueryTextID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >&, sal_uInt32 nShapeId );
+ // add an dummy rectangle shape into the escher stream
+ sal_uInt32 AddDummyShape();
+
+ static const SdrObject* GetSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rXShape );
+
+ void SetHellLayerId( sal_uInt16 nId ) { mnHellLayerId = nId; }
+ sal_uInt16 GetHellLayerId() const { return mnHellLayerId; }
+
+private:
+ EscherEx( const EscherEx& );
+ EscherEx& operator=( const EscherEx& );
+
+ // prevent C-style cast to former base class EscherGraphicProvider
+ operator EscherGraphicProvider&();
+ operator EscherGraphicProvider const&();
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/mscodec.hxx b/include/filter/msfilter/mscodec.hxx
new file mode 100644
index 000000000000..f321441e2941
--- /dev/null
+++ b/include/filter/msfilter/mscodec.hxx
@@ -0,0 +1,370 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVX_MSCODEC_HXX
+#define SVX_MSCODEC_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+
+#include <rtl/cipher.h>
+#include <rtl/digest.h>
+#include "filter/msfilter/msfilterdllapi.h"
+
+namespace msfilter {
+
+// ============================================================================
+
+/** Encodes and decodes data from protected MSO 95- documents.
+ */
+class MSFILTER_DLLPUBLIC MSCodec_Xor95
+{
+public:
+ explicit MSCodec_Xor95(int nRotateDistance);
+ virtual ~MSCodec_Xor95();
+
+ /** Initializes the algorithm with the specified password.
+
+ @param pPassData
+ Character array containing the password. Must be zero terminated,
+ which results in a maximum length of 15 characters.
+ */
+ void InitKey( const sal_uInt8 pnPassData[ 16 ] );
+
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ sal_Bool InitCodec( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aData );
+
+ /** Retrieves the encryption data
+
+ @return
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetEncryptionData();
+
+
+ /** Verifies the validity of the password using the passed key and hash.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param nKey
+ Password key value read from the file.
+ @param nHash
+ Password hash value read from the file.
+
+ @return
+ true = Test was successful.
+ */
+ bool VerifyKey( sal_uInt16 nKey, sal_uInt16 nHash ) const;
+
+ /** Reinitializes the codec to start a new memory block.
+
+ Resets the internal key offset to 0.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+ */
+ void InitCipher();
+
+ /** Decodes a block of memory inplace.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param pnData
+ Encrypted data block. Will contain the decrypted data afterwards.
+ @param nBytes
+ Size of the passed data block.
+ */
+ virtual void Decode( sal_uInt8* pnData, sal_Size nBytes )=0;
+
+ /** Lets the cipher skip a specific amount of bytes.
+
+ This function sets the cipher to the same state as if the specified
+ amount of data has been decoded with one or more calls of Decode().
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param nBytes
+ Number of bytes to be skipped (cipher "seeks" forward).
+ */
+ void Skip( sal_Size nBytes );
+
+protected:
+ sal_uInt8 mpnKey[ 16 ]; /// Encryption key.
+ sal_Size mnOffset; /// Key offset.
+
+private:
+ MSFILTER_DLLPRIVATE MSCodec_Xor95( const MSCodec_Xor95& );
+ MSFILTER_DLLPRIVATE MSCodec_Xor95& operator=( const MSCodec_Xor95& );
+
+ sal_uInt16 mnKey; /// Base key from password.
+ sal_uInt16 mnHash; /// Hash value from password.
+ int mnRotateDistance;
+};
+
+/** Encodes and decodes data from protected MSO XLS 95- documents.
+ */
+class MSFILTER_DLLPUBLIC MSCodec_XorXLS95 : public MSCodec_Xor95
+{
+public:
+ explicit MSCodec_XorXLS95() : MSCodec_Xor95(2) {}
+
+ /** Decodes a block of memory inplace.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param pnData
+ Encrypted data block. Will contain the decrypted data afterwards.
+ @param nBytes
+ Size of the passed data block.
+ */
+ virtual void Decode( sal_uInt8* pnData, sal_Size nBytes );
+};
+
+/** Encodes and decodes data from protected MSO Word 95- documents.
+ */
+class MSFILTER_DLLPUBLIC MSCodec_XorWord95 : public MSCodec_Xor95
+{
+public:
+ explicit MSCodec_XorWord95() : MSCodec_Xor95(7) {}
+
+ /** Decodes a block of memory inplace.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param pnData
+ Encrypted data block. Will contain the decrypted data afterwards.
+ @param nBytes
+ Size of the passed data block.
+ */
+ virtual void Decode( sal_uInt8* pnData, sal_Size nBytes );
+};
+
+
+// ============================================================================
+
+/** Encodes and decodes data from protected MSO 97+ documents.
+
+ This is a wrapper class around low level cryptographic functions from RTL.
+ Implementation is based on the wvDecrypt package by Caolan McNamara:
+ http://www.csn.ul.ie/~caolan/docs/wvDecrypt.html
+ */
+class MSFILTER_DLLPUBLIC MSCodec_Std97
+{
+public:
+ explicit MSCodec_Std97();
+ ~MSCodec_Std97();
+
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ sal_Bool InitCodec( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aData );
+
+ /** Retrieves the encryption data
+
+ @return
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetEncryptionData();
+
+
+ /** Initializes the algorithm with the specified password and document ID.
+
+ @param pPassData
+ Wide character array containing the password. Must be zero
+ terminated, which results in a maximum length of 15 characters.
+ @param pDocId
+ Unique document identifier read from or written to the file.
+ */
+ void InitKey(
+ const sal_uInt16 pPassData[ 16 ],
+ const sal_uInt8 pDocId[ 16 ] );
+
+ /** Verifies the validity of the password using the passed salt data.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param pSaltData
+ Salt data block read from the file.
+ @param pSaltDigest
+ Salt digest read from the file.
+
+ @return
+ true = Test was successful.
+ */
+ bool VerifyKey(
+ const sal_uInt8 pSaltData[ 16 ],
+ const sal_uInt8 pSaltDigest[ 16 ] );
+
+ /** Rekeys the codec using the specified counter.
+
+ After reading a specific amount of data the cipher algorithm needs to
+ be rekeyed using a counter that counts the data blocks.
+
+ The block size is for example 512 Bytes for Word files and 1024 Bytes
+ for Excel files.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param nCounter
+ Block counter used to rekey the cipher.
+ */
+ bool InitCipher( sal_uInt32 nCounter );
+
+ /** Creates an MD5 digest of salt digest. */
+ bool CreateSaltDigest(
+ const sal_uInt8 nSaltData[16], sal_uInt8 nSaltDigest[16] );
+
+ /** Encodes a block of memory.
+
+ @see rtl_cipher_encode()
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used. The destination buffer must be able to take all
+ unencoded data from the source buffer (usually this means it must be
+ as long as or longer than the source buffer).
+
+ @param pData
+ Unencrypted source data block.
+ @param nDatLen
+ Size of the passed source data block.
+ @param pBuffer
+ Destination buffer for the encrypted data.
+ @param nBufLen
+ Size of the destination buffer.
+
+ @return
+ true = Encoding was successful (no error occurred).
+ */
+ bool Encode(
+ const void* pData, sal_Size nDatLen,
+ sal_uInt8* pBuffer, sal_Size nBufLen );
+
+ /** Decodes a block of memory.
+
+ @see rtl_cipher_decode()
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used. The destination buffer must be able to take all
+ encoded data from the source buffer (usually this means it must be
+ as long as or longer than the source buffer).
+
+ @param pData
+ Encrypted source data block.
+ @param nDatLen
+ Size of the passed source data block.
+ @param pBuffer
+ Destination buffer for the decrypted data.
+ @param nBufLen
+ Size of the destination buffer.
+
+ @return
+ true = Decoding was successful (no error occurred).
+ */
+ bool Decode(
+ const void* pData, sal_Size nDatLen,
+ sal_uInt8* pBuffer, sal_Size nBufLen );
+
+ /** Lets the cipher skip a specific amount of bytes.
+
+ This function sets the cipher to the same state as if the specified
+ amount of data has been decoded with one or more calls of Decode().
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param nDatLen
+ Number of bytes to be skipped (cipher "seeks" forward).
+ */
+ bool Skip( sal_Size nDatLen );
+
+ /** Gets salt data and salt digest.
+
+ @precond
+ The codec must be initialized with InitKey() before this function
+ can be used.
+
+ @param pSalt
+ Salt, a random number.
+ @param pSaltData
+ Salt data block generated from the salt.
+ @param pSaltDigest
+ Salt digest generated from the salt.
+ */
+ void GetEncryptKey (
+ const sal_uInt8 pSalt[16],
+ sal_uInt8 pSaltData[16],
+ sal_uInt8 pSaltDigest[16]);
+
+ /* allows to get the unique document id from the codec
+ */
+ void GetDocId( sal_uInt8 pDocId[16] );
+
+ void GetDigestFromSalt( const sal_uInt8 pSaltData[16], sal_uInt8 pDigest[16] );
+
+private:
+ void InitKeyImpl(
+ const sal_uInt8 pKeyData[64],
+ const sal_uInt8 pDocId[16] );
+
+
+private:
+ MSFILTER_DLLPRIVATE MSCodec_Std97( const MSCodec_Std97& );
+ MSFILTER_DLLPRIVATE MSCodec_Std97& operator=( const MSCodec_Std97& );
+
+ rtlCipher m_hCipher;
+ rtlDigest m_hDigest;
+ sal_uInt8 m_pDigestValue[ RTL_DIGEST_LENGTH_MD5 ];
+ sal_uInt8 m_pDocId[16];
+};
+
+// ============================================================================
+
+} // namespace msfilter
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx
new file mode 100644
index 000000000000..6359277f49f4
--- /dev/null
+++ b/include/filter/msfilter/msdffimp.hxx
@@ -0,0 +1,809 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef FLT_MSDFFIMP_HXX
+#define FLT_MSDFFIMP_HXX
+
+#include <string.h>
+
+#include <map>
+#include <vector>
+#include <set>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/ptr_container/ptr_set.hpp>
+
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include <tools/solar.h>
+#include <tools/color.hxx>
+#include <tools/gen.hxx>
+
+#include <sot/storage.hxx>
+
+#include <vcl/graph.hxx>
+
+#include <svx/msdffdef.hxx>
+#include <filter/msfilter/dffpropset.hxx>
+#include <filter/msfilter/dffrecordheader.hxx>
+
+#include <filter/msfilter/msfilterdllapi.h>
+
+class Graphic;
+class SvStream;
+class SdrObject;
+class SdrOle2Obj;
+class SotStorageRef;
+class Polygon;
+class PolyPolygon;
+class FmFormModel;
+class SdrModel;
+class SwFlyFrmFmt;
+
+struct SvxMSDffBLIPInfo;
+struct SvxMSDffShapeInfo;
+struct SvxMSDffShapeOrder;
+
+class SvxMSDffManager;
+class SfxItemSet;
+class SdrObject;
+class SdrTextObj;
+struct DffObjData;
+
+class MSFILTER_DLLPUBLIC DffPropertyReader : public DffPropSet
+{
+ const SvxMSDffManager& rManager;
+ DffPropSet* pDefaultPropSet;
+
+ void ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const;
+ void CheckAndCorrectExcelTextRotation( SvStream& rIn, SfxItemSet& rSet, DffObjData& rObjData ) const;
+ void ApplyCustomShapeAdjustmentAttributes( SfxItemSet& rSet ) const;
+ void ApplyCustomShapeGeometryAttributes( SvStream& rIn,
+ SfxItemSet& rSet,
+ const DffObjData& rObjData ) const;
+ void ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eShapeType ) const; // #i28269#
+ void ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const;
+
+public:
+ sal_Int32 mnFix16Angle;
+ explicit DffPropertyReader( const SvxMSDffManager& rManager );
+ ~DffPropertyReader();
+ sal_Int32 Fix16ToAngle( sal_Int32 nAngle ) const;
+
+#ifdef DBG_CUSTOMSHAPE
+ void ReadPropSet( SvStream& rIn, void* pClientData, sal_uInt32 nShapeType = 0 ) const;
+#else
+ void ReadPropSet( SvStream& rIn, void* pClientData ) const;
+#endif
+
+ void SetDefaultPropSet( SvStream& rIn, sal_uInt32 nOffDgg ) const;
+ void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet ) const;
+ void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObjData& rObjData ) const;
+};
+
+#define COL_DEFAULT RGB_COLORDATA( 0xFA, 0xFB, 0xFC )
+
+typedef ::std::map< sal_Int32, SdrObject* > SvxMSDffShapeIdContainer;
+
+#define SVEXT_PERSIST_STREAM "\002OlePres000"
+
+// the following two will be sorted by the order of their appearance:
+typedef boost::ptr_vector<SvxMSDffBLIPInfo> SvxMSDffBLIPInfos;
+class SvxMSDffShapeOrders : public std::vector<SvxMSDffShapeOrder*>
+{
+public:
+ ~SvxMSDffShapeOrders();
+};
+
+struct MSFILTER_DLLPUBLIC CompareSvxMSDffShapeInfoById
+{
+ bool operator()(::boost::shared_ptr<SvxMSDffShapeInfo> const& lhs,
+ ::boost::shared_ptr<SvxMSDffShapeInfo> const& rhs) const;
+};
+struct MSFILTER_DLLPUBLIC CompareSvxMSDffShapeInfoByTxBxComp
+{
+ bool operator()(::boost::shared_ptr<SvxMSDffShapeInfo> const& lhs,
+ ::boost::shared_ptr<SvxMSDffShapeInfo> const& rhs) const;
+};
+
+// the following will be sorted explicitly:
+typedef ::std::set< ::boost::shared_ptr<SvxMSDffShapeInfo>,
+ CompareSvxMSDffShapeInfoById > SvxMSDffShapeInfos_ById;
+typedef ::std::multiset< ::boost::shared_ptr<SvxMSDffShapeInfo>,
+ CompareSvxMSDffShapeInfoByTxBxComp> SvxMSDffShapeInfos_ByTxBxComp;
+
+#define SVXMSDFF_SETTINGS_CROP_BITMAPS 1
+#define SVXMSDFF_SETTINGS_IMPORT_PPT 2
+#define SVXMSDFF_SETTINGS_IMPORT_EXCEL 4
+
+#define SP_FGROUP 0x001 ///< This shape is a group shape
+#define SP_FCHILD 0x002 ///< Not a top-level shape
+#define SP_FPATRIARCH 0x004 ///< This is the topmost group shape.
+ ///< Exactly one of these per drawing.
+#define SP_FDELETED 0x008 ///< The shape has been deleted
+#define SP_FOLESHAPE 0x010 ///< The shape is an OLE object
+#define SP_FHAVEMASTER 0x020 ///< Shape has a hspMaster property
+#define SP_FFLIPH 0x040 ///< Shape is flipped horizontally
+#define SP_FFLIPV 0x080 ///< Shape is flipped vertically
+#define SP_FCONNECTOR 0x100 ///< Connector type of shape
+#define SP_FHAVEANCHOR 0x200 ///< Shape has an anchor of some kind
+#define SP_FBACKGROUND 0x400 ///< Background shape
+#define SP_FHAVESPT 0x800 ///< Shape has a shape type property
+
+// for the CreateSdrOLEFromStorage we need the information, how we handle
+// convert able OLE-Objects - this ist stored in
+#define OLE_MATHTYPE_2_STARMATH 0x0001
+#define OLE_WINWORD_2_STARWRITER 0x0002
+#define OLE_EXCEL_2_STARCALC 0x0004
+#define OLE_POWERPOINT_2_STARIMPRESS 0x0008
+
+struct SvxMSDffConnectorRule
+{
+ sal_uInt32 nRuleId;
+ sal_uInt32 nShapeA; ///< SPID of shape A
+ sal_uInt32 nShapeB; ///< SPID of shape B
+ sal_uInt32 nShapeC; ///< SPID of connector shape
+ sal_uInt32 ncptiA; ///< Connection site Index of shape A
+ sal_uInt32 ncptiB; ///< Connection site Index of shape B
+ sal_uInt32 nSpFlagsA; ///< SpFlags of shape A (the original mirror flags
+ ///< must be known when solving the Solver Container)
+ sal_uInt32 nSpFlagsB; ///< SpFlags of shape B
+
+ SdrObject* pAObj; ///< pPtr of object (corresponding to shape A)
+ SdrObject* pBObj; ///< pPtr of object (corresponding to shape B)
+ SdrObject* pCObj; ///< pPtr of connector object
+
+ SvxMSDffConnectorRule() : nSpFlagsA( 0 ), nSpFlagsB( 0 ), pAObj( NULL ),
+ pBObj( NULL ), pCObj( NULL ) {};
+
+ friend SvStream& operator>>( SvStream& rIn, SvxMSDffConnectorRule& rAtom );
+};
+
+typedef ::std::vector< SvxMSDffConnectorRule* > SvxMSDffConnectorRuleList;
+
+struct MSFILTER_DLLPUBLIC SvxMSDffSolverContainer
+{
+ SvxMSDffConnectorRuleList aCList;
+
+ SvxMSDffSolverContainer();
+ ~SvxMSDffSolverContainer();
+
+ MSFILTER_DLLPUBLIC friend SvStream& operator>>( SvStream& rIn, SvxMSDffSolverContainer& rAtom );
+};
+
+struct FIDCL
+{
+ sal_uInt32 dgid; ///< DG owning the SPIDs in this cluster
+ sal_uInt32 cspidCur; ///< number of SPIDs used so far
+};
+
+/// provided by SvxMSDffManager for each shape in a group
+struct MSDffTxId
+{
+ sal_uInt16 nTxBxS;
+ sal_uInt16 nSequence;
+ MSDffTxId( sal_uInt16 nTxBxS_, sal_uInt16 nSequence_ )
+ : nTxBxS( nTxBxS_ ), nSequence( nSequence_ ){}
+ MSDffTxId( const MSDffTxId& rCopy )
+ : nTxBxS( rCopy.nTxBxS ), nSequence( rCopy.nSequence ){}
+};
+
+struct MSFILTER_DLLPUBLIC SvxMSDffImportRec
+{
+ static const int RELTO_DEFAULT = 2;
+
+ SdrObject* pObj;
+ Polygon* pWrapPolygon;
+ char* pClientAnchorBuffer;
+ sal_uInt32 nClientAnchorLen;
+ char* pClientDataBuffer;
+ sal_uInt32 nClientDataLen;
+ sal_uInt32 nXAlign;
+ sal_uInt32 *pXRelTo;
+ sal_uInt32 nYAlign;
+ sal_uInt32 *pYRelTo;
+ sal_uInt32 nLayoutInTableCell;
+ sal_uInt32 nFlags;
+ long nTextRotationAngle;
+ long nDxTextLeft; ///< distance of text box from surrounding shape
+ long nDyTextTop;
+ long nDxTextRight;
+ long nDyTextBottom;
+ long nDxWrapDistLeft;
+ long nDyWrapDistTop;
+ long nDxWrapDistRight;
+ long nDyWrapDistBottom;
+ long nCropFromTop;
+ long nCropFromBottom;
+ long nCropFromLeft;
+ long nCropFromRight;
+ MSDffTxId aTextId; ///< identifier for text boxes
+ sal_uLong nNextShapeId; ///< for linked text boxes
+ sal_uLong nShapeId;
+ MSO_SPT eShapeType;
+ MSO_LineStyle eLineStyle; ///< border types
+ MSO_LineDashing eLineDashing;
+ sal_Bool bDrawHell :1;
+ sal_Bool bHidden :1;
+ sal_Bool bReplaceByFly :1;
+ sal_Bool bLastBoxInChain :1;
+ sal_Bool bHasUDefProp :1;
+ sal_Bool bVFlip :1;
+ sal_Bool bHFlip :1;
+ sal_Bool bAutoWidth :1;
+ int relativeHorizontalWidth; ///< in 0.1% or -1 for none
+ bool isHorizontalRule;
+
+ SvxMSDffImportRec();
+ SvxMSDffImportRec(const SvxMSDffImportRec& rCopy);
+ ~SvxMSDffImportRec();
+
+ bool operator==( const SvxMSDffImportRec& rEntry ) const
+ { return nShapeId == rEntry.nShapeId; }
+ bool operator<( const SvxMSDffImportRec& rEntry ) const
+ { return nShapeId < rEntry.nShapeId; }
+
+private:
+ SvxMSDffImportRec &operator=(const SvxMSDffImportRec&);
+};
+
+/** list of all SvxMSDffImportRec instances of/for a group */
+class MSDffImportRecords
+ : public ::boost::ptr_set<SvxMSDffImportRec>
+{};
+
+/** block of parameters for import/export for a single call of
+ ImportObjAtCurrentStreamPos() */
+struct SvxMSDffImportData
+{
+ MSDffImportRecords aRecords; ///< Shape pointer, Shape ids and private data
+ Rectangle aParentRect;///< Rectangle of the surrounding groups,
+ ///< which might have been provided externally
+ Rectangle aNewRect; ///< Rectangle that is defined by this shape
+
+ SvxMSDffImportData()
+ {}
+ explicit SvxMSDffImportData( const Rectangle& rParentRect ) : aParentRect( rParentRect ) {}
+ void SetNewRect(sal_Int32 left, sal_Int32 top, sal_Int32 right, sal_Int32 bottom )
+ { aNewRect = Rectangle(left, top, right, bottom); }
+ sal_Bool HasParRect() const { return aParentRect.IsEmpty(); }
+ sal_Bool HasNewRect() const { return aNewRect.IsEmpty() ; }
+ bool empty() const { return aRecords.empty(); }
+ size_t size() const { return aRecords.size(); }
+ MSDffImportRecords::const_iterator begin() const { return aRecords.begin(); }
+ MSDffImportRecords::const_iterator end() const { return aRecords.end(); }
+};
+
+struct DffObjData
+{
+ const DffRecordHeader& rSpHd;
+
+ Rectangle aBoundRect;
+ Rectangle aChildAnchor;
+
+ sal_uInt32 nShapeId;
+ sal_uInt32 nSpFlags;
+ MSO_SPT eShapeType;
+
+ sal_Bool bShapeType : 1;
+ sal_Bool bClientAnchor : 1;
+ sal_Bool bClientData : 1;
+ sal_Bool bChildAnchor : 1;
+ sal_Bool bOpt : 1;
+ sal_Bool bOpt2 : 1;
+ sal_Bool bIsAutoText : 1;
+ sal_Bool bRotateTextWithShape : 1;
+ bool bPageAnchor;
+ int nCalledByGroup;
+
+ DffObjData( const DffRecordHeader& rObjHd,
+ const Rectangle& rBoundRect,
+ int nClByGroup ) :
+ rSpHd( rObjHd ),
+ aBoundRect( rBoundRect ),
+ nShapeId( 0 ),
+ nSpFlags( 0 ),
+ eShapeType( mso_sptNil ),
+ bShapeType( sal_False ),
+ bClientAnchor( sal_False ),
+ bClientData( sal_False ),
+ bChildAnchor( sal_False ),
+ bOpt( sal_False ),
+ bOpt2( sal_False ),
+ bIsAutoText( sal_False ),
+ bRotateTextWithShape( sal_True ),
+ bPageAnchor( true ),
+ nCalledByGroup( nClByGroup ){}
+};
+
+#define DFF_RECORD_MANAGER_BUF_SIZE 64
+
+struct DffRecordList
+{
+ sal_uInt32 nCount;
+ sal_uInt32 nCurrent;
+ DffRecordList* pPrev;
+ DffRecordList* pNext;
+
+ DffRecordHeader mHd[ DFF_RECORD_MANAGER_BUF_SIZE ];
+
+ explicit DffRecordList( DffRecordList* pList );
+ ~DffRecordList();
+};
+
+enum DffSeekToContentMode
+{
+ SEEK_FROM_BEGINNING,
+ SEEK_FROM_CURRENT,
+ SEEK_FROM_CURRENT_AND_RESTART
+};
+
+class MSFILTER_DLLPUBLIC DffRecordManager : public DffRecordList
+{
+public :
+ DffRecordList* pCList;
+
+ void Clear();
+ void Consume( SvStream& rIn,
+ sal_Bool bAppend = sal_False,
+ sal_uInt32 nStOfs = 0 );
+
+ sal_Bool SeekToContent( SvStream& rIn,
+ sal_uInt16 nRecType,
+ DffSeekToContentMode eMode = SEEK_FROM_BEGINNING );
+ DffRecordHeader* GetRecordHeader( sal_uInt16 nRecType,
+ DffSeekToContentMode eMode = SEEK_FROM_BEGINNING );
+
+ DffRecordManager();
+ explicit DffRecordManager( SvStream& rIn );
+ ~DffRecordManager();
+
+ DffRecordHeader* Current();
+ DffRecordHeader* First();
+ DffRecordHeader* Next();
+ DffRecordHeader* Prev();
+ DffRecordHeader* Last();
+};
+
+/** abstract base class for Escher imports
+
+ Purpose: access to objects in Drawing File Format
+
+ Note: The method ProcessUserDefinedRecord() _has_ to be implemented in the
+ inheriting class(es) that is/are eventually used for PowerPoint, Word,
+ or Excel importing.
+
+ Status: Currently only access to BLIPs (will be extended later)
+*/
+class MSFILTER_DLLPUBLIC SvxMSDffManager : public DffPropertyReader
+{
+ FmFormModel* pFormModel;
+ SvxMSDffBLIPInfos* pBLIPInfos;
+ ::boost::scoped_ptr<SvxMSDffShapeInfos_ByTxBxComp> m_pShapeInfosByTxBxComp;
+ ::boost::scoped_ptr<SvxMSDffShapeInfos_ById> m_pShapeInfosById;
+ SvxMSDffShapeOrders* pShapeOrders;
+ sal_uLong nDefaultFontHeight;
+ sal_uInt32 nOffsDgg;
+ sal_uInt16 nBLIPCount;
+ sal_uInt16 nShapeCount;
+ sal_uInt32 nGroupShapeFlags;
+
+ void CheckTxBxStoryChain();
+ void GetFidclData(sal_uInt32 nOffsDgg);
+
+protected :
+ typedef std::map<sal_uInt32, sal_uInt32> OffsetMap;
+
+ OUString maBaseURL;
+ sal_uInt32 mnCurMaxShapeId; // we need this information to
+ sal_uInt32 mnDrawingsSaved; // access the right drawing
+ sal_uInt32 mnIdClusters; // while only knowing the shapeid
+ std::vector<FIDCL> maFidcls;
+ OffsetMap maDgOffsetTable; ///< array of fileoffsets
+
+ friend class DffPropertyReader;
+
+ SvStream& rStCtrl;
+ SvStream* pStData;
+ SvStream* pStData2;
+ SdrModel* pSdrModel;
+
+ long nMapMul;
+ long nMapDiv;
+ long nMapXOfs;
+ long nMapYOfs;
+ long nEmuMul;
+ long nEmuDiv;
+ long nPntMul;
+ long nPntDiv;
+ bool bNeedMap;
+ sal_uInt32 nSvxMSDffSettings;
+ sal_uInt32 nSvxMSDffOLEConvFlags;
+
+ /** stores a reference to an imported SdrObject
+ with its shape id if it has one */
+ SvxMSDffShapeIdContainer maShapeIdContainer;
+
+ void GetCtrlData(sal_uInt32 nOffsDgg);
+ void GetDrawingGroupContainerData( SvStream& rSt,
+ sal_uLong nLenDgg );
+ // #156763#
+ // Add internal drawing container id as parameter to the sub methods of
+ // reading the control information about the drawing objects.
+ // The drawing container id is used to distinguish the text ids of drawing
+ // objects in different drawing containers.
+ void GetDrawingContainerData( SvStream& rSt,
+ sal_uLong nLenDg,
+ const unsigned long nDrawingContainerId );
+ sal_Bool GetShapeGroupContainerData( SvStream& rSt,
+ sal_uLong nLenShapeGroupCont,
+ sal_Bool bPatriarch,
+ const unsigned long nDrawingContainerId );
+ sal_Bool GetShapeContainerData( SvStream& rSt,
+ sal_uLong nLenShapeCont,
+ sal_uLong nPosGroup,
+ const unsigned long nDrawingContainerId );
+
+ bool ReadGraphic( SvStream& rSt, sal_uLong nIndex, Graphic& rGraphic ) const;
+ SdrObject* ImportGraphic( SvStream&, SfxItemSet&, const DffObjData& );
+ // #i32596# - pass <nCalledByGroup> to method
+ // Needed in Writer's Microsoft Word import to avoid import of OLE objects
+ // inside groups. Instead a graphic object is created.
+ virtual SdrObject* ImportOLE( long nOLEId,
+ const Graphic& rGraf,
+ const Rectangle& rBoundRect,
+ const Rectangle& rVisArea,
+ const int _nCalledByGroup,
+ sal_Int64 nAspect ) const;
+ static com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > CheckForConvertToSOObj(
+ sal_uInt32 nConvertFlags, SotStorage& rSrcStg,
+ const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xDestStg,
+ const Graphic& rGrf,
+ const Rectangle& rVisArea );
+
+// the following methods need to be overriden for Excel imports
+ virtual sal_Bool ProcessClientAnchor( SvStream& rStData,
+ sal_uInt32 nDatLen,
+ char*& rpBuff,
+ sal_uInt32& rBuffLen ) const;
+ virtual void ProcessClientAnchor2( SvStream& rStData,
+ DffRecordHeader& rHd,
+ void* pData, DffObjData& );
+ virtual sal_Bool ProcessClientData( SvStream& rStData,
+ sal_uInt32 nDatLen,
+ char*& rpBuff,
+ sal_uInt32& rBuffLen ) const;
+ virtual SdrObject* ProcessObj( SvStream& rSt,
+ DffObjData& rData,
+ void* pData,
+ Rectangle& rTextRect,
+ SdrObject* pObj = NULL);
+ virtual sal_uLong Calc_nBLIPPos( sal_uLong nOrgVal,
+ sal_uLong nStreamPos ) const;
+ virtual bool GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const;
+
+ // Fontwork objects use a new implementation of ReadObjText because the old
+ // one does not properly import multiple paragraphs.
+ static void ReadObjText( const OUString& rText, SdrObject* pObj );
+
+// the following method needs to be overridden for the import of OLE objects
+ virtual sal_Bool GetOLEStorageName( long nOLEId,
+ OUString& rStorageName,
+ SotStorageRef& rSrcStorage,
+ com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xDestStg
+ ) const;
+
+ /** Prevent that (rounded) rectangles with wrapped text will always be
+ converted into SdrRectObj( OBJ_TEXT ).
+
+ @return sal_True means "conversion".
+ */
+ virtual sal_Bool ShapeHasText(sal_uLong nShapeId, sal_uLong nFilePos) const;
+
+public:
+ DffPropertyReader* pSecPropSet;
+ std::map<sal_uInt32,OString> aEscherBlipCache;
+
+ DffRecordManager maShapeRecords;
+ ColorData mnDefaultColor;
+
+ sal_Bool mbTracing;
+
+ Color MSO_TEXT_CLR_ToColor( sal_uInt32 nColorCode ) const;
+ Color MSO_CLR_ToColor( sal_uInt32 nColorCode,
+ sal_uInt16 nContextProperty = DFF_Prop_lineColor ) const;
+ virtual sal_Bool SeekToShape( SvStream& rSt,
+ void* pClientData,
+ sal_uInt32 nId ) const;
+ bool SeekToRec( SvStream& rSt,
+ sal_uInt16 nRecId,
+ sal_uLong nMaxFilePos,
+ DffRecordHeader* pRecHd = NULL,
+ sal_uLong nSkipCount = 0 ) const;
+ bool SeekToRec2( sal_uInt16 nRecId1,
+ sal_uInt16 nRecId2,
+ sal_uLong nMaxFilePos,
+ DffRecordHeader* pRecHd = NULL,
+ sal_uLong nSkipCount = 0 ) const;
+
+ static OUString MSDFFReadZString( SvStream& rIn,
+ sal_uInt32 nMaxLen,
+ bool bUniCode = sal_False);
+
+ static bool ReadCommonRecordHeader( SvStream& rSt,
+ sal_uInt8& rVer,
+ sal_uInt16& rInst,
+ sal_uInt16& rFbt,
+ sal_uInt32& rLength) SAL_WARN_UNUSED_RESULT;
+
+// TODO: provide proper documentation here
+ /** constructor
+
+ sets nBLIPCount
+
+ @param rStCtrl Management stream with containers, FBSE
+ objects and shapes (mandatory; stream needs
+ to be open already)
+ @param rBaseURL ???
+ @param nOffsDgg offset in rStrCtrl; beginning of the drawing
+ group container
+ @param pStData data stream in that the BLIPs are stored (if
+ NULL it is assumed that all BLIPs are also in
+ the rStCtrl; stream needs to be open already)
+ @param pSdrModel_ ??? (can be empty during Ctor call but needs
+ to be set via SetModel() later in that case!)
+ @param nApplicationScale ???
+ @param mnDefaultColor_ ???
+ @param nDefaultFontHeight_ ???
+ @param pStData2_ ???
+ */
+ SvxMSDffManager( SvStream& rStCtrl,
+ const OUString& rBaseURL,
+ sal_uInt32 nOffsDgg,
+ SvStream* pStData,
+ SdrModel* pSdrModel_ = 0,
+ long nApplicationScale = 0,
+ ColorData mnDefaultColor_ = COL_DEFAULT,
+ sal_uLong nDefaultFontHeight_ = 24,
+ SvStream* pStData2_ = 0 );
+
+ // in PPT the parameters DGGContainerOffset and PicStream are provided by an
+ // init method
+ SvxMSDffManager( SvStream& rStCtrl, const OUString& rBaseURL );
+ void InitSvxMSDffManager( sal_uInt32 nOffsDgg_,
+ SvStream* pStData_,
+ sal_uInt32 nSvxMSDffOLEConvFlags);
+ void SetDgContainer( SvStream& rSt );
+
+ virtual ~SvxMSDffManager();
+
+ sal_uInt32 GetSvxMSDffSettings() const { return nSvxMSDffSettings; };
+ void SetSvxMSDffSettings( sal_uInt32 nSettings ) { nSvxMSDffSettings = nSettings; };
+
+ static sal_Bool MakeContentStream( SotStorage * pStor, const GDIMetaFile & );
+ static void ReadObjText( SvStream& rStream, SdrObject* pObj );
+ static sal_Bool ConvertToOle2( SvStream& rStm,
+ sal_uInt32 nLen,
+ const GDIMetaFile*,
+ const SotStorageRef & rDest );
+
+ void SetModel(SdrModel* pModel, long nApplicationScale);
+ SdrModel* GetModel() const { return pSdrModel; }
+ void Scale(sal_Int32& rVal) const;
+ void Scale(Point& rPos) const;
+ void Scale(Size& rSiz) const;
+ void ScaleEmu(sal_Int32& rVal) const;
+ sal_uInt32 ScalePt( sal_uInt32 nPt ) const;
+ sal_Int32 ScalePoint( sal_Int32 nVal ) const;
+
+// TODO: provide proper documentation here
+ /** Request for a specific BLIP.
+
+ @param[in] nIdx number of the requested BLIP (mandatory)
+ @param[out] rData already converted data (insert directly as graphics
+ into our documents)
+ @param pVisArea ???
+
+ @return sal_True if successful, sal_False otherwise
+ */
+ sal_Bool GetBLIP( sal_uLong nIdx, Graphic& rData, Rectangle* pVisArea = NULL );
+
+// TODO: provide proper documentation here
+ /** read a BLIP out of a already positioned stream
+
+ @param[in] rBLIPStream alread positioned stream (mandatory)
+ @param[out] rData already converted data (insert directly as
+ graphics into our documents)
+ @param pVisArea ???
+
+ @return sal_True if successful, sal_False otherwise
+ */
+ sal_Bool GetBLIPDirect(SvStream& rBLIPStream, Graphic& rData, Rectangle* pVisArea = NULL ) const;
+
+ sal_Bool GetShape(sal_uLong nId, SdrObject*& rpData, SvxMSDffImportData& rData);
+
+ /** Get count of managed BLIPs
+
+ @return Number of BLIPs in pStData (or rStCtrl), thus number of FBSEs in
+ the drawing group container. If 0 is returned this means that
+ the structure is ok but there are no BLIPs; if USHRT_MAX is
+ returned than there was an error: no correct Drawing File Format
+ */
+ sal_uInt16 GetBLIPCount() const{ return nBLIPCount; }
+
+ SdrObject* ImportObj( SvStream& rSt,
+ void* pData,
+ Rectangle& rClientRect,
+ const Rectangle& rGlobalChildRect,
+ int nCalledByGroup = 0,
+ sal_Int32* pShapeId = NULL);
+ SdrObject* ImportGroup( const DffRecordHeader& rHd,
+ SvStream& rSt,
+ void* pData,
+ Rectangle& rClientRect,
+ const Rectangle& rGlobalChildRect,
+ int nCalledByGroup = 0,
+ sal_Int32* pShapeId = NULL );
+ SdrObject* ImportShape( const DffRecordHeader& rHd,
+ SvStream& rSt,
+ void* pData,
+ Rectangle& rClientRect,
+ const Rectangle& rGlobalChildRect,
+ int nCalledByGroup = 0,
+ sal_Int32* pShapeId = NULL);
+
+ Rectangle GetGlobalChildAnchor( const DffRecordHeader& rHd,
+ SvStream& rSt,
+ Rectangle& aClientRect );
+ void GetGroupAnchors( const DffRecordHeader& rHd,
+ SvStream& rSt,
+ Rectangle& rGroupClientAnchor,
+ Rectangle& rGroupChildAnchor,
+ const Rectangle& rClientRect,
+ const Rectangle& rGlobalChildRect );
+
+ inline const SvxMSDffShapeInfos_ById* GetShapeInfos( void ) const
+ { return m_pShapeInfosById.get(); }
+
+ inline const SvxMSDffShapeOrders* GetShapeOrders( void ) const
+ { return pShapeOrders; }
+
+ void StoreShapeOrder(sal_uLong nId,
+ sal_uLong nTxBx,
+ SdrObject* pObject,
+ SwFlyFrmFmt* pFly = 0,
+ short nHdFtSection = 0) const;
+
+ void ExchangeInShapeOrder(SdrObject* pOldObject,
+ sal_uLong nTxBx,
+ SwFlyFrmFmt* pFly,
+ SdrObject* pObject) const;
+
+ void RemoveFromShapeOrder( SdrObject* pObject ) const;
+
+ sal_uInt32 GetConvertFlags() const { return nSvxMSDffOLEConvFlags; }
+
+ static SdrOle2Obj* CreateSdrOLEFromStorage( const OUString& rStorageName,
+ SotStorageRef& rSrcStorage,
+ const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xDestStg,
+ const Graphic& rGraf,
+ const Rectangle& rBoundRect,
+ const Rectangle& rVisArea,
+ SvStream* pDataStrrm,
+ ErrCode& rError,
+ sal_uInt32 nConvertFlags,
+ sal_Int64 nAspect );
+
+ /** Create connections between shapes.
+ This method should be called after a page is imported.
+
+ @param rSolver contains necessary data that is collected during the
+ import of each shape
+ */
+ void SolveSolver( const SvxMSDffSolverContainer& rSolver );
+
+ static sal_Bool SetPropValue(
+ const ::com::sun::star::uno::Any& rAny,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ const OUString& rPropertyName,
+ sal_Bool bTestPropertyAvailability = sal_False
+ );
+
+ void insertShapeId( sal_Int32 nShapeId, SdrObject* pShape );
+ void removeShapeId( SdrObject* pShape );
+ SdrObject* getShapeForId( sal_Int32 nShapeId );
+};
+
+struct SvxMSDffBLIPInfo
+{
+ sal_uInt16 nBLIPType; ///< type of BLIP: e.g. 6 for PNG
+ sal_uLong nFilePos; ///< offset of the BLIP in data strem
+ sal_uLong nBLIPSize; ///< number of bytes that the BLIP needs in stream
+ SvxMSDffBLIPInfo(sal_uInt16 nBType, sal_uLong nFPos, sal_uLong nBSize):
+ nBLIPType( nBType ), nFilePos( nFPos ), nBLIPSize( nBSize ){}
+};
+
+struct SvxMSDffShapeInfo
+{
+ sal_uInt32 nShapeId; ///< shape id, used in PLCF SPA and in mso_fbtSp (FSP)
+ sal_uLong nFilePos; ///< offset of the shape in control stream for
+ ///< potential later access to it
+ sal_uInt32 nTxBxComp;
+
+ sal_Bool bReplaceByFly :1; ///< shape can be replaced by a frame in Writer
+ sal_Bool bLastBoxInChain:1;
+
+ explicit SvxMSDffShapeInfo(sal_uLong nFPos, sal_uInt32 nId=0, // sal_uLong nBIdx=0,
+ sal_uInt16 nSeqId=0, sal_uInt16 nBoxId=0):
+ nShapeId( nId ),
+ nFilePos( nFPos ),
+ nTxBxComp( (nSeqId << 16) + nBoxId )
+ {
+ bReplaceByFly = sal_False;
+ bLastBoxInChain = sal_True;
+ }
+ SvxMSDffShapeInfo(SvxMSDffShapeInfo& rInfo):
+ nShapeId( rInfo.nShapeId ),
+ nFilePos( rInfo.nFilePos ),
+ nTxBxComp( rInfo.nTxBxComp )
+ {
+ bReplaceByFly = rInfo.bReplaceByFly;
+ bLastBoxInChain = rInfo.bLastBoxInChain;
+ }
+};
+
+
+struct SvxMSDffShapeOrder
+{
+ sal_uLong nShapeId; ///< shape id used in PLCF SPA and in mso_fbtSp (FSP)
+ sal_uLong nTxBxComp; ///< chain or box number in the Text-Box-Story (or NULL)
+ SwFlyFrmFmt* pFly; ///< format of frame that was inserted as a replacement
+ ///< for a Sdr-Text object in Writer - needed for
+ ///< chaining!
+ short nHdFtSection; ///< used by Writer to find out if linked frames are in
+ ///< the same header or footer of the same section
+ SdrObject* pObj; ///< pointer to the draw object (or NULL if not used)
+
+ // Approach: In the Ctor of SvxMSDffManager only the shape ids are stored in
+ // the shape order array. The Text-Box number and the object
+ // pointer are only stored if the shape is really imported.
+ explicit SvxMSDffShapeOrder( sal_uLong nId ):
+ nShapeId( nId ), nTxBxComp( 0 ), pFly( 0 ), nHdFtSection( 0 ), pObj( 0 ){}
+
+ bool operator==( const SvxMSDffShapeOrder& rEntry ) const
+ { return (nTxBxComp == rEntry.nTxBxComp); }
+ bool operator<( const SvxMSDffShapeOrder& rEntry ) const
+ { return (nTxBxComp < rEntry.nTxBxComp); }
+};
+
+// the following will be sorted explicitly:
+struct CompareSvxMSDffShapeTxBxSort
+{
+ bool operator()( SvxMSDffShapeOrder* const& lhs, SvxMSDffShapeOrder* const& rhs ) const { return (*lhs)<(*rhs); }
+};
+class MSFILTER_DLLPUBLIC SvxMSDffShapeTxBxSort : public std::set<SvxMSDffShapeOrder*,CompareSvxMSDffShapeTxBxSort> {};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/msfilterdllapi.h b/include/filter/msfilter/msfilterdllapi.h
new file mode 100644
index 000000000000..03816baa92fc
--- /dev/null
+++ b/include/filter/msfilter/msfilterdllapi.h
@@ -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_MSFILTER_DLLAPI_H
+#define INCLUDED_MSFILTER_DLLAPI_H
+
+#include "sal/types.h"
+
+#if defined MSFILTER_DLLIMPLEMENTATION
+#define MSFILTER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define MSFILTER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#define MSFILTER_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/msocximex.hxx b/include/filter/msfilter/msocximex.hxx
new file mode 100644
index 000000000000..79815e49126e
--- /dev/null
+++ b/include/filter/msfilter/msocximex.hxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _MSOCXIMEX_HXX
+#define _MSOCXIMEX_HXX
+
+#include <sot/storage.hxx>
+
+#include "filter/msfilter/msfilterdllapi.h"
+
+namespace com{namespace sun{namespace star{
+ namespace drawing{
+ class XDrawPage;
+ class XShape;
+ class XShapes;
+ }
+ namespace form{
+ class XFormComponent;
+ }
+ namespace lang{
+ class XMultiServiceFactory;
+ }
+ namespace container{
+ class XIndexContainer;
+ class XNameContainer;
+ }
+ namespace beans{
+ class XPropertySet;
+ }
+ namespace text{
+ class XText;
+ }
+ namespace awt{
+ struct Size;
+ class XControlModel;
+ }
+ namespace uno{
+ class XComponentContext;
+ }
+ namespace frame{
+ class XModel;
+ }
+
+}}}
+
+class SfxObjectShell;
+
+class MSFILTER_DLLPUBLIC SvxMSConvertOCXControls
+{
+public:
+ SvxMSConvertOCXControls( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
+ virtual ~SvxMSConvertOCXControls();
+
+ virtual sal_Bool InsertControl(
+ const com::sun::star::uno::Reference<
+ com::sun::star::form::XFormComponent >& /*rFComp*/,
+ const com::sun::star::awt::Size& /*rSize*/,
+ com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShape >* /*pShape*/,
+ sal_Bool /*bFloatingCtrl*/ ) {return sal_False;}
+
+ /*begin: Backwards compatability with office 95 import, modify later*/
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > & GetServiceFactory();
+protected:
+ const com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > &
+ GetShapes();
+
+ const com::sun::star::uno::Reference<
+ com::sun::star::container::XIndexContainer > & GetFormComps();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
+
+ // gecachte Interfaces
+ com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >
+ xDrawPage;
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >
+ xShapes;
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceFactory;
+
+ // das einzige Formular
+ com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >
+ xFormComps;
+
+ virtual const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XDrawPage > & GetDrawPage();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/msoleexp.hxx b/include/filter/msfilter/msoleexp.hxx
new file mode 100644
index 000000000000..468fa6284513
--- /dev/null
+++ b/include/filter/msfilter/msoleexp.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 _MSOLEEXP_HXX
+#define _MSOLEEXP_HXX
+
+#include <com/sun/star/uno/Reference.h>
+#include "filter/msfilter/msfilterdllapi.h"
+
+// for the CreateSdrOLEFromStorage we need the information, how we handle
+// convert able OLE-Objects - this ist stored in
+#define OLE_STARMATH_2_MATHTYPE 0x0001
+#define OLE_STARWRITER_2_WINWORD 0x0002
+#define OLE_STARCALC_2_EXCEL 0x0004
+#define OLE_STARIMPRESS_2_POWERPOINT 0x0008
+
+class SotStorage;
+
+#include <svtools/embedhlp.hxx>
+
+class MSFILTER_DLLPUBLIC SvxMSExportOLEObjects
+{
+ sal_uInt32 nConvertFlags;
+public:
+ SvxMSExportOLEObjects( sal_uInt32 nCnvrtFlgs ) : nConvertFlags(nCnvrtFlgs) {}
+
+ void SetFlags( sal_uInt32 n ) { nConvertFlags = n; }
+ sal_uInt32 GetFlags() const { return nConvertFlags; }
+
+ void ExportOLEObject( svt::EmbeddedObjectRef& rObj, SotStorage& rDestStg );
+ void ExportOLEObject( const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject>& rObj, SotStorage& rDestStg );
+};
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/mstoolbar.hxx b/include/filter/msfilter/mstoolbar.hxx
new file mode 100644
index 000000000000..fc80f3115177
--- /dev/null
+++ b/include/filter/msfilter/mstoolbar.hxx
@@ -0,0 +1,359 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Noel Power <noel.power@novell.com>
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Noel Power <noel.power@novell.com>
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _MSTOOLBAR_HXX
+#define _MSTOOLBAR_HXX
+#include "filter/msfilter/msfilterdllapi.h"
+#include <sot/storage.hxx>
+#include <ostream>
+#include <memory>
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/ui/ImageType.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <vcl/bitmap.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+class TBCHeader;
+
+
+class MSOCommandConvertor
+{
+public:
+ virtual ~MSOCommandConvertor() {}
+ virtual OUString MSOCommandToOOCommand( sal_Int16 msoCmd ) = 0;
+ virtual OUString MSOTCIDToOOCommand( sal_Int16 msoTCID ) = 0;
+};
+
+class SfxObjectShell;
+
+class MSFILTER_DLLPUBLIC CustomToolBarImportHelper
+{
+ struct iconcontrolitem
+ {
+ OUString sCommand;
+ css::uno::Reference< css::graphic::XGraphic > image;
+ };
+ std::vector< iconcontrolitem > iconcommands;
+ std::auto_ptr< MSOCommandConvertor > pMSOCmdConvertor;
+ css::uno::Reference< css::ui::XUIConfigurationManagerSupplier > m_xCfgSupp;
+ css::uno::Reference< css::ui::XUIConfigurationManager > m_xAppCfgMgr;
+ SfxObjectShell& mrDocSh;
+ void ScaleImage( css::uno::Reference< css::graphic::XGraphic >& xGraphic, long nNewSize );
+public:
+ CustomToolBarImportHelper( SfxObjectShell& rDocSh, const css::uno::Reference< css::ui::XUIConfigurationManager >& rxAppCfgMgr );
+
+ void setMSOCommandMap( MSOCommandConvertor* pCnvtr ) { pMSOCmdConvertor.reset( pCnvtr ); }
+ css::uno::Reference< css::ui::XUIConfigurationManager > getCfgManager();
+ css::uno::Reference< css::ui::XUIConfigurationManager > getAppCfgManager();
+
+
+ css::uno::Any createCommandFromMacro( const OUString& sCmd );
+
+ void addIcon( const css::uno::Reference< css::graphic::XGraphic >& xImage, const OUString& sString );
+ void applyIcons();
+ OUString MSOCommandToOOCommand( sal_Int16 msoCmd );
+ OUString MSOTCIDToOOCommand( sal_Int16 msoTCID );
+ SfxObjectShell& GetDocShell() { return mrDocSh; }
+ bool createMenu( const OUString& rName, const css::uno::Reference< css::container::XIndexAccess >& xMenuDesc, bool bPersist );
+};
+
+class MSFILTER_DLLPUBLIC TBBase
+{
+friend class Indent;
+ static int nIndent; // num spaces to indent before printing
+protected:
+ void indent_printf(FILE* fp, const char* format, ... );
+ sal_uInt32 nOffSet; // usually for debug we can store the offset in the stream to this record
+public:
+ TBBase() : nOffSet( 0 ) {}
+ virtual ~TBBase(){}
+
+ virtual bool Read(SvStream &rS) = 0;
+ virtual void Print( FILE* ) {} // #FIXME remove this an implement the debug routines in all the classes below to enable some sort of readable output
+ sal_uInt32 GetOffset() { return nOffSet; }
+};
+
+class Indent
+{
+public:
+ Indent( bool binit = false )
+ {
+ if ( binit )
+ init();
+ else
+ TBBase::nIndent = TBBase::nIndent + 2;
+ }
+ ~Indent() { TBBase::nIndent = TBBase::nIndent - 2; }
+ void init() { TBBase::nIndent = 0; }
+};
+
+
+class MSFILTER_DLLPUBLIC WString : public TBBase
+{
+ OUString sString;
+
+public:
+ WString(){};
+ ~WString(){};
+ bool Read(SvStream &rS);
+ OUString getString(){ return sString; }
+};
+
+class MSFILTER_DLLPUBLIC TBCExtraInfo : public TBBase
+{
+ WString wstrHelpFile;
+ sal_Int32 idHelpContext;
+ WString wstrTag;
+ WString wstrOnAction;
+ WString wstrParam;
+ sal_Int8 tbcu;
+ sal_Int8 tbmg;
+
+ TBCExtraInfo(const TBCExtraInfo&);
+ TBCExtraInfo& operator = ( const TBCExtraInfo&);
+public:
+ TBCExtraInfo();
+ ~TBCExtraInfo(){}
+ bool Read(SvStream &rS);
+ void Print( FILE* );
+ OUString getOnAction();
+};
+
+class MSFILTER_DLLPUBLIC TBCGeneralInfo : public TBBase
+{
+ sal_uInt8 bFlags;
+ WString customText;
+ WString descriptionText;
+ WString tooltip;
+ TBCExtraInfo extraInfo;
+
+public:
+ TBCGeneralInfo();
+ ~TBCGeneralInfo() {}
+ bool Read(SvStream &rS);
+ void Print( FILE* );
+ bool ImportToolBarControlData( CustomToolBarImportHelper&, std::vector< css::beans::PropertyValue >& );
+ OUString CustomText() { return customText.getString(); }
+ OUString DescriptionText() { return descriptionText.getString(); }
+ OUString Tooltip() { return tooltip.getString(); }
+};
+
+class MSFILTER_DLLPUBLIC TBCBitMap : public TBBase
+{
+friend class TBCBSpecific; // #FIXME hacky access, need to fix
+ sal_Int32 cbDIB;
+ Bitmap mBitMap;
+public:
+ TBCBitMap();
+ ~TBCBitMap();
+ bool Read(SvStream &rS);
+ void Print( FILE* );
+ Bitmap& getBitMap();
+};
+
+class MSFILTER_DLLPUBLIC TBCMenuSpecific : public TBBase
+{
+ sal_Int32 tbid;
+ boost::shared_ptr< WString > name; //exist only if tbid equals 0x00000001
+public:
+ TBCMenuSpecific();
+ ~TBCMenuSpecific(){}
+ bool Read(SvStream &rS);
+ void Print( FILE* );
+ OUString Name();
+};
+
+class MSFILTER_DLLPUBLIC TBCCDData : public TBBase
+{
+ sal_Int16 cwstrItems; //Signed integer that specifies the number of items in wstrList. MUST be positive.
+ std::vector< WString > wstrList; // Zero-based index array of WString structures. Number of elements MUST be equal to cwstrItems.
+ sal_Int16 cwstrMRU; // Signed integer that specifies the number of most recently used string
+ sal_Int16 iSel ; // Signed integer that specifies the zero-based index of the selected item in the wstrList field. MUST be equal to 0xFFFF (-1) or greater than or equal to 0x0000.
+ sal_Int16 cLines; // Signed integer that specifies the suggested number of lines that the toolbar control will display at any time when displaying the elements of wstrList of available items.
+ sal_Int16 dxWidth; // Signed integer that specifies the width in pixels that the interior of the dropdown has. This excludes the width of the toolbar control border and scroll bar.
+ WString wstrEdit; //Structure of type WString. Editable text for editable area of the ComboBox toolbar control.
+
+public:
+ TBCCDData();
+ ~TBCCDData();
+ bool Read(SvStream &rS);
+ void Print( FILE* );
+};
+
+class TBCComboDropdownSpecific : public TBBase
+{
+ boost::shared_ptr< TBCCDData > data;
+public:
+ TBCComboDropdownSpecific( const TBCHeader& header );
+ TBCComboDropdownSpecific(){}
+ bool Read(SvStream &rS);
+ void Print( FILE* );
+};
+
+class TBCBSpecific : public TBBase
+{
+ sal_uInt8 bFlags;
+ boost::shared_ptr< TBCBitMap > icon; // optional
+ boost::shared_ptr< TBCBitMap > iconMask; // optional
+ boost::shared_ptr< sal_uInt16 > iBtnFace; // optional
+ boost::shared_ptr< WString > wstrAcc; // optional
+
+public:
+ TBCBSpecific();
+ ~TBCBSpecific(){}
+ bool Read(SvStream &rS);
+ void Print( FILE* );
+ // #TODO just add a getGraphic member here
+ TBCBitMap* getIcon();
+ TBCBitMap* getIconMask();
+ sal_uInt16* getBtnFace() { return iBtnFace.get(); }
+};
+
+/* TBCHeader.tct controlSpecificInfo type
+
+0x01 (Button control) TBCBSpecific
+0x10 (ExpandingGrid control) TBCBSpecific
+0x0A (Popup control) TBCMenuSpecific
+0x0C (ButtonPopup control) TBCMenuSpecific
+0x0D (SplitButtonPopup control) TBCMenuSpecific
+0x0E (SplitButtonMRUPopup control) TBCMenuSpecific
+0x02 (Edit control) TBCComboDropdow nSpecific
+0x04 (ComboBox control) TBCComboDropdow nSpecific
+0x14 (GraphicCombo control) TBCComboDropdow nSpecific
+0x03 (DropDown control) TBCComboDropdow nSpecific
+0x06 (SplitDropDown control) TBCComboDropdow nSpecific
+0x09 (GraphicDropDown control) TBCComboDropdow nSpecific
+0x07 (OCXDropDown control) controlSpecificInfo MUST NOT exist
+0x0F (Label control) controlSpecificInfo MUST NOT exist
+0x12 (Grid control) controlSpecificInfo MUST NOT exist
+0x13 (Gauge control) controlSpecificInfo MUST NOT exist
+0x16 (ActiveX control) controlSpecificInfo MUST NOT exist
+
+*/
+class MSFILTER_DLLPUBLIC TBCHeader : public TBBase
+{
+ sal_Int8 bSignature;
+ sal_Int8 bVersion;
+ sal_uInt8 bFlagsTCR;
+ sal_uInt8 tct;
+ sal_uInt16 tcid;
+ sal_uInt32 tbct;
+ sal_uInt8 bPriority;
+ boost::shared_ptr< sal_uInt16 > width; //optional
+ boost::shared_ptr< sal_uInt16 > height; //optional
+
+public:
+ TBCHeader();
+ ~TBCHeader();
+ sal_uInt8 getTct() const { return tct; }
+ sal_uInt16 getTcID() const { return tcid; }
+ bool isVisible() { return !( bFlagsTCR & 0x1 ); }
+ bool isBeginGroup() { return ( bFlagsTCR & 0x2 ); }
+ bool Read(SvStream &rS);
+ void Print( FILE* );
+ sal_uInt32 getTbct() { return tbct; };
+};
+
+class MSFILTER_DLLPUBLIC TBCData : public TBBase
+{
+ TBCHeader rHeader;
+ TBCGeneralInfo controlGeneralInfo;
+ boost::shared_ptr< TBBase > controlSpecificInfo; // can be one of TBCBSpecific, TBCMenuSpecific or TBCComboDropdow nSpecific depending on the control type specified by TBCHeader.tct
+ TBCData(const TBCData&);
+ TBCData& operator = ( const TBCData&);
+public:
+ TBCData( const TBCHeader& Header );
+ ~TBCData(){}
+ bool Read(SvStream &rS);
+ void Print( FILE* );
+ bool ImportToolBarControl( CustomToolBarImportHelper&, std::vector< css::beans::PropertyValue >&, bool& bBeginGroup, bool bIsMenuBar );
+ TBCGeneralInfo& getGeneralInfo() { return controlGeneralInfo; }
+ TBCMenuSpecific* getMenuSpecific();
+};
+
+class MSFILTER_DLLPUBLIC TB : public TBBase
+{
+ sal_uInt8 bSignature;// Signed integer that specifies the toolbar signature number. MUST be 0x02.
+ sal_uInt8 bVersion; // Signed integer that specifies the toolbar version number. MUST be 0x01.
+ sal_Int16 cCL; // Signed integer that SHOULD specify the number of toolbar controls contained in this toolbar.
+ sal_Int32 ltbid;// Signed integer that specifies the toolbar ID. MUST be 0x0001 (custom toolbar ID).
+ sal_uInt32 ltbtr;// Unsigned integer of type TBTRFlags that specifies the toolbar type and toolbar restrictions.
+ sal_uInt16 cRowsDefault;// Unsigned integer that specifies the number of preferred rows for the toolbar when the toolbar is not docked. MUST be less than or equal to 255.
+ sal_uInt16 bFlags; //Unsigned integer of type TBFlags.
+ WString name; //Structure of type WString that specifies the toolbar name
+public:
+ TB();
+ ~TB(){}
+ bool Read(SvStream &rS);
+ void Print( FILE* );
+ sal_Int16 getcCL(){ return cCL; }
+ WString& getName(){ return name; }
+ bool IsEnabled();
+ bool IsMenuToolbar(){ return ( ( ltbtr & 0x2000000 ) == 0x2000000 ); }
+};
+
+class MSFILTER_DLLPUBLIC SRECT : public TBBase
+{
+public:
+ SRECT() : left(0), top(0), right(0), bottom(0) {}
+ sal_Int16 left;
+ sal_Int16 top;
+ sal_Int16 right;
+ sal_Int16 bottom;
+ bool Read( SvStream &rS ) { rS >> left >> top >> right >> bottom; return true; }
+ void Print( FILE* fo );
+};
+
+typedef cppu::WeakImplHelper1< css::container::XIndexContainer > PropertyValueIndexContainer_BASE;
+
+class MSFILTER_DLLPUBLIC TBVisualData : public TBBase
+{
+ sal_Int8 tbds;
+ sal_Int8 tbv;
+ sal_Int8 tbdsDock;
+ sal_Int8 iRow;
+
+ SRECT rcDock;
+ SRECT rcFloat;
+
+public:
+ TBVisualData();
+ ~TBVisualData(){}
+ bool Read(SvStream &rS);
+ void Print( FILE* );
+};
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/msvbahelper.hxx b/include/filter/msfilter/msvbahelper.hxx
new file mode 100644
index 000000000000..bafcc461a598
--- /dev/null
+++ b/include/filter/msfilter/msvbahelper.hxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _MSVBAHELPER_HXX
+#define _MSVBAHELPER_HXX
+
+#include <sfx2/objsh.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/script/vba/XVBAMacroResolver.hpp>
+#include <com/sun/star/awt/KeyEvent.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include "filter/msfilter/msfilterdllapi.h"
+namespace ooo {
+namespace vba {
+
+// ============================================================================
+
+struct MSFILTER_DLLPUBLIC MacroResolvedInfo
+{
+ SfxObjectShell* mpDocContext;
+ OUString msResolvedMacro;
+ bool mbFound;
+
+ inline explicit MacroResolvedInfo( SfxObjectShell* pDocContext = 0 ) : mpDocContext( pDocContext ), mbFound( false ) {}
+};
+
+MSFILTER_DLLPUBLIC OUString makeMacroURL( const OUString& sMacroName );
+MSFILTER_DLLPUBLIC OUString extractMacroName( const OUString& rMacroUrl );
+MSFILTER_DLLPUBLIC OUString getDefaultProjectName( SfxObjectShell* pShell );
+MSFILTER_DLLPUBLIC OUString resolveVBAMacro( SfxObjectShell* pShell, const OUString& rLibName, const OUString& rModuleName, const OUString& rMacroName );
+MSFILTER_DLLPUBLIC MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const OUString& rMacroName, bool bSearchGlobalTemplates = false );
+MSFILTER_DLLPUBLIC sal_Bool executeMacro( SfxObjectShell* pShell, const OUString& sMacroName, com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArgs, com::sun::star::uno::Any& aRet, const com::sun::star::uno::Any& aCaller );
+MSFILTER_DLLPUBLIC ::com::sun::star::awt::KeyEvent parseKeyEvent( const OUString& sKey ) throw (::com::sun::star::uno::RuntimeException);
+MSFILTER_DLLPUBLIC void applyShortCutKeyBinding ( const ::com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxDoc, const ::com::sun::star::awt::KeyEvent& rKeyEvent, const OUString& sMacro ) throw (::com::sun::star::uno::RuntimeException);
+// ============================================================================
+
+typedef ::cppu::WeakImplHelper3<
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::script::vba::XVBAMacroResolver > VBAMacroResolverBase;
+
+class VBAMacroResolver : public VBAMacroResolverBase
+{
+public:
+ explicit VBAMacroResolver();
+ virtual ~VBAMacroResolver();
+
+ // com.sun.star.lang.XServiceInfo interface -------------------------------
+
+ virtual OUString SAL_CALL
+ getImplementationName() throw (::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL
+ supportsService( const OUString& rService )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
+ getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
+
+ // com.sun.star.lang.XInitialization interface ----------------------------
+
+ virtual void SAL_CALL initialize(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rArgs )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // com.sun.star.script.vba.XVBAMacroResolver interface --------------------
+
+ virtual OUString SAL_CALL
+ resolveVBAMacroToScriptURL( const OUString& rVBAMacroName )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ virtual OUString SAL_CALL
+ resolveScriptURLtoVBAMacro( const OUString& rScriptURL )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
+ SfxObjectShell* mpObjShell;
+ OUString maProjectName;
+};
+
+// ============================================================================
+
+} // namespace vba
+} // namespace ooo
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/rtfutil.hxx b/include/filter/msfilter/rtfutil.hxx
new file mode 100644
index 000000000000..b8d3c2c6d8ca
--- /dev/null
+++ b/include/filter/msfilter/rtfutil.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/.
+ */
+
+#ifndef INCLUDED_MSFILTER_RTFUTIL_HXX
+#define INCLUDED_MSFILTER_RTFUTIL_HXX
+
+#include "filter/msfilter/msfilterdllapi.h"
+#include <rtl/string.hxx>
+#include <rtl/textenc.h>
+#include <tools/string.hxx>
+
+namespace msfilter {
+namespace rtfutil {
+
+/// Outputs a single character in hex form.
+MSFILTER_DLLPUBLIC OString OutHex(sal_uLong nHex, sal_uInt8 nLen);
+
+/// Handles correct unicode and legacy export of a single character.
+MSFILTER_DLLPUBLIC OString OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc, bool* pSuccess = 0, bool bUnicode = true);
+
+/**
+ * Handles correct unicode and legacy export of a string.
+ *
+ * @param rStr the string to export
+ * @param eDestEnc the legacy encoding to use
+ * @param bUnicode if unicode output is wanted as well, or just legacy
+ */
+MSFILTER_DLLPUBLIC OString OutString(const String &rStr, rtl_TextEncoding eDestEnc, bool bUnicode = true);
+
+/**
+ * Handles correct unicode and legacy export of a string, when a
+ * '{' \upr '{' keyword ansi_text '}{\*' \ud '{' keyword Unicode_text '}}}'
+ * construct should be used.
+ *
+ * @param pToken the keyword
+ * @param rStr the text to export
+ * @param eDestEnc the legacy encoding to use
+ */
+MSFILTER_DLLPUBLIC OString OutStringUpr(const sal_Char *pToken, const String &rStr, rtl_TextEncoding eDestEnc);
+
+}
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx
new file mode 100644
index 000000000000..2fbf096aec58
--- /dev/null
+++ b/include/filter/msfilter/svdfppt.hxx
@@ -0,0 +1,1564 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDFPPT_HXX
+#define _SVDFPPT_HXX
+
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <tools/gen.hxx>
+#include <tools/color.hxx>
+#include <svx/svdobj.hxx>
+#include <editeng/numitem.hxx>
+#include <editeng/editdata.hxx>
+#include <filter/msfilter/msdffimp.hxx>
+#include <filter/msfilter/msocximex.hxx>
+#include <editeng/eeitem.hxx>
+#define ITEMID_FIELD EE_FEATURE_FIELD
+#include <editeng/flditem.hxx>
+#undef ITEMID_FIELD
+#include "filter/msfilter/msfilterdllapi.h"
+#include <vcl/font.hxx>
+#include <vector>
+#include <boost/optional.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
+
+class SdrModel;
+class SdPage;
+class SdrPage;
+class SdrObject;
+class SvStream;
+class Polygon;
+class PolyPolygon;
+class SfxItemSet;
+class Outliner;
+class Graphic;
+class SvxMSDffManager;
+class PPTTextObj;
+class DffRecordHeader;
+class SvxBulletItem;
+
+#define PPT_IMPORTFLAGS_NO_TEXT_ASSERT 1
+
+struct MSFILTER_DLLPUBLIC PptCurrentUserAtom
+{
+ sal_uInt32 nMagic;
+ sal_uInt32 nCurrentUserEdit;
+ sal_uInt16 nDocFileVersion;
+ sal_uInt8 nMajorVersion;
+ sal_uInt8 nMinorVersion;
+ OUString aCurrentUser;
+
+public:
+
+ PptCurrentUserAtom() : nMagic ( 0 ),
+ nCurrentUserEdit ( 0 ),
+ nDocFileVersion ( 0 ),
+ nMajorVersion ( 0 ),
+ nMinorVersion ( 0 ) {}
+
+ MSFILTER_DLLPUBLIC friend SvStream& operator>>( SvStream& rIn, PptCurrentUserAtom& rAtom );
+};
+
+struct MSFILTER_DLLPUBLIC PowerPointImportParam
+{
+ SvStream& rDocStream;
+ sal_uInt32 nImportFlags;
+ PptCurrentUserAtom aCurrentUserAtom;
+
+ PowerPointImportParam( SvStream& rDocStream, sal_uInt32 nImportFlags );
+};
+
+struct SdHyperlinkEntry
+{
+ sal_uInt32 nIndex;
+ sal_Int32 nPrivate1;
+ sal_Int32 nPrivate2;
+ sal_Int32 nPrivate3;
+ sal_Int32 nInfo;
+ OUString aTarget;
+ OUString aSubAdress;
+
+ sal_Int32 nStartPos;
+ sal_Int32 nEndPos;
+
+ OUString aConvSubString;
+ ESelection aESelection;
+ sal_Bool bSelection;
+};
+
+// Hilfsklasse zum Einlesen der PPT InteractiveInfoAtom
+struct MSFILTER_DLLPUBLIC PptInteractiveInfoAtom
+{
+ sal_uInt32 nSoundRef;
+ sal_uInt32 nExHyperlinkId;
+ sal_uInt8 nAction;
+ sal_uInt8 nOleVerb;
+ sal_uInt8 nJump;
+ sal_uInt8 nFlags;
+ sal_uInt8 nHyperlinkType;
+
+ // unknown, da Gesamtgroesse 16 ist
+ sal_uInt8 nUnknown1;
+ sal_uInt8 nUnknown2;
+ sal_uInt8 nUnknown3;
+
+public:
+
+ MSFILTER_DLLPUBLIC friend SvStream& operator>>( SvStream& rIn, PptInteractiveInfoAtom& rAtom );
+};
+
+enum PptPageKind { PPT_MASTERPAGE, PPT_SLIDEPAGE, PPT_NOTEPAGE };
+
+enum PptPageFormat
+{ PPTPF_SCREEN, //
+ PPTPF_USLETTER, // 8.5x11"
+ PPTPF_A4, // 210x297mm
+ PPTPF_35MMDIA, // DIA
+ PPTPF_OVERHEAD, //
+ PPTPF_CUSTOM
+};
+
+// Werte fuer den sal_uLong im PPT_PST_TextHeaderAtom
+enum PPT_TextHeader
+{
+ PPTTH_TITLE,
+ PPTTH_BODY,
+ PPTTH_NOTES,
+ PPTTH_NOTUSED,
+ PPTTH_OTHER, // Text in a Shape
+ PPTTH_CENTERBODY, // Subtitle in Title-Slide
+ PPTTH_CENTERTITLE, // Title in Title-Slide
+ PPTTH_HALFBODY, // Body in two-column slide
+ PPTTH_QUARTERBODY // Body in four-body slide
+};
+
+#define TSS_TYPE_PAGETITLE (0)
+#define TSS_TYPE_BODY (1)
+#define TSS_TYPE_NOTES (2)
+#define TSS_TYPE_UNUSED (3)
+#define TSS_TYPE_TEXT_IN_SHAPE (4)
+#define TSS_TYPE_SUBTITLE (5)
+#define TSS_TYPE_TITLE (6)
+#define TSS_TYPE_HALFBODY (7)
+#define TSS_TYPE_QUARTERBODY (8)
+
+// Inventor-Id fuer PPT UserData
+const sal_uInt32 PPTInventor = sal_uInt32('P') * 0x00000001
+ + sal_uInt32('P') * 0x00000100
+ + sal_uInt32('T') * 0x00010000
+ + sal_uInt32('0') * 0x01000000;
+
+// Object-Ids fuer StarDraw UserData
+#define PPT_OBJECTINFO_ID (1)
+
+struct MSFILTER_DLLPUBLIC PptDocumentAtom
+{
+ Size aSlidesPageSize; // page size of the slides in 576DPI
+ Size aNotesPageSize; // page size of the notes in 576DPI
+ // RatioAtom erstmal weggelassen
+ sal_uInt32 nNotesMasterPersist; // 0=non-existent
+ sal_uInt32 nHandoutMasterPersist; // 0=non-existent
+ sal_uInt16 n1stPageNumber; // page number of the first slide
+ PptPageFormat eSlidesPageFormat; // page format of the slides
+ sal_Bool bEmbeddedTrueType : 1; // TrueType direcly within the File?
+ sal_Bool bTitlePlaceholdersOmitted : 1;
+ sal_Bool bRightToLeft : 1;
+ sal_Bool bShowComments : 1;
+
+public:
+
+ Size GetPageSize( const Size& rSiz ) const;
+ Size GetSlidesPageSize() const { return GetPageSize( aSlidesPageSize ); }
+ Size GetNotesPageSize() const { return GetPageSize( aNotesPageSize ); }
+
+ friend SvStream& operator>>( SvStream& rIn, PptDocumentAtom& rAtom );
+};
+
+struct PptSlideLayoutAtom
+{
+ sal_Int32 eLayout; // 0..18
+ sal_uInt8 aPlaceholderId[ 8 ];
+ sal_uLong aPlacementId[ 8 ];
+
+public:
+ PptSlideLayoutAtom() { Clear(); }
+ void Clear();
+
+ // Das SlideLayoutAtom wird ohne Header eingelesen!
+ friend SvStream& operator>>( SvStream& rIn, PptSlideLayoutAtom& rAtom );
+};
+
+struct PptSlideAtom
+{
+ PptSlideLayoutAtom aLayout;
+ sal_uInt32 nMasterId;
+ sal_uInt32 nNotesId;
+ sal_uInt16 nFlags;
+
+public:
+ PptSlideAtom() { Clear(); }
+ void Clear();
+
+ friend SvStream& operator>>(SvStream& rIn, PptSlideAtom& rAtom);
+};
+
+struct PptSlidePersistAtom
+{
+ sal_uInt32 nPsrReference;
+ sal_uInt32 nFlags;
+ sal_uInt32 nNumberTexts;
+ sal_uInt32 nSlideId;
+ sal_uInt32 nReserved; // we will use nReserved temporarly to set the offset to SSSlideInfoAtom ( if possible )
+
+public:
+ PptSlidePersistAtom() { Clear(); }
+ void Clear();
+
+ friend SvStream& operator>>(SvStream& rIn, PptSlidePersistAtom& rAtom);
+};
+
+struct PptNotesAtom
+{
+ sal_uInt32 nSlideId;
+ sal_uInt16 nFlags;
+
+public:
+ PptNotesAtom() { Clear(); }
+ void Clear();
+
+ friend SvStream& operator>>(SvStream& rIn, PptNotesAtom& rAtom);
+};
+
+struct PptColorSchemeAtom
+{
+ sal_uInt8 aData[32];
+
+public:
+ PptColorSchemeAtom () { Clear(); }
+ void Clear();
+ Color GetColor( sal_uInt16 nNum ) const;
+
+ friend SvStream& operator>>(SvStream& rIn, PptColorSchemeAtom& rAtom);
+};
+
+struct PptFontEntityAtom
+{
+ OUString aName;
+ double fScaling;
+ sal_uInt8 lfClipPrecision;
+ sal_uInt8 lfQuality;
+
+ sal_uInt32 nUniqueFontId; // not used anymore
+ CharSet eCharSet;
+ FontFamily eFamily;
+ FontPitch ePitch;
+ sal_Bool bAvailable;
+
+ friend SvStream& operator>>(SvStream& rIn, PptFontEntityAtom& rAtom);
+};
+
+class PptFontCollection;
+struct PptUserEditAtom
+{
+ DffRecordHeader aHd;
+ sal_Int32 nLastSlideID; // ID of last visible slide
+ sal_uInt32 nVersion; // This is major/minor/build which did the edit
+ sal_uInt32 nOffsetLastEdit; // File offset of prev PptUserEditAtom
+ sal_uInt32 nOffsetPersistDirectory; // Offset to PersistPtrs for this file version.
+ sal_uInt32 nDocumentRef;
+ sal_uInt32 nMaxPersistWritten; // total number of Persist entries up to this point
+ sal_Int16 eLastViewType; // enum view type
+
+public:
+ PptUserEditAtom() : nOffsetPersistDirectory( 0 ) {}
+
+ friend SvStream& operator>>( SvStream& rIn, PptUserEditAtom& rAtom );
+};
+
+struct PptOEPlaceholderAtom
+{
+ sal_uInt32 nPlacementId;
+ sal_uInt8 nPlaceholderId;
+ sal_uInt8 nPlaceholderSize; // 0=Full size, 1=Half size, 2=Quarter of Slide
+
+public:
+ PptOEPlaceholderAtom() { Clear(); }
+ void Clear();
+
+ friend SvStream& operator>>( SvStream& rIn, PptOEPlaceholderAtom& rAtom );
+};
+
+struct ProcessData;
+struct PPTStyleSheet;
+struct HeaderFooterEntry;
+struct PptSlidePersistEntry
+{
+ PptSlidePersistAtom aPersistAtom;
+ PptSlideAtom aSlideAtom;
+ PptNotesAtom aNotesAtom;
+ PptColorSchemeAtom aColorScheme; // each slide includes this colorscheme atom
+ PPTStyleSheet* pStyleSheet; // stylesheet of this page ( only in masterpages ), since XP supports more than one masterpage
+
+ sal_uInt32 HeaderFooterOfs[ 4 ]; // containing the ofs to the placeholder (only masterpage)
+ HeaderFooterEntry* pHeaderFooterEntry;
+ SvxMSDffSolverContainer* pSolverContainer;
+ sal_uInt32 nSlidePersistStartOffset;// is an array to the end of the SlidePersistAtom of this page, TextHeaderAtom is following
+ sal_uInt32 nSlidePersistEndOffset;
+ sal_uInt32 nBackgroundOffset; // fileoffset
+ sal_uInt32 nDrawingDgId; // valid, if not -1
+ sal_uInt32* pPresentationObjects; // if valid, this is a pointer to an array that includes the offsets to the presentation objects
+ // on this masterpage for each instance ( 0 - 8 );
+ SdrObject* pBObj;
+ sal_Bool bBObjIsTemporary;
+
+ PptPageKind ePageKind; //
+
+ sal_Bool bNotesMaster : 1; // for NotesMaster
+ sal_Bool bHandoutMaster : 1; // for HandoutMaster
+ sal_Bool bStarDrawFiller : 1; // special for StarDraw
+public:
+ PptSlidePersistEntry();
+ ~PptSlidePersistEntry();
+ sal_uInt32 GetSlideId() const { return aPersistAtom.nSlideId; }
+};
+
+class _PptSlidePersistList : public std::vector<PptSlidePersistEntry*>
+{
+public:
+ ~_PptSlidePersistList()
+ {
+ for( const_iterator it = begin(); it != end(); ++it )
+ delete *it;
+ }
+};
+
+#define PPTSLIDEPERSIST_ENTRY_NOTFOUND 0xFFFF
+
+class MSFILTER_DLLPUBLIC PptSlidePersistList: public _PptSlidePersistList
+{
+public:
+ sal_uInt16 FindPage( sal_uInt32 nId ) const;
+};
+
+class SfxObjectShell;
+struct PPTOleEntry
+{
+ sal_uInt32 nId; // OleId
+ sal_uInt32 nPersistPtr; // PersistPtr
+ sal_uInt32 nRecHdOfs; // points to the record header: ExObjListHd
+ SfxObjectShell* pShell;
+ sal_uInt16 nType; // maybe PPT_PST_ExEmbed or PPT_PST_ExControl
+ sal_uInt32 nAspect; // the aspect of the OLE object
+
+ PPTOleEntry( sal_uInt32 nid, sal_uInt32 nOfs, SfxObjectShell* pSh, sal_uInt16 nT, sal_uInt32 nAsp ) :
+ nId ( nid ),
+ nRecHdOfs ( nOfs ),
+ pShell ( pSh ),
+ nType ( nT ),
+ nAspect ( nAsp ) {}
+};
+
+struct PptExOleObjAtom
+{
+ sal_uInt32 nAspect;
+ sal_uInt32 nId;
+ sal_uInt32 nPersistPtr;
+
+public:
+
+ friend SvStream& operator>>( SvStream& rIn, PptExOleObjAtom& rAtom );
+};
+
+typedef ::std::vector< PPTOleEntry* > PPTOleEntryList;
+class PPTExtParaProv;
+class MSFILTER_DLLPUBLIC SdrEscherImport : public SvxMSDffManager
+{
+protected:
+
+ friend class PPTTextObj;
+ friend class PPTPortionObj;
+ friend struct PPTStyleTextPropReader;
+ friend class ImplSdPPTImport;
+
+ PptDocumentAtom aDocAtom;
+ DffRecordManager aDocRecManager; // contains all first level container and atoms of the document container
+
+ PPTOleEntryList aOleObjectList; // contains PPTOleEntrys
+
+ PptFontCollection* pFonts;
+
+ sal_uInt32 nStreamLen;
+ sal_uInt16 nTextStylesIndex;
+
+ CharSet eCharSetSystem;
+
+ sal_Bool bWingdingsChecked : 1;
+ sal_Bool bWingdingsAvailable : 1;
+ sal_Bool bMonotypeSortsChecked : 1;
+ sal_Bool bMonotypeSortsAvailable : 1;
+ sal_Bool bTimesNewRomanChecked : 1;
+ sal_Bool bTimesNewRomanAvailable : 1;
+
+ sal_Bool ReadString( OUString& rStr ) const;
+ // nur fuer PowerPoint-Filter:
+ virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const;
+
+public:
+ using SvxMSDffManager::ReadObjText;
+
+ PowerPointImportParam& rImportParam;
+
+ SdrEscherImport( PowerPointImportParam&, const OUString& rBaseURL );
+ virtual ~SdrEscherImport();
+ virtual bool GetColorFromPalette( sal_uInt16 nNum, Color& rColor ) const;
+ virtual sal_Bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const;
+ PptFontEntityAtom* GetFontEnityAtom( sal_uInt32 nNum ) const;
+ void RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic& rGraph );
+ virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPage* pPage ) const;
+ virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, Rectangle& rTextRect, SdrObject* pObj );
+ virtual void ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, void* pData, DffObjData& rObj );
+ void ImportHeaderFooterContainer( DffRecordHeader& rHeader, HeaderFooterEntry& rEntry );
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define SD_HEADERFOOTER_DATE 1
+#define SD_HEADERFOOTER_TODAYDATE 2
+#define SD_HEADERFOOTER_USERDATE 4
+#define SD_HEADERFOOTER_SLIDENUMBER 8
+#define SD_HEADERFOOTER_HEADER 16
+#define SD_HEADERFOOTER_FOOTER 32
+
+class SvxFieldItem;
+struct MSFILTER_DLLPUBLIC PPTFieldEntry
+{
+ sal_uInt16 nPos;
+ sal_uInt16 nTextRangeEnd;
+ SvxFieldItem* pField1;
+ SvxFieldItem* pField2;
+ OUString* pString;
+
+ PPTFieldEntry() : nPos( 0 ), nTextRangeEnd( 0 ), pField1( NULL ), pField2( NULL ), pString( NULL ) {};
+ ~PPTFieldEntry();
+
+ void SetDateTime( sal_uInt32 nType );
+
+ // converting PPT date time format:
+ static void GetDateTime(
+ const sal_uInt32 nVal,
+ SvxDateFormat& eDateFormat,
+ SvxTimeFormat& eTimeFormat
+ );
+};
+
+struct MSFILTER_DLLPUBLIC HeaderFooterEntry
+{
+ const PptSlidePersistEntry* pMasterPersist;
+ OUString pPlaceholder[ 4 ];
+ sal_uInt32 nAtom;
+
+ sal_uInt32 GetMaskForInstance( sal_uInt32 nInstance );
+ sal_uInt32 IsToDisplay( sal_uInt32 nInstance );
+ sal_uInt32 NeedToImportInstance(
+ const sal_uInt32 nInstance,
+ const PptSlidePersistEntry& rSlidePersist
+ );
+
+ explicit HeaderFooterEntry( const PptSlidePersistEntry* pMaster = NULL );
+ ~HeaderFooterEntry();
+};
+
+struct ProcessData
+{
+ PptSlidePersistEntry& rPersistEntry;
+ SdPage* pPage;
+ ::std::vector< SdrObject* > aBackgroundColoredObjects;
+ sal_uInt32* pTableRowProperties;
+
+ ProcessData( PptSlidePersistEntry& rP, SdPage* pP ) :
+ rPersistEntry ( rP ),
+ pPage ( pP ),
+ pTableRowProperties ( NULL ) {};
+ ~ProcessData() { delete[] pTableRowProperties; };
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+typedef ::std::vector< SdHyperlinkEntry* > SdHyperlinkEntryList;
+class SdrTextObj;
+class SfxObjectShell;
+
+class MSFILTER_DLLPUBLIC SdrPowerPointImport : public SdrEscherImport
+{
+protected:
+
+ friend class PPTTextObj;
+ friend class PPTExtParaProv;
+ friend struct PPTStyleSheet;
+ friend class PPTNumberFormatCreator;
+
+ sal_Bool bOk;
+ PptUserEditAtom aUserEditAtom;
+ PptColorSchemeAtom aPageColors;
+ SdHyperlinkEntryList aHyperList;
+ sal_uInt32* pPersistPtr;
+ sal_uLong nPersistPtrAnz;
+
+ const PPTStyleSheet* pPPTStyleSheet; // this is the current stylesheet;
+ const PPTStyleSheet* pDefaultSheet; // this is a sheet we are using if no masterpage can be found, but that should
+ // never happen just preventing a crash
+ PptSlidePersistList* pMasterPages;
+ PptSlidePersistList* pSlidePages;
+ PptSlidePersistList* pNotePages;
+ sal_uInt16 nAktPageNum;
+ sal_uLong nDocStreamPos;
+ sal_uInt16 nPageColorsNum;
+ PptPageKind ePageColorsKind;
+ PptPageKind eAktPageKind;
+
+protected:
+ using SdrEscherImport::ReadObjText;
+
+ sal_Bool SeekToAktPage(DffRecordHeader* pRecHd=NULL) const;
+ sal_Bool SeekToDocument(DffRecordHeader* pRecHd=NULL) const;
+ sal_Bool SeekToContentOfProgTag(
+ sal_Int32 nVersion,
+ SvStream& rSt,
+ const DffRecordHeader& rProgTagBinaryDataHd,
+ DffRecordHeader& rContentHd
+ );
+ virtual SdrObject* ApplyTextObj(
+ PPTTextObj* pTextObj,
+ SdrTextObj* pText,
+ SdPage* pPage,
+ SfxStyleSheet*,
+ SfxStyleSheet** )
+ const;
+ virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPage* pPage ) const;
+ // #i32596# - new parameter <_nCalledByGroup>, which
+ // indicates, if the OLE object is imported inside a group object.
+ virtual SdrObject* ImportOLE(
+ long nOLEId,
+ const Graphic& rGraf,
+ const Rectangle& rBoundRect,
+ const Rectangle& rVisArea,
+ const int _nCalledByGroup,
+ sal_Int64 nAspect
+ ) const;
+ SvMemoryStream* ImportExOleObjStg( sal_uInt32 nPersistPtr, sal_uInt32& nOleId ) const;
+ SdrPage* MakeBlancPage(sal_Bool bMaster) const;
+ sal_Bool ReadFontCollection();
+ sal_Bool ForceFontCollection() const
+ { return pFonts!=NULL?sal_True:((SdrPowerPointImport*)this)->ReadFontCollection(); }
+ PptSlidePersistList* GetPageList(PptPageKind ePageKind) const;
+ sal_uInt32 GetAktPageId();
+ sal_uInt32 GetMasterPageId(sal_uInt16 nPageNum, PptPageKind ePageKind) const;
+ sal_uInt32 GetNotesPageId(sal_uInt16 nPageNum ) const;
+ SdrOutliner* GetDrawOutliner( SdrTextObj* pSdrText ) const;
+ void SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOptions );
+
+public:
+ SdrPowerPointImport( PowerPointImportParam&, const OUString& rBaseURL );
+ virtual ~SdrPowerPointImport();
+ sal_uInt16 GetPageCount( PptPageKind eKind = PPT_SLIDEPAGE ) const;
+ void SetPageNum( sal_uInt16 nPageNum, PptPageKind = PPT_SLIDEPAGE );
+ sal_uInt16 GetPageNum() const { return nAktPageNum; }
+ PptPageKind GetPageKind() const { return eAktPageKind; }
+ Size GetPageSize() const;
+ SdrObject* ImportPageBackgroundObject(
+ const SdrPage& rPage,
+ sal_uInt32& nBgFileOffset,
+ sal_Bool bForce
+ );
+ sal_Bool IsNoteOrHandout( sal_uInt16 nPageNum, PptPageKind ePageKind ) const;
+ sal_Bool HasMasterPage(
+ sal_uInt16 nPageNum,
+ PptPageKind ePageKind = PPT_SLIDEPAGE
+ ) const;
+ sal_uInt16 GetMasterPageIndex(
+ sal_uInt16 nPageNum,
+ PptPageKind ePageKind = PPT_SLIDEPAGE
+ ) const;
+
+ void ImportPage( SdrPage* pPage, const PptSlidePersistEntry* pMasterPersist = NULL );
+ virtual bool GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const;
+ virtual sal_Bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const;
+ sal_Unicode PPTSubstitute(
+ sal_uInt16 nFont,
+ sal_Unicode nChar,
+ sal_uInt32& nMappedFontId,
+ Font& rFont,
+ char nDefault
+ ) const;
+ const PptDocumentAtom& GetDocumentAtom() const { return aDocAtom; }
+ virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const;
+ SdrObject* CreateTable(
+ SdrObject* pGroupObject,
+ sal_uInt32* pTableArry,
+ SvxMSDffSolverContainer*
+ );
+ virtual bool ReadFormControl( SotStorageRef& rSrc1, com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rFormComp ) const = 0;
+};
+
+struct PPTTextCharacterStyleAtomInterpreter
+{
+ sal_uInt16 nFlags1;
+ sal_uInt16 nFlags2;
+ sal_uInt16 nFlags3;
+ sal_Int32 n1;
+ sal_uInt16 nFontHeight;
+ sal_Int32 nFontColor;
+
+ PPTTextCharacterStyleAtomInterpreter();
+ ~PPTTextCharacterStyleAtomInterpreter();
+
+ sal_Bool Read( SvStream& rIn, const DffRecordHeader& rRecHd );
+
+ sal_uInt32 GetColor( sal_uInt32 nDefault );
+};
+
+struct PPTTextParagraphStyleAtomInterpreter
+{
+ sal_Bool bValid;
+ sal_Bool bForbiddenRules;
+ sal_Bool bHangingPunctuation;
+ sal_Bool bLatinTextWrap;
+
+ PPTTextParagraphStyleAtomInterpreter();
+ ~PPTTextParagraphStyleAtomInterpreter();
+
+ sal_Bool Read( SvStream& rIn, const DffRecordHeader& rRecHd );
+};
+
+struct PPTTextSpecInfo
+{
+ sal_uInt32 nCharIdx;
+ sal_uInt16 nLanguage[ 3 ];
+ sal_uInt16 nDontKnow;
+
+ explicit PPTTextSpecInfo( sal_uInt32 nCharIdx );
+ ~PPTTextSpecInfo();
+};
+
+typedef ::std::vector< PPTTextSpecInfo* > PPTTextSpecInfoList;
+struct PPTTextSpecInfoAtomInterpreter
+{
+ sal_Bool bValid;
+ PPTTextSpecInfoList aList;
+
+ PPTTextSpecInfoAtomInterpreter();
+ ~PPTTextSpecInfoAtomInterpreter();
+
+ sal_Bool Read(
+ SvStream& rIn,
+ const DffRecordHeader& rRecHd,
+ sal_uInt16 nRecordType,
+ const PPTTextSpecInfo* pTextSpecDefault = NULL
+ );
+
+};
+
+#define PPT_STYLESHEETENTRYS 9
+
+struct PPTExtParaLevel
+{
+ sal_uInt32 mnExtParagraphMask;
+ sal_uInt16 mnBuBlip;
+ sal_uInt16 mnHasAnm;
+ sal_uInt32 mnAnmScheme;
+ sal_uInt32 mpfPP10Ext;
+ sal_uInt32 mnExtCharacterMask;
+ sal_uInt32 mcfPP10Ext;
+ sal_Bool mbSet;
+
+ PPTExtParaLevel();
+ friend SvStream& operator>>( SvStream& rIn, PPTExtParaLevel& rL );
+};
+
+struct PPTExtParaSheet
+{
+ PPTExtParaLevel aExtParaLevel[ 5 ];
+};
+
+struct PPTBuGraEntry
+{
+ sal_uInt32 nInstance;
+ Graphic aBuGra;
+
+ PPTBuGraEntry( Graphic& rGraphic, sal_uInt32 nInstance );
+};
+
+typedef ::std::vector< PPTBuGraEntry* > PPTBuGraEntryList;
+
+class PPTExtParaProv
+{
+ PPTBuGraEntryList aBuGraList;
+
+public :
+ sal_Bool bStyles;
+ sal_Bool bGraphics;
+ DffRecordManager aExtendedPresRules;
+
+ PPTExtParaSheet aExtParaSheet[ PPT_STYLESHEETENTRYS ];
+
+ sal_Bool GetGraphic( sal_uInt32 nInstance, Graphic& rGraphic ) const;
+
+ PPTExtParaProv(
+ SdrPowerPointImport& rManager,
+ SvStream& rSt,
+ const DffRecordHeader* pMainMasterHd
+ );
+ ~PPTExtParaProv();
+};
+
+struct PPTCharLevel
+{
+ Color mnFontColorInStyleSheet;
+ sal_uInt32 mnFontColor;
+ sal_uInt16 mnFlags;
+ sal_uInt16 mnFont;
+ sal_uInt16 mnAsianOrComplexFont;
+ sal_uInt16 mnFontHeight;
+ sal_uInt16 mnEscapement;
+};
+
+struct PPTCharSheet
+{
+ PPTCharLevel maCharLevel[ 5 ];
+
+ explicit PPTCharSheet( sal_uInt32 nInstance );
+ PPTCharSheet( const PPTCharSheet& rCharSheet );
+
+ void Read( SvStream& rIn, sal_Bool bMasterStyle, sal_uInt32 nLevel, sal_Bool bFirst );
+};
+
+struct PPTParaLevel
+{
+ sal_uInt16 mnBuFlags;
+ sal_uInt16 mnBulletChar;
+ sal_uInt16 mnBulletFont;
+ sal_uInt16 mnBulletHeight;
+ sal_uInt32 mnBulletColor;
+
+ sal_uInt16 mnAdjust;
+ sal_uInt16 mnLineFeed;
+ sal_uInt16 mnUpperDist;
+ sal_uInt16 mnLowerDist;
+ sal_uInt16 mnTextOfs;
+ sal_uInt16 mnBulletOfs;
+ sal_uInt16 mnDefaultTab;
+ sal_uInt16 mnAsianLineBreak; // bit0: use asian rules for first and last character
+ // 1: do not wrap latin text in the middle of the word
+ // 2: allow hanging punctuation
+ sal_uInt16 mnBiDi;
+};
+
+struct PPTParaSheet
+{
+public:
+
+ PPTParaLevel maParaLevel[ 5 ];
+
+ explicit PPTParaSheet( sal_uInt32 nInstance );
+ PPTParaSheet( const PPTParaSheet& rParaSheet );
+
+ void Read(
+ SdrPowerPointImport& rMan,
+ SvStream& rIn,
+ sal_Bool bMasterStyle,
+ sal_uInt32 nLevel,
+ sal_Bool bFirst
+ );
+ void UpdateBulletRelSize( sal_uInt32 nLevel, sal_uInt16 nFontHeight );
+};
+
+class PPTParagraphObj;
+class PPTNumberFormatCreator
+{
+ sal_uInt32 nIsBullet;
+ sal_uInt32 nBulletChar;
+ sal_uInt32 nBulletFont;
+ sal_uInt32 nBulletHeight;
+ sal_uInt32 nBulletColor;
+ sal_uInt32 nTextOfs;
+ sal_uInt32 nBulletOfs;
+
+ void ImplGetNumberFormat(
+ SdrPowerPointImport& rMan,
+ SvxNumberFormat& rNumberFormat,
+ sal_uInt32 nLevel
+ );
+ sal_Bool ImplGetExtNumberFormat(
+ SdrPowerPointImport& rMan,
+ SvxNumberFormat& rNumberFormat,
+ sal_uInt32 nLevel,
+ sal_uInt32 nInstance,
+ sal_uInt32 nInstanceInSheet,
+ boost::optional< sal_Int16 >& rStartNumbering,
+ sal_uInt32 nFontHeight,
+ PPTParagraphObj* pPara
+ );
+
+protected:
+
+ PPTNumberFormatCreator( PPTExtParaProv* );
+ ~PPTNumberFormatCreator();
+
+public:
+
+ PPTExtParaProv* pExtParaProv;
+
+ void GetNumberFormat(
+ SdrPowerPointImport& rMan,
+ SvxNumberFormat& rNumberFormat,
+ sal_uInt32 nLevel,
+ const PPTParaLevel& rParaLevel,
+ const PPTCharLevel& rCharLevel,
+ sal_uInt32 nInstance
+ );
+
+ sal_Bool GetNumberFormat(
+ SdrPowerPointImport& rMan,
+ SvxNumberFormat& rNumberFormat,
+ PPTParagraphObj* pPara,
+ sal_uInt32 nInstanceInSheet,
+ boost::optional< sal_Int16 >& rStartNumbering
+ );
+};
+
+class SvxNumBulletItem;
+struct PPTStyleSheet : public PPTNumberFormatCreator
+{
+ PPTTextSpecInfo maTxSI;
+ PPTCharSheet* mpCharSheet[ PPT_STYLESHEETENTRYS ];
+ PPTParaSheet* mpParaSheet[ PPT_STYLESHEETENTRYS ];
+ SvxNumBulletItem* mpNumBulletItem[ PPT_STYLESHEETENTRYS ];
+
+ PPTStyleSheet(
+ const DffRecordHeader& rSlideHd,
+ SvStream& rSt, SdrPowerPointImport&,
+ const PPTTextCharacterStyleAtomInterpreter&,
+ const PPTTextParagraphStyleAtomInterpreter&,
+ const PPTTextSpecInfo&
+ );
+ ~PPTStyleSheet();
+};
+
+struct ImplPPTParaPropSet
+{
+ sal_uInt32 mnRefCount;
+
+ sal_uInt16 mnDepth;
+ sal_uInt32 mnAttrSet;
+ sal_uInt32 mnBulletColor;
+ sal_uInt16 mpArry[ 22 ];
+
+ sal_uInt32 mnExtParagraphMask;
+ sal_uInt32 mnAnmScheme;
+ sal_uInt16 mnHasAnm;
+ sal_uInt16 mnBuBlip;
+
+ sal_uInt32 nDontKnow1;
+ sal_uInt32 nDontKnow2;
+ sal_uInt16 nDontKnow2bit06;
+
+ ImplPPTParaPropSet()
+ { mnRefCount = 1; mnAttrSet = 0; mnExtParagraphMask = 0; mnDepth = 0; };
+};
+
+struct PPTParaPropSet
+{
+ sal_uInt32 mnOriginalTextPos;
+ ImplPPTParaPropSet* pParaSet;
+
+ PPTParaPropSet();
+ PPTParaPropSet( PPTParaPropSet& rParaPropSet );
+ ~PPTParaPropSet();
+
+ PPTParaPropSet& operator=( PPTParaPropSet& rParaPropSet );
+};
+
+struct ImplPPTCharPropSet
+{
+ sal_uInt32 mnRefCount;
+
+ sal_uInt32 mnAttrSet;
+ sal_uInt16 mnFlags;
+ sal_uInt32 mnColor;
+ sal_uInt16 mnFont;
+ sal_uInt16 mnAsianOrComplexFont;
+ sal_uInt16 mnANSITypeface;
+ sal_uInt16 mnFontHeight;
+ sal_uInt16 mnEscapement;
+ sal_uInt16 mnSymbolFont;
+
+ ImplPPTCharPropSet(){ mnRefCount = 1; mnAttrSet = 0; };
+};
+
+struct PPTCharPropSet
+{
+ //when the bullet text has more than two color,next the text following with bullet has been set hyperlink.
+ //now,the bullet color should be set original hyperlink text's color
+ //so "mbHardHylinkOrigColor" hold the original hyperlink text's color.
+ sal_uInt32 mnHylinkOrigColor;
+ //the bullet text weather has a hyperlink.
+ sal_Bool mbIsHyperlink;
+ //the hyperlink text weather has a custom color.
+ sal_Bool mbHardHylinkOrigColor;
+
+ sal_uInt32 mnOriginalTextPos;
+ sal_uInt32 mnParagraph;
+ OUString maString;
+ SvxFieldItem* mpFieldItem;
+ sal_uInt16 mnLanguage[ 3 ];
+
+ ImplPPTCharPropSet* pCharSet;
+
+ void SetFont( sal_uInt16 nFont );
+ void SetColor( sal_uInt32 nColor );
+
+ explicit PPTCharPropSet( sal_uInt32 nParagraph );
+ PPTCharPropSet( const PPTCharPropSet& rCharPropSet );
+ PPTCharPropSet( const PPTCharPropSet& rCharPropSet, sal_uInt32 nParagraph );
+ ~PPTCharPropSet();
+
+ PPTCharPropSet& operator=( const PPTCharPropSet& rCharPropSet );
+
+private:
+ void ImplMakeUnique();
+};
+
+struct PPTTabEntry
+{
+ sal_uInt16 nOffset;
+ sal_uInt16 nStyle;
+};
+
+struct PPTRuler
+{
+ sal_uInt32 nRefCount;
+
+ sal_Int32 nFlags;
+ sal_uInt16 nDefaultTab;
+ sal_uInt16 nTextOfs[ 5 ];
+ sal_uInt16 nBulletOfs[ 5 ];
+ PPTTabEntry* pTab;
+ sal_uInt16 nTabCount;
+
+ PPTRuler();
+ ~PPTRuler();
+};
+
+struct PPTTextRulerInterpreter
+{
+ PPTRuler *mpImplRuler;
+
+ PPTTextRulerInterpreter();
+ PPTTextRulerInterpreter( PPTTextRulerInterpreter& rRuler );
+ PPTTextRulerInterpreter(
+ sal_uInt32 nFileOfs,
+ SdrPowerPointImport&,
+ DffRecordHeader& rHd,
+ SvStream& rIn
+ );
+ ~PPTTextRulerInterpreter();
+
+ sal_uInt16 GetTabOffsetByIndex( sal_uInt16 nIndex ) const
+ { return mpImplRuler->pTab[ nIndex ].nOffset; };
+
+ sal_uInt16 GetTabStyleByIndex( sal_uInt16 nIndex ) const
+ { return mpImplRuler->pTab[ nIndex ].nStyle; };
+
+ sal_uInt16 GetTabCount() const { return mpImplRuler->nTabCount; };
+ sal_Bool GetDefaultTab( sal_uInt32 nLevel, sal_uInt16& nValue ) const;
+ sal_Bool GetTextOfs( sal_uInt32 nLevel, sal_uInt16& nValue ) const;
+ sal_Bool GetBulletOfs( sal_uInt32 nLevel, sal_uInt16& nValue ) const;
+
+ PPTTextRulerInterpreter& operator=( PPTTextRulerInterpreter& rRuler );
+};
+
+#define PPT_SPEC_NEWLINE 0x10000
+#define PPT_SPEC_SYMBOL 0x20000
+#define PPT_SPEC_USE_STARBATS 0x40000
+
+struct StyleTextProp9
+{
+ sal_uInt32 mnExtParagraphMask;
+ sal_uInt16 mnBuBlip;
+ sal_uInt16 mnHasAnm;
+ sal_uInt32 mnAnmScheme;
+ sal_uInt32 mpfPP10Ext;
+ sal_uInt32 mnExtCharacterMask;
+ sal_uInt32 mncfPP10Ext;
+ sal_uInt32 mnSpecialInfoMask;
+ sal_uInt32 mnPP10Ext;
+ sal_uInt16 mfBidi;
+
+ StyleTextProp9()
+ : mnExtParagraphMask( 0 )
+ , mnBuBlip( 0 )
+ , mnHasAnm( 0 )
+ , mnAnmScheme( 0 )
+ , mpfPP10Ext( 0 )
+ , mnExtCharacterMask( 0 )
+ , mncfPP10Ext( 0 )
+ , mnSpecialInfoMask( 0 )
+ , mnPP10Ext( 0 )
+ , mfBidi( 0 )
+ {
+ }
+ void Read( SvStream& rSt );
+};
+
+typedef std::vector<PPTParaPropSet*> PPTParaPropSetList;
+typedef std::vector<PPTCharPropSet*> PPTCharPropSetList;
+
+struct PPTStyleTextPropReader
+{
+ std::vector< sal_uInt32 > aSpecMarkerList; // hiword -> Flags, loword -> Position
+ PPTParaPropSetList aParaPropList;
+ PPTCharPropSetList aCharPropList;
+
+ PPTStyleTextPropReader(
+ SvStream& rIn,
+ SdrPowerPointImport&,
+ const DffRecordHeader& rClientTextBoxHd,
+ PPTTextRulerInterpreter& rInterpreter,
+ const DffRecordHeader& rExtParaHd,
+ sal_uInt32 nTextInstance
+ );
+ ~PPTStyleTextPropReader();
+
+ void Init(
+ SvStream& rIn,
+ SdrPowerPointImport&,
+ const DffRecordHeader& rClientTextBoxHd,
+ PPTTextRulerInterpreter& rInterpreter,
+ const DffRecordHeader& rExtParaHd,
+ sal_uInt32 nTextInstance
+ );
+ void ReadParaProps(
+ SvStream& rIn,
+ SdrPowerPointImport& rMan,
+ const DffRecordHeader& rTextHeader,
+ const OUString& aString,
+ PPTTextRulerInterpreter& rRuler,
+ sal_uInt32& nCharCount,
+ sal_Bool& bTextPropAtom
+ );
+ void ReadCharProps(
+ SvStream& rIn,
+ PPTCharPropSet& aCharPropSet,
+ const OUString& aString,
+ sal_uInt32& nCharCount,
+ sal_uInt32 nCharAnzRead,
+ sal_Bool& bTextPropAtom,
+ sal_uInt32 nExtParaPos,
+ const std::vector< StyleTextProp9 >& aStyleTextProp9,
+ sal_uInt32& nExtParaFlags,
+ sal_uInt16& nBuBlip,
+ sal_uInt16& nHasAnm,
+ sal_uInt32& nAnmScheme
+ );
+};
+
+class SvxFieldItem;
+class MSFILTER_DLLPUBLIC PPTPortionObj : public PPTCharPropSet
+{
+
+ friend class PPTParagraphObj;
+
+ const PPTStyleSheet& mrStyleSheet;
+ sal_uInt32 mnInstance;
+ sal_uInt32 mnDepth;
+
+public:
+
+ sal_Bool GetAttrib( sal_uInt32 nAttr, sal_uInt32& nVal, sal_uInt32 nInstanceInSheet ) const;
+ SvxFieldItem* GetTextField();
+
+ PPTPortionObj( const PPTStyleSheet&, sal_uInt32 nInstance, sal_uInt32 nDepth );
+ PPTPortionObj(
+ const PPTCharPropSet&,
+ const PPTStyleSheet&,
+ sal_uInt32 nInstance,
+ sal_uInt32 nDepth
+ );
+ PPTPortionObj( const PPTPortionObj& );
+ ~PPTPortionObj();
+
+ // the following function should be removed during next full update
+ void ApplyTo(
+ SfxItemSet& rSet,
+ SdrPowerPointImport& rManager,
+ sal_uInt32 nInstanceInSheet
+ );
+ void ApplyTo(
+ SfxItemSet& rSet,
+ SdrPowerPointImport& rManager,
+ sal_uInt32 nInstanceInSheet,
+ const PPTTextObj* pTextObj
+ );
+ sal_uInt32 Count() const { return ( mpFieldItem ) ? 1 : maString.getLength(); };
+ sal_Bool HasTabulator();
+};
+
+class MSFILTER_DLLPUBLIC PPTParagraphObj
+ : public PPTParaPropSet,
+ public PPTNumberFormatCreator,
+ public PPTTextRulerInterpreter
+{
+ friend class PPTTextObj;
+ friend class PPTNumberFormatCreator;
+
+ const PPTStyleSheet& mrStyleSheet;
+ sal_uInt32 mnInstance;
+
+protected:
+
+ void ImplClear();
+
+public:
+
+ sal_Bool mbTab; // if true, this paragraph has tabulators in text
+
+ sal_uInt32 mnCurrentObject;
+ ::boost::ptr_vector<PPTPortionObj> m_PortionList;
+
+ void UpdateBulletRelSize( sal_uInt32& nBulletRelSize ) const;
+ sal_Bool GetAttrib( sal_uInt32 nAttr, sal_uInt32& nVal, sal_uInt32 nInstanceInSheet );
+
+ PPTParagraphObj(
+ const PPTStyleSheet&,
+ sal_uInt32 nInstance,
+ sal_uInt16 nDepth
+ );
+ PPTParagraphObj(
+ PPTStyleTextPropReader&,
+ size_t nCurParaPos,
+ size_t& rnCurCharPos,
+ const PPTStyleSheet&,
+ sal_uInt32 nInstance,
+ PPTTextRulerInterpreter& rRuler
+ );
+ ~PPTParagraphObj();
+
+ sal_uInt32 GetTextSize();
+ PPTPortionObj* First();
+ PPTPortionObj* Next();
+
+ void AppendPortion( PPTPortionObj& rPortion );
+ void ApplyTo(
+ SfxItemSet& rSet,
+ boost::optional< sal_Int16 >& rStartNumbering,
+ SdrPowerPointImport& rManager,
+ sal_uInt32 nInstanceInSheet,
+ const PPTParagraphObj* pPrev
+ );
+};
+
+#define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT 1
+#define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_CENTER 2
+#define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT 4
+#define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_BLOCK 8
+#define PPT_TEXTOBJ_FLAGS_VERTICAL 16
+
+struct ImplPPTTextObj
+{
+ sal_uInt32 mnRefCount;
+ sal_uInt32 mnShapeId;
+ sal_uInt32 mnShapeMaster;
+ PptOEPlaceholderAtom* mpPlaceHolderAtom;
+ sal_uInt16 mnInstance;
+ sal_uInt16 mnDestinationInstance;
+ MSO_SPT meShapeType;
+
+ sal_uInt32 mnCurrentObject;
+ sal_uInt32 mnParagraphCount;
+ PPTParagraphObj** mpParagraphList;
+ PptSlidePersistEntry& mrPersistEntry;
+
+ sal_uInt32 mnTextFlags;
+
+ explicit ImplPPTTextObj( PptSlidePersistEntry& rPersistEntry ) : mrPersistEntry ( rPersistEntry ) {};
+};
+
+class PPTTextObj
+{
+ ImplPPTTextObj* mpImplTextObj;
+ void ImplClear();
+
+ PPTTextObj(){};
+public:
+ PPTTextObj(
+ SvStream& rSt,
+ SdrPowerPointImport&,
+ PptSlidePersistEntry&,
+ DffObjData*
+ );
+ PPTTextObj( PPTTextObj& rTextObj );
+ ~PPTTextObj();
+
+ sal_uInt32 GetCurrentIndex() const { return mpImplTextObj->mnCurrentObject; };
+ sal_uInt32 Count() const { return mpImplTextObj->mnParagraphCount; };
+ PPTParagraphObj* First();
+ PPTParagraphObj* Next();
+ MSO_SPT GetShapeType() const { return mpImplTextObj->meShapeType; };
+ sal_uInt32 GetInstance() const { return mpImplTextObj->mnInstance; };
+ void SetInstance( sal_uInt16 nInstance )
+ { mpImplTextObj->mnInstance = nInstance; }
+
+ sal_uInt32 GetDestinationInstance() const
+ { return mpImplTextObj->mnDestinationInstance; }
+
+ void SetDestinationInstance( sal_uInt16 nInstance )
+ { mpImplTextObj->mnDestinationInstance = nInstance; }
+
+ PptOEPlaceholderAtom* GetOEPlaceHolderAtom() const { return mpImplTextObj->mpPlaceHolderAtom; }
+ sal_uInt32 GetTextFlags() const { return mpImplTextObj->mnTextFlags; }
+ void SetVertical( sal_Bool bVertical )
+ {
+ if ( bVertical )
+ mpImplTextObj->mnTextFlags |= PPT_TEXTOBJ_FLAGS_VERTICAL;
+ else
+ mpImplTextObj->mnTextFlags &= ~PPT_TEXTOBJ_FLAGS_VERTICAL;
+ }
+ sal_Bool GetVertical() const
+ { return ( mpImplTextObj->mnTextFlags & PPT_TEXTOBJ_FLAGS_VERTICAL ) != 0; }
+
+ const SfxItemSet* GetBackground() const;
+
+ PPTTextObj& operator=( PPTTextObj& rTextObj );
+};
+
+class PPTConvertOCXControls : public SvxMSConvertOCXControls
+{
+ virtual const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > & GetDrawPage();
+ PptPageKind ePageKind;
+ const SdrPowerPointImport* mpPPTImporter;
+ com::sun::star::uno::Reference< com::sun::star::io::XInputStream > mxInStrm;
+public :
+
+ PPTConvertOCXControls( const SdrPowerPointImport* pPPTImporter, com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& rxInStrm, const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel, PptPageKind ePKind ) :
+ SvxMSConvertOCXControls ( rxModel ),
+ ePageKind ( ePKind ),
+ mpPPTImporter ( pPPTImporter ),
+ mxInStrm ( rxInStrm )
+ {};
+ virtual sal_Bool ReadOCXStream( SotStorageRef& rSrc1,
+ com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShape > *pShapeRef=0,
+ sal_Bool bFloatingCtrl=sal_False );
+ virtual sal_Bool InsertControl(
+ const com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > &rFComp,
+ const com::sun::star::awt::Size& rSize,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape > *pShape,
+ sal_Bool bFloatingCtrl
+ );
+};
+
+// Powerpoint Recordtypen
+#define PPT_PST_Unknown 0
+#define PPT_PST_SubContainerCompleted 1
+#define PPT_PST_IRRAtom 2
+#define PPT_PST_PSS 3
+#define PPT_PST_SubContainerException 4
+#define PPT_PST_ClientSignal1 6
+#define PPT_PST_ClientSignal2 7
+#define PPT_PST_PowerPointStateInfoAtom 10
+#define PPT_PST_Document 1000
+#define PPT_PST_DocumentAtom 1001
+#define PPT_PST_EndDocument 1002
+#define PPT_PST_SlidePersist 1003
+#define PPT_PST_SlideBase 1004
+#define PPT_PST_SlideBaseAtom 1005
+#define PPT_PST_Slide 1006
+#define PPT_PST_SlideAtom 1007
+#define PPT_PST_Notes 1008
+#define PPT_PST_NotesAtom 1009
+#define PPT_PST_Environment 1010
+#define PPT_PST_SlidePersistAtom 1011
+#define PPT_PST_Scheme 1012
+#define PPT_PST_SchemeAtom 1013
+#define PPT_PST_DocViewInfo 1014
+#define PPT_PST_SslideLayoutAtom 1015
+#define PPT_PST_MainMaster 1016
+#define PPT_PST_SSSlideInfoAtom 1017
+#define PPT_PST_SlideViewInfo 1018
+#define PPT_PST_GuideAtom 1019
+#define PPT_PST_ViewInfo 1020
+#define PPT_PST_ViewInfoAtom 1021
+#define PPT_PST_SlideViewInfoAtom 1022
+#define PPT_PST_VBAInfo 1023
+#define PPT_PST_VBAInfoAtom 1024
+#define PPT_PST_SSDocInfoAtom 1025
+#define PPT_PST_Summary 1026
+#define PPT_PST_Texture 1027
+#define PPT_PST_VBASlideInfo 1028
+#define PPT_PST_VBASlideInfoAtom 1029
+#define PPT_PST_DocRoutingSlip 1030
+#define PPT_PST_OutlineViewInfo 1031
+#define PPT_PST_SorterViewInfo 1032
+#define PPT_PST_ExObjList 1033
+#define PPT_PST_ExObjListAtom 1034
+#define PPT_PST_PPDrawingGroup 1035
+#define PPT_PST_PPDrawing 1036
+#define PPT_PST_NewlyAddedAtomByXP1037 1037
+#define PPT_PST_NamedShows 1040
+#define PPT_PST_NamedShow 1041
+#define PPT_PST_NamedShowSlides 1042
+#define PPT_PST_List 2000
+#define PPT_PST_FontCollection 2005
+#define PPT_PST_ListPlaceholder 2017
+#define PPT_PST_BookmarkCollection 2019
+#define PPT_PST_SoundCollection 2020
+#define PPT_PST_SoundCollAtom 2021
+#define PPT_PST_Sound 2022
+#define PPT_PST_SoundData 2023
+#define PPT_PST_BookmarkSeedAtom 2025
+#define PPT_PST_GuideList 2026
+#define PPT_PST_RunArray 2028
+#define PPT_PST_RunArrayAtom 2029
+#define PPT_PST_ArrayElementAtom 2030
+#define PPT_PST_Int4ArrayAtom 2031
+#define PPT_PST_ColorSchemeAtom 2032
+
+// these atoms first was seen in ppt2000 in a private Tag atom
+#define PPT_PST_ExtendedBuGraContainer 2040 // consist of 4041
+#define PPT_PST_ExtendedBuGraAtom 2041 // the instance of this atom indices the current graphic
+
+#define PPT_PST_OEShape 3008
+#define PPT_PST_ExObjRefAtom 3009
+#define PPT_PST_OEPlaceholderAtom 3011
+#define PPT_PST_GrColor 3020
+#define PPT_PST_GrectAtom 3025
+#define PPT_PST_GratioAtom 3031
+#define PPT_PST_Gscaling 3032
+#define PPT_PST_GpointAtom 3034
+#define PPT_PST_OEShapeAtom 3035
+#define PPT_PST_OutlineTextRefAtom 3998
+#define PPT_PST_TextHeaderAtom 3999
+#define PPT_PST_TextCharsAtom 4000
+#define PPT_PST_StyleTextPropAtom 4001
+#define PPT_PST_BaseTextPropAtom 4002
+#define PPT_PST_TxMasterStyleAtom 4003
+#define PPT_PST_TxCFStyleAtom 4004
+#define PPT_PST_TxPFStyleAtom 4005
+#define PPT_PST_TextRulerAtom 4006
+#define PPT_PST_TextBookmarkAtom 4007
+#define PPT_PST_TextBytesAtom 4008
+#define PPT_PST_TxSIStyleAtom 4009
+#define PPT_PST_TextSpecInfoAtom 4010
+#define PPT_PST_DefaultRulerAtom 4011
+
+// these atoms first was seen in ppt2000 in a private Tag atom
+#define PPT_PST_ExtendedParagraphAtom 4012
+#define PPT_PST_ExtendedParagraphMasterAtom 4013
+#define PPT_PST_ExtendedPresRuleContainer 4014 // consist of 4012, 4015,
+#define PPT_PST_ExtendedParagraphHeaderAtom 4015 // the instance of this atom indices the current presobj
+ // the first sal_uInt32 in this atom indices the current slideId
+#define PPT_PST_NewlyAddedAtom4016 4016
+
+#define PPT_PST_FontEntityAtom 4023
+#define PPT_PST_FontEmbedData 4024
+#define PPT_PST_TypeFace 4025
+#define PPT_PST_CString 4026
+#define PPT_PST_ExternalObject 4027
+#define PPT_PST_MetaFile 4033
+#define PPT_PST_ExOleObj 4034
+#define PPT_PST_ExOleObjAtom 4035
+#define PPT_PST_ExPlainLinkAtom 4036
+#define PPT_PST_CorePict 4037
+#define PPT_PST_CorePictAtom 4038
+#define PPT_PST_ExPlainAtom 4039
+#define PPT_PST_SrKinsoku 4040
+#define PPT_PST_Handout 4041
+#define PPT_PST_ExEmbed 4044
+#define PPT_PST_ExEmbedAtom 4045
+#define PPT_PST_ExLink 4046
+#define PPT_PST_ExLinkAtom_old 4047
+#define PPT_PST_BookmarkEntityAtom 4048
+#define PPT_PST_ExLinkAtom 4049
+#define PPT_PST_SrKinsokuAtom 4050
+#define PPT_PST_ExHyperlinkAtom 4051
+#define PPT_PST_ExPlain 4053
+#define PPT_PST_ExPlainLink 4054
+#define PPT_PST_ExHyperlink 4055
+#define PPT_PST_SlideNumberMCAtom 4056
+#define PPT_PST_HeadersFooters 4057
+#define PPT_PST_HeadersFootersAtom 4058
+#define PPT_PST_RecolorEntryAtom 4062
+#define PPT_PST_TxInteractiveInfoAtom 4063
+#define PPT_PST_EmFormatAtom 4065
+#define PPT_PST_CharFormatAtom 4066
+#define PPT_PST_ParaFormatAtom 4067
+#define PPT_PST_MasterText 4068
+#define PPT_PST_RecolorInfoAtom 4071
+#define PPT_PST_ExQuickTime 4073
+#define PPT_PST_ExQuickTimeMovie 4074
+#define PPT_PST_ExQuickTimeMovieData 4075
+#define PPT_PST_ExSubscription 4076
+#define PPT_PST_ExSubscriptionSection 4077
+#define PPT_PST_ExControl 4078
+#define PPT_PST_ExControlAtom 4091
+#define PPT_PST_SlideListWithText 4080
+#define PPT_PST_AnimationInfoAtom 4081
+#define PPT_PST_InteractiveInfo 4082
+#define PPT_PST_InteractiveInfoAtom 4083
+#define PPT_PST_SlideList 4084
+#define PPT_PST_UserEditAtom 4085
+#define PPT_PST_CurrentUserAtom 4086
+#define PPT_PST_DateTimeMCAtom 4087
+#define PPT_PST_GenericDateMCAtom 4088
+#define PPT_PST_HeaderMCAtom 4089
+#define PPT_PST_FooterMCAtom 4090
+#define PPT_PST_ExMediaAtom 4100
+#define PPT_PST_ExVideo 4101
+#define PPT_PST_ExAviMovie 4102
+#define PPT_PST_ExMCIMovie 4103
+#define PPT_PST_ExMIDIAudio 4109
+#define PPT_PST_ExCDAudio 4110
+#define PPT_PST_ExWAVAudioEmbedded 4111
+#define PPT_PST_ExWAVAudioLink 4112
+#define PPT_PST_ExOleObjStg 4113
+#define PPT_PST_ExCDAudioAtom 4114
+#define PPT_PST_ExWAVAudioEmbeddedAtom 4115
+#define PPT_PST_AnimationInfo 4116
+#define PPT_PST_RTFDateTimeMCAtom 4117
+#define PPT_PST_ProgTags 5000
+#define PPT_PST_ProgStringTag 5001
+#define PPT_PST_ProgBinaryTag 5002
+#define PPT_PST_BinaryTagData 5003
+#define PPT_PST_PrintOptions 6000
+#define PPT_PST_PersistPtrFullBlock 6001
+#define PPT_PST_PersistPtrIncrementalBlock 6002
+
+// these atoms first was seen in ppt2000 in a private Tag atom
+#define PPT_PST_NewlyAddedAtomByPPT2000_6010 6010
+#define PPT_PST_NewlyAddedAtomByPPT2000_6011 6011
+
+#define PPT_PST_RulerIndentAtom 10000
+#define PPT_PST_GscalingAtom 10001
+#define PPT_PST_GrColorAtom 10002
+#define PPT_PST_GLPointAtom 10003
+#define PPT_PST_GlineAtom 10004
+
+#define PPT_PST_NewlyAddedAtomByXP11008 11008
+#define PPT_PST_NewlyAddedAtomByXP11010 11010
+#define PPT_PST_Comment10 12000
+#define PPT_PST_CommentAtom10 12001
+#define PPT_PST_NewlyAddedAtomByXP12004 12004
+#define PPT_PST_NewlyAddedAtomByXP12010 12010
+#define PPT_PST_NewlyAddedAtomByXP12011 12011
+#define PPT_PST_NewlyAddedAtomByXP14001 14001
+
+// Attribute fuer PptTextStyleSheet
+#define PPT_ParaAttr_BulletOn 0 //00000001
+#define PPT_ParaAttr_BuHardFont 1 //00000002
+#define PPT_ParaAttr_BuHardColor 2 //00000004
+#define PPT_ParaAttr_BuHardHeight 3 //00000008
+#define PPT_ParaAttr_BulletFont 4 //00000010
+#define PPT_ParaAttr_BulletColor 5 //00000020
+#define PPT_ParaAttr_BulletHeight 6 //00000040
+#define PPT_ParaAttr_BulletChar 7 //00000080
+#define PPT_ParaAttr_DontKnow1 8 //00000100
+#define PPT_ParaAttr_DontKnow2 9 //00000200
+#define PPT_ParaAttr_DontKnow3 10 //00000400
+#define PPT_ParaAttr_Adjust 11 //00000800 0000=Left, 0001=Center, 0002=Right, 0003=Block
+#define PPT_ParaAttr_LineFeed 12 //00001000
+#define PPT_ParaAttr_UpperDist 13 //00002000 ist bei Textframes default immer auf 0032 gesetzt
+#define PPT_ParaAttr_LowerDist 14 //00004000
+#define PPT_ParaAttr_TextOfs 15 //00008000
+#define PPT_ParaAttr_BulletOfs 16 //00010000
+#define PPT_ParaAttr_DefaultTab 17 //00020000
+#define PPT_ParaAttr_AsianLB_1 18
+#define PPT_ParaAttr_AsianLB_2 19
+#define PPT_ParaAttr_AsianLB_3 20
+#define PPT_ParaAttr_BiDi 21 //00200000
+
+#define PPT_CharAttr_Bold 0 //00000001
+#define PPT_CharAttr_Italic 1 //00000002
+#define PPT_CharAttr_Underline 2 //00000004
+#define PPT_CharAttr_Shadow 4 //00000010
+#define PPT_CharAttr_Strikeout 8 //00000100
+#define PPT_CharAttr_Embossed 9 //00000200
+#define PPT_CharAttr_ResetNumbering 10 //00000400
+#define PPT_CharAttr_EnableNumbering1 11 //00000800
+#define PPT_CharAttr_EnableNumbering2 12 //00001000
+#define PPT_CharAttr_Font 16 //00010000
+#define PPT_CharAttr_AsianOrComplexFont 21 //00200000
+#define PPT_CharAttr_ANSITypeface 22 //00400000
+#define PPT_CharAttr_Symbol 23 //00800000
+#define PPT_CharAttr_FontHeight 17 //00020000
+#define PPT_CharAttr_FontColor 18 //00040000
+#define PPT_CharAttr_Escapement 19 //00080000
+
+// Werte fuer PptSlideLayoutAtom.eLayout
+#define PPT_LAYOUT_TITLESLIDE 0 // The slide is a title slide
+#define PPT_LAYOUT_TITLEANDBODYSLIDE 1 // Title and body slide
+#define PPT_LAYOUT_TITLEMASTERSLIDE 2 // Title master slide
+#define PPT_LAYOUT_MASTERSLIDE 3 // Master slide layout
+#define PPT_LAYOUT_MASTERNOTES 4 // Master notes layout
+#define PPT_LAYOUT_NOTESTITLEBODY 5 // Notes title/body layout
+#define PPT_LAYOUT_HANDOUTLAYOUT 6 // Handout layout, therefore it doesn't have placeholders except header, footer, and date
+#define PPT_LAYOUT_ONLYTITLE 7 // Only title placeholder
+#define PPT_LAYOUT_2COLUMNSANDTITLE 8 // Body of the slide has 2 columns and a title
+#define PPT_LAYOUT_2ROWSANDTITLE 9 // Slide's body has 2 rows and a title
+#define PPT_LAYOUT_RIGHTCOLUMN2ROWS 10 // Body contains 2 columns, right column has 2 rows
+#define PPT_LAYOUT_LEFTCOLUMN2ROWS 11 // Body contains 2 columns, left column has 2 rows
+#define PPT_LAYOUT_BOTTOMROW2COLUMNS 12 // Body contains 2 rows, bottom row has 2 columns
+#define PPT_LAYOUT_TOPROW2COLUMN 13 // Body contains 2 rows, top row has 2 columns
+#define PPT_LAYOUT_4OBJECTS 14 // 4 objects
+#define PPT_LAYOUT_BIGOBJECT 15 // Big object
+#define PPT_LAYOUT_BLANCSLIDE 16 // Blank slide
+#define PPT_LAYOUT_TITLERIGHTBODYLEFT 17 // Vertical title on the right, body on the left
+#define PPT_LAYOUT_TITLERIGHT2BODIESLEFT 18 // Vertical title on the right, body on the left split into 2 rows
+
+// the following table describes the placeholder id's (values from reality followed by values taken from the documentation)
+#define PPT_PLACEHOLDER_NONE 0 // 0 None
+#define PPT_PLACEHOLDER_MASTERTITLE 1 // 1 Master title
+#define PPT_PLACEHOLDER_MASTERBODY 2 // 2 Master body
+#define PPT_PLACEHOLDER_MASTERCENTEREDTITLE 3 // 3 Master centered title
+#define PPT_PLACEHOLDER_MASTERSUBTITLE 4 // 10 Master subtitle
+#define PPT_PLACEHOLDER_MASTERNOTESSLIDEIMAGE 5 // 4 Master notes slide image
+#define PPT_PLACEHOLDER_MASTERNOTESBODYIMAGE 6 // 5 Master notes body image
+#define PPT_PLACEHOLDER_MASTERDATE 7 // 6 Master date
+#define PPT_PLACEHOLDER_MASTERSLIDENUMBER 8 // 7 Master slide number
+#define PPT_PLACEHOLDER_MASTERFOOTER 9 // 8 Master footer
+#define PPT_PLACEHOLDER_MASTERHEADER 10 // 9 Master header
+#define PPT_PLACEHOLDER_GENERICTEXTOBJECT // 11 Generic text object
+#define PPT_PLACEHOLDER_TITLE 13 // 12 Title
+#define PPT_PLACEHOLDER_BODY 14 // 13 Body
+#define PPT_PLACEHOLDER_NOTESBODY 12 // 14 Notes body
+#define PPT_PLACEHOLDER_CENTEREDTITLE 15 // 15 Centered title
+#define PPT_PLACEHOLDER_SUBTITLE 16 // 16 Subtitle
+#define PPT_PLACEHOLDER_VERTICALTEXTTITLE 17 // 17 Vertical text title
+#define PPT_PLACEHOLDER_VERTICALTEXTBODY 18 // 18 Vertical text body
+#define PPT_PLACEHOLDER_NOTESSLIDEIMAGE 11 // 19 Notes slide image
+#define PPT_PLACEHOLDER_OBJECT 19 // 20 Object (no matter the size)
+#define PPT_PLACEHOLDER_GRAPH 20 // 21 Graph
+#define PPT_PLACEHOLDER_TABLE 21 // 22 Table
+#define PPT_PLACEHOLDER_CLIPART 22 // 23 Clip Art
+#define PPT_PLACEHOLDER_ORGANISZATIONCHART 23 // 24 Organization Chart
+#define PPT_PLACEHOLDER_MEDIACLIP 24 // 25 Media Clip
+
+#endif //_SVDFPPT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/svxmsbas.hxx b/include/filter/msfilter/svxmsbas.hxx
new file mode 100644
index 000000000000..8f87401edee5
--- /dev/null
+++ b/include/filter/msfilter/svxmsbas.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 _SVXMSBAS_HXX
+#define _SVXMSBAS_HXX
+
+#include <tools/solar.h>
+#include "filter/msfilter/msfilterdllapi.h"
+
+#include <sot/storage.hxx>
+#include <map>
+#include <boost/unordered_map.hpp>
+
+class SfxObjectShell;
+
+/* Construct with the root storage of the MS document, with bImportCode
+ * set the visual basic code will be imported into the stardocument when Import
+ * is called, with bCopyStorage set, the visual basic storage tree will be
+ * copied completely into staroffice, so that any future export to a msoffice
+ * format will retain the vba code, allowing a lossless roundtrip from
+ * msoffice to staroffice and back.
+ *
+ * Setting bAsComment to true in Import will import the visual basic as a
+ * starbasic comment. Which is currently necessary, as vb is not valid sb.
+ *
+ * Setting bStripped will remove the "Attribute" lines from the vb, msoffice
+ * does this itself when it shows the vb code in the vbeditor, so this is
+ * probably what the user expects to see when viewing the code
+ */
+
+typedef boost::unordered_map< sal_Int32, OUString > ObjIdToName;
+
+typedef std::map< OUString, ObjIdToName > ControlAttributeInfo;
+
+class MSFILTER_DLLPUBLIC SvxImportMSVBasic
+{
+public:
+ SvxImportMSVBasic( SfxObjectShell &rDocS, SotStorage &rRoot )
+ : xRoot(&rRoot), rDocSh(rDocS)
+ {}
+ // only for the export - copy or delete the saved VBA-macro-storage
+ // form the ObjectShell
+ // - returns a warning code if a modified basic exist, in all other
+ // cases return ERRCODE_NONE.
+ sal_uLong SaveOrDelMSVBAStorage( sal_Bool bSaveInto, const OUString& rStorageName );
+
+ // check if the MS-VBA-Storage exist in the RootStorage of the DocShell.
+ // If it exist, then return the WarningId for loosing the information.
+ static sal_uLong GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS );
+
+ static OUString GetMSBasicStorageName();
+private:
+ SotStorageRef xRoot;
+ SfxObjectShell &rDocSh;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/filter/msfilter/util.hxx b/include/filter/msfilter/util.hxx
new file mode 100644
index 000000000000..f50e4d10ea83
--- /dev/null
+++ b/include/filter/msfilter/util.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_MSFILTER_UTIL_HXX
+#define INCLUDED_MSFILTER_UTIL_HXX
+
+#include <rtl/textenc.h>
+#include <tools/datetime.hxx>
+#include <tools/color.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+#include "filter/msfilter/msfilterdllapi.h"
+
+namespace msfilter {
+namespace util {
+
+/// Returns the best-fit default 8bit encoding for a given locale
+/// i.e. useful when dealing with legacy formats which use legacy text encodings without recording
+/// what the encoding is, but you know or can guess the language
+MSFILTER_DLLPUBLIC rtl_TextEncoding getBestTextEncodingFromLocale(const ::com::sun::star::lang::Locale &rLocale);
+
+/// Convert a color in BGR format to RGB.
+MSFILTER_DLLPUBLIC sal_uInt32 BGRToRGB(sal_uInt32 nColour);
+
+/** Convert from DTTM to Writer's DateTime
+
+ @author
+ <a href="mailto:mmaher@openoffice.org">Martin Maher</a
+ */
+MSFILTER_DLLPUBLIC DateTime DTTM2DateTime( long lDTTM );
+
+/** Convert DateTime to xsd::dateTime string.
+
+I guess there must be an implementation of this somewhere in LO, but I failed
+to find it, unfortunately :-(
+*/
+MSFILTER_DLLPUBLIC OString DateTimeToOString( const DateTime& rDateTime );
+
+/// Given a cBullet in encoding r_ioChrSet and fontname r_ioFontName return a
+/// suitable new Bullet and change r_ioChrSet and r_ioFontName to form the
+/// best-fit replacement in terms of default available MSOffice symbol
+/// fonts.
+///
+/// Set bDisableUnicodeSupport when exporting to 8bit encodings
+///
+/// Used to map from [Open|Star]Symbol to some Windows font or other.
+MSFILTER_DLLPUBLIC sal_Unicode bestFitOpenSymbolToMSFont(sal_Unicode cBullet,
+ rtl_TextEncoding& r_ioChrSet, OUString& r_ioFontName, bool bDisableUnicodeSupport = false);
+
+
+enum TextCategory
+{
+ latin, //Latin
+ cs, //Complex Script
+ ea, //East Asian
+ sym //Symbol
+};
+
+/** Categorize codepoints according to how MS seems to do it.
+
+ It's been bugging me for ages as to what codepoint MS considers in
+ what category. Tom Jebo has a post suggesting the criteria used here
+ and indicating its been submitting to the standards working group
+ as a proposed resolution.
+*/
+MSFILTER_DLLPUBLIC TextCategory categorizeCodePoint(sal_uInt32 codePoint, const OUString &rBcp47LanguageTag);
+
+/// Converts tools Color to HTML color (without leading hashmark).
+MSFILTER_DLLPUBLIC OString ConvertColor( const Color &rColor );
+
+}
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/ExternalReferenceHelper.hxx b/include/formula/ExternalReferenceHelper.hxx
new file mode 100644
index 000000000000..cd9b3b5b69c6
--- /dev/null
+++ b/include/formula/ExternalReferenceHelper.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 FORMULA_EXTERNALREFERENCEHELPER_HXX
+#define FORMULA_EXTERNALREFERENCEHELPER_HXX
+
+#include <rtl/ustring.hxx>
+#include "formula/formuladllapi.h"
+
+namespace formula
+{
+ class FORMULA_DLLPUBLIC SAL_NO_VTABLE ExternalReferenceHelper
+ {
+ public:
+ virtual OUString getCacheTableName(sal_uInt16 nFileId, size_t nTabIndex) const = 0;
+
+ protected:
+ ~ExternalReferenceHelper() {}
+ };
+// =============================================================================
+} // formula
+// =============================================================================
+#endif //FORMULA_EXTERNALREFERENCEHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx
new file mode 100644
index 000000000000..b53bb2df4316
--- /dev/null
+++ b/include/formula/FormulaCompiler.hxx
@@ -0,0 +1,388 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef FORMULA_COMPILER_HXX_INCLUDED
+#define FORMULA_COMPILER_HXX_INCLUDED
+
+#include "formula/formuladllapi.h"
+#include <tools/string.hxx>
+#include <tools/debug.hxx>
+#include <rtl/ustrbuf.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/unordered_map.hpp>
+
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include "formula/opcode.hxx"
+#include "formula/grammar.hxx"
+#include "formula/token.hxx"
+#include "formula/ExternalReferenceHelper.hxx"
+
+
+#define MAXJUMPCOUNT 32 /* maximum number of jumps (ocChose) */
+#define MAXCODE 512 /* maximum number of tokens in formula */
+
+
+namespace com { namespace sun { namespace star {
+ namespace sheet {
+ struct FormulaOpCodeMapEntry;
+ struct FormulaToken;
+ }
+}}}
+
+
+namespace formula
+{
+ class FormulaTokenArray;
+
+struct FormulaArrayStack
+{
+ FormulaArrayStack* pNext;
+ FormulaTokenArray* pArr;
+ bool bTemp;
+};
+
+
+struct FORMULA_DLLPUBLIC StringHashCode
+{
+ size_t operator()( const String& rStr ) const
+ {
+ return rtl_ustr_hashCode_WithLength( rStr.GetBuffer(), rStr.Len() );
+ }
+};
+
+typedef ::boost::unordered_map< String, OpCode, StringHashCode, ::std::equal_to< String > > OpCodeHashMap;
+typedef ::boost::unordered_map< String, String, StringHashCode, ::std::equal_to< String > > ExternalHashMap;
+
+class FORMULA_DLLPUBLIC FormulaCompiler
+{
+public:
+ FormulaCompiler();
+ FormulaCompiler(FormulaTokenArray& _rArr);
+ virtual ~FormulaCompiler();
+
+ // SUNWS8 needs a forward declared friend, otherwise members of the outer
+ // class are not accessible.
+ class OpCodeMap;
+ friend class FormulaCompiler::OpCodeMap;
+
+ /** Mappings from strings to OpCodes and vice versa. */
+ class FORMULA_DLLPUBLIC OpCodeMap
+ {
+ OpCodeHashMap * mpHashMap; /// Hash map of symbols, String -> OpCode
+ String * mpTable; /// Array of symbols, OpCode -> String, offset==OpCode
+ ExternalHashMap * mpExternalHashMap; /// Hash map of ocExternal, Filter String -> AddIn String
+ ExternalHashMap * mpReverseExternalHashMap; /// Hash map of ocExternal, AddIn String -> Filter String
+ FormulaGrammar::Grammar meGrammar; /// Grammar, language and reference convention
+ sal_uInt16 mnSymbols; /// Count of OpCode symbols
+ bool mbCore : 1; /// If mapping was setup by core, not filters
+ bool mbEnglish : 1; /// If English symbols and external names
+
+ OpCodeMap(); // prevent usage
+ OpCodeMap( const OpCodeMap& ); // prevent usage
+ OpCodeMap& operator=( const OpCodeMap& ); // prevent usage
+
+ public:
+
+ OpCodeMap(sal_uInt16 nSymbols, bool bCore, FormulaGrammar::Grammar eGrammar ) :
+ mpHashMap( new OpCodeHashMap( nSymbols)),
+ mpTable( new String[ nSymbols ]),
+ mpExternalHashMap( new ExternalHashMap),
+ mpReverseExternalHashMap( new ExternalHashMap),
+ meGrammar( eGrammar),
+ mnSymbols( nSymbols),
+ mbCore( bCore)
+ {
+ mbEnglish = FormulaGrammar::isEnglish( meGrammar);
+ }
+ virtual ~OpCodeMap();
+
+ void copyFrom( const OpCodeMap& r );
+
+ /// Get the symbol String -> OpCode hash map for finds.
+ inline const OpCodeHashMap* getHashMap() const { return mpHashMap; }
+
+ /// Get the symbol String -> AddIn String hash map for finds.
+ inline const ExternalHashMap* getExternalHashMap() const { return mpExternalHashMap; }
+
+ /// Get the AddIn String -> symbol String hash map for finds.
+ inline const ExternalHashMap* getReverseExternalHashMap() const { return mpReverseExternalHashMap; }
+
+ /// Get the symbol string matching an OpCode.
+ inline const String& getSymbol( const OpCode eOp ) const
+ {
+ DBG_ASSERT( sal_uInt16(eOp) < mnSymbols, "OpCodeMap::getSymbol: OpCode out of range");
+ if (sal_uInt16(eOp) < mnSymbols)
+ return mpTable[ eOp ];
+ static String s_sEmpty;
+ return s_sEmpty;
+ }
+
+ /// Get the grammar.
+ inline FormulaGrammar::Grammar getGrammar() const { return meGrammar; }
+
+ /// Get the symbol count.
+ inline sal_uInt16 getSymbolCount() const { return mnSymbols; }
+
+ /** Are these English symbols, as opposed to native language (which may
+ be English as well)? */
+ inline bool isEnglish() const { return mbEnglish; }
+
+ /// Is it an internal core mapping, or setup by filters?
+ inline bool isCore() const { return mbCore; }
+
+ /// Is it an ODF 1.1 compatibility mapping?
+ inline bool isPODF() const { return FormulaGrammar::isPODF( meGrammar); }
+
+ /// Is it an ODFF / ODF 1.2 mapping?
+ inline bool isODFF() const { return FormulaGrammar::isODFF( meGrammar); }
+
+ /// Does it have external symbol/name mappings?
+ inline bool hasExternals() const { return !mpExternalHashMap->empty(); }
+
+ /// Put entry of symbol String and OpCode pair.
+ void putOpCode( const String & rStr, const OpCode eOp );
+
+ /// Put entry of symbol String and AddIn international String pair.
+ void putExternal( const String & rSymbol, const String & rAddIn );
+
+ /** Put entry of symbol String and AddIn international String pair,
+ failing silently if rAddIn name already exists. */
+ void putExternalSoftly( const String & rSymbol, const String & rAddIn );
+
+ /// Core implementation of XFormulaOpCodeMapper::getMappings()
+ ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >
+ createSequenceOfFormulaTokens(const FormulaCompiler& _rCompiler,
+ const ::com::sun::star::uno::Sequence< OUString >& rNames ) const;
+
+ /// Core implementation of XFormulaOpCodeMapper::getAvailableMappings()
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::sheet::FormulaOpCodeMapEntry >
+ createSequenceOfAvailableMappings( const FormulaCompiler& _rCompiler,const sal_Int32 nGroup ) const;
+
+ /** The value used in createSequenceOfAvailableMappings() and thus in
+ XFormulaOpCodeMapper::getMappings() for an unknown symbol. */
+ static sal_Int32 getOpCodeUnknown();
+ };
+
+public:
+ typedef ::boost::shared_ptr< const OpCodeMap > OpCodeMapPtr;
+ typedef ::boost::shared_ptr< OpCodeMap > NonConstOpCodeMapPtr;
+
+ /** Get OpCodeMap for formula language.
+ @param nLanguage
+ One of ::com::sun::star::sheet::FormulaLanguage constants.
+ @return Map for nLanguage. If nLanguage is unknown, a NULL map is returned.
+ */
+ OpCodeMapPtr GetOpCodeMap( const sal_Int32 nLanguage ) const;
+
+ /** Create an internal symbol map from API mapping.
+ @param bEnglish
+ Use English number parser / formatter instead of native.
+ */
+ OpCodeMapPtr CreateOpCodeMap(
+ const ::com::sun::star::uno::Sequence<
+ const ::com::sun::star::sheet::FormulaOpCodeMapEntry > & rMapping,
+ bool bEnglish );
+
+ /** Get current OpCodeMap in effect. */
+ inline OpCodeMapPtr GetCurrentOpCodeMap() const { return mxSymbols; }
+
+ /** Get OpCode for English symbol.
+ Used in XFunctionAccess to create token array.
+ @param rName
+ Symbol to lookup. MUST be upper case.
+ */
+ OpCode GetEnglishOpCode( const String& rName ) const;
+
+ sal_uInt16 GetErrorConstant( const String& rName ) const;
+
+ void SetCompileForFAP( bool bVal )
+ { bCompileForFAP = bVal; bIgnoreErrors = bVal; }
+
+ static bool IsOpCodeVolatile( OpCode eOp );
+
+ static bool DeQuote( String& rStr );
+
+
+ static const String& GetNativeSymbol( OpCode eOp );
+ static bool IsMatrixFunction(OpCode _eOpCode); // if a function _always_ returns a Matrix
+
+ short GetNumFormatType() const { return nNumFmt; }
+ bool CompileTokenArray();
+
+ void CreateStringFromTokenArray( String& rFormula );
+ void CreateStringFromTokenArray( OUStringBuffer& rBuffer );
+ FormulaToken* CreateStringFromToken( String& rFormula, FormulaToken* pToken,
+ bool bAllowArrAdvance = false );
+ FormulaToken* CreateStringFromToken( OUStringBuffer& rBuffer, FormulaToken* pToken,
+ bool bAllowArrAdvance = false );
+
+ void AppendBoolean( OUStringBuffer& rBuffer, bool bVal );
+ void AppendDouble( OUStringBuffer& rBuffer, double fVal );
+ void AppendString( OUStringBuffer& rBuffer, const String & rStr );
+
+ /** Set symbol map corresponding to one of predefined formula::FormulaGrammar::Grammar,
+ including an address reference convention. */
+ inline FormulaGrammar::Grammar GetGrammar() const { return meGrammar; }
+
+ static void UpdateSeparatorsNative( const OUString& rSep, const OUString& rArrayColSep, const OUString& rArrayRowSep );
+ static void ResetNativeSymbols();
+ static void SetNativeSymbols( const OpCodeMapPtr& xMap );
+protected:
+ virtual String FindAddInFunction( const String& rUpperName, bool bLocalFirst ) const;
+ virtual void fillFromAddInCollectionUpperName( NonConstOpCodeMapPtr xMap ) const;
+ virtual void fillFromAddInMap( NonConstOpCodeMapPtr xMap, FormulaGrammar::Grammar _eGrammar ) const;
+ virtual void fillFromAddInCollectionEnglishName( NonConstOpCodeMapPtr xMap ) const;
+ virtual void fillAddInToken(::std::vector< ::com::sun::star::sheet::FormulaOpCodeMapEntry >& _rVec,bool _bIsEnglish) const;
+
+ virtual void SetError(sal_uInt16 nError);
+ virtual FormulaTokenRef ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2, bool bReuseDoubleRef );
+ virtual bool HandleExternalReference(const FormulaToken& _aToken);
+ virtual bool HandleRange();
+ virtual bool HandleSingleRef();
+ virtual bool HandleDbData();
+
+ virtual void CreateStringFromExternal(OUStringBuffer& rBuffer, FormulaToken* pTokenP);
+ virtual void CreateStringFromSingleRef(OUStringBuffer& rBuffer,FormulaToken* pTokenP);
+ virtual void CreateStringFromDoubleRef(OUStringBuffer& rBuffer,FormulaToken* pTokenP);
+ virtual void CreateStringFromMatrix(OUStringBuffer& rBuffer,FormulaToken* pTokenP);
+ virtual void CreateStringFromIndex(OUStringBuffer& rBuffer,FormulaToken* pTokenP);
+ virtual void LocalizeString( String& rName ); // modify rName - input: exact name
+
+ void AppendErrorConstant( OUStringBuffer& rBuffer, sal_uInt16 nError );
+
+ bool GetToken();
+ OpCode NextToken();
+ void PutCode( FormulaTokenRef& );
+ void Factor();
+ void RangeLine();
+ void UnionLine();
+ void IntersectionLine();
+ void UnaryLine();
+ void PostOpLine();
+ void PowLine();
+ void MulDivLine();
+ void AddSubLine();
+ void ConcatLine();
+ void CompareLine();
+ void NotLine();
+ OpCode Expression();
+ void PopTokenArray();
+ void PushTokenArray( FormulaTokenArray*, bool = false );
+
+ bool MergeRangeReference( FormulaToken * * const pCode1, FormulaToken * const * const pCode2 );
+
+ String aCorrectedFormula; // autocorrected Formula
+ String aCorrectedSymbol; // autocorrected Symbol
+
+ OpCodeMapPtr mxSymbols; // which symbols are used
+
+ FormulaTokenRef mpToken; // current token
+ FormulaTokenRef pCurrentFactorToken; // current factor token (of Factor() method)
+ FormulaTokenArray* pArr;
+ ExternalReferenceHelper* pExternalRef;
+
+ FormulaToken** pCode;
+ FormulaArrayStack* pStack;
+
+ OpCode eLastOp;
+ short nRecursion; // GetToken() recursions
+ short nNumFmt; // set during CompileTokenArray()
+ sal_uInt16 pc; // program counter
+
+ FormulaGrammar::Grammar meGrammar; // The grammar used, language plus convention.
+
+ bool bAutoCorrect; // whether to apply AutoCorrection
+ bool bCorrected; // AutoCorrection was applied
+ bool bCompileForFAP; //! not real RPN but names, for FunctionAutoPilot
+ // will not be resolved
+ bool bIgnoreErrors; // on AutoCorrect and CompileForFAP
+ // ignore errors and create RPN nevertheless
+ bool glSubTotal; // if code contains one or more subtotal functions
+private:
+ void InitSymbolsNative() const; /// only SymbolsNative, on first document creation
+ void InitSymbolsEnglish() const; /// only SymbolsEnglish, maybe later
+ void InitSymbolsPODF() const; /// only SymbolsPODF, on demand
+ void InitSymbolsODFF() const; /// only SymbolsODFF, on demand
+ void InitSymbolsEnglishXL() const; /// only SymbolsEnglishXL, on demand
+
+ void loadSymbols(sal_uInt16 _nSymbols,FormulaGrammar::Grammar _eGrammar,NonConstOpCodeMapPtr& _xMap) const;
+
+ static inline void ForceArrayOperator( FormulaTokenRef& rCurr, const FormulaTokenRef& rPrev )
+ {
+ if ( rPrev && rPrev->HasForceArray() &&
+ rCurr->GetType() == svByte && rCurr->GetOpCode() != ocPush
+ && !rCurr->HasForceArray() )
+ rCurr->SetForceArray( true);
+ }
+
+ // SUNWS7 needs a forward declared friend, otherwise members of the outer
+ // class are not accessible.
+ class CurrentFactor;
+ friend class FormulaCompiler::CurrentFactor;
+ class CurrentFactor
+ {
+ FormulaTokenRef pPrevFac;
+ FormulaCompiler* pCompiler;
+ // not implemented
+ CurrentFactor( const CurrentFactor& );
+ CurrentFactor& operator=( const CurrentFactor& );
+ public:
+ explicit CurrentFactor( FormulaCompiler* pComp )
+ : pPrevFac( pComp->pCurrentFactorToken )
+ , pCompiler( pComp )
+ {}
+ ~CurrentFactor()
+ { pCompiler->pCurrentFactorToken = pPrevFac; }
+ // yes, this operator= may modify the RValue
+ void operator=( FormulaTokenRef& r )
+ {
+ ForceArrayOperator( r, pPrevFac);
+ pCompiler->pCurrentFactorToken = r;
+ }
+ void operator=( FormulaToken* p )
+ {
+ FormulaTokenRef xTemp( p );
+ *this = xTemp;
+ }
+ operator FormulaTokenRef&()
+ { return pCompiler->pCurrentFactorToken; }
+ FormulaToken* operator->()
+ { return pCompiler->pCurrentFactorToken.operator->(); }
+ operator FormulaToken*()
+ { return operator->(); }
+ };
+
+
+ mutable NonConstOpCodeMapPtr mxSymbolsODFF; // ODFF symbols
+ mutable NonConstOpCodeMapPtr mxSymbolsPODF; // ODF 1.1 symbols
+ mutable NonConstOpCodeMapPtr mxSymbolsNative; // native symbols
+ mutable NonConstOpCodeMapPtr mxSymbolsEnglish; // English symbols
+ mutable NonConstOpCodeMapPtr mxSymbolsEnglishXL; // English Excel symbols (for VBA formula parsing)
+};
+// =============================================================================
+} // formula
+// =============================================================================
+
+#endif // FORMULA_COMPILER_HXX_INCLUDED
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/FormulaOpCodeMapperObj.hxx b/include/formula/FormulaOpCodeMapperObj.hxx
new file mode 100644
index 000000000000..07945ca27101
--- /dev/null
+++ b/include/formula/FormulaOpCodeMapperObj.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 FORMULA_FORMULAOPCODEMAPPER_HXX_INCLUDED
+#define FORMULA_FORMULAOPCODEMAPPER_HXX_INCLUDED
+
+#include "formula/formuladllapi.h"
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/sheet/XFormulaOpCodeMapper.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <memory>
+#include "formula/FormulaCompiler.hxx"
+
+
+namespace formula
+{
+
+class FORMULA_DLLPUBLIC FormulaOpCodeMapperObj : public ::cppu::WeakImplHelper2<
+ ::com::sun::star::sheet::XFormulaOpCodeMapper,
+ ::com::sun::star::lang::XServiceInfo >
+{
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ ::std::auto_ptr<FormulaCompiler> m_pCompiler;
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+public:
+ static OUString getImplementationName_Static();
+ static ::com::sun::star::uno::Sequence< OUString> getSupportedServiceNames_Static();
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext);
+
+protected:
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler> _pCompiler);
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+ virtual ~FormulaOpCodeMapperObj();
+
+private:
+ // XFormulaOpCodeMapper
+ // Attributes
+ virtual ::sal_Int32 SAL_CALL getOpCodeExternal() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getOpCodeUnknown() throw (::com::sun::star::uno::RuntimeException);
+ // Methods
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getMappings(
+ const ::com::sun::star::uno::Sequence< OUString >& rNames,
+ sal_Int32 nLanguage )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaOpCodeMapEntry > SAL_CALL getAvailableMappings(
+ sal_Int32 nLanguage, sal_Int32 nGroups )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
+ throw(::com::sun::star::uno::RuntimeException);
+
+};
+// =============================================================================
+} // formula
+// =============================================================================
+
+#endif // FORMULA_FORMULAOPCODEMAPPER_HXX_INCLUDED
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/IControlReferenceHandler.hxx b/include/formula/IControlReferenceHandler.hxx
new file mode 100644
index 000000000000..bee4bac3953e
--- /dev/null
+++ b/include/formula/IControlReferenceHandler.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 FORMULA_ICONTROL_REFERENCE_HANDLER_HXX_INCLUDED
+#define FORMULA_ICONTROL_REFERENCE_HANDLER_HXX_INCLUDED
+
+#include "formula/formuladllapi.h"
+
+namespace formula
+{
+ class RefEdit;
+ class RefButton;
+ class FORMULA_DLLPUBLIC SAL_NO_VTABLE IControlReferenceHandler
+ {
+ public:
+ virtual void ShowReference(const String& _sRef) = 0;
+ virtual void HideReference( sal_Bool bDoneRefMode = sal_True ) = 0;
+ virtual void ReleaseFocus( RefEdit* pEdit, RefButton* pButton = NULL ) = 0;
+ virtual void ToggleCollapsed( RefEdit* pEdit, RefButton* pButton = NULL ) = 0;
+
+ protected:
+ ~IControlReferenceHandler() {}
+ };
+} // formula
+#endif // FORMULA_ICONTROL_REFERENCE_HANDLER_HXX_INCLUDED
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/IFunctionDescription.hxx b/include/formula/IFunctionDescription.hxx
new file mode 100644
index 000000000000..1747c2f2ddce
--- /dev/null
+++ b/include/formula/IFunctionDescription.hxx
@@ -0,0 +1,170 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDE_FUNCTION_DESCRIPTION
+#define INCLUDE_FUNCTION_DESCRIPTION
+
+#include <vector>
+#include <memory>
+#include "formula/formuladllapi.h"
+#include <rtl/ustring.hxx>
+#include <tools/string.hxx>
+#include <com/sun/star/sheet/XFormulaParser.hpp>
+#include <com/sun/star/sheet/XFormulaOpCodeMapper.hpp>
+
+class SvTreeListEntry;
+
+namespace formula
+{
+ class IFunctionCategory;
+ class IFunctionDescription;
+ class FormEditData;
+ class FormulaTokenArray;
+
+ class SAL_NO_VTABLE IFunctionManager
+ {
+ public:
+ IFunctionManager(){}
+ enum EToken
+ {
+ eOk,
+ eClose,
+ eSep,
+ eArrayOpen,
+ eArrayClose
+ };
+ virtual sal_uInt32 getCount() const = 0;
+ virtual const IFunctionCategory* getCategory(sal_uInt32 nPos) const = 0;
+ virtual void fillLastRecentlyUsedFunctions(::std::vector< const IFunctionDescription*>& _rLastRUFunctions) const = 0;
+ virtual const IFunctionDescription* getFunctionByName(const OUString& _sFunctionName) const = 0;
+
+ virtual sal_Unicode getSingleToken(const EToken _eToken) const = 0;
+
+ protected:
+ ~IFunctionManager() {}
+ };
+
+ class SAL_NO_VTABLE IFunctionCategory
+ {
+ public:
+ IFunctionCategory(){}
+ virtual const IFunctionManager* getFunctionManager() const = 0;
+ virtual sal_uInt32 getCount() const = 0;
+ virtual const IFunctionDescription* getFunction(sal_uInt32 _nPos) const = 0;
+ virtual sal_uInt32 getNumber() const = 0;
+ virtual OUString getName() const = 0;
+
+ protected:
+ ~IFunctionCategory() {}
+ };
+
+ class SAL_NO_VTABLE IFunctionDescription
+ {
+ public:
+ IFunctionDescription(){}
+ virtual OUString getFunctionName() const = 0;
+ virtual const IFunctionCategory* getCategory() const = 0;
+ virtual OUString getDescription() const = 0;
+ // GetSuppressedArgCount
+ virtual xub_StrLen getSuppressedArgumentCount() const = 0;
+ // GetFormulaString
+ virtual OUString getFormula(const ::std::vector< OUString >& _aArguments) const = 0;
+ // GetVisibleArgMapping
+ virtual void fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const = 0;
+ virtual void initArgumentInfo() const = 0;
+ virtual OUString getSignature() const = 0;
+ virtual OString getHelpId() const = 0;
+
+ // parameter
+ virtual sal_uInt32 getParameterCount() const = 0;
+ virtual OUString getParameterName(sal_uInt32 _nPos) const = 0;
+ virtual OUString getParameterDescription(sal_uInt32 _nPos) const = 0;
+ virtual bool isParameterOptional(sal_uInt32 _nPos) const = 0;
+
+ protected:
+ ~IFunctionDescription() {}
+ };
+
+ class SAL_NO_VTABLE IFormulaToken
+ {
+ public:
+ virtual bool isFunction() const = 0;
+ virtual sal_uInt32 getArgumentCount() const = 0;
+
+ protected:
+ ~IFormulaToken() {}
+ };
+
+ class SAL_NO_VTABLE IStructHelper
+ {
+ public:
+ IStructHelper(){}
+ virtual SvTreeListEntry* InsertEntry(const XubString& rText, SvTreeListEntry* pParent,
+ sal_uInt16 nFlag,sal_uLong nPos=0,IFormulaToken* pScToken=NULL) = 0;
+
+ virtual String GetEntryText(SvTreeListEntry* pEntry) const = 0;
+ virtual SvTreeListEntry* GetParent(SvTreeListEntry* pEntry) const = 0;
+
+ protected:
+ ~IStructHelper() {}
+ };
+
+ class SAL_NO_VTABLE IFormulaEditorHelper
+ {
+ public:
+ IFormulaEditorHelper(){}
+ virtual void notifyChange() = 0;
+ virtual void fill() = 0;
+
+ virtual String getCurrentFormula() const = 0;
+ virtual void setCurrentFormula(const String& _sReplacement) = 0;
+
+ virtual void getSelection(xub_StrLen& _nStart,xub_StrLen& _nEnd) const = 0;
+ virtual void setSelection(xub_StrLen _nStart,xub_StrLen _nEnd) = 0;
+
+ virtual FormEditData* getFormEditData() const = 0;
+ virtual bool calculateValue(const String& _sExpression,String& _rResult) = 0;
+
+ virtual void switchBack() = 0;
+
+ virtual void clear() = 0;
+ virtual void deleteFormData() = 0;
+ virtual void setReferenceInput(const FormEditData* _pData) = 0;
+
+ virtual IFunctionManager* getFunctionManager() = 0;
+ virtual ::std::auto_ptr<FormulaTokenArray> convertToTokenArray(const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& _aTokenList) = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser> getFormulaParser() const = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const = 0;
+ virtual ::com::sun::star::table::CellAddress getReferencePosition() const = 0;
+
+ virtual void setDispatcherLock( sal_Bool bLock ) = 0;
+ virtual void dispatch(sal_Bool _bOK,sal_Bool _bMartixChecked) = 0;
+ virtual void doClose(sal_Bool _bOk) = 0;
+ virtual void insertEntryToLRUList(const IFunctionDescription* pDesc) = 0;
+ virtual void showReference(const String& _sFormula) = 0;
+
+ protected:
+ ~IFormulaEditorHelper() {}
+ };
+
+}
+#endif //INCLUDE_FUNCTION_DESCRIPTION
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
new file mode 100644
index 000000000000..053947c2a796
--- /dev/null
+++ b/include/formula/compiler.hrc
@@ -0,0 +1,423 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef FORMULA_COMPILER_HRC
+#define FORMULA_COMPILER_HRC
+
+/* Central definition of OpCodes for spreadsheet functions */
+
+/*** Special commands ***/
+#define SC_OPCODE_PUSH 0 /* internal commands */
+#define SC_OPCODE_CALL 1
+#define SC_OPCODE_STOP 2
+#define SC_OPCODE_EXTERNAL 3
+#define SC_OPCODE_NAME 4
+#define SC_OPCODE_EXTERNAL_REF 5
+#define SC_OPCODE_IF 6 /* jump commands */
+#define SC_OPCODE_IF_ERROR 7
+#define SC_OPCODE_IF_NA 8
+#define SC_OPCODE_CHOSE 9
+#define SC_OPCODE_OPEN 10 /* parentheses and separators */
+#define SC_OPCODE_CLOSE 11
+#define SC_OPCODE_SEP 12
+#define SC_OPCODE_MISSING 13 /* special OpCodes */
+#define SC_OPCODE_BAD 14
+#define SC_OPCODE_STRINGXML 15
+#define SC_OPCODE_SPACES 16
+#define SC_OPCODE_MAT_REF 17
+#define SC_OPCODE_DB_AREA 18 /* additional access operators */
+#define SC_OPCODE_MACRO 19
+#define SC_OPCODE_COL_ROW_NAME 20
+#define SC_OPCODE_COL_ROW_NAME_AUTO 21
+#define SC_OPCODE_PERCENT_SIGN 22 /* operator _follows_ value */
+#define SC_OPCODE_ARRAY_OPEN 23
+#define SC_OPCODE_ARRAY_CLOSE 24
+#define SC_OPCODE_ARRAY_ROW_SEP 25
+#define SC_OPCODE_ARRAY_COL_SEP 26 /* some convs use sep != col_sep */
+#define SC_OPCODE_STOP_DIV 27
+#define SC_OPCODE_SKIP 28 /* used to skip raw tokens during string compilation */
+
+/*** error constants #... ***/
+#define SC_OPCODE_START_ERRORS 30
+#define SC_OPCODE_ERROR_NULL 30
+#define SC_OPCODE_ERROR_DIVZERO 31
+#define SC_OPCODE_ERROR_VALUE 32
+#define SC_OPCODE_ERROR_REF 33
+#define SC_OPCODE_ERROR_NAME 34
+#define SC_OPCODE_ERROR_NUM 35
+#define SC_OPCODE_ERROR_NA 36
+#define SC_OPCODE_STOP_ERRORS 37
+
+/*** Binary operators ***/
+#define SC_OPCODE_START_BIN_OP 40
+#define SC_OPCODE_ADD 40
+#define SC_OPCODE_SUB 41
+#define SC_OPCODE_MUL 42
+#define SC_OPCODE_DIV 43
+#define SC_OPCODE_AMPERSAND 44
+#define SC_OPCODE_POW 45
+#define SC_OPCODE_EQUAL 46
+#define SC_OPCODE_NOT_EQUAL 47
+#define SC_OPCODE_LESS 48
+#define SC_OPCODE_GREATER 49
+#define SC_OPCODE_LESS_EQUAL 50
+#define SC_OPCODE_GREATER_EQUAL 51
+#define SC_OPCODE_AND 52
+#define SC_OPCODE_OR 53
+#define SC_OPCODE_INTERSECT 54
+#define SC_OPCODE_UNION 55
+#define SC_OPCODE_RANGE 56
+#define SC_OPCODE_STOP_BIN_OP 57
+
+/* NOTE: binary and unary operators must be in sequence for compiler! */
+
+/*** Unary operators ***/
+#define SC_OPCODE_START_UN_OP 60
+#define SC_OPCODE_NOT 60
+#define SC_OPCODE_NEG 61
+#define SC_OPCODE_NEG_SUB 62
+#define SC_OPCODE_STOP_UN_OP 63
+
+#define SC_OPCODE_START_FUNCTION 65
+
+/*** Functions without parameters ***/
+#define SC_OPCODE_START_NO_PAR 65
+#define SC_OPCODE_PI 65
+#define SC_OPCODE_RANDOM 66
+#define SC_OPCODE_TRUE 67
+#define SC_OPCODE_FALSE 68
+#define SC_OPCODE_GET_ACT_DATE 69
+#define SC_OPCODE_GET_ACT_TIME 70
+#define SC_OPCODE_NO_VALUE 71
+#define SC_OPCODE_CURRENT 72
+#define SC_OPCODE_STOP_NO_PAR 73
+
+/*** Functions with one parameter ***/
+#define SC_OPCODE_START_1_PAR 80
+#define SC_OPCODE_DEG 80 /* trigonometric */
+#define SC_OPCODE_RAD 81
+#define SC_OPCODE_SIN 82
+#define SC_OPCODE_COS 83
+#define SC_OPCODE_TAN 84
+#define SC_OPCODE_COT 85
+#define SC_OPCODE_ARC_SIN 86
+#define SC_OPCODE_ARC_COS 87
+#define SC_OPCODE_ARC_TAN 88
+#define SC_OPCODE_ARC_COT 89
+#define SC_OPCODE_SIN_HYP 90
+#define SC_OPCODE_COS_HYP 91
+#define SC_OPCODE_TAN_HYP 92
+#define SC_OPCODE_COT_HYP 93
+#define SC_OPCODE_ARC_SIN_HYP 94 /* transcendent */
+#define SC_OPCODE_ARC_COS_HYP 95
+#define SC_OPCODE_ARC_TAN_HYP 96
+#define SC_OPCODE_ARC_COT_HYP 97
+#define SC_OPCODE_COSECANT 98
+#define SC_OPCODE_SECANT 99
+#define SC_OPCODE_COSECANT_HYP 100
+#define SC_OPCODE_SECANT_HYP 101
+#define SC_OPCODE_EXP 102
+#define SC_OPCODE_LN 103
+#define SC_OPCODE_SQRT 104
+#define SC_OPCODE_FACT 105
+#define SC_OPCODE_GET_YEAR 106 /* date and time */
+#define SC_OPCODE_GET_MONTH 107
+#define SC_OPCODE_GET_DAY 108
+#define SC_OPCODE_GET_HOUR 109
+#define SC_OPCODE_GET_MIN 110
+#define SC_OPCODE_GET_SEC 111
+#define SC_OPCODE_PLUS_MINUS 112 /* miscellaneous */
+#define SC_OPCODE_ABS 113
+#define SC_OPCODE_INT 114
+#define SC_OPCODE_PHI 115
+#define SC_OPCODE_GAUSS 116
+#define SC_OPCODE_IS_EMPTY 117 /* obtain type */
+#define SC_OPCODE_IS_STRING 118
+#define SC_OPCODE_IS_NON_STRING 119
+#define SC_OPCODE_IS_LOGICAL 120
+#define SC_OPCODE_TYPE 121
+#define SC_OPCODE_IS_REF 122
+#define SC_OPCODE_IS_VALUE 123
+#define SC_OPCODE_IS_FORMULA 124
+#define SC_OPCODE_IS_NV 125
+#define SC_OPCODE_IS_ERR 126
+#define SC_OPCODE_IS_ERROR 127
+#define SC_OPCODE_IS_EVEN 128
+#define SC_OPCODE_IS_ODD 129
+#define SC_OPCODE_N 130
+#define SC_OPCODE_GET_DATE_VALUE 131 /* string functions */
+#define SC_OPCODE_GET_TIME_VALUE 132
+#define SC_OPCODE_CODE 133
+#define SC_OPCODE_TRIM 134
+#define SC_OPCODE_UPPER 135
+#define SC_OPCODE_PROPPER 136
+#define SC_OPCODE_LOWER 137
+#define SC_OPCODE_LEN 138
+#define SC_OPCODE_T 139 /* miscellaneous, part 21 */
+#define SC_OPCODE_VALUE 140
+#define SC_OPCODE_CLEAN 141
+#define SC_OPCODE_CHAR 142
+#define SC_OPCODE_LOG10 143
+#define SC_OPCODE_EVEN 144
+#define SC_OPCODE_ODD 145
+#define SC_OPCODE_STD_NORM_DIST 146
+#define SC_OPCODE_FISHER 147
+#define SC_OPCODE_FISHER_INV 148
+#define SC_OPCODE_S_NORM_INV 149
+#define SC_OPCODE_GAMMA_LN 150
+#define SC_OPCODE_ERROR_TYPE 151
+#define SC_OPCODE_ERR_CELL 152
+#define SC_OPCODE_FORMULA 153
+#define SC_OPCODE_ARABIC 154
+#define SC_OPCODE_INFO 155
+#define SC_OPCODE_BAHTTEXT 156
+#define SC_OPCODE_JIS 157
+#define SC_OPCODE_ASC 158
+#define SC_OPCODE_UNICODE 159
+#define SC_OPCODE_UNICHAR 160
+#define SC_OPCODE_GAMMA 161
+#define SC_OPCODE_STOP_1_PAR 162
+
+/*** Functions with more than one parameters ***/
+#define SC_OPCODE_START_2_PAR 201
+#define SC_OPCODE_ARC_TAN_2 201
+#define SC_OPCODE_CEIL 202
+#define SC_OPCODE_FLOOR 203
+#define SC_OPCODE_ROUND 204
+#define SC_OPCODE_ROUND_UP 205
+#define SC_OPCODE_ROUND_DOWN 206
+#define SC_OPCODE_TRUNC 207
+#define SC_OPCODE_LOG 208
+#define SC_OPCODE_POWER 209
+#define SC_OPCODE_GGT 210
+#define SC_OPCODE_KGV 211
+#define SC_OPCODE_MOD 212
+#define SC_OPCODE_SUM_PRODUCT 213
+#define SC_OPCODE_SUM_SQ 214
+#define SC_OPCODE_SUM_X2MY2 215
+#define SC_OPCODE_SUM_X2DY2 216
+#define SC_OPCODE_SUM_XMY2 217
+#define SC_OPCODE_GET_DATE 218
+#define SC_OPCODE_GET_TIME 219
+#define SC_OPCODE_GET_DIFF_DATE 220
+#define SC_OPCODE_GET_DIFF_DATE_360 221
+#define SC_OPCODE_MIN 222
+#define SC_OPCODE_MAX 223
+#define SC_OPCODE_SUM 224
+#define SC_OPCODE_PRODUCT 225
+#define SC_OPCODE_AVERAGE 226
+#define SC_OPCODE_COUNT 227
+#define SC_OPCODE_COUNT_2 228
+#define SC_OPCODE_NBW 229
+#define SC_OPCODE_IKV 230
+#define SC_OPCODE_VAR 231
+#define SC_OPCODE_VAR_P 232
+#define SC_OPCODE_ST_DEV 233
+#define SC_OPCODE_ST_DEV_P 234
+#define SC_OPCODE_B 235
+#define SC_OPCODE_NORM_DIST 236
+#define SC_OPCODE_EXP_DIST 237
+#define SC_OPCODE_BINOM_DIST 238
+#define SC_OPCODE_POISSON_DIST 239
+#define SC_OPCODE_KOMBIN 240
+#define SC_OPCODE_KOMBIN_2 241
+#define SC_OPCODE_VARIATIONEN 242
+#define SC_OPCODE_VARIATIONEN_2 243
+#define SC_OPCODE_BW 244
+#define SC_OPCODE_DIA 245
+#define SC_OPCODE_GDA 246
+#define SC_OPCODE_GDA_2 247
+#define SC_OPCODE_VBD 248
+#define SC_OPCODE_LAUFZ 249
+#define SC_OPCODE_LIA 250
+#define SC_OPCODE_RMZ 251
+#define SC_OPCODE_COLUMNS 252
+#define SC_OPCODE_ROWS 253
+#define SC_OPCODE_COLUMN 254
+#define SC_OPCODE_ROW 255
+#define SC_OPCODE_ZGZ 256
+#define SC_OPCODE_ZW 257
+#define SC_OPCODE_ZZR 258
+#define SC_OPCODE_ZINS 259
+#define SC_OPCODE_ZINS_Z 260
+#define SC_OPCODE_KAPZ 261
+#define SC_OPCODE_KUM_ZINS_Z 262
+#define SC_OPCODE_KUM_KAP_Z 263
+#define SC_OPCODE_EFFEKTIV 264
+#define SC_OPCODE_NOMINAL 265
+#define SC_OPCODE_SUB_TOTAL 266
+#define SC_OPCODE_DB_SUM 267 /* database functions */
+#define SC_OPCODE_DB_COUNT 268
+#define SC_OPCODE_DB_COUNT_2 269
+#define SC_OPCODE_DB_AVERAGE 270
+#define SC_OPCODE_DB_GET 271
+#define SC_OPCODE_DB_MAX 272
+#define SC_OPCODE_DB_MIN 273
+#define SC_OPCODE_DB_PRODUCT 274
+#define SC_OPCODE_DB_STD_DEV 275
+#define SC_OPCODE_DB_STD_DEV_P 276
+#define SC_OPCODE_DB_VAR 277
+#define SC_OPCODE_DB_VAR_P 278
+#define SC_OPCODE_INDIRECT 279 /* management functions */
+#define SC_OPCODE_ADDRESS 280
+#define SC_OPCODE_MATCH 281
+#define SC_OPCODE_COUNT_EMPTY_CELLS 282
+#define SC_OPCODE_COUNT_IF 283
+#define SC_OPCODE_SUM_IF 284
+#define SC_OPCODE_LOOKUP 285
+#define SC_OPCODE_V_LOOKUP 286
+#define SC_OPCODE_H_LOOKUP 287
+#define SC_OPCODE_MULTI_AREA 288
+#define SC_OPCODE_OFFSET 289
+#define SC_OPCODE_INDEX 290
+#define SC_OPCODE_AREAS 291
+#define SC_OPCODE_CURRENCY 292 /* string functions */
+#define SC_OPCODE_REPLACE 293
+#define SC_OPCODE_FIXED 294
+#define SC_OPCODE_FIND 295
+#define SC_OPCODE_EXACT 296
+#define SC_OPCODE_LEFT 297
+#define SC_OPCODE_RIGHT 298
+#define SC_OPCODE_SEARCH 299
+#define SC_OPCODE_MID 300
+#define SC_OPCODE_TEXT 301
+#define SC_OPCODE_SUBSTITUTE 302
+#define SC_OPCODE_REPT 303
+#define SC_OPCODE_CONCAT 304
+#define SC_OPCODE_MAT_VALUE 305 /* matrix functions */
+#define SC_OPCODE_MAT_DET 306
+#define SC_OPCODE_MAT_INV 307
+#define SC_OPCODE_MAT_MULT 308
+#define SC_OPCODE_MAT_TRANS 309
+#define SC_OPCODE_MATRIX_UNIT 310
+#define SC_OPCODE_BACK_SOLVER 311 /* BackSolver */
+#define SC_OPCODE_HYP_GEOM_DIST 312 /* statistical functions */
+#define SC_OPCODE_LOG_NORM_DIST 313
+#define SC_OPCODE_T_DIST 314
+#define SC_OPCODE_F_DIST 315
+#define SC_OPCODE_CHI_DIST 316
+#define SC_OPCODE_WEIBULL 317
+#define SC_OPCODE_NEG_BINOM_VERT 318
+#define SC_OPCODE_KRIT_BINOM 319
+#define SC_OPCODE_KURT 320
+#define SC_OPCODE_HAR_MEAN 321
+#define SC_OPCODE_GEO_MEAN 322
+#define SC_OPCODE_STANDARD 323
+#define SC_OPCODE_AVE_DEV 324
+#define SC_OPCODE_SCHIEFE 325
+#define SC_OPCODE_DEV_SQ 326
+#define SC_OPCODE_MEDIAN 327
+#define SC_OPCODE_MODAL_VALUE 328
+#define SC_OPCODE_Z_TEST 329
+#define SC_OPCODE_T_TEST 330
+#define SC_OPCODE_RANK 331
+#define SC_OPCODE_PERCENTILE 332
+#define SC_OPCODE_PERCENT_RANK 333
+#define SC_OPCODE_LARGE 334
+#define SC_OPCODE_SMALL 335
+#define SC_OPCODE_FREQUENCY 336
+#define SC_OPCODE_QUARTILE 337
+#define SC_OPCODE_NORM_INV 338
+#define SC_OPCODE_CONFIDENCE 339
+#define SC_OPCODE_F_TEST 340
+#define SC_OPCODE_TRIM_MEAN 341
+#define SC_OPCODE_PROB 342
+#define SC_OPCODE_CORREL 343
+#define SC_OPCODE_COVAR 344
+#define SC_OPCODE_PEARSON 345
+#define SC_OPCODE_RSQ 346
+#define SC_OPCODE_STEYX 347
+#define SC_OPCODE_SLOPE 348
+#define SC_OPCODE_INTERCEPT 349
+#define SC_OPCODE_TREND 350
+#define SC_OPCODE_GROWTH 351
+#define SC_OPCODE_RGP 352
+#define SC_OPCODE_RKP 353
+#define SC_OPCODE_FORECAST 354
+#define SC_OPCODE_CHI_INV 355
+#define SC_OPCODE_GAMMA_DIST 356
+#define SC_OPCODE_GAMMA_INV 357
+#define SC_OPCODE_T_INV 358
+#define SC_OPCODE_F_INV 359
+#define SC_OPCODE_CHI_TEST 360
+#define SC_OPCODE_LOG_INV 361
+#define SC_OPCODE_TABLE_OP 362
+#define SC_OPCODE_BETA_DIST 363
+#define SC_OPCODE_BETA_INV 364
+#define SC_OPCODE_WEEK 365 /* miscellaneous */
+#define SC_OPCODE_GET_DAY_OF_WEEK 366
+#define SC_OPCODE_NO_NAME 367
+#define SC_OPCODE_STYLE 368
+#define SC_OPCODE_DDE 369
+#define SC_OPCODE_BASE 370
+#define SC_OPCODE_TABLE 371
+#define SC_OPCODE_TABLES 372
+#define SC_OPCODE_MIN_A 373
+#define SC_OPCODE_MAX_A 374
+#define SC_OPCODE_AVERAGE_A 375
+#define SC_OPCODE_ST_DEV_A 376
+#define SC_OPCODE_ST_DEV_P_A 377
+#define SC_OPCODE_VAR_A 378
+#define SC_OPCODE_VAR_P_A 379
+#define SC_OPCODE_EASTERSUNDAY 380
+#define SC_OPCODE_DECIMAL 381
+#define SC_OPCODE_CONVERT 382
+#define SC_OPCODE_ROMAN 383
+#define SC_OPCODE_MIRR 384
+#define SC_OPCODE_CELL 385
+#define SC_OPCODE_ISPMT 386
+#define SC_OPCODE_HYPERLINK 387
+#define SC_OPCODE_INDIRECT_XL 388 /* See also INDIRECT for OOO variant */
+#define SC_OPCODE_ADDRESS_XL 389 /* See also ADRESS for OOO variant */
+#define SC_OPCODE_GET_PIVOT_DATA 390
+#define SC_OPCODE_EUROCONVERT 391
+#define SC_OPCODE_NUMBERVALUE 392
+#define SC_OPCODE_CHISQ_DIST 393
+#define SC_OPCODE_CHISQ_INV 394
+#define SC_OPCODE_BITAND 395
+#define SC_OPCODE_BITOR 396
+#define SC_OPCODE_BITXOR 397
+#define SC_OPCODE_BITRSHIFT 398
+#define SC_OPCODE_BITLSHIFT 399
+#define SC_OPCODE_GET_DATEDIF 400
+#define SC_OPCODE_XOR 401
+#define SC_OPCODE_AVERAGE_IF 402
+#define SC_OPCODE_SUM_IFS 403
+#define SC_OPCODE_AVERAGE_IFS 404
+#define SC_OPCODE_COUNT_IFS 405
+#define SC_OPCODE_SKEWP 406
+#define SC_OPCODE_STOP_2_PAR 407
+#define SC_OPCODE_LAST_OPCODE_ID 406 /* last OpCode */
+
+#define SC_OPCODE_STOP_FUNCTION 407
+
+/*** Internal ***/
+#define SC_OPCODE_INTERNAL_BEGIN 9999
+#define SC_OPCODE_TTT 9999
+#define SC_OPCODE_INTERNAL_END 9999
+
+/*** from here on ExtraData contained ***/
+#define SC_OPCODE_DATA_TOKEN_1 10000
+
+#define SC_OPCODE_NONE 0xFFFF
+
+
+#endif /* FORMULA_COMPILER_HRC */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/errorcodes.hxx b/include/formula/errorcodes.hxx
new file mode 100644
index 000000000000..1e145e04132b
--- /dev/null
+++ b/include/formula/errorcodes.hxx
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SC_ERRORCODES_HXX
+#define SC_ERRORCODES_HXX
+
+#include <rtl/math.hxx>
+#include <tools/solar.h>
+
+namespace ScErrorCodes
+{
+
+const sal_uInt16 errIllegalChar = 501;
+const sal_uInt16 errIllegalArgument = 502;
+const sal_uInt16 errIllegalFPOperation = 503; // #NUM!
+const sal_uInt16 errIllegalParameter = 504;
+const sal_uInt16 errIllegalJump = 505;
+const sal_uInt16 errSeparator = 506;
+const sal_uInt16 errPair = 507;
+const sal_uInt16 errPairExpected = 508;
+const sal_uInt16 errOperatorExpected = 509;
+const sal_uInt16 errVariableExpected = 510;
+const sal_uInt16 errParameterExpected = 511;
+const sal_uInt16 errCodeOverflow = 512;
+const sal_uInt16 errStringOverflow = 513;
+const sal_uInt16 errStackOverflow = 514;
+const sal_uInt16 errUnknownState = 515;
+const sal_uInt16 errUnknownVariable = 516;
+const sal_uInt16 errUnknownOpCode = 517;
+const sal_uInt16 errUnknownStackVariable = 518;
+const sal_uInt16 errNoValue = 519; // #VALUE!
+const sal_uInt16 errUnknownToken = 520;
+const sal_uInt16 errNoCode = 521; // #NULL!
+const sal_uInt16 errCircularReference = 522;
+const sal_uInt16 errNoConvergence = 523;
+const sal_uInt16 errNoRef = 524; // #REF!
+const sal_uInt16 errNoName = 525; // #NAME?
+const sal_uInt16 errDoubleRef = 526;
+const sal_uInt16 errInterpOverflow = 527;
+// Not displayed, temporary for TrackFormulas,
+// Cell depends on another cell that has errCircularReference
+const sal_uInt16 errTrackFromCircRef = 528;
+// ScInterpreter internal: no numeric value but numeric queried. If this is
+// set as mnStringNoValueError no error is generated but 0 returned.
+const sal_uInt16 errCellNoValue = 529;
+// Interpreter: needed AddIn not found
+const sal_uInt16 errNoAddin = 530;
+// Interpreter: needed Macro not found
+const sal_uInt16 errNoMacro = 531;
+// Interpreter: Division by zero
+const sal_uInt16 errDivisionByZero = 532; // #DIV/0!
+// Compiler: a non-simple (str,err,val) value was put in an array
+const sal_uInt16 errNestedArray = 533;
+// ScInterpreter internal: no numeric value but numeric queried. If this is
+// temporarily (!) set as mnStringNoValueError, the error is generated and can
+// be used to distinguish that condition from all other (inherited) errors. Do
+// not use for anything else! Never push or inherit the error otherwise!
+const sal_uInt16 errNotNumericString = 534;
+// ScInterpreter internal: jump matrix already has a result at this position,
+// do not overwrite in case of empty code path.
+const sal_uInt16 errJumpMatHasResult = 535;
+
+// Interpreter: NA() not available condition, not a real error
+const sal_uInt16 NOTAVAILABLE = 0x7fff;
+
+
+/** Unconditionally construct a double value of NAN where the lower bits
+ represent an interpreter error code. */
+inline double CreateDoubleError( sal_uInt16 nErr )
+{
+ union
+ {
+ double fVal;
+ sal_math_Double smVal;
+ };
+ ::rtl::math::setNan( &fVal );
+ smVal.nan_parts.fraction_lo = nErr;
+ return fVal;
+}
+
+
+/** Recreate the error code of a coded double error, if any. */
+inline sal_uInt16 GetDoubleErrorValue( double fVal )
+{
+ if ( ::rtl::math::isFinite( fVal ) )
+ return 0;
+ if ( ::rtl::math::isInf( fVal ) )
+ return errIllegalFPOperation; // normal INF
+ sal_uInt32 nErr = reinterpret_cast< sal_math_Double * >(
+ &fVal)->nan_parts.fraction_lo;
+ if ( nErr & 0xffff0000 )
+ return errNoValue; // just a normal NAN
+ return (sal_uInt16)(nErr & 0x0000ffff); // any other error
+}
+
+} // namespace ScErrorCodes
+
+// yes, exceptionally we put a "using namespace" in a header file..
+using namespace ScErrorCodes;
+
+#endif // SC_ERRORCODES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/formdata.hxx b/include/formula/formdata.hxx
new file mode 100644
index 000000000000..595ddb63fc5a
--- /dev/null
+++ b/include/formula/formdata.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 FORMULA_FORMDATA_HXX
+#define FORMULA_FORMDATA_HXX
+
+#include <tools/string.hxx>
+#include <tools/gen.hxx>
+#include "formula/formuladllapi.h"
+
+//============================================================================
+namespace formula
+{
+class FORMULA_DLLPUBLIC FormEditData
+{
+public:
+ FormEditData();
+ virtual ~FormEditData();
+
+ virtual void SaveValues();
+ sal_Bool HasParent() const { return pParent != NULL; }
+
+ inline sal_uInt16 GetMode() const { return nMode; }
+ inline xub_StrLen GetFStart() const { return nFStart; }
+ inline sal_uInt16 GetCatSel() const { return nCatSel; }
+ inline sal_uInt16 GetFuncSel() const { return nFuncSel; }
+ inline sal_uInt16 GetOffset() const { return nOffset; }
+ inline sal_uInt16 GetEdFocus() const { return nEdFocus; }
+ inline const String& GetUndoStr() const { return aUndoStr; }
+ inline sal_Bool GetMatrixFlag()const{ return bMatrix;}
+ inline OString GetUniqueId()const { return aUniqueId;}
+ inline const Selection& GetSelection()const { return aSelection;}
+
+ inline void SetMode( sal_uInt16 nNew ) { nMode = nNew; }
+ inline void SetFStart( xub_StrLen nNew ) { nFStart = nNew; }
+ inline void SetCatSel( sal_uInt16 nNew ) { nCatSel = nNew; }
+ inline void SetFuncSel( sal_uInt16 nNew ) { nFuncSel = nNew; }
+ inline void SetOffset( sal_uInt16 nNew ) { nOffset = nNew; }
+ inline void SetEdFocus( sal_uInt16 nNew ) { nEdFocus = nNew; }
+ inline void SetUndoStr( const String& rNew ) { aUndoStr = rNew; }
+ inline void SetMatrixFlag(sal_Bool bNew) { bMatrix=bNew;}
+ inline void SetUniqueId(const OString nNew) { aUniqueId=nNew;}
+ inline void SetSelection(const Selection& aSel) { aSelection=aSel;}
+protected:
+ void Reset();
+ FormEditData( const FormEditData& );
+ const FormEditData& operator=( const FormEditData& r );
+
+ FormEditData* pParent; // fuer Verschachtelung
+private:
+ sal_uInt16 nMode; // enum ScFormulaDlgMode
+ xub_StrLen nFStart;
+ sal_uInt16 nCatSel;
+ sal_uInt16 nFuncSel;
+ sal_uInt16 nOffset;
+ sal_uInt16 nEdFocus;
+ String aUndoStr;
+ sal_Bool bMatrix;
+ OString aUniqueId;
+ Selection aSelection;
+};
+
+
+} // formula
+#endif // FORMULA_FORMDATA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/formula.hxx b/include/formula/formula.hxx
new file mode 100644
index 000000000000..5a55f5ca81d1
--- /dev/null
+++ b/include/formula/formula.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 FORMULA_FORMULA_HXX
+#define FORMULA_FORMULA_HXX
+
+#include <sfx2/basedlgs.hxx>
+#include <memory>
+#include "formula/formuladllapi.h"
+#include "formula/omoduleclient.hxx"
+#include <formula/IFunctionDescription.hxx>
+
+namespace formula
+{
+//============================================================================
+#define STRUCT_END 1
+#define STRUCT_FOLDER 2
+#define STRUCT_ERROR 3
+
+enum FormulaDlgMode { FORMULA_FORMDLG_FORMULA, FORMULA_FORMDLG_ARGS, FORMULA_FORMDLG_EDIT };
+
+//============================================================================
+
+class FormulaDlg_Impl;
+class IControlReferenceHandler;
+class IFunctionDescription;
+class IFunctionManager;
+class FormulaHelper;
+class RefEdit;
+class RefButton;
+class FormEditData;
+//============================================================================
+class FORMULA_DLLPUBLIC FormulaModalDialog : public ModalDialog, public formula::IFormulaEditorHelper
+{
+ friend class FormulaDlg_Impl;
+public:
+ FormulaModalDialog( Window* pParent
+ , bool _bSupportFunctionResult
+ , bool _bSupportResult
+ , bool _bSupportMatrix
+ ,IFunctionManager* _pFunctionMgr
+ ,IControlReferenceHandler* _pDlg = NULL );
+ virtual ~FormulaModalDialog();
+private:
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ ::std::auto_ptr<FormulaDlg_Impl> m_pImpl;
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+
+protected:
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ ::std::pair<RefButton*,RefEdit*> RefInputStartBefore( RefEdit* pEdit, RefButton* pButton = NULL );
+ void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL );
+ void RefInputDoneAfter( sal_Bool bForced = sal_False );
+ void SetFocusWin(Window *pWin,const OString& nUniqueId);
+
+ void SetMeText(const String& _sText);
+ void Update();
+ sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/);
+ void Update(const String& _sExp);
+
+ void StoreFormEditData(FormEditData* pData);
+};
+
+class FORMULA_DLLPUBLIC FormulaDlg:
+ private OModuleClient, public SfxModelessDialog, public IFormulaEditorHelper
+ // order of base classes is important, as OModuleClient controls the
+ // lifecycle of the ResMgr passed into SfxModelessDialog (via
+ // formula::ModuleRes), and at least with DBG_UTIL calling TestRes in
+ // ~Resource, the ResMgr must outlive the Resource (from which
+ // SfxModelessDialog ultimately derives)
+{
+ friend class FormulaDlg_Impl;
+public:
+ FormulaDlg( SfxBindings* pB
+ , SfxChildWindow* pCW
+ , Window* pParent
+ , bool _bSupportFunctionResult
+ , bool _bSupportResult
+ , bool _bSupportMatrix
+ , IFunctionManager* _pFunctionMgr
+ , IControlReferenceHandler* _pDlg = NULL );
+ virtual ~FormulaDlg();
+private:
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ ::std::auto_ptr<FormulaDlg_Impl> m_pImpl;
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+
+ DECL_LINK( UpdateFocusHdl, void*);
+protected:
+ void disableOk();
+
+protected:
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ ::std::pair<RefButton*,RefEdit*> RefInputStartBefore( RefEdit* pEdit, RefButton* pButton = NULL );
+ void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL );
+ void RefInputDoneAfter( sal_Bool bForced = sal_False );
+ void SetFocusWin(Window *pWin,const OString& nUniqueId);
+ void HighlightFunctionParas(const String& aFormula);
+
+ void SetMeText(const String& _sText);
+ FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate);
+ void Update();
+ sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/);
+ String GetMeText() const;
+ void Update(const String& _sExp);
+ void CheckMatrix();
+ void DoEnter(sal_Bool _bOk);
+ sal_Bool isUserMatrix() const;
+ const IFunctionDescription* getCurrentFunctionDescription() const;
+ sal_Bool UpdateParaWin(Selection& _rSelection);
+ void UpdateParaWin(const Selection& _rSelection,const String& _sRefStr);
+ RefEdit* GetActiveEdit();
+ void SetEdSelection();
+
+ void StoreFormEditData(FormEditData* pData);
+
+ const FormulaHelper& GetFormulaHelper() const;
+};
+
+} // formula
+
+#endif // FORMULA_FORMULA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/formuladllapi.h b/include/formula/formuladllapi.h
new file mode 100644
index 000000000000..b2f4b06bd1a8
--- /dev/null
+++ b/include/formula/formuladllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_FORMULADLLAPI_H
+#define INCLUDED_FORMULADLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(FORMULA_DLLIMPLEMENTATION)
+#define FORMULA_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define FORMULA_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define FORMULA_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_FORMULADLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/formulahelper.hxx b/include/formula/formulahelper.hxx
new file mode 100644
index 000000000000..27c9b6683964
--- /dev/null
+++ b/include/formula/formulahelper.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 FORMULA_FORMULA_HELPER_HXX
+#define FORMULA_FORMULA_HELPER_HXX
+
+#include "formula/IFunctionDescription.hxx"
+#include <vector>
+#include <tools/string.hxx>
+#include <memory>
+#include "formula/formuladllapi.h"
+
+class SvtSysLocale;
+class CharClass;
+
+namespace formula
+{
+ class FORMULA_DLLPUBLIC FormulaHelper
+ {
+ ::std::auto_ptr<SvtSysLocale> m_pSysLocale;
+ const CharClass* m_pCharClass;
+ const IFunctionManager* m_pFunctionManager;
+ const sal_Unicode open;
+ const sal_Unicode close;
+ const sal_Unicode sep;
+ const sal_Unicode arrayOpen;
+ const sal_Unicode arrayClose;
+ public:
+ FormulaHelper(const IFunctionManager* _pFunctionManager);
+
+ inline const CharClass* GetCharClass() const { return m_pCharClass; }
+
+ sal_Bool GetNextFunc( const String& rFormula,
+ sal_Bool bBack,
+ xub_StrLen& rFStart, // Ein- und Ausgabe
+ xub_StrLen* pFEnd = NULL,
+ const IFunctionDescription** ppFDesc = NULL,
+ ::std::vector< OUString>* pArgs = NULL ) const;
+
+ xub_StrLen GetFunctionStart( const String& rFormula, xub_StrLen nStart,
+ sal_Bool bBack, String* pFuncName = NULL ) const;
+
+ xub_StrLen GetFunctionEnd ( const String& rFormula, xub_StrLen nStart ) const;
+
+ xub_StrLen GetArgStart ( const String& rFormula, xub_StrLen nStart,
+ sal_uInt16 nArg ) const;
+
+ void GetArgStrings ( ::std::vector< OUString >& _rArgs,
+ const String& rFormula,
+ xub_StrLen nFuncPos,
+ sal_uInt16 nArgs ) const;
+
+ void FillArgStrings ( const String& rFormula,
+ xub_StrLen nFuncPos,
+ sal_uInt16 nArgs,
+ ::std::vector< OUString >& _rArgs ) const;
+ };
+// =============================================================================
+} // formula
+// =============================================================================
+
+#endif //FORMULA_FORMULA_HELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx
new file mode 100644
index 000000000000..6676117cdf20
--- /dev/null
+++ b/include/formula/funcutl.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 FORMULA_FUNCUTL_HXX
+#define FORMULA_FUNCUTL_HXX
+
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+#include <vcl/edit.hxx>
+#include "formula/formuladllapi.h"
+
+namespace formula {
+
+class IControlReferenceHandler;
+
+class FORMULA_DLLPUBLIC RefEdit : public Edit
+{
+private:
+ Timer aTimer;
+ IControlReferenceHandler* pAnyRefDlg; // parent dialog
+ Window* pLabelWidget;
+
+ DECL_LINK( UpdateHdl, void* );
+
+protected:
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+public:
+ RefEdit( Window* _pParent,IControlReferenceHandler* pParent,
+ Window* pShrinkModeLabel, const ResId& rResId );
+ RefEdit( Window* _pParent, Window* pShrinkModeLabel,
+ WinBits nStyle = WB_BORDER );
+ virtual ~RefEdit();
+
+ void SetRefString( const XubString& rStr );
+
+ /**
+ * Flag reference valid or invalid, which in turn changes the visual
+ * appearance of the control accordingly.
+ */
+ void SetRefValid(bool bValid);
+
+ using Edit::SetText;
+ virtual void SetText( const XubString& rStr );
+ virtual void Modify();
+
+ void StartUpdateData();
+
+ void SetReferences( IControlReferenceHandler* pDlg, Window *pLabelWidget );
+ IControlReferenceHandler* GetRefDialog() { return pAnyRefDlg; }
+ Window* GetLabelWidgetForShrinkMode() { return pLabelWidget; }
+};
+
+
+//============================================================================
+
+class FORMULA_DLLPUBLIC RefButton : public ImageButton
+{
+private:
+ Image aImgRefStart; /// Start reference input
+ Image aImgRefDone; /// Stop reference input
+ OUString aShrinkQuickHelp;
+ OUString aExpandQuickHelp;
+ IControlReferenceHandler* pAnyRefDlg; // parent dialog
+ RefEdit* pRefEdit; // zugeordnetes Edit-Control
+
+protected:
+ virtual void Click();
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+public:
+ RefButton(Window* _pParent, const ResId& rResId);
+ RefButton(Window* _pParent, WinBits nStyle = 0);
+ RefButton(Window* _pParent, const ResId& rResId,
+ RefEdit* pEdit, IControlReferenceHandler* pDlg);
+
+ void SetReferences( IControlReferenceHandler* pDlg,
+ RefEdit* pEdit );
+
+ void SetStartImage();
+ void SetEndImage();
+ void DoRef() { Click(); }
+};
+
+} // formula
+
+#endif // FORMULA_FUNCUTL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/grammar.hxx b/include/formula/grammar.hxx
new file mode 100644
index 000000000000..584aff1ae57f
--- /dev/null
+++ b/include/formula/grammar.hxx
@@ -0,0 +1,242 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef FORMULA_GRAMMAR_HXX
+#define FORMULA_GRAMMAR_HXX
+
+#include "com/sun/star/sheet/FormulaLanguage.hpp"
+#include "formula/formuladllapi.h"
+#include <tools/debug.hxx>
+
+namespace formula
+{
+
+/** Grammars digested by ScCompiler.
+ */
+class FORMULA_DLLPUBLIC FormulaGrammar
+{
+public:
+ enum AddressConvention{
+ CONV_UNSPECIFIED = -1, /* useful when we want method to chose, must be first */
+
+ /* elements must be sequential and changes should be reflected in ScCompiler::pCharTables */
+ CONV_OOO = 0, /* 'doc'#sheet.A1:sheet2.B2 */
+ CONV_ODF, /* ['doc'#sheet.A1:sheet2.B2] */
+ CONV_XL_A1, /* [doc]sheet:sheet2!A1:B2 */
+ CONV_XL_R1C1, /* [doc]sheet:sheet2!R1C1:R2C2 */
+ CONV_XL_OOX, /* [#]sheet:sheet2!A1:B2 */
+
+ CONV_LOTUS_A1, /* external? 3d? A1.B2 <placeholder/> */
+
+ CONV_LAST /* for loops, must always be last */
+ };
+
+ //! CONV_UNSPECIFIED is a negative value!
+ static const int kConventionOffset = - CONV_UNSPECIFIED + 1;
+ // Room for 32k hypothetical languages plus EXTERNAL.
+ static const int kConventionShift = 16;
+ // Room for 256 reference conventions.
+ static const int kEnglishBit = (1 << (kConventionShift + 8));
+ // Mask off all non-language bits.
+ static const int kFlagMask = ~((~int(0)) << kConventionShift);
+
+ /** Values encoding the formula language plus address reference convention
+ plus English parsing/formatting
+ */
+ //! When adding new values adapt isSupported() below as well.
+ enum Grammar
+ {
+ /// Used only in ScCompiler ctor and in some XML import API context.
+ GRAM_UNSPECIFIED = -1,
+ /// ODFF with default ODF A1 bracketed references.
+ GRAM_ODFF = ::com::sun::star::sheet::FormulaLanguage::ODFF |
+ ((CONV_ODF +
+ kConventionOffset) << kConventionShift) |
+ kEnglishBit,
+ /// ODF 1.1 with default ODF A1 bracketed references.
+ GRAM_PODF = ::com::sun::star::sheet::FormulaLanguage::ODF_11 |
+ ((CONV_ODF +
+ kConventionOffset) << kConventionShift) |
+ kEnglishBit,
+ /// English with default A1 reference style.
+ GRAM_ENGLISH = ::com::sun::star::sheet::FormulaLanguage::ENGLISH |
+ ((CONV_OOO +
+ kConventionOffset) << kConventionShift) |
+ kEnglishBit,
+ /// Native with default A1 reference style.
+ GRAM_NATIVE = ::com::sun::star::sheet::FormulaLanguage::NATIVE |
+ ((CONV_OOO +
+ kConventionOffset) << kConventionShift),
+ /// ODFF with reference style as set in UI, may be A1 or R1C1.
+ GRAM_ODFF_UI = ::com::sun::star::sheet::FormulaLanguage::ODFF |
+ ((CONV_UNSPECIFIED +
+ kConventionOffset) << kConventionShift) |
+ kEnglishBit,
+ /// ODFF with A1 reference style, unbracketed.
+ GRAM_ODFF_A1 = ::com::sun::star::sheet::FormulaLanguage::ODFF |
+ ((CONV_OOO +
+ kConventionOffset) << kConventionShift) |
+ kEnglishBit,
+ /// ODF 1.1 with reference style as set in UI, may be A1 or R1C1.
+ GRAM_PODF_UI = ::com::sun::star::sheet::FormulaLanguage::ODF_11 |
+ ((CONV_UNSPECIFIED +
+ kConventionOffset) << kConventionShift) |
+ kEnglishBit,
+ /// ODF 1.1 with A1 reference style, unbracketed.
+ GRAM_PODF_A1 = ::com::sun::star::sheet::FormulaLanguage::ODF_11 |
+ ((CONV_OOO +
+ kConventionOffset) << kConventionShift) |
+ kEnglishBit,
+ /// Native with reference style as set in UI, may be A1 or R1C1.
+ GRAM_NATIVE_UI = ::com::sun::star::sheet::FormulaLanguage::NATIVE |
+ ((CONV_UNSPECIFIED +
+ kConventionOffset) << kConventionShift),
+ /// Native with ODF A1 bracketed references. Not very useful but supported.
+ GRAM_NATIVE_ODF = ::com::sun::star::sheet::FormulaLanguage::NATIVE |
+ ((CONV_ODF +
+ kConventionOffset) << kConventionShift),
+ /// Native with Excel A1 reference style.
+ GRAM_NATIVE_XL_A1 = ::com::sun::star::sheet::FormulaLanguage::NATIVE |
+ ((CONV_XL_A1 +
+ kConventionOffset) << kConventionShift),
+ /// Native with Excel R1C1 reference style.
+ GRAM_NATIVE_XL_R1C1 = ::com::sun::star::sheet::FormulaLanguage::NATIVE |
+ ((CONV_XL_R1C1 +
+ kConventionOffset) << kConventionShift),
+ /// English with Excel A1 reference style.
+ GRAM_ENGLISH_XL_A1 = ::com::sun::star::sheet::FormulaLanguage::XL_ENGLISH |
+ ((CONV_XL_A1 +
+ kConventionOffset) << kConventionShift) |
+ kEnglishBit,
+ /// English with Excel R1C1 reference style.
+ GRAM_ENGLISH_XL_R1C1 = ::com::sun::star::sheet::FormulaLanguage::XL_ENGLISH |
+ ((CONV_XL_R1C1 +
+ kConventionOffset) << kConventionShift) |
+ kEnglishBit,
+ /// Central definition of the default grammar to be used.
+ GRAM_DEFAULT = GRAM_NATIVE_UI,
+
+ /// Central definition of the default storage grammar to be used.
+ GRAM_STORAGE_DEFAULT = GRAM_ODFF,
+
+ /** OpCodeMap set by external filter and merged with reference
+ convention plus English bit on top. Plain value acts as
+ FormulaLanguage. */
+ GRAM_EXTERNAL = (1 << (kConventionShift - 1))
+ };
+
+ /// If English parsing/formatting is associated with a grammar.
+ static inline bool isEnglish( const Grammar eGrammar )
+ {
+ return (eGrammar & kEnglishBit) != 0;
+ }
+
+ /** Compatibility helper for old "bCompileEnglish, bCompileXML" API calls
+ to obtain the new grammar. */
+ static Grammar mapAPItoGrammar( const bool bEnglish, const bool bXML )
+ {
+ Grammar eGrammar;
+ if (bEnglish && bXML)
+ eGrammar = GRAM_PODF;
+ else if (bEnglish && !bXML)
+ eGrammar = GRAM_PODF_A1;
+ else if (!bEnglish && bXML)
+ eGrammar = GRAM_NATIVE_ODF;
+ else // (!bEnglish && !bXML)
+ eGrammar = GRAM_NATIVE;
+ return eGrammar;
+ }
+
+ static bool isSupported( const Grammar eGrammar )
+ {
+ switch (eGrammar)
+ {
+ case GRAM_ODFF :
+ case GRAM_PODF :
+ case GRAM_ENGLISH :
+ case GRAM_NATIVE :
+ case GRAM_ODFF_UI :
+ case GRAM_ODFF_A1 :
+ case GRAM_PODF_UI :
+ case GRAM_PODF_A1 :
+ case GRAM_NATIVE_UI :
+ case GRAM_NATIVE_ODF :
+ case GRAM_NATIVE_XL_A1 :
+ case GRAM_NATIVE_XL_R1C1 :
+ case GRAM_ENGLISH_XL_A1 :
+ case GRAM_ENGLISH_XL_R1C1:
+ return true;
+ default:
+ return extractFormulaLanguage( eGrammar) == GRAM_EXTERNAL;
+ }
+ }
+
+ static inline sal_Int32 extractFormulaLanguage( const Grammar eGrammar )
+ {
+ return eGrammar & kFlagMask;
+ }
+
+ static inline AddressConvention extractRefConvention( const Grammar eGrammar )
+ {
+ return static_cast<AddressConvention>(
+ ((eGrammar & ~kEnglishBit) >> kConventionShift) -
+ kConventionOffset);
+ }
+
+ static inline Grammar setEnglishBit( const Grammar eGrammar, const bool bEnglish )
+ {
+ if (bEnglish)
+ return static_cast<Grammar>( eGrammar | kEnglishBit);
+ else
+ return static_cast<Grammar>( eGrammar & ~kEnglishBit);
+ }
+
+ static inline Grammar mergeToGrammar( const Grammar eGrammar, const AddressConvention eConv )
+ {
+ bool bEnglish = isEnglish( eGrammar);
+ Grammar eGram = static_cast<Grammar>(
+ extractFormulaLanguage( eGrammar) |
+ ((eConv + kConventionOffset) << kConventionShift));
+ eGram = setEnglishBit( eGram, bEnglish);
+ DBG_ASSERT( isSupported( eGram), "CompilerGrammarMap::mergeToGrammar: unsupported grammar");
+ return eGram;
+ }
+
+ /// If grammar is of ODF 1.1
+ static inline bool isPODF( const Grammar eGrammar )
+ {
+ return extractFormulaLanguage( eGrammar) ==
+ ::com::sun::star::sheet::FormulaLanguage::ODF_11;
+ }
+
+ /// If grammar is of ODFF
+ static inline bool isODFF( const Grammar eGrammar )
+ {
+ return extractFormulaLanguage( eGrammar) ==
+ ::com::sun::star::sheet::FormulaLanguage::ODFF;
+ }
+
+};
+// =============================================================================
+} // formula
+// =============================================================================
+
+#endif // FORMULA_GRAMMAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/omoduleclient.hxx b/include/formula/omoduleclient.hxx
new file mode 100644
index 000000000000..76fcee97fb57
--- /dev/null
+++ b/include/formula/omoduleclient.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_FORMULA_MODULECLIENT_HXX
+#define INCLUDED_FORMULA_MODULECLIENT_HXX
+
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "formula/formuladllapi.h"
+
+namespace formula {
+
+/** Base class for objects which use any global module-specific resources.
+*/
+class FORMULA_DLLPUBLIC OModuleClient: private boost::noncopyable
+{
+public:
+ OModuleClient();
+ ~OModuleClient();
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
new file mode 100644
index 000000000000..b94c066a624b
--- /dev/null
+++ b/include/formula/opcode.hxx
@@ -0,0 +1,420 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef FORMULA_OPCODE_HXX
+#define FORMULA_OPCODE_HXX
+
+#include "formula/compiler.hrc" // OpCodes
+#include <tools/solar.h>
+
+enum OpCodeEnum
+{
+ // Special commands
+ ocPush = SC_OPCODE_PUSH,
+ ocCall = SC_OPCODE_CALL,
+ ocStop = SC_OPCODE_STOP,
+ ocExternal = SC_OPCODE_EXTERNAL,
+ ocName = SC_OPCODE_NAME,
+ ocExternalRef = SC_OPCODE_EXTERNAL_REF,
+ // Jump commands
+ ocIf = SC_OPCODE_IF,
+ ocIfError = SC_OPCODE_IF_ERROR,
+ ocIfNA = SC_OPCODE_IF_NA,
+ ocChose = SC_OPCODE_CHOSE,
+ // Parentheses and separators
+ ocOpen = SC_OPCODE_OPEN,
+ ocClose = SC_OPCODE_CLOSE,
+ ocSep = SC_OPCODE_SEP,
+ ocArrayOpen = SC_OPCODE_ARRAY_OPEN,
+ ocArrayClose = SC_OPCODE_ARRAY_CLOSE,
+ ocArrayRowSep = SC_OPCODE_ARRAY_ROW_SEP,
+ ocArrayColSep = SC_OPCODE_ARRAY_COL_SEP,
+ // Special OpCodes
+ ocMissing = SC_OPCODE_MISSING,
+ ocBad = SC_OPCODE_BAD,
+ ocStringXML = SC_OPCODE_STRINGXML,
+ ocSpaces = SC_OPCODE_SPACES,
+ ocMatRef = SC_OPCODE_MAT_REF,
+ ocSkip = SC_OPCODE_SKIP,
+ // Access commands
+ ocDBArea = SC_OPCODE_DB_AREA,
+ ocMacro = SC_OPCODE_MACRO,
+ ocColRowName = SC_OPCODE_COL_ROW_NAME,
+ ocColRowNameAuto = SC_OPCODE_COL_ROW_NAME_AUTO,
+ // Percent operator _follows_ value
+ ocPercentSign = SC_OPCODE_PERCENT_SIGN,
+ // Error constants
+ ocErrNull = SC_OPCODE_ERROR_NULL,
+ ocErrDivZero = SC_OPCODE_ERROR_DIVZERO,
+ ocErrValue = SC_OPCODE_ERROR_VALUE,
+ ocErrRef = SC_OPCODE_ERROR_REF,
+ ocErrName = SC_OPCODE_ERROR_NAME,
+ ocErrNum = SC_OPCODE_ERROR_NUM,
+ ocErrNA = SC_OPCODE_ERROR_NA,
+ // Binary operators
+ ocAdd = SC_OPCODE_ADD,
+ ocSub = SC_OPCODE_SUB,
+ ocMul = SC_OPCODE_MUL,
+ ocDiv = SC_OPCODE_DIV,
+ ocAmpersand = SC_OPCODE_AMPERSAND,
+ ocPow = SC_OPCODE_POW,
+ ocEqual = SC_OPCODE_EQUAL,
+ ocNotEqual = SC_OPCODE_NOT_EQUAL,
+ ocLess = SC_OPCODE_LESS,
+ ocGreater = SC_OPCODE_GREATER,
+ ocLessEqual = SC_OPCODE_LESS_EQUAL,
+ ocGreaterEqual = SC_OPCODE_GREATER_EQUAL,
+ ocAnd = SC_OPCODE_AND,
+ ocOr = SC_OPCODE_OR,
+ ocXor = SC_OPCODE_XOR,
+ ocIntersect = SC_OPCODE_INTERSECT,
+ ocUnion = SC_OPCODE_UNION,
+ ocRange = SC_OPCODE_RANGE,
+ // Unary operators
+ ocNot = SC_OPCODE_NOT,
+ ocNeg = SC_OPCODE_NEG,
+ ocNegSub = SC_OPCODE_NEG_SUB,
+ // Functions with no parameters
+ ocPi = SC_OPCODE_PI,
+ ocRandom = SC_OPCODE_RANDOM,
+ ocTrue = SC_OPCODE_TRUE,
+ ocFalse = SC_OPCODE_FALSE,
+ ocGetActDate = SC_OPCODE_GET_ACT_DATE,
+ ocGetActTime = SC_OPCODE_GET_ACT_TIME,
+ ocNotAvail = SC_OPCODE_NO_VALUE,
+ ocCurrent = SC_OPCODE_CURRENT,
+ // Functions with one parameter
+ ocDeg = SC_OPCODE_DEG,
+ ocRad = SC_OPCODE_RAD,
+ ocSin = SC_OPCODE_SIN,
+ ocCos = SC_OPCODE_COS,
+ ocTan = SC_OPCODE_TAN,
+ ocCot = SC_OPCODE_COT,
+ ocArcSin = SC_OPCODE_ARC_SIN,
+ ocArcCos = SC_OPCODE_ARC_COS,
+ ocArcTan = SC_OPCODE_ARC_TAN,
+ ocArcCot = SC_OPCODE_ARC_COT,
+ ocSinHyp = SC_OPCODE_SIN_HYP,
+ ocCosHyp = SC_OPCODE_COS_HYP,
+ ocTanHyp = SC_OPCODE_TAN_HYP,
+ ocCotHyp = SC_OPCODE_COT_HYP,
+ ocArcSinHyp = SC_OPCODE_ARC_SIN_HYP,
+ ocArcCosHyp = SC_OPCODE_ARC_COS_HYP,
+ ocArcTanHyp = SC_OPCODE_ARC_TAN_HYP,
+ ocArcCotHyp = SC_OPCODE_ARC_COT_HYP,
+ ocCosecant = SC_OPCODE_COSECANT,
+ ocSecant = SC_OPCODE_SECANT,
+ ocCosecantHyp = SC_OPCODE_COSECANT_HYP,
+ ocSecantHyp = SC_OPCODE_SECANT_HYP,
+ ocExp = SC_OPCODE_EXP,
+ ocLn = SC_OPCODE_LN,
+ ocSqrt = SC_OPCODE_SQRT,
+ ocFact = SC_OPCODE_FACT,
+ ocGetYear = SC_OPCODE_GET_YEAR,
+ ocGetMonth = SC_OPCODE_GET_MONTH,
+ ocGetDay = SC_OPCODE_GET_DAY,
+ ocGetHour = SC_OPCODE_GET_HOUR,
+ ocGetMin = SC_OPCODE_GET_MIN,
+ ocGetSec = SC_OPCODE_GET_SEC,
+ ocPlusMinus = SC_OPCODE_PLUS_MINUS,
+ ocAbs = SC_OPCODE_ABS,
+ ocInt = SC_OPCODE_INT,
+ ocPhi = SC_OPCODE_PHI,
+ ocGauss = SC_OPCODE_GAUSS,
+ ocIsEmpty = SC_OPCODE_IS_EMPTY,
+ ocIsString = SC_OPCODE_IS_STRING,
+ ocIsNonString = SC_OPCODE_IS_NON_STRING,
+ ocIsLogical = SC_OPCODE_IS_LOGICAL,
+ ocType = SC_OPCODE_TYPE,
+ ocCell = SC_OPCODE_CELL,
+ ocIsRef = SC_OPCODE_IS_REF,
+ ocIsValue = SC_OPCODE_IS_VALUE,
+ ocIsFormula = SC_OPCODE_IS_FORMULA,
+ ocIsNA = SC_OPCODE_IS_NV,
+ ocIsErr = SC_OPCODE_IS_ERR,
+ ocIsError = SC_OPCODE_IS_ERROR,
+ ocIsEven = SC_OPCODE_IS_EVEN,
+ ocIsOdd = SC_OPCODE_IS_ODD,
+ ocN = SC_OPCODE_N,
+ // String functions
+ ocGetDateValue = SC_OPCODE_GET_DATE_VALUE,
+ ocGetTimeValue = SC_OPCODE_GET_TIME_VALUE,
+ ocCode = SC_OPCODE_CODE,
+ ocTrim = SC_OPCODE_TRIM,
+ ocUpper = SC_OPCODE_UPPER,
+ ocPropper = SC_OPCODE_PROPPER,
+ ocLower = SC_OPCODE_LOWER,
+ ocLen = SC_OPCODE_LEN,
+ ocT = SC_OPCODE_T,
+ ocValue = SC_OPCODE_VALUE,
+ ocClean = SC_OPCODE_CLEAN,
+ ocChar = SC_OPCODE_CHAR,
+ ocLog10 = SC_OPCODE_LOG10,
+ ocEven = SC_OPCODE_EVEN,
+ ocOdd = SC_OPCODE_ODD,
+ ocStdNormDist = SC_OPCODE_STD_NORM_DIST,
+ ocFisher = SC_OPCODE_FISHER,
+ ocFisherInv = SC_OPCODE_FISHER_INV,
+ ocSNormInv = SC_OPCODE_S_NORM_INV,
+ ocGammaLn = SC_OPCODE_GAMMA_LN,
+ ocGamma = SC_OPCODE_GAMMA,
+ ocErrorType = SC_OPCODE_ERROR_TYPE,
+ ocErrCell = SC_OPCODE_ERR_CELL,
+ ocFormula = SC_OPCODE_FORMULA,
+ ocArabic = SC_OPCODE_ARABIC,
+ ocInfo = SC_OPCODE_INFO,
+ ocBahtText = SC_OPCODE_BAHTTEXT,
+ ocJis = SC_OPCODE_JIS,
+ ocAsc = SC_OPCODE_ASC,
+ ocUnicode = SC_OPCODE_UNICODE,
+ ocUnichar = SC_OPCODE_UNICHAR,
+ // Functions with more than one parameters
+ ocArcTan2 = SC_OPCODE_ARC_TAN_2,
+ ocCeil = SC_OPCODE_CEIL,
+ ocFloor = SC_OPCODE_FLOOR,
+ ocRound = SC_OPCODE_ROUND,
+ ocRoundUp = SC_OPCODE_ROUND_UP,
+ ocRoundDown = SC_OPCODE_ROUND_DOWN,
+ ocTrunc = SC_OPCODE_TRUNC,
+ ocLog = SC_OPCODE_LOG,
+ ocPower = SC_OPCODE_POWER,
+ ocGCD = SC_OPCODE_GGT,
+ ocLCM = SC_OPCODE_KGV,
+ ocMod = SC_OPCODE_MOD,
+ ocSumProduct = SC_OPCODE_SUM_PRODUCT,
+ ocSumSQ = SC_OPCODE_SUM_SQ,
+ ocSumX2MY2 = SC_OPCODE_SUM_X2MY2,
+ ocSumX2DY2 = SC_OPCODE_SUM_X2DY2,
+ ocSumXMY2 = SC_OPCODE_SUM_XMY2,
+ ocGetDate = SC_OPCODE_GET_DATE,
+ ocGetTime = SC_OPCODE_GET_TIME,
+ ocGetDiffDate = SC_OPCODE_GET_DIFF_DATE,
+ ocGetDiffDate360 = SC_OPCODE_GET_DIFF_DATE_360,
+ ocGetDateDif = SC_OPCODE_GET_DATEDIF,
+ ocMin = SC_OPCODE_MIN,
+ ocMax = SC_OPCODE_MAX,
+ ocSum = SC_OPCODE_SUM,
+ ocProduct = SC_OPCODE_PRODUCT,
+ ocAverage = SC_OPCODE_AVERAGE,
+ ocCount = SC_OPCODE_COUNT,
+ ocCount2 = SC_OPCODE_COUNT_2,
+ ocNPV = SC_OPCODE_NBW,
+ ocIRR = SC_OPCODE_IKV,
+ ocMIRR = SC_OPCODE_MIRR,
+ ocISPMT = SC_OPCODE_ISPMT,
+ ocVar = SC_OPCODE_VAR,
+ ocVarP = SC_OPCODE_VAR_P,
+ ocStDev = SC_OPCODE_ST_DEV,
+ ocStDevP = SC_OPCODE_ST_DEV_P,
+ ocB = SC_OPCODE_B,
+ ocNormDist = SC_OPCODE_NORM_DIST,
+ ocExpDist = SC_OPCODE_EXP_DIST,
+ ocBinomDist = SC_OPCODE_BINOM_DIST,
+ ocPoissonDist = SC_OPCODE_POISSON_DIST,
+ ocKombin = SC_OPCODE_KOMBIN,
+ ocKombin2 = SC_OPCODE_KOMBIN_2,
+ ocVariationen = SC_OPCODE_VARIATIONEN,
+ ocVariationen2 = SC_OPCODE_VARIATIONEN_2,
+ ocBW = SC_OPCODE_BW,
+ ocDIA = SC_OPCODE_DIA,
+ ocGDA = SC_OPCODE_GDA,
+ ocGDA2 = SC_OPCODE_GDA_2,
+ ocVBD = SC_OPCODE_VBD,
+ ocLaufz = SC_OPCODE_LAUFZ,
+ ocLIA = SC_OPCODE_LIA,
+ ocRMZ = SC_OPCODE_RMZ,
+ ocColumns = SC_OPCODE_COLUMNS,
+ ocRows = SC_OPCODE_ROWS,
+ ocColumn = SC_OPCODE_COLUMN,
+ ocRow = SC_OPCODE_ROW,
+ ocZGZ = SC_OPCODE_ZGZ,
+ ocZW = SC_OPCODE_ZW,
+ ocZZR = SC_OPCODE_ZZR,
+ ocZins = SC_OPCODE_ZINS,
+ ocZinsZ = SC_OPCODE_ZINS_Z,
+ ocKapz = SC_OPCODE_KAPZ,
+ ocKumZinsZ = SC_OPCODE_KUM_ZINS_Z,
+ ocKumKapZ = SC_OPCODE_KUM_KAP_Z,
+ ocEffektiv = SC_OPCODE_EFFEKTIV,
+ ocNominal = SC_OPCODE_NOMINAL,
+ ocSubTotal = SC_OPCODE_SUB_TOTAL,
+ // Database functions
+ ocDBSum = SC_OPCODE_DB_SUM,
+ ocDBCount = SC_OPCODE_DB_COUNT,
+ ocDBCount2 = SC_OPCODE_DB_COUNT_2,
+ ocDBAverage = SC_OPCODE_DB_AVERAGE,
+ ocDBGet = SC_OPCODE_DB_GET,
+ ocDBMax = SC_OPCODE_DB_MAX,
+ ocDBMin = SC_OPCODE_DB_MIN,
+ ocDBProduct = SC_OPCODE_DB_PRODUCT,
+ ocDBStdDev = SC_OPCODE_DB_STD_DEV,
+ ocDBStdDevP = SC_OPCODE_DB_STD_DEV_P,
+ ocDBVar = SC_OPCODE_DB_VAR,
+ ocDBVarP = SC_OPCODE_DB_VAR_P,
+ // Management functions
+ ocIndirect = SC_OPCODE_INDIRECT,
+ ocIndirectXL = SC_OPCODE_INDIRECT_XL,
+ ocAddress = SC_OPCODE_ADDRESS,
+ ocAddressXL = SC_OPCODE_ADDRESS_XL,
+ ocMatch = SC_OPCODE_MATCH,
+ ocCountEmptyCells = SC_OPCODE_COUNT_EMPTY_CELLS,
+ ocCountIf = SC_OPCODE_COUNT_IF,
+ ocSumIf = SC_OPCODE_SUM_IF,
+ ocAverageIf = SC_OPCODE_AVERAGE_IF,
+ ocSumIfs = SC_OPCODE_SUM_IFS,
+ ocAverageIfs = SC_OPCODE_AVERAGE_IFS,
+ ocCountIfs = SC_OPCODE_COUNT_IFS,
+ ocLookup = SC_OPCODE_LOOKUP,
+ ocVLookup = SC_OPCODE_V_LOOKUP,
+ ocHLookup = SC_OPCODE_H_LOOKUP,
+ ocMultiArea = SC_OPCODE_MULTI_AREA,
+ ocOffset = SC_OPCODE_OFFSET,
+ ocIndex = SC_OPCODE_INDEX,
+ ocAreas = SC_OPCODE_AREAS,
+ // String functions
+ ocCurrency = SC_OPCODE_CURRENCY,
+ ocReplace = SC_OPCODE_REPLACE,
+ ocFixed = SC_OPCODE_FIXED,
+ ocFind = SC_OPCODE_FIND,
+ ocExact = SC_OPCODE_EXACT,
+ ocLeft = SC_OPCODE_LEFT,
+ ocRight = SC_OPCODE_RIGHT,
+ ocSearch = SC_OPCODE_SEARCH,
+ ocMid = SC_OPCODE_MID,
+ ocText = SC_OPCODE_TEXT,
+ ocSubstitute = SC_OPCODE_SUBSTITUTE,
+ ocRept = SC_OPCODE_REPT,
+ ocConcat = SC_OPCODE_CONCAT,
+ ocNumberValue = SC_OPCODE_NUMBERVALUE,
+ // Matrix functions
+ ocMatValue = SC_OPCODE_MAT_VALUE,
+ ocMatDet = SC_OPCODE_MAT_DET,
+ ocMatInv = SC_OPCODE_MAT_INV,
+ ocMatMult = SC_OPCODE_MAT_MULT,
+ ocMatTrans = SC_OPCODE_MAT_TRANS,
+ ocMatrixUnit = SC_OPCODE_MATRIX_UNIT,
+ // BackSolver
+ ocBackSolver = SC_OPCODE_BACK_SOLVER,
+ // Statistical functions
+ ocHypGeomDist = SC_OPCODE_HYP_GEOM_DIST,
+ ocLogNormDist = SC_OPCODE_LOG_NORM_DIST,
+ ocTDist = SC_OPCODE_T_DIST,
+ ocFDist = SC_OPCODE_F_DIST,
+ ocChiDist = SC_OPCODE_CHI_DIST,
+ ocChiSqDist = SC_OPCODE_CHISQ_DIST,
+ ocChiSqInv = SC_OPCODE_CHISQ_INV,
+ ocWeibull = SC_OPCODE_WEIBULL,
+ ocNegBinomVert = SC_OPCODE_NEG_BINOM_VERT,
+ ocKritBinom = SC_OPCODE_KRIT_BINOM,
+ ocKurt = SC_OPCODE_KURT,
+ ocHarMean = SC_OPCODE_HAR_MEAN,
+ ocGeoMean = SC_OPCODE_GEO_MEAN,
+ ocStandard = SC_OPCODE_STANDARD,
+ ocAveDev = SC_OPCODE_AVE_DEV,
+ ocSchiefe = SC_OPCODE_SCHIEFE,
+ ocSkewp = SC_OPCODE_SKEWP,
+ ocDevSq = SC_OPCODE_DEV_SQ,
+ ocMedian = SC_OPCODE_MEDIAN,
+ ocModalValue = SC_OPCODE_MODAL_VALUE,
+ ocZTest = SC_OPCODE_Z_TEST,
+ ocTTest = SC_OPCODE_T_TEST,
+ ocRank = SC_OPCODE_RANK,
+ ocPercentile = SC_OPCODE_PERCENTILE,
+ ocPercentrank = SC_OPCODE_PERCENT_RANK,
+ ocLarge = SC_OPCODE_LARGE,
+ ocSmall = SC_OPCODE_SMALL,
+ ocFrequency = SC_OPCODE_FREQUENCY,
+ ocQuartile = SC_OPCODE_QUARTILE,
+ ocNormInv = SC_OPCODE_NORM_INV,
+ ocConfidence = SC_OPCODE_CONFIDENCE,
+ ocFTest = SC_OPCODE_F_TEST,
+ ocTrimMean = SC_OPCODE_TRIM_MEAN,
+ ocProb = SC_OPCODE_PROB,
+ ocCorrel = SC_OPCODE_CORREL,
+ ocCovar = SC_OPCODE_COVAR,
+ ocPearson = SC_OPCODE_PEARSON,
+ ocRSQ = SC_OPCODE_RSQ,
+ ocSTEYX = SC_OPCODE_STEYX,
+ ocSlope = SC_OPCODE_SLOPE,
+ ocIntercept = SC_OPCODE_INTERCEPT,
+ ocTrend = SC_OPCODE_TREND,
+ ocGrowth = SC_OPCODE_GROWTH,
+ ocRGP = SC_OPCODE_RGP,
+ ocRKP = SC_OPCODE_RKP,
+ ocForecast = SC_OPCODE_FORECAST,
+ ocChiInv = SC_OPCODE_CHI_INV,
+ ocGammaDist = SC_OPCODE_GAMMA_DIST,
+ ocGammaInv = SC_OPCODE_GAMMA_INV,
+ ocTInv = SC_OPCODE_T_INV,
+ ocFInv = SC_OPCODE_F_INV,
+ ocChiTest = SC_OPCODE_CHI_TEST,
+ ocLogInv = SC_OPCODE_LOG_INV,
+ ocTableOp = SC_OPCODE_TABLE_OP,
+ ocBetaDist = SC_OPCODE_BETA_DIST,
+ ocBetaInv = SC_OPCODE_BETA_INV,
+ // Bit functions
+ ocBitAnd = SC_OPCODE_BITAND,
+ ocBitOr = SC_OPCODE_BITOR,
+ ocBitXor = SC_OPCODE_BITXOR,
+ ocBitRshift = SC_OPCODE_BITRSHIFT,
+ ocBitLshift = SC_OPCODE_BITLSHIFT,
+ // miscellaneous
+ ocWeek = SC_OPCODE_WEEK,
+ ocGetDayOfWeek = SC_OPCODE_GET_DAY_OF_WEEK,
+ ocNoName = SC_OPCODE_NO_NAME,
+ ocStyle = SC_OPCODE_STYLE,
+ ocDde = SC_OPCODE_DDE,
+ ocBase = SC_OPCODE_BASE,
+ ocTable = SC_OPCODE_TABLE,
+ ocTables = SC_OPCODE_TABLES,
+ ocMinA = SC_OPCODE_MIN_A,
+ ocMaxA = SC_OPCODE_MAX_A,
+ ocAverageA = SC_OPCODE_AVERAGE_A,
+ ocStDevA = SC_OPCODE_ST_DEV_A,
+ ocStDevPA = SC_OPCODE_ST_DEV_P_A,
+ ocVarA = SC_OPCODE_VAR_A,
+ ocVarPA = SC_OPCODE_VAR_P_A,
+ ocEasterSunday = SC_OPCODE_EASTERSUNDAY,
+ ocDecimal = SC_OPCODE_DECIMAL,
+ ocConvert = SC_OPCODE_CONVERT,
+ ocRoman = SC_OPCODE_ROMAN,
+ ocHyperLink = SC_OPCODE_HYPERLINK,
+ ocGetPivotData = SC_OPCODE_GET_PIVOT_DATA,
+ ocEuroConvert = SC_OPCODE_EUROCONVERT,
+ // internal stuff
+ ocInternalBegin = SC_OPCODE_INTERNAL_BEGIN,
+ ocTTT = SC_OPCODE_TTT,
+ ocInternalEnd = SC_OPCODE_INTERNAL_END,
+ // from here on ExtraData
+ ocDataToken1 = SC_OPCODE_DATA_TOKEN_1,
+ // no OpCode
+ ocNone = SC_OPCODE_NONE
+};
+
+#ifndef DBG_UTIL
+// save memory since compilers tend to int an enum
+typedef sal_uInt16 OpCode;
+#else
+// have enum names in debugger
+typedef OpCodeEnum OpCode;
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
new file mode 100644
index 000000000000..3a174d7b9d4f
--- /dev/null
+++ b/include/formula/token.hxx
@@ -0,0 +1,428 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef FORMULA_TOKEN_HXX
+#define FORMULA_TOKEN_HXX
+
+#include <memory>
+#include <string.h>
+#include <vector>
+#include "formula/opcode.hxx"
+#include <tools/mempool.hxx>
+#include "formula/IFunctionDescription.hxx"
+#include "formula/formuladllapi.h"
+
+#include <boost/intrusive_ptr.hpp>
+
+namespace formula
+{
+
+enum StackVarEnum
+{
+ svByte,
+ svDouble,
+ svString,
+ svSingleRef,
+ svDoubleRef,
+ svMatrix,
+ svIndex,
+ svJump,
+ svExternal, // Byte + String
+ svFAP, // FormulaAutoPilot only, ever exported
+ svJumpMatrix, // 2003-07-02
+ svRefList, // ocUnion result
+ svEmptyCell, // Result is an empty cell, e.g. in LOOKUP()
+
+ svMatrixCell, // Result is a matrix with bells and
+ // whistles as needed for _the_ matrix
+ // formula result.
+
+ svHybridCell, // A temporary condition of a formula
+ // cell during import, having a double
+ // and/or string result and a formula
+ // string to be compiled.
+
+ svHybridValueCell, // A temporary formula cell with an value
+ // and possibily a string representation
+
+ svExternalSingleRef,
+ svExternalDoubleRef,
+ svExternalName,
+ svSubroutine, // A token with a subroutine token array.
+ svError, // error token
+ svMissing = 0x70, // 0 or ""
+ svSep, // separator, ocSep, ocOpen, ocClose
+ svUnknown // unknown StackType
+};
+
+#ifndef DBG_UTIL
+// save memory since compilers tend to int an enum
+typedef sal_uInt8 StackVar;
+#else
+// have enum names in debugger
+typedef StackVarEnum StackVar;
+#endif
+
+
+class FormulaToken;
+typedef ::boost::intrusive_ptr<FormulaToken> FormulaTokenRef;
+typedef ::boost::intrusive_ptr<const FormulaToken> FormulaConstTokenRef;
+
+class FormulaTokenArray;
+
+class FORMULA_DLLPUBLIC FormulaToken : public IFormulaToken
+{
+ OpCode eOp;
+ // not implemented, prevent usage
+ FormulaToken();
+ FormulaToken& operator=( const FormulaToken& );
+protected:
+
+ const StackVar eType; // type of data
+ mutable sal_uInt16 nRefCnt; // reference count
+
+public:
+ FormulaToken( StackVar eTypeP,OpCode e = ocPush ) :
+ eOp(e), eType( eTypeP ), nRefCnt(0) {}
+ FormulaToken( const FormulaToken& r ) : IFormulaToken(),
+ eOp(r.eOp), eType( r.eType ), nRefCnt(0) {}
+
+ virtual ~FormulaToken();
+
+ inline void Delete() { delete this; }
+ inline StackVar GetType() const { return eType; }
+ bool IsFunction() const; // pure functions, no operators
+ bool IsExternalRef() const;
+ sal_uInt8 GetParamCount() const;
+ inline void IncRef() const { nRefCnt++; }
+ inline void DecRef() const
+ {
+ if (!--nRefCnt)
+ const_cast<FormulaToken*>(this)->Delete();
+ }
+ inline sal_uInt16 GetRef() const { return nRefCnt; }
+ inline OpCode GetOpCode() const { return eOp; }
+
+ /**
+ Dummy methods to avoid switches and casts where possible,
+ the real token classes have to overload the appropriate method[s].
+ The only methods valid anytime if not overloaded are:
+
+ - GetByte() since this represents the count of parameters to a function
+ which of course is 0 on non-functions. FormulaByteToken and ScExternal do
+ overload it.
+
+ - HasForceArray() since also this is only used for operators and
+ functions and is 0 for other tokens.
+
+ Any other non-overloaded method pops up an assertion.
+ */
+
+ virtual sal_uInt8 GetByte() const;
+ virtual void SetByte( sal_uInt8 n );
+ virtual bool HasForceArray() const;
+ virtual void SetForceArray( bool b );
+ virtual double GetDouble() const;
+ virtual double& GetDoubleAsReference();
+ virtual const String& GetString() const;
+ virtual sal_uInt16 GetIndex() const;
+ virtual void SetIndex( sal_uInt16 n );
+ virtual bool IsGlobal() const;
+ virtual void SetGlobal( bool b );
+ virtual short* GetJump() const;
+ virtual const String& GetExternal() const;
+ virtual FormulaToken* GetFAPOrigToken() const;
+ virtual sal_uInt16 GetError() const;
+ virtual void SetError( sal_uInt16 );
+
+ virtual FormulaToken* Clone() const { return new FormulaToken(*this); }
+
+ virtual bool Is3DRef() const; // reference with 3D flag set
+ virtual bool TextEqual( const formula::FormulaToken& rToken ) const;
+ virtual bool operator==( const FormulaToken& rToken ) const;
+
+ virtual bool isFunction() const
+ {
+ return IsFunction();
+ }
+
+ virtual sal_uInt32 getArgumentCount() const
+ {
+ return GetParamCount();
+ }
+
+ /** This is dirty and only the compiler should use it! */
+ struct PrivateAccess { friend class FormulaCompiler; private: PrivateAccess() { } };
+ inline void NewOpCode( OpCode e, const PrivateAccess& ) { eOp = e; }
+
+ static size_t GetStrLenBytes( xub_StrLen nLen )
+ { return nLen * sizeof(sal_Unicode); }
+ static size_t GetStrLenBytes( const String& rStr )
+ { return GetStrLenBytes( rStr.Len() ); }
+};
+
+inline void intrusive_ptr_add_ref(const FormulaToken* p)
+{
+ p->IncRef();
+}
+
+inline void intrusive_ptr_release(const FormulaToken* p)
+{
+ p->DecRef();
+}
+
+class FORMULA_DLLPUBLIC FormulaByteToken : public FormulaToken
+{
+private:
+ sal_uInt8 nByte;
+ bool bHasForceArray;
+protected:
+ FormulaByteToken( OpCode e, sal_uInt8 n, StackVar v, bool b ) :
+ FormulaToken( v,e ), nByte( n ),
+ bHasForceArray( b ) {}
+public:
+ FormulaByteToken( OpCode e, sal_uInt8 n, bool b ) :
+ FormulaToken( svByte,e ), nByte( n ),
+ bHasForceArray( b ) {}
+ FormulaByteToken( OpCode e, sal_uInt8 n ) :
+ FormulaToken( svByte,e ), nByte( n ),
+ bHasForceArray( false ) {}
+ FormulaByteToken( OpCode e ) :
+ FormulaToken( svByte,e ), nByte( 0 ),
+ bHasForceArray( false ) {}
+ FormulaByteToken( const FormulaByteToken& r ) :
+ FormulaToken( r ), nByte( r.nByte ),
+ bHasForceArray( r.bHasForceArray ) {}
+
+ virtual FormulaToken* Clone() const { return new FormulaByteToken(*this); }
+ virtual sal_uInt8 GetByte() const;
+ virtual void SetByte( sal_uInt8 n );
+ virtual bool HasForceArray() const;
+ virtual void SetForceArray( bool b );
+ virtual bool operator==( const FormulaToken& rToken ) const;
+
+ DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaByteToken )
+};
+
+
+// A special token for the FormulaAutoPilot only. Keeps a reference pointer of
+// the token of which it was created for comparison.
+class FORMULA_DLLPUBLIC FormulaFAPToken : public FormulaByteToken
+{
+private:
+ FormulaTokenRef pOrigToken;
+public:
+ FormulaFAPToken( OpCode e, sal_uInt8 n, FormulaToken* p ) :
+ FormulaByteToken( e, n, svFAP, false ),
+ pOrigToken( p ) {}
+ FormulaFAPToken( const FormulaFAPToken& r ) :
+ FormulaByteToken( r ), pOrigToken( r.pOrigToken ) {}
+
+ virtual FormulaToken* Clone() const { return new FormulaFAPToken(*this); }
+ virtual FormulaToken* GetFAPOrigToken() const;
+ virtual bool operator==( const FormulaToken& rToken ) const;
+};
+
+class FORMULA_DLLPUBLIC FormulaDoubleToken : public FormulaToken
+{
+private:
+ double fDouble;
+public:
+ FormulaDoubleToken( double f ) :
+ FormulaToken( svDouble ), fDouble( f ) {}
+ FormulaDoubleToken( const FormulaDoubleToken& r ) :
+ FormulaToken( r ), fDouble( r.fDouble ) {}
+
+ virtual FormulaToken* Clone() const { return new FormulaDoubleToken(*this); }
+ virtual double GetDouble() const;
+ virtual double& GetDoubleAsReference();
+ virtual bool operator==( const FormulaToken& rToken ) const;
+
+ DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaDoubleToken )
+};
+
+
+class FORMULA_DLLPUBLIC FormulaStringToken : public FormulaToken
+{
+private:
+ String aString;
+public:
+ FormulaStringToken( const String& r ) :
+ FormulaToken( svString ), aString( r ) {}
+ FormulaStringToken( const FormulaStringToken& r ) :
+ FormulaToken( r ), aString( r.aString ) {}
+
+ virtual FormulaToken* Clone() const { return new FormulaStringToken(*this); }
+ virtual const String& GetString() const;
+ virtual bool operator==( const FormulaToken& rToken ) const;
+
+ DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaStringToken )
+};
+
+
+/** Identical to FormulaStringToken, but with explicit OpCode instead of implicit
+ ocPush, and an optional sal_uInt8 for ocBad tokens. */
+class FORMULA_DLLPUBLIC FormulaStringOpToken : public FormulaByteToken
+{
+private:
+ String aString;
+public:
+ FormulaStringOpToken( OpCode e, const String& r ) :
+ FormulaByteToken( e, 0, svString, false ), aString( r ) {}
+ FormulaStringOpToken( const FormulaStringOpToken& r ) :
+ FormulaByteToken( r ), aString( r.aString ) {}
+
+ virtual FormulaToken* Clone() const { return new FormulaStringOpToken(*this); }
+ virtual const String& GetString() const;
+ virtual bool operator==( const FormulaToken& rToken ) const;
+};
+
+class FORMULA_DLLPUBLIC FormulaIndexToken : public FormulaToken
+{
+private:
+ sal_uInt16 nIndex;
+ bool mbGlobal;
+public:
+ FormulaIndexToken( OpCode e, sal_uInt16 n, bool bGlobal = true ) :
+ FormulaToken( svIndex, e ), nIndex( n ), mbGlobal( bGlobal ) {}
+ FormulaIndexToken( const FormulaIndexToken& r ) :
+ FormulaToken( r ), nIndex( r.nIndex ), mbGlobal( r.mbGlobal ) {}
+
+ virtual FormulaToken* Clone() const { return new FormulaIndexToken(*this); }
+ virtual sal_uInt16 GetIndex() const;
+ virtual void SetIndex( sal_uInt16 n );
+ virtual bool IsGlobal() const;
+ virtual void SetGlobal( bool b );
+ virtual bool operator==( const FormulaToken& rToken ) const;
+};
+
+
+class FORMULA_DLLPUBLIC FormulaExternalToken : public FormulaToken
+{
+private:
+ String aExternal;
+ sal_uInt8 nByte;
+public:
+ FormulaExternalToken( OpCode e, sal_uInt8 n, const String& r ) :
+ FormulaToken( svExternal, e ), aExternal( r ),
+ nByte( n ) {}
+ FormulaExternalToken( OpCode e, const String& r ) :
+ FormulaToken(svExternal, e ), aExternal( r ),
+ nByte( 0 ) {}
+ FormulaExternalToken( const FormulaExternalToken& r ) :
+ FormulaToken( r ), aExternal( r.aExternal ),
+ nByte( r.nByte ) {}
+
+ virtual FormulaToken* Clone() const { return new FormulaExternalToken(*this); }
+ virtual const String& GetExternal() const;
+ virtual sal_uInt8 GetByte() const;
+ virtual void SetByte( sal_uInt8 n );
+ virtual bool operator==( const FormulaToken& rToken ) const;
+};
+
+
+class FORMULA_DLLPUBLIC FormulaMissingToken : public FormulaToken
+{
+public:
+ FormulaMissingToken() :
+ FormulaToken( svMissing,ocMissing ) {}
+ FormulaMissingToken( const FormulaMissingToken& r ) :
+ FormulaToken( r ) {}
+
+ virtual FormulaToken* Clone() const { return new FormulaMissingToken(*this); }
+ virtual double GetDouble() const;
+ virtual const String& GetString() const;
+ virtual bool operator==( const FormulaToken& rToken ) const;
+};
+
+class FORMULA_DLLPUBLIC FormulaJumpToken : public FormulaToken
+{
+private:
+ short* pJump;
+public:
+ FormulaJumpToken( OpCode e, short* p ) :
+ FormulaToken( formula::svJump , e)
+ {
+ pJump = new short[ p[0] + 1 ];
+ memcpy( pJump, p, (p[0] + 1) * sizeof(short) );
+ }
+ FormulaJumpToken( const FormulaJumpToken& r ) :
+ FormulaToken( r )
+ {
+ pJump = new short[ r.pJump[0] + 1 ];
+ memcpy( pJump, r.pJump, (r.pJump[0] + 1) * sizeof(short) );
+ }
+ virtual ~FormulaJumpToken();
+ virtual short* GetJump() const;
+ virtual bool operator==( const formula::FormulaToken& rToken ) const;
+ virtual FormulaToken* Clone() const { return new FormulaJumpToken(*this); }
+};
+
+
+class FORMULA_DLLPUBLIC FormulaSubroutineToken : public FormulaToken
+{
+public:
+ /** Takes ownership of pArray and deletes it upon destruction! */
+ FormulaSubroutineToken( const FormulaTokenArray* pArray ) :
+ FormulaToken( svSubroutine, ocCall ), mpArray( pArray) {}
+ FormulaSubroutineToken( const FormulaSubroutineToken& r );
+ virtual ~FormulaSubroutineToken();
+ virtual FormulaToken* Clone() const { return new FormulaSubroutineToken(*this); }
+ virtual bool operator==( const FormulaToken& rToken ) const;
+
+private:
+ const FormulaTokenArray* mpArray;
+};
+
+
+class FORMULA_DLLPUBLIC FormulaUnknownToken : public FormulaToken
+{
+public:
+ FormulaUnknownToken( OpCode e ) :
+ FormulaToken( svUnknown, e ) {}
+ FormulaUnknownToken( const FormulaUnknownToken& r ) :
+ FormulaToken( r ) {}
+
+ virtual FormulaToken* Clone() const { return new FormulaUnknownToken(*this); }
+ virtual bool operator==( const FormulaToken& rToken ) const;
+};
+
+
+class FORMULA_DLLPUBLIC FormulaErrorToken : public FormulaToken
+{
+ sal_uInt16 nError;
+public:
+ FormulaErrorToken( sal_uInt16 nErr ) :
+ FormulaToken( svError ), nError( nErr) {}
+ FormulaErrorToken( const FormulaErrorToken& r ) :
+ FormulaToken( r ), nError( r.nError) {}
+
+ virtual FormulaToken* Clone() const { return new FormulaErrorToken(*this); }
+ virtual sal_uInt16 GetError() const;
+ virtual void SetError( sal_uInt16 nErr );
+ virtual bool operator==( const FormulaToken& rToken ) const;
+};
+
+// =============================================================================
+} // formula
+// =============================================================================
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
new file mode 100644
index 000000000000..875b055a621a
--- /dev/null
+++ b/include/formula/tokenarray.hxx
@@ -0,0 +1,287 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef FORMULA_TOKENARRAY_HXX
+#define FORMULA_TOKENARRAY_HXX
+
+#include <limits.h>
+#include "formula/token.hxx"
+#include "formula/ExternalReferenceHelper.hxx"
+#include <tools/solar.h>
+#include <com/sun/star/sheet/FormulaToken.hpp>
+
+namespace formula
+{
+
+// RecalcMode access only via TokenArray SetRecalcMode / IsRecalcMode...
+
+typedef sal_uInt8 ScRecalcMode;
+// Only one of the exclusive bits can be set,
+// handled by TokenArray SetRecalcMode... methods
+#define RECALCMODE_NORMAL 0x01 // exclusive
+#define RECALCMODE_ALWAYS 0x02 // exclusive, always
+#define RECALCMODE_ONLOAD 0x04 // exclusive, always after load
+#define RECALCMODE_ONLOAD_ONCE 0x08 // exclusive, once after load
+#define RECALCMODE_FORCED 0x10 // combined, also if cell isn't visible
+#define RECALCMODE_ONREFMOVE 0x20 // combined, if reference was moved
+#define RECALCMODE_EMASK 0x0F // mask of exclusive bits
+// If new bits are to be defined, AddRecalcMode has to be adjusted!
+
+class FormulaMissingContext;
+
+class FORMULA_DLLPUBLIC MissingConvention
+{
+ bool mbODFF; /// TRUE: ODFF, FALSE: PODF
+public:
+ explicit MissingConvention( bool bODFF ) : mbODFF(bODFF) {}
+ // Implementation and usage only in token.cxx
+ inline bool isRewriteNeeded( OpCode eOp ) const;
+ inline bool isODFF() const { return mbODFF; }
+};
+
+class FORMULA_DLLPUBLIC FormulaTokenArray
+{
+ friend class FormulaCompiler;
+ friend class FormulaTokenIterator;
+ friend class FormulaMissingContext;
+
+protected:
+ FormulaToken** pCode; // Token code array
+ FormulaToken** pRPN; // RPN array
+ sal_uInt16 nLen; // Length of token array
+ sal_uInt16 nRPN; // Length of RPN array
+ sal_uInt16 nIndex; // Current step index
+ sal_uInt16 nError; // Error code
+ short nRefs; // Count of cell references
+ ScRecalcMode nMode; // Flags to indicate when to recalc this code
+ bool bHyperLink; // If HYPERLINK() occurs in the formula.
+
+protected:
+ void Assign( const FormulaTokenArray& );
+
+ /// Also used by the compiler. The token MUST had been allocated with new!
+ FormulaToken* Add( FormulaToken* );
+ inline void SetCombinedBitsRecalcMode( ScRecalcMode nBits )
+ { nMode |= (nBits & ~RECALCMODE_EMASK); }
+ inline ScRecalcMode GetCombinedBitsRecalcMode() const
+ { return nMode & ~RECALCMODE_EMASK; }
+ /** Exclusive bits already set in nMode are
+ zero'ed, nBits may contain combined bits, but
+ only one exclusive bit may be set! */
+ inline void SetMaskedRecalcMode( ScRecalcMode nBits )
+ { nMode = GetCombinedBitsRecalcMode() | nBits; }
+
+public:
+ FormulaTokenArray();
+ /// Assignment with references to FormulaToken entries (not copied!)
+ FormulaTokenArray( const FormulaTokenArray& );
+ virtual ~FormulaTokenArray();
+ FormulaTokenArray* Clone() const; /// True copy!
+
+ void Clear();
+ void DelRPN();
+ FormulaToken* First() { nIndex = 0; return Next(); }
+ FormulaToken* Next();
+ FormulaToken* FirstNoSpaces() { nIndex = 0; return NextNoSpaces(); }
+ FormulaToken* NextNoSpaces();
+ FormulaToken* GetNextName();
+ FormulaToken* GetNextReference();
+ FormulaToken* GetNextReferenceRPN();
+ FormulaToken* GetNextReferenceOrName();
+ FormulaToken* GetNextColRowName();
+ FormulaToken* GetNextOpCodeRPN( OpCode );
+ /// Peek at nIdx-1 if not out of bounds, decrements nIdx if successful. Returns NULL if not.
+ FormulaToken* PeekPrev( sal_uInt16 & nIdx );
+ FormulaToken* PeekNext();
+ FormulaToken* PeekPrevNoSpaces(); /// Only after Reset/First/Next/Last/Prev!
+ FormulaToken* PeekNextNoSpaces(); /// Only after Reset/First/Next/Last/Prev!
+ FormulaToken* FirstRPN() { nIndex = 0; return NextRPN(); }
+ FormulaToken* NextRPN();
+ FormulaToken* LastRPN() { nIndex = nRPN; return PrevRPN(); }
+ FormulaToken* PrevRPN();
+
+ bool HasExternalRef() const;
+ bool HasOpCode( OpCode ) const;
+ bool HasOpCodeRPN( OpCode ) const;
+ /// Token of type svIndex or opcode ocColRowName
+ bool HasNameOrColRowName() const;
+
+ FormulaToken** GetArray() const { return pCode; }
+ FormulaToken** GetCode() const { return pRPN; }
+ sal_uInt16 GetLen() const { return nLen; }
+ sal_uInt16 GetCodeLen() const { return nRPN; }
+ void Reset() { nIndex = 0; }
+ sal_uInt16 GetCodeError() const { return nError; }
+ void SetCodeError( sal_uInt16 n ) { nError = n; }
+ short GetRefs() const { return nRefs; }
+ void IncrementRefs() { ++nRefs; }
+ void SetHyperLink( bool bVal ) { bHyperLink = bVal; }
+ bool IsHyperLink() const { return bHyperLink; }
+
+ inline ScRecalcMode GetRecalcMode() const { return nMode; }
+ /** Bits aren't set directly but validated and
+ maybe handled according to priority if more
+ than one exclusive bit was set. */
+ void AddRecalcMode( ScRecalcMode nBits );
+
+ inline void ClearRecalcMode() { nMode = RECALCMODE_NORMAL; }
+ inline void SetExclusiveRecalcModeNormal()
+ { SetMaskedRecalcMode( RECALCMODE_NORMAL ); }
+ inline void SetExclusiveRecalcModeAlways()
+ { SetMaskedRecalcMode( RECALCMODE_ALWAYS ); }
+ inline void SetExclusiveRecalcModeOnLoad()
+ { SetMaskedRecalcMode( RECALCMODE_ONLOAD ); }
+ inline void SetExclusiveRecalcModeOnLoadOnce()
+ { SetMaskedRecalcMode( RECALCMODE_ONLOAD_ONCE ); }
+ inline void SetRecalcModeForced()
+ { nMode |= RECALCMODE_FORCED; }
+ inline void ClearRecalcModeForced()
+ { nMode &= ~RECALCMODE_FORCED; }
+ inline void SetRecalcModeOnRefMove()
+ { nMode |= RECALCMODE_ONREFMOVE; }
+ inline void ClearRecalcModeOnRefMove()
+ { nMode &= ~RECALCMODE_ONREFMOVE; }
+ inline bool IsRecalcModeNormal() const
+ { return (nMode & RECALCMODE_NORMAL) != 0; }
+ inline bool IsRecalcModeAlways() const
+ { return (nMode & RECALCMODE_ALWAYS) != 0; }
+ inline bool IsRecalcModeOnLoad() const
+ { return (nMode & RECALCMODE_ONLOAD) != 0; }
+ inline bool IsRecalcModeOnLoadOnce() const
+ { return (nMode & RECALCMODE_ONLOAD_ONCE) != 0; }
+ inline bool IsRecalcModeForced() const
+ { return (nMode & RECALCMODE_FORCED) != 0; }
+ inline bool IsRecalcModeOnRefMove() const
+ { return (nMode & RECALCMODE_ONREFMOVE) != 0; }
+
+ /** Get OpCode of the most outer function */
+ inline OpCode GetOuterFuncOpCode();
+
+ /** Operators +,-,*,/,^,&,=,<>,<,>,<=,>=
+ with DoubleRef in Formula? */
+ bool HasMatrixDoubleRefOps();
+
+ virtual FormulaToken* AddOpCode(OpCode e);
+
+ /** Adds the single token to array.
+ Derived classes must overload it when they want to support derived classes from FormulaToken.
+ @return true when an error occurs
+ */
+ virtual bool AddFormulaToken(const com::sun::star::sheet::FormulaToken& _aToken, ExternalReferenceHelper* _pRef = NULL);
+
+ /** fill the array with the tokens from the sequence.
+ It calls AddFormulaToken for each token in the list.
+ @param _aSequence the token to add
+ @return true when an error occurs
+ */
+ bool Fill(const com::sun::star::uno::Sequence< com::sun::star::sheet::FormulaToken >& _aSequence, ExternalReferenceHelper* _pRef = NULL);
+
+ /**
+ * Do some checking based on the individual tokens. For now, we use this
+ * only to check whether we can vectorize the token array.
+ */
+ virtual void CheckToken( const FormulaToken& t );
+
+ FormulaToken* AddToken( const FormulaToken& );
+ FormulaToken* AddString( const sal_Unicode* pStr );
+ FormulaToken* AddString( const String& rStr );
+ FormulaToken* AddDouble( double fVal );
+ FormulaToken* AddExternal( const sal_Unicode* pStr );
+ /** Xcl import may play dirty tricks with OpCode!=ocExternal.
+ Others don't use! */
+ FormulaToken* AddExternal( const String& rStr, OpCode eOp = ocExternal );
+ FormulaToken* AddBad( const String& rStr ); /// ocBad with String
+ FormulaToken* AddStringXML( const String& rStr ); /// ocStringXML with String, temporary during import
+
+ virtual FormulaToken* MergeArray( );
+
+ /// Assignment with references to FormulaToken entries (not copied!)
+ FormulaTokenArray& operator=( const FormulaTokenArray& );
+
+ /** Determines if this formula needs any changes to convert it to something
+ previous versions of OOo could consume (Plain Old Formula). */
+ bool NeedsPofRewrite(const MissingConvention & rConv);
+
+ /** Rewrites to Plain Old Formula, substituting missing parameters. The
+ FormulaTokenArray* returned is new'ed. */
+ FormulaTokenArray* RewriteMissingToPof(const MissingConvention & rConv);
+
+ /** Determines if this formula may be followed by a reference. */
+ bool MayReferenceFollow();
+};
+
+inline OpCode FormulaTokenArray::GetOuterFuncOpCode()
+{
+ if ( pRPN && nRPN )
+ return pRPN[nRPN-1]->GetOpCode();
+ return ocNone;
+}
+
+struct ImpTokenIterator
+{
+ ImpTokenIterator* pNext;
+ const FormulaTokenArray* pArr;
+ short nPC;
+ short nStop;
+
+ DECL_FIXEDMEMPOOL_NEWDEL( ImpTokenIterator );
+};
+
+class FORMULA_DLLPUBLIC FormulaTokenIterator
+{
+ ImpTokenIterator* pCur;
+
+public:
+ FormulaTokenIterator( const FormulaTokenArray& );
+ ~FormulaTokenIterator();
+ void Reset();
+ const FormulaToken* Next();
+ const FormulaToken* PeekNextOperator();
+ bool IsEndOfPath() const; /// if a jump or subroutine path is done
+ bool HasStacked() const { return pCur->pNext != 0; }
+ short GetPC() const { return pCur->nPC; }
+
+ /** Jump or subroutine call.
+ Program counter values will be incremented before code is executed =>
+ positions are to be passed with -1 offset.
+ @param nStart
+ Start on code at position nStart+1 (yes, pass with offset -1)
+ @param nNext
+ After subroutine continue with instruction at position nNext+1
+ @param nStop
+ Stop before reaching code at position nStop. If not specified the
+ default is to either run the entire code, or to stop if an ocSep or
+ ocClose is encountered, which are only present in ocIf or ocChose
+ jumps.
+ */
+ void Jump( short nStart, short nNext, short nStop = SHRT_MAX );
+ void Push( const FormulaTokenArray* );
+ void Pop();
+
+private:
+ const FormulaToken* GetNonEndOfPathToken( short nIdx ) const;
+};
+// =============================================================================
+} // formula
+// =============================================================================
+
+
+#endif // FORMULA_TOKENARRAY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/actiontriggerhelper.hxx b/include/framework/actiontriggerhelper.hxx
new file mode 100644
index 000000000000..e942de94924f
--- /dev/null
+++ b/include/framework/actiontriggerhelper.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 __FRAMEWORK_HELPER_ACTIONTRIGGERHELPER_HXX_
+#define __FRAMEWORK_HELPER_ACTIONTRIGGERHELPER_HXX_
+
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <vcl/menu.hxx>
+#include <framework/fwedllapi.h>
+
+
+namespace framework
+{
+ class FWE_DLLPUBLIC ActionTriggerHelper
+ {
+ public:
+ // Fills the submitted menu with the structure contained in the second
+ // parameter rActionTriggerContainer
+ // @param pNewMenu = must be a valid and empty menu
+ // @param rActionTriggerContainer = must be an instance of service "com.sun.star.ui.ActionTriggerContaienr"
+ static void
+ CreateMenuFromActionTriggerContainer(
+ Menu* pNewMenu,
+ const com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& rActionTriggerContainer );
+
+ // Creates a "com::sun::star::ui::ActionTriggerContainer" with the structure of the menu
+ // provided as a parameter. The implementation class stores the menu pointer
+ // to optimize the time of creation of a menu from a actiontrigger structure.
+ // IMPORTANT: The caller must ensure that the menu pointer is valid through the
+ // life time of the XIndexContainer object!!!
+ // @param pNewMenu = Must be a valid menu. Please be aware that this implementation is based on
+ // the above mentioned restriction!!!
+
+ static com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer > CreateActionTriggerContainerFromMenu(
+ const Menu* pMenu, const OUString* pMenuIdentifier );
+
+ // Fills the submitted rActionTriggerContainer with the structure of the menu
+ // provided as the second parameter
+ // @param rActionTriggerContainer = must be an instance of service "com.sun.star.ui.ActionTriggerContainer"
+ // @param pNewMenu = must be a valid menu
+ static void
+ FillActionTriggerContainerFromMenu(
+ com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& rActionTriggerContainer,
+ const Menu* pMenu );
+
+ };
+}
+
+#endif // __FRAMEWORK_HELPER_ACTIONTRIGGERHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/addonmenu.hxx b/include/framework/addonmenu.hxx
new file mode 100644
index 000000000000..6390459be0f1
--- /dev/null
+++ b/include/framework/addonmenu.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 __FRAMEWORK_CLASSES_ADDONMENU_HXX_
+#define __FRAMEWORK_CLASSES_ADDONMENU_HXX_
+
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <vcl/menu.hxx>
+#include <framework/fwedllapi.h>
+
+#define ADDONMENU_ITEMID_START 2000
+#define ADDONMENU_ITEMID_END 3000
+
+namespace framework
+{
+
+class FWE_DLLPUBLIC AddonMenu : public PopupMenu
+{
+ public:
+ AddonMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
+ ~AddonMenu();
+
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+};
+
+class AddonMenuManager;
+
+class FWE_DLLPUBLIC AddonPopupMenu : public AddonMenu
+{
+ public:
+ ~AddonPopupMenu();
+
+ // Check if command URL string has the unique prefix to identify addon popup menus
+ static sal_Bool IsCommandURLPrefix( const OUString& aCmdURL );
+
+ void SetCommandURL( const OUString& aCmdURL ) { m_aCommandURL = aCmdURL; }
+ const OUString& GetCommandURL() const { return m_aCommandURL; }
+
+ protected:
+ void Initialize( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rAddonPopupMenuDefinition );
+
+ private:
+ AddonPopupMenu( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame );
+
+ OUString m_aCommandURL;
+
+ friend class AddonMenuManager;
+};
+
+class FWE_DLLPUBLIC AddonMenuManager
+{
+ public:
+ enum MenuType
+ {
+ ADDON_MENU,
+ ADDON_POPUPMENU
+ };
+
+ static sal_Bool HasAddonMenuElements();
+
+ static sal_Bool IsAddonMenuId( sal_uInt16 nId ) { return (( nId >= ADDONMENU_ITEMID_START ) && ( nId < ADDONMENU_ITEMID_END )); }
+
+ // Check if the context string matches the provided xModel context
+ static sal_Bool IsCorrectContext( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rModel, const OUString& aContext );
+
+ // Factory method to create different Add-On menu types
+ static PopupMenu* CreatePopupMenuType( MenuType eMenuType, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame );
+
+ // Create the Add-Ons menu
+ static AddonMenu* CreateAddonMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
+
+ // Merge the Add-Ons help menu items into the given menu bar at a defined pos
+ static void MergeAddonHelpMenu( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
+ MenuBar* pMergeMenuBar );
+
+ // Merge the addon popup menus into the given menu bar at the provided pos.
+ static void MergeAddonPopupMenus( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
+ const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rModel,
+ sal_uInt16 nMergeAtPos,
+ MenuBar* pMergeMenuBar );
+
+ // Returns the next position to insert a menu item/sub menu
+ static sal_uInt16 GetNextPos( sal_uInt16 nPos );
+
+ // Build up the menu item and sub menu into the provided pCurrentMenu. The sub menus should be of type nSubMenuType.
+ static void BuildMenu( PopupMenu* pCurrentMenu,
+ MenuType nSubMenuType,
+ sal_uInt16 nInsPos,
+ sal_uInt16& nUniqueMenuId,
+ com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > > aAddonMenuDefinition,
+ const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
+ const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rModel );
+
+ // Retrieve the menu entry property values from a sequence
+ static void GetMenuEntry( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rAddonMenuEntry,
+ OUString& rTitle,
+ OUString& rURL,
+ OUString& rTarget,
+ OUString& rImageId,
+ OUString& rContext,
+ com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > >& rAddonSubMenu );
+};
+
+} // namespace framework
+
+#endif // #ifndef __FRAMEWORK_CLASSES_ADDONMENU_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/addonsoptions.hxx b/include/framework/addonsoptions.hxx
new file mode 100644
index 000000000000..def743378216
--- /dev/null
+++ b/include/framework/addonsoptions.hxx
@@ -0,0 +1,350 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __FRAMEWORK_CLASSES_ADDONSOPTIONS_HXX_
+#define __FRAMEWORK_CLASSES_ADDONSOPTIONS_HXX_
+
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <vcl/image.hxx>
+#include <vcl/bitmap.hxx>
+#include <vcl/svapp.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <framework/fwedllapi.h>
+//_________________________________________________________________________________________________________________
+// types, enums, ...
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @descr The method GetAddonsMenu() returns a list of property values.
+ Use follow defines to seperate values by names.
+*//*-*************************************************************************************************************/
+#define ADDONSMENUITEM_STRING_URL "URL"
+#define ADDONSMENUITEM_STRING_TITLE "Title"
+#define ADDONSMENUITEM_STRING_TARGET "Target"
+#define ADDONSMENUITEM_STRING_IMAGEIDENTIFIER "ImageIdentifier"
+#define ADDONSMENUITEM_STRING_CONTEXT "Context"
+#define ADDONSMENUITEM_STRING_SUBMENU "Submenu"
+#define ADDONSMENUITEM_STRING_CONTROLTYPE "ControlType"
+#define ADDONSMENUITEM_STRING_WIDTH "Width"
+
+#define ADDONSMENUITEM_URL_LEN 3
+#define ADDONSMENUITEM_TITLE_LEN 5
+#define ADDONSMENUITEM_TARGET_LEN 6
+#define ADDONSMENUITEM_SUBMENU_LEN 7
+#define ADDONSMENUITEM_CONTEXT_LEN 7
+#define ADDONSMENUITEM_IMAGEIDENTIFIER_LEN 15
+
+#define ADDONSMENUITEM_PROPERTYNAME_URL OUString(ADDONSMENUITEM_STRING_URL )
+#define ADDONSMENUITEM_PROPERTYNAME_TITLE OUString(ADDONSMENUITEM_STRING_TITLE )
+#define ADDONSMENUITEM_PROPERTYNAME_TARGET OUString(ADDONSMENUITEM_STRING_TARGET )
+#define ADDONSMENUITEM_PROPERTYNAME_IMAGEIDENTIFIER OUString(ADDONSMENUITEM_STRING_IMAGEIDENTIFIER )
+#define ADDONSMENUITEM_PROPERTYNAME_CONTEXT OUString(ADDONSMENUITEM_STRING_CONTEXT )
+#define ADDONSMENUITEM_PROPERTYNAME_SUBMENU OUString(ADDONSMENUITEM_STRING_SUBMENU )
+#define ADDONSMENUITEM_PROPERTYNAME_CONTROLTYPE OUString(ADDONSMENUITEM_STRING_CONTROLTYPE )
+#define ADDONSMENUITEM_PROPERTYNAME_WIDTH OUString(ADDONSMENUITEM_STRING_WIDTH )
+
+#define ADDONSPOPUPMENU_URL_PREFIX_STR "private:menu/Addon"
+
+#define ADDONSPOPUPMENU_URL_PREFIX OUString( ADDONSPOPUPMENU_URL_PREFIX_STR )
+
+namespace framework
+{
+
+typedef ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > MergeMenuDefinition;
+
+struct FWE_DLLPUBLIC MergeMenuInstruction
+{
+ OUString aMergePoint;
+ OUString aMergeCommand;
+ OUString aMergeCommandParameter;
+ OUString aMergeFallback;
+ OUString aMergeContext;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > aMergeMenu;
+};
+typedef ::std::vector< MergeMenuInstruction > MergeMenuInstructionContainer;
+
+struct FWE_DLLPUBLIC MergeToolbarInstruction
+{
+ OUString aMergeToolbar;
+ OUString aMergePoint;
+ OUString aMergeCommand;
+ OUString aMergeCommandParameter;
+ OUString aMergeFallback;
+ OUString aMergeContext;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > aMergeToolbarItems;
+};
+
+typedef ::std::vector< MergeToolbarInstruction > MergeToolbarInstructionContainer;
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class AddonsOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about menu features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class FWE_DLLPUBLIC AddonsOptions
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ AddonsOptions();
+ ~AddonsOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short clears completely the addons menu
+ @descr Call this methods to clear the addons menu
+ To fill it again use AppendItem().
+
+ @seealso -
+
+ @param "eMenu" select right menu to clear.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void Clear();
+
+ /*-****************************************************************************************************//**
+ @short returns if an addons menu is available
+ @descr Call to retrieve if a addons menu is available
+
+
+ @return sal_True if there is a menu otherwise sal_False
+ *//*-*****************************************************************************************************/
+
+ sal_Bool HasAddonsMenu() const;
+
+ /*-****************************************************************************************************//**
+ @short returns number of addons toolbars
+ @descr Call to retrieve the number of addons toolbars
+
+
+ @return number of addons toolbars
+ *//*-*****************************************************************************************************/
+ sal_Int32 GetAddonsToolBarCount() const ;
+
+ /*-****************************************************************************************************//**
+ @short returns the complete addons menu
+ @descr Call it to get all entries of the addon menu.
+ We return a list of all nodes with his names and properties.
+
+ @seealso -
+
+ @return A list of menu items is returned.
+
+ @onerror We return an empty list.
+ *//*-*****************************************************************************************************/
+
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& GetAddonsMenu() const;
+
+ /*-****************************************************************************************************//**
+ @short Gets the menu bar part of all addon components registered
+ @descr -
+
+ @seealso -
+
+ @return A complete
+
+ @onerror We return sal_False
+ *//*-*****************************************************************************************************/
+
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& GetAddonsMenuBarPart() const;
+
+ /*-****************************************************************************************************//**
+ @short Gets a toolbar part of an single addon
+ @descr -
+
+ @seealso -
+
+ @return A complete
+
+ @onerror We return sal_False
+ *//*-*****************************************************************************************************/
+
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& GetAddonsToolBarPart( sal_uInt32 nIndex ) const;
+
+ /*-****************************************************************************************************//**
+ @short Gets a unique toolbar resource name of an single addon
+ @descr -
+
+ @seealso -
+
+ @return A complete
+
+ @onerror We return sal_False
+ *//*-*****************************************************************************************************/
+
+ const OUString GetAddonsToolbarResourceName( sal_uInt32 nIndex ) const;
+
+ /*-****************************************************************************************************//**
+ @short Retrieves all available merge instructions for the Office menu bar
+ @descr -
+
+ @seealso -
+
+ @return The filled MergeMenuDefinitionContaier
+
+ @onerror We return sal_False
+ *//*-*****************************************************************************************************/
+
+ const MergeMenuInstructionContainer& GetMergeMenuInstructions() const;
+
+ /*-****************************************************************************************************//**
+ @short Retrieves all available merge instructions for a single toolbar
+ @descr -
+
+ @seealso -
+
+ @return The filled
+
+ @onerror We return sal_False
+ *//*-*****************************************************************************************************/
+ bool GetMergeToolbarInstructions( const OUString& rToolbarName, MergeToolbarInstructionContainer& rToolbar ) const;
+
+ /*-****************************************************************************************************//**
+ @short Gets the Add-On help menu part of all addon components registered
+ @descr -
+
+ @seealso -
+
+ @return A complete
+
+ @onerror We return sal_False
+ *//*-*****************************************************************************************************/
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& GetAddonsHelpMenu() const;
+
+ /*-****************************************************************************************************//**
+ @short Retrieve an image for a command URL which is defined inside the addon menu configuration
+ @descr Call it to retrieve an image for a command URL which is defined inside the addon menu configuration
+
+ @seealso -
+
+ @return An image which was defined in the configuration for the menu item. The image can be empty
+ no bitmap was defined for the request image properties.
+
+ @onerror An empty image
+ *//*-*****************************************************************************************************/
+
+ Image GetImageFromURL( const OUString& aURL, sal_Bool bBig, sal_Bool bNoScale ) const;
+ Image GetImageFromURL( const OUString& aURL, sal_Bool bBig ) const;
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ static ::osl::Mutex& GetOwnStaticMutex();
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+ DECL_STATIC_LINK( AddonsOptions, Notify, void* );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static AddonsOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtMenuOptions
+
+}
+
+#endif // #ifndef __FRAMEWORK_CLASSES_ADDONSOPTIONS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/bmkmenu.hxx b/include/framework/bmkmenu.hxx
new file mode 100644
index 000000000000..d78eefeced24
--- /dev/null
+++ b/include/framework/bmkmenu.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 __FRAMEWORK_CLASSES_BMKMENU_HXX
+#define __FRAMEWORK_CLASSES_BMKMENU_HXX
+
+#include "framework/addonmenu.hxx"
+
+#include <com/sun/star/frame/XFrame.hpp>
+#include <framework/fwedllapi.h>
+
+#include <vcl/menu.hxx>
+#include <vcl/image.hxx>
+
+class String;
+class ImageList;
+
+#define BMKMENU_ITEMID_START 20000
+
+namespace framework
+{
+
+class BmkMenu_Impl;
+class FWE_DLLPUBLIC BmkMenu : public AddonMenu
+{
+ public:
+ enum BmkMenuType
+ {
+ BMK_NEWMENU,
+ BMK_WIZARDMENU
+ };
+
+ BmkMenu( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ BmkMenuType nType
+ );
+
+ ~BmkMenu();
+
+ void Initialize(); // Synchrones Laden der Eintraege
+
+ protected:
+ BmkMenu::BmkMenuType m_nType;
+ sal_uInt16 CreateMenuId();
+
+ private:
+
+ BmkMenu_Impl* _pImp;
+};
+
+} // namespace framework
+
+#endif // #ifndef __FRAMEWORK_CLASSES_BMKMENU_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/configimporter.hxx b/include/framework/configimporter.hxx
new file mode 100644
index 000000000000..06b6467f6c2a
--- /dev/null
+++ b/include/framework/configimporter.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 __FRAMEWORK_HELPER_CONFIGIMPORTER_HXX_
+#define __FRAMEWORK_HELPER_CONFIGIMPORTER_HXX_
+
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/ui/XUIConfigurationManager2.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <rtl/ustring.hxx>
+#include <framework/fwedllapi.h>
+
+namespace framework
+{
+ class FWE_DLLPUBLIC UIConfigurationImporterOOo1x
+ {
+ public:
+ static sal_Bool ImportCustomToolbars(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager2 >& rContainerFactory,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > >& rSeqContainer,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rToolbarStorage );
+ };
+
+} // namespace framework
+
+#endif // __FRAMEWORK_HELPER_CONFIGIMPORTER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/documentundoguard.hxx b/include/framework/documentundoguard.hxx
new file mode 100644
index 000000000000..1954a72b5c67
--- /dev/null
+++ b/include/framework/documentundoguard.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 FRAMEWORK_DOCUMENTUNDOGUARD_HXX
+#define FRAMEWORK_DOCUMENTUNDOGUARD_HXX
+
+#include "framework/fwedllapi.h"
+
+#include <com/sun/star/uno/XInterface.hpp>
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace framework
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= DocumentUndoGuard
+ //==================================================================================================================
+ struct DocumentUndoGuard_Data;
+ /** a helper class guarding the Undo manager of a document
+
+ This class guards, within a given scope, the Undo Manager of a document (or another component supporting
+ the XUndoManagerSupplier interface). When entering the scope (i.e. when the <code>DocumentUndoGuard</code>
+ instances is constructed), the current state of the undo contexts of the undo manager is examined.
+ Upon leaving the scope (i.e. when the <code>DocumentUndoGuard</code> is destructed), the guard will execute
+ as many calls to <member scope="com::sun::star::document">XUndoManager::leaveUndoContext</member> as are
+ necessary to restore the manager's initial state.
+ */
+ class FWE_DLLPUBLIC DocumentUndoGuard
+ {
+ public:
+ DocumentUndoGuard( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_undoSupplierComponent );
+ ~DocumentUndoGuard();
+
+ private:
+ ::boost::scoped_ptr< DocumentUndoGuard_Data > m_pData;
+ };
+
+//......................................................................................................................
+} // namespace framework
+//......................................................................................................................
+
+#endif // FRAMEWORK_DOCUMENTUNDOGUARD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/eventsconfiguration.hxx b/include/framework/eventsconfiguration.hxx
new file mode 100644
index 000000000000..29694b7fb539
--- /dev/null
+++ b/include/framework/eventsconfiguration.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 __FRAMEWORK_XML_EVENTSCONFIGURATION_HXX_
+#define __FRAMEWORK_XML_EVENTSCONFIGURATION_HXX_
+
+#include <framework/fwedllapi.h>
+#include <tools/stream.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
+namespace framework
+{
+
+struct FWE_DLLPUBLIC EventsConfig
+{
+ ::com::sun::star::uno::Sequence< OUString > aEventNames;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aEventsProperties;
+};
+
+} // namespace framework
+
+#endif // __FRAMEWORK_XML_EVENTSCONFIGURATION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/framelistanalyzer.hxx b/include/framework/framelistanalyzer.hxx
new file mode 100644
index 000000000000..951474c3934d
--- /dev/null
+++ b/include/framework/framelistanalyzer.hxx
@@ -0,0 +1,195 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __FRAMEWORK_CLASSES_FRAMELISTANALYZER_HXX_
+#define __FRAMEWORK_CLASSES_FRAMELISTANALYZER_HXX_
+
+#include <com/sun/star/frame/XFrame.hpp>
+
+#include <framework/fwedllapi.h>
+
+namespace framework{
+
+/** analyze and split the current available frame list of a given frames supplier
+ into different parts.
+
+ These analyzed information can be used e.g. to decide if it's neccessary
+ to switch into the backing mode, close the current active frame only or
+ exit the whole application explicitly or implicitly.
+ */
+class FWE_DLLPUBLIC FrameListAnalyzer
+{
+ //_______________________________________
+ // types
+
+ public:
+
+ /** These enums can be combined as flags to enable/disable
+ special search algorithm during analyze phase.
+ see impl_analyze() for further information.
+ But note: To be useable as flags, these enums
+ must be values of range [2^n]! */
+ enum EDetect
+ {
+ E_MODEL = 1,
+ E_HELP = 2,
+ E_BACKINGCOMPONENT = 4,
+ E_HIDDEN = 8,
+ E_ALL = 15,
+ E_ZOMBIE = 32768 // use it for special test scenarios only!!!
+ };
+
+ //_______________________________________
+ // member
+
+ public:
+
+ /** provides access to the frame container, which should be analyzed. */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFramesSupplier >& m_xSupplier;
+
+ /** hold the reference frame, which is used e.g. to detect other frames with the same model. */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& m_xReferenceFrame;
+
+ /** enable/disable some special analyzing steps.
+ see impl_analyze() for further information. */
+ sal_uInt32 m_eDetectMode;
+
+ /** contains all frames, which uses the same model like the reference frame.
+ Will be filled only if m_eDetectMode has set the flag E_MODEL.
+ The reference frame is never part of this list! */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > > m_lModelFrames;
+
+ /** contains all frames, which does not contain the same model like the reference frame.
+ Filling of it can't be supressed by m_eDetectMode.
+ The reference frame is never part of this list!
+ All frames inside this list are visible ones. */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > > m_lOtherVisibleFrames;
+
+ /** contains all frames, which does not contain the same model like the reference frame.
+ Filling of it can't be supressed by m_eDetectMode.
+ The reference frame is never part of this list!
+ All frames inside this list are hidden ones. */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > > m_lOtherHiddenFrames;
+
+ /** points to the help frame.
+ Will be set only, if any other frame (means different from the reference frame)
+ contains the help component. If the reference frame itself includes the help module
+ it's not set ... but another member m_bIsHelp is used to safe this information.
+ See following example code:
+
+ <listing>
+ if (m_xReferenceFrame == help)
+ {
+ m_xHelp = NULL;
+ m_bIsHelp = sal_True;
+ }
+ else
+ if (xOtherFrame == help)
+ {
+ m_xHelp = xOtherFrame;
+ m_bIsHelp = sal_False;
+ }
+ </listing>
+
+ Analyzing of the help frame ignores the visible state of any frame.
+ But note: a hidden help frame indicates a wrong state!
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xHelp;
+
+ /** points to the frame, which contains the backing component.
+ Will be set only, if any other frame (means different from the reference frame)
+ contains the backing component. If the reference frame itself includes the
+ backing component it's not set ... but another member m_bIsBackingComponent
+ will used to safe this information.
+ See following example code:
+
+ <listing>
+ if (m_xReferenceFrame == backing)
+ {
+ m_xBackingComponent = NULL;
+ m_bIsBackingComponent = sal_True;
+ }
+ else
+ if (xOtherFrame == backing)
+ {
+ m_xBackingComponent = xOtherFrame;
+ m_bIsBackingComponent = sal_False ;
+ }
+ </listing>
+
+ Analyzing of the help frame ignores the visible state of any frame.
+ But note: a hidden backing mode frame indicates a wrong state!
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xBackingComponent;
+
+ /** is set to true only, if the reference frame is a hidden one.
+ This value is undefined if m_eDetectMode doesn't have set the flag E_HIDDEN! */
+ sal_Bool m_bReferenceIsHidden;
+
+ /** is set to true only, if the reference frame contains the help component.
+ In this case the member m_xHelp is set to NULL everytimes.
+ This value is undefined if m_eDetectMode doesn't have set the flag E_HELP! */
+ sal_Bool m_bReferenceIsHelp;
+
+ /** is set to true only, if the reference frame contains the backing component.
+ In this case the member m_xBackingComponent is set to NULL everytimes.
+ This value is undefined if m_eDetectMode doesn't have set the flag E_BACKINGCOMPONENT! */
+ sal_Bool m_bReferenceIsBacking;
+
+ //_______________________________________
+ // interface
+
+ public:
+
+ /** starts analyze phase and fille all members with valid information.
+
+ @param xSupplier
+ Must be a valid reference to a frames supplier, which provies
+ access to the frame list for analyzing.
+
+ @param xReferenceFrame
+ This frame must(!) exist inside the analyzed frame list and
+ is used for some comparing functions. Further some member states
+ depends from the current state of this frame.
+
+ @param eDetectMode
+ It represent a flag field, which can enable/disable special
+ analyze steps. Note: Some member values will be undefined, if
+ an analyze step will be disabled.
+ */
+ FrameListAnalyzer( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFramesSupplier >& xSupplier ,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xReferenceFrame ,
+ sal_uInt32 eDetectMode );
+ virtual ~FrameListAnalyzer();
+
+ //_______________________________________
+ // helper
+
+ private:
+
+ void impl_analyze();
+
+
+}; // class FrameListAnalyzer
+
+} // namespace framework
+
+#endif // #ifndef __FRAMEWORK_CLASSES_FRAMELISTANALYZER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/fwedllapi.h b/include/framework/fwedllapi.h
new file mode 100644
index 000000000000..14201508768a
--- /dev/null
+++ b/include/framework/fwedllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_FWEDLLAPI_H
+#define INCLUDED_FWEDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(FWE_DLLIMPLEMENTATION)
+#define FWE_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define FWE_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define FWE_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_FWEDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/iguard.hxx b/include/framework/iguard.hxx
new file mode 100644
index 000000000000..a522d6225e43
--- /dev/null
+++ b/include/framework/iguard.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 __FRAMEWORK_THREADHELP_IGUARD_H_
+#define __FRAMEWORK_THREADHELP_IGUARD_H_
+
+#include <sal/types.h>
+
+namespace framework{
+
+/*-************************************************************************************************************//**
+ @descr interface for guarding a lock
+*//*-*************************************************************************************************************/
+class SAL_NO_VTABLE IGuard
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+ public:
+
+ /** clears the lock. If the guard does not currently hold the lock, nothing happens.
+ */
+ virtual void clear() = 0;
+
+ /** attempts to re-establishes the lock, blocking until the attempt is successful.
+ */
+ virtual void reset() = 0;
+
+ protected:
+ ~IGuard() {}
+
+}; // class IGuard
+
+} // namespace framework
+
+#endif // #ifndef __FRAMEWORK_THREADHELP_IGUARD_H_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/imageproducer.hxx b/include/framework/imageproducer.hxx
new file mode 100644
index 000000000000..0d9398f7b2a3
--- /dev/null
+++ b/include/framework/imageproducer.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 __FRAMEWORK_HELPER_IMAGEPRODUCER_HXX_
+#define __FRAMEWORK_HELPER_IMAGEPRODUCER_HXX_
+
+#include <sal/types.h>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <vcl/image.hxx>
+#include <rtl/ustring.hxx>
+#include <framework/fwedllapi.h>
+
+namespace framework
+{
+
+typedef Image ( *pfunc_getImage)(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ const OUString& aURL,
+ bool bBig
+);
+
+pfunc_getImage FWE_DLLPUBLIC SAL_CALL SetImageProducer( pfunc_getImage pGetImageFunc );
+
+Image FWE_DLLPUBLIC SAL_CALL GetImageFromURL(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ const OUString& aURL,
+ bool bBig
+);
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/imutex.hxx b/include/framework/imutex.hxx
new file mode 100644
index 000000000000..f576297e0d14
--- /dev/null
+++ b/include/framework/imutex.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 __FRAMEWORK_THREADHELP_IMUTEX_H_
+#define __FRAMEWORK_THREADHELP_IMUTEX_H_
+
+#include <sal/types.h>
+
+namespace framework{
+
+/*-************************************************************************************************************//**
+ @descr We need this interface to support using of different mutex implementations in a generic way.
+*//*-*************************************************************************************************************/
+class SAL_NO_VTABLE IMutex
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+ public:
+
+ /*-****************************************************************************************************//**
+ @descr These functions must be supported by a derived class!
+ acquire() -try to register thread
+ release() -unregister thread
+ *//*-*****************************************************************************************************/
+ virtual void acquire() = 0;
+ virtual void release() = 0;
+
+ protected:
+ ~IMutex() {}
+}; // class IMutex
+
+} // namespace framework
+
+#endif // #ifndef __FRAMEWORK_THREADHELP_IMUTEX_H_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/interaction.hxx b/include/framework/interaction.hxx
new file mode 100644
index 000000000000..1cd56bbd36d9
--- /dev/null
+++ b/include/framework/interaction.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 __FRAMEWORK_DISPATCH_INTERACTION_HXX_
+#define __FRAMEWORK_DISPATCH_INTERACTION_HXX_
+
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <com/sun/star/task/XInteractionContinuation.hpp>
+#include <com/sun/star/task/XInteractionAbort.hpp>
+#include <com/sun/star/task/XInteractionApprove.hpp>
+#include <com/sun/star/task/XInteractionDisapprove.hpp>
+#include <com/sun/star/task/XInteractionRetry.hpp>
+#include <com/sun/star/document/XInteractionFilterSelect.hpp>
+#include <com/sun/star/document/NoSuchFilterRequest.hpp>
+#include <com/sun/star/document/AmbigousFilterRequest.hpp>
+#include <com/sun/star/uno/RuntimeException.hpp>
+
+#include <rtl/ustring.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <framework/fwedllapi.h>
+
+namespace framework{
+
+/*-************************************************************************************************************//**
+ @short special request for interaction to ask user for right filter
+ @descr These helper can be used to ask user for right filter, if filter detection failed.
+ It capsulate communication with any interaction handler and supports an easy
+ access on interaction results for user of these class.
+ Use it and forget complex mechanism of interaction ...
+
+ @example RequestFilterSelect* pRequest = new RequestFilterSelect;
+ Reference< XInteractionRequest > xRequest ( pRequest );
+ xInteractionHandler->handle( xRequest );
+ if( ! pRequest.isAbort() )
+ {
+ OUString sFilter = pRequest->getFilter();
+ }
+
+ @implements XInteractionRequest
+
+ @base WeakImplHelper1
+
+ @devstatus ready to use
+ @threadsafe no (used on once position only!)
+*//*-*************************************************************************************************************/
+class RequestFilterSelect_Impl;
+class FWE_DLLPUBLIC RequestFilterSelect
+{
+ RequestFilterSelect_Impl* pImp;
+
+ public:
+ RequestFilterSelect( const OUString& sURL );
+ ~RequestFilterSelect();
+ sal_Bool isAbort () const;
+ OUString getFilter() const;
+ com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > GetRequest();
+};
+
+/*-************************************************************************************************************//**
+ @short special request for interaction
+ @descr User must decide between a preselected and another detected filter.
+ It capsulate communication with any interaction handler and supports an easy
+ access on interaction results for user of these class.
+
+ @implements XInteractionRequest
+
+ @base WeakImplHelper1
+
+ @devstatus ready to use
+ @threadsafe no (used on once position only!)
+*//*-*************************************************************************************************************/
+class FWE_DLLPUBLIC InteractionRequest
+{
+public:
+ static com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest >
+ CreateRequest( const ::com::sun::star::uno::Any& aRequest,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > lContinuations );
+};
+
+
+} // namespace framework
+
+#endif // #define __FRAMEWORK_DISPATCH_INTERACTION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/menuconfiguration.hxx b/include/framework/menuconfiguration.hxx
new file mode 100644
index 000000000000..1ccd6ba0d167
--- /dev/null
+++ b/include/framework/menuconfiguration.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 __FRAMEWORK_XML_MENUCONFIGURATION_HXX_
+#define __FRAMEWORK_XML_MENUCONFIGURATION_HXX_
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/WrappedTargetException.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <framework/fwedllapi.h>
+
+#include <cppuhelper/weak.hxx>
+#include <vcl/menu.hxx>
+#include <vcl/toolbox.hxx>
+
+#define BOOKMARK_NEWMENU OUString( "private:menu_bookmark_new" )
+#define BOOKMARK_WIZARDMENU OUString( "private:menu_bookmark_wizard" )
+
+// Prepare for inclusion by framework and sfx
+// Please consider that there is a corresponding define also in sfxsids.hrc!! (SID_SFX_START)/(SID_ADDONS)
+#define FWK_SID_SFX_START 5000
+#define FWK_SID_ADDONS (FWK_SID_SFX_START+1678)
+#define FWK_SID_ADDONHELP (FWK_SID_SFX_START+1684)
+
+const sal_uInt16 START_ITEMID_PICKLIST = 4500;
+const sal_uInt16 END_ITEMID_PICKLIST = 4599;
+const sal_uInt16 MAX_ITEMCOUNT_PICKLIST = 99; // difference between START_... & END_... for picklist / must be changed too, if these values are changed!
+const sal_uInt16 START_ITEMID_WINDOWLIST = 4600;
+const sal_uInt16 END_ITEMID_WINDOWLIST = 4699;
+const sal_uInt16 ITEMID_ADDONLIST = FWK_SID_ADDONS;
+const sal_uInt16 ITEMID_ADDONHELP = FWK_SID_ADDONHELP;
+
+namespace framework
+{
+
+class FWE_DLLPUBLIC MenuConfiguration
+{
+ public:
+ struct Attributes
+ {
+ Attributes() {}
+ Attributes( const OUString& aFrame, const OUString& aImageIdStr ) :
+ aTargetFrame( aFrame ), aImageId( aImageIdStr ) {}
+
+ OUString aTargetFrame;
+ OUString aImageId;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XDispatchProvider > xDispatchProvider;
+ sal_Int16 nStyle;
+ };
+
+ MenuConfiguration(
+ // use const when giving a uno reference by reference
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+
+ virtual ~MenuConfiguration();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > CreateMenuBarConfigurationFromXML(
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream )
+ throw ( ::com::sun::star::lang::WrappedTargetException );
+
+ PopupMenu* CreateBookmarkMenu(
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ const OUString& aURL )
+ throw ( ::com::sun::star::lang::WrappedTargetException );
+
+ ToolBox* CreateToolBoxFromConfiguration(
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream )
+ throw ( ::com::sun::star::lang::WrappedTargetException );
+
+ void StoreMenuBarConfigurationToXML( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& rMenuBarConfiguration,
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOutputStream )
+ throw ( ::com::sun::star::lang::WrappedTargetException );
+
+ void StoreToolBox( ToolBox* pToolBox,
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOutputStream )
+ throw ( ::com::sun::star::lang::WrappedTargetException );
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xContext;
+};
+
+}
+
+#endif // __FRAMEWORK_XML_MENUCONFIGURATION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/menuextensionsupplier.hxx b/include/framework/menuextensionsupplier.hxx
new file mode 100644
index 000000000000..6d3a6761e38e
--- /dev/null
+++ b/include/framework/menuextensionsupplier.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 __FRAMEWORK_CLASSES_MENUEXTENSIONSUPPLIER_HXX_
+#define __FRAMEWORK_CLASSES_MENUEXTENSIONSUPPLIER_HXX_
+
+#include <rtl/ustring.hxx>
+#include <framework/fwedllapi.h>
+
+struct FWE_DLLPUBLIC MenuExtensionItem
+{
+ OUString aLabel;
+ OUString aURL;
+};
+
+typedef MenuExtensionItem ( *pfunc_setMenuExtensionSupplier)();
+
+namespace framework
+{
+
+FWE_DLLPUBLIC MenuExtensionItem SAL_CALL GetMenuExtension();
+
+}
+
+#endif // __FRAMEWORK_CLASSES_MENUEXTENSIONSUPPLIER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/preventduplicateinteraction.hxx b/include/framework/preventduplicateinteraction.hxx
new file mode 100644
index 000000000000..5be9d52f62cf
--- /dev/null
+++ b/include/framework/preventduplicateinteraction.hxx
@@ -0,0 +1,236 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __FRAMEWORK_INTERACTION_PREVENTDUPLICATEINTERACTION_HXX_
+#define __FRAMEWORK_INTERACTION_PREVENTDUPLICATEINTERACTION_HXX_
+
+#include <framework/fwedllapi.h>
+
+#include <vector>
+
+#include <com/sun/star/task/XInteractionHandler2.hpp>
+#include <com/sun/star/task/XInteractionRequest.hpp>
+
+#include <cppuhelper/implbase1.hxx>
+
+namespace framework{
+
+/**
+ @short Prevent us from showing the same interaction more then once during
+ the same transaction.
+
+ @descr Every interaction provided to this helper will be safed ... handled by the internal
+ used UUIInteractionHandler (!) and never be handled a second time!
+
+ On the other side there exists some interactions, which allow a retry.
+ So this helper allow to set a list of interactions combined with a retry value.
+ */
+struct ThreadHelpBase2
+{
+ public:
+ mutable ::osl::Mutex m_aLock;
+};
+
+class FWE_DLLPUBLIC PreventDuplicateInteraction : private ThreadHelpBase2
+ ,public ::cppu::WeakImplHelper1< css::task::XInteractionHandler2 >
+{
+ //_____________________________________
+ // structs, types etcp.
+ public:
+
+ struct InteractionInfo
+ {
+ public:
+ /// describe the interaction.
+ css::uno::Type m_aInteraction;
+ /// after max count was reached this interaction will be blocked.
+ sal_Int32 m_nMaxCount;
+ /// count how often this interaction was called.
+ sal_Int32 m_nCallCount;
+ /** hold the last intercepted request (matching the set interaction type) alive
+ so it can be used for further checks */
+ css::uno::Reference< css::task::XInteractionRequest > m_xRequest;
+
+ public:
+
+ InteractionInfo(const css::uno::Type& aInteraction,
+ sal_Int32 nMaxCount )
+ : m_aInteraction(aInteraction)
+ , m_nMaxCount (nMaxCount )
+ , m_nCallCount (0 )
+ {}
+
+ InteractionInfo(const InteractionInfo& aCopy)
+ : m_aInteraction(aCopy.m_aInteraction)
+ , m_nMaxCount (aCopy.m_nMaxCount )
+ , m_nCallCount (aCopy.m_nCallCount )
+ , m_xRequest (aCopy.m_xRequest )
+ {}
+ };
+
+ typedef ::std::vector< InteractionInfo > InteractionList;
+
+ //_____________________________________
+ // member
+ private:
+
+ /// Used to create needed uno services at runtime.
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+
+ /** The outside interaction handler, which is used to handle every incoming interaction,
+ if it's not blocked. */
+ css::uno::Reference< css::task::XInteractionHandler > m_xHandler;
+
+ /** This list describe which and how incoming interactions must be handled.
+ Further it contains all collected information after this interaction
+ object was used.*/
+ InteractionList m_lInteractionRules;
+
+ //_____________________________________
+ // uno interface
+ public:
+
+ //_________________________________
+ /**
+ @interface XInteractionHandler
+ @short called from outside to handle a problem
+ @descr We filter the incoming interactions. some of them
+ will be forwarded to the generic UI interaction handler.
+ So we must not implement it twice. Some other ones
+ will be aborted only.
+
+ @threadsafe yes
+ */
+ virtual void SAL_CALL handle(const css::uno::Reference< css::task::XInteractionRequest >& xRequest)
+ throw(css::uno::RuntimeException);
+
+ //_________________________________
+ /**
+ @interface XInteractionHandler2
+ @short called from outside to handle a problem
+ @descr We filter the incoming interactions. some of them
+ will be forwarded to the generic UI interaction handler.
+ So we must not implement it twice. Some other ones
+ will be aborted only.
+
+ @threadsafe yes
+ */
+ virtual ::sal_Bool SAL_CALL handleInteractionRequest( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xRequest )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //_________________________________
+ /**
+ @interface XInterface
+ @short called to query another interface of the component
+ @descr Will allow to query for XInteractionHandler2 if and only if m_xHandler supports this interface, too.
+
+ @threadsafe yes
+ */
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
+ throw (::com::sun::star::uno::RuntimeException);
+ //_____________________________________
+ // c++ interface
+ public:
+
+ //_________________________________
+ /**
+ @short ctor to guarantee right initialized instances of this class
+ @descr It uses the given uno service manager to create the global
+ generic UI interaction handler for later internal using.
+
+ @param xSMGR
+ uno service manager for creating services internaly
+
+ @threadsafe not neccessary
+ */
+ PreventDuplicateInteraction(const css::uno::Reference< css::uno::XComponentContext >& rxContext);
+
+ //_________________________________
+ /**
+ @short dtor to free used memory.
+ */
+ virtual ~PreventDuplicateInteraction();
+
+ //_________________________________
+ /**
+ @short set the outside interaction handler, which must be used internaly
+ if the interaction will not be blocked by the set list of rules.
+
+ @note This overwrites the settings of e.g. useDefaultUUIHandler()!
+
+ @param xHandler
+ the new interaction handler
+ */
+ virtual void setHandler(const css::uno::Reference< css::task::XInteractionHandler >& xHandler);
+
+ //_________________________________
+ /**
+ @short instead of setting an outside interaction handler, this method
+ make sure the default UUI interaction handler of the office is used.
+
+ @note This overwrites the settings of e.g. setHandler()!
+ */
+ virtual void useDefaultUUIHandler();
+
+ //_________________________________
+ /**
+ @short add a new interaction to the list of interactions, which
+ must be handled by this helper.
+
+ @descr This method must be called immediately after a new instance of this helper was
+ created. Without such list of InteractionRules, this instances does nothing!
+ On the other side there is no possibility to remove rules.
+ So the same instance cant be used within different transactions.
+ It's a OneWay-object .-)
+
+ @param aInteractionInfo
+ describe the type of interaction, hos often it can be called etcpp.
+
+ @threadsafe yes
+ */
+ virtual void addInteractionRule(const PreventDuplicateInteraction::InteractionInfo& aInteractionInfo);
+
+ //_________________________________
+ /**
+ @short return the info struct for the specified interaction.
+
+ @param aInteraction
+ specify the interaction.
+
+ @param pReturn
+ provides information about:
+ - the count how often this interaction was handled during the
+ lifetime of this helper.
+ - the interaction itself, so it can be analyzed further
+
+ @return [boolean]
+ sal_True if the queried interaction could be found.
+ sal_False otherwise.
+
+ @threadsafe yes
+ */
+ virtual sal_Bool getInteractionInfo(const css::uno::Type& aInteraction,
+ PreventDuplicateInteraction::InteractionInfo* pReturn ) const;
+};
+
+} // namespace framework
+
+#endif // #ifndef __FRAMEWORK_INTERACTION_PREVENTDUPLICATEINTERACTION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/sfxhelperfunctions.hxx b/include/framework/sfxhelperfunctions.hxx
new file mode 100644
index 000000000000..ce2b604f5e5e
--- /dev/null
+++ b/include/framework/sfxhelperfunctions.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 __FRAMEWORK_CLASSES_SFXHELPERFUNCTIONS_HXX_
+#define __FRAMEWORK_CLASSES_SFXHELPERFUNCTIONS_HXX_
+
+#include <framework/fwedllapi.h>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <rtl/ustring.hxx>
+#include <vcl/toolbox.hxx>
+#include <vcl/status.hxx>
+#include <svtools/toolboxcontroller.hxx>
+#include <svtools/statusbarcontroller.hxx>
+
+typedef svt::ToolboxController* ( *pfunc_setToolBoxControllerCreator)(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ ToolBox* pToolbox,
+ unsigned short nID,
+ const OUString& aCommandURL );
+
+typedef svt::StatusbarController* ( *pfunc_setStatusBarControllerCreator)(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ StatusBar* pStatusBar,
+ unsigned short nID,
+ const OUString& aCommandURL );
+
+typedef void ( *pfunc_getRefreshToolbars)(
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
+
+typedef void ( *pfunc_createDockingWindow)(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ const OUString& rResourceURL );
+
+typedef bool ( *pfunc_isDockingWindowVisible)(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ const OUString& rResourceURL );
+
+typedef void ( *pfunc_activateToolPanel)(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame,
+ const OUString& i_rPanelURL );
+
+
+namespace framework
+{
+FWE_DLLPUBLIC pfunc_setToolBoxControllerCreator SAL_CALL SetToolBoxControllerCreator( pfunc_setToolBoxControllerCreator pSetToolBoxControllerCreator );
+FWE_DLLPUBLIC svt::ToolboxController* SAL_CALL CreateToolBoxController(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ ToolBox* pToolbox,
+ unsigned short nID,
+ const OUString& aCommandURL );
+
+FWE_DLLPUBLIC pfunc_setStatusBarControllerCreator SAL_CALL SetStatusBarControllerCreator( pfunc_setStatusBarControllerCreator pSetStatusBarControllerCreator );
+FWE_DLLPUBLIC svt::StatusbarController* SAL_CALL CreateStatusBarController(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ StatusBar* pStatusBar,
+ unsigned short nID,
+ const OUString& aCommandURL );
+
+FWE_DLLPUBLIC pfunc_getRefreshToolbars SAL_CALL SetRefreshToolbars( pfunc_getRefreshToolbars pRefreshToolbarsFunc );
+FWE_DLLPUBLIC void SAL_CALL RefreshToolbars(
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
+
+FWE_DLLPUBLIC pfunc_createDockingWindow SAL_CALL SetDockingWindowCreator( pfunc_createDockingWindow pCreateDockingWindow );
+FWE_DLLPUBLIC void SAL_CALL CreateDockingWindow(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ const OUString& rResourceURL );
+
+FWE_DLLPUBLIC pfunc_isDockingWindowVisible SAL_CALL SetIsDockingWindowVisible( pfunc_isDockingWindowVisible pIsDockingWindowVisible );
+FWE_DLLPUBLIC bool SAL_CALL IsDockingWindowVisible(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ const OUString& rResourceURL );
+
+FWE_DLLPUBLIC pfunc_activateToolPanel SAL_CALL SetActivateToolPanel( pfunc_activateToolPanel i_pActivator );
+FWE_DLLPUBLIC void SAL_CALL ActivateToolPanel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame,
+ const OUString& i_rPanelURL );
+}
+
+#endif // __FRAMEWORK_CLASSES_SFXHELPERFUNCTIONS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/statusbarconfiguration.hxx b/include/framework/statusbarconfiguration.hxx
new file mode 100644
index 000000000000..e71a89fe0ca4
--- /dev/null
+++ b/include/framework/statusbarconfiguration.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 __FRAMEWORK_CLASSES_STATUSBARCONFIGURATION_HXX_
+#define __FRAMEWORK_CLASSES_STATUSBARCONFIGURATION_HXX_
+
+#include <framework/fwedllapi.h>
+#include <tools/stream.hxx>
+#include <vcl/status.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+namespace framework
+{
+
+class FWE_DLLPUBLIC StatusBarConfiguration
+{
+ public:
+ static sal_Bool LoadStatusBar(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInputStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rStatusbarConfiguration );
+
+ static sal_Bool StoreStatusBar(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& rStatusbarConfiguration );
+};
+
+} // namespace framework
+
+#endif // __FRAMEWORK_CLASSES_STATUSBARCONFIGURATION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/titlehelper.hxx b/include/framework/titlehelper.hxx
new file mode 100644
index 000000000000..c4cdc31a6329
--- /dev/null
+++ b/include/framework/titlehelper.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 _FRAMEWORK_TITLEHELPER_HXX_
+#define _FRAMEWORK_TITLEHELPER_HXX_
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/frame/XUntitledNumbers.hpp>
+#include <com/sun/star/frame/XTitle.hpp>
+#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XFrameActionListener.hpp>
+#include <com/sun/star/document/XEventListener.hpp>
+
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <cppuhelper/implbase5.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+
+#include <rtl/ustrbuf.hxx>
+
+#include <boost/unordered_map.hpp>
+#include <framework/fwedllapi.h>
+
+
+namespace framework{
+
+
+/** @short can be used as implementation helper of interface css.frame.XTitle
+
+ @threadsafe
+ */
+class FWE_DLLPUBLIC TitleHelper : private ::cppu::BaseMutex
+ , public ::cppu::WeakImplHelper5< css::frame::XTitle ,
+ css::frame::XTitleChangeBroadcaster,
+ css::frame::XTitleChangeListener ,
+ css::frame::XFrameActionListener ,
+ css::document::XEventListener >
+{
+ //-------------------------------------------
+ // interface
+ public:
+
+ //---------------------------------------
+ /** @short lightweight constructor.
+ */
+ TitleHelper(const css::uno::Reference< css::uno::XComponentContext >& rxContext);
+
+ //---------------------------------------
+ /** @short free all internaly used resources.
+ */
+ virtual ~TitleHelper();
+
+ //---------------------------------------
+ /** set an outside component which uses this container and must be set
+ as source of all broadcasted messages, exceptions.
+
+ It's holded weak only so we do not need any complex dispose sessions.
+
+ Note: Passing NULL as parameter will be alloed. It will reset the internal
+ member reference only.
+
+ @param xOwner
+ the new owner of this collection.
+ */
+ void setOwner (const css::uno::Reference< css::uno::XInterface >& xOwner);
+
+ //---------------------------------------
+ /** set an outside component which provides the righht string and number for
+ an untitled component.
+
+ It's holded weak only so we do not need any complex dispose sessions.
+
+ Note: Passing NULL as parameter will be alloed. It will reset the internal
+ member reference only.
+
+ @param xNumbers
+ the right numbered collection for this helper.
+ */
+ void connectWithUntitledNumbers (const css::uno::Reference< css::frame::XUntitledNumbers >& xNumbers);
+
+ //---------------------------------------
+ /** @see XTitle */
+ virtual OUString SAL_CALL getTitle()
+ throw (css::uno::RuntimeException);
+
+ //---------------------------------------
+ /** @see XTitle */
+ virtual void SAL_CALL setTitle(const OUString& sTitle)
+ throw (css::uno::RuntimeException);
+
+ //---------------------------------------
+ /** @see XTitleChangeBroadcaster */
+ virtual void SAL_CALL addTitleChangeListener(const css::uno::Reference< css::frame::XTitleChangeListener >& xListener)
+ throw (css::uno::RuntimeException);
+
+ //---------------------------------------
+ /** @see XTitleChangeBroadcaster */
+ virtual void SAL_CALL removeTitleChangeListener(const css::uno::Reference< css::frame::XTitleChangeListener >& xListener)
+ throw (css::uno::RuntimeException);
+
+ //---------------------------------------
+ /** @see XTitleChangeListener */
+ virtual void SAL_CALL titleChanged(const css::frame::TitleChangedEvent& aEvent)
+ throw (css::uno::RuntimeException);
+
+ //---------------------------------------
+ /** @see css.document.XEventListener */
+ virtual void SAL_CALL notifyEvent(const css::document::EventObject& aEvent)
+ throw (css::uno::RuntimeException);
+
+ //---------------------------------------
+ /** @see css.lang.XEventListener */
+ virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent)
+ throw (css::uno::RuntimeException);
+
+ //---------------------------------------
+ /** @see css.frame.XFrameActionListener */
+ virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent& aEvent)
+ throw(css::uno::RuntimeException);
+
+ //-------------------------------------------
+ // internal
+ private:
+
+ void impl_sendTitleChangedEvent ();
+
+ void impl_updateTitle (bool init = false);
+ void impl_updateTitleForModel (const css::uno::Reference< css::frame::XModel >& xModel, bool init);
+ void impl_updateTitleForController (const css::uno::Reference< css::frame::XController >& xController, bool init);
+ void impl_updateTitleForFrame (const css::uno::Reference< css::frame::XFrame >& xFrame, bool init);
+
+ void impl_startListeningForModel (const css::uno::Reference< css::frame::XModel >& xModel);
+ void impl_startListeningForController (const css::uno::Reference< css::frame::XController >& xController);
+ void impl_startListeningForFrame (const css::uno::Reference< css::frame::XFrame >& xFrame);
+ void impl_updateListeningForFrame (const css::uno::Reference< css::frame::XFrame >& xFrame);
+
+ void impl_appendComponentTitle ( OUStringBuffer& sTitle ,
+ const css::uno::Reference< css::uno::XInterface >& xComponent);
+ void impl_appendProductName (OUStringBuffer& sTitle);
+ void impl_appendProductExtension (OUStringBuffer& sTitle);
+ void impl_appendModuleName (OUStringBuffer& sTitle);
+ void impl_appendDebugVersion (OUStringBuffer& sTitle);
+
+ void impl_setSubTitle (const css::uno::Reference< css::frame::XTitle >& xSubTitle);
+
+ OUString impl_convertURL2Title(const OUString& sURL);
+
+ //-------------------------------------------
+ // member
+ private:
+
+ /** points to the global uno service manager. */
+ css::uno::Reference< css::uno::XComponentContext> m_xContext;
+
+ /** reference to the outside UNO class using this helper. */
+ css::uno::WeakReference< css::uno::XInterface > m_xOwner;
+
+ /** used to know how an "Untitled X" string can be created right :-) */
+ css::uno::WeakReference< css::frame::XUntitledNumbers > m_xUntitledNumbers;
+
+ /** provides parts of our own title and we listen there for changes too. */
+ css::uno::WeakReference< css::frame::XTitle > m_xSubTitle;
+
+ /** if it's set to sal_True the member m_sTitle has not to be changed internaly.
+ It was set from outside and so outside code has to make sure it will be
+ updated.
+ */
+ ::sal_Bool m_bExternalTitle;
+
+ /** the actual title value */
+ OUString m_sTitle;
+
+ /** knows the leased number which must be used for untitled components. */
+ ::sal_Int32 m_nLeasedNumber;
+
+ /** contains all title change listener */
+ ::cppu::OMultiTypeInterfaceContainerHelper m_aListener;
+};
+
+} // namespace framework
+
+#endif // _FRAMEWORK_TITLEHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/toolboxconfiguration.hxx b/include/framework/toolboxconfiguration.hxx
new file mode 100644
index 000000000000..a296231a07ea
--- /dev/null
+++ b/include/framework/toolboxconfiguration.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 __FRAMEWORK_XML_TOOLBOXCONFIGURATION_HXX_
+#define __FRAMEWORK_XML_TOOLBOXCONFIGURATION_HXX_
+
+#include <framework/fwedllapi.h>
+#include <vcl/bitmap.hxx>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+namespace framework
+{
+
+class FWE_DLLPUBLIC ToolBoxConfiguration
+{
+ public:
+ static sal_Bool LoadToolBox(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rToolbarConfiguration );
+
+ static sal_Bool StoreToolBox(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOutputStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& rToolbarConfiguration );
+};
+
+} // namespace framework
+
+#endif // __FRAMEWORK_XML_TOOLBOXCONFIGURATION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/undomanagerhelper.hxx b/include/framework/undomanagerhelper.hxx
new file mode 100644
index 000000000000..ae91db981553
--- /dev/null
+++ b/include/framework/undomanagerhelper.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 FRAMEWORK_UNDOMANAGERHELPER_HXX
+#define FRAMEWORK_UNDOMANAGERHELPER_HXX
+
+#include "framework/fwedllapi.h"
+#include "framework/iguard.hxx"
+#include "framework/imutex.hxx"
+
+#include <com/sun/star/document/XUndoManager.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+
+#include <boost/scoped_ptr.hpp>
+
+namespace svl
+{
+ class IUndoManager;
+}
+
+//......................................................................................................................
+namespace framework
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= IMutexGuard
+ //==================================================================================================================
+ class SAL_NO_VTABLE IMutexGuard : public IGuard
+ {
+ public:
+ /** returns the mutex guarded by the instance.
+
+ Even if the guard currently has not a lock on the mutex, this method must succeed.
+ */
+ virtual IMutex& getGuardedMutex() = 0;
+
+ protected:
+ ~IMutexGuard() {}
+ };
+
+ //==================================================================================================================
+ //= IUndoManagerImplementation
+ //==================================================================================================================
+ class SAL_NO_VTABLE IUndoManagerImplementation
+ {
+ public:
+ /** returns the IUndoManager interface to the actual Undo stack
+
+ @throws com::sun::star::lang::DisposedException
+ when the instance is already disposed, and no IUndoManager can be provided
+
+ @throws com::sun::star::lang::NotInitializedException
+ when the instance is not initialized, yet, and no IUndoManager can be provided
+ */
+ virtual ::svl::IUndoManager& getImplUndoManager() = 0;
+
+ /** provides access to an UNO interface for the XUndoManager implementation. Used when throwing exceptions.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager >
+ getThis() = 0;
+
+ protected:
+ ~IUndoManagerImplementation() {}
+ };
+
+ //==================================================================================================================
+ //= UndoManagerHelper
+ //==================================================================================================================
+ class UndoManagerHelper_Impl;
+ /** helper class for implementing an XUndoManager
+
+ Several of the methods of the class take an IMutexGuard instance. It is assumed that this guard has a lock on
+ its mutext at the moment the method is entered. The lock will be released before any notifications to the
+ registered XUndoManagerListeners happen.
+
+ The following locking strategy is used for this mutex:
+ <ul><li>Any notifications to the registered XUndoManagerListeners are after the guard has been cleared. i.e.
+ without the mutex being locked.</p>
+ <li>Any calls into the <code>IUndoManager</code> implementation is made without the mutex being locked.
+ Note that this implies that the <code>IUndoManager</code> implementation must be thread-safe in itself
+ (which is true for the default implementation, SfxUndoManager).</li>
+ <li>An exception to the previous item are the <member>IUndoManager::Undo</member> and
+ <member>IUndoManager::Redo</member> methods: They're called with the given external mutex being
+ locked.</li>
+ </ul>
+
+ The reason for the exception for IUndoManager::Undo and IUndoManager::Redo is that those are expected to
+ modify the actual document which the UndoManager works for. And as long as our documents are not thread-safe,
+ and as long as we do not re-fit <strong>all</strong> existing SfxUndoImplementations to <em>not</em> expect
+ the dreaded SolarMutex being locked when they're called, the above behavior is a compromise between "how it should
+ be" and "how it can realistically be".
+ */
+ class FWE_DLLPUBLIC UndoManagerHelper
+ {
+ public:
+ UndoManagerHelper( IUndoManagerImplementation& i_undoManagerImpl );
+ ~UndoManagerHelper();
+
+ // life time control
+ void disposing();
+
+ // XUndoManager equivalents
+ void enterUndoContext( const OUString& i_title, IMutexGuard& i_instanceLock );
+ void enterHiddenUndoContext( IMutexGuard& i_instanceLock );
+ void leaveUndoContext( IMutexGuard& i_instanceLock );
+ void addUndoAction( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoAction >& i_action, IMutexGuard& i_instanceLock );
+ void undo( IMutexGuard& i_instanceLock );
+ void redo( IMutexGuard& i_instanceLock );
+ ::sal_Bool isUndoPossible() const;
+ ::sal_Bool isRedoPossible() const;
+ OUString getCurrentUndoActionTitle() const;
+ OUString getCurrentRedoActionTitle() const;
+ ::com::sun::star::uno::Sequence< OUString >
+ getAllUndoActionTitles() const;
+ ::com::sun::star::uno::Sequence< OUString >
+ getAllRedoActionTitles() const;
+ void clear( IMutexGuard& i_instanceLock );
+ void clearRedo( IMutexGuard& i_instanceLock );
+ void reset( IMutexGuard& i_instanceLock );
+ void addUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener );
+ void removeUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener );
+
+ // XLockable, base of XUndoManager, equivalents
+ void lock();
+ void unlock();
+ ::sal_Bool isLocked();
+
+ // XModifyBroadcaster equivalents
+ void addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& i_listener );
+ void removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& i_listener );
+
+ private:
+ ::boost::scoped_ptr< UndoManagerHelper_Impl > m_pImpl;
+ };
+
+//......................................................................................................................
+} // namespace framework
+//......................................................................................................................
+
+#endif // FRAMEWORK_UNDOMANAGERHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nlangtag/i18nlangtagdllapi.h b/include/i18nlangtag/i18nlangtagdllapi.h
new file mode 100644
index 000000000000..ba9af35c08fe
--- /dev/null
+++ b/include/i18nlangtag/i18nlangtagdllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_I18NLANGTAG_I18NLANGTAGDLLAPI_H
+#define INCLUDED_I18NLANGTAG_I18NLANGTAGDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(I18NLANGTAG_DLLIMPLEMENTATION)
+#define I18NLANGTAG_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define I18NLANGTAG_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define I18NLANGTAG_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_I18NLANGTAG_I18NLANGTAGDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h
new file mode 100644
index 000000000000..d4f5ca7a61b3
--- /dev/null
+++ b/include/i18nlangtag/lang.h
@@ -0,0 +1,568 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_I18NLANGTAG_LANG_H
+#define INCLUDED_I18NLANGTAG_LANG_H
+
+/**
+ These are MS LANGIDs, the lower 10 bits (mask 0x03ff, values below 0x0400
+ aren't real locale IDs) represent the primary language ID, the upper 6 bits
+ represent the sublanguage ID, which in most cases together with the primary
+ language simply designates a country. A LANGID is constructed by
+ UINT16 nLangID = ((((UINT16)(SubLangId)) << 10) | (UINT16)(PriLangId));
+
+ A user-defined primary language ID is a value in the range 0x0200 to 0x03ff.
+ All other values are reserved for Windows system use.
+
+ A user-defined sublanguage identifier is a value in the range 0x20 to 0x3f.
+ All other values are reserved for Windows system use.
+ If there is no sublanguage ID for a primary language ID, use SUBLANG_DEFAULT
+ (0x01, which shifted to the left by 10 bits results in the frequently seen
+ 0x0400). OR'ed with a 0x0200 primary results in 0x0600.
+
+ Values added as of 2006-04-18, a helper script: ../../source/isolang/lcid.awk
+ Utility to compare MS-LANGID definitions with those defined in this file.
+
+ For further information about MS-LANGIDs please see include/winnt.h of a
+ recent MSDEV version and the following web pages.
+
+
+ The once complete list, not necessarily supported by Windows:
+ List of Locale ID (LCID) Values as Assigned by Microsoft
+ http://www.microsoft.com/globaldev/reference/lcid-all.mspx
+
+ As a complete list is never complete, some more that came with WinXP SP2:
+ Windows XP/Server 2003 - List of Locale IDs, Input Locale, and Language Collection
+ http://www.microsoft.com/globaldev/reference/winxp/xp-lcid.mspx
+
+ And of course 2 lists aren't enough, so Windows Vista needs an extra one.
+ Which at least seems to include values of other versions of Windows.
+ Language Identifier Constants and Strings
+ http://msdn2.microsoft.com/en-us/library/ms776294.aspx
+
+ Hey, yet another list, maybe this one will not move around? It seems to be
+ quite complete..
+ Language Identifier Constants and Strings (Windows)
+ http://msdn.microsoft.com/en-us/library/dd318693(VS.85).aspx
+
+ List of supported locale identifiers in Word
+ http://support.microsoft.com/default.aspx?scid=KB;en-us;q221435
+ */
+
+
+/* It must be safe to include this file in plain C code, so only C style
+ * comments are used. Do NOT use // C++ style comments. */
+
+/* disable typedef for usage in svtools/source/misc/langtab.src */
+#ifndef RSC_RESOURCE_USAGE
+typedef unsigned short LanguageType;
+#endif
+
+#define LANGUAGE_MASK_PRIMARY 0x03ff
+
+#ifdef __cplusplus
+/* Please use the methods provided in mslangid.hxx for type-safety! */
+#else
+#define MSLANGID_MAKELANGID( nSubLangId, nPriLangId ) \
+ (((nSubLangId) << 10) | (nPriLangId))
+#define MSLANGID_GETPRIMARYLANGUAGE( nLangID ) \
+ ((nLangID) & LANGUAGE_MASK_PRIMARY)
+#define MSLANGID_GETSUBLANGUAGE( nLangID ) \
+ (((nLangID) & ~LANGUAGE_MASK_PRIMARY) >> 10)
+#endif
+
+
+#define LANGUAGE_DONTKNOW 0x03FF /* yes, the mask */
+#define LANGUAGE_NONE 0x00FF
+#define LANGUAGE_HID_HUMAN_INTERFACE_DEVICE 0x04FF
+#define LANGUAGE_SYSTEM 0x0000 /* OOo/SO definition */
+
+/* The Invariant Locale (Locale ID = 0x007f) is a locale that can be used by
+ * applications when a consistent and locale-independent result is required.
+ * The invariant locale can be used, for example, when comparing character
+ * strings using the CompareString() API and a consistent result regardless of
+ * the User Locale is expected.
+ * The settings of the Invariant Locale are similar to US-English international
+ * standards, but should not be used to display formatted data. */
+/* NOTE: this is taken from the MS documentation! Not supported by OOo/SO! */
+#define LANGUAGE_INVARIANT 0x007F
+
+#define LANGUAGE_AFRIKAANS 0x0436
+#define LANGUAGE_ALBANIAN 0x041C
+#define LANGUAGE_ALSATIAN_FRANCE 0x0484
+#define LANGUAGE_AMHARIC_ETHIOPIA 0x045E
+#define LANGUAGE_ARABIC_ALGERIA 0x1401
+#define LANGUAGE_ARABIC_BAHRAIN 0x3C01
+#define LANGUAGE_ARABIC_EGYPT 0x0C01
+#define LANGUAGE_ARABIC_IRAQ 0x0801
+#define LANGUAGE_ARABIC_JORDAN 0x2C01
+#define LANGUAGE_ARABIC_KUWAIT 0x3401
+#define LANGUAGE_ARABIC_LEBANON 0x3001
+#define LANGUAGE_ARABIC_LIBYA 0x1001
+#define LANGUAGE_ARABIC_MOROCCO 0x1801
+#define LANGUAGE_ARABIC_OMAN 0x2001
+#define LANGUAGE_ARABIC_QATAR 0x4001
+#define LANGUAGE_ARABIC_SAUDI_ARABIA 0x0401
+#define LANGUAGE_ARABIC_SYRIA 0x2801
+#define LANGUAGE_ARABIC_TUNISIA 0x1C01
+#define LANGUAGE_ARABIC_UAE 0x3801
+#define LANGUAGE_ARABIC_YEMEN 0x2401
+#define LANGUAGE_ARABIC_PRIMARY_ONLY 0x0001 /* primary only, not a locale! */
+#define LANGUAGE_ARMENIAN 0x042B
+#define LANGUAGE_ASSAMESE 0x044D
+#define LANGUAGE_AZERI 0x002C /* primary only, not a locale! */
+#define LANGUAGE_AZERI_CYRILLIC 0x082C
+#define LANGUAGE_AZERI_LATIN 0x042C
+#define LANGUAGE_BASHKIR_RUSSIA 0x046D
+#define LANGUAGE_BASQUE 0x042D
+#define LANGUAGE_BELARUSIAN 0x0423
+#define LANGUAGE_BENGALI 0x0445 /* in India */
+#define LANGUAGE_BENGALI_BANGLADESH 0x0845
+#define LANGUAGE_BOSNIAN_LATIN_BOSNIA_HERZEGOVINA 0x141A
+#define LANGUAGE_BOSNIAN_CYRILLIC_BOSNIA_HERZEGOVINA 0x201A
+#define LANGUAGE_BOSNIAN_BOSNIA_HERZEGOVINA LANGUAGE_BOSNIAN_LATIN_BOSNIA_HERZEGOVINA /* TODO: remove, only for langtab.src & localize.sdf compatibility */
+#define LANGUAGE_BRETON_FRANCE 0x047E /* obsoletes LANGUAGE_USER_BRETON 0x0629 */
+#define LANGUAGE_BULGARIAN 0x0402
+#define LANGUAGE_BURMESE 0x0455
+#define LANGUAGE_CATALAN 0x0403
+#define LANGUAGE_CHEROKEE_UNITED_STATES 0x045C
+#define LANGUAGE_CHINESE 0x0004 /* primary only, not a locale! */
+#define LANGUAGE_CHINESE_HONGKONG 0x0C04
+#define LANGUAGE_CHINESE_MACAU 0x1404
+#define LANGUAGE_CHINESE_SIMPLIFIED 0x0804
+#define LANGUAGE_CHINESE_SINGAPORE 0x1004
+#define LANGUAGE_CHINESE_TRADITIONAL 0x0404
+/* #define LANGUAGE_CHINESE_SIMPLIFIED 0x0004 */ /* artificial political? Defined as 'zh-CHS' by MS. Primary only! */
+/* #define LANGUAGE_CHINESE_TRADITIONAL 0x7C04 */ /* artificial political? Defined as 'zh-CHT' by MS. */
+#define LANGUAGE_CORSICAN_FRANCE 0x0483
+#define LANGUAGE_CROATIAN 0x041A
+#define LANGUAGE_CROATIAN_BOSNIA_HERZEGOVINA 0x101A
+#define LANGUAGE_CZECH 0x0405
+#define LANGUAGE_DANISH 0x0406
+#define LANGUAGE_DARI_AFGHANISTAN 0x048C /* AKA Zoroastrian Dari */
+#define LANGUAGE_DHIVEHI 0x0465 /* AKA Divehi */
+#define LANGUAGE_DUTCH 0x0413
+#define LANGUAGE_DUTCH_BELGIAN 0x0813
+#define LANGUAGE_EDO 0x0466
+#define LANGUAGE_ENGLISH 0x0009 /* primary only, not a locale! */
+#define LANGUAGE_ENGLISH_AUS 0x0C09
+#define LANGUAGE_ENGLISH_BELIZE 0x2809
+#define LANGUAGE_ENGLISH_CAN 0x1009
+#define LANGUAGE_ENGLISH_CARRIBEAN 0x2409
+#define LANGUAGE_ENGLISH_EIRE 0x1809
+#define LANGUAGE_ENGLISH_HONG_KONG_SAR 0x3C09
+#define LANGUAGE_ENGLISH_INDIA 0x4009
+#define LANGUAGE_ENGLISH_INDONESIA 0x3809
+#define LANGUAGE_ENGLISH_JAMAICA 0x2009
+#define LANGUAGE_ENGLISH_MALAYSIA 0x4409
+#define LANGUAGE_ENGLISH_NZ 0x1409
+#define LANGUAGE_ENGLISH_PHILIPPINES 0x3409
+#define LANGUAGE_ENGLISH_SAFRICA 0x1C09
+#define LANGUAGE_ENGLISH_SINGAPORE 0x4809
+#define LANGUAGE_ENGLISH_TRINIDAD 0x2C09
+#define LANGUAGE_ENGLISH_UK 0x0809
+#define LANGUAGE_ENGLISH_US 0x0409
+#define LANGUAGE_ENGLISH_ZIMBABWE 0x3009
+#define LANGUAGE_ESTONIAN 0x0425
+#define LANGUAGE_FAEROESE 0x0438
+#define LANGUAGE_FARSI 0x0429
+#define LANGUAGE_FILIPINO 0x0464
+#define LANGUAGE_FINNISH 0x040B
+#define LANGUAGE_FRENCH 0x040C
+#define LANGUAGE_FRENCH_BELGIAN 0x080C
+#define LANGUAGE_FRENCH_CAMEROON 0x2C0C
+#define LANGUAGE_FRENCH_CANADIAN 0x0C0C
+#define LANGUAGE_FRENCH_COTE_D_IVOIRE 0x300C
+
+#define LANGUAGE_FRENCH_HAITI 0x3C0C
+#define LANGUAGE_FRENCH_LUXEMBOURG 0x140C
+#define LANGUAGE_FRENCH_MALI 0x340C
+#define LANGUAGE_FRENCH_MONACO 0x180C
+#define LANGUAGE_FRENCH_MOROCCO 0x380C
+#define LANGUAGE_FRENCH_NORTH_AFRICA 0xE40C
+#define LANGUAGE_FRENCH_REUNION 0x200C
+#define LANGUAGE_FRENCH_SENEGAL 0x280C
+#define LANGUAGE_FRENCH_SWISS 0x100C
+#define LANGUAGE_FRENCH_WEST_INDIES 0x1C0C
+#define LANGUAGE_FRENCH_ZAIRE 0x240C
+#define LANGUAGE_FRISIAN_NETHERLANDS 0x0462
+#define LANGUAGE_FULFULDE_NIGERIA 0x0467
+#define LANGUAGE_GAELIC_IRELAND 0x083C
+#define LANGUAGE_GAELIC_SCOTLAND 0x043C
+#define LANGUAGE_GALICIAN 0x0456
+#define LANGUAGE_GEORGIAN 0x0437
+#define LANGUAGE_GERMAN 0x0407
+#define LANGUAGE_GERMAN_AUSTRIAN 0x0C07
+#define LANGUAGE_GERMAN_LIECHTENSTEIN 0x1407
+#define LANGUAGE_GERMAN_LUXEMBOURG 0x1007
+#define LANGUAGE_GERMAN_SWISS 0x0807
+#define LANGUAGE_GREEK 0x0408
+#define LANGUAGE_GUARANI_PARAGUAY 0x0474
+#define LANGUAGE_GUJARATI 0x0447
+#define LANGUAGE_HAUSA_NIGERIA 0x0468
+#define LANGUAGE_HAWAIIAN_UNITED_STATES 0x0475
+#define LANGUAGE_HEBREW 0x040D
+#define LANGUAGE_HINDI 0x0439
+#define LANGUAGE_HUNGARIAN 0x040E
+#define LANGUAGE_IBIBIO_NIGERIA 0x0469
+#define LANGUAGE_ICELANDIC 0x040F
+#define LANGUAGE_IGBO_NIGERIA 0x0470
+#define LANGUAGE_INDONESIAN 0x0421
+#define LANGUAGE_INUKTITUT_SYLLABICS_CANADA 0x045D
+#define LANGUAGE_INUKTITUT_LATIN_CANADA 0x085D
+#define LANGUAGE_ITALIAN 0x0410
+#define LANGUAGE_ITALIAN_SWISS 0x0810
+#define LANGUAGE_JAPANESE 0x0411
+#define LANGUAGE_KALAALLISUT_GREENLAND 0x046F /* obsoletes LANGUAGE_USER_KALAALLISUT 0x062A */
+#define LANGUAGE_KANNADA 0x044B
+#define LANGUAGE_KANURI_NIGERIA 0x0471
+#define LANGUAGE_KASHMIRI 0x0460
+#define LANGUAGE_KASHMIRI_INDIA 0x0860
+#define LANGUAGE_KAZAKH 0x043F
+#define LANGUAGE_KHMER 0x0453
+#define LANGUAGE_KICHE_GUATEMALA 0x0486 /* AKA K'iche', West Central Quiche, */
+#define LANGUAGE_KINYARWANDA_RWANDA 0x0487 /* obsoletes LANGUAGE_USER_KINYARWANDA 0x0621 */
+#define LANGUAGE_KIRGHIZ 0x0440 /* AKA Kyrgyz */
+#define LANGUAGE_KONKANI 0x0457
+#define LANGUAGE_KOREAN 0x0412
+#define LANGUAGE_KOREAN_JOHAB 0x0812
+#define LANGUAGE_LAO 0x0454
+#define LANGUAGE_LATIN 0x0476 /* obsoletes LANGUAGE_USER_LATIN 0x0610 */
+#define LANGUAGE_LATVIAN 0x0426
+#define LANGUAGE_LITHUANIAN 0x0427
+#define LANGUAGE_LITHUANIAN_CLASSIC 0x0827
+#define LANGUAGE_LUXEMBOURGISH_LUXEMBOURG 0x046E /* obsoletes LANGUAGE_USER_LUXEMBOURGISH 0x0630 */
+#define LANGUAGE_MACEDONIAN 0x042F
+#define LANGUAGE_MALAY 0x003E /* primary only, not a locale! */
+#define LANGUAGE_MALAYALAM 0x044C /* in India */
+#define LANGUAGE_MALAY_BRUNEI_DARUSSALAM 0x083E
+#define LANGUAGE_MALAY_MALAYSIA 0x043E
+#define LANGUAGE_MALTESE 0x043A
+#define LANGUAGE_MANIPURI 0x0458
+#define LANGUAGE_MAORI_NEW_ZEALAND 0x0481 /* obsoletes LANGUAGE_USER_MAORI 0x0620 */
+#define LANGUAGE_MAPUDUNGUN_CHILE 0x047A /* AKA Araucanian */
+#define LANGUAGE_MARATHI 0x044E
+#define LANGUAGE_MOHAWK_CANADA 0x047C
+#define LANGUAGE_MONGOLIAN 0x0450 /* Cyrillic script */
+#define LANGUAGE_MONGOLIAN_MONGOLIAN 0x0850
+#define LANGUAGE_NEPALI 0x0461
+#define LANGUAGE_NEPALI_INDIA 0x0861
+#define LANGUAGE_NORWEGIAN 0x0014 /* primary only, not a locale! */
+#define LANGUAGE_NORWEGIAN_BOKMAL 0x0414
+#define LANGUAGE_NORWEGIAN_NYNORSK 0x0814
+#define LANGUAGE_OCCITAN_FRANCE 0x0482 /* obsoletes LANGUAGE_USER_OCCITAN 0x0625 */
+#define LANGUAGE_ORIYA 0x0448
+#define LANGUAGE_OROMO 0x0472
+#define LANGUAGE_PAPIAMENTU 0x0479
+#define LANGUAGE_PASHTO 0x0463
+#define LANGUAGE_POLISH 0x0415
+#define LANGUAGE_PORTUGUESE 0x0816
+#define LANGUAGE_PORTUGUESE_BRAZILIAN 0x0416
+#define LANGUAGE_PUNJABI 0x0446
+#define LANGUAGE_PUNJABI_PAKISTAN 0x0846
+#define LANGUAGE_QUECHUA_BOLIVIA 0x046B
+#define LANGUAGE_QUECHUA_ECUADOR 0x086B
+#define LANGUAGE_QUECHUA_PERU 0x0C6B
+#define LANGUAGE_RHAETO_ROMAN 0x0417
+#define LANGUAGE_ROMANIAN 0x0418
+#define LANGUAGE_ROMANIAN_MOLDOVA 0x0818
+#define LANGUAGE_RUSSIAN 0x0419
+#define LANGUAGE_RUSSIAN_MOLDOVA 0x0819
+#define LANGUAGE_SAMI_NORTHERN_NORWAY 0x043B
+#define LANGUAGE_SAMI_LAPPISH LANGUAGE_SAMI_NORTHERN_NORWAY /* the old MS definition */
+#define LANGUAGE_SAMI_INARI 0x243B
+#define LANGUAGE_SAMI_LULE_NORWAY 0x103B
+#define LANGUAGE_SAMI_LULE_SWEDEN 0x143B
+#define LANGUAGE_SAMI_NORTHERN_FINLAND 0x0C3B
+#define LANGUAGE_SAMI_NORTHERN_SWEDEN 0x083B
+#define LANGUAGE_SAMI_SKOLT 0x203B
+#define LANGUAGE_SAMI_SOUTHERN_NORWAY 0x183B
+#define LANGUAGE_SAMI_SOUTHERN_SWEDEN 0x1C3B
+#define LANGUAGE_SANSKRIT 0x044F
+#define LANGUAGE_SEPEDI 0x046C
+#define LANGUAGE_NORTHERNSOTHO LANGUAGE_SEPEDI /* just an alias for the already existing localization */
+#define LANGUAGE_SERBIAN 0x001A /* primary only, not a locale! */
+#define LANGUAGE_SERBIAN_CYRILLIC 0x0C1A /* MS lists this as Serbian (Cyrillic, Serbia) 'sr-Cyrl-SP', but they use 'SP' since at least Windows2003 where it was Serbia and Montenegro! */
+#define LANGUAGE_SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA 0x1C1A
+#define LANGUAGE_SERBIAN_LATIN 0x081A /* MS lists this as Serbian (Latin, Serbia) 'sr-Latn-SP', but they use 'SP' since at least Windows2003 where it was Serbia and Montenegro! */
+#define LANGUAGE_SERBIAN_LATIN_BOSNIA_HERZEGOVINA 0x181A
+#define LANGUAGE_SERBIAN_LATIN_NEUTRAL 0x7C1A /* MS lists this as 'sr' only. What a mess. */
+#define LANGUAGE_SESOTHO 0x0430 /* also called Sutu now by MS */
+#define LANGUAGE_SINDHI 0x0459
+#define LANGUAGE_SINDHI_PAKISTAN 0x0859
+#define LANGUAGE_SINHALESE_SRI_LANKA 0x045B
+#define LANGUAGE_SLOVAK 0x041B
+#define LANGUAGE_SLOVENIAN 0x0424
+#define LANGUAGE_SOMALI 0x0477
+#define LANGUAGE_UPPER_SORBIAN_GERMANY 0x042E /* obsoletes LANGUAGE_USER_UPPER_SORBIAN 0x0623 */
+#define LANGUAGE_LOWER_SORBIAN_GERMANY 0x082E /* obsoletes LANGUAGE_USER_LOWER_SORBIAN 0x0624. NOTE: the primary ID is identical to Upper Sorbian, which is not quite correct because they're distinct languages */
+#define LANGUAGE_SORBIAN LANGUAGE_USER_UPPER_SORBIAN /* a strange MS definition */
+#define LANGUAGE_SPANISH_DATED 0x040A /* old collation, not supported, see #i94435# */
+#define LANGUAGE_SPANISH_ARGENTINA 0x2C0A
+#define LANGUAGE_SPANISH_BOLIVIA 0x400A
+#define LANGUAGE_SPANISH_CHILE 0x340A
+#define LANGUAGE_SPANISH_COLOMBIA 0x240A
+#define LANGUAGE_SPANISH_COSTARICA 0x140A
+#define LANGUAGE_SPANISH_DOMINICAN_REPUBLIC 0x1C0A
+#define LANGUAGE_SPANISH_ECUADOR 0x300A
+#define LANGUAGE_SPANISH_EL_SALVADOR 0x440A
+#define LANGUAGE_SPANISH_GUATEMALA 0x100A
+#define LANGUAGE_SPANISH_HONDURAS 0x480A
+#define LANGUAGE_SPANISH_LATIN_AMERICA 0xE40A /* no locale possible */
+#define LANGUAGE_SPANISH_MEXICAN 0x080A
+#define LANGUAGE_SPANISH_MODERN 0x0C0A
+#define LANGUAGE_SPANISH_NICARAGUA 0x4C0A
+#define LANGUAGE_SPANISH_PANAMA 0x180A
+#define LANGUAGE_SPANISH_PARAGUAY 0x3C0A
+#define LANGUAGE_SPANISH_PERU 0x280A
+#define LANGUAGE_SPANISH_PUERTO_RICO 0x500A
+#define LANGUAGE_SPANISH_UNITED_STATES 0x540A
+#define LANGUAGE_SPANISH_URUGUAY 0x380A
+#define LANGUAGE_SPANISH_VENEZUELA 0x200A
+#define LANGUAGE_SPANISH LANGUAGE_SPANISH_MODERN /* modern collation, see #i94435# */
+#define LANGUAGE_SWAHILI 0x0441 /* Kenya */
+#define LANGUAGE_SWEDISH 0x041D
+#define LANGUAGE_SWEDISH_FINLAND 0x081D
+#define LANGUAGE_SYRIAC 0x045A
+#define LANGUAGE_TAJIK 0x0428
+#define LANGUAGE_TAMAZIGHT_ARABIC 0x045F
+#define LANGUAGE_TAMAZIGHT_LATIN 0x085F
+#define LANGUAGE_TAMAZIGHT_TIFINAGH 0x0C5F
+#define LANGUAGE_TAMIL 0x0449
+#define LANGUAGE_TATAR 0x0444
+#define LANGUAGE_TELUGU 0x044A
+#define LANGUAGE_THAI 0x041E
+#define LANGUAGE_TIBETAN 0x0451
+#define LANGUAGE_DZONGKHA 0x0851
+#define LANGUAGE_TIBETAN_BHUTAN LANGUAGE_DZONGKHA /* a MS error, see #i53497# */
+#define LANGUAGE_TIGRIGNA_ERITREA 0x0873
+#define LANGUAGE_TIGRIGNA_ETHIOPIA 0x0473
+#define LANGUAGE_TSONGA 0x0431
+#define LANGUAGE_TSWANA 0x0432 /* AKA Setsuana, for South Africa */
+#define LANGUAGE_TURKISH 0x041F
+#define LANGUAGE_TURKMEN 0x0442
+#define LANGUAGE_UIGHUR_CHINA 0x0480
+#define LANGUAGE_UKRAINIAN 0x0422
+#define LANGUAGE_URDU 0x0020 /* primary only, not a locale! */
+#define LANGUAGE_URDU_INDIA 0x0820
+#define LANGUAGE_URDU_PAKISTAN 0x0420
+#define LANGUAGE_UZBEK_CYRILLIC 0x0843
+#define LANGUAGE_UZBEK_LATIN 0x0443
+#define LANGUAGE_VENDA 0x0433
+#define LANGUAGE_VIETNAMESE 0x042A
+#define LANGUAGE_WELSH 0x0452
+#define LANGUAGE_WOLOF_SENEGAL 0x0488
+#define LANGUAGE_XHOSA 0x0434 /* AKA isiZhosa */
+#define LANGUAGE_YAKUT_RUSSIA 0x0485
+#define LANGUAGE_YI 0x0478 /* Sichuan Yi */
+#define LANGUAGE_YIDDISH 0x043D
+#define LANGUAGE_YORUBA 0x046A
+#define LANGUAGE_ZULU 0x0435
+
+/*! use only for import/export of MS documents, number formatter maps it to
+ *! LANGUAGE_SYSTEM and then to effective system language */
+#define LANGUAGE_SYSTEM_DEFAULT 0x0800
+
+/*! use only for import/export of MS documents, number formatter maps it to
+ *! LANGUAGE_SYSTEM and then to effective system language */
+#define LANGUAGE_PROCESS_OR_USER_DEFAULT 0x0400
+
+/* And now the extensions we define, valid from
+ * 0x0610 to 0x07FF with sublanguage ID 0x01 (default)
+ * 0x0A00 to 0x0BFF with sublanguage ID 0x02
+ * ...
+ * 0x8200 to 0x83FF with sublanguage ID 0x20
+ * 0x8600 to 0x87FF with sublanguage ID 0x21
+ * ...
+ * 0xFA00 to 0xFBFF with sublanguage ID 0x3E
+ * 0xFE00 to 0xFFFF with sublanguage ID 0x3F
+ *
+ * Obsolete OOo user defines now have other values assigned by MS, and
+ * different name. Mapping an obsolete value to ISO code should work provided
+ * that such a mapping exists in i18nlangtag/source/isolang/isolang.cxx, but
+ * mapping ISO back to LANGID will return the new value.
+ */
+#define LANGUAGE_OBSOLETE_USER_LATIN 0x0610
+#define LANGUAGE_USER_LATIN LANGUAGE_LATIN
+#define LANGUAGE_USER_ESPERANTO 0x0611 /* no locale possible */
+#define LANGUAGE_USER_INTERLINGUA 0x0612 /* no locale, but conventions */
+#define LANGUAGE_OBSOLETE_USER_MAORI 0x0620
+#define LANGUAGE_USER_MAORI LANGUAGE_MAORI_NEW_ZEALAND
+#define LANGUAGE_OBSOLETE_USER_KINYARWANDA 0x0621
+#define LANGUAGE_USER_KINYARWANDA LANGUAGE_KINYARWANDA_RWANDA
+/* was reserved for Northern Sotho but never used: 0x0622 */ /* obsoleted by LANGUAGE_SEPEDI */
+#define LANGUAGE_OBSOLETE_USER_UPPER_SORBIAN 0x0623
+#define LANGUAGE_USER_UPPER_SORBIAN LANGUAGE_UPPER_SORBIAN_GERMANY
+#define LANGUAGE_OBSOLETE_USER_LOWER_SORBIAN 0x0624
+#define LANGUAGE_USER_LOWER_SORBIAN LANGUAGE_LOWER_SORBIAN_GERMANY
+#define LANGUAGE_OBSOLETE_USER_OCCITAN 0x0625
+#define LANGUAGE_USER_OCCITAN LANGUAGE_OCCITAN_FRANCE /* reserved to languedocian */
+
+#define LANGUAGE_USER_KOREAN_NORTH 0x8012 /* North Korean as opposed to South Korean, makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_KOREAN)) */
+#define LANGUAGE_USER_KURDISH_TURKEY 0x0626 /* sublang 0x01, Latin script */
+#define LANGUAGE_USER_KURDISH_SYRIA 0x0A26 /* sublang 0x02, Latin script */
+#define LANGUAGE_USER_KURDISH_IRAQ 0x0E26 /* sublang 0x03, Arabic script */
+#define LANGUAGE_USER_KURDISH_IRAN 0x1226 /* sublang 0x04, Arabic script */
+#define LANGUAGE_USER_SARDINIAN 0x0627
+/* was reserved for Dzongkha but turned down with #i53497#: 0x0628 */ /* obsoleted by LANGUAGE_DZONGKHA */
+#define LANGUAGE_USER_SWAHILI_TANZANIA 0x8041 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_SWAHILI)) */
+#define LANGUAGE_OBSOLETE_USER_BRETON 0x0629
+#define LANGUAGE_USER_BRETON LANGUAGE_BRETON_FRANCE
+#define LANGUAGE_OBSOLETE_USER_KALAALLISUT 0x062A
+#define LANGUAGE_USER_KALAALLISUT LANGUAGE_KALAALLISUT_GREENLAND
+#define LANGUAGE_USER_SWAZI 0x062B
+#define LANGUAGE_USER_NDEBELE_SOUTH 0x062C
+#define LANGUAGE_USER_TSWANA_BOTSWANA 0x8032 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_TSWANA)) */
+#define LANGUAGE_USER_MOORE 0x062D
+#define LANGUAGE_USER_BAMBARA 0x062E
+#define LANGUAGE_USER_AKAN 0x062F
+#define LANGUAGE_OBSOLETE_USER_LUXEMBOURGISH 0x0630
+#define LANGUAGE_USER_LUXEMBOURGISH LANGUAGE_LUXEMBOURGISH_LUXEMBOURG
+#define LANGUAGE_USER_FRIULIAN 0x0631
+#define LANGUAGE_USER_FIJIAN 0x0632
+#define LANGUAGE_USER_AFRIKAANS_NAMIBIA 0x8036 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_AFRIKAANS)) */
+#define LANGUAGE_USER_ENGLISH_NAMIBIA 0x8009 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_ENGLISH_US)) */
+#define LANGUAGE_USER_WALLOON 0x0633
+#define LANGUAGE_USER_COPTIC 0x0634
+#define LANGUAGE_USER_CHUVASH 0x0635
+#define LANGUAGE_USER_GASCON 0x0636 /* Gascon France */
+#define LANGUAGE_USER_GERMAN_BELGIUM 0x8007 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_GERMAN)) */
+#define LANGUAGE_USER_CATALAN_VALENCIAN 0x8003 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_CATALAN)) */
+#define LANGUAGE_USER_HAUSA_GHANA 0x8068 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_HAUSA_NIGERIA)) */
+#define LANGUAGE_USER_EWE_GHANA 0x0637
+#define LANGUAGE_USER_ENGLISH_GHANA 0x8409 /* makeLangID( 0x21, getPrimaryLanguage( LANGUAGE_ENGLISH_US)) */
+#define LANGUAGE_USER_TAGALOG 0x0638
+#define LANGUAGE_USER_LINGALA_DRCONGO 0x0639
+#define LANGUAGE_USER_SANGO 0x063A
+#define LANGUAGE_USER_GANDA 0x063B
+#define LANGUAGE_USER_LOW_GERMAN 0x063C
+#define LANGUAGE_USER_HILIGAYNON 0x063D
+#define LANGUAGE_USER_NYANJA 0x063E
+#define LANGUAGE_USER_KASHUBIAN 0x063F
+#define LANGUAGE_USER_SPANISH_CUBA 0x800A /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_SPANISH)) */
+#define LANGUAGE_USER_TETUN 0x0640
+#define LANGUAGE_USER_QUECHUA_NORTH_BOLIVIA 0x0641
+#define LANGUAGE_USER_QUECHUA_SOUTH_BOLIVIA 0x0642
+#define LANGUAGE_USER_SERBIAN_CYRILLIC_SERBIA 0x8C1A /* makeLangID( 0x20+0x03, getPrimaryLanguage( LANGUAGE_SERBIAN_CYRILLIC)) */
+#define LANGUAGE_USER_SERBIAN_LATIN_SERBIA 0x881A /* makeLangID( 0x20+0x02, getPrimaryLanguage( LANGUAGE_SERBIAN_LATIN)) */
+#define LANGUAGE_USER_SERBIAN_CYRILLIC_MONTENEGRO 0xCC1A /* makeLangID( 0x20+0x13, getPrimaryLanguage( LANGUAGE_SERBIAN_CYRILLIC)) */
+#define LANGUAGE_USER_SERBIAN_LATIN_MONTENEGRO 0xC81A /* makeLangID( 0x20+0x12, getPrimaryLanguage( LANGUAGE_SERBIAN_LATIN)) */
+#define LANGUAGE_USER_SAMI_KILDIN_RUSSIA 0x803B /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_SAMI_NORTHERN_NORWAY)) */
+#define LANGUAGE_USER_BODO_INDIA 0x0643
+#define LANGUAGE_USER_DOGRI_INDIA 0x0644
+#define LANGUAGE_USER_MAITHILI_INDIA 0x0645
+#define LANGUAGE_USER_SANTALI_INDIA 0x0646
+#define LANGUAGE_USER_TETUN_TIMOR_LESTE 0x0A40 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_USER_TETUN)) */
+#define LANGUAGE_USER_TOK_PISIN 0x0647
+#define LANGUAGE_USER_SHUSWAP 0x0648
+#define LANGUAGE_USER_ARABIC_CHAD 0x8001 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_ARABIC_SAUDI_ARABIA)) */
+#define LANGUAGE_USER_ARABIC_COMOROS 0x8401 /* makeLangID( 0x21, getPrimaryLanguage( LANGUAGE_ARABIC_SAUDI_ARABIA)) */
+#define LANGUAGE_USER_ARABIC_DJIBOUTI 0x8801 /* makeLangID( 0x22, getPrimaryLanguage( LANGUAGE_ARABIC_SAUDI_ARABIA)) */
+#define LANGUAGE_USER_ARABIC_ERITREA 0x8C01 /* makeLangID( 0x23, getPrimaryLanguage( LANGUAGE_ARABIC_SAUDI_ARABIA)) */
+#define LANGUAGE_USER_ARABIC_ISRAEL 0x9001 /* makeLangID( 0x24, getPrimaryLanguage( LANGUAGE_ARABIC_SAUDI_ARABIA)) */
+#define LANGUAGE_USER_ARABIC_MAURITANIA 0x9401 /* makeLangID( 0x25, getPrimaryLanguage( LANGUAGE_ARABIC_SAUDI_ARABIA)) */
+#define LANGUAGE_USER_ARABIC_PALESTINE 0x9801 /* makeLangID( 0x26, getPrimaryLanguage( LANGUAGE_ARABIC_SAUDI_ARABIA)) */
+#define LANGUAGE_USER_ARABIC_SOMALIA 0x9C01 /* makeLangID( 0x27, getPrimaryLanguage( LANGUAGE_ARABIC_SAUDI_ARABIA)) */
+#define LANGUAGE_USER_ARABIC_SUDAN 0xA001 /* makeLangID( 0x28, getPrimaryLanguage( LANGUAGE_ARABIC_SAUDI_ARABIA)) */
+#define LANGUAGE_USER_ANCIENT_GREEK 0x0649
+#define LANGUAGE_USER_ASTURIAN 0x064A
+#define LANGUAGE_USER_LATGALIAN 0x064B
+#define LANGUAGE_USER_MAORE 0x064C
+#define LANGUAGE_USER_BUSHI 0x064D
+#define LANGUAGE_USER_TAHITIAN 0x064E
+#define LANGUAGE_USER_MALAGASY_PLATEAU 0x064F
+#define LANGUAGE_USER_PAPIAMENTU_ARUBA 0x8079 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_PAPIAMENTU)) */
+#define LANGUAGE_USER_SARDINIAN_CAMPIDANESE 0x0650
+#define LANGUAGE_USER_SARDINIAN_GALLURESE 0x0651
+#define LANGUAGE_USER_SARDINIAN_LOGUDORESE 0x0652
+#define LANGUAGE_USER_SARDINIAN_SASSARESE 0x0653
+#define LANGUAGE_USER_BAFIA 0x0654
+#define LANGUAGE_USER_GIKUYU 0x0655
+#define LANGUAGE_USER_RUSYN_UKRAINE 0x0656
+#define LANGUAGE_USER_RUSYN_SLOVAKIA 0x8256 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_USER_RUSYN_UKRAINE)) */
+#define LANGUAGE_USER_YIDDISH_US 0x083D /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_YIDDISH)) */
+#define LANGUAGE_USER_LIMBU 0x0657
+#define LANGUAGE_USER_LOJBAN 0x0658 /* no locale */
+#define LANGUAGE_OBSOLETE_USER_KABYLE 0x0659
+#define LANGUAGE_USER_KABYLE LANGUAGE_TAMAZIGHT_LATIN
+#define LANGUAGE_USER_HAITIAN 0x065A
+#define LANGUAGE_USER_BEEMBE 0x065B
+#define LANGUAGE_USER_BEKWEL 0x065C
+#define LANGUAGE_USER_KITUBA 0x065D
+#define LANGUAGE_USER_LARI 0x065E
+#define LANGUAGE_USER_MBOCHI 0x065F
+#define LANGUAGE_USER_TEKE_IBALI 0x0660
+#define LANGUAGE_USER_TEKE_TYEE 0x0661
+#define LANGUAGE_USER_VILI 0x0662
+#define LANGUAGE_USER_PORTUGUESE_ANGOLA 0x8016 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_PORTUGUESE)) */
+#define LANGUAGE_USER_MANX 0x0663
+#define LANGUAGE_USER_TEKE_EBOO 0x0664
+#define LANGUAGE_USER_ARAGONESE 0x0665
+#define LANGUAGE_USER_KEYID 0x0666 /* key id pseudolanguage */
+#define LANGUAGE_USER_PALI_LATIN 0x0667
+#define LANGUAGE_USER_KYRGYZ_CHINA 0x0668 /* not derived from LANGUAGE_KIRGHIZ as these may be different scripts, see http://www.omniglot.com/writing/kirghiz.htm */
+#define LANGUAGE_USER_KOMI_ZYRIAN 0x0669
+#define LANGUAGE_USER_KOMI_PERMYAK 0x066A
+#define LANGUAGE_USER_PITJANTJATJARA 0x066B
+#define LANGUAGE_USER_ENGLISH_MALAWI 0x8809 /* makeLangID( 0x22, getPrimaryLanguage( LANGUAGE_ENGLISH_UK)) */
+#define LANGUAGE_USER_ERZYA 0x066C
+#define LANGUAGE_USER_MARI_MEADOW 0x066D
+#define LANGUAGE_USER_KHANTY 0x066E
+#define LANGUAGE_USER_LIVONIAN 0x066F
+#define LANGUAGE_USER_MOKSHA 0x0670
+#define LANGUAGE_USER_MARI_HILL 0x0671
+#define LANGUAGE_USER_NGANASAN 0x0672
+#define LANGUAGE_USER_OLONETS 0x0673
+#define LANGUAGE_USER_VEPS 0x0674
+#define LANGUAGE_USER_VORO 0x0675
+#define LANGUAGE_USER_NENETS 0x0676
+#define LANGUAGE_USER_PAPIAMENTU_CURACAO 0x8479 /* makeLangID( 0x21, getPrimaryLanguage( LANGUAGE_PAPIAMENTU)) */
+#define LANGUAGE_USER_PAPIAMENTU_BONAIRE 0x8879 /* makeLangID( 0x22, getPrimaryLanguage( LANGUAGE_PAPIAMENTU)) */
+#define LANGUAGE_USER_AKA 0x0677
+#define LANGUAGE_USER_AKA_CONGO 0x8277 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_USER_AKA)) */
+#define LANGUAGE_USER_DIBOLE 0x0678
+#define LANGUAGE_USER_DOONDO 0x0679
+#define LANGUAGE_USER_KAAMBA 0x067A
+#define LANGUAGE_USER_KOONGO 0x067B
+#define LANGUAGE_USER_KOONGO_CONGO 0x827B /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_USER_KOONGO)) */
+#define LANGUAGE_USER_KUNYI 0x067C
+#define LANGUAGE_USER_NGUNGWEL 0x067D
+#define LANGUAGE_USER_NJYEM 0x067E
+#define LANGUAGE_USER_NJYEM_CONGO 0x827E /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_USER_NJYEM)) */
+#define LANGUAGE_USER_PUNU 0x067F
+#define LANGUAGE_USER_PUNU_CONGO 0x827F /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_USER_PUNU)) */
+#define LANGUAGE_USER_SUUNDI 0x0680
+#define LANGUAGE_USER_TEKE_KUKUYA 0x0681
+#define LANGUAGE_USER_TSAANGI 0x0682
+#define LANGUAGE_USER_YAKA 0x0683
+#define LANGUAGE_USER_YOMBE 0x0684
+#define LANGUAGE_USER_YOMBE_CONGO 0x8284 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_USER_YOMBE)) */
+#define LANGUAGE_USER_SIDAMA 0x0685
+
+#define LANGUAGE_USER_PRIV_JOKER 0xFFEB /* privateuse "*" (sic! bad! nasty!), primary 0x3eb, sub 0x3f */
+#define LANGUAGE_USER_PRIV_COMMENT 0xFFEC /* privateuse "x-comment", primary 0x3ec, sub 0x3f */
+#define LANGUAGE_USER_PRIV_DEFAULT 0xFFED /* privateuse "x-default", primary 0x3ed, sub 0x3f */
+#define LANGUAGE_USER_PRIV_NOTRANSLATE 0xFFEE /* privateuse "x-no-translate" (sic!), primary 0x3ee, sub 0x3f */
+#define LANGUAGE_MULTIPLE 0xFFEF /* multiple languages, primary 0x3ef, sub 0x3f */
+#define LANGUAGE_UNDETERMINED 0xFFF0 /* undetermined language, primary 0x3f0, sub 0x3f */
+#define LANGUAGE_USER_SYSTEM_CONFIG 0xFFFE /* not a locale, to be used only in configuration context to obtain system default, primary 0x3fe, sub 0x3f */
+
+#endif /* INCLUDED_I18NLANGTAG_LANG_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nlangtag/languagetag.hxx b/include/i18nlangtag/languagetag.hxx
new file mode 100644
index 000000000000..e5ba011ab2ba
--- /dev/null
+++ b/include/i18nlangtag/languagetag.hxx
@@ -0,0 +1,400 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_I18NLANGTAG_LANGUAGETAG_HXX
+#define INCLUDED_I18NLANGTAG_LANGUAGETAG_HXX
+
+#include <sal/config.h>
+#include <rtl/ustring.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+#include <i18nlangtag/i18nlangtagdllapi.h>
+#include <i18nlangtag/lang.h>
+
+#include <vector>
+
+typedef struct _rtl_Locale rtl_Locale; // as in rtl/locale.h
+
+
+/** Wrapper for liblangtag BCP 47 language tags, MS-LangIDs, locales and
+ conversions in between.
+
+ Note that member variables are mutable and may change their values even in
+ const methods. Getter methods return either the original value or matching
+ converted values.
+ */
+class I18NLANGTAG_DLLPUBLIC LanguageTag
+{
+public:
+
+ /** Init LanguageTag with existing BCP 47 language tag string.
+
+ @param bCanonicalize
+ If TRUE, canonicalize tag and reparse, the resulting tag string may
+ be different.
+ IF FALSE, the tag is simply stored and can be retrieved with
+ getBcp47().
+
+ Note that conversions to ISO codes, locales or LanguageType or
+ obtaining language or script will canonicalize the tag string anyway,
+ so specifying bCanonicalize=false is not a guarantee that the tag will
+ stay identical to what was passed.
+ */
+ explicit LanguageTag( const OUString & rBcp47LanguageTag, bool bCanonicalize = false );
+
+ /** Init LanguageTag with Locale. */
+ explicit LanguageTag( const com::sun::star::lang::Locale & rLocale );
+
+ /** Init LanguageTag with LanguageType MS-LangID. */
+ explicit LanguageTag( LanguageType nLanguage );
+
+ /** Init LanguageTag with language and country strings.
+
+ This is a convenience ctor for places that so far use only language and
+ country to replace the MsLangId::convert...IsoNames...() calls. Avoid
+ use in new code.
+ */
+ explicit LanguageTag( const OUString& rLanguage, const OUString& rCountry );
+
+ /** Init LanguageTag with rtl_Locale.
+
+ This is a convenience ctor.
+ */
+ explicit LanguageTag( const rtl_Locale & rLocale );
+
+ LanguageTag( const LanguageTag & rLanguageTag );
+ ~LanguageTag();
+ LanguageTag& operator=( const LanguageTag & rLanguageTag );
+
+ /** Obtain BCP 47 language tag.
+
+ @param bResolveSystem
+ If TRUE, resolve an empty language tag denoting the system
+ locale to the real locale used.
+ If FALSE, return an empty OUString for such a tag.
+ */
+ const OUString & getBcp47( bool bResolveSystem = true ) const;
+
+ /** Obtain language tag as Locale.
+
+ As a convention, language tags that can not be expressed as "pure"
+ com::sun::star::lang::Locale content using Language and Country fields
+ store "qlt" (ISO 639 reserved for local use) in the Language field and
+ the entire BCP 47 language tag in the Variant field. The Country field
+ contains the corresponding ISO 3166 country code _if_ there is one, or
+ otherwise is empty.
+
+ @param bResolveSystem
+ If TRUE, resolve an empty language tag denoting the system
+ locale to the real locale used.
+ If FALSE, return an empty Locale for such a tag.
+ */
+ const com::sun::star::lang::Locale & getLocale( bool bResolveSystem = true ) const;
+
+ /** Obtain mapping to MS-LangID.
+
+ @param bResolveSystem
+ If TRUE, resolve an empty language tag denoting the system
+ locale to the real locale used.
+ If FALSE, return LANGUAGE_SYSTEM for such a tag.
+ */
+ LanguageType getLanguageType( bool bResolveSystem = true ) const;
+
+ /** Obtain ISO strings for language and country.
+
+ This is a convenience method for places that so far use only language and
+ country to replace the MsLangId::convert...IsoNames...() calls. Avoid
+ use in new code.
+
+ ATTENTION! May return empty strings if the language tag is not
+ expressable in valid ISO codes!
+
+ @see isIsoLocale()
+
+ Always resolves an empty tag to the system locale.
+ */
+ void getIsoLanguageCountry( OUString& rLanguage, OUString& rCountry ) const;
+
+ /** Get ISO 639 language code, or BCP 47 language.
+
+ Always resolves an empty tag to the system locale.
+ */
+ OUString getLanguage() const;
+
+ /** Get ISO 15924 script code, if not the default script according to
+ BCP 47. For default script an empty string is returned.
+
+ @see hasScript()
+
+ Always resolves an empty tag to the system locale.
+ */
+ OUString getScript() const;
+
+ /** Get combined language and script code, separated by '-' if
+ non-default script, if default script only language.
+
+ @see hasScript()
+
+ Always resolves an empty tag to the system locale.
+ */
+ OUString getLanguageAndScript() const;
+
+ /** Get ISO 3166 country alpha code. Empty if the BCP 47 tags denote a
+ region not expressable as 2 character country code.
+
+ Always resolves an empty tag to the system locale.
+ */
+ OUString getCountry() const;
+
+ /** Get BCP 47 region tag, which may be an ISO 3166 country alpha code or
+ any other BCP 47 region tag.
+
+ Always resolves an empty tag to the system locale.
+ */
+ OUString getRegion() const;
+
+ /** Get a GLIBC locale string.
+
+ Always resolves an empty tag to the system locale.
+
+ @param rEncoding
+ An encoding to be appended to language_country, for example
+ ".UTF-8" including the dot.
+
+ @return The resulting GLIBC locale string if it could be constructed,
+ if not an empty string is returned.
+ */
+ OUString getGlibcLocaleString( const OUString & rEncoding ) const;
+
+ /** If language tag has a non-default script specified.
+ */
+ bool hasScript() const;
+
+ /** If language tag is a locale that can be expressed using only ISO 639
+ language codes and ISO 3166 country codes, thus is convertible to a
+ conforming Locale struct without using extension mechanisms.
+
+ Note that an empty language tag or empty Locale::Language field or
+ LanguageType LANGUAGE_SYSTEM could be treated as a valid ISO locale in
+ some context, but here is not. If you want that ask for
+ aTag.isSystemLocale() || aTag.isIsoLocale()
+
+ Always resolves an empty tag to the system locale.
+ */
+ bool isIsoLocale() const;
+
+ /** If language tag is a locale that can be expressed using only ISO 639
+ language codes and ISO 15924 script codes and ISO 3166 country codes,
+ thus can be stored in an ODF document using only fo:language, fo:script
+ and fo:country attributes. If this is FALSE, the locale must be stored
+ as a <*:rfc-language-tag> element.
+
+ Always resolves an empty tag to the system locale.
+ */
+ bool isIsoODF() const;
+
+ /** If this is a valid BCP 47 language tag.
+
+ Always resolves an empty tag to the system locale.
+ */
+ bool isValidBcp47() const;
+
+ /** If this tag was contructed as an empty tag denoting the system locale.
+ */
+ bool isSystemLocale() const;
+
+
+ /** Reset with existing BCP 47 language tag string. See ctor. */
+ void reset( const OUString & rBcp47LanguageTag, bool bCanonicalize = false );
+
+ /** Reset with Locale. */
+ void reset( const com::sun::star::lang::Locale & rLocale );
+
+ /** Reset with LanguageType MS-LangID. */
+ void reset( LanguageType nLanguage );
+
+ /** Reset with rtl_Locale. */
+ void reset( const rtl_Locale & rLocale );
+
+
+ /** Fall back to a known locale.
+
+ If the current tag does not represent a known (by us) locale, fall back
+ to the most likely locale possible known.
+ If the current tag is known, no change occurs.
+ */
+ LanguageTag & makeFallback();
+
+ /** Return a vector of fall-back strings.
+
+ In order:
+ full BCP 47 tag, same as getBcp47()
+ lll-Ssss-CC
+ lll-Ssss
+ lll-CC
+ lll
+
+ Only strings that differ from a higher order are included, for example
+ if there is no script the elements will be bcp47, lll-CC, lll; if the
+ bcp47 string is identical to lll-CC then only lll-CC, lll.
+
+ Note that lll is only ISO 639-1/2 alpha code and CC is only ISO 3166
+ alpha code. If the region can not be expressed as ISO 3166 then no -CC
+ tags are included.
+ */
+ ::std::vector< OUString > getFallbackStrings() const;
+
+
+ /** @short search for an equal or at least for a similar locale in a list
+ of possible ones.
+
+ @descr First search for a locale that is equal to the reference
+ locale. (means: same BCP47 string)
+
+ If the reference locale could not be located, check for
+ "similar" locales, in the same order as obtained by
+ getFallbackStrings().
+
+ If no similar locale could be located, we search for a locale
+ "en-US" inside the given locale list.
+
+ If "en-US" could not be located, we search for a locale "en"
+ inside the given list.
+
+ If no "same" nor any "similar" locale could be found, we try
+ "x-default" and "x-no-translate" explicitly. Sometimes
+ variables don't use real localization. For example, in case the
+ localized value is a fix product name.
+
+ If no locale matched until then, we use any other locale that
+ exists inside the set of given ones, namely the first
+ encountered!
+
+ @param rList
+ the vector of possible locales as BCP47 strings.
+
+ @param rReference
+ the reference locale, BCP47 string.
+
+ @return An iterator that points to the found element inside the given
+ locale list. If no matching locale could be found it points to
+ the end of the list.
+ */
+ static ::std::vector< OUString >::const_iterator getFallback( const ::std::vector< OUString > & rList,
+ const OUString & rReference );
+
+
+ /** Test equality of two LanguageTag, possibly resolving system locale.
+
+ @param bResolveSystem
+ If TRUE, resolve empty language tags denoting the system
+ locale to the real locale used before comparing.
+ If FALSE, the behavior is identical to operator==(), system
+ locales are not resolved first.
+ */
+ bool equals( const LanguageTag & rLanguageTag, bool bResolveSystem = false ) const;
+
+ /** Test equality of two LanguageTag.
+
+ Does NOT resolve system, i.e. if the system locale is en-US
+ LanguageTag("")==LanguageTag("en-US") returns false! Use
+ equals(...,true) instead if system locales shall be resolved.
+ */
+ bool operator==( const LanguageTag & rLanguageTag ) const;
+
+ /** Test inequality of two LanguageTag.
+
+ Does NOT resolve system, i.e. if the system locale is en-US
+ LanguageTag("")!=LanguageTag("en-US") returns true! Use
+ !equals(,...true) instead if system locales shall be resolved.
+ */
+ bool operator!=( const LanguageTag & rLanguageTag ) const;
+
+private:
+
+ enum Decision
+ {
+ DECISION_DONTKNOW,
+ DECISION_NO,
+ DECISION_YES
+ };
+
+ mutable com::sun::star::lang::Locale maLocale;
+ mutable OUString maBcp47;
+ mutable OUString maCachedLanguage; ///< cache getLanguage()
+ mutable OUString maCachedScript; ///< cache getScript()
+ mutable OUString maCachedCountry; ///< cache getCountry()
+ mutable void* mpImplLangtag; ///< actually lt_tag_t pointer, encapsulated
+ mutable LanguageType mnLangID;
+ mutable Decision meIsValid;
+ mutable Decision meIsIsoLocale;
+ mutable Decision meIsIsoODF;
+ mutable Decision meIsLiblangtagNeeded; ///< whether processing with liblangtag needed
+ bool mbSystemLocale : 1;
+ mutable bool mbInitializedBcp47 : 1;
+ mutable bool mbInitializedLocale : 1;
+ mutable bool mbInitializedLangID : 1;
+ mutable bool mbCachedLanguage : 1;
+ mutable bool mbCachedScript : 1;
+ mutable bool mbCachedCountry : 1;
+ bool mbIsFallback : 1;
+
+ void convertLocaleToBcp47();
+ void convertLocaleToLang();
+ void convertBcp47ToLocale();
+ void convertBcp47ToLang();
+ void convertLangToLocale();
+ void convertLangToBcp47();
+
+ void convertFromRtlLocale();
+
+ bool canonicalize();
+
+ OUString getLanguageFromLangtag();
+ OUString getScriptFromLangtag();
+ OUString getRegionFromLangtag();
+
+ void resetVars();
+
+ /** Obtain Language, Script and Country via simpleExtract() and assign them
+ to the cached variables if successful.
+
+ @return return of simpleExtract()
+ */
+ bool cacheSimpleLSC();
+
+ static bool isIsoLanguage( const OUString& rLanguage );
+ static bool isIsoScript( const OUString& rScript );
+ static bool isIsoCountry( const OUString& rRegion );
+
+ enum Extraction
+ {
+ EXTRACTED_NONE,
+ EXTRACTED_LSC,
+ EXTRACTED_X,
+ EXTRACTED_X_JOKER
+ };
+
+ /** Of a simple language tag of the form lll[-Ssss][-CC] (i.e. one that
+ would fulfill the isIsoODF() condition) extract the portions.
+
+ Does not check case or content!
+
+ @return EXTRACTED_LSC if simple tag was detected, EXTRACTED_X if x-...
+ privateuse tag was detected, EXTRACTED_X_JOKER if "*" joker was
+ detected, else EXTRACTED_NONE.
+ */
+ static Extraction simpleExtract( const OUString& rBcp47,
+ OUString& rLanguage,
+ OUString& rScript,
+ OUString& rCountry );
+};
+
+#endif // INCLUDED_I18NLANGTAG_LANGUAGETAG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nlangtag/mslangid.hxx b/include/i18nlangtag/mslangid.hxx
new file mode 100644
index 000000000000..8148d1760de0
--- /dev/null
+++ b/include/i18nlangtag/mslangid.hxx
@@ -0,0 +1,309 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_I18NLANGTAG_MSLANGID_HXX
+#define INCLUDED_I18NLANGTAG_MSLANGID_HXX
+
+#include <sal/config.h>
+
+#include "i18nlangtag/i18nlangtagdllapi.h"
+#include "i18nlangtag/lang.h"
+#include <com/sun/star/lang/Locale.hpp>
+
+/** Methods related to Microsoft language IDs. For details about MS-LANGIDs
+ please see lang.h */
+class I18NLANGTAG_DLLPUBLIC MsLangId
+{
+public:
+
+ /// Create a LangID from a primary and a sublanguage.
+ static inline LanguageType makeLangID( LanguageType nSubLangId, LanguageType nPriLangId)
+ {
+ return (nSubLangId << 10) | nPriLangId;
+ }
+
+ /// Get the primary language of a LangID.
+ static inline LanguageType getPrimaryLanguage( LanguageType nLangID)
+ {
+ return nLangID & LANGUAGE_MASK_PRIMARY;
+ }
+
+ /// Get the sublanguage of a LangID.
+ static inline LanguageType getSubLanguage( LanguageType nLangID)
+ {
+ return (nLangID & ~LANGUAGE_MASK_PRIMARY) >> 10;
+ }
+
+ /** Language/locale of category LC_CTYPE (on Unix, else the system
+ language).
+ Evaluation order: LC_ALL, LC_CTYPE, LANG */
+ static LanguageType getSystemLanguage();
+
+ /** Language/locale of category LC_MESSAGES (on Unix, else same as
+ GetSystemLanguage()).
+ Evaluation order: LANGUAGE, LC_ALL, LC_MESSAGES, LANG */
+ static LanguageType getSystemUILanguage();
+
+
+ /** @short: A proper language/locale if the nLang parameter designates some
+ special value.
+
+ @descr: NOTE: The "system" values may be overridden by the
+ application's configuration.
+
+ @returns
+ case LANGUAGE_PROCESS_OR_USER_DEFAULT : configured or system language
+ case LANGUAGE_SYSTEM_DEFAULT : configured or system language
+ case LANGUAGE_SYSTEM : configured or system language
+ case LANGUAGE_HID_HUMAN_INTERFACE_DEVICE : configured or system UI language
+ case LANGUAGE_DONTKNOW : LANGUAGE_ENGLISH_US
+ else: nLang
+
+ In case the configured language is LANGUAGE_SYSTEM, which is also
+ the initial default, the system language is obtained. In case the
+ configured or resulting system language is LANGUAGE_DONTKNOW,
+ LANGUAGE_ENGLISH_US is returned instead.
+ */
+ static LanguageType getRealLanguage( LanguageType nLang );
+
+
+ // TODO: refactor to LanguageTag? Used only in
+ // i18npool/source/localedata/localedata.cxx
+
+ /** Get fall-back Locale for Locale with handling of an empty language name
+ designating the SYSTEM language. Returns the same Locale if an exact
+ match was found.
+ */
+ static ::com::sun::star::lang::Locale getFallbackLocale(
+ const ::com::sun::star::lang::Locale & rLocale );
+
+
+ // TODO: refactor to LanguageTag, used only in
+ // i18npool/source/isolang/inunx.cxx to convert Unix locale string
+
+ static LanguageType convertUnxByteStringToLanguage( const OString& rString );
+
+
+ static LanguageType resolveSystemLanguageByScriptType( LanguageType nLang, sal_Int16 nType );
+
+
+ /** Whether locale has a Right-To-Left orientation. */
+ static bool isRightToLeft( LanguageType nLang );
+
+ /** Whether locale is a CJK locale */
+ static bool isCJK( LanguageType nLang );
+
+ /** Whether locale is a chinese locale */
+ static bool isChinese( LanguageType nLang );
+
+ /** Whether locale is a simplified chinese locale */
+ static bool isSimplifiedChinese( LanguageType nLang );
+
+ /** Whether locale is a traditional chinese locale */
+ static bool isTraditionalChinese( LanguageType nLang );
+
+ /** Whether locale is a korean locale */
+ static bool isKorean( LanguageType nLang );
+
+ /** Whether locale is a simplified chinese locale */
+ static bool isSimplifiedChinese( const ::com::sun::star::lang::Locale & rLocale );
+
+ /** Whether locale is a traditional chinese locale */
+ static bool isTraditionalChinese( const ::com::sun::star::lang::Locale & rLocale );
+
+ /** Whether locale is one where family name comes first, e.g. Japan, Hungary, Samoa */
+ static bool isFamilyNameFirst( LanguageType nLang );
+
+ /** Whether there are "forbidden characters at start or end of line" in
+ this locale. CJK locales.
+
+ @see offapi/com/sun/star/i18n/ForbiddenCharacters.idl
+ */
+ static bool hasForbiddenCharacters( LanguageType nLang );
+
+
+ /** Whether locale needs input sequence checking. CTL locales. */
+ static bool needsSequenceChecking( LanguageType nLang );
+
+
+ /** Get ::com::sun::star::i18n::ScriptType of locale. */
+ static sal_Int16 getScriptType( LanguageType nLang );
+
+
+ /** Map an obsolete user defined LANGID (see lang.h
+ LANGUAGE_OBSOLETE_USER_...) to the new value defined by MS in the
+ meantime.
+
+ Also used to map UI localizations using reserved ISO codes to something
+ "official" but not identical in order to not pollute documents with
+ invalid ISO codes.
+
+ @param bUserInterfaceSelection
+ If TRUE, don't replace such UI-only locale. Only use for
+ Tools->Options->LanguageSettings->UserInterface listbox.
+ If FALSE, do replace.
+ */
+ static LanguageType getReplacementForObsoleteLanguage( LanguageType nLang,
+ bool bUserInterfaceSelection = false );
+
+
+ /** @ATTENTION: these are _ONLY_ to be called by the application's
+ configuration! */
+ static void setConfiguredSystemLanguage( LanguageType nLang );
+ static void setConfiguredSystemUILanguage( LanguageType nLang );
+ static void setConfiguredWesternFallback( LanguageType nLang );
+ static void setConfiguredComplexFallback( LanguageType nLang );
+ static void setConfiguredAsianFallback( LanguageType nLang );
+
+// ---------------------------------------------------------------------------
+
+ /** @internal - Access to fields of an element of the simple conversion table.
+ For resource compiler build environment usage only! */
+ struct IsoLangEntry
+ {
+ LanguageType mnLang;
+ sal_Char maLangStr[4];
+ sal_Char maCountry[3];
+
+ /** Obtain a language tag string with '-' separator. */
+ I18NLANGTAG_DLLPUBLIC OUString getTagString() const;
+ };
+
+ /** @internal - Return a pointer to the IsoLangEntry of the underlying table,
+ matching the offset passed by nIndex. Only meaningful for the resource
+ compiler to build a list of known languages.
+
+ @returns address of IsoLangEntry, or NULL pointer if nIndex exceeds the
+ table elements' count.
+ */
+ static const IsoLangEntry* getIsoLangEntry( size_t nIndex );
+
+// ---------------------------------------------------------------------------
+
+ /** Encapsulated conversion methods used by LanguageTag and conversions,
+ not to be used by anything else.
+ */
+ class Conversion
+ {
+ private:
+
+ friend class LanguageTag;
+
+ friend ::com::sun::star::lang::Locale MsLangId::getFallbackLocale(
+ const ::com::sun::star::lang::Locale & rLocale );
+
+ friend LanguageType MsLangId::convertUnxByteStringToLanguage(
+ const OString& rString );
+
+
+ /** Convert a Locale to a LanguageType with handling of an empty
+ language name designating LANGUAGE_SYSTEM.
+ */
+ I18NLANGTAG_DLLPRIVATE static LanguageType convertLocaleToLanguage(
+ const ::com::sun::star::lang::Locale & rLocale );
+
+ /** Convert x-... privateuse, used by convertLocaleToLanguage(Locale) */
+ I18NLANGTAG_DLLPRIVATE static LanguageType convertPrivateUseToLanguage(
+ const OUString& rPriv );
+
+ /** Used by convertLocaleToLanguage(Locale) */
+ I18NLANGTAG_DLLPRIVATE static LanguageType convertIsoNamesToLanguage(
+ const OUString& rLang, const OUString& rCountry );
+
+
+ /** Used by convertUnxByteStringToLanguage(OString) */
+ I18NLANGTAG_DLLPRIVATE static LanguageType convertIsoNamesToLanguage(
+ const OString& rLang, const OString& rCountry );
+
+
+ /** Convert a LanguageType to a Locale.
+
+ @param bResolveSystem
+ If bResolveSystem==true, a LANGUAGE_SYSTEM is resolved.
+ If bResolveSystem==false, a LANGUAGE_SYSTEM results in an
+ empty Locale.
+ */
+ I18NLANGTAG_DLLPRIVATE static ::com::sun::star::lang::Locale convertLanguageToLocale(
+ LanguageType nLang, bool bResolveSystem );
+
+ /** Convert a LanguageType to a Locale, resolving LANGUAGE_SYSTEM.
+
+ Used by convertLanguageToLocale(LanguageType,bool)
+ */
+ I18NLANGTAG_DLLPRIVATE static void convertLanguageToLocale(
+ LanguageType nLang, ::com::sun::star::lang::Locale & rLocale );
+
+ /** Used by convertLanguageToLocale(LanguageType,Locale) */
+ I18NLANGTAG_DLLPRIVATE static void convertLanguageToIsoNames(
+ LanguageType nLang, OUString& rLangStr, OUString& rCountry );
+
+
+ I18NLANGTAG_DLLPRIVATE static LanguageType lookupFallbackLanguage( LanguageType nLang );
+
+ I18NLANGTAG_DLLPRIVATE static ::com::sun::star::lang::Locale lookupFallbackLocale(
+ const ::com::sun::star::lang::Locale & rLocale );
+
+
+ /** Convert a LanguageType to a Locale, resolving LANGUAGE_SYSTEM,
+ falling back to a default locale if no exact match was found.
+
+ Used by getFallbackLocale(Locale)
+ */
+ I18NLANGTAG_DLLPRIVATE static ::com::sun::star::lang::Locale convertLanguageToLocaleWithFallback(
+ LanguageType nLang );
+
+ /** Used by convertLanguageToLocaleWithFallback(LanguageType) */
+ I18NLANGTAG_DLLPRIVATE static ::com::sun::star::lang::Locale lookupFallbackLocale(
+ LanguageType nLang );
+ };
+
+private:
+
+ static LanguageType nConfiguredSystemLanguage;
+ static LanguageType nConfiguredSystemUILanguage;
+
+ static LanguageType nConfiguredWesternFallback;
+ static LanguageType nConfiguredAsianFallback;
+ static LanguageType nConfiguredComplexFallback;
+
+ static LanguageType getPlatformSystemLanguage();
+ static LanguageType getPlatformSystemUILanguage();
+
+ // Substitute LANGUAGE_SYSTEM for LANGUAGE_SYSTEM_DEFAULT and
+ // LANGUAGE_PROCESS_OR_USER_DEFAULT, other values aren't touched.
+ I18NLANGTAG_DLLPRIVATE static inline LanguageType simplifySystemLanguages( LanguageType nLang );
+};
+
+
+// static
+inline LanguageType MsLangId::getSystemLanguage()
+{
+ return getPlatformSystemLanguage();
+}
+
+
+// static
+inline LanguageType MsLangId::getSystemUILanguage()
+{
+ return getPlatformSystemUILanguage();
+}
+
+#endif // INCLUDED_I18NLANGTAG_MSLANGID_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nutil/casefolding.hxx b/include/i18nutil/casefolding.hxx
new file mode 100644
index 000000000000..a0867d1e687c
--- /dev/null
+++ b/include/i18nutil/casefolding.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_I18NUTIL_CASEFOLDING_HXX
+#define INCLUDED_I18NUTIL_CASEFOLDING_HXX
+
+#include <sal/types.h>
+#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include "i18nutildllapi.h"
+
+namespace com { namespace sun { namespace star { namespace i18n {
+
+#define MappingTypeLowerToUpper (1 << 0) // Upper to Lower mapping
+#define MappingTypeUpperToLower (1 << 1) // Lower to Upper mapping
+#define MappingTypeToUpper (1 << 2) // to Upper mapping
+#define MappingTypeToLower (1 << 3) // to Lower mapping
+#define MappingTypeToTitle (1 << 4) // to Title mapping
+#define MappingTypeSimpleFolding (1 << 5) // Simple Case Folding
+#define MappingTypeFullFolding (1 << 6) // Full Case Folding
+#define MappingTypeMask (MappingTypeLowerToUpper|MappingTypeUpperToLower|\
+ MappingTypeToUpper|MappingTypeToLower|MappingTypeToTitle|\
+ MappingTypeSimpleFolding|MappingTypeFullFolding)
+
+#define ValueTypeNotValue (1 << 7) // Value field is an address
+
+#define CasedLetter (MappingTypeMask) // for final sigmar
+
+struct Value
+{
+ sal_uInt8 type;
+ sal_uInt16 value; // value or address, depend on the type
+};
+
+struct Mapping
+{
+ sal_uInt8 type;
+ sal_Int8 nmap;
+#define NMAPPINGMAX 3
+ sal_Unicode map[NMAPPINGMAX];
+}; // for Unconditional mapping
+
+struct MappingElement
+{
+ MappingElement() {element.nmap = current = 0;}
+ Mapping element;
+ sal_Int8 current;
+};
+
+class I18NUTIL_DLLPUBLIC casefolding
+{
+public:
+ static Mapping& getValue(const sal_Unicode* str, sal_Int32 pos, sal_Int32 len, com::sun::star::lang::Locale& aLocale, sal_uInt8 nMappingType) throw (com::sun::star::uno::RuntimeException);
+ static Mapping& getConditionalValue(const sal_Unicode* str, sal_Int32 pos, sal_Int32 len, com::sun::star::lang::Locale& aLocale, sal_uInt8 nMappingType) throw (com::sun::star::uno::RuntimeException);
+ static sal_Unicode getNextChar(const sal_Unicode *str, sal_Int32& idx, sal_Int32 len, MappingElement& e, com::sun::star::lang::Locale& aLocale,sal_uInt8 nMappingtype, TransliterationModules moduleLoaded) throw (com::sun::star::uno::RuntimeException);
+
+};
+
+} } } }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nutil/i18nutildllapi.h b/include/i18nutil/i18nutildllapi.h
new file mode 100644
index 000000000000..b208b51e9ee0
--- /dev/null
+++ b/include/i18nutil/i18nutildllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_I18NUTILDLLAPI_H
+#define INCLUDED_I18NUTILDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(I18NUTIL_DLLIMPLEMENTATION)
+#define I18NUTIL_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define I18NUTIL_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define I18NUTIL_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_I18NUTILDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nutil/oneToOneMapping.hxx b/include/i18nutil/oneToOneMapping.hxx
new file mode 100644
index 000000000000..533e4ad52c59
--- /dev/null
+++ b/include/i18nutil/oneToOneMapping.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_I18NUTIL_TRANSLITERATION_ONETOONEMAPPING_HXX
+#define INCLUDED_I18NUTIL_TRANSLITERATION_ONETOONEMAPPING_HXX
+
+#include <boost/noncopyable.hpp>
+#include <rtl/ustring.hxx>
+#include "i18nutildllapi.h"
+
+namespace com { namespace sun { namespace star { namespace i18n {
+
+class widthfolding;
+
+struct OneToOneMappingTable_t
+{
+ sal_Unicode first;
+ sal_Unicode second;
+};
+
+typedef sal_Int8 UnicodePairFlag;
+struct UnicodePairWithFlag
+{
+ sal_Unicode first;
+ sal_Unicode second;
+ UnicodePairFlag flag;
+};
+
+class I18NUTIL_DLLPUBLIC oneToOneMapping : private boost::noncopyable
+{
+public:
+ oneToOneMapping( OneToOneMappingTable_t *rpTable, const size_t rnSize, const size_t rnUnitSize = sizeof(OneToOneMappingTable_t) );
+ virtual ~oneToOneMapping();
+
+ // binary search
+ virtual sal_Unicode find( const sal_Unicode nKey ) const;
+
+ // translator
+ sal_Unicode operator[] ( const sal_Unicode nKey ) const { return find( nKey ); };
+
+protected:
+ OneToOneMappingTable_t *mpTable;
+ size_t mnSize;
+};
+
+class I18NUTIL_DLLPUBLIC oneToOneMappingWithFlag : public oneToOneMapping
+{
+ friend class widthfolding;
+
+public:
+ oneToOneMappingWithFlag( UnicodePairWithFlag *rpTableWF, const size_t rnSize, const UnicodePairFlag rnFlag );
+ virtual ~oneToOneMappingWithFlag();
+
+ // make index for fast search
+ void makeIndex();
+
+ // index search
+ virtual sal_Unicode find( const sal_Unicode nKey ) const;
+protected:
+ UnicodePairWithFlag *mpTableWF;
+ UnicodePairFlag mnFlag;
+ UnicodePairWithFlag **mpIndex[256];
+ bool mbHasIndex;
+};
+
+} } } }
+
+#endif // _I18N_TRANSLITERATION_ONETOONEMAPPING_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nutil/paper.hxx b/include/i18nutil/paper.hxx
new file mode 100644
index 000000000000..8847b294fbdb
--- /dev/null
+++ b/include/i18nutil/paper.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_I18NUTIL_PAPER_HXX
+#define INCLUDED_I18NUTIL_PAPER_HXX
+
+#include "i18nutildllapi.h"
+#include <rtl/string.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+
+//!! WARNING: be aware of cui/source/tabpages/page.h where someone had the broken idea
+//!! of duplicating the values of this enum in order to use those defines within
+//!! src files.
+//!! Thus don't reorder the enum values here without changing the code there as well.
+enum Paper
+{
+ PAPER_A0,
+ PAPER_A1,
+ PAPER_A2,
+ PAPER_A3,
+ PAPER_A4,
+ PAPER_A5,
+ PAPER_B4_ISO,
+ PAPER_B5_ISO,
+ PAPER_LETTER,
+ PAPER_LEGAL,
+ PAPER_TABLOID,
+ PAPER_USER,
+ PAPER_B6_ISO,
+ PAPER_ENV_C4,
+ PAPER_ENV_C5,
+ PAPER_ENV_C6,
+ PAPER_ENV_C65,
+ PAPER_ENV_DL,
+ PAPER_SLIDE_DIA,
+ PAPER_SCREEN_4_3,
+ PAPER_C,
+ PAPER_D,
+ PAPER_E,
+ PAPER_EXECUTIVE,
+ PAPER_FANFOLD_LEGAL_DE,
+ PAPER_ENV_MONARCH,
+ PAPER_ENV_PERSONAL,
+ PAPER_ENV_9,
+ PAPER_ENV_10,
+ PAPER_ENV_11,
+ PAPER_ENV_12,
+ PAPER_KAI16,
+ PAPER_KAI32,
+ PAPER_KAI32BIG,
+ PAPER_B4_JIS,
+ PAPER_B5_JIS,
+ PAPER_B6_JIS,
+ PAPER_LEDGER,
+ PAPER_STATEMENT,
+ PAPER_QUARTO,
+ PAPER_10x14,
+ PAPER_ENV_14,
+ PAPER_ENV_C3,
+ PAPER_ENV_ITALY,
+ PAPER_FANFOLD_US,
+ PAPER_FANFOLD_DE,
+ PAPER_POSTCARD_JP,
+ PAPER_9x11,
+ PAPER_10x11,
+ PAPER_15x11,
+ PAPER_ENV_INVITE,
+ PAPER_A_PLUS,
+ PAPER_B_PLUS,
+ PAPER_LETTER_PLUS,
+ PAPER_A4_PLUS,
+ PAPER_DOUBLEPOSTCARD_JP,
+ PAPER_A6,
+ PAPER_12x11,
+ PAPER_A7,
+ PAPER_A8,
+ PAPER_A9,
+ PAPER_A10,
+ PAPER_B0_ISO,
+ PAPER_B1_ISO,
+ PAPER_B2_ISO,
+ PAPER_B3_ISO,
+ PAPER_B7_ISO,
+ PAPER_B8_ISO,
+ PAPER_B9_ISO,
+ PAPER_B10_ISO,
+ PAPER_ENV_C2,
+ PAPER_ENV_C7,
+ PAPER_ENV_C8,
+ PAPER_ARCHA,
+ PAPER_ARCHB,
+ PAPER_ARCHC,
+ PAPER_ARCHD,
+ PAPER_ARCHE,
+ PAPER_SCREEN_16_9,
+ PAPER_SCREEN_16_10
+};
+
+// defined for 'equal size' test with the implementation array
+#define NUM_PAPER_ENTRIES (PAPER_SCREEN_16_10 - PAPER_A0 + 1)
+
+// ---------
+// - Paper -
+// ---------
+
+class I18NUTIL_DLLPUBLIC PaperInfo
+{
+ Paper m_eType;
+ long m_nPaperWidth; // width in 100thMM
+ long m_nPaperHeight; // height in 100thMM
+public:
+ PaperInfo(Paper eType);
+ PaperInfo(long nPaperWidth, long nPaperHeight);
+
+ Paper getPaper() const { return m_eType; }
+ long getWidth() const { return m_nPaperWidth; }
+ long getHeight() const { return m_nPaperHeight; }
+ bool sloppyEqual(const PaperInfo &rOther) const;
+ bool doSloppyFit();
+
+ static PaperInfo getSystemDefaultPaper();
+ static PaperInfo getDefaultPaperForLocale(const ::com::sun::star::lang::Locale & rLocale);
+
+ static Paper fromPSName(const OString &rName);
+ static OString toPSName(Paper eType);
+
+ static long sloppyFitPageDimension(long nDimension);
+};
+
+#endif // INCLUDED_I18NUTIL_PAPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nutil/scripttypedetector.hxx b/include/i18nutil/scripttypedetector.hxx
new file mode 100644
index 000000000000..cf3b9b71e11b
--- /dev/null
+++ b/include/i18nutil/scripttypedetector.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 _I18N_SCRIPTTYPEDETECTOR_HXX_
+#define _I18N_SCRIPTTYPEDETECTOR_HXX_
+
+#include "i18nutildllapi.h"
+#include <rtl/ustring.hxx>
+
+class I18NUTIL_DLLPUBLIC ScriptTypeDetector
+{
+public:
+ static sal_Int32 beginOfScriptDirection( const OUString& Text, sal_Int32 nPos, sal_Int16 scriptDirection );
+ static sal_Int32 endOfScriptDirection( const OUString& Text, sal_Int32 nPos, sal_Int16 scriptDirection );
+ static sal_Int16 getScriptDirection( const OUString& Text, sal_Int32 nPos, sal_Int16 defaultScriptDirection );
+ static sal_Int32 beginOfCTLScriptType( const OUString& Text, sal_Int32 nPos );
+ static sal_Int32 endOfCTLScriptType( const OUString& Text, sal_Int32 nPos );
+ static sal_Int16 getCTLScriptType( const OUString& Text, sal_Int32 nPos );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nutil/unicode.hxx b/include/i18nutil/unicode.hxx
new file mode 100644
index 000000000000..7da0f5329803
--- /dev/null
+++ b/include/i18nutil/unicode.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_I18NUTIL_UNICODE_HXX
+#define INCLUDED_I18NUTIL_UNICODE_HXX
+
+#include <com/sun/star/i18n/UnicodeScript.hpp>
+#include <sal/types.h>
+#include <unicode/uscript.h>
+#include "i18nutildllapi.h"
+
+typedef struct _ScriptTypeList {
+ sal_Int16 from;
+ sal_Int16 to;
+ sal_Int16 value;
+} ScriptTypeList;
+
+class I18NUTIL_DLLPUBLIC unicode
+{
+public:
+
+ static sal_Int16 SAL_CALL getUnicodeType( const sal_Unicode ch );
+ static sal_Int16 SAL_CALL getUnicodeScriptType( const sal_Unicode ch, ScriptTypeList *typeList = NULL, sal_Int16 unknownType = 0 );
+ static sal_Unicode SAL_CALL getUnicodeScriptStart(com::sun::star::i18n::UnicodeScript type);
+ static sal_Unicode SAL_CALL getUnicodeScriptEnd(com::sun::star::i18n::UnicodeScript type);
+ static sal_uInt8 SAL_CALL getUnicodeDirection( const sal_Unicode ch );
+ static sal_Bool SAL_CALL isUpper( const sal_Unicode ch);
+ static sal_Bool SAL_CALL isLower( const sal_Unicode ch);
+ static sal_Bool SAL_CALL isDigit( const sal_Unicode ch);
+ static sal_Bool SAL_CALL isControl( const sal_Unicode ch);
+ static sal_Bool SAL_CALL isPrint( const sal_Unicode ch);
+ static sal_Bool SAL_CALL isAlpha( const sal_Unicode ch);
+ static sal_Bool SAL_CALL isSpace( const sal_Unicode ch);
+ static sal_Bool SAL_CALL isWhiteSpace( const sal_Unicode ch);
+ static sal_Bool SAL_CALL isAlphaDigit( const sal_Unicode ch);
+
+ //Map an ISO 15924 script code to Latin/Asian/Complex/Weak
+ static sal_Int16 SAL_CALL getScriptClassFromUScriptCode(UScriptCode eScript);
+
+ //Return a language that can be written in a given ISO 15924 script code
+ static OString SAL_CALL getExemplerLanguageForUScriptCode(UScriptCode eScript);
+};
+
+#endif
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nutil/widthfolding.hxx b/include/i18nutil/widthfolding.hxx
new file mode 100644
index 000000000000..481239deca88
--- /dev/null
+++ b/include/i18nutil/widthfolding.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_I18NUTIL_WIDTHFOLDING_HXX
+#define INCLUDED_I18NUTIL_WIDTHFOLDING_HXX
+
+#include <sal/types.h>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <i18nutil/oneToOneMapping.hxx>
+#include "i18nutildllapi.h"
+
+namespace com { namespace sun { namespace star { namespace i18n {
+
+#define WIDTHFOLDNIG_DONT_USE_COMBINED_VU 0x01
+
+class I18NUTIL_DLLPUBLIC widthfolding
+{
+public:
+ static oneToOneMapping& getfull2halfTable();
+ static oneToOneMapping& gethalf2fullTable();
+
+ static oneToOneMapping& getfull2halfTableForASC();
+ static oneToOneMapping& gethalf2fullTableForJIS();
+
+ static oneToOneMapping& getfullKana2halfKanaTable();
+ static oneToOneMapping& gethalfKana2fullKanaTable();
+
+ static OUString decompose_ja_voiced_sound_marks(const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset, sal_Bool useOffset);
+ static sal_Unicode decompose_ja_voiced_sound_marksChar2Char (sal_Unicode inChar);
+ static OUString compose_ja_voiced_sound_marks(const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset, sal_Bool useOffset, sal_Int32 nFlags = 0 );
+ static sal_Unicode getCompositionChar(sal_Unicode c1, sal_Unicode c2);
+};
+
+
+} } } }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/jvmaccess/classpath.hxx b/include/jvmaccess/classpath.hxx
new file mode 100644
index 000000000000..1cc8d83ab348
--- /dev/null
+++ b/include/jvmaccess/classpath.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_JVMACCESS_CLASSPATH_HXX
+#define INCLUDED_JVMACCESS_CLASSPATH_HXX
+
+#include "jvmaccessdllapi.h"
+#include "sal/config.h"
+#include "com/sun/star/uno/Reference.hxx"
+
+#include "jni.h"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class XComponentContext;
+} } } }
+
+namespace jvmaccess {
+
+/**
+ Helper functions for class path handling.
+*/
+class JVMACCESS_DLLPUBLIC ClassPath {
+public:
+ /**
+ translates a class path into a java.net.URL[] instance.
+
+ @param context
+ a component context; must not be null.
+
+ @param environment
+ a JNI environment; must not be null.
+
+ @param classPath
+ a list of zero or more internal (see the
+ com.sun.star.uri.ExternalUriReferenceTranslator service) URI references,
+ where any space characters (U+0020) are ignored (and, in particular,
+ separate adjacent URI references). Any vnd.sun.star.expand URL
+ references in the list are expanded using the
+ com.sun.star.util.theMacroExpander singleton of the given context.
+
+ @returns
+ a local reference to a java.net.URL[] instance containing the external
+ (see the com.sun.star.uri.ExternalUriReferenceTranslator service)
+ equivalents of all the URI references in the given classPath. If null, a
+ (still pending) JNI exception occurred.
+
+ @throws com::sun::star::uno::RuntimeException
+ */
+ static inline ::jobjectArray
+ translateToUrls(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & context,
+ ::JNIEnv * environment, OUString const & classPath)
+ {
+ return
+ static_cast< ::jobjectArray >(
+ doTranslateToUrls(context, environment, classPath));
+ }
+
+ /**
+ loads a class via a java.net.URLClassLoader.
+
+ @param context
+ a component context; must not be null.
+
+ @param environment
+ a JNI environment; must not be null.
+
+ @param classPath
+ a list of zero or more internal (see the
+ com.sun.star.uri.ExternalUriReferenceTranslator service) URI references,
+ where any space characters (U+0020) are ignored (and, in particular,
+ separate adjacent URI references). Any vnd.sun.star.expand URL
+ references in the list are expanded using the
+ com.sun.star.util.theMacroExpander singleton of the given context.
+
+ @param name
+ the Java binary name of the class to load.
+
+ @returns
+ a local reference to a java.lang.Class instance. If null, a (still
+ pending) JNI exception occurred.
+
+ @throws com::sun::star::uno::RuntimeException
+ */
+ static inline ::jclass loadClass(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & context,
+ ::JNIEnv * environment, OUString const & classPath,
+ OUString const & name)
+ {
+ return
+ static_cast< ::jclass >(
+ doLoadClass(context, environment, classPath, name));
+ }
+
+private:
+ ClassPath(); // not defined
+ ClassPath(ClassPath &); // not defined
+ ~ClassPath(); // not defined
+ void operator =(ClassPath &); // not defined
+
+ // Functions that replace JNIEnv, jobjectArray, and jclass with void *, so
+ // that their mangled C++ names do not depend on the JDK version used at
+ // compile time:
+
+ static void * doTranslateToUrls(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & context,
+ void * environment, OUString const & classPath);
+
+ static void * doLoadClass(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & context,
+ void * environment, OUString const & classPath,
+ OUString const & name);
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/jvmaccess/jvmaccessdllapi.h b/include/jvmaccess/jvmaccessdllapi.h
new file mode 100644
index 000000000000..0f6651b5dbf8
--- /dev/null
+++ b/include/jvmaccess/jvmaccessdllapi.h
@@ -0,0 +1,24 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_JVMACCESS_JVMACCESSDLLAPI_H
+#define INCLUDED_JVMACCESS_JVMACCESSDLLAPI_H
+
+#include <sal/types.h>
+
+#if defined JVMACCESS_DLLIMPLEMENTATION
+# define JVMACCESS_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+# define JVMACCESS_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define JVMACCESS_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/jvmaccess/unovirtualmachine.hxx b/include/jvmaccess/unovirtualmachine.hxx
new file mode 100644
index 000000000000..4d618d14d863
--- /dev/null
+++ b/include/jvmaccess/unovirtualmachine.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_JVMACCESS_UNOVIRTUALMACHINE_HXX
+#define INCLUDED_JVMACCESS_UNOVIRTUALMACHINE_HXX
+
+#include "jvmaccessdllapi.h"
+#include "sal/config.h"
+#include "salhelper/simplereferenceobject.hxx"
+#include "rtl/ref.hxx"
+
+namespace jvmaccess {
+
+class VirtualMachine;
+
+/** An encapsulating wrapper around a Java virtual machine and an appropriate
+ UNO class loader.
+ */
+class JVMACCESS_DLLPUBLIC UnoVirtualMachine: public salhelper::SimpleReferenceObject {
+public:
+ /** An exception indicating failure to create a UnoVirtualMachine.
+ */
+ class JVMACCESS_DLLPUBLIC CreationException
+ {
+ public:
+ CreationException();
+
+ CreationException(CreationException const &);
+
+ virtual ~CreationException();
+
+ CreationException & operator =(CreationException const &);
+ };
+
+ /** Create a wrapper around a Java virtual machine and an appropriate UNO
+ class loader.
+
+ @param virtualMachine
+ A Java virtual machine wrapper. Must not be null.
+
+ @param classLoader
+ A local or global JNI reference, relative to the given virtualMachine,
+ to an appropriate UNO class loader instance. Must not be null. This
+ parameter should be of type jobject, not void *, but the exact
+ definition of jobject is different for different JDK versions, so that
+ the mangled C++ name of the constructor would depend on the JDK version
+ used at compile time.
+
+ @exception CreationException
+ Thrown in case creation fails (due to a JNI problem).
+ */
+ UnoVirtualMachine(
+ rtl::Reference< jvmaccess::VirtualMachine > const & virtualMachine,
+ void * classLoader);
+
+ /** Get the Java virtual machine wrapper.
+
+ @return
+ The Java virtual machine wrapper. Will never be null.
+ */
+ rtl::Reference< jvmaccess::VirtualMachine > getVirtualMachine() const;
+
+ /** Get the UNO class loader.
+
+ @return
+ A global JNI reference to the UNO class loader. (The JNI reference must
+ not be deleted by client code.) Will never be null. This should be of
+ type jobject, not void *, but the exact definition of jobject is
+ different for different JDK versions, so that the mangled C++ name of
+ the function would depend on the JDK version used at compile time.
+ */
+ void * getClassLoader() const;
+
+private:
+ UnoVirtualMachine(UnoVirtualMachine &); // not defined
+ void operator =(UnoVirtualMachine &); // not defined
+
+ virtual ~UnoVirtualMachine();
+
+ rtl::Reference< jvmaccess::VirtualMachine > m_virtualMachine;
+ void * m_classLoader;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/jvmaccess/virtualmachine.hxx b/include/jvmaccess/virtualmachine.hxx
new file mode 100644
index 000000000000..57ac5ead39f4
--- /dev/null
+++ b/include/jvmaccess/virtualmachine.hxx
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_JVMACCESS_VIRTUALMACHINE_HXX
+#define INCLUDED_JVMACCESS_VIRTUALMACHINE_HXX
+
+#include "jvmaccessdllapi.h"
+#include "rtl/ref.hxx"
+#include "salhelper/simplereferenceobject.hxx"
+
+#include "jni.h"
+
+namespace jvmaccess {
+
+/** An encapsulating wrapper around a Java virtual machine.
+ */
+class JVMACCESS_DLLPUBLIC VirtualMachine: public salhelper::SimpleReferenceObject
+{
+public:
+ /** A helper to attach a thread to a Java virtual machine.
+
+ @descr
+ Upon construction of a guard the current thread is attached to the
+ virtual machine, and upon destruction of the guard the thread is
+ detached again. For any one thread, multiple instances of this class
+ may be used in a stack-like fashion (care is taken to only really
+ detach the thread from the virtual machine upon destruction of the guard
+ at the bottom of the stack).
+ */
+ class JVMACCESS_DLLPUBLIC AttachGuard
+ {
+ public:
+ /** An exception indicating failure to create an AttachGuard.
+ */
+ class JVMACCESS_DLLPUBLIC CreationException
+ {
+ public:
+ CreationException();
+
+ CreationException(CreationException const &);
+
+ virtual ~CreationException();
+
+ CreationException & operator =(CreationException const &);
+ };
+
+ /** Attach the current thread to a virtual machine.
+
+ @param rMachine
+ The virtual machine to attach to. Must not be a null reference.
+
+ @exception CreationException
+ Thrown in case attaching fails (due to a JNI problem).
+ */
+ explicit AttachGuard(rtl::Reference< VirtualMachine > const & rMachine);
+
+ /** Detach the current thread from the virtual machine again.
+ */
+ ~AttachGuard();
+
+ /** Get a JNI environment pointer for the current thread.
+
+ @return
+ A valid JNI environment pointer. Will never be null.
+ */
+ inline JNIEnv * getEnvironment() const { return m_pEnvironment; }
+
+ private:
+ AttachGuard(AttachGuard &); // not implemented
+ void operator =(AttachGuard); // not implemented
+
+ rtl::Reference< VirtualMachine > m_xMachine;
+ JNIEnv * m_pEnvironment;
+ bool m_bDetach;
+ };
+
+ /** Create a wrapper around a Java virtual machine.
+
+ @param pVm
+ A JNI pointer to virtual machine. Must not be null.
+
+ @param nVersion
+ The JNI version of the virtual machine pointed to by pVm. Must be at
+ least JNI_VERSION_1_2. This parameter should be of type jint, not int,
+ but at least on some platforms the definition of jint changed from
+ JDK 1.3 (long) to JDK 1.4 (int), so that the mangled C++ name of the
+ constructor would depend on the JDK version used at compile time.
+
+ @param bDestroy
+ Whether to destroy the virtual machine when destructing the wrapper
+ (i.e., whether the wrapper owns the virtual machine pointed to by pVm).
+
+ @param pMainThreadEnv
+ A valid JNI environment pointer for the current thread; must not be
+ null. The current thread must be "initially attached" to the virtual
+ machine while this constructor is being called (i.e., it must be the
+ thread that has called JNI_CreateJavaVM in case the virtual machine has
+ been started via the JNI Invocation API, and it must not already have
+ called DetachCurrentThread; or it must be executing native code called
+ from a "primordial" virtual machine). This environment pointer was
+ formerly used to obtain a reference to the thread's current context
+ class loader (java.lang.Thread.getCurrentClassLoader; if later a native
+ thread was attached to the virtual machine, that thread's context class
+ loader would be null, so the AttachGuard first of all set it to the
+ saved value; this feature has been removed again for performance reasons
+ and because the default context class loader is often not useful, so
+ that code relying on a context class loader has to set one explicitly,
+ anyway). This parameter is currently unused (but may be used again in
+ the future).
+ */
+ VirtualMachine(JavaVM * pVm, int nVersion, bool bDestroy,
+ JNIEnv * pMainThreadEnv);
+
+private:
+ VirtualMachine(VirtualMachine &); // not implemented
+ void operator =(VirtualMachine); // not implemented
+
+ virtual ~VirtualMachine();
+
+ JNIEnv * attachThread(bool * pAttached) const;
+
+ void detachThread() const;
+
+ JavaVM * m_pVm;
+ jint m_nVersion;
+ bool m_bDestroy;
+
+ friend class AttachGuard; // to access attachThread, detachThread
+};
+
+}
+
+#endif // INCLUDED_JVMACCESS_VIRTUALMACHINE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/jvmfwk/framework.h b/include/jvmfwk/framework.h
new file mode 100644
index 000000000000..f1399e0b88f1
--- /dev/null
+++ b/include/jvmfwk/framework.h
@@ -0,0 +1,835 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+/** @HTML */
+
+#ifndef INCLUDED_JVMFWK_FRAMEWORK_H
+#define INCLUDED_JVMFWK_FRAMEWORK_H
+
+#include "jvmfwkdllapi.h"
+#include "rtl/ustring.h"
+#include "osl/mutex.h"
+#include "jni.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file
+ <p>This library can operate in two modes, application mode and direct mode.</p>
+
+
+ <h2>Application Mode</h2>
+ In application mode the Java related settings are stored in files.
+ There are currently three files which need to be accessed. They are determined
+ by bootstrap parameters:</p>
+ <dl>
+ <dt>UNO_JAVA_JFW_VENDOR_SETTINGS</dt>
+ <dd>contains vendor and version information about JREs as well as the
+ location of plugin-libraries which are responsible for providing information
+ about these JREs as well as starting the VMs.</dd>
+ <dt>UNO_JAVA_JFW_USER_DATA</dt>
+ <dd>The file contains settings for a particular user. One can use the macro
+ $SYSUSERCONFIG in the URL which expands to a directory whery the user's data are
+ kept. On UNIX this would be the home directory and on Windows some sub-directory
+ of the &quot;Documents and Settings&quot; folder.The content of this file is an
+ implementation detail and may change in the future.</dd>
+ <dt>UNO_JAVA_JFW_SHARED_DATA</dt>
+ <dd>The file contains settings valid for all users. If a user changes a setting
+ then it takes precedence over the setting from UNO_JAVA_JFW_SHARED_DATA.
+ The content of this file is an implementation detail and may change in the future.</dd>
+ </dl>
+
+ <p>The values for these parameters must be file URLs and include the file name, for
+ example:<br>
+ file:///d:/MyApp/javavendors.xml<br>
+ All files are XML files and must have the extension .xml.</p>
+ <p>
+ Modifying the shared settings is currently not supported by the framework. To provide
+ Java settings for all users one can run OOo and change the settings in the
+ options dialog. These settings are made persistent in the UNO_JAVA_JFW_USER_DATA.
+ The file can then be copied into the base installation.
+ Other users will use automatically these data but can override the settings in
+ the options dialog. This mechanism may change in the future.
+ </p>
+ <p>If shared Java settings are not supported by an application then it is not
+ necessary to specify the bootstrap parameter <code>UNO_JAVA_JFW_SHARED_DATA</code>.
+ </p>
+
+ <p>Setting the class path used by a Java VM should not be necesarry. The locations
+ of Jar files should be knows by a class loader. If a jar file depends on another
+ jar file then it can be referenced in the manifest file of the first jar. However,
+ a user may add jars to the class path by using this API. If it becomes necessary
+ to add files to the class path which is to be used by all users then one can use
+ the bootrap parameter UNO_JAVA_JFW_CLASSPATH_URLS. The value contains of file URLs
+ which must be separated by spaces.</p>
+
+
+ <h2>Direct Mode</h2>
+
+ <p>The direct mode is intended for a scenario where no configuration files
+ are available and a Java VM shall be run. That is,
+ the files containing the user and shared settings are not specified by the
+ bootstrap parameters UNO_JAVA_JFW_SHARED_DATA and UNO_JAVA_JFW_USER_DATA.
+ For example, tools, such as regcomp, may use this framework in a build
+ environment. Then one would want to use settings which have been specified
+ by the build environment. The framework would automatically use the
+ current settings when they change in the environment.
+ </p>
+
+ <p> Here are examples how regcomp could be invoked using bootstrap parameters:
+ </p>
+ <p>
+ regcomp -env:UNO_JAVA_JFW_JREHOME=file:///d:/j2re1.4.2
+ -env:&quot;UNO_JAVA_JFW_CLASSPATH=d:\\solver\\bin\\classes.jar;d:\\solver\\bin\\jurt.jar&quot;
+ -register ....
+ </p>
+ <p>If UNO_JAVA_JFW_VENDOR_SETTINGS is not set then a plugin library must be specified. For example:</p>
+ <p>
+ regcomp -env:UNO_JAVA_JFW_JREHOME=file:///d:/j2re1.4.2
+ -env:&quot;UNO_JAVA_JFW_CLASSPATH=d:\\solver\\bin\\classes.jar;d:\\solver\\bin\\jurt.jar&quot;
+ -env:UNO_JAVA_JFW_PLUGIN=file:\\solver\\bin\\libsunjavaplugin.dll -register ....
+ </p>
+ <p>Additionall parameters for the Java VM can be provided. For every parameter
+ a seperate bootstrap parameter must be specified. The names are
+ <code>UNO_JAVA_JFW_PARAMETER_X</code>, where X is 1,2, .. n. For example:</p>
+ <p>
+ regcomp -env:UNO_JAVA_JFW_PARAMETER_1=-Xdebug
+ -env:UNO_JAVA_JFW_PARAMETER_2=-Xrunjdwp:transport=dt_socket,server=y,address=8100
+ -env:UNO_JAVA_JFW_JREHOME=file:///d:/j2re1.4.2
+ -env:&quot;UNO_JAVA_JFW_CLASSPATH=d:\\solver\\bin\\classes.jar;d:\\solver\\bin\\jurt.jar&quot;
+ -register ....</p>
+ <p>
+ Here is a complete list of the bootstrap parameter for the direct mode:
+ </p>
+ <dl>
+ <dt>UNO_JAVA_JFW_JREHOME</dt>
+ <dd>Specifies a file URL to a JRE installation.It must ALWAYS be specified
+ in direct mode</dd>
+ <dt>UNO_JAVA_JFW_ENV_JREHOME</dt>
+ <dd>Setting this parameter, for example to &quot;1&quot; or &quot;true&quot;,
+ causes the framework to use the environment variable JAVA_HOME. It is expected
+ that JAVA_HOME contains a system path rather than a file URL. This parameter
+ and UNO_JAVA_JFW_JREHOME are mutually exclusive</dd>
+ <dt>UNO_JAVA_JFW_CLASSPATH</dt>
+ <dd>Contains the class path which is to be used by the VM. Special character,
+ such as '\','{','}','$' must be preceded with '\'. See documentation about the
+ bootstrap parameter.</dd>
+ <dt>UNO_JAVA_JFW_ENV_CLASSPATH</dt>
+ <dd>Setting this parameter,for example to &quot;1&quot; or &quot;true&quot;,
+ causes the framework to use the
+ environment variable CLASSPATH. If this variable and UNO_JAVA_JFW_CLASSPATH are
+ set then the class path is composed from UNO_JAVA_JFW_CLASSPATH and the environment
+ variable CLASSPATH.</dd>
+ <dt>UNO_JAVA_JFW_PLUGIN</dt>
+ <dd>Specified a file URL to a plugin library. If this variable is provided
+ then a javavendors.xml is ignored. It must be provided if no
+ javavendors.xml is available.</dd>
+ <dt>UNO_JAVA_JFW_PARAMETER_X</dt>
+ <dd>Specifies a parameter for the Java VM. The X is replaced by
+ non-negative natural numbers starting with 1.</dd>
+ </dl>
+
+ <p>A note about bootstrap parameters. The implementation of the bootstrap
+ parameter mechanism interprets the characters '\', '$', '{', '}' as
+ escape characters. Thats why the Windows path contain double back-slashes.
+ One should also take into account that a console may have also special
+ escape characters.</p>
+
+ <h2>What mode is used</h2>
+ <p>
+ The default mode is application mode. If at least one bootstrap parameter
+ for the direct mode is provided then direct mode is used. </p>
+
+ <p>
+ All settings made by this API are done for the current user if not
+ mentioned differently.</p>
+
+ <h2>Other bootstrap variables</h2>
+ <dl>
+ <dt>JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY</dt>
+ <dd>This is a unofficial variable which was introduced to workaround external issues.
+ It may be removed in the future. By setting it to 1, the framework will not try to
+ find out if the system is configured to use accessibility tools or if a JRE has an
+ accessibiliy bridge installed</dd>
+ </dl>
+*/
+
+/** indicates that a JRE has an accessibility bridge installed.
+ <p>
+ The flag is used with JavaInfo::nFeatures.</p>
+ */
+#define JFW_FEATURE_ACCESSBRIDGE 0x1l
+/** indicates that there must be an environment set up before the Java process
+ runs.
+ <p>Therefore, when a Java is selected in OO then the office must be
+ restarted, so that the changes can take effect.</p>
+ */
+#define JFW_REQUIRE_NEEDRESTART 0x1l
+
+/** error codes which are returned by functions of this API.
+ */
+typedef enum _javaFrameworkError
+{
+ JFW_E_NONE,
+ JFW_E_ERROR,
+ JFW_E_INVALID_ARG,
+ JFW_E_NO_SELECT,
+ JFW_E_INVALID_SETTINGS,
+ JFW_E_NEED_RESTART,
+ JFW_E_RUNNING_JVM,
+ JFW_E_JAVA_DISABLED,
+ JFW_E_NO_PLUGIN,
+ JFW_E_NOT_RECOGNIZED,
+ JFW_E_FAILED_VERSION,
+ JFW_E_NO_JAVA_FOUND,
+ JFW_E_VM_CREATION_FAILED,
+ JFW_E_CONFIGURATION,
+ JFW_E_DIRECT_MODE
+} javaFrameworkError;
+
+/** an instance of this struct represents an installation of a Java
+ Runtime Environment (JRE).
+
+ <p>
+ Instances of this struct are created by the plug-in libraries which are used by
+ this framework (jvmfwk/vendorplugin.h). The memory of the instances is created
+ by <code>rtl_allocateMemory</code> (rtl/alloc.h). Therefore, the memory must
+ be freed by <code>rtl_freeMemory</code>. Also the contained members must be
+ freed particularly.
+ For convenience this API provides the function <code>jfw_freeJavaInfo</code>
+ which frees the objects properly. </p>
+ */
+struct _JavaInfo
+{
+ /** contains the vendor.
+
+ <p>string must be the same as the one obtained from the
+ Java system property <code>java.vendor</code>.
+ </p>
+ */
+ rtl_uString *sVendor;
+ /** contains the file URL to the installation directory.
+ */
+ rtl_uString *sLocation;
+ /** contains the version of this Java distribution.
+
+ <p>The version string must adhere to the rules
+ about how a version string has to be formed. These rules may
+ be vendor-dependent. Essentially the strings must syntactically
+ equal the Java system property <code>java.version</code>.
+ </p>
+ */
+ rtl_uString *sVersion;
+ /** indicates supported special features.
+
+ <p>For example, <code>JFW_FEATURE_ACCESSBRIDGE</code> indicates that
+ assistive technology tools are supported.</p>
+ */
+ sal_uInt64 nFeatures;
+ /** indicates requirments for running the java runtime.
+
+ <p>For example, it may be necessary to prepare the environment before
+ the runtime is created. That could mean, setting the
+ <code>LD_LIBRARY_PATH</code>
+ when <code>nRequirements</code> contains the flag
+ <code>JFW_REQUIRE_NEEDRESTART</code></p>
+ */
+ sal_uInt64 nRequirements;
+ /** contains data needed for the creation of the java runtime.
+
+ <p>There is no rule about the format and content of the sequence's
+ values. The plug-in libraries can put all data, necessary for
+ starting the java runtime into this sequence. </p>
+ */
+ sal_Sequence * arVendorData;
+};
+
+typedef struct _JavaInfo JavaInfo;
+
+/** frees the memory of a <code>JavaInfo</code> object.
+ @param pInfo
+ The object which is to be freed. It can be NULL;
+ */
+JVMFWK_DLLPUBLIC void SAL_CALL jfw_freeJavaInfo(JavaInfo *pInfo);
+
+
+/** compares two <code>JavaInfo</code> objects for equality.
+
+ <p>Two <code>JavaInfo</code> objects are said to be equal if the contained
+ members of the first <code>JavaInfo</code> are equal to their counterparts
+ in the second <code>JavaInfo</code> object. The equality of the
+ <code>rtl_uString</code> members is determined
+ by the respective comparison function (see
+ <code>OUString::equals</code>).
+ Similiarly the equality of the <code>sal_Sequence</code> is
+ also determined by a comparison
+ function (see <code>rtl::ByteSequence::operator ==</code>). </p>
+ <p>
+ Both argument pointers must be valid.</p>
+ @param pInfoA
+ the first argument.
+ @param pInfoB
+ the second argument which is compared with the first.
+ @return
+ sal_True - both object represent the same JRE.</br>
+ sal_False - the objects represend different JREs
+ */
+JVMFWK_DLLPUBLIC sal_Bool SAL_CALL jfw_areEqualJavaInfo(
+ JavaInfo const * pInfoA,JavaInfo const * pInfoB);
+
+/** determines if a Java Virtual Machine is already running.
+
+ <p>As long as the office and the JREs only support one
+ Virtual Machine per process the Java settings, particulary the
+ selected Java, are not effective immediately after changing when
+ a VM has already been running. That is, if a JRE A was used to start
+ a VM and then a JRE B is selected, then JRE B will only be used
+ after a restart of the office.</p>
+ <p>
+ By determining if a VM is running, the user can be presented a message,
+ that the changed setting may not be effective immediately.</p>
+
+ @param bRunning
+ [out] sal_True - a VM is running. <br/>
+ sal_False - no VM is running.
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALID_ARG the parameter <code>bRunning</code> was NULL.
+*/
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_isVMRunning(sal_Bool *bRunning);
+
+/** detects a suitable JRE and configures the framework to use it.
+
+ <p>Which JREs can be used is determined by the file javavendors.xml,
+ which contains version requirements, as well as information about available
+ plug-in libraries. Only these libraries are responsible for locating JRE
+ installations.</p>
+ <p>
+ JREs can be provided by different vendors. In order to find the JREs of
+ a certain vendor a plug-in library must be provided. There must be only one
+ library for one vendor. The names of locations of those libraries have to
+ be put into the javavendors.xml file.<br/>
+ The function uses the plug-in libraries to obtain information about JRE
+ installation and checks if they there is one among them that supports
+ a set of features (currently only accessibilty is possible). If none was
+ found then it also uses a list of paths, which have been registered
+ by <code>jfw_addJRELocation</code> or <code>jfw_setJRELocations</code>
+ to find JREs. Found JREs are examined in the same way.</p>
+ <p>
+ A JRE installation is only selected if it meets the version requirements.
+ Information about the selected JRE are made persistent so that
+ subsequent calls to <code>jfw_getSelectedJRE</code> returns this
+ information.</p>
+ <p>
+ While determining a proper JRE this function takes into account if a
+ user requires support for assistive technology tools. If user
+ need that support they have to set up their system accordingly. When support
+ for assistive technology is required, then the lists of
+ <code>JavaInfo</code> objects,
+ which are provided by the <code>getJavaInfo</code> functions of the plug-ins, are
+ examined for a suitable JRE. That is, the <code>JavaInfo</code> objects
+ from the list
+ obtained from the first plug-in, are examined. If no <code>JavaInfo</code>
+ object has the flag
+ <code>JFW_FEATURE_ACCESSBRIDGE</code> in the member <code>nFeatures</code>
+ then the
+ next plug-in is used to obtain a list of <code>JavaInfo</code> objects.
+ This goes on until a <code>JavaInfo</code> object was found which
+ represents a suitable JRE. Or neither plug-in provided such a
+ <code>JavaInfo</code> object. In that case the first
+ <code>JavaInfo</code> object from the first plug-in is used to determine
+ the JRE which is to be used.</p>
+ <p>
+ If there is no need for the support of assistive technology tools then
+ the first <code>JavaInfo</code> object from the list obtained by the
+ first plug-in is used. If this plug-in does not find any JREs then the
+ next plug-in is used, and so on.</p>
+
+ @param ppInfo
+ [out] a <code>JavaInfo</code> pointer, representing the selected JRE.
+ The caller has to free it by calling <code>jfw_freeJavaInfo<code>. The
+ <code>JavaInfo</code> is for informational purposes only. It is not
+ necessary to call <code>jfw_setSelectedJRE</code> afterwards.<br/>
+ <code>ppInfo</code>can be NULL. If <code>*ppInfo</code> is not null, then it is
+ overwritten, without attempting to free <code>*ppInfo</code>.
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_ERROR an error occurred. <br/>
+ JFW_E_NO_PLUGIN a plug-in library could not be found.<br/>
+ JFW_E_NO_JAVA_FOUND no JRE was found that meets the requirements.</br>
+ JFW_E_DIRECT_MODE the function cannot be used in this mode. </br>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo);
+
+/** provides information about all availabe JRE installations.
+
+ <p>The function determines dynamically what JREs are available. It uses
+ the plug-in libraries to provide lists of available <code>JavaInfo</code>
+ objects where each object represents a JRE (see vendorplugin.h,
+ getAllJavaInfos). It also uses a list of paths, which have been registered
+ by <code>jfw_addJRELocation</code> or <code>jfw_setJRELocations</code>.
+ It is checked if the path still contains a valid JRE and if so the respective
+ <code>JavaInfo</code> object will be appended to the array unless there is
+ already an equal object.</p>
+
+ @param parInfo
+ [out] on returns it contains a pointer to an array of <code>JavaInfo</code>
+ pointers.
+ The caller must free the array with <code>rtl_freeMemory</code> and each
+ element of the array must be freed with <code>jfw_freeJavaInfo</code>.
+ @param pSize
+ [out] on return contains the size of array returned in <code>parInfo</code>.
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALID_ARG at least on of the parameters was NULL<br/>
+ JFW_E_ERROR an error occurred. <br/>
+ JFW_E_NO_PLUGIN a plug-in library could not be found.<br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.
+*/
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_findAllJREs(
+ JavaInfo ***parInfo, sal_Int32 *pSize);
+
+/** determines if a path points to a Java installation.
+
+ <p>If the path belongs to a JRE installation then it returns the
+ respective <code>JavaInfo</code> object. The function uses the
+ <code>getJavaInfoByPath</code> function of the plug-ins to obtain the
+ <code>JavaInfo</code> object. Only if the JRE found at the specified location
+ meets the version requirements as specified in the javavendors.xml file a
+ <code>JavaInfo</code> object is returned.<br/>
+ <p>
+ The functions only checks if a JRE exists but does not modify any settings.
+ To make the found JRE the &quot;selected JRE&quot; one has
+ to call <code>jfw_setSelectedJRE</code>.</p>
+
+ @param pPath
+ [in] a file URL to a directory.
+ @param pInfo
+ [out] the <code>JavaInfo</code> object which represents a JRE found at the
+ location specified by <code>pPath</code>
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALID_ARG at least on of the parameters was NULL<br/>
+ JFW_E_ERROR an error occurred. <br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.</br>
+ JFW_E_NO_PLUGIN a plug-in library could not be found.<br/>
+ JFW_E_NOT_RECOGNIZED neither plug-in library could detect a JRE. <br/>
+ JFW_E_FAILED_VERSION a JRE was detected but if failed the version
+ requirements as determined by the javavendors.xml
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getJavaInfoByPath(
+ rtl_uString *pPath, JavaInfo **ppInfo);
+
+
+/** starts a Java Virtual Machine (JVM).
+
+ <p>The function uses the current settings to start a JVM. The actual
+ start-up code, however, is provided by the plug-in libraries. The setting
+ of the &quot;selected Java&quot; contains the information as to what vendor
+ the respective JRE comes from. In the javavendors.xml there is a mapping of
+ vendor names to the respective plug-in libraries.</p>
+ <p>
+ The function ultimately calls <code>startJavaVirtualMachine</code> from
+ the plug-in library.</p>
+ <p>
+ The <code>arOptions</code>
+ argument contains start arguments which are passed in JavaVMOption structures
+ to the VM during its creation. These
+ could be things, such as language settings, proxy settings or any other
+ properties which shall be obtainable by
+ <code>java.lang.System.getProperties</code>. One can also pass options which
+ have a certain meaning to the runtime behaviour such as -ea or -X... However,
+ one must be sure that these options can be interpreted by the VM.<br/>
+ The class path cannot be set this way. The class path is internally composed by
+ the paths to archives in a certain directory, which is preconfigured in
+ the internal data store and the respective user setting (see
+ <code>jfw_setUserClassPath</code>.</p>
+ <p>
+ If a JRE was selected at runtime which was different from the previous
+ setting and that JRE needs a prepared environment, for example an adapted
+ <code>LD_LIBRARY_PATH</code> environment variable, then the VM will not be
+ created and JFW_E_NEED_RESTART error is returned. If a VM is already running
+ then a JFW_E_RUNNING_JVM is returned.</p>
+
+ @param pInfo
+ [in] optional pointer to a specific JRE; must be caller-freed if not NULL
+ @param arOptions
+ [in] the array containing additional start arguments or NULL.
+ @param nSize
+ [in] the size of the array <code>arOptions</code>.
+ @param ppVM
+ [out] the <code>JavaVM</code> pointer.
+ @param ppEnv
+ [out] the <code>JNIenv</code> pointer.
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALID_ARG <code>ppVM</code>, <code>ppEnv</code> are NULL or
+ <code>arOptions</code> was NULL but <code>nSize</code> was greater 0.<br/>
+ JFW_E_ERROR an error occurred. <br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.</br>
+ JFW_E_NO_PLUGIN the plug-in library responsible for creating the VM
+ could not be found.<br/>
+ JFW_E_JAVA_DISABLED the use of Java is currently disabled. <br/>
+ JFW_E_NO_SELECT there is no JRE selected yet. <br/>
+ JFW_E_RUNNIN_JVM there is already a VM running.<br/>
+ JFW_E_INVALID_SETTINGS the javavendors.xml has been changed and no
+ JRE has been selected afterwards. <br/>
+ JFW_E_NEED_RESTART in the current process a different JRE has been selected
+ which needs a prepared environment, which has to be done before the office
+ process. Therefore the new JRE may not be used until the office was restarted.<br/>
+ JFW_E_NEED_RESTART is also returned when Java was disabled at the beginning and
+ then the user enabled it. If then the selected JRE has the requirement
+ JFW_REQUIRE_NEEDRESTART then this error is returned. </br>
+ JFW_E_VM_CREATION_FAILED the creation of the JVM failed. The creation is performed
+ by a plug-in library and not by this API.
+ JFW_E_FAILED_VERSION the &quot;Default Mode&quot; is active. The JRE determined by
+ <code>JAVA_HOME</code>does not meet the version requirements.
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_startVM(
+ JavaInfo const * pInfo, JavaVMOption * arOptions, sal_Int32 nSize,
+ JavaVM ** ppVM, JNIEnv ** ppEnv);
+
+/** determines the JRE that is to be used.
+
+ <p>When calling <code>jfw_startVM</code> then a VM is startet from
+ the JRE that is determined by this function.<br/>
+ It is not verified if the JRE represented by the <code>JavaInfo</code>
+ argument meets the requirements as specified by the javavendors.xml file.
+ However, usually one obtains the <code>JavaInfo</code> object from the
+ functions <code>jfw_findAllJREs</code> or <code>jfw_getJavaInfoByPath</code>,
+ which do verify the JREs and pass out only <code>JavaInfo</code> objects
+ which comply with the version requirements.</p>
+ <p>
+ If <code>pInfo</code> is NULL then the meaning is that no JRE will be
+ selected. <code>jfw_startVM</code> will then return
+ <code>JFW_E_NO_SELECT</code>.</p>
+
+ @param pInfo
+ [in] pointer to <code>JavaInfo</code> structure, containing data about a
+ JRE. The caller must still free <code>pInfo</code>.
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_ERROR An error occurred.<br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.<br/>
+ JFW_E_DIRECT_MODE the function cannot be used in this mode.
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setSelectedJRE(JavaInfo const *pInfo);
+
+
+/** provides information about the JRE that is to be used.
+
+ <p>If no JRE is currently selected then <code>ppInfo</code> will contain
+ NULL on return.</br>
+ If the value of the element <updated> in the javavendors.xml file was
+ changed since the time when the last Java was selected then this
+ function returns <code>JFW_E_INVALID_SETTINGS</code>. This could happen during
+ a product patch. Then new version requirements may be introduced, so that
+ the currently selected JRE may not meet these requirements anymore.
+ </p>
+ <p>In direct mode the function returns information about a JRE that was
+ set by the bootstrap parameter UNO_JAVA_JFW_JREHOME.
+ </p>
+ @param ppInfo
+ [out] on return it contains a pointer to a <code>JavaInfo</code> object
+ that represents the currently selected JRE. When <code>*ppInfo</code> is not
+ NULL then the function overwrites the pointer. It is not attempted to free
+ the pointer.
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALIDARG <code>ppInfo</code> is a NULL.<br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.<br/>
+ JFW_E_INVALID_SETTINGS the javavendors.xml has been changed and no
+ JRE has been selected afterwards. <br/>
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInfo);
+
+
+/** determines if Java can be used.
+
+ <p>If <code>bEnabled</code> is <code>sal_False</code> then a call
+ to jfw_startVM will result in an error with the errorcode
+ <code>JFW_E_JAVA_DISABLED</code></p>
+
+ @param bEnabled
+ [in] use of Java enabled/disabled.
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_ERROR An error occurred.<br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.<br/>
+ JFW_E_DIRECT_MODE the function cannot be used in this mode.
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setEnabled(sal_Bool bEnabled);
+
+/** provides the information if Java can be used.
+
+ <p>That is if the user enabled or disabled the use of Java.
+ </p>
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALIDARG pbEnabled is NULL<br/>
+ JFW_E_ERROR An error occurred.<br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.<br/>
+ JFW_E_DIRECT_MODE the function cannot be used in this mode.
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getEnabled(sal_Bool *pbEnabled);
+
+/** determines parameters which are passed to VM during its creation.
+
+ <p>The strings must be exactly as they are passed on the command line.
+ For example, one could pass<br/>
+ -Xdebug <br/>
+ -Xrunjdw:transport=dt_socket,server=y,address=8000<br/>
+ in order to enable debugging support.
+ </p>
+
+ @param arParameters
+ [in] contains the arguments. It can be NULL if nSize is 0.
+ @param nSize
+ [i] the size of <code>arArgs</code>
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALIDARG arArgs is NULL and nSize is not 0
+ JFW_E_ERROR An error occurred.<br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.<br/>
+ JFW_E_DIRECT_MODE the function cannot be used in this mode.
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setVMParameters(
+ rtl_uString ** arArgs, sal_Int32 nSize);
+
+/** obtains the currently used start parameters.
+
+ <p>The caller needs to free the returned array with
+ <code>rtl_freeMemory</code>. The contained strings must be released with
+ <code>rtl_uString_release</code>.
+ </p>
+
+ @param parParameters
+ [out] on returns contains a pointer to the array of the start arguments.
+ If *parParameters is not NULL then the value is overwritten.
+ @param pSize
+ [out] on return contains the size of array returned in
+ <code>parParameters</code>
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALIDARG parParameters or pSize are NULL<br/>
+ JFW_E_ERROR An error occurred.<br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.<br/>
+ JFW_E_DIRECT_MODE the function cannot be used in this mode.
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getVMParameters(
+ rtl_uString *** parParameters,
+ sal_Int32 * pSize);
+
+/** sets the user class path.
+
+ <p>When the VM is started then it is passed the class path. The
+ class path also contains the user class path set by this function.
+ The paths contained in <code>pCP</code> must be separated with a
+ system dependent path separator.</p>
+
+ @param pCP
+ [in] the user class path.
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALIDARG pCP is NULL.<br/>
+ JFW_E_ERROR An error occurred.<br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.<br/>
+ JFW_E_DIRECT_MODE the function cannot be used in this mode.
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setUserClassPath(rtl_uString * pCP);
+/** provides the value of the current user class path.
+
+ <p>The function returns an empty string if no user class path is set.
+ </p>
+
+ @param ppCP
+ [out] contains the user class path on return. If <code>*ppCP</code> was
+ not NULL then the value is overwritten. No attempt at freeing that string
+ is made.
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALIDARG ppCP is NULL.<br/>
+ JFW_E_ERROR An error occurred.<br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.<br/>
+ JFW_E_DIRECT_MODE the function cannot be used in this mode.
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getUserClassPath(rtl_uString ** ppCP);
+
+/** saves the location of a JRE.
+
+ <p>When <code>jfw_findAllJREs</code> is called then the paths added by this
+ function are evaluated. If the location still represents a
+ JRE then a <code>JavaInfo</code> object is created which is returned along
+ with all other <code>JavaInfo</code> objects by
+ <code>jfw_findAllJREs</code>. If the location
+ cannot be recognized then the location string is ignored. </p>
+ <p>
+ A validation if <code>sLocation</code> points to a JRE is not
+ performed. To do that one has to use <code>jfw_getJavaInfoByPath</code>.
+ </p>
+ <p>
+ Adding a path that is already stored causes no error.</p>
+
+ @param sLocation
+ [in] file URL to a directory which contains a JRE.
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALIDARG sLocation is NULL.<br/>
+ JFW_E_ERROR An error occurred.<br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.<br/>
+ JFW_E_DIRECT_MODE the function cannot be used in this mode.
+ @see jfw_setJRELocations
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_addJRELocation(rtl_uString * sLocation);
+
+/** saves the locations of a number of JREs.
+
+ <p>
+ The function does not verify if the paths points to JRE. However,
+ it makes sure that every path is unique. That is, if the array
+ contains strings which are the same then only one is stored.</p>
+ <p>
+ If <code>arLocations</code> is NULL or it has the length null (nSize = 0)
+ then all previously stored paths are deleted. Otherwise,
+ the old values are overwritten.</p>
+
+ @param arLocations
+ [in] array of paths to locations of JREs.
+
+ @param nSize
+ [in] the size of the array <code>arLocations</code>
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALIDARG arLocation is NULL and nSize is not null.<br/>
+ JFW_E_ERROR An error occurred.<br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.<br/>
+ JFW_E_DIRECT_MODE the function cannot be used in this mode.
+ @see jfw_addJRELocations
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_setJRELocations(
+ rtl_uString ** arLocations, sal_Int32 nSize);
+/** obtains an array containing paths to JRE installations.
+
+ <p>
+ It is not guaranteed that the returned paths represent
+ a valid JRE. One can use <code>jfw_getJavaInfoByPath</code> to check this.
+ </p>
+
+ @param parLocations
+ [out] on return it contains the array of paths.
+ @param pSize
+ [out] on return it contains the size of the array <code>parLocations</code>.
+
+ @return
+ JFW_E_NONE function ran successfully.<br/>
+ JFW_E_INVALIDARG parLocation is NULL or pSize is NULL.<br/>
+ JFW_E_ERROR An error occurred.<br/>
+ JFW_E_CONFIGURATION mode was not properly set or their prerequisites
+ were not met.<br/>
+ JFW_E_DIRECT_MODE the function cannot be used in this mode.
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getJRELocations(
+ rtl_uString *** parLocations, sal_Int32 * pSize);
+
+
+/** checks if the installation of the jre still exists.
+
+ This function checks if the JRE described by pInfo still
+ exists. The check must be very quick because it is called by javaldx
+ (Linux, Solaris) at start up.
+
+ @param pInfo
+ [in] the JavaInfo object with information about the JRE.
+ @param pp_exist
+ [out] the parameter is set to either sal_True or sal_False. The value is
+ only valid if the function returns JFW_E_NONE.
+
+ @return
+ JFW_E_NONE the function ran successfully.</br>
+ JFW_E_ERROR an error occurred during execution.</br>
+ JFW_E_INVALID_ARG pInfo contains invalid data</br>
+ JFW_E_NO_PLUGIN a plug-in library could not be found.<br/>
+ */
+JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist);
+
+
+/** locks this API so that it cannot be used by other threads.
+
+ <p>If a different thread called this function before then the
+ current call is blocked until the other thread has called
+ <code>jfw_unlock()</code>. The function should be called if one
+ needs an exact snapshot of the current settings. Then the settings
+ are retrieved one by one without risk that the settings may be changed
+ by a different thread. Similiary if one needs to make settings which
+ should become effective at the same time then <code>jfw_lock</code>
+ should be called. That is, <code>jfw_startVM</code> which uses the
+ settings cannot be called before all settings have be made.</p>
+ <p>
+ The only functions which are not effected by <code>jfw_lock</code> are
+ <code>jfw_freeJavaInfo</code> and <code>jfw_areEqualJavaInfo</code>.
+ */
+JVMFWK_DLLPUBLIC void SAL_CALL jfw_lock();
+
+/** unlocks this API.
+
+ <p>This function is called after <code>jfw_lock</code>. It allows other
+ threads to use this API concurrently.</p>
+*/
+JVMFWK_DLLPUBLIC void SAL_CALL jfw_unlock();
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/jvmfwk/jvmfwkdllapi.h b/include/jvmfwk/jvmfwkdllapi.h
new file mode 100644
index 000000000000..52c8273b5954
--- /dev/null
+++ b/include/jvmfwk/jvmfwkdllapi.h
@@ -0,0 +1,24 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_JVMFWK_JVMFWKDLLAPI_H
+#define INCLUDED_JVMFWK_JVMFWKDLLAPI_H
+
+#include <sal/types.h>
+
+#if defined JVMFWK_DLLIMPLEMENTATION
+# define JVMFWK_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+# define JVMFWK_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define JVMFWK_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/jvmfwk/jvmfwkplugindllapi.h b/include/jvmfwk/jvmfwkplugindllapi.h
new file mode 100644
index 000000000000..d96016e261bb
--- /dev/null
+++ b/include/jvmfwk/jvmfwkplugindllapi.h
@@ -0,0 +1,24 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_JVMFWK_JVMFWKPLUGINDLLAPI_H
+#define INCLUDED_JVMFWK_JVMFWKPLUGINDLLAPI_H
+
+#include <sal/types.h>
+
+#if defined JVMFWK_PLUGIN_DLLIMPLEMENTATION
+# define JVMFWK_PLUGIN_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+# define JVMFWK_PLUGIN_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define JVMFWK_PLUGIN_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/jvmfwk/vendorplugin.h b/include/jvmfwk/vendorplugin.h
new file mode 100644
index 000000000000..5ca5e10009ba
--- /dev/null
+++ b/include/jvmfwk/vendorplugin.h
@@ -0,0 +1,258 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+/** @HTML */
+#ifndef INCLUDED_JVMFWK_VENDORPLUGIN_H
+#define INCLUDED_JVMFWK_VENDORPLUGIN_H
+
+#include "jvmfwkplugindllapi.h"
+#include "jvmfwk/framework.h"
+#include "rtl/ustring.h"
+#include "jni.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ @file
+ <p>
+ This API shall be implemented if one wants to support a Java Runtime
+ Environment (JRE) of a particular vendor. Because there is currently no
+ specification which rules the structure and location of JRE installations
+ and the format of version strings it is not possible to supply a general
+ implementation for all possible vendors. If an application determines exactly
+ what version a JRE must have then it relies on certain features and bug
+ fixes of that version. Because a version 1.4.2_1 from vendor X may contain
+ different fixes as the same version from vendor Y it is important to see
+ version an vendor as one entity. One without the other does not guarantee
+ the existence of a particular set of features or bug fixes. An implementation
+ of this API may support multiple vendors. </p>
+ <p>
+ Libraries which implement this interface will be dynamically loaded and
+ unloaded by the java framework (jvmfwk/framework.h). Therefore they must not
+ keep global variables.
+ </p>
+ */
+
+typedef enum
+{
+ JFW_PLUGIN_E_NONE,
+ JFW_PLUGIN_E_ERROR,
+ JFW_PLUGIN_E_INVALID_ARG,
+ JFW_PLUGIN_E_WRONG_VERSION_FORMAT,
+ JFW_PLUGIN_E_FAILED_VERSION,
+ JFW_PLUGIN_E_NO_JRE,
+ JFW_PLUGIN_E_WRONG_VENDOR,
+ JFW_PLUGIN_E_VM_CREATION_FAILED
+} javaPluginError;
+
+
+
+/** obtains information about installations of Java Runtime Environments (JREs).
+
+ <p>The function gathers information about available JREs which have the same
+ vendor as determined by the <code>sVendor</code> parameter. Only information
+ about those JREs which match the version requirements are returned. These
+ requirements are specified by the parameters <code>sMinVersion</code>,
+ <code>sMaxVersion</code> and <code>arExcludeList</code>.
+ </p>
+ <p>
+ The JavaInfo structures returned in <code>parJavaInfo</code> should be ordered
+ according to their version. The one, representing a JRE with the highest
+ version should be the first in the array. </p>
+ <p>
+ The function allocates memory for an array and all the JavaInfo objects returned
+ in <code>parJavaInfo</code>. The caller must free each JavaInfo object by calling
+ <code>jfw_freeJavaInfo</code> (#include "jvmfwk/framework.h"). The array is to be
+ freed by rtl_freeMemory.
+ In case an error occurred <code>parJavaInfo</code> need not be freed.
+ </p>
+ @param sVendor
+ [in] only JREs from this vendor are examined. This parameter always contains
+ a vendor string. That is, the string it is not empty.
+ @param sMinVersion
+ [in] represents the minimum version of a JRE. The string can be empty but
+ a null pointer is not allowed.
+ @param sMaxVersion
+ [in] represents the maximum version of a JRE. The string can be empty but
+ a null pointer is not allowed.
+ @param arExcludeList
+ [in] contains a list of &quot;bad&quot; versions. JREs which have one of these
+ versions must not be returned by this function. It can be NULL.
+ @param nSizeExcludeList
+ [in] the number of version strings contained in <code>arExcludeList</code>.
+ @param parJavaInfo
+ [out] if the function runs successfully then <code>parJavaInfo</code> contains
+ on return an array of pointers to <code>JavaInfo</code> objects.
+ @param nSizeJavaInfo
+ [out] the number of <code>JavaInfo</code> pointers contained in
+ <code>parJavaInfo</code>.
+
+ @return
+ JFW_PLUGIN_E_NONE the function ran successfully.</br>
+ JFW_PLUGIN_E_ERROR an error occurred during execution.</br>
+ JFW_PLUGIN_E_INVALID_ARG an argument was not valid. For example
+ <code>nSizeExcludeList</code> is greater null but <code>arExcludeList</code>
+ is NULL or NULL pointer were passed for at least on of the strings.</br>
+ JFW_PLUGIN_E_WRONG_VERSION_FORMAT the version strings in
+ <code>sMinVersion,sMaxVersion,arExcludeList</code> are not recognized as valid
+ version strings.
+ */
+JVMFWK_PLUGIN_DLLPUBLIC javaPluginError jfw_plugin_getAllJavaInfos(
+ rtl_uString *sVendor,
+ rtl_uString *sMinVersion,
+ rtl_uString *sMaxVersion,
+ rtl_uString * * arExcludeList,
+ sal_Int32 nSizeExcludeList,
+ JavaInfo*** parJavaInfo,
+ sal_Int32 *nSizeJavaInfo);
+
+/** obtains information for a JRE at a given location.
+
+ <p>If the given location belongs to a JRE whoose vendor matches the
+ sVendor argument and the JRE has a version which meets the requirements as
+ specified by <code>sMinVersion, sMaxVersion, arExcludeList</code> then
+ this function shall return a JavaInfo object for this JRE if this implementation
+ supports this vendor.</p>
+
+ @param sLocation
+ [in] a file URL to the directory of the JRE.
+ @param sVendor
+ [in] a name of a vendor. This parameter always contains
+ a vendor string. That is, the string it is not empty.
+ @param sMinVersion
+ [in] represents the minimum version of a JRE.
+ @param sMaxVersion
+ [in] represents the maximum version of a JRE.
+ @param arExcludeList
+ [in] contains a list of &quot;bad&quot; versions. JREs which have one of these
+ versions must not be returned by this function. It can be NULL.
+ @param nSizeExcludeList
+ [in] the number of version strings contained in <code>arExcludeList</code>.
+ @param ppInfo
+ [out] if the function runs successfully then <code>ppInfo</code> contains
+ on return a pointer to a <code>JavaInfo</code> object.
+
+ @return
+ JFW_PLUGIN_E_NONE the function ran successfully.</br>
+ JFW_PLUGIN_E_ERROR an error occurred during execution.</br>
+ JFW_PLUGIN_E_INVALID_ARG an argument was not valid. For example
+ <code>nSizeExcludeList</code> is greater null but <code>arExcludeList</code>
+ is NULL, NULL pointer were passed for at least on of the strings, sLocation
+ is an empty string.</br>
+ JFW_PLUGIN_E_WRONG_VERSION_FORMAT the version strings in
+ <code>sMinVersion,sMaxVersion,arExcludeList</code> are not recognized as valid
+ version strings.
+ JFW_PLUGIN_E_FAILED_VERSION there is a JRE at the given location but it does not
+ meet the version requirements.
+ JFW_PLUGIN_E_NO_JRE no JRE could be detected at the given location. However, that
+ does not mean necessarily that there is no JRE. There could be a JRE but it has
+ a vendor which is not supported by this API implementation.
+ */
+JVMFWK_PLUGIN_DLLPUBLIC javaPluginError jfw_plugin_getJavaInfoByPath(
+ rtl_uString *sLocation,
+ rtl_uString *sVendor,
+ rtl_uString *sMinVersion,
+ rtl_uString *sMaxVersion,
+ rtl_uString * *arExcludeList,
+ sal_Int32 nSizeExcludeList,
+ JavaInfo ** ppInfo);
+
+/** starts a Java Virtual Machine.
+
+ <p>The caller should provide all essential JavaVMOptions, such as the
+ class path (-Djava.class.path=xxx). It is assumed that the caller
+ knows what JRE is used. Hence the implementation does not need to check
+ the options for validity. If a user configured the application to
+ use specific options, such as -X..., then it is in his responsibility to
+ ensure that the application works properly. The function may add or modify
+ properties. For example, it may add to the class path property.
+ <p>
+ The function must ensure, that the VM does not abort the process
+ during instantiation.</p>
+ <p>
+ The function receives a <code>JavaInfo</code> object that was created
+ by the functions <code>jfw_plugin_getJavaInfoByPath</code> or
+ <code>jfw_plugin_getAllJavaInfos</code> from the same library. This can be
+ guaranteed if an application uses exactly one library for one vendor.
+ Therefore the functions which create the <code>JavaInfo</code> can store all
+ necessary information which are needed for starting the VM into that
+ structure. </p>
+
+ @param pInfo
+ [in] the JavaInfo object with information about the JRE.
+ @param arOptions
+ [in] the options which are passed into the JNI_CreateJavaVM function.
+ Can be NULL.
+ @param nSizeOptions
+ [in] the number of elements in <code>arOptions</code>.
+ @param ppVM
+ [out] the JavaVM pointer of the created VM.
+ @param ppEnv
+ [out] the JNIEnv pointer of the created VM.
+
+ @return
+ JFW_PLUGIN_E_NONE the function ran successfully.</br>
+ JFW_PLUGIN_E_ERROR an error occurred during execution.</br>
+ JFW_PLUGIN_E_WRONG_VENDOR the <code>JavaInfo</code> object was not created
+ in by this library and the VM cannot be started.</br>
+ JFW_PLUGIN_E_INVALID_ARG an argument was not valid. For example
+ <code>pInfo</code> or , <code>ppVM</code> or <code>ppEnv</code> are NULL.
+ </br>
+ JFW_PLUGIN_E_VM_CREATION_FAILED a VM could not be created. The error was caused
+ by the JRE.
+ */
+JVMFWK_PLUGIN_DLLPUBLIC javaPluginError jfw_plugin_startJavaVirtualMachine(
+ const JavaInfo *pInfo,
+ const JavaVMOption *arOptions,
+ sal_Int32 nSizeOptions,
+ JavaVM ** ppVM,
+ JNIEnv ** ppEnv);
+
+
+
+/** checks if the installation of the jre still exists.
+
+ This function checks if the JRE described by pInfo still
+ exists. The check must be very quick because it is called by javaldx
+ (Linux, Solaris) at start up.
+
+ @param pInfo
+ [in] the JavaInfo object with information about the JRE.
+ @param pp_exist
+ [out] the parameter is set to either sal_True or sal_False. The value is
+ only valid if the function returns JFW_E_NONE.
+
+ @return
+ JFW_PLUGIN_E_NONE the function ran successfully.</br>
+ JFW_PLUGIN_E_ERROR an error occurred during execution.</br>
+ JFW_PLUGIN_E_INVALID_ARG pInfo contains invalid data</br>
+ */
+JVMFWK_PLUGIN_DLLPUBLIC javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/linguistic/hyphdta.hxx b/include/linguistic/hyphdta.hxx
new file mode 100644
index 000000000000..9dec2d6dc15e
--- /dev/null
+++ b/include/linguistic/hyphdta.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 _LINGUISTIC_HYPHDTA_HXX_
+#define _LINGUISTIC_HYPHDTA_HXX_
+
+#include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
+#include <com/sun/star/linguistic2/XPossibleHyphens.hpp>
+#include <tools/solar.h>
+#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
+#include <cppuhelper/implbase1.hxx> // helper for implementations
+#include <linguistic/lngdllapi.h>
+
+namespace linguistic
+{
+
+class HyphenatedWord :
+ public cppu::WeakImplHelper1
+ <
+ ::com::sun::star::linguistic2::XHyphenatedWord
+ >
+{
+ OUString aWord;
+ OUString aHyphenatedWord;
+ sal_Int16 nHyphPos;
+ sal_Int16 nHyphenationPos;
+ sal_Int16 nLanguage;
+ sal_Bool bIsAltSpelling;
+
+ // disallow copy-constructor and assignment-operator for now
+ HyphenatedWord(const HyphenatedWord &);
+ HyphenatedWord & operator = (const HyphenatedWord &);
+
+public:
+ HyphenatedWord(const OUString &rWord, sal_Int16 nLang, sal_Int16 nHyphenationPos,
+ const OUString &rHyphenatedWord, sal_Int16 nHyphenPos );
+ virtual ~HyphenatedWord();
+
+ // XHyphenatedWord
+ virtual OUString SAL_CALL
+ getWord()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::lang::Locale SAL_CALL
+ getLocale()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL
+ getHyphenationPos()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL
+ getHyphenatedWord()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL
+ getHyphenPos()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL
+ isAlternativeSpelling()
+ throw(::com::sun::star::uno::RuntimeException);
+
+ OUString GetWord() { return aWord; }
+ OUString GetHyphenatedWord() { return aHyphenatedWord; }
+ sal_Int16 GetLanguage() { return nLanguage; }
+ void SetWord( OUString &rTxt ) { aWord = rTxt; }
+ void SetHyphenatedWord( OUString &rTxt ) { aHyphenatedWord = rTxt; }
+ void SetLanguage( sal_Int16 nLang ) { nLanguage = nLang; }
+ static com::sun::star::uno::Reference <com::sun::star::linguistic2::XHyphenatedWord> LNG_DLLPUBLIC CreateHyphenatedWord(
+ const OUString &rWord, sal_Int16 nLang, sal_Int16 nHyphenationPos,
+ const OUString &rHyphenatedWord, sal_Int16 nHyphenPos );
+};
+
+
+class PossibleHyphens :
+ public cppu::WeakImplHelper1
+ <
+ ::com::sun::star::linguistic2::XPossibleHyphens
+ >
+{
+ OUString aWord;
+ OUString aWordWithHyphens;
+ ::com::sun::star::uno::Sequence< sal_Int16 > aOrigHyphenPos;
+ sal_Int16 nLanguage;
+
+ // disallow copy-constructor and assignment-operator for now
+ PossibleHyphens(const PossibleHyphens &);
+ PossibleHyphens & operator = (const PossibleHyphens &);
+
+public:
+ PossibleHyphens(const OUString &rWord, sal_Int16 nLang,
+ const OUString &rHyphWord,
+ const ::com::sun::star::uno::Sequence< sal_Int16 > &rPositions);
+ virtual ~PossibleHyphens();
+
+ // XPossibleHyphens
+ virtual OUString SAL_CALL
+ getWord()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::lang::Locale SAL_CALL
+ getLocale()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL
+ getPossibleHyphens()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL
+ getHyphenationPositions()
+ throw(::com::sun::star::uno::RuntimeException);
+
+ OUString GetWord() { return aWord; }
+ sal_Int16 GetLanguage() { return nLanguage; }
+ void SetWord( OUString &rTxt ) { aWord = rTxt; }
+ void SetLanguage( sal_Int16 nLang ) { nLanguage = nLang; }
+
+ static com::sun::star::uno::Reference < com::sun::star::linguistic2::XPossibleHyphens > LNG_DLLPUBLIC CreatePossibleHyphens
+ (const OUString &rWord, sal_Int16 nLang,
+ const OUString &rHyphWord,
+ const ::com::sun::star::uno::Sequence< sal_Int16 > &rPositions);
+};
+} // namespace linguistic
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/linguistic/lngdllapi.h b/include/linguistic/lngdllapi.h
new file mode 100644
index 000000000000..0da35fe7e123
--- /dev/null
+++ b/include/linguistic/lngdllapi.h
@@ -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 _LNG_DLLAPI_H
+#define _LNG_DLLAPI_H
+
+#include "sal/config.h"
+#include "sal/types.h"
+
+#if defined(LNG_DLLIMPLEMENTATION)
+#define LNG_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define LNG_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define LNG_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/linguistic/lngprophelp.hxx b/include/linguistic/lngprophelp.hxx
new file mode 100644
index 000000000000..3995d87cc1e4
--- /dev/null
+++ b/include/linguistic/lngprophelp.hxx
@@ -0,0 +1,360 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _LINGUISTIC_LNGPROPHELP_HXX_
+#define _LINGUISTIC_LNGPROPHELP_HXX_
+
+#include <tools/solar.h>
+#include <uno/lbnames.h>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/interfacecontainer.h>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp>
+#include <linguistic/lngdllapi.h>
+
+namespace com { namespace sun { namespace star { namespace beans {
+ class XPropertySet;
+}}}}
+
+namespace com { namespace sun { namespace star { namespace linguistic2 {
+ struct LinguServiceEvent;
+}}}}
+
+
+namespace linguistic
+{
+
+// PropertyChgHelper
+// Base class for all XPropertyChangeListener members of the
+// various lingu services.
+
+
+// Flags for type of events allowed to be launched
+#define AE_SPELLCHECKER 1
+#define AE_HYPHENATOR 2
+
+typedef cppu::WeakImplHelper2
+<
+ ::com::sun::star::beans::XPropertyChangeListener,
+ ::com::sun::star::linguistic2::XLinguServiceEventBroadcaster
+> PropertyChgHelperBase;
+
+class PropertyChgHelper :
+ public PropertyChgHelperBase
+{
+ ::com::sun::star::uno::Sequence< OUString > aPropNames;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > xMyEvtObj;
+ ::cppu::OInterfaceContainerHelper aLngSvcEvtListeners;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > xPropSet;
+
+ int nEvtFlags; // flags for event types allowed to be launched
+
+ // default values
+ sal_Bool bIsIgnoreControlCharacters;
+ sal_Bool bIsUseDictionaryList;
+
+ // return values, will be set to default value or current temporary value
+ sal_Bool bResIsIgnoreControlCharacters;
+ sal_Bool bResIsUseDictionaryList;
+
+
+ // disallow use of copy-constructor and assignment-operator
+ PropertyChgHelper( const PropertyChgHelper & );
+ PropertyChgHelper & operator = ( const PropertyChgHelper & );
+
+protected:
+ virtual void SetDefaultValues();
+ virtual void GetCurrentValues();
+
+ ::com::sun::star::uno::Sequence< OUString > &
+ GetPropNames() { return aPropNames; }
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &
+ GetPropSet() { return xPropSet; }
+
+ void AddPropNames( const char *pNewNames[], sal_Int32 nCount );
+
+ virtual sal_Bool propertyChange_Impl(
+ const ::com::sun::star::beans::PropertyChangeEvent& rEvt );
+
+public:
+ PropertyChgHelper(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &rxSource,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet,
+ int nAllowedEvents );
+ virtual ~PropertyChgHelper();
+
+ virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
+
+ // XEventListener
+ virtual void SAL_CALL
+ disposing( const ::com::sun::star::lang::EventObject& rSource )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL
+ propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XLinguServiceEventBroadcaster
+ virtual sal_Bool SAL_CALL
+ addLinguServiceEventListener(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL
+ removeLinguServiceEventListener(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // non-UNO functions
+ void LNG_DLLPUBLIC AddAsPropListener();
+ void LNG_DLLPUBLIC RemoveAsPropListener();
+ void LaunchEvent(
+ const ::com::sun::star::linguistic2::LinguServiceEvent& rEvt );
+
+ const ::com::sun::star::uno::Sequence< OUString > &
+ GetPropNames() const { return aPropNames; }
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &
+ GetPropSet() const { return xPropSet; }
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &
+ GetEvtObj() const { return xMyEvtObj; }
+
+ sal_Bool IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; }
+ sal_Bool IsUseDictionaryList() const { return bResIsUseDictionaryList; }
+};
+
+
+class PropertyHelper_Thes :
+ public PropertyChgHelper
+{
+ // disallow use of copy-constructor and assignment-operator
+ PropertyHelper_Thes( const PropertyHelper_Thes & );
+ PropertyHelper_Thes & operator = ( const PropertyHelper_Thes & );
+
+public:
+ PropertyHelper_Thes(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &rxSource,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet );
+ virtual ~PropertyHelper_Thes();
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL
+ propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
+ throw(::com::sun::star::uno::RuntimeException);
+};
+
+class LNG_DLLPUBLIC PropertyHelper_Thesaurus
+{
+ PropertyHelper_Thes* pInst;
+ com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener > xPropHelper;
+
+ // disallow use of copy-constructor and assignment-operator
+ PropertyHelper_Thesaurus( const PropertyHelper_Thes & );
+ PropertyHelper_Thesaurus & operator = ( const PropertyHelper_Thes & );
+
+public:
+ PropertyHelper_Thesaurus(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &rxSource,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet );
+ ~PropertyHelper_Thesaurus();
+ void AddAsPropListener();
+ void RemoveAsPropListener();
+ void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
+};
+
+
+class LNG_DLLPUBLIC PropertyHelper_Spell :
+ public PropertyChgHelper
+{
+ // default values
+ sal_Bool bIsSpellUpperCase;
+ sal_Bool bIsSpellWithDigits;
+ sal_Bool bIsSpellCapitalization;
+
+ // return values, will be set to default value or current temporary value
+ sal_Int16 nResMaxNumberOfSuggestions; // special value that is not part of the property set and thus needs to be handled differently
+ sal_Bool bResIsSpellUpperCase;
+ sal_Bool bResIsSpellWithDigits;
+ sal_Bool bResIsSpellCapitalization;
+
+
+ // disallow use of copy-constructor and assignment-operator
+ PropertyHelper_Spell( const PropertyHelper_Spell & );
+ PropertyHelper_Spell & operator = ( const PropertyHelper_Spell & );
+
+protected:
+ // PropertyChgHelper
+ virtual void SetDefaultValues();
+ virtual void GetCurrentValues();
+ virtual sal_Bool propertyChange_Impl(
+ const ::com::sun::star::beans::PropertyChangeEvent& rEvt );
+
+public:
+ PropertyHelper_Spell(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &rxSource,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet );
+ virtual ~PropertyHelper_Spell();
+
+ virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL
+ propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int16 GetDefaultNumberOfSuggestions() const;
+
+ sal_Int16 GetMaxNumberOfSuggestions() const { return nResMaxNumberOfSuggestions; }
+ sal_Bool IsSpellUpperCase() const { return bResIsSpellUpperCase; }
+ sal_Bool IsSpellWithDigits() const { return bResIsSpellWithDigits; }
+ sal_Bool IsSpellCapitalization() const { return bResIsSpellCapitalization; }
+};
+
+
+class LNG_DLLPUBLIC PropertyHelper_Spelling
+{
+ PropertyHelper_Spell* pInst;
+ com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener > xPropHelper;
+
+ // disallow use of copy-constructor and assignment-operator
+ PropertyHelper_Spelling( const PropertyHelper_Spell & );
+ PropertyHelper_Spelling & operator = ( const PropertyHelper_Spell & );
+
+public:
+ PropertyHelper_Spelling(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &rxSource,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet );
+ ~PropertyHelper_Spelling();
+
+ void AddAsPropListener();
+ void RemoveAsPropListener();
+ void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
+ sal_Bool IsSpellUpperCase() const;
+ sal_Bool IsSpellWithDigits() const;
+ sal_Bool IsSpellCapitalization() const;
+ sal_Bool addLinguServiceEventListener(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
+ throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool removeLinguServiceEventListener(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
+ throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+class PropertyHelper_Hyphen :
+ public PropertyChgHelper
+{
+ // default values
+ sal_Int16 nHyphMinLeading,
+ nHyphMinTrailing,
+ nHyphMinWordLength;
+
+ // return values, will be set to default value or current temporary value
+ sal_Int16 nResHyphMinLeading,
+ nResHyphMinTrailing,
+ nResHyphMinWordLength;
+
+ // disallow use of copy-constructor and assignment-operator
+ PropertyHelper_Hyphen( const PropertyHelper_Hyphen & );
+ PropertyHelper_Hyphen & operator = ( const PropertyHelper_Hyphen & );
+
+protected:
+ // PropertyChgHelper
+ virtual void SetDefaultValues();
+ virtual void GetCurrentValues();
+ virtual sal_Bool propertyChange_Impl(
+ const ::com::sun::star::beans::PropertyChangeEvent& rEvt );
+
+public:
+ PropertyHelper_Hyphen(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &rxSource,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet);
+ virtual ~PropertyHelper_Hyphen();
+
+ virtual void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL
+ propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ sal_Int16 GetMinLeading() const { return nResHyphMinLeading; }
+ sal_Int16 GetMinTrailing() const { return nResHyphMinTrailing; }
+ sal_Int16 GetMinWordLength() const { return nResHyphMinWordLength; }
+};
+
+class LNG_DLLPUBLIC PropertyHelper_Hyphenation
+{
+ PropertyHelper_Hyphen* pInst;
+ com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener > xPropHelper;
+
+ // disallow use of copy-constructor and assignment-operator
+ PropertyHelper_Hyphenation( const PropertyHelper_Hyphen & );
+ PropertyHelper_Hyphenation & operator = ( const PropertyHelper_Hyphen & );
+
+public:
+ PropertyHelper_Hyphenation(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > &rxSource,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet);
+ ~PropertyHelper_Hyphenation();
+
+ void AddAsPropListener();
+ void RemoveAsPropListener();
+ void SetTmpPropVals( const com::sun::star::beans::PropertyValues &rPropVals );
+ sal_Int16 GetMinLeading() const;
+ sal_Int16 GetMinTrailing() const;
+ sal_Int16 GetMinWordLength() const;
+ sal_Bool addLinguServiceEventListener(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
+ throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool removeLinguServiceEventListener(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XLinguServiceEventListener >& rxListener )
+ throw(::com::sun::star::uno::RuntimeException);
+};
+
+} // namespace linguistic
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/linguistic/lngprops.hxx b/include/linguistic/lngprops.hxx
new file mode 100644
index 000000000000..2f8339f9b0b8
--- /dev/null
+++ b/include/linguistic/lngprops.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 _LINGUISTIC_LNGPROPS_HHX_
+#define _LINGUISTIC_LNGPROPS_HHX_
+
+#include <unotools/linguprops.hxx>
+
+// maximal number of suggestions to be returned in spelling context-menu
+// (may not include results added by looking up user dictionaries)
+#define UPN_MAX_NUMBER_OF_SUGGESTIONS "MaxNumberOfSuggestions"
+
+// WIDs for property names
+//!! Don't change values! They are used as the property handles in
+//!! the service description
+#define WID_IS_GERMAN_PRE_REFORM UPH_IS_GERMAN_PRE_REFORM /*! deprecated !*/
+#define WID_IS_USE_DICTIONARY_LIST UPH_IS_USE_DICTIONARY_LIST
+#define WID_IS_IGNORE_CONTROL_CHARACTERS UPH_IS_IGNORE_CONTROL_CHARACTERS
+#define WID_IS_SPELL_UPPER_CASE UPH_IS_SPELL_UPPER_CASE
+#define WID_IS_SPELL_WITH_DIGITS UPH_IS_SPELL_WITH_DIGITS
+#define WID_IS_SPELL_CAPITALIZATION UPH_IS_SPELL_CAPITALIZATION
+#define WID_HYPH_MIN_LEADING UPH_HYPH_MIN_LEADING
+#define WID_HYPH_MIN_TRAILING UPH_HYPH_MIN_TRAILING
+#define WID_HYPH_MIN_WORD_LENGTH UPH_HYPH_MIN_WORD_LENGTH
+#define WID_DEFAULT_LOCALE UPH_DEFAULT_LOCALE
+#define WID_IS_SPELL_AUTO UPH_IS_SPELL_AUTO
+#define WID_IS_SPELL_HIDE UPH_IS_SPELL_HIDE /*! deprecated !*/
+#define WID_IS_SPELL_IN_ALL_LANGUAGES UPH_IS_SPELL_IN_ALL_LANGUAGES /*! deprecated !*/
+#define WID_IS_SPELL_SPECIAL UPH_IS_SPELL_SPECIAL
+#define WID_IS_HYPH_AUTO UPH_IS_HYPH_AUTO
+#define WID_IS_HYPH_SPECIAL UPH_IS_HYPH_SPECIAL
+#define WID_IS_WRAP_REVERSE UPH_IS_WRAP_REVERSE
+#define WID_DEFAULT_LANGUAGE UPH_DEFAULT_LANGUAGE
+#define WID_DEFAULT_LOCALE_CJK UPH_DEFAULT_LOCALE_CJK
+#define WID_DEFAULT_LOCALE_CTL UPH_DEFAULT_LOCALE_CTL
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/linguistic/misc.hxx b/include/linguistic/misc.hxx
new file mode 100644
index 000000000000..c15d2fc70dab
--- /dev/null
+++ b/include/linguistic/misc.hxx
@@ -0,0 +1,215 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _LINGUISTIC_MISC_HXX_
+#define _LINGUISTIC_MISC_HXX_
+
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/frame/XTerminateListener.hpp>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/linguistic2/XDictionaryEntry.hpp>
+#include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
+#include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
+
+#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
+#include <cppuhelper/implbase1.hxx> // helper for implementations
+#include <unotools/pathoptions.hxx>
+#include <i18nlangtag/lang.h>
+#include <tools/string.hxx>
+#include <unotools/charclass.hxx>
+#include <osl/thread.h>
+#include <osl/mutex.hxx>
+#include <linguistic/lngdllapi.h>
+
+namespace com { namespace sun { namespace star { namespace beans {
+ class XPropertySet;
+ class XFastPropertySet;
+}}}}
+
+namespace com { namespace sun { namespace star { namespace frame {
+ class XDesktop2;
+}}}}
+
+class LocaleDataWrapper;
+
+
+#define SN_GRAMMARCHECKER "com.sun.star.linguistic2.Proofreader"
+#define SN_SPELLCHECKER "com.sun.star.linguistic2.SpellChecker"
+#define SN_HYPHENATOR "com.sun.star.linguistic2.Hyphenator"
+#define SN_THESAURUS "com.sun.star.linguistic2.Thesaurus"
+#define SN_LINGU_PROPERTIES "com.sun.star.linguistic2.LinguProperties"
+
+
+namespace linguistic
+{
+
+/// Flags to be used with the multi-path related functions
+/// @see GetDictionaryPaths
+#define PATH_FLAG_INTERNAL 0x01
+#define PATH_FLAG_USER 0x02
+#define PATH_FLAG_WRITABLE 0x04
+#define PATH_FLAG_ALL (PATH_FLAG_INTERNAL | PATH_FLAG_USER | PATH_FLAG_WRITABLE)
+
+
+// AddEntryToDic return values
+#define DIC_ERR_NONE 0
+#define DIC_ERR_FULL 1
+#define DIC_ERR_READONLY 2
+#define DIC_ERR_UNKNOWN 3
+#define DIC_ERR_NOT_EXISTS 4
+
+// values asigned to capitalization types
+enum CapType
+{
+ CAPTYPE_UNKNOWN,
+ CAPTYPE_NOCAP,
+ CAPTYPE_INITCAP,
+ CAPTYPE_ALLCAP,
+ CAPTYPE_MIXED
+};
+
+LNG_DLLPUBLIC ::osl::Mutex& GetLinguMutex();
+
+LocaleDataWrapper & GetLocaleDataWrapper( sal_Int16 nLang );
+
+sal_Int32 LevDistance( const OUString &rTxt1, const OUString &rTxt2 );
+
+/** Convert Locale to LanguageType for legacy handling.
+ Linguistic specific handling of an empty locale denoting LANGUAGE_NONE.
+ Does not resolve empty locale as system locale.
+ */
+LNG_DLLPUBLIC LanguageType LinguLocaleToLanguage( const ::com::sun::star::lang::Locale& rLocale );
+
+/** Convert LanguageType to Locale for legacy handling.
+ Linguistic specific handling of LANGUAGE_NONE resulting in an empty locale.
+ Avoid use!
+ */
+LNG_DLLPUBLIC ::com::sun::star::lang::Locale LinguLanguageToLocale( LanguageType nLanguage );
+
+/** Checks if a LanguageType is one of the values that denote absence of
+ language or undetermined language or multiple languages, in short all
+ values used in linguistic context that do not denote a specific language.
+ */
+LNG_DLLPUBLIC bool LinguIsUnspecified( LanguageType nLanguage );
+
+::com::sun::star::uno::Sequence< sal_Int16 >
+ LocaleSeqToLangSeq( ::com::sun::star::uno::Sequence<
+ ::com::sun::star::lang::Locale > &rLocaleSeq );
+
+// checks if file pointed to by rURL is readonly
+// and may also check return if such a file exists or not
+sal_Bool IsReadOnly( const String &rURL, sal_Bool *pbExist = 0 );
+
+// checks if a file with the given URL exists
+sal_Bool FileExists( const String &rURL );
+
+
+OUString GetDictionaryWriteablePath();
+::com::sun::star::uno::Sequence< OUString > GetDictionaryPaths( sal_Int16 nPathFlags = PATH_FLAG_ALL );
+
+/// @returns an URL for a new and writable dictionary rDicName.
+/// The URL will point to the path given by 'GetDictionaryWriteablePath'
+LNG_DLLPUBLIC String GetWritableDictionaryURL( const String &rDicName );
+
+LNG_DLLPUBLIC sal_Int32 GetPosInWordToCheck( const OUString &rTxt, sal_Int32 nPos );
+
+::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenatedWord >
+ RebuildHyphensAndControlChars( const OUString &rOrigWord,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenatedWord > &rxHyphWord );
+
+
+LNG_DLLPUBLIC sal_Bool IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage );
+
+inline sal_Bool IsUpper( const String &rText, sal_Int16 nLanguage ) { return IsUpper( rText, 0, rText.Len(), nLanguage ); }
+LNG_DLLPUBLIC CapType SAL_CALL capitalType(const OUString&, CharClass *);
+
+String ToLower( const String &rText, sal_Int16 nLanguage );
+LNG_DLLPUBLIC sal_Bool HasDigits( const OUString &rText );
+LNG_DLLPUBLIC sal_Bool IsNumeric( const String &rText );
+
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > GetOneInstanceService( const char *pServiceName );
+LNG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetLinguProperties();
+::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList > GetDictionaryList();
+::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > GetIgnoreAllList();
+
+
+sal_Bool IsUseDicList( const ::com::sun::star::beans::PropertyValues &rProperties,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet );
+
+sal_Bool IsIgnoreControlChars( const ::com::sun::star::beans::PropertyValues &rProperties,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > &rxPropSet );
+
+::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XDictionaryEntry >
+ SearchDicList(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList >& rDicList,
+ const OUString& rWord, sal_Int16 nLanguage,
+ sal_Bool bSearchPosDics, sal_Bool bSearchSpellEntry );
+
+LNG_DLLPUBLIC sal_uInt8 AddEntryToDic(
+ ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > &rxDic,
+ const OUString &rWord, sal_Bool bIsNeg,
+ const OUString &rRplcTxt, sal_Int16 nRplcLang,
+ sal_Bool bStripDot = sal_True );
+
+LNG_DLLPUBLIC sal_Bool SaveDictionaries( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList > &xDicList );
+
+// AppExitLstnr:
+// virtual base class that calls it AtExit function when the application
+// (ie the Desktop) is about to terminate
+
+class AppExitListener :
+ public cppu::WeakImplHelper1
+ <
+ ::com::sun::star::frame::XTerminateListener
+ >
+{
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XDesktop2 > xDesktop;
+
+public:
+ AppExitListener();
+ virtual ~AppExitListener();
+
+ virtual void AtExit() = 0;
+
+ void Activate();
+ void Deactivate();
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTerminateListener
+ virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+} // namespace linguistic
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/linguistic/spelldta.hxx b/include/linguistic/spelldta.hxx
new file mode 100644
index 000000000000..92f9cd680c77
--- /dev/null
+++ b/include/linguistic/spelldta.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 _LINGUISTIC_SPELLDTA_HXX_
+#define _LINGUISTIC_SPELLDTA_HXX_
+
+#include <vector>
+#include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
+#include <com/sun/star/linguistic2/XSetSpellAlternatives.hpp>
+#include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
+
+#include <tools/solar.h>
+
+#include <uno/lbnames.h>
+#include <cppuhelper/implbase2.hxx>
+#include <linguistic/lngdllapi.h>
+
+#include <boost/noncopyable.hpp>
+
+namespace com { namespace sun { namespace star {
+ namespace linguistic2 {
+ class XDictionaryList;
+ }
+} } }
+
+
+namespace linguistic
+{
+
+::com::sun::star::uno::Sequence< OUString >
+ MergeProposalSeqs(
+ ::com::sun::star::uno::Sequence< OUString > &rAlt1,
+ ::com::sun::star::uno::Sequence< OUString > &rAlt2,
+ sal_Bool bAllowDuplicates );
+
+void SeqRemoveNegEntries(
+ ::com::sun::star::uno::Sequence< OUString > &rSeq,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSearchableDictionaryList > &rxDicList,
+ sal_Int16 nLanguage );
+
+sal_Bool SeqHasEntry(
+ const ::com::sun::star::uno::Sequence< OUString > &rSeq,
+ const OUString &rTxt);
+
+///////////////////////////////////////////////////////////////////////////
+
+void SearchSimilarText( const OUString &rText, sal_Int16 nLanguage,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSearchableDictionaryList > &xDicList,
+ std::vector< OUString > & rDicListProps );
+
+///////////////////////////////////////////////////////////////////////////
+
+
+class SpellAlternatives
+ : public cppu::WeakImplHelper2
+ <
+ ::com::sun::star::linguistic2::XSpellAlternatives,
+ ::com::sun::star::linguistic2::XSetSpellAlternatives
+ >
+ , private ::boost::noncopyable
+{
+ ::com::sun::star::uno::Sequence< OUString > aAlt; // list of alternatives, may be empty.
+ OUString aWord;
+ sal_Int16 nType; // type of failure
+ sal_Int16 nLanguage;
+
+public:
+ LNG_DLLPUBLIC SpellAlternatives();
+ SpellAlternatives(const OUString &rWord, sal_Int16 nLang, sal_Int16 nFailureType,
+ const ::com::sun::star::uno::Sequence< OUString > &rAlternatives );
+ virtual ~SpellAlternatives();
+
+ // XSpellAlternatives
+ virtual OUString SAL_CALL getWord( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getFailureType( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getAlternativesCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAlternatives( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XSetSpellAlternatives
+ virtual void SAL_CALL setAlternatives( const ::com::sun::star::uno::Sequence< OUString >& aAlternatives ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFailureType( ::sal_Int16 nFailureType ) throw (::com::sun::star::uno::RuntimeException);
+
+ // non-interface specific functions
+ void LNG_DLLPUBLIC SetWordLanguage(const OUString &rWord, sal_Int16 nLang);
+ void LNG_DLLPUBLIC SetFailureType(sal_Int16 nTypeP);
+ void LNG_DLLPUBLIC SetAlternatives( const ::com::sun::star::uno::Sequence< OUString > &rAlt );
+ static com::sun::star::uno::Reference < com::sun::star::linguistic2::XSpellAlternatives > LNG_DLLPUBLIC CreateSpellAlternatives(
+ const OUString &rWord, sal_Int16 nLang, sal_Int16 nTypeP, const ::com::sun::star::uno::Sequence< OUString > &rAlt );
+};
+
+
+///////////////////////////////////////////////////////////////////////////
+
+} // namespace linguistic
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/o3tl/compat_functional.hxx b/include/o3tl/compat_functional.hxx
new file mode 100644
index 000000000000..00ae33cb23bb
--- /dev/null
+++ b/include/o3tl/compat_functional.hxx
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+/*
+ * Lifted and paraphrased from STLport - with additions from Fridrich
+ * Strba and Thorsten Behrens
+ */
+
+#ifndef INCLUDED_O3TL_COMPAT_FUNCTIONAL_HXX
+#define INCLUDED_O3TL_COMPAT_FUNCTIONAL_HXX
+
+#include <functional>
+
+namespace o3tl
+{
+
+/// Identity functor - return the input value
+template<class T>
+struct identity : public std::unary_function<T, T>
+{
+ T operator()(const T& y) const
+ {
+ return (y);
+ }
+};
+
+/// Functor, given two parameters, return the first
+template<class T1,class T2>
+struct project1st : public std::binary_function<T1, T2, T1>
+{
+ T1 operator()(const T1& y, const T2&) const
+ {
+ return (y);
+ }
+};
+
+/// Functor, given two parameters, return the second
+template<class T1,class T2>
+struct project2nd : public std::binary_function<T1, T2, T2>
+{
+ T2 operator()(const T1&, const T2& x) const
+ {
+ return (x);
+ }
+};
+
+/// Select first value of a pair
+template<class P>
+struct select1st : public std::unary_function<P, typename P::first_type>
+{
+ const typename P::first_type& operator()(const P& y) const
+ {
+ return (y.first);
+ }
+};
+
+/// Select second value of a pair
+template<class P>
+struct select2nd : public std::unary_function<P, typename P::second_type>
+{
+ const typename P::second_type& operator()(const P& y) const
+ {
+ return (y.second);
+ }
+};
+
+/// Call F1 with the result of F2 applied to the one input parameter
+template<class F1, class F2>
+class unary_compose : public std::unary_function<typename F2::argument_type, typename F1::result_type>
+{
+ public:
+ unary_compose(const F1& fnction1, const F2& fnction2) : ftor1(fnction1), ftor2(fnction2) {}
+
+ typename F1::result_type operator()(const typename F2::argument_type& y) const
+ {
+ return (ftor1(ftor2(y)));
+ }
+
+ protected:
+ F1 ftor1;
+ F2 ftor2;
+};
+
+/// Create functor that calls F1 with the result of F2 applied to the one input parameter
+template<class F1, class F2>
+inline unary_compose<F1, F2> compose1(const F1& fnction1, const F2& fnction2)
+{
+ return (unary_compose<F1, F2>(fnction1, fnction2));
+}
+
+/// Calls F2 and F3 for the two args of F1, respectively
+template<class F1, class F2, class F3>
+class binary_compose : public std::unary_function<typename F2::argument_type,typename F1::result_type>
+{
+ public:
+ binary_compose(const F1& fnction1, const F2& fnction2, const F3& fnction3) : ftor1(fnction1), ftor2(fnction2), ftor3(fnction3) {}
+
+ typename F1::result_type operator()(const typename F2::argument_type& y) const
+ {
+ return (ftor1(ftor2(y), ftor3(y)));
+ }
+
+ protected:
+ F1 ftor1;
+ F2 ftor2;
+ F3 ftor3;
+};
+
+/// Creates functor that calls F2 and F3 for the two args of F1, respectively
+template<class F1, class F2, class F3>
+inline binary_compose<F1, F2, F3> compose2(const F1& fnction1, const F2& fnction2, const F3& fnction3)
+{
+ return (binary_compose<F1, F2, F3>(fnction1, fnction2, fnction3));
+}
+
+/// Algo that assigns val, val+1, ... to the given range
+template<typename FwdIter, typename ValueType>
+inline void iota(FwdIter first, FwdIter last, ValueType val)
+{
+ while(first != last)
+ *first++ = val++;
+}
+
+} // namespace o3tl
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/o3tl/cow_wrapper.hxx b/include/o3tl/cow_wrapper.hxx
new file mode 100644
index 000000000000..b54f99d0f190
--- /dev/null
+++ b/include/o3tl/cow_wrapper.hxx
@@ -0,0 +1,322 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_O3TL_COW_WRAPPER_HXX
+#define INCLUDED_O3TL_COW_WRAPPER_HXX
+
+#include <osl/interlck.h>
+
+#include <algorithm>
+
+#include <boost/utility.hpp>
+#include <boost/checked_delete.hpp>
+
+namespace o3tl
+{
+ /** Thread-unsafe refcounting
+
+ This is the default locking policy for cow_wrapper. No
+ locking/guarding against concurrent access is performed
+ whatsoever.
+ */
+ struct UnsafeRefCountingPolicy
+ {
+ typedef sal_uInt32 ref_count_t;
+ static void incrementCount( ref_count_t& rCount ) { ++rCount; }
+ static bool decrementCount( ref_count_t& rCount ) { return --rCount != 0; }
+ };
+
+ /** Thread-safe refcounting
+
+ Use this to have the cow_wrapper refcounting mechanisms employ
+ the thread-safe oslInterlockedCount .
+ */
+ struct ThreadSafeRefCountingPolicy
+ {
+ typedef oslInterlockedCount ref_count_t;
+ static void incrementCount( ref_count_t& rCount ) { osl_atomic_increment(&rCount); }
+ static bool decrementCount( ref_count_t& rCount )
+ {
+ if( rCount == 1 ) // caller is already the only/last reference
+ return false;
+ else
+ return osl_atomic_decrement(&rCount) != 0;
+ }
+ };
+
+ /** Copy-on-write wrapper.
+
+ This template provides copy-on-write semantics for the wrapped
+ type: when copying, the operation is performed shallow,
+ i.e. different cow_wrapper objects share the same underlying
+ instance. Only when accessing the underlying object via
+ non-const methods, a unique copy is provided.
+
+ The type parameter <code>T</code> must satisfy the following
+ requirements: it must be default-constructible, copyable (it
+ need not be assignable), and be of non-reference type. Note
+ that, despite the fact that this template provides access to
+ the wrapped type via pointer-like methods
+ (<code>operator->()</code> and <code>operator*()</code>), it does
+ <em>not</em> work like e.g. the boost pointer wrappers
+ (shared_ptr, scoped_ptr, etc.). Internally, the cow_wrapper
+ holds a by-value instance of the wrapped object. This is to
+ avoid one additional heap allocation, and providing access via
+ <code>operator->()</code>/<code>operator*()</code> is because
+ <code>operator.()</code> cannot be overridden.
+
+ Regarding thread safety: this wrapper is <em>not</em>
+ thread-safe per se, because cow_wrapper has no way of
+ syncronizing the potentially many different cow_wrapper
+ instances, that reference a single shared value_type
+ instance. That said, when passing
+ <code>ThreadSafeRefCountingPolicy</code> as the
+ <code>MTPolicy</code> parameter, accessing a thread-safe
+ pointee through multiple cow_wrapper instances might be
+ thread-safe, if the individual pointee methods are
+ thread-safe, <em>including</em> pointee's copy
+ constructor. Any wrapped object that needs external
+ synchronisation (e.g. via an external mutex, which arbitrates
+ access to object methods, and can be held across multiple
+ object method calls) cannot easily be dealt with in a
+ thread-safe way, because, as noted, objects are shared behind
+ the client's back.
+
+ @attention if one wants to use the pimpl idiom together with
+ cow_wrapper (i.e. put an opaque type into the cow_wrapper),
+ then <em>all<em> methods in the surrounding class needs to be
+ non-inline (<em>including</em> destructor, copy constructor
+ and assignment operator).
+
+ @example
+ <pre>
+class cow_wrapper_client_impl;
+
+class cow_wrapper_client
+{
+public:
+ cow_wrapper_client();
+ cow_wrapper_client( const cow_wrapper_client& );
+ ~cow_wrapper_client();
+
+ cow_wrapper_client& operator=( const cow_wrapper_client& );
+
+ void modify( int nVal );
+ int queryUnmodified() const;
+
+private:
+ otl::cow_wrapper< cow_wrapper_client_impl > maImpl;
+};
+ </pre>
+ and the implementation file would look like this:
+ <pre>
+class cow_wrapper_client_impl
+{
+public:
+ void setValue( int nVal ) { mnValue = nVal; }
+ int getValue() const { return mnValue; }
+
+private:
+ int mnValue;
+}
+
+cow_wrapper_client::cow_wrapper_client() :
+ maImpl()
+{
+}
+cow_wrapper_client::cow_wrapper_client( const cow_wrapper_client& rSrc ) :
+ maImpl( rSrc.maImpl )
+{
+}
+cow_wrapper_client::~cow_wrapper_client()
+{
+}
+cow_wrapper_client& cow_wrapper_client::operator=( const cow_wrapper_client& rSrc )
+{
+ maImpl = rSrc.maImpl;
+ return *this;
+}
+void cow_wrapper_client::modify( int nVal )
+{
+ maImpl->setValue( nVal );
+}
+int cow_wrapper_client::queryUnmodified() const
+{
+ return maImpl->getValue();
+}
+ </pre>
+ */
+ template<typename T, class MTPolicy=UnsafeRefCountingPolicy> class cow_wrapper
+ {
+ /** shared value object - gets cloned before cow_wrapper hands
+ out a non-const reference to it
+ */
+ struct impl_t : private boost::noncopyable
+ {
+ impl_t() :
+ m_value(),
+ m_ref_count(1)
+ {
+ }
+
+ explicit impl_t( const T& v ) :
+ m_value(v),
+ m_ref_count(1)
+ {
+ }
+
+ T m_value;
+ typename MTPolicy::ref_count_t m_ref_count;
+ };
+
+ void release()
+ {
+ if( !MTPolicy::decrementCount(m_pimpl->m_ref_count) )
+ boost::checked_delete(m_pimpl), m_pimpl=0;
+ }
+
+ public:
+ typedef T value_type;
+ typedef T* pointer;
+ typedef const T* const_pointer;
+ typedef MTPolicy mt_policy;
+
+ /** Default-construct wrapped type instance
+ */
+ cow_wrapper() :
+ m_pimpl( new impl_t() )
+ {
+ }
+
+ /** Copy-construct wrapped type instance from given object
+ */
+ explicit cow_wrapper( const value_type& r ) :
+ m_pimpl( new impl_t(r) )
+ {
+ }
+
+ /** Shallow-copy given cow_wrapper
+ */
+ explicit cow_wrapper( const cow_wrapper& rSrc ) : // nothrow
+ m_pimpl( rSrc.m_pimpl )
+ {
+ MTPolicy::incrementCount( m_pimpl->m_ref_count );
+ }
+
+ ~cow_wrapper() // nothrow, if ~T does not throw
+ {
+ release();
+ }
+
+ /// now sharing rSrc cow_wrapper instance with us
+ cow_wrapper& operator=( const cow_wrapper& rSrc ) // nothrow
+ {
+ // this already guards against self-assignment
+ MTPolicy::incrementCount( rSrc.m_pimpl->m_ref_count );
+
+ release();
+ m_pimpl = rSrc.m_pimpl;
+
+ return *this;
+ }
+
+ /// unshare with any other cow_wrapper instance
+ value_type& make_unique()
+ {
+ if( m_pimpl->m_ref_count > 1 )
+ {
+ impl_t* pimpl = new impl_t(m_pimpl->m_value);
+ release();
+ m_pimpl = pimpl;
+ }
+
+ return m_pimpl->m_value;
+ }
+
+ /// true, if not shared with any other cow_wrapper instance
+ bool is_unique() const // nothrow
+ {
+ return m_pimpl->m_ref_count == 1;
+ }
+
+ /// return number of shared instances (1 for unique object)
+ typename MTPolicy::ref_count_t use_count() const // nothrow
+ {
+ return m_pimpl->m_ref_count;
+ }
+
+ void swap(cow_wrapper& r) // never throws
+ {
+ std::swap(m_pimpl, r.m_pimpl);
+ }
+
+ pointer operator->() { return &make_unique(); }
+ value_type& operator*() { return make_unique(); }
+ const_pointer operator->() const { return &m_pimpl->m_value; }
+ const value_type& operator*() const { return m_pimpl->m_value; }
+
+ pointer get() { return &make_unique(); }
+ const_pointer get() const { return &m_pimpl->m_value; }
+
+ /// true, if both cow_wrapper internally share the same object
+ bool same_object( const cow_wrapper& rOther ) const
+ {
+ return rOther.m_pimpl == m_pimpl;
+ }
+
+ private:
+ impl_t* m_pimpl;
+ };
+
+
+ template<class T, class P> inline bool operator==( const cow_wrapper<T,P>& a,
+ const cow_wrapper<T,P>& b )
+ {
+ return a.same_object(b) ? true : *a == *b;
+ }
+
+ template<class T, class P> inline bool operator!=( const cow_wrapper<T,P>& a,
+ const cow_wrapper<T,P>& b )
+ {
+ return a.same_object(b) ? false : *a != *b;
+ }
+
+ template<class A, class B, class P> inline bool operator<( const cow_wrapper<A,P>& a,
+ const cow_wrapper<B,P>& b )
+ {
+ return *a < *b;
+ }
+
+ template<class T, class P> inline void swap( cow_wrapper<T,P>& a,
+ cow_wrapper<T,P>& b )
+ {
+ a.swap(b);
+ }
+
+ // to enable boost::mem_fn on cow_wrapper
+ template<class T, class P> inline T * get_pointer( const cow_wrapper<T,P>& r )
+ {
+ return r.get();
+ }
+
+}
+
+#endif /* INCLUDED_O3TL_COW_WRAPPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/o3tl/heap_ptr.hxx b/include/o3tl/heap_ptr.hxx
new file mode 100644
index 000000000000..713aa21c41b8
--- /dev/null
+++ b/include/o3tl/heap_ptr.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_O3TL_HEAP_PTR_HXX
+#define INCLUDED_O3TL_HEAP_PTR_HXX
+
+
+#include <boost/assert.hpp>
+#include <boost/checked_delete.hpp>
+
+
+namespace o3tl
+{
+/** heap_ptr<> owns an object on the heap, which will be automatically
+ deleted, when ~heap_ptr<>() is called.
+
+ Applicability
+ -------------
+ heap_ptr<> can be used for class members on the heap.
+ - One cannot forget to delete them in the destructor.
+ - Constness will be transfered from the owning instance.
+
+ heap_ptr<> can also be used as smart pointer in function bodies to
+ ensure exception safety.
+
+ Special Characteristics
+ -----------------------
+ - heap_ptr<> transfers constness from the owning object to
+ the pointed to object. Such it behaves like if *get() would be
+ a normal member of the owning object, not a pointer member.
+ This is preferable to the normal pointer behaviour, because
+ if an object is owned by another one, it is normally part of
+ its state.
+
+ - heap_ptr<> provides a ->release() function
+
+ - For reasons of simplicity and portability ->is()
+ is preferred over the safe-bool idiom.
+
+ Copyability
+ -----------
+ heap_ptr is non copyable.
+ - It forbids the copyconstructor and operator=(self).
+
+ - Owning classes will automatically be non copyable, if they do not
+ redefine those two functions themselves.
+
+ Incomplete Types
+ ----------------
+ heap_ptr<> also works with incomplete types. You only need to write
+ class T;
+ but need not include <T>.hxx.
+
+ If you use heap_ptr<> with an incomplete type, the owning class
+ needs to define a non-inline destructor. Else the compiler will
+ complain.
+*/
+template <class T>
+class heap_ptr
+{
+ public:
+ typedef T element_type; /// Provided for generic programming.
+ typedef heap_ptr<T> self;
+
+#ifndef __SUNPRO_CC
+ typedef T * (self::* safe_bool )();
+#endif
+
+ /// Now, pass_heapObject is owned by this.
+ explicit heap_ptr(
+ T * pass_heapObject = 0 );
+ ~heap_ptr();
+
+
+ /** Identical to reset(), except of the return value.
+ @see heap_ptr<>::reset()
+ */
+ self & operator=(
+ T * pass_heapObject );
+ const T & operator*() const;
+ T & operator*();
+ const T * operator->() const;
+ T * operator->();
+
+ /// True, if pHeapObject != 0.
+#ifndef __SUNPRO_CC
+ operator safe_bool() const;
+#else // workaround opt bug of Sun C++ compiler, when compiling with -xO3
+ operator bool() const;
+#endif
+
+
+ /** This deletes any prevoiusly existing ->pHeapObject.
+ Now, pass_heapObject, if != 0, is owned by this.
+
+ @onerror
+ Ignores self-assignment.
+ Such, multiple assignment of the same pointer to the same
+ instance of heap_ptr<> is possible (though not recommended).
+ */
+ void reset(
+ T * pass_heapObject );
+ /** @return An object on the heap that must be deleted by the caller,
+ or 0.
+
+ @postcond get() == 0;
+ */
+ T * release();
+ void swap(
+ self & io_other );
+
+ /// True, if pHeapObject != 0.
+ bool is() const;
+ const T * get() const;
+ T * get();
+
+ private:
+ // Forbidden functions:
+ heap_ptr( const self & ); /// Prevent copies.
+ self & operator=( const self & ); /// Prevent copies.
+
+ /// @attention Does not set ->pHeapObject = 0.
+ void internal_delete();
+
+ // DATA
+ /// Will be deleted, when *this is destroyed.
+ T * pHeapObject;
+};
+
+
+/** Supports the semantic of std::swap(). Provided as an aid to
+ generic programming.
+*/
+template<class T>
+inline void
+swap( heap_ptr<T> & io_a,
+ heap_ptr<T> & io_b )
+{
+ io_a.swap(io_b);
+}
+
+
+
+// IMPLEMENTATION
+
+template <class T>
+inline void
+heap_ptr<T>::internal_delete()
+{
+ ::boost::checked_delete(pHeapObject);
+
+ // Do not set pHeapObject to 0, because
+ // that is reset to a value in all code
+ // where internal_delete() is used.
+}
+
+template <class T>
+inline
+heap_ptr<T>::heap_ptr( T * pass_heapObject )
+ : pHeapObject(pass_heapObject)
+{
+}
+
+template <class T>
+inline
+heap_ptr<T>::~heap_ptr()
+{
+ internal_delete();
+}
+
+template <class T>
+inline heap_ptr<T> &
+heap_ptr<T>::operator=(T * pass_heapObject)
+{
+ reset(pass_heapObject);
+ return *this;
+}
+
+template <class T>
+inline const T &
+heap_ptr<T>::operator*() const
+{
+ BOOST_ASSERT( pHeapObject != 0
+ && "Accessing a heap_ptr<>(0)." );
+ return *pHeapObject;
+}
+
+template <class T>
+inline T &
+heap_ptr<T>::operator*()
+{
+ BOOST_ASSERT( pHeapObject != 0
+ && "Accessing a heap_ptr<>(0)." );
+ return *pHeapObject;
+}
+
+template <class T>
+inline const T *
+heap_ptr<T>::operator->() const
+{
+ return pHeapObject;
+}
+
+template <class T>
+inline T *
+heap_ptr<T>::operator->()
+{
+ return pHeapObject;
+}
+
+#ifndef __SUNPRO_CC
+
+template <class T>
+inline
+heap_ptr<T>::operator typename heap_ptr<T>::safe_bool() const
+{
+ return is()
+ ? safe_bool(&self::get)
+ : safe_bool(0);
+}
+
+#else
+
+template <class T>
+inline heap_ptr<T>::operator bool() const
+{
+ return is();
+}
+
+#endif // !defined(__SUNPRO_CC)
+
+
+
+template <class T>
+void
+heap_ptr<T>::reset(T * pass_heapObject)
+{
+ if ( pHeapObject != 0
+ && pHeapObject == pass_heapObject)
+ return;
+
+ internal_delete();
+ pHeapObject = pass_heapObject;
+}
+
+template <class T>
+T *
+heap_ptr<T>::release()
+{
+ T * ret = pHeapObject;
+ pHeapObject = 0;
+ return ret;
+}
+
+template <class T>
+void
+heap_ptr<T>::swap(self & io_other)
+{
+ T * temp = io_other.pHeapObject;
+ io_other.pHeapObject = pHeapObject;
+ pHeapObject = temp;
+}
+
+template <class T>
+inline bool
+heap_ptr<T>::is() const
+{
+ return pHeapObject != 0;
+}
+
+template <class T>
+inline const T *
+heap_ptr<T>::get() const
+{
+ return pHeapObject;
+}
+
+template <class T>
+inline T *
+heap_ptr<T>::get()
+{
+ return pHeapObject;
+}
+
+
+} // namespace o3tl
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/o3tl/lazy_update.hxx b/include/o3tl/lazy_update.hxx
new file mode 100644
index 000000000000..b05bda37ba40
--- /dev/null
+++ b/include/o3tl/lazy_update.hxx
@@ -0,0 +1,265 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_O3TL_LAZY_UPDATE_HXX
+#define INCLUDED_O3TL_LAZY_UPDATE_HXX
+
+#include <sal/types.h>
+#include <boost/function.hpp>
+
+namespace o3tl
+{
+ /** Update output object lazily
+
+ This template collects data in input type, and updates the
+ output type with the given update functor, but only if the
+ output is requested. Usefúl if updating is expensive, or input
+ changes frequently, but output is only comparatively seldom
+ used.
+
+ @example
+ <pre>
+LazyUpdate<InType,OutType,LAZYUPDATE_DIRECT_TAG> myValue;
+*myValue = newInput;
+myValue->updateInput( this, that, those );
+
+output( *myValue );
+ </pre>
+ or
+ <pre>
+output( myValue.getOutValue() );
+ </pre>
+ if the compiler does not recognize the const context.
+ */
+ template< typename InputType, typename OutputType, typename Tag > class LazyUpdate;
+
+ /// LazyUpdate specialization takes boost::function argument
+ struct LAZYUPDATE_FUNCTOR_TAG {};
+ /// LazyUpdate specialization takes OutputType (*FunctionType)( InputType const& ) argument
+ struct LAZYUPDATE_FUNCTION_TAG {};
+ /// LazyUpdate specialization can directly convert, OutputType ctor must take InputType argument
+ struct LAZYUPDATE_DIRECT_TAG {};
+
+ // -----------------------------------------------------------------------------------------------------
+
+ namespace detail
+ {
+ /// @internal
+ template< typename InputType, typename OutputType, typename Functor > class LazyUpdateImpl : private Functor
+ {
+ public:
+ typedef OutputType output_type;
+ typedef InputType input_type;
+
+ LazyUpdateImpl() :
+ m_aInput()
+ {}
+
+ template< typename ParamType > explicit LazyUpdateImpl( ParamType const& rParm ) :
+ Functor(rParm),
+ m_aInput()
+ {}
+
+ enum UnaryConstructorTag{ UNARY_CONSTRUCTOR_TAG };
+ LazyUpdateImpl( const input_type& rInput, UnaryConstructorTag ) :
+ m_aInput(rInput)
+ {}
+
+ template< typename ParamType > LazyUpdateImpl( ParamType const& rParm,
+ const input_type& rInput ) :
+ Functor(rParm),
+ m_aInput(rInput)
+ {}
+
+ // default copy ctor/assignment operator are ok
+ // LazyUpdate( const LazyUpdate& );
+ // LazyUpdate& operator=( const LazyUpdate& );
+
+ void setInValue( input_type const& rIn ) { Functor::m_bCacheDirty = true; m_aInput = rIn; }
+ input_type const& getInValue() const { return m_aInput; }
+ output_type const& getOutValue() const { return this->implUpdateValue(m_aInput); }
+
+ input_type& operator*() { Functor::m_bCacheDirty = true; return m_aInput; }
+ input_type* operator->() { Functor::m_bCacheDirty = true; return &m_aInput; }
+
+ output_type const& operator*() const { return this->implUpdateValue(m_aInput); }
+ output_type const* operator->() const { return &(this->implUpdateValue(m_aInput)); }
+
+ private:
+ input_type m_aInput;
+ };
+
+ template< typename InputType, typename OutputType > struct DefaultFunctor
+ {
+ protected:
+ typedef OutputType output_type;
+ typedef InputType input_type;
+
+ DefaultFunctor() :
+ m_aOutput(),
+ m_bCacheDirty(true)
+ {}
+
+ OutputType const& implUpdateValue( input_type const& rIn ) const
+ {
+ if( m_bCacheDirty )
+ {
+ m_aOutput = output_type( rIn );
+ m_bCacheDirty = false;
+ }
+
+ return m_aOutput;
+ }
+
+ mutable output_type m_aOutput;
+ mutable bool m_bCacheDirty; // when true, m_aOutput needs update
+ };
+
+ template< typename InputType, typename OutputType, typename FunctionType > struct FunctionPointer
+ {
+ protected:
+ typedef OutputType output_type;
+ typedef InputType input_type;
+ typedef FunctionType function_type;
+
+ FunctionPointer() :
+ m_pFunc(),
+ m_aOutput(),
+ m_bCacheDirty(true)
+
+ {}
+
+ explicit FunctionPointer( function_type const& pFunc ) :
+ m_pFunc(pFunc),
+ m_aOutput(),
+ m_bCacheDirty(true)
+
+ {}
+
+ output_type const& implUpdateValue( input_type const& rIn ) const
+ {
+ if( m_bCacheDirty )
+ {
+ m_aOutput = m_pFunc( rIn );
+ m_bCacheDirty = false;
+ }
+
+ return m_aOutput;
+ }
+
+ function_type m_pFunc;
+ mutable output_type m_aOutput;
+ mutable bool m_bCacheDirty; // when true, m_aOutput needs update
+ };
+ }
+
+ // -----------------------------------------------------------------------------------------------------
+
+ // partial specializations for the three LAZYUPDATE_* tags
+
+ template< typename InputType, typename OutputType > class LazyUpdate<InputType,
+ OutputType,
+ LAZYUPDATE_DIRECT_TAG> :
+ public detail::LazyUpdateImpl<InputType,
+ OutputType,
+ detail::DefaultFunctor<InputType, OutputType> >
+ {
+ public:
+ LazyUpdate() {}
+ explicit LazyUpdate( InputType const& rIn ) :
+ detail::LazyUpdateImpl<InputType,
+ OutputType,
+ detail::DefaultFunctor<InputType, OutputType> >(
+ rIn,
+ detail::LazyUpdateImpl<
+ InputType,
+ OutputType,
+ detail::DefaultFunctor<InputType, OutputType> >::UNARY_CONSTRUCTOR_TAG )
+ {}
+ };
+
+ // -----------------------------------------------------------------------------------------------------
+
+ template< typename InputType, typename OutputType > class LazyUpdate<InputType,
+ OutputType,
+ LAZYUPDATE_FUNCTION_TAG> :
+ public detail::LazyUpdateImpl<InputType,
+ OutputType,
+ detail::FunctionPointer<
+ InputType,
+ OutputType,
+ OutputType (*)( InputType const& ) > >
+ {
+ public:
+ explicit LazyUpdate( OutputType (*pFunc)( InputType const& ) ) :
+ detail::LazyUpdateImpl<InputType,
+ OutputType,
+ detail::FunctionPointer<
+ InputType,
+ OutputType,
+ OutputType (*)( InputType const& )> >(pFunc)
+ {}
+ LazyUpdate( OutputType (*pFunc)( InputType const& ),
+ InputType const& rIn ) :
+ detail::LazyUpdateImpl<InputType,
+ OutputType,
+ detail::FunctionPointer<
+ InputType,
+ OutputType,
+ OutputType (*)( InputType const& )> >(pFunc,rIn)
+ {}
+ };
+
+ // -----------------------------------------------------------------------------------------------------
+
+ template< typename InputType, typename OutputType > class LazyUpdate<InputType,
+ OutputType,
+ LAZYUPDATE_FUNCTOR_TAG> :
+ public detail::LazyUpdateImpl<InputType,
+ OutputType,
+ detail::FunctionPointer<
+ InputType,
+ OutputType,
+ boost::function1<OutputType,InputType> > >
+ {
+ public:
+ explicit LazyUpdate( boost::function1<OutputType,InputType> const& rFunc ) :
+ detail::LazyUpdateImpl<InputType,
+ OutputType,
+ detail::FunctionPointer<
+ InputType,
+ OutputType,
+ boost::function1<OutputType,InputType> > >(rFunc)
+ {}
+ LazyUpdate( boost::function1<OutputType,InputType> const& rFunc,
+ InputType const& rIn ) :
+ detail::LazyUpdateImpl<InputType,
+ OutputType,
+ detail::FunctionPointer<
+ InputType,
+ OutputType,
+ boost::function1<OutputType,InputType> > >(rFunc,rIn)
+ {}
+ };
+
+}
+
+#endif /* INCLUDED_O3TL_LAZY_UPDATE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/o3tl/range.hxx b/include/o3tl/range.hxx
new file mode 100644
index 000000000000..a5ebacb4c6b8
--- /dev/null
+++ b/include/o3tl/range.hxx
@@ -0,0 +1,183 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_O3TL_RANGE_HXX
+#define INCLUDED_O3TL_RANGE_HXX
+
+
+#include <cstring> // for std::size_t
+#include <boost/assert.hpp>
+
+
+
+namespace o3tl
+{
+/** Represents a range of integer or iterator values.
+
+ @tpl T
+ Has to be assignable, add- and subtractable. That is:
+ either it is
+ - an integral type
+ - or a random access iterator.
+*/
+template <class T>
+class range
+{
+ public:
+ typedef T element_type; /// Provided for generic programming.
+ typedef range<T> self;
+
+ // LIFECYCLE
+ range(
+ T i_inclusiveLowerBorder,
+ T i_exclusiveUpperBorder );
+ ~range();
+ // INQUIRY
+ T begin() const;
+ T end() const;
+ std::size_t size() const;
+
+ bool contains(
+ T i_value ) const;
+ bool contains(
+ const self & i_other ) const;
+ bool overlaps(
+ const self & i_other ) const;
+ /// @return i_other.begin() - this->end()
+ long distance_to(
+ const self & i_other ) const;
+ private:
+ // DATA
+ T nBegin;
+ T nEnd;
+};
+
+
+template <class T>
+inline range<T>
+make_range(T i1, T i2)
+{
+ return range<T>(i1, i2);
+}
+
+template <class T>
+inline range<typename T::const_iterator>
+range_of(const T & i_container)
+{
+ return make_range( i_container.begin(),
+ i_container.end()
+ );
+}
+
+template <class T>
+inline range<typename T::iterator>
+range_of(T & io_container)
+{
+ return make_range( io_container.begin(),
+ io_container.end()
+ );
+}
+
+
+
+
+
+// IMPLEMENTATION
+
+template <class T>
+range<T>::range( T i_inclusiveLowerBorder,
+ T i_exclusiveUpperBorder )
+ : nBegin(i_inclusiveLowerBorder),
+ nEnd(i_exclusiveUpperBorder)
+{
+ BOOST_ASSERT( nBegin <= nEnd
+ && "Invalid parameters for range<> constructor.");
+}
+
+template <class T>
+range<T>::~range()
+{
+}
+
+template <class T>
+inline T
+range<T>::begin() const
+{
+ return nBegin;
+}
+
+template <class T>
+inline T
+range<T>::end() const
+{
+ return nEnd;
+}
+
+template <class T>
+inline std::size_t
+range<T>::size() const
+{
+ BOOST_ASSERT( nBegin <= nEnd
+ && "Invalid range limits in range<>::size().");
+ return static_cast<std::size_t>( end() - begin() );
+}
+
+template <class T>
+bool
+range<T>::contains(T i_value ) const
+{
+ return begin() <= i_value
+ && i_value < end();
+}
+
+template <class T>
+bool
+range<T>::contains(const self & i_other) const
+{
+ // This is subtle, because this would be wrong:
+ // begin() <= i_other.begin()
+ // && i_other.end() <= end();
+ // An empty range that begins and starts at my end()
+ // must not be contained.
+
+ return contains(i_other.begin())
+ && i_other.end() <= end();
+}
+
+template <class T>
+bool
+range<T>::overlaps(const self & i_other) const
+{
+ return contains(i_other.begin())
+ || i_other.contains(begin());
+}
+
+template <class T>
+long
+range<T>::distance_to(const self & i_other) const
+{
+ return i_other.begin() - end();
+}
+
+
+
+} // namespace o3tl
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/o3tl/sorted_vector.hxx b/include/o3tl/sorted_vector.hxx
new file mode 100644
index 000000000000..776fd5605e6f
--- /dev/null
+++ b/include/o3tl/sorted_vector.hxx
@@ -0,0 +1,237 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_O3TL_SORTED_VECTOR_HXX
+#define INCLUDED_O3TL_SORTED_VECTOR_HXX
+
+#include <vector>
+#include <functional>
+#include <algorithm>
+
+namespace o3tl
+{
+
+// forward declared because it's default tempate arg for sorted_vector
+template<class Value, class Compare>
+struct find_unique;
+
+/** Represents a sorted vector of values.
+
+ @tpl Value class of item to be stored in container
+ @tpl Compare comparison method
+ @tpl Find look up index of a Value in the array
+*/
+template<typename Value, typename Compare = std::less<Value>,
+ template<typename, typename> class Find = find_unique >
+class sorted_vector
+ : private std::vector<Value>
+{
+private:
+ typedef Find<Value, Compare> Find_t;
+ typedef typename std::vector<Value> base_t;
+ typedef typename std::vector<Value>::iterator iterator;
+public:
+ typedef typename std::vector<Value>::const_iterator const_iterator;
+ typedef typename std::vector<Value>::size_type size_type;
+
+ using base_t::clear;
+ using base_t::empty;
+ using base_t::size;
+
+ // MODIFIERS
+
+ std::pair<const_iterator,bool> insert( const Value& x )
+ {
+ std::pair<const_iterator, bool> const ret(Find_t()(begin(), end(), x));
+ if (!ret.second)
+ {
+ const_iterator const it = base_t::insert(
+ begin_nonconst() + (ret.first - begin()), x);
+ return std::make_pair(it, true);
+ }
+ return std::make_pair(ret.first, false);
+ }
+
+ size_type erase( const Value& x )
+ {
+ std::pair<const_iterator, bool> const ret(Find_t()(begin(), end(), x));
+ if (ret.second)
+ {
+ base_t::erase(begin_nonconst() + (ret.first - begin()));
+ return 1;
+ }
+ return 0;
+ }
+
+ void erase( size_t index )
+ {
+ base_t::erase( begin_nonconst() + index );
+ }
+
+ // like C++ 2011: erase with const_iterator (doesn't change sort order)
+ void erase(const_iterator const& position)
+ { // C++98 has vector::erase(iterator), so call that
+ base_t::erase(begin_nonconst() + (position - begin()));
+ }
+
+ void erase(const_iterator const& first, const_iterator const& last)
+ {
+ base_t::erase(begin_nonconst() + (first - begin()),
+ begin_nonconst() + (last - begin()));
+ }
+
+ // ACCESSORS
+
+ // Only return a const iterator, so that the vector cannot be directly updated.
+ const_iterator begin() const
+ {
+ return base_t::begin();
+ }
+
+ // Only return a const iterator, so that the vector cannot be directly updated.
+ const_iterator end() const
+ {
+ return base_t::end();
+ }
+
+ const Value& front() const
+ {
+ return base_t::front();
+ }
+
+ const Value& back() const
+ {
+ return base_t::back();
+ }
+
+ const Value& operator[]( size_t index ) const
+ {
+ return base_t::operator[]( index );
+ }
+
+ // OPERATIONS
+
+ const_iterator lower_bound( const Value& x ) const
+ {
+ return std::lower_bound( base_t::begin(), base_t::end(), x, Compare() );
+ }
+
+ const_iterator upper_bound( const Value& x ) const
+ {
+ return std::upper_bound( base_t::begin(), base_t::end(), x, Compare() );
+ }
+
+ /* Searches the container for an element with a value of x
+ * and returns an iterator to it if found, otherwise it returns an
+ * iterator to sorted_vector::end (the element past the end of the container).
+ *
+ * Only return a const iterator, so that the vector cannot be directly updated.
+ */
+ const_iterator find( const Value& x ) const
+ {
+ std::pair<const_iterator, bool> const ret(Find_t()(begin(), end(), x));
+ return (ret.second) ? ret.first : end();
+ }
+
+ void insert(sorted_vector<Value,Compare,Find> const& rOther)
+ {
+ // optimisation for the rather common case that we are overwriting this with the contents
+ // of another sorted vector
+ if ( empty() )
+ {
+ base_t::insert(begin_nonconst(), rOther.begin(), rOther.end());
+ }
+ else
+ for( const_iterator it = rOther.begin(); it != rOther.end(); ++it )
+ insert( *it );
+ }
+
+ /* Clear() elements in the vector, and free them one by one. */
+ void DeleteAndDestroyAll()
+ {
+ for( const_iterator it = begin(); it != end(); ++it )
+ delete *it;
+ clear();
+ }
+
+ // fdo#58793: some existing code in Writer (SwpHintsArray)
+ // routinely modifies the members of the vector in a way that
+ // violates the sort order, and then re-sorts the array.
+ // This is a kludge to enable that code to work.
+ // If you are calling this function, you are Doing It Wrong!
+ void Resort()
+ {
+ std::stable_sort(begin_nonconst(), end_nonconst(), Compare());
+ }
+
+private:
+
+ typename base_t::iterator begin_nonconst() { return base_t::begin(); }
+ typename base_t::iterator end_nonconst() { return base_t::end(); }
+
+};
+
+
+/** Implements an ordering function over a pointer, where the comparison uses the < operator on the pointed-to types.
+ Very useful for the cases where we put pointers to objects inside a sorted_vector.
+*/
+template <class T> struct less_ptr_to : public std::binary_function <T*,T*,bool>
+{
+ bool operator() ( T* const& lhs, T* const& rhs ) const
+ {
+ return (*lhs) < (*rhs);
+ }
+};
+
+/** the elements are totally ordered by Compare,
+ for no 2 elements !Compare(a,b) && !Compare(b,a) is true
+ */
+template<class Value, class Compare>
+struct find_unique
+{
+ typedef typename sorted_vector<Value, Compare,
+ o3tl::find_unique> ::const_iterator const_iterator;
+ std::pair<const_iterator, bool> operator()(
+ const_iterator first, const_iterator last,
+ Value const& v)
+ {
+ const_iterator const it = std::lower_bound(first, last, v, Compare());
+ return std::make_pair(it, (it != last && !Compare()(v, *it)));
+ }
+};
+
+/** the elements are partially ordered by Compare,
+ 2 elements are allowed if they are not the same element (pointer equal)
+ */
+template<class Value, class Compare>
+struct find_partialorder_ptrequals
+{
+ typedef typename sorted_vector<Value, Compare,
+ o3tl::find_partialorder_ptrequals>::const_iterator const_iterator;
+ std::pair<const_iterator, bool> operator()(
+ const_iterator first, const_iterator last,
+ Value const& v)
+ {
+ std::pair<const_iterator, const_iterator> const its =
+ std::equal_range(first, last, v, Compare());
+ for (const_iterator it = its.first; it != its.second; ++it)
+ {
+ if (v == *it)
+ {
+ return std::make_pair(it, true);
+ }
+ }
+ return std::make_pair(its.first, false);
+ }
+};
+
+} // namespace o3tl
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/o3tl/vector_pool.hxx b/include/o3tl/vector_pool.hxx
new file mode 100644
index 000000000000..b132289af3ab
--- /dev/null
+++ b/include/o3tl/vector_pool.hxx
@@ -0,0 +1,123 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_O3TL_VECTOR_POOL_HXX
+#define INCLUDED_O3TL_VECTOR_POOL_HXX
+
+#include <sal/types.h>
+#include <vector>
+
+namespace o3tl
+{
+ namespace detail
+ {
+ template<typename ValueType, class Container> class simple_pool_impl :
+ public Container
+ {
+ typedef typename Container::value_type value_type;
+ std::ptrdiff_t mnFirstFreeIndex;
+
+ public:
+ simple_pool_impl() :
+ mnFirstFreeIndex(-1)
+ {}
+
+ std::ptrdiff_t alloc()
+ {
+ return store(ValueType());
+ }
+
+ std::ptrdiff_t store(const ValueType& rCopy)
+ {
+ if( mnFirstFreeIndex != -1 )
+ {
+ std::ptrdiff_t nIdx=mnFirstFreeIndex;
+ mnFirstFreeIndex = this->at(mnFirstFreeIndex).nextFree;
+ this->at(nIdx).value = rCopy;
+ this->at(nIdx).nextFree = -1;
+
+ return nIdx;
+ }
+ else
+ {
+ this->push_back(value_type(rCopy));
+ return this->size()-1;
+ }
+ }
+
+ void free( std::ptrdiff_t nIdx )
+ {
+ this->at(nIdx).nextFree = mnFirstFreeIndex;
+ mnFirstFreeIndex = nIdx;
+ }
+
+ const ValueType& get( std::ptrdiff_t nIdx ) const
+ {
+ return this->operator[](nIdx).value;
+ }
+ ValueType& get( std::ptrdiff_t nIdx )
+ {
+ return this->operator[](nIdx).value;
+ }
+ };
+
+ template< typename ValueType > struct struct_from_value
+ {
+ struct type
+ {
+ type() :
+ value(),
+ nextFree(-1)
+ {}
+ explicit type( const ValueType& val ) :
+ value(val),
+ nextFree(-1)
+ {}
+
+ ValueType value;
+ std::ptrdiff_t nextFree;
+ };
+ };
+ }
+
+ /** Simple vector-based memory pool allocator
+
+ This template can be used to provide simple pooled memory
+ allocation from a container class that adheres to the stl
+ random access container concept. Note that alloc/free works
+ with _indices_ into the container!
+
+ @example
+ <pre>
+vector_pool<type> myPool;
+int nIdx=myPool.alloc();
+myPool[nIdx] = myVal;
+ ... do stuff ...
+myPool.free(nIdx);
+ </pre>
+ */
+ template<typename ValueType> struct vector_pool :
+ public detail::simple_pool_impl<ValueType,
+ std::vector<typename detail::struct_from_value<ValueType>::type > >
+ {};
+}
+
+#endif /* INCLUDED_O3TL_VECTOR_POOL_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/binarycodec.hxx b/include/oox/core/binarycodec.hxx
new file mode 100644
index 000000000000..64b06d4244ef
--- /dev/null
+++ b/include/oox/core/binarycodec.hxx
@@ -0,0 +1,316 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_CORE_BINARYCODEC_HXX
+#define OOX_CORE_BINARYCODEC_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+
+#include <rtl/cipher.h>
+#include <rtl/digest.h>
+#include "oox/dllapi.h"
+
+namespace oox { class AttributeList; }
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+class OOX_DLLPUBLIC CodecHelper
+{
+public:
+ /** Returns the password hash if it is in the required 16-bit limit. */
+ static sal_uInt16 getPasswordHash( const AttributeList& rAttribs, sal_Int32 nElement );
+
+private:
+ CodecHelper();
+ ~CodecHelper();
+};
+
+// ============================================================================
+
+/** Encodes and decodes data from/to protected MS Office documents.
+
+ Implements a simple XOR encoding/decoding algorithm used in MS Office
+ versions up to MSO 95.
+ */
+class OOX_DLLPUBLIC BinaryCodec_XOR
+{
+public:
+ /** Enumerates codec types supported by this XOR codec implementation. */
+ enum CodecType
+ {
+ CODEC_WORD, ///< MS Word XOR codec.
+ CODEC_EXCEL ///< MS Excel XOR codec.
+ };
+
+public:
+ /** Default constructor.
+
+ Two-step construction in conjunction with the initKey() and verifyKey()
+ functions allows to try to initialize with different passwords (e.g.
+ built-in default password used for Excel workbook protection).
+ */
+ explicit BinaryCodec_XOR( CodecType eCodecType );
+
+ ~BinaryCodec_XOR();
+
+ /** Initializes the algorithm with the specified password.
+
+ @param pnPassData
+ Character array containing the password. Must be zero terminated,
+ which results in a maximum length of 15 characters.
+ */
+ void initKey( const sal_uInt8 pnPassData[ 16 ] );
+
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ bool initCodec( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aData );
+
+ /** Retrieves the encryption data
+
+ @return
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > getEncryptionData();
+
+ /** Verifies the validity of the password using the passed key and hash.
+
+ @precond
+ The codec must be initialized with the initKey() function before
+ this function can be used.
+
+ @param nKey
+ Password key value read from the file.
+ @param nHash
+ Password hash value read from the file.
+
+ @return
+ True = test was successful.
+ */
+ bool verifyKey( sal_uInt16 nKey, sal_uInt16 nHash ) const;
+
+ /** Reinitializes the codec to start a new memory block.
+
+ Resets the internal key offset to 0.
+
+ @precond
+ The codec must be initialized with the initKey() function before
+ this function can be used.
+ */
+ void startBlock();
+
+ /** Decodes a block of memory.
+
+ @precond
+ The codec must be initialized with the initKey() function before
+ this function can be used.
+
+ @param pnDestData
+ Destination buffer. Will contain the decrypted data afterwards.
+ @param pnSrcData
+ Encrypted data block.
+ @param nBytes
+ Size of the passed data blocks. pnDestData and pnSrcData must be of
+ this size.
+
+ @return
+ True = decoding was successful (no error occurred).
+ */
+ bool decode(
+ sal_uInt8* pnDestData,
+ const sal_uInt8* pnSrcData,
+ sal_Int32 nBytes );
+
+ /** Lets the cipher skip a specific amount of bytes.
+
+ This function sets the cipher to the same state as if the specified
+ amount of data has been decoded with one or more calls of decode().
+
+ @precond
+ The codec must be initialized with the initKey() function before
+ this function can be used.
+
+ @param nBytes
+ Number of bytes to be skipped (cipher "seeks" forward).
+
+ @return
+ True = skip was successful (no error occurred).
+ */
+ bool skip( sal_Int32 nBytes );
+
+private:
+ CodecType meCodecType; ///< Codec type.
+ sal_uInt8 mpnKey[ 16 ]; ///< Encryption key.
+ sal_Int32 mnOffset; ///< Key offset.
+ sal_uInt16 mnBaseKey; ///< Base key from password.
+ sal_uInt16 mnHash; ///< Hash value from password.
+};
+
+// ============================================================================
+
+/** Encodes and decodes data from protected MSO 97+ documents.
+
+ This is a wrapper class around low level cryptographic functions from RTL.
+ Implementation is based on the wvDecrypt package by Caolan McNamara:
+ http://www.csn.ul.ie/~caolan/docs/wvDecrypt.html
+ */
+class OOX_DLLPUBLIC BinaryCodec_RCF
+{
+public:
+ /** Default constructor.
+
+ Two-step construction in conjunction with the initKey() and verifyKey()
+ functions allows to try to initialize with different passwords (e.g.
+ built-in default password used for Excel workbook protection).
+ */
+ explicit BinaryCodec_RCF();
+
+ ~BinaryCodec_RCF();
+
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ bool initCodec( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aData );
+
+ /** Retrieves the encryption data
+
+ @return
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > getEncryptionData();
+
+ /** Initializes the algorithm with the specified password and document ID.
+
+ @param pnPassData
+ Unicode character array containing the password. Must be zero
+ terminated, which results in a maximum length of 15 characters.
+ @param pnSalt
+ Random salt data block read from or written to the file.
+ */
+ void initKey(
+ const sal_uInt16 pnPassData[ 16 ],
+ const sal_uInt8 pnSalt[ 16 ] );
+
+ /** Verifies the validity of the password using the passed salt data.
+
+ @precond
+ The codec must be initialized with the initKey() function before
+ this function can be used.
+
+ @param pnVerifier
+ Verifier block read from the file.
+ @param pnVerifierHash
+ Verifier hash read from the file.
+
+ @return
+ True = test was successful.
+ */
+ bool verifyKey(
+ const sal_uInt8 pnVerifier[ 16 ],
+ const sal_uInt8 pnVerifierHash[ 16 ] );
+
+ /** Rekeys the codec using the specified counter.
+
+ After reading a specific amount of data the cipher algorithm needs to
+ be rekeyed using a counter that counts the data blocks.
+
+ The block size is for example 512 bytes for MS Word files and 1024
+ bytes for MS Excel files.
+
+ @precond
+ The codec must be initialized with the initKey() function before
+ this function can be used.
+
+ @param nCounter
+ Block counter used to rekey the cipher.
+ */
+ bool startBlock( sal_Int32 nCounter );
+
+ /** Decodes a block of memory.
+
+ @see rtl_cipher_decode()
+
+ @precond
+ The codec must be initialized with the initKey() function before
+ this function can be used.
+
+ @param pnDestData
+ Destination buffer. Will contain the decrypted data afterwards.
+ @param pnSrcData
+ Encrypted data block.
+ @param nBytes
+ Size of the passed data blocks. pnDestData and pnSrcData must be of
+ this size.
+
+ @return
+ True = decoding was successful (no error occurred).
+ */
+ bool decode(
+ sal_uInt8* pnDestData,
+ const sal_uInt8* pnSrcData,
+ sal_Int32 nBytes );
+
+ /** Lets the cipher skip a specific amount of bytes.
+
+ This function sets the cipher to the same state as if the specified
+ amount of data has been decoded with one or more calls of decode().
+
+ @precond
+ The codec must be initialized with the initKey() function before
+ this function can be used.
+
+ @param nBytes
+ Number of bytes to be skipped (cipher "seeks" forward).
+
+ @return
+ True = skip was successful (no error occurred).
+ */
+ bool skip( sal_Int32 nBytes );
+
+private:
+ void InitKeyImpl(
+ const sal_uInt8 pKeyData[64],
+ const sal_uInt8 pUnique[16] );
+
+ rtlCipher mhCipher;
+ rtlDigest mhDigest;
+ sal_uInt8 mpnDigestValue[ RTL_DIGEST_LENGTH_MD5 ];
+ sal_uInt8 mpnUnique[16];
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/contexthandler.hxx b/include/oox/core/contexthandler.hxx
new file mode 100644
index 000000000000..f11dc1d6260a
--- /dev/null
+++ b/include/oox/core/contexthandler.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 OOX_CORE_CONTEXTHANDLER_HXX
+#define OOX_CORE_CONTEXTHANDLER_HXX
+
+#include <com/sun/star/xml/sax/XFastContextHandler.hpp>
+#include <boost/shared_ptr.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <rtl/ref.hxx>
+#include "oox/token/namespaces.hxx"
+#include "oox/token/tokens.hxx"
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace xml { namespace sax { class XLocator; } }
+} } }
+
+namespace oox { class SequenceInputStream; }
+
+namespace oox {
+namespace core {
+
+class XmlFilterBase;
+class FragmentHandler;
+struct Relation;
+class Relations;
+
+// ============================================================================
+
+class ContextHandler;
+typedef ::rtl::Reference< ContextHandler > ContextHandlerRef;
+
+struct FragmentBaseData;
+typedef ::boost::shared_ptr< FragmentBaseData > FragmentBaseDataRef;
+
+typedef ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastContextHandler > ContextHandler_BASE;
+
+class OOX_DLLPUBLIC ContextHandler : public ContextHandler_BASE
+{
+public:
+ explicit ContextHandler( const ContextHandler& rParent );
+ virtual ~ContextHandler();
+
+ /** Returns the filter instance. */
+ XmlFilterBase& getFilter() const;
+ /** Returns the relations of the current fragment. */
+ const Relations& getRelations() const;
+ /** Returns the full path of the current fragment. */
+ const OUString& getFragmentPath() const;
+
+ /** Returns the full fragment path for the target of the passed relation. */
+ OUString getFragmentPathFromRelation( const Relation& rRelation ) const;
+ /** Returns the full fragment path for the passed relation identifier. */
+ OUString getFragmentPathFromRelId( const OUString& rRelId ) const;
+ /** Returns the full fragment path for the first relation of the passed type. */
+ OUString getFragmentPathFromFirstType( const OUString& rType ) const;
+
+ // com.sun.star.xml.sax.XFastContextHandler interface ---------------------
+
+ virtual void SAL_CALL startFastElement( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL startUnknownElement( const OUString& Namespace, const OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endUnknownElement( const OUString& Namespace, const OUString& Name ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext( const OUString& Namespace, const OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL characters( const OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+ // record context interface -----------------------------------------------
+
+ virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void endRecord( sal_Int32 nRecId );
+
+protected:
+ /** Helper constructor for the FragmentHandler. */
+ explicit ContextHandler( const FragmentBaseDataRef& rxBaseData );
+
+ void implSetLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& rxLocator );
+
+#ifdef _MSC_VER
+ ContextHandler() {} // workaround
+#endif
+
+private:
+ ContextHandler& operator=( const ContextHandler& );
+
+private:
+ FragmentBaseDataRef mxBaseData; ///< Base data of the fragment.
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/contexthandler2.hxx b/include/oox/core/contexthandler2.hxx
new file mode 100644
index 000000000000..f1a0c7db38b2
--- /dev/null
+++ b/include/oox/core/contexthandler2.hxx
@@ -0,0 +1,272 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_CORE_CONTEXTHANDLER2_HXX
+#define OOX_CORE_CONTEXTHANDLER2_HXX
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include "oox/helper/attributelist.hxx"
+#include "oox/helper/binaryinputstream.hxx"
+#include "oox/core/contexthandler.hxx"
+#include "oox/dllapi.h"
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+const sal_Int32 XML_ROOT_CONTEXT = SAL_MAX_INT32;
+
+// ============================================================================
+
+struct ElementInfo;
+
+/** Helper class that provides a context stack.
+
+ Fragment handlers and context handlers derived from this helper class will
+ track the identifiers of the visited elements in a stack. The idea is to
+ use the same instance of a fragment handler or context handler to process
+ several nested elements in an XML stream. For that, the abstract function
+ onCreateContext() has to return 'this' for the passed element.
+
+ Derived classes have to implement the createFastChildContext(),
+ startFastElement(), characters(), and endFastElement() functions from the
+ com.sun.star.xml.sax.XFastContextHandler interface by simply forwarding
+ them to the respective implCreateChildContext(), implStartElement(),
+ implCharacters(), and implEndElement() functions of this helper. This is
+ implemented already in the classes ContextHandler2 and FragmentHandler2.
+ The new abstract functions have to be implemented according to the elements
+ to be processed.
+
+ Similarly, for binary import, derived classes have to forward the
+ createRecordContext(), startRecord(), and endRecord() functions from the
+ ContextHandler class to the implCreateRecordContext(), implStartRecord(),
+ and implEndRecord() functions of this helper. Again, this is implemented
+ already in the classes ContextHandler2 and FragmentHandler2.
+ */
+class OOX_DLLPUBLIC ContextHandler2Helper
+{
+public:
+ explicit ContextHandler2Helper( bool bEnableTrimSpace );
+ explicit ContextHandler2Helper( const ContextHandler2Helper& rParent );
+ virtual ~ContextHandler2Helper();
+
+ // allow instances to be stored in ::rtl::Reference
+ virtual void SAL_CALL acquire() throw() = 0;
+ virtual void SAL_CALL release() throw() = 0;
+
+ // interface --------------------------------------------------------------
+
+ /** Will be called to create a context handler for the passed element.
+
+ Usually 'this' can be returned to improve performance by reusing the
+ same instance to process several elements. Used by OOXML import only.
+ */
+ virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) = 0;
+
+ /** Will be called when a new element has been started.
+
+ This function is called at the context handler returned from
+ onCreateContext(), or, for root elements of an XML stream, at the
+ fragment handler itself.
+
+ The current element identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by OOXML import only.
+ */
+ virtual void onStartElement( const AttributeList& rAttribs ) = 0;
+
+ /** Will be called before a new child element starts, or if the current
+ element is about to be left.
+
+ This helper function collects all text fragments received by the
+ characters() function (such as encoded characters which are passed in
+ separate calls to the characters() function), and passes the
+ concatenated and trimmed string.
+
+ The current element identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by OOXML import only.
+ */
+ virtual void onCharacters( const OUString& rChars ) = 0;
+
+ /** Will be called when the current element is about to be left.
+
+ The current element identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by OOXML import only.
+ */
+ virtual void onEndElement() = 0;
+
+ /** Will be called to create a context handler for the passed record.
+
+ Usually 'this' can be returned to improve performance by reusing the
+ same instance to process several records. Used by BIFF import only.
+ */
+ virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) = 0;
+
+ /** Will be called when a new record block in a binary stream has been
+ started.
+
+ The current record identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by BIFF import only.
+ */
+ virtual void onStartRecord( SequenceInputStream& rStrm ) = 0;
+
+ /** Will be called when the current record block is about to be left.
+
+ The current record identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by BIFF import only.
+ */
+ virtual void onEndRecord() = 0;
+
+ // helpers ----------------------------------------------------------------
+
+ /** Returns the identifier of the currently processed element. Ignores MCE elements in stack */
+ sal_Int32 getCurrentElement() const;
+
+ /** Returns the identifier of the currently processed element - Including MCE root elements */
+ sal_Int32 getCurrentElementWithMce() const;
+
+ /** Returns true, if nElement contains the identifier of the currently
+ processed element. */
+ inline bool isCurrentElement( sal_Int32 nElement ) const
+ { return getCurrentElement() == nElement; }
+
+ /** Returns true, if either nElement1 or nElement2 contain the identifier
+ of the currently processed element. */
+ inline bool isCurrentElement( sal_Int32 nElement1, sal_Int32 nElement2 ) const
+ { return isCurrentElement( nElement1 ) || isCurrentElement( nElement2 ); }
+
+ /** Returns the identifier of the specified parent element. */
+ sal_Int32 getParentElement( sal_Int32 nCountBack = 1 ) const;
+
+ /** Returns true, if nElement contains the identifier of the specified
+ parent element. */
+ inline sal_Int32 isParentElement( sal_Int32 nElement, sal_Int32 nCountBack = 1 ) const
+ { return getParentElement( nCountBack ) == nElement; }
+
+ /** Returns true, if the element currently processed is the root element of
+ the context or fragment handler. */
+ bool isRootElement() const;
+
+ // implementation ---------------------------------------------------------
+
+protected:
+ /** Must be called from createFastChildContext() in derived classes. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler >
+ implCreateChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs );
+
+ /** Must be called from startFastElement() in derived classes. */
+ void implStartElement(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs );
+
+ /** Must be called from characters() in derived classes. */
+ void implCharacters( const OUString& rChars );
+
+ /** Must be called from endFastElement() in derived classes. */
+ void implEndElement( sal_Int32 nElement );
+
+ /** Must be called from createRecordContext() in derived classes. */
+ ContextHandlerRef implCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+
+ /** Must be called from startRecord() in derived classes. */
+ void implStartRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
+
+ /** Must be called from endRecord() in derived classes. */
+ void implEndRecord( sal_Int32 nRecId );
+
+private:
+ ContextHandler2Helper& operator=( const ContextHandler2Helper& );
+
+ ElementInfo& pushElementInfo( sal_Int32 nElement );
+ void popElementInfo();
+ void processCollectedChars();
+
+private:
+ typedef ::std::vector< ElementInfo > ContextStack;
+ typedef ::boost::shared_ptr< ContextStack > ContextStackRef;
+
+ ContextStackRef mxContextStack; ///< Stack of all processed elements.
+ size_t mnRootStackSize; ///< Stack size on construction time.
+ bool mbEnableTrimSpace; ///< True = trim whitespace in characters().
+};
+
+// ============================================================================
+
+class OOX_DLLPUBLIC ContextHandler2 : public ContextHandler, public ContextHandler2Helper
+{
+public:
+ explicit ContextHandler2( ContextHandler2Helper& rParent );
+ virtual ~ContextHandler2();
+
+ // resolve ambiguity from base classes
+ virtual void SAL_CALL acquire() throw() { ContextHandler::acquire(); }
+ virtual void SAL_CALL release() throw() { ContextHandler::release(); }
+
+ // com.sun.star.xml.sax.XFastContextHandler interface ---------------------
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw( ::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL startFastElement(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw( ::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL characters( const OUString& rChars )
+ throw( ::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL endFastElement( sal_Int32 nElement )
+ throw( ::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException );
+
+ // oox.core.ContextHandler interface --------------------------------------
+
+ virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void endRecord( sal_Int32 nRecId );
+
+ // oox.core.ContextHandler2Helper interface -------------------------------
+
+ virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onStartElement( const AttributeList& rAttribs );
+ virtual void onCharacters( const OUString& rChars );
+ virtual void onEndElement();
+
+ virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
+ virtual void onEndRecord();
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/fastparser.hxx b/include/oox/core/fastparser.hxx
new file mode 100644
index 000000000000..40b5e763998f
--- /dev/null
+++ b/include/oox/core/fastparser.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 OOX_CORE_FASTPARSER_HXX
+#define OOX_CORE_FASTPARSER_HXX
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/xml/sax/XFastParser.hpp>
+
+namespace oox {
+ struct NamespaceMap;
+ class StorageBase;
+}
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+/** Wrapper for a fast SAX parser that works on automatically generated OOXML
+ token and namespace identifiers.
+ */
+class FastParser
+{
+public:
+ explicit FastParser(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ~FastParser();
+
+ /** Registers an OOXML namespace at the parser. */
+ void registerNamespace( sal_Int32 nNamespaceId )
+ throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
+
+ /** Sets the passed document handler that will receive the SAX parser events. */
+ void setDocumentHandler(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastDocumentHandler >& rxDocHandler )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ /** Parses the passed SAX input source.
+ @param bCloseStream True = closes the stream in the input source after parsing. */
+ void parseStream( const ::com::sun::star::xml::sax::InputSource& rInputSource, bool bCloseStream = false )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException );
+
+ /** Parses the passed input stream.
+ @param bCloseStream True = closes the passed stream after parsing. */
+ void parseStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream,
+ const OUString& rStreamName, bool bCloseStream = false )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException );
+
+ /** Parses a stream from the passed storage with the specified name.
+ @param bCloseStream True = closes the stream after parsing. */
+ void parseStream( StorageBase& rStorage, const OUString& rStreamName, bool bCloseStream = false )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException );
+
+ OUString getNamespaceURL( const OUString& rPrefix )
+ throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
+
+ sal_Int32 getNamespaceId( const OUString& aUrl );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler >
+ getTokenHandler() const { return mxTokenHandler; }
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastParser >
+ mxParser;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler >
+ mxTokenHandler;
+ const NamespaceMap& mrNamespaceMap;
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/fasttokenhandler.hxx b/include/oox/core/fasttokenhandler.hxx
new file mode 100644
index 000000000000..05c7063d3925
--- /dev/null
+++ b/include/oox/core/fasttokenhandler.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 OOX_CORE_FASTTOKENHANDLER_HXX
+#define OOX_CORE_FASTTOKENHANDLER_HXX
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+namespace oox { class TokenMap; }
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::xml::sax::XFastTokenHandler > FastTokenHandler_BASE;
+
+/** Wrapper implementing the com.sun.star.xml.sax.XFastTokenHandler API interface
+ that provides access to the tokens generated from the internal token name list.
+ */
+class FastTokenHandler : public FastTokenHandler_BASE
+{
+public:
+ explicit FastTokenHandler();
+ virtual ~FastTokenHandler();
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
+
+ // XFastTokenHandler
+ virtual sal_Int32 SAL_CALL getToken( const OUString& rIdentifier ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getIdentifier( sal_Int32 nToken ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getUTF8Identifier( sal_Int32 nToken ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getTokenFromUTF8( const ::com::sun::star::uno::Sequence< sal_Int8 >& Identifier ) throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ const TokenMap& mrTokenMap; ///< Reference to global token map singleton.
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/filterbase.hxx b/include/oox/core/filterbase.hxx
new file mode 100644
index 000000000000..6f4fc40499c7
--- /dev/null
+++ b/include/oox/core/filterbase.hxx
@@ -0,0 +1,293 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_CORE_FILTERBASE_HXX
+#define OOX_CORE_FILTERBASE_HXX
+
+#include <memory>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/implbase5.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+#include "oox/helper/binarystreambase.hxx"
+#include "oox/helper/storagebase.hxx"
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace awt { struct DeviceInfo; }
+ namespace frame { class XFrame; }
+ namespace frame { class XModel; }
+ namespace drawing { class XShape; }
+ namespace graphic { class XGraphic; }
+ namespace io { class XInputStream; }
+ namespace io { class XOutputStream; }
+ namespace io { class XStream; }
+ namespace lang { class XMultiComponentFactory; }
+ namespace lang { class XMultiServiceFactory; }
+ namespace task { class XInteractionHandler; }
+ namespace task { class XStatusIndicator; }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace comphelper {
+ class IDocPasswordVerifier;
+ class MediaDescriptor;
+}
+
+namespace oox {
+ class GraphicHelper;
+ class ModelObjectHelper;
+}
+
+namespace oox { namespace ole {
+ class OleObjectHelper;
+ class VbaProject;
+} }
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+enum OoxmlVersion
+{
+ ECMA_DIALECT,
+ ISOIEC_29500_2008
+};
+
+struct FilterBaseImpl;
+
+typedef ::cppu::WeakImplHelper5<
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::document::XImporter,
+ ::com::sun::star::document::XExporter,
+ ::com::sun::star::document::XFilter >
+ FilterBase_BASE;
+
+class OOX_DLLPUBLIC FilterBase : public FilterBase_BASE, public ::cppu::BaseMutex
+{
+public:
+ explicit FilterBase(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ~FilterBase();
+
+ /** Returns true, if filter is an import filter. */
+ bool isImportFilter() const;
+ /** Returns true, if filter is an export filter. */
+ bool isExportFilter() const;
+
+ OoxmlVersion getVersion() const;
+
+ /** Derived classes implement import of the entire document. */
+ virtual bool importDocument() = 0;
+
+ /** Derived classes implement export of the entire document. */
+ virtual bool exportDocument() = 0;
+
+ // ------------------------------------------------------------------------
+
+ /** Returns the component context passed in the filter constructor (always existing). */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&
+ getComponentContext() const;
+
+ /** Returns the multi service factory of the component (always existing). */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
+ getServiceFactory() const;
+
+ /** Returns the document model (always existing). */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >&
+ getModel() const;
+
+ /** Returns the service factory provided by the document model (always existing). */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
+ getModelFactory() const;
+
+ /** Returns the frame that will contain the document model (may be null). */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
+ getTargetFrame() const;
+
+ /// Returns the parent shape to load into (if any)
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >&
+ getParentShape() const;
+
+ /** Returns the status indicator (may be null). */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator >&
+ getStatusIndicator() const;
+
+ /** Returns the FilterData */
+ ::comphelper::SequenceAsHashMap& getFilterData() const;
+
+ /** Returns the media descriptor. */
+ ::comphelper::MediaDescriptor& getMediaDescriptor() const;
+
+ /** Returns the URL of the imported or exported file. */
+ const OUString& getFileUrl() const;
+
+ /** Returns an absolute URL for the passed relative or absolute URL. */
+ OUString getAbsoluteUrl( const OUString& rUrl ) const;
+
+ /** Returns the base storage of the imported/exported file. */
+ StorageRef getStorage() const;
+
+ /** Opens and returns the specified input stream from the base storage.
+
+ @param rStreamName
+ The name of the embedded storage stream. The name may contain
+ slashes to open streams from embedded substorages. If base stream
+ access has been enabled in the storage, the base stream can be
+ accessed by passing an empty string as stream name.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ openInputStream( const OUString& rStreamName ) const;
+
+ /** Opens and returns the specified output stream from the base storage.
+
+ @param rStreamName
+ The name of the embedded storage stream. The name may contain
+ slashes to open streams from embedded substorages. If base stream
+ access has been enabled in the storage, the base stream can be
+ accessed by passing an empty string as stream name.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+ openOutputStream( const OUString& rStreamName ) const;
+
+ /** Commits changes to base storage (and substorages) */
+ void commitStorage() const;
+
+ // helpers ----------------------------------------------------------------
+
+ /** Returns a helper for the handling of graphics and graphic objects. */
+ GraphicHelper& getGraphicHelper() const;
+
+ /** Returns a helper with containers for various named drawing objects for
+ the imported document. */
+ ModelObjectHelper& getModelObjectHelper() const;
+
+ /** Returns a helper for the handling of OLE objects. */
+ ::oox::ole::OleObjectHelper& getOleObjectHelper() const;
+
+ /** Returns the VBA project manager. */
+ ::oox::ole::VbaProject& getVbaProject() const;
+
+ /** Imports the raw binary data from the specified stream.
+ @return True, if the data could be imported from the stream. */
+ bool importBinaryData( StreamDataSequence& orDataSeq, const OUString& rStreamName );
+
+ // com.sun.star.lang.XServiceInfo interface -------------------------------
+
+ virtual OUString SAL_CALL
+ getImplementationName()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL
+ supportsService( const OUString& rServiceName )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
+ getSupportedServiceNames()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ // com.sun.star.lang.XInitialization interface ----------------------------
+
+ /** Receives user defined arguments.
+
+ @param rArgs
+ the sequence of arguments passed to the filter. The implementation
+ expects one or two arguments. The first argument shall be the
+ com.sun.star.lang.XMultiServiceFactory interface of the global
+ service factory. The optional second argument may contain a
+ sequence of com.sun.star.beans.NamedValue objects. The different
+ filter implemetations may support different arguments.
+ */
+ virtual void SAL_CALL initialize(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rArgs )
+ throw( ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ // com.sun.star.document.XImporter interface ------------------------------
+
+ virtual void SAL_CALL setTargetDocument(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxDocument )
+ throw( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException );
+
+ // com.sun.star.document.XExporter interface ------------------------------
+
+ virtual void SAL_CALL setSourceDocument(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxDocument )
+ throw( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException );
+
+ // com.sun.star.document.XFilter interface --------------------------------
+
+ virtual sal_Bool SAL_CALL filter(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rMediaDescSeq )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL cancel()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ // ------------------------------------------------------------------------
+protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ implGetInputStream( ::comphelper::MediaDescriptor& rMediaDesc ) const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
+ implGetOutputStream( ::comphelper::MediaDescriptor& rMediaDesc ) const;
+
+private:
+ void setMediaDescriptor(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rMediaDescSeq );
+
+ /** Derived classes may create a specialized graphic helper, e.g. for
+ resolving palette colors. */
+ virtual GraphicHelper* implCreateGraphicHelper() const;
+
+ /** Derived classes create a VBA project manager object. */
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const = 0;
+
+ virtual OUString implGetImplementationName() const = 0;
+
+ virtual StorageRef implCreateStorage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream ) const = 0;
+ virtual StorageRef implCreateStorage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream ) const = 0;
+
+private:
+ ::std::auto_ptr< FilterBaseImpl > mxImpl;
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/filterdetect.hxx b/include/oox/core/filterdetect.hxx
new file mode 100644
index 000000000000..cd9573b0f0bd
--- /dev/null
+++ b/include/oox/core/filterdetect.hxx
@@ -0,0 +1,162 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_CORE_FILTERDETECT_HXX
+#define OOX_CORE_FILTERDETECT_HXX
+
+#include <vector>
+#include <com/sun/star/document/XExtendedFilterDetection.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace io { class XInputStream; }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace comphelper { class MediaDescriptor; }
+
+namespace oox { class AttributeList; }
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+/** Document handler specifically designed for detecting OOXML file formats.
+
+ It takes a reference to the filter string object via its constructor, and
+ puts the name of the detected filter to it, if it successfully finds one.
+ */
+class FilterDetectDocHandler : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastDocumentHandler >
+{
+public:
+ explicit FilterDetectDocHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, OUString& rFilter );
+ virtual ~FilterDetectDocHandler();
+
+ // XFastDocumentHandler
+ virtual void SAL_CALL startDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+ // XFastContextHandler
+ virtual void SAL_CALL startFastElement( sal_Int32 nElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL startUnknownElement( const OUString& Namespace, const OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endFastElement( sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endUnknownElement( const OUString& Namespace, const OUString& Name ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< XFastContextHandler > SAL_CALL createUnknownChildContext( const OUString& Namespace, const OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL characters( const OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ void parseRelationship( const AttributeList& rAttribs );
+
+ OUString getFilterNameFromContentType( const OUString& rContentType ) const;
+ void parseContentTypesDefault( const AttributeList& rAttribs );
+ void parseContentTypesOverride( const AttributeList& rAttribs );
+
+private:
+ typedef ::std::vector< sal_Int32 > ContextVector;
+
+ OUString& mrFilterName;
+ ContextVector maContextStack;
+ OUString maTargetPath;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
+};
+
+// ============================================================================
+
+class OOX_DLLPUBLIC FilterDetect : public ::cppu::WeakImplHelper2< ::com::sun::star::document::XExtendedFilterDetection, ::com::sun::star::lang::XServiceInfo >
+{
+public:
+ explicit FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual ~FilterDetect();
+
+ /** Tries to extract an unencrypted ZIP package from the passed media
+ descriptor.
+
+ First, this function checks if the input stream provided by the media
+ descriptor property 'InputStream' contains a ZIP package. If yes, this
+ stream is returned.
+
+ Second, this function checks if the 'ComponentData' property exists and
+ contains a sequence of com.sun.star.beans.NamedValue. If yes, a named
+ value is searched with the name 'DecryptedPackage' and a value of type
+ com.sun.star.io.XStream. If the input stream provided by this XStream
+ contains a ZIP package, this input stream is returned.
+
+ Third, this function checks if the input stream of the media descriptor
+ contains an OLE package. If yes, it checks the existence of the streams
+ 'EncryptionInfo' and 'EncyptedPackage' and tries to decrypt the package
+ into a temporary file. This may include requesting a password from the
+ media descriptor property 'Password' or from the user, using the
+ interaction handler provided by the descriptor. On success, and if the
+ decrypted package is a ZIP package, the XStream of the temporary file
+ is stored in the property 'ComponentData' of the media descriptor and
+ its input stream is returned.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ extractUnencryptedPackage( ::comphelper::MediaDescriptor& rMediaDesc ) const;
+
+ // com.sun.star.lang.XServiceInfo interface -------------------------------
+
+ virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
+
+ // com.sun.star.document.XExtendedFilterDetection interface ---------------
+
+ /** Detects MS Office 2007 file types and supports package decryption.
+
+ The following file types are detected:
+ - MS Word 2007 XML Document (*.docx, *.docm)
+ - MS Word 2007 XML Template (*.dotx, *.dotm)
+ - MS Excel 2007 XML Document (*.xlsx, *.xlsm)
+ - MS Excel 2007 BIFF12 Document (*.xlsb)
+ - MS Excel 2007 XML Template (*.xltx, *.xltm)
+ - MS Powerpoint 2007 XML Document (*.pptx, *.pptm)
+ - MS Powerpoint 2007 XML Template (*.potx, *.potm)
+
+ If the package is encrypted, the detection tries to decrypt it into a
+ temporary file. The user may be asked for a password. The XStream
+ interface of the temporary file will be stored in the 'ComponentData'
+ property of the passed media descriptor.
+ */
+ virtual OUString SAL_CALL
+ detect( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rMediaDescSeq )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/fragmenthandler.hxx b/include/oox/core/fragmenthandler.hxx
new file mode 100644
index 000000000000..236e212e6e32
--- /dev/null
+++ b/include/oox/core/fragmenthandler.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 OOX_CORE_FRAGMENTHANDLER_HXX
+#define OOX_CORE_FRAGMENTHANDLER_HXX
+
+#include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include "oox/core/contexthandler.hxx"
+#include "oox/core/relations.hxx"
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace io { class XInputStream; }
+} } }
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+/** Base data of a fragment.
+
+ This data is stored in a separate struct to make it accessible in every
+ child context handler of the fragment.
+ */
+struct FragmentBaseData
+{
+ XmlFilterBase& mrFilter;
+ const OUString maFragmentPath;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >
+ mxLocator;
+ RelationsRef mxRelations;
+
+ explicit FragmentBaseData(
+ XmlFilterBase& rFilter,
+ const OUString& rFragmentPath,
+ RelationsRef xRelations );
+};
+
+// ============================================================================
+
+/** Describes record identifiers used to create contexts in a binary stream.
+
+ If a record is used to start a new context, usually the record identifier
+ increased by 1 is used to mark the end of this context, e.g. the Excel
+ record SHEETDATA == 0x0091 starts the <sheetData> context, and the record
+ SHEETDATA_END == 0x0092 ends this context. But some records are used to
+ start a new context, though there is no identifier to end this context,
+ e.g. the ROW or EXTROW records. These record identifiers can be marked by
+ setting the mnEndRecId member of this struct to -1.
+ */
+struct RecordInfo
+{
+ sal_Int32 mnStartRecId; ///< Record identifier for context start.
+ sal_Int32 mnEndRecId; ///< Record identifier for context end, -1 = no record.
+};
+
+// ============================================================================
+
+typedef ::cppu::ImplInheritanceHelper1< ContextHandler, ::com::sun::star::xml::sax::XFastDocumentHandler > FragmentHandler_BASE;
+
+class OOX_DLLPUBLIC FragmentHandler : public FragmentHandler_BASE
+{
+public:
+ explicit FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath );
+ virtual ~FragmentHandler();
+
+ /** Returns the com.sun.star.xml.sax.XFastContextHandler interface of this context. */
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler >
+ getFastContextHandler() { return static_cast< ContextHandler* >( this ); }
+
+ // com.sun.star.xml.sax.XFastDocumentHandler interface --------------------
+
+ virtual void SAL_CALL startDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endDocument() throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& rxLocator ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+ // com.sun.star.xml.sax.XFastContextHandler interface ---------------------
+
+ virtual void SAL_CALL startFastElement( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL startUnknownElement( const OUString& Namespace, const OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endUnknownElement( const OUString& Namespace, const OUString& Name ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext( const OUString& Namespace, const OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL characters( const OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+ // XML stream handling ----------------------------------------------------
+
+ /** Opens the fragment stream referred by the own fragment path. Derived
+ classes may provide specilized stream implementations. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ openFragmentStream() const;
+
+ // binary records ---------------------------------------------------------
+
+ virtual const RecordInfo* getRecordInfos() const;
+
+protected:
+ explicit FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, RelationsRef xRelations );
+};
+
+typedef ::rtl::Reference< FragmentHandler > FragmentHandlerRef;
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/fragmenthandler2.hxx b/include/oox/core/fragmenthandler2.hxx
new file mode 100644
index 000000000000..21ad03619fd1
--- /dev/null
+++ b/include/oox/core/fragmenthandler2.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 OOX_CORE_FRAGMENTHANDLER2_HXX
+#define OOX_CORE_FRAGMENTHANDLER2_HXX
+
+#include "oox/core/contexthandler2.hxx"
+#include "oox/core/fragmenthandler.hxx"
+#include <vector>
+#include "oox/dllapi.h"
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+class OOX_DLLPUBLIC FragmentHandler2 : public FragmentHandler, public ContextHandler2Helper
+{
+protected:
+ enum MCE_STATE
+ {
+ MCE_UNUSED,
+ MCE_STARTED,
+ MCE_FOUND_CHOICE
+ };
+ ::std::vector<MCE_STATE> aMceState;
+
+ bool prepareMceContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+
+public:
+ explicit FragmentHandler2(
+ XmlFilterBase& rFilter,
+ const OUString& rFragmentPath,
+ bool bEnableTrimSpace = true );
+ virtual ~FragmentHandler2();
+
+ // resolve ambiguity from base classes
+ virtual void SAL_CALL acquire() throw() { FragmentHandler::acquire(); }
+ virtual void SAL_CALL release() throw() { FragmentHandler::release(); }
+
+ // com.sun.star.xml.sax.XFastContextHandler interface ---------------------
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw( ::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL startFastElement(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw( ::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL characters( const OUString& rChars )
+ throw( ::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL endFastElement( sal_Int32 nElement )
+ throw( ::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException );
+
+ // com.sun.star.xml.sax.XFastDocumentHandler interface --------------------
+
+ virtual void SAL_CALL startDocument()
+ throw( ::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL endDocument()
+ throw( ::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException );
+
+ // oox.core.ContextHandler interface --------------------------------------
+
+ virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void endRecord( sal_Int32 nRecId );
+
+ // oox.core.ContextHandler2Helper interface -------------------------------
+
+ virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onStartElement( const AttributeList& rAttribs );
+ virtual void onCharacters( const OUString& rChars );
+ virtual void onEndElement();
+
+ virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
+ virtual void onEndRecord();
+
+ // oox.core.FragmentHandler2 interface ------------------------------------
+
+ virtual void initializeImport();
+ virtual void finalizeImport();
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/recordparser.hxx b/include/oox/core/recordparser.hxx
new file mode 100644
index 000000000000..9e417c03d01a
--- /dev/null
+++ b/include/oox/core/recordparser.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_CORE_RECORDPARSER_HXX
+#define OOX_CORE_RECORDPARSER_HXX
+
+#include <map>
+#include <com/sun/star/io/IOException.hpp>
+#include <com/sun/star/xml/sax/SAXException.hpp>
+#include <rtl/ref.hxx>
+#include "oox/helper/binaryinputstream.hxx"
+
+namespace oox {
+namespace core {
+
+class FragmentHandler;
+struct RecordInfo;
+
+namespace prv { class Locator; }
+namespace prv { class ContextStack; }
+
+// ============================================================================
+
+struct RecordInputSource
+{
+ BinaryInputStreamRef mxInStream;
+ OUString maPublicId;
+ OUString maSystemId;
+};
+
+// ============================================================================
+
+class RecordParser
+{
+public:
+ explicit RecordParser();
+ virtual ~RecordParser();
+
+ void setFragmentHandler( const ::rtl::Reference< FragmentHandler >& rxHandler );
+
+ void parseStream( const RecordInputSource& rInputSource )
+ throw( ::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::RuntimeException );
+
+ inline const RecordInputSource& getInputSource() const { return maSource; }
+
+private:
+ /** Returns a RecordInfo struct that contains the passed record identifier
+ as context start identifier. */
+ const RecordInfo* getStartRecordInfo( sal_Int32 nRecId ) const;
+ /** Returns a RecordInfo struct that contains the passed record identifier
+ as context end identifier. */
+ const RecordInfo* getEndRecordInfo( sal_Int32 nRecId ) const;
+
+private:
+ typedef ::std::map< sal_Int32, RecordInfo > RecordInfoMap;
+
+ RecordInputSource maSource;
+ ::rtl::Reference< FragmentHandler > mxHandler;
+ ::rtl::Reference< prv::Locator > mxLocator;
+ ::std::auto_ptr< prv::ContextStack > mxStack;
+ RecordInfoMap maStartMap;
+ RecordInfoMap maEndMap;
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/relations.hxx b/include/oox/core/relations.hxx
new file mode 100644
index 000000000000..b78d0d3056eb
--- /dev/null
+++ b/include/oox/core/relations.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 OOX_CORE_RELATIONS_HXX
+#define OOX_CORE_RELATIONS_HXX
+
+#include <map>
+#include <boost/shared_ptr.hpp>
+#include "oox/helper/helper.hxx"
+#include "oox/dllapi.h"
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+/** Expands to an OUString containing an 'officeDocument' relation type created
+ from the passed literal(!) ASCII(!) character array. */
+#define CREATE_OFFICEDOC_RELATION_TYPE( ascii ) \
+ ( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/" ascii )
+
+/** Expands to an OUString containing a 'package' relation type created from
+ the passed literal(!) ASCII(!) character array. */
+#define CREATE_PACKAGE_RELATION_TYPE( ascii ) \
+ ( "http://schemas.openxmlformats.org/package/2006/relationships/" ascii )
+
+/** Expands to an OUString containing an MS Office specific relation type
+ created from the passed literal(!) ASCII(!) character array. */
+#define CREATE_MSOFFICE_RELATION_TYPE( ascii ) \
+ ( "http://schemas.microsoft.com/office/2006/relationships/" ascii )
+
+// ============================================================================
+
+struct Relation
+{
+ OUString maId;
+ OUString maType;
+ OUString maTarget;
+ bool mbExternal;
+
+ inline explicit Relation() : mbExternal( false ) {}
+};
+
+// ============================================================================
+
+class Relations;
+typedef ::boost::shared_ptr< Relations > RelationsRef;
+
+class OOX_DLLPUBLIC Relations : public ::std::map< OUString, Relation >
+{
+public:
+ explicit Relations( const OUString& rFragmentPath );
+
+ /** Returns the path of the fragment this relations collection is related to. */
+ inline const OUString& getFragmentPath() const { return maFragmentPath; }
+
+ /** Returns the relation with the passed relation identifier. */
+ const Relation* getRelationFromRelId( const OUString& rId ) const;
+ /** Returns the first relation with the passed type. */
+ const Relation* getRelationFromFirstType( const OUString& rType ) const;
+ /** Finds all relations associated with the passed type. */
+ RelationsRef getRelationsFromType( const OUString& rType ) const;
+
+ /** Returns the external target of the relation with the passed relation identifier. */
+ OUString getExternalTargetFromRelId( const OUString& rRelId ) const;
+ /** Returns the internal target of the relation with the passed relation identifier. */
+ OUString getInternalTargetFromRelId( const OUString& rRelId ) const;
+
+ /** Returns the full fragment path for the target of the passed relation. */
+ OUString getFragmentPathFromRelation( const Relation& rRelation ) const;
+ /** Returns the full fragment path for the passed relation identifier. */
+ OUString getFragmentPathFromRelId( const OUString& rRelId ) const;
+ /** Returns the full fragment path for the first relation of the passed type. */
+ OUString getFragmentPathFromFirstType( const OUString& rType ) const;
+
+private:
+ OUString maFragmentPath;
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/relationshandler.hxx b/include/oox/core/relationshandler.hxx
new file mode 100644
index 000000000000..d42e5d1ad8b7
--- /dev/null
+++ b/include/oox/core/relationshandler.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 OOX_CORE_RELATIONSHANDLER_HXX
+#define OOX_CORE_RELATIONSHANDLER_HXX
+
+#include "oox/core/fragmenthandler.hxx"
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+class RelationsFragment : public FragmentHandler
+{
+public:
+ explicit RelationsFragment(
+ XmlFilterBase& rFilter,
+ RelationsRef xRelations );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ RelationsRef mxRelations;
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/xmlfilterbase.hxx b/include/oox/core/xmlfilterbase.hxx
new file mode 100644
index 000000000000..4b5c1e093657
--- /dev/null
+++ b/include/oox/core/xmlfilterbase.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 OOX_CORE_XMLFILTERBASE_HXX
+#define OOX_CORE_XMLFILTERBASE_HXX
+
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/text/XTextCursor.hpp>
+#include <com/sun/star/text/XTextField.hpp>
+#include <rtl/ref.hxx>
+#include <rtl/string.hxx>
+#include <rtl/ustring.hxx>
+#include "oox/core/filterbase.hxx"
+#include "oox/core/relations.hxx"
+#include "oox/drawingml/table/tablestylelist.hxx"
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace container { class XNameContainer; }
+ namespace document { class XDocumentProperties; }
+ namespace xml { namespace dom { class XDocument; } }
+ namespace xml { namespace sax { class XLocator; } }
+ namespace xml { namespace sax { class XFastDocumentHandler; } }
+ namespace xml { namespace sax { class XFastSAXSerializable; } }
+} } }
+
+namespace oox {
+ namespace drawingml { class Theme; }
+ namespace drawingml { namespace chart { class ChartConverter; } }
+ namespace vml { class Drawing; }
+}
+
+namespace sax_fastparser {
+ class FastSerializerHelper;
+
+ typedef boost::shared_ptr< FastSerializerHelper > FSHelperPtr;
+}
+
+namespace oox {
+namespace core {
+
+class FragmentHandler;
+
+// ============================================================================
+
+struct TextField {
+ com::sun::star::uno::Reference< com::sun::star::text::XText > xText;
+ com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > xTextCursor;
+ com::sun::star::uno::Reference< com::sun::star::text::XTextField > xTextField;
+};
+typedef std::vector< TextField > TextFieldStack;
+
+// ============================================================================
+
+struct XmlFilterBaseImpl;
+
+class OOX_DLLPUBLIC XmlFilterBase : public FilterBase
+{
+public:
+ explicit XmlFilterBase(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ~XmlFilterBase();
+
+ /** Has to be implemented by each filter, returns the current theme. */
+ virtual const ::oox::drawingml::Theme*
+ getCurrentTheme() const = 0;
+
+ /** Has to be implemented by each filter to return the collection of VML shapes. */
+ virtual ::oox::vml::Drawing* getVmlDrawing() = 0;
+
+ /** Has to be implemented by each filter, returns a filter-specific chart
+ converter object, that should be global per imported document. */
+ virtual ::oox::drawingml::chart::ChartConverter* getChartConverter() = 0;
+
+ /** Has to be implemented by each filter to return the table style list. */
+ virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles() = 0;
+
+ // ------------------------------------------------------------------------
+
+ /** Returns the fragment path from the first relation of the passed type,
+ used for fragments referred by the root relations. */
+ OUString getFragmentPathFromFirstType( const OUString& rType );
+
+ /** Imports a fragment using the passed fragment handler, which contains
+ the full path to the fragment stream.
+
+ @return True, if the fragment could be imported.
+ */
+ bool importFragment( const ::rtl::Reference< FragmentHandler >& rxHandler );
+
+ /** Imports a fragment into an xml::dom::XDocument.
+
+ @param rFragmentPath path to fragment
+
+ @return a non-empty reference to the XDocument, if the
+ fragment could be imported.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::dom::XDocument> importFragment( const OUString& rFragmentPath );
+
+ /** Imports a fragment from an xml::dom::XDocument using the
+ passed fragment handler
+
+ @param rxHandler fragment handler; path to fragment is
+ ignored, input source is the rxSerializer
+
+ @param rxSerializer usually retrieved from a
+ xml::dom::XDocument, will get serialized into rxHandler
+
+ @return true, if the fragment could be imported.
+ */
+ bool importFragment( const ::rtl::Reference< FragmentHandler >& rxHandler,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XFastSAXSerializable >& rxSerializer );
+
+ /** Imports the relations fragment associated with the specified fragment.
+
+ @return The relations collection of the specified fragment.
+ */
+ RelationsRef importRelations( const OUString& rFragmentPath );
+
+ /** Adds new relation.
+
+ @param rType
+ Relation type.
+
+ @param rTarget
+ Relation target.
+
+ @return Added relation Id.
+ */
+ OUString addRelation( const OUString& rType, const OUString& rTarget, bool bExternal = false );
+
+ /** Adds new relation to part's relations.
+
+ @param rPartName
+ Part name the relations are related to. The relations will be stored in <rPartName::path>/_rels/<rPartName::name>.rels.
+
+ @param rType
+ Relation type.
+
+ @param rTarget
+ Relation target.
+
+ @return Added relation Id.
+ */
+ OUString addRelation( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xOutputStream, const OUString& rType, const OUString& rTarget, bool bExternal = false );
+
+ /** Returns a stack of used textfields, used by the pptx importer to replace links to slidepages with rhe real page name */
+ TextFieldStack& getTextFieldStack() const;
+
+ /** Opens and returns the specified output stream from the base storage with specified media type.
+
+ @param rStreamName
+ The name of the embedded storage stream. The name may contain
+ slashes to open streams from embedded substorages. If base stream
+ access has been enabled in the storage, the base stream can be
+ accessed by passing an empty string as stream name.
+
+ @param rMediaType
+ The media type string, used in [Content_Types].xml stream in base
+ storage.
+
+ @return The opened output stream.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+ openFragmentStream(
+ const OUString& rStreamName,
+ const OUString& rMediaType );
+
+ /** Opens specified output stream from the base storage with specified
+ media type and returns new fast serializer for that stream.
+
+ @param rStreamName
+ The name of the embedded storage stream. The name may contain
+ slashes to open streams from embedded substorages. If base stream
+ access has been enabled in the storage, the base stream can be
+ accessed by passing an empty string as stream name.
+
+ @param rMediaType
+ The media type string, used in [Content_Types].xml stream in base
+ storage.
+
+ @return newly created serializer helper.
+ */
+ ::sax_fastparser::FSHelperPtr
+ openFragmentStreamWithSerializer(
+ const OUString& rStreamName,
+ const OUString& rMediaType );
+
+ /** Returns new unique ID for exported document.
+
+ @return newly created ID.
+ */
+ inline sal_Int32 GetUniqueId() { return mnMaxDocId++; }
+ inline OString GetUniqueIdOString() { return OString::valueOf( mnMaxDocId++ ); }
+ inline OUString GetUniqueIdOUString() { return OUString::valueOf( mnMaxDocId++ ); }
+
+ /** Write the document properties into into the current OPC package.
+
+ @param xProperties The document properties to export.
+
+ @return *this
+ */
+ XmlFilterBase& exportDocumentProperties( ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > xProperties );
+
+ OUString getNamespaceURL( const OUString& rPrefix );
+
+ sal_Int32 getNamespaceId( const OUString& rUrl );
+
+ void importDocumentProperties();
+
+protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ implGetInputStream( ::comphelper::MediaDescriptor& rMediaDesc ) const;
+
+private:
+ virtual StorageRef implCreateStorage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream ) const;
+ virtual StorageRef implCreateStorage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream ) const;
+
+private:
+ ::std::auto_ptr< XmlFilterBaseImpl > mxImpl;
+ sal_Int32 mnRelId;
+ sal_Int32 mnMaxDocId;
+};
+
+typedef ::rtl::Reference< XmlFilterBase > XmlFilterRef;
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/dllapi.h b/include/oox/dllapi.h
new file mode 100644
index 000000000000..6026aef0ae58
--- /dev/null
+++ b/include/oox/dllapi.h
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_OOX_DLLAPI_H
+#define INCLUDED_OOX_DLLAPI_H
+
+#include "sal/types.h"
+
+#if defined OOX_DLLIMPLEMENTATION
+#define OOX_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define OOX_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/axiscontext.hxx b/include/oox/drawingml/chart/axiscontext.hxx
new file mode 100644
index 000000000000..d22a53f23227
--- /dev/null
+++ b/include/oox/drawingml/chart/axiscontext.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 OOX_DRAWINGML_CHART_AXISCONTEXT_HXX
+#define OOX_DRAWINGML_CHART_AXISCONTEXT_HXX
+
+#include "oox/drawingml/chart/chartcontextbase.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct AxisDispUnitsModel;
+
+/** Handler for a value axis display units context (c:dispUnits element).
+ */
+class AxisDispUnitsContext : public ContextBase< AxisDispUnitsModel >
+{
+public:
+ explicit AxisDispUnitsContext( ::oox::core::ContextHandler2Helper& rParent, AxisDispUnitsModel& rModel );
+ virtual ~AxisDispUnitsContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+struct AxisModel;
+
+/** Base class for axis context handlers (c:catAx, c:dateAx, c:serAx, c:valAx
+ elements).
+ */
+class AxisContextBase : public ContextBase< AxisModel >
+{
+public:
+ explicit AxisContextBase( ::oox::core::ContextHandler2Helper& rParent, AxisModel& rModel );
+ virtual ~AxisContextBase();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for a category axis context (c:catAx element).
+ */
+class CatAxisContext : public AxisContextBase
+{
+public:
+ explicit CatAxisContext( ::oox::core::ContextHandler2Helper& rParent, AxisModel& rModel );
+ virtual ~CatAxisContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for a date axis context (c:dateAx element).
+ */
+class DateAxisContext : public AxisContextBase
+{
+public:
+ explicit DateAxisContext( ::oox::core::ContextHandler2Helper& rParent, AxisModel& rModel );
+ virtual ~DateAxisContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for a series axis context (c:serAx element).
+ */
+class SerAxisContext : public AxisContextBase
+{
+public:
+ explicit SerAxisContext( ::oox::core::ContextHandler2Helper& rParent, AxisModel& rModel );
+ virtual ~SerAxisContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for a value axis context (c:valAx element).
+ */
+class ValAxisContext : public AxisContextBase
+{
+public:
+ explicit ValAxisContext( ::oox::core::ContextHandler2Helper& rParent, AxisModel& rModel );
+ virtual ~ValAxisContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/axisconverter.hxx b/include/oox/drawingml/chart/axisconverter.hxx
new file mode 100644
index 000000000000..fac1d67c8997
--- /dev/null
+++ b/include/oox/drawingml/chart/axisconverter.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 OOX_DRAWINGML_CHART_AXISCONVERTER_HXX
+#define OOX_DRAWINGML_CHART_AXISCONVERTER_HXX
+
+#include "oox/drawingml/chart/converterbase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace chart2 { class XAxis; }
+ namespace chart2 { class XCoordinateSystem; }
+} } }
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct AxisModel;
+class TypeGroupConverter;
+
+class AxisConverter : public ConverterBase< AxisModel >
+{
+public:
+ explicit AxisConverter(
+ const ConverterRoot& rParent,
+ AxisModel& rModel );
+ virtual ~AxisConverter();
+
+ /** Creates a chart2 axis and inserts it into the passed coordinate system. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem >& rxCoordSystem,
+ TypeGroupConverter& rTypeGroup,
+ const AxisModel* pCrossingAxis,
+ sal_Int32 nAxesSetIdx,
+ sal_Int32 nAxisIdx );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/axismodel.hxx b/include/oox/drawingml/chart/axismodel.hxx
new file mode 100644
index 000000000000..30ceae499b0a
--- /dev/null
+++ b/include/oox/drawingml/chart/axismodel.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 OOX_DRAWINGML_CHART_AXISMODEL_HXX
+#define OOX_DRAWINGML_CHART_AXISMODEL_HXX
+
+#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/chart/titlemodel.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct AxisDispUnitsModel
+{
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< TextBody > TextBodyRef;
+ typedef ModelRef< LayoutModel > LayoutRef;
+ typedef ModelRef< TextModel > TextRef;
+
+ ShapeRef mxShapeProp; /// Label frame formatting.
+ TextBodyRef mxTextProp; /// Label text formatting.
+ LayoutRef mxLayout; /// Layout/position of the axis units label.
+ TextRef mxText; /// Text source of the axis units label.
+ double mfCustomUnit; /// Custom unit size on value axis.
+ sal_Int32 mnBuiltInUnit; /// Built-in unit on value axis.
+
+ explicit AxisDispUnitsModel();
+ ~AxisDispUnitsModel();
+};
+
+// ============================================================================
+
+struct AxisModel
+{
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< TextBody > TextBodyRef;
+ typedef ModelRef< TitleModel > TitleRef;
+ typedef ModelRef< AxisDispUnitsModel > AxisDispUnitsRef;
+
+ ShapeRef mxShapeProp; /// Axis line formatting.
+ TextBodyRef mxTextProp; /// Axis label text formatting.
+ TitleRef mxTitle; /// Axis title.
+ AxisDispUnitsRef mxDispUnits; /// Axis units label.
+ ShapeRef mxMajorGridLines; /// Major grid lines formatting.
+ ShapeRef mxMinorGridLines; /// Minor grid lines formatting.
+ NumberFormat maNumberFormat; /// Number format for axis tick labels.
+ OptValue< double > mofCrossesAt; /// Position on this axis where another axis crosses.
+ OptValue< double > mofMajorUnit; /// Unit for major tick marks on date/value axis.
+ OptValue< double > mofMinorUnit; /// Unit for minor tick marks on date/value axis.
+ OptValue< double > mofLogBase; /// Logarithmic base for logarithmic axes.
+ OptValue< double > mofMax; /// Maximum axis value.
+ OptValue< double > mofMin; /// Minimum axis value.
+ OptValue< sal_Int32 > monBaseTimeUnit; /// Base time unit shown on a date axis.
+ sal_Int32 mnAxisId; /// Unique axis identifier.
+ sal_Int32 mnAxisPos; /// Position of the axis (top/bottom/left/right).
+ sal_Int32 mnCrossAxisId; /// Identifier of a crossing axis.
+ sal_Int32 mnCrossBetween; /// This value axis crosses between or inside category.
+ sal_Int32 mnCrossMode; /// Mode this axis crosses another axis (min, max, auto).
+ sal_Int32 mnLabelAlign; /// Tick mark label alignment.
+ sal_Int32 mnLabelOffset; /// Tick mark label distance from axis.
+ sal_Int32 mnMajorTickMark; /// Major tick mark style.
+ sal_Int32 mnMajorTimeUnit; /// Time unit for major tick marks on date axis.
+ sal_Int32 mnMinorTickMark; /// Mainor tick mark style.
+ sal_Int32 mnMinorTimeUnit; /// Time unit for minor tick marks on date axis.
+ sal_Int32 mnOrientation; /// Axis orientation (value order min to max, or max to min).
+ sal_Int32 mnTickLabelPos; /// Position of tick mark labels relative to the axis.
+ sal_Int32 mnTickLabelSkip; /// Number of tick mark labels to skip.
+ sal_Int32 mnTickMarkSkip; /// Number of tick marks to skip.
+ sal_Int32 mnTypeId; /// Type identifier of this axis.
+ bool mbAuto; /// True = automatic selection of text/date axis type.
+ bool mbDeleted; /// True = axis has been deleted manually.
+ bool mbNoMultiLevel; /// True = no multi-level categories supported.
+
+ explicit AxisModel( sal_Int32 nTypeId );
+ ~AxisModel();
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/chartcontextbase.hxx b/include/oox/drawingml/chart/chartcontextbase.hxx
new file mode 100644
index 000000000000..218e7bf4406e
--- /dev/null
+++ b/include/oox/drawingml/chart/chartcontextbase.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 OOX_DRAWINGML_CHART_CHARTCONTEXTBASE_HXX
+#define OOX_DRAWINGML_CHART_CHARTCONTEXTBASE_HXX
+
+#include "oox/core/fragmenthandler2.hxx"
+
+namespace oox { namespace drawingml { class Shape; } }
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+template< typename ModelType >
+class ContextBase : public ::oox::core::ContextHandler2
+{
+public:
+ inline explicit ContextBase( ::oox::core::ContextHandler2Helper& rParent, ModelType& rModel ) :
+ ::oox::core::ContextHandler2( rParent ), mrModel( rModel ) {}
+ virtual ~ContextBase() {}
+
+protected:
+ ModelType& mrModel;
+};
+
+// ============================================================================
+
+template< typename ModelType >
+class FragmentBase : public ::oox::core::FragmentHandler2
+{
+public:
+ explicit FragmentBase( ::oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, ModelType& rModel ) :
+ ::oox::core::FragmentHandler2( rFilter, rFragmentPath, false ), mrModel( rModel ) {}
+ virtual ~FragmentBase() {}
+
+protected:
+ ModelType& mrModel;
+};
+
+// ============================================================================
+
+/** Help class for all contexts that have only the c:spPr child element.
+ */
+class ShapePrWrapperContext : public ContextBase< Shape >
+{
+public:
+ explicit ShapePrWrapperContext( ::oox::core::ContextHandler2Helper& rParent, Shape& rModel );
+ virtual ~ShapePrWrapperContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+struct LayoutModel;
+
+/** Handler for a chart layout context (c:layout element).
+ */
+class LayoutContext : public ContextBase< LayoutModel >
+{
+public:
+ explicit LayoutContext( ::oox::core::ContextHandler2Helper& rParent, LayoutModel& rModel );
+ virtual ~LayoutContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/chartconverter.hxx b/include/oox/drawingml/chart/chartconverter.hxx
new file mode 100644
index 000000000000..bbc7e0fafd28
--- /dev/null
+++ b/include/oox/drawingml/chart/chartconverter.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 OOX_DRAWINGML_CHART_CHARTCONVERTER_HXX
+#define OOX_DRAWINGML_CHART_CHARTCONVERTER_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <oox/dllapi.h>
+
+namespace com { namespace sun { namespace star {
+ namespace awt { struct Point; }
+ namespace awt { struct Size; }
+ namespace drawing { class XShapes; }
+ namespace chart2 { class XChartDocument; }
+ namespace chart2 { namespace data { class XDataProvider; } }
+ namespace chart2 { namespace data { class XDataSequence; } }
+} } }
+
+namespace oox { namespace core { class XmlFilterBase; } }
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+struct ChartSpaceModel;
+struct DataSequenceModel;
+
+// ============================================================================
+
+class OOX_DLLPUBLIC ChartConverter
+{
+public:
+ explicit ChartConverter();
+ virtual ~ChartConverter();
+
+ /** Converts the passed OOXML chart model to the passed chart2 document.
+
+ @param rChartModel The filled MSOOXML chart model structure.
+
+ @param rxChartDoc The UNO chart document model to be initialized.
+
+ @param rxExternalPage If null, all embedded shapes will be inserted
+ into the internal drawing page of the chart document. If not null,
+ all embedded shapes will be inserted into this shapes collection.
+
+ @param rChartPos The position of the chart shape in its drawing page,
+ in 1/100 mm. Will be used only, if parameter rxExternalPage is not
+ null, for correct positioning of the embedded shapes in the
+ external drawing page.
+
+ @param rChartSize The size of the chart shape in 1/100 mm. Needed for
+ calculation of position and size of the chart elements (diagram,
+ titles, legend, etc.) and embedded shapes.
+ */
+ void convertFromModel(
+ ::oox::core::XmlFilterBase& rFilter,
+ ChartSpaceModel& rChartModel,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxExternalPage,
+ const ::com::sun::star::awt::Point& rChartPos,
+ const ::com::sun::star::awt::Size& rChartSize );
+
+ /** Creates an internal data provider. Derived classes may override this
+ function to create an external data provider. */
+ virtual void createDataProvider(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc );
+
+ /** Creates a data sequence from a formula. Dummy implementation. Derived
+ classes have to override this function to actually parse the formula. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >
+ createDataSequence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider >& rxDataProvider,
+ const DataSequenceModel& rDataSeq );
+
+private:
+ ChartConverter( const ChartConverter& );
+ ChartConverter& operator=( const ChartConverter& );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/chartdrawingfragment.hxx b/include/oox/drawingml/chart/chartdrawingfragment.hxx
new file mode 100644
index 000000000000..43d27f586514
--- /dev/null
+++ b/include/oox/drawingml/chart/chartdrawingfragment.hxx
@@ -0,0 +1,115 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_CHART_CHARTDRAWINGFRAGMENT_HXX
+#define OOX_DRAWINGML_CHART_CHARTDRAWINGFRAGMENT_HXX
+
+#include "oox/core/fragmenthandler2.hxx"
+#include "oox/drawingml/shape.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+/** Relative shape position in a chart object. */
+struct AnchorPosModel
+{
+ double mfX; /// X coordinate relative to chart object (0.0 to 1.0).
+ double mfY; /// Y coordinate relative to chart object (0.0 to 1.0).
+
+ inline explicit AnchorPosModel() : mfX( -1.0 ), mfY( -1.0 ) {}
+ inline bool isValid() const { return (0.0 <= mfX) && (mfX <= 1.0) && (0.0 <= mfY) && (mfY <= 1.0); }
+};
+
+// ----------------------------------------------------------------------------
+
+/** Absolute shape size in a chart object (in EMUs). */
+struct AnchorSizeModel : public EmuSize
+{
+ inline explicit AnchorSizeModel() : EmuSize( -1, -1 ) {}
+ inline bool isValid() const { return (Width >= 0) && (Height >= 0); }
+};
+
+// ============================================================================
+
+/** Contains the position of a shape in the chart object. Supports different
+ shape anchor modes (absolute, relative).
+ */
+class ShapeAnchor
+{
+public:
+ explicit ShapeAnchor( bool bRelSize );
+
+ /** Imports the absolute anchor size from the cdr:ext element. */
+ void importExt( const AttributeList& rAttribs );
+ /** Sets an the relative anchor position from the cdr:from or cdr:to element. */
+ void setPos( sal_Int32 nElement, sal_Int32 nParentContext, const OUString& rValue );
+
+ /** Calculates the resulting shape anchor in EMUs. */
+ EmuRectangle calcAnchorRectEmu( const EmuRectangle& rChartRect ) const;
+
+private:
+ AnchorPosModel maFrom; /// Top-left position relative to chart object.
+ AnchorPosModel maTo; /// Bottom-right position relative to chart object.
+ AnchorSizeModel maSize; /// Shape size, if anchor has absolute size.
+ bool mbRelSize; /// True = relative size, false = absolute size.
+};
+
+typedef ::boost::shared_ptr< ShapeAnchor > ShapeAnchorRef;
+
+// ============================================================================
+
+/** Handler for a chart drawing fragment (c:userShapes root element).
+ */
+class ChartDrawingFragment : public ::oox::core::FragmentHandler2
+{
+public:
+ explicit ChartDrawingFragment(
+ ::oox::core::XmlFilterBase& rFilter,
+ const OUString& rFragmentPath,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxDrawPage,
+ const ::com::sun::star::awt::Size& rChartSize,
+ const ::com::sun::star::awt::Point& rShapesOffset,
+ bool bOleSupport );
+ virtual ~ChartDrawingFragment();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onCharacters( const OUString& rChars );
+ virtual void onEndElement();
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
+ mxDrawPage; /// Drawing page of this sheet.
+ ::oox::drawingml::ShapePtr mxShape; /// Current top-level shape.
+ ShapeAnchorRef mxAnchor; /// Current anchor of top-level shape.
+ EmuRectangle maChartRectEmu; /// Position and size of the chart object for embedded shapes (in EMUs).
+ bool mbOleSupport; /// True = allow to insert OLE objects into the drawing page.
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/chartspaceconverter.hxx b/include/oox/drawingml/chart/chartspaceconverter.hxx
new file mode 100644
index 000000000000..2bdeb013b1b3
--- /dev/null
+++ b/include/oox/drawingml/chart/chartspaceconverter.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 OOX_DRAWINGML_CHART_CHARTSPACECONVERTER_HXX
+#define OOX_DRAWINGML_CHART_CHARTSPACECONVERTER_HXX
+
+#include "oox/drawingml/chart/converterbase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace drawing { class XShapes; }
+} } }
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct ChartSpaceModel;
+
+class ChartSpaceConverter : public ConverterBase< ChartSpaceModel >
+{
+public:
+ explicit ChartSpaceConverter( const ConverterRoot& rParent, ChartSpaceModel& rModel );
+ virtual ~ChartSpaceConverter();
+
+ /** Converts the contained OOXML chart model to a chart2 document. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxExternalPage,
+ const ::com::sun::star::awt::Point& rChartPos );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/chartspacefragment.hxx b/include/oox/drawingml/chart/chartspacefragment.hxx
new file mode 100644
index 000000000000..c9b1e0c6b776
--- /dev/null
+++ b/include/oox/drawingml/chart/chartspacefragment.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 OOX_DRAWINGML_CHART_CHARTSPACEFRAGMENT_HXX
+#define OOX_DRAWINGML_CHART_CHARTSPACEFRAGMENT_HXX
+
+#include "oox/drawingml/chart/chartcontextbase.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct ChartSpaceModel;
+
+/** Handler for a chart fragment (c:chartSpace root element).
+ */
+class ChartSpaceFragment : public FragmentBase< ChartSpaceModel >
+{
+public:
+ explicit ChartSpaceFragment(
+ ::oox::core::XmlFilterBase& rFilter,
+ const OUString& rFragmentPath,
+ ChartSpaceModel& rModel );
+ virtual ~ChartSpaceFragment();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/chartspacemodel.hxx b/include/oox/drawingml/chart/chartspacemodel.hxx
new file mode 100644
index 000000000000..b3d3405c4670
--- /dev/null
+++ b/include/oox/drawingml/chart/chartspacemodel.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 OOX_DRAWINGML_CHART_CHARTSPACEMODEL_HXX
+#define OOX_DRAWINGML_CHART_CHARTSPACEMODEL_HXX
+
+#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/chart/plotareamodel.hxx"
+#include "oox/drawingml/chart/titlemodel.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct ChartSpaceModel
+{
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< TextBody > TextBodyRef;
+ typedef ModelRef< PlotAreaModel > PlotAreaRef;
+ typedef ModelRef< WallFloorModel > WallFloorRef;
+ typedef ModelRef< View3DModel > View3DRef;
+ typedef ModelRef< TitleModel > TitleRef;
+ typedef ModelRef< LegendModel > LegendRef;
+
+ ShapeRef mxShapeProp; /// Chart frame formatting.
+ TextBodyRef mxTextProp; /// Global chart text formatting.
+ PlotAreaRef mxPlotArea; /// Plot area of the chart.
+ WallFloorRef mxFloor; /// Floor formatting in 3D charts.
+ WallFloorRef mxBackWall; /// Back wall formatting in 3D charts.
+ WallFloorRef mxSideWall; /// Side wall formatting in 3D charts.
+ View3DRef mxView3D; /// 3D settings.
+ TitleRef mxTitle; /// Chart main title.
+ LegendRef mxLegend; /// Chart legend.
+ OUString maDrawingPath; /// Path to drawing fragment with embedded shapes.
+ sal_Int32 mnDispBlanksAs; /// Mode how to display blank values.
+ sal_Int32 mnStyle; /// Index to default formatting.
+ bool mbAutoTitleDel; /// True = automatic title deleted manually.
+ bool mbPlotVisOnly; /// True = plot visible cells in a sheet only.
+ bool mbShowLabelsOverMax;/// True = show labels over chart maximum.
+ bool mbPivotChart; /// True = pivot chart.
+
+ explicit ChartSpaceModel();
+ ~ChartSpaceModel();
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/converterbase.hxx b/include/oox/drawingml/chart/converterbase.hxx
new file mode 100644
index 000000000000..21a03441e803
--- /dev/null
+++ b/include/oox/drawingml/chart/converterbase.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 OOX_DRAWINGML_CHART_CONVERTERBASE_HXX
+#define OOX_DRAWINGML_CHART_CONVERTERBASE_HXX
+
+#include "oox/drawingml/chart/chartcontextbase.hxx"
+#include "oox/drawingml/chart/objectformatter.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace awt { struct Rectangle; }
+ namespace awt { struct Size; }
+ namespace chart2 { class XChartDocument; }
+ namespace chart2 { class XTitle; }
+ namespace drawing { class XShape; }
+} } }
+
+namespace oox { namespace core {
+ class XmlFilterBase;
+} }
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+class ChartConverter;
+struct ChartSpaceModel;
+struct ConverterData;
+
+// ============================================================================
+
+const sal_Int32 API_PRIM_AXESSET = 0;
+const sal_Int32 API_SECN_AXESSET = 1;
+
+const sal_Int32 API_X_AXIS = 0;
+const sal_Int32 API_Y_AXIS = 1;
+const sal_Int32 API_Z_AXIS = 2;
+
+// ============================================================================
+
+class ConverterRoot
+{
+public:
+ explicit ConverterRoot(
+ ::oox::core::XmlFilterBase& rFilter,
+ ChartConverter& rChartConverter,
+ const ChartSpaceModel& rChartModel,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
+ const ::com::sun::star::awt::Size& rChartSize );
+ virtual ~ConverterRoot();
+
+ /** Creates an instance for the passed service name, using the process service factory. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ createInstance( const OUString& rServiceName ) const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ getComponentContext() const;
+
+protected:
+ /** Returns the filter object of the imported/exported document. */
+ ::oox::core::XmlFilterBase& getFilter() const;
+ /** Returns the chart converter. */
+ ChartConverter* getChartConverter() const;
+ /** Returns the API chart document model. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
+ getChartDocument() const;
+ /** Returns the position and size of the chart shape in 1/100 mm. */
+ const ::com::sun::star::awt::Size& getChartSize() const;
+ /** Returns the object formatter. */
+ ObjectFormatter& getFormatter() const;
+
+ /** Registers a title object and its layout data, needed for conversion of
+ the title position using the old Chart1 API. */
+ void registerTitleLayout(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitle >& rxTitle,
+ const ModelRef< LayoutModel >& rxLayout, ObjectType eObjType,
+ sal_Int32 nMainIdx = -1, sal_Int32 nSubIdx = -1 );
+ /** Converts the positions of the main title and all axis titles. */
+ void convertTitlePositions();
+
+private:
+ ::boost::shared_ptr< ConverterData > mxData;
+};
+
+// ============================================================================
+
+/** Base class of all converter classes. Holds a reference to a model structure
+ of the specified type.
+ */
+template< typename ModelType >
+class ConverterBase : public ConverterRoot
+{
+public:
+ inline const ModelType& getModel() const { return mrModel; }
+
+protected:
+ inline explicit ConverterBase( const ConverterRoot& rParent, ModelType& rModel ) :
+ ConverterRoot( rParent ), mrModel( rModel ) {}
+ virtual ~ConverterBase() {}
+
+protected:
+ ModelType& mrModel;
+};
+
+// ============================================================================
+
+/** A layout converter calculates positions and sizes for various chart objects.
+ */
+class LayoutConverter : public ConverterBase< LayoutModel >
+{
+public:
+ explicit LayoutConverter( const ConverterRoot& rParent, LayoutModel& rModel );
+ virtual ~LayoutConverter();
+
+ /** Tries to calculate the absolute position and size from the contained
+ OOXML layout model. Returns true, if returned rectangle is valid. */
+ bool calcAbsRectangle( ::com::sun::star::awt::Rectangle& orRect ) const;
+
+ /** Tries to set the position and size from the contained OOXML layout model.
+ Returns true, if a manual position and size could be calculated. */
+ bool convertFromModel( PropertySet& rPropSet );
+
+ /** Tries to set the position from the contained OOXML layout model.
+ Returns true, if a manual position could be calculated. */
+ bool convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
+ double fRotationAngle );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/datasourcecontext.hxx b/include/oox/drawingml/chart/datasourcecontext.hxx
new file mode 100644
index 000000000000..163b99c868e4
--- /dev/null
+++ b/include/oox/drawingml/chart/datasourcecontext.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 OOX_DRAWINGML_CHART_DATASOURCECONTEXT_HXX
+#define OOX_DRAWINGML_CHART_DATASOURCECONTEXT_HXX
+
+#include "oox/drawingml/chart/chartcontextbase.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct DataSequenceModel;
+
+typedef ContextBase< DataSequenceModel > DataSequenceContextBase;
+
+// ============================================================================
+
+/** Handler for a double sequence context (c:numLit, c:numRef elements).
+ */
+class DoubleSequenceContext : public DataSequenceContextBase
+{
+public:
+ explicit DoubleSequenceContext( ::oox::core::ContextHandler2Helper& rParent, DataSequenceModel& rModel );
+ virtual ~DoubleSequenceContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onCharacters( const OUString& rChars );
+
+private:
+ sal_Int32 mnPtIndex; /// Current data point index.
+};
+
+// ============================================================================
+
+/** Handler for a string sequence context (c:multiLvlStrRef, c:strLit,
+ c:strRef elements).
+ */
+class StringSequenceContext : public DataSequenceContextBase
+{
+public:
+ explicit StringSequenceContext( ::oox::core::ContextHandler2Helper& rParent, DataSequenceModel& rModel );
+ virtual ~StringSequenceContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onCharacters( const OUString& rChars );
+
+private:
+ sal_Int32 mnPtIndex; /// Current data point index.
+};
+
+// ============================================================================
+
+struct DataSourceModel;
+
+/** Handler for a data source context (c:bubbleSize, c:cat, c:minus, c:plus,
+ c:val, c:xVal, c:yVal elements).
+ */
+class DataSourceContext : public ContextBase< DataSourceModel >
+{
+public:
+ explicit DataSourceContext( ::oox::core::ContextHandler2Helper& rParent, DataSourceModel& rModel );
+ virtual ~DataSourceContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/datasourceconverter.hxx b/include/oox/drawingml/chart/datasourceconverter.hxx
new file mode 100644
index 000000000000..e8b5649e1bef
--- /dev/null
+++ b/include/oox/drawingml/chart/datasourceconverter.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 OOX_DRAWINGML_CHART_DATASOURCECONVERTER_HXX
+#define OOX_DRAWINGML_CHART_DATASOURCECONVERTER_HXX
+
+#include "oox/drawingml/chart/converterbase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace chart2 { namespace data { class XDataSequence; } }
+} } }
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct DataSequenceModel;
+
+class DataSequenceConverter : public ConverterBase< DataSequenceModel >
+{
+public:
+ explicit DataSequenceConverter( const ConverterRoot& rParent, DataSequenceModel& rModel );
+ virtual ~DataSequenceConverter();
+
+ /** Creates a data sequence object from the contained formula link. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >
+ createDataSequence( const OUString& rRole );
+};
+
+// ============================================================================
+
+struct DataSourceModel;
+
+class DataSourceConverter : public ConverterBase< DataSourceModel >
+{
+public:
+ explicit DataSourceConverter( const ConverterRoot& rParent, DataSourceModel& rModel );
+ virtual ~DataSourceConverter();
+
+ /** Creates a data sequence object from the contained series data. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >
+ createDataSequence( const OUString& rRole );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/datasourcemodel.hxx b/include/oox/drawingml/chart/datasourcemodel.hxx
new file mode 100644
index 000000000000..d43048ef071c
--- /dev/null
+++ b/include/oox/drawingml/chart/datasourcemodel.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 OOX_DRAWINGML_CHART_DATASOURCEMODEL_HXX
+#define OOX_DRAWINGML_CHART_DATASOURCEMODEL_HXX
+
+#include <com/sun/star/uno/Any.hxx>
+#include "oox/drawingml/chart/modelbase.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct DataSequenceModel
+{
+ typedef ::std::map< sal_Int32, ::com::sun::star::uno::Any > AnyMap;
+
+ AnyMap maData; /// Map of values, indexed by point identifier.
+ OUString maFormula; /// Formula reference, e.g. into a spreadsheet.
+ OUString maFormatCode; /// Number format for double values.
+ sal_Int32 mnPointCount; /// Number of points in this series source.
+
+ explicit DataSequenceModel();
+ ~DataSequenceModel();
+};
+
+// ============================================================================
+
+struct DataSourceModel
+{
+ typedef ModelRef< DataSequenceModel > DataSequenceRef;
+
+ DataSequenceRef mxDataSeq; /// The data sequence or formula link of this source.
+
+ explicit DataSourceModel();
+ ~DataSourceModel();
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/modelbase.hxx b/include/oox/drawingml/chart/modelbase.hxx
new file mode 100644
index 000000000000..985221ec394b
--- /dev/null
+++ b/include/oox/drawingml/chart/modelbase.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 OOX_DRAWINGML_CHART_MODELBASE_HXX
+#define OOX_DRAWINGML_CHART_MODELBASE_HXX
+
+#include "oox/helper/helper.hxx"
+#include "oox/helper/refmap.hxx"
+#include "oox/helper/refvector.hxx"
+
+namespace oox { class AttributeList; }
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+template< typename ModelType >
+class ModelRef : public ::boost::shared_ptr< ModelType >
+{
+public:
+ inline explicit ModelRef() {}
+ inline ModelRef( const ::boost::shared_ptr< ModelType >& rxModel ) : ::boost::shared_ptr< ModelType >( rxModel ) {}
+ inline ~ModelRef() {}
+
+ inline bool is() const { return this->get() != 0; }
+
+ inline ModelType& create() { this->reset( new ModelType ); return **this; }
+ template< typename Param1Type >
+ inline ModelType& create( const Param1Type& rParam1 ) { this->reset( new ModelType( rParam1 ) ); return **this; }
+
+ inline ModelType& getOrCreate() { if( !*this ) this->reset( new ModelType ); return **this; }
+ template< typename Param1Type >
+ inline ModelType& getOrCreate( const Param1Type& rParam1 ) { if( !*this ) this->reset( new ModelType( rParam1 ) ); return **this; }
+};
+
+// ============================================================================
+
+template< typename ModelType >
+class ModelVector : public RefVector< ModelType >
+{
+public:
+ typedef typename RefVector< ModelType >::value_type value_type;
+ typedef typename RefVector< ModelType >::size_type size_type;
+
+ inline explicit ModelVector() {}
+ inline ~ModelVector() {}
+
+ inline ModelType& create() { return append( new ModelType ); }
+ template< typename Param1Type >
+ inline ModelType& create( const Param1Type& rParam1 ) { return append( new ModelType( rParam1 ) ); }
+
+private:
+ inline ModelType& append( ModelType* pModel ) { this->push_back( value_type( pModel ) ); return *pModel; }
+};
+
+// ============================================================================
+
+template< typename KeyType, typename ModelType >
+class ModelMap : public RefMap< KeyType, ModelType >
+{
+public:
+ typedef typename RefMap< KeyType, ModelType >::key_type key_type;
+ typedef typename RefMap< KeyType, ModelType >::mapped_type mapped_type;
+ typedef typename RefMap< KeyType, ModelType >::value_type value_type;
+
+ inline explicit ModelMap() {}
+ inline ~ModelMap() {}
+
+ inline ModelType& create( KeyType eKey ) { return insert( eKey, new ModelType ); }
+ template< typename Param1Type >
+ inline ModelType& create( KeyType eKey, const Param1Type& rParam1 ) { return insert( eKey, new ModelType( rParam1 ) ); }
+
+private:
+ inline ModelType& insert( KeyType eKey, ModelType* pModel ) { (*this)[ eKey ].reset( pModel ); return *pModel; }
+};
+
+// ============================================================================
+
+struct NumberFormat
+{
+ OUString maFormatCode; /// Number format code.
+ bool mbSourceLinked; /// True = number format linked to source data.
+
+ explicit NumberFormat();
+
+ void setAttributes( const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+struct LayoutModel
+{
+ double mfX; /// Left position of this object.
+ double mfY; /// Top position of this object.
+ double mfW; /// Width of this object.
+ double mfH; /// Height of this object.
+ sal_Int32 mnXMode; /// Mode for left position.
+ sal_Int32 mnYMode; /// Mode for top position.
+ sal_Int32 mnWMode; /// Mode for width.
+ sal_Int32 mnHMode; /// Mode for height.
+ sal_Int32 mnTarget; /// Layout target for plot area.
+ bool mbAutoLayout; /// True = automatic positioning.
+
+ explicit LayoutModel();
+ ~LayoutModel();
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/objectformatter.hxx b/include/oox/drawingml/chart/objectformatter.hxx
new file mode 100644
index 000000000000..5b2bb727f4fd
--- /dev/null
+++ b/include/oox/drawingml/chart/objectformatter.hxx
@@ -0,0 +1,157 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX
+#define OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX
+
+#include "oox/helper/propertyset.hxx"
+#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/drawingml/chart/modelbase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace chart2 { class XChartDocument; }
+} } }
+
+namespace oox { namespace core { class XmlFilterBase; } }
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+/** Enumerates different object types for specific automatic formatting behaviour. */
+enum ObjectType
+{
+ OBJECTTYPE_CHARTSPACE, /// Chart background.
+ OBJECTTYPE_CHARTTITLE, /// Chart title.
+ OBJECTTYPE_LEGEND, /// Legend.
+ OBJECTTYPE_PLOTAREA2D, /// Plot area containing axes and data series in 2D charts.
+ OBJECTTYPE_PLOTAREA3D, /// Plot area containing axes and data series in 3D charts.
+ OBJECTTYPE_WALL, /// Background and side wall in 3D charts.
+ OBJECTTYPE_FLOOR, /// Floor in 3D charts.
+ OBJECTTYPE_AXIS, /// Axis line, labels, tick marks.
+ OBJECTTYPE_AXISTITLE, /// Axis title.
+ OBJECTTYPE_AXISUNIT, /// Axis unit label.
+ OBJECTTYPE_MAJORGRIDLINE, /// Axis major grid line.
+ OBJECTTYPE_MINORGRIDLINE, /// Axis minor grid line.
+ OBJECTTYPE_LINEARSERIES2D, /// Linear series in 2D line/radarline/scatter charts.
+ OBJECTTYPE_FILLEDSERIES2D, /// Filled series in 2D bar/area/radararea/bubble/pie/surface charts.
+ OBJECTTYPE_FILLEDSERIES3D, /// Filled series in 3D charts.
+ OBJECTTYPE_DATALABEL, /// Labels for data points.
+ OBJECTTYPE_TRENDLINE, /// Data series trend line.
+ OBJECTTYPE_TRENDLINELABEL, /// Trend line label.
+ OBJECTTYPE_ERRORBAR, /// Data series error indicator line.
+ OBJECTTYPE_SERLINE, /// Data point connector lines.
+ OBJECTTYPE_LEADERLINE, /// Leader lines between pie slice and data label.
+ OBJECTTYPE_DROPLINE, /// Drop lines between data points and X axis.
+ OBJECTTYPE_HILOLINE, /// High/low lines in line/stock charts.
+ OBJECTTYPE_UPBAR, /// Up-bar in line/stock charts.
+ OBJECTTYPE_DOWNBAR, /// Down-bar in line/stock charts.
+ OBJECTTYPE_DATATABLE /// Data table.
+};
+
+// ============================================================================
+
+struct ChartSpaceModel;
+struct ObjectFormatterData;
+struct PictureOptionsModel;
+
+class ObjectFormatter
+{
+public:
+ explicit ObjectFormatter(
+ const ::oox::core::XmlFilterBase& rFilter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
+ const ChartSpaceModel& rChartSpace );
+ ~ObjectFormatter();
+
+ /** Sets the maximum series index used for color cycling/fading. */
+ void setMaxSeriesIndex( sal_Int32 nMaxSeriesIdx );
+ /** Returns the current maximum series index used for color cycling/fading. */
+ sal_Int32 getMaxSeriesIndex() const;
+
+ /** Sets frame formatting properties to the passed property set. */
+ void convertFrameFormatting(
+ PropertySet& rPropSet,
+ const ModelRef< Shape >& rxShapeProp,
+ ObjectType eObjType,
+ sal_Int32 nSeriesIdx = -1 );
+
+ /** Sets frame formatting properties to the passed property set. */
+ void convertFrameFormatting(
+ PropertySet& rPropSet,
+ const ModelRef< Shape >& rxShapeProp,
+ const PictureOptionsModel& rPicOptions,
+ ObjectType eObjType,
+ sal_Int32 nSeriesIdx = -1 );
+
+ /** Sets text formatting properties to the passed property set. */
+ void convertTextFormatting(
+ PropertySet& rPropSet,
+ const ModelRef< TextBody >& rxTextProp,
+ ObjectType eObjType );
+
+ /** Sets frame/text formatting properties to the passed property set. */
+ void convertFormatting(
+ PropertySet& rPropSet,
+ const ModelRef< Shape >& rxShapeProp,
+ const ModelRef< TextBody >& rxTextProp,
+ ObjectType eObjType );
+
+ /** Sets text formatting properties to the passed property set. */
+ void convertTextFormatting(
+ PropertySet& rPropSet,
+ const TextCharacterProperties& rTextProps,
+ ObjectType eObjType );
+
+ /** Sets text rotation properties to the passed property set. */
+ void convertTextRotation(
+ PropertySet& rPropSet,
+ const ModelRef< TextBody >& rxTextProp,
+ bool bSupportsStacked );
+
+ /** Sets number format properties to the passed property set. */
+ void convertNumberFormat(
+ PropertySet& rPropSet,
+ const NumberFormat& rNumberFormat,
+ bool bPercentFormat = false );
+
+ /** Sets automatic fill properties to the passed property set. */
+ void convertAutomaticFill(
+ PropertySet& rPropSet,
+ ObjectType eObjType,
+ sal_Int32 nSeriesIdx = -1 );
+
+ /** Returns true, if the passed shape properties have automatic fill mode. */
+ static bool isAutomaticFill( const ModelRef< Shape >& rxShapeProp );
+
+private:
+ ::boost::shared_ptr< ObjectFormatterData > mxData;
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/plotareacontext.hxx b/include/oox/drawingml/chart/plotareacontext.hxx
new file mode 100644
index 000000000000..d9966a8d8bf4
--- /dev/null
+++ b/include/oox/drawingml/chart/plotareacontext.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 OOX_DRAWINGML_CHART_PLOTAREACONTEXT_HXX
+#define OOX_DRAWINGML_CHART_PLOTAREACONTEXT_HXX
+
+#include "oox/drawingml/chart/chartcontextbase.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct View3DModel;
+
+/** Handler for a chart plot area context (c:plotArea element).
+ */
+class View3DContext : public ContextBase< View3DModel >
+{
+public:
+ explicit View3DContext( ::oox::core::ContextHandler2Helper& rParent, View3DModel& rModel );
+ virtual ~View3DContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+struct WallFloorModel;
+
+/** Handler for a chart wall/floor context (c:backWall, c:floor, c:sideWall
+ elements).
+ */
+class WallFloorContext : public ContextBase< WallFloorModel >
+{
+public:
+ explicit WallFloorContext( ::oox::core::ContextHandler2Helper& rParent, WallFloorModel& rModel );
+ virtual ~WallFloorContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+struct PlotAreaModel;
+
+/** Handler for a chart plot area context (c:plotArea element).
+ */
+class PlotAreaContext : public ContextBase< PlotAreaModel >
+{
+public:
+ explicit PlotAreaContext( ::oox::core::ContextHandler2Helper& rParent, PlotAreaModel& rModel );
+ virtual ~PlotAreaContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/plotareaconverter.hxx b/include/oox/drawingml/chart/plotareaconverter.hxx
new file mode 100644
index 000000000000..6796ffbd6a1c
--- /dev/null
+++ b/include/oox/drawingml/chart/plotareaconverter.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 OOX_DRAWINGML_CHART_PLOTAREACONVERTER_HXX
+#define OOX_DRAWINGML_CHART_PLOTAREACONVERTER_HXX
+
+#include "oox/drawingml/chart/converterbase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace chart2 { class XDiagram; }
+} } }
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct View3DModel;
+class TypeGroupConverter;
+
+class View3DConverter : public ConverterBase< View3DModel >
+{
+public:
+ explicit View3DConverter( const ConverterRoot& rParent, View3DModel& rModel );
+ virtual ~View3DConverter();
+
+ /** Converts the OOXML plot area model to a chart2 diagram. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& rxDiagram,
+ TypeGroupConverter& rTypeGroup );
+};
+
+// ============================================================================
+
+struct WallFloorModel;
+
+class WallFloorConverter : public ConverterBase< WallFloorModel >
+{
+public:
+ explicit WallFloorConverter( const ConverterRoot& rParent, WallFloorModel& rModel );
+ virtual ~WallFloorConverter();
+
+ /** Converts the OOXML wall/floor model to a chart2 diagram. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& rxDiagram,
+ ObjectType eObjType );
+};
+
+// ============================================================================
+
+struct PlotAreaModel;
+
+class PlotAreaConverter : public ConverterBase< PlotAreaModel >
+{
+public:
+ explicit PlotAreaConverter( const ConverterRoot& rParent, PlotAreaModel& rModel );
+ virtual ~PlotAreaConverter();
+
+ /** Converts the OOXML plot area model to a chart2 diagram. */
+ void convertFromModel( View3DModel& rView3DModel );
+ /** Converts the manual plot area position and size, if set. */
+ void convertPositionFromModel();
+
+ /** Returns the automatic chart title if the chart contains only one series. */
+ inline const OUString& getAutomaticTitle() const { return maAutoTitle; }
+ /** Returns true, if the chart is three-dimensional. */
+ inline bool is3dChart() const { return mb3dChart; }
+ /** Returns true, if chart type supports wall and floor format in 3D mode. */
+ inline bool isWall3dChart() const { return mbWall3dChart; }
+
+private:
+ OUString maAutoTitle;
+ bool mb3dChart;
+ bool mbWall3dChart;
+ bool mbPieChart;
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/plotareamodel.hxx b/include/oox/drawingml/chart/plotareamodel.hxx
new file mode 100644
index 000000000000..2afd6ccdd1da
--- /dev/null
+++ b/include/oox/drawingml/chart/plotareamodel.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 OOX_DRAWINGML_CHART_PLOTAREAMODEL_HXX
+#define OOX_DRAWINGML_CHART_PLOTAREAMODEL_HXX
+
+#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/chart/axismodel.hxx"
+#include "oox/drawingml/chart/seriesmodel.hxx"
+#include "oox/drawingml/chart/typegroupmodel.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct View3DModel
+{
+ OptValue< sal_Int32 > monHeightPercent; /// Height of the 3D view, relative to chart width.
+ OptValue< sal_Int32 > monRotationX; /// Horizontal rotation in degrees.
+ OptValue< sal_Int32 > monRotationY; /// Vertical rotation in degrees.
+ sal_Int32 mnDepthPercent; /// Depth of the 3D view, relative to chart width.
+ sal_Int32 mnPerspective; /// Eye distance to the 3D objects.
+ bool mbRightAngled; /// True = right-angled axes in 3D view.
+
+ explicit View3DModel();
+ ~View3DModel();
+};
+
+// ============================================================================
+
+struct WallFloorModel
+{
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< PictureOptionsModel > PictureOptionsRef;
+
+ ShapeRef mxShapeProp; /// Wall/floor frame formatting.
+ PictureOptionsRef mxPicOptions; /// Fill bitmap settings.
+
+ explicit WallFloorModel();
+ ~WallFloorModel();
+};
+
+// ============================================================================
+
+struct PlotAreaModel
+{
+ typedef ModelVector< TypeGroupModel > TypeGroupVector;
+ typedef ModelVector< AxisModel > AxisVector;
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< LayoutModel > LayoutRef;
+
+ TypeGroupVector maTypeGroups; /// All chart type groups contained in the chart.
+ AxisVector maAxes; /// All axes contained in the chart.
+ ShapeRef mxShapeProp; /// Plot area frame formatting.
+ LayoutRef mxLayout; /// Layout/position of the plot area.
+
+ explicit PlotAreaModel();
+ ~PlotAreaModel();
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/seriescontext.hxx b/include/oox/drawingml/chart/seriescontext.hxx
new file mode 100644
index 000000000000..e31156dd2796
--- /dev/null
+++ b/include/oox/drawingml/chart/seriescontext.hxx
@@ -0,0 +1,266 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_CHART_SERIESCONTEXT_HXX
+#define OOX_DRAWINGML_CHART_SERIESCONTEXT_HXX
+
+#include "oox/drawingml/chart/chartcontextbase.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct DataLabelModel;
+
+/** Handler for a chart data point label context (c:dLbl element).
+ */
+class DataLabelContext : public ContextBase< DataLabelModel >
+{
+public:
+ explicit DataLabelContext( ::oox::core::ContextHandler2Helper& rParent, DataLabelModel& rModel );
+ virtual ~DataLabelContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onCharacters( const OUString& rChars );
+};
+
+// ============================================================================
+
+struct DataLabelsModel;
+
+/** Handler for a chart data point label context (c:dLbl element).
+ */
+class DataLabelsContext : public ContextBase< DataLabelsModel >
+{
+public:
+ explicit DataLabelsContext( ::oox::core::ContextHandler2Helper& rParent, DataLabelsModel& rModel );
+ virtual ~DataLabelsContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onCharacters( const OUString& rChars );
+};
+
+// ============================================================================
+
+struct PictureOptionsModel;
+
+/** Handler for fill bitmap settings (c:pictureOptions element).
+ */
+class PictureOptionsContext : public ContextBase< PictureOptionsModel >
+{
+public:
+ explicit PictureOptionsContext( ::oox::core::ContextHandler2Helper& rParent, PictureOptionsModel& rModel );
+ virtual ~PictureOptionsContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+struct ErrorBarModel;
+
+/** Handler for a series error bar context (c:errBars element).
+ */
+class ErrorBarContext : public ContextBase< ErrorBarModel >
+{
+public:
+ explicit ErrorBarContext( ::oox::core::ContextHandler2Helper& rParent, ErrorBarModel& rModel );
+ virtual ~ErrorBarContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+struct TrendlineLabelModel;
+
+/** Handler for a series trendline label context (c:trendlineLbl element).
+ */
+class TrendlineLabelContext : public ContextBase< TrendlineLabelModel >
+{
+public:
+ explicit TrendlineLabelContext( ::oox::core::ContextHandler2Helper& rParent, TrendlineLabelModel& rModel );
+ virtual ~TrendlineLabelContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+struct TrendlineModel;
+
+/** Handler for a series trendline context (c:trendline element).
+ */
+class TrendlineContext : public ContextBase< TrendlineModel >
+{
+public:
+ explicit TrendlineContext( ::oox::core::ContextHandler2Helper& rParent, TrendlineModel& rModel );
+ virtual ~TrendlineContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onCharacters( const OUString& rChars );
+};
+
+// ============================================================================
+
+struct DataPointModel;
+
+/** Handler for a chart data point context (c:dPt element).
+ */
+class DataPointContext : public ContextBase< DataPointModel >
+{
+public:
+ explicit DataPointContext( ::oox::core::ContextHandler2Helper& rParent, DataPointModel& rModel );
+ virtual ~DataPointContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+struct SeriesModel;
+
+/** Handler base class for chart data series contexts (c:ser element).
+ */
+class SeriesContextBase : public ContextBase< SeriesModel >
+{
+public:
+ explicit SeriesContextBase( ::oox::core::ContextHandler2Helper& rParent, SeriesModel& rModel );
+ virtual ~SeriesContextBase();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for a data series context for area chart types (c:ser element).
+ */
+class AreaSeriesContext : public SeriesContextBase
+{
+public:
+ explicit AreaSeriesContext( ::oox::core::ContextHandler2Helper& rParent, SeriesModel& rModel );
+ virtual ~AreaSeriesContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for a data series context for bar chart types (c:ser element).
+ */
+class BarSeriesContext : public SeriesContextBase
+{
+public:
+ explicit BarSeriesContext( ::oox::core::ContextHandler2Helper& rParent, SeriesModel& rModel );
+ virtual ~BarSeriesContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for a data series context for bubble chart types (c:ser element).
+ */
+class BubbleSeriesContext : public SeriesContextBase
+{
+public:
+ explicit BubbleSeriesContext( ::oox::core::ContextHandler2Helper& rParent, SeriesModel& rModel );
+ virtual ~BubbleSeriesContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for a data series context for line and stock chart types (c:ser
+ element).
+ */
+class LineSeriesContext : public SeriesContextBase
+{
+public:
+ explicit LineSeriesContext( ::oox::core::ContextHandler2Helper& rParent, SeriesModel& rModel );
+ virtual ~LineSeriesContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for a data series context for pie and doughnut chart types (c:ser
+ element).
+ */
+class PieSeriesContext : public SeriesContextBase
+{
+public:
+ explicit PieSeriesContext( ::oox::core::ContextHandler2Helper& rParent, SeriesModel& rModel );
+ virtual ~PieSeriesContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for a data series context for radar chart types (c:ser element).
+ */
+class RadarSeriesContext : public SeriesContextBase
+{
+public:
+ explicit RadarSeriesContext( ::oox::core::ContextHandler2Helper& rParent, SeriesModel& rModel );
+ virtual ~RadarSeriesContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for a data series context for scatter chart types (c:ser element).
+ */
+class ScatterSeriesContext : public SeriesContextBase
+{
+public:
+ explicit ScatterSeriesContext( ::oox::core::ContextHandler2Helper& rParent, SeriesModel& rModel );
+ virtual ~ScatterSeriesContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for a data series context for scatter chart types (c:ser element).
+ */
+class SurfaceSeriesContext : public SeriesContextBase
+{
+public:
+ explicit SurfaceSeriesContext( ::oox::core::ContextHandler2Helper& rParent, SeriesModel& rModel );
+ virtual ~SurfaceSeriesContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/seriesconverter.hxx b/include/oox/drawingml/chart/seriesconverter.hxx
new file mode 100644
index 000000000000..073073c5bbe7
--- /dev/null
+++ b/include/oox/drawingml/chart/seriesconverter.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 OOX_DRAWINGML_CHART_SERIESCONVERTER_HXX
+#define OOX_DRAWINGML_CHART_SERIESCONVERTER_HXX
+
+#include "oox/drawingml/chart/converterbase.hxx"
+#include "oox/drawingml/chart/seriesmodel.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace chart2 { class XDataSeries; }
+ namespace chart2 { namespace data { class XLabeledDataSequence; } }
+} } }
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+class TypeGroupConverter;
+
+// #i66858# enable this when Chart2 supports smoothed lines per data series
+#define OOX_CHART_SMOOTHED_PER_SERIES 0
+
+// ============================================================================
+
+class DataLabelConverter : public ConverterBase< DataLabelModel >
+{
+public:
+ explicit DataLabelConverter( const ConverterRoot& rParent, DataLabelModel& rModel );
+ virtual ~DataLabelConverter();
+
+ /** Converts OOXML data label settings for the passed data point. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& rxDataSeries,
+ const TypeGroupConverter& rTypeGroup );
+
+ /** Conversion helper for data series and data points. */
+ static void convertLabelFormatting(
+ PropertySet& rPropSet,
+ ObjectFormatter& rFormatter,
+ const DataLabelModelBase& rDataLabel,
+ const TypeGroupConverter& rTypeGroup,
+ bool bDataSeriesLabel );
+};
+
+// ============================================================================
+
+class DataLabelsConverter : public ConverterBase< DataLabelsModel >
+{
+public:
+ explicit DataLabelsConverter( const ConverterRoot& rParent, DataLabelsModel& rModel );
+ virtual ~DataLabelsConverter();
+
+ /** Converts OOXML data label settings for the passed data series. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& rxDataSeries,
+ const TypeGroupConverter& rTypeGroup );
+};
+
+// ============================================================================
+
+class ErrorBarConverter : public ConverterBase< ErrorBarModel >
+{
+public:
+ explicit ErrorBarConverter( const ConverterRoot& rParent, ErrorBarModel& rModel );
+ virtual ~ErrorBarConverter();
+
+ /** Converts an OOXML errorbar and inserts it into the passed data series. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& rxDataSeries );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence >
+ createLabeledDataSequence( ErrorBarModel::SourceType eSourceType );
+};
+
+// ============================================================================
+
+class TrendlineLabelConverter : public ConverterBase< TrendlineLabelModel >
+{
+public:
+ explicit TrendlineLabelConverter( const ConverterRoot& rParent, TrendlineLabelModel& rModel );
+ virtual ~TrendlineLabelConverter();
+
+ /** Converts the OOXML trendline label. */
+ void convertFromModel( PropertySet& rPropSet );
+};
+
+// ============================================================================
+
+class TrendlineConverter : public ConverterBase< TrendlineModel >
+{
+public:
+ explicit TrendlineConverter( const ConverterRoot& rParent, TrendlineModel& rModel );
+ virtual ~TrendlineConverter();
+
+ /** Converts an OOXML trendline and inserts it into the passed data series. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& rxDataSeries );
+};
+
+// ============================================================================
+
+class DataPointConverter : public ConverterBase< DataPointModel >
+{
+public:
+ explicit DataPointConverter( const ConverterRoot& rParent, DataPointModel& rModel );
+ virtual ~DataPointConverter();
+
+ /** Converts settings for a data point in the passed series. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& rxDataSeries,
+ const TypeGroupConverter& rTypeGroup,
+ const SeriesModel& rSeries );
+};
+
+// ============================================================================
+
+class SeriesConverter : public ConverterBase< SeriesModel >
+{
+public:
+ explicit SeriesConverter( const ConverterRoot& rParent, SeriesModel& rModel );
+ virtual ~SeriesConverter();
+
+ /** Creates a labeled data sequence object from category data link. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence >
+ createCategorySequence( const OUString& rRole );
+ /** Creates a labeled data sequence object from value data link. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence >
+ createValueSequence( const OUString& rRole );
+ /** Creates a data series object with initialized source links. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >
+ createDataSeries( const TypeGroupConverter& rTypeGroup, bool bVaryColorsByPoint );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence >
+ createLabeledDataSequence(
+ SeriesModel::SourceType eSourceType,
+ const OUString& rRole,
+ bool bUseTextLabel );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/seriesmodel.hxx b/include/oox/drawingml/chart/seriesmodel.hxx
new file mode 100644
index 000000000000..998065f7f8ad
--- /dev/null
+++ b/include/oox/drawingml/chart/seriesmodel.hxx
@@ -0,0 +1,237 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_CHART_SERIESMODEL_HXX
+#define OOX_DRAWINGML_CHART_SERIESMODEL_HXX
+
+#include "oox/drawingml/chart/datasourcemodel.hxx"
+#include "oox/drawingml/chart/titlemodel.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct DataLabelModelBase
+{
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< TextBody > TextBodyRef;
+
+ ShapeRef mxShapeProp; /// Data label frame formatting.
+ TextBodyRef mxTextProp; /// Data label text formatting.
+ NumberFormat maNumberFormat; /// Number format for numeric data labels.
+ OptValue< OUString > moaSeparator;/// Separator between label components.
+ OptValue< sal_Int32 > monLabelPos; /// Data label position.
+ OptValue< bool > mobShowBubbleSize; /// True = show size of bubbles in bubble charts.
+ OptValue< bool > mobShowCatName; /// True = show category name of data points.
+ OptValue< bool > mobShowLegendKey; /// True = show legend key of data series.
+ OptValue< bool > mobShowPercent; /// True = show percentual value in pie/doughnut charts.
+ OptValue< bool > mobShowSerName; /// True = show series name.
+ OptValue< bool > mobShowVal; /// True = show data point value.
+ bool mbDeleted; /// True = data label(s) deleted.
+
+ explicit DataLabelModelBase();
+ ~DataLabelModelBase();
+};
+
+// ============================================================================
+
+struct DataLabelModel : public DataLabelModelBase
+{
+ typedef ModelRef< LayoutModel > LayoutRef;
+ typedef ModelRef< TextModel > TextRef;
+
+ LayoutRef mxLayout; /// Layout/position of the data point label frame.
+ TextRef mxText; /// Manual or linked text for this data point label.
+ sal_Int32 mnIndex; /// Data point index for this data label.
+
+ explicit DataLabelModel();
+ ~DataLabelModel();
+};
+
+// ============================================================================
+
+struct DataLabelsModel : public DataLabelModelBase
+{
+ typedef ModelVector< DataLabelModel > DataLabelVector;
+ typedef ModelRef< Shape > ShapeRef;
+
+ DataLabelVector maPointLabels; /// Settings for individual data point labels.
+ ShapeRef mxLeaderLines; /// Formatting of connector lines between data points and labels.
+ bool mbShowLeaderLines; /// True = show connector lines between data points and labels.
+
+ explicit DataLabelsModel();
+ ~DataLabelsModel();
+};
+
+// ============================================================================
+
+struct PictureOptionsModel
+{
+ double mfStackUnit; /// Bitmap stacking unit.
+ sal_Int32 mnPictureFormat; /// Bitmap mode (stretch/tile).
+ bool mbApplyToFront; /// True = draw picture at front/back side of 3D data points.
+ bool mbApplyToSides; /// True = draw picture at left/right side of 3D data points.
+ bool mbApplyToEnd; /// True = draw picture at top/bottom side of 3D data points.
+
+ explicit PictureOptionsModel();
+ ~PictureOptionsModel();
+};
+
+// ============================================================================
+
+struct ErrorBarModel
+{
+ enum SourceType
+ {
+ PLUS, /// Plus error bar values.
+ MINUS /// Minus error bar values.
+ };
+
+ typedef ModelMap< SourceType, DataSourceModel > DataSourceMap;
+ typedef ModelRef< Shape > ShapeRef;
+
+ DataSourceMap maSources; /// Source ranges for manual error bar values.
+ ShapeRef mxShapeProp; /// Error line formatting.
+ double mfValue; /// Fixed value for several error bar types.
+ sal_Int32 mnDirection; /// Direction of the error bars (x/y).
+ sal_Int32 mnTypeId; /// Type of the error bars (plus/minus/both).
+ sal_Int32 mnValueType; /// Type of the values.
+ bool mbNoEndCap; /// True = no end cap at error bar lines.
+
+ explicit ErrorBarModel();
+ ~ErrorBarModel();
+};
+
+// ============================================================================
+
+struct TrendlineLabelModel
+{
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< TextBody > TextBodyRef;
+ typedef ModelRef< LayoutModel > LayoutRef;
+ typedef ModelRef< TextModel > TextRef;
+
+ ShapeRef mxShapeProp; /// Label frame formatting.
+ TextBodyRef mxTextProp; /// Label text formatting.
+ LayoutRef mxLayout; /// Layout/position of the frame.
+ TextRef mxText; /// Text source of the label.
+ NumberFormat maNumberFormat; /// Number format for coefficients.
+
+ explicit TrendlineLabelModel();
+ ~TrendlineLabelModel();
+};
+
+// ============================================================================
+
+struct TrendlineModel
+{
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< TrendlineLabelModel > TrendlineLabelRef;
+
+ ShapeRef mxShapeProp; /// Trendline formatting.
+ TrendlineLabelRef mxLabel; /// Trendline label text object.
+ OUString maName; /// User-defined name of the trendline.
+ OptValue< double > mfBackward; /// Size of trendline before first data point.
+ OptValue< double > mfForward; /// Size of trendline behind last data point.
+ OptValue< double > mfIntercept; /// Crossing point with Y axis.
+ sal_Int32 mnOrder; /// Polynomial order in range [2, 6].
+ sal_Int32 mnPeriod; /// Moving average period in range [2, 255].
+ sal_Int32 mnTypeId; /// Type of the trendline.
+ bool mbDispEquation; /// True = show equation of the trendline.
+ bool mbDispRSquared; /// True = show R-squared of the trendline.
+
+ explicit TrendlineModel();
+ ~TrendlineModel();
+};
+
+// ============================================================================
+
+struct DataPointModel
+{
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< PictureOptionsModel > PictureOptionsRef;
+
+ ShapeRef mxShapeProp; /// Data point formatting.
+ PictureOptionsRef mxPicOptions; /// Fill bitmap settings.
+ ShapeRef mxMarkerProp; /// Data point marker formatting.
+ OptValue< sal_Int32 > monExplosion; /// Pie slice moved from pie center.
+ OptValue< sal_Int32 > monMarkerSize; /// Size of the series line marker (2...72).
+ OptValue< sal_Int32 > monMarkerSymbol; /// Series line marker symbol.
+ OptValue< bool > mobBubble3d; /// True = show bubbles with 3D shade.
+ sal_Int32 mnIndex; /// Unique data point index.
+ bool mbInvertNeg; /// True = invert negative data points (not derived from series!).
+
+ explicit DataPointModel();
+ ~DataPointModel();
+};
+
+// ============================================================================
+
+struct SeriesModel
+{
+ enum SourceType
+ {
+ CATEGORIES, /// Data point categories.
+ VALUES, /// Data point values.
+ POINTS /// Data point size (e.g. bubble size in bubble charts).
+ };
+
+ typedef ModelMap< SourceType, DataSourceModel > DataSourceMap;
+ typedef ModelVector< ErrorBarModel > ErrorBarVector;
+ typedef ModelVector< TrendlineModel > TrendlineVector;
+ typedef ModelVector< DataPointModel > DataPointVector;
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< PictureOptionsModel > PictureOptionsRef;
+ typedef ModelRef< TextModel > TextRef;
+ typedef ModelRef< DataLabelsModel > DataLabelsRef;
+
+ DataSourceMap maSources; /// Series source ranges.
+ ErrorBarVector maErrorBars; /// All error bars of this series.
+ TrendlineVector maTrendlines; /// All trendlines of this series.
+ DataPointVector maPoints; /// Explicit formatted data points.
+ ShapeRef mxShapeProp; /// Series formatting.
+ PictureOptionsRef mxPicOptions; /// Fill bitmap settings.
+ ShapeRef mxMarkerProp; /// Data point marker formatting.
+ TextRef mxText; /// Series title source.
+ DataLabelsRef mxLabels; /// Data point label settings for all points.
+ OptValue< sal_Int32 > monShape; /// 3D bar shape type.
+ sal_Int32 mnExplosion; /// Pie slice moved from pie center.
+ sal_Int32 mnIndex; /// Series index used for automatic formatting.
+ sal_Int32 mnMarkerSize; /// Size of the series line marker (2...72).
+ sal_Int32 mnMarkerSymbol; /// Series line marker symbol.
+ sal_Int32 mnOrder; /// Series order.
+ bool mbBubble3d; /// True = show bubbles with 3D shade.
+ bool mbInvertNeg; /// True = invert negative data points.
+ bool mbSmooth; /// True = smooth series line.
+
+ explicit SeriesModel();
+ ~SeriesModel();
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/titlecontext.hxx b/include/oox/drawingml/chart/titlecontext.hxx
new file mode 100644
index 000000000000..b00a9ed45b6d
--- /dev/null
+++ b/include/oox/drawingml/chart/titlecontext.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 OOX_DRAWINGML_CHART_TITLECONTEXT_HXX
+#define OOX_DRAWINGML_CHART_TITLECONTEXT_HXX
+
+#include "oox/drawingml/chart/chartcontextbase.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct TextModel;
+
+/** Handler for a chart text context (c:tx element).
+ */
+class TextContext : public ContextBase< TextModel >
+{
+public:
+ explicit TextContext( ::oox::core::ContextHandler2Helper& rParent, TextModel& rModel );
+ virtual ~TextContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onCharacters( const OUString& rChars );
+};
+
+// ============================================================================
+
+struct TitleModel;
+
+/** Handler for a chart title context (c:title element).
+ */
+class TitleContext : public ContextBase< TitleModel >
+{
+public:
+ explicit TitleContext( ::oox::core::ContextHandler2Helper& rParent, TitleModel& rModel );
+ virtual ~TitleContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+struct LegendModel;
+
+/** Handler for a chart legend context (c:legend element).
+ */
+class LegendContext : public ContextBase< LegendModel >
+{
+public:
+ explicit LegendContext( ::oox::core::ContextHandler2Helper& rParent, LegendModel& rModel );
+ virtual ~LegendContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/titleconverter.hxx b/include/oox/drawingml/chart/titleconverter.hxx
new file mode 100644
index 000000000000..ad3694568efe
--- /dev/null
+++ b/include/oox/drawingml/chart/titleconverter.hxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_CHART_TITLECONVERTER_HXX
+#define OOX_DRAWINGML_CHART_TITLECONVERTER_HXX
+
+#include "oox/drawingml/chart/converterbase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace chart2 { class XDiagram; }
+ namespace chart2 { class XFormattedString; }
+ namespace chart2 { class XTitled; }
+ namespace chart2 { namespace data { class XDataSequence; } }
+} } }
+
+namespace oox { namespace drawingml { struct TextCharacterProperties; } }
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct TextModel;
+
+class TextConverter : public ConverterBase< TextModel >
+{
+public:
+ explicit TextConverter( const ConverterRoot& rParent, TextModel& rModel );
+ virtual ~TextConverter();
+
+ /** Creates a data sequence object from the contained text data. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >
+ createDataSequence( const OUString& rRole );
+ /** Creates a sequence of formatted string objects. */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XFormattedString > >
+ createStringSequence(
+ const OUString& rDefaultText,
+ const ModelRef< TextBody >& rxTextProp,
+ ObjectType eObjType );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XFormattedString >
+ appendFormattedString(
+ ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XFormattedString > >& orStringVec,
+ const OUString& rString,
+ bool bAddNewLine ) const;
+};
+
+// ============================================================================
+
+struct TitleModel;
+
+class TitleConverter : public ConverterBase< TitleModel >
+{
+public:
+ explicit TitleConverter( const ConverterRoot& rParent, TitleModel& rModel );
+ virtual ~TitleConverter();
+
+ /** Creates a title text object and attaches it at the passed interface. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitled >& rxTitled,
+ const OUString& rAutoTitle, ObjectType eObjType,
+ sal_Int32 nMainIdx = -1, sal_Int32 nSubIdx = -1 );
+};
+
+// ============================================================================
+
+struct LegendModel;
+
+class LegendConverter : public ConverterBase< LegendModel >
+{
+public:
+ explicit LegendConverter( const ConverterRoot& rParent, LegendModel& rModel );
+ virtual ~LegendConverter();
+
+ /** Creates a legend object and attaches it at the passed diagram. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& rxDiagram );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/titlemodel.hxx b/include/oox/drawingml/chart/titlemodel.hxx
new file mode 100644
index 000000000000..f365d0b6ec89
--- /dev/null
+++ b/include/oox/drawingml/chart/titlemodel.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 OOX_DRAWINGML_CHART_TITLEMODEL_HXX
+#define OOX_DRAWINGML_CHART_TITLEMODEL_HXX
+
+#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/chart/datasourcemodel.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct TextModel
+{
+ typedef ModelRef< DataSequenceModel > DataSequenceRef;
+ typedef ModelRef< TextBody > TextBodyRef;
+
+ DataSequenceRef mxDataSeq; /// The string data or formula link of this text.
+ TextBodyRef mxTextBody; /// Rich-formatted literal text (for title objects only).
+
+ explicit TextModel();
+ ~TextModel();
+};
+
+// ============================================================================
+
+struct TitleModel
+{
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< TextBody > TextBodyRef;
+ typedef ModelRef< LayoutModel > LayoutRef;
+ typedef ModelRef< TextModel > TextRef;
+
+ ShapeRef mxShapeProp; /// Title shape formatting.
+ TextBodyRef mxTextProp; /// Title text formatting.
+ LayoutRef mxLayout; /// Layout/position of the frame.
+ TextRef mxText; /// Text source of the title.
+ bool mbOverlay; /// True = title may overlay other objects.
+
+ explicit TitleModel();
+ ~TitleModel();
+};
+
+// ============================================================================
+
+struct LegendModel
+{
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< TextBody > TextBodyRef;
+ typedef ModelRef< LayoutModel > LayoutRef;
+
+ ShapeRef mxShapeProp; /// Legend shape formatting.
+ TextBodyRef mxTextProp; /// Legend text formatting.
+ LayoutRef mxLayout; /// Layout/position of the legend.
+ sal_Int32 mnPosition; /// Legend position.
+ bool mbOverlay; /// True = legend may overlay other objects.
+
+ explicit LegendModel();
+ ~LegendModel();
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/typegroupcontext.hxx b/include/oox/drawingml/chart/typegroupcontext.hxx
new file mode 100644
index 000000000000..52667817ff0d
--- /dev/null
+++ b/include/oox/drawingml/chart/typegroupcontext.hxx
@@ -0,0 +1,164 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_CHART_TYPEGROUPCONTEXT_HXX
+#define OOX_DRAWINGML_CHART_TYPEGROUPCONTEXT_HXX
+
+#include "oox/drawingml/chart/chartcontextbase.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct UpDownBarsModel;
+
+/** Handler for an up/down bars context (c:upDownBars element).
+ */
+class UpDownBarsContext : public ContextBase< UpDownBarsModel >
+{
+public:
+ explicit UpDownBarsContext( ::oox::core::ContextHandler2Helper& rParent, UpDownBarsModel& rModel );
+ virtual ~UpDownBarsContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+struct TypeGroupModel;
+typedef ContextBase< TypeGroupModel > TypeGroupContextBase;
+
+// ============================================================================
+
+/** Handler for area type group contexts (c:area3DChart, c:areaChart elements).
+ */
+class AreaTypeGroupContext : public TypeGroupContextBase
+{
+public:
+ explicit AreaTypeGroupContext( ::oox::core::ContextHandler2Helper& rParent, TypeGroupModel& rModel );
+ virtual ~AreaTypeGroupContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for bar type group contexts (c:bar3DChart, c:barChart elements).
+ */
+class BarTypeGroupContext : public TypeGroupContextBase
+{
+public:
+ explicit BarTypeGroupContext( ::oox::core::ContextHandler2Helper& rParent, TypeGroupModel& rModel );
+ virtual ~BarTypeGroupContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for bubble type group context (c:bubbleChart element).
+ */
+class BubbleTypeGroupContext : public TypeGroupContextBase
+{
+public:
+ explicit BubbleTypeGroupContext( ::oox::core::ContextHandler2Helper& rParent, TypeGroupModel& rModel );
+ virtual ~BubbleTypeGroupContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for line type group contexts (c:line3DChart, c:lineChart,
+ c:stockChart elements).
+ */
+class LineTypeGroupContext : public TypeGroupContextBase
+{
+public:
+ explicit LineTypeGroupContext( ::oox::core::ContextHandler2Helper& rParent, TypeGroupModel& rModel );
+ virtual ~LineTypeGroupContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for pie type group contexts (c:doughnutChart, c:ofPieChart,
+ c:pie3DChart, c:pieChart elements).
+ */
+class PieTypeGroupContext : public TypeGroupContextBase
+{
+public:
+ explicit PieTypeGroupContext( ::oox::core::ContextHandler2Helper& rParent, TypeGroupModel& rModel );
+ virtual ~PieTypeGroupContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for radar type group context (c:radarChart element).
+ */
+class RadarTypeGroupContext : public TypeGroupContextBase
+{
+public:
+ explicit RadarTypeGroupContext( ::oox::core::ContextHandler2Helper& rParent, TypeGroupModel& rModel );
+ virtual ~RadarTypeGroupContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for scatter type group context (c:scatterChart element).
+ */
+class ScatterTypeGroupContext : public TypeGroupContextBase
+{
+public:
+ explicit ScatterTypeGroupContext( ::oox::core::ContextHandler2Helper& rParent, TypeGroupModel& rModel );
+ virtual ~ScatterTypeGroupContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+/** Handler for surface type group contexts (c:surface3DChart, c:surfaceChart
+ elements).
+ */
+class SurfaceTypeGroupContext : public TypeGroupContextBase
+{
+public:
+ explicit SurfaceTypeGroupContext( ::oox::core::ContextHandler2Helper& rParent, TypeGroupModel& rModel );
+ virtual ~SurfaceTypeGroupContext();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/typegroupconverter.hxx b/include/oox/drawingml/chart/typegroupconverter.hxx
new file mode 100644
index 000000000000..dfce05065c18
--- /dev/null
+++ b/include/oox/drawingml/chart/typegroupconverter.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 OOX_DRAWINGML_CHART_TYPEGROUPCONVERTER_HXX
+#define OOX_DRAWINGML_CHART_TYPEGROUPCONVERTER_HXX
+
+#include "oox/drawingml/chart/converterbase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace chart2 { class XChartType; }
+ namespace chart2 { class XCoordinateSystem; }
+ namespace chart2 { class XDataSeries; }
+ namespace chart2 { class XDiagram; }
+ namespace chart2 { namespace data { class XLabeledDataSequence; } }
+} } }
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+/** Enumerates different chart types. */
+enum TypeId
+{
+ TYPEID_BAR, /// Vertical bar chart.
+ TYPEID_HORBAR, /// Horizontal bar chart.
+ TYPEID_LINE, /// Line chart.
+ TYPEID_AREA, /// Area chart.
+ TYPEID_STOCK, /// Stock chart.
+ TYPEID_RADARLINE, /// Linear radar chart.
+ TYPEID_RADARAREA, /// Filled radar chart.
+ TYPEID_PIE, /// Pie chart.
+ TYPEID_DOUGHNUT, /// Doughnut (ring) chart.
+ TYPEID_OFPIE, /// Pie-to-pie or pie-to-bar chart.
+ TYPEID_SCATTER, /// Scatter (XY) chart.
+ TYPEID_BUBBLE, /// Bubble chart.
+ TYPEID_SURFACE, /// Surface chart.
+ TYPEID_UNKNOWN /// Default for unknown chart types.
+};
+
+// ----------------------------------------------------------------------------
+
+/** Enumerates different categories of similar chart types. */
+enum TypeCategory
+{
+ TYPECATEGORY_BAR, /// Bar charts (horizontal or vertical).
+ TYPECATEGORY_LINE, /// Line charts (line, area, stock charts).
+ TYPECATEGORY_RADAR, /// Radar charts (linear or filled).
+ TYPECATEGORY_PIE, /// Pie and donut charts.
+ TYPECATEGORY_SCATTER, /// Scatter and bubble charts.
+ TYPECATEGORY_SURFACE /// Surface charts.
+};
+
+// ----------------------------------------------------------------------------
+
+/** Enumerates modes for varying point colors in a series. */
+enum VarPointMode
+{
+ VARPOINTMODE_NONE, /// No varied colors supported.
+ VARPOINTMODE_SINGLE, /// Only supported, if type group contains only one series.
+ VARPOINTMODE_MULTI /// Supported for multiple series in a chart type group.
+};
+
+// ============================================================================
+
+/** Contains info for a chart type related to the OpenOffice.org chart module. */
+struct TypeGroupInfo
+{
+ TypeId meTypeId; /// Unique chart type identifier.
+ TypeCategory meTypeCategory; /// Category this chart type belongs to.
+ const sal_Char* mpcServiceName; /// Service name of the type.
+ VarPointMode meVarPointMode; /// Mode for varying point colors.
+ sal_Int32 mnDefLabelPos; /// Default data label position (API constant).
+ bool mbCombinable2d; /// True = types can be combined in one axes set.
+ bool mbSupports3d; /// True = 3D type allowed, false = only 2D type.
+ bool mbPolarCoordSystem; /// True = polar, false = cartesian.
+ bool mbSeriesIsFrame2d; /// True = 2D type series with area formatting.
+ bool mbSingleSeriesVis; /// True = only first series visible (e.g. pie charts).
+ bool mbCategoryAxis; /// True = X axis contains categories.
+ bool mbSwappedAxesSet; /// True = X axis and Y axis are swapped.
+ bool mbSupportsStacking; /// True = data points can be stacked on each other.
+ bool mbReverseSeries; /// True = insert unstacked series in reverse order.
+ bool mbTicksBetweenCateg; /// True = X axis ticks between categories.
+ bool mbPictureOptions; /// True = bitmaps support options from c:pictureOptions.
+};
+
+// ============================================================================
+
+struct UpDownBarsModel;
+
+class UpDownBarsConverter : public ConverterBase< UpDownBarsModel >
+{
+public:
+ explicit UpDownBarsConverter( const ConverterRoot& rParent, UpDownBarsModel& rModel );
+ virtual ~UpDownBarsConverter();
+
+ /** Converts the OOXML up/down bars. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& rxChartType );
+};
+
+// ============================================================================
+
+struct TypeGroupModel;
+struct View3DModel;
+
+class TypeGroupConverter : public ConverterBase< TypeGroupModel >
+{
+public:
+ explicit TypeGroupConverter( const ConverterRoot& rParent, TypeGroupModel& rModel );
+ virtual ~TypeGroupConverter();
+
+ /** Returns the type info struct that describes this chart type group. */
+ inline const TypeGroupInfo& getTypeInfo() const { return maTypeInfo; }
+
+ /** Returns true, if the series in this chart type group are stacked on each other (no percentage). */
+ bool isStacked() const;
+ /** Returns true, if the series in this chart type group are stacked on each other as percentage. */
+ bool isPercent() const;
+ /** Returns true, if the chart is three-dimensional. */
+ bool is3dChart() const;
+ /** Returns true, if chart type supports wall and floor format in 3D mode. */
+ bool isWall3dChart() const;
+ /** Returns true, if the series in this chart type group are ordered on the Z axis. */
+ bool isDeep3dChart() const;
+
+ /** Returns true, if this chart type supports area formatting for its series. */
+ bool isSeriesFrameFormat() const;
+ /** Returns the object type for a series depending on the chart type. */
+ ObjectType getSeriesObjectType() const;
+
+ /** Returns true, if this chart type has to reverse its series order. */
+ bool isReverseSeries() const;
+ /** Returns series title, if the chart type group contains only one single series. */
+ OUString getSingleSeriesTitle() const;
+
+ /** Creates a coordinate system according to the contained chart type. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem >
+ createCoordinateSystem();
+ /** Creates a labeled data sequence object for axis categories. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence >
+ createCategorySequence();
+
+ /** Converts the OOXML type group model into a chart2 coordinate system. */
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& rxDiagram,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem >& rxCoordSystem,
+ sal_Int32 nAxesSetIdx, bool bSupportsVaryColorsByPoint );
+
+ /** Sets the passed OOXML marker style at the passed property set. */
+ void convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize ) const;
+ /** Sets the passed OOXML line smoothing at the passed property set. */
+ void convertLineSmooth( PropertySet& rPropSet, bool bOoxSmooth ) const;
+ /** Sets the passed OOXML bar 3D geometry at the passed property set. */
+ void convertBarGeometry( PropertySet& rPropSet, sal_Int32 nOoxShape ) const;
+ /** Sets the passed OOXML pie rotation at the passed property set. */
+ void convertPieRotation( PropertySet& rPropSet, sal_Int32 nOoxAngle ) const;
+ /** Sets the passed OOXML pie explosion at the passed property set. */
+ void convertPieExplosion( PropertySet& rPropSet, sal_Int32 nOoxExplosion ) const;
+
+private:
+ /** Inserts the passed series into the chart type. Adds additional properties to the series. */
+ void insertDataSeries(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& rxChartType,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& rxSeries,
+ sal_Int32 nAxesSetIdx );
+
+private:
+ TypeGroupInfo maTypeInfo; /// Extended type info for contained chart type model.
+ bool mb3dChart; /// True = type is a 3D chart type.
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/chart/typegroupmodel.hxx b/include/oox/drawingml/chart/typegroupmodel.hxx
new file mode 100644
index 000000000000..1949a3ee892e
--- /dev/null
+++ b/include/oox/drawingml/chart/typegroupmodel.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_CHART_TYPEGROUPMODEL_HXX
+#define OOX_DRAWINGML_CHART_TYPEGROUPMODEL_HXX
+
+#include "oox/drawingml/chart/seriesmodel.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+struct UpDownBarsModel
+{
+ typedef ModelRef< Shape > ShapeRef;
+
+ ShapeRef mxDownBars; /// Formatting of down bars.
+ ShapeRef mxUpBars; /// Formatting of up bars.
+ sal_Int32 mnGapWidth; /// Space between up/down bars.
+
+ explicit UpDownBarsModel();
+ ~UpDownBarsModel();
+};
+
+// ============================================================================
+
+struct TypeGroupModel
+{
+ typedef ModelVector< SeriesModel > SeriesVector;
+ typedef ::std::vector< sal_Int32 > AxisIdVector;
+ typedef ModelRef< DataLabelsModel > DataLabelsRef;
+ typedef ModelRef< UpDownBarsModel > UpDownBarsRef;
+ typedef ModelRef< Shape > ShapeRef;
+
+ SeriesVector maSeries; /// Series attached to this chart type group.
+ AxisIdVector maAxisIds; /// List of axis identifiers used by this chart type.
+ DataLabelsRef mxLabels; /// Data point label settings for all series.
+ UpDownBarsRef mxUpDownBars; /// Up/down bars in stock charts.
+ ShapeRef mxSerLines; /// Connector lines in stacked bar charts.
+ ShapeRef mxDropLines; /// Drop lines connecting data points with X axis.
+ ShapeRef mxHiLowLines; /// High/low lines connecting lowest and highest data points.
+ double mfSplitPos; /// Threshold value in pie-to charts.
+ sal_Int32 mnBarDir; /// Bar direction in bar charts (vertical/horizontal).
+ sal_Int32 mnBubbleScale; /// Relative scaling of bubble size (percent).
+ sal_Int32 mnFirstAngle; /// Rotation angle of first slice in pie charts.
+ sal_Int32 mnGapDepth; /// Space between series in deep 3D charts.
+ sal_Int32 mnGapWidth; /// Space between bars in bar charts, or space in pie-to charts.
+ sal_Int32 mnGrouping; /// Series grouping mode.
+ sal_Int32 mnHoleSize; /// Hole size in doughnut charts.
+ sal_Int32 mnOfPieType; /// Pie-to-pie or pie-to-bar chart.
+ sal_Int32 mnOverlap; /// Bar overlap per category (2D bar charts only).
+ sal_Int32 mnRadarStyle; /// Type of radar chart (lines, markers, filled).
+ sal_Int32 mnScatterStyle; /// Type of scatter chart (lines, markers, smooth).
+ sal_Int32 mnSecondPieSize; /// relative size of second pie/bar in pie-to charts (percent).
+ sal_Int32 mnShape; /// 3D bar shape type.
+ sal_Int32 mnSizeRepresents; /// Bubble size represents area or width.
+ sal_Int32 mnSplitType; /// Split type in pie-to charts.
+ sal_Int32 mnTypeId; /// Chart type identifier.
+ bool mbBubble3d; /// True = show bubbles with 3D shade.
+ bool mbShowMarker; /// True = show point markers in line charts.
+ bool mbShowNegBubbles; /// True = show absolute value of negative bubbles.
+ bool mbSmooth; /// True = smooth lines in line charts.
+ bool mbVaryColors; /// True = different automatic colors for each point.
+ bool mbWireframe; /// True = wireframe surface chart, false = filled surface chart.
+
+ explicit TypeGroupModel( sal_Int32 nTypeId );
+ ~TypeGroupModel();
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/clrscheme.hxx b/include/oox/drawingml/clrscheme.hxx
new file mode 100644
index 000000000000..7c4f0106cb43
--- /dev/null
+++ b/include/oox/drawingml/clrscheme.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 OOX_DRAWINGML_CLRSCHEME_HXX
+#define OOX_DRAWINGML_CLRSCHEME_HXX
+
+#include <boost/shared_ptr.hpp>
+#include <map>
+#include <vector>
+#include "oox/drawingml/color.hxx"
+#include "oox/dllapi.h"
+
+namespace oox { namespace drawingml {
+
+class ClrMap
+{
+ std::map < sal_Int32, sal_Int32 > maClrMap;
+
+public:
+
+ sal_Bool getColorMap( sal_Int32& nClrToken );
+ void setColorMap( sal_Int32 nClrToken, sal_Int32 nMappedClrToken );
+};
+
+typedef boost::shared_ptr< ClrMap > ClrMapPtr;
+
+class OOX_DLLPUBLIC ClrScheme
+{
+ std::map < sal_Int32, sal_Int32 > maClrScheme;
+
+public:
+
+ ClrScheme();
+ ~ClrScheme();
+
+ sal_Bool getColor( sal_Int32 nSchemeClrToken, sal_Int32& rColor ) const;
+ void setColor( sal_Int32 nSchemeClrToken, sal_Int32 nColor );
+};
+
+typedef boost::shared_ptr< ClrScheme > ClrSchemePtr;
+
+} }
+
+#endif // OOX_DRAWINGML_CLRSCHEME_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/clrschemecontext.hxx b/include/oox/drawingml/clrschemecontext.hxx
new file mode 100644
index 000000000000..466b852a37cf
--- /dev/null
+++ b/include/oox/drawingml/clrschemecontext.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 OOX_DRAWINGML_CLRSCHEMECONTEXT_HXX
+#define OOX_DRAWINGML_CLRSCHEMECONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+#include "oox/drawingml/clrscheme.hxx"
+#include "oox/drawingml/color.hxx"
+#include "oox/drawingml/colorchoicecontext.hxx"
+
+namespace oox { namespace drawingml {
+
+class clrMapContext : public oox::core::ContextHandler
+{
+public:
+ clrMapContext( ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes, ClrMap& rClrMap );
+};
+
+class clrSchemeColorContext : private Color, public ColorContext
+{
+public:
+ clrSchemeColorContext( ::oox::core::ContextHandler& rParent, ClrScheme& rClrScheme, sal_Int32 nColorToken );
+ virtual ~clrSchemeColorContext();
+
+private:
+ ClrScheme& mrClrScheme;
+ sal_Int32 mnColorToken;
+};
+
+class clrSchemeContext : public oox::core::ContextHandler
+{
+public:
+ clrSchemeContext( ::oox::core::ContextHandler& rParent, ClrScheme& rClrScheme );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ ClrScheme& mrClrScheme;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_CLRSCHEMECONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx
new file mode 100644
index 000000000000..b58f0b8ae5b3
--- /dev/null
+++ b/include/oox/drawingml/color.hxx
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_COLOR_HXX
+#define OOX_DRAWINGML_COLOR_HXX
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include <sal/types.h>
+#include <rtl/instance.hxx>
+#include <rtl/ustring.hxx>
+#include "oox/helper/helper.hxx"
+#include "oox/dllapi.h"
+
+namespace oox { class GraphicHelper; }
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+class OOX_DLLPUBLIC Color
+{
+public:
+ Color();
+ ~Color();
+
+ /** Returns the RGB value for the passed DrawingML color token, or nDefaultRgb on error. */
+ static sal_Int32 getDmlPresetColor( sal_Int32 nToken, sal_Int32 nDefaultRgb );
+ /** Returns the RGB value for the passed VML color token, or nDefaultRgb on error. */
+ static sal_Int32 getVmlPresetColor( sal_Int32 nToken, sal_Int32 nDefaultRgb );
+
+ /** Sets the color to unused state. */
+ void setUnused();
+ /** Sets an RGB value (hexadecimal RRGGBB) from the a:srgbClr element. */
+ void setSrgbClr( sal_Int32 nRgb );
+ /** Sets the percentual RGB values from the a:scrgbClr element. */
+ void setScrgbClr( sal_Int32 nR, sal_Int32 nG, sal_Int32 nB );
+ /** Sets the HSL values from the a:hslClr element. */
+ void setHslClr( sal_Int32 nHue, sal_Int32 nSat, sal_Int32 nLum );
+ /** Sets a predefined color from the a:prstClr element. */
+ void setPrstClr( sal_Int32 nToken );
+ /** Sets a scheme color from the a:schemeClr element. */
+ void setSchemeClr( sal_Int32 nToken );
+ /** Sets a system color from the a:sysClr element. */
+ void setSysClr( sal_Int32 nToken, sal_Int32 nLastRgb );
+ /** Sets a palette color index. */
+ void setPaletteClr( sal_Int32 nPaletteIdx );
+
+ /** Inserts the passed color transformation. */
+ void addTransformation( sal_Int32 nElement, sal_Int32 nValue = -1 );
+ /** Inserts Chart specific color tint (-1.0...0.0 = shade, 0.0...1.0 = tint). */
+ void addChartTintTransformation( double fTint );
+ /** Inserts Excel specific color tint (-1.0...0.0 = shade, 0.0...1.0 = tint). */
+ void addExcelTintTransformation( double fTint );
+ /** Removes all color transformations. */
+ void clearTransformations();
+ /** Removes transparence from the color. */
+ void clearTransparence();
+
+ /** Overwrites this color with the passed color, if it is used. */
+ inline void assignIfUsed( const Color& rColor ) { if( rColor.isUsed() ) *this = rColor; }
+
+ /** Returns true, if the color is initialized. */
+ bool isUsed() const { return meMode != COLOR_UNUSED; }
+ /** Returns true, if the color is a placeholder color in theme style lists. */
+ bool isPlaceHolder() const { return meMode == COLOR_PH; }
+ /** Returns the final RGB color value.
+ @param nPhClr Actual color for the phClr placeholder color used in theme style lists. */
+ sal_Int32 getColor( const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
+
+ /** Returns true, if the color is transparent. */
+ bool hasTransparency() const;
+ /** Returns the transparency of the color (0 = opaque, 100 = full transparent). */
+ sal_Int16 getTransparency() const;
+
+private:
+ /** Internal helper for getColor(). */
+ void setResolvedRgb( sal_Int32 nRgb ) const;
+
+ /** Converts the color components to RGB values. */
+ void toRgb() const;
+ /** Converts the color components to CRGB values (gamma corrected percentage). */
+ void toCrgb() const;
+ /** Converts the color components to HSL values. */
+ void toHsl() const;
+
+private:
+ enum ColorMode
+ {
+ COLOR_UNUSED, /// Color is not used, or undefined.
+ COLOR_RGB, /// Absolute RGB (r/g/b: 0...255).
+ COLOR_CRGB, /// Relative RGB (r/g/b: 0...100000).
+ COLOR_HSL, /// HSL (hue: 0...21600000, sat/lum: 0...100000).
+ COLOR_SCHEME, /// Color from scheme.
+ COLOR_PALETTE, /// Color from application defined palette.
+ COLOR_SYSTEM, /// Color from system palette.
+ COLOR_PH, /// Placeholder color in theme style lists.
+ COLOR_FINAL /// Finalized RGB color.
+ };
+
+ struct Transformation
+ {
+ sal_Int32 mnToken;
+ sal_Int32 mnValue;
+
+ explicit Transformation( sal_Int32 nToken, sal_Int32 nValue ) : mnToken( nToken ), mnValue( nValue ) {}
+ };
+ typedef ::std::vector< Transformation > TransformVec;
+
+ mutable ColorMode meMode; /// Current color mode.
+ mutable TransformVec maTransforms; /// Color transformations.
+ mutable sal_Int32 mnC1; /// Red, red%, hue, scheme token, palette index, system token, or final RGB.
+ mutable sal_Int32 mnC2; /// Green, green%, saturation, or system default RGB.
+ mutable sal_Int32 mnC3; /// Blue, blue%, or luminance.
+ sal_Int32 mnAlpha; /// Alpha value (color opacity).
+};
+
+typedef boost::shared_ptr< Color > ColorPtr;
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/colorchoicecontext.hxx b/include/oox/drawingml/colorchoicecontext.hxx
new file mode 100644
index 000000000000..aaacfd44d5b7
--- /dev/null
+++ b/include/oox/drawingml/colorchoicecontext.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 OOX_DRAWINGML_COLORCHOICECONTEXT_HXX
+#define OOX_DRAWINGML_COLORCHOICECONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+
+namespace oox {
+namespace drawingml {
+
+class Color;
+
+// ============================================================================
+
+/** Context handler for the different color value elements (a:scrgbClr,
+ a:srgbClr, a:hslClr, a:sysClr, a:schemeClr, a:prstClr). */
+class ColorValueContext : public ::oox::core::ContextHandler
+{
+public:
+ explicit ColorValueContext( ::oox::core::ContextHandler& rParent, Color& rColor );
+
+ virtual void SAL_CALL startFastElement(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ Color& mrColor;
+};
+
+// ============================================================================
+
+/** Context handler for elements that *contain* a color value element
+ (a:scrgbClr, a:srgbClr, a:hslClr, a:sysClr, a:schemeClr, a:prstClr). */
+class ColorContext : public ::oox::core::ContextHandler
+{
+public:
+ explicit ColorContext( ::oox::core::ContextHandler& rParent, Color& rColor );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ Color& mrColor;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/connectorshapecontext.hxx b/include/oox/drawingml/connectorshapecontext.hxx
new file mode 100644
index 000000000000..48a03ae317af
--- /dev/null
+++ b/include/oox/drawingml/connectorshapecontext.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 OOX_DRAWINGML_CONNECTORSHAPECONTEXT_HXX
+#define OOX_DRAWINGML_CONNECTORSHAPECONTEXT_HXX
+
+#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/shapecontext.hxx"
+#include "oox/dllapi.h"
+
+namespace oox { namespace drawingml {
+
+class OOX_DLLPUBLIC ConnectorShapeContext : public ShapeContext
+{
+public:
+ ConnectorShapeContext( ::oox::core::ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pGroupShapePtr );
+ virtual ~ConnectorShapeContext();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+};
+
+} }
+
+#endif // OOX_DRAWINGML_CONNECTORSHAPECONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/customshapegeometry.hxx b/include/oox/drawingml/customshapegeometry.hxx
new file mode 100644
index 000000000000..3920881f123a
--- /dev/null
+++ b/include/oox/drawingml/customshapegeometry.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 OOX_DRAWINGML_CUSTOMSHAPEGEOMETRY_HXX
+#define OOX_DRAWINGML_CUSTOMSHAPEGEOMETRY_HXX
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include "oox/helper/propertymap.hxx"
+#include "oox/core/contexthandler.hxx"
+#include "oox/drawingml/shape.hxx"
+
+namespace oox { namespace drawingml {
+
+
+// ---------------------------------------------------------------------
+// CT_CustomGeometry2D
+class CustomShapeGeometryContext : public ::oox::core::ContextHandler
+{
+public:
+ CustomShapeGeometryContext( ::oox::core::ContextHandler& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes, CustomShapeProperties& rCustomShapeProperties );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ CustomShapeProperties& mrCustomShapeProperties;
+};
+
+// ---------------------------------------------------------------------
+// CT_PresetGeometry2D
+class PresetShapeGeometryContext : public ::oox::core::ContextHandler
+{
+public:
+ PresetShapeGeometryContext( ::oox::core::ContextHandler& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes, CustomShapeProperties& rCustomShapeProperties );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ CustomShapeProperties& mrCustomShapeProperties;
+};
+
+// ---------------------------------------------------------------------
+// CT_PresetTextShape
+class PresetTextShapeContext : public ::oox::core::ContextHandler
+{
+public:
+ PresetTextShapeContext( ::oox::core::ContextHandler& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes, CustomShapeProperties& rCustomShapeProperties );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ CustomShapeProperties& mrCustomShapeProperties;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_CUSTOMSHAPEGEOMETRY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/customshapeproperties.hxx b/include/oox/drawingml/customshapeproperties.hxx
new file mode 100644
index 000000000000..e44f20db95e2
--- /dev/null
+++ b/include/oox/drawingml/customshapeproperties.hxx
@@ -0,0 +1,189 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_CUSTOMSHAPEPROPERTIES_HXX
+#define OOX_DRAWINGML_CUSTOMSHAPEPROPERTIES_HXX
+
+#include <boost/shared_ptr.hpp>
+#include <boost/unordered_map.hpp>
+#include <vector>
+#include <map>
+#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeGluePointType.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/drawing/ProjectionMode.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include "oox/core/xmlfilterbase.hxx"
+#include "oox/drawingml/color.hxx"
+#include "oox/helper/helper.hxx"
+#include "oox/helper/propertymap.hxx"
+#include "oox/token/tokens.hxx"
+
+namespace oox { namespace drawingml {
+
+class CustomShapeProperties;
+
+typedef boost::shared_ptr< CustomShapeProperties > CustomShapePropertiesPtr;
+
+struct CustomShapeGuide
+{
+ OUString maName;
+ OUString maFormula;
+};
+
+struct AdjustHandle
+{
+ sal_Bool polar;
+ com::sun::star::drawing::EnhancedCustomShapeParameterPair
+ pos;
+
+ // depending to the type (polar or not):
+ OptValue< OUString > gdRef1; // gdRefX or gdRefR
+ OptValue< com::sun::star::drawing::EnhancedCustomShapeParameter >
+ min1; // minX or minR
+ OptValue< com::sun::star::drawing::EnhancedCustomShapeParameter >
+ max1; // maxX or maxR
+ OptValue< OUString > gdRef2; // gdRefY or gdRefAng
+ OptValue< com::sun::star::drawing::EnhancedCustomShapeParameter >
+ min2; // minX or minAng
+ OptValue< com::sun::star::drawing::EnhancedCustomShapeParameter >
+ max2; // maxY or maxAng
+
+ AdjustHandle( sal_Bool bPolar ) : polar( bPolar ) {};
+};
+
+struct ConnectionSite
+{
+ com::sun::star::drawing::EnhancedCustomShapeParameterPair
+ pos;
+ com::sun::star::drawing::EnhancedCustomShapeParameter
+ ang;
+};
+
+struct GeomRect
+{
+ com::sun::star::drawing::EnhancedCustomShapeParameter l;
+ com::sun::star::drawing::EnhancedCustomShapeParameter t;
+ com::sun::star::drawing::EnhancedCustomShapeParameter r;
+ com::sun::star::drawing::EnhancedCustomShapeParameter b;
+};
+
+struct Path2D
+{
+ sal_Int64 w;
+ sal_Int64 h;
+ sal_Int32 fill;
+ sal_Bool stroke;
+ sal_Bool extrusionOk;
+ std::vector< com::sun::star::drawing::EnhancedCustomShapeParameterPair > parameter;
+
+ Path2D() : w( 0 ), h( 0 ), fill( XML_norm ), stroke( sal_True ), extrusionOk( sal_True ) {};
+};
+
+
+class CustomShapeProvider {
+protected:
+ struct ParameterPairData {
+ sal_uInt16 nFirstType;
+ sal_uInt16 nSecondType;
+ sal_uInt32 nFirstValue;
+ sal_uInt32 nSecondValue;
+ };
+ static com::sun::star::uno::Any createStringSequence( size_t nStrings, const char **pStrings );
+ static com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > createSegmentSequence( size_t nElems, const sal_uInt16 *pValues );
+ static com::sun::star::drawing::EnhancedCustomShapeParameterPair createParameterPair( const ParameterPairData *pData );
+ static com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > createParameterPairSequence( size_t nElems, const ParameterPairData *pData );
+public:
+ virtual ~CustomShapeProvider() {}
+ virtual PropertyMap getProperties() = 0;
+};
+
+class CustomShapeProperties
+{
+public:
+
+ CustomShapeProperties();
+ virtual ~CustomShapeProperties();
+
+ void pushToPropSet( const ::oox::core::FilterBase& rFilterBase,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & xPropSet,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > & xShape);
+
+ sal_Int32 getShapePresetType() const { return mnShapePresetType; }
+ OUString getShapePresetTypeName() const;
+ void setShapePresetType( sal_Int32 nShapePresetType ){ mnShapePresetType = nShapePresetType; };
+
+ std::vector< CustomShapeGuide >& getAdjustmentGuideList(){ return maAdjustmentGuideList; };
+ std::vector< CustomShapeGuide >& getGuideList(){ return maGuideList; };
+ std::vector< AdjustHandle >& getAdjustHandleList(){ return maAdjustHandleList; };
+ std::vector< ConnectionSite >& getConnectionSiteList(){ return maConnectionSiteList; };
+ OptValue< GeomRect >& getTextRect(){ return maTextRect; };
+ std::vector< Path2D >& getPath2DList(){ return maPath2DList; };
+ std::vector< com::sun::star::drawing::EnhancedCustomShapeSegment >& getSegments(){ return maSegments; };
+ void setMirroredX( sal_Bool bMirroredX ) { mbMirroredX = bMirroredX; };
+ void setMirroredY( sal_Bool bMirroredY ) { mbMirroredY = bMirroredY; };
+ void setTextRotateAngle( sal_Int32 nAngle ) { mnTextRotateAngle = nAngle; };
+
+ static sal_Int32 SetCustomShapeGuideValue( std::vector< CustomShapeGuide >& rGuideList, const CustomShapeGuide& rGuide );
+ static sal_Int32 GetCustomShapeGuideValue( const std::vector< CustomShapeGuide >& rGuideList, const OUString& rFormulaName );
+
+ sal_Int32 getArcNum() { return mnArcNum++; }
+
+private:
+
+ sal_Int32 mnShapePresetType;
+ std::vector< CustomShapeGuide > maAdjustmentGuideList;
+ std::vector< CustomShapeGuide > maGuideList;
+ std::vector< AdjustHandle > maAdjustHandleList;
+ std::vector< ConnectionSite > maConnectionSiteList;
+ OptValue< GeomRect > maTextRect;
+ std::vector< Path2D > maPath2DList;
+
+ std::vector< com::sun::star::drawing::EnhancedCustomShapeSegment >
+ maSegments;
+ sal_Bool mbMirroredX;
+ sal_Bool mbMirroredY;
+ sal_Int32 mnTextRotateAngle;
+
+ typedef boost::unordered_map< sal_Int32, CustomShapeProvider * > PresetsMap;
+
+ static PresetsMap maPresetsMap;
+ static void initializePresetsMap();
+ static void initializePresetsMap1();
+ static void initializePresetsMap2();
+ static void initializePresetsMap3();
+ static void initializePresetsMap4();
+ static void initializePresetsMap5();
+ static void initializePresetsMap6();
+
+ sal_Int32 mnArcNum;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_CUSTOMSHAPEPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/diagram/diagram.hxx b/include/oox/drawingml/diagram/diagram.hxx
new file mode 100644
index 000000000000..e37c1a44e42f
--- /dev/null
+++ b/include/oox/drawingml/diagram/diagram.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 OOX_DRAWINGML_DIAGRAM_HXX
+#define OOX_DRAWINGML_DIAGRAM_HXX
+
+#include <rtl/ustring.hxx>
+#include "oox/drawingml/shape.hxx"
+#include "oox/core/xmlfilterbase.hxx"
+
+#include <com/sun/star/xml/dom/XDocument.hpp>
+
+namespace oox { namespace drawingml {
+
+/** load diagram data, and put resulting graphic into shape
+
+ This method loads the diagram data fragments from the given paths,
+ generate and layout the shapes, and push it as children into the
+ referenced shape.
+ */
+void loadDiagram( ShapePtr& pShape,
+ core::XmlFilterBase& rFilter,
+ const OUString& rDataModelPath,
+ const OUString& rLayoutPath,
+ const OUString& rQStylePath,
+ const OUString& rColorStylePath );
+
+void loadDiagram( const ShapePtr& pShape,
+ core::XmlFilterBase& rFilter,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::dom::XDocument>& rXDataModelDom,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::dom::XDocument>& rXLayoutDom,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::dom::XDocument>& rXQStyleDom,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::dom::XDocument>& rXColorStyleDom );
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/drawingmltypes.hxx b/include/oox/drawingml/drawingmltypes.hxx
new file mode 100644
index 000000000000..5df664ee66a4
--- /dev/null
+++ b/include/oox/drawingml/drawingmltypes.hxx
@@ -0,0 +1,200 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_TYPES_HXX
+#define OOX_DRAWINGML_TYPES_HXX
+
+#include <boost/shared_ptr.hpp>
+#include <com/sun/star/style/TabAlign.hpp>
+#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
+#include <com/sun/star/geometry/IntegerRectangle2D.hpp>
+#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
+#include "oox/helper/helper.hxx"
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+const sal_Int32 PER_PERCENT = 1000;
+const sal_Int32 MAX_PERCENT = 100 * PER_PERCENT;
+
+const sal_Int32 PER_DEGREE = 60000;
+const sal_Int32 MAX_DEGREE = 360 * PER_DEGREE;
+
+// ============================================================================
+
+struct LineProperties;
+typedef ::boost::shared_ptr< LineProperties > LinePropertiesPtr;
+
+struct FillProperties;
+typedef ::boost::shared_ptr< FillProperties > FillPropertiesPtr;
+
+struct GraphicProperties;
+typedef ::boost::shared_ptr< GraphicProperties > GraphicPropertiesPtr;
+
+struct Shape3DProperties;
+typedef ::boost::shared_ptr< Shape3DProperties > Shape3DPropertiesPtr;
+
+struct TextCharacterProperties;
+typedef ::boost::shared_ptr< TextCharacterProperties > TextCharacterPropertiesPtr;
+
+struct TextBodyProperties;
+typedef ::boost::shared_ptr< TextBodyProperties > TextBodyPropertiesPtr;
+
+struct EffectProperties;
+typedef ::boost::shared_ptr< EffectProperties > EffectPropertiesPtr;
+
+class TextBody;
+typedef ::boost::shared_ptr< TextBody > TextBodyPtr;
+
+class Shape;
+typedef ::boost::shared_ptr< Shape > ShapePtr;
+
+class Theme;
+typedef ::boost::shared_ptr< Theme > ThemePtr;
+
+// ---------------------------------------------------------------------------
+
+namespace table {
+
+class TableProperties;
+typedef ::boost::shared_ptr< TableProperties > TablePropertiesPtr;
+
+} // namespace table
+
+// ============================================================================
+
+/** converts the attributes from an CT_TLPoint into an awt Point with 1/1000% */
+com::sun::star::awt::Point GetPointPercent( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs );
+
+
+/** converts the attributes from an CT_Size2D into an awt Size with 1/100th mm */
+com::sun::star::awt::Size GetSize2D( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes );
+
+/** converts the attributes from a CT_RelativeRect to an IntegerRectangle2D */
+com::sun::star::geometry::IntegerRectangle2D GetRelativeRect( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes );
+
+/** converts EMUs into 1/100th mmm */
+sal_Int32 GetCoordinate( sal_Int32 nValue );
+
+/** converts an emu string into 1/100th mmm */
+sal_Int32 GetCoordinate( const OUString& sValue );
+
+/** converts a ST_Percentage % string into 1/1000th of % */
+sal_Int32 GetPercent( const OUString& sValue );
+
+/** Converts a ST_PositiveFixedPercentage to a float. 1.0 == 100% */
+double GetPositiveFixedPercentage( const OUString& sValue );
+
+/** converts the ST_TextFontSize to point */
+float GetTextSize( const OUString& rValue );
+
+/** converts the ST_TextSpacingPoint to 1/100mm */
+sal_Int32 GetTextSpacingPoint( const OUString& sValue );
+sal_Int32 GetTextSpacingPoint( const sal_Int32 nValue );
+
+/** */
+::com::sun::star::style::TabAlign GetTabAlign( ::sal_Int32 aToken );
+
+float GetFontHeight( sal_Int32 nHeight );
+
+sal_Int16 GetFontUnderline( sal_Int32 nToken );
+
+sal_Int16 GetFontStrikeout( sal_Int32 nToken );
+
+sal_Int16 GetCaseMap( sal_Int32 nToken );
+
+/** converts a paragraph align to a ParaAdjust */
+sal_Int16 GetParaAdjust( sal_Int32 nAlign );
+
+// ============================================================================
+
+// CT_IndexRange
+struct IndexRange {
+ sal_Int32 start;
+ sal_Int32 end;
+};
+
+/** retrieve the content of CT_IndexRange */
+IndexRange GetIndexRange( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes );
+
+// ============================================================================
+
+const sal_Int32 EMU_PER_HMM = 360; /// 360 EMUs per 1/100 mm.
+
+/** Converts the passed 32-bit integer value from 1/100 mm to EMUs. */
+inline sal_Int64 convertHmmToEmu( sal_Int32 nValue )
+{
+ return static_cast< sal_Int64 >( nValue ) * EMU_PER_HMM;
+}
+
+/** Converts the passed 64-bit integer value from EMUs to 1/100 mm. */
+inline sal_Int32 convertEmuToHmm( sal_Int64 nValue )
+{
+ return getLimitedValue< sal_Int32, sal_Int64 >( (nValue + EMU_PER_HMM / 2) / EMU_PER_HMM, SAL_MIN_INT32, SAL_MAX_INT32 );
+}
+
+// ============================================================================
+
+/** A structure for a point with 64-bit interger components. */
+struct EmuPoint
+{
+ sal_Int64 X;
+ sal_Int64 Y;
+
+ inline explicit EmuPoint() : X( 0 ), Y( 0 ) {}
+ inline explicit EmuPoint( sal_Int64 nX, sal_Int64 nY ) : X( nX ), Y( nY ) {}
+};
+
+// ============================================================================
+
+/** A structure for a size with 64-bit interger components. */
+struct EmuSize
+{
+ sal_Int64 Width;
+ sal_Int64 Height;
+
+ inline explicit EmuSize() : Width( 0 ), Height( 0 ) {}
+ inline explicit EmuSize( sal_Int64 nWidth, sal_Int64 nHeight ) : Width( nWidth ), Height( nHeight ) {}
+};
+
+// ============================================================================
+
+/** A structure for a rectangle with 64-bit interger components. */
+struct EmuRectangle : public EmuPoint, public EmuSize
+{
+ inline explicit EmuRectangle() {}
+ inline explicit EmuRectangle( const EmuPoint& rPos, const EmuSize& rSize ) : EmuPoint( rPos ), EmuSize( rSize ) {}
+ inline explicit EmuRectangle( sal_Int64 nX, sal_Int64 nY, sal_Int64 nWidth, sal_Int64 nHeight ) : EmuPoint( nX, nY ), EmuSize( nWidth, nHeight ) {}
+
+ inline void setPos( const EmuPoint& rPos ) { static_cast< EmuPoint& >( *this ) = rPos; }
+ inline void setSize( const EmuSize& rSize ) { static_cast< EmuSize& >( *this ) = rSize; }
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/effectproperties.hxx b/include/oox/drawingml/effectproperties.hxx
new file mode 100644
index 000000000000..55c5ec34a20f
--- /dev/null
+++ b/include/oox/drawingml/effectproperties.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/.
+ */
+
+#ifndef OOX_DRAWINGML_EFFECTPROPERTIES_HXX
+#define OOX_DRAWINGML_EFFECTPROPERTIES_HXX
+
+#include "oox/drawingml/fillproperties.hxx"
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+struct EffectShadowProperties
+{
+ OptValue< sal_Int64 > moShadowDist;
+ OptValue< sal_Int64 > moShadowDir;
+ OptValue< sal_Int64 > moShadowAlpha;
+ Color moShadowColor;
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const EffectShadowProperties& rSourceProps );
+};
+
+// ============================================================================
+
+struct OOX_DLLPUBLIC EffectProperties
+{
+ EffectShadowProperties maShadow;
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const EffectProperties& rSourceProps );
+
+ /** Writes the properties to the passed property map. */
+ void pushToPropMap(
+ PropertyMap& rPropMap,
+ const GraphicHelper& rGraphicHelper ) const;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/effectpropertiescontext.hxx b/include/oox/drawingml/effectpropertiescontext.hxx
new file mode 100644
index 000000000000..cd5e2eba28f5
--- /dev/null
+++ b/include/oox/drawingml/effectpropertiescontext.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 OOX_DRAWINGML_EFFECTPROPERTIESCONTEXT_HXX
+#define OOX_DRAWINGML_EFFECTPROPERTIESCONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+#include "oox/dllapi.h"
+
+namespace oox { namespace drawingml {
+
+// ---------------------------------------------------------------------
+
+struct EffectProperties;
+
+class OOX_DLLPUBLIC EffectPropertiesContext : public ::oox::core::ContextHandler
+{
+public:
+ EffectPropertiesContext( ::oox::core::ContextHandler& rParent,
+ EffectProperties& rEffectProperties ) throw();
+ ~EffectPropertiesContext();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ EffectProperties& mrEffectProperties;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_EFFECTPROPERTIESCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/embeddedwavaudiofile.hxx b/include/oox/drawingml/embeddedwavaudiofile.hxx
new file mode 100644
index 000000000000..97cebd54947b
--- /dev/null
+++ b/include/oox/drawingml/embeddedwavaudiofile.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 OOX_DRAWINGML_EMBEDDEDWAVAUDIOFILE_HXX
+#define OOX_DRAWINGML_EMBEDDEDWAVAUDIOFILE_HXX
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
+
+#include "oox/core/fragmenthandler.hxx"
+
+namespace oox { namespace drawingml {
+
+ struct EmbeddedWAVAudioFile
+ {
+ EmbeddedWAVAudioFile()
+ : mbBuiltIn(false)
+ {
+ }
+ bool mbBuiltIn;
+ OUString msName;
+ OUString msEmbed;
+ };
+
+ void getEmbeddedWAVAudioFile(
+ const ::oox::core::Relations& rRelations,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
+ EmbeddedWAVAudioFile & aAudio );
+
+} }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/fillproperties.hxx b/include/oox/drawingml/fillproperties.hxx
new file mode 100644
index 000000000000..fb9aa849e92e
--- /dev/null
+++ b/include/oox/drawingml/fillproperties.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 OOX_DRAWINGML_FILLPROPERTIES_HXX
+#define OOX_DRAWINGML_FILLPROPERTIES_HXX
+
+#include <map>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/geometry/IntegerRectangle2D.hpp>
+#include "oox/drawingml/color.hxx"
+#include "oox/helper/helper.hxx"
+#include "oox/drawingml/embeddedwavaudiofile.hxx"
+
+namespace oox {
+ class GraphicHelper;
+ class PropertyMap;
+ class PropertySet;
+}
+
+namespace oox {
+namespace drawingml {
+
+class ShapePropertyMap;
+
+// ============================================================================
+
+struct GradientFillProperties
+{
+ typedef ::std::map< double, Color > GradientStopMap;
+
+ GradientStopMap maGradientStops; /// Gradient stops (colors/transparence).
+ OptValue< ::com::sun::star::geometry::IntegerRectangle2D > moFillToRect;
+ OptValue< ::com::sun::star::geometry::IntegerRectangle2D > moTileRect;
+ OptValue< sal_Int32 > moGradientPath; /// If set, gradient follows rectangle, circle, or shape.
+ OptValue< sal_Int32 > moShadeAngle; /// Rotation angle of linear gradients.
+ OptValue< sal_Int32 > moShadeFlip; /// Flip mode of gradient, if not stretched to shape.
+ OptValue< bool > moShadeScaled; /// True = scale gradient into shape.
+ OptValue< bool > moRotateWithShape; /// True = rotate gradient with shape.
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const GradientFillProperties& rSourceProps );
+};
+
+// ============================================================================
+
+struct PatternFillProperties
+{
+ Color maPattFgColor; /// Pattern foreground color.
+ Color maPattBgColor; /// Pattern background color.
+ OptValue< sal_Int32 > moPattPreset; /// Preset pattern type.
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const PatternFillProperties& rSourceProps );
+};
+
+// ============================================================================
+
+struct BlipFillProperties
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
+ mxGraphic; /// The fill graphic.
+ OptValue< sal_Int32 > moBitmapMode; /// Bitmap tile or stretch.
+ OptValue< ::com::sun::star::geometry::IntegerRectangle2D >
+ moFillRect; /// Stretch fill offsets.
+ OptValue< ::com::sun::star::geometry::IntegerRectangle2D >
+ moClipRect;
+ OptValue< sal_Int32 > moTileOffsetX; /// Width of bitmap tiles (EMUs).
+ OptValue< sal_Int32 > moTileOffsetY; /// Height of bitmap tiles (EMUs).
+ OptValue< sal_Int32 > moTileScaleX; /// Horizontal scaling of bitmap tiles (1/1000 percent).
+ OptValue< sal_Int32 > moTileScaleY; /// Vertical scaling of bitmap tiles (1/1000 percent).
+ OptValue< sal_Int32 > moTileAlign; /// Anchor point inside bitmap.
+ OptValue< sal_Int32 > moTileFlip; /// Flip mode of bitmap tiles.
+ OptValue< bool > moRotateWithShape; /// True = rotate bitmap with shape.
+ // effects
+ OptValue< sal_Int32 > moColorEffect; /// XML token for a color effect.
+ OptValue< sal_Int32 > moBrightness; /// Brightness in the range [-100000,100000].
+ OptValue< sal_Int32 > moContrast; /// Contrast in the range [-100000,100000].
+ Color maColorChangeFrom; /// Start color of color transformation.
+ Color maColorChangeTo; /// Destination color of color transformation.
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const BlipFillProperties& rSourceProps );
+};
+
+// ============================================================================
+
+struct OOX_DLLPUBLIC FillProperties
+{
+ OptValue< sal_Int32 > moFillType; /// Fill type (OOXML token).
+ Color maFillColor; /// Solid fill color and transparence.
+ GradientFillProperties maGradientProps; /// Properties for gradient fills.
+ PatternFillProperties maPatternProps; /// Properties for pattern fills.
+ BlipFillProperties maBlipProps; /// Properties for bitmap fills.
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const FillProperties& rSourceProps );
+
+ /** Tries to resolve current settings to a solid color, e.g. returns the
+ start color of a gradient. */
+ Color getBestSolidColor() const;
+
+ /** Writes the properties to the passed property map. */
+ void pushToPropMap(
+ ShapePropertyMap& rPropMap,
+ const GraphicHelper& rGraphicHelper,
+ sal_Int32 nShapeRotation = 0,
+ sal_Int32 nPhClr = API_RGB_TRANSPARENT,
+ bool bFlipH = false,
+ bool bFlipV = false ) const;
+};
+
+// ============================================================================
+
+struct GraphicProperties
+{
+ BlipFillProperties maBlipProps; /// Properties for the graphic.
+ EmbeddedWAVAudioFile maAudio; /// Audio file details
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const GraphicProperties& rSourceProps );
+
+ /** Writes the properties to the passed property map. */
+ void pushToPropMap(
+ PropertyMap& rPropMap,
+ const GraphicHelper& rGraphicHelper,
+ sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/fillpropertiesgroupcontext.hxx b/include/oox/drawingml/fillpropertiesgroupcontext.hxx
new file mode 100644
index 000000000000..81d8a6e0db20
--- /dev/null
+++ b/include/oox/drawingml/fillpropertiesgroupcontext.hxx
@@ -0,0 +1,208 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_FILLPROPERTIESGROUPCONTEXT_HPP
+#define OOX_DRAWINGML_FILLPROPERTIESGROUPCONTEXT_HPP
+
+#include "oox/drawingml/colorchoicecontext.hxx"
+#include "oox/drawingml/fillproperties.hxx"
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+/** Context handler that imports the a:solidFill element. */
+class SolidFillContext : public ColorContext
+{
+public:
+ explicit SolidFillContext(
+ ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs,
+ FillProperties& rFillProps );
+};
+
+// ============================================================================
+
+/** Context handler that imports the a:gradFill element. */
+class GradientFillContext : public ::oox::core::ContextHandler
+{
+public:
+ explicit GradientFillContext(
+ ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs,
+ GradientFillProperties& rGradientProps );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+private:
+ GradientFillProperties& mrGradientProps;
+};
+
+// ============================================================================
+
+/** Context handler that imports the a:pattFill element. */
+class PatternFillContext : public ::oox::core::ContextHandler
+{
+public:
+ explicit PatternFillContext(
+ ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs,
+ PatternFillProperties& rPatternProps );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+private:
+ PatternFillProperties& mrPatternProps;
+};
+
+// ============================================================================
+// ============================================================================
+
+/** Context handler that imports the a:clrChange element containing the colors
+ of a bitmap color change transformation. */
+class ColorChangeContext : public ::oox::core::ContextHandler
+{
+public:
+ explicit ColorChangeContext(
+ ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs,
+ BlipFillProperties& rBlipProps );
+ virtual ~ColorChangeContext();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+private:
+ BlipFillProperties& mrBlipProps;
+ bool mbUseAlpha;
+};
+
+// ============================================================================
+
+/** Context handler that imports the a:blip element containing the fill bitmap
+ and bitmap color transformation settings. */
+class BlipContext : public ::oox::core::ContextHandler
+{
+public:
+ explicit BlipContext(
+ ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs,
+ BlipFillProperties& rBlipProps );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+private:
+ BlipFillProperties& mrBlipProps;
+};
+
+// ============================================================================
+
+/** Context handler that imports the a:blipFill element. */
+class BlipFillContext : public ::oox::core::ContextHandler
+{
+public:
+ explicit BlipFillContext(
+ ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs,
+ BlipFillProperties& rBlipProps );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+private:
+ BlipFillProperties& mrBlipProps;
+};
+
+// ============================================================================
+// ============================================================================
+
+/** Context handler for elements that contain a fill property element
+ (a:noFill, a:solidFill, a:gradFill, a:pattFill, a:blipFill, a:grpFill). */
+class FillPropertiesContext : public ::oox::core::ContextHandler
+{
+public:
+ explicit FillPropertiesContext(
+ ::oox::core::ContextHandler& rParent,
+ FillProperties& rFillProps );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler >
+ createFillContext(
+ ::oox::core::ContextHandler& rParent,
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs,
+ FillProperties& rFillProps );
+
+protected:
+ FillProperties& mrFillProps;
+};
+
+// ============================================================================
+
+/** Context handler for elements that contain a fill property element
+ (a:noFill, a:solidFill, a:gradFill, a:pattFill, a:blipFill, a:grpFill).
+
+ This context handler takes a simple color instead of a fill properties
+ struct. The imported fill properties are converted automatically to the
+ best fitting solid color.
+ */
+class SimpleFillPropertiesContext : private FillProperties, public FillPropertiesContext
+{
+public:
+ explicit SimpleFillPropertiesContext(
+ ::oox::core::ContextHandler& rParent,
+ Color& rColor );
+ virtual ~SimpleFillPropertiesContext();
+
+protected:
+ Color& mrColor;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/graphicshapecontext.hxx b/include/oox/drawingml/graphicshapecontext.hxx
new file mode 100644
index 000000000000..c5984d503363
--- /dev/null
+++ b/include/oox/drawingml/graphicshapecontext.hxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_GRAPHICSHAPECONTEXT_HXX
+#define OOX_DRAWINGML_GRAPHICSHAPECONTEXT_HXX
+
+#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/shapecontext.hxx"
+#include "oox/dllapi.h"
+
+namespace oox { namespace vml { struct OleObjectInfo; } }
+
+namespace oox { namespace drawingml {
+
+class OOX_DLLPUBLIC GraphicShapeContext : public ShapeContext
+{
+public:
+ GraphicShapeContext( ::oox::core::ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+};
+
+// ====================================================================
+
+class OOX_DLLPUBLIC GraphicalObjectFrameContext : public ShapeContext
+{
+public:
+ GraphicalObjectFrameContext( ::oox::core::ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr, bool bEmbedShapesInChart );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ bool mbEmbedShapesInChart;
+};
+
+// ====================================================================
+
+class OleObjectGraphicDataContext : public ShapeContext
+{
+public:
+ OleObjectGraphicDataContext( ::oox::core::ContextHandler& rParent, ShapePtr pShapePtr );
+ ~OleObjectGraphicDataContext();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ ::oox::vml::OleObjectInfo& mrOleObjectInfo;
+};
+
+// ====================================================================
+
+class Diagram;
+
+class DiagramGraphicDataContext
+ : public ShapeContext
+{
+public:
+ DiagramGraphicDataContext( ::oox::core::ContextHandler& rParent, ShapePtr pShapePtr );
+ virtual ~DiagramGraphicDataContext();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ OUString msDm;
+ OUString msLo;
+ OUString msQs;
+ OUString msCs;
+};
+
+// ====================================================================
+
+class ChartGraphicDataContext : public ShapeContext
+{
+public:
+ explicit ChartGraphicDataContext(
+ ::oox::core::ContextHandler& rParent,
+ const ShapePtr& rxShape, bool bEmbedShapes );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ ChartShapeInfo& mrChartShapeInfo;
+};
+
+// ====================================================================
+
+} }
+
+#endif // OOX_DRAWINGML_GRAPHICSHAPECONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/guidcontext.hxx b/include/oox/drawingml/guidcontext.hxx
new file mode 100644
index 000000000000..8a60bf20ab5c
--- /dev/null
+++ b/include/oox/drawingml/guidcontext.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 OOX_DRAWINGML_GUIDCONTEXT_HXX
+#define OOX_DRAWINGML_GUIDCONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+
+namespace oox { namespace drawingml {
+
+ class GuidContext : public ::oox::core::ContextHandler
+ {
+
+ public:
+ GuidContext( ::oox::core::ContextHandler& rParent, OUString& rGuidId );
+ virtual void SAL_CALL characters( const OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+ private:
+
+ OUString& mrGuidId;
+ };
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/lineproperties.hxx b/include/oox/drawingml/lineproperties.hxx
new file mode 100644
index 000000000000..7ffdc04230a0
--- /dev/null
+++ b/include/oox/drawingml/lineproperties.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 OOX_DRAWINGML_LINEPROPERTIES_HXX
+#define OOX_DRAWINGML_LINEPROPERTIES_HXX
+
+#include "oox/drawingml/fillproperties.hxx"
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+struct LineArrowProperties
+{
+ OptValue< sal_Int32 > moArrowType;
+ OptValue< sal_Int32 > moArrowWidth;
+ OptValue< sal_Int32 > moArrowLength;
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const LineArrowProperties& rSourceProps );
+};
+
+// ============================================================================
+
+struct OOX_DLLPUBLIC LineProperties
+{
+ typedef ::std::pair< sal_Int32, sal_Int32 > DashStop;
+ typedef ::std::vector< DashStop > DashStopVector;
+
+ LineArrowProperties maStartArrow; /// Start line arrow style.
+ LineArrowProperties maEndArrow; /// End line arrow style.
+ FillProperties maLineFill; /// Line fill (solid, gradient, ...).
+ DashStopVector maCustomDash; /// User-defined line dash style.
+ OptValue< sal_Int32 > moLineWidth; /// Line width (EMUs).
+ OptValue< sal_Int32 > moPresetDash; /// Preset dash (OOXML token).
+ OptValue< sal_Int32 > moLineCompound; /// Line compound type (OOXML token).
+ OptValue< sal_Int32 > moLineCap; /// Line cap (OOXML token).
+ OptValue< sal_Int32 > moLineJoint; /// Line joint type (OOXML token).
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const LineProperties& rSourceProps );
+
+ /** Writes the properties to the passed property map. */
+ void pushToPropMap(
+ ShapePropertyMap& rPropMap,
+ const GraphicHelper& rGraphicHelper,
+ sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/linepropertiescontext.hxx b/include/oox/drawingml/linepropertiescontext.hxx
new file mode 100644
index 000000000000..e0454ddb2250
--- /dev/null
+++ b/include/oox/drawingml/linepropertiescontext.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 OOX_DRAWINGML_LINEPROPERTIESCONTEXT_HXX
+#define OOX_DRAWINGML_LINEPROPERTIESCONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+#include "oox/dllapi.h"
+
+namespace oox { namespace drawingml {
+
+// ---------------------------------------------------------------------
+
+struct LineProperties;
+
+class OOX_DLLPUBLIC LinePropertiesContext : public ::oox::core::ContextHandler
+{
+public:
+ LinePropertiesContext( ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes,
+ LineProperties& rLineProperties ) throw();
+ ~LinePropertiesContext();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ LineProperties& mrLineProperties;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_LINEPROPERTIESCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/objectdefaultcontext.hxx b/include/oox/drawingml/objectdefaultcontext.hxx
new file mode 100644
index 000000000000..b8b1d5b95ede
--- /dev/null
+++ b/include/oox/drawingml/objectdefaultcontext.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 OOX_DRAWINGML_OBJECTDEFAULTCONTEXT_HXX
+#define OOX_DRAWINGML_OBJECTDEFAULTCONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+
+namespace oox { namespace drawingml {
+
+class Theme;
+
+class objectDefaultContext : public oox::core::ContextHandler
+{
+public:
+ objectDefaultContext( ::oox::core::ContextHandler& rParent, Theme& rTheme );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ Theme& mrTheme;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_OBJECTDEFAULTCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/scene3dcontext.hxx b/include/oox/drawingml/scene3dcontext.hxx
new file mode 100644
index 000000000000..cc3341ddf310
--- /dev/null
+++ b/include/oox/drawingml/scene3dcontext.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 OOX_DRAWINGML_SCENE3DPROPERTIESCONTEXT_HPP
+#define OOX_DRAWINGML_SCENE3DPROPERTIESCONTEXT_HPP
+
+#include "oox/core/contexthandler.hxx"
+
+namespace oox { namespace drawingml {
+
+struct Shape3DProperties;
+
+// ---------------------------------------------------------------------
+
+class Scene3DPropertiesContext : public ::oox::core::ContextHandler
+{
+public:
+ Scene3DPropertiesContext( ::oox::core::ContextHandler& rParent, Shape3DProperties& r3DProperties ) throw();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+private:
+ Shape3DProperties& mr3DProperties;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_SCENE3DPROPERTIESCONTEXT_HPP
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
new file mode 100644
index 000000000000..f8a58ec5340b
--- /dev/null
+++ b/include/oox/drawingml/shape.hxx
@@ -0,0 +1,273 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_SHAPE_HXX
+#define OOX_DRAWINGML_SHAPE_HXX
+
+#include "oox/helper/propertymap.hxx"
+#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/drawingml/customshapeproperties.hxx"
+#include "oox/drawingml/textliststyle.hxx"
+#include "oox/drawingml/shape3dproperties.hxx"
+
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <vector>
+#include <map>
+#include "oox/dllapi.h"
+
+namespace oox { namespace vml {
+ struct OleObjectInfo;
+} }
+
+namespace oox { namespace drawingml {
+
+class CustomShapeProperties;
+typedef boost::shared_ptr< CustomShapeProperties > CustomShapePropertiesPtr;
+
+typedef ::std::map< OUString, ShapePtr > ShapeIdMap;
+
+struct ShapeStyleRef
+{
+ Color maPhClr;
+ sal_Int32 mnThemedIdx;
+};
+
+typedef ::std::map< sal_Int32, ShapeStyleRef > ShapeStyleRefMap;
+
+// ============================================================================
+
+/** Additional information for a chart embedded in a drawing shape. */
+struct ChartShapeInfo
+{
+ OUString maFragmentPath; ///< Path to related XML stream, e.g. for charts.
+ bool mbEmbedShapes; ///< True = load chart shapes into chart, false = load into parent drawpage.
+
+ inline explicit ChartShapeInfo( bool bEmbedShapes ) : mbEmbedShapes( bEmbedShapes ) {}
+};
+
+// ============================================================================
+
+class OOX_DLLPUBLIC Shape
+ : public boost::enable_shared_from_this< Shape >
+{
+public:
+
+ explicit Shape( const sal_Char* pServiceType = 0 );
+ explicit Shape( const ShapePtr& pSourceShape );
+ virtual ~Shape();
+
+ OUString& getServiceName(){ return msServiceName; }
+ void setServiceName( const sal_Char* pServiceName );
+
+ PropertyMap& getShapeProperties(){ return maShapeProperties; }
+
+ inline LineProperties& getLineProperties() { return *mpLinePropertiesPtr; }
+ inline const LineProperties& getLineProperties() const { return *mpLinePropertiesPtr; }
+
+ inline FillProperties& getFillProperties() { return *mpFillPropertiesPtr; }
+ inline const FillProperties& getFillProperties() const { return *mpFillPropertiesPtr; }
+
+ inline GraphicProperties& getGraphicProperties() { return *mpGraphicPropertiesPtr; }
+ inline const GraphicProperties& getGraphicProperties() const { return *mpGraphicPropertiesPtr; }
+
+ CustomShapePropertiesPtr getCustomShapeProperties(){ return mpCustomShapePropertiesPtr; }
+
+ Shape3DProperties& get3DProperties() { return *mp3DPropertiesPtr; }
+ const Shape3DProperties& get3DProperties() const { return *mp3DPropertiesPtr; }
+
+ table::TablePropertiesPtr getTableProperties();
+
+ inline EffectProperties& getEffectProperties() { return *mpEffectPropertiesPtr; }
+
+ void setChildPosition( com::sun::star::awt::Point nPosition ){ maChPosition = nPosition; }
+ void setChildSize( com::sun::star::awt::Size aSize ){ maChSize = aSize; }
+ void moveAllToPosition( const com::sun::star::awt::Point &rPoint );
+
+ void setPosition( com::sun::star::awt::Point nPosition ){ maPosition = nPosition; }
+ const com::sun::star::awt::Point& getPosition() const { return maPosition; }
+
+ void setSize( com::sun::star::awt::Size aSize ){ maSize = aSize; }
+ const com::sun::star::awt::Size& getSize() const { return maSize; }
+
+ void setRotation( sal_Int32 nRotation ) { mnRotation = nRotation; }
+ void setFlip( sal_Bool bFlipH, sal_Bool bFlipV ) { mbFlipH = bFlipH; mbFlipV = bFlipV; }
+ void addChild( const ShapePtr pChildPtr ) { maChildren.push_back( pChildPtr ); }
+ std::vector< ShapePtr >& getChildren() { return maChildren; }
+
+ void setName( const OUString& rName ) { msName = rName; }
+ OUString getName( ) { return msName; }
+ void setId( const OUString& rId ) { msId = rId; }
+ OUString getId() { return msId; }
+ void setHidden( sal_Bool bHidden ) { mbHidden = bHidden; }
+ sal_Bool getHidden() const { return mbHidden; };
+ void setHiddenMasterShape( sal_Bool bHiddenMasterShape ) { mbHiddenMasterShape = bHiddenMasterShape; }
+ void setSubType( sal_Int32 nSubType ) { mnSubType = nSubType; }
+ sal_Int32 getSubType() const { return mnSubType; }
+ void setSubTypeIndex( sal_Int32 nSubTypeIndex ) { moSubTypeIndex = nSubTypeIndex; }
+ const OptValue< sal_Int32 >& getSubTypeIndex() const { return moSubTypeIndex; }
+
+ // setDefaults has to be called if styles are imported (OfficeXML is not storing properties having the default value)
+ void setDefaults();
+
+ ::oox::vml::OleObjectInfo& setOleObjectType();
+ ChartShapeInfo& setChartType( bool bEmbedShapes );
+ void setDiagramType();
+ void setTableType();
+
+ void setTextBody(const TextBodyPtr & pTextBody);
+ TextBodyPtr getTextBody();
+ void setMasterTextListStyle( const TextListStylePtr& pMasterTextListStyle );
+ TextListStylePtr getMasterTextListStyle() const { return mpMasterTextListStyle; }
+
+ inline ShapeStyleRefMap& getShapeStyleRefs() { return maShapeStyleRefs; }
+ inline const ShapeStyleRefMap& getShapeStyleRefs() const { return maShapeStyleRefs; }
+ const ShapeStyleRef* getShapeStyleRef( sal_Int32 nRefType ) const;
+
+ // addShape is creating and inserting the corresponding XShape.
+ void addShape(
+ ::oox::core::XmlFilterBase& rFilterBase,
+ const Theme* pTheme,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ basegfx::B2DHomMatrix& aTransformation,
+ FillProperties& rShapeOrParentShapeFillProps,
+ const ::com::sun::star::awt::Rectangle* pShapeRect = 0,
+ ShapeIdMap* pShapeMap = 0 );
+
+ void dropChildren() { maChildren.clear(); }
+
+ void addChildren(
+ ::oox::core::XmlFilterBase& rFilterBase,
+ const Theme* pTheme,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ basegfx::B2DHomMatrix& aTransformation,
+ const ::com::sun::star::awt::Rectangle* pShapeRect = 0,
+ ShapeIdMap* pShapeMap = 0 );
+
+ void setXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rXShape )
+ { mxShape = rXShape; };
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &
+ getXShape() const { return mxShape; }
+
+ virtual void applyShapeReference( const Shape& rReferencedShape, bool bUseText = true );
+ const ::std::vector<OUString>&
+ getExtDrawings() { return maExtDrawings; }
+ void addExtDrawingRelId( const OUString &rRelId ) { maExtDrawings.push_back( rRelId ); }
+
+protected:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsert(
+ ::oox::core::XmlFilterBase& rFilterBase,
+ const OUString& rServiceName,
+ const Theme* pTheme,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle* pShapeRect,
+ sal_Bool bClearText,
+ sal_Bool bDoNotInsertEmptyTextBody,
+ basegfx::B2DHomMatrix& aTransformation,
+ FillProperties& rShapeOrParentShapeFillProps
+ );
+
+ void addChildren(
+ ::oox::core::XmlFilterBase& rFilterBase,
+ Shape& rMaster,
+ const Theme* pTheme,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rClientRect,
+ ShapeIdMap* pShapeMap,
+ basegfx::B2DHomMatrix& aTransformation );
+
+ virtual OUString finalizeServiceName(
+ ::oox::core::XmlFilterBase& rFilter,
+ const OUString& rServiceName,
+ const ::com::sun::star::awt::Rectangle& rShapeRect );
+
+ virtual void finalizeXShape(
+ ::oox::core::XmlFilterBase& rFilter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
+
+ std::vector< ShapePtr > maChildren; // only used for group shapes
+ com::sun::star::awt::Size maChSize; // only used for group shapes
+ com::sun::star::awt::Point maChPosition; // only used for group shapes
+ com::sun::star::awt::Size maAbsoluteSize; // only used for group shapes
+ com::sun::star::awt::Point maAbsolutePosition; // only used for group shapes
+ sal_Bool mbIsChild;
+
+ TextBodyPtr mpTextBody;
+ LinePropertiesPtr mpLinePropertiesPtr;
+ FillPropertiesPtr mpFillPropertiesPtr;
+ GraphicPropertiesPtr mpGraphicPropertiesPtr;
+ CustomShapePropertiesPtr mpCustomShapePropertiesPtr;
+ table::TablePropertiesPtr mpTablePropertiesPtr;
+ Shape3DPropertiesPtr mp3DPropertiesPtr;
+ EffectPropertiesPtr mpEffectPropertiesPtr;
+ PropertyMap maShapeProperties;
+ PropertyMap maDefaultShapeProperties;
+ TextListStylePtr mpMasterTextListStyle;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape;
+
+ OUString msServiceName;
+ OUString msName;
+ OUString msId;
+ sal_Int32 mnSubType; // if this type is not zero, then the shape is a placeholder
+ OptValue< sal_Int32 > moSubTypeIndex;
+
+ ShapeStyleRefMap maShapeStyleRefs;
+
+ com::sun::star::awt::Size maSize;
+ com::sun::star::awt::Point maPosition;
+ ::std::vector<OUString> maExtDrawings;
+
+private:
+ enum FrameType
+ {
+ FRAMETYPE_GENERIC, ///< Generic shape, no special type.
+ FRAMETYPE_OLEOBJECT, ///< OLE object embedded in a shape.
+ FRAMETYPE_CHART, ///< Chart embedded in a shape.
+ FRAMETYPE_DIAGRAM, ///< Complex diagram drawing shape.
+ FRAMETYPE_TABLE ///< A table embedded in a shape.
+ };
+
+ typedef ::boost::shared_ptr< ::oox::vml::OleObjectInfo > OleObjectInfoRef;
+ typedef ::boost::shared_ptr< ChartShapeInfo > ChartShapeInfoRef;
+
+ FrameType meFrameType; ///< Type for graphic frame shapes.
+ OleObjectInfoRef mxOleObjectInfo; ///< Additional data for OLE objects.
+ ChartShapeInfoRef mxChartShapeInfo; ///< Additional data for chart shapes.
+
+ sal_Int32 mnRotation;
+ sal_Bool mbFlipH;
+ sal_Bool mbFlipV;
+ sal_Bool mbHidden;
+ sal_Bool mbHiddenMasterShape; // master shapes can be hidden in layout slides
+ // we need separate flag because we don't want
+ // to propagate it when applying reference shape
+};
+
+// ============================================================================
+
+} }
+
+#endif // OOX_DRAWINGML_SHAPE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/shape3dproperties.hxx b/include/oox/drawingml/shape3dproperties.hxx
new file mode 100644
index 000000000000..d1891402757c
--- /dev/null
+++ b/include/oox/drawingml/shape3dproperties.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 OOX_DRAWINGML_SHAPE3DPROPERTIES_HXX
+#define OOX_DRAWINGML_SHAPE3DPROPERTIES_HXX
+
+#include <map>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/geometry/IntegerRectangle2D.hpp>
+#include "oox/core/xmlfilterbase.hxx"
+#include "oox/drawingml/color.hxx"
+#include "oox/helper/helper.hxx"
+
+namespace oox { class PropertyMap; }
+namespace oox { class PropertySet; }
+namespace oox { namespace core { class ModelObjectContainer; } }
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+struct Shape3DPropertyNames
+{
+ OUString maFillStyle;
+ OUString maFillColor;
+ OUString maFillTransparence;
+ OUString maFillGradient;
+ OUString maFillBitmap;
+ OUString maFillBitmapMode;
+ OUString maFillBitmapTile;
+ OUString maFillBitmapStretch;
+ OUString maFillBitmapLogicalSize;
+ OUString maFillBitmapSizeX;
+ OUString maFillBitmapSizeY;
+ OUString maFillBitmapOffsetX;
+ OUString maFillBitmapOffsetY;
+ OUString maFillBitmapRectanglePoint;
+ bool mbNamedFillGradient;
+ bool mbNamedFillBitmap;
+ bool mbTransformGraphic;
+
+ Shape3DPropertyNames();
+};
+
+// ============================================================================
+
+struct Shape3DProperties
+{
+ typedef ::std::map< double, Color > GradientStopMap;
+
+ OptValue< sal_Int32 > moFillType; /// Fill type (OOXML token).
+ OptValue< bool > moRotateWithShape; /// True = rotate gradient/bitmap with shape.
+ Color maFillColor; /// Solid fill color and transparence.
+ GradientStopMap maGradientStops; /// Gradient stops (colors/transparence).
+ OptValue< sal_Int32 > moGradientPath; /// If set, gradient follows rectangle, circle, or shape.
+ OptValue< sal_Int32 > moShadeAngle; /// Rotation angle of linear gradients.
+ OptValue< bool > moShadeScaled;
+ OptValue< sal_Int32 > moFlipModeToken;
+ OptValue< com::sun::star::geometry::IntegerRectangle2D > moFillToRect;
+ OptValue< com::sun::star::geometry::IntegerRectangle2D > moTileRect;
+ OptValue< sal_Int32 > moPattPreset; /// Preset pattern type.
+ Color maPattFgColor; /// Pattern foreground color.
+ Color maPattBgColor; /// Pattern background color.
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > mxGraphic;
+ Color maColorChangeFrom; /// Start color of color transformation.
+ Color maColorChangeTo; /// Destination color of color transformation.
+ OptValue< sal_Int32 > moBitmapMode; /// Bitmap tile or stretch.
+ OptValue< sal_Int32 > moTileX; /// Width of bitmap tiles.
+ OptValue< sal_Int32 > moTileY; /// Height of bitmap tiles.
+ OptValue< sal_Int32 > moTileSX;
+ OptValue< sal_Int32 > moTileSY;
+ OptValue< sal_Int32 > moTileAlign; /// Anchor point inside bitmap.
+
+ static Shape3DPropertyNames DEFAULTNAMES; /// Default fill property names for shape fill.
+ static Shape3DPropertyNames DEFAULTPICNAMES; /// Default fill property names for pictures.
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const Shape3DProperties& rSourceProps );
+
+ /** Tries to resolve current settings to a solid color, e.g. returns the
+ start color of a gradient. */
+ Color getBestSolidColor() const;
+
+ /** Writes the properties to the passed property map. */
+ void pushToPropMap(
+ PropertyMap& rPropMap,
+ const Shape3DPropertyNames& rPropNames,
+ const ::oox::core::XmlFilterBase& rFilter,
+ ::oox::core::ModelObjectContainer& rObjContainer,
+ sal_Int32 nShapeRotation, sal_Int32 nPhClr ) const;
+
+ /** Writes the properties to the passed property set. */
+ void pushToPropSet(
+ PropertySet& rPropSet,
+ const Shape3DPropertyNames& rPropNames,
+ const ::oox::core::XmlFilterBase& rFilter,
+ ::oox::core::ModelObjectContainer& rObjContainer,
+ sal_Int32 nShapeRotation, sal_Int32 nPhClr ) const;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/shapecontext.hxx b/include/oox/drawingml/shapecontext.hxx
new file mode 100644
index 000000000000..277ee91017ec
--- /dev/null
+++ b/include/oox/drawingml/shapecontext.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 OOX_DRAWINGML_SHAPECONTEXT_HXX
+#define OOX_DRAWINGML_SHAPECONTEXT_HXX
+
+#include <com/sun/star/drawing/XShapes.hpp>
+
+#include "oox/core/contexthandler.hxx"
+#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/shapepropertiescontext.hxx"
+#include "oox/dllapi.h"
+
+namespace oox { namespace drawingml {
+
+class OOX_DLLPUBLIC ShapeContext : public ::oox::core::ContextHandler
+{
+public:
+ ShapeContext( ::oox::core::ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr );
+ virtual ~ShapeContext();
+
+ virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+ ShapePtr getShape();
+
+protected:
+
+ ShapePtr mpMasterShapePtr;
+ ShapePtr mpShapePtr;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_SHAPEGROUPCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/shapegroupcontext.hxx b/include/oox/drawingml/shapegroupcontext.hxx
new file mode 100644
index 000000000000..65b86ac99567
--- /dev/null
+++ b/include/oox/drawingml/shapegroupcontext.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 OOX_DRAWINGML_SHAPEGROUPCONTEXT_HXX
+#define OOX_DRAWINGML_SHAPEGROUPCONTEXT_HXX
+
+#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/shapecontext.hxx"
+#include "oox/dllapi.h"
+
+namespace oox { namespace drawingml {
+
+class OOX_DLLPUBLIC ShapeGroupContext : public ::oox::core::ContextHandler
+{
+public:
+ ShapeGroupContext( ::oox::core::ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pGroupShapePtr );
+ virtual ~ShapeGroupContext();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+
+ ShapePtr mpGroupShapePtr;
+ ShapePtr mpMasterShapePtr;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_SHAPEGROUPCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/shapepropertiescontext.hxx b/include/oox/drawingml/shapepropertiescontext.hxx
new file mode 100644
index 000000000000..31da8a9c0f23
--- /dev/null
+++ b/include/oox/drawingml/shapepropertiescontext.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 OOX_DRAWINGML_SHAPEPROPERTIESCONTEXT_HXX
+#define OOX_DRAWINGML_SHAPEPROPERTIESCONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+#include "oox/drawingml/shape.hxx"
+
+namespace oox { namespace drawingml {
+
+class ShapePropertiesContext : public ::oox::core::ContextHandler
+{
+public:
+ ShapePropertiesContext( ::oox::core::ContextHandler& rParent, Shape& rShape );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ Shape& mrShape;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_SHAPEPROPERTIESCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/shapepropertymap.hxx b/include/oox/drawingml/shapepropertymap.hxx
new file mode 100644
index 000000000000..a5cc12f5484c
--- /dev/null
+++ b/include/oox/drawingml/shapepropertymap.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 OOX_DRAWINGML_SHAPEPROPERTYMAP_HXX
+#define OOX_DRAWINGML_SHAPEPROPERTYMAP_HXX
+
+#include "oox/helper/propertymap.hxx"
+#include "oox/dllapi.h"
+
+namespace oox { class ModelObjectHelper; }
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+/** Enumeration for various properties related to drawing shape formatting.
+
+ This is an abstraction for shape formatting properties that have different
+ names in various implementations, e.g. drawing shapes vs. chart objects.
+ */
+enum ShapePropertyId
+{
+ SHAPEPROP_LineStyle,
+ SHAPEPROP_LineWidth,
+ SHAPEPROP_LineColor,
+ SHAPEPROP_LineTransparency,
+ SHAPEPROP_LineDash, /// Explicit line dash or name of a line dash stored in a global container.
+ SHAPEPROP_LineJoint,
+ SHAPEPROP_LineStart, /// Explicit line start marker or name of a line marker stored in a global container.
+ SHAPEPROP_LineStartWidth,
+ SHAPEPROP_LineStartCenter,
+ SHAPEPROP_LineEnd, /// Explicit line end marker or name of a line marker stored in a global container.
+ SHAPEPROP_LineEndWidth,
+ SHAPEPROP_LineEndCenter,
+ SHAPEPROP_FillStyle,
+ SHAPEPROP_FillColor,
+ SHAPEPROP_FillTransparency,
+ SHAPEPROP_GradientTransparency,
+ SHAPEPROP_FillGradient, /// Explicit fill gradient or name of a fill gradient stored in a global container.
+ SHAPEPROP_FillBitmapUrl, /// Explicit fill bitmap URL or name of a fill bitmap URL stored in a global container.
+ SHAPEPROP_FillBitmapMode,
+ SHAPEPROP_FillBitmapSizeX,
+ SHAPEPROP_FillBitmapSizeY,
+ SHAPEPROP_FillBitmapOffsetX,
+ SHAPEPROP_FillBitmapOffsetY,
+ SHAPEPROP_FillBitmapRectanglePoint,
+ SHAPEPROP_ShadowXDistance,
+ SHAPEPROP_END
+};
+
+// ============================================================================
+
+struct OOX_DLLPUBLIC ShapePropertyInfo
+{
+ const sal_Int32* mpnPropertyIds; /// Pointer to array of property identifiers for all SHAPEPROP properties.
+ bool mbNamedLineMarker; /// True = use named line marker instead of explicit line marker.
+ bool mbNamedLineDash; /// True = use named line dash instead of explicit line dash.
+ bool mbNamedFillGradient; /// True = use named fill gradient instead of explicit fill gradient.
+ bool mbNamedFillBitmapUrl; /// True = use named fill bitmap URL instead of explicit fill bitmap URL.
+
+ static ShapePropertyInfo DEFAULT; /// Default property info (used as default parameter of other methods).
+
+ explicit ShapePropertyInfo(
+ const sal_Int32* pnPropertyIds,
+ bool bNamedLineMarker,
+ bool bNamedLineDash,
+ bool bNamedFillGradient,
+ bool bNamedFillBitmapUrl );
+
+ inline bool has( ShapePropertyId ePropId ) const { return mpnPropertyIds[ ePropId ] >= 0; }
+ inline sal_Int32 operator[]( ShapePropertyId ePropId ) const { return mpnPropertyIds[ ePropId ]; }
+};
+
+// ============================================================================
+
+class OOX_DLLPUBLIC ShapePropertyMap : public PropertyMap
+{
+public:
+ explicit ShapePropertyMap(
+ ModelObjectHelper& rModelObjHelper,
+ const ShapePropertyInfo& rShapePropInfo = ShapePropertyInfo::DEFAULT );
+
+ /** Returns true, if the specified property is supported. */
+ bool supportsProperty( ShapePropertyId ePropId ) const;
+
+ /** Returns true, if named line markers are supported, and the specified
+ line marker has already been inserted into the marker table. */
+ bool hasNamedLineMarkerInTable( const OUString& rMarkerName ) const;
+
+ /** Sets the specified shape property to the passed value. */
+ bool setAnyProperty( ShapePropertyId ePropId, const ::com::sun::star::uno::Any& rValue );
+
+ /** Sets the specified shape property to the passed value. */
+ template< typename Type >
+ inline bool setProperty( ShapePropertyId ePropId, const Type& rValue )
+ { return setAnyProperty( ePropId, ::com::sun::star::uno::Any( rValue ) ); }
+
+ using PropertyMap::setAnyProperty;
+ using PropertyMap::setProperty;
+ using PropertyMap::operator[];
+
+private:
+ /** Sets an explicit line marker, or creates a named line marker. */
+ bool setLineMarker( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+ /** Sets an explicit line dash, or creates a named line dash. */
+ bool setLineDash( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+ /** Sets an explicit fill gradient, or creates a named fill gradient. */
+ bool setFillGradient( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+ /** Creates a named transparency gradient. */
+ bool setGradientTrans( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+ /** Sets an explicit fill bitmap URL, or creates a named fill bitmap URL. */
+ bool setFillBitmapUrl( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+
+ // not implemented, to prevent implicit conversion from enum to int
+ ::com::sun::star::uno::Any& operator[]( ShapePropertyId ePropId );
+ const ::com::sun::star::uno::Any& operator[]( ShapePropertyId ePropId ) const;
+
+private:
+ ModelObjectHelper& mrModelObjHelper;
+ ShapePropertyInfo maShapePropInfo;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/shapestylecontext.hxx b/include/oox/drawingml/shapestylecontext.hxx
new file mode 100644
index 000000000000..88338a16b59a
--- /dev/null
+++ b/include/oox/drawingml/shapestylecontext.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 OOX_DRAWINGML_SHAPESTYLECONTEXT_HXX
+#define OOX_DRAWINGML_SHAPESTYLECONTEXT_HXX
+
+#include "oox/drawingml/shape.hxx"
+#include "oox/core/contexthandler.hxx"
+
+namespace oox { namespace drawingml {
+
+class ShapeStyleContext : public ::oox::core::ContextHandler
+{
+public:
+ ShapeStyleContext( ::oox::core::ContextHandler& rParent, Shape& rShape );
+ ~ShapeStyleContext();
+
+ virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ Shape& mrShape;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_SHAPESTYLECONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/spdefcontext.hxx b/include/oox/drawingml/spdefcontext.hxx
new file mode 100644
index 000000000000..1fa773fb57dc
--- /dev/null
+++ b/include/oox/drawingml/spdefcontext.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 OOX_DRAWINGML_SPDEFCONTEXT_HXX
+#define OOX_DRAWINGML_SPDEFCONTEXT_HXX
+
+#include "oox/drawingml/shape.hxx"
+#include "oox/core/contexthandler.hxx"
+
+namespace oox { namespace drawingml {
+
+class spDefContext : public oox::core::ContextHandler
+{
+public:
+ spDefContext( ::oox::core::ContextHandler& rParent, Shape& rDefaultObject );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ Shape& mrDefaultObject;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_SPDEFCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablebackgroundstylecontext.hxx b/include/oox/drawingml/table/tablebackgroundstylecontext.hxx
new file mode 100644
index 000000000000..185987df8ad7
--- /dev/null
+++ b/include/oox/drawingml/table/tablebackgroundstylecontext.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 OOX_DRAWINGML_TABLEBACKGROUNDSTYLECONTEXT
+#define OOX_DRAWINGML_TABLEBACKGROUNDSTYLECONTEXT
+
+#include "oox/core/contexthandler.hxx"
+#include "oox/drawingml/table/tablestyle.hxx"
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableBackgroundStyleContext : public ::oox::core::ContextHandler
+{
+public:
+ TableBackgroundStyleContext( ::oox::core::ContextHandler& rParent, TableStyle& rTableStyle );
+ ~TableBackgroundStyleContext();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+
+ TableStyle& mrTableStyle;
+};
+
+} } }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablecell.hxx b/include/oox/drawingml/table/tablecell.hxx
new file mode 100644
index 000000000000..9bb721f8599a
--- /dev/null
+++ b/include/oox/drawingml/table/tablecell.hxx
@@ -0,0 +1,115 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_TABLECELL_HXX
+#define OOX_DRAWINGML_TABLECELL_HXX
+
+#include "oox/helper/propertymap.hxx"
+#include "oox/drawingml/color.hxx"
+#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/drawingml/lineproperties.hxx"
+#include "oox/drawingml/fillproperties.hxx"
+#include "oox/drawingml/textliststyle.hxx"
+#include <com/sun/star/table/XCell.hpp>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include <vector>
+#include <map>
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableCellContext;
+class TableProperties;
+class TableStyle;
+
+class TableCell
+{
+ friend class TableCellContext;
+
+public:
+
+ TableCell();
+ ~TableCell();
+
+ sal_Int32 getRowSpan() const { return mnRowSpan; };
+ void setRowSpan( sal_Int32 nRowSpan ){ mnRowSpan = nRowSpan; };
+ sal_Int32 getGridSpan() const { return mnGridSpan; };
+ void setGridSpan( sal_Int32 nGridSpan ){ mnGridSpan = nGridSpan; };
+ sal_Bool gethMerge() const { return mbhMerge; };
+ void sethMerge( sal_Bool bhMerge ){ mbhMerge = bhMerge; };
+ sal_Bool getvMerge() const { return mbvMerge; };
+ void setvMerge( sal_Bool bvMerge ){ mbvMerge = bvMerge; };
+ sal_Int32 getLeftMargin() const { return mnMarL; };
+ void setLeftMargin( sal_Int32 nMargin ){ mnMarL = nMargin; };
+ sal_Int32 getRightMargin() const { return mnMarR; };
+ void setRightMargin( sal_Int32 nMargin ){ mnMarR = nMargin; };
+ sal_Int32 getTopMargin() const { return mnMarT; };
+ void setTopMargin( sal_Int32 nMargin ){ mnMarT = nMargin; };
+ sal_Int32 getBottomMargin() const { return mnMarB; };
+ void setBottomMargin( sal_Int32 nMargin ){ mnMarB = nMargin; };
+ sal_Int32 getVertToken() const { return mnVertToken; };
+ void setVertToken( sal_Int32 nToken ){ mnVertToken = nToken; };
+ sal_Int32 getAnchorToken() const { return mnAnchorToken; };
+ void setAnchorToken( sal_Int32 nToken ){ mnAnchorToken = nToken; };
+ sal_Bool getAnchorCtr() const { return mbAnchorCtr; };
+ void setAnchorCtr( sal_Bool bAnchorCtr ){ mbAnchorCtr = bAnchorCtr; };
+ sal_Int32 getHorzOverflowToken() const { return mnHorzOverflowToken; };
+ void setHorzOverflowToken( sal_Int32 nToken ){ mnHorzOverflowToken = nToken; };
+
+ void setTextBody( const oox::drawingml::TextBodyPtr& pTextBody ){ mpTextBody = pTextBody; };
+ oox::drawingml::TextBodyPtr getTextBody(){ return mpTextBody; };
+
+ void pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oox::drawingml::TextListStylePtr pMasterTextListStyle,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::table::XCell >& rxCell, const TableProperties& rTableProperties,
+ const TableStyle& rTable, sal_Int32 nColumn, sal_Int32 nMaxColumn, sal_Int32 nRow, sal_Int32 nMaxRow );
+
+private:
+
+ oox::drawingml::TextBodyPtr mpTextBody;
+
+ oox::drawingml::LineProperties maLinePropertiesLeft;
+ oox::drawingml::LineProperties maLinePropertiesRight;
+ oox::drawingml::LineProperties maLinePropertiesTop;
+ oox::drawingml::LineProperties maLinePropertiesBottom;
+ oox::drawingml::LineProperties maLinePropertiesTopLeftToBottomRight;
+ oox::drawingml::LineProperties maLinePropertiesBottomLeftToTopRight;
+
+ oox::drawingml::FillProperties maFillProperties;
+
+ sal_Int32 mnRowSpan;
+ sal_Int32 mnGridSpan;
+ sal_Bool mbhMerge;
+ sal_Bool mbvMerge;
+
+ sal_Int32 mnMarL;
+ sal_Int32 mnMarR;
+ sal_Int32 mnMarT;
+ sal_Int32 mnMarB;
+ sal_Int32 mnVertToken;
+ sal_Int32 mnAnchorToken;
+ sal_Bool mbAnchorCtr;
+ sal_Int32 mnHorzOverflowToken;
+};
+
+} } }
+
+#endif // OOX_DRAWINGML_TABLECELL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablecellcontext.hxx b/include/oox/drawingml/table/tablecellcontext.hxx
new file mode 100644
index 000000000000..a2c04bbff9a7
--- /dev/null
+++ b/include/oox/drawingml/table/tablecellcontext.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 OOX_DRAWINGML_TABLECELLCONTEXT
+#define OOX_DRAWINGML_TABLECELLCONTEXT
+
+#include "oox/drawingml/shapecontext.hxx"
+#include "oox/drawingml/table/tablecell.hxx"
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableCellContext : public ::oox::core::ContextHandler
+{
+public:
+ TableCellContext( ::oox::core::ContextHandler& rParent,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >& xAttribs, TableCell& rTableCell );
+ ~TableCellContext();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+
+ TableCell& mrTableCell;
+};
+
+} } }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablecontext.hxx b/include/oox/drawingml/table/tablecontext.hxx
new file mode 100644
index 000000000000..175f7f84cb43
--- /dev/null
+++ b/include/oox/drawingml/table/tablecontext.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 OOX_DRAWINGML_TABLECONTEXT
+#define OOX_DRAWINGML_TABLECONTEXT
+
+#include "oox/drawingml/shapecontext.hxx"
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableProperties;
+
+class TableContext : public ShapeContext
+{
+public:
+ TableContext( ::oox::core::ContextHandler& rParent, ShapePtr pShapePtr );
+ ~TableContext();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+
+ TableProperties& mrTableProperties;
+};
+
+} } }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablepartstylecontext.hxx b/include/oox/drawingml/table/tablepartstylecontext.hxx
new file mode 100644
index 000000000000..14b38547d9f4
--- /dev/null
+++ b/include/oox/drawingml/table/tablepartstylecontext.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 OOX_DRAWINGML_TABLEPARTSTYLECONTEXT
+#define OOX_DRAWINGML_TABLEPARTSTYLECONTEXT
+
+#include "oox/core/contexthandler.hxx"
+#include "oox/drawingml/table/tablestylepart.hxx"
+
+namespace oox { namespace drawingml { namespace table {
+
+class TablePartStyleContext : public ::oox::core::ContextHandler
+{
+public:
+ TablePartStyleContext( ::oox::core::ContextHandler& rParent, TableStylePart& rTableStylePart );
+ ~TablePartStyleContext();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+
+ TableStylePart& mrTableStylePart;
+};
+
+} } }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tableproperties.hxx b/include/oox/drawingml/table/tableproperties.hxx
new file mode 100644
index 000000000000..8c584b1f8959
--- /dev/null
+++ b/include/oox/drawingml/table/tableproperties.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 OOX_DRAWINGML_TABLEPROPERTIES_HXX
+#define OOX_DRAWINGML_TABLEPROPERTIES_HXX
+
+#include "oox/drawingml/table/tablerow.hxx"
+#include "oox/drawingml/table/tablestyle.hxx"
+#include "oox/helper/propertymap.hxx"
+#include "oox/drawingml/color.hxx"
+
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include <vector>
+#include <map>
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableProperties
+{
+public:
+
+ TableProperties();
+ ~TableProperties();
+
+ std::vector< sal_Int32 >& getTableGrid() { return mvTableGrid; };
+ std::vector< TableRow >& getTableRows() { return mvTableRows; };
+
+ OUString& getStyleId(){ return maStyleId; };
+ boost::shared_ptr< TableStyle >& getTableStyle(){ return mpTableStyle; };
+ sal_Bool& isRtl(){ return mbRtl; };
+ sal_Bool& isFirstRow(){ return mbFirstRow; };
+ sal_Bool& isFirstCol(){ return mbFirstCol; };
+ sal_Bool& isLastRow(){ return mbLastRow; };
+ sal_Bool& isLastCol(){ return mbLastCol; };
+ sal_Bool& isBandRow(){ return mbBandRow; };
+ sal_Bool& isBandCol(){ return mbBandCol; };
+
+ void pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBase,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & xPropSet, ::oox::drawingml::TextListStylePtr pMasterTextListStyle );
+
+private:
+
+ const TableStyle& getUsedTableStyle( const ::oox::core::XmlFilterBase& rFilterBase );
+
+ OUString maStyleId; // either StyleId is available
+ boost::shared_ptr< TableStyle > mpTableStyle; // or the complete TableStyle
+ std::vector< sal_Int32 > mvTableGrid;
+ std::vector< TableRow > mvTableRows;
+
+ sal_Bool mbRtl;
+ sal_Bool mbFirstRow;
+ sal_Bool mbFirstCol;
+ sal_Bool mbLastRow;
+ sal_Bool mbLastCol;
+ sal_Bool mbBandRow;
+ sal_Bool mbBandCol;
+};
+
+} } }
+
+#endif // OOX_DRAWINGML_TABLEPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablerow.hxx b/include/oox/drawingml/table/tablerow.hxx
new file mode 100644
index 000000000000..299ffabfd8b1
--- /dev/null
+++ b/include/oox/drawingml/table/tablerow.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 OOX_DRAWINGML_TABLEROW_HXX
+#define OOX_DRAWINGML_TABLEROW_HXX
+
+#include "oox/drawingml/table/tablecell.hxx"
+#include <vector>
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableRow
+{
+public:
+
+ TableRow();
+ ~TableRow();
+
+ void setHeight( sal_Int32 nHeight ){ mnHeight = nHeight; };
+ sal_Int32 getHeight() const { return mnHeight; };
+ std::vector< TableCell >& getTableCells() { return mvTableCells; };
+
+private:
+
+ sal_Int32 mnHeight;
+ std::vector< TableCell > mvTableCells;
+};
+
+} } }
+
+#endif // OOX_DRAWINGML_TABLEROW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablerowcontext.hxx b/include/oox/drawingml/table/tablerowcontext.hxx
new file mode 100644
index 000000000000..58ab0da0cd3a
--- /dev/null
+++ b/include/oox/drawingml/table/tablerowcontext.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 OOX_DRAWINGML_TABLEROWCONTEXT
+#define OOX_DRAWINGML_TABLEROWCONTEXT
+
+#include "oox/core/contexthandler.hxx"
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableRow;
+
+class TableRowContext : public ::oox::core::ContextHandler
+{
+public:
+ TableRowContext( ::oox::core::ContextHandler& rParent,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >& xAttribs, TableRow& rTableRow );
+ ~TableRowContext();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+
+ TableRow& mrTableRow;
+};
+
+} } }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablestyle.hxx b/include/oox/drawingml/table/tablestyle.hxx
new file mode 100644
index 000000000000..b31b5891a32b
--- /dev/null
+++ b/include/oox/drawingml/table/tablestyle.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 OOX_DRAWINGML_TABLESTYLE_HXX
+#define OOX_DRAWINGML_TABLESTYLE_HXX
+
+#include "oox/drawingml/table/tablestylepart.hxx"
+#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/drawingml/shape.hxx"
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableStyle
+{
+public:
+
+ TableStyle();
+ ~TableStyle();
+
+ OUString& getStyleId(){ return maStyleId; }
+ OUString& getStyleName() { return maStyleName; }
+
+ ::oox::drawingml::ShapeStyleRef& getBackgroundFillStyleRef(){ return maFillStyleRef; }
+
+ ::oox::drawingml::FillPropertiesPtr& getBackgroundFillProperties(){ return mpFillProperties; }
+
+ TableStylePart& getWholeTbl() { return maWholeTbl; }
+ TableStylePart& getBand1H() { return maBand1H; }
+ TableStylePart& getBand2H() { return maBand2H; }
+ TableStylePart& getBand1V() { return maBand1V; }
+ TableStylePart& getBand2V() { return maBand2V; }
+ TableStylePart& getLastCol() { return maLastCol; }
+ TableStylePart& getFirstCol() { return maFirstCol; }
+ TableStylePart& getLastRow() { return maLastRow; }
+ TableStylePart& getSeCell() { return maSeCell; }
+ TableStylePart& getSwCell() { return maSwCell; }
+ TableStylePart& getFirstRow() { return maFirstRow; }
+ TableStylePart& getNeCell() { return maNeCell; }
+ TableStylePart& getNwCell() { return maNwCell; }
+
+private:
+
+ OUString maStyleId;
+ OUString maStyleName;
+
+ ::oox::drawingml::ShapeStyleRef maFillStyleRef;
+
+ ::oox::drawingml::FillPropertiesPtr mpFillProperties;
+
+ TableStylePart maWholeTbl;
+ TableStylePart maBand1H;
+ TableStylePart maBand2H;
+ TableStylePart maBand1V;
+ TableStylePart maBand2V;
+ TableStylePart maLastCol;
+ TableStylePart maFirstCol;
+ TableStylePart maLastRow;
+ TableStylePart maSeCell;
+ TableStylePart maSwCell;
+ TableStylePart maFirstRow;
+ TableStylePart maNeCell;
+ TableStylePart maNwCell;
+};
+
+} } }
+
+#endif // OOX_DRAWINGML_TABLESTYLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablestylecellstylecontext.hxx b/include/oox/drawingml/table/tablestylecellstylecontext.hxx
new file mode 100644
index 000000000000..ae0997ab6d88
--- /dev/null
+++ b/include/oox/drawingml/table/tablestylecellstylecontext.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 OOX_DRAWINGML_TABLESTYLECELLSTYLECONTEXT
+#define OOX_DRAWINGML_TABLESTYLECELLSTYLECONTEXT
+
+#include "oox/core/contexthandler.hxx"
+#include "oox/drawingml/table/tablestylepart.hxx"
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableStyleCellStyleContext : public ::oox::core::ContextHandler
+{
+public:
+ TableStyleCellStyleContext( ::oox::core::ContextHandler& rParent, TableStylePart& rTableStylePart );
+ ~TableStyleCellStyleContext();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+
+ TableStylePart& mrTableStylePart;
+ sal_Int32 mnLineType;
+};
+
+} } }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablestylecontext.hxx b/include/oox/drawingml/table/tablestylecontext.hxx
new file mode 100644
index 000000000000..f9600d38365c
--- /dev/null
+++ b/include/oox/drawingml/table/tablestylecontext.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 OOX_DRAWINGML_TABLESTYLECONTEXT
+#define OOX_DRAWINGML_TABLESTYLECONTEXT
+
+#include "oox/core/contexthandler.hxx"
+#include "oox/drawingml/table/tablestyle.hxx"
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableStyleContext : public ::oox::core::ContextHandler
+{
+public:
+ TableStyleContext( ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs,
+ TableStyle& rTableStyle );
+ ~TableStyleContext();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+
+ TableStyle& mrTableStyle;
+};
+
+} } }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablestylelist.hxx b/include/oox/drawingml/table/tablestylelist.hxx
new file mode 100644
index 000000000000..320609d064d9
--- /dev/null
+++ b/include/oox/drawingml/table/tablestylelist.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 OOX_DRAWINGML_TABLESTYLELIST_HXX
+#define OOX_DRAWINGML_TABLESTYLELIST_HXX
+
+#include <rtl/ustring.hxx>
+#include <boost/shared_ptr.hpp>
+#include <vector>
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableStyle;
+
+class TableStyleList
+{
+public:
+
+ TableStyleList();
+ ~TableStyleList();
+
+ OUString& getDefaultStyleId() { return maDefaultStyleId; };
+ std::vector< TableStyle >& getTableStyles(){ return maTableStyles; };
+
+private:
+
+ OUString maDefaultStyleId;
+ std::vector< TableStyle > maTableStyles;
+
+};
+
+typedef boost::shared_ptr< TableStyleList > TableStyleListPtr;
+
+} } }
+
+#endif // OOX_DRAWINGML_TABLESTYLELIST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablestylelistfragmenthandler.hxx b/include/oox/drawingml/table/tablestylelistfragmenthandler.hxx
new file mode 100644
index 000000000000..d6ef77f8614c
--- /dev/null
+++ b/include/oox/drawingml/table/tablestylelistfragmenthandler.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 OOX_DRAWINGML_TABLESTYLELISTFRAGMENTHANDLER_HXX
+#define OOX_DRAWINGML_TABLESTYLELISTFRAGMENTHANDLER_HXX
+
+#include "oox/drawingml/table/tablestylelist.hxx"
+#include "oox/core/fragmenthandler2.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace table {
+
+// ============================================================================
+
+class TableStyleListFragmentHandler : public ::oox::core::FragmentHandler2
+{
+public:
+ explicit TableStyleListFragmentHandler(
+ ::oox::core::XmlFilterBase& rFilter,
+ const OUString& rFragmentPath,
+ TableStyleList& rTableStyleList );
+ virtual ~TableStyleListFragmentHandler();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+
+ TableStyleList& mrTableStyleList;
+};
+
+// ============================================================================
+
+} // namespace table
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablestylepart.hxx b/include/oox/drawingml/table/tablestylepart.hxx
new file mode 100644
index 000000000000..abfb21c890d9
--- /dev/null
+++ b/include/oox/drawingml/table/tablestylepart.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 OOX_DRAWINGML_TABLESTYLEPART_HXX
+#define OOX_DRAWINGML_TABLESTYLEPART_HXX
+
+#include <rtl/ustring.hxx>
+#include <boost/optional.hpp>
+#include "oox/drawingml/color.hxx"
+#include "oox/drawingml/textfont.hxx"
+#include "oox/drawingml/fillproperties.hxx"
+#include "oox/drawingml/lineproperties.hxx"
+#include "oox/drawingml/shape.hxx"
+#include <map>
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableStylePart
+{
+public:
+
+ TableStylePart();
+ ~TableStylePart();
+
+ ::oox::drawingml::Color& getTextColor(){ return maTextColor; }
+ ::boost::optional< sal_Bool >& getTextBoldStyle(){ return maTextBoldStyle; }
+ ::boost::optional< sal_Bool >& getTextItalicStyle(){ return maTextItalicStyle; }
+ ::oox::drawingml::TextFont& getAsianFont(){ return maAsianFont; }
+ ::oox::drawingml::TextFont& getComplexFont(){ return maComplexFont; }
+ ::oox::drawingml::TextFont& getSymbolFont(){ return maSymbolFont; }
+ ::oox::drawingml::TextFont& getLatinFont(){ return maLatinFont; }
+
+ ::oox::drawingml::FillPropertiesPtr& getFillProperties(){ return mpFillProperties; }
+ std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >& getLineBorders(){ return maLineBorders; }
+
+ ::oox::drawingml::ShapeStyleRefMap& getStyleRefs(){ return maStyleRefs; }
+
+private:
+
+ ::oox::drawingml::Color maTextColor;
+ ::boost::optional< sal_Bool > maTextBoldStyle;
+ ::boost::optional< sal_Bool > maTextItalicStyle;
+ ::oox::drawingml::TextFont maAsianFont;
+ ::oox::drawingml::TextFont maComplexFont;
+ ::oox::drawingml::TextFont maSymbolFont;
+ ::oox::drawingml::TextFont maLatinFont;
+
+ ::oox::drawingml::FillPropertiesPtr mpFillProperties;
+ std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr > maLineBorders;
+ ::oox::drawingml::ShapeStyleRefMap maStyleRefs;
+};
+
+} } }
+
+#endif // OOX_DRAWINGML_TABLESTYLEPART_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/table/tablestyletextstylecontext.hxx b/include/oox/drawingml/table/tablestyletextstylecontext.hxx
new file mode 100644
index 000000000000..10714743ad58
--- /dev/null
+++ b/include/oox/drawingml/table/tablestyletextstylecontext.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 OOX_DRAWINGML_TABLESTYLETEXTSTYLECONTEXT
+#define OOX_DRAWINGML_TABLESTYLETEXTSTYLECONTEXT
+
+#include "oox/core/contexthandler.hxx"
+#include "oox/drawingml/table/tablestylepart.hxx"
+
+namespace oox { namespace drawingml { namespace table {
+
+class TableStyleTextStyleContext : public ::oox::core::ContextHandler
+{
+public:
+ TableStyleTextStyleContext( ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs,
+ TableStylePart& rTableStylePart );
+ ~TableStyleTextStyleContext();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+
+ TableStylePart& mrTableStylePart;
+};
+
+} } }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textbody.hxx b/include/oox/drawingml/textbody.hxx
new file mode 100644
index 000000000000..2d77cf277df6
--- /dev/null
+++ b/include/oox/drawingml/textbody.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 OOX_DRAWINGML_TEXTBODY_HXX
+#define OOX_DRAWINGML_TEXTBODY_HXX
+
+#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/drawingml/textbodyproperties.hxx"
+#include "oox/drawingml/textliststyle.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace text { class XText; }
+ namespace text { class XTextCursor; }
+} } }
+
+namespace oox { namespace core { class XmlFilterBase; } }
+
+namespace oox { namespace drawingml {
+
+class TextParagraph;
+typedef RefVector< TextParagraph > TextParagraphVector;
+
+class TextBody
+{
+public:
+ TextBody();
+ TextBody( TextBodyPtr pBody );
+ ~TextBody();
+
+ inline const TextParagraphVector& getParagraphs() const { return maParagraphs; }
+ TextParagraph& addParagraph();
+
+ inline const TextListStyle& getTextListStyle() const { return maTextListStyle; }
+ inline TextListStyle& getTextListStyle() { return maTextListStyle; }
+
+ inline const TextBodyProperties& getTextProperties() const { return maTextProperties; }
+ inline TextBodyProperties& getTextProperties() { return maTextProperties; }
+
+ /** insert the text body at the text cursor */
+ void insertAt(
+ const ::oox::core::XmlFilterBase& rFilterBase,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::text::XText > & xText,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::text::XTextCursor > & xAt,
+ const TextCharacterProperties& rTextStyleProperties,
+ const TextListStylePtr& pMasterTextListStyle ) const;
+ bool isEmpty();
+protected:
+ TextParagraphVector maParagraphs;
+ TextBodyProperties maTextProperties;
+ TextListStyle maTextListStyle;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_TEXTBODY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textbodycontext.hxx b/include/oox/drawingml/textbodycontext.hxx
new file mode 100644
index 000000000000..d46272e853a6
--- /dev/null
+++ b/include/oox/drawingml/textbodycontext.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 OOX_DRAWINGML_TEXTBODYCONTEXT_HXX
+#define OOX_DRAWINGML_TEXTBODYCONTEXT_HXX
+
+#include <com/sun/star/text/XText.hpp>
+
+#include "oox/drawingml/textbody.hxx"
+#include "oox/drawingml/textrun.hxx"
+#include "oox/core/contexthandler.hxx"
+
+namespace oox { namespace drawingml {
+
+class TextBodyContext : public ::oox::core::ContextHandler
+{
+public:
+ TextBodyContext( ::oox::core::ContextHandler& rParent, TextBody& rTextBody );
+
+ virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ TextBody& mrTextBody;
+ ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxText;
+};
+
+// CT_RegularTextRun
+class RegularTextRunContext : public ::oox::core::ContextHandler
+{
+public:
+ RegularTextRunContext( ::oox::core::ContextHandler& rParent, TextRunPtr pRunPtr );
+
+ virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL characters( const OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ TextRunPtr mpRunPtr;
+ bool mbIsInText;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_TEXTBODYCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textbodyproperties.hxx b/include/oox/drawingml/textbodyproperties.hxx
new file mode 100644
index 000000000000..f8800be29659
--- /dev/null
+++ b/include/oox/drawingml/textbodyproperties.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 OOX_DRAWINGML_TEXTBODYPROPERTIES_HXX
+#define OOX_DRAWINGML_TEXTBODYPROPERTIES_HXX
+
+#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
+#include "oox/helper/helper.hxx"
+#include "oox/helper/propertymap.hxx"
+#include <boost/optional.hpp>
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+struct TextBodyProperties
+{
+ PropertyMap maPropertyMap;
+ OptValue< sal_Int32 > moRotation;
+ OptValue< sal_Int32 > moVert;
+ boost::optional< sal_Int32 > moInsets[4];
+ boost::optional< sal_Int32 > moTextOffX;
+ boost::optional< sal_Int32 > moTextOffY;
+ ::com::sun::star::drawing::TextVerticalAdjust meVA;
+
+ explicit TextBodyProperties();
+
+ void pushRotationAdjustments( sal_Int32 nRotation );
+ void pushVertSimulation();
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textbodypropertiescontext.hxx b/include/oox/drawingml/textbodypropertiescontext.hxx
new file mode 100644
index 000000000000..e907a60b94d8
--- /dev/null
+++ b/include/oox/drawingml/textbodypropertiescontext.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 OOX_DRAWINGML_TEXTBODYPROPERTIESCONTEXT_HXX
+#define OOX_DRAWINGML_TEXTBODYPROPERTIESCONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+
+namespace oox { namespace drawingml {
+
+struct TextBodyProperties;
+
+class TextBodyPropertiesContext : public ::oox::core::ContextHandler
+{
+public:
+ TextBodyPropertiesContext( ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes,
+ TextBodyProperties& rTextBodyProp );
+
+ virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ TextBodyProperties& mrTextBodyProp;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_TEXTBODYPROPERTIESCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textcharacterproperties.hxx b/include/oox/drawingml/textcharacterproperties.hxx
new file mode 100644
index 000000000000..99792fe7725d
--- /dev/null
+++ b/include/oox/drawingml/textcharacterproperties.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 OOX_DRAWINGML_TEXTCHARACTERPROPERTIES_HXX
+#define OOX_DRAWINGML_TEXTCHARACTERPROPERTIES_HXX
+
+#include "oox/helper/helper.hxx"
+#include "oox/helper/propertymap.hxx"
+#include "oox/drawingml/color.hxx"
+#include "oox/drawingml/textfont.hxx"
+
+namespace oox { class PropertySet; }
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+struct TextCharacterProperties
+{
+ PropertyMap maHyperlinkPropertyMap;
+ TextFont maLatinFont;
+ TextFont maAsianFont;
+ TextFont maComplexFont;
+ TextFont maSymbolFont;
+ Color maCharColor;
+ Color maUnderlineColor;
+ Color maHighlightColor;
+ OptValue< OUString > moLang;
+ OptValue< sal_Int32 > moHeight;
+ OptValue< sal_Int32 > moSpacing;
+ OptValue< sal_Int32 > moUnderline;
+ OptValue< sal_Int32 > moStrikeout;
+ OptValue< sal_Int32 > moCaseMap;
+ OptValue< bool > moBold;
+ OptValue< bool > moItalic;
+ OptValue< bool > moUnderlineLineFollowText;
+ OptValue< bool > moUnderlineFillFollowText;
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const TextCharacterProperties& rSourceProps );
+
+ /** Returns the current character size. If possible the masterstyle should
+ have been applied before, otherwise the character size can be zero and
+ the default value is returned. */
+ float getCharHeightPoints( float fDefault ) const;
+
+ /** Writes the properties to the passed property map. */
+ void pushToPropMap(
+ PropertyMap& rPropMap,
+ const ::oox::core::XmlFilterBase& rFilter,
+ bool bUseOptional = false ) const;
+
+ /** Writes the properties to the passed property set. */
+ void pushToPropSet(
+ PropertySet& rPropSet,
+ const ::oox::core::XmlFilterBase& rFilter,
+ bool bUseOptional = false ) const;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textcharacterpropertiescontext.hxx b/include/oox/drawingml/textcharacterpropertiescontext.hxx
new file mode 100644
index 000000000000..f31e86b27ca4
--- /dev/null
+++ b/include/oox/drawingml/textcharacterpropertiescontext.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 OOX_DRAWINGML_TEXTCHARACTERPROPERTIESCONTEXT_HXX
+#define OOX_DRAWINGML_TEXTCHARACTERPROPERTIESCONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+
+namespace oox { namespace drawingml {
+
+struct TextCharacterProperties;
+
+class TextCharacterPropertiesContext : public ::oox::core::ContextHandler
+{
+public:
+ TextCharacterPropertiesContext( ::oox::core::ContextHandler& rParent,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >& rXAttributes,
+ TextCharacterProperties& rTextCharacterProperties );
+ virtual ~TextCharacterPropertiesContext();
+
+ virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ TextCharacterProperties& mrTextCharacterProperties;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_TEXTCHARACTERPROPERTIESCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textfield.hxx b/include/oox/drawingml/textfield.hxx
new file mode 100644
index 000000000000..df98b0302560
--- /dev/null
+++ b/include/oox/drawingml/textfield.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 OOX_DRAWINGML_TEXTFIELD_HXX
+#define OOX_DRAWINGML_TEXTFIELD_HXX
+
+#include <boost/shared_ptr.hpp>
+
+#include "oox/drawingml/textrun.hxx"
+#include "oox/drawingml/textparagraphproperties.hxx"
+
+namespace oox { namespace drawingml {
+
+struct TextCharacterProperties;
+
+class TextField
+ : public TextRun
+{
+public:
+ TextField();
+
+ inline TextParagraphProperties& getTextParagraphProperties() { return maTextParagraphProperties; }
+ inline const TextParagraphProperties& getTextParagraphProperties() const { return maTextParagraphProperties; }
+
+ inline void setType( const OUString& sType ) { msType = sType; }
+ inline void setUuid( const OUString & sUuid ) { msUuid = sUuid; }
+
+ virtual sal_Int32 insertAt(
+ const ::oox::core::XmlFilterBase& rFilterBase,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::text::XText > & xText,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::text::XTextCursor > &xAt,
+ const TextCharacterProperties& rTextCharacterStyle ) const;
+
+private:
+ TextParagraphProperties maTextParagraphProperties;
+ OUString msType;
+ OUString msUuid;
+};
+
+typedef boost::shared_ptr< TextField > TextFieldPtr;
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textfieldcontext.hxx b/include/oox/drawingml/textfieldcontext.hxx
new file mode 100644
index 000000000000..3a50ea93620f
--- /dev/null
+++ b/include/oox/drawingml/textfieldcontext.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 OOX_DRAWINGML_TEXTFIELDCONTEXT_HXX
+#define OOX_DRAWINGML_TEXTFIELDCONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+
+namespace oox { namespace drawingml {
+
+class TextField;
+
+class TextFieldContext
+ : public ::oox::core::ContextHandler
+{
+public:
+ TextFieldContext( ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rXAttributes,
+ TextField& rTextField);
+ virtual void SAL_CALL endFastElement( sal_Int32 aElementToken ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL characters( const OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
+ sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rXAttributes )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ TextField& mrTextField;
+ bool mbIsInText;
+};
+
+} }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textfont.hxx b/include/oox/drawingml/textfont.hxx
new file mode 100644
index 000000000000..95a7a1716a0d
--- /dev/null
+++ b/include/oox/drawingml/textfont.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 OOX_DRAWINGNML_TEXTFONT_HXX
+#define OOX_DRAWINGNML_TEXTFONT_HXX
+
+#include <rtl/ustring.hxx>
+
+namespace oox { class AttributeList; }
+namespace oox { namespace core { class XmlFilterBase; } }
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+/** carries a CT_TextFont*/
+class TextFont
+{
+public:
+ explicit TextFont();
+
+ /** Sets attributes from the passed attribute list. */
+ void setAttributes( const AttributeList& rAttribs );
+
+ /** Overwrites this text font with the passed text font, if it is used. */
+ void assignIfUsed( const TextFont& rTextFont );
+
+ /** Returns the font name, pitch, and family; tries to resolve theme
+ placeholder names, e.g. '+mj-lt' for the major latin theme font. */
+ bool getFontData(
+ OUString& rFontName,
+ sal_Int16& rnFontPitch,
+ sal_Int16& rnFontFamily,
+ const ::oox::core::XmlFilterBase& rFilter ) const;
+
+private:
+ bool implGetFontData(
+ OUString& rFontName,
+ sal_Int16& rnFontPitch,
+ sal_Int16& rnFontFamily ) const;
+
+private:
+ OUString maTypeface;
+ OUString maPanose;
+ sal_Int32 mnPitch;
+ sal_Int32 mnCharset;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textliststyle.hxx b/include/oox/drawingml/textliststyle.hxx
new file mode 100644
index 000000000000..851c506af17e
--- /dev/null
+++ b/include/oox/drawingml/textliststyle.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 OOX_DRAWINGML_TEXTLISTSTYLE_HXX
+#define OOX_DRAWINGML_TEXTLISTSTYLE_HXX
+
+#include "oox/drawingml/textparagraphproperties.hxx"
+#include "oox/helper/refvector.hxx"
+
+namespace oox { namespace drawingml {
+
+typedef RefVector< TextParagraphProperties > TextParagraphPropertiesVector;
+
+class TextListStyle
+{
+public:
+
+ TextListStyle();
+ ~TextListStyle();
+
+ void apply( const TextListStyle& rTextListStyle );
+
+ inline const TextParagraphPropertiesVector& getListStyle() const { return maListStyle; };
+ inline TextParagraphPropertiesVector& getListStyle() { return maListStyle; };
+
+ inline const TextParagraphPropertiesVector& getAggregationListStyle() const { return maAggregationListStyle; };
+ inline TextParagraphPropertiesVector& getAggregationListStyle() { return maAggregationListStyle; };
+
+#if defined(DBG_UTIL) && OSL_DEBUG_LEVEL > 1
+ void dump() const;
+#endif
+
+protected:
+
+ TextParagraphPropertiesVector maListStyle;
+ TextParagraphPropertiesVector maAggregationListStyle;
+};
+
+typedef boost::shared_ptr< TextListStyle > TextListStylePtr;
+
+} }
+
+#endif // OOX_DRAWINGML_TEXTLISTSTYLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textliststylecontext.hxx b/include/oox/drawingml/textliststylecontext.hxx
new file mode 100644
index 000000000000..2d480c709be5
--- /dev/null
+++ b/include/oox/drawingml/textliststylecontext.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 OOX_DRAWINGML_TEXTLISTSTYLECONTEXT_HXX
+#define OOX_DRAWINGML_TEXTLISTSTYLECONTEXT_HXX
+
+#include "oox/drawingml/textliststyle.hxx"
+#include "oox/core/contexthandler.hxx"
+
+namespace oox { namespace drawingml {
+
+class TextListStyleContext : public ::oox::core::ContextHandler
+{
+public:
+ TextListStyleContext( ::oox::core::ContextHandler& rParent, TextListStyle& rTextListStyle );
+ ~TextListStyleContext();
+
+ virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ TextListStyle& mrTextListStyle;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_TEXTLISTSTYLECONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textparagraph.hxx b/include/oox/drawingml/textparagraph.hxx
new file mode 100644
index 000000000000..37c53268b001
--- /dev/null
+++ b/include/oox/drawingml/textparagraph.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 OOX_DRAWINGML_TEXTPARAGRAPH_HXX
+#define OOX_DRAWINGML_TEXTPARAGRAPH_HXX
+
+#include <com/sun/star/text/XTextCursor.hpp>
+#include <com/sun/star/text/XText.hpp>
+
+#include "oox/core/xmlfilterbase.hxx"
+#include "oox/drawingml/textrun.hxx"
+#include "oox/drawingml/textliststyle.hxx"
+#include "oox/drawingml/textparagraphproperties.hxx"
+
+namespace oox { namespace drawingml {
+
+typedef RefVector< TextRun > TextRunVector;
+
+class TextParagraph
+{
+public:
+ TextParagraph();
+ ~TextParagraph();
+
+ inline TextRunVector& getRuns() { return maRuns; }
+ inline const TextRunVector& getRuns() const { return maRuns; }
+ inline void addRun( const TextRunPtr & pRun ) { maRuns.push_back( pRun ); }
+
+ inline TextParagraphProperties& getProperties() { return maProperties; }
+ inline const TextParagraphProperties& getProperties() const { return maProperties; }
+
+ inline TextCharacterProperties& getEndProperties() { return maEndProperties; }
+ inline const TextCharacterProperties& getEndProperties() const { return maEndProperties; }
+
+ //inline void setProperties( TextParagraphPropertiesPtr pProps ) { mpProperties = pProps; }
+
+ void insertAt(
+ const ::oox::core::XmlFilterBase& rFilterBase,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::text::XText > & xText,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::text::XTextCursor > &xAt,
+ const TextCharacterProperties& rTextStyleProperties,
+ const TextListStyle& rTextListStyle,
+ bool bFirst = false ) const;
+
+private:
+ TextParagraphProperties maProperties;
+ TextCharacterProperties maEndProperties;
+ TextRunVector maRuns;
+};
+
+typedef boost::shared_ptr< TextParagraph > TextParagraphPtr;
+
+} }
+
+#endif // OOX_DRAWINGML_TEXTPARAGRAPH_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textparagraphproperties.hxx b/include/oox/drawingml/textparagraphproperties.hxx
new file mode 100644
index 000000000000..1cb8215a3fc1
--- /dev/null
+++ b/include/oox/drawingml/textparagraphproperties.hxx
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
+#define OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
+#include "oox/drawingml/textcharacterproperties.hxx"
+#include <com/sun/star/style/NumberingType.hpp>
+#include "oox/drawingml/textfont.hxx"
+#include "textspacing.hxx"
+#include <boost/optional.hpp>
+
+namespace com { namespace sun { namespace star {
+ namespace graphic { class XGraphic; }
+} } }
+
+namespace oox { namespace drawingml {
+
+class TextParagraphProperties;
+
+typedef boost::shared_ptr< TextParagraphProperties > TextParagraphPropertiesPtr;
+
+class BulletList
+{
+public:
+ BulletList( );
+ bool is() const;
+ void apply( const BulletList& );
+ void pushToPropMap( const ::oox::core::XmlFilterBase* pFilterBase, PropertyMap& xPropMap ) const;
+ void setBulletChar( const OUString & sChar );
+ void setStartAt( sal_Int32 nStartAt ){ mnStartAt <<= static_cast< sal_Int16 >( nStartAt ); }
+ void setType( sal_Int32 nType );
+ void setNone( );
+ void setSuffixParenBoth();
+ void setSuffixParenRight();
+ void setSuffixPeriod();
+ void setSuffixNone();
+ void setSuffixMinusRight();
+ void setBulletSize(sal_Int16 nSize);
+ void setFontSize(sal_Int16 nSize);
+ void setStyleName( const OUString& rStyleName ) { maStyleName <<= rStyleName; }
+ void setGraphic( ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rXGraphic );
+
+ ::oox::drawingml::ColorPtr maBulletColorPtr;
+ ::com::sun::star::uno::Any mbBulletColorFollowText;
+ ::com::sun::star::uno::Any mbBulletFontFollowText;
+ ::oox::drawingml::TextFont maBulletFont;
+ ::com::sun::star::uno::Any msBulletChar;
+ ::com::sun::star::uno::Any mnStartAt;
+ ::com::sun::star::uno::Any mnNumberingType;
+ ::com::sun::star::uno::Any msNumberingPrefix;
+ ::com::sun::star::uno::Any msNumberingSuffix;
+ ::com::sun::star::uno::Any mnSize;
+ ::com::sun::star::uno::Any mnFontSize;
+ ::com::sun::star::uno::Any maStyleName;
+ ::com::sun::star::uno::Any maGraphic;
+ boost::optional< float > maFollowFontSize;
+};
+
+class TextParagraphProperties
+{
+public:
+
+ TextParagraphProperties();
+ ~TextParagraphProperties();
+
+ void setLevel( sal_Int16 nLevel ) { mnLevel = nLevel; }
+ sal_Int16 getLevel( ) const { return mnLevel; }
+ PropertyMap& getTextParagraphPropertyMap() { return maTextParagraphPropertyMap; }
+ BulletList& getBulletList() { return maBulletList; }
+ TextCharacterProperties& getTextCharacterProperties() { return maTextCharacterProperties; }
+ const TextCharacterProperties& getTextCharacterProperties() const { return maTextCharacterProperties; }
+
+ TextSpacing& getParaTopMargin() { return maParaTopMargin; }
+ TextSpacing& getParaBottomMargin() { return maParaBottomMargin; }
+ boost::optional< sal_Int32 >& getParaLeftMargin(){ return moParaLeftMargin; }
+ boost::optional< sal_Int32 >& getFirstLineIndentation(){ return moFirstLineIndentation; }
+
+ void apply( const TextParagraphProperties& rSourceProps );
+ void pushToPropSet( const ::oox::core::XmlFilterBase* pFilterBase,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & xPropSet,
+ PropertyMap& rioBulletList, const BulletList* pMasterBuList, sal_Bool bApplyBulletList, float fFontSize, bool bPushDefaultValues = false ) const;
+ void pushToPropSet( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & xPropSet) const;
+
+ /** Returns the largest character size of this paragraph. If possible the
+ masterstyle should have been applied before, otherwise the character
+ size can be zero and the default value is returned. */
+ float getCharHeightPoints( float fDefault ) const;
+
+#ifdef DBG_UTIL
+ void dump() const;
+#endif
+
+protected:
+
+ TextCharacterProperties maTextCharacterProperties;
+ PropertyMap maTextParagraphPropertyMap;
+ BulletList maBulletList;
+ TextSpacing maParaTopMargin;
+ TextSpacing maParaBottomMargin;
+ boost::optional< sal_Int32 > moParaLeftMargin;
+ boost::optional< sal_Int32 > moFirstLineIndentation;
+ sal_Int16 mnLevel;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textparagraphpropertiescontext.hxx b/include/oox/drawingml/textparagraphpropertiescontext.hxx
new file mode 100644
index 000000000000..db0f3426a680
--- /dev/null
+++ b/include/oox/drawingml/textparagraphpropertiescontext.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 OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIESCONTEXT_HXX
+#define OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIESCONTEXT_HXX
+
+#include <list>
+
+#include <com/sun/star/style/TabStop.hpp>
+#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/drawingml/textparagraphproperties.hxx"
+#include "oox/drawingml/textspacing.hxx"
+#include "oox/core/contexthandler.hxx"
+
+namespace oox { namespace drawingml {
+
+class TextParagraphPropertiesContext : public ::oox::core::ContextHandler
+{
+public:
+ TextParagraphPropertiesContext( ::oox::core::ContextHandler& rParent,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >& rXAttributes,
+ TextParagraphProperties& rTextParagraphProperties );
+ ~TextParagraphPropertiesContext();
+
+ virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ TextParagraphProperties& mrTextParagraphProperties;
+ TextSpacing maLineSpacing;
+ TextSpacing& mrSpaceBefore;
+ TextSpacing& mrSpaceAfter;
+ BulletList& mrBulletList;
+ ::std::list< ::com::sun::star::style::TabStop > maTabList;
+ ::boost::shared_ptr< BlipFillProperties > mxBlipProps;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIESCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textrun.hxx b/include/oox/drawingml/textrun.hxx
new file mode 100644
index 000000000000..0e215bf68973
--- /dev/null
+++ b/include/oox/drawingml/textrun.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 OOX_DRAWINGML_TEXTRUN_HXX
+#define OOX_DRAWINGML_TEXTRUN_HXX
+
+#include <com/sun/star/text/XTextCursor.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include "oox/drawingml/textcharacterproperties.hxx"
+
+namespace oox { namespace drawingml {
+
+class TextRun
+{
+public:
+ TextRun();
+ virtual ~TextRun();
+
+ inline OUString& getText() { return msText; }
+ inline const OUString& getText() const { return msText; }
+
+ inline TextCharacterProperties& getTextCharacterProperties() { return maTextCharacterProperties; }
+ inline const TextCharacterProperties& getTextCharacterProperties() const { return maTextCharacterProperties; }
+
+ inline void setLineBreak() { mbIsLineBreak = true; }
+
+ virtual sal_Int32 insertAt(
+ const ::oox::core::XmlFilterBase& rFilterBase,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::text::XText >& xText,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::text::XTextCursor >& xAt,
+ const TextCharacterProperties& rTextCharacterStyle ) const;
+
+private:
+ OUString msText;
+ TextCharacterProperties maTextCharacterProperties;
+ bool mbIsLineBreak;
+};
+
+typedef boost::shared_ptr< TextRun > TextRunPtr;
+
+} }
+
+#endif // OOX_DRAWINGML_TEXTRUN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/textspacing.hxx b/include/oox/drawingml/textspacing.hxx
new file mode 100644
index 000000000000..c85936283b4b
--- /dev/null
+++ b/include/oox/drawingml/textspacing.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 OOX_DRAWINGNML__TEXTSPACING_HXX
+#define OOX_DRAWINGNML__TEXTSPACING_HXX
+
+#include <rtl/ustring.hxx>
+
+#include <com/sun/star/style/LineSpacing.hpp>
+#include <com/sun/star/style/LineSpacingMode.hpp>
+
+namespace oox { namespace drawingml {
+
+
+ /** carries a CT_TextSpacing */
+ class TextSpacing
+ {
+ public:
+ enum {
+ POINTS = 0,
+ PERCENT
+ };
+ TextSpacing()
+ : nUnit( POINTS ), nValue( 0 ), bHasValue( false )
+ {
+ }
+ TextSpacing( sal_Int32 nPoints ) : nUnit( POINTS ), nValue( nPoints ), bHasValue( true ){};
+ ::com::sun::star::style::LineSpacing toLineSpacing() const
+ {
+ ::com::sun::star::style::LineSpacing aSpacing;
+ aSpacing.Mode = ( nUnit == PERCENT
+ ? ::com::sun::star::style::LineSpacingMode::PROP
+ : ::com::sun::star::style::LineSpacingMode::MINIMUM );
+ aSpacing.Height = static_cast< sal_Int16 >( nUnit == PERCENT ? nValue / 1000 : nValue );
+ return aSpacing;
+ }
+ sal_Int32 toMargin( float fFontSize ) const
+ {
+ if ( nUnit == PERCENT )
+ return (sal_Int32) ((((fFontSize*nValue)/1000)*254 + 360)/720);
+ else
+ return nValue;
+ }
+ sal_Int32 nUnit;
+ sal_Int32 nValue;
+ bool bHasValue;
+ };
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/theme.hxx b/include/oox/drawingml/theme.hxx
new file mode 100644
index 000000000000..f167c43a4fd4
--- /dev/null
+++ b/include/oox/drawingml/theme.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 OOX_DRAWINGML_THEME_HXX
+#define OOX_DRAWINGML_THEME_HXX
+
+#include "oox/drawingml/clrscheme.hxx"
+#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/textfont.hxx"
+#include <com/sun/star/xml/dom/XDocument.hpp>
+#include "oox/dllapi.h"
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+const sal_Int32 THEMED_STYLE_SUBTLE = 1;
+const sal_Int32 THEMED_STYLE_MODERATE = 2;
+const sal_Int32 THEMED_STYLE_INTENSE = 3;
+
+typedef RefVector< FillProperties > FillStyleList;
+typedef RefVector< LineProperties > LineStyleList;
+typedef RefVector< EffectProperties > EffectStyleList;
+typedef RefMap< sal_Int32, TextCharacterProperties > FontScheme;
+
+// ============================================================================
+
+class OOX_DLLPUBLIC Theme
+{
+public:
+ explicit Theme();
+ ~Theme();
+
+ inline void setStyleName( const OUString& rStyleName ) { maStyleName = rStyleName; }
+ inline const OUString& getStyleName() const { return maStyleName; }
+
+ inline ClrScheme& getClrScheme() { return maClrScheme; }
+ inline const ClrScheme& getClrScheme() const { return maClrScheme; }
+
+ inline FillStyleList& getFillStyleList() { return maFillStyleList; }
+ inline const FillStyleList& getFillStyleList() const { return maFillStyleList; }
+ inline FillStyleList& getBgFillStyleList() { return maBgFillStyleList; }
+ inline const FillStyleList& getBgFillStyleList() const { return maBgFillStyleList; }
+ /** Returns the fill properties of the passed one-based themed style index. */
+ const FillProperties* getFillStyle( sal_Int32 nIndex ) const;
+
+ inline LineStyleList& getLineStyleList() { return maLineStyleList; }
+ inline const LineStyleList& getLineStyleList() const { return maLineStyleList; }
+ /** Returns the line properties of the passed one-based themed style index. */
+ const LineProperties* getLineStyle( sal_Int32 nIndex ) const;
+
+ inline EffectStyleList& getEffectStyleList() { return maEffectStyleList; }
+ inline const EffectStyleList& getEffectStyleList() const { return maEffectStyleList; }
+ const EffectProperties* getEffectStyle( sal_Int32 nIndex ) const;
+
+ inline FontScheme& getFontScheme() { return maFontScheme; }
+ inline const FontScheme& getFontScheme() const { return maFontScheme; }
+ /** Returns theme font properties by scheme type (major/minor). */
+ const TextCharacterProperties* getFontStyle( sal_Int32 nSchemeType ) const;
+ /** Returns theme font by placeholder name, e.g. the major latin theme font for the font name '+mj-lt'. */
+ const TextFont* resolveFont( const OUString& rName ) const;
+
+ inline Shape& getSpDef() { return maSpDef; }
+ inline const Shape& getSpDef() const { return maSpDef; }
+
+ inline Shape& getLnDef() { return maLnDef; }
+ inline const Shape& getLnDef() const { return maLnDef; }
+
+ inline Shape& getTxDef() { return maTxDef; }
+ inline const Shape& getTxDef() const { return maTxDef; }
+
+ void setFragment( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::dom::XDocument>& xRef ) { mxFragment=xRef; }
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::dom::XDocument>& getFragment() const { return mxFragment; }
+
+private:
+ OUString maStyleName;
+ ClrScheme maClrScheme;
+ FillStyleList maFillStyleList;
+ FillStyleList maBgFillStyleList;
+ LineStyleList maLineStyleList;
+ EffectStyleList maEffectStyleList;
+ FontScheme maFontScheme;
+ Shape maSpDef;
+ Shape maLnDef;
+ Shape maTxDef;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::dom::XDocument> mxFragment;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/themeelementscontext.hxx b/include/oox/drawingml/themeelementscontext.hxx
new file mode 100644
index 000000000000..a3d36a9d8225
--- /dev/null
+++ b/include/oox/drawingml/themeelementscontext.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 OOX_DRAWINGML_THEMEELEMENTSCONTEXT_HXX
+#define OOX_DRAWINGML_THEMEELEMENTSCONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+
+namespace oox {
+namespace drawingml {
+
+class Theme;
+
+// ============================================================================
+
+class ThemeElementsContext : public oox::core::ContextHandler
+{
+public:
+ ThemeElementsContext( ::oox::core::ContextHandler& rParent, Theme& rTheme );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ Theme& mrTheme;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/themefragmenthandler.hxx b/include/oox/drawingml/themefragmenthandler.hxx
new file mode 100644
index 000000000000..61062775fa37
--- /dev/null
+++ b/include/oox/drawingml/themefragmenthandler.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 OOX_DRAWINGML_THEMEFRAGMENTHANDLER_HXX
+#define OOX_DRAWINGML_THEMEFRAGMENTHANDLER_HXX
+
+#include "oox/core/fragmenthandler2.hxx"
+#include "oox/dllapi.h"
+
+namespace oox {
+namespace drawingml {
+
+class Theme;
+
+// ============================================================================
+
+class OOX_DLLPUBLIC ThemeFragmentHandler : public ::oox::core::FragmentHandler2
+{
+public:
+ explicit ThemeFragmentHandler(
+ ::oox::core::XmlFilterBase& rFilter,
+ const OUString& rFragmentPath,
+ Theme& rTheme );
+ virtual ~ThemeFragmentHandler();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+private:
+ Theme& mrTheme;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/drawingml/transform2dcontext.hxx b/include/oox/drawingml/transform2dcontext.hxx
new file mode 100644
index 000000000000..6bbbe191e77c
--- /dev/null
+++ b/include/oox/drawingml/transform2dcontext.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 OOX_DRAWINGML_TRANSFORM2DCONTEXT_HXX
+#define OOX_DRAWINGML_TRANSFORM2DCONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+
+namespace oox {
+namespace drawingml {
+
+// ============================================================================
+
+class Shape;
+
+/** context to import a CT_Transform2D */
+class Transform2DContext : public ::oox::core::ContextHandler
+{
+public:
+ Transform2DContext( ::oox::core::ContextHandler& rParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes, Shape& rShape, bool btxXfrm = false ) throw();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ Shape& mrShape;
+ bool mbtxXfrm;
+};
+
+// ============================================================================
+
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/dump/dffdumper.hxx b/include/oox/dump/dffdumper.hxx
new file mode 100644
index 000000000000..d041dcc0be66
--- /dev/null
+++ b/include/oox/dump/dffdumper.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 OOX_DUMP_DFFDUMPER_HXX
+#define OOX_DUMP_DFFDUMPER_HXX
+
+#include "oox/dump/dumperbase.hxx"
+
+#if OOX_INCLUDE_DUMPER
+
+namespace oox {
+namespace dump {
+
+// ============================================================================
+
+class DffStreamObject : public SequenceRecordObjectBase
+{
+public:
+ inline sal_uInt16 getVer() const { return mnInstVer & 0x000F; }
+ inline sal_uInt16 getInst() const { return (mnInstVer & 0xFFF0) >> 4; }
+ inline bool isContainer() const { return getVer() == 15; }
+
+protected:
+ inline explicit DffStreamObject() {}
+
+ using SequenceRecordObjectBase::construct;
+
+ virtual bool implReadRecordHeader( BinaryInputStream& rBaseStrm, sal_Int64& ornRecId, sal_Int64& ornRecSize );
+ virtual void implWriteExtHeader();
+ virtual void implDumpRecordBody();
+ virtual void implDumpClientAnchor();
+
+private:
+ sal_uInt32 dumpDffSimpleColor( const String& rName );
+
+ void dumpDffOpt();
+ sal_uInt16 dumpDffOptPropHeader();
+
+private:
+ ItemFormatMap maSimpleProps;
+ ItemFormatMap maComplexProps;
+ sal_uInt16 mnInstVer;
+ sal_Int32 mnRealSize;
+};
+
+// ============================================================================
+
+} // namespace dump
+} // namespace oox
+
+#endif
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/dump/dumperbase.hxx b/include/oox/dump/dumperbase.hxx
new file mode 100644
index 000000000000..043bb73ecfa8
--- /dev/null
+++ b/include/oox/dump/dumperbase.hxx
@@ -0,0 +1,1871 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DUMP_DUMPERBASE_HXX
+#define OOX_DUMP_DUMPERBASE_HXX
+
+#include <math.h>
+#include <vector>
+#include <stack>
+#include <set>
+#include <map>
+#include <boost/shared_ptr.hpp>
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/util/DateTime.hpp>
+#include "oox/helper/binaryinputstream.hxx"
+#include "oox/helper/helper.hxx"
+#include "oox/helper/storagebase.hxx"
+
+#define OOX_INCLUDE_DUMPER (OSL_DEBUG_LEVEL > 0)
+
+#if OOX_INCLUDE_DUMPER
+
+namespace com { namespace sun { namespace star {
+ namespace io { class XInputStream; }
+ namespace io { class XOutputStream; }
+ namespace io { class XTextOutputStream2; }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace comphelper {
+ class IDocPasswordVerifier;
+}
+
+namespace oox {
+ class BinaryOutputStream;
+ class TextInputStream;
+}
+
+namespace oox { namespace core {
+ class FilterBase;
+} }
+
+namespace oox {
+namespace dump {
+
+// ============================================================================
+
+#define OOX_DUMP_UNUSED "unused"
+#define OOX_DUMP_UNKNOWN "?unknown"
+
+#define OOX_DUMP_ERRASCII( ascii ) "?err:" ascii
+
+#define OOX_DUMP_ERR_NOMAP "no-map"
+#define OOX_DUMP_ERR_NONAME "no-name"
+#define OOX_DUMP_ERR_STREAM "stream-error"
+
+#define OOX_DUMP_DUMPEXT ".dump"
+
+const sal_Unicode OOX_DUMP_STRQUOTE = '\'';
+const sal_Unicode OOX_DUMP_FMLASTRQUOTE = '"';
+const sal_Unicode OOX_DUMP_ADDRABS = '$';
+const sal_Unicode OOX_DUMP_R1C1ROW = 'R';
+const sal_Unicode OOX_DUMP_R1C1COL = 'C';
+const sal_Unicode OOX_DUMP_R1C1OPEN = '[';
+const sal_Unicode OOX_DUMP_R1C1CLOSE = ']';
+const sal_Unicode OOX_DUMP_RANGESEP = ':';
+const sal_Unicode OOX_DUMP_BASECLASS = 'B';
+const sal_Unicode OOX_DUMP_FUNCSEP = ',';
+const sal_Unicode OOX_DUMP_LISTSEP = ',';
+const sal_Unicode OOX_DUMP_TABSEP = '!';
+const sal_Unicode OOX_DUMP_ARRAYSEP = ';';
+const sal_Unicode OOX_DUMP_EMPTYVALUE = '~';
+const sal_Unicode OOX_DUMP_CMDPROMPT = '?';
+const sal_Unicode OOX_DUMP_PLACEHOLDER = '\x01';
+
+typedef ::std::pair< OUString, OUString > OUStringPair;
+typedef ::std::pair< sal_Int64, sal_Int64 > Int64Pair;
+
+typedef ::std::vector< OUString > OUStringVector;
+typedef ::std::vector< sal_Int64 > Int64Vector;
+
+// ============================================================================
+// ============================================================================
+
+/** Static helper functions for system file and stream access. */
+class InputOutputHelper
+{
+public:
+ // file names -------------------------------------------------------------
+
+ static OUString convertFileNameToUrl( const OUString& rFileName );
+ static sal_Int32 getFileNamePos( const OUString& rFileUrl );
+ static OUString getFileNameExtension( const OUString& rFileUrl );
+
+ // input streams ----------------------------------------------------------
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ openInputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const OUString& rFileName );
+
+ // output streams ---------------------------------------------------------
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+ openOutputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const OUString& rFileName );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextOutputStream2 >
+ openTextOutputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rxOutStrm,
+ rtl_TextEncoding eTextEnc );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextOutputStream2 >
+ openTextOutputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const OUString& rFileName,
+ rtl_TextEncoding eTextEnc );
+};
+
+// ============================================================================
+
+class BinaryInputStreamRef : public ::oox::BinaryInputStreamRef
+{
+public:
+ inline BinaryInputStreamRef() {}
+
+ inline /*implicit*/ BinaryInputStreamRef( BinaryInputStream* pInStrm ) :
+ ::oox::BinaryInputStreamRef( pInStrm ) {}
+
+ inline /*implicit*/ BinaryInputStreamRef( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm ) :
+ ::oox::BinaryInputStreamRef( new BinaryXInputStream( rxInStrm, true ) ) {}
+
+ template< typename StreamType >
+ inline /*implicit*/ BinaryInputStreamRef( const ::boost::shared_ptr< StreamType >& rxInStrm ) :
+ ::oox::BinaryInputStreamRef( rxInStrm ) {}
+};
+
+// ============================================================================
+// ============================================================================
+
+/** Specifiers for atomic data types. */
+enum DataType
+{
+ DATATYPE_VOID, ///< No data type.
+ DATATYPE_INT8, ///< Signed 8-bit integer.
+ DATATYPE_UINT8, ///< Unsigned 8-bit integer.
+ DATATYPE_INT16, ///< Signed 16-bit integer.
+ DATATYPE_UINT16, ///< Unsigned 16-bit integer.
+ DATATYPE_INT32, ///< Signed 32-bit integer.
+ DATATYPE_UINT32, ///< Unsigned 32-bit integer.
+ DATATYPE_INT64, ///< Signed 64-bit integer.
+ DATATYPE_UINT64, ///< Unsigned 64-bit integer.
+ DATATYPE_FLOAT, ///< Floating-point, single precision.
+ DATATYPE_DOUBLE ///< Floating-point, double precision.
+};
+
+// ----------------------------------------------------------------------------
+
+/** Specifiers for the output format of values. */
+enum FormatType
+{
+ FORMATTYPE_NONE, ///< No numeric format (e.g. show name only).
+ FORMATTYPE_DEC, ///< Decimal.
+ FORMATTYPE_HEX, ///< Hexadecimal.
+ FORMATTYPE_SHORTHEX, ///< Hexadecimal, as short as possible (no leading zeros).
+ FORMATTYPE_BIN, ///< Binary.
+ FORMATTYPE_FIX, ///< Fixed-point.
+ FORMATTYPE_BOOL ///< Boolean ('true' or 'false').
+};
+
+// ----------------------------------------------------------------------------
+
+/** Describes the output format of a data item.
+
+ Data items are written in the following format:
+
+ <NAME>=<VALUE>=<NAME-FROM-LIST>
+
+ NAME is the name of the data item. The name is contained in the member
+ maItemName. If the name is empty, only the value is written (without a
+ leading equality sign).
+
+ VALUE is the numeric value of the data item. Its format is dependent on the
+ output format given in the member meFmtType. If the format type is
+ FORMATTYPE_NONE, no value is written.
+
+ NAME-FROM-LIST is a symbolic name for the current value of the data item.
+ Various types of name lists produce different names for values, which can
+ be used for enumerations or names for single bits in bitfields (see class
+ NameListBase and derived classes). The name of the list is given in the
+ member maListName. If it is empty, no name is written for the value.
+ */
+struct ItemFormat
+{
+ DataType meDataType; ///< Data type of the item.
+ FormatType meFmtType; ///< Output format for the value.
+ OUString maItemName; ///< Name of the item.
+ OUString maListName; ///< Name of a name list to be used for this item.
+
+ explicit ItemFormat();
+
+ void set( DataType eDataType, FormatType eFmtType, const OUString& rItemName );
+
+ /** Initializes the struct from a vector of strings containing the item format.
+
+ The vector must contain at least 2 strings. The struct is filled from
+ the strings in the vector in the following order:
+ 1) Data type (one of: [u]int8, [u]int16, [u]int32, [u]int64, float, double).
+ 2) Format type (one of: dec, hex, shorthex, bin, fix, bool, unused, unknown).
+ 3) Item name (optional).
+ 4) Name list name (optional).
+
+ @return Iterator pointing to the first unhandled string.
+ */
+ OUStringVector::const_iterator parse( const OUStringVector& rFormatVec );
+
+ /** Initializes the struct from a string containing the item format.
+
+ The string must have the following format:
+ DATATYPE,FORMATTYPE[,ITEMNAME[,LISTNAME]]
+
+ DATATYPE is the data type of the item (see above for possible values).
+ FORMATTYPE is the format type of the item (see above for possible values).
+ ITEMNAME is the name of the item (optional).
+ LISTNAME is the name of a name list (optional).
+
+ @return List containing remaining unhandled format strings.
+ */
+ OUStringVector parse( const OUString& rFormatStr );
+};
+
+// ============================================================================
+// ============================================================================
+
+struct Address
+{
+ sal_Int32 mnCol;
+ sal_Int32 mnRow;
+ inline explicit Address() : mnCol( 0 ), mnRow( 0 ) {}
+ inline explicit Address( sal_Int32 nCol, sal_Int32 nRow ) : mnCol( nCol ), mnRow( nRow ) {}
+};
+
+// ----------------------------------------------------------------------------
+
+struct Range
+{
+ Address maFirst;
+ Address maLast;
+ inline explicit Range() {}
+};
+
+// ----------------------------------------------------------------------------
+
+typedef ::std::vector< Range > RangeList;
+
+// ============================================================================
+
+struct TokenAddress : public Address
+{
+ bool mbRelCol;
+ bool mbRelRow;
+ inline explicit TokenAddress() : mbRelCol( false ), mbRelRow( false ) {}
+};
+
+// ----------------------------------------------------------------------------
+
+struct TokenRange
+{
+ TokenAddress maFirst;
+ TokenAddress maLast;
+ inline explicit TokenRange() {}
+};
+
+// ============================================================================
+// ============================================================================
+
+/** Static helper functions for formatted output to strings. */
+class StringHelper
+{
+public:
+ // append string to string ------------------------------------------------
+
+ static void appendChar( OUStringBuffer& rStr, sal_Unicode cChar, sal_Int32 nCount = 1 );
+ static void appendString( OUStringBuffer& rStr, const OUString& rData, sal_Int32 nWidth = 0, sal_Unicode cFill = ' ' );
+
+ // append decimal ---------------------------------------------------------
+
+ static void appendDec( OUStringBuffer& rStr, sal_uInt8 nData, sal_Int32 nWidth = 0, sal_Unicode cFill = ' ' );
+ static void appendDec( OUStringBuffer& rStr, sal_Int8 nData, sal_Int32 nWidth = 0, sal_Unicode cFill = ' ' );
+ static void appendDec( OUStringBuffer& rStr, sal_uInt16 nData, sal_Int32 nWidth = 0, sal_Unicode cFill = ' ' );
+ static void appendDec( OUStringBuffer& rStr, sal_Int16 nData, sal_Int32 nWidth = 0, sal_Unicode cFill = ' ' );
+ static void appendDec( OUStringBuffer& rStr, sal_uInt32 nData, sal_Int32 nWidth = 0, sal_Unicode cFill = ' ' );
+ static void appendDec( OUStringBuffer& rStr, sal_Int32 nData, sal_Int32 nWidth = 0, sal_Unicode cFill = ' ' );
+ static void appendDec( OUStringBuffer& rStr, sal_uInt64 nData, sal_Int32 nWidth = 0, sal_Unicode cFill = ' ' );
+ static void appendDec( OUStringBuffer& rStr, sal_Int64 nData, sal_Int32 nWidth = 0, sal_Unicode cFill = ' ' );
+ static void appendDec( OUStringBuffer& rStr, double fData, sal_Int32 nWidth = 0, sal_Unicode cFill = ' ' );
+
+ // append hexadecimal -----------------------------------------------------
+
+ static void appendHex( OUStringBuffer& rStr, sal_uInt8 nData, bool bPrefix = true );
+ static void appendHex( OUStringBuffer& rStr, sal_Int8 nData, bool bPrefix = true );
+ static void appendHex( OUStringBuffer& rStr, sal_uInt16 nData, bool bPrefix = true );
+ static void appendHex( OUStringBuffer& rStr, sal_Int16 nData, bool bPrefix = true );
+ static void appendHex( OUStringBuffer& rStr, sal_uInt32 nData, bool bPrefix = true );
+ static void appendHex( OUStringBuffer& rStr, sal_Int32 nData, bool bPrefix = true );
+ static void appendHex( OUStringBuffer& rStr, sal_uInt64 nData, bool bPrefix = true );
+ static void appendHex( OUStringBuffer& rStr, sal_Int64 nData, bool bPrefix = true );
+ static void appendHex( OUStringBuffer& rStr, double fData, bool bPrefix = true );
+
+ // append shortened hexadecimal -------------------------------------------
+
+ static void appendShortHex( OUStringBuffer& rStr, sal_uInt8 nData, bool bPrefix = true );
+ static void appendShortHex( OUStringBuffer& rStr, sal_Int8 nData, bool bPrefix = true );
+ static void appendShortHex( OUStringBuffer& rStr, sal_uInt16 nData, bool bPrefix = true );
+ static void appendShortHex( OUStringBuffer& rStr, sal_Int16 nData, bool bPrefix = true );
+ static void appendShortHex( OUStringBuffer& rStr, sal_uInt32 nData, bool bPrefix = true );
+ static void appendShortHex( OUStringBuffer& rStr, sal_Int32 nData, bool bPrefix = true );
+ static void appendShortHex( OUStringBuffer& rStr, sal_uInt64 nData, bool bPrefix = true );
+ static void appendShortHex( OUStringBuffer& rStr, sal_Int64 nData, bool bPrefix = true );
+ static void appendShortHex( OUStringBuffer& rStr, double fData, bool bPrefix = true );
+
+ // append binary ----------------------------------------------------------
+
+ static void appendBin( OUStringBuffer& rStr, sal_uInt8 nData, bool bDots = true );
+ static void appendBin( OUStringBuffer& rStr, sal_Int8 nData, bool bDots = true );
+ static void appendBin( OUStringBuffer& rStr, sal_uInt16 nData, bool bDots = true );
+ static void appendBin( OUStringBuffer& rStr, sal_Int16 nData, bool bDots = true );
+ static void appendBin( OUStringBuffer& rStr, sal_uInt32 nData, bool bDots = true );
+ static void appendBin( OUStringBuffer& rStr, sal_Int32 nData, bool bDots = true );
+ static void appendBin( OUStringBuffer& rStr, sal_uInt64 nData, bool bDots = true );
+ static void appendBin( OUStringBuffer& rStr, sal_Int64 nData, bool bDots = true );
+ static void appendBin( OUStringBuffer& rStr, double fData, bool bDots = true );
+
+ // append fixed-point decimal ---------------------------------------------
+
+ template< typename Type >
+ static void appendFix( OUStringBuffer& rStr, Type nData, sal_Int32 nWidth = 0 );
+
+ // append formatted value -------------------------------------------------
+
+ static void appendBool( OUStringBuffer& rStr, bool bData );
+ template< typename Type >
+ static void appendValue( OUStringBuffer& rStr, Type nData, FormatType eFmtType );
+
+ // encoded text output ----------------------------------------------------
+
+ static void appendCChar( OUStringBuffer& rStr, sal_Unicode cChar, bool bPrefix = true );
+ static void appendEncChar( OUStringBuffer& rStr, sal_Unicode cChar, sal_Int32 nCount = 1, bool bPrefix = true );
+ static void appendEncString( OUStringBuffer& rStr, const OUString& rData, bool bPrefix = true );
+
+ // token list -------------------------------------------------------------
+
+ static void appendToken( OUStringBuffer& rStr, const OUString& rToken, sal_Unicode cSep = OOX_DUMP_LISTSEP );
+
+ static void appendIndex( OUStringBuffer& rStr, const OUString& rIdx );
+ static void appendIndex( OUStringBuffer& rStr, sal_Int64 nIdx );
+
+ static OUString getToken( const OUString& rData, sal_Int32& rnPos, sal_Unicode cSep = OOX_DUMP_LISTSEP );
+
+ /** Encloses the passed string with the passed characters. Uses cOpen, if cClose is NUL. */
+ static void enclose( OUStringBuffer& rStr, sal_Unicode cOpen, sal_Unicode cClose = '\0' );
+
+ // string conversion ------------------------------------------------------
+
+ static OUString trimSpaces( const OUString& rStr );
+ static OUString trimTrailingNul( const OUString& rStr );
+
+ static OString convertToUtf8( const OUString& rStr );
+ static DataType convertToDataType( const OUString& rStr );
+ static FormatType convertToFormatType( const OUString& rStr );
+
+ static bool convertFromDec( sal_Int64& ornData, const OUString& rData );
+ static bool convertFromHex( sal_Int64& ornData, const OUString& rData );
+
+ static bool convertStringToInt( sal_Int64& ornData, const OUString& rData );
+ static bool convertStringToDouble( double& orfData, const OUString& rData );
+ static bool convertStringToBool( const OUString& rData );
+
+ static OUStringPair convertStringToPair( const OUString& rString, sal_Unicode cSep = '=' );
+
+ // string to list conversion ----------------------------------------------
+
+ static void convertStringToStringList( OUStringVector& orVec, const OUString& rData, bool bIgnoreEmpty );
+ static void convertStringToIntList( Int64Vector& orVec, const OUString& rData, bool bIgnoreEmpty );
+};
+
+// ----------------------------------------------------------------------------
+
+template< typename Type >
+void StringHelper::appendFix( OUStringBuffer& rStr, Type nData, sal_Int32 nWidth )
+{
+ appendDec( rStr, static_cast< double >( nData ) / pow( 2.0, 4.0 * sizeof( Type ) ), nWidth );
+}
+
+template< typename Type >
+void StringHelper::appendValue( OUStringBuffer& rStr, Type nData, FormatType eFmtType )
+{
+ switch( eFmtType )
+ {
+ case FORMATTYPE_DEC: appendDec( rStr, nData ); break;
+ case FORMATTYPE_HEX: appendHex( rStr, nData ); break;
+ case FORMATTYPE_SHORTHEX: appendShortHex( rStr, nData ); break;
+ case FORMATTYPE_BIN: appendBin( rStr, nData ); break;
+ case FORMATTYPE_FIX: appendFix( rStr, nData ); break;
+ case FORMATTYPE_BOOL: appendBool( rStr, nData ); break;
+ default:;
+ }
+}
+
+// ============================================================================
+
+class String : public OUString
+{
+public:
+ inline String() {}
+ inline /*implicit*/ String( const OUString& rStr ) : OUString( rStr ) {}
+ inline /*implicit*/ String( const sal_Char* pcStr ) : OUString( OUString::createFromAscii( pcStr ? pcStr : "" ) ) {}
+ inline /*implicit*/ String( sal_Unicode cChar ) : OUString( cChar ) {}
+
+ inline bool has() const { return getLength() > 0; }
+ inline OUString operator()( const sal_Char* pcDefault ) const { if( has() ) return *this; return String( pcDefault ); }
+};
+
+static const String EMPTY_STRING;
+
+// ============================================================================
+// ============================================================================
+
+class Base;
+typedef ::boost::shared_ptr< Base > BaseRef;
+
+/** Base class for all dumper classes.
+
+ Derived classes implement the virtual function implIsValid(). It should
+ check all members the other functions rely on. If the function
+ implIsValid() returns true, all references and pointers can be used without
+ further checking.
+
+ Overview of all classes in this header file based on this Base class:
+
+ Base
+ |
+ +----> NameListBase
+ | |
+ | +----> ConstList ------> MultiList
+ | |
+ | +----> FlagsList ------> CombiList
+ | |
+ | +----> UnitConverter
+ |
+ +----> SharedConfigData
+ |
+ +----> Config
+ |
+ +----> Output
+ |
+ +----> StorageIterator
+ |
+ +----> ObjectBase
+ |
+ +----> StorageObjectBase
+ |
+ +----> OutputObjectBase
+ | |
+ | +----> InputObjectBase
+ | |
+ | +----> BinaryStreamObject
+ | |
+ | +----> TextStreamObjectBase
+ | | |
+ | | +----> TextStreamObject
+ | | |
+ | | +----> XmlStreamObject
+ | |
+ | +----> RecordObjectBase
+ | |
+ | +----> SequenceRecordObjectBase
+ |
+ +----> DumperBase
+ */
+class Base
+{
+public:
+ virtual ~Base();
+
+ inline bool isValid() const { return implIsValid(); }
+ inline static bool isValid( const BaseRef& rxBase ) { return rxBase.get() && rxBase->isValid(); }
+
+protected:
+ inline explicit Base() {}
+
+ virtual bool implIsValid() const = 0;
+};
+
+// ============================================================================
+// ============================================================================
+
+class ConfigItemBase
+{
+public:
+ virtual ~ConfigItemBase();
+ void readConfigBlock( TextInputStream& rStrm );
+
+protected:
+ inline explicit ConfigItemBase() {}
+
+ virtual void implProcessConfigItemStr(
+ TextInputStream& rStrm,
+ const OUString& rKey,
+ const OUString& rData );
+
+ virtual void implProcessConfigItemInt(
+ TextInputStream& rStrm,
+ sal_Int64 nKey,
+ const OUString& rData );
+
+ void readConfigBlockContents(
+ TextInputStream& rStrm );
+
+private:
+ enum LineType { LINETYPE_DATA, LINETYPE_END };
+
+ LineType readConfigLine(
+ TextInputStream& rStrm,
+ OUString& orKey,
+ OUString& orData ) const;
+
+ void processConfigItem(
+ TextInputStream& rStrm,
+ const OUString& rKey,
+ const OUString& rData );
+};
+
+// ============================================================================
+
+class SharedConfigData;
+class Config;
+
+class NameListBase;
+typedef ::boost::shared_ptr< NameListBase > NameListRef;
+
+/** Base class of all classes providing names for specific values (name lists).
+
+ The idea is to provide a unique interfase for all different methods to
+ write specific names for any values. This can be enumerations (dedicated
+ names for a subset of values), or names for bits in bit fields. Classes
+ derived from this base class implement the specific behaviour for the
+ desired purpose.
+ */
+class NameListBase : public Base, public ConfigItemBase
+{
+public:
+ typedef ::std::map< sal_Int64, OUString > OUStringMap;
+ typedef OUStringMap::const_iterator const_iterator;
+
+public:
+ virtual ~NameListBase();
+
+ /** Sets a name for the specified key. */
+ void setName( sal_Int64 nKey, const String& rName );
+
+ /** Include all names of the passed list. */
+ void includeList( const NameListRef& rxList );
+
+ /** Returns true, if the map contains an entry for the passed key. */
+ template< typename Type >
+ inline bool hasName( Type nKey ) const
+ { return maMap.count( static_cast< sal_Int64 >( nKey ) ) != 0; }
+
+ /** Returns the name for the passed key. */
+ template< typename Type >
+ inline OUString getName( const Config& rCfg, Type nKey ) const
+ { return implGetName( rCfg, static_cast< sal_Int64 >( nKey ) ); }
+
+ /** Returns a display name for the passed double value. */
+ inline OUString getName( const Config& rCfg, double fValue ) const
+ { return implGetNameDbl( rCfg, fValue ); }
+
+ /** Returns a map iterator pointing to the first contained name. */
+ inline const_iterator begin() const { return maMap.begin(); }
+ /** Returns a map iterator pointing one past the last contained name. */
+ inline const_iterator end() const { return maMap.end(); }
+
+protected:
+ inline explicit NameListBase( const SharedConfigData& rCfgData ) : mrCfgData( rCfgData ) {}
+
+ virtual bool implIsValid() const;
+
+ virtual void implProcessConfigItemStr(
+ TextInputStream& rStrm,
+ const OUString& rKey,
+ const OUString& rData );
+
+ virtual void implProcessConfigItemInt(
+ TextInputStream& rStrm,
+ sal_Int64 nKey,
+ const OUString& rData );
+
+ /** Derived classes set the name for the passed key. */
+ virtual void implSetName( sal_Int64 nKey, const OUString& rName ) = 0;
+ /** Derived classes generate and return the name for the passed key. */
+ virtual OUString implGetName( const Config& rCfg, sal_Int64 nKey ) const = 0;
+ /** Derived classes generate and return the name for the passed double value. */
+ virtual OUString implGetNameDbl( const Config& rCfg, double fValue ) const = 0;
+ /** Derived classes insert all names and other settings from the passed list. */
+ virtual void implIncludeList( const NameListBase& rList ) = 0;
+
+ /** Inserts the passed name into the internal map. */
+ void insertRawName( sal_Int64 nKey, const OUString& rName );
+ /** Returns the name for the passed key, or 0, if nothing found. */
+ const OUString* findRawName( sal_Int64 nKey ) const;
+
+private:
+ /** Includes name lists, given in a comma separated list of names of the lists. */
+ void include( const OUString& rListKeys );
+ /** Excludes names from the list, given in a comma separated list of their keys. */
+ void exclude( const OUString& rKeys );
+
+private:
+ OUStringMap maMap;
+ const SharedConfigData& mrCfgData;
+};
+
+// ============================================================================
+
+class ConstList : public NameListBase
+{
+public:
+ explicit ConstList( const SharedConfigData& rCfgData );
+
+ /** Sets a default name for unknown keys. */
+ inline void setDefaultName( const String& rDefName ) { maDefName = rDefName; }
+ /** Enables or disables automatic quotation of returned names. */
+ inline void setQuoteNames( bool bQuoteNames ) { mbQuoteNames = bQuoteNames; }
+
+protected:
+ virtual void implProcessConfigItemStr(
+ TextInputStream& rStrm,
+ const OUString& rKey,
+ const OUString& rData );
+
+ /** Sets the name for the passed key. */
+ virtual void implSetName( sal_Int64 nKey, const OUString& rName );
+ /** Returns the name for the passed key, or the default name, if key is not contained. */
+ virtual OUString implGetName( const Config& rCfg, sal_Int64 nKey ) const;
+ /** Returns the name for the passed double value. */
+ virtual OUString implGetNameDbl( const Config& rCfg, double fValue ) const;
+ /** Inserts all names from the passed list. */
+ virtual void implIncludeList( const NameListBase& rList );
+
+private:
+ OUString maDefName;
+ bool mbQuoteNames;
+};
+
+// ============================================================================
+
+class MultiList : public ConstList
+{
+public:
+ explicit MultiList( const SharedConfigData& rCfgData );
+
+ void setNamesFromVec( sal_Int64 nStartKey, const OUStringVector& rNames );
+
+protected:
+ virtual void implProcessConfigItemStr(
+ TextInputStream& rStrm,
+ const OUString& rKey,
+ const OUString& rData );
+
+ virtual void implSetName( sal_Int64 nKey, const OUString& rName );
+
+private:
+ void insertNames( sal_Int64 nStartKey, const OUString& rData );
+
+private:
+ bool mbIgnoreEmpty;
+};
+
+// ============================================================================
+
+class FlagsList : public NameListBase
+{
+public:
+ explicit FlagsList( const SharedConfigData& rCfgData );
+
+ /** Returns the flags to be ignored on output. */
+ inline sal_Int64 getIgnoreFlags() const { return mnIgnore; }
+ /** Sets flags to be ignored on output. */
+ inline void setIgnoreFlags( sal_Int64 nIgnore ) { mnIgnore = nIgnore; }
+
+protected:
+ virtual void implProcessConfigItemStr(
+ TextInputStream& rStrm,
+ const OUString& rKey,
+ const OUString& rData );
+
+ /** Sets the name for the passed key. */
+ virtual void implSetName( sal_Int64 nKey, const OUString& rName );
+ /** Returns the name for the passed key. */
+ virtual OUString implGetName( const Config& rCfg, sal_Int64 nKey ) const;
+ /** Returns the name for the passed double value. */
+ virtual OUString implGetNameDbl( const Config& rCfg, double fValue ) const;
+ /** Inserts all flags from the passed list. */
+ virtual void implIncludeList( const NameListBase& rList );
+
+private:
+ sal_Int64 mnIgnore;
+};
+
+// ============================================================================
+
+class CombiList : public FlagsList
+{
+public:
+ explicit CombiList( const SharedConfigData& rCfgData );
+
+protected:
+ /** Sets the name for the passed key. */
+ virtual void implSetName( sal_Int64 nKey, const OUString& rName );
+ /** Returns the name for the passed key. */
+ virtual OUString implGetName( const Config& rCfg, sal_Int64 nKey ) const;
+ /** Inserts all flags from the passed list. */
+ virtual void implIncludeList( const NameListBase& rList );
+
+private:
+ struct ExtItemFormatKey
+ {
+ sal_Int64 mnKey;
+ Int64Pair maFilter;
+ inline explicit ExtItemFormatKey( sal_Int64 nKey ) : mnKey( nKey ), maFilter( 0, 0 ) {}
+ bool operator<( const ExtItemFormatKey& rRight ) const;
+
+ };
+ struct ExtItemFormat : public ItemFormat
+ {
+ bool mbShiftValue;
+ inline explicit ExtItemFormat() : mbShiftValue( true ) {}
+ };
+ typedef ::std::map< ExtItemFormatKey, ExtItemFormat > ExtItemFormatMap;
+ ExtItemFormatMap maFmtMap;
+};
+
+// ============================================================================
+
+class UnitConverter : public NameListBase
+{
+public:
+ explicit UnitConverter( const SharedConfigData& rCfgData );
+
+ inline void setUnitName( const String& rUnitName ) { maUnitName = rUnitName; }
+ inline void setFactor( double fFactor ) { mfFactor = fFactor; }
+
+protected:
+ /** Sets the name for the passed key. */
+ virtual void implSetName( sal_Int64 nKey, const OUString& rName );
+ /** Returns the converted value with appended unit name. */
+ virtual OUString implGetName( const Config& rCfg, sal_Int64 nKey ) const;
+ /** Returns the converted value with appended unit name. */
+ virtual OUString implGetNameDbl( const Config& rCfg, double fValue ) const;
+ /** Empty implementation. */
+ virtual void implIncludeList( const NameListBase& rList );
+
+private:
+ OUString maUnitName;
+ double mfFactor;
+};
+
+// ============================================================================
+
+class NameListWrapper
+{
+public:
+ inline NameListWrapper() {}
+ inline /*implicit*/ NameListWrapper( const OUString& rListName ) : maName( rListName ) {}
+ inline /*implicit*/ NameListWrapper( const sal_Char* pcListName ) : maName( pcListName ) {}
+ inline /*implicit*/ NameListWrapper( const NameListRef& rxList ) : mxList( rxList ) {}
+
+ inline bool isEmpty() const { return !mxList && !maName.has(); }
+ NameListRef getNameList( const Config& rCfg ) const;
+
+private:
+ String maName;
+ mutable NameListRef mxList;
+};
+
+static const NameListWrapper NO_LIST;
+
+// ============================================================================
+
+class ItemFormatMap : public ::std::map< sal_Int64, ItemFormat >
+{
+public:
+ inline explicit ItemFormatMap() {}
+ inline explicit ItemFormatMap( const NameListRef& rxNameList ) { insertFormats( rxNameList ); }
+
+ void insertFormats( const NameListRef& rxNameList );
+};
+
+// ============================================================================
+// ============================================================================
+
+class SharedConfigData : public Base, public ConfigItemBase
+{
+public:
+ explicit SharedConfigData(
+ const OUString& rFileName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const StorageRef& rxRootStrg,
+ const OUString& rSysFileName );
+
+ virtual ~SharedConfigData();
+
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& getContext() const { return mxContext; }
+ inline const StorageRef& getRootStorage() const { return mxRootStrg; }
+ inline const OUString& getSysFileName() const { return maSysFileName; }
+
+ void setOption( const OUString& rKey, const OUString& rData );
+ const OUString* getOption( const OUString& rKey ) const;
+
+ template< typename ListType >
+ ::boost::shared_ptr< ListType > createNameList( const OUString& rListName );
+ void setNameList( const OUString& rListName, const NameListRef& rxList );
+ void eraseNameList( const OUString& rListName );
+ NameListRef getNameList( const OUString& rListName ) const;
+
+ inline bool isPasswordCancelled() const { return mbPwCancelled; }
+
+protected:
+ virtual bool implIsValid() const;
+ virtual void implProcessConfigItemStr(
+ TextInputStream& rStrm,
+ const OUString& rKey,
+ const OUString& rData );
+
+private:
+ bool readConfigFile( const OUString& rFileUrl );
+ template< typename ListType >
+ void readNameList( TextInputStream& rStrm, const OUString& rListName );
+ void createShortList( const OUString& rData );
+ void createUnitConverter( const OUString& rData );
+
+private:
+ typedef ::std::set< OUString > ConfigFileSet;
+ typedef ::std::map< OUString, OUString > ConfigDataMap;
+ typedef ::std::map< OUString, NameListRef > NameListMap;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
+ StorageRef mxRootStrg;
+ OUString maSysFileName;
+ ConfigFileSet maConfigFiles;
+ ConfigDataMap maConfigData;
+ NameListMap maNameLists;
+ OUString maConfigPath;
+ bool mbLoaded;
+ bool mbPwCancelled;
+};
+
+// ----------------------------------------------------------------------------
+
+template< typename ListType >
+::boost::shared_ptr< ListType > SharedConfigData::createNameList( const OUString& rListName )
+{
+ ::boost::shared_ptr< ListType > xList;
+ if( !rListName.isEmpty() )
+ {
+ xList.reset( new ListType( *this ) );
+ setNameList( rListName, xList );
+ }
+ return xList;
+}
+
+template< typename ListType >
+void SharedConfigData::readNameList( TextInputStream& rStrm, const OUString& rListName )
+{
+ NameListRef xList = createNameList< ListType >( rListName );
+ if( xList.get() )
+ xList->readConfigBlock( rStrm );
+}
+
+// ============================================================================
+
+class Config : public Base
+{
+public:
+ explicit Config( const Config& rParent );
+ explicit Config(
+ const sal_Char* pcEnvVar,
+ const ::oox::core::FilterBase& rFilter );
+ explicit Config(
+ const sal_Char* pcEnvVar,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const StorageRef& rxRootStrg,
+ const OUString& rSysFileName );
+
+ virtual ~Config();
+
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& getContext() const { return mxCfgData->getContext(); }
+ inline const StorageRef& getRootStorage() const { return mxCfgData->getRootStorage(); }
+ inline const OUString& getSysFileName() const { return mxCfgData->getSysFileName(); }
+
+ const OUString& getStringOption( const String& rKey, const OUString& rDefault ) const;
+ bool getBoolOption( const String& rKey, bool bDefault ) const;
+ template< typename Type >
+ Type getIntOption( const String& rKey, Type nDefault ) const;
+
+ bool isDumperEnabled() const;
+ bool isImportEnabled() const;
+
+ template< typename ListType >
+ ::boost::shared_ptr< ListType > createNameList( const String& rListName );
+ void eraseNameList( const String& rListName );
+ NameListRef getNameList( const String& rListName ) const;
+
+ /** Returns the name for the passed key from the passed name list. */
+ template< typename Type >
+ OUString getName( const NameListWrapper& rListWrp, Type nKey ) const;
+ /** Returns true, if the passed name list contains an entry for the passed key. */
+ template< typename Type >
+ bool hasName( const NameListWrapper& rListWrp, Type nKey ) const;
+
+ bool isPasswordCancelled() const;
+
+protected:
+ inline explicit Config() {}
+ void construct( const Config& rParent );
+ void construct(
+ const sal_Char* pcEnvVar,
+ const ::oox::core::FilterBase& rFilter );
+ void construct(
+ const sal_Char* pcEnvVar,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const StorageRef& rxRootStrg,
+ const OUString& rSysFileName );
+
+ virtual bool implIsValid() const;
+ virtual const OUString* implGetOption( const OUString& rKey ) const;
+ virtual NameListRef implGetNameList( const OUString& rListName ) const;
+
+private:
+ typedef ::boost::shared_ptr< SharedConfigData > SharedConfigDataRef;
+ SharedConfigDataRef mxCfgData;
+};
+
+typedef ::boost::shared_ptr< Config > ConfigRef;
+
+// ----------------------------------------------------------------------------
+
+template< typename Type >
+Type Config::getIntOption( const String& rKey, Type nDefault ) const
+{
+ sal_Int64 nRawData;
+ const OUString* pData = implGetOption( rKey );
+ return (pData && StringHelper::convertStringToInt( nRawData, *pData )) ?
+ static_cast< Type >( nRawData ) : nDefault;
+}
+
+template< typename ListType >
+::boost::shared_ptr< ListType > Config::createNameList( const String& rListName )
+{
+ return mxCfgData->createNameList< ListType >( rListName );
+}
+
+template< typename Type >
+OUString Config::getName( const NameListWrapper& rListWrp, Type nKey ) const
+{
+ NameListRef xList = rListWrp.getNameList( *this );
+ return xList.get() ? xList->getName( *this, nKey ) : OOX_DUMP_ERR_NOMAP;
+}
+
+template< typename Type >
+bool Config::hasName( const NameListWrapper& rListWrp, Type nKey ) const
+{
+ NameListRef xList = rListWrp.getNameList( *this );
+ return xList.get() && xList->hasName( nKey );
+}
+
+// ============================================================================
+// ============================================================================
+
+class Output : public Base
+{
+public:
+ explicit Output(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const OUString& rFileName );
+
+ // ------------------------------------------------------------------------
+
+ void newLine();
+ void emptyLine( size_t nCount = 1 );
+ inline OUStringBuffer& getLine() { return maLine; }
+
+ void incIndent();
+ void decIndent();
+
+ void startTable( sal_Int32 nW1 );
+ void startTable( sal_Int32 nW1, sal_Int32 nW2 );
+ void startTable( sal_Int32 nW1, sal_Int32 nW2, sal_Int32 nW3, sal_Int32 nW4 );
+ void startTable( size_t nColCount, const sal_Int32* pnColWidths );
+ void tab();
+ void tab( size_t nCol );
+ void endTable();
+
+ void resetItemIndex( sal_Int64 nIdx = 0 );
+ void startItem( const String& rItemName );
+ void contItem();
+ void endItem();
+ inline const OUString& getLastItemValue() const { return maLastItem; }
+
+ void startMultiItems();
+ void endMultiItems();
+
+ // ------------------------------------------------------------------------
+
+ void writeChar( sal_Unicode cChar, sal_Int32 nCount = 1 );
+ void writeAscii( const sal_Char* pcStr );
+ void writeString( const OUString& rStr );
+ void writeArray( const sal_uInt8* pnData, sal_Size nSize, sal_Unicode cSep = OOX_DUMP_LISTSEP );
+ void writeBool( bool bData );
+ void writeDateTime( const ::com::sun::star::util::DateTime& rDateTime );
+
+ template< typename Type >
+ inline void writeDec( Type nData, sal_Int32 nWidth = 0, sal_Unicode cFill = ' ' )
+ { StringHelper::appendDec( maLine, nData, nWidth, cFill ); }
+ template< typename Type >
+ inline void writeHex( Type nData, bool bPrefix = true )
+ { StringHelper::appendHex( maLine, nData, bPrefix ); }
+ template< typename Type >
+ inline void writeShortHex( Type nData, bool bPrefix = true )
+ { StringHelper::appendShortHex( maLine, nData, bPrefix ); }
+ template< typename Type >
+ inline void writeBin( Type nData, bool bDots = true )
+ { StringHelper::appendBin( maLine, nData, bDots ); }
+ template< typename Type >
+ inline void writeFix( Type nData, sal_Int32 nWidth = 0 )
+ { StringHelper::appendFix( maLine, nData, nWidth ); }
+ template< typename Type >
+ inline void writeValue( Type nData, FormatType eFmtType )
+ { StringHelper::appendValue( maLine, nData, eFmtType ); }
+ template< typename Type >
+ inline void writeName( const Config& rCfg, Type nData, const NameListWrapper& rListWrp )
+ { writeString( rCfg.getName( rListWrp, nData ) ); }
+
+ // ------------------------------------------------------------------------
+protected:
+ virtual bool implIsValid() const;
+
+private:
+ void writeItemName( const String& rItemName );
+
+private:
+ typedef ::std::vector< sal_Int32 > StringLenVec;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextOutputStream2 > mxStrm;
+ OUString maIndent;
+ OUStringBuffer maLine;
+ OUString maLastItem;
+ StringLenVec maColPos;
+ size_t mnCol;
+ size_t mnItemLevel;
+ size_t mnMultiLevel;
+ sal_Int64 mnItemIdx;
+ sal_Int32 mnLastItem;
+};
+
+typedef ::boost::shared_ptr< Output > OutputRef;
+
+// ============================================================================
+
+class IndentGuard
+{
+public:
+ inline explicit IndentGuard( const OutputRef& rxOut ) : mrOut( *rxOut ) { mrOut.incIndent(); }
+ inline ~IndentGuard() { mrOut.decIndent(); }
+private:
+ IndentGuard( const IndentGuard& );
+ IndentGuard& operator=( const IndentGuard& );
+private:
+ Output& mrOut;
+};
+
+// ----------------------------------------------------------------------------
+
+class TableGuard
+{
+public:
+ inline explicit TableGuard( const OutputRef& rxOut, sal_Int32 nW1 ) :
+ mrOut( *rxOut ) { mrOut.startTable( nW1 ); }
+ inline explicit TableGuard( const OutputRef& rxOut, sal_Int32 nW1, sal_Int32 nW2 ) :
+ mrOut( *rxOut ) { mrOut.startTable( nW1, nW2 ); }
+ inline explicit TableGuard( const OutputRef& rxOut, sal_Int32 nW1, sal_Int32 nW2, sal_Int32 nW3, sal_Int32 nW4 ) :
+ mrOut( *rxOut ) { mrOut.startTable( nW1, nW2, nW3, nW4 ); }
+ inline explicit TableGuard( const OutputRef& rxOut, size_t nColCount,
+ const sal_Int32* pnColWidths ) :
+ mrOut( *rxOut ) { mrOut.startTable( nColCount, pnColWidths ); }
+ inline ~TableGuard() { mrOut.endTable(); }
+ inline void tab() { mrOut.tab(); }
+ inline void tab( size_t nCol ) { mrOut.tab( nCol ); }
+private:
+ TableGuard( const TableGuard& );
+ TableGuard& operator=( const TableGuard& );
+private:
+ Output& mrOut;
+};
+
+// ----------------------------------------------------------------------------
+
+class ItemGuard
+{
+public:
+ inline explicit ItemGuard( const OutputRef& rxOut, const String& rName = EMPTY_STRING ) :
+ mrOut( *rxOut ) { mrOut.startItem( rName ); }
+ inline ~ItemGuard() { mrOut.endItem(); }
+ inline void cont() { mrOut.contItem(); }
+private:
+ ItemGuard( const ItemGuard& );
+ ItemGuard& operator=( const ItemGuard& );
+private:
+ Output& mrOut;
+};
+
+// ----------------------------------------------------------------------------
+
+class MultiItemsGuard
+{
+public:
+ inline explicit MultiItemsGuard( const OutputRef& rxOut ) : mrOut( *rxOut ) { mrOut.startMultiItems(); }
+ inline ~MultiItemsGuard() { mrOut.endMultiItems(); }
+private:
+ MultiItemsGuard( const MultiItemsGuard& );
+ MultiItemsGuard& operator=( const MultiItemsGuard& );
+private:
+ Output& mrOut;
+};
+
+// ============================================================================
+
+class StorageIterator : public Base
+{
+public:
+ explicit StorageIterator( const StorageRef& rxStrg );
+ virtual ~StorageIterator();
+
+ StorageIterator& operator++();
+
+ OUString getName() const;
+ bool isStream() const;
+ bool isStorage() const;
+
+private:
+ virtual bool implIsValid() const;
+
+private:
+ StorageRef mxStrg;
+ OUStringVector maNames;
+ OUStringVector::const_iterator maIt;
+};
+
+// ============================================================================
+// ============================================================================
+
+class ObjectBase : public Base
+{
+public:
+ virtual ~ObjectBase();
+
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&
+ getContext() const { return mxConfig->getContext(); }
+
+ void dump();
+
+ // ------------------------------------------------------------------------
+protected:
+ inline explicit ObjectBase() {}
+
+ void construct( const ConfigRef& rxConfig );
+ void construct( const ObjectBase& rParent );
+
+ virtual bool implIsValid() const;
+ virtual void implDump();
+
+ // ------------------------------------------------------------------------
+
+ inline Config& cfg() const { return *mxConfig; }
+
+private:
+ ConfigRef mxConfig;
+};
+
+typedef ::boost::shared_ptr< ObjectBase > ObjectRef;
+
+// ============================================================================
+// ============================================================================
+
+class StorageObjectBase : public ObjectBase
+{
+protected:
+ inline explicit StorageObjectBase() {}
+
+protected:
+ using ObjectBase::construct;
+ void construct( const ObjectBase& rParent, const StorageRef& rxStrg, const OUString& rSysPath );
+ void construct( const ObjectBase& rParent );
+
+ virtual bool implIsValid() const;
+ virtual void implDump();
+
+ virtual void implDumpStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
+ const OUString& rStrgPath,
+ const OUString& rStrmName,
+ const OUString& rSysFileName );
+
+ virtual void implDumpStorage(
+ const StorageRef& rxStrg,
+ const OUString& rStrgPath,
+ const OUString& rSysPath );
+
+ virtual void implDumpBaseStream(
+ const BinaryInputStreamRef& rxStrm,
+ const OUString& rSysFileName );
+
+ void addPreferredStream( const String& rStrmName );
+ void addPreferredStorage( const String& rStrgPath );
+
+private:
+ OUString getSysFileName(
+ const OUString& rStrmName,
+ const OUString& rSysOutPath );
+
+ void extractStream(
+ StorageBase& rStrg,
+ const OUString& rStrgPath,
+ const OUString& rStrmName,
+ const OUString& rSysFileName );
+ void extractStorage(
+ const StorageRef& rxStrg,
+ const OUString& rStrgPath,
+ const OUString& rSysPath );
+
+ void extractItem(
+ const StorageRef& rxStrg,
+ const OUString& rStrgPath,
+ const OUString& rItemName,
+ const OUString& rSysPath,
+ bool bIsStrg, bool bIsStrm );
+
+private:
+ struct PreferredItem
+ {
+ OUString maName;
+ bool mbStorage;
+
+ inline explicit PreferredItem( const OUString rName, bool bStorage ) :
+ maName( rName ), mbStorage( bStorage ) {}
+ };
+ typedef ::std::vector< PreferredItem > PreferredItemVector;
+
+ StorageRef mxStrg;
+ OUString maSysPath;
+ PreferredItemVector maPreferred;
+};
+
+typedef ::boost::shared_ptr< StorageObjectBase > StorageObjectRef;
+
+// ============================================================================
+// ============================================================================
+
+class OutputObjectBase : public ObjectBase
+{
+public:
+ virtual ~OutputObjectBase();
+
+ // ------------------------------------------------------------------------
+protected:
+ inline explicit OutputObjectBase() {}
+
+ using ObjectBase::construct;
+ void construct( const ObjectBase& rParent, const OUString& rSysFileName );
+ void construct( const OutputObjectBase& rParent );
+
+ virtual bool implIsValid() const;
+
+ // ------------------------------------------------------------------------
+
+ void writeEmptyItem( const String& rName );
+ void writeInfoItem( const String& rName, const String& rData );
+ void writeCharItem( const String& rName, sal_Unicode cData );
+ void writeStringItem( const String& rName, const OUString& rData );
+ void writeArrayItem( const String& rName, const sal_uInt8* pnData, sal_Size nSize, sal_Unicode cSep = OOX_DUMP_LISTSEP );
+ void writeDateTimeItem( const String& rName, const ::com::sun::star::util::DateTime& rDateTime );
+ void writeGuidItem( const String& rName, const OUString& rGuid );
+
+ template< typename Type >
+ void addNameToItem( Type nData, const NameListWrapper& rListWrp );
+
+ template< typename Type >
+ void writeNameItem( const String& rName, Type nData, const NameListWrapper& rListWrp );
+ template< typename Type >
+ void writeDecItem( const String& rName, Type nData, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type >
+ void writeHexItem( const String& rName, Type nData, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type >
+ void writeShortHexItem( const String& rName, Type nData, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type >
+ void writeBinItem( const String& rName, Type nData, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type >
+ void writeFixItem( const String& rName, Type nData, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type >
+ void writeDecBoolItem( const String& rName, Type nData, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type >
+ void writeValueItem( const String& rName, Type nData, FormatType eFmtType, const NameListWrapper& rListWrp = NO_LIST );
+
+ template< typename Type >
+ void writeValueItem( const ItemFormat& rItemFmt, Type nData );
+
+ template< typename Type >
+ void writeDecPairItem( const String& rName, Type nData1, Type nData2, sal_Unicode cSep = ',' );
+ template< typename Type >
+ void writeHexPairItem( const String& rName, Type nData1, Type nData2, sal_Unicode cSep = ',' );
+
+protected:
+ OutputRef mxOut;
+ OUString maSysFileName;
+};
+
+typedef ::boost::shared_ptr< OutputObjectBase > OutputObjectRef;
+
+// ----------------------------------------------------------------------------
+
+template< typename Type >
+void OutputObjectBase::addNameToItem( Type nData, const NameListWrapper& rListWrp )
+{
+ if( !rListWrp.isEmpty() )
+ {
+ mxOut->contItem();
+ mxOut->writeName( cfg(), nData, rListWrp );
+ }
+}
+
+template< typename Type >
+void OutputObjectBase::writeNameItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
+{
+ ItemGuard aItem( mxOut, rName );
+ mxOut->writeName( cfg(), nData, rListWrp );
+}
+
+template< typename Type >
+void OutputObjectBase::writeDecItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
+{
+ ItemGuard aItem( mxOut, rName );
+ mxOut->writeDec( nData );
+ addNameToItem( nData, rListWrp );
+}
+
+template< typename Type >
+void OutputObjectBase::writeHexItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
+{
+ ItemGuard aItem( mxOut, rName );
+ mxOut->writeHex( nData );
+ addNameToItem( nData, rListWrp );
+}
+
+template< typename Type >
+void OutputObjectBase::writeShortHexItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
+{
+ ItemGuard aItem( mxOut, rName );
+ mxOut->writeShortHex( nData );
+ addNameToItem( nData, rListWrp );
+}
+
+template< typename Type >
+void OutputObjectBase::writeBinItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
+{
+ ItemGuard aItem( mxOut, rName );
+ mxOut->writeBin( nData );
+ addNameToItem( nData, rListWrp );
+}
+
+template< typename Type >
+void OutputObjectBase::writeFixItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
+{
+ ItemGuard aItem( mxOut, rName );
+ mxOut->writeFix( nData );
+ addNameToItem( nData, rListWrp );
+}
+
+template< typename Type >
+void OutputObjectBase::writeDecBoolItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
+{
+ ItemGuard aItem( mxOut, rName );
+ mxOut->writeDec( nData );
+ aItem.cont();
+ mxOut->writeBool( nData != 0 );
+ addNameToItem( nData, rListWrp );
+}
+
+template< typename Type >
+void OutputObjectBase::writeValueItem( const String& rName, Type nData, FormatType eFmtType, const NameListWrapper& rListWrp )
+{
+ if( eFmtType == FORMATTYPE_BOOL )
+ writeDecBoolItem( rName, nData, rListWrp );
+ else
+ {
+ ItemGuard aItem( mxOut, rName );
+ mxOut->writeValue( nData, eFmtType );
+ addNameToItem( nData, rListWrp );
+ }
+}
+
+template< typename Type >
+void OutputObjectBase::writeValueItem( const ItemFormat& rItemFmt, Type nData )
+{
+ OString aNameUtf8 = StringHelper::convertToUtf8( rItemFmt.maItemName );
+ writeValueItem( aNameUtf8.getStr(), nData, rItemFmt.meFmtType, rItemFmt.maListName );
+}
+
+template< typename Type >
+void OutputObjectBase::writeDecPairItem( const String& rName, Type nData1, Type nData2, sal_Unicode cSep )
+{
+ ItemGuard aItem( mxOut, rName );
+ mxOut->writeDec( nData1 );
+ mxOut->writeChar( cSep );
+ mxOut->writeDec( nData2 );
+}
+
+template< typename Type >
+void OutputObjectBase::writeHexPairItem( const String& rName, Type nData1, Type nData2, sal_Unicode cSep )
+{
+ ItemGuard aItem( mxOut, rName );
+ mxOut->writeHex( nData1 );
+ mxOut->writeChar( cSep );
+ mxOut->writeHex( nData2 );
+}
+
+// ============================================================================
+// ============================================================================
+
+class InputObjectBase : public OutputObjectBase
+{
+public:
+ virtual ~InputObjectBase();
+
+ // ------------------------------------------------------------------------
+protected:
+ inline explicit InputObjectBase() {}
+
+ using OutputObjectBase::construct;
+ void construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName );
+ void construct( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm );
+ void construct( const InputObjectBase& rParent );
+
+ virtual bool implIsValid() const;
+
+ // ------------------------------------------------------------------------
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ getXInputStream() const;
+
+ // ------------------------------------------------------------------------
+
+ void skipBlock( sal_Int64 nBytes, bool bShowSize = true );
+ void dumpRawBinary( sal_Int64 nBytes, bool bShowOffset = true, bool bStream = false );
+
+ void dumpBinary( const String& rName, sal_Int64 nBytes, bool bShowOffset = true );
+ void dumpRemaining( sal_Int64 nBytes );
+ void dumpRemainingTo( sal_Int64 nPos );
+ void dumpRemainingStream();
+
+ void dumpArray( const String& rName, sal_Int32 nBytes, sal_Unicode cSep = OOX_DUMP_LISTSEP );
+ inline void dumpUnused( sal_Int32 nBytes ) { dumpArray( OOX_DUMP_UNUSED, nBytes ); }
+ inline void dumpUnknown( sal_Int32 nBytes ) { dumpArray( OOX_DUMP_UNKNOWN, nBytes ); }
+
+ sal_Unicode dumpUnicode( const String& rName );
+
+ OUString dumpCharArray( const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc, bool bHideTrailingNul = false );
+ OUString dumpUnicodeArray( const String& rName, sal_Int32 nLen, bool bHideTrailingNul = false );
+
+ ::com::sun::star::util::DateTime dumpFileTime( const String& rName = EMPTY_STRING );
+ OUString dumpGuid( const String& rName = EMPTY_STRING );
+
+ void dumpItem( const ItemFormat& rItemFmt );
+
+ template< typename Type >
+ Type dumpName( const String& rName, const NameListWrapper& rListWrp );
+ template< typename Type >
+ Type dumpDec( const String& rName, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type >
+ Type dumpHex( const String& rName, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type >
+ Type dumpBin( const String& rName, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type >
+ Type dumpFix( const String& rName, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type >
+ Type dumpBool( const String& rName, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type >
+ Type dumpValue( const ItemFormat& rItemFmt );
+
+ template< typename Type1, typename Type2 >
+ Type1 dumpName( bool bType1, const String& rName, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type1, typename Type2 >
+ Type1 dumpDec( bool bType1, const String& rName, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type1, typename Type2 >
+ Type1 dumpHex( bool bType1, const String& rName, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type1, typename Type2 >
+ Type1 dumpBin( bool bType1, const String& rName, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type1, typename Type2 >
+ Type1 dumpFix( bool bType1, const String& rName, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type1, typename Type2 >
+ Type1 dumpBool( bool bType1, const String& rName, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type1, typename Type2 >
+ Type1 dumpValue( bool bType1, const ItemFormat& rItemFmt );
+
+ template< typename Type >
+ void dumpDecPair( const String& rName, sal_Unicode cSep = ',' );
+ template< typename Type >
+ void dumpHexPair( const String& rName, sal_Unicode cSep = ',' );
+
+protected:
+ BinaryInputStreamRef mxStrm;
+};
+
+typedef ::boost::shared_ptr< InputObjectBase > InputObjectRef;
+
+// ----------------------------------------------------------------------------
+
+template< typename Type >
+Type InputObjectBase::dumpName( const String& rName, const NameListWrapper& rListWrp )
+{
+ Type nData;
+ *mxStrm >> nData;
+ writeNameItem( rName, nData, rListWrp );
+ return nData;
+}
+
+template< typename Type >
+Type InputObjectBase::dumpDec( const String& rName, const NameListWrapper& rListWrp )
+{
+ Type nData;
+ *mxStrm >> nData;
+ writeDecItem( rName, nData, rListWrp );
+ return nData;
+}
+
+template< typename Type >
+Type InputObjectBase::dumpHex( const String& rName, const NameListWrapper& rListWrp )
+{
+ Type nData;
+ *mxStrm >> nData;
+ writeHexItem( rName, nData, rListWrp );
+ return nData;
+}
+
+template< typename Type >
+Type InputObjectBase::dumpBin( const String& rName, const NameListWrapper& rListWrp )
+{
+ Type nData;
+ *mxStrm >> nData;
+ writeBinItem( rName, nData, rListWrp );
+ return nData;
+}
+
+template< typename Type >
+Type InputObjectBase::dumpFix( const String& rName, const NameListWrapper& rListWrp )
+{
+ Type nData;
+ *mxStrm >> nData;
+ writeFixItem( rName, nData, rListWrp );
+ return nData;
+}
+
+template< typename Type >
+Type InputObjectBase::dumpBool( const String& rName, const NameListWrapper& rListWrp )
+{
+ Type nData;
+ *mxStrm >> nData;
+ writeDecBoolItem( rName, nData, rListWrp );
+ return nData;
+}
+
+template< typename Type >
+Type InputObjectBase::dumpValue( const ItemFormat& rItemFmt )
+{
+ Type nData;
+ *mxStrm >> nData;
+ writeValueItem( rItemFmt, nData );
+ return nData;
+}
+
+template< typename Type1, typename Type2 >
+Type1 InputObjectBase::dumpName( bool bType1, const String& rName, const NameListWrapper& rListWrp )
+{
+ return bType1 ? dumpName< Type1 >( rName, rListWrp ) : static_cast< Type1 >( dumpName< Type2 >( rName, rListWrp ) );
+}
+
+template< typename Type1, typename Type2 >
+Type1 InputObjectBase::dumpDec( bool bType1, const String& rName, const NameListWrapper& rListWrp )
+{
+ return bType1 ? dumpDec< Type1 >( rName, rListWrp ) : static_cast< Type1 >( dumpDec< Type2 >( rName, rListWrp ) );
+}
+
+template< typename Type1, typename Type2 >
+Type1 InputObjectBase::dumpHex( bool bType1, const String& rName, const NameListWrapper& rListWrp )
+{
+ return bType1 ? dumpHex< Type1 >( rName, rListWrp ) : static_cast< Type1 >( dumpHex< Type2 >( rName, rListWrp ) );
+}
+
+template< typename Type1, typename Type2 >
+Type1 InputObjectBase::dumpBin( bool bType1, const String& rName, const NameListWrapper& rListWrp )
+{
+ return bType1 ? dumpBin< Type1 >( rName, rListWrp ) : static_cast< Type1 >( dumpBin< Type2 >( rName, rListWrp ) );
+}
+
+template< typename Type1, typename Type2 >
+Type1 InputObjectBase::dumpFix( bool bType1, const String& rName, const NameListWrapper& rListWrp )
+{
+ return bType1 ? dumpFix< Type1 >( rName, rListWrp ) : static_cast< Type1 >( dumpFix< Type2 >( rName, rListWrp ) );
+}
+
+template< typename Type1, typename Type2 >
+Type1 InputObjectBase::dumpBool( bool bType1, const String& rName, const NameListWrapper& rListWrp )
+{
+ return bType1 ? dumpBool< Type1 >( rName, rListWrp ) : static_cast< Type1 >( dumpBool< Type2 >( rName, rListWrp ) );
+}
+
+template< typename Type1, typename Type2 >
+Type1 InputObjectBase::dumpValue( bool bType1, const ItemFormat& rItemFmt )
+{
+ return bType1 ? dumpValue< Type1 >( rItemFmt ) : static_cast< Type1 >( dumpValue< Type2 >( rItemFmt ) );
+}
+
+template< typename Type >
+void InputObjectBase::dumpDecPair( const String& rName, sal_Unicode cSep )
+{
+ Type nData1, nData2;
+ *mxStrm >> nData1 >> nData2;
+ writeDecPairItem( rName, nData1, nData2, cSep );
+}
+
+template< typename Type >
+void InputObjectBase::dumpHexPair( const String& rName, sal_Unicode cSep )
+{
+ Type nData1, nData2;
+ *mxStrm >> nData1 >> nData2;
+ writeHexPairItem( rName, nData1, nData2, cSep );
+}
+
+// ============================================================================
+// ============================================================================
+
+class BinaryStreamObject : public InputObjectBase
+{
+public:
+ explicit BinaryStreamObject(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const OUString& rSysFileName );
+
+protected:
+ void dumpBinaryStream( bool bShowOffset = true );
+
+ virtual void implDump();
+};
+
+// ============================================================================
+// ============================================================================
+
+class TextStreamObjectBase : public InputObjectBase
+{
+protected:
+ inline TextStreamObjectBase() {}
+
+ using InputObjectBase::construct;
+ void construct(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ rtl_TextEncoding eTextEnc,
+ const OUString& rSysFileName );
+ void construct(
+ const OutputObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ rtl_TextEncoding eTextEnc );
+
+ virtual bool implIsValid() const;
+ virtual void implDump();
+
+ virtual void implDumpText( TextInputStream& rTextStrm ) = 0;
+
+private:
+ void constructTextStrmObj( rtl_TextEncoding eTextEnc );
+
+protected:
+ ::boost::shared_ptr< TextInputStream > mxTextStrm;
+};
+
+// ============================================================================
+
+class TextLineStreamObject : public TextStreamObjectBase
+{
+public:
+ explicit TextLineStreamObject(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ rtl_TextEncoding eTextEnc,
+ const OUString& rSysFileName );
+
+ explicit TextLineStreamObject(
+ const OutputObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ rtl_TextEncoding eTextEnc );
+
+protected:
+ virtual void implDumpText( TextInputStream& rTextStrm );
+ virtual void implDumpLine( const OUString& rLine, sal_uInt32 nLine );
+};
+
+// ============================================================================
+
+class XmlStreamObject : public TextStreamObjectBase
+{
+public:
+ explicit XmlStreamObject(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const OUString& rSysFileName );
+
+protected:
+ virtual void implDumpText( TextInputStream& rTextStrm );
+};
+
+// ============================================================================
+// ============================================================================
+
+class RecordObjectBase : public InputObjectBase
+{
+protected:
+ inline explicit RecordObjectBase() {}
+
+ using InputObjectBase::construct;
+ void construct(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxBaseStrm,
+ const OUString& rSysFileName,
+ const BinaryInputStreamRef& rxRecStrm,
+ const String& rRecNames,
+ const String& rSimpleRecs = EMPTY_STRING );
+
+ inline sal_Int64 getRecPos() const { return mnRecPos; }
+ inline sal_Int64 getRecId() const { return mnRecId; }
+ inline sal_Int64 getRecSize() const { return mnRecSize; }
+ inline NameListRef getRecNames() const { return maRecNames.getNameList( cfg() ); }
+
+ inline void setBinaryOnlyMode( bool bBinaryOnly ) { mbBinaryOnly = bBinaryOnly; }
+ inline bool isBinaryOnlyMode() const { return mbBinaryOnly; }
+
+ virtual bool implIsValid() const;
+ virtual void implDump();
+
+ virtual bool implStartRecord( BinaryInputStream& rBaseStrm, sal_Int64& ornRecPos, sal_Int64& ornRecId, sal_Int64& ornRecSize ) = 0;
+ virtual void implWriteExtHeader();
+ virtual void implDumpRecordBody();
+
+private:
+ void constructRecObjBase(
+ const BinaryInputStreamRef& rxBaseStrm,
+ const String& rRecNames,
+ const String& rSimpleRecs );
+
+ void writeHeader();
+
+private:
+ BinaryInputStreamRef mxBaseStrm;
+ NameListWrapper maRecNames;
+ NameListWrapper maSimpleRecs;
+ sal_Int64 mnRecPos;
+ sal_Int64 mnRecId;
+ sal_Int64 mnRecSize;
+ bool mbShowRecPos;
+ bool mbBinaryOnly;
+};
+
+// ============================================================================
+
+class SequenceRecordObjectBase : public RecordObjectBase
+{
+protected:
+ inline explicit SequenceRecordObjectBase() : mxRecData( new StreamDataSequence ) {}
+
+ inline StreamDataSequence& getRecordDataSequence() { return *mxRecData; }
+
+ using RecordObjectBase::construct;
+ void construct(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxBaseStrm,
+ const OUString& rSysFileName,
+ const String& rRecNames,
+ const String& rSimpleRecs = EMPTY_STRING );
+
+ virtual bool implStartRecord( BinaryInputStream& rBaseStrm, sal_Int64& ornRecPos, sal_Int64& ornRecId, sal_Int64& ornRecSize );
+ virtual bool implReadRecordHeader( BinaryInputStream& rBaseStrm, sal_Int64& ornRecId, sal_Int64& ornRecSize ) = 0;
+
+private:
+ typedef ::boost::shared_ptr< StreamDataSequence > StreamDataSeqRef;
+ StreamDataSeqRef mxRecData;
+};
+
+// ============================================================================
+// ============================================================================
+
+/** Base class for a file dumper. Derived classes implement the implDump()
+ function to add functionality.
+ */
+class DumperBase : public ObjectBase
+{
+public:
+ virtual ~DumperBase();
+
+ bool isImportEnabled() const;
+ bool isImportCancelled() const;
+
+protected:
+ inline explicit DumperBase() {}
+
+ using ObjectBase::construct;
+ void construct( const ConfigRef& rxConfig );
+};
+
+// ============================================================================
+// ============================================================================
+
+} // namespace dump
+} // namespace oox
+
+#define OOX_DUMP_FILE( DumperClassName ) \
+do { \
+ DumperClassName aDumper( *this ); \
+ aDumper.dump(); \
+ bool bCancelled = aDumper.isImportCancelled(); \
+ if( !aDumper.isImportEnabled() || bCancelled ) \
+ return aDumper.isValid() && !bCancelled; \
+} while( false )
+
+#else // OOX_INCLUDE_DUMPER
+
+#define OOX_DUMP_FILE( DumperClassName ) (void)0
+
+#endif // OOX_INCLUDE_DUMPER
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/dump/oledumper.hxx b/include/oox/dump/oledumper.hxx
new file mode 100644
index 000000000000..b58500ef8f3c
--- /dev/null
+++ b/include/oox/dump/oledumper.hxx
@@ -0,0 +1,905 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_DUMP_OLEDUMPER_HXX
+#define OOX_DUMP_OLEDUMPER_HXX
+
+#include "oox/helper/storagebase.hxx"
+#include "oox/dump/dumperbase.hxx"
+
+#if OOX_INCLUDE_DUMPER
+
+namespace com { namespace sun { namespace star {
+ namespace io { class XInputStream; }
+} } }
+
+namespace oox {
+namespace dump {
+
+// ============================================================================
+// ============================================================================
+
+class OleInputObjectBase : public InputObjectBase
+{
+protected:
+ inline explicit OleInputObjectBase() {}
+
+ OUString dumpAnsiString32( const String& rName );
+ OUString dumpUniString32( const String& rName );
+
+ sal_Int32 dumpStdClipboardFormat( const String& rName = EMPTY_STRING );
+ OUString dumpAnsiString32OrStdClip( const String& rName );
+ OUString dumpUniString32OrStdClip( const String& rName );
+
+ void writeOleColorItem( const String& rName, sal_uInt32 nColor );
+ sal_uInt32 dumpOleColor( const String& rName );
+};
+
+// ============================================================================
+// ============================================================================
+
+class StdFontObject : public OleInputObjectBase
+{
+public:
+ explicit StdFontObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDump();
+};
+
+// ============================================================================
+
+class StdPicObject : public OleInputObjectBase
+{
+public:
+ explicit StdPicObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDump();
+};
+
+// ============================================================================
+// ============================================================================
+
+class OleStreamObject : public OleInputObjectBase
+{
+public:
+ explicit OleStreamObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName );
+};
+
+// ============================================================================
+
+class OleCompObjObject : public OleStreamObject
+{
+public:
+ explicit OleCompObjObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName );
+
+protected:
+ virtual void implDump();
+};
+
+// ============================================================================
+// ============================================================================
+
+class OlePropertyStreamObject : public InputObjectBase
+{
+public:
+ explicit OlePropertyStreamObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName );
+
+protected:
+ virtual void implDump();
+
+private:
+ void dumpSection( const OUString& rGuid, sal_uInt32 nStartPos );
+
+ void dumpProperty( sal_Int32 nPropId, sal_uInt32 nStartPos );
+ void dumpCodePageProperty( sal_uInt32 nStartPos );
+ void dumpDictionaryProperty( sal_uInt32 nStartPos );
+
+ sal_uInt16 dumpPropertyContents( sal_Int32 nPropId );
+ void dumpPropertyValue( sal_Int32 nPropId, sal_uInt16 nBaseType );
+ void dumpPropertyVector( sal_Int32 nPropId, sal_uInt16 nBaseType );
+ void dumpPropertyArray( sal_Int32 nPropId, sal_uInt16 nBaseType );
+
+ sal_uInt16 dumpPropertyType();
+ void dumpBlob( sal_Int32 nPropId, const String& rName );
+ OUString dumpString8( const String& rName );
+ OUString dumpCharArray8( const String& rName, sal_Int32 nLen );
+ OUString dumpString16( const String& rName );
+ OUString dumpCharArray16( const String& rName, sal_Int32 nLen );
+ bool dumpTypedProperty( const String& rName, sal_uInt16 nExpectedType );
+ void dumpHlinks( sal_Int32 nSize );
+
+ bool startElement( sal_uInt32 nStartPos );
+ void writeSectionHeader( const OUString& rGuid, sal_uInt32 nStartPos );
+ void writePropertyHeader( sal_Int32 nPropId, sal_uInt32 nStartPos );
+
+private:
+ NameListRef mxPropIds;
+ rtl_TextEncoding meTextEnc;
+ bool mbIsUnicode;
+};
+
+// ============================================================================
+
+class OleStorageObject : public StorageObjectBase
+{
+public:
+ explicit OleStorageObject( const ObjectBase& rParent, const StorageRef& rxStrg, const OUString& rSysPath );
+
+protected:
+ inline explicit OleStorageObject() {}
+
+ using StorageObjectBase::construct;
+ void construct( const ObjectBase& rParent, const StorageRef& rxStrg, const OUString& rSysPath );
+
+ virtual void implDumpStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
+ const OUString& rStrgPath,
+ const OUString& rStrmName,
+ const OUString& rSysFileName );
+};
+
+// ============================================================================
+// ============================================================================
+
+class ComCtlObjectBase : public OleInputObjectBase
+{
+protected:
+ explicit ComCtlObjectBase(
+ const InputObjectBase& rParent,
+ sal_uInt32 nDataId5, sal_uInt32 nDataId6, sal_uInt16 nVersion,
+ bool bCommonPart, bool bComplexPart );
+
+ virtual void implDump();
+ virtual void implDumpProperties() = 0;
+ virtual void implDumpCommonExtra( sal_Int64 nEndPos );
+ virtual void implDumpCommonTrailing();
+
+private:
+ bool dumpComCtlHeader( sal_uInt32 nExpId, sal_uInt16 nExpMajor = SAL_MAX_UINT16, sal_uInt16 nExpMinor = SAL_MAX_UINT16 );
+ bool dumpComCtlSize();
+ bool dumpComCtlData( sal_uInt32& ornCommonPartSize );
+ bool dumpComCtlCommon( sal_uInt32 nPartSize );
+ bool dumpComCtlComplex();
+
+protected:
+ sal_uInt32 mnDataId5;
+ sal_uInt32 mnDataId6;
+ sal_uInt16 mnVersion;
+ bool mbCommonPart;
+ bool mbComplexPart;
+};
+
+// ============================================================================
+
+class ComCtlScrollBarObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlScrollBarObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+};
+
+// ============================================================================
+
+class ComCtlProgressBarObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlProgressBarObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+};
+
+// ============================================================================
+
+class ComCtlSliderObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlSliderObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+};
+
+// ============================================================================
+
+class ComCtlUpDownObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlUpDownObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+};
+
+// ============================================================================
+
+class ComCtlImageListObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlImageListObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+ virtual void implDumpCommonExtra( sal_Int64 nEndPos );
+ virtual void implDumpCommonTrailing();
+};
+
+// ============================================================================
+
+class ComCtlTabStripObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlTabStripObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+ virtual void implDumpCommonExtra( sal_Int64 nEndPos );
+};
+
+// ============================================================================
+
+class ComCtlTreeViewObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlTreeViewObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+ virtual void implDumpCommonExtra( sal_Int64 nEndPos );
+
+private:
+ sal_uInt32 mnStringFlags;
+};
+
+// ============================================================================
+
+class ComCtlStatusBarObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlStatusBarObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+ virtual void implDumpCommonExtra( sal_Int64 nEndPos );
+ virtual void implDumpCommonTrailing();
+};
+
+// ============================================================================
+// ============================================================================
+
+class AxPropertyObjectBase : public OleInputObjectBase
+{
+protected:
+ inline explicit AxPropertyObjectBase() {}
+
+ using OleInputObjectBase::construct;
+ void construct(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const OUString& rSysFileName,
+ const String& rPropNameList,
+ bool b64BitPropFlags = false );
+ void construct(
+ const InputObjectBase& rParent,
+ const String& rPropNameList,
+ bool b64BitPropFlags = false );
+
+ virtual bool implIsValid() const;
+ virtual void implDump();
+
+ virtual void implDumpShortProperties();
+ virtual void implDumpExtended();
+
+ bool ensureValid( bool bCondition = true );
+
+ template< typename Type >
+ void alignInput();
+
+ void setAlignAnchor();
+ bool startNextProperty();
+ OUString getPropertyName() const;
+
+ template< typename Type >
+ Type dumpDecProperty( Type nDefault, const NameListWrapper& rListWrp = NO_LIST );
+ template< typename Type >
+ Type dumpHexProperty( Type nDefault, const NameListWrapper& rListWrp = NO_LIST );
+
+ inline bool dumpBoolProperty() { return startNextProperty(); }
+ inline sal_Int32 dumpHmmProperty() { return dumpDecProperty< sal_Int32 >( 0, "CONV-HMM-TO-CM" ); }
+ inline sal_uInt8 dumpMousePtrProperty() { return dumpDecProperty< sal_uInt8 >( 0, "OLE-MOUSEPTR" ); }
+ template< typename Type >
+ inline Type dumpBorderStyleProperty( Type nDefault ) { return dumpDecProperty< Type >( nDefault, "AX-BORDERSTYLE" ); }
+ template< typename Type >
+ inline Type dumpSpecialEffectProperty( Type nDefault ) { return dumpDecProperty< Type >( nDefault, "AX-SPECIALEFFECT" ); }
+ inline sal_uInt32 dumpEnabledProperty() { return dumpDecProperty< sal_uInt32 >( 1, "AX-ENABLED" ); }
+ inline sal_Int32 dumpOrientationProperty() { return dumpDecProperty< sal_Int32 >( -1, "AX-ORIENTATION" ); }
+ inline sal_Int32 dumpDelayProperty() { return dumpDecProperty< sal_Int32 >( 50, "AX-CONV-MS" ); }
+ inline sal_uInt32 dumpImagePosProperty() { return dumpHexProperty< sal_uInt32 >( 0x00070001, "AX-IMAGEPOS" ); }
+ inline sal_uInt8 dumpImageSizeModeProperty() { return dumpDecProperty< sal_uInt8 >( 0, "AX-IMAGESIZEMODE" ); }
+ inline sal_uInt8 dumpImageAlignProperty() { return dumpDecProperty< sal_uInt8 >( 2, "AX-IMAGEALIGN" ); }
+
+ sal_uInt32 dumpFlagsProperty( sal_uInt32 nDefault, const sal_Char* pcNameList = "AX-FLAGS" );
+ sal_uInt32 dumpColorProperty( sal_uInt32 nDefault );
+ sal_Unicode dumpUnicodeProperty();
+ void dumpUnknownProperty();
+
+ void dumpPosProperty();
+ void dumpSizeProperty();
+ void dumpGuidProperty( OUString* pValue = 0 );
+ void dumpStringProperty( OUString* pValue = 0 );
+ void dumpStringArrayProperty();
+ void dumpStreamProperty();
+
+ void dumpEmbeddedFont();
+ void dumpToPosition( sal_Int64 nPos );
+
+private:
+ void constructAxPropObj( const String& rPropNameList, bool b64BitPropFlags );
+
+ void dumpVersion();
+ OUString dumpString( const String& rName, sal_uInt32 nSize, bool bArray );
+ void dumpShortProperties();
+ void dumpLargeProperties();
+
+private:
+ struct LargeProperty
+ {
+ enum LargePropertyType { PROPTYPE_POS, PROPTYPE_SIZE, PROPTYPE_GUID, PROPTYPE_STRING, PROPTYPE_STRINGARRAY };
+
+ LargePropertyType mePropType;
+ OUString maItemName;
+ sal_uInt32 mnDataSize;
+ OUString* mpItemValue;
+ inline explicit LargeProperty( LargePropertyType ePropType, const String& rItemName, sal_uInt32 nDataSize, OUString* pItemValue = 0 ) :
+ mePropType( ePropType ), maItemName( rItemName ), mnDataSize( nDataSize ), mpItemValue( pItemValue ) {}
+ };
+ typedef ::std::vector< LargeProperty > LargePropertyVector;
+
+ struct StreamProperty
+ {
+ OUString maItemName;
+ sal_uInt16 mnData;
+ inline explicit StreamProperty( const String& rItemName, sal_uInt16 nData ) :
+ maItemName( rItemName ), mnData( nData ) {}
+ };
+ typedef ::std::vector< StreamProperty > StreamPropertyVector;
+
+ LargePropertyVector maLargeProps;
+ StreamPropertyVector maStreamProps;
+ NameListRef mxPropNames;
+ sal_Int64 mnPropertiesStart;
+ sal_Int64 mnPropertiesEnd;
+ sal_Int64 mnPropFlags;
+ sal_Int64 mnCurrProp;
+ bool mb64BitPropFlags;
+ bool mbValid;
+};
+
+// ----------------------------------------------------------------------------
+
+template< typename Type >
+void AxPropertyObjectBase::alignInput()
+{
+ mxStrm->skip( (sizeof( Type ) - ((mxStrm->tell() - mnPropertiesStart) % sizeof( Type ))) % sizeof( Type ) );
+}
+
+template< typename Type >
+Type AxPropertyObjectBase::dumpDecProperty( Type nDefault, const NameListWrapper& rListWrp )
+{
+ if( startNextProperty() )
+ {
+ alignInput< Type >();
+ return dumpDec< Type >( getPropertyName(), rListWrp );
+ }
+ return nDefault;
+}
+
+template< typename Type >
+Type AxPropertyObjectBase::dumpHexProperty( Type nDefault, const NameListWrapper& rListWrp )
+{
+ if( startNextProperty() )
+ {
+ alignInput< Type >();
+ return dumpHex< Type >( getPropertyName(), rListWrp );
+ }
+ return nDefault;
+}
+
+// ============================================================================
+
+class AxCFontNewObject : public AxPropertyObjectBase
+{
+public:
+ explicit AxCFontNewObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDumpShortProperties();
+};
+
+// ============================================================================
+
+class AxColumnInfoObject : public AxPropertyObjectBase
+{
+public:
+ explicit AxColumnInfoObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDumpShortProperties();
+};
+
+// ============================================================================
+
+class AxCommandButtonObject : public AxPropertyObjectBase
+{
+public:
+ explicit AxCommandButtonObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDumpShortProperties();
+ virtual void implDumpExtended();
+};
+
+// ============================================================================
+
+class AxMorphControlObject : public AxPropertyObjectBase
+{
+public:
+ explicit AxMorphControlObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDumpShortProperties();
+ virtual void implDumpExtended();
+
+private:
+ void dumpColumnInfos();
+
+private:
+ sal_uInt16 mnColInfoCount;
+ sal_uInt8 mnCtrlType;
+};
+
+// ============================================================================
+
+class AxLabelObject : public AxPropertyObjectBase
+{
+public:
+ explicit AxLabelObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDumpShortProperties();
+ virtual void implDumpExtended();
+};
+
+// ============================================================================
+
+class AxImageObject : public AxPropertyObjectBase
+{
+public:
+ explicit AxImageObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDumpShortProperties();
+};
+
+// ============================================================================
+
+class AxScrollBarObject : public AxPropertyObjectBase
+{
+public:
+ explicit AxScrollBarObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDumpShortProperties();
+};
+
+// ============================================================================
+
+class AxSpinButtonObject : public AxPropertyObjectBase
+{
+public:
+ explicit AxSpinButtonObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDumpShortProperties();
+};
+
+// ============================================================================
+
+class AxTabStripObject : public AxPropertyObjectBase
+{
+public:
+ explicit AxTabStripObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDumpShortProperties();
+ virtual void implDumpExtended();
+
+private:
+ sal_Int32 mnTabFlagCount;
+};
+
+// ============================================================================
+// ============================================================================
+
+class FormControlStreamObject : public OleInputObjectBase
+{
+public:
+ explicit FormControlStreamObject(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const OUString& rSysFileName,
+ const OUString* pProgId = 0 );
+ explicit FormControlStreamObject(
+ const OutputObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const OUString* pProgId = 0 );
+
+protected:
+ virtual void implDump();
+
+private:
+ void constructFormCtrlStrmObj( const OUString* pProgId );
+
+private:
+ OUString maProgId;
+ bool mbReadGuid;
+};
+
+// ============================================================================
+// ============================================================================
+
+struct VbaFormSiteInfo
+{
+ OUString maProgId;
+ sal_Int32 mnId;
+ sal_uInt32 mnLength;
+ bool mbInStream;
+
+ inline explicit VbaFormSiteInfo() : mnId( 0 ), mnLength( 0 ), mbInStream( false ) {}
+};
+
+typedef ::std::vector< VbaFormSiteInfo > VbaFormSiteInfoVector;
+
+// ============================================================================
+
+struct VbaFormSharedData
+{
+ OUStringVector maClassInfoProgIds;
+ VbaFormSiteInfoVector maSiteInfos;
+};
+
+// ============================================================================
+
+class VbaFormClassInfoObject : public AxPropertyObjectBase
+{
+public:
+ explicit VbaFormClassInfoObject( const InputObjectBase& rParent, VbaFormSharedData& rFormData );
+
+protected:
+ virtual void implDumpShortProperties();
+
+private:
+ VbaFormSharedData& mrFormData;
+};
+
+// ============================================================================
+
+class VbaFormSiteObject : public AxPropertyObjectBase
+{
+public:
+ explicit VbaFormSiteObject( const InputObjectBase& rParent, VbaFormSharedData& rFormData );
+
+protected:
+ virtual void implDumpShortProperties();
+
+private:
+ VbaFormSharedData& mrFormData;
+};
+
+// ============================================================================
+
+class VbaFormDesignExtObject : public AxPropertyObjectBase
+{
+public:
+ explicit VbaFormDesignExtObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDumpShortProperties();
+};
+
+// ============================================================================
+
+class VbaFStreamObject : public AxPropertyObjectBase
+{
+public:
+ explicit VbaFStreamObject(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const OUString& rSysFileName,
+ VbaFormSharedData& rFormData );
+
+protected:
+ virtual void implDumpShortProperties();
+ virtual void implDumpExtended();
+
+private:
+ void dumpClassInfos();
+ void dumpFormSites( sal_uInt32 nCount );
+ void dumpSiteData();
+ void dumpDesignExtender();
+
+private:
+ VbaFormSharedData& mrFormData;
+ sal_uInt32 mnFlags;
+};
+
+// ============================================================================
+
+class VbaOStreamObject : public OleInputObjectBase
+{
+public:
+ explicit VbaOStreamObject(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const OUString& rSysFileName,
+ VbaFormSharedData& rFormData );
+
+protected:
+ virtual void implDump();
+
+private:
+ VbaFormSharedData& mrFormData;
+};
+
+// ============================================================================
+
+class VbaPageObject : public AxPropertyObjectBase
+{
+public:
+ explicit VbaPageObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDumpShortProperties();
+};
+
+// ============================================================================
+
+class VbaMultiPageObject : public AxPropertyObjectBase
+{
+public:
+ explicit VbaMultiPageObject( const InputObjectBase& rParent );
+
+protected:
+ virtual void implDumpShortProperties();
+ virtual void implDumpExtended();
+
+private:
+ sal_Int32 mnPageCount;
+};
+
+// ============================================================================
+
+class VbaXStreamObject : public InputObjectBase
+{
+public:
+ explicit VbaXStreamObject(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const OUString& rSysFileName,
+ VbaFormSharedData& rFormData );
+
+protected:
+ virtual void implDump();
+
+private:
+ VbaFormSharedData& mrFormData;
+};
+
+// ============================================================================
+
+class VbaContainerStorageObject : public OleStorageObject
+{
+public:
+ explicit VbaContainerStorageObject(
+ const ObjectBase& rParent,
+ const StorageRef& rxStrg,
+ const OUString& rSysPath );
+
+protected:
+ virtual void implDumpStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
+ const OUString& rStrgPath,
+ const OUString& rStrmName,
+ const OUString& rSysFileName );
+
+ virtual void implDumpStorage(
+ const StorageRef& rxStrg,
+ const OUString& rStrgPath,
+ const OUString& rSysPath );
+
+private:
+ bool isFormStorage( const OUString& rStrgPath ) const;
+
+private:
+ VbaFormSharedData maFormData;
+};
+
+// ============================================================================
+// ============================================================================
+
+struct VbaSharedData
+{
+ typedef ::std::map< OUString, sal_Int32 > StreamOffsetMap;
+
+ StreamOffsetMap maStrmOffsets;
+ rtl_TextEncoding meTextEnc;
+
+ explicit VbaSharedData();
+
+ bool isModuleStream( const OUString& rStrmName ) const;
+ sal_Int32 getStreamOffset( const OUString& rStrmName ) const;
+};
+
+// ============================================================================
+
+class VbaDirStreamObject : public SequenceRecordObjectBase
+{
+public:
+ explicit VbaDirStreamObject(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const OUString& rSysFileName,
+ VbaSharedData& rVbaData );
+
+protected:
+ virtual bool implIsValid() const;
+ virtual bool implReadRecordHeader( BinaryInputStream& rBaseStrm, sal_Int64& ornRecId, sal_Int64& ornRecSize );
+ virtual void implDumpRecordBody();
+
+private:
+ OUString dumpByteString( const String& rName = EMPTY_STRING );
+ OUString dumpUniString( const String& rName = EMPTY_STRING );
+
+ OUString dumpByteStringWithLength( const String& rName = EMPTY_STRING );
+
+private:
+ VbaSharedData& mrVbaData;
+ BinaryInputStreamRef mxInStrm;
+ OUString maCurrStream;
+ sal_Int32 mnCurrOffset;
+};
+
+// ============================================================================
+
+class VbaModuleStreamObject : public InputObjectBase
+{
+public:
+ explicit VbaModuleStreamObject(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const OUString& rSysFileName,
+ VbaSharedData& rVbaData,
+ sal_Int32 nStrmOffset );
+
+protected:
+ virtual void implDump();
+
+private:
+ VbaSharedData& mrVbaData;
+ sal_Int32 mnStrmOffset;
+};
+
+// ============================================================================
+
+class VbaStorageObject : public OleStorageObject
+{
+public:
+ explicit VbaStorageObject(
+ const ObjectBase& rParent,
+ const StorageRef& rxStrg,
+ const OUString& rSysPath,
+ VbaSharedData& rVbaData );
+
+protected:
+ virtual void implDumpStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
+ const OUString& rStrgPath,
+ const OUString& rStrmName,
+ const OUString& rSysFileName );
+
+private:
+ VbaSharedData& mrVbaData;
+};
+
+// ============================================================================
+
+class VbaFormStorageObject : public VbaContainerStorageObject
+{
+public:
+ explicit VbaFormStorageObject(
+ const ObjectBase& rParent,
+ const StorageRef& rxStrg,
+ const OUString& rSysPath,
+ VbaSharedData& rVbaData );
+
+protected:
+ virtual void implDumpStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
+ const OUString& rStrgPath,
+ const OUString& rStrmName,
+ const OUString& rSysFileName );
+
+private:
+ VbaSharedData& mrVbaData;
+};
+
+// ============================================================================
+
+class VbaProjectStorageObject : public OleStorageObject
+{
+public:
+ explicit VbaProjectStorageObject( const ObjectBase& rParent, const StorageRef& rxStrg, const OUString& rSysPath );
+
+protected:
+ virtual void implDumpStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
+ const OUString& rStrgPath,
+ const OUString& rStrmName,
+ const OUString& rSysFileName );
+
+ virtual void implDumpStorage(
+ const StorageRef& rxStrg,
+ const OUString& rStrgPath,
+ const OUString& rSysPath );
+
+private:
+ VbaSharedData maVbaData;
+};
+
+// ============================================================================
+// ============================================================================
+
+class ActiveXStorageObject : public VbaContainerStorageObject
+{
+public:
+ explicit ActiveXStorageObject(
+ const ObjectBase& rParent,
+ const StorageRef& rxStrg,
+ const OUString& rSysPath );
+
+protected:
+ virtual void implDumpBaseStream(
+ const BinaryInputStreamRef& rxStrm,
+ const OUString& rSysFileName );
+};
+
+// ============================================================================
+// ============================================================================
+
+} // namespace dump
+} // namespace oox
+
+#endif
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/dump/pptxdumper.hxx b/include/oox/dump/pptxdumper.hxx
new file mode 100644
index 000000000000..43f39002059b
--- /dev/null
+++ b/include/oox/dump/pptxdumper.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 OOX_DUMP_PPTXDUMPER_HXX
+#define OOX_DUMP_PPTXDUMPER_HXX
+
+#include "oox/dump/dumperbase.hxx"
+
+#if OOX_INCLUDE_DUMPER
+
+namespace oox {
+namespace dump {
+namespace pptx {
+
+// ============================================================================
+
+class RootStorageObject : public StorageObjectBase
+{
+public:
+ explicit RootStorageObject( const DumperBase& rParent );
+
+protected:
+ virtual void implDumpStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
+ const OUString& rStrgPath,
+ const OUString& rStrmName,
+ const OUString& rSysFileName );
+};
+
+// ============================================================================
+
+class Dumper : public DumperBase
+{
+public:
+ explicit Dumper( const ::oox::core::FilterBase& rFilter );
+
+ explicit Dumper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
+ const OUString& rSysFileName );
+
+protected:
+ virtual void implDump();
+};
+
+// ============================================================================
+
+} // namespace pptx
+} // namespace dump
+} // namespace oox
+
+#endif
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/dump/xlsbdumper.hxx b/include/oox/dump/xlsbdumper.hxx
new file mode 100644
index 000000000000..ffd24d4de808
--- /dev/null
+++ b/include/oox/dump/xlsbdumper.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 OOX_DUMP_XLSBDUMPER_HXX
+#define OOX_DUMP_XLSBDUMPER_HXX
+
+#include "oox/dump/dumperbase.hxx"
+
+#if OOX_INCLUDE_DUMPER
+
+namespace oox { namespace xls {
+ class FontPortionModelList;
+ class PhoneticPortionModelList;
+ struct FunctionInfo;
+ class FunctionProvider;
+} }
+
+namespace oox {
+namespace dump {
+namespace xlsb {
+
+// ============================================================================
+
+class RecordObjectBase : public SequenceRecordObjectBase
+{
+protected:
+ explicit RecordObjectBase();
+ virtual ~RecordObjectBase();
+
+ using SequenceRecordObjectBase::construct;
+ void construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName );
+ void construct( const RecordObjectBase& rParent );
+
+ virtual bool implReadRecordHeader( BinaryInputStream& rBaseStrm, sal_Int64& ornRecId, sal_Int64& ornRecSize );
+
+ OUString getErrorName( sal_uInt8 nErrCode ) const;
+
+ // ------------------------------------------------------------------------
+
+ void readAddress( Address& orAddress );
+ void readRange( Range& orRange );
+ void readRangeList( RangeList& orRanges );
+
+ // ------------------------------------------------------------------------
+
+ void writeBooleanItem( const String& rName, sal_uInt8 nBool );
+ void writeErrorCodeItem( const String& rName, sal_uInt8 nErrCode );
+
+ void writeFontPortions( const ::oox::xls::FontPortionModelList& rPortions );
+ void writePhoneticPortions( const ::oox::xls::PhoneticPortionModelList& rPhonetics );
+
+ // ------------------------------------------------------------------------
+
+ sal_uInt8 dumpBoolean( const String& rName = EMPTY_STRING );
+ sal_uInt8 dumpErrorCode( const String& rName = EMPTY_STRING );
+ OUString dumpString( const String& rName = EMPTY_STRING, bool bRich = false, bool b32BitLen = true );
+ void dumpColor( const String& rName = EMPTY_STRING );
+ ::com::sun::star::util::DateTime dumpPivotDateTime( const String& rName = EMPTY_STRING );
+
+ sal_Int32 dumpColIndex( const String& rName = EMPTY_STRING );
+ sal_Int32 dumpRowIndex( const String& rName = EMPTY_STRING );
+ sal_Int32 dumpColRange( const String& rName = EMPTY_STRING );
+ sal_Int32 dumpRowRange( const String& rName = EMPTY_STRING );
+
+ Address dumpAddress( const String& rName = EMPTY_STRING );
+ Range dumpRange( const String& rName = EMPTY_STRING );
+ void dumpRangeList( const String& rName = EMPTY_STRING );
+
+ // ------------------------------------------------------------------------
+private:
+ bool readCompressedInt( BinaryInputStream& rStrm, sal_Int32& ornValue );
+
+private:
+ typedef ::boost::shared_ptr< SequenceInputStream > SequenceInputStreamRef;
+
+ SequenceInputStreamRef mxBiffStrm;
+ NameListRef mxErrCodes;
+};
+
+// ============================================================================
+
+class RootStorageObject : public StorageObjectBase
+{
+public:
+ explicit RootStorageObject( const DumperBase& rParent );
+
+protected:
+ virtual void implDumpStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
+ const OUString& rStrgPath,
+ const OUString& rStrmName,
+ const OUString& rSysFileName );
+};
+
+// ============================================================================
+
+class Dumper : public DumperBase
+{
+public:
+ explicit Dumper( const ::oox::core::FilterBase& rFilter );
+
+ explicit Dumper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
+ const OUString& rSysFileName );
+
+protected:
+ virtual void implDump();
+};
+
+// ============================================================================
+
+} // namespace xlsb
+} // namespace dump
+} // namespace oox
+
+#endif
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx
new file mode 100644
index 000000000000..10fc8922dc4a
--- /dev/null
+++ b/include/oox/export/chartexport.hxx
@@ -0,0 +1,204 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _OOX_EXPORT_CHART_HXX_
+#define _OOX_EXPORT_CHART_HXX_
+
+#include <oox/dllapi.h>
+#include <com/sun/star/uno/XReference.hpp>
+#include <oox/export/drawingml.hxx>
+#include <oox/token/tokens.hxx>
+#include <sax/fshelper.hxx>
+#include <vcl/mapmod.hxx>
+#include <boost/unordered_map.hpp>
+#include <map>
+
+namespace com { namespace sun { namespace star {
+ namespace chart {
+ class XDiagram;
+ class XChartDocument;
+ class XChartDataArray;
+ struct ChartSeriesAddress;
+ }
+ namespace chart2 {
+ class XDiagram;
+ class XChartDocument;
+ class XDataSeries;
+ class XChartType;
+ namespace data
+ {
+ class XDataProvider;
+ class XDataSequence;
+ }
+ }
+ namespace drawing {
+ class XShape;
+ class XShapes;
+ }
+ namespace task {
+ class XStatusIndicator;
+ }
+ namespace frame {
+ class XModel;
+ }
+}}}
+
+namespace oox { namespace drawingml {
+
+const sal_Int32 AXIS_PRIMARY_X = 1;
+const sal_Int32 AXIS_PRIMARY_Y = 2;
+const sal_Int32 AXIS_PRIMARY_Z = 3;
+const sal_Int32 AXIS_SECONDARY_X = 4;
+const sal_Int32 AXIS_SECONDARY_Y = 5;
+
+struct AxisIdPair{
+ sal_Int32 nAxisType;
+ sal_Int32 nAxisId;
+ sal_Int32 nCrossAx;
+
+ AxisIdPair( sal_Int32 nType, sal_Int32 nId, sal_Int32 nAx ): nAxisType( nType ),nAxisId( nId ),nCrossAx( nAx ) {}
+};
+
+class OOX_DLLPUBLIC ChartExport : public DrawingML {
+
+public:
+ // first: data sequence for label, second: data sequence for values.
+ typedef ::std::vector< AxisIdPair > AxisVector;
+
+private:
+ sal_Int32 mnXmlNamespace;
+ Fraction maFraction;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxChartModel;
+ com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > mxDiagram;
+ com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > mxNewDiagram;
+
+ OUString msTableName;
+ OUStringBuffer msStringBuffer;
+ OUString msString;
+
+ // members filled by InitRangeSegmentationProperties (retrieved from DataProvider)
+ sal_Bool mbHasSeriesLabels;
+ sal_Bool mbHasCategoryLabels; //if the categories are only automatically generated this will be false
+ sal_Bool mbRowSourceColumns;
+ OUString msChartAddress;
+ OUString msTableNumberList;
+ ::com::sun::star::uno::Sequence< sal_Int32 > maSequenceMapping;
+
+ //::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxAdditionalShapes;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > mxCategoriesValues;
+
+ AxisVector maAxes;
+ sal_Bool mbHasXAxis;
+ sal_Bool mbHasYAxis;
+ sal_Bool mbHasZAxis;
+ sal_Bool mbHasSecondaryXAxis;
+ sal_Bool mbHasSecondaryYAxis;
+ sal_Bool mbIs3DChart;
+
+
+private:
+ sal_Int32 getChartType(
+ );
+
+ OUString parseFormula( const OUString& rRange );
+ void InitPlotArea();
+
+ void _ExportContent();
+ void exportChartSpace( com::sun::star::uno::Reference<
+ com::sun::star::chart::XChartDocument > rChartDoc,
+ sal_Bool bIncludeTable );
+ void exportChart( com::sun::star::uno::Reference<
+ com::sun::star::chart::XChartDocument > rChartDoc );
+ void exportLegend( com::sun::star::uno::Reference<
+ com::sun::star::chart::XChartDocument > rChartDoc );
+ void exportTitle( com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape > xShape );
+ void exportPlotArea( );
+
+ void exportAreaChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+ void exportBarChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+ void exportBubbleChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+ void exportDoughnutChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+ void exportLineChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+ void exportOfPieChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+ void exportPieChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+ void exportRadarChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+ void exportScatterChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+ void exportStockChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+ void exportSuffaceChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+
+ void exportSeries( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType, sal_Int32& nAttachedAxis );
+ void exportCandleStickSeries(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries > > & aSeriesSeq,
+ sal_Bool bJapaneseCandleSticks, sal_Int32& nAttachedAxis );
+ void exportSeriesText(
+ const com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xValueSeq );
+ void exportSeriesCategory(
+ const com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xValueSeq );
+ void exportSeriesValues(
+ const com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xValueSeq, sal_Int32 nValueType = XML_val );
+ void exportShapeProps( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropSet );
+ void exportDataPoints(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSeriesProperties,
+ sal_Int32 nSeriesLength );
+ void exportDataLabels(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSeriesProperties,
+ sal_Int32 nSeriesLength );
+ void exportGrouping( sal_Bool isBar = sal_False );
+ void exportMarker();
+ void exportSmooth();
+ void exportFirstSliceAng();
+
+ void exportAxes( );
+ void exportAxis( AxisIdPair aAxisIdPair );
+ void _exportAxis(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xAxisProp,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xAxisTitle,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xMajorGrid,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xMinorGrid,
+ sal_Int32 nAxisType,
+ const char* sAxisPos,
+ AxisIdPair aAxisIdPair );
+ void exportAxesId( sal_Int32 nAttachedAxis );
+ void exportView3D();
+ sal_Bool isDeep3dChart();
+
+public:
+
+ ChartExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX );
+ virtual ~ChartExport() {}
+
+ sal_Int32 GetChartID( );
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getModel(){ return mxChartModel; }
+
+ virtual ChartExport& WriteChartObj( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, sal_Int32 nChartCount );
+
+ void ExportContent();
+ void InitRangeSegmentationProperties(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument > & xChartDoc );
+};
+
+}}
+
+#endif /* ndef _OOX_EXPORT_CHART_HXX_ */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
new file mode 100644
index 000000000000..fa13a49ea090
--- /dev/null
+++ b/include/oox/export/drawingml.hxx
@@ -0,0 +1,160 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _OOX_EXPORT_DRAWINGML_HXX_
+#define _OOX_EXPORT_DRAWINGML_HXX_
+
+#include <oox/dllapi.h>
+#include <sax/fshelper.hxx>
+#include <rtl/strbuf.hxx>
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/uno/XReference.hpp>
+#include <tools/poly.hxx>
+#include <filter/msfilter/escherex.hxx>
+#ifndef PPTX_EXPORT_ROTATE_CLOCKWISIFY
+#define PPTX_EXPORT_ROTATE_CLOCKWISIFY(input) ((21600000-input*600)%21600000)
+#endif
+
+class Graphic;
+class String;
+
+namespace com { namespace sun { namespace star {
+namespace beans {
+ class XPropertySet;
+ class XPropertyState;
+}
+namespace drawing {
+ class XShape;
+}
+namespace style {
+ struct LineSpacing;
+}
+namespace text {
+ class XTextContent;
+ class XTextRange;
+}
+namespace io {
+ class XOutputStream;
+}
+}}}
+
+namespace oox {
+namespace core {
+ class XmlFilterBase;
+}
+
+namespace drawingml {
+
+class OOX_DLLPUBLIC DrawingML {
+public:
+ enum DocumentType { DOCUMENT_DOCX, DOCUMENT_PPTX, DOCUMENT_XLSX };
+
+private:
+ static int mnImageCounter;
+
+ /// To specify where write eg. the images to (like 'ppt', or 'word' - according to the OPC).
+ DocumentType meDocumentType;
+
+protected:
+ ::com::sun::star::uno::Any mAny;
+ ::sax_fastparser::FSHelperPtr mpFS;
+ ::oox::core::XmlFilterBase* mpFB;
+
+ bool GetProperty( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, OUString aName );
+ bool GetPropertyAndState( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState > rXPropState,
+ String aName, ::com::sun::star::beans::PropertyState& eState );
+ const char* GetFieldType( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun, sal_Bool& bIsField );
+
+ OUString WriteImage( const OUString& rURL );
+
+ const char* GetComponentDir();
+ const char* GetRelationCompPrefix();
+
+public:
+ DrawingML( ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX ) : meDocumentType( eDocumentType ), mpFS( pFS ), mpFB( pFB ) {}
+ void SetFS( ::sax_fastparser::FSHelperPtr pFS ) { mpFS = pFS; }
+ ::sax_fastparser::FSHelperPtr GetFS() { return mpFS; }
+ ::oox::core::XmlFilterBase* GetFB() { return mpFB; }
+ DocumentType GetDocumentType() { return meDocumentType; }
+
+ OUString WriteImage( const Graphic &rGraphic );
+
+ void WriteColor( sal_uInt32 nColor );
+ void WriteGradientStop( sal_uInt16 nStop, sal_uInt32 nColor );
+ void WriteLineArrow( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, sal_Bool bLineStart );
+ void WriteConnectorConnections( EscherConnectorListEntry& rConnectorEntry, sal_Int32 nStartID, sal_Int32 nEndID );
+
+ void WriteSolidFill( sal_uInt32 nColor );
+ void WriteSolidFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
+ void WriteGradientFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
+ void WriteBlipFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, OUString sURLPropName, sal_Int32 nXmlNamespace );
+ void WriteBlipFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, OUString sURLPropName );
+ void WriteSrcRect( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >, const OUString& );
+ void WriteOutline( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
+ void WriteStretch();
+ void WriteLinespacing( ::com::sun::star::style::LineSpacing& rLineSpacing );
+
+ OUString WriteBlip( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, OUString& rURL, const Graphic *pGraphic=NULL );
+ void WriteBlipMode( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
+
+ void WriteShapeTransformation( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rXShape,
+ sal_Int32 nXmlNamespace, sal_Bool bFlipH = false, sal_Bool bFlipV = false, sal_Bool bSuppressRotation = false );
+ void WriteTransformation( const Rectangle& rRectangle,
+ sal_Int32 nXmlNamespace, sal_Bool bFlipH = false, sal_Bool bFlipV = false, sal_Int32 nRotation = 0 );
+
+ void WriteText( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > rXIface );
+ void WriteParagraph( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > rParagraph );
+ void WriteParagraphProperties( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > rParagraph );
+ void WriteParagraphNumbering( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
+ sal_Int16 nLevel );
+ void WriteRun( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun );
+ void WriteRunProperties( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rRun, sal_Bool bIsField );
+
+ void WritePresetShape( const char* pShape );
+ void WritePresetShape( const char* pShape, MSO_SPT eShapeType, sal_Bool bPredefinedHandlesUsed, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, const ::com::sun::star::beans::PropertyValue& rProp );
+ void WritePolyPolygon( const PolyPolygon& rPolyPolygon );
+ void WriteFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropSet );
+
+ static void ResetCounters();
+
+ void GetUUID( OStringBuffer& rBuffer );
+
+ static sal_Unicode SubstituteBullet( sal_Unicode cBulletId, ::com::sun::star::awt::FontDescriptor& rFontDesc );
+
+ sal_uInt32 ColorWithIntensity( sal_uInt32 nColor, sal_uInt32 nIntensity );
+
+ static const char* GetAlignment( sal_Int32 nAlignment );
+
+ sax_fastparser::FSHelperPtr CreateOutputStream (
+ const OUString& sFullStream,
+ const OUString& sRelativeStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xParentRelation,
+ const char* sContentType,
+ const char* sRelationshipType,
+ OUString* pRelationshipId = NULL );
+
+};
+
+}
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/export/shapes.hxx b/include/oox/export/shapes.hxx
new file mode 100644
index 000000000000..39b4c0d9ec72
--- /dev/null
+++ b/include/oox/export/shapes.hxx
@@ -0,0 +1,170 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _OOX_EXPORT_SHAPES_HXX_
+#define _OOX_EXPORT_SHAPES_HXX_
+
+#include <oox/dllapi.h>
+#include <com/sun/star/uno/XReference.hpp>
+#include <oox/export/drawingml.hxx>
+#include <sax/fshelper.hxx>
+#include <vcl/mapmod.hxx>
+#include <boost/unordered_map.hpp>
+
+namespace com { namespace sun { namespace star {
+namespace beans {
+ class XPropertySet;
+}
+namespace drawing {
+ class XShape;
+ class XShapes;
+}
+}}}
+
+namespace oox { namespace drawingml {
+
+class OOX_DLLPUBLIC ShapeExport : public DrawingML {
+
+private:
+ static int mnSpreadsheetCounter;
+ struct ShapeCheck
+ {
+ bool operator()( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> s1, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> s2 ) const
+ {
+ return s1 == s2;
+ }
+ };
+
+ struct ShapeHash
+ {
+ size_t operator()( const ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > ) const;
+ };
+
+public:
+ typedef boost::unordered_map< const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>, sal_Int32, ShapeHash, ShapeCheck> ShapeHashMap;
+
+protected:
+ sal_Int32 mnShapeIdMax, mnPictureIdMax;
+
+ void WriteGraphicObjectShapePart( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape, const Graphic *pGraphic=NULL );
+
+private:
+ sal_Int32 mnXmlNamespace;
+ Fraction maFraction;
+ MapMode maMapModeSrc, maMapModeDest;
+
+ ::com::sun::star::awt::Size MapSize( const ::com::sun::star::awt::Size& ) const;
+
+ ShapeHashMap maShapeMap;
+ ShapeHashMap* mpShapeMap;
+
+public:
+
+ ShapeExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, ShapeHashMap* pShapeMap = NULL, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX );
+ virtual ~ShapeExport() {}
+
+ static sal_Bool NonEmptyText( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xIface );
+
+ virtual ShapeExport&
+ WriteBezierShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape, sal_Bool bClosed );
+ virtual ShapeExport&
+ WriteClosedBezierShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ShapeExport&
+ WriteConnectorShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ShapeExport&
+ WriteCustomShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ShapeExport&
+ WriteEllipseShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ShapeExport&
+ WriteGraphicObjectShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ShapeExport&
+ WriteLineShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ShapeExport&
+ WriteNonVisualDrawingProperties( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape, const char* sName );
+ virtual ShapeExport&
+ WriteNonVisualProperties( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ShapeExport&
+ WriteOpenBezierShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ShapeExport&
+ WriteRectangleShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+
+ /**
+ * Write the DrawingML for a particular shape.
+ *
+ * <p>This is the member function you want. It performs the type lookup and
+ * invokes the appropriate corresponding Write*() method for the specific
+ * type.</p>
+ *
+ * <p>To write an XShape, XShape::getShapeType() is called to determine
+ * the shape type, and the corresponding method in this table is
+ * invoked:</p>
+ *
+ * <table>
+ * <tr><th>Shape Type</th><th>Method</th></tr>
+ * <tr><td><tt>com.sun.star.drawing.ClosedBezierShape</tt></td> <td>ShapeExport::WriteClosedBezierShape</td></tr>
+ * <tr><td><tt>com.sun.star.drawing.CustomShape</tt></td> <td>ShapeExport::WriteCustomShape</td></tr>
+ * <tr><td><tt>com.sun.star.drawing.EllipseShape</tt></td> <td>ShapeExport::WriteEllipseShape</td></tr>
+ * <tr><td><tt>com.sun.star.drawing.GraphicObjectShape</tt></td> <td>ShapeExport::WriteGraphicObjectShape</td></tr>
+ * <tr><td><tt>com.sun.star.drawing.LineShape</tt></td> <td>ShapeExport::WriteLineShape</td></tr>
+ * <tr><td><tt>com.sun.star.drawing.OpenBezierShape</tt></td> <td>ShapeExport::WriteOpenBezierShape</td></tr>
+ * <tr><td><tt>com.sun.star.drawing.RectangleShape</tt></td> <td>ShapeExport::WriteRectangleShape</td></tr>
+ * <tr><td><tt>com.sun.star.drawing.TableShape</tt></td> <td>ShapeExport::WriteTableShape</td></tr>
+ * <tr><td><tt>com.sun.star.drawing.TextShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
+ * <tr><td><tt>com.sun.star.presentation.DateTimeShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
+ * <tr><td><tt>com.sun.star.presentation.FooterShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
+ * <tr><td><tt>com.sun.star.presentation.HeaderShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
+ * <tr><td><tt>com.sun.star.presentation.NotesShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
+ * <tr><td><tt>com.sun.star.presentation.OutlinerShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
+ * <tr><td><tt>com.sun.star.presentation.SlideNumberShape</tt></td><td>ShapeExport::WriteTextShape</td></tr>
+ * <tr><td><tt>com.sun.star.presentation.TitleTextShape</tt></td> <td>ShapeExport::WriteTextShape</td></tr>
+ * </table>
+ *
+ * <p>If the shape type is not recognized, then
+ * <tt>ShapeExport::WriteUnknownShape</tt> is called.</p>
+ *
+ * @param xShape The shape to export as DrawingML.
+ * @return <tt>*this</tt>
+ */
+ virtual ShapeExport&
+ WriteShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ShapeExport&
+ WriteTextBox( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xIface, sal_Int32 nXmlNamespace );
+ virtual ShapeExport&
+ WriteTextShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ShapeExport&
+ WriteTableShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ShapeExport&
+ WriteOLE2Shape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ShapeExport&
+ WriteUnknownShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+
+ void WriteTable( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rXShape );
+
+
+ sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
+ sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape, ::oox::core::XmlFilterBase* pFB );
+ sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
+ static sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape, ShapeHashMap* pShapeMap );
+};
+
+}}
+
+#endif /* ndef _OOX_EXPORT_SHAPES_HXX_ */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx
new file mode 100644
index 000000000000..04c3b3375742
--- /dev/null
+++ b/include/oox/export/utils.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 _OOX_EXPORT_UTILS_HXX_
+#define _OOX_EXPORT_UTILS_HXX_
+
+#define I32S(x) OString::valueOf( (sal_Int32) x ).getStr()
+#define I64S(x) OString::valueOf( (sal_Int64) x ).getStr()
+#define IS(x) OString::valueOf( x ).getStr()
+#define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr()
+
+#ifndef DBG
+# if OSL_DEBUG_LEVEL > 0
+# define DBG(x) x
+# else
+# define DBG(x)
+# endif
+#endif
+
+// ---------------------------------------------------------------------------------------------
+
+static inline sal_Int64 PPTtoEMU( sal_Int32 nPPT )
+{
+ return (sal_Int64)( (double)nPPT * 1587.5 );
+}
+
+// ---------------------------------------------------------------------------------------------
+
+static inline sal_Int64 MM100toEMU( sal_Int32 nMM100 )
+{
+ return (sal_Int64)nMM100 * 360;
+}
+
+// ---------------------------------------------------------------------------------------------
+
+static inline sal_Int64 TwipsToEMU( sal_Int32 nTwips )
+{
+ return sal_Int64( nTwips ) * 635;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/export/vmlexport.hxx b/include/oox/export/vmlexport.hxx
new file mode 100644
index 000000000000..54212a65bccf
--- /dev/null
+++ b/include/oox/export/vmlexport.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 _OOX_EXPORT_VMLEXPORT_HXX_
+#define _OOX_EXPORT_VMLEXPORT_HXX_
+
+#include <oox/dllapi.h>
+#include <oox/export/drawingml.hxx>
+#include <sax/fshelper.hxx>
+#include <filter/msfilter/escherex.hxx>
+#include <editeng/outlobj.hxx>
+
+
+namespace oox {
+
+namespace vml {
+
+/// Interface to be implemented by the parent exporter that knows how to handle shape text.
+class OOX_DLLPUBLIC VMLTextExport
+{
+public:
+ virtual void WriteOutliner(const OutlinerParaObject& rParaObj) = 0;
+ virtual oox::drawingml::DrawingML& GetDrawingML() = 0;
+protected:
+ VMLTextExport() {}
+ virtual ~VMLTextExport() {}
+};
+
+class OOX_DLLPUBLIC VMLExport : public EscherEx
+{
+ /// Fast serializer to output the data
+ ::sax_fastparser::FSHelperPtr m_pSerializer;
+
+ /// Parent exporter, used for text callback.
+ VMLTextExport* m_pTextExport;
+
+ /// The object we're exporting.
+ const SdrObject* m_pSdrObject;
+
+ /// Fill the shape attributes as they come.
+ ::sax_fastparser::FastAttributeList *m_pShapeAttrList;
+
+ /// Remember the shape type.
+ sal_uInt32 m_nShapeType;
+
+ /// Remember the shape flags.
+ sal_uInt32 m_nShapeFlags;
+
+ /// Remember style, the most important shape attribute ;-)
+ OStringBuffer *m_pShapeStyle;
+
+ /// Remember which shape types we had already written.
+ bool *m_pShapeTypeWritten;
+
+public:
+ VMLExport( ::sax_fastparser::FSHelperPtr pSerializer, VMLTextExport* pTextExport = 0 );
+ virtual ~VMLExport();
+
+ ::sax_fastparser::FSHelperPtr
+ GetFS() { return m_pSerializer; }
+
+ /// Export the sdr object as VML.
+ ///
+ /// Call this when you need to export the object as VML.
+ sal_uInt32 AddSdrObject( const SdrObject& rObj );
+
+protected:
+ /// Add an attribute to the generated <v:shape/> element.
+ ///
+ /// This should be called from within StartShape() to ensure that the
+ /// added attribute is preserved.
+ void AddShapeAttribute( sal_Int32 nAttribute, const OString& sValue );
+
+ using EscherEx::StartShape;
+ using EscherEx::EndShape;
+
+ /// Start the shape for which we just collected the information.
+ ///
+ /// Returns the element's tag number, -1 means we wrote nothing.
+ virtual sal_Int32 StartShape();
+
+ /// End the shape.
+ ///
+ /// The parameter is just what we got from StartShape().
+ virtual void EndShape( sal_Int32 nShapeElement );
+
+ virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
+
+private:
+
+ virtual void OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance = 0 );
+ virtual void CloseContainer();
+
+ virtual sal_uInt32 EnterGroup( const OUString& rShapeName, const Rectangle* pBoundRect = 0 );
+ virtual void LeaveGroup();
+
+ virtual void AddShape( sal_uInt32 nShapeType, sal_uInt32 nShapeFlags, sal_uInt32 nShapeId = 0 );
+
+private:
+ /// Create an OString representing the id from a numerical id.
+ static OString ShapeIdString( sal_uInt32 nId );
+
+ /// Add starting and ending point of a line to the m_pShapeAttrList.
+ void AddLineDimensions( const Rectangle& rRectangle );
+
+ /// Add position and size to the OStringBuffer.
+ void AddRectangleDimensions( OStringBuffer& rBuffer, const Rectangle& rRectangle );
+};
+
+} // namespace vml
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/attributelist.hxx b/include/oox/helper/attributelist.hxx
new file mode 100644
index 000000000000..55f41cf0a3b3
--- /dev/null
+++ b/include/oox/helper/attributelist.hxx
@@ -0,0 +1,170 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_HELPER_ATTRIBUTELIST_HXX
+#define OOX_HELPER_ATTRIBUTELIST_HXX
+
+#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
+#include "oox/helper/helper.hxx"
+#include "oox/token/namespaces.hxx"
+#include "oox/token/tokens.hxx"
+#include "oox/dllapi.h"
+
+namespace oox {
+
+// ============================================================================
+
+/** Static helpers for conversion of strings to attribute values of various
+ different data types.
+ */
+class OOX_DLLPUBLIC AttributeConversion
+{
+public:
+ /** Returns the XML token identifier from the passed string. */
+ static sal_Int32 decodeToken( const OUString& rValue );
+
+ /** Returns the decoded string value. All characters in the format
+ '_xHHHH_' (H being a hexadecimal digit), will be decoded. */
+ static OUString decodeXString( const OUString& rValue );
+
+ /** Returns the double value from the passed string. */
+ static double decodeDouble( const OUString& rValue );
+
+ /** Returns the 32-bit signed integer value from the passed string (decimal). */
+ static sal_Int32 decodeInteger( const OUString& rValue );
+
+ /** Returns the 32-bit unsigned integer value from the passed string (decimal). */
+ static sal_uInt32 decodeUnsigned( const OUString& rValue );
+
+ /** Returns the 64-bit signed integer value from the passed string (decimal). */
+ static sal_Int64 decodeHyper( const OUString& rValue );
+
+ /** Returns the 32-bit signed integer value from the passed string (hexadecimal). */
+ static sal_Int32 decodeIntegerHex( const OUString& rValue );
+};
+
+// ============================================================================
+
+/** Provides access to attribute values of an element.
+
+ Wraps a com.sun.star.xml.sax.XFastAttributeList object. Provides
+ convenience functions that convert the string value of an attribute to
+ various other data types.
+ */
+class OOX_DLLPUBLIC AttributeList
+{
+public:
+ explicit AttributeList(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs );
+
+ /** Returns the wrapped com.sun.star.xml.sax.XFastAttributeList object. */
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >
+ getFastAttributeList() const { return mxAttribs; }
+
+ /** Returns true, if the specified attribute is present. */
+ bool hasAttribute( sal_Int32 nAttrToken ) const;
+
+ // optional return values -------------------------------------------------
+
+ /** Returns the token identifier of the value of the specified attribute. */
+ OptValue< sal_Int32 > getToken( sal_Int32 nAttrToken ) const;
+
+ /** Returns the string value of the specified attribute. */
+ OptValue< OUString > getString( sal_Int32 nAttrToken ) const;
+
+ /** Returns the string value of the specified attribute. All characters in
+ the format '_xHHHH_' (H being a hexadecimal digit), will be decoded. */
+ OptValue< OUString > getXString( sal_Int32 nAttrToken ) const;
+
+ /** Returns the double value of the specified attribute. */
+ OptValue< double > getDouble( sal_Int32 nAttrToken ) const;
+
+ /** Returns the 32-bit signed integer value of the specified attribute (decimal). */
+ OptValue< sal_Int32 > getInteger( sal_Int32 nAttrToken ) const;
+
+ /** Returns the 32-bit unsigned integer value of the specified attribute (decimal). */
+ OptValue< sal_uInt32 > getUnsigned( sal_Int32 nAttrToken ) const;
+
+ /** Returns the 64-bit signed integer value of the specified attribute (decimal). */
+ OptValue< sal_Int64 > getHyper( sal_Int32 nAttrToken ) const;
+
+ /** Returns the 32-bit signed integer value of the specified attribute (hexadecimal). */
+ OptValue< sal_Int32 > getIntegerHex( sal_Int32 nAttrToken ) const;
+
+ /** Returns the boolean value of the specified attribute. */
+ OptValue< bool > getBool( sal_Int32 nAttrToken ) const;
+
+ /** Returns the date/time value of the specified attribute. */
+ OptValue< ::com::sun::star::util::DateTime > getDateTime( sal_Int32 nAttrToken ) const;
+
+ // defaulted return values ------------------------------------------------
+
+ /** Returns the token identifier of the value of the specified attribute,
+ or the passed default identifier if the attribute is missing. */
+ sal_Int32 getToken( sal_Int32 nAttrToken, sal_Int32 nDefault ) const;
+
+ /** Returns the string value of the specified attribute, or the passed
+ default string if the attribute is missing. */
+ OUString getString( sal_Int32 nAttrToken, const OUString& rDefault ) const;
+
+ /** Returns the decoded string value of the specified attribute, or the
+ passed default string if the attribute is missing. */
+ OUString getXString( sal_Int32 nAttrToken, const OUString& rDefault ) const;
+
+ /** Returns the double value of the specified attribute, or the passed
+ default value if the attribute is missing or not convertible to a double. */
+ double getDouble( sal_Int32 nAttrToken, double fDefault ) const;
+
+ /** Returns the 32-bit signed integer value of the specified attribute, or the
+ passed default value if the attribute is missing or not convertible to integer. */
+ sal_Int32 getInteger( sal_Int32 nAttrToken, sal_Int32 nDefault ) const;
+
+ /** Returns the 32-bit unsigned integer value of the specified attribute, or the
+ passed default value if the attribute is missing or not convertible to unsigned. */
+ sal_uInt32 getUnsigned( sal_Int32 nAttrToken, sal_uInt32 nDefault ) const;
+
+ /** Returns the 64-bit signed integer value of the specified attribute, or the
+ passed default value if the attribute is missing or not convertible to integer. */
+ sal_Int64 getHyper( sal_Int32 nAttrToken, sal_Int64 nDefault ) const;
+
+ /** Returns the 32-bit signed integer value of the specified attribute (hexadecimal),
+ or the passed default value if the attribute is missing or not convertible. */
+ sal_Int32 getIntegerHex( sal_Int32 nAttrToken, sal_Int32 nDefault ) const;
+
+ /** Returns the boolean value of the specified attribute, or the passed
+ default value if the attribute is missing or not convertible to bool. */
+ bool getBool( sal_Int32 nAttrToken, bool bDefault ) const;
+
+ /** Returns the date/time value of the specified attribute, or the default
+ value if the attribute is missing or not convertible to a date/time value. */
+ ::com::sun::star::util::DateTime getDateTime( sal_Int32 nAttrToken, const ::com::sun::star::util::DateTime& rDefault ) const;
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >
+ mxAttribs;
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/binaryinputstream.hxx b/include/oox/helper/binaryinputstream.hxx
new file mode 100644
index 000000000000..64d85357c2e8
--- /dev/null
+++ b/include/oox/helper/binaryinputstream.hxx
@@ -0,0 +1,438 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_HELPER_BINARYINPUTSTREAM_HXX
+#define OOX_HELPER_BINARYINPUTSTREAM_HXX
+
+#include <vector>
+#include <com/sun/star/io/XInputStream.hpp>
+#include "oox/helper/binarystreambase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace io { class XInputStream; }
+} } }
+
+namespace oox {
+
+class BinaryOutputStream;
+
+// ============================================================================
+
+/** Interface for binary input stream classes.
+
+ The binary data in the stream is assumed to be in little-endian format.
+ */
+class OOX_DLLPUBLIC BinaryInputStream : public virtual BinaryStreamBase
+{
+public:
+ /** Derived classes implement reading nBytes bytes to the passed sequence.
+ The sequence will be reallocated internally.
+
+ @param nAtomSize
+ The size of the elements in the memory block, if available. Derived
+ classes may be interested in this information.
+
+ @return
+ Number of bytes really read.
+ */
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 ) = 0;
+
+ /** Derived classes implement reading nBytes bytes to the (preallocated!)
+ memory buffer opMem.
+
+ @param nAtomSize
+ The size of the elements in the memory block, if available. Derived
+ classes may be interested in this information.
+
+ @return
+ Number of bytes really read.
+ */
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 ) = 0;
+
+ /** Derived classes implement seeking the stream forward by the passed
+ number of bytes. This should work for non-seekable streams too.
+
+ @param nAtomSize
+ The size of the elements in the memory block, if available. Derived
+ classes may be interested in this information.
+ */
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 ) = 0;
+
+ /** Reads a value from the stream and converts it to platform byte order.
+ All data types supported by the ByteOrderConverter class can be used.
+ */
+ template< typename Type >
+ void readValue( Type& ornValue );
+
+ /** Reads a value from the stream and converts it to platform byte order.
+ All data types supported by the ByteOrderConverter class can be used.
+ */
+ template< typename Type >
+ inline Type readValue() { Type nValue; readValue( nValue ); return nValue; }
+
+ /** Stream operator for all data types supported by the readValue() function. */
+ template< typename Type >
+ inline BinaryInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; }
+
+ inline sal_Int8 readInt8() { return readValue< sal_Int8 >(); }
+ inline sal_uInt8 readuInt8() { return readValue< sal_uInt8 >(); }
+ inline sal_Int16 readInt16() { return readValue< sal_Int16 >(); }
+ inline sal_uInt16 readuInt16() { return readValue< sal_uInt16 >(); }
+ inline sal_Int32 readInt32() { return readValue< sal_Int32 >(); }
+ inline sal_uInt32 readuInt32() { return readValue< sal_uInt32 >(); }
+ inline sal_Int64 readInt64() { return readValue< sal_Int64 >(); }
+ inline sal_uInt64 readuInt64() { return readValue< sal_uInt64 >(); }
+ inline float readFloat() { return readValue< float >(); }
+ inline double readDouble() { return readValue< double >(); }
+
+ /** Reads a (preallocated!) C array of values from the stream.
+
+ Converts all values in the array to platform byte order. All data types
+ supported by the ByteOrderConverter class can be used.
+
+ @param nElemCount
+ Number of array elements to read (NOT byte count).
+
+ @return
+ Number of array elements really read (NOT byte count).
+ */
+ template< typename Type >
+ sal_Int32 readArray( Type* opnArray, sal_Int32 nElemCount );
+
+ /** Reads a sequence of values from the stream.
+
+ The sequence will be reallocated internally. Converts all values in the
+ array to platform byte order. All data types supported by the
+ ByteOrderConverter class can be used.
+
+ @param nElemCount
+ Number of elements to put into the sequence (NOT byte count).
+
+ @return
+ Number of sequence elements really read (NOT byte count).
+ */
+ template< typename Type >
+ sal_Int32 readArray( ::com::sun::star::uno::Sequence< Type >& orSequence, sal_Int32 nElemCount );
+
+ /** Reads a vector of values from the stream.
+
+ The vector will be resized internally. Converts all values in the
+ vector to platform byte order. All data types supported by the
+ ByteOrderConverter class can be used.
+
+ @param nElemCount
+ Number of elements to put into the vector (NOT byte count).
+
+ @return
+ Number of vector elements really read (NOT byte count).
+ */
+ template< typename Type >
+ sal_Int32 readArray( ::std::vector< Type >& orVector, sal_Int32 nElemCount );
+
+ /** Skips an array of values of a certain type in the stream.
+
+ All data types supported by the ByteOrderConverter class can be used.
+
+ @param nElemCount
+ Number of array elements to skip (NOT byte count).
+ */
+ template< typename Type >
+ void skipArray( sal_Int32 nElemCount );
+
+ /** Reads a NUL-terminated Unicode character array and returns the string.
+ */
+ OUString readNulUnicodeArray();
+
+ /** Reads a byte character array and returns the string.
+
+ @param nChars
+ Number of characters (bytes) to read from the stream.
+
+ @param bAllowNulChars
+ True = NUL characters are inserted into the imported string.
+ False = NUL characters are replaced by question marks (default).
+ */
+ OString readCharArray( sal_Int32 nChars, bool bAllowNulChars = false );
+
+ /** Reads a byte character array and returns a Unicode string.
+
+ @param nChars
+ Number of characters (bytes) to read from the stream.
+
+ @param eTextEnc
+ The text encoding used to create the Unicode string.
+
+ @param bAllowNulChars
+ True = NUL characters are inserted into the imported string.
+ False = NUL characters are replaced by question marks (default).
+ */
+ OUString readCharArrayUC( sal_Int32 nChars, rtl_TextEncoding eTextEnc, bool bAllowNulChars = false );
+
+ /** Reads a Unicode character array and returns the string.
+
+ @param nChars
+ Number of 16-bit characters to read from the stream.
+
+ @param bAllowNulChars
+ True = NUL characters are inserted into the imported string.
+ False = NUL characters are replaced by question marks (default).
+ */
+ OUString readUnicodeArray( sal_Int32 nChars, bool bAllowNulChars = false );
+
+ /** Reads a Unicode character array (may be compressed) and returns the
+ string.
+
+ @param nChars
+ Number of 8-bit or 16-bit characters to read from the stream.
+
+ @param bCompressed
+ True = Character array is compressed (stored as 8-bit characters).
+ False = Character array is not compressed (stored as 16-bit characters).
+
+ @param bAllowNulChars
+ True = NUL characters are inserted into the imported string.
+ False = NUL characters are replaced by question marks (default).
+ */
+ OUString readCompressedUnicodeArray( sal_Int32 nChars, bool bCompressed, bool bAllowNulChars = false );
+
+ /** Copies nBytes bytes from the current position to the passed output stream.
+ */
+ void copyToStream( BinaryOutputStream& rOutStrm, sal_Int64 nBytes = SAL_MAX_INT64, sal_Int32 nAtomSize = 1 );
+
+protected:
+ /** This dummy default c'tor will never call the c'tor of the virtual base
+ class BinaryStreamBase as this class cannot be instanciated directly. */
+ inline explicit BinaryInputStream() : BinaryStreamBase( false ) {}
+};
+
+typedef ::boost::shared_ptr< BinaryInputStream > BinaryInputStreamRef;
+
+// ----------------------------------------------------------------------------
+
+template< typename Type >
+void BinaryInputStream::readValue( Type& ornValue )
+{
+ readMemory( &ornValue, static_cast< sal_Int32 >( sizeof( Type ) ), sizeof( Type ) );
+ ByteOrderConverter::convertLittleEndian( ornValue );
+}
+
+template< typename Type >
+sal_Int32 BinaryInputStream::readArray( Type* opnArray, sal_Int32 nElemCount )
+{
+ sal_Int32 nRet = 0;
+ if( !mbEof )
+ {
+ sal_Int32 nReadSize = getLimitedValue< sal_Int32, sal_Int32 >( nElemCount, 0, SAL_MAX_INT32 / sizeof( Type ) ) * sizeof( Type );
+ nRet = readMemory( opnArray, nReadSize, sizeof( Type ) ) / sizeof( Type );
+ ByteOrderConverter::convertLittleEndianArray( opnArray, static_cast< size_t >( nRet ) );
+ }
+ return nRet;
+}
+
+template< typename Type >
+sal_Int32 BinaryInputStream::readArray( ::com::sun::star::uno::Sequence< Type >& orSequence, sal_Int32 nElemCount )
+{
+ orSequence.reallocate( nElemCount );
+ return orSequence.hasElements() ? readArray( orSequence.getArray(), nElemCount ) : 0;
+}
+
+template< typename Type >
+sal_Int32 BinaryInputStream::readArray( ::std::vector< Type >& orVector, sal_Int32 nElemCount )
+{
+ orVector.resize( static_cast< size_t >( nElemCount ) );
+ return orVector.empty() ? 0 : readArray( &orVector.front(), nElemCount );
+}
+
+template< typename Type >
+void BinaryInputStream::skipArray( sal_Int32 nElemCount )
+{
+ sal_Int32 nSkipSize = getLimitedValue< sal_Int32, sal_Int32 >( nElemCount, 0, SAL_MAX_INT32 / sizeof( Type ) ) * sizeof( Type );
+ skip( nSkipSize, sizeof( Type ) );
+}
+
+// ============================================================================
+
+/** Wraps a UNO input stream and provides convenient access functions.
+
+ The binary data in the stream is assumed to be in little-endian format.
+ */
+class OOX_DLLPUBLIC BinaryXInputStream : public BinaryXSeekableStream, public BinaryInputStream
+{
+public:
+ /** Constructs the wrapper object for the passed input stream.
+
+ @param rxInStream
+ The com.sun.star.io.XInputStream interface of the UNO input stream
+ to be wrapped.
+
+ @param bAutoClose
+ True = automatically close the wrapped input stream on destruction
+ of this wrapper or when close() is called.
+ */
+ explicit BinaryXInputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
+ bool bAutoClose );
+
+ virtual ~BinaryXInputStream();
+
+ /** Closes the input stream. Does also close the wrapped UNO input stream
+ if bAutoClose has been set to true in the constructor. */
+ virtual void close();
+
+ /** Reads nBytes bytes to the passed sequence.
+ @return Number of bytes really read. */
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Reads nBytes bytes to the (existing) buffer opMem.
+ @return Number of bytes really read. */
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Seeks the stream forward by the passed number of bytes. This works for
+ non-seekable streams too. */
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Stream operator for all data types supported by the readValue() function. */
+ template< typename Type >
+ inline BinaryXInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; }
+
+private:
+ StreamDataSequence maBuffer; ///< Data buffer used in readMemory() function.
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ mxInStrm; ///< Reference to the input stream.
+ bool mbAutoClose; ///< True = automatically close stream on destruction.
+};
+
+// ============================================================================
+
+/** Wraps a StreamDataSequence and provides convenient access functions.
+
+ The binary data in the stream is assumed to be in little-endian format.
+ */
+class OOX_DLLPUBLIC SequenceInputStream : public SequenceSeekableStream, public BinaryInputStream
+{
+public:
+ /** Constructs the wrapper object for the passed data sequence.
+
+ @attention
+ The passed data sequence MUST live at least as long as this stream
+ wrapper. The data sequence MUST NOT be changed from outside as long
+ as this stream wrapper is used to read from it.
+ */
+ explicit SequenceInputStream( const StreamDataSequence& rData );
+
+ /** Reads nBytes bytes to the passed sequence.
+ @return Number of bytes really read. */
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Reads nBytes bytes to the (existing) buffer opMem.
+ @return Number of bytes really read. */
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Seeks the stream forward by the passed number of bytes. This works for
+ non-seekable streams too. */
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Stream operator for all data types supported by the readValue() function. */
+ template< typename Type >
+ inline SequenceInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; }
+
+private:
+ /** Returns the number of bytes available in the sequence for the passed byte count. */
+ inline sal_Int32 getMaxBytes( sal_Int32 nBytes ) const
+ { return getLimitedValue< sal_Int32, sal_Int32 >( nBytes, 0, mpData->getLength() - mnPos ); }
+};
+
+// ============================================================================
+
+/** Wraps a BinaryInputStream and provides access to a specific part of the
+ stream data.
+
+ Provides access to the stream data block starting at the current position
+ of the stream, and with a specific length. If the wrapped stream is
+ seekable, this wrapper will treat the position of the wrapped stream at
+ construction time as position "0" (therefore the class name).
+
+ The passed input stream MUST live at least as long as this stream wrapper.
+ The stream MUST NOT be changed from outside as long as this stream wrapper
+ is used to read from it.
+ */
+class RelativeInputStream : public BinaryInputStream
+{
+public:
+ /** Constructs the wrapper object for the passed stream.
+
+ @param nSize
+ If specified, restricts the amount of data that can be read from
+ the passed input stream.
+ */
+ explicit RelativeInputStream(
+ BinaryInputStream& rInStrm,
+ sal_Int64 nSize = SAL_MAX_INT64 );
+
+ /** Returns the size of the data block in the wrapped stream offered by
+ this wrapper. */
+ virtual sal_Int64 size() const;
+
+ /** Returns the current relative stream position. */
+ virtual sal_Int64 tell() const;
+
+ /** Seeks the stream to the passed relative position, if the wrapped stream
+ is seekable. */
+ virtual void seek( sal_Int64 nPos );
+
+ /** Closes the input stream but not the wrapped stream. */
+ virtual void close();
+
+ /** Reads nBytes bytes to the passed sequence. Does not read out of the
+ data block whose size has been specified on construction.
+ @return Number of bytes really read. */
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Reads nBytes bytes to the (existing) buffer opMem. Does not read out of
+ the data block whose size has been specified on construction.
+ @return Number of bytes really read. */
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Seeks the stream forward by the passed number of bytes. This works for
+ non-seekable streams too. Does not seek out of the data block. */
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Stream operator for all data types supported by the readValue() function. */
+ template< typename Type >
+ inline RelativeInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; }
+
+private:
+ /** Returns the number of bytes available in the sequence for the passed byte count. */
+ inline sal_Int32 getMaxBytes( sal_Int32 nBytes ) const
+ { return getLimitedValue< sal_Int32, sal_Int64 >( nBytes, 0, mnSize - mnRelPos ); }
+
+private:
+ BinaryInputStream* mpInStrm;
+ sal_Int64 mnStartPos;
+ sal_Int64 mnRelPos;
+ sal_Int64 mnSize;
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/binaryoutputstream.hxx b/include/oox/helper/binaryoutputstream.hxx
new file mode 100644
index 000000000000..0882821e9834
--- /dev/null
+++ b/include/oox/helper/binaryoutputstream.hxx
@@ -0,0 +1,189 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_HELPER_BINARYOUTPUTSTREAM_HXX
+#define OOX_HELPER_BINARYOUTPUTSTREAM_HXX
+
+#include "oox/helper/binarystreambase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace io { class XOutputStream; }
+} } }
+
+namespace oox {
+
+// ============================================================================
+
+/** Interface for binary output stream classes.
+
+ The binary data in the stream is written in little-endian format.
+ */
+class BinaryOutputStream : public virtual BinaryStreamBase
+{
+public:
+ /** Derived classes implement writing the contents of the passed data
+ sequence.
+
+ @param nAtomSize
+ The size of the elements in the memory block, if available. Derived
+ classes may be interested in this information.
+ */
+ virtual void writeData( const StreamDataSequence& rData, size_t nAtomSize = 1 ) = 0;
+
+ /** Derived classes implement writing the contents of the (preallocated!)
+ memory buffer pMem.
+
+ @param nAtomSize
+ The size of the elements in the memory block, if available. Derived
+ classes may be interested in this information.
+ */
+ virtual void writeMemory( const void* pMem, sal_Int32 nBytes, size_t nAtomSize = 1 ) = 0;
+
+ /** Writes a value to the stream and converts it to platform byte order.
+ All data types supported by the ByteOrderConverter class can be used.
+ */
+ template< typename Type >
+ void writeValue( Type nValue );
+
+ template< typename Type >
+ void writeArray( Type* opnArray, sal_Int32 nElemCount );
+
+ /** Stream operator for all data types supported by the writeValue() function. */
+ template< typename Type >
+ inline BinaryOutputStream& operator<<( Type nValue ) { writeValue( nValue ); return *this; }
+
+ void writeCompressedUnicodeArray( const OUString& rString, bool bCompressed, bool bAllowNulChars = false );
+
+ void writeCharArrayUC( const OUString& rString, rtl_TextEncoding eTextEnc, bool bAllowNulChars = false );
+
+ void writeUnicodeArray( const OUString& rString, bool bAllowNulChars = false );
+
+protected:
+ /** This dummy default c'tor will never call the c'tor of the virtual base
+ class BinaryStreamBase as this class cannot be instanciated directly. */
+ inline explicit BinaryOutputStream() : BinaryStreamBase( false ) {}
+};
+
+template< typename Type >
+void BinaryOutputStream::writeArray( Type* opnArray, sal_Int32 nElemCount )
+{
+ sal_Int32 nWriteSize = getLimitedValue< sal_Int32, sal_Int32 >( nElemCount, 0, SAL_MAX_INT32 / sizeof( Type ) ) * sizeof( Type );
+ ByteOrderConverter::convertLittleEndianArray( opnArray, static_cast< size_t >( nWriteSize ) );
+ writeMemory( opnArray, nWriteSize, sizeof( Type ) );
+}
+
+typedef ::boost::shared_ptr< BinaryOutputStream > BinaryOutputStreamRef;
+
+// ----------------------------------------------------------------------------
+
+template< typename Type >
+void BinaryOutputStream::writeValue( Type nValue )
+{
+ ByteOrderConverter::convertLittleEndian( nValue );
+ writeMemory( &nValue, static_cast< sal_Int32 >( sizeof( Type ) ), sizeof( Type ) );
+}
+
+// ============================================================================
+
+/** Wraps a UNO output stream and provides convenient access functions.
+
+ The binary data in the stream is written in little-endian format.
+ */
+class BinaryXOutputStream : public BinaryXSeekableStream, public BinaryOutputStream
+{
+public:
+ /** Constructs the wrapper object for the passed output stream.
+
+ @param rxOutStream
+ The com.sun.star.io.XOutputStream interface of the output stream to
+ be wrapped.
+
+ @param bAutoClose
+ True = automatically close the wrapped output stream on destruction
+ of this wrapper or when close() is called.
+ */
+ explicit BinaryXOutputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rxOutStrm,
+ bool bAutoClose );
+
+ virtual ~BinaryXOutputStream();
+
+ /** Flushes and closes the output stream. Does also close the wrapped UNO
+ output stream if bAutoClose has been set to true in the constructor. */
+ void close();
+
+ /** Writes the passed data sequence. */
+ virtual void writeData( const StreamDataSequence& rData, size_t nAtomSize = 1 );
+
+ /** Write nBytes bytes from the (preallocated!) buffer pMem. */
+ virtual void writeMemory( const void* pMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Stream operator for all data types supported by the writeValue() function. */
+ template< typename Type >
+ inline BinaryXOutputStream& operator<<( Type nValue ) { writeValue( nValue ); return *this; }
+
+ /** Returns the XOutputStream interface of the wrapped output stream. */
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+ getXOutputStream() const { return mxOutStrm; }
+
+private:
+ StreamDataSequence maBuffer; ///< Data buffer used in writeMemory() function.
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+ mxOutStrm; ///< Reference to the output stream.
+ bool mbAutoClose; ///< True = automatically close stream on destruction.
+};
+
+// ============================================================================
+
+/** Wraps a StreamDataSequence and provides convenient access functions.
+
+ The binary data in the stream is written in little-endian format. After
+ construction, the stream points to the beginning of the passed data
+ sequence. The data sequence is expanded automatically while writing to it.
+ */
+class OOX_DLLPUBLIC SequenceOutputStream : public SequenceSeekableStream, public BinaryOutputStream
+{
+public:
+ /** Constructs the wrapper object for the passed data sequence.
+
+ @attention
+ The passed data sequence MUST live at least as long as this stream
+ wrapper. The data sequence MUST NOT be changed from outside as long
+ as this stream wrapper is used to write to it.
+ */
+ explicit SequenceOutputStream( StreamDataSequence& rData );
+
+ /** Writes the passed data sequence. */
+ virtual void writeData( const StreamDataSequence& rData, size_t nAtomSize = 1 );
+
+ /** Write nBytes bytes from the (preallocated!) buffer pMem. */
+ virtual void writeMemory( const void* pMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Stream operator for all data types supported by the writeValue() function. */
+ template< typename Type >
+ inline SequenceOutputStream& operator<<( Type nValue ) { writeValue( nValue ); return *this; }
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/binarystreambase.hxx b/include/oox/helper/binarystreambase.hxx
new file mode 100644
index 000000000000..d9ab979de019
--- /dev/null
+++ b/include/oox/helper/binarystreambase.hxx
@@ -0,0 +1,187 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_HELPER_BINARYSTREAMBASE_HXX
+#define OOX_HELPER_BINARYSTREAMBASE_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <boost/shared_ptr.hpp>
+#include "oox/helper/helper.hxx"
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace io { class XSeekable; }
+} } }
+
+namespace oox {
+
+typedef ::com::sun::star::uno::Sequence< sal_Int8 > StreamDataSequence;
+
+// ============================================================================
+
+/** Base class for binary stream classes.
+ */
+class OOX_DLLPUBLIC BinaryStreamBase
+{
+public:
+ virtual ~BinaryStreamBase();
+
+ /** Implementations return the size of the stream, if possible.
+
+ This function may be implemented for some types of unseekable streams,
+ and MUST be implemented for all seekable streams.
+
+ @return
+ The size of the stream in bytes, or -1, if not implemented.
+ */
+ virtual sal_Int64 size() const = 0;
+
+ /** Implementations return the current stream position, if possible.
+
+ This function may be implemented for some types of unseekable streams,
+ and MUST be implemented for all seekable streams.
+
+ @return
+ The current position in the stream, or -1, if not implemented.
+ */
+ virtual sal_Int64 tell() const = 0;
+
+ /** Implementations seek the stream to the passed position, if
+ the stream is seekable.
+ */
+ virtual void seek( sal_Int64 nPos ) = 0;
+
+ /** Implementations close the stream.
+ */
+ virtual void close() = 0;
+
+ /** Returns true, if the implementation supports the seek() operation.
+
+ Implementations may still implement size() and tell() even if the
+ stream is not seekable.
+ */
+ inline bool isSeekable() const { return mbSeekable; }
+
+ /** Returns true, if the stream position is invalid (EOF). This flag turns
+ true *after* the first attempt to seek/read beyond the stream end.
+ */
+ inline bool isEof() const { return mbEof; }
+
+ /** Returns the size of the remaining data available in the stream, if
+ stream supports size() and tell(), otherwise -1.
+ */
+ sal_Int64 getRemaining() const;
+
+ /** Seeks the stream to the beginning, if stream is seekable.
+ */
+ inline void seekToStart() { seek( 0 ); }
+
+ /** Seeks the stream to the end, if stream is seekable.
+ */
+ inline void seekToEnd() { seek( size() ); }
+
+ /** Seeks the stream forward to a position that is a multiple of the passed
+ block size, if stream is seekable.
+
+ @param nBlockSize
+ The size of the data blocks the streams needs to be aligned to.
+
+ @param nAnchorPos
+ Position in the stream the data blocks are aligned to.
+ */
+ void alignToBlock( sal_Int32 nBlockSize, sal_Int64 nAnchorPos = 0 );
+
+protected:
+ inline explicit BinaryStreamBase( bool bSeekable ) : mbEof( false ), mbSeekable( bSeekable ) {}
+
+private:
+ BinaryStreamBase( const BinaryStreamBase& );
+ BinaryStreamBase& operator=( const BinaryStreamBase& );
+
+protected:
+ bool mbEof; ///< End of stream flag.
+
+private:
+ const bool mbSeekable; ///< True = implementation supports seeking.
+};
+
+// ============================================================================
+
+/** Base class for binary input and output streams wrapping a UNO stream,
+ seekable via the com.sun.star.io.XSeekable interface.
+ */
+class OOX_DLLPUBLIC BinaryXSeekableStream : public virtual BinaryStreamBase
+{
+public:
+ virtual ~BinaryXSeekableStream();
+
+ /** Returns the size of the stream, if wrapped stream is seekable, otherwise -1. */
+ virtual sal_Int64 size() const;
+ /** Returns the current stream position, if wrapped stream is seekable, otherwise -1. */
+ virtual sal_Int64 tell() const;
+ /** Seeks the stream to the passed position, if wrapped stream is seekable. */
+ virtual void seek( sal_Int64 nPos );
+ /** Releases the reference to the UNO XSeekable interface. */
+ virtual void close();
+
+protected:
+ explicit BinaryXSeekableStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable >& rxSeekable );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable >
+ mxSeekable; ///< Stream seeking interface.
+};
+
+// ============================================================================
+
+/** Base class for binary input and output streams wrapping a
+ StreamDataSequence, which is always seekable.
+
+ The wrapped data sequence MUST live at least as long as this stream
+ wrapper. The data sequence MUST NOT be changed from outside as long as this
+ stream wrapper is used to modify it.
+ */
+class OOX_DLLPUBLIC SequenceSeekableStream : public virtual BinaryStreamBase
+{
+public:
+ /** Returns the size of the wrapped data sequence. */
+ virtual sal_Int64 size() const;
+ /** Returns the current stream position. */
+ virtual sal_Int64 tell() const;
+ /** Seeks the stream to the passed position. */
+ virtual void seek( sal_Int64 nPos );
+ /** Releases the reference to the data sequence. */
+ virtual void close();
+
+protected:
+ explicit SequenceSeekableStream( const StreamDataSequence& rData );
+
+protected:
+ const StreamDataSequence* mpData; ///< Wrapped data sequence.
+ sal_Int32 mnPos; ///< Current position in the sequence.
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/containerhelper.hxx b/include/oox/helper/containerhelper.hxx
new file mode 100644
index 000000000000..f3b27f05b1e2
--- /dev/null
+++ b/include/oox/helper/containerhelper.hxx
@@ -0,0 +1,410 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_HELPER_CONTAINERHELPER_HXX
+#define OOX_HELPER_CONTAINERHELPER_HXX
+
+#include <map>
+#include <vector>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/Sequence.h>
+#include "oox/dllapi.h"
+
+
+namespace com { namespace sun { namespace star {
+ namespace container { class XIndexAccess; }
+ namespace container { class XIndexContainer; }
+ namespace container { class XNameAccess; }
+ namespace container { class XNameContainer; }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace oox {
+
+// ============================================================================
+
+/** A range of signed 32-bit integer values. */
+struct ValueRange
+{
+ sal_Int32 mnFirst;
+ sal_Int32 mnLast;
+
+ inline explicit ValueRange( sal_Int32 nValue = 0 ) : mnFirst( nValue ), mnLast( nValue ) {}
+ inline explicit ValueRange( sal_Int32 nFirst, sal_Int32 nLast ) : mnFirst( nFirst ), mnLast( nLast ) {}
+
+ inline bool operator==( const ValueRange& rRange ) const { return (mnFirst == rRange.mnFirst) && (mnLast == rRange.mnLast); }
+ inline bool operator!=( const ValueRange& rRange ) const { return !(*this == rRange); }
+ inline bool contains( sal_Int32 nValue ) const { return (mnFirst <= nValue) && (nValue <= mnLast); }
+ inline bool contains( const ValueRange& rRange ) const { return (mnFirst <= rRange.mnFirst) && (rRange.mnLast <= mnLast); }
+ inline bool intersects( const ValueRange& rRange ) const { return (mnFirst <= rRange.mnLast) && (rRange.mnFirst <= mnLast); }
+};
+
+// ----------------------------------------------------------------------------
+
+typedef ::std::vector< ValueRange > ValueRangeVector;
+
+// ----------------------------------------------------------------------------
+
+/** An ordered list of value ranges. The insertion operation will merge
+ consecutive value ranges.
+ */
+class OOX_DLLPUBLIC ValueRangeSet
+{
+public:
+ inline explicit ValueRangeSet() {}
+
+ /** Inserts the passed value into the range list. */
+ inline void insert( sal_Int32 nValue ) { insert( ValueRange( nValue ) ); }
+ /** Inserts the passed value range into the range list. */
+ void insert( const ValueRange& rRange );
+
+ /** Returns the ordered list of all value ranges. */
+ inline const ValueRangeVector& getRanges() const { return maRanges; }
+
+private:
+ ValueRangeVector maRanges;
+};
+
+// ============================================================================
+
+/** Template for a 2-dimensional array of objects.
+
+ This class template provides a similar interface to the ::std::vector
+ template.
+ */
+template< typename Type >
+class Matrix
+{
+public:
+ typedef ::std::vector< Type > container_type;
+ typedef typename container_type::value_type value_type;
+ typedef typename container_type::pointer pointer;
+ typedef typename container_type::reference reference;
+ typedef typename container_type::const_reference const_reference;
+ typedef typename container_type::size_type size_type;
+ typedef typename container_type::iterator iterator;
+ typedef typename container_type::const_iterator const_iterator;
+
+ inline explicit Matrix() : mnWidth( 0 ) {}
+ inline explicit Matrix( size_type nWidth, size_type nHeight ) { this->resize( nWidth, nHeight ); }
+ inline explicit Matrix( size_type nWidth, size_type nHeight, const_reference rData ) { this->resize( nWidth, nHeight, rData ); }
+
+ inline size_type capacity() const { return maData.capacity(); }
+ inline bool empty() const { return maData.empty(); }
+ inline size_type size() const { return maData.size(); }
+ inline size_type width() const { return mnWidth; }
+ inline size_type height() const { return this->empty() ? 0 : (this->size() / this->width()); }
+ inline bool has( size_type nX, size_type nY ) const { return (nX < this->width()) && (nY < this->height()); }
+
+ inline void reserve( size_type nWidth, size_type nHeight ) { maData.reserve( nWidth * nHeight ); }
+ inline void clear() { this->resize( 0, 0 ); }
+ inline void resize( size_type nWidth, size_type nHeight ) { mnWidth = nWidth; maData.resize( nWidth * nHeight ); }
+ inline void resize( size_type nWidth, size_type nHeight, const_reference rData ) { mnWidth = nWidth; maData.resize( nWidth * nHeight, rData ); }
+
+ inline iterator at( size_type nX, size_type nY ) { return maData.begin() + mnWidth * nY + nX; }
+ inline const_iterator at( size_type nX, size_type nY ) const { return maData.begin() + mnWidth * nY + nX; }
+
+ inline reference operator()( size_type nX, size_type nY ) { return *this->at( nX, nY ); }
+ inline const_reference operator()( size_type nX, size_type nY ) const { return *this->at( nX, nY ); }
+
+ inline iterator begin() { return maData.begin(); }
+ inline const_iterator begin() const { return maData.begin(); }
+ inline iterator end() { return maData.end(); }
+ inline const_iterator end() const { return maData.end(); }
+
+ inline reference front() { return maData.front(); }
+ inline const_reference front() const { return maData.front(); }
+ inline reference back() { return maData.back(); }
+ inline const_reference back() const { return maData.back(); }
+
+ inline iterator row_begin( size_type nY ) { return this->at( 0, nY ); }
+ inline const_iterator row_begin( size_type nY ) const { return this->at( 0, nY ); }
+ inline iterator row_end( size_type nY ) { return this->at( mnWidth, nY ); }
+ inline const_iterator row_end( size_type nY ) const { return this->at( mnWidth, nY ); }
+
+ inline reference row_front( size_type nY ) { return (*this)( 0, nY ); }
+ inline const_reference row_front( size_type nY ) const { return (*this)( 0, nY ); }
+ inline reference row_back( size_type nY ) { return (*this)( mnWidth - 1, nY ); }
+ inline const_reference row_back( size_type nY ) const { return (*this)( mnWidth - 1, nY ); }
+
+ inline void swap( Matrix& rMatrix ) { maData.swap( rMatrix.maData ); }
+
+private:
+ container_type maData;
+ size_type mnWidth;
+};
+
+// ============================================================================
+
+/** Static helper functions for improved API container handling. */
+class OOX_DLLPUBLIC ContainerHelper
+{
+public:
+
+ /** Returns a name that is not used in the passed name container.
+
+ @param rxNameAccess com.sun.star.container.XNameAccess interface of
+ the name container.
+
+ @param rSuggestedName Suggested name for the object.
+
+ @return An unused name. Will be equal to the suggested name, if not
+ contained, otherwise a numerical index will be appended.
+ */
+ static OUString getUnusedName(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& rxNameAccess,
+ const OUString& rSuggestedName,
+ sal_Unicode cSeparator,
+ sal_Int32 nFirstIndexToAppend = 1 );
+
+ /** Inserts an object into a name container.
+
+ @param rxNameContainer com.sun.star.container.XNameContainer interface
+ of the name container.
+
+ @param rName Exact name for the object.
+
+ @param rObject The object to be inserted.
+
+ @return True = object successfully inserted.
+ */
+ static bool insertByName(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxNameContainer,
+ const OUString& rName,
+ const ::com::sun::star::uno::Any& rObject,
+ bool bReplaceOldExisting = true );
+
+ /** Inserts an object into a name container.
+
+ The function will use an unused name to insert the object, based on the
+ suggested object name. It is possible to specify whether the existing
+ object or the new inserted object will be renamed, if the container
+ already has an object with the name suggested for the new object.
+
+ @param rxNameContainer com.sun.star.container.XNameContainer interface
+ of the name container.
+
+ @param rSuggestedName Suggested name for the object.
+
+ @param rObject The object to be inserted.
+
+ @param bRenameOldExisting Specifies behaviour if an object with the
+ suggested name already exists. If false (default), the new object
+ will be inserted with a name not yet extant in the container (this
+ is done by appending a numerical index to the suggested name). If
+ true, the existing object will be removed and inserted with an
+ unused name, and the new object will be inserted with the suggested
+ name.
+
+ @return The final name the object is inserted with. Will always be
+ equal to the suggested name, if parameter bRenameOldExisting is
+ true.
+ */
+ static OUString insertByUnusedName(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxNameContainer,
+ const OUString& rSuggestedName,
+ sal_Unicode cSeparator,
+ const ::com::sun::star::uno::Any& rObject,
+ bool bRenameOldExisting = false );
+
+ // std::vector and std::map element access --------------------------------
+
+ /** Returns the pointer to an existing element of the passed vector, or a
+ null pointer, if the passed index is out of bounds. */
+ template< typename VectorType >
+ static const typename VectorType::value_type*
+ getVectorElement( const VectorType& rVector, sal_Int32 nIndex );
+
+ /** Returns the pointer to an existing element of the passed vector, or a
+ null pointer, if the passed index is out of bounds. */
+ template< typename VectorType >
+ static typename VectorType::value_type*
+ getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex );
+
+ /** Returns the reference to an existing element of the passed vector, or
+ the passed default value, if the passed index is out of bounds. */
+ template< typename VectorType >
+ static const typename VectorType::value_type&
+ getVectorElement( const VectorType& rVector, sal_Int32 nIndex, const typename VectorType::value_type& rDefault );
+
+ /** Returns the reference to an existing element of the passed vector, or
+ the passed default value, if the passed index is out of bounds. */
+ template< typename VectorType >
+ static typename VectorType::value_type&
+ getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault );
+
+ /** Returns the pointer to an existing element of the passed map, or a null
+ pointer, if an element with the passed key does not exist. */
+ template< typename MapType >
+ static const typename MapType::mapped_type*
+ getMapElement( const MapType& rMap, const typename MapType::key_type& rKey );
+
+ /** Returns the pointer to an existing element of the passed map, or a null
+ pointer, if an element with the passed key does not exist. */
+ template< typename MapType >
+ static typename MapType::mapped_type*
+ getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey );
+
+ /** Returns the reference to an existing element of the passed map, or the
+ passed default value, if an element with the passed key does not exist. */
+ template< typename MapType >
+ static const typename MapType::mapped_type&
+ getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault );
+
+ /** Returns the reference to an existing element of the passed map, or the
+ passed default value, if an element with the passed key does not exist. */
+ template< typename MapType >
+ static typename MapType::mapped_type&
+ getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault );
+
+ // vector/map/matrix to UNO sequence --------------------------------------
+
+ /** Creates a UNO sequence from a std::vector with copies of all elements.
+
+ @param rVector The vector to be converted to a sequence.
+
+ @return A com.sun.star.uno.Sequence object with copies of all objects
+ contained in the passed vector.
+ */
+ template< typename VectorType >
+ static ::com::sun::star::uno::Sequence< typename VectorType::value_type >
+ vectorToSequence( const VectorType& rVector );
+
+ /** Creates a UNO sequence from a std::map with copies of all elements.
+
+ @param rMap The map to be converted to a sequence.
+
+ @return A com.sun.star.uno.Sequence object with copies of all objects
+ contained in the passed map.
+ */
+ template< typename MapType >
+ static ::com::sun::star::uno::Sequence< typename MapType::mapped_type >
+ mapToSequence( const MapType& rMap );
+
+ /** Creates a UNO sequence of sequences from a matrix with copies of all elements.
+
+ @param rMatrix The matrix to be converted to a sequence of sequences.
+
+ @return A com.sun.star.uno.Sequence object containing
+ com.sun.star.uno.Sequence objects with copies of all objects
+ contained in the passed matrix.
+ */
+ template< typename MatrixType >
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< typename MatrixType::value_type > >
+ matrixToSequenceSequence( const MatrixType& rMatrix );
+};
+
+// ----------------------------------------------------------------------------
+
+template< typename VectorType >
+/*static*/ const typename VectorType::value_type* ContainerHelper::getVectorElement( const VectorType& rVector, sal_Int32 nIndex )
+{
+ return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? &rVector[ static_cast< size_t >( nIndex ) ] : 0;
+}
+
+template< typename VectorType >
+/*static*/ typename VectorType::value_type* ContainerHelper::getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex )
+{
+ return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? &rVector[ static_cast< size_t >( nIndex ) ] : 0;
+}
+
+template< typename VectorType >
+/*static*/ const typename VectorType::value_type& ContainerHelper::getVectorElement( const VectorType& rVector, sal_Int32 nIndex, const typename VectorType::value_type& rDefault )
+{
+ return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault;
+}
+
+template< typename VectorType >
+/*static*/ typename VectorType::value_type& ContainerHelper::getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault )
+{
+ return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault;
+}
+
+template< typename MapType >
+/*static*/ const typename MapType::mapped_type* ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey )
+{
+ typename MapType::const_iterator aIt = rMap.find( rKey );
+ return (aIt == rMap.end()) ? 0 : &aIt->second;
+}
+
+template< typename MapType >
+/*static*/ typename MapType::mapped_type* ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey )
+{
+ typename MapType::iterator aIt = rMap.find( rKey );
+ return (aIt == rMap.end()) ? 0 : &aIt->second;
+}
+
+template< typename MapType >
+/*static*/ const typename MapType::mapped_type& ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault )
+{
+ typename MapType::const_iterator aIt = rMap.find( rKey );
+ return (aIt == rMap.end()) ? rDefault : aIt->second;
+}
+
+template< typename MapType >
+/*static*/ typename MapType::mapped_type& ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault )
+{
+ typename MapType::iterator aIt = rMap.find( rKey );
+ return (aIt == rMap.end()) ? rDefault : aIt->second;
+}
+
+template< typename VectorType >
+/*static*/ ::com::sun::star::uno::Sequence< typename VectorType::value_type > ContainerHelper::vectorToSequence( const VectorType& rVector )
+{
+ typedef typename VectorType::value_type ValueType;
+ if( rVector.empty() )
+ return ::com::sun::star::uno::Sequence< ValueType >();
+ return ::com::sun::star::uno::Sequence< ValueType >( &rVector.front(), static_cast< sal_Int32 >( rVector.size() ) );
+}
+
+template< typename MapType >
+/*static*/ ::com::sun::star::uno::Sequence< typename MapType::mapped_type > ContainerHelper::mapToSequence( const MapType& rMap )
+{
+ typedef typename MapType::mapped_type ValueType;
+ if( rMap.empty() )
+ return ::com::sun::star::uno::Sequence< ValueType >();
+ ::com::sun::star::uno::Sequence< ValueType > aSeq( static_cast< sal_Int32 >( rMap.size() ) );
+ sal_Int32 nIndex = 0;
+ for( typename MapType::const_iterator aIt = rMap.begin(), aEnd = rMap.end(); aIt != aEnd; ++aIt, ++nIndex )
+ aSeq[ nIndex ] = *aIt;
+ return aSeq;
+}
+
+template< typename MatrixType >
+/*static*/ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< typename MatrixType::value_type > > ContainerHelper::matrixToSequenceSequence( const MatrixType& rMatrix )
+{
+ typedef typename MatrixType::value_type ValueType;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ValueType > > aSeq;
+ if( !rMatrix.empty() )
+ {
+ aSeq.realloc( static_cast< sal_Int32 >( rMatrix.height() ) );
+ for( size_t nRow = 0, nHeight = rMatrix.height(); nRow < nHeight; ++nRow )
+ aSeq[ static_cast< sal_Int32 >( nRow ) ] =
+ ::com::sun::star::uno::Sequence< ValueType >( &rMatrix.row_front( nRow ), static_cast< sal_Int32 >( rMatrix.width() ) );
+ }
+ return aSeq;
+}
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/graphichelper.hxx b/include/oox/helper/graphichelper.hxx
new file mode 100644
index 000000000000..0681716bc84f
--- /dev/null
+++ b/include/oox/helper/graphichelper.hxx
@@ -0,0 +1,168 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_HELPER_GRAPHICHELPER_HXX
+#define OOX_HELPER_GRAPHICHELPER_HXX
+
+#include <deque>
+#include <map>
+#include <rtl/ustring.hxx>
+#include <com/sun/star/awt/DeviceInfo.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include "oox/helper/binarystreambase.hxx"
+#include "oox/helper/storagebase.hxx"
+
+struct WMF_EXTERNALHEADER;
+
+namespace com { namespace sun { namespace star {
+ namespace awt { struct Point; }
+ namespace awt { struct Size; }
+ namespace awt { class XUnitConversion; }
+ namespace io { class XInputStream; }
+ namespace frame { class XFrame; }
+ namespace graphic { class XGraphic; }
+ namespace graphic { class XGraphicObject; }
+ namespace graphic { class XGraphicProvider; }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace oox {
+
+// ============================================================================
+
+/** Provides helper functions for colors, device measurement conversion,
+ graphics, and graphic objects handling.
+
+ All createGraphicObject() and importGraphicObject() functions create
+ persistent graphic objects internally and store them in an internal
+ container to prevent their early destruction. This makes it possible to use
+ the returned URL of the graphic object in any way (e.g. insert it into a
+ property map) without needing to store it immediately at an object that
+ resolves the graphic object from the passed URL and thus prevents it from
+ being destroyed.
+ */
+class OOX_DLLPUBLIC GraphicHelper
+{
+public:
+ explicit GraphicHelper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxTargetFrame,
+ const StorageRef& rxStorage );
+ virtual ~GraphicHelper();
+
+ // System colors and predefined colors ------------------------------------
+
+ /** Returns a system color specified by the passed XML token identifier. */
+ sal_Int32 getSystemColor( sal_Int32 nToken, sal_Int32 nDefaultRgb = API_RGB_TRANSPARENT ) const;
+ /** Derived classes may implement to resolve a scheme color from the passed XML token identifier. */
+ virtual sal_Int32 getSchemeColor( sal_Int32 nToken ) const;
+ /** Derived classes may implement to resolve a palette index to an RGB color. */
+ virtual sal_Int32 getPaletteColor( sal_Int32 nPaletteIdx ) const;
+
+ // Device info and device dependent unit conversion -----------------------
+
+ /** Returns information about the output device. */
+ const ::com::sun::star::awt::DeviceInfo& getDeviceInfo() const;
+
+ /** Converts the passed value from horizontal screen pixels to 1/100 mm. */
+ sal_Int32 convertScreenPixelXToHmm( double fPixelX ) const;
+ /** Converts the passed value from vertical screen pixels to 1/100 mm. */
+ sal_Int32 convertScreenPixelYToHmm( double fPixelY ) const;
+ /** Converts the passed size from screen pixels to 1/100 mm. */
+ ::com::sun::star::awt::Size convertScreenPixelToHmm( const ::com::sun::star::awt::Size& rPixel ) const;
+
+ /** Converts the passed value from 1/100 mm to horizontal screen pixels. */
+ double convertHmmToScreenPixelX( sal_Int32 nHmmX ) const;
+ /** Converts the passed value from 1/100 mm to vertical screen pixels. */
+ double convertHmmToScreenPixelY( sal_Int32 nHmmY ) const;
+ /** Converts the passed point from 1/100 mm to screen pixels. */
+ ::com::sun::star::awt::Point convertHmmToScreenPixel( const ::com::sun::star::awt::Point& rHmm ) const;
+ /** Converts the passed size from 1/100 mm to screen pixels. */
+ ::com::sun::star::awt::Size convertHmmToScreenPixel( const ::com::sun::star::awt::Size& rHmm ) const;
+
+ /** Converts the passed point from 1/100 mm to AppFont units. */
+ ::com::sun::star::awt::Point convertHmmToAppFont( const ::com::sun::star::awt::Point& rHmm ) const;
+ /** Converts the passed size from 1/100 mm to AppFont units. */
+ ::com::sun::star::awt::Size convertHmmToAppFont( const ::com::sun::star::awt::Size& rHmm ) const;
+
+ // Graphics and graphic objects ------------------------------------------
+
+ /** Imports a graphic from the passed input stream. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
+ importGraphic(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
+ const WMF_EXTERNALHEADER* pExtHeader = NULL ) const;
+
+ /** Imports a graphic from the passed binary memory block. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
+ importGraphic( const StreamDataSequence& rGraphicData ) const;
+
+ /** Imports a graphic from the storage stream with the passed path and name. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
+ importEmbeddedGraphic( const OUString& rStreamName ) const;
+
+ /** Creates a persistent graphic object from the passed graphic.
+ @return The URL of the created and internally cached graphic object. */
+ OUString createGraphicObject(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic ) const;
+
+ /** Creates a persistent graphic object from the passed input stream.
+ @return The URL of the created and internally cached graphic object. */
+ OUString importGraphicObject(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
+ const WMF_EXTERNALHEADER* pExtHeader = NULL ) const;
+
+ /** Creates a persistent graphic object from the passed binary memory block.
+ @return The URL of the created and internally cached graphic object. */
+ OUString importGraphicObject( const StreamDataSequence& rGraphicData ) const;
+
+ /** Imports a graphic object from the storage stream with the passed path and name.
+ @return The URL of the created and internally cached graphic object. */
+ OUString importEmbeddedGraphicObject( const OUString& rStreamName ) const;
+
+ /** calculates the orignal size of a graphic which is necessary to be able to calculate cropping values
+ @return The original Graphic size in 100thmm */
+ ::com::sun::star::awt::Size getOriginalSize( const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic ) const;
+
+ // ------------------------------------------------------------------------
+private:
+ typedef ::std::map< sal_Int32, sal_Int32 > SystemPalette;
+ typedef ::std::deque< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > > GraphicObjectDeque;
+ typedef ::std::map< OUString, ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > > EmbeddedGraphicMap;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicProvider > mxGraphicProvider;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XUnitConversion > mxUnitConversion;
+ ::com::sun::star::awt::DeviceInfo maDeviceInfo; ///< Current output device info.
+ SystemPalette maSystemPalette; ///< Maps system colors (XML tokens) to RGB color values.
+ StorageRef mxStorage; ///< Storage containing embedded graphics.
+ mutable GraphicObjectDeque maGraphicObjects; ///< Caches all created graphic objects to keep them alive.
+ mutable EmbeddedGraphicMap maEmbeddedGraphics; ///< Maps all embedded graphics by their storage path.
+ const OUString maGraphicObjScheme; ///< The URL scheme name for graphic objects.
+ double mfPixelPerHmmX; ///< Number of screen pixels per 1/100 mm in X direction.
+ double mfPixelPerHmmY; ///< Number of screen pixels per 1/100 mm in Y direction.
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/helper.hxx b/include/oox/helper/helper.hxx
new file mode 100644
index 000000000000..4f8e738354d4
--- /dev/null
+++ b/include/oox/helper/helper.hxx
@@ -0,0 +1,334 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_HELPER_HELPER_HXX
+#define OOX_HELPER_HELPER_HXX
+
+#include <algorithm>
+#include <limits>
+#include <boost/static_assert.hpp>
+#include <osl/endian.h>
+#include <rtl/math.hxx>
+#include <rtl/string.hxx>
+#include <rtl/ustring.hxx>
+#include <string.h>
+
+namespace oox {
+
+// Helper macros ==============================================================
+
+/** Expands to the number of elements in a STATIC data array. */
+#define STATIC_ARRAY_SIZE( array ) \
+ (sizeof(array)/sizeof(*(array)))
+
+/** Expands to a pointer behind the last element of a STATIC data array (like
+ STL end()). */
+#define STATIC_ARRAY_END( array ) \
+ ((array)+STATIC_ARRAY_SIZE(array))
+
+/** Expands to the 'index'-th element of a STATIC data array, or to 'def', if
+ 'index' is out of the array limits. */
+#define STATIC_ARRAY_SELECT( array, index, def ) \
+ ((static_cast<size_t>(index) < STATIC_ARRAY_SIZE(array)) ? ((array)[static_cast<size_t>(index)]) : (def))
+
+/** Expands to a temporary OString, created from a literal(!) character
+ array. */
+#define CREATE_OSTRING( ascii ) \
+ OString( RTL_CONSTASCII_STRINGPARAM( ascii ) )
+
+/** Convert an OUString to an ASCII C string. Use for debug purposes only. */
+#define OUSTRING_TO_CSTR( str ) \
+ OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ).getStr()
+
+// Common constants ===========================================================
+
+const sal_uInt8 WINDOWS_CHARSET_ANSI = 0;
+const sal_uInt8 WINDOWS_CHARSET_DEFAULT = 1;
+const sal_uInt8 WINDOWS_CHARSET_SYMBOL = 2;
+const sal_uInt8 WINDOWS_CHARSET_APPLE_ROMAN = 77;
+const sal_uInt8 WINDOWS_CHARSET_SHIFTJIS = 128;
+const sal_uInt8 WINDOWS_CHARSET_HANGEUL = 129;
+const sal_uInt8 WINDOWS_CHARSET_JOHAB = 130;
+const sal_uInt8 WINDOWS_CHARSET_GB2312 = 134;
+const sal_uInt8 WINDOWS_CHARSET_BIG5 = 136;
+const sal_uInt8 WINDOWS_CHARSET_GREEK = 161;
+const sal_uInt8 WINDOWS_CHARSET_TURKISH = 162;
+const sal_uInt8 WINDOWS_CHARSET_VIETNAMESE = 163;
+const sal_uInt8 WINDOWS_CHARSET_HEBREW = 177;
+const sal_uInt8 WINDOWS_CHARSET_ARABIC = 178;
+const sal_uInt8 WINDOWS_CHARSET_BALTIC = 186;
+const sal_uInt8 WINDOWS_CHARSET_RUSSIAN = 204;
+const sal_uInt8 WINDOWS_CHARSET_THAI = 222;
+const sal_uInt8 WINDOWS_CHARSET_EASTERN = 238;
+const sal_uInt8 WINDOWS_CHARSET_OEM = 255;
+
+// ----------------------------------------------------------------------------
+
+const sal_Int32 API_RGB_TRANSPARENT = -1; ///< Transparent color for API calls.
+const sal_Int32 API_RGB_BLACK = 0x000000; ///< Black color for API calls.
+const sal_Int32 API_RGB_GRAY = 0x808080; ///< Gray color for API calls.
+const sal_Int32 API_RGB_WHITE = 0xFFFFFF; ///< White color for API calls.
+
+const sal_Int16 API_LINE_SOLID = 0;
+const sal_Int16 API_LINE_DOTTED = 1;
+const sal_Int16 API_LINE_DASHED = 2;
+
+const sal_Int16 API_LINE_NONE = 0;
+const sal_Int16 API_LINE_HAIR = 2;
+const sal_Int16 API_LINE_THIN = 35;
+const sal_Int16 API_LINE_MEDIUM = 88;
+const sal_Int16 API_LINE_THICK = 141;
+
+const sal_Int16 API_ESCAPE_NONE = 0; ///< No escapement.
+const sal_Int16 API_ESCAPE_SUPERSCRIPT = 101; ///< Superscript: raise characters automatically (magic value 101).
+const sal_Int16 API_ESCAPE_SUBSCRIPT = -101; ///< Subscript: lower characters automatically (magic value -101).
+
+const sal_Int8 API_ESCAPEHEIGHT_NONE = 100; ///< Relative character height if not escaped.
+const sal_Int8 API_ESCAPEHEIGHT_DEFAULT = 58; ///< Relative character height if escaped.
+
+// ============================================================================
+
+// Limitate values ------------------------------------------------------------
+
+template< typename ReturnType, typename Type >
+inline ReturnType getLimitedValue( Type nValue, Type nMin, Type nMax )
+{
+ return static_cast< ReturnType >( ::std::min( ::std::max( nValue, nMin ), nMax ) );
+}
+
+template< typename ReturnType, typename Type >
+inline ReturnType getIntervalValue( Type nValue, Type nBegin, Type nEnd )
+{
+// this BOOST_STATIC_ASSERT fails with suncc
+// BOOST_STATIC_ASSERT( ::std::numeric_limits< Type >::is_integer );
+ Type nInterval = nEnd - nBegin;
+ Type nCount = (nValue < nBegin) ? -((nBegin - nValue - 1) / nInterval + 1) : ((nValue - nBegin) / nInterval);
+ return static_cast< ReturnType >( nValue - nCount * nInterval );
+}
+
+template< typename ReturnType >
+inline ReturnType getDoubleIntervalValue( double fValue, double fBegin, double fEnd )
+{
+ double fInterval = fEnd - fBegin;
+ double fCount = (fValue < fBegin) ? -(::rtl::math::approxFloor( (fBegin - fValue - 1.0) / fInterval ) + 1.0) : ::rtl::math::approxFloor( (fValue - fBegin) / fInterval );
+ return static_cast< ReturnType >( fValue - fCount * fInterval );
+}
+
+// Read from bitfields --------------------------------------------------------
+
+/** Returns true, if at least one of the bits set in nMask is set in nBitField. */
+template< typename Type >
+inline bool getFlag( Type nBitField, Type nMask )
+{
+ return (nBitField & nMask) != 0;
+}
+
+/** Returns nSet, if at least one bit of nMask is set in nBitField, otherwise nUnset. */
+template< typename ReturnType, typename Type >
+inline ReturnType getFlagValue( Type nBitField, Type nMask, ReturnType nSet, ReturnType nUnset )
+{
+ return getFlag( nBitField, nMask ) ? nSet : nUnset;
+}
+
+/** Extracts a value from a bit field.
+
+ Returns the data fragment from nBitField, that starts at bit nStartBit
+ (0-based, bit 0 is rightmost) with the width of nBitCount. The returned
+ value will be right-aligned (normalized).
+ For instance: extractValue<T>(0x4321,8,4) returns 3 (value in bits 8-11).
+ */
+template< typename ReturnType, typename Type >
+inline ReturnType extractValue( Type nBitField, sal_uInt8 nStartBit, sal_uInt8 nBitCount )
+{
+ sal_uInt64 nMask = 1; nMask <<= nBitCount; --nMask;
+ return static_cast< ReturnType >( nMask & (nBitField >> nStartBit) );
+}
+
+// Write to bitfields ---------------------------------------------------------
+
+/** Sets or clears (according to bSet) all set bits of nMask in ornBitField. */
+template< typename Type >
+inline void setFlag( Type& ornBitField, Type nMask, bool bSet = true )
+{
+ if( bSet ) ornBitField |= nMask; else ornBitField &= ~nMask;
+}
+
+/** Inserts a value into a bitfield.
+
+ Inserts the lower nBitCount bits of nValue into ornBitField, starting
+ there at bit nStartBit. Other contents of ornBitField keep unchanged.
+ */
+template< typename Type, typename InsertType >
+void insertValue( Type& ornBitField, InsertType nValue, sal_uInt8 nStartBit, sal_uInt8 nBitCount )
+{
+ sal_uInt64 nMask = 1; nMask <<= nBitCount; --nMask;
+ Type nNewValue = static_cast< Type >( nValue & nMask );
+ (ornBitField &= ~(nMask << nStartBit)) |= (nNewValue << nStartBit);
+}
+
+// ============================================================================
+
+/** Optional value, similar to ::boost::optional<>, with convenience accessors.
+ */
+template< typename Type >
+class OptValue
+{
+public:
+ inline explicit OptValue() : maValue(), mbHasValue( false ) {}
+ inline explicit OptValue( const Type& rValue ) : maValue( rValue ), mbHasValue( true ) {}
+ inline explicit OptValue( bool bHasValue, const Type& rValue ) : maValue( rValue ), mbHasValue( bHasValue ) {}
+
+ inline bool has() const { return mbHasValue; }
+ inline bool operator!() const { return !mbHasValue; }
+ inline bool differsFrom( const Type& rValue ) const { return mbHasValue && (maValue != rValue); }
+
+ inline const Type& get() const { return maValue; }
+ inline const Type& get( const Type& rDefValue ) const { return mbHasValue ? maValue : rDefValue; }
+
+ inline void reset() { mbHasValue = false; }
+ inline void set( const Type& rValue ) { maValue = rValue; mbHasValue = true; }
+ inline Type& use() { mbHasValue = true; return maValue; }
+
+ inline OptValue& operator=( const Type& rValue ) { set( rValue ); return *this; }
+ inline bool operator==( const OptValue& rValue ) const {
+ return ( ( mbHasValue == false && rValue.mbHasValue == false ) ||
+ ( mbHasValue == rValue.mbHasValue && maValue == rValue.maValue ) );
+ }
+ inline void assignIfUsed( const OptValue& rValue ) { if( rValue.mbHasValue ) set( rValue.maValue ); }
+
+private:
+ Type maValue;
+ bool mbHasValue;
+};
+
+// ============================================================================
+
+/** Provides platform independent functions to convert from or to little-endian
+ byte order, e.g. for reading data from or writing data to memory or a
+ binary stream.
+
+ On big-endian platforms, the byte order in the passed values is swapped,
+ this can be used for converting big-endian to and from little-endian data.
+
+ On little-endian platforms, the conversion functions are implemented empty,
+ thus compilers should completely optimize away the function call.
+ */
+class ByteOrderConverter
+{
+public:
+#ifdef OSL_BIGENDIAN
+ inline static void convertLittleEndian( sal_Int8& ) {} // present for usage in templates
+ inline static void convertLittleEndian( sal_uInt8& ) {} // present for usage in templates
+ inline static void convertLittleEndian( sal_Int16& rnValue ) { swap2( reinterpret_cast< sal_uInt8* >( &rnValue ) ); }
+ inline static void convertLittleEndian( sal_uInt16& rnValue ) { swap2( reinterpret_cast< sal_uInt8* >( &rnValue ) ); }
+ inline static void convertLittleEndian( sal_Int32& rnValue ) { swap4( reinterpret_cast< sal_uInt8* >( &rnValue ) ); }
+ inline static void convertLittleEndian( sal_uInt32& rnValue ) { swap4( reinterpret_cast< sal_uInt8* >( &rnValue ) ); }
+ inline static void convertLittleEndian( sal_Int64& rnValue ) { swap8( reinterpret_cast< sal_uInt8* >( &rnValue ) ); }
+ inline static void convertLittleEndian( sal_uInt64& rnValue ) { swap8( reinterpret_cast< sal_uInt8* >( &rnValue ) ); }
+ inline static void convertLittleEndian( float& rfValue ) { swap4( reinterpret_cast< sal_uInt8* >( &rfValue ) ); }
+ inline static void convertLittleEndian( double& rfValue ) { swap8( reinterpret_cast< sal_uInt8* >( &rfValue ) ); }
+
+ template< typename Type >
+ inline static void convertLittleEndianArray( Type* pnArray, size_t nElemCount );
+
+ inline static void convertLittleEndianArray( sal_Int8*, size_t ) {}
+ inline static void convertLittleEndianArray( sal_uInt8*, size_t ) {}
+
+#else
+ template< typename Type >
+ inline static void convertLittleEndian( Type& ) {}
+
+ template< typename Type >
+ inline static void convertLittleEndianArray( Type*, size_t ) {}
+
+#endif
+
+ /** Reads a value from memory, assuming memory buffer in little-endian.
+ @param ornValue (out-parameter) Contains the value read from memory.
+ @param pSrcBuffer The memory buffer to read the value from.
+ */
+ template< typename Type >
+ inline static void readLittleEndian( Type& ornValue, const void* pSrcBuffer );
+
+ /** Writes a value to memory, while converting it to little-endian.
+ @param pDstBuffer The memory buffer to write the value to.
+ @param nValue The value to be written to memory in little-endian.
+ */
+ template< typename Type >
+ inline static void writeLittleEndian( void* pDstBuffer, Type nValue );
+
+#ifdef OSL_BIGENDIAN
+private:
+ inline static void swap2( sal_uInt8* pnData );
+ inline static void swap4( sal_uInt8* pnData );
+ inline static void swap8( sal_uInt8* pnData );
+#endif
+};
+
+// ----------------------------------------------------------------------------
+
+template< typename Type >
+inline void ByteOrderConverter::readLittleEndian( Type& ornValue, const void* pSrcBuffer )
+{
+ memcpy( &ornValue, pSrcBuffer, sizeof( Type ) );
+ convertLittleEndian( ornValue );
+}
+
+template< typename Type >
+inline void ByteOrderConverter::writeLittleEndian( void* pDstBuffer, Type nValue )
+{
+ convertLittleEndian( nValue );
+ memcpy( pDstBuffer, &nValue, sizeof( Type ) );
+}
+
+#ifdef OSL_BIGENDIAN
+template< typename Type >
+inline void ByteOrderConverter::convertLittleEndianArray( Type* pnArray, size_t nElemCount )
+{
+ for( Type* pnArrayEnd = pnArray + nElemCount; pnArray != pnArrayEnd; ++pnArray )
+ convertLittleEndian( *pnArray );
+}
+
+inline void ByteOrderConverter::swap2( sal_uInt8* pnData )
+{
+ ::std::swap( pnData[ 0 ], pnData[ 1 ] );
+}
+
+inline void ByteOrderConverter::swap4( sal_uInt8* pnData )
+{
+ ::std::swap( pnData[ 0 ], pnData[ 3 ] );
+ ::std::swap( pnData[ 1 ], pnData[ 2 ] );
+}
+
+inline void ByteOrderConverter::swap8( sal_uInt8* pnData )
+{
+ ::std::swap( pnData[ 0 ], pnData[ 7 ] );
+ ::std::swap( pnData[ 1 ], pnData[ 6 ] );
+ ::std::swap( pnData[ 2 ], pnData[ 5 ] );
+ ::std::swap( pnData[ 3 ], pnData[ 4 ] );
+}
+#endif
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/modelobjecthelper.hxx b/include/oox/helper/modelobjecthelper.hxx
new file mode 100644
index 000000000000..253279a4c05a
--- /dev/null
+++ b/include/oox/helper/modelobjecthelper.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 OOX_HELPER_MODELOBJECTHELPER_HXX
+#define OOX_HELPER_MODELOBJECTHELPER_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace awt { struct Gradient; }
+ namespace container { class XNameContainer; }
+ namespace drawing { struct LineDash; }
+ namespace drawing { struct PolyPolygonBezierCoords; }
+ namespace lang { class XMultiServiceFactory; }
+} } }
+
+namespace oox {
+
+// ============================================================================
+
+/** This helper manages named objects in a container, which is created on demand.
+ */
+class OOX_DLLPUBLIC ObjectContainer
+{
+public:
+ explicit ObjectContainer(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory,
+ const OUString& rServiceName );
+ ~ObjectContainer();
+
+ /** Returns true, if the object with the passed name exists in the container. */
+ bool hasObject( const OUString& rObjName ) const;
+
+ /** Inserts the passed object into the container, returns its final name. */
+ OUString insertObject(
+ const OUString& rObjName,
+ const ::com::sun::star::uno::Any& rObj,
+ bool bInsertByUnusedName );
+
+private:
+ void createContainer() const;
+
+private:
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
+ mxModelFactory; ///< Factory to create the container.
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ mxContainer; ///< Container for the objects.
+ OUString maServiceName; ///< Service name to create the container.
+ sal_Int32 mnIndex; ///< Index to create unique identifiers.
+};
+
+// ============================================================================
+
+/** Contains tables for named drawing objects for a document model.
+
+ Contains tables for named line markers, line dashes, fill gradients, and
+ fill bitmap URLs. The class is needed to handle different document models
+ in the same filter (e.g. embedded charts) which carry their own drawing
+ object tables.
+ */
+class OOX_DLLPUBLIC ModelObjectHelper
+{
+public:
+ explicit ModelObjectHelper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory );
+
+ /** Returns true, if the model contains a line marker with the passed name. */
+ bool hasLineMarker( const OUString& rMarkerName ) const;
+
+ /** Inserts a new named line marker, overwrites an existing line marker
+ with the same name. Returns true, if the marker could be inserted. */
+ bool insertLineMarker(
+ const OUString& rMarkerName,
+ const ::com::sun::star::drawing::PolyPolygonBezierCoords& rMarker );
+
+ /** Inserts a new named line dash, returns the line dash name, based on an
+ internal constant name with a new unused index appended. */
+ OUString insertLineDash( const ::com::sun::star::drawing::LineDash& rDash );
+
+ /** Inserts a new named fill gradient, returns the gradient name, based on
+ an internal constant name with a new unused index appended. */
+ OUString insertFillGradient( const ::com::sun::star::awt::Gradient& rGradient );
+
+ OUString insertTransGrandient( const ::com::sun::star::awt::Gradient& rGradient );
+
+ /** Inserts a new named fill bitmap URL, returns the bitmap name, based on
+ an internal constant name with a new unused index appended. */
+ OUString insertFillBitmapUrl( const OUString& rGraphicUrl );
+
+private:
+ ObjectContainer maMarkerContainer; ///< Contains all named line markers (line end polygons).
+ ObjectContainer maDashContainer; ///< Contains all named line dsahes.
+ ObjectContainer maGradientContainer; ///< Contains all named fill gradients.
+ ObjectContainer maTransGradContainer; ///< Contains all named transparency Gradients.
+ ObjectContainer maBitmapUrlContainer; ///< Contains all named fill bitmap URLs.
+ const OUString maDashNameBase; ///< Base name for all named line dashes.
+ const OUString maGradientNameBase; ///< Base name for all named fill gradients.
+ const OUString maTransGradNameBase; ///< Base name for all named fill gradients.
+ const OUString maBitmapUrlNameBase; ///< Base name for all named fill bitmap URLs.
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/progressbar.hxx b/include/oox/helper/progressbar.hxx
new file mode 100644
index 000000000000..ba0bdcfbb5c9
--- /dev/null
+++ b/include/oox/helper/progressbar.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 OOX_HELPER_PROGRESSBAR_HXX
+#define OOX_HELPER_PROGRESSBAR_HXX
+
+#include <boost/shared_ptr.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include "oox/dllapi.h"
+
+
+namespace com { namespace sun { namespace star {
+ namespace task { class XStatusIndicator; }
+} } }
+
+namespace oox {
+
+// Interfaces =================================================================
+
+/** Interface for progress bar classes.
+ */
+class IProgressBar
+{
+public:
+ virtual ~IProgressBar();
+
+ /** Returns the current position of the progress bar.
+
+ @return Position of the progress bar, in the range from 0.0 (beginning
+ of the progress bar) to 1.0 (end of the progress bar) inclusive.
+ */
+ virtual double getPosition() const = 0;
+
+ /** Sets the current position of the progress bar.
+
+ @param fPosition New position of the progress bar, in the range from
+ 0.0 (beginning of the progress bar) to 1.0 (end of the progress bar)
+ inclusive.
+ */
+ virtual void setPosition( double fPosition ) = 0;
+};
+
+typedef ::boost::shared_ptr< IProgressBar > IProgressBarRef;
+
+// ----------------------------------------------------------------------------
+
+class ISegmentProgressBar;
+typedef ::boost::shared_ptr< ISegmentProgressBar > ISegmentProgressBarRef;
+
+/** Interface for a segment in a progress bar, that is able to create sub
+ segments from itself.
+ */
+class ISegmentProgressBar : public IProgressBar
+{
+public:
+ virtual ~ISegmentProgressBar();
+
+ /** Returns the length that is still free for creating sub segments. */
+ virtual double getFreeLength() const = 0;
+
+ /** Adds a new segment with the specified length. */
+ virtual ISegmentProgressBarRef createSegment( double fLength ) = 0;
+};
+
+// ============================================================================
+// ============================================================================
+
+/** A simple progress bar.
+ */
+class OOX_DLLPUBLIC ProgressBar : public IProgressBar
+{
+public:
+ explicit ProgressBar(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator >& rxIndicator,
+ const OUString& rText );
+
+ virtual ~ProgressBar();
+
+ /** Returns the current position of the progress bar. */
+ virtual double getPosition() const;
+ /** Sets the current position of the progress bar. */
+ virtual void setPosition( double fPosition );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator >
+ mxIndicator;
+ double mfPosition;
+};
+
+// ============================================================================
+
+/** A progress bar containing several independent segments.
+ */
+class OOX_DLLPUBLIC SegmentProgressBar : public ISegmentProgressBar
+{
+public:
+ explicit SegmentProgressBar(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator >& rxIndicator,
+ const OUString& rText );
+
+ /** Returns the current position of the progress bar segment. */
+ virtual double getPosition() const;
+ /** Sets the current position of the progress bar segment. */
+ virtual void setPosition( double fPosition );
+
+ /** Returns the length that is still free for creating sub segments. */
+ virtual double getFreeLength() const;
+ /** Adds a new segment with the specified length. */
+ virtual ISegmentProgressBarRef createSegment( double fLength );
+
+private:
+ ProgressBar maProgress;
+ double mfFreeStart;
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/propertymap.hxx b/include/oox/helper/propertymap.hxx
new file mode 100644
index 000000000000..d03d891d93b5
--- /dev/null
+++ b/include/oox/helper/propertymap.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 OOX_HELPER_PROPERTYMAP_HXX
+#define OOX_HELPER_PROPERTYMAP_HXX
+
+#include <vector>
+#include <map>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <rtl/ustring.hxx>
+#include "oox/token/properties.hxx"
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star { namespace beans {
+ struct PropertyValue;
+ class XPropertySet;
+} } } }
+
+namespace oox {
+
+struct PropertyNameVector;
+
+// ============================================================================
+
+typedef ::std::map< sal_Int32, ::com::sun::star::uno::Any > PropertyMapBase;
+
+/** A helper that maps property identifiers to property values.
+
+ The property identifiers are generated on compile time and refer to the
+ property name strings that are held by a static vector. The identifier to
+ name mapping is done internally while the properties are written to
+ property sets.
+ */
+class OOX_DLLPUBLIC PropertyMap : public PropertyMapBase
+{
+public:
+ explicit PropertyMap();
+
+ /** Returns the name of the passed property identifier. */
+ static const OUString& getPropertyName( sal_Int32 nPropId );
+
+ /** Returns true, if the map contains a property with the passed identifier. */
+ inline bool hasProperty( sal_Int32 nPropId ) const
+ { return find( nPropId ) != end(); }
+
+ /** Sets the specified property to the passed value. Does nothing, if the
+ identifier is invalid. */
+ inline bool setAnyProperty( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue )
+ { if( nPropId < 0 ) return false; (*this)[ nPropId ] = rValue; return true; }
+
+ /** Sets the specified property to the passed value. Does nothing, if the
+ identifier is invalid. */
+ template< typename Type >
+ inline bool setProperty( sal_Int32 nPropId, const Type& rValue )
+ { if( nPropId < 0 ) return false; (*this)[ nPropId ] <<= rValue; return true; }
+
+ /** Inserts all properties contained in the passed property map. */
+ inline void assignUsed( const PropertyMap& rPropMap )
+ { insert( rPropMap.begin(), rPropMap.end() ); }
+
+ /** Inserts all properties contained in the passed property map */
+ void assignAll( const PropertyMap& rPropMap );
+
+ /** Returns a sequence of property values, filled with all contained properties. */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
+ makePropertyValueSequence() const;
+
+ /** Fills the passed sequences of names and anys with all contained properties. */
+ void fillSequences(
+ ::com::sun::star::uno::Sequence< OUString >& rNames,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rValues ) const;
+
+ /** Creates a property set supporting the XPropertySet interface and inserts all properties. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+ makePropertySet() const;
+
+#if OSL_DEBUG_LEVEL > 0
+#ifdef DBG_UTIL
+ static void dump( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet);
+#endif
+ static void dumpCode( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet);
+ void dumpCode();
+#endif
+private:
+ const PropertyNameVector* mpPropNames;
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/propertyset.hxx b/include/oox/helper/propertyset.hxx
new file mode 100644
index 000000000000..2c97b29677fa
--- /dev/null
+++ b/include/oox/helper/propertyset.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 OOX_HELPER_PROPERTYSET_HXX
+#define OOX_HELPER_PROPERTYSET_HXX
+
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include "oox/dllapi.h"
+
+namespace oox {
+
+class PropertyMap;
+
+// ============================================================================
+
+/** A wrapper for a UNO property set.
+
+ This class provides functions to silently get and set properties (without
+ exceptions, without the need to check validity of the UNO property set).
+
+ An instance is constructed with the reference to a UNO property set or any
+ other interface (the constructor will query for the
+ com.sun.star.beans.XPropertySet interface then). The reference to the
+ property set will be kept as long as the instance of this class is alive.
+
+ The functions setProperties() tries to handle all passed values at once,
+ using the com.sun.star.beans.XMultiPropertySet interface. If the
+ implementation does not support the XMultiPropertySet interface, all
+ properties are handled separately in a loop.
+ */
+class OOX_DLLPUBLIC PropertySet
+{
+public:
+ inline explicit PropertySet() {}
+
+ /** Constructs a property set wrapper with the passed UNO property set. */
+ inline explicit PropertySet(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rxPropSet )
+ { set( rxPropSet ); }
+
+ /** Constructs a property set wrapper after querying the XPropertySet interface. */
+ template< typename Type >
+ inline explicit PropertySet( const Type& rObject ) { set( rObject ); }
+
+ /** Sets the passed UNO property set and releases the old UNO property set. */
+ void set( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rxPropSet );
+
+ /** Queries the passed object (interface or any) for an XPropertySet and releases the old UNO property set. */
+ template< typename Type >
+ inline void set( const Type& rObject )
+ { set( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >( rObject, ::com::sun::star::uno::UNO_QUERY ) ); }
+
+ /** Returns true, if the contained XPropertySet interface is valid. */
+ inline bool is() const { return mxPropSet.is(); }
+
+ /** Returns the contained XPropertySet interface. */
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+ getXPropertySet() const { return mxPropSet; }
+
+ /** Returns true, if the specified property is supported by the property set. */
+ bool hasProperty( sal_Int32 nPropId ) const;
+
+ // Get properties ---------------------------------------------------------
+
+ /** Gets the specified property from the property set.
+ @return the property value, or an empty Any, if the property is missing. */
+ ::com::sun::star::uno::Any getAnyProperty( sal_Int32 nPropId ) const;
+
+ /** Gets the specified property from the property set.
+ @return true, if the passed variable could be filled with the property value. */
+ template< typename Type >
+ inline bool getProperty( Type& orValue, sal_Int32 nPropId ) const
+ { return getAnyProperty( nPropId ) >>= orValue; }
+
+ /** Gets the specified boolean property from the property set.
+ @return true = property contains true; false = property contains false or error occurred. */
+ inline bool getBoolProperty( sal_Int32 nPropId ) const
+ { bool bValue = false; return getProperty( bValue, nPropId ) && bValue; }
+ // Set properties ---------------------------------------------------------
+
+ /** Puts the passed any into the property set. */
+ bool setAnyProperty( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+
+ /** Puts the passed value into the property set. */
+ template< typename Type >
+ inline bool setProperty( sal_Int32 nPropId, const Type& rValue )
+ { return setAnyProperty( nPropId, ::com::sun::star::uno::Any( rValue ) ); }
+
+ /** Puts the passed properties into the property set. Tries to use the XMultiPropertySet interface.
+ @param rPropNames The property names. MUST be ordered alphabetically.
+ @param rValues The related property values. */
+ void setProperties(
+ const ::com::sun::star::uno::Sequence< OUString >& rPropNames,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rValues );
+
+ /** Puts the passed property map into the property set. Tries to use the XMultiPropertySet interface.
+ @param rPropertyMap The property map. */
+ void setProperties( const PropertyMap& rPropertyMap );
+
+#ifdef DBG_UTIL
+ void dump();
+#endif
+
+ // ------------------------------------------------------------------------
+private:
+ /** Gets the specified property from the property set.
+ @return true, if the any could be filled with the property value. */
+ bool implGetPropertyValue( ::com::sun::star::uno::Any& orValue, const OUString& rPropName ) const;
+
+ /** Puts the passed any into the property set. */
+ bool implSetPropertyValue( const OUString& rPropName, const ::com::sun::star::uno::Any& rValue );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+ mxPropSet; ///< The mandatory property set interface.
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet >
+ mxMultiPropSet; ///< The optional multi property set interface.
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
+ mxPropSetInfo; ///< Property information.
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/refmap.hxx b/include/oox/helper/refmap.hxx
new file mode 100644
index 000000000000..c980039442b1
--- /dev/null
+++ b/include/oox/helper/refmap.hxx
@@ -0,0 +1,185 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_HELPER_REFMAP_HXX
+#define OOX_HELPER_REFMAP_HXX
+
+#include <map>
+#include <boost/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <sal/types.h>
+
+namespace oox {
+
+// ============================================================================
+
+/** Template for a map of ref-counted objects with additional accessor functions.
+
+ An instance of the class RefMap< Type > stores elements of the type
+ ::boost::shared_ptr< Type >. The new accessor functions has() and get()
+ work correctly for nonexisting keys, there is no need to check the passed
+ key before.
+ */
+template< typename KeyType, typename ObjType, typename CompType = ::std::less< KeyType > >
+class RefMap : public ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType >
+{
+public:
+ typedef ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > container_type;
+ typedef typename container_type::key_type key_type;
+ typedef typename container_type::mapped_type mapped_type;
+ typedef typename container_type::value_type value_type;
+ typedef typename container_type::key_compare key_compare;
+
+public:
+ /** Returns true, if the object associated to the passed key exists.
+ Returns false, if the key exists but points to an empty reference. */
+ inline bool has( key_type nKey ) const
+ {
+ const mapped_type* pxRef = getRef( nKey );
+ return pxRef && pxRef->get();
+ }
+
+ /** Returns a reference to the object associated to the passed key, or an
+ empty reference on error. */
+ inline mapped_type get( key_type nKey ) const
+ {
+ if( const mapped_type* pxRef = getRef( nKey ) ) return *pxRef;
+ return mapped_type();
+ }
+
+ /** Calls the passed functor for every contained object, automatically
+ skips all elements that are empty references. */
+ template< typename FunctorType >
+ inline void forEach( const FunctorType& rFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( rFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType >
+ inline void forEachMem( FuncType pFunc ) const
+ {
+ forEach( ::boost::bind( pFunc, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMem( FuncType pFunc, ParamType aParam ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3, typename ParamType4 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3, ParamType4 aParam4 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3, aParam4 ) );
+ }
+
+
+ /** Calls the passed functor for every contained object. Passes the key as
+ first argument and the object reference as second argument to rFunctor. */
+ template< typename FunctorType >
+ inline void forEachWithKey( const FunctorType& rFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctorWithKey< FunctorType >( rFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as argument to the member function. */
+ template< typename FuncType >
+ inline void forEachMemWithKey( FuncType pFunc ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as first argument to the member function. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMemWithKey( FuncType pFunc, ParamType aParam ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) );
+ }
+
+private:
+ template< typename FunctorType >
+ struct ForEachFunctor
+ {
+ FunctorType maFunctor;
+ inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( *rValue.second ); }
+ };
+
+ template< typename FunctorType >
+ struct ForEachFunctorWithKey
+ {
+ FunctorType maFunctor;
+ inline explicit ForEachFunctorWithKey( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( rValue.first, *rValue.second ); }
+ };
+
+ inline const mapped_type* getRef( key_type nKey ) const
+ {
+ typename container_type::const_iterator aIt = this->find( nKey );
+ return (aIt == this->end()) ? 0 : &aIt->second;
+ }
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/refvector.hxx b/include/oox/helper/refvector.hxx
new file mode 100644
index 000000000000..c0602b571c23
--- /dev/null
+++ b/include/oox/helper/refvector.hxx
@@ -0,0 +1,195 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_HELPER_REFVECTOR_HXX
+#define OOX_HELPER_REFVECTOR_HXX
+
+#include <vector>
+#include <boost/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <sal/types.h>
+
+namespace oox {
+
+// ============================================================================
+
+/** Template for a vector of ref-counted objects with additional accessor functions.
+
+ An instance of the class RefVector< Type > stores elements of the type
+ ::boost::shared_ptr< Type >. The new accessor functions has() and get()
+ work correctly for indexes out of the current range, there is no need to
+ check the passed index before.
+ */
+template< typename ObjType >
+class RefVector : public ::std::vector< ::boost::shared_ptr< ObjType > >
+{
+public:
+ typedef ::std::vector< ::boost::shared_ptr< ObjType > > container_type;
+ typedef typename container_type::value_type value_type;
+ typedef typename container_type::size_type size_type;
+
+public:
+ /** Returns true, if the object with the passed index exists. Returns
+ false, if the vector element exists but is an empty reference. */
+ inline bool has( sal_Int32 nIndex ) const
+ {
+ const value_type* pxRef = getRef( nIndex );
+ return pxRef && pxRef->get();
+ }
+
+ /** Returns a reference to the object with the passed index, or 0 on error. */
+ inline value_type get( sal_Int32 nIndex ) const
+ {
+ if( const value_type* pxRef = getRef( nIndex ) ) return *pxRef;
+ return value_type();
+ }
+
+ /** Returns the index of the last element, or -1, if the vector is empty.
+ Does *not* check whether the last element is an empty reference. */
+ inline sal_Int32 getLastIndex() const { return static_cast< sal_Int32 >( this->size() ) - 1; }
+
+ /** Calls the passed functor for every contained object, automatically
+ skips all elements that are empty references. */
+ template< typename FunctorType >
+ inline void forEach( FunctorType aFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( aFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType >
+ inline void forEachMem( FuncType pFunc ) const
+ {
+ forEach( ::boost::bind( pFunc, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMem( FuncType pFunc, ParamType aParam ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) );
+ }
+
+ /** Calls the passed functor for every contained object. Passes the index as
+ first argument and the object reference as second argument to rFunctor. */
+ template< typename FunctorType >
+ inline void forEachWithIndex( const FunctorType& rFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctorWithIndex< FunctorType >( rFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index to the member function. */
+ template< typename FuncType >
+ inline void forEachMemWithIndex( FuncType pFunc ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index as first argument to the member function. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMemWithIndex( FuncType pFunc, ParamType aParam ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) );
+ }
+
+ /** Searches for an element by using the passed functor that takes a
+ constant reference of the object type (const ObjType&). */
+ template< typename FunctorType >
+ inline value_type findIf( const FunctorType& rFunctor ) const
+ {
+ typename container_type::const_iterator aIt = ::std::find_if( this->begin(), this->end(), FindFunctor< FunctorType >( rFunctor ) );
+ return (aIt == this->end()) ? value_type() : *aIt;
+ }
+
+private:
+ template< typename FunctorType >
+ struct ForEachFunctor
+ {
+ FunctorType maFunctor;
+ inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( *rxValue ); }
+ };
+
+ template< typename FunctorType >
+ struct ForEachFunctorWithIndex
+ {
+ FunctorType maFunctor;
+ sal_Int32 mnIndex;
+ inline explicit ForEachFunctorWithIndex( const FunctorType& rFunctor ) : maFunctor( rFunctor ), mnIndex( 0 ) {}
+ inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( mnIndex, *rxValue ); ++mnIndex; }
+ };
+
+ template< typename FunctorType >
+ struct FindFunctor
+ {
+ FunctorType maFunctor;
+ inline explicit FindFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline bool operator()( const value_type& rxValue ) { return rxValue.get() && maFunctor( *rxValue ); }
+ };
+
+ inline const value_type* getRef( sal_Int32 nIndex ) const
+ {
+ return ((0 <= nIndex) && (static_cast< size_type >( nIndex ) < this->size())) ?
+ &(*this)[ static_cast< size_type >( nIndex ) ] : 0;
+ }
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/storagebase.hxx b/include/oox/helper/storagebase.hxx
new file mode 100644
index 000000000000..f318f01b4768
--- /dev/null
+++ b/include/oox/helper/storagebase.hxx
@@ -0,0 +1,191 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_HELPER_STORAGEBASE_HXX
+#define OOX_HELPER_STORAGEBASE_HXX
+
+#include <vector>
+#include <com/sun/star/uno/Reference.hxx>
+#include "oox/helper/refmap.hxx"
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace embed { class XStorage; }
+ namespace io { class XInputStream; }
+ namespace io { class XOutputStream; }
+ namespace io { class XStream; }
+} } }
+
+namespace oox {
+
+// ============================================================================
+
+class StorageBase;
+typedef ::boost::shared_ptr< StorageBase > StorageRef;
+
+/** Base class for storage access implementations.
+
+ Derived classes will be used to encapsulate storage access implementations
+ for ZIP storages containing XML streams, and OLE storages containing binary
+ data streams.
+ */
+class OOX_DLLPUBLIC StorageBase
+{
+public:
+ explicit StorageBase(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream,
+ bool bBaseStreamAccess );
+
+ explicit StorageBase(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream,
+ bool bBaseStreamAccess );
+
+ virtual ~StorageBase();
+
+ /** Returns true, if the object represents a valid storage. */
+ bool isStorage() const;
+
+ /** Returns true, if the object represents the root storage. */
+ bool isRootStorage() const;
+
+ /** Returns true, if the storage operates in read-only mode (based on an
+ input stream). */
+ bool isReadOnly() const;
+
+ /** Returns the com.sun.star.embed.XStorage interface of the current storage. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ getXStorage() const;
+
+ /** Returns the element name of this storage. */
+ const OUString& getName() const;
+
+ /** Returns the full path of this storage. */
+ OUString getPath() const;
+
+ /** Fills the passed vector with the names of all direct elements of this
+ storage. */
+ void getElementNames( ::std::vector< OUString >& orElementNames ) const;
+
+ /** Opens and returns the specified sub storage from the storage.
+
+ @param rStorageName
+ The name of the embedded storage. The name may contain slashes to
+ open storages from embedded substorages.
+ @param bCreateMissing
+ True = create missing sub storages (for export filters). Must be
+ false for storages based on input streams.
+ */
+ StorageRef openSubStorage( const OUString& rStorageName, bool bCreateMissing );
+
+ /** Opens and returns the specified input stream from the storage.
+
+ @param rStreamName
+ The name of the embedded storage stream. The name may contain
+ slashes to open streams from embedded substorages. If base stream
+ access has been enabled in the constructor, the base stream can be
+ accessed by passing an empty string as stream name.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ openInputStream( const OUString& rStreamName );
+
+ /** Opens and returns the specified output stream from the storage.
+
+ @param rStreamName
+ The name of the embedded storage stream. The name may contain
+ slashes to create and open streams in embedded substorages. If base
+ stream access has been enabled in the constructor, the base stream
+ can be accessed by passing an empty string as stream name.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+ openOutputStream( const OUString& rStreamName );
+
+ /** Copies the specified element from this storage to the passed
+ destination storage.
+
+ @param rElementName
+ The name of the embedded storage or stream. The name may contain
+ slashes to specify an element in an embedded substorage. In this
+ case, the element will be copied to the same substorage in the
+ destination storage.
+ */
+ void copyToStorage( StorageBase& rDestStrg, const OUString& rElementName );
+
+ /** Copies all streams of this storage and of all substorages to the passed
+ destination. */
+ void copyStorageToStorage( StorageBase& rDestStrg );
+
+ /** Commits the changes to the storage and all substorages. */
+ void commit();
+
+protected:
+ /** Special constructor for sub storage objects. */
+ explicit StorageBase( const StorageBase& rParentStorage, const OUString& rStorageName, bool bReadOnly );
+
+private:
+ StorageBase( const StorageBase& );
+ StorageBase& operator=( const StorageBase& );
+
+ /** Returns true, if the object represents a valid storage. */
+ virtual bool implIsStorage() const = 0;
+
+ /** Returns the com.sun.star.embed.XStorage interface of the current storage. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ implGetXStorage() const = 0;
+
+ /** Returns the names of all elements of this storage. */
+ virtual void implGetElementNames( ::std::vector< OUString >& orElementNames ) const = 0;
+
+ /** Implementation of opening a storage element. */
+ virtual StorageRef implOpenSubStorage( const OUString& rElementName, bool bCreate ) = 0;
+
+ /** Implementation of opening an input stream element. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ implOpenInputStream( const OUString& rElementName ) = 0;
+
+ /** Implementation of opening an output stream element. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+ implOpenOutputStream( const OUString& rElementName ) = 0;
+
+ /** Commits the current storage. */
+ virtual void implCommit() const = 0;
+
+ /** Helper that opens and caches the specified direct substorage. */
+ StorageRef getSubStorage( const OUString& rElementName, bool bCreateMissing );
+
+private:
+ typedef RefMap< OUString, StorageBase > SubStorageMap;
+
+ SubStorageMap maSubStorages; ///< Map of direct sub storages.
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ mxInStream; ///< Cached base input stream (to keep it alive).
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
+ mxOutStream; ///< Cached base output stream (to keep it alive).
+ OUString maParentPath; ///< Full path of parent storage.
+ OUString maStorageName; ///< Name of this storage, if it is a substorage.
+ bool mbBaseStreamAccess; ///< True = access base streams with empty stream name.
+ bool mbReadOnly; ///< True = storage opened read-only (based on input stream).
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/textinputstream.hxx b/include/oox/helper/textinputstream.hxx
new file mode 100644
index 000000000000..16a2d5145e9d
--- /dev/null
+++ b/include/oox/helper/textinputstream.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_HELPER_TEXTINPUTSTREAM_HXX
+#define OOX_HELPER_TEXTINPUTSTREAM_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <rtl/ustring.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace io { class XInputStream; }
+ namespace io { class XTextInputStream2; }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace oox {
+
+class BinaryInputStream;
+
+// ============================================================================
+
+class TextInputStream
+{
+public:
+ explicit TextInputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
+ rtl_TextEncoding eTextEnc );
+
+ explicit TextInputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ BinaryInputStream& rInStrm,
+ rtl_TextEncoding eTextEnc );
+
+ ~TextInputStream();
+
+ /** Returns true, if no more text is available in the stream.
+ */
+ bool isEof() const;
+
+ /** Reads a text line from the stream.
+
+ If the last line in the stream is not terminated with line-end
+ character(s), the stream will immediately go into EOF state and return
+ the text line. Otherwise, if the last character in the stream is a
+ line-end character, the next call to this function will turn the stream
+ into EOF state and return an empty string.
+ */
+ OUString readLine();
+
+ /** Reads a text portion from the stream until the specified character is
+ found.
+
+ If the end of the stream is not terminated with the specified
+ character, the stream will immediately go into EOF state and return the
+ remaining text portion. Otherwise, if the last character in the stream
+ is the specified character (and caller specifies to read and return it,
+ see parameter bIncludeChar), the next call to this function will turn
+ the stream into EOF state and return an empty string.
+
+ @param cChar
+ The separator character to be read to.
+
+ @param bIncludeChar
+ True = if found, the specified character will be read from stream
+ and included in the returned string.
+ False = the specified character will neither be read from the
+ stream nor included in the returned string, but will be
+ returned as first character in the next call of this function
+ or readLine().
+ */
+ OUString readToChar( sal_Unicode cChar, bool bIncludeChar );
+
+ // ------------------------------------------------------------------------
+
+ /** Creates a UNO text input stream object from the passed UNO input stream.
+ */
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream2 >
+ createXTextInputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
+ rtl_TextEncoding eTextEnc );
+
+ // ------------------------------------------------------------------------
+private:
+ void init(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
+ rtl_TextEncoding eTextEnc );
+
+ /** Adds the pending character in front of the passed string, if existing. */
+ OUString createFinalString( const OUString& rString );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream2 >
+ mxTextStrm;
+ sal_Unicode mcPendingChar;
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/helper/zipstorage.hxx b/include/oox/helper/zipstorage.hxx
new file mode 100644
index 000000000000..e46df41387d7
--- /dev/null
+++ b/include/oox/helper/zipstorage.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_HELPER_ZIPSTORAGE_HXX
+#define OOX_HELPER_ZIPSTORAGE_HXX
+
+#include "oox/helper/storagebase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace oox {
+
+// ============================================================================
+
+/** Implements stream access for ZIP storages containing XML streams. */
+class ZipStorage : public StorageBase
+{
+public:
+ explicit ZipStorage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream );
+
+ explicit ZipStorage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxStream );
+
+ virtual ~ZipStorage();
+
+private:
+ explicit ZipStorage(
+ const ZipStorage& rParentStorage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage,
+ const OUString& rElementName );
+
+ /** Returns true, if the object represents a valid storage. */
+ virtual bool implIsStorage() const;
+
+ /** Returns the com.sun.star.embed.XStorage interface of the current storage. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ implGetXStorage() const;
+
+ /** Returns the names of all elements of this storage. */
+ virtual void implGetElementNames( ::std::vector< OUString >& orElementNames ) const;
+
+ /** Opens and returns the specified sub storage from the storage. */
+ virtual StorageRef implOpenSubStorage( const OUString& rElementName, bool bCreateMissing );
+
+ /** Opens and returns the specified input stream from the storage. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ implOpenInputStream( const OUString& rElementName );
+
+ /** Opens and returns the specified output stream from the storage. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+ implOpenOutputStream( const OUString& rElementName );
+
+ /** Commits the current storage. */
+ virtual void implCommit() const;
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ mxStorage; ///< Storage based on input or output stream.
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/mathml/export.hxx b/include/oox/mathml/export.hxx
new file mode 100644
index 000000000000..3a0f3788a77f
--- /dev/null
+++ b/include/oox/mathml/export.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/.
+ */
+#ifndef _OOXMLEXPORT_HXX
+#define _OOXMLEXPORT_HXX
+
+#include <sax/fshelper.hxx>
+#include <rtl/strbuf.hxx>
+#include <oox/core/filterbase.hxx>
+#include <oox/dllapi.h>
+
+namespace oox
+{
+
+/**
+ Interface class, StarMath will implement writeFormula*() to write out markup
+ representing the formula.
+ */
+class OOX_DLLPUBLIC FormulaExportBase
+{
+public:
+ virtual void writeFormulaOoxml( ::sax_fastparser::FSHelperPtr m_pSerializer, oox::core::OoxmlVersion version ) = 0;
+ virtual void writeFormulaRtf( OStringBuffer& rBuffer, rtl_TextEncoding nEncoding ) = 0;
+
+protected:
+ FormulaExportBase();
+
+ ~FormulaExportBase() {}
+};
+
+} // namespace
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/mathml/import.hxx b/include/oox/mathml/import.hxx
new file mode 100644
index 000000000000..fe436d41a047
--- /dev/null
+++ b/include/oox/mathml/import.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/.
+ */
+#ifndef _STARMATHIMPORT_HXX
+#define _STARMATHIMPORT_HXX
+
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <tools/gen.hxx>
+
+#include <oox/dllapi.h>
+
+namespace oox
+{
+
+namespace formulaimport
+{
+class XmlStream;
+}
+
+/**
+ Interface class, StarMath will implement readFormulaOoxml() to read OOXML
+ representing the formula and getFormulaSize() to provide the size of the resulting
+ formula.
+ */
+class OOX_DLLPUBLIC FormulaImportBase
+{
+public:
+ virtual void readFormulaOoxml( oox::formulaimport::XmlStream& stream ) = 0;
+ virtual Size getFormulaSize() const = 0;
+
+protected:
+ FormulaImportBase();
+
+ ~FormulaImportBase() {}
+};
+
+} // namespace
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/mathml/importutils.hxx b/include/oox/mathml/importutils.hxx
new file mode 100644
index 000000000000..c3c16482164f
--- /dev/null
+++ b/include/oox/mathml/importutils.hxx
@@ -0,0 +1,254 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 _STARMATHIMPORTUTILS_HXX
+#define _STARMATHIMPORTUTILS_HXX
+
+#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
+#include <oox/token/tokens.hxx>
+#include <map>
+#include <vector>
+
+#include <oox/dllapi.h>
+
+namespace oox
+{
+
+namespace formulaimport
+{
+
+// used to differentiate between tags that opening or closing
+const int TAG_OPENING = 1 << 29;
+const int TAG_CLOSING = 1 << 30;
+
+// you probably want to #define these to something shorter in the .cxx file,
+// but they must be done as macros, otherwise they wouldn't be usable for case values,
+// and macros cannot be namespaced
+#define XML_STREAM_OPENING( token ) ( TAG_OPENING | token )
+#define XML_STREAM_CLOSING( token ) ( TAG_CLOSING | token )
+
+/**
+ Class for storing a stream of xml tokens.
+
+ A part of an XML file can be parsed and stored in this stream, from which it can be read
+ as if parsed linearly. The purpose of this class is to allow simpler handling of XML
+ files, unlike the usual LO way of using callbacks, context handlers and similar needlesly
+ complicated stuff (YMMV).
+
+ The advantages of this approach is easy to read and debug code (as it is just functions
+ reading tokens one by one and calling other functions, compared to having to use callbacks
+ and temporary storage). The disadvantage is that the XML structure needs to be handled
+ manually by the code.
+
+ Note that tag identifiers are simply int values and the API does not care besides matching
+ their values to XML stream contents and requiring that the values are not as high as TAG_OPENING.
+ Be prepared for the fact that some of the functions may throw exceptions if the input
+ stream does not match the required token (TBD).
+
+ The API tries to make the common idioms as simple as possible, see the following examples.
+
+ Parse <tagone attr="value"><tagtwo>text</tagtwo></tagone> , where tagtwo is optional:
+ @code
+XmlStream::Tag tagoneTag = stream.ensureOpeningTag( tagone );
+if( attributeTag.hasAttribute( attr ))
+ ... = attributeTag.attribute( attr, defaultValueOfTheRightType );
+if( XmlStream::Tag tagtwoTag = stream.checkOpeningTag( tagtwo ))
+{
+ ... = tagtwoTag.text;
+ stream.ensureClosingTag( tagtwo );
+}
+stream.ensureClosingTag( tagone );
+ @endcode
+
+ Parse an element that may contain several sub-elements of different types in random order:
+ @code
+stream.ensureOpeningTag( element );
+while( !stream.atEnd() && stream.currentToken() != CLOSING( element ))
+ {
+ switch( stream.currentToken())
+ {
+ case OPENING( subelement1 ):
+ handleSubElement1();
+ break;
+ case OPENING( subelement2 ):
+ ... process subelement2;
+ break;
+ default:
+ stream.handleUnexpectedTag();
+ break;
+ }
+stream.ensureClosingTag( element );
+ @endcode
+
+ If there may not be a zero number of sub-elements, use a helper bool variable or use a do-while loop.
+
+ Parse an element that may contain an unknown number of sub-elements of the same type:
+ @code
+stream.ensureOpeningTag( element );
+while( !stream.atEnd() && stream.findTag( OPENING( subelement )))
+ {
+ handleSubelement();
+ }
+stream.ensureClosingTag( element );
+ @endcode
+
+ If there may not be a zero number of sub-elements, use a helper bool variable or use a do-while loop.
+
+ @since 3.5
+*/
+class OOX_DLLPUBLIC XmlStream
+{
+public:
+ XmlStream();
+ /**
+ Structure representing a list of attributes.
+ */
+ // One could theoretically use oox::AttributeList, but that complains if the passed reference is empty,
+ // which would be complicated to avoid here. Also, parsers apparently reuse the same instance of XFastAttributeList,
+ // which means using oox::AttributeList would make them all point to the one instance.
+ struct OOX_DLLPUBLIC AttributeList
+ {
+ bool hasAttribute( int token ) const;
+ OUString& operator[] (int token);
+ OUString attribute( int token, const OUString& def = OUString()) const;
+ bool attribute( int token, bool def ) const;
+ sal_Unicode attribute( int token, sal_Unicode def ) const;
+ // when adding more attribute() overloads, add also to XmlStream itself
+ protected:
+ std::map< int, OUString > attrs;
+ };
+ /**
+ Structure representing a tag, including its attributes and content text immediatelly following it.
+ */
+ struct OOX_DLLPUBLIC Tag
+ {
+ Tag( int token = XML_TOKEN_INVALID,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >& attributes = com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >(),
+ const OUString& text = OUString());
+ Tag( int token,
+ const AttributeList& attribs);
+ int token; ///< tag type, or XML_TOKEN_INVALID
+ AttributeList attributes;
+ OUString text;
+ /**
+ This function returns value of the given attribute, or the passed default value if not found.
+ The type of the default value selects the return type (OUString here).
+ */
+ OUString attribute( int token, const OUString& def = OUString()) const;
+ /**
+ @overload
+ */
+ bool attribute( int token, bool def ) const;
+ /**
+ @overload
+ */
+ sal_Unicode attribute( int token, sal_Unicode def ) const;
+ // when adding more attribute() overloads, add also to XmlStream::AttributeList and inline below
+ /**
+ Converts to true if the tag has a valid token, false otherwise. Allows simple
+ usage in if(), for example 'if( XmlStream::Tag foo = stream.checkOpeningTag( footoken ))'.
+ */
+ operator bool() const;
+ };
+ /**
+ @return true if current position is at the end of the XML stream
+ */
+ bool atEnd() const;
+ /**
+ @return data about the current tag
+ */
+ Tag currentTag() const;
+ /**
+ @return the token for the current tag
+ */
+ int currentToken() const;
+ /**
+ Moves position to the next tag.
+ */
+ void moveToNextTag();
+ /**
+ Ensures that an opening tag with the given token is read. If the current tag does not match,
+ writes out a warning and tries to recover by skipping tags until found (or until the current element would end).
+ If found, the position in the stream is afterwards moved to the next tag.
+ @return the matching found opening tag, or empty tag if not found
+ */
+ Tag ensureOpeningTag( int token );
+ /**
+ Tries to find an opening tag with the given token. Works similarly like ensureOpeningTag(),
+ but if a matching tag is not found, the position in the stream is not altered. The primary
+ use of this function is to check for optional elements.
+ @return the matching found opening tag, or empty tag if not found
+ */
+ Tag checkOpeningTag( int token );
+ /**
+ Ensures that a closing tag with the given token is read. Like ensureOpeningTag(),
+ if not, writes out a warning and tries to recover by skiping tags until found (or until the current element would end).
+ If found, the position in the stream is afterwards moved to the next tag.
+ */
+ void ensureClosingTag( int token );
+ /**
+ Tries to find the given token, until either found (returns true) or end of current element.
+ Position in the stream is set to make the tag current (i.e. it will be the next one read).
+ */
+ bool findTag( int token );
+ /**
+ Handle the current (unexpected) tag.
+ */
+ void handleUnexpectedTag();
+protected:
+ Tag checkTag( int token, bool optional );
+ bool findTagInternal( int token, bool silent );
+ void skipElementInternal( int token, bool silent );
+ std::vector< Tag > tags;
+ unsigned int pos;
+};
+
+/**
+ This class is used for creating XmlStream.
+
+ Simply use this class and then pass it as XmlStream to the consumer.
+
+ @since 3.5.0
+*/
+class OOX_DLLPUBLIC XmlStreamBuilder
+: public XmlStream
+{
+public:
+ void appendOpeningTag( int token,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >& attributes = com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >());
+ void appendOpeningTag( int token,
+ const AttributeList& attribs );
+ void appendClosingTag( int token );
+ // appends the characters after the last appended token
+ void appendCharacters( const OUString& characters );
+};
+
+inline
+OUString XmlStream::Tag::attribute( int t, const OUString& def ) const
+{
+ return attributes.attribute( t, def );
+}
+
+inline
+bool XmlStream::Tag::attribute( int t, bool def ) const
+{
+ return attributes.attribute( t, def );
+}
+
+inline
+sal_Unicode XmlStream::Tag::attribute( int t, sal_Unicode def ) const
+{
+ return attributes.attribute( t, def );
+}
+
+} // namespace
+} // namespace
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/axbinaryreader.hxx b/include/oox/ole/axbinaryreader.hxx
new file mode 100644
index 000000000000..b6a937d14c4c
--- /dev/null
+++ b/include/oox/ole/axbinaryreader.hxx
@@ -0,0 +1,257 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_OLE_AXBINARYREADER_HXX
+#define OOX_OLE_AXBINARYREADER_HXX
+
+#include <utility>
+#include "oox/helper/binaryinputstream.hxx"
+#include "oox/helper/refvector.hxx"
+#include "oox/ole/axfontdata.hxx"
+
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+/** A wrapper for a binary input stream that supports aligned read operations.
+
+ The implementation does not support seeking back the wrapped stream. All
+ seeking operations (tell, seekTo, align) are performed relative to the
+ position of the wrapped stream at construction time of this wrapper. It is
+ possible to construct this wrapper with an unseekable input stream without
+ loosing any functionality.
+ */
+class AxAlignedInputStream : public BinaryInputStream
+{
+public:
+ explicit AxAlignedInputStream( BinaryInputStream& rInStrm );
+
+ /** Returns the size of the data this stream represents, if the wrapped
+ stream supports the size() operation. */
+ virtual sal_Int64 size() const;
+ /** Return the current relative stream position (relative to position of
+ the wrapped stream at construction time). */
+ virtual sal_Int64 tell() const;
+ /** Seeks the stream to the passed relative position, if it is behind the
+ current position. */
+ virtual void seek( sal_Int64 nPos );
+ /** Closes the input stream but not the wrapped stream. */
+ virtual void close();
+
+ /** Reads nBytes bytes to the passed sequence.
+ @return Number of bytes really read. */
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 );
+ /** Reads nBytes bytes to the (existing) buffer opMem.
+ @return Number of bytes really read. */
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+ /** Seeks the stream forward by the passed number of bytes. */
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Aligns the stream to a multiple of the passed size (relative to the
+ position of the wrapped stream at construction time). */
+ void align( size_t nSize );
+
+ /** Aligns the stream according to the passed type and reads a value. */
+ template< typename Type >
+ inline Type readAligned() { align( sizeof( Type ) ); return readValue< Type >(); }
+ /** Aligns the stream according to the passed type and skips the size of the type. */
+ template< typename Type >
+ inline void skipAligned() { align( sizeof( Type ) ); skip( sizeof( Type ) ); }
+
+private:
+ BinaryInputStream* mpInStrm; ///< The wrapped input stream.
+ sal_Int64 mnStrmPos; ///< Tracks relative position in the stream.
+ sal_Int64 mnStrmSize; ///< Size of the wrapped stream data.
+};
+
+// ============================================================================
+
+/** A pair of integer values as a property. */
+typedef ::std::pair< sal_Int32, sal_Int32 > AxPairData;
+
+/** An array of string values as a property. */
+typedef ::std::vector< OUString > AxArrayString;
+
+// ============================================================================
+
+/** Import helper to read simple and complex ActiveX form control properties
+ from a binary input stream. */
+class AxBinaryPropertyReader
+{
+public:
+ explicit AxBinaryPropertyReader( BinaryInputStream& rInStrm, bool b64BitPropFlags = false );
+
+ /** Reads the next integer property value from the stream, if the
+ respective flag in the property mask is set. */
+ template< typename StreamType, typename DataType >
+ inline void readIntProperty( DataType& ornValue )
+ { if( startNextProperty() ) ornValue = maInStrm.readAligned< StreamType >(); }
+ /** Reads the next boolean property value from the stream, if the
+ respective flag in the property mask is set. */
+ void readBoolProperty( bool& orbValue, bool bReverse = false );
+ /** Reads the next pair property from the stream, if the respective flag in
+ the property mask is set. */
+ void readPairProperty( AxPairData& orPairData );
+ /** Reads the next string property from the stream, if the respective flag
+ in the property mask is set. */
+ void readStringProperty( OUString& orValue );
+ /** Reads ArrayString, an array of fmString ( compressed or uncompressed )
+ is read from the stream and inserted into rStrings */
+ void readArrayStringProperty( std::vector< OUString >& rStrings );
+ /** Reads the next GUID property from the stream, if the respective flag
+ in the property mask is set. The GUID will be enclosed in braces. */
+ void readGuidProperty( OUString& orGuid );
+ /** Reads the next font property from the stream, if the respective flag in
+ the property mask is set. */
+ void readFontProperty( AxFontData& orFontData );
+ /** Reads the next picture property from the stream, if the respective flag
+ in the property mask is set. */
+ void readPictureProperty( StreamDataSequence& orPicData );
+
+ /** Skips the next integer property value in the stream, if the respective
+ flag in the property mask is set. */
+ template< typename StreamType >
+ inline void skipIntProperty() { if( startNextProperty() ) maInStrm.skipAligned< StreamType >(); }
+ /** Skips the next boolean property value in the stream, if the respective
+ flag in the property mask is set. */
+ inline void skipBoolProperty() { startNextProperty(); }
+ /** Skips the next pair property in the stream, if the respective flag in
+ the property mask is set. */
+ void skipPairProperty() { readPairProperty( maDummyPairData ); }
+ /** Skips the next string property in the stream, if the respective flag in
+ the property mask is set. */
+ inline void skipStringProperty() { readStringProperty( maDummyString ); }
+ /** Skips the next ArrayString property in the stream, if the respective flag in
+ the property mask is set. */
+ inline void skipArrayStringProperty() { readArrayStringProperty( maDummyArrayString ); }
+ /** Skips the next GUID property in the stream, if the respective flag in
+ the property mask is set. */
+ inline void skipGuidProperty() { readGuidProperty( maDummyString ); }
+ /** Skips the next font property in the stream, if the respective flag in
+ the property mask is set. */
+ inline void skipFontProperty() { readFontProperty( maDummyFontData ); }
+ /** Skips the next picture property in the stream, if the respective flag
+ in the property mask is set. */
+ inline void skipPictureProperty() { readPictureProperty( maDummyPicData ); }
+ /** Has to be called for undefined properties. If the respective flag in
+ the mask is set, the property import cannot be finished successfully. */
+ inline void skipUndefinedProperty() { ensureValid( !startNextProperty() ); }
+
+ /** Final processing, reads contents of all complex properties. */
+ bool finalizeImport();
+
+private:
+ bool ensureValid( bool bCondition = true );
+ bool startNextProperty();
+
+private:
+ /** Base class for complex properties such as string, point, size, GUID, picture. */
+ struct ComplexProperty
+ {
+ virtual ~ComplexProperty();
+ virtual bool readProperty( AxAlignedInputStream& rInStrm ) = 0;
+ };
+
+ /** Complex property for a 32-bit value pair, e.g. point or size. */
+ struct PairProperty : public ComplexProperty
+ {
+ AxPairData& mrPairData;
+
+ inline explicit PairProperty( AxPairData& rPairData ) :
+ mrPairData( rPairData ) {}
+ virtual bool readProperty( AxAlignedInputStream& rInStrm );
+ };
+
+ /** Complex property for a string value. */
+ struct StringProperty : public ComplexProperty
+ {
+ OUString& mrValue;
+ sal_uInt32 mnSize;
+
+ inline explicit StringProperty( OUString& rValue, sal_uInt32 nSize ) :
+ mrValue( rValue ), mnSize( nSize ) {}
+ virtual bool readProperty( AxAlignedInputStream& rInStrm );
+ };
+
+ /** Complex property for an array of strings. */
+ struct ArrayStringProperty : public ComplexProperty
+ {
+ AxArrayString& mrArray;
+ sal_uInt32 mnSize;
+ inline explicit ArrayStringProperty( AxArrayString& rArray, sal_uInt32 nSize ) :
+ mrArray( rArray ), mnSize( nSize ) {}
+ virtual bool readProperty( AxAlignedInputStream& rInStrm );
+ };
+
+ /** Complex property for a GUID value. */
+ struct GuidProperty : public ComplexProperty
+ {
+ OUString& mrGuid;
+
+ inline explicit GuidProperty( OUString& rGuid ) :
+ mrGuid( rGuid ) {}
+ virtual bool readProperty( AxAlignedInputStream& rInStrm );
+ };
+
+ /** Stream property for a font structure. */
+ struct FontProperty : public ComplexProperty
+ {
+ AxFontData& mrFontData;
+
+ inline explicit FontProperty( AxFontData& rFontData ) :
+ mrFontData( rFontData ) {}
+ virtual bool readProperty( AxAlignedInputStream& rInStrm );
+ };
+
+ /** Stream property for a picture or mouse icon. */
+ struct PictureProperty : public ComplexProperty
+ {
+ StreamDataSequence& mrPicData;
+
+ inline explicit PictureProperty( StreamDataSequence& rPicData ) :
+ mrPicData( rPicData ) {}
+ virtual bool readProperty( AxAlignedInputStream& rInStrm );
+ };
+
+ typedef RefVector< ComplexProperty > ComplexPropVector;
+
+private:
+ AxAlignedInputStream maInStrm; ///< The input stream to read from.
+ ComplexPropVector maLargeProps; ///< Stores info for all used large properties.
+ ComplexPropVector maStreamProps; ///< Stores info for all used stream data properties.
+ AxPairData maDummyPairData; ///< Dummy pair for unsupported properties.
+ AxFontData maDummyFontData; ///< Dummy font for unsupported properties.
+ StreamDataSequence maDummyPicData; ///< Dummy picture for unsupported properties.
+ OUString maDummyString; ///< Dummy string for unsupported properties.
+ AxArrayString maDummyArrayString; ///< Dummy strings for unsupported ArrayString properties.
+ sal_Int64 mnPropFlags; ///< Flags specifying existing properties.
+ sal_Int64 mnNextProp; ///< Next property to read.
+ sal_Int64 mnPropsEnd; ///< End position of simple/large properties.
+ bool mbValid; ///< True = stream still valid.
+};
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/axbinarywriter.hxx b/include/oox/ole/axbinarywriter.hxx
new file mode 100644
index 000000000000..eb4aec532d1f
--- /dev/null
+++ b/include/oox/ole/axbinarywriter.hxx
@@ -0,0 +1,194 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 Noel Power<noel.power@suse.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef OOX_OLE_AXBINARYWRITER_HXX
+#define OOX_OLE_AXBINARYWRITER_HXX
+
+#include <utility>
+#include "oox/helper/binaryoutputstream.hxx"
+#include "oox/helper/refvector.hxx"
+
+namespace oox {
+namespace ole {
+// ============================================================================
+
+/** A wrapper for a binary output stream that supports aligned write operations.
+
+ The implementation does support seeking back the wrapped stream. All
+ seeking operations (tell, seekTo, align) are performed relative to the
+ position of the wrapped stream at construction time of this wrapper.
+ Unlike it's reader class counterpart it is NOT possible to construct this
+ wrapper with an unseekable output stream.
+ */
+class AxAlignedOutputStream : public BinaryOutputStream
+{
+public:
+ explicit AxAlignedOutputStream( BinaryOutputStream& rOutStrm );
+
+ /** Returns the size of the data this stream represents, if the wrapped
+ stream supports the size() operation. */
+ virtual sal_Int64 size() const;
+ /** Return the current relative stream position (relative to position of
+ the wrapped stream at construction time). */
+ virtual sal_Int64 tell() const;
+ /** Seeks the stream to the passed relative position, if it is behind the
+ current position. */
+ virtual void seek( sal_Int64 nPos );
+ /** Closes the input stream but not the wrapped stream. */
+ virtual void close();
+
+ /** Reads nBytes bytes to the passed sequence.
+ @return Number of bytes really read. */
+ virtual void writeData( const StreamDataSequence& orData, size_t nAtomSize = 1 );
+ /** Reads nBytes bytes to the (existing) buffer opMem.
+ @return Number of bytes really read. */
+ virtual void writeMemory( const void* pMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+ /** Aligns the stream to a multiple of the passed size (relative to the
+ position of the wrapped stream at construction time). */
+ void align( size_t nSize );
+
+ void pad( sal_Int32 nBytes, size_t nAtomSize = 1);
+ /** Aligns the stream according to the passed type and reads a value. */
+ template< typename Type >
+ inline void writeAligned( Type nVal ) { align( sizeof( Type ) ); writeValue( nVal ); }
+ /** Aligns the stream according to the passed type and skips the size of the type. */
+ template< typename Type >
+ inline void padAligned() { align( sizeof( Type ) ); pad( sizeof( Type ) ); }
+
+private:
+ BinaryOutputStream* mpOutStrm; ///< The wrapped input stream.
+ sal_Int64 mnStrmPos; ///< Tracks relative position in the stream.
+ sal_Int64 mnStrmSize; ///< Size of the wrapped stream data.
+ sal_Int64 mnWrappedBeginPos; ///< starting pos or wrapped stream
+};
+
+/** A pair of integer values as a property. */
+typedef ::std::pair< sal_Int32, sal_Int32 > AxPairData;
+
+/** An array of string values as a property. */
+typedef ::std::vector< OUString > AxStringArray;
+
+// ============================================================================
+
+/** Export helper to write simple and complex ActiveX form control properties
+ to a binary input stream. */
+class AxBinaryPropertyWriter
+{
+public:
+ explicit AxBinaryPropertyWriter( BinaryOutputStream& rOutStrm, bool b64BitPropFlags = false );
+
+ /** Write an integer property value to the stream, the
+ respective flag in the property mask is set. */
+ template< typename StreamType, typename DataType >
+ inline void writeIntProperty( DataType& ornValue )
+ { if( startNextProperty() ) maOutStrm.writeAligned< StreamType >( ornValue ); }
+ /** Write a boolean property value to the stream, the
+ respective flag in the property mask is set. */
+ void writeBoolProperty( bool orbValue, bool bReverse = false );
+ /** Write a pair property the stream, the respective flag in
+ the property mask is set. */
+ void writePairProperty( AxPairData& orPairData );
+ /** Write a string property to the stream, the respective flag
+ in the property mask is set. */
+ void writeStringProperty( OUString& orValue, bool bCompressed = true );
+
+ /** Skips the next property clears the respective
+ flag in the property mask. */
+ inline void skipProperty() { startNextProperty( true ); }
+
+ /** Final processing, write contents of all complex properties, writes record size */
+ bool finalizeExport();
+
+private:
+ bool ensureValid( bool bCondition = true );
+ bool startNextProperty( bool bSkip = false );
+
+private:
+ /** Base class for complex properties such as string, point, size, GUID, picture. */
+ struct ComplexProperty
+ {
+ virtual ~ComplexProperty();
+ virtual bool writeProperty( AxAlignedOutputStream& rOutStrm ) = 0;
+ };
+
+ /** Complex property for a 32-bit value pair, e.g. point or size. */
+ struct PairProperty : public ComplexProperty
+ {
+ AxPairData& mrPairData;
+
+ inline explicit PairProperty( AxPairData& rPairData ) :
+ mrPairData( rPairData ) {}
+ virtual bool writeProperty( AxAlignedOutputStream& rOutStrm );
+ };
+
+ /** Complex property for a string value. */
+ struct StringProperty : public ComplexProperty
+ {
+ OUString& mrValue;
+ sal_uInt32 mnSize;
+
+ inline explicit StringProperty( OUString& rValue, sal_uInt32 nSize ) :
+ mrValue( rValue ), mnSize( nSize ) {}
+ virtual bool writeProperty( AxAlignedOutputStream& rOutStrm );
+ };
+
+ /** Stream property for a picture or mouse icon. */
+ struct PictureProperty : public ComplexProperty
+ {
+ StreamDataSequence& mrPicData;
+
+ inline explicit PictureProperty( StreamDataSequence& rPicData ) :
+ mrPicData( rPicData ) {}
+ virtual bool writeProperty( AxAlignedOutputStream& rOutStrm );
+ };
+
+ typedef RefVector< ComplexProperty > ComplexPropVector;
+
+private:
+ AxAlignedOutputStream maOutStrm; ///< The input stream to read from.
+ ComplexPropVector maLargeProps; ///< Stores info for all used large properties.
+ ComplexPropVector maStreamProps; ///< Stores info for all used stream data properties.
+ AxPairData maDummyPairData; ///< Dummy pair for unsupported properties.
+ StreamDataSequence maDummyPicData; ///< Dummy picture for unsupported properties.
+ OUString maDummyString; ///< Dummy string for unsupported properties.
+ AxStringArray maDummyStringArray; ///< Dummy string array for unsupported properties.
+ sal_Int16 mnBlockSize;
+ sal_Int64 mnPropFlagsStart; ///< pos of Prop flags
+ sal_Int64 mnPropFlags; ///< Flags specifying existing properties.
+ sal_Int64 mnNextProp; ///< Next property to read.
+ bool mbValid; ///< True = stream still valid.
+ bool mb64BitPropFlags;
+};
+
+// ============================================================================
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/axcontrol.hxx b/include/oox/ole/axcontrol.hxx
new file mode 100644
index 000000000000..84e3a3ecbcdd
--- /dev/null
+++ b/include/oox/ole/axcontrol.hxx
@@ -0,0 +1,1031 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_OLE_AXCONTROL_HXX
+#define OOX_OLE_AXCONTROL_HXX
+
+#include <boost/shared_ptr.hpp>
+#include "oox/helper/binarystreambase.hxx"
+#include "oox/helper/propertyset.hxx"
+#include "oox/ole/axbinaryreader.hxx"
+#include "oox/ole/olehelper.hxx"
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace awt { class XControlModel; }
+ namespace container { class XIndexContainer; }
+ namespace drawing { class XDrawPage; }
+ namespace frame { class XModel; }
+ namespace form { class XFormsSupplier; }
+ namespace lang { class XMultiServiceFactory; }
+} } }
+
+namespace oox {
+ class BinaryInputStream;
+ class GraphicHelper;
+ class PropertyMap;
+}
+
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+#define COMCTL_GUID_SCROLLBAR_60 "{FE38753A-44A3-11D1-B5B7-0000C09000C4}"
+#define COMCTL_GUID_PROGRESSBAR_50 "{0713E8D2-850A-101B-AFC0-4210102A8DA7}"
+#define COMCTL_GUID_PROGRESSBAR_60 "{35053A22-8589-11D1-B16A-00C0F0283628}"
+
+const sal_uInt16 COMCTL_VERSION_50 = 5;
+const sal_uInt16 COMCTL_VERSION_60 = 6;
+
+// ----------------------------------------------------------------------------
+
+#define AX_GUID_COMMANDBUTTON "{D7053240-CE69-11CD-a777-00dd01143c57}"
+#define AX_GUID_LABEL "{978C9E23-D4B0-11CE-bf2d-00aa003f40d0}"
+#define AX_GUID_IMAGE "{4C599241-6926-101B-9992-00000b65c6f9}"
+#define AX_GUID_TOGGLEBUTTON "{8BD21D60-EC42-11CE-9e0d-00aa006002f3}"
+#define AX_GUID_CHECKBOX "{8BD21D40-EC42-11CE-9e0d-00aa006002f3}"
+#define AX_GUID_OPTIONBUTTON "{8BD21D50-EC42-11CE-9e0d-00aa006002f3}"
+#define AX_GUID_TEXTBOX "{8BD21D10-EC42-11CE-9e0d-00aa006002f3}"
+#define AX_GUID_LISTBOX "{8BD21D20-EC42-11CE-9e0d-00aa006002f3}"
+#define AX_GUID_COMBOBOX "{8BD21D30-EC42-11CE-9e0d-00aa006002f3}"
+#define AX_GUID_SPINBUTTON "{79176FB0-B7F2-11CE-97ef-00aa006d2776}"
+#define AX_GUID_SCROLLBAR "{DFD181E0-5E2F-11CE-a449-00aa004a803d}"
+#define AX_GUID_FRAME "{6E182020-F460-11CE-9bcd-00aa00608e01}"
+
+// Html control GUID(s)
+
+#define HTML_GUID_SELECT "{5512D122-5CC6-11CF-8d67-00aa00bdce1d}"
+#define HTML_GUID_TEXTBOX "{5512D124-5CC6-11CF-8d67-00aa00bdce1d}"
+
+const sal_uInt32 AX_SYSCOLOR_WINDOWBACK = 0x80000005;
+const sal_uInt32 AX_SYSCOLOR_WINDOWFRAME = 0x80000006;
+const sal_uInt32 AX_SYSCOLOR_WINDOWTEXT = 0x80000008;
+const sal_uInt32 AX_SYSCOLOR_BUTTONFACE = 0x8000000F;
+const sal_uInt32 AX_SYSCOLOR_BUTTONTEXT = 0x80000012;
+
+const sal_uInt32 AX_FLAGS_ENABLED = 0x00000002;
+const sal_uInt32 AX_FLAGS_LOCKED = 0x00000004;
+const sal_uInt32 AX_FLAGS_OPAQUE = 0x00000008;
+const sal_uInt32 AX_FLAGS_COLUMNHEADS = 0x00000400;
+const sal_uInt32 AX_FLAGS_ENTIREROWS = 0x00000800;
+const sal_uInt32 AX_FLAGS_EXISTINGENTRIES = 0x00001000;
+const sal_uInt32 AX_FLAGS_CAPTIONLEFT = 0x00002000;
+const sal_uInt32 AX_FLAGS_EDITABLE = 0x00004000;
+const sal_uInt32 AX_FLAGS_IMEMODE_MASK = 0x00078000;
+const sal_uInt32 AX_FLAGS_DRAGENABLED = 0x00080000;
+const sal_uInt32 AX_FLAGS_ENTERASNEWLINE = 0x00100000;
+const sal_uInt32 AX_FLAGS_KEEPSELECTION = 0x00200000;
+const sal_uInt32 AX_FLAGS_TABASCHARACTER = 0x00400000;
+const sal_uInt32 AX_FLAGS_WORDWRAP = 0x00800000;
+const sal_uInt32 AX_FLAGS_BORDERSSUPPRESSED = 0x02000000;
+const sal_uInt32 AX_FLAGS_SELECTLINE = 0x04000000;
+const sal_uInt32 AX_FLAGS_SINGLECHARSELECT = 0x08000000;
+const sal_uInt32 AX_FLAGS_AUTOSIZE = 0x10000000;
+const sal_uInt32 AX_FLAGS_HIDESELECTION = 0x20000000;
+const sal_uInt32 AX_FLAGS_MAXLENAUTOTAB = 0x40000000;
+const sal_uInt32 AX_FLAGS_MULTILINE = 0x80000000;
+
+const sal_Int32 AX_BORDERSTYLE_NONE = 0;
+const sal_Int32 AX_BORDERSTYLE_SINGLE = 1;
+
+const sal_Int32 AX_SPECIALEFFECT_FLAT = 0;
+const sal_Int32 AX_SPECIALEFFECT_RAISED = 1;
+const sal_Int32 AX_SPECIALEFFECT_SUNKEN = 2;
+const sal_Int32 AX_SPECIALEFFECT_ETCHED = 3;
+const sal_Int32 AX_SPECIALEFFECT_BUMPED = 6;
+
+const sal_Int32 AX_PICSIZE_CLIP = 0;
+const sal_Int32 AX_PICSIZE_STRETCH = 1;
+const sal_Int32 AX_PICSIZE_ZOOM = 3;
+
+const sal_Int32 AX_PICALIGN_TOPLEFT = 0;
+const sal_Int32 AX_PICALIGN_TOPRIGHT = 1;
+const sal_Int32 AX_PICALIGN_CENTER = 2;
+const sal_Int32 AX_PICALIGN_BOTTOMLEFT = 3;
+const sal_Int32 AX_PICALIGN_BOTTOMRIGHT = 4;
+
+const sal_Int32 AX_DISPLAYSTYLE_TEXT = 1;
+const sal_Int32 AX_DISPLAYSTYLE_LISTBOX = 2;
+const sal_Int32 AX_DISPLAYSTYLE_COMBOBOX = 3;
+const sal_Int32 AX_DISPLAYSTYLE_CHECKBOX = 4;
+const sal_Int32 AX_DISPLAYSTYLE_OPTBUTTON = 5;
+const sal_Int32 AX_DISPLAYSTYLE_TOGGLE = 6;
+const sal_Int32 AX_DISPLAYSTYLE_DROPDOWN = 7;
+
+const sal_Int32 AX_SELCTION_SINGLE = 0;
+const sal_Int32 AX_SELCTION_MULTI = 1;
+const sal_Int32 AX_SELCTION_EXTENDED = 2;
+
+const sal_Int32 AX_SHOWDROPBUTTON_NEVER = 0;
+const sal_Int32 AX_SHOWDROPBUTTON_FOCUS = 1;
+const sal_Int32 AX_SHOWDROPBUTTON_ALWAYS = 2;
+
+const sal_Int32 AX_SCROLLBAR_NONE = 0x00;
+const sal_Int32 AX_SCROLLBAR_HORIZONTAL = 0x01;
+const sal_Int32 AX_SCROLLBAR_VERTICAL = 0x02;
+
+// ----------------------------------------------------------------------------
+
+/** Enumerates all UNO API control types supported by these filters. */
+enum ApiControlType
+{
+ API_CONTROL_BUTTON,
+ API_CONTROL_FIXEDTEXT,
+ API_CONTROL_IMAGE,
+ API_CONTROL_CHECKBOX,
+ API_CONTROL_RADIOBUTTON,
+ API_CONTROL_EDIT,
+ API_CONTROL_NUMERIC,
+ API_CONTROL_LISTBOX,
+ API_CONTROL_COMBOBOX,
+ API_CONTROL_SPINBUTTON,
+ API_CONTROL_SCROLLBAR,
+ API_CONTROL_TABSTRIP, //11
+ API_CONTROL_PROGRESSBAR,
+ API_CONTROL_GROUPBOX,
+ API_CONTROL_FRAME, // 14
+ API_CONTROL_PAGE, // 15
+ API_CONTROL_MULTIPAGE, // 16
+ API_CONTROL_DIALOG // 17
+};
+
+// ============================================================================
+
+/** Specifies how a form control supports transparent background. */
+enum ApiTransparencyMode
+{
+ API_TRANSPARENCY_NOTSUPPORTED, ///< Control does not support transparency.
+ API_TRANSPARENCY_VOID, ///< Transparency is enabled by missing fill color.
+ API_TRANSPARENCY_PAINTTRANSPARENT ///< Transparency is enabled by the 'PaintTransparent' property.
+};
+
+/** Specifies how a form control supports the DefaultState property. */
+enum ApiDefaultStateMode
+{
+ API_DEFAULTSTATE_BOOLEAN, ///< Control does not support tri-state, state is given as boolean.
+ API_DEFAULTSTATE_SHORT, ///< Control does not support tri-state, state is given as short.
+ API_DEFAULTSTATE_TRISTATE ///< Control supports tri-state, state is given as short.
+};
+
+// ----------------------------------------------------------------------------
+
+/** A base class with useful helper functions for something that is able to
+ convert ActiveX and ComCtl form controls.
+ */
+class OOX_DLLPUBLIC ControlConverter
+{
+public:
+ explicit ControlConverter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
+ const GraphicHelper& rGraphicHelper,
+ bool bDefaultColorBgr = true );
+ virtual ~ControlConverter();
+
+ // Generic conversion -----------------------------------------------------
+
+ /** Converts the passed position in 1/100 mm to UNO properties. */
+ void convertPosition(
+ PropertyMap& rPropMap,
+ const AxPairData& rPos ) const;
+
+ /** Converts the passed size in 1/100 mm to UNO properties. */
+ void convertSize(
+ PropertyMap& rPropMap,
+ const AxPairData& rSize ) const;
+
+ /** Converts the passed encoded OLE color to UNO properties. */
+ void convertColor(
+ PropertyMap& rPropMap,
+ sal_Int32 nPropId,
+ sal_uInt32 nOleColor ) const;
+
+ void convertToMSColor(
+ PropertySet& rPropSet,
+ sal_Int32 nPropId,
+ sal_uInt32& nOleColor,
+ sal_uInt32 nDefault = 0 ) const;
+
+
+ /** Converts the passed StdPic picture stream to UNO properties. */
+ void convertPicture(
+ PropertyMap& rPropMap,
+ const StreamDataSequence& rPicData ) const;
+
+ /** Converts the control orientation to UNO properties. */
+ void convertOrientation(
+ PropertyMap& rPropMap,
+ bool bHorizontal ) const;
+
+ void convertToMSOrientation(
+ PropertySet& rPropMap,
+ bool& bHorizontal ) const;
+
+ /** Converts the vertical alignment to UNO properties. */
+ void convertVerticalAlign(
+ PropertyMap& rPropMap,
+ sal_Int32 nVerticalAlign ) const;
+
+ /** Converts common scrollbar settings to UNO properties. */
+ void convertScrollBar(
+ PropertyMap& rPropMap,
+ sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition,
+ sal_Int32 nSmallChange, sal_Int32 nLargeChange, bool bAwtModel ) const;
+
+ /** Converts scrollability settings to UNO properties. */
+ void convertScrollabilitySettings(
+ PropertyMap& rPropMap,
+ const AxPairData& rScrollPos, const AxPairData& rScrollArea,
+ sal_Int32 nScrollBars ) const;
+
+ /** Binds the passed control model to the passed data sources. The
+ implementation will check which source types are supported. */
+ void bindToSources(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
+ const OUString& rCtrlSource,
+ const OUString& rRowSource,
+ sal_Int32 nRefSheet = 0 ) const;
+
+ // ActiveX (Forms 2.0) specific conversion --------------------------------
+
+ /** Converts the Forms 2.0 background formatting to UNO properties. */
+ void convertAxBackground(
+ PropertyMap& rPropMap,
+ sal_uInt32 nBackColor,
+ sal_uInt32 nFlags,
+ ApiTransparencyMode eTranspMode ) const;
+
+ /** Converts the Forms 2.0 border formatting to UNO properties. */
+ void convertAxBorder(
+ PropertyMap& rPropMap,
+ sal_uInt32 nBorderColor,
+ sal_Int32 nBorderStyle,
+ sal_Int32 nSpecialEffect ) const;
+
+ void convertToAxBorder(
+ PropertySet& rPropSet,
+ sal_uInt32& nBorderColor,
+ sal_Int32& nBorderStyle,
+ sal_Int32& nSpecialEffect ) const;
+
+ /** Converts the Forms 2.0 special effect to UNO properties. */
+ void convertAxVisualEffect(
+ PropertyMap& rPropMap,
+ sal_Int32 nSpecialEffect ) const;
+
+ void convertToAxVisualEffect(
+ PropertySet& rPropSet,
+ sal_Int32& nSpecialEffect ) const;
+
+ /** Converts the passed picture stream and Forms 2.0 position to UNO
+ properties. */
+ void convertAxPicture(
+ PropertyMap& rPropMap,
+ const StreamDataSequence& rPicData,
+ sal_uInt32 nPicPos ) const;
+
+ /** Converts the passed picture stream and Forms 2.0 position to UNO
+ properties. */
+ void convertAxPicture(
+ PropertyMap& rPropMap,
+ const StreamDataSequence& rPicData,
+ sal_Int32 nPicSizeMode,
+ sal_Int32 nPicAlign,
+ bool bPicTiling ) const;
+
+ /** Converts the Forms 2.0 value for checked/unchecked/dontknow to UNO
+ properties. */
+ void convertAxState(
+ PropertyMap& rPropMap,
+ const OUString& rValue,
+ sal_Int32 nMultiSelect,
+ ApiDefaultStateMode eDefStateMode,
+ bool bAwtModel ) const;
+
+ void convertToAxState(
+ PropertySet& rPropSet,
+ OUString& rValue,
+ sal_Int32& nMultiSelect,
+ ApiDefaultStateMode eDefStateMode,
+ bool bAwtModel ) const;
+
+ /** Converts the Forms 2.0 control orientation to UNO properties. */
+ void convertAxOrientation(
+ PropertyMap& rPropMap,
+ const AxPairData& rSize,
+ sal_Int32 nOrientation ) const;
+
+ void convertToAxOrientation(
+ PropertySet& rPropSet,
+ const AxPairData& rSize,
+ sal_Int32& nOrientation ) const;
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxDocModel;
+ const GraphicHelper& mrGraphicHelper;
+ mutable PropertySet maAddressConverter;
+ mutable PropertySet maRangeConverter;
+ bool mbDefaultColorBgr;
+};
+
+// ============================================================================
+
+/** Base class for all models of form controls. */
+class OOX_DLLPUBLIC ControlModelBase
+{
+public:
+ explicit ControlModelBase();
+ virtual ~ControlModelBase();
+
+ /** Sets this control model to AWT model mode. */
+ inline void setAwtModelMode() { mbAwtModel = true; }
+ /** Sets this control model to form component mode. */
+ inline void setFormComponentMode() { mbAwtModel = false; }
+
+ /** Returns the UNO service name used to construct the AWT control model,
+ or the control form component. */
+ OUString getServiceName() const;
+
+ /** Derived classes set specific OOXML properties at the model structure. */
+ virtual void importProperty( sal_Int32 nPropId, const OUString& rValue );
+ /** Derived classes set binary data (picture, mouse icon) at the model structure. */
+ virtual void importPictureData( sal_Int32 nPropId, BinaryInputStream& rInStrm );
+ /** Derived classes import a form control model from the passed input stream. */
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm ) = 0;
+ /** Derived classes export a form control model to the passed output stream. */
+ virtual void exportBinaryModel( BinaryOutputStream& /*rOutStrm*/ ) {}
+ /** Derived classes export CompObjStream contents. */
+ virtual void exportCompObj( BinaryOutputStream& /*rOutStrm*/ ) {}
+ /** Derived classes return the UNO control type enum value. */
+ virtual ApiControlType getControlType() const = 0;
+ /** Derived classes convert all control properties. */
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ /** Derived classes convert from uno control properties to equiv. MS values. */
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+
+ /** Converts the control size to UNO properties. */
+ void convertSize( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+
+public: // direct access needed for legacy VML drawing controls
+ AxPairData maSize; ///< Size of the control in 1/100 mm.
+
+protected:
+ bool mbAwtModel; ///< True = AWT control model, false = form component.
+};
+
+typedef ::boost::shared_ptr< ControlModelBase > ControlModelRef;
+
+// ============================================================================
+
+/** Base class for all models of ComCtl form controls. */
+class ComCtlModelBase : public ControlModelBase
+{
+public:
+ explicit ComCtlModelBase(
+ sal_uInt32 nDataPartId5, sal_uInt32 nDataPartId6, sal_uInt16 nVersion,
+ bool bCommonPart, bool bComplexPart );
+
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+
+protected:
+ virtual void importControlData( BinaryInputStream& rInStrm ) = 0;
+ virtual void importCommonExtraData( BinaryInputStream& rInStrm );
+ virtual void importCommonTrailingData( BinaryInputStream& rInStrm );
+
+private:
+ /** Returns the data part identifier according to the model version. */
+ sal_uInt32 getDataPartId() const;
+
+ bool readPartHeader( BinaryInputStream& rInStrm,
+ sal_uInt32 nExpPartId,
+ sal_uInt16 nExpMajor = SAL_MAX_UINT16,
+ sal_uInt16 nExpMinor = SAL_MAX_UINT16 );
+
+ bool importSizePart( BinaryInputStream& rInStrm );
+ bool importCommonPart( BinaryInputStream& rInStrm, sal_uInt32 nPartSize );
+ bool importComplexPart( BinaryInputStream& rInStrm );
+
+protected:
+ StdFontInfo maFontData; ///< Font formatting.
+ StreamDataSequence maMouseIcon; ///< Binary picture stream for mouse icon.
+ sal_uInt32 mnFlags; ///< Common flags for ComCtl controls.
+ const sal_uInt16 mnVersion; ///< Current version of the ComCtl control model.
+
+private:
+ sal_uInt32 mnDataPartId5; ///< Identifier for version 5.0 control data.
+ sal_uInt32 mnDataPartId6; ///< Identifier for version 6.0 control data.
+ bool mbCommonPart; ///< True = the COMCTL_COMMONDATA part exists.
+ bool mbComplexPart; ///< True = the COMCTL_COMPLEXDATA part exists.
+};
+
+// ============================================================================
+
+/** Model for a ComCtl scroll bar. */
+class ComCtlScrollBarModel : public ComCtlModelBase
+{
+public:
+ explicit ComCtlScrollBarModel( sal_uInt16 nVersion );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+
+protected:
+ virtual void importControlData( BinaryInputStream& rInStrm );
+
+private:
+ sal_uInt32 mnScrollBarFlags; ///< Special flags for scroll bar model.
+ sal_Int32 mnLargeChange; ///< Increment step size (thumb).
+ sal_Int32 mnSmallChange; ///< Increment step size (buttons).
+ sal_Int32 mnMin; ///< Minimum of the value range.
+ sal_Int32 mnMax; ///< Maximum of the value range.
+ sal_Int32 mnPosition; ///< Value of the spin button.
+};
+
+// ============================================================================
+
+/** Model for a ComCtl progress bar. */
+class ComCtlProgressBarModel : public ComCtlModelBase
+{
+public:
+ explicit ComCtlProgressBarModel( sal_uInt16 nVersion );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+
+protected:
+ virtual void importControlData( BinaryInputStream& rInStrm );
+
+private:
+ float mfMin; ///< Minimum of the value range.
+ float mfMax; ///< Maximum of the value range.
+ sal_uInt16 mnVertical; ///< 0 = horizontal, 1 = vertical.
+ sal_uInt16 mnSmooth; ///< 0 = progress blocks, 1 = pixel resolution.
+};
+
+// ============================================================================
+
+/** Base class for all models of Form 2.0 form controls. */
+class OOX_DLLPUBLIC AxControlModelBase : public ControlModelBase
+{
+public:
+ explicit AxControlModelBase();
+
+ virtual void importProperty( sal_Int32 nPropId, const OUString& rValue );
+};
+
+// ============================================================================
+
+/** Base class for Forms 2.0 controls supporting text formatting. */
+class OOX_DLLPUBLIC AxFontDataModel : public AxControlModelBase
+{
+public:
+ explicit AxFontDataModel( bool bSupportsAlign = true );
+
+ virtual void importProperty( sal_Int32 nPropId, const OUString& rValue );
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void exportBinaryModel( BinaryOutputStream& rOutStrm );
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+
+ /** Returns the font height in points. */
+ inline sal_Int16 getFontHeight() const { return maFontData.getHeightPoints(); }
+
+public: // direct access needed for legacy VML drawing controls
+ AxFontData maFontData; ///< The font settings.
+
+private:
+ bool mbSupportsAlign; ///< True = UNO model supports Align property.
+};
+
+// ============================================================================
+
+/** Model for a Forms 2.0 command button. */
+class OOX_DLLPUBLIC AxCommandButtonModel : public AxFontDataModel
+{
+public:
+ explicit AxCommandButtonModel();
+
+ virtual void importProperty( sal_Int32 nPropId, const OUString& rValue );
+ virtual void importPictureData( sal_Int32 nPropId, BinaryInputStream& rInStrm );
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void exportBinaryModel( BinaryOutputStream& rOutStrm );
+ virtual void exportCompObj( BinaryOutputStream& rOutStrm );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+
+public: // direct access needed for legacy VML drawing controls
+ StreamDataSequence maPictureData; ///< Binary picture stream.
+ OUString maCaption; ///< Visible caption of the button.
+ sal_uInt32 mnTextColor; ///< Text color.
+ sal_uInt32 mnBackColor; ///< Fill color.
+ sal_uInt32 mnFlags; ///< Various flags.
+ sal_uInt32 mnPicturePos; ///< Position of the picture relative to text.
+ sal_Int32 mnVerticalAlign; ///< Vertical alignment (legacy VML drawing controls only).
+ bool mbFocusOnClick; ///< True = take focus on click.
+};
+
+// ============================================================================
+
+/** Model for a Forms 2.0 label. */
+class OOX_DLLPUBLIC AxLabelModel : public AxFontDataModel
+{
+public:
+ explicit AxLabelModel();
+
+ virtual void importProperty( sal_Int32 nPropId, const OUString& rValue );
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void exportBinaryModel( BinaryOutputStream& rOutStrm );
+ virtual void exportCompObj( BinaryOutputStream& rOutStrm );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+
+public: // direct access needed for legacy VML drawing controls
+ OUString maCaption; ///< Visible caption of the button.
+ sal_uInt32 mnTextColor; ///< Text color.
+ sal_uInt32 mnBackColor; ///< Fill color.
+ sal_uInt32 mnFlags; ///< Various flags.
+ sal_uInt32 mnBorderColor; ///< Flat border color.
+ sal_Int32 mnBorderStyle; ///< Flat border style.
+ sal_Int32 mnSpecialEffect; ///< 3D border effect.
+ sal_Int32 mnVerticalAlign; ///< Vertical alignment (legacy VML drawing controls only).
+};
+
+// ============================================================================
+
+/** Model for a Forms 2.0 image. */
+class OOX_DLLPUBLIC AxImageModel : public AxControlModelBase
+{
+public:
+ explicit AxImageModel();
+
+ virtual void importProperty( sal_Int32 nPropId, const OUString& rValue );
+ virtual void importPictureData( sal_Int32 nPropId, BinaryInputStream& rInStrm );
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void exportBinaryModel( BinaryOutputStream& rOutStrm );
+ virtual void exportCompObj( BinaryOutputStream& rOutStrm );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+
+private:
+ StreamDataSequence maPictureData; ///< Binary picture stream.
+ sal_uInt32 mnBackColor; ///< Fill color.
+ sal_uInt32 mnFlags; ///< Various flags.
+ sal_uInt32 mnBorderColor; ///< Flat border color.
+ sal_Int32 mnBorderStyle; ///< Flat border style.
+ sal_Int32 mnSpecialEffect; ///< 3D border effect.
+ sal_Int32 mnPicSizeMode; ///< Clip, stretch, zoom.
+ sal_Int32 mnPicAlign; ///< Anchor position of the picture.
+ bool mbPicTiling; ///< True = picture is repeated.
+};
+
+class OOX_DLLPUBLIC AxTabStripModel : public AxFontDataModel
+{
+public:
+ explicit AxTabStripModel();
+
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+
+ virtual ApiControlType getControlType() const;
+
+public:
+ sal_uInt32 mnListIndex;
+ sal_uInt32 mnTabStyle;
+ sal_uInt32 mnTabData;
+ sal_uInt32 mnVariousPropertyBits;
+ std::vector< ::rtl::OUString > maItems; // captions for each tab
+ std::vector< ::rtl::OUString > maTabNames; // names for each tab
+};
+
+// ============================================================================
+
+/** Base class for a Forms 2.0 morph data control. */
+class OOX_DLLPUBLIC AxMorphDataModelBase : public AxFontDataModel
+{
+public:
+ explicit AxMorphDataModelBase();
+
+ virtual void importProperty( sal_Int32 nPropId, const OUString& rValue );
+ virtual void importPictureData( sal_Int32 nPropId, BinaryInputStream& rInStrm );
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void exportBinaryModel( BinaryOutputStream& rOutStrm );
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+
+public: // direct access needed for legacy VML drawing controls
+ StreamDataSequence maPictureData; ///< Binary picture stream.
+ OUString maCaption; ///< Visible caption of the button.
+ OUString maValue; ///< Current value of the control.
+ OUString maGroupName; ///< Group name for option buttons.
+ sal_uInt32 mnTextColor; ///< Text color.
+ sal_uInt32 mnBackColor; ///< Fill color.
+ sal_uInt32 mnFlags; ///< Various flags.
+ sal_uInt32 mnPicturePos; ///< Position of the picture relative to text.
+ sal_uInt32 mnBorderColor; ///< Flat border color.
+ sal_Int32 mnBorderStyle; ///< Flat border style.
+ sal_Int32 mnSpecialEffect; ///< 3D border effect.
+ sal_Int32 mnDisplayStyle; ///< Type of the morph control.
+ sal_Int32 mnMultiSelect; ///< Selection mode.
+ sal_Int32 mnScrollBars; ///< Horizontal/vertical scroll bar.
+ sal_Int32 mnMatchEntry; ///< Auto completion mode.
+ sal_Int32 mnShowDropButton; ///< When to show the dropdown button.
+ sal_Int32 mnMaxLength; ///< Maximum character count.
+ sal_Int32 mnPasswordChar; ///< Password character in edit fields.
+ sal_Int32 mnListRows; ///< Number of rows in dropdown box.
+ sal_Int32 mnVerticalAlign; ///< Vertical alignment (legacy VML drawing controls only).
+};
+
+// ============================================================================
+
+/** Model for a Forms 2.0 toggle button. */
+class OOX_DLLPUBLIC AxToggleButtonModel : public AxMorphDataModelBase
+{
+public:
+ explicit AxToggleButtonModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+ virtual void exportCompObj( BinaryOutputStream& rOutStrm );
+};
+
+// ============================================================================
+
+/** Model for a Forms 2.0 check box. */
+class OOX_DLLPUBLIC AxCheckBoxModel : public AxMorphDataModelBase
+{
+public:
+ explicit AxCheckBoxModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+ virtual void exportCompObj( BinaryOutputStream& rOutStrm );
+};
+
+// ============================================================================
+
+/** Model for a Forms 2.0 option button. */
+class OOX_DLLPUBLIC AxOptionButtonModel : public AxMorphDataModelBase
+{
+public:
+ explicit AxOptionButtonModel();
+
+ /** Returns the group name used to goup several option buttons gogether. */
+ inline const OUString& getGroupName() const { return maGroupName; }
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+ virtual void exportCompObj( BinaryOutputStream& rOutStrm );
+};
+
+// ============================================================================
+
+/** Model for a Forms 2.0 text box. */
+class OOX_DLLPUBLIC AxTextBoxModel : public AxMorphDataModelBase
+{
+public:
+ explicit AxTextBoxModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+ virtual void exportCompObj( BinaryOutputStream& rOutStrm );
+};
+
+// ============================================================================
+
+/** Model for a numeric field (legacy drawing controls only). */
+class OOX_DLLPUBLIC AxNumericFieldModel : public AxMorphDataModelBase
+{
+public:
+ explicit AxNumericFieldModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+ virtual void exportCompObj( BinaryOutputStream& rOutStrm );
+};
+
+// ============================================================================
+
+/** Model for a Forms 2.0 list box. */
+class OOX_DLLPUBLIC AxListBoxModel : public AxMorphDataModelBase
+{
+public:
+ explicit AxListBoxModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+ virtual void exportCompObj( BinaryOutputStream& rOutStrm );
+};
+
+// ============================================================================
+
+/** Model for a Forms 2.0 combo box. */
+class OOX_DLLPUBLIC AxComboBoxModel : public AxMorphDataModelBase
+{
+public:
+ explicit AxComboBoxModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+ virtual void exportCompObj( BinaryOutputStream& rOutStrm );
+};
+
+// ============================================================================
+
+/** Model for a Forms 2.0 spin button. */
+class OOX_DLLPUBLIC AxSpinButtonModel : public AxControlModelBase
+{
+public:
+ explicit AxSpinButtonModel();
+
+ virtual void importProperty( sal_Int32 nPropId, const OUString& rValue );
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void exportBinaryModel( BinaryOutputStream& rOutStrm );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+ virtual void exportCompObj( BinaryOutputStream& rOutStrm );
+
+public: // direct access needed for legacy VML drawing controls
+ sal_uInt32 mnArrowColor; ///< Button arrow color.
+ sal_uInt32 mnBackColor; ///< Fill color.
+ sal_uInt32 mnFlags; ///< Various flags.
+ sal_Int32 mnOrientation; ///< Orientation of the buttons.
+ sal_Int32 mnMin; ///< Minimum of the value range.
+ sal_Int32 mnMax; ///< Maximum of the value range.
+ sal_Int32 mnPosition; ///< Value of the spin button.
+ sal_Int32 mnSmallChange; ///< Increment step size.
+ sal_Int32 mnDelay; ///< Repeat delay in milliseconds.
+};
+
+// ============================================================================
+
+/** Model for a Forms 2.0 scroll bar. */
+class OOX_DLLPUBLIC AxScrollBarModel : public AxControlModelBase
+{
+public:
+ explicit AxScrollBarModel();
+
+ virtual void importProperty( sal_Int32 nPropId, const OUString& rValue );
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void exportBinaryModel( BinaryOutputStream& rOutStrm );
+ virtual void exportCompObj( BinaryOutputStream& rOutStrm );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ virtual void convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv );
+
+public: // direct access needed for legacy VML drawing controls
+ sal_uInt32 mnArrowColor; ///< Button arrow color.
+ sal_uInt32 mnBackColor; ///< Fill color.
+ sal_uInt32 mnFlags; ///< Various flags.
+ sal_Int32 mnOrientation; ///< Orientation of the buttons.
+ sal_Int32 mnPropThumb; ///< Proportional thumb size.
+ sal_Int32 mnMin; ///< Minimum of the value range.
+ sal_Int32 mnMax; ///< Maximum of the value range.
+ sal_Int32 mnPosition; ///< Value of the spin button.
+ sal_Int32 mnSmallChange; ///< Increment step size (buttons).
+ sal_Int32 mnLargeChange; ///< Increment step size (thumb).
+ sal_Int32 mnDelay; ///< Repeat delay in milliseconds.
+};
+
+// ============================================================================
+
+typedef ::std::vector< OUString > AxClassTable;
+
+/** Base class for ActiveX container controls. */
+class OOX_DLLPUBLIC AxContainerModelBase : public AxFontDataModel
+{
+public:
+ explicit AxContainerModelBase( bool bFontSupport = false );
+
+ /** Allows to set single properties specified by XML token identifier. */
+ virtual void importProperty( sal_Int32 nPropId, const OUString& rValue );
+ /** Reads the leading structure in the 'f' stream containing the model for
+ this control. */
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ /** Converts font settings if supported. */
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+
+ /** Reads the class table structure for embedded controls following the own
+ model from the 'f' stream. */
+ bool importClassTable( BinaryInputStream& rInStrm, AxClassTable& orClassTable );
+
+public: // direct access needed for legacy VML drawing controls
+ StreamDataSequence maPictureData; ///< Binary picture stream.
+ OUString maCaption; ///< Visible caption of the form.
+ AxPairData maLogicalSize; ///< Logical form size (scroll area).
+ AxPairData maScrollPos; ///< Scroll position.
+ sal_uInt32 mnBackColor; ///< Fill color.
+ sal_uInt32 mnTextColor; ///< Text color.
+ sal_uInt32 mnFlags; ///< Various flags.
+ sal_uInt32 mnBorderColor; ///< Flat border color.
+ sal_Int32 mnBorderStyle; ///< Flat border style.
+ sal_Int32 mnScrollBars; ///< Horizontal/vertical scroll bar.
+ sal_Int32 mnCycleType; ///< Cycle in all forms or in this form.
+ sal_Int32 mnSpecialEffect; ///< 3D border effect.
+ sal_Int32 mnPicAlign; ///< Anchor position of the picture.
+ sal_Int32 mnPicSizeMode; ///< Clip, stretch, zoom.
+ bool mbPicTiling; ///< True = picture is repeated.
+ bool mbFontSupport; ///< True = control supports the font property.
+};
+
+typedef ::boost::shared_ptr< AxContainerModelBase > AxContainerModelRef;
+
+// ============================================================================
+
+/** Model for a Forms 2.0 frame control. */
+class OOX_DLLPUBLIC AxFrameModel : public AxContainerModelBase
+{
+public:
+ explicit AxFrameModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+};
+
+class OOX_DLLPUBLIC AxPageModel : public AxContainerModelBase
+{
+public:
+ explicit AxPageModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+};
+
+class OOX_DLLPUBLIC AxMultiPageModel : public AxContainerModelBase
+{
+public:
+ explicit AxMultiPageModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual bool importPageAndMultiPageProperties( BinaryInputStream& rInStrm, sal_Int32 nPages );
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+ std::vector<sal_uInt32> mnIDs;
+ sal_uInt32 mnActiveTab;
+ sal_uInt32 mnTabStyle;
+};
+
+// ============================================================================
+
+
+/** Model for a Forms 2.0 user form. */
+class OOX_DLLPUBLIC AxUserFormModel : public AxContainerModelBase
+{
+public:
+ explicit AxUserFormModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+};
+
+class HtmlSelectModel : public AxListBoxModel
+{
+ com::sun::star::uno::Sequence< OUString > msListData;
+ com::sun::star::uno::Sequence< sal_Int16 > msIndices;
+public:
+ HtmlSelectModel();
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+};
+
+class HtmlTextBoxModel : public AxTextBoxModel
+{
+public:
+ explicit HtmlTextBoxModel();
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+};
+// ============================================================================
+
+/** A form control embedded in a document draw page. Contains a specific model
+ structure according to the type of the control. */
+class OOX_DLLPUBLIC EmbeddedControl
+{
+public:
+ explicit EmbeddedControl( const OUString& rName );
+ virtual ~EmbeddedControl();
+
+ /** Creates and returns the internal control model of the specified type. */
+ template< typename ModelType >
+ inline ModelType& createModel();
+
+ /** Creates and returns the internal control model of the specified type. */
+ template< typename ModelType, typename ParamType >
+ inline ModelType& createModel( const ParamType& rParam );
+
+ /** Creates and returns the internal control model according to the passed
+ MS class identifier. */
+ ControlModelBase* createModelFromGuid( const OUString& rClassId );
+
+ /** Returns true, if the internal control model exists. */
+ inline bool hasModel() const { return mxModel.get() != 0; }
+ /** Returns read-only access to the internal control model. */
+ inline const ControlModelBase* getModel() const { return mxModel.get(); }
+ /** Returns read/write access to the internal control model. */
+ inline ControlModelBase* getModel() { return mxModel.get(); }
+
+ /** Returns the UNO service name needed to construct the control model. */
+ OUString getServiceName() const;
+
+ /** Converts all control properties and inserts them into the passed model. */
+ bool convertProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
+ const ControlConverter& rConv ) const;
+
+ bool convertFromProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
+ const ControlConverter& rConv );
+
+private:
+ ControlModelRef mxModel; ///< Control model containing the properties.
+ OUString maName; ///< Name of the control.
+};
+
+// ----------------------------------------------------------------------------
+
+template< typename ModelType >
+inline ModelType& EmbeddedControl::createModel()
+{
+ ::boost::shared_ptr< ModelType > xModel( new ModelType );
+ mxModel = xModel;
+ xModel->setFormComponentMode();
+ return *xModel;
+}
+
+template< typename ModelType, typename ParamType >
+inline ModelType& EmbeddedControl::createModel( const ParamType& rParam )
+{
+ ::boost::shared_ptr< ModelType > xModel( new ModelType( rParam ) );
+ mxModel = xModel;
+ xModel->setFormComponentMode();
+ return *xModel;
+}
+
+// ============================================================================
+
+/** A wrapper for a control form embedded directly in a draw page. */
+class EmbeddedForm
+{
+public:
+ explicit EmbeddedForm(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage,
+ const GraphicHelper& rGraphicHelper,
+ bool bDefaultColorBgr = true );
+
+ /** Converts the passed control and inserts the control model into the form.
+ @return The API control model, if conversion was successful. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >
+ convertAndInsert( const EmbeddedControl& rControl, sal_Int32& rnCtrlIndex );
+
+ /** Returns the XIndexContainer interface of the UNO control form, if existing. */
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >
+ getXForm() const { return mxFormIC; }
+
+private:
+ /** Creates the form that will hold the form controls. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >
+ createXForm();
+
+private:
+ ControlConverter maControlConv;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxModelFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormsSupplier > mxFormsSupp;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > mxFormIC;
+};
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/axcontrolfragment.hxx b/include/oox/ole/axcontrolfragment.hxx
new file mode 100644
index 000000000000..653f23c30479
--- /dev/null
+++ b/include/oox/ole/axcontrolfragment.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 OOX_OLE_AXCONTROLFRAGMENT_HXX
+#define OOX_OLE_AXCONTROLFRAGMENT_HXX
+
+#include "oox/core/fragmenthandler2.hxx"
+
+namespace oox {
+namespace ole {
+
+class ControlModelBase;
+class EmbeddedControl;
+
+// ============================================================================
+
+/** Context handler for ActiveX form control model properties. */
+class AxControlPropertyContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit AxControlPropertyContext(
+ ::oox::core::FragmentHandler2& rFragment,
+ ControlModelBase& rModel );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+private:
+ ControlModelBase& mrModel;
+ sal_Int32 mnPropId; ///< Identifier of currently processed property.
+};
+
+// ============================================================================
+
+/** Fragment handler for an embedded ActiveX form control fragment. */
+class AxControlFragment : public ::oox::core::FragmentHandler2
+{
+public:
+ explicit AxControlFragment(
+ ::oox::core::XmlFilterBase& rFilter,
+ const OUString& rFragmentPath,
+ EmbeddedControl& rControl );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+private:
+ EmbeddedControl& mrControl;
+};
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/axfontdata.hxx b/include/oox/ole/axfontdata.hxx
new file mode 100644
index 000000000000..9dbec1786261
--- /dev/null
+++ b/include/oox/ole/axfontdata.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_OLE_AXFONTDATA_HXX
+#define OOX_OLE_AXFONTDATA_HXX
+
+#include "oox/helper/binaryinputstream.hxx"
+#include "oox/helper/binaryoutputstream.hxx"
+#include "oox/helper/refvector.hxx"
+#include "oox/dllapi.h"
+
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+const sal_Char* const AX_GUID_CFONT = "{AFC20920-DA4E-11CE-B943-00AA006887B4}";
+
+const sal_uInt32 AX_FONTDATA_BOLD = 0x00000001;
+const sal_uInt32 AX_FONTDATA_ITALIC = 0x00000002;
+const sal_uInt32 AX_FONTDATA_UNDERLINE = 0x00000004;
+const sal_uInt32 AX_FONTDATA_STRIKEOUT = 0x00000008;
+const sal_uInt32 AX_FONTDATA_DISABLED = 0x00002000;
+const sal_uInt32 AX_FONTDATA_AUTOCOLOR = 0x40000000;
+
+const sal_Int32 AX_FONTDATA_LEFT = 1;
+const sal_Int32 AX_FONTDATA_RIGHT = 2;
+const sal_Int32 AX_FONTDATA_CENTER = 3;
+
+/** All entries of a font property. */
+struct OOX_DLLPUBLIC AxFontData
+{
+ OUString maFontName; ///< Name of the used font.
+ sal_uInt32 mnFontEffects; ///< Font effect flags.
+ sal_Int32 mnFontHeight; ///< Height of the font (not really twips, see code).
+ sal_Int32 mnFontCharSet; ///< Windows character set of the font.
+ sal_Int32 mnHorAlign; ///< Horizontal text alignment.
+ bool mbDblUnderline; ///< True = double underline style (legacy VML drawing controls only).
+
+ explicit AxFontData();
+
+ /** Converts the internal representation of the font height to points. */
+ sal_Int16 getHeightPoints() const;
+ /** Converts the passed font height from points to the internal representation. */
+ void setHeightPoints( sal_Int16 nPoints );
+
+ /** Reads the font data settings from the passed input stream. */
+ bool importBinaryModel( BinaryInputStream& rInStrm );
+
+ void exportBinaryModel( BinaryOutputStream& rOutStrm );
+ /** Reads the font data settings from the passed input stream that contains
+ an OLE StdFont structure. */
+ bool importStdFont( BinaryInputStream& rInStrm );
+ /** Reads the font data settings from the passed input stream depending on
+ the GUID preceding the actual font data. */
+ bool importGuidAndFont( BinaryInputStream& rInStrm );
+};
+
+
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/olehelper.hxx b/include/oox/ole/olehelper.hxx
new file mode 100644
index 000000000000..e75a0cd07588
--- /dev/null
+++ b/include/oox/ole/olehelper.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 OOX_OLE_OLEHELPER_HXX
+#define OOX_OLE_OLEHELPER_HXX
+
+#include <rtl/ustring.hxx>
+#include "oox/helper/binarystreambase.hxx"
+#include "oox/helper/storagebase.hxx"
+#include "oox/helper/graphichelper.hxx"
+#include "com/sun/star/form/XFormComponent.hpp"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/frame/XModel.hpp"
+#include "com/sun/star/frame/XFrame.hpp"
+#include "com/sun/star/drawing/XShapes.hpp"
+#include "com/sun/star/awt/XControlModel.hpp"
+#include "com/sun/star/io/XInputStream.hpp"
+#include "com/sun/star/io/XOutputStream.hpp"
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include "com/sun/star/container/XIndexContainer.hpp"
+#include <filter/msfilter/msocximex.hxx>
+#include "oox/dllapi.h"
+#include "sot/storage.hxx"
+
+namespace oox {
+ class BinaryInputStream;
+ class BinaryOutputStream;
+ class BinaryXInputStream;
+ class GraphicHelper;
+}
+
+namespace oox {
+
+typedef ::boost::shared_ptr< oox::BinaryXInputStream > BinaryXInputStreamRef;
+
+namespace ole {
+
+
+// ============================================================================
+
+#define OLE_GUID_STDFONT "{0BE35203-8F91-11CE-9DE3-00AA004BB851}"
+#define OLE_GUID_STDPIC "{0BE35204-8F91-11CE-9DE3-00AA004BB851}"
+#define OLE_GUID_STDHLINK "{79EAC9D0-BAF9-11CE-8C82-00AA004BA90B}"
+
+// ============================================================================
+
+const sal_uInt16 OLE_STDFONT_NORMAL = 400;
+const sal_uInt16 OLE_STDFONT_BOLD = 700;
+
+const sal_uInt8 OLE_STDFONT_ITALIC = 0x02;
+const sal_uInt8 OLE_STDFONT_UNDERLINE = 0x04;
+const sal_uInt8 OLE_STDFONT_STRIKE = 0x08;
+
+/** Stores data about a StdFont font structure. */
+struct StdFontInfo
+{
+ OUString maName; ///< Font name.
+ sal_uInt32 mnHeight; ///< Font height (1/10,000 points).
+ sal_uInt16 mnWeight; ///< Font weight (normal/bold).
+ sal_uInt16 mnCharSet; ///< Font charset.
+ sal_uInt8 mnFlags; ///< Font flags.
+
+ explicit StdFontInfo();
+ explicit StdFontInfo(
+ const OUString& rName,
+ sal_uInt32 nHeight,
+ sal_uInt16 nWeight = OLE_STDFONT_NORMAL,
+ sal_uInt16 nCharSet = WINDOWS_CHARSET_ANSI,
+ sal_uInt8 nFlags = 0 );
+};
+
+// ============================================================================
+
+/** Stores data about a StdHlink hyperlink. */
+struct StdHlinkInfo
+{
+ OUString maTarget;
+ OUString maLocation;
+ OUString maDisplay;
+ OUString maFrame;
+};
+
+// ============================================================================
+
+/** Static helper functions for OLE import/export. */
+class OOX_DLLPUBLIC OleHelper
+{
+public:
+ /** Returns the UNO RGB color from the passed encoded OLE color.
+
+ @param bDefaultColorBgr
+ True = OLE default color type is treated as BGR color.
+ False = OLE default color type is treated as palette color.
+ */
+ static sal_Int32 decodeOleColor(
+ const GraphicHelper& rGraphicHelper,
+ sal_uInt32 nOleColor,
+ bool bDefaultColorBgr = true );
+
+ /** Returns the OLE color from the passed UNO RGB color.
+ */
+ static sal_uInt32 encodeOleColor( sal_Int32 nRgbColor );
+
+ /** Imports a GUID from the passed binary stream and returns its string
+ representation (in uppercase characters).
+ */
+ static OUString importGuid( BinaryInputStream& rInStrm );
+
+ /** Imports an OLE StdFont font structure from the current position of the
+ passed binary stream.
+ */
+ static bool importStdFont(
+ StdFontInfo& orFontInfo,
+ BinaryInputStream& rInStrm,
+ bool bWithGuid );
+
+ /** Imports an OLE StdPic picture from the current position of the passed
+ binary stream.
+ */
+ static bool importStdPic(
+ StreamDataSequence& orGraphicData,
+ BinaryInputStream& rInStrm,
+ bool bWithGuid );
+
+private:
+ OleHelper(); // not implemented
+ ~OleHelper(); // not implemented
+};
+
+// ideally it would be great to get rid of SvxMSConvertOCXControls
+// however msfilter/source/msfilter/svdfppt.cxx still uses
+// SvxMSConvertOCXControls as a base class, unfortunately oox depends on
+// msfilter. Probably the solution would be to move the svdfppt.cxx
+// implementation into the sd module itself.
+class OOX_DLLPUBLIC MSConvertOCXControls : public SvxMSConvertOCXControls
+{
+#ifdef SvxMSConvertOCXControlsRemoved
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > mxShapes;
+ com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > mxDrawPage;
+ com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer > mxFormComps;
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
+#endif
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxCtx;
+ ::oox::GraphicHelper maGrfHelper;
+
+ bool importControlFromStream( ::oox::BinaryInputStream& rInStrm,
+ ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp,
+ const OUString& rGuidString );
+ bool importControlFromStream( ::oox::BinaryInputStream& rInStrm,
+ ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp,
+ const OUString& rGuidString,
+ sal_Int32 nSize );
+public:
+ MSConvertOCXControls( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel );
+ ~MSConvertOCXControls();
+ sal_Bool ReadOCXStorage( SotStorageRef& rSrc1, ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp );
+ sal_Bool ReadOCXCtlsStream(SotStorageStreamRef& rSrc1, ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp,
+ sal_Int32 nPos, sal_Int32 nSize );
+ static sal_Bool WriteOCXStream( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel, SotStorageRef &rSrc1, const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > &rControlModel, const com::sun::star::awt::Size& rSize,OUString &rName);
+
+#ifdef SvxMSConvertOCXControlsRemoved
+ const com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > & GetShapes();
+ const com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer > & GetFormComps();
+ virtual const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XDrawPage > & GetDrawPage();
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & GetServiceFactory();
+ virtual sal_Bool InsertControl(
+ const com::sun::star::uno::Reference<
+ com::sun::star::form::XFormComponent >& /*rFComp*/,
+ const com::sun::star::awt::Size& /*rSize*/,
+ com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShape >* /*pShape*/,
+ sal_Bool /*bFloatingCtrl*/ ) {return sal_False;}
+#endif
+};
+
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/oleobjecthelper.hxx b/include/oox/ole/oleobjecthelper.hxx
new file mode 100644
index 000000000000..9d97a8d95f71
--- /dev/null
+++ b/include/oox/ole/oleobjecthelper.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 OOX_OLE_OLEOBJECTHELPER_HXX
+#define OOX_OLE_OLEOBJECTHELPER_HXX
+
+#include "oox/helper/binarystreambase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace awt { struct Size; }
+ namespace document { class XEmbeddedObjectResolver; }
+ namespace lang { class XMultiServiceFactory; }
+} } }
+
+namespace oox { class PropertyMap; }
+
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+/** Contains generic information about an OLE object. */
+struct OleObjectInfo
+{
+ StreamDataSequence maEmbeddedData; ///< Data of an embedded OLE object.
+ OUString maTargetLink; ///< Path to external data for linked OLE object.
+ OUString maProgId;
+ bool mbLinked; ///< True = linked OLE object, false = embedded OLE object.
+ bool mbShowAsIcon; ///< True = show as icon, false = show contents.
+ bool mbAutoUpdate;
+
+ explicit OleObjectInfo();
+};
+
+// ============================================================================
+
+/** Helper for OLE object handling. */
+class OleObjectHelper
+{
+public:
+ explicit OleObjectHelper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory );
+ ~OleObjectHelper();
+
+ bool importOleObject(
+ PropertyMap& rPropMap,
+ const OleObjectInfo& rOleObject,
+ const ::com::sun::star::awt::Size& rObjSize );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver > mxResolver;
+ const OUString maEmbeddedObjScheme;
+ sal_Int32 mnObjectId;
+};
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/olestorage.hxx b/include/oox/ole/olestorage.hxx
new file mode 100644
index 000000000000..1b48eab8213d
--- /dev/null
+++ b/include/oox/ole/olestorage.hxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_OLE_OLESTORAGE_HXX
+#define OOX_OLE_OLESTORAGE_HXX
+
+#include "oox/helper/storagebase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace container { class XNameContainer; }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+/** Implements stream access for binary OLE storages. */
+class OOX_DLLPUBLIC OleStorage : public StorageBase
+{
+public:
+ explicit OleStorage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream,
+ bool bBaseStreamAccess );
+
+ explicit OleStorage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream,
+ bool bBaseStreamAccess );
+
+ virtual ~OleStorage();
+
+private:
+ explicit OleStorage(
+ const OleStorage& rParentStorage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxStorage,
+ const OUString& rElementName,
+ bool bReadOnly );
+ explicit OleStorage(
+ const OleStorage& rParentStorage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream,
+ const OUString& rElementName );
+
+ /** Initializes the API storage object for input. */
+ void initStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream );
+ /** Initializes the API storage object for input/output. */
+ void initStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream );
+
+ /** Returns true, if the object represents a valid storage. */
+ virtual bool implIsStorage() const;
+
+ /** Returns the com.sun.star.embed.XStorage interface of the current storage.
+
+ @attention
+ This function is not implemented for binary OLE storages.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ implGetXStorage() const;
+
+ /** Returns the names of all elements of this storage. */
+ virtual void implGetElementNames( ::std::vector< OUString >& orElementNames ) const;
+
+ /** Opens and returns the specified sub storage from the storage. */
+ virtual StorageRef implOpenSubStorage( const OUString& rElementName, bool bCreateMissing );
+
+ /** Opens and returns the specified input stream from the storage. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ implOpenInputStream( const OUString& rElementName );
+
+ /** Opens and returns the specified output stream from the storage. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+ implOpenOutputStream( const OUString& rElementName );
+
+ /** Commits the current storage. */
+ virtual void implCommit() const;
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ mxContext; ///< Component context with service manager.
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ mxStorage; ///< Access to elements of this sub storage.
+ const OleStorage* mpParentStorage; ///< Parent OLE storage that contains this storage.
+};
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/vbacontrol.hxx b/include/oox/ole/vbacontrol.hxx
new file mode 100644
index 000000000000..0de80153baed
--- /dev/null
+++ b/include/oox/ole/vbacontrol.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 OOX_OLE_VBACONTROL_HXX
+#define OOX_OLE_VBACONTROL_HXX
+
+#include "oox/ole/axcontrol.hxx"
+#include <com/sun/star/frame/XModel.hpp>
+
+namespace com { namespace sun { namespace star {
+ namespace container { class XNameContainer; }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace oox { class StorageBase; }
+
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+/** Common properties for all controls that are part of a VBA user form or of
+ another container control in a VBA user form. */
+class VbaSiteModel
+{
+public:
+ explicit VbaSiteModel();
+ virtual ~VbaSiteModel();
+
+ /** Allows to set single properties specified by XML token identifier. */
+ void importProperty( sal_Int32 nPropId, const OUString& rValue );
+ /** Imports the site model data from the passed input stream. */
+ bool importBinaryModel( BinaryInputStream& rInStrm );
+ /** Moves the control relative to its current position by the passed distance. */
+ void moveRelative( const AxPairData& rDistance );
+
+ /** Returns the programmatical name of the control. */
+ inline const OUString& getName() const { return maName; }
+ /** Returns the position of the control in its parent. */
+ inline const AxPairData& getPosition() const { return maPos; }
+ /** Returns the unique identifier of this control. */
+ inline sal_Int32 getId() const { return mnId; }
+ /** Returns true, if this control is a container control. */
+ bool isContainer() const;
+ /** Returns the length of the stream data for stream based controls. */
+ sal_uInt32 getStreamLength() const;
+ /** Returns the name of the substorage for the container control data. */
+ OUString getSubStorageName() const;
+ /** Returns the tab index of the control. */
+ inline sal_Int16 getTabIndex() const { return mnTabIndex; }
+
+ /** Tries to create the control model according to the site model. */
+ ControlModelRef createControlModel( const AxClassTable& rClassTable ) const;
+ /** Converts all form site properties. */
+ void convertProperties(
+ PropertyMap& rPropMap,
+ const ControlConverter& rConv,
+ ApiControlType eCtrlType,
+ sal_Int32 nCtrlIndex ) const;
+
+protected:
+ OUString maName; ///< Name of the control.
+ OUString maTag; ///< User defined tag.
+ OUString maToolTip; ///< Tool tip for the control.
+ OUString maControlSource; ///< Linked cell for the control value in a spreadsheet.
+ OUString maRowSource; ///< Source data for the control in a spreadsheet.
+
+ AxPairData maPos; ///< Position in parent container.
+ sal_Int32 mnId; ///< Control identifier.
+ sal_Int32 mnHelpContextId; ///< Help context identifier.
+ sal_uInt32 mnFlags; ///< Various flags.
+ sal_uInt32 mnStreamLen; ///< Size of control stream data.
+ sal_Int16 mnTabIndex; ///< Tab order index.
+ sal_uInt16 mnClassIdOrCache; ///< Class name identifier or GUID cache index.
+ sal_uInt16 mnGroupId; ///< Group identifier for grouped controls.
+};
+
+typedef ::boost::shared_ptr< VbaSiteModel > VbaSiteModelRef;
+
+// ============================================================================
+
+/** A control that is embedded in a VBA user form or in another container
+ control in a VBA user form.
+
+ The control may be a 'simple' control with its data stored in the 'o'
+ stream, or it may be a container control with its data stored in an own
+ substorage.
+ */
+class VbaFormControl
+{
+public:
+ explicit VbaFormControl();
+ virtual ~VbaFormControl();
+
+ /** Imports the model from the passed stream or storage, depending on the
+ control's type. Imports all embedded controls, if this is a container. */
+ void importModelOrStorage(
+ BinaryInputStream& rInStrm,
+ StorageBase& rStrg,
+ const AxClassTable& rClassTable );
+
+ /** Returns the programmatical name of the control. */
+ OUString getControlName() const;
+
+ /** Creates the UNO control model, inserts it into the passed container,
+ and converts all control properties. */
+ void createAndConvert(
+ sal_Int32 nCtrlIndex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxParentNC,
+ const ControlConverter& rConv ) const;
+
+protected:
+ /** Creates and imports the control model containing properties of the control. */
+ void importControlModel( BinaryInputStream& rInStrm, const AxClassTable& rClassTable );
+ /** Creates and imports the control model, and imports all embedded
+ controls from the passed substorage. */
+ void importStorage( StorageBase& rStrg, const AxClassTable& rClassTable );
+
+ /** Converts all control properties, and inserts and converts embedded controls. */
+ bool convertProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
+ const ControlConverter& rConv,
+ sal_Int32 nCtrlIndex ) const;
+
+private:
+ typedef RefVector< VbaFormControl > VbaFormControlVector;
+ typedef VbaFormControlVector::value_type VbaFormControlRef;
+
+ /** Creates the control model according to the current site model. */
+ void createControlModel( const AxClassTable& rClassTable );
+ /** Imports the site model data containing common properties of the control. */
+ bool importSiteModel( BinaryInputStream& rInStrm );
+
+ /** Imports the site models of all embedded controls from the 'f' stream. */
+ bool importEmbeddedSiteModels( BinaryInputStream& rInStrm );
+ /* Final processing of all embedded controls after import. */
+ void finalizeEmbeddedControls();
+
+ /** Moves the control relative to its current position by the passed distance. */
+ void moveRelative( const AxPairData& rDistance );
+ /** Moves all embedded controls from their relative position in this
+ control to an absolute position in the parent of this control. */
+ void moveEmbeddedToAbsoluteParent();
+
+ /** Functor for comparing controls by their tab index. */
+ static bool compareByTabIndex( const VbaFormControlRef& rxLeft, const VbaFormControlRef& rxRight );
+
+protected:
+ VbaSiteModelRef mxSiteModel; ///< Common control properties.
+ ControlModelRef mxCtrlModel; ///< Specific control properties.
+
+private:
+ VbaFormControlVector maControls; ///< All embedded form controls.
+ AxClassTable maClassTable; ///< Class identifiers for exotic embedded controls.
+};
+
+// ============================================================================
+
+class VbaUserForm : public VbaFormControl
+{
+public:
+ explicit VbaUserForm(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
+ const GraphicHelper& rGraphicHelper,
+ bool bDefaultColorBgr = true );
+
+ /** Imports the form and its embedded controls, and inserts the form with
+ all its controls into the passed dialog library. */
+ void importForm(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxDialogLib,
+ StorageBase& rVbaFormStrg,
+ const OUString& rModuleName,
+ rtl_TextEncoding eTextEnc );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxDocModel;
+ ControlConverter maConverter;
+};
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/vbahelper.hxx b/include/oox/ole/vbahelper.hxx
new file mode 100644
index 000000000000..a8faee21ff6e
--- /dev/null
+++ b/include/oox/ole/vbahelper.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 OOX_OLE_VBAHELPER_HXX
+#define OOX_OLE_VBAHELPER_HXX
+
+#include "oox/helper/binarystreambase.hxx"
+
+namespace oox { class BinaryInputStream; }
+
+namespace oox {
+namespace ole {
+
+// Directory stream record identifiers ========================================
+
+const sal_uInt16 VBA_ID_MODULECOOKIE = 0x002C;
+const sal_uInt16 VBA_ID_MODULEDOCSTRING = 0x001C;
+const sal_uInt16 VBA_ID_MODULEDOCSTRINGUNICODE = 0x0048;
+const sal_uInt16 VBA_ID_MODULEEND = 0x002B;
+const sal_uInt16 VBA_ID_MODULEHELPCONTEXT = 0x001E;
+const sal_uInt16 VBA_ID_MODULENAME = 0x0019;
+const sal_uInt16 VBA_ID_MODULENAMEUNICODE = 0x0047;
+const sal_uInt16 VBA_ID_MODULEOFFSET = 0x0031;
+const sal_uInt16 VBA_ID_MODULEPRIVATE = 0x0028;
+const sal_uInt16 VBA_ID_MODULEREADONLY = 0x0025;
+const sal_uInt16 VBA_ID_MODULESTREAMNAME = 0x001A;
+const sal_uInt16 VBA_ID_MODULESTREAMNAMEUNICODE = 0x0032;
+const sal_uInt16 VBA_ID_MODULETYPEDOCUMENT = 0x0022;
+const sal_uInt16 VBA_ID_MODULETYPEPROCEDURAL = 0x0021;
+const sal_uInt16 VBA_ID_PROJECTCODEPAGE = 0x0003;
+const sal_uInt16 VBA_ID_PROJECTEND = 0x0010;
+const sal_uInt16 VBA_ID_PROJECTMODULES = 0x000F;
+const sal_uInt16 VBA_ID_PROJECTNAME = 0x0004;
+const sal_uInt16 VBA_ID_PROJECTVERSION = 0x0009;
+
+// ============================================================================
+
+/** Static helper functions for the VBA filters. */
+class VbaHelper
+{
+public:
+ /** Reads the next record from the VBA directory stream 'dir'.
+
+ @param rnRecId (out parameter) The record identifier of the new record.
+ @param rRecData (out parameter) The contents of the new record.
+ @param rInStrm The 'dir' stream.
+
+ @return True = next record successfully read. False on any error, or
+ if the stream is EOF.
+ */
+ static bool readDirRecord(
+ sal_uInt16& rnRecId,
+ StreamDataSequence& rRecData,
+ BinaryInputStream& rInStrm );
+
+ /** Extracts a key/value pair from a string separated by an equality sign.
+
+ @param rKey (out parameter) The key before the separator.
+ @param rValue (out parameter) The value following the separator.
+ @param rCodeLine The source key/value pair.
+
+ @return True = Equality sign separator found, and the returned key and
+ value are not empty. False otherwise.
+ */
+ static bool extractKeyValue(
+ OUString& rKey,
+ OUString& rValue,
+ const OUString& rKeyValue );
+
+private:
+ VbaHelper();
+ ~VbaHelper();
+};
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/vbainputstream.hxx b/include/oox/ole/vbainputstream.hxx
new file mode 100644
index 000000000000..7e0cd4986bd7
--- /dev/null
+++ b/include/oox/ole/vbainputstream.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 OOX_OLE_VBAINPUTSTREAM_HXX
+#define OOX_OLE_VBAINPUTSTREAM_HXX
+
+#include <vector>
+#include "oox/helper/binaryinputstream.hxx"
+
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+/** A non-seekable input stream that implements run-length decompression. */
+class VbaInputStream : public BinaryInputStream
+{
+public:
+ explicit VbaInputStream( BinaryInputStream& rInStrm );
+
+ /** Returns -1, stream size is not determinable. */
+ virtual sal_Int64 size() const;
+ /** Returns -1, stream position is not tracked. */
+ virtual sal_Int64 tell() const;
+ /** Does nothing, stream is not seekable. */
+ virtual void seek( sal_Int64 nPos );
+ /** Closes the input stream but not the wrapped stream. */
+ virtual void close();
+
+ /** Reads nBytes bytes to the passed sequence.
+ @return Number of bytes really read. */
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 );
+ /** Reads nBytes bytes to the (existing) buffer opMem.
+ @return Number of bytes really read. */
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+ /** Seeks the stream forward by the passed number of bytes. */
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+private:
+ /** If no data left in chunk buffer, reads the next chunk from stream. */
+ bool updateChunk();
+
+private:
+ typedef ::std::vector< sal_uInt8 > ChunkBuffer;
+
+ BinaryInputStream* mpInStrm;
+ ChunkBuffer maChunk;
+ size_t mnChunkPos;
+};
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/vbamodule.hxx b/include/oox/ole/vbamodule.hxx
new file mode 100644
index 000000000000..70dcd3913b9a
--- /dev/null
+++ b/include/oox/ole/vbamodule.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 OOX_OLE_VBAMODULE_HXX
+#define OOX_OLE_VBAMODULE_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <rtl/ustring.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace container { class XNameAccess; }
+ namespace container { class XNameContainer; }
+ namespace frame { class XModel; }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace oox {
+ class BinaryInputStream;
+ class StorageBase;
+}
+
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+class VbaModule
+{
+public:
+ explicit VbaModule(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
+ const OUString& rName,
+ rtl_TextEncoding eTextEnc,
+ bool bExecutable );
+
+ /** Returns the module type (com.sun.star.script.ModuleType constant). */
+ inline sal_Int32 getType() const { return mnType; }
+ /** Sets the passed module type. */
+ inline void setType( sal_Int32 nType ) { mnType = nType; }
+
+ /** Returns the name of the module. */
+ inline const OUString& getName() const { return maName; }
+ /** Returns the stream name of the module. */
+ inline const OUString& getStreamName() const { return maStreamName; }
+
+ /** Imports all records for this module until the MODULEEND record. */
+ void importDirRecords( BinaryInputStream& rDirStrm );
+
+ /** Imports the VBA source code into the passed Basic library. */
+ void createAndImportModule(
+ StorageBase& rVbaStrg,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& rxDocObjectNA ) const;
+ /** Creates an empty Basic module in the passed Basic library. */
+ void createEmptyModule(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& rxDocObjectNA ) const;
+
+private:
+ /** Reads and returns the VBA source code from the passed storage. */
+ OUString readSourceCode( StorageBase& rVbaStrg ) const;
+
+ /** Creates a new Basic module and inserts it into the passed Basic library. */
+ void createModule(
+ const OUString& rVBASourceCode,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& rxDocObjectNA ) const;
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ mxContext; ///< Component context with service manager.
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
+ mxDocModel; ///< Document model used to import/export the VBA project.
+ OUString maName;
+ OUString maStreamName;
+ OUString maDocString;
+ rtl_TextEncoding meTextEnc;
+ sal_Int32 mnType;
+ sal_uInt32 mnOffset;
+ bool mbReadOnly;
+ bool mbPrivate;
+ bool mbExecutable;
+};
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ole/vbaproject.hxx b/include/oox/ole/vbaproject.hxx
new file mode 100644
index 000000000000..f742138756b5
--- /dev/null
+++ b/include/oox/ole/vbaproject.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 OOX_OLE_VBAPROJECT_HXX
+#define OOX_OLE_VBAPROJECT_HXX
+
+#include <map>
+#include <com/sun/star/uno/XInterface.hpp>
+#include "oox/helper/refvector.hxx"
+#include "oox/helper/storagebase.hxx"
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace container { class XNameContainer; }
+ namespace document { class XEventsSupplier; }
+ namespace frame { class XModel; }
+ namespace script { class XLibraryContainer; }
+ namespace script { namespace vba { class XVBAMacroResolver; } }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace oox { class GraphicHelper; }
+
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+class OOX_DLLPUBLIC VbaFilterConfig
+{
+public:
+ explicit VbaFilterConfig(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const OUString& rConfigCompName );
+ ~VbaFilterConfig();
+
+ /** Returns true, if the VBA source code and forms should be imported. */
+ bool isImportVba() const;
+ /** Returns true, if the VBA source code should be imported executable. */
+ bool isImportVbaExecutable() const;
+ /** Returns true, if the VBA source code and forms should be exported. */
+ bool isExportVba() const;
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ mxConfigAccess;
+};
+
+// ============================================================================
+
+/** Base class for objects that attach a amcro to a specific action.
+
+ Purpose is to collect objects that need to attach a VBA macro to an action.
+ The VBA project will be loaded at a very late point of the document import
+ process, because it depends on an initialized core document model (e.g.
+ spreadsheet codenames). Some objects that want to attach a VBA macro to an
+ action (e.g. mouse click action for drawing shapes) are loaded long before
+ the VBA project. The drawback is that in most cases macros are specified
+ without module name, or the VBA project name is part of the macro name.
+ In the former case, all code modules have to be scanned for the macro to be
+ able to create a valid script URL.
+
+ The import code will register these requests to attach a VBA macro with an
+ instance of a class derived from this base class. The derived class will
+ store all information needed to finally attach the macro to the action,
+ once the VBA project has been imported.
+ */
+class OOX_DLLPUBLIC VbaMacroAttacherBase
+{
+public:
+ explicit VbaMacroAttacherBase( const OUString& rMacroName );
+ virtual ~VbaMacroAttacherBase();
+
+ /** Resolves the internal macro name to the related macro URL, and attaches
+ the macro to the object. */
+ void resolveAndAttachMacro(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::script::vba::XVBAMacroResolver >& rxResolver );
+
+private:
+ /** Called after the VBA project has been imported. Derived classes will
+ attach the passed script to the object represented by this instance. */
+ virtual void attachMacro( const OUString& rScriptUrl ) = 0;
+
+private:
+ OUString maMacroName;
+};
+
+typedef ::boost::shared_ptr< VbaMacroAttacherBase > VbaMacroAttacherRef;
+
+// ============================================================================
+
+class OOX_DLLPUBLIC VbaProject : public VbaFilterConfig
+{
+public:
+ explicit VbaProject(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
+ const OUString& rConfigCompName );
+ virtual ~VbaProject();
+
+ /** Imports the entire VBA project from the passed storage.
+
+ @param rVbaPrjStrg The root storage of the entire VBA project.
+ */
+ void importVbaProject(
+ StorageBase& rVbaPrjStrg,
+ const GraphicHelper& rGraphicHelper,
+ bool bDefaultColorBgr = true );
+
+ bool importVbaProject(
+ StorageBase& rVbaPrjStrg );
+
+ /** Registers a macro atatcher object. For details, see description of the
+ VbaMacroAttacherBase class. */
+ void registerMacroAttacher( const VbaMacroAttacherRef& rxAttacher );
+
+ /** Returns true, if the document contains at least one code module. */
+ bool hasModules() const;
+
+ /** Returns true, if the document contains at least one dialog. */
+ bool hasDialogs() const;
+
+ void setOleOverridesSink( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxOleOverridesSink ){ mxOleOverridesSink = rxOleOverridesSink; }
+
+protected:
+ /** Registers a dummy module that will be created when the VBA project is
+ imported. */
+ void addDummyModule( const OUString& rName, sal_Int32 nType );
+
+ /** Called when the import process of the VBA project has been started. */
+ virtual void prepareImport();
+ /** Called when the import process of the VBA project is finished. */
+ virtual void finalizeImport();
+
+private:
+ VbaProject( const VbaProject& );
+ VbaProject& operator=( const VbaProject& );
+
+ /** Returns the Basic or dialog library container. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >
+ getLibraryContainer( sal_Int32 nPropId );
+ /** Opens a Basic or dialog library (creates missing if specified). */
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ openLibrary( sal_Int32 nPropId, bool bCreateMissing );
+ /** Creates and returns the Basic library of the document used for import. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ createBasicLibrary();
+ /** Creates and returns the dialog library of the document used for import. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ createDialogLibrary();
+
+ /** Imports the VBA code modules and forms. */
+ void importVba(
+ StorageBase& rVbaPrjStrg,
+ const GraphicHelper& rGraphicHelper,
+ bool bDefaultColorBgr );
+
+ /** Attaches VBA macros to objects registered via registerMacroAttacher(). */
+ void attachMacros();
+
+ /** Copies the entire VBA project storage to the passed document model. */
+ void copyStorage( StorageBase& rVbaPrjStrg );
+
+private:
+ typedef RefVector< VbaMacroAttacherBase > MacroAttacherVector;
+ typedef ::std::map< OUString, sal_Int32 > DummyModuleMap;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ mxContext; ///< Component context with service manager.
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
+ mxDocModel; ///< Document model used to import/export the VBA project.
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ mxBasicLib; ///< The Basic library of the document used for import.
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ mxDialogLib; ///< The dialog library of the document used for import.
+ MacroAttacherVector maMacroAttachers; ///< Objects that want to attach a VBA macro to an action.
+ DummyModuleMap maDummyModules; ///< Additional empty modules created on import.
+ OUString maPrjName; ///< Name of the VBA project.
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ mxOleOverridesSink;
+};
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/animationspersist.hxx b/include/oox/ppt/animationspersist.hxx
new file mode 100644
index 000000000000..ba63991def2a
--- /dev/null
+++ b/include/oox/ppt/animationspersist.hxx
@@ -0,0 +1,126 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#ifndef OOX_PPT_ANIMATIONPERSIST
+#define OOX_PPT_ANIMATIONPERSIST
+
+#include <list>
+#include <boost/shared_ptr.hpp>
+#include <boost/array.hpp>
+
+#include <rtl/ustring.hxx>
+
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/drawing/XShape.hpp>
+
+#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/ppt/slidepersist.hxx"
+
+namespace oox { namespace ppt {
+
+ enum {
+ NP_TO = 0,
+ NP_FROM, NP_BY, NP_USERDATA, NP_ATTRIBUTENAME,
+ NP_ACCELERATION, NP_AUTOREVERSE, NP_DECELERATE, NP_DURATION, NP_FILL,
+ NP_REPEATCOUNT, NP_REPEATDURATION, NP_RESTART,
+ NP_DIRECTION, NP_COLORINTERPOLATION, NP_CALCMODE, NP_TRANSFORMTYPE,
+ NP_PATH,
+ NP_ENDSYNC, NP_ITERATETYPE, NP_ITERATEINTERVAL,
+ NP_SUBITEM, NP_TARGET, NP_COMMAND, NP_PARAMETER,
+ NP_VALUES, NP_FORMULA, NP_KEYTIMES, NP_DISPLAY,
+ _NP_SIZE
+ };
+
+ typedef boost::array< ::com::sun::star::uno::Any, _NP_SIZE > NodePropertyMap;
+
+
+ /** data for CT_TLShapeTargetElement */
+ struct ShapeTargetElement
+ {
+ ShapeTargetElement()
+ : mnType( 0 )
+ {}
+ void convert( ::com::sun::star::uno::Any & aAny, sal_Int16 & rSubType ) const;
+
+ sal_Int32 mnType;
+ sal_Int32 mnRangeType;
+ drawingml::IndexRange maRange;
+ OUString msSubShapeId;
+ };
+
+
+ /** data for CT_TLTimeTargetElement */
+ struct AnimTargetElement
+ {
+ AnimTargetElement()
+ : mnType( 0 )
+ {}
+ /** convert to a set of properties */
+ ::com::sun::star::uno::Any convert(const SlidePersistPtr & pSlide, sal_Int16 & nSubType) const;
+
+ sal_Int32 mnType;
+ OUString msValue;
+
+ ShapeTargetElement maShapeTarget;
+ };
+
+ typedef boost::shared_ptr< AnimTargetElement > AnimTargetElementPtr;
+
+ struct AnimationCondition;
+
+ typedef ::std::list< AnimationCondition > AnimationConditionList;
+
+ /** data for CT_TLTimeCondition */
+ struct AnimationCondition
+ {
+ AnimationCondition()
+ : mnType( 0 )
+ {}
+
+ ::com::sun::star::uno::Any convert(const SlidePersistPtr & pSlide) const;
+ static ::com::sun::star::uno::Any convertList(const SlidePersistPtr & pSlide, const AnimationConditionList & l);
+
+ AnimTargetElementPtr & getTarget()
+ { if(!mpTarget) mpTarget.reset( new AnimTargetElement ); return mpTarget; }
+ ::com::sun::star::uno::Any maValue;
+ sal_Int32 mnType;
+ private:
+ AnimTargetElementPtr mpTarget;
+ };
+
+
+ struct TimeAnimationValue
+ {
+ OUString msFormula;
+ OUString msTime;
+ ::com::sun::star::uno::Any maValue;
+ };
+
+ typedef ::std::list< TimeAnimationValue > TimeAnimationValueList;
+
+} }
+
+
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/backgroundproperties.hxx b/include/oox/ppt/backgroundproperties.hxx
new file mode 100644
index 000000000000..05926d44b796
--- /dev/null
+++ b/include/oox/ppt/backgroundproperties.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 OOX_POWERPOINT_BACKGROUNDPROPERTIES_HXX
+#define OOX_POWERPOINT_BACKGROUNDPROPERTIES_HXX
+
+#include "oox/core/fragmenthandler2.hxx"
+#include "oox/drawingml/fillproperties.hxx"
+
+namespace oox { namespace ppt {
+
+// ---------------------------------------------------------------------
+
+class BackgroundPropertiesContext : public ::oox::core::FragmentHandler2
+{
+public:
+ BackgroundPropertiesContext( ::oox::core::FragmentHandler2& rParent, ::oox::drawingml::FillProperties& rFillProperties );
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
+
+protected:
+ ::oox::drawingml::FillProperties& mrFillProperties;
+};
+
+} }
+
+#endif // OOX_POWERPOINT_BACKGROUNDPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/comments.hxx b/include/oox/ppt/comments.hxx
new file mode 100644
index 000000000000..1095cd0223db
--- /dev/null
+++ b/include/oox/ppt/comments.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/.
+ */
+
+
+#ifndef OOX_PPT_COMMENTS_HXX
+#define OOX_PPT_COMMENTS_HXX
+
+#include <vector>
+#include <com/sun/star/util/DateTime.hpp>
+
+namespace oox { namespace ppt {
+
+struct CommentAuthor
+{
+ OUString clrIdx;
+ OUString id;
+ OUString initials;
+ OUString lastIdx;
+ OUString name;
+};
+
+class CommentAuthorList
+{
+ private:
+ std::vector<CommentAuthor> cmAuthorLst;
+
+ public:
+ void setValues(const CommentAuthorList& list);
+
+ const std::vector<CommentAuthor>& getCmAuthorLst() const
+ {
+ return cmAuthorLst;
+ }
+
+ void addAuthor(const CommentAuthor& _author)
+ {
+ cmAuthorLst.push_back(_author);
+ }
+
+ friend class Comment;
+};
+
+class Comment
+{
+ private:
+ OUString authorId;
+ OUString dt;
+ OUString idx;
+ OUString x;
+ OUString y;
+ OUString text;
+ ::com::sun::star::util::DateTime aDateTime;
+
+ void setDateTime (OUString datetime);
+
+ public:
+ void setAuthorId(const OUString& _aId)
+ {
+ authorId = _aId;
+ }
+ void setdt(const OUString& _dt)
+ {
+ dt=_dt;
+ setDateTime(_dt);
+ }
+ void setidx(const OUString& _idx)
+ {
+ idx=_idx;
+ }
+ void setPoint(const OUString& _x, const OUString& _y)
+ {
+ x=_x;
+ y=_y;
+ }
+ void setText(const OUString& _text)
+ {
+ text = _text;
+ }
+ OUString getAuthorId()
+ {
+ return authorId;
+ }
+ OUString getdt()
+ {
+ return dt;
+ }
+ OUString getidx()
+ {
+ return idx;
+ }
+ OUString get_X()
+ {
+ return x;
+ }
+ OUString get_Y()
+ {
+ return y;
+ }
+ OUString get_text()
+ {
+ return text;
+ }
+ ::com::sun::star::util::DateTime getDateTime()
+ {
+ return aDateTime;
+ }
+ sal_Int32 getIntX()
+ {
+ return x.toInt32();
+ }
+ sal_Int32 getIntY()
+ {
+ return y.toInt32();
+ }
+ OUString getAuthor ( const CommentAuthorList& list );
+};
+
+class CommentList
+{
+ public:
+ std::vector<Comment> cmLst;
+ int getSize ()
+ {
+ return (int)cmLst.size();
+ }
+ const Comment& getCommentAtIndex (int index);
+};
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/customshowlistcontext.hxx b/include/oox/ppt/customshowlistcontext.hxx
new file mode 100644
index 000000000000..ed913c8bbe2c
--- /dev/null
+++ b/include/oox/ppt/customshowlistcontext.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 OOX_POWERPOINT_CUSTOMSHOWLISTCONTEXT_HXX
+#define OOX_POWERPOINT_CUSTOMSHOWLISTCONTEXT_HXX
+
+#include "oox/core/fragmenthandler2.hxx"
+#include <vector>
+
+namespace oox { namespace ppt {
+
+
+ struct CustomShow
+ {
+ OUString maName;
+ OUString mnId;
+ std::vector< OUString >maSldLst;
+ };
+
+ /** CT_ */
+ class CustomShowListContext : public ::oox::core::FragmentHandler2
+ {
+ std::vector< CustomShow >& mrCustomShowList;
+
+ public:
+ CustomShowListContext( ::oox::core::FragmentHandler2& rParent,
+ std::vector< CustomShow >& rCustomShowList );
+
+ ~CustomShowListContext( );
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
+ };
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/dgmimport.hxx b/include/oox/ppt/dgmimport.hxx
new file mode 100644
index 000000000000..f369c5e526b8
--- /dev/null
+++ b/include/oox/ppt/dgmimport.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 OOX_POWERPOINT_QUICKDIAGRAMMINGIMPORT_HXX
+#define OOX_POWERPOINT_QUICKDIAGRAMMINGIMPORT_HXX
+
+#include "oox/core/xmlfilterbase.hxx"
+
+#include <com/sun/star/animations/XAnimationNode.hpp>
+#include <oox/drawingml/theme.hxx>
+#include "oox/ppt/presentationfragmenthandler.hxx"
+#include "oox/ppt/slidepersist.hxx"
+#include <vector>
+#include <map>
+
+namespace oox { namespace ppt {
+
+// ---------------------------------------------------------------------
+
+class QuickDiagrammingImport : public oox::core::XmlFilterBase
+{
+public:
+
+ QuickDiagrammingImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+
+ // from FilterBase
+ virtual bool importDocument() throw();
+ virtual bool exportDocument() throw();
+
+ virtual const ::oox::drawingml::Theme* getCurrentTheme() const;
+ virtual sal_Int32 getSchemeClr( sal_Int32 nColorSchemeToken ) const;
+ virtual const oox::drawingml::table::TableStyleListPtr getTableStyles();
+
+ virtual oox::vml::Drawing* getVmlDrawing();
+ virtual oox::drawingml::chart::ChartConverter* getChartConverter();
+
+private:
+ virtual OUString implGetImplementationName() const;
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
+};
+
+} }
+
+#endif // OOX_POWERPOINT_QUICKDIAGRAMMINGIMPORT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/dgmlayout.hxx b/include/oox/ppt/dgmlayout.hxx
new file mode 100644
index 000000000000..bf964fe5d310
--- /dev/null
+++ b/include/oox/ppt/dgmlayout.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 OOX_POWERPOINT_QUICKDIAGRAMMINGLAYOUT_HXX
+#define OOX_POWERPOINT_QUICKDIAGRAMMINGLAYOUT_HXX
+
+#include "oox/core/xmlfilterbase.hxx"
+
+#include <com/sun/star/animations/XAnimationNode.hpp>
+#include <oox/drawingml/theme.hxx>
+#include "oox/ppt/presentationfragmenthandler.hxx"
+#include "oox/ppt/slidepersist.hxx"
+#include <vector>
+#include <map>
+
+namespace oox { namespace ppt {
+
+// ---------------------------------------------------------------------
+
+class QuickDiagrammingLayout : public oox::core::XmlFilterBase
+{
+public:
+
+ QuickDiagrammingLayout( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+
+ // from FilterBase
+ virtual bool importDocument() throw();
+ virtual bool exportDocument() throw();
+
+ virtual const ::oox::drawingml::Theme* getCurrentTheme() const;
+ virtual sal_Int32 getSchemeClr( sal_Int32 nColorSchemeToken ) const;
+ virtual const oox::drawingml::table::TableStyleListPtr getTableStyles();
+
+ virtual ::oox::vml::Drawing* getVmlDrawing();
+ virtual ::oox::drawingml::chart::ChartConverter* getChartConverter();
+
+private:
+ virtual OUString implGetImplementationName() const;
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
+ drawingml::ThemePtr mpThemePtr;
+};
+
+} }
+
+#endif // OOX_POWERPOINT_QUICKDIAGRAMMINGLAYOUT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/headerfooter.hxx b/include/oox/ppt/headerfooter.hxx
new file mode 100644
index 000000000000..4d0a3cb65f1d
--- /dev/null
+++ b/include/oox/ppt/headerfooter.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 OOX_PPT_HEADERFOOTER
+#define OOX_PPT_HEADERFOOTER
+
+#include <sal/types.h>
+
+namespace oox { namespace ppt {
+
+ struct HeaderFooter
+ {
+ sal_Bool mbSlideNumber;
+ sal_Bool mbHeader;
+ sal_Bool mbFooter;
+ sal_Bool mbDateTime;
+
+ HeaderFooter()
+ : mbSlideNumber( sal_True )
+ , mbHeader( sal_True )
+ , mbFooter( sal_True )
+ , mbDateTime( sal_True ) {};
+ };
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/layoutfragmenthandler.hxx b/include/oox/ppt/layoutfragmenthandler.hxx
new file mode 100644
index 000000000000..80983182b73d
--- /dev/null
+++ b/include/oox/ppt/layoutfragmenthandler.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 OOX_PPT_LAYOUTFRAGMENTHANDLER
+#define OOX_PPT_LAYOUTFRAGMENTHANDLER
+
+#include "oox/ppt/slidefragmenthandler.hxx"
+
+#include <vector>
+
+namespace oox { namespace ppt {
+
+class LayoutFragmentHandler : public SlideFragmentHandler
+{
+public:
+ LayoutFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, SlidePersistPtr pMasterPersistPtr ) throw();
+ virtual ~LayoutFragmentHandler() throw();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
+};
+
+} }
+
+#endif // OOX_PPT_LAYOUTFRAGMENTHANDLER
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/pptgraphicshapecontext.hxx b/include/oox/ppt/pptgraphicshapecontext.hxx
new file mode 100644
index 000000000000..180098a67166
--- /dev/null
+++ b/include/oox/ppt/pptgraphicshapecontext.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 OOX_PPT_PPTGRAPHICSHAPECONTEXT_HXX
+#define OOX_PPT_PPTGRAPHICSHAPECONTEXT_HXX
+
+#include "oox/drawingml/graphicshapecontext.hxx"
+
+namespace oox { namespace ppt {
+
+class PPTGraphicShapeContext : public ::oox::drawingml::GraphicShapeContext
+{
+ SlidePersistPtr mpSlidePersistPtr;
+
+public:
+ PPTGraphicShapeContext( ::oox::core::ContextHandler& rParent, const SlidePersistPtr pSlidePersistPtr, oox::drawingml::ShapePtr pMasterShapePtr, oox::drawingml::ShapePtr pShapePtr );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+};
+
+} }
+
+#endif // OOX_PPT_PPTGRAPHICSHAPEGROUPCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/pptimport.hxx b/include/oox/ppt/pptimport.hxx
new file mode 100644
index 000000000000..035ea8cdc5c1
--- /dev/null
+++ b/include/oox/ppt/pptimport.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 OOX_POWERPOINT_POWERPOINTIMPORT_HXX
+#define OOX_POWERPOINT_POWERPOINTIMPORT_HXX
+
+#include "oox/core/xmlfilterbase.hxx"
+
+#include <com/sun/star/animations/XAnimationNode.hpp>
+#include <oox/drawingml/theme.hxx>
+#include "oox/ppt/presentationfragmenthandler.hxx"
+#include "oox/ppt/slidepersist.hxx"
+#include <vector>
+#include <map>
+
+namespace oox { namespace ppt {
+
+// ---------------------------------------------------------------------
+
+class PowerPointImport : public oox::core::XmlFilterBase
+{
+public:
+
+ PowerPointImport( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual ~PowerPointImport();
+
+ // from FilterBase
+ virtual bool importDocument() throw();
+ virtual bool exportDocument() throw();
+
+ virtual const ::oox::drawingml::Theme* getCurrentTheme() const;
+ virtual ::oox::vml::Drawing* getVmlDrawing();
+ virtual const oox::drawingml::table::TableStyleListPtr getTableStyles();
+ virtual ::oox::drawingml::chart::ChartConverter* getChartConverter();
+
+ void setActualSlidePersist( SlidePersistPtr pActualSlidePersist ){ mpActualSlidePersist = pActualSlidePersist; };
+ std::map< OUString, oox::drawingml::ThemePtr >& getThemes(){ return maThemes; };
+ std::vector< SlidePersistPtr >& getDrawPages(){ return maDrawPages; };
+ std::vector< SlidePersistPtr >& getMasterPages(){ return maMasterPages; };
+ std::vector< SlidePersistPtr >& getNotesPages(){ return maNotesPages; };
+
+ virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rDescriptor )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ sal_Int32 getSchemeColor( sal_Int32 nToken ) const;
+
+#if OSL_DEBUG_LEVEL > 0
+ static XmlFilterBase* mpDebugFilterBase;
+#endif
+
+private:
+ virtual GraphicHelper* implCreateGraphicHelper() const;
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
+ virtual OUString implGetImplementationName() const;
+
+private:
+ OUString maTableStyleListPath;
+ oox::drawingml::table::TableStyleListPtr mpTableStyleList;
+
+ SlidePersistPtr mpActualSlidePersist;
+ std::map< OUString, oox::drawingml::ThemePtr > maThemes;
+
+ std::vector< SlidePersistPtr > maDrawPages;
+ std::vector< SlidePersistPtr > maMasterPages;
+ std::vector< SlidePersistPtr > maNotesPages;
+
+ ::boost::shared_ptr< ::oox::drawingml::chart::ChartConverter > mxChartConv;
+};
+
+} }
+
+#endif // OOX_POWERPOINT_POWERPOINTIMPORT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/pptshape.hxx b/include/oox/ppt/pptshape.hxx
new file mode 100644
index 000000000000..aa485adf9347
--- /dev/null
+++ b/include/oox/ppt/pptshape.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 OOX_PPT_PRESENTATION_PPTSHAPE_HXX
+#define OOX_PPT_PRESENTATION_PPTSHAPE_HXX
+
+#include "oox/drawingml/shape.hxx"
+#include "oox/ppt/slidepersist.hxx"
+
+namespace oox { namespace ppt {
+
+class PPTShape : public oox::drawingml::Shape
+{
+ ShapeLocation meShapeLocation; // placeholdershapes (mnSubType != 0) on Master are never displayed
+ sal_Bool mbReferenced; // placeholdershapes on Layout are displayed only, if they are not referenced
+ // placeholdershapes on Slide are displayed always
+
+public:
+
+ PPTShape( const oox::ppt::ShapeLocation eShapeLocation,
+ const sal_Char* pServiceType = NULL );
+ virtual ~PPTShape();
+
+ using oox::drawingml::Shape::addShape;
+ // addShape is creating and inserting the corresponding XShape.
+ void addShape(
+ oox::core::XmlFilterBase& rFilterBase,
+ SlidePersist& rPersist,
+ const oox::drawingml::Theme* pTheme,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ basegfx::B2DHomMatrix& aTransformation,
+ const com::sun::star::awt::Rectangle* pShapeRect = 0,
+ ::oox::drawingml::ShapeIdMap* pShapeMap = 0 );
+
+ virtual void applyShapeReference( const oox::drawingml::Shape& rReferencedShape, bool bUseText = true );
+
+ void setShapeLocation( const oox::ppt::ShapeLocation eShapeLocation ) { meShapeLocation = eShapeLocation; };
+ ShapeLocation getShapeLocation() const { return meShapeLocation; };
+ sal_Bool isReferenced() const { return mbReferenced; };
+ void setReferenced( sal_Bool bReferenced ){ mbReferenced = bReferenced; };
+ void setPlaceholder( oox::drawingml::ShapePtr pPlaceholder ) { mpPlaceholder = pPlaceholder; }
+
+ static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes, bool bMasterOnly = false );
+ static oox::drawingml::ShapePtr findPlaceholderByIndex( const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes, bool bMasterOnly = false );
+
+ static oox::drawingml::TextListStylePtr getSubTypeTextListStyle( const SlidePersist& rSlidePersist, sal_Int32 nSubType );
+
+protected:
+
+ oox::drawingml::ShapePtr mpPlaceholder;
+};
+
+} }
+
+#endif // OOX_PPT_PRESENTATION_PPTSHAPE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/pptshapecontext.hxx b/include/oox/ppt/pptshapecontext.hxx
new file mode 100644
index 000000000000..59e46b3d54b5
--- /dev/null
+++ b/include/oox/ppt/pptshapecontext.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 OOX_PPT_PPTSHAPECONTEXT_HXX
+#define OOX_PPT_PPTSHAPECONTEXT_HXX
+
+#include "oox/drawingml/shapecontext.hxx"
+
+namespace oox { namespace ppt {
+
+class PPTShapeContext : public ::oox::drawingml::ShapeContext
+{
+ SlidePersistPtr mpSlidePersistPtr;
+
+public:
+ PPTShapeContext( ::oox::core::ContextHandler& rParent, const SlidePersistPtr pSlidePersistPtr, oox::drawingml::ShapePtr pMasterShapePtr, oox::drawingml::ShapePtr pShapePtr );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+};
+
+} }
+
+#endif // OOX_PPT_PPTSHAPEGROUPCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/pptshapegroupcontext.hxx b/include/oox/ppt/pptshapegroupcontext.hxx
new file mode 100644
index 000000000000..c7e60c76e823
--- /dev/null
+++ b/include/oox/ppt/pptshapegroupcontext.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 OOX_PPT_PPTSHAPEGROUPCONTEXT_HXX
+#define OOX_PPT_PPTSHAPEGROUPCONTEXT_HXX
+
+#include "oox/drawingml/shapegroupcontext.hxx"
+#include "oox/ppt/slidepersist.hxx"
+
+namespace oox { namespace ppt {
+
+class PPTShapeGroupContext : public ::oox::drawingml::ShapeGroupContext
+{
+ SlidePersistPtr mpSlidePersistPtr;
+ ShapeLocation meShapeLocation;
+ oox::drawingml::ShapePtr pGraphicShape;
+ void importExtDrawings();
+
+public:
+ PPTShapeGroupContext(
+ ::oox::core::ContextHandler& rParent,
+ const oox::ppt::SlidePersistPtr pSlidePersistPtr,
+ const oox::ppt::ShapeLocation eShapeLocation,
+ oox::drawingml::ShapePtr pMasterShapePtr,
+ oox::drawingml::ShapePtr pGroupShapePtr );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+protected:
+
+};
+
+} }
+
+#endif // OOX_PPT_PPTSHAPEGROUPCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/pptshapepropertiescontext.hxx b/include/oox/ppt/pptshapepropertiescontext.hxx
new file mode 100644
index 000000000000..f979c6efd3db
--- /dev/null
+++ b/include/oox/ppt/pptshapepropertiescontext.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 OOX_PPT_PPTSHAPEPROPERTIESCONTEXT_HXX
+#define OOX_PPT_PPTSHAPEPROPERTIESCONTEXT_HXX
+
+#include "oox/drawingml/shapepropertiescontext.hxx"
+
+namespace oox { namespace ppt {
+
+class PPTShapePropertiesContext : public ::oox::drawingml::ShapePropertiesContext
+{
+public:
+ PPTShapePropertiesContext( ::oox::core::ContextHandler& rParent, ::oox::drawingml::Shape& rShape );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+};
+
+} }
+
+#endif // OOX_PPT_PPTSHAPEGROUPCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx
new file mode 100644
index 000000000000..ae26cb233e8c
--- /dev/null
+++ b/include/oox/ppt/presentationfragmenthandler.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 OOX_PPT_PRESENTATION_FRAGMENTHANDLER
+#define OOX_PPT_PRESENTATION_FRAGMENTHANDLER
+
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include "oox/drawingml/textliststyle.hxx"
+#include "oox/ppt/slidepersist.hxx"
+#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
+#include "oox/core/relations.hxx"
+#include "oox/ppt/customshowlistcontext.hxx"
+#include "oox/ppt/comments.hxx"
+#include <stack>
+#include <vector>
+
+namespace oox { namespace ppt {
+
+class PresentationFragmentHandler : public ::oox::core::FragmentHandler2
+{
+public:
+ PresentationFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath ) throw();
+ virtual ~PresentationFragmentHandler() throw();
+ virtual void finalizeImport();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
+
+protected:
+ bool importSlide( const ::oox::core::FragmentHandlerRef& rxSlideFragmentHandler,
+ const oox::ppt::SlidePersistPtr pPersist );
+
+private:
+
+ void importSlide(sal_uInt32 nSlide, sal_Bool bFirstSlide, sal_Bool bImportNotes);
+
+ std::vector< OUString > maSlideMasterVector;
+ std::vector< OUString > maSlidesVector;
+ std::vector< OUString > maNotesMasterVector;
+ ::oox::drawingml::TextListStylePtr mpTextListStyle;
+
+ ::com::sun::star::awt::Size maSlideSize;
+ ::com::sun::star::awt::Size maNotesSize;
+
+ std::vector< CustomShow > maCustomShowList;
+
+ CommentAuthorList maAuthorList;
+ bool mbCommentAuthorsRead; // read commentAuthors.xml only once
+};
+
+} }
+
+#endif // OOX_PPT_PRESENTATION_FRAGMENTHANDLER
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/slidefragmenthandler.hxx b/include/oox/ppt/slidefragmenthandler.hxx
new file mode 100644
index 000000000000..045f6ff1ccda
--- /dev/null
+++ b/include/oox/ppt/slidefragmenthandler.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 OOX_PPT_SLIDEFRAGMENTHANDLER
+#define OOX_PPT_SLIDEFRAGMENTHANDLER
+
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include "oox/helper/propertymap.hxx"
+#include "oox/core/fragmenthandler2.hxx"
+#include "oox/ppt/slidepersist.hxx"
+
+#include <stack>
+#include <vector>
+#include <map>
+
+namespace oox { namespace ppt {
+
+class SlideFragmentHandler : public ::oox::core::FragmentHandler2
+{
+public:
+ SlideFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, SlidePersistPtr pPersistPtr, const ShapeLocation eShapeLocation ) throw();
+ virtual ~SlideFragmentHandler() throw();
+
+ virtual void finalizeImport();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
+ virtual void onCharacters( const OUString& rChars );
+
+ const ::std::vector< OUString>& getCharVector() { return maCharVector; }
+
+protected:
+ SlidePersistPtr mpSlidePersistPtr;
+ ShapeLocation meShapeLocation;
+
+private:
+ OUString maSlideName;
+ PropertyMap maSlideProperties;
+ ::std::vector< OUString> maCharVector; // handle char in OnCharacters
+};
+
+} }
+
+#endif // OOX_PPT_SLIDEFRAGMENTHANDLER
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/slidemastertextstylescontext.hxx b/include/oox/ppt/slidemastertextstylescontext.hxx
new file mode 100644
index 000000000000..c1e9c1478ec6
--- /dev/null
+++ b/include/oox/ppt/slidemastertextstylescontext.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 OOX_DRAWINGML_SLIDEMASTERTEXTSTYLESCONTEXT_HXX
+#define OOX_DRAWINGML_SLIDEMASTERTEXTSTYLESCONTEXT_HXX
+
+#include "oox/drawingml/theme.hxx"
+#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
+#include "oox/ppt/slidepersist.hxx"
+
+namespace oox { namespace ppt {
+
+class SlideMasterTextStylesContext : public oox::core::FragmentHandler2
+{
+public:
+ SlideMasterTextStylesContext( ::oox::core::FragmentHandler2& rParent, SlidePersistPtr pSlidePersistPtr );
+ ~SlideMasterTextStylesContext();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
+
+protected:
+ SlidePersistPtr mpSlidePersistPtr;
+};
+
+} }
+
+#endif // OOX_DRAWINGML_SLIDEMASTERTEXTSTYLESCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/slidepersist.hxx b/include/oox/ppt/slidepersist.hxx
new file mode 100644
index 000000000000..6f58d81813c3
--- /dev/null
+++ b/include/oox/ppt/slidepersist.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 OOX_POWERPOINT_SLIDEPERSIST_HXX
+#define OOX_POWERPOINT_SLIDEPERSIST_HXX
+
+#include <boost/shared_ptr.hpp>
+#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/theme.hxx"
+#include "oox/drawingml/clrscheme.hxx"
+#include "oox/drawingml/textliststyle.hxx"
+#include "oox/drawingml/textparagraphproperties.hxx"
+#include <oox/ppt/headerfooter.hxx>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/animations/XAnimationNode.hpp>
+#include "oox/core/fragmenthandler.hxx"
+#include "oox/ppt/comments.hxx"
+
+#include <list>
+
+namespace oox { namespace vml { class Drawing; } }
+
+namespace oox { namespace ppt {
+
+enum ShapeLocation
+{
+ Master,
+ Layout,
+ Slide
+};
+
+// ---------------------------------------------------------------------
+class TimeNode;
+class SlidePersist;
+
+typedef boost::shared_ptr< SlidePersist > SlidePersistPtr;
+
+class SlidePersist : public boost::enable_shared_from_this< SlidePersist >
+{
+
+public:
+ SlidePersist( oox::core::XmlFilterBase& rFilter, sal_Bool bMaster, sal_Bool bNotes,
+ const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >&,
+ oox::drawingml::ShapePtr pShapesPtr, const ::oox::drawingml::TextListStylePtr & );
+ ~SlidePersist();
+
+ com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > getPage() const { return mxPage; };
+
+#if OSL_DEBUG_LEVEL > 0
+ static com::sun::star::uno::WeakReference< com::sun::star::drawing::XDrawPage > mxDebugPage;
+#endif
+
+ void setMasterPersist( SlidePersistPtr pMasterPersistPtr ){ mpMasterPagePtr = pMasterPersistPtr; }
+ SlidePersistPtr getMasterPersist() const { return mpMasterPagePtr; }
+
+ void setPath( const OUString& rPath ) { maPath = rPath; }
+ const OUString getPath() const { return maPath; }
+
+ void setLayoutPath( const OUString& rLayoutPath ) { maLayoutPath = rLayoutPath; }
+ const OUString getLayoutPath() const { return maLayoutPath; }
+
+ void setTheme( const oox::drawingml::ThemePtr pThemePtr ){ mpThemePtr = pThemePtr; }
+ oox::drawingml::ThemePtr getTheme() const { return mpThemePtr; }
+
+ void setClrScheme( const oox::drawingml::ClrSchemePtr pClrSchemePtr ){ mpClrSchemePtr = pClrSchemePtr; }
+ oox::drawingml::ClrSchemePtr getClrScheme() const { return mpClrSchemePtr; }
+
+ void setClrMap( const oox::drawingml::ClrMapPtr pClrMapPtr ){ mpClrMapPtr = pClrMapPtr; }
+ oox::drawingml::ClrMapPtr getClrMap() const { return mpClrMapPtr; }
+
+ void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr pFillPropertiesPtr ){ mpBackgroundPropertiesPtr = pFillPropertiesPtr; }
+ oox::drawingml::FillPropertiesPtr getBackgroundProperties() const { return mpBackgroundPropertiesPtr; }
+ oox::drawingml::Color& getBackgroundColor() { return maBackgroundColor; }
+
+ sal_Bool isMasterPage() const { return mbMaster; }
+ sal_Bool isNotesPage() const { return mbNotes; }
+
+ void setLayoutValueToken( sal_Int32 nLayoutValueToken ) { mnLayoutValueToken = nLayoutValueToken; }
+ short getLayoutFromValueToken();
+
+
+ oox::drawingml::TextListStylePtr getDefaultTextStyle() const { return maDefaultTextStylePtr; }
+ oox::drawingml::TextListStylePtr getTitleTextStyle() const { return maTitleTextStylePtr; }
+ oox::drawingml::TextListStylePtr getBodyTextStyle() const { return maBodyTextStylePtr; }
+ oox::drawingml::TextListStylePtr getNotesTextStyle() const { return maNotesTextStylePtr; }
+ oox::drawingml::TextListStylePtr getOtherTextStyle() const { return maOtherTextStylePtr; }
+
+ oox::drawingml::ShapePtr getShapes() { return maShapesPtr; }
+ void hideShapesAsMasterShapes();
+ ::std::list< boost::shared_ptr< TimeNode > >& getTimeNodeList() { return maTimeNodeList; }
+ oox::ppt::HeaderFooter& getHeaderFooter(){ return maHeaderFooter; };
+
+ oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); }
+
+ void createXShapes( oox::core::XmlFilterBase& rFilterBase );
+ void createBackground( const oox::core::XmlFilterBase& rFilterBase );
+ void applyTextStyles( const oox::core::XmlFilterBase& rFilterBase );
+
+ std::map< OUString, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > >& getAnimNodesMap() { return maAnimNodesMap; };
+ ::oox::drawingml::ShapePtr getShape( const OUString & id ) { return maShapeMap[ id ]; }
+ ::oox::drawingml::ShapeIdMap& getShapeMap() { return maShapeMap; }
+
+ CommentList& getCommentsList() { return maCommentsList; }
+ CommentAuthorList& getCommentAuthors() { return maCommentAuthors; }
+
+private:
+ OUString maPath;
+ OUString maLayoutPath;
+ ::boost::shared_ptr< oox::vml::Drawing > mpDrawingPtr;
+ com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > mxPage;
+ oox::drawingml::ThemePtr mpThemePtr; // the theme that is used
+ oox::drawingml::ClrSchemePtr mpClrSchemePtr; // the local color scheme (if any)
+ oox::drawingml::ClrMapPtr mpClrMapPtr; // color mapping (if any)
+ SlidePersistPtr mpMasterPagePtr;
+
+ oox::drawingml::ShapePtr maShapesPtr;
+ oox::drawingml::Color maBackgroundColor;
+ oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr;
+ ::std::list< boost::shared_ptr< TimeNode > > maTimeNodeList;
+
+ oox::ppt::HeaderFooter maHeaderFooter;
+ sal_Int32 mnLayoutValueToken;
+ sal_Bool mbMaster;
+ sal_Bool mbNotes;
+
+ oox::drawingml::TextListStylePtr maDefaultTextStylePtr;
+ oox::drawingml::TextListStylePtr maTitleTextStylePtr;
+ oox::drawingml::TextListStylePtr maBodyTextStylePtr;
+ oox::drawingml::TextListStylePtr maNotesTextStylePtr;
+ oox::drawingml::TextListStylePtr maOtherTextStylePtr;
+
+ std::map< OUString, ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > > maAnimNodesMap;
+ std::map< OUString, ::oox::drawingml::ShapePtr > maShapeMap;
+
+ // slide comments
+ CommentList maCommentsList;
+ CommentAuthorList maCommentAuthors;
+};
+
+} }
+
+#endif // OOX_POWERPOINT_SLIDEPERSIST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/slidetimingcontext.hxx b/include/oox/ppt/slidetimingcontext.hxx
new file mode 100644
index 000000000000..a50e8be60fd3
--- /dev/null
+++ b/include/oox/ppt/slidetimingcontext.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 OOX_PPT_SLIDETIMINGCONTEXT
+#define OOX_PPT_SLIDETIMINGCONTEXT
+
+#include <com/sun/star/animations/XTimeContainer.hpp>
+#include "oox/ppt/timenode.hxx"
+#include "oox/core/fragmenthandler2.hxx"
+
+#include <stack>
+#include <vector>
+
+namespace oox { namespace ppt {
+
+class SlideTimingContext : public ::oox::core::FragmentHandler2
+{
+public:
+ SlideTimingContext( ::oox::core::FragmentHandler2& rParent, TimeNodePtrList & aTimeNodeList ) throw();
+ virtual ~SlideTimingContext() throw();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
+
+private:
+ TimeNodePtrList & maTimeNodeList;
+};
+
+} }
+
+#endif // OOX_PPT_SLIDETIMINGCONTEXT
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/slidetransition.hxx b/include/oox/ppt/slidetransition.hxx
new file mode 100644
index 000000000000..01f701d63dfe
--- /dev/null
+++ b/include/oox/ppt/slidetransition.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 OOX_PPT_SLIDETRANSITION
+#define OOX_PPT_SLIDETRANSITION
+
+#include <rtl/ustring.hxx>
+
+#include <com/sun/star/animations/XTransitionFilter.hpp>
+
+namespace oox { class PropertyMap; }
+
+namespace oox { namespace ppt {
+
+ class SlideTransition
+ {
+ public:
+ SlideTransition();
+ explicit SlideTransition(const OUString & );
+
+ void setSlideProperties( PropertyMap& props );
+ void setTransitionFilterProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XTransitionFilter > & xFilter );
+
+ void setOoxTransitionSpeed( sal_Int32 nToken );
+ void setFadeColor( sal_Int32 nColor )
+ { mnFadeColor = nColor; }
+ void setMode( sal_Bool bMode )
+ { mbMode = bMode; }
+ void setOoxAdvanceTime( sal_Int32 nAdvanceTime )
+ { mnAdvanceTime = nAdvanceTime; }
+
+ static sal_Int16 ooxToOdpDirection( ::sal_Int32 nOoxType );
+ static sal_Int16 ooxToOdpEightDirections( ::sal_Int32 nOoxType );
+ static sal_Int16 ooxToOdpCornerDirections( ::sal_Int32 nOoxType );
+ static sal_Int16 ooxToOdpBorderDirections( ::sal_Int32 nOoxType );
+ static sal_Int16 ooxToOdpSideDirections( ::sal_Int32 nOoxType );
+ static sal_Bool ooxToOdpSideDirectionsDirectionNormal( ::sal_Int32 nOoxType );
+
+ void setOoxTransitionType( ::sal_Int32 OoxType,
+ ::sal_Int32 param1, ::sal_Int32 param2 );
+ private:
+ ::sal_Int16 mnTransitionType;
+ ::sal_Int16 mnTransitionSubType;
+ ::sal_Bool mbTransitionDirectionNormal;
+ ::sal_Int16 mnAnimationSpeed;
+ ::sal_Int32 mnFadeColor;
+ ::sal_Bool mbMode; /**< http://api.libreoffice.org/docs/common/ref/com/sun/star/animations/XTransitionFilter.html Mode property */
+ ::sal_Int32 mnAdvanceTime;
+ };
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/slidetransitioncontext.hxx b/include/oox/ppt/slidetransitioncontext.hxx
new file mode 100644
index 000000000000..077d5a8f5813
--- /dev/null
+++ b/include/oox/ppt/slidetransitioncontext.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 OOX_PPT_SLIDETRANSITIONCONTEXT
+#define OOX_PPT_SLIDETRANSITIONCONTEXT
+
+#include "oox/core/fragmenthandler2.hxx"
+#include "oox/ppt/slidetransition.hxx"
+
+namespace oox { class PropertyMap; }
+
+namespace oox { namespace ppt {
+
+ class SlideTransitionContext : public ::oox::core::FragmentHandler2
+ {
+ public:
+ SlideTransitionContext( ::oox::core::FragmentHandler2& rParent,
+ const AttributeList& rAttributes,
+ PropertyMap & aProperties ) throw();
+ virtual ~SlideTransitionContext() throw();
+
+ virtual void onEndElement();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
+
+
+ private:
+ PropertyMap& maSlideProperties;
+ ::sal_Bool mbHasTransition;
+ SlideTransition maTransition;
+ };
+
+} }
+
+#endif // OOX_PPT_SLIDEFRAGMENTHANDLER
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/soundactioncontext.hxx b/include/oox/ppt/soundactioncontext.hxx
new file mode 100644
index 000000000000..d1f1040c75ba
--- /dev/null
+++ b/include/oox/ppt/soundactioncontext.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 OOX_PPT_SOUNDACTIONCONTEXT
+#define OOX_PPT_SOUNDACTIONCONTEXT
+
+#include "oox/core/fragmenthandler2.hxx"
+
+namespace oox { class PropertyMap; }
+
+namespace oox { namespace ppt {
+
+class SoundActionContext : public ::oox::core::FragmentHandler2
+{
+public:
+ SoundActionContext( ::oox::core::FragmentHandler2& rParent, PropertyMap & aProperties ) throw();
+ virtual ~SoundActionContext() throw();
+
+ virtual void onEndElement();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
+
+private:
+ PropertyMap& maSlideProperties;
+ bool mbHasStartSound;
+ bool mbLoopSound;
+ bool mbStopSound;
+ OUString msEmbedded;
+ OUString msLink;
+ OUString msSndName;
+};
+
+} }
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/timenode.hxx b/include/oox/ppt/timenode.hxx
new file mode 100644
index 000000000000..769cc0e03943
--- /dev/null
+++ b/include/oox/ppt/timenode.hxx
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#ifndef OOX_DRAWINGML_TIMENODE_HXX
+#define OOX_DRAWINGML_TIMENODE_HXX
+
+#include <boost/shared_ptr.hpp>
+#include <vector>
+#include <list>
+#include <rtl/ustring.hxx>
+
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/animations/XAnimationNode.hpp>
+#include "oox/helper/propertymap.hxx"
+#include "oox/ppt/slidetransition.hxx"
+#include "oox/ppt/slidepersist.hxx"
+#include "oox/ppt/animationspersist.hxx"
+#include "oox/ppt/timenode.hxx"
+
+namespace oox { namespace ppt {
+
+ class TimeNode;
+ class SlideTransition;
+
+ typedef boost::shared_ptr< TimeNode > TimeNodePtr;
+ typedef ::std::list< TimeNodePtr > TimeNodePtrList;
+
+ class TimeNode
+ {
+ public:
+ typedef ::std::map< OUString, ::com::sun::star::uno::Any > UserDataMap;
+
+ TimeNode( sal_Int16 nNodeType );
+ virtual ~TimeNode();
+
+ NodePropertyMap & getNodeProperties() { return maNodeProperties; }
+ UserDataMap & getUserData() { return maUserData; }
+ void addChild( const TimeNodePtr & pChildPtr )
+ { maChildren.push_back( pChildPtr ); }
+
+ TimeNodePtrList & getChildren()
+ { return maChildren; }
+
+ void setId( sal_Int32 nId );
+ const OUString & getId() const { return msId; }
+
+ void addNode(
+ const ::oox::core::XmlFilterBase& rFilter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rxNode,
+ const SlidePersistPtr & slide);
+ // data setters
+ void setTo( const ::com::sun::star::uno::Any & aTo );
+ void setFrom( const ::com::sun::star::uno::Any & aFrom );
+ void setBy( const ::com::sun::star::uno::Any & aBy );
+ void setTransitionFilter( const SlideTransition & aTransition)
+ { maTransitionFilter = aTransition; }
+
+ void setNode(
+ const ::oox::core::XmlFilterBase& rFilter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode,
+ const SlidePersistPtr & pSlide );
+
+ AnimTargetElementPtr getTarget()
+ {
+ if( !mpTarget )
+ mpTarget.reset( new AnimTargetElement );
+ return mpTarget;
+ }
+
+ AnimationConditionList &getStartCondition()
+ { return maStCondList; }
+ AnimationConditionList &getEndCondition()
+ { return maEndCondList; }
+ AnimationConditionList &getNextCondition()
+ { return maNextCondList; }
+ AnimationConditionList &getPrevCondition()
+ { return maPrevCondList; }
+ AnimationCondition & getEndSyncValue()
+ { mbHasEndSyncValue = true; return maEndSyncValue; }
+ protected:
+
+ static OUString getServiceName( sal_Int16 nNodeType );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >
+ createAndInsert(
+ const ::oox::core::XmlFilterBase& rFilter,
+ const OUString& rServiceName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rxNode );
+
+ private:
+ const sal_Int16 mnNodeType;
+
+ TimeNodePtrList maChildren;
+
+ OUString msId;
+ NodePropertyMap maNodeProperties;
+ UserDataMap maUserData; // a sequence to be stored as "UserData" property
+ SlideTransition maTransitionFilter;
+ AnimTargetElementPtr mpTarget;
+ bool mbHasEndSyncValue; // set to true if we try to get the endSync.
+ AnimationCondition maEndSyncValue;
+ AnimationConditionList maStCondList, maEndCondList;
+ AnimationConditionList maPrevCondList, maNextCondList;
+ };
+
+} }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/ppt/timenodelistcontext.hxx b/include/oox/ppt/timenodelistcontext.hxx
new file mode 100644
index 000000000000..baacbc94add4
--- /dev/null
+++ b/include/oox/ppt/timenodelistcontext.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 OOX_PPT_TIMENODELISTCONTEXT
+#define OOX_PPT_TIMENODELISTCONTEXT
+
+#include "oox/core/fragmenthandler2.hxx"
+#include "oox/ppt/timenode.hxx"
+
+#include <com/sun/star/animations/XTimeContainer.hpp>
+
+namespace oox { namespace ppt {
+
+
+ class TimeNodeContext : public ::oox::core::FragmentHandler2
+ {
+ public:
+ virtual ~TimeNodeContext() throw();
+
+ static TimeNodeContext * SAL_CALL makeContext( ::oox::core::FragmentHandler2& rParent, sal_Int32 aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode );
+
+ protected:
+ TimeNodeContext( ::oox::core::FragmentHandler2& rParent, sal_Int32 aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode ) throw();
+
+ sal_Int32 mnElement;
+ TimeNodePtr mpNode;
+ };
+
+
+
+/** FastParser context for XML_tnLst, XML_subTnLst and XML_childTnLst */
+class TimeNodeListContext : public ::oox::core::FragmentHandler2
+{
+public:
+ TimeNodeListContext( ::oox::core::FragmentHandler2& rParent, TimeNodePtrList & aList ) throw();
+
+ virtual ~TimeNodeListContext() throw();
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
+
+
+private:
+ TimeNodePtrList & maList;
+};
+
+} }
+
+#endif // OOX_PPT_SLIDEFRAGMENTHANDLER
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/token/namespacemap.hxx b/include/oox/token/namespacemap.hxx
new file mode 100644
index 000000000000..78eeaa93cc40
--- /dev/null
+++ b/include/oox/token/namespacemap.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 OOX_TOKEN_NAMESPACEMAP_HXX
+#define OOX_TOKEN_NAMESPACEMAP_HXX
+
+#include <map>
+#include <rtl/instance.hxx>
+#include <rtl/ustring.hxx>
+
+namespace oox {
+
+// ============================================================================
+
+/** A map that contains all XML namespace URLs used in the filters. */
+struct NamespaceMap : public ::std::map< sal_Int32, OUString > { NamespaceMap(); };
+
+/** Thread-save singleton of a map of all supported XML namespace URLs. */
+struct StaticNamespaceMap : public ::rtl::Static< NamespaceMap, StaticNamespaceMap > {};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/token/propertynames.hxx b/include/oox/token/propertynames.hxx
new file mode 100644
index 000000000000..931eaed0172b
--- /dev/null
+++ b/include/oox/token/propertynames.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 OOX_TOKEN_PROPERTYNAMES_HXX
+#define OOX_TOKEN_PROPERTYNAMES_HXX
+
+#include <vector>
+#include <rtl/instance.hxx>
+#include <rtl/ustring.hxx>
+
+namespace oox {
+
+// ============================================================================
+
+/** A vector that contains all predefined property names used in the filters. */
+struct PropertyNameVector : public ::std::vector< OUString > { PropertyNameVector(); };
+
+/** Thread-save singleton of a vector of all supported property names. */
+struct StaticPropertyNameVector : public ::rtl::Static< PropertyNameVector, StaticPropertyNameVector > {};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/token/tokenmap.hxx b/include/oox/token/tokenmap.hxx
new file mode 100644
index 000000000000..84dc70d03fac
--- /dev/null
+++ b/include/oox/token/tokenmap.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 OOX_TOKEN_TOKENMAP_HXX
+#define OOX_TOKEN_TOKENMAP_HXX
+
+#include <vector>
+#include <rtl/instance.hxx>
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+
+namespace oox {
+
+// ============================================================================
+
+class TokenMap
+{
+public:
+ explicit TokenMap();
+ ~TokenMap();
+
+ /** Returns the Unicode name of the passed token identifier. */
+ OUString getUnicodeTokenName( sal_Int32 nToken ) const;
+
+ /** Returns the token identifier for the passed Unicode token name. */
+ sal_Int32 getTokenFromUnicode( const OUString& rUnicodeName ) const;
+
+ /** Returns the UTF8 name of the passed token identifier as byte sequence. */
+ ::com::sun::star::uno::Sequence< sal_Int8 >
+ getUtf8TokenName( sal_Int32 nToken ) const;
+
+ /** Returns the token identifier for the passed UTF8 token name. */
+ sal_Int32 getTokenFromUtf8(
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& rUtf8Name ) const;
+
+private:
+ struct TokenName
+ {
+ OUString maUniName;
+ ::com::sun::star::uno::Sequence< sal_Int8 > maUtf8Name;
+ };
+ typedef ::std::vector< TokenName > TokenNameVector;
+
+ TokenNameVector maTokenNames;
+};
+
+// ============================================================================
+
+struct StaticTokenMap : public ::rtl::Static< TokenMap, StaticTokenMap > {};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/vml/vmldrawing.hxx b/include/oox/vml/vmldrawing.hxx
new file mode 100644
index 000000000000..ad7790962366
--- /dev/null
+++ b/include/oox/vml/vmldrawing.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 OOX_VML_VMLDRAWING_HXX
+#define OOX_VML_VMLDRAWING_HXX
+
+#include <map>
+#include <memory>
+#include <vector>
+#include <oox/ole/axcontrol.hxx>
+#include <oox/ole/oleobjecthelper.hxx>
+#include <oox/vml/vmlshapecontainer.hxx>
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace awt { struct Rectangle; }
+ namespace awt { class XControlModel; }
+ namespace drawing { class XDrawPage; }
+ namespace drawing { class XShape; }
+ namespace drawing { class XShapes; }
+} } }
+
+namespace oox {
+ namespace core { class XmlFilterBase; }
+ namespace ole { class EmbeddedControl; }
+}
+
+namespace oox {
+namespace vml {
+
+class ShapeBase;
+struct ClientData;
+
+// ============================================================================
+
+/** Enumerates different types of VML drawings. */
+enum DrawingType
+{
+ VMLDRAWING_WORD, ///< Word: One shape per drawing.
+ VMLDRAWING_EXCEL, ///< Excel: OLE objects are part of VML.
+ VMLDRAWING_POWERPOINT ///< PowerPoint: OLE objects are part of DrawingML.
+};
+
+// ============================================================================
+
+/** Contains information about an OLE object embedded in a draw page. */
+struct OOX_DLLPUBLIC OleObjectInfo : public ::oox::ole::OleObjectInfo
+{
+ OUString maShapeId; ///< Shape identifier for shape lookup.
+ OUString maName; ///< Programmatical name of the OLE object.
+ bool mbAutoLoad;
+ const bool mbDmlShape; ///< True = DrawingML shape (PowerPoint), false = VML shape (Excel/Word).
+
+ explicit OleObjectInfo( bool bDmlShape = false );
+
+ /** Sets the string representation of the passed numeric shape identifier. */
+ void setShapeId( sal_Int32 nShapeId );
+};
+
+// =========================================/===================================
+
+/** Contains information about a form control embedded in a draw page. */
+struct OOX_DLLPUBLIC ControlInfo
+{
+ OUString maShapeId; ///< Shape identifier for shape lookup.
+ OUString maFragmentPath; ///< Path to the fragment describing the form control properties.
+ OUString maName; ///< Programmatical name of the form control.
+
+ explicit ControlInfo();
+
+ /** Sets the string representation of the passed numeric shape identifier. */
+ void setShapeId( sal_Int32 nShapeId );
+};
+
+// ============================================================================
+
+/** Represents the collection of VML shapes for a complete draw page. */
+class OOX_DLLPUBLIC Drawing
+{
+public:
+ explicit Drawing(
+ ::oox::core::XmlFilterBase& rFilter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage,
+ DrawingType eType );
+
+ virtual ~Drawing();
+
+ /** Returns the filter object that imports/exports this VML drawing. */
+ inline ::oox::core::XmlFilterBase& getFilter() const { return mrFilter; }
+ /** Returns the application type containing the drawing. */
+ inline DrawingType getType() const { return meType; }
+ /** Returns read/write access to the container of shapes and templates. */
+ inline ShapeContainer& getShapes() { return *mxShapes; }
+ /** Returns read access to the container of shapes and templates. */
+ inline const ShapeContainer& getShapes() const { return *mxShapes; }
+ /** Returns the form object used to process ActiveX form controls. */
+ ::oox::ole::EmbeddedForm& getControlForm() const;
+
+ /** Registers a block of shape identifiers reserved by this drawing. Block
+ size is 1024, shape identifiers are one-based (block 1 => 1025-2048). */
+ void registerBlockId( sal_Int32 nBlockId );
+ /** Registers the passed embedded OLE object. The related shape will then
+ load the OLE object data from the specified fragment. */
+ void registerOleObject( const OleObjectInfo& rOleObject );
+ /** Registers the passed embedded form control. The related shape will then
+ load the control properties from the specified fragment. */
+ void registerControl( const ControlInfo& rControl );
+
+ /** Final processing after import of the fragment. */
+ void finalizeFragmentImport();
+
+ /** Creates and inserts all UNO shapes into the draw page. The virtual
+ function notifyXShapeInserted() will be called for each new shape. */
+ void convertAndInsert() const;
+
+ /** Returns the local shape index from the passed global shape identifier. */
+ sal_Int32 getLocalShapeIndex( const OUString& rShapeId ) const;
+ /** Returns the registered info structure for an OLE object, if extant. */
+ const OleObjectInfo* getOleObjectInfo( const OUString& rShapeId ) const;
+ /** Returns the registered info structure for a form control, if extant. */
+ const ControlInfo* getControlInfo( const OUString& rShapeId ) const;
+
+ /** Creates a new UNO shape object, inserts it into the passed UNO shape
+ container, and sets the shape position and size. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsertXShape(
+ const OUString& rService,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+
+ /** Creates a new UNO shape object for a form control, inserts the control
+ model into the form, and the shape into the passed UNO shape container. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsertXControlShape(
+ const ::oox::ole::EmbeddedControl& rControl,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect,
+ sal_Int32& rnCtrlIndex ) const;
+
+ /** Derived classes may disable conversion of specific shapes. */
+ virtual bool isShapeSupported( const ShapeBase& rShape ) const;
+
+ /** Derived classes may return additional base names for automatic shape
+ name creation. */
+ virtual OUString getShapeBaseName( const ShapeBase& rShape ) const;
+
+ /** Derived classes may calculate the shape rectangle from a non-standard
+ anchor information string. */
+ virtual bool convertClientAnchor(
+ ::com::sun::star::awt::Rectangle& orShapeRect,
+ const OUString& rShapeAnchor ) const;
+
+ /** Derived classes create a UNO shape according to the passed shape model.
+ Called for shape models that specify being under host control. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsertClientXShape(
+ const ShapeBase& rShape,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+
+ /** Derived classes may want to know that a UNO shape has been inserted.
+ Will be called from the convertAndInsert() implementation.
+ @param bGroupChild True = inserted into a group shape,
+ false = inserted directly into this drawing. */
+ virtual void notifyXShapeInserted(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
+ const ::com::sun::star::awt::Rectangle& rShapeRect,
+ const ShapeBase& rShape, bool bGroupChild );
+
+private:
+ typedef ::std::vector< sal_Int32 > BlockIdVector;
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ typedef ::std::auto_ptr< ::oox::ole::EmbeddedForm > EmbeddedFormPtr;
+ typedef ::std::auto_ptr< ShapeContainer > ShapeContainerPtr;
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+ typedef ::std::map< OUString, OleObjectInfo > OleObjectInfoMap;
+ typedef ::std::map< OUString, ControlInfo > ControlInfoMap;
+
+ ::oox::core::XmlFilterBase& mrFilter; ///< Filter object that imports/exports the VML drawing.
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
+ mxDrawPage; ///< UNO draw page used to insert the shapes.
+ mutable EmbeddedFormPtr mxCtrlForm; ///< The control form used to process embedded controls.
+ mutable BlockIdVector maBlockIds; ///< Block identifiers used by this drawing.
+ ShapeContainerPtr mxShapes; ///< All shapes and shape templates.
+ OleObjectInfoMap maOleObjects; ///< Info about all embedded OLE objects, mapped by shape id.
+ ControlInfoMap maControls; ///< Info about all embedded form controls, mapped by control name.
+ const DrawingType meType; ///< Application type containing the drawing.
+};
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/vml/vmldrawingfragment.hxx b/include/oox/vml/vmldrawingfragment.hxx
new file mode 100644
index 000000000000..f0947998a092
--- /dev/null
+++ b/include/oox/vml/vmldrawingfragment.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 OOX_VML_VMLDRAWINGFRAGMENT_HXX
+#define OOX_VML_VMLDRAWINGFRAGMENT_HXX
+
+#include "oox/core/fragmenthandler2.hxx"
+#include "oox/dllapi.h"
+
+namespace oox {
+namespace vml {
+
+class Drawing;
+
+// ============================================================================
+
+class OOX_DLLPUBLIC DrawingFragment : public ::oox::core::FragmentHandler2
+{
+public:
+ explicit DrawingFragment(
+ ::oox::core::XmlFilterBase& rFilter,
+ const OUString& rFragmentPath,
+ Drawing& rDrawing );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ openFragmentStream() const;
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+ virtual void finalizeImport();
+
+private:
+ Drawing& mrDrawing;
+};
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/vml/vmlformatting.hxx b/include/oox/vml/vmlformatting.hxx
new file mode 100644
index 000000000000..79fa38009e4d
--- /dev/null
+++ b/include/oox/vml/vmlformatting.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 OOX_VML_VMLFORMATTING_HXX
+#define OOX_VML_VMLFORMATTING_HXX
+
+#include "oox/helper/helper.hxx"
+#include "oox/dllapi.h"
+#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
+
+#include <vector>
+
+namespace oox {
+ class GraphicHelper;
+ namespace drawingml { class Color; }
+ namespace drawingml { class ShapePropertyMap; }
+}
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+typedef ::std::pair< sal_Int32, sal_Int32 > Int32Pair;
+typedef ::std::pair< double, double > DoublePair;
+
+// ============================================================================
+
+class OOX_DLLPUBLIC ConversionHelper
+{
+public:
+ /** Returns two values contained in rValue separated by cSep.
+ */
+ static bool separatePair(
+ OUString& orValue1, OUString& orValue2,
+ const OUString& rValue, sal_Unicode cSep );
+
+ /** Returns the boolean value from the passed string of a VML attribute.
+ Supported values: 'f', 't', 'false', 'true'. False for anything else.
+ */
+ static bool decodeBool( const OUString& rValue );
+
+ /** Converts the passed VML percentage measure string to a normalized
+ floating-point value.
+
+ @param rValue The VML percentage value. This is a floating-point value
+ with optional following '%' or 'f' sign. If the sign is missing, the
+ floating point value will be returned unmodified. If the '%' sign
+ is present, the value will be divided by 100. If the 'f' sign is present,
+ the value will be divided by 65536.
+ */
+ static double decodePercent(
+ const OUString& rValue,
+ double fDefValue );
+
+ /** Converts the passed VML measure string to EMU (English Metric Units).
+
+ @param rGraphicHelper The graphic helper needed to perform pixel
+ conversion according to the current output device.
+
+ @param rValue The VML measure value. This is a floating-point value
+ with optional measure string following the value.
+
+ @param nRefValue Reference value needed for percentage measure.
+
+ @param bPixelX Set to true if the value is oriented horizontally (e.g.
+ X coordinates, widths). Set to false if the value is oriented
+ vertically (e.g. Y coordinates, heights). This is needed because
+ output devices may specify different width and height for a pixel.
+
+ @param bDefaultAsPixel Set to true if omitted measure unit means
+ pixel. Set to false if omitted measure unit means EMU.
+ */
+ static sal_Int64 decodeMeasureToEmu(
+ const GraphicHelper& rGraphicHelper,
+ const OUString& rValue,
+ sal_Int32 nRefValue,
+ bool bPixelX,
+ bool bDefaultAsPixel );
+
+ /** Converts the passed VML measure string to 1/100 mm.
+
+ @param rGraphicHelper See above.
+ @param rValue See above.
+ @param nRefValue See above.
+ @param bPixelX See above.
+ @param bDefaultAsPixel See above.
+ */
+ static sal_Int32 decodeMeasureToHmm(
+ const GraphicHelper& rGraphicHelper,
+ const OUString& rValue,
+ sal_Int32 nRefValue,
+ bool bPixelX,
+ bool bDefaultAsPixel );
+
+ /** Converts VML color attributes to a DrawingML color.
+
+ @param roVmlColor The VML string representation of the color. If
+ existing, this can be a 3-digit or 6-digit hexadecimal RGB value
+ with leading '#' character, a predefined color name (e.g. 'black',
+ 'red', etc.), the index into an application defined color palette
+ in brackets with leading color name (e.g. 'red [9]' or
+ 'windowColor [64]'), or a color modifier used in one-color
+ gradients (e.g. 'fill darken(128)' or 'fill lighten(0)').
+
+ @param roVmlOpacity The opacity of the color. If existing, this should
+ be a floating-point value in the range [0.0;1.0].
+
+ @param nDefaultRgb Deafult RGB color used if the parameter roVmlColor
+ is empty.
+
+ @param nPrimaryRgb If set to something else than API_RGB_TRANSPARENT,
+ specifies the color to be used to resolve the color modifiers used
+ in one-color gradients.
+
+ @return The resulting DrawingML color.
+ */
+ static ::oox::drawingml::Color decodeColor(
+ const GraphicHelper& rGraphicHelper,
+ const OptValue< OUString >& roVmlColor,
+ const OptValue< double >& roVmlOpacity,
+ sal_Int32 nDefaultRgb,
+ sal_Int32 nPrimaryRgb = API_RGB_TRANSPARENT );
+
+ /** Converts VML path string into point and flag vectors.
+
+ @param rPoints The point vector to fill with coordinates.
+
+ @param rFlags The flag vector to fill. PolygonFlags_NORMAL indicates
+ a corresponding plain shape coordinate in rPoints and
+ PolygonFlags_CONTROL indicates a bezier curve control point.
+
+ @param rPath The VML path string.
+
+ @param rGraphicHelper See above.
+ */
+ static void decodeVmlPath(
+ ::std::vector< ::std::vector< ::com::sun::star::awt::Point > >& rPoints,
+ ::std::vector< ::std::vector< ::com::sun::star::drawing::PolygonFlags > >& rFlags,
+ const OUString& rPath );
+
+private:
+ ConversionHelper();
+ ~ConversionHelper();
+};
+
+// ============================================================================
+
+/** The stroke arrow model structure contains all properties for an line end arrow. */
+struct StrokeArrowModel
+{
+ OptValue< sal_Int32 > moArrowType;
+ OptValue< sal_Int32 > moArrowWidth;
+ OptValue< sal_Int32 > moArrowLength;
+
+ void assignUsed( const StrokeArrowModel& rSource );
+};
+
+// ============================================================================
+
+/** The stroke model structure contains all shape border properties. */
+struct StrokeModel
+{
+ OptValue< bool > moStroked; ///< Shape border line on/off.
+ StrokeArrowModel maStartArrow; ///< Start line arrow style.
+ StrokeArrowModel maEndArrow; ///< End line arrow style.
+ OptValue< OUString > moColor; ///< Solid line color.
+ OptValue< double > moOpacity; ///< Solid line color opacity.
+ OptValue< OUString > moWeight; ///< Line width.
+ OptValue< OUString > moDashStyle; ///< Line dash (predefined or manually).
+ OptValue< sal_Int32 > moLineStyle; ///< Line style (single, double, ...).
+ OptValue< sal_Int32 > moEndCap; ///< Type of line end cap.
+ OptValue< sal_Int32 > moJoinStyle; ///< Type of line join.
+
+ void assignUsed( const StrokeModel& rSource );
+
+ /** Writes the properties to the passed property map. */
+ void pushToPropMap(
+ ::oox::drawingml::ShapePropertyMap& rPropMap,
+ const GraphicHelper& rGraphicHelper ) const;
+};
+
+// ============================================================================
+
+/** The fill model structure contains all shape fill properties. */
+struct OOX_DLLPUBLIC FillModel
+{
+ OptValue< bool > moFilled; ///< Shape fill on/off.
+ OptValue< OUString > moColor; ///< Solid fill color.
+ OptValue< double > moOpacity; ///< Solid fill color opacity.
+ OptValue< OUString > moColor2; ///< End color of gradient.
+ OptValue< double > moOpacity2; ///< End color opacity of gradient.
+ OptValue< sal_Int32 > moType; ///< Fill type.
+ OptValue< sal_Int32 > moAngle; ///< Gradient rotation angle.
+ OptValue< double > moFocus; ///< Linear gradient focus of second color.
+ OptValue< DoublePair > moFocusPos; ///< Rectangular gradient focus position of second color.
+ OptValue< DoublePair > moFocusSize; ///< Rectangular gradient focus size of second color.
+ OptValue< OUString > moBitmapPath; ///< Path to fill bitmap fragment.
+ OptValue< bool > moRotate; ///< True = rotate gradient/bitmap with shape.
+
+ void assignUsed( const FillModel& rSource );
+
+ /** Writes the properties to the passed property map. */
+ void pushToPropMap(
+ ::oox::drawingml::ShapePropertyMap& rPropMap,
+ const GraphicHelper& rGraphicHelper ) const;
+};
+
+// ============================================================================
+
+/** The shadow model structure contains all shape shadow properties. */
+struct OOX_DLLPUBLIC ShadowModel
+{
+ bool mbHasShadow; ///< Is a v:shadow element seen?
+ OptValue<bool> moShadowOn; ///< Is the element turned on?
+ OptValue<OUString> moColor; ///< Specifies the color of the shadow.
+ OptValue<OUString> moOffset; ///< Specifies the shadow's offset from the shape's location.
+ OptValue<double> moOpacity; ///< Specifies the opacity of the shadow.
+
+ ShadowModel();
+
+ /** Writes the properties to the passed property map. */
+ void pushToPropMap(oox::drawingml::ShapePropertyMap& rPropMap, const GraphicHelper& rGraphicHelper) const;
+};
+
+} // namespace vml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/vml/vmlinputstream.hxx b/include/oox/vml/vmlinputstream.hxx
new file mode 100644
index 000000000000..7c8e13160722
--- /dev/null
+++ b/include/oox/vml/vmlinputstream.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 OOX_VML_VMLINPUTSTREAM_HXX
+#define OOX_VML_VMLINPUTSTREAM_HXX
+
+#include <com/sun/star/io/XInputStream.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <rtl/string.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace io { class XTextInputStream2; }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+typedef ::cppu::WeakImplHelper1< ::com::sun::star::io::XInputStream > InputStream_BASE;
+
+/** An input stream class for VML streams, implementing the UNO interface
+ com.sun.star.io.XInputStream needed by the Expat XML parsers.
+
+ This stream reads the data from the input stream passed to the constructor,
+ and parses all XML elements for features unsupported by the current Expat
+ XML parser:
+
+ 1) All elements that have the form '<![inst]>' where 'inst' is any string
+ not containing the characters '<' and '>' are stripped from the input
+ stream.
+
+ 2) Multiple occurences of the same attribute in an element but the last
+ are removed.
+
+ 3) Line breaks represented by a single <br> element (without matching
+ </br> element) are replaced by a literal LF character.
+ */
+class InputStream : public InputStream_BASE
+{
+public:
+ explicit InputStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm );
+ virtual ~InputStream();
+
+ virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& rData, sal_Int32 nBytesToRead )
+ throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& rData, sal_Int32 nMaxBytesToRead )
+ throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip )
+ throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL available()
+ throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL closeInput()
+ throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ void updateBuffer() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ OString readToElementBegin() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ OString readToElementEnd() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream2 >
+ mxTextStrm;
+ ::com::sun::star::uno::Sequence< sal_Unicode > maOpeningBracket;
+ ::com::sun::star::uno::Sequence< sal_Unicode > maClosingBracket;
+ const OString maOpeningCData;
+ const OString maClosingCData;
+ OString maBuffer;
+ sal_Int32 mnBufferPos;
+};
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx
new file mode 100644
index 000000000000..7b6a4a9376c7
--- /dev/null
+++ b/include/oox/vml/vmlshape.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 OOX_VML_VMLSHAPE_HXX
+#define OOX_VML_VMLSHAPE_HXX
+
+#include <memory>
+#include <vector>
+#include <com/sun/star/awt/Point.hpp>
+#include "oox/vml/vmlformatting.hxx"
+#include "oox/vml/vmltextbox.hxx"
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace awt { struct Rectangle; }
+ namespace drawing { class XShape; }
+ namespace drawing { class XShapes; }
+} } }
+
+namespace oox {
+namespace vml {
+
+class Drawing;
+struct ShapeParentAnchor;
+class ShapeContainer;
+
+// ============================================================================
+
+const sal_Int32 VML_CLIENTDATA_UNCHECKED = 0;
+const sal_Int32 VML_CLIENTDATA_CHECKED = 1;
+const sal_Int32 VML_CLIENTDATA_MIXED = 2;
+
+const sal_Int32 VML_CLIENTDATA_TEXT = 0;
+const sal_Int32 VML_CLIENTDATA_INTEGER = 1;
+const sal_Int32 VML_CLIENTDATA_NUMBER = 2;
+const sal_Int32 VML_CLIENTDATA_REFERENCE = 3;
+const sal_Int32 VML_CLIENTDATA_FORMULA = 4;
+
+// ============================================================================
+
+/** The shape model structure contains all properties shared by all types of shapes. */
+struct OOX_DLLPUBLIC ShapeTypeModel
+{
+ OUString maShapeId; ///< Unique identifier of the shape.
+ OUString maShapeName; ///< Name of the shape, if present.
+ OptValue< sal_Int32 > moShapeType; ///< Builtin shape type identifier.
+
+ OptValue< Int32Pair > moCoordPos; ///< Top-left position of coordinate system for children scaling.
+ OptValue< Int32Pair > moCoordSize; ///< Size of coordinate system for children scaling.
+ OUString maPosition; ///< Position type of the shape.
+ OUString maLeft; ///< X position of the shape bounding box (number with unit).
+ OUString maTop; ///< Y position of the shape bounding box (number with unit).
+ OUString maWidth; ///< Width of the shape bounding box (number with unit).
+ OUString maHeight; ///< Height of the shape bounding box (number with unit).
+ OUString maMarginLeft; ///< X position of the shape bounding box to shape anchor (number with unit).
+ OUString maMarginTop; ///< Y position of the shape bounding box to shape anchor (number with unit).
+ OUString maPositionHorizontalRelative; ///< The X position is relative to this.
+ OUString maPositionVerticalRelative; ///< The Y position is relative to this.
+ OUString maPositionHorizontal; ///< The X position orientation (default: absolute).
+ OUString maPositionVertical; ///< The Y position orientation.
+ OUString maWidthPercent; ///< The width in percents of the WidthRelative
+ OUString maHeightPercent; ///< The height in percents of the HeightRelative
+ OUString maWidthRelative; ///< To what the width is relative
+ OUString maHeightRelative; ///< To what the height is relative
+ OUString maRotation; ///< Rotation of the shape, in degrees.
+ OUString maFlip; ///< Flip type of the shape (can be "x" or "y").
+ sal_Bool mbAutoHeight; ///< If true, the height value is a minimum value (mostly used for textboxes)
+ sal_Bool mbVisible; ///< Visible or Hidden
+ OUString maWrapStyle; ///< Wrapping mode for text.
+ OUString maArcsize; ///< round rectangles arc size
+
+ StrokeModel maStrokeModel; ///< Border line formatting.
+ FillModel maFillModel; ///< Shape fill formatting.
+ ShadowModel maShadowModel; ///< Shape shadow formatting.
+
+ OptValue< OUString > moGraphicPath; ///< Path to a graphic for this shape.
+ OptValue< OUString > moGraphicTitle; ///< Title of the graphic.
+ OptValue< OUString > moWrapAnchorX; ///< The base object from which our horizontal positioning should be calculated.
+ OptValue< OUString > moWrapAnchorY; ///< The base object from which our vertical positioning should be calculated.
+
+ explicit ShapeTypeModel();
+
+ void assignUsed( const ShapeTypeModel& rSource );
+};
+
+// ----------------------------------------------------------------------------
+
+/** A shape template contains all formatting properties of shapes and can serve
+ as templates for several shapes in a drawing. */
+class ShapeType
+{
+public:
+ explicit ShapeType( Drawing& rDrawing );
+ virtual ~ShapeType();
+
+ /** Returns read/write access to the shape template model structure. */
+ inline ShapeTypeModel& getTypeModel() { return maTypeModel; }
+ /** Returns read access to the shape template model structure. */
+ inline const ShapeTypeModel& getTypeModel() const { return maTypeModel; }
+
+ /** Returns the shape identifier (which is unique through the containing drawing). */
+ inline const OUString& getShapeId() const { return maTypeModel.maShapeId; }
+ /** Returns the application defined shape type. */
+ sal_Int32 getShapeType() const;
+ /** Returns the fragment path to the embedded graphic used by this shape. */
+ OUString getGraphicPath() const;
+
+ const Drawing& getDrawing() const { return mrDrawing; }
+
+protected:
+ /** Returns the coordinate system of this shape. */
+ ::com::sun::star::awt::Rectangle getCoordSystem() const;
+ /** Returns the absolute shape rectangle according to the passed anchor. */
+ ::com::sun::star::awt::Rectangle getRectangle( const ShapeParentAnchor* pParentAnchor ) const;
+ /** Returns the absolute shape rectangle. */
+ virtual ::com::sun::star::awt::Rectangle getAbsRectangle() const;
+ /** Returns the rectangle relative to the parent coordinate system. */
+ virtual ::com::sun::star::awt::Rectangle getRelRectangle() const;
+
+protected:
+ Drawing& mrDrawing; ///< The VML drawing page that contains this shape.
+ ShapeTypeModel maTypeModel; ///< The model structure containing shape type data.
+};
+
+// ============================================================================
+
+/** Excel specific shape client data (such as cell anchor). */
+struct ClientData
+{
+ OUString maAnchor; ///< Cell anchor as comma-separated string.
+ OUString maFmlaMacro; ///< Link to macro associated to the control.
+ OUString maFmlaPict; ///< Target cell range of picture links.
+ OUString maFmlaLink; ///< Link to value cell associated to the control.
+ OUString maFmlaRange; ///< Link to cell range used as data source for the control.
+ OUString maFmlaGroup; ///< Link to value cell associated to a group of option buttons.
+ sal_Int32 mnObjType; ///< Type of the shape.
+ sal_Int32 mnTextHAlign; ///< Horizontal text alignment.
+ sal_Int32 mnTextVAlign; ///< Vertical text alignment.
+ sal_Int32 mnCol; ///< Column index for spreadsheet cell note.
+ sal_Int32 mnRow; ///< Row index for spreadsheet cell note.
+ sal_Int32 mnChecked; ///< State for checkboxes and option buttons.
+ sal_Int32 mnDropStyle; ///< Drop down box style (read-only or editable).
+ sal_Int32 mnDropLines; ///< Number of lines in drop down box.
+ sal_Int32 mnVal; ///< Current value of spin buttons and scroll bars.
+ sal_Int32 mnMin; ///< Minimum value of spin buttons and scroll bars.
+ sal_Int32 mnMax; ///< Maximum value of spin buttons and scroll bars.
+ sal_Int32 mnInc; ///< Small increment of spin buttons and scroll bars.
+ sal_Int32 mnPage; ///< Large increment of spin buttons and scroll bars.
+ sal_Int32 mnSelType; ///< Listbox selection type.
+ sal_Int32 mnVTEdit; ///< Data type of the textbox.
+ bool mbPrintObject; ///< True = print the object.
+ bool mbVisible; ///< True = cell note is visible.
+ bool mbDde; ///< True = object is linked through DDE.
+ bool mbNo3D; ///< True = flat style, false = 3D style.
+ bool mbNo3D2; ///< True = flat style, false = 3D style (listboxes and dropdowns).
+ bool mbMultiLine; ///< True = textbox allows line breaks.
+ bool mbVScroll; ///< True = textbox has a vertical scrollbar.
+ bool mbSecretEdit; ///< True = textbox is a password edit field.
+
+ explicit ClientData();
+};
+
+// ----------------------------------------------------------------------------
+
+struct ShapeModel
+{
+ typedef ::std::vector< ::com::sun::star::awt::Point > PointVector;
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ typedef ::std::auto_ptr< TextBox > TextBoxPtr;
+ typedef ::std::auto_ptr< ClientData > ClientDataPtr;
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+
+ OUString maType; ///< Shape template with default properties.
+ PointVector maPoints; ///< Points for the polyline shape.
+ TextBoxPtr mxTextBox; ///< Text contents and properties.
+ ClientDataPtr mxClientData; ///< Excel specific client data.
+ OUString maLegacyDiagramPath;///< Legacy Diagram Fragment Path
+ OUString maFrom; ///< Start point for line shape.
+ OUString maTo; ///< End point for line shape.
+ OUString maControl1; ///< Bezier control point 1
+ OUString maControl2; ///< Bezier control point 2
+ OUString maVmlPath; ///< VML path for this shape
+
+ explicit ShapeModel();
+ ~ShapeModel();
+
+ /** Creates and returns a new shape textbox structure. */
+ TextBox& createTextBox(ShapeTypeModel& rModel);
+ /** Creates and returns a new shape client data structure. */
+ ClientData& createClientData();
+};
+
+// ----------------------------------------------------------------------------
+
+/** A shape object that is part of a drawing. May inherit properties from a
+ shape template. */
+class OOX_DLLPUBLIC ShapeBase : public ShapeType
+{
+public:
+ /** Returns read/write access to the shape model structure. */
+ inline ShapeModel& getShapeModel() { return maShapeModel; }
+ /** Returns read access to the shape model structure. */
+ inline const ShapeModel& getShapeModel() const { return maShapeModel; }
+
+ /** Returns read access to the shape textbox. */
+ inline const TextBox* getTextBox() const { return maShapeModel.mxTextBox.get(); }
+ /** Returns read access to the shape client data structure. */
+ inline const ClientData* getClientData() const { return maShapeModel.mxClientData.get(); }
+
+ /** Final processing after import of the drawing fragment. */
+ virtual void finalizeFragmentImport();
+
+ /** Returns the real shape name if existing, or a generated shape name. */
+ OUString getShapeName() const;
+
+ /** Returns the shape template with the passed identifier from the child shapes. */
+ virtual const ShapeType* getChildTypeById( const OUString& rShapeId ) const;
+ /** Returns the shape with the passed identifier from the child shapes. */
+ virtual const ShapeBase* getChildById( const OUString& rShapeId ) const;
+
+ /** Creates the corresponding XShape and inserts it into the passed container. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ convertAndInsert(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ShapeParentAnchor* pParentAnchor = 0 ) const;
+
+ /** Converts position and formatting into the passed existing XShape. */
+ void convertFormatting(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
+ const ShapeParentAnchor* pParentAnchor = 0 ) const;
+
+protected:
+ explicit ShapeBase( Drawing& rDrawing );
+
+ /** Derived classes create the corresponding XShape and insert it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const = 0;
+
+ /** Calculates the final shape rectangle according to the passed anchor,
+ if present, otherwise according to the own anchor settings. */
+ ::com::sun::star::awt::Rectangle calcShapeRectangle(
+ const ShapeParentAnchor* pParentAnchor ) const;
+
+ /** Converts common shape properties such as formatting attributes. */
+ void convertShapeProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape ) const;
+
+protected:
+ ShapeModel maShapeModel; ///< The model structure containing shape data.
+};
+
+// ============================================================================
+
+/** A simple shape object based on a specific UNO shape service. */
+class SimpleShape : public ShapeBase
+{
+public:
+ explicit SimpleShape( Drawing& rDrawing, const OUString& rService );
+
+ void setService( OUString aService ) { maService = aService; }
+
+protected:
+ /** Creates the corresponding XShape and inserts it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+ /** Used by both RectangleShape and ComplexShape. */
+ com::sun::star::uno::Reference<com::sun::star::drawing::XShape>createPictureObject(
+ const com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rxShapes,
+ const com::sun::star::awt::Rectangle& rShapeRect, OUString& rGraphicPath ) const;
+
+private:
+ OUString maService; ///< Name of the UNO shape service.
+};
+
+// ============================================================================
+
+/** A rectangular shape object. */
+class RectangleShape : public SimpleShape
+{
+public:
+ explicit RectangleShape( Drawing& rDrawing );
+protected:
+ /** Creates the corresponding XShape and inserts it into the passed container. */
+ virtual com::sun::star::uno::Reference<com::sun::star::drawing::XShape>
+ implConvertAndInsert(
+ const com::sun::star::uno::Reference<com::sun::star::drawing::XShapes>& rxShapes,
+ const com::sun::star::awt::Rectangle& rShapeRect) const;
+};
+
+// ============================================================================
+
+/** An oval shape object. */
+class EllipseShape : public SimpleShape
+{
+public:
+ explicit EllipseShape( Drawing& rDrawing );
+};
+
+// ============================================================================
+
+/** A polygon shape object. */
+class PolyLineShape : public SimpleShape
+{
+public:
+ explicit PolyLineShape( Drawing& rDrawing );
+
+protected:
+ /** Creates the corresponding XShape and inserts it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+};
+
+/** A Line shape object. */
+class LineShape : public SimpleShape
+{
+public:
+ explicit LineShape( Drawing& rDrawing );
+
+protected:
+ /** Returns the absolute shape rectangle. */
+ virtual ::com::sun::star::awt::Rectangle getAbsRectangle() const SAL_OVERRIDE;
+ /** Returns the rectangle relative to the parent coordinate system. */
+ virtual ::com::sun::star::awt::Rectangle getRelRectangle() const SAL_OVERRIDE;
+};
+
+/** Bezier shape object that supports to, from, control1 and control2
+ attribute or path attribute specification */
+class BezierShape : public SimpleShape
+{
+public:
+ explicit BezierShape( Drawing& rDrawing );
+
+protected:
+ /** Creates the corresponding XShape and inserts it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+};
+
+// ============================================================================
+
+/** A shape object with custom geometry. */
+class CustomShape : public SimpleShape
+{
+public:
+ explicit CustomShape( Drawing& rDrawing );
+
+protected:
+ /** Creates the corresponding XShape and inserts it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+};
+
+// ============================================================================
+
+/** A complex shape object. This can be a picture shape, a custom shape, an OLE
+ object, or an ActiveX form control. */
+class ComplexShape : public CustomShape
+{
+public:
+ explicit ComplexShape( Drawing& rDrawing );
+
+protected:
+ /** Creates the corresponding XShape and inserts it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+};
+
+// ============================================================================
+
+/** A group shape that extends the basic shape by a container of child shapes. */
+class GroupShape : public ShapeBase
+{
+public:
+ explicit GroupShape( Drawing& rDrawing );
+ virtual ~GroupShape();
+
+ /** Returns read/write access to the container of child shapes and templates. */
+ inline ShapeContainer& getChildren() { return *mxChildren; }
+ /** Returns read access to the container of child shapes and templates. */
+ inline const ShapeContainer& getChildren() const { return *mxChildren; }
+
+ /** Final processing after import of the drawing fragment. */
+ virtual void finalizeFragmentImport();
+
+ /** Returns the shape template with the passed identifier from the child shapes. */
+ virtual const ShapeType* getChildTypeById( const OUString& rShapeId ) const;
+ /** Returns the shape with the passed identifier from the child shapes. */
+ virtual const ShapeBase* getChildById( const OUString& rShapeId ) const;
+
+protected:
+ /** Creates the corresponding XShape and inserts it into the passed container. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ implConvertAndInsert(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+
+private:
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ typedef ::std::auto_ptr< ShapeContainer > ShapeContainerPtr;
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+ ShapeContainerPtr mxChildren; ///< Shapes and templates that are part of this group.
+};
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/vml/vmlshapecontainer.hxx b/include/oox/vml/vmlshapecontainer.hxx
new file mode 100644
index 000000000000..5e6a2c2a9d75
--- /dev/null
+++ b/include/oox/vml/vmlshapecontainer.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 OOX_VML_VMLSHAPECONTAINER_HXX
+#define OOX_VML_VMLSHAPECONTAINER_HXX
+
+#include <com/sun/star/awt/Rectangle.hpp>
+#include "oox/helper/refmap.hxx"
+#include "oox/helper/refvector.hxx"
+#include <stack>
+
+namespace com { namespace sun { namespace star {
+ namespace drawing { class XShapes; }
+} } }
+
+namespace oox {
+namespace vml {
+
+class Drawing;
+class ShapeType;
+class ShapeBase;
+
+// ============================================================================
+
+struct ShapeParentAnchor
+{
+ ::com::sun::star::awt::Rectangle maShapeRect;
+ ::com::sun::star::awt::Rectangle maCoordSys;
+};
+
+// ============================================================================
+
+/** Container that holds a list of shapes and shape templates. */
+class ShapeContainer
+{
+public:
+ explicit ShapeContainer( Drawing& rDrawing );
+ ~ShapeContainer();
+
+ /** Returns the drawing this shape container is part of. */
+ inline Drawing& getDrawing() { return mrDrawing; }
+
+ /** Creates and returns a new shape template object. */
+ ShapeType& createShapeType();
+ /** Creates and returns a new shape object of the specified type. */
+ template< typename ShapeT >
+ ShapeT& createShape();
+
+ /** Final processing after import of the drawing fragment. */
+ void finalizeFragmentImport();
+
+ /** Returns true, if this container does not contain any shapes. */
+ inline bool empty() const { return maShapes.empty(); }
+
+ /** Returns the shape template with the passed identifier.
+ @param bDeep True = searches in all group shapes too. */
+ const ShapeType* getShapeTypeById( const OUString& rShapeId, bool bDeep ) const;
+ /** Returns the shape with the passed identifier.
+ @param bDeep True = searches in all group shapes too. */
+ const ShapeBase* getShapeById( const OUString& rShapeId, bool bDeep ) const;
+
+ /** Searches for a shape type by using the passed functor that takes a
+ constant reference of a ShapeType object. */
+ template< typename Functor >
+ const ShapeType* findShapeType( const Functor& rFunctor ) const;
+ /** Searches for a shape by using the passed functor that takes a constant
+ reference of a ShapeBase object. */
+ template< typename Functor >
+ const ShapeBase* findShape( const Functor& rFunctor ) const;
+
+ /**
+ (Word only) Returns the last shape in the collection, if it is after the last
+ mark from pushMark(), and removes it.
+ */
+ boost::shared_ptr< ShapeBase > takeLastShape();
+ /**
+ Adds a recursion mark to the stack. It is possible that a shape contains <w:txbxContent>
+ which contains another shape, and writerfilter needs to know which shape is from the inner
+ ooxml context and which from the outer ooxml context, while it is necessary to keep
+ at least shape types across such blocks. Therefore this function marks beginning
+ of each shape xml block, and takeLastShape() returns only shapes from this block.
+ */
+ void pushMark();
+ /**
+ Removes a recursion mark.
+ */
+ void popMark();
+
+ /** Creates and inserts all UNO shapes into the passed container. */
+ void convertAndInsert(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ShapeParentAnchor* pParentAnchor = 0 ) const;
+
+private:
+ typedef RefVector< ShapeType > ShapeTypeVector;
+ typedef RefVector< ShapeBase > ShapeVector;
+ typedef RefMap< OUString, ShapeType > ShapeTypeMap;
+ typedef RefMap< OUString, ShapeBase > ShapeMap;
+
+ Drawing& mrDrawing; ///< The VML drawing page that contains this shape.
+ ShapeTypeVector maTypes; ///< All shape templates.
+ ShapeVector maShapes; ///< All shape definitions.
+ ShapeTypeMap maTypesById; ///< All shape templates mapped by identifier.
+ ShapeMap maShapesById; ///< All shape definitions mapped by identifier.
+ std::stack< size_t > markStack; ///< Recursion marks from pushMark()/popMark().
+};
+
+// ----------------------------------------------------------------------------
+
+template< typename ShapeT >
+ShapeT& ShapeContainer::createShape()
+{
+ ::boost::shared_ptr< ShapeT > xShape( new ShapeT( mrDrawing ) );
+ maShapes.push_back( xShape );
+ return *xShape;
+}
+
+template< typename Functor >
+const ShapeType* ShapeContainer::findShapeType( const Functor& rFunctor ) const
+{
+ return maTypes.findIf( rFunctor ).get();
+}
+
+template< typename Functor >
+const ShapeBase* ShapeContainer::findShape( const Functor& rFunctor ) const
+{
+ return maShapes.findIf( rFunctor ).get();
+}
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/vml/vmlshapecontext.hxx b/include/oox/vml/vmlshapecontext.hxx
new file mode 100644
index 000000000000..803674088e37
--- /dev/null
+++ b/include/oox/vml/vmlshapecontext.hxx
@@ -0,0 +1,188 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOX_VML_VMLSHAPECONTEXT_HXX
+#define OOX_VML_VMLSHAPECONTEXT_HXX
+
+#include "oox/core/contexthandler2.hxx"
+
+namespace oox {
+namespace vml {
+
+class Drawing;
+
+struct ShapeTypeModel;
+class ShapeType;
+
+struct ClientData;
+struct ShapeModel;
+class ShapeBase;
+class GroupShape;
+class RectangleShape;
+
+class ShapeContainer;
+
+// ============================================================================
+
+class ShapeLayoutContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit ShapeLayoutContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ Drawing& rDrawing );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+private:
+ Drawing& mrDrawing;
+};
+
+// ============================================================================
+
+class ClientDataContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit ClientDataContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ ClientData& rClientData,
+ const AttributeList& rAttribs );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onCharacters( const OUString& rChars );
+ virtual void onEndElement();
+
+private:
+ ClientData& mrClientData;
+ OUString maElementText;
+};
+
+// ============================================================================
+
+class ShapeContextBase : public ::oox::core::ContextHandler2
+{
+public:
+ static ::oox::core::ContextHandlerRef
+ createShapeContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ ShapeContainer& rShapes,
+ sal_Int32 nElement,
+ const AttributeList& rAttribs );
+
+protected:
+ explicit ShapeContextBase( ::oox::core::ContextHandler2Helper& rParent );
+};
+
+// ============================================================================
+
+class ShapeTypeContext : public ShapeContextBase
+{
+public:
+ explicit ShapeTypeContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ ShapeType& rShapeType,
+ const AttributeList& rAttribs );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+private:
+ /** Processes the 'style' attribute. */
+ void setStyle( const OUString& rStyle );
+
+ /** Resolve a relation identifier to a fragment path. */
+ OptValue< OUString > decodeFragmentPath( const AttributeList& rAttribs, sal_Int32 nToken ) const;
+
+private:
+ ShapeTypeModel& mrTypeModel;
+};
+
+// ============================================================================
+
+class ShapeContext : public ShapeTypeContext
+{
+public:
+ explicit ShapeContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ ShapeBase& rShape,
+ const AttributeList& rAttribs );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+private:
+ /** Processes the 'points' attribute. */
+ void setPoints( const OUString& rPoints );
+ /** Processes the 'from' attribute. */
+ void setFrom( const OUString& rPoints );
+ /** Processes the 'to' attribute. */
+ void setTo( const OUString& rPoints );
+ /** Processes the 'control1' attribute. */
+ void setControl1( const OUString& rPoints );
+ /** Processes the 'control2' attribute. */
+ void setControl2( const OUString& rPoints );
+ /** Processes the 'path' attribute. */
+ void setVmlPath( const OUString& rPath );
+
+protected:
+ ShapeBase& mrShape;
+
+private:
+ ShapeModel& mrShapeModel;
+};
+
+// ============================================================================
+
+class GroupShapeContext : public ShapeContext
+{
+public:
+ explicit GroupShapeContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ GroupShape& rShape,
+ const AttributeList& rAttribs );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+private:
+ ShapeContainer& mrShapes;
+};
+
+// ============================================================================
+
+class RectangleShapeContext : public ShapeContext
+{
+public:
+ explicit RectangleShapeContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ const AttributeList& rAttribs,
+ RectangleShape& rShape );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+};
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/vml/vmltextbox.hxx b/include/oox/vml/vmltextbox.hxx
new file mode 100644
index 000000000000..4975e6bb26b6
--- /dev/null
+++ b/include/oox/vml/vmltextbox.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 OOX_VML_VMLTEXTBOX_HXX
+#define OOX_VML_VMLTEXTBOX_HXX
+
+#include <vector>
+#include <rtl/ustring.hxx>
+#include "oox/helper/helper.hxx"
+#include "oox/dllapi.h"
+#include <com/sun/star/uno/Reference.h>
+
+namespace com { namespace sun { namespace star {
+ namespace drawing { class XShape; }
+} } }
+
+namespace oox {
+namespace vml {
+
+struct ShapeTypeModel;
+
+// ============================================================================
+
+/** Font settings for a text portion in a textbox. */
+struct OOX_DLLPUBLIC TextFontModel
+{
+ OptValue< OUString > moName; ///< Font name.
+ OptValue< OUString > moColor; ///< Font color, HTML encoded, sort of.
+ OptValue< sal_Int32 > monSize; ///< Font size in twips.
+ OptValue< sal_Int32 > monUnderline; ///< Single or double underline.
+ OptValue< sal_Int32 > monEscapement; ///< Subscript or superscript.
+ OptValue< bool > mobBold;
+ OptValue< bool > mobItalic;
+ OptValue< bool > mobStrikeout;
+
+ explicit TextFontModel();
+};
+
+// ============================================================================
+
+/** A text portion in a textbox with the same formatting for all characters. */
+struct TextPortionModel
+{
+ TextFontModel maFont;
+ OUString maText;
+
+ explicit TextPortionModel( const TextFontModel& rFont, const OUString& rText );
+};
+
+// ============================================================================
+
+/** The textbox contains all text contents and properties. */
+class OOX_DLLPUBLIC TextBox
+{
+public:
+ explicit TextBox(ShapeTypeModel& rTypeModel);
+
+ /** Appends a new text portion to the textbox. */
+ void appendPortion( const TextFontModel& rFont, const OUString& rText );
+
+ /** Returns the current number of text portions. */
+ inline size_t getPortionCount() const { return maPortions.size(); }
+ /** Returns the font settings of the first text portion. */
+ const TextFontModel* getFirstFont() const;
+ /** Returns the entire text of all text portions. */
+ OUString getText() const;
+ void convert(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> xShape) const;
+
+ ShapeTypeModel& mrTypeModel;
+ /// Text distance from the border (inset attribute of v:textbox), valid only if set.
+ bool borderDistanceSet;
+ int borderDistanceLeft, borderDistanceTop, borderDistanceRight, borderDistanceBottom;
+ OUString maLayoutFlow;
+
+private:
+ typedef ::std::vector< TextPortionModel > PortionVector;
+
+ PortionVector maPortions;
+};
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/vml/vmltextboxcontext.hxx b/include/oox/vml/vmltextboxcontext.hxx
new file mode 100644
index 000000000000..47d71ac41b41
--- /dev/null
+++ b/include/oox/vml/vmltextboxcontext.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 OOX_VML_VMLTEXTBOXCONTEXT_HXX
+#define OOX_VML_VMLTEXTBOXCONTEXT_HXX
+
+#include "oox/core/contexthandler2.hxx"
+#include "oox/vml/vmltextbox.hxx"
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+class TextPortionContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit TextPortionContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ TextBox& rTextBox,
+ const TextFontModel& rParentFont,
+ sal_Int32 nElement,
+ const AttributeList& rAttribs );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onCharacters( const OUString& rChars );
+ virtual void onStartElement(const AttributeList& rAttribs);
+ virtual void onEndElement();
+
+private:
+ TextBox& mrTextBox;
+ TextFontModel maFont;
+ size_t mnInitialPortions;
+};
+
+// ============================================================================
+
+class TextBoxContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit TextBoxContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ TextBox& rTextBox,
+ const AttributeList& rAttribs,
+ const GraphicHelper& graphicHelper );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+private:
+ TextBox& mrTextBox;
+};
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/package/Deflater.hxx b/include/package/Deflater.hxx
new file mode 100644
index 000000000000..7531e3a1ac66
--- /dev/null
+++ b/include/package/Deflater.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 _DEFLATER_HXX_
+#define _DEFLATER_HXX_
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include "packagedllapi.hxx"
+
+struct z_stream_s;
+
+namespace ZipUtils {
+
+class DLLPUBLIC_PACKAGE Deflater
+{
+ typedef struct z_stream_s z_stream;
+
+protected:
+ com::sun::star::uno::Sequence< sal_Int8 > sInBuffer;
+ sal_Bool bFinish;
+ sal_Bool bFinished;
+ sal_Bool bSetParams;
+ sal_Int32 nLevel, nStrategy;
+ sal_Int64 nOffset, nLength;
+ z_stream* pStream;
+
+ void init (sal_Int32 nLevel, sal_Int32 nStrategy, sal_Bool bNowrap);
+ sal_Int32 doDeflateBytes (com::sun::star::uno::Sequence < sal_Int8 > &rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength);
+
+public:
+ ~Deflater();
+ Deflater(sal_Int32 nSetLevel, sal_Bool bNowrap);
+ void SAL_CALL setInputSegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
+ void SAL_CALL setLevel( sal_Int32 nNewLevel );
+ sal_Bool SAL_CALL needsInput( );
+ void SAL_CALL finish( );
+ sal_Bool SAL_CALL finished( );
+ sal_Int32 SAL_CALL doDeflateSegment( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
+ sal_Int64 SAL_CALL getTotalIn( );
+ sal_Int64 SAL_CALL getTotalOut( );
+ void SAL_CALL reset( );
+ void SAL_CALL end( );
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/package/Inflater.hxx b/include/package/Inflater.hxx
new file mode 100644
index 000000000000..284451750e43
--- /dev/null
+++ b/include/package/Inflater.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 _INFLATER_HXX_
+#define _INFLATER_HXX_
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include "packagedllapi.hxx"
+
+struct z_stream_s;
+
+namespace ZipUtils {
+
+class DLLPUBLIC_PACKAGE Inflater
+{
+ typedef struct z_stream_s z_stream;
+
+protected:
+ sal_Bool bFinish, bFinished, bSetParams, bNeedDict;
+ sal_Int32 nOffset, nLength, nLastInflateError;
+ z_stream* pStream;
+ com::sun::star::uno::Sequence < sal_Int8 > sInBuffer;
+ sal_Int32 doInflateBytes (com::sun::star::uno::Sequence < sal_Int8 > &rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength);
+
+public:
+ Inflater(sal_Bool bNoWrap = sal_False);
+ ~Inflater();
+ void SAL_CALL setInput( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer );
+ sal_Bool SAL_CALL needsDictionary( );
+ sal_Bool SAL_CALL finished( );
+ sal_Int32 SAL_CALL doInflateSegment( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
+ void SAL_CALL end( );
+
+ sal_Int32 getLastInflateError() { return nLastInflateError; }
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/package/packagedllapi.hxx b/include/package/packagedllapi.hxx
new file mode 100644
index 000000000000..72a3dab60f07
--- /dev/null
+++ b/include/package/packagedllapi.hxx
@@ -0,0 +1,22 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_PACKAGEDLLAPI_H
+#define INCLUDED_PACKAGEDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(DLLIMPLEMENTATION_PACKAGE)
+#define DLLPUBLIC_PACKAGE SAL_DLLPUBLIC_EXPORT
+#else
+#define DLLPUBLIC_PACKAGE SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif /* INCLUDED_PACKAGEDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/reader.h b/include/registry/reader.h
new file mode 100644
index 000000000000..263215a92722
--- /dev/null
+++ b/include/registry/reader.h
@@ -0,0 +1,603 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_registry_reader_h
+#define INCLUDED_registry_reader_h
+
+#include "registry/regdllapi.h"
+#include "registry/types.h"
+#include "registry/version.h"
+
+#include "rtl/ustring.h"
+#include "sal/types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ Creates a type reader working on a binary blob that represents a UNOIDL type.
+
+ <p>If a non-null handle is returned through <code>result</code>, its
+ reference count will be one. Operations on a non-null handle are not
+ multi-thread&ndash;safe.</p>
+
+ @param buffer the binary blob representing the type; must point to at least
+ <code>length</code> bytes, and need only be byte-aligned
+
+ @param length the size in bytes of the binary blob representing the type
+
+ @param copy if true, the type reader creates an internal copy of the given
+ buffer, and the given buffer is not accessed after this function returns; if
+ false, the type reader works directly on the given buffer, which must remain
+ available unmodified until the type reader is destroyed
+
+ @param maxVersion the maximum binary blob version the client is prepared to
+ handle; must not be negative
+
+ @param result an out-parameter obtaining a handle on the type reader; must
+ not be null; if the given binary blob is malformed, or of a version larger
+ than <code>maxVersion</code>, null is returned
+
+ @return false iff an out-of-memory condition occurred, in which case
+ <code>result</code> is left unchanged, and no type reader is created
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_Bool SAL_CALL typereg_reader_create(
+ void const * buffer, sal_uInt32 length, sal_Bool copy,
+ enum typereg_Version maxVersion, void ** result)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Increments the reference count of a type reader.
+
+ @param handle a handle on a type reader; may be null
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_acquire(void * handle) SAL_THROW_EXTERN_C();
+
+/**
+ Decrements the reference count of a type reader.
+
+ <p>If the reference count drops to zero, the type reader is destroyed.</p>
+
+ @param handle a handle on a type reader; may be null
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_release(void * handle) SAL_THROW_EXTERN_C();
+
+/**
+ Returns the binary blob version of a type reader.
+
+ @param handle a handle on a type reader; may be null
+
+ @return the version of the binary blob from which the type reader was
+ constructed; if <code>handle</code> is null, <code>TYPEREG_VERSION_0</code>
+ is returned
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC enum typereg_Version SAL_CALL typereg_reader_getVersion(void * handle)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the documentation of a type reader.
+
+ @param handle a handle on a type reader; may be null
+
+ @param result an out-parameter obtaining the documentation string; must not
+ be null; if <code>handle</code> is null, an empty string is returned; if an
+ out-of-memory condition occurs, a pointer to a null pointer is returned
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getDocumentation(
+ void * handle, rtl_uString ** result) SAL_THROW_EXTERN_C();
+
+/**
+ Returns the file name of a type reader.
+
+ @param handle a handle on a type reader; may be null
+
+ @param result an out-parameter obtaining the file name string; must not be
+ null; if <code>handle</code> is null, an empty string is returned; if an
+ out-of-memory condition occurs, a pointer to a null pointer is returned
+
+ @since UDK 3.2.0
+ @deprecated
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getFileName(void * handle, rtl_uString ** result)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the type class of a type reader.
+
+ <p>This function will always return the type class without the internal
+ <code>RT_TYPE_PUBLISHED</code> flag set. Use
+ <code>typereg_reader_isPublished</code> to determine whether a type reader is
+ published.</p>
+
+ @param handle a handle on a type reader; may be null
+
+ @return the type class of the type reader; if <code>handle</code> is null,
+ <code>RT_TYPE_INVALID</code> is returned
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC enum RTTypeClass SAL_CALL typereg_reader_getTypeClass(void * handle)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns whether a type reader is published.
+
+ @param handle a handle on a type reader; may be null
+
+ @return whether the type reader is published; if <code>handle</code> is null,
+ <code>sal_False</code> is returned
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_Bool SAL_CALL typereg_reader_isPublished(void * handle)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the type name of a type reader.
+
+ @param handle a handle on a type reader; may be null
+
+ @param result an out-parameter obtaining the type name string; must not be
+ null; if <code>handle</code> is null, an empty string is returned; if an
+ out-of-memory condition occurs, a pointer to a null pointer is returned
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getTypeName(void * handle, rtl_uString ** result)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the number of super types of a type reader.
+
+ @param handle a handle on a type reader; may be null
+
+ @return the number of super types of the type reader; if <code>handle</code>
+ is null, zero is returned
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_uInt16 SAL_CALL typereg_reader_getSuperTypeCount(void * handle)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the type name of a super type of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the super type's type name string;
+ must not be null; if an out-of-memory condition occurs, a pointer to a null
+ pointer is returned
+
+ @param index a valid index into the range of super types of the given type
+ reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getSuperTypeName(
+ void * handle, rtl_uString ** result, sal_uInt16 index)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the number of fields of a type reader.
+
+ @param handle a handle on a type reader; may be null
+
+ @return the number of fields of the type reader; if <code>handle</code> is
+ null, zero is returned
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_uInt16 SAL_CALL typereg_reader_getFieldCount(void * handle)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the documentation of a field of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the field's documentation string;
+ must not be null; if an out-of-memory condition occurs, a pointer to a null
+ pointer is returned
+
+ @param index a valid index into the range of fields of the given type reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getFieldDocumentation(
+ void * handle, rtl_uString ** result, sal_uInt16 index)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the file name of a field of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the field's file name string; must
+ not be null; if an out-of-memory condition occurs, a pointer to a null
+ pointer is returned
+
+ @param index a valid index into the range of fields of the given type reader
+
+ @since UDK 3.2.0
+ @deprecated
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getFieldFileName(
+ void * handle, rtl_uString ** result, sal_uInt16 index)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the flags of a field of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param index a valid index into the range of fields of the given type reader
+
+ @return the flags of the given field of the type reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC RTFieldAccess SAL_CALL typereg_reader_getFieldFlags(
+ void * handle, sal_uInt16 index) SAL_THROW_EXTERN_C();
+
+/**
+ Returns the name of a field of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the field's name string; must not be
+ null; if an out-of-memory condition occurs, a pointer to a null pointer is
+ returned
+
+ @param index a valid index into the range of fields of the given type reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getFieldName(
+ void * handle, rtl_uString ** result, sal_uInt16 index)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the type name of a field of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the field's type name string; must
+ not be null; if an out-of-memory condition occurs, a pointer to a null
+ pointer is returned
+
+ @param index a valid index into the range of fields of the given type reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getFieldTypeName(
+ void * handle, rtl_uString ** result, sal_uInt16 index)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the value of a field of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param index a valid index into the range of fields of the given type reader
+
+ @param type an out-parameter obtaining the field value's type; must not be
+ null
+
+ @param value an out-parameter obtaining the field value's value; must not be
+ null
+
+ @return false iff an out-of-memory condition occurred, in which case
+ <code>type</code> and <code>value</code> are left unchanged
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_Bool SAL_CALL typereg_reader_getFieldValue(
+ void * handle, sal_uInt16 index, enum RTValueType * type,
+ union RTConstValueUnion * value)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the number of methods of a type reader.
+
+ @param handle a handle on a type reader; may be null
+
+ @return the number of methods of the type reader; if <code>handle</code> is
+ null, zero is returned
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_uInt16 SAL_CALL typereg_reader_getMethodCount(void * handle)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the documentation of a method of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the methods's documentation string;
+ must not be null; if an out-of-memory condition occurs, a pointer to a null
+ pointer is returned
+
+ @param index a valid index into the range of methods of the given type reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getMethodDocumentation(
+ void * handle, rtl_uString ** result, sal_uInt16 index)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the flags of a method of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param index a valid index into the range of methods of the given type reader
+
+ @return the flags of the given method of the type reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC enum RTMethodMode SAL_CALL typereg_reader_getMethodFlags(
+ void * handle, sal_uInt16 index) SAL_THROW_EXTERN_C();
+
+/**
+ Returns the name of a method of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the methods's name string; must not
+ be null; if an out-of-memory condition occurs, a pointer to a null pointer is
+ returned
+
+ @param index a valid index into the range of methods of the given type reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getMethodName(
+ void * handle, rtl_uString ** result, sal_uInt16 index)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the return type name of a method of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the methods's return type name
+ string; must not be null; if an out-of-memory condition occurs, a pointer to
+ a null pointer is returned
+
+ @param index a valid index into the range of methods of the given type reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getMethodReturnTypeName(
+ void * handle, rtl_uString ** result, sal_uInt16 index)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the number of parameters of a method of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param index a valid index into the range of methods of the given type reader
+
+ @return the number of parameters of the given method of the type reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_uInt16 SAL_CALL typereg_reader_getMethodParameterCount(
+ void * handle, sal_uInt16 index) SAL_THROW_EXTERN_C();
+
+/**
+ Returns the flags of a parameter of a method of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param methodIndex a valid index into the range of methods of the given type
+ reader
+
+ @param parameterIndex a valid index into the range of parameters of the given
+ method
+
+ @return the flags of the given parameter of the given method of the type
+ reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC enum RTParamMode SAL_CALL typereg_reader_getMethodParameterFlags(
+ void * handle, sal_uInt16 methodIndex, sal_uInt16 parameterIndex)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the name of a parameter of a method of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the parameter's name string; must
+ not be null; if an out-of-memory condition occurs, a pointer to a null
+ pointer is returned
+
+ @param methodIndex a valid index into the range of methods of the given type
+ reader
+
+ @param parameterIndex a valid index into the range of parameters of the given
+ method
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getMethodParameterName(
+ void * handle, rtl_uString ** result, sal_uInt16 methodIndex,
+ sal_uInt16 parameterIndex)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the type name of a parameter of a method of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the parameter's type name string;
+ must not be null; if an out-of-memory condition occurs, a pointer to a null
+ pointer is returned
+
+ @param methodIndex a valid index into the range of methods of the given type
+ reader
+
+ @param parameterIndex a valid index into the range of parameters of the given
+ method
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getMethodParameterTypeName(
+ void * handle, rtl_uString ** result, sal_uInt16 methodIndex,
+ sal_uInt16 parameterIndex)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the number of exceptions of a method of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param index a valid index into the range of methods of the given type reader
+
+ @return the number of exceptions of the given method of the type reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_uInt16 SAL_CALL typereg_reader_getMethodExceptionCount(
+ void * handle, sal_uInt16 index) SAL_THROW_EXTERN_C();
+
+/**
+ Returns the type name of an exception of a method of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the exception's type name string;
+ must not be null; if an out-of-memory condition occurs, a pointer to a null
+ pointer is returned
+
+ @param methodIndex a valid index into the range of methods of the given type
+ reader
+
+ @param exceptionIndex a valid index into the range of exceptions of the given
+ method
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getMethodExceptionTypeName(
+ void * handle, rtl_uString ** result, sal_uInt16 methodIndex,
+ sal_uInt16 exceptionIndex)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the number of references of a type reader.
+
+ @param handle a handle on a type reader; may be null
+
+ @return the number of references of the type reader; if <code>handle</code>
+ is null, zero is returned
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_uInt16 SAL_CALL typereg_reader_getReferenceCount(void * handle)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the documentation of a reference of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the reference's documentation
+ string; must not be null; if an out-of-memory condition occurs, a pointer to
+ a null pointer is returned
+
+ @param index a valid index into the range of references of the given type
+ reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getReferenceDocumentation(
+ void * handle, rtl_uString ** result, sal_uInt16 index)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the flags of a reference of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param index a valid index into the range of references of the given type
+ reader
+
+ @return the flags of the given reference of the type reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC RTFieldAccess SAL_CALL typereg_reader_getReferenceFlags(
+ void * handle, sal_uInt16 index) SAL_THROW_EXTERN_C();
+
+/**
+ Returns the sort of a reference of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param index a valid index into the range of references of the given type
+ reader
+
+ @return the sort of the given reference of the type reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC enum RTReferenceType SAL_CALL typereg_reader_getReferenceSort(
+ void * handle, sal_uInt16 index) SAL_THROW_EXTERN_C();
+
+/**
+ Returns the type name of a reference of a type reader.
+
+ @param handle a handle on a type reader; must not be null
+
+ @param result an out-parameter obtaining the reference's type name string;
+ must not be null; if an out-of-memory condition occurs, a pointer to a null
+ pointer is returned
+
+ @param index a valid index into the range of references of the given type
+ reader
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_reader_getReferenceTypeName(
+ void * handle, rtl_uString ** result, sal_uInt16 index)
+ SAL_THROW_EXTERN_C();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/reader.hxx b/include/registry/reader.hxx
new file mode 100644
index 000000000000..a867f3b1185a
--- /dev/null
+++ b/include/registry/reader.hxx
@@ -0,0 +1,624 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_registry_reader_hxx
+#define INCLUDED_registry_reader_hxx
+
+#include "registry/reader.h"
+#include "registry/refltype.hxx"
+#include "registry/types.h"
+#include "registry/version.h"
+
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include <algorithm>
+#include <new>
+
+namespace typereg {
+
+/**
+ A type reader working on a binary blob that represents a UNOIDL type.
+
+ <p>Instances of this class are not multi-thread&ndash;safe.</p>
+
+ @since UDK 3.2.0
+ */
+class Reader {
+public:
+ /**
+ Creates an invalid type reader.
+ */
+ Reader(): m_handle(0) {}
+
+ /**
+ Creates a type reader.
+
+ <p>If the given binary blob is malformed, or of a version larger than
+ <code>maxVersion</code>, the created type reader is flagged as
+ invalid.</p>
+
+ @param buffer the binary blob representing the type; must point to at
+ least <code>length</code> bytes, and need only be byte-aligned
+
+ @param length the size in bytes of the binary blob representing the type
+
+ @param copy if true, the type reader creates an internal copy of the
+ given buffer, and the given buffer is not accessed after this constructor
+ returns; if false, the type reader works directly on the given buffer,
+ which must remain available unmodified until the underlying type reader
+ is destroyed (note that the lifetime of the underlying type reader can be
+ different from the lifetime of this <code>Reader</code> instance)
+
+ @param maxVersion the maximum binary blob version the client is prepared
+ to handle; must not be negative
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ Reader(
+ void const * buffer, sal_uInt32 length, bool copy,
+ typereg_Version maxVersion)
+ {
+ if (!typereg_reader_create(buffer, length, copy, maxVersion, &m_handle))
+ {
+ throw std::bad_alloc();
+ }
+ }
+
+ /**
+ Shares a type reader between two <code>Reader</code> instances.
+
+ @param other another <code>Reader</code> instance
+ */
+ Reader(Reader const & other): m_handle(other.m_handle) {
+ typereg_reader_acquire(m_handle);
+ }
+
+ /**
+ Destroys this <code>Reader</code> instance.
+
+ <p>The underlying type reader is only destroyed if this instance was its
+ last user.</p>
+ */
+ ~Reader() {
+ typereg_reader_release(m_handle);
+ }
+
+ /**
+ Replaces the underlying type reader.
+
+ @param other any <code>Reader</code> instance
+
+ @return this <code>Reader</code> instance
+ */
+ Reader & operator =(Reader const & other) {
+ Reader temp(other);
+ std::swap(this->m_handle, temp.m_handle);
+ return *this;
+ }
+
+ /**
+ Returns whether this type reader is valid.
+
+ @return true iff this type reader is valid
+ */
+ bool isValid() const {
+ return m_handle != 0;
+ }
+
+ /**
+ Returns the binary blob version of this type reader.
+
+ @return the version of the binary blob from which this type reader was
+ constructed; if this type reader is invalid,
+ <code>TYPEREG_VERSION_0</code> is returned
+ */
+ typereg_Version getVersion() const {
+ return typereg_reader_getVersion(m_handle);
+ }
+
+ /**
+ Returns the documentation of this type reader.
+
+ @return the documentation of this type reader; if this type reader is
+ invalid, an empty string is returned
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getDocumentation() const {
+ rtl_uString * s = 0;
+ typereg_reader_getDocumentation(m_handle, &s);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the file name of this type reader.
+
+ @return the file name of this type reader; if this type reader is
+ invalid, an empty string is returned
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ @deprecated
+ */
+ OUString getFileName() const {
+ rtl_uString * s = 0;
+ typereg_reader_getFileName(m_handle, &s);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the type class of this type reader.
+
+ <p>This function will always return the type class without the internal
+ <code>RT_TYPE_PUBLISHED</code> flag set. Use <code>isPublished</code> to
+ determine whether this type reader is published.</p>
+
+ @return the type class of this type reader; if this type reader is
+ invalid, <code>RT_TYPE_INVALID</code> is returned
+ */
+ RTTypeClass getTypeClass() const {
+ return typereg_reader_getTypeClass(m_handle);
+ }
+
+ /**
+ Returns whether this type reader is published.
+
+ @return whether this type reader is published; if this type reader is
+ invalid, <code>false</code> is returned
+ */
+ bool isPublished() const {
+ return typereg_reader_isPublished(m_handle);
+ }
+
+ /**
+ Returns the type name of this type reader.
+
+ @return the type name of this type reader; if this type reader is
+ invalid, an empty string is returned
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getTypeName() const {
+ rtl_uString * s = 0;
+ typereg_reader_getTypeName(m_handle, &s);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the number of super types of this type reader.
+
+ @return the number of super types of this type reader; if this type
+ reader is invalid, zero is returned
+ */
+ sal_uInt16 getSuperTypeCount() const {
+ return typereg_reader_getSuperTypeCount(m_handle);
+ }
+
+ /**
+ Returns the type name of a super type of this type reader.
+
+ @param index a valid index into the range of super types of this type
+ reader
+
+ @return the type name of the given super type
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getSuperTypeName(sal_uInt16 index) const {
+ rtl_uString * s = 0;
+ typereg_reader_getSuperTypeName(m_handle, &s, index);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the number of fields of this type reader.
+
+ @return the number of fields of this type reader; if this type reader is
+ invalid, zero is returned
+ */
+ sal_uInt16 getFieldCount() const {
+ return typereg_reader_getFieldCount(m_handle);
+ }
+
+ /**
+ Returns the documentation of a field of this type reader.
+
+ @param index a valid index into the range of fields of this type reader
+
+ @return the documentation of the given field
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getFieldDocumentation(sal_uInt16 index) const {
+ rtl_uString * s = 0;
+ typereg_reader_getFieldDocumentation(m_handle, &s, index);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the file name of a field of this type reader.
+
+ @param index a valid index into the range of fields of this type reader
+
+ @return the file name of the given field
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ @deprecated
+ */
+ OUString getFieldFileName(sal_uInt16 index) const {
+ rtl_uString * s = 0;
+ typereg_reader_getFieldFileName(m_handle, &s, index);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the flags of a field of this type reader.
+
+ @param index a valid index into the range of fields of this type reader
+
+ @return the flags of the given field
+ */
+ RTFieldAccess getFieldFlags(sal_uInt16 index) const {
+ return typereg_reader_getFieldFlags(m_handle, index);
+ }
+
+ /**
+ Returns the name of a field of this type reader.
+
+ @param index a valid index into the range of fields of this type reader
+
+ @return the name of the given field
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getFieldName(sal_uInt16 index) const {
+ rtl_uString * s = 0;
+ typereg_reader_getFieldName(m_handle, &s, index);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the type name of a field of this type reader.
+
+ @param index a valid index into the range of fields of this type reader
+
+ @return the type name of the given field
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getFieldTypeName(sal_uInt16 index) const {
+ rtl_uString * s = 0;
+ typereg_reader_getFieldTypeName(m_handle, &s, index);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the value of a field of this type reader.
+
+ @param index a valid index into the range of fields of this type reader
+
+ @return the value of the given field
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ RTConstValue getFieldValue(sal_uInt16 index) const {
+ RTConstValue v;
+ if (!typereg_reader_getFieldValue(
+ m_handle, index, &v.m_type, &v.m_value))
+ {
+ throw std::bad_alloc();
+ }
+ return v;
+ }
+
+ /**
+ Returns the number of methods of this type reader.
+
+ @return the number of methods of this type reader; if this type reader is
+ invalid, zero is returned
+ */
+ sal_uInt16 getMethodCount() const {
+ return typereg_reader_getMethodCount(m_handle);
+ }
+
+ /**
+ Returns the documentation of a method of this type reader.
+
+ @param index a valid index into the range of methods of this type reader
+
+ @return the documentation of the given method
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getMethodDocumentation(sal_uInt16 index) const {
+ rtl_uString * s = 0;
+ typereg_reader_getMethodDocumentation(m_handle, &s, index);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the flags of a method of this type reader.
+
+ @param index a valid index into the range of methods of this type reader
+
+ @return the flags of the given method
+ */
+ RTMethodMode getMethodFlags(sal_uInt16 index) const {
+ return typereg_reader_getMethodFlags(m_handle, index);
+ }
+
+ /**
+ Returns the name of a method of this type reader.
+
+ @param index a valid index into the range of methods of this type reader
+
+ @return the name of the given method
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getMethodName(sal_uInt16 index) const {
+ rtl_uString * s = 0;
+ typereg_reader_getMethodName(m_handle, &s, index);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the return type name of a method of this type reader.
+
+ @param index a valid index into the range of methods of this type reader
+
+ @return the return type name of the given method
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getMethodReturnTypeName(sal_uInt16 index) const {
+ rtl_uString * s = 0;
+ typereg_reader_getMethodReturnTypeName(m_handle, &s, index);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the number of parameters of a method of this type reader.
+
+ @param index a valid index into the range of methods of this type reader
+
+ @return the number of parameters of the given method
+ */
+ sal_uInt16 getMethodParameterCount(sal_uInt16 index) const {
+ return typereg_reader_getMethodParameterCount(m_handle, index);
+ }
+
+ /**
+ Returns the flags of a parameter of a method of this type reader.
+
+ @param methodIndex a valid index into the range of methods of this type
+ reader
+
+ @param parameterIndex a valid index into the range of parameters of the
+ given method
+
+ @return the flags of the given method parameter
+ */
+ RTParamMode getMethodParameterFlags(
+ sal_uInt16 methodIndex, sal_uInt16 parameterIndex) const
+ {
+ return typereg_reader_getMethodParameterFlags(
+ m_handle, methodIndex, parameterIndex);
+ }
+
+ /**
+ Returns the name of a parameter of a method of this type reader.
+
+ @param methodIndex a valid index into the range of methods of this type
+ reader
+
+ @param parameterIndex a valid index into the range of parameters of the
+ given method
+
+ @return the name of the given method parameter
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getMethodParameterName(
+ sal_uInt16 methodIndex, sal_uInt16 parameterIndex) const
+ {
+ rtl_uString * s = 0;
+ typereg_reader_getMethodParameterName(
+ m_handle, &s, methodIndex, parameterIndex);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the type name of a parameter of a method of this type reader.
+
+ @param methodIndex a valid index into the range of methods of this type
+ reader
+
+ @param parameterIndex a valid index into the range of parameters of the
+ given method
+
+ @return the type name of the given method parameter
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getMethodParameterTypeName(
+ sal_uInt16 methodIndex, sal_uInt16 parameterIndex) const
+ {
+ rtl_uString * s = 0;
+ typereg_reader_getMethodParameterTypeName(
+ m_handle, &s, methodIndex, parameterIndex);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the number of exceptions of a method of this type reader.
+
+ @param index a valid index into the range of methods of this type reader
+
+ @return the number of exceptions of the given method
+ */
+ sal_uInt16 getMethodExceptionCount(sal_uInt16 index) const {
+ return typereg_reader_getMethodExceptionCount(m_handle, index);
+ }
+
+ /**
+ Returns the type name of an exception of a method of this type reader.
+
+ @param methodIndex a valid index into the range of methods of this type
+ reader
+
+ @param exceptionIndex a valid index into the range of exceptions of the
+ given method
+
+ @return the type name of the given method exception
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getMethodExceptionTypeName(
+ sal_uInt16 methodIndex, sal_uInt16 exceptionIndex) const
+ {
+ rtl_uString * s = 0;
+ typereg_reader_getMethodExceptionTypeName(
+ m_handle, &s, methodIndex, exceptionIndex);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the number of references of this type reader.
+
+ @return the number of references of this type reader; if this type reader
+ is invalid, zero is returned
+ */
+ sal_uInt16 getReferenceCount() const {
+ return typereg_reader_getReferenceCount(m_handle);
+ }
+
+ /**
+ Returns the documentation of a reference of this type reader.
+
+ @param index a valid index into the range of references of this type
+ reader
+
+ @return the documentation of the given reference
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getReferenceDocumentation(sal_uInt16 index) const {
+ rtl_uString * s = 0;
+ typereg_reader_getReferenceDocumentation(m_handle, &s, index);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+ /**
+ Returns the flags of a reference of this type reader.
+
+ @param index a valid index into the range of references of this type
+ reader
+
+ @return the flags of the given reference
+ */
+ RTFieldAccess getReferenceFlags(sal_uInt16 index) const {
+ return typereg_reader_getReferenceFlags(m_handle, index);
+ }
+
+ /**
+ Returns the sort of a reference of this type reader.
+
+ @param index a valid index into the range of references of this type
+ reader
+
+ @return the sort of the given reference
+ */
+ RTReferenceType getReferenceSort(sal_uInt16 index) const {
+ return typereg_reader_getReferenceSort(m_handle, index);
+ }
+
+ /**
+ Returns the type name of a reference of this type reader.
+
+ @param index a valid index into the range of references of this type
+ reader
+
+ @return the type name of the given reference
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ OUString getReferenceTypeName(sal_uInt16 index) const {
+ rtl_uString * s = 0;
+ typereg_reader_getReferenceTypeName(m_handle, &s, index);
+ if (s == 0) {
+ throw std::bad_alloc();
+ }
+ return OUString(s, SAL_NO_ACQUIRE);
+ }
+
+private:
+ void * m_handle;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/reflread.hxx b/include/registry/reflread.hxx
new file mode 100644
index 000000000000..541692443127
--- /dev/null
+++ b/include/registry/reflread.hxx
@@ -0,0 +1,513 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _REGISTRY_REFLREAD_HXX_
+#define _REGISTRY_REFLREAD_HXX_
+
+#include <registry/regdllapi.h>
+#include <registry/refltype.hxx>
+#include <registry/regtype.h>
+#include <rtl/ustring.hxx>
+
+/// Implememetation handle
+typedef void* TypeReaderImpl;
+
+/****************************************************************************
+
+ C-Api
+
+*****************************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** specifies a collection of function pointers which represents the complete registry type reader C-API.
+
+ This funtions pointers are used by the C++ wrapper to call the C-API.
+*/
+struct RegistryTypeReader_Api
+{
+ TypeReaderImpl (TYPEREG_CALLTYPE *createEntry) (const sal_uInt8*, sal_uInt32, sal_Bool);
+ void (TYPEREG_CALLTYPE *acquire) (TypeReaderImpl);
+ void (TYPEREG_CALLTYPE *release) (TypeReaderImpl);
+ sal_uInt16 (TYPEREG_CALLTYPE *getMinorVersion) (TypeReaderImpl);
+ sal_uInt16 (TYPEREG_CALLTYPE *getMajorVersion) (TypeReaderImpl);
+ RTTypeClass (TYPEREG_CALLTYPE *getTypeClass) (TypeReaderImpl);
+ void (TYPEREG_CALLTYPE *getUik) (TypeReaderImpl, RTUik*);
+ void (TYPEREG_CALLTYPE *getDoku) (TypeReaderImpl, rtl_uString**);
+ void (TYPEREG_CALLTYPE *getFileName) (TypeReaderImpl, rtl_uString**);
+ void (TYPEREG_CALLTYPE *getTypeName) (TypeReaderImpl, rtl_uString**);
+ void (TYPEREG_CALLTYPE *getSuperTypeName) (TypeReaderImpl, rtl_uString**);
+ sal_uInt32 (TYPEREG_CALLTYPE *getFieldCount) (TypeReaderImpl);
+ void (TYPEREG_CALLTYPE *getFieldName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
+ void (TYPEREG_CALLTYPE *getFieldType) (TypeReaderImpl, rtl_uString**, sal_uInt16);
+ RTFieldAccess (TYPEREG_CALLTYPE *getFieldAccess) (TypeReaderImpl, sal_uInt16);
+ RTValueType (TYPEREG_CALLTYPE *getFieldConstValue) (TypeReaderImpl, sal_uInt16, RTConstValueUnion*);
+ void (TYPEREG_CALLTYPE *getFieldDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16);
+ void (TYPEREG_CALLTYPE *getFieldFileName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
+ sal_uInt32 (TYPEREG_CALLTYPE *getMethodCount) (TypeReaderImpl);
+ void (TYPEREG_CALLTYPE *getMethodName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
+ sal_uInt32 (TYPEREG_CALLTYPE *getMethodParamCount) (TypeReaderImpl, sal_uInt16);
+ void (TYPEREG_CALLTYPE *getMethodParamType) (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16);
+ void (TYPEREG_CALLTYPE *getMethodParamName) (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16);
+ RTParamMode (TYPEREG_CALLTYPE *getMethodParamMode) (TypeReaderImpl, sal_uInt16, sal_uInt16);
+ sal_uInt32 (TYPEREG_CALLTYPE *getMethodExcCount) (TypeReaderImpl, sal_uInt16);
+ void (TYPEREG_CALLTYPE *getMethodExcType) (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16);
+ void (TYPEREG_CALLTYPE *getMethodReturnType) (TypeReaderImpl, rtl_uString**, sal_uInt16);
+ RTMethodMode (TYPEREG_CALLTYPE *getMethodMode) (TypeReaderImpl, sal_uInt16);
+ void (TYPEREG_CALLTYPE *getMethodDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16);
+
+ sal_uInt32 (TYPEREG_CALLTYPE *getReferenceCount) (TypeReaderImpl);
+ void (TYPEREG_CALLTYPE *getReferenceName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
+ RTReferenceType (TYPEREG_CALLTYPE *getReferenceType) (TypeReaderImpl, sal_uInt16);
+ void (TYPEREG_CALLTYPE *getReferenceDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16);
+ RTFieldAccess (TYPEREG_CALLTYPE *getReferenceAccess) (TypeReaderImpl, sal_uInt16);
+};
+
+/** the API initialization function.
+*/
+REG_DLLPUBLIC RegistryTypeReader_Api* TYPEREG_CALLTYPE initRegistryTypeReader_Api(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+/** RegistryTypeReades reads a binary type blob.
+
+ This class provides the necessary functions to read type information
+ for all kinds of types of a type blob.
+ The class is inline and use a C-Api.
+
+ @deprecated
+ use typereg::Reader instead
+*/
+class RegistryTypeReader
+{
+public:
+
+ /** Constructor.
+
+ @param buffer points to the binary data block.
+ @param bufferLen specifies the size of the binary data block.
+ @param copyData specifies if the data block should be copied.
+ The block can be copied to ensure that the data
+ is valid for the lifetime of this instance.
+ */
+ inline RegistryTypeReader(const sal_uInt8* buffer,
+ sal_uInt32 bufferLen,
+ sal_Bool copyData);
+
+ /// Copy constructcor
+ inline RegistryTypeReader(const RegistryTypeReader& toCopy);
+
+ /// Destructor. The Destructor frees the data block if the copyData flag was TRUE.
+ inline ~RegistryTypeReader();
+
+ /// Assign operator
+ inline RegistryTypeReader& operator == (const RegistryTypeReader& toAssign);
+
+ /// checks if the registry type reader points to a valid Api.
+ inline sal_Bool isValid() const;
+
+ /** @deprecated
+ returns the minor version number.
+
+ We currently don't support a versioning concept of IDL interfaces and
+ so this function is currently not used.
+ */
+ inline sal_uInt16 getMinorVersion() const;
+
+ /** @deprecated
+ returns the major version number.
+
+ We currently don't support a versioning concept of IDL interfaces and
+ so this function is currently not used.
+ */
+ inline sal_uInt16 getMajorVersion() const;
+
+ /** returns the typeclass of the type represented by this blob.
+
+ This function will always return the type class without the internal
+ RT_TYPE_PUBLISHED flag set.
+ */
+ inline RTTypeClass getTypeClass() const;
+
+ /** returns the full qualified name of the type.
+ */
+ inline OUString getTypeName() const;
+
+ /** returns the full qualified name of the supertype.
+ */
+ inline OUString getSuperTypeName() const;
+
+ /** @deprecated
+ returns the unique identifier for an interface type as an out parameter.
+
+ An earlier version of UNO used an unique identifier for interfaces. In the
+ current version of UNO this uik was eliminated and this function is
+ not longer used.
+ */
+ inline void getUik(RTUik& uik) const;
+
+ /** returns the documentation string of this type.
+ */
+ inline OUString getDoku() const;
+
+ /** returns the IDL filename where the type is defined.
+ */
+ inline OUString getFileName() const;
+
+ /** returns the number of fields (attributes/properties, enum values or number
+ of constants in a module).
+
+ */
+ inline sal_uInt32 getFieldCount() const;
+
+ /** returns the name of the field specified by index.
+ */
+ inline OUString getFieldName( sal_uInt16 index ) const;
+
+ /** returns the full qualified name of the field specified by index.
+ */
+ inline OUString getFieldType( sal_uInt16 index ) const;
+
+ /** returns the access mode of the field specified by index.
+ */
+ inline RTFieldAccess getFieldAccess( sal_uInt16 index ) const;
+
+ /** returns the value of the field specified by index.
+
+ This function returns the value of an enum value or of a constant.
+ */
+ inline RTConstValue getFieldConstValue( sal_uInt16 index ) const;
+
+ /** returns the documentation string for the field specified by index.
+
+ Each field of a type can have their own documentation.
+ */
+ inline OUString getFieldDoku( sal_uInt16 index ) const;
+
+ /** returns the IDL filename of the field specified by index.
+
+ The IDL filename of a field can differ from the filename of the ype itself
+ because modules and also constants can be defined in different IDL files.
+ */
+ inline OUString getFieldFileName( sal_uInt16 index ) const;
+
+ /** returns the number of methods of an interface type.
+ */
+ inline sal_uInt32 getMethodCount() const;
+
+ /** returns the name of the method specified by index.
+ */
+ inline OUString getMethodName( sal_uInt16 index ) const;
+
+ /** returns number of parameters of the method specified by index.
+ */
+ inline sal_uInt32 getMethodParamCount( sal_uInt16 index ) const;
+
+ /** returns the full qualified parameter typename.
+
+ @param index indicates the method
+ @param paramIndex indeciates the parameter which type will be returned.
+ */
+ inline OUString getMethodParamType( sal_uInt16 index, sal_uInt16 paramIndex ) const;
+
+ /** returns the name of a parameter.
+
+ @param index indicates the method
+ @param paramIndex indiciates the parameter which name will be returned.
+ */
+ inline OUString getMethodParamName( sal_uInt16 index, sal_uInt16 paramIndex ) const;
+
+ /** returns the parameter mode, if it is an in, out or inout parameter.
+
+ @param index indicates the method
+ @param paramIndex indeciates the parameter which mode will be returned.
+ */
+ inline RTParamMode getMethodParamMode( sal_uInt16 index, sal_uInt16 paramIndex ) const;
+
+ /** returns the number of exceptions which are declared for the method specified by index.
+
+ @param index indicates the method
+ */
+ inline sal_uInt32 getMethodExcCount( sal_uInt16 index ) const;
+
+ /** returns the full qualified exception type of the specified exception.
+
+ @param index indicates the method
+ @param excIndex indeciates the exception which typename will be returned.
+ */
+ inline OUString getMethodExcType( sal_uInt16 index, sal_uInt16 excIndex ) const;
+
+ /** returns the full qualified return type of the method specified by index.
+ */
+ inline OUString getMethodReturnType( sal_uInt16 index ) const;
+
+ /** returns the full qualified exception type of the specified exception.
+
+ @param index indicates the method
+ */
+ inline RTMethodMode getMethodMode( sal_uInt16 index ) const;
+
+ /** returns the documentation string of the method specified by index.
+
+ @param index indicates the method.
+ */
+ inline OUString getMethodDoku( sal_uInt16 index ) const;
+
+ /** returns the number of references (supported interfaces, exported services).
+ */
+ inline sal_uInt32 getReferenceCount() const;
+
+ /** returns the full qualified typename of the reference specified by index.
+
+ @param index indicates the reference.
+ */
+ inline OUString getReferenceName( sal_uInt16 index ) const;
+
+ /** returns the type of the reference specified by index.
+
+ @param index indicates the reference.
+ */
+ inline RTReferenceType getReferenceType( sal_uInt16 index ) const;
+
+ /** returns the documentation string of the reference specified by index.
+
+ @param index indicates the reference.
+ */
+ inline OUString getReferenceDoku( sal_uInt16 index ) const;
+
+ /** returns the access mode of the reference specified by index.
+
+ The only valid value is RT_ACCESS_OPTIONAL in the context of
+ references.
+ @param index indicates the reference.
+ */
+ inline RTFieldAccess getReferenceAccess( sal_uInt16 index ) const;
+
+protected:
+
+ /// stores the registry type reader Api.
+ const RegistryTypeReader_Api* m_pApi;
+ /// stores the handle of an implementation class
+ TypeReaderImpl m_hImpl;
+};
+
+
+
+inline RegistryTypeReader::RegistryTypeReader(const sal_uInt8* buffer,
+ sal_uInt32 bufferLen,
+ sal_Bool copyData)
+ : m_pApi(initRegistryTypeReader_Api())
+ , m_hImpl(NULL)
+ {
+ m_hImpl = m_pApi->createEntry(buffer, bufferLen, copyData);
+ }
+
+
+inline RegistryTypeReader::RegistryTypeReader(const RegistryTypeReader& toCopy)
+ : m_pApi(toCopy.m_pApi)
+ , m_hImpl(toCopy.m_hImpl)
+ { m_pApi->acquire(m_hImpl); }
+
+
+inline RegistryTypeReader::~RegistryTypeReader()
+ { m_pApi->release(m_hImpl); }
+
+inline RegistryTypeReader& RegistryTypeReader::operator == (const RegistryTypeReader& toAssign)
+{
+ if (m_hImpl != toAssign.m_hImpl)
+ {
+ m_pApi->release(m_hImpl);
+ m_hImpl = toAssign.m_hImpl;
+ m_pApi->acquire(m_hImpl);
+ }
+
+ return *this;
+}
+
+inline sal_uInt16 RegistryTypeReader::getMinorVersion() const
+ { return m_pApi->getMinorVersion(m_hImpl); }
+
+inline sal_Bool RegistryTypeReader::isValid() const
+ { return (m_hImpl != NULL); }
+
+inline sal_uInt16 RegistryTypeReader::getMajorVersion() const
+ { return m_pApi->getMajorVersion(m_hImpl); }
+
+inline RTTypeClass RegistryTypeReader::getTypeClass() const
+ { return m_pApi->getTypeClass(m_hImpl); }
+
+inline OUString RegistryTypeReader::getTypeName() const
+ {
+ OUString sRet;
+ m_pApi->getTypeName(m_hImpl, &sRet.pData);
+ return sRet;
+ }
+
+inline OUString RegistryTypeReader::getSuperTypeName() const
+ {
+ OUString sRet;
+ m_pApi->getSuperTypeName(m_hImpl, &sRet.pData);
+ return sRet;
+ }
+
+inline void RegistryTypeReader::getUik(RTUik& uik) const
+ { m_pApi->getUik(m_hImpl, &uik); }
+
+inline OUString RegistryTypeReader::getDoku() const
+ {
+ OUString sRet;
+ m_pApi->getDoku(m_hImpl, &sRet.pData);
+ return sRet;
+ }
+
+inline OUString RegistryTypeReader::getFileName() const
+ {
+ OUString sRet;
+ m_pApi->getFileName(m_hImpl, &sRet.pData);
+ return sRet;
+ }
+
+inline sal_uInt32 RegistryTypeReader::getFieldCount() const
+ { return m_pApi->getFieldCount(m_hImpl); }
+
+inline OUString RegistryTypeReader::getFieldName( sal_uInt16 index ) const
+ {
+ OUString sRet;
+ m_pApi->getFieldName(m_hImpl, &sRet.pData, index);
+ return sRet;
+ }
+
+inline OUString RegistryTypeReader::getFieldType( sal_uInt16 index ) const
+ {
+ OUString sRet;
+ m_pApi->getFieldType(m_hImpl, &sRet.pData, index);
+ return sRet;
+ }
+
+inline RTFieldAccess RegistryTypeReader::getFieldAccess( sal_uInt16 index ) const
+ { return m_pApi->getFieldAccess(m_hImpl, index); }
+
+inline RTConstValue RegistryTypeReader::getFieldConstValue( sal_uInt16 index ) const
+ {
+ RTConstValue ret;
+ ret.m_type = m_pApi->getFieldConstValue(m_hImpl, index, &ret.m_value);
+ return ret;
+ }
+
+inline OUString RegistryTypeReader::getFieldDoku( sal_uInt16 index ) const
+ {
+ OUString sRet;
+ m_pApi->getFieldDoku(m_hImpl, &sRet.pData, index);
+ return sRet;
+ }
+
+inline OUString RegistryTypeReader::getFieldFileName( sal_uInt16 index ) const
+ {
+ OUString sRet;
+ m_pApi->getFieldFileName(m_hImpl, &sRet.pData, index);
+ return sRet;
+ }
+
+inline sal_uInt32 RegistryTypeReader::getMethodCount() const
+ { return m_pApi->getMethodCount(m_hImpl); }
+
+inline OUString RegistryTypeReader::getMethodName( sal_uInt16 index ) const
+ {
+ OUString sRet;
+ m_pApi->getMethodName(m_hImpl, &sRet.pData, index);
+ return sRet;
+ }
+
+inline sal_uInt32 RegistryTypeReader::getMethodParamCount( sal_uInt16 index ) const
+ { return m_pApi->getMethodParamCount(m_hImpl, index); }
+
+inline OUString RegistryTypeReader::getMethodParamType( sal_uInt16 index, sal_uInt16 paramIndex ) const
+ {
+ OUString sRet;
+ m_pApi->getMethodParamType(m_hImpl, &sRet.pData, index, paramIndex);
+ return sRet;
+ }
+
+inline OUString RegistryTypeReader::getMethodParamName( sal_uInt16 index, sal_uInt16 paramIndex ) const
+ {
+ OUString sRet;
+ m_pApi->getMethodParamName(m_hImpl, &sRet.pData, index, paramIndex);
+ return sRet;
+ }
+
+inline RTParamMode RegistryTypeReader::getMethodParamMode( sal_uInt16 index, sal_uInt16 paramIndex ) const
+ { return m_pApi->getMethodParamMode(m_hImpl, index, paramIndex); }
+
+inline sal_uInt32 RegistryTypeReader::getMethodExcCount( sal_uInt16 index ) const
+ { return m_pApi->getMethodExcCount(m_hImpl, index); }
+
+inline OUString RegistryTypeReader::getMethodExcType( sal_uInt16 index, sal_uInt16 excIndex ) const
+ {
+ OUString sRet;
+ m_pApi->getMethodExcType(m_hImpl, &sRet.pData, index, excIndex);
+ return sRet;
+ }
+
+inline OUString RegistryTypeReader::getMethodReturnType( sal_uInt16 index ) const
+ {
+ OUString sRet;
+ m_pApi->getMethodReturnType(m_hImpl, &sRet.pData, index);
+ return sRet;
+ }
+
+inline RTMethodMode RegistryTypeReader::getMethodMode( sal_uInt16 index ) const
+ { return m_pApi->getMethodMode(m_hImpl, index); }
+
+inline OUString RegistryTypeReader::getMethodDoku( sal_uInt16 index ) const
+ {
+ OUString sRet;
+ m_pApi->getMethodDoku(m_hImpl, &sRet.pData, index);
+ return sRet;
+ }
+
+inline sal_uInt32 RegistryTypeReader::getReferenceCount() const
+ { return m_pApi->getReferenceCount(m_hImpl); }
+
+inline OUString RegistryTypeReader::getReferenceName( sal_uInt16 index ) const
+ {
+ OUString sRet;
+ m_pApi->getReferenceName(m_hImpl, &sRet.pData, index);
+ return sRet;
+ }
+
+inline RTReferenceType RegistryTypeReader::getReferenceType( sal_uInt16 index ) const
+ { return m_pApi->getReferenceType(m_hImpl, index); }
+
+inline OUString RegistryTypeReader::getReferenceDoku( sal_uInt16 index ) const
+ {
+ OUString sRet;
+ m_pApi->getReferenceDoku(m_hImpl, &sRet.pData, index);
+ return sRet;
+ }
+
+inline RTFieldAccess RegistryTypeReader::getReferenceAccess( sal_uInt16 index ) const
+ { return m_pApi->getReferenceAccess(m_hImpl, index); }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/refltype.hxx b/include/registry/refltype.hxx
new file mode 100644
index 000000000000..0de7716a9ed3
--- /dev/null
+++ b/include/registry/refltype.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 _REGISTRY_REFLTYPE_HXX_
+#define _REGISTRY_REFLTYPE_HXX_
+
+#include "registry/types.h"
+#include <sal/types.h>
+
+/** specifies the type source of a binary type blob.
+
+ Currently only RT_UNO_IDL type is used.
+ */
+enum RTTypeSource
+{
+ RT_UNO_IDL,
+ RT_CORBA_IDL,
+ RT_JAVA
+};
+
+/** specifies a helper class for const values.
+
+ This class is used for easy handling of constants or enum values
+ as fields in binary type blob.
+ */
+class RTConstValue
+{
+public:
+ /// stores the type of the constant value.
+ RTValueType m_type;
+ /// stores the value of the constant.
+ RTConstValueUnion m_value;
+
+ /// Default constructor.
+ RTConstValue()
+ : m_type(RT_TYPE_NONE)
+ {
+ m_value.aDouble = 0.0;
+ }
+
+ /// Destructor
+ ~RTConstValue() {}
+};
+
+/** deprecated.
+
+ An earlier version of UNO used an unique identifier for interfaces. In the
+ current version of UNO this uik was eliminated and this type is not longer used.
+ */
+struct RTUik
+{
+ sal_uInt32 m_Data1;
+ sal_uInt16 m_Data2;
+ sal_uInt16 m_Data3;
+ sal_uInt32 m_Data4;
+ sal_uInt32 m_Data5;
+};
+
+/// specifies the calling convention for type reader/writer api
+#define TYPEREG_CALLTYPE SAL_CALL
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/reflwrit.hxx b/include/registry/reflwrit.hxx
new file mode 100644
index 000000000000..8e84aa9b1483
--- /dev/null
+++ b/include/registry/reflwrit.hxx
@@ -0,0 +1,350 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _REGISTRY_REFLWRIT_HXX_
+#define _REGISTRY_REFLWRIT_HXX_
+
+#include <registry/regdllapi.h>
+#include <registry/refltype.hxx>
+#include <registry/regtype.h>
+#include <rtl/ustring.hxx>
+
+/// Implememetation handle
+typedef void* TypeWriterImpl;
+
+/****************************************************************************
+
+ C-Api
+
+*****************************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** specifies a collection of function pointers which represents the complete registry type writer C-API.
+
+ This funtions pointers are used by the C++ wrapper to call the C-API.
+*/
+struct RegistryTypeWriter_Api
+{
+ TypeWriterImpl (TYPEREG_CALLTYPE *createEntry) (RTTypeClass, rtl_uString*, rtl_uString*, sal_uInt16, sal_uInt16, sal_uInt16);
+ void (TYPEREG_CALLTYPE *acquire) (TypeWriterImpl);
+ void (TYPEREG_CALLTYPE *release) (TypeWriterImpl);
+ void (TYPEREG_CALLTYPE *setUik) (TypeWriterImpl, const RTUik*);
+ void (TYPEREG_CALLTYPE *setDoku) (TypeWriterImpl, rtl_uString*);
+ void (TYPEREG_CALLTYPE *setFileName) (TypeWriterImpl, rtl_uString*);
+ void (TYPEREG_CALLTYPE *setFieldData) (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, rtl_uString*, rtl_uString*, RTFieldAccess, RTValueType, RTConstValueUnion);
+ void (TYPEREG_CALLTYPE *setMethodData) (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, RTMethodMode, sal_uInt16, sal_uInt16, rtl_uString*);
+ void (TYPEREG_CALLTYPE *setParamData) (TypeWriterImpl, sal_uInt16, sal_uInt16, rtl_uString*, rtl_uString*, RTParamMode);
+ void (TYPEREG_CALLTYPE *setExcData) (TypeWriterImpl, sal_uInt16, sal_uInt16, rtl_uString*);
+ const sal_uInt8* (TYPEREG_CALLTYPE *getBlop) (TypeWriterImpl);
+ sal_uInt32 (TYPEREG_CALLTYPE *getBlopSize) (TypeWriterImpl);
+
+ void (TYPEREG_CALLTYPE *setReferenceData) (TypeWriterImpl, sal_uInt16, rtl_uString*, RTReferenceType, rtl_uString*, RTFieldAccess);
+};
+
+/** the API initialization function.
+*/
+REG_DLLPUBLIC RegistryTypeWriter_Api* TYPEREG_CALLTYPE initRegistryTypeWriter_Api(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+/** RegistryTypeWriter writes/creates a binary type blob.
+
+ This class provides the necessary functions to write type information
+ for all kinds of types into a blob.
+ The class is inline and use a C-Api.
+
+ @deprecated
+ use typereg::Writer instead
+*/
+class RegistryTypeWriter
+{
+public:
+
+ /** Constructor.
+
+ @param RTTypeClass specifies the type of the new blob.
+ @param typeName specifies the full qualified type name with '/' as separator.
+ @param superTypeName specifies the full qualified type name of the base type
+ with '/' as separator.
+ @param fieldCount specifies the number of fields (eg. number of attrbutes/properties,
+ enum values or constants).
+ @param methodCount specifies the number of methods.
+ @param referenceCount specifies the number of references (eg. number of supported interfaces,
+ exported services ...)
+ */
+ inline RegistryTypeWriter(RTTypeClass RTTypeClass,
+ const OUString& typeName,
+ const OUString& superTypeName,
+ sal_uInt16 fieldCount,
+ sal_uInt16 methodCount,
+ sal_uInt16 referenceCount);
+
+ /// Copy constructcor
+ inline RegistryTypeWriter(const RegistryTypeWriter& toCopy);
+
+ /** Destructor. The Destructor frees the internal data block.
+
+ The pointer (returned by getBlop) will be set to NULL.
+ */
+ inline ~RegistryTypeWriter();
+
+ /// Assign operator
+ inline RegistryTypeWriter& operator == (const RegistryTypeWriter& toAssign);
+
+ /** @deprecated
+ sets the unique identifier for an interface type.
+
+ An earlier version of UNO used an unique identifier for interfaces. In the
+ current version of UNO this uik was eliminated and this function is
+ not longer used.
+ */
+ inline void setUik(const RTUik& uik);
+
+ /** sets a documentation string for the type.
+
+ This documentation should be the same as the documentation which is provided
+ for this type in IDL.
+ */
+ inline void setDoku(const OUString& doku);
+
+ /** sets the IDL filename where this type is defined.
+ */
+ inline void setFileName(const OUString& fileName);
+
+ /** sets the data for a field member of a type blob.
+
+ @param index indicates the index of the field.
+ @param name specifies the name.
+ @param typeName specifies the full qualified typename.
+ @param doku specifies the documentation string of the field.
+ @param fileName specifies the name of the IDL file where the field is defined.
+ @param access specifies the access mode of the field.
+ @param constValue specifies the value of the field. The value is only interesting
+ for enum values or constants.
+ */
+ inline void setFieldData( sal_uInt16 index,
+ const OUString& name,
+ const OUString& typeName,
+ const OUString& doku,
+ const OUString& fileName,
+ RTFieldAccess access,
+ RTConstValue constValue = RTConstValue());
+
+ /** sets the data for a method.
+
+ @param index indicates the index of the method.
+ @param name specifies the name.
+ @param returnTypeName specifies the full qualified return typename.
+ @param mode specifies the method mode.
+ @param paramCount specifies the number of parameters.
+ @param excCount specifies the number of exceptions.
+ @param doku specifies the documentation string of the field.
+ */
+ inline void setMethodData(sal_uInt16 index,
+ const OUString& name,
+ const OUString& returnTypeName,
+ RTMethodMode mode,
+ sal_uInt16 paramCount,
+ sal_uInt16 excCount,
+ const OUString& doku);
+
+ /** sets the data for the specified parameter of a method.
+
+ @param index indicates the index of the method.
+ @param paramIndex specifies the index of the parameter.
+ @param type specifies the full qualified typename.
+ @param name specifies the name.
+ @param mode specifies the parameter mode.
+ */
+ inline void setParamData(sal_uInt16 index,
+ sal_uInt16 paramIndex,
+ const OUString& type,
+ const OUString& name,
+ RTParamMode mode);
+
+ /** sets the data for the specified exception of a mehtod.
+
+ @param index indicates the index of the method.
+ @param excIndex specifies the index of the exception.
+ @param type specifies the full qualified typename of the exception.
+ */
+ inline void setExcData(sal_uInt16 index,
+ sal_uInt16 excIndex,
+ const OUString& type);
+
+ /** returns a pointer to the new type blob.
+
+ The pointer will be invalid (NULL) if the instance of
+ the RegistryTypeWriter will be destroyed.
+ */
+ inline const sal_uInt8* getBlop();
+
+ /** returns the size of the new type blob in bytes.
+ */
+ inline sal_uInt32 getBlopSize();
+
+ /** sets the data for a reference member.
+
+ @param index indicates the index of the reference.
+ @param name specifies the name.
+ @param refType specifies the full qualified typename of the reference.
+ @param doku specifies the documentation string of the reference.
+ @param access specifies the access mode of the reference.
+ */
+ inline void setReferenceData( sal_uInt16 index,
+ const OUString& name,
+ RTReferenceType refType,
+ const OUString& doku,
+ RTFieldAccess access = RT_ACCESS_INVALID);
+
+protected:
+
+ /// stores the registry type writer Api.
+ const RegistryTypeWriter_Api* m_pApi;
+ /// stores the handle of an implementation class
+ TypeWriterImpl m_hImpl;
+};
+
+
+
+inline RegistryTypeWriter::RegistryTypeWriter(RTTypeClass RTTypeClass,
+ const OUString& typeName,
+ const OUString& superTypeName,
+ sal_uInt16 fieldCount,
+ sal_uInt16 methodCount,
+ sal_uInt16 referenceCount)
+ : m_pApi(initRegistryTypeWriter_Api())
+ , m_hImpl(NULL)
+{
+ m_hImpl = m_pApi->createEntry(RTTypeClass,
+ typeName.pData,
+ superTypeName.pData,
+ fieldCount,
+ methodCount,
+ referenceCount);
+}
+
+
+inline RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriter& toCopy)
+ : m_pApi(toCopy.m_pApi)
+ , m_hImpl(toCopy.m_hImpl)
+{
+ m_pApi->acquire(m_hImpl);
+}
+
+inline RegistryTypeWriter::~RegistryTypeWriter()
+{
+ m_pApi->release(m_hImpl);
+}
+
+inline RegistryTypeWriter& RegistryTypeWriter::operator == (const RegistryTypeWriter& toAssign)
+{
+ if (m_hImpl != toAssign.m_hImpl)
+ {
+ m_pApi->release(m_hImpl);
+ m_hImpl = toAssign.m_hImpl;
+ m_pApi->acquire(m_hImpl);
+ }
+
+ return *this;
+}
+
+inline void RegistryTypeWriter::setFieldData( sal_uInt16 index,
+ const OUString& name,
+ const OUString& typeName,
+ const OUString& doku,
+ const OUString& fileName,
+ RTFieldAccess access,
+ RTConstValue constValue)
+{
+ m_pApi->setFieldData(m_hImpl, index, name.pData, typeName.pData, doku.pData, fileName.pData, access, constValue.m_type, constValue.m_value);
+}
+
+
+inline void RegistryTypeWriter::setMethodData(sal_uInt16 index,
+ const OUString& name,
+ const OUString& returnTypeName,
+ RTMethodMode mode,
+ sal_uInt16 paramCount,
+ sal_uInt16 excCount,
+ const OUString& doku)
+{
+ m_pApi->setMethodData(m_hImpl, index, name.pData, returnTypeName.pData, mode, paramCount, excCount, doku.pData);
+}
+
+
+inline void RegistryTypeWriter::setUik(const RTUik& uik)
+{
+ m_pApi->setUik(m_hImpl, &uik);
+}
+
+inline void RegistryTypeWriter::setDoku(const OUString& doku)
+{
+ m_pApi->setDoku(m_hImpl, doku.pData);
+}
+
+inline void RegistryTypeWriter::setFileName(const OUString& doku)
+{
+ m_pApi->setFileName(m_hImpl, doku.pData);
+}
+
+inline void RegistryTypeWriter::setParamData(sal_uInt16 index,
+ sal_uInt16 paramIndex,
+ const OUString& type,
+ const OUString& name,
+ RTParamMode mode)
+{
+ m_pApi->setParamData(m_hImpl, index, paramIndex, type.pData, name.pData, mode);
+}
+
+inline void RegistryTypeWriter::setExcData(sal_uInt16 index,
+ sal_uInt16 excIndex,
+ const OUString& type)
+{
+ m_pApi->setExcData(m_hImpl, index, excIndex, type.pData);
+}
+
+inline const sal_uInt8* RegistryTypeWriter::getBlop()
+{
+ return m_pApi->getBlop(m_hImpl);
+}
+
+inline sal_uInt32 RegistryTypeWriter::getBlopSize()
+{
+ return m_pApi->getBlopSize(m_hImpl);
+}
+
+
+inline void RegistryTypeWriter::setReferenceData( sal_uInt16 index,
+ const OUString& name,
+ RTReferenceType refType,
+ const OUString& doku,
+ RTFieldAccess access)
+{
+ m_pApi->setReferenceData(m_hImpl, index, name.pData, refType, doku.pData, access);
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/regdllapi.h b/include/registry/regdllapi.h
new file mode 100644
index 000000000000..5116a7062d24
--- /dev/null
+++ b/include/registry/regdllapi.h
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_REGDLLAPI_H
+#define INCLUDED_REGDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(REG_DLLIMPLEMENTATION)
+#define REG_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define REG_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif /* INCLUDED_REGDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/registry.h b/include/registry/registry.h
new file mode 100644
index 000000000000..030e1a12a5de
--- /dev/null
+++ b/include/registry/registry.h
@@ -0,0 +1,456 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _REGISTRY_REGISTRY_H_
+#define _REGISTRY_REGISTRY_H_
+
+#include <stddef.h>
+#include <rtl/ustring.h>
+#include <registry/regtype.h>
+#include <registry/regdllapi.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/** This function creates the specified key.
+
+ If the key already exists in the registry, the function opens the key only.
+ @param hKey identifies a currently open key. The key which will be opened or created by this
+ function is a subkey of the key identified by hKey.
+ @param keyName points to a null terminated string specifying the name of a key.
+ @param phNewKey points to a variable that receives the handle of the opened or created key.
+ The memory to store this variable will be allocated and will be freed by the function
+ reg_closeKey. If the function fails, phNewKey is NULL.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_createKey(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ RegKeyHandle* phNewKey);
+
+
+/** This function opens the specified key.
+
+ @param hKey identifies a currently open key. The key which will be opened by this function
+ is a subkey of the key identified by hKey
+ @param keyName points to a null terminated string specifying the name of a key.
+ @param phOpenKey points to a variable that receives the handle of the opened key.
+ The memory to store this variable will be allocated and will be freed by the function
+ reg_closeKey. If the function fails, phNewKey is NULL.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_openKey(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ RegKeyHandle* phOpenKey);
+
+
+
+/** This function opens all subkeys of the specified key.
+
+ @param hKey identifies a currently open key. The key that subkeys will be opened by this
+ function is a subkey of the key identified by hKey
+ @param keyName points to a null terminated string specifying the name of a key whose subkeys
+ will be opened.
+ @param pphSubKeys points to a variable that receives an array of all opened subkeys.
+ The memory to store this variable will be allocated and will be freed by the function
+ reg_closeSubKeys. If the function fails, pphSubKeys is NULL.
+ @param pnSubKeys specifies the length of the array (the number of open subkeys).
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_openSubKeys(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ RegKeyHandle** pphSubKeys,
+ sal_uInt32* pnSubKeys);
+
+
+/** This function closes all subkeys specified in the array.
+
+ @param phSubKeys points to a variable that containss an array of all opened subkeys.
+ The allocated memory of pphSubKeys and all open subkeys will be freed.
+ @param nSubKeys specifies the length of the array (the number of subkeys to closed).
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_closeSubKeys(RegKeyHandle* phSubKeys,
+ sal_uInt32 nSubKeys);
+
+
+/** This function deletes the specified key.
+
+ @param hKey identifies a currently open key. The key deleted by this function
+ is a subkey of the key identified by hKey
+ @param keyName points to a null terminated string specifying the name of a key which will
+ be deleted.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_deleteKey(RegKeyHandle hKey,
+ rtl_uString* keyName);
+
+
+/** This function closes the specified key.
+
+ @param hKey identifies a currently open key which will be closed by this function.
+ The memory of the variable specifying the key will be freed.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_closeKey(RegKeyHandle hKey);
+
+
+/** This function returns the name of a key.
+
+ @param hKey identifies a currently open key which name will be returned.
+ @param pKeyName contains the keyname if succeeds else an empty string.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_getKeyName(RegKeyHandle hKey, rtl_uString** pKeyName);
+
+
+/** This function sets a value of a key.
+
+ @param hKey identifies a currently open key. The key which value will be set by this
+ function is a subkey of the key identified by hKey.
+ @param keyName points to a null terminated string specifying the name of a key which value
+ will be set. If keyName is NULL, then the value of the key specified by
+ hKey will be set.
+ @param valueType specifies the type of the value.
+ @param pData points to a memory block containing the data of the value.
+ @param valueSize specifies the size of pData in bytes
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_setValue(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ RegValueType valueType,
+ RegValue pData,
+ sal_uInt32 valueSize);
+
+
+/** This function sets an long list value of a key.
+
+ @param[in] hKey identifies a currently open key. The key which value will be set by this
+ function is a subkey of the key identified by hKey.
+ @param[in] keyName points to a null terminated string specifying the name of a key which value
+ will be set. If keyName is NULL, then the value of the key specified by
+ hKey will be set.
+ @param[out] pValueList points to an array of longs containing the data of the value.
+ @param[out] len specifies the len of pValueList.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_setLongListValue(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ sal_Int32* pValueList,
+ sal_uInt32 len);
+
+
+/** This function sets an ascii list value of a key.
+
+ @param[in] hKey identifies a currently open key. The key which value will be set by this
+ function is a subkey of the key identified by hKey.
+ @param[in] keyName points to a null terminated string specifying the name of a key which value
+ will be set. If keyName is NULL, then the value of the key specified by
+ hKey will be set.
+ @param[in] pValueList points to an array of sal_Char* containing the data of the value.
+ @param[in] len specifies the len of pValueList.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_setStringListValue(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ sal_Char** pValueList,
+ sal_uInt32 len);
+
+
+/** This function sets an unicode string list value of a key.
+
+ @param[in] hKey identifies a currently open key. The key which value will be set by this
+ function is a subkey of the key identified by hKey.
+ @param[in] keyName points to a null terminated string specifying the name of a key which value
+ will be set. If keyName is NULL, then the value of the key specified by
+ hKey will be set.
+ @param[in] pValueList points to an array of sal_Unicode* containing the data of the value.
+ @param[in] len specifies the len of pValueList.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_setUnicodeListValue(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ sal_Unicode** pValueList,
+ sal_uInt32 len);
+
+
+/** This function gets info about type and size of a key value.
+
+ @param hKey identifies a currently open key. The key which value info will be got by this
+ function is a subkey of the key identified by hKey.
+ @param keyName points to a null terminated string specifying the name of a key which value
+ will be got. If keyName is NULL, then the value info of the key specified by
+ hKey will be got.
+ @param pValueType returns the type of the value.
+ @param pValueSize returns the size of the value in bytes
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_getValueInfo(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ RegValueType* pValueType,
+ sal_uInt32* pValueSize);
+
+
+/** This function gets the value of a key.
+
+ @param hKey identifies a currently open key. The key which value will be got by this
+ function is a subkey of the key identified by hKey.
+ @param keyName points to a null terminated string specifying the name of a key which value
+ will be got. If keyName is NULL, then the value of the key specified by
+ hKey will be got.
+ @param pData points to an allocated memory block receiving the data of the value.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_getValue(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ RegValue pData);
+
+
+/** This function gets the long list value of a key.
+
+ @param[in] hKey identifies a currently open key. The key which value will be got by this
+ function is a subkey of the key identified by hKey.
+ @param[in] keyName points to a null terminated string specifying the name of a key which value
+ will be got. If keyName is NULL, then the value of the key specified by
+ hKey will be got.
+ @param[out] pValueList a Pointer to a long value list which returns the data of the value.
+ @param[out] pLen returns the length of the value list.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_getLongListValue(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ sal_Int32** pValueList,
+ sal_uInt32* pLen);
+
+
+/** This function gets the string list value of a key.
+
+ @param[in] hKey identifies a currently open key. The key whose value will be retrived by this
+ function is a subkey of the key identified by hKey.
+ @param[in] keyName points to a null terminated string specifying the name of a key whose value
+ will be retrived. If keyName is NULL, then the value of the key specified by
+ hKey will be retrived.
+ @param[out] pValueList a Pointer to an ascii value list which returns the data of the value.
+ @param[out] pLen returns the length of the value list.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_getStringListValue(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ sal_Char*** pValueList,
+ sal_uInt32* pLen);
+
+
+/** This function gets the unicode list value of a key.
+
+ @param[in] hKey identifies a currently open key. The key whose value will be retrived by this
+ function is a subkey of the key identified by hKey.
+ @param[in] keyName points to a null terminated string specifying the name of a key whose value
+ will be retrived. If keyName is NULL, then the value of the key specified by
+ hKey will be retrived.
+ @param[out] pValueList a Pointer to an unicode value list which returns the data of the value.
+ @param[out] pLen returns the length of the value list.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_getUnicodeListValue(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ sal_Unicode*** pValueList,
+ sal_uInt32* pLen);
+
+
+/** This function frees the memory of a value list.
+
+ @param valueType specifies the type of the list values.
+ @param pValueList a Pointer to the value list.
+ @param len specifies the length of the value list.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_freeValueList(RegValueType valueType,
+ RegValue pValueList,
+ sal_uInt32 len);
+
+/** This function returns the type of a key.
+
+ The registry differentiates two possible types:
+ - RG_KEYTYPE represents a real key
+ - RG_LINKTYPE used to represent a link (no longer used)
+ @param[in] hKey identifies a currently open key. The key specified by keyName is a subkey
+ of the key identified by hKey.
+ @param[in] keyName points to a null terminated string specifying the name of the key which keytype
+ will be returned.
+ @param[out] pKeyType returns the type of the key.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_getKeyType(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ RegKeyType* pKeyType);
+
+/** This function resolves a keyname.
+
+ @param[in] hKey identifies a currently open key. The key specified by keyName is a subkey
+ of the key identified by hKey.
+ @param[in] keyName points to a null terminated string specifying the relativ name of a key.
+ The name of hKey together with keyName will be generated.
+ @param[in] firstLinkOnly ignored
+ @param[out] pResolvedName returns the resolved keyName.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_getResolvedKeyName(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ sal_Bool firstLinkOnly,
+ rtl_uString** pResolvedName);
+
+/** This function loads registry information from a file and save it under the
+ specified keyName.
+
+ @param hKey identifies a currently open key. The key which should store the registry information
+ is a subkey of this key.
+ @param keyName points to a null terminated string specifying the name of the key which stores the
+ registry information. If keyName is NULL the registry information will be saved under
+ the key specified by hKey.
+ @param regFileName points to a null terminated string specifying the file which conains the
+ registry information.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_loadKey(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ rtl_uString* regFileName);
+
+
+/** This function saves the registry information under a specified key and all of its subkeys and save
+ it in a registry file.
+
+ @param hKey identifies a currently open key. The key which information is saved by this
+ function is a subkey of the key identified by hKey.
+ @param keyName points to a null terminated string specifying the name of the subkey.
+ If keyName is NULL the registry information under the key specified by hKey
+ will be saved in the specified file.
+ @param regFileName points to a null terminated string specifying the file which will contain the
+ registry information.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_saveKey(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ rtl_uString* regFileName);
+
+
+/** This function merges the registry information from a specified source with the information of the
+ currently open registry.
+
+ All existing keys will be extended and existing key values will be overwritten.
+ @param hKey identifies a currently open key. The key which information is merged by this
+ function is a subkey of the key identified by hKey.
+ @param keyName points to a null terminated string specifying the name of the key which will be merged.
+ If keyName is NULL the registry information under the key specified by hKey
+ is merged with the complete information from the specified file.
+ @param regFileName points to a null terminated string specifying the file containing the
+ registry information.
+ @param bWarnings if TRUE the function returns an error if a key already exists.
+ @param bReport if TRUE the function reports warnings on stdout if a key already exists.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_mergeKey(RegKeyHandle hKey,
+ rtl_uString* keyName,
+ rtl_uString* regFileName,
+ sal_Bool bWarnings,
+ sal_Bool bReport);
+
+
+/** This function creates a new registry with the specified name and creates a root key.
+
+ @param registryName points to a null terminated string specifying the name of the new registry.
+ @param phRegistry points to a handle of the new registry if the function succeeds otherwise NULL.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_createRegistry(rtl_uString* registryName,
+ RegHandle* phRegistry);
+
+
+/** This function opens the root key of a registry.
+
+ @param hRegistry identifies a currently open registry whose rootKey will be returned.
+ @param phRootKey points to a handle of the open root key if the function succeeds otherwise NULL.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_openRootKey(RegHandle hRegistry,
+ RegKeyHandle* phRootKey);
+
+
+/** This function returns the name of a registry.
+
+ @param hRegistry identifies a currently open registry whose name will be returned.
+ @param pName returns the name of the registry if the function succeeds otherwise an empty string.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_getName(RegHandle hRegistry, rtl_uString** pName);
+
+
+/** This function returns the access mode of the registry.
+
+ @param hReg identifies a currently open registry.
+ @return TRUE if accessmode is read only else FALSE.
+*/
+REG_DLLPUBLIC sal_Bool REGISTRY_CALLTYPE reg_isReadOnly(RegHandle hReg);
+
+
+/** This function opens a registry with the specified name.
+
+ @param registryName points to a null terminated string specifying the name of the registry.
+ @param phRegistry points to a hanle of the opened registry if the function succeeds otherwise NULL.
+ @param accessMode specifies the accessmode of the registry, REG_READONLY or REG_READWRITE.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_openRegistry(rtl_uString* registryName,
+ RegHandle* phRegistry,
+ RegAccessMode accessMode);
+
+
+/** This function closes a registry.
+
+ @param hRegistry identifies a currently open registry which should be closed.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_closeRegistry(RegHandle hRegistry);
+
+
+/** This function destroys a registry.
+
+ @param hRegistry identifies a currently open registry.
+ @param registryName specifies a registry name of a registry which should be destroyed. If the
+ name is NULL the registry itselfs will be destroyed.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_destroyRegistry(RegHandle hRegistry,
+ rtl_uString* registryName);
+
+
+/** This function reports the complete registry information of a key and all of its subkeys.
+
+ All information which are available (keynames, value types, values, ...)
+ will be printed to stdout for report issues only.
+ @param hKey identifies a currently open key which content will be reported.
+ @return REG_NO_ERROR if succeeds else an error code.
+*/
+REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_dumpRegistry(RegKeyHandle hKey);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/registry.hxx b/include/registry/registry.hxx
new file mode 100644
index 000000000000..d165c594adff
--- /dev/null
+++ b/include/registry/registry.hxx
@@ -0,0 +1,1257 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _REGISTRY_REGISTRY_HXX_
+#define _REGISTRY_REGISTRY_HXX_
+
+#include <registry/regdllapi.h>
+#include <registry/regtype.h>
+#include <rtl/ustring.hxx>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** specifies a collection of function pointers which represents the complete registry C-API.
+
+ This funtions pointers are used by the C++ wrapper to call the C-API.
+*/
+struct Registry_Api
+{
+ void (REGISTRY_CALLTYPE *acquire) (RegHandle);
+ void (REGISTRY_CALLTYPE *release) (RegHandle);
+ sal_Bool (REGISTRY_CALLTYPE *isReadOnly) (RegHandle);
+ RegError (REGISTRY_CALLTYPE *openRootKey) (RegHandle, RegKeyHandle*);
+ RegError (REGISTRY_CALLTYPE *getName) (RegHandle, rtl_uString**);
+ RegError (REGISTRY_CALLTYPE *createRegistry) (rtl_uString*, RegHandle*);
+ RegError (REGISTRY_CALLTYPE *openRegistry) (rtl_uString*, RegHandle*, RegAccessMode);
+ RegError (REGISTRY_CALLTYPE *closeRegistry) (RegHandle);
+ RegError (REGISTRY_CALLTYPE *destroyRegistry) (RegHandle, rtl_uString*);
+ RegError (REGISTRY_CALLTYPE *loadKey) (RegHandle, RegKeyHandle, rtl_uString*, rtl_uString*);
+ RegError (REGISTRY_CALLTYPE *saveKey) (RegHandle, RegKeyHandle, rtl_uString*, rtl_uString*);
+ RegError (REGISTRY_CALLTYPE *mergeKey) (RegHandle, RegKeyHandle, rtl_uString*, rtl_uString*, sal_Bool, sal_Bool);
+ RegError (REGISTRY_CALLTYPE *dumpRegistry) (RegHandle, RegKeyHandle);
+ void (REGISTRY_CALLTYPE *acquireKey) (RegKeyHandle);
+ void (REGISTRY_CALLTYPE *releaseKey) (RegKeyHandle);
+ sal_Bool (REGISTRY_CALLTYPE *isKeyReadOnly) (RegKeyHandle);
+ RegError (REGISTRY_CALLTYPE *getKeyName) (RegKeyHandle, rtl_uString**);
+ RegError (REGISTRY_CALLTYPE *createKey) (RegKeyHandle, rtl_uString*, RegKeyHandle*);
+ RegError (REGISTRY_CALLTYPE *openKey) (RegKeyHandle, rtl_uString*, RegKeyHandle*);
+ RegError (REGISTRY_CALLTYPE *openSubKeys) (RegKeyHandle, rtl_uString*, RegKeyHandle**, sal_uInt32*);
+ RegError (REGISTRY_CALLTYPE *closeSubKeys) (RegKeyHandle*, sal_uInt32);
+ RegError (REGISTRY_CALLTYPE *deleteKey) (RegKeyHandle, rtl_uString*);
+ RegError (REGISTRY_CALLTYPE *closeKey) (RegKeyHandle);
+ RegError (REGISTRY_CALLTYPE *setValue) (RegKeyHandle, rtl_uString*, RegValueType, RegValue, sal_uInt32);
+ RegError (REGISTRY_CALLTYPE *setLongListValue) (RegKeyHandle, rtl_uString*, sal_Int32*, sal_uInt32);
+ RegError (REGISTRY_CALLTYPE *setStringListValue) (RegKeyHandle, rtl_uString*, sal_Char**, sal_uInt32);
+ RegError (REGISTRY_CALLTYPE *setUnicodeListValue)(RegKeyHandle, rtl_uString*, sal_Unicode**, sal_uInt32);
+ RegError (REGISTRY_CALLTYPE *getValueInfo) (RegKeyHandle, rtl_uString*, RegValueType*, sal_uInt32*);
+ RegError (REGISTRY_CALLTYPE *getValue) (RegKeyHandle, rtl_uString*, RegValue);
+ RegError (REGISTRY_CALLTYPE *getLongListValue) (RegKeyHandle, rtl_uString*, sal_Int32**, sal_uInt32*);
+ RegError (REGISTRY_CALLTYPE *getStringListValue) (RegKeyHandle, rtl_uString*, sal_Char***, sal_uInt32*);
+ RegError (REGISTRY_CALLTYPE *getUnicodeListValue)(RegKeyHandle, rtl_uString*, sal_Unicode***, sal_uInt32*);
+ RegError (REGISTRY_CALLTYPE *freeValueList) (RegValueType, RegValue, sal_uInt32);
+ RegError (REGISTRY_CALLTYPE *createLink) (RegKeyHandle, rtl_uString*, rtl_uString*);
+ RegError (REGISTRY_CALLTYPE *deleteLink) (RegKeyHandle, rtl_uString*);
+ RegError (REGISTRY_CALLTYPE *getKeyType) (RegKeyHandle, rtl_uString*, RegKeyType*);
+ RegError (REGISTRY_CALLTYPE *getLinkTarget) (RegKeyHandle, rtl_uString*, rtl_uString**);
+ RegError (REGISTRY_CALLTYPE *getResolvedKeyName) (RegKeyHandle, rtl_uString*, sal_Bool, rtl_uString**);
+ RegError (REGISTRY_CALLTYPE *getKeyNames) (RegKeyHandle, rtl_uString*, rtl_uString***, sal_uInt32*);
+ RegError (REGISTRY_CALLTYPE *freeKeyNames) (rtl_uString**, sal_uInt32);
+};
+
+/** the API initialization function.
+*/
+REG_DLLPUBLIC Registry_Api* REGISTRY_CALLTYPE initRegistry_Api(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+class RegistryKey;
+
+//-----------------------------------------------------------------------------
+
+/** The Registry provides the functionality to read and write information in a registry file.
+
+ The class is implemented inline and use a C-Api.
+*/
+class Registry
+{
+public:
+ /** Default constructor.
+ */
+ inline Registry();
+
+ /// Copy constructcor
+ inline Registry(const Registry& toCopy);
+
+ /// Destructor. The Destructor close the registry if it is open.
+ inline ~Registry();
+
+ /// Assign operator
+ inline Registry& operator = (const Registry& toAssign);
+
+ /// checks if the registry points to a valid registry data file.
+ inline sal_Bool isValid() const;
+
+ /** returns the access mode of the registry.
+
+ @return TRUE if the access mode is readonly else FALSE.
+ */
+ inline sal_Bool isReadOnly() const;
+
+ /** opens the root key of the registry.
+
+ @param rRootKey reference to a RegistryKey which is filled with the rootkey.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError openRootKey(RegistryKey& rRootKey);
+
+ /// returns the name of the current registry data file.
+ inline OUString getName();
+
+ /** creates a new registry with the specified name and creates a root key.
+
+ @param registryName specifies the name of the new registry.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError create(const OUString& registryName);
+
+ /** opens a registry with the specified name.
+
+ If the registry already points to a valid registry, the old registry will be closed.
+ @param registryName specifies a registry name.
+ @param accessMode specifies the access mode for the registry, REG_READONLY or REG_READWRITE.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError open(const OUString& registryName,
+ RegAccessMode accessMode);
+
+ /// closes explicitly the current registry data file.
+ inline RegError close();
+
+ /** destroys a registry.
+
+ @param registryName specifies a registry name, if the name is an empty string the registry
+ itselfs will be destroyed.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError destroy(const OUString& registryName);
+
+ /** loads registry information from a specified file and save it under the
+ specified keyName.
+
+ @param rKey references a currently open key. The key which should store the registry information
+ is a subkey of this key.
+ @param keyName specifies the name of the key which stores the registry information. If keyName is
+ is an empty string the registry information will be saved under the key specified
+ by rKey.
+ @param regFileName specifies the file containing the registry information.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError loadKey(RegistryKey& rKey,
+ const OUString& keyName,
+ const OUString& regFileName);
+
+ /** saves the registry information of the specified key and all subkeys and save
+ it in the specified file.
+
+ @param rKey references a currently open key. The key which information is saved by this
+ function is a subkey of this key.
+ @param keyName specifies the name of the key which information should be stored.
+ If keyName is an empty string the registry information under the key specified
+ by rKey is saved in the specified file.
+ @param regFileName specifies the file containing the registry information.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError saveKey(RegistryKey& rKey,
+ const OUString& keyName,
+ const OUString& regFileName);
+
+ /** merges the registry information of the specified key with the registry
+ information of the specified file.
+
+ All existing keys will be extended and existing key values will be overwritten.
+ @param rKey references a currently open key. The key which information is merged by this
+ function is a subkey of this key
+ @param keyName specifies the name of the key which will be merged.
+ If keyName is an empty string the registry information under the key specified
+ by rKey is merged with the information from the specified file.
+ @param regFileName specifies the file containing the registry information.
+ @param bWarnings if TRUE the function returns an error if a key already exists.
+ @param bReport if TRUE the function reports warnings on stdout if a key already exists.
+ @return REG_NO_ERROR if succeeds else an error code. If it returns an error the registry will
+ restore the state before merging.
+ */
+ inline RegError mergeKey(RegistryKey& rKey,
+ const OUString& keyName,
+ const OUString& regFileName,
+ sal_Bool bWarnings = sal_False,
+ sal_Bool bReport = sal_False);
+
+ /** This function reports the complete registry information of a key and all of its subkeys.
+
+ All information which are available (keynames, value types, values, ...)
+ will be printed to stdout for report issues only.
+ @param rKey references a currently open key which content will be reported.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError dumpRegistry(RegistryKey& rKey);
+
+ friend class RegistryKey;
+ friend class RegistryKeyArray;
+ friend class RegistryKeyNames;
+
+ /// returns the used registry Api.
+ const Registry_Api* getApi() { return m_pApi; }
+protected:
+
+ /// stores the used and initialized registry Api.
+ const Registry_Api* m_pApi;
+ /// stores the handle of the underlying registry file on which most of the functions work.
+ RegHandle m_hImpl;
+};
+
+
+//-----------------------------------------------------------------------------
+
+/** RegistryKeyArray represents an array of open keys.
+
+ RegistryKeyArray is a helper class to work with an array of keys.
+*/
+class RegistryKeyArray
+{
+public:
+ /// Default constructor
+ inline RegistryKeyArray();
+
+ /// Destructor, all subkeys will be closed.
+ inline ~RegistryKeyArray();
+
+ /// returns the open key specified by index.
+ inline RegistryKey getElement(sal_uInt32 index);
+
+ /// returns the length of the array.
+ inline sal_uInt32 getLength();
+
+ friend class RegistryKey;
+protected:
+ /** sets the data of the key array.
+
+ @param registry specifies the registry files where the keys are located.
+ @param phKeys points to an array of open keys.
+ @param length specifies the length of the array specified by phKeys.
+ */
+ inline void setKeyHandles(Registry& registry, RegKeyHandle* phKeys, sal_uInt32 length);
+ /// close all subkeys
+ inline RegError closeKeyHandles();
+
+ /// stores the number of open subkeys, the number of elements.
+ sal_uInt32 m_length;
+ /// stores an array of open subkeys.
+ RegKeyHandle* m_phKeys;
+ /// stores the handle to the registry file where the appropriate keys are located.
+ Registry m_registry;
+};
+
+
+/** RegistryKeyNames represents an array of key names.
+
+ RegistryKeyNames is a helper class to work with an array of key names.
+*/
+class RegistryKeyNames
+{
+public:
+ /// Default constructor
+ inline RegistryKeyNames();
+
+ /// Destructor, the internal array with key names will be deleted.
+ inline ~RegistryKeyNames();
+
+ /// returns the name of the key sepecified by index.
+ inline OUString getElement(sal_uInt32 index);
+
+ /// returns the length of the array.
+ inline sal_uInt32 getLength();
+
+ friend class RegistryKey;
+protected:
+ /** sets the data of the array.
+
+ @param registry specifies the registry files where the keys are located.
+ @param pKeyNames points to an array of key names.
+ @param length specifies the length of the array specified by pKeyNames.
+ */
+ inline void setKeyNames(Registry& registry, rtl_uString** pKeyNames, sal_uInt32 length);
+ /// delete the array of key names.
+ inline RegError freeKeyNames();
+
+ /// stores the number of key names, the number of elements.
+ sal_uInt32 m_length;
+ /// stores an array of key names.
+ rtl_uString** m_pKeyNames;
+ /// stores the handle to the registry file where the appropriate keys are located.
+ Registry m_registry;
+};
+
+//-----------------------------------------------------------------------------
+
+/** RegistryValueList represents a value list of the specified type.
+
+ RegistryValueList is a helper class to work with a list value.
+*/
+template<class ValueType>
+class RegistryValueList
+{
+public:
+ /// Default constructor
+ RegistryValueList()
+ : m_length(0)
+ , m_pValueList(NULL)
+ , m_valueType(RG_VALUETYPE_NOT_DEFINED)
+ {}
+
+ /// Destructor, the internal value list will be freed.
+ ~RegistryValueList()
+ {
+ if (m_pValueList)
+ {
+ m_registry.getApi()->freeValueList(m_valueType, m_pValueList, m_length);
+ }
+ }
+
+ /// returns the value of the list specified by index.
+ ValueType getElement(sal_uInt32 index)
+ {
+ if (m_registry.isValid() && index < m_length)
+ {
+ return m_pValueList[index];
+ } else
+ {
+ return 0;
+ }
+ }
+
+ /// returns the length of the list.
+ sal_uInt32 getLength()
+ {
+ return m_length;
+ }
+
+ friend class RegistryKey;
+protected:
+ /** sets the data of the value list.
+
+ @param registry specifies the registry files where the appropriate key is located.
+ @param valueType specifies the type of the list values.
+ @param pValueList points to a value list.
+ @param length specifies the length of the list.
+ */
+ void setValueList(Registry& registry, RegValueType valueType,
+ ValueType* pValueList, sal_uInt32 length)
+ {
+ m_length = length;
+ m_pValueList = pValueList;
+ m_valueType = valueType;
+ m_registry = registry;
+ }
+
+ /// stores the length of the list, the number of elements.
+ sal_uInt32 m_length;
+ /// stores the value list.
+ ValueType* m_pValueList;
+ /// stores the type of the list elements
+ RegValueType m_valueType;
+ /** stores the handle to the registry file where the appropriate key to this
+ value is located.
+ */
+ Registry m_registry;
+};
+
+//-----------------------------------------------------------------------------
+
+/** RegistryKey reads or writes information of the underlying key in a registry.
+
+ Class is inline and use a load on call C-Api.
+*/
+class RegistryKey
+{
+public:
+ /// Default constructor
+ inline RegistryKey();
+
+ /// Copy constructor
+ inline RegistryKey(const RegistryKey& toCopy);
+
+ /// Destructor, close the key if it references an open one.
+ inline ~RegistryKey();
+
+ /// Assign operator
+ inline RegistryKey& operator = (const RegistryKey& toAssign);
+
+ /// checks if the key points to a valid registry key.
+ inline sal_Bool isValid() const;
+
+ /** returns the access mode of the key.
+
+ @return TRUE if access mode is read only else FALSE.
+ */
+ inline sal_Bool isReadOnly() const;
+
+ /// returns the full qualified name of the key beginning with the rootkey.
+ inline OUString getName();
+
+ /** creates a new key or opens a key if the specified key already exists.
+
+ The specified keyname is relativ to this key.
+ @param keyName specifies the name of the key which will be opened or created.
+ @param rNewKey references a RegistryKey which will be filled with the new or open key.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError createKey(const OUString& keyName,
+ RegistryKey& rNewKey);
+
+ /** opens the specified key.
+
+ The specified keyname is relativ to this key.
+ @param keyName specifies the name of the key which will be opened.
+ @param rOpenKey references a RegistryKey which will be filled with the open key.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError openKey(const OUString& keyName,
+ RegistryKey& rOpenKey);
+
+ /** opens all subkeys of the specified key.
+
+ The specified keyname is relativ to this key.
+ @param keyName specifies the name of the key which subkeys will be opened.
+ @param rSubKeys reference a RegistryKeyArray which will be filled with the open subkeys.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError openSubKeys(const OUString& keyName,
+ RegistryKeyArray& rSubKeys);
+
+ /** returns an array with the names of all subkeys of the specified key.
+
+ The specified keyname is relativ to this key.
+ @param keyName specifies the name of the key which subkey names will be returned.
+ @param rSubKeyNames reference a RegistryKeyNames array which will be filled with the subkey names.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError getKeyNames(const OUString& keyName,
+ RegistryKeyNames& rSubKeyNames);
+
+ /** closes all keys specified in the array.
+
+ @param rSubKeys reference a RegistryKeyArray which contains the open keys.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError closeSubKeys(RegistryKeyArray& rSubKeys);
+
+ /** deletes the specified key.
+
+ @param keyName specifies the name of the key which will be deleted.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError deleteKey(const OUString& keyName);
+
+ /// closes explicitly the current key
+ inline RegError closeKey();
+
+ /// releases the current key
+ inline void releaseKey();
+
+ /** sets a value of a key.
+
+ @param keyName specifies the name of the key which value will be set.
+ If keyName is an empty string, the value will be set for the key
+ specified by hKey.
+ @param valueType specifies the type of the value.
+ @param pValue points to a memory block containing the data for the value.
+ @param valueSize specifies the size of pData in bytes
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError setValue(const OUString& keyName,
+ RegValueType valueType,
+ RegValue pValue,
+ sal_uInt32 valueSize);
+
+ /** sets a long list value of a key.
+
+ @param keyName specifies the name of the key which value will be set.
+ If keyName is an empty string, the value will be set for the key
+ specified by hKey.
+ @param pValueList points to an array of longs containing the data for the value.
+ @param len specifies the length of the list (the array referenced by pValueList).
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError setLongListValue(const OUString& keyName,
+ sal_Int32* pValueList,
+ sal_uInt32 len);
+
+ /** sets an ascii list value of a key.
+
+ @param keyName specifies the name of the key which value will be set.
+ If keyName is an empty string, the value will be set for the key
+ specified by hKey.
+ @param pValueList points to an array of sal_Char* containing the data for the value.
+ @param len specifies the length of the list (the array referenced by pValueList).
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError setStringListValue(const OUString& keyName,
+ sal_Char** pValueList,
+ sal_uInt32 len);
+
+ /** sets an unicode string list value of a key.
+
+ @param keyName specifies the name of the key which value will be set.
+ If keyName is an empty string, the value will be set for the key
+ specified by hKey.
+ @param pValueList points to an array of sal_Unicode* containing the data for the value.
+ @param len specifies the length of the list (the array referenced by pValueList).
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError setUnicodeListValue(const OUString& keyName,
+ sal_Unicode** pValueList,
+ sal_uInt32 len);
+
+ /** gets info about type and size of a value.
+
+ @param keyName specifies the name of the key which value info will be returned.
+ If keyName is an empty string, the value info of the key
+ specified by hKey will be returned.
+ @param pValueType returns the type of the value.
+ @param pValueSize returns the size of the value in bytes or the length of a list value.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError getValueInfo(const OUString& keyName,
+ RegValueType* pValueType,
+ sal_uInt32* pValueSize);
+
+ /** gets the value of a key.
+
+ @param keyName specifies the name of the key which value will be returned.
+ If keyName is an empty string, the value is get from the key
+ specified by hKey.
+ @param pValue points to an allocated memory block receiving the data of the value.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError getValue(const OUString& keyName,
+ RegValue pValue);
+
+ /** gets a long list value of a key.
+
+ @param keyName specifies the name of the key which value will be returned.
+ If keyName is an empty string, the value is get from the key
+ specified by hKey.
+ @param rValueList references a RegistryValueList which will be filled with the long values.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError getLongListValue(const OUString& keyName,
+ RegistryValueList<sal_Int32>& rValueList);
+
+ /** gets an ascii list value of a key.
+
+ @param keyName specifies the name of the key which value will be returned.
+ If keyName is an empty string, the value is get from the key
+ specified by hKey.
+ @param rValueList references a RegistryValueList which will be filled with the ascii values.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError getStringListValue(const OUString& keyName,
+ RegistryValueList<sal_Char*>& rValueList);
+
+ /** gets a unicode value of a key.
+
+ @param keyName specifies the name of the key which value will be returned.
+ If keyName is an empty string, the value is get from the key
+ specified by hKey.
+ @param rValueList reference a RegistryValueList which will be filled with the unicode values.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError getUnicodeListValue(const OUString& keyName,
+ RegistryValueList<sal_Unicode*>& rValueList);
+
+ /** used to create a link.
+
+ @deprecated Links are no longer supported.
+
+ @return REG_INVALID_LINK
+ */
+ inline RegError createLink(const OUString& linkName,
+ const OUString& linkTarget);
+
+ /** used to delete a link.
+
+ @deprecated Links are no longer supported.
+
+ @return REG_INVALID_LINK
+ */
+ inline RegError deleteLink(const OUString& linkName);
+
+ /** returns the type of the specified key.
+
+ @param name specifies the name of the key or link.
+ @param pKeyType returns the type of the key (always RG_KEYTYPE).
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError getKeyType(const OUString& name,
+ RegKeyType* pKeyType) const;
+
+ /** used to return the target of a link.
+
+ @deprecated Links are no longer supported.
+
+ @return REG_INVALID_LINK
+ */
+ inline RegError getLinkTarget(const OUString& linkName,
+ OUString& rLinkTarget) const;
+
+ /** resolves a keyname.
+
+ @param[in] keyName specifies the name of the key which will be resolved relative to this key.
+ The resolved name will be prefixed with the name of this key.
+ @param[in] firstLinkOnly ignored
+ @param[out] rResolvedName the resolved name.
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ inline RegError getResolvedKeyName(const OUString& keyName,
+ sal_Bool firstLinkOnly,
+ OUString& rResolvedName) const;
+
+ /// returns the name of the registry in which the key is defined.
+ inline OUString getRegistryName();
+
+ /// returns the registry in which the key is defined.
+ Registry getRegistry() const { return m_registry; }
+
+ friend class Registry;
+public:
+ /// @cond INTERNAL
+
+ /** Constructor, which initialize a RegistryKey with registry and an valid key handle.
+
+ This constructor is internal only.
+ */
+ inline RegistryKey(Registry& registry,
+ RegKeyHandle hKey);
+
+ /** returns the internal key handle.
+ */
+ RegKeyHandle getKeyHandle() const { return m_hImpl; }
+
+protected:
+ /** sets the internal registry on which this key should work.
+ */
+ inline void setRegistry(Registry& registry);
+
+ /// @endcond
+
+ /// stores the registry on which this key works
+ Registry m_registry;
+ /// stores the current key handle of this key
+ RegKeyHandle m_hImpl;
+};
+
+
+//-----------------------------------------------------------------------------
+
+inline RegistryKeyArray::RegistryKeyArray()
+ : m_length(0)
+ , m_phKeys(NULL)
+{
+}
+
+inline RegistryKeyArray::~RegistryKeyArray()
+{
+ if (m_phKeys)
+ m_registry.m_pApi->closeSubKeys(m_phKeys, m_length);
+}
+
+inline RegistryKey RegistryKeyArray::getElement(sal_uInt32 index)
+{
+ if (m_registry.isValid() && index < m_length)
+ return RegistryKey(m_registry, m_phKeys[index]);
+ else
+ return RegistryKey();
+}
+
+inline sal_uInt32 RegistryKeyArray::getLength()
+{
+ return m_length;
+}
+
+inline void RegistryKeyArray::setKeyHandles(Registry& registry,
+ RegKeyHandle* phKeys,
+ sal_uInt32 length)
+{
+ m_phKeys = phKeys;
+ m_length = length;
+ m_registry = registry;
+}
+
+inline RegError RegistryKeyArray::closeKeyHandles()
+{
+ if (m_registry.isValid() && m_phKeys)
+ {
+ RegError ret;
+ ret = m_registry.m_pApi->closeSubKeys(m_phKeys, m_length);
+ m_registry = Registry();
+ m_length = 0;
+ m_phKeys = NULL;
+ return ret;
+ } else
+ return(REG_INVALID_KEY);
+}
+
+//-----------------------------------------------------------------------------
+
+inline RegistryKeyNames::RegistryKeyNames()
+ : m_length(0)
+ , m_pKeyNames(NULL)
+{
+}
+
+inline RegistryKeyNames::~RegistryKeyNames()
+{
+ if (m_pKeyNames)
+ m_registry.m_pApi->freeKeyNames(m_pKeyNames, m_length);
+}
+
+inline OUString RegistryKeyNames::getElement(sal_uInt32 index)
+{
+
+ if (m_pKeyNames && index < m_length)
+ return m_pKeyNames[index];
+ else
+ return OUString();
+}
+
+inline sal_uInt32 RegistryKeyNames::getLength()
+{
+ return m_length;
+}
+
+inline void RegistryKeyNames::setKeyNames(Registry& registry,
+ rtl_uString** pKeyNames,
+ sal_uInt32 length)
+{
+ m_pKeyNames = pKeyNames;
+ m_length = length;
+ m_registry = registry;
+}
+
+inline RegError RegistryKeyNames::freeKeyNames()
+{
+ if (m_registry.isValid() && m_pKeyNames)
+ {
+ RegError ret = REG_NO_ERROR;
+ ret = m_registry.m_pApi->freeKeyNames(m_pKeyNames, m_length);
+ m_registry = Registry();
+ m_length = 0;
+ m_pKeyNames = NULL;
+ return ret;
+ } else
+ return REG_INVALID_KEY;
+}
+
+//-----------------------------------------------------------------------------
+
+inline RegistryKey::RegistryKey()
+ : m_hImpl(NULL)
+ { }
+
+/// @cond INTERNAL
+inline RegistryKey::RegistryKey(Registry& registry, RegKeyHandle hKey)
+ : m_registry(registry)
+ , m_hImpl(hKey)
+ {
+ if (m_hImpl)
+ m_registry.m_pApi->acquireKey(m_hImpl);
+ }
+/// @endcond
+
+inline RegistryKey::RegistryKey(const RegistryKey& toCopy)
+ : m_registry(toCopy.m_registry)
+ , m_hImpl(toCopy.m_hImpl)
+ {
+ if (m_hImpl)
+ m_registry.m_pApi->acquireKey(m_hImpl);
+ }
+
+/// @cond INTERNAL
+inline void RegistryKey::setRegistry(Registry& registry)
+ {
+ m_registry = registry;
+ }
+/// @endcond
+
+inline RegistryKey::~RegistryKey()
+ {
+ if (m_hImpl)
+ m_registry.m_pApi->releaseKey(m_hImpl);
+ }
+
+inline RegistryKey& RegistryKey::operator = (const RegistryKey& toAssign)
+{
+ m_registry = toAssign.m_registry;
+
+ if (toAssign.m_hImpl)
+ m_registry.m_pApi->acquireKey(toAssign.m_hImpl);
+ if (m_hImpl)
+ m_registry.m_pApi->releaseKey(m_hImpl);
+ m_hImpl = toAssign.m_hImpl;
+
+ return *this;
+}
+
+inline sal_Bool RegistryKey::isValid() const
+ { return (m_hImpl != NULL); }
+
+inline sal_Bool RegistryKey::isReadOnly() const
+ {
+ if (m_registry.isValid())
+ return (m_registry.m_pApi)->isKeyReadOnly(m_hImpl);
+ else
+ return sal_False;
+ }
+
+inline OUString RegistryKey::getName()
+ {
+ OUString sRet;
+ if (m_registry.isValid())
+ m_registry.m_pApi->getKeyName(m_hImpl, &sRet.pData);
+ return sRet;
+ }
+
+inline RegError RegistryKey::createKey(const OUString& keyName,
+ RegistryKey& rNewKey)
+ {
+ if (rNewKey.isValid()) rNewKey.closeKey();
+ if (m_registry.isValid())
+ {
+ RegError ret = m_registry.m_pApi->createKey(m_hImpl, keyName.pData, &rNewKey.m_hImpl);
+ if (!ret) rNewKey.setRegistry(m_registry);
+ return ret;
+ } else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::openKey(const OUString& keyName,
+ RegistryKey& rOpenKey)
+ {
+ if (rOpenKey.isValid()) rOpenKey.closeKey();
+ if (m_registry.isValid())
+ {
+ RegError ret = m_registry.m_pApi->openKey(m_hImpl, keyName.pData,
+ &rOpenKey.m_hImpl);
+ if (!ret) rOpenKey.setRegistry(m_registry);
+ return ret;
+ } else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::openSubKeys(const OUString& keyName,
+ RegistryKeyArray& rSubKeys)
+ {
+ if (m_registry.isValid())
+ {
+ RegError ret = REG_NO_ERROR;
+ RegKeyHandle* pSubKeys;
+ sal_uInt32 nSubKeys;
+ ret = m_registry.m_pApi->openSubKeys(m_hImpl, keyName.pData,
+ &pSubKeys, &nSubKeys);
+ if ( ret )
+ {
+ return ret;
+ } else
+ {
+ rSubKeys.setKeyHandles(m_registry, pSubKeys, nSubKeys);
+ return ret;
+ }
+ } else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::getKeyNames(const OUString& keyName,
+ RegistryKeyNames& rSubKeyNames)
+ {
+ if (m_registry.isValid())
+ {
+ RegError ret = REG_NO_ERROR;
+ rtl_uString** pSubKeyNames;
+ sal_uInt32 nSubKeys;
+ ret = m_registry.m_pApi->getKeyNames(m_hImpl, keyName.pData,
+ &pSubKeyNames, &nSubKeys);
+ if ( ret )
+ {
+ return ret;
+ } else
+ {
+ rSubKeyNames.setKeyNames(m_registry, pSubKeyNames, nSubKeys);
+ return ret;
+ }
+ } else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::closeSubKeys(RegistryKeyArray& rSubKeys)
+ {
+ if (m_registry.isValid())
+ return rSubKeys.closeKeyHandles();
+ else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::deleteKey(const OUString& keyName)
+ {
+ if (m_registry.isValid())
+ return m_registry.m_pApi->deleteKey(m_hImpl, keyName.pData);
+ else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::closeKey()
+ {
+ if (m_registry.isValid())
+ {
+ RegError ret = m_registry.m_pApi->closeKey(m_hImpl);
+ if (!ret)
+ {
+ m_hImpl = NULL;
+ m_registry = Registry();
+ }
+ return ret;
+ } else
+ return REG_INVALID_KEY;
+ }
+
+inline void RegistryKey::releaseKey()
+{
+ if (m_registry.isValid() && (m_hImpl != 0))
+ {
+ m_registry.m_pApi->releaseKey(m_hImpl), m_hImpl = 0;
+ }
+}
+
+inline RegError RegistryKey::setValue(const OUString& keyName,
+ RegValueType valueType,
+ RegValue pValue,
+ sal_uInt32 valueSize)
+ {
+ if (m_registry.isValid())
+ return m_registry.m_pApi->setValue(m_hImpl, keyName.pData, valueType,
+ pValue, valueSize);
+ else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::setLongListValue(const OUString& keyName,
+ sal_Int32* pValueList,
+ sal_uInt32 len)
+ {
+ if (m_registry.isValid())
+ return m_registry.m_pApi->setLongListValue(m_hImpl, keyName.pData,
+ pValueList, len);
+ else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::setStringListValue(const OUString& keyName,
+ sal_Char** pValueList,
+ sal_uInt32 len)
+ {
+ if (m_registry.isValid())
+ return m_registry.m_pApi->setStringListValue(m_hImpl, keyName.pData,
+ pValueList, len);
+ else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::setUnicodeListValue(const OUString& keyName,
+ sal_Unicode** pValueList,
+ sal_uInt32 len)
+ {
+ if (m_registry.isValid())
+ return m_registry.m_pApi->setUnicodeListValue(m_hImpl, keyName.pData,
+ pValueList, len);
+ else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::getValueInfo(const OUString& keyName,
+ RegValueType* pValueType,
+ sal_uInt32* pValueSize)
+ {
+ if (m_registry.isValid())
+ return m_registry.m_pApi->getValueInfo(m_hImpl, keyName.pData, pValueType, pValueSize);
+ else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::getValue(const OUString& keyName,
+ RegValue pValue)
+ {
+ if (m_registry.isValid())
+ return m_registry.m_pApi->getValue(m_hImpl, keyName.pData, pValue);
+ else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::getLongListValue(const OUString& keyName,
+ RegistryValueList<sal_Int32>& rValueList)
+ {
+ if (m_registry.isValid())
+ {
+ RegError ret = REG_NO_ERROR;
+ sal_Int32* pValueList;
+ sal_uInt32 length;
+ ret = m_registry.m_pApi->getLongListValue(m_hImpl, keyName.pData,
+ &pValueList, &length);
+ if ( ret )
+ {
+ return ret;
+ } else
+ {
+ rValueList.setValueList(m_registry, RG_VALUETYPE_LONGLIST,
+ pValueList, length);
+ return ret;
+ }
+ } else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::getStringListValue(const OUString& keyName,
+ RegistryValueList<sal_Char*>& rValueList)
+ {
+ if (m_registry.isValid())
+ {
+ RegError ret = REG_NO_ERROR;
+ sal_Char** pValueList;
+ sal_uInt32 length;
+ ret = m_registry.m_pApi->getStringListValue(m_hImpl, keyName.pData,
+ &pValueList, &length);
+ if ( ret )
+ {
+ return ret;
+ } else
+ {
+ rValueList.setValueList(m_registry, RG_VALUETYPE_STRINGLIST,
+ pValueList, length);
+ return ret;
+ }
+ } else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::getUnicodeListValue(const OUString& keyName,
+ RegistryValueList<sal_Unicode*>& rValueList)
+ {
+ if (m_registry.isValid())
+ {
+ RegError ret = REG_NO_ERROR;
+ sal_Unicode** pValueList;
+ sal_uInt32 length;
+ ret = m_registry.m_pApi->getUnicodeListValue(m_hImpl, keyName.pData,
+ &pValueList, &length);
+ if ( ret )
+ {
+ return ret;
+ } else
+ {
+ rValueList.setValueList(m_registry, RG_VALUETYPE_UNICODELIST,
+ pValueList, length);
+ return ret;
+ }
+ } else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::createLink(const OUString& linkName,
+ const OUString& linkTarget)
+ {
+ if (m_registry.isValid())
+ return m_registry.m_pApi->createLink(m_hImpl, linkName.pData, linkTarget.pData);
+ else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::deleteLink(const OUString& linkName)
+ {
+ if (m_registry.isValid())
+ return m_registry.m_pApi->deleteLink(m_hImpl, linkName.pData);
+ else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::getKeyType(const OUString& keyName,
+ RegKeyType* pKeyType) const
+ {
+ if (m_registry.isValid())
+ return m_registry.m_pApi->getKeyType(m_hImpl, keyName.pData, pKeyType);
+ else
+ return REG_INVALID_KEY;
+ }
+
+inline RegError RegistryKey::getLinkTarget(const OUString& linkName,
+ OUString& rLinkTarget) const
+ {
+ if (m_registry.isValid())
+ {
+ return m_registry.m_pApi->getLinkTarget(m_hImpl,
+ linkName.pData,
+ &rLinkTarget.pData);
+ } else
+ return REG_INVALID_KEY;
+ }
+
+
+inline RegError RegistryKey::getResolvedKeyName(const OUString& keyName,
+ sal_Bool firstLinkOnly,
+ OUString& rResolvedName) const
+ {
+ if (m_registry.isValid())
+ return m_registry.m_pApi->getResolvedKeyName(m_hImpl,
+ keyName.pData,
+ firstLinkOnly,
+ &rResolvedName.pData);
+ else
+ return REG_INVALID_KEY;
+ }
+
+inline OUString RegistryKey::getRegistryName()
+ {
+ if (m_registry.isValid())
+ {
+ return m_registry.getName();
+ } else
+ return OUString();
+ }
+
+//-----------------------------------------------------------------------------
+
+inline Registry::Registry()
+ : m_pApi(initRegistry_Api())
+ , m_hImpl(NULL)
+ { }
+
+inline Registry::Registry(const Registry& toCopy)
+ : m_pApi(toCopy.m_pApi)
+ , m_hImpl(toCopy.m_hImpl)
+ {
+ if (m_hImpl)
+ m_pApi->acquire(m_hImpl);
+ }
+
+
+inline Registry::~Registry()
+ {
+ if (m_hImpl)
+ m_pApi->release(m_hImpl);
+ }
+
+inline Registry& Registry::operator = (const Registry& toAssign)
+{
+ if (toAssign.m_hImpl)
+ toAssign.m_pApi->acquire(toAssign.m_hImpl);
+ if (m_hImpl)
+ m_pApi->release(m_hImpl);
+
+ m_pApi = toAssign.m_pApi;
+ m_hImpl = toAssign.m_hImpl;
+
+ return *this;
+}
+
+inline sal_Bool Registry::isValid() const
+ { return ( m_hImpl != NULL ); }
+
+inline sal_Bool Registry::isReadOnly() const
+ { return m_pApi->isReadOnly(m_hImpl); }
+
+inline RegError Registry::openRootKey(RegistryKey& rRootKey)
+ {
+ rRootKey.setRegistry(*this);
+ return m_pApi->openRootKey(m_hImpl, &rRootKey.m_hImpl);
+ }
+
+inline OUString Registry::getName()
+ {
+ OUString sRet;
+ m_pApi->getName(m_hImpl, &sRet.pData);
+ return sRet;
+ }
+
+inline RegError Registry::create(const OUString& registryName)
+ {
+ if (m_hImpl)
+ m_pApi->release(m_hImpl);
+ return m_pApi->createRegistry(registryName.pData, &m_hImpl);
+ }
+
+inline RegError Registry::open(const OUString& registryName,
+ RegAccessMode accessMode)
+ {
+ if (m_hImpl)
+ m_pApi->release(m_hImpl);
+ return m_pApi->openRegistry(registryName.pData, &m_hImpl, accessMode);
+ }
+
+inline RegError Registry::close()
+ {
+ RegError ret = m_pApi->closeRegistry(m_hImpl);
+ if (!ret)
+ m_hImpl = NULL;
+ return ret;
+ }
+
+inline RegError Registry::destroy(const OUString& registryName)
+ {
+ RegError ret = m_pApi->destroyRegistry(m_hImpl, registryName.pData);
+ if ( !ret && registryName.isEmpty() )
+ m_hImpl = NULL;
+ return ret;
+ }
+
+inline RegError Registry::loadKey(RegistryKey& rKey,
+ const OUString& keyName,
+ const OUString& regFileName)
+ { return m_pApi->loadKey(m_hImpl, rKey.m_hImpl, keyName.pData, regFileName.pData); }
+
+inline RegError Registry::saveKey(RegistryKey& rKey,
+ const OUString& keyName,
+ const OUString& regFileName)
+ { return m_pApi->saveKey(m_hImpl, rKey.m_hImpl, keyName.pData, regFileName.pData); }
+
+inline RegError Registry::mergeKey(RegistryKey& rKey,
+ const OUString& keyName,
+ const OUString& regFileName,
+ sal_Bool bWarnings,
+ sal_Bool bReport)
+ { return m_pApi->mergeKey(m_hImpl, rKey.m_hImpl, keyName.pData, regFileName.pData, bWarnings, bReport); }
+
+inline RegError Registry::dumpRegistry(RegistryKey& rKey)
+ { return m_pApi->dumpRegistry(m_hImpl, rKey.m_hImpl); }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/regtype.h b/include/registry/regtype.h
new file mode 100644
index 000000000000..86ddb299fb37
--- /dev/null
+++ b/include/registry/regtype.h
@@ -0,0 +1,168 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _REGISTRY_REGTYPE_H_
+#define _REGISTRY_REGTYPE_H_
+
+#include <sal/types.h>
+
+/// defines the type of a registry handle used in the C API.
+typedef void* RegHandle;
+
+/// defines the type of a registry key handle used in the C API.
+typedef void* RegKeyHandle;
+
+/// defines the type of a registry key value handle used in the C API.
+typedef void* RegValue;
+
+/** defines the open/access mode of the registry.
+
+ Two modes are valid:
+ -REG_READONLY allows readonly access
+ -REG_READWRITE allows read and write access
+ */
+typedef sal_uInt16 RegAccessMode;
+
+/// Flag to specify the open mode of a registry. This mode allows readonly access.
+#define REG_READONLY 0x0001
+/// Flag to specify the open mode of a registry. This mode allows read and write access.
+#define REG_READWRITE 0x0002
+
+/** defines the type of a registry key.
+
+ The registry differs between normal keys which can contain subkeys or
+ a value and link keys which navigate over the linktarget to an existing
+ other key (which are no longer supported).
+*/
+enum RegKeyType
+{
+ /// represents a real key
+ RG_KEYTYPE,
+ /// represents a link (which is no longer supported)
+ RG_LINKTYPE
+};
+
+/** defines the type of a key value.
+
+ A registry key can contain a value which has one of seven different types.
+ Three simple types (long, ascii and unicode string) and a list type of
+ these simple types. Furthermore a binary type which provides the possibilty
+ to define own data structures and store these types in the registry. The UNO
+ core reflection data is stored as a binary blob in the type registry.
+ */
+enum RegValueType
+{
+ /// The key has no value or the value type is unknown.
+ RG_VALUETYPE_NOT_DEFINED,
+ /// The key has a value of type long
+ RG_VALUETYPE_LONG,
+ /// The key has a value of type ascii string
+ RG_VALUETYPE_STRING,
+ /// The key has a value of type unicode string
+ RG_VALUETYPE_UNICODE,
+ /// The key has a value of type binary
+ RG_VALUETYPE_BINARY,
+ /// The key has a value of type long list
+ RG_VALUETYPE_LONGLIST,
+ /// The key has a value of type ascii string list
+ RG_VALUETYPE_STRINGLIST,
+ /// The key has a value of type unicode string list
+ RG_VALUETYPE_UNICODELIST
+};
+
+/// specifies the possible error codes which can occur using the registry API.
+enum RegError
+{
+ /// no error.
+ REG_NO_ERROR,
+ /// internal registry error.
+ REG_INTERNAL_ERROR,
+
+ /// registry is not open.
+ REG_REGISTRY_NOT_OPEN,
+ /// registry does not exists.
+ REG_REGISTRY_NOT_EXISTS,
+ /// registry is open with readonly access rights.
+ REG_REGISTRY_READONLY,
+ /// destroy a registry failed. There are may be any open keys.
+ REG_DESTROY_REGISTRY_FAILED,
+ /** registry cannot be opened with readwrite access because the registry is already
+ open with readwrite access anywhere.
+ */
+ REG_CANNOT_OPEN_FOR_READWRITE,
+ /** registry is in an invalid state or the registry does not point to
+ a valid registry data file.
+ */
+ REG_INVALID_REGISTRY,
+
+ /// the key or key handle points to an invalid key or closed key.
+ REG_KEY_NOT_OPEN,
+ /// the specified keyname points to a nonexisting key.
+ REG_KEY_NOT_EXISTS,
+ /// the key with the specified keyname cannot be created.
+ REG_CREATE_KEY_FAILED,
+ /// the specified key cannot be deleted. Maybe an open key handle exists to this key.
+ REG_DELETE_KEY_FAILED,
+ /** the keyname is invalid. This error will return if the keyname
+ is NULL but should not be NULL in the context of a called function.
+ */
+ REG_INVALID_KEYNAME,
+ /// the key is not in a valid state.
+ REG_INVALID_KEY,
+
+ /// the key has no value
+ REG_VALUE_NOT_EXISTS,
+ /// setting the specified value of a key failed.
+ REG_SET_VALUE_FAILED,
+ /// deleting of the key value failed.
+ REG_DELETE_VALUE_FAILED,
+ /// the key has a invalid value or the value type is unknown.
+ REG_INVALID_VALUE,
+
+ /// merging a key, the value and all subkeys failed.
+ REG_MERGE_ERROR,
+ /** conflicts exists during the merge process of a key. This could happen if
+ the value of a key already exists and the merge process will replace it.
+ */
+ REG_MERGE_CONFLICT,
+
+ /** a recursion was detected resolving different link targets (no longer
+ used).
+ */
+ REG_DETECT_RECURSION,
+ /** the link is invalid and can not be resolved (now used by all
+ link-related operations, as links are no longer supported).
+ */
+ REG_INVALID_LINK,
+ /// the specified linkname is not valid (no longer used).
+ REG_INVALID_LINKNAME,
+ /// the linknane is not valid (no longer used).
+ REG_INVALID_LINKTARGET,
+ /// the link target points to a nonexisting key (no longer used).
+ REG_LINKTARGET_NOT_EXIST,
+ /// the reserved buffer for the resolved keyname is to small.
+ REG_BUFFERSIZE_TOSMALL
+};
+
+/// specify the calling convention for the registry API
+#define REGISTRY_CALLTYPE SAL_CALL
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/types.h b/include/registry/types.h
new file mode 100644
index 000000000000..0ad7977486f4
--- /dev/null
+++ b/include/registry/types.h
@@ -0,0 +1,334 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_registry_types_h
+#define INCLUDED_registry_types_h
+
+#include "sal/types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** specifies the typeclass of a binary type blob.
+
+ The general structure of a binary type blob is always the same. It depends
+ on the typeclass which parts of the blob are filled with data or not.
+ */
+enum RTTypeClass {
+ /** specifies that the structure of the given blob is unknown and can't be
+ read.
+ */
+ RT_TYPE_INVALID,
+
+ /** specifies that the blob represents an interface type. An interface blob
+ can contain a base interface, attributes and methods.
+ */
+ RT_TYPE_INTERFACE,
+
+ /** specifies that the blob represents a module type. A module blob can
+ contain a base module and constant members (fields).
+ */
+ RT_TYPE_MODULE,
+
+ /** specifies that the blob represents a struct type. A struct blob can
+ contain a base struct and members (fields).
+ */
+ RT_TYPE_STRUCT,
+
+ /** specifies that the blob represents an enum type. An enum blob can
+ contain enum values which are accessible as fields.
+ */
+ RT_TYPE_ENUM,
+
+ /** specifies that the blob represents an exception type. An exception blob
+ can contain a base exception and members (fields).
+ */
+ RT_TYPE_EXCEPTION,
+
+ /** specifies that the blob represents a typedef type. A typedef blob can
+ contain a base type.
+ */
+ RT_TYPE_TYPEDEF,
+
+ /** specifies that the blob represents a service type. A service blob can
+ contain a base service, properties (fields), references to services or
+ interfaces.
+ */
+ RT_TYPE_SERVICE,
+
+ /** specifies that the blob represents a singleton type (a named object)
+ which refers exactly one existing service.
+ */
+ RT_TYPE_SINGLETON,
+
+ /// deprecated, not used.
+ RT_TYPE_OBJECT,
+
+ /** specifies that the blob represents a constants type. A constants blob
+ can contain constant types as fields.
+ */
+ RT_TYPE_CONSTANTS,
+
+ /** @deprecated
+ a union type was evaluated but currently not supported.
+ */
+ RT_TYPE_UNION,
+
+ /// @cond INTERNAL
+ /**
+ Flag for published entities.
+
+ Used in combination with RT_TYPE_INTERFACE, RT_TYPE_STRUCT, RT_TYPE_ENUM,
+ RT_TYPE_EXCEPTION, RT_TYPE_TYPEDEF, RT_TYPE_SERVICE, RT_TYPE_SINGLETON,
+ or RT_TYPE_CONSTANTS to mark an entity as published.
+
+ (The value of this enumerator is chosen so that it is unlikely that its
+ addition changes the underlying type of this enumeration for any C/C++
+ compiler.)
+
+ @since UDK 3.2.0
+ */
+ RT_TYPE_PUBLISHED = 0x4000
+ /// @endcond
+};
+
+/** specifies the type for the field access.
+
+ Fields in a type blob are used for different types. Among others they were
+ used for properties of services and these poperties can have several flags.
+
+ @see RT_ACCESS_INVALID
+ @see RT_ACCESS_READONLY
+ @see RT_ACCESS_OPTIONAL
+ @see RT_ACCESS_MAYBEVOID
+ @see RT_ACCESS_BOUND
+ @see RT_ACCESS_CONSTRAINED
+ @see RT_ACCESS_TRANSIENT
+ @see RT_ACCESS_MAYBEAMBIGUOUS
+ @see RT_ACCESS_MAYBEDEFAULT
+ @see RT_ACCESS_REMOVEABLE
+ @see RT_ACCESS_ATTRIBUTE
+ @see RT_ACCESS_PROPERTY
+ @see RT_ACCESS_CONST
+ @see RT_ACCESS_READWRITE
+ @see RT_ACCESS_DEFAULT
+ @see RT_ACCESS_PARAMETERIZED_TYPE
+ @see RT_ACCESS_PUBLISHED
+ */
+typedef sal_uInt16 RTFieldAccess;
+
+/// specifies a unknown flag
+#define RT_ACCESS_INVALID 0x0000
+/// specifies a readonly property/attribute
+#define RT_ACCESS_READONLY 0x0001
+/// specifies a property as optional that means that it must not be implemented.
+#define RT_ACCESS_OPTIONAL 0x0002
+/// @see com::sun::star::beans::PropertyAttribute
+#define RT_ACCESS_MAYBEVOID 0x0004
+/// @see com::sun::star::beans::PropertyAttribute
+#define RT_ACCESS_BOUND 0x0008
+/// @see com::sun::star::beans::PropertyAttribute
+#define RT_ACCESS_CONSTRAINED 0x0010
+/// @see com::sun::star::beans::PropertyAttribute
+#define RT_ACCESS_TRANSIENT 0x0020
+/// @see com::sun::star::beans::PropertyAttribute
+#define RT_ACCESS_MAYBEAMBIGUOUS 0x0040
+/// @see com::sun::star::beans::PropertyAttribute
+#define RT_ACCESS_MAYBEDEFAULT 0x0080
+/// @see com::sun::star::beans::PropertyAttribute
+#define RT_ACCESS_REMOVEABLE 0x0100
+/// @see com::sun::star::beans::PropertyAttribute
+#define RT_ACCESS_ATTRIBUTE 0x0200
+/// specifies that the field is a property
+#define RT_ACCESS_PROPERTY 0x0400
+/// specifies that the field is a constant or enum value
+#define RT_ACCESS_CONST 0x0800
+/// specifies that the property/attribute has read/write access
+#define RT_ACCESS_READWRITE 0x1000
+/// only to describe a union default label
+#define RT_ACCESS_DEFAULT 0x2000
+
+/**
+ Indicates that a member of a polymorphic struct type template is of a
+ parameterized type.
+
+ Only valid for fields that represent members of polymorphic struct type
+ templates.
+
+ @since UDK 3.2.0
+ */
+#define RT_ACCESS_PARAMETERIZED_TYPE 0x4000
+
+/**
+ Flag for published individual constants.
+
+ Used in combination with RT_ACCESS_CONST for individual constants (which are
+ not members of constant groups).
+
+ @since UDK 3.2.0
+ */
+#define RT_ACCESS_PUBLISHED 0x8000
+
+/** specifies the type of a field value.
+
+ A field can have a value if it repsresents a constant or an enum value.
+ */
+enum RTValueType {
+ RT_TYPE_NONE,
+ RT_TYPE_BOOL,
+ RT_TYPE_BYTE,
+ RT_TYPE_INT16,
+ RT_TYPE_UINT16,
+ RT_TYPE_INT32,
+ RT_TYPE_UINT32,
+ RT_TYPE_INT64,
+ RT_TYPE_UINT64,
+ RT_TYPE_FLOAT,
+ RT_TYPE_DOUBLE,
+ RT_TYPE_STRING
+};
+
+/** specifies a variable container for field values.
+ */
+union RTConstValueUnion {
+ sal_Bool aBool;
+ sal_Int8 aByte;
+ sal_Int16 aShort;
+ sal_uInt16 aUShort;
+ sal_Int32 aLong;
+ sal_uInt32 aULong;
+ sal_Int64 aHyper;
+ sal_uInt64 aUHyper;
+ float aFloat;
+ double aDouble;
+ sal_Unicode const * aString;
+};
+
+/** specifies the mode of a method.
+
+ A method can be synchron or asynchron (oneway). The const attribute for
+ methods was removed so that the const values are deprecated.
+ */
+enum RTMethodMode {
+ /// indicates an invalid mode
+ RT_MODE_INVALID,
+
+ /// indicates the asynchronous mode of a method
+ RT_MODE_ONEWAY,
+
+ /// @deprecated
+ RT_MODE_ONEWAY_CONST,
+
+ /// indicated the synchronous mode of a method
+ RT_MODE_TWOWAY,
+
+ /// @deprecated
+ RT_MODE_TWOWAY_CONST,
+
+ /**
+ Indicates an extended attribute getter (that has a 'raises' clause) of an
+ interface type.
+
+ @since UDK 3.2.0
+ */
+ RT_MODE_ATTRIBUTE_GET,
+
+ /**
+ Indicates an extended attribute setter (that has a 'raises' clause) of an
+ interface type.
+
+ @since UDK 3.2.0
+ */
+ RT_MODE_ATTRIBUTE_SET
+};
+
+/** specifies the mode of a parameter.
+
+ There are three paramter modes which have impact of the handling of the
+ paramter in the UNO bridges and the UNO code generation.
+ */
+enum RTParamMode {
+ /// indicates an invalid parameter mode
+ RT_PARAM_INVALID = 0,
+
+ /// indicates a pure in parameter which is used by value
+ RT_PARAM_IN = 1,
+
+ /// indicates a pure out parameter which is used by reference
+ RT_PARAM_OUT = 2,
+
+ /// indicates a in and out parameter which is used also by reference
+ RT_PARAM_INOUT = 3,
+
+ /**
+ Indicates a rest parameter (currently only valid for service
+ constructors).
+
+ This value can be combined with any of RT_PARAM_IN, RT_PARAM_OUT, and
+ RT_PARAM_INOUT (however, service constructors currently only allow
+ RT_PARAM_IN, anyway).
+
+ @since UDK 3.2.0
+ */
+ RT_PARAM_REST = 4
+};
+
+/** specifies the type of a reference used in a service description.
+ */
+enum RTReferenceType {
+ /// the reference type is unknown
+ RT_REF_INVALID,
+
+ /** the service support the interface that means a implementation of this
+ service must implement this interface.
+ */
+ RT_REF_SUPPORTS,
+
+ /** @deprecated
+ the service observes the interface.
+ */
+ RT_REF_OBSERVES,
+
+ /** the service exports the specified service that means this service
+ provides also the specified service.
+ */
+ RT_REF_EXPORTS,
+
+ /** @deprecated
+ the service needs the specified service that means in the context of
+ this service the specified service will be used or must be available.
+ */
+ RT_REF_NEEDS,
+
+ /**
+ Indicates a type parameter of a polymorphic struct type template.
+
+ @since UDK 3.2.0
+ */
+ RT_REF_TYPE_PARAMETER
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/version.h b/include/registry/version.h
new file mode 100644
index 000000000000..01f0f8033323
--- /dev/null
+++ b/include/registry/version.h
@@ -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_registry_version_h
+#define INCLUDED_registry_version_h
+
+#include "sal/types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ The version of a binary blob that represents a UNOIDL type.
+
+ <p>All values between <code>TYPEREG_VERSION_0</code> and
+ <code>TYPEREG_MAX_VERSION</code> are valid, where currently unallocated
+ values represent future versions. Negative values are not valid.</p>
+
+ @see typereg::Reader
+ @see typereg::Writer
+
+ @since UDK 3.2.0
+ */
+enum typereg_Version {
+ /**
+ Denotes the original version of UNOIDL type blobs.
+ */
+ TYPEREG_VERSION_0,
+
+ /**
+ Denotes the updated version of UNOIDL type blobs.
+
+ <p>This version added support for multiple-inheritance interface types,
+ extended interface type attributes, single-interface&ndash;based
+ services, interface-based singletons, polymorphic struct types, and
+ published entities.</p>
+ */
+ TYPEREG_VERSION_1,
+
+ /**
+ Denotes the maximum future version of UNOIDL type blobs.
+ */
+ TYPEREG_MAX_VERSION = SAL_MAX_INT32
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/writer.h b/include/registry/writer.h
new file mode 100644
index 000000000000..f1b39a583e22
--- /dev/null
+++ b/include/registry/writer.h
@@ -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_registry_writer_h
+#define INCLUDED_registry_writer_h
+
+#include "registry/regdllapi.h"
+#include "registry/types.h"
+#include "registry/version.h"
+
+#include "rtl/ustring.h"
+#include "sal/types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ Creates a type writer working on a binary blob that represents a UNOIDL type.
+
+ <p>Operations on a returned handle are not multi-thread&ndash;safe.</p>
+
+ @param version the version of the created type writer; must not be negative
+
+ @param documentation the documentation; must not be null
+
+ @param fileName the file name; must not be null (deprecated, use an empty string)
+
+ @param typeClass the type class of the created type writer
+
+ @param published whether the created type writer is published; for a type
+ class that cannot be published, this should be false
+
+ @param typeName the type name of the created type writer; must not be null
+
+ @param superTypeCount the number of super types of the created type writer
+
+ @param fieldCount the number of fields of the created type writer
+
+ @param methodCount the number of methods of the created type writer
+
+ @param referenceCount the number of references of the created type writer
+
+ @return a handle on the type writer; if an out-of-memory condition occurs,
+ null is returned, and no type writer is created
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void * SAL_CALL typereg_writer_create(
+ typereg_Version version, rtl_uString const * documentation,
+ rtl_uString const * fileName, RTTypeClass typeClass, sal_Bool published,
+ rtl_uString const * typeName, sal_uInt16 superTypeCount,
+ sal_uInt16 fieldCount, sal_uInt16 methodCount, sal_uInt16 referenceCount)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Destroys a type writer.
+
+ @param handle a handle on a type writer obtained from a call to
+ <code>typereg_writer_create</code>; must not be null
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC void SAL_CALL typereg_writer_destroy(void * handle) SAL_THROW_EXTERN_C();
+
+/**
+ Sets the type name of a super type of a type writer.
+
+ @param handle a handle on a type writer; must not be null
+
+ @param index a valid index into the range of super types of the given type
+ writer
+
+ @param typeName the super type name; must not be null
+
+ @return false iff an out-of-memory condition ocurred, in which case the type
+ writer is not modified
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setSuperTypeName(
+ void * handle, sal_uInt16 index, rtl_uString const * typeName)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Sets the data of a field of a type writer.
+
+ @param handle a handle on a type writer; must not be null
+
+ @param index a valid index into the range of fields of the given type writer
+
+ @param documentation the documentation of the field; must not be null
+
+ @param fileName the file name of the field; must not be null (deprecated, use an empty string)
+
+ @param flags the flags of the field
+
+ @param name the name of the field; must not be null
+
+ @param typeName the type name of the field; must not be null
+
+ @param valueType the type of the value of the field
+
+ @param valueValue the value of the value of the field
+
+ @return false iff an out-of-memory condition ocurred, in which case the type
+ writer is not modified
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setFieldData(
+ void * handle, sal_uInt16 index, rtl_uString const * documentation,
+ rtl_uString const * fileName, RTFieldAccess flags, rtl_uString const * name,
+ rtl_uString const * typeName, RTValueType valueType,
+ RTConstValueUnion valueValue)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Sets the data of a method of a type writer.
+
+ @param handle a handle on a type writer; must not be null
+
+ @param index a valid index into the range of methods of the given type writer
+
+ @param documentation the documentation of the method; must not be null
+
+ @param flags the flags of the method
+
+ @param name the name of the method; must not be null
+
+ @param returnTypeName the return type name of the method; must not be null
+
+ @param parameterCount the number of parameters of the method
+
+ @param exceptionCount the number of exceptions of the method
+
+ @return false iff an out-of-memory condition ocurred, in which case the type
+ writer is not modified
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setMethodData(
+ void * handle, sal_uInt16 index, rtl_uString const * documentation,
+ RTMethodMode flags, rtl_uString const * name,
+ rtl_uString const * returnTypeName, sal_uInt16 parameterCount,
+ sal_uInt16 exceptionCount)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Sets the data of a parameter of a method of a type writer.
+
+ @param handle a handle on a type writer; must not be null
+
+ @param methodIndex a valid index into the range of methods of the given type
+ writer
+
+ @param parameterIndex a valid index into the range of parameters of the given
+ method
+
+ @param flags the flags of the parameter
+
+ @param name the name of the parameter; must not be null
+
+ @param typeName the type name of the parameter; must not be null
+
+ @return false iff an out-of-memory condition ocurred, in which case the type
+ writer is not modified
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setMethodParameterData(
+ void * handle, sal_uInt16 methodIndex, sal_uInt16 parameterIndex,
+ RTParamMode flags, rtl_uString const * name, rtl_uString const * typeName)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Sets an exception type name of a method of a type writer.
+
+ @param handle a handle on a type writer; must not be null
+
+ @param methodIndex a valid index into the range of methods of the given type
+ writer
+
+ @param exceptionIndex a valid index into the range of exceptions of the given
+ method
+
+ @param typeName the exception type name; must not be null
+
+ @return false iff an out-of-memory condition ocurred, in which case the type
+ writer is not modified
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setMethodExceptionTypeName(
+ void * handle, sal_uInt16 methodIndex, sal_uInt16 exceptionIndex,
+ rtl_uString const * typeName)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Sets the data of a reference of a type writer.
+
+ @param handle a handle on a type writer; must not be null
+
+ @param index a valid index into the range of references of the given type
+ writer
+
+ @param documentation the documentation of the reference; must not be null
+
+ @param sort the sort of the reference
+
+ @param flags the flags of the reference
+
+ @param typeName the type name of the reference; must not be null
+
+ @return false iff an out-of-memory condition ocurred, in which case the type
+ writer is not modified
+
+ @since UDK 3.2.0
+ */
+REG_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setReferenceData(
+ void * handle, sal_uInt16 index, rtl_uString const * documentation,
+ RTReferenceType sort, RTFieldAccess flags, rtl_uString const * typeName)
+ SAL_THROW_EXTERN_C();
+
+/**
+ Returns the blob of a type writer.
+
+ @param handle a handle on a type writer; must not be null
+
+ @param size an out-parameter obtaining the size of the blob; must not be null
+
+ @return a (byte-aligned) pointer to the blob; the returned pointer and the
+ returned <code>size</code> remain valid until the next function is called on
+ the given type writer; if an out-of-memory condition occurs, null is returned
+ and <code>size</code> is not modified
+ */
+REG_DLLPUBLIC void const * SAL_CALL typereg_writer_getBlob(void * handle, sal_uInt32 * size)
+ SAL_THROW_EXTERN_C();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/writer.hxx b/include/registry/writer.hxx
new file mode 100644
index 000000000000..cfdf479853df
--- /dev/null
+++ b/include/registry/writer.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_registry_writer_hxx
+#define INCLUDED_registry_writer_hxx
+
+#include "registry/writer.h"
+#include "registry/refltype.hxx"
+#include "registry/types.h"
+#include "registry/version.h"
+
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include <new>
+
+namespace typereg {
+
+/**
+ A type writer working on a binary blob that represents a UNOIDL type.
+
+ <p>Instances of this class are not multi-thread&ndash;safe.</p>
+
+ @since UDK 3.2.0
+ */
+class Writer {
+public:
+ /**
+ Creates a type writer.
+
+ @param version the version of the created type writer; must not be
+ negative
+
+ @param documentation the documentation
+
+ @param fileName the file name (deprecated, use an empty string)
+
+ @param typeClass the type class of the created type writer
+
+ @param published whether the created type writer is published; for a type
+ class that cannot be published, this should be false
+
+ @param typeName the type name of the created type writer
+
+ @param superTypeCount the number of super types of the created type
+ writer
+
+ @param fieldCount the number of fields of the created type writer
+
+ @param methodCount the number of methods of the created type writer
+
+ @param referenceCount the number of references of the created type writer
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ Writer(
+ typereg_Version version, OUString const & documentation,
+ OUString const & fileName, RTTypeClass typeClass, bool published,
+ OUString const & typeName, sal_uInt16 superTypeCount,
+ sal_uInt16 fieldCount, sal_uInt16 methodCount,
+ sal_uInt16 referenceCount):
+ m_handle(
+ typereg_writer_create(
+ version, documentation.pData, fileName.pData, typeClass,
+ published, typeName.pData, superTypeCount, fieldCount,
+ methodCount, referenceCount))
+ {
+ if (m_handle == 0) {
+ throw std::bad_alloc();
+ }
+ }
+
+ /**
+ Destroys this <code>Writer</code> instance.
+ */
+ ~Writer() {
+ typereg_writer_destroy(m_handle);
+ }
+
+ /**
+ Sets the type name of a super type of this type writer.
+
+ @param index a valid index into the range of super types of this type
+ writer
+
+ @param typeName the super type name
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ void setSuperTypeName(sal_uInt16 index, OUString const & typeName) {
+ if (!typereg_writer_setSuperTypeName(m_handle, index, typeName.pData)) {
+ throw std::bad_alloc();
+ }
+ }
+
+ /**
+ Sets the data of a field of this type writer.
+
+ @param index a valid index into the range of fields of this type writer
+
+ @param documentation the documentation of the field
+
+ @param fileName the file name of the field (deprecated, use an empty string)
+
+ @param flags the flags of the field
+
+ @param name the name of the field
+
+ @param typeName the type name of the field
+
+ @param value the value of the field
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ void setFieldData(
+ sal_uInt16 index, OUString const & documentation,
+ OUString const & fileName, RTFieldAccess flags, OUString const & name,
+ OUString const & typeName, RTConstValue const & value)
+ {
+ if (!typereg_writer_setFieldData(
+ m_handle, index, documentation.pData, fileName.pData, flags,
+ name.pData, typeName.pData, value.m_type, value.m_value))
+ {
+ throw std::bad_alloc();
+ }
+ }
+
+ /**
+ Sets the data of a method of this type writer.
+
+ @param index a valid index into the range of methods of this type writer
+
+ @param documentation the documentation of the method
+
+ @param flags the flags of the method
+
+ @param name the name of the method
+
+ @param returnTypeName the return type name of the method
+
+ @param parameterCount the number of parameters of the method
+
+ @param exceptionCount the number of exceptions of the method
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ void setMethodData(
+ sal_uInt16 index, OUString const & documentation,
+ RTMethodMode flags, OUString const & name,
+ OUString const & returnTypeName, sal_uInt16 parameterCount,
+ sal_uInt16 exceptionCount)
+ {
+ if (!typereg_writer_setMethodData(
+ m_handle, index, documentation.pData, flags, name.pData,
+ returnTypeName.pData, parameterCount, exceptionCount))
+ {
+ throw std::bad_alloc();
+ }
+ }
+
+ /**
+ Sets the data of a parameter of a method of this type writer.
+
+ @param methodIndex a valid index into the range of methods of this type
+ writer
+
+ @param parameterIndex a valid index into the range of parameters of the
+ given method
+
+ @param flags the flags of the parameter
+
+ @param name the name of the parameter
+
+ @param typeName the type name of the parameter
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ void setMethodParameterData(
+ sal_uInt16 methodIndex, sal_uInt16 parameterIndex,
+ RTParamMode flags, OUString const & name,
+ OUString const & typeName)
+ {
+ if (!typereg_writer_setMethodParameterData(
+ m_handle, methodIndex, parameterIndex, flags, name.pData,
+ typeName.pData))
+ {
+ throw std::bad_alloc();
+ }
+ }
+
+ /**
+ Sets an exception type name of a method of this type writer.
+
+ @param methodIndex a valid index into the range of methods of this type
+ writer
+
+ @param exceptionIndex a valid index into the range of exceptions of the
+ given method
+
+ @param typeName the exception type name
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ void setMethodExceptionTypeName(
+ sal_uInt16 methodIndex, sal_uInt16 exceptionIndex,
+ OUString const & typeName)
+ {
+ if (!typereg_writer_setMethodExceptionTypeName(
+ m_handle, methodIndex, exceptionIndex, typeName.pData))
+ {
+ throw std::bad_alloc();
+ }
+ }
+
+ /**
+ Sets the data of a reference of this type writer.
+
+ @param index a valid index into the range of references of this type
+ writer
+
+ @param documentation the documentation of the reference
+
+ @param sort the sort of the reference
+
+ @param flags the flags of the reference
+
+ @param typeName the type name of the reference
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ */
+ void setReferenceData(
+ sal_uInt16 index, OUString const & documentation,
+ RTReferenceType sort, RTFieldAccess flags,
+ OUString const & typeName)
+ {
+ if (!typereg_writer_setReferenceData(
+ m_handle, index, documentation.pData, sort, flags,
+ typeName.pData))
+ {
+ throw std::bad_alloc();
+ }
+ }
+
+ /**
+ Returns the blob of this type writer.
+
+ @param size an out-parameter obtaining the size of the blob
+
+ @return a (byte-aligned) pointer to the blob; the returned pointer and
+ the returned <code>size</code> remain valid until the next function is
+ called on this type writer
+
+ @exception std::bad_alloc is raised if an out-of-memory condition occurs
+ (in which case <code>siez</code> is not modified
+ */
+ void const * getBlob(sal_uInt32 * size) {
+ void const * p = typereg_writer_getBlob(m_handle, size);
+ if (p == 0) {
+ throw std::bad_alloc();
+ }
+ return p;
+ }
+
+private:
+ Writer(Writer &); // not implemented
+ void operator =(Writer); // not implemented
+
+ void * m_handle;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/rsc/rsc-vcl-shared-types.hxx b/include/rsc/rsc-vcl-shared-types.hxx
new file mode 100644
index 000000000000..4e8ca10090c7
--- /dev/null
+++ b/include/rsc/rsc-vcl-shared-types.hxx
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _RSC_RSC_VCL_SHARED_TYPES_HXX
+#define _RSC_RSC_VCL_SHARED_TYPES_HXX
+
+enum TimeFieldFormat {TIMEF_NONE, TIMEF_SEC, TIMEF_100TH_SEC, TIMEF_SEC_CS, TimeFieldFormat_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+enum KeyFuncType { KEYFUNC_DONTKNOW, KEYFUNC_NEW, KEYFUNC_OPEN, KEYFUNC_SAVE,
+ KEYFUNC_SAVEAS, KEYFUNC_PRINT, KEYFUNC_CLOSE, KEYFUNC_QUIT,
+ KEYFUNC_CUT, KEYFUNC_COPY, KEYFUNC_PASTE, KEYFUNC_UNDO,
+ KEYFUNC_REDO, KEYFUNC_DELETE, KEYFUNC_REPEAT, KEYFUNC_FIND,
+ KEYFUNC_FINDBACKWARD, KEYFUNC_PROPERTIES, KEYFUNC_FRONT,
+ KeyFuncType_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+enum MenuItemType { MENUITEM_DONTKNOW, MENUITEM_STRING, MENUITEM_IMAGE,
+ MENUITEM_STRINGIMAGE, MENUITEM_SEPARATOR };
+
+typedef sal_uInt16 MenuItemBits;
+
+#define MIB_CHECKABLE ((MenuItemBits)0x0001)
+#define MIB_RADIOCHECK ((MenuItemBits)0x0002)
+#define MIB_AUTOCHECK ((MenuItemBits)0x0004)
+#define MIB_ABOUT ((MenuItemBits)0x0008)
+#define MIB_HELP ((MenuItemBits)0x0010)
+#define MIB_POPUPSELECT ((MenuItemBits)0x0020)
+
+// These have been said to be a prelimitary (sic) solution since 2007
+#define MIB_NOSELECT ((MenuItemBits)0x0040)
+#define MIB_ICON ((MenuItemBits)0x0080)
+#define MIB_TEXT ((MenuItemBits)0x0100)
+
+typedef sal_uInt16 ToolBoxItemBits;
+
+#define TIB_CHECKABLE ((ToolBoxItemBits)0x0001)
+#define TIB_RADIOCHECK ((ToolBoxItemBits)0x0002)
+#define TIB_AUTOCHECK ((ToolBoxItemBits)0x0004)
+#define TIB_LEFT ((ToolBoxItemBits)0x0008)
+#define TIB_AUTOSIZE ((ToolBoxItemBits)0x0010)
+#define TIB_DROPDOWN ((ToolBoxItemBits)0x0020)
+#define TIB_REPEAT ((ToolBoxItemBits)0x0040)
+#define TIB_DROPDOWNONLY ((ToolBoxItemBits)0x0080 | TIB_DROPDOWN)
+#define TIB_TEXT_ONLY ((ToolBoxItemBits)0x0100)
+#define TIB_ICON_ONLY ((ToolBoxItemBits)0x0200)
+#define TIB_TEXTICON ((ToolBoxItemBits) TIB_TEXT_ONLY | TIB_ICON_ONLY )
+
+enum ToolBoxItemType { TOOLBOXITEM_DONTKNOW, TOOLBOXITEM_BUTTON,
+ TOOLBOXITEM_SPACE, TOOLBOXITEM_SEPARATOR,
+ TOOLBOXITEM_BREAK };
+
+enum ButtonType { BUTTON_SYMBOL, BUTTON_TEXT, BUTTON_SYMBOLTEXT };
+
+typedef sal_uInt16 SymbolType;
+
+#define SYMBOL_DONTKNOW ((SymbolType)0)
+#define SYMBOL_IMAGE ((SymbolType)1)
+#define SYMBOL_ARROW_UP ((SymbolType)2)
+#define SYMBOL_ARROW_DOWN ((SymbolType)3)
+#define SYMBOL_ARROW_LEFT ((SymbolType)4)
+#define SYMBOL_ARROW_RIGHT ((SymbolType)5)
+#define SYMBOL_SPIN_UP ((SymbolType)6)
+#define SYMBOL_SPIN_DOWN ((SymbolType)7)
+#define SYMBOL_SPIN_LEFT ((SymbolType)8)
+#define SYMBOL_SPIN_RIGHT ((SymbolType)9)
+#define SYMBOL_FIRST ((SymbolType)10)
+#define SYMBOL_LAST ((SymbolType)11)
+#define SYMBOL_PREV ((SymbolType)12)
+#define SYMBOL_NEXT ((SymbolType)13)
+#define SYMBOL_PAGEUP ((SymbolType)14)
+#define SYMBOL_PAGEDOWN ((SymbolType)15)
+#define SYMBOL_PLAY ((SymbolType)16)
+#define SYMBOL_REVERSEPLAY ((SymbolType)17)
+#define SYMBOL_RECORD ((SymbolType)18)
+#define SYMBOL_STOP ((SymbolType)19)
+#define SYMBOL_PAUSE ((SymbolType)20)
+#define SYMBOL_WINDSTART ((SymbolType)21)
+#define SYMBOL_WINDEND ((SymbolType)22)
+#define SYMBOL_WINDBACKWARD ((SymbolType)23)
+#define SYMBOL_WINDFORWARD ((SymbolType)24)
+#define SYMBOL_CLOSE ((SymbolType)25)
+#define SYMBOL_ROLLUP ((SymbolType)26)
+#define SYMBOL_ROLLDOWN ((SymbolType)27)
+#define SYMBOL_CHECKMARK ((SymbolType)28)
+#define SYMBOL_RADIOCHECKMARK ((SymbolType)29)
+#define SYMBOL_SPIN_UPDOWN ((SymbolType)30)
+#define SYMBOL_FLOAT ((SymbolType)31)
+#define SYMBOL_DOCK ((SymbolType)32)
+#define SYMBOL_HIDE ((SymbolType)33)
+#define SYMBOL_HELP ((SymbolType)34)
+#define SYMBOL_PLUS ((SymbolType)35)
+#define SYMBOL_MENU SYMBOL_SPIN_DOWN
+
+#define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW)
+
+// Border-Styles fuer SetBorder()
+typedef sal_uInt16 WindowBorderStyle;
+
+#define WINDOW_BORDER_NORMAL ((WindowBorderStyle)0x0001)
+#define WINDOW_BORDER_MONO ((WindowBorderStyle)0x0002)
+#define WINDOW_BORDER_MENU ((WindowBorderStyle)0x0010)
+#define WINDOW_BORDER_NWF ((WindowBorderStyle)0x0020)
+#define WINDOW_BORDER_NOBORDER ((WindowBorderStyle)0x1000)
+#define WINDOW_BORDER_REMOVEBORDER ((WindowBorderStyle)0x2000)
+
+#define KEY_CODE ((sal_uInt16)0x0FFF)
+
+// Modifier-Tasten
+#define KEY_SHIFT ((sal_uInt16)0x1000)
+#define KEY_MOD1 ((sal_uInt16)0x2000)
+#define KEY_MOD2 ((sal_uInt16)0x4000)
+#define KEY_MOD3 ((sal_uInt16)0x8000)
+#define KEY_MODTYPE ((sal_uInt16)0xF000)
+#define KEY_ALLMODTYPE ((sal_uInt16)0xF000)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/rsc/rscsfx.hxx b/include/rsc/rscsfx.hxx
new file mode 100644
index 000000000000..8dc9687031d5
--- /dev/null
+++ b/include/rsc/rscsfx.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 _RSCSFX_HXX
+#define _RSCSFX_HXX
+
+// StarView (RSC_NOTYPE) bis (RSC_NOTYPE + 0x190)
+// Sfx (RSC_NOTYPE + 0x200) bis (RSC_NOTYPE + 0x20F)
+#define RSC_SFX_STYLE_FAMILIES (0x100 + 0x201)
+#define RSC_SFX_STYLE_FAMILY_ITEM (0x100 + 0x202)
+#define RSC_SFX_SLOT_INFO (0x100 + 0x203)
+// StarMoney (RSC_NOTYPE + 0x210) bis (RSC_NOTYPE + 0x22F)
+// Public (RSC_NOTYPE + 0x300) bis (RSC_NOTYPE + 0x3FF)
+
+//========== S F X =======================================
+enum SfxStyleFamily { SFX_STYLE_FAMILY_CHAR = 1,
+ SFX_STYLE_FAMILY_PARA = 2,
+ SFX_STYLE_FAMILY_FRAME = 4,
+ SFX_STYLE_FAMILY_PAGE = 8,
+ SFX_STYLE_FAMILY_PSEUDO = 16,
+ SFX_STYLE_FAMILY_ALL = 0x7fff
+ };
+
+
+// SfxTemplateDialog
+#define RSC_SFX_STYLE_ITEM_LIST 0x1
+#define RSC_SFX_STYLE_ITEM_BITMAP 0x2
+#define RSC_SFX_STYLE_ITEM_TEXT 0x4
+#define RSC_SFX_STYLE_ITEM_HELPTEXT 0x8
+#define RSC_SFX_STYLE_ITEM_STYLEFAMILY 0x10
+#define RSC_SFX_STYLE_ITEM_IMAGE 0x20
+
+
+// SfxSlotInfo
+#define RSC_SFX_SLOT_INFO_SLOTNAME 0x1
+#define RSC_SFX_SLOT_INFO_HELPTEXT 0x2
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx
new file mode 100644
index 000000000000..f31be4b142f6
--- /dev/null
+++ b/include/sax/fastattribs.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 _SAX_FASTATTRIBS_HXX_
+#define _SAX_FASTATTRIBS_HXX_
+
+#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
+#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
+#include <com/sun/star/xml/Attribute.hpp>
+#include <com/sun/star/xml/FastAttribute.hpp>
+
+#include <cppuhelper/implbase1.hxx>
+#include "sax/saxdllapi.h"
+
+#include <map>
+#include <vector>
+
+namespace sax_fastparser
+{
+
+struct UnknownAttribute
+{
+ OUString maNamespaceURL;
+ OString maName;
+ OString maValue;
+
+ UnknownAttribute( const OUString& rNamespaceURL, const OString& rName, const OString& rValue );
+
+ UnknownAttribute( const OString& rName, const OString& rValue );
+
+ void FillAttribute( ::com::sun::star::xml::Attribute* pAttrib ) const;
+};
+
+typedef std::map< sal_Int32, OString > FastAttributeMap;
+typedef std::vector< UnknownAttribute > UnknownAttributeList;
+
+class SAX_DLLPUBLIC FastAttributeList : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastAttributeList >
+{
+public:
+ FastAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler >& xTokenHandler );
+ virtual ~FastAttributeList();
+
+ void clear();
+ void add( sal_Int32 nToken, const OString& rValue );
+ void addUnknown( const OUString& rNamespaceURL, const OString& rName, const OString& rValue );
+ void addUnknown( const OString& rName, const OString& rValue );
+
+ // XFastAttributeList
+ virtual ::sal_Bool SAL_CALL hasAttribute( ::sal_Int32 Token ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getValueToken( ::sal_Int32 Token ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getOptionalValueToken( ::sal_Int32 Token, ::sal_Int32 Default ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getValue( ::sal_Int32 Token ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getOptionalValue( ::sal_Int32 Token ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::xml::Attribute > SAL_CALL getUnknownAttributes( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::xml::FastAttribute > SAL_CALL getFastAttributes() throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ FastAttributeMap maAttributes;
+ UnknownAttributeList maUnknownAttributes;
+ FastAttributeMap::iterator maLastIter;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler > mxTokenHandler;
+
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sax/fshelper.hxx b/include/sax/fshelper.hxx
new file mode 100644
index 000000000000..e0945fc07ddf
--- /dev/null
+++ b/include/sax/fshelper.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 _SAX_FS_HELPER_HXX_
+#define _SAX_FS_HELPER_HXX_
+
+#include <com/sun/star/uno/XReference.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
+#include <stdarg.h>
+#include <boost/shared_ptr.hpp>
+#include <sax/fastattribs.hxx>
+
+#define FSNS(namespc, element) ((namespc << 16) | element)
+// Backwards compatibility for code that used FSEND to terminate the vararg.
+// As soon as no supported LO version has the varargs code, this can be removed entirely
+// (otherwise backports might break silently if people didn't add FSEND).
+// Ctor is there to get an error when trying to pass it to a vararg by accident.
+struct FSEND_t { FSEND_t() {}; };
+static const FSEND_t FSEND = FSEND_t();
+const sal_Int32 FSEND_internal = -1; // same as XML_TOKEN_INVALID
+
+#define SAX_ARGS_ARG( arg1, arg2, convert, num ) arg1##num, arg2##num convert
+#define SAX_ARGS_ARG1( arg1, arg2, convert ) SAX_ARGS_ARG( arg1, arg2, convert, 1 )
+#define SAX_ARGS_ARG2( arg1, arg2, convert ) SAX_ARGS_ARG1( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 2 )
+#define SAX_ARGS_ARG3( arg1, arg2, convert ) SAX_ARGS_ARG2( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 3 )
+#define SAX_ARGS_ARG4( arg1, arg2, convert ) SAX_ARGS_ARG3( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 4 )
+#define SAX_ARGS_ARG5( arg1, arg2, convert ) SAX_ARGS_ARG4( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 5 )
+#define SAX_ARGS_ARG6( arg1, arg2, convert ) SAX_ARGS_ARG5( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 6 )
+#define SAX_ARGS_ARG7( arg1, arg2, convert ) SAX_ARGS_ARG6( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 7 )
+#define SAX_ARGS_ARG8( arg1, arg2, convert ) SAX_ARGS_ARG7( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 8 )
+#define SAX_ARGS_ARG9( arg1, arg2, convert ) SAX_ARGS_ARG8( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 9 )
+#define SAX_ARGS_ARG10( arg1, arg2, convert ) SAX_ARGS_ARG9( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 10 )
+#define SAX_ARGS_ARG11( arg1, arg2, convert ) SAX_ARGS_ARG10( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 11 )
+#define SAX_ARGS_ARG12( arg1, arg2, convert ) SAX_ARGS_ARG11( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 12 )
+#define SAX_ARGS_ARG13( arg1, arg2, convert ) SAX_ARGS_ARG12( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 13 )
+#define SAX_ARGS_ARG14( arg1, arg2, convert ) SAX_ARGS_ARG13( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 14 )
+#define SAX_ARGS_ARG15( arg1, arg2, convert ) SAX_ARGS_ARG14( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 15 )
+#define SAX_ARGS_ARG16( arg1, arg2, convert ) SAX_ARGS_ARG15( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 16 )
+#define SAX_ARGS_ARG17( arg1, arg2, convert ) SAX_ARGS_ARG16( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 17 )
+#define SAX_ARGS_ARG18( arg1, arg2, convert ) SAX_ARGS_ARG17( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 18 )
+#define SAX_ARGS_ARG19( arg1, arg2, convert ) SAX_ARGS_ARG18( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 19 )
+#define SAX_ARGS_ARG20( arg1, arg2, convert ) SAX_ARGS_ARG19( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 20 )
+#define SAX_ARGS_ARG21( arg1, arg2, convert ) SAX_ARGS_ARG20( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 21 )
+#define SAX_ARGS_ARG22( arg1, arg2, convert ) SAX_ARGS_ARG21( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 22 )
+
+namespace sax_fastparser {
+
+enum MergeMarksEnum { MERGE_MARKS_APPEND = 0, MERGE_MARKS_PREPEND = 1, MERGE_MARKS_POSTPONE = 2 };
+
+typedef ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList > XFastAttributeListRef;
+
+class FastSaxSerializer;
+
+class SAX_DLLPUBLIC FastSerializerHelper
+{
+public:
+
+ FastSerializerHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream, bool bWriteHeader = true );
+
+ ~FastSerializerHelper();
+
+ /// Start an element. After the first argument there can be a number of (attribute, value) pairs.
+ void startElement(sal_Int32 elementTokenId, FSEND_t)
+ { startElementInternal( elementTokenId, FSEND_internal ); }
+ /// overload
+ void startElement(sal_Int32 elementTokenId, sal_Int32 attribute, const char* value, FSEND_t)
+ { startElementInternal( elementTokenId, attribute, value, FSEND_internal ); }
+ /// overload
+ void startElement(sal_Int32 elementTokenId, sal_Int32 attribute, const OString& value, FSEND_t)
+ { startElementInternal( elementTokenId, attribute, value.getStr(), FSEND_internal ); }
+ /// Create a single element. After the first argument there can be a number of (attribute, value) pairs.
+ void singleElement(sal_Int32 elementTokenId, FSEND_t)
+ { singleElementInternal( elementTokenId, FSEND_internal ); }
+ /// overload
+ void singleElement(sal_Int32 elementTokenId, sal_Int32 attribute, const char* value, FSEND_t)
+ { singleElementInternal( elementTokenId, attribute, value, FSEND_internal ); }
+ /// overload
+ void singleElement(sal_Int32 elementTokenId, sal_Int32 attribute, const OString& value, FSEND_t)
+ { singleElementInternal( elementTokenId, attribute, value.getStr(), FSEND_internal ); }
+ /// Start an element. After the first two arguments there can be a number of (attribute, value) pairs.
+ void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, FSEND_t)
+ { startElementInternal( FSNS( namespaceTokenId, elementTokenId), FSEND_internal ); }
+ /// overload
+ void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, sal_Int32 attribute, const char* value, FSEND_t)
+ { startElementInternal( FSNS( namespaceTokenId, elementTokenId), attribute, value, FSEND_internal ); }
+ /// overload
+ void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, sal_Int32 attribute, const OString& value, FSEND_t)
+ { startElementInternal( FSNS( namespaceTokenId, elementTokenId), attribute, value.getStr(), FSEND_internal ); }
+ /// Create a single element. After the first two arguments there can be a number of (attribute, value) pairs.
+ void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, FSEND_t)
+ { singleElementInternal( FSNS( namespaceTokenId, elementTokenId), FSEND_internal ); }
+ /// overload
+ void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, sal_Int32 attribute, const char* value, FSEND_t)
+ { singleElementInternal( FSNS( namespaceTokenId, elementTokenId), attribute, value, FSEND_internal ); }
+ /// overload
+ void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, sal_Int32 attribute, const OString& value, FSEND_t)
+ { singleElementInternal( FSNS( namespaceTokenId, elementTokenId), attribute, value.getStr(), FSEND_internal ); }
+ void endElement(sal_Int32 elementTokenId);
+ inline void endElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId)
+ { endElement( FSNS( namespaceTokenId, elementTokenId ) ); }
+
+ void singleElement(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList);
+ inline void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, XFastAttributeListRef xAttrList)
+ { singleElement(FSNS( namespaceTokenId, elementTokenId), xAttrList); }
+
+ void startElement(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList);
+ inline void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, XFastAttributeListRef xAttrList)
+ { startElement( FSNS( namespaceTokenId, elementTokenId ), xAttrList ); }
+
+ FastSerializerHelper* write(const char* value);
+ FastSerializerHelper* write(const OUString& value);
+ FastSerializerHelper* write(sal_Int32 value);
+ FastSerializerHelper* write(sal_Int64 value);
+ FastSerializerHelper* write(double value);
+
+ FastSerializerHelper* writeEscaped(const char* value);
+ FastSerializerHelper* writeEscaped(const OUString& value);
+
+ FastSerializerHelper* writeId(sal_Int32 tokenId);
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > getOutputStream();
+
+ FastAttributeList *createAttrList();
+
+ void mark( ::com::sun::star::uno::Sequence< sal_Int32 > aOrder =
+ ::com::sun::star::uno::Sequence< sal_Int32 >() );
+ void mergeTopMarks( MergeMarksEnum eMergeType = MERGE_MARKS_APPEND );
+ void copyTopMarkPush();
+ void copyTopMarkPop();
+
+ /*
+ Now create all the overloads in a typesafe way (i.e. without varargs) by creating a number of overloads
+ up to a certain reasonable limit (feel free to raise it). This would be a lot easier with C++11 vararg templates.
+ */
+ // now overloads for 2 and more pairs
+ #define SAX_ARGS_FUNC_DECL( argsdecl, argsuse ) \
+ void startElement(sal_Int32 elementTokenId, argsdecl, FSEND_t) \
+ { startElementInternal( elementTokenId, argsuse, FSEND_internal ); } \
+ void singleElement(sal_Int32 elementTokenId, argsdecl, FSEND_t) \
+ { singleElementInternal( elementTokenId, argsuse, FSEND_internal ); } \
+ void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, argsdecl, FSEND_t) \
+ { startElementInternal( FSNS( namespaceTokenId, elementTokenId), argsuse, FSEND_internal ); } \
+ void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, argsdecl, FSEND_t) \
+ { singleElementInternal( FSNS( namespaceTokenId, elementTokenId), argsuse, FSEND_internal ); }
+ #define SAX_ARGS_FUNC_NUM( decl1, decl2, use1, use2, convert, num ) \
+ SAX_ARGS_FUNC_DECL( SAX_ARGS_ARG##num( decl1, decl2, ), SAX_ARGS_ARG##num( use1, use2, convert ))
+ #define SAX_ARGS_FUNC_SUBST( type, convert, num ) \
+ SAX_ARGS_FUNC_NUM( sal_Int32 attribute, type value, attribute, value, convert, num )
+ #define SAX_ARGS_FUNC( arg, convert ) SAX_ARGS_FUNC_SUBST( arg, convert, 2 ) \
+ SAX_ARGS_FUNC_SUBST( arg, convert, 3 ) SAX_ARGS_FUNC_SUBST( arg, convert, 4 ) \
+ SAX_ARGS_FUNC_SUBST( arg, convert, 5 ) SAX_ARGS_FUNC_SUBST( arg, convert, 6 ) \
+ SAX_ARGS_FUNC_SUBST( arg, convert, 7 ) SAX_ARGS_FUNC_SUBST( arg, convert, 8 ) \
+ SAX_ARGS_FUNC_SUBST( arg, convert, 9 ) SAX_ARGS_FUNC_SUBST( arg, convert, 10 ) \
+ SAX_ARGS_FUNC_SUBST( arg, convert, 11 ) SAX_ARGS_FUNC_SUBST( arg, convert, 12 ) \
+ SAX_ARGS_FUNC_SUBST( arg, convert, 13 ) SAX_ARGS_FUNC_SUBST( arg, convert, 14 ) \
+ SAX_ARGS_FUNC_SUBST( arg, convert, 15 ) SAX_ARGS_FUNC_SUBST( arg, convert, 16 ) \
+ SAX_ARGS_FUNC_SUBST( arg, convert, 17 ) SAX_ARGS_FUNC_SUBST( arg, convert, 18 ) \
+ SAX_ARGS_FUNC_SUBST( arg, convert, 19 ) SAX_ARGS_FUNC_SUBST( arg, convert, 20 ) \
+ SAX_ARGS_FUNC_SUBST( arg, convert, 21 ) SAX_ARGS_FUNC_SUBST( arg, convert, 22 )
+ SAX_ARGS_FUNC( const char*, )
+ SAX_ARGS_FUNC( const OString&, .getStr() )
+ #undef SAX_ARGS_FUNC_DECL
+ #undef SAX_ARGS_FUNC_NUM
+ #undef SAX_ARGS_FUNC_SUBST
+ #undef SAX_ARGS_FUNC
+
+private:
+ void startElementInternal(sal_Int32 elementTokenId, ...);
+ void singleElementInternal(sal_Int32 elementTokenId, ...);
+
+ FastSaxSerializer* mpSerializer;
+ com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastTokenHandler> mxTokenHandler;
+
+};
+
+typedef boost::shared_ptr< FastSerializerHelper > FSHelperPtr;
+
+}
+
+#endif // _SAX_FS_HELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sax/saxdllapi.h b/include/sax/saxdllapi.h
new file mode 100644
index 000000000000..e4716975bec7
--- /dev/null
+++ b/include/sax/saxdllapi.h
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SAX_DLLAPI_H
+#define INCLUDED_SAX_DLLAPI_H
+
+#include <sal/types.h>
+
+#if defined SAX_DLLIMPLEMENTATION
+#define SAX_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define SAX_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx
new file mode 100644
index 000000000000..615308c9e418
--- /dev/null
+++ b/include/sax/tools/converter.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 _SAX_CONVERTER_HXX
+#define _SAX_CONVERTER_HXX
+
+#include "sax/saxdllapi.h"
+
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/util/MeasureUnit.hpp>
+
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class Any;
+ }
+ namespace util {
+ struct Date;
+ struct DateTime;
+ struct Duration;
+ }
+} } }
+
+namespace sax {
+
+/** the Converter converts values of various types from
+ their internal represantation to the textual form used in xml
+ and back.
+
+ All unit types are expressed as com::sun::star::util::MeasureUnit
+*/
+
+
+class SAX_DLLPUBLIC Converter
+{
+public:
+ /** convert string to measure using optional min and max values*/
+ static bool convertMeasure( sal_Int32& rValue,
+ const OUString& rString,
+ sal_Int16 nTargetUnit = ::com::sun::star::util::MeasureUnit::MM_100TH,
+ sal_Int32 nMin = SAL_MIN_INT32,
+ sal_Int32 nMax = SAL_MAX_INT32 );
+
+ /** convert measure to string */
+ static void convertMeasure( OUStringBuffer& rBuffer,
+ sal_Int32 nMeasure,
+ sal_Int16 SourceUnit = ::com::sun::star::util::MeasureUnit::MM_100TH,
+ sal_Int16 nTargetUnit = ::com::sun::star::util::MeasureUnit::INCH );
+
+ /** convert string to boolean */
+ static bool convertBool( bool& rBool,
+ const OUString& rString );
+
+ /** convert boolean to string */
+ static void convertBool( OUStringBuffer& rBuffer,
+ bool bValue );
+
+ /** convert string to percent */
+ static bool convertPercent( sal_Int32& rValue,
+ const OUString& rString );
+
+ /** convert percent to string */
+ static void convertPercent( OUStringBuffer& rBuffer,
+ sal_Int32 nValue );
+
+ /** convert string to pixel measure unite */
+ static bool convertMeasurePx( sal_Int32& rValue,
+ const OUString& rString );
+
+ /** convert pixel measure unit to string */
+ static void convertMeasurePx( OUStringBuffer& rBuffer,
+ sal_Int32 nValue );
+
+ /** convert string to rgb color */
+ static bool convertColor( sal_Int32& rColor,
+ const OUString&rValue );
+
+ /** convert color to string */
+ static void convertColor( OUStringBuffer &rBuffer,
+ sal_Int32 nColor );
+
+ /** convert number to string */
+ static void convertNumber( OUStringBuffer& rBuffer,
+ sal_Int32 nNumber );
+
+ /** convert string to number with optional min and max values */
+ static bool convertNumber( sal_Int32& rValue,
+ const OUString& rString,
+ sal_Int32 nMin = SAL_MIN_INT32,
+ sal_Int32 nMax = SAL_MAX_INT32 );
+
+ /** convert string to number with optional min and max values */
+ static bool convertNumber64(sal_Int64& rValue,
+ const OUString& rString,
+ sal_Int64 nMin = SAL_MIN_INT64,
+ sal_Int64 nMax = SAL_MAX_INT64);
+
+ /** convert double number to string (using ::rtl::math) and
+ DO convert from source unit to target unit */
+ static void convertDouble( OUStringBuffer& rBuffer,
+ double fNumber,
+ bool bWriteUnits,
+ sal_Int16 nSourceUnit,
+ sal_Int16 nTargetUnit );
+
+ /** convert double number to string (using ::rtl::math) without unit conversion */
+ static void convertDouble( OUStringBuffer& rBuffer, double fNumber);
+
+ /** convert string to double number (using ::rtl::math) and DO convert from
+ source unit to target unit. */
+ static bool convertDouble( double& rValue,
+ const OUString& rString,
+ sal_Int16 nSourceUnit,
+ sal_Int16 nTargetUnit );
+
+ /** convert string to double number (using ::rtl::math) without unit conversion */
+ static bool convertDouble(double& rValue, const OUString& rString);
+
+ /** convert double to ISO "duration" string; negative durations allowed */
+ static void convertDuration(OUStringBuffer& rBuffer,
+ const double fTime);
+
+ /** convert util::Duration to ISO "duration" string */
+ static void convertDuration(OUStringBuffer& rBuffer,
+ const ::com::sun::star::util::Duration& rDuration);
+
+ /** convert ISO "duration" string to double; negative durations allowed */
+ static bool convertDuration(double & rfTime,
+ const OUString& rString);
+
+ /** convert ISO "duration" string to util::Duration */
+ static bool convertDuration(::com::sun::star::util::Duration& rDuration,
+ const OUString& rString);
+
+ /** convert util::Date to ISO "date" string */
+ static void convertDate( OUStringBuffer& rBuffer,
+ const com::sun::star::util::Date& rDate );
+
+ /** convert util::DateTime to ISO "date" or "dateTime" string */
+ static void convertDateTime( OUStringBuffer& rBuffer,
+ const com::sun::star::util::DateTime& rDateTime,
+ bool bAddTimeIf0AM = false );
+
+ /** convert ISO "date" or "dateTime" string to util::DateTime */
+ static bool convertDateTime( com::sun::star::util::DateTime& rDateTime,
+ const OUString& rString );
+
+ /** convert ISO "date" or "dateTime" string to util::DateTime or
+ util::Date */
+ static bool convertDateOrDateTime(
+ com::sun::star::util::Date & rDate,
+ com::sun::star::util::DateTime & rDateTime,
+ bool & rbDateTime,
+ const OUString & rString );
+
+ /** gets the position of the first comma after npos in the string
+ rStr. Commas inside '"' pairs are not matched */
+ static sal_Int32 indexOfComma( const OUString& rStr,
+ sal_Int32 nPos );
+
+ /** encodes the given byte sequence into Base64 */
+ static void encodeBase64(OUStringBuffer& aStrBuffer, const com::sun::star::uno::Sequence<sal_Int8>& aPass);
+
+ // Decode a base 64 encoded string into a sequence of bytes. The first
+ // version can be used for attribute values only, bacause it does not
+ // return any chars left from conversion.
+ // For text submitted throgh the SAX characters call, the later method
+ // must be used!
+ static void decodeBase64(com::sun::star::uno::Sequence<sal_Int8>& aPass, const OUString& sBuffer);
+
+ static sal_Int32 decodeBase64SomeChars(com::sun::star::uno::Sequence<sal_Int8>& aPass, const OUString& sBuffer);
+
+ static double GetConversionFactor(OUStringBuffer& rUnit, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit);
+ static sal_Int16 GetUnitFromString(const OUString& rString, sal_Int16 nDefaultUnit);
+
+ /** convert an Any to string (typesafe) */
+ static bool convertAny(OUStringBuffer& rsValue,
+ OUStringBuffer& rsType ,
+ const ::com::sun::star::uno::Any& rValue);
+
+};
+
+}
+
+#endif // _SAX_CONVERTER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sax/tools/documenthandleradapter.hxx b/include/sax/tools/documenthandleradapter.hxx
new file mode 100644
index 000000000000..5867bbbb9cac
--- /dev/null
+++ b/include/sax/tools/documenthandleradapter.hxx
@@ -0,0 +1,254 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Peter Jentsch <pjotr@guineapics.de> ]
+ *
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Peter Jentsch <pjotr@guineapics.de>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef _DOCUMENTHANDLERADAPTER_H_
+#define _DOCUMENTHANDLERADAPTER_H_
+
+#include <com/sun/star/xml/sax/SAXException.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+
+namespace sax
+{
+ /**
+ * DocumentHandlerAdapter provides a base class for simple decorators to XDocumentHandlers.
+ * It forwards all method calls to a delegate. An inheriting class only needs to override the
+ * methods it actually wants to modify.
+ *
+ * See filters/source/odfflatxml/FlatXml.cxx for an example.
+ */
+ class DocumentHandlerAdapter : public ::com::sun::star::xml::sax::XDocumentHandler
+ {
+ public:
+ // XDocumentHandler
+ virtual void SAL_CALL
+ startDocument(void) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->startDocument();
+ }
+
+ virtual void SAL_CALL
+ endDocument(void) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->endDocument();
+ }
+
+ virtual void SAL_CALL
+ startElement(const OUString& aName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs)
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->startElement(aName, xAttribs);
+ }
+
+ virtual void SAL_CALL
+ endElement(const OUString& aName) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->endElement(aName);
+ }
+
+ virtual void SAL_CALL
+ characters(const OUString& aChars) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->characters(aChars);
+ }
+
+ virtual void SAL_CALL
+ ignorableWhitespace(const OUString& aWhitespaces) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->ignorableWhitespace(aWhitespaces);
+ }
+ virtual void SAL_CALL
+ processingInstruction(const OUString& aTarget, const OUString& aData)
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->processingInstruction(aTarget, aData);
+ }
+ virtual void SAL_CALL
+ setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator)
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->setDocumentLocator(xLocator);
+ }
+ DocumentHandlerAdapter(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >& delegate);
+ DocumentHandlerAdapter() :
+ m_handler(::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > (0, ::com::sun::star::uno::UNO_QUERY))
+ {
+ }
+ ;
+
+ protected:
+ virtual void SAL_CALL
+ setDelegate(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >& delegate)
+ {
+ m_handler = delegate;
+ }
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > SAL_CALL
+ getDelegate()
+ {
+ return m_handler;
+ }
+ virtual
+ ~DocumentHandlerAdapter()
+ {
+
+ }
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_handler;
+
+ };
+
+ /**
+ * ExtendedDocumentHandlerAdapter provides a base class for simple decorators to XExtendedDocumentHandlers.
+ * It forwards all method calls to a delegate. An inheriting class only needs to override the
+ * methods it actually wants to modify.
+ */
+ class ExtendedDocumentHandlerAdapter : public ::com::sun::star::xml::sax::XExtendedDocumentHandler
+
+ {
+
+ public:
+ // XDocumentHandler
+ virtual void SAL_CALL
+ startDocument(void) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->startDocument();
+ }
+
+ virtual void SAL_CALL
+ endDocument(void) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->endDocument();
+ }
+
+ virtual void SAL_CALL
+ startElement(const OUString& aName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs)
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->startElement(aName, xAttribs);
+ }
+
+ virtual void SAL_CALL
+ endElement(const OUString& aName) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->endElement(aName);
+ }
+
+ virtual void SAL_CALL
+ characters(const OUString& aChars) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->characters(aChars);
+ }
+
+ virtual void SAL_CALL
+ ignorableWhitespace(const OUString& aWhitespaces) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->ignorableWhitespace(aWhitespaces);
+ }
+ virtual void SAL_CALL
+ processingInstruction(const OUString& aTarget, const OUString& aData)
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->processingInstruction(aTarget, aData);
+ }
+ virtual void SAL_CALL
+ setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator)
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->setDocumentLocator(xLocator);
+ }
+ // XExtendedDocumentHandler
+ virtual void SAL_CALL
+ startCDATA(void) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->startCDATA();
+ }
+ virtual void SAL_CALL
+ endCDATA(void) throw (::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->endCDATA();
+ }
+ virtual void SAL_CALL
+ comment(const OUString& sComment) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->comment(sComment);
+ }
+ virtual void SAL_CALL
+ unknown(const OUString& sString) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->unknown(sString);
+ }
+ virtual void SAL_CALL
+ allowLineBreak(void) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->allowLineBreak();
+ }
+ protected:
+ ExtendedDocumentHandlerAdapter() :
+ m_handler(::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > (0, ::com::sun::star::uno::UNO_QUERY))
+ {
+ }
+ ExtendedDocumentHandlerAdapter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > delegate) :
+ m_handler(delegate)
+ {
+ }
+
+ virtual void SAL_CALL
+ setDelegate(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler >& delegate)
+ {
+ m_handler = delegate;
+ }
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > SAL_CALL
+ getDelegate()
+ {
+ return m_handler;
+ }
+ virtual
+ ~ExtendedDocumentHandlerAdapter()
+ {
+
+ }
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > m_handler;
+ };
+}
+#endif /* _DOCUMENTHANDLERADAPTER_H_ */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/DocumentMetadataAccess.hxx b/include/sfx2/DocumentMetadataAccess.hxx
new file mode 100644
index 000000000000..d81401266ac3
--- /dev/null
+++ b/include/sfx2/DocumentMetadataAccess.hxx
@@ -0,0 +1,208 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SFX_DOCUMENTMETADATAACCESS_HXX_
+#define _SFX_DOCUMENTMETADATAACCESS_HXX_
+
+#include <sal/config.h>
+
+#include <sfx2/dllapi.h>
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
+#include <com/sun/star/rdf/XRepositorySupplier.hpp>
+
+#include <cppuhelper/implbase1.hxx>
+
+#include <boost/utility.hpp>
+
+#include <memory>
+
+
+/** Implementation of the interface com.sun.star.rdf.XDocumentMetadataAccess
+
+ This is not a service only because it needs some kind of XML ID registry
+ from the document, and i do not like defining an API for that.
+ Also, the implementation does _no_ locking, so make sure access is
+ protected externally.
+
+ @author mst
+ */
+
+namespace com { namespace sun { namespace star { namespace embed {
+ class XStorage;
+} } } }
+
+namespace sfx2 {
+
+
+/** create a base URI for loading metadata from an ODF (sub)document.
+
+ @param i_xContext component context
+ @param i_xStorage storage for the document; FileSystemStorage is allowed
+ @param i_rPkgURI the URI for the package
+ @param i_rSubDocument (optional) path of the subdocument in package
+
+ @return a base URI suitable for XDocumentMetadataAccess::loadFromStorage
+ */
+::com::sun::star::uno::Reference< ::com::sun::star::rdf::XURI> SFX2_DLLPUBLIC
+createBaseURI(
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>
+ const & i_xContext,
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage>
+ const & i_xStorage,
+ OUString const & i_rPkgURI,
+ OUString const & i_rSubDocument = OUString());
+
+
+class IXmlIdRegistrySupplier;
+struct DocumentMetadataAccess_Impl;
+
+
+class SFX2_DLLPUBLIC DocumentMetadataAccess :
+ private boost::noncopyable,
+ public ::cppu::WeakImplHelper1<
+ ::com::sun::star::rdf::XDocumentMetadataAccess>
+{
+public:
+ explicit DocumentMetadataAccess(::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & i_xContext,
+ IXmlIdRegistrySupplier const & i_rRegistrySupplier,
+ OUString const & i_rBaseURI);
+ // N.B.: in contrast to previous, this constructor does _not_ initialize!
+ // caller must immediately call loadFromStorage/Medium!
+ explicit DocumentMetadataAccess(::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & i_xContext,
+ IXmlIdRegistrySupplier const & i_rRegistrySupplier);
+ virtual ~DocumentMetadataAccess();
+
+ // ::com::sun::star::rdf::XNode:
+ virtual OUString SAL_CALL getStringValue()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XURI:
+ virtual OUString SAL_CALL getNamespace()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getLocalName()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XRepositorySupplier:
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XRepository > SAL_CALL getRDFRepository()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XDocumentMetadataAccess:
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > SAL_CALL
+ getElementByMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rReference)
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > SAL_CALL
+ getElementByURI(const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xURI)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > > SAL_CALL getMetadataGraphsWithType(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xType)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI> SAL_CALL
+ addMetadataFile(const OUString & i_rFileName,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XURI >
+ > & i_rTypes)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::ElementExistException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI> SAL_CALL
+ importMetadataFile(::sal_Int16 i_Format,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream > & i_xInStream,
+ const OUString & i_rFileName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xBaseURI,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XURI >
+ > & i_rTypes)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::datatransfer::UnsupportedFlavorException,
+ ::com::sun::star::container::ElementExistException,
+ ::com::sun::star::rdf::ParseException,
+ ::com::sun::star::io::IOException);
+ virtual void SAL_CALL removeMetadataFile(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xGraphName)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException);
+ virtual void SAL_CALL addContentOrStylesFile(
+ const OUString & i_rFileName)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::ElementExistException);
+ virtual void SAL_CALL removeContentOrStylesFile(
+ const OUString & i_rFileName)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException);
+
+ virtual void SAL_CALL loadMetadataFromStorage(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::embed::XStorage > & i_xStorage,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XURI > & i_xBaseURI,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::task::XInteractionHandler> & i_xHandler)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException);
+ virtual void SAL_CALL storeMetadataToStorage(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::embed::XStorage > & i_xStorage)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException);
+ virtual void SAL_CALL loadMetadataFromMedium(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue > & i_rMedium)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException);
+ virtual void SAL_CALL storeMetadataToMedium(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue > & i_rMedium)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException);
+
+private:
+ std::auto_ptr<DocumentMetadataAccess_Impl> m_pImpl;
+};
+
+} // namespace sfx2
+
+#endif // _SFX_DOCUMENTMETADATAACCESS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/Metadatable.hxx b/include/sfx2/Metadatable.hxx
new file mode 100644
index 000000000000..70737da920ce
--- /dev/null
+++ b/include/sfx2/Metadatable.hxx
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef METADATABLE_HXX
+#define METADATABLE_HXX
+
+#include <sal/config.h>
+
+#include <sfx2/dllapi.h>
+
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/rdf/XMetadatable.hpp>
+
+#include <boost/utility.hpp>
+#include <boost/shared_ptr.hpp>
+
+
+namespace com { namespace sun { namespace star {
+ namespace frame { class XModel; }
+} } }
+
+namespace sfx2 {
+ class IXmlIdRegistry;
+}
+
+namespace sfx2 {
+
+class XmlIdRegistry;
+class MetadatableUndo;
+
+
+// XML ID handling ---------------------------------------------------
+
+
+/// create a sfx2::XmlIdRegistryDocument or a sfx2::XmlIdRegistryClipboard
+SFX2_DLLPUBLIC ::sfx2::IXmlIdRegistry *
+createXmlIdRegistry(const bool i_DocIsClipboard);
+
+
+/** base class for core objects that may have xml:id.
+
+ <p>The interface of this class consists of 3 parts:
+ <ul><li>implementations that are used by the <type>MetadatableMixin</type>
+ below</li>
+ <li>hooks to be called by the sw core whenever actions that are
+ relevant to the uniqueness of xml:ids are taken (copying,
+ splitting, merging, deletion, undo, etc.)</li>
+ <li>abstract methods that are called by the implementation of the
+ previous hooks</li></ul>
+ </p>
+ */
+class SFX2_DLLPUBLIC Metadatable : private boost::noncopyable
+{
+
+public:
+ Metadatable() : m_pReg(0) {}
+
+ // destructor calls RemoveMetadataReference
+ virtual ~Metadatable();
+
+ // for MetadatableMixin ----------------------------------------------
+
+ ::com::sun::star::beans::StringPair GetMetadataReference() const;
+ void SetMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rReference);
+ void EnsureMetadataReference();
+
+ // hooks -------------------------------------------------------------
+
+ // called from dtor!
+ void RemoveMetadataReference();
+
+ /** register this as a copy of i_rSource */
+ void RegisterAsCopyOf(Metadatable const & i_rSource,
+ const bool i_bCopyPrecedesSource = false);
+
+ /** create an Undo Metadatable, which remembers this' reference */
+ ::boost::shared_ptr<MetadatableUndo> CreateUndo() const;
+ ::boost::shared_ptr<MetadatableUndo> CreateUndoForDelete();
+
+ /** restore this from Undo Metadatable */
+ void RestoreMetadata(::boost::shared_ptr<MetadatableUndo> const& i_pUndo);
+
+ /** merge this and i_rOther into this */
+ void JoinMetadatable(Metadatable const & i_rOther,
+ const bool i_isMergedEmpty, const bool i_isOtherEmpty);
+
+ // abstract methods --------------------------------------------------
+
+ /** get the registry from the SwDoc */
+ virtual ::sfx2::IXmlIdRegistry& GetRegistry() = 0;
+
+ /** is this in a clipboard document? */
+ virtual bool IsInClipboard() const = 0;
+
+ /** is this in undo array? */
+ virtual bool IsInUndo() const = 0;
+
+ /** which stream is this in? true: content.xml; false: styles.xml */
+ virtual bool IsInContent() const = 0;
+
+ /** create XMetadatable from this.
+ note: if IsInUndo or IsInClipboard return true,
+ MakeUnoObject <em>must not</em> be called!
+ */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > MakeUnoObject() = 0;
+
+private:
+ friend class MetadatableClipboard;
+ friend class MetadatableUndo;
+
+ // note that Reg may be a XmlIdRegistryDocument or a XmlIdRegistryClipboard
+ XmlIdRegistry* m_pReg; // null => no XmlId
+};
+
+
+/** base class for UNO objects that implement <type>XMetadatable</type>.
+
+ <p>An instance of this base class is associated with an instance of
+ <type>Metadatable</type>.</p>
+ */
+class SFX2_DLLPUBLIC MetadatableMixin :
+ public ::cppu::WeakImplHelper1<
+ ::com::sun::star::rdf::XMetadatable>
+{
+
+public:
+ MetadatableMixin() {};
+
+ virtual ~MetadatableMixin() {}
+
+ // ::com::sun::star::rdf::XNode:
+ virtual OUString SAL_CALL getStringValue()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XURI:
+ virtual OUString SAL_CALL getLocalName()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getNamespace()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::rdf::XMetadatable:
+ virtual ::com::sun::star::beans::StringPair SAL_CALL getMetadataReference()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rReference)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IllegalArgumentException);
+ virtual void SAL_CALL ensureMetadataReference()
+ throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ /// get the core object corresponding to this UNO object.
+ virtual Metadatable * GetCoreObject() = 0;
+ /// get the <type>XModel</type> for the document
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
+ GetModel() = 0;
+
+};
+
+} // namespace sfx2
+
+#endif // METADATABLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/QuerySaveDocument.hxx b/include/sfx2/QuerySaveDocument.hxx
new file mode 100644
index 000000000000..e442b482ff53
--- /dev/null
+++ b/include/sfx2/QuerySaveDocument.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 SFX_QUERYSAVEDOCUMENT_HXX
+#define SFX_QUERYSAVEDOCUMENT_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+class Window;
+class String;
+/** Opens the general query save document dialog.
+ @param _pParent
+ The parent window.
+ @_rTitle
+ The title of the document.
+*/
+SFX2_DLLPUBLIC short ExecuteQuerySaveDocument(
+ Window* _pParent,const String& _rTitle);
+
+#endif //SFX_QUERYSAVEDOCUMENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/XmlIdRegistry.hxx b/include/sfx2/XmlIdRegistry.hxx
new file mode 100644
index 000000000000..a7540dc469b0
--- /dev/null
+++ b/include/sfx2/XmlIdRegistry.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 _SFX_XMLIDREGISTRY_HXX_
+#define _SFX_XMLIDREGISTRY_HXX_
+
+#include <sal/config.h>
+
+#include <sfx2/dllapi.h>
+
+#include <com/sun/star/beans/StringPair.hpp>
+
+
+namespace com { namespace sun { namespace star { namespace rdf {
+ class XMetadatable;
+} } } }
+
+namespace sfx2 {
+
+// XML ID utilities --------------------------------------------------
+
+/** is i_rIdref a valid NCName ? */
+bool SFX2_DLLPUBLIC isValidNCName(OUString const & i_rIdref);
+
+bool SFX2_DLLPUBLIC isValidXmlId(OUString const & i_rStreamName,
+ OUString const & i_rIdref);
+
+// XML ID handling ---------------------------------------------------
+
+/** interface for getElementByMetadataReference;
+ for use by sfx2::DocumentMetadataAccess
+ */
+class SFX2_DLLPUBLIC IXmlIdRegistry
+{
+
+public:
+ virtual ~IXmlIdRegistry() { }
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::rdf::XMetadatable > SAL_CALL
+ GetElementByMetadataReference(
+ const ::com::sun::star::beans::StringPair & i_rXmlId) const = 0;
+
+};
+
+/** supplier interface for the registry.
+
+ This indirection is unfortunately necessary, because the SwDocShell
+ is not always connected to a SwDoc, so we cannot guarantee that a
+ registry given to a SfxBaseModel/DocumentMetadataAccess remains valid;
+ it has to be retrieved from this supplier interface on access.
+ */
+class SFX2_DLLPUBLIC IXmlIdRegistrySupplier
+{
+
+public:
+ virtual ~IXmlIdRegistrySupplier() { }
+
+ /** override this if you have a XmlIdRegistry. */
+ virtual const IXmlIdRegistry* GetXmlIdRegistry() const { return 0; }
+
+};
+
+} // namespace sfx2
+
+#endif // _SFX_XMLIDREGISTRY_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
new file mode 100644
index 000000000000..858140d2b8be
--- /dev/null
+++ b/include/sfx2/app.hxx
@@ -0,0 +1,278 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXAPP_HXX
+#define _SFXAPP_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <tools/solar.h>
+#include <tools/errcode.hxx>
+#include <svl/smplhint.hxx>
+#include <svl/poolitem.hxx>
+#include <vcl/image.hxx>
+#include <tools/ref.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/script/XLibraryContainer.hpp>
+#include <com/sun/star/task/XStatusIndicator.hpp>
+
+// too many files including sfx2/app.hxx use VCL Application class but don't include the
+// header file because in former times SfxApplication was derived from it
+#include <vcl/svapp.hxx>
+
+#include <sfx2/shell.hxx>
+#include <vector>
+
+class Timer;
+class ApplicationEvent;
+class WorkWindow;
+class ISfxTemplateCommon;
+class BasicManager;
+class DdeService;
+class GenLink;
+class PrinterDialog;
+class Point;
+class Rectangle;
+class AppSettings;
+struct SfxChildWinContextFactory;
+class SfxAppData_Impl;
+class SfxBindings;
+class SfxChildWinFactArr_Impl;
+class SfxChildWindow;
+class SfxDispatcher;
+class SfxEventConfiguration;
+class SfxEventHint;
+class SfxItemSet;
+class SfxMedium;
+class SfxMenuCtrlFactArr_Impl;
+class SfxNewFileDialog;
+class SfxObjectShell;
+class SfxObjectShellArr_Impl;
+class SfxProgress;
+class SfxSlotPool;
+class SfxStbCtrlFactArr_Impl;
+class SfxTbxCtrlFactArr_Impl;
+class SfxTemplateDialog;
+class SfxViewFrame;
+class SfxViewFrameArr_Impl;
+class SfxViewShell;
+class SfxViewShellArr_Impl;
+class StarBASIC;
+class SfxWorkWindow;
+class SfxFilterMatcher;
+class SfxModule;
+class SfxModule;
+typedef ::std::vector<SfxModule*> SfxModuleArr_Impl;
+class Window;
+class INetURLObject;
+struct SfxChildWinFactory;
+struct SfxMenuCtrlFactory;
+struct SfxStbCtrlFactory;
+struct SfxTbxCtrlFactory;
+class SimpleResMgr;
+class ModalDialog;
+class SbxArray;
+class SbxValue;
+
+typedef ::std::vector< SfxMedium* > SfxMediumList;
+
+namespace sfx2
+{
+ class SvLinkSource;
+}
+
+//====================================================================
+
+class SfxLinkItem : public SfxPoolItem
+{
+ Link aLink;
+public:
+ virtual SfxPoolItem* Clone( SfxItemPool* = 0 ) const
+ { return new SfxLinkItem( *this ); }
+ virtual int operator==( const SfxPoolItem& rL) const
+ { return ((SfxLinkItem&)rL).aLink == aLink; }
+ SfxLinkItem( sal_uInt16 nWhichId, const Link& rValue ) : SfxPoolItem( nWhichId )
+ { aLink = rValue; }
+ const Link& GetValue() const { return aLink; }
+};
+
+//TODO/CLEANUP
+//is apparently used only in SfxPickList/SfxFrameLoader
+DECL_OBJHINT( SfxStringHint, String );
+
+#ifndef SFX_DECL_OBJECTSHELL_DEFINED
+#define SFX_DECL_OBJECTSHELL_DEFINED
+SV_DECL_REF(SfxObjectShell)
+#endif
+
+class SfxObjectShellLock;
+
+class SFX2_DLLPUBLIC SfxApplication: public SfxShell
+{
+ SAL_DLLPRIVATE static SfxApplication* pApp;
+
+ SfxAppData_Impl* pAppData_Impl;
+
+ DECL_DLLPRIVATE_LINK( GlobalBasicErrorHdl_Impl, StarBASIC* );
+
+ static SfxApplication* Create();
+ void Init();
+ void Exit();
+ void SettingsChange( sal_uInt16, const AppSettings & );
+ void Quit();
+ void Deinitialize();
+
+public:
+ TYPEINFO();
+ SFX_DECL_INTERFACE(SFX_INTERFACE_SFXAPP)
+
+ SfxApplication();
+ ~SfxApplication();
+ static SfxApplication* GetOrCreate();
+
+ // Resource Manager
+ ResMgr* GetSfxResManager();
+ static ResMgr* CreateResManager( const char *pPrefix );
+
+ // DDE
+#if defined( WNT )
+ long DdeExecute( const String& rCmd );
+#endif
+ sal_Bool InitializeDde();
+ const DdeService* GetDdeService() const;
+ DdeService* GetDdeService();
+#if defined( WNT )
+ void AddDdeTopic( SfxObjectShell* );
+#endif
+ void RemoveDdeTopic( SfxObjectShell* );
+
+ // "static" methods
+ /**
+ * @param pArgs Takes ownership
+ */
+ sal_uIntPtr LoadTemplate( SfxObjectShellLock& xDoc, const String& rFileName, sal_Bool bCopy=sal_True, SfxItemSet* pArgs = 0 );
+ SfxTemplateDialog* GetTemplateDialog();
+ Window* GetTopWindow() const;
+
+ // TODO/CLEANUP: make currently selected family a view property and so we don't need to query the status from the "TemplateCommon"
+ ISfxTemplateCommon* GetCurrentTemplateCommon( SfxBindings& );
+
+ // members
+ SfxFilterMatcher& GetFilterMatcher();
+ SfxProgress* GetProgress() const;
+ const String& GetLastSaveDirectory() const;
+ sal_uInt16 GetFreeIndex();
+ void ReleaseIndex(sal_uInt16 i);
+
+ // Basic/Scripting
+ static sal_Bool IsXScriptURL( const String& rScriptURL );
+ static OUString ChooseScript();
+ static void MacroOrganizer( sal_Int16 nTabId );
+ static ErrCode CallBasic( const String&, BasicManager*, SbxArray *pArgs, SbxValue *pRet );
+ static ErrCode CallAppBasic( const String& i_macroName, SbxArray* i_args = NULL, SbxValue* i_ret = NULL )
+ { return CallBasic( i_macroName, SfxApplication::GetOrCreate()->GetBasicManager(), i_args, i_ret ); }
+ BasicManager* GetBasicManager();
+ com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer >
+ GetDialogContainer();
+ com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer >
+ GetBasicContainer();
+ StarBASIC* GetBasic();
+ sal_uInt16 SaveBasicAndDialogContainer() const;
+
+ // misc.
+ sal_Bool GetOptions(SfxItemSet &);
+ void SetOptions(const SfxItemSet &);
+ virtual void Invalidate(sal_uInt16 nId = 0);
+ void NotifyEvent(const SfxEventHint& rEvent, bool bSynchron = true );
+ sal_Bool IsDowning() const;
+ sal_Bool IsSecureURL( const INetURLObject &rURL, const String *pReferer ) const;
+ void ResetLastDir();
+
+ SAL_DLLPRIVATE static SfxApplication* Get() { return pApp;}
+ SAL_DLLPRIVATE SfxDispatcher* GetAppDispatcher_Impl();
+ SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl();
+
+ SAL_DLLPRIVATE sal_Bool QueryExit_Impl();
+ SAL_DLLPRIVATE void SetOptions_Impl(const SfxItemSet &);
+ SAL_DLLPRIVATE bool Initialize_Impl();
+
+ SAL_DLLPRIVATE SfxAppData_Impl* Get_Impl() const { return pAppData_Impl; }
+
+ // Object-Factories/global arrays
+ SAL_DLLPRIVATE void RegisterChildWindow_Impl(SfxModule*, SfxChildWinFactory*);
+ SAL_DLLPRIVATE void RegisterChildWindowContext_Impl(SfxModule*, sal_uInt16, SfxChildWinContextFactory*);
+ SAL_DLLPRIVATE void RegisterStatusBarControl_Impl(SfxModule*, SfxStbCtrlFactory*);
+ SAL_DLLPRIVATE void RegisterMenuControl_Impl(SfxModule*, SfxMenuCtrlFactory*);
+ SAL_DLLPRIVATE void RegisterToolBoxControl_Impl( SfxModule*, SfxTbxCtrlFactory*);
+ SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl& GetTbxCtrlFactories_Impl() const;
+ SAL_DLLPRIVATE SfxStbCtrlFactArr_Impl& GetStbCtrlFactories_Impl() const;
+ SAL_DLLPRIVATE SfxMenuCtrlFactArr_Impl& GetMenuCtrlFactories_Impl() const;
+ SAL_DLLPRIVATE SfxChildWinFactArr_Impl& GetChildWinFactories_Impl() const;
+ SAL_DLLPRIVATE SfxViewFrameArr_Impl& GetViewFrames_Impl() const;
+ SAL_DLLPRIVATE SfxViewShellArr_Impl& GetViewShells_Impl() const;
+ SAL_DLLPRIVATE SfxObjectShellArr_Impl& GetObjectShells_Impl() const;
+ SAL_DLLPRIVATE void SetViewFrame_Impl(SfxViewFrame *pViewFrame);
+
+ // Slot Methods
+ // TODO/CLEANUP: still needed?
+ SAL_DLLPRIVATE void NewDocDirectExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void NewDocExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void OpenDocExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void MiscExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void MiscState_Impl(SfxItemSet &);
+ SAL_DLLPRIVATE void PropExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void PropState_Impl(SfxItemSet &);
+ SAL_DLLPRIVATE void INetExecute_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &);
+ SAL_DLLPRIVATE void OfaExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void OfaState_Impl(SfxItemSet &);
+
+ SAL_DLLPRIVATE void SetProgress_Impl(SfxProgress *);
+ SAL_DLLPRIVATE const String& GetLastDir_Impl() const;
+ SAL_DLLPRIVATE void SetLastDir_Impl( const String & );
+
+ SAL_DLLPRIVATE void Registrations_Impl();
+ SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl(const SfxViewFrame *pFrame=0) const;
+
+ // TODO/CLEANUP: still needed? -- unclear whether this comment
+ // refers to the GetDisabledSlotList_Impl() method which was
+ // already removed, or the below methods?
+ SAL_DLLPRIVATE SfxSlotPool& GetAppSlotPool_Impl() const;
+ SAL_DLLPRIVATE SfxModule* GetModule_Impl();
+ SAL_DLLPRIVATE ResMgr* GetOffResManager_Impl();
+
+ static bool loadBrandSvg(const char *pName, BitmapEx &rBitmap, int nWidth);
+
+ /** loads the application logo as used in the impress slideshow pause screen */
+ static BitmapEx GetApplicationLogo(long nWidth);
+};
+
+#define SFX_APP() SfxGetpApp()
+
+//--------------------------------------------------------------------
+
+inline SfxApplication* SfxGetpApp()
+{
+ return SfxApplication::GetOrCreate();
+}
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/appuno.hxx b/include/sfx2/appuno.hxx
new file mode 100644
index 000000000000..90bf2d5edf58
--- /dev/null
+++ b/include/sfx2/appuno.hxx
@@ -0,0 +1,108 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFX_APPUNO_HXX
+#define _SFX_APPUNO_HXX
+
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/registry/XSimpleRegistry.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/uno/Exception.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XSynchronousDispatch.hpp>
+#include <com/sun/star/frame/XNotifyingDispatch.hpp>
+#include <com/sun/star/frame/XDispatchResultListener.hpp>
+#include <com/sun/star/frame/DispatchDescriptor.hpp>
+#include <com/sun/star/frame/XDispatchInformationProvider.hpp>
+
+#include <com/sun/star/uno/Any.h>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase4.hxx>
+
+#include <tools/errcode.hxx>
+#include <sfx2/sfxuno.hxx>
+
+class SfxObjectShell;
+class SfxMacroLoader : public ::com::sun::star::frame::XDispatchProvider,
+ public ::com::sun::star::frame::XNotifyingDispatch,
+ public ::com::sun::star::frame::XSynchronousDispatch,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::com::sun::star::lang::XServiceInfo,
+ public ::com::sun::star::lang::XInitialization,
+ public ::cppu::OWeakObject
+{
+ ::com::sun::star::uno::WeakReference < ::com::sun::star::frame::XFrame > m_xFrame;
+
+ SfxObjectShell* GetObjectShell_Impl();
+
+public:
+ // XInterface, XTypeProvider, XServiceInfo
+ SFX_DECL_XINTERFACE_XTYPEPROVIDER_XSERVICEINFO
+
+ SfxMacroLoader( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& )
+ {}
+
+ static ErrCode loadMacro( const OUString& aURL, ::com::sun::star::uno::Any& rRetval, SfxObjectShell* pDoc=NULL ) throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatch > SAL_CALL
+ queryDispatch( const ::com::sun::star::util::URL& aURL, const OUString& sTargetFrameName,
+ FrameSearchFlags eSearchFlags ) throw( ::com::sun::star::uno::RuntimeException ) ;
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatch > > SAL_CALL
+ queryDispatches( const ::com::sun::star::uno::Sequence < ::com::sun::star::frame::DispatchDescriptor >& seqDescriptor )
+ throw( ::com::sun::star::uno::RuntimeException ) ;
+ virtual void SAL_CALL dispatchWithNotification( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArgs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArgs ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL dispatchWithReturnValue( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArgs ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, const ::com::sun::star::util::URL& aURL ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, const ::com::sun::star::util::URL& aURL ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+};
+
+class SfxAppDispatchProvider : public ::cppu::WeakImplHelper4< ::com::sun::star::frame::XDispatchProvider,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::frame::XDispatchInformationProvider >
+{
+ ::com::sun::star::uno::WeakReference < ::com::sun::star::frame::XFrame > m_xFrame;
+public:
+ SfxAppDispatchProvider( const com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& )
+ {}
+
+ SFX_DECL_XSERVICEINFO
+ virtual ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatch > SAL_CALL
+ queryDispatch( const ::com::sun::star::util::URL& aURL, const OUString& sTargetFrameName,
+ FrameSearchFlags eSearchFlags ) throw( ::com::sun::star::uno::RuntimeException ) ;
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatch > > SAL_CALL
+ queryDispatches( const ::com::sun::star::uno::Sequence < ::com::sun::star::frame::DispatchDescriptor >& seqDescriptor )
+ throw( ::com::sun::star::uno::RuntimeException ) ;
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedCommandGroups() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation( sal_Int16 ) throw (::com::sun::star::uno::RuntimeException);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
new file mode 100644
index 000000000000..95278e89e605
--- /dev/null
+++ b/include/sfx2/basedlgs.hxx
@@ -0,0 +1,238 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _BASEDLGS_HXX
+#define _BASEDLGS_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <vcl/builder.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/floatwin.hxx>
+#include <vcl/timer.hxx>
+
+class TabPage;
+class SfxTabPage;
+class SfxBindings;
+class SfxChildWindow;
+struct SfxChildWinInfo;
+class SfxItemSet;
+class SfxItemPool;
+class OKButton;
+class CancelButton;
+class HelpButton;
+class Button;
+class FixedLine;
+
+//There is a hack which hides the HelpId for a Dialog in SfxModelessDialog
+//and SfxDockingWindow, where it is changed into a UniqueId and cleared
+//This reverses the clear of the HelpId
+
+SFX2_DLLPUBLIC inline void reverseUniqueHelpIdHack(Window &rWindow)
+{
+ if (rWindow.GetHelpId().isEmpty())
+ rWindow.SetHelpId(rWindow.GetUniqueId());
+}
+
+// class SfxModalDialog --------------------------------------------------
+
+class SFX2_DLLPUBLIC SfxModalDialog: public ModalDialog
+{
+ sal_uInt32 nUniqId;
+ String aExtraData;
+ const SfxItemSet* pInputSet;
+ SfxItemSet* pOutputSet;
+
+private:
+ SAL_DLLPRIVATE SfxModalDialog(SfxModalDialog &); // not defined
+ SAL_DLLPRIVATE void operator =(SfxModalDialog &); // not defined
+
+ SAL_DLLPRIVATE void SetDialogData_Impl();
+ SAL_DLLPRIVATE void GetDialogData_Impl();
+ SAL_DLLPRIVATE void init();
+
+protected:
+ SfxModalDialog(Window *pParent, const ResId& );
+ SfxModalDialog(Window *pParent, const OString& rID, const OUString& rUIXMLDescription);
+ SfxModalDialog(Window* pParent, sal_uInt32 nUniqueId, WinBits nWinStyle = WB_STDMODAL );
+
+ String& GetExtraData() { return aExtraData; }
+ sal_uInt32 GetUniqId() const { return nUniqId; }
+ void SetUniqId(sal_uInt32 nSettingsId) { nUniqId = nSettingsId; }
+ SfxItemSet* GetItemSet() { return pOutputSet; }
+ void CreateOutputItemSet( SfxItemPool& rPool );
+ void CreateOutputItemSet( const SfxItemSet& rInput );
+ void SetInputSet( const SfxItemSet* pInSet ) { pInputSet = pInSet; }
+ SfxItemSet* GetOutputSetImpl() { return pOutputSet; }
+
+public:
+ ~SfxModalDialog();
+ const SfxItemSet* GetOutputItemSet() const { return pOutputSet; }
+ const SfxItemSet* GetInputItemSet() const { return pInputSet; }
+};
+
+// class SfxModelessDialog --------------------------------------------------
+class SfxModelessDialog_Impl;
+class SFX2_DLLPUBLIC SfxModelessDialog: public ModelessDialog
+{
+ SfxBindings* pBindings;
+ Size aSize;
+ SfxModelessDialog_Impl* pImp;
+
+ SAL_DLLPRIVATE SfxModelessDialog(SfxModelessDialog &); // not defined
+ SAL_DLLPRIVATE void operator =(SfxModelessDialog &); // not defined
+
+ void Init(SfxBindings *pBindinx, SfxChildWindow *pCW);
+
+protected:
+ SfxModelessDialog( SfxBindings*, SfxChildWindow*,
+ Window*, const ResId& );
+ SfxModelessDialog( SfxBindings*, SfxChildWindow*,
+ Window*, const OString& rID, const OUString& rUIXMLDescription );
+ ~SfxModelessDialog();
+ virtual sal_Bool Close();
+ virtual void Resize();
+ virtual void Move();
+ virtual void StateChanged( StateChangedType nStateChange );
+
+public:
+ virtual void FillInfo(SfxChildWinInfo&) const;
+ void Initialize (SfxChildWinInfo* pInfo);
+ virtual long Notify( NotifyEvent& rNEvt );
+ SfxBindings& GetBindings()
+ { return *pBindings; }
+
+ DECL_LINK(TimerHdl, void *);
+
+};
+
+// class SfxFloatingWindow --------------------------------------------------
+class SfxFloatingWindow_Impl;
+class SFX2_DLLPUBLIC SfxFloatingWindow: public FloatingWindow
+{
+ SfxBindings* pBindings;
+ Size aSize;
+ SfxFloatingWindow_Impl* pImp;
+
+ SAL_DLLPRIVATE SfxFloatingWindow(SfxFloatingWindow &); // not defined
+ SAL_DLLPRIVATE void operator =(SfxFloatingWindow &); // not defined
+
+protected:
+ SfxFloatingWindow( SfxBindings *pBindings,
+ SfxChildWindow *pCW,
+ Window* pParent,
+ WinBits nWinBits=WB_STDMODELESS);
+ SfxFloatingWindow( SfxBindings *pBindings,
+ SfxChildWindow *pCW,
+ Window* pParent,
+ const ResId& rResId);
+ ~SfxFloatingWindow();
+
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual sal_Bool Close();
+ virtual void Resize();
+ virtual void Move();
+ virtual long Notify( NotifyEvent& rNEvt );
+ SfxBindings& GetBindings()
+ { return *pBindings; }
+
+public:
+ virtual void FillInfo(SfxChildWinInfo&) const;
+ void Initialize (SfxChildWinInfo* pInfo);
+
+ DECL_LINK(TimerHdl, void *);
+
+};
+
+// class SfxNoLayoutSingleTabDialog --------------------------------------------------
+
+struct SingleTabDlgImpl
+{
+ SfxTabPage* m_pSfxPage;
+ FixedLine* m_pLine;
+ String m_sInfoURL;
+ Link m_aInfoLink;
+
+ SingleTabDlgImpl()
+ : m_pSfxPage(NULL)
+ , m_pLine(NULL)
+ {
+ }
+};
+
+typedef sal_uInt16* (*GetTabPageRanges)(); // liefert internationale Which-Werte
+
+class SFX2_DLLPUBLIC SfxSingleTabDialogBase : public SfxModalDialog
+{
+public:
+ //layout ctor
+ SfxSingleTabDialogBase(Window* pParent, const SfxItemSet& rOptionsSet);
+
+ //non-layout ctors
+ SfxSingleTabDialogBase( Window* pParent, const SfxItemSet& rOptionsSet, sal_uInt16 nUniqueId );
+ SfxSingleTabDialogBase( Window* pParent, sal_uInt16 nUniqueId, const SfxItemSet* pInSet = 0 );
+
+ virtual ~SfxSingleTabDialogBase();
+
+ SfxTabPage* GetTabPage() const { return pImpl->m_pSfxPage; }
+
+ OKButton* GetOKButton() const { return pOKBtn; }
+ CancelButton* GetCancelButton() const { return pCancelBtn; }
+
+protected:
+ GetTabPageRanges fnGetRanges;
+
+ OKButton* pOKBtn;
+ CancelButton* pCancelBtn;
+ HelpButton* pHelpBtn;
+
+ SingleTabDlgImpl* pImpl;
+
+ DECL_DLLPRIVATE_LINK(OKHdl_Impl, void *);
+};
+
+class SFX2_DLLPUBLIC SfxSingleTabDialog : public SfxSingleTabDialogBase
+{
+public:
+ SfxSingleTabDialog(Window* pParent, const SfxItemSet& rOptionsSet)
+ : SfxSingleTabDialogBase(pParent, rOptionsSet)
+ {
+ }
+ void setTabPage(SfxTabPage* pTabPage, GetTabPageRanges pRangesFunc = 0, sal_uInt32 nSettingsId = 0);
+};
+
+//Old school deprecated non-layout aware version
+class SFX2_DLLPUBLIC SfxNoLayoutSingleTabDialog : public SfxSingleTabDialogBase
+{
+public:
+ SfxNoLayoutSingleTabDialog(Window* pParent, const SfxItemSet& rOptionsSet, sal_uInt16 nUniqueId)
+ : SfxSingleTabDialogBase(pParent, rOptionsSet, nUniqueId)
+ {
+ }
+ SfxNoLayoutSingleTabDialog(Window* pParent, sal_uInt16 nUniqueId, const SfxItemSet* pInSet = 0)
+ : SfxSingleTabDialogBase(pParent, nUniqueId, pInSet)
+ {
+ }
+ ~SfxNoLayoutSingleTabDialog();
+ void SetTabPage(SfxTabPage* pTabPage, GetTabPageRanges pRangesFunc = 0);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/bindings.hxx b/include/sfx2/bindings.hxx
new file mode 100644
index 000000000000..664673cf66d5
--- /dev/null
+++ b/include/sfx2/bindings.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 _SFX_BINDINGS_HXX
+#define _SFX_BINDINGS_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include "rtl/strbuf.hxx"
+#include <tools/link.hxx>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
+#include <vector>
+
+//________________________________________________________________________________________________________________
+// some other includes
+//________________________________________________________________________________________________________________
+
+#include <sfx2/viewfrm.hxx>
+
+//________________________________________________________________________________________________________________
+// forwards, typedefs, declarations
+//________________________________________________________________________________________________________________
+
+class SystemWindow;
+class SfxSlot;
+class SfxSlotServer;
+class SfxControllerItem;
+class SfxStateCache;
+class SfxItemSet;
+class SfxDispatcher;
+class SfxBindings;
+class SfxBindings_Impl;
+class Timer;
+struct SfxFoundCache_Impl;
+class SfxFoundCacheArr_Impl;
+class SfxWorkWindow;
+class SfxUnoControllerItem;
+
+typedef std::vector<SfxUnoControllerItem*> SfxUnoControllerArr_Impl;
+
+#define SFX_CALLMODE_SLOT 0x00 // sync/async from Slot
+#define SFX_CALLMODE_SYNCHRON 0x01 // synchronously in the same Stackframe
+#define SFX_CALLMODE_ASYNCHRON 0x02 // asynchronously via AppEvent
+#define SFX_CALLMODE_RECORD 0x04 // take into accont while recording
+#define SFX_CALLMODE_API 0x08 // API call (silent)
+#define SFX_CALLMODE_MODAL 0x10 // despite ModalMode
+
+#define SFX_CALLMODE_STANDARD SFX_CALLMODE_RECORD
+typedef sal_uInt16 SfxCallMode;
+
+enum SfxPopupAction
+{
+ SFX_POPUP_DELETE,
+ SFX_POPUP_HIDE,
+ SFX_POPUP_SHOW
+};
+
+//====================================================================
+class SFX2_DLLPUBLIC SfxBindings: public SfxBroadcaster
+
+/* [Description]
+
+ In each SFx application one instance of the SfxBindings-Class will
+ exists from <SfxApplication::Init()> until <SfxApplication::Exit()>.
+ This instance is automatically created and destroyed by SfxApplication.
+ However these instances will be handled by the Macro <SFX_BINDINGS>
+ or the associated <SfxViewFrame>.
+
+ The SfxBindings manages all of its Slot-Ids bound by the registerd
+ controllers and keeps a cache of the <Slot-Server> respectively.
+ (it is what we call the combination of SfxShell instance and SfxSlot).
+ In the SfxBindings it is stored, if and in this case which controllers
+ that are dirty and which Slot-Server-Caches are dirty respectively.
+ It summarizes status queries (calls to the status methods specified
+ in the IDL) that are served by the same state methods, and handles
+ the simulation of <Pseudo-Slots>.
+*/
+
+{
+friend class SfxApplication;
+friend class SfxShell;
+friend class SfxBindings_Impl;
+
+ SfxBindings_Impl*pImp; // Data of the Bindings instance
+ SfxDispatcher* pDispatcher; // Dispatcher, to be used
+ sal_uInt16 nRegLevel; // Lock-Level while Reconfig
+
+private:
+ SAL_DLLPRIVATE const SfxPoolItem* Execute_Impl( sal_uInt16 nSlot, const SfxPoolItem **pArgs, sal_uInt16 nModi,
+ SfxCallMode nCall, const SfxPoolItem **pInternalArgs, sal_Bool bGlobalOnly=sal_False);
+ SAL_DLLPRIVATE void SetSubBindings_Impl( SfxBindings* );
+ SAL_DLLPRIVATE void UpdateSlotServer_Impl(); // Update SlotServer
+ SAL_DLLPRIVATE SfxItemSet* CreateSet_Impl( SfxStateCache* &pCache,
+ const SfxSlot* &pRealSlot,
+ const SfxSlotServer**,
+ SfxFoundCacheArr_Impl& );
+ SAL_DLLPRIVATE sal_uInt16 GetSlotPos( sal_uInt16 nId, sal_uInt16 nStartSearchAt = 0 );
+ SAL_DLLPRIVATE void Update_Impl( SfxStateCache* pCache );
+ SAL_DLLPRIVATE void UpdateControllers_Impl(
+ const SfxInterface* pIF,
+ const SfxFoundCache_Impl* pFound,
+ const SfxPoolItem *pItem,
+ SfxItemState eItemState );
+ SAL_DLLPRIVATE SfxStateCache* GetStateCache( sal_uInt16 nId, sal_uInt16 *pPos);
+ DECL_DLLPRIVATE_LINK( NextJob_Impl, Timer * );
+
+public:
+ SfxBindings();
+ ~SfxBindings();
+
+ void HidePopups( bool bHide = true );
+ SAL_DLLPRIVATE void HidePopupCtrls_Impl( bool bHide = true );
+
+ void SetDispatcher(SfxDispatcher *pDisp);
+
+ void Update( sal_uInt16 nId ); // For example, from Menu::Activate
+ void Update();
+ SAL_DLLPRIVATE void StartUpdate_Impl(sal_Bool bComplete=sal_False);
+ void Invalidate( sal_uInt16 nId );
+ void Invalidate( const sal_uInt16* pIds );
+ void InvalidateShell( const SfxShell &rSh, sal_Bool bDeep = sal_False );
+ void InvalidateAll( sal_Bool bWithMsg );
+ void SetState( const SfxItemSet &rSet );
+ void SetState( const SfxPoolItem &rItem );
+ void Invalidate( sal_uInt16 nId, sal_Bool bWithItem, sal_Bool bWithMsg=sal_False);
+ void Invalidate( sal_uInt16 nId, sal_Bool bWithMsg);
+ sal_Bool IsInUpdate() const;
+ void SetVisibleState( sal_uInt16 nId, sal_Bool bShow );
+
+ sal_Bool IsBound( sal_uInt16 nMsgId, sal_uInt16 nStartSearchAt = 0 );
+
+ const SfxSlot* GetSlot( sal_uInt16 nMsgId );
+ SfxStateCache* GetStateCache( sal_uInt16 nId);
+ SAL_DLLPRIVATE SfxStateCache* GetAnyStateCache_Impl( sal_uInt16 nId );
+ /**
+ * @param rpState the caller has to delete the pointer
+ */
+ SfxItemState QueryState( sal_uInt16 nSID, SfxPoolItem* &rpState );
+
+ const SfxPoolItem* ExecuteSynchron( sal_uInt16 nSlot,
+ const SfxPoolItem **pArgs = 0,
+ sal_uInt16 nModi = 0,
+ const SfxPoolItem **pInternalArgs = 0);
+ sal_Bool Execute( sal_uInt16 nSlot,
+ const SfxPoolItem **pArgs = 0,
+ sal_uInt16 nModi = 0,
+ SfxCallMode nCall = SFX_CALLMODE_SLOT,
+ const SfxPoolItem **pInternalArgs = 0);
+
+ SAL_DLLPRIVATE void SetDispatchProvider_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & rFrame );
+ SAL_DLLPRIVATE const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & GetDispatchProvider_Impl() const;
+ void SetActiveFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & rFrame );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > GetActiveFrame() const;
+ // Reconfig
+ int IsInRegistrations() const;
+ sal_uInt16 EnterRegistrations(const char *pFile = 0, int nLine = 0);
+ void LeaveRegistrations( sal_uInt16 nLevel = USHRT_MAX, const char *pFile = 0, int nLine = 0 );
+ void Register( SfxControllerItem& rBinding );
+ void Release( SfxControllerItem& rBinding );
+ SystemWindow* GetSystemWindow() const;
+ SfxDispatcher* GetDispatcher() const
+ { return pDispatcher; }
+ com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > GetRecorder() const;
+ com::sun::star::uno::Reference < com::sun::star::frame::XDispatch >
+ GetDispatch( const SfxSlot*, const com::sun::star::util::URL& aURL, sal_Bool bMasterCommand );
+ SAL_DLLPRIVATE void ContextChanged_Impl();
+ SAL_DLLPRIVATE void Execute_Impl( SfxRequest& rReq, const SfxSlot* pSlot, SfxShell* pShell );
+ SAL_DLLPRIVATE void DeleteControllers_Impl();
+ SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl() { return pDispatcher; }
+ SAL_DLLPRIVATE void ClearCache_Impl( sal_uInt16 nSlotId );
+ SAL_DLLPRIVATE sal_Bool IsInUpdate_Impl() const{ return IsInUpdate(); }
+ SAL_DLLPRIVATE void RegisterInternal_Impl( SfxControllerItem& rBinding );
+ SAL_DLLPRIVATE void Register_Impl( SfxControllerItem& rBinding, sal_Bool );
+ SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl() const;
+ SAL_DLLPRIVATE void SetWorkWindow_Impl( SfxWorkWindow* );
+ SAL_DLLPRIVATE SfxBindings* GetSubBindings_Impl( sal_Bool bTop = sal_False ) const;
+ SAL_DLLPRIVATE void InvalidateUnoControllers_Impl();
+ SAL_DLLPRIVATE void RegisterUnoController_Impl( SfxUnoControllerItem* );
+ SAL_DLLPRIVATE void ReleaseUnoController_Impl( SfxUnoControllerItem* );
+ SAL_DLLPRIVATE sal_Bool ExecuteCommand_Impl( const String& rCommand );
+ SAL_DLLPRIVATE void SetRecorder_Impl( com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder >& );
+ SAL_DLLPRIVATE void InvalidateSlotsInMap_Impl();
+ SAL_DLLPRIVATE void AddSlotToInvalidateSlotsMap_Impl( sal_uInt16 nId );
+};
+
+#ifdef DBG_UTIL
+#define ENTERREGISTRATIONS() EnterRegistrations(__FILE__, __LINE__)
+#define LEAVEREGISTRATIONS() LeaveRegistrations(USHRT_MAX, __FILE__, __LINE__)
+#define DENTERREGISTRATIONS() \
+ EnterRegistrations( OStringBuffer(__FILE__).append('(').append(reinterpret_cast<sal_Int64>(this)).append(')').getStr(), __LINE__ )
+#define DLEAVEREGISTRATIONS( ) \
+ LeaveRegistrations( USHRT_MAX, OStringBuffer(__FILE__).append('(').append(reinterpret_cast<sal_Int64>(this)).append(')').getStr(), __LINE__ )
+#else
+#define ENTERREGISTRATIONS() EnterRegistrations()
+#define LEAVEREGISTRATIONS() LeaveRegistrations()
+#define DENTERREGISTRATIONS() EnterRegistrations()
+#define DLEAVEREGISTRATIONS() LeaveRegistrations()
+#endif
+
+//--------------------------------------------------------------------
+
+inline int SfxBindings::IsInRegistrations() const
+
+/* [Description]
+
+ Determines whether the <SfxContollerItems> SfxBindings instance is
+ registerd or unregisted, i.e. <SfxBindings::EnterRegistrations()>
+ calls that have not been closed by <SfxBindings::LeaveRegistrations()>.
+
+ [Return value]
+
+ int sal_True
+ The SfxBindings instance is currently in
+ Registration-Mode. No status updates .
+
+ int sal_False
+ The SfxBindings instance is the normal mode.
+ Status updates can be done.
+*/
+
+{
+ return 0 != nRegLevel;
+}
+
+//--------------------------------------------------------------------
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/brokenpackageint.hxx b/include/sfx2/brokenpackageint.hxx
new file mode 100644
index 000000000000..85cd33402f3c
--- /dev/null
+++ b/include/sfx2/brokenpackageint.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 .
+ */
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <com/sun/star/document/BrokenPackageRequest.hpp>
+#include <com/sun/star/task/XInteractionApprove.hpp>
+#include <com/sun/star/task/XInteractionDisapprove.hpp>
+
+class RequestPackageReparation_Impl;
+class SFX2_DLLPUBLIC RequestPackageReparation
+{
+ RequestPackageReparation_Impl* pImp;
+public:
+ RequestPackageReparation( OUString aName );
+ ~RequestPackageReparation();
+ sal_Bool isApproved();
+ com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > GetRequest();
+};
+
+class NotifyBrokenPackage_Impl;
+class SFX2_DLLPUBLIC NotifyBrokenPackage
+{
+ NotifyBrokenPackage_Impl* pImp;
+public:
+ NotifyBrokenPackage( OUString aName );
+ ~NotifyBrokenPackage();
+ sal_Bool isAborted();
+ com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > GetRequest();
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/chalign.hxx b/include/sfx2/chalign.hxx
new file mode 100644
index 000000000000..f8bf451e2b22
--- /dev/null
+++ b/include/sfx2/chalign.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 _SFX_CHILDALIGN_HXX
+#define _SFX_CHILDALIGN_HXX
+
+#include <tools/solar.h>
+
+// New order: first, navigation bar, then vertically docked child windows
+// (Explorer!), then horizontally docked child windows (Browser!),
+// then the format bar, status bar, and at the end of the toolbar.
+
+enum SfxChildAlignment
+{
+ SFX_ALIGN_HIGHESTTOP, // for example Navigation bar
+ SFX_ALIGN_LOWESTBOTTOM,
+ SFX_ALIGN_FIRSTLEFT,
+ SFX_ALIGN_LASTRIGHT,
+ SFX_ALIGN_LEFT, // for example SplitWindow
+ SFX_ALIGN_RIGHT,
+ SFX_ALIGN_LASTLEFT,
+ SFX_ALIGN_FIRSTRIGHT,
+ SFX_ALIGN_TOP, // for example Hyperlink-Builder, SplitWindow
+ SFX_ALIGN_BOTTOM, // for example SplitWindow
+ SFX_ALIGN_TOOLBOXTOP, // for example Objekt bar
+ SFX_ALIGN_TOOLBOXBOTTOM,
+ SFX_ALIGN_LOWESTTOP, // for example Calc bar
+ SFX_ALIGN_HIGHESTBOTTOM, // for example Status bar
+ SFX_ALIGN_TOOLBOXLEFT, // for example Tool bar
+ SFX_ALIGN_TOOLBOXRIGHT,
+ SFX_ALIGN_NOALIGNMENT // all FloatingWindows
+};
+
+// Verifies that a valid alignment is used
+inline sal_Bool SfxChildAlignValid( SfxChildAlignment eAlign )
+{
+ return ( eAlign >= SFX_ALIGN_HIGHESTTOP && eAlign <= SFX_ALIGN_NOALIGNMENT );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/checkin.hxx b/include/sfx2/checkin.hxx
new file mode 100644
index 000000000000..9a9c20f485d7
--- /dev/null
+++ b/include/sfx2/checkin.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/.
+ */
+#ifndef _SFX_CHECKIN_HXX
+#define _SFX_CHECKIN_HXX
+
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/edit.hxx>
+
+class SfxCheckinDialog : public ModalDialog
+{
+ private:
+ Edit* m_pCommentED;
+ CheckBox* m_pMajorCB;
+
+ OKButton* m_pOKBtn;
+
+ DECL_DLLPRIVATE_LINK(OKHdl, void *);
+
+ public:
+ SfxCheckinDialog( Window* pParent );
+
+ OUString GetComment( );
+ bool IsMajor( );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
new file mode 100644
index 000000000000..d0c5e50fce1f
--- /dev/null
+++ b/include/sfx2/childwin.hxx
@@ -0,0 +1,370 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFX_CHILDWIN_HXX
+#define _SFX_CHILDWIN_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <vcl/window.hxx>
+#include <com/sun/star/frame/XFrame.hpp>
+
+#include <sfx2/shell.hxx>
+#include <sfx2/chalign.hxx>
+#include <boost/ptr_container/ptr_vector.hpp>
+
+class SfxWorkWindow;
+class SfxModule;
+class SfxBindings;
+class SfxShell;
+class SfxChildWindow;
+class SfxChildWindowContext;
+
+#define SFX_CHILDWIN_ZOOMIN 0x01 // Fully retracted Float
+#define SFX_CHILDWIN_SMALL 0x02 // Half retracted Float
+#define SFX_CHILDWIN_FORCEDOCK 0x04 // Float forbidden
+#define SFX_CHILDWIN_AUTOHIDE 0x08 // DockingWindow in AutoHide mode
+#define SFX_CHILDWIN_TASK 0x10 // ChildWindow inside the Task
+#define SFX_CHILDWIN_CANTGETFOCUS 0x20 // ChildWindow can not get focus
+#define SFX_CHILDWIN_ALWAYSAVAILABLE 0x40 // ChildWindow is never disabled
+#define SFX_CHILDWIN_NEVERHIDE 0x80 // ChildWindow is can always made
+ // visible/is visible
+#define CHILDWIN_NOPOS USHRT_MAX
+
+// ChildWindow Configuration
+struct SfxChildWinInfo
+{
+ sal_Bool bVisible;
+ Point aPos;
+ Size aSize;
+ sal_uInt16 nFlags;
+ String aExtraString;
+ OString aWinState;
+
+ SfxChildWinInfo()
+ {
+ bVisible = sal_False;
+ nFlags = 0;
+ }
+ sal_Bool GetExtraData_Impl( SfxChildAlignment *pAlign,
+ SfxChildAlignment *pLastAlign = 0,
+ Size *pSize = 0,
+ sal_uInt16 *pLine = 0,
+ sal_uInt16 *pPos = 0 ) const;
+};
+
+// ChildWindow factory methods
+typedef SfxChildWindow* (*SfxChildWinCtor)( ::Window *pParentWindow,
+ sal_uInt16 nId,
+ SfxBindings *pBindings,
+ SfxChildWinInfo *pInfo);
+
+// ChildWindowsContexts factory methods
+typedef SfxChildWindowContext* (*SfxChildWinContextCtor)( ::Window *pParentWindow,
+ SfxBindings *pBindings,
+ SfxChildWinInfo *pInfo);
+struct SfxChildWinContextFactory
+{
+ SfxChildWinContextCtor pCtor; // Factory method
+ sal_uInt16 nContextId; // Idenifier for SfxInterface
+ SfxChildWinInfo aInfo; // Configuration
+
+ SfxChildWinContextFactory( SfxChildWinContextCtor pTheCtor, sal_uInt16 nID )
+ : pCtor(pTheCtor)
+ , nContextId(nID)
+ {}
+};
+
+typedef boost::ptr_vector<SfxChildWinContextFactory> SfxChildWinContextArr_Impl;
+
+struct SfxChildWinFactory
+{
+ SfxChildWinCtor pCtor; // Factory method
+ sal_uInt16 nId; // ChildWindow-Id ( SlotId )
+ SfxChildWinInfo aInfo; // Configuration
+ sal_uInt16 nPos; // Position in UI
+ SfxChildWinContextArr_Impl *pArr; // Array for Contexts
+
+ SfxChildWinFactory( SfxChildWinCtor pTheCtor, sal_uInt16 nID,
+ sal_uInt16 n )
+ : pCtor(pTheCtor)
+ , nId( nID )
+ , nPos(n)
+ , pArr( NULL )
+ {}
+
+ ~SfxChildWinFactory()
+ {
+ delete pArr;
+ }
+
+};
+
+class FloatingWindow;
+struct SfxChildWindow_Impl;
+class SFX2_DLLPUBLIC SfxChildWindowContext
+{
+friend class SfxChildWindow;
+ ::Window* pWindow;
+ sal_uInt16 nContextId;
+
+protected:
+ SfxChildWindowContext( sal_uInt16 nId );
+
+public:
+ virtual ~SfxChildWindowContext();
+
+ void SetWindow( ::Window* pWin )
+ { pWindow=pWin; }
+ ::Window* GetWindow() const
+ { return pWindow; }
+ sal_uInt16 GetContextId() const
+ { return nContextId; }
+
+ FloatingWindow* GetFloatingWindow() const;
+
+ virtual void Resizing( Size& rSize );
+ virtual sal_Bool Close();
+ static void RegisterChildWindowContext(SfxModule*, sal_uInt16, SfxChildWinContextFactory*);
+};
+
+class SFX2_DLLPUBLIC SfxChildWindow
+{
+ ::Window* pParent; // parent window ( Topwindow )
+ sal_uInt16 nType; // ChildWindow-Id
+
+protected:
+ SfxChildAlignment eChildAlignment; // Current ::com::sun::star::drawing::Alignment
+ ::Window* pWindow; // actual contents
+ SfxChildWindow_Impl* pImp; // Implementation data
+
+private:
+ SfxChildWindowContext* pContext; // With context-sensitive ChildWindows:
+ // Annother window in pWindow
+ SAL_DLLPRIVATE SfxChildWindowContext*
+ GetContext() const
+ { return pContext; }
+
+protected:
+ SfxChildWindow(::Window *pParentWindow, sal_uInt16 nId);
+
+public:
+ virtual ~SfxChildWindow();
+ void Destroy();
+ ::Window* GetWindow() const
+ { return pWindow; }
+ ::Window* GetParent() const
+ { return pParent; }
+ SfxChildAlignment GetAlignment() const
+ { return eChildAlignment; }
+ void SetAlignment(SfxChildAlignment eAlign);
+ Size GetSizePixel() const
+ { return pWindow->GetSizePixel(); }
+ void SetPosSizePixel(const Point& rPoint, const Size& rSize)
+ { pWindow->SetPosSizePixel(rPoint, rSize); }
+ Point GetPosPixel()
+ { return pWindow->GetPosPixel(); }
+ virtual void Hide();
+ virtual void Show( sal_uInt16 nFlags );
+ sal_uInt16 GetFlags() const
+ { return GetInfo().nFlags; }
+ sal_Bool CanGetFocus() const;
+ sal_uInt16 GetPosition();
+ sal_uInt16 GetType()
+ { return nType; }
+
+ void CreateContext( sal_uInt16 nContextId, SfxBindings& );
+ sal_uInt16 GetContextId() const
+ { return pContext ? pContext->GetContextId(): 0; }
+
+ ::Window* GetContextWindow() const
+ { return pContext ? pContext->GetWindow(): 0; }
+
+ ::Window* GetContextWindow( SfxModule *pModule ) const;
+
+ virtual SfxChildWinInfo GetInfo() const;
+ void SaveStatus(const SfxChildWinInfo& rInfo);
+
+ static void RegisterChildWindow(SfxModule*, SfxChildWinFactory*);
+
+ static SfxChildWindow* CreateChildWindow( sal_uInt16, ::Window*, SfxBindings*, SfxChildWinInfo&);
+ void SetHideNotDelete( sal_Bool bOn );
+ sal_Bool IsHideNotDelete() const;
+ sal_Bool IsHideAtToggle() const;
+ sal_Bool IsVisible() const;
+ void SetWantsFocus( sal_Bool );
+ sal_Bool WantsFocus() const;
+
+ virtual sal_Bool QueryClose();
+ virtual com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > GetFrame();
+ void SetFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & );
+
+ SAL_DLLPRIVATE static void InitializeChildWinFactory_Impl(sal_uInt16, SfxChildWinInfo&);
+ SAL_DLLPRIVATE void SetVisible_Impl( sal_Bool bVis );
+ SAL_DLLPRIVATE void SetWorkWindow_Impl( SfxWorkWindow* );
+ SAL_DLLPRIVATE void Activate_Impl();
+ SAL_DLLPRIVATE void Deactivate_Impl();
+
+ SAL_DLLPRIVATE SfxChildWindowContext*
+ GetContext_Impl() const
+ { return pContext; }
+ SAL_DLLPRIVATE void SetFactory_Impl( SfxChildWinFactory* );
+};
+
+//------------------------------------------------------------------
+//! soon obsolete !
+#define SFX_DECL_CHILDWINDOW_CONTEXT(Class) \
+ static SfxChildWindowContext* CreateImpl(::Window *pParent, \
+ SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \
+ static void RegisterChildWindowContext(SfxModule *pMod=0); \
+
+//! The Macro of the future ...
+#define SFX_DECL_CHILDWINDOWCONTEXT(Class) \
+ static SfxChildWindowContext* CreateImpl(::Window *pParent, \
+ SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \
+ static void RegisterChildWindowContext(sal_uInt16, SfxModule *pMod=0); \
+
+//! soon obsolete !
+#define SFX_IMPL_CHILDWINDOW_CONTEXT(Class, MyID, ShellClass) \
+ SfxChildWindowContext* Class::CreateImpl( ::Window *pParent, \
+ SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \
+ { \
+ SfxChildWindowContext *pContext = new Class(pParent, \
+ /* cast is safe here! */static_cast< sal_uInt16 >(ShellClass::GetInterfaceId()), \
+ pBindings,pInfo); \
+ return pContext; \
+ } \
+ void Class::RegisterChildWindowContext(SfxModule* pMod) \
+ { \
+ SfxChildWinContextFactory *pFact = new SfxChildWinContextFactory( \
+ Class::CreateImpl, \
+ /* cast is safe here! */static_cast< sal_uInt16 >(ShellClass::GetInterfaceId()) ); \
+ SfxChildWindowContext::RegisterChildWindowContext(pMod, MyID, pFact); \
+ }
+
+//! The Macro of the future ...
+// As a parameter and because of ContextId, CreateImpl must be handed the
+// factory. As long as Id is set to 0 and patched in
+// SfxChildWindow::CreateContext
+#define SFX_IMPL_CHILDWINDOWCONTEXT(Class, MyID) \
+ SfxChildWindowContext* Class::CreateImpl( ::Window *pParent, \
+ SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \
+ { \
+ SfxChildWindowContext *pContext = new Class(pParent,0,pBindings,pInfo);\
+ return pContext; \
+ } \
+ void Class::RegisterChildWindowContext(sal_uInt16 nId, SfxModule* pMod) \
+ { \
+ SfxChildWinContextFactory *pFact = new SfxChildWinContextFactory( \
+ Class::CreateImpl, nId ); \
+ SfxChildWindowContext::RegisterChildWindowContext(pMod, MyID, pFact); \
+ }
+
+#define SFX_DECL_CHILDWINDOW(Class) \
+ public : \
+ static SfxChildWindow* CreateImpl(::Window *pParent, sal_uInt16 nId, \
+ SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \
+ static void RegisterChildWindow (sal_Bool bVisible=sal_False, SfxModule *pMod=NULL, sal_uInt16 nFlags=0); \
+ virtual SfxChildWinInfo GetInfo() const
+
+#define SFX_DECL_CHILDWINDOW_WITHID(Class) \
+ SFX_DECL_CHILDWINDOW(Class); \
+ static sal_uInt16 GetChildWindowId ()\
+
+#define SFX_IMPL_CHILDWINDOW(Class, MyID) \
+ SFX_IMPL_POS_CHILDWINDOW(Class, MyID, CHILDWIN_NOPOS)
+
+#define SFX_IMPL_CHILDWINDOW_WITHID(Class, MyID) \
+ SFX_IMPL_POS_CHILDWINDOW_WITHID(Class, MyID, CHILDWIN_NOPOS)
+
+#define SFX_IMPL_POS_CHILDWINDOW(Class, MyID, Pos) \
+ SfxChildWindow* Class::CreateImpl( ::Window *pParent, \
+ sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \
+ { \
+ SfxChildWindow *pWin = new Class(pParent, nId, pBindings, pInfo);\
+ return pWin; \
+ } \
+ void Class::RegisterChildWindow (sal_Bool bVis, SfxModule *pMod, sal_uInt16 nFlags) \
+ { \
+ SfxChildWinFactory *pFact = new SfxChildWinFactory( \
+ Class::CreateImpl, MyID, Pos ); \
+ pFact->aInfo.nFlags |= nFlags; \
+ pFact->aInfo.bVisible = bVis; \
+ SfxChildWindow::RegisterChildWindow(pMod, pFact); \
+ }
+
+#define SFX_IMPL_POS_CHILDWINDOW_WITHID(Class, MyID, Pos) \
+ SFX_IMPL_POS_CHILDWINDOW(Class, MyID, Pos) \
+ sal_uInt16 Class::GetChildWindowId () \
+ { return MyID; } \
+
+#define SFX_IMPL_FLOATINGWINDOW(Class, MyID) \
+ SFX_IMPL_CHILDWINDOW(Class, MyID) \
+ SfxChildWinInfo Class::GetInfo() const \
+ { \
+ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
+ ((SfxFloatingWindow*)GetWindow())->FillInfo( aInfo ); \
+ return aInfo; }
+
+#define SFX_IMPL_FLOATINGWINDOW_WITHID(Class, MyID) \
+ SFX_IMPL_CHILDWINDOW_WITHID(Class, MyID) \
+ SfxChildWinInfo Class::GetInfo() const \
+ { \
+ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
+ ((SfxFloatingWindow*)GetWindow())->FillInfo( aInfo ); \
+ return aInfo; }
+
+#define SFX_IMPL_MODELESSDIALOG_WITHID(Class, MyID) \
+ SFX_IMPL_CHILDWINDOW_WITHID(Class, MyID) \
+ SfxChildWinInfo Class::GetInfo() const \
+ { \
+ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
+ ((SfxModelessDialog*)GetWindow())->FillInfo( aInfo ); \
+ return aInfo; }
+
+
+#define SFX_IMPL_DOCKINGWINDOW(Class, MyID) \
+ SFX_IMPL_CHILDWINDOW(Class, MyID) \
+ SfxChildWinInfo Class::GetInfo() const \
+ { \
+ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
+ ((SfxDockingWindow*)GetWindow())->FillInfo( aInfo ); \
+ return aInfo; }
+
+#define SFX_IMPL_DOCKINGWINDOW_WITHID(Class, MyID) \
+ SFX_IMPL_CHILDWINDOW_WITHID(Class, MyID) \
+ SfxChildWinInfo Class::GetInfo() const \
+ { \
+ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
+ ((SfxDockingWindow*)GetWindow())->FillInfo( aInfo ); \
+ return aInfo; }
+
+#define SFX_IMPL_TOOLBOX(Class, MyID) \
+ SFX_IMPL_CHILDWINDOW(Class, MyID) \
+ SfxChildWinInfo Class::GetInfo() const \
+ { \
+ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
+ ((SfxToolbox*)GetWindow())->FillInfo( aInfo ); \
+ return aInfo; }
+
+//------------------------------------------------------------------
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/cntids.hrc b/include/sfx2/cntids.hrc
new file mode 100644
index 000000000000..db4c5877afd6
--- /dev/null
+++ b/include/sfx2/cntids.hrc
@@ -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 _CNTIDS_HRC
+#define _CNTIDS_HRC
+
+#include <svl/cntwids.hrc>
+#include <svl/solar.hrc>
+
+// Slot-ID's -----------------------------------------------------------------
+
+#ifndef SID_SFX_START
+// HACK() - SID's may not change its numerical value just like that,
+// sfxsids.hrc may not be included!!! Solution: sfxsids.hrc
+// include it on a lower level - for example svtools???
+#define SID_SFX_START 5000
+#endif
+#define SID_TITLE (SID_SFX_START + 307)
+#define SID_DELETE (SID_SFX_START + 713)
+#define SID_INTERNET_ONLINE (SID_SFX_START + 1370)
+
+// Don't let SID_CHAOS_END grow. Internal docking windows use the range between
+// SID_CHAOS_END and SID_LIB_START!! Look into sfxsids.hrc for more information!
+#define SID_CHAOS_START 9000
+#define SID_CHAOS_END 9799
+
+#define SID_DISTRIBUTION (SID_CHAOS_START + 26)
+#define SID_INSERT (SID_CHAOS_START + 90)
+#define SID_VIEW_FLD_PIC (SID_CHAOS_START + 185)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/controlwrapper.hxx b/include/sfx2/controlwrapper.hxx
new file mode 100644
index 000000000000..0a429b906638
--- /dev/null
+++ b/include/sfx2/controlwrapper.hxx
@@ -0,0 +1,644 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SFX_CONTROLWRAPPER_HXX
+#define SFX_CONTROLWRAPPER_HXX
+
+#include <tools/debug.hxx>
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <memory>
+
+#include <vcl/button.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/field.hxx>
+#include <vcl/lstbox.hxx>
+#include <svtools/valueset.hxx>
+#include <svtools/ctrlbox.hxx>
+
+// ============================================================================
+
+namespace sfx {
+
+// ============================================================================
+
+/** List position type of VCL ListBox. */
+typedef sal_uInt16 ListBoxPosType;
+/** List position type of SVTOOLS ValueSet. */
+typedef sal_uInt16 ValueSetPosType;
+
+// ============================================================================
+// Helpers
+// ============================================================================
+
+/** A helper class for mapping list positions from/to represented values.
+
+ Deriving from this helper class adds the two functions GetValueFromPos()
+ and GetPosFromValue(). The constructor receives an array of MapEntryType
+ structures that represents the table of positions and values. It is
+ possible to pass a null pointer, this results in a direct mapping between
+ list positions and values. If the map exists, it MUST be terminated with an
+ entry containing the special "not found" list position passed to the
+ constructor. The value contained in this last entry is used as default
+ value in case of an error.
+ */
+template< typename PosT, typename ValueT >
+class PosValueMapper
+{
+public:
+ typedef PosT PosType;
+ typedef ValueT ValueType;
+ typedef PosValueMapper< PosT, ValueT > MapperType;
+
+ /** A helper struct that contains a list position - value pair. */
+ struct MapEntryType
+ {
+ PosT mnPos; /// Position in the list.
+ ValueT mnValue; /// Corresponding value.
+ };
+
+ /** Constructs the map helper with the passed map.
+ @param nNFPos This list position is used to represent the
+ "not found" or "not existing" state.
+ @param pMap The map of list positions/values. If 0, a direct mapping
+ is used (simply casting between list position and values). If the map
+ exists, it *MUST* be terminated by an entry containing the special
+ "not found" list position. */
+ inline explicit PosValueMapper( PosT nNFPos, const MapEntryType* pMap = 0 ) :
+ mpMap( pMap ), mnNFPos( nNFPos ) {}
+
+ /** Returns the value at the specified list position.
+ @return The found value, or the value of the last map entry on error. */
+ ValueT GetValueFromPos( PosT nPos ) const;
+ /** Returns the list position of the specified value.
+ @return The position, or the special "not found" position on error. */
+ PosT GetPosFromValue( ValueT nValue ) const;
+
+ /** Returns the special "not found" list position. */
+ inline PosT GetNotFoundPos() const { return mnNFPos; }
+
+private:
+ const MapEntryType* mpMap; /// The list position/value map.
+ PosT mnNFPos; /// Special "not found" list position.
+};
+
+// ============================================================================
+// Base control wrapper classes
+// ============================================================================
+
+/** Base class for all control wrappers.
+
+ Control wrappers are used to have an equal interface for various functions
+ used in connections for different types of controls.
+
+ The current tree of base classes/templates and standard control wrappers:
+
+ ControlWrapperBase
+ |
+ +- SingleControlWrapper< ControlT, ValueT >
+ | |
+ | +- DummyWindowWrapper [1]
+ | +- CheckBoxWrapper [1]
+ | +- EditWrapper [1]
+ | +- ColorListBoxWrapper [1]
+ | |
+ | +- NumericFieldWrapper< ValueT > [1]
+ | | |
+ | | +- [ValueType]NumericFieldWrapper [1] [2]
+ | |
+ | +- MetricFieldWrapper< ValueT > [1]
+ | | |
+ | | +- [ValueType]MetricFieldWrapper [1] [2]
+ | |
+ | +- ListBoxWrapper< ValueT > [1]
+ | | |
+ | | +- [ValueType]ListBoxWrapper [1] [2]
+ | |
+ | +- ValueSetWrapper< ValueT > [1]
+ | |
+ | +- [ValueType]ValueSetWrapper [1] [2]
+ |
+ +- MultiControlWrapperHelper
+ |
+ +- MultiControlWrapper< ValueT >
+
+ Notes:
+ [1] Standard wrappers ready to use.
+ [2] [ValueType] is one of Int16, UInt16, Int32, UInt32, UShort, ULong.
+
+ See documentation of class ItemConnectionBase (itemconnect.hxx) for more
+ details.
+ */
+class SFX2_DLLPUBLIC ControlWrapperBase
+{
+public:
+ inline explicit ControlWrapperBase() {}
+ virtual ~ControlWrapperBase();
+
+ /** Derived classes enable, disable, show, or hide control(s).
+ @descr Will do nothing, if the corresponding parameter is STATE_DONTKNOW. */
+ virtual void ModifyControl( TriState eEnable, TriState eShow ) = 0;
+
+ /** Derived classes return true if the control is in "don't know" state. */
+ virtual bool IsControlDontKnow() const = 0;
+ /** Derived classes set the control to "don't know" state. */
+ virtual void SetControlDontKnow( bool bSet ) = 0;
+
+private:
+ /* Disable copy c'tor and assignment. */
+ ControlWrapperBase( const ControlWrapperBase& );
+ ControlWrapperBase& operator=( const ControlWrapperBase& );
+};
+
+// ============================================================================
+// Single control wrappers
+// ============================================================================
+
+/** Base class template for control wrappers containing one single control.
+
+ Classes created from this template store the reference to a single control
+ object. It is not required that the control is derived from VCL's Window
+ class. Derived classes have to implement the abstract functions
+ ShowControl(), EnableControl(), IsControlDontKnow(), SetControlDontKnow(),
+ GetControlValue(), and SetControlValue().
+
+ As already stated, it is not required for ControlT to be a VCL Window.
+ Anyway, ControlT must support the following functions:
+ - void ControlT::Enable( bool )
+ - void ControlT::Show( bool )
+ */
+template< typename ControlT, typename ValueT >
+class SingleControlWrapper : public ControlWrapperBase
+{
+public:
+ typedef ControlT ControlType;
+ typedef ValueT ControlValueType;
+ typedef SingleControlWrapper< ControlT, ValueT > SingleControlWrapperType;
+
+ inline explicit SingleControlWrapper( ControlT& rControl ) : mrControl( rControl ) {}
+
+ /** Returns a reference to the control this connection works on. */
+ inline const ControlT& GetControl() const { return mrControl; }
+ /** Returns a reference to the control this connection works on. */
+ inline ControlT& GetControl() { return mrControl; }
+
+ /** Enables, disables, shows, or hides the control.
+ @descr Does nothing, if the corresponding parameter is STATE_DONTKNOW. */
+ virtual void ModifyControl( TriState eEnable, TriState eShow );
+
+ /** Derived classes return the value the control contains. */
+ virtual ValueT GetControlValue() const = 0;
+ /** Derived classes set the contents of the control to the passed value. */
+ virtual void SetControlValue( ValueT aValue ) = 0;
+
+private:
+ ControlT& mrControl; /// The control of this wrapper.
+};
+
+// ============================================================================
+
+/** A dummy wrapper for a VCL Window that does nothing special.
+
+ This wrapper is used to implement the DummyItemConnection. It does not
+ connect an item to a control, but handles the special flags to disable or
+ hide a control, if an item is unknown.
+ */
+class SFX2_DLLPUBLIC DummyWindowWrapper:
+ public SingleControlWrapper< Window, void* >
+{
+public:
+ explicit DummyWindowWrapper( Window& rWindow );
+
+ virtual bool IsControlDontKnow() const;
+ virtual void SetControlDontKnow( bool );
+
+ virtual void* GetControlValue() const;
+ virtual void SetControlValue( void* );
+};
+
+// ----------------------------------------------------------------------------
+
+/** A wrapper for the VCL CheckBox. */
+class SFX2_DLLPUBLIC CheckBoxWrapper:
+ public SingleControlWrapper< CheckBox, sal_Bool >
+{
+public:
+ explicit CheckBoxWrapper( CheckBox& rCheckBox );
+
+ virtual bool IsControlDontKnow() const;
+ virtual void SetControlDontKnow( bool bSet );
+
+ virtual sal_Bool GetControlValue() const;
+ virtual void SetControlValue( sal_Bool bValue );
+};
+
+// ----------------------------------------------------------------------------
+
+/** A wrapper for the SVTOOLS ColorListBox. */
+class SFX2_DLLPUBLIC ColorListBoxWrapper:
+ public SingleControlWrapper< ColorListBox, Color >
+{
+ /* Note: cannot use 'const Color&' as template argument, because the
+ SVTOOLS ColorListBox returns the color by value and not by reference,
+ therefore GetControlValue() must return a temporary object too. */
+public:
+ explicit ColorListBoxWrapper(ColorListBox & rListBox);
+
+ virtual ~ColorListBoxWrapper();
+
+ virtual bool IsControlDontKnow() const;
+ virtual void SetControlDontKnow( bool bSet );
+
+ virtual Color GetControlValue() const;
+ virtual void SetControlValue( Color aColor );
+};
+
+// ============================================================================
+
+/** A wrapper for the VCL NumericField. */
+template< typename ValueT >
+class NumericFieldWrapper : public SingleControlWrapper< NumericField, ValueT >
+{
+public:
+ inline explicit NumericFieldWrapper( NumericField& rField ) :
+ SingleControlWrapper< NumericField, ValueT >( rField ) {}
+
+ virtual bool IsControlDontKnow() const;
+ virtual void SetControlDontKnow( bool bSet );
+
+ virtual ValueT GetControlValue() const;
+ virtual void SetControlValue( ValueT nValue );
+};
+
+// ----------------------------------------------------------------------------
+
+typedef NumericFieldWrapper< sal_Int16 > Int16NumericFieldWrapper;
+typedef NumericFieldWrapper< sal_uInt16 > UInt16NumericFieldWrapper;
+typedef NumericFieldWrapper< sal_Int32 > Int32NumericFieldWrapper;
+typedef NumericFieldWrapper< sal_uInt32 > UInt32NumericFieldWrapper;
+
+typedef NumericFieldWrapper< sal_uInt16 > UShortNumericFieldWrapper;
+typedef NumericFieldWrapper< sal_uIntPtr > ULongNumericFieldWrapper;
+
+// ============================================================================
+
+/** A wrapper for the VCL MetricField.
+
+ Adds support for field units during accessing the control value. The
+ wrapper respects the field unit set at the control itself and converts it
+ from/to the field unit passed to the constructor.
+ */
+template< typename ValueT >
+class MetricFieldWrapper : public SingleControlWrapper< MetricField, ValueT >
+{
+public:
+ inline explicit MetricFieldWrapper( MetricField& rField, FieldUnit eUnit = FUNIT_NONE ) :
+ SingleControlWrapper< MetricField, ValueT >( rField ), meUnit( eUnit ) {}
+
+ virtual bool IsControlDontKnow() const;
+ virtual void SetControlDontKnow( bool bSet );
+
+ virtual ValueT GetControlValue() const;
+ virtual void SetControlValue( ValueT nValue );
+
+private:
+ FieldUnit meUnit;
+};
+
+// ----------------------------------------------------------------------------
+
+typedef MetricFieldWrapper< sal_Int16 > Int16MetricFieldWrapper;
+typedef MetricFieldWrapper< sal_uInt16 > UInt16MetricFieldWrapper;
+typedef MetricFieldWrapper< sal_Int32 > Int32MetricFieldWrapper;
+typedef MetricFieldWrapper< sal_uInt32 > UInt32MetricFieldWrapper;
+
+typedef MetricFieldWrapper< sal_uInt16 > UShortMetricFieldWrapper;
+typedef MetricFieldWrapper< sal_uIntPtr > ULongMetricFieldWrapper;
+
+// ============================================================================
+
+/** A wrapper for the VCL ListBox.
+
+ If a position<->value map is passed to the constructor, it MUST be
+ terminated with an entry containing LISTBOX_ENTRY_NOTFOUND as list
+ position. See documentation of the PosValueMapper template for details.
+ */
+template< typename ValueT >
+class ListBoxWrapper :
+ public SingleControlWrapper< ListBox, ValueT >,
+ public PosValueMapper< ListBoxPosType, ValueT >
+{
+ typedef PosValueMapper< ListBoxPosType, ValueT > MapperType;
+
+public:
+ typedef typename MapperType::MapEntryType MapEntryType;
+
+ /** @param pMap Optional list position <-> value map.
+ See PosValueMapper documentation for details. */
+ inline explicit ListBoxWrapper( ListBox& rListBox, const MapEntryType* pMap = 0 ) :
+ SingleControlWrapper< ListBox, ValueT >( rListBox ), MapperType( LISTBOX_ENTRY_NOTFOUND, pMap ) {}
+
+ virtual bool IsControlDontKnow() const
+ { return this->GetControl().GetSelectEntryCount() == 0; }
+ virtual void SetControlDontKnow( bool bSet )
+ { if( bSet ) this->GetControl().SetNoSelection(); }
+
+ virtual ValueT GetControlValue() const;
+ virtual void SetControlValue( ValueT nValue );
+};
+
+// ----------------------------------------------------------------------------
+
+typedef ListBoxWrapper< sal_Int16 > Int16ListBoxWrapper;
+typedef ListBoxWrapper< sal_uInt16 > UInt16ListBoxWrapper;
+typedef ListBoxWrapper< sal_Int32 > Int32ListBoxWrapper;
+typedef ListBoxWrapper< sal_uInt32 > UInt32ListBoxWrapper;
+
+typedef ListBoxWrapper< sal_uInt16 > UShortListBoxWrapper;
+typedef ListBoxWrapper< sal_uIntPtr > ULongListBoxWrapper;
+
+// ============================================================================
+
+/** A wrapper for the SVTOOLS ValueSet.
+
+ If a position<->value map is passed to the constructor, it MUST be
+ terminated with an entry containing VALUESET_ITEM_NOTFOUND as list
+ position. See documentation of the PosValueMapper template for details.
+ */
+template< typename ValueT >
+class ValueSetWrapper :
+ public SingleControlWrapper< ValueSet, ValueT >,
+ public PosValueMapper< ValueSetPosType, ValueT >
+{
+ typedef PosValueMapper< ValueSetPosType, ValueT > MapperType;
+
+public:
+ typedef typename MapperType::MapEntryType MapEntryType;
+
+ /** @param pMap Optional position <-> value map.
+ See PosValueMapper documentation for details. */
+ inline explicit ValueSetWrapper( ValueSet& rValueSet, const MapEntryType* pMap = 0 ) :
+ SingleControlWrapper< ValueSet, ValueT >( rValueSet ), MapperType( VALUESET_ITEM_NOTFOUND, pMap ) {}
+
+ virtual bool IsControlDontKnow() const
+ { return this->GetControl().IsNoSelection(); }
+ virtual void SetControlDontKnow( bool bSet )
+ { if( bSet ) this->GetControl().SetNoSelection(); }
+
+ virtual ValueT GetControlValue() const;
+ virtual void SetControlValue( ValueT nValue );
+};
+
+// ----------------------------------------------------------------------------
+
+typedef ValueSetWrapper< sal_Int16 > Int16ValueSetWrapper;
+typedef ValueSetWrapper< sal_uInt16 > UInt16ValueSetWrapper;
+typedef ValueSetWrapper< sal_Int32 > Int32ValueSetWrapper;
+typedef ValueSetWrapper< sal_uInt32 > UInt32ValueSetWrapper;
+
+typedef ValueSetWrapper< sal_uInt16 > UShortValueSetWrapper;
+typedef ValueSetWrapper< sal_uIntPtr > ULongValueSetWrapper;
+
+// ============================================================================
+// Multi control wrappers
+// ============================================================================
+
+struct MultiControlWrapperHelper_Impl;
+
+/** A container of control wrappers.
+
+ Derived classes should define control wrapper members and register them in
+ their constructor, using the function RegisterControlWrapper().
+
+ This wrapper implements the abstract functions of the ControlWrapperBase
+ base class by calling the functions of all registered wrappers.
+ */
+class SFX2_DLLPUBLIC MultiControlWrapperHelper : public ControlWrapperBase
+{
+public:
+ explicit MultiControlWrapperHelper();
+ virtual ~MultiControlWrapperHelper();
+
+ /** Registers a control wrapper (should be a member of a derived class). */
+ void RegisterControlWrapper( ControlWrapperBase& rWrapper );
+
+ /** Enables, disables, shows, or hides the registered controls. */
+ virtual void ModifyControl( TriState eEnable, TriState eShow );
+
+ /** Returns true if all registered controls are in "don't know" state. */
+ virtual bool IsControlDontKnow() const;
+ /** Sets all registered controls to "don't know" state. */
+ virtual void SetControlDontKnow( bool bSet );
+
+private:
+ std::auto_ptr< MultiControlWrapperHelper_Impl > mxImpl;
+};
+
+// ----------------------------------------------------------------------------
+
+/** A multi control wrapper with extended interface.
+
+ This template class extends the MultiControlWrapperHelper class by the
+ functions GetControlValue() and SetControlValue(), known from the
+ SingleControlWrapper template. This makes it possible to use this template
+ in item connections expecting a single control wrapper. The type ValueT
+ should be able to contain the values of all controls handled in this
+ wrapper. In most cases, the easiest way to achieve this is to use the
+ related item type directly, using the IdentItemWrapper template
+ (itemwrapper.hxx).
+ */
+template< typename ValueT >
+class MultiControlWrapper : public MultiControlWrapperHelper
+{
+public:
+ typedef MultiControlWrapperHelper ControlType;
+ typedef ValueT ControlValueType;
+ typedef MultiControlWrapper< ValueT > MultiControlWrapperType;
+
+ MultiControlWrapper() : maDefValue( 0 ){}
+
+ /** Returns the default value that can be used in GetControlValue(). */
+ inline const ValueT& GetDefaultValue() const { return maDefValue; }
+ /** Sets a default value that can be used in GetControlValue(). */
+ inline void SetDefaultValue( const ValueT& rDefValue ) { maDefValue = rDefValue; }
+
+ /** Derived classes return the value the control contains. */
+ virtual ValueT GetControlValue() const = 0;
+ /** Derived classes set the contents of the control to the passed value. */
+ virtual void SetControlValue( ValueT aValue ) = 0;
+
+private:
+ ValueT maDefValue;
+};
+
+// ============================================================================
+
+
+// ============================================================================
+// *** Implementation of template functions ***
+// ============================================================================
+
+// ============================================================================
+// Helpers
+// ============================================================================
+
+template< typename PosT, typename ValueT >
+ValueT PosValueMapper< PosT, ValueT >::GetValueFromPos( PosT nPos ) const
+{
+ ValueT nValue;
+ if( mpMap )
+ {
+ const MapEntryType* pEntry = mpMap;
+ while( (pEntry->mnPos != nPos) && (pEntry->mnPos != mnNFPos) )
+ ++pEntry;
+ nValue = pEntry->mnValue;
+ }
+ else /* if( nPos != mnNFPos ) */
+ {
+ DBG_ASSERT( nPos != mnNFPos, "sfx2::PosValueMapper< PosT, ValueT >::GetValueFromPos(), previously uninitialized value found!" );
+ nValue = static_cast< ValueT >( nPos );
+ }
+
+ return nValue;
+}
+
+template< typename PosT, typename ValueT >
+PosT PosValueMapper< PosT, ValueT >::GetPosFromValue( ValueT nValue ) const
+{
+ PosT nPos = mnNFPos;
+ if( mpMap )
+ {
+ const MapEntryType* pEntry = mpMap;
+ while( (pEntry->mnValue != nValue) && (pEntry->mnPos != mnNFPos) )
+ ++pEntry;
+ nPos = pEntry->mnPos;
+ }
+ else if( nValue >= 0 )
+ nPos = static_cast< PosT >( nValue );
+ return nPos;
+}
+
+// ============================================================================
+// Single control wrappers
+// ============================================================================
+
+template< typename ControlT, typename ValueT >
+inline void SingleControlWrapper< ControlT, ValueT >::ModifyControl( TriState eEnable, TriState eShow )
+{
+ if( eEnable != STATE_DONTKNOW )
+ mrControl.Enable( eEnable == STATE_CHECK );
+ if( eShow != STATE_DONTKNOW )
+ mrControl.Show( eShow == STATE_CHECK );
+}
+
+// ============================================================================
+
+template< typename ValueT >
+bool NumericFieldWrapper< ValueT >::IsControlDontKnow() const
+{
+ return this->GetControl().GetText().Len() == 0;
+}
+
+template< typename ValueT >
+void NumericFieldWrapper< ValueT >::SetControlDontKnow( bool bSet )
+{
+ if( bSet )
+ this->GetControl().SetText( String() );
+}
+
+template< typename ValueT >
+ValueT NumericFieldWrapper< ValueT >::GetControlValue() const
+{
+ return static_cast< ValueT >( this->GetControl().Denormalize( this->GetControl().GetValue() ) );
+}
+
+template< typename ValueT >
+void NumericFieldWrapper< ValueT >::SetControlValue( ValueT nValue )
+{
+ this->GetControl().SetValue( this->GetControl().Normalize( static_cast< sal_Int64 >( nValue ) ) );
+}
+
+// ============================================================================
+
+template< typename ValueT >
+bool MetricFieldWrapper< ValueT >::IsControlDontKnow() const
+{
+ return this->GetControl().GetText().isEmpty();
+}
+
+template< typename ValueT >
+void MetricFieldWrapper< ValueT >::SetControlDontKnow( bool bSet )
+{
+ if( bSet )
+ this->GetControl().SetText( String() );
+}
+
+template< typename ValueT >
+ValueT MetricFieldWrapper< ValueT >::GetControlValue() const
+{
+ return static_cast< ValueT >( this->GetControl().Denormalize( this->GetControl().GetValue( meUnit ) ) );
+}
+
+template< typename ValueT >
+void MetricFieldWrapper< ValueT >::SetControlValue( ValueT nValue )
+{
+ this->GetControl().SetValue( this->GetControl().Normalize( static_cast< sal_Int64 >( nValue ) ), meUnit );
+}
+
+// ============================================================================
+
+template< typename ValueT >
+ValueT ListBoxWrapper< ValueT >::GetControlValue() const
+{
+ return this->GetValueFromPos( this->GetControl().GetSelectEntryPos() );
+}
+
+template< typename ValueT >
+void ListBoxWrapper< ValueT >::SetControlValue( ValueT nValue )
+{
+ sal_uInt16 nPos = this->GetPosFromValue( nValue );
+ if( nPos != this->GetNotFoundPos() )
+ this->GetControl().SelectEntryPos( nPos );
+}
+
+// ----------------------------------------------------------------------------
+
+template< typename ValueT >
+ValueT ValueSetWrapper< ValueT >::GetControlValue() const
+{
+ return this->GetValueFromPos( this->GetControl().GetSelectItemId() );
+}
+
+template< typename ValueT >
+void ValueSetWrapper< ValueT >::SetControlValue( ValueT nValue )
+{
+ sal_uInt16 nPos = this->GetPosFromValue( nValue );
+ if( nPos != this->GetNotFoundPos() )
+ this->GetControl().SelectItem( nPos );
+}
+
+// ============================================================================
+
+
+} // namespace sfx
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/ctrlitem.hxx b/include/sfx2/ctrlitem.hxx
new file mode 100644
index 000000000000..af6288e772e9
--- /dev/null
+++ b/include/sfx2/ctrlitem.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 _SFXCTRLITEM_HXX
+#define _SFXCTRLITEM_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <svl/poolitem.hxx>
+
+class SfxPoolItem;
+class SfxBindings;
+class SvStream;
+
+class SFX2_DLLPUBLIC SfxControllerItem
+{
+private:
+ sal_uInt16 nId;
+ SfxControllerItem* pNext; // to notify next ControllerItem
+ SfxBindings* pBindings;
+
+protected:
+#if defined( DBG_UTIL )
+ SAL_DLLPRIVATE void CheckConfigure_Impl( sal_uIntPtr nType );
+#endif
+
+public:
+ SfxBindings & GetBindings() {
+ DBG_ASSERT(pBindings, "no Bindings");
+ return *pBindings;
+ }
+ const SfxBindings & GetBindings() const {
+ DBG_ASSERT(pBindings, "no Bindings");
+ return *pBindings;
+ }
+
+ SfxControllerItem(); // for arrays
+ SfxControllerItem( sal_uInt16 nId, SfxBindings & );
+ virtual ~SfxControllerItem();
+
+ void Bind( sal_uInt16 nNewId, SfxBindings * = 0); // Register in SfxBindings
+ void UnBind();
+ void ReBind();
+ sal_Bool IsBound() const;
+ void ClearCache();
+ void SetBindings(SfxBindings &rBindings) { pBindings = &rBindings; }
+
+ SfxControllerItem* GetItemLink();
+ SfxControllerItem* ChangeItemLink( SfxControllerItem* pNewLink );
+
+ void SetId( sal_uInt16 nItemId );
+ sal_uInt16 GetId() const { return nId; }
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual void DeleteFloatingWindow();
+
+ SfxMapUnit GetCoreMetric() const;
+
+ static SfxItemState GetItemState( const SfxPoolItem* pState );
+
+ SAL_DLLPRIVATE sal_Bool IsBindable_Impl() const
+ { return pBindings != NULL; }
+ SAL_DLLPRIVATE void BindInternal_Impl( sal_uInt16 nNewId, SfxBindings* );
+};
+
+//====================================================================
+
+class SFX2_DLLPUBLIC SfxStatusForwarder: public SfxControllerItem
+{
+ SfxControllerItem* pMaster;
+
+protected:
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+
+public:
+ SfxStatusForwarder( sal_uInt16 nSlotId,
+ SfxControllerItem&rMaster );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/dialogs.hrc b/include/sfx2/dialogs.hrc
new file mode 100644
index 000000000000..debf4e64c21c
--- /dev/null
+++ b/include/sfx2/dialogs.hrc
@@ -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 _SFX2_DIALOGS_HRC
+#define _SFX2_DIALOGS_HRC
+
+#include <sfx2/sfxsids.hrc>
+#include <sfx2/tabpage.hrc>
+
+#define RID_OFA_AUTOCORR_DLG (RID_OFA_START + 101)
+#define RID_SVXDLG_CUSTOMIZE (RID_SVX_START + 291)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
new file mode 100644
index 000000000000..c0758b56bc00
--- /dev/null
+++ b/include/sfx2/dinfdlg.hxx
@@ -0,0 +1,501 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFX_DINFDLG_HXX
+#define _SFX_DINFDLG_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/util/Duration.hpp>
+
+#include <svl/stritem.hxx>
+#include <svl/zforlist.hxx>
+
+#include <svtools/headbar.hxx>
+#include <svtools/stdctrl.hxx>
+#include <svtools/svmedit.hxx>
+
+#include <unotools/syslocale.hxx>
+
+#include <vcl/edit.hxx>
+#include <vcl/field.hxx>
+#include <vcl/layout.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/scrbar.hxx>
+
+#include "tabdlg.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace document {
+ class XDocumentProperties;
+ }
+} } }
+
+struct CustomProperty;
+
+
+// class SfxDocumentInfoItem ---------------------------------------------
+
+class SFX2_DLLPUBLIC SfxDocumentInfoItem : public SfxStringItem
+{
+private:
+ sal_Int32 m_AutoloadDelay;
+ OUString m_AutoloadURL;
+ sal_Bool m_isAutoloadEnabled;
+ OUString m_DefaultTarget;
+ OUString m_TemplateName;
+ OUString m_Author;
+ ::com::sun::star::util::DateTime m_CreationDate;
+ OUString m_ModifiedBy;
+ ::com::sun::star::util::DateTime m_ModificationDate;
+ OUString m_PrintedBy;
+ ::com::sun::star::util::DateTime m_PrintDate;
+ sal_Int16 m_EditingCycles;
+ sal_Int32 m_EditingDuration;
+ OUString m_Description;
+ OUString m_Keywords;
+ OUString m_Subject;
+ OUString m_Title;
+ sal_Bool m_bHasTemplate;
+ sal_Bool m_bDeleteUserData;
+ sal_Bool m_bUseUserData;
+ std::vector< CustomProperty* > m_aCustomProperties;
+
+public:
+ TYPEINFO();
+ SfxDocumentInfoItem();
+ SfxDocumentInfoItem( const String &rFileName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties> & i_xDocProps,
+ sal_Bool bUseUserData );
+ SfxDocumentInfoItem( const SfxDocumentInfoItem& );
+ virtual ~SfxDocumentInfoItem();
+
+ /// update i_xDocProps with the data in this object
+ void UpdateDocumentInfo(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties> & i_xDocProps,
+ bool i_bDoNotUpdateUserDefined = false)
+ const;
+
+ sal_Bool isAutoloadEnabled() const { return m_isAutoloadEnabled; }
+ void setAutoloadEnabled(sal_Bool i_val) { m_isAutoloadEnabled = i_val; }
+ sal_Int32 getAutoloadDelay() const { return m_AutoloadDelay; }
+ void setAutoloadDelay(sal_Int32 i_val) { m_AutoloadDelay = i_val; }
+ OUString getAutoloadURL() const { return m_AutoloadURL; }
+ void setAutoloadURL(OUString i_val) { m_AutoloadURL = i_val; }
+ OUString getDefaultTarget() const { return m_DefaultTarget; }
+ void setDefaultTarget(OUString i_val) { m_DefaultTarget = i_val; }
+ OUString getTemplateName() const { return m_TemplateName; }
+ void setTemplateName(OUString i_val) { m_TemplateName = i_val; }
+ OUString getAuthor() const { return m_Author; }
+ void setAuthor(OUString i_val) { m_Author = i_val; }
+
+ ::com::sun::star::util::DateTime
+ getCreationDate() const { return m_CreationDate; }
+ void setCreationDate(::com::sun::star::util::DateTime i_val) {
+ m_CreationDate = i_val;
+ }
+ OUString getModifiedBy() const { return m_ModifiedBy; }
+ void setModifiedBy(OUString i_val) { m_ModifiedBy = i_val; }
+
+ ::com::sun::star::util::DateTime
+ getModificationDate() const { return m_ModificationDate; }
+ void setModificationDate(::com::sun::star::util::DateTime i_val) {
+ m_ModificationDate = i_val;
+ }
+ OUString getPrintedBy() const { return m_PrintedBy; }
+ void setPrintedBy(OUString i_val) { m_PrintedBy = i_val; }
+ ::com::sun::star::util::DateTime
+ getPrintDate() const { return m_PrintDate; }
+ void setPrintDate(::com::sun::star::util::DateTime i_val) {
+ m_PrintDate = i_val;
+ }
+ sal_Int16 getEditingCycles() const { return m_EditingCycles; }
+ void setEditingCycles(sal_Int16 i_val) { m_EditingCycles = i_val; }
+ sal_Int32 getEditingDuration() const { return m_EditingDuration; }
+ void setEditingDuration(sal_Int32 i_val) { m_EditingDuration = i_val; }
+ OUString getDescription() const { return m_Description; }
+ void setDescription(OUString i_val) { m_Description = i_val; }
+ OUString getKeywords() const { return m_Keywords; }
+ void setKeywords(OUString i_val) { m_Keywords = i_val; }
+ OUString getSubject() const { return m_Subject; }
+ void setSubject(OUString i_val) { m_Subject = i_val; }
+ OUString getTitle() const { return m_Title; }
+ void setTitle(OUString i_val) { m_Title = i_val; }
+
+ /// reset user-specific data (author, modified-by, ...)
+ void resetUserData(const OUString & i_rAuthor);
+
+ void SetTemplate( sal_Bool b ) { m_bHasTemplate = b; }
+ sal_Bool HasTemplate() const { return m_bHasTemplate; }
+ void SetDeleteUserData( sal_Bool bSet );
+ void SetUseUserData( sal_Bool bSet );
+ sal_Bool IsDeleteUserData() const;
+ sal_Bool IsUseUserData() const;
+
+ std::vector< CustomProperty* > GetCustomProperties() const;
+ void ClearCustomProperties();
+ void AddCustomProperty( const OUString& sName,
+ const com::sun::star::uno::Any& rValue );
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+// class SfxDocumentPage -------------------------------------------------
+
+class SfxDocumentPage : public SfxTabPage
+{
+private:
+ FixedImage* m_pBmp;
+ Edit* m_pNameED;
+ PushButton* m_pChangePassBtn;
+
+ SelectableFixedText* m_pShowTypeFT;
+ CheckBox* m_pReadOnlyCB;
+ SelectableFixedText* m_pFileValFt;
+ SelectableFixedText* m_pShowSizeFT;
+
+ SelectableFixedText* m_pCreateValFt;
+ SelectableFixedText* m_pChangeValFt;
+ SelectableFixedText* m_pSignedValFt;
+ PushButton* m_pSignatureBtn;
+ SelectableFixedText* m_pPrintValFt;
+ SelectableFixedText* m_pTimeLogValFt;
+ SelectableFixedText* m_pDocNoValFt;
+
+ CheckBox* m_pUseUserDataCB;
+ PushButton* m_pDeleteBtn;
+
+ FixedText* m_pTemplFt;
+ SelectableFixedText* m_pTemplValFt;
+
+ OUString m_aUnknownSize;
+ OUString m_aMultiSignedStr;
+
+ sal_Bool bEnableUseUserData : 1,
+ bHandleDelete : 1;
+
+ DECL_LINK(DeleteHdl, void *);
+ DECL_LINK(SignatureHdl, void *);
+ DECL_LINK(ChangePassHdl, void *);
+ void ImplUpdateSignatures();
+ void ImplCheckPasswordState();
+
+protected:
+ SfxDocumentPage( Window* pParent, const SfxItemSet& );
+
+ virtual sal_Bool FillItemSet( SfxItemSet& );
+ virtual void Reset( const SfxItemSet& );
+
+public:
+ static SfxTabPage* Create( Window* pParent, const SfxItemSet& );
+
+ void EnableUseUserData();
+};
+
+// class SfxDocumentDescPage ---------------------------------------------
+
+class SfxDocumentDescPage : public SfxTabPage
+{
+private:
+ Edit* m_pTitleEd;
+ Edit* m_pThemaEd;
+ Edit* m_pKeywordsEd;
+ VclMultiLineEdit* m_pCommentEd;
+ SfxDocumentInfoItem* m_pInfoItem;
+
+protected:
+ SfxDocumentDescPage( Window* pParent, const SfxItemSet& );
+
+ virtual sal_Bool FillItemSet( SfxItemSet& );
+ virtual void Reset( const SfxItemSet& );
+
+public:
+ static SfxTabPage* Create( Window* pParent, const SfxItemSet& );
+};
+
+// class SfxDocumentInfoDialog -------------------------------------------
+
+class SFX2_DLLPUBLIC SfxDocumentInfoDialog : public SfxTabDialog
+{
+private:
+ sal_uInt16 m_nDocInfoId;
+protected:
+ virtual void PageCreated( sal_uInt16 nId, SfxTabPage& rPage );
+
+public:
+ SfxDocumentInfoDialog( Window* pParent, const SfxItemSet& );
+ void AddFontTabPage();
+};
+
+// class CustomPropertiesRemoveButton ------------------------------------
+
+struct CustomPropertyLine;
+
+class CustomPropertiesEdit : public Edit
+{
+private:
+ CustomPropertyLine* m_pLine;
+
+public:
+ inline CustomPropertiesEdit(
+ Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) :
+ Edit( pParent, rResId ), m_pLine( pLine ) {}
+
+ inline CustomPropertyLine* GetLine() const { return m_pLine; }
+};
+
+class CustomPropertiesTypeBox : public ListBox
+{
+private:
+ CustomPropertyLine* m_pLine;
+
+public:
+ inline CustomPropertiesTypeBox(
+ Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) :
+ ListBox( pParent, rResId ), m_pLine( pLine ) {}
+
+ inline CustomPropertyLine* GetLine() const { return m_pLine; }
+};
+
+class CustomPropertiesDateField : public DateField
+{
+private:
+ CustomPropertyLine* m_pLine;
+
+public:
+ inline CustomPropertiesDateField(
+ Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) :
+ DateField( pParent, rResId ), m_pLine( pLine ) {}
+
+ inline CustomPropertyLine* GetLine() const { return m_pLine; }
+};
+class CustomPropertiesTimeField : public TimeField
+{
+private:
+ CustomPropertyLine* m_pLine;
+
+public:
+ inline CustomPropertiesTimeField(
+ Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) :
+ TimeField( pParent, rResId ), m_pLine( pLine ) {}
+
+ inline CustomPropertyLine* GetLine() const { return m_pLine; }
+};
+class CustomPropertiesDurationField : public Edit
+{
+ CustomPropertyLine* m_pLine;
+ com::sun::star::util::Duration m_aDuration;
+protected:
+ virtual void RequestHelp(const HelpEvent& rEvt);
+public:
+ CustomPropertiesDurationField( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine );
+ ~CustomPropertiesDurationField();
+
+ void SetDuration( const com::sun::star::util::Duration& rDuration );
+ const com::sun::star::util::Duration& GetDuration() const { return m_aDuration; }
+};
+
+class CustomPropertiesEditButton : public PushButton
+{
+ CustomPropertyLine* m_pLine;
+
+public:
+ CustomPropertiesEditButton( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine );
+ ~CustomPropertiesEditButton();
+
+ DECL_LINK(ClickHdl, void *);
+};
+
+class CustomPropertiesRemoveButton : public ImageButton
+{
+private:
+ CustomPropertyLine* m_pLine;
+
+public:
+ inline CustomPropertiesRemoveButton(
+ Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) :
+ ImageButton( pParent, rResId ), m_pLine( pLine ) {}
+
+ inline CustomPropertyLine* GetLine() const { return m_pLine; }
+};
+
+class CustomPropertiesYesNoButton : public Control
+{
+private:
+ RadioButton m_aYesButton;
+ RadioButton m_aNoButton;
+
+public:
+ CustomPropertiesYesNoButton( Window* pParent, const ResId& rResId );
+
+ virtual void Resize();
+
+ inline void CheckYes() { m_aYesButton.Check(); }
+ inline void CheckNo() { m_aNoButton.Check(); }
+ inline bool IsYesChecked() const { return m_aYesButton.IsChecked() != sal_False; }
+};
+
+// struct CustomPropertyLine ---------------------------------------------
+
+struct CustomPropertyLine
+{
+ ComboBox m_aNameBox;
+ CustomPropertiesTypeBox m_aTypeBox;
+ CustomPropertiesEdit m_aValueEdit;
+ CustomPropertiesDateField m_aDateField;
+ CustomPropertiesTimeField m_aTimeField;
+ const String m_sDurationFormat;
+ CustomPropertiesDurationField m_aDurationField;
+ CustomPropertiesEditButton m_aEditButton;
+ CustomPropertiesYesNoButton m_aYesNoButton;
+ CustomPropertiesRemoveButton m_aRemoveButton;
+
+ Point m_aDatePos;
+ Point m_aTimePos;
+ Size m_aDateTimeSize;
+
+ bool m_bIsRemoved;
+ bool m_bTypeLostFocus;
+
+ CustomPropertyLine( Window* pParent );
+
+ void SetRemoved();
+};
+
+// class CustomPropertiesWindow ------------------------------------------
+
+class CustomPropertiesWindow : public Window
+{
+private:
+ ComboBox m_aNameBox;
+ ListBox m_aTypeBox;
+ Edit m_aValueEdit;
+ DateField m_aDateField;
+ TimeField m_aTimeField;
+ Edit m_aDurationField;
+ PushButton m_aEditButton;
+ CustomPropertiesYesNoButton m_aYesNoButton;
+ ImageButton m_aRemoveButton;
+
+ sal_Int32 m_nLineHeight;
+ sal_Int32 m_nScrollPos;
+ SvtSysLocale m_aSysLocale;
+ std::vector< CustomPropertyLine* > m_aCustomPropertiesLines;
+ CustomPropertyLine* m_pCurrentLine;
+ SvNumberFormatter m_aNumberFormatter;
+ Timer m_aEditLoseFocusTimer;
+ Timer m_aBoxLoseFocusTimer;
+ Link m_aRemovedHdl;
+
+ DECL_LINK( TypeHdl, CustomPropertiesTypeBox* );
+ DECL_LINK( RemoveHdl, CustomPropertiesRemoveButton* );
+ DECL_LINK( EditLoseFocusHdl, CustomPropertiesEdit* );
+ DECL_LINK( BoxLoseFocusHdl, CustomPropertiesTypeBox* );
+ //add lose focus handlers of Date/TimeField?
+
+ DECL_LINK(EditTimeoutHdl, void *);
+ DECL_LINK(BoxTimeoutHdl, void *);
+
+ bool IsLineValid( CustomPropertyLine* pLine ) const;
+ void ValidateLine( CustomPropertyLine* pLine, bool bIsFromTypeBox );
+
+public:
+ CustomPropertiesWindow(Window* pParent,
+ const OUString &rHeaderAccName,
+ const OUString &rHeaderAccType,
+ const OUString &rHeaderAccValue);
+ ~CustomPropertiesWindow();
+
+ void InitControls( HeaderBar* pHeaderBar, const ScrollBar* pScrollBar );
+ sal_uInt16 GetVisibleLineCount() const;
+ inline sal_Int32 GetLineHeight() const { return m_nLineHeight; }
+ void AddLine( const OUString& sName, com::sun::star::uno::Any& rAny );
+ bool AreAllLinesValid() const;
+ void ClearAllLines();
+ void DoScroll( sal_Int32 nNewPos );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
+ GetCustomProperties() const;
+ void SetRemovedHdl( const Link& rLink ) { m_aRemovedHdl = rLink; }
+
+ void InitRemoveButton(const ScrollBar &rScrollBar);
+ void updateLineWidth();
+};
+
+// class CustomPropertiesControl -----------------------------------------
+
+class CustomPropertiesControl : public VclVBox
+{
+private:
+ HeaderBar* m_pHeaderBar;
+ VclHBox* m_pBody;
+ CustomPropertiesWindow* m_pPropertiesWin;
+ ScrollBar* m_pVertScroll;
+
+ sal_Int32 m_nThumbPos;
+
+ DECL_LINK( ScrollHdl, ScrollBar* );
+ DECL_LINK( RemovedHdl, void* );
+
+public:
+ CustomPropertiesControl(Window* pParent);
+ ~CustomPropertiesControl();
+
+ void AddLine( const OUString& sName, com::sun::star::uno::Any& rAny, bool bInteractive );
+
+ inline bool AreAllLinesValid() const { return m_pPropertiesWin->AreAllLinesValid(); }
+ inline void ClearAllLines() { m_pPropertiesWin->ClearAllLines(); }
+ inline ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
+ GetCustomProperties() const
+ { return m_pPropertiesWin->GetCustomProperties(); }
+ void Init(VclBuilderContainer& rParent);
+ virtual void setAllocation(const Size &rAllocation);
+};
+
+// class SfxCustomPropertiesPage -----------------------------------------
+
+class SfxCustomPropertiesPage : public SfxTabPage
+{
+private:
+ CustomPropertiesControl* m_pPropertiesCtrl;
+
+ DECL_LINK(AddHdl, void *);
+
+ using TabPage::DeactivatePage;
+
+protected:
+ SfxCustomPropertiesPage( Window* pParent, const SfxItemSet& );
+
+ virtual sal_Bool FillItemSet( SfxItemSet& );
+ virtual void Reset( const SfxItemSet& );
+ virtual int DeactivatePage( SfxItemSet* pSet = NULL );
+
+public:
+ static SfxTabPage* Create( Window* pParent, const SfxItemSet& );
+};
+
+#endif // #ifndef _SFX_DINFDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/dinfedt.hxx b/include/sfx2/dinfedt.hxx
new file mode 100644
index 000000000000..b24908a7d081
--- /dev/null
+++ b/include/sfx2/dinfedt.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 _SFX_DINFEDT_HXX
+#define _SFX_DINFEDT_HXX
+
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
+
+// class InfoEdit_Impl ---------------------------------------------------
+
+class InfoEdit_Impl : public Edit
+{
+public:
+ InfoEdit_Impl( Window* pParent, const ResId& rResId ) :
+ Edit( pParent, rResId ) {}
+
+ virtual void KeyInput( const KeyEvent& rKEvent );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/dispatch.hxx b/include/sfx2/dispatch.hxx
new file mode 100644
index 000000000000..2b02a5e620c6
--- /dev/null
+++ b/include/sfx2/dispatch.hxx
@@ -0,0 +1,308 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXDISPATCH_HXX
+#define _SFXDISPATCH_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+
+#include <stdarg.h>
+
+#include <sfx2/bindings.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <map>
+#include <vector>
+
+class SfxSlotServer;
+class SfxShell;
+class SfxRequest;
+class SfxHintPoster;
+class SfxViewFrame;
+class SfxBindings;
+class SfxItemSet;
+class SfxPopupMenuManager;
+class SfxModule;
+struct SfxDispatcher_Impl;
+
+typedef std::vector<SfxShell*> SfxShellStack_Impl;
+
+namespace com
+{
+ namespace sun
+ {
+ namespace star
+ {
+ namespace frame
+ {
+ class XDispatch;
+ }
+ }
+ }
+}
+
+//=========================================================================
+
+#define SFX_SHELL_POP_UNTIL 4
+#define SFX_SHELL_POP_DELETE 2
+#define SFX_SHELL_PUSH 1
+
+//=========================================================================
+
+// Maps the Which() field to a pointer to a SfxPoolItem
+class SfxItemPtrMap : public std::map<sal_uInt16, SfxPoolItem*>
+{
+public:
+ ~SfxItemPtrMap()
+ {
+ for(iterator it = begin(); it != end(); ++it)
+ delete it->second;
+ }
+};
+
+class SFX2_DLLPUBLIC SfxDispatcher
+{
+ SfxDispatcher_Impl* pImp;
+ sal_Bool bFlushed;
+
+private:
+ // Search for temporary evaluated Todos
+ SAL_DLLPRIVATE sal_Bool CheckVirtualStack( const SfxShell& rShell, sal_Bool bDeep );
+
+#ifndef _SFX_HXX
+
+friend class SfxApplication;
+friend class SfxViewFrame;
+
+ DECL_DLLPRIVATE_LINK( EventHdl_Impl, void * );
+ DECL_DLLPRIVATE_LINK( PostMsgHandler, SfxRequest * );
+
+ SAL_DLLPRIVATE int Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest &rReq, sal_Bool bRecord );
+ SAL_DLLPRIVATE void _Update_Impl( sal_Bool,sal_Bool,sal_Bool,SfxWorkWindow*);
+ SAL_DLLPRIVATE void CollectTools_Impl(SfxWorkWindow*);
+
+protected:
+friend class SfxBindings;
+friend class SfxStateCache;
+friend class SfxPopupMenuManager;
+friend class SfxHelp;
+ // For bindings: Finding the Message;
+ // level for re-access
+ SAL_DLLPRIVATE sal_Bool _TryIntercept_Impl( sal_uInt16 nId, SfxSlotServer &rServer, sal_Bool bModal );
+ sal_Bool _FindServer( sal_uInt16 nId, SfxSlotServer &rServer, sal_Bool bModal );
+ sal_Bool _FillState( const SfxSlotServer &rServer,
+ SfxItemSet &rState, const SfxSlot *pRealSlot );
+ void _Execute( SfxShell &rShell, const SfxSlot &rSlot,
+ SfxRequest &rReq,
+ SfxCallMode eCall = SFX_CALLMODE_STANDARD);
+#endif
+protected:
+ void FlushImpl();
+
+public:
+ SfxDispatcher( SfxDispatcher* pParent );
+ SfxDispatcher( SfxViewFrame *pFrame = 0 );
+
+ SAL_DLLPRIVATE void Construct_Impl( SfxDispatcher* pParent );
+
+ virtual ~SfxDispatcher();
+
+ const SfxPoolItem* Execute( sal_uInt16 nSlot,
+ SfxCallMode nCall = SFX_CALLMODE_SLOT,
+ const SfxPoolItem **pArgs = 0,
+ sal_uInt16 nModi = 0,
+ const SfxPoolItem **pInternalArgs = 0);
+
+ const SfxPoolItem* Execute( sal_uInt16 nSlot,
+ SfxCallMode nCall,
+ SfxItemSet* pArgs,
+ SfxItemSet* pInternalArgs,
+ sal_uInt16 nModi = 0);
+
+ const SfxPoolItem* Execute( sal_uInt16 nSlot,
+ SfxCallMode nCall,
+ const SfxPoolItem *pArg1, ... );
+
+ const SfxPoolItem* Execute( sal_uInt16 nSlot,
+ SfxCallMode nCall,
+ const SfxItemSet &rArgs );
+
+ const SfxPoolItem* Execute( sal_uInt16 nSlot,
+ SfxCallMode nCall,
+ sal_uInt16 nModi,
+ const SfxItemSet &rArgs );
+
+ const SfxSlot* GetSlot( const String& rCommand );
+
+ sal_Bool IsActive( const SfxShell& rShell );
+ sal_Bool IsOnTop( const SfxShell& rShell );
+ sal_uInt16 GetShellLevel( const SfxShell &rShell );
+ SfxBindings* GetBindings() const;
+
+ void Push( SfxShell& rShell );
+ void Pop( SfxShell& rShell, sal_uInt16 nMode = 0 );
+
+ SfxShell* GetShell(sal_uInt16 nIdx) const;
+ SfxViewFrame* GetFrame() const;
+ SfxModule* GetModule() const;
+ // caller has to clean up the Manager on his own
+ static SfxPopupMenuManager* Popup( sal_uInt16 nConfigId,Window *pWin, const Point *pPos );
+
+ void ExecutePopup( const ResId &rId,
+ Window *pWin = 0, const Point *pPosPixel = 0 );
+ static void ExecutePopup( sal_uInt16 nConfigId = 0,
+ Window *pWin = 0, const Point *pPosPixel = 0 );
+
+ sal_Bool IsAppDispatcher() const;
+ sal_Bool IsFlushed() const;
+ void Flush();
+ void Lock( sal_Bool bLock );
+ sal_Bool IsLocked( sal_uInt16 nSID = 0 ) const;
+ void SetSlotFilter( sal_Bool bEnable = sal_False,
+ sal_uInt16 nCount = 0, const sal_uInt16 *pSIDs = 0 );
+
+ void HideUI( sal_Bool bHide = sal_True );
+ void ShowObjectBar(sal_uInt16 nId, SfxShell *pShell=0) const;
+ sal_uInt32 GetObjectBarId( sal_uInt16 nPos ) const;
+
+ SfxItemState QueryState( sal_uInt16 nSID, const SfxPoolItem* &rpState );
+ SfxItemState QueryState( sal_uInt16 nSID, ::com::sun::star::uno::Any& rAny );
+
+ ::com::sun::star::frame::XDispatch* GetDispatchInterface( const String& );
+ void SetDisableFlags( sal_uInt32 nFlags );
+ sal_uInt32 GetDisableFlags() const;
+
+ SAL_DLLPRIVATE void SetMenu_Impl();
+ SAL_DLLPRIVATE void Update_Impl( sal_Bool bForce = sal_False ); // ObjectBars etc.
+ SAL_DLLPRIVATE sal_Bool IsUpdated_Impl() const;
+ SAL_DLLPRIVATE int GetShellAndSlot_Impl( sal_uInt16 nSlot, SfxShell **ppShell, const SfxSlot **ppSlot,
+ sal_Bool bOwnShellsOnly, sal_Bool bModal, sal_Bool bRealSlot=sal_True );
+ SAL_DLLPRIVATE void SetReadOnly_Impl( sal_Bool bOn );
+ SAL_DLLPRIVATE sal_Bool GetReadOnly_Impl() const;
+ SAL_DLLPRIVATE sal_Bool IsSlotEnabledByFilter_Impl( sal_uInt16 nSID ) const;
+ SAL_DLLPRIVATE void SetQuietMode_Impl( sal_Bool bOn );
+ SAL_DLLPRIVATE sal_Bool IsReadOnlyShell_Impl( sal_uInt16 nShell ) const;
+ SAL_DLLPRIVATE void RemoveShell_Impl( SfxShell& rShell );
+ SAL_DLLPRIVATE void DoParentActivate_Impl();
+ SAL_DLLPRIVATE void DoParentDeactivate_Impl();
+ SAL_DLLPRIVATE void DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* pOld );
+ SAL_DLLPRIVATE void DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew );
+ SAL_DLLPRIVATE void InvalidateBindings_Impl(sal_Bool);
+ SAL_DLLPRIVATE sal_uInt16 GetNextToolBox_Impl( sal_uInt16 nPos, sal_uInt16 nType, String *pStr );
+};
+
+//--------------------------------------------------------------------
+
+inline sal_Bool SfxDispatcher::IsFlushed() const
+
+/* [Description]
+
+ This method checks if the stack of the SfxDispatchers is flushed, or if
+ push- or pop- commands are pending.
+*/
+
+{
+ return bFlushed;
+}
+
+//--------------------------------------------------------------------
+
+inline void SfxDispatcher::Flush()
+
+/* [Description]
+
+ This method performs outstanding push- and pop- commands. For <SfxShell>s,
+ which are new on the stack, the <SfxShell::Activate(sal_Bool)> is invoked with
+ bMDI == sal_True, for SfxShells that are removed from the stack, the
+ <SfxShell::Deactivate(sal_Bool)> is invoked with bMDI == sal_True
+*/
+
+{
+ if ( !bFlushed ) FlushImpl();
+}
+
+//--------------------------------------------------------------------
+
+inline void SfxDispatcher::Push( SfxShell& rShell )
+
+/* [Description]
+
+ With this method, a <SfxShell> pushed on to the SfxDispatcher.
+ The SfxShell is first marked for push and a timer is set up.
+ First when the timer has couted down to zero the push
+ ( <SfxDispatcher::Flush()> ) is actually performed and the
+ <SfxBindings> is invalidated. While the timer is counting down
+ the opposing push and pop commands on the same SfxShell are
+ leveled out.
+*/
+
+{
+ Pop( rShell, SFX_SHELL_PUSH );
+}
+
+//--------------------------------------------------------------------
+
+inline sal_Bool SfxDispatcher::IsActive( const SfxShell& rShell )
+
+/* [Description]
+
+ This method checks whether a particular <SfxShell> instance is
+ on the SfxDispatcher.
+
+ [Return value]
+
+ sal_Bool sal_True
+ The SfxShell instance is on the SfxDispatcher.
+
+ sal_False
+ The SfxShell instance is not on the SfxDispatcher.
+*/
+
+{
+ return CheckVirtualStack( rShell, sal_True );
+}
+//--------------------------------------------------------------------
+
+inline sal_Bool SfxDispatcher::IsOnTop( const SfxShell& rShell )
+
+/* [Description]
+
+ This method checks whether a particular <SfxShell> instance is on
+ top of the SfxDispatcher.
+
+ [Return value]
+
+ sal_Bool sal_True
+ The SfxShell instance is on the top of
+ the SfxDispatcher.
+
+ sal_False
+ The SfxShell instance is not on the top of
+ the SfxDispatcher.
+*/
+
+{
+ return CheckVirtualStack( rShell, sal_False );
+}
+
+//--------------------------------------------------------------------
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/dllapi.h b/include/sfx2/dllapi.h
new file mode 100644
index 000000000000..95ba80bff9e5
--- /dev/null
+++ b/include/sfx2/dllapi.h
@@ -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_SFX2_DLLAPI_H
+#define INCLUDED_SFX2_DLLAPI_H
+
+#include "sal/config.h"
+#include "sal/types.h"
+
+#if defined SFX2_DLLIMPLEMENTATION
+#define SFX2_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define SFX2_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#define SFX2_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/docfac.hxx b/include/sfx2/docfac.hxx
new file mode 100644
index 000000000000..e8d15a8366cd
--- /dev/null
+++ b/include/sfx2/docfac.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 _SFX_OBJFAC_HXX
+#define _SFX_OBJFAC_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <sal/types.h>
+#include <tools/solar.h>
+#include <tools/rtti.hxx>
+
+// SFX_IMPL_MODULE_LIB
+#include <osl/module.hxx>
+#include <rtl/ustring.hxx>
+
+#include <sfx2/objsh.hxx>
+#include <sfx2/sfxdefs.hxx>
+
+class SfxMedium;
+class SfxFilter;
+class SfxViewFactory;
+struct SfxObjectFactory_Impl;
+class SfxFilterContainer;
+class SfxBindings;
+
+//====================================================================
+
+typedef void (*SfxVoidFunc)();
+
+#define SDT_SDT_DOCFACTPRIO 10 // Explorer
+#define SDT_SW_DOCFACTPRIO 20 // Text Document
+#define SDT_SWW_DOCFACTPRIO 21 // Web Document
+#define SDT_SC_DOCFACTPRIO 30 // Table Document
+#define SDT_SI_DOCFACTPRIO 40 // Impress Document
+#define SDT_SD_DOCFACTPRIO 41 // Draw Document
+#define SDT_SCH_DOCFACTPRIO 50 // Chart Document
+#define SDT_SMA_DOCFACTPRIO 60 // Math Document
+#define SDT_SIM_DOCFACTPRIO 70 // Image Document
+#define SDT_FRM_DOCFACTPRIO 100 // Frame Document
+#define SDT_MSG_DOCFACTPRIO 110 // Message Document
+#define SDT_SDB_DOCFACTPRIO 200 // Database Document
+
+//====================================================================
+
+class SFX2_DLLPUBLIC SfxObjectFactory
+{
+private:
+ const char* pShortName;
+ SfxObjectFactory_Impl* pImpl; // Additional Data
+ SfxObjectShellFlags nFlags;
+ SAL_DLLPRIVATE void Construct();
+
+public:
+ SfxObjectFactory( const SvGlobalName &rName, SfxObjectShellFlags nFlags, const char* pShortName );
+ ~SfxObjectFactory();
+
+ const SvGlobalName& GetClassId() const;
+ SfxObjectShellFlags GetFlags() { return nFlags; }
+ const char* GetShortName() const { return pShortName; }
+ String GetFactoryURL() const; // shortcut for "private:factory/GetShortName()"
+ String GetFactoryName() const { return OUString::createFromAscii(pShortName); }
+ String GetModuleName() const;
+ SfxFilterContainer *GetFilterContainer( sal_Bool bForceLoad = sal_True) const;
+
+ // Views
+ void RegisterViewFactory(SfxViewFactory &rFactory);
+ sal_uInt16 GetViewFactoryCount() const;
+ SfxViewFactory& GetViewFactory(sal_uInt16 i = 0) const;
+
+ /// returns the view factory whose GetAPIViewName or GetLegacyViewName delivers the requested logical name
+ SfxViewFactory* GetViewFactoryByViewName( const String& i_rViewName ) const;
+
+ // Filter
+ const SfxFilter* GetTemplateFilter() const;
+ static String GetStandardTemplate( const String& rServiceName );
+ static void SetStandardTemplate( const String& rServiceName, const String& rTemplateName );
+ static void SetSystemTemplate( const String& rServiceName, const String& rTemplateName );
+
+ void SetDocumentServiceName( const OUString& rServiceName );
+ const OUString& GetDocumentServiceName() const;
+
+ SfxModule* GetModule() const;
+
+ SAL_DLLPRIVATE void SetModule_Impl( SfxModule* );
+ SAL_DLLPRIVATE static void UpdateFilterContainers_Impl();
+ SAL_DLLPRIVATE sal_uInt16 GetViewNo_Impl( const sal_uInt16 i_nViewId, const sal_uInt16 i_nFallback ) const;
+
+private:
+ // Kopieren verboten
+ SAL_DLLPRIVATE SfxObjectFactory(const SfxObjectFactory&);
+ SAL_DLLPRIVATE const SfxObjectFactory& operator=(const SfxObjectFactory &);
+};
+
+//=========================================================================
+
+#define SFX_DECL_OBJECTFACTORY() \
+public: \
+ static SfxObjectFactory& Factory(); \
+ virtual SfxObjectFactory& GetFactory() const { return Factory(); }
+
+#define SFX_IMPL_OBJECTFACTORY(ClassName,GlobName,Flags,ShortName) \
+ SfxObjectFactory& ClassName::Factory() \
+ { \
+ static SfxObjectFactory aObjectFactory(GlobName, Flags, ShortName); \
+ return aObjectFactory; \
+ }
+#endif // #ifndef _SFX_OBJFAC_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
new file mode 100644
index 000000000000..fcf7351f9c9f
--- /dev/null
+++ b/include/sfx2/docfile.hxx
@@ -0,0 +1,286 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SFXDOCFILE_HXX
+#define _SFXDOCFILE_HXX
+
+#include <com/sun/star/io/XSeekable.hpp>
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/util/RevisionTag.hpp>
+#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/ucb/XContent.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <tools/link.hxx>
+#include <tools/stream.hxx>
+#include <tools/string.hxx>
+#include <svl/lstner.hxx>
+
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/content.hxx>
+
+#include <vector>
+
+class SvKeyValueIterator;
+class SfxObjectFactory;
+class SfxFilter;
+class SfxMedium_Impl;
+class INetURLObject;
+class SfxObjectShell;
+class SfxFrame;
+class Timer;
+class SfxItemSet;
+class DateTime;
+
+class SFX2_DLLPUBLIC SfxMedium : public SvRefBase
+{
+ SfxMedium_Impl* pImp;
+
+ SAL_DLLPRIVATE void SetIsRemote_Impl();
+ SAL_DLLPRIVATE void CloseInStream_Impl();
+ SAL_DLLPRIVATE sal_Bool CloseOutStream_Impl();
+ SAL_DLLPRIVATE void CloseStreams_Impl();
+ DECL_DLLPRIVATE_STATIC_LINK( SfxMedium, UCBHdl_Impl, sal_uInt32 * );
+
+ SAL_DLLPRIVATE void SetEncryptionDataToStorage_Impl();
+
+public:
+
+ SfxMedium();
+ /**
+ * @param pSet Takes ownership
+ */
+ SfxMedium( const String &rName,
+ StreamMode nOpenMode,
+ const SfxFilter *pFilter = 0,
+ SfxItemSet *pSet = 0 );
+ //TODO: the next, non-defined overload is only there to
+ // detect uses of the above (String, StreamMode, etc.)
+ // overload from when it still had an additional third
+ // parameter sal_Bool bDirect, where now a leftover
+ // "false" or "sal_False" could be mistaken for a null
+ // pointer argument for the pFilter parameter; it can be
+ // removed once we are confident all old uses of the
+ // original overload have been adapted (in platform
+ // specific code etc.):
+ SfxMedium(String const &, StreamMode, void *)
+ SAL_DELETED_FUNCTION;
+
+ /**
+ * @param pSet does NOT take ownership
+ */
+ SfxMedium( const css::uno::Reference< css::embed::XStorage >& xStorage,
+ const String& rBaseURL,
+ const SfxItemSet* pSet=0 );
+ /**
+ * @param pSet does NOT take ownership
+ */
+ SfxMedium( const css::uno::Reference< css::embed::XStorage >& xStorage,
+ const String& rBaseURL,
+ const String& rTypeName,
+ const SfxItemSet* pSet=0 );
+ SfxMedium( const css::uno::Sequence< css::beans::PropertyValue >& aArgs );
+
+ ~SfxMedium();
+
+ void UseInteractionHandler( sal_Bool );
+ css::uno::Reference< css::task::XInteractionHandler >
+ GetInteractionHandler();
+
+ void setStreamToLoadFrom(
+ const css::uno::Reference<css::io::XInputStream>& xInputStream,
+ sal_Bool bIsReadOnly);
+
+ void SetLoadTargetFrame(SfxFrame* pFrame );
+ SfxFrame* GetLoadTargetFrame() const;
+
+ void SetFilter(const SfxFilter *pFlt, sal_Bool bResetOrig = sal_False);
+ const SfxFilter* GetFilter() const;
+ const SfxFilter * GetOrigFilter( sal_Bool bNotCurrent = sal_False ) const;
+ const OUString& GetOrigURL() const;
+
+ SfxItemSet * GetItemSet() const;
+ void Close();
+ void CloseAndRelease();
+ void ReOpen();
+ void CompleteReOpen();
+ const OUString& GetName() const;
+ const INetURLObject& GetURLObject() const;
+
+ void CheckFileDate( const css::util::DateTime& aInitDate );
+ sal_Bool DocNeedsFileDateCheck();
+ css::util::DateTime GetInitFileDate( sal_Bool bIgnoreOldValue );
+
+ css::uno::Reference< css::ucb::XContent > GetContent() const;
+ const OUString& GetPhysicalName() const;
+ sal_Bool IsRemote();
+ sal_Bool IsOpen() const; // { return aStorage.Is() || pInStream; }
+ void DownLoad( const Link& aLink = Link());
+ void SetDoneLink( const Link& rLink );
+
+ sal_uInt32 GetErrorCode() const;
+ sal_uInt32 GetError() const
+ { return ERRCODE_TOERROR(GetErrorCode()); }
+ sal_uInt32 GetLastStorageCreationState();
+
+ void SetError( sal_uInt32 nError, const OUString& aLogMessage );
+
+ void AddLog( const OUString& aMessage );
+
+ void CloseInStream();
+ sal_Bool CloseOutStream();
+
+ void CloseStorage();
+
+ StreamMode GetOpenMode() const;
+ void SetOpenMode( StreamMode nStorOpen, sal_Bool bDontClose = sal_False );
+
+ SvStream* GetInStream();
+ SvStream* GetOutStream();
+
+ sal_Bool Commit();
+ sal_Bool IsStorage();
+
+ sal_Int8 ShowLockedDocumentDialog( const css::uno::Sequence< OUString >& aData, sal_Bool bIsLoading, sal_Bool bOwnLock );
+ bool LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI );
+ void UnlockFile( sal_Bool bReleaseLockStream );
+
+ css::uno::Reference< css::embed::XStorage > GetStorage( sal_Bool bCreateTempIfNo = sal_True );
+ css::uno::Reference< css::embed::XStorage > GetOutputStorage();
+ void ResetError();
+ sal_Bool UsesCache() const;
+ void SetUsesCache( sal_Bool );
+ sal_Bool IsExpired() const;
+ void SetName( const String& rName, sal_Bool bSetOrigURL = sal_False );
+ sal_Bool IsAllowedForExternalBrowser() const;
+ long GetFileVersion() const;
+
+ const css::uno::Sequence < css::util::RevisionTag >&
+ GetVersionList( bool _bNoReload = false );
+ sal_Bool IsReadOnly();
+
+ // Whether the medium had originally been opened r/o, independent of later
+ // changes via SetOpenMode; used to keep track of the "true" state of the
+ // medium across toggles via SID_EDITDOC (which do change SetOpenMode):
+ bool IsOriginallyReadOnly() const;
+
+ css::uno::Reference< css::io::XInputStream > GetInputStream();
+
+ void CreateTempFile( sal_Bool bReplace = sal_True );
+ void CreateTempFileNoCopy();
+ OUString SwitchDocumentToTempFile();
+ sal_Bool SwitchDocumentToFile( const OUString& aURL );
+
+ OUString GetBaseURL( bool bForSaving=false );
+ void SetInCheckIn( bool bInCheckIn );
+ bool IsInCheckIn( );
+
+ SAL_DLLPRIVATE sal_Bool HasStorage_Impl() const;
+
+ SAL_DLLPRIVATE void StorageBackup_Impl();
+ SAL_DLLPRIVATE OUString GetBackup_Impl();
+
+ SAL_DLLPRIVATE css::uno::Reference< css::embed::XStorage > GetZipStorageToSign_Impl( sal_Bool bReadOnly = sal_True );
+ SAL_DLLPRIVATE void CloseZipStorage_Impl();
+
+ // the storage that will be returned by the medium on GetStorage request
+ SAL_DLLPRIVATE void SetStorage_Impl( const css::uno::Reference< css::embed::XStorage >& xNewStorage );
+
+ SAL_DLLPRIVATE css::uno::Reference< css::io::XInputStream > GetInputStream_Impl();
+ SAL_DLLPRIVATE void CloseAndReleaseStreams_Impl();
+ SAL_DLLPRIVATE sal_uInt16 AddVersion_Impl( css::util::RevisionTag& rVersion );
+ SAL_DLLPRIVATE sal_Bool TransferVersionList_Impl( SfxMedium& rMedium );
+ SAL_DLLPRIVATE sal_Bool SaveVersionList_Impl( sal_Bool bUseXML );
+ SAL_DLLPRIVATE sal_Bool RemoveVersion_Impl( const OUString& rVersion );
+
+ SAL_DLLPRIVATE void SetExpired_Impl( const DateTime& rDateTime );
+ SAL_DLLPRIVATE SvKeyValueIterator* GetHeaderAttributes_Impl();
+
+ // Diese Protokolle liefern MIME Typen
+ SAL_DLLPRIVATE sal_Bool SupportsMIME_Impl() const;
+
+ SAL_DLLPRIVATE void Init_Impl();
+ SAL_DLLPRIVATE void ForceSynchronStream_Impl( sal_Bool bSynchron );
+
+ SAL_DLLPRIVATE void GetLockingStream_Impl();
+ SAL_DLLPRIVATE void GetMedium_Impl();
+ SAL_DLLPRIVATE sal_Bool TryDirectTransfer( const OUString& aURL, SfxItemSet& aTargetSet );
+ SAL_DLLPRIVATE void Transfer_Impl();
+ SAL_DLLPRIVATE void CreateFileStream();
+ SAL_DLLPRIVATE void SetUpdatePickList(sal_Bool);
+ SAL_DLLPRIVATE sal_Bool IsUpdatePickList() const;
+
+ SAL_DLLPRIVATE void SetLongName(const OUString &rName);
+ SAL_DLLPRIVATE const OUString & GetLongName() const;
+ SAL_DLLPRIVATE ErrCode CheckOpenMode_Impl( sal_Bool bSilent, sal_Bool bAllowRO = sal_True );
+ SAL_DLLPRIVATE sal_Bool IsPreview_Impl();
+ SAL_DLLPRIVATE void ClearBackup_Impl();
+ SAL_DLLPRIVATE void Done_Impl( ErrCode );
+ SAL_DLLPRIVATE void SetPhysicalName_Impl(const OUString& rName);
+ SAL_DLLPRIVATE void CanDisposeStorage_Impl( sal_Bool bDisposeStorage );
+ SAL_DLLPRIVATE sal_Bool WillDisposeStorageOnClose_Impl();
+
+ SAL_DLLPRIVATE void DoBackup_Impl();
+ SAL_DLLPRIVATE void DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalContent );
+ SAL_DLLPRIVATE void DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalContent,
+ const String& aPrefix,
+ const String& aExtension,
+ const String& aDestDir );
+
+ SAL_DLLPRIVATE sal_Bool UseBackupToRestore_Impl( ::ucbhelper::Content& aOriginalContent,
+ const css::uno::Reference< css::ucb::XCommandEnvironment >& xComEnv );
+
+ SAL_DLLPRIVATE sal_Bool StorageCommit_Impl();
+
+ SAL_DLLPRIVATE sal_Bool TransactedTransferForFS_Impl( const INetURLObject& aSource,
+ const INetURLObject& aDest,
+ const css::uno::Reference< css::ucb::XCommandEnvironment >& xComEnv );
+
+ SAL_DLLPRIVATE sal_Bool SignContents_Impl( sal_Bool bScriptingContent, const OUString& aODFVersion, sal_Bool bHasValidDocumentSignature );
+
+ // the following two methods must be used and make sence only during saving currently
+ // TODO/LATER: in future the signature state should be controlled by the medium not by the document
+ // in this case the methods will be used generally, and might need to be renamed
+ SAL_DLLPRIVATE sal_uInt16 GetCachedSignatureState_Impl();
+ SAL_DLLPRIVATE void SetCachedSignatureState_Impl( sal_uInt16 nState );
+
+ static css::uno::Sequence < css::util::RevisionTag > GetVersionList(
+ const css::uno::Reference< css::embed::XStorage >& xStorage );
+ static OUString CreateTempCopyWithExt( const OUString& aURL );
+ static sal_Bool CallApproveHandler( const css::uno::Reference< css::task::XInteractionHandler >& xHandler, css::uno::Any aRequest, sal_Bool bAllowAbort );
+
+ static sal_Bool SetWritableForUserOnly( const OUString& aURL );
+ static sal_uInt32 CreatePasswordToModifyHash( const OUString& aPasswd, sal_Bool bWriter );
+};
+
+SV_DECL_IMPL_REF( SfxMedium )
+
+typedef ::std::vector< SfxMedium* > SfxMediumList;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx
new file mode 100644
index 000000000000..cc6f6b8c1971
--- /dev/null
+++ b/include/sfx2/docfilt.hxx
@@ -0,0 +1,126 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFX_DOCFILT_HACK_HXX
+#define _SFX_DOCFILT_HACK_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/plugin/PluginDescription.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/beans/UnknownPropertyException.hpp>
+#include <com/sun/star/lang/WrappedTargetException.hpp>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <tools/wldcrd.hxx>
+
+#include <comphelper/documentconstants.hxx>
+#define SFX_FILTER_STARTPRESENTATION 0x20000000L
+
+#include <sfx2/sfxdefs.hxx>
+
+class SfxFilterContainer;
+class SotStorage;
+
+class SFX2_DLLPUBLIC SfxFilter
+{
+ friend class SfxFilterContainer;
+
+ WildCard aWildCard;
+
+ OUString aTypeName;
+ OUString aUserData;
+ OUString aServiceName;
+ OUString aMimeType;
+ OUString maFilterName;
+ OUString aPattern;
+ OUString aUIName;
+ OUString aDefaultTemplate;
+
+ /**
+ * Custom provider name in case the filter is provided via external
+ * libraries. Empty for conventional filter types.
+ */
+ OUString maProvider;
+
+ SfxFilterFlags nFormatType;
+ sal_uIntPtr nVersion;
+ sal_uIntPtr lFormat;
+ sal_uInt16 nDocIcon;
+
+public:
+ SfxFilter( const OUString& rProvider, const OUString& rFilterName );
+
+ SfxFilter( const OUString &rName,
+ const OUString &rWildCard,
+ SfxFilterFlags nFormatType,
+ sal_uInt32 lFormat,
+ const OUString &rTypeName,
+ sal_uInt16 nDocIcon,
+ const OUString &rMimeType,
+ const OUString &rUserData,
+ const OUString& rServiceName );
+ ~SfxFilter();
+
+ bool IsAllowedAsTemplate() const { return nFormatType & SFX_FILTER_TEMPLATE; }
+ bool IsOwnFormat() const { return nFormatType & SFX_FILTER_OWN; }
+ bool IsOwnTemplateFormat() const { return nFormatType & SFX_FILTER_TEMPLATEPATH; }
+ bool IsAlienFormat() const { return nFormatType & SFX_FILTER_ALIEN; }
+ bool CanImport() const { return nFormatType & SFX_FILTER_IMPORT; }
+ bool CanExport() const { return nFormatType & SFX_FILTER_EXPORT; }
+ bool IsInternal() const { return nFormatType & SFX_FILTER_INTERNAL; }
+ SfxFilterFlags GetFilterFlags() const { return nFormatType; }
+ const OUString& GetFilterName() const { return maFilterName; }
+ const OUString& GetMimeType() const { return aMimeType; }
+ const OUString& GetName() const { return maFilterName; }
+ const WildCard& GetWildcard() const { return aWildCard; }
+ const OUString& GetRealTypeName() const { return aTypeName; }
+ sal_uIntPtr GetFormat() const { return lFormat; }
+ const OUString& GetTypeName() const { return aTypeName; }
+ const OUString& GetUIName() const { return aUIName; }
+ sal_uInt16 GetDocIconId() const { return nDocIcon; }
+ const OUString& GetUserData() const { return aUserData; }
+ const OUString& GetDefaultTemplate() const { return aDefaultTemplate; }
+ void SetDefaultTemplate( const String& rStr ) { aDefaultTemplate = rStr; }
+ bool UsesStorage() const { return GetFormat() != 0; }
+ void SetURLPattern( const OUString& rStr );
+ OUString GetURLPattern() const { return aPattern; }
+ void SetUIName( const String& rName ) { aUIName = rName; }
+ void SetVersion( sal_uIntPtr nVersionP ) { nVersion = nVersionP; }
+ sal_uIntPtr GetVersion() const { return nVersion; }
+ OUString GetSuffixes() const;
+ OUString GetDefaultExtension() const;
+ const OUString& GetServiceName() const { return aServiceName; }
+ const OUString& GetProviderName() const;
+
+ static const SfxFilter* GetDefaultFilter( const String& rName );
+ static const SfxFilter* GetFilterByName( const String& rName );
+ static const SfxFilter* GetDefaultFilterFromFactory( const String& rServiceName );
+
+ static OUString GetTypeFromStorage( const SotStorage& rStg );
+ static OUString GetTypeFromStorage(
+ const com::sun::star::uno::Reference<com::sun::star::embed::XStorage>& xStorage,
+ bool bTemplate = false, OUString* pName = NULL )
+ throw ( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/docinf.hxx b/include/sfx2/docinf.hxx
new file mode 100644
index 000000000000..8ab57ffe2ae4
--- /dev/null
+++ b/include/sfx2/docinf.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 _SFXDOCINF_HXX
+#define _SFXDOCINF_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/uno/Reference.hxx>
+
+
+class GDIMetaFile;
+class SotStorage;
+
+namespace com { namespace sun { namespace star {
+ namespace document {
+ class XDocumentProperties;
+ }
+} } }
+
+
+namespace sfx2 {
+
+/** load document meta-data from OLE stream
+
+ @param i_xDocProps Document meta-data
+ @param i_pStorage OLE Storage
+ */
+sal_uInt32 SFX2_DLLPUBLIC LoadOlePropertySet(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties> i_xDocProps,
+ SotStorage* i_pStorage );
+
+/** save document meta-data to OLE stream
+
+ @param i_xDocProps Document meta-data
+ @param i_pStorage OLE Storage
+ @param i_pThumb Thumbnail: preview bitmap
+ @param i_pGuid Blob: Guid blob ("_PID_GUID")
+ @param i_pHyperlinks Blob: Hyperlink blob ("_PID_HLINKS")
+ */
+bool SFX2_DLLPUBLIC SaveOlePropertySet(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties> i_xDocProps,
+ SotStorage* i_pStorage,
+ const ::com::sun::star::uno::Sequence<sal_uInt8> * i_pThumb = 0,
+ const ::com::sun::star::uno::Sequence<sal_uInt8> * i_pGuid = 0,
+ const ::com::sun::star::uno::Sequence<sal_uInt8> * i_pHyperlinks = 0);
+
+
+::com::sun::star::uno::Sequence<sal_uInt8> SFX2_DLLPUBLIC convertMetaFile(
+ GDIMetaFile* i_pThumb);
+
+} // namespace sfx2
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/docinsert.hxx b/include/sfx2/docinsert.hxx
new file mode 100644
index 000000000000..cefcf034f48e
--- /dev/null
+++ b/include/sfx2/docinsert.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 _SFX_DOCINSERT_HXX
+#define _SFX_DOCINSERT_HXX
+
+#include <tools/errcode.hxx>
+#include <tools/link.hxx>
+#include <tools/string.hxx>
+#include <vector>
+
+#include "sfx2/dllapi.h"
+
+namespace sfx2 { class FileDialogHelper; }
+class SfxMedium;
+class SfxItemSet;
+
+typedef ::std::vector< SfxMedium* > SfxMediumList;
+
+namespace sfx2 {
+
+class SFX2_DLLPUBLIC DocumentInserter
+{
+private:
+ String m_sDocFactory;
+ String m_sFilter;
+ Link m_aDialogClosedLink;
+
+ sal_Int64 const m_nDlgFlags;
+ ErrCode m_nError;
+
+ sfx2::FileDialogHelper* m_pFileDlg;
+ SfxItemSet* m_pItemSet;
+ std::vector<OUString> m_pURLList;
+
+ DECL_LINK(DialogClosedHdl, void *);
+
+public:
+ DocumentInserter(const String& rFactory,
+ bool const bEnableMultiSelection = false);
+ ~DocumentInserter();
+
+ void StartExecuteModal( const Link& _rDialogClosedLink );
+ SfxMedium* CreateMedium();
+ SfxMediumList* CreateMediumList();
+
+ inline ErrCode GetError() const { return m_nError; }
+ inline String GetFilter() const { return m_sFilter; }
+};
+
+} // namespace sfx2
+
+#endif // _SFX_DOCINSERT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/dockwin.hxx b/include/sfx2/dockwin.hxx
new file mode 100644
index 000000000000..d64b6ed7a6f7
--- /dev/null
+++ b/include/sfx2/dockwin.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 _SFXDOCKWIN_HXX
+#define _SFXDOCKWIN_HXX
+
+#include "sal/config.h"
+#include "sal/types.h"
+#include <vcl/dockwin.hxx>
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+
+#include "sfx2/dllapi.h"
+#include <sfx2/childwin.hxx>
+
+class SfxSplitWindow;
+class SfxDockingWindow_Impl;
+
+void SFX2_DLLPUBLIC SAL_CALL SfxDockingWindowFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const OUString& rDockingWindowName );
+bool SFX2_DLLPUBLIC SAL_CALL IsDockingWindowVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const OUString& rDockingWindowName );
+
+class SFX2_DLLPUBLIC SfxDockingWindow : public DockingWindow
+{
+private:
+ Rectangle aInnerRect;
+ Rectangle aOuterRect;
+ SfxBindings* pBindings;
+ Size aFloatSize;
+ SfxChildWindow* pMgr;
+ SfxDockingWindow_Impl* pImp;
+
+ SAL_DLLPRIVATE SfxDockingWindow(SfxDockingWindow &); // not defined
+ SAL_DLLPRIVATE void operator =(SfxDockingWindow &); // not defined
+
+protected:
+ SfxChildAlignment CalcAlignment(const Point& rPos, Rectangle& rRect );
+ void CalcSplitPosition(const Point rPos, Rectangle& rRect,
+ SfxChildAlignment eAlign);
+ virtual Size CalcDockingSize(SfxChildAlignment);
+ virtual SfxChildAlignment
+ CheckAlignment(SfxChildAlignment,SfxChildAlignment);
+
+ virtual void Resize();
+ virtual sal_Bool PrepareToggleFloatingMode();
+ virtual void ToggleFloatingMode();
+ virtual void StartDocking();
+ virtual sal_Bool Docking( const Point& rPos, Rectangle& rRect );
+ virtual void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
+ virtual void Resizing( Size& rSize );
+ virtual void Paint( const Rectangle& rRect );
+ virtual sal_Bool Close();
+ virtual void Move();
+
+ SAL_DLLPRIVATE SfxChildWindow* GetChildWindow_Impl() { return pMgr; }
+
+public:
+ SfxDockingWindow( SfxBindings *pBindings,
+ SfxChildWindow *pCW,
+ Window* pParent,
+ WinBits nWinBits=0);
+ SfxDockingWindow( SfxBindings *pBindings,
+ SfxChildWindow *pCW,
+ Window* pParent,
+ const ResId& rResId);
+ ~SfxDockingWindow();
+
+ void Initialize (SfxChildWinInfo* pInfo);
+ virtual void FillInfo(SfxChildWinInfo&) const;
+ virtual void StateChanged( StateChangedType nStateChange );
+
+ void SetDockingRects(const Rectangle& rOuter, const Rectangle& rInner)
+ { aInnerRect = rInner; aOuterRect = rOuter; }
+ const Rectangle& GetInnerRect() const { return aInnerRect; }
+ const Rectangle& GetOuterRect() const { return aOuterRect; }
+ SfxBindings& GetBindings() const { return *pBindings; }
+ sal_uInt16 GetType() const { return pMgr->GetType(); }
+ SfxChildAlignment GetAlignment() const { return pMgr->GetAlignment(); }
+ void SetAlignment(SfxChildAlignment eAlign) { pMgr->SetAlignment(eAlign); }
+ Size GetFloatingSize() const { return aFloatSize; }
+ void SetFloatingSize(const Size& rSize) { aFloatSize=rSize; }
+
+ void SetMinOutputSizePixel( const Size& rSize );
+ Size GetMinOutputSizePixel() const;
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void FadeIn( sal_Bool );
+ void AutoShow( sal_Bool bShow = sal_True );
+ DECL_LINK(TimerHdl, void *);
+
+ SAL_DLLPRIVATE void Initialize_Impl();
+ SAL_DLLPRIVATE sal_uInt16 GetWinBits_Impl() const;
+ SAL_DLLPRIVATE void SetItemSize_Impl( const Size& rSize );
+ SAL_DLLPRIVATE void Disappear_Impl();
+ SAL_DLLPRIVATE void Reappear_Impl();
+ SAL_DLLPRIVATE sal_Bool IsAutoHide_Impl() const;
+ SAL_DLLPRIVATE void AutoShow_Impl( sal_Bool bShow = sal_True );
+ SAL_DLLPRIVATE void Pin_Impl( sal_Bool bPinned );
+ SAL_DLLPRIVATE void ReleaseChildWindow_Impl();
+};
+
+class SfxDockingWrapper : public SfxChildWindow
+{
+ public:
+ SfxDockingWrapper( Window* pParent ,
+ sal_uInt16 nId ,
+ SfxBindings* pBindings ,
+ SfxChildWinInfo* pInfo );
+
+ SFX_DECL_CHILDWINDOW(SfxDockingWrapper);
+};
+
+#endif // #ifndef _SFXDOCKWIN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/docmacromode.hxx b/include/sfx2/docmacromode.hxx
new file mode 100644
index 000000000000..4e089d7e3d55
--- /dev/null
+++ b/include/sfx2/docmacromode.hxx
@@ -0,0 +1,328 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SFX2_DOCMACROMODE_HXX
+#define SFX2_DOCMACROMODE_HXX
+
+#include "sfx2/dllapi.h"
+
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/script/XLibraryContainer.hpp>
+#include <com/sun/star/document/XEmbeddedScripts.hpp>
+
+#include <boost/shared_ptr.hpp>
+
+//........................................................................
+namespace sfx2
+{
+//........................................................................
+
+ //====================================================================
+ //= IMacroDocumentAccess
+ //====================================================================
+ /** provides access to several settings of a document, which are needed by ->DocumentMacroMode
+ to properly determine the current macro execution mode of this document
+ */
+ class SAL_NO_VTABLE IMacroDocumentAccess
+ {
+ public:
+ /** retrieves the current MacroExecutionMode.
+
+ Usually, this is initialized from the media descriptor used to load the document,
+ respectively the one passed into the document's XModel::attachResource call.
+
+ If no such mode was passed there, document implementations should return
+ MacroExecMode::NEVER_EXECUTE.
+
+ @see ::com::sun::star::document::MediaDescriptor::MacroExecutionMode
+ @see ::com::sun::star::frame::XComponentLoader::loadComponentFromURL
+ @see ::com::sun::star::frame::XModel::attachResource
+
+ @see setCurrentMacroExecMode
+
+ @todo
+ Effectively, this is the MacroExecutionMode of the MediaDescriptor of
+ the document. Thus, this setting could be obtained from the XModel
+ directly. We should introduce a getDocumentModel method here, which
+ can be used for this and other purposes.
+ */
+ virtual sal_Int16
+ getCurrentMacroExecMode() const = 0;
+
+ /** sets the MacroExecutionMode of the document, as calculated by the DocumentMacroMode
+ class.
+
+ Effectively, the existence of this method means that the responsibility
+ to store the current macro execution mode is not with the DocumentMacroMode
+ instance, but with the document instance itself.
+
+ Usually, a document implementation will simply put the macro execution mode
+ into its media descriptor, as returned by XModel::getArgs.
+
+ @see ::com::sun::star::document::MediaDescriptor::MacroExecutionMode
+ @see ::com::sun::star::frame::XComponentLoader::loadComponentFromURL
+ @see ::com::sun::star::frame::XModel::attachResource
+
+ see getCurrentMacroExecMode
+ */
+ virtual sal_Bool
+ setCurrentMacroExecMode( sal_uInt16 ) = 0;
+
+ /** returns the origin of the document
+
+ This usually is the document's location, or, if the document has been
+ newly created from a template, then the location of the template. Location
+ here means the complete path of the document, including the file name.
+
+ @todo
+ This probably can also be obtained from the XModel, by calling getURL
+ or getLocation. If both are empty, then we need an UNO way to obtain
+ the URL of the underlying template document - if any. If we have this,
+ we could replace this method with a newly introduced method
+ getDocumentModel and some internal code.
+ */
+ virtual OUString
+ getDocumentLocation() const = 0;
+
+ /** returns a zip-storage based on the last commited version of the document,
+ for readonly access
+
+ The storage is intended to be used for signing. An implementation is
+ allowed to return <NULL/> here if and only if the document
+ does not support signing the script storages.
+
+ @todo
+ UNOize this, too. Once we have a getDocumentModel, we should be able to
+ obtain the "last commit" storage via UNO API, provided it's an
+ XStorageBasedDocument.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ getZipStorageToSign() = 0;
+
+ /** checks whether the document's storage contains sub storages with macros or scripts
+
+ A default implementation of this method will simply cann DocumentMacroMode::storageHasMacros
+ with the document's root storage. However, there might be document types where this
+ isn't sufficient (e.g. database documents which contain sub documents which can also
+ contain macro/script storages).
+ */
+ virtual sal_Bool
+ documentStorageHasMacros() const = 0;
+
+ /** provides access to the XEmbeddedScripts interface of the document
+
+ Implementations are allowed to return <NULL/> here if and only if they
+ do not (yet) support embedding scripts.
+
+ @todo
+ can also be replaced with a call to the (to be introduced) getDocumentModel
+ method, and a queryInterface.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedScripts >
+ getEmbeddedDocumentScripts() const = 0;
+
+ /** returns the state of the signatures for the scripts embedded in the document
+
+ Note: On the medium run, the signature handling of a document should be outsourced
+ into a dedicated class, instead of being hard-wired into the SfxObjectShell. This
+ class could then be used outside the SfxObjectShell (e.g. in Base documents), too.
+ When this happens, this method here becomes should be replaced by a method at this
+ new class.
+
+ @seealso <sfx2/signaturestate.hxx>
+ */
+ virtual sal_Int16
+ getScriptingSignatureState() = 0;
+
+ /** allows to detect whether there is a trusted scripting signature
+
+ Note: On the medium run, the signature handling of a document should be outsourced
+ into a dedicated class, instead of being hard-wired into the SfxObjectShell. This
+ class could then be used outside the SfxObjectShell (e.g. in Base documents), too.
+ When this happens, this method here should be replaced by a method at this
+ new class.
+
+ @seealso <sfx2/signaturestate.hxx>
+ */
+ virtual sal_Bool
+ hasTrustedScriptingSignature( sal_Bool bAllowUIToAddAuthor ) = 0;
+
+ /** shows a warning that the document's signature is broken
+
+ Here, a similar note applies as to getScriptingSignatureState: This method doesn't
+ really belong here. It's just there because SfxObjectShell_Impl::bSignatureErrorIsShown
+ is not accessible where the method is called.
+ So, once the signature handling has been oursourced from SfxObjectShell/_Impl, so it
+ is re-usable in non-SFX contexts as well, this method here is also unneeded, probably.
+
+ @param _rxInteraction
+ the interaction handler to use for showing the warning. It is exactly the same
+ as passed to DocumentMacroMode::adjustMacroMode, so it is <NULL/> if and
+ only if the instance passed to that method was <NULL/>.
+ */
+ virtual void
+ showBrokenSignatureWarning(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxInteraction
+ ) const = 0;
+
+ protected:
+ ~IMacroDocumentAccess() {}
+ };
+
+ //====================================================================
+ //= DocumentMacroMode
+ //====================================================================
+ struct DocumentMacroMode_Data;
+
+ /** encapsulates handling the macro mode of a document
+
+ @see com::sun::star::document::MacroExecMode
+ */
+ class SFX2_DLLPUBLIC DocumentMacroMode
+ {
+ public:
+ /** creates an instance
+
+ @param _rDocumentAccess
+ access to the document which this instance works for. Must live as long as the
+ DocumentMacroMode instance lives, at least
+ */
+ DocumentMacroMode( IMacroDocumentAccess& _rDocumentAccess );
+ ~DocumentMacroMode();
+
+ /** allows macro execution in the document
+
+ Effectively, the macro mode is set to MacroExecMode::ALWAYS_EXECUTE_NO_WARN.
+
+ @return
+ <TRUE/>, always
+ */
+ sal_Bool allowMacroExecution();
+
+ /** disallows macro execution in the document
+
+ Effectively, the macro mode is set to MacroExecMode::NEVER_EXECUTE.
+
+ @return
+ <TRUE/>, always
+ */
+ sal_Bool disallowMacroExecution();
+
+ /** checks whether the document allows executing contained macros.
+
+ The method transforms the current macro execution mode into either
+ ALWAYS_EXECUTE_NO_WARN or NEVER_EXECUTE, depending on the current value,
+ possible configuration settings, and possible user interaction.
+
+ @param _rxInteraction
+ A handler for interactions which might become necessary.
+ This includes
+ <ul><li>Asking the user for confirmation for macro execution.</li>
+ <li>Telling the user that macro execution is disabled.</li>
+ </ul>
+
+ If the user needs to be asked for macro execution confirmation, and if
+ this parameter is <NULL/>, the most defensive assumptions will be made,
+ effectively disabling macro execution.
+
+ @return
+ <TRUE/> if and only if macro execution in this document is allowed.
+ */
+ sal_Bool adjustMacroMode(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxInteraction
+ );
+
+ /** determines whether macro execution is disallowed
+
+ There's a number of reasons why macro execution could be disallowed:
+ <ul><li>Somebody called ->disallowMacroExecution</li>
+ <li>Macro execution is disabled globally, via the security options</li>
+ <li>Macro execution mode was not defined initially, and the user denied
+ executing macros for this particular document.</li>
+ </ul>
+
+ Note that if this method returns <FALSE/>, then subsequent calls of
+ ->adjustMacroMode can still return <FALSE/>.
+ That is, if the current macro execution mode for the document is not yet known
+ (and inparticular <em>not</em> MacroExecMode::NEVER_EXECUTE), then ->isMacroExecutionDisallowed
+ will return <FALSE/>.
+ However, a subsequent call to ->adjustMacroMode can result in the user
+ denying macro execution, in which ->adjustMacroMode will return <FALSE/>,
+ and the next call to isMacroExecutionDisallowed will return <TRUE/>.
+ */
+ sal_Bool isMacroExecutionDisallowed() const;
+
+ /** determines whether the document actually has a macros library
+
+ Effectively, this method checks the Basic library container (as returned by
+ IMacroDocumentAccess::getEmbeddedDocumentScripts().getBasicLibraries) for
+ content.
+ */
+ sal_Bool hasMacroLibrary() const;
+
+ /** determines whether the given document storage has sub storages containing scripts
+ or macros.
+
+ Effectively, the method checks for the presence of a sub-storage name "Scripts" (where
+ BeanShell-/JavaScript-/Python-Scripts are stored, and a sub storage named "Basic" (where
+ Basic scripts are stored).
+ */
+ static sal_Bool
+ storageHasMacros( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxStorage );
+
+ static sal_Bool containerHasBasicMacros( const ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >& xContainter );
+ /** checks the macro execution mode while loading the document.
+
+ This must be called when the loading is effectively finished, but before any macro action
+ happened.
+
+ The method will disallow macro execution for this document if it is disabled
+ globally (SvtSecurityOptions::IsMacroDisabled). Otherwise, it will check whether
+ the document contains a macro storage or macro libraries. If so, it will
+ properly calculate the MacroExecutionMode by calling adjustMacroMode.
+
+ If the document doesn't contain macros, yet, then the macro execution for this
+ document will be allowed (again: unless disabled globally), since in this case
+ macros which later are newly created by the user should be allowed, of course.
+
+ @return
+ <TRUE/> if and only if macro execution is allowed in the document
+
+ @see isMacroExecutionDisallowed
+ @see IMacroDocumentAccess::documentStorageHasMacros
+ @see hasMacroLibrary
+ @see IMacroDocumentAccess::checkForBrokenScriptingSignatures
+ */
+ sal_Bool
+ checkMacrosOnLoading(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxInteraction
+ );
+
+ private:
+ ::boost::shared_ptr< DocumentMacroMode_Data > m_pData;
+ };
+
+//........................................................................
+} // namespace sfx2
+//........................................................................
+
+#endif // SFX2_DOCMACROMODE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/docstoragemodifylistener.hxx b/include/sfx2/docstoragemodifylistener.hxx
new file mode 100644
index 000000000000..c361b8768260
--- /dev/null
+++ b/include/sfx2/docstoragemodifylistener.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 SFX2_DOCSTORAGEMODIFYLISTENER_HXX
+#define SFX2_DOCSTORAGEMODIFYLISTENER_HXX
+
+#include "sfx2/dllapi.h"
+
+#include <com/sun/star/util/XModifyListener.hpp>
+
+#include <cppuhelper/implbase1.hxx>
+
+
+//........................................................................
+namespace sfx2
+{
+//........................................................................
+
+ //====================================================================
+ //= IModifiableDocument
+ //====================================================================
+ /** callback for the DocumentStorageModifyListener class
+ */
+ class SAL_NO_VTABLE IModifiableDocument
+ {
+ public:
+ /// indicates the root or a sub storage of the document has been modified
+ virtual void storageIsModified() = 0;
+
+ protected:
+ ~IModifiableDocument() {}
+ };
+
+ //====================================================================
+ //= DocumentStorageModifyListener
+ //====================================================================
+ typedef ::cppu::WeakImplHelper1 < ::com::sun::star::util::XModifyListener > DocumentStorageModifyListener_Base;
+
+ class SFX2_DLLPUBLIC DocumentStorageModifyListener : public DocumentStorageModifyListener_Base
+ {
+ IModifiableDocument* m_pDocument;
+ ::osl::SolarMutex& m_rMutex;
+
+ public:
+ DocumentStorageModifyListener( IModifiableDocument& _rDocument, ::osl::SolarMutex& _rMutex );
+
+ void dispose();
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ virtual ~DocumentStorageModifyListener();
+
+ private:
+ DocumentStorageModifyListener(); // never implemented
+ DocumentStorageModifyListener( const DocumentStorageModifyListener& ); // never implemented
+ DocumentStorageModifyListener& operator=( const DocumentStorageModifyListener& ); // never implemented
+ };
+
+//........................................................................
+} // namespace sfx2
+//........................................................................
+
+#endif // SFX2_DOCSTORAGEMODIFYLISTENER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/doctempl.hxx b/include/sfx2/doctempl.hxx
new file mode 100644
index 000000000000..a5b24cf81993
--- /dev/null
+++ b/include/sfx2/doctempl.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 _SFXDOCTEMPL_HXX
+#define _SFXDOCTEMPL_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <tools/ref.hxx>
+#include <tools/string.hxx>
+
+// CLASS -----------------------------------------------------------------
+
+class SfxObjectShell;
+
+#ifndef SFX_DECL_OBJECTSHELL_DEFINED
+#define SFX_DECL_OBJECTSHELL_DEFINED
+SV_DECL_REF(SfxObjectShell)
+#endif
+
+class SfxDocTemplate_Impl;
+
+#ifndef SFX_DECL_DOCTEMPLATES_DEFINED
+#define SFX_DECL_DOCTEMPLATES_DEFINED
+SV_DECL_REF(SfxDocTemplate_Impl)
+#endif
+
+// class SfxDocumentTemplates --------------------------------------------
+
+class SFX2_DLLPUBLIC SfxDocumentTemplates
+{
+private:
+ SfxDocTemplate_ImplRef pImp;
+
+ SAL_DLLPRIVATE sal_Bool CopyOrMove( sal_uInt16 nTargetRegion, sal_uInt16 nTargetIdx,
+ sal_uInt16 nSourceRegion, sal_uInt16 nSourceIdx, sal_Bool bMove );
+public:
+ SfxDocumentTemplates();
+ SfxDocumentTemplates(const SfxDocumentTemplates &);
+ ~SfxDocumentTemplates();
+
+ sal_Bool IsConstructed() { return pImp != NULL; }
+ void Construct();
+
+ const SfxDocumentTemplates &operator=(const SfxDocumentTemplates &);
+
+ void ReInitFromComponent();
+
+ sal_uInt16 GetRegionCount() const;
+ const String& GetRegionName(sal_uInt16 nIdx) const; //dv!
+ String GetFullRegionName(sal_uInt16 nIdx) const;
+
+ sal_uInt16 GetCount(sal_uInt16 nRegion) const;
+ const String& GetName(sal_uInt16 nRegion, sal_uInt16 nIdx) const; //dv!
+ String GetPath(sal_uInt16 nRegion, sal_uInt16 nIdx) const;
+
+ // Allows to retrieve the target template URL from the UCB
+ OUString GetTemplateTargetURLFromComponent( const OUString& aGroupName,
+ const OUString& aTitle );
+
+ // Convert a resource string - a template name - to its localised pair
+ // if it exists in templatelocnames.src
+ static OUString ConvertResourceString(int nSourceResIds,
+ int nDestResIds,
+ int nCount,
+ const OUString& rString);
+
+ sal_Bool Copy(sal_uInt16 nTargetRegion,
+ sal_uInt16 nTargetIdx,
+ sal_uInt16 nSourceRegion,
+ sal_uInt16 nSourceIdx);
+ sal_Bool Move(sal_uInt16 nTargetRegion,
+ sal_uInt16 nTargetIdx,
+ sal_uInt16 nSourceRegion,
+ sal_uInt16 nSourceIdx);
+ sal_Bool Delete(sal_uInt16 nRegion, sal_uInt16 nIdx);
+ sal_Bool InsertDir(const String &rText, sal_uInt16 nRegion);
+
+ sal_Bool InsertTemplate (sal_uInt16 nSourceRegion, sal_uInt16 nIdx, const OUString &rName, const OUString &rPath);
+
+ /** Change the name of an entry or a directory
+
+ \param rName
+ The new name to set
+ \param nRegion
+ The id of the region to rename or containing the template to rename
+ \param nIdx
+ The id of the template to rename or USHRT_MAX to rename the region.
+
+ \return
+ sal_True if the action could be performed, sal_False otherwise
+
+ */
+ sal_Bool SetName(const OUString &rName, sal_uInt16 nRegion, sal_uInt16 nIdx);
+
+ sal_Bool CopyTo(sal_uInt16 nRegion, sal_uInt16 nIdx, const String &rName) const;
+ sal_Bool CopyFrom(sal_uInt16 nRegion, sal_uInt16 nIdx, String &rName);
+
+ sal_Bool GetFull( const String& rRegion, const String& rName, String& rPath );
+ sal_Bool GetLogicNames( const String& rPath, String& rRegion, String& rName ) const;
+
+ /** updates the configuration where the document templates structure is stored.
+
+ <p>The info about the document templates (which files, which groups etc.) is stored in the
+ configuration. This means that just by copying files into OOo's template directories, this
+ change is not reflected in the SfxDocumentTemplates - 'cause the configuration is not synchronous with
+ the file system. This can be enforced with this method.</p>
+
+ @param _bSmart
+ The update of the configuration is rather expensive - nothing you want to do regulary if you don't really
+ need it. So you have the possibility to do a smart update - it first checks if the update if necessary.
+ In case the update is needed, the additional check made it somewhat more expensive. In case it's not
+ necessary (which should be the usual case), the check alone is (much) less expensive than the real update.
+ <br/>
+ So set <arg>_bSmart</arg> to <TRUE/> to do a check for necessity first.
+ */
+ void Update( sal_Bool _bSmart = sal_True );
+};
+
+#endif // #ifndef _SFXDOCTEMPL_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/event.hxx b/include/sfx2/event.hxx
new file mode 100644
index 000000000000..bcdc88ec2edb
--- /dev/null
+++ b/include/sfx2/event.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 _SFXEVENT_HXX
+#define _SFXEVENT_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <tools/string.hxx>
+#include <svl/hint.hxx>
+#include <unotools/eventcfg.hxx>
+#include <rtl/ustring.hxx>
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/frame/XController2.hpp>
+
+class SfxObjectShell;
+
+//-------------------------------------------------------------------
+
+class SFX2_DLLPUBLIC SfxEventHint : public SfxHint
+{
+ SfxObjectShell* pObjShell;
+ OUString aEventName;
+ sal_uInt16 nEventId;
+
+public:
+ TYPEINFO();
+ SfxEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj = 0 )
+ : pObjShell(pObj),
+ aEventName(aName),
+ nEventId(nId)
+ {}
+
+ sal_uInt16 GetEventId() const
+ { return nEventId; }
+
+ OUString GetEventName() const
+ { return aEventName; }
+
+ SfxObjectShell* GetObjShell() const
+ { return pObjShell; }
+};
+
+//-------------------------------------------------------------------
+
+class SFX2_DLLPUBLIC SfxViewEventHint : public SfxEventHint
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > xViewController;
+
+public:
+ TYPEINFO();
+
+ SfxViewEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController )
+ : SfxEventHint( nId, aName, pObj )
+ , xViewController( xController, ::com::sun::star::uno::UNO_QUERY )
+ {}
+
+ SfxViewEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >& xController )
+ : SfxEventHint( nId, aName, pObj )
+ , xViewController( xController )
+ {}
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > GetController() const
+ { return xViewController; }
+};
+
+//-------------------------------------------------------------------
+
+class SfxNamedHint : public SfxHint
+{
+ String _aEventName;
+ SfxObjectShell* _pObjShell;
+ String _aArgs;
+
+public:
+ TYPEINFO();
+
+ SfxNamedHint( const String& rName,
+ const String& rArgs,
+ SfxObjectShell *pObj = 0 )
+ : _aEventName( rName ),
+ _pObjShell( pObj),
+ _aArgs( rArgs )
+ {}
+
+ SfxNamedHint( const String& rName,
+ SfxObjectShell *pObj = 0 )
+ : _aEventName( rName ),
+ _pObjShell( pObj )
+ {}
+
+ const String& GetArgs() const { return _aArgs;}
+ const String& GetName() const { return _aEventName; }
+ SfxObjectShell* GetObjShell() const { return _pObjShell; }
+};
+
+class Printer;
+class SfxPrintingHint : public SfxHint
+{
+ sal_Int32 nWhich;
+ com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aOpts;
+public:
+ TYPEINFO();
+ SfxPrintingHint( sal_Int32 nEvent, const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& rOpts )
+ : nWhich( nEvent )
+ , aOpts( rOpts )
+ {}
+
+ SfxPrintingHint( sal_Int32 nEvent )
+ : nWhich( nEvent )
+ {}
+
+ sal_Int32 GetWhich() const { return nWhich; }
+ const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& GetOptions() { return aOpts; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/evntconf.hxx b/include/sfx2/evntconf.hxx
new file mode 100644
index 000000000000..2f181ad820b1
--- /dev/null
+++ b/include/sfx2/evntconf.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 _SFX_EVENTCONF_HXX
+#define _SFX_EVENTCONF_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <tools/rtti.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+
+#include <sfx2/event.hxx>
+
+#include <sfx2/sfxsids.hrc>
+#ifdef ITEMID_MACRO
+#undef ITEMID_MACRO
+#endif
+#define ITEMID_MACRO SID_ATTR_MACROITEM
+#include <svl/macitem.hxx>
+#include <vector>
+
+class SfxObjectShell;
+class SvxMacroTableDtor;
+
+struct SFX2_DLLPUBLIC SfxEventName
+{
+ sal_uInt16 mnId;
+ String maEventName;
+ String maUIName;
+
+ SfxEventName( sal_uInt16 nId,
+ const String& rEventName,
+ const String& rUIName )
+ : mnId( nId )
+ , maEventName( rEventName )
+ , maUIName( rUIName ) {}
+};
+
+typedef ::std::vector< SfxEventName* > _SfxEventNamesList;
+
+class SFX2_DLLPUBLIC SfxEventNamesList
+{
+private:
+ _SfxEventNamesList aEventNamesList;
+ void DelDtor();
+
+public:
+ SfxEventNamesList() {}
+ SfxEventNamesList( const SfxEventNamesList &rCpy ) { *this = rCpy; }
+ ~SfxEventNamesList() { DelDtor(); }
+ SfxEventNamesList& operator=( const SfxEventNamesList &rCpy );
+
+ size_t size() const { return aEventNamesList.size(); };
+
+ SfxEventName* at( size_t Index ) const
+ { return Index < aEventNamesList.size() ? aEventNamesList[ Index ] : NULL; }
+
+ void push_back( SfxEventName* Item ) { aEventNamesList.push_back( Item ); }
+};
+
+class SFX2_DLLPUBLIC SfxEventNamesItem : public SfxPoolItem
+{
+ SfxEventNamesList aEventsList;
+
+public:
+ TYPEINFO();
+
+ SfxEventNamesItem ( const sal_uInt16 nId ) : SfxPoolItem( nId ) {}
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+
+ const SfxEventNamesList& GetEvents() const { return aEventsList;}
+ void SetEvents( const SfxEventNamesList& rList ) { aEventsList = rList; }
+ void AddEvent( const String&, const String&, sal_uInt16 );
+};
+
+// -----------------------------------------------------------------------
+
+#define PROP_EVENT_TYPE "EventType"
+#define PROP_LIBRARY "Library"
+#define PROP_SCRIPT "Script"
+#define PROP_MACRO_NAME "MacroName"
+#define STAR_BASIC "StarBasic"
+
+class SFX2_DLLPUBLIC SfxEventConfiguration
+{
+public:
+ static void ConfigureEvent( OUString aName, const SvxMacro&, SfxObjectShell* pObjSh);
+ static SvxMacro* ConvertToMacro( const com::sun::star::uno::Any& rElement, SfxObjectShell* pDoc, sal_Bool bBlowUp );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/fcontnr.hxx b/include/sfx2/fcontnr.hxx
new file mode 100644
index 000000000000..de7d9a961de4
--- /dev/null
+++ b/include/sfx2/fcontnr.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 _SFX_FCONTNR_HXX
+#define _SFX_FCONTNR_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <svl/poolitem.hxx>
+#include <vcl/window.hxx>
+
+#include <sfx2/docfilt.hxx>
+#include <sfx2/sfxdefs.hxx>
+
+#include <tools/ref.hxx>
+
+#include <boost/utility.hpp>
+
+class Window;
+class SfxFilter;
+class SfxObjectFactory;
+class SfxMedium;
+class SfxFilterContainer_Impl;
+class SfxFrame;
+
+//#define SFX_FILTER_CONTAINER_FACTORY 1
+typedef sal_uInt16 SfxFilterContainerFlags;
+
+class SfxRefItem : public SfxPoolItem
+{
+ SvRefBaseRef aRef;
+public:
+ virtual SfxPoolItem* Clone( SfxItemPool* = 0 ) const
+ { return new SfxRefItem( *this ); }
+ virtual int operator==( const SfxPoolItem& rL) const
+ { return ((SfxRefItem&)rL).aRef == aRef; }
+ SfxRefItem( sal_uInt16 nWhichId, const SvRefBaseRef& rValue ) : SfxPoolItem( nWhichId )
+ { aRef = rValue; }
+ const SvRefBaseRef& GetValue() const { return aRef; }
+
+};
+
+class SfxFrameWindow
+{
+ Window* pWindow;
+public:
+ SfxFrameWindow( Window *pWin )
+ : pWindow( pWin )
+ {}
+
+ virtual ~SfxFrameWindow()
+ { delete pWindow; }
+ Window* GetWindow() const
+ { return pWindow; }
+ void SetWindow( Window *pWin )
+ { pWindow = pWin; }
+};
+
+typedef sal_uIntPtr (*SfxDetectFilter)( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust, SfxFilterFlags nDont );
+
+class SFX2_DLLPUBLIC SfxFilterContainer
+{
+ SfxFilterContainer_Impl *pImpl;
+
+public:
+ SfxFilterContainer( const String& rName );
+ ~SfxFilterContainer();
+
+
+ const String GetName() const;
+
+ const SfxFilter* GetAnyFilter( SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
+ const SfxFilter* GetFilter4EA( const String& rEA, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
+ const SfxFilter* GetFilter4Extension( const String& rExt, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
+ const SfxFilter* GetFilter4FilterName( const String& rName, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
+
+ SAL_DLLPRIVATE static void ReadFilters_Impl( sal_Bool bUpdate=sal_False );
+ SAL_DLLPRIVATE static void ReadSingleFilter_Impl( const OUString& rName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xTypeCFG,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xFilterCFG,
+ sal_Bool bUpdate );
+ SAL_DLLPRIVATE static const SfxFilter* GetDefaultFilter_Impl( const String& );
+};
+
+class SfxFilterMatcher_Impl;
+
+class SFX2_DLLPUBLIC SfxFilterMatcher : private boost::noncopyable
+{
+ friend class SfxFilterMatcherIter;
+ SfxFilterMatcher_Impl &m_rImpl;
+public:
+ SfxFilterMatcher( const OUString& rFact );
+ SfxFilterMatcher();
+ ~SfxFilterMatcher();
+
+ SAL_DLLPRIVATE static sal_Bool IsFilterInstalled_Impl( const SfxFilter* pFilter );
+ DECL_DLLPRIVATE_STATIC_LINK( SfxFilterMatcher, MaybeFileHdl_Impl, String* );
+
+ sal_uInt32 GuessFilterIgnoringContent( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
+ sal_uInt32 GuessFilter( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
+ sal_uInt32 GuessFilterControlDefaultUI( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED, sal_Bool bDefUI = sal_True ) const;
+ sal_uInt32 DetectFilter( SfxMedium& rMedium, const SfxFilter **, sal_Bool bPlugIn, sal_Bool bAPI = sal_False ) const;
+
+ const SfxFilter* GetFilter4Mime( const OUString& rMime, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED) const;
+ const SfxFilter* GetFilter4ClipBoardId( sal_uInt32 nId, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
+ const SfxFilter* GetFilter4EA( const String& rEA, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
+ const SfxFilter* GetFilter4Extension( const String& rExt, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
+ const SfxFilter* GetFilter4FilterName( const String& rName, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
+ const SfxFilter* GetFilter4UIName( const String& rName, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
+ const SfxFilter* GetFilterForProps( const com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue >& aSeq, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
+ const SfxFilter* GetAnyFilter( SfxFilterFlags nMust=0, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED ) const;
+};
+
+class SfxFilterContainer_Impl;
+class SFX2_DLLPUBLIC SfxFilterMatcherIter : private boost::noncopyable
+
+{
+ SfxFilterFlags nOrMask;
+ SfxFilterFlags nAndMask;
+ sal_uInt16 nCurrent;
+ const SfxFilterMatcher_Impl &m_rMatch;
+
+ SAL_DLLPRIVATE const SfxFilter* Find_Impl();
+
+public:
+ SfxFilterMatcherIter( const SfxFilterMatcher& rMatcher, SfxFilterFlags nMask = 0, SfxFilterFlags nNotMask = SFX_FILTER_NOTINSTALLED );
+ const SfxFilter* First();
+ const SfxFilter* Next();
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/filedlghelper.hxx b/include/sfx2/filedlghelper.hxx
new file mode 100644
index 000000000000..304fd5cdff58
--- /dev/null
+++ b/include/sfx2/filedlghelper.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 _FILEDLGHELPER_HXX
+#define _FILEDLGHELPER_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <rtl/ustring.hxx>
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <tools/errcode.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/button.hxx>
+#include <vcl/graph.hxx>
+#include <sfx2/sfxdefs.hxx>
+#include <sfx2/sfxuno.hxx>
+#include <sfx2/docfilt.hxx>
+
+//-----------------------------------------------------------------------------
+
+namespace com
+{
+ namespace sun
+ {
+ namespace star
+ {
+ namespace ui
+ {
+ namespace dialogs
+ {
+ class XFilePicker;
+ class XFilePickerListener;
+ struct FilePickerEvent;
+ struct DialogClosedEvent;
+ }
+ }
+ }
+ }
+}
+
+class SfxItemSet;
+class Window;
+
+// the SFXWB constants are for the nFlags parameter of the constructor
+#define SFXWB_INSERT 0x04000000L // turn Open into Insert dialog
+#define SFXWB_EXPORT 0x40000000L // turn Save into Export dialog
+#define SFXWB_SAVEACOPY 0x00400000L // turn Save into Save a Copy dialog
+#define SFXWB_MULTISELECTION 0x20000000L
+#define SFXWB_GRAPHIC 0x00800000L // register graphic formats
+
+#define FILEDIALOG_FILTER_ALL "*.*"
+
+#define FILE_OPEN_SERVICE_NAME_OOO "com.sun.star.ui.dialogs.OfficeFilePicker"
+
+namespace sfx2 {
+
+class FileDialogHelper_Impl;
+
+class SFX2_DLLPUBLIC FileDialogHelper
+{
+public:
+ enum Context // context where the FileDialogHelper is used
+ {
+ UNKNOWN_CONTEXT, // unknown context
+ SW_INSERT_GRAPHIC, // insert graphic in writer
+ SW_INSERT_SOUND, // insert sound in writer
+ SW_INSERT_VIDEO, // insert video in writer
+ SC_INSERT_GRAPHIC, // insert graphic in calc
+ SC_INSERT_SOUND, // insert sound in calc
+ SC_INSERT_VIDEO, // insert video in calc
+ SD_INSERT_GRAPHIC, // insert graphic in draw
+ SD_INSERT_SOUND, // insert sound in draw
+ SD_INSERT_VIDEO, // insert video in draw
+ SD_EXPORT, // export in draw
+ SI_EXPORT, // export in impress
+ SW_EXPORT // export in writer
+ };
+
+private:
+ Link m_aDialogClosedLink;
+ ErrCode m_nError;
+
+ ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePickerListener > mxImp;
+ FileDialogHelper_Impl *mpImp;
+
+
+public:
+ FileDialogHelper( sal_Int16 nDialogType,
+ sal_Int64 nFlags,
+ Window* _pPreferredParent = NULL );
+
+ FileDialogHelper( sal_Int16 nDialogType,
+ sal_Int64 nFlags,
+ const String& rFactory,
+ SfxFilterFlags nMust = 0,
+ SfxFilterFlags nDont = 0 );
+
+ FileDialogHelper( sal_Int16 nDialogType,
+ sal_Int64 nFlags,
+ const String& rFactory,
+ sal_Int16 nDialog,
+ SfxFilterFlags nMust,
+ SfxFilterFlags nDont,
+ const String& rStandardDir,
+ const ::com::sun::star::uno::Sequence< OUString >& rBlackList);
+
+ FileDialogHelper( sal_Int16 nDialogType,
+ sal_Int64 nFlags,
+ const OUString& aFilterUIName,
+ const OUString& aExtName,
+ const OUString& rStandardDir,
+ const ::com::sun::star::uno::Sequence< OUString >& rBlackList,
+ Window* _pPreferredParent = NULL );
+
+
+ virtual ~FileDialogHelper();
+
+ ErrCode Execute();
+ void StartExecuteModal( const Link& rEndDialogHdl );
+ inline ErrCode GetError() const { return m_nError; }
+ sal_Int16 GetDialogType() const;
+ sal_Bool IsPasswordEnabled() const;
+ String GetRealFilter() const;
+
+ void SetTitle( const String& rNewTitle );
+ String GetPath() const;
+
+ /** @deprected: Don't use this method to retrieve the selected files
+ There are file picker which can provide multiple selected file which belong
+ to different folders. As this method always provides the root folder for all selected
+ files this cannot work.
+ */
+ ::com::sun::star::uno::Sequence< OUString > GetMPath() const;
+
+ /** Provides the selected files with full path information */
+ ::com::sun::star::uno::Sequence< OUString > GetSelectedFiles() const;
+
+ void AddFilter( const String& rFilterName, const String& rExtension );
+ void SetCurrentFilter( const String& rFilter );
+
+ /** sets an initial display directory/file name
+
+ @deprecated
+ don't use this method. It contains a lot of magic in determining whether the
+ last segment of the given path/URL denotes a file name or a folder, and by
+ definition, it cannot succeed with this magic *all* the time - there will
+ always be scenarios where it fails.
+
+ Use SetDisplayFolder and SetFileName.
+ */
+ void SetDisplayDirectory( const String& rPath );
+
+ /** sets a new folder whose content is to be displayed in the file picker
+
+ @param _rURL
+ specifies the URL of the folder whose content is to be displayed.<br/>
+ If the URL doesn't denote a valid (existent and accessible) folder, the
+ request is silently dropped.
+ @throws ::com::sun::star::uno::RuntimeException
+ if the invocation of any of the file picker or UCB methods throws a RuntimeException.
+ */
+ void SetDisplayFolder( const String& _rURL );
+
+ /** sets an initial file name to display
+
+ This method is usually used in "save-as" contexts, where the application should
+ suggest an initial name for the file to save.
+
+ Calling this method is nearly equivalent to calling <code>GetFilePicker().setDefaultName( _rFileName )</code>,
+ with the following differences:
+ <ul><li>The FileDialogHelper remembers the given file name, and upon execution,
+ strips its extension if the dialog is set up for "automatic file name extension".</li>
+ <li>Exceptions thrown from the <code>XFilePicker</code> are caught and silenced.</li>
+ </ul>
+ */
+ void SetFileName( const String& _rFileName );
+
+ String GetCurrentFilter() const;
+ String GetDisplayDirectory() const;
+ ErrCode GetGraphic( Graphic& rGraphic ) const;
+
+ ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePicker > GetFilePicker() const;
+
+ // XFilePickerListener methods
+ virtual void SAL_CALL FileSelectionChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent );
+ virtual void SAL_CALL DirectoryChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent );
+ virtual void SAL_CALL ControlStateChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent );
+ virtual void SAL_CALL DialogSizeChanged();
+ virtual OUString SAL_CALL HelpRequested( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent );
+
+ // XDialogClosedListener methods
+ virtual void SAL_CALL DialogClosed( const ::com::sun::star::ui::dialogs::DialogClosedEvent& _rEvent );
+
+ /** sets help ids for the controls in the dialog
+ @param _pControlId
+ Pointer to a 0-terminated array of control ids. They must be recruited from the
+ CommonFilePickerElementIds and ExtendedFilePickerElementIds values.
+ @param _pHelpId
+ Pointer to an array of help ids. For each element in _pControlId, there must be
+ a corresponding element herein.
+ */
+ void SetControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId );
+ void CreateMatcher( const String& rName );
+
+ /** sets the context of the dialog and trigger necessary actions e.g. loading config, setting help id
+ @param _eNewContext
+ New context for the dialog.
+ */
+ void SetContext( Context _eNewContext );
+
+ DECL_LINK( ExecuteSystemFilePicker, void* );
+
+ ErrCode Execute( std::vector<OUString>& rpURLList,
+ SfxItemSet *& rpSet,
+ String& rFilter,
+ const String& rDirPath );
+ ErrCode Execute( SfxItemSet *& rpSet,
+ String& rFilter );
+};
+
+#define SFX2_IMPL_DIALOG_CONFIG 0
+#define SFX2_IMPL_DIALOG_SYSTEM 1
+#define SFX2_IMPL_DIALOG_OOO 2
+
+ErrCode FileOpenDialog_Impl( sal_Int16 nDialogType,
+ sal_Int64 nFlags,
+ const String& rFact,
+ std::vector<OUString>& rpURLList,
+ String& rFilter,
+ SfxItemSet *& rpSet,
+ const String* pPath = NULL,
+ sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG,
+ const String& rStandardDir = OUString(),
+ const ::com::sun::star::uno::Sequence< OUString >& rBlackList = ::com::sun::star::uno::Sequence< OUString >());
+
+
+ErrCode RequestPassword(const SfxFilter* pCurrentFilter, OUString& aURL, SfxItemSet* pSet);
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/frame.hxx b/include/sfx2/frame.hxx
new file mode 100644
index 000000000000..63220cae1325
--- /dev/null
+++ b/include/sfx2/frame.hxx
@@ -0,0 +1,290 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXFRAME_HXX
+#define _SFXFRAME_HXX
+
+#ifndef TF_NEWDESKTOP
+#define TF_NEWDESKTOP 1
+#endif
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+
+namespace com
+{
+ namespace sun
+ {
+ namespace star
+ {
+ namespace awt
+ {
+ class XWindow;
+ }
+ namespace frame
+ {
+ class XFrame;
+ class XFrameLoader;
+ class XController;
+ class XDispatchProviderInterceptor;
+ }
+ namespace beans
+ {
+ struct PropertyValue;
+ }
+ }
+ }
+}
+#include <tools/ref.hxx>
+#include <tools/string.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/poolitem.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <vector>
+
+class SvBorder;
+class SfxWorkWindow;
+class Window;
+class SfxFrame;
+class SfxFrame_Impl;
+class SfxObjectShell;
+class SfxObjectFactory;
+class SfxViewFrame;
+class SfxFrameDescriptor;
+class SfxFrameSetDescriptor;
+class SfxDispatcher;
+class Rectangle;
+class SfxRequest;
+class SfxUnoControllerItem;
+class SvCompatWeakHdl;
+class SystemWindow;
+
+class SfxFrame;
+typedef ::std::vector<SfxFrame*> SfxFrameArr_Impl;
+
+typedef ::std::vector< String* > TargetList;
+
+#define SFXFRAME_HASTITLE 0x0001
+
+//==========================================================================
+// SfxFrame is a management class for windows and their content.
+// A SfxApplication represent a hierarchy of SfxFrames, with which the actual
+// content in the derived classes is defined. The base class SfxFrame
+// implements two aspects of frames: naming and control of its lifespan.
+// Inside a frame hierarchy the parent frame always controls the lifespan of
+// its child frames, even though they usually are not even produced by the
+// parent. By calling DoCloser() on any frame in the hierarchy,
+// a part of the "framework" can be removed, where frames unsubscribe
+// from their parent frames.
+//==========================================================================
+
+class SFX2_DLLPUBLIC SfxFrame
+{
+ friend class SfxFrameIterator;
+ friend class SfxFrameWindow_Impl;
+
+private:
+ SfxFrame* pParentFrame;
+ SfxFrameArr_Impl* pChildArr;
+ SfxFrame_Impl* pImp;
+ Window* pWindow;
+
+protected:
+ sal_Bool Close();
+ virtual ~SfxFrame();
+
+ SAL_DLLPRIVATE void RemoveChildFrame_Impl( SfxFrame* );
+
+ SfxFrame( ); // not implemented
+ SAL_DLLPRIVATE SfxFrame( Window& i_rContainerWindow, bool bHidden );
+
+public:
+ TYPEINFO();
+
+ static SfxFrame* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
+ CreateBlankFrame();
+ static SfxFrame* Create( SfxObjectShell& rDoc, Window& rWindow, sal_uInt16 nViewId, bool bHidden );
+
+ SvCompatWeakHdl* GetHdl();
+ Window& GetWindow() const;
+ void CancelTransfers( sal_Bool bCancelLoadEnv = sal_True );
+ sal_Bool DoClose();
+ sal_uInt16 GetChildFrameCount() const;
+ SfxFrame* GetChildFrame( sal_uInt16 nPos ) const;
+ SfxFrame* GetParentFrame() const
+ { return pParentFrame; }
+
+ void SetPresentationMode( sal_Bool bSet );
+ SystemWindow* GetSystemWindow() const;
+
+ static SfxFrame* GetFirst();
+ static SfxFrame* GetNext( SfxFrame& );
+
+ static const SfxPoolItem*
+ OpenDocumentSynchron( SfxItemSet& aSet, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rTargetFrame );
+
+ SfxObjectShell* GetCurrentDocument() const;
+ SfxViewFrame* GetCurrentViewFrame() const;
+ SfxFrame& GetTopFrame() const;
+ sal_Bool IsParent( SfxFrame* ) const;
+
+ sal_uInt32 GetFrameType() const;
+ void GetTargetList( TargetList& ) const;
+ SAL_DLLPRIVATE SfxFrame* GetContainingDocFrame_Impl( SfxFrame* pSelf );
+ void UpdateDescriptor( SfxObjectShell *pDoc );
+ void Resize();
+ sal_Bool HasComponent() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
+ GetComponent() const;
+ void ReleaseComponent();
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
+ GetFrameInterface() const;
+ void Appear();
+ void AppearWithUpdate();
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
+ GetController() const;
+
+ sal_Bool IsInPlace() const;
+
+ SAL_DLLPRIVATE sal_Bool DoClose_Impl();
+ SAL_DLLPRIVATE void SetFrameInterface_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
+ SAL_DLLPRIVATE void ReleasingComponent_Impl( sal_Bool bSet );
+ SAL_DLLPRIVATE void GetViewData_Impl();
+ SAL_DLLPRIVATE void SetFrameType_Impl( sal_uInt32 );
+ SAL_DLLPRIVATE sal_uInt16 PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing=sal_False );
+ SAL_DLLPRIVATE sal_Bool DocIsModified_Impl();
+ SAL_DLLPRIVATE void SetCurrentViewFrame_Impl( SfxViewFrame* );
+ SAL_DLLPRIVATE sal_Bool IsClosing_Impl() const;
+ SAL_DLLPRIVATE void SetIsClosing_Impl();
+
+ // Methods for accessing the current set
+ SAL_DLLPRIVATE SfxFrameDescriptor* GetDescriptor() const;
+
+ SAL_DLLPRIVATE void Lock_Impl( sal_Bool bLock );
+ SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl() const;
+ SAL_DLLPRIVATE sal_Bool IsAutoLoadLocked_Impl() const;
+
+ SAL_DLLPRIVATE static void InsertTopFrame_Impl( SfxFrame* pFrame );
+ SAL_DLLPRIVATE static void RemoveTopFrame_Impl( SfxFrame* pFrame );
+ SAL_DLLPRIVATE void SetOwnsBindings_Impl( sal_Bool bSet );
+ SAL_DLLPRIVATE sal_Bool OwnsBindings_Impl() const;
+ SAL_DLLPRIVATE void InvalidateUnoControllers_Impl();
+ SAL_DLLPRIVATE void RegisterUnoController_Impl( SfxUnoControllerItem* );
+ SAL_DLLPRIVATE void ReleaseUnoController_Impl( SfxUnoControllerItem* );
+ SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl() const;
+ SAL_DLLPRIVATE void SetToolSpaceBorderPixel_Impl( const SvBorder& );
+ SAL_DLLPRIVATE Rectangle GetTopOuterRectPixel_Impl() const;
+ SAL_DLLPRIVATE void CreateWorkWindow_Impl();
+ SAL_DLLPRIVATE void GrabFocusOnComponent_Impl();
+ SAL_DLLPRIVATE void SetInPlace_Impl( sal_Bool );
+
+ SAL_DLLPRIVATE void PrepareForDoc_Impl( SfxObjectShell& i_rDoc );
+ SAL_DLLPRIVATE void LockResize_Impl( sal_Bool bLock );
+ SAL_DLLPRIVATE void SetMenuBarOn_Impl( sal_Bool bOn );
+ SAL_DLLPRIVATE sal_Bool IsMenuBarOn_Impl() const;
+ SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const;
+ SAL_DLLPRIVATE bool IsMarkedHidden_Impl() const;
+private:
+ SAL_DLLPRIVATE void Construct_Impl();
+};
+
+SV_DECL_COMPAT_WEAK( SfxFrame )
+
+class SfxFrameIterator
+{
+ const SfxFrame* pFrame;
+ sal_Bool bRecursive;
+
+ SfxFrame* NextSibling_Impl( SfxFrame& rPrev );
+
+public:
+ SfxFrameIterator( const SfxFrame& rFrame, sal_Bool bRecursive=sal_True );
+ SfxFrame* FirstFrame();
+ SfxFrame* NextFrame( SfxFrame& rPrev );
+};
+
+//--------------------------------------------------------------------
+
+class SFX2_DLLPUBLIC SfxFrameItem: public SfxPoolItem
+{
+ SfxFrame* pFrame;
+ SfxFrameWeak wFrame;
+ SAL_DLLPRIVATE void SetFramePtr_Impl( SfxFrame* /*pFrameP*/ ) { pFrame = wFrame; }
+
+public:
+ TYPEINFO();
+
+ SfxFrameItem( sal_uInt16 nWhich, SfxViewFrame *p );
+ SfxFrameItem( SfxFrame *p=0 );
+ SfxFrameItem( sal_uInt16 nWhich, SfxFrame *p );
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual String GetValueText() const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ sal_Bool FrameKilled() const { return &wFrame != pFrame; }
+
+ SfxFrame* GetFrame() const
+ { return wFrame; }
+};
+
+class SFX2_DLLPUBLIC SfxUsrAnyItem : public SfxPoolItem
+{
+ ::com::sun::star::uno::Any aValue;
+public:
+ TYPEINFO();
+ SfxUsrAnyItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Any& rAny );
+ ::com::sun::star::uno::Any GetValue() const
+ { return aValue; }
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+class SFX2_DLLPUBLIC SfxUnoFrameItem : public SfxPoolItem
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
+ m_xFrame;
+
+public:
+ TYPEINFO();
+ SfxUnoFrameItem();
+ SfxUnoFrameItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
+ GetFrame() const
+ { return m_xFrame; }
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+typedef SfxUsrAnyItem SfxUnoAnyItem;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/frmdescr.hxx b/include/sfx2/frmdescr.hxx
new file mode 100644
index 000000000000..2c0c178a3795
--- /dev/null
+++ b/include/sfx2/frmdescr.hxx
@@ -0,0 +1,259 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFX_FRMDESCRHXX
+#define _SFX_FRMDESCRHXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <sfx2/sfxsids.hrc>
+#include <svl/poolitem.hxx>
+#include <tools/urlobj.hxx>
+#include <tools/string.hxx>
+#include <tools/gen.hxx>
+
+class SvStream;
+struct SfxFrameDescriptor_Impl;
+class SfxFrameDescriptor;
+class Wallpaper;
+
+//===========================================================================
+// The SfxFrame descriptors build a recursive structure, that covers all the
+// required data in-order to display the frame document.
+// Through a SfxFrameSetDescriptor access is given to the whole underlying
+// structure. Due to the nature of the SfxFrames document, the
+// SfxFramesSetDescriptor is not only the content of this document, but also
+// describes the view on it. The FrameSet is made up of lines, which in turn,
+// contains the actual window . A line can be horizontally or vertically
+// aligned, from which also the alignment of the FrameSet is given.
+//===========================================================================
+
+enum ScrollingMode
+{
+ ScrollingYes,
+ ScrollingNo,
+ ScrollingAuto
+};
+
+enum SizeSelector
+{
+ SIZE_ABS,
+ SIZE_PERCENT,
+ SIZE_REL
+};
+
+#define BORDER_SET 2
+#define BORDER_YES 1
+#define BORDER_NO 0
+#define SPACING_NOT_SET -1L
+#define SIZE_NOT_SET -1L
+
+class SfxItemSet;
+struct SfxFrameProperties;
+
+class SFX2_DLLPUBLIC SfxFrameDescriptor
+{
+ INetURLObject aURL;
+ INetURLObject aActualURL;
+ String aName;
+ Size aMargin;
+ long nWidth;
+ ScrollingMode eScroll;
+ SizeSelector eSizeSelector;
+ sal_uInt16 nHasBorder;
+ sal_uInt16 nItemId;
+ sal_Bool bResizeHorizontal;
+ sal_Bool bResizeVertical;
+ sal_Bool bHasUI;
+ sal_Bool bReadOnly;
+ SfxFrameDescriptor_Impl* pImp;
+
+public:
+ SfxFrameDescriptor();
+ ~SfxFrameDescriptor();
+
+ // FileName/URL
+ SfxItemSet* GetArgs();
+ const INetURLObject& GetURL() const
+ { return aURL; }
+ void SetURL( const String& rURL );
+ const INetURLObject& GetActualURL() const
+ { return aActualURL; }
+ void SetActualURL( const INetURLObject& rURL );
+ void SetActualURL( const String& rURL );
+ void SetReadOnly( sal_Bool bSet ) { bReadOnly = bSet;}
+ sal_Bool IsReadOnly( ) const { return bReadOnly;}
+ void SetEditable( sal_Bool bSet );
+ sal_Bool IsEditable() const;
+
+ // Size
+ void SetWidth( long n )
+ { nWidth = n; }
+ void SetWidthPercent( long n )
+ { nWidth = n; eSizeSelector = SIZE_PERCENT; }
+ void SetWidthRel( long n )
+ { nWidth = n; eSizeSelector = SIZE_REL; }
+ void SetWidthAbs( long n )
+ { nWidth = n; eSizeSelector = SIZE_ABS; }
+ long GetWidth() const
+ { return nWidth; }
+ SizeSelector GetSizeSelector() const
+ { return eSizeSelector; }
+ sal_Bool IsResizable() const
+ { return bResizeHorizontal && bResizeVertical; }
+ void SetResizable( sal_Bool bRes )
+ { bResizeHorizontal = bResizeVertical = bRes; }
+
+ // FrameName
+ const String& GetName() const
+ { return aName; }
+ void SetName( const String& rName )
+ { aName = rName; }
+
+ // Margin, Scrolling
+ const Size& GetMargin() const
+ { return aMargin; }
+ void SetMargin( const Size& rMargin )
+ { aMargin = rMargin; }
+ ScrollingMode GetScrollingMode() const
+ { return eScroll; }
+ void SetScrollingMode( ScrollingMode eMode )
+ { eScroll = eMode; }
+
+ // FrameBorder
+ void SetWallpaper( const Wallpaper& rWallpaper );
+ sal_Bool HasFrameBorder() const;
+
+ sal_Bool IsFrameBorderOn() const
+ { return ( nHasBorder & BORDER_YES ) != 0; }
+
+ void SetFrameBorder( sal_Bool bBorder )
+ {
+ nHasBorder = bBorder ?
+ BORDER_YES | BORDER_SET :
+ BORDER_NO | BORDER_SET;
+ }
+ sal_Bool IsFrameBorderSet() const
+ { return (nHasBorder & BORDER_SET) != 0; }
+ void ResetBorder()
+ { nHasBorder = 0; }
+
+ sal_Bool HasUI() const
+ { return bHasUI; }
+ void SetHasUI( sal_Bool bOn )
+ { bHasUI = bOn; }
+
+ // Attribute for Splitwindow
+ sal_uInt16 GetItemId() const
+ { return nItemId; }
+ void SetItemId( sal_uInt16 nId )
+ { nItemId = nId; }
+
+ // Copy for example for Views
+ SfxFrameDescriptor* Clone( sal_Bool bWithIds = sal_True ) const;
+};
+
+// No block to implement a =operator
+struct SfxFrameProperties
+{
+ String aURL;
+ String aName;
+ long lMarginWidth;
+ long lMarginHeight;
+ long lSize;
+ long lSetSize;
+ long lFrameSpacing;
+ long lInheritedFrameSpacing;
+ ScrollingMode eScroll;
+ SizeSelector eSizeSelector;
+ SizeSelector eSetSizeSelector;
+ sal_Bool bHasBorder;
+ sal_Bool bBorderSet;
+ sal_Bool bResizable;
+ sal_Bool bSetResizable;
+ sal_Bool bIsRootSet;
+ sal_Bool bIsInColSet;
+ sal_Bool bHasBorderInherited;
+ SfxFrameDescriptor* pFrame;
+
+private:
+ SfxFrameProperties( SfxFrameProperties& ) {}
+public:
+ SfxFrameProperties()
+ : lMarginWidth( SIZE_NOT_SET ),
+ lMarginHeight( SIZE_NOT_SET ),
+ lSize( 1L ),
+ lSetSize( 1L ),
+ lFrameSpacing( SPACING_NOT_SET ),
+ lInheritedFrameSpacing( SPACING_NOT_SET ),
+ eScroll( ScrollingAuto ),
+ eSizeSelector( SIZE_REL ),
+ eSetSizeSelector( SIZE_REL ),
+ bHasBorder( sal_True ),
+ bBorderSet( sal_True ),
+ bResizable( sal_True ),
+ bSetResizable( sal_True ),
+ bIsRootSet( sal_False ),
+ bIsInColSet( sal_False ),
+ bHasBorderInherited( sal_True ),
+ pFrame( 0 ) {}
+
+ ~SfxFrameProperties() { delete pFrame; }
+
+ int operator ==( const SfxFrameProperties& ) const;
+ SfxFrameProperties& operator =( const SfxFrameProperties &rProp );
+};
+
+class SfxFrameDescriptorItem : public SfxPoolItem
+{
+ SfxFrameProperties aProperties;
+public:
+ TYPEINFO();
+
+ SfxFrameDescriptorItem ( const sal_uInt16 nId = SID_FRAMEDESCRIPTOR )
+ : SfxPoolItem( nId )
+ {}
+
+ SfxFrameDescriptorItem( const SfxFrameDescriptorItem& rCpy )
+ : SfxPoolItem( rCpy )
+ {
+ aProperties = rCpy.aProperties;
+ }
+
+ virtual ~SfxFrameDescriptorItem();
+
+ virtual int operator ==( const SfxPoolItem& ) const;
+ SfxFrameDescriptorItem& operator =( const SfxFrameDescriptorItem & );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+ const SfxFrameProperties& GetProperties() const
+ { return aProperties; }
+ void SetProperties( const SfxFrameProperties& rProp )
+ { aProperties = rProp; }
+};
+
+#endif // #ifndef _SFX_FRMDESCRHXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/frmhtml.hxx b/include/sfx2/frmhtml.hxx
new file mode 100644
index 000000000000..d1eb1c4054c0
--- /dev/null
+++ b/include/sfx2/frmhtml.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 _FRMHTML_HXX
+#define _FRMHTML_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <sfx2/frmdescr.hxx>
+#include <sfx2/sfxhtml.hxx>
+
+class SfxFrameHTMLParser;
+class SfxMedium;
+namespace svtools { class AsynchronLink; }
+
+class SFX2_DLLPUBLIC SfxFrameHTMLParser : public SfxHTMLParser
+{
+protected:
+ SfxFrameHTMLParser( SvStream& rStream, sal_Bool bIsNewDoc=sal_True, SfxMedium *pMediumPtr=0 ):
+ SfxHTMLParser( rStream, bIsNewDoc, pMediumPtr ) {};
+
+public:
+ // These methods can also be used by other parsers.
+ static void ParseFrameOptions(SfxFrameDescriptor*, const HTMLOptions&, const String& );
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/frmhtmlw.hxx b/include/sfx2/frmhtmlw.hxx
new file mode 100644
index 000000000000..3abdfbee3107
--- /dev/null
+++ b/include/sfx2/frmhtmlw.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 _FRMHTMLW_HXX
+#define _FRMHTMLW_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+
+#include <sfx2/frmdescr.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <tools/stream.hxx>
+#include <svtools/parhtml.hxx>
+#include <svtools/htmlout.hxx>
+#include <svtools/htmlkywd.hxx>
+
+class SfxFrame;
+
+namespace com { namespace sun { namespace star {
+ namespace document {
+ class XDocumentProperties;
+ }
+} } }
+
+class SFX2_DLLPUBLIC SfxFrameHTMLWriter
+{
+ SAL_DLLPRIVATE static const sal_Char sNewLine[];
+ SAL_DLLPRIVATE static void OutMeta( SvStream& rStrm,
+ const sal_Char *pIndent, const String& rName,
+ const String& rContent, sal_Bool bHTTPEquiv,
+ rtl_TextEncoding eDestEnc,
+ String *pNonConvertableChars = 0 );
+ SAL_DLLPRIVATE inline static void OutMeta( SvStream& rStrm,
+ const sal_Char *pIndent, const sal_Char *pName,
+ const String& rContent, sal_Bool bHTTPEquiv,
+ rtl_TextEncoding eDestEnc,
+ String *pNonConvertableChars = 0 );
+
+public:
+ static void Out_DocInfo( SvStream& rStrm, const String& rBaseURL,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>&,
+ const sal_Char *pIndent,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+
+ static void Out_FrameDescriptor(
+ SvStream&, const String& rBaseURL, const com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet >& xSet,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+};
+
+inline void SfxFrameHTMLWriter::OutMeta( SvStream& rStrm,
+ const sal_Char *pIndent, const sal_Char *pName,
+ const String& rContent, sal_Bool bHTTPEquiv,
+ rtl_TextEncoding eDestEnc,
+ String *pNonConvertableChars )
+{
+ String sTmp = OUString::createFromAscii(pName);
+ OutMeta( rStrm, pIndent, sTmp, rContent, bHTTPEquiv, eDestEnc, pNonConvertableChars );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/genlink.hxx b/include/sfx2/genlink.hxx
new file mode 100644
index 000000000000..045047d9d0c7
--- /dev/null
+++ b/include/sfx2/genlink.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 _SFXGENLINK_HXX
+#define _SFXGENLINK_HXX
+
+
+#include <tools/link.hxx>
+typedef long (*CFuncPtr)(void*);
+
+class GenLink
+{
+ Link aLink;
+ CFuncPtr pFunc;
+
+public:
+ GenLink(): pFunc(0) {}
+ GenLink( CFuncPtr pCFunc ): pFunc(pCFunc) {}
+ GenLink( const Link& rLink ): aLink(rLink), pFunc(0) {}
+ GenLink( const GenLink& rOrig ):
+ aLink(rOrig.aLink), pFunc(rOrig.pFunc) {}
+
+ GenLink& operator = ( const GenLink& rOrig )
+ { pFunc = rOrig.pFunc; aLink = rOrig.aLink; return *this; }
+
+ sal_Bool operator!() const { return !aLink && !pFunc; }
+ sal_Bool IsSet() const { return aLink.IsSet() || pFunc; }
+
+ long Call( void* pCaller )
+ { return pFunc ? (*pFunc)(pCaller) : aLink.Call(pCaller); }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/hintpost.hxx b/include/sfx2/hintpost.hxx
new file mode 100644
index 000000000000..25adb3ea3d58
--- /dev/null
+++ b/include/sfx2/hintpost.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 _SFXHINTPOST_HXX
+#define _SFXHINTPOST_HXX
+
+#include <sfx2/genlink.hxx>
+#include <tools/ref.hxx>
+
+//===================================================================
+
+class SfxHint;
+
+//-------------------------------------------------------------------
+
+class SfxHintPoster: public SvRefBase
+
+/* [Description]
+
+ With instances of this class unique events per PostUserEvent can be sent
+ using the StarView-application. If the User-Event is triggered often,
+ the handler <Event()> is called, the base implementation with the
+ <SetEventHdl()> line is making these link calls.
+
+ The instance are held via Ref-Count at least as long as a possible sent
+ event has not arrived yet. Should be killed before the goal, before the
+ connection is SetEventHdl (GenLink ()) .
+*/
+
+{
+ GenLink aLink;
+
+private:
+ DECL_LINK( DoEvent_Impl, SfxHint * );
+
+protected:
+ virtual ~SfxHintPoster();
+ virtual void Event( SfxHint* pPostedHint );
+
+public:
+ SfxHintPoster( const GenLink& rLink );
+
+ void Post( SfxHint* pHint = 0 );
+ void SetEventHdl( const GenLink& rLink );
+};
+
+//-------------------------------------------------------------------
+
+SV_DECL_IMPL_REF(SfxHintPoster);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/htmlmode.hxx b/include/sfx2/htmlmode.hxx
new file mode 100644
index 000000000000..0ce8e430869e
--- /dev/null
+++ b/include/sfx2/htmlmode.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 _SFX_HTMLMODE_HXX_
+#define _SFX_HTMLMODE_HXX_
+
+#define HTMLMODE_ON 0x0001
+#define HTMLMODE_PARA_DISTANCE 0x0004
+#define HTMLMODE_SOME_STYLES 0x0020 /* mind. MS IE */
+#define HTMLMODE_FULL_STYLES 0x0040 /* == SW */
+#define HTMLMODE_PARA_BLOCK 0x0100
+#define HTMLMODE_RESERVED1 0x4000
+#define HTMLMODE_RESERVED0 0x8000
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/imagemgr.hxx b/include/sfx2/imagemgr.hxx
new file mode 100644
index 000000000000..92df8e70c573
--- /dev/null
+++ b/include/sfx2/imagemgr.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/frame/XFrame.hpp>
+
+#include <rtl/ustring.hxx>
+#include <vcl/image.hxx>
+
+SFX2_DLLPUBLIC Image SAL_CALL GetImage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ const OUString& aURL,
+ bool bBig
+);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/imgmgr.hxx b/include/sfx2/imgmgr.hxx
new file mode 100644
index 000000000000..7ef278023336
--- /dev/null
+++ b/include/sfx2/imgmgr.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 _SFXIMGMGR_HXX
+#define _SFXIMGMGR_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <sal/types.h>
+#include <vcl/image.hxx>
+
+class ToolBox;
+class SfxModule;
+class SfxImageManager_Impl;
+class SFX2_DLLPUBLIC SfxImageManager
+{
+ SfxImageManager_Impl* pImp;
+
+public:
+ static SfxImageManager* GetImageManager( SfxModule* );
+
+ SfxImageManager( SfxModule* pModule = 0 );
+ ~SfxImageManager();
+
+ void RegisterToolBox( ToolBox *pBox, sal_uInt16 nFlags=0xFFFF);
+ void ReleaseToolBox( ToolBox *pBox );
+
+ Image GetImage( sal_uInt16 nId, bool bLarge ) const;
+ Image GetImage( sal_uInt16 nId) const;
+ Image SeekImage( sal_uInt16 nId, bool bLarge ) const;
+ Image SeekImage( sal_uInt16 nId ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/infobar.hxx b/include/sfx2/infobar.hxx
new file mode 100644
index 000000000000..b91d01ad4927
--- /dev/null
+++ b/include/sfx2/infobar.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/.
+ */
+#ifndef _SFX2_MESSAGEBAR_HXX_
+#define _SFX2_MESSAGEBAR_HXX_
+
+#include <vector>
+
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+
+#include <sfx2/dllapi.h>
+#include <sfx2/childwin.hxx>
+
+/** SfxChildWindow for positioning the InfoBar in the view.
+ */
+class SFX2_DLLPUBLIC SfxInfoBarContainerChild : public SfxChildWindow
+{
+ private:
+ SfxBindings* m_pBindings;
+
+ public:
+ SfxInfoBarContainerChild( Window* pParent,
+ sal_uInt16 nId,
+ SfxBindings* pBindings,
+ SfxChildWinInfo* pInfo );
+ virtual ~SfxInfoBarContainerChild();
+
+ SFX_DECL_CHILDWINDOW_WITHID( SfxInfoBarContainerChild );
+
+ void Update( );
+};
+
+/** Class representing a single InfoBar to be added in a SfxInfoBarContainerWindow.
+ */
+class SfxInfoBarWindow : public Window
+{
+ private:
+ OUString m_sId;
+ FixedText* m_pMessage;
+ Button* m_pCloseBtn;
+ std::vector< PushButton* > m_aActionBtns;
+
+ public:
+ SfxInfoBarWindow( Window* parent, const OUString& sId,
+ const OUString& sMessage,
+ std::vector< PushButton* > aButtons );
+ ~SfxInfoBarWindow( );
+
+ virtual const OUString& getId() const { return m_sId; }
+ virtual void Paint( const Rectangle& );
+ virtual void Resize( );
+
+ private:
+ DECL_LINK( CloseHandler, void* );
+};
+
+class SfxInfoBarContainerWindow : public Window
+{
+ private:
+ SfxInfoBarContainerChild* m_pChildWin;
+ std::vector< SfxInfoBarWindow* > m_pInfoBars;
+
+ public:
+ SfxInfoBarContainerWindow( SfxInfoBarContainerChild* pChildWin );
+ ~SfxInfoBarContainerWindow( );
+
+ void appendInfoBar( const OUString& sId, const OUString& sMessage, std::vector< PushButton* > aButtons );
+ SfxInfoBarWindow* getInfoBar( const OUString& sId );
+ void removeInfoBar( SfxInfoBarWindow* pInfoBar );
+
+ virtual void Resize( );
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/ipclient.hxx b/include/sfx2/ipclient.hxx
new file mode 100644
index 000000000000..e97b628d4b1a
--- /dev/null
+++ b/include/sfx2/ipclient.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 _SFX_IPCLIENT_HXX
+#define _SFX_IPCLIENT_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/embed/Aspects.hpp>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+
+#include <tools/gen.hxx>
+
+#include <sfx2/objsh.hxx>
+
+class SfxInPlaceClient_Impl;
+class SfxViewShell;
+class SfxObjectShell;
+class Window;
+class Fraction;
+
+//=========================================================================
+
+class SFX2_DLLPUBLIC SfxInPlaceClient
+{
+friend class SfxInPlaceClient_Impl;
+
+ SfxInPlaceClient_Impl* m_pImp;
+ SfxViewShell* m_pViewSh;
+ Window* m_pEditWin;
+
+ // called after the requested new object area was negotiated
+ SAL_DLLPRIVATE virtual void ObjectAreaChanged();
+
+ // an active object was resized by the user and now asks for the new space
+ SAL_DLLPRIVATE virtual void RequestNewObjectArea( Rectangle& );
+
+ // notify the client that an active object has changed its VisualAreaSize
+ SAL_DLLPRIVATE virtual void ViewChanged();
+
+ // an object wants to become visible
+ SAL_DLLPRIVATE virtual void MakeVisible();
+
+public:
+ SfxInPlaceClient( SfxViewShell* pViewShell, Window* pDraw, sal_Int64 nAspect = com::sun::star::embed::Aspects::MSOLE_CONTENT );
+ virtual ~SfxInPlaceClient();
+
+ SfxViewShell* GetViewShell() const { return m_pViewSh; }
+ Window* GetEditWin() const { return m_pEditWin; }
+ com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObject() const;
+ void SetObject( const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& rObject );
+ void SetObjectState( sal_Int32 );
+ Size GetObjectVisAreaSize() const;
+ sal_Bool IsObjectUIActive() const;
+ sal_Bool IsObjectInPlaceActive() const;
+ void DeactivateObject();
+ sal_Bool SetObjArea( const Rectangle & );
+ Rectangle GetObjArea() const;
+ Rectangle GetScaledObjArea() const;
+ void SetSizeScale( const Fraction & rScaleWidth, const Fraction & rScaleHeight );
+ sal_Bool SetObjAreaAndScale( const Rectangle&, const Fraction&, const Fraction& );
+ const Fraction& GetScaleWidth() const;
+ const Fraction& GetScaleHeight() const;
+ void Invalidate();
+ static SfxInPlaceClient* GetClient( SfxObjectShell* pDoc, const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObject );
+ sal_Int64 GetAspect() const;
+ sal_Int64 GetObjectMiscStatus() const;
+ ErrCode DoVerb( long nVerb );
+ void VisAreaChanged();
+ void ResetObject();
+ sal_Bool IsUIActive();
+
+ virtual void FormatChanged(); // object format was changed (used for StarMath formulas aligning)
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/itemconnect.hxx b/include/sfx2/itemconnect.hxx
new file mode 100644
index 000000000000..95a545e3dad4
--- /dev/null
+++ b/include/sfx2/itemconnect.hxx
@@ -0,0 +1,578 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SFX_ITEMCONNECT_HXX
+#define SFX_ITEMCONNECT_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <memory>
+#include <sfx2/itemwrapper.hxx>
+#include <sfx2/controlwrapper.hxx>
+
+// ============================================================================
+
+namespace sfx {
+
+// ============================================================================
+
+typedef int ItemConnFlags;
+
+/** No special state for the connection. */
+const ItemConnFlags ITEMCONN_NONE = 0x0000;
+
+/** Connection is inactive - virtual functions will not be called. */
+const ItemConnFlags ITEMCONN_INACTIVE = 0x0001;
+
+/** Enable control(s), if the item is known. */
+const ItemConnFlags ITEMCONN_ENABLE_KNOWN = 0x0010;
+/** Disable control(s), if the item is unknown. */
+const ItemConnFlags ITEMCONN_DISABLE_UNKNOWN = 0x0020;
+/** Show control(s), if the item is known. */
+const ItemConnFlags ITEMCONN_SHOW_KNOWN = 0x0040;
+/** Hide control(s), if the item is unknown. */
+const ItemConnFlags ITEMCONN_HIDE_UNKNOWN = 0x0080;
+
+/** Default value for constructors. */
+const ItemConnFlags ITEMCONN_DEFAULT = ITEMCONN_NONE;
+
+// ============================================================================
+// Base connection classes
+// ============================================================================
+
+/** A helper for SfxTabPages to connect controls to items.
+
+ This is the base class of all control connection classes. Their purpose is
+ to connect one or more controls from an SfxTabPage with an item from an
+ item set. The goal is to omit any additional code in the virtual functions
+ Reset() and FillItemSet() in classes derived from SfxTabPage.
+
+ Examples of connections:
+ - A check box with an SfxBoolItem,
+ - A metric (spin) field with an SfxInt32Item.
+ - A group of radio buttons with an SfxEnumItem.
+
+ Each SfxTabPage will contain a list of connection objects (derived from
+ this class). The connection objects remember the item and control(s) they
+ have to work on. The SfxTabPage will call the DoApplyFlags(), DoReset(),
+ and DoFillItemSet() functions of all connection objects it knows. The code
+ to initialize control(s) from the item value and fill the item from
+ control(s) has to be written only once for each control type.
+
+ Additional flags passed in the constructor allow to control the behaviour
+ of the control(s) if the item is supported/unsupported in the currently
+ used item set. For example, it is possible to specify that a control will
+ be disabled or hidden if the item is not supported. This is done before
+ each call of Reset().
+
+ The special flag ITEMCONN_CLONE_ITEM controls how to create new items in
+ the DoFillItemSet() function. The standard (and faster) method is to create
+ a temporary item on the stack and put it into the item set. But this does
+ not work if the item set expects a special item type derived from a common
+ item class, i.e. a Boolean item derived from SfxBoolItem providing special
+ item representation text. As this code does not know the item type, the
+ item cannot be created on the stack. For this case the flag specifies to
+ use the virtual Clone() method of the pool default item. This will create
+ an item of the correct type but can still be used in conjunction with i.e.
+ the standard BoolItemWrapper.
+
+ How to use the item connection feature:
+
+ A) Single item <-> single control connection
+
+ Example: An SfxBoolItem and a check box.
+
+ A1) Create a new item wrapper class derived from the SingleItemWrapper
+ template, or use the template directly, or use one of the
+ predefined item wrappers. See documentation of the
+ SingleItemWrapper template for details (itemwrapper.hxx).
+ A2) Create a new control wrapper class derived from the
+ SingleControlWrapper template and implement the abstract functions,
+ or use one of the predefined control wrappers. See documentation of
+ the SingleControlWrapper template for details (controlwrapper.hxx).
+ A3) Create a new connection class derived from one of the following
+ base classes, and implement the abstract functions, or use the
+ ItemControlConnection template directly, or use one of the
+ predefined connections.
+ A4) Create connection objects in the constructor of the tab page, and
+ insert them into the tab page with SfxTabPage::AddItemConnection().
+ A5) Remove old code from the tab page's Reset() and FillItemSet()
+ functions, if necessary.
+
+ B) Single item <-> multiple controls connections
+
+ B1) See step A1. If the item contains multiple values (and not a
+ structure that contains all the values for the different controls),
+ the best way is to use the IdentItemWrapper template, that works
+ with the item itself. This way it is possible to provide a 'data
+ type' that contains the values for all controls.
+ B2) Create a new control wrapper class derived from the
+ MultiControlWrapper template. Add single control wrapper members
+ for all controls to this class and register them in the
+ constructor, using the RegisterControlWrapper() function. Implement
+ the abstract functions GetControlValue() and SetControlValue().
+ These functions should call the respective functions of the own
+ single control wrappers and either fill a new data object (the item
+ itself in most cases, see step B1) with all the values from the
+ controls, or fill all the controls from the data object.
+ B3) Create a new connection class derived from ItemControlConnection,
+ or use the ItemControlConnection template directly. The multiple
+ control wrapper from step B2 acts like a single control, therefore
+ it is possible to use the ItemControlConnection.
+ B4) See steps A4 and A5.
+
+ C) Multiple items <-> single control connections
+
+ todo
+
+ D) Multiple items <-> multiple controls connections
+
+ todo
+
+ The current tree of base classes/templates and standard connections:
+
+ ItemConnectionBase
+ |
+ +- DummyItemConnection [1]
+ |
+ +- ItemControlConnection< ItemWrpT, ControlWrpT >
+ | |
+ | +- CheckBoxConnection [1]
+ | |
+ | +- NumericConnection< ItemWrpT > [1]
+ | | |
+ | | +- [ValueType]NumericConnection [1] [2]
+ | |
+ | +- MetricConnection< ItemWrpT > [1]
+ | | |
+ | | +- [ValueType]MetricConnection [1] [2]
+ | |
+ | +- ListBoxConnection< ItemWrpT > [1]
+ | | |
+ | | +- [ValueType]ListBoxConnection [1] [2]
+ | |
+ | +- ValueSetConnection< ItemWrpT > [1]
+ | |
+ | +- [ValueType]ValueSetConnection [1] [2]
+ |
+ +- ItemConnectionArray [1]
+
+ Notes:
+ [1] Standard connections ready to use.
+ [2] [ValueType] is one of Int16, UInt16, Int32, UInt32.
+ */
+class SFX2_DLLPUBLIC ItemConnectionBase
+{
+public:
+ virtual ~ItemConnectionBase();
+
+ /** Returns the flags passed in the constructor. */
+ inline ItemConnFlags GetFlags() const { return mnFlags; }
+
+ /** Returns true if this connection is active. */
+ bool IsActive() const;
+
+ /** Calls the virtual ApplyFlags() function, if connection is active. */
+ void DoApplyFlags( const SfxItemSet& rItemSet );
+ /** Calls the virtual Reset() function, if connection is active. */
+ void DoReset( const SfxItemSet& rItemSet );
+ /** Calls the virtual FillItemSet() function, if connection is active. */
+ bool DoFillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet );
+
+protected:
+ explicit ItemConnectionBase( ItemConnFlags nFlags = ITEMCONN_DEFAULT );
+
+ /** Derived classes implement actions according to current flags here. */
+ virtual void ApplyFlags( const SfxItemSet& rItemSet ) = 0;
+ /** Derived classes implement initializing controls from item sets here. */
+ virtual void Reset( const SfxItemSet& rItemSet ) = 0;
+ /** Derived classes implement filling item sets from controls here. */
+ virtual bool FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet ) = 0;
+
+ /** Returns whether to enable a control, according to current flags. */
+ TriState GetEnableState( bool bKnown ) const;
+ /** Returns whether to show a control, according to current flags. */
+ TriState GetShowState( bool bKnown ) const;
+
+private:
+ /* Disable copy c'tor and assignment. */
+ ItemConnectionBase( const ItemConnectionBase& );
+ ItemConnectionBase& operator=( const ItemConnectionBase& );
+
+ ItemConnFlags mnFlags; /// Flags for additional options.
+};
+
+// ----------------------------------------------------------------------------
+
+/** Base class template for single item <-> single control connection objects.
+
+ This template uses functions provided by the SingleItemWrapper and the
+ SingleControlWrapper template classes. The virtual functions ApplyFlags(),
+ Reset(), and FillItemSet() are implemented here in a generic way using the
+ virtual functions of the wrapper classes. Derived classes only have to
+ create or otherwise provide appropriate wrappers.
+ */
+template< typename ItemWrpT, typename ControlWrpT >
+class ItemControlConnection : public ItemConnectionBase
+{
+public:
+ typedef ItemWrpT ItemWrapperType;
+ typedef ControlWrpT ControlWrapperType;
+ typedef ItemControlConnection< ItemWrpT, ControlWrpT > ItemControlConnectionType;
+ typedef typename ItemWrpT::ItemType ItemType;
+ typedef typename ItemWrpT::ItemValueType ItemValueType;
+ typedef typename ControlWrpT::ControlType ControlType;
+ typedef typename ControlWrpT::ControlValueType ControlValueType;
+
+ typedef std::auto_ptr< ItemWrpT > ItemWrapperRef;
+ typedef std::auto_ptr< ControlWrpT > ControlWrapperRef;
+
+ /** Receives pointer to a newly created control wrapper.
+ @descr Takes ownership of the control wrapper. */
+ explicit ItemControlConnection( sal_uInt16 nSlot, ControlWrpT* pNewCtrlWrp,
+ ItemConnFlags nFlags = ITEMCONN_DEFAULT );
+
+ /** Convenience constructor. Receives reference to a control directly.
+ @descr May only be used, if ControlWrpT::ControlWrpT( ControlType& )
+ constructor exists. */
+ explicit ItemControlConnection( sal_uInt16 nSlot, ControlType& rControl,
+ ItemConnFlags nFlags = ITEMCONN_DEFAULT );
+
+ virtual ~ItemControlConnection();
+
+protected:
+ /** Actions according to current flags for the control. */
+ virtual void ApplyFlags( const SfxItemSet& rItemSet );
+ /** Resets the control according to the item contents. */
+ virtual void Reset( const SfxItemSet& rItemSet );
+ /** Fills the item set according to the control's state. */
+ virtual bool FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet );
+
+ ItemWrapperType maItemWrp;
+ ControlWrapperRef mxCtrlWrp;
+};
+
+// ============================================================================
+// Standard connections
+// ============================================================================
+
+/** This is a helper class to enable/disable/show/hide a control only.
+
+ This class does nothing special in the Reset() and FillItemSet() functions.
+ It can be used to control the visibility of i.e. fixed lines or fixed texts
+ related to the availability of an item by passing the appropriate flags to
+ the constructor of this connection.
+ */
+class SFX2_DLLPUBLIC DummyItemConnection:
+ public ItemConnectionBase, public DummyWindowWrapper
+{
+public:
+ explicit DummyItemConnection( sal_uInt16 nSlot, Window& rWindow,
+ ItemConnFlags nFlags = ITEMCONN_DEFAULT );
+
+protected:
+ virtual void ApplyFlags( const SfxItemSet& rItemSet );
+ virtual void Reset( const SfxItemSet& rItemSet );
+ virtual bool FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet );
+
+private:
+ sal_uInt16 mnSlot;
+};
+
+// ----------------------------------------------------------------------------
+
+/** Connection between an SfxBoolItem and a VCL CheckBox. */
+typedef ItemControlConnection< BoolItemWrapper, CheckBoxWrapper > CheckBoxConnection;
+
+// ============================================================================
+
+/** Connection between an item and the VCL NumericField. */
+template< typename ItemWrpT >
+class NumericConnection : public ItemControlConnection< ItemWrpT,
+ NumericFieldWrapper< typename ItemWrpT::ItemValueType > >
+{
+ typedef ItemControlConnection< ItemWrpT,
+ NumericFieldWrapper< typename ItemWrpT::ItemValueType > >
+ ItemControlConnectionType;
+
+public:
+ typedef typename ItemControlConnectionType::ControlWrapperType NumericFieldWrapperType;
+
+ explicit NumericConnection( sal_uInt16 nSlot, NumericField& rField,
+ ItemConnFlags nFlags = ITEMCONN_DEFAULT );
+};
+
+// ----------------------------------------------------------------------------
+
+typedef NumericConnection< Int16ItemWrapper > Int16NumericConnection;
+typedef NumericConnection< UInt16ItemWrapper > UInt16NumericConnection;
+typedef NumericConnection< Int32ItemWrapper > Int32NumericConnection;
+typedef NumericConnection< UInt32ItemWrapper > UInt32NumericConnection;
+
+// ============================================================================
+
+/** Connection between an item and the VCL MetricField.
+
+ Adds support of different field units during control value <-> item value
+ conversion. The field unit passed to the constructor applies for the item
+ values, while the field unit used in the control has to be set at the
+ control itself.
+ */
+template< typename ItemWrpT >
+class MetricConnection : public ItemControlConnection< ItemWrpT,
+ MetricFieldWrapper< typename ItemWrpT::ItemValueType > >
+{
+ typedef ItemControlConnection< ItemWrpT,
+ MetricFieldWrapper< typename ItemWrpT::ItemValueType > >
+ ItemControlConnectionType;
+
+public:
+ typedef typename ItemControlConnectionType::ControlWrapperType MetricFieldWrapperType;
+
+ explicit MetricConnection( sal_uInt16 nSlot, MetricField& rField,
+ FieldUnit eItemUnit = FUNIT_NONE, ItemConnFlags nFlags = ITEMCONN_DEFAULT );
+};
+
+// ----------------------------------------------------------------------------
+
+typedef MetricConnection< Int16ItemWrapper > Int16MetricConnection;
+typedef MetricConnection< UInt16ItemWrapper > UInt16MetricConnection;
+typedef MetricConnection< Int32ItemWrapper > Int32MetricConnection;
+typedef MetricConnection< UInt32ItemWrapper > UInt32MetricConnection;
+
+// ============================================================================
+
+/** Connection between an item and a VCL ListBox.
+
+ Optionally a map can be passed that maps list box positions to item values.
+ This map MUST be terminated with an entry containing LISTBOX_ENTRY_NOTFOUND
+ as list box position. The item value contained in this last entry is used
+ as default item value in case of an error.
+ */
+template< typename ItemWrpT >
+class ListBoxConnection : public ItemControlConnection< ItemWrpT,
+ ListBoxWrapper< typename ItemWrpT::ItemValueType > >
+{
+ typedef ItemControlConnection< ItemWrpT,
+ ListBoxWrapper< typename ItemWrpT::ItemValueType > >
+ ItemControlConnectionType;
+
+public:
+ typedef typename ItemControlConnectionType::ControlWrapperType ListBoxWrapperType;
+ typedef typename ListBoxWrapperType::MapEntryType MapEntryType;
+
+ explicit ListBoxConnection( sal_uInt16 nSlot, ListBox& rListBox,
+ const MapEntryType* pMap = 0, ItemConnFlags nFlags = ITEMCONN_DEFAULT );
+};
+
+// ----------------------------------------------------------------------------
+
+typedef ListBoxConnection< Int16ItemWrapper > Int16ListBoxConnection;
+typedef ListBoxConnection< UInt16ItemWrapper > UInt16ListBoxConnection;
+typedef ListBoxConnection< Int32ItemWrapper > Int32ListBoxConnection;
+typedef ListBoxConnection< UInt32ItemWrapper > UInt32ListBoxConnection;
+
+// ============================================================================
+
+/** Connection between an item and an SVTOOLS ValueSet.
+
+ Optionally a map can be passed that maps value set identifiers to item
+ values. This map MUST be terminated with an entry containing
+ VALUESET_ITEM_NOTFOUND as value set identifier. The item value contained in
+ this last entry is used as default item value in case of an error.
+ */
+template< typename ItemWrpT >
+class ValueSetConnection : public ItemControlConnection< ItemWrpT,
+ ValueSetWrapper< typename ItemWrpT::ItemValueType > >
+{
+ typedef ItemControlConnection< ItemWrpT,
+ ValueSetWrapper< typename ItemWrpT::ItemValueType > >
+ ItemControlConnectionType;
+
+public:
+ typedef typename ItemControlConnectionType::ControlWrapperType ValueSetWrapperType;
+ typedef typename ValueSetWrapperType::MapEntryType MapEntryType;
+
+ explicit ValueSetConnection( sal_uInt16 nSlot, ValueSet& rValueSet,
+ const MapEntryType* pMap = 0, ItemConnFlags nFlags = ITEMCONN_DEFAULT );
+};
+
+// ----------------------------------------------------------------------------
+
+typedef ValueSetConnection< Int16ItemWrapper > Int16ValueSetConnection;
+typedef ValueSetConnection< UInt16ItemWrapper > UInt16ValueSetConnection;
+typedef ValueSetConnection< Int32ItemWrapper > Int32ValueSetConnection;
+typedef ValueSetConnection< UInt32ItemWrapper > UInt32ValueSetConnection;
+
+// ============================================================================
+// Array of connections
+// ============================================================================
+
+class ItemConnectionArrayImpl;
+
+/** A container of connection objects.
+
+ This is a connection with the only purpose to contain other connection
+ objects. This way it is possible to create a tree structure of connections
+ for a convenient connection management. This class is used by the class
+ SfxTabPage to store all connections.
+ */
+class ItemConnectionArray : public ItemConnectionBase
+{
+public:
+ explicit ItemConnectionArray();
+ virtual ~ItemConnectionArray();
+
+ /** Adds a new connection to the list.
+ @descr Takes ownership of the connection! */
+ void AddConnection( ItemConnectionBase* pConnection );
+
+protected:
+ virtual void ApplyFlags( const SfxItemSet& rItemSet );
+ virtual void Reset( const SfxItemSet& rItemSet );
+ virtual bool FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet );
+
+private:
+ std::auto_ptr< ItemConnectionArrayImpl > mxImpl;
+};
+
+// ============================================================================
+
+// ============================================================================
+// *** Implementation of template functions ***
+// ============================================================================
+
+// ============================================================================
+// Base connection classes
+// ============================================================================
+
+template< typename ItemWrpT, typename ControlWrpT >
+ItemControlConnection< ItemWrpT, ControlWrpT >::ItemControlConnection(
+ sal_uInt16 nSlot, ControlWrpT* pNewCtrlWrp, ItemConnFlags nFlags ) :
+ ItemConnectionBase( nFlags ),
+ maItemWrp( nSlot ),
+ mxCtrlWrp( pNewCtrlWrp )
+{
+}
+
+template< typename ItemWrpT, typename ControlWrpT >
+ItemControlConnection< ItemWrpT, ControlWrpT >::ItemControlConnection(
+ sal_uInt16 nSlot, ControlType& rControl, ItemConnFlags nFlags ) :
+ ItemConnectionBase( nFlags ),
+ maItemWrp( nSlot ),
+ mxCtrlWrp( new ControlWrpT( rControl ) )
+{
+}
+
+template< typename ItemWrpT, typename ControlWrpT >
+ItemControlConnection< ItemWrpT, ControlWrpT >::~ItemControlConnection()
+{
+}
+
+template< typename ItemWrpT, typename ControlWrpT >
+void ItemControlConnection< ItemWrpT, ControlWrpT >::ApplyFlags( const SfxItemSet& rItemSet )
+{
+ bool bKnown = ItemWrapperHelper::IsKnownItem( rItemSet, maItemWrp.GetSlotId() );
+ mxCtrlWrp->ModifyControl( GetEnableState( bKnown ), GetShowState( bKnown ) );
+}
+
+template< typename ItemWrpT, typename ControlWrpT >
+void ItemControlConnection< ItemWrpT, ControlWrpT >::Reset( const SfxItemSet& rItemSet )
+{
+ const ItemType* pItem = maItemWrp.GetUniqueItem( rItemSet );
+ mxCtrlWrp->SetControlDontKnow( pItem == 0 );
+ if( pItem )
+ mxCtrlWrp->SetControlValue( maItemWrp.GetItemValue( *pItem ) );
+}
+
+template< typename ItemWrpT, typename ControlWrpT >
+bool ItemControlConnection< ItemWrpT, ControlWrpT >::FillItemSet(
+ SfxItemSet& rDestSet, const SfxItemSet& rOldSet )
+{
+ const ItemType* pOldItem = maItemWrp.GetUniqueItem( rOldSet );
+ bool bChanged = false;
+ if( !mxCtrlWrp->IsControlDontKnow() )
+ {
+ // first store the control value in a local variable
+ ControlValueType aCtrlValue( mxCtrlWrp->GetControlValue() );
+ // convert to item value type -> possible to convert i.e. from 'T' to 'const T&'
+ ItemValueType aNewValue( aCtrlValue );
+ // do not rely on existence of ItemValueType::operator!=
+ if( !pOldItem || !(maItemWrp.GetItemValue( *pOldItem ) == aNewValue) )
+ {
+ sal_uInt16 nWhich = ItemWrapperHelper::GetWhichId( rDestSet, maItemWrp.GetSlotId() );
+ std::auto_ptr< ItemType > xItem(
+ static_cast< ItemType* >( maItemWrp.GetDefaultItem( rDestSet ).Clone() ) );
+ xItem->SetWhich( nWhich );
+ maItemWrp.SetItemValue( *xItem, aNewValue );
+ rDestSet.Put( *xItem );
+ bChanged = true;
+ }
+ }
+ if( !bChanged )
+ ItemWrapperHelper::RemoveDefaultItem( rDestSet, rOldSet, maItemWrp.GetSlotId() );
+ return bChanged;
+}
+
+// ============================================================================
+// Standard connections
+// ============================================================================
+
+template< typename ItemWrpT >
+NumericConnection< ItemWrpT >::NumericConnection(
+ sal_uInt16 nSlot, NumericField& rField, ItemConnFlags nFlags ) :
+ ItemControlConnectionType( nSlot, rField, nFlags )
+{
+}
+
+// ============================================================================
+
+template< typename ItemWrpT >
+MetricConnection< ItemWrpT >::MetricConnection(
+ sal_uInt16 nSlot, MetricField& rField, FieldUnit eItemUnit, ItemConnFlags nFlags ) :
+ ItemControlConnectionType( nSlot, new MetricFieldWrapperType( rField, eItemUnit ), nFlags )
+{
+}
+
+// ============================================================================
+
+template< typename ItemWrpT >
+ListBoxConnection< ItemWrpT >::ListBoxConnection(
+ sal_uInt16 nSlot, ListBox& rListBox, const MapEntryType* pMap, ItemConnFlags nFlags ) :
+ ItemControlConnectionType( nSlot, new ListBoxWrapperType( rListBox, pMap ), nFlags )
+{
+}
+
+// ============================================================================
+
+template< typename ItemWrpT >
+ValueSetConnection< ItemWrpT >::ValueSetConnection(
+ sal_uInt16 nSlot, ValueSet& rValueSet, const MapEntryType* pMap, ItemConnFlags nFlags ) :
+ ItemControlConnectionType( nSlot, new ValueSetWrapperType( rValueSet, pMap ), nFlags )
+{
+}
+
+// ============================================================================
+
+} // namespace sfx
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/itemwrapper.hxx b/include/sfx2/itemwrapper.hxx
new file mode 100644
index 000000000000..7143fadf092f
--- /dev/null
+++ b/include/sfx2/itemwrapper.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 SFX_ITEMWRAPPER_HXX
+#define SFX_ITEMWRAPPER_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <svl/eitem.hxx>
+#include <svl/stritem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/itemset.hxx>
+
+// ============================================================================
+
+namespace sfx {
+
+// ============================================================================
+// Helpers
+// ============================================================================
+
+class SFX2_DLLPUBLIC ItemWrapperHelper
+{
+public:
+ /** Returns the WID of the passed SID in the item set. */
+ static sal_uInt16 GetWhichId( const SfxItemSet& rItemSet, sal_uInt16 nSlot );
+
+ /** Returns true, if the passed item set supports the SID. */
+ static bool IsKnownItem( const SfxItemSet& rItemSet, sal_uInt16 nSlot );
+
+ /** Returns an item from an item set, if it is not in "don't know" state.
+ @return Pointer to item, or 0 if it has "don't know" state. */
+ static const SfxPoolItem* GetUniqueItem( const SfxItemSet& rItemSet, sal_uInt16 nSlot );
+
+ /** Returns the default item from the pool of the passed item set. */
+ static const SfxPoolItem& GetDefaultItem( const SfxItemSet& rItemSet, sal_uInt16 nSlot );
+
+ /** Removes an item from rDestSet, if it is default in rOldSet. */
+ static void RemoveDefaultItem( SfxItemSet& rDestSet, const SfxItemSet& rOldSet, sal_uInt16 nSlot );
+};
+
+// ============================================================================
+// Item wrappers
+// ============================================================================
+
+/** Base class wrapping a single item.
+
+ Objects of this class store the SID of an item. Exchanging data with the
+ item is done with the virtual functions GetItemValue() and SetItemValue().
+ Derived classes implement these functions according to the item type they
+ work on.
+
+ The current tree of base classes/templates and standard item wrappers:
+
+ SingleItemWrapper< ItemT, ValueT >
+ |
+ +- ValueItemWrapper< ItemT, ValueT > [1]
+ | |
+ | +- BoolItemWrapper [1]
+ | +- Int16ItemWrapper [1]
+ | +- UInt16ItemWrapper [1]
+ | +- Int32ItemWrapper [1]
+ | +- UInt32ItemWrapper [1]
+ | +- StringItemWrapper [1]
+ |
+ +- IdentItemWrapper< ItemT > [1]
+
+ Notes:
+ [1] Standard wrappers ready to use.
+
+ See documentation of class ItemConnectionBase for more details.
+ */
+template< typename ItemT, typename ValueT >
+class SingleItemWrapper
+{
+public:
+ typedef ItemT ItemType;
+ typedef ValueT ItemValueType;
+ typedef SingleItemWrapper< ItemT, ValueT > SingleItemWrapperType;
+
+ inline explicit SingleItemWrapper( sal_uInt16 nSlot ) : mnSlot( nSlot ) {}
+
+ virtual ~SingleItemWrapper() {}
+
+ /** Returns the SID this wrapper works on. */
+ inline sal_uInt16 GetSlotId() const { return mnSlot; }
+
+ /** Returns the item from an item set, if it is not in "don't know" state.
+ @descr Similar to ItemWrapperHelper::GetUniqueItem(), but works always
+ with the own SID and returns the correct item type.
+ @return Pointer to item, or 0 if it has "don't know" state. */
+ const ItemT* GetUniqueItem( const SfxItemSet& rItemSet ) const;
+ /** Returns the default item from the pool of the passed item set.
+ @descr Similar to ItemWrapperHelper::GetDefaultItem(), but works
+ always with the own SID and returns the correct item type. */
+ const ItemT& GetDefaultItem( const SfxItemSet& rItemSet ) const;
+
+ /** Derived classes return the value of the passed item. */
+ virtual ValueT GetItemValue( const ItemT& rItem ) const = 0;
+ /** Derived classes set the value at the passed item. */
+ virtual void SetItemValue( ItemT& rItem, ValueT aValue ) const = 0;
+
+private:
+ sal_uInt16 mnSlot; /// The SID of this item wrapper.
+};
+
+// ============================================================================
+
+/** An item wrapper usable for most types of items.
+
+ The item type must support the following functions:
+ - ValueT ItemT::GetValue() const
+ - void ItemT::SetValue( ValueT )
+
+ The template parameter InternalValueT can be used to specify the internal
+ value type of the item, if it differs from ValueT. This parameter has to be
+ used to prevent compiler warnings.
+ */
+template< typename ItemT, typename ValueT, typename InternalValueT = ValueT >
+class ValueItemWrapper : public SingleItemWrapper< ItemT, ValueT >
+{
+public:
+ inline explicit ValueItemWrapper( sal_uInt16 nSlot ) :
+ SingleItemWrapper< ItemT, ValueT >( nSlot ) {}
+
+ virtual ~ValueItemWrapper() {}
+
+ virtual ValueT GetItemValue( const ItemT& rItem ) const
+ { return static_cast< ValueT >( rItem.GetValue() ); }
+ virtual void SetItemValue( ItemT& rItem, ValueT aValue ) const
+ { rItem.SetValue( static_cast< InternalValueT >( aValue ) ); }
+};
+
+// ----------------------------------------------------------------------------
+
+typedef ValueItemWrapper< SfxBoolItem, sal_Bool > BoolItemWrapper;
+typedef ValueItemWrapper< SfxInt16Item, sal_Int16 > Int16ItemWrapper;
+typedef ValueItemWrapper< SfxUInt16Item, sal_uInt16 > UInt16ItemWrapper;
+typedef ValueItemWrapper< SfxInt32Item, sal_Int32 > Int32ItemWrapper;
+typedef ValueItemWrapper< SfxUInt32Item, sal_uInt32 > UInt32ItemWrapper;
+typedef ValueItemWrapper< SfxStringItem, const String& > StringItemWrapper;
+
+// ============================================================================
+
+/** An item wrapper that uses the item itself as value. */
+template< typename ItemT >
+class IdentItemWrapper : public SingleItemWrapper< ItemT, const ItemT& >
+{
+public:
+ inline explicit IdentItemWrapper( sal_uInt16 nSlot ) :
+ SingleItemWrapper< ItemT, const ItemT& >( nSlot ) {}
+
+ virtual ~IdentItemWrapper() {}
+
+ virtual const ItemT& GetItemValue( const ItemT& rItem ) const
+ { return rItem; }
+ virtual void SetItemValue( ItemT& rItem, const ItemT& rValue ) const
+ { rItem = rValue; }
+};
+
+// ============================================================================
+
+
+// ============================================================================
+// *** Implementation of template functions ***
+// ============================================================================
+
+// ============================================================================
+// Item wrappers
+// ============================================================================
+
+template< typename ItemT, typename ValueT >
+const ItemT* SingleItemWrapper< ItemT, ValueT >::GetUniqueItem( const SfxItemSet& rItemSet ) const
+{
+ return static_cast< const ItemT* >( ItemWrapperHelper::GetUniqueItem( rItemSet, mnSlot ) );
+}
+
+template< typename ItemT, typename ValueT >
+const ItemT& SingleItemWrapper< ItemT, ValueT >::GetDefaultItem( const SfxItemSet& rItemSet ) const
+{
+ return static_cast< const ItemT& >( ItemWrapperHelper::GetDefaultItem( rItemSet, mnSlot ) );
+}
+
+// ============================================================================
+
+} // namespace sfx
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/linkmgr.hxx b/include/sfx2/linkmgr.hxx
new file mode 100644
index 000000000000..24a5f6315edb
--- /dev/null
+++ b/include/sfx2/linkmgr.hxx
@@ -0,0 +1,195 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _LINKMGR_HXX
+#define _LINKMGR_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <sfx2/linksrc.hxx>
+#include <tools/string.hxx>
+
+#include <vector>
+#include <set>
+
+class SfxObjectShell;
+class Graphic;
+class Size;
+
+namespace com { namespace sun { namespace star {
+ namespace lang {
+ class XComponent;
+ }
+}}}
+
+namespace sfx2
+{
+ // For the link to receive information about the status of graphics that
+ // will be loaded the FileObject sends a SvData, which contains the
+ // FormatID "RegisterStatusInfoId" and a string as the data container.
+ // This contains the following enum.
+
+class SvBaseLink;
+class SvBaseLinkRef;
+
+typedef std::vector<SvBaseLinkRef*> SvBaseLinks;
+
+typedef std::set<SvLinkSource*> SvLinkSources;
+
+class SFX2_DLLPUBLIC LinkManager
+{
+ typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > >
+ CompVector;
+ CompVector maCachedComps;
+
+ SvBaseLinks aLinkTbl;
+ SvLinkSources aServerTbl;
+
+ SfxObjectShell *pPersist; // LinkMgr must be release before SfxObjectShell
+protected:
+ sal_Bool InsertLink( SvBaseLink* pLink, sal_uInt16 nObjType, sal_uInt16 nUpdateType,
+ const String* pName = 0 );
+public:
+
+ enum LinkState
+ {
+ STATE_LOAD_OK,
+ STATE_LOAD_ERROR,
+ STATE_LOAD_ABORT
+ };
+
+ LinkManager( SfxObjectShell * pCacheCont );
+ ~LinkManager();
+
+ /**
+ * Insert a component loaded during link update, which needs to be closed
+ * when the update is complete.
+ *
+ * @param xComp component loaded during link update.
+ */
+ void InsertCachedComp(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xComp);
+
+ void CloseCachedComps();
+
+ SfxObjectShell* GetPersist() const { return pPersist; }
+ void SetPersist( SfxObjectShell * p ) { pPersist = p; }
+
+ void Remove( SvBaseLink *pLink );
+ void Remove( sal_uInt16 nPos, sal_uInt16 nCnt = 1 );
+ sal_Bool Insert( SvBaseLink* pLink );
+
+ // the links connect to a SvLinkSource and adds to the list
+ sal_Bool InsertDDELink( SvBaseLink*,
+ const String& rServer,
+ const String& rTopic,
+ const String& rItem );
+
+ // if everything is already set at the link!
+ sal_Bool InsertDDELink( SvBaseLink* );
+
+ // Connect the links to a pseudo-object and add to the list
+ bool InsertFileLink( sfx2::SvBaseLink&,
+ sal_uInt16 nFileType,
+ const String& rFileNm,
+ const String* pFilterNm = 0,
+ const String* pRange = 0 );
+
+ bool InsertFileLink(
+ sfx2::SvBaseLink& rLink, sal_uInt16 nFileType, const OUString& rFileNm,
+ const OUString* pFilterNm = NULL, const OUString* pRange = NULL);
+
+ void ReconnectDdeLink(SfxObjectShell& rServer);
+
+ /**
+ * Reconnect the server document shell to a DDE link object.
+ *
+ * @param rPath path to the server document
+ * @param rServer server document shell instance
+ * @param rLink link object of the client document
+ */
+ void LinkServerShell(const OUString& rPath, SfxObjectShell& rServer, ::sfx2::SvBaseLink& rLink) const;
+
+ // Obtain the string for the dialog
+ bool GetDisplayNames( const SvBaseLink *,
+ String* pType,
+ String* pFile = 0,
+ String* pLink = 0,
+ String* pFilter = 0 ) const;
+
+ bool GetDisplayNames(
+ const SvBaseLink* pLink, OUString* pType, OUString* pFile = NULL,
+ OUString* pLinkStr = NULL, OUString* pFilter = NULL) const;
+
+ SvLinkSourceRef CreateObj( SvBaseLink* );
+
+ void UpdateAllLinks( bool bAskUpdate = true,
+ bool bCallErrHdl = true,
+ bool bUpdateGrfLinks = false,
+ Window* pParentWin = 0 );
+
+ // Call for list of links (eg for link-dialog)
+ const SvBaseLinks& GetLinks() const { return aLinkTbl; }
+
+ // ----------------- Server-side management --------------------
+
+ // Call with list of links to server
+ const SvLinkSources& GetServers() const { return aServerTbl; }
+ // Link register/delete
+ sal_Bool InsertServer( SvLinkSource* rObj );
+ void RemoveServer( SvLinkSource* rObj );
+
+ // A transfer is aborted, so cancel all download media
+ // (for the time beeing this is only of interest for the FileLinks!)
+ void CancelTransfers();
+
+ // To send status information from the FileObject to the Baselink,
+ // for this there exist a separate ClipBoardId. The SvData-object has
+ // got the appropriate information as a string.
+ // Is now required for FileObject in conjunction with JavaScript
+ // this needs information about Load/Abort/Error
+ static sal_uIntPtr RegisterStatusInfoId();
+
+ // if the mimetype says graphic/bitmap/gdimetafile then get the
+ // graphic from the Any. Return says no errors
+ static sal_Bool GetGraphicFromAny( const String& rMimeType,
+ const ::com::sun::star::uno::Any & rValue,
+ Graphic& rGrf );
+
+private:
+ LinkManager( const LinkManager& );
+ LinkManager& operator=( const LinkManager& );
+};
+
+// Separator in the link name for the DDE-/File-/Graphics- links
+// (only those who need to construct a SvLinkName)
+const sal_Unicode cTokenSeperator = 0xFFFF;
+
+// create a string for the SvLinkName. For:
+// - DDE the first 3 Strings, (Server, Topic, Item)
+// - File-/Graphics-LinkNames the last 3 Strings (FileName, Region, Filter)
+SFX2_DLLPUBLIC void MakeLnkName( String& rName,
+ const String* pType, // Can also be null!!
+ const String& rFile,
+ const String& rLink,
+ const String* pFilter = 0 );
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/linksrc.hxx b/include/sfx2/linksrc.hxx
new file mode 100644
index 000000000000..4ff77b6afa54
--- /dev/null
+++ b/include/sfx2/linksrc.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 _LINKSRC_HXX
+#define _LINKSRC_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <tools/link.hxx>
+#include <tools/ref.hxx>
+#include <tools/rtti.hxx>
+#include <com/sun/star/io/XInputStream.hpp>
+
+#include <sal/config.h>
+
+namespace com { namespace sun { namespace star { namespace uno
+{
+ class Any;
+}}}}
+class Window;
+class String;
+
+#ifndef ADVISEMODE_NODATA
+// Must be the same value as Ole2 ADVF_*
+#define ADVISEMODE_NODATA 0x01
+#define ADVISEMODE_PRIMEFIRST 0x02
+#define ADVISEMODE_ONLYONCE 0x04
+#define ADVISEMODE_DATAONSTOP 0x40
+#endif
+
+namespace sfx2
+{
+
+class SvBaseLink;
+struct SvLinkSource_Impl;
+
+class SFX2_DLLPUBLIC SvLinkSource : public SvRefBase
+{
+private:
+ SvLinkSource_Impl* pImpl; // compatible area
+
+public:
+ TYPEINFO();
+
+ SvLinkSource();
+ virtual ~SvLinkSource();
+
+ sal_Bool HasDataLinks( const SvBaseLink* = 0 ) const;
+
+ void Closed();
+
+ sal_uIntPtr GetUpdateTimeout() const;
+ void SetUpdateTimeout( sal_uIntPtr nTime );
+ // notify the sink, the mime type is not
+ // a selection criterion
+ void DataChanged( const String & rMimeType,
+ const ::com::sun::star::uno::Any & rVal );
+ void SendDataChanged();
+ void NotifyDataChanged();
+
+ virtual sal_Bool Connect( SvBaseLink* );
+ virtual sal_Bool GetData( ::com::sun::star::uno::Any & rData /*out param*/,
+ const String & rMimeType,
+ sal_Bool bSynchron = sal_False );
+
+ // sal_True => waitinmg for data
+ virtual sal_Bool IsPending() const;
+ // sal_True => data complete loaded
+ virtual sal_Bool IsDataComplete() const;
+
+ // Link impl: DECL_LINK( MyEndEditHdl, sfx2::FileDialogHelper* ); <= param is the dialog
+ virtual void Edit( Window *, SvBaseLink *, const Link& rEndEditHdl );
+
+
+ void AddDataAdvise( SvBaseLink *, const String & rMimeType,
+ sal_uInt16 nAdviceMode );
+ void RemoveAllDataAdvise( SvBaseLink * );
+
+ void AddConnectAdvise( SvBaseLink * );
+ void RemoveConnectAdvise( SvBaseLink * );
+
+ struct StreamToLoadFrom{
+ StreamToLoadFrom(
+ const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream,sal_Bool bIsReadOnly )
+ :m_xInputStreamToLoadFrom(xInputStream),
+ m_bIsReadOnly(bIsReadOnly)
+ {
+ }
+
+ com::sun::star::uno::Reference<com::sun::star::io::XInputStream>
+ m_xInputStreamToLoadFrom;
+ sal_Bool m_bIsReadOnly;
+ };
+
+ StreamToLoadFrom getStreamToLoadFrom();
+ void setStreamToLoadFrom(const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream,sal_Bool bIsReadOnly );
+ void clearStreamToLoadFrom();
+};
+
+SV_DECL_IMPL_REF(SvLinkSource);
+
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/lnkbase.hxx b/include/sfx2/lnkbase.hxx
new file mode 100644
index 000000000000..ebd76db400d0
--- /dev/null
+++ b/include/sfx2/lnkbase.hxx
@@ -0,0 +1,176 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _LNKBASE_HXX
+#define _LNKBASE_HXX
+
+#include <com/sun/star/io/XInputStream.hpp>
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <sot/exchange.hxx>
+#include <tools/ref.hxx>
+#include <sfx2/linksrc.hxx>
+
+namespace com { namespace sun { namespace star { namespace uno
+{
+ class Any;
+}}}}
+
+namespace sfx2
+{
+
+struct ImplBaseLinkData;
+class LinkManager;
+class SvLinkSource;
+class FileDialogHelper;
+
+#ifndef OBJECT_DDE_EXTERN
+#define OBJECT_INTERN 0x00
+//#define OBJECT_SO_EXTERN 0x01
+#define OBJECT_DDE_EXTERN 0x02
+#endif
+
+#define OBJECT_CLIENT_SO 0x80 // a Link
+#define OBJECT_CLIENT_DDE 0x81
+//#define OBJECT_CLIENT_OLE 0x82 // a Ole-Link
+//#define OBJECT_CLIENT_OLE_CACHE 0x83 // a Ole-Link with SvEmbeddedObject
+#define OBJECT_CLIENT_FILE 0x90
+#define OBJECT_CLIENT_GRF 0x91
+#define OBJECT_CLIENT_OLE 0x92 // embedded link
+
+enum sfxlink {
+ // Ole2 compatibel and persistent
+ LINKUPDATE_ALWAYS = 1,
+ LINKUPDATE_ONCALL = 3,
+
+ LINKUPDATE_END // dummy!
+};
+
+struct BaseLink_Impl;
+
+class SFX2_DLLPUBLIC SvBaseLink : public SvRefBase
+{
+private:
+ friend class LinkManager;
+ friend class SvLinkSource;
+
+ SvLinkSourceRef xObj;
+ String aLinkName;
+ BaseLink_Impl* pImpl;
+ sal_uInt16 nObjType;
+ sal_Bool bVisible : 1;
+ sal_Bool bSynchron : 1;
+ sal_Bool bUseCache : 1; // for Graphics Links!
+ sal_Bool bWasLastEditOK : 1;
+
+ DECL_LINK( EndEditHdl, String* );
+
+ bool ExecuteEdit( const String& _rNewName );
+
+protected:
+ void SetObjType( sal_uInt16 );
+
+ // Set LinkSourceName without action
+ void SetName( const String & rLn );
+
+ ImplBaseLinkData* pImplData;
+
+ sal_Bool m_bIsReadOnly;
+ com::sun::star::uno::Reference<com::sun::star::io::XInputStream>
+ m_xInputStreamToLoadFrom;
+
+ SvBaseLink();
+ SvBaseLink( sal_uInt16 nLinkType, sal_uIntPtr nContentType = FORMAT_STRING );
+ virtual ~SvBaseLink();
+
+ void _GetRealObject( sal_Bool bConnect = sal_True );
+
+ SvLinkSource* GetRealObject()
+ {
+ if( !xObj.Is() )
+ _GetRealObject();
+ return xObj;
+ }
+
+public:
+ TYPEINFO();
+
+ virtual void Closed();
+ SvBaseLink( const String& rNm, sal_uInt16 nObjectType,
+ SvLinkSource* );
+
+ sal_uInt16 GetObjType() const { return nObjType; }
+
+ void SetObj( SvLinkSource * pObj );
+ SvLinkSource* GetObj() const { return xObj; }
+
+ void SetLinkSourceName( const String & rName );
+ String GetLinkSourceName() const;
+
+ enum UpdateResult {
+ SUCCESS = 0,
+ ERROR_GENERAL = 1
+ };
+
+ virtual UpdateResult DataChanged(
+ const String & rMimeType, const ::com::sun::star::uno::Any & rValue );
+
+ void SetUpdateMode( sal_uInt16 );
+ sal_uInt16 GetUpdateMode() const;
+ sal_uIntPtr GetContentType() const;
+ sal_Bool SetContentType( sal_uIntPtr nType );
+
+ LinkManager* GetLinkManager();
+ const LinkManager* GetLinkManager() const;
+ void SetLinkManager( LinkManager* _pMgr );
+
+ sal_Bool Update();
+ void Disconnect();
+
+ // Link impl: DECL_LINK( MyEndDialogHdl, SvBaseLink* ); <= param is this
+ virtual void Edit( Window*, const Link& rEndEditHdl );
+
+ // should the link appear in the dialog? (to the left in the link in the...)
+ sal_Bool IsVisible() const { return bVisible; }
+ void SetVisible( sal_Bool bFlag ) { bVisible = bFlag; }
+ // should the Link be loaded synchronous or asynchronous?
+ sal_Bool IsSynchron() const { return bSynchron; }
+ void SetSynchron( sal_Bool bFlag ) { bSynchron = bFlag; }
+
+ sal_Bool IsUseCache() const { return bUseCache; }
+ void SetUseCache( sal_Bool bFlag ) { bUseCache = bFlag; }
+
+ void setStreamToLoadFrom(
+ const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream,
+ sal_Bool bIsReadOnly )
+ { m_xInputStreamToLoadFrom = xInputStream;
+ m_bIsReadOnly = bIsReadOnly; }
+ // #i88291#
+ void clearStreamToLoadFrom();
+
+ inline sal_Bool WasLastEditOK() const { return bWasLastEditOK; }
+ FileDialogHelper & GetInsertFileDialog(const String& rFactory) const;
+};
+
+SV_DECL_IMPL_REF(SvBaseLink);
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/macropg.hxx b/include/sfx2/macropg.hxx
new file mode 100644
index 000000000000..1a6c87198f41
--- /dev/null
+++ b/include/sfx2/macropg.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 _MACROPG_HXX
+#define _MACROPG_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <sfx2/basedlgs.hxx>
+#include <sfx2/tabdlg.hxx>
+#include <svl/macitem.hxx>
+#include <vcl/lstbox.hxx>
+#include <com/sun/star/frame/XFrame.hpp>
+
+class _SfxMacroTabPage;
+class SvTabListBox;
+class Edit;
+class String;
+class SfxObjectShell;
+
+class SfxConfigFunctionListBox_Impl;
+
+class _HeaderTabListBox;
+class _SfxMacroTabPage_Impl;
+
+class SFX2_DLLPUBLIC _SfxMacroTabPage : public SfxTabPage
+{
+ SvxMacroTableDtor aTbl;
+
+ DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectEvent_Impl, SvTabListBox * );
+ DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectGroup_Impl, ListBox * );
+ DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectMacro_Impl, ListBox * );
+
+ DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, DoubleClickHdl_Impl, Control* );
+ DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton * );
+
+ DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, ChangeScriptHdl_Impl, RadioButton * );
+ DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, GetFocus_Impl, Edit* );
+ DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, TimeOut_Impl, Timer* );
+
+protected:
+ _SfxMacroTabPage_Impl* mpImpl;
+
+ _SfxMacroTabPage( Window* pParent, const ResId& rId, const SfxItemSet& rItemSet );
+
+ void InitAndSetHandler();
+ void FillEvents();
+ void FillMacroList();
+ void EnableButtons( const String& rLanguage );
+
+public:
+
+ virtual ~_SfxMacroTabPage();
+
+ void AddEvent( const String & rEventName, sal_uInt16 nEventId );
+
+ const SvxMacroTableDtor& GetMacroTbl() const;
+ void SetMacroTbl( const SvxMacroTableDtor& rTbl );
+ void ClearMacroTbl();
+
+ virtual void ScriptChanged( const String& rLanguage );
+
+ // zum setzen / abfragen der Links
+ void SetGetMacrosOfRangeLink( FNGetMacrosOfRangeHdl pFn );
+ FNGetMacrosOfRangeHdl GetGetMacrosOfRangeLink() const;
+
+ // --------- Erben aus der Basis -------------
+ virtual sal_Bool FillItemSet( SfxItemSet& rSet );
+ virtual void Reset( const SfxItemSet& rSet );
+
+ void SetReadOnly( sal_Bool bSet );
+ sal_Bool IsReadOnly() const;
+ void SelectEvent( const String& rEventName, sal_uInt16 nEventId );
+};
+
+inline const SvxMacroTableDtor& _SfxMacroTabPage::GetMacroTbl() const
+{
+ return aTbl;
+}
+
+inline void _SfxMacroTabPage::SetMacroTbl( const SvxMacroTableDtor& rTbl )
+{
+ aTbl = rTbl;
+}
+
+inline void _SfxMacroTabPage::ClearMacroTbl()
+{
+ aTbl.DelDtor();
+}
+
+class SFX2_DLLPUBLIC SfxMacroTabPage : public _SfxMacroTabPage
+{
+public:
+ SfxMacroTabPage(
+ Window* pParent,
+ const ResId& rId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
+ const SfxItemSet& rSet
+ );
+
+ // --------- Erben aus der Basis -------------
+ static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
+};
+
+class SFX2_DLLPUBLIC SfxMacroAssignDlg : public SfxNoLayoutSingleTabDialog
+{
+public:
+ SfxMacroAssignDlg(
+ Window* pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
+ SfxItemSet& rSet );
+ SfxMacroAssignDlg(
+ Window* pParent,
+ const SfxObjectShell* _pShell,
+ SfxItemSet& rSet );
+ virtual ~SfxMacroAssignDlg();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/mailmodelapi.hxx b/include/sfx2/mailmodelapi.hxx
new file mode 100644
index 000000000000..042a364e2b5a
--- /dev/null
+++ b/include/sfx2/mailmodelapi.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_SFX_MAILMODEL_HXX
+#define INCLUDED_SFX_MAILMODEL_HXX
+
+#include <vector>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include "tools/link.hxx"
+#include <tools/string.hxx>
+#include "sfx2/dllapi.h"
+
+// class AddressList_Impl ------------------------------------------------
+typedef String* AddressItemPtr_Impl;
+typedef ::std::vector< AddressItemPtr_Impl > AddressList_Impl;
+
+// class SfxMailModel_Impl -----------------------------------------------
+
+class SFX2_DLLPUBLIC SfxMailModel
+{
+public:
+ enum MailPriority
+ {
+ PRIO_HIGHEST,
+ PRIO_HIGH,
+ PRIO_NORMAL,
+ PRIO_LOW,
+ PRIO_LOWEST
+ };
+
+ enum AddressRole
+ {
+ ROLE_TO,
+ ROLE_CC,
+ ROLE_BCC
+ };
+
+ enum MailDocType
+ {
+ TYPE_SELF,
+ TYPE_ASPDF
+ };
+
+protected:
+ enum SaveResult
+ {
+ SAVE_SUCCESSFULL,
+ SAVE_CANCELLED,
+ SAVE_ERROR
+ };
+ ::std::vector< OUString > maAttachedDocuments;
+ SaveResult SaveDocumentAsFormat( const OUString& aSaveFileName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xFrameOrModel,
+ const OUString& rType,
+ OUString& rFileNamePath );
+
+private:
+ AddressList_Impl* mpToList;
+ AddressList_Impl* mpCcList;
+ AddressList_Impl* mpBccList;
+ String maFromAddress;
+ String maSubject;
+ MailPriority mePriority;
+
+ sal_Bool mbLoadDone;
+
+ void ClearList( AddressList_Impl* pList );
+ SaveResult ShowFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMGR,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel,
+ const OUString& rFilterName,
+ const OUString& rType,
+ bool bModified,
+ sal_Int32& rNumArgs,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
+
+ DECL_LINK( DoneHdl, void* );
+
+public:
+ enum SendMailResult
+ {
+ SEND_MAIL_OK,
+ SEND_MAIL_CANCELLED,
+ SEND_MAIL_ERROR
+ };
+
+ SfxMailModel();
+ ~SfxMailModel();
+
+ void AddAddress( const String& rAddress, AddressRole eRole );
+ void SetFromAddress( const String& rAddress ) { maFromAddress = rAddress; }
+ void SetSubject( const String& rSubject ) { maSubject = rSubject; }
+ void SetPriority( MailPriority ePrio ) { mePriority = ePrio; }
+
+ /** attaches a document to the current attachment list, can be called more than once.
+ * at the moment there will be a dialog for export executed for every model which is going to be attached.
+ *
+ * \param sDocumentType
+ The doc type to export. PDF will be at the moment only a direct export (no dialog).
+ * \param xModel
+ The current model to attach
+ * \param sAttachmentTitle
+ The title which will be used as attachment title
+ * \return @see error code
+ */
+ SendMailResult AttachDocument( const OUString& sDocumentType,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xFrameOrModel,
+ const OUString& sAttachmentTitle );
+
+ SendMailResult SaveAndSend( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
+ const OUString& rType );
+ SendMailResult Send( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame );
+
+ sal_Bool IsEmpty() const;
+};
+
+sal_Bool CreateFromAddress_Impl( String& rFrom );
+
+#endif // INCLUDED_SFX_MAILMODEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx
new file mode 100644
index 000000000000..553c5bd745f3
--- /dev/null
+++ b/include/sfx2/mgetempl.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 _SFX_MGETEMPL_HXX
+#define _SFX_MGETEMPL_HXX
+
+#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/vclmedit.hxx>
+#include <sfx2/tabdlg.hxx>
+
+/* expected:
+ SID_TEMPLATE_NAME : In: StringItem, Name of Template
+ SID_TEMPLATE_FAMILY : In: Family of Template
+*/
+
+class SfxStyleFamilies;
+class SfxStyleFamilyItem;
+class SfxStyleSheetBase;
+
+class SfxManageStyleSheetPage : public SfxTabPage
+{
+ VclMultiLineEdit* m_pNameRo;
+ Edit* m_pNameRw;
+
+ CheckBox* m_pAutoCB;
+
+ FixedText* m_pFollowFt;
+ ListBox* m_pFollowLb;
+
+ FixedText* m_pBaseFt;
+ ListBox* m_pBaseLb;
+
+ FixedText* m_pFilterFt;
+ ListBox* m_pFilterLb;
+
+ FixedText *m_pDescFt;
+
+ SfxStyleSheetBase *pStyle;
+ SfxStyleFamilies *pFamilies;
+ const SfxStyleFamilyItem *pItem;
+ String aBuf;
+ sal_Bool bModified;
+
+ // initial data for the style
+ String aName;
+ String aFollow;
+ String aParent;
+ sal_uInt16 nFlags;
+
+private:
+friend class SfxStyleDialog;
+
+ DECL_LINK( GetFocusHdl, Edit * );
+ DECL_LINK( LoseFocusHdl, Edit * );
+
+ void UpdateName_Impl(ListBox *, const String &rNew);
+ void SetDescriptionText_Impl();
+
+ SfxManageStyleSheetPage(Window *pParent, const SfxItemSet &rAttrSet );
+ ~SfxManageStyleSheetPage();
+
+ static SfxTabPage* Create(Window *pParent, const SfxItemSet &rAttrSet );
+
+protected:
+ virtual sal_Bool FillItemSet(SfxItemSet &);
+ virtual void Reset(const SfxItemSet &);
+
+ using TabPage::ActivatePage;
+ virtual void ActivatePage(const SfxItemSet &);
+ using TabPage::DeactivatePage;
+ virtual int DeactivatePage(SfxItemSet * = 0);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/mieclip.hxx b/include/sfx2/mieclip.hxx
new file mode 100644
index 000000000000..6b616607b38f
--- /dev/null
+++ b/include/sfx2/mieclip.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 _MIECLIP_HXX
+#define _MIECLIP_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <tools/solar.h>
+#include <tools/string.hxx>
+
+class SvStream;
+class SotDataObject;
+class SvData;
+
+class SFX2_DLLPUBLIC MSE40HTMLClipFormatObj
+{
+ SvStream* pStrm;
+ String sBaseURL;
+
+public:
+ MSE40HTMLClipFormatObj() : pStrm(0) {}
+ ~MSE40HTMLClipFormatObj();
+
+//JP 31.01.2001: old interfaces
+ SAL_DLLPRIVATE sal_Bool GetData( SotDataObject& );
+ SAL_DLLPRIVATE sal_Bool GetData( SvData& );
+//JP 31.01.2001: the new one
+ SvStream* IsValid( SvStream& );
+
+ const SvStream* GetStream() const { return pStrm; }
+ SvStream* GetStream() { return pStrm; }
+ const String& GetBaseURL() const { return sBaseURL; }
+};
+
+
+#endif //_MIECLIP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/minfitem.hxx b/include/sfx2/minfitem.hxx
new file mode 100644
index 000000000000..fb06ffc1e979
--- /dev/null
+++ b/include/sfx2/minfitem.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 _SFX_MINFITEM_HXX
+#define _SFX_MINFITEM_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <tools/string.hxx>
+#include <svl/poolitem.hxx>
+class BasicManager;
+
+class SFX2_DLLPUBLIC SfxMacroInfoItem: public SfxPoolItem
+{
+ const BasicManager* pBasicManager;
+ String aLibName;
+ String aModuleName;
+ String aMethodName;
+ String aCommentText;
+
+public:
+ TYPEINFO();
+ SfxMacroInfoItem( sal_uInt16 nWhich,
+ const BasicManager* pMgr,
+ const String &rLibName,
+ const String &rModuleName,
+ const String &rMethodName,
+ const String &rComment);
+
+ SfxMacroInfoItem( const SfxMacroInfoItem& );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+ String GetComment() const
+ { return aCommentText; }
+ void SetComment( const String& r )
+ { aCommentText = r; }
+ String GetMethod() const
+ { return aMethodName; }
+ void SetMethod( const String& r )
+ { aMethodName = r; }
+ String GetModule() const
+ { return aModuleName; }
+ void SetModule( const String& r )
+ { aModuleName = r; }
+ String GetLib() const
+ { return aLibName; }
+ void SetLib( const String& r )
+ { aLibName = r; }
+ const BasicManager* GetBasicManager() const
+ { return pBasicManager; }
+ String GetQualifiedName() const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/mnuitem.hxx b/include/sfx2/mnuitem.hxx
new file mode 100644
index 000000000000..e65220be2a13
--- /dev/null
+++ b/include/sfx2/mnuitem.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 _SFXMNUITEM_HXX
+#define _SFXMNUITEM_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+class SfxVirtualMenu;
+class SfxBindings;
+class SfxModule;
+class Menu;
+class PopupMenu;
+class SfxUnoMenuControl;
+class SfxUnoControllerItem;
+struct SfxMenuCtrlFactory;
+#include <tools/string.hxx>
+#include <sfx2/ctrlitem.hxx>
+
+class SFX2_DLLPUBLIC SfxMenuControl: public SfxControllerItem
+{
+ String aTitle;
+ SfxVirtualMenu* pOwnMenu;
+ SfxVirtualMenu* pSubMenu;
+ sal_Bool b_ShowStrings;
+
+public:
+ SfxMenuControl();
+ SfxMenuControl( sal_Bool bShowStrings );
+ SfxMenuControl( sal_uInt16, SfxBindings&);
+
+ static SfxMenuControl* CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings );
+ static void RegisterControl( sal_uInt16 nSlotId = 0, SfxModule *pMod=NULL );
+
+ ~SfxMenuControl();
+
+ using SfxControllerItem::Bind;
+ void Bind( SfxVirtualMenu* pOwnMenu, sal_uInt16 nId,
+ const String& rTitle, SfxBindings& rBindings );
+ void Bind( SfxVirtualMenu* pOwnMenu, sal_uInt16 nId,
+ SfxVirtualMenu& rSubMenu,
+ const String& rTitle, SfxBindings& rBindings );
+
+ String GetTitle() const;
+ SfxVirtualMenu* GetPopupMenu() const;
+ virtual PopupMenu* GetPopup() const;
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+
+ static SfxMenuControl* CreateControl( sal_uInt16 nId, Menu &, SfxBindings & );
+ static SfxUnoMenuControl* CreateControl( const String&, sal_uInt16, Menu&, const String& sItemText, SfxBindings&, SfxVirtualMenu* );
+ static void RegisterMenuControl(SfxModule*, SfxMenuCtrlFactory*);
+
+};
+
+class SfxUnoMenuControl : public SfxMenuControl
+{
+ SfxUnoControllerItem* pUnoCtrl;
+public:
+ SfxUnoMenuControl( const String&, sal_uInt16 nId, Menu&,
+ const String&,
+ SfxBindings&, SfxVirtualMenu* );
+ ~SfxUnoMenuControl();
+};
+
+typedef SfxMenuControl* (*SfxMenuControlCtor)( sal_uInt16 nId, Menu &, SfxBindings & );
+
+struct SfxMenuCtrlFactory
+{
+ SfxMenuControlCtor pCtor;
+ TypeId nTypeId;
+ sal_uInt16 nSlotId;
+
+ SfxMenuCtrlFactory( SfxMenuControlCtor pTheCtor,
+ TypeId nTheTypeId, sal_uInt16 nTheSlotId ):
+ pCtor(pTheCtor),
+ nTypeId(nTheTypeId),
+ nSlotId(nTheSlotId)
+ {}
+};
+
+inline String SfxMenuControl::GetTitle() const
+{
+ return aTitle;
+}
+
+inline SfxVirtualMenu* SfxMenuControl::GetPopupMenu() const
+{
+ return pSubMenu;
+}
+
+#define SFX_DECL_MENU_CONTROL() \
+ static SfxMenuControl* CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ); \
+ static void RegisterControl(sal_uInt16 nSlotId = 0, SfxModule *pMod=NULL)
+
+#define SFX_IMPL_MENU_CONTROL(Class, nItemClass) \
+ SfxMenuControl* Class::CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ) \
+ { return new Class(nId, rMenu, rBindings); } \
+ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
+ { SfxMenuControl::RegisterMenuControl( pMod, new SfxMenuCtrlFactory( \
+ Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); }
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/mnumgr.hxx b/include/sfx2/mnumgr.hxx
new file mode 100644
index 000000000000..4624026a059e
--- /dev/null
+++ b/include/sfx2/mnumgr.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 _SFXMNUMGR_HXX
+#define _SFXMNUMGR_HXX
+
+#include <vcl/menu.hxx>
+#include <tools/wintypes.hxx>
+#include <tools/link.hxx>
+#include <com/sun/star/embed/VerbDescriptor.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <tools/stream.hxx>
+#include <tools/resid.hxx>
+#include <sfx2/sfx.hrc>
+
+class SfxVirtualMenu;
+class SfxPoolItem;
+class SfxBindings;
+class ResMgr;
+class Menu;
+class PopupMenu;
+class SfxBindings;
+class ResId;
+class Point;
+class SfxObjectShell;
+class SfxModule;
+class SfxViewFrame;
+
+class SfxMenuManager
+{
+friend class SfxPopupMenuManager;
+
+ SfxVirtualMenu* pMenu; // the actual Menu
+ SfxVirtualMenu* pOldMenu; // only while reconfiguring
+ sal_Bool bMenuBar; // Popup or MenuBar
+ SfxBindings* pBindings;
+ ResMgr* pResMgr;
+ sal_uInt32 nType;
+ sal_Bool bAddClipboardFuncs : 1;
+
+ void Construct( SfxVirtualMenu& rMenu );
+
+protected:
+ SfxMenuManager( Menu*, SfxBindings& );
+ ~SfxMenuManager();
+ sal_uInt16 GetItemPos( sal_uInt16 nId );
+ sal_uInt32 GetType() { return nType; }
+public:
+
+ DECL_LINK( Select, Menu* );
+
+ SfxVirtualMenu* GetMenu() const
+ { return pMenu; }
+
+ SfxBindings& GetBindings() { return *pBindings; }
+ const SfxBindings& GetBindings() const { return *pBindings; }
+ void SetResMgr(ResMgr* pMgr) {pResMgr = pMgr; }
+ ResMgr* GetResMgr() const { return pResMgr; }
+ void SetPopupMenu( sal_uInt16 nId, PopupMenu *pMenu );
+};
+
+//--------------------------------------------------------------------
+
+class SAL_DLLPUBLIC_EXPORT SfxPopupMenuManager : public SfxMenuManager
+{
+private:
+ Menu* pSVMenu;
+
+ // when #i107205 gets fixed this one should be superfluous.
+ // But right now we want to avoid the memory leak that would otherwise occur,
+ // if we don't delete the pointer that got created in SfxPopupMenuManager::Popup
+ static PopupMenu * pStaticThesSubMenu;
+
+ // only declared, but not defined: don't allow copying
+ SfxPopupMenuManager( const SfxPopupMenuManager& );
+ SfxPopupMenuManager& operator=( const SfxPopupMenuManager& );
+
+public:
+ SfxPopupMenuManager( PopupMenu*, SfxBindings& );
+ ~SfxPopupMenuManager();
+ static void ExecutePopup( const ResId&, SfxViewFrame* pViewFrame, const Point& rPoint, Window* pWindow );
+ // @deprecated!!
+ // Don't use this method any longer. The whole class will be removed in the future.
+ // Changing code which relies on Popup would need much more effort.
+ static SfxPopupMenuManager* Popup( const ResId& rResId, SfxViewFrame* pFrame,const Point& rPoint, Window* pWindow );
+
+ sal_uInt16 Execute( const Point& rPos, Window *pWindow );
+
+ void RemoveDisabledEntries();
+ Menu* GetSVMenu();
+};
+
+#endif // #ifndef _SFXMNUMGR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/module.hxx b/include/sfx2/module.hxx
new file mode 100644
index 000000000000..3b285faf6593
--- /dev/null
+++ b/include/sfx2/module.hxx
@@ -0,0 +1,115 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXMODULE_HXX
+#define _SFXMODULE_HXX // internal
+#define _SFXMOD_HXX // external
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <sfx2/shell.hxx>
+#include <svtools/imgdef.hxx>
+#include <sal/types.h>
+#include <tools/fldunit.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <vector>
+
+class ImageList;
+
+class SfxBindings;
+class SfxObjectFactory;
+class ModalDialog;
+class SfxObjectFactory;
+class SfxModule;
+typedef ::std::vector<SfxModule*> SfxModuleArr_Impl;
+class SfxModule_Impl;
+class SfxSlotPool;
+struct SfxChildWinContextFactory;
+struct SfxChildWinFactory;
+struct SfxMenuCtrlFactory;
+struct SfxStbCtrlFactory;
+struct SfxTbxCtrlFactory;
+class SfxTbxCtrlFactArr_Impl;
+class SfxChildWinFactArr_Impl;
+class SfxMenuCtrlFactArr_Impl;
+class SfxStbCtrlFactArr_Impl;
+class SfxTabPage;
+class Window;
+
+namespace com { namespace sun { namespace star { namespace frame {
+ class XFrame;
+} } } }
+//====================================================================
+
+class SFX2_DLLPUBLIC SfxModule : public SfxShell
+{
+private:
+ ResMgr* pResMgr;
+ sal_Bool bDummy : 1;
+ SfxModule_Impl* pImpl;
+
+ SAL_DLLPRIVATE void Construct_Impl();
+
+public:
+ TYPEINFO();
+ SFX_DECL_INTERFACE(SFX_INTERFACE_SFXMODULE)
+
+ SfxModule( ResMgr* pMgrP, sal_Bool bDummy,
+ SfxObjectFactory* pFactoryP, ... );
+ ~SfxModule();
+
+ ResMgr* GetResMgr() const { return SfxShell::GetResMgr(); }
+ virtual ResMgr* GetResMgr();
+ SfxSlotPool* GetSlotPool() const;
+
+ void RegisterToolBoxControl(SfxTbxCtrlFactory*);
+ void RegisterChildWindow(SfxChildWinFactory*);
+ void RegisterStatusBarControl(SfxStbCtrlFactory*);
+ void RegisterMenuControl(SfxMenuCtrlFactory*);
+
+ virtual SfxTabPage* CreateTabPage( sal_uInt16 nId,
+ Window* pParent,
+ const SfxItemSet& rSet );
+ virtual void Invalidate(sal_uInt16 nId = 0);
+
+ /*virtual*/ bool IsChildWindowAvailable( const sal_uInt16 i_nId, const SfxViewFrame* i_pViewFrame ) const;
+
+ static SfxModule* GetActiveModule( SfxViewFrame* pFrame=NULL );
+ static FieldUnit GetCurrentFieldUnit();
+ /** retrieves the field unit of the module belonging to the document displayed in the given frame
+
+ Effectively, this method looks up the SfxViewFrame belonging to the given XFrame, then the SfxModule belonging to
+ the document in this frame, then this module's field unit.
+
+ Failures in any of those steps are reported as assertion in non-product builds, and then FUNIT_100TH_MM is returned.
+ */
+ static FieldUnit GetModuleFieldUnit( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & i_frame );
+ FieldUnit GetFieldUnit() const;
+
+ SAL_DLLPRIVATE static SfxModuleArr_Impl& GetModules_Impl();
+ SAL_DLLPRIVATE static void DestroyModules_Impl();
+ SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl* GetTbxCtrlFactories_Impl() const;
+ SAL_DLLPRIVATE SfxStbCtrlFactArr_Impl* GetStbCtrlFactories_Impl() const;
+ SAL_DLLPRIVATE SfxMenuCtrlFactArr_Impl* GetMenuCtrlFactories_Impl() const;
+ SAL_DLLPRIVATE SfxChildWinFactArr_Impl* GetChildWinFactories_Impl() const;
+ SAL_DLLPRIVATE ImageList* GetImageList_Impl( sal_Bool bBig );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/msg.hxx b/include/sfx2/msg.hxx
new file mode 100644
index 000000000000..eca6618cc118
--- /dev/null
+++ b/include/sfx2/msg.hxx
@@ -0,0 +1,333 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXMSG_HXX
+#define _SFXMSG_HXX
+
+#include <tools/rtti.hxx>
+#include <sfx2/shell.hxx>
+#include <rtl/string.hxx>
+#include <rtl/ustring.hxx>
+#include <sfx2/dllapi.h>
+
+//--------------------------------------------------------------------
+
+#define SFX_SLOT_CACHABLE 0x0001L // exclusiv to VOLATILE, default
+#define SFX_SLOT_VOLATILE 0x0002L // per Timer every 2s get new,
+ // exclusiv to CACHABLE
+#define SFX_SLOT_TOGGLE 0x0004L // inverted for Execute old value
+#define SFX_SLOT_AUTOUPDATE 0x0008L // invalidated the status automatically
+ // after execute
+
+#define SFX_SLOT_SYNCHRON 0x0010L // exclusiv to ASYNCHRON, default
+#define SFX_SLOT_ASYNCHRON 0x0020L // via Post-Message, exclusiv
+ // to SYNCHRON
+
+#define SFX_SLOT_HASCOREID 0x0040L // Slot-ID/Which-ID execute mapping
+#define SFX_SLOT_HASDIALOG 0x0080L // Coordinates for dialogue after recofig
+
+#define SFX_SLOT_NORECORD 0x0100L // no recording
+#define SFX_SLOT_RECORDPERITEM 0x0200L // each item, one statement
+#define SFX_SLOT_RECORDPERSET 0x0400L // The whole Set is a Statement, default
+#define SFX_SLOT_RECORDMANUAL 0x0800L // Recording by the application
+ // developer is default
+
+#define SFX_SLOT_RECORDABSOLUTE 0x1000000L // Recording with absolute Target
+#define SFX_SLOT_STANDARD ( SFX_SLOT_CACHABLE | \
+ SFX_SLOT_SYNCHRON | \
+ SFX_SLOT_RECORDPERSET )
+
+#define SFX_SLOT_PROPGET 0x1000L // get property
+#define SFX_SLOT_PROPSET 0x2000L // set property, exclusiv to
+ // SFX_SLOT_METHOD
+#define SFX_SLOT_METHOD 0x4000L // Method, exclusiv to SFX_SLOT_PROPSET
+
+#define SFX_SLOT_FASTCALL 0x8000L // No test if disabled before Execute
+
+#define SFX_SLOT_STATUSBARCONFIG 0x10000L // configurable status row
+#define SFX_SLOT_MENUCONFIG 0x20000L // configurable Menu
+#define SFX_SLOT_TOOLBOXCONFIG 0x40000L // configurable Toolboxen
+#define SFX_SLOT_ACCELCONFIG 0x80000L // configurable keys
+
+#define SFX_SLOT_CONTAINER 0x100000L // Operated by the container at
+ // InPlace
+#define SFX_SLOT_READONLYDOC 0x200000L // also available for
+ // read-only Documents
+#define SFX_SLOT_IMAGEROTATION 0x400000L // Rotate image on Vertical/
+ // Bi-directional writing
+#define SFX_SLOT_IMAGEREFLECTION 0x800000L // Mirror image on Vertical/
+ // Bi-directional writing
+
+//--------------------------------------------------------------------
+
+class SfxRequest;
+class SfxItemSet;
+
+#define SFX_EXEC_STUB( aShellClass, aExecMethod) \
+ void SfxStub##aShellClass##aExecMethod( \
+ SfxShell *pShell, SfxRequest& rReq) \
+ { \
+ (( aShellClass* ) pShell )->aExecMethod( rReq ); \
+ }
+
+#define SFX_STATE_STUB( aShellClass, aStateMethod) \
+ void SfxStub##aShellClass##aStateMethod( \
+ SfxShell *pShell, SfxItemSet& rSet) \
+ { \
+ (( aShellClass* ) pShell )->aStateMethod( rSet ); \
+ }
+
+#define SFX_STUB_PTR( aShellClass, aMethod ) \
+ &SfxStub##aShellClass##aMethod
+
+#define SFX_STUB_PTR_EXEC_NONE &SfxShell::EmptyExecStub
+
+#define SFX_STUB_PTR_STATE_NONE &SfxShell::EmptyStateStub
+
+//--------------------------------------------------------------------
+
+enum SfxSlotKind
+{
+ SFX_KIND_STANDARD,
+ SFX_KIND_ENUM,
+ SFX_KIND_ATTR
+};
+
+//=========================================================================
+
+struct SfxTypeAttrib
+{
+ sal_uInt16 nAID;
+ const char* pName;
+};
+
+struct SfxType
+{
+ TypeId aTypeId;
+ sal_uInt16 nAttribs;
+ SfxTypeAttrib aAttrib[16];
+
+ const TypeId& Type() const
+ { return aTypeId; }
+ SfxPoolItem* CreateItem() const
+ { return (SfxPoolItem*) aTypeId(); }
+};
+
+struct SfxType0
+{
+ TypeId aTypeId;
+ sal_uInt16 nAttribs;
+
+ const TypeId& Type() const
+ { return aTypeId; }
+ SfxPoolItem* CreateItem() const
+ { return (SfxPoolItem*) aTypeId(); }
+};
+
+#define SFX_DECL_TYPE(n) struct SfxType##n \
+ { \
+ TypeId aTypeId; \
+ sal_uInt16 nAttribs; \
+ SfxTypeAttrib aAttrib[n]; \
+ }
+
+#define SFX_TYPE(Class) &a##Class##_Impl
+
+SFX_DECL_TYPE(1);
+SFX_DECL_TYPE(2);
+SFX_DECL_TYPE(3);
+SFX_DECL_TYPE(4);
+SFX_DECL_TYPE(5);
+SFX_DECL_TYPE(6);
+SFX_DECL_TYPE(7);
+SFX_DECL_TYPE(8);
+SFX_DECL_TYPE(10); // for SfxDocInfoItem
+SFX_DECL_TYPE(11);
+
+SFX_DECL_TYPE(13); // for SwAddPrinterItem, Sd...
+SFX_DECL_TYPE(14);
+SFX_DECL_TYPE(16); // for SwDocDisplayItem
+SFX_DECL_TYPE(17); // for SvxAddressItem
+SFX_DECL_TYPE(18); // for SvxSearchItem
+
+// all SfxTypes must be in this header
+#undef SFX_DECL_TYPE
+
+#define SFX_SLOT_ARG( aShellClass, id, GroupId, ExecMethodPtr, StateMethodPtr, Flags, ItemClass, nArg0, nArgs, Name, Prop ) \
+ { id, GroupId, id, Flags | Prop, \
+ USHRT_MAX, 0, \
+ ExecMethodPtr, \
+ StateMethodPtr, \
+ (const SfxType*) &a##ItemClass##_Impl, \
+ Name, Name, 0, 0, \
+ &a##aShellClass##Args_Impl[nArg0], nArgs, 0, Name \
+ }
+
+#define SFX_SLOT( aShellClass, id, GroupId, ExecMethodPtr, StateMethodPtr, Flags, ItemClass ) \
+ { id, GroupId, id, Flags, \
+ 0, 0, \
+ ExecMethodPtr, \
+ StateMethodPtr, \
+ (const SfxType*) &a##ItemClass##_Impl, \
+ 0, 0, 0, 0, 0, 0, 0 \
+ }
+
+#define SFX_NEW_SLOT_ARG( aShellClass, id, hid, GroupId, pLinked, pNext, ExecMethodPtr, StateMethodPtr, Flags, DisableFlags, ItemClass, nArg0, nArgs, Name, Prop, UnoName ) \
+ { id, GroupId, hid, Flags | Prop, \
+ USHRT_MAX, 0, \
+ ExecMethodPtr, \
+ StateMethodPtr, \
+ (const SfxType*) &a##ItemClass##_Impl, \
+ Name, Name, \
+ pLinked, pNext, \
+ &a##aShellClass##Args_Impl[nArg0], nArgs, DisableFlags, UnoName \
+ }
+
+#define SFX_NEW_SLOT_ENUM( SlaveId, hid, GroupId, pMaster, pNext, MasterId, Value, Flags, DisableFlags, UnoName ) \
+ { SlaveId, GroupId, hid, Flags, \
+ MasterId, Value, \
+ 0, \
+ 0, \
+ (const SfxType*) &aSfxBoolItem_Impl, \
+ 0, 0, \
+ pMaster, \
+ pNext, \
+ 0, 0, DisableFlags, UnoName \
+ }
+
+#define SFX_ARGUMENT( ArgSlotId, ArgName, ArgTypeId ) \
+ { (const SfxType*) &a##ArgTypeId##_Impl, ArgName, ArgSlotId }
+
+//--------------------------------------------------------------------
+
+class SfxPoolItem;
+
+struct SfxFormalArgument
+{
+ const SfxType* pType; // Type of the parameter (SfxPoolItem subclass)
+ const char* pName; // Name of the sParameters
+ sal_uInt16 nSlotId; // Slot-Id for identification of the Parameters
+
+ const TypeId& Type() const
+ { return pType->aTypeId; }
+ SfxPoolItem* CreateItem() const
+ { return (SfxPoolItem*) pType->aTypeId(); }
+};
+
+//--------------------------------------------------------------------
+
+class SfxSlot
+{
+public:
+ sal_uInt16 nSlotId; // Unique slot-ID in Shell
+ sal_uInt16 nGroupId; // for configuration region
+ sal_uIntPtr nHelpId; // Usually == nSlotId
+ sal_uIntPtr nFlags; // artihmetic ordered Flags
+
+ sal_uInt16 nMasterSlotId; // Enum-Slot for example Which-Id
+ sal_uInt16 nValue; // Value, in case of Enum-Slot
+
+ SfxExecFunc fnExec; // Function to be excecuted
+ SfxStateFunc fnState; // Function for Status
+
+ const SfxType* pType; // SfxPoolItem-Type (Status)
+ const char* pName; // Name of the Slots
+ const char* pMethodName; // Name of the Method if different
+
+ const SfxSlot* pLinkedSlot; // Master-Slot for Enum value
+ const SfxSlot* pNextSlot; // with the same Status-Method
+
+ const SfxFormalArgument* pFirstArgDef; // first formal Argument-Definition
+ sal_uInt16 nArgDefCount; // Number of formal Argumentents
+ long nDisableFlags; // DisableFlags that need to be
+ // present, so that the Slot
+ // can be enabled
+ const char* pUnoName; // UnoName for the Slots
+
+public:
+
+ SfxSlotKind GetKind() const;
+ sal_uInt16 GetSlotId() const;
+ sal_uIntPtr GetHelpId() const;
+ sal_uIntPtr GetMode() const;
+ sal_Bool IsMode( sal_uIntPtr nMode ) const;
+ sal_uInt16 GetGroupId() const;
+ sal_uInt16 GetMasterSlotId() const { return nMasterSlotId; }
+ sal_uInt16 GetWhich( const SfxItemPool &rPool ) const;
+ sal_uInt16 GetValue() const { return nValue; }
+ const SfxType* GetType() const { return pType; }
+ const char* GetUnoName() const { return pUnoName; }
+ SFX2_DLLPUBLIC OString GetCommand() const;
+ SFX2_DLLPUBLIC OUString GetCommandString() const;
+
+ sal_uInt16 GetFormalArgumentCount() const { return nArgDefCount; }
+ const SfxFormalArgument& GetFormalArgument( sal_uInt16 nNo ) const
+ { return pFirstArgDef[nNo]; }
+
+ SfxExecFunc GetExecFnc() const { return fnExec; }
+ SfxStateFunc GetStateFnc() const { return fnState; }
+
+ const SfxSlot* GetLinkedSlot() const { return pLinkedSlot; }
+ const SfxSlot* GetNextSlot() const { return pNextSlot; }
+};
+
+//=========================================================================
+
+// returns the id of the function
+
+inline sal_uInt16 SfxSlot::GetSlotId() const
+{
+ return nSlotId;
+}
+//--------------------------------------------------------------------
+// returns the help-id of the slot
+
+inline sal_uIntPtr SfxSlot::GetHelpId() const
+{
+ return nHelpId;
+}
+
+//--------------------------------------------------------------------
+
+// returns a bitfield with flags
+
+inline sal_uIntPtr SfxSlot::GetMode() const
+{
+ return nFlags;
+}
+//--------------------------------------------------------------------
+
+// determines if the specified mode is assigned
+
+inline sal_Bool SfxSlot::IsMode( sal_uIntPtr nMode ) const
+{
+ return (nFlags & nMode) != 0;
+}
+//--------------------------------------------------------------------
+
+// returns the id of the associated group
+
+inline sal_uInt16 SfxSlot::GetGroupId() const
+{
+ return nGroupId;
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/msgpool.hxx b/include/sfx2/msgpool.hxx
new file mode 100644
index 000000000000..500912ff3f5b
--- /dev/null
+++ b/include/sfx2/msgpool.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 _SFXMSGPOOL_HXX
+#define _SFXMSGPOOL_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+
+#include <sfx2/msg.hxx>
+#include <tools/string.hxx>
+
+#include <string>
+#include <vector>
+
+class SfxInterface;
+class SfxSlot;
+
+typedef std::basic_string< sal_uInt16 > SfxSlotGroupArr_Impl;
+typedef std::vector<SfxInterface*> SfxInterfaceArr_Impl;
+
+class SFX2_DLLPUBLIC SfxSlotPool
+{
+ SfxSlotGroupArr_Impl* _pGroups;
+ SfxSlotPool* _pParentPool;
+ ResMgr* _pResMgr;
+ SfxInterfaceArr_Impl* _pInterfaces;
+ sal_uInt16 _nCurGroup;
+ sal_uInt16 _nCurInterface;
+ sal_uInt16 _nCurMsg;
+
+private:
+ const SfxSlot* SeekSlot( sal_uInt16 nObject );
+
+public:
+ SfxSlotPool( SfxSlotPool* pParent=0, ResMgr* pMgr=0);
+ ~SfxSlotPool();
+
+ void RegisterInterface( SfxInterface& rFace );
+ void ReleaseInterface( SfxInterface& rFace );
+ SfxInterface* FirstInterface();
+
+ static SfxSlotPool& GetSlotPool( SfxViewFrame *pFrame=NULL );
+
+ sal_uInt16 GetGroupCount();
+ String SeekGroup( sal_uInt16 nNo );
+ const SfxSlot* FirstSlot();
+ const SfxSlot* NextSlot();
+ const SfxSlot* GetSlot( sal_uInt16 nId );
+ const SfxSlot* GetUnoSlot( sal_uInt16 nId );
+ const SfxSlot* GetUnoSlot( const String& rUnoName );
+ TypeId GetSlotType( sal_uInt16 nSlotId ) const;
+};
+
+//--------------------------------------------------------------------
+
+// seeks to the first func in the current group
+
+inline const SfxSlot* SfxSlotPool::FirstSlot()
+{
+ return SeekSlot(0);
+}
+
+#define SFX_SLOTPOOL() SfxSlotPool::GetSlotPool()
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/navigat.hxx b/include/sfx2/navigat.hxx
new file mode 100644
index 000000000000..b1cada954d2b
--- /dev/null
+++ b/include/sfx2/navigat.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 _SFXNAVI_HXX
+#define _SFXNAVI_HXX
+
+#include <sfx2/childwin.hxx>
+#include <sfx2/dockwin.hxx>
+
+class SfxNavigatorWrapper : public SfxChildWindow
+{
+
+public:
+ SfxNavigatorWrapper( Window* pParent ,
+ sal_uInt16 nId ,
+ SfxBindings* pBindings ,
+ SfxChildWinInfo* pInfo );
+
+ SFX_DECL_CHILDWINDOW(SfxNavigatorWrapper);
+};
+
+class SfxNavigator : public SfxDockingWindow
+{
+ SfxChildWindow* pWrapper;
+
+public:
+ SfxNavigator( SfxBindings* pBindings ,
+ SfxChildWindow* pChildWin ,
+ Window* pParent ,
+ WinBits nBits );
+
+ virtual void Resize();
+ virtual void Resizing( Size& rSize );
+ virtual sal_Bool Close();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/new.hxx b/include/sfx2/new.hxx
new file mode 100644
index 000000000000..a7534580f1cd
--- /dev/null
+++ b/include/sfx2/new.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 _SFXNEW_HXX
+#define _SFXNEW_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <vcl/button.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
+#include <sfx2/basedlgs.hxx>
+
+//=========================================================================
+
+class SfxObjectShellLock;
+class SfxObjectShell;
+class MoreButton;
+
+//=========================================================================
+
+#define SFXWB_PREVIEW 0x0003
+#define SFXWB_LOAD_TEMPLATE 0x0004
+
+#define SFX_LOAD_TEXT_STYLES 0x0001
+#define SFX_LOAD_FRAME_STYLES 0x0002
+#define SFX_LOAD_PAGE_STYLES 0x0004
+#define SFX_LOAD_NUM_STYLES 0x0008
+#define SFX_MERGE_STYLES 0x0010
+
+#define RET_TEMPLATE_LOAD 100
+
+class SfxNewFileDialog_Impl;
+class SFX2_DLLPUBLIC SfxNewFileDialog : public SfxModalDialog
+{
+ friend class SfxNewFileDialog_Impl;
+
+private:
+ SfxNewFileDialog_Impl* pImpl;
+
+public:
+
+ SfxNewFileDialog(Window *pParent, sal_uInt16 nFlags = 0);
+ ~SfxNewFileDialog();
+
+ // Returns sal_False, when '- No -' is set as Template
+ // Template names can only be obtained when IsTemplate() returns sal_True.
+ sal_Bool IsTemplate() const;
+ String GetTemplateFileName() const;
+
+ // load template methods
+ sal_uInt16 GetTemplateFlags()const;
+ void SetTemplateFlags(sal_uInt16 nSet);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/newstyle.hxx b/include/sfx2/newstyle.hxx
new file mode 100644
index 000000000000..2c7999f9923c
--- /dev/null
+++ b/include/sfx2/newstyle.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 _NEWSTYLE_HXX
+#define _NEWSTYLE_HXX
+
+#include <comphelper/string.hxx>
+#include <sal/config.h>
+#include <sfx2/dllapi.h>
+#include <vcl/button.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/combobox.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/fixed.hxx>
+
+class SfxStyleSheetBasePool;
+
+class SFX2_DLLPUBLIC SfxNewStyleDlg : public ModalDialog
+{
+private:
+ FixedLine aColFL;
+ ComboBox aColBox;
+ OKButton aOKBtn;
+ CancelButton aCancelBtn;
+
+ QueryBox aQueryOverwriteBox;
+ SfxStyleSheetBasePool& rPool;
+
+ DECL_DLLPRIVATE_LINK( OKHdl, Control * );
+ DECL_DLLPRIVATE_LINK( ModifyHdl, ComboBox * );
+
+public:
+ SfxNewStyleDlg( Window* pParent, SfxStyleSheetBasePool& );
+ ~SfxNewStyleDlg();
+
+ String GetName() const { return comphelper::string::stripStart(aColBox.GetText(), ' '); }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/objface.hxx b/include/sfx2/objface.hxx
new file mode 100644
index 000000000000..8e1f772e3791
--- /dev/null
+++ b/include/sfx2/objface.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 _SFXOBJFACE_HXX
+#define _SFXOBJFACE_HXX
+
+#include "sal/config.h"
+
+#include "rtl/ustring.hxx"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <tools/string.hxx>
+#include <tools/resid.hxx>
+
+#include <sfx2/msg.hxx>
+
+struct SfxFormalArgument;
+struct SfxInterface_Impl;
+class SfxConfigItem;
+class SfxModule;
+class SvStream;
+
+class SFX2_DLLPUBLIC SfxInterface
+{
+friend class SfxSlotPool;
+
+ const char* pName; // Sfx-internal name of interface
+ const SfxInterface* pGenoType; // base interface
+ SfxSlot* pSlots; // SlotMap
+ sal_uInt16 nCount; // number of slots in SlotMap
+ SfxInterfaceId nClassId; // Id of interface
+ ResId aNameResId; // ResId of external interface name
+ SfxInterface_Impl* pImpData;
+
+ SfxSlot* operator[]( sal_uInt16 nPos ) const;
+
+public:
+ SfxInterface( const char *pClass,
+ const ResId& rResId,
+ SfxInterfaceId nClassId,
+ const SfxInterface* pGeno,
+ SfxSlot &rMessages, sal_uInt16 nMsgCount );
+ virtual ~SfxInterface();
+
+ void SetSlotMap( SfxSlot& rMessages, sal_uInt16 nMsgCount );
+ inline sal_uInt16 Count() const;
+
+ const SfxSlot* GetRealSlot( const SfxSlot * ) const;
+ const SfxSlot* GetRealSlot( sal_uInt16 nSlotId ) const;
+ virtual const SfxSlot* GetSlot( sal_uInt16 nSlotId ) const;
+ const SfxSlot* GetSlot( const String& rCommand ) const;
+
+ const char* GetClassName() const { return pName; }
+ bool HasName() const { return 0 != aNameResId.GetId(); }
+ OUString GetName() const
+ { return HasName() ? aNameResId.toString() : OUString(); }
+ ResMgr* GetResMgr() const
+ { return aNameResId.GetResMgr(); }
+
+ const SfxInterface* GetGenoType() const { return pGenoType; }
+ const SfxInterface* GetRealInterfaceForSlot( const SfxSlot* ) const;
+
+ void RegisterObjectBar( sal_uInt16, const ResId&, const String* pST=0 );
+ void RegisterObjectBar( sal_uInt16, const ResId&, sal_uInt32 nFeature, const String* pST=0 );
+ void RegisterChildWindow( sal_uInt16, sal_Bool bContext, const String* pST=0 );
+ void RegisterChildWindow( sal_uInt16, sal_Bool bContext, sal_uInt32 nFeature, const String* pST=0 );
+ void RegisterStatusBar( const ResId& );
+ const ResId& GetObjectBarResId( sal_uInt16 nNo ) const;
+ sal_uInt16 GetObjectBarPos( sal_uInt16 nNo ) const;
+ sal_uInt32 GetObjectBarFeature( sal_uInt16 nNo ) const;
+ sal_uInt16 GetObjectBarCount() const;
+ void SetObjectBarPos( sal_uInt16 nPos, sal_uInt16 nId );
+ const String* GetObjectBarName( sal_uInt16 nNo ) const;
+ sal_Bool IsObjectBarVisible( sal_uInt16 nNo) const;
+ sal_uInt32 GetChildWindowFeature( sal_uInt16 nNo ) const;
+ sal_uInt32 GetChildWindowId( sal_uInt16 nNo ) const;
+ sal_uInt16 GetChildWindowCount() const;
+ void RegisterPopupMenu( const ResId& );
+ const ResId& GetPopupMenuResId() const;
+ const ResId& GetStatusBarResId() const;
+
+ void Register( SfxModule* );
+
+ SAL_DLLPRIVATE int ContainsSlot_Impl( const SfxSlot *pSlot ) const
+ { return pSlot >= pSlots && pSlot < pSlots + Count(); }
+ SAL_DLLPRIVATE ResMgr* GetResManager_Impl() const
+ { return aNameResId.GetResMgr(); }
+};
+
+//--------------------------------------------------------------------
+
+// returns the number of functions in this cluster
+
+inline sal_uInt16 SfxInterface::Count() const
+{
+ return nCount;
+}
+
+//--------------------------------------------------------------------
+
+// returns a function by position in the array
+
+inline SfxSlot* SfxInterface::operator[]( sal_uInt16 nPos ) const
+{
+ return nPos < nCount? pSlots+nPos: 0;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/objitem.hxx b/include/sfx2/objitem.hxx
new file mode 100644
index 000000000000..8e607c9f0ce5
--- /dev/null
+++ b/include/sfx2/objitem.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 _SFX_OBJITEM_HXX
+#define _SFX_OBJITEM_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <svl/poolitem.hxx>
+
+#include <sfx2/shell.hxx>
+
+//------------------------------------------------------------------------
+
+class SFX2_DLLPUBLIC SfxObjectItem: public SfxPoolItem
+{
+ SfxShell* _pSh;
+
+public:
+ TYPEINFO();
+ SfxObjectItem( sal_uInt16 nWhich=0, SfxShell *pSh=0 );
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+ SfxShell* GetShell() const
+ { return _pSh; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
new file mode 100644
index 000000000000..4c366a56710f
--- /dev/null
+++ b/include/sfx2/objsh.hxx
@@ -0,0 +1,824 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFX_OBJSH_HXX
+#define _SFX_OBJSH_HXX
+
+#include <config_features.h>
+
+#include "sal/config.h"
+
+#include "tools/solar.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/script/XLibraryContainer.hpp>
+#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/security/DocumentSignatureInformation.hpp>
+#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <boost/shared_ptr.hpp>
+
+//________________________________________________________________________________________________________________
+// include something else
+//________________________________________________________________________________________________________________
+
+#include <vcl/timer.hxx>
+#include <svl/poolitem.hxx>
+#include <vcl/bitmap.hxx>
+#include <sot/storage.hxx>
+#include <rsc/rscsfx.hxx>
+
+#include <sfx2/XmlIdRegistry.hxx>
+#include <sfx2/shell.hxx>
+#include <comphelper/embeddedobjectcontainer.hxx>
+#include <com/sun/star/frame/XModel.hpp>
+
+class SbxValue;
+class SvxMacro;
+class SbxArray;
+class BasicManager;
+class SfxMedium;
+class SfxObjectFactory;
+class SfxDocumentInfoDialog;
+class SfxStyleSheetBasePool;
+class INote;
+class SfxStyleSheetPool;
+class SfxFrame;
+class SbMethod;
+class StarBASIC;
+class Printer;
+class SvKeyValueIterator;
+class SfxBaseModel;
+class SfxModule;
+class SvData;
+class SfxProgress;
+class GDIMetaFile;
+class Bitmap;
+class INetURLObject;
+class IndexBitSet;
+class JobSetup;
+class Size;
+class Point;
+
+// From embobj.hxx
+#define ASPECT_CONTENT 1
+#define ASPECT_THUMBNAIL 2 /* 120 * 120, 6 Colors DIB in MetaFile */
+#define ASPECT_ICON 4
+#define ASPECT_DOCPRINT 8
+#define ASPECT_ALL (ASPECT_CONTENT | ASPECT_THUMBNAIL | ASPECT_ICON | ASPECT_DOCPRINT)
+
+// from pseudo.hxx; must be the same as in OLE2
+#define SVOBJ_MISCSTATUS_SERVERRESIZE 1
+#define SVOBJ_MISCSTATUS_NOTREPLACE 4
+#define SVOBJ_MISCSTATUS_CANTLINKINSIDE 16
+#define SVOBJ_MISCSTATUS_LINK 64
+#define SVOBJ_MISCSTATUS_INSIDEOUT 128
+#define SVOBJ_MISCSTATUS_ACTIVATEWHENVISIBLE 256
+#define SVOBJ_MISCSTATUS_NOTRESIZEABLE 512
+#define SVOBJ_MISCSTATUS_ALWAYSACTIVATE 1024
+#define SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE 2048
+#define SVOBJ_MISCSTATUS_SPECIALOBJECT 4096
+
+
+namespace sfx2
+{
+ class SvLinkSource;
+}
+
+namespace com { namespace sun { namespace star { namespace datatransfer { class XTransferable; } } } }
+
+namespace com { namespace sun { namespace star {
+ namespace document {
+ class XDocumentProperties;
+ }
+ namespace lang {
+ class XComponent;
+ }
+} } }
+
+typedef sal_uInt32 SfxObjectShellFlags;
+#define SFXOBJECTSHELL_HASOPENDOC 0x01L
+#define SFXOBJECTSHELL_DONTREPLACE 0x02L
+#define SFXOBJECTSHELL_HASMENU 0x04L
+#define SFXOBJECTSHELL_DONTLOADFILTERS 0x08L
+#define SFXOBJECTSHELL_DONTCLOSE 0x10L
+#define SFXOBJECTSHELL_NODOCINFO 0x20L
+#define SFXOBJECTSHELL_STD_NORMAL ( SFXOBJECTSHELL_HASOPENDOC )
+#define SFXOBJECTSHELL_STD_SPECIAL ( SFXOBJECTSHELL_DONTLOADFILTERS )
+#define SFXOBJECTSHELL_UNDEFINED 0xf000000
+
+//--------------------------------------------------------------------
+
+#define SFX_TITLE_TITLE 0
+#define SFX_TITLE_FILENAME 1
+#define SFX_TITLE_FULLNAME 2
+#define SFX_TITLE_APINAME 3
+#define SFX_TITLE_DETECT 4
+#define SFX_TITLE_CAPTION 5
+#define SFX_TITLE_PICKLIST 6
+#define SFX_TITLE_HISTORY 7
+#define SFX_TITLE_MAXLEN 10 // this gives the limits on length
+
+#define SFX_LOADED_MAINDOCUMENT 1
+#define SFX_LOADED_IMAGES 2
+#define SFX_LOADED_ALL 3
+
+//--------------------------------------------------------------------
+
+#define HIDDENINFORMATION_RECORDEDCHANGES 0x0001
+#define HIDDENINFORMATION_NOTES 0x0002
+#define HIDDENINFORMATION_DOCUMENTVERSIONS 0x0004
+
+enum HiddenWarningFact
+{
+ WhenSaving = 0,
+ WhenPrinting,
+ WhenSigning,
+ WhenCreatingPDF
+};
+
+//--------------------------------------------------------------------
+
+enum SfxObjectCreateMode
+{
+ SFX_CREATE_MODE_EMBEDDED,
+ SFX_CREATE_MODE_STANDARD,
+ SFX_CREATE_MODE_PREVIEW,
+ SFX_CREATE_MODE_ORGANIZER,
+ SFX_CREATE_MODE_PLUGIN,
+ SFX_CREATE_MODE_INTERNAL
+};
+
+/*====================================================================
+
+The class SfxObjectShell is the base class for SFx-objects, ie documents
+and parts of documents that can be integrated as separate objects
+into foreign objects.
+
+----------------------------------------------------------------------*/
+
+class SfxToolBoxConfig;
+struct TransferableObjectDescriptor;
+
+class SFX2_DLLPUBLIC SfxObjectShell :
+ public SfxShell, virtual public SotObject,
+ public ::comphelper::IEmbeddedHelper, public ::sfx2::IXmlIdRegistrySupplier
+{
+friend struct ModifyBlocker_Impl;
+friend class SfxObjectShellLock;
+
+private:
+ struct SfxObjectShell_Impl* pImp; // internal data
+
+ SfxMedium * pMedium; // Description of the file for example
+ // storage that contains the object
+ SfxStyleSheetBasePool* pStyleSheetPool; // StyleSheets
+ SfxObjectCreateMode eCreateMode; // Purpose of the object
+ sal_Bool bHasName :1, // sal_True := existing object,
+ // sal_False := new object
+ bIsTmp :1; // temporary Storage
+
+private:
+ SAL_DLLPRIVATE void UpdateTime_Impl(const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties> & i_xDocProps);
+
+ SAL_DLLPRIVATE sal_Bool SaveTo_Impl(SfxMedium &rMedium, const SfxItemSet* pSet );
+
+protected:
+ SfxObjectShell(SfxObjectCreateMode);
+ SfxObjectShell( const sal_uInt64 i_nCreationFlags ); // see sfxmodelfactory.hxx
+ virtual ~SfxObjectShell();
+
+ virtual void ModifyChanged();
+ virtual sal_Bool Close();
+
+ /** declares the document to have capabilities to contain basic/dialog libraries
+ */
+ void SetHasNoBasic();
+
+ /// template method, called by FlushDocInfo; this implementation is empty
+ virtual void DoFlushDocInfo();
+
+ // helper method
+ void AddToRecentlyUsedList();
+
+public:
+ TYPEINFO();
+ SFX_DECL_INTERFACE(SFX_INTERFACE_SFXDOCSH)
+
+ static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
+ /* Stampit disable/enable cancel button for print jobs
+ default = true = enable! */
+ void Stamp_SetPrintCancelState(sal_Bool bState);
+ sal_Bool Stamp_GetPrintCancelState() const;
+
+ using SotObject::GetInterface;
+
+ // Document-Shell Iterator
+ static SfxObjectShell* GetFirst( const TypeId* pType = 0,
+ sal_Bool bOnlyVisible = sal_True );
+ static SfxObjectShell* GetNext( const SfxObjectShell& rPrev,
+ const TypeId* pType = 0,
+ sal_Bool bOnlyVisible = sal_True );
+ static SfxObjectShell* Current();
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ GetCurrentComponent();
+ static void SetCurrentComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
+
+ virtual void Invalidate(sal_uInt16 nId = 0);
+
+ SfxObjectShellFlags GetFlags( ) const ;
+
+ SfxModule* GetModule() const;
+
+ virtual SfxObjectFactory& GetFactory() const=0;
+ SfxMedium * GetMedium() const { return pMedium; }
+ void ForgetMedium() { pMedium = 0; }
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties > getDocProperties();
+ void UpdateDocInfoForSave( );
+ void FlushDocInfo();
+ sal_Bool HasName() const { return bHasName; }
+ virtual String GetAPIName() const;
+ void SetReadOnly();
+ sal_Bool IsReadOnly() const;
+ sal_Bool IsReadOnlyMedium() const;
+ bool IsOriginallyReadOnlyMedium() const;
+ void SetReadOnlyUI( sal_Bool bReadOnly = sal_True );
+ sal_Bool IsReadOnlyUI() const;
+ void SetNoName();
+ sal_Bool IsInModalMode() const;
+ sal_Bool IsInPrepareClose() const;
+ virtual sal_Bool AcceptStateUpdate() const;
+ sal_Bool IsHelpDocument() const;
+
+#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
+ sal_Bool IsDocShared() const;
+ OUString GetSharedFileURL() const;
+ sal_Bool SwitchToShared( sal_Bool bShared, sal_Bool bSave );
+ SAL_DLLPRIVATE void FreeSharedFile();
+ SAL_DLLPRIVATE void FreeSharedFile( const OUString& aTempFileURL );
+ SAL_DLLPRIVATE void DoNotCleanShareControlFile();
+ void SetSharedXMLFlag( sal_Bool bFlag ) const;
+ sal_Bool HasSharedXMLFlagSet() const;
+#else
+ sal_Bool IsDocShared() const
+ { return sal_False; };
+ OUString GetSharedFileURL() const
+ { return OUString(); };
+#endif
+
+ SAL_DLLPRIVATE void SetModalMode_Impl(sal_Bool bModal=sal_True);
+ SAL_DLLPRIVATE void SetMacroMode_Impl(sal_Bool bModal=sal_True);
+
+ void ResetError();
+ sal_uInt32 GetError() const;
+ sal_uInt32 GetErrorCode() const;
+ void SetError( sal_uInt32 rErr, const OUString& aLogMessage );
+
+ void AddLog( const OUString& aMessage );
+ void StoreLog();
+
+ /**
+ * Initialize bare minimum just enough for unit test runs.
+ *
+ * @return true if the initialization is successful, false otherwise.
+ */
+ bool DoInitUnitTest();
+ sal_Bool DoInitNew( SfxMedium* pMedium=0 );
+ sal_Bool DoLoad( SfxMedium* pMedium );
+ bool DoLoadExternal( SfxMedium* pMed );
+ sal_Bool DoSave();
+ sal_Bool DoSaveAs( SfxMedium &rNewStor );
+ sal_Bool DoSaveObjectAs( SfxMedium &rNewStor, sal_Bool bCommit );
+
+ // TODO/LATER: currently only overloaded in Calc, should be made non-virtual
+ virtual sal_Bool DoSaveCompleted( SfxMedium* pNewStor=0 );
+
+ virtual sal_Bool LoadOwnFormat( SfxMedium& pMedium );
+ virtual sal_Bool SaveAsOwnFormat( SfxMedium& pMedium );
+ virtual sal_Bool ConvertFrom( SfxMedium &rMedium );
+ virtual sal_Bool ConvertTo( SfxMedium &rMedium );
+ virtual sal_Bool InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
+ virtual sal_Bool Load( SfxMedium &rMedium );
+ virtual sal_Bool LoadFrom( SfxMedium& rMedium );
+ virtual sal_Bool Save();
+ virtual sal_Bool SaveAs( SfxMedium &rMedium );
+ virtual sal_Bool SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
+ virtual sal_Bool SwitchPersistance(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
+ virtual void UpdateLinks();
+ virtual bool LoadExternal( SfxMedium& rMedium );
+ /**
+ * Called when the Options dialog is dismissed with the OK button, to
+ * handle potentially conflicting option settings.
+ */
+ virtual void CheckConfigOptions();
+ sal_Bool IsConfigOptionsChecked() const;
+ void SetConfigOptionsChecked( sal_Bool bChecked );
+
+ // called for a few slots like SID_SAVE[AS]DOC, SID_PRINTDOC[DIRECT], derived classes may abort the action
+ virtual sal_Bool QuerySlotExecutable( sal_uInt16 nSlotId );
+
+ sal_Bool SaveChildren(sal_Bool bObjectsOnly=sal_False);
+ sal_Bool SaveAsChildren( SfxMedium &rMedium );
+ sal_Bool SwitchChildrenPersistance(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ sal_Bool bForceNonModified = sal_False );
+ sal_Bool SaveCompletedChildren( sal_Bool bSuccess );
+
+ virtual sal_Bool ImportFrom( SfxMedium &rMedium, bool bInsert );
+ sal_Bool ExportTo( SfxMedium &rMedium );
+
+ // xmlsec05, check with SFX team
+ sal_uInt16 GetDocumentSignatureState();
+ void SignDocumentContent();
+ sal_uInt16 GetScriptingSignatureState();
+ void SignScriptingContent();
+
+ virtual SfxDocumentInfoDialog* CreateDocumentInfoDialog(
+ Window *pParent, const SfxItemSet& );
+
+ ErrCode CallBasic( const String& rMacro, const String& rBasicName,
+ SbxArray* pArgs = 0, SbxValue* pRet = 0 );
+
+ ErrCode CallXScript(
+ const String& rScriptURL,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams,
+ ::com::sun::star::uno::Any& aRet,
+ ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam,
+ bool bRaiseError = true,
+ const ::com::sun::star::uno::Any* aCaller = 0 );
+
+ static ErrCode CallXScript(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxScriptContext,
+ const OUString& rScriptURL,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams,
+ ::com::sun::star::uno::Any& aRet,
+ ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam,
+ bool bRaiseError = true,
+ const ::com::sun::star::uno::Any* aCaller = 0
+ );
+
+ /** adjusts the internal macro mode, according to the current security settings
+
+ Finally, the macro mode is either NEVER_EXECUTE or ALWAYS_EXECUTE_NO_WARN.
+
+ @return
+ whether macros from this document should be executed
+ */
+ bool AdjustMacroMode( const String& rScriptType, bool _bSuppressUI = false );
+
+ SvKeyValueIterator* GetHeaderAttributes();
+ void ClearHeaderAttributesForSourceViewHack();
+ void SetHeaderAttributesForSourceViewHack();
+
+ sal_Bool IsTemplate() const;
+
+ sal_Bool IsQueryLoadTemplate() const;
+ sal_Bool IsUseUserData() const;
+ sal_Bool IsLoadReadonly() const;
+ sal_Bool IsSaveVersionOnClose() const;
+ void SetQueryLoadTemplate( sal_Bool b );
+ void SetUseUserData( sal_Bool bNew );
+ void SetLoadReadonly( sal_Bool _bReadonly );
+ void SetSaveVersionOnClose( sal_Bool bSet );
+ void ResetFromTemplate( const String& rTemplateName, const String& rFileName );
+
+ // TODO/LATER: the following two methods should be replaced by Get/SetModifPasswordInfo in future
+ sal_uInt32 GetModifyPasswordHash() const;
+ sal_Bool SetModifyPasswordHash( sal_uInt32 nHash );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetModifyPasswordInfo() const;
+ sal_Bool SetModifyPasswordInfo( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aInfo );
+
+ static sal_uInt32 HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDoc );
+
+ virtual void ViewAssigned();
+ virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual sal_Bool IsInformationLost();
+ virtual sal_uInt16 GetHiddenInformationState( sal_uInt16 nStates );
+ sal_Int16 QueryHiddenInformation( HiddenWarningFact eFact, Window* pParent );
+ virtual sal_Bool HasSecurityOptOpenReadOnly() const;
+ sal_Bool IsSecurityOptOpenReadOnly() const;
+ void SetSecurityOptOpenReadOnly( sal_Bool bOpenReadOnly = sal_True );
+
+ virtual Size GetFirstPageSize();
+ virtual sal_Bool DoClose();
+ virtual void PrepareReload();
+ virtual ::boost::shared_ptr<GDIMetaFile> GetPreviewMetaFile( sal_Bool bFullContent = sal_False ) const;
+ virtual void CancelTransfers();
+
+ sal_Bool GenerateAndStoreThumbnail(
+ sal_Bool bEncrypted,
+ sal_Bool bSigned,
+ sal_Bool bIsTemplate,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStor );
+
+ sal_Bool WriteThumbnail(
+ sal_Bool bEncrypted,
+ sal_Bool bSigned,
+ sal_Bool bIsTemplate,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream );
+
+ // Transfer IFace
+ void AbortImport();
+ sal_Bool IsAbortingImport() const;
+ sal_Bool IsReloading() const;
+ void FinishedLoading( sal_uInt16 nWhich = SFX_LOADED_ALL );
+ void TemplateDisconnectionAfterLoad();
+ sal_Bool IsLoading() const;
+ sal_Bool IsLoadingFinished() const;
+ void SetAutoLoad( const INetURLObject&, sal_uInt32 nTime, sal_Bool bReload = sal_True );
+ sal_Bool IsAutoLoadLocked() const;
+ void NotifyReloadAvailable();
+
+ // Misc
+ sal_Bool IsPreview() const;
+ SfxObjectCreateMode GetCreateMode() const { return eCreateMode; }
+ SfxProgress* GetProgress() const;
+ void SetWaitCursor( sal_Bool bSet ) const;
+
+ // Naming Interface
+ void SetTitle( const String& rTitle );
+ String GetTitle( sal_uInt16 nMaxLen = 0 ) const;
+ void InvalidateName(); // Re-set to unnamed
+
+ // DDE-Interface
+ virtual long DdeExecute( const String& rCmd );
+ virtual long DdeGetData( const String& rItem,
+ const String& rMimeType,
+ ::com::sun::star::uno::Any & rValue );
+ virtual long DdeSetData( const String& rItem,
+ const String& rMimeType,
+ const ::com::sun::star::uno::Any & rValue );
+ virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem );
+ virtual void ReconnectDdeLink(SfxObjectShell& rServer);
+
+ static void ReconnectDdeLinks(SfxObjectShell& rServer);
+
+ // Contents
+ virtual SfxStyleSheetBasePool* GetStyleSheetPool();
+ void SetStyleSheetPool(SfxStyleSheetBasePool *pBasePool ) {
+ pStyleSheetPool = pBasePool; }
+
+ // Determine the position of the "Automatic" filter in the stylist
+ void SetAutoStyleFilterIndex(sal_uInt16 nSet);
+ sal_uInt16 GetAutoStyleFilterIndex();
+ virtual sal_Bool HasBasic() const;
+ BasicManager* GetBasicManager() const;
+ com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer >
+ GetBasicContainer();
+ com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer >
+ GetDialogContainer();
+ StarBASIC* GetBasic() const;
+
+ // Interface Document content, Organizer
+#define INDEX_IGNORE USHRT_MAX
+
+#define CONTENT_STYLE 0
+#define CONTENT_CONFIG 1
+#define CONTENT_MACRO 2
+#define DEF_CONTENT_COUNT 1
+
+
+ virtual void SetOrganizerSearchMask(
+ SfxStyleSheetBasePool* ) const;
+
+ virtual sal_Bool CanHaveChildren(
+ sal_uInt16 nIdx1,
+ sal_uInt16 nIdx2 = INDEX_IGNORE
+ );
+
+ virtual void GetContent( String &,
+ Bitmap &rClosedBitmap,
+ Bitmap &rOpenedBitmap,
+ sal_Bool &bCanDelete,
+ sal_uInt16 nPos,
+ sal_uInt16 nIdx1
+ );
+
+ virtual Bitmap GetStyleFamilyBitmap(SfxStyleFamily eFamily);
+
+ virtual sal_Bool Insert( SfxObjectShell &rSource,
+ sal_uInt16 nSourceIdx1,
+ sal_uInt16 nSourceIdx2,
+ sal_uInt16 nSourceIdx3,
+ sal_uInt16 &nIdx1,
+ sal_uInt16 &nIdx2,
+ sal_uInt16 &nIdx3,
+ sal_uInt16 &rIdxDeleted);
+
+ virtual sal_Bool Remove( sal_uInt16 nIdx1,
+ sal_uInt16 nIdx2 = INDEX_IGNORE,
+ sal_uInt16 nIdx3 = INDEX_IGNORE);
+
+ virtual void LoadStyles( SfxObjectShell &rSource );
+ void ReadNote( INote * );
+ void UpdateNote( INote * );
+
+ // Documents, for which to format the view size
+
+ virtual SfxObjectShell* GetObjectShell();
+
+ virtual SfxFrame* GetSmartSelf( SfxFrame* pSelf, SfxMedium& rMedium );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
+ GetModel() const;
+ // Only temporarily for the applications!
+ void SetBaseModel( SfxBaseModel* pModel );
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetBaseModel() const;
+ // Only temporarily for the applications!
+
+ virtual ::com::sun::star::uno::Sequence< OUString > GetEventNames();
+
+ Window* GetDialogParent( SfxMedium* pMedium=0 );
+ static SfxObjectShell* CreateObject( const String& rServiceName, SfxObjectCreateMode = SFX_CREATE_MODE_STANDARD );
+ static SfxObjectShell* CreateObjectByFactoryName( const String& rURL, SfxObjectCreateMode = SFX_CREATE_MODE_STANDARD );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
+ CreateAndLoadComponent( const SfxItemSet& rSet, SfxFrame* pFrame = NULL );
+ static SfxObjectShell* GetShellFromComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xComp );
+ static String GetServiceNameFromFactory( const String& rFact );
+ sal_Bool IsInPlaceActive();
+ sal_Bool IsUIActive();
+ virtual void InPlaceActivate( sal_Bool );
+ virtual void UIActivate( sal_Bool );
+
+ static sal_Bool CopyStoragesOfUnknownMediaType(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xSource,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xTarget );
+
+ // ==== The functions from SvPersist
+ void EnableSetModified( sal_Bool bEnable = sal_True );
+ sal_Bool IsEnableSetModified() const;
+ virtual void SetModified( sal_Bool bModified = sal_True );
+ sal_Bool IsModified();
+
+ /**
+ * @param bChart true if the file is a chart doc and FillClass should not be called
+ */
+ void SetupStorage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ sal_Int32 nVersion, sal_Bool bTemplate, bool bChart = false ) const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetStorage();
+
+ SvGlobalName GetClassName() const;
+
+ // comphelper::IEmbeddedHelper
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > getInteractionHandler() const;
+ virtual com::sun::star::uno::Reference < com::sun::star::embed::XStorage > getStorage() const
+ {
+ return const_cast<SfxObjectShell*>(this)->GetStorage();
+ }
+ virtual comphelper::EmbeddedObjectContainer& getEmbeddedObjectContainer() const
+ {
+ return GetEmbeddedObjectContainer();
+ }
+ bool isEnableSetModified() const
+ {
+ return IsEnableSetModified();
+ }
+ comphelper::EmbeddedObjectContainer& GetEmbeddedObjectContainer() const;
+ void ClearEmbeddedObjects();
+
+ // ==== The functions from SvEmbeddedObject
+ virtual Printer * GetDocumentPrinter();
+ virtual OutputDevice* GetDocumentRefDev();
+ virtual void OnDocumentPrinterChanged( Printer * pNewPrinter );
+ virtual Rectangle GetVisArea( sal_uInt16 nAspect ) const;
+ virtual void SetVisArea( const Rectangle & rVisArea );
+ const Rectangle & GetVisArea() const;
+ void SetVisAreaSize( const Size & rVisSize );
+ virtual sal_uIntPtr GetMiscStatus() const;
+
+ MapUnit GetMapUnit() const;
+ void SetMapUnit( MapUnit nMUnit );
+
+ void FillTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc ) const;
+ void DoDraw( OutputDevice *, const Point & rObjPos,
+ const Size & rSize,
+ const JobSetup & rSetup,
+ sal_uInt16 nAspect = ASPECT_CONTENT );
+ virtual void Draw( OutputDevice *, const JobSetup & rSetup,
+ sal_uInt16 nAspect = ASPECT_CONTENT ) = 0;
+
+
+ virtual void FillClass( SvGlobalName * pClassName,
+ sal_uInt32 * pFormat,
+ OUString * pAppName,
+ OUString * pFullTypeName,
+ OUString * pShortTypeName,
+ sal_Int32 nVersion,
+ sal_Bool bTemplate = sal_False) const = 0;
+
+ // change recording and respective passwword protection for Writer and Calc
+ // slots available for Writer: FN_REDLINE_ON, FN_REDLINE_ON
+ // slots used for Calc: FID_CHG_RECORD, SID_CHG_PROTECT
+ virtual bool IsChangeRecording() const;
+ virtual bool HasChangeRecordProtection() const;
+ virtual void SetChangeRecording( bool bActivate );
+ virtual bool SetProtectionPassword( const String &rPassword );
+ virtual bool GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash );
+
+ // =================================
+
+ SAL_DLLPRIVATE ::boost::shared_ptr<GDIMetaFile> CreatePreviewMetaFile_Impl( sal_Bool bFullContent ) const;
+
+ SAL_DLLPRIVATE sal_Bool IsOwnStorageFormat_Impl(const SfxMedium &) const;
+
+ SAL_DLLPRIVATE sal_Bool IsPackageStorageFormat_Impl(const SfxMedium &) const;
+
+ SAL_DLLPRIVATE sal_Bool ConnectTmpStorage_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, SfxMedium* pMedium );
+ SAL_DLLPRIVATE sal_Bool DisconnectStorage_Impl( SfxMedium& rSrcMedium, SfxMedium& rTargetMedium );
+
+ SAL_DLLPRIVATE sal_Bool PutURLContentsToVersionStream_Impl(
+ OUString aURL,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDocStorage,
+ OUString aStreamName );
+
+ SAL_DLLPRIVATE OUString CreateTempCopyOfStorage_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
+
+ SAL_DLLPRIVATE void InitOwnModel_Impl();
+ SAL_DLLPRIVATE void BreakMacroSign_Impl( sal_Bool bBreakMacroSing );
+ SAL_DLLPRIVATE void CheckSecurityOnLoading_Impl();
+ SAL_DLLPRIVATE void CheckForBrokenDocSignatures_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler );
+ SAL_DLLPRIVATE sal_uInt16 ImplCheckSignaturesInformation(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation >& aInfos );
+ SAL_DLLPRIVATE void CheckEncryption_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler );
+ SAL_DLLPRIVATE void SetModifyPasswordEntered( sal_Bool bEntered = sal_True );
+ SAL_DLLPRIVATE sal_Bool IsModifyPasswordEntered();
+
+ SAL_DLLPRIVATE void InitBasicManager_Impl();
+ SAL_DLLPRIVATE SfxObjectShell_Impl* Get_Impl() { return pImp; }
+
+ SAL_DLLPRIVATE static sal_Bool UseInteractionToHandleError(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler,
+ sal_uInt32 nError );
+ SAL_DLLPRIVATE const SfxObjectShell_Impl* Get_Impl() const { return pImp; }
+
+ SAL_DLLPRIVATE void SetCreateMode_Impl( SfxObjectCreateMode nMode );
+
+ SAL_DLLPRIVATE void DoDraw_Impl( OutputDevice* pDev,
+ const Point & rViewPos,
+ const Fraction & rScaleX,
+ const Fraction & rScaleY,
+ const JobSetup & rSetup,
+ sal_uInt16 nAspect );
+
+ // Shell Interface
+ SAL_DLLPRIVATE void ExecFile_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void GetState_Impl(SfxItemSet&);
+ SAL_DLLPRIVATE void PrintExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void PrintState_Impl(SfxItemSet&);
+ SAL_DLLPRIVATE void ExecProps_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void StateProps_Impl(SfxItemSet &);
+ SAL_DLLPRIVATE void ExecView_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void StateView_Impl(SfxItemSet &);
+
+ // Load/Save public internals
+ SAL_DLLPRIVATE sal_Bool ImportFromGeneratedStream_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr );
+ SAL_DLLPRIVATE void PositionView_Impl();
+ SAL_DLLPRIVATE void UpdateFromTemplate_Impl();
+ SAL_DLLPRIVATE sal_Bool CanReload_Impl();
+ SAL_DLLPRIVATE void SetNamedVisibility_Impl();
+ SAL_DLLPRIVATE sal_Bool DoSave_Impl( const SfxItemSet* pSet=0 );
+ SAL_DLLPRIVATE sal_Bool Save_Impl( const SfxItemSet* pSet=0 );
+ SAL_DLLPRIVATE sal_Bool PreDoSaveAs_Impl(const String &rFileName, const String &rFiltName, SfxItemSet *);
+ SAL_DLLPRIVATE sal_Bool APISaveAs_Impl ( const String& aFileName, SfxItemSet* aParams );
+ SAL_DLLPRIVATE sal_Bool CommonSaveAs_Impl ( const INetURLObject& aURL, const String& aFilterName, SfxItemSet* aParams );
+ SAL_DLLPRIVATE sal_Bool GeneralInit_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ sal_Bool bTypeMustBeSetAlready );
+ SAL_DLLPRIVATE void PrepareSecondTryLoad_Impl();
+ SAL_DLLPRIVATE void SetInitialized_Impl( const bool i_fromInitNew );
+
+ // public-internals
+ SAL_DLLPRIVATE IndexBitSet& GetNoSet_Impl();
+ SAL_DLLPRIVATE void SetProgress_Impl( SfxProgress *pProgress );
+ SAL_DLLPRIVATE void PostActivateEvent_Impl( SfxViewFrame* );
+ SAL_DLLPRIVATE void SetActivateEvent_Impl(sal_uInt16 );
+ SAL_DLLPRIVATE SfxObjectShell* GetParentShellByModel_Impl();
+
+ // configuration items
+ SAL_DLLPRIVATE SfxToolBoxConfig* GetToolBoxConfig_Impl();
+ SAL_DLLPRIVATE sal_uInt16 ImplGetSignatureState( sal_Bool bScriptingContent = sal_False );
+
+ SAL_DLLPRIVATE ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation >
+ ImplAnalyzeSignature(
+ sal_Bool bScriptingContent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >& xSigner
+ = ::com::sun::star::uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >() );
+
+ SAL_DLLPRIVATE void ImplSign( sal_Bool bScriptingContent = sal_False );
+ SAL_DLLPRIVATE sal_Bool QuerySaveSizeExceededModules_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler );
+
+ SAL_DLLPRIVATE void CheckOut( );
+ SAL_DLLPRIVATE void CancelCheckOut( );
+ SAL_DLLPRIVATE void CheckIn( );
+};
+
+#define SFX_GLOBAL_CLASSID \
+ 0x9eaba5c3, 0xb232, 0x4309, \
+ 0x84, 0x5f, 0x5f, 0x15, 0xea, 0x50, 0xd0, 0x74
+
+ struct ModifyBlocker_Impl
+ {
+ SfxObjectShell* pPersist;
+ sal_Bool bWasEnabled;
+ ModifyBlocker_Impl( SfxObjectShell* pPersistP ) : pPersist( pPersistP )
+ {
+ bWasEnabled = pPersistP->IsEnableSetModified();
+ if ( bWasEnabled )
+ pPersistP->EnableSetModified( sal_False );
+ }
+ ~ModifyBlocker_Impl()
+ {
+ if ( bWasEnabled )
+ pPersist->EnableSetModified( bWasEnabled );
+ }
+ };
+
+
+//--------------------------------------------------------------------
+#ifndef SFX_DECL_OBJECTSHELL_DEFINED
+#define SFX_DECL_OBJECTSHELL_DEFINED
+SV_DECL_REF(SfxObjectShell)
+#endif
+SV_DECL_LOCK(SfxObjectShell)
+SV_IMPL_LOCK(SfxObjectShell)
+SV_IMPL_REF(SfxObjectShell)
+
+//--------------------------------------------------------------------
+class AutoReloadTimer_Impl : public Timer
+{
+ String aUrl;
+ SfxObjectShell* pObjSh;
+
+public:
+ AutoReloadTimer_Impl( const String& rURL, sal_uInt32 nTime,
+ SfxObjectShell* pSh );
+ virtual void Timeout();
+};
+
+//-------------------------------------------------------------------------
+
+class SFX2_DLLPUBLIC SfxObjectShellItem: public SfxPoolItem
+{
+ SfxObjectShell* pObjSh;
+
+public:
+ TYPEINFO();
+ SfxObjectShellItem() :
+ SfxPoolItem( 0 ),
+ pObjSh( 0 )
+ {}
+ SfxObjectShellItem( SfxObjectShell *pObjShell ):
+ SfxPoolItem( 0 ),
+ pObjSh( pObjShell )
+ {}
+ SfxObjectShellItem( sal_uInt16 nWhichId,
+ SfxObjectShell *pObjShell ):
+ SfxPoolItem( nWhichId ),
+ pObjSh( pObjShell )
+ {}
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual String GetValueText() const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ SfxObjectShell* GetObjectShell() const
+ { return pObjSh; }
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/opengrf.hxx b/include/sfx2/opengrf.hxx
new file mode 100644
index 000000000000..70dce688e9a8
--- /dev/null
+++ b/include/sfx2/opengrf.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 _SFX2_OPENGRF_HXX
+#define _SFX2_OPENGRF_HXX
+
+#include <memory> // auto_ptr
+#include <vcl/graphicfilter.hxx>
+#include <sfx2/dllapi.h>
+
+struct SvxOpenGrf_Impl;
+
+class SFX2_DLLPUBLIC SvxOpenGraphicDialog
+{
+public:
+ SvxOpenGraphicDialog ( const String& rTitle );
+ ~SvxOpenGraphicDialog ();
+
+ short Execute();
+
+ void SetPath( const String& rPath );
+ void SetPath( const String& rPath, sal_Bool bLinkState );
+ String GetPath() const;
+
+ int GetGraphic(Graphic&) const;
+
+ void EnableLink(sal_Bool);
+ void AsLink(sal_Bool);
+ sal_Bool IsAsLink() const;
+
+ String GetCurrentFilter() const;
+ void SetCurrentFilter(const String&);
+private:
+ // disable copy and assignment
+ SFX2_DLLPRIVATE SvxOpenGraphicDialog (const SvxOpenGraphicDialog&);
+ SFX2_DLLPRIVATE SvxOpenGraphicDialog& operator = ( const SvxOpenGraphicDialog & );
+
+ const std::auto_ptr< SvxOpenGrf_Impl > mpImpl;
+};
+
+#endif // _SVX_OPENGRF_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/passwd.hxx b/include/sfx2/passwd.hxx
new file mode 100644
index 000000000000..1f10c7416b98
--- /dev/null
+++ b/include/sfx2/passwd.hxx
@@ -0,0 +1,123 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFX_PASSWD_HXX
+#define _SFX_PASSWD_HXX
+
+#include "sal/config.h"
+#include <sfx2/dllapi.h>
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/layout.hxx>
+#include <sfx2/app.hxx>
+
+// defines ---------------------------------------------------------------
+
+#define SHOWEXTRAS_NONE ((sal_uInt16)0x0000)
+#define SHOWEXTRAS_USER ((sal_uInt16)0x0001)
+#define SHOWEXTRAS_CONFIRM ((sal_uInt16)0x0002)
+#define SHOWEXTRAS_PASSWORD2 ((sal_uInt16)0x0004)
+#define SHOWEXTRAS_CONFIRM2 ((sal_uInt16)0x0008)
+#define SHOWEXTRAS_ALL ((sal_uInt16)(SHOWEXTRAS_USER | SHOWEXTRAS_CONFIRM))
+
+// class SfxPasswordDialog -----------------------------------------------
+
+class SFX2_DLLPUBLIC SfxPasswordDialog : public ModalDialog
+{
+private:
+ VclFrame* mpPassword1Box;
+ FixedText* mpUserFT;
+ Edit* mpUserED;
+ FixedText* mpPassword1FT;
+ Edit* mpPassword1ED;
+ FixedText* mpConfirm1FT;
+ Edit* mpConfirm1ED;
+
+ VclFrame* mpPassword2Box;
+ FixedText* mpPassword2FT;
+ Edit* mpPassword2ED;
+ FixedText* mpConfirm2FT;
+ Edit* mpConfirm2ED;
+
+ FixedText* mpMinLengthFT;
+
+ OKButton* mpOKBtn;
+
+ String maMinLenPwdStr;
+ String maEmptyPwdStr;
+ String maMainPwdStr;
+ sal_uInt16 mnMinLen;
+ sal_uInt16 mnExtras;
+
+ bool mbAsciiOnly;
+ DECL_DLLPRIVATE_LINK(EditModifyHdl, Edit*);
+ DECL_DLLPRIVATE_LINK(OKHdl, void *);
+
+ void SetPasswdText();
+
+public:
+ SfxPasswordDialog(Window* pParent, const String* pGroupText = NULL);
+
+ String GetUser() const
+ {
+ return mpUserED->GetText();
+ }
+ String GetPassword() const
+ {
+ return mpPassword1ED->GetText();
+ }
+ String GetConfirm() const
+ {
+ return mpConfirm1ED->GetText();
+ }
+ String GetPassword2() const
+ {
+ return mpPassword2ED->GetText();
+ }
+ String GetConfirm2() const
+ {
+ return mpConfirm2ED->GetText();
+ }
+ void SetGroup2Text(const String& i_rText)
+ {
+ mpPassword2Box->set_label(i_rText);
+ }
+ void SetMinLen(sal_uInt16 Len);
+ void SetEditHelpId(const OString& rId)
+ {
+ mpPassword1ED->SetHelpId( rId );
+ }
+ void ShowExtras(sal_uInt16 nExtras)
+ {
+ mnExtras = nExtras;
+ }
+ void AllowAsciiOnly(bool i_bAsciiOnly = true)
+ {
+ mbAsciiOnly = i_bAsciiOnly;
+ }
+
+ void ShowMinLengthText(bool bShow);
+
+ virtual short Execute();
+};
+
+#endif // #ifndef _SFX_PASSWD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/printer.hxx b/include/sfx2/printer.hxx
new file mode 100644
index 000000000000..aac11a3bf4dc
--- /dev/null
+++ b/include/sfx2/printer.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 _SFX_PRINTER_HXX
+#define _SFX_PRINTER_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <vcl/print.hxx>
+
+class SfxTabPage;
+class SfxItemSet;
+
+struct SfxPrinter_Impl;
+
+// class SfxPrinter ------------------------------------------------------
+
+class SFX2_DLLPUBLIC SfxPrinter : public Printer
+{
+private:
+ JobSetup aOrigJobSetup;
+ SfxItemSet* pOptions;
+ SfxPrinter_Impl* pImpl;
+ sal_Bool bKnown;
+
+ SAL_DLLPRIVATE void operator =(SfxPrinter &); // not defined
+
+ SAL_DLLPRIVATE void UpdateFonts_Impl();
+
+public:
+ SfxPrinter( SfxItemSet *pTheOptions );
+ SfxPrinter( SfxItemSet *pTheOptions,
+ const String &rPrinterName );
+ SfxPrinter( SfxItemSet *pTheOptions,
+ const JobSetup &rTheOrigJobSetup );
+ SfxPrinter( SfxItemSet *pTheOptions,
+ const String &rPrinterName,
+ const JobSetup &rTheOrigJobSetup );
+ SfxPrinter( const SfxPrinter &rPrinter );
+ ~SfxPrinter();
+
+ SfxPrinter* Clone() const;
+
+ static SfxPrinter* Create( SvStream &rStream, SfxItemSet *pOptions );
+ SvStream& Store( SvStream &rStream ) const;
+
+ const JobSetup& GetOrigJobSetup() const { return aOrigJobSetup; }
+ void SetOrigJobSetup( const JobSetup &rNewJobSetup );
+
+ const SfxItemSet& GetOptions() const { return *pOptions; }
+ void SetOptions( const SfxItemSet &rNewOptions );
+
+ sal_Bool IsKnown() const { return bKnown; }
+ sal_Bool IsOriginal() const { return bKnown; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/printopt.hxx b/include/sfx2/printopt.hxx
new file mode 100644
index 000000000000..44d37d0a4558
--- /dev/null
+++ b/include/sfx2/printopt.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 _SFX_PRINTOPT_HXX
+#define _SFX_PRINTOPT_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <vcl/button.hxx>
+#include <vcl/field.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/print.hxx>
+
+#include <sfx2/tabdlg.hxx>
+
+// --------------------------------
+// - SfxCommonPrintOptionsTabPage -
+// --------------------------------
+
+class SvtBasePrintOptions;
+
+class SFX2_DLLPUBLIC SfxCommonPrintOptionsTabPage : public SfxTabPage
+{
+private:
+
+ RadioButton* m_pPrinterOutputRB;
+ RadioButton* m_pPrintFileOutputRB;
+
+ CheckBox* m_pReduceTransparencyCB;
+ RadioButton* m_pReduceTransparencyAutoRB;
+ RadioButton* m_pReduceTransparencyNoneRB;
+
+ CheckBox* m_pReduceGradientsCB;
+ RadioButton* m_pReduceGradientsStripesRB;
+ RadioButton* m_pReduceGradientsColorRB;
+ NumericField* m_pReduceGradientsStepCountNF;
+
+ CheckBox* m_pReduceBitmapsCB;
+ RadioButton* m_pReduceBitmapsOptimalRB;
+ RadioButton* m_pReduceBitmapsNormalRB;
+ RadioButton* m_pReduceBitmapsResolutionRB;
+ ListBox* m_pReduceBitmapsResolutionLB;
+ CheckBox* m_pReduceBitmapsTransparencyCB;
+
+ CheckBox* m_pConvertToGreyscalesCB;
+
+ CheckBox* m_pPDFCB;
+
+ CheckBox* m_pPaperSizeCB;
+ CheckBox* m_pPaperOrientationCB;
+ CheckBox* m_pTransparencyCB;
+
+private:
+
+ PrinterOptions maPrinterOptions;
+ PrinterOptions maPrintFileOptions;
+
+ DECL_DLLPRIVATE_LINK( ToggleOutputPrinterRBHdl, RadioButton* pButton );
+ DECL_DLLPRIVATE_LINK( ToggleOutputPrintFileRBHdl, RadioButton* pButton );
+
+ DECL_DLLPRIVATE_LINK( ClickReduceTransparencyCBHdl, CheckBox* pBox );
+ DECL_DLLPRIVATE_LINK( ClickReduceGradientsCBHdl, CheckBox* pBox );
+ DECL_DLLPRIVATE_LINK( ClickReduceBitmapsCBHdl, CheckBox* pBox );
+
+ DECL_DLLPRIVATE_LINK( ToggleReduceGradientsStripesRBHdl, RadioButton* pButton );
+ DECL_DLLPRIVATE_LINK( ToggleReduceBitmapsResolutionRBHdl, RadioButton* pButton );
+
+ SAL_DLLPRIVATE void ImplUpdateControls( const PrinterOptions* pCurrentOptions );
+ SAL_DLLPRIVATE void ImplSaveControls( PrinterOptions* pCurrentOptions );
+
+protected:
+
+ using TabPage::DeactivatePage;
+ virtual int DeactivatePage( SfxItemSet* pSet = NULL );
+
+public:
+
+ SfxCommonPrintOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
+ ~SfxCommonPrintOptionsTabPage();
+
+ virtual sal_Bool FillItemSet( SfxItemSet& rSet );
+ virtual void Reset( const SfxItemSet& rSet );
+ virtual Window* GetParentLabeledBy( const Window* pLabel ) const;
+ virtual Window* GetParentLabelFor( const Window* pLabel ) const;
+
+ static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
+};
+
+#endif // #ifndef _SFX_PRINTOPT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/prnmon.hxx b/include/sfx2/prnmon.hxx
new file mode 100644
index 000000000000..0d14c616a7bc
--- /dev/null
+++ b/include/sfx2/prnmon.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 _SFX_PRNMON_HXX
+#define _SFX_PRNMON_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <sfx2/printer.hxx>
+
+
+class SfxViewShell;
+
+// ------------------------------------------------------------------------
+
+struct SfxPrintOptDlg_Impl;
+class SfxPrintOptionsDialog : public ModalDialog
+{
+private:
+ SfxPrintOptDlg_Impl* pDlgImpl;
+ SfxViewShell* pViewSh;
+ SfxItemSet* pOptions;
+ SfxTabPage* pPage;
+
+public:
+ SfxPrintOptionsDialog( Window *pParent,
+ SfxViewShell *pViewShell,
+ const SfxItemSet *rOptions );
+ virtual ~SfxPrintOptionsDialog();
+
+ sal_Bool Construct();
+ virtual short Execute();
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ SfxTabPage* GetTabPage() const { return pPage; }
+ const SfxItemSet& GetOptions() const { return *pOptions; }
+ void DisableHelp();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/progress.hxx b/include/sfx2/progress.hxx
new file mode 100644
index 000000000000..285360272d30
--- /dev/null
+++ b/include/sfx2/progress.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 _SFX_PROGRESS_HXX
+#define _SFX_PROGRESS_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <tools/solar.h>
+#include <tools/link.hxx>
+#include <rtl/ustring.hxx>
+
+class String;
+class SfxObjectShell;
+struct SfxProgress_Impl;
+struct PlugInLoadStatus;
+struct SvProgressArg;
+
+//=======================================================================
+
+class SFX2_DLLPUBLIC SfxProgress
+{
+ SfxProgress_Impl* pImp;
+ sal_uIntPtr nVal;
+ sal_Bool bSuspended;
+
+public:
+ SfxProgress( SfxObjectShell* pObjSh,
+ const String& rText,
+ sal_uIntPtr nRange, sal_Bool bAllDocs = sal_False,
+ sal_Bool bWait = sal_True );
+ virtual ~SfxProgress();
+
+ virtual void SetText( const OUString& rText );
+ sal_Bool SetStateText( sal_uIntPtr nVal, const String &rVal, sal_uIntPtr nNewRange = 0 );
+ virtual sal_Bool SetState( sal_uIntPtr nVal, sal_uIntPtr nNewRange = 0 );
+ sal_uIntPtr GetState() const { return nVal; }
+
+ void Resume();
+ void Suspend();
+ sal_Bool IsSuspended() const { return bSuspended; }
+
+ void UnLock();
+ void Reschedule();
+
+ void Stop();
+
+ static SfxProgress* GetActiveProgress( SfxObjectShell *pDocSh = 0 );
+ static void EnterLock();
+ static void LeaveLock();
+
+ DECL_DLLPRIVATE_STATIC_LINK( SfxProgress, SetStateHdl, PlugInLoadStatus* );
+ DECL_DLLPRIVATE_STATIC_LINK( SfxProgress, DefaultBindingProgress, SvProgressArg* );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/querystatus.hxx b/include/sfx2/querystatus.hxx
new file mode 100644
index 000000000000..475d3cd00765
--- /dev/null
+++ b/include/sfx2/querystatus.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 _SFXQUERYSTATUS_HXX
+#define _SFXQUERYSTATUS_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <svl/poolitem.hxx>
+#include <cppuhelper/weak.hxx>
+#include <osl/conditn.hxx>
+#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+
+#include <sfx2/sfxuno.hxx>
+
+class SfxQueryStatus_Impl;
+class SFX2_DLLPUBLIC SfxQueryStatus
+{
+ public:
+ SfxQueryStatus( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& aCommand );
+ ~SfxQueryStatus();
+
+ // Query method
+ SfxItemState QueryState( SfxPoolItem*& pPoolItem );
+
+ private:
+ SfxQueryStatus( const SfxQueryStatus& );
+ SfxQueryStatus();
+ SfxQueryStatus& operator=( const SfxQueryStatus& );
+
+ com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener > m_xStatusListener;
+ SfxQueryStatus_Impl* m_pSfxQueryStatusImpl;
+};
+
+#endif // _SFXQUERYSTATUS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/request.hxx b/include/sfx2/request.hxx
new file mode 100644
index 000000000000..590fd7bffeaf
--- /dev/null
+++ b/include/sfx2/request.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 _SFXREQUEST_HXX
+#define _SFXREQUEST_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <svl/itemset.hxx>
+#include <svl/hint.hxx>
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/frame/XDispatchRecorder.hpp>
+
+class SfxPoolItem;
+class SfxAllItemSet;
+class SfxItemSet;
+class SfxItemPool;
+class SfxShell;
+class SfxSlot;
+class String;
+class SfxViewFrame;
+struct SfxRequest_Impl;
+
+//==================================================================
+
+class SFX2_DLLPUBLIC SfxRequest: public SfxHint
+{
+friend struct SfxRequest_Impl;
+
+ sal_uInt16 nSlot;
+ SfxAllItemSet* pArgs;
+ SfxRequest_Impl* pImp;
+
+ //---------------------------------------------------------------------
+public:
+ SAL_DLLPRIVATE void Record_Impl( SfxShell &rSh, const SfxSlot &rSlot,
+ com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder,
+ SfxViewFrame* );
+private:
+ SAL_DLLPRIVATE void Done_Impl( const SfxItemSet *pSet );
+
+ //---------------------------------------------------------------------
+
+public:
+ SfxRequest( SfxViewFrame*, sal_uInt16 nSlotId );
+ SfxRequest( sal_uInt16 nSlot, sal_uInt16 nCallMode, SfxItemPool &rPool );
+ SfxRequest( const SfxSlot* pSlot, const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& rArgs,
+ sal_uInt16 nCallMode, SfxItemPool &rPool );
+ SfxRequest( sal_uInt16 nSlot, sal_uInt16 nCallMode, const SfxAllItemSet& rSfxArgs );
+ SfxRequest( const SfxRequest& rOrig );
+ ~SfxRequest();
+
+ sal_uInt16 GetSlot() const { return nSlot; }
+ void SetSlot(sal_uInt16 nNewSlot) { nSlot = nNewSlot; }
+
+ sal_uInt16 GetModifier() const;
+ void SetModifier( sal_uInt16 nModi );
+ SAL_DLLPRIVATE void SetInternalArgs_Impl( const SfxAllItemSet& rArgs );
+ SAL_DLLPRIVATE const SfxItemSet* GetInternalArgs_Impl() const;
+ const SfxItemSet* GetArgs() const { return pArgs; }
+ void SetArgs( const SfxAllItemSet& rArgs );
+ void AppendItem(const SfxPoolItem &);
+ void RemoveItem( sal_uInt16 nSlotId );
+
+ static const SfxPoolItem* GetItem( const SfxItemSet*, sal_uInt16 nSlotId,
+ bool bDeep = false,
+ TypeId aType = 0 );
+ const SfxPoolItem* GetArg( sal_uInt16 nSlotId, bool bDeep = false, TypeId aType = 0 ) const;
+ void ReleaseArgs();
+ void SetReturnValue(const SfxPoolItem &);
+ const SfxPoolItem* GetReturnValue() const;
+
+ static com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > GetMacroRecorder( SfxViewFrame* pFrame=NULL );
+ static sal_Bool HasMacroRecorder( SfxViewFrame* pFrame=NULL );
+ sal_uInt16 GetCallMode() const;
+ void AllowRecording( sal_Bool );
+ sal_Bool AllowsRecording() const;
+ sal_Bool IsAPI() const;
+ sal_Bool IsSynchronCall() const;
+ void SetSynchronCall( sal_Bool bSynchron );
+
+ sal_Bool IsDone() const;
+ void Done( sal_Bool bRemove = sal_False );
+
+ void Ignore();
+ void Cancel();
+ sal_Bool IsCancelled() const;
+ void Done(const SfxItemSet &, bool bKeep = true );
+
+ void ForgetAllArgs();
+
+private:
+ const SfxRequest& operator=(const SfxRequest &); // n.i.!!
+};
+
+//------------------------------------------------------------------------
+
+#define SFX_REQUEST_ARG(rReq, pItem, ItemType, nSlotId, bDeep) \
+ const ItemType *pItem = (const ItemType*) \
+ rReq.GetArg( nSlotId, bDeep, TYPE(ItemType) )
+#define SFX_ITEMSET_ARG(pArgs, pItem, ItemType, nSlotId, bDeep) \
+ const ItemType *pItem = (const ItemType*) \
+ SfxRequest::GetItem( pArgs, nSlotId, bDeep, TYPE(ItemType) )
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/securitypage.hxx b/include/sfx2/securitypage.hxx
new file mode 100644
index 000000000000..994fd0befa41
--- /dev/null
+++ b/include/sfx2/securitypage.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 _SECURITYPAGE_HXX_
+#define _SECURITYPAGE_HXX_
+
+#include "sfx2/tabdlg.hxx"
+#include "sfx2/htmlmode.hxx"
+
+#include <memory>
+
+
+
+struct SfxSecurityPage_Impl;
+
+class SfxSecurityPage : public SfxTabPage
+{
+ std::auto_ptr< SfxSecurityPage_Impl > m_pImpl;
+
+protected:
+ SfxSecurityPage( Window* pParent, const SfxItemSet& );
+ virtual ~SfxSecurityPage();
+
+ virtual sal_Bool FillItemSet( SfxItemSet& );
+ virtual void Reset( const SfxItemSet& );
+
+public:
+ static SfxTabPage* Create( Window* pParent, const SfxItemSet& );
+};
+
+
+#endif // #ifndef _SECURITYPAGE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfx.hrc b/include/sfx2/sfx.hrc
new file mode 100644
index 000000000000..245daa2f062a
--- /dev/null
+++ b/include/sfx2/sfx.hrc
@@ -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 _SFX_HRC
+#define _SFX_HRC
+
+#include <svl/solar.hrc>
+#include <svl/memberid.hrc>
+
+#define RID_GROUPS_OFFSET 32000
+#define RID_GROUPS_SFXOFFSET 32700
+#define RID_GROUPS_END 32767
+
+//--------------------------------------------------------------------
+
+#define EVENT_SFX_START 5000
+// EVENT_SFX_END 9999
+
+// EVENT_LIB_START 10000
+// EVENT_LIB_END 19999
+
+#define EVENT_APP_START 20000
+// EVENT_APP_END 29999
+
+#define EVENT_OBJ_START 30000
+
+#define EVENT_SVX_START (EVENT_OBJ_START+0x0400)
+
+// Warning: the following are simultaneously SID_ON_ ...
+#define SFX_EVENT_CLOSEAPP (EVENT_SFX_START + 1)
+#define SFX_EVENT_CREATEDOC (EVENT_SFX_START + 2)
+#define SFX_EVENT_OPENDOC (EVENT_SFX_START + 3)
+#define SFX_EVENT_CLOSEDOC (EVENT_SFX_START + 4)
+#define SFX_EVENT_SAVEDOC (EVENT_SFX_START + 5)
+#define SFX_EVENT_SAVEASDOC (EVENT_SFX_START + 6)
+#define SFX_EVENT_ACTIVATEDOC (EVENT_SFX_START + 7)
+#define SFX_EVENT_DEACTIVATEDOC (EVENT_SFX_START + 8)
+#define SFX_EVENT_PRINTDOC (EVENT_SFX_START + 9)
+#define SFX_EVENT_SAVEACOPY (EVENT_SFX_START + 10)
+
+#define SFX_EVENT_LOADFINISHED (EVENT_SFX_START + 11)
+
+#define SFX_EVENT_MODIFYCHANGED (EVENT_SFX_START + 13)
+#define SFX_EVENT_PREPARECLOSEDOC (EVENT_SFX_START + 14)
+#define SFX_EVENT_TOGGLEFULLSCREENMODE (EVENT_SFX_START + 16)
+#define SFX_EVENT_SAVEDOCDONE (EVENT_SFX_START + 17)
+#define SFX_EVENT_SAVEASDOCDONE (EVENT_SFX_START + 18)
+
+#define SFX_EVENT_SAVETODOC (EVENT_SFX_START + 19)
+#define SFX_EVENT_SAVETODOCDONE (EVENT_SFX_START + 20)
+
+#define SFX_EVENT_VIEWCREATED (EVENT_SFX_START + 21)
+#define SFX_EVENT_PREPARECLOSEVIEW (EVENT_SFX_START + 22)
+#define SFX_EVENT_CLOSEVIEW (EVENT_SFX_START + 23)
+
+#define SFX_EVENT_STORAGECHANGED (EVENT_SFX_START + 24)
+#define SFX_EVENT_VISAREACHANGED (EVENT_SFX_START + 25)
+
+#define SFX_EVENT_DOCCREATED (EVENT_SFX_START + 26)
+
+#define SFX_EVENT_SAVEASDOCFAILED (EVENT_SFX_START + 27)
+#define SFX_EVENT_SAVEDOCFAILED (EVENT_SFX_START + 28)
+#define SFX_EVENT_SAVETODOCFAILED (EVENT_SFX_START + 29)
+
+
+// Events for Controls etc.
+#define SFX_EVENT_MOUSEOVER_OBJECT ( EVENT_SFX_START + 100 )
+#define SFX_EVENT_MOUSECLICK_OBJECT ( EVENT_SFX_START + 101 )
+#define SFX_EVENT_MOUSEOUT_OBJECT ( EVENT_SFX_START + 102 )
+
+//--------------------------------------------------------------------
+
+#define RID_SFX_APP_START (RID_SFX_START + 256)
+#define RID_SFX_MENU_START (RID_SFX_START + 768)
+// RID_SFX_CONFIG_START (RID_SFX_START + 1536)
+#define RID_SFX_DOC_START (RID_SFX_START + 1792)
+#define RID_SFX_DIALOG_START (RID_SFX_START + 2048)
+#define RID_SFX_BASTYP_START (RID_SFX_START + 2304)
+#define RID_SFX_EXPLORER_START (RID_SFX_START + 2816)
+
+// RID_CNT_START (RID_SFX_START + 3072)
+
+#define RID_SFX_SFXLOCAL_START (RID_SFX_START + 3082)
+#define RID_SFX_VIEW_START (RID_SFX_START + 4096)
+// RID_CNT_START2 (RID_SFX_START + 4500)
+// RID_SFX_CHAOSDOC_START (RID_SFX_START + 5120)
+// RID_SFX_TPLCOMPONENT_START (RID_SFX_START + 6800)
+// RID_SFX_HELPCOMPONENT_START (RID_SFX_START + 7000)
+
+//--------------------------------------------------------------------
+
+#define SFX_OBJECTBAR_APPLICATION 0
+#define SFX_OBJECTBAR_OBJECT 1
+#define SFX_OBJECTBAR_TOOLS 2
+#define SFX_OBJECTBAR_MACRO 3
+#define SFX_OBJECTBAR_FULLSCREEN 4
+#define SFX_OBJECTBAR_RECORDING 5
+#define SFX_OBJECTBAR_COMMONTASK 6
+#define SFX_OBJECTBAR_OPTIONS 7
+#define SFX_OBJECTBAR_NAVIGATION 12
+#define SFX_OBJECTBAR_MAX 13
+
+// temporary due to compatibility
+
+
+#define MSG_QUERY_LASTVERSION RID_SFX_START
+
+#define RID_APPLICATION RID_SFX_START
+#define RID_DEFAULTIMAGELIST_SC (RID_SFX_START+15)
+#define RID_DEFAULTIMAGELIST_LC (RID_SFX_START+17)
+
+#define RID_STYLECATALOG (RID_SFX_START+1201)
+
+#define RID_DEFAULTABOUT (RID_SFX_START+0)
+
+#define RID_APPTITLE (RID_SFX_START+4)
+
+#define DLG_DOCINFO_EDT (RID_SFX_START+6)
+
+#define DLG_STYLE_DESIGNER (RID_SFX_START+8)
+
+#define RID_SFX_INCORRECT_PASSWORD (RID_SFX_START+216)
+
+#define STR_STYLE_FILTER_AUTO (RID_SFX_START+9)
+#define STR_STYLE_FILTER_USED (RID_SFX_START+10)
+#define STR_STYLE_FILTER_USERDEF (RID_SFX_START+11)
+#define STR_STYLE_FILTER_ALL (RID_SFX_START+12)
+// +13 already used!
+#define STR_STYLE_FILTER_HIERARCHICAL (RID_SFX_START+1200)
+
+#define STR_NONAME (RID_SFX_START+100)
+#define STR_NONE (RID_SFX_START+101)
+#define STR_CLOSE (RID_SFX_START+103)
+#define STR_STANDARD (RID_SFX_START+104)
+#define STR_READONLY (RID_SFX_START+105)
+
+#define STR_SFX_FILTERNAME_ALL (RID_SFX_START+106)
+#define STR_EDIT (RID_SFX_START+108)
+#define STR_QUERY_SAVE_DOCUMENT (RID_SFX_START+110)
+#define STR_BYTES (RID_SFX_START+111)
+#define STR_KB (RID_SFX_START+112)
+#define STR_MB (RID_SFX_START+113)
+#define STR_GB (RID_SFX_START+114)
+#define STR_QUERY_SAVE_DOCUMENT_TITLE (RID_SFX_START+115)
+
+#define STR_STANDARD_SHORTCUT (RID_SFX_START+117)
+#define STR_REPAIREDDOCUMENT (RID_SFX_START+118)
+#define STR_ERRUNOEVENTBINDUNG (RID_SFX_START+119)
+#define STR_SHARED (RID_SFX_START+120)
+#define RID_XMLSEC_DOCUMENTSIGNED (RID_SFX_START+121)
+#define STR_PASSWD (RID_SFX_START+122)
+#define STR_PASSWD_EMPTY (RID_SFX_START+123)
+#define STR_PASSWD_MIN_LEN (RID_SFX_START+124)
+#define STR_NONCHECKEDOUT_DOCUMENT (RID_SFX_START+125)
+#define BT_CHECKOUT (RID_SFX_START+126)
+#define STR_ACCTITLE_PRODUCTIVITYTOOLS (RID_SFX_START+157)
+
+#define SFX_THUMBNAIL_TEXT (RID_SFX_START+158)
+#define SFX_THUMBNAIL_SHEET (RID_SFX_START+159)
+#define SFX_THUMBNAIL_PRESENTATION (RID_SFX_START+160)
+#define SFX_THUMBNAIL_DRAWING (RID_SFX_START+161)
+
+//=========================================================================
+
+// group ids
+//=========================================================================
+// !! If you add a new group, please change sfxbasecontroller.cxx and
+// !! com.sun.star.frame.CommandGroup accordingly!
+//=========================================================================
+
+#define GID_INTERN (RID_GROUPS_SFXOFFSET+ 0)
+#define GID_APPLICATION (RID_GROUPS_SFXOFFSET+ 1)
+#define GID_DOCUMENT (RID_GROUPS_SFXOFFSET+ 2)
+#define GID_VIEW (RID_GROUPS_SFXOFFSET+ 3)
+#define GID_EDIT (RID_GROUPS_SFXOFFSET+ 4)
+#define GID_MACRO (RID_GROUPS_SFXOFFSET+ 5)
+#define GID_OPTIONS (RID_GROUPS_SFXOFFSET+ 6)
+#define GID_MATH (RID_GROUPS_SFXOFFSET+ 7)
+#define GID_NAVIGATOR (RID_GROUPS_SFXOFFSET+ 8)
+#define GID_INSERT (RID_GROUPS_SFXOFFSET+ 9)
+#define GID_FORMAT (RID_GROUPS_SFXOFFSET+10)
+#define GID_TEMPLATE (RID_GROUPS_SFXOFFSET+11)
+#define GID_TEXT (RID_GROUPS_SFXOFFSET+12)
+#define GID_FRAME (RID_GROUPS_SFXOFFSET+13)
+#define GID_GRAPHIC (RID_GROUPS_SFXOFFSET+14)
+#define GID_TABLE (RID_GROUPS_SFXOFFSET+15)
+#define GID_ENUMERATION (RID_GROUPS_SFXOFFSET+16)
+#define GID_DATA (RID_GROUPS_SFXOFFSET+17)
+#define GID_SPECIAL (RID_GROUPS_SFXOFFSET+18)
+#define GID_IMAGE (RID_GROUPS_SFXOFFSET+19)
+#define GID_CHART (RID_GROUPS_SFXOFFSET+20)
+#define GID_EXPLORER (RID_GROUPS_SFXOFFSET+21)
+#define GID_CONNECTOR (RID_GROUPS_SFXOFFSET+22)
+#define GID_MODIFY (RID_GROUPS_SFXOFFSET+23)
+#define GID_DRAWING (RID_GROUPS_SFXOFFSET+24)
+#define GID_CONTROLS (RID_GROUPS_SFXOFFSET+25)
+#define GID_NAVIGATION (RID_GROUPS_SFXOFFSET+26)
+
+// =========================================================================
+
+#define RID_OPTIONS_START (SID_LIB_START + 2000)
+// RID_OPTIONS_END (RID_OPTIONS_START + 100)
+
+// ResId's ------------------------------------------------------------------
+
+#define RID_SFXPAGE_SAVE (RID_OPTIONS_START + 0)
+#define RID_SFXPAGE_GENERAL (RID_OPTIONS_START + 1)
+#define RID_SFXDLG_NEWDICT (RID_OPTIONS_START + 3)
+#define RID_SFXDLG_EDITDICT (RID_OPTIONS_START + 4)
+#define RID_SFXQB_DELDICT (RID_OPTIONS_START + 5)
+#define RID_SFXPAGE_PATH (RID_OPTIONS_START + 6)
+#define RID_SFXPAGE_LINGU (RID_OPTIONS_START + 7)
+#define RID_SFXQB_SET_LANGUAGE (RID_OPTIONS_START + 10)
+#define RID_SFXPAGE_PRINTOPTIONS (RID_OPTIONS_START + 12)
+
+#define RID_STR_NEW_TASK (RID_SFX_DOC_START+ 76)
+
+// Member-Ids ------------------------------------------------------------
+
+#define MID_DOCINFO_DESCRIPTION 0x13
+#define MID_DOCINFO_KEYWORDS 0x17
+#define MID_DOCINFO_SUBJECT 0x1b
+#define MID_DOCINFO_TITLE 0x1d
+#define MID_DOCINFO_AUTOLOADENABLED 0x2d
+#define MID_DOCINFO_AUTOLOADURL 0x2e
+#define MID_DOCINFO_AUTOLOADSECS 0x2f
+#define MID_DOCINFO_DEFAULTTARGET 0x30
+#define MID_DOCINFO_USEUSERDATA 0x31
+#define MID_DOCINFO_DELETEUSERDATA 0x32
+
+// only for FastPropertySet
+#define MID_DOCINFO_REVISION 0x15
+#define MID_DOCINFO_EDITTIME 0x16
+#define MID_DOCINFO_MODIFICATIONAUTHOR 0x18
+#define MID_DOCINFO_TEMPLATE 0x1c
+#define MID_DOCINFO_PRINTDATE 0x28
+#define MID_DOCINFO_PRINTEDBY 0x2a
+#define MID_DOCINFO_TEMPLATEDATE 0x2b
+#define MID_DOCINFO_STATISTIC 0x33
+#define MID_DOCINFO_CHARLOCALE 0x34
+#define MID_CATEGORY 0x35
+#define MID_COMPANY 0x36
+#define MID_MANAGER 0x37
+#define MID_TYPE 0x38
+#define MID_VALUE 0x39
+#define MID_VALUESET 0x40
+
+// Config-Ids -----------------------------------------------------------
+
+#define SFX_ITEMTYPE_SW_BEGIN 20000
+// SFX_ITEMTYPE_SW_END 22999
+
+#define SFX_ITEMTYPE_SD_BEGIN 23000
+// SFX_ITEMTYPE_SD_END 25999
+
+#define SFX_ITEMTYPE_SC_BEGIN 26000
+// SFX_ITEMTYPE_SC_END 27999
+
+// free: 28000-32767
+
+// Slot-Ids -------------------------------------------------------------
+
+#include <sfx2/sfxsids.hrc>
+
+#define HID_INTERFACE_SFXHELP_VIEWSH 24
+
+#define RET_NEWTASK 200
+
+#endif // #ifndef _SFX_HRC
+
+// ******************************************************************* EOF
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxbasecontroller.hxx b/include/sfx2/sfxbasecontroller.hxx
new file mode 100644
index 000000000000..df2635f711ed
--- /dev/null
+++ b/include/sfx2/sfxbasecontroller.hxx
@@ -0,0 +1,386 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SFX_SFXBASECONTROLLER_HXX_
+#define _SFX_SFXBASECONTROLLER_HXX_
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/DispatchDescriptor.hpp>
+#include <com/sun/star/frame/XDispatchInformationProvider.hpp>
+#include <com/sun/star/frame/XController2.hpp>
+#include <com/sun/star/frame/XControllerBorder.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XTitle.hpp>
+#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
+#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <cppuhelper/implbase9.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <osl/mutex.hxx>
+#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
+#include <com/sun/star/ui/XContextMenuInterception.hpp>
+#include <com/sun/star/ui/XContextMenuInterceptor.hpp>
+#include <com/sun/star/awt/XMouseClickHandler.hpp>
+#include <com/sun/star/awt/XKeyHandler.hpp>
+#include <com/sun/star/awt/XUserInputInterception.hpp>
+#include <tools/link.hxx>
+#include <vcl/button.hxx>
+
+#include <sfx2/viewsh.hxx>
+#include <sfx2/sfxuno.hxx>
+
+struct IMPL_SfxBaseController_DataContainer ; // impl. struct to hold member of class SfxBaseController
+
+class SfxViewFrame;
+
+sal_Int16 MapGroupIDToCommandGroup( sal_Int16 nGroupID );
+
+//________________________________________________________________________________________________________
+// class declarations
+//________________________________________________________________________________________________________
+
+typedef ::cppu::WeakImplHelper9 < css::frame::XController2
+ , css::frame::XControllerBorder
+ , css::frame::XDispatchProvider
+ , css::task::XStatusIndicatorSupplier
+ , css::ui::XContextMenuInterception
+ , css::awt::XUserInputInterception
+ , css::frame::XDispatchInformationProvider
+ , css::frame::XTitle
+ , css::frame::XTitleChangeBroadcaster
+ > SfxBaseController_Base;
+
+class SFX2_DLLPUBLIC SfxBaseController :public SfxBaseController_Base
+ ,public ::cppu::BaseMutex
+{
+//________________________________________________________________________________________________________
+// public methods
+//________________________________________________________________________________________________________
+
+public:
+
+ //____________________________________________________________________________________________________
+ // constructor/destructor
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ SfxBaseController( SfxViewShell* pView ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ ~SfxBaseController() ;
+
+ SAL_DLLPRIVATE void ReleaseShell_Impl();
+ SAL_DLLPRIVATE void BorderWidthsChanged_Impl();
+
+ css::uno::Reference< css::task::XStatusIndicator > SAL_CALL getStatusIndicator( ) throw (css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XController2
+ //____________________________________________________________________________________________________
+ virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getComponentWindow() throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getViewControllerName() throw (css::uno::RuntimeException);
+ virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCreationArguments() throw (css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XController
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL attachFrame( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual sal_Bool SAL_CALL attachModel( const css::uno::Reference< css::frame::XModel >& xModel ) throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual sal_Bool SAL_CALL suspend( sal_Bool bSuspend ) throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ css::uno::Any SAL_CALL getViewData() throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ void SAL_CALL restoreViewData( const css::uno::Any& aValue ) throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ css::uno::Reference< css::frame::XFrame > SAL_CALL getFrame() throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ css::uno::Reference< css::frame::XModel > SAL_CALL getModel() throw( css::uno::RuntimeException ) ;
+
+ //____________________________________________________________________________________________________
+ // XDispatchProvider
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL & aURL ,
+ const OUString & sTargetFrameName,
+ FrameSearchFlags eSearchFlags ) throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& seqDescriptor ) throw( css::uno::RuntimeException ) ;
+
+ //____________________________________________________________________________________________________
+ // XControllerBorder
+ //____________________________________________________________________________________________________
+
+ virtual css::frame::BorderWidths SAL_CALL getBorder() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL addBorderResizeListener( const css::uno::Reference< css::frame::XBorderResizeListener >& xListener ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeBorderResizeListener( const css::uno::Reference< css::frame::XBorderResizeListener >& xListener ) throw (css::uno::RuntimeException);
+ virtual css::awt::Rectangle SAL_CALL queryBorderedArea( const css::awt::Rectangle& aPreliminaryRectangle ) throw (css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XComponent
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL dispose() throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) throw( css::uno::RuntimeException ) ;
+ virtual void SAL_CALL registerContextMenuInterceptor( const css::uno::Reference< css::ui::XContextMenuInterceptor >& xInterceptor ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL releaseContextMenuInterceptor( const css::uno::Reference< css::ui::XContextMenuInterceptor >& xInterceptor ) throw( css::uno::RuntimeException );
+
+ virtual void SAL_CALL addKeyHandler( const css::uno::Reference< css::awt::XKeyHandler >& xHandler ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeKeyHandler( const css::uno::Reference< css::awt::XKeyHandler >& xHandler ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL addMouseClickHandler( const css::uno::Reference< css::awt::XMouseClickHandler >& xHandler ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeMouseClickHandler( const css::uno::Reference< css::awt::XMouseClickHandler >& xHandler ) throw (css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XDispatchInformationProvider
+ //____________________________________________________________________________________________________
+ virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedCommandGroups() throw (css::uno::RuntimeException);
+ virtual css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation( sal_Int16 nCommandGroup ) throw (css::uno::RuntimeException);
+
+ // css::frame::XTitle
+ virtual OUString SAL_CALL getTitle( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTitle( const OUString& sTitle ) throw (css::uno::RuntimeException);
+
+ // css::frame::XTitleChangeBroadcaster
+ virtual void SAL_CALL addTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener ) throw (css::uno::RuntimeException);
+
+ // FIXME: TL needs this in sw/source/ui/uno/unotxdoc.cxx now;
+ // either the _Impl name should vanish or there should be an "official" API
+ SfxViewShell* GetViewShell_Impl() const;
+ SAL_DLLPRIVATE sal_Bool HandleEvent_Impl( NotifyEvent& rEvent );
+ SAL_DLLPRIVATE sal_Bool HasKeyListeners_Impl();
+ SAL_DLLPRIVATE sal_Bool HasMouseClickListeners_Impl();
+ SAL_DLLPRIVATE void SetCreationArguments_Impl( const css::uno::Sequence< css::beans::PropertyValue >& i_rCreationArgs );
+ SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper ();
+private:
+ enum ConnectSfxFrame
+ {
+ E_CONNECT,
+ E_DISCONNECT,
+ E_RECONNECT
+ };
+ SAL_DLLPRIVATE void ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect );
+ SAL_DLLPRIVATE SfxViewFrame& GetViewFrame_Impl() const;
+ SAL_DLLPRIVATE void ShowInfoBars( );
+
+ DECL_LINK( CheckOutHandler, void * );
+
+//________________________________________________________________________________________________________
+// private variables
+//________________________________________________________________________________________________________
+
+private:
+
+ IMPL_SfxBaseController_DataContainer* m_pData ;
+
+} ; // class SfxBaseController
+
+#endif // _SFX_SFXBASECONTROLLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxbasemodel.hxx b/include/sfx2/sfxbasemodel.hxx
new file mode 100644
index 000000000000..524c86b0b99d
--- /dev/null
+++ b/include/sfx2/sfxbasemodel.hxx
@@ -0,0 +1,1554 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SFX_SFXBASEMODEL_HXX_
+#define _SFX_SFXBASEMODEL_HXX_
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/frame/XModule.hpp>
+#include <com/sun/star/frame/XTitle.hpp>
+#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
+#include <com/sun/star/frame/XUntitledNumbers.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/XNameReplace.hpp>
+#include <com/sun/star/frame/XController2.hpp>
+#include <com/sun/star/document/XCmisDocument.hpp>
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XDocumentRecovery.hpp>
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
+#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
+#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
+#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/document/XEventsSupplier.hpp>
+#include <com/sun/star/document/XEmbeddedScripts.hpp>
+#include <com/sun/star/document/EventObject.hpp>
+#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
+#include <com/sun/star/document/XStorageBasedDocument.hpp>
+#include <com/sun/star/document/XScriptInvocationContext.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/lang/NotInitializedException.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/frame/XModel2.hpp>
+#include <com/sun/star/frame/DoubleInitializationException.hpp>
+#include <com/sun/star/util/XModifiable2.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/util/XCloseBroadcaster.hpp>
+#include <com/sun/star/util/XCloseListener.hpp>
+#include <com/sun/star/util/CloseVetoException.hpp>
+#include <com/sun/star/view/XPrintable.hpp>
+#include <com/sun/star/view/XPrintJobBroadcaster.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/frame/XStorable2.hpp>
+#include <com/sun/star/frame/XLoadable.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/lang/EventObject.hpp>
+#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
+#include <com/sun/star/ui/XUIConfigurationManager2.hpp>
+#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/embed/XVisualObject.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Any.hxx>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <com/sun/star/script/XStarBasicAccess.hpp>
+#include <osl/mutex.hxx>
+#include <vcl/svapp.hxx>
+
+#include <com/sun/star/document/XViewDataSupplier.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+
+#ifndef INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_32
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_32
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 32
+#include <comphelper/implbase_var.hxx>
+#endif
+
+#include <svl/lstner.hxx>
+
+class SfxMedium;
+class SfxPrinter;
+class SfxViewShell;
+class SfxObjectShell ;
+class SfxEventHint;
+class SfxViewFrame;
+struct IMPL_SfxBaseModel_DataContainer ; // impl. struct to hold member of class SfxBaseModel
+
+namespace sfx { namespace intern {
+ class ViewCreationGuard;
+} }
+//________________________________________________________________________________________________________
+// class declarations
+//________________________________________________________________________________________________________
+
+/**_______________________________________________________________________________________________________
+ @short -
+
+ @descr -
+
+ @implements XChild
+ XComponent
+ document::XDocumentPropertiesSupplier
+ rdf::XDocumentMetadataAccess
+ XEventListener
+ XModel
+ XModifiable2
+ XPrintable
+ XStorable2
+ document::XEventBroadcaster
+ document::XEventsSupplier
+ document::XEmbeddedScripts
+ document::XScriptInvocationContext
+ XCloseable
+ XCloseBroadcaster
+
+ @base cppu::BaseMutex
+ SfxListener
+*/
+
+typedef ::comphelper::WeakImplHelper32 < css::container::XChild
+ , css::document::XDocumentPropertiesSupplier
+ , css::document::XCmisDocument
+ , css::rdf::XDocumentMetadataAccess
+ , css::document::XDocumentRecovery
+ , css::document::XUndoManagerSupplier
+ , css::document::XEventBroadcaster
+ , css::document::XDocumentEventBroadcaster
+ , css::lang::XEventListener
+ , css::document::XEventsSupplier
+ , css::document::XEmbeddedScripts
+ , css::document::XScriptInvocationContext
+ , css::frame::XModel2
+ , css::util::XModifiable2
+ , css::view::XPrintable
+ , css::view::XPrintJobBroadcaster
+ , css::frame::XStorable2
+ , css::frame::XLoadable
+ , css::script::XStarBasicAccess
+ , css::document::XViewDataSupplier
+ , css::util::XCloseable // => css::util::XCloseBroadcaster
+ , css::datatransfer::XTransferable
+ , css::document::XDocumentSubStorageSupplier
+ , css::document::XStorageBasedDocument
+ , css::script::provider::XScriptProviderSupplier
+ , css::ui::XUIConfigurationManagerSupplier
+ , css::embed::XVisualObject
+ , css::lang::XUnoTunnel
+ , css::frame::XModule
+ , css::frame::XTitle
+ , css::frame::XTitleChangeBroadcaster
+ , css::frame::XUntitledNumbers
+ > SfxBaseModel_Base;
+
+class SFX2_DLLPUBLIC SfxBaseModel : protected ::cppu::BaseMutex
+ , public SfxBaseModel_Base
+ , public SfxListener
+{
+
+//________________________________________________________________________________________________________
+// public methods
+//________________________________________________________________________________________________________
+
+public:
+
+ //____________________________________________________________________________________________________
+ // constructor/destructor
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ SfxBaseModel( SfxObjectShell *pObjektShell = NULL ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual ~SfxBaseModel() ;
+
+ //____________________________________________________________________________________________________
+ // XInterface
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short give answer, if interface is supported
+ @descr The interfaces are searched by type.
+
+ @seealso XInterface
+
+ @param "rType" is the type of searched interface.
+
+ @return Any information about found interface
+
+ @onerror A RuntimeException is thrown.
+ */
+
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short increment refcount
+ @descr -
+
+ @seealso XInterface
+ @seealso release()
+
+ @param -
+
+ @return -
+
+ @onerror A RuntimeException is thrown.
+ */
+
+ virtual void SAL_CALL acquire() throw() ;
+
+ /**___________________________________________________________________________________________________
+ @short decrement refcount
+ @descr -
+
+ @seealso XInterface
+ @seealso acquire()
+
+ @param -
+
+ @return -
+
+ @onerror A RuntimeException is thrown.
+ */
+
+ virtual void SAL_CALL release() throw() ;
+
+ //____________________________________________________________________________________________________
+ // XTypeProvider
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short get information about supported interfaces
+ @descr -
+
+ @seealso XTypeProvider
+
+ @param -
+
+ @return Sequence of types of all supported interfaces
+
+ @onerror A RuntimeException is thrown.
+ */
+
+ virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short get implementation id
+ @descr This ID is neccessary for UNO-caching. If there no ID, cache is disabled.
+ Another way, cache is enabled.
+
+ @seealso XTypeProvider
+
+ @param -
+
+ @return ID as Sequence of byte
+
+ @onerror A RuntimeException is thrown.
+ */
+
+ virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw( css::uno::RuntimeException ) ;
+
+
+ //____________________________________________________________________________________________________
+ // XStarBasicAccess
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @seealso XStarBasicAccess
+ */
+ virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getLibraryContainer() throw( css::uno::RuntimeException );
+
+ /**___________________________________________________________________________________________________
+ @seealso XStarBasicAccess
+ */
+ virtual void SAL_CALL createLibrary( const OUString& LibName, const OUString& Password,
+ const OUString& ExternalSourceURL, const OUString& LinkTargetURL )
+ throw(css::container::ElementExistException, css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @seealso XStarBasicAccess
+ */
+ virtual void SAL_CALL addModule( const OUString& LibraryName, const OUString& ModuleName,
+ const OUString& Language, const OUString& Source )
+ throw( css::container::NoSuchElementException, css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @seealso XStarBasicAccess
+ */
+ virtual void SAL_CALL addDialog( const OUString& LibraryName, const OUString& DialogName,
+ const css::uno::Sequence< sal_Int8 >& Data )
+ throw(css::container::NoSuchElementException, css::uno::RuntimeException);
+
+
+ //____________________________________________________________________________________________________
+ // XChild
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& xParent ) throw(css::lang::NoSupportException,
+ css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XComponent
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL dispose() throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener >& aListener) throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener >& aListener ) throw (css::uno::RuntimeException);
+
+ // XDocumentPropertiesSupplier
+ virtual css::uno::Reference< css::document::XDocumentProperties >
+ SAL_CALL getDocumentProperties()
+ throw (css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XEventListener
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw (css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XModel
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual sal_Bool SAL_CALL attachResource(const OUString& sURL,
+ const css::uno::Sequence< css::beans::PropertyValue >& aArgs)
+ throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual OUString SAL_CALL getURL() throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs() throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL connectController( const css::uno::Reference< css::frame::XController >& xController ) throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL disconnectController( const css::uno::Reference< css::frame::XController >& xController ) throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL lockControllers() throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL unlockControllers() throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual sal_Bool SAL_CALL hasControllersLocked() throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController() throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL setCurrentController( const css::uno::Reference< css::frame::XController >& xController )
+ throw (css::container::NoSuchElementException, css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection() throw (css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XModel2
+ //____________________________________________________________________________________________________
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL getControllers()
+ throw (css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< OUString > SAL_CALL getAvailableViewControllerNames()
+ throw (css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createDefaultViewController(const css::uno::Reference< css::frame::XFrame >& Frame )
+ throw (css::uno::RuntimeException ,
+ css::lang::IllegalArgumentException,
+ css::uno::Exception );
+
+ virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createViewController(const OUString& ViewName ,
+ const css::uno::Sequence< css::beans::PropertyValue >& Arguments ,
+ const css::uno::Reference< css::frame::XFrame >& Frame )
+ throw (css::uno::RuntimeException ,
+ css::lang::IllegalArgumentException,
+ css::uno::Exception );
+
+ //____________________________________________________________________________________________________
+ // XModifiable2
+ //____________________________________________________________________________________________________
+
+ virtual ::sal_Bool SAL_CALL disableSetModified( ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL enableSetModified( ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isSetModifiedEnabled( ) throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual sal_Bool SAL_CALL isModified() throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL setModified( sal_Bool bModified )
+ throw (css::beans::PropertyVetoException, css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& xListener ) throw( css::uno::RuntimeException ) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > & xListener) throw( css::uno::RuntimeException ) ;
+
+ //____________________________________________________________________________________________________
+ // XCloseable
+ //____________________________________________________________________________________________________
+
+ virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) throw (css::util::CloseVetoException, css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XCloseBroadcaster
+ //____________________________________________________________________________________________________
+
+ virtual void SAL_CALL addCloseListener( const css::uno::Reference< css::util::XCloseListener >& xListener ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeCloseListener( const css::uno::Reference< css::util::XCloseListener >& xListener ) throw (css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XPrintJobBroadcaster
+ //____________________________________________________________________________________________________
+
+ virtual void SAL_CALL addPrintJobListener( const css::uno::Reference< css::view::XPrintJobListener >& xListener ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removePrintJobListener( const css::uno::Reference< css::view::XPrintJobListener >& xListener ) throw (css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XPrintable
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPrinter() throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL setPrinter( const css::uno::Sequence< css::beans::PropertyValue >& seqPrinter )
+ throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL print( const css::uno::Sequence< css::beans::PropertyValue >& seqOptions )
+ throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XStorable2
+ //____________________________________________________________________________________________________
+
+ virtual void SAL_CALL storeSelf( const css::uno::Sequence< css::beans::PropertyValue >& seqArguments )
+ throw (css::lang::IllegalArgumentException, css::io::IOException, css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XStorable
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual sal_Bool SAL_CALL hasLocation() throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual OUString SAL_CALL getLocation() throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual sal_Bool SAL_CALL isReadonly() throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL store() throw (css::io::IOException, css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL storeAsURL( const OUString& sURL,
+ const css::uno::Sequence< css::beans::PropertyValue >& seqArguments )
+ throw (css::io::IOException, css::uno::RuntimeException) ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL storeToURL( const OUString& sURL,
+ const css::uno::Sequence< css::beans::PropertyValue >& seqArguments )
+ throw (css::io::IOException, css::uno::RuntimeException);
+
+
+
+ //____________________________________________________________________________________________________
+ // XLoadable
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL initNew()
+ throw (css::frame::DoubleInitializationException,
+ css::io::IOException,
+ css::uno::RuntimeException,
+ css::uno::Exception);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL load( const css::uno::Sequence< css::beans::PropertyValue >& seqArguments )
+ throw (css::frame::DoubleInitializationException,
+ css::io::IOException,
+ css::uno::RuntimeException,
+ css::uno::Exception);
+
+ //____________________________________________________________________________________________________
+ // XDocumentSubStorageSupplier
+ //____________________________________________________________________________________________________
+
+ virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentSubStorage( const OUString& aStorageName, sal_Int32 nMode )
+ throw ( css::uno::RuntimeException );
+
+ virtual css::uno::Sequence< OUString > SAL_CALL getDocumentSubStoragesNames()
+ throw ( css::io::IOException, css::uno::RuntimeException );
+
+ //____________________________________________________________________________________________________
+ // XStorageBasedDocument
+ //____________________________________________________________________________________________________
+
+ virtual void SAL_CALL loadFromStorage( const css::uno::Reference< css::embed::XStorage >& xStorage,
+ const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescriptor )
+ throw ( css::lang::IllegalArgumentException,
+ com::sun::star::frame::DoubleInitializationException,
+ css::io::IOException,
+ css::uno::Exception,
+ css::uno::RuntimeException );
+
+ virtual void SAL_CALL storeToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage,
+ const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescriptor )
+ throw ( css::lang::IllegalArgumentException,
+ css::io::IOException,
+ css::uno::Exception,
+ css::uno::RuntimeException );
+
+ virtual void SAL_CALL switchToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage )
+ throw ( css::lang::IllegalArgumentException,
+ css::io::IOException,
+ css::uno::Exception,
+ css::uno::RuntimeException );
+
+ virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentStorage()
+ throw ( css::io::IOException,
+ css::uno::Exception,
+ css::uno::RuntimeException );
+
+ virtual void SAL_CALL addStorageChangeListener(
+ const css::uno::Reference< css::document::XStorageChangeListener >& xListener )
+ throw ( css::uno::RuntimeException );
+
+ virtual void SAL_CALL removeStorageChangeListener(
+ const css::uno::Reference< css::document::XStorageChangeListener >& xListener )
+ throw ( css::uno::RuntimeException );
+
+ //____________________________________________________________________________________________________
+ // XVisualObject
+ //____________________________________________________________________________________________________
+
+ virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const css::awt::Size& aSize )
+ throw ( css::lang::IllegalArgumentException,
+ css::embed::WrongStateException,
+ css::uno::Exception,
+ css::uno::RuntimeException );
+
+ virtual css::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect )
+ throw ( css::lang::IllegalArgumentException,
+ css::embed::WrongStateException,
+ css::uno::Exception,
+ css::uno::RuntimeException );
+
+ virtual css::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect )
+ throw ( css::lang::IllegalArgumentException,
+ css::embed::WrongStateException,
+ css::uno::Exception,
+ css::uno::RuntimeException );
+
+ virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect )
+ throw ( css::uno::Exception,
+ css::uno::RuntimeException );
+
+ //____________________________________________________________________________________________________
+ // XScriptProviderSupplier
+ //____________________________________________________________________________________________________
+
+ virtual css::uno::Reference< css::script::provider::XScriptProvider > SAL_CALL getScriptProvider() throw ( css::uno::RuntimeException );
+
+ //____________________________________________________________________________________________________
+ // XUIConfigurationManagerSupplier
+ //____________________________________________________________________________________________________
+ virtual css::uno::Reference< css::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager() throw ( css::uno::RuntimeException );
+
+ //____________________________________________________________________________________________________
+ // XTransferable
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& aFlavor )
+ throw (css::datatransfer::UnsupportedFlavorException,
+ css::io::IOException,
+ css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+
+ virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors()
+ throw (css::uno::RuntimeException);
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual sal_Bool SAL_CALL isDataFlavorSupported( const css::datatransfer::DataFlavor& aFlavor )
+ throw (css::uno::RuntimeException);
+
+
+ //____________________________________________________________________________________________________
+ // XEventsSupplier
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr - offers a list of event handlers which are be bound to events of
+ this object.
+ @seealso -
+
+ @param -
+
+ @return - an <type>Events</type> object.
+
+ @onerror -
+ */
+
+ virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() throw( css::uno::RuntimeException );
+
+
+ //____________________________________________________________________________________________________
+ // XEmbeddedScripts
+ //____________________________________________________________________________________________________
+
+ virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getBasicLibraries() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getDialogLibraries() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getAllowMacroExecution() throw (css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XScriptInvocationContext
+ //____________________________________________________________________________________________________
+
+ virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL getScriptContainer() throw (css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XEventBroadcaster
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr - registers the given <type>XEventListener</type>.
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL addEventListener( const css::uno::Reference< css::document::XEventListener >& xListener ) throw( css::uno::RuntimeException );
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr - unregisters the given <type>XEventListener</type>.
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::document::XEventListener >& xListener ) throw( css::uno::RuntimeException );
+
+ //____________________________________________________________________________________________________
+ // XDocumentEventBroadcaster
+ //____________________________________________________________________________________________________
+
+ virtual void SAL_CALL addDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& _Listener ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& _Listener ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL notifyDocumentEvent( const OUString& _EventName, const css::uno::Reference< css::frame::XController2 >& _ViewController, const css::uno::Any& _Supplement ) throw (css::lang::IllegalArgumentException, css::lang::NoSupportException, css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+ // XUnoTunnel
+ //____________________________________________________________________________________________________
+
+ virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) throw(css::uno::RuntimeException);
+
+ // css.frame.XModule
+ virtual void SAL_CALL setIdentifier(const OUString& sIdentifier)
+ throw (css::uno::RuntimeException);
+
+ // css.frame.XModule
+ virtual OUString SAL_CALL getIdentifier()
+ throw (css::uno::RuntimeException);
+
+ // css.frame.XTitle
+ virtual OUString SAL_CALL getTitle()
+ throw (css::uno::RuntimeException);
+
+ // css.frame.XTitle
+ virtual void SAL_CALL setTitle( const OUString& sTitle )
+ throw (css::uno::RuntimeException);
+
+ // css.frame.XTitleChangeBroadcaster
+ virtual void SAL_CALL addTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener )
+ throw (css::uno::RuntimeException);
+
+ // css.frame.XTitleChangeBroadcaster
+ virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener )
+ throw (css::uno::RuntimeException);
+
+ // css.frame.XUntitledNumbers
+ virtual ::sal_Int32 SAL_CALL leaseNumber( const css::uno::Reference< css::uno::XInterface >& xComponent )
+ throw (css::lang::IllegalArgumentException,
+ css::uno::RuntimeException );
+
+ // css.frame.XUntitledNumbers
+ virtual void SAL_CALL releaseNumber( ::sal_Int32 nNumber )
+ throw (css::lang::IllegalArgumentException,
+ css::uno::RuntimeException );
+
+ // css.frame.XUntitledNumbers
+ virtual void SAL_CALL releaseNumberForComponent( const css::uno::Reference< css::uno::XInterface >& xComponent )
+ throw (css::lang::IllegalArgumentException,
+ css::uno::RuntimeException );
+
+ // css.frame.XUntitledNumbers
+ virtual OUString SAL_CALL getUntitledPrefix()
+ throw (css::uno::RuntimeException);
+
+ // css.document.XDocumentRecovery
+ virtual ::sal_Bool SAL_CALL wasModifiedSinceLastSave()
+ throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL storeToRecoveryFile( const OUString& i_TargetLocation, const css::uno::Sequence< css::beans::PropertyValue >& i_MediaDescriptor )
+ throw ( css::uno::RuntimeException,
+ css::io::IOException,
+ css::lang::WrappedTargetException );
+ virtual void SAL_CALL recoverFromFile( const OUString& i_SourceLocation, const OUString& i_SalvagedFile, const css::uno::Sequence< css::beans::PropertyValue >& i_MediaDescriptor )
+ throw ( css::uno::RuntimeException,
+ css::io::IOException,
+ css::lang::WrappedTargetException );
+
+ // css.document.XUndoManagerSupplier
+ virtual css::uno::Reference< css::document::XUndoManager > SAL_CALL getUndoManager( ) throw (css::uno::RuntimeException);
+
+ //____________________________________________________________________________________________________
+
+ // css::rdf::XNode:
+ virtual OUString SAL_CALL getStringValue()
+ throw (css::uno::RuntimeException);
+
+ // css::rdf::XURI:
+ virtual OUString SAL_CALL getNamespace()
+ throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getLocalName()
+ throw (css::uno::RuntimeException);
+
+ // css::rdf::XRepositorySupplier:
+ virtual css::uno::Reference<
+ css::rdf::XRepository > SAL_CALL getRDFRepository()
+ throw (css::uno::RuntimeException);
+
+ // css::rdf::XDocumentMetadataAccess:
+ virtual css::uno::Reference<
+ css::rdf::XMetadatable > SAL_CALL
+ getElementByMetadataReference(
+ const css::beans::StringPair & i_rReference)
+ throw (css::uno::RuntimeException);
+ virtual css::uno::Reference<
+ css::rdf::XMetadatable > SAL_CALL
+ getElementByURI(const css::uno::Reference<
+ css::rdf::XURI > & i_xURI)
+ throw (css::uno::RuntimeException,
+ css::lang::IllegalArgumentException);
+ virtual css::uno::Sequence< css::uno::Reference<
+ css::rdf::XURI > > SAL_CALL getMetadataGraphsWithType(
+ const css::uno::Reference<
+ css::rdf::XURI > & i_xType)
+ throw (css::uno::RuntimeException,
+ css::lang::IllegalArgumentException);
+ virtual css::uno::Reference<
+ css::rdf::XURI> SAL_CALL
+ addMetadataFile(const OUString & i_rFileName,
+ const css::uno::Sequence<
+ css::uno::Reference< css::rdf::XURI >
+ > & i_rTypes)
+ throw (css::uno::RuntimeException,
+ css::lang::IllegalArgumentException,
+ css::container::ElementExistException);
+ virtual css::uno::Reference<
+ css::rdf::XURI> SAL_CALL
+ importMetadataFile(::sal_Int16 i_Format,
+ const css::uno::Reference<
+ css::io::XInputStream > & i_xInStream,
+ const OUString & i_rFileName,
+ const css::uno::Reference<
+ css::rdf::XURI > & i_xBaseURI,
+ const css::uno::Sequence<
+ css::uno::Reference< css::rdf::XURI >
+ > & i_rTypes)
+ throw (css::uno::RuntimeException,
+ css::lang::IllegalArgumentException,
+ css::datatransfer::UnsupportedFlavorException,
+ css::container::ElementExistException,
+ css::rdf::ParseException,
+ css::io::IOException);
+ virtual void SAL_CALL removeMetadataFile(
+ const css::uno::Reference<
+ css::rdf::XURI > & i_xGraphName)
+ throw (css::uno::RuntimeException,
+ css::lang::IllegalArgumentException,
+ css::container::NoSuchElementException);
+ virtual void SAL_CALL addContentOrStylesFile(
+ const OUString & i_rFileName)
+ throw (css::uno::RuntimeException,
+ css::lang::IllegalArgumentException,
+ css::container::ElementExistException);
+ virtual void SAL_CALL removeContentOrStylesFile(
+ const OUString & i_rFileName)
+ throw (css::uno::RuntimeException,
+ css::lang::IllegalArgumentException,
+ css::container::NoSuchElementException);
+
+ virtual void SAL_CALL loadMetadataFromStorage(
+ const css::uno::Reference<
+ css::embed::XStorage > & i_xStorage,
+ const css::uno::Reference<
+ css::rdf::XURI > & i_xBaseURI,
+ const css::uno::Reference<
+ css::task::XInteractionHandler> & i_xHandler)
+ throw (css::uno::RuntimeException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException);
+ virtual void SAL_CALL storeMetadataToStorage(
+ const css::uno::Reference<
+ css::embed::XStorage > & i_xStorage)
+ throw (css::uno::RuntimeException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException);
+ virtual void SAL_CALL loadMetadataFromMedium(
+ const css::uno::Sequence<
+ css::beans::PropertyValue > & i_rMedium)
+ throw (css::uno::RuntimeException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException);
+ virtual void SAL_CALL storeMetadataToMedium(
+ const css::uno::Sequence<
+ css::beans::PropertyValue > & i_rMedium)
+ throw (css::uno::RuntimeException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException);
+
+ // XCmisDocument
+
+ virtual css::uno::Sequence< css::beans::PropertyValue >
+ SAL_CALL getCmisPropertiesValues()
+ throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setCmisPropertiesValues(
+ const css::uno::Sequence<
+ css::beans::PropertyValue >& _cmispropertiesvalues )
+ throw (css::uno::RuntimeException);
+ virtual css::uno::Sequence< css::beans::PropertyValue >
+ SAL_CALL getCmisPropertiesDisplayNames()
+ throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setCmisPropertiesDisplayNames(
+ const css::uno::Sequence<
+ css::beans::PropertyValue >& _cmispropertiesdisplaynames )
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL checkOut( ) throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL cancelCheckOut( ) throw ( css::uno::RuntimeException );
+ virtual void SAL_CALL checkIn( sal_Bool bIsMajor, const OUString & rMessage )
+ throw ( css::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL isVersionable( ) throw ( css::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL canCheckOut( ) throw ( css::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL canCancelCheckOut( ) throw ( css::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL canCheckIn( ) throw ( css::uno::RuntimeException );
+
+ sal_Bool getBoolPropertyValue( const OUString& rName ) throw ( css::uno::RuntimeException );
+
+ //____________________________________________________________________________________________________
+ // SfxListener
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ void Notify( SfxBroadcaster& aBC ,
+ const SfxHint& aHint ) ;
+
+ //____________________________________________________________________________________________________
+ // public IMPL?
+ //____________________________________________________________________________________________________
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ void changing() ;
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ SfxObjectShell* GetObjectShell() const ;
+
+ SAL_DLLPRIVATE sal_Bool impl_isDisposed() const ;
+ sal_Bool IsInitialized() const;
+ sal_Bool IsDisposed() const { return impl_isDisposed(); }
+ void MethodEntryCheck( const bool i_mustBeInitialized ) const;
+ ::osl::Mutex& getMutex() const { return m_aMutex; }
+
+ css::uno::Reference < css::container::XIndexAccess > SAL_CALL getViewData() throw (css::uno::RuntimeException);
+ void SAL_CALL setViewData( const css::uno::Reference < css::container::XIndexAccess >& aData ) throw (css::uno::RuntimeException);
+
+ /** calls all XEventListeners */
+ void notifyEvent( const css::document::EventObject& aEvent ) const;
+
+ /** returns true if someone added a XEventListener to this XEventBroadcaster */
+ sal_Bool hasEventListeners() const;
+
+protected:
+
+ /* returns a unique id for the model that is valid as long as the document
+ is loaded. The id is not saved across document close/reload. */
+ OUString getRuntimeUID() const;
+
+ /* returns true if the document signatures are valid, otherwise false */
+ sal_Bool hasValidSignatures() const;
+
+//________________________________________________________________________________________________________
+// private methods
+//________________________________________________________________________________________________________
+
+private:
+
+ /**___________________________________________________________________________________________________
+ @short -
+ @descr -
+
+ @seealso -
+
+ @param -
+
+ @return -
+
+ @onerror -
+ */
+
+ css::uno::Reference< css::ui::XUIConfigurationManager2 > getUIConfigurationManager2() throw ( css::uno::RuntimeException );
+ bool impl_getPrintHelper();
+ SAL_DLLPRIVATE void ListenForStorage_Impl( const css::uno::Reference< css::embed::XStorage >& xStorage );
+ SAL_DLLPRIVATE OUString GetMediumFilterName_Impl();
+
+ SAL_DLLPRIVATE void impl_store( const OUString& sURL,
+ const css::uno::Sequence< css::beans::PropertyValue >& seqArguments ,
+ sal_Bool bSaveTo ) ;
+
+ SAL_DLLPRIVATE void postEvent_Impl( const OUString& aName, const css::uno::Reference< css::frame::XController2 >& xController = css::uno::Reference< css::frame::XController2 >() );
+
+ SAL_DLLPRIVATE String getEventName_Impl( long nID );
+ SAL_DLLPRIVATE bool QuerySaveSizeExceededModules( const com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >& xHandler );
+
+ SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper ();
+ SAL_DLLPRIVATE css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper ();
+
+ SAL_DLLPRIVATE SfxViewFrame* FindOrCreateViewFrame_Impl(
+ const css::uno::Reference< css::frame::XFrame >& i_rFrame,
+ ::sfx::intern::ViewCreationGuard& i_rGuard
+ ) const;
+
+ SAL_DLLPRIVATE void NotifyModifyListeners_Impl() const;
+
+ SAL_DLLPRIVATE void loadCmisProperties();
+
+ SAL_DLLPRIVATE void handleLoadError( sal_uInt32 nError, SfxMedium* pMedium );
+
+//________________________________________________________________________________________________________
+// private variables and methods
+//________________________________________________________________________________________________________
+
+private:
+
+ IMPL_SfxBaseModel_DataContainer* m_pData ;
+ // cannot be held in m_pData, since it needs to be accessed in non-threadsafe context
+ const bool m_bSupportEmbeddedScripts;
+ const bool m_bSupportDocRecovery;
+
+} ; // class SfxBaseModel
+
+/** base class for sub components of an SfxBaseModel, which share their ref count and lifetime with the SfxBaseModel
+*/
+class SFX2_DLLPUBLIC SfxModelSubComponent
+{
+public:
+ /** checks whether the instance is alive, i.e. properly initialized, and not yet disposed
+ */
+ void MethodEntryCheck()
+ {
+ m_rModel.MethodEntryCheck( true );
+ }
+
+ // called when the SfxBaseModel which the component is superordinate of is being disposed
+ virtual void disposing();
+
+protected:
+ SfxModelSubComponent( SfxBaseModel& i_model )
+ :m_rModel( i_model )
+ {
+ }
+ virtual ~SfxModelSubComponent();
+
+ // helpers for implementing XInterface - delegates ref counting to the SfxBaseModel
+ void acquire() { m_rModel.acquire(); }
+ void release() { m_rModel.release(); }
+
+ bool isDisposed() const { return m_rModel.IsDisposed(); }
+
+protected:
+ const SfxBaseModel& getBaseModel() const { return m_rModel; }
+ SfxBaseModel& getBaseModel() { return m_rModel; }
+
+ ::osl::Mutex& getMutex() { return m_rModel.getMutex(); }
+
+private:
+ SfxBaseModel& m_rModel;
+};
+
+class SFX2_DLLPUBLIC SfxModelGuard
+{
+public:
+ enum AllowedModelState
+ {
+ // not yet initialized
+ E_INITIALIZING,
+ // fully alive, i.e. initialized, and not yet disposed
+ E_FULLY_ALIVE
+ };
+
+ SfxModelGuard( SfxBaseModel& i_rModel, const AllowedModelState i_eState = E_FULLY_ALIVE )
+ : m_aGuard()
+ {
+ i_rModel.MethodEntryCheck( i_eState != E_INITIALIZING );
+ }
+ SfxModelGuard( SfxModelSubComponent& i_rSubComponent )
+ :m_aGuard()
+ {
+ i_rSubComponent.MethodEntryCheck();
+ }
+ ~SfxModelGuard()
+ {
+ }
+
+ void reset()
+ {
+ m_aGuard.reset();
+ }
+
+ void clear()
+ {
+ m_aGuard.clear();
+ }
+
+private:
+ SolarMutexResettableGuard m_aGuard;
+};
+
+#endif // _SFX_SFXBASEMODEL_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxcommands.h b/include/sfx2/sfxcommands.h
new file mode 100644
index 000000000000..3f4df5cb5220
--- /dev/null
+++ b/include/sfx2/sfxcommands.h
@@ -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 SFX2_SFXCOMMANDS_HRC
+#define SFX2_SFXCOMMANDS_HRC
+
+#define CMD_SID_ABOUT ".uno:About"
+#define CMD_SID_NEWDOC ".uno:NewDoc"
+#define CMD_SID_BROWSE_BACKWARD ".uno:BrowseBackward"
+#define CMD_SID_BROWSE_FORWARD ".uno:BrowseForward"
+#define CMD_SID_CLOSEWIN ".uno:CloseWin"
+#define CMD_SID_COPY ".uno:Copy"
+#define CMD_SID_CUT ".uno:Cut"
+#define CMD_SID_DELETE ".uno:Delete"
+#define CMD_SID_BASICIDE_DELETECURRENT ".uno:DeleteCurrent"
+#define CMD_SID_STYLE_DESIGNER ".uno:DesignerDialog"
+#define CMD_SID_EDITDOC ".uno:EditDoc"
+#define CMD_SID_STYLE_EDIT ".uno:EditStyle"
+#define CMD_SID_WIN_FULLSCREEN ".uno:FullScreen"
+#define CMD_SID_BASICIDE_HIDECURPAGE ".uno:HideCurPage"
+#define CMD_SID_HYPERLINK_DIALOG ".uno:HyperlinkDialog"
+#define CMD_SID_BASICIDE_MODULEDLG ".uno:ModuleDialog"
+#define CMD_SID_NAVIGATOR ".uno:Navigator"
+#define CMD_SID_BASICIDE_NEWDIALOG ".uno:NewDialog"
+#define CMD_SID_BASICIDE_NEWMODULE ".uno:NewModule"
+#define CMD_SID_OBJECT ".uno:ObjectMenue"
+#define CMD_SID_OPENDOC ".uno:Open"
+#define CMD_SID_WEBHTML ".uno:WebHtml"
+#define CMD_SID_OPENHYPERLINK ".uno:OpenHyperlink"
+#define CMD_SID_DOCINFO_TITLE ".uno:DocInfoTitle"
+#define CMD_SID_OPENTEMPLATE ".uno:OpenTemplate"
+#define CMD_SID_CHECKOUT ".uno:CheckOut"
+#define CMD_SID_CANCELCHECKOUT ".uno:CancelCheckOut"
+#define CMD_SID_CHECKIN ".uno:CheckIn"
+#define CMD_SID_OPENURL ".uno:OpenUrl"
+#define CMD_SID_OPTIONS ".uno:Options"
+#define CMD_SID_ORGANIZER ".uno:Organizer"
+#define CMD_SID_PASTE ".uno:Paste"
+#define CMD_SID_PASTE_SPECIAL ".uno:PasteSpecial"
+#define CMD_SID_PASTE_ONLY ".uno:PasteOnly"
+#define CMD_SID_PASTE_ONLY_VALUE ".uno:PasteOnlyValue"
+#define CMD_SID_PASTE_ONLY_TEXT ".uno:PasteOnlyText"
+#define CMD_SID_PASTE_ONLY_FORMULA ".uno:PasteOnlyFormula"
+#define CMD_SID_PRINTPREVIEW ".uno:PrintPreview"
+#define CMD_SID_RELOAD ".uno:Reload"
+#define CMD_SID_BASICIDE_RENAMECURRENT ".uno:RenameCurrent"
+#define CMD_SID_DOCTEMPLATE ".uno:SaveAsTemplate"
+#define CMD_SID_SEARCH_DLG ".uno:SearchDialog"
+#define CMD_SID_SHOW_BROWSER ".uno:ShowBrowser"
+#define CMD_SID_STYLE_NEW_BY_EXAMPLE ".uno:StyleNewByExample"
+#define CMD_SID_INET_DLG ".uno:InternetDialog"
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxdefs.hxx b/include/sfx2/sfxdefs.hxx
new file mode 100644
index 000000000000..cca545f7e2f7
--- /dev/null
+++ b/include/sfx2/sfxdefs.hxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SFXDEFS_HXX
+#define _SFXDEFS_HXX
+
+#define SfxFilterFlags sal_uLong
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxdlg.hxx b/include/sfx2/sfxdlg.hxx
new file mode 100644
index 000000000000..a994c7dfa77a
--- /dev/null
+++ b/include/sfx2/sfxdlg.hxx
@@ -0,0 +1,158 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFX2_DIALOG_HXX
+#define _SFX2_DIALOG_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <vcl/abstdlg.hxx>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+
+#include <sot/exchange.hxx>
+#include <sfx2/lnkbase.hxx>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Reference.h>
+
+class SfxTabPage;
+class SfxViewFrame;
+class SfxBindings;
+class SfxItemSet;
+class ResId;
+class Window;
+class String;
+class SfxItemPool;
+class SvObjectServerList;
+class TransferableDataHelper;
+struct TransferableObjectDescriptor;
+
+#include <sfx2/tabdlg.hxx>
+
+namespace sfx2
+{
+ class LinkManager;
+}
+
+namespace com { namespace sun { namespace star { namespace frame {
+ class XModel;
+} } } }
+
+class SfxAbstractDialog : virtual public VclAbstractDialog
+{
+public:
+ virtual const SfxItemSet* GetOutputItemSet() const = 0;
+ virtual void SetText( const OUString& rStr ) = 0;
+ virtual OUString GetText() const = 0;
+};
+
+class SfxAbstractTabDialog : virtual public SfxAbstractDialog
+{
+public:
+ virtual void SetCurPageId( sal_uInt16 nId ) = 0;
+ virtual void SetCurPageId( const OString &rName ) = 0;
+ virtual const sal_uInt16* GetInputRanges( const SfxItemPool& ) = 0;
+ virtual void SetInputSet( const SfxItemSet* pInSet ) = 0;
+};
+
+class SfxAbstractApplyTabDialog : virtual public SfxAbstractTabDialog
+{
+public:
+ virtual void SetApplyHdl( const Link& rLink ) = 0;
+};
+
+class SfxAbstractInsertObjectDialog : virtual public VclAbstractDialog
+{
+public:
+ virtual com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObject()=0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( OUString* pGraphicMediaType )=0;
+ virtual sal_Bool IsCreateNew()=0;
+};
+
+class SfxAbstractPasteDialog : virtual public VclAbstractDialog
+{
+public:
+ virtual void Insert( SotFormatStringId nFormat, const String & rFormatName ) = 0;
+ virtual void SetObjName( const SvGlobalName & rClass, const String & rObjName ) = 0;
+ virtual sal_uIntPtr GetFormat( const TransferableDataHelper& aHelper,
+ const DataFlavorExVector* pFormats=0,
+ const TransferableObjectDescriptor* pDesc=0 ) = 0;
+};
+
+class SfxAbstractLinksDialog : virtual public VclAbstractDialog
+{
+};
+
+class AbstractScriptSelectorDialog : virtual public VclAbstractDialog
+{
+public:
+ virtual String GetScriptURL() const = 0;
+ virtual void SetRunLabel() = 0;
+};
+
+namespace com { namespace sun { namespace star { namespace frame { class XFrame; } } } }
+
+class SFX2_DLLPUBLIC SfxAbstractDialogFactory : virtual public VclAbstractDialogFactory
+{
+public:
+ virtual ~SfxAbstractDialogFactory(); // needed for export of vtable
+ static SfxAbstractDialogFactory* Create();
+ virtual VclAbstractDialog* CreateSfxDialog( Window* pParent, const SfxBindings& rBindings, sal_uInt32 nResId ) = 0;
+ virtual VclAbstractDialog* CreateFrameDialog( Window* pParent, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, sal_uInt32 nResId, const String& rParameter ) = 0;
+ virtual SfxAbstractTabDialog* CreateTabDialog( sal_uInt32 nResId,
+ Window* pParent,
+ const SfxItemSet* pAttrSet,
+ SfxViewFrame* pViewFrame,
+ bool bEditFmt=false,
+ const String *pUserButtonText=0 ) = 0;
+ virtual SfxAbstractTabDialog* CreateTabDialog( sal_uInt32 nResId,
+ Window* pParent,
+ const SfxItemSet* pAttrSet,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xViewFrame,
+ bool bEditFmt=false,
+ const String *pUserButtonText=0 ) = 0;
+ virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) = 0;
+ virtual GetTabPageRanges GetTabPageRangesFunc( sal_uInt16 nId ) = 0;
+ virtual SfxAbstractInsertObjectDialog* CreateInsertObjectDialog( Window* pParent, const OUString& rCommand,
+ const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStor,
+ const SvObjectServerList* pList = 0 )=0;
+ virtual VclAbstractDialog* CreateEditObjectDialog( Window* pParent, const OUString& rCommand,
+ const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj )=0;
+ virtual SfxAbstractPasteDialog* CreatePasteDialog( Window* pParent )=0;
+ virtual SfxAbstractLinksDialog* CreateLinksDialog( Window* pParent, sfx2::LinkManager* pMgr, sal_Bool bHTML=sal_False, sfx2::SvBaseLink* p=0 )=0;
+ virtual VclAbstractDialog * CreateSvxScriptOrgDialog( Window* pParent, const String& rLanguage ) = 0;
+
+ virtual AbstractScriptSelectorDialog*
+ CreateScriptSelectorDialog(
+ Window* pParent,
+ sal_Bool bShowSlots,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame
+ ) = 0;
+
+ virtual VclAbstractDialog* CreateScriptErrorDialog(
+ Window* pParent, com::sun::star::uno::Any aException ) = 0;
+
+ virtual VclAbstractDialog* CreateOptionsDialog(
+ Window* pParent, const OUString& rExtensionId, const OUString& rApplicationContext ) = 0;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxhelp.hxx b/include/sfx2/sfxhelp.hxx
new file mode 100644
index 000000000000..9de00f008736
--- /dev/null
+++ b/include/sfx2/sfxhelp.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 _SFX_HELP_HXX
+#define _SFX_HELP_HXX
+
+#include <rtl/ustring.hxx>
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <vcl/help.hxx>
+
+class SfxHelp_Impl;
+class SfxFrame;
+class SFX2_DLLPUBLIC SfxHelp : public Help
+{
+ OUString aTicket; // for Plugins
+ OUString aUser;
+ OUString aLanguageStr;
+ OUString aCountryStr;
+ sal_Bool bIsDebug;
+ SfxHelp_Impl* pImp;
+
+private:
+ SAL_DLLPRIVATE sal_Bool Start_Impl( const OUString& rURL, const Window* pWindow, const OUString& rKeyword );
+ SAL_DLLPRIVATE virtual sal_Bool SearchKeyword( const OUString& rKeyWord );
+ SAL_DLLPRIVATE virtual sal_Bool Start( const OUString& rURL, const Window* pWindow );
+ SAL_DLLPRIVATE virtual void OpenHelpAgent( const OString& sHelpId );
+ SAL_DLLPRIVATE OUString GetHelpModuleName_Impl();
+ SAL_DLLPRIVATE OUString CreateHelpURL_Impl( const OUString& aCommandURL, const OUString& rModuleName );
+
+public:
+ SfxHelp();
+ ~SfxHelp();
+
+ inline void SetTicket( const OUString& rTicket ) { aTicket = rTicket; }
+ inline void SetUser( const OUString& rUser ) { aUser = rUser; }
+
+ virtual OUString GetHelpText( const OUString&, const Window* pWindow );
+
+ static OUString CreateHelpURL( const OUString& aCommandURL, const OUString& rModuleName );
+ using Help::OpenHelpAgent;
+ static void OpenHelpAgent( SfxFrame* pFrame, const OString& sHelpId );
+ static OUString GetDefaultHelpModule();
+ static OUString GetCurrentModuleIdentifier();
+};
+
+#endif // #ifndef _SFX_HELP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxhtml.hxx b/include/sfx2/sfxhtml.hxx
new file mode 100644
index 000000000000..7569afe483c2
--- /dev/null
+++ b/include/sfx2/sfxhtml.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 _SFXHTML_HXX
+#define _SFXHTML_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <i18nlangtag/lang.h>
+#include <svtools/parhtml.hxx>
+#include <svl/macitem.hxx>
+
+
+class ImageMap;
+class SfxMedium;
+class SfxObjectShell;
+
+class SFX2_DLLPUBLIC SfxHTMLParser : public HTMLParser
+{
+ String aScriptType;
+
+ SfxMedium* pMedium;
+ SfxMedium *pDLMedium; // Medium for Download Files
+
+ ScriptType eScriptType;
+
+ SAL_DLLPRIVATE void GetScriptType_Impl( SvKeyValueIterator* );
+
+protected:
+
+ SfxHTMLParser( SvStream& rStream, sal_Bool bNewDoc=sal_True, SfxMedium *pMedium=0 );
+
+ virtual ~SfxHTMLParser();
+
+public:
+ // Read the options of an image map
+ // <MAP>: sal_True = Image-Map has a name
+ // <AREA>: sal_True = Image-Map has now one Region more
+ static bool ParseMapOptions(ImageMap* pImageMap, const HTMLOptions& rOptions);
+ bool ParseMapOptions(ImageMap * pImageMap)
+ { return ParseMapOptions(pImageMap, GetOptions()); }
+ static bool ParseAreaOptions(ImageMap * pImageMap, const String& rBaseURL,
+ const HTMLOptions& rOptions,
+ sal_uInt16 nEventMouseOver = 0,
+ sal_uInt16 nEventMouseOut = 0 );
+ inline sal_Bool ParseAreaOptions(ImageMap * pImageMap, const String& rBaseURL,
+ sal_uInt16 nEventMouseOver = 0,
+ sal_uInt16 nEventMouseOut = 0);
+
+ // <TD SDVAL="..." SDNUM="...">
+ static double GetTableDataOptionsValNum( sal_uInt32& nNumForm,
+ LanguageType& eNumLang, const String& aValStr,
+ const String& aNumStr, SvNumberFormatter& rFormatter );
+
+protected:
+ // Start a file download. This is done asynchronously or synchronously.
+ // In the synchronous case, the parser is in the working state after
+ // it has been called. The read file can then be picked up directly with
+ // FinishFileDownload. In the asynchronous case, the parser is in the
+ // pending state after it hs been called. The parser then has to leave
+ // over the Continue (without Reschedule!). If the file is loaded,
+ // a Continue is called with passed on token. The file can then be picked
+ // up by FinishFileDownload. To cancel the download should a shell be
+ // left. It can only exist a single download at the same time, For every
+ // started download FinshFileDownload must be called.
+ void StartFileDownload(const OUString& rURL);
+
+ // End of an asynchronous file download. Returns TRUE if the download
+ // was successful. The read file is then passed into String.
+ sal_Bool FinishFileDownload( String& rStr );
+
+ // Returns TRUE if a file was downloaded and if FileDownloadFinished
+ // has not yet been called
+ sal_Bool ShouldFinishFileDownload() const { return pDLMedium != 0; }
+
+ SfxMedium *GetMedium() { return pMedium; }
+ const SfxMedium *GetMedium() const { return pMedium; }
+
+ // Default (without iterator) is JavaScript
+ ScriptType GetScriptType( SvKeyValueIterator* ) const;
+ const String& GetScriptTypeString( SvKeyValueIterator* ) const;
+};
+
+inline sal_Bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const String& rBaseURL,
+ sal_uInt16 nEventMouseOver,
+ sal_uInt16 nEventMouseOut)
+{
+ return ParseAreaOptions( pImageMap, rBaseURL, GetOptions(),
+ nEventMouseOver, nEventMouseOut );
+}
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxmodelfactory.hxx b/include/sfx2/sfxmodelfactory.hxx
new file mode 100644
index 000000000000..612aea61d07e
--- /dev/null
+++ b/include/sfx2/sfxmodelfactory.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 SFX2_SFXMODELFACTORY_HXX
+#define SFX2_SFXMODELFACTORY_HXX
+
+#include "sfx2/dllapi.h"
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+
+//........................................................................
+namespace sfx2
+{
+//........................................................................
+
+ #define SFXMODEL_STANDARD (sal_uInt64)(0x0000)
+ #define SFXMODEL_EMBEDDED_OBJECT (sal_uInt64)(0x0001)
+ #define SFXMODEL_DISABLE_EMBEDDED_SCRIPTS (sal_uInt64)(0x0002)
+ #define SFXMODEL_DISABLE_DOCUMENT_RECOVERY (sal_uInt64)(0x0004)
+
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ( SAL_CALL * SfxModelFactoryFunc ) (
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,
+ const sal_uInt64 _nCreationFlags
+ );
+
+ //====================================================================
+ //= createSfxModelFactory
+ //====================================================================
+ /** creates a XSingleServiceFactory which can be used to created instances
+ of classes derived from SfxBaseModel
+
+ In opposite to the default implementations from module cppuhelper, this
+ factory evaluates certain creation arguments (passed to createInstanceWithArguments)
+ and passes them to the factory function of the derived class.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >
+ SFX2_DLLPUBLIC createSfxModelFactory(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceFactory,
+ const OUString& _rImplementationName,
+ const SfxModelFactoryFunc _pComponentFactoryFunc,
+ const ::com::sun::star::uno::Sequence< OUString >& _rServiceNames
+ );
+
+//........................................................................
+} // namespace sfx2
+//........................................................................
+
+#endif // SFX2_SFXMODELFACTORY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxresid.hxx b/include/sfx2/sfxresid.hxx
new file mode 100644
index 000000000000..f90221847579
--- /dev/null
+++ b/include/sfx2/sfxresid.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 _SFX_SFXRESID_HXX
+#define _SFX_SFXRESID_HXX
+
+#include "sfx2/dllapi.h"
+#include <tools/resid.hxx>
+
+class SFX2_DLLPUBLIC SfxResId: public ResId
+{
+public:
+ SfxResId( sal_uInt16 nId );
+ static ResMgr* GetResMgr();
+ static void DeleteResMgr();
+};
+
+#define SFX2_RESSTR(x) SfxResId(x).toString()
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
new file mode 100644
index 000000000000..00923ffdc6a8
--- /dev/null
+++ b/include/sfx2/sfxsids.hrc
@@ -0,0 +1,753 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXSIDS_HRC
+#define _SFXSIDS_HRC
+
+#include <svl/solar.hrc>
+#include <sfx2/cntids.hrc>
+#include <svl/memberid.hrc>
+
+// Please be careful:
+// Changing just one part here doesn't add new
+// docking windows automatically!
+//
+
+#define SID_DOCKWIN_0 SID_DOCKWIN_START
+#define SID_DOCKWIN_1 SID_DOCKWIN_START+1
+#define SID_DOCKWIN_2 SID_DOCKWIN_START+2
+#define SID_DOCKWIN_3 SID_DOCKWIN_START+3
+#define SID_DOCKWIN_4 SID_DOCKWIN_START+4
+#define SID_DOCKWIN_5 SID_DOCKWIN_START+5
+#define SID_DOCKWIN_6 SID_DOCKWIN_START+6
+#define SID_DOCKWIN_7 SID_DOCKWIN_START+7
+#define SID_DOCKWIN_8 SID_DOCKWIN_START+8
+#define SID_DOCKWIN_9 SID_DOCKWIN_START+9
+
+//=========================================================================
+
+#define SID_UNKNOWN SID_SFX_START
+
+//-------------------------------------------------------------------------
+
+// default-ids for application
+#define SID_QUITAPP (SID_SFX_START + 300)
+#define SID_ABOUT (SID_SFX_START + 301)
+#define SID_SETUPPRINTER (SID_SFX_START + 302)
+#define SID_EXITANDRETURN (SID_SFX_START + 303)
+
+#define SID_CONTEXT (SID_SFX_START + 310)
+
+#define SID_PASTE_SPECIAL (SID_SFX_START + 311)
+#define SID_CLIPBOARD_FORMAT_ITEMS (SID_SFX_START + 312)
+
+#define SID_VERSION_VISIBLE (SID_SFX_START + 313)
+#define SID_PASTE_UNFORMATTED (SID_SFX_START + 314)
+#define SID_PRINTER_NOTFOUND_WARN (SID_SFX_START + 320)
+#define SID_PRINTER_NAME (SID_SFX_START + 322)
+#define SID_PRINTER_CHANGESTODOC (SID_SFX_START + 324)
+#define SID_PRINTPREVIEW (SID_SFX_START + 325)
+
+#define SID_MAIL_SUBJECT (SID_SFX_START + 328)
+#define SID_MAIL_NOTIFY (SID_SFX_START + 330)
+#define SID_MAIL_SENDDOC (SID_SFX_START + 331)
+#define SID_MAIL_SENDDOCASPDF (SID_SFX_START + 1672)
+
+#define SID_MAIL_RECIPIENT (SID_SFX_START + 334)
+#define SID_MAIL_TEXT (SID_SFX_START + 335)
+#define SID_MAIL_ATTACH (SID_SFX_START + 336)
+#define SID_MAIL_PRIORITY (SID_SFX_START + 337)
+
+#define SID_MAIL_ATTACH_FILE (SID_SFX_START + 375)
+#define SID_MAIL_PREPAREEXPORT (SID_SFX_START + 385)
+
+#define SID_MAIL_EXPORT_FINISHED (SID_SFX_START + 388)
+#define SID_WEBHTML (SID_SFX_START + 393)
+#define SID_MAIL_SCROLLBODY_PAGEDOWN (SID_SFX_START + 1588)
+
+#define SID_PROGRESS_STATUSBAR_CONTROL (SID_SFX_START + 1597)
+
+#define SID_APPLICATION (SID_SFX_START + 340)
+#define SID_PROGNAME (SID_SFX_START + 341)
+#define SID_PROGFILENAME (SID_SFX_START + 342)
+#define SID_SELECTION (SID_SFX_START + 346)
+
+// 360-400 see SID_MAIL_...
+
+// default-ids for help
+#define SID_HELPONHELP (SID_SFX_START + 400)
+#define SID_HELPINDEX (SID_SFX_START + 401)
+#define SID_EXTENDEDHELP (SID_SFX_START + 402)
+#define SID_HELPBALLOONS (SID_SFX_START + 403)
+#define SID_HELPTIPS (SID_SFX_START + 404)
+#define SID_HELPMENU (SID_SFX_START + 410)
+#define SID_HELP_INDEX (SID_SFX_START + 411)
+#define SID_HELP_SEARCH (SID_SFX_START + 412)
+#define SID_HELP_ANNOTATE (SID_SFX_START + 413)
+#define SID_HELP_BOOKMARK (SID_SFX_START + 414)
+#define SID_HELP_DOWNLOAD (SID_SFX_START + 415)
+#define SID_HELP_ZOOMIN (SID_SFX_START + 417)
+#define SID_HELP_ZOOMOUT (SID_SFX_START + 418)
+#define SID_HELP_HELPFILEBOX (SID_SFX_START + 419)
+#define SID_SEND_FEEDBACK (SID_SFX_START + 421)
+#define SID_SHOW_LICENSE (SID_SFX_START + 1683)
+#define SID_SHOW_CREDITS (SID_SFX_START + 1711)
+#define SID_HELP_TUTORIALS (SID_SFX_START + 1695)
+
+// default-ids for document
+#define SID_NEWDOC (SID_SFX_START + 500)
+#define SID_OPENDOC (SID_SFX_START + 501)
+#define SID_OPENURL (SID_SFX_START + 596)
+#define SID_SAVEASURL (SID_SFX_START + 643)
+#define SID_JUMPTOMARK (SID_SFX_START + 598)
+#define SID_OPENTEMPLATE (SID_SFX_START + 594)
+#define SID_SAVEASDOC (SID_SFX_START + 502)
+#define SID_SAVEACOPY (SID_SFX_START + 999)
+#define SID_CLOSING (SID_SFX_START +1539)
+#define SID_CLOSEDOC (SID_SFX_START + 503)
+#define SID_CLOSEDOCS (SID_SFX_START + 595)
+#define SID_CLOSEDOC_SAVE (SID_SFX_START + 1)
+#define SID_CLOSEDOC_FILENAME (SID_SFX_START + 2)
+#define SID_PRINTDOC (SID_SFX_START + 504)
+#define SID_PRINT_FIRST_PAGE (SID_SFX_START + 1)
+#define SID_PRINT_LAST_PAGE (SID_SFX_START + 2)
+#define SID_PRINT_COPIES (SID_SFX_START + 3)
+#define SID_PRINT_PAGES (SID_SFX_START +1589)
+#define SID_PRINT_COLLATE (SID_SFX_START +1590)
+#define SID_PRINT_SORT (SID_SFX_START +1591)
+#define SID_SAVEDOC (SID_SFX_START + 505)
+#define SID_UPDATEDOC (SID_SFX_START + 506)
+#define SID_FILE_NAME (SID_SFX_START + 507)
+#define SID_DOCINFO_TITLE (SID_SFX_START + 557)
+#define SID_FILE_FILTEROPTIONS (SID_SFX_START + 527)
+#define SID_RELOAD (SID_SFX_START + 508)
+#define SID_PRINTDOCDIRECT (SID_SFX_START + 509)
+#define SID_PICKLIST (SID_SFX_START + 510)
+#define SID_DOC_SERVICE (SID_SFX_START + 511)
+#define SID_ATTR_XWINDOW (SID_SFX_START + 777)
+#define SID_PLUGIN_MODE (SID_SFX_START + 827)
+#define SID_EXPORTDOC (SID_SFX_START + 829)
+#define SID_EXPORTDOCASPDF (SID_SFX_START + 1673)
+#define SID_DIRECTEXPORTDOCASPDF (SID_SFX_START + 1674)
+#define SID_UPDATEDOCMODE (SID_SFX_START + 1668)
+#define SID_CHECKOUT (SID_SFX_START + 512)
+#define SID_CANCELCHECKOUT (SID_SFX_START + 513)
+#define SID_CHECKIN (SID_SFX_START + 514)
+#define SID_FILTER_PROVIDER (SID_SFX_START + 515)
+
+#define SID_FORCERELOAD (SID_SFX_START + 1502)
+#define SID_FILE_DIALOG (SID_SFX_START + 304)
+#define SID_PATH (SID_SFX_START + 308)
+#define SID_SAVEDOCS (SID_SFX_START + 309)
+#define SID_STANDARD_DIR (SID_SFX_START + 450)
+#define SID_BLACK_LIST (SID_SFX_START + 451)
+
+// browse-ids
+#define SID_BROWSE_FORWARD (SID_SFX_START + 1300)
+#define SID_BROWSE_BACKWARD (SID_SFX_START + 1301)
+#define SID_CREATELINK (SID_SFX_START + 1309)
+#define SID_BOOKMARK_TITLE (SID_SFX_START + 1310)
+#define SID_BOOKMARK_URL (SID_SFX_START + 1311)
+#define SID_EDITDOC (SID_SFX_START + 1312)
+#define SID_BROWSER_MODE (SID_SFX_START + 1313)
+#define SID_PLUGINS_ACTIVE (SID_SFX_START + 1314)
+#define SID_BROWSER (SID_SFX_START + 1318)
+#define SID_MACROEXECMODE (SID_SFX_START + 1319)
+
+#define SID_FILTER_DATA (SID_SFX_START + 1375)
+
+#define SID_EXPLORER_FILEPROPS_START (SID_SFX_START + 1390)
+// SID_EXPLORER_FILEPROPS_END (SID_SFX_START + 1399)
+
+#define ID_FILETP_START SID_EXPLORER_FILEPROPS_START
+#define ID_FILETP_READONLY (ID_FILETP_START + 0)
+#define ID_FILETP_TITLE (ID_FILETP_START + 1)
+
+#define SID_ATTR_ZOOM (SID_SVX_START + 0)
+
+#define SID_EXPLORER_PROPS_START (SID_SFX_START + 1410)
+// SID_EXPLORER_PROPS_END (SID_SFX_START + 1499)
+
+#define SID_AUTOLOAD (SID_SFX_START + 1509)
+#define SID_FILLFRAME (SID_SFX_START + 1516)
+#define SID_BASEURL (SID_SFX_START + 1518)
+#define SID_TEMPLATE (SID_SFX_START + 1519)
+
+#define SID_CONTENTTYPE (SID_SFX_START + 1541)
+
+#define SID_SAVETO (SID_SFX_START + 1546)
+
+#define SID_CREATE_BASICOBJECT (SID_SFX_START + 1555)
+#define SID_DELETE_BASICOBJECT (SID_SFX_START + 1556)
+
+#define SID_UPDATE_VERSION (SID_SFX_START + 1568)
+#define SID_BUILD_VERSION (SID_SFX_START + 1569)
+
+#define SID_VERSION (SID_SFX_START + 1583)
+
+#define SID_DOCUMENT_COMPARE (SID_SFX_START + 1586)
+#define SID_DOCUMENT_MERGE (SID_SFX_START + 1587)
+
+#define SID_OFFICE_CUSTOMERNUMBER (SID_SFX_START + 1608)
+#define SID_OFFICE_CHECK_PLZ (SID_SFX_START + 1610)
+#define SID_CURRENT_URL (SID_SFX_START + 1613)
+
+#define SID_TIPWINDOW (SID_SFX_START + 1632)
+#define SID_CHARSET (SID_SFX_START + 1633)
+#define SID_OVERWRITE (SID_SFX_START + 1634)
+#define SID_RENAME (SID_SFX_START + 1653)
+#define SID_PARTWIN (SID_SFX_START + 1640)
+#define SID_CRASH (SID_SFX_START + 1645)
+#define SID_FAIL_ON_WARNING (SID_SFX_START + 1646)
+#define SID_INPUTSTREAM (SID_SFX_START + 1648)
+#define SID_LOGOUT (SID_SFX_START + 1652)
+#define SID_JUMPMARK (SID_SFX_START + 1654)
+#define SID_BROWSE (SID_SFX_START + 1658)
+ // FREE (was: SID_BACKTOWEBTOP)
+#define SID_SEGMENTSIZE (SID_SFX_START + 1659)
+#define SID_VIEW_DATA_SOURCE_BROWSER (SID_SFX_START + 1660)
+#define SID_TOGGLE_MENUBAR (SID_SFX_START + 1661)
+#define SID_UNPACK (SID_SFX_START + 1662)
+// (SID_SFX_START + 1663) used further down
+#define SID_MACRO_WARNING (SID_SFX_START + 1664)
+#define SID_MACRO_CONFIRMATION (SID_SFX_START + 1665)
+#define SID_OUTPUTSTREAM (SID_SFX_START + 1666)
+#define SID_IMAGE_ORIENTATION (SID_SFX_START + 1667)
+
+#define SID_SAVE_VERSION_ON_CLOSE (SID_SFX_START + 1670)
+#define SID_STOP_RECORDING (SID_SFX_START + 1671)
+#define SID_INTERACTIONHANDLER (SID_SFX_START + 1675)
+#define SID_OPENHYPERLINK (SID_SFX_START + 1676)
+#define SID_ADDONLIST (SID_SFX_START + 1677)
+#define SID_ADDONS (SID_SFX_START + 1678)
+#define SID_CONTENT (SID_SFX_START + 1679)
+#define SID_SHOW_IME_STATUS_WINDOW (SID_SFX_START + 1680)
+#define SID_UPDATE_CONFIG (SID_SFX_START + 1681)
+#define SID_VIEWONLY (SID_SFX_START + 1682)
+#define SID_REPAIRPACKAGE (SID_SFX_START + 1683)
+#define SID_ADDONHELP (SID_SFX_START + 1684)
+#define SID_MINIMIZED (SID_SFX_START + 1687)
+#define SID_COMPONENTDATA (SID_SFX_START + 1688)
+#define SID_COMPONENTCONTEXT (SID_SFX_START + 1689)
+#define SID_SCRIPTORGANIZER (SID_SFX_START + 1690)
+#define SID_MACROORGANIZER (SID_SFX_START + 1691)
+#define SID_RUNMACRO (SID_SFX_START + 1692)
+#define SID_AVMEDIA_TOOLBOX (SID_SFX_START + 1693)
+#define SID_AVMEDIA_PLAYER (SID_SFX_START + 1694)
+#define SID_INSERT_AVMEDIA (SID_SFX_START + 1696)
+#define SID_RECENTFILELIST (SID_SFX_START + 1697)
+#define SID_AVAILABLE_TOOLBARS (SID_SFX_START + 1698)
+#define SID_STREAM (SID_SFX_START + 1699)
+#define SID_DOC_BASEURL (SID_SFX_START + 1700)
+#define SID_DOC_HIERARCHICALNAME (SID_SFX_START + 1701)
+#define SID_TERMINATE_INPLACEACTIVATION (SID_SFX_START + 1702)
+#define SID_APPLY_STYLE (SID_SFX_START + 1703)
+#define SID_MACRO_SIGNATURE (SID_SFX_START + 1704)
+#define SID_ATTR_WARNALIENFORMAT (SID_SFX_START + 1705)
+#define SID_COPY_STREAM_IF_POSSIBLE (SID_SFX_START + 1706)
+#define SID_MAIL_SENDDOCASFORMAT (SID_SFX_START + 1707)
+#define SID_MAIL_SENDDOCASMS (SID_SFX_START + 1708)
+#define SID_MAIL_SENDDOCASOOO (SID_SFX_START + 1709)
+#define SID_NOAUTOSAVE (SID_SFX_START + 1711)
+#define SID_PRINT_SELECTEDSHEET (SID_SFX_START + 1712)
+#define SID_OPTIONS_PAGEURL (SID_SFX_START + 1713)
+#define SID_MORE_DICTIONARIES (SID_SFX_START + 1714)
+#define SID_ACTIVATE_STYLE_APPLY (SID_SFX_START + 1715)
+#define SID_FONT_NAME (SID_SFX_START + 1716)
+#define SID_DEFAULTFILENAME (SID_SFX_START + 1717)
+#define SID_MODIFYPASSWORDINFO (SID_SFX_START + 1718)
+#define SID_RECOMMENDREADONLY (SID_SFX_START + 1719)
+#define SID_SUGGESTEDSAVEASDIR (SID_SFX_START + 1720)
+#define SID_SUGGESTEDSAVEASNAME (SID_SFX_START + 1721)
+#define SID_ENCRYPTIONDATA (SID_SFX_START + 1722)
+#define SID_PASSWORDINTERACTION (SID_SFX_START + 1723)
+#define SID_GOTOLINE (SID_SFX_START + 1724)
+#define SID_SHOWLINES (SID_SFX_START + 1725)
+#define SID_BLUETOOTH_SENDDOC (SID_SFX_START + 1726)
+#define SID_TEMPLATE_MANAGER (SID_SFX_START + 1727)
+
+// SID_SFX_free_START (SID_SFX_START + 1728)
+// SID_SFX_free_END (SID_SFX_START + 3999)
+
+#define SID_OPEN_NEW_VIEW (SID_SFX_START + 520)
+ // FREE, was SID_VIEW_ZOOM_MODE
+ // FREE, was SID_VIEW_POS_SIZE
+#define SID_VIEW_ID (SID_SFX_START + 523)
+ // FREE, was SID_USER_DATA
+#define SID_VIEW_DATA (SID_SFX_START + 1582)
+#define SID_SILENT (SID_SFX_START + 528)
+#define SID_HIDDEN (SID_SFX_START + 534)
+#define SID_PREVIEW (SID_SFX_START + 1404)
+
+#define SID_FOCUSURLBOX (SID_SFX_START + 1406)
+
+#define SID_ACTIVATE (SID_SFX_START + 525)
+#define SID_PRINTOUT (SID_SFX_START + 526)
+
+#define SID_FILE_LONGNAME (SID_SFX_START + 529)
+#define SID_FILTER_NAME (SID_SFX_START + 530)
+#define SID_DOC_SALVAGE (SID_SFX_START + 531)
+#define SID_INSERTDOC (SID_SFX_START + 532)
+#define SID_TYPE_NAME (SID_SFX_START + 533)
+
+#define SID_DOC_READONLY (SID_SFX_START + 590)
+#define SID_DOC_MODIFIED (SID_SFX_START + 584)
+#define SID_DOC_LOADING (SID_SFX_START + 585)
+#define SID_IMG_LOADING (SID_SFX_START + 586)
+#define SID_DOC_SAVED (SID_SFX_START + 599)
+#define SID_DOCINFO (SID_SFX_START + 535)
+#define SID_DOCINFO_KEYWORDS (SID_SFX_START + 591)
+#define SID_DOCINFO_COMMENTS (SID_SFX_START + 592)
+#define SID_DOCINFO_AUTHOR (SID_SFX_START + 593)
+#define SID_DOCINFO_MAJOR (SID_SFX_START + 594)
+#define SID_NEWDOCDIRECT (SID_SFX_START + 537)
+#define SID_DOCFRAME (SID_SFX_START + 598)
+#define SID_TARGETNAME (SID_SFX_START + 560)
+#define SID_ORIGURL (SID_SFX_START + 644)
+#define SID_POSTDATA (SID_SFX_START + 1536)
+#define SID_DONELINK (SID_SFX_START + 646)
+#define SID_REFERER (SID_SFX_START + 654)
+#define SID_MODIFIER (SID_SFX_START + 669)
+#define SID_SETOPTIONS (SID_SFX_START + 670)
+#define SID_SOURCEVIEW (SID_SFX_START + 675)
+#define SID_DOC_STARTPRESENTATION (SID_SFX_START + 695)
+#define SID_DDE_RECONNECT_ONLOAD (SID_SFX_START + 696)
+
+#define SID_NEWWINDOWFOREDIT (SID_SFX_START + 667)
+
+#define SID_DOCTEMPLATE (SID_SFX_START + 538)
+#define SID_AUTOPILOTMENU (SID_SFX_START + 1381)
+
+// Floating Window Template
+#define SID_STYLE_DESIGNER (SID_SFX_START + 539)
+
+#define SID_TEMPLATE_ADDRESSBOKSOURCE (SID_SFX_START + 1655)
+
+// Ruby dialog
+#define SID_RUBY_DIALOG (SID_SFX_START + 1656)
+
+#define SID_STYLE_FAMILY_START (SID_SFX_START + 541)
+#define SID_STYLE_FAMILY1 (SID_STYLE_FAMILY_START)
+#define SID_STYLE_FAMILY2 (SID_STYLE_FAMILY_START + 1)
+#define SID_STYLE_FAMILY3 (SID_STYLE_FAMILY_START + 2)
+#define SID_STYLE_FAMILY4 (SID_STYLE_FAMILY_START + 3)
+#define SID_STYLE_FAMILY5 (SID_STYLE_FAMILY_START + 4)
+
+#define SID_STYLE_NEW (SID_SFX_START + 549)
+#define SID_STYLE_EDIT (SID_SFX_START + 550)
+#define SID_STYLE_DELETE (SID_SFX_START + 551)
+#define SID_STYLE_APPLY (SID_SFX_START + 552)
+#define SID_STYLE_FAMILY (SID_SFX_START + 553)
+#define SID_STYLE_FAMILYNAME (SID_SFX_START + 566)
+#define SID_STYLE_WATERCAN (SID_SFX_START + 554)
+#define SID_STYLE_NEW_BY_EXAMPLE (SID_SFX_START + 555)
+#define SID_STYLE_UPDATE_BY_EXAMPLE (SID_SFX_START + 556)
+#define SID_STYLE_DRAGHIERARCHIE (SID_SFX_START + 565)
+#define SID_STYLE_MASK (SID_SFX_START + 562)
+#define SID_STYLE_HIDE (SID_SFX_START + 1603)
+#define SID_STYLE_SHOW (SID_SFX_START + 1604)
+#define SID_STYLE_UPD_BY_EX_NAME (SID_SFX_START + 1585)
+#define SID_STYLE_REFERENCE (SID_SFX_START + 1602)
+
+#define SID_TEMPLATE_NAME (SID_SFX_START + 660)
+#define SID_TEMPLATE_REGION (SID_SFX_START + 661)
+#define SID_TEMPLATE_REGIONNAME (SID_SFX_START + 662)
+#define SID_TEMPLATE_LOAD (SID_SFX_START + 663)
+
+#define SID_INSERT_OBJECT (SID_SFX_START + 561)
+#define SID_INSERT_FLOATINGFRAME (SID_SFX_START + 563)
+#define SID_INSERT_PLUGIN (SID_SFX_START + 672)
+#define SID_INSERT_SOUND (SID_SFX_START + 676)
+#define SID_INSERT_VIDEO (SID_SFX_START + 677)
+
+#define SID_HYPERLINK_DIALOG (SID_SFX_START + 678)
+
+#define SID_ACTIVEDOCUMENT (SID_SFX_START + 570)
+#define SID_DEFAULTFILEPATH (SID_SFX_START + 571)
+#define SID_OBJECT (SID_SFX_START + 575)
+
+// Doc-Properties
+#define SID_DOCFULLNAME (SID_SFX_START + 581)
+#define SID_DOCPATH (SID_SFX_START + 582)
+#define SID_DOCTITLE (SID_SFX_START + 583)
+
+#define SID_DOCUMENT (SID_SFX_START + 588)
+
+// default-ids for windows
+
+#define SID_CLOSEWINS (SID_SFX_START + 605)
+#define SID_MDIWINDOWLIST (SID_SFX_START + 610)
+#define SID_NEWWINDOW (SID_SFX_START + 620)
+#define SID_CLOSEWIN (SID_SFX_START + 621)
+#define SID_VIEWSHELL (SID_SFX_START + 623)
+#define SID_WIN_FULLSCREEN (SID_SFX_START + 627)
+ // FREE, was SID_WIN_POSSIZE
+#define SID_WIN_VISIBLE (SID_SFX_START + 629)
+
+#define SID_VIEWSHELL0 (SID_SFX_START + 630)
+#define SID_VIEWSHELL1 (SID_SFX_START + 631)
+#define SID_VIEWSHELL2 (SID_SFX_START + 632)
+#define SID_VIEWSHELL3 (SID_SFX_START + 633)
+#define SID_VIEWSHELL4 (SID_SFX_START + 634)
+
+#define SID_CAPTION (SID_SFX_START + 641)
+
+// id for thesaurs entry in context menu
+#define SID_THES (SID_SFX_START + 698)
+
+// default-ids for editing, cursor travellung and selection
+#define SID_REDO (SID_SFX_START + 700)
+#define SID_UNDO (SID_SFX_START + 701)
+#define SID_REPEAT (SID_SFX_START + 702)
+#define SID_CLEARHISTORY (SID_SFX_START + 703)
+#define SID_CUT (SID_SFX_START + 710)
+#define SID_COPY (SID_SFX_START + 711)
+#define SID_PASTE (SID_SFX_START + 712)
+
+#define SID_BACKSPACE (SID_SFX_START + 714)
+#define SID_FORMATPAINTBRUSH (SID_SFX_START + 715)
+#define SID_SELECT (SID_SFX_START + 720)
+#define SID_SELECTALL (SID_SFX_START + 723)
+#define SID_CURSORDOWN (SID_SFX_START + 731)
+#define SID_CURSORUP (SID_SFX_START + 732)
+#define SID_CURSORLEFT (SID_SFX_START + 733)
+#define SID_CURSORRIGHT (SID_SFX_START + 734)
+#define SID_CURSORPAGEDOWN (SID_SFX_START + 735)
+#define SID_CURSORPAGEUP (SID_SFX_START + 736)
+#define SID_CURSORPAGERIGHT (SID_SFX_START + 737)
+#define SID_CURSORPAGELEFT (SID_SFX_START + 738)
+#define SID_CURSORENDOFFILE (SID_SFX_START + 741)
+#define SID_CURSORTOPOFFILE (SID_SFX_START + 742)
+#define SID_CURSORENDOFSCREEN (SID_SFX_START + 743)
+#define SID_CURSORTOPOFSCREEN (SID_SFX_START + 744)
+#define SID_CURSORHOME (SID_SFX_START + 745)
+#define SID_CURSOREND (SID_SFX_START + 746)
+#define SID_FORMATMENU (SID_SFX_START + 780)
+#define SID_OBJECTMENU0 SID_FORMATMENU
+#define SID_OBJECTMENU3 (SID_SFX_START + 783)
+#define SID_OBJECTMENU_LAST SID_OBJECTMENU3
+#define SID_FORMATMENUSTATE (SID_SFX_START + 791)
+
+// default-ids for macros
+#define SID_RECORDING_FLOATWINDOW (SID_SFX_START + 800)
+#define SID_RECORDMACRO (SID_SFX_START + 1669)
+#define SID_PASTE_ONLY (SID_SFX_START + 801)
+#define SID_PASTE_ONLY_TEXT (SID_SFX_START + 802)
+#define SID_PASTE_ONLY_FORMULA (SID_SFX_START + 803)
+#define SID_PASTE_ONLY_VALUE (SID_SFX_START + 804)
+ // FREE: SID_SFX_START + 805
+ // FREE: SID_SFX_START + 806
+ // FREE: SID_SFX_START + 807
+ // FREE: SID_SFX_START + 808
+ // FREE: SID_SFX_START + 809
+ // FREE: SID_SFX_START + 810
+#define SID_ASYNCHRON (SID_SFX_START + 811)
+
+// default-ids for configuration
+#define SID_CONFIG (SID_SFX_START + 904)
+#define SID_TOGGLECOMMONTASKBAR (SID_SFX_START + 928)
+#define SID_TOOLBOXOPTIONS (SID_SFX_START + 907)
+#define SID_TOGGLEFUNCTIONBAR (SID_SFX_START + 910)
+#define SID_CONFIGITEMID (SID_SFX_START + 919)
+#define SID_MACROINFO (SID_SFX_START + 919)
+#define SID_TOGGLESTATUSBAR (SID_SFX_START + 920)
+#define SID_CONFIGSTATUSBAR (SID_SFX_START + 921)
+#define SID_CONFIGMENU (SID_SFX_START + 924)
+#define SID_CONFIGACCEL (SID_SFX_START + 925)
+#define SID_CONFIGEVENT (SID_SFX_START + 926)
+#define SID_CFGFILE (SID_SFX_START + 927)
+#define SID_SHOWPOPUPS (SID_SFX_START + 929)
+#define SID_TASKBAR (SID_SFX_START + 931)
+#define SID_AUTOHIDE (SID_SFX_START + 932)
+
+// Item-Id for the assinged event Tabpage
+#define SID_ATTR_MACROITEM (SID_SFX_START + 934)
+
+#define SID_SAVECONFIG (SID_SFX_START + 930)
+#define SID_LOADCONFIG (SID_SFX_START + 933)
+#define SID_OPTIONS (SID_SFX_START + 940)
+#define SID_BASICLOAD (SID_SFX_START + 951)
+#define SID_BASICSAVEAS (SID_SFX_START + 953)
+#define SID_BASICCOMPILE (SID_SFX_START + 954)
+#define SID_BASICRUN (SID_SFX_START + 955)
+#define SID_BASICSTEPINTO (SID_SFX_START + 956)
+#define SID_BASICSTEPOVER (SID_SFX_START + 957)
+#define SID_BASICSTEPOUT (SID_SFX_START + 963)
+#define SID_BASICSTOP (SID_SFX_START + 958)
+#define SID_BASICCHOOSER (SID_SFX_START + 959)
+#define SID_GALLERY (SID_SFX_START + 960)
+#define SID_SEARCH_DLG (SID_SFX_START + 961)
+#define SID_SEARCH_QUIET (SID_SFX_START + 1684)
+#define SID_HELP_PI (SID_SFX_START + 962)
+#define SID_BASIC_ENABLED (SID_SFX_START + 964)
+#define SID_EXPORT_DIALOG (SID_SFX_START + 965)
+#define SID_IMPORT_DIALOG (SID_SFX_START + 966)
+
+#define SID_BASICBREAK (SID_SFX_START +1521)
+
+#define SID_OBJECTRESIZE (SID_SFX_START + 1000)
+
+#define SID_EVENTCONFIG (SID_SFX_START + 1101)
+#define SID_VERB_START (SID_SFX_START + 1100)
+#define SID_VERB_END (SID_SFX_START + 1121)
+
+#define SID_SIGNATURE (SID_SFX_START + 1643)
+
+#define SID_FRAMEDESCRIPTOR (SID_SFX_START + 1229)
+
+// SaveTabPage
+#define SID_ATTR_DOCINFO (SID_OPTIONS_START + 0)
+#define SID_ATTR_BACKUP (SID_OPTIONS_START + 1)
+#define SID_ATTR_AUTOSAVE (SID_OPTIONS_START + 2)
+#define SID_ATTR_AUTOSAVEPROMPT (SID_OPTIONS_START + 3)
+#define SID_ATTR_USERAUTOSAVE (SID_OPTIONS_START + 4)
+#define SID_ATTR_AUTOSAVEMINUTE (SID_OPTIONS_START + 5)
+#define SID_ATTR_WORKINGSET (SID_OPTIONS_START + 13)
+#define SID_ATTR_UNDO_COUNT (SID_OPTIONS_START + 16)
+ // unused
+#define SID_ATTR_SAVEDOCVIEW (SID_OPTIONS_START + 18)
+
+// GeneralTabPage
+
+#define SID_ATTR_METRIC (SID_OPTIONS_START + 8)
+#define SID_ATTR_DEFTABSTOP (SID_OPTIONS_START + 14)
+#define SID_ATTR_BUTTON_OUTSTYLE3D (SID_OPTIONS_START + 62)
+#define SID_ATTR_BUTTON_BIGSIZE (SID_OPTIONS_START + 63)
+#define SID_ATTR_AUTOHELPAGENT (SID_OPTIONS_START + 67)
+#define SID_HELPAGENT_TIMEOUT (SID_OPTIONS_START + 93)
+#define SID_ATTR_WELCOMESCREEN (SID_OPTIONS_START + 81)
+#define SID_WELCOMESCREEN_RESET (SID_OPTIONS_START + 82)
+#define SID_ATTR_QUICKLAUNCHER (SID_OPTIONS_START + 74)
+#define SID_ATTR_YEAR2000 (SID_OPTIONS_START + 87)
+#define SID_ATTR_APPLYCHARUNIT (SID_OPTIONS_START + 88)
+
+
+// PathTabPage
+#define SID_ATTR_PATHGROUP (SID_OPTIONS_START + 10)
+#define SID_ATTR_PATHNAME (SID_OPTIONS_START + 11)
+
+// LinguTabPage
+#define SID_ATTR_LANGUAGE (SID_OPTIONS_START + 7)
+#define SID_ATTR_SPELL (SID_OPTIONS_START + 9)
+#define SID_ATTR_HYPHENREGION (SID_OPTIONS_START + 12)
+#define SID_SPELL_MODIFIED (SID_OPTIONS_START + 15)
+#define SID_AUTOSPELL_CHECK (SID_OPTIONS_START + 21)
+
+// InetTabPage
+
+#define SID_INET_PROXY_TYPE (SID_OPTIONS_START + 23)
+#define SID_INET_PROXY_PORT (SID_OPTIONS_START + 25)
+
+#define SID_INET_SMTPSERVER (SID_OPTIONS_START + 33)
+#define SID_PASSWORD (SID_OPTIONS_START + 36)
+
+#define SID_INET_NOPROXY (SID_OPTIONS_START + 37)
+
+#define SID_INET_HTTP_PROXY_NAME (SID_OPTIONS_START + 38)
+#define SID_INET_HTTP_PROXY_PORT (SID_OPTIONS_START + 39)
+#define SID_INET_FTP_PROXY_NAME (SID_OPTIONS_START + 40)
+#define SID_INET_FTP_PROXY_PORT (SID_OPTIONS_START + 41)
+#define SID_INET_SOCKS_PROXY_PORT (SID_OPTIONS_START + 43)
+
+#define SID_INET_EXE_PLUGIN (SID_OPTIONS_START + 52)
+
+#define SID_INET_DNS_AUTO (SID_OPTIONS_START + 57)
+#define SID_INET_DNS_SERVER (SID_OPTIONS_START + 58)
+
+#define SID_SAVEREL_INET (SID_OPTIONS_START + 30)
+#define SID_SAVEREL_FSYS (SID_OPTIONS_START + 31)
+
+// Automatic update of Styles - manage TabPage
+#define SID_ATTR_AUTO_STYLE_UPDATE (SID_OPTIONS_START + 65)
+
+#define SID_SECURE_URL (SID_OPTIONS_START + 66)
+
+// configured locale changed
+#define SID_OPT_LOCALE_CHANGED (SID_OPTIONS_START + 94)
+//middle mouse button
+#define SID_ATTR_PRETTYPRINTING (SID_OPTIONS_START + 98)
+#define SID_HELP_STYLESHEET (SID_OPTIONS_START + 99)
+
+// slot IDs from SVX (svxids.hrc) ---------------------------------------------
+
+#define SID_ZOOM_TOOLBOX (SID_SVX_START + 96)
+#define SID_ZOOM_OUT (SID_SVX_START + 97)
+#define SID_ZOOM_IN (SID_SVX_START + 98)
+#define SID_SIZE_REAL (SID_SVX_START + 99)
+#define SID_SIZE_PAGE (SID_SVX_START + 100)
+#define SID_SHOW_BROWSER (SID_SVX_START + 163)
+#define SID_GALLERY_BG_BRUSH (SID_SVX_START + 279)
+#define SID_SEARCH_OPTIONS (SID_SVX_START + 281)
+#define SID_ZOOM (SID_SVX_START + 289)
+#define SID_SEARCH_ITEM (SID_SVX_START + 291)
+#define SID_HYPERLINK_GETLINK (SID_SVX_START + 361)
+#define SID_HYPERLINK_SETLINK (SID_SVX_START + 362)
+#define SID_INFOBARCONTAINER (SID_SVX_START + 365)
+#define SID_NAVIGATOR (SID_SVX_START + 366)
+#define SID_TASKPANE (SID_SVX_START + 370)
+#define SID_ZOOM_NEXT (SID_SVX_START + 402)
+#define SID_ZOOM_PREV (SID_SVX_START + 403)
+#define SID_INET_DLG (SID_SVX_START + 416)
+#define SID_AUTO_CORRECT_DLG (SID_SVX_START + 424)
+#define SID_SD_AUTOPILOT (SID_SVX_START + 425)
+#define SID_ATTR_CHAR_COLOR_EXT (SID_SVX_START + 488)
+#define SID_ATTR_CHAR_COLOR_BACKGROUND (SID_SVX_START + 489)
+#define SID_ATTR_CHAR_COLOR_BACKGROUND_EXT (SID_SVX_START + 490)
+#define SID_ATTR_CHAR_COLOR2 (SID_SVX_START + 537)
+#define SID_COMP_BIBLIOGRAPHY (SID_SVX_START + 880)
+#define SID_ADDRESS_DATA_SOURCE (SID_SVX_START + 934)
+
+#define FID_SVX_START (SID_LIB_START + 500)
+#define FID_SEARCH_NOW (FID_SVX_START + 2)
+
+// SlotIds for Basic -------------------------------------------------------
+#define SID_BASICIDE_TOGGLEBRKPNT ( SID_BASICIDE_START + 0 )
+#define SID_BASICIDE_ADDWATCH ( SID_BASICIDE_START + 1 )
+#define SID_BASICIDE_APPEAR ( SID_BASICIDE_START + 15 )
+#define SID_BASICIDE_BRKPNTSCHANGED ( SID_BASICIDE_START + 36 )
+#define SID_BASICIDE_CHOOSEMACRO ( SID_BASICIDE_START + 2 )
+#define SID_BASICIDE_CREATEMACRO ( SID_BASICIDE_START + 4 )
+#define SID_BASICIDE_DELETECURRENT ( SID_BASICIDE_START + 22 )
+#define SID_BASICIDE_EDITMACRO ( SID_BASICIDE_START + 3 )
+#define SID_BASICIDE_HIDECURPAGE ( SID_BASICIDE_START + 10 )
+#define SID_BASICIDE_LIBLOADED ( SID_BASICIDE_START + 27 )
+#define SID_BASICIDE_LIBSELECTOR ( SID_BASICIDE_START + 19 )
+#define SID_BASICIDE_LIBSELECTED ( SID_BASICIDE_START + 18 )
+#define SID_BASICIDE_LIBREMOVED ( SID_BASICIDE_START + 28 )
+#define SID_BASICIDE_ARG_LIBNAME ( SID_BASICIDE_START + 34 )
+#define SID_BASICIDE_MATCHGROUP ( SID_BASICIDE_START + 14 )
+#define SID_BASICIDE_MODULEDLG ( SID_BASICIDE_START + 5 )
+#define SID_BASICIDE_NAMECHANGEDONTAB ( SID_BASICIDE_START + 11 )
+#define SID_BASICIDE_ARG_TABID ( SID_BASICIDE_START + 30 )
+#define SID_BASICIDE_ARG_MACROINFO ( SID_BASICIDE_START + 32 )
+#define SID_BASICIDE_ARG_MODULENAME ( SID_BASICIDE_START + 35 )
+#define SID_BASICIDE_ARG_SBX ( SID_BASICIDE_START + 31 )
+#define SID_BASICIDE_NEWMODULE ( SID_BASICIDE_START + 21 )
+#define SID_BASICIDE_NEWDIALOG ( SID_BASICIDE_START + 20 )
+#define SID_BASICIDE_OBJCAT ( SID_BASICIDE_START + 6 )
+#define SID_BASICIDE_REMOVEWATCH ( SID_BASICIDE_START + 7 )
+#define SID_BASICIDE_RENAMECURRENT ( SID_BASICIDE_START + 23 )
+#define SID_BASICIDE_SBXDELETED ( SID_BASICIDE_START + 24 )
+#define SID_BASICIDE_SBXINSERTED ( SID_BASICIDE_START + 25 )
+#define SID_BASICIDE_SBXRENAMED ( SID_BASICIDE_START + 26 )
+#define SID_BASICIDE_SHOWSBX ( SID_BASICIDE_START + 9 )
+#define SID_BASICIDE_STAT_POS ( SID_BASICIDE_START + 38 )
+#define SID_BASICIDE_STAT_DATE ( SID_BASICIDE_START + 39 )
+#define SID_BASICIDE_STAT_TITLE ( SID_BASICIDE_START + 40 )
+#define SID_BASICIDE_STOREMODULESOURCE ( SID_BASICIDE_START + 13 )
+#define SID_BASICIDE_STOREALLMODULESOURCES ( SID_BASICIDE_START + 16 )
+#define SID_BASICIDE_UPDATEALLMODULESOURCES ( SID_BASICIDE_START + 17 )
+#define SID_BASICIDE_UPDATEMODULESOURCE ( SID_BASICIDE_START + 12 )
+#define SID_BASICIDE_MANAGEBRKPNTS ( SID_BASICIDE_START + 42 )
+#define SID_BASICIDE_TOGGLEBRKPNTENABLED ( SID_BASICIDE_START + 43 )
+#define SID_BASICIDE_SHOWWINDOW ( SID_BASICIDE_START + 44 )
+#define SID_BASICIDE_ARG_DOCUMENT ( SID_BASICIDE_START + 45 )
+#define SID_BASICIDE_ARG_NAME ( SID_BASICIDE_START + 46 )
+#define SID_BASICIDE_ARG_TYPE ( SID_BASICIDE_START + 47 )
+#define SID_BASICIDE_ARG_LINE ( SID_BASICIDE_START + 48 )
+#define SID_BASICIDE_ARG_COLUMN1 ( SID_BASICIDE_START + 49 )
+#define SID_BASICIDE_ARG_COLUMN2 ( SID_BASICIDE_START + 50 )
+#define SID_BASICIDE_ARG_DOCUMENT_MODEL ( SID_BASICIDE_START + 51 )
+#define SID_BASICIDE_MANAGE_LANG ( SID_BASICIDE_START + 52 )
+#define SID_BASICIDE_CURRENT_LANG ( SID_BASICIDE_START + 53 )
+
+// SlotIds for Apps --------------------------------------------------------
+#define FN_PARAM (SID_SW_START + 1100)
+#define FN_PARAM_1 (FN_PARAM+60)
+#define FN_PARAM_2 (FN_PARAM+61)
+#define FN_PARAM_3 (FN_PARAM+62)
+#define FN_PARAM_4 (FN_PARAM+63)
+#define FN_PARAM_5 (FN_PARAM+64)
+#define FN_PARAM_6 (FN_PARAM+65)
+#define FN_FAX (SID_SW_START + 28) /* Fax */
+
+#define SID_KEYFUNC_START (SID_SC_START + 521)
+#define SID_CURSORDOWN_SEL (SID_KEYFUNC_START + 0)
+#define SID_CURSORUP_SEL (SID_KEYFUNC_START + 1)
+#define SID_CURSORLEFT_SEL (SID_KEYFUNC_START + 2)
+#define SID_CURSORRIGHT_SEL (SID_KEYFUNC_START + 3)
+#define SID_CURSORPAGEDOWN_SEL (SID_KEYFUNC_START + 4)
+#define SID_CURSORPAGEUP_SEL (SID_KEYFUNC_START + 5)
+#define SID_CURSORPAGELEFT_SEL (SID_KEYFUNC_START + 7)
+#define SID_CURSORPAGERIGHT_SEL (SID_KEYFUNC_START + 9)
+#define SID_CURSORTOPOFFILE_SEL (SID_KEYFUNC_START + 10)
+#define SID_CURSORENDOFFILE_SEL (SID_KEYFUNC_START + 11)
+#define SID_CURSORHOME_SEL (SID_KEYFUNC_START + 12)
+#define SID_CURSOREND_SEL (SID_KEYFUNC_START + 13)
+#define SID_REPAINT (SID_SC_START + 12)
+
+#define SID_MODIFIED (SID_SD_START+89)
+#define ID_VAL_DUMMY0 (SID_SD_START+230)
+#define ID_VAL_ZOOM (SID_SD_START+234)
+#define SID_SIZE_OPTIMAL (SID_SD_START+99)
+
+//-----------------------------------------------------------------------
+
+#define SID_ZOOM_OPTIMAL (SID_SIZE_OPTIMAL)
+#define SID_ZOOM_ENTIRE_PAGE (SID_SIZE_PAGE)
+#define SID_ZOOM_PAGE_WIDTH (SID_SVX_START + 1420)
+#define SID_ZOOM_50_PERCENT (SID_SVX_START + 1421)
+#define SID_ZOOM_75_PERCENT (SID_SVX_START + 1422)
+#define SID_ZOOM_100_PERCENT (SID_SIZE_REAL)
+#define SID_ZOOM_150_PERCENT (SID_SVX_START + 1423)
+#define SID_ZOOM_200_PERCENT (SID_SVX_START + 1424)
+
+//-----------------------------------------------------------------------
+
+// SfxScriptOrganizerItem
+#define MID_SCRIPT_ORGANIZER_LANGUAGE 1 // Don't use zero for MID's. It's forbidden to do it!
+
+#define SID_NEWSD (SID_SFX_START + 1686)
+#define FN_LABEL (SID_SW_START + 1051 )
+#define FN_BUSINESS_CARD (SID_SW_START + 1052)
+#define FN_XFORMS_INIT (SID_SW_START + 1053)
+#define SID_OPTIONS_TREEDIALOG ( SID_BASICIDE_START + 862)
+
+
+#define SID_RESTORE_EDITING_VIEW (SID_SFX_START + 1663)
+
+#endif // #ifndef _SFXSIDS_HRC
+
+//-----------------------------------------------------------------------
+// SfxSecurityPage related stuff
+
+#define FN_EDIT2 (SID_SW_START + 1800)
+#define FN_REDLINE_PROTECT (FN_EDIT2 + 23)
+#define FN_REDLINE_ON (FN_EDIT2 + 25)
+
+#define SID_HTML_MODE (SID_SVX_START + 414)
+
+// Calc-Id's used for SfxSecurityPage
+#ifndef SC_FUNCTION_START
+#define SC_FUNCTION_START (SID_SC_START + 200)
+#endif
+#ifndef FILE_MENU_END
+#define FILE_MENU_END (SC_FUNCTION_START + 20)
+#endif
+#ifndef EDIT_MENU_START
+#define EDIT_MENU_START (FILE_MENU_END)
+#endif
+#ifndef SC_VIEW_START
+#define SC_VIEW_START (SID_SC_START)
+#endif
+#define FID_CHG_RECORD (EDIT_MENU_START + 18)
+#define SID_CHG_PROTECT (SC_VIEW_START + 84)
+
+// eof ------------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxstatuslistener.hxx b/include/sfx2/sfxstatuslistener.hxx
new file mode 100644
index 000000000000..9e6be020db10
--- /dev/null
+++ b/include/sfx2/sfxstatuslistener.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SFXSTATUSLISTENER_HXX
+#define _SFXSTATUSLISTENER_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <svl/poolitem.hxx>
+#include <cppuhelper/weak.hxx>
+#include <osl/conditn.hxx>
+#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+
+#include <sfx2/sfxuno.hxx>
+
+// Interface for implementations which needs to get notifications about state changes
+class SfxStatusListenerInterface
+{
+ public:
+ virtual void StateChanged( sal_uInt16 nSlotId, SfxItemState eState, const SfxPoolItem* pState ) = 0;
+
+ protected:
+ ~SfxStatusListenerInterface() {}
+};
+
+class SFX2_DLLPUBLIC SfxStatusListener :
+ public ::com::sun::star::frame::XStatusListener ,
+ public ::com::sun::star::lang::XTypeProvider ,
+ public ::com::sun::star::lang::XComponent ,
+ public ::cppu::OWeakObject
+{
+ public:
+ SFX_DECL_XINTERFACE_XTYPEPROVIDER
+
+ SfxStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& aCommand );
+ virtual ~SfxStatusListener();
+
+ // old methods from SfxControllerItem
+ sal_uInt16 GetId() const { return m_nSlotID; }
+ void UnBind();
+ void ReBind();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged(const ::com::sun::star::frame::FeatureStateEvent& Event) throw( ::com::sun::star::uno::RuntimeException );
+
+ private:
+ SfxStatusListener( const SfxStatusListener& );
+ SfxStatusListener();
+ SfxStatusListener& operator=( const SfxStatusListener& );
+
+ sal_uInt16 m_nSlotID;
+ ::com::sun::star::util::URL m_aCommand;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xDispatchProvider;
+ ::com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > m_xDispatch;
+};
+
+#endif // _SFXSTATUSLISTENER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxuno.hxx b/include/sfx2/sfxuno.hxx
new file mode 100644
index 000000000000..6b0a2763497e
--- /dev/null
+++ b/include/sfx2/sfxuno.hxx
@@ -0,0 +1,638 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SFX_SFXUNO_HXX
+#define _SFX_SFXUNO_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <com/sun/star/uno/Exception.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/task/ErrorCodeIOException.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+
+#include <com/sun/star/uno/Type.h>
+#include <com/sun/star/uno/Any.h>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <cppuhelper/queryinterface.hxx>
+#include <cppuhelper/factory.hxx>
+
+#include <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
+
+
+inline sal_Bool operator==( const css::util::URL& aURL1, const css::util::URL& aURL2 )
+{
+ return aURL1.Complete == aURL2.Complete;
+}
+
+class SfxAllItemSet ;
+class SfxItemSet ;
+class SfxSlot ;
+
+SFX2_DLLPUBLIC void TransformParameters( sal_uInt16 nSlotId ,
+ const css::uno::Sequence< css::beans::PropertyValue >& seqArgs ,
+ SfxAllItemSet& aSet ,
+ const SfxSlot* pSlot = 0 );
+
+SFX2_DLLPUBLIC void TransformItems( sal_uInt16 nSlotId ,
+ const SfxItemSet& aSet ,
+ css::uno::Sequence< css::beans::PropertyValue >& seqArgs ,
+ const SfxSlot* pSlot = 0 );
+
+bool GetEncryptionData_Impl( const SfxItemSet* pSet, css::uno::Sequence< css::beans::NamedValue >& aEncryptionData );
+
+#define FrameSearchFlags sal_Int32
+
+// Macros to convert string -> unicode and unicode -> string.
+// We use UTF8 everytime. Its the best way to do this!
+#define S2U(STRING) OStringToOUString(STRING, RTL_TEXTENCODING_UTF8)
+#define U2S(STRING) OUStringToOString(STRING, RTL_TEXTENCODING_UTF8)
+
+//________________________________________________________________________________________________________________________
+// macros for declaration and definition of uno-services
+//________________________________________________________________________________________________________________________
+
+//************************************************************************************************************************
+// declaration of XInterface::queryInterface()
+// XInterface::aquire()
+// XInterface::release()
+// XTypeProvider::getTypes()
+// XTypeProvider::getImplementationId()
+//************************************************************************************************************************
+#define SFX_DECL_XINTERFACE \
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw( css::uno::RuntimeException ); \
+ virtual void SAL_CALL acquire() throw(); \
+ virtual void SAL_CALL release() throw();
+
+#define SFX_DECL_XTYPEPROVIDER \
+ /* XTypeProvider */ \
+ virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw( css::uno::RuntimeException ); \
+ virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw( css::uno::RuntimeException );
+
+#define SFX_DECL_XINTERFACE_XTYPEPROVIDER \
+ SFX_DECL_XINTERFACE \
+ SFX_DECL_XTYPEPROVIDER
+
+//************************************************************************************************************************
+// declaration of XInterface::queryInterface()
+// XInterface::aquire()
+// XInterface::release()
+// XTypeProvider::getTypes()
+// XTypeProvider::getImplementationId()
+// XServiceInfo::getImplementationName()
+// XServiceInfo::supportsService()
+// XServiceInfo::getSupportedServiceNames()
+// static xxx::impl_getStaticSupportedServiceNames()
+// static xxx::impl_getStaticImplementationName()
+// static xxx::impl_createInstance()
+//************************************************************************************************************************
+#define SFX_DECL_XSERVICEINFO_NOFACTORY \
+ /* XServiceInfo */ \
+ virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException ); \
+ virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) throw( css::uno::RuntimeException ); \
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException ); \
+ \
+ /* Helper for XServiceInfo */ \
+ static css::uno::Sequence< OUString > impl_getStaticSupportedServiceNames(); \
+ static OUString impl_getStaticImplementationName(); \
+ \
+ /* Helper for registry */ \
+ static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) throw( css::uno::Exception );
+
+//************************************************************************************************************************
+// declaration of XInterface::queryInterface()
+// XInterface::aquire()
+// XInterface::release()
+// XTypeProvider::getTypes()
+// XTypeProvider::getImplementationId()
+// XServiceInfo::getImplementationName()
+// XServiceInfo::supportsService()
+// XServiceInfo::getSupportedServiceNames()
+// static xxx::impl_getStaticSupportedServiceNames()
+// static xxx::impl_getStaticImplementationName()
+// static xxx::impl_createInstance()
+// static xxx::impl_createFactory()
+//************************************************************************************************************************
+#define SFX_DECL_XSERVICEINFO \
+ SFX_DECL_XSERVICEINFO_NOFACTORY \
+ static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager );
+
+#define SFX_DECL_XINTERFACE_XTYPEPROVIDER_XSERVICEINFO \
+ \
+ /* XInterface + XTypeProvider */ \
+ SFX_DECL_XINTERFACE_XTYPEPROVIDER \
+ SFX_DECL_XSERVICEINFO
+
+//************************************************************************************************************************
+// implementation of XInterface::queryInterface()
+// XInterface::aquire()
+// XInterface::release()
+//************************************************************************************************************************
+/*_________________________________________________________________________________________________________________________*/
+// DON'T USE FOLLOW MACROS DIRECTLY!!!
+#define SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, IMPLINTERFACES ) \
+ \
+ void SAL_CALL IMPLCLASS::acquire() throw() \
+ { \
+ /* Don't use mutex in methods of XInterface! */ \
+ BASECLASS::acquire(); \
+ } \
+ \
+ void SAL_CALL IMPLCLASS::release() throw() \
+ { \
+ /* Don't use mutex in methods of XInterface! */ \
+ BASECLASS::release(); \
+ } \
+ \
+ css::uno::Any SAL_CALL IMPLCLASS::queryInterface( const css::uno::Type& rType ) throw( css::uno::RuntimeException ) \
+ { \
+ /* Attention: Don't use mutex or guard in this method!!! Is a method of XInterface. */ \
+ /* Ask for my own supported interfaces ... */ \
+ css::uno::Any aReturn ( ::cppu::queryInterface( rType, \
+ IMPLINTERFACES \
+ ) \
+ ); \
+ /* If searched interface supported by this class ... */ \
+ if ( aReturn.hasValue() == sal_True ) \
+ { \
+ /* ... return this information. */ \
+ return aReturn ; \
+ } \
+ else \
+ { \
+ /* Else; ... ask baseclass for interfaces! */ \
+ return BASECLASS::queryInterface( rType ); \
+ } \
+ }
+
+#define SFX_IMPL_INTERFACE_0 \
+ static_cast< css::lang::XTypeProvider* >( this )
+
+#define SFX_IMPL_INTERFACE_1( INTERFACE1 ) \
+ SFX_IMPL_INTERFACE_0, \
+ static_cast< INTERFACE1* >( this )
+
+#define SFX_IMPL_INTERFACE_2( INTERFACE1, INTERFACE2 ) \
+ SFX_IMPL_INTERFACE_1( INTERFACE1 ), \
+ static_cast< INTERFACE2* >( this )
+
+#define SFX_IMPL_INTERFACE_3( INTERFACE1, INTERFACE2, INTERFACE3 ) \
+ SFX_IMPL_INTERFACE_2( INTERFACE1, INTERFACE2 ), \
+ static_cast< INTERFACE3* >( this )
+
+#define SFX_IMPL_INTERFACE_4( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4 ) \
+ SFX_IMPL_INTERFACE_3( INTERFACE1, INTERFACE2, INTERFACE3 ), \
+ static_cast< INTERFACE4* >( this )
+
+#define SFX_IMPL_INTERFACE_5( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5 ) \
+ SFX_IMPL_INTERFACE_4( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4 ), \
+ static_cast< INTERFACE5* >( this )
+
+#define SFX_IMPL_INTERFACE_6( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6 ) \
+ SFX_IMPL_INTERFACE_5( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5 ), \
+ static_cast< INTERFACE6* >( this )
+
+#define SFX_IMPL_INTERFACE_7( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7 ) \
+ SFX_IMPL_INTERFACE_6( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6 ), \
+ static_cast< INTERFACE7* >( this )
+
+#define SFX_IMPL_INTERFACE_8( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8 ) \
+ SFX_IMPL_INTERFACE_7( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7 ), \
+ static_cast< INTERFACE8* >( this )
+
+#define SFX_IMPL_INTERFACE_9( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9 ) \
+ SFX_IMPL_INTERFACE_8( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8 ), \
+ static_cast< INTERFACE9* >( this )
+
+#define SFX_IMPL_INTERFACE_10( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10 ) \
+ SFX_IMPL_INTERFACE_9( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9 ), \
+ static_cast< INTERFACE10* >( this )
+
+#define SFX_IMPL_INTERFACE_11( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10, INTERFACE11 ) \
+ SFX_IMPL_INTERFACE_10( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10 ), \
+ static_cast< INTERFACE11* >( this )
+
+#define SFX_IMPL_INTERFACE_12( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10, INTERFACE11, INTERFACE12 ) \
+ SFX_IMPL_INTERFACE_11( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10, INTERFACE11 ), \
+ static_cast< INTERFACE12* >( this )
+
+#define SFX_IMPL_INTERFACE_13( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10, INTERFACE11, INTERFACE12, INTERFACE13 ) \
+ SFX_IMPL_INTERFACE_12( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10, INTERFACE11, INTERFACE12 ), \
+ static_cast< INTERFACE13* >( this )
+/*_________________________________________________________________________________________________________________________*/
+
+// Follow macros can used directly :-)
+// implementation of XInterface with 0 additional interface for queryInterface()
+#define SFX_IMPL_XINTERFACE_0( IMPLCLASS, BASECLASS ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_0 )
+
+// implementation of XInterface with 1 additional interface for queryInterface()
+#define SFX_IMPL_XINTERFACE_1( IMPLCLASS, BASECLASS, INTERFACE1 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_1( INTERFACE1 ) )
+
+// implementation of XInterface with 2 additional interfaces for queryInterface()
+#define SFX_IMPL_XINTERFACE_2( IMPLCLASS, BASECLASS, INTERFACE1, INTERFACE2 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_2( INTERFACE1, INTERFACE2 ) )
+
+// implementation of XInterface with 3 additional interfaces for queryInterface()
+#define SFX_IMPL_XINTERFACE_3( IMPLCLASS, BASECLASS, INTERFACE1, INTERFACE2, INTERFACE3 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_3( INTERFACE1, INTERFACE2, INTERFACE3 ) )
+
+// implementation of XInterface with 4 additional interfaces for queryInterface()
+#define SFX_IMPL_XINTERFACE_4( IMPLCLASS, BASECLASS, INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_4( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4 ) )
+
+// implementation of XInterface with 5 additional interfaces for queryInterface()
+#define SFX_IMPL_XINTERFACE_5( IMPLCLASS, BASECLASS, INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_5( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5 ) )
+
+// implementation of XInterface with 6 additional interfaces for queryInterface()
+#define SFX_IMPL_XINTERFACE_6( IMPLCLASS, BASECLASS, INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_6( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6 ) )
+
+// implementation of XInterface with 7 additional interfaces for queryInterface()
+#define SFX_IMPL_XINTERFACE_7( IMPLCLASS, BASECLASS, INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_7( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7 ) )
+
+// implementation of XInterface with 8 additional interfaces for queryInterface()
+#define SFX_IMPL_XINTERFACE_8( IMPLCLASS, BASECLASS, INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_8( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8 ) )
+
+// implementation of XInterface with 9 additional interfaces for queryInterface()
+#define SFX_IMPL_XINTERFACE_9( IMPLCLASS, BASECLASS, INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_9( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9 ) )
+
+// implementation of XInterface with 10 additional interfaces for queryInterface()
+#define SFX_IMPL_XINTERFACE_10( IMPLCLASS, BASECLASS, INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_10( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10 ) )
+
+// implementation of XInterface with 11 additional interfaces for queryInterface()
+#define SFX_IMPL_XINTERFACE_11( IMPLCLASS, BASECLASS, INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10, INTERFACE11 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_11( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10, INTERFACE11 ) )
+
+// implementation of XInterface with 11 additional interfaces for queryInterface()
+#define SFX_IMPL_XINTERFACE_12( IMPLCLASS, BASECLASS, INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10, INTERFACE11, INTERFACE12 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_12( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10, INTERFACE11, INTERFACE12 ) )
+
+// implementation of XInterface with 11 additional interfaces for queryInterface()
+#define SFX_IMPL_XINTERFACE_13( IMPLCLASS, BASECLASS, INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10, INTERFACE11, INTERFACE12, INTERFACE13 ) \
+ SFX_IMPL_XINTERFACE_BASE( IMPLCLASS, BASECLASS, SFX_IMPL_INTERFACE_13( INTERFACE1, INTERFACE2, INTERFACE3, INTERFACE4, INTERFACE5, INTERFACE6, INTERFACE7, INTERFACE8, INTERFACE9, INTERFACE10, INTERFACE11, INTERFACE12, INTERFACE13 ) )
+
+//************************************************************************************************************************
+// implementation of XTypeProvider::getTypes()
+// XTypeProvider::getImplementationId()
+//************************************************************************************************************************
+/*_________________________________________________________________________________________________________________________*/
+// DON'T USE FOLLOW MACROS DIRECTLY!!!
+#define SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, IMPLTYPES ) \
+ \
+ css::uno::Sequence< sal_Int8 > SAL_CALL IMPLCLASS::getImplementationId() throw( css::uno::RuntimeException ) \
+ { \
+ /* Create one Id for all instances of this class. */ \
+ /* Use ethernet address to do this! (sal_True) */ \
+ /* Optimize this method */ \
+ /* We initialize a static variable only one time. And we don't must use a mutex at every call! */ \
+ /* For the first call; pID is NULL - for the second call pID is different from NULL! */ \
+ static ::cppu::OImplementationId* pID = NULL ; \
+ if ( pID == NULL ) \
+ { \
+ /* Ready for multithreading; get global mutex for first call of this method only! see before */ \
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
+ /* Control these pointer again ... it can be, that another instance will be faster then these! */ \
+ if ( pID == NULL ) \
+ { \
+ /* Create a new static ID ... */ \
+ static ::cppu::OImplementationId aID( sal_False ); \
+ /* ... and set his address to static pointer! */ \
+ pID = &aID ; \
+ } \
+ } \
+ return pID->getImplementationId(); \
+ } \
+ \
+ css::uno::Sequence< css::uno::Type > SAL_CALL IMPLCLASS::getTypes() throw( css::uno::RuntimeException ) \
+ { \
+ /* Optimize this method ! */ \
+ /* We initialize a static variable only one time. And we don't must use a mutex at every call! */ \
+ /* For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!*/ \
+ static ::cppu::OTypeCollection* pTypeCollection = NULL ; \
+ if ( pTypeCollection == NULL ) \
+ { \
+ /* Ready for multithreading; get global mutex for first call of this method only! see before */ \
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
+ /* Control these pointer again ... it can be, that another instance will be faster then these! */ \
+ if ( pTypeCollection == NULL ) \
+ { \
+ /* Create a static typecollection ... */ \
+ static ::cppu::OTypeCollection aTypeCollection( IMPLTYPES ); \
+ /* ... and set his address to static pointer! */ \
+ pTypeCollection = &aTypeCollection ; \
+ } \
+ } \
+ return pTypeCollection->getTypes(); \
+ }
+
+#define SFX_IMPL_TYPE_0 \
+ ::getCppuType(( const css::uno::Reference< css::lang::XTypeProvider >*)NULL )
+
+#define SFX_IMPL_TYPE_1( TYPE1 ) \
+ SFX_IMPL_TYPE_0, \
+ ::getCppuType(( const css::uno::Reference< TYPE1 >*)NULL )
+
+#define SFX_IMPL_TYPE_2( TYPE1, TYPE2 ) \
+ SFX_IMPL_TYPE_1( TYPE1 ), \
+ ::getCppuType(( const css::uno::Reference< TYPE2 >*)NULL )
+
+#define SFX_IMPL_TYPE_3( TYPE1, TYPE2, TYPE3 ) \
+ SFX_IMPL_TYPE_2( TYPE1, TYPE2 ), \
+ ::getCppuType(( const css::uno::Reference< TYPE3 >*)NULL )
+
+#define SFX_IMPL_TYPE_4( TYPE1, TYPE2, TYPE3, TYPE4 ) \
+ SFX_IMPL_TYPE_3( TYPE1, TYPE2, TYPE3 ), \
+ ::getCppuType(( const css::uno::Reference< TYPE4 >*)NULL )
+
+#define SFX_IMPL_TYPE_5( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ) \
+ SFX_IMPL_TYPE_4( TYPE1, TYPE2, TYPE3, TYPE4 ), \
+ ::getCppuType(( const css::uno::Reference< TYPE5 >*)NULL )
+
+#define SFX_IMPL_TYPE_6( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ) \
+ SFX_IMPL_TYPE_5( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ), \
+ ::getCppuType(( const css::uno::Reference< TYPE6 >*)NULL )
+
+#define SFX_IMPL_TYPE_7( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ) \
+ SFX_IMPL_TYPE_6( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ), \
+ ::getCppuType(( const css::uno::Reference< TYPE7 >*)NULL )
+
+#define SFX_IMPL_TYPE_8( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ) \
+ SFX_IMPL_TYPE_7( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ), \
+ ::getCppuType(( const css::uno::Reference< TYPE8 >*)NULL )
+
+#define SFX_IMPL_TYPE_9( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ) \
+ SFX_IMPL_TYPE_8( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ), \
+ ::getCppuType(( const css::uno::Reference< TYPE9 >*)NULL )
+
+#define SFX_IMPL_TYPE_10( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ) \
+ SFX_IMPL_TYPE_9( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ), \
+ ::getCppuType(( const css::uno::Reference< TYPE10 >*)NULL )
+
+#define SFX_IMPL_TYPE_11( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ) \
+ SFX_IMPL_TYPE_10( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ), \
+ ::getCppuType(( const css::uno::Reference< TYPE11 >*)NULL )
+
+#define SFX_IMPL_TYPE_12( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12 ) \
+ SFX_IMPL_TYPE_11( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ), \
+ ::getCppuType(( const css::uno::Reference< TYPE12 >*)NULL )
+
+#define SFX_IMPL_TYPE_13( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13 ) \
+ SFX_IMPL_TYPE_12( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12 ), \
+ ::getCppuType(( const css::uno::Reference< TYPE13 >*)NULL )
+/*_________________________________________________________________________________________________________________________*/
+
+// FOLLOW MACROS CAN USED DIRECTLY :-)
+
+// implementation of XInterface with 1 additional interface for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_0( IMPLCLASS ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_0 )
+
+// implementation of XInterface with 1 additional interface for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_1( IMPLCLASS, TYPE1 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_1( TYPE1 ) )
+
+// implementation of XInterface with 2 additional interfaces for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_2( IMPLCLASS, TYPE1, TYPE2 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_2( TYPE1, TYPE2 ) )
+
+// implementation of XInterface with 3 additional interfaces for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_3( IMPLCLASS, TYPE1, TYPE2, TYPE3 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_3( TYPE1, TYPE2, TYPE3 ) )
+
+// implementation of XInterface with 4 additional interfaces for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_4( IMPLCLASS, TYPE1, TYPE2, TYPE3, TYPE4 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_4( TYPE1, TYPE2, TYPE3, TYPE4 ) )
+
+// implementation of XInterface with 5 additional interfaces for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_5( IMPLCLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_5( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ) )
+
+// implementation of XInterface with 6 additional interfaces for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_6( IMPLCLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_6( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ) )
+
+// implementation of XInterface with 7 additional interfaces for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_7( IMPLCLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_7( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ) )
+
+// implementation of XInterface with 8 additional interfaces for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_8( IMPLCLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_8( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ) )
+
+// implementation of XInterface with 9 additional interfaces for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_9( IMPLCLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_9( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ) )
+
+// implementation of XInterface with 10 additional interfaces for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_10( IMPLCLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_10( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ) )
+
+// implementation of XInterface with 11 additional interfaces for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_11( IMPLCLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_11( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ) )
+
+// implementation of XInterface with 11 additional interfaces for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_12( IMPLCLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_12( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12 ) )
+
+// implementation of XInterface with 11 additional interfaces for queryInterface()
+#define SFX_IMPL_XTYPEPROVIDER_13( IMPLCLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13 ) \
+ SFX_IMPL_XTYPEPROVIDER_BASE( IMPLCLASS, SFX_IMPL_TYPE_13( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13 ) )
+
+//************************************************************************************************************************
+// implementation of XServiceInfo::getImplementationName()
+// XServiceInfo::supportsService()
+// XServiceInfo::getSupportedServiceNames()
+// static xxx::impl_getStaticSupportedServiceNames()
+// static xxx::impl_getStaticImplementationName()
+// static xxx::impl_createInstance()
+//************************************************************************************************************************
+#define SFX_IMPL_XSERVICEINFO( IMPLCLASS, IMPLSERVICENAME, IMPLNAME ) \
+ \
+ /* XServiceInfo */ \
+ OUString SAL_CALL IMPLCLASS::getImplementationName() throw( css::uno::RuntimeException ) \
+ { \
+ return impl_getStaticImplementationName(); \
+ } \
+ \
+ /* XServiceInfo */ \
+ sal_Bool SAL_CALL IMPLCLASS::supportsService( const OUString& sServiceName ) throw( css::uno::RuntimeException ) \
+ { \
+ css::uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames(); \
+ const OUString* pArray = seqServiceNames.getConstArray(); \
+ for ( sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength(); nCounter++ ) \
+ { \
+ if ( pArray[nCounter] == sServiceName ) \
+ { \
+ return sal_True ; \
+ } \
+ } \
+ return sal_False ; \
+ } \
+ \
+ /* XServiceInfo */ \
+ css::uno::Sequence< OUString > SAL_CALL IMPLCLASS::getSupportedServiceNames() throw( css::uno::RuntimeException ) \
+ { \
+ return impl_getStaticSupportedServiceNames(); \
+ } \
+ \
+ /* Helper for XServiceInfo */ \
+ css::uno::Sequence< OUString > IMPLCLASS::impl_getStaticSupportedServiceNames() \
+ { \
+ css::uno::Sequence< OUString > seqServiceNames( 1 ); \
+ seqServiceNames.getArray() [0] = OUString::createFromAscii( IMPLSERVICENAME ); \
+ return seqServiceNames ; \
+ } \
+ \
+ /* Helper for XServiceInfo */ \
+ OUString IMPLCLASS::impl_getStaticImplementationName() \
+ { \
+ return OUString::createFromAscii( IMPLNAME ); \
+ } \
+ \
+ /* Helper for registry */ \
+ css::uno::Reference< css::uno::XInterface > SAL_CALL IMPLCLASS::impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) throw( css::uno::Exception ) \
+ { \
+ return css::uno::Reference< css::uno::XInterface >( *new IMPLCLASS( xServiceManager ) ); \
+ }
+
+//************************************************************************************************************************
+// implementation of XServiceInfo::getImplementationName()
+// XServiceInfo::supportsService()
+// XServiceInfo::getSupportedServiceNames()
+// static xxx::impl_getStaticSupportedServiceNames()
+// static xxx::impl_getStaticImplementationName()
+// static xxx::impl_createInstance()
+//************************************************************************************************************************
+#define SFX_IMPL_XSERVICEINFO_CTX( IMPLCLASS, IMPLSERVICENAME, IMPLNAME ) \
+ \
+ /* XServiceInfo */ \
+ OUString SAL_CALL IMPLCLASS::getImplementationName() throw( css::uno::RuntimeException ) \
+ { \
+ return impl_getStaticImplementationName(); \
+ } \
+ \
+ /* XServiceInfo */ \
+ sal_Bool SAL_CALL IMPLCLASS::supportsService( const OUString& sServiceName ) throw( css::uno::RuntimeException ) \
+ { \
+ css::uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames(); \
+ const OUString* pArray = seqServiceNames.getConstArray(); \
+ for ( sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength(); nCounter++ ) \
+ { \
+ if ( pArray[nCounter] == sServiceName ) \
+ { \
+ return sal_True ; \
+ } \
+ } \
+ return sal_False ; \
+ } \
+ \
+ /* XServiceInfo */ \
+ css::uno::Sequence< OUString > SAL_CALL IMPLCLASS::getSupportedServiceNames() throw( css::uno::RuntimeException ) \
+ { \
+ return impl_getStaticSupportedServiceNames(); \
+ } \
+ \
+ /* Helper for XServiceInfo */ \
+ css::uno::Sequence< OUString > IMPLCLASS::impl_getStaticSupportedServiceNames() \
+ { \
+ css::uno::Sequence< OUString > seqServiceNames( 1 ); \
+ seqServiceNames.getArray() [0] = OUString::createFromAscii( IMPLSERVICENAME ); \
+ return seqServiceNames ; \
+ } \
+ \
+ /* Helper for XServiceInfo */ \
+ OUString IMPLCLASS::impl_getStaticImplementationName() \
+ { \
+ return OUString::createFromAscii( IMPLNAME ); \
+ } \
+ \
+ /* Helper for registry */ \
+ css::uno::Reference< css::uno::XInterface > SAL_CALL IMPLCLASS::impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) throw( css::uno::Exception ) \
+ { \
+ return css::uno::Reference< css::uno::XInterface >( *new IMPLCLASS( comphelper::getComponentContext(xServiceManager) ) ); \
+ }
+
+//************************************************************************************************************************
+// definition of createFactory() for MultiServices
+//************************************************************************************************************************
+#define SFX_IMPL_SINGLEFACTORY( IMPLCLASS ) \
+ \
+ css::uno::Reference< css::lang::XSingleServiceFactory > IMPLCLASS::impl_createFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) \
+ { \
+ css::uno::Reference< css::lang::XSingleServiceFactory > xReturn ( \
+ cppu::createSingleFactory( xServiceManager , \
+ IMPLCLASS::impl_getStaticImplementationName() , \
+ IMPLCLASS::impl_createInstance , \
+ IMPLCLASS::impl_getStaticSupportedServiceNames() ) \
+ ); \
+ return xReturn ; \
+ }
+
+//************************************************************************************************************************
+// definition of createFactory() for OneInstance-Services
+//************************************************************************************************************************
+#define SFX_IMPL_ONEINSTANCEFACTORY( IMPLCLASS ) \
+ \
+ css::uno::Reference< css::lang::XSingleServiceFactory > IMPLCLASS::impl_createFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) \
+ { \
+ css::uno::Reference< css::lang::XSingleServiceFactory > xReturn( \
+ cppu::createOneInstanceFactory( xServiceManager , \
+ IMPLCLASS::impl_getStaticImplementationName() , \
+ IMPLCLASS::impl_createInstance , \
+ IMPLCLASS::impl_getStaticSupportedServiceNames() ) \
+ ); \
+ return xReturn ; \
+ }
+
+//************************************************************************************************************************
+// definition for "extern c sfx_component_getFactory()"
+//************************************************************************************************************************
+#define CREATEFACTORY(CLASS) \
+ \
+ /* Create right factory ... */ \
+ xFactory = CLASS::impl_createFactory( xServiceManager );
+
+//************************************************************************************************************************
+// definition for "extern c sfx_component_getFactory()"
+//************************************************************************************************************************
+#define IF_NAME_CREATECOMPONENTFACTORY(CLASS) \
+ \
+ if ( CLASS::impl_getStaticImplementationName().equals( OUString::createFromAscii( pImplementationName ) ) ) \
+ { \
+ CREATEFACTORY ( CLASS ) \
+ }
+
+#endif // _SFX_SFXUNO_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
new file mode 100644
index 000000000000..cba6efaf8e36
--- /dev/null
+++ b/include/sfx2/shell.hxx
@@ -0,0 +1,371 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFX_SHELL_HXX
+#define _SFX_SHELL_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/embed/VerbDescriptor.hpp>
+#include <tools/debug.hxx>
+#include <tools/rtti.hxx>
+#include <svl/brdcst.hxx>
+
+#include <tools/string.hxx>
+
+#include <sfx2/sfxuno.hxx>
+
+class ResMgr;
+class Window;
+class ToolBox;
+class SfxItemPool;
+class SfxPoolItem;
+class SfxRequest;
+class SfxItemSet;
+struct SfxFormalArgument;
+class StatusBar;
+class SfxInterface;
+class SfxViewShell;
+class SfxObjectShell;
+class SfxSlotPool;
+class SvGlobalName;
+
+class SfxShellObject;
+class SfxShell;
+struct SfxShell_Impl;
+class SfxShellObject;
+class SfxDispatcher;
+class SfxViewFrame;
+class SfxSlot;
+class SfxRepeatTarget;
+class SbxVariable;
+class SbxBase;
+class SfxBindings;
+
+namespace svl
+{
+ class IUndoManager;
+}
+
+//====================================================================
+
+enum SfxInterfaceId
+
+/* [Description]
+
+ Id for <SfxInterface>s, gives a quasi-static access to the interface
+ through an array to <SfxApplication>.
+*/
+
+{
+ SFX_INTERFACE_NONE,
+ SFX_INTERFACE_SFXAPP,
+ SFX_INTERFACE_SFXDOCSH,
+ SFX_INTERFACE_SFXIPFRM,
+ SFX_INTERFACE_SFXVIEWSH,
+ SFX_INTERFACE_SFXVIEWFRM,
+ SFX_INTERFACE_SFXPLUGINFRM,
+ SFX_INTERFACE_SFXPLUGINOBJ,
+ SFX_INTERFACE_SFXPLUGINVIEWSH,
+ SFX_INTERFACE_SFXFRAMESETOBJ,
+ SFX_INTERFACE_SFXFRAMESETVIEWSH,
+ SFX_INTERFACE_SFXINTERNALFRM,
+ SFX_INTERFACE_SFXCOMPONENTDOCSH,
+ SFX_INTERFACE_SFXGENERICOBJ,
+ SFX_INTERFACE_SFXGENERICVIEWSH,
+ SFX_INTERFACE_SFXEXPLOBJ,
+ SFX_INTERFACE_SFXEXPLVIEWSH,
+ SFX_INTERFACE_SFXPLUGINVIEWSHDYNAMIC,
+ SFX_INTERFACE_SFXEXTERNALVIEWFRM,
+ SFX_INTERFACE_SFXMODULE,
+ SFX_INTERFACE_SFXFRAMESETVIEW,
+ SFX_INTERFACE_SFXFRAMESETSOURCEVIEW,
+ SFX_INTERFACE_SFXHELP_DOCSH,
+ SFX_INTERFACE_SFXHELP_VIEWSH,
+ SFX_INTERFACE_SFXTASK,
+ SFX_INTERFACE_OFA_START = 100,
+ SFX_INTERFACE_OFA_END = 100,
+ SFX_INTERFACE_SC_START = 150,
+ SFX_INTERFACE_SC_END = 199,
+ SFX_INTERFACE_SD_START = 200,
+ SFX_INTERFACE_SD_END = 249,
+ SFX_INTERFACE_SW_START = 250,
+ SFX_INTERFACE_SW_END = 299,
+ SFX_INTERFACE_SIM_START = 300,
+ SFX_INTERFACE_SIM_END = 319,
+ SFX_INTERFACE_SCH_START = 320,
+ SFX_INTERFACE_SCH_END = 339,
+ SFX_INTERFACE_SMA_START = 340,
+ SFX_INTERFACE_SMA_END = 359,
+ SFX_INTERFACE_SBA_START = 360,
+ SFX_INTERFACE_SBA_END = 399,
+ SFX_INTERFACE_IDE_START = 400,
+ SFX_INTERFACE_IDE_END = 409,
+ //-if one is still needed
+ SFX_INTERFACE_APP = SFX_INTERFACE_SW_START,
+ SFX_INTERFACE_LIB = 450
+};
+
+//TODO/CLEANUP: replace by UNO constant
+#define SVVERB_SHOW -1
+
+//====================================================================
+
+typedef void (*SfxExecFunc)(SfxShell *, SfxRequest &rReq);
+typedef void (*SfxStateFunc)(SfxShell *, SfxItemSet &rSet);
+
+class SFX2_DLLPUBLIC SfxShell: public SfxBroadcaster
+
+/* [Description]
+
+ The class SfxShell is the base class for all classes, which provide
+ the functionality of the form <Slot>s.
+
+ Each instance has a reference to an interface description, which is
+ obtainable through <SfxShell::GetInterface()const>. This interface
+ provides the connection to specific methods and contains some other
+ descriptive data for controllers like menus and toolboxes, but also
+ for the various APIs. The main part of the interface description is in
+ the form of a <Type-Library>, which is generated from an IDL-file by
+ the <SVIDL-Compiler>. For each SfxShell Subclass-File there is one
+ such IDL-file to write.
+*/
+
+{
+ friend class SfxObjectItem;
+
+ SfxShell_Impl* pImp;
+ SfxItemPool* pPool;
+ ::svl::IUndoManager* pUndoMgr;
+
+private:
+ SfxShell( const SfxShell & ); // internal
+ SfxShell& operator = ( const SfxShell & ); // internal
+
+protected:
+ SfxShell();
+ SfxShell( SfxViewShell *pViewSh );
+
+#ifndef _SFXSH_HXX
+ SAL_DLLPRIVATE void SetViewShell_Impl( SfxViewShell* pView );
+ SAL_DLLPRIVATE void Invalidate_Impl( SfxBindings& rBindings, sal_uInt16 nId );
+ SAL_DLLPRIVATE SfxShellObject* GetShellObj_Impl() const;
+ SAL_DLLPRIVATE void SetShellObj_Impl( SfxShellObject* pObj );
+#endif
+
+public:
+ TYPEINFO();
+ virtual ~SfxShell();
+
+ virtual SfxInterface* GetInterface() const;
+ static SfxInterface* GetStaticInterface() { return 0; }
+
+ void SetName( const String &rName );
+ const String& GetName() const;
+
+ SfxViewShell* GetViewShell() const;
+
+ void CallExec( SfxExecFunc pFunc, SfxRequest &rReq )
+ { (*pFunc)(this, rReq); }
+ void CallState( SfxStateFunc pFunc, SfxItemSet &rSet )
+ { (*pFunc)(this, rSet); }
+
+ static void EmptyExecStub(SfxShell *pShell, SfxRequest &);
+ static void EmptyStateStub(SfxShell *pShell, SfxItemSet &);
+
+ const SfxPoolItem* GetSlotState( sal_uInt16 nSlotId, const SfxInterface *pIF = 0, SfxItemSet *pStateSet = 0 );
+ const SfxPoolItem* ExecuteSlot( SfxRequest &rReq, const SfxInterface *pIF = 0 );
+ const SfxPoolItem* ExecuteSlot( SfxRequest &rReq, sal_Bool bAsync );
+ sal_uIntPtr ExecuteSlot( sal_uInt16 nSlot, sal_uInt16 nMemberId, SbxVariable& rRet, SbxBase* pArgs = 0 );
+
+ inline SfxItemPool& GetPool() const;
+ inline void SetPool( SfxItemPool *pNewPool ) ;
+
+ virtual ::svl::IUndoManager*
+ GetUndoManager();
+ void SetUndoManager( ::svl::IUndoManager *pNewUndoMgr );
+
+ SfxRepeatTarget* GetRepeatTarget() const;
+ void SetRepeatTarget( SfxRepeatTarget *pTarget );
+
+ virtual void Invalidate(sal_uInt16 nId = 0);
+
+ sal_Bool IsActive() const;
+ virtual void Activate(sal_Bool bMDI);
+ virtual void Deactivate(sal_Bool bMDI);
+ virtual void ParentActivate();
+ virtual void ParentDeactivate();
+
+ SfxDispatcher* GetDispatcher() const;
+ SfxViewFrame* GetFrame() const;
+ ResMgr* GetResMgr() const;
+ virtual sal_Bool HasUIFeature( sal_uInt32 nFeature );
+ void UIFeatureChanged();
+
+ // Items
+ const SfxPoolItem* GetItem( sal_uInt16 nSlotId ) const;
+ void PutItem( const SfxPoolItem& rItem );
+
+ // TODO/CLEANUP: still needed?!
+ void SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor >& aVerbs);
+ const com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor >& GetVerbs() const;
+ void VerbExec (SfxRequest&);
+ void VerbState (SfxItemSet&);
+ SAL_DLLPRIVATE const SfxSlot* GetVerbSlot_Impl(sal_uInt16 nId) const;
+
+ void SetHelpId(sal_uIntPtr nId);
+ sal_uIntPtr GetHelpId() const;
+ virtual SfxObjectShell* GetObjectShell();
+ void SetDisableFlags( sal_uIntPtr nFlags );
+ sal_uIntPtr GetDisableFlags() const;
+
+ virtual SfxItemSet* CreateItemSet( sal_uInt16 nId );
+ virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet );
+
+#ifndef _SFXSH_HXX
+ SAL_DLLPRIVATE bool CanExecuteSlot_Impl( const SfxSlot &rSlot );
+ SAL_DLLPRIVATE void DoActivate_Impl( SfxViewFrame *pFrame, sal_Bool bMDI);
+ SAL_DLLPRIVATE void DoDeactivate_Impl( SfxViewFrame *pFrame, sal_Bool bMDI);
+#endif
+};
+
+//--------------------------------------------------------------------
+SfxItemPool& SfxShell::GetPool() const
+/*
+ [Description]
+
+ Each Subclass of SfxShell must reference a pool. This is partly set by
+ SFx's own set of subclasses (eg <SfxViewShell>). In particular however
+ this must be set directly from one derived SfxShell class and ny
+ derivatives of SfxObjectShell.
+
+ The SfxShell class itself does not have any SfxItemPool, therfore a
+ null-pointer is returned.
+*/
+
+{
+ DBG_ASSERT( pPool, "no pool" );
+ return *pPool;
+}
+//-------------------------------------------------------------------
+inline void SfxShell::SetPool
+(
+ SfxItemPool* pNewPool // Pointer to the new Pool or null
+)
+
+/* [Description]
+
+ With this method, the subclasses register their special <SfxItemPool>
+ in the SfxShell. Each SfxShell instance must have access to a SfxItemPool.
+ Usually this is the SfxItemPool of the SfxDocumentShell. The SfxShell
+ subclass does not take ownership of the orphaned pool. Before it is
+ deleted it has to be deregisted with SetPool(0).
+*/
+
+{
+ pPool = pNewPool;
+}
+
+//=====================================================================
+
+#define SFX_ARGUMENTMAP(ShellClass) static SfxFormalArgument a##ShellClass##Args_Impl[] =
+
+#define SFX_SLOTMAP(ShellClass) static SfxFormalArgument a##ShellClass##Args_Impl[1]; \
+ static SfxSlot a##ShellClass##Slots_Impl[] =
+
+#define SFX_SLOTMAP_ARG(ShellClass) static SfxSlot a##ShellClass##Slots_Impl[] =
+
+#define SFX_DECL_INTERFACE(nId) \
+ static SfxInterface* pInterface; \
+ private: \
+ static void InitInterface_Impl(); \
+ public: \
+ static const SfxFormalArgument* pSfxFormalArgs_Impl; \
+ static SfxInterface* GetStaticInterface(); \
+ static SfxInterfaceId GetInterfaceId() {return SfxInterfaceId(nId);} \
+ static void RegisterInterface(SfxModule* pMod=NULL); \
+ virtual SfxInterface* GetInterface() const;
+
+#define SFX_IMPL_INTERFACE(Class,SuperClass,NameResId) \
+ \
+ SfxInterface* Class::pInterface = 0; \
+ const SfxFormalArgument* Class::pSfxFormalArgs_Impl = a##Class##Args_Impl;\
+ SfxInterface* Class::GetStaticInterface() \
+ { \
+ if ( !pInterface ) \
+ { \
+ pInterface = \
+ new SfxInterface( \
+ #Class, NameResId, GetInterfaceId(), \
+ SuperClass::GetStaticInterface(), \
+ a##Class##Slots_Impl[0], \
+ (sal_uInt16) (sizeof(a##Class##Slots_Impl) / sizeof(SfxSlot) ) ); \
+ InitInterface_Impl(); \
+ } \
+ return pInterface; \
+ } \
+ \
+ SfxInterface* Class::GetInterface() const \
+ { \
+ return GetStaticInterface(); \
+ } \
+ \
+ void Class::RegisterInterface(SfxModule* pMod) \
+ { \
+ GetStaticInterface()->Register(pMod); \
+ } \
+ \
+ void Class::InitInterface_Impl()
+
+#define SFX_POSITION_MASK 0x000F
+#define SFX_VISIBILITY_MASK 0xFFF0
+#define SFX_VISIBILITY_UNVISIBLE 0x0000 // Never visible
+#define SFX_VISIBILITY_VIEWER 0x0040
+#define SFX_VISIBILITY_READONLYDOC 0x0400
+#define SFX_VISIBILITY_DESKTOP 0x0800
+#define SFX_VISIBILITY_STANDARD 0x1000
+#define SFX_VISIBILITY_FULLSCREEN 0x2000
+#define SFX_VISIBILITY_CLIENT 0x4000
+#define SFX_VISIBILITY_SERVER 0x8000
+#define SFX_VISIBILITY_NOCONTEXT 0xFFFF // Always visable
+
+#define SFX_OBJECTBAR_REGISTRATION(nPos,rResId) \
+ GetStaticInterface()->RegisterObjectBar( nPos, rResId )
+
+#define SFX_FEATURED_OBJECTBAR_REGISTRATION(nPos,rResId,nFeature) \
+ GetStaticInterface()->RegisterObjectBar( nPos, rResId, nFeature )
+
+#define SFX_CHILDWINDOW_REGISTRATION(nId) \
+ GetStaticInterface()->RegisterChildWindow( nId, (sal_Bool) sal_False )
+
+#define SFX_FEATURED_CHILDWINDOW_REGISTRATION(nId,nFeature) \
+ GetStaticInterface()->RegisterChildWindow( nId, (sal_Bool) sal_False, nFeature )
+
+#define SFX_CHILDWINDOW_CONTEXT_REGISTRATION(nId) \
+ GetStaticInterface()->RegisterChildWindow( nId, (sal_Bool) sal_True )
+
+#define SFX_POPUPMENU_REGISTRATION(rResId) \
+ GetStaticInterface()->RegisterPopupMenu( rResId )
+
+#define SFX_STATUSBAR_REGISTRATION(rResId) \
+ GetStaticInterface()->RegisterStatusBar( rResId )
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/signaturestate.hxx b/include/sfx2/signaturestate.hxx
new file mode 100644
index 000000000000..ff17355d2f48
--- /dev/null
+++ b/include/sfx2/signaturestate.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 SFX2_SIGNATURESTATE_HXX
+#define SFX2_SIGNATURESTATE_HXX
+
+// xmlsec05, check with SFX team
+#define SIGNATURESTATE_UNKNOWN (sal_Int16)(-1)
+#define SIGNATURESTATE_NOSIGNATURES (sal_Int16)0
+#define SIGNATURESTATE_SIGNATURES_OK (sal_Int16)1
+#define SIGNATURESTATE_SIGNATURES_BROKEN (sal_Int16)2
+// State was SIGNATURES_OK, but doc is modified now
+#define SIGNATURESTATE_SIGNATURES_INVALID (sal_Int16)3
+// signature is OK, but certificate could not be validated
+#define SIGNATURESTATE_SIGNATURES_NOTVALIDATED (sal_Int16)4
+//signatur and certificate are ok,but not al files are signed, as was the case in
+//OOo 2.x - OOo 3.1.1. This state is only used together with document signatures.
+#define SIGNATURESTATE_SIGNATURES_PARTIAL_OK (sal_Int16)5
+
+#endif // SFX2_SIGNATURESTATE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/stbitem.hxx b/include/sfx2/stbitem.hxx
new file mode 100644
index 000000000000..d94e76841045
--- /dev/null
+++ b/include/sfx2/stbitem.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 _SFXSTBITEM_HXX
+#define _SFXSTBITEM_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <svl/poolitem.hxx>
+#include <svtools/statusbarcontroller.hxx>
+
+//------------------------------------------------------------------
+
+class SfxModule;
+class StatusBar;
+class SfxStatusBarControl;
+class SfxBindings;
+
+svt::StatusbarController* SAL_CALL SfxStatusBarControllerFactory(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ StatusBar* pStatusBar,
+ unsigned short nID,
+ const OUString& aCommandURL );
+typedef SfxStatusBarControl* (*SfxStatusBarControlCtor)( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb );
+
+struct SfxStbCtrlFactory
+{
+ SfxStatusBarControlCtor pCtor;
+ TypeId nTypeId;
+ sal_uInt16 nSlotId;
+
+ SfxStbCtrlFactory( SfxStatusBarControlCtor pTheCtor,
+ TypeId nTheTypeId, sal_uInt16 nTheSlotId ):
+ pCtor(pTheCtor),
+ nTypeId(nTheTypeId),
+ nSlotId(nTheSlotId)
+ {}
+};
+
+//------------------------------------------------------------------
+
+class CommandEvent;
+class MouseEvent;
+class UserDrawEvent;
+
+class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController
+{
+ sal_uInt16 nSlotId;
+ sal_uInt16 nId;
+ StatusBar* pBar;
+
+protected:
+ // new controller API
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XStatusbarController
+ virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL command( const ::com::sun::star::awt::Point& aPos,
+ ::sal_Int32 nCommand,
+ ::sal_Bool bMouseEvent,
+ const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
+ const ::com::sun::star::awt::Rectangle& rOutputRectangle,
+ ::sal_Int32 nItemId, ::sal_Int32 nStyle ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
+
+ // Old sfx2 interface
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual void Click();
+ virtual void DoubleClick();
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual sal_Bool MouseButtonDown( const MouseEvent & );
+ virtual sal_Bool MouseMove( const MouseEvent & );
+ virtual sal_Bool MouseButtonUp( const MouseEvent & );
+ virtual void Paint( const UserDrawEvent &rUDEvt );
+
+ static sal_uInt16 convertAwtToVCLMouseButtons( sal_Int16 nAwtMouseButtons );
+
+public:
+ SfxStatusBarControl( sal_uInt16 nSlotID, sal_uInt16 nId, StatusBar& rBar );
+ virtual ~SfxStatusBarControl();
+
+ sal_uInt16 GetSlotId() const { return nSlotId; }
+ sal_uInt16 GetId() const { return nId; }
+ StatusBar& GetStatusBar() const { return *pBar; }
+ void CaptureMouse();
+ void ReleaseMouse();
+
+ static SfxStatusBarControl* CreateControl( sal_uInt16 nSlotID, sal_uInt16 nId, StatusBar *pBar, SfxModule* );
+ static void RegisterStatusBarControl(SfxModule*, SfxStbCtrlFactory*);
+
+};
+
+//------------------------------------------------------------------
+
+#define SFX_DECL_STATUSBAR_CONTROL() \
+ static SfxStatusBarControl* CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ); \
+ static void RegisterControl(sal_uInt16 nSlotId = 0, SfxModule *pMod=NULL)
+
+#define SFX_IMPL_STATUSBAR_CONTROL(Class, nItemClass) \
+ SfxStatusBarControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ) \
+ { return new Class( nSlotId, nId, rStb ); } \
+ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
+ { SfxStatusBarControl::RegisterStatusBarControl( pMod, new SfxStbCtrlFactory( \
+ Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); }
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/styfitem.hxx b/include/sfx2/styfitem.hxx
new file mode 100644
index 000000000000..b728be448a49
--- /dev/null
+++ b/include/sfx2/styfitem.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 _SFX_STYFITEM_HXX
+#define _SFX_STYFITEM_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <vcl/bitmap.hxx>
+#include <vcl/image.hxx>
+#include <tools/rc.hxx>
+#include <rsc/rscsfx.hxx>
+#include <vector>
+
+struct SfxFilterTupel {
+ String aName;
+ sal_uInt16 nFlags;
+};
+typedef ::std::vector< SfxFilterTupel* > SfxStyleFilter;
+
+// CLASS -----------------------------------------------------------------
+
+class SfxStyleFamilyItem: public Resource
+{
+ Image aImage;
+ Bitmap aBitmap;
+ String aText;
+ String aHelpText;
+ sal_uInt16 nFamily;
+ SfxStyleFilter aFilterList;
+
+public:
+ SfxStyleFamilyItem( const ResId &rId );
+ ~SfxStyleFamilyItem();
+
+ const Bitmap& GetBitmap() const { return aBitmap; }
+ const String& GetText() const { return aText; }
+ const String& GetHelpText() const { return aHelpText; }
+ SfxStyleFamily GetFamily() const { return (SfxStyleFamily)nFamily; }
+ const SfxStyleFilter& GetFilterList() const { return aFilterList; }
+ const Image& GetImage() const { return aImage; }
+
+ // --------------------------------------------------------------------
+ class GrantAccess { friend class SfxStyleFamilies; };
+ void SetImage( const Image& _rImg ) { aImage = _rImg; }
+};
+
+typedef ::std::vector< SfxStyleFamilyItem* > SfxStyleFamilyList;
+
+class SFX2_DLLPUBLIC SfxStyleFamilies: public Resource
+{
+ SfxStyleFamilyList aEntryList;
+
+public:
+ /** ctor
+ <p>Will automatically call updateImages with BMP_COLOR_NORMAL.</p>
+ */
+ SfxStyleFamilies( const ResId &);
+ SfxStyleFamilies( ) {};
+ ~SfxStyleFamilies();
+
+ size_t size() const
+ { return aEntryList.size(); }
+
+ const SfxStyleFamilyItem* at(size_t nIdx) const
+ { return (SfxStyleFamilyItem*)(aEntryList.empty() ? NULL : aEntryList[nIdx]); }
+
+ /** updates the images of all single SfxStyleFamilyItems with new images from the given resource
+
+ <p>The resource must contain a local image lists, with the id beeing the integer equivalent for the
+ requested bitmap mode, incremented by 1.</p>
+
+ <p>Usually, you will use the same resource which originally constructed the object.</p>
+
+ @return
+ <TRUE/> if an image list for the requested mode could be found in the given resource.
+ */
+ sal_Bool updateImages( const ResId& _rId );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/styledlg.hxx b/include/sfx2/styledlg.hxx
new file mode 100644
index 000000000000..0580e4cae25c
--- /dev/null
+++ b/include/sfx2/styledlg.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 _SFX_STYLEDLG_HXX
+#define _SFX_STYLEDLG_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <sfx2/tabdlg.hxx>
+
+class SfxStyleSheetBase;
+
+class SFX2_DLLPUBLIC SfxStyleDialog: public SfxTabDialog
+{
+private:
+ SfxStyleSheetBase* pStyle;
+ DECL_DLLPRIVATE_LINK( CancelHdl, Button * );
+protected:
+ virtual const SfxItemSet* GetRefreshedSet();
+
+public:
+#define ID_TABPAGE_MANAGESTYLES 1
+ SfxStyleDialog( Window* pParent, const ResId& rResId, SfxStyleSheetBase&,
+ sal_Bool bFreeRes = sal_True, const String* pUserBtnTxt = 0 );
+
+ ~SfxStyleDialog();
+
+ SfxStyleSheetBase& GetStyleSheet() { return *pStyle; }
+ const SfxStyleSheetBase& GetStyleSheet() const { return *pStyle; }
+
+ virtual short Ok();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
new file mode 100644
index 000000000000..17016489e917
--- /dev/null
+++ b/include/sfx2/tabdlg.hxx
@@ -0,0 +1,306 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXTABDLG_HXX
+#define _SFXTABDLG_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <vcl/button.hxx>
+#include <vcl/layout.hxx>
+#include <vcl/tabctrl.hxx>
+#include <vcl/tabdlg.hxx>
+#include <vcl/tabpage.hxx>
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
+#include <com/sun/star/frame/XFrame.hpp>
+
+class SfxPoolItem;
+class SfxTabDialog;
+class SfxViewFrame;
+class SfxTabPage;
+class SfxBindings;
+
+typedef SfxTabPage* (*CreateTabPage)(Window *pParent, const SfxItemSet &rAttrSet);
+typedef sal_uInt16* (*GetTabPageRanges)(); // provides international Which-value
+struct TabPageImpl;
+
+struct TabDlg_Impl;
+
+#define ID_TABCONTROL 1
+#define RET_USER 100
+#define RET_USER_CANCEL 101
+
+class SFX2_DLLPUBLIC SfxTabDialogItem: public SfxSetItem
+{
+public:
+ TYPEINFO();
+ SfxTabDialogItem( sal_uInt16 nId, const SfxItemSet& rItemSet );
+ SfxTabDialogItem(const SfxTabDialogItem& rAttr, SfxItemPool* pItemPool=NULL);
+ virtual SfxPoolItem* Clone(SfxItemPool* pToPool) const;
+ virtual SfxPoolItem* Create(SvStream& rStream, sal_uInt16 nVersion) const;
+};
+
+class SFX2_DLLPUBLIC SfxTabDialog : public TabDialog
+{
+private:
+friend class SfxTabPage;
+friend class SfxTabDialogController;
+
+ SfxViewFrame* pFrame;
+
+ VclBox *m_pBox;
+ TabControl *m_pTabCtrl;
+
+ OKButton *m_pOKBtn;
+ PushButton* m_pApplyBtn;
+ PushButton* m_pUserBtn;
+ CancelButton* m_pCancelBtn;
+ HelpButton* m_pHelpBtn;
+ PushButton* m_pResetBtn;
+ PushButton* m_pBaseFmtBtn;
+
+ bool m_bOwnsVBox;
+ bool m_bOwnsTabCtrl;
+ bool m_bOwnsActionArea;
+ bool m_bOwnsOKBtn;
+ bool m_bOwnsApplyBtn;
+ bool m_bOwnsUserBtn;
+ bool m_bOwnsCancelBtn;
+ bool m_bOwnsHelpBtn;
+ bool m_bOwnsResetBtn;
+ bool m_bOwnsBaseFmtBtn;
+
+ const SfxItemSet* pSet;
+ SfxItemSet* pOutSet;
+ TabDlg_Impl* pImpl;
+ sal_uInt16* pRanges;
+ sal_uInt32 nResId;
+ sal_uInt16 nAppPageId;
+ sal_Bool bItemsReset;
+ sal_Bool bFmt;
+
+ DECL_DLLPRIVATE_LINK( ActivatePageHdl, TabControl * );
+ DECL_DLLPRIVATE_LINK( DeactivatePageHdl, TabControl * );
+ DECL_DLLPRIVATE_LINK(OkHdl, void *);
+ DECL_DLLPRIVATE_LINK(ResetHdl, void *);
+ DECL_DLLPRIVATE_LINK(BaseFmtHdl, void *);
+ DECL_DLLPRIVATE_LINK(UserHdl, void *);
+ DECL_DLLPRIVATE_LINK(CancelHdl, void *);
+ SAL_DLLPRIVATE void Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText, const ResId* pResId );
+
+protected:
+ virtual short Ok();
+ // Is deleted in Sfx!
+ virtual SfxItemSet* CreateInputItemSet( sal_uInt16 nId );
+ // Is not deleted in Sfx!
+ virtual const SfxItemSet* GetRefreshedSet();
+ virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ VclButtonBox* m_pActionArea;
+ SfxItemSet* pExampleSet;
+ SfxItemSet* GetInputSetImpl();
+ SfxTabPage* GetTabPage( sal_uInt16 nPageId ) const;
+
+ /** prepare to leace the current page. Calls the DeactivatePage method of the current page, (if necessary),
+ handles the item sets to copy.
+ @return sal_True if it is allowed to leave the current page, sal_False otherwise
+ */
+ bool PrepareLeaveCurrentPage();
+
+ /** save the position of the TabDialog and which tab page is the currently active one
+ */
+ void SavePosAndId();
+
+public:
+ SfxTabDialog( Window* pParent,
+ const OString& rID, const OUString& rUIXMLDescription,
+ const SfxItemSet * = 0, sal_Bool bEditFmt = sal_False );
+ SfxTabDialog( SfxViewFrame *pViewFrame, Window* pParent,
+ const OString& rID, const OUString& rUIXMLDescription,
+ const SfxItemSet * = 0, sal_Bool bEditFmt = sal_False );
+
+
+ SfxTabDialog( Window* pParent, const ResId &rResId, const SfxItemSet * = 0,
+ sal_Bool bEditFmt = sal_False, const String *pUserButtonText = 0 );
+ SfxTabDialog( SfxViewFrame *pViewFrame, Window* pParent, const ResId &rResId,
+ const SfxItemSet * = 0, sal_Bool bEditFmt = sal_False,
+ const String *pUserButtonText = 0 );
+ ~SfxTabDialog();
+
+ sal_uInt16 AddTabPage( const OString& rName, // Name of the label for the page in the notebook .ui
+ CreateTabPage pCreateFunc, // != 0
+ GetTabPageRanges pRangesFunc, // can be 0
+ sal_Bool bItemsOnDemand = sal_False);
+
+ sal_uInt16 AddTabPage ( const OString &rName, // Name of the label for the page in the notebook .ui
+ sal_uInt16 nPageCreateId ); // Identifier of the Factory Method to create the page
+
+ void AddTabPage( sal_uInt16 nId,
+ CreateTabPage pCreateFunc, // != 0
+ GetTabPageRanges pRangesFunc, // can be 0
+ sal_Bool bItemsOnDemand = sal_False);
+
+
+ void AddTabPage( sal_uInt16 nId,
+ const String &rRiderText,
+ CreateTabPage pCreateFunc, // != 0
+ GetTabPageRanges pRangesFunc, // can be 0
+ sal_Bool bItemsOnDemand = sal_False,
+ sal_uInt16 nPos = TAB_APPEND);
+ void AddTabPage( sal_uInt16 nId,
+ const Bitmap &rRiderBitmap,
+ CreateTabPage pCreateFunc, // != 0
+ GetTabPageRanges pRangesFunc, // can be 0
+ sal_Bool bItemsOnDemand = sal_False,
+ sal_uInt16 nPos = TAB_APPEND);
+
+ void AddTabPage( sal_uInt16 nId,
+ sal_Bool bItemsOnDemand = sal_False);
+ void AddTabPage( sal_uInt16 nId,
+ const String &rRiderText,
+ sal_Bool bItemsOnDemand = sal_False,
+ sal_uInt16 nPos = TAB_APPEND);
+ void AddTabPage( sal_uInt16 nId,
+ const Bitmap &rRiderBitmap,
+ sal_Bool bItemsOnDemand = sal_False,
+ sal_uInt16 nPos = TAB_APPEND);
+
+ void RemoveTabPage( const OString& rName ); // Name of the label for the page in the notebook .ui
+ void RemoveTabPage( sal_uInt16 nId );
+
+ void SetCurPageId(sal_uInt16 nId)
+ {
+ nAppPageId = nId;
+ }
+ void SetCurPageId(const OString& rName)
+ {
+ nAppPageId = m_pTabCtrl->GetPageId(rName);
+ }
+ sal_uInt16 GetCurPageId() const
+ {
+ return m_pTabCtrl->GetCurPageId();
+ }
+ void ShowPage( sal_uInt16 nId );
+
+ // may provide local slots converted by Map
+ const sal_uInt16* GetInputRanges( const SfxItemPool& );
+ void SetInputSet( const SfxItemSet* pInSet );
+ const SfxItemSet* GetOutputItemSet() const { return pOutSet; }
+ sal_Bool IsFormat() const { return bFmt; }
+
+ const OKButton& GetOKButton() const { return *m_pOKBtn; }
+ OKButton& GetOKButton() { return *m_pOKBtn; }
+ const CancelButton& GetCancelButton() const { return *m_pCancelBtn; }
+ CancelButton& GetCancelButton() { return *m_pCancelBtn; }
+ const HelpButton& GetHelpButton() const { return *m_pHelpBtn; }
+ HelpButton& GetHelpButton() { return *m_pHelpBtn; }
+
+ const PushButton* GetUserButton() const { return m_pUserBtn; }
+ PushButton* GetUserButton() { return m_pUserBtn; }
+ void RemoveResetButton();
+
+ short Execute();
+ void StartExecuteModal( const Link& rEndDialogHdl );
+ void Start( sal_Bool bShow = sal_True );
+
+ const SfxItemSet* GetExampleSet() const { return pExampleSet; }
+ SfxViewFrame* GetViewFrame() const { return pFrame; }
+
+ void EnableApplyButton(sal_Bool bEnable = sal_True);
+ sal_Bool IsApplyButtonEnabled() const;
+ void SetApplyHandler(const Link& _rHdl);
+
+ SAL_DLLPRIVATE void Start_Impl();
+
+ //calls Ok without closing dialog
+ bool Apply();
+};
+
+namespace sfx { class ItemConnectionBase; }
+
+class SFX2_DLLPUBLIC SfxTabPage: public TabPage
+{
+friend class SfxTabDialog;
+
+private:
+ const SfxItemSet* pSet;
+ String aUserString;
+ sal_Bool bHasExchangeSupport;
+ SfxTabDialog* pTabDlg;
+ TabPageImpl* pImpl;
+
+ SAL_DLLPRIVATE void SetTabDialog( SfxTabDialog* pNew ) { pTabDlg = pNew; }
+ SAL_DLLPRIVATE void SetInputSet( const SfxItemSet* pNew ) { pSet = pNew; }
+
+protected:
+ SfxTabPage( Window *pParent, const ResId &, const SfxItemSet &rAttrSet );
+ SfxTabPage(Window *pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet &rAttrSet);
+
+ sal_uInt16 GetSlot( sal_uInt16 nWhich ) const
+ { return pSet->GetPool()->GetSlotId( nWhich ); }
+ sal_uInt16 GetWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const
+ { return pSet->GetPool()->GetWhich( nSlot, bDeep ); }
+ const SfxPoolItem* GetOldItem( const SfxItemSet& rSet, sal_uInt16 nSlot, sal_Bool bDeep = sal_True );
+ SfxTabDialog* GetTabDialog() const { return pTabDlg; }
+
+ void AddItemConnection( sfx::ItemConnectionBase* pConnection );
+
+public:
+ virtual ~SfxTabPage();
+
+ const SfxItemSet& GetItemSet() const { return *pSet; }
+
+ virtual sal_Bool FillItemSet( SfxItemSet& );
+ virtual void Reset( const SfxItemSet& );
+
+ sal_Bool HasExchangeSupport() const
+ { return bHasExchangeSupport; }
+ void SetExchangeSupport( sal_Bool bNew = sal_True )
+ { bHasExchangeSupport = bNew; }
+
+ enum sfxpg {
+ KEEP_PAGE = 0x0000, // Error handling; page does not change
+ // 2. Fill an itemset for update
+ // parent examples, this pointer can be NULL all the time!
+ LEAVE_PAGE = 0x0001,
+ // Set, refresh and update other Page
+ REFRESH_SET = 0x0002
+ };
+
+ using TabPage::ActivatePage;
+ using TabPage::DeactivatePage;
+ virtual void ActivatePage( const SfxItemSet& );
+ virtual int DeactivatePage( SfxItemSet* pSet = 0 );
+ void SetUserData(const String& rString)
+ { aUserString = rString; }
+ String GetUserData() { return aUserString; }
+ virtual void FillUserData();
+ virtual sal_Bool IsReadOnly() const;
+ virtual void PageCreated (SfxAllItemSet aSet);
+ static const SfxPoolItem* GetItem( const SfxItemSet& rSet, sal_uInt16 nSlot, sal_Bool bDeep = sal_True );
+
+ void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > GetFrame();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/tabpage.hrc b/include/sfx2/tabpage.hrc
new file mode 100644
index 000000000000..2c70183d433f
--- /dev/null
+++ b/include/sfx2/tabpage.hrc
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SFX2_TABPAGE_HRC
+#define INCLUDED_SFX2_TABPAGE_HRC
+
+// Width and height of all tab pages used in dialogs. Because tab pages
+// can be combined arbitrarily in tab dialogs, they have to have the
+// same dimensions. If you need to adjust either dimension of any tab
+// page (when adding new controls), do the change here.
+
+#define TP_WIDTH 260
+#define TP_HEIGHT 199
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/taskpane.hxx b/include/sfx2/taskpane.hxx
new file mode 100644
index 000000000000..0d0dd6eea199
--- /dev/null
+++ b/include/sfx2/taskpane.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 SFX_TASKPANE_HXX
+#define SFX_TASKPANE_HXX
+
+#include "sfx2/dllapi.h"
+#include "sfx2/childwin.hxx"
+#include "sfx2/titledockwin.hxx"
+
+#include <svtools/toolpanel/tabalignment.hxx>
+#include <svtools/toolpanel/tabitemcontent.hxx>
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/optional.hpp>
+
+namespace svt
+{
+ class ToolPanelDeck;
+}
+
+//......................................................................................................................
+namespace sfx2
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ITaskPaneToolPanelAccess
+ //==================================================================================================================
+ class SAL_NO_VTABLE ITaskPaneToolPanelAccess
+ {
+ public:
+ virtual void ActivateToolPanel( const OUString& i_rPanelURL ) = 0;
+
+ protected:
+ ~ITaskPaneToolPanelAccess() {}
+ };
+
+ //==================================================================================================================
+ //= TaskPaneWrapper
+ //==================================================================================================================
+ class SFX2_DLLPUBLIC TaskPaneWrapper :public SfxChildWindow
+ ,public ITaskPaneToolPanelAccess
+ {
+ public:
+ TaskPaneWrapper(
+ Window* i_pParent,
+ sal_uInt16 i_nId,
+ SfxBindings* i_pBindings,
+ SfxChildWinInfo* i_pInfo
+ );
+
+ SFX_DECL_CHILDWINDOW( TaskPaneWrapper );
+
+ // ITaskPaneToolPanelAccess
+ virtual void ActivateToolPanel( const OUString& i_rPanelURL );
+ };
+
+ //==================================================================================================================
+ //= IToolPanelCompare
+ //==================================================================================================================
+ class SFX2_DLLPUBLIC SAL_NO_VTABLE IToolPanelCompare
+ {
+ public:
+ /** compares to tool panel URLs
+ @return
+ <ul>
+ <li>-1 if the tool panel described by i_rLHS should precede the one described by i_rRHS</li>
+ <li>0 if the two panels have no particular relative order</li>
+ <li>1 if the tool panel described by i_rLHS should succeed the one described by i_rRHS</li>
+
+ */
+ virtual short compareToolPanelsURLs(
+ const OUString& i_rLHS,
+ const OUString& i_rRHS
+ ) const = 0;
+
+ protected:
+ ~IToolPanelCompare() {}
+ };
+
+ //==================================================================================================================
+ //= ModuleTaskPane
+ //==================================================================================================================
+ class ModuleTaskPane_Impl;
+ /** SFX-less version of a module dependent task pane, filled with tool panels as specified in the respective
+ module's configuration
+ */
+ class SFX2_DLLPUBLIC ModuleTaskPane : public Window
+ {
+ public:
+ /** creates a new instance
+ @param i_rParentWindow
+ the parent window
+ @param i_rDocumentFrame
+ the frame to which the task pane belongs. Will be passed to any custom tool panels created
+ via an XUIElementFactory. Also, it is used to determine the module which the task pane is
+ responsible for, thus controlling which tool panels are actually available.
+ */
+ ModuleTaskPane(
+ Window& i_rParentWindow,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocumentFrame
+ );
+ /** creates a new instance
+ @param i_rParentWindow
+ the parent window
+ @param i_rDocumentFrame
+ the frame to which the task pane belongs. Will be passed to any custom tool panels created
+ via an XUIElementFactory. Also, it is used to determine the module which the task pane is
+ responsible for, thus controlling which tool panels are actually available.
+ @param i_rCompare
+ a comparator for tool panel URLs, which allows controlling the order in which the panels are
+ added to the tool panel deck.
+ */
+ ModuleTaskPane(
+ Window& i_rParentWindow,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocumentFrame,
+ const IToolPanelCompare& i_rCompare
+ );
+ ~ModuleTaskPane();
+
+ /** determines whether a given module has any registered tool panels
+ */
+ static bool ModuleHasToolPanels( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocumentFrame );
+
+ /** provides access to the Window aspect of the PanelDeck
+
+ Be careful with this method. For instance, you're not allowed to insert arbitrary IToolPanel implementations
+ into the deck, as the ModuleTaskPane has certain assumptions about the panel implementations. However,
+ you're allowed to remove and re-insert panels, which have originally been created by the ModuleTaskPane
+ itself.
+ */
+ ::svt::ToolPanelDeck& GetPanelDeck();
+ const ::svt::ToolPanelDeck& GetPanelDeck() const;
+
+ /** returns the position of the panel with the given resource URL
+ */
+ ::boost::optional< size_t >
+ GetPanelPos( const OUString& i_rResourceURL );
+
+ /** returns the resource URL of the panel at the specified position
+ */
+ OUString
+ GetPanelResourceURL( const size_t i_nPanelPos ) const;
+
+ /// sets the "classical" layout of the tool panel deck, using drawers
+ void SetDrawersLayout();
+ /// sets the new layout of the tool panel deck, using tabs
+ void SetTabsLayout( const ::svt::TabAlignment i_eTabAlignment, const ::svt::TabItemContent i_eTabContent );
+
+ protected:
+ // Window overridables
+ virtual void Resize();
+ virtual void GetFocus();
+
+ private:
+ ::boost::scoped_ptr< ModuleTaskPane_Impl > m_pImpl;
+ };
+
+ //==================================================================================================================
+ //= TaskPaneController
+ //==================================================================================================================
+ class TaskPaneController_Impl;
+ /** is a helper class for connecting a ModuleTaskPane and a TitledDockingWindow, for clients of the ModuleTaskPane
+ which do not use the TaskPaneDockingWindow
+
+ The controller will add a drop down menu to the docking window which contains one item for each panel in the
+ panel deck, and allows toggling their visibility.
+ */
+ class SFX2_DLLPUBLIC TaskPaneController
+ {
+ public:
+ TaskPaneController(
+ ModuleTaskPane& i_rTaskPane,
+ TitledDockingWindow& i_rDockingWindow
+ );
+ ~TaskPaneController();
+
+ /// activates the panel with the given URL
+ void ActivateToolPanel( const OUString& i_rPanelURL );
+
+ private:
+ ::boost::scoped_ptr< TaskPaneController_Impl > m_pImpl;
+ };
+
+ //==================================================================================================================
+ //= TaskPaneDockingWindow
+ //==================================================================================================================
+ class TaskPaneDockingWindow :public TitledDockingWindow
+ ,public ITaskPaneToolPanelAccess
+ {
+ public:
+ TaskPaneDockingWindow( SfxBindings* i_pBindings, TaskPaneWrapper& i_rWrapper,
+ Window* i_pParent, WinBits i_nBits );
+
+ // ITaskPaneToolPanelAccess
+ virtual void ActivateToolPanel( const OUString& i_rPanelURL );
+
+ protected:
+ // Window overridables
+ virtual void GetFocus();
+
+ // TitledDockingWindow overridables
+ virtual void onLayoutDone();
+
+ private:
+ ModuleTaskPane m_aTaskPane;
+ TaskPaneController m_aPaneController;
+ };
+
+//......................................................................................................................
+} // namespace sfx2
+//......................................................................................................................
+
+#endif // SFX_TASKPANE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
new file mode 100644
index 000000000000..56047d1e32ad
--- /dev/null
+++ b/include/sfx2/tbxctrl.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 _SFXTBXCTRL_HXX
+#define _SFXTBXCTRL_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <vcl/timer.hxx>
+#include <vcl/menu.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/floatwin.hxx>
+#include <comphelper/processfactory.hxx>
+#include <sfx2/ctrlitem.hxx>
+#include <sfx2/sfxstatuslistener.hxx>
+#include <svtools/toolboxcontroller.hxx>
+#include <svtools/framestatuslistener.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/awt/XDockableWindowListener.hpp>
+#include <com/sun/star/awt/XDockableWindow.hpp>
+#include <com/sun/star/frame/XSubToolbarController.hpp>
+
+//------------------------------------------------------------------
+
+class SfxToolBoxControl;
+class SfxBindings;
+class SfxModule;
+class SfxUnoControllerItem;
+
+svt::ToolboxController* SAL_CALL SfxToolBoxControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, ToolBox* pToolbox, unsigned short nID, const OUString& aCommandURL );
+
+typedef SfxToolBoxControl* (*SfxToolBoxControlCtor)( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox );
+
+struct SfxTbxCtrlFactory
+{
+ SfxToolBoxControlCtor pCtor;
+ TypeId nTypeId;
+ sal_uInt16 nSlotId;
+
+ SfxTbxCtrlFactory( SfxToolBoxControlCtor pTheCtor,
+ TypeId nTheTypeId, sal_uInt16 nTheSlotId ):
+ pCtor(pTheCtor),
+ nTypeId(nTheTypeId),
+ nSlotId(nTheSlotId)
+ {}
+};
+
+//------------------------------------------------------------------
+
+enum SfxPopupWindowType
+{
+ SFX_POPUPWINDOW_NONE,
+ SFX_POPUPWINDOW_ONCLICK,
+ SFX_POPUPWINDOW_ONTIMEOUT,
+ SFX_POPUPWINDOW_ONCLICKANDMOVE,
+ SFX_POPUPWINDOW_ONTIMEOUTANDMOVE,
+ SFX_POPUPWINDOW_CONTEXTMENU
+};
+
+//------------------------------------------------------------------
+
+class SfxFrameStatusListener : public svt::FrameStatusListener
+{
+ public:
+ SfxFrameStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
+ SfxStatusListenerInterface* pCallee );
+ virtual ~SfxFrameStatusListener();
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ private:
+ SfxStatusListenerInterface* m_pCallee;
+};
+
+//------------------------------------------------------------------
+
+/* Floating windows that can be torn from tool boxes should be derived from
+ this class. Since it is also derived from SfxControllerItem, its instances
+ will also receive the StateChanged calls.
+*/
+
+class SFX2_DLLPUBLIC SfxPopupWindow: public FloatingWindow, public SfxStatusListenerInterface
+{
+ sal_Bool m_bFloating;
+ sal_uIntPtr m_nEventId;
+ sal_Bool m_bCascading;
+ Link m_aDeleteLink;
+ sal_uInt16 m_nId;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+ SfxFrameStatusListener* m_pStatusListener;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xStatusListener;
+
+private:
+ SfxFrameStatusListener* GetOrCreateStatusListener();
+
+ SAL_DLLPRIVATE SfxPopupWindow(SfxPopupWindow &); // not defined
+ SAL_DLLPRIVATE void operator =(SfxPopupWindow &); // not defined
+ void Delete();
+
+protected:
+ virtual void PopupModeEnd();
+ virtual sal_Bool Close();
+ virtual void DeleteFloatingWindow();
+
+ sal_uInt16 GetId() const { return m_nId; }
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& GetFrame() const { return m_xFrame; }
+
+ void BindListener();
+ void UnbindListener();
+ void AddStatusListener( const OUString& rCommandURL );
+
+ // SfxStatusListenerInterface
+ using FloatingWindow::StateChanged;
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+
+public:
+ SfxPopupWindow( sal_uInt16 nId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ WinBits nBits );
+ SfxPopupWindow( sal_uInt16 nId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ const ResId &rId );
+ SfxPopupWindow( sal_uInt16 nId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ Window* pParentWindow,
+ WinBits nBits );
+ ~SfxPopupWindow();
+
+ virtual SfxPopupWindow* Clone() const;
+ virtual void MouseMove( const MouseEvent& rMEvt );
+
+ void StartCascading();
+ SAL_DLLPRIVATE void SetDeleteLink_Impl( const Link& rLink )
+ {
+ m_aDeleteLink = rLink;
+ }
+};
+
+//------------------------------------------------------------------
+
+#define SFX_DECL_TOOLBOX_CONTROL() \
+ static SfxToolBoxControl* CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ); \
+ static void RegisterControl(sal_uInt16 nSlotId = 0, SfxModule *pMod=NULL)
+
+/* For special ToolBox controls, such as a font selection box or toolbox
+ tear-off floating windows, an appropriate Item-Subclass of SfxTooBoxControl
+ has to be implemented.
+
+ This class has to be registered in SfxApplication:Init() with the static
+ control method RegisterControl(). The SFx then automatically creates these
+ controls in the toolbox, if the associated slots are of the specific type.
+ */
+
+struct SfxToolBoxControl_Impl;
+class SFX2_DLLPUBLIC SfxToolBoxControl:
+ public ::com::sun::star::awt::XDockableWindowListener,
+ public ::com::sun::star::frame::XSubToolbarController,
+ public svt::ToolboxController
+
+{
+friend class SfxToolbox;
+friend class SfxPopupWindow;
+friend struct SfxTbxCtrlFactory;
+
+ SfxToolBoxControl_Impl* pImpl;
+
+protected:
+ DECL_LINK( PopupModeEndHdl, void * );
+ DECL_LINK( ClosePopupWindow, SfxPopupWindow * );
+
+ // old SfxToolBoxControl methods
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual void Select( sal_Bool bMod1 = sal_False );
+ virtual void Select( sal_uInt16 nModifier );
+
+ virtual void DoubleClick();
+ virtual void Click();
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+ virtual SfxPopupWindow* CreatePopupWindowCascading();
+ virtual Window* CreateItemWindow( Window *pParent );
+
+ // Must be called by subclass to set a new popup window instance
+ void SetPopupWindow( SfxPopupWindow* pWindow );
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XEventListener
+ using ::cppu::OPropertySetHelper::disposing;
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+
+ // new controller API
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& rParent )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // XSubToolbarController
+ virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL functionSelected( const OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XDockableWindowListener
+ virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+
+ // helper methods
+ void createAndPositionSubToolBar( const OUString& rSubToolBarResName );
+ ::Size getPersistentFloatingSize( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const OUString& rSubToolBarResName );
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SfxToolBoxControl( sal_uInt16 nSlotID, sal_uInt16 nId, ToolBox& rBox, sal_Bool bShowStrings = sal_False );
+ virtual ~SfxToolBoxControl();
+
+ ToolBox& GetToolBox() const;
+ unsigned short GetId() const;
+ unsigned short GetSlotId() const;
+
+ void Dispatch( const OUString& aCommand,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs );
+ static void Dispatch( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider,
+ const OUString& rCommand,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs );
+
+ static SfxItemState GetItemState( const SfxPoolItem* pState );
+ static SfxToolBoxControl* CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule *pMod );
+ static void RegisterToolBoxControl( SfxModule*, SfxTbxCtrlFactory*);
+};
+
+#define SFX_IMPL_TOOLBOX_CONTROL(Class, nItemClass) \
+ SfxToolBoxControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \
+ { return new Class( nSlotId, nId, rTbx ); } \
+ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
+ { SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( \
+ Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); }
+
+#define SFX_IMPL_TOOLBOX_CONTROL_ARG(Class, nItemClass, Arg) \
+ SfxToolBoxControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \
+ { return new Class( nSlotId, nId, rTbx, Arg); } \
+ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
+ { SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( \
+ Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); }
+
+//=========================================================================
+
+
+class SfxDragButton_Impl : public FixedImage
+{
+public:
+
+ SfxDragButton_Impl( Window *pParent );
+ virtual void Command ( const CommandEvent& rCEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+};
+
+class SfxDragToolBoxControl_Impl : public SfxToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SfxDragToolBoxControl_Impl( sal_uInt16 nId, ToolBox& rBox );
+ virtual Window* CreateItemWindow( Window *pParent );
+ using SfxToolBoxControl::Select;
+ virtual void Select( sal_Bool bMod1 = sal_False );
+};
+
+//------------------------------------------------------------------------
+
+class SfxAppToolBoxControl_Impl : public SfxToolBoxControl
+
+/* [Description]
+
+ Internal helper class for the pop-up menu <AppMenu_Impl> under new
+ start in the SDT.
+*/
+
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SfxAppToolBoxControl_Impl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox );
+ ~SfxAppToolBoxControl_Impl();
+ void SetImage( const String& rFacName );
+
+ struct ExecuteInfo
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
+ ::com::sun::star::util::URL aTargetURL;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
+ };
+
+ DECL_STATIC_LINK( SfxAppToolBoxControl_Impl, ExecuteHdl_Impl, ExecuteInfo* );
+
+protected:
+ virtual void Click();
+ using SfxToolBoxControl::Select;
+ virtual void Select( sal_Bool );
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual SfxPopupWindow* CreatePopupWindow();
+ DECL_LINK( Activate, Menu * );
+private:
+ String aLastURL;
+ PopupMenu* pMenu;
+ sal_uIntPtr m_nSymbolsStyle;
+ sal_Bool m_bShowMenuImages;
+};
+
+class SfxHistoryToolBoxControl_Impl : public SfxToolBoxControl
+{
+ Timer aTimer;
+
+private:
+ DECL_LINK( Timeout, Timer * );
+
+protected:
+ virtual void Click( );
+ using SfxToolBoxControl::Select;
+ virtual void Select( sal_Bool );
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SfxHistoryToolBoxControl_Impl( sal_uInt16 nId, ToolBox& rBox );
+};
+
+class SfxReloadToolBoxControl_Impl : public SfxToolBoxControl
+{
+ protected:
+ using SfxToolBoxControl::Select;
+ virtual void Select( sal_uInt16 nSelectModifier );
+
+ public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SfxReloadToolBoxControl_Impl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox );
+};
+
+class SfxPopupMenuManager;
+class SfxAddonsToolBoxControl_Impl : public SfxToolBoxControl
+
+/* [Description]
+
+ Internal helper class to provide the addons popup menu through the addons
+ toolbox button.
+*/
+
+{
+ sal_Bool bBigImages;
+ PopupMenu* pMenu;
+ sal_Bool m_bShowMenuImages;
+
+protected:
+ virtual void Click();
+ using SfxToolBoxControl::Select;
+ virtual void Select( sal_Bool );
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+ DECL_LINK( Activate, Menu * );
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SfxAddonsToolBoxControl_Impl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox );
+ ~SfxAddonsToolBoxControl_Impl();
+
+ void RefreshMenuImages( Menu* pMenu );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/templateabstractview.hxx b/include/sfx2/templateabstractview.hxx
new file mode 100644
index 000000000000..5f1eca6a80fa
--- /dev/null
+++ b/include/sfx2/templateabstractview.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/.
+ */
+
+#ifndef __SFX2_TEMPLATEABSTRACTVIEW_HXX__
+#define __SFX2_TEMPLATEABSTRACTVIEW_HXX__
+
+#include <sfx2/templateproperties.hxx>
+#include <sfx2/thumbnailview.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+
+//template thumbnail item defines
+#define TEMPLATE_ITEM_MAX_WIDTH 160
+#define TEMPLATE_ITEM_MAX_HEIGHT 140
+#define TEMPLATE_ITEM_PADDING 5
+#define TEMPLATE_ITEM_MAX_TEXT_LENGTH 20
+#define TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT 88
+
+//template thumbnail height with a subtitle
+#define TEMPLATE_ITEM_MAX_HEIGHT_SUB 160
+
+//template thumbnail image defines
+#define TEMPLATE_THUMBNAIL_MAX_HEIGHT TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT - 2*TEMPLATE_ITEM_PADDING
+#define TEMPLATE_THUMBNAIL_MAX_WIDTH TEMPLATE_ITEM_MAX_WIDTH - 2*TEMPLATE_ITEM_PADDING
+
+class SfxDocumentTemplates;
+
+enum FILTER_APPLICATION
+{
+ FILTER_APP_NONE,
+ FILTER_APP_WRITER,
+ FILTER_APP_CALC,
+ FILTER_APP_IMPRESS,
+ FILTER_APP_DRAW
+};
+
+// Display template items depending on the generator application
+class ViewFilter_Application
+{
+public:
+
+ ViewFilter_Application (FILTER_APPLICATION App)
+ : mApp(App)
+ {}
+
+ virtual ~ViewFilter_Application () {}
+
+ virtual bool operator () (const ThumbnailViewItem *pItem);
+
+ bool isValid (const OUString& rPath) const;
+
+protected:
+
+ FILTER_APPLICATION mApp;
+};
+
+class ViewFilter_Keyword
+{
+public:
+
+ ViewFilter_Keyword (const OUString &rKeyword)
+ : maKeyword(rKeyword)
+ {}
+
+ bool operator () (const ThumbnailViewItem *pItem);
+
+private:
+
+ OUString maKeyword;
+};
+
+class SFX2_DLLPUBLIC TemplateAbstractView : public ThumbnailView
+{
+public:
+
+ TemplateAbstractView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren);
+
+ TemplateAbstractView ( Window* pParent, const ResId& rResId, bool bDisableTransientChildren = false );
+
+ virtual ~TemplateAbstractView ();
+
+ void insertItem (const TemplateItemProperties &rTemplate);
+
+ // Fill view with new item list
+ void insertItems (const std::vector<TemplateItemProperties> &rTemplates);
+
+ // Fill view with template folders thumbnails
+ virtual void Populate () { }
+
+ virtual void reload () { }
+
+ virtual void showRootRegion () = 0;
+
+ virtual void showRegion (ThumbnailViewItem *pItem) = 0;
+
+ virtual sal_uInt16 createRegion (const OUString &rName) = 0;
+
+ // Return if we can have regions inside the current region
+ virtual bool isNestedRegionAllowed () const = 0;
+
+ // Return if we can import templates to the current region
+ virtual bool isImportAllowed () const = 0;
+
+ sal_uInt16 getCurRegionId () const;
+
+ const OUString& getCurRegionName () const;
+
+ // Check if the root region is visible or not.
+ bool isNonRootRegionVisible () const;
+
+ void setOpenRegionHdl(const Link &rLink);
+
+ void setOpenTemplateHdl (const Link &rLink);
+
+ static BitmapEx scaleImg (const BitmapEx &rImg, long width, long height);
+
+ static BitmapEx getDefaultThumbnail( const OUString& rPath );
+
+ static BitmapEx fetchThumbnail (const OUString &msURL, long width, long height);
+
+protected:
+
+ DECL_LINK(ShowRootRegionHdl, void*);
+
+ virtual void OnItemDblClicked(ThumbnailViewItem *pItem);
+
+protected:
+
+ sal_uInt16 mnCurRegionId;
+ OUString maCurRegionName;
+
+ PushButton maAllButton;
+ FixedText maFTName;
+
+ Link maOpenRegionHdl;
+ Link maOpenTemplateHdl;
+};
+
+#endif // __SFX2_TEMPLATEABSTRACTVIEW_HXX__
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/templatecontaineritem.hxx b/include/sfx2/templatecontaineritem.hxx
new file mode 100644
index 000000000000..527571c80cac
--- /dev/null
+++ b/include/sfx2/templatecontaineritem.hxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright 2012 LibreOffice contributors.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 TEMPLATEFOLDERVIEWITEM_HXX
+#define TEMPLATEFOLDERVIEWITEM_HXX
+
+#include <sfx2/templateproperties.hxx>
+#include <sfx2/thumbnailviewitem.hxx>
+
+class TemplateContainerItem : public ThumbnailViewItem
+{
+public:
+
+ sal_uInt16 mnRegionId;
+ BitmapEx maPreview2;
+ BitmapEx maPreview3;
+ BitmapEx maPreview4;
+ std::vector<TemplateItemProperties> maTemplates;
+
+ TemplateContainerItem (ThumbnailView &rView);
+
+ virtual ~TemplateContainerItem ();
+
+ virtual void Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor,
+ const ThumbnailItemAttributes *pAttrs);
+
+ virtual void calculateItemsPosition (const long nThumbnailHeight, const long nDisplayHeight,
+ const long nPadding, sal_uInt32 nMaxTextLenght,
+ const ThumbnailItemAttributes *pAttrs);
+
+ bool HasMissingPreview( );
+
+private:
+
+ Rectangle maThumbnailArea;
+};
+
+#endif // TEMPLATEFOLDERVIEWITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/templateinfodlg.hxx b/include/sfx2/templateinfodlg.hxx
new file mode 100644
index 000000000000..69d79b20da9a
--- /dev/null
+++ b/include/sfx2/templateinfodlg.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/.
+*/
+
+#ifndef __SFX2_TEMPLATEINFODLG_HXX__
+#define __SFX2_TEMPLATEINFODLG_HXX__
+
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+
+namespace svtools {
+ class ODocumentInfoPreview;
+}
+
+namespace com{ namespace sun { namespace star { namespace awt { class XWindow; } } } }
+namespace com{ namespace sun { namespace star { namespace frame { class XFrame2; } } } }
+
+class SfxTemplateInfoDlg : public ModalDialog
+{
+public:
+
+ SfxTemplateInfoDlg (Window *pParent = NULL);
+
+ ~SfxTemplateInfoDlg ();
+
+ void loadDocument (const OUString &rURL);
+
+protected:
+
+ DECL_LINK (CloseHdl, void*);
+
+private:
+
+ PushButton maBtnClose;
+
+ Window *mpPreviewView; // gets released when xWindows get destroyed (dont delete in constructor)
+ svtools::ODocumentInfoPreview *mpInfoView;
+
+ ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 > m_xFrame;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xWindow;
+};
+
+#endif // __SFX2_TEMPLATEINFODLG_HXX__
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/templatelocalview.hxx b/include/sfx2/templatelocalview.hxx
new file mode 100644
index 000000000000..6cefaf1782c0
--- /dev/null
+++ b/include/sfx2/templatelocalview.hxx
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright 2012 LibreOffice contributors.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 TEMPLATEFOLDERVIEW_HXX
+#define TEMPLATEFOLDERVIEW_HXX
+
+#include <set>
+
+#include <sfx2/templateabstractview.hxx>
+
+class SfxDocumentTemplates;
+class TemplateContainerItem;
+
+namespace com {
+ namespace sun { namespace star { namespace frame {
+ class XModel;
+ } } }
+}
+
+class SFX2_DLLPUBLIC TemplateLocalView : public TemplateAbstractView
+{
+ typedef bool (*selection_cmp_fn)(const ThumbnailViewItem*,const ThumbnailViewItem*);
+
+public:
+
+ TemplateLocalView ( Window* pParent, const ResId& rResId, bool bDisableTransientChildren = false );
+
+ virtual ~TemplateLocalView ();
+
+ // Fill view with template folders thumbnails
+ virtual void Populate ();
+
+ virtual void reload ();
+
+ virtual void showRootRegion ();
+
+ virtual void showRegion (ThumbnailViewItem *pItem);
+
+ void showRegion (const OUString &rName);
+
+ sal_uInt16 getCurRegionItemId () const;
+
+ sal_uInt16 getRegionId (size_t pos) const;
+
+ OUString getRegionName(const sal_uInt16 nRegionId) const;
+
+ OUString getRegionItemName(const sal_uInt16 nItemId) const;
+
+ std::vector<OUString> getFolderNames ();
+
+ std::vector<TemplateItemProperties>
+ getFilteredItems (const boost::function<bool (const TemplateItemProperties&) > &rFunc) const;
+
+ virtual sal_uInt16 createRegion (const OUString &rName);
+
+ virtual bool isNestedRegionAllowed () const;
+
+ virtual bool isImportAllowed () const;
+
+ bool removeRegion (const sal_uInt16 nItemId);
+
+ bool removeTemplate (const sal_uInt16 nItemId, const sal_uInt16 nSrcItemId);
+
+ bool moveTemplate (const ThumbnailViewItem* pItem, const sal_uInt16 nSrcItem,
+ const sal_uInt16 nTargetItem);
+
+ bool moveTemplates (const std::set<const ThumbnailViewItem*,selection_cmp_fn> &rItems, const sal_uInt16 nTargetItem);
+
+ bool copyFrom (const sal_uInt16 nRegionItemId, const BitmapEx &rThumbnail, const OUString &rPath);
+
+ // Import a template to the current region
+ bool copyFrom (const OUString &rPath);
+
+ bool copyFrom(TemplateContainerItem *pItem, const OUString &rPath);
+
+ bool exportTo (const sal_uInt16 nItemId, const sal_uInt16 nRegionItemId, const OUString &rName);
+
+ bool saveTemplateAs (sal_uInt16 nItemId,
+ com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rModel,
+ const OUString &rName);
+
+ bool saveTemplateAs (TemplateContainerItem *pDstItem,
+ com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rModel,
+ const OUString &rName);
+
+ bool isTemplateNameUnique (const sal_uInt16 nRegionItemId, const OUString &rName) const;
+
+ virtual bool renameItem(ThumbnailViewItem* pItem, OUString sNewTitle);
+
+private:
+
+ SfxDocumentTemplates *mpDocTemplates;
+ std::vector<TemplateContainerItem* > maRegions;
+};
+
+#endif // TEMPLATEFOLDERVIEW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/templatelocnames.hrc b/include/sfx2/templatelocnames.hrc
new file mode 100644
index 000000000000..7d3c52798461
--- /dev/null
+++ b/include/sfx2/templatelocnames.hrc
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Péter Rabi <prabi@caesar.elte.hu>
+ * Portions created by the Initial Developer are Copyright (C) 2011 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#define NUM_TEMPLATE_NAMES 10
+#define TEMPL_LOC_OFFSET 2190
+
+#define STR_TEMPLATE_NAME1_DEF (TEMPL_LOC_OFFSET + 1)
+#define STR_TEMPLATE_NAME2_DEF (TEMPL_LOC_OFFSET + 2)
+#define STR_TEMPLATE_NAME3_DEF (TEMPL_LOC_OFFSET + 3)
+#define STR_TEMPLATE_NAME4_DEF (TEMPL_LOC_OFFSET + 4)
+#define STR_TEMPLATE_NAME5_DEF (TEMPL_LOC_OFFSET + 5)
+#define STR_TEMPLATE_NAME6_DEF (TEMPL_LOC_OFFSET + 6)
+#define STR_TEMPLATE_NAME7_DEF (TEMPL_LOC_OFFSET + 7)
+#define STR_TEMPLATE_NAME8_DEF (TEMPL_LOC_OFFSET + 8)
+#define STR_TEMPLATE_NAME9_DEF (TEMPL_LOC_OFFSET + 9)
+#define STR_TEMPLATE_NAME10_DEF (TEMPL_LOC_OFFSET + 10)
+
+#define STR_TEMPLATE_NAME1 (TEMPL_LOC_OFFSET + 51)
+#define STR_TEMPLATE_NAME2 (TEMPL_LOC_OFFSET + 52)
+#define STR_TEMPLATE_NAME3 (TEMPL_LOC_OFFSET + 53)
+#define STR_TEMPLATE_NAME4 (TEMPL_LOC_OFFSET + 54)
+#define STR_TEMPLATE_NAME5 (TEMPL_LOC_OFFSET + 55)
+#define STR_TEMPLATE_NAME6 (TEMPL_LOC_OFFSET + 56)
+#define STR_TEMPLATE_NAME7 (TEMPL_LOC_OFFSET + 57)
+#define STR_TEMPLATE_NAME8 (TEMPL_LOC_OFFSET + 58)
+#define STR_TEMPLATE_NAME9 (TEMPL_LOC_OFFSET + 59)
+#define STR_TEMPLATE_NAME10 (TEMPL_LOC_OFFSET + 60)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/templateproperties.hxx b/include/sfx2/templateproperties.hxx
new file mode 100644
index 000000000000..f0db901073f0
--- /dev/null
+++ b/include/sfx2/templateproperties.hxx
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright 2012 LibreOffice contributors.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 __SFX2_TEMPLATEPROPERTIES_HXX__
+#define __SFX2_TEMPLATEPROPERTIES_HXX__
+
+#include <rtl/ustring.hxx>
+#include <vcl/bitmapex.hxx>
+
+struct TemplateItemProperties
+{
+ bool aIsFolder;
+ sal_uInt16 nId; ///< Index for ThumbnailView
+ sal_uInt16 nDocId; ///< Index based on SfxTemplateDocument
+ sal_uInt16 nRegionId;
+ OUString aName;
+ OUString aPath;
+ BitmapEx aThumbnail;
+};
+
+#endif // __SFX2_TEMPLATEPROPERTIES_HXX__
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/templateremoteview.hxx b/include/sfx2/templateremoteview.hxx
new file mode 100644
index 000000000000..bcb2b68fc0a4
--- /dev/null
+++ b/include/sfx2/templateremoteview.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/.
+ */
+
+#ifndef __SFX2_TEMPLATEREMOTEVIEW_HXX__
+#define __SFX2_TEMPLATEREMOTEVIEW_HXX__
+
+#include <sfx2/templateabstractview.hxx>
+#include <sfx2/templateproperties.hxx>
+
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+
+class TemplateRepository;
+
+class TemplateRemoteView : public TemplateAbstractView
+{
+public:
+
+ TemplateRemoteView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren);
+
+ virtual ~TemplateRemoteView ();
+
+ virtual void showRootRegion ();
+
+ virtual void showRegion (ThumbnailViewItem *pItem);
+
+ bool loadRepository (TemplateRepository* pRepository, bool bRefresh);
+
+ virtual sal_uInt16 createRegion (const OUString &rName);
+
+ virtual bool isNestedRegionAllowed () const;
+
+ virtual bool isImportAllowed () const;
+
+private:
+
+ com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
+};
+
+#endif // __SFX2_TEMPLATEREMOTEVIEW_HXX__
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/templaterepository.hxx b/include/sfx2/templaterepository.hxx
new file mode 100644
index 000000000000..f134c9897bf6
--- /dev/null
+++ b/include/sfx2/templaterepository.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/.
+ */
+
+#ifndef __SFX2_TEMPLATEREPOSITORY_HXX__
+#define __SFX2_TEMPLATEREPOSITORY_HXX__
+
+#include <sfx2/templateproperties.hxx>
+
+class TemplateRepository
+{
+public:
+
+ TemplateRepository () : mnId(0) { };
+
+ virtual ~TemplateRepository () { };
+
+ void setURL (const OUString &rURL) { maUrl = rURL; }
+
+ const OUString& getURL () const { return maUrl; }
+
+ void insertTemplate (const TemplateItemProperties &prop) { maTemplates.push_back(prop); }
+
+ void clearTemplates () { maTemplates.clear(); }
+
+ const std::vector<TemplateItemProperties>& getTemplates () const { return maTemplates; }
+
+public:
+
+ sal_uInt16 mnId;
+ OUString maTitle;
+
+private:
+
+ OUString maUrl;
+ std::vector<TemplateItemProperties> maTemplates;
+};
+
+#endif // __SFX2_TEMPLATEREPOSITORY_HXX__
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/templateviewitem.hxx b/include/sfx2/templateviewitem.hxx
new file mode 100644
index 000000000000..efabd34ea4fd
--- /dev/null
+++ b/include/sfx2/templateviewitem.hxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright 2012 LibreOffice contributors.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 TEMPLATEVIEWITEM_HXX
+#define TEMPLATEVIEWITEM_HXX
+
+#include <sfx2/thumbnailviewitem.hxx>
+
+class TemplateViewItem : public ThumbnailViewItem
+{
+public:
+
+ TemplateViewItem (ThumbnailView &rView);
+
+ virtual ~TemplateViewItem ();
+
+ void setPath (const OUString &rPath) { maPath = rPath; }
+
+ const OUString& getPath () const { return maPath; }
+
+ void setAuthor (const OUString &rAuthor) { maAuthor = rAuthor; }
+
+ const OUString& getAuthor () const { return maAuthor; }
+
+ void setKeywords (const OUString &rKeywords) { maKeywords = rKeywords; }
+
+ const OUString& getKeywords () const { return maKeywords; }
+
+ void setSubTitle (const OUString &rTitle) { maSubTitle = rTitle; }
+
+ const OUString& getSubTitle () const { return maSubTitle; }
+
+ virtual void calculateItemsPosition (const long nThumbnailHeight, const long nDisplayHeight,
+ const long nPadding, sal_uInt32 nMaxTextLenght,
+ const ThumbnailItemAttributes *pAttrs);
+
+ virtual void Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor,
+ const ThumbnailItemAttributes *pAttrs);
+
+ sal_uInt16 mnRegionId;
+ sal_uInt16 mnDocId;
+
+private:
+
+ OUString maPath;
+ OUString maAuthor;
+ OUString maKeywords;
+ OUString maSubTitle;
+
+ Point maSubTitlePos;
+};
+
+#endif // TEMPLATEVIEWITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/templdlg.hxx b/include/sfx2/templdlg.hxx
new file mode 100644
index 000000000000..e9fb3a5e4c51
--- /dev/null
+++ b/include/sfx2/templdlg.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 _SFX_TEMPLDLG_HXX
+#define _SFX_TEMPLDLG_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+
+#include <rsc/rscsfx.hxx>
+
+#include <sfx2/dockwin.hxx>
+#include <sfx2/childwin.hxx>
+#include <sfx2/basedlgs.hxx>
+
+class SfxTemplateDialog_Impl;
+
+// class ISfxTemplateCommon ----------------------------------------------
+
+class ISfxTemplateCommon
+{
+public:
+ virtual SfxStyleFamily GetActualFamily() const = 0;
+ virtual String GetSelectedEntry() const = 0;
+
+protected:
+ ~ISfxTemplateCommon() {}
+};
+
+// class SfxTemplateDialog -----------------------------------------------
+
+class SfxTemplateDialog : public SfxDockingWindow
+{
+private:
+friend class SfxTemplateDialogWrapper;
+friend class SfxTemplateDialog_Impl;
+
+ SfxTemplateDialog_Impl* pImpl;
+
+ virtual void DataChanged( const DataChangedEvent& _rDCEvt );
+ virtual void Resize();
+ virtual SfxChildAlignment CheckAlignment( SfxChildAlignment, SfxChildAlignment );
+ virtual void StateChanged( StateChangedType nStateChange );
+
+public:
+ SfxTemplateDialog( SfxBindings*, SfxChildWindow*, Window* );
+ ~SfxTemplateDialog();
+
+ virtual void Update();
+
+ ISfxTemplateCommon* GetISfxTemplateCommon();
+ void SetParagraphFamily();
+};
+
+// class SfxTemplateDialogWrapper ----------------------------------------
+
+class SFX2_DLLPUBLIC SfxTemplateDialogWrapper : public SfxChildWindow
+{
+public:
+ SfxTemplateDialogWrapper
+ (Window*,sal_uInt16,SfxBindings*,SfxChildWinInfo*);
+ SFX_DECL_CHILDWINDOW_WITHID(SfxTemplateDialogWrapper);
+
+ void SetParagraphFamily();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
new file mode 100644
index 000000000000..2bdf1b94ae09
--- /dev/null
+++ b/include/sfx2/thumbnailview.hxx
@@ -0,0 +1,332 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright 2012 LibreOffice contributors.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 THUMBNAILVIEW_HXX
+#define THUMBNAILVIEW_HXX
+
+#include "sfx2/dllapi.h"
+
+#include <vector>
+#include <boost/function.hpp>
+
+#include <sfx2/thumbnailviewitem.hxx>
+#include <vcl/ctrl.hxx>
+#include <vcl/timer.hxx>
+
+class BitmapEx;
+class MouseEvent;
+class TrackingEvent;
+class HelpEvent;
+class KeyEvent;
+class DataChangedEvent;
+class ScrollBar;
+typedef ::std::vector< ThumbnailViewItem* > ValueItemList;
+
+struct ThumbnailItemAttributes;
+class ThumbnailViewAcc;
+class ThumbnailViewItemAcc;
+
+namespace drawinglayer {
+ namespace processor2d {
+ class BaseProcessor2D;
+ }
+}
+
+/*************************************************************************
+
+ Description
+ ============
+
+ class ThumbnailView
+
+ This class allows the selection of an item. In the process items are
+ drawn side by side. The selection of items can be more clear than in a
+ ListBox shape for example in case of colors or samples.
+ The amount of columns drawn by the control and whether the items
+ should be encircled can be specified. Optional a NoSelection or name
+ field could be shown. By default image and color items are supported.
+ Items could be drawn by oneself if InsertItem() is only called with
+ an ID. To achieve this the UserDraw handler needs to be overloaded. The
+ description text could be specified afterwards in case of UserDraw
+ and any other items.
+
+ Cross references
+
+ class ListBox
+
+ --------------------------------------------------------------------------
+
+ WinBits
+
+ WB_VSCROLL A scroolbar will be always shown. The visible number of
+ lines have to be specified with SetLineCount() if this
+ flag is set.
+ WB_TABSTOP It is possible to jump into the ValueSet with the tab key.
+ WB_NOTABSTOP It is not possible to jump into the ValueSet with the
+ tab key.
+ --------------------------------------------------------------------------
+
+ The number of columns must be either set with SetColCount() or
+ SetItemWidth(). If the number of colums is specified by SetColCount()
+ the width of the items will be calculated by the visible range.
+ If the items should have a static width, it has to be specified
+ with SetItemWidth(). In this case the number of columns will be calculated
+ by the visible range.
+
+ The number of rows is given by the number of items / number of columns. The
+ number of visible rows must either specified by SetLineCount() or
+ SetItemWidth(). If the number of visible rows is specified by SetLineCount(),
+ the height of the items will be calculated from the visible height. If the
+ items should have a fixed height it has to be specified with SetItemHeight().
+ In this case the number of visible rows is then calculated from the visible
+ height. If the number of visible rows is neither specified by SetLineCount()
+ nor by SetItemHeight() all rows will be shown. The height of the items will
+ be calculated by the visible height. If the number of visible rows is
+ specified by SetLineCount() or SetItemHeight() ValueSet does scroll
+ automatically when more lines are available, as are visible. If scrolling
+ should be also possible with a ScrollBar WB_VSCROLL needs to be set.
+
+ The distance between the items can be increased by SetExtraSpacing(). The
+ distance, which will be shown between two items (both in x and in y), is
+ measured in pixels.
+
+ The exact window size for a specific item size can be calculated by
+ CalcWindowSizePixel(). To do this all relevant data (number of columns/...)
+ have to be specified and if no number of rows was set, all items need to
+ be inserted. If the window was created with WB_BORDER/Border=sal_True the
+ size has to be specified with SetOutputSizePixel(). In other cases different
+ size-methods can be used. With CalcItemSize() the inner and outer size of
+ an item could be calculated (for this the free space defined by
+ SetExtraSpacing() will not be included).
+
+ The background color could be specified by SetColor(), with which the image
+ or UserDraw items will be underlayed. If no color is specified the color
+ of other windows (WindowColor) will be used for the background.
+
+ --------------------------------------------------------------------------
+
+ At first all items should be inserted and only then Show() should be called
+ since the output area will be precomputed. If this is not done the first
+ Paint will appear a little bit slower. Therefore the Control, if it is loaded
+ from the resource and only supplied with items during runtime, should be
+ loaded with Hide = sal_True and then displayed with Show().
+
+ In case of a visible Control the creation of the new output area could be
+ activated before Paint by calling Format().
+
+ --------------------------------------------------------------------------
+
+ If Drag and Drop will be called from the ValueSet the Command-Handler has to
+ be overloaded. From this StartDrag needs to be called. If this method returns
+ sal_True the drag-process could be initiated by ExecuteDrag(), otherwise no
+ processing will take place. This method makes sure that ValueSet stops its
+ processing and as appropriate selects the entry. Therefore the calling of
+ Select-Handler within this function must be expected.
+
+ For dropping QueryDrop() and Drop() need to be overloaded and ShowDropPos()
+ and HideDropPos() should be called within these methods.
+ To show the insertion point ShowDropPos() has to be called within the
+ QueryDrop-Handler. ShowDropPos() also scrolls the ValueSet if the passed
+ position is located at the window border. Furthermore ShowDropPos() returns
+ the position, at which the item should be inserted respectively which
+ insertion point was shown. If no insertion point was determined
+ VALUESET_ITEM_NOTFOUND will be returned. If the window was left during dragging
+ or the drag process is terminated HideDropPos() should be called in any case.
+
+ --------------------------------------------------------------------------
+
+ This class is currently still in the SV-Tools. That's why the ValueSet needs
+ to be loaded as a Control out of the resource and the desired WinBits have
+ to be set (before Show) with SetStyle().
+
+*************************************************************************/
+
+/* ThumbnailView types */
+
+#define THUMBNAILVIEW_APPEND ((sal_uInt16)-1)
+#define THUMBNAILVIEW_ITEM_NOTFOUND ((sal_uInt16)-1)
+
+// Display all the available items in the thumbnail.
+class ViewFilterAll
+{
+public:
+
+ bool operator () (const ThumbnailViewItem*) const
+ {
+ return true;
+ }
+};
+
+/**
+ *
+ * Class to display thumbnails with their names below their respective icons
+ *
+ **/
+
+class SFX2_DLLPUBLIC ThumbnailView : public Control
+{
+public:
+
+ ThumbnailView ( Window* pParent, WinBits nWinStyle = WB_TABSTOP, bool bDisableTransientChildren = false );
+
+ ThumbnailView ( Window* pParent, const ResId& rResId, bool bDisableTransientChildren = false );
+
+ virtual ~ThumbnailView ();
+
+ void AppendItem (ThumbnailViewItem *pItem);
+
+ void RemoveItem( sal_uInt16 nItemId );
+
+ void Clear();
+
+ // Change current thumbnail item list with new one (invalidates all pointers to a thumbnail item)
+ void updateItems(const std::vector<ThumbnailViewItem *> &items);
+
+ size_t GetItemPos( sal_uInt16 nItemId ) const;
+
+ sal_uInt16 GetItemId( size_t nPos ) const;
+
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+
+ sal_uInt16 getNextItemId () const;
+
+ long GetItemWidth() const { return mnItemWidth; }
+
+ long GetItemHeight() const { return mnItemHeight; }
+
+ void setItemMaxTextLength (sal_uInt32 nLength);
+
+ void setItemDimensions (long ItemWidth, long ThumbnailHeight,
+ long DisplayHeight, int itemPadding);
+
+ sal_uInt16 GetFirstLine() const { return mnFirstLine; }
+
+ void SelectItem( sal_uInt16 nItemId );
+
+ void DeselectItem( sal_uInt16 nItemId );
+
+ bool IsItemSelected( sal_uInt16 nItemId ) const;
+
+ /**
+ *
+ * @brief deselect all current selected items.
+ *
+ **/
+
+ void deselectItems ();
+
+ OUString GetItemText( sal_uInt16 nItemId ) const;
+
+ void SetColor( const Color& rColor );
+
+ void SetColor() { SetColor( Color( COL_TRANSPARENT ) ); }
+
+ Color GetColor() const { return maColor; }
+
+ bool IsColor() const { return maColor.GetTransparency() == 0; }
+
+ void filterItems (const boost::function<bool (const ThumbnailViewItem*) > &func);
+
+ void sortItems (const boost::function<bool (const ThumbnailViewItem*,
+ const ThumbnailViewItem*) > &func);
+
+ void setItemStateHdl (const Link &aLink) { maItemStateHdl = aLink; }
+
+ virtual void Resize();
+
+ virtual bool renameItem(ThumbnailViewItem* pItem, OUString sNewTitle);
+
+protected:
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+
+ virtual void Command( const CommandEvent& rCEvt );
+
+ virtual void Paint( const Rectangle& rRect );
+
+ virtual void GetFocus();
+
+ virtual void LoseFocus();
+
+ virtual void StateChanged( StateChangedType nStateChange );
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+protected:
+
+ // Drawing item related functions, override them to make your own custom ones.
+
+ virtual void DrawItem (ThumbnailViewItem *pItem);
+
+ virtual void OnItemDblClicked (ThumbnailViewItem *pItem);
+
+protected:
+
+ friend class ThumbnailViewAcc;
+ friend class ThumbnailViewItemAcc;
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+
+ void CalculateItemPositions ();
+ void MakeItemVisible( sal_uInt16 nId );
+
+ SFX2_DLLPRIVATE void ImplInit();
+ SFX2_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
+ SFX2_DLLPRIVATE void ImplInitScrollBar();
+ SFX2_DLLPRIVATE void ImplDeleteItems();
+ SFX2_DLLPRIVATE void ImplDraw();
+ SFX2_DLLPRIVATE size_t ImplGetItem( const Point& rPoint, bool bMove = false ) const;
+ SFX2_DLLPRIVATE ThumbnailViewItem* ImplGetItem( size_t nPos );
+ SFX2_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
+ SFX2_DLLPRIVATE ThumbnailViewItem* ImplGetVisibleItem( sal_uInt16 nVisiblePos );
+ SFX2_DLLPRIVATE void ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue );
+ SFX2_DLLPRIVATE bool ImplHasAccessibleListeners();
+ DECL_DLLPRIVATE_LINK( ImplScrollHdl, ScrollBar* );
+
+ DECL_LINK(OnItemSelected, ThumbnailViewItem*);
+
+protected:
+
+ ValueItemList mItemList;
+ ValueItemList mFilteredItemList; ///< Cache to store the filtered items
+ ValueItemList::iterator mpStartSelRange;
+ ScrollBar* mpScrBar;
+ Rectangle maItemListRect;
+ long mnHeaderHeight;
+ long mnItemWidth;
+ long mnItemHeight;
+ long mnItemPadding;
+ long mnThumbnailHeight; // Maximum height of the thumbnail
+ long mnDisplayHeight; // Height of the data display box (name, etc)
+ long mnVisLines;
+ long mnLines;
+ sal_uInt16 mnHighItemId;
+ sal_uInt16 mnCols;
+ sal_uInt16 mnFirstLine;
+ sal_uInt16 mnSpacing;
+ bool mbScroll : 1;
+ bool mbIsTransientChildrenDisabled : 1;
+ bool mbHasVisibleItems : 1;
+ Color maColor;
+
+ Link maItemStateHdl;
+ ThumbnailItemAttributes *mpItemAttrs;
+ drawinglayer::processor2d::BaseProcessor2D *mpProcessor;
+ boost::function<bool (const ThumbnailViewItem*) > maFilterFunc;
+};
+
+#endif // THUMBNAILVIEW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx
new file mode 100644
index 000000000000..64a20cda910f
--- /dev/null
+++ b/include/sfx2/thumbnailviewitem.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 THUMBNAILVIEWITEM_HXX
+#define THUMBNAILVIEWITEM_HXX
+
+#include <basegfx/vector/b2dvector.hxx>
+#include <drawinglayer/attribute/fontattribute.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <osl/mutex.hxx>
+#include <vcl/bitmapex.hxx>
+#include <vcl/vclmedit.hxx>
+#include "sfx2/dllapi.h"
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+
+#define THUMBNAILVIEW_ITEM_NONEITEM 0xFFFE
+
+class CheckBox;
+class Font;
+class Window;
+class ThumbnailView;
+
+namespace basegfx {
+ class B2DPolygon;
+}
+
+namespace drawinglayer {
+ namespace processor2d {
+ class BaseProcessor2D;
+ }
+
+ namespace primitive2d {
+ class PolygonHairlinePrimitive2D;
+ }
+}
+
+struct ThumbnailItemAttributes
+{
+ sal_uInt32 nMaxTextLenght;
+ basegfx::BColor aFillColor;
+ basegfx::BColor aHighlightColor;
+ basegfx::B2DVector aFontSize;
+ drawinglayer::attribute::FontAttribute aFontAttr;
+};
+
+class SFX2_DLLPUBLIC ThumbnailViewItem
+{
+public:
+
+ ThumbnailView &mrParent;
+ sal_uInt16 mnId;
+ bool mbVisible;
+ bool mbSelected;
+ bool mbHover;
+ BitmapEx maPreview1;
+ OUString maTitle;
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >* mpxAcc;
+
+ ThumbnailViewItem (ThumbnailView &rView);
+
+ virtual ~ThumbnailViewItem ();
+
+ bool isVisible () const { return mbVisible; }
+
+ void show (bool bVisible);
+
+ bool isSelected () const { return mbSelected; }
+
+ void setSelection (bool state);
+
+ bool isHighlighted () const { return mbHover; }
+
+ void setHighlight (bool state);
+
+ void setEditTitle (bool edit, bool bChangeFocus = true);
+ void updateTitleEditSize ();
+ virtual void setTitle (const OUString& rTitle);
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetAccessible( bool bIsTransientChildrenDisabled );
+
+ void setDrawArea (const Rectangle &area);
+
+ const Rectangle& getDrawArea () const { return maDrawArea; }
+ Rectangle getTextArea () const;
+
+ virtual void calculateItemsPosition (const long nThumbnailHeight, const long nDisplayHeight,
+ const long nPadding, sal_uInt32 nMaxTextLenght,
+ const ThumbnailItemAttributes *pAttrs);
+
+ const Point& getTextPos () const { return maTextPos; }
+
+ const Point& getPrev1Pos () const { return maPrev1Pos; }
+
+ void setSelectClickHdl (const Link &link);
+
+ virtual void Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor,
+ const ThumbnailItemAttributes *pAttrs);
+ void addTextPrimitives (const OUString& rText, const ThumbnailItemAttributes *pAttrs, Point aPos, drawinglayer::primitive2d::Primitive2DSequence& rSeq);
+
+ static drawinglayer::primitive2d::PolygonHairlinePrimitive2D*
+ createBorderLine (const basegfx::B2DPolygon &rPolygon);
+
+protected:
+
+ Point maTextPos;
+ Point maPrev1Pos;
+ Rectangle maDrawArea;
+ Link maClickHdl;
+ bool mbEditTitle;
+ VclMultiLineEdit* mpTitleED;
+ Rectangle maTextEditMaxArea;
+};
+
+#endif // THUMBNAILVIEWITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/titledockwin.hxx b/include/sfx2/titledockwin.hxx
new file mode 100644
index 000000000000..09b500caa6bc
--- /dev/null
+++ b/include/sfx2/titledockwin.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 SFX_TITLEDOCKWIN_HXX
+#define SFX_TITLEDOCKWIN_HXX
+
+#include "sfx2/dllapi.h"
+#include "sfx2/dockwin.hxx"
+
+#include <vcl/toolbox.hxx>
+#include <tools/svborder.hxx>
+
+//......................................................................................................................
+namespace sfx2
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= TitledDockingWindow
+ //==================================================================================================================
+ class SFX2_DLLPUBLIC TitledDockingWindow : public SfxDockingWindow
+ {
+ public:
+ TitledDockingWindow(
+ SfxBindings* i_pBindings, SfxChildWindow* i_pChildWindow,
+ Window* i_pParent, WinBits i_nStyle = 0
+ );
+
+ TitledDockingWindow( SfxBindings* i_pBindings, SfxChildWindow* i_pChildWindow,
+ Window* i_pParent, const ResId& i_rResId
+ );
+
+ virtual ~TitledDockingWindow();
+
+ /** sets a title to be displayed in the docking window
+ */
+ void SetTitle( const String& i_rTitle );
+
+ /** adds a drop down item to the toolbox. Usually, this is used to add some kind of menu to the toolbox.
+
+ @param i_rItemText
+ the text to display for the item
+ @param i_nHelpId
+ the help ID for the new toolbox item
+ @param i_rCallback
+ the callback to invoke when the drop item has been clicked
+ @return
+ the ID of the newly created toolbox item
+ */
+ sal_uInt16 AddDropDownToolBoxItem( const String& i_rItemText, const OString& i_nHelpId, const Link& i_rCallback )
+ {
+ return impl_addDropDownToolBoxItem( i_rItemText, i_nHelpId, i_rCallback );
+ }
+
+ void SetEndDockingHdl( const Link& i_rEndDockingHdl ) { m_aEndDockingHdl = i_rEndDockingHdl; }
+ const Link& GetEndDockingHdl() const { return m_aEndDockingHdl; }
+
+ /** resets the toolbox. Upon return, the only item in the toolbox is the closer.
+ */
+ void ResetToolBox()
+ {
+ impl_resetToolBox();
+ }
+
+ /** returns the content window, which is to be used as parent window for any content to be displayed
+ in the docking window.
+ */
+ ::Window& GetContentWindow() { return m_aContentWindow; }
+ const ::Window& GetContentWindow() const { return m_aContentWindow; }
+
+ ToolBox& GetToolBox() { return m_aToolbox; }
+ const ToolBox& GetToolBox() const { return m_aToolbox; }
+
+ /** Return the border that is painted around the inner window as
+ decoration.
+ */
+ SvBorder GetDecorationBorder (void) const { return m_aBorder; }
+
+ protected:
+ // Window overridables
+ virtual void Paint( const Rectangle& i_rArea );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType i_nType );
+ virtual void DataChanged( const DataChangedEvent& i_rDataChangedEvent );
+ virtual void SetText( const OUString& i_rText );
+
+ // DockingWindow overridables
+ void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
+
+ // own overridables
+ virtual void onLayoutDone();
+
+ protected:
+ /** internal version of ResetToolBox
+ */
+ void impl_resetToolBox();
+
+ /** internal version of AddDropDownToolBoxItem
+ */
+ sal_uInt16 impl_addDropDownToolBoxItem( const String& i_rItemText, const OString& i_nHelpId, const Link& i_rCallback );
+
+ /** returns the current title.
+
+ If no title has been set via SetTitle, then the window text (Window::GetText) is returned.
+ */
+ String impl_getTitle() const;
+
+ private:
+ DECL_LINK( OnToolboxItemSelected, ToolBox* );
+
+ void impl_construct();
+ void impl_layout();
+ void impl_scheduleLayout();
+
+ private:
+ OUString m_sTitle;
+ ToolBox m_aToolbox;
+ Window m_aContentWindow;
+
+ Link m_aEndDockingHdl;
+
+ /** The border that is painted arround the inner window. The bevel
+ shadow lines are part of the border, so where the border is 0 no
+ such line is painted.
+ */
+ SvBorder m_aBorder;
+
+ /** Remember that a layout is pending, i.e. Resize() has been called
+ since the last Paint().
+ */
+ bool m_bLayoutPending;
+
+ /** Height of the title bar. Calculated in impl_layout().
+ */
+ int m_nTitleBarHeight;
+
+ };
+
+//......................................................................................................................
+} // namespace sfx2
+//......................................................................................................................
+
+#endif // SFX_TITLEDOCKWIN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/tplpitem.hxx b/include/sfx2/tplpitem.hxx
new file mode 100644
index 000000000000..58f0618443ae
--- /dev/null
+++ b/include/sfx2/tplpitem.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 _SFX_TPLPITEM_HXX
+#define _SFX_TPLPITEM_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <tools/string.hxx>
+#include <tools/rtti.hxx>
+#include <svl/flagitem.hxx>
+#include <svl/style.hrc>
+
+class SFX2_DLLPUBLIC SfxTemplateItem: public SfxFlagItem
+{
+ String aStyle;
+public:
+ TYPEINFO();
+ SfxTemplateItem();
+ SfxTemplateItem( sal_uInt16 nWhich,
+ const String &rStyle,
+ sal_uInt16 nMask = SFXSTYLEBIT_ALL );
+ SfxTemplateItem( const SfxTemplateItem& );
+
+ const String& GetStyleName() const { return aStyle; }
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual sal_uInt8 GetFlagCount() const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/unoctitm.hxx b/include/sfx2/unoctitm.hxx
new file mode 100644
index 000000000000..d1d41b8ae689
--- /dev/null
+++ b/include/sfx2/unoctitm.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 _SFX_UNOCTITM_HXX
+#define _SFX_UNOCTITM_HXX
+
+#include <functional>
+#include <com/sun/star/frame/XNotifyingDispatch.hpp>
+#include <com/sun/star/frame/XDispatchResultListener.hpp>
+#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
+#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#include <com/sun/star/frame/DispatchDescriptor.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+
+#include <sfx2/sfxuno.hxx>
+#include <sfx2/ctrlitem.hxx>
+#include <osl/mutex.hxx>
+
+class SfxBindings;
+class SfxFrame;
+class SfxDispatcher;
+
+class SfxUnoControllerItem : public ::com::sun::star::frame::XStatusListener ,
+ public ::com::sun::star::lang::XTypeProvider ,
+ public ::cppu::OWeakObject
+{
+ ::com::sun::star::util::URL aCommand;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
+ SfxControllerItem* pCtrlItem;
+ SfxBindings* pBindings;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > TryGetDispatch( SfxFrame* pFrame );
+
+public:
+ SFX_DECL_XINTERFACE_XTYPEPROVIDER
+
+
+ SfxUnoControllerItem( SfxControllerItem*, SfxBindings&, const String& );
+ ~SfxUnoControllerItem();
+
+ const ::com::sun::star::util::URL& GetCommand() const
+ { return aCommand; }
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged(const ::com::sun::star::frame::FeatureStateEvent& Event) throw( ::com::sun::star::uno::RuntimeException );
+
+ // Something else
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException );
+ void UnBind();
+ void GetNewDispatch();
+ void ReleaseDispatch();
+ void ReleaseBindings();
+};
+
+struct SfxStatusDispatcher_Impl_hashType
+{
+ size_t operator()(const OUString& s) const
+ { return s.hashCode(); }
+};
+
+typedef ::cppu::OMultiTypeInterfaceContainerHelperVar< OUString, SfxStatusDispatcher_Impl_hashType, std::equal_to< OUString > > SfxStatusDispatcher_Impl_ListenerContainer ;
+
+class SfxStatusDispatcher : public ::com::sun::star::frame::XNotifyingDispatch,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::cppu::OWeakObject
+{
+ ::osl::Mutex aMutex;
+ SfxStatusDispatcher_Impl_ListenerContainer aListeners;
+
+public:
+ SFX_DECL_XINTERFACE_XTYPEPROVIDER
+
+ SfxStatusDispatcher();
+
+ // XDispatch
+ virtual void SAL_CALL dispatchWithNotification( const ::com::sun::star::util::URL& aURL,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& rListener ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL removeStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw( ::com::sun::star::uno::RuntimeException );
+
+ // Something else
+ void ReleaseAll();
+ SfxStatusDispatcher_Impl_ListenerContainer& GetListeners()
+ { return aListeners; }
+};
+
+class SfxSlotServer;
+class SfxDispatchController_Impl;
+class SfxOfficeDispatch : public SfxStatusDispatcher
+ , public ::com::sun::star::lang::XUnoTunnel
+{
+friend class SfxDispatchController_Impl;
+ SfxDispatchController_Impl* pControllerItem;
+public:
+ SfxOfficeDispatch( SfxBindings& rBind,
+ SfxDispatcher* pDispat,
+ const SfxSlot* pSlot,
+ const ::com::sun::star::util::URL& rURL );
+ SfxOfficeDispatch( SfxDispatcher* pDispat,
+ const SfxSlot* pSlot,
+ const ::com::sun::star::util::URL& rURL );
+ ~SfxOfficeDispatch();
+
+ SFX_DECL_XINTERFACE_XTYPEPROVIDER
+
+ virtual void SAL_CALL dispatchWithNotification( const ::com::sun::star::util::URL& aURL,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& rListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs )
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL addStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl,
+ const ::com::sun::star::util::URL& aURL)
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ // XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException) ;
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& impl_getStaticIdentifier();
+
+ static sal_Bool IsMasterUnoCommand( const ::com::sun::star::util::URL& aURL );
+ static OUString GetMasterUnoCommand( const ::com::sun::star::util::URL& aURL );
+
+ void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
+
+ void SetMasterUnoCommand( sal_Bool bSet );
+
+ SfxDispatcher* GetDispatcher_Impl();
+};
+
+class SfxDispatchController_Impl : public SfxControllerItem
+{
+ ::com::sun::star::util::URL aDispatchURL;
+ SfxDispatcher* pDispatcher;
+ SfxBindings* pBindings;
+ const SfxPoolItem* pLastState;
+ sal_uInt16 nSlot;
+ SfxOfficeDispatch* pDispatch;
+ sal_Bool bMasterSlave;
+ sal_Bool bVisible;
+ const char* pUnoName;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XFrame > xFrame;
+
+ void addParametersToArgs( const com::sun::star::util::URL& aURL,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs ) const;
+ SfxMapUnit GetCoreMetric( SfxItemPool& rPool, sal_uInt16 nSlot );
+
+public:
+ SfxDispatchController_Impl( SfxOfficeDispatch* pDisp,
+ SfxBindings* pBind,
+ SfxDispatcher* pDispat,
+ const SfxSlot* pSlot,
+ const ::com::sun::star::util::URL& rURL );
+ ~SfxDispatchController_Impl();
+
+ static OUString getSlaveCommand( const ::com::sun::star::util::URL& rURL );
+
+ void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState, SfxSlotServer* pServ );
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+ void setMasterSlaveCommand( sal_Bool bSet );
+ void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& rListener ) throw( ::com::sun::star::uno::RuntimeException );
+ void SAL_CALL addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw( ::com::sun::star::uno::RuntimeException );
+ void UnBindController();
+ SfxDispatcher* GetDispatcher();
+ void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/userinputinterception.hxx b/include/sfx2/userinputinterception.hxx
new file mode 100644
index 000000000000..7350314b4835
--- /dev/null
+++ b/include/sfx2/userinputinterception.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 USERINPUTINTERCEPTION_HXX
+#define USERINPUTINTERCEPTION_HXX
+
+#include "sfx2/dllapi.h"
+
+#include <com/sun/star/awt/XUserInputInterception.hpp>
+
+#include <boost/noncopyable.hpp>
+#include <memory>
+
+class NotifyEvent;
+
+namespace cppu { class OWeakObject; }
+
+//........................................................................
+namespace sfx2
+{
+//........................................................................
+
+ //====================================================================
+ //= UserInputInterception
+ //====================================================================
+ struct UserInputInterception_Data;
+ /** helper class for implementing the XUserInputInterception interface
+ for a controller implementation
+ */
+ class SFX2_DLLPUBLIC UserInputInterception : public ::boost::noncopyable
+ {
+ public:
+ UserInputInterception( ::cppu::OWeakObject& _rControllerImpl, ::osl::Mutex& _rMutex );
+ ~UserInputInterception();
+
+ // delegator functions for your XUserInputInterception implementation
+ void addKeyHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException);
+ void removeKeyHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException);
+ void addMouseClickHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseClickHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException);
+ void removeMouseClickHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseClickHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException);
+
+ // state
+ bool hasKeyHandlers() const;
+ bool hasMouseClickListeners() const;
+
+ // forwarding a NotifyEvent to the KeyListeners respectively MouseClickListeners
+ bool handleNotifyEvent( const NotifyEvent& _rEvent );
+
+ private:
+ ::std::auto_ptr< UserInputInterception_Data > m_pData;
+ };
+
+//........................................................................
+} // namespace sfx2
+//........................................................................
+
+#endif // USERINPUTINTERCEPTION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/viewfac.hxx b/include/sfx2/viewfac.hxx
new file mode 100644
index 000000000000..3348cb69d199
--- /dev/null
+++ b/include/sfx2/viewfac.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 _VIEWFAC_HXX
+#define _VIEWFAC_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include <tools/string.hxx>
+#include <tools/resid.hxx>
+
+class SfxViewFrame;
+class SfxViewShell;
+class Window;
+
+typedef SfxViewShell* (*SfxViewCtor)(SfxViewFrame*, SfxViewShell*);
+
+// CLASS -----------------------------------------------------------------
+class SFX2_DLLPUBLIC SfxViewFactory
+{
+public:
+ SfxViewFactory( SfxViewCtor fnC,
+ sal_uInt16 nOrdinal, const sal_Char* asciiViewName );
+
+ SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh);
+ sal_uInt16 GetOrdinal() const { return nOrd; }
+
+ /// returns a legacy view name. This is "view" with an appended ordinal/ID.
+ String GetLegacyViewName() const;
+
+ /** returns a API-compatible view name.
+
+ For details on which view names are specified, see the XModel2.getAvailableViewControllerNames
+ documentation.
+ */
+ String GetAPIViewName() const;
+
+private:
+ SfxViewCtor fnCreate;
+ sal_uInt16 nOrd;
+ const String m_sViewName;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
new file mode 100644
index 000000000000..522b4719eac0
--- /dev/null
+++ b/include/sfx2/viewfrm.hxx
@@ -0,0 +1,335 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXVIEWFRM_HXX
+#define _SFXVIEWFRM_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <svl/lstner.hxx>
+#include <sfx2/module.hxx>
+#include <sfx2/frame.hxx>
+#include <sfx2/shell.hxx>
+#include <sfx2/sfxsids.hrc>
+#include <svl/poolitem.hxx>
+#include <vcl/button.hxx>
+#include <com/sun/star/frame/status/Verb.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XController2.hpp>
+
+#include <tools/svborder.hxx>
+
+class SvBorder;
+class SfxDispatcher;
+class SfxObjectShell;
+class SfxBindings;
+class SfxProgress;
+class SvData;
+class SfxViewShell;
+class SystemWindow;
+class Fraction;
+class Point;
+class Size;
+class SfxChildWindow;
+
+namespace sfx2
+{
+class SvLinkSource;
+}
+namespace svtools
+{
+ class AsynchronLink;
+}
+
+#ifndef SFX_DECL_OBJECTSHELL_DEFINED
+#define SFX_DECL_OBJECTSHELL_DEFINED
+SV_DECL_REF(SfxObjectShell)
+#endif
+
+//========================================================================
+DBG_NAMEEX(SfxViewFrame)
+class SFX2_DLLPUBLIC SfxViewFrame: public SfxShell, public SfxListener
+{
+ struct SfxViewFrame_Impl* pImp;
+
+ SfxObjectShellRef xObjSh;
+ SfxDispatcher* pDispatcher;
+ SfxBindings* pBindings;
+ sal_uInt16 nAdjustPosPixelLock;
+
+private:
+#ifndef _SFX_HXX
+ SAL_DLLPRIVATE void Construct_Impl( SfxObjectShell *pObjSh=NULL );
+#endif
+
+protected:
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+#ifndef _SFX_HXX
+ SAL_DLLPRIVATE void KillDispatcher_Impl();
+#endif
+
+ virtual ~SfxViewFrame();
+
+public:
+ SfxViewFrame( SfxFrame& rFrame, SfxObjectShell *pDoc = NULL );
+
+ TYPEINFO();
+ SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWFRM)
+
+ static void SetViewFrame( SfxViewFrame* );
+
+ static SfxViewFrame* LoadHiddenDocument( SfxObjectShell& i_rDoc, const sal_uInt16 i_nViewId );
+ static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const sal_uInt16 i_nViewId );
+ static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const sal_uInt16 i_nViewId = 0 );
+ static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrameItem, const sal_uInt16 i_nViewId = 0 );
+ static SfxViewFrame* DisplayNewDocument( SfxObjectShell& i_rDoc, const SfxRequest& i_rCreateDocRequest, const sal_uInt16 i_nViewId = 0 );
+
+ static SfxViewFrame* Current();
+ static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = 0, sal_Bool bOnlyVisible = sal_True );
+ static SfxViewFrame* GetNext( const SfxViewFrame& rPrev, const SfxObjectShell* pDoc = 0, sal_Bool bOnlyVisible = sal_True );
+
+ static SfxViewFrame* Get( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController>& i_rController, const SfxObjectShell* i_pDoc = NULL );
+
+ void DoActivate(sal_Bool bMDI, SfxViewFrame *pOld=NULL);
+ void DoDeactivate(sal_Bool bMDI, SfxViewFrame *pOld=NULL);
+
+ SfxViewFrame* GetParentViewFrame() const;
+
+ using SfxShell::GetDispatcher;
+ SfxDispatcher* GetDispatcher() { return pDispatcher; }
+ SfxBindings& GetBindings() { return *pBindings; }
+ const SfxBindings& GetBindings() const { return *pBindings; }
+ Window& GetWindow() const;
+ virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY );
+
+ SfxProgress* GetProgress() const;
+
+ SfxObjectShell* GetObjectShell() const
+ { return xObjSh; }
+
+ void LockAdjustPosSizePixel()
+ { nAdjustPosPixelLock++; }
+ void UnlockAdjustPosSizePixel()
+ { nAdjustPosPixelLock--; }
+ void DoAdjustPosSizePixel( SfxViewShell * pSh,
+ const Point &rPos, const Size &rSize );
+ void Show();
+ sal_Bool IsVisible() const;
+ void ToTop();
+ void Enable( sal_Bool bEnable );
+ virtual sal_Bool Close();
+ virtual void Activate( sal_Bool bUI );
+ virtual void Deactivate( sal_Bool bUI );
+
+ // DDE-Interface
+ virtual long DdeExecute( const String& rCmd );
+ virtual long DdeGetData( const String& rItem,
+ const String& rMimeType,
+ ::com::sun::star::uno::Any & rValue );
+ virtual long DdeSetData( const String& rItem,
+ const String& rMimeType,
+ const ::com::sun::star::uno::Any & rValue );
+ virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem );
+
+ void UpdateTitle();
+
+ static void ActivateToolPanel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const OUString& i_rPanelURL );
+
+ // interne Handler
+ SAL_DLLPRIVATE virtual sal_Bool SetBorderPixelImpl( const SfxViewShell *pSh, const SvBorder &rBorder );
+ SAL_DLLPRIVATE virtual const SvBorder& GetBorderPixelImpl( const SfxViewShell *pSh ) const;
+ SAL_DLLPRIVATE virtual void InvalidateBorderImpl( const SfxViewShell *pSh );
+
+ virtual SfxObjectShell* GetObjectShell();
+ sal_uInt16 GetCurViewId() const;
+ SfxFrame& GetFrame() const;
+ SfxViewFrame* GetTopViewFrame() const;
+
+ sal_Bool DoClose();
+ sal_uIntPtr GetFrameType() const
+ { return GetFrame().GetFrameType(); }
+ SfxFrame& GetTopFrame() const
+ { return GetFrame().GetTopFrame(); }
+ void GetTargetList( TargetList& rList ) const
+ { GetFrame().GetTargetList( rList ); }
+ void CancelTransfers()
+ { GetFrame().CancelTransfers(); }
+
+ void SetModalMode( sal_Bool );
+ sal_Bool IsInModalMode() const;
+ void Resize(sal_Bool bForce=sal_False);
+
+ void SetChildWindow(sal_uInt16 nId, sal_Bool bVisible, sal_Bool bSetFocus=sal_True);
+ void ToggleChildWindow(sal_uInt16);
+ sal_Bool HasChildWindow(sal_uInt16);
+ sal_Bool KnowsChildWindow(sal_uInt16);
+ void ShowChildWindow(sal_uInt16,sal_Bool bVisible=sal_True);
+ SfxChildWindow* GetChildWindow(sal_uInt16);
+ void ChildWindowExecute(SfxRequest&);
+ void ChildWindowState(SfxItemSet&);
+
+ /** Append a new InfoBar (see https://wiki.documentfoundation.org/Design/Whiteboards/Infobar).
+
+ The buttons will be added from Right to Left at the right of the info bar. The parent, size
+ and position of each button will be changed: only the width will remain unchanged.
+ */
+ void AppendInfoBar( const OUString& sId, const OUString& sMessage, std::vector< PushButton* > aButtons );
+ void RemoveInfoBar( const OUString& sId );
+
+ SAL_DLLPRIVATE void SetDowning_Impl();
+ SAL_DLLPRIVATE void GetDocNumber_Impl();
+ SAL_DLLPRIVATE sal_Bool IsDowning_Impl() const;
+ SAL_DLLPRIVATE void SetViewShell_Impl( SfxViewShell *pVSh );
+ SAL_DLLPRIVATE void ReleaseObjectShell_Impl();
+
+ SAL_DLLPRIVATE void GetState_Impl( SfxItemSet &rSet );
+ SAL_DLLPRIVATE void ExecReload_Impl( SfxRequest &rReq );
+ SAL_DLLPRIVATE void StateReload_Impl( SfxItemSet &rSet );
+ SAL_DLLPRIVATE void ExecView_Impl( SfxRequest &rReq );
+ SAL_DLLPRIVATE void StateView_Impl( SfxItemSet &rSet );
+ SAL_DLLPRIVATE void ExecHistory_Impl( SfxRequest &rReq );
+ SAL_DLLPRIVATE void StateHistory_Impl( SfxItemSet &rSet );
+ SAL_DLLPRIVATE SfxViewFrame* GetParentViewFrame_Impl() const;
+ SAL_DLLPRIVATE void ForceOuterResize_Impl(sal_Bool bOn=sal_True);
+ SAL_DLLPRIVATE sal_Bool IsResizeInToOut_Impl() const;
+ SAL_DLLPRIVATE sal_Bool IsAdjustPosSizePixelLocked_Impl() const
+ { return nAdjustPosPixelLock != 0; }
+ SAL_DLLPRIVATE void UpdateDocument_Impl();
+
+ SAL_DLLPRIVATE void LockObjectShell_Impl(sal_Bool bLock=sal_True);
+
+ SAL_DLLPRIVATE void MakeActive_Impl( sal_Bool bActivate );
+ SAL_DLLPRIVATE void SetQuietMode_Impl( sal_Bool );
+ SAL_DLLPRIVATE const Size& GetMargin_Impl() const;
+ SAL_DLLPRIVATE void SetActiveChildFrame_Impl( SfxViewFrame* );
+ SAL_DLLPRIVATE SfxViewFrame* GetActiveChildFrame_Impl() const;
+ SAL_DLLPRIVATE String GetActualPresentationURL_Impl() const;
+ SAL_DLLPRIVATE void MiscExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void MiscState_Impl(SfxItemSet &);
+ SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl( sal_uInt16 nId );
+ SAL_DLLPRIVATE void AddDispatchMacroToBasic_Impl(const OUString& sMacro);
+
+ SAL_DLLPRIVATE void Exec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void INetExecute_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &);
+
+ SAL_DLLPRIVATE void SetCurViewId_Impl( const sal_uInt16 i_nID );
+ SAL_DLLPRIVATE void ActivateToolPanel_Impl( const OUString& i_rPanelURL );
+
+private:
+ SAL_DLLPRIVATE sal_Bool SwitchToViewShell_Impl( sal_uInt16 nNo, sal_Bool bIsIndex = sal_False );
+ SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell );
+ SAL_DLLPRIVATE void SaveCurrentViewData_Impl( const sal_uInt16 i_nNewViewId );
+
+ /** loads the given existing document into the given frame
+
+ This is done using the XComponentLoader interface of the frame, so the SFX document loader is invoked.
+
+ @param i_rDoc
+ the document to load
+ @param i_rFrame
+ the frame to load the document into
+ @param i_rLoadArgs
+ the arguments to pass to the component loader. If this sequence is empty, then the current arguments of the
+ model will be obtained, and passed to the loader. This ensures that any arguments in the model will be preserved,
+ instead of being reset.
+ @param i_nViewId
+ the ID of the view to create
+ @throws Exception
+ if something goes wrong. The caller is responsible for handling this.
+ */
+ SAL_DLLPRIVATE static SfxViewShell* LoadViewIntoFrame_Impl(
+ const SfxObjectShell& i_rDoc,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rLoadArgs,
+ const sal_uInt16 i_nViewId,
+ const bool i_bHidden
+ );
+
+ /** loads the given existing document into the given frame
+
+ This is done using the XComponentLoader interface of the frame, so the SFX document loader is invoked.
+
+ If no frame is given, a blank top level frame is created.
+
+ If anything fails during the process, as much as possible is cleaned up.
+
+ @param i_rDoc
+ the document to load
+ @param i_rFrame
+ the frame to load the document into. Might be <NULL/>, in which case a new frame is created.
+ @param i_nViewId
+ the ID of the view to create
+ */
+ SAL_DLLPRIVATE static SfxViewFrame* LoadViewIntoFrame_Impl_NoThrow(
+ const SfxObjectShell& i_rDoc,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame,
+ const sal_uInt16 i_nViewId,
+ const bool i_bHidden
+ );
+};
+
+//--------------------------------------------------------------------
+
+class SFX2_DLLPUBLIC SfxViewFrameItem: public SfxPoolItem
+{
+ SfxViewFrame* pFrame;
+
+public:
+ TYPEINFO();
+ SfxViewFrameItem( SfxViewFrame *pViewFrame ):
+ SfxPoolItem( 0 ),
+ pFrame( pViewFrame)
+ {}
+ SfxViewFrameItem( sal_uInt16 nWhichId, SfxViewFrame *pViewFrame ):
+ SfxPoolItem( nWhichId ),
+ pFrame( pViewFrame)
+ {}
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual String GetValueText() const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+ SfxViewFrame* GetFrame() const
+ { return pFrame; }
+};
+
+class SfxVerbListItem : public SfxPoolItem
+{
+ com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor > aVerbs;
+
+public:
+ TYPEINFO();
+ SfxVerbListItem( sal_uInt16 nWhichId = SID_OBJECT ) :
+ SfxPoolItem( nWhichId )
+ {}
+
+ SfxVerbListItem( sal_uInt16 nWhichId, const com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor >& );
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ const com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor >& GetVerbList() const { return aVerbs; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
new file mode 100644
index 000000000000..ad4c64cd5272
--- /dev/null
+++ b/include/sfx2/viewsh.hxx
@@ -0,0 +1,343 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXVIEWSH_HXX
+#define _SFXVIEWSH_HXX
+
+#include "sal/config.h"
+#include "sfx2/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/view/XRenderable.hpp>
+#include <com/sun/star/uno/Reference.h>
+#include <svl/lstner.hxx>
+#include <com/sun/star/ui/XContextMenuInterceptor.hpp>
+#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
+#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
+#include <cppuhelper/interfacecontainer.hxx>
+#include "shell.hxx"
+#include <tools/gen.hxx>
+#include <tools/errcode.hxx>
+#include <vcl/jobset.hxx>
+#include <vector>
+
+class SfxBaseController;
+class Size;
+class Fraction;
+class Window;
+class KeyEvent;
+class WorkWindow;
+class SvBorder;
+class SdrView;
+class SfxFrame;
+class SfxMedium;
+class SfxModule;
+class SfxViewFrame;
+class SfxItemPool;
+class SfxTabPage;
+class SfxFrameSetDescriptor;
+class Printer;
+class SfxPrinter;
+class SfxProgress;
+class SfxFrameItem;
+class Dialog;
+class Menu;
+class NotifyEvent;
+
+#define SFX_PRINTER_PRINTER 1 // without JOB SETUP => Temporary
+#define SFX_PRINTER_JOBSETUP 2
+#define SFX_PRINTER_OPTIONS 4
+#define SFX_PRINTER_CHG_ORIENTATION 8
+#define SFX_PRINTER_CHG_SIZE 16
+#define SFX_PRINTER_ALL 31
+
+#define SFX_PRINTER_CHG_ORIENTATION_FLAG 3
+#define SFX_PRINTER_CHG_SIZE_FLAG 4
+
+#define SFX_PRINTERROR_NONE 0
+#define SFX_PRINTERROR_BUSY 1
+
+// "Verified" using www.apple.com and Netscape 3.01
+#define DEFAULT_MARGIN_WIDTH 8
+#define DEFAULT_MARGIN_HEIGHT 12
+
+//========================================================================
+
+// @[SfxViewShell-Flags]
+
+#define SFX_VIEW_HAS_PRINTOPTIONS 0x0010 /* Options-Button and Options-
+ Dialog in PrintDialog */
+#define SFX_VIEW_CAN_PRINT 0x0020 /* Printing enabled without having
+ to create a Printer */
+#define SFX_VIEW_NO_SHOW 0x0040 /* Window of the ViewShell shall
+ not be showed automatically */
+#define SFX_VIEW_NO_NEWWINDOW 0x0100 /* Allow N View */
+
+/* [Description]
+
+ The SfxViewShell flags control the behavior of SfxViewShell for the
+ duration of its lifetime. They are defined in the constructor of
+ <SfxViewShell>.
+*/
+
+//=========================================================================
+
+#define SFX_DECL_VIEWFACTORY(Class) \
+private: \
+ static SfxViewFactory *pFactory; \
+public: \
+ static SfxViewShell *CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView); \
+ static void RegisterFactory( sal_uInt16 nPrio = USHRT_MAX ); \
+ static SfxViewFactory&Factory() { return *pFactory; } \
+ static void InitFactory()
+
+#define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \
+ SfxViewFactory* Class::pFactory; \
+ SfxViewShell* Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \
+ { return new Class(pFrame, pOldView); } \
+ void Class::RegisterFactory( sal_uInt16 nPrio ) \
+ { \
+ pFactory = new SfxViewFactory(&CreateInstance,nPrio,AsciiViewName);\
+ InitFactory(); \
+ } \
+ void Class::InitFactory()
+
+#define SFX_VIEW_REGISTRATION(DocClass) \
+ DocClass::Factory().RegisterViewFactory( Factory() )
+
+class SfxInPlaceClient;
+typedef ::std::vector< SfxInPlaceClient* > SfxInPlaceClientList;
+
+// -----------------------------------------------------------------------
+class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener
+{
+#ifdef _SFXVIEWSH_HXX
+friend class SfxViewFrame;
+friend class SfxBaseController;
+friend class SfxPrinterController;
+#endif
+
+ struct SfxViewShell_Impl* pImp;
+ SfxInPlaceClientList* pIPClientList;
+ SfxViewFrame* pFrame;
+ SfxShell* pSubShell;
+ Window* pWindow;
+ sal_Bool bNoNewWindow;
+
+protected:
+ virtual void Activate(sal_Bool IsMDIActivate);
+ virtual void Deactivate(sal_Bool IsMDIActivate);
+
+ virtual void InnerResizePixel( const Point &rOfs, const Size &rSize );
+ virtual void OuterResizePixel( const Point &rOfs, const Size &rSize );
+ virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY );
+
+ virtual void Move();
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+public:
+ // Iteration
+ static SfxViewShell* GetFirst( const TypeId* pType = 0, sal_Bool bOnlyVisible = sal_True );
+ static SfxViewShell* GetNext( const SfxViewShell& rPrev,
+ const TypeId* pType = 0, sal_Bool bOnlyVisible = sal_True );
+ static SfxViewShell* Current();
+
+ static SfxViewShell* Get( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController>& i_rController );
+
+ // Initialize Constructors/Destructors
+ TYPEINFO();
+ SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWSH)
+
+ SfxViewShell( SfxViewFrame *pFrame, sal_uInt16 nFlags = 0 );
+ virtual ~SfxViewShell();
+
+ SfxInPlaceClient* GetIPClient() const;
+ SfxInPlaceClient* GetUIActiveClient() const;
+ SfxInPlaceClient* FindIPClient( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, Window *pObjParentWin ) const;
+
+ virtual ErrCode DoVerb(long nVerb);
+
+ virtual void OutplaceActivated( sal_Bool bActive, SfxInPlaceClient* pClient );
+ virtual void InplaceActivating( SfxInPlaceClient* pClient );
+ virtual void InplaceDeactivated( SfxInPlaceClient* pClient );
+ virtual void UIActivating( SfxInPlaceClient* pClient );
+ virtual void UIDeactivated( SfxInPlaceClient* pClient );
+
+ virtual void JumpToMark( const String& rMark );
+ void VisAreaChanged(const Rectangle& rRect);
+
+ // Misc
+ virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual String GetSelectionText( sal_Bool bCompleteWords = sal_False );
+ virtual sal_Bool HasSelection( sal_Bool bText = sal_True ) const;
+ virtual SdrView* GetDrawView() const;
+
+ SfxShell* GetSubShell() const { return pSubShell; }
+ void AddSubShell( SfxShell& rShell );
+ void RemoveSubShell( SfxShell *pShell=NULL );
+ SfxShell* GetSubShell( sal_uInt16 );
+
+ // Focus, KeyInput, Cursor
+ void GotFocus() const;
+ inline void LostFocus() const;
+ virtual void ShowCursor( bool bOn = true );
+ virtual bool KeyInput( const KeyEvent &rKeyEvent );
+ sal_Bool Escape();
+
+ // Viewing Interface
+ Window* GetWindow() const { return pWindow; }
+ void SetWindow( Window *pViewPort );
+ virtual void AdjustPosSizePixel( const Point &rOfs, const Size &rSize );
+ const SvBorder& GetBorderPixel() const;
+ void SetBorderPixel( const SvBorder &rBorder );
+ void InvalidateBorder();
+ inline SfxViewFrame* GetViewFrame() const;
+
+ // Printing Interface
+ virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
+ virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=sal_False );
+ virtual bool HasPrintOptionsPage() const;
+ virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
+ virtual JobSetup GetJobSetup() const;
+ Printer* GetActivePrinter() const;
+
+ // Working set
+ virtual void WriteUserData( String&, sal_Bool bBrowse = sal_False );
+ virtual void ReadUserData( const String&, sal_Bool bBrowse = sal_False );
+ virtual void WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
+ virtual void ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
+ virtual void QueryObjAreaPixel( Rectangle& rRect ) const;
+
+ virtual SfxObjectShell* GetObjectShell();
+ /** retrieves the document which shall be considered the "current document" when the frame is active
+
+ The default implementation simply returns the XModel of the associated SfxObjectShell. You will rarely
+ need to overwrite this behavior.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
+ GetCurrentDocument() const;
+ /** forwards the current document, as returned by ->GetCurrentDocument, to SfxObjectShell::SetWorkingDocument
+ */
+ void SetCurrentDocument() const;
+
+ /** get an XRenderable instance that can render this document
+ */
+ virtual com::sun::star::uno::Reference< com::sun::star::view::XRenderable > GetRenderable();
+
+
+ virtual void MarginChanged();
+ const Size& GetMargin() const;
+ void SetMargin( const Size& );
+ void DisconnectAllClients();
+ virtual SfxFrame* GetSmartSelf( SfxFrame* pSelf, SfxMedium& rMedium );
+ sal_Bool NewWindowAllowed() const { return !bNoNewWindow; }
+ void SetNewWindowAllowed( sal_Bool bSet ) { bNoNewWindow = !bSet; }
+
+ void SetController( SfxBaseController* pController );
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
+ GetController();
+
+ sal_Bool TryContextMenuInterception( Menu& rIn, const OUString& rMenuIdentifier, Menu*& rpOut, ::com::sun::star::ui::ContextMenuExecuteEvent aEvent );
+
+ void ExecPrint( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool, sal_Bool );
+
+ void AddRemoveClipboardListener( const com::sun::star::uno::Reference < com::sun::star::datatransfer::clipboard::XClipboardListener>&, sal_Bool );
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardNotifier > GetClipboardNotifier();
+
+ SAL_DLLPRIVATE SfxInPlaceClient* GetUIActiveIPClient_Impl() const;
+ SAL_DLLPRIVATE void AddContextMenuInterceptor_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::ui::XContextMenuInterceptor >& xInterceptor );
+ SAL_DLLPRIVATE void RemoveContextMenuInterceptor_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::ui::XContextMenuInterceptor >& xInterceptor );
+ SAL_DLLPRIVATE bool GlobalKeyInput_Impl( const KeyEvent &rKeyEvent );
+
+ SAL_DLLPRIVATE void NewIPClient_Impl( SfxInPlaceClient *pIPClient )
+ { GetIPClientList_Impl(sal_True)->push_back(pIPClient); }
+ SAL_DLLPRIVATE void IPClientGone_Impl( SfxInPlaceClient *pIPClient );
+ SAL_DLLPRIVATE SfxInPlaceClientList* GetIPClientList_Impl( sal_Bool bCreate = sal_True ) const;
+ SAL_DLLPRIVATE void ResetAllClients_Impl( SfxInPlaceClient *pIP );
+ SAL_DLLPRIVATE void DiscardClients_Impl();
+
+ SAL_DLLPRIVATE SfxPrinter* SetPrinter_Impl( SfxPrinter *pNewPrinter );
+ SAL_DLLPRIVATE sal_Bool IsShowView_Impl() const;
+
+ SAL_DLLPRIVATE long HandleNotifyEvent_Impl( NotifyEvent& rEvent );
+ SAL_DLLPRIVATE sal_Bool HasKeyListeners_Impl();
+ SAL_DLLPRIVATE sal_Bool HasMouseClickListeners_Impl();
+
+ SAL_DLLPRIVATE SfxBaseController* GetBaseController_Impl() const;
+
+ // Shell Interface
+ SAL_DLLPRIVATE void ExecPrint_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void ExecMisc_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void GetState_Impl(SfxItemSet&);
+ SAL_DLLPRIVATE SfxFrameSetDescriptor* GetFrameSet_Impl() const;
+ SAL_DLLPRIVATE void SetFrameSet_Impl(SfxFrameSetDescriptor*);
+ SAL_DLLPRIVATE void CheckIPClient_Impl( SfxInPlaceClient*, const Rectangle& );
+ SAL_DLLPRIVATE void PushSubShells_Impl( sal_Bool bPush=sal_True );
+ SAL_DLLPRIVATE void PopSubShells_Impl() { PushSubShells_Impl( sal_False ); }
+ SAL_DLLPRIVATE void TakeOwnership_Impl();
+ SAL_DLLPRIVATE void TakeFrameOwnership_Impl();
+ SAL_DLLPRIVATE sal_Bool ExecKey_Impl(const KeyEvent& aKey);
+};
+
+//========================================================================
+
+inline void SfxViewShell::LostFocus() const
+
+/* [Description]
+
+ This method has to be called by the application developer, if the edit
+ window has lost the focus. The SFx has for example the ability to turn off
+ the accelerator, so that the cursor keys, the Delete button, etc. work in
+ certain Floating-Windows, even though they are redefined by the
+ Accelerator.
+
+ [Note]
+
+ <StarView> unfortunatly does not provide the possibility to define
+ such events 'from the side'.
+*/
+
+{
+}
+
+//------------------------------------------------------------------------
+
+inline SfxViewFrame* SfxViewShell::GetViewFrame() const
+
+/* [Description]
+
+ This method returns a pointer to the <SfxViewFrame> Instance in which
+ this SfxViewShell is displayed. This is the instance that was passed
+ on in the constructor. It is guaranteed that the returned pointer
+ points on the valid SfxViewFrame instance.
+
+ [Cross-reference]
+
+ <SfxShell::GetFrame()const>
+*/
+
+{
+ return pFrame;
+}
+
+#endif // #ifndef _SFXVIEWSH_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/zoomitem.hxx b/include/sfx2/zoomitem.hxx
new file mode 100644
index 000000000000..ab5c81c425aa
--- /dev/null
+++ b/include/sfx2/zoomitem.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 _SVX_ZOOMITEM_HXX
+#define _SVX_ZOOMITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <sfx2/sfxsids.hrc>
+#include "sfx2/dllapi.h"
+
+//-------------------------------------------------------------------------
+
+enum SvxZoomType
+{
+ SVX_ZOOM_PERCENT, // GetValue() ist kein besonderer prozentualer Wert
+ SVX_ZOOM_OPTIMAL, // GetValue() entspricht der optimalen Gr"o\se
+ SVX_ZOOM_WHOLEPAGE, // GetValue() entspricht der ganzen Seite
+ SVX_ZOOM_PAGEWIDTH, // GetValue() entspricht der Seitenbreite
+ SVX_ZOOM_PAGEWIDTH_NOBORDER // GetValue() pagewidth without border
+};
+
+//-------------------------------------------------------------------------
+
+class SFX2_DLLPUBLIC SvxZoomItem: public SfxUInt16Item
+{
+ sal_uInt16 nValueSet; // erlaubte Werte (siehe #defines unten)
+ SvxZoomType eType;
+
+public:
+ TYPEINFO();
+
+ SvxZoomItem( SvxZoomType eZoomType = SVX_ZOOM_PERCENT,
+ sal_uInt16 nVal = 0, sal_uInt16 nWhich = SID_ATTR_ZOOM );
+ SvxZoomItem( const SvxZoomItem& );
+ ~SvxZoomItem();
+
+ void SetValueSet( sal_uInt16 nValues ) { nValueSet = nValues; }
+ sal_uInt16 GetValueSet() const { return nValueSet; }
+ bool IsValueAllowed( sal_uInt16 nValue ) const
+ { return nValue == ( nValue & nValueSet ); }
+
+ SvxZoomType GetType() const { return eType; }
+ void SetType( SvxZoomType eNewType )
+ { eType = eNewType; }
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStrm, sal_uInt16 nVersion ) const;
+ virtual SvStream& Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+//------------------------------------------------------------------------
+
+#define SVX_ZOOM_ENABLE_50 0x0001
+#define SVX_ZOOM_ENABLE_75 0x0002
+#define SVX_ZOOM_ENABLE_100 0x0004
+#define SVX_ZOOM_ENABLE_150 0x0008
+#define SVX_ZOOM_ENABLE_200 0x0010
+#define SVX_ZOOM_ENABLE_OPTIMAL 0x1000
+#define SVX_ZOOM_ENABLE_WHOLEPAGE 0x2000
+#define SVX_ZOOM_ENABLE_PAGEWIDTH 0x4000
+#define SVX_ZOOM_ENABLE_ALL 0x701F
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/shell/kde_headers.h b/include/shell/kde_headers.h
new file mode 100644
index 000000000000..3ca3fa69ef26
--- /dev/null
+++ b/include/shell/kde_headers.h
@@ -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_VCL_KDE_HEADERS_H
+#define INCLUDED_VCL_KDE_HEADERS_H
+
+#include <config_vclplug.h>
+
+#if ENABLE_TDE
+
+#include "shell/tde_headers.h"
+
+#else // ENABLE_TDE
+
+/* ********* Suppress warnings if needed */
+#include "sal/config.h"
+
+#include <cstddef>
+
+#if defined __GNUC__
+#pragma GCC system_header
+#endif
+
+
+/* ********* Hack, but needed because of conflicting types... */
+#define Region QtXRegion
+
+
+/* ********* Qt headers */
+#include <qaccessible.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qfont.h>
+#include <qframe.h>
+#include <qlineedit.h>
+#include <qlistview.h>
+#include <qmainwindow.h>
+#include <qmenudata.h>
+#include <qpaintdevice.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qrangecontrol.h>
+#include <qstring.h>
+#include <qtabbar.h>
+#include <qtabwidget.h>
+#include <qtoolbar.h>
+#include <qtoolbutton.h>
+#include <qwidget.h>
+#include <qprogressbar.h>
+
+/* ********* See hack on top of this file */
+#undef Region
+
+
+/* ********* KDE base headers */
+#include <kaboutdata.h>
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <kconfig.h>
+#include <kdeversion.h>
+#include <kemailsettings.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kmainwindow.h>
+#include <kmenubar.h>
+#include <kprotocolmanager.h>
+#include <kstartupinfo.h>
+#include <kstyle.h>
+
+
+/* ********* KDE address book connectivity headers */
+#include <kabc/addressbook.h>
+#include <kabc/addressee.h>
+#include <kabc/field.h>
+#include <kabc/stdaddressbook.h>
+
+#endif // ENABLE_TDE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/shell/tde_defines.h b/include/shell/tde_defines.h
new file mode 100644
index 000000000000..0dc91e931cee
--- /dev/null
+++ b/include/shell/tde_defines.h
@@ -0,0 +1,109 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Timothy Pearson <kb9vqf@pearsoncomputing.net> (C) 2012, All Rights Reserved.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_VCL_TDE_DEFINE_HEADERS_H
+#define INCLUDED_VCL_TDE_DEFINE_HEADERS_H
+
+#define QObject TQObject
+#define QWidget TQWidget
+#define QVBox TQVBox
+#define QHBox TQHBox
+#define QGrid TQGrid
+#define QString TQString
+#define QStringList TQStringList
+#define QCustomEvent TQCustomEvent
+#define QMutex TQMutex
+#define QEvent TQEvent
+#define QFont TQFont
+#define QDateTime TQDateTime
+#define QThread TQThread
+#define QStyle TQStyle
+#define QApplication TQApplication
+#define QRect TQRect
+#define QProgressBar TQProgressBar
+#define QPopupMenu TQPopupMenu
+#define QMenuBar TQMenuBar
+#define QToolButton TQToolButton
+#define QToolBar TQToolBar
+#define QScrollBar TQScrollBar
+#define QListView TQListView
+#define QSpinWidget TQSpinWidget
+#define QScrollBar TQScrollBar
+#define QLineEdit TQLineEdit
+#define QComboBox TQComboBox
+#define QCheckBox TQCheckBox
+#define QRadioButton TQRadioButton
+#define QPushButton TQPushButton
+#define QPainter TQPainter
+#define QResizeEvent TQResizeEvent
+#define QShowEvent TQShowEvent
+#define QPoint TQPoint
+#define QDialog TQDialog
+#define QFile TQFile
+#define QLabel TQLabel
+#define QObjectList TQObjectList
+#define QCString TQCString
+#define QRegExp TQRegExp
+#define QSessionManager TQSessionManager
+#define QPaintDevice TQPaintDevice
+#define QTextIStream TQTextIStream
+#define QTextStream TQTextStream
+#define QMutexLocker TQMutexLocker
+#define QValueList TQValueList
+#define QTab TQTab
+#define QTabBar TQTabBar
+#define QTabWidget TQTabWidget
+#define QMainWindow TQMainWindow
+#define QPixmap TQPixmap
+#define QColorGroup TQColorGroup
+#define QStyleOption TQStyleOption
+#define QSize TQSize
+#define QMenuItem TQMenuItem
+#define QFontInfo TQFontInfo
+
+#define qSwap tqSwap
+#define qt_cast tqt_cast
+#define qt_xdisplay tqt_xdisplay
+#define qVersion tqVersion
+
+#define KAboutData TDEAboutData
+#define KApplication TDEApplication
+#define KCmdLineArgs TDECmdLineArgs
+#define KConfig TDEConfig
+#define KGlobal TDEGlobal
+#define KGlobalSettings TDEGlobalSettings
+#define KMainWindow TDEMainWindow
+#define KStartupInfo TDEStartupInfo
+#define KStyle TDEStyle
+#define KToolBar TDEToolBar
+
+#define drawKStylePrimitive drawTDEStylePrimitive
+
+#define KIO TDEIO
+#define KABC TDEABC
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/shell/tde_headers.h b/include/shell/tde_headers.h
new file mode 100644
index 000000000000..ed3739eb2e43
--- /dev/null
+++ b/include/shell/tde_headers.h
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Timothy Pearson <kb9vqf@pearsoncomputing.net> (C) 2012, All Rights Reserved.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_VCL_TDE_HEADERS_H
+#define INCLUDED_VCL_TDE_HEADERS_H
+
+/* ********* Suppress warnings if needed */
+#include "sal/config.h"
+
+#include <cstddef>
+
+#if defined __GNUC__
+#pragma GCC system_header
+#endif
+
+
+/* ********* Hack, but needed because of conflicting types... */
+#define Region TQtXRegion
+
+
+/* ********* TQt headers */
+#include <tqaccessible.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqfont.h>
+#include <tqframe.h>
+#include <tqlineedit.h>
+#include <tqlistview.h>
+#include <tqmainwindow.h>
+#include <tqmenudata.h>
+#include <tqpaintdevice.h>
+#include <tqpainter.h>
+#include <tqpushbutton.h>
+#include <tqradiobutton.h>
+#include <tqrangecontrol.h>
+#include <tqstring.h>
+#include <tqtabbar.h>
+#include <tqtabwidget.h>
+#include <tqtoolbar.h>
+#include <tqtoolbutton.h>
+#include <tqwidget.h>
+#include <tqprogressbar.h>
+
+/* ********* See hack on top of this file */
+#undef Region
+
+
+/* ********* TDE base headers */
+#include <tdeaboutdata.h>
+#include <tdeapplication.h>
+#include <tdecmdlineargs.h>
+#include <tdeconfig.h>
+#include <tdeversion.h>
+#include <tdeemailsettings.h>
+#include <tdeglobal.h>
+#include <tdeglobalsettings.h>
+#include <tdelocale.h>
+#include <tdemainwindow.h>
+#include <tdemenubar.h>
+#include <tdeprotocolmanager.h>
+#include <tdestartupinfo.h>
+#include <tdestyle.h>
+
+
+/* ********* TDE address book connectivity headers */
+#include <tdeabc/addressbook.h>
+#include <tdeabc/addressee.h>
+#include <tdeabc/field.h>
+#include <tdeabc/stdaddressbook.h>
+
+#include "tde_defines.h"
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sot/exchange.hxx b/include/sot/exchange.hxx
new file mode 100644
index 000000000000..b4273682de40
--- /dev/null
+++ b/include/sot/exchange.hxx
@@ -0,0 +1,224 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SOT_EXCHANGE_HXX
+#define _SOT_EXCHANGE_HXX
+
+#include <list>
+#include <vector>
+#include <tools/string.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/datatransfer/DataFlavor.hpp>
+#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
+#include "sot/sotdllapi.h"
+
+class SotDataObject;
+
+namespace com { namespace sun { namespace star { namespace datatransfer {
+ class XTransferable;
+} } } }
+
+// ---------------------
+// - SotFormatStringId -
+// ---------------------
+
+typedef sal_uLong SotFormatStringId;
+
+// ----------------
+// - DataFlavorEx -
+// ----------------
+
+struct DataFlavorEx : public ::com::sun::star::datatransfer::DataFlavor
+{
+ SotFormatStringId mnSotId;
+};
+
+typedef ::std::vector< ::com::sun::star::datatransfer::DataFlavor > DataFlavorVector;
+typedef ::std::vector< DataFlavorEx > _DataFlavorExVector;
+
+// JP 23.03.2001 - this struct is only for "hide" the STD of the vetor,
+// because our makefile filter all this symbols and so nowbody can use
+// these struct in any interfacses.
+struct DataFlavorExVector : public _DataFlavorExVector
+{
+};
+
+typedef ::std::list< ::com::sun::star::datatransfer::DataFlavor > DataFlavorList;
+typedef ::std::list< DataFlavorEx > DataFlavorExList;
+
+SOT_DLLPUBLIC sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector,
+ sal_uLong nId );
+
+// -------------------------
+// - Vordefinierte Formate -
+// -------------------------
+
+// Die Reihenfolge und die Werte d�rfen nicht ge�ndert werden,
+// da die Implementation sich darauf verl��t.
+// Standard-Formate fuer die es auch Copy/Paste-Methoden gibt
+#define FORMAT_STRING 1
+#define FORMAT_BITMAP 2
+#define FORMAT_GDIMETAFILE 3
+#define FORMAT_PRIVATE 4
+#define FORMAT_FILE 5
+#define FORMAT_FILE_LIST 6
+
+// Weitere Standardformate (diese gehen nur ueber CopyData/PasteData)
+#define FORMAT_RTF 10
+
+// Source-Options
+#define EXCHG_SOURCE_MOVEABLE ((sal_uInt16)0x0001)
+#define EXCHG_SOURCE_COPYABLE ((sal_uInt16)0x0002)
+#define EXCHG_SOURCE_LINKABLE ((sal_uInt16)0x0004)
+#define EXCHG_SOURCE_PRINTABLE ((sal_uInt16)0x0008)
+#define EXCHG_SOURCE_DISCARDABLE ((sal_uInt16)0x0010)
+#define EXCHG_SOURCE_ALL ((sal_uInt16)0x001F)
+#define EXCHG_SOURCE_DEF_COPYABLE ((sal_uInt16)0x0020)
+
+// Aktionen
+#define EXCHG_ACTION_MASK ((sal_uInt16)0x00FF)
+#define EXCHG_INOUT_ACTION_NONE ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE)
+#define EXCHG_IN_ACTION_DEFAULT EXCHG_INOUT_ACTION_NONE
+#define EXCHG_IN_ACTION_MOVE ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_MOVE)
+#define EXCHG_IN_ACTION_COPY ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY)
+#define EXCHG_IN_ACTION_LINK ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_LINK)
+#define EXCHG_INOUT_ACTION_PRINT ((sal_uInt16)8)
+#define EXCHG_INOUT_ACTION_DISCARD ((sal_uInt16)16)
+#define EXCHG_OUT_ACTION_INSERT_OBJ ((sal_uInt16)17)
+#define EXCHG_OUT_ACTION_INSERT_BOOKMARK ((sal_uInt16)18)
+#define EXCHG_OUT_ACTION_INSERT_FILELINK ((sal_uInt16)19)
+#define EXCHG_OUT_ACTION_INSERT_FILE ((sal_uInt16)20)
+#define EXCHG_OUT_ACTION_INSERT_FILELIST ((sal_uInt16)21)
+#define EXCHG_OUT_ACTION_INSERT_IMAGEMAP ((sal_uInt16)22)
+#define EXCHG_OUT_ACTION_INSERT_OLE ((sal_uInt16)23)
+#define EXCHG_OUT_ACTION_INSERT_INTERACTIVE ((sal_uInt16)24)
+#define EXCHG_OUT_ACTION_INSERT_URLBUTTON ((sal_uInt16)25)
+#define EXCHG_OUT_ACTION_INSERT_CHAOSOBJ ((sal_uInt16)26) // OBSOLET ab 500.b ?
+#define EXCHG_OUT_ACTION_REPLACE_OBJ ((sal_uInt16)27)
+#define EXCHG_OUT_ACTION_REPLACE_LINK ((sal_uInt16)28)
+#define EXCHG_OUT_ACTION_REPLACE_IMAGEMAP ((sal_uInt16)29)
+#define EXCHG_OUT_ACTION_GET_ATTRIBUTES ((sal_uInt16)30)
+#define EXCHG_OUT_ACTION_UPLOAD ((sal_uInt16)31) // OBSOLET ab 500.b ?
+#define EXCHG_OUT_ACTION_MOVE_FILE ((sal_uInt16)32)
+#define EXCHG_OUT_ACTION_MOVE_FILELIST ((sal_uInt16)33)
+#define EXCHG_OUT_ACTION_UPDATE_RANGE ((sal_uInt16)34)
+#define EXCHG_OUT_ACTION_INSERT_PRIVATE ((sal_uInt16)35)
+#define EXCHG_OUT_ACTION_INSERT_HTML ((sal_uInt16)36)
+#define EXCHG_OUT_ACTION_MOVE_PRIVATE ((sal_uInt16)37)
+#define EXCHG_OUT_ACTION_INSERT_STRING ((sal_uInt16)38)
+#define EXCHG_OUT_ACTION_INSERT_DRAWOBJ ((sal_uInt16)39)
+#define EXCHG_OUT_ACTION_INSERT_SVXB ((sal_uInt16)40)
+#define EXCHG_OUT_ACTION_INSERT_GDIMETAFILE ((sal_uInt16)41)
+#define EXCHG_OUT_ACTION_INSERT_BITMAP ((sal_uInt16)42)
+#define EXCHG_OUT_ACTION_INSERT_DDE ((sal_uInt16)43)
+#define EXCHG_OUT_ACTION_INSERT_HYPERLINK ((sal_uInt16)44)
+#define EXCHG_OUT_ACTION_REPLACE_DRAWOBJ ((sal_uInt16)45)
+#define EXCHG_OUT_ACTION_REPLACE_SVXB ((sal_uInt16)46)
+#define EXCHG_OUT_ACTION_REPLACE_GDIMETAFILE ((sal_uInt16)47)
+#define EXCHG_OUT_ACTION_REPLACE_BITMAP ((sal_uInt16)48)
+#define EXCHG_OUT_ACTION_REPLACE_GRAPH ((sal_uInt16)49)
+#define EXCHG_OUT_ACTION_INSERT_GRAPH ((sal_uInt16)50)
+#define EXCHG_OUT_ACTION_INSERT_MSGATTACH ((sal_uInt16)51) // obsolet ab 500.b ?
+#define EXCHG_OUT_ACTION_COPY_CHAOSOBJ ((sal_uInt16)52)
+#define EXCHG_OUT_ACTION_MOVE_CHAOSOBJ ((sal_uInt16)53)
+#define EXCHG_OUT_ACTION_COPY_MSGATTACH ((sal_uInt16)54)
+#define EXCHG_OUT_ACTION_COPY_BOOKMARK ((sal_uInt16)55)
+#define EXCHG_OUT_ACTION_COPY_FILE ((sal_uInt16)56)
+
+#define EXCHG_OUT_ACTION_FLAG_CREATE_THEME ((sal_uInt16)0x0100)
+#define EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE ((sal_uInt16)0x0200)
+#define EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP ((sal_uInt16)0x0400)
+#define EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP ((sal_uInt16)0x0800)
+#define EXCHG_OUT_ACTION_FLAG_FILL ((sal_uInt16)0x1000)
+#define EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL ((sal_uInt16)0x2000)
+
+// Ziele
+#define EXCHG_DEST_DOC_OLEOBJ 1
+#define EXCHG_DEST_CHARTDOC_OLEOBJ 2
+#define EXCHG_DEST_DOC_TEXTFRAME 3
+#define EXCHG_DEST_DOC_GRAPHOBJ 4
+#define EXCHG_DEST_DOC_LNKD_GRAPHOBJ 5
+#define EXCHG_DEST_DOC_GRAPH_W_IMAP 6
+#define EXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP 7
+#define EXCHG_DEST_DOC_IMAPREGION 8
+#define EXCHG_DEST_DOC_DRAWOBJ 9
+#define EXCHG_DEST_DOC_URLBUTTON 10
+#define EXCHG_DEST_DOC_URLFIELD 11
+#define EXCHG_DEST_DOC_GROUPOBJ 12
+#define EXCHG_DEST_SWDOC_FREE_AREA 13
+#define EXCHG_DEST_SCDOC_FREE_AREA 14
+#define EXCHG_DEST_SDDOC_FREE_AREA 15
+#define EXCHG_DEST_DOC_TEXTFRAME_WEB 16
+#define EXCHG_DEST_SWDOC_FREE_AREA_WEB 17
+
+// ------------
+// - Exchange -
+// ------------
+class SvGlobalName;
+class SOT_DLLPUBLIC SotExchange
+{
+public:
+ static sal_uLong RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ static sal_uLong RegisterFormatName( const String& rName );
+ static sal_uLong RegisterFormatMimeType( const String& rMimeType );
+
+ static sal_uLong GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ static String GetFormatName( sal_uLong nFormat );
+ static sal_Bool GetFormatDataFlavor( sal_uLong nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ static String GetFormatMimeType( sal_uLong nFormat );
+ static sal_Bool IsInternal( const SvGlobalName& );
+ static sal_uLong GetFormatIdFromMimeType( const String& rMimeType );
+
+ // bestimme die SotFormatStringId von dem registrierten Format
+ //JP 12.11.98: diese 3 Methoden sind ab sofort ueberfluessig, da
+ // die ClipboardIds statisch sind und aequivalent zur
+ // SotFormatStringId ist!
+ static SotFormatStringId GetFormatStringId( sal_uLong nFormat )
+ { return nFormat; }
+ static SotFormatStringId GetFormatStringId( const String& rName )
+ { return SotExchange::RegisterFormatMimeType( rName ); }
+ static sal_uLong RegisterSotFormatName( SotFormatStringId nId )
+ { return nId; }
+
+ // same for XTransferable interface
+ static sal_uInt16 GetExchangeAction(
+ // XTransferable
+ const DataFlavorExVector& rDataFlavorExVector,
+ // Ziel der Aktion (EXCHG_DEST_*)
+ sal_uInt16 nDestination,
+ // Aktionen, die Quelle unterstuetzt (EXCHG_SOURCE_...)
+ sal_uInt16 nSourceOptions,
+ // vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*)
+ sal_uInt16 nUserAction,
+ // In:- Out: Zu benutzendes Format
+ sal_uLong& rFormat,
+ // In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*)
+ sal_uInt16& rDefaultAction,
+ // In:- optional - check only for this specific format
+ sal_uLong nOnlyTestFormat = 0,
+ // In:- optional - check the contents of Xtransferable
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >* pxTransferable = NULL );
+
+ static sal_uInt16 IsChart( const SvGlobalName& rName );
+ static sal_uInt16 IsMath( const SvGlobalName& rName );
+};
+
+#endif // _EXCHANGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sot/factory.hxx b/include/sot/factory.hxx
new file mode 100644
index 000000000000..726b24382756
--- /dev/null
+++ b/include/sot/factory.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 _SOT_FACTORY_HXX
+#define _SOT_FACTORY_HXX
+
+#include <tools/globname.hxx>
+#include <tools/rtti.hxx>
+#include "sot/sotdllapi.h"
+#include <vector>
+
+/*************************************************************************
+*************************************************************************/
+class SotObject;
+class SotFactory;
+
+typedef ::std::vector< SotFactory* > SotFactoryList;
+typedef void * (*CreateInstanceType)( SotObject ** );
+
+//==================class SotFactory=======================================
+class SOT_DLLPUBLIC SotFactory : public SvGlobalName
+{
+ sal_uInt16 nSuperCount; // Anzahl der Superklassen
+ const SotFactory ** pSuperClasses; // Superklassen
+ CreateInstanceType pCreateFunc;
+
+ String aClassName;
+
+ static sal_Bool ExistTest( const SvGlobalName & );
+protected:
+ virtual ~SotFactory();
+public:
+ TYPEINFO();
+ static void IncSvObjectCount( SotObject * = NULL );
+ static void DecSvObjectCount( SotObject * = NULL );
+
+ static const SotFactory * Find( const SvGlobalName & );
+
+ SotFactory( const SvGlobalName &,
+ const String & rClassName, CreateInstanceType );
+
+ void PutSuperClass( const SotFactory * );
+ virtual void * CreateInstance( SotObject ** ppObj = NULL ) const;
+
+ sal_Bool Is( const SotFactory * pSuperClass ) const;
+ const SotFactory * GetSuper( sal_uInt16 nPos ) const
+ {
+ return nPos < nSuperCount ?
+ pSuperClasses[ nPos ]
+ : NULL;
+ }
+
+private:
+ SOT_DLLPRIVATE SotFactory( const SotFactory & );
+ SOT_DLLPRIVATE SotFactory & operator = ( const SotFactory & );
+};
+
+#endif // _FACTORY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sot/filelist.hxx b/include/sot/filelist.hxx
new file mode 100644
index 000000000000..2e69a95e5498
--- /dev/null
+++ b/include/sot/filelist.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 _FILELIST_HXX
+#define _FILELIST_HXX
+
+#include <tools/stream.hxx>
+#include "sot/sotdllapi.h"
+
+#include <vector>
+typedef ::std::vector< String* > FileStringList;
+
+class SOT_DLLPUBLIC FileList : public SvDataCopyStream
+{
+ FileStringList aStrList;
+
+protected:
+
+ // SvData-Methoden
+ virtual void Load( SvStream& );
+ virtual void Save( SvStream& );
+ virtual void Assign( const SvDataCopyStream& );
+
+ // Liste loeschen;
+ void ClearAll( void );
+
+public:
+
+ TYPEINFO();
+ FileList() {};
+ ~FileList();
+
+ // Zuweisungsoperator
+ FileList& operator=( const FileList& rFileList );
+
+ // Im-/Export
+ SOT_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const FileList& rFileList );
+ SOT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, FileList& rFileList );
+
+ // Liste fuellen/abfragen
+ void AppendFile( const String& rStr );
+ String GetFile( size_t i ) const;
+ size_t Count( void ) const;
+
+};
+
+#endif // _FILELIST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sot/formats.hxx b/include/sot/formats.hxx
new file mode 100644
index 000000000000..912947669e53
--- /dev/null
+++ b/include/sot/formats.hxx
@@ -0,0 +1,182 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SOT_FORMATS_HXX
+#define _SOT_FORMATS_HXX
+
+#ifdef _SOT_FORMATS_INCLUDE_SYSTEMFORMATS
+
+#ifdef WNT
+#ifdef _MSC_VER
+#pragma warning(push, 1)
+#pragma warning(disable: 4917)
+#endif
+#include <shlobj.h>
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+#endif
+
+#endif
+#include <sot/exchange.hxx>
+
+#define SOT_FORMAT_SYSTEM_START ((sal_uLong)0)
+#define SOT_FORMAT_STRING ((sal_uLong)FORMAT_STRING)
+#define SOT_FORMAT_BITMAP ((sal_uLong)FORMAT_BITMAP)
+#define SOT_FORMAT_GDIMETAFILE ((sal_uLong)FORMAT_GDIMETAFILE)
+#define SOT_FORMAT_PRIVATE ((sal_uLong)FORMAT_PRIVATE)
+#define SOT_FORMAT_FILE ((sal_uLong)FORMAT_FILE)
+#define SOT_FORMAT_FILE_LIST ((sal_uLong)FORMAT_FILE_LIST)
+#define SOT_FORMAT_RTF ((sal_uLong)FORMAT_RTF)
+
+#define SOT_FORMATSTR_ID_DRAWING ((sal_uLong)11)
+#define SOT_FORMATSTR_ID_SVXB ((sal_uLong)12)
+#define SOT_FORMATSTR_ID_SVIM ((sal_uLong)13)
+#define SOT_FORMATSTR_ID_XFA ((sal_uLong)14)
+#define SOT_FORMATSTR_ID_EDITENGINE ((sal_uLong)15)
+#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((sal_uLong)16)
+#define SOT_FORMATSTR_ID_SOLK ((sal_uLong)17)
+#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((sal_uLong)18)
+#define SOT_FORMATSTR_ID_TREELISTBOX ((sal_uLong)19)
+#define SOT_FORMATSTR_ID_NATIVE ((sal_uLong)20)
+#define SOT_FORMATSTR_ID_OWNERLINK ((sal_uLong)21)
+#define SOT_FORMATSTR_ID_STARSERVER ((sal_uLong)22)
+#define SOT_FORMATSTR_ID_STAROBJECT ((sal_uLong)23)
+#define SOT_FORMATSTR_ID_APPLETOBJECT ((sal_uLong)24)
+#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((sal_uLong)25)
+#define SOT_FORMATSTR_ID_STARWRITER_30 ((sal_uLong)26)
+#define SOT_FORMATSTR_ID_STARWRITER_40 ((sal_uLong)27)
+#define SOT_FORMATSTR_ID_STARWRITER_50 ((sal_uLong)28)
+#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((sal_uLong)29)
+#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((sal_uLong)30)
+#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((sal_uLong)31)
+#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((sal_uLong)32)
+#define SOT_FORMATSTR_ID_STARDRAW ((sal_uLong)33)
+#define SOT_FORMATSTR_ID_STARDRAW_40 ((sal_uLong)34)
+#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((sal_uLong)35)
+#define SOT_FORMATSTR_ID_STARDRAW_50 ((sal_uLong)36)
+#define SOT_FORMATSTR_ID_STARCALC ((sal_uLong)37)
+#define SOT_FORMATSTR_ID_STARCALC_40 ((sal_uLong)38)
+#define SOT_FORMATSTR_ID_STARCALC_50 ((sal_uLong)39)
+#define SOT_FORMATSTR_ID_STARCHART ((sal_uLong)40)
+#define SOT_FORMATSTR_ID_STARCHART_40 ((sal_uLong)41)
+#define SOT_FORMATSTR_ID_STARCHART_50 ((sal_uLong)42)
+#define SOT_FORMATSTR_ID_STARIMAGE ((sal_uLong)43)
+#define SOT_FORMATSTR_ID_STARIMAGE_40 ((sal_uLong)44)
+#define SOT_FORMATSTR_ID_STARIMAGE_50 ((sal_uLong)45)
+#define SOT_FORMATSTR_ID_STARMATH ((sal_uLong)46)
+#define SOT_FORMATSTR_ID_STARMATH_40 ((sal_uLong)47)
+#define SOT_FORMATSTR_ID_STARMATH_50 ((sal_uLong)48)
+#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((sal_uLong)49)
+#define SOT_FORMATSTR_ID_FILLED_AREA ((sal_uLong)50)
+#define SOT_FORMATSTR_ID_HTML ((sal_uLong)51)
+#define SOT_FORMATSTR_ID_HTML_SIMPLE ((sal_uLong)52)
+#define SOT_FORMATSTR_ID_CHAOS ((sal_uLong)53)
+#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((sal_uLong)54)
+#define SOT_FORMATSTR_ID_BIFF_5 ((sal_uLong)55)
+#define SOT_FORMATSTR_ID_BIFF__5 ((sal_uLong)56)
+#define SOT_FORMATSTR_ID_SYLK ((sal_uLong)57)
+#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((sal_uLong)58)
+#define SOT_FORMATSTR_ID_LINK ((sal_uLong)59)
+#define SOT_FORMATSTR_ID_DIF ((sal_uLong)60)
+#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((sal_uLong)61)
+#define SOT_FORMATSTR_ID_SONLK ((sal_uLong)62)
+#define SOT_FORMATSTR_ID_MSWORD_DOC ((sal_uLong)63)
+#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((sal_uLong)64)
+#define SOT_FORMATSTR_ID_OFFICE_DOC ((sal_uLong)65)
+#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((sal_uLong)66)
+#define SOT_FORMATSTR_ID_NOTES_HNOTE ((sal_uLong)67)
+#define SOT_FORMATSTR_ID_NOTES_NATIVE ((sal_uLong)68)
+#define SOT_FORMATSTR_ID_SFX_DOC ((sal_uLong)69)
+#define SOT_FORMATSTR_ID_EVDF ((sal_uLong)70)
+#define SOT_FORMATSTR_ID_ESDF ((sal_uLong)71)
+#define SOT_FORMATSTR_ID_IDF ((sal_uLong)72)
+#define SOT_FORMATSTR_ID_EFTP ((sal_uLong)73)
+#define SOT_FORMATSTR_ID_EFD ((sal_uLong)74)
+#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((sal_uLong)75)
+#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((sal_uLong)76)
+#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((sal_uLong)77)
+#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((sal_uLong)78)
+#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((sal_uLong)79)
+#define SOT_FORMATSTR_ID_SBA_TABED ((sal_uLong)80)
+#define SOT_FORMATSTR_ID_SBA_TABID ((sal_uLong)81)
+#define SOT_FORMATSTR_ID_SBA_JOIN ((sal_uLong)82)
+#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((sal_uLong)83)
+#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((sal_uLong)84)
+#define SOT_FORMATSTR_ID_EMBED_SOURCE ((sal_uLong)85)
+#define SOT_FORMATSTR_ID_LINK_SOURCE ((sal_uLong)86)
+#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((sal_uLong)87)
+#define SOT_FORMATSTR_ID_FILECONTENT ((sal_uLong)88)
+#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((sal_uLong)89)
+#define SOT_FORMATSTR_ID_FILENAME ((sal_uLong)90)
+#define SOT_FORMATSTR_ID_SD_OLE ((sal_uLong)91)
+#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((sal_uLong)92)
+#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((sal_uLong)93)
+#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((sal_uLong)94)
+#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((sal_uLong)95)
+#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((sal_uLong)96)
+#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((sal_uLong)97)
+#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((sal_uLong)98)
+#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((sal_uLong)99)
+#define SOT_FORMATSTR_ID_INET_IMAGE ((sal_uLong)100)
+#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((sal_uLong)101)
+#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((sal_uLong)102)
+#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((sal_uLong)103)
+#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((sal_uLong)104)
+#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((sal_uLong)105)
+#define SOT_FORMATSTR_ID_GRAPHOBJ ((sal_uLong)106)
+#define SOT_FORMATSTR_ID_STARWRITER_60 ((sal_uLong)107)
+#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((sal_uLong)108)
+#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((sal_uLong)109)
+#define SOT_FORMATSTR_ID_STARDRAW_60 ((sal_uLong)110)
+#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((sal_uLong)111)
+#define SOT_FORMATSTR_ID_STARCALC_60 ((sal_uLong)112)
+#define SOT_FORMATSTR_ID_STARCHART_60 ((sal_uLong)113)
+#define SOT_FORMATSTR_ID_STARMATH_60 ((sal_uLong)114)
+#define SOT_FORMATSTR_ID_WMF ((sal_uLong)115)
+#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((sal_uLong)116)
+#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((sal_uLong)117)
+#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((sal_uLong)118)
+#define SOT_FORMATSTR_ID_DIALOG_60 ((sal_uLong)119)
+#define SOT_FORMATSTR_ID_EMF ((sal_uLong)120)
+#define SOT_FORMATSTR_ID_BIFF_8 ((sal_uLong)121)
+#define SOT_FORMATSTR_ID_BMP ((sal_uLong)122)
+#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((sal_uLong)123)
+#define SOT_FORMATSTR_ID_STARWRITER_8 ((sal_uLong)124)
+#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((sal_uLong)125)
+#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((sal_uLong)126)
+#define SOT_FORMATSTR_ID_STARDRAW_8 ((sal_uLong)127)
+#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((sal_uLong)128)
+#define SOT_FORMATSTR_ID_STARCALC_8 ((sal_uLong)129)
+#define SOT_FORMATSTR_ID_STARCHART_8 ((sal_uLong)130)
+#define SOT_FORMATSTR_ID_STARMATH_8 ((sal_uLong)131)
+#define SOT_FORMATSTR_ID_XFORMS ((sal_uLong)132)
+#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((sal_uLong)133)
+#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((sal_uLong)134)
+#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((sal_uLong)135)
+#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((sal_uLong)136)
+#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((sal_uLong)137)
+#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((sal_uLong)138)
+#define SOT_FORMATSTR_ID_STARBASE_8 ((sal_uLong)139)
+#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((sal_uLong)140)
+#define SOT_FORMATSTR_ID_USER_END SOT_FORMATSTR_ID_HC_GDIMETAFILE
+
+#endif // _SOT_FORMATS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sot/object.hxx b/include/sot/object.hxx
new file mode 100644
index 000000000000..435dda8d4626
--- /dev/null
+++ b/include/sot/object.hxx
@@ -0,0 +1,307 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SOT_OBJECT_HXX
+#define _SOT_OBJECT_HXX
+
+#include <sot/sotdata.hxx>
+#include <tools/globname.hxx>
+#include <tools/ref.hxx>
+#include "sot/sotdllapi.h"
+
+/*************************************************************************
+*************************************************************************/
+
+#define SO2_DECL_BASIC_CLASS_DLL(ClassName,FacName) \
+private: \
+ static SotFactory ** GetFactoryAdress() \
+ { return &(FacName->p##ClassName##Factory); } \
+public: \
+ static void * CreateInstance( SotObject ** = NULL ); \
+ static SotFactory * ClassFactory(); \
+ virtual const SotFactory * GetSvFactory() const; \
+ virtual void * Cast( const SotFactory * );
+
+#define SO2_DECL_BASIC_CLASS(ClassName) \
+private: \
+ static SotFactory * pFactory; \
+ static SotFactory ** GetFactoryAdress() { return &pFactory; } \
+public: \
+ static void * CreateInstance( SotObject ** = NULL ); \
+ static SotFactory * ClassFactory(); \
+ virtual const SotFactory * GetSvFactory() const; \
+ virtual void * Cast( const SotFactory * );
+
+/**************************************************************************
+**************************************************************************/
+#define SO2_IMPL_BASIC_CLASS_DLL(ClassName,FactoryName,GlobalName) \
+SotFactory * ClassName::ClassFactory() \
+{ \
+ SotFactory **ppFactory = GetFactoryAdress(); \
+ if( !*ppFactory ) \
+ { \
+ *ppFactory = new FactoryName( GlobalName, \
+ OUString( #ClassName ), ClassName::CreateInstance ); \
+ } \
+ return *ppFactory; \
+} \
+void * ClassName::CreateInstance( SotObject ** ppObj ) \
+{ \
+ ClassName * p = new ClassName(); \
+ if( ppObj ) \
+ *ppObj = p; \
+ return p; \
+} \
+const SotFactory * ClassName::GetSvFactory() const \
+{ \
+ return ClassFactory(); \
+} \
+void * ClassName::Cast( const SotFactory * pFact ) \
+{ \
+ void * pRet = NULL; \
+ if( !pFact || pFact == ClassFactory() ) \
+ pRet = this; \
+ return pRet; \
+}
+
+#define SO2_IMPL_BASIC_CLASS(ClassName,FactoryName,GlobalName) \
+SotFactory * ClassName::pFactory = NULL; \
+ SO2_IMPL_BASIC_CLASS_DLL(ClassName,FactoryName,GlobalName)
+
+/**************************************************************************
+**************************************************************************/
+#define SO2_IMPL_BASIC_CLASS1_DLL(ClassName,FactoryName,Super1,GlobalName)\
+SotFactory * ClassName::ClassFactory() \
+{ \
+ SotFactory **ppFactory = GetFactoryAdress(); \
+ if( !*ppFactory ) \
+ { \
+ *ppFactory = new FactoryName( GlobalName, \
+ OUString( #ClassName ), ClassName::CreateInstance ); \
+ (*ppFactory)->PutSuperClass( Super1::ClassFactory() ); \
+ } \
+ return *ppFactory; \
+} \
+void * ClassName::CreateInstance( SotObject ** ppObj ) \
+{ \
+ ClassName * p = new ClassName(); \
+ Super1* pSuper1 = p; \
+ SotObject* pBasicObj = pSuper1; \
+ if( ppObj ) \
+ *ppObj = pBasicObj; \
+ return p; \
+} \
+const SotFactory * ClassName::GetSvFactory() const \
+{ \
+ return ClassFactory(); \
+} \
+void * ClassName::Cast( const SotFactory * pFact ) \
+{ \
+ void * pRet = NULL; \
+ if( !pFact || pFact == ClassFactory() ) \
+ pRet = this; \
+ if( !pRet ) \
+ pRet = Super1::Cast( pFact ); \
+ return pRet; \
+}
+
+#define SO2_IMPL_BASIC_CLASS1(ClassName,FactoryName,Super1,GlobalName) \
+SotFactory * ClassName::pFactory = NULL; \
+ SO2_IMPL_BASIC_CLASS1_DLL(ClassName,FactoryName,Super1,GlobalName)
+
+/**************************************************************************
+**************************************************************************/
+#define SO2_IMPL_BASIC_CLASS2_DLL(ClassName,FactoryName,Super1,Super2,GlobalName) \
+SotFactory * ClassName::ClassFactory() \
+{ \
+ SotFactory **ppFactory = GetFactoryAdress(); \
+ if( !*ppFactory ) \
+ { \
+ *ppFactory = new FactoryName( GlobalName, \
+ OUString( #ClassName ), ClassName::CreateInstance ); \
+ (*ppFactory)->PutSuperClass( Super1::ClassFactory() ); \
+ (*ppFactory)->PutSuperClass( Super2::ClassFactory() ); \
+ } \
+ return *ppFactory; \
+} \
+void * ClassName::CreateInstance( SotObject ** ppObj ) \
+{ \
+ ClassName * p = new ClassName(); \
+ if( ppObj ) \
+ *ppObj = p; \
+ return p; \
+} \
+const SotFactory * ClassName::GetSvFactory() const \
+{ \
+ return ClassFactory(); \
+} \
+void * ClassName::Cast( const SotFactory * pFact ) \
+{ \
+ void * pRet = NULL; \
+ if( !pFact || pFact == ClassFactory() ) \
+ pRet = this; \
+ if( !pRet ) \
+ pRet = Super1::Cast( pFact ); \
+ if( !pRet ) \
+ pRet = Super2::Cast( pFact ); \
+ return pRet; \
+}
+#define SO2_IMPL_BASIC_CLASS2(ClassName,FactoryName,Super1,Super2,GlobalName) \
+SotFactory * ClassName::pFactory = NULL; \
+ SO2_IMPL_BASIC_CLASS2_DLL(ClassName,FactoryName,Super1,Super2,GlobalName)
+
+/**************************************************************************
+**************************************************************************/
+#define SO2_IMPL_BASIC_CLASS3_DLL(ClassName,FactoryName,Super1,Super2,Super3,GlobalName) \
+SotFactory * ClassName::ClassFactory() \
+{ \
+ SotFactory **ppFactory = GetFactoryAdress(); \
+ if( !*ppFactory ) \
+ { \
+ *ppFactory = new FactoryName( GlobalName, \
+ OUString( #ClassName ), ClassName::CreateInstance ); \
+ (*ppFactory)->PutSuperClass( Super1::ClassFactory() ); \
+ (*ppFactory)->PutSuperClass( Super2::ClassFactory() ); \
+ (*ppFactory)->PutSuperClass( Super3::ClassFactory() ); \
+ } \
+ return *pFactory; \
+} \
+void * ClassName::CreateInstance( SotObject ** ppObj ) \
+{ \
+ ClassName * p = new ClassName(); \
+ if( ppObj ) \
+ *ppObj = p; \
+ return p; \
+} \
+const SotFactory * ClassName::GetSvFactory() const \
+{ \
+ return ClassFactory(); \
+} \
+void * ClassName::Cast( const SotFactory * pFact ) \
+{ \
+ void * pRet = NULL; \
+ if( !pFact || pFact == ClassFactory() ) \
+ pRet = this; \
+ if( !pRet ) \
+ pRet = Super1::Cast( pFact ); \
+ if( !pRet ) \
+ pRet = Super2::Cast( pFact ); \
+ if( !pRet ) \
+ pRet = Super3::Cast( pFact ); \
+ return pRet; \
+}
+
+#define SO2_IMPL_BASIC_CLASS3(ClassName,FactoryName,Super1,Super2,Super3,GlobalName) \
+SotFactory * ClassName::pFactory = NULL; \
+ SO2_IMPL_BASIC_CLASS3_DLL(ClassName,FactoryName,Super1,Super2,Super3,GlobalName)
+
+/**************************************************************************
+**************************************************************************/
+#define SO2_IMPL_BASIC_CLASS4_DLL(ClassName,FactoryName,Super1,Super2,Super3,Super4,GlobalName) \
+SotFactory * ClassName::ClassFactory() \
+{ \
+ SotFactory **ppFactory = GetFactoryAdress(); \
+ if( !*ppFactory ) \
+ { \
+ *ppFactory = new SotFactory( GlobalName, \
+ OUString( #ClassName ), ClassName::CreateInstance ); \
+ (*ppFactory)->PutSuperClass( Super1::ClassFactory() ); \
+ (*ppFactory)->PutSuperClass( Super2::ClassFactory() ); \
+ (*ppFactory)->PutSuperClass( Super3::ClassFactory() ); \
+ (*ppFactory)->PutSuperClass( Super4::ClassFactory() ); \
+ } \
+ return *ppFactory; \
+} \
+void * ClassName::CreateInstance( SotObject ** ppObj ) \
+{ \
+ ClassName * p = new ClassName(); \
+ if( ppObj ) \
+ *ppObj = p; \
+ return p; \
+} \
+const SotFactory * ClassName::GetSvFactory() const \
+{ \
+ return ClassFactory(); \
+} \
+void * ClassName::Cast( const SotFactory * pFact ) \
+{ \
+ void * pRet = NULL; \
+ if( !pFact || pFact == ClassFactory() ) \
+ pRet = this; \
+ if( !pRet ) \
+ pRet = Super1::Cast( pFact ); \
+ if( !pRet ) \
+ pRet = Super2::Cast( pFact ); \
+ if( !pRet ) \
+ pRet = Super3::Cast( pFact ); \
+ if( !pRet ) \
+ pRet = Super4::Cast( pFact ); \
+ return pRet; \
+}
+
+#define SO2_IMPL_BASIC_CLASS4(ClassName,FactoryName,Super1,Super2,Super3,Super4,GlobalName) \
+SotFactory * ClassName::pFactory = NULL; \
+ SO2_IMPL_BASIC_CLASS4_DLL(ClassName,FactoryName,Super1,Super2,Super3,Super4,GlobalName)
+
+//==================class SotObject========================================
+#ifdef _MSC_VER
+#pragma warning(disable: 4250)
+#endif
+
+struct IUnknown;
+class SOT_DLLPUBLIC SotObject : virtual public SvRefBase
+{
+friend class SotFactory;
+friend class SvObject;
+ sal_uInt16 nOwnerLockCount;
+ sal_Bool bOwner:1,
+ bSVObject:1, // Ist Proxy, dann TRUE wenn andere Seite SV ist
+ bInClose:1; // TRUE, im DoClose
+
+protected:
+ virtual ~SotObject();
+ void SetExtern() { bOwner = sal_False; }
+ virtual sal_Bool Close();
+public:
+ SotObject();
+ SO2_DECL_BASIC_CLASS_DLL(SotObject,SOTDATA())
+
+ // Nur damit die Makros in So3 nicht ganz ausufern
+ virtual IUnknown * GetInterface( const SvGlobalName & );
+
+ sal_Bool Owner() const { return bOwner; }
+
+ sal_uInt16 GetOwnerLockCount() const { return nOwnerLockCount; }
+
+ void OwnerLock( sal_Bool bLock );
+ sal_Bool DoClose();
+ sal_Bool IsInClose() const { return bInClose; }
+
+private:
+ // Kopieren und Zuweisen dieses Objekttyps ist nicht erlaubt
+ SOT_DLLPRIVATE SotObject & operator = ( const SotObject & );
+ SOT_DLLPRIVATE SotObject( const SotObject & );
+};
+
+//==================class SotObjectRef======================================
+SV_DECL_IMPL_REF(SotObject)
+
+#endif // _IFACE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sot/sotdata.hxx b/include/sot/sotdata.hxx
new file mode 100644
index 000000000000..da045079c76e
--- /dev/null
+++ b/include/sot/sotdata.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 _SOT_DATA_HXX
+#define _SOT_DATA_HXX
+
+/*************************************************************************
+*************************************************************************/
+
+#include <tools/solar.h>
+#include "sot/sotdllapi.h"
+#include <com/sun/star/datatransfer/DataFlavor.hpp>
+#include <vector>
+#include <list>
+
+//==================class SotData_Impl====================================
+
+class SotFactory;
+class SotObject;
+
+typedef ::std::vector< SotFactory* > SotFactoryList;
+typedef ::std::vector< com::sun::star::datatransfer::DataFlavor* > tDataFlavorList;
+
+struct SotData_Impl
+{
+ sal_uInt32 nSvObjCount;
+ std::list<SotObject*> aObjectList;
+ SotFactoryList * pFactoryList;
+ SotFactory * pSotObjectFactory;
+ SotFactory * pSotStorageStreamFactory;
+ SotFactory * pSotStorageFactory;
+ tDataFlavorList* pDataFlavorList;
+ SotData_Impl();
+ ~SotData_Impl();
+};
+
+SOT_DLLPUBLIC SotData_Impl* SOTDATA();
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sot/sotdllapi.h b/include/sot/sotdllapi.h
new file mode 100644
index 000000000000..722d2ee25f47
--- /dev/null
+++ b/include/sot/sotdllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SOTDLLAPI_H
+#define INCLUDED_SOTDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(SOT_DLLIMPLEMENTATION)
+#define SOT_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define SOT_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define SOT_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_SOTDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sot/stg.hxx b/include/sot/stg.hxx
new file mode 100644
index 000000000000..bd124cc8df00
--- /dev/null
+++ b/include/sot/stg.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 _STG_HXX
+#define _STG_HXX
+
+#include <com/sun/star/uno/Any.h>
+#include <com/sun/star/uno/Reference.h>
+
+#include <com/sun/star/io/XInputStream.hpp>
+
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+
+#include <com/sun/star/embed/XStorage.hpp>
+
+
+#include <tools/rtti.hxx>
+#include <tools/stream.hxx>
+#include <tools/globname.hxx>
+#include "sot/storinfo.hxx"
+#include "sot/sotdllapi.h"
+
+class Storage;
+class StorageStream;
+class StgIo;
+class StgDirEntry;
+class StgStrm;
+class SvGlobalName;
+struct ClsId
+{
+ sal_Int32 n1;
+ sal_Int16 n2, n3;
+ sal_uInt8 n4, n5, n6, n7, n8, n9, n10, n11;
+};
+
+class SOT_DLLPUBLIC StorageBase : public SvRefBase
+{
+protected:
+ sal_uLong m_nError; // error code
+ StreamMode m_nMode; // open mode
+ sal_Bool m_bAutoCommit;
+ StorageBase();
+ virtual ~StorageBase();
+public:
+ TYPEINFO();
+ virtual const SvStream* GetSvStream() const = 0;
+ virtual sal_Bool Validate( sal_Bool=sal_False ) const = 0;
+ virtual sal_Bool ValidateMode( StreamMode ) const = 0;
+ void ResetError() const;
+ void SetError( sal_uLong ) const;
+ sal_uLong GetError() const;
+ sal_Bool Good() const { return sal_Bool( m_nError == SVSTREAM_OK ); }
+ StreamMode GetMode() const { return m_nMode; }
+ void SetAutoCommit( sal_Bool bSet )
+ { m_bAutoCommit = bSet; }
+};
+
+class BaseStorageStream : public StorageBase
+{
+public:
+ TYPEINFO();
+ virtual sal_uLong Read( void * pData, sal_uLong nSize ) = 0;
+ virtual sal_uLong Write( const void* pData, sal_uLong nSize ) = 0;
+ virtual sal_uLong Seek( sal_uLong nPos ) = 0;
+ virtual sal_uLong Tell() = 0;
+ virtual void Flush() = 0;
+ virtual sal_Bool SetSize( sal_uLong nNewSize ) = 0;
+ virtual sal_uLong GetSize() const = 0;
+ virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ) = 0;
+ virtual sal_Bool Commit() = 0;
+ virtual sal_Bool Revert() = 0;
+ virtual sal_Bool Equals( const BaseStorageStream& rStream ) const = 0;
+};
+
+class BaseStorage : public StorageBase
+{
+public:
+ TYPEINFO();
+ virtual const String& GetName() const = 0;
+ virtual sal_Bool IsRoot() const = 0;
+ virtual void SetClassId( const ClsId& ) = 0;
+ virtual const ClsId& GetClassId() const = 0;
+ virtual void SetDirty() = 0;
+ virtual void SetClass( const SvGlobalName & rClass,
+ sal_uLong nOriginalClipFormat,
+ const String & rUserTypeName ) = 0;
+ virtual void SetConvertClass( const SvGlobalName & rConvertClass,
+ sal_uLong nOriginalClipFormat,
+ const String & rUserTypeName ) = 0;
+ virtual SvGlobalName GetClassName() = 0;
+ virtual sal_uLong GetFormat() = 0;
+ virtual String GetUserName() = 0;
+ virtual sal_Bool ShouldConvert() = 0;
+ virtual void FillInfoList( SvStorageInfoList* ) const = 0;
+ virtual sal_Bool CopyTo( BaseStorage* pDestStg ) const = 0;
+ virtual sal_Bool Commit() = 0;
+ virtual sal_Bool Revert() = 0;
+ virtual BaseStorageStream* OpenStream( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ sal_Bool bDirect = sal_True, const OString* pKey=0 ) = 0;
+ virtual BaseStorage* OpenStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ bool bDirect = false ) = 0;
+ virtual BaseStorage* OpenUCBStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ sal_Bool bDirect = sal_False ) = 0;
+ virtual BaseStorage* OpenOLEStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ sal_Bool bDirect = sal_False ) = 0;
+ virtual sal_Bool IsStream( const String& rEleName ) const = 0;
+ virtual sal_Bool IsStorage( const String& rEleName ) const = 0;
+ virtual sal_Bool IsContained( const String& rEleName ) const = 0;
+ virtual sal_Bool Remove( const String & rEleName ) = 0;
+ virtual sal_Bool Rename( const String & rEleName, const String & rNewName ) = 0;
+ virtual sal_Bool CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0;
+ virtual sal_Bool MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0;
+ virtual sal_Bool ValidateFAT() = 0;
+ virtual sal_Bool Equals( const BaseStorage& rStream ) const = 0;
+};
+
+class OLEStorageBase
+{
+protected:
+ StreamMode& nStreamMode; // open mode
+ StgIo* pIo; // I/O subsystem
+ StgDirEntry* pEntry; // the dir entry
+ OLEStorageBase( StgIo*, StgDirEntry*, StreamMode& );
+ ~OLEStorageBase();
+ sal_Bool Validate_Impl( sal_Bool=sal_False ) const;
+ sal_Bool ValidateMode_Impl( StreamMode, StgDirEntry* p = NULL ) const ;
+ const SvStream* GetSvStream_Impl() const;
+public:
+};
+
+class StorageStream : public BaseStorageStream, public OLEStorageBase
+{
+//friend class Storage;
+ sal_uLong nPos; // current position
+protected:
+ ~StorageStream();
+public:
+ TYPEINFO();
+ StorageStream( StgIo*, StgDirEntry*, StreamMode );
+ virtual sal_uLong Read( void * pData, sal_uLong nSize );
+ virtual sal_uLong Write( const void* pData, sal_uLong nSize );
+ virtual sal_uLong Seek( sal_uLong nPos );
+ virtual sal_uLong Tell() { return nPos; }
+ virtual void Flush();
+ virtual sal_Bool SetSize( sal_uLong nNewSize );
+ virtual sal_uLong GetSize() const;
+ virtual sal_Bool CopyTo( BaseStorageStream * pDestStm );
+ virtual sal_Bool Commit();
+ virtual sal_Bool Revert();
+ virtual sal_Bool Validate( sal_Bool=sal_False ) const;
+ virtual sal_Bool ValidateMode( StreamMode ) const;
+ const SvStream* GetSvStream() const;
+ virtual sal_Bool Equals( const BaseStorageStream& rStream ) const;
+};
+
+class UCBStorageStream;
+
+class SOT_DLLPUBLIC Storage : public BaseStorage, public OLEStorageBase
+{
+ String aName;
+ sal_Bool bIsRoot;
+ void Init( sal_Bool bCreate );
+ Storage( StgIo*, StgDirEntry*, StreamMode );
+protected:
+ ~Storage();
+public:
+ TYPEINFO();
+ Storage( const String &, StreamMode = STREAM_STD_READWRITE, sal_Bool bDirect = sal_True );
+ Storage( SvStream& rStrm, sal_Bool bDirect = sal_True );
+ Storage( UCBStorageStream& rStrm, sal_Bool bDirect = sal_True );
+
+ static sal_Bool IsStorageFile( const String & rFileName );
+ static sal_Bool IsStorageFile( SvStream* );
+
+ virtual const String& GetName() const;
+ virtual sal_Bool IsRoot() const { return bIsRoot; }
+ virtual void SetClassId( const ClsId& );
+ virtual const ClsId& GetClassId() const;
+ virtual void SetDirty();
+ virtual void SetClass( const SvGlobalName & rClass,
+ sal_uLong nOriginalClipFormat,
+ const String & rUserTypeName );
+ virtual void SetConvertClass( const SvGlobalName & rConvertClass,
+ sal_uLong nOriginalClipFormat,
+ const String & rUserTypeName );
+ virtual SvGlobalName GetClassName();
+ virtual sal_uLong GetFormat();
+ virtual String GetUserName();
+ virtual sal_Bool ShouldConvert();
+ virtual void FillInfoList( SvStorageInfoList* ) const;
+ virtual sal_Bool CopyTo( BaseStorage* pDestStg ) const;
+ virtual sal_Bool Commit();
+ virtual sal_Bool Revert();
+ virtual BaseStorageStream* OpenStream( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ sal_Bool bDirect = sal_True, const OString* pKey=0 );
+ virtual BaseStorage* OpenStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ bool bDirect = false );
+ virtual BaseStorage* OpenUCBStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ sal_Bool bDirect = sal_False );
+ virtual BaseStorage* OpenOLEStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ sal_Bool bDirect = sal_False );
+ virtual sal_Bool IsStream( const String& rEleName ) const;
+ virtual sal_Bool IsStorage( const String& rEleName ) const;
+ virtual sal_Bool IsContained( const String& rEleName ) const;
+ virtual sal_Bool Remove( const String & rEleName );
+ virtual sal_Bool Rename( const String & rEleName, const String & rNewName );
+ virtual sal_Bool CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName );
+ virtual sal_Bool MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName );
+ virtual sal_Bool ValidateFAT();
+ virtual sal_Bool Validate( sal_Bool=sal_False ) const;
+ virtual sal_Bool ValidateMode( StreamMode ) const;
+ sal_Bool ValidateMode( StreamMode, StgDirEntry* p ) const;
+ virtual const SvStream* GetSvStream() const;
+ virtual sal_Bool Equals( const BaseStorage& rStream ) const;
+};
+
+class UCBStorageStream_Impl;
+class UCBStorageStream : public BaseStorageStream
+{
+friend class UCBStorage;
+
+ UCBStorageStream_Impl*
+ pImp;
+protected:
+ ~UCBStorageStream();
+public:
+ TYPEINFO();
+ UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const OString* pKey, sal_Bool bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress );
+ UCBStorageStream( UCBStorageStream_Impl* );
+
+ virtual sal_uLong Read( void * pData, sal_uLong nSize );
+ virtual sal_uLong Write( const void* pData, sal_uLong nSize );
+ virtual sal_uLong Seek( sal_uLong nPos );
+ virtual sal_uLong Tell();
+ virtual void Flush();
+ virtual sal_Bool SetSize( sal_uLong nNewSize );
+ virtual sal_uLong GetSize() const;
+ virtual sal_Bool CopyTo( BaseStorageStream * pDestStm );
+ virtual sal_Bool Commit();
+ virtual sal_Bool Revert();
+ virtual sal_Bool Validate( sal_Bool=sal_False ) const;
+ virtual sal_Bool ValidateMode( StreamMode ) const;
+ const SvStream* GetSvStream() const;
+ virtual sal_Bool Equals( const BaseStorageStream& rStream ) const;
+ sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
+
+ SvStream* GetModifySvStream();
+};
+
+namespace ucbhelper
+{
+ class Content;
+}
+
+class UCBStorage_Impl;
+struct UCBStorageElement_Impl;
+class SOT_DLLPUBLIC UCBStorage : public BaseStorage
+{
+ UCBStorage_Impl* pImp;
+
+protected:
+ ~UCBStorage();
+public:
+ static sal_Bool IsStorageFile( SvStream* );
+ static sal_Bool IsDiskSpannedFile( SvStream* );
+ static String GetLinkedFile( SvStream& );
+ static String CreateLinkFile( const String& rName );
+
+ UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, sal_Bool bDirect = sal_True, sal_Bool bIsRoot = sal_True );
+ UCBStorage( const String& rName,
+ StreamMode nMode,
+ sal_Bool bDirect = sal_True,
+ sal_Bool bIsRoot = sal_True );
+
+ UCBStorage( const String& rName,
+ StreamMode nMode,
+ sal_Bool bDirect,
+ sal_Bool bIsRoot,
+ sal_Bool bIsRepair,
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler >
+ xProgressHandler );
+
+ UCBStorage( UCBStorage_Impl* );
+ UCBStorage( SvStream& rStrm, sal_Bool bDirect = sal_True );
+
+ TYPEINFO();
+ virtual const String& GetName() const;
+ virtual sal_Bool IsRoot() const;
+ virtual void SetClassId( const ClsId& );
+ virtual const ClsId& GetClassId() const;
+ virtual void SetDirty();
+ virtual void SetClass( const SvGlobalName & rClass,
+ sal_uLong nOriginalClipFormat,
+ const String & rUserTypeName );
+ virtual void SetConvertClass( const SvGlobalName & rConvertClass,
+ sal_uLong nOriginalClipFormat,
+ const String & rUserTypeName );
+ virtual SvGlobalName GetClassName();
+ virtual sal_uLong GetFormat();
+ virtual String GetUserName();
+ virtual sal_Bool ShouldConvert();
+ virtual void FillInfoList( SvStorageInfoList* ) const;
+ virtual sal_Bool CopyTo( BaseStorage* pDestStg ) const;
+ virtual sal_Bool Commit();
+ virtual sal_Bool Revert();
+ virtual BaseStorageStream* OpenStream( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ sal_Bool bDirect = sal_True, const OString* pKey=0 );
+ virtual BaseStorage* OpenStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ bool bDirect = false );
+ virtual BaseStorage* OpenUCBStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ sal_Bool bDirect = sal_False );
+ virtual BaseStorage* OpenOLEStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ sal_Bool bDirect = sal_False );
+ virtual sal_Bool IsStream( const String& rEleName ) const;
+ virtual sal_Bool IsStorage( const String& rEleName ) const;
+ virtual sal_Bool IsContained( const String& rEleName ) const;
+ virtual sal_Bool Remove( const String & rEleName );
+ virtual sal_Bool Rename( const String & rEleName, const String & rNewName );
+ virtual sal_Bool CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName );
+ virtual sal_Bool MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName );
+ virtual sal_Bool ValidateFAT();
+ virtual sal_Bool Validate( sal_Bool=sal_False ) const;
+ virtual sal_Bool ValidateMode( StreamMode ) const;
+ virtual const SvStream* GetSvStream() const;
+ virtual sal_Bool Equals( const BaseStorage& rStream ) const;
+ sal_Bool GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue );
+
+ UCBStorageElement_Impl* FindElement_Impl( const String& rName ) const;
+ sal_Bool CopyStorageElement_Impl( UCBStorageElement_Impl& rElement,
+ BaseStorage* pDest, const String& rNew ) const;
+ BaseStorage* OpenStorage_Impl( const String & rEleName,
+ StreamMode, sal_Bool bDirect, sal_Bool bForceUCBStorage );
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sot/storage.hxx b/include/sot/storage.hxx
new file mode 100644
index 000000000000..db3995dfc374
--- /dev/null
+++ b/include/sot/storage.hxx
@@ -0,0 +1,223 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SOT_STORAGE_HXX
+#define _SOT_STORAGE_HXX
+
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Reference.h>
+
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <sot/object.hxx>
+#include <sot/factory.hxx>
+#include <tools/stream.hxx>
+#include <tools/errcode.hxx>
+#include "sot/storinfo.hxx"
+#include "sot/sotdllapi.h"
+
+#define STORAGE_FAILIFTHERE 0x02
+#define STORAGE_TRANSACTED 0x04
+#define STORAGE_PRIORITY 0x08
+#define STORAGE_DELETEONRELEASE 0x10
+#define STORAGE_CONVERT 0x20
+#define STORAGE_UNPACKED_MODE 0x40
+#define STORAGE_DISKSPANNED_MODE 0x80
+#define STORAGE_CREATE_UNPACKED 0x44
+typedef short StorageMode;
+
+class SvStorage;
+
+
+/*************************************************************************
+*************************************************************************/
+class SotStorage;
+class BaseStorageStream;
+class SOT_DLLPUBLIC SotStorageStream : virtual public SotObject, public SvStream
+{
+friend class SotStorage;
+ BaseStorageStream * pOwnStm;// Zeiger auf den eigenen Stream
+protected:
+ virtual sal_uLong GetData( void* pData, sal_uLong nSize );
+ virtual sal_uLong PutData( const void* pData, sal_uLong nSize );
+ virtual sal_uLong SeekPos( sal_uLong nPos );
+ virtual void FlushData();
+ ~SotStorageStream();
+public:
+ SotStorageStream( const String &,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = 0 );
+ SotStorageStream( BaseStorageStream *pStm );
+ SotStorageStream();
+ SO2_DECL_BASIC_CLASS_DLL(SotStorageStream,SOTDATA())
+
+ virtual void ResetError();
+
+ virtual void SetSize( sal_uLong nNewSize );
+ sal_uInt32 GetSize() const;
+ sal_Bool CopyTo( SotStorageStream * pDestStm );
+ virtual sal_Bool Commit();
+ virtual sal_Bool Revert();
+ sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
+ virtual sal_Size remainingSize();
+};
+
+#ifndef SOT_DECL_SOTSTORAGESTREAM_DEFINED
+#define SOT_DECL_SOTSTORAGESTREAM_DEFINED
+SV_DECL_REF(SotStorageStream)
+#endif
+SV_IMPL_REF(SotStorageStream)
+
+namespace ucbhelper
+{
+ class Content;
+}
+
+class BaseStorage;
+class UNOStorageHolder;
+class SOT_DLLPUBLIC SotStorage : virtual public SotObject
+{
+friend class SotStorageStream;
+friend class SvStorage;
+
+ BaseStorage * m_pTmpStg; // Temp-Storage fuer Transacted, nur auf diesem schreiben! ??? Useless ???
+ BaseStorage * m_pOwnStg; // Zielstorage
+ SvStream * m_pStorStm; // nur fuer SDSTORAGES
+ sal_uLong m_nError;
+ String m_aName; // Name des Storage
+ sal_Bool m_bIsRoot:1, // z.B.: File-Storage
+ m_bDelStm:1;
+ OString m_aKey; // aKey.Len != 0 -> Verschluesselung
+ long m_nVersion;
+
+protected:
+ ~SotStorage();
+ void CreateStorage( sal_Bool bUCBStorage, StreamMode, StorageMode );
+public:
+ SotStorage( const String &,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = 0 );
+ SotStorage( sal_Bool bUCBStorage, const String &,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = 0 );
+ SotStorage( BaseStorage * );
+ SotStorage( SvStream & rStm );
+ SotStorage( sal_Bool bUCBStorage, SvStream & rStm );
+ SotStorage( SvStream * pStm, sal_Bool bDelete );
+ SotStorage();
+ SO2_DECL_BASIC_CLASS_DLL(SotStorage,SOTDATA())
+
+ SvMemoryStream * CreateMemoryStream();
+
+ static sal_Bool IsStorageFile( const String & rFileName );
+ static sal_Bool IsStorageFile( SvStream* pStream );
+
+ virtual const String & GetName() const;
+
+ virtual sal_Bool Validate();
+
+ const OString& GetKey() const;
+
+ void SetVersion( long nVers )
+ {
+ m_nVersion = nVers;
+ }
+ long GetVersion() const
+ {
+ return m_nVersion;
+ }
+
+ sal_uLong GetErrorCode() const { return m_nError; }
+ sal_uLong GetError() const { return ERRCODE_TOERROR(m_nError); }
+ void SetError( sal_uLong nErrorCode )
+ {
+ if( m_nError == SVSTREAM_OK )
+ m_nError = nErrorCode;
+ }
+ virtual void ResetError();
+
+ sal_Bool IsRoot() const { return m_bIsRoot; }
+ void SignAsRoot( sal_Bool b = sal_True ) { m_bIsRoot = b; }
+ void SetDeleteStream( sal_Bool bDelete ) { m_bDelStm = bDelete; }
+
+ // eigener Datenbereich
+ virtual void SetClass( const SvGlobalName & rClass,
+ sal_uLong bOriginalClipFormat,
+ const String & rUserTypeName );
+ virtual void SetConvertClass( const SvGlobalName & rConvertClass,
+ sal_uLong bOriginalClipFormat,
+ const String & rUserTypeName );
+ virtual SvGlobalName GetClassName();// Typ der Daten im Storage
+ virtual sal_uLong GetFormat();
+ virtual String GetUserName();
+ virtual sal_Bool ShouldConvert();
+
+ // Liste aller Elemente
+ virtual void FillInfoList( SvStorageInfoList * ) const;
+ virtual sal_Bool CopyTo( SotStorage * pDestStg );
+ virtual sal_Bool Commit();
+ virtual sal_Bool Revert();
+
+ /* Element Methoden */
+ // Stream mit Verbindung zu Storage erzeugen,
+ // in etwa eine Parent-Child Beziehung
+ SotStorageStream * OpenSotStream( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = 0 );
+ SotStorage * OpenSotStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = STORAGE_TRANSACTED );
+ // Abfrage auf Storage oder Stream
+ virtual sal_Bool IsStream( const String & rEleName ) const;
+ virtual sal_Bool IsStorage( const String & rEleName ) const;
+ virtual sal_Bool IsContained( const String & rEleName ) const;
+ // Element loeschen
+ virtual sal_Bool Remove( const String & rEleName );
+ // Elementnamen aendern
+ virtual sal_Bool Rename( const String & rEleName,
+ const String & rNewName );
+ virtual sal_Bool CopyTo( const String & rEleName, SotStorage * pDest,
+ const String & rNewName );
+ virtual sal_Bool MoveTo( const String & rEleName, SotStorage * pDest,
+ const String & rNewName );
+
+ sal_Bool IsOLEStorage() const;
+ static sal_Bool IsOLEStorage( const String & rFileName );
+ static sal_Bool IsOLEStorage( SvStream* pStream );
+
+ static SotStorage* OpenOLEStorage( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage,
+ const String& rEleName, StreamMode = STREAM_STD_READWRITE );
+ static sal_Int32 GetFormatID( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
+ static sal_Int32 GetVersion( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
+};
+
+#ifndef SOT_DECL_SOTSTORAGE_DEFINED
+#define SOT_DECL_SOTSTORAGE_DEFINED
+SV_DECL_REF(SotStorage)
+#endif
+SV_IMPL_REF(SotStorage)
+
+#define SvStorage SotStorage
+#define SvStorageRef SotStorageRef
+#define SvStorageStream SotStorageStream
+#define SvStorageStreamRef SotStorageStreamRef
+
+#endif // _SVSTOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sot/storinfo.hxx b/include/sot/storinfo.hxx
new file mode 100644
index 000000000000..5518d618bf36
--- /dev/null
+++ b/include/sot/storinfo.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 _SOT_STORINFO_HXX
+#define _SOT_STORINFO_HXX
+
+#include <tools/globname.hxx>
+#include <vector>
+#include "sot/sotdllapi.h"
+
+class StgDirEntry;
+class SvStorageInfo
+{
+friend class SvStorage;
+ String aName;
+ SvGlobalName aClassName;
+ sal_uLong nSize;
+ sal_Bool bStream:1,
+ bStorage:1;
+
+ SvStorageInfo(){}; // Fuer SvStorage
+public:
+ SvStorageInfo( const StgDirEntry& );
+ SvStorageInfo( const String& rName, sal_uLong nSz, sal_Bool bIsStorage )
+ : aName( rName )
+ , nSize( nSz )
+ , bStream( !bIsStorage )
+ , bStorage( bIsStorage )
+ {}
+
+ const SvGlobalName & GetClassName() const { return aClassName; }
+ const String & GetName() const { return aName; }
+ sal_Bool IsStream() const { return bStream; }
+ sal_Bool IsStorage() const { return bStorage; }
+ sal_uLong GetSize() const { return nSize; }
+};
+
+typedef ::std::vector< SvStorageInfo > SvStorageInfoList;
+
+SOT_DLLPUBLIC sal_uLong ReadClipboardFormat( SvStream & rStm );
+SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat );
+
+#endif // _STORINFO_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/store/store.h b/include/store/store.h
new file mode 100644
index 000000000000..ff3f1ef0a390
--- /dev/null
+++ b/include/store/store.h
@@ -0,0 +1,405 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _STORE_STORE_H_
+#define _STORE_STORE_H_
+
+#include <store/types.h>
+#include <store/storedllapi.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Handle opaque type.
+ */
+typedef void* storeHandle;
+
+
+/** Acquire a Handle.
+ @param Handle [in] the Handle.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_acquireHandle (
+ storeHandle Handle
+) SAL_THROW_EXTERN_C();
+
+
+/** Release a Handle.
+ @param Handle [in] the Handle.
+ @return store_E_None upon success,
+ store_E_InvalidHandle otherwise.
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_releaseHandle (
+ storeHandle Handle
+) SAL_THROW_EXTERN_C();
+
+
+
+/** File Handle opaque type.
+ */
+typedef void* storeFileHandle;
+
+
+/** Open a temporary file in memory.
+ @param nPageSize [in] the creation page size,
+ integer multiple of minimum page size.
+ @param phFile [out] the File Handle.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_createMemoryFile (
+ sal_uInt16 nPageSize,
+ storeFileHandle *phFile
+) SAL_THROW_EXTERN_C();
+
+
+/** Open a file.
+ @param pFilename [in] the filename as URL or system path.
+ @param eAccessMode [in] the access mode.
+ store_AccessCreate truncate existing and create,
+ store_AccessReadCreate create not existing,
+ store_AccessReadWrite write existing,
+ store_AccessReadOnly never modifies.
+ @param nPageSize [in] the creation page size,
+ integer multiple of minimum page size.
+ @param phFile [out] the File Handle.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_openFile (
+ rtl_uString *pFilename,
+ storeAccessMode eAccessMode,
+ sal_uInt16 nPageSize,
+ storeFileHandle *phFile
+) SAL_THROW_EXTERN_C();
+
+
+/** Close a file.
+ @param hFile [in] the File Handle.
+ @return store_E_None upon success,
+ store_E_InvalidHandle otherwise.
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_closeFile (
+ storeFileHandle hFile
+) SAL_THROW_EXTERN_C();
+
+
+/** Flush a file.
+ @param hFile [in] the File Handle.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_flushFile (
+ storeFileHandle hFile
+) SAL_THROW_EXTERN_C();
+
+
+/** Get the number of referers to a file.
+ @param hFile [in] the File Handle.
+ @param pnRefCount [out] number of open directories and streams.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_getFileRefererCount (
+ storeFileHandle hFile,
+ sal_uInt32 *pnRefCount
+) SAL_THROW_EXTERN_C();
+
+
+/** Get the size of a file.
+ @param hFile [in] the File Handle.
+ @param pnSize [out] the file size in bytes.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_getFileSize (
+ storeFileHandle hFile,
+ sal_uInt32 *pnSize
+) SAL_THROW_EXTERN_C();
+
+
+/** Recover and Compact a file into another file.
+ @see store_openFile()
+
+ @param pSrcFilename [in] opened with store_AccessReadOnly.
+ @param pDstFilename [in] created with store_AccessCreate.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_rebuildFile (
+ rtl_uString *pSrcFilename,
+ rtl_uString *pDstFilename
+) SAL_THROW_EXTERN_C();
+
+
+
+/** Directory Handle opaque type.
+ */
+typedef void* storeDirectoryHandle;
+
+
+/** Open a directory.
+ @see store_openFile()
+
+ @param hFile [in] the File Handle.
+ @param pPath [in] the directory path.
+ @param pName [in] the directory name.
+ @param eAccessMode [in] the access mode.
+ @param phDirectory [out] the Directory Handle.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_openDirectory (
+ storeFileHandle hFile,
+ rtl_uString *pPath,
+ rtl_uString *pName,
+ storeAccessMode eAccessMode,
+ storeDirectoryHandle *phDirectory
+) SAL_THROW_EXTERN_C();
+
+
+/** Close a directory.
+ @param hDirectory [in] the Directory Handle.
+ @return store_E_None upon success,
+ store_E_InvalidHandle otherwise.
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_closeDirectory (
+ storeDirectoryHandle hDirectory
+) SAL_THROW_EXTERN_C();
+
+
+/** Find first directory entry.
+ @param hDirectory [in] the Directory Handle.
+ @param pFindData [out] the Find Data structure.
+ @return store_E_None upon success,
+ store_E_NoMoreFile upon end of iteration.
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_findFirst (
+ storeDirectoryHandle hDirectory,
+ storeFindData *pFindData
+) SAL_THROW_EXTERN_C();
+
+
+/** Find next directory entry.
+ @param hDirectory [in] the Directory Handle.
+ @param pFindData [out] the Find Data structure.
+ @return store_E_None upon success,
+ store_E_NoMoreFile upon end of iteration.
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_findNext (
+ storeDirectoryHandle hDirectory,
+ storeFindData *pFindData
+) SAL_THROW_EXTERN_C();
+
+
+
+/** Stream Handle opaque type.
+ */
+typedef void* storeStreamHandle;
+
+
+/** Open a stream.
+ @see store_openFile()
+
+ @param hFile [in] the File Handle.
+ @param pPath [in] the stream path.
+ @param pName [in] the stream name.
+ @param eMode [in] the access mode.
+ @param phStrm [out] the Stream Handle.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_openStream (
+ storeFileHandle hFile,
+ rtl_uString *pPath,
+ rtl_uString *pName,
+ storeAccessMode eMode,
+ storeStreamHandle *phStrm
+) SAL_THROW_EXTERN_C();
+
+
+/** Close a stream.
+ @param hStrm [in] the Stream Handle.
+ @return store_E_None upon success,
+ store_E_InvalidHandle otherwise.
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_closeStream (
+ storeStreamHandle hStrm
+) SAL_THROW_EXTERN_C();
+
+
+/** Read from a stream.
+ @param hStrm [in] the Stream Handle.
+ @param nOffset [in] the offset of the first byte to read.
+ @param pBuffer [out] the buffer.
+ @param nBytes [in] the number of bytes to read.
+ @param pnDone [out] the number of bytes actually read.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_readStream (
+ storeStreamHandle hStrm,
+ sal_uInt32 nOffset,
+ void *pBuffer,
+ sal_uInt32 nBytes,
+ sal_uInt32 *pnDone
+) SAL_THROW_EXTERN_C();
+
+
+/** Write to a stream.
+ @param hStrm [in] the Stream Handle.
+ @param nOffset [in] the offset of the first byte to write.
+ @param pBuffer [in] the buffer.
+ @param nBytes [in] the number of bytes to write.
+ @param pnDone [out] the number of bytes actually written.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_writeStream (
+ storeStreamHandle hStrm,
+ sal_uInt32 nOffset,
+ const void *pBuffer,
+ sal_uInt32 nBytes,
+ sal_uInt32 *pnDone
+) SAL_THROW_EXTERN_C();
+
+
+/** Flush a stream.
+ @param hStrm [in] the Stream Handle.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_flushStream (
+ storeStreamHandle hStrm
+) SAL_THROW_EXTERN_C();
+
+
+/** Get the size of a stream.
+ @param hStrm [in] the Stream Handle.
+ @param pnSize [out] the stream size in bytes.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_getStreamSize (
+ storeStreamHandle hStrm,
+ sal_uInt32 *pnSize
+) SAL_THROW_EXTERN_C();
+
+
+/** Set the size of a stream.
+ @param hStrm [in] the Stream Handle.
+ @param nSize [in] the new stream size in bytes.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_setStreamSize (
+ storeStreamHandle hStrm,
+ sal_uInt32 nSize
+) SAL_THROW_EXTERN_C();
+
+
+
+/** Set attributes of a file entry.
+ @param hFile [in] the File Handle.
+ @param pPath [in] the entry path.
+ @param pName [in] the entry name.
+ @param nMask1 [in] the attributes to be cleared.
+ @param nMask2 [in] the attributes to be set.
+ @param pnAttrib [out] the resulting attributes, may be NULL.
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_attrib (
+ storeFileHandle hFile,
+ rtl_uString *pPath,
+ rtl_uString *pName,
+ sal_uInt32 nMask1,
+ sal_uInt32 nMask2,
+ sal_uInt32 *pnAttrib
+) SAL_THROW_EXTERN_C();
+
+
+/** Insert a file entry as 'hard link' to another file entry.
+ @pre Source must not exist, Destination must exist.
+ @post Source has attribute STORE_ATTRIB_ISLINK.
+ @see store_attrib()
+
+ @param hFile [in] the File Handle
+ @param pSrcPath [in] the Source path
+ @param pSrcName [in] the Source name
+ @param pDstPath [in] the Destination path
+ @param pDstName [in] the Destination name
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_link (
+ storeFileHandle hFile,
+ rtl_uString *pSrcPath, rtl_uString *pSrcName,
+ rtl_uString *pDstPath, rtl_uString *pDstName
+) SAL_THROW_EXTERN_C();
+
+
+/** Insert a file entry as 'symbolic link' to another file entry.
+ @pre Source must not exist
+ @post Source has attribute STORE_ATTRIB_ISLINK.
+ @see store_attrib()
+
+ @param hFile [in] the File Handle
+ @param pSrcPath [in] the Source path
+ @param pSrcName [in] the Source name
+ @param pDstPath [in] the Destination path
+ @param pDstName [in] the Destination name
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_symlink (
+ storeFileHandle hFile,
+ rtl_uString *pSrcPath, rtl_uString *pSrcName,
+ rtl_uString *pDstPath, rtl_uString *pDstName
+) SAL_THROW_EXTERN_C();
+
+
+/** Rename a file entry.
+ @param hFile [in] the File Handle
+ @param pSrcPath [in] the Source path
+ @param pSrcName [in] the Source name
+ @param pDstPath [in] the Destination path
+ @param pDstName [in] the Destination name
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_rename (
+ storeFileHandle hFile,
+ rtl_uString *pSrcPath, rtl_uString *pSrcName,
+ rtl_uString *pDstPath, rtl_uString *pDstName
+) SAL_THROW_EXTERN_C();
+
+
+/** Remove a file entry.
+ @param hFile [in] the File Handle
+ @param pPath [in] the entry path
+ @param pName [in] the entry name
+ @return store_E_None upon success
+ */
+STORE_DLLPUBLIC storeError SAL_CALL store_remove (
+ storeFileHandle hFile,
+ rtl_uString *pPath,
+ rtl_uString *pName
+) SAL_THROW_EXTERN_C();
+
+/*========================================================================
+ *
+ * The End.
+ *
+ *======================================================================*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _STORE_STORE_H_ */
+
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/store/store.hxx b/include/store/store.hxx
new file mode 100644
index 000000000000..43ef8859c52e
--- /dev/null
+++ b/include/store/store.hxx
@@ -0,0 +1,605 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _STORE_STORE_HXX_
+#define _STORE_STORE_HXX_
+
+#include "sal/types.h"
+#include "rtl/ustring.hxx"
+#include "store/store.h"
+
+namespace store
+{
+
+/*========================================================================
+ *
+ * OStoreStream interface.
+ *
+ *======================================================================*/
+class OStoreStream
+{
+public:
+ /** Construction.
+ */
+ inline OStoreStream (void) SAL_THROW(())
+ : m_hImpl (0)
+ {}
+
+ /** Destruction.
+ */
+ inline ~OStoreStream (void) SAL_THROW(())
+ {
+ if (m_hImpl)
+ (void) store_releaseHandle (m_hImpl);
+ }
+
+ /** Copy construction.
+ */
+ inline OStoreStream (OStoreStream const & rhs) SAL_THROW(())
+ : m_hImpl (rhs.m_hImpl)
+ {
+ if (m_hImpl)
+ (void) store_acquireHandle (m_hImpl);
+ }
+
+ /** Assignment.
+ */
+ inline OStoreStream & operator= (OStoreStream const & rhs) SAL_THROW(())
+ {
+ if (rhs.m_hImpl)
+ (void) store_acquireHandle (rhs.m_hImpl);
+ if (m_hImpl)
+ (void) store_releaseHandle (m_hImpl);
+ m_hImpl = rhs.m_hImpl;
+ return *this;
+ }
+
+ /** Construction from Stream Handle.
+ */
+ inline explicit OStoreStream (storeStreamHandle Handle) SAL_THROW(())
+ : m_hImpl (Handle)
+ {
+ if (m_hImpl)
+ (void) store_acquireHandle (m_hImpl);
+ }
+
+ /** Conversion into Stream Handle.
+ */
+ inline operator storeStreamHandle (void) const SAL_THROW(())
+ {
+ return m_hImpl;
+ }
+
+ /** Check for a valid Stream Handle.
+ @return sal_True if valid, sal_False otherwise.
+ */
+ inline bool isValid (void) const SAL_THROW(())
+ {
+ return (m_hImpl != 0);
+ }
+
+ /** Open the stream.
+ @see store_openStream()
+ */
+ inline storeError create (
+ storeFileHandle hFile,
+ OUString const & rPath,
+ OUString const & rName,
+ storeAccessMode eMode) SAL_THROW(())
+ {
+ if (m_hImpl)
+ {
+ (void) store_releaseHandle (m_hImpl);
+ m_hImpl = 0;
+ }
+ return store_openStream (hFile, rPath.pData, rName.pData, eMode, &m_hImpl);
+ }
+
+ /** Close the stream.
+ @see store_closeStream()
+ */
+ inline void close (void) SAL_THROW(())
+ {
+ if (m_hImpl)
+ {
+ (void) store_closeStream (m_hImpl);
+ m_hImpl = 0;
+ }
+ }
+
+ /** Read from the stream.
+ @see store_readStream()
+ */
+ inline storeError readAt (
+ sal_uInt32 nOffset,
+ void * pBuffer,
+ sal_uInt32 nBytes,
+ sal_uInt32 & rnDone) SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_readStream (m_hImpl, nOffset, pBuffer, nBytes, &rnDone);
+ }
+
+ /** Write to the stream.
+ @see store_writeStream()
+ */
+ inline storeError writeAt (
+ sal_uInt32 nOffset,
+ void const * pBuffer,
+ sal_uInt32 nBytes,
+ sal_uInt32 & rnDone) SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_writeStream (m_hImpl, nOffset, pBuffer, nBytes, &rnDone);
+ }
+
+ /** Flush the stream.
+ @see store_flushStream()
+ */
+ inline storeError flush (void) const SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_flushStream (m_hImpl);
+ }
+
+ /** Get the stream size.
+ @see store_getStreamSize()
+ */
+ inline storeError getSize (sal_uInt32 & rnSize) const SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_getStreamSize (m_hImpl, &rnSize);
+ }
+
+ /** Set the stream size.
+ @see store_setStreamSize()
+ */
+ inline storeError setSize (sal_uInt32 nSize) SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_setStreamSize (m_hImpl, nSize);
+ }
+
+private:
+ /** Representation.
+ */
+ storeStreamHandle m_hImpl;
+};
+
+/*========================================================================
+ *
+ * OStoreDirectory interface.
+ *
+ *======================================================================*/
+class OStoreDirectory
+{
+public:
+ /** Construction.
+ */
+ inline OStoreDirectory (void) SAL_THROW(())
+ : m_hImpl (0)
+ {}
+
+ /** Destruction.
+ */
+ inline ~OStoreDirectory (void) SAL_THROW(())
+ {
+ if (m_hImpl)
+ (void) store_releaseHandle (m_hImpl);
+ }
+
+ /** Copy construction.
+ */
+ inline OStoreDirectory (OStoreDirectory const & rhs) SAL_THROW(())
+ : m_hImpl (rhs.m_hImpl)
+ {
+ if (m_hImpl)
+ (void) store_acquireHandle (m_hImpl);
+ }
+
+ /** Assignment.
+ */
+ inline OStoreDirectory & operator= (OStoreDirectory const & rhs) SAL_THROW(())
+ {
+ if (rhs.m_hImpl)
+ (void) store_acquireHandle (rhs.m_hImpl);
+ if (m_hImpl)
+ (void) store_releaseHandle (m_hImpl);
+ m_hImpl = rhs.m_hImpl;
+ return *this;
+ }
+
+ /** Construction from Directory Handle.
+ */
+ inline explicit OStoreDirectory (storeDirectoryHandle Handle) SAL_THROW(())
+ : m_hImpl (Handle)
+ {
+ if (m_hImpl)
+ (void) store_acquireHandle (m_hImpl);
+ }
+
+ /** Conversion into Directory Handle.
+ */
+ inline operator storeDirectoryHandle(void) const SAL_THROW(())
+ {
+ return m_hImpl;
+ }
+
+ /** Check for a valid Directory Handle.
+ @return sal_True if valid, sal_False otherwise.
+ */
+ inline bool isValid (void) const SAL_THROW(())
+ {
+ return (m_hImpl != 0);
+ }
+
+ /** Open the directory.
+ @see store_openDirectory()
+ */
+ inline storeError create (
+ storeFileHandle hFile,
+ OUString const & rPath,
+ OUString const & rName,
+ storeAccessMode eMode) SAL_THROW(())
+ {
+ if (m_hImpl)
+ {
+ (void) store_releaseHandle (m_hImpl);
+ m_hImpl = 0;
+ }
+ return store_openDirectory (hFile, rPath.pData, rName.pData, eMode, &m_hImpl);
+ }
+
+ /** Close the directory.
+ @see store_closeDirectory()
+ */
+ inline void close (void) SAL_THROW(())
+ {
+ if (m_hImpl)
+ {
+ (void) store_closeDirectory (m_hImpl);
+ m_hImpl = 0;
+ }
+ }
+
+ /** Directory iterator type.
+ @see first()
+ @see next()
+ */
+ typedef storeFindData iterator;
+
+ /** Find first directory entry.
+ @see store_findFirst()
+ */
+ inline storeError first (iterator& it) SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_findFirst (m_hImpl, &it);
+ }
+
+ /** Find next directory entry.
+ @see store_findNext()
+ */
+ inline storeError next (iterator& it) SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_findNext (m_hImpl, &it);
+ }
+
+ /** Directory traversal helper.
+ @see travel()
+ */
+ class traveller
+ {
+ public:
+ /** Directory traversal callback.
+ @param it [in] current directory entry.
+ @return sal_True to continue iteration, sal_False to stop.
+ */
+ virtual sal_Bool visit (const iterator& it) = 0;
+
+ protected:
+ ~traveller() {}
+ };
+
+ /** Directory traversal.
+ @see store_findFirst()
+ @see store_findNext()
+
+ @param rTraveller [in] the traversal callback.
+ @return store_E_NoMoreFiles upon end of iteration.
+ */
+ inline storeError travel (traveller & rTraveller) const
+ {
+ storeError eErrCode = store_E_InvalidHandle;
+ if (m_hImpl)
+ {
+ iterator it;
+ eErrCode = store_findFirst (m_hImpl, &it);
+ while ((eErrCode == store_E_None) && rTraveller.visit(it))
+ eErrCode = store_findNext (m_hImpl, &it);
+ }
+ return eErrCode;
+ }
+
+private:
+ /** Representation.
+ */
+ storeDirectoryHandle m_hImpl;
+};
+
+/*========================================================================
+ *
+ * OStoreFile interface.
+ *
+ *======================================================================*/
+class OStoreFile
+{
+public:
+ /** Construction.
+ */
+ inline OStoreFile (void) SAL_THROW(())
+ : m_hImpl (0)
+ {}
+
+ /** Destruction.
+ */
+ inline ~OStoreFile (void) SAL_THROW(())
+ {
+ if (m_hImpl)
+ (void) store_releaseHandle (m_hImpl);
+ }
+
+ /** Copy construction.
+ */
+ inline OStoreFile (OStoreFile const & rhs) SAL_THROW(())
+ : m_hImpl (rhs.m_hImpl)
+ {
+ if (m_hImpl)
+ (void) store_acquireHandle (m_hImpl);
+ }
+
+ /** Assignment.
+ */
+ inline OStoreFile & operator= (OStoreFile const & rhs) SAL_THROW(())
+ {
+ if (rhs.m_hImpl)
+ (void) store_acquireHandle (rhs.m_hImpl);
+ if (m_hImpl)
+ (void) store_releaseHandle (m_hImpl);
+ m_hImpl = rhs.m_hImpl;
+ return *this;
+ }
+
+ /** Construction from File Handle.
+ */
+ inline explicit OStoreFile (storeFileHandle Handle) SAL_THROW(())
+ : m_hImpl (Handle)
+ {
+ if (m_hImpl)
+ (void) store_acquireHandle (m_hImpl);
+ }
+
+ /** Conversion into File Handle.
+ */
+ inline operator storeFileHandle (void) const SAL_THROW(())
+ {
+ return m_hImpl;
+ }
+
+ /** Check for a valid File Handle.
+ @return sal_True if valid, sal_False otherwise.
+ */
+ inline bool isValid (void) const SAL_THROW(())
+ {
+ return (m_hImpl != 0);
+ }
+
+ /** Open the file.
+ @see store_openFile()
+ */
+ inline storeError create (
+ OUString const & rFilename,
+ storeAccessMode eAccessMode,
+ sal_uInt16 nPageSize = STORE_DEFAULT_PAGESIZE) SAL_THROW(())
+ {
+ if (m_hImpl)
+ {
+ (void) store_releaseHandle (m_hImpl);
+ m_hImpl = 0;
+ }
+ return store_openFile (rFilename.pData, eAccessMode, nPageSize, &m_hImpl);
+ }
+
+ /** Open the temporary file in memory.
+ @see store_createMemoryFile()
+ */
+ inline storeError createInMemory (
+ sal_uInt16 nPageSize = STORE_DEFAULT_PAGESIZE) SAL_THROW(())
+ {
+ if (m_hImpl)
+ {
+ (void) store_releaseHandle (m_hImpl);
+ m_hImpl = 0;
+ }
+ return store_createMemoryFile (nPageSize, &m_hImpl);
+ }
+
+ /** Close the file.
+ @see store_closeFile()
+ */
+ inline void close (void) SAL_THROW(())
+ {
+ if (m_hImpl)
+ {
+ (void) store_closeFile (m_hImpl);
+ m_hImpl = 0;
+ }
+ }
+
+ /** Flush the file.
+ @see store_flushFile()
+ */
+ inline storeError flush (void) const SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_flushFile (m_hImpl);
+ }
+
+ /** Get the number of referers to the file.
+ @see store_getFileRefererCount()
+ */
+ inline storeError getRefererCount (sal_uInt32 & rnRefCount) const SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_getFileRefererCount (m_hImpl, &rnRefCount);
+ }
+
+ /** Get the file size.
+ @see store_getFileSize()
+ */
+ inline storeError getSize (sal_uInt32 & rnSize) const SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_getFileSize (m_hImpl, &rnSize);
+ }
+
+ /** Set attributes of a file entry.
+ @see store_attrib()
+ */
+ inline storeError attrib (
+ OUString const & rPath,
+ OUString const & rName,
+ sal_uInt32 nMask1,
+ sal_uInt32 nMask2,
+ sal_uInt32 & rnAttrib) SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_attrib (m_hImpl, rPath.pData, rName.pData, nMask1, nMask2, &rnAttrib);
+ }
+
+ /** Set attributes of a file entry.
+ @see store_attrib()
+ */
+ inline storeError attrib (
+ OUString const & rPath,
+ OUString const & rName,
+ sal_uInt32 nMask1,
+ sal_uInt32 nMask2) SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_attrib (m_hImpl, rPath.pData, rName.pData, nMask1, nMask2, NULL);
+ }
+
+ /** Insert a file entry as 'hard link' to another file entry.
+ @see store_link()
+ */
+ inline storeError link (
+ OUString const & rSrcPath, OUString const & rSrcName,
+ OUString const & rDstPath, OUString const & rDstName) SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_link (
+ m_hImpl, rSrcPath.pData, rSrcName.pData, rDstPath.pData, rDstName.pData);
+ }
+
+ /** Insert a file entry as 'symbolic link' to another file entry.
+ @see store_symlink()
+ */
+ inline storeError symlink (
+ OUString const & rSrcPath, OUString const & rSrcName,
+ OUString const & rDstPath, OUString const & rDstName) SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_symlink (m_hImpl, rSrcPath.pData, rSrcName.pData, rDstPath.pData, rDstName.pData);
+ }
+
+ /** Rename a file entry.
+ @see store_rename()
+ */
+ inline storeError rename (
+ OUString const & rSrcPath, OUString const & rSrcName,
+ OUString const & rDstPath, OUString const & rDstName) SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_rename (m_hImpl, rSrcPath.pData, rSrcName.pData, rDstPath.pData, rDstName.pData);
+ }
+
+ /** Remove a file entry.
+ @see store_remove()
+ */
+ inline storeError remove (
+ OUString const & rPath, OUString const & rName) SAL_THROW(())
+ {
+ if (!m_hImpl)
+ return store_E_InvalidHandle;
+
+ return store_remove (m_hImpl, rPath.pData, rName.pData);
+ }
+
+private:
+ /** Representation.
+ */
+ storeFileHandle m_hImpl;
+};
+
+/*========================================================================
+ *
+ * The End.
+ *
+ *======================================================================*/
+
+} // namespace store
+
+#endif /* !_STORE_STORE_HXX_ */
+
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/store/storedllapi.h b/include/store/storedllapi.h
new file mode 100644
index 000000000000..0a4b27a333ca
--- /dev/null
+++ b/include/store/storedllapi.h
@@ -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_STOREDLLAPI_H
+#define INCLUDED_STOREDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(STORE_DLLIMPLEMENTATION)
+#define STORE_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define STORE_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif /* INCLUDED_STOREDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/store/types.h b/include/store/types.h
new file mode 100644
index 000000000000..0d51995348a0
--- /dev/null
+++ b/include/store/types.h
@@ -0,0 +1,160 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _STORE_TYPES_H_
+#define _STORE_TYPES_H_
+
+#include <sal/types.h>
+#include <rtl/ustring.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** PageSize (recommended) default.
+ @see store_openFile()
+ */
+#define STORE_DEFAULT_PAGESIZE ((sal_uInt16)0x0400)
+
+
+/** PageSize (enforced) limits.
+ @see store_openFile()
+ */
+#define STORE_MINIMUM_PAGESIZE ((sal_uInt16)0x0200)
+#define STORE_MAXIMUM_PAGESIZE ((sal_uInt16)0x8000)
+
+
+/** NameSize (enforced) limit.
+ @see any param pName
+ @see store_E_NameTooLong
+ */
+#define STORE_MAXIMUM_NAMESIZE 256
+
+
+/** Attributes (predefined).
+ @see store_attrib()
+ */
+#define STORE_ATTRIB_ISLINK ((sal_uInt32)0x10000000)
+#define STORE_ATTRIB_ISDIR ((sal_uInt32)0x20000000)
+#define STORE_ATTRIB_ISFILE ((sal_uInt32)0x40000000)
+
+
+/** Access Mode enumeration.
+ @see store_openFile()
+ @see store_openDirectory()
+ @see store_openStream()
+ */
+enum __store_AccessMode
+{
+ store_AccessCreate,
+ store_AccessReadCreate,
+ store_AccessReadWrite,
+ store_AccessReadOnly,
+ store_Access_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
+};
+
+/** Access Mode type.
+ */
+typedef enum __store_AccessMode storeAccessMode;
+
+
+/** Error Code enumeration.
+ */
+enum __store_Error
+{
+ store_E_None = 0,
+ store_E_AccessViolation,
+ store_E_LockingViolation,
+ store_E_CantSeek,
+ store_E_CantRead,
+ store_E_CantWrite,
+ store_E_InvalidAccess,
+ store_E_InvalidHandle,
+ store_E_InvalidParameter,
+ store_E_InvalidChecksum,
+ store_E_AlreadyExists,
+ store_E_NotExists,
+ store_E_NotDirectory,
+ store_E_NotFile,
+ store_E_NoMoreFiles,
+ store_E_NameTooLong,
+ store_E_OutOfMemory,
+ store_E_OutOfSpace,
+ store_E_Pending,
+ store_E_WrongFormat,
+ store_E_WrongVersion,
+ store_E_Unknown,
+ store_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
+};
+
+/** Error Code type.
+ */
+typedef enum __store_Error storeError;
+
+
+/** Find Data structure.
+ @see store_findFirst()
+ @see store_findNext()
+ */
+struct __store_FindData
+{
+ /** Name.
+ @see m_nLength
+ */
+ sal_Unicode m_pszName[STORE_MAXIMUM_NAMESIZE];
+
+ /** Name Length.
+ @see m_pszName
+ */
+ sal_Int32 m_nLength;
+
+ /** Attributes.
+ @see store_attrib()
+ */
+ sal_uInt32 m_nAttrib;
+
+ /** Size.
+ @see store_getStreamSize()
+ @see store_setStreamSize()
+ */
+ sal_uInt32 m_nSize;
+
+ /** Reserved for internal use.
+ */
+ sal_uInt32 m_nReserved;
+};
+
+/** Find Data type.
+ */
+typedef struct __store_FindData storeFindData;
+
+
+/*========================================================================
+ *
+ * The End.
+ *
+ *======================================================================*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _STORE_TYPES_H_ */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/PasswordHelper.hxx b/include/svl/PasswordHelper.hxx
new file mode 100644
index 000000000000..7204ebdc845b
--- /dev/null
+++ b/include/svl/PasswordHelper.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 _SVTOOLS_PASSWORDHELPER_HXX
+#define _SVTOOLS_PASSWORDHELPER_HXX
+
+#include "svl/svldllapi.h"
+#include "sal/types.h"
+#include "com/sun/star/uno/Sequence.hxx"
+
+class SvPasswordHelper
+{
+ static void GetHashPasswordLittleEndian(com::sun::star::uno::Sequence<sal_Int8>& rPassHash, const OUString& sPass);
+ static void GetHashPasswordBigEndian(com::sun::star::uno::Sequence<sal_Int8>& rPassHash, const OUString& sPass);
+
+public:
+ SVL_DLLPUBLIC static void GetHashPassword(com::sun::star::uno::Sequence <sal_Int8>& rPassHash, const sal_Char* pPass, sal_uInt32 nLen);
+
+ SVL_DLLPUBLIC static void GetHashPassword(com::sun::star::uno::Sequence<sal_Int8>& rPassHash, const OUString& sPass);
+ /**
+ Use this method to compare a given string with another given Hash value.
+ This is necessary, because in older versions exists different hashs of the same string. They were endian dependent.
+ We need this to handle old files. This method will compare against big and little endian. See #101326#
+ */
+ SVL_DLLPUBLIC static bool CompareHashPassword(const com::sun::star::uno::Sequence<sal_Int8>& rOldPassHash, const OUString& sNewPass);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/adrparse.hxx b/include/svl/adrparse.hxx
new file mode 100644
index 000000000000..063ba11a95a9
--- /dev/null
+++ b/include/svl/adrparse.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 _ADRPARSE_HXX
+#define _ADRPARSE_HXX
+
+#include "svl/svldllapi.h"
+#include <vector>
+
+//============================================================================
+struct SvAddressEntry_Impl
+{
+ OUString m_aAddrSpec;
+ OUString m_aRealName;
+
+ SvAddressEntry_Impl()
+ {
+ }
+
+ SvAddressEntry_Impl(const OUString& rTheAddrSpec,
+ const OUString& rTheRealName)
+ : m_aAddrSpec(rTheAddrSpec)
+ , m_aRealName(rTheRealName)
+ {
+ }
+};
+
+//============================================================================
+typedef ::std::vector< SvAddressEntry_Impl* > SvAddressList_Impl;
+
+//============================================================================
+class SVL_DLLPUBLIC SvAddressParser
+{
+ friend class SvAddressParser_Impl;
+
+ SvAddressEntry_Impl m_aFirst;
+ SvAddressList_Impl m_aRest;
+ bool m_bHasFirst;
+
+public:
+ SvAddressParser(const OUString& rInput);
+
+ ~SvAddressParser();
+
+ sal_Int32 Count() const { return m_bHasFirst ? m_aRest.size() + 1 : 0; }
+
+ const OUString& GetEmailAddress(sal_Int32 nIndex) const
+ {
+ return nIndex == 0 ? m_aFirst.m_aAddrSpec :
+ m_aRest[ nIndex - 1 ]->m_aAddrSpec;
+ }
+
+ const OUString& GetRealName(sal_Int32 nIndex) const
+ {
+ return nIndex == 0 ? m_aFirst.m_aRealName :
+ m_aRest[ nIndex - 1 ]->m_aRealName;
+ }
+};
+
+#endif // _ADRPARSE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/aeitem.hxx b/include/svl/aeitem.hxx
new file mode 100644
index 000000000000..7dd741592015
--- /dev/null
+++ b/include/svl/aeitem.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 _AEITEM_HXX
+#define _AEITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <svl/poolitem.hxx>
+#include <svl/eitem.hxx>
+#include <vector>
+
+class SfxAllEnumValueArr;
+
+class SVL_DLLPUBLIC SfxAllEnumItem: public SfxEnumItem
+{
+ SfxAllEnumValueArr* pValues;
+ std::vector<sal_uInt16>* pDisabledValues;
+
+protected:
+ sal_uInt16 _GetPosByValue( sal_uInt16 nValue ) const;
+
+public:
+ TYPEINFO();
+ SfxAllEnumItem();
+ explicit SfxAllEnumItem( sal_uInt16 nWhich);
+ SfxAllEnumItem( sal_uInt16 nWhich, sal_uInt16 nVal );
+ SfxAllEnumItem( sal_uInt16 nWhich, SvStream &rStream );
+ SfxAllEnumItem( const SfxAllEnumItem & );
+ ~SfxAllEnumItem();
+
+ void InsertValue( sal_uInt16 nValue );
+ void InsertValue( sal_uInt16 nValue, const OUString &rText );
+ void RemoveValue( sal_uInt16 nValue );
+
+ sal_uInt16 GetPosByValue( sal_uInt16 nValue ) const;
+
+ virtual sal_uInt16 GetValueCount() const;
+ virtual sal_uInt16 GetValueByPos( sal_uInt16 nPos ) const;
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const;
+ virtual sal_Bool IsEnabled( sal_uInt16 ) const;
+ void DisableValue( sal_uInt16 );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/asiancfg.hxx b/include/svl/asiancfg.hxx
new file mode 100644
index 000000000000..622b1f8ff277
--- /dev/null
+++ b/include/svl/asiancfg.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_SVL_ASIANCFG_HXX
+#define INCLUDED_SVL_ASIANCFG_HXX
+
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "boost/scoped_ptr.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "sal/types.h"
+#include "svl/svldllapi.h"
+
+namespace com { namespace sun { namespace star { namespace lang {
+ struct Locale;
+} } } }
+
+class SVL_DLLPUBLIC SvxAsianConfig: private boost::noncopyable {
+public:
+ SvxAsianConfig();
+
+ ~SvxAsianConfig();
+
+ void Commit();
+
+ bool IsKerningWesternTextOnly() const;
+
+ void SetKerningWesternTextOnly(bool value);
+
+ sal_Int16 GetCharDistanceCompression() const;
+
+ void SetCharDistanceCompression(sal_Int16 value);
+
+ com::sun::star::uno::Sequence< com::sun::star::lang::Locale >
+ GetStartEndCharLocales() const;
+
+ bool GetStartEndChars(
+ com::sun::star::lang::Locale const & locale, OUString & startChars,
+ OUString & endChars) const;
+
+ void SetStartEndChars(
+ com::sun::star::lang::Locale const & locale,
+ OUString const * startChars, OUString const * endChars);
+
+private:
+ struct Impl;
+
+ boost::scoped_ptr< Impl > impl_;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/brdcst.hxx b/include/svl/brdcst.hxx
new file mode 100644
index 000000000000..258cf6066e58
--- /dev/null
+++ b/include/svl/brdcst.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 _SFXBRDCST_HXX
+#define _SFXBRDCST_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/rtti.hxx>
+#include <vector>
+
+class SfxListener;
+class SfxHint;
+
+//-------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxBroadcaster
+{
+ friend class SfxListener;
+ typedef std::vector<SfxListener*> SfxListenerArr_Impl;
+
+ SfxListenerArr_Impl m_Listeners;
+
+private:
+ void AddListener( SfxListener& rListener );
+ void RemoveListener( SfxListener& rListener );
+ const SfxBroadcaster& operator=(const SfxBroadcaster &); // verboten
+
+protected:
+ void Forward(SfxBroadcaster& rBC, const SfxHint& rHint);
+ virtual void ListenersGone();
+
+public:
+ TYPEINFO();
+
+ SfxBroadcaster();
+ SfxBroadcaster( const SfxBroadcaster &rBC );
+ virtual ~SfxBroadcaster();
+
+ void Broadcast( const SfxHint &rHint );
+ bool HasListeners() const;
+ size_t GetListenerCount() const
+ {
+ return m_Listeners.size();
+ }
+ SfxListener* GetListener( sal_uInt16 nNo ) const
+ {
+ return m_Listeners[nNo];
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/broadcast.hxx b/include/svl/broadcast.hxx
new file mode 100644
index 000000000000..ac2931986914
--- /dev/null
+++ b/include/svl/broadcast.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 _SVT_BROADCAST_HXX
+#define _SVT_BROADCAST_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/rtti.hxx>
+
+class SvtListener;
+class SfxHint;
+class SvtListenerBase;
+
+//-------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SvtBroadcaster
+{
+friend class SvtListener;
+friend class SvtListenerBase;
+friend class SvtListenerIter;
+ SvtListenerBase* pRoot;
+
+ const SvtBroadcaster& operator=(const SvtBroadcaster &); // verboten
+
+protected:
+ virtual void ListenersGone();
+
+public:
+ TYPEINFO();
+
+ SvtBroadcaster();
+ SvtBroadcaster( const SvtBroadcaster &rBC );
+ virtual ~SvtBroadcaster();
+
+ void Broadcast( const SfxHint &rHint );
+
+ sal_Bool HasListeners() const { return 0 != pRoot; }
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/cenumitm.hxx b/include/svl/cenumitm.hxx
new file mode 100644
index 000000000000..35024c3a6d44
--- /dev/null
+++ b/include/svl/cenumitm.hxx
@@ -0,0 +1,170 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVTOOLS_CENUMITM_HXX
+#define _SVTOOLS_CENUMITM_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/debug.hxx>
+#include <svl/poolitem.hxx>
+
+//============================================================================
+DBG_NAMEEX(SfxEnumItemInterface)
+
+class SVL_DLLPUBLIC SfxEnumItemInterface: public SfxPoolItem
+{
+protected:
+ explicit SfxEnumItemInterface(sal_uInt16 which): SfxPoolItem(which) {}
+
+ SfxEnumItemInterface(const SfxEnumItemInterface & rItem):
+ SfxPoolItem(rItem) {}
+
+public:
+ TYPEINFO();
+
+ virtual int operator ==(const SfxPoolItem & rItem) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
+ SfxMapUnit, SfxMapUnit,
+ OUString & rText,
+ const IntlWrapper * = 0)
+ const;
+
+ virtual bool QueryValue(com::sun::star::uno::Any & rVal, sal_uInt8 = 0) const;
+
+ virtual bool PutValue(const com::sun::star::uno::Any & rVal, sal_uInt8 = 0);
+
+ virtual sal_uInt16 GetValueCount() const = 0;
+
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+
+ virtual sal_uInt16 GetValueByPos(sal_uInt16 nPos) const;
+
+ /// Return the position of some value within this enumeration.
+ ///
+ /// @descr This method is implemented using GetValueCount() and
+ /// GetValueByPos(). Derived classes may replace this with a more
+ /// efficient implementation.
+ ///
+ /// @param nValue Some value.
+ ///
+ /// @return The position of nValue within this enumeration, or USHRT_MAX
+ /// if not included.
+ virtual sal_uInt16 GetPosByValue(sal_uInt16 nValue) const;
+
+ virtual sal_Bool IsEnabled(sal_uInt16 nValue) const;
+
+ virtual sal_uInt16 GetEnumValue() const = 0;
+
+ virtual void SetEnumValue(sal_uInt16 nValue) = 0;
+
+ virtual int HasBoolValue() const;
+
+ virtual sal_Bool GetBoolValue() const;
+
+ virtual void SetBoolValue(sal_Bool bValue);
+};
+
+//============================================================================
+DBG_NAMEEX(CntEnumItem)
+
+class SVL_DLLPUBLIC CntEnumItem: public SfxEnumItemInterface
+{
+ sal_uInt16 m_nValue;
+
+protected:
+ explicit CntEnumItem(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0):
+ SfxEnumItemInterface(which), m_nValue(nTheValue) {}
+
+ CntEnumItem(sal_uInt16 which, SvStream & rStream);
+
+ CntEnumItem(const CntEnumItem & rItem):
+ SfxEnumItemInterface(rItem), m_nValue(rItem.m_nValue) {}
+
+public:
+ TYPEINFO();
+
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
+
+ virtual sal_uInt16 GetEnumValue() const;
+
+ virtual void SetEnumValue(sal_uInt16 nTheValue);
+
+ sal_uInt16 GetValue() const { return m_nValue; }
+
+ inline void SetValue(sal_uInt16 nTheValue);
+};
+
+inline void CntEnumItem::SetValue(sal_uInt16 nTheValue)
+{
+ DBG_ASSERT(GetRefCount() == 0, "CntEnumItem::SetValue(): Pooled item");
+ m_nValue = nTheValue;
+}
+
+//============================================================================
+DBG_NAMEEX(CntBoolItem)
+
+class SVL_DLLPUBLIC CntBoolItem: public SfxPoolItem
+{
+ sal_Bool m_bValue;
+
+public:
+ TYPEINFO();
+
+ explicit CntBoolItem(sal_uInt16 which = 0, sal_Bool bTheValue = sal_False):
+ SfxPoolItem(which), m_bValue(bTheValue) {}
+
+ CntBoolItem(sal_uInt16 nWhich, SvStream & rStream);
+
+ CntBoolItem(const CntBoolItem & rItem):
+ SfxPoolItem(rItem), m_bValue(rItem.m_bValue) {}
+
+ virtual int operator ==(const SfxPoolItem & rItem) const;
+
+ using SfxPoolItem::Compare;
+ virtual int Compare(const SfxPoolItem & rWith) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
+ SfxMapUnit, SfxMapUnit,
+ OUString & rText,
+ const IntlWrapper * = 0)
+ const;
+
+ virtual bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 = 0) const;
+
+ virtual bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 = 0);
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
+
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
+
+ virtual sal_uInt16 GetValueCount() const;
+
+ virtual OUString GetValueTextByVal(sal_Bool bTheValue) const;
+
+ sal_Bool GetValue() const { return m_bValue; }
+
+ void SetValue(sal_Bool bTheValue) { m_bValue = bTheValue; }
+};
+
+#endif // _SVTOOLS_CENUMITM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/cintitem.hxx b/include/svl/cintitem.hxx
new file mode 100644
index 000000000000..e781ada09a35
--- /dev/null
+++ b/include/svl/cintitem.hxx
@@ -0,0 +1,274 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVTOOLS_CINTITEM_HXX
+#define _SVTOOLS_CINTITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/debug.hxx>
+#include <svl/poolitem.hxx>
+
+//============================================================================
+DBG_NAMEEX_VISIBILITY(CntByteItem, SVL_DLLPUBLIC)
+
+class SVL_DLLPUBLIC CntByteItem: public SfxPoolItem
+{
+ sal_uInt8 m_nValue;
+
+public:
+ TYPEINFO();
+
+ CntByteItem(sal_uInt16 which = 0, sal_uInt8 nTheValue = 0):
+ SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntByteItem, 0); }
+
+ CntByteItem(const CntByteItem & rItem):
+ SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
+ { DBG_CTOR(CntByteItem, 0); }
+
+ virtual ~CntByteItem() { DBG_DTOR(CntByteItem, 0); }
+
+ virtual int operator ==(const SfxPoolItem & rItem) const;
+
+ using SfxPoolItem::Compare;
+ virtual int Compare(const SfxPoolItem & rWith) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
+ SfxMapUnit, SfxMapUnit,
+ OUString & rText,
+ const IntlWrapper * = 0)
+ const;
+
+ virtual bool QueryValue(com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0) const;
+
+ virtual bool PutValue(const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0);
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
+
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
+
+ virtual sal_uInt8 GetMin() const;
+
+ virtual sal_uInt8 GetMax() const;
+
+ virtual SfxFieldUnit GetUnit() const;
+
+ sal_uInt8 GetValue() const { return m_nValue; }
+
+ inline void SetValue(sal_uInt8 nTheValue);
+};
+
+inline void CntByteItem::SetValue(sal_uInt8 nTheValue)
+{
+ DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item");
+ m_nValue = nTheValue;
+}
+
+//============================================================================
+DBG_NAMEEX_VISIBILITY(CntUInt16Item, SVL_DLLPUBLIC)
+
+class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem
+{
+ sal_uInt16 m_nValue;
+
+public:
+ TYPEINFO();
+
+ CntUInt16Item(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0):
+ SfxPoolItem(which), m_nValue(nTheValue)
+ { DBG_CTOR(CntUInt16Item, 0); }
+
+ CntUInt16Item(sal_uInt16 which, SvStream & rStream);
+
+ CntUInt16Item(const CntUInt16Item & rItem):
+ SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
+ { DBG_CTOR(CntUInt16Item, 0); }
+
+ virtual ~CntUInt16Item() { DBG_DTOR(CntUInt16Item, 0); }
+
+ virtual int operator ==(const SfxPoolItem & rItem) const;
+
+ using SfxPoolItem::Compare;
+ virtual int Compare(const SfxPoolItem & rWith) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
+ SfxMapUnit, SfxMapUnit,
+ OUString & rText,
+ const IntlWrapper * = 0)
+ const;
+
+ virtual bool QueryValue(com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0) const;
+
+ virtual bool PutValue(const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0);
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
+
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
+
+ virtual sal_uInt16 GetMin() const;
+
+ virtual sal_uInt16 GetMax() const;
+
+ virtual SfxFieldUnit GetUnit() const;
+
+ sal_uInt16 GetValue() const { return m_nValue; }
+
+ inline void SetValue(sal_uInt16 nTheValue);
+};
+
+inline void CntUInt16Item::SetValue(sal_uInt16 nTheValue)
+{
+ DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item");
+ m_nValue = nTheValue;
+}
+
+//============================================================================
+DBG_NAMEEX_VISIBILITY(CntInt32Item, SVL_DLLPUBLIC)
+
+class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem
+{
+ sal_Int32 m_nValue;
+
+public:
+ TYPEINFO();
+
+ CntInt32Item(sal_uInt16 which = 0, sal_Int32 nTheValue = 0):
+ SfxPoolItem(which), m_nValue(nTheValue)
+ { DBG_CTOR(CntInt32Item, 0); }
+
+ CntInt32Item(sal_uInt16 which, SvStream & rStream);
+
+ CntInt32Item(const CntInt32Item & rItem):
+ SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
+ { DBG_CTOR(CntInt32Item, 0); }
+
+ virtual ~CntInt32Item() { DBG_DTOR(CntInt32Item, 0); }
+
+ virtual int operator ==(const SfxPoolItem & rItem) const;
+
+ using SfxPoolItem::Compare;
+ virtual int Compare(const SfxPoolItem & rWith) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
+ SfxMapUnit, SfxMapUnit,
+ OUString & rText,
+ const IntlWrapper * = 0)
+ const;
+
+ virtual bool QueryValue(com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0) const;
+
+ virtual bool PutValue(const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0);
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
+
+ virtual SvStream & Store(SvStream &, sal_uInt16) const;
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
+
+ virtual sal_Int32 GetMin() const;
+
+ virtual sal_Int32 GetMax() const;
+
+ virtual SfxFieldUnit GetUnit() const;
+
+ sal_Int32 GetValue() const { return m_nValue; }
+
+ inline void SetValue(sal_Int32 nTheValue);
+};
+
+inline void CntInt32Item::SetValue(sal_Int32 nTheValue)
+{
+ DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item");
+ m_nValue = nTheValue;
+}
+
+//============================================================================
+DBG_NAMEEX_VISIBILITY(CntUInt32Item, SVL_DLLPUBLIC)
+
+class SVL_DLLPUBLIC CntUInt32Item: public SfxPoolItem
+{
+ sal_uInt32 m_nValue;
+
+public:
+ TYPEINFO();
+
+ CntUInt32Item(sal_uInt16 which = 0, sal_uInt32 nTheValue = 0):
+ SfxPoolItem(which), m_nValue(nTheValue)
+ { DBG_CTOR(CntUInt32Item, 0); }
+
+ CntUInt32Item(sal_uInt16 nWhich, SvStream & rStream);
+
+ CntUInt32Item(const CntUInt32Item & rItem):
+ SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
+ { DBG_CTOR(CntUInt32Item, 0); }
+
+ virtual ~CntUInt32Item() { DBG_DTOR(CntUInt32Item, 0); }
+
+ virtual int operator ==(const SfxPoolItem & rItem) const;
+
+ using SfxPoolItem::Compare;
+ virtual int Compare(const SfxPoolItem & rWith) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
+ SfxMapUnit, SfxMapUnit,
+ OUString & rText,
+ const IntlWrapper * = 0)
+ const;
+
+ virtual bool QueryValue(com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0) const;
+
+ virtual bool PutValue(const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0);
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
+
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
+
+ virtual sal_uInt32 GetMin() const;
+
+ virtual sal_uInt32 GetMax() const;
+
+ virtual SfxFieldUnit GetUnit() const;
+
+ sal_uInt32 GetValue() const { return m_nValue; }
+
+ inline void SetValue(sal_uInt32 nTheValue);
+};
+
+inline void CntUInt32Item::SetValue(sal_uInt32 nTheValue)
+{
+ DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item");
+ m_nValue = nTheValue;
+}
+
+#endif // _SVTOOLS_CINTITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/cjkoptions.hxx b/include/svl/cjkoptions.hxx
new file mode 100644
index 000000000000..22055e404b42
--- /dev/null
+++ b/include/svl/cjkoptions.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 _SVTOOLS_CJKOPTIONS_HXX
+#define _SVTOOLS_CJKOPTIONS_HXX
+
+#include "svl/svldllapi.h"
+#include <sal/types.h>
+#include <unotools/options.hxx>
+
+class SvtCJKOptions_Impl;
+
+// class SvtCJKOptions --------------------------------------------------
+
+class SVL_DLLPUBLIC SvtCJKOptions: public utl::detail::Options
+{
+private:
+ SvtCJKOptions_Impl* pImp;
+
+public:
+
+ enum EOption
+ {
+ E_CJKFONT,
+ E_VERTICALTEXT,
+ E_ASIANTYPOGRAPHY,
+ E_JAPANESEFIND,
+ E_RUBY,
+ E_CHANGECASEMAP,
+ E_DOUBLELINES,
+ E_EMPHASISMARKS,
+ E_VERTICALCALLOUT,
+ E_ALL // special one for IsAnyEnabled()/SetAll() functionality
+ };
+
+ // bDontLoad is for referencing purposes only
+ SvtCJKOptions(sal_Bool bDontLoad = sal_False);
+ virtual ~SvtCJKOptions();
+
+ sal_Bool IsCJKFontEnabled() const;
+ sal_Bool IsVerticalTextEnabled() const;
+ sal_Bool IsAsianTypographyEnabled() const;
+ sal_Bool IsJapaneseFindEnabled() const;
+ sal_Bool IsRubyEnabled() const;
+ sal_Bool IsChangeCaseMapEnabled() const;
+ sal_Bool IsDoubleLinesEnabled() const;
+
+ void SetAll(sal_Bool bSet);
+ sal_Bool IsAnyEnabled() const;
+ sal_Bool IsReadOnly(EOption eOption) const;
+};
+
+#endif // _SVTOOLS_CJKOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/cntwall.hxx b/include/svl/cntwall.hxx
new file mode 100644
index 000000000000..581c558b2575
--- /dev/null
+++ b/include/svl/cntwall.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 _CNTWALL_HXX
+#define _CNTWALL_HXX
+
+#include "svl/svldllapi.h"
+
+#include <tools/shl.hxx>
+#include <tools/rtti.hxx>
+#include <tools/color.hxx>
+#include <svl/poolitem.hxx>
+
+class SvStream;
+
+class SVL_DLLPUBLIC CntWallpaperItem : public SfxPoolItem
+{
+private:
+ OUString _aURL;
+ Color _nColor;
+ sal_uInt16 _nStyle;
+
+public:
+ TYPEINFO();
+
+ CntWallpaperItem( sal_uInt16 nWhich );
+ CntWallpaperItem( sal_uInt16 nWhich, SvStream& rStream, sal_uInt16 nVersion );
+ CntWallpaperItem( const CntWallpaperItem& rCpy );
+ ~CntWallpaperItem();
+
+ virtual sal_uInt16 GetVersion(sal_uInt16) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItemVersion ) const;
+ virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 );
+
+ void SetBitmapURL( const OUString& rURL ) { _aURL = rURL; }
+ void SetColor( Color nColor ) { _nColor = nColor; }
+ void SetStyle( sal_uInt16 nStyle ) { _nStyle = nStyle; }
+
+ const OUString& GetBitmapURL() const { return _aURL; }
+ Color GetColor() const { return _nColor; }
+ sal_uInt16 GetStyle() const { return _nStyle; }
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
+#endif // _CNTWALL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/cntwids.hrc b/include/svl/cntwids.hrc
new file mode 100644
index 000000000000..68a9b3ab3ee5
--- /dev/null
+++ b/include/svl/cntwids.hrc
@@ -0,0 +1,208 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CNTWIDS_HRC
+#define _CNTWIDS_HRC
+
+//=========================================================================
+// ARGS, MSG, ALL, FOLDER, BOXALL, BOXEXT
+//=========================================================================
+
+#define WID_CHAOS_START 500
+
+//PROP MSG
+#define WID_PRIORITY (WID_CHAOS_START + 15)
+#define WID_REPLY_TO (WID_CHAOS_START + 19)
+#define WID_IN_REPLY_TO (WID_CHAOS_START + 20)
+
+#define WID_MESSAGE_ID (WID_CHAOS_START + 21)
+#define WID_BCC (WID_CHAOS_START + 22)
+#define WID_CC (WID_CHAOS_START + 23)
+#define WID_TO (WID_CHAOS_START + 24)
+#define WID_FROM (WID_CHAOS_START + 25)
+#define WID_TITLE (WID_CHAOS_START + 26)
+#define WID_MESSAGEBODY (WID_CHAOS_START + 27)
+
+#define WID_REFERENCES (WID_CHAOS_START + 28)
+#define WID_NEWSGROUPS (WID_CHAOS_START + 29)
+#define WID_NEWS_XREFLIST (WID_CHAOS_START + 30)
+
+#define WID_OUTMSGINTERNALSTATE (WID_CHAOS_START + 31)
+#define WID_RECIPIENTLIST (WID_CHAOS_START + 32)
+
+//PROP ALL
+#define WID_CONTENT_TYPE (WID_CHAOS_START + 44)
+
+#define WID_OWN_URL (WID_CHAOS_START + 45)
+#define WID_REAL_URL (WID_CHAOS_START + 46)
+#define WID_FLAG_READONLY (WID_CHAOS_START + 48)
+
+#define WID_FLAG_IS_FOLDER (WID_CHAOS_START + 51)
+#define WID_FLAG_HAS_FOLDER (WID_CHAOS_START + 52)
+#define WID_FLAG_IS_MESSAGE (WID_CHAOS_START + 53)
+#define WID_FLAG_HAS_MESSAGES (WID_CHAOS_START + 54)
+
+#define WID_DATE_CREATED (WID_CHAOS_START + 55)
+#define WID_DATE_MODIFIED (WID_CHAOS_START + 56)
+#define WID_IS_READ (WID_CHAOS_START + 58)
+#define WID_IS_MARKED (WID_CHAOS_START + 59)
+
+//PROP FOLDER VIEW
+#define WID_THREADING (WID_CHAOS_START + 66)
+#define WID_FOLDERVIEW_MODE (WID_CHAOS_START + 69)
+#define WID_MESSAGEVIEW_MODE (WID_CHAOS_START + 70)
+#define WID_SENTMESSAGEVIEW_MODE (WID_CHAOS_START + 71)
+#define WID_THREADED (WID_CHAOS_START + 73)
+#define WID_RULES (WID_CHAOS_START + 75)
+#define WID_SUBSCRNEWSGROUPCOUNT (WID_CHAOS_START + 76)
+#define WID_FLAG_SUBSCRIBED (WID_CHAOS_START + 77)
+
+//PROP FOLDER DIR
+#define WID_TOTALCONTENTCOUNT (WID_CHAOS_START + 80)
+
+//PROP FOLDER USER
+#define WID_SEENCONTENTCOUNT (WID_CHAOS_START + 86)
+
+//PROP BOXALL
+#define WID_USERNAME (WID_CHAOS_START + 91)
+#define WID_PASSWORD (WID_CHAOS_START + 92)
+#define WID_SERVERNAME (WID_CHAOS_START + 93)
+#define WID_SERVERPORT (WID_CHAOS_START + 94)
+#define WID_SERVERBASE (WID_CHAOS_START + 101)
+
+// -> ..._DEFAULT
+
+#define WID_AUTOUPDATE_INTERVAL (WID_CHAOS_START + 105)
+#define WID_UPDATE_ENABLED (WID_CHAOS_START + 106)
+
+//PROP BOX RNMGR
+#define WID_CONNECTION_MODE (WID_CHAOS_START + 107)
+#define WID_MESSAGE_STOREMODE (WID_CHAOS_START + 109)
+#define WID_DELETE_ON_SERVER (WID_CHAOS_START + 110)
+
+//////////////////////////////////////////////////////////////////////////
+// MISC - Added after initial pool version
+//////////////////////////////////////////////////////////////////////////
+
+// PROP FOLDER
+#define WID_SHOW_MSGS_HAS_TIMELIMIT (WID_CHAOS_START + 121)
+#define WID_SHOW_MSGS_TIMELIMIT (WID_CHAOS_START + 122)
+#define WID_STORE_MSGS_HAS_TIMELIMIT (WID_CHAOS_START + 123)
+#define WID_STORE_MSGS_TIMELIMIT (WID_CHAOS_START + 124)
+
+//////////////////////////////////////////////////////////////////////////
+// WIDs added after SO 4.0 release
+//////////////////////////////////////////////////////////////////////////
+
+// PROP BOXALL
+#define WID_SEND_PUBLIC_PROT_ID (WID_CHAOS_START + 127)
+#define WID_SEND_PRIVATE_PROT_ID (WID_CHAOS_START + 128)
+#define WID_SEND_PUBLIC_OUTBOXPROPS (WID_CHAOS_START + 129)
+#define WID_SEND_PRIVATE_OUTBOXPROPS (WID_CHAOS_START + 130)
+#define WID_SEND_SERVERNAME (WID_CHAOS_START + 131)
+#define WID_SEND_USERNAME (WID_CHAOS_START + 132)
+#define WID_SEND_PASSWORD (WID_CHAOS_START + 133)
+#define WID_SEND_REPLY_TO_DEFAULT (WID_CHAOS_START + 134)
+#define WID_SEND_FROM_DEFAULT (WID_CHAOS_START + 135)
+#define WID_VIM_POPATH (WID_CHAOS_START + 136)
+#define WID_SEND_VIM_POPATH (WID_CHAOS_START + 137)
+#define WID_LOCALBASE (WID_CHAOS_START + 142)
+
+// PROP DOCUMENT
+#define WID_DOCUMENT_HEADER (WID_CHAOS_START + 143)
+#define WID_DOCUMENT_BODY (WID_CHAOS_START + 144)
+#define WID_DOCUMENT_SIZE (WID_CHAOS_START + 145)
+
+// PROP FSYS
+#define WID_FSYS_DISKSPACE_LEFT (WID_CHAOS_START + 148)
+
+// PROP ALL
+#define WID_KEYWORDS (WID_CHAOS_START + 150)
+
+// PROP SEARCH
+#define WID_SEARCH_CRITERIA (WID_CHAOS_START + 152)
+#define WID_SEARCH_LOCATIONS (WID_CHAOS_START + 153)
+#define WID_SEARCH_RECURSIVE (WID_CHAOS_START + 154)
+
+// PROP Channel
+#define WID_TARGET_URL (WID_CHAOS_START + 159)
+
+// PROP HTTP
+#define WID_HTTP_CONNECTION_LIMIT (WID_CHAOS_START + 161)
+
+// PROP BOXALL
+#define WID_ACCOUNT (WID_CHAOS_START + 172)
+
+// PROP FSYS
+#define WID_FSYS_FLAGS (WID_CHAOS_START + 174)
+
+// PROP FSYS
+#define WID_WHO_IS_MASTER (WID_CHAOS_START + 176)
+
+// PROP ALL
+#define WID_SIZE_LIMIT (WID_CHAOS_START + 179)
+
+// PROP FOLDER
+#define WID_MARKED_DOCUMENT_COUNT (WID_CHAOS_START + 180)
+#define WID_FOLDER_COUNT (WID_CHAOS_START + 181)
+
+// TRASHCAN
+#define WID_TRASHCAN_FLAG_AUTODELETE (WID_CHAOS_START + 184)
+#define WID_TRASHCAN_FLAG_CONFIRMEMPTY (WID_CHAOS_START + 185)
+
+// TRASH
+#define WID_TRASH_ORIGIN (WID_CHAOS_START + 189)
+
+// PROP ALL
+#define WID_TARGET_FRAMES (WID_CHAOS_START + 191)
+
+// PROP ALL
+#define WID_FLAG_UPDATE_ON_OPEN (WID_CHAOS_START + 213)
+
+// PROP HTTP
+#define WID_HTTP_KEEP_EXPIRED (WID_CHAOS_START + 220)
+#define WID_HTTP_VERIFY_MODE (WID_CHAOS_START + 221)
+#define WID_HTTP_NOCACHE_LIST (WID_CHAOS_START + 222)
+#define WID_HTTP_REFERER (WID_CHAOS_START + 223)
+
+// PROP HTTP
+#define WID_HTTP_COOKIE (WID_CHAOS_START + 231)
+
+//////////////////////////////////////////////////////////////////////////
+// WIDs added after SO 5.0 release
+//////////////////////////////////////////////////////////////////////////
+
+// PROP FOLDER
+#define WID_USER_SORT_CRITERIUM (WID_CHAOS_START + 233)
+
+// PROP FTP
+#define WID_FTP_ACCOUNT (WID_CHAOS_START + 243)
+
+// PROP SEARCH
+#define WID_SEARCH_INDIRECTIONS (WID_CHAOS_START + 250)
+
+// PROP ALL
+#define WID_SEND_FORMATS (WID_CHAOS_START + 251)
+#define WID_SEND_COPY_TARGET (WID_CHAOS_START + 252)
+
+// END
+
+#endif /* !_CNTWIDS_HRC */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/converter.hxx b/include/svl/converter.hxx
new file mode 100644
index 000000000000..8f423f786307
--- /dev/null
+++ b/include/svl/converter.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 _SV_CONVERTER_HXX_
+#define _SV_CONVERTER_HXX_
+
+#include "svl/svldllapi.h"
+#include <tools/solar.h>
+
+class SvDbaseConverter
+{
+public:
+ SVL_DLLPUBLIC static sal_Int32 ConvertPrecisionToDbase(sal_Int32 _nLen, sal_Int32 _nScale);
+ SVL_DLLPUBLIC static sal_Int32 ConvertPrecisionToOdbc(sal_Int32 _nLen, sal_Int32 _nScale);
+};
+
+#endif //_CONVERTER_HXX_
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/ctloptions.hxx b/include/svl/ctloptions.hxx
new file mode 100644
index 000000000000..525e8e73a795
--- /dev/null
+++ b/include/svl/ctloptions.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 _SVTOOLS_CTLOPTIONS_HXX
+#define _SVTOOLS_CTLOPTIONS_HXX
+
+#include "svl/svldllapi.h"
+#include <sal/types.h>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <unotools/options.hxx>
+
+class SvtCTLOptions_Impl;
+
+// class SvtCTLOptions --------------------------------------------------------
+
+class SVL_DLLPUBLIC SvtCTLOptions : public utl::detail::Options
+{
+private:
+ SvtCTLOptions_Impl* m_pImp;
+
+public:
+
+ // bDontLoad is for referencing purposes only
+ SvtCTLOptions( bool bDontLoad = false );
+ virtual ~SvtCTLOptions();
+
+ void SetCTLFontEnabled( bool _bEnabled );
+ bool IsCTLFontEnabled() const;
+
+ void SetCTLSequenceChecking( bool _bEnabled );
+ bool IsCTLSequenceChecking() const;
+
+ void SetCTLSequenceCheckingRestricted( bool _bEnable );
+ bool IsCTLSequenceCheckingRestricted( void ) const;
+
+ void SetCTLSequenceCheckingTypeAndReplace( bool _bEnable );
+ bool IsCTLSequenceCheckingTypeAndReplace() const;
+
+ enum CursorMovement
+ {
+ MOVEMENT_LOGICAL = 0,
+ MOVEMENT_VISUAL
+ };
+ void SetCTLCursorMovement( CursorMovement _eMovement );
+ CursorMovement GetCTLCursorMovement() const;
+
+ enum TextNumerals
+ {
+ NUMERALS_ARABIC = 0,
+ NUMERALS_HINDI,
+ NUMERALS_SYSTEM,
+ NUMERALS_CONTEXT
+ };
+ void SetCTLTextNumerals( TextNumerals _eNumerals );
+ TextNumerals GetCTLTextNumerals() const;
+
+ enum EOption
+ {
+ E_CTLFONT,
+ E_CTLSEQUENCECHECKING,
+ E_CTLCURSORMOVEMENT,
+ E_CTLTEXTNUMERALS,
+ E_CTLSEQUENCECHECKINGRESTRICTED,
+ E_CTLSEQUENCECHECKINGTYPEANDREPLACE
+ };
+ bool IsReadOnly(EOption eOption) const;
+};
+
+#endif // _SVTOOLS_CTLOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/ctypeitm.hxx b/include/svl/ctypeitm.hxx
new file mode 100644
index 000000000000..1a783bca78d8
--- /dev/null
+++ b/include/svl/ctypeitm.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 _SVTOOLS_CTYPEITM_HXX
+#define _SVTOOLS_CTYPEITM_HXX
+
+#include <svl/inettype.hxx>
+#include <svl/custritm.hxx>
+
+//=========================================================================
+
+class CntContentTypeItem : public CntUnencodedStringItem
+{
+private:
+ INetContentType _eType;
+ OUString _aPresentation;
+
+public:
+ TYPEINFO();
+
+ CntContentTypeItem();
+ CntContentTypeItem( sal_uInt16 nWhich, const OUString& rType );
+ CntContentTypeItem( const CntContentTypeItem& rOrig );
+
+ virtual SfxPoolItem* Create( SvStream& rStream,
+ sal_uInt16 nItemVersion ) const;
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
+
+ virtual int operator==( const SfxPoolItem& rOrig ) const;
+
+ virtual sal_uInt16 GetVersion(sal_uInt16) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = NULL ) const;
+
+ void SetValue( const OUString& rNewVal );
+
+ using SfxPoolItem::Compare;
+ virtual int Compare( const SfxPoolItem &rWith, const IntlWrapper& rIntlWrapper ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString & rText,
+ const IntlWrapper* pIntlWrapper = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0);
+
+ INetContentType GetEnumValue() const;
+
+ void SetValue( const INetContentType eType );
+};
+
+#endif /* !_SVTOOLS_CTYPEITM_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/custritm.hxx b/include/svl/custritm.hxx
new file mode 100644
index 000000000000..70948d8fbf43
--- /dev/null
+++ b/include/svl/custritm.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 _SVTOOLS_CUSTRITM_HXX
+#define _SVTOOLS_CUSTRITM_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/debug.hxx>
+#include <svl/poolitem.hxx>
+
+//============================================================================
+DBG_NAMEEX_VISIBILITY(CntUnencodedStringItem, SVL_DLLPUBLIC)
+
+class SVL_DLLPUBLIC CntUnencodedStringItem: public SfxPoolItem
+{
+ OUString m_aValue;
+
+public:
+ TYPEINFO();
+
+ CntUnencodedStringItem(sal_uInt16 which = 0): SfxPoolItem(which)
+ { DBG_CTOR(CntUnencodedStringItem, 0); }
+
+ CntUnencodedStringItem(sal_uInt16 which, const OUString & rTheValue):
+ SfxPoolItem(which), m_aValue(rTheValue)
+ { DBG_CTOR(CntUnencodedStringItem, 0); }
+
+ CntUnencodedStringItem(const CntUnencodedStringItem & rItem):
+ SfxPoolItem(rItem), m_aValue(rItem.m_aValue)
+ { DBG_CTOR(CntUnencodedStringItem, 0); }
+
+ virtual ~CntUnencodedStringItem() { DBG_DTOR(CntUnencodedStringItem, 0); }
+
+ virtual int operator ==(const SfxPoolItem & rItem) const;
+
+ virtual int Compare(const SfxPoolItem & rWith) const;
+
+ virtual int Compare(SfxPoolItem const & rWith,
+ IntlWrapper const & rIntlWrapper) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
+ SfxMapUnit, SfxMapUnit,
+ OUString & rText,
+ const IntlWrapper * = 0)
+ const;
+
+ virtual bool QueryValue(com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0) const;
+
+ virtual bool PutValue(const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0);
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
+
+ const OUString & GetValue() const { return m_aValue; }
+
+ inline void SetValue(const OUString & rTheValue);
+};
+
+inline void CntUnencodedStringItem::SetValue(const OUString & rTheValue)
+{
+ DBG_ASSERT(GetRefCount() == 0,
+ "CntUnencodedStringItem::SetValue(): Pooled item");
+ m_aValue = rTheValue;
+}
+
+#endif // _SVTOOLS_CUSTRITM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/dateitem.hxx b/include/svl/dateitem.hxx
new file mode 100644
index 000000000000..043502966ffc
--- /dev/null
+++ b/include/svl/dateitem.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 _DATETIMEITEM_HXX
+#define _DATETIMEITEM_HXX
+
+#include <tools/rtti.hxx>
+#include <tools/datetime.hxx>
+
+#include <svl/poolitem.hxx>
+
+class SvStream;
+
+DBG_NAMEEX(SfxDateTimeItem)
+
+// class SfxDateTimeItem -------------------------------------------------
+
+class SfxDateTimeItem : public SfxPoolItem
+{
+private:
+ DateTime aDateTime;
+
+public:
+ TYPEINFO();
+
+ SfxDateTimeItem( sal_uInt16 nWhich,
+ const DateTime& rDT );
+ SfxDateTimeItem( const SfxDateTimeItem& rCpy );
+
+ ~SfxDateTimeItem() {
+ DBG_DTOR(SfxDateTimeItem, 0); }
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ using SfxPoolItem::Compare;
+ virtual int Compare( const SfxPoolItem &rWith ) const;
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItemVersion ) const;
+ virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * pIntlWrapper = 0 )
+ const;
+
+ const DateTime& GetDateTime() const { return aDateTime; }
+ void SetDateTime( const DateTime& rDT ) {
+ DBG_ASSERT( GetRefCount() == 0,
+ "SetDateTime() with pooled item" );
+ aDateTime = rDT; }
+
+ virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/documentlockfile.hxx b/include/svl/documentlockfile.hxx
new file mode 100644
index 000000000000..437b59fbf127
--- /dev/null
+++ b/include/svl/documentlockfile.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 _SVT_DOCUMENTLOCKFILE_HXX
+#define _SVT_DOCUMENTLOCKFILE_HXX
+
+#include <svl/svldllapi.h>
+
+#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <com/sun/star/io/XTruncate.hpp>
+
+#include <svl/lockfilecommon.hxx>
+
+namespace svt {
+
+class SVL_DLLPUBLIC DocumentLockFile : public LockFileCommon
+{
+ // the workaround for automated testing!
+ static sal_Bool m_bAllowInteraction;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > OpenStream();
+
+ void WriteEntryToStream( ::com::sun::star::uno::Sequence< OUString > aEntry, ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xStream );
+
+public:
+ DocumentLockFile( const OUString& aOrigURL );
+ ~DocumentLockFile();
+
+ sal_Bool CreateOwnLockFile();
+ ::com::sun::star::uno::Sequence< OUString > GetLockData();
+ sal_Bool OverwriteOwnLockFile();
+ void RemoveFile();
+
+ // the methods allow to control whether UI interaction regarding the locked document file is allowed
+ // this is a workaround for automated tests
+ static void AllowInteraction( sal_Bool bAllow ) { m_bAllowInteraction = bAllow; }
+ static sal_Bool IsInteractionAllowed() { return m_bAllowInteraction; }
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/eitem.hxx b/include/svl/eitem.hxx
new file mode 100644
index 000000000000..c9c5e389132f
--- /dev/null
+++ b/include/svl/eitem.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 _SFXENUMITEM_HXX
+#define _SFXENUMITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <svl/cenumitm.hxx>
+
+//============================================================================
+class SVL_DLLPUBLIC SfxEnumItem: public CntEnumItem
+{
+protected:
+ explicit SfxEnumItem(sal_uInt16 which = 0, sal_uInt16 nValue = 0):
+ CntEnumItem(which, nValue) {}
+
+ SfxEnumItem(sal_uInt16 which, SvStream & rStream):
+ CntEnumItem(which, rStream) {}
+
+public:
+ TYPEINFO();
+
+};
+
+//============================================================================
+class SVL_DLLPUBLIC SfxBoolItem: public CntBoolItem
+{
+public:
+ TYPEINFO();
+
+ explicit SfxBoolItem(sal_uInt16 which = 0, sal_Bool bValue = sal_False):
+ CntBoolItem(which, bValue) {}
+
+ SfxBoolItem(sal_uInt16 which, SvStream & rStream):
+ CntBoolItem(which, rStream) {}
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
+ { return new SfxBoolItem(Which(), rStream); }
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
+ { return new SfxBoolItem(*this); }
+};
+
+#endif // _SFXENUMITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/filenotation.hxx b/include/svl/filenotation.hxx
new file mode 100644
index 000000000000..00c2c16ed77c
--- /dev/null
+++ b/include/svl/filenotation.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 SVTOOLS_FILENOTATION_HXX
+#define SVTOOLS_FILENOTATION_HXX
+
+#include "svl/svldllapi.h"
+#include <rtl/ustring.hxx>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OFileNotation
+ //=====================================================================
+ class SVL_DLLPUBLIC OFileNotation
+ {
+ protected:
+ OUString m_sSystem;
+ OUString m_sFileURL;
+
+ public:
+ enum NOTATION
+ {
+ N_SYSTEM,
+ N_URL
+ };
+
+ OFileNotation( const OUString& _rUrlOrPath );
+ OFileNotation( const OUString& _rUrlOrPath, NOTATION _eInputNotation );
+
+ OUString get(NOTATION _eOutputNotation);
+
+ private:
+ SVL_DLLPRIVATE void construct( const OUString& _rUrlOrPath );
+ SVL_DLLPRIVATE bool implInitWithSystemNotation( const OUString& _rSystemPath );
+ SVL_DLLPRIVATE bool implInitWithURLNotation( const OUString& _rURL );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // SVTOOLS_FILENOTATION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/filerec.hxx b/include/svl/filerec.hxx
new file mode 100644
index 000000000000..afc5f4632fd7
--- /dev/null
+++ b/include/svl/filerec.hxx
@@ -0,0 +1,1031 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SFXFILEREC_HXX
+#define _SFXFILEREC_HXX
+
+//=========================================================================
+
+#include "svl/svldllapi.h"
+#include <tools/debug.hxx>
+#include <tools/stream.hxx>
+#include <vector>
+
+//------------------------------------------------------------------------
+
+#define SFX_REC_PRETAG_EXT sal_uInt8(0x00) // Pre-Tag f"ur Extended-Records
+#define SFX_REC_PRETAG_EOR sal_uInt8(0xFF) // Pre-Tag f"ur End-Of-Records
+
+#define SFX_REC_TYPE_NONE sal_uInt8(0x00) // unbekannter Record-Typ
+#define SFX_REC_TYPE_FIRST sal_uInt8(0x01)
+#define SFX_REC_TYPE_SINGLE sal_uInt8(0x01) // Single-Content-Record
+#define SFX_REC_TYPE_FIXSIZE sal_uInt8(0x02) // Fix-Size-Multi-Content-Record
+#define SFX_REC_TYPE_VARSIZE_RELOC sal_uInt8(0x03) // variable Rec-Size
+#define SFX_REC_TYPE_VARSIZE sal_uInt8(0x04) // alt (nicht verschiebbar)
+#define SFX_REC_TYPE_MIXTAGS_RELOC sal_uInt8(0x07) // Mixed Tag Content-Record
+#define SFX_REC_TYPE_MIXTAGS sal_uInt8(0x08) // alt (nicht verschiebbar)
+#define SFX_REC_TYPE_LAST sal_uInt8(0x08)
+#define SFX_REC_TYPE_MINI 0x100 // Mini-Record
+#define SFX_REC_TYPE_DRAWENG 0x400 // Drawing-Engine-Record
+#define SFX_REC_TYPE_EOR 0xF00 // End-Of-Records
+
+//------------------------------------------------------------------------
+
+#define SFX_REC_HEADERSIZE_MINI 4 // Gr"o\se des Mini-Record-Headers
+#define SFX_REC_HEADERSIZE_SINGLE 4 // zzgl. HEADERSIZE_MINI => 8
+#define SFX_REC_HEADERSIZE_MULTI 6 // zzgl. HEADERSIZE_SINGLE => 14
+
+//------------------------------------------------------------------------
+
+#ifndef DBG
+#ifdef DBG_UTIL
+#define DBG(x) x
+#else
+#define DBG(x)
+#endif
+#endif
+
+//------------------------------------------------------------------------
+
+/* [Fileformat]
+
+ Jeder Record beginnt mit einem Byte, dem sogenannten 'Pre-Tag'.
+
+ Ist dieses 'Pre-Tag' == 0x00, dann handelt es sich um einen Extended-
+ Record, dessen Typ durch ein weiteres Byte an Position 5 n�her
+ beschrieben wird:
+
+ 0x01: SfxSingleRecord
+ 0x02: SfxMultiFixRecord
+ 0x03+0x04: SfxMultiVarRecord
+ 0x07+0x08: SfxMultiMixRecord
+ (Alle weiteren Record-Typ-Kennungen sind reserviert.)
+
+ I.d.R. werden File-Formate schon aus Performance-Gr"unden so aufgebaut,
+ da\s beim Lesen jeweils vorher schon feststeht, welcher Record-Typ
+ vorliegt. Diese Kennung dient daher hautps"achlich der "Uberpr"ufung
+ und File-Viewern, die das genaue File-Format (unterhalb der Records)
+ nicht kennen.
+
+ Der 'SfxMiniRecordReader' verf"ugt dazu auch "uber eine statische
+ Methode 'ScanRecordType()', mit der festgestellt werden kann, welcher
+ Record-Typ in dem "ubergebenen Stream zu finden ist.
+
+ Ein 'Pre-Tag' mit dem Wert 0xFF ist als Terminator reserviert.
+ Terminatoren werden verwendet, um das Suchen nach einem speziellen
+ Record zu terminieren, d.h. ist er bis dorthin nicht gefunden, wird
+ auch nicht weitergesucht.
+
+ Bei allen anderen Werten des 'Pre-Tags' (also von 0x01 bis 0xFE)
+ handelt es sich um einen zum SW3 kompatbilen Record, der hier
+ 'SfxMiniRecord' genannt wird, er kann daher mit einem <SfxMiniRecordReader>
+ gelesen werden.
+
+ Beginnt ein Record mit 0x44 k"onnte es sich um einen Drawing-Engine-
+ Record handeln. Dies ist dann der Fall, wenn die folgenden drei Bytes
+ die Zeichenkette 'RMD' bzw. 'RVW' ergeben (zusammen mit 'D'==0x44
+ ergibt dies die K"urzel f"ur 'DRaw-MoDel' bzw. 'DRaw-VieW'). Records
+ dieser Art k"onnen von den hier dargestellten Klassen weder gelesen,
+ noch in irgendeiner Weise interpretiert werden. Einzig die Methode
+ 'ScanRecordType()' kann sie erkennen - weitere Behandlung obliegt
+ jedoch der Anwendungsprogrammierung.
+
+ Diese drei Bytes an den Positionen 2 bis 4 enthalten normalerweise
+ die Gr"o\se des Records ohne Pre-Tag und Gr"o\sen-Bytes selbst,
+ also die Restgr"o\se nach diesem 4-Byte-Header.
+
+ Struktur des Mini-Records:
+
+ 1 sal_uInt8 Pre-Tag
+ 3 sal_uInt8 OffsetToEndOfRec
+ OffsetToEndOfRec* 1 sal_uInt8 Content
+
+ Bei den Extended-Reords folgt auf diesen 4-Byte-Header ein erweiterter
+ Header, der zun"achst den o.g. Record-Typ, dann eine Versions-Kennung
+ sowie ein Tag enth"alt, welches den Inhalt kennzeichnet.
+
+ Struktur des Extended-Records:
+
+ 1 sal_uInt8 Pre-Tag (==0x00)
+ 3 sal_uInt8 OffsetToEndOfRec
+ OffsetToEndOfRec* 1 sal_uInt8 Content
+ 1 sal_uInt8 Record-Type
+ 1 sal_uInt8 Version
+ 2 sal_uInt8 Tag
+ ContentSize* 1 sal_uInt8 Content
+
+ (ContentSize = OffsetToEndOfRec - 8)
+
+ [Anmerkung]
+
+ Der Aufbau der Records wird wie folgt begr"undet:
+
+ Der SW-Record-Typ war zuerst vorhanden, mu\ste also 1:1 "ubernommen
+ werden. Zum Gl"uck wurden einige Record-Tags nicht verwendet, (Z.B.
+ 0x00 und 0xFF).
+ => 1. Byte 0x00 kann als Kennung f"ur erweiterten Record verwendet werden
+ => 1. Byte 0xFF kann f"ur besondere Zwecke verwendet werden
+
+ Egal welcher Record-Typ vorliegt, sollte eine Erkennung des Typs, ein
+ Auslesen des Headers und ein "uberpspringen des Records m"oglich sein,
+ ohne zu"uck-seeken zu m"ussen und ohne "uberfl"ussige Daten lesen zu
+ m"ussen.
+ => die Bytes 2-4 werden bei allen Records als Offset zum Ende des
+ Records interpretiert, so da\s die Gesamt-Recors-Size sich wie
+ folgt berechnet: sizeof(sal_uInt32) + OffsetToEndOfRec
+
+ Die Records sollten einfach zu parsen un einheitlich aufgebaut sein.
+ => Sie bauen aufeinander auf, so ist z.B. der SfxMiniRecord in jedem
+ anderen enthalten.
+
+ Die Records sollten auch von denen der Drawing Enginge unterscheidbar
+ sein. Diese beginnen mit 'DRMD' und 'DRVW'.
+ => Mini-Records mit dem Pre-Tag 'D' d"urfen maximal 4MB gro\s sein,
+ um nicht in diesen Kennungs-Bereich zu reichen.
+
+ [Erweiterungen]
+
+ Es ist geplant das File-Format so zu erweitern, da\s das High-Nibble
+ des Record-Typs der erweiterten Records besondere Aufgaben "ubernehmen
+ soll. Zum Beispiel ist geplant, Record-Contents als 'nur aus Records
+ bestehend' zu kennzeichnen. Ein File-Viewer k"onnte sich dann automatisch
+ durch solche Strukturen 'hangeln', ohne Gefahr zu laufen, auf Daten
+ zu sto\sen, die sich zwar als Records interpretieren lassen, aber
+ tats"achlis als 'flache' Daten geschrieben wurden. Die m"ogliche
+ Erweiterung wird schon jetzt insofern vorbereitet, als da\s das
+ High-Nibble des Typs bei Vergleichen nicht ber"ucksichtigt wird.
+*/
+
+//------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxMiniRecordWriter
+
+/* [Beschreibung]
+
+ Mit Instanzen dieser Klasse kann ein einfacher Record in einen Stream
+ geschrieben werden, der sich durch ein sal_uInt8-Tag identifiziert, sowie
+ seine eigene L"ange speichert und somit auch von "alteren Versionen
+ bzw. Readern, die diesen Record-Type (Tag) nicht kennen, "ubersprungen
+ werden kann. Es wird keine Version-Nummer gespeichert.
+
+ Alternativ kann die Gr"o\se fest angegeben werden oder sie wird
+ automatisch aus der Differenz der Tell()-Angaben vor und nach dem
+ Streamen des Inhalts ermittelt.
+
+ Um Auf- und Abw"artskompatiblit"at gew"ahrleisten zu k"onnen, m"ussen
+ neue Versionen die Daten der "alteren immer komplett enthalten,
+ es d"urfen allenfalls neue Daten hintenan geh"angt werden!
+
+ [Fileformat]
+
+ 1* sal_uInt8 Content-Tag (!= 0)
+ 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes
+ SizeOfContent* sal_uInt8 Content
+
+ [Beispiel]
+
+ {
+ SfxMiniRecordWriter aRecord( pStream, MY_TAG_X );
+ *aRecord << aMember1;
+ *aRecord << aMember2;
+ }
+*/
+
+{
+protected:
+ SvStream* _pStream; // <SvStream>, in dem der Record liegt
+ sal_uInt32 _nStartPos; // Start-Position des Gesamt-Records im Stream
+ bool _bHeaderOk; /* TRUE, wenn der Header schon geschrieben ist; */
+ sal_uInt8 _nPreTag; // in den Header zu schreibendes 'Pre-Tag'
+
+public:
+ inline SfxMiniRecordWriter( SvStream *pStream,
+ sal_uInt8 nTag );
+ inline SfxMiniRecordWriter( SvStream *pStream, sal_uInt8 nTag,
+ sal_uInt32 nSize );
+
+ inline ~SfxMiniRecordWriter();
+
+ inline SvStream& operator*() const;
+
+ inline void Reset();
+
+ sal_uInt32 Close( bool bSeekToEndOfRec = true );
+
+private:
+ // not implementend, not allowed
+ SfxMiniRecordWriter( const SfxMiniRecordWriter& );
+ SfxMiniRecordWriter& operator=(const SfxMiniRecordWriter&);
+};
+
+//------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxMiniRecordReader
+
+/* [Beschreibung]
+
+ Mit Instanzen dieser Klasse kann ein einfacher Record aus einem Stream
+ gelesen werden, der mit der Klasse <SfxRecordWriter> geschrieben wurde.
+
+ Es ist auch m"oglich, den Record zu "uberspringen, ohne sein internes
+ Format zu kennen.
+
+ [Beispiel]
+
+ {
+ SfxMiniRecordReader aRecord( pStream );
+ switch ( aRecord.GetTag() )
+ {
+ case MY_TAG_X:
+ *aRecord >> aMember1;
+ *aRecord >> aMember2;
+ break;
+
+ ...
+ }
+ }
+*/
+
+{
+protected:
+ SvStream* _pStream; // <SvStream>, aus dem gelesen wird
+ sal_uInt32 _nEofRec; // Position direkt hinter dem Record
+ bool _bSkipped; // TRUE: der Record wurde explizit geskippt
+ sal_uInt8 _nPreTag; // aus dem Header gelesenes Pre-Tag
+
+ // Drei-Phasen-Ctor f"ur Subklassen
+ SfxMiniRecordReader() {}
+ void Construct_Impl( SvStream *pStream, sal_uInt8 nTag )
+ {
+ _pStream = pStream;
+ _bSkipped = sal_False;
+ _nPreTag = nTag;
+ }
+ inline bool SetHeader_Impl( sal_uInt32 nHeader );
+
+ // als ung"ultig markieren und zur"uck-seeken
+ void SetInvalid_Impl( sal_uInt32 nRecordStartPos )
+ {
+ _nPreTag = SFX_REC_PRETAG_EOR;
+ _pStream->Seek( nRecordStartPos );
+ }
+
+public:
+ SfxMiniRecordReader( SvStream *pStream, sal_uInt8 nTag );
+ inline ~SfxMiniRecordReader();
+
+ inline sal_uInt8 GetTag() const;
+ inline bool IsValid() const;
+
+ inline SvStream& operator*() const;
+
+ inline void Skip();
+
+private:
+ // not implementend, not allowed
+ SfxMiniRecordReader( const SfxMiniRecordReader& );
+ SfxMiniRecordReader& operator=(const SfxMiniRecordReader&);
+};
+
+//------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxSingleRecordWriter: public SfxMiniRecordWriter
+
+/* [Beschreibung]
+
+ Mit Instanzen dieser Klasse kann ein Record in einen Stream geschrieben
+ werden, dessen einziger Inhalt sich durch ein sal_uInt16-Tag und eine
+ sal_uInt8-Versions-Nummer identifiziert, sowie seine eigene L"ange speichert
+ und somit auch von "alteren Versionen bzw. Readern, die diesen
+ Record-Type (Tag) nicht kennen, "ubersprungen werden kann.
+
+ Alternativ kann die Gr"o\se fest angegeben werden oder sie wird
+ automatisch aus der Differenz der Tell()-Angaben vor und nach dem
+ Streamen des Inhalts ermittelt.
+
+ Um Auf- und Abw"artskompatiblit"at gew"ahrleisten zu k"onnen, m"ussen
+ neue Versionen die Daten der "alteren immer komplett enthalten,
+ es d"urfen allenfalls neue Daten hintenan geh"angt werden!
+
+ [Fileformat]
+
+ 1* sal_uInt8 Pre-Tag (!= 0)
+ 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes
+ 1* sal_uInt8 Record-Type (==SFX_REC_TYPE_SINGLE)
+ 1* sal_uInt8 Content-Version
+ 1* sal_uInt16 Content-Tag
+ SizeOfContent* sal_uInt8 Content
+*/
+
+{
+protected:
+ SfxSingleRecordWriter( sal_uInt8 nRecordType,
+ SvStream *pStream,
+ sal_uInt16 nTag, sal_uInt8 nCurVer );
+
+public:
+ inline void Reset();
+
+ sal_uInt32 Close( bool bSeekToEndOfRec = true );
+};
+
+//------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxSingleRecordReader: public SfxMiniRecordReader
+
+/* [Beschreibung]
+
+ Mit Instanzen dieser Klasse kann ein einfacher Record aus einem Stream
+ gelesen werden, der mit der Klasse <SfxSingleRecordWriter> geschrieben
+ wurde.
+
+ Es ist auch m"oglich, den Record zu "uberspringen, ohne sein internes
+ Format zu kennen.
+*/
+
+{
+protected:
+ sal_uInt16 _nRecordTag; // Art des Gesamt-Inhalts
+ sal_uInt8 _nRecordVer; // Version des Gesamt-Inhalts
+ sal_uInt8 _nRecordType; // Record Type aus dem Header
+
+ // Drei-Phasen-Ctor f"ur Subklassen
+ SfxSingleRecordReader() {}
+ void Construct_Impl( SvStream *pStream )
+ {
+ SfxMiniRecordReader::Construct_Impl(
+ pStream, SFX_REC_PRETAG_EXT );
+ }
+ bool FindHeader_Impl( sal_uInt16 nTypes, sal_uInt16 nTag );
+ bool ReadHeader_Impl( sal_uInt16 nTypes );
+
+public:
+
+ inline sal_uInt16 GetTag() const;
+
+ inline sal_uInt8 GetVersion() const;
+ inline bool HasVersion( sal_uInt16 nVersion ) const;
+};
+
+//------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxMultiFixRecordWriter: public SfxSingleRecordWriter
+
+/* [Beschreibung]
+
+ Mit Instanzen dieser Klasse kann ein Record in einen Stream geschrieben
+ werden, der seine eigene L"ange speichert und somit auch von "alteren
+ Versionen bzw. Readern, die diesen Record-Type (Tag) nicht kennen,
+ "ubersprungen werden kann.
+
+ Er enth"alt mehrere Inhalte von demselben Typ (Tag) und derselben
+ Version, die einmalig (stellvertretend f"ur alle) im Header des Records
+ identifiziert werden. Alle Inhalte haben eine vorher bekannte und
+ identische L"ange.
+
+ Um Auf- und Abw"artskompatiblit"at gew"ahrleisten zu k"onnen, m"ussen
+ neue Versionen die Daten der "alteren immer komplett enthalten,
+ es d"urfen allenfalls neue Daten hinten angeh"angt werden! Hier sind
+ damit selbstverst"andlich nur die Daten der einzelnen Inhalte gemeint,
+ die Anzahl der Inhalte ist selbstverst"andlich variabel und sollte
+ von lesenden Applikationen auch so behandelt werden.
+
+ [Fileformat]
+
+ 1* sal_uInt8 Pre-Tag (==0)
+ 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes
+ 1* sal_uInt8 Record-Type (==SFX_REC_TYPE_FIXSIZE)
+ 1* sal_uInt8 Content-Version
+ 1* sal_uInt16 Content-Tag
+ 1* sal_uInt16 NumberOfContents
+ 1* sal_uInt32 SizeOfEachContent
+ NumberOfContents* (
+ SizeOfEachContent sal_uInt8 Content
+ )
+
+ [Beispiel]
+
+ {
+ SfxMultiFixRecordWriter aRecord( pStream, MY_TAG_X, MY_VERSION );
+ for ( sal_uInt16 n = 0; n < Count(); ++n )
+ {
+ aRecord.NewContent();
+ *aRecord << aMember1[n];
+ *aRecord << aMember2[n];
+ }
+ }
+*/
+
+{
+protected:
+ sal_uInt32 _nContentStartPos; /* Startposition des jeweiligen
+ Contents - nur bei DBG_UTIL
+ und f"ur Subklassen */
+ sal_uInt32 _nContentSize; // Gr"o\se jedes Contents
+ sal_uInt16 _nContentCount; // jeweilige Anzahl der Contents
+
+ SfxMultiFixRecordWriter( sal_uInt8 nRecordType,
+ SvStream *pStream,
+ sal_uInt16 nTag,
+ sal_uInt8 nCurVer );
+
+public:
+ inline ~SfxMultiFixRecordWriter();
+
+ inline void NewContent();
+
+ inline void Reset();
+
+ sal_uInt32 Close( bool bSeekToEndOfRec = true );
+};
+
+//------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxMultiVarRecordWriter: public SfxMultiFixRecordWriter
+
+/* [Beschreibung]
+
+ Mit Instanzen dieser Klasse kann ein Record in einen Stream geschrieben
+ werden, der seine eigene L"ange speichert und somit auch von "alteren
+ Versionen bzw. Readern, die diesen Record-Type (Tag) nicht kennen,
+ "ubersprungen werden kann.
+
+ Er enth"alt mehrere Inhalte von demselben Typ (Tag) und derselben
+ Version, die einmalig (stellvertretend f"ur alle) im Header des Records
+ identifiziert werden. Die L"ange f"ur jeden einzelnen Inhalt wird
+ automatisch berechnet und gespeichert, so da\s auch einzelne Inhalte
+ "ubersprungen werden k"onnen, ohne sie interpretieren zu m"ussen.
+
+ Um Auf- und Abw"artskompatiblit"at gew"ahrleisten zu k"onnen, m"ussen
+ neue Versionen die Daten der "alteren immer komplett enthalten,
+ es d"urfen allenfalls neue Daten hinten angeh"angt werden!
+
+ [Fileformat]
+
+ 1* sal_uInt8 Pre-Tag (==0)
+ 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes
+ 1* sal_uInt8 Record-Type (==SFX_FILETYPE_TYPE_VARSIZE)
+ 1* sal_uInt8 Content-Version
+ 1* sal_uInt16 Content-Tag
+ 1* sal_uInt16 NumberOfContents
+ 1* sal_uInt32 OffsetToOfsTable
+ NumberOfContents* (
+ ContentSize* sal_uInt8 Content
+ )
+ NumberOfContents* sal_uInt32 ContentOfs (je per <<8 verschoben)
+
+ [Beispiel]
+
+ {
+ SfxMultiVarRecordWriter aRecord( pStream, MY_TAG_X, MY_VERSION );
+ for ( sal_uInt16 n = 0; n < Count(); ++n )
+ {
+ aRecord.NewContent();
+ *aRecord << aMember1[n];
+ *aRecord << aMember2[n];
+ }
+ }
+*/
+
+{
+protected:
+ std::vector<sal_uInt32> _aContentOfs;
+ sal_uInt16 _nContentVer; // nur f"ur SfxMultiMixRecordWriter
+
+ SfxMultiVarRecordWriter( sal_uInt8 nRecordType,
+ SvStream *pStream,
+ sal_uInt16 nRecordTag,
+ sal_uInt8 nRecordVer );
+
+ void FlushContent_Impl();
+
+public:
+ SfxMultiVarRecordWriter( SvStream *pStream,
+ sal_uInt16 nRecordTag,
+ sal_uInt8 nRecordVer );
+ virtual ~SfxMultiVarRecordWriter();
+
+ void NewContent();
+
+ virtual sal_uInt32 Close( bool bSeekToEndOfRec = true );
+};
+
+//------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxMultiMixRecordWriter: public SfxMultiVarRecordWriter
+
+/* [Beschreibung]
+
+ Mit Instanzen dieser Klasse kann ein Record in einen Stream geschrieben
+ werden, der seine eigene L"ange speichert und somit auch von "alteren
+ Versionen bzw. Readern, die diesen Record-Type (Tag) nicht kennen,
+ "ubersprungen werden kann.
+
+ Er enth"alt mehrere Inhalte von demselben Typ (Tag) und derselben
+ Version, die einmalig (stellvertretend f"ur alle) im Header des Records
+ identifiziert werden. Alle Inhalte haben eine vorher bekannte und
+ identische L"ange.
+
+ Um Auf- und Abw"artskompatiblit"at gew"ahrleisten zu k"onnen, m"ussen
+ neue Versionen die Daten der "alteren immer komplett enthalten,
+ es d"urfen allenfalls neue Daten hinten angeh"angt werden!
+
+ [Fileformat]
+
+ 1* sal_uInt8 Pre-Tag (==0)
+ 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes
+ 1* sal_uInt8 Record-Type (==SFX_REC_TYPE_MIXTAGS)
+ 1* sal_uInt8 Content-Version
+ 1* sal_uInt16 Record-Tag
+ 1* sal_uInt16 NumberOfContents
+ 1* sal_uInt32 OffsetToOfsTable
+ NumberOfContents* (
+ 1* sal_uInt16 Content-Tag
+ ContentSize* sal_uInt8 Content
+ )
+ NumberOfContents* sal_uInt32 ( ContentOfs << 8 + Version )
+*/
+
+{
+public:
+ inline SfxMultiMixRecordWriter( SvStream *pStream,
+ sal_uInt16 nRecordTag,
+ sal_uInt8 nRecordVer );
+
+ void NewContent( sal_uInt16 nTag, sal_uInt8 nVersion );
+
+// private: geht nicht, da einige Compiler dann auch vorherige privat machen
+ void NewContent()
+ { OSL_FAIL( "NewContent() only allowed with args" ); }
+};
+
+//------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxMultiRecordReader: public SfxSingleRecordReader
+
+/* [Beschreibung]
+
+ Mit Instanzen dieser Klasse kann ein aus mehreren Contents bestehender
+ Record aus einem Stream gelesen werden, der mit einer der Klassen
+ <SfxMultiFixRecordWriter>, <SfxMultiVarRecordWriter> oder
+ <SfxMultiMixRecordWriter> geschrieben wurde.
+
+ Es ist auch m"oglich, den Record oder einzelne Contents zu "uberspringen,
+ ohne das jeweilis interne Format zu kennen.
+
+ [Beispiel]
+
+ {
+ SfxMultiRecordReader aRecord( pStream );
+ for ( sal_uInt16 nRecNo = 0; aRecord.GetContent(); ++nRecNo )
+ {
+ switch ( aRecord.GetTag() )
+ {
+ case MY_TAG_X:
+ X *pObj = new X;
+ *aRecord >> pObj.>aMember1;
+ if ( aRecord.HasVersion(2) )
+ *aRecord >> pObj->aMember2;
+ Append( pObj );
+ break;
+
+ ...
+ }
+ }
+ }
+*/
+
+{
+ sal_uInt32 _nStartPos; // Start-Position des Records
+ sal_uInt32* _pContentOfs; // Offsets der Startpositionen
+ sal_uInt32 _nContentSize; // Size jedes einzelnen / Tabellen-Pos
+ sal_uInt16 _nContentCount; // Anzahl der Contents im Record
+ sal_uInt16 _nContentNo; /* der Index des aktuellen Contents
+ enth"alt jeweils den Index des
+ Contents, der beim n"achsten
+ GetContent() geholt wird */
+ sal_uInt16 _nContentTag; // Art-Kennung des aktuellen Contents
+ sal_uInt8 _nContentVer; // Versions-Kennung des akt. Contents
+
+ bool ReadHeader_Impl();
+
+public:
+ SfxMultiRecordReader( SvStream *pStream, sal_uInt16 nTag );
+ ~SfxMultiRecordReader();
+
+ bool GetContent();
+ inline sal_uInt16 GetContentTag();
+ inline sal_uInt8 GetContentVersion() const;
+ inline bool HasContentVersion( sal_uInt16 nVersion ) const;
+
+ inline sal_uInt32 ContentCount() const;
+};
+
+//=========================================================================
+
+inline SfxMiniRecordWriter::SfxMiniRecordWriter
+(
+ SvStream* pStream, // Stream, in dem der Record angelegt wird
+ sal_uInt8 nTag // Record-Tag zwischen 0x01 und 0xFE
+)
+
+/* [Beschreibung]
+
+ Legt in 'pStream' einen 'SfxMiniRecord' an, dessen Content-Gr"o\se
+ nicht bekannt ist, sondern nach dam Streamen des Contents errechnet
+ werden soll.
+*/
+
+: _pStream( pStream ),
+ _nStartPos( pStream->Tell() ),
+ _bHeaderOk(false),
+ _nPreTag( nTag )
+{
+ DBG_ASSERT( _nPreTag != 0xFF, "invalid Tag" );
+ DBG( DbgOutf( "SfxFileRec: writing record to %ul", pStream->Tell() ) );
+
+ pStream->SeekRel( + SFX_REC_HEADERSIZE_MINI );
+}
+
+//-------------------------------------------------------------------------
+
+inline SfxMiniRecordWriter::SfxMiniRecordWriter
+(
+ SvStream* pStream, // Stream, in dem der Record angelegt wird
+ sal_uInt8 nTag, // Record-Tag zwischen 0x01 und 0xFE
+ sal_uInt32 nSize // Gr"o\se der Daten in Bytes
+)
+
+/* [Beschreibung]
+
+ Legt in 'pStream' einen 'SfxMiniRecord' an, dessen Content-Gr"o\se
+ von vornherein bekannt ist.
+*/
+
+: _pStream( pStream ),
+ // _nTag( uninitialized ),
+ // _nStarPos( uninitialized ),
+ _bHeaderOk(true)
+{
+ DBG_ASSERT( nTag != 0 && nTag != 0xFF, "invalid Tag" );
+ DBG(_nStartPos = pStream->Tell());
+ DBG( DbgOutf( "SfxFileRec: writing record to %ul", _nStartPos ) );
+
+ *pStream << ( ( nTag << 24 ) | nSize );
+}
+
+//-------------------------------------------------------------------------
+
+inline SfxMiniRecordWriter::~SfxMiniRecordWriter()
+
+/* [Beschreibung]
+
+ Der Dtor der Klasse <SfxMiniRecordWriter> schlie\st den Record
+ automatisch, falls <SfxMiniRecordWriter::Close()> nicht bereits
+ explizit gerufen wurde.
+*/
+
+{
+ // wurde der Header noch nicht geschrieben oder mu\s er gepr"uft werden
+ if ( !_bHeaderOk )
+ Close();
+}
+
+//-------------------------------------------------------------------------
+
+inline SvStream& SfxMiniRecordWriter::operator*() const
+
+/* [Beschreibung]
+
+ Dieser Operator liefert den Stream, in dem der Record liegt.
+ Der Record darf noch nicht geschlossen worden sein.
+*/
+
+{
+ DBG_ASSERT( !_bHeaderOk, "getting Stream of closed record" );
+ return *_pStream;
+}
+
+//-------------------------------------------------------------------------
+
+inline void SfxMiniRecordWriter::Reset()
+{
+ _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI );
+ _bHeaderOk = false;
+}
+
+//=========================================================================
+
+inline SfxMiniRecordReader::~SfxMiniRecordReader()
+
+/* [Beschreibung]
+
+ Der Dtor der Klasse <SfxMiniRecordReader> positioniert den Stream
+ automatisch auf die Position direkt hinter dem Record, falls nicht
+ <SfxMiniRecordReader::Skip()> bereits explizit gerufen wurde.
+*/
+
+{
+ // noch nicht explizit ans Ende gesprungen?
+ if ( !_bSkipped )
+ Skip();
+}
+
+//-------------------------------------------------------------------------
+
+inline void SfxMiniRecordReader::Skip()
+
+/* [Beschreibung]
+
+ Mit dieser Methode wird der Stream direkt hinter das Ende des Records
+ positioniert.
+*/
+
+{
+ _pStream->Seek(_nEofRec);
+ _bSkipped = sal_True;
+}
+
+//-------------------------------------------------------------------------
+
+inline sal_uInt8 SfxMiniRecordReader::GetTag() const
+
+/* [Beschreibung]
+
+ Liefert des aus dem Header gelesene Pre-Tag des Records. Dieses kann
+ auch SFX_REC_PRETAG_EXT oder SFX_REC_PRETAG_EOR sein, im
+ letzteren Fall ist am Stream der Fehlercode ERRCODE_IO_WRONGFORMAT
+ gesetzt. SFX_REC_PRETAG_EXT ist g"ultig, da diese extended-Records
+ nur eine Erweiterung des SfxMiniRecord darstellen.
+*/
+
+{
+ return _nPreTag;
+}
+
+//-------------------------------------------------------------------------
+
+inline bool SfxMiniRecordReader::IsValid() const
+
+/* [Beschreibung]
+
+ Hiermit kann abgefragt werden, ob der Record erfolgreich aus dem
+ Stream konstruiert werden konnte, der Header also f"ur diesen Record-Typ
+ passend war.
+*/
+
+{
+ return _nPreTag != SFX_REC_PRETAG_EOR;
+}
+
+//-------------------------------------------------------------------------
+
+inline SvStream& SfxMiniRecordReader::operator*() const
+
+/* [Beschreibung]
+
+ Dieser Operator liefert den Stream in dem der Record liegt.
+ Die aktuelle Position des Streams mu\s innerhalb des Records liegen.
+*/
+
+{
+ DBG_ASSERT( _pStream->Tell() < _nEofRec, "read behind record" );
+ return *_pStream;
+}
+
+//=========================================================================
+
+inline sal_uInt32 SfxSingleRecordWriter::Close( bool bSeekToEndOfRec )
+
+// siehe <SfxMiniRecordWriter::Close(bool)>
+
+{
+ sal_uInt32 nRet = 0;
+
+ // wurde der Header noch nicht geschrieben?
+ if ( !_bHeaderOk )
+ {
+ // Basisklassen-Header schreiben
+ sal_uInt32 nEndPos = SfxMiniRecordWriter::Close( bSeekToEndOfRec );
+
+ // ggf. ans Ende des eigenen Headers seeken oder hinter Rec bleiben
+ if ( !bSeekToEndOfRec )
+ _pStream->SeekRel( SFX_REC_HEADERSIZE_SINGLE );
+ nRet = nEndPos;
+ }
+#ifdef DBG_UTIL
+ else
+ // Basisklassen-Header pr"ufen
+ SfxMiniRecordWriter::Close( bSeekToEndOfRec );
+#endif
+
+ // Record war bereits geschlossen
+// nRet = 0;
+ return nRet;
+}
+
+//-------------------------------------------------------------------------
+
+inline void SfxSingleRecordWriter::Reset()
+{
+ _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI +
+ SFX_REC_HEADERSIZE_SINGLE );
+ _bHeaderOk = false;
+}
+
+//=========================================================================
+
+inline sal_uInt16 SfxSingleRecordReader::GetTag() const
+
+/* [Beschreibung]
+
+ Liefert des aus dem Header gelesene Tag f"ur den Gesamt-Record.
+*/
+
+{
+ return _nRecordTag;
+}
+
+//-------------------------------------------------------------------------
+
+inline sal_uInt8 SfxSingleRecordReader::GetVersion() const
+
+/* [Beschreibung]
+
+ Liefert die Version des aus dem Stream gelesenen Records.
+*/
+
+{
+ return _nRecordVer;
+}
+
+//-------------------------------------------------------------------------
+
+inline bool SfxSingleRecordReader::HasVersion( sal_uInt16 nVersion ) const
+
+/* [Beschreibung]
+
+ Stellt fest, ob der aus dem Stream gelese Record in der Version
+ 'nVersion' oder h"oher vorliegt.
+*/
+
+{
+ return _nRecordVer >= nVersion;
+}
+
+//=========================================================================
+
+inline SfxMultiFixRecordWriter::~SfxMultiFixRecordWriter()
+
+/* [Beschreibung]
+
+ Der Dtor der Klasse <SfxMultiFixRecordWriter> schlie\st den Record
+ automatisch, falls <SfxMutiFixRecordWriter::Close()> nicht bereits
+ explizit gerufen wurde.
+*/
+
+{
+ // wurde der Header noch nicht geschrieben oder mu\s er gepr"uft werden
+ if ( !_bHeaderOk )
+ Close();
+}
+
+//-------------------------------------------------------------------------
+
+inline void SfxMultiFixRecordWriter::NewContent()
+
+/* [Beschreibung]
+
+ Mit dieser Methode wird in den Record ein neuer Content eingef"ugt.
+ Jeder, auch der 1. Record mu\s durch Aufruf dieser Methode eingeleitet
+ werden.
+*/
+
+{
+ #ifdef DBG_UTIL
+ sal_uLong nOldStartPos;
+ // Startposition des aktuellen Contents merken - Achtung Subklassen!
+ nOldStartPos = _nContentStartPos;
+ #endif
+ _nContentStartPos = _pStream->Tell();
+
+#ifdef DBG_UTIL
+ // ist ein vorhergehender Content vorhanden?
+ if ( _nContentCount )
+ {
+ // pr"ufen, ob der vorhergehende die Soll-Gr"o\se eingehalten hat
+ DBG_ASSERT( _nContentStartPos - nOldStartPos == _nContentSize,
+ "wrong content size detected" );
+ }
+#endif
+
+ // Anzahl mitz"ahlen
+ ++_nContentCount;
+}
+
+//=========================================================================
+
+inline SfxMultiMixRecordWriter::SfxMultiMixRecordWriter
+(
+ SvStream* pStream, // Stream, in dem der Record angelegt wird
+ sal_uInt16 nRecordTag, // Gesamt-Record-Art-Kennung
+ sal_uInt8 nRecordVer // Gesamt-Record-Versions-Kennung
+)
+
+/* [Beschreibung]
+
+ Legt in 'pStream' einen 'SfxMultiMixRecord' an, f"ur dessen Contents
+ je eine separate Kennung f"ur Art (Tag) und Version gespeichert wird.
+ Die Gr"o\sen der einzelnen Contents werden automatisch ermittelt.
+*/
+
+: SfxMultiVarRecordWriter( SFX_REC_TYPE_MIXTAGS,
+ pStream, nRecordTag, nRecordVer )
+{
+}
+
+//=========================================================================
+
+inline void SfxMultiFixRecordWriter::Reset()
+{
+ _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI +
+ SFX_REC_HEADERSIZE_SINGLE +
+ SFX_REC_HEADERSIZE_MULTI );
+ _bHeaderOk = false;
+}
+
+//=========================================================================
+
+inline sal_uInt16 SfxMultiRecordReader::GetContentTag()
+
+/* [Beschreibung]
+
+ Diese Methode liefert die Art-Kennung des zuletzt mit der Methode
+ <SfxMultiRecordReder::GetContent()> ge"offneten Contents.
+*/
+
+{
+ return _nContentTag;
+}
+
+//-------------------------------------------------------------------------
+
+inline sal_uInt8 SfxMultiRecordReader::GetContentVersion() const
+
+/* [Beschreibung]
+
+ Diese Methode liefert die Version-Kennung des zuletzt mit der Methode
+ <SfxMultiRecordReder::GetContent()> ge"offneten Contents.
+*/
+
+{
+ return _nContentVer;
+}
+
+//-------------------------------------------------------------------------
+
+inline bool SfxMultiRecordReader::HasContentVersion( sal_uInt16 nVersion ) const
+
+/* [Beschreibung]
+
+ Diese Methode stellt fest, ob die Version 'nVersion' in der Version des
+ zuletzt mit der Methode <SfxMultiRecordReder::GetContent()> ge"offneten
+ Contents enthalten ist.
+*/
+
+{
+ return _nContentVer >= nVersion;
+}
+
+//-------------------------------------------------------------------------
+
+inline sal_uInt32 SfxMultiRecordReader::ContentCount() const
+
+/* [Beschreibung]
+
+ Diese Methode liefert die Anzahl im Record befindlichen Contents.
+*/
+
+{
+ return _nContentCount;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/flagitem.hxx b/include/svl/flagitem.hxx
new file mode 100644
index 000000000000..6b0c88ef8f7e
--- /dev/null
+++ b/include/svl/flagitem.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 _SFXFLAGITEM_HXX
+#define _SFXFLAGITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/solar.h>
+#include <tools/rtti.hxx>
+#include <svl/poolitem.hxx>
+
+class SvStream;
+
+// -----------------------------------------------------------------------
+
+DBG_NAMEEX_VISIBILITY(SfxFlagItem, SVL_DLLPUBLIC)
+
+class SVL_DLLPUBLIC SfxFlagItem: public SfxPoolItem
+{
+ sal_uInt16 nVal;
+
+public:
+ TYPEINFO();
+
+ explicit SfxFlagItem( sal_uInt16 nWhich = 0, sal_uInt16 nValue = 0 );
+ SfxFlagItem( const SfxFlagItem& );
+
+ ~SfxFlagItem() {
+ DBG_DTOR(SfxFlagItem, 0); }
+
+ virtual sal_uInt8 GetFlagCount() const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString & rText,
+ const IntlWrapper * = 0 ) const;
+ sal_uInt16 GetValue() const { return nVal; }
+ void SetValue( sal_uInt16 nNewVal ) {
+ DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
+ nVal = nNewVal;
+ }
+ bool GetFlag( sal_uInt8 nFlag ) const { return ( (nVal & ( 1<<nFlag))); }
+ void SetFlag( sal_uInt8 nFlag, bool bVal ) { if(bVal) { nVal |= (1<<nFlag); } else { nVal &= ~(1<<nFlag);};}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/folderrestriction.hxx b/include/svl/folderrestriction.hxx
new file mode 100644
index 000000000000..4ddb9d4be7bc
--- /dev/null
+++ b/include/svl/folderrestriction.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 SVTOOLS_FOLDER_RESTRICTION_HXX
+#define SVTOOLS_FOLDER_RESTRICTION_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/string.hxx>
+
+#include <vector>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ /** retrieves a list of folders which's access is not restricted.
+
+ <p>Note that this is not meant as security feature, but only as
+ method to restrict some UI presentation, such as browsing
+ in the file open dialog.</p>
+ */
+ SVL_DLLPUBLIC void getUnrestrictedFolders( ::std::vector< String >& _rFolders );
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVTOOLS_FOLDER_RESTRICTION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/fstathelper.hxx b/include/svl/fstathelper.hxx
new file mode 100644
index 000000000000..9e69c6ed28ec
--- /dev/null
+++ b/include/svl/fstathelper.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 _SVTOOLS_FSTATHELPER_HXX
+#define _SVTOOLS_FSTATHELPER_HXX
+
+#include "svl/svldllapi.h"
+#include <rtl/ustring.hxx>
+#include <tools/solar.h>
+
+class Date;
+class Time;
+
+namespace FStatHelper {
+
+/** Return the modified time and date stamp for this URL.
+
+ @param URL the asking URL
+
+ @param pDate if unequal 0, the function set the date stamp
+
+ @param pTime if unequal 0, the function set the time stamp
+
+ @return it was be able to get the date/time stamp
+*/
+SVL_DLLPUBLIC sal_Bool GetModifiedDateTimeOfFile( const OUString& rURL,
+ Date* pDate, Time* pTime );
+
+/** Return if under the URL a document exist. This is only a wrapper for the
+ UCB.IsContent.
+*/
+SVL_DLLPUBLIC sal_Bool IsDocument( const OUString& rURL );
+
+/** Return if under the URL a folder exist. This is only a wrapper for the
+ UCB.isFolder.
+*/
+SVL_DLLPUBLIC sal_Bool IsFolder( const OUString& rURL );
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/globalnameitem.hxx b/include/svl/globalnameitem.hxx
new file mode 100644
index 000000000000..618791bebb92
--- /dev/null
+++ b/include/svl/globalnameitem.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 _GLOBALNAMEITEM_HXX
+#define _GLOBALNAMEITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/solar.h>
+#include <tools/rtti.hxx>
+#include <tools/globname.hxx>
+#include <svl/poolitem.hxx>
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxGlobalNameItem: public SfxPoolItem
+{
+ SvGlobalName m_aName;
+
+public:
+ TYPEINFO();
+ SfxGlobalNameItem();
+ SfxGlobalNameItem( sal_uInt16 nWhich, const SvGlobalName& );
+ ~SfxGlobalNameItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ SvGlobalName GetValue() const { return m_aName; }
+
+ virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx
new file mode 100644
index 000000000000..8f5356ac9a13
--- /dev/null
+++ b/include/svl/hint.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 _SFXHINT_HXX
+#define _SFXHINT_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/rtti.hxx>
+
+class SVL_DLLPUBLIC SfxHint
+{
+public:
+ TYPEINFO();
+
+ virtual ~SfxHint();
+};
+
+//--------------------------------------------------------------------
+
+#define DECL_PTRHINT(Visibility, Name, Type) \
+ class Visibility Name: public SfxHint \
+ { \
+ Type* pObj; \
+ bool bIsOwner; \
+ \
+ public: \
+ TYPEINFO(); \
+ explicit Name( Type* Object, bool bOwnedByHint = false ); \
+ ~Name(); \
+ \
+ Type* GetObject() const { return pObj; } \
+ bool IsOwner() const { return bIsOwner; } \
+ }
+
+#define IMPL_PTRHINT(Name, Type) \
+ TYPEINIT1(Name, SfxHint); \
+ Name::Name( Type* pObject, bool bOwnedByHint ) \
+ { pObj = pObject; bIsOwner = bOwnedByHint; } \
+ Name::~Name() {}
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/ilstitem.hxx b/include/svl/ilstitem.hxx
new file mode 100644
index 000000000000..6c04ff239c74
--- /dev/null
+++ b/include/svl/ilstitem.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 _SFXILSTITEM_HXX
+#define _SFXILSTITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <svl/poolitem.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <vector>
+
+class SVL_DLLPUBLIC SfxIntegerListItem : public SfxPoolItem
+{
+ ::com::sun::star::uno::Sequence < sal_Int32 > m_aList;
+
+public:
+ TYPEINFO();
+
+ SfxIntegerListItem();
+ SfxIntegerListItem( sal_uInt16 nWhich, const ::std::vector < sal_Int32 >& rList );
+ SfxIntegerListItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Sequence < sal_Int32 >& rList );
+ SfxIntegerListItem( const SfxIntegerListItem& rItem );
+ ~SfxIntegerListItem();
+
+ ::com::sun::star::uno::Sequence < sal_Int32 > GetSequence()
+ { return m_aList; }
+ ::com::sun::star::uno::Sequence < sal_Int32 > GetConstSequence() const
+ { return (const_cast< SfxIntegerListItem * >(this))->GetSequence(); }
+
+ void GetList( ::std::vector < sal_Int32 >& rList ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+};
+
+#endif // _SFXINTITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/imageitm.hxx b/include/svl/imageitm.hxx
new file mode 100644
index 000000000000..0a2e26f80086
--- /dev/null
+++ b/include/svl/imageitm.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 _SVT_IMAGEITM_HXX
+#define _SVT_IMAGEITM_HXX
+
+#include "svl/svldllapi.h"
+#include <svl/intitem.hxx>
+
+class String;
+
+struct SfxImageItem_Impl;
+class SVL_DLLPUBLIC SfxImageItem : public SfxInt16Item
+{
+ SfxImageItem_Impl* pImp;
+public:
+ TYPEINFO();
+ SfxImageItem( sal_uInt16 nWhich = 0, sal_uInt16 nImage = 0 );
+ SfxImageItem( const SfxImageItem& );
+ virtual ~SfxImageItem();
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ void SetRotation( long nValue );
+ long GetRotation() const;
+ void SetMirrored( bool bSet );
+ bool IsMirrored() const;
+};
+
+#endif // _SFX_IMAGEITM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/inethist.hxx b/include/svl/inethist.hxx
new file mode 100644
index 000000000000..4ee592faad16
--- /dev/null
+++ b/include/svl/inethist.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 _INETHIST_HXX
+#define _INETHIST_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <tools/urlobj.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/hint.hxx>
+
+/*========================================================================
+ *
+ * INetURLHistory interface.
+ *
+ *=======================================================================*/
+class INetURLHistory_Impl;
+class INetURLHistory : public SfxBroadcaster
+{
+ struct StaticInstance
+ {
+ INetURLHistory * operator()();
+ };
+ friend INetURLHistory * StaticInstance::operator()();
+
+ /** Representation.
+ */
+ INetURLHistory_Impl *m_pImpl;
+
+ /** Construction/Destruction.
+ */
+ INetURLHistory (void);
+ virtual ~INetURLHistory (void);
+
+ /** Implementation.
+ */
+ static void NormalizeUrl_Impl (INetURLObject &rUrl);
+
+ SVL_DLLPUBLIC void PutUrl_Impl (const INetURLObject &rUrl);
+ SVL_DLLPUBLIC sal_Bool QueryUrl_Impl (const INetURLObject &rUrl);
+
+ /** Not implemented.
+ */
+ INetURLHistory (const INetURLHistory&);
+ INetURLHistory& operator= (const INetURLHistory&);
+
+public:
+ /** GetOrCreate.
+ */
+ SVL_DLLPUBLIC static INetURLHistory* GetOrCreate (void);
+
+ /** QueryProtocol.
+ */
+ sal_Bool QueryProtocol (INetProtocol eProto) const
+ {
+ return ((eProto == INET_PROT_FILE ) ||
+ (eProto == INET_PROT_FTP ) ||
+ (eProto == INET_PROT_HTTP ) ||
+ (eProto == INET_PROT_HTTPS) );
+ }
+
+ /** QueryUrl.
+ */
+ sal_Bool QueryUrl (const INetURLObject &rUrl)
+ {
+ if (QueryProtocol (rUrl.GetProtocol()))
+ return QueryUrl_Impl (rUrl);
+ else
+ return sal_False;
+ }
+
+ sal_Bool QueryUrl (const String &rUrl)
+ {
+ INetProtocol eProto =
+ INetURLObject::CompareProtocolScheme (rUrl);
+ if (QueryProtocol (eProto))
+ return QueryUrl_Impl (INetURLObject (rUrl));
+ else
+ return sal_False;
+ }
+
+ /** PutUrl.
+ */
+ void PutUrl (const INetURLObject &rUrl)
+ {
+ if (QueryProtocol (rUrl.GetProtocol()))
+ PutUrl_Impl (rUrl);
+ }
+
+ void PutUrl (const String &rUrl)
+ {
+ INetProtocol eProto =
+ INetURLObject::CompareProtocolScheme (rUrl);
+ if (QueryProtocol (eProto))
+ PutUrl_Impl (INetURLObject (rUrl));
+ }
+};
+
+/*========================================================================
+ *
+ * INetURLHistoryHint (broadcasted from PutUrl()).
+ *
+ *=======================================================================*/
+DECL_PTRHINT (SVL_DLLPUBLIC, INetURLHistoryHint, const INetURLObject);
+
+#endif /* _INETHIST_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/inettype.hxx b/include/svl/inettype.hxx
new file mode 100644
index 000000000000..48fca19aa5d6
--- /dev/null
+++ b/include/svl/inettype.hxx
@@ -0,0 +1,304 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _INETTYPE_HXX
+#define _INETTYPE_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/inetmime.hxx>
+#include <i18nlangtag/languagetag.hxx>
+
+//============================================================================
+/** Definitions for frequently used media type names.
+ */
+#define CONTENT_TYPE_STR_APP_OCTSTREAM "application/octet-stream"
+#define CONTENT_TYPE_STR_APP_PDF "application/pdf"
+#define CONTENT_TYPE_STR_APP_RTF "application/rtf"
+#define CONTENT_TYPE_STR_APP_VND_CALC "application/vnd.stardivision.calc"
+#define CONTENT_TYPE_STR_APP_VND_CHART "application/vnd.stardivision.chart"
+#define CONTENT_TYPE_STR_APP_VND_DRAW "application/vnd.stardivision.draw"
+#define CONTENT_TYPE_STR_APP_VND_IMAGE "application/vnd.stardivision.image"
+#define CONTENT_TYPE_STR_APP_VND_IMPRESSPACKED "application/vnd.stardivision.impress-packed"
+#define CONTENT_TYPE_STR_APP_VND_IMPRESS "application/vnd.stardivision.impress"
+#define CONTENT_TYPE_STR_APP_VND_MAIL "application/vnd.stardivision.mail"
+#define CONTENT_TYPE_STR_APP_VND_MATH "application/vnd.stardivision.math"
+#define CONTENT_TYPE_STR_APP_VND_NEWS "application/vnd.stardivision.news"
+#define CONTENT_TYPE_STR_APP_VND_OUTTRAY "application/vnd.stardivision.outtray"
+#define CONTENT_TYPE_STR_APP_VND_TEMPLATE "application/vnd.stardivision.template"
+#define CONTENT_TYPE_STR_APP_VND_WRITER_GLOBAL "application/vnd.stardivision.writer-global"
+#define CONTENT_TYPE_STR_APP_VND_WRITER_WEB "application/vnd.stardivision.writer-web"
+#define CONTENT_TYPE_STR_APP_VND_WRITER "application/vnd.stardivision.writer"
+#define CONTENT_TYPE_STR_APP_FRAMESET "application/x-frameset"
+#define CONTENT_TYPE_STR_APP_GALLERY_THEME "application/x-gallery-theme"
+#define CONTENT_TYPE_STR_APP_GALLERY "application/x-gallery"
+#define CONTENT_TYPE_STR_APP_JAR "application/x-jar"
+#define CONTENT_TYPE_STR_APP_MACRO "application/x-macro"
+#define CONTENT_TYPE_STR_APP_MSEXCEL_TEMPL "application/x-msexcel-template"
+#define CONTENT_TYPE_STR_APP_MSEXCEL "application/x-msexcel"
+#define CONTENT_TYPE_STR_APP_MSPPOINT_TEMPL "application/x-mspowerpoint-template"
+#define CONTENT_TYPE_STR_APP_MSPPOINT "application/x-mspowerpoint"
+#define CONTENT_TYPE_STR_APP_MSWORD_TEMPL "application/x-msword-template"
+#define CONTENT_TYPE_STR_APP_MSWORD "application/x-msword"
+#define CONTENT_TYPE_STR_APP_SCHEDULE_EVT "application/x-schedule-event"
+#define CONTENT_TYPE_STR_APP_SCHEDULE_FEVT "application/x-schedule-form-event"
+#define CONTENT_TYPE_STR_APP_SCHEDULE_FTASK "application/x-schedule-form-task"
+#define CONTENT_TYPE_STR_APP_SCHEDULE_TASK "application/x-schedule-task"
+#define CONTENT_TYPE_STR_APP_SCHEDULE_CMB "application/x-schedule"
+#define CONTENT_TYPE_STR_APP_STARCALC "application/x-starcalc"
+#define CONTENT_TYPE_STR_APP_STARCHART "application/x-starchart"
+#define CONTENT_TYPE_STR_APP_STARDRAW "application/x-stardraw"
+#define CONTENT_TYPE_STR_APP_STARHELP "application/x-starhelp"
+#define CONTENT_TYPE_STR_APP_STARIMAGE "application/x-starimage"
+#define CONTENT_TYPE_STR_APP_STARIMPRESS "application/x-starimpress"
+#define CONTENT_TYPE_STR_APP_STARMAIL_SDM "application/x-starmail-sdm"
+#define CONTENT_TYPE_STR_APP_STARMAIL_SMD "application/x-starmail-smd"
+#define CONTENT_TYPE_STR_APP_STARMATH "application/x-starmath"
+#define CONTENT_TYPE_STR_APP_STARWRITER_GLOB "application/x-starwriter-global"
+#define CONTENT_TYPE_STR_APP_STARWRITER "application/x-starwriter"
+#define CONTENT_TYPE_STR_APP_CDE_CALENDAR_APP "application/x-sun-ae-file"
+#define CONTENT_TYPE_STR_APP_ZIP "application/x-zip-compressed"
+#define CONTENT_TYPE_STR_AUDIO_AIFF "audio/aiff"
+#define CONTENT_TYPE_STR_AUDIO_BASIC "audio/basic"
+#define CONTENT_TYPE_STR_AUDIO_MIDI "audio/midi"
+#define CONTENT_TYPE_STR_AUDIO_VORBIS "audio/vorbis"
+#define CONTENT_TYPE_STR_AUDIO_WAV "audio/wav"
+#define CONTENT_TYPE_STR_AUDIO_WEBM "audio/webm"
+#define CONTENT_TYPE_STR_X_CNT_FSYSBOX ".chaos/fsys-box"
+#define CONTENT_TYPE_STR_X_CNT_FSYSFOLDER ".chaos/fsys-folder"
+#define CONTENT_TYPE_STR_X_CNT_FSYSSPECIALFOLDER ".chaos/fsys-special-folder"
+#define CONTENT_TYPE_STR_IMAGE_GENERIC "image/generic"
+#define CONTENT_TYPE_STR_IMAGE_GIF "image/gif"
+#define CONTENT_TYPE_STR_IMAGE_JPEG "image/jpeg"
+#define CONTENT_TYPE_STR_IMAGE_PCX "image/pcx"
+#define CONTENT_TYPE_STR_IMAGE_PNG "image/png"
+#define CONTENT_TYPE_STR_IMAGE_TIFF "image/tiff"
+#define CONTENT_TYPE_STR_IMAGE_BMP "image/x-MS-bmp"
+#define CONTENT_TYPE_STR_INET_MSG_RFC822 "message/rfc822"
+#define CONTENT_TYPE_STR_INET_MULTI_ALTERNATIVE "multipart/alternative"
+#define CONTENT_TYPE_STR_INET_MULTI_DIGEST "multipart/digest"
+#define CONTENT_TYPE_STR_INET_MULTI_MIXED "multipart/mixed"
+#define CONTENT_TYPE_STR_INET_MULTI_PARALLEL "multipart/parallel"
+#define CONTENT_TYPE_STR_INET_MULTI_RELATED "multipart/related"
+#define CONTENT_TYPE_STR_TEXT_ICALENDAR "text/calendar"
+#define CONTENT_TYPE_STR_TEXT_HTML "text/html"
+#define CONTENT_TYPE_STR_TEXT_PLAIN "text/plain"
+#define CONTENT_TYPE_STR_TEXT_XMLICALENDAR "text/x-icalxml"
+#define CONTENT_TYPE_STR_TEXT_URL "text/x-url"
+#define CONTENT_TYPE_STR_TEXT_VCALENDAR "text/x-vCalendar"
+#define CONTENT_TYPE_STR_TEXT_VCARD "text/x-vCard"
+#define CONTENT_TYPE_STR_VIDEO_MSVIDEO "video/x-msvideo"
+#define CONTENT_TYPE_STR_VIDEO_THEORA "video/theora"
+#define CONTENT_TYPE_STR_VIDEO_VDO "video/vdo"
+#define CONTENT_TYPE_STR_VIDEO_WEBM "audio/webm"
+#define CONTENT_TYPE_STR_X_STARMAIL "x-starmail"
+#define CONTENT_TYPE_STR_X_VRML "x-world/x-vrml"
+#define CONTENT_TYPE_STR_APP_VND_SUN_XML_WRITER "application/vnd.sun.xml.writer"
+#define CONTENT_TYPE_STR_APP_VND_SUN_XML_CALC "application/vnd.sun.xml.calc"
+#define CONTENT_TYPE_STR_APP_VND_SUN_XML_IMPRESS "application/vnd.sun.xml.impress"
+#define CONTENT_TYPE_STR_APP_VND_SUN_XML_DRAW "application/vnd.sun.xml.draw"
+#define CONTENT_TYPE_STR_APP_VND_SUN_XML_CHART "application/vnd.sun.xml.chart"
+#define CONTENT_TYPE_STR_APP_VND_SUN_XML_MATH "application/vnd.sun.xml.math"
+#define CONTENT_TYPE_STR_APP_VND_SUN_XML_WRITER_GLOBAL "application/vnd.sun.xml.writer-global"
+#define CONTENT_TYPE_STR_APP_VND_SUN_XML_IMPRESSPACKED "application/vnd.sun.xml.impress-packed"
+
+//============================================================================
+/** Definitions for matching parts of URIs.
+ */
+#define INETTYPE_URL_PROT_COMPONENT ".component"
+#define INETTYPE_URL_PROT_DATA "data"
+#define INETTYPE_URL_PROT_FILE "file"
+#define INETTYPE_URL_PROT_HTTP "http"
+#define INETTYPE_URL_PROT_HTTPS "https"
+#define INETTYPE_URL_PROT_MACRO "macro"
+#define INETTYPE_URL_PROT_MAILTO "mailto"
+#define INETTYPE_URL_PROT_PRIVATE "private"
+
+#define INETTYPE_URL_SUB_FACTORY "factory"
+#define INETTYPE_URL_SUB_HELPID "helpid"
+
+#define INETTYPE_URL_SSUB_FRAMESET "frameset"
+#define INETTYPE_URL_SSUB_SCALC "scalc"
+#define INETTYPE_URL_SSUB_SCHART "schart"
+#define INETTYPE_URL_SSUB_SDRAW "sdraw"
+#define INETTYPE_URL_SSUB_SIMAGE "simage"
+#define INETTYPE_URL_SSUB_SIMPRESS "simpress"
+#define INETTYPE_URL_SSUB_SMATH "smath"
+#define INETTYPE_URL_SSUB_SS "ss"
+#define INETTYPE_URL_SSUB_SWRITER "swriter"
+
+#define INETTYPE_URL_SSSUB_GLOB "GlobalDocument"
+#define INETTYPE_URL_SSSUB_WEB "web"
+
+#define INETTYPE_URL_SCHED_CMB "cmbview"
+#define INETTYPE_URL_SCHED_FORM "formular"
+#define INETTYPE_URL_SCHED_TASK "type=task"
+
+//============================================================================
+enum INetContentType
+{
+ CONTENT_TYPE_UNKNOWN,
+ CONTENT_TYPE_APP_OCTSTREAM,
+ CONTENT_TYPE_APP_PDF,
+ CONTENT_TYPE_APP_RTF,
+ CONTENT_TYPE_APP_MSWORD,
+ CONTENT_TYPE_APP_MSWORD_TEMPL,
+ CONTENT_TYPE_APP_STARCALC,
+ CONTENT_TYPE_APP_STARCHART,
+ CONTENT_TYPE_APP_STARDRAW,
+ CONTENT_TYPE_APP_STARHELP,
+ CONTENT_TYPE_APP_STARIMAGE,
+ CONTENT_TYPE_APP_STARIMPRESS,
+ CONTENT_TYPE_APP_STARMATH,
+ CONTENT_TYPE_APP_STARWRITER,
+ CONTENT_TYPE_APP_ZIP,
+ CONTENT_TYPE_AUDIO_AIFF,
+ CONTENT_TYPE_AUDIO_BASIC,
+ CONTENT_TYPE_AUDIO_MIDI,
+ CONTENT_TYPE_AUDIO_VORBIS,
+ CONTENT_TYPE_AUDIO_WAV,
+ CONTENT_TYPE_AUDIO_WEBM,
+ CONTENT_TYPE_IMAGE_GIF,
+ CONTENT_TYPE_IMAGE_JPEG,
+ CONTENT_TYPE_IMAGE_PCX,
+ CONTENT_TYPE_IMAGE_PNG,
+ CONTENT_TYPE_IMAGE_TIFF,
+ CONTENT_TYPE_IMAGE_BMP,
+ CONTENT_TYPE_TEXT_HTML,
+ CONTENT_TYPE_TEXT_PLAIN,
+ CONTENT_TYPE_TEXT_URL,
+ CONTENT_TYPE_TEXT_VCARD,
+ CONTENT_TYPE_VIDEO_MSVIDEO,
+ CONTENT_TYPE_VIDEO_THEORA,
+ CONTENT_TYPE_VIDEO_VDO,
+ CONTENT_TYPE_VIDEO_WEBM,
+ CONTENT_TYPE_X_CNT_FSYSBOX,
+ CONTENT_TYPE_X_CNT_FSYSFOLDER,
+ CONTENT_TYPE_X_STARMAIL,
+ CONTENT_TYPE_X_VRML,
+ CONTENT_TYPE_APP_GALLERY,
+ CONTENT_TYPE_APP_GALLERY_THEME,
+ CONTENT_TYPE_APP_STARWRITER_GLOB,
+ CONTENT_TYPE_APP_STARMAIL_SDM,
+ CONTENT_TYPE_APP_STARMAIL_SMD,
+ CONTENT_TYPE_APP_VND_CALC,
+ CONTENT_TYPE_APP_VND_CHART,
+ CONTENT_TYPE_APP_VND_DRAW,
+ CONTENT_TYPE_APP_VND_IMAGE,
+ CONTENT_TYPE_APP_VND_IMPRESS,
+ CONTENT_TYPE_APP_VND_MAIL,
+ CONTENT_TYPE_APP_VND_MATH,
+ CONTENT_TYPE_APP_VND_WRITER,
+ CONTENT_TYPE_APP_VND_WRITER_GLOBAL,
+ CONTENT_TYPE_APP_VND_WRITER_WEB,
+ CONTENT_TYPE_APP_SCHEDULE,
+ CONTENT_TYPE_APP_SCHEDULE_EVT,
+ CONTENT_TYPE_APP_SCHEDULE_TASK,
+ CONTENT_TYPE_APP_SCHEDULE_FORM_EVT,
+ CONTENT_TYPE_APP_SCHEDULE_FORM_TASK,
+ CONTENT_TYPE_APP_FRAMESET,
+ CONTENT_TYPE_APP_MACRO,
+ CONTENT_TYPE_X_CNT_FSYSSPECIALFOLDER,
+ CONTENT_TYPE_APP_VND_TEMPLATE,
+ CONTENT_TYPE_IMAGE_GENERIC,
+ CONTENT_TYPE_APP_VND_NEWS,
+ CONTENT_TYPE_APP_VND_OUTTRAY,
+ CONTENT_TYPE_APP_MSEXCEL,
+ CONTENT_TYPE_APP_MSEXCEL_TEMPL,
+ CONTENT_TYPE_APP_MSPPOINT,
+ CONTENT_TYPE_APP_MSPPOINT_TEMPL,
+ CONTENT_TYPE_TEXT_VCALENDAR,
+ CONTENT_TYPE_TEXT_ICALENDAR,
+ CONTENT_TYPE_TEXT_XMLICALENDAR,
+ CONTENT_TYPE_APP_CDE_CALENDAR_APP,
+ CONTENT_TYPE_INET_MESSAGE_RFC822,
+ CONTENT_TYPE_INET_MULTIPART_ALTERNATIVE,
+ CONTENT_TYPE_INET_MULTIPART_DIGEST,
+ CONTENT_TYPE_INET_MULTIPART_PARALLEL,
+ CONTENT_TYPE_INET_MULTIPART_RELATED,
+ CONTENT_TYPE_INET_MULTIPART_MIXED,
+ CONTENT_TYPE_APP_VND_IMPRESSPACKED,
+ CONTENT_TYPE_APP_JAR,
+ CONTENT_TYPE_APP_VND_SUN_XML_WRITER,
+ CONTENT_TYPE_APP_VND_SUN_XML_CALC,
+ CONTENT_TYPE_APP_VND_SUN_XML_IMPRESS,
+ CONTENT_TYPE_APP_VND_SUN_XML_DRAW,
+ CONTENT_TYPE_APP_VND_SUN_XML_CHART,
+ CONTENT_TYPE_APP_VND_SUN_XML_MATH,
+ CONTENT_TYPE_APP_VND_SUN_XML_WRITER_GLOBAL,
+ CONTENT_TYPE_APP_VND_SUN_XML_IMPRESSPACKED,
+ CONTENT_TYPE_LAST = CONTENT_TYPE_APP_VND_SUN_XML_IMPRESSPACKED
+};
+
+//============================================================================
+class SVL_DLLPUBLIC INetContentTypes
+{
+public:
+ static INetContentType RegisterContentType(OUString const & rTypeName,
+ OUString const & rPresentation,
+ OUString const * pExtension = 0,
+ OUString const * pSystemFileType = 0);
+
+ static INetContentType GetContentType(OUString const & rTypeName);
+
+ static OUString GetContentType(INetContentType eTypeID);
+
+ static OUString GetPresentation(INetContentType eTypeID,
+ const LanguageTag& aLocale);
+
+ static INetContentType GetContentType4Extension(OUString const & rExtension);
+
+ static INetContentType GetContentTypeFromURL(OUString const & rURL);
+
+ static bool GetExtensionFromURL(OUString const & rURL, OUString & rExtension);
+
+ /** Parse the body of an RFC 2045 Content-Type header field.
+
+ @param rMediaType The body of the Content-Type header field. It must
+ be of the form
+
+ token "/" token *(";" token "=" (token / quoted-string))
+
+ with intervening linear white space and comments (cf. RFCs 822, 2045).
+ The RFC 2231 extension are supported. The encoding of rMediaType
+ should be US-ASCII, but any Unicode values in the range U+0080..U+FFFF
+ are interpretet 'as appropriate.'
+
+ @param rType Returns the type (the first of the above tokens), in US-
+ ASCII encoding and converted to lower case.
+
+ @param rSubType Returns the sub type (the second of the above
+ tokens), in US-ASCII encoding and converted to lower case.
+
+ @param rParameters If not null, returns the parameters as a list of
+ INetContentTypeParameters (the attributes are in US-ASCII encoding and
+ converted to lower case, the values are in Unicode encoding). If
+ null, only the syntax of the parameters is checked, but they are not
+ returned.
+
+ @return True if the syntax of the field body is correct. If false is
+ returned, none of the output parameters will be modified!
+ */
+ static bool parse(OUString const & rMediaType, OUString & rType,
+ OUString & rSubType,
+ INetContentTypeParameterList * pParameters = 0);
+};
+
+#endif // _INETTYPE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/instrm.hxx b/include/svl/instrm.hxx
new file mode 100644
index 000000000000..39c3a8589be9
--- /dev/null
+++ b/include/svl/instrm.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 SVTOOLS_INSTRM_HXX
+#define SVTOOLS_INSTRM_HXX
+
+#include "svl/svldllapi.h"
+#include <com/sun/star/uno/Reference.h>
+#include <tools/stream.hxx>
+
+namespace com { namespace sun { namespace star { namespace io {
+ class XInputStream;
+ class XSeekable;
+} } } }
+
+class SvDataPipe_Impl;
+
+//============================================================================
+class SVL_DLLPUBLIC SvInputStream: public SvStream
+{
+ com::sun::star::uno::Reference< com::sun::star::io::XInputStream >
+ m_xStream;
+ com::sun::star::uno::Reference< com::sun::star::io::XSeekable >
+ m_xSeekable;
+ SvDataPipe_Impl * m_pPipe;
+ sal_uLong m_nSeekedFrom;
+
+ SVL_DLLPRIVATE bool open();
+
+ SVL_DLLPRIVATE virtual sal_uLong GetData(void * pData, sal_uLong nSize);
+
+ SVL_DLLPRIVATE virtual sal_uLong PutData(void const *, sal_uLong);
+
+ SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong nPos);
+
+ SVL_DLLPRIVATE virtual void FlushData();
+
+ SVL_DLLPRIVATE virtual void SetSize(sal_uLong);
+
+public:
+ SvInputStream(
+ com::sun::star::uno::Reference< com::sun::star::io::XInputStream >
+ const &
+ rTheStream);
+
+ virtual ~SvInputStream();
+
+ virtual sal_uInt16 IsA() const;
+
+ virtual void AddMark(sal_uLong nPos);
+
+ virtual void RemoveMark(sal_uLong nPos);
+};
+
+#endif // SVTOOLS_INSTRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/intitem.hxx b/include/svl/intitem.hxx
new file mode 100644
index 000000000000..a9cb341aec10
--- /dev/null
+++ b/include/svl/intitem.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 _SFXINTITEM_HXX
+#define _SFXINTITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <svl/cintitem.hxx>
+
+//============================================================================
+class SVL_DLLPUBLIC SfxByteItem: public CntByteItem
+{
+public:
+ TYPEINFO();
+
+ explicit SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0):
+ CntByteItem(which, nValue) {}
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
+ { return new SfxByteItem(*this); }
+};
+
+//============================================================================
+DBG_NAMEEX_VISIBILITY(SfxInt16Item, SVL_DLLPUBLIC)
+
+class SVL_DLLPUBLIC SfxInt16Item: public SfxPoolItem
+{
+ sal_Int16 m_nValue;
+
+public:
+ TYPEINFO();
+
+ explicit SfxInt16Item(sal_uInt16 which = 0, sal_Int16 nTheValue = 0):
+ SfxPoolItem(which), m_nValue(nTheValue)
+ { DBG_CTOR(SfxInt16Item, 0); }
+
+ SfxInt16Item(sal_uInt16 nWhich, SvStream & rStream);
+
+ SfxInt16Item(const SfxInt16Item & rItem):
+ SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
+ { DBG_CTOR(SfxInt16Item, 0); }
+
+ virtual ~SfxInt16Item() { DBG_DTOR(SfxInt16Item, 0); }
+
+ virtual int operator ==(const SfxPoolItem & rItem) const;
+
+ using SfxPoolItem::Compare;
+ virtual int Compare(const SfxPoolItem & rWith) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
+ SfxMapUnit, SfxMapUnit,
+ OUString & rText,
+ const IntlWrapper * = 0)
+ const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 ) const;
+
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 );
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
+
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
+
+ virtual sal_Int16 GetMin() const;
+
+ virtual sal_Int16 GetMax() const;
+
+ virtual SfxFieldUnit GetUnit() const;
+
+ sal_Int16 GetValue() const { return m_nValue; }
+
+ inline void SetValue(sal_Int16 nTheValue);
+};
+
+inline void SfxInt16Item::SetValue(sal_Int16 nTheValue)
+{
+ DBG_ASSERT(GetRefCount() == 0, "SfxInt16Item::SetValue(); Pooled item");
+ m_nValue = nTheValue;
+}
+
+//============================================================================
+class SVL_DLLPUBLIC SfxUInt16Item: public CntUInt16Item
+{
+public:
+ TYPEINFO();
+
+ explicit SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0):
+ CntUInt16Item(which, nValue) {}
+
+ SfxUInt16Item(sal_uInt16 which, SvStream & rStream):
+ CntUInt16Item(which, rStream) {}
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
+ { return new SfxUInt16Item(Which(), rStream); }
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
+ { return new SfxUInt16Item(*this); }
+};
+
+//============================================================================
+class SVL_DLLPUBLIC SfxInt32Item: public CntInt32Item
+{
+public:
+ TYPEINFO();
+
+ explicit SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0):
+ CntInt32Item(which, nValue) {}
+
+ SfxInt32Item(sal_uInt16 which, SvStream & rStream):
+ CntInt32Item(which, rStream) {}
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
+ { return new SfxInt32Item(Which(), rStream); }
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
+ { return new SfxInt32Item(*this); }
+
+};
+
+//============================================================================
+class SVL_DLLPUBLIC SfxUInt32Item: public CntUInt32Item
+{
+public:
+ TYPEINFO();
+
+ explicit SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0):
+ CntUInt32Item(which, nValue) {}
+
+ SfxUInt32Item(sal_uInt16 which, SvStream & rStream):
+ CntUInt32Item(which, rStream) {}
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
+ { return new SfxUInt32Item(Which(), rStream); }
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
+ { return new SfxUInt32Item(*this); }
+};
+
+#endif // _SFXINTITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/isethint.hxx b/include/svl/isethint.hxx
new file mode 100644
index 000000000000..cd966f5fcc4f
--- /dev/null
+++ b/include/svl/isethint.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 _SFXISETHINT_HXX
+#define _SFXISETHINT_HXX
+
+#include "svl/svldllapi.h"
+
+#include <svl/hint.hxx>
+
+class SfxItemSet;
+
+//--------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxItemSetHint: public SfxHint
+{
+ SfxItemSet* _pItemSet;
+
+public:
+ TYPEINFO();
+
+ SfxItemSetHint( const SfxItemSet &rItemSet );
+ virtual ~SfxItemSetHint();
+
+ const SfxItemSet& GetItemSet() const { return *_pItemSet; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/itemiter.hxx b/include/svl/itemiter.hxx
new file mode 100644
index 000000000000..4dada91a42b7
--- /dev/null
+++ b/include/svl/itemiter.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 _SFXITEMITER_HXX
+#define _SFXITEMITER_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/solar.h>
+#include <svl/itemset.hxx>
+
+class SfxPoolItem;
+class SfxItemSet;
+class SfxItemPool;
+
+class SVL_DLLPUBLIC SfxItemIter
+{
+ // Item-Feld - Start & Ende
+ const SfxItemSet& _rSet;
+ sal_uInt16 _nStt, _nEnd, _nAkt;
+
+public:
+ SfxItemIter( const SfxItemSet& rSet );
+ ~SfxItemIter();
+
+ // falls es diese gibt, returne sie, sonst 0
+ const SfxPoolItem* FirstItem()
+ { _nAkt = _nStt;
+ return _rSet._nCount ? *(_rSet._aItems+_nAkt) : 0; }
+ const SfxPoolItem* LastItem()
+ { _nAkt = _nEnd;
+ return _rSet._nCount ? *(_rSet._aItems+_nAkt) : 0; }
+ const SfxPoolItem* GetCurItem()
+ { return _rSet._nCount ? *(_rSet._aItems+_nAkt) : 0; }
+ const SfxPoolItem* NextItem();
+
+ sal_Bool IsAtStart() const { return _nAkt == _nStt; }
+ sal_Bool IsAtEnd() const { return _nAkt == _nEnd; }
+
+ sal_uInt16 GetCurPos() const { return _nAkt; }
+ sal_uInt16 GetFirstPos() const { return _nStt; }
+ sal_uInt16 GetLastPos() const { return _nEnd; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx
new file mode 100644
index 000000000000..ab9ff84d173d
--- /dev/null
+++ b/include/svl/itempool.hxx
@@ -0,0 +1,259 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SFXITEMPOOL_HXX
+#define _SFXITEMPOOL_HXX
+
+#include "svl/svldllapi.h"
+
+#include <limits.h>
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <svl/poolitem.hxx>
+#include <vector>
+
+class SvStream;
+class SfxBroadcaster;
+struct SfxItemPool_Impl;
+
+#define SFX_WHICH_MAX 4999
+
+DBG_NAMEEX(SfxItemPool)
+
+//====================================================================
+
+#define SFX_ITEM_POOLABLE 0x0001
+#define SFX_ITEM_NOT_POOLABLE 0x0002
+
+#define SFX_ITEM_USERFLAG0 0x0100
+#define SFX_ITEM_USERFLAG1 0x0200
+#define SFX_ITEM_USERFLAG2 0x0400
+#define SFX_ITEM_USERFLAG3 0x0800
+#define SFX_ITEM_USERFLAG4 0x1000
+#define SFX_ITEM_USERFLAG5 0x2000
+#define SFX_ITEM_USERFLAG6 0x4000
+#define SFX_ITEM_USERFLAG7 0x8000
+#define SFX_ITEM_USERFLAG8 0x0010
+#define SFX_ITEM_USERFLAG9 0x0020
+#define SFX_ITEM_USERFLAGA 0x0040
+#define SFX_ITEM_USERFLAGB 0x0080
+
+//====================================================================
+
+struct SfxItemInfo
+{
+ sal_uInt16 _nSID;
+ sal_uInt16 _nFlags;
+};
+
+//====================================================================
+
+class SfxStyleSheetIterator;
+struct SfxPoolItemArray_Impl;
+class SfxItemPool;
+
+class SVL_DLLPUBLIC SfxItemPoolUser
+{
+public:
+ virtual void ObjectInDestruction(const SfxItemPool& rSfxItemPool) = 0;
+
+protected:
+ ~SfxItemPoolUser() {}
+};
+
+class SVL_DLLPUBLIC SfxItemPool
+
+/* [Beschreibung]
+
+ Die von dieser Klasse abgeleiteten Klassen dienen der Bereitstellung von
+ Defaults von SfxPoolItems und halten konkrete (konstante) Instanzen, die
+ dann von mehreren Stellen (i.d.R. eines Dokuments) referenziert werden
+ k�nnen.
+
+ Dadurch ist jeder Wert nur einmalig gespeichert, was zu wenig Konstruktor
+ und Destruktor-Aufrufen f�hrt, Vergleiche zwischen Items eines Dokuments
+ beschleunigt und ein einfaches Laden und Speichern von Attributen
+ bereitstellt.
+*/
+
+{
+ friend struct SfxItemPool_Impl;
+
+ const SfxItemInfo* pItemInfos;
+ SfxItemPool_Impl* pImp;
+
+public:
+ void AddSfxItemPoolUser(SfxItemPoolUser& rNewUser);
+ void RemoveSfxItemPoolUser(SfxItemPoolUser& rOldUser);
+
+ //---------------------------------------------------------------------
+#ifndef _SFXITEMS_HXX
+
+private:
+ sal_uInt16 GetIndex_Impl(sal_uInt16 nWhich) const;
+ sal_uInt16 GetSize_Impl() const;
+
+ SVL_DLLPRIVATE SvStream& Load1_Impl( SvStream &rStream );
+ SVL_DLLPRIVATE bool IsItemFlag_Impl( sal_uInt16 nWhich, sal_uInt16 nFlag ) const;
+
+public:
+ // fuer dflt. SfxItemSet::CTOR, setze dflt. WhichRanges
+ void FillItemIdRanges_Impl( sal_uInt16*& pWhichRanges ) const;
+ const sal_uInt16* GetFrozenIdRanges() const;
+
+#endif
+ //---------------------------------------------------------------------
+
+protected:
+ static inline void SetRefCount( SfxPoolItem& rItem, sal_uLong n );
+ static inline sal_uLong AddRef( const SfxPoolItem& rItem, sal_uLong n = 1 );
+ static inline sal_uLong ReleaseRef( const SfxPoolItem& rItem, sal_uLong n = 1);
+ static inline void SetKind( SfxPoolItem& rItem, sal_uInt16 nRef );
+
+public:
+ SfxItemPool( const SfxItemPool &rPool,
+ sal_Bool bCloneStaticDefaults = sal_False );
+ SfxItemPool( const OUString &rName,
+ sal_uInt16 nStart, sal_uInt16 nEnd,
+ const SfxItemInfo *pItemInfos,
+ SfxPoolItem **pDefaults = 0,
+ bool bLoadRefCounts = true );
+protected:
+ virtual ~SfxItemPool();
+public:
+ static void Free(SfxItemPool* pPool);
+
+ SfxBroadcaster& BC();
+
+ void SetPoolDefaultItem( const SfxPoolItem& );
+ const SfxPoolItem* GetPoolDefaultItem( sal_uInt16 nWhich ) const;
+ void ResetPoolDefaultItem( sal_uInt16 nWhich );
+
+ void SetDefaults( SfxPoolItem **pDefaults );
+ void ReleaseDefaults( sal_Bool bDelete = sal_False );
+ static void ReleaseDefaults( SfxPoolItem **pDefaults, sal_uInt16 nCount, sal_Bool bDelete = sal_False );
+
+ virtual SfxMapUnit GetMetric( sal_uInt16 nWhich ) const;
+ void SetDefaultMetric( SfxMapUnit eNewMetric );
+ virtual SfxItemPresentation GetPresentation( const SfxPoolItem& rItem,
+ SfxItemPresentation ePresentation,
+ SfxMapUnit ePresentationMetric,
+ OUString& rText,
+ const IntlWrapper * pIntlWrapper
+ = 0 ) const;
+ virtual SfxItemPool* Clone() const;
+ const OUString& GetName() const;
+
+ virtual const SfxPoolItem& Put( const SfxPoolItem&, sal_uInt16 nWhich = 0 );
+ virtual void Remove( const SfxPoolItem& );
+ virtual const SfxPoolItem& GetDefaultItem( sal_uInt16 nWhich ) const;
+
+ const SfxPoolItem* LoadItem( SvStream &rStream,
+ bool bDirect = false,
+ const SfxItemPool *pRefPool = 0 );
+ bool StoreItem( SvStream &rStream,
+ const SfxPoolItem &rItem,
+ bool bDirect = false ) const;
+
+ sal_uInt32 GetSurrogate(const SfxPoolItem *) const;
+ const SfxPoolItem * GetItem2(sal_uInt16 nWhich, sal_uInt32 nSurrogate) const;
+ sal_uInt32 GetItemCount2(sal_uInt16 nWhich) const;
+ const SfxPoolItem* LoadSurrogate(SvStream& rStream,
+ sal_uInt16 &rWhich, sal_uInt16 nSlotId,
+ const SfxItemPool* pRefPool = 0 );
+ bool StoreSurrogate(SvStream& rStream,
+ const SfxPoolItem *pItem ) const;
+
+ virtual SvStream & Load(SvStream &);
+ virtual SvStream & Store(SvStream &) const;
+ bool HasPersistentRefCounts() const;
+ void LoadCompleted();
+
+ sal_uInt16 GetFirstWhich() const;
+ sal_uInt16 GetLastWhich() const;
+ bool IsInRange( sal_uInt16 nWhich ) const;
+ bool IsInVersionsRange( sal_uInt16 nWhich ) const;
+ bool IsInStoringRange( sal_uInt16 nWhich ) const;
+ void SetStoringRange( sal_uInt16 nFrom, sal_uInt16 nTo );
+ void SetSecondaryPool( SfxItemPool *pPool );
+ SfxItemPool* GetSecondaryPool() const;
+ SfxItemPool* GetMasterPool() const;
+ void FreezeIdRanges();
+
+ void Delete();
+
+ bool IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const;
+ bool IsItemFlag( const SfxPoolItem &rItem, sal_uInt16 nFlag ) const
+ { return IsItemFlag( rItem.Which(), nFlag ); }
+ void SetItemInfos( const SfxItemInfo *pInfos )
+ { pItemInfos = pInfos; }
+ sal_uInt16 GetWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const;
+ sal_uInt16 GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep = sal_True ) const;
+ sal_uInt16 GetTrueWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const;
+ sal_uInt16 GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep = sal_True ) const;
+
+ void SetVersionMap( sal_uInt16 nVer,
+ sal_uInt16 nOldStart, sal_uInt16 nOldEnd,
+ const sal_uInt16 *pWhichIdTab );
+ sal_uInt16 GetNewWhich( sal_uInt16 nOldWhich ) const;
+ sal_uInt16 GetVersion() const;
+ void SetFileFormatVersion( sal_uInt16 nFileFormatVersion );
+ bool IsCurrentVersionLoading() const;
+
+ static int IsWhich(sal_uInt16 nId) {
+ return nId && nId <= SFX_WHICH_MAX; }
+ static int IsSlot(sal_uInt16 nId) {
+ return nId && nId > SFX_WHICH_MAX; }
+
+ static const SfxItemPool* GetStoringPool();
+
+private:
+ const SfxItemPool& operator=(const SfxItemPool &); // n.i.!!
+
+ static const SfxItemPool* pStoringPool_;
+};
+
+// --------------- Inline Implementierungen ------------------------------
+
+// nur der Pool darf den Referenz-Zaehler manipulieren !!!
+inline void SfxItemPool::SetRefCount( SfxPoolItem& rItem, sal_uLong n )
+{
+ rItem.SetRefCount(n);
+}
+
+// nur der Pool darf den Referenz-Zaehler manipulieren !!!
+inline sal_uLong SfxItemPool::AddRef( const SfxPoolItem& rItem, sal_uLong n )
+{
+ return rItem.AddRef(n);
+}
+
+// nur der Pool darf den Referenz-Zaehler manipulieren !!!
+inline sal_uLong SfxItemPool::ReleaseRef( const SfxPoolItem& rItem, sal_uLong n )
+{
+ return rItem.ReleaseRef(n);
+}
+
+inline void SfxItemPool::SetKind( SfxPoolItem& rItem, sal_uInt16 nRef )
+{
+ rItem.SetKind( nRef );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/itemprop.hxx b/include/svl/itemprop.hxx
new file mode 100644
index 000000000000..c1b7ed68b400
--- /dev/null
+++ b/include/svl/itemprop.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 _SFX_ITEMPROP_HXX
+#define _SFX_ITEMPROP_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <svl/itemset.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/beans/PropertyState.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <vector>
+
+// UNO III - Implementation
+#define MAP_CHAR_LEN(cchar) cchar, sizeof(cchar) - 1
+
+struct SfxItemPropertyMapEntry
+{
+ const char* pName;
+ sal_uInt16 nNameLen;
+ sal_uInt16 nWID;
+ const com::sun::star::uno::Type* pType;
+ long nFlags;
+ sal_uInt8 nMemberId;
+
+};
+
+struct SfxItemPropertySimpleEntry
+{
+ sal_uInt16 nWID;
+ const com::sun::star::uno::Type* pType;
+ long nFlags;
+ sal_uInt8 nMemberId;
+
+ SfxItemPropertySimpleEntry() :
+ nWID( 0 ),
+ pType( 0 ),
+ nFlags( 0 ),
+ nMemberId( 0 ){}
+
+ SfxItemPropertySimpleEntry(sal_uInt16 _nWID, const com::sun::star::uno::Type* _pType,
+ long _nFlags, sal_uInt8 _nMemberId) :
+ nWID( _nWID ),
+ pType( _pType ),
+ nFlags( _nFlags ),
+ nMemberId( _nMemberId ){}
+
+ SfxItemPropertySimpleEntry( const SfxItemPropertyMapEntry* pMapEntry ) :
+ nWID( pMapEntry->nWID ),
+ pType( pMapEntry->pType ),
+ nFlags( pMapEntry->nFlags ),
+ nMemberId( pMapEntry->nMemberId ){}
+
+};
+struct SfxItemPropertyNamedEntry : public SfxItemPropertySimpleEntry
+{
+ OUString sName;
+ SfxItemPropertyNamedEntry( const String& rName, const SfxItemPropertySimpleEntry& rSimpleEntry) :
+ SfxItemPropertySimpleEntry( rSimpleEntry ),
+ sName( rName ){}
+
+};
+typedef std::vector< SfxItemPropertyNamedEntry > PropertyEntryVector_t;
+class SfxItemPropertyMap_Impl;
+class SVL_DLLPUBLIC SfxItemPropertyMap
+{
+ SfxItemPropertyMap_Impl* m_pImpl;
+public:
+ SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries );
+ SfxItemPropertyMap( const SfxItemPropertyMap& rSource );
+ ~SfxItemPropertyMap();
+
+ const SfxItemPropertySimpleEntry* getByName( const OUString &rName ) const;
+ com::sun::star::uno::Sequence< com::sun::star::beans::Property > getProperties() const;
+ com::sun::star::beans::Property getPropertyByName( const OUString rName ) const
+ throw( ::com::sun::star::beans::UnknownPropertyException );
+ sal_Bool hasPropertyByName( const OUString& rName ) const;
+
+ void mergeProperties( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rPropSeq );
+ PropertyEntryVector_t getPropertyEntries() const;
+ sal_uInt32 getSize() const;
+
+};
+
+class SVL_DLLPUBLIC SfxItemPropertySet
+{
+ SfxItemPropertyMap m_aMap;
+ mutable com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> m_xInfo;
+protected:
+ virtual sal_Bool FillItem(SfxItemSet& rSet, sal_uInt16 nWhich, sal_Bool bGetProperty) const;
+
+public:
+ SfxItemPropertySet( const SfxItemPropertyMapEntry *pMap ) :
+ m_aMap(pMap) {}
+ virtual ~SfxItemPropertySet();
+
+ void getPropertyValue( const SfxItemPropertySimpleEntry& rEntry,
+ const SfxItemSet& rSet,
+ com::sun::star::uno::Any& rAny) const
+ throw(::com::sun::star::uno::RuntimeException);
+ void getPropertyValue( const OUString &rName,
+ const SfxItemSet& rSet,
+ com::sun::star::uno::Any& rAny) const
+ throw(::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::beans::UnknownPropertyException);
+ com::sun::star::uno::Any
+ getPropertyValue( const OUString &rName,
+ const SfxItemSet& rSet ) const
+ throw(::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::beans::UnknownPropertyException);
+ void setPropertyValue( const SfxItemPropertySimpleEntry& rEntry,
+ const com::sun::star::uno::Any& aVal,
+ SfxItemSet& rSet ) const
+ throw(::com::sun::star::uno::RuntimeException,
+ com::sun::star::lang::IllegalArgumentException);
+ void setPropertyValue( const OUString& rPropertyName,
+ const com::sun::star::uno::Any& aVal,
+ SfxItemSet& rSet ) const
+ throw(::com::sun::star::uno::RuntimeException,
+ com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::beans::UnknownPropertyException);
+
+ com::sun::star::beans::PropertyState
+ getPropertyState(const OUString& rName, const SfxItemSet& rSet)const
+ throw(com::sun::star::beans::UnknownPropertyException);
+ com::sun::star::beans::PropertyState
+ getPropertyState(const SfxItemPropertySimpleEntry& rEntry, const SfxItemSet& rSet) const
+ throw();
+
+ com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo>
+ getPropertySetInfo() const;
+ const SfxItemPropertyMap& getPropertyMap() const {return m_aMap;}
+};
+
+struct SfxItemPropertySetInfo_Impl;
+class SVL_DLLPUBLIC SfxItemPropertySetInfo : public
+ cppu::WeakImplHelper1<com::sun::star::beans::XPropertySetInfo>
+{
+ SfxItemPropertySetInfo_Impl* m_pImpl;
+
+public:
+ SfxItemPropertySetInfo(const SfxItemPropertyMap &rMap );
+ SfxItemPropertySetInfo(const SfxItemPropertyMapEntry *pEntries );
+ virtual ~SfxItemPropertySetInfo();
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL
+ getProperties( )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::beans::Property SAL_CALL
+ getPropertyByName( const OUString& aName )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL
+ hasPropertyByName( const OUString& Name )
+ throw(::com::sun::star::uno::RuntimeException);
+
+};
+
+class SVL_DLLPUBLIC SfxExtItemPropertySetInfo: public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySetInfo >
+{
+ SfxItemPropertyMap aExtMap;
+public:
+ SfxExtItemPropertySetInfo(
+ const SfxItemPropertyMapEntry *pMap,
+ const com::sun::star::uno::Sequence<com::sun::star::beans::Property>& rPropSeq );
+ virtual ~SfxExtItemPropertySetInfo();
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL
+ getProperties( )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::beans::Property SAL_CALL
+ getPropertyByName( const OUString& aName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL
+ hasPropertyByName( const OUString& Name )
+ throw(::com::sun::star::uno::RuntimeException);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx
new file mode 100644
index 000000000000..a38398ac1ce7
--- /dev/null
+++ b/include/svl/itemset.hxx
@@ -0,0 +1,191 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXITEMSET_HXX
+#define _SFXITEMSET_HXX
+
+#include "svl/svldllapi.h"
+
+#include <cstdarg> // std::va_list and friends
+#include <svl/poolitem.hxx>
+#include <tools/rtti.hxx>
+#include <tools/solar.h>
+
+class SfxItemPool;
+class SfxPoolItem;
+class SvStream;
+
+typedef SfxPoolItem const** SfxItemArray;
+
+#define USHORT_ARG int
+
+#ifdef DBG
+#undef DBG
+#endif
+#define DBG(s)
+
+//========================================================================
+
+#define SFX_ITEMSET_GET( rSet, pItem, ItemType, nSlotId, bDeep ) \
+ const ItemType *pItem = (const ItemType*) \
+ (rSet).GetItem( nSlotId, bDeep, TYPE(ItemType) )
+
+//========================================================================
+
+class SVL_DLLPUBLIC SfxItemSet
+{
+ friend class SfxItemIter;
+
+ SfxItemPool* _pPool; // der verwendete Pool
+ const SfxItemSet* _pParent; // Ableitung
+ SfxItemArray _aItems; // Item-Feld
+ sal_uInt16* _pWhichRanges; // Array von Which-Bereichen
+ sal_uInt16 _nCount; // Anzahl Items
+
+ //---------------------------------------------------------------------
+#ifndef _SFXITEMS_HXX
+
+friend class SfxItemPoolCache;
+friend class SfxAllItemSet;
+friend const char *DbgCheckItemSet( const void* );
+
+private:
+ SVL_DLLPRIVATE void InitRanges_Impl(const sal_uInt16 *nWhichPairTable);
+ SVL_DLLPRIVATE void InitRanges_Impl(va_list pWhich, sal_uInt16 n1, sal_uInt16 n2, sal_uInt16 n3);
+ SVL_DLLPRIVATE void InitRanges_Impl(sal_uInt16 nWh1, sal_uInt16 nWh2);
+
+public:
+ SfxItemArray GetItems_Impl() const { return _aItems; }
+
+#endif
+ //---------------------------------------------------------------------
+
+private:
+ const SfxItemSet& operator=(const SfxItemSet &); // n.i.!!
+
+protected:
+ // Notification-Callback
+ virtual void Changed( const SfxPoolItem& rOld, const SfxPoolItem& rNew );
+
+ // direkte Put-Methode
+ int PutDirect(const SfxPoolItem &rItem);
+
+public:
+ SfxItemSet( const SfxItemSet& );
+
+ SfxItemSet( SfxItemPool&, sal_Bool bTotalPoolRanges = sal_False );
+ SfxItemSet( SfxItemPool&, sal_uInt16 nWhich1, sal_uInt16 nWhich2 );
+ SfxItemSet( SfxItemPool&, USHORT_ARG nWh1, USHORT_ARG nWh2, USHORT_ARG nNull, ... );
+ SfxItemSet( SfxItemPool&, const sal_uInt16* nWhichPairTable );
+ virtual ~SfxItemSet();
+
+ virtual SfxItemSet * Clone(sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0) const;
+
+ // Items erfragen
+ sal_uInt16 Count() const { return _nCount; }
+ sal_uInt16 TotalCount() const;
+
+ virtual const SfxPoolItem& Get( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True ) const;
+ const SfxPoolItem* GetItem( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True,
+ TypeId aItemType = 0 ) const;
+
+ // Which-Wert des Items an der Position nPos erfragen
+ sal_uInt16 GetWhichByPos(sal_uInt16 nPos) const;
+
+ // Item-Status erfragen
+ SfxItemState GetItemState( sal_uInt16 nWhich,
+ sal_Bool bSrchInParent = sal_True,
+ const SfxPoolItem **ppItem = 0 ) const;
+
+ bool HasItem(sal_uInt16 nWhich, const SfxPoolItem** ppItem = NULL) const;
+
+ virtual void DisableItem(sal_uInt16 nWhich);
+ virtual void InvalidateItem( sal_uInt16 nWhich );
+ virtual sal_uInt16 ClearItem( sal_uInt16 nWhich = 0);
+ virtual void ClearInvalidItems( sal_Bool bHardDefault = sal_False );
+ void InvalidateAllItems(); // HACK(via nWhich = 0) ???
+
+ inline void SetParent( const SfxItemSet* pNew );
+
+ // Items hinzufuegen, loeschen etc.
+ virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich );
+ const SfxPoolItem* Put( const SfxPoolItem& rItem )
+ { return Put(rItem, rItem.Which()); }
+ virtual int Put( const SfxItemSet&,
+ sal_Bool bInvalidAsDefault = sal_True );
+ void PutExtended( const SfxItemSet&,
+ SfxItemState eDontCareAs = SFX_ITEM_UNKNOWN,
+ SfxItemState eDefaultAs = SFX_ITEM_UNKNOWN );
+
+ virtual int Set( const SfxItemSet&, sal_Bool bDeep = sal_True );
+
+ virtual void Intersect( const SfxItemSet& rSet );
+ virtual void MergeValues( const SfxItemSet& rSet, sal_Bool bOverwriteDefaults = sal_False );
+ virtual void Differentiate( const SfxItemSet& rSet );
+ virtual void MergeValue( const SfxPoolItem& rItem, sal_Bool bOverwriteDefaults = sal_False );
+
+ SfxItemPool* GetPool() const { return _pPool; }
+ const sal_uInt16* GetRanges() const { return _pWhichRanges; }
+ void SetRanges( const sal_uInt16 *pRanges );
+ void MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo );
+ const SfxItemSet* GetParent() const { return _pParent; }
+
+ virtual SvStream & Load( SvStream &, bool bDirect = false,
+ const SfxItemPool *pRefPool = 0 );
+ virtual SvStream & Store( SvStream &, bool bDirect = false ) const;
+
+ virtual int operator==(const SfxItemSet &) const;
+};
+
+// --------------- Inline Implementierungen ------------------------
+
+inline void SfxItemSet::SetParent( const SfxItemSet* pNew )
+{
+ DBG( if (_pParent) --*_pChildCount(_pParent) );
+ _pParent = pNew;
+ DBG( if (_pParent) ++*_pChildCount(_pParent) );
+}
+
+//========================================================================
+
+class SVL_DLLPUBLIC SfxAllItemSet: public SfxItemSet
+
+/* versteht alle Ranges; werden durch das Putten der Items
+ automatisch angepasst
+*/
+
+{
+ SfxVoidItem aDefault;
+ sal_uInt16 nFree;
+
+public:
+ SfxAllItemSet( SfxItemPool &rPool );
+ SfxAllItemSet( const SfxItemSet & );
+ SfxAllItemSet( const SfxAllItemSet & );
+
+ virtual SfxItemSet * Clone( sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0 ) const;
+ virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich );
+ const SfxPoolItem* Put( const SfxPoolItem& rItem )
+ { return Put(rItem, rItem.Which()); }
+ virtual int Put( const SfxItemSet&,
+ sal_Bool bInvalidAsDefault = sal_True );
+};
+
+#endif // #ifndef _SFXITEMSET_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/languageoptions.hxx b/include/svl/languageoptions.hxx
new file mode 100644
index 000000000000..ef8fb1b4ae5d
--- /dev/null
+++ b/include/svl/languageoptions.hxx
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVTOOLS_LANGUAGEOPTIONS_HXX
+#define _SVTOOLS_LANGUAGEOPTIONS_HXX
+
+#include "svl/svldllapi.h"
+#include <sal/types.h>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <unotools/configitem.hxx>
+#include <unotools/options.hxx>
+#include <i18nlangtag/lang.h>
+
+// class SvtLanguageOptions ----------------------------------------------------
+
+// these defines can be ored
+#define SCRIPTTYPE_LATIN 0x01
+#define SCRIPTTYPE_ASIAN 0x02
+#define SCRIPTTYPE_COMPLEX 0x04
+
+class SvtCJKOptions;
+class SvtCTLOptions;
+
+class SVL_DLLPUBLIC SvtLanguageOptions : public ::utl::detail::Options
+{
+private:
+ SvtCJKOptions* m_pCJKOptions;
+ SvtCTLOptions* m_pCTLOptions;
+
+public:
+ enum EOption
+ {
+ // cjk options
+ E_CJKFONT,
+ E_VERTICALTEXT,
+ E_ASIANTYPOGRAPHY,
+ E_JAPANESEFIND,
+ E_RUBY,
+ E_CHANGECASEMAP,
+ E_DOUBLELINES,
+ E_EMPHASISMARKS,
+ E_VERTICALCALLOUT,
+ E_ALLCJK,
+ // ctl options
+ E_CTLFONT,
+ E_CTLSEQUENCECHECKING,
+ E_CTLCURSORMOVEMENT,
+ E_CTLTEXTNUMERALS
+ };
+
+ // bDontLoad is for referencing purposes only
+ SvtLanguageOptions( sal_Bool _bDontLoad = sal_False );
+ ~SvtLanguageOptions();
+
+ // CJK options
+ sal_Bool IsCJKFontEnabled() const;
+ sal_Bool IsVerticalTextEnabled() const;
+ sal_Bool IsAsianTypographyEnabled() const;
+ sal_Bool IsJapaneseFindEnabled() const;
+ void SetAll( sal_Bool _bSet );
+ sal_Bool IsAnyEnabled() const;
+
+ // CTL options
+ void SetCTLFontEnabled( sal_Bool _bEnabled );
+ sal_Bool IsCTLFontEnabled() const;
+
+ void SetCTLSequenceChecking( sal_Bool _bEnabled );
+
+ void SetCTLSequenceCheckingRestricted( sal_Bool _bEnable );
+
+ void SetCTLSequenceCheckingTypeAndReplace( sal_Bool _bEnable );
+
+ sal_Bool IsReadOnly(EOption eOption) const;
+
+ // returns for a language the scripttype
+ static sal_uInt16 GetScriptTypeOfLanguage( sal_uInt16 nLang );
+};
+/** #i42730# Gives access to the Windows 16bit system locale
+ */
+class SVL_DLLPUBLIC SvtSystemLanguageOptions : public utl::ConfigItem
+{
+private:
+ OUString m_sWin16SystemLocale;
+
+public:
+ SvtSystemLanguageOptions();
+ ~SvtSystemLanguageOptions();
+
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence< OUString >& rPropertyNames );
+
+ LanguageType GetWin16SystemLanguage();
+};
+
+#endif // _SVTOOLS_LANGUAGEOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/lckbitem.hxx b/include/svl/lckbitem.hxx
new file mode 100644
index 000000000000..163c2168c4c0
--- /dev/null
+++ b/include/svl/lckbitem.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 _LCKBITEM_HXX
+#define _LCKBITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/solar.h>
+#include <tools/rtti.hxx>
+#include <tools/stream.hxx>
+#include <svl/poolitem.hxx>
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxLockBytesItem : public SfxPoolItem
+{
+ SvLockBytesRef _xVal;
+
+public:
+ TYPEINFO();
+ SfxLockBytesItem();
+ SfxLockBytesItem( sal_uInt16 nWhich, SvStream & );
+ SfxLockBytesItem( const SfxLockBytesItem& );
+ ~SfxLockBytesItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+
+ SvLockBytes* GetValue() const { return _xVal; }
+
+ virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/listener.hxx b/include/svl/listener.hxx
new file mode 100644
index 000000000000..eeb275e302aa
--- /dev/null
+++ b/include/svl/listener.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 _SVT_LISTENER_HXX
+#define _SVT_LISTENER_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/rtti.hxx>
+
+class SvtBroadcaster;
+class SfxHint;
+class SvtListenerBase;
+
+//-------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SvtListener
+{
+ friend class SvtListenerBase;
+ SvtListenerBase *pBrdCastLst;
+
+ const SvtListener& operator=(const SvtListener &); // n.i., ist verboten
+
+public:
+ TYPEINFO();
+
+ SvtListener();
+ SvtListener( const SvtListener &rCopy );
+ virtual ~SvtListener();
+
+ sal_Bool StartListening( SvtBroadcaster& rBroadcaster );
+ sal_Bool EndListening( SvtBroadcaster& rBroadcaster );
+ void EndListeningAll();
+ sal_Bool IsListening( SvtBroadcaster& rBroadcaster ) const;
+
+ sal_Bool HasBroadcaster() const { return 0 != pBrdCastLst; }
+
+ virtual void Notify( SvtBroadcaster& rBC, const SfxHint& rHint );
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/listeneriter.hxx b/include/svl/listeneriter.hxx
new file mode 100644
index 000000000000..9a621d80e244
--- /dev/null
+++ b/include/svl/listeneriter.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 _SVT_LISTENERITER_HXX
+#define _SVT_LISTENERITER_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/rtti.hxx>
+
+class SvtListener;
+class SvtListenerBase;
+class SvtBroadcaster;
+
+//-------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SvtListenerIter
+{
+ friend class SvtListenerBase;
+
+ SvtBroadcaster& rRoot;
+ SvtListenerBase *pAkt, *pDelNext;
+
+ // for the update of all iterator's, if a listener is added or removed
+ // at the same time.
+ static SvtListenerIter *pListenerIters;
+ SvtListenerIter *pNxtIter;
+
+ SVL_DLLPRIVATE static void RemoveListener( SvtListenerBase& rDel,
+ SvtListenerBase* pNext );
+
+public:
+ SvtListenerIter( SvtBroadcaster& );
+ ~SvtListenerIter();
+
+ const SvtBroadcaster& GetBroadcaster() const { return rRoot; }
+ SvtBroadcaster& GetBroadcaster() { return rRoot; }
+
+ SvtListener* GoNext(); // to the next
+
+ SvtListener* GoStart(); // to the start of the list
+
+ SvtListener* GetCurr() const; // returns the current
+
+ int IsChanged() const { return pDelNext != pAkt; }
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/lngmisc.hxx b/include/svl/lngmisc.hxx
new file mode 100644
index 000000000000..c1b4a0160277
--- /dev/null
+++ b/include/svl/lngmisc.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 _SVTOOLS_LNGMISC_HXX_
+#define _SVTOOLS_LNGMISC_HXX_
+
+#include "svl/svldllapi.h"
+
+#include <rtl/ustring.hxx>
+
+#define SVT_SOFT_HYPHEN (static_cast<sal_Unicode>(0x00AD))
+#define SVT_HARD_HYPHEN (static_cast<sal_Unicode>(0x2011))
+
+// the non-breaking space
+#define SVT_HARD_SPACE (static_cast<sal_Unicode>(0x00A0))
+
+namespace linguistic
+{
+ inline bool IsHyphen(sal_Unicode cChar)
+ {
+ return cChar == SVT_SOFT_HYPHEN || cChar == SVT_HARD_HYPHEN;
+ }
+
+ inline bool IsControlChar(sal_Unicode cChar)
+ {
+ // TODO: why doesn't this include 0x0F DEL?
+ return cChar < static_cast<sal_Unicode>(' ');
+ }
+
+ SVL_DLLPRIVATE sal_Int32 GetNumControlChars( const OUString &rTxt );
+
+ SVL_DLLPUBLIC bool RemoveHyphens(OUString &rTxt);
+ SVL_DLLPUBLIC bool RemoveControlChars(OUString &rTxt);
+ SVL_DLLPUBLIC bool ReplaceControlChars(OUString &rTxt);
+ SVL_DLLPUBLIC OUString GetThesaurusReplaceText(const OUString &rText);
+} // namespace linguistic
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/lockfilecommon.hxx b/include/svl/lockfilecommon.hxx
new file mode 100644
index 000000000000..b9f62cd78504
--- /dev/null
+++ b/include/svl/lockfilecommon.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 _SVT_LOCKFILECOMMON_HXX
+#define _SVT_LOCKFILECOMMON_HXX
+
+#include <svl/svldllapi.h>
+
+#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <com/sun/star/io/XTruncate.hpp>
+
+#include <osl/mutex.hxx>
+#include <tools/urlobj.hxx>
+
+#define LOCKFILE_OOOUSERNAME_ID 0
+#define LOCKFILE_SYSUSERNAME_ID 1
+#define LOCKFILE_LOCALHOST_ID 2
+#define LOCKFILE_EDITTIME_ID 3
+#define LOCKFILE_USERURL_ID 4
+#define LOCKFILE_ENTRYSIZE 5
+
+namespace svt {
+
+// This is a general implementation that is used in document lock file implementation and in sharing control file implementation
+class SVL_DLLPUBLIC LockFileCommon
+{
+protected:
+ ::osl::Mutex m_aMutex;
+ OUString m_aURL;
+
+ INetURLObject ResolveLinks( const INetURLObject& aDocURL );
+
+public:
+ LockFileCommon( const OUString& aOrigURL, const OUString& aPrefix );
+ ~LockFileCommon();
+
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< OUString > > ParseList( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer );
+ static ::com::sun::star::uno::Sequence< OUString > ParseEntry( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& o_nCurPos );
+ static OUString ParseName( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& o_nCurPos );
+ static OUString EscapeCharacters( const OUString& aSource );
+ static OUString GetOOOUserName();
+ static OUString GetCurrentLocalTime();
+ static ::com::sun::star::uno::Sequence< OUString > GenerateOwnEntry();
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/lstner.hxx b/include/svl/lstner.hxx
new file mode 100644
index 000000000000..e54368abb557
--- /dev/null
+++ b/include/svl/lstner.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 _SFXLSTNER_HXX
+#define _SFXLSTNER_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/rtti.hxx>
+#include <deque>
+
+class SfxBroadcaster;
+class SfxHint;
+
+typedef std::deque<SfxBroadcaster*> SfxBroadcasterArr_Impl;
+
+#define SFX_NOTIFY( rBC, rBCT, rHint, rHintT ) \
+ Notify( rBC, rHint )
+
+//-------------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxListener
+{
+ SfxBroadcasterArr_Impl aBCs;
+
+private:
+ const SfxListener& operator=(const SfxListener &); // n.i., ist verboten
+
+public:
+ TYPEINFO();
+
+ SfxListener();
+ SfxListener( const SfxListener &rCopy );
+ virtual ~SfxListener();
+
+ sal_Bool StartListening( SfxBroadcaster& rBroadcaster, sal_Bool bPreventDups = sal_False );
+ sal_Bool EndListening( SfxBroadcaster& rBroadcaster, sal_Bool bAllDups = sal_False );
+ void EndListeningAll();
+ sal_Bool IsListening( SfxBroadcaster& rBroadcaster ) const;
+
+ sal_uInt16 GetBroadcasterCount() const
+ { return aBCs.size(); }
+ SfxBroadcaster* GetBroadcasterJOE( sal_uInt16 nNo ) const
+ { return aBCs[nNo]; }
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+#ifndef _NOTIFY_HXX
+ void RemoveBroadcaster_Impl( SfxBroadcaster& rBC );
+#endif
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/macitem.hxx b/include/svl/macitem.hxx
new file mode 100644
index 000000000000..9d73f6a3ded3
--- /dev/null
+++ b/include/svl/macitem.hxx
@@ -0,0 +1,215 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXMACITEM_HXX
+#define _SFXMACITEM_HXX
+
+// class SvxMacroItem ----------------------------------------------------
+
+#include "svl/svldllapi.h"
+#include <svl/poolitem.hxx>
+#include <tools/rtti.hxx>
+#include <tools/debug.hxx>
+#include <tools/string.hxx>
+#include <map>
+
+class SvStream;
+
+#define SVX_MACRO_LANGUAGE_JAVASCRIPT "JavaScript"
+#define SVX_MACRO_LANGUAGE_STARBASIC "StarBasic"
+#define SVX_MACRO_LANGUAGE_SF "Script"
+
+DBG_NAMEEX(SvxMacroItem)
+
+// -----------------------------------------------------------------------
+
+//Ein Macro
+
+enum ScriptType
+{
+ STARBASIC,
+ JAVASCRIPT,
+ EXTENDED_STYPE
+};
+
+// Basisklasse fuer SjJSbxObject mit virtuellem Destruktor
+class SjJSbxObjectBase
+{
+public:
+ virtual ~SjJSbxObjectBase();
+ virtual SjJSbxObjectBase* Clone( void );
+ //virtual SjJSbxObjectBase& operator=( const SjJSbxObjectBase& rBase );
+};
+
+class SjJSbxObject;
+
+class SVL_DLLPUBLIC SvxMacro
+{
+ OUString aMacName;
+ OUString aLibName;
+ // Fuer JavaScript muss ein Function-Objekt gehalten werden
+ SjJSbxObjectBase* pFunctionObject;
+ ScriptType eType;
+
+public:
+
+ SvxMacro( const OUString &rMacName, const OUString &rLanguage);
+
+ SvxMacro( const OUString &rMacName, const OUString &rLibName,
+ ScriptType eType); // = STARBASIC entfernt
+
+ SvxMacro( SjJSbxObjectBase* _pFunctionObject, const OUString &rSource );
+ ~SvxMacro(); // noetig fuer pFunctionObject
+
+ const OUString &GetLibName() const { return aLibName; }
+ const OUString &GetMacName() const { return aMacName; }
+ OUString GetLanguage()const;
+
+ ScriptType GetScriptType() const { return eType; }
+
+ bool HasMacro() const { return !aMacName.isEmpty(); }
+
+#ifdef SOLAR_JAVA
+ // JavaScript-Function-Objekt holen
+ // ACHTUNG: Implementation in SJ, Source/JScript/sjimpl.cxx
+ SjJSbxObjectBase* GetFunctionObject( SjJSbxObject* pParent );
+#endif
+
+ SvxMacro& operator=( const SvxMacro& rBase );
+};
+
+inline SvxMacro::SvxMacro( const OUString &rMacName, const OUString &rLibName,
+ ScriptType eTyp )
+ : aMacName( rMacName ), aLibName( rLibName ), pFunctionObject(NULL), eType( eTyp )
+{}
+
+inline SvxMacro::SvxMacro( SjJSbxObjectBase* _pFunctionObject, const OUString &rSource )
+ : aMacName( rSource ), pFunctionObject( _pFunctionObject ), eType( JAVASCRIPT )
+{}
+
+//Macro Table, zerstoert die Pointer im DTor!
+
+typedef std::map<sal_uInt16, SvxMacro> SvxMacroTable;
+
+#define SVX_MACROTBL_VERSION31 0
+#define SVX_MACROTBL_VERSION40 1
+
+#define SVX_MACROTBL_AKTVERSION SVX_MACROTBL_VERSION40
+
+class SVL_DLLPUBLIC SvxMacroTableDtor
+{
+private:
+ SvxMacroTable aSvxMacroTable;
+public:
+ inline SvxMacroTableDtor() {}
+ inline SvxMacroTableDtor( const SvxMacroTableDtor &rCpy ) : aSvxMacroTable(rCpy.aSvxMacroTable) { }
+
+ SvxMacroTableDtor& operator=( const SvxMacroTableDtor &rCpy );
+ int operator==( const SvxMacroTableDtor& rOther ) const;
+
+ // loescht alle Eintraege
+ void clear() { aSvxMacroTable.clear(); }
+
+ SvStream& Read( SvStream &, sal_uInt16 nVersion = SVX_MACROTBL_AKTVERSION );
+ SvStream& Write( SvStream & ) const;
+
+ sal_uInt16 GetVersion() const { return SVX_MACROTBL_AKTVERSION; }
+
+ SvxMacroTable::iterator begin() { return aSvxMacroTable.begin(); }
+ SvxMacroTable::const_iterator begin() const { return aSvxMacroTable.begin(); }
+ SvxMacroTable::iterator end() { return aSvxMacroTable.end(); }
+ SvxMacroTable::const_iterator end () const { return aSvxMacroTable.end(); }
+ SvxMacroTable::size_type size() const { return aSvxMacroTable.size(); }
+ bool empty() const { return aSvxMacroTable.empty(); }
+
+ // returns NULL if no entry exists, or a pointer to the internal value
+ const SvxMacro* Get(sal_uInt16 nEvent) const;
+ // returns NULL if no entry exists, or a pointer to the internal value
+ SvxMacro* Get(sal_uInt16 nEvent);
+ // return true if the key exists
+ bool IsKeyValid(sal_uInt16 nEvent) const;
+ // This stores a copy of the rMacro parameter
+ SvxMacro& Insert(sal_uInt16 nEvent, const SvxMacro& rMacro);
+ // If the entry exists, remove it from the map and release it's storage
+ sal_Bool Erase(sal_uInt16 nEvent);
+};
+
+
+/*
+[Beschreibung]
+Dieses Item beschreibt eine Makro-Tabelle.
+*/
+
+class SVL_DLLPUBLIC SvxMacroItem: public SfxPoolItem
+{
+public:
+ TYPEINFO();
+
+ explicit inline SvxMacroItem ( const sal_uInt16 nId /*= ITEMID_MACRO*/ );
+
+ // "pure virtual Methoden" vom SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+
+ inline const SvxMacroTableDtor& GetMacroTable() const { return aMacroTable;}
+ inline void SetMacroTable( const SvxMacroTableDtor& rTbl ) { aMacroTable = rTbl; }
+
+ inline const SvxMacro& GetMacro( sal_uInt16 nEvent ) const;
+ inline sal_Bool HasMacro( sal_uInt16 nEvent ) const;
+ void SetMacro( sal_uInt16 nEvent, const SvxMacro& );
+ inline sal_Bool DelMacro( sal_uInt16 nEvent );
+
+private:
+ SvxMacroTableDtor aMacroTable;
+
+ inline SvxMacroItem( const SvxMacroItem& );
+ SvxMacroItem &operator=( const SvxMacroItem & );
+};
+
+inline SvxMacroItem::SvxMacroItem( const sal_uInt16 nId )
+ : SfxPoolItem( nId )
+{}
+inline SvxMacroItem::SvxMacroItem( const SvxMacroItem &rCpy )
+ : SfxPoolItem( rCpy ),
+ aMacroTable( rCpy.GetMacroTable() )
+{}
+
+inline sal_Bool SvxMacroItem::HasMacro( sal_uInt16 nEvent ) const
+{
+ return aMacroTable.IsKeyValid( nEvent );
+}
+inline const SvxMacro& SvxMacroItem::GetMacro( sal_uInt16 nEvent ) const
+{
+ return *(aMacroTable.Get(nEvent));
+}
+inline sal_Bool SvxMacroItem::DelMacro( sal_uInt16 nEvent )
+{
+ return aMacroTable.Erase(nEvent);
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/mailenum.hxx b/include/svl/mailenum.hxx
new file mode 100644
index 000000000000..a01c6bc109ed
--- /dev/null
+++ b/include/svl/mailenum.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _MAILENUM_HXX
+#define _MAILENUM_HXX
+
+// enum ------------------------------------------------------------------
+
+enum MailState
+{
+ MAIL_STATE_SUCCESS = 0,
+ MAIL_STATE_FAILURE,
+ MAIL_STATE_ATTACHED_NOT_FOUND,
+ MAIL_STATE_NO_MEMORY,
+ MAIL_STATE_LOGIN_FAILURE,
+ MAIL_STATE_RECEIVER_NOT_FOUND,
+ MAIL_STATE_TOO_MANY_FILES,
+ MAIL_STATE_TOO_MANY_RECEIVERS,
+ MAIL_STATE_NO_RECEIVERS,
+ MAIL_STATE_USER_CANCEL,
+ MAIL_STATE_DRIVER_NOT_AVAILABLE
+};
+
+enum MailDriver
+{
+ MAIL_DRIVER_DETECT = 0,
+ MAIL_DRIVER_BEGIN,
+ MAIL_DRIVER_VIM = MAIL_DRIVER_BEGIN,
+ MAIL_DRIVER_MAPI,
+ MAIL_DRIVER_CMC,
+ MAIL_DRIVER_SMP,
+ MAIL_DRIVER_UNIX,
+ MAIL_DRIVER_SMTP,
+ MAIL_DRIVER_END
+};
+
+enum MailPriority
+{
+ MAIL_PRIORITY_LOW = 0,
+ MAIL_PRIORITY_NORMAL,
+ MAIL_PRIORITY_URGENT
+};
+
+enum MailReceiverRole
+{
+ MAIL_RECEIVER_TO = 0,
+ MAIL_RECEIVER_CC,
+ MAIL_RECEIVER_BCC,
+ MAIL_RECEIVER_NEWSGROUP
+};
+
+enum MailAction
+{
+ MAIL_ACTION_DYING, // Server stirbt
+ MAIL_ACTION_SEND, // Mail wurde versendet
+ MAIL_ACTION_READ, // Mail wurde als gelesen gekennzeichnet
+ MAIL_ACTION_REMOVED, // Mail wurde gel"oscht
+ MAIL_ACTION_UPDATED, // alle Mails wurden neu eingelesen
+ MAIL_ACTION_NEXT, // Sprung zur n"achsten Mail
+ MAIL_ACTION_PREV // Sprung zur vorherigen Mail
+};
+
+// Textformat zum Versenden von Nachrichten ------------------------------
+
+#define TXTFORMAT_ASCII ((sal_uInt8)0x01)
+#define TXTFORMAT_HTML ((sal_uInt8)0x02)
+#define TXTFORMAT_RTF ((sal_uInt8)0x04)
+#define TXTFORMAT_OFFICE ((sal_uInt8)0x08)
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/memberid.hrc b/include/svl/memberid.hrc
new file mode 100644
index 000000000000..4d501b5ae2ab
--- /dev/null
+++ b/include/svl/memberid.hrc
@@ -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 _MEMBERID_HRC
+#define _MEMBERID_HRC
+
+
+#define MID_X 1
+#define MID_Y 2
+#define MID_RECT_LEFT 3
+#define MID_RECT_TOP 4
+#define MID_WIDTH 5
+#define MID_HEIGHT 6
+#define MID_RECT_RIGHT 7
+
+// SvxSizeItem
+#define MID_SIZE_SIZE 0
+#define MID_SIZE_WIDTH 1
+#define MID_SIZE_HEIGHT 2
+
+// SvxSearchItem
+#define MID_SEARCH_STYLEFAMILY 1
+#define MID_SEARCH_CELLTYPE 2
+#define MID_SEARCH_ROWDIRECTION 3
+#define MID_SEARCH_ALLTABLES 4
+#define MID_SEARCH_SEARCHFILTERED 5
+#define MID_SEARCH_BACKWARD 6
+#define MID_SEARCH_PATTERN 7
+#define MID_SEARCH_CONTENT 8
+#define MID_SEARCH_ASIANOPTIONS 9
+#define MID_SEARCH_ALGORITHMTYPE 10
+#define MID_SEARCH_FLAGS 11
+#define MID_SEARCH_SEARCHSTRING 12
+#define MID_SEARCH_REPLACESTRING 13
+#define MID_SEARCH_LOCALE 14
+#define MID_SEARCH_CHANGEDCHARS 15
+#define MID_SEARCH_DELETEDCHARS 16
+#define MID_SEARCH_INSERTEDCHARS 17
+#define MID_SEARCH_TRANSLITERATEFLAGS 18
+#define MID_SEARCH_COMMAND 19
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/metitem.hxx b/include/svl/metitem.hxx
new file mode 100644
index 000000000000..090d95450159
--- /dev/null
+++ b/include/svl/metitem.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 _SFXMETRICITEM_HXX
+#define _SFXMETRICITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <svl/intitem.hxx>
+
+DBG_NAMEEX_VISIBILITY(SfxMetricItem, SVL_DLLPUBLIC)
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxMetricItem: public SfxInt32Item
+{
+public:
+ TYPEINFO();
+ explicit SfxMetricItem( sal_uInt16 nWhich = 0, sal_uInt32 nValue = 0 );
+ SfxMetricItem( sal_uInt16 nWhich, SvStream & );
+ SfxMetricItem( const SfxMetricItem& );
+ ~SfxMetricItem() {
+ DBG_DTOR(SfxMetricItem, 0); }
+
+ virtual bool ScaleMetrics( long lMult, long lDiv );
+ virtual bool HasMetrics() const;
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/nfkeytab.hxx b/include/svl/nfkeytab.hxx
new file mode 100644
index 000000000000..fdedea036d00
--- /dev/null
+++ b/include/svl/nfkeytab.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SVTOOLS_NFKEYTAB_HXX
+#define INCLUDED_SVTOOLS_NFKEYTAB_HXX
+
+#include <vector>
+#include <tools/string.hxx>
+
+//! For ImpSvNumberformatScan: first the short symbols, then the long symbols!
+//! e.g. first TT then TTTT
+//! The internal order is essentially for the format code string scanner!
+//! New keywords MUST NOT be inserted, only the NF_KEY_UNUSEDn may be used,
+//! NF_KEY_LASTKEYWORD must be adjusted accordingly. Otherwise old versions
+//! will fail upon reading these entries. Nevertheless, old versions are NOT
+//! able to display those new keywords => blank display.
+//
+// Note: 2005-09-02: the above applies to the binary file format.
+//
+// ER 15.12.99: This table is externally only to be used with method
+// String SvNumberformat::GetMappedFormatstring( const NfKeywordTable&, const LocaleDataWrapper& );
+// and method
+// void SvNumberFormatter::FillKeywordTable( NfKeywordTable&, LanguageType );
+enum NfKeywordIndex
+{
+ NF_KEY_NONE = 0,
+ NF_KEY_E, // exponential symbol
+ NF_KEY_AMPM, // AM/PM
+ NF_KEY_AP, // a/p
+ NF_KEY_MI, // minute (!)
+ NF_KEY_MMI, // minute 02 (!)
+ NF_KEY_M, // month (!)
+ NF_KEY_MM, // month 02 (!)
+ NF_KEY_MMM, // month short name
+ NF_KEY_MMMM, // month long name
+ NF_KEY_H, // hour
+ NF_KEY_HH, // hour 02
+ NF_KEY_S, // second
+ NF_KEY_SS, // second 02
+ NF_KEY_Q, // quarter
+ NF_KEY_QQ, // quarter 02
+ NF_KEY_D, // day of month
+ NF_KEY_DD, // day of month 02
+ NF_KEY_DDD, // day of week short
+ NF_KEY_DDDD, // day of week long
+ NF_KEY_YY, // year two digits
+ NF_KEY_YYYY, // year four digits
+ NF_KEY_NN, // day of week short
+ NF_KEY_NNNN, // day of week long with separator
+ NF_KEY_CCC, // currency bank symbol (old version)
+ NF_KEY_GENERAL, // General / Standard
+ NF_KEY_LASTOLDKEYWORD = NF_KEY_GENERAL,
+ NF_KEY_NNN, // day of week long without separator, as of version 6, 10.10.97
+ NF_KEY_WW, // week of year, as of version 8, 19.06.98
+ NF_KEY_MMMMM, // first letter of month name
+ NF_KEY_LASTKEYWORD = NF_KEY_MMMMM,
+ NF_KEY_UNUSED4,
+ NF_KEY_QUARTER, // was quarter word, not used anymore from SRC631 on (26.04.01)
+ NF_KEY_TRUE, // boolean true
+ NF_KEY_FALSE, // boolean false
+ NF_KEY_BOOLEAN, // boolean
+ NF_KEY_COLOR, // color
+ NF_KEY_FIRSTCOLOR,
+ NF_KEY_BLACK = NF_KEY_FIRSTCOLOR, // you do know colors, don't you?
+ NF_KEY_BLUE,
+ NF_KEY_GREEN,
+ NF_KEY_CYAN,
+ NF_KEY_RED,
+ NF_KEY_MAGENTA,
+ NF_KEY_BROWN,
+ NF_KEY_GREY,
+ NF_KEY_YELLOW,
+ NF_KEY_WHITE,
+ NF_KEY_LASTCOLOR = NF_KEY_WHITE,
+ NF_KEY_LASTKEYWORD_SO5 = NF_KEY_LASTCOLOR,
+ //! Keys from here on can't be saved in SO5 file format and MUST be
+ //! converted to string which means losing any information.
+ NF_KEY_AAA, // abbreviated day name from Japanese Xcl, same as DDD or NN English
+ NF_KEY_AAAA, // full day name from Japanese Xcl, same as DDDD or NNN English
+ NF_KEY_EC, // E non-gregorian calendar year without preceding 0
+ NF_KEY_EEC, // EE non-gregorian calendar year with preceding 0 (two digit)
+ NF_KEY_G, // abbreviated era name, latin characters M T S or H for Gengou calendar
+ NF_KEY_GG, // abbreviated era name
+ NF_KEY_GGG, // full era name
+ NF_KEY_R, // acts as EE (Xcl) => GR==GEE, GGR==GGEE, GGGR==GGGEE
+ NF_KEY_RR, // acts as GGGEE (Xcl)
+ NF_KEY_THAI_T, // Thai T modifier, speciality of Thai Excel, only used with Thai locale and converted to [NatNum1]
+ NF_KEYWORD_ENTRIES_COUNT
+};
+
+class NfKeywordTable
+{
+ typedef ::std::vector<OUString> Keywords_t;
+ Keywords_t m_keywords;
+
+public:
+ NfKeywordTable() : m_keywords(NF_KEYWORD_ENTRIES_COUNT) {};
+ virtual ~NfKeywordTable() {}
+
+ OUString & operator[] (Keywords_t::size_type n) { return m_keywords[n]; }
+ const OUString & operator[] (Keywords_t::size_type n) const { return m_keywords[n]; }
+};
+
+#endif // INCLUDED_SVTOOLS_NFKEYTAB_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/nfsymbol.hxx b/include/svl/nfsymbol.hxx
new file mode 100644
index 000000000000..0edfc33e112d
--- /dev/null
+++ b/include/svl/nfsymbol.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_SVTOOLS_NFSYMBOL_HXX
+#define INCLUDED_SVTOOLS_NFSYMBOL_HXX
+
+/* ATTENTION! If new types arrive that had its content previously handled as
+ * SYMBOLTYPE_STRING, they have to be added at several places in zforscan.cxx
+ * and/or zformat.cxx, and in xmloff/source/style/xmlnumfe.cxx. Mostly these
+ * are places where already NF_SYMBOLTYPE_STRING together with
+ * NF_SYMBOLTYPE_CURRENCY or NF_SYMBOLTYPE_DATESEP are used in the same case of
+ * a switch respectively an if-condition.
+ */
+
+namespace svt {
+
+/// Number formatter's symbol types of a token, if not key words, which are >0
+enum NfSymbolType
+{
+ NF_SYMBOLTYPE_STRING = -1, // literal string in output
+ NF_SYMBOLTYPE_DEL = -2, // special character
+ NF_SYMBOLTYPE_BLANK = -3, // blank for '_'
+ NF_SYMBOLTYPE_STAR = -4, // *-character
+ NF_SYMBOLTYPE_DIGIT = -5, // digit place holder
+ NF_SYMBOLTYPE_DECSEP = -6, // decimal separator
+ NF_SYMBOLTYPE_THSEP = -7, // group AKA thousand separator
+ NF_SYMBOLTYPE_EXP = -8, // exponent E
+ NF_SYMBOLTYPE_FRAC = -9, // fraction /
+ NF_SYMBOLTYPE_EMPTY = -10, // deleted symbols
+ NF_SYMBOLTYPE_FRACBLANK = -11, // delimiter between integer and fraction
+ NF_SYMBOLTYPE_CURRENCY = -12, // currency symbol
+ NF_SYMBOLTYPE_CURRDEL = -13, // currency symbol delimiter [$]
+ NF_SYMBOLTYPE_CURREXT = -14, // currency symbol extension -xxx
+ NF_SYMBOLTYPE_CALENDAR = -15, // calendar ID
+ NF_SYMBOLTYPE_CALDEL = -16, // calendar delimiter [~]
+ NF_SYMBOLTYPE_DATESEP = -17, // date separator
+ NF_SYMBOLTYPE_TIMESEP = -18, // time separator
+ NF_SYMBOLTYPE_TIME100SECSEP = -19, // time 100th seconds separator
+ NF_SYMBOLTYPE_PERCENT = -20, // percent %
+ NF_SYMBOLTYPE_FRAC_FDIV = -21 // forced divisors
+};
+
+} // namespace svt
+
+#endif // INCLUDED_SVTOOLS_NFSYMBOL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/nfversi.hxx b/include/svl/nfversi.hxx
new file mode 100644
index 000000000000..3e86af078fe4
--- /dev/null
+++ b/include/svl/nfversi.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 NF_NFVERSI_HXX
+#define NF_NFVERSI_HXX
+
+// file IDs
+
+#define SV_NUMBERFORMATTER_VERSION_SYSTORE 0x0004
+#define SV_NUMBERFORMATTER_VERSION_KEYWORDS 0x0005
+#define SV_NUMBERFORMATTER_VERSION_NEWSTANDARD 0x0006
+#define SV_NUMBERFORMATTER_VERSION_NF_TIME_HH_MMSS00 0x0007
+#define SV_NUMBERFORMATTER_VERSION_NF_DATE_WW 0x0008
+#define SV_NUMBERFORMATTER_VERSION_NEW_CURR 0x0009
+#define SV_NUMBERFORMATTER_VERSION_YEAR2000 0x000a
+#define SV_NUMBERFORMATTER_VERSION_TWODIGITYEAR 0x000b
+#define SV_NUMBERFORMATTER_VERSION_NF_DATETIME_SYS_DDMMYYYY_HHMMSS 0x000c
+#define SV_NUMBERFORMATTER_VERSION_CALENDAR 0x000d
+#define SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS 0x000e
+#define SV_NUMBERFORMATTER_VERSION_FIXED_FRACTION 0x000f
+
+#define SV_NUMBERFORMATTER_VERSION 0x000f
+
+// 1 to 1996-01-18
+// 2 1996-01-19 added TT.MM.JJJJ
+// 3 1996-02-13 (not emergency) added #.##0,00 CCC
+// 4 1997-07-30 364i store what SYSTEM actually was (using existing
+// Dummy field, no change of file format)
+// 5 1997-08-07 non-German is not always English
+// convert older non-German user defined formats on load
+// 6 1997-10-17 new keyword NNN for long weekday without separator
+// not evaluated in older versions!
+// New standard date formats, DIN, EN etc.
+// 7 1998-05-25 Standard format [HH]:MM:SS,00 (NF_TIME_HH_MMSS00) for
+// automatic input recognition of 100th seconds with hours
+// 8 1998-06-10 Standard format WW (NF_DATE_WW) for calendar week
+// 9 1998-12-17 new currency formats [$DM-xxx]
+// A 1999-01-25 store/load Year2000
+// B 1999-02-12 Year2000 is general TwoDigitYearStart
+// C ????-??-?? date/time format of system variables
+// D 2000-11-23 new calendar
+// E 2001-01-19 additional formats provided by i18n
+// F 2012-04-27 fixed fraction formats ?/4 and ??/100, actually added
+// already 2010/2011 but without versioning
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/nranges.hxx b/include/svl/nranges.hxx
new file mode 100644
index 000000000000..364bf59a44f2
--- /dev/null
+++ b/include/svl/nranges.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 .
+ */
+#ifdef MACOSX
+// We need an empty block in here. Otherwise, if the #ifndef _SFXNRANGES_HXX
+// line is the first line, the Mac OS X version of the gcc preprocessor will
+// incorrectly optimize the inclusion process and will never include this file
+// a second time
+#endif
+
+#ifndef _SFXNRANGES_HXX
+#define _SFXNRANGES_HXX
+
+#include <tools/solar.h>
+
+//========================================================================
+
+class SfxUShortRanges
+{
+ sal_uInt16* _pRanges; // 0-terminated array of sal_uInt16-pairs
+
+public:
+ SfxUShortRanges() : _pRanges( 0 ) {}
+ SfxUShortRanges( const SfxUShortRanges &rOrig );
+ SfxUShortRanges( sal_uInt16 nWhich1, sal_uInt16 nWhich2 );
+ SfxUShortRanges( const sal_uInt16* nNumTable );
+ ~SfxUShortRanges()
+ { delete [] _pRanges; }
+
+ sal_Bool operator == ( const SfxUShortRanges & ) const;
+ sal_Bool operator != ( const SfxUShortRanges & rRanges ) const
+ { return !( *this == rRanges ); }
+
+ SfxUShortRanges& operator = ( const SfxUShortRanges & );
+
+ SfxUShortRanges& operator += ( const SfxUShortRanges & );
+ SfxUShortRanges& operator -= ( const SfxUShortRanges & );
+ SfxUShortRanges& operator /= ( const SfxUShortRanges & );
+
+ sal_uInt16 Count() const;
+ sal_Bool IsEmpty() const
+ { return !_pRanges || 0 == *_pRanges; }
+
+ operator const sal_uInt16* () const
+ { return _pRanges; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/numuno.hxx b/include/svl/numuno.hxx
new file mode 100644
index 000000000000..515a73fb26a6
--- /dev/null
+++ b/include/svl/numuno.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 _NUMUNO_HXX
+#define _NUMUNO_HXX
+
+#include "svl/svldllapi.h"
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+class SvNumberFormatter;
+class SvNumFmtSuppl_Impl;
+
+namespace comphelper
+{
+ class SharedMutex;
+}
+
+//------------------------------------------------------------------
+
+// SvNumberFormatterServiceObj must be registered as service somewhere
+
+com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
+ SvNumberFormatterServiceObj_NewInstance(
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory>& rSMgr );
+
+//------------------------------------------------------------------
+
+// SvNumberFormatsSupplierObj: aggregate to document,
+// construct with SvNumberFormatter
+
+class SVL_DLLPUBLIC SvNumberFormatsSupplierObj : public cppu::WeakAggImplHelper2<
+ com::sun::star::util::XNumberFormatsSupplier,
+ com::sun::star::lang::XUnoTunnel>
+{
+private:
+ SvNumFmtSuppl_Impl* pImpl;
+
+public:
+ SvNumberFormatsSupplierObj();
+ SvNumberFormatsSupplierObj(SvNumberFormatter* pForm);
+ virtual ~SvNumberFormatsSupplierObj();
+
+ void SetNumberFormatter(SvNumberFormatter* pNew);
+ SvNumberFormatter* GetNumberFormatter() const;
+
+ // ueberladen, um Attribute im Dokument anzupassen
+ virtual void NumberFormatDeleted(sal_uInt32 nKey);
+ // ueberladen, um evtl. neu zu formatieren
+ virtual void SettingsChanged();
+
+ // XNumberFormatsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL
+ getNumberFormatSettings()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > SAL_CALL
+ getNumberFormats()
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
+ sal_Int8 >& aIdentifier )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
+ static SvNumberFormatsSupplierObj* getImplementation( const com::sun::star::uno::Reference<
+ com::sun::star::util::XNumberFormatsSupplier> xObj );
+
+ ::comphelper::SharedMutex& getSharedMutex() const;
+};
+
+#endif // #ifndef _NUMUNO_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/ondemand.hxx b/include/svl/ondemand.hxx
new file mode 100644
index 000000000000..b3a2c42e11e6
--- /dev/null
+++ b/include/svl/ondemand.hxx
@@ -0,0 +1,384 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SVTOOLS_ONDEMAND_HXX
+#define INCLUDED_SVTOOLS_ONDEMAND_HXX
+
+#include <unotools/syslocale.hxx>
+#include <i18nlangtag/lang.h>
+#include <unotools/localedatawrapper.hxx>
+#include <unotools/calendarwrapper.hxx>
+#include <unotools/collatorwrapper.hxx>
+#include <com/sun/star/i18n/CollatorOptions.hpp>
+#include <unotools/transliterationwrapper.hxx>
+#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <unotools/nativenumberwrapper.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <comphelper/processfactory.hxx>
+
+/*
+ On demand instanciation and initialization of several i18n wrappers,
+ helping the number formatter to not perform worse than it already does.
+ */
+
+/** @short
+ Switch between LANGUAGE_SYSTEM and LANGUAGE_ENGLISH_US and any other
+ LocaleDataWrapper.
+ SvNumberformatter uses it upon switching locales.
+
+ @descr
+ Avoids reloading and analysing of locale data again and again.
+
+ @ATTENTION
+ If the default ctor is used the init() method MUST be called before
+ accessing any locale data. The passed parameters Locale and LanguageType
+ must match each other.
+ */
+
+class OnDemandLocaleDataWrapper
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ SvtSysLocale aSysLocale;
+ LanguageType eCurrentLanguage;
+ LanguageType eLastAnyLanguage;
+ const LocaleDataWrapper* pSystem;
+ const LocaleDataWrapper* pEnglish;
+ LocaleDataWrapper* pAny;
+ const LocaleDataWrapper* pCurrent;
+ bool bInitialized;
+
+public:
+ OnDemandLocaleDataWrapper()
+ : eLastAnyLanguage( LANGUAGE_DONTKNOW )
+ , pEnglish(0)
+ , pAny(0)
+ , bInitialized(false)
+ {
+ pCurrent = pSystem = aSysLocale.GetLocaleDataPtr();
+ eCurrentLanguage = LANGUAGE_SYSTEM;
+ }
+ OnDemandLocaleDataWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const LanguageTag& rLanguageTag
+ )
+ : pEnglish(0)
+ , pAny(0)
+ , pCurrent(0)
+ , bInitialized(false)
+ {
+ pSystem = aSysLocale.GetLocaleDataPtr();
+ init( rxContext, rLanguageTag );
+ }
+ ~OnDemandLocaleDataWrapper()
+ {
+ delete pEnglish;
+ delete pAny;
+ }
+
+ bool isInitialized() const { return bInitialized; }
+
+ bool is() const { return pCurrent != NULL; }
+
+ void init(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const LanguageTag& rLanguageTag
+ )
+ {
+ m_xContext = rxContext;
+ changeLocale( rLanguageTag );
+ bInitialized = true;
+ }
+
+ void changeLocale( const LanguageTag& rLanguageTag )
+ {
+ LanguageType eLang = rLanguageTag.getLanguageType( false);
+ switch ( eLang )
+ {
+ case LANGUAGE_SYSTEM :
+ pCurrent = pSystem;
+ break;
+ case LANGUAGE_ENGLISH_US :
+ if ( !pEnglish )
+ pEnglish = new LocaleDataWrapper( m_xContext, rLanguageTag );
+ pCurrent = pEnglish;
+ break;
+ default:
+ if ( !pAny )
+ {
+ pAny = new LocaleDataWrapper( m_xContext, rLanguageTag );
+ eLastAnyLanguage = eLang;
+ }
+ else if ( eLastAnyLanguage != eLang )
+ {
+ pAny->setLanguageTag( rLanguageTag );
+ eLastAnyLanguage = eLang;
+ }
+ pCurrent = pAny;
+ }
+ eCurrentLanguage = eLang;
+ }
+
+ LanguageType getCurrentLanguage() const
+ { return eCurrentLanguage; }
+
+ LocaleDataWrapper* getAnyLocale()
+ {
+ if ( !pAny )
+ {
+ pAny = new LocaleDataWrapper( m_xContext, pCurrent->getLanguageTag() );
+ eLastAnyLanguage = eCurrentLanguage;
+ }
+ else if ( pCurrent != pAny )
+ {
+ pAny->setLanguageTag( pCurrent->getLanguageTag() );
+ eLastAnyLanguage = eCurrentLanguage;
+ }
+ return pAny;
+ }
+
+ const LocaleDataWrapper* get() const { return pCurrent; }
+ const LocaleDataWrapper* operator->() const { return get(); }
+ const LocaleDataWrapper& operator*() const { return *get(); }
+};
+
+/** Load a calendar only if it's needed.
+ SvNumberformatter uses it upon switching locales.
+ @ATTENTION If the default ctor is used the init() method MUST be called
+ before accessing the calendar.
+ */
+class OnDemandCalendarWrapper
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::lang::Locale aLocale;
+ mutable CalendarWrapper* pPtr;
+ mutable bool bValid;
+ bool bInitialized;
+
+public:
+ OnDemandCalendarWrapper()
+ : pPtr(0)
+ , bValid(false)
+ , bInitialized(false)
+ {}
+ OnDemandCalendarWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ ::com::sun::star::lang::Locale& rLocale
+ )
+ : bValid(false)
+ , bInitialized(false)
+ {
+ init( rxContext, rLocale );
+ }
+ ~OnDemandCalendarWrapper()
+ {
+ delete pPtr;
+ }
+
+ bool isInitialized() const { return bInitialized; }
+
+ bool is() const { return pPtr != NULL; }
+
+ void init(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::lang::Locale& rLocale
+ )
+ {
+ m_xContext = rxContext;
+ changeLocale( rLocale );
+ if ( pPtr )
+ {
+ delete pPtr;
+ pPtr = NULL;
+ }
+ bInitialized = true;
+ }
+
+ void changeLocale( const ::com::sun::star::lang::Locale& rLocale )
+ {
+ bValid = false;
+ aLocale = rLocale;
+ }
+
+ CalendarWrapper* get() const
+ {
+ if ( !bValid )
+ {
+ if ( !pPtr )
+ pPtr = new CalendarWrapper( m_xContext );
+ pPtr->loadDefaultCalendar( aLocale );
+ bValid = true;
+ }
+ return pPtr;
+ }
+
+ CalendarWrapper* operator->() { return get(); }
+ CalendarWrapper& operator*() { return *get(); }
+};
+
+/** Load a transliteration only if it's needed.
+ SvNumberformatter uses it upon switching locales.
+ @ATTENTION If the default ctor is used the init() method MUST be called
+ before accessing the transliteration.
+ */
+class OnDemandTransliterationWrapper
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ LanguageType eLanguage;
+ ::com::sun::star::i18n::TransliterationModules nType;
+ mutable ::utl::TransliterationWrapper* pPtr;
+ mutable bool bValid;
+ bool bInitialized;
+
+public:
+ OnDemandTransliterationWrapper()
+ : eLanguage( LANGUAGE_SYSTEM )
+ , pPtr(0)
+ , bValid(false)
+ , bInitialized(false)
+ {}
+ OnDemandTransliterationWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ LanguageType eLang,
+ ::com::sun::star::i18n::TransliterationModules nTypeP
+ )
+ : bValid(false)
+ , bInitialized(false)
+ {
+ init( rxContext, eLang, nTypeP );
+ }
+ ~OnDemandTransliterationWrapper()
+ {
+ delete pPtr;
+ }
+
+ bool isInitialized() const { return bInitialized; }
+
+ bool is() const { return pPtr != NULL; }
+
+ void init(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ LanguageType eLang,
+ ::com::sun::star::i18n::TransliterationModules nTypeP
+ )
+ {
+ m_xContext = rxContext;
+ nType = nTypeP;
+ changeLocale( eLang );
+ if ( pPtr )
+ {
+ delete pPtr;
+ pPtr = NULL;
+ }
+ bInitialized = true;
+ }
+
+ void changeLocale( LanguageType eLang )
+ {
+ bValid = false;
+ eLanguage = eLang;
+ }
+
+ const ::utl::TransliterationWrapper* get() const
+ {
+ if ( !bValid )
+ {
+ if ( !pPtr )
+ pPtr = new ::utl::TransliterationWrapper( m_xContext, nType );
+ pPtr->loadModuleIfNeeded( eLanguage );
+ bValid = true;
+ }
+ return pPtr;
+ }
+
+ const ::utl::TransliterationWrapper* getForModule( const String& rModule, LanguageType eLang ) const
+ {
+ if ( !pPtr )
+ pPtr = new ::utl::TransliterationWrapper( m_xContext, nType );
+ pPtr->loadModuleByImplName( rModule, eLang );
+ bValid = false; // reforce settings change in get()
+ return pPtr;
+ }
+
+ const ::utl::TransliterationWrapper* operator->() const { return get(); }
+ const ::utl::TransliterationWrapper& operator*() const { return *get(); }
+};
+
+/** Load a native number service wrapper only if it's needed.
+ SvNumberformatter uses it.
+
+ @ATTENTION
+ If the default ctor is used the init() method MUST be called
+ before accessing the native number supplier.
+ */
+class OnDemandNativeNumberWrapper
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ mutable NativeNumberWrapper* pPtr;
+ bool bInitialized;
+
+public:
+ OnDemandNativeNumberWrapper()
+ : pPtr(0)
+ , bInitialized(false)
+ {}
+ OnDemandNativeNumberWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext
+ )
+ : pPtr(0)
+ , bInitialized(false)
+ {
+ init( rxContext );
+ }
+ ~OnDemandNativeNumberWrapper()
+ {
+ delete pPtr;
+ }
+
+ bool isInitialized() const { return bInitialized; }
+
+ void init(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext
+ )
+ {
+ m_xContext = rxContext;
+ if ( pPtr )
+ {
+ delete pPtr;
+ pPtr = NULL;
+ }
+ bInitialized = true;
+ }
+
+ bool is() const { return pPtr != NULL; }
+
+ NativeNumberWrapper* get() const
+ {
+ if ( !pPtr )
+ pPtr = new NativeNumberWrapper( m_xContext );
+ return pPtr;
+ }
+
+ NativeNumberWrapper* operator->() { return get(); }
+ NativeNumberWrapper& operator*() { return *get(); }
+};
+
+#endif // INCLUDED_SVTOOLS_ONDEMAND_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/outstrm.hxx b/include/svl/outstrm.hxx
new file mode 100644
index 000000000000..31899599fc90
--- /dev/null
+++ b/include/svl/outstrm.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 SVTOOLS_OUTSTRM_HXX
+#define SVTOOLS_OUTSTRM_HXX
+
+#include "svl/svldllapi.h"
+#include <com/sun/star/uno/Reference.h>
+#include <tools/stream.hxx>
+
+namespace com { namespace sun { namespace star { namespace io {
+ class XOutputStream;
+} } } }
+
+//============================================================================
+class SVL_DLLPUBLIC SvOutputStream: public SvStream
+{
+ com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >
+ m_xStream;
+
+ SVL_DLLPRIVATE virtual sal_uLong GetData(void *, sal_uLong);
+
+ SVL_DLLPRIVATE virtual sal_uLong PutData(void const * pData, sal_uLong nSize);
+
+ SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong);
+
+ SVL_DLLPRIVATE virtual void FlushData();
+
+ SVL_DLLPRIVATE virtual void SetSize(sal_uLong);
+
+public:
+ SvOutputStream(com::sun::star::uno::Reference<
+ com::sun::star::io::XOutputStream > const &
+ rTheStream);
+
+ virtual ~SvOutputStream();
+
+ virtual sal_uInt16 IsA() const;
+};
+
+#endif // SVTOOLS_OUTSTRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/ownlist.hxx b/include/svl/ownlist.hxx
new file mode 100644
index 000000000000..e4cead159c8b
--- /dev/null
+++ b/include/svl/ownlist.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _OWNLIST_HXX
+#define _OWNLIST_HXX
+
+#include "svl/svldllapi.h"
+#include <com/sun/star/uno/Sequence.hxx>
+#include <vector>
+
+namespace com { namespace sun { namespace star {
+ namespace beans {
+ struct PropertyValue;
+ }
+}}}
+
+//=========================================================================
+class SvCommand
+/* [Beschreibung]
+
+ Enth"alt einen String, welcher das Kommando angibt und eine weiteren
+ String, der das Argument des Kommandos bildet. W"urde solch ein
+ Kommando "uber die Kommandozeile angegeben werden, s"ahe es wie folgt
+ aus: Kommando = Argument.
+*/
+{
+ OUString aCommand;
+ OUString aArgument;
+public:
+ SvCommand() {}
+ SvCommand( const OUString & rCommand, const OUString & rArg )
+ {
+ aCommand = rCommand;
+ aArgument = rArg;
+ }
+ const OUString & GetCommand() const { return aCommand; }
+ const OUString & GetArgument() const { return aArgument; }
+};
+
+typedef ::std::vector< SvCommand > SvCommandList_impl;
+
+//=========================================================================
+class SVL_DLLPUBLIC SvCommandList
+/* [Beschreibung]
+
+ Die Liste enth"alt Objekte vom Typ SvCommand. Wird ein Objekt
+ eingef"ugt, dann wird es kopiert und das neue Objekt wird
+ in die Liste gestellt.
+*/
+{
+private:
+ SvCommandList_impl aCommandList;
+
+public:
+ SvCommand& Append( const OUString & rCommand, const OUString & rArg );
+ bool AppendCommands( const OUString & rCmd, sal_Int32 * pEaten );
+
+ bool FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& );
+ void FillSequence( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& );
+
+ size_t size() const { return aCommandList.size(); }
+
+ SvCommand operator[]( size_t i) {
+ return aCommandList[ i ];
+ }
+
+ void clear() {
+ aCommandList.clear();
+ }
+};
+
+#endif // _OWNLIST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/pickerhistoryaccess.hxx b/include/svl/pickerhistoryaccess.hxx
new file mode 100644
index 000000000000..5f91d3578f9a
--- /dev/null
+++ b/include/svl/pickerhistoryaccess.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 SVTOOLS_PICKERHISTORYACCESS_HXX
+#define SVTOOLS_PICKERHISTORYACCESS_HXX
+
+#include "svl/svldllapi.h"
+
+#include <com/sun/star/uno/Reference.hxx>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ // --------------------------------------------------------------------
+ SVL_DLLPUBLIC void addFolderPicker(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxPicker );
+
+ SVL_DLLPUBLIC void addFilePicker(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxPicker );
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // SVTOOLS_PICKERHISTORYACCESS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/poolcach.hxx b/include/svl/poolcach.hxx
new file mode 100644
index 000000000000..eaf6ad3deef9
--- /dev/null
+++ b/include/svl/poolcach.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 _SFXPOOLCACH_HXX
+#define _SFXPOOLCACH_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/solar.h>
+#include <vector>
+
+//------------------------------------------------------------------------
+
+class SfxItemPool;
+class SfxItemSet;
+class SfxPoolItem;
+class SfxSetItem;
+
+struct SfxItemModifyImpl
+{
+ const SfxSetItem *pOrigItem;
+ SfxSetItem *pPoolItem;
+};
+
+typedef std::vector<SfxItemModifyImpl> SfxItemModifyArr_Impl;
+
+
+class SVL_DLLPUBLIC SfxItemPoolCache
+{
+ SfxItemPool *pPool;
+ SfxItemModifyArr_Impl *pCache;
+ const SfxItemSet *pSetToPut;
+ const SfxPoolItem *pItemToPut;
+
+public:
+ SfxItemPoolCache( SfxItemPool *pPool,
+ const SfxPoolItem *pPutItem );
+ SfxItemPoolCache( SfxItemPool *pPool,
+ const SfxItemSet *pPutSet );
+ ~SfxItemPoolCache();
+
+ const SfxSetItem& ApplyTo( const SfxSetItem& rSetItem, sal_Bool bNew = sal_False );
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx
new file mode 100644
index 000000000000..5e041825186a
--- /dev/null
+++ b/include/svl/poolitem.hxx
@@ -0,0 +1,415 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXPOOLITEM_HXX
+#define _SFXPOOLITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <com/sun/star/uno/Any.hxx>
+
+#include <sal/config.h>
+#include <tools/rtti.hxx>
+#include <limits.h>
+#include <tools/solar.h>
+#include <tools/debug.hxx>
+#include <tools/string.hxx>
+#include <svl/hint.hxx>
+
+typedef long SfxArgumentError;
+
+class SbxVariable;
+class SbxObject;
+class SvStream;
+class Color;
+class IntlWrapper;
+
+namespace com { namespace sun { namespace star { namespace uno { class Any; } } } }
+
+static const sal_uInt32 SFX_ITEMS_DIRECT= 0xffffffff;
+static const sal_uInt32 SFX_ITEMS_NULL= 0xfffffff0; // instead StoreSurrogate
+static const sal_uInt32 SFX_ITEMS_DEFAULT= 0xfffffffe;
+
+#define SFX_ITEMS_POOLDEFAULT 0xffff
+#define SFX_ITEMS_STATICDEFAULT 0xfffe
+#define SFX_ITEMS_DELETEONIDLE 0xfffd
+
+#define SFX_ITEMS_OLD_MAXREF 0xffef
+#define SFX_ITEMS_MAXREF 0xfffffffe
+#define SFX_ITEMS_SPECIAL 0xffffffff
+
+#define CONVERT_TWIPS 0x80 //Uno-Konvertierung fuer Massangaben (fuer MemberId)
+
+// -----------------------------------------------------------------------
+
+// UNO3 shortcuts
+
+// warning, if there is no boolean inside the any this will always return the value false
+inline sal_Bool Any2Bool( const ::com::sun::star::uno::Any&rValue )
+{
+ sal_Bool nValue = sal_False;
+ if( rValue.hasValue() )
+ {
+ if( rValue.getValueType() == ::getCppuBooleanType() )
+ {
+ nValue = *(sal_Bool*)rValue.getValue();
+ }
+ else
+ {
+ sal_Int32 nNum = 0;
+ if( rValue >>= nNum )
+ nValue = nNum != 0;
+ }
+ }
+
+ return nValue;
+}
+
+inline ::com::sun::star::uno::Any Bool2Any( sal_Bool bValue )
+{
+ return ::com::sun::star::uno::Any( &bValue, ::getCppuBooleanType() );
+}
+
+// -----------------------------------------------------------------------
+
+//! Notloesung!!!
+enum SfxFieldUnit
+{
+ SFX_FUNIT_NONE, SFX_FUNIT_MM, SFX_FUNIT_CM, SFX_FUNIT_M, SFX_FUNIT_KM,
+ SFX_FUNIT_TWIP, SFX_FUNIT_POINT, SFX_FUNIT_PICA,
+ SFX_FUNIT_INCH, SFX_FUNIT_FOOT, SFX_FUNIT_MILE, SFX_FUNIT_CHAR, SFX_FUNIT_LINE, SFX_FUNIT_CUSTOM
+};
+
+enum SfxMapUnit
+{
+ SFX_MAPUNIT_100TH_MM,
+ SFX_MAPUNIT_10TH_MM,
+ SFX_MAPUNIT_MM,
+ SFX_MAPUNIT_CM,
+ SFX_MAPUNIT_1000TH_INCH,
+ SFX_MAPUNIT_100TH_INCH,
+ SFX_MAPUNIT_10TH_INCH,
+ SFX_MAPUNIT_INCH,
+ SFX_MAPUNIT_POINT,
+ SFX_MAPUNIT_TWIP,
+ SFX_MAPUNIT_PIXEL,
+ SFX_MAPUNIT_SYSFONT,
+ SFX_MAPUNIT_APPFONT,
+ SFX_MAPUNIT_RELATIVE,
+ SFX_MAPUNIT_ABSOLUTE
+};
+
+// -----------------------------------------------------------------------
+
+enum SfxItemPresentation
+
+/* [Beschreibung]
+
+ Die Werte dieses Enums bezeichnen den Grad der textuellen
+ Presentation eines Items nach Aufruf der virtuellen Methode
+ <SfxPoolItem::GetPresentation()const>.
+*/
+
+{
+ SFX_ITEM_PRESENTATION_NONE,
+ SFX_ITEM_PRESENTATION_NAMEONLY,
+ SFX_ITEM_PRESENTATION_NAMELESS,
+ SFX_ITEM_PRESENTATION_COMPLETE
+};
+
+// -----------------------------------------------------------------------
+
+typedef sal_uInt16 SfxItemState;
+
+#define SFX_ITEM_UNKNOWN 0x0000
+
+#define SFX_ITEM_DISABLED 0x0001
+#define SFX_ITEM_READONLY 0x0002
+
+#define SFX_ITEM_DONTCARE 0x0010
+#define SFX_ITEM_DEFAULT 0x0020
+#define SFX_ITEM_SET 0x0030
+
+// old stuff - dont use!!!
+#define SFX_ITEM_AVAILABLE SFX_ITEM_DEFAULT
+#define SFX_ITEM_OFF SFX_ITEM_DEFAULT
+#define SFX_ITEM_ON SFX_ITEM_SET
+
+DBG_NAMEEX_VISIBILITY(SfxPoolItem, SVL_DLLPUBLIC)
+DBG_NAMEEX(SfxVoidItem)
+DBG_NAMEEX(SfxItemHandle)
+
+class SvXMLUnitConverter;
+class SfxItemPool;
+class SfxItemSet;
+
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxPoolItem
+{
+friend class SfxItemPool;
+friend class SfxItemDesruptor_Impl;
+friend class SfxItemPoolCache;
+friend class SfxItemSet;
+friend class SfxVoidItem;
+
+ sal_uLong m_nRefCount;
+ sal_uInt16 m_nWhich;
+ sal_uInt16 m_nKind;
+
+private:
+ inline void SetRefCount( sal_uLong n );
+ inline void SetKind( sal_uInt16 n );
+public:
+ inline sal_uLong AddRef( sal_uLong n = 1 ) const;
+private:
+ inline sal_uLong ReleaseRef( sal_uLong n = 1 ) const;
+ SVL_DLLPRIVATE long Delete_Impl(void*);
+
+protected:
+ explicit SfxPoolItem( sal_uInt16 nWhich = 0 );
+ SfxPoolItem( const SfxPoolItem& );
+
+public:
+ TYPEINFO();
+ virtual ~SfxPoolItem();
+
+ void SetWhich( sal_uInt16 nId ) {
+ DBG_CHKTHIS(SfxPoolItem, 0);
+ m_nWhich = nId; }
+ sal_uInt16 Which() const {
+ DBG_CHKTHIS(SfxPoolItem, 0);
+ return m_nWhich; }
+ virtual int operator==( const SfxPoolItem& ) const = 0;
+ int operator!=( const SfxPoolItem& rItem ) const
+ { return !(*this == rItem); }
+ virtual int Compare( const SfxPoolItem &rWith ) const;
+ virtual int Compare( const SfxPoolItem &rWith, const IntlWrapper& rIntlWrapper ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresentationMetric,
+ OUString &rText,
+ const IntlWrapper * pIntlWrapper = 0 ) const;
+
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+ virtual bool ScaleMetrics( long lMult, long lDiv );
+ virtual bool HasMetrics() const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0;
+
+ sal_uLong GetRefCount() const { return m_nRefCount; }
+ inline sal_uInt16 GetKind() const { return m_nKind; }
+
+ /** Read in a Unicode string from a streamed byte string representation.
+
+ @param rStream Some (input) stream. Its Stream/TargetCharSets must
+ be set to correct values!
+
+ @param rString On success, returns the reconstructed Unicode string.
+
+ @return True if the string was successfully read and reconstructed.
+ */
+ static OUString readByteString(SvStream & rStream);
+
+ /** Write a byte string representation of a Unicode string into a stream.
+
+ @param rStream Some (output) stream. Its Stream/TargetCharSets must
+ be set to correct values!
+
+ @param rString Some Unicode string.
+ */
+ static void writeByteString(SvStream & rStream,
+ const OUString& rString);
+
+ /** Read in a Unicode string from either a streamed Unicode or byte string
+ representation.
+
+ @param rStream Some (input) stream. If bUnicode is false, its
+ Stream/TargetCharSets must be set to correct values!
+
+ @param bUnicode Whether to read in a stream Unicode (true) or byte
+ string (false) representation.
+
+ @return On success, returns the reconstructed Unicode string.
+ */
+ static OUString readUnicodeString(SvStream & rStream, bool bUnicode);
+
+ /** Write a Unicode string representation of a Unicode string into a
+ stream.
+
+ @param rStream Some (output) stream.
+
+ @param rString Some Unicode string.
+ */
+ static void writeUnicodeString(SvStream & rStream,
+ const OUString& rString);
+
+private:
+ SfxPoolItem& operator=( const SfxPoolItem& ); // n.i.!!
+};
+
+// -----------------------------------------------------------------------
+
+inline void SfxPoolItem::SetRefCount( sal_uLong n )
+{
+ DBG_CHKTHIS( SfxPoolItem, 0 );
+ m_nRefCount = n;
+ m_nKind = 0;
+}
+
+inline void SfxPoolItem::SetKind( sal_uInt16 n )
+{
+ DBG_CHKTHIS( SfxPoolItem, 0 );
+ m_nRefCount = SFX_ITEMS_SPECIAL;
+ m_nKind = n;
+}
+
+inline sal_uLong SfxPoolItem::AddRef( sal_uLong n ) const
+{
+ DBG_CHKTHIS( SfxPoolItem, 0 );
+ DBG_ASSERT(m_nRefCount <= SFX_ITEMS_MAXREF, "AddRef with non-Pool-Item");
+ DBG_ASSERT(ULONG_MAX - m_nRefCount > n, "AddRef: refcount overflow");
+ return (const_cast<SfxPoolItem *>(this)->m_nRefCount += n);
+}
+
+inline sal_uLong SfxPoolItem::ReleaseRef( sal_uLong n ) const
+{
+ DBG_CHKTHIS( SfxPoolItem, 0 );
+ DBG_ASSERT(m_nRefCount <= SFX_ITEMS_MAXREF, "AddRef with non-Pool-Item");
+ DBG_ASSERT(m_nRefCount >= n, "AddRef: refcount underflow");
+ const_cast<SfxPoolItem *>(this)->m_nRefCount -= n;
+ return m_nRefCount;
+}
+
+// -----------------------------------------------------------------------
+
+inline int IsPoolDefaultItem(const SfxPoolItem *pItem )
+{
+ return pItem && pItem->GetKind() == SFX_ITEMS_POOLDEFAULT;
+}
+
+inline int IsStaticDefaultItem(const SfxPoolItem *pItem )
+{
+ return pItem && pItem->GetKind() == SFX_ITEMS_STATICDEFAULT;
+}
+
+inline int IsDefaultItem( const SfxPoolItem *pItem )
+{
+ return pItem && pItem->GetKind() >= SFX_ITEMS_STATICDEFAULT;
+}
+
+inline int IsPooledItem( const SfxPoolItem *pItem )
+{
+ return pItem && pItem->GetRefCount() > 0 && pItem->GetRefCount() <= SFX_ITEMS_MAXREF;
+}
+
+inline int IsInvalidItem(const SfxPoolItem *pItem)
+{
+ return pItem == (SfxPoolItem *)-1;
+}
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxVoidItem: public SfxPoolItem
+{
+ SfxVoidItem & operator=( const SfxVoidItem& ); // not implemented.
+public:
+ TYPEINFO();
+ explicit SfxVoidItem( sal_uInt16 nWhich );
+ SfxVoidItem( sal_uInt16 nWhich, SvStream & );
+ SfxVoidItem( const SfxVoidItem& );
+ ~SfxVoidItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ // von sich selbst eine Kopie erzeugen
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ void SetWhich(sal_uInt16 nWh) { m_nWhich = nWh; }
+};
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxSetItem: public SfxPoolItem
+{
+ SfxItemSet *pSet;
+
+ SfxSetItem & operator=( const SfxSetItem& ); // not implemented.
+
+public:
+ TYPEINFO();
+ SfxSetItem( sal_uInt16 nWhich, SfxItemSet *pSet );
+ SfxSetItem( sal_uInt16 nWhich, const SfxItemSet &rSet );
+ SfxSetItem( const SfxSetItem&, SfxItemPool *pPool = 0 );
+ ~SfxSetItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ // von sich selbst eine Kopie erzeugen
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const = 0;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nVer) const;
+
+ const SfxItemSet& GetItemSet() const
+ { return *pSet; }
+ SfxItemSet& GetItemSet()
+ { return *pSet; }
+};
+
+// -----------------------------------------------------------------------
+// Handle Klasse fuer PoolItems
+
+class SVL_DLLPUBLIC SfxItemHandle
+{
+ sal_uInt16 *pRef;
+ SfxPoolItem *pItem;
+public:
+ explicit SfxItemHandle( SfxPoolItem& );
+ SfxItemHandle( const SfxItemHandle& );
+ ~SfxItemHandle();
+
+ const SfxItemHandle &operator=(const SfxItemHandle &);
+ const SfxPoolItem &GetItem() const { return *pItem; }
+};
+
+// -----------------------------------------------------------------------
+
+DECL_PTRHINT(SVL_DLLPUBLIC, SfxPoolItemHint, SfxPoolItem);
+
+// -----------------------------------------------------------------------
+
+#endif // #ifndef _SFXPOOLITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/ptitem.hxx b/include/svl/ptitem.hxx
new file mode 100644
index 000000000000..6906e24baaf7
--- /dev/null
+++ b/include/svl/ptitem.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 _SFXPTITEM_HXX
+#define _SFXPTITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <svl/poolitem.hxx>
+#include <tools/gen.hxx>
+
+class SvStream;
+
+DBG_NAMEEX_VISIBILITY(SfxPointItem, SVL_DLLPUBLIC)
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxPointItem: public SfxPoolItem
+{
+ Point aVal;
+
+public:
+ TYPEINFO();
+ SfxPointItem();
+ SfxPointItem( sal_uInt16 nWhich, const Point& rVal );
+ SfxPointItem( const SfxPointItem& );
+ ~SfxPointItem() {
+ DBG_DTOR(SfxPointItem, 0); }
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ const Point& GetValue() const { return aVal; }
+ void SetValue( const Point& rNewVal ) {
+ DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
+ aVal = rNewVal;
+ }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/rectitem.hxx b/include/svl/rectitem.hxx
new file mode 100644
index 000000000000..b9f0f950eb63
--- /dev/null
+++ b/include/svl/rectitem.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 _SFXRECTITEM_HXX
+#define _SFXRECTITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/debug.hxx>
+#include <tools/gen.hxx>
+#include <svl/poolitem.hxx>
+
+class SvStream;
+
+DBG_NAMEEX_VISIBILITY(SfxRectangleItem, SVL_DLLPUBLIC)
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxRectangleItem: public SfxPoolItem
+{
+ Rectangle aVal;
+
+public:
+ TYPEINFO();
+ SfxRectangleItem();
+ SfxRectangleItem( sal_uInt16 nWhich, const Rectangle& rVal );
+ SfxRectangleItem( const SfxRectangleItem& );
+ ~SfxRectangleItem() {
+ DBG_DTOR(SfxRectangleItem, 0); }
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ const Rectangle& GetValue() const { return aVal; }
+ void SetValue( const Rectangle& rNewVal ) {
+ DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
+ aVal = rNewVal;
+ }
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/restrictedpaths.hxx b/include/svl/restrictedpaths.hxx
new file mode 100644
index 000000000000..85326a569654
--- /dev/null
+++ b/include/svl/restrictedpaths.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 SVTOOLS_RESTRICTEDPATHS_HXX
+#define SVTOOLS_RESTRICTEDPATHS_HXX
+
+#include <svl/urlfilter.hxx>
+#include <svl/svldllapi.h>
+
+#include <vector>
+
+namespace svt
+{
+ class SVL_DLLPUBLIC RestrictedPaths : public IUrlFilter
+ {
+ private:
+ ::std::vector< OUString > m_aUnrestrictedURLs;
+ bool m_bFilterIsEnabled;
+
+ public:
+ RestrictedPaths();
+ virtual ~RestrictedPaths();
+
+ inline bool hasFilter() const { return !m_aUnrestrictedURLs.empty(); }
+ inline const ::std::vector< OUString >& getFilter() const { return m_aUnrestrictedURLs; }
+
+ inline void enableFilter( bool _bEnable ) { m_bFilterIsEnabled = _bEnable; }
+ inline bool isFilterEnabled() const { return m_bFilterIsEnabled; }
+
+ public:
+ /** checks URL access permissions
+
+ <p>with the "restriction" feature we have in the file dialog, it's possible that
+ only certain URLs can be browsed. This method checks whether a given URL belongs
+ to this set of permitted URLs.</p>
+
+ <p>If no "access restriction" is effective, this method always returns <TRUE/>.</p>
+ */
+ virtual bool isUrlAllowed( const OUString& _rURL ) const;
+
+ /** checks URL access permissions
+
+ <p>with the "restriction" feature we have in the file dialog, it's possible that
+ only certain URLs can be browsed. This method checks whether a given URL belongs
+ to this set of permitted URLs.</p>
+
+ <p>Default behavior allows access to parent folder of a restricted folder (but not to its siblings).
+ If allowParents is set to <FALSE/> parent folders will be treated as forbidden.
+
+ <p>If no "access restriction" is effective, this method always returns <TRUE/>.</p>
+ */
+ bool isUrlAllowed( const OUString& _rURL, bool allowParents ) const;
+ };
+
+} // namespace svt
+
+#endif // SVTOOLS_RESTRICTEDPATHS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/rngitem.hxx b/include/svl/rngitem.hxx
new file mode 100644
index 000000000000..450e958ec179
--- /dev/null
+++ b/include/svl/rngitem.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 _SFXRNGITEM_HXX
+#define _SFXRNGITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <svl/poolitem.hxx>
+
+class SvStream;
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxRangeItem : public SfxPoolItem
+{
+private:
+ sal_uInt16 nFrom;
+ sal_uInt16 nTo;
+public:
+ TYPEINFO();
+ SfxRangeItem();
+ SfxRangeItem( sal_uInt16 nWID, sal_uInt16 nFrom, sal_uInt16 nTo );
+ SfxRangeItem( const SfxRangeItem& rItem );
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ inline sal_uInt16& From() { return nFrom; }
+ inline sal_uInt16 From() const { return nFrom; }
+ inline sal_uInt16& To() { return nTo; }
+ inline sal_uInt16 To() const { return nTo; }
+ inline sal_Bool HasRange() const { return nTo>nFrom; }
+ virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const;
+ virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
+};
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxUShortRangesItem : public SfxPoolItem
+{
+private:
+ sal_uInt16* _pRanges;
+
+public:
+ TYPEINFO();
+ SfxUShortRangesItem();
+ SfxUShortRangesItem( sal_uInt16 nWID, SvStream &rStream );
+ SfxUShortRangesItem( const SfxUShortRangesItem& rItem );
+ virtual ~SfxUShortRangesItem();
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ inline const sal_uInt16* GetRanges() const { return _pRanges; }
+ virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const;
+ virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/sfontitm.hxx b/include/svl/sfontitm.hxx
new file mode 100644
index 000000000000..f9bcbdc7f917
--- /dev/null
+++ b/include/svl/sfontitm.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 _SFONTITM_HXX
+#define _SFONTITM_HXX
+
+#include <tools/color.hxx>
+#include <tools/gen.hxx>
+#include <i18nlangtag/lang.h>
+#include <svl/poolitem.hxx>
+
+//============================================================================
+class SfxFontItem: public SfxPoolItem
+{
+ XubString m_aName;
+ XubString m_aStyleName;
+ Size m_aSize;
+ Color m_aColor;
+ Color m_aFillColor;
+ rtl_TextEncoding m_nCharSet;
+ LanguageType m_nLanguage;
+ sal_Int16 m_nFamily;
+ sal_Int16 m_nPitch;
+ sal_Int16 m_nWeight;
+ sal_Int16 m_nWidthType;
+ sal_Int16 m_nItalic;
+ sal_Int16 m_nUnderline;
+ sal_Int16 m_nStrikeout;
+ sal_Int16 m_nOrientation;
+ unsigned m_bWordLine: 1;
+ unsigned m_bOutline: 1;
+ unsigned m_bShadow: 1;
+ unsigned m_bKerning: 1;
+ unsigned m_bHasFont: 1;
+ unsigned m_bHasColor: 1;
+ unsigned m_bHasFillColor: 1;
+
+public:
+ TYPEINFO();
+
+ inline SfxFontItem(sal_uInt16 nWhich);
+
+ virtual int operator ==(const SfxPoolItem & rItem) const;
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
+ { return new SfxFontItem(*this); }
+
+ sal_Bool hasFont() const { return m_bHasFont; }
+ sal_Bool hasColor() const { return m_bHasColor; }
+ sal_Bool hasFillColor() const { return m_bHasFillColor; }
+
+ const XubString & getName() const { return m_aName; }
+ const XubString & getStyleName() const { return m_aStyleName; }
+
+ const Size & getSize() const { return m_aSize; }
+ const Color & getColor() const { return m_aColor; }
+ const Color & getFillColor() const { return m_aFillColor; }
+
+ rtl_TextEncoding getCharSet() const { return m_nCharSet; }
+
+ LanguageType getLanguage() const { return m_nLanguage; }
+
+ sal_Int16 getFamily() const { return m_nFamily; }
+ sal_Int16 getPitch() const { return m_nPitch; }
+ sal_Int16 getWeight() const { return m_nWeight; }
+ sal_Int16 getWidthType() const { return m_nWidthType; }
+ sal_Int16 getItalic() const { return m_nItalic; }
+ sal_Int16 getUnderline() const { return m_nUnderline; }
+ sal_Int16 getStrikeout() const { return m_nStrikeout; }
+ sal_Int16 getOrientation() const { return m_nOrientation; }
+ sal_Bool getWordLine() const { return m_bWordLine; }
+ sal_Bool getOutline() const { return m_bOutline; }
+ sal_Bool getShadow() const { return m_bShadow; }
+ sal_Bool getKerning() const { return m_bKerning; }
+
+ inline void setFont(sal_Int16 nTheFamily, const XubString & rTheName,
+ const XubString & rTheStyleName, sal_Int16 nThePitch,
+ rtl_TextEncoding nTheCharSet);
+ inline void setWeight(sal_Int16 nTheWeight);
+ inline void setItalic(sal_Int16 nTheItalic);
+ inline void setHeight(sal_Int32 nHeight);
+ inline void setColor(const Color & rTheColor);
+ inline void setFillColor(const Color & rTheFillColor);
+ inline void setUnderline(sal_Int16 nTheUnderline);
+ inline void setStrikeout(sal_Int16 nTheStrikeout);
+ inline void setOutline(sal_Bool bTheOutline);
+ inline void setShadow(sal_Bool bTheShadow);
+ inline void setLanguage(LanguageType nTheLanguage);
+};
+
+inline SfxFontItem::SfxFontItem(sal_uInt16 which):
+ SfxPoolItem(which),
+ m_nCharSet(RTL_TEXTENCODING_DONTKNOW),
+ m_nLanguage(LANGUAGE_DONTKNOW),
+ m_nFamily(0), // FAMILY_DONTKNOW
+ m_nPitch(0), // PITCH_DONTKNOW
+ m_nWeight(0), // WEIGHT_DONTKNOW
+ m_nWidthType(0), // WIDTH_DONTKNOW
+ m_nItalic(3), // ITALIC_DONTKNOW
+ m_nUnderline(4), // UNDERLINE_DONTKNOW
+ m_nStrikeout(3), // STRIKEOUT_DONTKNOW
+ m_nOrientation(0),
+ m_bWordLine(sal_False),
+ m_bOutline(sal_False),
+ m_bShadow(sal_False),
+ m_bKerning(sal_False),
+ m_bHasFont(sal_False),
+ m_bHasColor(sal_False),
+ m_bHasFillColor(sal_False)
+{}
+
+inline void SfxFontItem::setFont(sal_Int16 nTheFamily,
+ const XubString & rTheName,
+ const XubString & rTheStyleName,
+ sal_Int16 nThePitch,
+ rtl_TextEncoding nTheCharSet)
+{
+ m_nFamily = nTheFamily;
+ m_aName = rTheName;
+ m_aStyleName = rTheStyleName;
+ m_nPitch = nThePitch;
+ m_nCharSet = nTheCharSet;
+ m_bHasFont = sal_True;
+}
+
+inline void SfxFontItem::setWeight(sal_Int16 nTheWeight)
+{
+ m_nWeight = nTheWeight;
+ m_bHasFont = sal_True;
+}
+
+inline void SfxFontItem::setItalic(sal_Int16 nTheItalic)
+{
+ m_nItalic = nTheItalic;
+ m_bHasFont = sal_True;
+}
+
+inline void SfxFontItem::setHeight(sal_Int32 nHeight)
+{
+ m_aSize.setHeight(nHeight);
+ m_bHasFont = sal_True;
+}
+
+inline void SfxFontItem::setColor(const Color & rTheColor)
+{
+ m_aColor = rTheColor;
+ m_bHasColor = sal_True;
+}
+
+inline void SfxFontItem::setFillColor(const Color & rTheFillColor)
+{
+ m_aFillColor = rTheFillColor;
+ m_bHasFillColor = sal_True;
+}
+
+inline void SfxFontItem::setUnderline(sal_Int16 nTheUnderline)
+{
+ m_nUnderline = nTheUnderline;
+ m_bHasFont = sal_True;
+}
+
+inline void SfxFontItem::setStrikeout(sal_Int16 nTheStrikeout)
+{
+ m_nStrikeout = nTheStrikeout;
+ m_bHasFont = sal_True;
+}
+
+inline void SfxFontItem::setOutline(sal_Bool bTheOutline)
+{
+ m_bOutline = bTheOutline;
+ m_bHasFont = sal_True;
+}
+
+inline void SfxFontItem::setShadow(sal_Bool bTheShadow)
+{
+ m_bShadow = bTheShadow;
+ m_bHasFont = sal_True;
+}
+
+inline void SfxFontItem::setLanguage(LanguageType nTheLanguage)
+{
+ m_nLanguage = nTheLanguage;
+ m_bHasFont = sal_True;
+}
+
+#endif // _SFONTITM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/sharecontrolfile.hxx b/include/svl/sharecontrolfile.hxx
new file mode 100644
index 000000000000..d2c842d98ebb
--- /dev/null
+++ b/include/svl/sharecontrolfile.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 _SVT_SHARECONTROLFILE_HXX
+#define _SVT_SHARECONTROLFILE_HXX
+
+#include <svl/svldllapi.h>
+
+#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <com/sun/star/io/XTruncate.hpp>
+
+#include <svl/lockfilecommon.hxx>
+
+#define SHARED_OOOUSERNAME_ID LOCKFILE_OOOUSERNAME_ID
+#define SHARED_SYSUSERNAME_ID LOCKFILE_SYSUSERNAME_ID
+#define SHARED_LOCALHOST_ID LOCKFILE_LOCALHOST_ID
+#define SHARED_EDITTIME_ID LOCKFILE_EDITTIME_ID
+#define SHARED_USERURL_ID LOCKFILE_USERURL_ID
+#define SHARED_ENTRYSIZE LOCKFILE_ENTRYSIZE
+
+namespace svt {
+
+class SVL_DLLPUBLIC ShareControlFile : public LockFileCommon
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xStream;
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream;
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > m_xOutputStream;
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable > m_xSeekable;
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XTruncate > m_xTruncate;
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< OUString > > m_aUsersData;
+
+ void OpenStream();
+ void Close();
+ sal_Bool IsValid()
+ {
+ return ( m_xStream.is() && m_xInputStream.is() && m_xOutputStream.is() && m_xSeekable.is() && m_xTruncate.is() );
+ }
+
+public:
+
+ // The constructor will throw exception in case the stream can not be opened
+ ShareControlFile( const OUString& aOrigURL );
+ ~ShareControlFile();
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< OUString > > GetUsersData();
+ void SetUsersDataAndStore( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< OUString > >& aUserNames );
+ ::com::sun::star::uno::Sequence< OUString > InsertOwnEntry();
+ bool HasOwnEntry();
+ void RemoveEntry( const ::com::sun::star::uno::Sequence< OUString >& aOptionalSpecification = ::com::sun::star::uno::Sequence< OUString >() );
+ void RemoveFile();
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/slstitm.hxx b/include/svl/slstitm.hxx
new file mode 100644
index 000000000000..90c873119b80
--- /dev/null
+++ b/include/svl/slstitm.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 _SFXSLSTITM_HXX
+#define _SFXSLSTITM_HXX
+
+#include <vector>
+
+#include "svl/svldllapi.h"
+#include <tools/rtti.hxx>
+#include <svl/poolitem.hxx>
+#include <com/sun/star/uno/Sequence.h>
+
+class SfxImpStringList;
+
+class SVL_DLLPUBLIC SfxStringListItem : public SfxPoolItem
+{
+protected:
+ SfxImpStringList* pImp;
+
+public:
+ TYPEINFO();
+
+ SfxStringListItem();
+ SfxStringListItem( sal_uInt16 nWhich, const std::vector<String> *pList=NULL );
+ SfxStringListItem( sal_uInt16 nWhich, SvStream& rStream );
+ SfxStringListItem( const SfxStringListItem& rItem );
+ ~SfxStringListItem();
+
+ std::vector<String>& GetList();
+
+ const std::vector<String>& GetList() const;
+
+ // String-Separator: \n
+ virtual void SetString( const XubString& );
+ virtual XubString GetString();
+
+ void SetStringList( const com::sun::star::uno::Sequence< OUString >& rList );
+ void GetStringList( com::sun::star::uno::Sequence< OUString >& rList ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const;
+ virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
+
+ virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 ) const;
+};
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/smplhint.hxx b/include/svl/smplhint.hxx
new file mode 100644
index 000000000000..5c74a3dc4f6e
--- /dev/null
+++ b/include/svl/smplhint.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 _SFXSMPLHINT_HXX
+#define _SFXSMPLHINT_HXX
+
+#include "svl/svldllapi.h"
+#include <svl/hint.hxx>
+#include <tools/rtti.hxx>
+
+#define SFX_HINT_DYING 0x00000001
+#define SFX_HINT_NAMECHANGED 0x00000002
+#define SFX_HINT_TITLECHANGED 0x00000004
+#define SFX_HINT_DATACHANGED 0x00000008
+#define SFX_HINT_DOCCHANGED 0x00000010
+#define SFX_HINT_UPDATEDONE 0x00000020
+#define SFX_HINT_DEINITIALIZING 0x00000040
+#define SFX_HINT_MODECHANGED 0x00000080
+ // unused, formerly SFX_HINT_CANCELLABLE
+ // unused, formerly SFX_HINT_DATAAVAILABLE
+ // unused, formerly SFX_HINT_SAVECOMPLETED
+ // unused, formerly SFX_HINT_RELEASEREF
+#define SFX_HINT_COLORS_CHANGED 0x00001000
+#define SFX_HINT_CTL_SETTINGS_CHANGED 0x00002000
+#define SFX_HINT_ACCESSIBILITY_CHANGED 0x00004000
+ // unused, formerly SFX_HINT_VIEWCREATED
+#define SFX_HINT_USER00 0x00010000
+#define SFX_HINT_USER01 0x00020000
+#define SFX_HINT_USER02 0x00040000
+#define SFX_HINT_USER03 0x00080000
+#define SFX_HINT_USER04 0x00100000
+#define SFX_HINT_USER05 0x00200000
+#define SFX_HINT_USER06 0x00400000
+#define SFX_HINT_USER07 0x00800000
+#define SFX_HINT_USER08 0x01000000
+#define SFX_HINT_USER09 0x02000000
+#define SFX_HINT_USER10 0x04000000
+#define SFX_HINT_USER11 0x08000000
+#define SFX_HINT_USER12 0x10000000
+#define SFX_HINT_USER13 0x20000000
+#define SFX_HINT_UNDO_OPTIONS_CHANGED 0x40000000
+#define SFX_HINT_USER_OPTIONS_CHANGED 0x80000000
+#define SFX_HINT_ALL 0xFFFFFFFF
+
+class SVL_DLLPUBLIC SfxSimpleHint: public SfxHint
+{
+private:
+ sal_uLong nId;
+public:
+ TYPEINFO();
+ SfxSimpleHint( sal_uLong nId );
+ sal_uLong GetId() const { return nId; }
+};
+
+//--------------------------------------------------------------------
+
+#define DECL_OBJHINT(Name, Type) \
+ class Name: public SfxSimpleHint \
+ { \
+ Type aObj; \
+ \
+ public: \
+ TYPEINFO(); \
+ Name( sal_uInt16 nId, const Type& rObject ); \
+ ~Name(); \
+ const Type& GetObject() const { return aObj; } \
+ }
+
+#define IMPL_OBJHINT(Name, Type) \
+ TYPEINIT1(Name, SfxSimpleHint); \
+ Name::Name( sal_uInt16 nID, const Type& rObject ): \
+ SfxSimpleHint( nID ), aObj(rObject) \
+ { } \
+ Name::~Name() {}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/solar.hrc b/include/svl/solar.hrc
new file mode 100644
index 000000000000..05d2cedc533a
--- /dev/null
+++ b/include/svl/solar.hrc
@@ -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 _SOLAR_HRC
+#define _SOLAR_HRC
+
+// defines ------------------------------------------------------------------
+
+#define OWN_ATTR_VALUE_START 3900
+#define OWN_ATTR_VALUE_END 3990
+
+#define CREATERESMGR_NAME( Name ) #Name
+#define CREATERESMGR( Name ) ResMgr::CreateResMgr( CREATERESMGR_NAME( Name ) )
+
+#define RID_SFX_START 260
+// RID_SFX_END 9999
+
+#define RID_LIB_START 10000
+#define RID_LIB_END 19999
+
+#define RID_SVX_START (RID_LIB_START)
+// RID_SVX_END (RID_LIB_START+499)
+
+// free: 500-2999
+
+#define RID_BASIC_START (RID_LIB_START+3000)
+// RID_BASIC_END (RID_LIB_START+4499)
+
+#define RID_UUI_START (RID_LIB_START+4500)
+// RID_UUI_END (RID_LIB_START+4599)
+
+// free: 4600-4849
+
+#define RID_BASICIDE_START (RID_LIB_START+4850)
+// RID_BASICIDE_END (RID_LIB_START+4949)
+
+#define RID_SVXITEMS_START (RID_LIB_START+4950)
+#define RID_SVXITEMS_END (RID_LIB_START+5599)
+
+// free: 5600-5699
+
+#define RID_EXTENSIONS_START (RID_LIB_START+5700)
+// RID_EXTENSIONS_END (RID_LIB_START+5799)
+
+#define RID_EDIT_START (RID_LIB_START+5800)
+#define RID_EDIT_END (RID_LIB_START+6369)
+
+#define RID_FPICKER_START (RID_LIB_START+6370)
+// RID_FPICKER_END (RID_LIB_START+6389)
+
+#define RID_SVTOOLS_START (RID_LIB_START+6390)
+// RID_SVTOOLS_END (RID_LIB_START+6499)
+
+// free: 6500-6799
+
+#define RID_DLG_START (RID_LIB_START+6800)
+// RID_DLG_END (RID_LIB_START+6899)
+
+#define RID_OFA_START (RID_LIB_START+6900)
+// RID_OFA_END (RID_LIB_START+7399)
+
+// free: RID_LIB_START+7400 to +7449
+
+#define RID_SVL_START (RID_LIB_START+7450)
+// RID_SVL_END (RID_LIB_START+7899)
+
+#define RID_CHAOS_START (RID_LIB_START+7900)
+// RID_CHAOS_END (RID_LIB_START+7999)
+
+#define RID_FORMS_START (RID_LIB_START+8000)
+// RID_FORMS_END (RID_LIB_START+8999)
+
+#define RID_FORMLAYER_START (RID_LIB_START+9000)
+// RID_FORMLAYER_END (RID_LIB_START+9199)
+
+#define RID_DBACCESS_START (RID_LIB_START+9200)
+#define RID_DBACCESS_END (RID_LIB_START+9699)
+
+#define RID_MORE_EXTENSIONS_START (RID_LIB_START+9700)
+#define RID_MORE_EXTENSIONS_END (RID_LIB_START+9999)
+
+// free: 10000-10199
+
+#define RID_FILTER_START (RID_LIB_START+10200)
+// RID_FILTER_END (RID_LIB_START+10299)
+
+// do *NOT* add more ranges here, RID_LIB_END is (RID_LIB_START + 10000)
+
+#define RID_APP_START 20000
+// RID_APP_END 31999
+
+#define RID_SW_START (20000)
+// RID_SW_END (25999)
+
+// free: 26000-26999
+
+#define RID_SD_START (27000)
+// RID_SD_END (27999)
+
+#define RID_OBJ_START (30000)
+// RID_OBJ_END (32767)
+
+#define RID_RPT_START (RID_OBJ_START+768)
+// RID_RPT_END (RID_OBJ_START+1000)
+
+#define RID_FORMULA_START (RID_OBJ_START+1001)
+// RID_FORMULA_END (RID_OBJ_START+1200)
+
+// Help-Ids --------------------------------------------------------------
+
+#define HID_START 32768
+
+#define HID_VCL_START (HID_START+100)
+// HID_VCL_END (HID_START+150)
+
+// free: 200-299
+
+#define HID_SFX_START (HID_START+300)
+// HID_SFX_END (HID_START+999)
+
+#define HID_LIB_START (HID_START+1000)
+// HID_LIB_END (HID_START+19999)
+
+// free: HID_LIB_START 0-1699
+
+// HID_OFA_START (HID_LIB_START+1760)
+#define HID_OFA_END (HID_LIB_START+1999)
+
+// free: HID_LIB_START 2000-2050
+
+#define HID_CHAOS_START (HID_LIB_START+2051)
+// HID_CHAOS_END (HID_LIB_START+2069)
+
+// free: HID_LIB_START 2070-9999
+
+// free: HID_START 20000-24999
+
+#define HID_SC_START (HID_START+25000)
+// HID_SC_END (HID_START+26999)
+
+#define HID_SD_START (HID_START+27000)
+// HID_SD_END (HID_START+27999)
+
+// free: HID_START 28000-29999
+
+#define HID_OBJ_START (HID_START+30000)
+// HID_OBJ_END (HID_START+32767)
+
+// free: HID_OBJ_START+2281 to HID_OBJ_START+2800
+
+// Slot Ids
+
+#define SID_SFX_START 5000
+// SID_SFX_END 8999
+#define SID_DOCKWIN_START 9800
+// SID_DOCKWIN_END 9999
+
+#define SID_LIB_START 10000
+// SID_LIB_END 19999
+// free: 20000-29999
+#define SID_OBJ_START 30000
+
+#define SID_SW_START 20000
+// SID_SW_END 25999
+#define SID_SC_START 26000
+// SID_SC_END 26999
+#define SID_SD_START 27000
+// SID_SD_END 27999
+
+#define SID_SMA_START (SID_OBJ_START + 256)
+// SID_SMA_END (SID_OBJ_START + 511)
+// free: SID_OBJ_START + 512 to SID_OBJ_START + 767
+#define SID_BASICIDE_START (SID_OBJ_START + 768)
+// SID_BASICIDE_END (SID_BASICIDE_START + 255)
+
+#define SID_SVX_START SID_LIB_START // 10000
+#define SID_SVX_END (SID_SVX_START + 1499)
+#define SID_EDIT_START (SID_SVX_END + 1) // 11500
+#define SID_EDIT_END (SID_EDIT_START + 499)
+#define SID_OPTIONS_START (SID_EDIT_END + 1) // 12000
+#define SID_OPTIONS_END (SID_OPTIONS_START + 100)
+#define SID_SBA_START (SID_OPTIONS_END + 1) // 12101
+#define SID_SBA_END (SID_SBA_START + 149)
+#define SID_DBACCESS_START (SID_SBA_END + 1) // 12251
+#define SID_DBACCESS_END (SID_DBACCESS_START + 200)
+#define SID_RPTUI_START (SID_DBACCESS_END + 1) // 12452
+// SID_RPTUI_END (SID_RPTUI_START + 199)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/srchdefs.hxx b/include/svl/srchdefs.hxx
new file mode 100644
index 000000000000..f339ebff9273
--- /dev/null
+++ b/include/svl/srchdefs.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 _SFX_SRCHDEFS_HXX_
+#define _SFX_SRCHDEFS_HXX_
+
+
+#define SEARCH_OPTIONS_SEARCH ((sal_uInt16)0x0001)
+#define SEARCH_OPTIONS_SEARCH_ALL ((sal_uInt16)0x0002)
+#define SEARCH_OPTIONS_REPLACE ((sal_uInt16)0x0004)
+#define SEARCH_OPTIONS_REPLACE_ALL ((sal_uInt16)0x0008)
+#define SEARCH_OPTIONS_WHOLE_WORDS ((sal_uInt16)0x0010)
+#define SEARCH_OPTIONS_BACKWARDS ((sal_uInt16)0x0020)
+#define SEARCH_OPTIONS_REG_EXP ((sal_uInt16)0x0040)
+#define SEARCH_OPTIONS_EXACT ((sal_uInt16)0x0080)
+#define SEARCH_OPTIONS_SELECTION ((sal_uInt16)0x0100)
+#define SEARCH_OPTIONS_FAMILIES ((sal_uInt16)0x0200)
+#define SEARCH_OPTIONS_FORMAT ((sal_uInt16)0x0400)
+#define SEARCH_OPTIONS_MORE ((sal_uInt16)0x0800)
+#define SEARCH_OPTIONS_SIMILARITY ((sal_uInt16)0x1000)
+#define SEARCH_OPTIONS_CONTENT ((sal_uInt16)0x2000)
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/srchitem.hxx b/include/svl/srchitem.hxx
new file mode 100644
index 000000000000..5d4413ea8cab
--- /dev/null
+++ b/include/svl/srchitem.hxx
@@ -0,0 +1,287 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFX_SRCHITEM_HXX
+#define _SFX_SRCHITEM_HXX
+
+#include "sal/config.h"
+#include "svl/svldllapi.h"
+#include <com/sun/star/util/XSearchDescriptor.hpp>
+#include <com/sun/star/util/SearchOptions.hpp>
+#include <com/sun/star/util/SearchFlags.hpp>
+#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <unotools/configitem.hxx>
+#include <rsc/rscsfx.hxx>
+#include <tools/string.hxx>
+#include <svl/poolitem.hxx>
+#include <svl/srchdefs.hxx>
+
+// defines ---------------------------------------------------------------
+
+// commands
+#define SVX_SEARCHCMD_FIND ((sal_uInt16)0)
+#define SVX_SEARCHCMD_FIND_ALL ((sal_uInt16)1)
+#define SVX_SEARCHCMD_REPLACE ((sal_uInt16)2)
+#define SVX_SEARCHCMD_REPLACE_ALL ((sal_uInt16)3)
+
+// search flags
+#define SVX_SEARCHIN_FORMULA ((sal_uInt16)0)
+#define SVX_SEARCHIN_VALUE ((sal_uInt16)1)
+#define SVX_SEARCHIN_NOTE ((sal_uInt16)2)
+#define SVX_SEARCHAPP_WRITER ((sal_uInt16)0)
+#define SVX_SEARCHAPP_CALC ((sal_uInt16)1)
+#define SVX_SEARCHAPP_DRAW ((sal_uInt16)2)
+#define SVX_SEARCHAPP_BASE ((sal_uInt16)3)
+
+// class SvxSearchItem ---------------------------------------------------
+
+class SVL_DLLPUBLIC SvxSearchItem :
+ public SfxPoolItem,
+ public utl::ConfigItem
+{
+ com::sun::star::util::SearchOptions aSearchOpt;
+
+ SfxStyleFamily eFamily; // Vorlagen-Familie
+
+ sal_uInt16 nCommand; // Kommando (Suchen, Alle Suchen, Ersetzen, Alle Ersetzen)
+
+ // Calc-Spezifische Daten
+ sal_uInt16 nCellType; // Suche in Formeln/Werten/Notizen
+ sal_uInt16 nAppFlag; // Fuer welche Applikation ist der Dialog ueberhaupt
+ bool bRowDirection; // Suchrichtung Zeilenweise/Spaltenweise
+ bool bAllTables; // in alle Tabellen suchen
+ bool bSearchFiltered; // search filtered cells.
+
+ // Writer-spezifisch
+ bool bNotes;
+
+ bool bBackward; // Suche Rueckwaerts
+ bool bPattern; // Suche nach Vorlagen
+ bool bContent; // Suche im Inhalt
+ bool bAsianOptions; // use asian options?
+
+public:
+ TYPEINFO();
+
+ explicit SvxSearchItem( const sal_uInt16 nId );
+ SvxSearchItem( const SvxSearchItem& rItem );
+ virtual ~SvxSearchItem();
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual int operator == ( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ // ConfigItem
+ virtual void Notify( const com::sun::star::uno::Sequence< OUString > &rPropertyNames );
+ virtual void Commit();
+
+ sal_uInt16 GetCommand() const { return nCommand; }
+ void SetCommand(sal_uInt16 nNewCommand) { nCommand = nNewCommand; }
+
+ inline const String GetSearchString() const;
+ inline void SetSearchString(const String& rNewString);
+
+ inline const String GetReplaceString() const;
+ inline void SetReplaceString(const String& rNewString);
+
+ inline bool GetWordOnly() const;
+ void SetWordOnly(bool bNewWordOnly);
+
+ inline bool GetExact() const;
+ void SetExact(bool bNewExact);
+
+ bool GetBackward() const { return bBackward; }
+ void SetBackward(bool bNewBackward) { bBackward = bNewBackward; }
+
+ inline bool GetSelection() const;
+ void SetSelection(bool bNewSelection);
+
+ inline bool GetRegExp() const;
+ void SetRegExp( bool bVal );
+
+ bool GetPattern() const { return bPattern; }
+ void SetPattern(bool bNewPattern) { bPattern = bNewPattern; }
+
+ bool IsContent() const { return bContent; }
+ void SetContent( bool bNew ) { bContent = bNew; }
+
+ SfxStyleFamily GetFamily() const { return eFamily; }
+ void SetFamily( SfxStyleFamily eNewFamily )
+ { eFamily = eNewFamily; }
+
+ bool GetRowDirection() const { return bRowDirection; }
+ void SetRowDirection(bool bNewRowDirection) { bRowDirection = bNewRowDirection; }
+
+ bool IsAllTables() const { return bAllTables; }
+ void SetAllTables(bool bNew) { bAllTables = bNew; }
+
+ bool IsSearchFiltered() const { return bSearchFiltered; }
+ void SetSearchFiltered(bool b) { bSearchFiltered = b; }
+
+ sal_uInt16 GetCellType() const { return nCellType; }
+ void SetCellType(sal_uInt16 nNewCellType) { nCellType = nNewCellType; }
+
+ bool GetNotes() const { return bNotes; }
+ void SetNotes(bool bNew) { bNotes = bNew; }
+
+ sal_uInt16 GetAppFlag() const { return nAppFlag; }
+ void SetAppFlag(sal_uInt16 nNewAppFlag) { nAppFlag = nNewAppFlag; }
+
+ inline bool IsLevenshtein() const;
+ void SetLevenshtein( bool bVal );
+
+ inline bool IsLEVRelaxed() const;
+ void SetLEVRelaxed(bool bSet);
+
+ inline sal_uInt16 GetLEVOther() const;
+ inline void SetLEVOther(sal_uInt16 nSet);
+
+ inline sal_uInt16 GetLEVShorter() const;
+ inline void SetLEVShorter(sal_uInt16 nSet);
+
+ inline sal_uInt16 GetLEVLonger() const;
+ inline void SetLEVLonger(sal_uInt16 nSet);
+
+ inline const com::sun::star::util::SearchOptions &
+ GetSearchOptions() const;
+ inline void SetSearchOptions( const com::sun::star::util::SearchOptions &rOpt );
+
+ inline sal_Int32 GetTransliterationFlags() const;
+ void SetTransliterationFlags( sal_Int32 nFlags );
+
+ inline bool IsMatchFullHalfWidthForms() const;
+ void SetMatchFullHalfWidthForms( bool bVal );
+
+ inline bool IsUseAsianOptions() const { return bAsianOptions; }
+ inline void SetUseAsianOptions( bool bVal ) { bAsianOptions = bVal; }
+};
+
+const String SvxSearchItem::GetSearchString() const
+{
+ return aSearchOpt.searchString;
+}
+
+void SvxSearchItem::SetSearchString(const String& rNewString)
+{
+ aSearchOpt.searchString = rNewString;
+}
+
+const String SvxSearchItem::GetReplaceString() const
+{
+ return aSearchOpt.replaceString;
+}
+
+void SvxSearchItem::SetReplaceString(const String& rNewString)
+{
+ aSearchOpt.replaceString = rNewString;
+}
+
+bool SvxSearchItem::GetWordOnly() const
+{
+ return 0 != (aSearchOpt.searchFlag &
+ com::sun::star::util::SearchFlags::NORM_WORD_ONLY);
+}
+
+bool SvxSearchItem::GetExact() const
+{
+ return 0 == (aSearchOpt.transliterateFlags &
+ com::sun::star::i18n::TransliterationModules_IGNORE_CASE);
+}
+
+bool SvxSearchItem::GetSelection() const
+{
+ return 0 != (aSearchOpt.searchFlag &
+ com::sun::star::util::SearchFlags::REG_NOT_BEGINOFLINE);
+}
+
+bool SvxSearchItem::GetRegExp() const
+{
+ return aSearchOpt.algorithmType == com::sun::star::util::SearchAlgorithms_REGEXP ;
+}
+
+bool SvxSearchItem::IsLEVRelaxed() const
+{
+ return 0 != (aSearchOpt.searchFlag &
+ com::sun::star::util::SearchFlags::LEV_RELAXED);
+}
+
+sal_uInt16 SvxSearchItem::GetLEVOther() const
+{
+ return (sal_Int16) aSearchOpt.changedChars;
+}
+
+void SvxSearchItem::SetLEVOther( sal_uInt16 nVal )
+{
+ aSearchOpt.changedChars = nVal;
+}
+
+sal_uInt16 SvxSearchItem::GetLEVShorter() const
+{
+ return (sal_Int16) aSearchOpt.insertedChars;
+}
+
+void SvxSearchItem::SetLEVShorter( sal_uInt16 nVal )
+{
+ aSearchOpt.insertedChars = nVal;
+}
+
+sal_uInt16 SvxSearchItem::GetLEVLonger() const
+{
+ return (sal_Int16) aSearchOpt.deletedChars;
+}
+
+void SvxSearchItem::SetLEVLonger( sal_uInt16 nVal )
+{
+ aSearchOpt.deletedChars = nVal;
+}
+
+bool SvxSearchItem::IsLevenshtein() const
+{
+ return aSearchOpt.algorithmType == com::sun::star::util::SearchAlgorithms_APPROXIMATE;
+}
+
+const com::sun::star::util::SearchOptions & SvxSearchItem::GetSearchOptions() const
+{
+ return aSearchOpt;
+}
+
+void SvxSearchItem::SetSearchOptions( const com::sun::star::util::SearchOptions &rOpt )
+{
+ aSearchOpt = rOpt;
+}
+
+sal_Int32 SvxSearchItem::GetTransliterationFlags() const
+{
+ return aSearchOpt.transliterateFlags;
+}
+
+bool SvxSearchItem::IsMatchFullHalfWidthForms() const
+{
+ return 0 != (aSearchOpt.transliterateFlags &
+ com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH);
+}
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/stritem.hxx b/include/svl/stritem.hxx
new file mode 100644
index 000000000000..a4109218c79e
--- /dev/null
+++ b/include/svl/stritem.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 _SFXSTRITEM_HXX
+#define _SFXSTRITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <svl/custritm.hxx>
+
+//============================================================================
+class SVL_DLLPUBLIC SfxStringItem: public CntUnencodedStringItem
+{
+public:
+ TYPEINFO();
+
+ SfxStringItem() {}
+
+ SfxStringItem(sal_uInt16 which, const OUString & rValue):
+ CntUnencodedStringItem(which, rValue) {}
+
+ SfxStringItem(sal_uInt16 nWhich, SvStream & rStream);
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
+
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
+};
+
+#endif // _SFXSTRITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/strmadpt.hxx b/include/svl/strmadpt.hxx
new file mode 100644
index 000000000000..167d3696d3a2
--- /dev/null
+++ b/include/svl/strmadpt.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 SVTOOLS_STRMADPT_HXX
+#define SVTOOLS_STRMADPT_HXX
+
+#include "svl/svldllapi.h"
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <cppuhelper/weak.hxx>
+#include <tools/stream.hxx>
+
+//============================================================================
+class SVL_DLLPUBLIC SvOutputStreamOpenLockBytes: public SvOpenLockBytes
+{
+ com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >
+ m_xOutputStream;
+ sal_uInt32 m_nPosition;
+
+public:
+ TYPEINFO();
+
+ SvOutputStreamOpenLockBytes(
+ const com::sun::star::uno::Reference<
+ com::sun::star::io::XOutputStream > &
+ rTheOutputStream):
+ m_xOutputStream(rTheOutputStream), m_nPosition(0) {}
+
+ virtual ErrCode ReadAt(sal_uLong, void *, sal_uLong, sal_uLong *) const;
+
+ virtual ErrCode WriteAt(sal_uLong nPos, const void * pBuffer, sal_uLong nCount,
+ sal_uLong * pWritten);
+
+ virtual ErrCode Flush() const;
+
+ virtual ErrCode SetSize(sal_uLong);
+
+ virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const;
+
+ virtual ErrCode FillAppend(const void * pBuffer, sal_uLong nCount,
+ sal_uLong * pWritten);
+
+ virtual sal_uLong Tell() const;
+
+ virtual sal_uLong Seek(sal_uLong);
+
+ virtual void Terminate();
+};
+
+//============================================================================
+class SVL_DLLPUBLIC SvLockBytesInputStream: public cppu::OWeakObject,
+ public com::sun::star::io::XInputStream,
+ public com::sun::star::io::XSeekable
+{
+ SvLockBytesRef m_xLockBytes;
+ sal_Int64 m_nPosition;
+
+public:
+ SvLockBytesInputStream(SvLockBytes * pTheLockBytes):
+ m_xLockBytes(pTheLockBytes), m_nPosition(0) {}
+
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface(const com::sun::star::uno::Type & rType)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL acquire() throw();
+
+ virtual void SAL_CALL release() throw();
+
+ virtual sal_Int32 SAL_CALL
+ readBytes(com::sun::star::uno::Sequence< sal_Int8 > & rData,
+ sal_Int32 nBytesToRead)
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL
+ readSomeBytes(com::sun::star::uno::Sequence< sal_Int8 > & rData,
+ sal_Int32 nMaxBytesToRead)
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip)
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL available()
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL closeInput()
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL seek(sal_Int64 nLocation)
+ throw (com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int64 SAL_CALL getPosition()
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int64 SAL_CALL getLength()
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+};
+
+#endif // SVTOOLS_STRMADPT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/style.hrc b/include/svl/style.hrc
new file mode 100644
index 000000000000..352cfe18e2b0
--- /dev/null
+++ b/include/svl/style.hrc
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SFX_STYLE_HRC
+#define SFX_STYLE_HRC
+
+#define SFXSTYLEBIT_AUTO 0x0000 ///< automatic: flags from application
+#define SFXSTYLEBIT_HIDDEN 0x0200 ///< hidden styles (search mask)
+#define SFXSTYLEBIT_HIERARCHY 0x1000 ///< hierarchical view - just for dialog
+#define SFXSTYLEBIT_READONLY 0x2000 ///< readonly styles (search mask)
+#define SFXSTYLEBIT_USED 0x4000 ///< used styles (search mask)
+#define SFXSTYLEBIT_USERDEF 0x8000 ///< user defined styles (search mask)
+#define SFXSTYLEBIT_ALL_VISIBLE 0xFDFF ///< all styles
+#define SFXSTYLEBIT_ALL 0xFFFF ///< all styles
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/style.hxx b/include/svl/style.hxx
new file mode 100644
index 000000000000..af58cbc44327
--- /dev/null
+++ b/include/svl/style.hxx
@@ -0,0 +1,386 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SFXSTYLE_HXX
+#define _SFXSTYLE_HXX
+
+#include <com/sun/star/style/XStyle.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+
+#include <rtl/ref.hxx>
+#include <vector>
+#include <comphelper/weak.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include "svl/svldllapi.h"
+#include <rsc/rscsfx.hxx>
+#include <tools/string.hxx>
+#include <svl/hint.hxx>
+#include <svl/lstner.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/poolitem.hxx>
+#include <svl/stylesheetuser.hxx>
+
+#include <svl/style.hrc>
+#include <boost/shared_ptr.hpp>
+
+class SfxItemSet;
+class SfxItemPool;
+class SfxStyleSheetBasePool;
+class SvStream;
+
+/*
+Everyone changing instances of SfxStyleSheetBasePool or SfxStyleSheetBase
+must broadcast this using <SfxStyleSheetBasePool::GetBroadcaster()> broadcasts.
+The class <SfxStyleSheetHint> is used for this, it contains an Action-Id and a
+pointer to the <SfxStyleSheetBase>. The actions are:
+
+#define SFX_STYLESHEET_CREATED // style is created
+#define SFX_STYLESHEET_MODIFIED // style is modified
+#define SFX_STYLESHEET_CHANGED // style is replaced
+#define SFX_STYLESHEET_ERASED // style is deleted
+
+The following methods already broadcast themself
+
+SfxSimpleHint(SFX_HINT_DYING) from:
+ SfxStyleSheetBasePool::~SfxStyleSheetBasePool()
+
+SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *p ) from:
+ SfxStyleSheetBasePool::Make( const String& rName,
+ SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos)
+
+SfxStyleSheetHint( SFX_STYLESHEET_CHANGED, *pNew ) from:
+ SfxStyleSheetBasePool::Add( SfxStyleSheetBase& rSheet )
+
+SfxStyleSheetHint( SFX_STYLESHEET_ERASED, *p ) from:
+ SfxStyleSheetBasePool::Erase( SfxStyleSheetBase* p )
+ SfxStyleSheetBasePool::Clear()
+*/
+
+class SVL_DLLPUBLIC SfxStyleSheetBase : public comphelper::OWeakTypeObject
+{
+private:
+ friend class SfxStyleSheetBasePool;
+ SVL_DLLPRIVATE static SfxStyleSheetBasePool& implGetStaticPool();
+
+protected:
+ SfxStyleSheetBasePool* pPool; // zugehoeriger Pool
+ SfxStyleFamily nFamily; // Familie
+
+ UniString aName, aParent, aFollow;
+ OUString maDisplayName;
+ OUString aHelpFile; // Name der Hilfedatei
+ SfxItemSet* pSet; // ItemSet
+ sal_uInt16 nMask; // Flags
+
+ sal_uLong nHelpId; // Hilfe-ID
+
+ bool bMySet; // sal_True: Set loeschen im dtor
+ bool bHidden;
+
+ SfxStyleSheetBase( const UniString&, SfxStyleSheetBasePool*, SfxStyleFamily eFam, sal_uInt16 mask );
+ SfxStyleSheetBase( const SfxStyleSheetBase& );
+ virtual ~SfxStyleSheetBase();
+ virtual void Load( SvStream&, sal_uInt16 );
+ virtual void Store( SvStream& );
+
+public:
+ TYPEINFO();
+
+ // returns the internal name of this style
+ virtual const UniString& GetName() const;
+
+ // sets the internal name of this style
+ virtual bool SetName( const UniString& );
+
+ /** returns the display name of this style, it is used at the user interface.
+ If the display name is empty, this method returns the internal name. */
+ virtual OUString GetDisplayName() const;
+
+ // sets the display name of this style
+ virtual void SetDisplayName( const OUString& );
+
+ virtual const UniString& GetParent() const;
+ virtual bool SetParent( const UniString& );
+ virtual const UniString& GetFollow() const;
+ virtual bool SetFollow( const UniString& );
+ virtual bool HasFollowSupport() const; // Default true
+ virtual bool HasParentSupport() const; // Default true
+ virtual bool HasClearParentSupport() const; // Default false
+ virtual bool IsUsed() const; // Default true
+ // Default aus dem Itemset; entweder dem uebergebenen
+ // oder aus dem per GetItemSet() zurueckgelieferten Set
+ virtual UniString GetDescription();
+ virtual UniString GetDescription( SfxMapUnit eMetric );
+
+ SfxStyleSheetBasePool& GetPool() { return *pPool; }
+ SfxStyleFamily GetFamily() const { return nFamily; }
+ sal_uInt16 GetMask() const { return nMask; }
+ void SetMask( sal_uInt16 mask) { nMask = mask; }
+ bool IsUserDefined() const
+ { return ( nMask & SFXSTYLEBIT_USERDEF) != 0; }
+
+ virtual sal_Bool IsHidden() const { return bHidden; }
+ virtual void SetHidden( sal_Bool bValue );
+
+ virtual sal_uLong GetHelpId( OUString& rFile );
+ virtual void SetHelpId( const OUString& r, sal_uLong nId );
+
+ virtual SfxItemSet& GetItemSet();
+ virtual sal_uInt16 GetVersion() const;
+};
+
+//=========================================================================
+
+typedef std::vector< rtl::Reference< SfxStyleSheetBase > > SfxStyles;
+
+//=========================================================================
+
+class SVL_DLLPUBLIC SfxStyleSheetIterator
+
+/* [Beschreibung]
+
+ Klasse zum Iterieren und Suchen auf einem SfxStyleSheetBasePool.
+
+*/
+
+{
+public:
+ SfxStyleSheetIterator(SfxStyleSheetBasePool *pBase,
+ SfxStyleFamily eFam, sal_uInt16 n=SFXSTYLEBIT_ALL );
+ virtual sal_uInt16 GetSearchMask() const;
+ virtual SfxStyleFamily GetSearchFamily() const;
+ virtual sal_uInt16 Count();
+ virtual SfxStyleSheetBase *operator[](sal_uInt16 nIdx);
+ virtual SfxStyleSheetBase* First();
+ virtual SfxStyleSheetBase* Next();
+ virtual SfxStyleSheetBase* Find(const OUString& rStr);
+ virtual ~SfxStyleSheetIterator();
+
+protected:
+
+ SfxStyleSheetBasePool* pBasePool;
+ SfxStyleFamily nSearchFamily;
+ sal_uInt16 nMask;
+
+ bool SearchUsed() const { return bSearchUsed; }
+
+private:
+ sal_uInt16 GetPos() { return nAktPosition; }
+ SVL_DLLPRIVATE bool IsTrivialSearch();
+ SVL_DLLPRIVATE bool DoesStyleMatch(SfxStyleSheetBase *pStyle);
+
+ SfxStyleSheetBase* pAktStyle;
+ sal_uInt16 nAktPosition;
+ bool bSearchUsed;
+
+friend class SfxStyleSheetBasePool;
+};
+
+typedef ::boost::shared_ptr< SfxStyleSheetIterator > SfxStyleSheetIteratorPtr;
+//=========================================================================
+
+class SfxStyleSheetBasePool_Impl;
+
+class SVL_DLLPUBLIC SfxStyleSheetBasePool: public SfxBroadcaster, public comphelper::OWeakTypeObject
+{
+friend class SfxStyleSheetIterator;
+friend class SfxStyleSheetBase;
+
+ SfxStyleSheetBasePool_Impl *pImp;
+
+private:
+ SVL_DLLPRIVATE SfxStyleSheetIterator& GetIterator_Impl();
+protected:
+ String aAppName;
+ SfxItemPool& rPool;
+ SfxStyles aStyles;
+ SfxStyleFamily nSearchFamily;
+ sal_uInt16 nMask;
+
+ SfxStyleSheetBase& Add( SfxStyleSheetBase& );
+ void ChangeParent( const UniString&, const UniString&, bool bVirtual = true );
+ virtual SfxStyleSheetBase* Create( const UniString&, SfxStyleFamily, sal_uInt16 );
+ virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& );
+
+ virtual ~SfxStyleSheetBasePool();
+
+public:
+ SfxStyleSheetBasePool( SfxItemPool& );
+ SfxStyleSheetBasePool( const SfxStyleSheetBasePool& );
+
+ const String& GetAppName() const { return aAppName; }
+
+ SfxItemPool& GetPool();
+ const SfxItemPool& GetPool() const;
+
+ virtual SfxStyleSheetIteratorPtr CreateIterator(SfxStyleFamily, sal_uInt16 nMask);
+ virtual sal_uInt16 Count();
+ virtual SfxStyleSheetBase* operator[](sal_uInt16 nIdx);
+
+ virtual SfxStyleSheetBase& Make(const UniString&,
+ SfxStyleFamily eFam,
+ sal_uInt16 nMask = SFXSTYLEBIT_ALL ,
+ sal_uInt16 nPos = 0xffff);
+
+ virtual void Replace(
+ SfxStyleSheetBase& rSource, SfxStyleSheetBase& rTarget );
+
+ virtual void Remove( SfxStyleSheetBase* );
+ virtual void Insert( SfxStyleSheetBase* );
+
+ virtual void Clear();
+
+ SfxStyleSheetBasePool& operator=( const SfxStyleSheetBasePool& );
+ SfxStyleSheetBasePool& operator+=( const SfxStyleSheetBasePool& );
+
+ const SfxStyles& GetStyles();
+ virtual SfxStyleSheetBase* First();
+ virtual SfxStyleSheetBase* Next();
+ virtual SfxStyleSheetBase* Find( const UniString&, SfxStyleFamily eFam, sal_uInt16 n=SFXSTYLEBIT_ALL );
+
+ virtual bool SetParent(SfxStyleFamily eFam,
+ const UniString &rStyle,
+ const UniString &rParent);
+
+ SfxStyleSheetBase* Find(const UniString& rStr)
+ { return Find(rStr, nSearchFamily, nMask); }
+
+ void SetSearchMask(SfxStyleFamily eFam, sal_uInt16 n=SFXSTYLEBIT_ALL );
+ sal_uInt16 GetSearchMask() const;
+ SfxStyleFamily GetSearchFamily() const { return nSearchFamily; }
+};
+
+//=========================================================================
+
+class SVL_DLLPUBLIC SfxStyleSheet: public SfxStyleSheetBase,
+ public SfxListener, public SfxBroadcaster, public svl::StyleSheetUser
+{
+public:
+ TYPEINFO();
+
+ SfxStyleSheet( const UniString&, const SfxStyleSheetBasePool&, SfxStyleFamily, sal_uInt16 );
+ SfxStyleSheet( const SfxStyleSheet& );
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+ virtual bool isUsedByModel() const;
+
+ virtual bool SetParent( const UniString& );
+
+protected:
+ SfxStyleSheet() // do not use! needed by MSVC at compile time to satisfy ImplInheritanceHelper2
+ : SfxStyleSheetBase(OUString("dummy"),
+ NULL, SFX_STYLE_FAMILY_ALL, 0)
+ {
+ assert(false);
+ }
+ virtual ~SfxStyleSheet();
+};
+
+//=========================================================================
+
+class SVL_DLLPUBLIC SfxStyleSheetPool: public SfxStyleSheetBasePool
+{
+protected:
+ using SfxStyleSheetBasePool::Create;
+ virtual SfxStyleSheetBase* Create(const UniString&, SfxStyleFamily, sal_uInt16 mask);
+ virtual SfxStyleSheetBase* Create(const SfxStyleSheet &);
+
+public:
+ SfxStyleSheetPool( SfxItemPool const& );
+
+// virtual sal_Bool CopyTo(SfxStyleSheetPool &rDest, const String &rSourceName);
+};
+
+//=========================================================================
+
+#define SFX_STYLESHEET_CREATED 1 // neu
+#define SFX_STYLESHEET_MODIFIED 2 // ver"andert
+#define SFX_STYLESHEET_CHANGED 3 // gel"oscht und neu (ausgetauscht)
+#define SFX_STYLESHEET_ERASED 4 // gel"oscht
+#define SFX_STYLESHEET_INDESTRUCTION 5 // wird gerade entfernt
+
+#define SFX_STYLESHEETPOOL_CHANGES 1 // Aenderungen, die den Zustand
+ // des Pools anedern, aber nicht
+ // ueber die STYLESHEET Hints
+ // verschickt werden sollen.
+
+//========================================================================
+
+class SVL_DLLPUBLIC SfxStyleSheetPoolHint : public SfxHint
+{
+ sal_uInt16 nHint;
+
+public:
+ TYPEINFO();
+
+ SfxStyleSheetPoolHint(sal_uInt16 nArgHint) : nHint(nArgHint){}
+ sal_uInt16 GetHint() const
+ { return nHint; }
+};
+
+//=========================================================================
+
+class SVL_DLLPUBLIC SfxStyleSheetHint: public SfxHint
+{
+ SfxStyleSheetBase* pStyleSh;
+ sal_uInt16 nHint;
+
+public:
+ TYPEINFO();
+
+ SfxStyleSheetHint( sal_uInt16, SfxStyleSheetBase& );
+ SfxStyleSheetBase* GetStyleSheet() const
+ { return pStyleSh; }
+ sal_uInt16 GetHint() const
+ { return nHint; }
+};
+
+class SVL_DLLPUBLIC SfxStyleSheetHintExtended: public SfxStyleSheetHint
+{
+ String aName;
+
+public:
+ TYPEINFO();
+
+ SfxStyleSheetHintExtended(
+ sal_uInt16, const String& rOld,
+ SfxStyleSheetBase& );
+ const String& GetOldName() { return aName; }
+};
+
+class SVL_DLLPUBLIC SfxUnoStyleSheet : public ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel >
+{
+public:
+ SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske );
+
+ static SfxUnoStyleSheet* getUnoStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >& xStyle );
+
+ // XUnoTunnel
+ virtual ::sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ SfxUnoStyleSheet(); // not implemented
+
+ static const ::com::sun::star::uno::Sequence< ::sal_Int8 >& getIdentifier();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/stylepool.hxx b/include/svl/stylepool.hxx
new file mode 100644
index 000000000000..deaed2591a83
--- /dev/null
+++ b/include/svl/stylepool.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_SVTOOLS_STYLEPOOL_HXX
+#define INCLUDED_SVTOOLS_STYLEPOOL_HXX
+
+#include <boost/shared_ptr.hpp>
+#include <rtl/ustring.hxx>
+#include <svl/itemset.hxx>
+
+class StylePoolImpl;
+class IStylePoolIteratorAccess;
+
+class SVL_DLLPUBLIC StylePool
+{
+private:
+ StylePoolImpl *pImpl;
+public:
+ typedef boost::shared_ptr<SfxItemSet> SfxItemSet_Pointer_t;
+
+ explicit StylePool( SfxItemSet* pIgnorableItems = 0 );
+
+ /** Insert a SfxItemSet into the style pool.
+
+ The pool makes a copy of the provided SfxItemSet.
+
+ @param SfxItemSet
+ the SfxItemSet to insert
+
+ @return a shared pointer to the SfxItemSet
+ */
+ virtual SfxItemSet_Pointer_t insertItemSet( const SfxItemSet& rSet );
+
+ /** Create an iterator
+
+ The iterator walks through the StylePool
+ OD 2008-03-07 #i86923#
+ introduce optional parameter to control, if unused SfxItemsSet are skipped or not
+ introduce optional parameter to control, if ignorable items are skipped or not
+
+ @attention every change, e.g. destruction, of the StylePool could cause undefined effects.
+
+ @param bSkipUnusedItemSets
+ input parameter - boolean, indicating if unused SfxItemSets are skipped or not
+
+ @param bSkipIgnorableItems
+ input parameter - boolean, indicating if ignorable items are skipped or not
+
+ @postcond the iterator "points before the first" SfxItemSet of the pool.
+ The first StylePoolIterator::getNext() call will deliver the first SfxItemSet.
+ */
+ virtual IStylePoolIteratorAccess* createIterator( const bool bSkipUnusedItemSets = false,
+ const bool bSkipIgnorableItems = false );
+
+ /** Returns the number of styles
+ */
+ virtual sal_Int32 getCount() const;
+
+ virtual ~StylePool();
+
+ static OUString nameOf( SfxItemSet_Pointer_t pSet );
+};
+
+class SVL_DLLPUBLIC IStylePoolIteratorAccess
+{
+public:
+ /** Delivers a shared pointer to the next SfxItemSet of the pool
+ If there is no more SfxItemSet, the delivered share_pointer is empty.
+ */
+ virtual StylePool::SfxItemSet_Pointer_t getNext() = 0;
+ virtual OUString getName() = 0;
+ virtual ~IStylePoolIteratorAccess() {};
+};
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/stylesheetuser.hxx b/include/svl/stylesheetuser.hxx
new file mode 100644
index 000000000000..787263ff4a8e
--- /dev/null
+++ b/include/svl/stylesheetuser.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/.
+ */
+
+#ifndef SVL_STYLESHEETUSER_HXX_INCLUDED
+#define SVL_STYLESHEETUSER_HXX_INCLUDED
+
+namespace svl
+{
+
+/** Test whether object that uses a stylesheet is used itself.
+
+ This interface should be implemented by all classes that use
+ a SfxStyleSheet (and listen on it). It can be queried by the stylesheet
+ to determine if it is really used.
+ */
+class StyleSheetUser
+{
+public:
+ /** Test whether this object is used.
+
+ @return true, if the object is used, false otherwise
+ */
+ virtual bool isUsedByModel() const = 0;
+protected:
+ ~StyleSheetUser() {}
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/svdde.hxx b/include/svl/svdde.hxx
new file mode 100644
index 000000000000..c8a08beffbb9
--- /dev/null
+++ b/include/svl/svdde.hxx
@@ -0,0 +1,416 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDDE_HXX
+#define _SVDDE_HXX
+
+#include "svl/svldllapi.h"
+#include <sot/exchange.hxx>
+#include <tools/string.hxx>
+#include <tools/link.hxx>
+#include <vector>
+
+class DdeString;
+class DdeData;
+class DdeConnection;
+class DdeTransaction;
+class DdeLink;
+class DdeRequest;
+class DdeWarmLink;
+class DdeHotLink;
+class DdePoke;
+class DdeExecute;
+class DdeItem;
+class DdeTopic;
+class DdeService;
+struct DdeDataImp;
+struct DdeImp;
+class DdeItemImp;
+struct Conversation;
+
+typedef ::std::vector< DdeService* > DdeServices;
+typedef ::std::vector< long > DdeFormats;
+typedef ::std::vector< Conversation* > ConvList;
+
+// -----------
+// - DdeData -
+// -----------
+
+class SVL_DLLPUBLIC DdeData
+{
+ friend class DdeInternal;
+ friend class DdeService;
+ friend class DdeConnection;
+ friend class DdeTransaction;
+ DdeDataImp* pImp;
+
+ SVL_DLLPRIVATE void Lock();
+
+ void SetFormat( sal_uLong nFmt );
+
+public:
+ DdeData();
+ DdeData( SAL_UNUSED_PARAMETER const void*, SAL_UNUSED_PARAMETER long, SAL_UNUSED_PARAMETER sal_uLong = FORMAT_STRING );
+ DdeData( SAL_UNUSED_PARAMETER const String& );
+ DdeData( const DdeData& );
+ ~DdeData();
+
+ operator const void*() const;
+ operator long() const;
+
+ sal_uLong GetFormat() const;
+
+ DdeData& operator = ( const DdeData& );
+
+ static sal_uLong GetExternalFormat( sal_uLong nFmt );
+ static sal_uLong GetInternalFormat( sal_uLong nFmt );
+};
+
+// ------------------
+// - DdeTransaction -
+// ------------------
+
+class SVL_DLLPUBLIC DdeTransaction
+{
+public:
+ virtual void Data( const DdeData* );
+ virtual void Done( sal_Bool bDataValid );
+protected:
+ DdeConnection& rDde;
+ DdeData aDdeData;
+ DdeString* pName;
+ short nType;
+ long nId;
+ long nTime;
+ Link aData;
+ Link aDone;
+ bool bBusy;
+
+ DdeTransaction( DdeConnection&, SAL_UNUSED_PARAMETER const String&, SAL_UNUSED_PARAMETER long = 0 );
+
+public:
+ virtual ~DdeTransaction();
+
+ bool IsBusy() { return bBusy; }
+ const OUString GetName() const;
+
+ void Execute();
+
+ void SetDataHdl( const Link& rLink ) { aData = rLink; }
+ const Link& GetDataHdl() const { return aData; }
+
+ void SetDoneHdl( const Link& rLink ) { aDone = rLink; }
+ const Link& GetDoneHdl() const { return aDone; }
+
+ void SetFormat( sal_uLong nFmt ) { aDdeData.SetFormat( nFmt ); }
+ sal_uLong GetFormat() const { return aDdeData.GetFormat(); }
+
+ long GetError();
+
+private:
+ friend class DdeInternal;
+ friend class DdeConnection;
+
+ DdeTransaction( const DdeTransaction& );
+ const DdeTransaction& operator= ( const DdeTransaction& );
+
+};
+
+// -----------
+// - DdeLink -
+// -----------
+
+class SVL_DLLPUBLIC DdeLink : public DdeTransaction
+{
+ Link aNotify;
+
+public:
+ DdeLink( DdeConnection&, const String&, long = 0 );
+ virtual ~DdeLink();
+
+ void SetNotifyHdl( const Link& rLink ) { aNotify = rLink; }
+ const Link& GetNotifyHdl() const { return aNotify; }
+ virtual void Notify();
+};
+
+// ---------------
+// - DdeWarmLink -
+// ---------------
+
+class SVL_DLLPUBLIC DdeWarmLink : public DdeLink
+{
+public:
+ DdeWarmLink( DdeConnection&, const String&, long = 0 );
+};
+
+// --------------
+// - DdeHotLink -
+// --------------
+
+class SVL_DLLPUBLIC DdeHotLink : public DdeLink
+{
+public:
+ DdeHotLink( DdeConnection&, const String&, long = 0 );
+};
+
+// --------------
+// - DdeRequest -
+// --------------
+
+class SVL_DLLPUBLIC DdeRequest : public DdeTransaction
+{
+public:
+ DdeRequest( DdeConnection&, const String&, long = 0 );
+};
+
+// -----------
+// - DdePoke -
+// -----------
+
+class SVL_DLLPUBLIC DdePoke : public DdeTransaction
+{
+public:
+ DdePoke( DdeConnection&, const String&, const char*, long,
+ sal_uLong = FORMAT_STRING, long = 0 );
+ DdePoke( DdeConnection&, const String&, SAL_UNUSED_PARAMETER const DdeData&, long = 0 );
+ DdePoke( DdeConnection&, const String&, const String&, long = 0 );
+};
+
+// --------------
+// - DdeExecute -
+// --------------
+
+class SVL_DLLPUBLIC DdeExecute : public DdeTransaction
+{
+public:
+ DdeExecute( DdeConnection&, const String&, long = 0 );
+};
+
+// -----------------
+// - DdeConnection -
+// -----------------
+
+class SVL_DLLPUBLIC DdeConnection
+{
+ friend class DdeInternal;
+ friend class DdeTransaction;
+ std::vector<DdeTransaction*> aTransactions;
+ DdeString* pService;
+ DdeString* pTopic;
+ DdeImp* pImp;
+
+public:
+ DdeConnection( SAL_UNUSED_PARAMETER const String&, SAL_UNUSED_PARAMETER const String& );
+ ~DdeConnection();
+
+ long GetError();
+ long GetConvId();
+
+ static const std::vector<DdeConnection*>& GetConnections();
+
+ sal_Bool IsConnected();
+
+ const String& GetServiceName();
+ const String& GetTopicName();
+
+private:
+ DdeConnection( const DdeConnection& );
+ const DdeConnection& operator= ( const DdeConnection& );
+};
+
+// -----------
+// - DdeItem -
+// -----------
+
+class SVL_DLLPUBLIC DdeItem
+{
+ friend class DdeInternal;
+ friend class DdeTopic;
+ DdeString* pName;
+ DdeTopic* pMyTopic;
+ DdeItemImp* pImpData;
+
+ void IncMonitor( sal_uLong );
+ void DecMonitor( sal_uLong );
+
+protected:
+ sal_uInt8 nType;
+
+public:
+ DdeItem( const sal_Unicode* );
+ DdeItem( SAL_UNUSED_PARAMETER const String& );
+ DdeItem( const DdeItem& );
+ virtual ~DdeItem();
+
+ const OUString GetName() const;
+ short GetLinks();
+ void NotifyClient();
+};
+
+// -----------
+// - DdeItem -
+// -----------
+
+class SVL_DLLPUBLIC DdeGetPutItem : public DdeItem
+{
+public:
+ DdeGetPutItem( const sal_Unicode* p );
+ DdeGetPutItem( const String& rStr );
+ DdeGetPutItem( const DdeItem& rItem );
+
+ virtual DdeData* Get( sal_uLong );
+ virtual sal_Bool Put( const DdeData* );
+ virtual void AdviseLoop( sal_Bool ); // AdviseLoop starten/stoppen
+};
+
+// ------------
+// - DdeTopic -
+// ------------
+
+class SVL_DLLPUBLIC DdeTopic
+{
+ SVL_DLLPRIVATE void _Disconnect( long );
+
+public:
+ virtual void Connect( long );
+ virtual void Disconnect( long );
+ virtual DdeData* Get( sal_uLong );
+ virtual sal_Bool Put( const DdeData* );
+ virtual sal_Bool Execute( const String* );
+ // evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden
+ virtual sal_Bool MakeItem( const OUString& rItem );
+
+ // es wird ein Warm-/Hot-Link eingerichtet. Return-Wert
+ // besagt ob es geklappt hat
+ virtual sal_Bool StartAdviseLoop();
+ virtual sal_Bool StopAdviseLoop();
+
+private:
+ friend class DdeInternal;
+ friend class DdeService;
+ friend class DdeItem;
+
+private:
+ DdeString* pName;
+ OUString aItem;
+ std::vector<DdeItem*> aItems;
+ Link aConnectLink;
+ Link aDisconnectLink;
+ Link aGetLink;
+ Link aPutLink;
+ Link aExecLink;
+
+public:
+ DdeTopic( SAL_UNUSED_PARAMETER const OUString& );
+ virtual ~DdeTopic();
+
+ const OUString GetName() const;
+ long GetConvId();
+
+ void SetConnectHdl( const Link& rLink ) { aConnectLink = rLink; }
+ const Link& GetConnectHdl() const { return aConnectLink; }
+ void SetDisconnectHdl( const Link& rLink ) { aDisconnectLink = rLink; }
+ const Link& GetDisconnectHdl() const { return aDisconnectLink; }
+ void SetGetHdl( const Link& rLink ) { aGetLink = rLink; }
+ const Link& GetGetHdl() const { return aGetLink; }
+ void SetPutHdl( const Link& rLink ) { aPutLink = rLink; }
+ const Link& GetPutHdl() const { return aPutLink; }
+ void SetExecuteHdl( const Link& rLink ) { aExecLink = rLink; }
+ const Link& GetExecuteHdl() const { return aExecLink; }
+
+ void NotifyClient( const String& );
+ sal_Bool IsSystemTopic();
+
+ void InsertItem( DdeItem* ); // fuer eigene Ableitungen!
+ DdeItem* AddItem( const DdeItem& ); // werden kopiert !
+ void RemoveItem( const DdeItem& );
+ const OUString& GetCurItem() { return aItem; }
+ const std::vector<DdeItem*>& GetItems() const { return aItems; }
+
+private:
+ DdeTopic( const DdeTopic& );
+ const DdeTopic& operator= ( const DdeTopic& );
+};
+
+// --------------
+// - DdeService -
+// --------------
+
+class SVL_DLLPUBLIC DdeService
+{
+ friend class DdeInternal;
+
+public:
+ virtual sal_Bool IsBusy();
+ virtual String GetHelp();
+ // evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden
+ virtual sal_Bool MakeTopic( const OUString& rItem );
+
+protected:
+ virtual String Topics();
+ virtual String Formats();
+ virtual String SysItems();
+ virtual String Status();
+ virtual String SysTopicGet( const String& );
+ virtual sal_Bool SysTopicExecute( const String* );
+
+ const DdeTopic* GetSysTopic() const { return pSysTopic; }
+private:
+ std::vector<DdeTopic*> aTopics;
+ DdeFormats aFormats;
+ DdeTopic* pSysTopic;
+ DdeString* pName;
+ ConvList* pConv;
+ short nStatus;
+
+ SVL_DLLPRIVATE sal_Bool HasCbFormat( sal_uInt16 );
+
+public:
+ DdeService( SAL_UNUSED_PARAMETER const String& );
+ virtual ~DdeService();
+
+ const OUString GetName() const;
+ short GetError() { return nStatus; }
+
+ static DdeServices& GetServices();
+ std::vector<DdeTopic*>& GetTopics() { return aTopics; }
+
+ void AddTopic( const DdeTopic& );
+ void RemoveTopic( const DdeTopic& );
+
+ void AddFormat( sal_uLong );
+ void RemoveFormat( sal_uLong );
+ sal_Bool HasFormat( sal_uLong );
+
+private:
+ // DdeService( const DdeService& );
+ //int operator= ( const DdeService& );
+};
+
+// ------------------
+// - DdeTransaction -
+// ------------------
+
+inline long DdeTransaction::GetError()
+{
+ return rDde.GetError();
+}
+#endif // _SVDDE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/svl.hrc b/include/svl/svl.hrc
new file mode 100644
index 000000000000..407fd6783c0f
--- /dev/null
+++ b/include/svl/svl.hrc
@@ -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 _SVL_HRC
+#define _SVL_HRC
+
+#include <svl/solar.hrc>
+
+#define STR_SVT_MIMETYPE_START (RID_SVL_START)
+#define STR_SVT_MIMETYPE_APP_OCTSTREAM (STR_SVT_MIMETYPE_START+0)
+#define STR_SVT_MIMETYPE_APP_PDF (STR_SVT_MIMETYPE_START+1)
+#define STR_SVT_MIMETYPE_APP_RTF (STR_SVT_MIMETYPE_START+2)
+#define STR_SVT_MIMETYPE_APP_MSWORD (STR_SVT_MIMETYPE_START+3)
+#define STR_SVT_MIMETYPE_APP_STARCALC (STR_SVT_MIMETYPE_START+4)
+#define STR_SVT_MIMETYPE_APP_STARCHART (STR_SVT_MIMETYPE_START+5)
+#define STR_SVT_MIMETYPE_APP_STARDRAW (STR_SVT_MIMETYPE_START+6)
+#define STR_SVT_MIMETYPE_APP_STARIMAGE (STR_SVT_MIMETYPE_START+7)
+#define STR_SVT_MIMETYPE_APP_STARMATH (STR_SVT_MIMETYPE_START+8)
+#define STR_SVT_MIMETYPE_APP_STARWRITER (STR_SVT_MIMETYPE_START+9)
+#define STR_SVT_MIMETYPE_APP_ZIP (STR_SVT_MIMETYPE_START+10)
+#define STR_SVT_MIMETYPE_AUDIO_AIFF (STR_SVT_MIMETYPE_START+11)
+#define STR_SVT_MIMETYPE_AUDIO_BASIC (STR_SVT_MIMETYPE_START+12)
+#define STR_SVT_MIMETYPE_AUDIO_VORBIS (STR_SVT_MIMETYPE_START+13)
+#define STR_SVT_MIMETYPE_AUDIO_MIDI (STR_SVT_MIMETYPE_START+14)
+#define STR_SVT_MIMETYPE_AUDIO_WAV (STR_SVT_MIMETYPE_START+15)
+#define STR_SVT_MIMETYPE_IMAGE_GIF (STR_SVT_MIMETYPE_START+16)
+#define STR_SVT_MIMETYPE_IMAGE_JPEG (STR_SVT_MIMETYPE_START+17)
+#define STR_SVT_MIMETYPE_IMAGE_PCX (STR_SVT_MIMETYPE_START+18)
+#define STR_SVT_MIMETYPE_IMAGE_BMP (STR_SVT_MIMETYPE_START+19)
+#define STR_SVT_MIMETYPE_TEXT_HTML (STR_SVT_MIMETYPE_START+20)
+#define STR_SVT_MIMETYPE_TEXT_PLAIN (STR_SVT_MIMETYPE_START+21)
+#define STR_SVT_MIMETYPE_TEXT_URL (STR_SVT_MIMETYPE_START+22)
+#define STR_SVT_MIMETYPE_TEXT_VCARD (STR_SVT_MIMETYPE_START+23)
+#define STR_SVT_MIMETYPE_VIDEO_THEORA (STR_SVT_MIMETYPE_START+24)
+#define STR_SVT_MIMETYPE_VIDEO_VDO (STR_SVT_MIMETYPE_START+25)
+#define STR_SVT_MIMETYPE_VIDEO_MSVIDEO (STR_SVT_MIMETYPE_START+26)
+#define STR_SVT_MIMETYPE_X_STARMAIL (STR_SVT_MIMETYPE_START+27)
+#define STR_SVT_MIMETYPE_X_VRML (STR_SVT_MIMETYPE_START+28)
+#define STR_SVT_MIMETYPE_APP_STARHELP (STR_SVT_MIMETYPE_START+29)
+#define STR_SVT_MIMETYPE_APP_STARIMPRESS (STR_SVT_MIMETYPE_START+30)
+
+#define STR_SVT_MIMETYPE_CNT_FSYSBOX (STR_SVT_MIMETYPE_START+35)
+#define STR_SVT_MIMETYPE_CNT_FSYSFLD (STR_SVT_MIMETYPE_START+36)
+#define STR_SVT_MIMETYPE_APP_GAL (STR_SVT_MIMETYPE_START+37)
+#define STR_SVT_MIMETYPE_APP_GAL_THEME (STR_SVT_MIMETYPE_START+38)
+#define STR_SVT_MIMETYPE_APP_STARW_GLOB (STR_SVT_MIMETYPE_START+39)
+#define STR_SVT_MIMETYPE_APP_SDM (STR_SVT_MIMETYPE_START+40)
+#define STR_SVT_MIMETYPE_APP_SMD (STR_SVT_MIMETYPE_START+41)
+#define STR_SVT_MIMETYPE_APP_STARW_WEB (STR_SVT_MIMETYPE_START+42)
+#define STR_SVT_MIMETYPE_SCHEDULE (STR_SVT_MIMETYPE_START+43)
+#define STR_SVT_MIMETYPE_SCHEDULE_EVT (STR_SVT_MIMETYPE_START+44)
+#define STR_SVT_MIMETYPE_SCHEDULE_TASK (STR_SVT_MIMETYPE_START+45)
+#define STR_SVT_MIMETYPE_SCHEDULE_FEVT (STR_SVT_MIMETYPE_START+46)
+#define STR_SVT_MIMETYPE_SCHEDULE_FTASK (STR_SVT_MIMETYPE_START+47)
+#define STR_SVT_MIMETYPE_FRAMESET (STR_SVT_MIMETYPE_START+48)
+#define STR_SVT_MIMETYPE_MACRO (STR_SVT_MIMETYPE_START+49)
+#define STR_SVT_MIMETYPE_CNT_SFSYSFOLDER (STR_SVT_MIMETYPE_START+50)
+#define STR_SVT_MIMETYPE_APP_TEMPLATE (STR_SVT_MIMETYPE_START+51)
+#define STR_SVT_MIMETYPE_IMAGE_GENERIC (STR_SVT_MIMETYPE_START+52)
+#define STR_SVT_MIMETYPE_APP_MSEXCEL (STR_SVT_MIMETYPE_START+53)
+#define STR_SVT_MIMETYPE_APP_MSEXCEL_TEMPL (STR_SVT_MIMETYPE_START+54)
+#define STR_SVT_MIMETYPE_APP_MSPPOINT (STR_SVT_MIMETYPE_START+55)
+#define STR_SVT_MIMETYPE_TEXT_VCALENDAR (STR_SVT_MIMETYPE_START+56)
+#define STR_SVT_MIMETYPE_TEXT_ICALENDAR (STR_SVT_MIMETYPE_START+57)
+#define STR_SVT_MIMETYPE_TEXT_XMLICALENDAR (STR_SVT_MIMETYPE_START+58)
+#define STR_SVT_MIMETYPE_TEXT_CDE_CALENDAR_APP (STR_SVT_MIMETYPE_START+59)
+#define STR_SVT_MIMETYPE_INET_MSG_RFC822 (STR_SVT_MIMETYPE_START+60)
+#define STR_SVT_MIMETYPE_INET_MULTI_ALTERNATIVE (STR_SVT_MIMETYPE_START+61)
+#define STR_SVT_MIMETYPE_INET_MULTI_DIGEST (STR_SVT_MIMETYPE_START+62)
+#define STR_SVT_MIMETYPE_INET_MULTI_PARALLEL (STR_SVT_MIMETYPE_START+63)
+#define STR_SVT_MIMETYPE_INET_MULTI_RELATED (STR_SVT_MIMETYPE_START+64)
+#define STR_SVT_MIMETYPE_INET_MULTI_MIXED (STR_SVT_MIMETYPE_START+65)
+#define STR_SVT_MIMETYPE_APP_IMPRESSPACKED (STR_SVT_MIMETYPE_START+66)
+#define STR_SVT_MIMETYPE_APP_JAR (STR_SVT_MIMETYPE_START+67)
+#define STR_SVT_MIMETYPE_IMAGE_PNG (STR_SVT_MIMETYPE_START+68)
+#define STR_SVT_MIMETYPE_IMAGE_TIFF (STR_SVT_MIMETYPE_START+69)
+
+#define STR_SVT_MIMETYPE_APP_SXCALC (STR_SVT_MIMETYPE_START+70)
+#define STR_SVT_MIMETYPE_APP_SXCHART (STR_SVT_MIMETYPE_START+71)
+#define STR_SVT_MIMETYPE_APP_SXDRAW (STR_SVT_MIMETYPE_START+72)
+#define STR_SVT_MIMETYPE_APP_SXMATH (STR_SVT_MIMETYPE_START+73)
+#define STR_SVT_MIMETYPE_APP_SXWRITER (STR_SVT_MIMETYPE_START+74)
+#define STR_SVT_MIMETYPE_APP_SXIMPRESS (STR_SVT_MIMETYPE_START+75)
+#define STR_SVT_MIMETYPE_APP_SXGLOBAL (STR_SVT_MIMETYPE_START+76)
+#define STR_SVT_MIMETYPE_APP_SXIPACKED (STR_SVT_MIMETYPE_START+77)
+
+
+#define STR_SVT_MIMETYPE_VIDEO_WEBM (STR_SVT_MIMETYPE_START+78)
+#define STR_SVT_MIMETYPE_AUDIO_WEBM (STR_SVT_MIMETYPE_START+79)
+
+#define STR_SVT_MIMETYPE_END (STR_SVT_MIMETYPE_AUDIO_WEBM)
+
+#define STR_COLUM_DT_AUTO (STR_SVT_MIMETYPE_END+1)
+
+#endif // #ifndef _SVTOOLS_HRC
+
+// ******************************************************************* EOF
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/svldllapi.h b/include/svl/svldllapi.h
new file mode 100644
index 000000000000..5d0feda87469
--- /dev/null
+++ b/include/svl/svldllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SVLDLLAPI_H
+#define INCLUDED_SVLDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(SVL_DLLIMPLEMENTATION)
+#define SVL_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define SVL_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define SVL_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_SVLDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/szitem.hxx b/include/svl/szitem.hxx
new file mode 100644
index 000000000000..1a576eced6fd
--- /dev/null
+++ b/include/svl/szitem.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 _SFXSZITEM_HXX
+#define _SFXSZITEM_HXX
+
+#include <tools/gen.hxx>
+
+#include <svl/poolitem.hxx>
+
+class SvStream;
+
+DBG_NAMEEX(SfxSizeItem)
+
+// -----------------------------------------------------------------------
+
+class SfxSizeItem : public SfxPoolItem
+{
+private:
+ Size aVal;
+
+public:
+ TYPEINFO();
+ SfxSizeItem();
+ SfxSizeItem( sal_uInt16 nWhich, const Size& rVal );
+ SfxSizeItem( const SfxSizeItem& );
+ ~SfxSizeItem() { DBG_DTOR(SfxSizeItem, 0); }
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
+
+ const Size& GetValue() const { return aVal; }
+ void SetValue( const Size& rNewVal ) {
+ DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
+ aVal = rNewVal; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/undo.hxx b/include/svl/undo.hxx
new file mode 100644
index 000000000000..f36cd816b607
--- /dev/null
+++ b/include/svl/undo.hxx
@@ -0,0 +1,474 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _UNDO_HXX
+#define _UNDO_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/rtti.hxx>
+#include <tools/string.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+#include <vector>
+#include <limits>
+
+//====================================================================
+
+class SVL_DLLPUBLIC SfxRepeatTarget
+{
+public:
+ TYPEINFO();
+ virtual ~SfxRepeatTarget() = 0;
+};
+
+//====================================================================
+
+class SVL_DLLPUBLIC SfxUndoContext
+{
+public:
+ virtual ~SfxUndoContext() = 0;
+};
+
+//====================================================================
+
+class SVL_DLLPUBLIC SfxUndoAction
+{
+ sal_Bool bLinked;
+public:
+ TYPEINFO();
+ SfxUndoAction();
+ virtual ~SfxUndoAction();
+
+ virtual sal_Bool IsLinked();
+ virtual void SetLinked( sal_Bool bIsLinked = sal_True );
+ virtual void Undo();
+ virtual void UndoWithContext( SfxUndoContext& i_context );
+ virtual void Redo();
+ virtual void RedoWithContext( SfxUndoContext& i_context );
+ virtual void Repeat(SfxRepeatTarget&);
+ virtual sal_Bool CanRepeat(SfxRepeatTarget&) const;
+
+ virtual sal_Bool Merge( SfxUndoAction *pNextAction );
+
+ virtual OUString GetComment() const;
+ virtual OUString GetRepeatComment(SfxRepeatTarget&) const;
+ virtual sal_uInt16 GetId() const;
+
+private:
+ SfxUndoAction& operator=( const SfxUndoAction& ); // n.i.!!
+};
+
+//========================================================================
+
+/// is a mark on the Undo stack
+typedef sal_Int32 UndoStackMark;
+#define MARK_INVALID ::std::numeric_limits< UndoStackMark >::max()
+
+//========================================================================
+
+struct MarkedUndoAction
+{
+ SfxUndoAction* pAction;
+ ::std::vector< UndoStackMark > aMarks;
+
+ MarkedUndoAction( SfxUndoAction* i_action )
+ :pAction( i_action )
+ ,aMarks()
+ {
+ }
+};
+
+class SfxUndoActions
+{
+private:
+ ::std::vector< MarkedUndoAction > m_aActions;
+
+public:
+ SfxUndoActions()
+ {
+ }
+
+ bool empty() const { return m_aActions.empty(); }
+ size_t size() const { return m_aActions.size(); }
+
+ const MarkedUndoAction& operator[]( size_t i ) const { return m_aActions[i]; }
+ MarkedUndoAction& operator[]( size_t i ) { return m_aActions[i]; }
+
+ void Remove( size_t i_pos )
+ {
+ m_aActions.erase( m_aActions.begin() + i_pos );
+ }
+
+ void Remove( size_t i_pos, size_t i_count )
+ {
+ m_aActions.erase( m_aActions.begin() + i_pos, m_aActions.begin() + i_pos + i_count );
+ }
+
+ void Insert( SfxUndoAction* i_action, size_t i_pos )
+ {
+ m_aActions.insert( m_aActions.begin() + i_pos, MarkedUndoAction( i_action ) );
+ }
+};
+
+//====================================================================
+
+/** do not make use of these implementation details, unless you
+ really really have to! */
+struct SVL_DLLPUBLIC SfxUndoArray
+{
+ SfxUndoActions aUndoActions;
+ size_t nMaxUndoActions;
+ size_t nCurUndoAction;
+ SfxUndoArray *pFatherUndoArray;
+ SfxUndoArray(size_t nMax=0):
+ nMaxUndoActions(nMax), nCurUndoAction(0),
+ pFatherUndoArray(0) {}
+ ~SfxUndoArray();
+};
+
+//=========================================================================
+
+/** do not make use of these implementation details, unless you
+ really really have to! */
+class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArray
+
+/* [Beschreibung]
+
+ UndoAction zur Klammerung mehrerer Undos in einer UndoAction.
+ Diese Actions werden vom SfxUndoManager verwendet. Dort
+ wird mit < SfxUndoManager::EnterListAction > eine Klammerebene
+ geoeffnet und mit <SfxUndoManager::LeaveListAction > wieder
+ geschlossen. Redo und Undo auf SfxListUndoActions wirken
+ Elementweise.
+
+*/
+{
+ public:
+ TYPEINFO();
+
+ SfxListUndoAction( const OUString &rComment,
+ const OUString rRepeatComment, sal_uInt16 Id, SfxUndoArray *pFather);
+ virtual void Undo();
+ virtual void UndoWithContext( SfxUndoContext& i_context );
+ virtual void Redo();
+ virtual void RedoWithContext( SfxUndoContext& i_context );
+ virtual void Repeat(SfxRepeatTarget&);
+ virtual sal_Bool CanRepeat(SfxRepeatTarget&) const;
+
+ virtual sal_Bool Merge( SfxUndoAction *pNextAction );
+
+ virtual OUString GetComment() const;
+ virtual OUString GetRepeatComment(SfxRepeatTarget&) const;
+ virtual sal_uInt16 GetId() const;
+
+ void SetComment(const OUString& rComment);
+
+ private:
+
+ sal_uInt16 nId;
+ OUString aComment;
+ OUString aRepeatComment;
+
+};
+
+//=========================================================================
+
+/** is a callback interface for notifications about state changes of an SfxUndoManager
+*/
+class SAL_NO_VTABLE SfxUndoListener
+{
+public:
+ virtual void actionUndone( const String& i_actionComment ) = 0;
+ virtual void actionRedone( const String& i_actionComment ) = 0;
+ virtual void undoActionAdded( const String& i_actionComment ) = 0;
+ virtual void cleared() = 0;
+ virtual void clearedRedo() = 0;
+ virtual void resetAll() = 0;
+ virtual void listActionEntered( const String& i_comment ) = 0;
+ virtual void listActionLeft( const String& i_comment ) = 0;
+ virtual void listActionLeftAndMerged() = 0;
+ virtual void listActionCancelled() = 0;
+ virtual void undoManagerDying() = 0;
+
+protected:
+ ~SfxUndoListener() {}
+};
+
+//=========================================================================
+
+namespace svl
+{
+ class SAL_NO_VTABLE IUndoManager
+ {
+ public:
+ enum
+ {
+ CurrentLevel = true,
+ TopLevel = false
+ };
+
+ virtual ~IUndoManager() { };
+
+ virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount ) = 0;
+ virtual size_t GetMaxUndoActionCount() const = 0;
+
+ virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False ) = 0;
+
+ virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0;
+ virtual sal_uInt16 GetUndoActionId() const = 0;
+ virtual OUString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0;
+ virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const = 0;
+
+ virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0;
+ virtual OUString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0;
+
+ virtual sal_Bool Undo() = 0;
+ virtual sal_Bool Redo() = 0;
+
+ /** clears both the Redo and the Undo stack.
+
+ Will assert and bail out when called while within a list action (<member>IsInListAction</member>).
+ */
+ virtual void Clear() = 0;
+
+ /** clears the Redo stack.
+
+ Will assert and bail out when called while within a list action (<member>IsInListAction</member>).
+ */
+ virtual void ClearRedo() = 0;
+
+ /** leaves any possible open list action (<member>IsInListAction</member>), and clears both the Undo and the
+ Redo stack.
+
+ Effectively, calling this method is equivalent to <code>while ( IsInListAction() ) LeaveListAction();</code>,
+ followed by <code>Clear()</code>. The only difference to this calling sequence is that Reset is an
+ atomic operation, also resulting in only one notification.
+ */
+ virtual void Reset() = 0;
+
+ /** determines whether an Undo or Redo is currently running
+ */
+ virtual bool IsDoing() const = 0;
+
+ virtual size_t GetRepeatActionCount() const = 0;
+ virtual OUString GetRepeatActionComment( SfxRepeatTarget &rTarget) const = 0;
+ virtual sal_Bool Repeat( SfxRepeatTarget &rTarget ) = 0;
+ virtual sal_Bool CanRepeat( SfxRepeatTarget &rTarget ) const = 0;
+
+ virtual void EnterListAction(const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId=0) = 0;
+
+ /** leaves the list action entered with EnterListAction
+ @return the number of the sub actions in the list which has just been left. Note that in case no such
+ actions exist, the list action does not contribute to the Undo stack, but is silently removed.
+ */
+ virtual size_t LeaveListAction() = 0;
+
+ /** leaves the list action entered with EnterListAction, and forcefully merges the previous
+ action on the stack into the newly created list action.
+
+ Say you have an Undo action A on the stack, then call EnterListAction, followed by one or more calls to
+ AddUndoAction, followed by a call to LeaveAndMergeListAction. In opposite to LeaveListAction, your Undo
+ stack will now still contain one undo action: the newly created list action, whose first child is the
+ original A, whose other children are those you added via AddUndoAction, and whose comment is the same as
+ the comment of A.
+
+ Effectively, this means that all actions added between EnterListAction and LeaveAndMergeListAction are
+ hidden from the user.
+
+ @return the number of the sub actions in the list which has just been left. Note that in case no such
+ actions exist, the list action does not contribute to the Undo stack, but is silently removed.
+ */
+ virtual size_t LeaveAndMergeListAction() = 0;
+
+ /// determines whether we're within a ListAction context, i.e. a LeaveListAction/LeaveAndMergeListAction call is pending
+ virtual bool IsInListAction() const = 0;
+
+ /// determines how many nested list actions are currently open
+ virtual size_t GetListActionDepth() const = 0;
+
+ /** clears the redo stack and removes the top undo action */
+ virtual void RemoveLastUndoAction() = 0;
+
+ /** 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!
+
+ Multiple calls to <code>EnableUndo</code> are not cumulative. That is, calling <code>EnableUndo( false )</code>
+ twice, and then calling <code>EnableUndo( true )</code> means that Undo is enable afterwards.
+ */
+ virtual void EnableUndo( bool bEnable ) = 0;
+
+ // 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.
+ virtual bool IsUndoEnabled() const = 0;
+
+ /// adds a new listener to be notified about changes in the UndoManager's state
+ virtual void AddUndoListener( SfxUndoListener& i_listener ) = 0;
+ virtual void RemoveUndoListener( SfxUndoListener& i_listener ) = 0;
+ };
+}
+
+//=========================================================================
+
+namespace svl { namespace undo { namespace impl
+{
+ class UndoManagerGuard;
+ class LockGuard;
+} } }
+
+struct SfxUndoManager_Data;
+class SVL_DLLPUBLIC SfxUndoManager : public ::svl::IUndoManager
+{
+ friend class SfxLinkUndoAction;
+
+ ::boost::scoped_ptr< SfxUndoManager_Data >
+ m_pData;
+public:
+ SfxUndoManager( size_t nMaxUndoActionCount = 20 );
+ virtual ~SfxUndoManager();
+
+ // IUndoManager overridables
+ virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount );
+ virtual size_t GetMaxUndoActionCount() const;
+ virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False );
+ virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const;
+ virtual sal_uInt16 GetUndoActionId() const;
+ virtual OUString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const;
+ virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const;
+ virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const;
+ virtual OUString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const;
+ virtual sal_Bool Undo();
+ virtual sal_Bool Redo();
+ virtual void Clear();
+ virtual void ClearRedo();
+ virtual void Reset();
+ virtual bool IsDoing() const;
+ virtual size_t GetRepeatActionCount() const;
+ virtual OUString GetRepeatActionComment( SfxRepeatTarget &rTarget) const;
+ virtual sal_Bool Repeat( SfxRepeatTarget &rTarget );
+ virtual sal_Bool CanRepeat( SfxRepeatTarget &rTarget ) const;
+ virtual void EnterListAction(const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId=0);
+ virtual size_t LeaveListAction();
+ virtual size_t LeaveAndMergeListAction();
+ virtual bool IsInListAction() const;
+ virtual size_t GetListActionDepth() const;
+ virtual void RemoveLastUndoAction();
+ virtual void EnableUndo( bool bEnable );
+ virtual bool IsUndoEnabled() const;
+ virtual void AddUndoListener( SfxUndoListener& i_listener );
+ virtual void RemoveUndoListener( SfxUndoListener& i_listener );
+
+ /** marks the current top-level element of the Undo stack, and returns a unique ID for it
+ */
+ UndoStackMark MarkTopUndoAction();
+
+ /** removes a mark given by its ID.
+ After the call, the mark ID is invalid.
+ */
+ void RemoveMark( UndoStackMark const i_mark );
+
+ /** determines whether the top action on the Undo stack has a given mark
+ */
+ bool HasTopUndoActionMark( UndoStackMark const i_mark );
+
+ /** removes the oldest Undo actions from the stack
+ */
+ void RemoveOldestUndoActions( size_t const i_count );
+
+protected:
+ sal_Bool UndoWithContext( SfxUndoContext& i_context );
+ sal_Bool RedoWithContext( SfxUndoContext& i_context );
+
+ void ImplClearRedo_NoLock( bool const i_currentLevel );
+
+ /** clears all undo actions on the current level, plus all undo actions on superordinate levels,
+ as soon as those levels are reached.
+
+ If no list action is active currently, i.e. we're on the top level already, this method is equivalent to
+ ->Clear.
+
+ Otherwise, the Undo actions on the current level are removed. Upon leaving the current list action, all
+ undo actions on the then-current level are removed, too. This is continued until the top level is reached.
+ */
+ void ClearAllLevels();
+
+private:
+ size_t ImplLeaveListAction( const bool i_merge, ::svl::undo::impl::UndoManagerGuard& i_guard );
+ bool ImplAddUndoAction_NoNotify( SfxUndoAction* pAction, bool bTryMerge, bool bClearRedo, ::svl::undo::impl::UndoManagerGuard& i_guard );
+ void ImplClearRedo( ::svl::undo::impl::UndoManagerGuard& i_guard, bool const i_currentLevel );
+ void ImplClearUndo( ::svl::undo::impl::UndoManagerGuard& i_guard );
+ void ImplClearCurrentLevel_NoNotify( ::svl::undo::impl::UndoManagerGuard& i_guard );
+ size_t ImplGetRedoActionCount_Lock( bool const i_currentLevel = CurrentLevel ) const;
+ bool ImplIsUndoEnabled_Lock() const;
+ bool ImplIsInListAction_Lock() const;
+ void ImplEnableUndo_Lock( bool const i_enable );
+
+ sal_Bool ImplUndo( SfxUndoContext* i_contextOrNull );
+ sal_Bool ImplRedo( SfxUndoContext* i_contextOrNull );
+
+ friend class ::svl::undo::impl::LockGuard;
+};
+
+//=========================================================================
+
+class SVL_DLLPUBLIC SfxLinkUndoAction : public SfxUndoAction
+
+/* [Beschreibung]
+
+ Die SfxLinkUndoAction dient zur Verbindung zweier SfxUndoManager. Die
+ im ersten SfxUndoManager eingefuegten SfxUndoAction leiten ihr Undo und Redo
+ an den zweiten weiter, so dass ein Undo und Redo am ersten
+ SfxUndoManager wie eine am zweiten wirkt.
+
+ Die SfxLinkUndoAction ist nach dem Einfuegen der SfxUndoAction am
+ zweiten SfxUndoManager einzufuegen. Waehrend der zweite SfxUndoManager
+ vom ersten ferngesteuert wird, duerfen an ihm weder Actions eingefuegt werden,
+ noch darf Undo/Redo aufgerufen werden.
+
+*/
+
+{
+public:
+ TYPEINFO();
+ SfxLinkUndoAction(::svl::IUndoManager *pManager);
+ ~SfxLinkUndoAction();
+
+ virtual void Undo();
+ virtual void Redo();
+ virtual sal_Bool CanRepeat(SfxRepeatTarget& r) const;
+
+ virtual void Repeat(SfxRepeatTarget&r);
+
+ virtual OUString GetComment() const;
+ virtual OUString GetRepeatComment(SfxRepeatTarget&r) const;
+ virtual sal_uInt16 GetId() const;
+
+ SfxUndoAction* GetAction() const { return pAction; }
+
+protected:
+ ::svl::IUndoManager *pUndoManager;
+ SfxUndoAction *pAction;
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/urihelper.hxx b/include/svl/urihelper.hxx
new file mode 100644
index 000000000000..321d9cd2ae0b
--- /dev/null
+++ b/include/svl/urihelper.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 SVTOOLS_URIHELPER_HXX
+#define SVTOOLS_URIHELPER_HXX
+
+#include "svl/svldllapi.h"
+#include "com/sun/star/uno/Reference.hxx"
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <rtl/textenc.h>
+#include <tools/link.hxx>
+#include <tools/solar.h>
+#include <tools/urlobj.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace uno { class XComponentContext; }
+ namespace uri { class XUriReference; }
+} } }
+
+class CharClass;
+
+//============================================================================
+namespace URIHelper {
+
+/**
+ @ATT
+ Calling this function with defaulted arguments rMaybeFileHdl = Link() and
+ bCheckFileExists = true often leads to results that are not intended:
+ Whenever the given rTheBaseURIRef is a file URL, the given rTheRelURIRef is
+ relative, and rTheRelURIRef could also be smart-parsed as a non-file URL
+ (e.g., the relative URL "foo/bar" can be smart-parsed as "http://foo/bar"),
+ then SmartRel2Abs called with rMaybeFileHdl = Link() and bCheckFileExists =
+ true returns the non-file URL interpretation. To avoid this, either pass
+ some non-null rMaybeFileHdl if you want to check generated file URLs for
+ existence (see URIHelper::GetMaybeFileHdl), or use bCheckFileExists = false
+ if you want to generate file URLs without checking for their existence.
+*/
+SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
+ OUString const & rTheRelURIRef,
+ Link const & rMaybeFileHdl = Link(),
+ bool bCheckFileExists = true,
+ bool bIgnoreFragment = false,
+ INetURLObject::EncodeMechanism eEncodeMechanism = INetURLObject::WAS_ENCODED,
+ INetURLObject::DecodeMechanism eDecodeMechanism = INetURLObject::DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ bool bRelativeNonURIs = false,
+ INetURLObject::FSysStyle eStyle = INetURLObject::FSYS_DETECT);
+
+//============================================================================
+SVL_DLLPUBLIC void SetMaybeFileHdl(Link const & rTheMaybeFileHdl);
+
+//============================================================================
+SVL_DLLPUBLIC Link GetMaybeFileHdl();
+
+/**
+ Converts a URI reference to a relative one, ignoring certain differences (for
+ example, treating file URLs for case-ignoring file systems
+ case-insensitively).
+
+ @param context a component context; must not be null
+
+ @param baseUriReference a base URI reference
+
+ @param uriReference a URI reference
+
+ @return a URI reference representing the given uriReference relative to the
+ given baseUriReference; if the given baseUriReference is not an absolute,
+ hierarchical URI reference, or the given uriReference is not a valid URI
+ reference, null is returned
+
+ @exception std::bad_alloc if an out-of-memory condition occurs
+
+ @exception com::sun::star::uno::RuntimeException if any error occurs
+ */
+SVL_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uri::XUriReference >
+normalizedMakeRelative(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context,
+ OUString const & baseUriReference, OUString const & uriReference);
+
+/**
+ A variant of normalizedMakeRelative with a simplified interface.
+
+ Internally calls normalizedMakeRelative with the default component context.
+
+ @param baseUriReference a base URI reference, passed to
+ normalizedMakeRelative
+
+ @param uriReference a URI reference, passed to normalizedMakeRelative
+
+ @return if the XUriReference returnd by normalizedMakeRelative is empty,
+ uriReference is returned unmodified; otherwise, the result of calling
+ XUriReference::getUriReference on the XUriReference returnd by
+ normalizedMakeRelative is returned
+
+ @exception std::bad_alloc if an out-of-memory condition occurs
+
+ @exception com::sun::star::uno::RuntimeException if any error occurs
+
+ @deprecated
+ No code should rely on the default component context.
+*/
+SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative( OUString const & baseUriReference,
+ OUString const & uriReference);
+
+//============================================================================
+SVL_DLLPUBLIC OUString FindFirstURLInText(OUString const & rText,
+ sal_Int32 & rBegin,
+ sal_Int32 & rEnd,
+ CharClass const & rCharClass,
+ INetURLObject::EncodeMechanism eMechanism = INetURLObject::WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ INetURLObject::FSysStyle eStyle = INetURLObject::FSYS_DETECT);
+
+//============================================================================
+/** Remove any password component from both absolute and relative URLs.
+
+ @ATT The current implementation will not remove a password from a
+ relative URL that has an authority component (e.g., the password is not
+ removed from the relative ftp URL <//user:password@domain/path>). But
+ since our functions to translate between absolute and relative URLs never
+ produce relative URLs with authority components, this is no real problem.
+
+ @ATT For relative URLs (or anything not recognized as an absolute URI),
+ the current implementation will return the input unmodified, not applying
+ any translations implied by the encode/decode parameters.
+
+ @param rURI An absolute or relative URI reference.
+
+ @param eEncodeMechanism See the general discussion for INetURLObject set-
+ methods.
+
+ @param eDecodeMechanism See the general discussion for INetURLObject get-
+ methods.
+
+ @param eCharset See the general discussion for INetURLObject get- and
+ set-methods.
+
+ @return The input URI with any password component removed.
+ */
+SVL_DLLPUBLIC OUString removePassword(OUString const & rURI,
+ INetURLObject::EncodeMechanism eEncodeMechanism = INetURLObject::WAS_ENCODED,
+ INetURLObject::DecodeMechanism eDecodeMechanism = INetURLObject::DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+}
+
+#endif // SVTOOLS_URIHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/urlbmk.hxx b/include/svl/urlbmk.hxx
new file mode 100644
index 000000000000..cc04b226d146
--- /dev/null
+++ b/include/svl/urlbmk.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 _URLBMK_HXX
+#define _URLBMK_HXX
+
+
+#include <tools/string.hxx>
+
+//=========================================================================
+
+class INetBookmark
+
+/* [Beschreibung]
+
+ Diese Klasse stellt ein Bookmark dar, welches aus einer URL und
+ einem dazuge"horigen Beschreibungstext besteht.
+
+ Es gibt ein eigenes Clipboardformat und Hilfsmethoden zum Kopieren
+ und Einf"ugen in und aus Clipboard und DragServer.
+*/
+
+{
+ String aUrl;
+ String aDescr;
+
+protected:
+
+ void SetURL( const String& rS ) { aUrl = rS; }
+ void SetDescription( const String& rS ) { aDescr = rS; }
+
+public:
+ INetBookmark( const String &rUrl, const String &rDescr )
+ : aUrl( rUrl ), aDescr( rDescr )
+ {}
+ INetBookmark()
+ {}
+
+ const String& GetURL() const { return aUrl; }
+ const String& GetDescription() const { return aDescr; }
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/urlfilter.hxx b/include/svl/urlfilter.hxx
new file mode 100644
index 000000000000..abcf0fd07091
--- /dev/null
+++ b/include/svl/urlfilter.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 SVTOOLS_URL_FILTER_HXX
+#define SVTOOLS_URL_FILTER_HXX
+
+#include <tools/wldcrd.hxx>
+#include <functional>
+#include <vector>
+/** filters allowed URLs
+*/
+class IUrlFilter
+{
+public:
+ virtual bool isUrlAllowed( const OUString& _rURL ) const = 0;
+
+protected:
+ virtual inline ~IUrlFilter() = 0;
+};
+
+inline IUrlFilter::~IUrlFilter() {}
+
+struct FilterMatch : public ::std::unary_function< bool, WildCard >
+{
+private:
+ const OUString& m_rCompareString;
+public:
+ FilterMatch( const OUString& _rCompareString ) : m_rCompareString( _rCompareString ) { }
+
+ bool operator()( const WildCard& _rMatcher )
+ {
+ return _rMatcher.Matches( m_rCompareString ) ? true : false;
+ }
+
+ static void createWildCardFilterList(const OUString& _rFilterList,::std::vector< WildCard >& _rFilters);
+};
+
+#endif // SVTOOLS_URL_FILTER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/visitem.hxx b/include/svl/visitem.hxx
new file mode 100644
index 000000000000..adb72d0578e7
--- /dev/null
+++ b/include/svl/visitem.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 _SFXVISIBILITYITEM_HXX
+#define _SFXVISIBILITYITEM_HXX
+
+#include "svl/svldllapi.h"
+#include <tools/debug.hxx>
+#include <svl/poolitem.hxx>
+#include <com/sun/star/frame/status/Visibility.hpp>
+
+//============================================================================
+DBG_NAMEEX_VISIBILITY(SfxVisibilityItem, SVL_DLLPUBLIC)
+
+class SVL_DLLPUBLIC SfxVisibilityItem: public SfxPoolItem
+{
+ ::com::sun::star::frame::status::Visibility m_nValue;
+
+public:
+ TYPEINFO();
+
+ explicit SfxVisibilityItem(sal_uInt16 which = 0, sal_Bool bVisible = sal_True):
+ SfxPoolItem(which)
+ {
+ m_nValue.bVisible = bVisible;
+ DBG_CTOR(SfxVisibilityItem, 0);
+ }
+
+ SfxVisibilityItem(sal_uInt16 which, SvStream & rStream);
+
+ SfxVisibilityItem(const SfxVisibilityItem & rItem):
+ SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
+ { DBG_CTOR(SfxVisibilityItem, 0); }
+
+ virtual ~SfxVisibilityItem() { DBG_DTOR(SfxVisibilityItem, 0); }
+
+ virtual int operator ==(const SfxPoolItem & rItem) const;
+
+ using SfxPoolItem::Compare;
+ virtual int Compare(const SfxPoolItem & rWith) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
+ SfxMapUnit, SfxMapUnit,
+ OUString & rText,
+ const IntlWrapper * = 0)
+ const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 ) const;
+
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 );
+
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
+
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
+
+ virtual sal_uInt16 GetValueCount() const;
+
+ virtual OUString GetValueTextByVal(sal_Bool bTheValue) const;
+
+ sal_Bool GetValue() const { return m_nValue.bVisible; }
+
+ void SetValue(sal_Bool bVisible) { m_nValue.bVisible = bVisible; }
+};
+
+#endif // _SFXVISIBILITYITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/whiter.hxx b/include/svl/whiter.hxx
new file mode 100644
index 000000000000..e92383624743
--- /dev/null
+++ b/include/svl/whiter.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 _SFX_WHITER_HXX
+#define _SFX_WHITER_HXX
+
+#include "svl/svldllapi.h"
+
+#include <limits.h>
+#include <tools/solar.h>
+
+class SfxItemSet;
+
+
+// INCLUDE ---------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxWhichIter
+{
+ const sal_uInt16 *pRanges, *pStart;
+ sal_uInt16 nOfst, nFrom, nTo;
+
+public:
+ SfxWhichIter( const SfxItemSet& rSet, sal_uInt16 nFrom = 0, sal_uInt16 nTo = USHRT_MAX );
+ ~SfxWhichIter();
+
+ sal_uInt16 GetCurWhich() const { return *pRanges + nOfst; }
+ sal_uInt16 NextWhich();
+ sal_uInt16 FirstWhich();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/xmlement.hxx b/include/svl/xmlement.hxx
new file mode 100644
index 000000000000..c6b67d59105b
--- /dev/null
+++ b/include/svl/xmlement.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVTOOLS_XMLEMENT_HXX
+#define _SVTOOLS_XMLEMENT_HXX
+
+#include <sal/types.h>
+
+struct SvXMLEnumMapEntry
+{
+ const sal_Char *pName;
+ sal_uInt16 nValue;
+};
+
+
+#endif // _SVTOOLS_XMLEMENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
new file mode 100644
index 000000000000..d5c84235a4f9
--- /dev/null
+++ b/include/svl/zforlist.hxx
@@ -0,0 +1,1037 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _ZFORLIST_HXX
+#define _ZFORLIST_HXX
+
+#include "svl/svldllapi.h"
+#include <rtl/ustrbuf.hxx>
+#include <rtl/ustring.hxx>
+#include <tools/string.hxx>
+#include <i18nlangtag/lang.h>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/i18n/NumberFormatCode.hpp>
+#include <unotools/localedatawrapper.hxx>
+#include <tools/link.hxx>
+#include <svl/ondemand.hxx>
+#include <svl/nfkeytab.hxx>
+
+#include <map>
+#include <set>
+#include <boost/ptr_container/ptr_vector.hpp>
+
+class Date;
+class SvStream;
+class Color;
+class CharClass;
+class CalendarWrapper;
+
+class ImpSvNumberformatScan;
+class ImpSvNumberInputScan;
+class SvNumberformat;
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+}}}
+
+#define SV_COUNTRY_LANGUAGE_OFFSET 10000 // Max count of formats per country/language
+#define SV_MAX_ANZ_STANDARD_FORMATE 100 // Max count of builtin default formats per CL
+
+// Format types
+#ifndef NUMBERFORMAT_ALL
+// also defined in com/sun/star/util/NumberFormat.hpp
+//! => put in single .idl file and include here
+#define NUMBERFORMAT_ALL 0x000 /// Just for Output of total list, not a real format type
+#define NUMBERFORMAT_DEFINED 0x001 /// Format defined by user
+#define NUMBERFORMAT_DATE 0x002 /// Number as date
+#define NUMBERFORMAT_TIME 0x004 /// Number as time
+#define NUMBERFORMAT_CURRENCY 0x008 /// Number as currency
+#define NUMBERFORMAT_NUMBER 0x010 /// Any "normal" number format
+#define NUMBERFORMAT_SCIENTIFIC 0x020 /// Number as scientific
+#define NUMBERFORMAT_FRACTION 0x040 /// Number as fraction
+#define NUMBERFORMAT_PERCENT 0x080 /// Number as percent
+#define NUMBERFORMAT_TEXT 0x100 /// Text format
+#define NUMBERFORMAT_DATETIME 0x006 /// Number as date and time
+#define NUMBERFORMAT_LOGICAL 0x400 /// Number as boolean value
+#define NUMBERFORMAT_UNDEFINED 0x800 /// Format undefined yet in analyzing
+#endif
+#define NUMBERFORMAT_ENTRY_NOT_FOUND (sal_uInt32)(0xffffffff) /// MAX_ULONG
+
+
+/** enum values for <method>SvNumberFormatter::GetFormatIndex</method>
+
+ <p>
+ Builtin standard formats, order should be also the arrangement in the
+ dialog list box representation.</p>
+
+ <p>
+ Date specials:<ul>
+ <li>SYSTEM: As set in System Regional Settings.
+ <li>SYS: short/long defined, order and separators from System Regional Settings.
+ <li>DEF: short/long and order defined, separators from System Regional Settings.
+ <li>DIN: all settings hard coded as DIN (Deutsche Industrie Norm) and EN (European Norm) require.
+ <li>all other: hard coded
+ </ul>
+
+ Do NOT insert any new values!
+ The values here correspond with those in offapi/com/sun/star/i18n/NumberFormatIndex.idl
+ */
+enum NfIndexTableOffset
+{
+ NF_NUMERIC_START = 0,
+
+ NF_NUMBER_START = NF_NUMERIC_START,
+ NF_NUMBER_STANDARD = NF_NUMBER_START, // Standard/General
+ NF_NUMBER_INT, // 0
+ NF_NUMBER_DEC2, // 0.00
+ NF_NUMBER_1000INT, // #,##0
+ NF_NUMBER_1000DEC2, // #,##0.00
+ NF_NUMBER_SYSTEM, // #,##0.00 or whatever is set in System Regional Settings
+ NF_NUMBER_END = NF_NUMBER_SYSTEM,
+
+ NF_SCIENTIFIC_START,
+ NF_SCIENTIFIC_000E000 = NF_SCIENTIFIC_START, // 0.00E+000
+ NF_SCIENTIFIC_000E00, // 0.00E+00
+ NF_SCIENTIFIC_END = NF_SCIENTIFIC_000E00,
+
+ NF_PERCENT_START,
+ NF_PERCENT_INT = NF_PERCENT_START, // 0%
+ NF_PERCENT_DEC2, // 0.00%
+ NF_PERCENT_END = NF_PERCENT_DEC2,
+
+ NF_FRACTION_START,
+ NF_FRACTION_1 = NF_FRACTION_START, // # ?/?
+ NF_FRACTION_2, // # ??/??
+ NF_FRACTION_END = NF_FRACTION_2,
+
+ NF_NUMERIC_END = NF_FRACTION_END,
+
+ NF_CURRENCY_START,
+ NF_CURRENCY_1000INT = NF_CURRENCY_START,// #,##0 DM
+ NF_CURRENCY_1000DEC2, // #,##0.00 DM
+ NF_CURRENCY_1000INT_RED, // #,##0 DM negative in red
+ NF_CURRENCY_1000DEC2_RED, // #,##0.00 DM negative in red
+ NF_CURRENCY_1000DEC2_CCC, // #,##0.00 DEM currency abbreviation
+ NF_CURRENCY_1000DEC2_DASHED, // #,##0.-- DM
+ NF_CURRENCY_END = NF_CURRENCY_1000DEC2_DASHED,
+
+ NF_DATE_START,
+ NF_DATE_SYSTEM_SHORT = NF_DATE_START, // 08.10.97
+ NF_DATE_SYSTEM_LONG, // Wednesday, 8. October 1997
+ NF_DATE_SYS_DDMMYY, // 08.10.97
+ NF_DATE_SYS_DDMMYYYY, // 08.10.1997
+ NF_DATE_SYS_DMMMYY, // 8. Oct 97
+ NF_DATE_SYS_DMMMYYYY, // 8. Oct 1997
+ NF_DATE_DIN_DMMMYYYY, // 8. Oct. 1997 DIN
+ NF_DATE_SYS_DMMMMYYYY, // 8. October 1997
+ NF_DATE_DIN_DMMMMYYYY, // 8. October 1997 DIN
+ NF_DATE_SYS_NNDMMMYY, // Wed, 8. Okt 97
+ NF_DATE_DEF_NNDDMMMYY, // Wed 08.Okt 97
+ NF_DATE_SYS_NNDMMMMYYYY, // Wed, 8. Oktober 1997
+ NF_DATE_SYS_NNNNDMMMMYYYY, // Wednesday, 8. Oktober 1997
+ NF_DATE_DIN_MMDD, // 10-08 DIN
+ NF_DATE_DIN_YYMMDD, // 97-10-08 DIN
+ NF_DATE_DIN_YYYYMMDD, // 1997-10-08 DIN
+ NF_DATE_SYS_MMYY, // 10.97
+ NF_DATE_SYS_DDMMM, // 08.Oct
+ NF_DATE_MMMM, // October
+ NF_DATE_QQJJ, // 4. Quarter 97
+ NF_DATE_WW, // week of year
+ NF_DATE_END = NF_DATE_WW,
+
+ NF_TIME_START,
+ NF_TIME_HHMM = NF_TIME_START, // HH:MM
+ NF_TIME_HHMMSS, // HH:MM:SS
+ NF_TIME_HHMMAMPM, // HH:MM AM/PM
+ NF_TIME_HHMMSSAMPM, // HH:MM:SS AM/PM
+ NF_TIME_HH_MMSS, // [HH]:MM:SS
+ NF_TIME_MMSS00, // MM:SS,00
+ NF_TIME_HH_MMSS00, // [HH]:MM:SS,00
+ NF_TIME_END = NF_TIME_HH_MMSS00,
+
+ NF_DATETIME_START,
+ NF_DATETIME_SYSTEM_SHORT_HHMM = NF_DATETIME_START, // 08.10.97 01:23
+ NF_DATETIME_SYS_DDMMYYYY_HHMMSS, // 08.10.1997 01:23:45
+ NF_DATETIME_END = NF_DATETIME_SYS_DDMMYYYY_HHMMSS,
+
+ NF_BOOLEAN, // BOOLEAN
+ NF_TEXT, // @
+
+ // From here on are values of new built-in formats that are not in the
+ // original NumberFormatIndex.idl
+
+ NF_FRACTION_3, // # ?/4
+ NF_FRACTION_4, // # ?/100
+
+ NF_INDEX_TABLE_ENTRIES
+};
+
+
+// #45717# IsNumberFormat( "98-10-24", 30, x ), YMD Format set with DMY
+// International settings doesn't recognize the string as a date.
+/** enum values for <method>SvNumberFormatter::SetEvalDateFormat</method>
+
+ <p>How <method>ImpSvNumberInputScan::GetDateRef</method> shall take the
+ DateFormat order (YMD,DMY,MDY) into account, if called from IsNumberFormat
+ with a date format to match against.
+ */
+enum NfEvalDateFormat
+{
+ /** DateFormat only from International, default. */
+ NF_EVALDATEFORMAT_INTL,
+
+ /** DateFormat only from date format passed to function (if any).
+ If no date format is passed then the DateFormat is taken from International. */
+ NF_EVALDATEFORMAT_FORMAT,
+
+ /** First try the DateFormat from International. If it doesn't match a
+ valid date try the DateFormat from the date format passed. */
+ NF_EVALDATEFORMAT_INTL_FORMAT,
+
+ /** First try the DateFormat from the date format passed. If it doesn't
+ match a valid date try the DateFormat from International. */
+ NF_EVALDATEFORMAT_FORMAT_INTL
+};
+
+
+typedef std::map<sal_uInt32, SvNumberformat*> SvNumberFormatTable;
+typedef std::map<sal_uInt16, sal_uInt32> SvNumberFormatterIndexTable;
+
+typedef ::std::map< sal_uInt32, sal_uInt32> SvNumberFormatterMergeMap;
+
+typedef ::std::set< LanguageType > NfInstalledLocales;
+
+
+/** Language/country dependent currency entries
+ */
+class SVL_DLLPUBLIC NfCurrencyEntry
+{
+ OUString aSymbol; /// currency symbol
+ OUString aBankSymbol; /// currency abbreviation
+ LanguageType eLanguage; /// language/country value
+ sal_uInt16 nPositiveFormat; /// position of symbol
+ sal_uInt16 nNegativeFormat; /// position of symbol and type and position of negative sign
+ sal_uInt16 nDigits; /// count of decimal digits
+ sal_Unicode cZeroChar; /// which character is used for zeros as last decimal digits
+
+ /// not implemented, prevent usage
+ NfCurrencyEntry( const NfCurrencyEntry& );
+ /// not implemented, prevent usage
+ NfCurrencyEntry& operator=( const NfCurrencyEntry& );
+
+private:
+
+ // nDecimalFormat := 0, 1, 2
+ // #,##0 or #,##0.00 or #,##0.-- is returned
+ SVL_DLLPRIVATE OUString Impl_BuildFormatStringNumChars( const LocaleDataWrapper&, sal_uInt16 nDecimalFormat) const;
+
+public:
+
+ NfCurrencyEntry( const LocaleDataWrapper& rLocaleData,
+ LanguageType eLang );
+ NfCurrencyEntry( const ::com::sun::star::i18n::Currency & rCurr,
+ const LocaleDataWrapper& rLocaleData,
+ LanguageType eLang );
+ ~NfCurrencyEntry() {}
+
+ /// Symbols and language identical
+ bool operator==( const NfCurrencyEntry& r ) const;
+
+ const OUString& GetSymbol() const { return aSymbol; }
+ const OUString& GetBankSymbol() const { return aBankSymbol; }
+ LanguageType GetLanguage() const { return eLanguage; }
+ sal_uInt16 GetPositiveFormat() const { return nPositiveFormat; }
+ sal_uInt16 GetNegativeFormat() const { return nNegativeFormat; }
+ sal_uInt16 GetDigits() const { return nDigits; }
+ sal_Unicode GetZeroChar() const { return cZeroChar; }
+
+ /** [$DM-407] (bBank==false) or [$DEM] (bBank==true)
+ is returned. If bBank==false and
+ bWithoutExtension==true only [$DM] */
+ OUString BuildSymbolString(bool bBank, bool bWithoutExtension = false) const;
+
+ /** #,##0.00 [$DM-407] is returned, separators
+ from rLoc, incl. minus sign but without [RED] */
+ OUString BuildPositiveFormatString(bool bBank, const LocaleDataWrapper&,
+ sal_uInt16 nDecimalFormat = 1) const;
+ OUString BuildNegativeFormatString(bool bBank, const LocaleDataWrapper&,
+ sal_uInt16 nDecimalFormat = 1) const;
+
+ /** [$DM-407] (or [$DEM] if bBank==true)
+ is appended/prepended to rStr, incl. minus sign */
+ void CompletePositiveFormatString(OUStringBuffer& rStr, bool bBank,
+ sal_uInt16 nPosiFormat) const;
+ void CompleteNegativeFormatString(OUStringBuffer& rStr, bool bBank,
+ sal_uInt16 nNegaFormat) const;
+
+ /// rSymStr is appended/prepended to rStr, incl. minus sign
+ static void CompletePositiveFormatString(OUStringBuffer& rStr,
+ const OUString& rSymStr, sal_uInt16 nPosiFormat);
+ static void CompleteNegativeFormatString(OUStringBuffer& rStr,
+ const OUString& rSymStr, sal_uInt16 nNegaFormat);
+
+ /** Representation of a currency (symbol position and
+ negative sign) in other language settings */
+ static sal_uInt16 GetEffectivePositiveFormat( sal_uInt16 nIntlFormat,
+ sal_uInt16 nCurrFormat, bool bBank );
+ static sal_uInt16 GetEffectiveNegativeFormat( sal_uInt16 nIntlFormat,
+ sal_uInt16 nCurrFormat, bool bBank );
+
+ /// General Unicode Euro symbol
+ static inline sal_Unicode GetEuroSymbol() { return sal_Unicode(0x20AC); }
+ /** Platform and CharSet dependent Euro symbol,
+ needed for import/export */
+ static sal_Char GetEuroSymbol( rtl_TextEncoding eTextEncoding );
+};
+
+typedef boost::ptr_vector<NfCurrencyEntry> NfCurrencyTable;
+
+typedef std::vector< OUString > NfWSStringsDtor;
+
+class SvNumberFormatterRegistry_Impl;
+
+class SVL_DLLPUBLIC SvNumberFormatter
+{
+public:
+ /**
+ * We can't technically have an "infinite" value, so we use an arbitrary
+ * upper precision threshold to represent the "unlimited" precision.
+ */
+ static const sal_uInt16 UNLIMITED_PRECISION;
+
+ /**
+ * Precision suitable for numbers displayed in input bar, for instance
+ * Calc's formula input bar.
+ */
+ static const sal_uInt16 INPUTSTRING_PRECISION;
+
+ /// Preferred ctor with service manager and language/country enum
+ SvNumberFormatter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ LanguageType eLang
+ );
+
+ ~SvNumberFormatter();
+
+ /// Set CallBack to ColorTable
+ void SetColorLink( const Link& rColorTableCallBack ) { aColorLink = rColorTableCallBack; }
+ /// Do the CallBack to ColorTable
+ Color* GetUserDefColor(sal_uInt16 nIndex);
+
+ /// Change language/country, also input and format scanner
+ void ChangeIntl( LanguageType eLnge );
+ /// Change the reference null date
+ void ChangeNullDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear);
+ /// Change standard precision
+ void ChangeStandardPrec(short nPrec);
+ /// Set zero value suppression
+ void SetNoZero(bool bNZ) { bNoZero = bNZ; }
+
+ /** The language with which the formatter was initialized (system setting),
+ NOT the current language after a ChangeIntl() */
+ LanguageType GetLanguage() const { return IniLnge; }
+
+ // Determine whether two format types are input compatible or not
+ bool IsCompatible(short eOldType, short eNewType);
+
+ /** Get table of formats of a specific type of a locale. A format FIndex is
+ tested whether it has the type and locale requested, if it doesn't
+ match FIndex returns the default format for the type/locale. If no
+ specific format is to be selected FIndex may be initialized to 0. */
+ SvNumberFormatTable& GetEntryTable(short eType,
+ sal_uInt32& FIndex,
+ LanguageType eLnge);
+
+ /** Get table of formats of a specific type of a language/country.
+ FIndex returns the default format of that type.
+ If the language/country was never touched before new entries are generated */
+ SvNumberFormatTable& ChangeCL(short eType,
+ sal_uInt32& FIndex,
+ LanguageType eLnge);
+
+ /** Get table of formats of the same type as FIndex; eType and rLnge are
+ set accordingly. An unknown format is set to Standard/General */
+ SvNumberFormatTable& GetFirstEntryTable(short& eType,
+ sal_uInt32& FIndex,
+ LanguageType& rLnge);
+
+ /// Delete an entry including the format it is refering to
+ void DeleteEntry(sal_uInt32 nKey);
+
+ /** Create new entry of a format code string for language/country.
+ @return
+ <TRUE/> if string new and ok and inserted.
+ <FALSE/> if string already exists or an unresolvable parse error
+ occurred, in which case nCheckPos is the error position within rString.
+ If the error occurs at position 0 or rString is empty nCheckPos
+ will be 1, so an error in the string is always indicated by
+ nCheckPos not being zero.
+ The content of the rString variable can be changed and corrected
+ by the method.
+ nType contains the type of the format.
+ nKey contains the index key of the format.
+ */
+ bool PutEntry( OUString& rString, sal_Int32& nCheckPos, short& nType, sal_uInt32& nKey,
+ LanguageType eLnge = LANGUAGE_DONTKNOW );
+
+ /** Same as <method>PutEntry</method> but the format code string is
+ considered to be of language/country eLnge and is converted to
+ language/country eNewLnge */
+ bool PutandConvertEntry( OUString& rString, sal_Int32& nCheckPos,
+ short& nType, sal_uInt32& nKey,
+ LanguageType eLnge, LanguageType eNewLnge );
+
+ /** Same as <method>PutandConvertEntry</method> but the format code string
+ is considered to be of the System language/country eLnge and is
+ converted to another System language/country eNewLnge. In this case
+ the automatic currency is converted too. */
+ bool PutandConvertEntrySystem( OUString& rString, sal_Int32& nCheckPos,
+ short& nType, sal_uInt32& nKey,
+ LanguageType eLnge, LanguageType eNewLnge );
+
+ /** Similar to <method>PutEntry</method> and
+ <method>PutandConvertEntry</method> or
+ <method>PutandConvertEntrySystem</method>, the format code string
+ passed is considered to be of language/country eLnge. If
+ eLnge==LANGUAGE_SYSTEM the format code has to match eSysLnge, and if
+ eSysLnge is not the current application locale the format code is
+ converted to the current locale. Additionally, if the format code
+ represents an old "automatic" currency format, it is converted to the
+ new default currency format of the eLnge locale. The rString format
+ code passed as an argument may get adapted in case eLnge was used (or
+ is LANGUAGE_SYSTEM and eSysLnge is identical); in case it wasn't the
+ method works on a copy instead, otherwise the resulting string would
+ not match eSysLnge anymore.
+
+ <p> This method was introduced to handle the legacy currency formats of
+ the "autotbl.fmt" file used by Calc and Writer and convert them to
+ fixed currency codes of the actual currency. Note that in the case of
+ legacy currency formats no special attribution is converted, only the
+ default currency format of the locale is chosen, and that new fixed
+ currency codes are of course not converted to other currencies. The
+ method may also be used as a general method taking, converting and
+ inserting almost arbitrary format codes. To insert or use, for example,
+ the default currency format code matching the current locale, the
+ method could be called with<br/>
+
+ <code>
+ GetIndexPuttingAndConverting( "0 $", LANGUAGE_SYSTEM, LANGUAGE_ENGLISH_US, ...);
+ </code>
+
+ @return
+ The index key of the resulting number format. If the format code
+ was empty, could not be converted or has errors, the eLnge locale's
+ standard number format is chosen instead. The index key is
+ guaranteed to represent some valid number format. If
+ rNewInserted==false and rCheckPos>0 the format code has errors
+ and/or could not be converted.
+ */
+ sal_uInt32 GetIndexPuttingAndConverting( String & rString, LanguageType eLnge,
+ LanguageType eSysLnge, short & rType,
+ bool & rNewInserted,
+ xub_StrLen & rCheckPos );
+
+ sal_uInt32 GetIndexPuttingAndConverting( OUString & rString, LanguageType eLnge,
+ LanguageType eSysLnge, short & rType,
+ bool & rNewInserted, sal_Int32 & rCheckPos );
+
+ /** Create a format code string using format nIndex as a template and
+ applying other settings (passed from the dialog) */
+ OUString GenerateFormat(sal_uInt32 nIndex,
+ LanguageType eLnge = LANGUAGE_DONTKNOW,
+ bool bThousand = false, bool IsRed = false,
+ sal_uInt16 nPrecision = 0, sal_uInt16 nAnzLeading = 1);
+
+ /** Analyze an input string
+ @return
+ <TRUE/> if input is a number or is matching a format F_Index
+ F_Index is set to a matching format if number, the value is
+ returned in fOutNumber
+ <FALSE/> if input is not a number
+ */
+ bool IsNumberFormat( const OUString& sString, sal_uInt32& F_Index, double& fOutNumber );
+
+ /// Format a number according to a format index, return string and color
+ void GetOutputString( const double& fOutNumber, sal_uInt32 nFIndex,
+ String& sOutString, Color** ppColor, bool bUseStarFormat = false );
+
+ /// Format a number according to a format index, return string and color
+ void GetOutputString( const double& fOutNumber, sal_uInt32 nFIndex,
+ OUString& sOutString, Color** ppColor, bool bUseStarFormat = false );
+
+ /** Format a string according to a format index, return string and color.
+ Formats only if the format code is of type text or the 4th subcode
+ of a format code is specified, otherwise sOutString will be == "" */
+ void GetOutputString( const OUString& sString, sal_uInt32 nFIndex,
+ OUString& sOutString, Color** ppColor, bool bUseStarFormat = false );
+
+ /** Format a number according to the standard default format matching
+ the given format index */
+ void GetInputLineString( const double& fOutNumber,
+ sal_uInt32 nFIndex, String& sOutString );
+
+ void GetInputLineString( const double& fOutNumber,
+ sal_uInt32 nFIndex, OUString& rOutString );
+
+ /** Format a number according to a format code string to be scanned.
+ @return
+ <FALSE/> if format code contains an error
+ <TRUE/> else, in which case the string and color are returned.
+ */
+ bool GetPreviewString(const OUString& sFormatString,
+ double fPreviewNumber,
+ OUString& sOutString,
+ Color** ppColor,
+ LanguageType eLnge,
+ bool bUseStarFormat = false );
+
+ /** Same as <method>GetPreviewString</method> but the format code string
+ may be either language/country eLnge or en_US english US */
+ bool GetPreviewStringGuess( const OUString& sFormatString, double fPreviewNumber,
+ OUString& sOutString, Color** ppColor,
+ LanguageType eLnge = LANGUAGE_DONTKNOW );
+
+ /** Format a string according to a format code string to be scanned.
+ @return
+ <FALSE/> if format code contains an error
+ <TRUE/> else, in which case the string and color are returned.
+ */
+ bool GetPreviewString( const OUString& sFormatString, const OUString& sPreviewString,
+ OUString& sOutString, Color** ppColor,
+ LanguageType eLnge = LANGUAGE_DONTKNOW );
+
+ /** Test whether the format code string is already present in container
+ @return
+ NUMBERFORMAT_ENTRY_NOT_FOUND if not found, else the format index.
+ */
+ sal_uInt32 TestNewString( const OUString& sFormatString,
+ LanguageType eLnge = LANGUAGE_DONTKNOW );
+
+ /// Whether format index nFIndex is of type text or not
+ bool IsTextFormat(sal_uInt32 nFIndex) const;
+
+ /// Load all formats from a stream
+ bool Load( SvStream& rStream );
+ /// Save all formats to a stream
+ bool Save( SvStream& rStream ) const;
+
+ /// Get additional info of a format index, e.g. for dialog box
+ void GetFormatSpecialInfo(sal_uInt32 nFormat, bool& bThousand, bool& IsRed,
+ sal_uInt16& nPrecision, sal_uInt16& nAnzLeading);
+
+ /// Count of decimals
+ sal_uInt16 GetFormatPrecision( sal_uInt32 nFormat ) const;
+
+ /** Get additional info of a format code string, e.g. for dialog box.
+ Uses a temporary parse, if possible use only if format code is not
+ present in container yet, otherwise ineffective.
+ @return
+ 0 if format code string parsed without errors, otherwise error
+ position (like nCheckPos on <method>PutEntry</method>)
+ */
+ sal_uInt32 GetFormatSpecialInfo( const OUString&, bool& bThousand, bool& IsRed,
+ sal_uInt16& nPrecision, sal_uInt16& nAnzLeading,
+ LanguageType eLnge = LANGUAGE_DONTKNOW );
+
+ /// Check if format code string may be deleted by user
+ bool IsUserDefined( const OUString& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW );
+
+ /** Return the format index of the format code string for language/country,
+ or NUMBERFORMAT_ENTRY_NOT_FOUND */
+ sal_uInt32 GetEntryKey( const OUString& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW );
+
+ /// Return the format for a format index
+ const SvNumberformat* GetEntry( sal_uInt32 nKey ) const;
+
+ /// Return the format index of the standard default number format for language/country
+ sal_uInt32 GetStandardIndex(LanguageType eLnge = LANGUAGE_DONTKNOW);
+
+ /// Return the format index of the default format of a type for language/country
+ sal_uInt32 GetStandardFormat(short eType, LanguageType eLnge = LANGUAGE_DONTKNOW);
+
+ /** Return the format index of the default format of a type for language/country.
+ Maybe not the default format but a special builtin format, e.g. for
+ NF_TIME_HH_MMSS00, if that format is passed in nFIndex. */
+ sal_uInt32 GetStandardFormat( sal_uInt32 nFIndex, short eType, LanguageType eLnge );
+
+ /** Return the format index of the default format of a type for language/country.
+ Maybe not the default format but a special builtin format, e.g. for
+ NF_TIME_HH_MMSS00, or NF_TIME_HH_MMSS if fNumber >= 1.0 */
+ sal_uInt32 GetStandardFormat( double fNumber, sal_uInt32 nFIndex, short eType,
+ LanguageType eLnge );
+
+ /// Whether nFIndex is a special builtin format
+ bool IsSpecialStandardFormat( sal_uInt32 nFIndex, LanguageType eLnge );
+
+ /** Return the corresponding edit format of a format. */
+ sal_uInt32 GetEditFormat( double fNumber, sal_uInt32 nFIndex, short eType,
+ LanguageType eLnge, SvNumberformat* pFormat );
+
+ /// Return the reference date
+ Date* GetNullDate();
+ /// Return the standard decimal precision
+ sal_uInt16 GetStandardPrec();
+ /// Return whether zero suppression is switched on
+ bool GetNoZero() { return bNoZero; }
+ /** Get the type of a format (or NUMBERFORMAT_UNDEFINED if no entry),
+ but with NUMBERFORMAT_DEFINED masked out */
+ short GetType(sal_uInt32 nFIndex);
+
+ /// As the name says
+ void ClearMergeTable();
+ /// Merge in all new entries from rNewTable and return a table of resulting new format indices
+ SvNumberFormatterIndexTable* MergeFormatter(SvNumberFormatter& rNewTable);
+
+ /// Whether a merge table is present or not
+ inline bool HasMergeFmtTbl() const;
+ /// Return the new format index for an old format index, if a merge table exists
+ inline sal_uInt32 GetMergeFmtIndex( sal_uInt32 nOldFmt ) const;
+
+ /** Convert the ugly old tools' Table type bloated with new'ed sal_uInt32
+ entries merge table to ::std::map with old index key and new index key.
+ @ATTENTION! Also clears the old table using ClearMergeTable() */
+ SvNumberFormatterMergeMap ConvertMergeTableToMap();
+
+ /// Return the last used position ever of a language/country combination
+ sal_uInt16 GetLastInsertKey(sal_uInt32 CLOffset);
+
+ /** Return the format index of a builtin format for a specific language/country.
+ If nFormat is not a builtin format nFormat is returned. */
+ sal_uInt32 GetFormatForLanguageIfBuiltIn( sal_uInt32 nFormat,
+ LanguageType eLnge = LANGUAGE_DONTKNOW );
+
+ /** Return the format index for a builtin format of a specific language
+ @see NfIndexTableOffset
+ */
+ sal_uInt32 GetFormatIndex( NfIndexTableOffset, LanguageType eLnge = LANGUAGE_DONTKNOW );
+
+ /** Return enum index of a format index of a builtin format,
+ NF_INDEX_TABLE_ENTRIES if it's not a builtin format.
+ @see NfIndexTableOffset
+ */
+ NfIndexTableOffset GetIndexTableOffset( sal_uInt32 nFormat ) const;
+
+ /** Set evaluation type and order of input date strings
+ @see NfEvalDateFormat
+ */
+ void SetEvalDateFormat( NfEvalDateFormat eEDF ) { eEvalDateFormat = eEDF; }
+ NfEvalDateFormat GetEvalDateFormat() const { return eEvalDateFormat; }
+
+ /** Set TwoDigitYearStart, how the input string scanner handles a two digit year.
+ Default from VCL: 1930, 30-99 19xx, 00-29 20xx
+
+ <p> Historically (prior to src513e) it was a two digit number determing
+ until which number the string scanner recognizes a year to be 20xx,
+ default <= 29 is used by SFX/OfaMiscCfg.
+ The name Year2000 is kept although the actual functionality is now a
+ TwoDigitYearStart which might be in any century.
+ */
+ void SetYear2000( sal_uInt16 nVal );
+ sal_uInt16 GetYear2000() const;
+ static sal_uInt16 GetYear2000Default();
+
+ sal_uInt16 ExpandTwoDigitYear( sal_uInt16 nYear ) const;
+ inline static sal_uInt16 ExpandTwoDigitYear( sal_uInt16 nYear, sal_uInt16 nTwoDigitYearStart );
+
+ /// DEPRICATED: Return first character of the decimal separator of the current language/country
+ sal_Unicode GetDecSep() const { return GetNumDecimalSep()[0]; }
+ /// Return the decimal separator of the current language/country
+ OUString GetDecimalSep() const { return GetNumDecimalSep(); }
+
+ /// Return the decimal separator matching the locale of the given format
+ OUString GetFormatDecimalSep( sal_uInt32 nFormat ) const;
+
+ /// Return a <type>NfCurrencyTable</type> with pointers to <type>NfCurrencyEntry</type> entries
+ static const NfCurrencyTable& GetTheCurrencyTable();
+
+ /** Searches, according to the default locale currency, an entry of the
+ CurrencyTable which is <bold>not</bold> the first (LANGUAGE_SYSTEM) entry.
+ @return
+ <NULL/> if not found
+ else pointer to <type>NfCurrencyEntry</type>
+ */
+ static const NfCurrencyEntry* MatchSystemCurrency();
+
+ /** Return a <type>NfCurrencyEntry</type> matching a language/country.
+ If language/country is LANGUAGE_SYSTEM a <method>MatchSystemCurrency</method>
+ call is tried to get an entry. If that fails or the corresponding
+ language/country is not present the entry for LANGUAGE_SYSTEM is returned.
+ */
+ static const NfCurrencyEntry& GetCurrencyEntry( LanguageType );
+
+ /** Return a <type>NfCurrencyEntry</type> pointer matching a language/country
+ and currency abbreviation (AKA banking symbol).
+ This method is meant for the configuration of the default currency.
+ @return
+ <NULL/> if not found
+ else pointer to <type>NfCurrencyEntry</type>
+ */
+ static const NfCurrencyEntry* GetCurrencyEntry( const OUString& rAbbrev,
+ LanguageType eLang );
+
+ /** Return a <type>NfCurrencyEntry</type> pointer matching the symbol
+ combination of a LegacyOnly currency. Note that this means only that
+ the currency matching both symbols was once used in the Office, but is
+ not offered in dialogs anymore. It doesn't even mean that the currency
+ symbol combination is valid, since the reason for removing it may have
+ been just that. #i61657#
+ @return
+ A matching entry, or else <NULL/>.
+ */
+ static const NfCurrencyEntry* GetLegacyOnlyCurrencyEntry( const OUString& rSymbol, const OUString& rAbbrev );
+
+ /** Set the default system currency. The combination of abbreviation and
+ language must match an existent element of theCurrencyTable. If not,
+ the SYSTEM (current locale) entry becomes the default.
+ This method is meant for the configuration of the default currency.
+ */
+ static void SetDefaultSystemCurrency( const OUString& rAbbrev, LanguageType eLang );
+
+ /** Get all standard formats for a specific currency, formats are
+ appended to the <type>NfWSStringsDtor</type> list.
+ @param bBank
+ <TRUE/>: generate only format strings with currency abbreviation
+ <FALSE/>: mixed format strings
+ @return
+ position of default format
+ */
+ sal_uInt16 GetCurrencyFormatStrings( NfWSStringsDtor&, const NfCurrencyEntry&,
+ bool bBank ) const;
+
+ /** Whether nFormat is of type NUMBERFORMAT_CURRENCY and the format code
+ contains a new SYMBOLTYPE_CURRENCY and if so which one [$xxx-nnn].
+ If ppEntry is not NULL and exactly one entry is found, a [$xxx-nnn] is
+ returned, even if the format code only contains [$xxx] !
+ */
+ bool GetNewCurrencySymbolString( sal_uInt32 nFormat, String& rSymbol,
+ const NfCurrencyEntry** ppEntry = NULL,
+ bool* pBank = NULL ) const;
+
+ /** Look up the corresponding <type>NfCurrencyEntry</type> matching
+ rSymbol (may be CurrencySymbol or CurrencyAbbreviation) and possibly
+ a rExtension (being yyy of [$xxx-yyy]) or a given language/country
+ value. Tries to match a rSymbol with rExtension first, then with
+ eFormatLanguage, then rSymbol only. This is because a currency entry
+ might have been constructed using I18N locale data where a used locale
+ of a currrency format code must not necessarily match the locale of
+ the locale data itself, e.g. [$HK$-40C] (being "zh_HK" locale) in
+ zh_CN locale data. Here the rExtension would have the value 0x40c but
+ eFormatLanguage of the number format would have the value of zh_CN
+ locale, the value with which the corresponding CurrencyEntry is
+ constructed.
+
+ @param bFoundBank
+ Only used for output.
+ If the return value is not <NULL/> this value is set to <TRUE/> if
+ the matching entry was found by comparing rSymbol against the
+ CurrencyAbbreviation (AKA BankSymbol).
+ If the return value is <NULL/> the value of bFoundBank is undefined.
+ @param rSymbol
+ Currency symbol, preferably obtained of a format by a call to
+ <method>SvNumberformat::GetNewCurrencySymbol()</method>
+ @param rExtension
+ Currency extension, preferably obtained of a format by a call to
+ <method>SvNumberformat::GetNewCurrencySymbol()</method>
+ @param eFormatLanguage
+ The language/country value of the format of which rSymbol and
+ rExtension are obtained (<method>SvNumberformat::GetLanguage()</method>).
+ @param bOnlyStringLanguage
+ If <TRUE/> only entries with language/country of rExtension are
+ checked, no match on eFormatLanguage. If rExtension is empty all
+ entries are checked.
+ @return
+ The matching entry if unique (in which case bFoundBank is set),
+ else <NULL/>.
+ */
+ static const NfCurrencyEntry* GetCurrencyEntry( bool & bFoundBank,
+ const OUString& rSymbol,
+ const OUString& rExtension,
+ LanguageType eFormatLanguage,
+ bool bOnlyStringLanguage = false );
+
+ /// Get compatibility ("automatic" old style) currency from I18N locale data
+ void GetCompatibilityCurrency( OUString& rSymbol, OUString& rAbbrev ) const;
+
+ /// Fill rList with the language/country codes that have been allocated
+ void GetUsedLanguages( std::vector<sal_uInt16>& rList );
+
+ /// Fill a <type>NfKeywordIndex</type> table with keywords of a language/country
+ void FillKeywordTable( NfKeywordTable& rKeywords, LanguageType eLang );
+
+ /** Return a keyword for a language/country and <type>NfKeywordIndex</type>
+ for XML import, to generate number format strings. */
+ OUString GetKeyword( LanguageType eLnge, sal_uInt16 nIndex );
+
+ /** Return the GENERAL keyword in proper case ("General") for a
+ language/country, used in XML import */
+ OUString GetStandardName( LanguageType eLnge );
+
+ /** Check if a specific locale has supported locale data. */
+ static bool IsLocaleInstalled( LanguageType eLang );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ LanguageTag maLanguageTag;
+ SvNumberFormatTable aFTable; // Table of format keys to format entries
+ typedef std::map<sal_uInt32, sal_uInt32> DefaultFormatKeysMap;
+ DefaultFormatKeysMap aDefaultFormatKeys; // Table of default standard to format keys
+ SvNumberFormatTable* pFormatTable; // For the UI dialog
+ SvNumberFormatterIndexTable* pMergeTable; // List of indices for merging two formatters
+ CharClass* pCharClass; // CharacterClassification
+ OnDemandLocaleDataWrapper xLocaleData; // LocaleData switched between SYSTEM, ENGLISH and other
+ OnDemandTransliterationWrapper xTransliteration; // Transliteration loaded on demand
+ OnDemandCalendarWrapper xCalendar; // Calendar loaded on demand
+ OnDemandNativeNumberWrapper xNatNum; // Native number service loaded on demand
+ ImpSvNumberInputScan* pStringScanner; // Input string scanner
+ ImpSvNumberformatScan* pFormatScanner; // Format code string scanner
+ Link aColorLink; // User defined color table CallBack
+ sal_uInt32 MaxCLOffset; // Max language/country offset used
+ sal_uInt32 nDefaultSystemCurrencyFormat; // NewCurrency matching SYSTEM locale
+ LanguageType IniLnge; // Initialized setting language/country
+ LanguageType ActLnge; // Current setting language/country
+ NfEvalDateFormat eEvalDateFormat; // DateFormat evaluation
+ bool bNoZero; // Zero value suppression
+
+ // cached locale data items needed almost any time
+ OUString aDecimalSep;
+ OUString aThousandSep;
+ OUString aDateSep;
+
+#ifdef _ZFORLIST_CXX // ----- private Methoden -----
+
+ SVL_DLLPRIVATE static bool bCurrencyTableInitialized;
+ SVL_DLLPRIVATE static sal_uInt16 nSystemCurrencyPosition;
+ SVL_DLLPRIVATE static SvNumberFormatterRegistry_Impl* pFormatterRegistry;
+
+ // get the registry, create one if none exists
+ SVL_DLLPRIVATE static SvNumberFormatterRegistry_Impl& GetFormatterRegistry();
+
+ // called by ctors
+ SVL_DLLPRIVATE void ImpConstruct( LanguageType eLang );
+
+ // Changes initialized language/country, clears the entries and generates
+ // new ones, may ONLY be called by the binary file format load
+ SVL_DLLPRIVATE void ImpChangeSysCL( LanguageType eLnge, bool bNoAdditionalFormats );
+
+ // Generate builtin formats provided by i18n behind CLOffset,
+ // if bNoAdditionalFormats==false also generate additional i18n formats.
+ SVL_DLLPRIVATE void ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditionalFormats );
+
+ // Generate additional formats provided by i18n
+ SVL_DLLPRIVATE void ImpGenerateAdditionalFormats( sal_uInt32 CLOffset,
+ NumberFormatCodeWrapper& rNumberFormatCode,
+ bool bAfterChangingSystemCL );
+
+ SVL_DLLPRIVATE SvNumberformat* ImpInsertFormat( const ::com::sun::star::i18n::NumberFormatCode& rCode,
+ sal_uInt32 nPos,
+ bool bAfterChangingSystemCL = false,
+ sal_Int16 nOrgIndex = 0 );
+ // ImpInsertNewStandardFormat for new (since version ...) builtin formats
+ SVL_DLLPRIVATE SvNumberformat* ImpInsertNewStandardFormat( const ::com::sun::star::i18n::NumberFormatCode& rCode,
+ sal_uInt32 nPos,
+ sal_uInt16 nVersion,
+ bool bAfterChangingSystemCL = false,
+ sal_Int16 nOrgIndex = 0 );
+
+ // Return CLOffset or (MaxCLOffset + SV_COUNTRY_LANGUAGE_OFFSET) if new language/country
+ SVL_DLLPRIVATE sal_uInt32 ImpGetCLOffset(LanguageType eLnge) const;
+
+ // Test whether format code already exists, then return index key,
+ // otherwise NUMBERFORMAT_ENTRY_NOT_FOUND
+ SVL_DLLPRIVATE sal_uInt32 ImpIsEntry( const OUString& rString,
+ sal_uInt32 CLOffset,
+ LanguageType eLnge );
+
+ // Create builtin formats for language/country if necessary, return CLOffset
+ SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL( LanguageType eLnge, bool bNoAdditionalFormats = false );
+
+ // Build negative currency format, old compatibility style
+ SVL_DLLPRIVATE void ImpGetNegCurrFormat(OUStringBuffer& sNegStr, const OUString& rCurrSymbol);
+ // Build positive currency format, old compatibility style
+ SVL_DLLPRIVATE void ImpGetPosCurrFormat(OUStringBuffer& sPosStr, const OUString& rCurrSymbol);
+
+ // Create <type>theCurrencyTable</type> with all <type>NfCurrencyEntry</type>
+ SVL_DLLPRIVATE static void ImpInitCurrencyTable();
+
+ // Return the format index of the currency format of the system locale.
+ // Format is created if not already present.
+ SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultSystemCurrencyFormat();
+
+ // Return the format index of the currency format of the current locale.
+ // Format is created if not already present.
+ SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultCurrencyFormat();
+
+ // Return the default format for a given type and current locale.
+ // May ONLY be called from within GetStandardFormat().
+ SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultFormat( short nType );
+
+ // Return the index in a sequence of format codes matching an enum of
+ // NfIndexTableOffset. If not found 0 is returned. If the sequence doesn't
+ // contain any format code elements a default element is created and inserted.
+ SVL_DLLPRIVATE sal_Int32 ImpGetFormatCodeIndex( ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::NumberFormatCode >& rSeq,
+ const NfIndexTableOffset nTabOff );
+
+ // Adjust a sequence of format codes to contain only one (THE) default
+ // instead of multiple defaults for short/medium/long types.
+ // If there is no medium but a short and a long default the long is taken.
+ // Return the default index in the sequence.
+ // Non-PRODUCT version may check locale data for matching defaults in one
+ // FormatElement group.
+ SVL_DLLPRIVATE sal_Int32 ImpAdjustFormatCodeDefault( ::com::sun::star::i18n::NumberFormatCode * pFormatArr,
+ sal_Int32 nCount, bool bCheckCorrectness = true );
+
+ // Obtain the format entry for a given key index.
+ SVL_DLLPRIVATE SvNumberformat* GetFormatEntry( sal_uInt32 nKey );
+ SVL_DLLPRIVATE const SvNumberformat* GetFormatEntry( sal_uInt32 nKey ) const
+ {
+ return GetEntry( nKey);
+ }
+
+ // used as a loop body inside of GetNewCurrencySymbolString() and GetCurrencyEntry()
+#ifndef DBG_UTIL
+ inline
+#endif
+ static bool ImpLookupCurrencyEntryLoopBody( const NfCurrencyEntry*& pFoundEntry,
+ bool& bFoundBank, const NfCurrencyEntry* pData,
+ sal_uInt16 nPos, const OUString& rSymbol );
+
+ // link to be set at <method>SvtSysLocaleOptions::SetCurrencyChangeLink()</method>
+ DECL_DLLPRIVATE_STATIC_LINK( SvNumberFormatter, CurrencyChangeLink, void* );
+
+#endif // _ZFORLIST_CXX
+
+public:
+
+ // own static mutex, may also be used by internal class SvNumberFormatterRegistry_Impl
+ static ::osl::Mutex& GetMutex();
+
+ // called by SvNumberFormatterRegistry_Impl::Notify if the default system currency changes
+ void ResetDefaultSystemCurrency();
+
+ // Called by SvNumberFormatterRegistry_Impl::Notify if the system locale's
+ // date acceptence patterns change.
+ void InvalidateDateAcceptancePatterns();
+
+ // Replace the SYSTEM language/country format codes. Called upon change of
+ // the user configurable locale.
+ // Old compatibility codes are replaced, user defined are converted, and
+ // new format codes are appended.
+ void ReplaceSystemCL( LanguageType eOldLanguage );
+
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > GetComponentContext() const
+ {
+ return m_xContext;
+ }
+
+
+
+ //! The following method is not to be used from outside but must be
+ //! public for the InputScanner.
+ // return the current FormatScanner
+ inline const ImpSvNumberformatScan* GetFormatScanner() const { return pFormatScanner; }
+
+
+ //! The following methods are not to be used from outside but must be
+ //! public for the InputScanner and FormatScanner.
+
+ // return current (!) Locale
+ inline const LanguageTag& GetLanguageTag() const { return maLanguageTag; }
+
+ // return corresponding Transliteration wrapper
+ inline const ::utl::TransliterationWrapper* GetTransliteration() const
+ {
+ return xTransliteration.get();
+ }
+
+ // return corresponding Transliteration wrapper with loadModuleByImplName()
+ inline const ::utl::TransliterationWrapper* GetTransliterationForModule( const OUString& rModule,
+ LanguageType eLang ) const
+ {
+ return xTransliteration.getForModule( rModule, eLang );
+ }
+
+ // return the corresponding CharacterClassification wrapper
+ inline const CharClass* GetCharClass() const { return pCharClass; }
+
+ // return the corresponding LocaleData wrapper
+ inline const LocaleDataWrapper* GetLocaleData() const { return xLocaleData.get(); }
+
+ // return the corresponding Calendar wrapper
+ inline CalendarWrapper* GetCalendar() const { return xCalendar.get(); }
+
+ // return the corresponding NativeNumberSupplier wrapper
+ inline const NativeNumberWrapper* GetNatNum() const { return xNatNum.get(); }
+
+ // cached locale data items
+
+ // return the corresponding decimal separator
+ inline const OUString& GetNumDecimalSep() const { return aDecimalSep; }
+
+ // return the corresponding group (AKA thousand) separator
+ inline const OUString& GetNumThousandSep() const { return aThousandSep; }
+
+ // return the corresponding date separator
+ inline const OUString& GetDateSep() const { return aDateSep; }
+
+};
+
+
+// --------------------------- inline --------------------------------------
+
+inline sal_uInt32 SvNumberFormatter::GetMergeFmtIndex( sal_uInt32 nOldFmt ) const
+{
+ if (pMergeTable)
+ {
+ SvNumberFormatterIndexTable::iterator it = pMergeTable->find(nOldFmt);
+ if (it != pMergeTable->end())
+ {
+ return it->second;
+ }
+ }
+ return nOldFmt;
+}
+
+inline bool SvNumberFormatter::HasMergeFmtTbl() const
+{
+ return pMergeTable && !pMergeTable->empty();
+}
+
+
+// static
+inline sal_uInt16 SvNumberFormatter::ExpandTwoDigitYear( sal_uInt16 nYear, sal_uInt16 nTwoDigitYearStart )
+{
+ if ( nYear < 100 )
+ {
+ if ( nYear < (nTwoDigitYearStart % 100) )
+ {
+ return nYear + (((nTwoDigitYearStart / 100) + 1) * 100);
+ }
+ else
+ {
+ return nYear + ((nTwoDigitYearStart / 100) * 100);
+ }
+ }
+ return nYear;
+}
+
+#endif // _ZFORLIST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
new file mode 100644
index 000000000000..20cc4d110c24
--- /dev/null
+++ b/include/svl/zformat.hxx
@@ -0,0 +1,712 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _ZFORMAT_HXX
+#define _ZFORMAT_HXX
+
+#include "svl/svldllapi.h"
+#include <i18nlangtag/mslangid.hxx>
+#include <svl/zforlist.hxx>
+#include <svl/nfversi.hxx>
+#include <svl/nfkeytab.hxx>
+
+// We need ImpSvNumberformatScan for the private SvNumberformat definitions.
+#ifdef _ZFORMAT_CXX
+#include "zforscan.hxx"
+#endif
+
+namespace utl {
+ class DigitGroupingIterator;
+}
+
+class SvStream;
+class Color;
+
+class ImpSvNumberformatScan; // format code string scanner
+class ImpSvNumberInputScan; // input string scanner
+class ImpSvNumMultipleWriteHeader; // compatible file format
+class ImpSvNumMultipleReadHeader; // compatible file format
+class SvNumberFormatter;
+
+enum SvNumberformatLimitOps
+{
+ NUMBERFORMAT_OP_NO = 0, // Undefined, no OP
+ NUMBERFORMAT_OP_EQ = 1, // Operator =
+ NUMBERFORMAT_OP_NE = 2, // Operator <>
+ NUMBERFORMAT_OP_LT = 3, // Operator <
+ NUMBERFORMAT_OP_LE = 4, // Operator <=
+ NUMBERFORMAT_OP_GT = 5, // Operator >
+ NUMBERFORMAT_OP_GE = 6 // Operator >=
+};
+
+// SYSTEM-german to SYSTEM-xxx and vice versa conversion hack onLoad
+enum NfHackConversion
+{
+ NF_CONVERT_NONE,
+ NF_CONVERT_GERMAN_ENGLISH,
+ NF_CONVERT_ENGLISH_GERMAN
+};
+
+struct ImpSvNumberformatInfo // Struct for FormatInfo
+{
+ OUString* sStrArray; // Array of symbols
+ short* nTypeArray; // Array of infos
+ sal_uInt16 nThousand; // Count of group separator sequences
+ sal_uInt16 nCntPre; // Count of digits before decimal point
+ sal_uInt16 nCntPost; // Count of digits after decimal point
+ sal_uInt16 nCntExp; // Count of exponent digits, or AM/PM
+ short eScannedType; // Type determined by scan
+ bool bThousand; // Has group (AKA thousand) separator
+
+ void Copy( const ImpSvNumberformatInfo& rNumFor, sal_uInt16 nAnz );
+ void Load(SvStream& rStream, sal_uInt16 nAnz);
+ void Save(SvStream& rStream, sal_uInt16 nAnz) const;
+};
+
+// NativeNumber, represent numbers using CJK or other digits if nNum>0,
+// eLang specifies the Locale to use.
+class SvNumberNatNum
+{
+ LanguageType eLang;
+ sal_uInt8 nNum;
+ bool bDBNum :1; // DBNum, to be converted to NatNum
+ bool bDate :1; // Used in date? (needed for DBNum/NatNum mapping)
+ bool bSet :1; // If set, since NatNum0 is possible
+
+public:
+
+ static sal_uInt8 MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang, bool bDate );
+#ifdef THE_FUTURE
+ static sal_uInt8 MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLang, bool bDate );
+#endif
+
+ SvNumberNatNum() : eLang( LANGUAGE_DONTKNOW ), nNum(0),
+ bDBNum(0), bDate(0), bSet(0) {}
+ bool IsComplete() const { return bSet && eLang != LANGUAGE_DONTKNOW; }
+ sal_uInt8 GetRawNum() const { return nNum; }
+ sal_uInt8 GetNatNum() const { return bDBNum ? MapDBNumToNatNum( nNum, eLang, bDate ) : nNum; }
+#ifdef THE_FUTURE
+ sal_uInt8 GetDBNum() const { return bDBNum ? nNum : MapNatNumToDBNum( nNum, eLang, bDate ); }
+#endif
+ LanguageType GetLang() const { return eLang; }
+ void SetLang( LanguageType e ) { eLang = e; }
+ void SetNum( sal_uInt8 nNumber, bool bDBNumber )
+ {
+ nNum = nNumber;
+ bDBNum = bDBNumber;
+ bSet = true;
+ }
+ bool IsSet() const { return bSet; }
+ void SetDate( bool bDateP ) { bDate = (bDateP != 0); }
+};
+
+class CharClass;
+
+class ImpSvNumFor // One of four subformats of the format code string
+{
+public:
+ ImpSvNumFor(); // Ctor without filling the Info
+ ~ImpSvNumFor();
+
+ void Enlarge(sal_uInt16 nAnz); // Init of arrays to the right size
+ void Load( SvStream& rStream, ImpSvNumberformatScan& rSc,
+ OUString& rLoadedColorName);
+ void Save( SvStream& rStream ) const;
+
+ // if pSc is set, it is used to get the Color pointer
+ void Copy( const ImpSvNumFor& rNumFor, ImpSvNumberformatScan* pSc );
+
+ // Access to Info; call Enlarge before!
+ ImpSvNumberformatInfo& Info() { return aI;}
+ const ImpSvNumberformatInfo& Info() const { return aI; }
+
+ // Get count of substrings (symbols)
+ sal_uInt16 GetCount() const { return nAnzStrings;}
+
+ Color* GetColor() const { return pColor; }
+ void SetColor( Color* pCol, OUString& rName )
+ { pColor = pCol; sColorName = rName; }
+ const OUString& GetColorName() const { return sColorName; }
+
+ // new SYMBOLTYPE_CURRENCY in subformat?
+ bool HasNewCurrency() const;
+ bool GetNewCurrencySymbol( OUString& rSymbol, OUString& rExtension ) const;
+ void SaveNewCurrencyMap( SvStream& rStream ) const;
+ void LoadNewCurrencyMap( SvStream& rStream );
+
+ // [NatNum1], [NatNum2], ...
+ void SetNatNumNum( sal_uInt8 nNum, bool bDBNum ) { aNatNum.SetNum( nNum, bDBNum ); }
+ void SetNatNumLang( LanguageType eLang ) { aNatNum.SetLang( eLang ); }
+ void SetNatNumDate( bool bDate ) { aNatNum.SetDate( bDate ); }
+ const SvNumberNatNum& GetNatNum() const { return aNatNum; }
+
+private:
+ ImpSvNumberformatInfo aI; // Hilfsstruct fuer die restlichen Infos
+ OUString sColorName; // color name
+ Color* pColor; // pointer to color of subformat
+ sal_uInt16 nAnzStrings; // count of symbols
+ SvNumberNatNum aNatNum; // DoubleByteNumber
+
+};
+
+class SVL_DLLPUBLIC SvNumberformat
+{
+ struct LocaleType
+ {
+ sal_uInt8 mnNumeralShape;
+ sal_uInt8 mnCalendarType;
+ LanguageType meLanguage;
+
+ OUString generateCode() const;
+
+ LocaleType();
+ LocaleType(sal_uInt32 nRawCode);
+ };
+
+public:
+ // Ctor for Load
+ SvNumberformat( ImpSvNumberformatScan& rSc, LanguageType eLge );
+
+ // Normal ctor
+ SvNumberformat( OUString& rString,
+ ImpSvNumberformatScan* pSc,
+ ImpSvNumberInputScan* pISc,
+ sal_Int32& nCheckPos,
+ LanguageType& eLan,
+ bool bStand = false );
+
+ // Copy ctor
+ SvNumberformat( SvNumberformat& rFormat );
+
+ // Copy ctor with exchange of format code string scanner (used in merge)
+ SvNumberformat( SvNumberformat& rFormat, ImpSvNumberformatScan& rSc );
+
+ ~SvNumberformat();
+
+ /// Get type of format, may include NUMBERFORMAT_DEFINED bit
+ short GetType() const
+ { return (nNewStandardDefined &&
+ (nNewStandardDefined <= SV_NUMBERFORMATTER_VERSION)) ?
+ (eType & ~NUMBERFORMAT_DEFINED) : eType; }
+
+ void SetType(const short eSetType) { eType = eSetType; }
+ // Standard means the I18N defined standard format of this type
+ void SetStandard() { bStandard = true; }
+ bool IsStandard() const { return bStandard; }
+
+ // For versions before version nVer it is UserDefined, for newer versions
+ // it is builtin. nVer of SV_NUMBERFORMATTER_VERSION_...
+ void SetNewStandardDefined( sal_uInt16 nVer )
+ { nNewStandardDefined = nVer; eType |= NUMBERFORMAT_DEFINED; }
+
+ sal_uInt16 GetNewStandardDefined() const { return nNewStandardDefined; }
+ bool IsAdditionalStandardDefined() const
+ { return nNewStandardDefined == SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS; }
+
+ LanguageType GetLanguage() const { return maLocale.meLanguage;}
+
+ const OUString& GetFormatstring() const { return sFormatstring; }
+
+ // Build a format string of application defined keywords
+ OUString GetMappedFormatstring( const NfKeywordTable& rKeywords,
+ const LocaleDataWrapper& rLoc,
+ bool bDontQuote = false ) const;
+
+ void SetUsed(const bool b) { bIsUsed = b; }
+ bool GetUsed() const { return bIsUsed; }
+ bool IsStarFormatSupported() const { return bStarFlag; }
+ void SetStarFormatSupport( bool b ) { bStarFlag = b; }
+
+ NfHackConversion Load( SvStream& rStream, ImpSvNumMultipleReadHeader& rHdr,
+ SvNumberFormatter* pConverter, ImpSvNumberInputScan& rISc );
+ void Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr ) const;
+
+ // Load a string which might contain an Euro symbol,
+ // in fact that could be any string used in number formats.
+ static OUString LoadString( SvStream& rStream );
+
+ /**
+ * Get output string from a numeric value that fits the number of
+ * characters specified.
+ */
+ bool GetOutputString( double fNumber, sal_uInt16 nCharCount, OUString& rOutString ) const;
+
+ bool GetOutputString( double fNumber, OUString& OutString, Color** ppColor );
+ bool GetOutputString( const OUString& sString, OUString& OutString, Color** ppColor );
+
+ // True if type text
+ bool IsTextFormat() const { return (eType & NUMBERFORMAT_TEXT) != 0; }
+ // True if 4th subformat present
+ bool HasTextFormat() const
+ {
+ return (NumFor[3].GetCount() > 0) ||
+ (NumFor[3].Info().eScannedType == NUMBERFORMAT_TEXT);
+ }
+
+ void GetFormatSpecialInfo(bool& bThousand,
+ bool& IsRed,
+ sal_uInt16& nPrecision,
+ sal_uInt16& nAnzLeading) const;
+
+ /// Count of decimal precision
+ sal_uInt16 GetFormatPrecision() const { return NumFor[0].Info().nCntPost; }
+
+ //! Read/write access on a special sal_uInt16 component, may only be used on the
+ //! standard format 0, 5000, ... and only by the number formatter!
+ sal_uInt16 GetLastInsertKey() const
+ { return NumFor[0].Info().nThousand; }
+ void SetLastInsertKey(sal_uInt16 nKey)
+ { NumFor[0].Info().nThousand = nKey; }
+
+ //! Only onLoad: convert from stored to current system language/country
+ void ConvertLanguage( SvNumberFormatter& rConverter,
+ LanguageType eConvertFrom, LanguageType eConvertTo, bool bSystem = false );
+
+ // Substring of a subformat code nNumFor (0..3)
+ // nPos == 0xFFFF => last substring
+ // bString==true: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY
+ const OUString* GetNumForString( sal_uInt16 nNumFor, sal_uInt16 nPos,
+ bool bString = false ) const;
+
+ // Subtype of a subformat code nNumFor (0..3)
+ // nPos == 0xFFFF => last substring
+ // bString==true: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY
+ short GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, bool bString = false ) const;
+
+ sal_Int32 GetForcedDenominatorForType( sal_uInt16 nNumFor ) const;
+ /** If the count of string elements (substrings, ignoring [modifiers] and
+ so on) in a subformat code nNumFor (0..3) is equal to the given number.
+ Used by ImpSvNumberInputScan::IsNumberFormatMain() to detect a matched
+ format. */
+ bool IsNumForStringElementCountEqual( sal_uInt16 nNumFor, sal_uInt16 nAllCount,
+ sal_uInt16 nNumCount ) const
+ {
+ if ( nNumFor < 4 )
+ {
+ // First try a simple approach. Note that this is called only
+ // if all MidStrings did match so far, to verify that all
+ // strings of the format were matched and not just the starting
+ // sequence, so we don't have to check if GetnAnz() includes
+ // [modifiers] or anything else if both counts are equal.
+ sal_uInt16 nCnt = NumFor[nNumFor].GetCount();
+ if ( nAllCount == nCnt )
+ return true;
+ if ( nAllCount < nCnt ) // check ignoring [modifiers] and so on
+ return ImpGetNumForStringElementCount( nNumFor ) ==
+ (nAllCount - nNumCount);
+ }
+ return false;
+ }
+
+ // Whether the second subformat code is really for negative numbers
+ // or another limit set.
+ bool IsSecondSubformatRealNegative() const
+ {
+ return fLimit1 == 0.0 && fLimit2 == 0.0 &&
+ ( (eOp1 == NUMBERFORMAT_OP_GE && eOp2 == NUMBERFORMAT_OP_NO) ||
+ (eOp1 == NUMBERFORMAT_OP_GT && eOp2 == NUMBERFORMAT_OP_LT) ||
+ (eOp1 == NUMBERFORMAT_OP_NO && eOp2 == NUMBERFORMAT_OP_NO) );
+ }
+
+ // Whether the first subformat code is really for negative numbers
+ // or another limit set.
+ bool IsFirstSubformatRealNegative() const
+ {
+ return fLimit1 == 0.0 && fLimit2 == 0.0 &&
+ ((eOp1 == NUMBERFORMAT_OP_LT &&
+ (eOp2 == NUMBERFORMAT_OP_GT || eOp2 == NUMBERFORMAT_OP_EQ ||
+ eOp2 == NUMBERFORMAT_OP_GE || eOp2 == NUMBERFORMAT_OP_NO)) ||
+ (eOp1 == NUMBERFORMAT_OP_LE &&
+ (eOp2 == NUMBERFORMAT_OP_NO || eOp2 == NUMBERFORMAT_OP_GT)));
+ }
+
+ // Whether the negative format is without a sign or not
+ bool IsNegativeWithoutSign() const;
+
+ bool IsNegativeInBracket() const;
+
+ bool HasPositiveBracketPlaceholder() const;
+
+ // Whether a new SYMBOLTYPE_CURRENCY is contained in the format
+ bool HasNewCurrency() const;
+
+ // Build string from NewCurrency for saving it SO50 compatible
+ void Build50Formatstring( OUString& rStr ) const;
+
+ // strip [$-yyy] from all [$xxx-yyy] leaving only xxx's,
+ // if bQuoteSymbol==true the xxx will become "xxx"
+ static OUString StripNewCurrencyDelimiters( const OUString& rStr,
+ bool bQuoteSymbol );
+
+ // If a new SYMBOLTYPE_CURRENCY is contained if the format is of type
+ // NUMBERFORMAT_CURRENCY, and if so the symbol xxx and the extension nnn
+ // of [$xxx-nnn] are returned
+ bool GetNewCurrencySymbol( OUString& rSymbol, OUString& rExtension ) const;
+
+ static bool HasStringNegativeSign( const OUString& rStr );
+
+ /**
+ Whether a character at position nPos is somewhere between two matching
+ cQuote or not.
+ If nPos points to a cQuote, a true is returned on an opening cQuote,
+ a false is returned on a closing cQuote.
+ A cQuote between quotes may be escaped by a cEscIn, a cQuote outside of
+ quotes may be escaped by a cEscOut.
+ The default '\0' results in no escapement possible.
+ Defaults are set right according to the "unlogic" of the Numberformatter
+ */
+ static bool IsInQuote( const OUString& rString, sal_Int32 nPos,
+ sal_Unicode cQuote = '"',
+ sal_Unicode cEscIn = '\0', sal_Unicode cEscOut = '\\' );
+
+ /**
+ Return the position of a matching closing cQuote if the character at
+ position nPos is between two matching cQuote, otherwise return
+ STRING_NOTFOUND.
+ If nPos points to an opening cQuote the position of the matching
+ closing cQuote is returned.
+ If nPos points to a closing cQuote nPos is returned.
+ If nPos points into a part which starts with an opening cQuote but has
+ no closing cQuote, rString.Len() is returned.
+ Uses <method>IsInQuote</method> internally, so you don't have to call
+ that prior to a call of this method.
+ */
+ static sal_Int32 GetQuoteEnd( const OUString& rString, sal_Int32 nPos,
+ sal_Unicode cQuote = '"',
+ sal_Unicode cEscIn = '\0',
+ sal_Unicode cEscOut = '\\' );
+
+ void SetComment( const OUString& rStr )
+ { sComment = rStr; }
+ const OUString& GetComment() const { return sComment; }
+
+ /** Insert the number of blanks into the string that is needed to simulate
+ the width of character c for underscore formats */
+ static sal_Int32 InsertBlanks( OUString& r, sal_Int32 nPos, sal_Unicode c )
+ {
+ sal_Int32 result;
+ OUStringBuffer sBuff(r);
+
+ result = InsertBlanks(sBuff, nPos, c);
+ r = sBuff.makeStringAndClear();
+
+ return result;
+ }
+
+ /** Insert the number of blanks into the string that is needed to simulate
+ the width of character c for underscore formats */
+ static sal_Int32 InsertBlanks( OUStringBuffer& r, sal_Int32 nPos, sal_Unicode c );
+
+ /// One of YMD,DMY,MDY if date format
+ DateFormat GetDateOrder() const;
+
+ /** A coded value of the exact YMD combination used, if date format.
+ For example: YYYY-MM-DD => ('Y' << 16) | ('M' << 8) | 'D'
+ or: MM/YY => ('M' << 8) | 'Y' */
+ sal_uInt32 GetExactDateOrder() const;
+
+ ImpSvNumberformatScan& ImpGetScan() const { return rScan; }
+
+ // used in XML export
+ void GetConditions( SvNumberformatLimitOps& rOper1, double& rVal1,
+ SvNumberformatLimitOps& rOper2, double& rVal2 ) const;
+ Color* GetColor( sal_uInt16 nNumFor ) const;
+ void GetNumForInfo( sal_uInt16 nNumFor, short& rScannedType,
+ bool& bThousand, sal_uInt16& nPrecision, sal_uInt16& nAnzLeading ) const;
+
+ // rAttr.Number not empty if NatNum attributes are to be stored
+ void GetNatNumXml(
+ ::com::sun::star::i18n::NativeNumberXmlAttributes& rAttr,
+ sal_uInt16 nNumFor ) const;
+
+ /** @returns <TRUE/> if E,EE,R,RR,AAA,AAAA in format code of subformat
+ nNumFor (0..3) and <b>no</b> preceding calendar was specified and the
+ currently loaded calendar is "gregorian". */
+ bool IsOtherCalendar( sal_uInt16 nNumFor ) const
+ {
+ if ( nNumFor < 4 )
+ return ImpIsOtherCalendar( NumFor[nNumFor] );
+ return false;
+ }
+
+ /** Switches to the first non-"gregorian" calendar, but only if the current
+ calendar is "gregorian"; original calendar name and date/time returned,
+ but only if calendar switched and rOrgCalendar was empty. */
+ void SwitchToOtherCalendar( OUString& rOrgCalendar, double& fOrgDateTime ) const;
+
+ /** Switches to the "gregorian" calendar, but only if the current calendar
+ is non-"gregorian" and rOrgCalendar is not empty. Thus a preceding
+ ImpSwitchToOtherCalendar() call should have been placed prior to
+ calling this method. */
+ void SwitchToGregorianCalendar( const OUString& rOrgCalendar, double fOrgDateTime ) const;
+
+#ifdef THE_FUTURE
+ /** Switches to the first specified calendar, if any, in subformat nNumFor
+ (0..3). Original calendar name and date/time returned, but only if
+ calendar switched and rOrgCalendar was empty.
+
+ @return
+ <TRUE/> if a calendar was specified and switched to,
+ <FALSE/> else.
+ */
+ bool SwitchToSpecifiedCalendar( OUString& rOrgCalendar, double& fOrgDateTime,
+ sal_uInt16 nNumFor ) const
+ {
+ if ( nNumFor < 4 )
+ return ImpSwitchToSpecifiedCalendar( rOrgCalendar,
+ fOrgDateTime, NumFor[nNumFor] );
+ return false;
+ }
+#endif
+
+ /// Whether it's a (YY)YY-M(M)-D(D) format.
+ bool IsIso8601( sal_uInt16 nNumFor )
+ {
+ if ( nNumFor < 4 )
+ return ImpIsIso8601( NumFor[nNumFor]);
+ return false;
+ }
+
+private:
+ ImpSvNumFor NumFor[4]; // Array for the 4 subformats
+ OUString sFormatstring; // The format code string
+ OUString sComment; // Comment, since number formatter version 6
+ double fLimit1; // Value for first condition
+ double fLimit2; // Value for second condition
+ ImpSvNumberformatScan& rScan; // Format code scanner
+ LocaleType maLocale; // Language/country of the format, numeral shape and calendar type from Excel.
+ SvNumberformatLimitOps eOp1; // Operator for first condition
+ SvNumberformatLimitOps eOp2; // Operator for second condition
+ sal_uInt16 nNewStandardDefined; // new builtin formats as of version 6
+ short eType; // Type of format
+ bool bStarFlag; // Take *n format as ESC n
+ bool bStandard; // If this is a default standard format
+ bool bIsUsed; // Flag as used for storing
+
+ SVL_DLLPRIVATE sal_uInt16 ImpGetNumForStringElementCount( sal_uInt16 nNumFor ) const;
+
+ SVL_DLLPRIVATE bool ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const;
+
+#ifdef THE_FUTURE
+ SVL_DLLPRIVATE bool ImpSwitchToSpecifiedCalendar( OUString& rOrgCalendar,
+ double& fOrgDateTime,
+ const ImpSvNumFor& rNumFor ) const;
+#endif
+
+ /** Whether to use possessive genitive case month name, or partitive case
+ month name, instead of nominative name (noun).
+
+ @param io_nState
+ 0: execute check <br>
+ set to 1 if nominative case is returned, <br>
+ set to 2 if genitive case is returned, <br>
+ set to 3 if partitive case is returned <br>
+ 1: don't execute check, return nominative case <br>
+ 2: don't execute check, return genitive case <br>
+ 3: don't execute check, return partitive case <br>
+
+ @param eCodeType
+ a NfKeywordIndex, must designate a month type code
+
+ @returns one of com::sun::star::i18n::CalendarDisplayCode values
+ according to eCodeType and the check executed (or passed).
+ */
+ SVL_DLLPRIVATE sal_Int32 ImpUseMonthCase( int & io_nState, const ImpSvNumFor& rNumFor, NfKeywordIndex eCodeType ) const;
+
+ /// Whether it's a (YY)YY-M(M)-D(D) format.
+ SVL_DLLPRIVATE bool ImpIsIso8601( const ImpSvNumFor& rNumFor );
+
+#ifdef _ZFORMAT_CXX // ----- private implementation methods -----
+
+ const CharClass& rChrCls() const { return rScan.GetChrCls(); }
+ const LocaleDataWrapper& rLoc() const { return rScan.GetLoc(); }
+ CalendarWrapper& GetCal() const { return rScan.GetCal(); }
+ const SvNumberFormatter& GetFormatter() const { return *rScan.GetNumberformatter(); }
+
+ // divide in substrings and color conditions
+ SVL_DLLPRIVATE short ImpNextSymbol( OUStringBuffer& rString,
+ sal_Int32& nPos,
+ OUString& sSymbol );
+
+ // read string until ']' and strip blanks (after condition)
+ SVL_DLLPRIVATE static sal_Int32 ImpGetNumber( OUStringBuffer& rString,
+ sal_Int32& nPos,
+ OUString& sSymbol );
+
+ /**
+ * Parse the content of '[$-xxx] or '[$-xxxxxxxx]' and extract the locale
+ * type from it. Given the string, start parsing at position specified by
+ * nPos, and store the end position with nPos when the parsing is
+ * complete. The nPos should point to the '$' before the parsing, and to
+ * the closing bracket after the parsing. When the content is [$-xxx],
+ * the xxx part represents the language type (aka LCID) in hex numerals.
+ * When the content is [$-xxxxxxxx] the last 4 digits represent the LCID
+ * (again in hex), the next 2 digits represent the calendar type, and the
+ * 2 highest digits (if exists) is the numeral shape.
+ *
+ * @reference
+ * http://office.microsoft.com/en-us/excel-help/creating-international-number-formats-HA001034635.aspx
+ *
+ * @param rString input string
+ * @param nPos position (see above).
+ *
+ * @return struct containing numeral shape, calendar type, and LCID that
+ * specifies language type. See i18nlangtag/lang.h for a complete
+ * list of language types. These numbers also correspond with the
+ * numbers used by Microsoft Office.
+ */
+ SVL_DLLPRIVATE static LocaleType ImpGetLocaleType( const OUString& rString, sal_Int32& nPos );
+
+ /** Obtain calendar and numerals from a LocaleType that was parsed from a
+ LCID with ImpGetLocaleType().
+
+ Inserts a NatNum modifier to rString at nPos if needed as determined
+ from the numeral code.
+
+ @ATTENTION: may modify <member>maLocale</member> to make it follow
+ aTmpLocale, in which case also nLang is adapted.
+
+ @returns a string with the calendar if one was determined from the
+ calendar code, else an empty string. The calendar string needs to be
+ inserted at a proper positon to rString after all bracketed prefixes.
+ */
+ SVL_DLLPRIVATE OUString ImpObtainCalendarAndNumerals( OUStringBuffer & rString,
+ sal_Int32 & nPos,
+ LanguageType & nLang,
+ const LocaleType & aTmpLocale );
+
+ // standard number output
+ SVL_DLLPRIVATE void ImpGetOutputStandard( double& fNumber, OUString& OutString );
+ SVL_DLLPRIVATE void ImpGetOutputStandard( double& fNumber, OUStringBuffer& OutString );
+ SVL_DLLPRIVATE void ImpGetOutputStdToPrecision( double& rNumber, OUString& rOutString, sal_uInt16 nPrecision ) const;
+ // numbers in input line
+ SVL_DLLPRIVATE void ImpGetOutputInputLine( double fNumber, OUString& OutString );
+
+ // check subcondition
+ // OP undefined => -1
+ // else 0 or 1
+ SVL_DLLPRIVATE short ImpCheckCondition(double& fNumber,
+ double& fLimit,
+ SvNumberformatLimitOps eOp);
+
+ SVL_DLLPRIVATE sal_uLong ImpGGT(sal_uLong x, sal_uLong y);
+ SVL_DLLPRIVATE sal_uLong ImpGGTRound(sal_uLong x, sal_uLong y);
+
+ // Helper function for number strings
+ // append string symbols, insert leading 0 or ' ', or ...
+ SVL_DLLPRIVATE bool ImpNumberFill( OUStringBuffer& sStr,
+ double& rNumber,
+ sal_Int32& k,
+ sal_uInt16& j,
+ sal_uInt16 nIx,
+ short eSymbolType );
+
+ // Helper function to fill in the integer part and the group (AKA thousand) separators
+ SVL_DLLPRIVATE bool ImpNumberFillWithThousands( OUStringBuffer& sStr,
+ double& rNumber,
+ sal_Int32 k,
+ sal_uInt16 j,
+ sal_uInt16 nIx,
+ sal_Int32 nDigCnt );
+ // Hilfsfunktion zum Auffuellen der Vor-
+ // kommazahl auch mit Tausenderpunkt
+
+ // Helper function to fill in the group (AKA thousand) separators
+ // or to skip additional digits
+ SVL_DLLPRIVATE void ImpDigitFill( OUStringBuffer& sStr,
+ sal_Int32 nStart,
+ sal_Int32& k,
+ sal_uInt16 nIx,
+ sal_Int32 & nDigitCount,
+ utl::DigitGroupingIterator & );
+
+ SVL_DLLPRIVATE bool ImpGetFractionOutput(double fNumber,
+ sal_uInt16 nIx,
+ OUStringBuffer& OutString);
+ SVL_DLLPRIVATE bool ImpGetScientificOutput(double fNumber,
+ sal_uInt16 nIx,
+ OUStringBuffer& OutString);
+
+ SVL_DLLPRIVATE bool ImpGetDateOutput( double fNumber,
+ sal_uInt16 nIx,
+ OUStringBuffer& OutString );
+ SVL_DLLPRIVATE bool ImpGetTimeOutput( double fNumber,
+ sal_uInt16 nIx,
+ OUStringBuffer& OutString );
+ SVL_DLLPRIVATE bool ImpGetDateTimeOutput( double fNumber,
+ sal_uInt16 nIx,
+ OUStringBuffer& OutString );
+
+ // Switches to the "gregorian" calendar if the current calendar is
+ // non-"gregorian" and the era is a "Dummy" era of a calendar which doesn't
+ // know a "before" era (like zh_TW ROC or ja_JP Gengou). If switched and
+ // rOrgCalendar was "gregorian" the string is emptied. If rOrgCalendar was
+ // empty the previous calendar name and date/time are returned.
+ SVL_DLLPRIVATE bool ImpFallBackToGregorianCalendar( OUString& rOrgCalendar, double& fOrgDateTime );
+
+ // Append a "G" short era string of the given calendar. In the case of a
+ // Gengou calendar this is a one character abbreviation, for other
+ // calendars the XExtendedCalendar::getDisplayString() method is called.
+ SVL_DLLPRIVATE static void ImpAppendEraG( OUStringBuffer& OutStringBuffer, const CalendarWrapper& rCal,
+ sal_Int16 nNatNum );
+
+ SVL_DLLPRIVATE bool ImpGetNumberOutput( double fNumber,
+ sal_uInt16 nIx,
+ OUStringBuffer& OutString );
+
+ SVL_DLLPRIVATE void ImpCopyNumberformat( const SvNumberformat& rFormat );
+
+ // normal digits or other digits, depending on ImpSvNumFor.aNatNum,
+ // [NatNum1], [NatNum2], ...
+ SVL_DLLPRIVATE OUString ImpGetNatNumString( const SvNumberNatNum& rNum, sal_Int32 nVal,
+ sal_uInt16 nMinDigits = 0 ) const;
+
+ OUString ImpIntToString( sal_uInt16 nIx, sal_Int32 nVal, sal_uInt16 nMinDigits = 0 ) const
+ {
+ const SvNumberNatNum& rNum = NumFor[nIx].GetNatNum();
+ if ( nMinDigits || rNum.IsComplete() )
+ {
+ return ImpGetNatNumString( rNum, nVal, nMinDigits );
+ }
+ return OUString::valueOf(nVal);
+ }
+
+ // transliterate according to NativeNumber
+ SVL_DLLPRIVATE OUString impTransliterateImpl(const OUString& rStr, const SvNumberNatNum& rNum) const;
+ SVL_DLLPRIVATE void impTransliterateImpl(OUStringBuffer& rStr, const SvNumberNatNum& rNum) const;
+
+ OUString impTransliterate(const OUString& rStr, const SvNumberNatNum& rNum) const
+ {
+ return rNum.IsComplete() ? impTransliterateImpl(rStr, rNum) : rStr;
+ }
+
+ SVL_DLLPRIVATE void impTransliterate(OUStringBuffer& rStr, const SvNumberNatNum& rNum) const
+ {
+ if(rNum.IsComplete())
+ {
+ impTransliterateImpl(rStr, rNum);
+ }
+ }
+
+#endif // _ZFORMAT_CXX
+
+};
+
+#endif // _ZFORMAT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/AccessibleBrowseBoxObjType.hxx b/include/svtools/AccessibleBrowseBoxObjType.hxx
new file mode 100644
index 000000000000..6334cb82aac1
--- /dev/null
+++ b/include/svtools/AccessibleBrowseBoxObjType.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 _SVTOOLS_ACCESSIBLEBROWSEBOXOBJTYPE_HXX
+#define _SVTOOLS_ACCESSIBLEBROWSEBOXOBJTYPE_HXX
+
+// ============================================================================
+
+namespace svt {
+
+// ============================================================================
+
+/** This enumeration contains a constant for each kind of accessible object of
+ a BrowseBox. */
+enum AccessibleBrowseBoxObjType
+{
+ BBTYPE_BROWSEBOX, /// The BrowseBox itself.
+ BBTYPE_TABLE, /// The data table.
+ BBTYPE_ROWHEADERBAR, /// The row header bar ("handle column").
+ BBTYPE_COLUMNHEADERBAR, /// The horizontal column header bar.
+ BBTYPE_TABLECELL, /// A cell of the data table.
+ BBTYPE_ROWHEADERCELL, /// A cell of the row header bar.
+ BBTYPE_COLUMNHEADERCELL, /// A cell of the column header bar.
+ BBTYPE_CHECKBOXCELL /// A cell with a checkbox.
+};
+
+// ============================================================================
+
+} // namespace svt
+
+// ============================================================================
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/DocumentInfoPreview.hxx b/include/svtools/DocumentInfoPreview.hxx
new file mode 100644
index 000000000000..167de92636de
--- /dev/null
+++ b/include/svtools/DocumentInfoPreview.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 SVTOOLS_DOCUMENTINFOPREVIEW_HXX
+#define SVTOOLS_DOCUMENTINFOPREVIEW_HXX
+
+#include "sal/config.h"
+
+#include "boost/scoped_ptr.hpp"
+#include "i18nlangtag/languagetag.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "svtools/svmedit2.hxx"
+#include "svtools/svtdllapi.h"
+#include "tools/wintypes.hxx"
+#include "vcl/window.hxx"
+
+class SvtDocInfoTable_Impl;
+
+namespace com { namespace sun { namespace star {
+ namespace document { class XDocumentProperties; }
+ namespace util { struct DateTime; }
+} } }
+
+namespace svtools {
+
+class SVT_DLLPUBLIC ODocumentInfoPreview: public Window {
+public:
+ ODocumentInfoPreview(Window * pParent, WinBits nBits);
+
+ virtual ~ODocumentInfoPreview();
+
+ virtual void Resize();
+
+ void clear();
+
+ void fill(
+ com::sun::star::uno::Reference<
+ com::sun::star::document::XDocumentProperties > const & xDocProps,
+ OUString const & rURL);
+
+private:
+ ExtMultiLineEdit m_pEditWin;
+ boost::scoped_ptr< SvtDocInfoTable_Impl > m_pInfoTable;
+ LanguageTag m_aLanguageTag;
+
+ void insertEntry(OUString const & title, OUString const & value);
+
+ void insertNonempty(long id, OUString const & value);
+
+ void insertDateTime(long id, com::sun::star::util::DateTime const & value);
+};
+
+}
+
+#endif // SVTOOLS_DOCUMENTINFOPREVIEW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/DocumentToGraphicRenderer.hxx b/include/svtools/DocumentToGraphicRenderer.hxx
new file mode 100644
index 000000000000..3033e6473129
--- /dev/null
+++ b/include/svtools/DocumentToGraphicRenderer.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 _DOCUMENTTOGRAPHICRENDERER_HXX_
+#define _DOCUMENTTOGRAPHICRENDERER_HXX_
+
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/view/XRenderable.hpp>
+#include <com/sun/star/awt/XToolkit.hpp>
+
+#include <vcl/graph.hxx>
+
+#include "svtools/svtdllapi.h"
+
+using namespace css;
+using namespace css::uno;
+using namespace css::lang;
+using namespace css::beans;
+
+class SVT_DLLPUBLIC DocumentToGraphicRenderer
+{
+ const Reference<XComponent>& mxDocument;
+
+ Reference<frame::XModel> mxModel;
+ Reference<frame::XController> mxController;
+ Reference<view::XRenderable> mxRenderable;
+ Reference<awt::XToolkit> mxToolkit;
+
+public:
+ DocumentToGraphicRenderer(const Reference<XComponent>& xDocument);
+ ~DocumentToGraphicRenderer();
+
+ sal_Int32 getCurrentPageWriter( );
+
+ Size getDocumentSizeInPixels( sal_Int32 aCurrentPage );
+
+ Size getDocumentSizeIn100mm( sal_Int32 aCurrentPage );
+
+ Graphic renderToGraphic(sal_Int32 aCurrentPage, Size aDocumentSizePixel, Size aTargetSizePixel);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/GraphicExportOptionsDialog.hxx b/include/svtools/GraphicExportOptionsDialog.hxx
new file mode 100644
index 000000000000..b346f8c25671
--- /dev/null
+++ b/include/svtools/GraphicExportOptionsDialog.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 _GRAPHICEXPORTOPTIONSDIALOG_HXX_
+#define _GRAPHICEXPORTOPTIONSDIALOG_HXX_
+
+#include <vcl/fltcall.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <vcl/layout.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/scrbar.hxx>
+
+#include <svtools/DocumentToGraphicRenderer.hxx>
+
+#include "svtools/svtdllapi.h"
+
+using namespace css;
+using namespace css::uno;
+using namespace css::lang;
+using namespace css::frame;
+using namespace css::beans;
+
+class SVT_DLLPUBLIC GraphicExportOptionsDialog : public ModalDialog
+{
+private:
+ NumericField* mpWidth;
+ NumericField* mpHeight;
+ ComboBox* mpResolution;
+
+ Size mSize100mm;
+ double mResolution;
+
+ DocumentToGraphicRenderer mRenderer;
+
+ sal_Int32 mCurrentPage;
+
+ void initialize();
+ void updateWidth();
+ void updateHeight();
+ void updateResolution();
+
+ double getViewWidthInch();
+ double getViewHeightInch();
+
+ DECL_LINK( widthModifiedHandle, void* );
+ DECL_LINK( heightModifiedHandle, void* );
+ DECL_LINK( resolutionModifiedHandle, void* );
+
+public:
+ GraphicExportOptionsDialog( Window* pWindow, const Reference<XComponent>& rxSourceDocument );
+ ~GraphicExportOptionsDialog();
+
+ Sequence<PropertyValue> getFilterData();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx
new file mode 100644
index 000000000000..d529442cd738
--- /dev/null
+++ b/include/svtools/PlaceEditDialog.hxx
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2012 Julien Levesy <jlevesy@gmail.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _PLACEEDITDIALOG_HXX
+#define _PLACEEDITDIALOG_HXX
+
+#include "ServerDetailsControls.hxx"
+
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/lstbox.hxx>
+
+#include <svtools/inettbc.hxx>
+#include <svtools/place.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <vector>
+
+class SVT_DLLPUBLIC PlaceEditDialog : public ModalDialog
+{
+private :
+
+ Edit* m_pEDServerName;
+ ListBox* m_pLBServerType;
+ boost::shared_ptr< DetailsContainer > m_pCurrentDetails;
+
+ Edit* m_pEDUsername;
+ OKButton* m_pBTOk;
+ CancelButton* m_pBTCancel;
+
+ PushButton* m_pBTDelete;
+
+ /** Vector holding the details UI control for each server type.
+
+ The elements in this vector need to match the order in the type listbox, e.g.
+ the m_aDetailsContainer[0] will be shown for the type corresponding to entry 0
+ in the listbox.
+ */
+ std::vector< boost::shared_ptr< DetailsContainer > > m_aDetailsContainers;
+
+public :
+
+ PlaceEditDialog( Window* pParent);
+ PlaceEditDialog(Window* pParent, const boost::shared_ptr<Place> &pPlace );
+ ~PlaceEditDialog();
+
+ // Returns a place instance with given information
+ boost::shared_ptr<Place> GetPlace();
+
+ OUString GetServerName() { return m_pEDServerName->GetText(); }
+ OUString GetServerUrl();
+
+private:
+
+ void InitDetails( );
+
+ DECL_LINK ( OKHdl, Button * );
+ DECL_LINK ( DelHdl, Button * );
+ DECL_LINK ( EditHdl, void * );
+ DECL_LINK ( SelectTypeHdl, void * );
+ DECL_LINK ( EditUsernameHdl, void * );
+
+};
+
+#endif //_PLACEEDITDIALOG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/QueryFolderName.hxx b/include/svtools/QueryFolderName.hxx
new file mode 100644
index 000000000000..b3ff30d24b81
--- /dev/null
+++ b/include/svtools/QueryFolderName.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 SVT_QUERYFOLDER_HXX
+#define SVT_QUERYFOLDER_HXX
+
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/dialog.hxx>
+
+//-------------------------------------------------------------------------
+namespace svtools {
+
+//-------------------------------------------------------------------------
+// QueryFolderNameDialog
+//-------------------------------------------------------------------------
+
+class QueryFolderNameDialog : public ModalDialog
+{
+private:
+ FixedText aNameText;
+ Edit aNameEdit;
+ FixedLine aNameLine;
+ OKButton aOKBtn;
+ CancelButton aCancelBtn;
+
+ DECL_LINK( OKHdl, void * );
+ DECL_LINK( NameHdl, void * );
+
+public:
+ QueryFolderNameDialog( Window* _pParent,
+ const String& rTitle,
+ const String& rDefaultText,
+ String* pGroupName = NULL );
+ String GetName() const { return aNameEdit.GetText(); }
+};
+
+}
+#endif // SVT_QUERYFOLDER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx
new file mode 100644
index 000000000000..f75b8aa87e2a
--- /dev/null
+++ b/include/svtools/ServerDetailsControls.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:
+ *
+ */
+#ifndef _SERVERDETAILSCONTROLS_HXX
+#define _SERVERDETAILSCONTROLS_HXX
+
+#include <map>
+
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+
+#include <tools/urlobj.hxx>
+#include <vcl/builder.hxx>
+#include <vcl/button.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/field.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/layout.hxx>
+
+class DetailsContainer
+{
+ private:
+ Link m_aChangeHdl;
+ VclFrame* m_pFrame;
+
+ public:
+ DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame );
+ virtual ~DetailsContainer( );
+
+ void setChangeHdl( const Link& rLink ) { m_aChangeHdl = rLink; }
+
+ virtual void show( bool bShow = true );
+ virtual INetURLObject getUrl( );
+
+ /** Try to split the URL in the controls of that container.
+
+ \param sUrl the URL to split
+ \return true if the split worked, false otherwise.
+ */
+ virtual bool setUrl( const INetURLObject& rUrl );
+
+ virtual void setUsername( const OUString& /*rUsername*/ ) { };
+
+ protected:
+ void notifyChange( );
+ DECL_LINK ( ValueChangeHdl, void * );
+};
+
+class HostDetailsContainer : public DetailsContainer
+{
+ private:
+ sal_uInt16 m_nDefaultPort;
+ OUString m_sScheme;
+
+ protected:
+ Edit* m_pEDHost;
+ NumericField* m_pEDPort;
+ Edit* m_pEDPath;
+
+ public:
+ HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, OUString sScheme );
+ virtual ~HostDetailsContainer( ) { };
+
+ virtual void show( bool bShow = true );
+ virtual INetURLObject getUrl( );
+ virtual bool setUrl( const INetURLObject& rUrl );
+
+ protected:
+ void setScheme( OUString sScheme ) { m_sScheme = sScheme; }
+
+ /** Verifies that the schement split from the URL can be handled by
+ the container and set the proper controls accordingly if needed.
+ */
+ virtual bool verifyScheme( const OUString& rScheme );
+};
+
+class DavDetailsContainer : public HostDetailsContainer
+{
+ private:
+ CheckBox* m_pCBDavs;
+
+ public:
+ DavDetailsContainer( VclBuilderContainer* pBuilder );
+ ~DavDetailsContainer( ) { };
+
+ virtual void show( bool bShow = true );
+
+ protected:
+ virtual bool verifyScheme( const OUString& rScheme );
+
+ private:
+ DECL_LINK ( ToggledDavsHdl, CheckBox * pCheckBox );
+};
+
+class SmbDetailsContainer : public DetailsContainer
+{
+ private:
+ Edit* m_pEDHost;
+ Edit* m_pEDShare;
+ Edit* m_pEDPath;
+
+ public:
+ SmbDetailsContainer( VclBuilderContainer* pBuilder );
+ ~SmbDetailsContainer( ) { };
+
+ virtual INetURLObject getUrl( );
+ virtual bool setUrl( const INetURLObject& rUrl );
+};
+
+class CmisDetailsContainer : public DetailsContainer
+{
+ private:
+ OUString m_sUsername;
+ com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
+ std::vector< OUString > m_aServerTypesURLs;
+ std::vector< OUString > m_aRepoIds;
+ OUString m_sRepoId;
+
+ Edit* m_pEDBinding;
+ ListBox* m_pLBRepository;
+ Button* m_pBTRepoRefresh;
+ ListBox* m_pLBServerType;
+ Edit* m_pEDPath;
+
+ public:
+ CmisDetailsContainer( VclBuilderContainer* pBuilder );
+ ~CmisDetailsContainer( ) { };
+
+ virtual INetURLObject getUrl( );
+ virtual bool setUrl( const INetURLObject& rUrl );
+ virtual void setUsername( const OUString& rUsername );
+
+ private:
+ void selectRepository( );
+ DECL_LINK ( SelectServerTypeHdl, void * );
+ DECL_LINK ( RefreshReposHdl, void * );
+ DECL_LINK ( SelectRepoHdl, void * );
+};
+
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/acceleratorexecute.hxx b/include/svtools/acceleratorexecute.hxx
new file mode 100644
index 000000000000..0b3b473449b7
--- /dev/null
+++ b/include/svtools/acceleratorexecute.hxx
@@ -0,0 +1,246 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SVTOOLS_ACCELERATOREXECUTE_HXX
+#define INCLUDED_SVTOOLS_ACCELERATOREXECUTE_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <vector>
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/awt/KeyEvent.hpp>
+#include <vcl/keycod.hxx>
+#include <vcl/evntpost.hxx>
+#include <osl/mutex.h>
+
+
+namespace svt
+{
+
+
+struct TMutexInit
+{
+ ::osl::Mutex m_aLock;
+};
+
+//===============================================
+/**
+ @descr implements a helper, which can be used to
+ convert vcl key codes into awt key codes ...
+ and reverse.
+
+ Further such key code can be triggered.
+ Doing so different accelerator
+ configurations are merged together; a suitable
+ command registered for the given key code is searched
+ and will be dispatched.
+
+ @attention
+
+ Because exceution of an accelerator command can be dangerous
+ (in case it force an office shutdown for key "ALT+F4"!)
+ all internal dispatches are done asynchronous.
+ Menas that the trigger call doesnt wait till the dispatch
+ is finished. You can call very often. All requests will be
+ queued internal and dispatched ASAP.
+
+ Of course this queue will be stopped if the environment
+ will be destructed ...
+ */
+class SVT_DLLPUBLIC AcceleratorExecute : private TMutexInit
+{
+ //-------------------------------------------
+ // const, types
+ private:
+
+ /** @deprecated
+ replaced by internal class AsyncAccelExec ...
+ remove this resource here if we go forwards to next major */
+ typedef ::std::vector< ::std::pair< css::util::URL, css::uno::Reference< css::frame::XDispatch > > > TCommandQueue;
+
+ //-------------------------------------------
+ // member
+ private:
+
+ /** TODO document me */
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+
+ /** TODO document me */
+ css::uno::Reference< css::util::XURLTransformer > m_xURLParser;
+
+ /** TODO document me */
+ css::uno::Reference< css::frame::XDispatchProvider > m_xDispatcher;
+
+ /** TODO document me */
+ css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xGlobalCfg;
+ css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xModuleCfg;
+ css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xDocCfg;
+
+ /** @deprecated
+ replaced by internal class AsyncAccelExec ...
+ remove this resource here if we go forwards to next major */
+ TCommandQueue m_lCommandQueue;
+
+ /** @deprecated
+ replaced by internal class AsyncAccelExec ...
+ remove this resource here if we go forwards to next major */
+ ::vcl::EventPoster m_aAsyncCallback;
+
+ //-------------------------------------------
+ // interface
+ public:
+
+ //---------------------------------------
+ /** @short factory method to create new accelerator
+ helper instance.
+
+ @descr Such helper instance must be initialized at first.
+ So it can know its environment (global/module or
+ document specific).
+
+ Afterwards it can be used to execute incoming
+ accelerator requests.
+
+ The "end of life" of such helper can be reached as follow:
+
+ - delete the object
+ => If it stands currently in its execute method, they will
+ be finished. All further queued requests will be removed
+ and further not executed!
+
+ - "let it stay alone"
+ => All currently queued events will be finished. The
+ helper kills itself afterwards. A shutdown of the
+ environment will be recognized ... The helper stop its
+ work immediately then!
+ */
+ static AcceleratorExecute* createAcceleratorHelper();
+
+ //---------------------------------------
+ /** @short fight against inlining ... */
+ virtual ~AcceleratorExecute();
+
+ //---------------------------------------
+ /** @short init this instance.
+
+ @descr It must be called as first method after creation.
+ And further it can be called more then once ...
+ but at least its should be used one times only.
+ Otherwhise nobody can say, which asynchronous
+ executions will be used inside the old and which one
+ will be used inside the new environment.
+
+ @param rxContext
+ reference to an uno service manager.
+
+ @param xEnv
+ if it points to a valid frame it will be used
+ to execute the dispatch there. Further the frame
+ is used to locate the right module configuration
+ and use it merged together with the document and
+ the global configuration.
+
+ If this parameter is set to NULL, the global configuration
+ is used only. Further the global Desktop instance is
+ used for dispatch.
+ */
+ virtual void init(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+ const css::uno::Reference< css::frame::XFrame >& xEnv );
+
+ //---------------------------------------
+ /** @short trigger this accelerator.
+
+ @descr The internal configuartions are used to find
+ as suitable command for this key code.
+ This command will be queued and executed later
+ asynchronous.
+
+ @param aKey
+ specify the accelerator for execute.
+
+ @return [sal_Bool]
+ sal_True if this key is configured and match to a command.
+ Attention: This state does not mean the success state
+ of the corresponding execute. Because its done asynchronous!
+ */
+ virtual sal_Bool execute(const KeyCode& aKey);
+ virtual sal_Bool execute(const css::awt::KeyEvent& aKey);
+
+ /** search the command for the given key event.
+ *
+ * @param aKey The key event
+ * @return The command or an empty string if the key event could not be found.
+ */
+ OUString findCommand(const ::com::sun::star::awt::KeyEvent& aKey);
+ //---------------------------------------
+ /** TODO document me */
+ static css::awt::KeyEvent st_VCLKey2AWTKey(const KeyCode& aKey);
+ static KeyCode st_AWTKey2VCLKey(const css::awt::KeyEvent& aKey);
+
+ //---------------------------------------
+ /** TODO document me */
+ static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openGlobalConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext);
+
+ //---------------------------------------
+ /** TODO document me */
+ static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openModuleConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext ,
+ const css::uno::Reference< css::frame::XFrame >& xFrame);
+
+ //---------------------------------------
+ /** TODO document me */
+ static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openDocConfig(const css::uno::Reference< css::frame::XModel >& xModel);
+
+ //-------------------------------------------
+ // internal
+ private:
+
+ //---------------------------------------
+ /** @short allow creation of instances of this class
+ by using our factory only!
+ */
+ SVT_DLLPRIVATE AcceleratorExecute();
+
+ AcceleratorExecute(const AcceleratorExecute& rCopy);
+ void operator=(const AcceleratorExecute&) {};
+ //---------------------------------------
+ /** TODO document me */
+ SVT_DLLPRIVATE OUString impl_ts_findCommand(const css::awt::KeyEvent& aKey);
+
+ //---------------------------------------
+ /** TODO document me */
+ SVT_DLLPRIVATE css::uno::Reference< css::util::XURLTransformer > impl_ts_getURLParser();
+
+ //---------------------------------------
+ /** @deprecated
+ replaced by internal class AsyncAccelExec ...
+ remove this resource here if we go forwards to next major */
+ DECL_DLLPRIVATE_LINK(impl_ts_asyncCallback, void*);
+};
+
+} // namespace svt
+
+#endif // INCLUDED_SVTOOLS_ACCELERATOREXECUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/accessibilityoptions.hxx b/include/svtools/accessibilityoptions.hxx
new file mode 100644
index 000000000000..4c168143aff9
--- /dev/null
+++ b/include/svtools/accessibilityoptions.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_SVTOOLS_ACCESSIBILITYOPTIONS_HXX
+#define INCLUDED_SVTOOLS_ACCESSIBILITYOPTIONS_HXX
+
+#include "svtools/svtdllapi.h"
+#include <unotools/configitem.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <unotools/options.hxx>
+
+class SvtAccessibilityOptions_Impl;
+
+class SVT_DLLPUBLIC SvtAccessibilityOptions:
+ public utl::detail::Options, private SfxListener
+{
+private:
+ static SvtAccessibilityOptions_Impl* sm_pSingleImplConfig;
+ static sal_Int32 sm_nAccessibilityRefCount;
+
+public:
+ SvtAccessibilityOptions();
+ virtual ~SvtAccessibilityOptions();
+
+ // get & set config entries
+ sal_Bool GetIsForPagePreviews() const;
+ sal_Bool GetIsHelpTipsDisappear() const;
+ sal_Bool GetIsAllowAnimatedGraphics() const;
+ sal_Bool GetIsAllowAnimatedText() const;
+ sal_Bool GetIsAutomaticFontColor() const;
+ sal_Bool GetIsSystemFont() const;
+ sal_Int16 GetHelpTipSeconds() const;
+ sal_Bool IsSelectionInReadonly() const;
+ sal_Bool GetAutoDetectSystemHC() const;
+
+ void SetIsForPagePreviews(sal_Bool bSet);
+ void SetIsHelpTipsDisappear(sal_Bool bSet);
+ void SetIsAllowAnimatedGraphics(sal_Bool bSet);
+ void SetIsAllowAnimatedText(sal_Bool bSet);
+ void SetIsAutomaticFontColor(sal_Bool bSet);
+ void SetIsSystemFont(sal_Bool bSet);
+ void SetHelpTipSeconds(sal_Int16 nSet);
+ void SetSelectionInReadonly(sal_Bool bSet);
+ void SetAutoDetectSystemHC(sal_Bool bSet);
+
+ sal_Bool IsModified() const;
+ void Commit();
+
+ //SfxListener:
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ void SetVCLSettings();
+};
+
+#endif // #ifndef INCLUDED_SVTOOLS_ACCESSIBILITYOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/accessiblefactory.hxx b/include/svtools/accessiblefactory.hxx
new file mode 100644
index 000000000000..d30af055c91d
--- /dev/null
+++ b/include/svtools/accessiblefactory.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 SVTOOLS_ACCESSIBLE_FACTORY_HXX
+#define SVTOOLS_ACCESSIBLE_FACTORY_HXX
+
+#include "AccessibleBrowseBoxObjType.hxx"
+#include "accessibletableprovider.hxx"
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <rtl/ref.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace accessibility {
+ class XAccessible;
+ class XAccessibleContext;
+ }
+ namespace awt {
+ class XWindow;
+ }
+} } }
+class SvHeaderTabListBox;
+class SvtIconChoiceCtrl;
+class TabBar;
+class SvTreeListBox;
+class VCLXWindow;
+class TextEngine;
+class TextView;
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ class ToolPanelDeck;
+ class IToolPanelDeck;
+ class PanelTabBar;
+ namespace table
+ {
+ class IAccessibleTable;
+ class IAccessibleTableControl;
+ }
+
+ /** a function which is able to create a factory for the standard Accessible/Context
+ components needed for standard toolkit controls
+
+ The returned pointer denotes an instance of the IAccessibleFactory, which has been acquired
+ <em>once</em>. The caller is responsible for holding this reference as long as it needs the
+ factory, and release it afterwards.
+ */
+ typedef void* (SAL_CALL * GetSvtAccessibilityComponentFactory)( );
+
+ //================================================================
+ //= IAccessibleFactory
+ //================================================================
+ class IAccessibleFactory : public ::rtl::IReference
+ {
+ public:
+ virtual IAccessibleTabListBox*
+ createAccessibleTabListBox(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
+ SvHeaderTabListBox& rBox
+ ) const = 0;
+
+ virtual IAccessibleBrowseBox*
+ createAccessibleBrowseBox(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ IAccessibleTableProvider& _rBrowseBox
+ ) const = 0;
+ virtual table::IAccessibleTableControl*
+ createAccessibleTableControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ table::IAccessibleTable& _rTable
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleIconChoiceCtrl(
+ SvtIconChoiceCtrl& _rIconCtrl,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xParent
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleTabBar(
+ TabBar& _rTabBar
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleTextWindowContext(
+ VCLXWindow* pVclXWindow, TextEngine& rEngine, TextView& rView, bool bCompoundControlChild
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleTreeListBox(
+ SvTreeListBox& _rListBox,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xParent
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleBrowseBoxHeaderBar(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
+ IAccessibleTableProvider& _rOwningTable,
+ AccessibleBrowseBoxObjType _eObjType
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleBrowseBoxTableCell(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ IAccessibleTableProvider& _rBrowseBox,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
+ sal_Int32 _nRowId,
+ sal_uInt16 _nColId,
+ sal_Int32 _nOffset
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleBrowseBoxHeaderCell(
+ sal_Int32 _nColumnRowId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
+ IAccessibleTableProvider& _rBrowseBox,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
+ AccessibleBrowseBoxObjType _eObjType
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleCheckBoxCell(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ IAccessibleTableProvider& _rBrowseBox,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
+ sal_Int32 _nRowPos,
+ sal_uInt16 _nColPos,
+ const TriState& _eState,
+ sal_Bool _bIsTriState
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createEditBrowseBoxTableCellAccess(
+ const ::com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible >& _rxParent,
+ const ::com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible >& _rxControlAccessible,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _rxFocusWindow,
+ IAccessibleTableProvider& _rBrowseBox,
+ sal_Int32 _nRowPos,
+ sal_uInt16 _nColPos
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleToolPanelDeck(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent,
+ ::svt::ToolPanelDeck& i_rPanelDeck
+ ) = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleToolPanelTabBar(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent,
+ ::svt::IToolPanelDeck& i_rPanelDeck,
+ ::svt::PanelTabBar& i_rTabBar
+ ) = 0;
+
+ protected:
+ ~IAccessibleFactory() {}
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVTOOLS_ACCESSIBLE_FACTORY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/accessibletable.hxx b/include/svtools/accessibletable.hxx
new file mode 100644
index 000000000000..7b314df4f4bf
--- /dev/null
+++ b/include/svtools/accessibletable.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 _SVTOOLS_ACCESSIBLETABLE_HXX
+#define _SVTOOLS_ACCESSIBLETABLE_HXX
+
+#include <vcl/window.hxx>
+#include <unotools/accessiblestatesethelper.hxx>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+
+
+namespace svt{ namespace table
+{
+
+typedef sal_Int32 RowPos;
+
+
+enum AccessibleTableType
+{
+ /** Child index of the column header bar (first row). */
+ TCINDEX_COLUMNHEADERBAR = 0,
+ /** Child index of the row header bar ("handle column"). */
+ TCINDEX_ROWHEADERBAR = 1,
+ /** Child index of the data table. */
+ TCINDEX_TABLE = 2
+};
+
+enum AccessibleTableControlObjType
+{
+ TCTYPE_GRIDCONTROL, /// The GridControl itself.
+ TCTYPE_TABLE, /// The data table.
+ TCTYPE_ROWHEADERBAR, /// The row header bar.
+ TCTYPE_COLUMNHEADERBAR, /// The horizontal column header bar.
+ TCTYPE_TABLECELL, /// A cell of the data table.
+ TCTYPE_ROWHEADERCELL, /// A cell of the row header bar.
+ TCTYPE_COLUMNHEADERCELL, /// A cell of the column header bar.
+};
+
+
+/** This abstract class provides methods to implement an accessible table object.
+*/
+class IAccessibleTable
+{
+public:
+ /** @return The position of the current row. */
+ virtual sal_Int32 GetCurrentRow() const = 0;
+ /** @return The position of the current column. */
+ virtual sal_Int32 GetCurrentColumn() const = 0;
+ /** Creates and returns the accessible object of the whole GridControl. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible()= 0;
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex )= 0;
+ virtual OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const= 0;
+ virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow )= 0;
+ virtual sal_Bool HasColHeader() = 0;
+ virtual sal_Bool HasRowHeader() = 0;
+
+ /** 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 colum/row cell
+ @return
+ The description of the specified object.
+ */
+ virtual OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const= 0;
+
+ /** Fills the StateSet with all states (except DEFUNC and SHOWING, done by
+ the accessible object), depending on the specified object type. */
+ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet,
+ AccessibleTableControlObjType eObjType ) const= 0;
+
+ // Window
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const = 0;
+ virtual void GrabFocus()= 0;
+ virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True )= 0;
+ virtual Window* GetAccessibleParentWindow() const= 0;
+ virtual Window* GetWindowInstance()= 0;
+ virtual sal_Int32 GetAccessibleControlCount() const = 0;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )= 0;
+ virtual long GetRowCount() const= 0;
+ virtual long GetColumnCount() const= 0;
+ virtual sal_Bool HasRowHeader() const= 0;
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )= 0;
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True ) = 0;
+ virtual Rectangle calcHeaderCellRect( sal_Bool _bColHeader, sal_Int32 _nPos ) = 0;
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True ) = 0;
+ virtual Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos ) = 0;
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)= 0;
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)= 0;
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const= 0;
+ virtual OUString GetRowDescription( sal_Int32 _nRow ) const = 0;
+ virtual OUString GetRowName(sal_Int32 _nIndex) const = 0;
+ virtual OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0;
+ virtual OUString GetColumnName( sal_Int32 _nIndex ) const = 0;
+ virtual css::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0;
+ virtual OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0;
+
+ virtual sal_Int32 GetSelectedRowCount() const = 0;
+ virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const = 0;
+ virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const = 0;
+ virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select ) = 0;
+ virtual void SelectAllRows( bool const i_select ) = 0;
+
+protected:
+ ~IAccessibleTable() {}
+};
+
+
+/** interface for an implementation of a table control's Accesible component
+*/
+class IAccessibleTableControl
+{
+public:
+ /** returns the XAccessible object itself
+
+ The reference returned here can be used to control the life time of the
+ IAccessibleTableImplementation object.
+
+ The returned reference is guaranteed to not be <NULL/>.
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getMyself() = 0;
+
+ /** disposes the accessible implementation, so that it becomes defunc
+ */
+ virtual void dispose() = 0;
+
+ /** checks whether the accessible implementation, and its context, are still alive
+ @return <TRUE/>, if the object is not disposed or disposing.
+ */
+ virtual sal_Bool isAlive() const = 0;
+
+ /** returns the accessible object for the row or the column header bar
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getTableHeader( ::svt::table::AccessibleTableControlObjType _eObjType ) = 0;
+
+ /** returns the accessible object for the table representation
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getTable() = 0;
+
+ /** commits the event at all listeners of the cell
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ virtual void commitCellEvent(
+ sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue
+ ) = 0;
+ /** commits the event at all listeners of the table
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ virtual void commitTableEvent(
+ sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue
+ ) = 0;
+
+ ///** Commits an event to all listeners. */
+ virtual void commitEvent(
+ sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue
+ ) = 0;
+
+protected:
+ ~IAccessibleTableControl() {}
+};
+
+
+} // namespace table
+} // namespace svt
+
+#endif // _SVTOOLS_ACCESSIBLETABLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/accessibletableprovider.hxx b/include/svtools/accessibletableprovider.hxx
new file mode 100644
index 000000000000..775ac23c8ab2
--- /dev/null
+++ b/include/svtools/accessibletableprovider.hxx
@@ -0,0 +1,241 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX
+#define _SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX
+
+#include <vcl/window.hxx>
+#include <unotools/accessiblestatesethelper.hxx>
+#include <svtools/AccessibleBrowseBoxObjType.hxx>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+
+
+namespace svt
+{
+
+#define OFFSET_DEFAULT ((sal_Int32)-1)
+#define OFFSET_NONE ((sal_Int32)0)
+
+enum AccessibleTableChildIndex
+{
+ /** Child index of the column header bar (first row). Exists always. */
+ BBINDEX_COLUMNHEADERBAR = 0,
+ /** Child index of the row header bar ("handle column"). Exists always. */
+ BBINDEX_ROWHEADERBAR = 1,
+ /** Child index of the data table. */
+ BBINDEX_TABLE = 2,
+ /** Child index of the first additional control. */
+ BBINDEX_FIRSTCONTROL = 3
+};
+
+
+/** This abstract class provides methods to implement an accessible table object.
+*/
+class IAccessibleTableProvider
+{
+public:
+ /** @return The count of the rows. */
+ virtual long GetRowCount() const = 0;
+ /** @return The count of the columns. */
+ virtual sal_uInt16 GetColumnCount() const = 0;
+
+ /** @return The position of the current row. */
+ virtual sal_Int32 GetCurrRow() const = 0;
+ /** @return The position of the current column. */
+ virtual sal_uInt16 GetCurrColumn() const = 0;
+
+ /** @return The description of a row.
+ @param _nRow The row which description is in demand. */
+ virtual OUString GetRowDescription( sal_Int32 _nRow ) const = 0;
+ /** @return The description of a column.
+ @param _nColumn The column which description is in demand. */
+ virtual OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0;
+
+ /** @return <TRUE/>, if the object has a row header. */
+ virtual sal_Bool HasRowHeader() const = 0; //GetColumnId
+ /** @return <TRUE/>, if the object can focus a cell. */
+ virtual sal_Bool IsCellFocusable() const = 0;
+ virtual sal_Bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
+
+ virtual void SetNoSelection() = 0;
+ virtual void SelectAll() = 0;
+ virtual void SelectRow( long _nRow, sal_Bool _bSelect = sal_True, sal_Bool bExpand = sal_True ) = 0;
+ virtual void SelectColumn( sal_uInt16 _nColumnPos, sal_Bool _bSelect = sal_True ) = 0;
+ virtual sal_Int32 GetSelectedRowCount() const = 0;
+ virtual sal_Int32 GetSelectedColumnCount() const = 0;
+ /** @return <TRUE/>, if the row is selected. */
+ virtual bool IsRowSelected( long _nRow ) const = 0;
+ virtual sal_Bool IsColumnSelected( long _nColumnPos ) const = 0;
+ virtual void GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& _rRows ) const = 0;
+ virtual void GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumns ) const = 0;
+
+ /** @return <TRUE/>, if the cell is visible. */
+ virtual sal_Bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0;
+ virtual String GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const = 0;
+
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True ) = 0;
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True ) = 0;
+ virtual Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumnPos, sal_Bool _bIsHeader, sal_Bool _bOnScreen = sal_True ) = 0;
+
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleRowHeader( sal_Int32 _nRow ) = 0;
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos ) = 0;
+
+ virtual sal_Int32 GetAccessibleControlCount() const = 0;
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex ) = 0;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint ) = 0;
+
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_uInt16& _rnColPos, const Point& _rPoint ) = 0;
+ virtual sal_Bool ConvertPointToRowHeader( sal_Int32& _rnRow, const Point& _rPoint ) = 0;
+ virtual sal_Bool ConvertPointToColumnHeader( sal_uInt16& _rnColPos, const Point& _rPoint ) = 0;
+
+ virtual OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const = 0;
+ virtual OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const = 0;
+
+ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& _rStateSet, ::svt::AccessibleBrowseBoxObjType _eType ) const = 0;
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0;
+ virtual void GrabTableFocus() = 0;
+
+ // OutputDevice
+ virtual sal_Bool GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector ) = 0;
+
+ // Window
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const = 0;
+ virtual void GrabFocus() = 0;
+ virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True ) = 0;
+ virtual Window* GetAccessibleParentWindow() const = 0;
+ virtual Window* GetWindowInstance() = 0;
+
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) = 0;
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) = 0;
+
+protected:
+ ~IAccessibleTableProvider() {}
+};
+
+
+/** interface for an implementation of a table control's Accesible component
+*/
+class IAccessibleTabListBox
+{
+public:
+ /** returns the XAccessible object itself
+
+ The reference returned here can be used to control the life time of the
+ IAccessibleTableImplementation object.
+
+ The returned reference is guaranteed to not be <NULL/>.
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getMyself() = 0;
+
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ SAL_CALL getAccessibleChild( sal_Int32 nChildIndex )
+ throw ( css::lang::IndexOutOfBoundsException, css::uno::RuntimeException ) = 0;
+
+ /** returns the accessible object for the row or the column header bar
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getHeaderBar( ::svt::AccessibleBrowseBoxObjType _eObjType ) = 0;
+
+protected:
+ ~IAccessibleTabListBox() {}
+};
+
+/** interface for an implementation of a browse box's Accesible component
+*/
+class IAccessibleBrowseBox
+{
+public:
+ /** returns the XAccessible object itself
+
+ The reference returned here can be used to control the life time of the
+ IAccessibleTableImplementation object.
+
+ The returned reference is guaranteed to not be <NULL/>.
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getMyself() = 0;
+
+ /** disposes the accessible implementation, so that it becomes defunc
+ */
+ virtual void dispose() = 0;
+
+ /** checks whether the accessible implementation, and its context, are still alive
+ @return <TRUE/>, if the object is not disposed or disposing.
+ */
+ virtual sal_Bool isAlive() const = 0;
+
+ /** returns the accessible object for the row or the column header bar
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getHeaderBar( ::svt::AccessibleBrowseBoxObjType _eObjType ) = 0;
+
+ /** returns the accessible object for the table representation
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getTable() = 0;
+
+ /** commits the event at all listeners of the column/row header bar
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ virtual void commitHeaderBarEvent(
+ sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue,
+ sal_Bool _bColumnHeaderBar
+ ) = 0;
+
+ /** commits the event at all listeners of the table
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ virtual void commitTableEvent(
+ sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue
+ ) = 0;
+
+ /** Commits an event to all listeners. */
+ virtual void commitEvent(
+ sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue
+ ) = 0;
+
+protected:
+ ~IAccessibleBrowseBox() {}
+};
+
+
+} // namespace svt
+
+
+#endif // _SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/addresstemplate.hxx b/include/svtools/addresstemplate.hxx
new file mode 100644
index 000000000000..d7406235b9a6
--- /dev/null
+++ b/include/svtools/addresstemplate.hxx
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVT_ADDRESSTEMPLATE_HXX_
+#define _SVT_ADDRESSTEMPLATE_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <vcl/dialog.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/combobox.hxx>
+#include <vcl/button.hxx>
+#include <vcl/layout.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/scrbar.hxx>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/util/AliasProgrammaticPair.hpp>
+#include <com/sun/star/sdb/XDatabaseContext.hpp>
+#include <com/sun/star/sdbc/XDataSource.hpp>
+#include <unotools/configitem.hxx>
+
+// .......................................................................
+namespace svt
+{
+// .......................................................................
+
+ // ===================================================================
+ // = AddressBookSourceDialog
+ // ===================================================================
+ struct AddressBookSourceDialogData;
+ class SVT_DLLPUBLIC AddressBookSourceDialog : public ModalDialog
+ {
+ protected:
+ // Controls
+ ComboBox* m_pDatasource;
+ PushButton* m_pAdministrateDatasources;
+ ComboBox* m_pTable;
+ ScrollBar* m_pFieldScroller;
+
+ // string to display for "no selection"
+ const String m_sNoFieldSelection;
+
+ /// the DatabaseContext for selecting data sources
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext >
+ m_xDatabaseContext;
+ // the ORB for creating objects
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ m_xORB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
+ m_xCurrentDatasourceTables;
+
+ AddressBookSourceDialogData*
+ m_pImpl;
+
+ public:
+ AddressBookSourceDialog( Window* _pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB );
+
+ /** if you use this ctor, the dialog
+ <ul><li>will not store it's data in the configuration (nor initially retrieve it from there)</li>
+ <li>will not allow to change the data source name</li>
+ <li>will not allow to change the table name</li>
+ <li>will not allow to call the data source administration dialog</li>
+ </ul>
+
+ @param _rxORB
+ a service factory to use for various UNO related needs
+ @param _rxTransientDS
+ the data source to obtain connections from
+ @param _rDataSourceName
+ the to-be name of _rxTransientDS. This is only for displaying this
+ name to the user, since the dialog completely works on _rxTransientDS,
+ and doesn't allow to change this.
+ @param _rTable
+ the table name to display. It must refer to a valid table, relative to a connection
+ obtained from <arg>_rxTransientDS</arg>
+ */
+ AddressBookSourceDialog( Window* _pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource >& _rxTransientDS,
+ const OUString& _rDataSourceName,
+ const OUString& _rTable,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::util::AliasProgrammaticPair >& _rMapping
+ );
+
+ ~AddressBookSourceDialog();
+
+ // to be used if the object was constructed for editing a field mapping only
+ void getFieldMapping(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::util::AliasProgrammaticPair >& _rMapping) const;
+
+ protected:
+ void implConstruct();
+
+ // Window overridables
+ virtual long PreNotify( NotifyEvent& _rNEvt );
+
+ // implementations
+ void implScrollFields(sal_Int32 _nPos, sal_Bool _bAdjustFocus, sal_Bool _bAdjustScrollbar);
+ void implSelectField(ListBox* _pBox, const String& _rText);
+
+ void initalizeListBox(ListBox* _pList);
+ void resetTables();
+ void resetFields();
+
+ // fill in the data sources listbox
+ void initializeDatasources();
+
+ // initialize the dialog from the configuration data
+ void loadConfiguration();
+
+ DECL_LINK(OnFieldScroll, ScrollBar*);
+ DECL_LINK(OnFieldSelect, ListBox*);
+ DECL_LINK(OnAdministrateDatasources, void*);
+ DECL_LINK(OnComboGetFocus, ComboBox*);
+ DECL_LINK(OnComboLoseFocus, ComboBox*);
+ DECL_LINK(OnComboSelect, ComboBox*);
+ DECL_LINK(OnOkClicked, void*);
+ DECL_LINK(OnDelayedInitialize, void*);
+ };
+
+
+// .......................................................................
+} // namespace svt
+// .......................................................................
+
+#endif // _SVT_ADDRESSTEMPLATE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/apearcfg.hxx b/include/svtools/apearcfg.hxx
new file mode 100644
index 000000000000..fdfb4ef0f671
--- /dev/null
+++ b/include/svtools/apearcfg.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 _SVT_APEARCFG_HXX
+#define _SVT_APEARCFG_HXX
+
+#include "svtools/svtdllapi.h"
+#include "tools/solar.h"
+#include <unotools/configitem.hxx>
+
+class Application;
+
+typedef enum {
+ SnapToButton = 0,
+ SnapToMiddle,
+ NoSnap
+} SnapType;
+
+typedef enum { // MUST match the order chosen in ListBox LB_DRAG_MODE in optgdlg.src
+ DragFullWindow,
+ DragFrame,
+ DragSystemDep
+} DragMode;
+
+
+class SVT_DLLPUBLIC SvtTabAppearanceCfg : public utl::ConfigItem
+{
+ short nDragMode ;
+ short nScaleFactor ;
+ short nSnapMode ;
+ short nMiddleMouse;
+#if defined( UNX )
+ short nAAMinPixelHeight ;
+#endif
+
+ sal_Bool bMenuMouseFollow ;
+#if defined( UNX )
+ sal_Bool bFontAntialiasing ;
+#endif
+
+ static sal_Bool bInitialized ;
+
+ SVT_DLLPRIVATE const com::sun::star::uno::Sequence<OUString>& GetPropertyNames();
+
+public:
+ SvtTabAppearanceCfg( );
+ ~SvtTabAppearanceCfg( );
+
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence< OUString >& _rPropertyNames);
+
+ sal_uInt16 GetDragMode () const { return nDragMode; }
+
+ sal_uInt16 GetScaleFactor () const { return nScaleFactor; }
+ void SetScaleFactor ( sal_uInt16 nSet );
+
+ sal_uInt16 GetSnapMode () const { return nSnapMode; }
+ void SetSnapMode ( sal_uInt16 nSet );
+
+ sal_uInt16 GetMiddleMouseButton () const { return nMiddleMouse; }
+ void SetMiddleMouseButton ( sal_uInt16 nSet );
+
+ void SetApplicationDefaults ( Application* pApp );
+
+ void SetMenuMouseFollow(sal_Bool bSet) {bMenuMouseFollow = bSet; SetModified();}
+ sal_Bool IsMenuMouseFollow() const{return bMenuMouseFollow;}
+
+#if defined( UNX )
+ void SetFontAntiAliasing( sal_Bool bSet ) { bFontAntialiasing = bSet; SetModified(); }
+ sal_Bool IsFontAntiAliasing() const { return bFontAntialiasing; }
+
+ sal_uInt16 GetFontAntialiasingMinPixelHeight( ) const { return nAAMinPixelHeight; }
+ void SetFontAntialiasingMinPixelHeight( sal_uInt16 _nMinHeight ) { nAAMinPixelHeight = _nMinHeight; SetModified(); }
+#endif
+
+ static sal_Bool IsInitialized() { return bInitialized; }
+ static void SetInitialized() { bInitialized = sal_True; }
+};
+
+#endif // _OFA_APEARCFG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/asynclink.hxx b/include/svtools/asynclink.hxx
new file mode 100644
index 000000000000..9551c1478f6b
--- /dev/null
+++ b/include/svtools/asynclink.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 SVTOOLS_ASYNCLINK_HXX
+#define SVTOOLS_ASYNCLINK_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/solar.h>
+#include <tools/link.hxx>
+#include <osl/mutex.hxx>
+
+class Timer;
+
+namespace svtools {
+
+class SVT_DLLPUBLIC AsynchronLink
+{
+ Link _aLink;
+ sal_uLong _nEventId;
+ Timer* _pTimer;
+ sal_Bool _bInCall;
+ sal_Bool* _pDeleted;
+ void* _pArg;
+ ::osl::Mutex* _pMutex;
+
+ DECL_DLLPRIVATE_STATIC_LINK( AsynchronLink, HandleCall, void* );
+ SVT_DLLPRIVATE void Call_Impl( void* pArg );
+
+public:
+ AsynchronLink( const Link& rLink ) :
+ _aLink( rLink ), _nEventId( 0 ), _pTimer( 0 ), _bInCall( sal_False ),
+ _pDeleted( 0 ), _pMutex( 0 ){}
+ AsynchronLink() : _nEventId( 0 ), _pTimer( 0 ), _bInCall( sal_False ),
+ _pDeleted( 0 ), _pMutex( 0 ){}
+ ~AsynchronLink();
+
+ void CreateMutex();
+ void operator=( const Link& rLink ) { _aLink = rLink; }
+ void Call( void* pObj, sal_Bool bAllowDoubles = sal_False,
+ sal_Bool bUseTimer = sal_False );
+ void ClearPendingCall( );
+ sal_Bool IsSet() const { return _aLink.IsSet(); }
+ Link GetLink() const { return _aLink; }
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/bindablecontrolhelper.hxx b/include/svtools/bindablecontrolhelper.hxx
new file mode 100644
index 000000000000..0fdea457d5f5
--- /dev/null
+++ b/include/svtools/bindablecontrolhelper.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 SVTOOLS_INC_BINDABLECONTROL_HXX
+#define SVTOOLS_INC_BINDABLECONTROL_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/frame/XModel.hpp>
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= GraphicAccess
+ //====================================================================
+ /** helper class for obtaining streams (which also can be used with the ImageProducer)
+ from a resource
+ */
+ class BindableControlHelper
+ {
+ private:
+ BindableControlHelper(); // never implemented
+
+ public:
+ SVT_DLLPUBLIC static void ApplyListSourceAndBindableData( const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& xModel, const com::sun::star::uno::Reference< com::sun::star::uno::XInterface >& rObj, const OUString& rsCtrlSource, const OUString& rsRowSource, sal_uInt16 nRefTab = 0 );
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVTOOLS_INC_BINDABLECONTROL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/borderhelper.hxx b/include/svtools/borderhelper.hxx
new file mode 100644
index 000000000000..77884bf2620a
--- /dev/null
+++ b/include/svtools/borderhelper.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 _BORDERHELPER_HXX
+#define _BORDERHELPER_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include <vcl/outdev.hxx>
+
+namespace svtools
+{
+ SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon,
+ sal_uInt16 nDashing, MapUnit eUnit );
+
+ SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon,
+ sal_uInt16 nDashing, MapUnit eUnit, double fScale );
+
+ SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const basegfx::B2DPoint& rBeg,
+ const basegfx::B2DPoint& rEnd, sal_uInt32 nWidth, sal_uInt16 nDashing );
+
+ SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const Point& rBeg,
+ const Point& rEnd, sal_uInt32 nWidth, sal_uInt16 nDashing );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
new file mode 100644
index 000000000000..128c57c699c2
--- /dev/null
+++ b/include/svtools/brwbox.hxx
@@ -0,0 +1,831 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_BRWBOX_HXX
+#define _SVX_BRWBOX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <vcl/scrbar.hxx>
+#include <vcl/ctrl.hxx>
+#include <tools/multisel.hxx>
+#include <svtools/headbar.hxx>
+#include <svtools/transfer.hxx>
+#include <svtools/AccessibleBrowseBoxObjType.hxx>
+#include <svtools/accessibletableprovider.hxx>
+#include <vector>
+
+#include <limits.h>
+#include <memory>
+
+class BrowserColumn;
+class BrowserDataWin;
+class MultiSelection;
+class BrowserHeader;
+
+typedef ::std::vector< BrowserColumn* > BrowserColumns;
+
+namespace svt {
+ class BrowseBoxImpl;
+ class IAccessibleFactory;
+}
+namespace utl {
+ class AccessibleStateSetHelper;
+}
+
+// -------------------
+// - BrowseBox-Types -
+// -------------------
+
+#define BROWSER_INVALIDID SAL_MAX_UINT16
+#define BROWSER_ENDOFSELECTION (static_cast<long>(SFX_ENDOFSELECTION))
+
+typedef sal_uLong BrowserMode;
+
+#define BROWSER_COLUMNSELECTION 0x0001
+#define BROWSER_MULTISELECTION 0x0002
+#define BROWSER_THUMBDRAGGING 0x0004
+#define BROWSER_KEEPHIGHLIGHT 0x0008
+#define BROWSER_KEEPSELECTION BROWSER_KEEPHIGHLIGHT // old, don't use!
+#define BROWSER_HLINES 0x0010
+#define BROWSER_VLINES 0x0020
+#define BROWSER_HLINESFULL BROWSER_HLINES // old, don't use!
+#define BROWSER_VLINESFULL BROWSER_VLINES // old, don't use!
+#define BROWSER_HLINESDOTS 0x0000 // old => don't use!
+#define BROWSER_VLINESDOTS 0x0000 // old => don't use!
+
+#define BROWSER_HIDESELECT 0x0100 // old => don't use!
+#define BROWSER_HIDECURSOR 0x0200
+
+#define BROWSER_NO_HSCROLL 0x0400
+#define BROWSER_NO_SCROLLBACK 0x0800
+
+#define BROWSER_AUTO_VSCROLL 0x1000
+#define BROWSER_AUTO_HSCROLL 0x2000
+
+#define BROWSER_TRACKING_TIPS 0x4000
+
+#define BROWSER_NO_VSCROLL 0x8000
+
+#define BROWSER_HIGHLIGHT_NONE 0x0100 // == BROWSER_HIDESELECT
+
+#define BROWSER_HEADERBAR_NEW 0x00040000
+#define BROWSER_AUTOSIZE_LASTCOL 0x00080000
+#define BROWSER_OWN_DATACHANGED 0x00100000
+
+#define BROWSER_CURSOR_WO_FOCUS 0x00200000
+ // Allows a cursor which is shown even if the control does not have the focus. This does not affect other
+ // situations which require to temporarily hide the cursor (such as scrolling).
+
+#define BROWSER_SMART_HIDECURSOR 0x00400000
+ // is an enhanced version of BROWSER_HIDECURSOR.
+ // When set, BROWSER_HIDECURSOR is overruled, and the cursor is hidden as long as no selection exists,
+ // but shown otherwise. This does not affect other situations which require to temporarily hide the
+ // cursor (such as scrolling).
+
+#define BROWSER_NONE 0
+#define BROWSER_SELECT 720
+#define BROWSER_ENHANCESELECTION 722
+#define BROWSER_SELECTDOWN 724
+#define BROWSER_SELECTUP 725
+#define BROWSER_CURSORDOWN 731
+#define BROWSER_CURSORUP 732
+#define BROWSER_CURSORLEFT 733
+#define BROWSER_CURSORRIGHT 734
+#define BROWSER_CURSORPAGEDOWN 735
+#define BROWSER_CURSORPAGEUP 736
+#define BROWSER_CURSORENDOFFILE 741
+#define BROWSER_CURSORTOPOFFILE 742
+#define BROWSER_CURSORENDOFSCREEN 743
+#define BROWSER_CURSORTOPOFSCREEN 744
+#define BROWSER_CURSORHOME 745
+#define BROWSER_CURSOREND 746
+#define BROWSER_SCROLLDOWN 751
+#define BROWSER_SCROLLUP 752
+#define BROWSER_SELECTHOME 753
+#define BROWSER_SELECTEND 754
+#define BROWSER_SELECTCOLUMN 755
+#define BROWSER_MOVECOLUMNLEFT 756
+#define BROWSER_MOVECOLUMNRIGHT 757
+
+// ---------------
+// - BrowseEvent -
+// ---------------
+
+class BrowseEvent
+{
+ Window* pWin;
+ long nRow;
+ Rectangle aRect;
+ sal_uInt16 nCol;
+ sal_uInt16 nColId;
+
+public:
+ BrowseEvent();
+ BrowseEvent( Window* pWindow,
+ long nAbsRow,
+ sal_uInt16 nColumn, sal_uInt16 nColumnId,
+ const Rectangle& rRect );
+
+ Window* GetWindow() const { return pWin; }
+ long GetRow() const { return nRow; }
+ sal_uInt16 GetColumn() const { return nCol; }
+ sal_uInt16 GetColumnId() const { return nColId; }
+ const Rectangle& GetRect() const { return aRect; }
+};
+
+// ---------------------
+// - BrowserMouseEvent -
+// ---------------------
+
+class BrowserMouseEvent: public MouseEvent, public BrowseEvent
+{
+public:
+ BrowserMouseEvent();
+ BrowserMouseEvent( BrowserDataWin* pWin, const MouseEvent& rEvt );
+ BrowserMouseEvent( Window* pWin, const MouseEvent& rEvt,
+ long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
+ const Rectangle& rRect );
+};
+
+// --------------------------
+// - BrowserAcceptDropEvent -
+// --------------------------
+
+class BrowserAcceptDropEvent : public AcceptDropEvent, public BrowseEvent
+{
+public:
+ BrowserAcceptDropEvent();
+ BrowserAcceptDropEvent( BrowserDataWin* pWin, const AcceptDropEvent& rEvt );
+};
+
+// ---------------------------
+// - BrowserExecuteDropEvent -
+// ---------------------------
+
+class BrowserExecuteDropEvent : public ExecuteDropEvent, public BrowseEvent
+{
+public:
+ BrowserExecuteDropEvent();
+ BrowserExecuteDropEvent( BrowserDataWin* pWin, const ExecuteDropEvent& rEvt );
+};
+
+// -------------
+// - BrowseBox -
+// -------------
+
+// TODO
+// The whole selection thingie in this class is somewhat .... suspicious to me.
+// some oddities:
+// * method parameters named like members (and used in both semantics within the method!)
+// * the multi selection flag is sometimes used as if it is for row selection, sometimes as if
+// it's for column selection, too (and sometimes in an even stranger way :)
+// * it is not really defined like all these hundreds selection related flags/methods work together
+// and influence each other. I do not understand it very well, but this may be my fault :)
+// * There is a GetColumnSelection, but it can't be used to determine the selected columns (at least
+// not without a const_cast)
+//
+// We should clearly define this somewhere in the future. Or, even better, we should re-implement this
+// whole class, which is planned for a long time :)
+//
+// sorry for the ranting. could not resist
+
+class SVT_DLLPUBLIC BrowseBox
+ :public Control
+ ,public DragSourceHelper
+ ,public DropTargetHelper
+ ,public svt::IAccessibleTableProvider
+{
+ #define NO_CURSOR_HIDE 0
+ #define HARD_CURSOR_HIDE 1
+ #define SMART_CURSOR_HIDE 2
+
+ friend class BrowserDataWin;
+ friend class ::svt::BrowseBoxImpl;
+
+#ifdef DBG_UTIL
+ friend const char* BrowseBoxCheckInvariants( const void * pVoid );
+#endif
+
+public:
+ static const sal_uInt16 HandleColumnId = 0;
+
+private:
+ Window* pDataWin; // window to display data rows
+ ScrollBar* pVScroll; // vertical scrollbar
+ ScrollBar aHScroll; // horizontal scrollbar
+
+ long nDataRowHeight; // height of a single data-row
+ sal_uInt16 nTitleLines; // number of lines in title row
+ sal_uLong nControlAreaWidth; // width of fixed area beneeth hscroll
+ sal_Bool bThumbDragging; // handle thumb dragging
+ sal_Bool bColumnCursor; // single columns and fields selectable
+ sal_Bool bMultiSelection;// allow multiple selected rows
+ sal_Bool bKeepHighlight; // don't hide selection on LoseFocus
+
+ sal_Bool bHLines; // draw lines between rows
+ sal_Bool bVLines; // draw lines between columns
+ sal_Bool bHDots; // draw lines between rows dotted
+ sal_Bool bVDots; // draw lines between columns dotted
+ Color aGridLineColor; // color for lines, default dark grey
+ sal_Bool bBootstrapped; // child windows resized etc.
+ long nTopRow; // no. of first visible row (0...)
+ long nCurRow; // no. of row with cursor
+ long nRowCount; // total number of rows in model
+ sal_uInt16 nFirstCol; // no. of first visible scrollable column
+ sal_uInt16 nCurColId; // column id of cursor
+
+ sal_Bool bSelecting;
+ sal_Bool bRowDividerDrag;
+ sal_Bool bHit;
+ sal_Bool mbInteractiveRowHeight;
+ Point a1stPoint;
+ Point a2ndPoint;
+
+ long nResizeX; // mouse position at start of resizing
+ long nMinResizeX; // never drag more left
+ long nDragX; // last dragged column (MouseMove)
+ sal_uInt16 nResizeCol; // resize this column in MouseMove
+ sal_Bool bResizing; // mouse captured for column resizing
+
+ sal_Bool bSelect; // select or deselect
+ sal_Bool bSelectionIsVisible; // depending on focus
+ sal_Bool bScrolling; // hidden cursor while scrolling
+ sal_Bool bNotToggleSel; // set while in ToggleSelection() etc.
+ sal_Bool bHasFocus; // set/unset in Get/LoseFocus
+ sal_Bool bHideSelect; // hide selection (highlight)
+ sal_Bool bHideCursor; // hide cursor (frame)
+ Range aSelRange; // for selection expansion
+
+ BrowserColumns* pCols; // array of column-descriptions
+ union
+ {
+ MultiSelection* pSel; // selected rows for multi-selection
+ long nSel; // selected row for single-selection
+ } uRow;
+ MultiSelection* pColSel; // selected column-ids
+
+ ::std::auto_ptr< ::svt::BrowseBoxImpl > m_pImpl; // impl structure of the BrowseBox object
+
+ sal_Bool m_bFocusOnlyCursor; // hide cursor if we don't have the focus
+ Color m_aCursorColor; // special color for cursor, COL_TRANSPARENT for usual (VCL-painted) "inverted" cursor
+ BrowserMode m_nCurrentMode; // last argument of SetMode (redundant, as our other members represent the current settings, too)
+
+private:
+ SVT_DLLPRIVATE void ConstructImpl(BrowserMode nMode);
+ SVT_DLLPRIVATE void ExpandRowSelection( const BrowserMouseEvent& rEvt );
+ SVT_DLLPRIVATE void ToggleSelection( sal_Bool bForce = sal_False );
+
+ SVT_DLLPRIVATE void UpdateScrollbars();
+ SVT_DLLPRIVATE void AutoSizeLastColumn();
+
+ SVT_DLLPRIVATE long ImpGetDataRowHeight() const;
+ SVT_DLLPRIVATE Rectangle ImplFieldRectPixel( long nRow, sal_uInt16 nColId ) const;
+ SVT_DLLPRIVATE sal_uInt16 FrozenColCount() const;
+
+ SVT_DLLPRIVATE void ColumnInserted( sal_uInt16 nPos );
+
+ DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * );
+ DECL_DLLPRIVATE_LINK( EndScrollHdl, void * );
+ DECL_DLLPRIVATE_LINK( StartDragHdl, HeaderBar * );
+
+ SVT_DLLPRIVATE long GetFrozenWidth() const;
+
+ sal_Bool GoToRow(long nRow, sal_Bool bRowColMove, sal_Bool bDoNotModifySelection = sal_False );
+
+ sal_Bool GoToColumnId( sal_uInt16 nColId, sal_Bool bMakeVisible, sal_Bool bRowColMove = sal_False);
+ void SelectColumnPos( sal_uInt16 nCol, sal_Bool _bSelect, sal_Bool bMakeVisible);
+ void SelectColumnId( sal_uInt16 nColId, sal_Bool _bSelect, sal_Bool bMakeVisible)
+ { SelectColumnPos( GetColumnPos(nColId), _bSelect, bMakeVisible); }
+
+ void ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_Bool _bForeignDevice, sal_Bool _bDrawSelections);
+
+ sal_Bool PaintCursorIfHiddenOnce() const { return !m_bFocusOnlyCursor && !HasFocus(); }
+
+ sal_uInt16 ToggleSelectedColumn();
+ void SetToggledSelectedColumn(sal_uInt16 _nSelectedColumnId);
+
+protected:
+ /// retrieves the XAccessible implementation associated with the BrowseBox instance
+ ::svt::IAccessibleFactory& getAccessibleFactory();
+
+protected:
+ sal_uInt16 ColCount() const;
+
+ // software plug for database access
+ // Der RowCount wird jetzt intern automatisch gezaehlt
+ // (ueber RowInserted und RowRemoved), daher ist das Ueberladen
+ // dieser Methode ueberfluessig!
+public:
+ virtual long GetRowCount() const;
+
+protected:
+ // fuer Anzeige im VScrollBar z.B. auf "?" oder setzen
+ void SetRealRowCount( const String &rRealRowCount );
+
+ // Return Value muss immer sal_True sein - SeekRow *muss* klappen!
+ // (sonst ASSERT) MI: wer hat das eingebaut? Das darf nicht so sein!
+
+ /** seeks for the given row position
+ @param nRow
+ nRow starts at 0
+ */
+ virtual sal_Bool SeekRow( long nRow ) = 0;
+ virtual void DrawCursor();
+ virtual void PaintRow( OutputDevice &rDev, const Rectangle &rRect );
+ virtual void PaintData( Window& rWin, const Rectangle& rRect );
+ virtual void PaintField( OutputDevice& rDev, const Rectangle& rRect,
+ sal_uInt16 nColumnId ) const = 0;
+ // Benachrichtigung an die abgeleitete Klasse, dass sich der sichtbare
+ // Bereich von Rows geaendert hat. Aus dieser Methode heraus darf
+ // die abgeleitete Klasse Aenderungen des Model mit Hilfe der Methoden
+ // RowInserted und RowRemoved bekanntgeben. Mit sich daraus ergebenden
+ // neuen Zustand wird anschliessend ein Paint veranlasst (und entsprechend
+ // SeekRow etc. gerufen).
+ //
+ // Parameter: nNewTopRow: Nr. der neuen TopRow (kann von VisibleRowsChanged
+ // durch Aufruf von RowInserted und RowDeleted noch veraendert werden).
+ // nNumRows: Anzahl der sichtbaren Rows (auch eine teilweise sichtbare Row
+ // wird mitgezaehlt).
+ //
+ // Moegliche Ursachen fuer die Aenderung des sichtbaren Bereiches:
+ // - Vor dem sichtbaren Bereich sind Rows eingefuegt oder geloescht worden,
+ // dadurch aendert sich nur die Numerierung der sichtbaren Rows
+ // - Scrollen (und daraus resultierend eine andere erste sichtbare Row)
+ // - Resize des Fensters
+ virtual void VisibleRowsChanged( long nNewTopRow, sal_uInt16 nNumRows);
+
+ // Anzahl sichtbarer Rows in dem Fenster (inkl. "angeschnittener" Rows)
+ sal_uInt16 GetVisibleRows()
+ { return (sal_uInt16)((pDataWin->GetOutputSizePixel().Height() - 1 )/ GetDataRowHeight() + 1); }
+ long GetTopRow() { return nTopRow; }
+ sal_uInt16 GetFirstVisibleColNumber() const { return nFirstCol; }
+
+ // Focus-Rect ein-/ausschalten
+ void DoShowCursor( const char *pWhoLog );
+ void DoHideCursor( const char *pWhoLog );
+ short GetCursorHideCount() const;
+
+ virtual BrowserHeader* CreateHeaderBar( BrowseBox* pParent );
+
+ // HACK(virtuelles Create wird im Ctor nicht gerufen)
+ void SetHeaderBar( BrowserHeader* );
+
+ long CalcReverseZoom(long nVal);
+
+ inline const DataFlavorExVector&
+ GetDataFlavors() const;
+
+ sal_Bool IsDropFormatSupported( SotFormatStringId nFormat ); // need this because the base class' IsDropFormatSupported is not const ...
+ sal_Bool IsDropFormatSupported( SotFormatStringId nFormat ) const;
+
+ sal_Bool IsDropFormatSupported( const css::datatransfer::DataFlavor& _rFlavor ); // need this because the base class' IsDropFormatSupported is not const ...
+ sal_Bool IsDropFormatSupported( const css::datatransfer::DataFlavor& _rFlavor ) const;
+
+private:
+ void* implGetDataFlavors() const;
+ // with this we can make GetDataFlavors() inline, which is strongly needed as SVTOOLS does not export
+ // any sysbols containing an "_STL", so a non-inlined method would not be exported ....
+
+protected:
+ // callbacks for the data window
+ virtual void ImplStartTracking();
+ virtual void ImplTracking();
+ virtual void ImplEndTracking();
+
+public:
+ BrowseBox( Window* pParent, WinBits nBits = 0,
+ BrowserMode nMode = 0 );
+ BrowseBox( Window* pParent, const ResId& rId,
+ BrowserMode nMode = 0 );
+ ~BrowseBox();
+
+ // ererbte ueberladene Handler
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void MouseButtonDown( const MouseEvent& rEvt );
+ virtual void MouseMove( const MouseEvent& rEvt );
+ virtual void MouseButtonUp( const MouseEvent& rEvt );
+ virtual void KeyInput( const KeyEvent& rEvt );
+ virtual void LoseFocus();
+ virtual void GetFocus();
+ virtual void Resize();
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Command( const CommandEvent& rEvt );
+ virtual void StartDrag( sal_Int8 _nAction, const Point& _rPosPixel );
+
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); // will forward everything got to the second AcceptDrop method
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); // will forward everything got to the second ExecuteDrop method
+
+ virtual sal_Int8 AcceptDrop( const BrowserAcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const BrowserExecuteDropEvent& rEvt );
+
+ // neue Handler
+ virtual void MouseButtonDown( const BrowserMouseEvent& rEvt );
+ virtual void MouseMove( const BrowserMouseEvent& rEvt );
+ virtual void MouseButtonUp( const BrowserMouseEvent& rEvt );
+ virtual void StartScroll();
+ virtual void EndScroll();
+ virtual void Select();
+ virtual void DoubleClick( const BrowserMouseEvent& rEvt );
+ virtual sal_Bool IsCursorMoveAllowed( long nNewRow, sal_uInt16 nNewColId ) const;
+ virtual void CursorMoved();
+ virtual void ColumnMoved( sal_uInt16 nColId );
+ virtual void ColumnResized( sal_uInt16 nColId );
+ virtual long QueryColumnResize( sal_uInt16 nColId, long nWidth );
+ /// called when the row height has been changed interactively
+ virtual void RowHeightChanged();
+ virtual long QueryMinimumRowHeight();
+
+ // Window-Control (pass to DataWindow)
+ void SetUpdateMode( sal_Bool bUpdate );
+ sal_Bool GetUpdateMode() const;
+
+ // map-mode and font control
+ void SetFont( const Font& rNewFont );
+ const Font& GetFont() const { return pDataWin->GetFont(); }
+ void SetTitleFont( const Font& rNewFont )
+ { Control::SetFont( rNewFont ); }
+ const Font& GetTitleFont() const { return Control::GetFont(); }
+
+ // color for line painting
+ void SetGridLineColor(const Color& rColor) {aGridLineColor = rColor;}
+ const Color& GetGridLineColor() const {return aGridLineColor;}
+
+ // inserting, changing, removing and freezing of columns
+ void InsertHandleColumn( sal_uLong nWidth );
+ void InsertDataColumn( sal_uInt16 nItemId, const XubString& rText,
+ long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
+ sal_uInt16 nPos = HEADERBAR_APPEND );
+ void SetColumnTitle( sal_uInt16 nColumnId, const String &rTitle );
+ void SetColumnWidth( sal_uInt16 nColumnId, sal_uLong nWidth );
+ void SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos );
+ void FreezeColumn( sal_uInt16 nColumnId, sal_Bool bFreeze = sal_True );
+ void UnfreezeColumns();
+ void RemoveColumn( sal_uInt16 nColumnId );
+ void RemoveColumns();
+
+ // control of title and data row height
+ void SetDataRowHeight( long nPixel );
+ long GetDataRowHeight() const;
+ void SetTitleLines( sal_uInt16 nLines );
+ sal_uInt16 GetTitleLines() const { return nTitleLines; }
+ virtual long GetTitleHeight() const;
+
+ // access to dynamic values of cursor row
+ String GetColumnTitle( sal_uInt16 nColumnId ) const;
+ Rectangle GetFieldRect( sal_uInt16 nColumnId ) const;
+ sal_uLong GetColumnWidth( sal_uInt16 nColumnId ) const;
+ sal_uInt16 GetColumnId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetColumnPos( sal_uInt16 nColumnId ) const;
+ sal_Bool IsFrozen( sal_uInt16 nColumnId ) const;
+
+ // movement of visible area
+ void ResetScroll();
+ long ScrollColumns( long nColumns );
+ long ScrollRows( long nRows );
+ sal_Bool MakeFieldVisible( long nRow, sal_uInt16 nColId, sal_Bool bComplete = sal_False );
+
+ // access and movement of cursor
+ long GetCurRow() const { return nCurRow; }
+ sal_uInt16 GetCurColumnId() const { return nCurColId; }
+ sal_Bool GoToRow( long nRow );
+ sal_Bool GoToColumnId( sal_uInt16 nColId );
+ sal_Bool GoToRowColumnId( long nRow, sal_uInt16 nColId );
+
+ // selections
+ virtual void SetNoSelection();
+ virtual void SelectAll();
+ virtual void SelectRow( long nRow, sal_Bool _bSelect = sal_True, sal_Bool bExpand = sal_True );
+ void SelectColumnPos( sal_uInt16 nCol, sal_Bool _bSelect = sal_True )
+ { SelectColumnPos( nCol, _bSelect, sal_True); }
+ void SelectColumnId( sal_uInt16 nColId, sal_Bool _bSelect = sal_True )
+ { SelectColumnPos( GetColumnPos(nColId), _bSelect, sal_True); }
+ long GetSelectRowCount() const;
+ sal_uInt16 GetSelectColumnCount() const;
+ virtual bool IsRowSelected( long nRow ) const;
+ bool IsColumnSelected( sal_uInt16 nColumnId ) const;
+ long FirstSelectedRow( sal_Bool bInverse = sal_False );
+ long LastSelectedRow();
+ long NextSelectedRow();
+ const MultiSelection* GetColumnSelection() const { return pColSel; }
+ const MultiSelection* GetSelection() const
+ { return bMultiSelection ? uRow.pSel : 0; }
+
+ long FirstSelectedColumn( ) const;
+
+ sal_Bool IsResizing() const { return bResizing; }
+
+ // access to positions of fields, column and rows
+ Window& GetDataWindow() const { return *pDataWin; }
+ Rectangle GetRowRectPixel( long nRow,
+ sal_Bool bRelToBrowser = sal_True ) const;
+ Rectangle GetFieldRectPixel( long nRow, sal_uInt16 nColId,
+ sal_Bool bRelToBrowser = sal_True) const;
+ sal_Bool IsFieldVisible( long nRow, sal_uInt16 nColId,
+ sal_Bool bComplete = sal_False ) const;
+ long GetRowAtYPosPixel( long nY,
+ sal_Bool bRelToBrowser = sal_True ) const;
+ sal_uInt16 GetColumnAtXPosPixel( long nX,
+ sal_Bool bRelToBrowser = sal_True ) const;
+
+ // invalidations
+ void Clear();
+ void RowRemoved( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True );
+ void RowModified( long nRow, sal_uInt16 nColId = BROWSER_INVALIDID );
+ void RowInserted( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True, sal_Bool bKeepSelection = sal_False );
+
+ // miscellanous
+ void ReserveControlArea( sal_uInt16 nWidth = USHRT_MAX );
+ Rectangle GetControlArea() const;
+ sal_Bool ProcessKey( const KeyEvent& rEvt );
+ void Dispatch( sal_uInt16 nId );
+ void SetMode( BrowserMode nMode = 0 );
+ BrowserMode GetMode( ) const { return m_nCurrentMode; }
+
+ void SetCursorColor(const Color& _rCol);
+ Color GetCursorColor() const { return m_aCursorColor; }
+ void ResetSelecting() { bSelecting = sal_False; }
+
+ /** specifies that the user is allowed to interactively change the height of a row,
+ by simply dragging an arbitrary row separator.
+
+ Note that this works only if there's a handle column, since only in this case,
+ there *is* something for the user to click onto
+ */
+ void EnableInteractiveRowHeight( sal_Bool _bEnable = sal_True ) { mbInteractiveRowHeight = _bEnable; }
+ sal_Bool IsInteractiveRowHeightEnabled( ) const { return mbInteractiveRowHeight; }
+
+ /// access to selected methods, to be granted to the BrowserColumn
+ struct BrowserColumnAccess { friend class BrowserColumn; private: BrowserColumnAccess() { } };
+ /** public version of PaintField, with selected access rights for the BrowserColumn
+ */
+ void DoPaintField( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId, BrowserColumnAccess ) const
+ { PaintField( rDev, rRect, nColumnId ); }
+
+ /** suggests a default width for a column containing a given text
+
+ The width is calculated so that the text fits completely, plus som margin.
+ */
+ sal_uLong GetDefaultColumnWidth( const String& _rText ) const;
+
+ /** 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 String GetCellText(long _nRow, sal_uInt16 _nColId) const;
+
+ /** @return
+ the current column count
+ */
+ sal_uInt16 GetColumnCount() const { return ColCount(); }
+
+ /** commitBrowseBoxEvent commit the event at all listeners of the browsebox
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ void commitBrowseBoxEvent(sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue);
+
+ /** commitTableEvent commit the event at all listeners of the table
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ void commitTableEvent(sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue);
+
+ /** fires an AccessibleEvent relative to a header bar AccessibleContext
+
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ void commitHeaderBarEvent(sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue,
+ sal_Bool _bColumnHeaderBar
+ );
+
+ /** returns the Rectangle for either the column header bar ot the row header bar
+ @param _bIsColumnBar
+ <TRUE/> when column header bar is used
+ @param _bOnScreen
+ <TRUE/> when the rectangle should be calculated OnScreen
+ @return
+ the Rectangle
+ */
+ virtual Rectangle calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen = sal_True);
+
+ /** calculates the Rectangle of the table
+ @param _bOnScreen
+ <TRUE/> when the rectangle should be calculated OnScreen
+ @return
+ the Rectangle
+ */
+ virtual Rectangle calcTableRect(sal_Bool _bOnScreen = sal_True);
+
+ /**
+ @param _nRowId
+ the current row
+ @param _nColId
+ the column id
+ @param _bOnScreen
+ <TRUE/> when the rectangle should be calculated OnScreen
+ @return
+ the Rectangle
+ */
+ virtual Rectangle GetFieldRectPixelAbs(sal_Int32 _nRowId,sal_uInt16 _nColId, sal_Bool _bIsHeader, sal_Bool _bOnScreen = sal_True);
+
+ /// return <TRUE/> if and only if the accessible object for this instance has been created and is alive
+ sal_Bool isAccessibleAlive( ) const;
+
+ // ACCESSIBILITY ==========================================================
+public:
+ /** Creates and returns the accessible object of the whole BrowseBox. */
+ virtual css::uno::Reference<
+ css::accessibility::XAccessible > CreateAccessible();
+
+ // Children ---------------------------------------------------------------
+
+ /** Creates the accessible object of a data table cell.
+ @param nRow The row index of the cell.
+ @param nColumnId The column pos of the cell.
+ @return The XAccessible interface of the specified cell. */
+ virtual css::uno::Reference<
+ css::accessibility::XAccessible >
+ CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnPos );
+
+ /** Creates the accessible object of a row header.
+ @param nRow The row index of the header.
+ @return The XAccessible interface of the specified row header. */
+ virtual css::uno::Reference<
+ css::accessibility::XAccessible >
+ CreateAccessibleRowHeader( sal_Int32 nRow );
+
+ /** Creates the accessible object of a column header.
+ @param nColumnId The column ID of the header.
+ @return The XAccessible interface of the specified column header. */
+ virtual css::uno::Reference<
+ css::accessibility::XAccessible >
+ CreateAccessibleColumnHeader( sal_uInt16 nColumnPos );
+
+ /** @return The count of additional controls of the control area. */
+ virtual sal_Int32 GetAccessibleControlCount() const;
+
+ /** 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 );
+
+ // Conversions ------------------------------------------------------------
+
+ /** Converts a point relative to the data window origin to a cell address.
+ @param rnRow Out-parameter that takes the row index.
+ @param rnColumnId Out-parameter that takes the column ID.
+ @param rPoint The position in pixels relative to the data window.
+ @return <TRUE/>, if the point could be converted to a valid address. */
+ virtual sal_Bool ConvertPointToCellAddress(
+ sal_Int32& rnRow, sal_uInt16& rnColumnId, const Point& rPoint );
+
+ /** Converts a point relative to the row header bar origin to a row header
+ index.
+ @param rnRow Out-parameter that takes the row index.
+ @param rPoint The position in pixels relative to the header bar.
+ @return <TRUE/>, if the point could be converted to a valid index. */
+ virtual sal_Bool ConvertPointToRowHeader( sal_Int32& rnRow, const Point& rPoint );
+
+ /** Converts a point relative to the column header bar origin to a column
+ header index.
+ @param rnColumnId Out-parameter that takes the column ID.
+ @param rPoint The position in pixels relative to the header bar.
+ @return <TRUE/>, if the point could be converted to a valid index. */
+ virtual sal_Bool ConvertPointToColumnHeader( sal_uInt16& rnColumnPos, const Point& rPoint );
+
+ /** Converts a point relative to the BrowseBox origin to the index of an
+ existing control.
+ @param rnRow Out-parameter that takes the 0-based control index.
+ @param rPoint The position in pixels relative to the BrowseBox.
+ @return <TRUE/>, if the point could be converted to a valid index. */
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& rnIndex, const Point& rPoint );
+
+ // Object data and state --------------------------------------------------
+
+ /** 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 colum/row cell
+ @return
+ The name of the specified object.
+ */
+ virtual OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const;
+
+ /** 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 colum/row cell
+ @return
+ The description of the specified object.
+ */
+ virtual OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const;
+
+ /** @return The header text of the specified row. */
+ virtual OUString GetRowDescription( sal_Int32 nRow ) const;
+
+ /** @return The header text of the specified column. */
+ virtual OUString GetColumnDescription( sal_uInt16 _nColumn ) const;
+
+ /** Fills the StateSet with all states (except DEFUNC and SHOWING, done by
+ the accessible object), depending on the specified object type. */
+ virtual void FillAccessibleStateSet(
+ ::utl::AccessibleStateSetHelper& rStateSet,
+ ::svt::AccessibleBrowseBoxObjType eObjType ) const;
+
+ /** Fills the StateSet with all states for one cell (except DEFUNC and SHOWING, done by
+ the accessible object). */
+ virtual void FillAccessibleStateSetForCell(
+ ::utl::AccessibleStateSetHelper& _rStateSet,
+ sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
+
+ /** Sets focus to current cell of the data table. */
+ virtual void GrabTableFocus();
+
+ // IAccessibleTableProvider
+ virtual sal_Int32 GetCurrRow() const;
+ virtual sal_uInt16 GetCurrColumn() const;
+ virtual sal_Bool HasRowHeader() const;
+ virtual sal_Bool IsCellFocusable() const;
+ virtual sal_Bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+ virtual void SelectColumn( sal_uInt16 _nColumn, sal_Bool _bSelect = sal_True );
+ virtual sal_Bool IsColumnSelected( long _nColumn ) const;
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual sal_Int32 GetSelectedColumnCount() const;
+ virtual void GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& _rRows ) const;
+ virtual void GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumns ) const;
+ virtual sal_Bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
+ virtual String GetAccessibleCellText(long _nRow, sal_uInt16 _nColPos) const;
+ virtual sal_Bool GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector );
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ virtual void GrabFocus();
+ virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True );
+ virtual Window* GetAccessibleParentWindow() const;
+ virtual Window* GetWindowInstance();
+
+private:
+ // the following declares some Window/OutputDevice methods private. This happened in the course
+ // of CWS warnings01, which pointed out nameclashs in those methods. If the build breaks in some
+ // upper module, you should investigate whether you really wanted to call base class methods,
+ // or the versions at this class. In the latter case, use the renamed versions above.
+
+ // Set/GetLineColor - superseded by Set/GetGridLineColor
+ using OutputDevice::SetLineColor;
+ using OutputDevice::GetLineColor;
+
+ // ToTop/ToBottom were never property implemented. If you currently call it, this is most probably wrong
+ // and not doing as intended
+ using Window::ToTop;
+};
+
+//-------------------------------------------------------------------
+inline const DataFlavorExVector& BrowseBox::GetDataFlavors() const
+{
+ return *reinterpret_cast<DataFlavorExVector*>(implGetDataFlavors());
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/brwhead.hxx b/include/svtools/brwhead.hxx
new file mode 100644
index 000000000000..6eaa06a5f62b
--- /dev/null
+++ b/include/svtools/brwhead.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 _BRWHEAD_HXX
+#define _BRWHEAD_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/headbar.hxx>
+
+class BrowseBox;
+
+//===================================================================
+
+class SVT_DLLPUBLIC BrowserHeader: public HeaderBar
+{
+ BrowseBox* _pBrowseBox;
+
+protected:
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Select();
+ virtual void EndDrag();
+
+public:
+ BrowserHeader( BrowseBox* pParent, WinBits nWinBits = WB_STDHEADERBAR | WB_DRAG );
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/calendar.hxx b/include/svtools/calendar.hxx
new file mode 100644
index 000000000000..2c41ae7ed929
--- /dev/null
+++ b/include/svtools/calendar.hxx
@@ -0,0 +1,451 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CALENDAR_HXX
+#define _CALENDAR_HXX
+
+#include "svtools/svtdllapi.h"
+#include <unotools/calendarwrapper.hxx>
+#include <com/sun/star/i18n/Weekdays.hpp>
+
+#include <vcl/ctrl.hxx>
+#include <vcl/timer.hxx>
+#include <vcl/field.hxx>
+#include <set>
+
+class MouseEvent;
+class TrackingEvent;
+class KeyEvent;
+class HelpEvent;
+class DataChangedEvent;
+class FloatingWindow;
+class PushButton;
+class ImplCFieldFloatWin;
+
+/*************************************************************************
+
+Description
+============
+
+class Calendar
+
+This class allows for the selection of a date. The displayed date range is
+the one specified by the Date class. We display as many months as we have
+space in the control. The user can switch between months using a ContextMenu
+(clicking on the month's name) or via two ScrollButtons in-between the months.
+
+--------------------------------------------------------------------------
+
+WinBits
+
+WB_BORDER We draw a border around the window.
+WB_TABSTOP Keyboard control is possible. We get the focus, when
+ the user clicks in the Control.
+WB_QUICKHELPSHOWSDATEINFO Show DateInfo as BallonHelp even if QuickInfo is enabled
+WB_BOLDTEXT We format by bold texts and DIB_BOLD is evaluated by
+ AddDateInfo()
+WB_FRAMEINFO We format in a way, so that FrameInfo can be displayed
+ and the FrameColor is evaluated by AddDateInfo()
+WB_RANGESELECT The user can select multiple days, which need to be
+ consecutive
+WB_MULTISELECT The user can select multiple days
+WB_WEEKNUMBER We also display the weekdays
+
+--------------------------------------------------------------------------
+
+We set and get the selected date by SetCurDate()/GetCurDate().
+If the user selects a date Select() is called. If the user double clicks
+DoubleClick() is called.
+
+--------------------------------------------------------------------------
+
+CalcWindowSizePixel() calculates the window size in pixel that is needed
+to display a certain number of months.
+
+--------------------------------------------------------------------------
+
+SetSaturdayColor() and SetSundayColor() set a special color for Saturdays
+and Sundays.
+AddDateInfo() marks special days. With that we can set e.g. public holidays
+to another color or encircle them (for e.g. appointments).
+If we do not supply a year in the date, the day is used in EVERY year.
+
+AddDateInfo() can also add text for every date, which is displayed if the
+BalloonHelp is enabled.
+In order to not have to supply all years with the relevant data, we call
+the RequestDateInfo() handler if a new year is displayed. We can then query
+the year in the handler with GetRequestYear().
+
+--------------------------------------------------------------------------
+
+In order to display a ContextMenu for a date, we need to override the
+Command handler. GetDate() can infer the date from the mouse's position.
+If we use the keyboard, the current date should be use.
+
+If a ContextMenu is displayed, the baseclass' handler must not be called.
+
+--------------------------------------------------------------------------
+
+For multiple selection (WB_RANGESELECT or WB_MULTISELECT) SelectDate(),
+SelectDateRange() can select date ranges. SelectDateRange() selects
+including the end date.
+SetNoSelection() deselects everything.
+SetCurDate() does not select the current date, but only defines the focus
+rectangle.
+GetSelectDateCount()/GetSelectDate() query the selected range.
+IsDateSelected() queries for the status of a date.
+
+The SelectionChanging() handler is being called while a user selects a
+date. In it, we can change the selected range. E.g. if we want to limit
+or extend the selected range. The selected range is realised via SelectDate()
+and SelectDateRange() and queried with GetSelectDateCount()/GetSelectDate().
+
+IsSelectLeft() returns the direction of the selection:
+sal_True is a selection to the left or up
+sal_False is a selection to the right or down
+
+--------------------------------------------------------------------------
+
+If the DateRange area changes and we want to take over the selection, we
+should only do this is if IsScrollDateRangeChanged() retruns sal_True.
+This method returns sal_True if the area change was triggered by using the
+ScrollButtons and sal_False if it was triggered by Resize(), other method
+calls or by ending a selection.
+
+*************************************************************************/
+
+// ------------------
+// - Calendar types -
+// ------------------
+
+#define WB_QUICKHELPSHOWSDATEINFO ((WinBits)0x00004000)
+#define WB_BOLDTEXT ((WinBits)0x00008000)
+#define WB_FRAMEINFO ((WinBits)0x00010000)
+#define WB_WEEKNUMBER ((WinBits)0x00020000)
+// Needs to in agreement with the WinBits in the TabBar or
+// we move it to \vcl\inc\wintypes.hxx
+#ifndef WB_RANGESELECT
+#define WB_RANGESELECT ((WinBits)0x00200000)
+#endif
+#ifndef WB_MULTISELECT
+#define WB_MULTISELECT ((WinBits)0x00400000)
+#endif
+
+#define DIB_BOLD ((sal_uInt16)0x0001)
+
+// ------------
+// - Calendar -
+// ------------
+
+typedef std::set<sal_uInt32> IntDateSet;
+
+
+class SVT_DLLPUBLIC Calendar : public Control
+{
+private:
+ IntDateSet* mpSelectTable;
+ IntDateSet* mpOldSelectTable;
+ IntDateSet* mpRestoreSelectTable;
+ OUString maDayTexts[31];
+ OUString maDayText;
+ OUString maWeekText;
+ CalendarWrapper maCalendarWrapper;
+ Rectangle maPrevRect;
+ Rectangle maNextRect;
+ String maDayOfWeekText;
+ sal_Int32 mnDayOfWeekAry[7];
+ Date maOldFormatFirstDate;
+ Date maOldFormatLastDate;
+ Date maFirstDate;
+ Date maOldFirstDate;
+ Date maCurDate;
+ Date maOldCurDate;
+ Date maAnchorDate;
+ Date maDropDate;
+ Color maSelColor;
+ Color maOtherColor;
+ Color* mpStandardColor;
+ Color* mpSaturdayColor;
+ Color* mpSundayColor;
+ sal_uLong mnDayCount;
+ long mnDaysOffX;
+ long mnWeekDayOffY;
+ long mnDaysOffY;
+ long mnMonthHeight;
+ long mnMonthWidth;
+ long mnMonthPerLine;
+ long mnLines;
+ long mnDayWidth;
+ long mnDayHeight;
+ long mnWeekWidth;
+ WinBits mnWinStyle;
+ sal_uInt16 mnFirstYear;
+ sal_uInt16 mnLastYear;
+ sal_uInt16 mnRequestYear;
+ sal_Bool mbCalc:1,
+ mbFormat:1,
+ mbDrag:1,
+ mbSelection:1,
+ mbMultiSelection:1,
+ mbWeekSel:1,
+ mbUnSel:1,
+ mbMenuDown:1,
+ mbSpinDown:1,
+ mbPrevIn:1,
+ mbNextIn:1,
+ mbDirect:1,
+ mbInSelChange:1,
+ mbTravelSelect:1,
+ mbScrollDateRange:1,
+ mbSelLeft:1,
+ mbAllSel:1,
+ mbDropPos:1;
+ Link maSelectionChangingHdl;
+ Link maDateRangeChangedHdl;
+ Link maRequestDateInfoHdl;
+ Link maDoubleClickHdl;
+ Link maSelectHdl;
+ Timer maDragScrollTimer;
+ sal_uInt16 mnDragScrollHitTest;
+
+#ifdef _SV_CALENDAR_CXX
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle );
+ SVT_DLLPRIVATE void ImplInitSettings();
+ SVT_DLLPRIVATE void ImplGetWeekFont( Font& rFont ) const;
+ SVT_DLLPRIVATE void ImplFormat();
+ using Window::ImplHitTest;
+ SVT_DLLPRIVATE sal_uInt16 ImplHitTest( const Point& rPos, Date& rDate ) const;
+ SVT_DLLPRIVATE void ImplDrawSpin( sal_Bool bDrawPrev = sal_True, sal_Bool bDrawNext = sal_True );
+ SVT_DLLPRIVATE void ImplDrawDate( long nX, long nY,
+ sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear,
+ DayOfWeek eDayOfWeek,
+ sal_Bool bBack = sal_True, sal_Bool bOther = sal_False,
+ sal_uLong nToday = 0 );
+ SVT_DLLPRIVATE void ImplDraw( sal_Bool bPaint = sal_False );
+ SVT_DLLPRIVATE void ImplUpdateDate( const Date& rDate );
+ SVT_DLLPRIVATE void ImplUpdateSelection( IntDateSet* pOld );
+ SVT_DLLPRIVATE void ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest,
+ sal_Bool bMove, sal_Bool bExpand, sal_Bool bExtended );
+ SVT_DLLPRIVATE void ImplUpdate( sal_Bool bCalcNew = sal_False );
+ using Window::ImplScroll;
+ SVT_DLLPRIVATE void ImplScroll( sal_Bool bPrev );
+ SVT_DLLPRIVATE void ImplInvertDropPos();
+ SVT_DLLPRIVATE void ImplShowMenu( const Point& rPos, const Date& rDate );
+ SVT_DLLPRIVATE void ImplTracking( const Point& rPos, sal_Bool bRepeat );
+ SVT_DLLPRIVATE void ImplEndTracking( sal_Bool bCancel );
+ SVT_DLLPRIVATE DayOfWeek ImplGetWeekStart() const;
+#endif
+
+protected:
+
+ DECL_STATIC_LINK( Calendar, ScrollHdl, Timer *);
+
+public:
+ Calendar( Window* pParent, WinBits nWinStyle = 0 );
+ ~Calendar();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void SelectionChanging();
+ virtual void DateRangeChanged();
+ virtual void RequestDateInfo();
+ virtual void DoubleClick();
+ virtual void Select();
+
+ const CalendarWrapper& GetCalendarWrapper() const { return maCalendarWrapper; }
+
+ void SelectDate( const Date& rDate, sal_Bool bSelect = sal_True );
+ void SetNoSelection();
+ sal_Bool IsDateSelected( const Date& rDate ) const;
+ Date GetFirstSelectedDate() const;
+ void EnableCallEverySelect( sal_Bool bEvery = sal_True ) { mbAllSel = bEvery; }
+ sal_Bool IsCallEverySelectEnabled() const { return mbAllSel; }
+
+ sal_uInt16 GetRequestYear() const { return mnRequestYear; }
+ void SetCurDate( const Date& rNewDate );
+ Date GetCurDate() const { return maCurDate; }
+ void SetFirstDate( const Date& rNewFirstDate );
+ Date GetFirstDate() const { return maFirstDate; }
+ Date GetLastDate() const { return GetFirstDate() + mnDayCount; }
+ sal_uLong GetDayCount() const { return mnDayCount; }
+ Date GetFirstMonth() const;
+ Date GetLastMonth() const;
+ sal_uInt16 GetMonthCount() const;
+ sal_Bool GetDate( const Point& rPos, Date& rDate ) const;
+ Rectangle GetDateRect( const Date& rDate ) const;
+
+ long GetCurMonthPerLine() const { return mnMonthPerLine; }
+ long GetCurLines() const { return mnLines; }
+
+ const Color& GetStandardColor() const;
+ const Color& GetSaturdayColor() const;
+ const Color& GetSundayColor() const;
+
+ void StartSelection();
+ void EndSelection();
+
+ sal_Bool IsTravelSelect() const { return mbTravelSelect; }
+ sal_Bool IsScrollDateRangeChanged() const { return mbScrollDateRange; }
+ sal_Bool IsSelectLeft() const { return mbSelLeft; }
+
+ Size CalcWindowSizePixel( long nCalcMonthPerLine = 1,
+ long nCalcLines = 1 ) const;
+
+ void SetSelectionChangingHdl( const Link& rLink ) { maSelectionChangingHdl = rLink; }
+ const Link& GetSelectionChangingHdl() const { return maSelectionChangingHdl; }
+ void SetDateRangeChangedHdl( const Link& rLink ) { maDateRangeChangedHdl = rLink; }
+ const Link& GetDateRangeChangedHdl() const { return maDateRangeChangedHdl; }
+ void SetRequestDateInfoHdl( const Link& rLink ) { maRequestDateInfoHdl = rLink; }
+ const Link& GetRequestDateInfoHdl() const { return maRequestDateInfoHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+};
+
+inline const Color& Calendar::GetStandardColor() const
+{
+ if ( mpStandardColor )
+ return *mpStandardColor;
+ else
+ return GetFont().GetColor();
+}
+
+inline const Color& Calendar::GetSaturdayColor() const
+{
+ if ( mpSaturdayColor )
+ return *mpSaturdayColor;
+ else
+ return GetFont().GetColor();
+}
+
+inline const Color& Calendar::GetSundayColor() const
+{
+ if ( mpSundayColor )
+ return *mpSundayColor;
+ else
+ return GetFont().GetColor();
+}
+
+/*************************************************************************
+
+Description
+============
+
+class CalendarField
+
+This class is a DateField with which one can select a date via a DropDownButton
+and the CalendarControl.
+
+--------------------------------------------------------------------------
+
+WinBits
+
+See DateField
+
+The preferences for the CalendarControl can be set via SetCalendarStyle().
+
+--------------------------------------------------------------------------
+
+With EnableToday()/EnableNone() we can enable a TodayButton and a NoneButton.
+
+--------------------------------------------------------------------------
+
+If we set WB_RANGESELECT with SetCalendarStyle(), we can select multiple days
+in the Calendar.
+
+Because we only take over the start date into the field, we should query
+with GetCalendar() in the SelectHandler and with GetSelectDateCount()/GetSelectDate()
+the selected range. We then can e.g. take over that value to another field.
+
+--------------------------------------------------------------------------
+
+If a derived Calendar should be used, we can override the CreateCalendar()
+method in CalendarField and create an own calendar there ourselves.
+
+*************************************************************************/
+
+// -----------------
+// - CalendarField -
+// -----------------
+
+class SVT_DLLPUBLIC CalendarField : public DateField
+{
+private:
+ ImplCFieldFloatWin* mpFloatWin;
+ Calendar* mpCalendar;
+ WinBits mnCalendarStyle;
+ PushButton* mpTodayBtn;
+ PushButton* mpNoneBtn;
+ Date maDefaultDate;
+ sal_Bool mbToday;
+ sal_Bool mbNone;
+ Link maSelectHdl;
+
+#ifdef _SV_CALENDAR_CXX
+ DECL_DLLPRIVATE_LINK( ImplSelectHdl, Calendar* );
+ DECL_DLLPRIVATE_LINK( ImplClickHdl, PushButton* );
+ DECL_DLLPRIVATE_LINK( ImplPopupModeEndHdl, void* );
+#endif
+
+public:
+ CalendarField( Window* pParent, WinBits nWinStyle );
+ ~CalendarField();
+
+ virtual void Select();
+
+ virtual sal_Bool ShowDropDown( sal_Bool bShow );
+ virtual Calendar* CreateCalendar( Window* pParent );
+ Calendar* GetCalendar();
+
+ void SetDefaultDate( const Date& rDate ) { maDefaultDate = rDate; }
+ Date GetDefaultDate() const { return maDefaultDate; }
+
+ void EnableToday( sal_Bool bToday = sal_True ) { mbToday = bToday; }
+ sal_Bool IsTodayEnabled() const { return mbToday; }
+ void EnableNone( sal_Bool bNone = sal_True ) { mbNone = bNone; }
+ sal_Bool IsNoneEnabled() const { return mbNone; }
+
+ void SetCalendarStyle( WinBits nStyle ) { mnCalendarStyle = nStyle; }
+ WinBits GetCalendarStyle() const { return mnCalendarStyle; }
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+
+protected:
+ virtual void StateChanged( StateChangedType nStateChange );
+};
+
+#endif // _CALENDAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/cliplistener.hxx b/include/svtools/cliplistener.hxx
new file mode 100644
index 000000000000..47ff64403dc6
--- /dev/null
+++ b/include/svtools/cliplistener.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 _CLIPLISTENER_HXX
+#define _CLIPLISTENER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
+
+class Window;
+
+
+class SVT_DLLPUBLIC TransferableClipboardListener : public ::cppu::WeakImplHelper1<
+ ::com::sun::star::datatransfer::clipboard::XClipboardListener >
+{
+ Link aLink;
+
+public:
+ // Link is called with a TransferableDataHelper pointer
+ TransferableClipboardListener( const Link& rCallback );
+ ~TransferableClipboardListener();
+
+ void AddRemoveListener( Window* pWin, sal_Bool bAdd );
+ void ClearCallbackLink();
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
+ throw(::com::sun::star::uno::RuntimeException);
+ // XClipboardListener
+ virtual void SAL_CALL changedContents( const ::com::sun::star::datatransfer::clipboard::ClipboardEvent& event )
+ throw(::com::sun::star::uno::RuntimeException);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/collatorres.hxx b/include/svtools/collatorres.hxx
new file mode 100644
index 000000000000..d8abf68ccf82
--- /dev/null
+++ b/include/svtools/collatorres.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 SVTOOLS_COLLATORRESOURCE_HXX
+#define SVTOOLS_COLLATORRESOURCE_HXX
+
+#include "svtools/svtdllapi.h"
+#include <rtl/ustring.hxx>
+
+class CollatorResourceData;
+
+class SVT_DLLPUBLIC CollatorResource
+{
+ private:
+
+ CollatorResourceData *mp_Data;
+
+ public:
+ CollatorResource();
+ ~CollatorResource();
+ const OUString& GetTranslation (const OUString& r_Algorithm);
+};
+
+#endif /* SVTOOLS_COLLATORRESOURCE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/colorcfg.hxx b/include/svtools/colorcfg.hxx
new file mode 100644
index 000000000000..2ea6649bdb8c
--- /dev/null
+++ b/include/svtools/colorcfg.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_SVTOOLS_COLORCFG_HXX
+#define INCLUDED_SVTOOLS_COLORCFG_HXX
+
+#include "svtools/svtdllapi.h"
+#include <rtl/ustring.hxx>
+#include <tools/color.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <unotools/options.hxx>
+
+//-----------------------------------------------------------------------------
+namespace svtools{
+enum ColorConfigEntry
+{
+ DOCCOLOR ,
+ DOCBOUNDARIES ,
+ APPBACKGROUND ,
+ OBJECTBOUNDARIES ,
+ TABLEBOUNDARIES ,
+ FONTCOLOR ,
+ LINKS ,
+ LINKSVISITED ,
+ SPELL ,
+ SMARTTAGS ,
+ SHADOWCOLOR ,
+ WRITERTEXTGRID ,
+ WRITERFIELDSHADINGS ,
+ WRITERIDXSHADINGS ,
+ WRITERDIRECTCURSOR ,
+ WRITERSCRIPTINDICATOR,
+ WRITERSECTIONBOUNDARIES,
+ WRITERHEADERFOOTERMARK,
+ WRITERPAGEBREAKS,
+ HTMLSGML ,
+ HTMLCOMMENT ,
+ HTMLKEYWORD ,
+ HTMLUNKNOWN ,
+ CALCGRID ,
+ CALCPAGEBREAK ,
+ CALCPAGEBREAKMANUAL,
+ CALCPAGEBREAKAUTOMATIC,
+ CALCDETECTIVE ,
+ CALCDETECTIVEERROR ,
+ CALCREFERENCE ,
+ CALCNOTESBACKGROUND ,
+ DRAWGRID ,
+ BASICIDENTIFIER,
+ BASICCOMMENT ,
+ BASICNUMBER ,
+ BASICSTRING ,
+ BASICOPERATOR ,
+ BASICKEYWORD ,
+ BASICERROR ,
+ SQLIDENTIFIER,
+ SQLNUMBER,
+ SQLSTRING,
+ SQLOPERATOR,
+ SQLKEYWORD,
+ SQLPARAMETER,
+ SQLCOMMENT,
+ ColorConfigEntryCount
+};
+
+class ColorConfig_Impl;
+struct ColorConfigValue
+{
+
+ sal_Bool bIsVisible; //validity depends on the element type
+ sal_Int32 nColor;
+ ColorConfigValue() : bIsVisible(sal_False), nColor(0) {}
+ sal_Bool operator !=(const ColorConfigValue& rCmp) const
+ { return nColor != rCmp.nColor || bIsVisible != rCmp.bIsVisible;}
+};
+
+class SVT_DLLPUBLIC ColorConfig:
+ public utl::detail::Options
+{
+ friend class ColorConfig_Impl;
+private:
+ static ColorConfig_Impl* m_pImpl;
+public:
+ ColorConfig();
+ virtual ~ColorConfig();
+
+ // get the configured value - if bSmart is set the default color setting is provided
+ // instead of the automatic color
+ ColorConfigValue GetColorValue(ColorConfigEntry eEntry, sal_Bool bSmart = sal_True)const;
+ static Color GetDefaultColor(ColorConfigEntry eEntry);
+};
+
+class SVT_DLLPUBLIC EditableColorConfig
+{
+ ColorConfig_Impl* m_pImpl;
+ sal_Bool m_bModified;
+public:
+ EditableColorConfig();
+ ~EditableColorConfig();
+
+ ::com::sun::star::uno::Sequence< OUString > GetSchemeNames() const;
+ void DeleteScheme(const OUString& rScheme );
+ void AddScheme(const OUString& rScheme );
+ sal_Bool LoadScheme(const OUString& rScheme );
+ const OUString& GetCurrentSchemeName()const;
+ void SetCurrentSchemeName(const OUString& rScheme);
+
+ const ColorConfigValue& GetColorValue(ColorConfigEntry eEntry)const;
+ void SetColorValue(ColorConfigEntry eEntry, const ColorConfigValue& rValue);
+ void SetModified();
+ void ClearModified(){m_bModified = sal_False;}
+ sal_Bool IsModified()const{return m_bModified;}
+ void Commit();
+
+ void DisableBroadcast();
+ void EnableBroadcast();
+};
+}//namespace svtools
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/colrdlg.hxx b/include/svtools/colrdlg.hxx
new file mode 100644
index 000000000000..ce155302865b
--- /dev/null
+++ b/include/svtools/colrdlg.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 _SV_COLRDLG_HXX
+#define _SV_COLRDLG_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <tools/color.hxx>
+
+class Window;
+
+// ---------------
+// - ColorDialog -
+// ---------------
+
+namespace svtools
+{
+ // SELECT is the default
+ enum ColorPickerMode { ColorPickerMode_SELECT = 0, ColorPickerMode_ADD = 1, ColorPickerMode_MODIFY = 2 };
+}
+
+class SVT_DLLPUBLIC SvColorDialog
+{
+public:
+ SvColorDialog( ::Window* pParent );
+ virtual ~SvColorDialog();
+
+ void SetColor( const Color& rColor );
+ const Color& GetColor() const;
+
+ void SetMode( sal_Int16 eMode );
+
+ virtual short Execute();
+
+private:
+ Window* mpParent;
+ Color maColor;
+ sal_Int16 meMode;
+};
+
+#endif // _SV_COLRDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/contextmenuhelper.hxx b/include/svtools/contextmenuhelper.hxx
new file mode 100644
index 000000000000..258da5dedbfb
--- /dev/null
+++ b/include/svtools/contextmenuhelper.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_SVTOOLS_CONTEXTMENUHELPER_HXX
+#define INCLUDED_SVTOOLS_CONTEXTMENUHELPER_HXX
+
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/awt/XPopupMenu.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/ui/XImageManager.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+
+#include <rtl/ustring.hxx>
+#include <cppuhelper/weak.hxx>
+#include <vcl/menu.hxx>
+#include "svtools/svtdllapi.h"
+
+namespace svt
+{
+
+/**
+ Context menu helper class.
+
+ Fills images and labels for a provided popup menu or
+ com.sun.star.awt.XPopupMenu.
+
+ PRECONDITION:
+ All commands must be set via SetItemCommand and are part
+ of the configuration files
+ (see org.openoffice.Office.UI.[Module]Commands.xcu)
+*/
+struct ExecuteInfo;
+class SVT_DLLPUBLIC ContextMenuHelper
+{
+ public:
+ // create context menu helper
+ // ARGS: xFrame = frame defines the context of the context menu
+ // bAutoRefresh = specifies that the context will be constant or not
+ ContextMenuHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, bool bAutoRefresh=true );
+ ~ContextMenuHelper();
+
+ // methods to complete a popup menu (set images, labels, enable/disable states)
+ // ATTENTION: The item ID's must be unique for the whole popup (inclusive the sub menus!)
+ void completeAndExecute( const Point& aPos, PopupMenu& aPopupMenu );
+ void completeAndExecute( const Point& aPos, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& xPopupMenu );
+
+ private:
+ // asynchronous link to prevent destruction while on stack
+ DECL_STATIC_LINK( ContextMenuHelper, ExecuteHdl_Impl, ExecuteInfo* );
+
+ // no copy-ctor and operator=
+ ContextMenuHelper( const ContextMenuHelper& );
+ const ContextMenuHelper& operator=( const ContextMenuHelper& );
+
+ // show context menu and dispatch command automatically
+ void executePopupMenu( const Point& aPos, PopupMenu* pMenu );
+
+ // fill image and label for every menu item on the provided menu
+ void completeMenuProperties( Menu* pMenu );
+
+ // dispatch provided command
+ bool dispatchCommand( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const OUString& aCommandURL );
+
+
+ // methods to retrieve a single command URL dependent value from a
+ // ui configuratin manager
+ Image getImageFromCommandURL( const OUString& aCmdURL ) const;
+ OUString getLabelFromCommandURL( const OUString& aCmdURL ) const;
+
+ // creates an association between current module/controller bound to the
+ // provided frame and their ui configuration managers.
+ bool associateUIConfigurationManagers();
+
+ // resets associations to create associations again on-demand.
+ // Useful for implementations which recycle frames. Normal
+ // implementations can profit from caching and should set
+ // auto refresh on ctor to false (default).
+ void resetAssociations()
+ {
+ if ( m_bAutoRefresh )
+ m_bUICfgMgrAssociated = false;
+ }
+
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XFrame > m_xWeakFrame;
+ OUString m_aModuleIdentifier;
+ OUString m_aSelf;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aDefaultArgs;
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::XImageManager > m_xDocImageMgr;
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::XImageManager > m_xModuleImageMgr;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xUICommandLabels;
+ bool m_bAutoRefresh;
+ bool m_bUICfgMgrAssociated;
+};
+
+} // namespace svt
+
+#endif // INCLUDED_SVTOOLS_CONTEXTMENUHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/controldims.hrc b/include/svtools/controldims.hrc
new file mode 100644
index 000000000000..2d01ddc668e1
--- /dev/null
+++ b/include/svtools/controldims.hrc
@@ -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 _SVT_CONTROLDIMS_HRC_
+#define _SVT_CONTROLDIMS_HRC_
+
+//
+// From: Dialogue Specification and Guidelines - Visual Design V1.3
+// by Christian Jansen
+//
+
+//
+// Usage:
+// ======
+//
+// all values have to be mapped by MAP_APPFONT
+//
+
+// Base
+#define RSC_BS_CHARHEIGHT 8
+#define RSC_BS_CHARWIDTH 4
+
+// control dimensions
+#define RSC_CD_PUSHBUTTON_WIDTH 50
+#define RSC_CD_PUSHBUTTON_HEIGHT 14
+
+#define RSC_CD_FIXEDTEXT_HEIGHT RSC_BS_CHARHEIGHT
+#define RSC_CD_FIXEDLINE_HEIGHT RSC_BS_CHARHEIGHT
+#define RSC_CD_FIXEDLINE_WIDTH RSC_BS_CHARWIDTH // for vertical FixedLines
+
+#define RSC_CD_DROPDOWN_HEIGHT 12 // also combobox and dropdown list
+#define RSC_CD_TEXTBOX_HEIGHT 12 // also numeric fields etc.
+
+#define RSC_CD_CHECKBOX_HEIGHT 10 // also tristate
+#define RSC_CD_RADIOBUTTON_HEIGHT 10
+
+// spacings
+#define RSC_SP_CTRL_X 6 // controls that are unrelated
+#define RSC_SP_CTRL_Y 7
+#define RSC_SP_CTRL_GROUP_X 3 // related controls, or controls in a groupbox
+#define RSC_SP_CTRL_GROUP_Y 4
+#define RSC_SP_CTRL_DESC_X 3 // between description text and related control
+#define RSC_SP_CTRL_DESC_Y 3
+
+// overruled spacings between certain controls
+#define RSC_SP_FLGR_SPACE_X 6 // between groupings made with FixedLine
+#define RSC_SP_FLGR_SPACE_Y 4
+#define RSC_SP_GRP_SPACE_X 6 // between groupings made with GroupBox
+#define RSC_SP_GRP_SPACE_Y 6
+#define RSC_SP_CHK_TEXTINDENT 8 // x indent of text aligned to checkbox title
+
+// dialog inner border
+#define RSC_SP_DLG_INNERBORDER_LEFT 6
+#define RSC_SP_DLG_INNERBORDER_TOP 6
+#define RSC_SP_DLG_INNERBORDER_RIGHT 6
+#define RSC_SP_DLG_INNERBORDER_BOTTOM 6
+
+// tab page inner border
+#define RSC_SP_TBPG_INNERBORDER_LEFT 6 // for tabpage groupings
+#define RSC_SP_TBPG_INNERBORDER_TOP 3
+#define RSC_SP_TBPG_INNERBORDER_RIGHT 6
+#define RSC_SP_TBPG_INNERBORDER_BOTTOM 6
+
+// FixedLine group inner border
+#define RSC_SP_FLGR_INNERBORDER_LEFT 6 // for FixedLine groupings
+#define RSC_SP_FLGR_INNERBORDER_TOP 3
+#define RSC_SP_FLGR_INNERBORDER_RIGHT 0
+#define RSC_SP_FLGR_INNERBORDER_BOTTOM 0
+
+// GroupBox inner border
+#define RSC_SP_GRP_INNERBORDER_LEFT 6 // for GroupBox groupings
+#define RSC_SP_GRP_INNERBORDER_TOP 6
+#define RSC_SP_GRP_INNERBORDER_RIGHT 6
+
+#endif // _SVT_CONTROLDIMS_HRC_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx
new file mode 100644
index 000000000000..39e5bb02bcc0
--- /dev/null
+++ b/include/svtools/ctrlbox.hxx
@@ -0,0 +1,552 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CTRLBOX_HXX
+#define _CTRLBOX_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <tools/string.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/combobox.hxx>
+#include <vcl/image.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/metric.hxx>
+#include <vcl/field.hxx>
+
+class FontList;
+class ImplColorListData;
+class ImpLineListData;
+
+typedef ::std::vector< ImplColorListData* > ImpColorList;
+typedef ::std::vector< ImpLineListData* > ImpLineList;
+typedef ::std::vector< FontInfo > ImplFontList;
+
+// FIXME: STYLE_* duplicate values from editeng::SvxBorderStyle,
+// which in turn duplicates values from com::sun::star::table::BorderLineStyle:
+// this needs cleaning up on master
+#define STYLE_SOLID ( ( sal_uInt16 ) 0 )
+#define STYLE_DOTTED ( ( sal_uInt16 ) 1 )
+#define STYLE_DASHED ( ( sal_uInt16 ) 2 )
+#define STYLE_FINE_DASHED ( ( sal_uInt16 ) 14 )
+#define STYLE_NONE ( ( sal_uInt16 ) -1)
+
+#define CHANGE_LINE1 ( ( sal_uInt16 ) 1 )
+#define CHANGE_LINE2 ( ( sal_uInt16 ) 2 )
+#define CHANGE_DIST ( ( sal_uInt16 ) 4 )
+#define ADAPT_DIST ( ( sal_uInt16 ) 8 )
+
+
+
+/*************************************************************************
+
+Description
+============
+
+class ColorListBox
+
+Description
+
+Allows color selection
+
+--------------------------------------------------------------------------
+
+class LineListBox
+
+Description
+
+Allows selection of line styles and sizes. Not that before first insert,
+units and window size need to be set. Supported units are typographic point
+(pt) and millimeters (mm). For SourceUnit, pt, mm and twips are supported.
+All scalar numbers in 1/100 of the corresponding unit.
+
+Line1 is the outer, Line2 the inner line, Distance is the distance between
+these two lines. If Line2 == 0, only Line1 will be shown. Defaults for
+source and target unit are FUNIT_POINT.
+
+SetColor() sets the line color.
+
+Remarks
+
+Contrary to a simple ListBox, user-specific data are not supported.
+If UpdateMode is disabled, no data should be read, no selections
+should be set, and the return code shall be ignore, as in these are
+not defined in this mode. Also the bit WinBit WB_SORT may not be set.
+
+--------------------------------------------------------------------------
+
+class FontNameBox
+
+Description
+
+Allows selection of fonts. The ListBox will be filled using Fill parameter,
+which is pointer to an FontList object.
+
+Calling EnableWYSIWYG() enables rendering the font name in the currently
+selected font.
+
+See also
+
+FontList; FontStyleBox; FontSizeBox; FontNameMenu
+
+--------------------------------------------------------------------------
+
+class FontStyleBox
+
+Description
+
+Allows select of FontStyle's. The parameter Fill points to a list
+of available font styles for the font.
+
+Reproduced styles are always added - this could change in future, as
+potentially not all applications [Draw,Equation,FontWork] can properly
+handle synthetic fonts. On filling, the previous name will be retained
+if possible.
+
+For DontKnow, the FontStyleBox should be filled with String(),
+so it will contain a list with the default attributes. The currently
+shown style probably needs to be reset by the application.
+
+See also
+
+FontList; FontNameBox; FontSizeBox;
+
+--------------------------------------------------------------------------
+
+class FontSizeBox
+
+Description
+
+Allows selection of font sizes. The values are retrieved via GetValue()
+and set via SetValue(). The Fill parameter fills the ListBox with the
+available sizes for the passed font.
+
+All sizes are in 1/10 typographic point (pt).
+
+The passed FontList must be retained until the next fill call.
+
+Additionally it supports an relative mod, which allows entering
+percentage values. This, eg., can be useful for template dialogs.
+This mode can only be enabled, but not disabled again.
+
+For DontKnow the FontSizeBox should be filled FontInfo(), so it will
+contain an list with the standard sizes. Th currently shown size
+probably needs to be reset by the application.
+
+See also
+
+FontList; FontNameBox; FontStyleBox; FontSizeMenu
+
+*************************************************************************/
+
+// ----------------
+// - ColorListBox -
+// ----------------
+
+class SVT_DLLPUBLIC ColorListBox : public ListBox
+{
+ ImpColorList* pColorList; // separate liste, in case of user data are required from outside
+ Size aImageSize;
+
+#ifdef _CTRLBOX_CXX
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit();
+ SVT_DLLPRIVATE void ImplDestroyColorEntries();
+#endif
+public:
+ ColorListBox( Window* pParent,
+ WinBits nWinStyle = WB_BORDER );
+ ColorListBox( Window* pParent, const ResId& rResId );
+ virtual ~ColorListBox();
+
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ using ListBox::InsertEntry;
+ virtual sal_uInt16 InsertEntry( const XubString& rStr,
+ sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const Color& rColor, const XubString& rStr,
+ sal_uInt16 nPos = LISTBOX_APPEND );
+ void InsertAutomaticEntryColor(const Color &rAutoColorValue);
+ bool IsAutomaticSelected() { return !GetSelectEntryPos(); }
+ using ListBox::RemoveEntry;
+ virtual void RemoveEntry( sal_uInt16 nPos );
+ virtual void Clear();
+ void CopyEntries( const ColorListBox& rBox );
+
+ using ListBox::GetEntryPos;
+ virtual sal_uInt16 GetEntryPos( const Color& rColor ) const;
+ virtual Color GetEntryColor( sal_uInt16 nPos ) const;
+ Size GetImageSize() const { return aImageSize; }
+
+ void SelectEntry( const XubString& rStr, sal_Bool bSelect = sal_True )
+ { ListBox::SelectEntry( rStr, bSelect ); }
+ void SelectEntry( const Color& rColor, sal_Bool bSelect = sal_True );
+ XubString GetSelectEntry( sal_uInt16 nSelIndex = 0 ) const
+ { return ListBox::GetSelectEntry( nSelIndex ); }
+ Color GetSelectEntryColor( sal_uInt16 nSelIndex = 0 ) const;
+ sal_Bool IsEntrySelected( const XubString& rStr ) const
+ { return ListBox::IsEntrySelected( rStr ); }
+
+ sal_Bool IsEntrySelected( const Color& rColor ) const;
+
+private:
+ // declared as private because some compilers would generate the default functions
+ ColorListBox( const ColorListBox& );
+ ColorListBox& operator =( const ColorListBox& );
+
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
+};
+
+inline void ColorListBox::SelectEntry( const Color& rColor, sal_Bool bSelect )
+{
+ sal_uInt16 nPos = GetEntryPos( rColor );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ ListBox::SelectEntryPos( nPos, bSelect );
+}
+
+inline sal_Bool ColorListBox::IsEntrySelected( const Color& rColor ) const
+{
+ sal_uInt16 nPos = GetEntryPos( rColor );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ return IsEntryPosSelected( nPos );
+ else
+ return sal_False;
+}
+
+inline Color ColorListBox::GetSelectEntryColor( sal_uInt16 nSelIndex ) const
+{
+ sal_uInt16 nPos = GetSelectEntryPos( nSelIndex );
+ Color aColor;
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ aColor = GetEntryColor( nPos );
+ return aColor;
+}
+
+// ---------------
+// - LineListBox -
+// ---------------
+
+/**
+ Class computing border widths shared between Line style listbox and the
+ SvxBorderLine implementation.
+
+ This class doesn't know anything about units: it all depends on the different
+ values set. A border is composed of 2 lines separated by a gap. The computed
+ widths are the ones of each line and the gap and they can either be fix or vary.
+
+ The #m_nflags member will define which widths will vary (value 0 means that all
+ widths are fixed). The available flags are:
+ - CHANGE_LINE1
+ - CHANGE_LINE2
+ - CHANGE_DIST
+
+ For each line, the rate member is used as a multiplication factor is the width
+ isn't fixed. Otherwise it is the width in the unit expected by the client code.
+ */
+class SVT_DLLPUBLIC BorderWidthImpl
+{
+ sal_uInt16 m_nFlags;
+ double m_nRate1;
+ double m_nRate2;
+ double m_nRateGap;
+
+public:
+
+ BorderWidthImpl( sal_uInt16 nFlags = CHANGE_LINE1, double nRate1 = 0.0,
+ double nRate2 = 0.0, double nRateGap = 0.0 );
+
+ BorderWidthImpl& operator= ( const BorderWidthImpl& r );
+ bool operator== ( const BorderWidthImpl& r ) const;
+
+ long GetLine1 ( long nWidth ) const;
+ long GetLine2( long nWidth ) const;
+ long GetGap( long nWidth ) const;
+
+ long GuessWidth( long nLine1, long nLine2, long nGap );
+
+ bool IsEmpty( ) const { return (0 == m_nRate1) && (0 == m_nRate2); }
+ bool IsDouble( ) const { return (0 != m_nRate1) && (0 != m_nRate2); }
+};
+
+SVT_DLLPUBLIC inline Color sameColor( Color rMain )
+{
+ return rMain;
+}
+
+SVT_DLLPUBLIC inline Color sameDistColor( Color /*rMain*/, Color rDefault )
+{
+ return rDefault;
+}
+
+
+class SVT_DLLPUBLIC LineListBox : public ListBox
+{
+ ImpLineList* pLineList;
+ long m_nWidth;
+ XubString m_sNone;
+
+ VirtualDevice aVirDev;
+ Size aTxtSize;
+ Color aColor;
+ Color maPaintCol;
+ FieldUnit eUnit;
+ FieldUnit eSourceUnit;
+
+ SVT_DLLPRIVATE void ImpGetLine( long nLine1, long nLine2, long nDistance,
+ Color nColor1, Color nColor2, Color nColorDist,
+ sal_uInt16 nStyle, Bitmap& rBmp );
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit();
+ sal_Bool UpdatePaintLineColor( void ); // returns sal_True if maPaintCol has changed
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void UpdateEntries( long nOldWidth );
+ sal_uInt16 GetStylePos( sal_uInt16 nListPos, long nWidth );
+
+public:
+ LineListBox( Window* pParent, WinBits nWinStyle = WB_BORDER );
+ LineListBox( Window* pParent, const ResId& rResId );
+ virtual ~LineListBox();
+
+ /** Set the width in Twips */
+ void SetWidth( long nWidth );
+ void SetNone( const XubString& sNone );
+
+ using ListBox::InsertEntry;
+ virtual sal_uInt16 InsertEntry( const XubString& rStr, sal_uInt16 nPos = LISTBOX_APPEND );
+ /** Insert a listbox entry with all widths in Twips. */
+ void InsertEntry( BorderWidthImpl aWidthImpl,
+ sal_uInt16 nStyle, long nMinWidth = 0,
+ Color (*pColor1Fn)(Color) = &sameColor,
+ Color (*pColor2Fn)( Color ) = &sameColor,
+ Color (*pColorDistFn)( Color, Color ) = &sameDistColor );
+
+ using ListBox::RemoveEntry;
+ virtual void RemoveEntry( sal_uInt16 nPos );
+ virtual void Clear();
+
+ using ListBox::GetEntryPos;
+ virtual sal_uInt16 GetEntryPos( sal_uInt16 nStyle = STYLE_SOLID ) const;
+ sal_uInt16 GetEntryStyle( sal_uInt16 nPos ) const;
+
+ void SelectEntry( const XubString& rStr, sal_Bool bSelect = sal_True ) { ListBox::SelectEntry( rStr, bSelect ); }
+ void SelectEntry( sal_uInt16 nStyle = STYLE_SOLID, sal_Bool bSelect = sal_True );
+ sal_uInt16 GetSelectEntryStyle( sal_uInt16 nSelIndex = 0 ) const;
+ inline sal_Bool IsEntrySelected( const XubString& rStr ) const { return ListBox::IsEntrySelected( rStr ); }
+ sal_Bool IsEntrySelected( sal_uInt16 nStyle1 = STYLE_SOLID ) const;
+
+ inline void SetUnit( FieldUnit eNewUnit ) { eUnit = eNewUnit; }
+ inline FieldUnit GetUnit() const { return eUnit; }
+ inline void SetSourceUnit( FieldUnit eNewUnit ) { eSourceUnit = eNewUnit; }
+ inline FieldUnit GetSourceUnit() const { return eSourceUnit; }
+
+ void SetColor( const Color& rColor );
+ inline Color GetColor( void ) const;
+
+protected:
+
+ inline const Color& GetPaintColor( void ) const;
+ Color GetColorLine1( sal_uInt16 nPos = 0 );
+ Color GetColorLine2( sal_uInt16 nPos = 0 );
+ Color GetColorDist( sal_uInt16 nPos = 0 );
+
+private:
+ // declared as private because some compilers would generate the default methods
+ LineListBox( const LineListBox& );
+ LineListBox& operator =( const LineListBox& );
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
+};
+
+inline sal_Bool LineListBox::IsEntrySelected( sal_uInt16 nStyle ) const
+{
+ sal_uInt16 nPos = GetEntryPos( nStyle );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ return IsEntryPosSelected( nPos );
+ else
+ return sal_False;
+}
+
+inline void LineListBox::SetColor( const Color& rColor )
+{
+ aColor = rColor;
+
+ UpdateEntries( m_nWidth );
+}
+
+inline Color LineListBox::GetColor( void ) const
+{
+ return aColor;
+}
+
+const Color& LineListBox::GetPaintColor( void ) const
+{
+ return maPaintCol;
+}
+
+inline void LineListBox::SetWidth( long nWidth )
+{
+ long nOldWidth = m_nWidth;
+ m_nWidth = nWidth;
+ UpdateEntries( nOldWidth );
+}
+
+inline void LineListBox::SetNone( const XubString& sNone )
+{
+ m_sNone = sNone;
+}
+
+// ---------------
+// - FontNameBox -
+// ---------------
+
+class SVT_DLLPUBLIC FontNameBox : public ComboBox
+{
+private:
+ ImplFontList* mpFontList;
+ sal_Bool mbWYSIWYG;
+ String maFontMRUEntriesFile;
+
+#ifdef _CTRLBOX_CXX
+ SVT_DLLPRIVATE void ImplCalcUserItemSize();
+ SVT_DLLPRIVATE void ImplDestroyFontList();
+#endif
+
+protected:
+ void LoadMRUEntries( const String& aFontMRUEntriesFile, sal_Unicode cSep = ';' );
+ void SaveMRUEntries( const String& aFontMRUEntriesFile, sal_Unicode cSep = ';' ) const;
+public:
+ FontNameBox( Window* pParent,
+ WinBits nWinStyle = WB_SORT );
+ FontNameBox( Window* pParent, const ResId& rResId );
+ virtual ~FontNameBox();
+
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ void Fill( const FontList* pList );
+
+ void EnableWYSIWYG( sal_Bool bEnable = sal_True );
+ sal_Bool IsWYSIWYGEnabled() const { return mbWYSIWYG; }
+
+private:
+ void InitFontMRUEntriesFile();
+
+ // declared as private because some compilers would generate the default functions
+ FontNameBox( const FontNameBox& );
+ FontNameBox& operator =( const FontNameBox& );
+};
+
+// ----------------
+// - FontStyleBox -
+// ----------------
+
+class SVT_DLLPUBLIC FontStyleBox : public ComboBox
+{
+ XubString aLastStyle;
+
+private:
+ using ComboBox::SetText;
+public:
+ FontStyleBox( Window* pParent, const ResId& rResId );
+ FontStyleBox( Window* pParent, WinBits nBits );
+ virtual ~FontStyleBox();
+
+ virtual void Select();
+ virtual void LoseFocus();
+ virtual void Modify();
+
+ void SetText( const OUString& rText );
+ void Fill( const XubString& rName, const FontList* pList );
+
+private:
+ // declared as private because some compilers would generate the default functions
+ FontStyleBox( const FontStyleBox& );
+ FontStyleBox& operator =( const FontStyleBox& );
+};
+
+inline void FontStyleBox::SetText( const OUString& rText )
+{
+ aLastStyle = rText;
+ ComboBox::SetText( rText );
+}
+
+// ---------------
+// - FontSizeBox -
+// ---------------
+
+class SVT_DLLPUBLIC FontSizeBox : public MetricBox
+{
+ FontInfo aFontInfo;
+ const FontList* pFontList;
+ sal_uInt16 nRelMin;
+ sal_uInt16 nRelMax;
+ sal_uInt16 nRelStep;
+ short nPtRelMin;
+ short nPtRelMax;
+ short nPtRelStep;
+ sal_Bool bRelativeMode:1,
+ bRelative:1,
+ bPtRelative:1,
+ bStdSize:1;
+
+#ifdef _CTRLBOX_CXX
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit();
+#endif
+
+protected:
+ virtual OUString CreateFieldText( sal_Int64 nValue ) const;
+
+public:
+ FontSizeBox( Window* pParent, WinBits nWinStyle = 0 );
+ FontSizeBox( Window* pParent, const ResId& rResId );
+ virtual ~FontSizeBox();
+
+ void Reformat();
+ void Modify();
+
+ void Fill( const FontInfo* pInfo, const FontList* pList );
+
+ void EnableRelativeMode( sal_uInt16 nMin = 50, sal_uInt16 nMax = 150,
+ sal_uInt16 nStep = 5 );
+ void EnablePtRelativeMode( short nMin = -200, short nMax = 200,
+ short nStep = 10 );
+ sal_Bool IsRelativeMode() const { return bRelativeMode; }
+ void SetRelative( sal_Bool bRelative = sal_False );
+ sal_Bool IsRelative() const { return bRelative; }
+ void SetPtRelative( sal_Bool bPtRel = sal_True )
+ { bPtRelative = bPtRel; SetRelative( sal_True ); }
+ sal_Bool IsPtRelative() const { return bPtRelative; }
+
+ virtual void SetValue( sal_Int64 nNewValue, FieldUnit eInUnit );
+ virtual void SetValue( sal_Int64 nNewValue );
+ virtual sal_Int64 GetValue( FieldUnit eOutUnit ) const;
+ virtual sal_Int64 GetValue() const;
+ sal_Int64 GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const;
+
+private:
+ // declared as private because some compilers would generate the default functions
+ FontSizeBox( const FontSizeBox& );
+ FontSizeBox& operator =( const FontSizeBox& );
+};
+
+#endif // _CTRLBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/ctrltool.hxx b/include/svtools/ctrltool.hxx
new file mode 100644
index 000000000000..b90f1b67a532
--- /dev/null
+++ b/include/svtools/ctrltool.hxx
@@ -0,0 +1,241 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _CTRLTOOL_HXX
+#define _CTRLTOOL_HXX
+
+#include <boost/ptr_container/ptr_vector.hpp>
+
+#include "svtools/svtdllapi.h"
+#include <rtl/ustring.hxx>
+#include <sal/types.h>
+#include <vcl/metric.hxx>
+
+class ImplFontListNameInfo;
+class OutputDevice;
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class FontList
+
+Diese Klasse verwaltet alle Fonts, die auf einem oder zwei Ausgabegeraeten
+dargestellt werden koennen. Zusaetzlich bietet die Klasse Methoden an, um
+aus Fett und Kursiv den StyleName zu generieren oder aus einem Stylename
+die fehlenden Attribute. Zusaetzlich kann diese Klasse syntetisch nachgebildete
+Fonts verarbeiten. Diese Klasse kann mit verschiedenen Standard-Controls und
+Standard-Menus zusammenarbeiten.
+
+Querverweise
+
+class FontNameBox, class FontStyleBox, class FontSizeBox,
+class FontNameMenu, class FontSizeMenu
+
+--------------------------------------------------------------------------
+
+FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2 = NULL,
+ sal_Bool bAll = sal_True );
+
+Konstruktor der Klasse FontList. Vom uebergebenen OutputDevice werden die
+entsprechenden Fonts abgefragt. Das OutputDevice muss solange existieren,
+wie auch die Klasse FontList existiert. Optional kann noch ein 2tes
+Ausgabedevice uebergeben werden, damit man zum Beispiel die Fonts von
+einem Drucker und dem Bildschirm zusammen in einer FontListe verwalten kann
+und somit auch den FontListen und FontMenus die Fonts von beiden OutputDevices
+zu uebergeben. Auch das pDevice2 muss solange existieren, wie die Klasse
+FontList existiert.
+
+Das OutputDevice, welches als erstes uebergeben wird, sollte das bevorzugte
+sein. Dies sollte im normalfall der Drucker sein. Denn wenn 2 verschiede
+Device-Schriften (eine fuer Drucker und eine fuer den Bildschirm) vorhanden
+sind, wird die vom uebergebenen Device "pDevice" bevorzugt.
+
+Mit dem dritten Parameter kann man angeben, ob nur skalierbare Schriften
+abgefragt werden sollen oder alle. Wenn sal_True uebergeben wird, werden auch
+Bitmap-Schriften mit abgefragt. Bei sal_False werden Vector-Schriften und
+scalierbare Schriften abgefragt.
+
+--------------------------------------------------------------------------
+
+String FontList::GetStyleName( const FontInfo& rInfo ) const;
+
+Diese Methode gibt den StyleName von einer FontInfo zurueck. Falls kein
+StyleName gesetzt ist, wird aus den gesetzten Attributen ein entsprechender
+Name generiert, der dem Anwender praesentiert werden kann.
+
+--------------------------------------------------------------------------
+
+XubString FontList::GetFontMapText( const FontInfo& rInfo ) const;
+
+Diese Methode gibt einen Matchstring zurueck, der dem Anwender
+anzeigen soll, welche Probleme es mit diesem Font geben kann.
+
+--------------------------------------------------------------------------
+
+FontInfo FontList::Get( const String& rName, const String& rStyleName ) const;
+
+Diese Methode sucht aus dem uebergebenen Namen und dem uebergebenen StyleName
+die entsprechende FontInfo-Struktur raus. Der Stylename kann in dieser
+Methode auch ein syntetischer sein. In diesem Fall werden die entsprechenden
+Werte in der FontInfo-Struktur entsprechend gesetzt. Wenn ein StyleName
+uebergeben wird, kann jedoch eine FontInfo-Struktur ohne Stylename
+zurueckgegeben werden. Um den StyleName dem Anwender zu repraesentieren,
+muss GetStyleName() mit dieser FontInfo-Struktur aufgerufen werden.
+
+Querverweise
+
+FontList::GetStyleName()
+
+--------------------------------------------------------------------------
+
+FontInfo FontList::Get( const String& rName, FontWeight eWeight,
+ FontItalic eItalic ) const;
+
+Diese Methode sucht aus dem uebergebenen Namen und den uebergebenen Styles
+die entsprechende FontInfo-Struktur raus. Diese Methode kann auch eine
+FontInfo-Struktur ohne Stylename zurueckgegeben. Um den StyleName dem
+Anwender zu repraesentieren, muss GetStyleName() mit dieser FontInfo-Struktur
+aufgerufen werden.
+
+Querverweise
+
+FontList::GetStyleName()
+
+--------------------------------------------------------------------------
+
+const long* FontList::GetSizeAry( const FontInfo& rInfo ) const;
+
+Diese Methode liefert zum uebergebenen Font die vorhandenen Groessen.
+Falls es sich dabei um einen skalierbaren Font handelt, werden Standard-
+Groessen zurueckgegeben. Das Array enthaelt die Hoehen des Fonts in 10tel
+Point. Der letzte Wert des Array ist 0. Das Array, was zurueckgegeben wird,
+wird von der FontList wieder zerstoert. Nach dem Aufruf der naechsten Methode
+von der FontList, sollte deshalb das Array nicht mehr referenziert werden.
+
+*************************************************************************/
+
+// ------------
+// - FontList -
+// ------------
+
+#define FONTLIST_FONTINFO_NOTFOUND ((sal_uInt16)0xFFFF)
+
+#define FONTLIST_FONTNAMETYPE_PRINTER ((sal_uInt16)0x0001)
+#define FONTLIST_FONTNAMETYPE_SCREEN ((sal_uInt16)0x0002)
+
+class SVT_DLLPUBLIC FontList
+{
+private:
+ OUString maMapBoth;
+ OUString maMapPrinterOnly;
+ OUString maMapScreenOnly;
+ OUString maMapSizeNotAvailable;
+ OUString maMapStyleNotAvailable;
+ OUString maMapNotAvailable;
+ OUString maLight;
+ OUString maLightItalic;
+ OUString maNormal;
+ OUString maNormalItalic;
+ OUString maBold;
+ OUString maBoldItalic;
+ OUString maBlack;
+ OUString maBlackItalic;
+ long* mpSizeAry;
+ OutputDevice* mpDev;
+ OutputDevice* mpDev2;
+ boost::ptr_vector<ImplFontListNameInfo> maEntries;
+#ifdef CTRLTOOL_CXX
+ SVT_DLLPRIVATE ImplFontListNameInfo* ImplFind( const OUString& rSearchName, sal_uLong* pIndex ) const;
+ SVT_DLLPRIVATE ImplFontListNameInfo* ImplFindByName( const OUString& rStr ) const;
+ SVT_DLLPRIVATE void ImplInsertFonts( OutputDevice* pDev, sal_Bool bAll,
+ sal_Bool bInsertData );
+#endif
+
+public:
+ FontList( OutputDevice* pDevice,
+ OutputDevice* pDevice2 = NULL,
+ sal_Bool bAll = sal_True );
+ ~FontList();
+
+ FontList* Clone() const;
+
+ OutputDevice* GetDevice() const { return mpDev; }
+ OutputDevice* GetDevice2() const { return mpDev2; }
+ XubString GetFontMapText( const FontInfo& rInfo ) const;
+
+ const OUString& GetNormalStr() const { return maNormal; }
+ const OUString& GetItalicStr() const { return maNormalItalic; }
+ const OUString& GetBoldStr() const { return maBold; }
+ const OUString& GetBoldItalicStr() const { return maBoldItalic; }
+ const OUString& GetStyleName( FontWeight eWeight, FontItalic eItalic ) const;
+ OUString GetStyleName( const FontInfo& rInfo ) const;
+
+ FontInfo Get( const OUString& rName,
+ const OUString& rStyleName ) const;
+ FontInfo Get( const OUString& rName,
+ FontWeight eWeight,
+ FontItalic eItalic ) const;
+
+ sal_Bool IsAvailable( const OUString& rName ) const;
+ sal_uInt16 GetFontNameCount() const
+ {
+ return (sal_uInt16)maEntries.size();
+ }
+ const FontInfo& GetFontName( sal_uInt16 nFont ) const;
+ sal_Handle GetFirstFontInfo( const OUString& rName ) const;
+ sal_Handle GetNextFontInfo( sal_Handle hFontInfo ) const;
+ const FontInfo& GetFontInfo( sal_Handle hFontInfo ) const;
+
+ const long* GetSizeAry( const FontInfo& rInfo ) const;
+ static const long* GetStdSizeAry();
+
+private:
+ FontList( const FontList& );
+ FontList& operator =( const FontList& );
+};
+
+
+// -----------------
+// - FontSizeNames -
+// -----------------
+
+class SVT_DLLPUBLIC FontSizeNames
+{
+private:
+ const struct ImplFSNameItem* mpArray;
+ sal_uLong mnElem;
+
+public:
+ FontSizeNames( LanguageType eLanguage /* = LANGUAGE_DONTKNOW */ );
+
+ sal_uLong Count() const { return mnElem; }
+ sal_Bool IsEmpty() const { return !mnElem; }
+
+ long Name2Size( const String& ) const;
+ String Size2Name( long ) const;
+
+ String GetIndexName( sal_uLong nIndex ) const;
+ long GetIndexSize( sal_uLong nIndex ) const;
+};
+
+#endif // _CTRLTOOL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/dialogclosedlistener.hxx b/include/svtools/dialogclosedlistener.hxx
new file mode 100644
index 000000000000..afaad3854827
--- /dev/null
+++ b/include/svtools/dialogclosedlistener.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 _SVTOOLS_DIALOGCLOSEDLISTENER_HXX
+#define _SVTOOLS_DIALOGCLOSEDLISTENER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/ui/dialogs/XDialogClosedListener.hpp>
+#include <tools/link.hxx>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=====================================================================
+ //= ODialogClosedListener
+ //=====================================================================
+ /**
+ C++ class to implement a ::com::sun::star::ui::dialogs::XDialogClosedListener
+ */
+ class SVT_DLLPUBLIC DialogClosedListener :
+ public ::cppu::WeakImplHelper1< ::com::sun::star::ui::dialogs::XDialogClosedListener >
+ {
+ private:
+ /**
+ This link will be called when the dialog was closed.
+
+ The link must have the type:
+ DECL_LINK( DialogClosedHdl, ::com::sun::star::ui::dialogs::DialogClosedEvent* );
+ */
+ Link m_aDialogClosedLink;
+
+ public:
+ DialogClosedListener();
+
+ inline void SetDialogClosedLink( const Link& rLink ) { m_aDialogClosedLink = rLink; }
+
+ // XDialogClosedListener methods
+ virtual void SAL_CALL dialogClosed( const ::com::sun::star::ui::dialogs::DialogClosedEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener methods
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif// COMPHELPER_DIALOGCLOSEDLISTENER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/dialogcontrolling.hxx b/include/svtools/dialogcontrolling.hxx
new file mode 100644
index 000000000000..56d31d4e7161
--- /dev/null
+++ b/include/svtools/dialogcontrolling.hxx
@@ -0,0 +1,293 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVTOOLS_DIALOGCONTROLLING_HXX
+#define SVTOOLS_DIALOGCONTROLLING_HXX
+
+#include <svtools/svtdllapi.h>
+
+#include <tools/link.hxx>
+#include <vcl/button.hxx>
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //=====================================================================
+ //= IWindowOperator
+ //=====================================================================
+ /** an abstract interface for operating on a ->Window
+ */
+ class SVT_DLLPUBLIC SAL_NO_VTABLE IWindowOperator
+ {
+ public:
+ /** called when an event happened which should be reacted to
+
+ @param _rTrigger
+ the event which triggered the call. If the Id of the event is 0, then this is the initial
+ call which is made when ->_rOperateOn is added to the responsibility of the DialogController.
+ @param _rOperateOn
+ the window on which to operate
+ */
+ virtual void operateOn( const VclWindowEvent& _rTrigger, Window& _rOperateOn ) const = 0;
+
+ virtual ~IWindowOperator();
+ };
+ typedef ::boost::shared_ptr< IWindowOperator > PWindowOperator;
+
+ //=====================================================================
+ //= IWindowEventFilter
+ //=====================================================================
+ /** an abstract interface for deciding whether a ->VclWindowEvent
+ is worth paying attention to
+ */
+ class SVT_DLLPUBLIC SAL_NO_VTABLE IWindowEventFilter
+ {
+ public:
+ virtual bool payAttentionTo( const VclWindowEvent& _rEvent ) const = 0;
+
+ virtual ~IWindowEventFilter();
+ };
+ typedef ::boost::shared_ptr< IWindowEventFilter > PWindowEventFilter;
+
+ //=====================================================================
+ //= DialogController
+ //=====================================================================
+ struct DialogController_Data;
+ /** a class controlling interactions between dialog controls
+
+ An instance of this class listens to all events fired by a certain
+ ->Control (more precise, a ->Window), the so-called instigator.
+
+ Additionally, the ->DialogController maintains a list of windows which
+ are affected by changes in the instigator window. Let's call those the
+ dependent windows.
+
+ Now, by help of an owner-provided ->IWindowEventFilter, the ->DialogController
+ decides which events are worth attention. By help of an owner-provided
+ ->IWindowOperator, it handles those events for all dependent windows.
+ */
+ class SVT_DLLPUBLIC DialogController
+ {
+ private:
+ ::std::auto_ptr< DialogController_Data > m_pImpl;
+
+ public:
+ DialogController( Window& _rInstigator, const PWindowEventFilter& _pEventFilter, const PWindowOperator& _pOperator );
+ virtual ~DialogController();
+
+ /** adds a window to the list of dependent windows
+
+ @param _rWindow
+ The window to add to the list of dependent windows.
+
+ The caller is responsible for life-time control: The given window
+ must live at least as long as the ->DialogController instance does.
+ */
+ void addDependentWindow( Window& _rWindow );
+
+ /** resets the controller so that no actions happened anymore.
+
+ The instances is disfunctional after this method has been called.
+ */
+ void reset();
+
+ private:
+ void impl_Init();
+ void impl_updateAll( const VclWindowEvent& _rTriggerEvent );
+ void impl_update( const VclWindowEvent& _rTriggerEvent, Window& _rWindow );
+
+ DECL_LINK( OnWindowEvent, const VclWindowEvent* );
+
+ private:
+ DialogController( const DialogController& ); // never implemented
+ DialogController& operator=( const DialogController& ); // never implemented
+ };
+ typedef ::boost::shared_ptr< DialogController > PDialogController;
+
+ //=====================================================================
+ //= ControlDependencyManager
+ //=====================================================================
+ struct ControlDependencyManager_Data;
+ /** helper class for managing control dependencies
+
+ Instances of this class are intended to be held as members of a dialog/tabpage/whatever
+ class, with easy administration of inter-control dependencies (such as "Enable
+ control X if and only if checkbox Y is checked).
+ */
+ class SVT_DLLPUBLIC ControlDependencyManager
+ {
+ private:
+ ::std::auto_ptr< ControlDependencyManager_Data > m_pImpl;
+
+ public:
+ ControlDependencyManager();
+ ~ControlDependencyManager();
+
+ /** clears all dialog controllers previously added to the manager
+ */
+ void clear();
+
+ /** ensures that a given window is enabled or disabled, according to the check state
+ of a given radio button
+ @param _rRadio
+ denotes the radio button whose check state is to observe
+ @param _rDependentWindow
+ denotes the window which should be enabled when ->_rRadio is checked, and
+ disabled when it's unchecked
+ */
+ void enableOnRadioCheck( RadioButton& _rRadio, Window& _rDependentWindow );
+ void enableOnRadioCheck( RadioButton& _rRadio, Window& _rDependentWindow1, Window& _rDependentWindow2, Window& _rDependentWindow3 );
+ void enableOnRadioCheck( RadioButton& _rRadio, Window& _rDependentWindow1, Window& _rDependentWindow2, Window& _rDependentWindow3, Window& _rDependentWindow4, Window& _rDependentWindow5 );
+
+ /** ensures that a given window is enabled or disabled, according to the mark state
+ of a given check box
+ @param _rBox
+ denotes the check box whose mark state is to observe
+ @param _rDependentWindow
+ denotes the window which should be enabled when ->_rBox is marked, and
+ disabled when it's unmarked
+ */
+ void enableOnCheckMark( CheckBox& _rBox, Window& _rDependentWindow );
+ void enableOnCheckMark( CheckBox& _rBox, Window& _rDependentWindow1, Window& _rDependentWindow2 );
+ void enableOnCheckMark( CheckBox& _rBox, Window& _rDependentWindow1, Window& _rDependentWindow2, Window& _rDependentWindow3, Window& _rDependentWindow4 );
+
+ /** adds a non-standard controller whose functionality is not covered by the other methods
+
+ @param _pController
+ the controller to add to the manager. Must not be <NULL/>.
+ */
+ void addController( const PDialogController& _pController );
+
+ private:
+ ControlDependencyManager( const ControlDependencyManager& ); // never implemented
+ ControlDependencyManager& operator=( const ControlDependencyManager& ); // never implemented
+ };
+
+ //=====================================================================
+ //= EnableOnCheck
+ //=====================================================================
+ /** a helper class implementing the ->IWindowOperator interface,
+ which enables a dependent window depending on the check state of
+ an instigator window.
+
+ @see DialogController
+ */
+ template< class CHECKABLE >
+ class SVT_DLLPUBLIC EnableOnCheck : public IWindowOperator
+ {
+ public:
+ typedef CHECKABLE SourceType;
+
+ private:
+ SourceType& m_rCheckable;
+
+ public:
+ /** constructs the instance
+
+ @param _rCheckable
+ a ->Window instance which supports a boolean method IsChecked. Usually
+ a ->RadioButton or ->CheckBox
+ */
+ EnableOnCheck( SourceType& _rCheckable )
+ :m_rCheckable( _rCheckable )
+ {
+ }
+
+ virtual void operateOn( const VclWindowEvent& /*_rTrigger*/, Window& _rOperateOn ) const
+ {
+ _rOperateOn.Enable( m_rCheckable.IsChecked() );
+ }
+ };
+
+ //=====================================================================
+ //= FilterForRadioOrCheckToggle
+ //=====================================================================
+ /** a helper class implementing the ->IWindowEventFilter interface,
+ which filters for radio buttons or check boxes being toggled.
+
+ Technically, the class simply filters for the ->VCLEVENT_RADIOBUTTON_TOGGLE
+ and the ->VCLEVENT_CHECKBOX_TOGGLE event.
+ */
+ class SVT_DLLPUBLIC FilterForRadioOrCheckToggle : public IWindowEventFilter
+ {
+ const Window& m_rWindow;
+ public:
+ FilterForRadioOrCheckToggle( const Window& _rWindow )
+ :m_rWindow( _rWindow )
+ {
+ }
+
+ bool payAttentionTo( const VclWindowEvent& _rEvent ) const
+ {
+ if ( ( _rEvent.GetWindow() == &m_rWindow )
+ && ( ( _rEvent.GetId() == VCLEVENT_RADIOBUTTON_TOGGLE )
+ || ( _rEvent.GetId() == VCLEVENT_CHECKBOX_TOGGLE )
+ )
+ )
+ return true;
+ return false;
+ }
+ };
+
+ //=====================================================================
+ //= RadioDependentEnabler
+ //=====================================================================
+ /** a ->DialogController derivee which enables or disables its dependent windows,
+ depending on the check state of a radio button.
+
+ The usage of this class is as simple as
+ <code>
+ pController = new RadioDependentEnabler( m_aOptionSelectSomething );
+ pController->addDependentWindow( m_aLabelSelection );
+ pController->addDependentWindow( m_aListSelection );
+ </code>
+
+ With this, both <code>m_aLabelSelection</code> and <code>m_aListSelection</code> will
+ be disabled if and only <code>m_aOptionSelectSomething</code> is checked.
+ */
+ class SVT_DLLPUBLIC RadioDependentEnabler : public DialogController
+ {
+ public:
+ RadioDependentEnabler( RadioButton& _rButton )
+ :DialogController( _rButton,
+ PWindowEventFilter( new FilterForRadioOrCheckToggle( _rButton ) ),
+ PWindowOperator( new EnableOnCheck< RadioButton >( _rButton ) ) )
+ {
+ }
+
+ RadioDependentEnabler( CheckBox& _rBox )
+ :DialogController( _rBox,
+ PWindowEventFilter( new FilterForRadioOrCheckToggle( _rBox ) ),
+ PWindowOperator( new EnableOnCheck< CheckBox >( _rBox ) ) )
+ {
+ }
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVTOOLS_DIALOGCONTROLLING_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx
new file mode 100644
index 000000000000..c9299d363c0a
--- /dev/null
+++ b/include/svtools/editbrowsebox.hxx
@@ -0,0 +1,685 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVTOOLS_EDITBROWSEBOX_HXX_
+#define _SVTOOLS_EDITBROWSEBOX_HXX_
+#define SVTOOLS_IN_EDITBROWSEBOX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/ref.hxx>
+#include <tools/rtti.hxx>
+#include <vcl/window.hxx>
+#include <vcl/combobox.hxx>
+#include <vcl/lstbox.hxx>
+
+#include <vcl/button.hxx>
+#include <svtools/brwbox.hxx>
+#include <vcl/timer.hxx>
+#include <svtools/brwhead.hxx>
+#include <svtools/svmedit.hxx>
+#include <vcl/svapp.hxx>
+
+//==================================================================
+// EditBrowseBoxFlags (EBBF)
+
+#define EBBF_NONE ((sal_Int32)0x0000)
+/** if this bit is _not_ set, the handle column will be invalidated upon
+ changing the row in the browse box. This is for forcing the row picture to
+ be repainted. If you do not have row pictures or text, you don't need this
+ invalidation, then you would specify this bit to prevent flicker
+*/
+#define EBBF_NO_HANDLE_COLUMN_CONTENT ((sal_Int32)0x0001)
+/** set this bit to activate the cell on a MouseButtonDown, not a MouseButtonUp event
+ */
+#define EBBF_ACTIVATE_ON_BUTTONDOWN ((sal_Int32)0x0002)
+/** if this bit is set and EBBF_NO_HANDLE_COLUMN_CONTENT is _not_ set, the handle
+ column is drawn with the text contained in column 0 instead of an image
+*/
+#define EBBF_HANDLE_COLUMN_TEXT ((sal_Int32)0x0004)
+
+/** If this bit is set, tab traveling is somewhat modified<br/>
+ If the control gets the focus because the user pressed the TAB key, then the
+ first or last cell (depending on whether the traveling was cycling forward or backward)
+ gets activated.
+ @see Window::GetGetFocusFlags
+ @see GETFOCUS_*
+*/
+#define EBBF_SMART_TAB_TRAVEL ((sal_Int32)0x0008)
+
+/// @deprecated
+#define EBBF_NOROWPICTURE EBBF_NO_HANDLE_COLUMN_CONTENT
+
+//==================================================================
+
+class Edit;
+class SpinField;
+class FormattedField;
+
+// .......................................................................
+namespace svt
+{
+// .......................................................................
+
+ class CellControllerRef;
+
+ //==================================================================
+ //= CellController
+ //==================================================================
+ class SVT_DLLPUBLIC CellController : public SvRefBase
+ {
+ friend class EditBrowseBox;
+
+ protected:
+ Control* pWindow;
+ sal_Bool bSuspended; // <sal_True> if the window is hidden and disabled
+
+ public:
+ TYPEINFO();
+
+ CellController(Control* pW);
+ virtual ~CellController();
+
+ Control& GetWindow() const { return *const_cast< CellController* >( this )->pWindow; }
+
+ virtual void SetModified();
+ virtual void ClearModified() = 0;
+ virtual sal_Bool IsModified() const = 0;
+
+ // commit any current changes. Especially, do any reformatting you need (from input formatting
+ // to output formatting) here
+ virtual void CommitModifications();
+
+ // suspending the controller is not culmulative!
+ void suspend( );
+ void resume( );
+ inline sal_Bool isSuspended( ) const { return bSuspended; }
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink) = 0;
+ virtual sal_Bool WantMouseEvent() const;
+ };
+
+ SV_DECL_IMPL_REF(CellController);
+
+ //==================================================================
+ //= IEditImplementation
+ //==================================================================
+ class SVT_DLLPUBLIC IEditImplementation
+ {
+ public:
+ virtual ~IEditImplementation() = 0;
+
+ virtual Control& GetControl() = 0;
+
+ virtual String GetText( LineEnd aSeparator ) const = 0;
+ virtual void SetText( const OUString& _rStr ) = 0;
+
+ virtual sal_Bool IsReadOnly() const = 0;
+ virtual void SetReadOnly( sal_Bool bReadOnly ) = 0;
+
+ virtual xub_StrLen GetMaxTextLen() const = 0;
+ virtual void SetMaxTextLen( xub_StrLen _nMaxLen ) = 0;
+
+ virtual Selection GetSelection() const = 0;
+ virtual void SetSelection( const Selection& _rSelection ) = 0;
+
+ virtual void ReplaceSelected( const String& _rStr ) = 0;
+ virtual void DeleteSelected() = 0;
+ virtual String GetSelected( LineEnd aSeparator ) const = 0;
+
+ virtual void SetModified() = 0;
+ virtual sal_Bool IsModified() const = 0;
+ virtual void ClearModified() = 0;
+ virtual void SetModifyHdl( const Link& _rLink ) = 0;
+ };
+
+ //==================================================================
+ //= GenericEditImplementation
+ //==================================================================
+ template <class EDIT>
+ class GenericEditImplementation : public IEditImplementation
+ {
+ EDIT& m_rEdit;
+ public:
+ GenericEditImplementation( EDIT& _rEdit );
+
+ EDIT& GetEditWindow() { return static_cast< EDIT& >( GetControl() ); }
+
+ virtual Control& GetControl();
+
+ virtual String GetText( LineEnd aSeparator ) const;
+ virtual void SetText( const OUString& _rStr );
+
+ virtual sal_Bool IsReadOnly() const;
+ virtual void SetReadOnly( sal_Bool bReadOnly );
+
+ virtual xub_StrLen GetMaxTextLen() const;
+ virtual void SetMaxTextLen( xub_StrLen _nMaxLen );
+
+ virtual Selection GetSelection() const;
+ virtual void SetSelection( const Selection& _rSelection );
+
+ virtual void ReplaceSelected( const String& _rStr );
+ virtual void DeleteSelected();
+ virtual String GetSelected( LineEnd aSeparator ) const;
+
+ virtual void SetModified();
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+ virtual void SetModifyHdl( const Link& _rLink );
+ };
+
+ #include <svtools/editimplementation.hxx>
+
+ //==================================================================
+ //= MultiLineTextCell
+ //==================================================================
+ /** a multi line edit which can be used in a cell of a EditBrowseBox
+ */
+ class SVT_DLLPUBLIC MultiLineTextCell : public MultiLineEdit
+ {
+ public:
+ MultiLineTextCell( Window* _pParent, WinBits _nStyle )
+ :MultiLineEdit( _pParent, _nStyle )
+ {
+ }
+
+ protected:
+ // Window overridables
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ // MultiLineEdit overridables
+ virtual void Modify();
+
+ private:
+ sal_Bool dispatchKeyEvent( const KeyEvent& _rEvent );
+ };
+
+ //==================================================================
+ //= concrete edit implementations
+ //==================================================================
+ typedef GenericEditImplementation< Edit > EditImplementation;
+
+ typedef GenericEditImplementation< MultiLineTextCell > MultiLineEditImplementation_Base;
+ class SVT_DLLPUBLIC MultiLineEditImplementation : public MultiLineEditImplementation_Base
+ {
+ public:
+ MultiLineEditImplementation( MultiLineTextCell& _rEdit ) : MultiLineEditImplementation_Base( _rEdit )
+ {
+ }
+
+ virtual String GetText( LineEnd aSeparator ) const;
+ virtual String GetSelected( LineEnd aSeparator ) const;
+ };
+
+ //==================================================================
+ //= EditCellController
+ //==================================================================
+ class SVT_DLLPUBLIC EditCellController : public CellController
+ {
+ IEditImplementation* m_pEditImplementation;
+ sal_Bool m_bOwnImplementation; // did we create m_pEditImplementation?
+
+ public:
+ TYPEINFO();
+ EditCellController( Edit* _pEdit );
+ EditCellController( IEditImplementation* _pImplementation );
+ ~EditCellController( );
+
+ const IEditImplementation* GetEditImplementation( ) const { return m_pEditImplementation; }
+ IEditImplementation* GetEditImplementation( ) { return m_pEditImplementation; }
+
+ virtual void SetModified();
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink);
+ };
+
+ //==================================================================
+ //= SpinCellController
+ //==================================================================
+ class SVT_DLLPUBLIC SpinCellController : public CellController
+ {
+ public:
+ TYPEINFO();
+ SpinCellController(SpinField* pSpinField);
+ SpinField& GetSpinWindow() const {return (SpinField &)GetWindow();}
+
+ virtual void SetModified();
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink);
+ };
+
+ //==================================================================
+ //= CheckBoxControl
+ //==================================================================
+ class SVT_DLLPUBLIC CheckBoxControl : public Control
+ {
+ CheckBox* pBox;
+ Rectangle aFocusRect;
+ Link m_aClickLink,m_aModifyLink;
+
+ public:
+ CheckBoxControl(Window* pParent, WinBits nWinStyle = 0);
+ ~CheckBoxControl();
+
+ virtual void GetFocus();
+ virtual long PreNotify(NotifyEvent& rEvt);
+ virtual void Paint(const Rectangle& rClientRect);
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& _rEvent );
+ virtual void Resize();
+
+ void SetClickHdl(const Link& rHdl) {m_aClickLink = rHdl;}
+ const Link& GetClickHdl() const {return m_aClickLink;}
+
+ void SetModifyHdl(const Link& rHdl) {m_aModifyLink = rHdl;}
+ const Link& GetModifyHdl() const {return m_aModifyLink;}
+
+ CheckBox& GetBox() {return *pBox;};
+
+ private:
+ DECL_LINK( OnClick, void* );
+ };
+
+ //==================================================================
+ //= CheckBoxCellController
+ //==================================================================
+ class SVT_DLLPUBLIC CheckBoxCellController : public CellController
+ {
+ public:
+ TYPEINFO();
+
+ CheckBoxCellController(CheckBoxControl* pWin):CellController(pWin){}
+ CheckBox& GetCheckBox() const;
+
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual void SetModifyHdl(const Link& rLink);
+ virtual sal_Bool WantMouseEvent() const;
+ };
+
+ //==================================================================
+ //= ComboBoxControl
+ //==================================================================
+ class SVT_DLLPUBLIC ComboBoxControl : public ComboBox
+ {
+ friend class ComboBoxCellController;
+
+ public:
+ ComboBoxControl(Window* pParent, WinBits nWinStyle = 0);
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ };
+
+ //==================================================================
+ //= ComboBoxCellController
+ //==================================================================
+ class SVT_DLLPUBLIC ComboBoxCellController : public CellController
+ {
+ public:
+ TYPEINFO();
+
+ ComboBoxCellController(ComboBoxControl* pParent);
+ ComboBoxControl& GetComboBox() const {return (ComboBoxControl &)GetWindow();}
+
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink);
+ };
+
+ //==================================================================
+ //= ListBoxControl
+ //==================================================================
+ class SVT_DLLPUBLIC ListBoxControl : public ListBox
+ {
+ friend class ListBoxCellController;
+
+ public:
+ ListBoxControl(Window* pParent, WinBits nWinStyle = 0);
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ };
+
+ //==================================================================
+ //= ListBoxCellController
+ //==================================================================
+ class SVT_DLLPUBLIC ListBoxCellController : public CellController
+ {
+ public:
+ TYPEINFO();
+
+ ListBoxCellController(ListBoxControl* pParent);
+ ListBoxControl& GetListBox() const {return (ListBoxControl &)GetWindow();}
+
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink);
+ };
+
+ //==================================================================
+ //= FormattedFieldCellController
+ //==================================================================
+ class SVT_DLLPUBLIC FormattedFieldCellController : public EditCellController
+ {
+ public:
+ TYPEINFO();
+ FormattedFieldCellController( FormattedField* _pFormatted );
+
+ virtual void CommitModifications();
+ };
+
+ //==================================================================
+ //= EditBrowserHeader
+ //==================================================================
+ class SVT_DLLPUBLIC EditBrowserHeader : public BrowserHeader
+ {
+ public:
+ EditBrowserHeader( BrowseBox* pParent, WinBits nWinBits = WB_BUTTONSTYLE )
+ :BrowserHeader(pParent, nWinBits){}
+
+ protected:
+ virtual void DoubleClick();
+ };
+
+ //==================================================================
+ //= EditBrowseBox
+ //==================================================================
+ class EditBrowseBoxImpl;
+ class SVT_DLLPUBLIC EditBrowseBox: public BrowseBox
+ {
+ friend class EditBrowserHeader;
+
+ enum BrowseInfo
+ {
+ COLSELECT = 1,
+ ROWSELECT = 2,
+ ROWCHANGE = 4,
+ COLCHANGE = 8
+ };
+
+ public:
+ enum RowStatus
+ {
+ CLEAN = 0,
+ CURRENT = 1,
+ CURRENTNEW = 2,
+ MODIFIED = 3,
+ NEW = 4,
+ DELETED = 5,
+ PRIMARYKEY = 6,
+ CURRENT_PRIMARYKEY = 7,
+ FILTER = 8,
+ HEADERFOOTER = 9
+ };
+
+ private:
+ // forbid these ones
+ EditBrowseBox(EditBrowseBox&);
+ EditBrowseBox& operator=(EditBrowseBox&);
+
+ class BrowserMouseEventPtr
+ {
+ BrowserMouseEvent* pEvent;
+ sal_Bool bDown;
+
+ public:
+ BrowserMouseEventPtr():pEvent(NULL){}
+ ~BrowserMouseEventPtr(){Clear();}
+
+ sal_Bool Is() const {return pEvent != NULL;}
+ sal_Bool IsDown() const {return bDown;}
+ const BrowserMouseEvent* operator->() const {return pEvent;}
+ const BrowserMouseEvent& operator*() const {return *pEvent;}
+
+ SVT_DLLPUBLIC void Clear();
+ void Set(const BrowserMouseEvent* pEvt, sal_Bool bIsDown);
+ } aMouseEvent;
+
+ const BrowserMouseEvent* pMouseEvent; // is set during a mouse event
+ CellControllerRef aController,
+ aOldController;
+
+ sal_uLong nStartEvent, nEndEvent, nCellModifiedEvent; // event ids
+ Window* m_pFocusWhileRequest;
+ // In ActivateCell, we grab the focus asynchronously, but if between requesting activation
+ // and the asynchornous event the focus has changed, we won't grab it for ourself.
+
+ long nPaintRow; // row beeing painted
+ long nEditRow, nOldEditRow;
+ sal_uInt16 nEditCol, nOldEditCol;
+
+ sal_Bool bHasFocus : 1;
+ mutable sal_Bool bPaintStatus : 1; // paint a status (image) in the handle column
+ sal_Bool bActiveBeforeTracking;
+
+ CheckBoxControl* pCheckBoxPaint;
+
+ sal_Int32 m_nBrowserFlags;
+ ImageList m_aStatusImages;
+ ::std::auto_ptr< EditBrowseBoxImpl> m_aImpl;
+
+ protected:
+ BrowserHeader* pHeader;
+
+ sal_Bool isGetCellFocusPending() const { return nStartEvent != 0; }
+ void cancelGetCellFocus() { if (nStartEvent) Application::RemoveUserEvent(nStartEvent); nStartEvent = 0; }
+ void forceGetCellFocus() { cancelGetCellFocus(); LINK(this, EditBrowseBox, StartEditHdl).Call((void*)NULL); }
+
+ BrowserMouseEventPtr& getMouseEvent() { return aMouseEvent; }
+
+ protected:
+ BrowserHeader* GetHeaderBar() const {return pHeader;}
+
+ virtual BrowserHeader* CreateHeaderBar(BrowseBox* pParent);
+
+ // if you want to have an own header ...
+ virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent);
+
+ virtual void ColumnMoved(sal_uInt16 nId);
+ virtual void ColumnResized(sal_uInt16 nColId);
+ virtual void Resize();
+ virtual void ArrangeControls(sal_uInt16& nX, sal_uInt16 nY);
+ virtual sal_Bool SeekRow(long nRow);
+
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void KeyInput(const KeyEvent& rEvt);
+ virtual void MouseButtonDown(const BrowserMouseEvent& rEvt);
+ virtual void MouseButtonUp(const BrowserMouseEvent& rEvt);
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ using BrowseBox::MouseButtonUp;
+ using BrowseBox::MouseButtonDown;
+
+ virtual long PreNotify(NotifyEvent& rNEvt );
+ virtual long Notify(NotifyEvent& rNEvt);
+
+ virtual void EndScroll();
+
+ // should be used instead of GetFieldRectPixel, 'cause this method here takes into account the borders
+ Rectangle GetCellRect(long nRow, sal_uInt16 nColId, sal_Bool bRelToBrowser = sal_True) const;
+ virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId);
+ virtual sal_uInt32 GetAutoColumnWidth(sal_uInt16 nColId);
+
+ virtual void PaintStatusCell(OutputDevice& rDev, const Rectangle& rRect) const;
+ virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId) const = 0;
+
+ virtual RowStatus GetRowStatus(long nRow) const;
+
+ virtual void RowHeightChanged();
+
+ // callbacks for the data window
+ virtual void ImplStartTracking();
+ virtual void ImplTracking();
+ virtual void ImplEndTracking();
+
+ // when changing a row:
+ // CursorMoving: cursor is beeing moved, but GetCurRow() still provides the old row
+ virtual sal_Bool CursorMoving(long nNewRow, sal_uInt16 nNewCol);
+
+ // cursor has been moved
+ virtual void CursorMoved();
+
+ virtual void CellModified(); // called whenever a cell has been modified
+ virtual sal_Bool SaveModified(); // called whenever a cell should be left, and it's content should be saved
+ // return sal_False prevents leaving the cell
+ virtual sal_Bool SaveRow(); // commit the current row
+
+ virtual sal_Bool IsModified() const {return aController.Is() && aController->IsModified();}
+
+ virtual CellController* GetController(long nRow, sal_uInt16 nCol);
+ virtual void InitController(CellControllerRef& rController, long nRow, sal_uInt16 nCol);
+ virtual void ResizeController(CellControllerRef& rController, const Rectangle&);
+ virtual void ReleaseController(CellControllerRef& pController, long nRow, sal_uInt16 nCol);
+ virtual void DoubleClick(const BrowserMouseEvent&);
+
+ void ActivateCell() { ActivateCell(GetCurRow(), GetCurColumnId()); }
+
+ // retrieve the image for the row status
+ virtual Image GetImage(RowStatus) const;
+
+ // inserting columns
+ // if you don't set a width, this will be calculated automatically
+ // if the id isn't set the smallest unused will do it ...
+ virtual sal_uInt16 AppendColumn(const String& rName, sal_uInt16 nWidth = 0, sal_uInt16 nPos = HEADERBAR_APPEND, sal_uInt16 nId = (sal_uInt16)-1);
+
+ // called whenever (Shift)Tab or Enter is pressed. If true is returned, these keys
+ // result in traveling to the next or to th previous cell
+ virtual sal_Bool IsTabAllowed(sal_Bool bForward) const;
+
+ virtual sal_Bool IsCursorMoveAllowed(long nNewRow, sal_uInt16 nNewColId) const;
+
+ void PaintTristate(OutputDevice& rDev, const Rectangle& rRect,const TriState& eState,sal_Bool _bEnabled=sal_True) const;
+
+ void AsynchGetFocus();
+ // secure starting of StartEditHdl
+
+ public:
+ EditBrowseBox(Window* pParent, sal_Int32 nBrowserFlags = EBBF_NONE, WinBits nBits = WB_TABSTOP, BrowserMode nMode = 0 );
+ EditBrowseBox(Window* pParent, const ResId& rId, sal_Int32 nBrowserFlags = EBBF_NONE, BrowserMode nMode = 0 );
+ ~EditBrowseBox();
+
+ sal_Bool IsEditing() const {return aController.Is();}
+ void InvalidateStatusCell(long nRow) {RowModified(nRow, 0);}
+ void InvalidateHandleColumn();
+
+ // late construction
+ virtual void Init();
+ virtual void RemoveRows();
+ virtual void Dispatch(sal_uInt16 nId);
+
+ CellControllerRef Controller() const { return aController; }
+ sal_Int32 GetBrowserFlags() const { return m_nBrowserFlags; }
+ void SetBrowserFlags(sal_Int32 nFlags);
+
+ virtual void ActivateCell(long nRow, sal_uInt16 nCol, sal_Bool bSetCellFocus = sal_True);
+ virtual void DeactivateCell(sal_Bool bUpdate = sal_True);
+ // Children ---------------------------------------------------------------
+
+ /** 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnPos );
+
+ /** @return The count of additional controls of the control area. */
+ virtual sal_Int32 GetAccessibleControlCount() const;
+
+ /** 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleControl( sal_Int32 nIndex );
+
+ /** Creates the accessible object of a column header.
+ @param nColumnId
+ The column ID of the header.
+ @return
+ The XAccessible interface of the specified column header. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleRowHeader( sal_Int32 _nRow );
+
+ /** Sets focus to current cell of the data table. */
+ virtual void GrabTableFocus();
+
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessibleCheckBoxCell(long _nRow, sal_uInt16 _nColumnPos,const TriState& eState);
+ protected:
+ // creates the accessible which wraps the active cell
+ void implCreateActiveAccessible( );
+
+ private:
+ virtual void PaintField(OutputDevice& rDev, const Rectangle& rRect,
+ sal_uInt16 nColumnId ) const;
+ using Control::ImplInitSettings;
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SVT_DLLPRIVATE void DetermineFocus( const sal_uInt16 _nGetFocusFlags = 0);
+ inline void HideAndDisable(CellControllerRef& rController);
+ inline void EnableAndShow() const;
+
+ SVT_DLLPRIVATE void implActivateCellOnMouseEvent(const BrowserMouseEvent& _rEvt, sal_Bool _bUp);
+ SVT_DLLPRIVATE void impl_construct();
+
+ DECL_DLLPRIVATE_LINK(ModifyHdl, void* );
+ DECL_DLLPRIVATE_LINK(StartEditHdl, void* );
+ DECL_DLLPRIVATE_LINK(EndEditHdl, void* );
+ DECL_DLLPRIVATE_LINK(CellModifiedHdl, void* );
+ };
+
+// .......................................................................
+} // namespace svt
+// .......................................................................
+
+#undef SVTOOLS_IN_EDITBROWSEBOX_HXX
+#endif // _SVTOOLS_EDITBROWSEBOX_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/editimplementation.hxx b/include/svtools/editimplementation.hxx
new file mode 100644
index 000000000000..983bf6dae5e8
--- /dev/null
+++ b/include/svtools/editimplementation.hxx
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVTOOLS_IN_EDITBROWSEBOX_HXX
+#error "not to be included directly!"
+#endif
+
+//----------------------------------------------------------------------
+template <class EDIT>
+GenericEditImplementation< EDIT >::GenericEditImplementation( EDIT& _rEdit )
+ :m_rEdit( _rEdit )
+{
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+Control& GenericEditImplementation< EDIT >::GetControl()
+{
+ return m_rEdit;
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+String GenericEditImplementation< EDIT >::GetText( LineEnd ) const
+{
+ // ignore the line end - this base implementation does not support it
+ return m_rEdit.GetText( );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetText( const OUString& _rStr )
+{
+ m_rEdit.SetText( _rStr );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+Selection GenericEditImplementation< EDIT >::GetSelection() const
+{
+ return m_rEdit.GetSelection( );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetSelection( const Selection& _rSelection )
+{
+ m_rEdit.SetSelection( _rSelection );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetReadOnly( sal_Bool bReadOnly )
+{
+ m_rEdit.SetReadOnly( bReadOnly );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+sal_Bool GenericEditImplementation< EDIT >::IsReadOnly() const
+{
+ return m_rEdit.IsReadOnly();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::ReplaceSelected( const String& _rStr )
+{
+ m_rEdit.ReplaceSelected( _rStr );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::DeleteSelected()
+{
+ m_rEdit.DeleteSelected();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+String GenericEditImplementation< EDIT >::GetSelected( LineEnd ) const
+{
+ return m_rEdit.GetSelected( );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetMaxTextLen( xub_StrLen _nMaxLen )
+{
+ m_rEdit.SetMaxTextLen( _nMaxLen );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+xub_StrLen GenericEditImplementation< EDIT >::GetMaxTextLen() const
+{
+ return (xub_StrLen)m_rEdit.GetMaxTextLen( );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetModified()
+{
+ m_rEdit.SetModifyFlag();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+sal_Bool GenericEditImplementation< EDIT >::IsModified() const
+{
+ return m_rEdit.IsModified();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::ClearModified()
+{
+ m_rEdit.ClearModifyFlag();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetModifyHdl( const Link& _rLink )
+{
+ m_rEdit.SetModifyHdl( _rLink );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/editsyntaxhighlighter.hxx b/include/svtools/editsyntaxhighlighter.hxx
new file mode 100644
index 000000000000..747d0567c213
--- /dev/null
+++ b/include/svtools/editsyntaxhighlighter.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 _EDITSYNTAXHIGHLIGHTER_HXX
+#define _EDITSYNTAXHIGHLIGHTER_HXX
+
+#include <comphelper/syntaxhighlight.hxx>
+#include <svtools/svmedit.hxx>
+#include <svtools/svtdllapi.h>
+#include <svtools/colorcfg.hxx>
+
+class SVT_DLLPUBLIC MultiLineEditSyntaxHighlight : public MultiLineEdit
+{
+ private:
+ bool mbDoBracketHilight;
+ SyntaxHighlighter aHighlighter;
+ svtools::ColorConfig m_aColorConfig;
+
+ private:
+ virtual void DoBracketHilight(sal_uInt16 aKey);
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ public:
+ MultiLineEditSyntaxHighlight( Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER , HighlighterLanguage aLanguage = HIGHLIGHT_SQL);
+ MultiLineEditSyntaxHighlight( Window* pParent, const ResId& rResId , HighlighterLanguage aLanguage = HIGHLIGHT_SQL);
+ ~MultiLineEditSyntaxHighlight();
+
+ virtual void UpdateData();
+ virtual void SetText(const OUString& rNewText);
+ virtual void SetText( const OUString& rStr, const Selection& rNewSelection )
+ { SetText( rStr ); SetSelection( rNewSelection ); }
+
+ Color GetColorValue(TokenTypes aToken);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/ehdl.hxx b/include/svtools/ehdl.hxx
new file mode 100644
index 000000000000..4b06a6e9d781
--- /dev/null
+++ b/include/svtools/ehdl.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 _EHDL_HXX
+#define _EHDL_HXX
+
+#ifndef __RSC
+
+#include "svtools/svtdllapi.h"
+
+#include <tools/errinf.hxx>
+
+class Window;
+class ResMgr;
+
+class SVT_DLLPUBLIC SfxErrorContext : private ErrorContext
+{
+public:
+ SfxErrorContext(
+ sal_uInt16 nCtxIdP, Window *pWin=0,
+ sal_uInt16 nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
+ SfxErrorContext(
+ sal_uInt16 nCtxIdP, const String &aArg1, Window *pWin=0,
+ sal_uInt16 nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
+ virtual sal_Bool GetString(sal_uLong nErrId, OUString &rStr);
+
+private:
+ sal_uInt16 nCtxId;
+ sal_uInt16 nResId;
+ ResMgr *pMgr;
+ String aArg1;
+};
+
+class SVT_DLLPUBLIC SfxErrorHandler : private ErrorHandler
+{
+public:
+ SfxErrorHandler(sal_uInt16 nId, sal_uLong lStart, sal_uLong lEnd, ResMgr *pMgr=0);
+ ~SfxErrorHandler();
+
+protected:
+ virtual sal_Bool GetErrorString(sal_uLong lErrId, OUString &, sal_uInt16&) const;
+ virtual sal_Bool GetMessageString(sal_uLong lErrId, OUString &, sal_uInt16&) const;
+
+private:
+
+ sal_uLong lStart;
+ sal_uLong lEnd;
+ sal_uInt16 nId;
+ ResMgr *pMgr;
+ ResMgr *pFreeMgr;
+
+ SVT_DLLPRIVATE sal_Bool GetClassString(sal_uLong lErrId, String &) const;
+ virtual sal_Bool CreateString(
+ const ErrorInfo *, OUString &, sal_uInt16 &) const;
+};
+
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/embedhlp.hxx b/include/svtools/embedhlp.hxx
new file mode 100644
index 000000000000..ba948376af9b
--- /dev/null
+++ b/include/svtools/embedhlp.hxx
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVTOOLS_EMBEDHLP_HXX
+#define _SVTOOLS_EMBEDHLP_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <vcl/graph.hxx>
+#include <tools/mapunit.hxx>
+#include <rtl/ustring.hxx>
+
+namespace comphelper
+{
+ class EmbeddedObjectContainer;
+}
+
+namespace com { namespace sun { namespace star { namespace embed {
+ class XEmbeddedObject;
+}}}}
+
+class Rectangle;
+class OutputDevice;
+
+namespace svt {
+
+struct EmbeddedObjectRef_Impl;
+
+class SVT_DLLPUBLIC EmbeddedObjectRef
+{
+ EmbeddedObjectRef_Impl* mpImpl;
+
+ SVT_DLLPRIVATE SvStream* GetGraphicStream( bool bUpdate ) const;
+ SVT_DLLPRIVATE void GetReplacement( bool bUpdate );
+
+ EmbeddedObjectRef& operator = ( const EmbeddedObjectRef& );
+
+public:
+ static void DrawPaintReplacement( const Rectangle &rRect, const OUString &rText, OutputDevice *pOut );
+ static void DrawShading( const Rectangle &rRect, OutputDevice *pOut );
+ static bool TryRunningState( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& );
+ static void SetGraphicToContainer( const Graphic& rGraphic,
+ comphelper::EmbeddedObjectContainer& aContainer,
+ const OUString& aName,
+ const OUString& aMediaType );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetGraphicReplacementStream(
+ sal_Int64 nViewAspect,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&,
+ OUString* pMediaType )
+ throw();
+
+ const com::sun::star::uno::Reference <com::sun::star::embed::XEmbeddedObject>& operator->() const;
+ const com::sun::star::uno::Reference <com::sun::star::embed::XEmbeddedObject>& GetObject() const;
+
+ // default constructed object; needs further assignment before it can be used
+ EmbeddedObjectRef();
+
+ // assign a previously default constructed object
+ void Assign( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect );
+
+ // create object for a certain view aspect
+ EmbeddedObjectRef( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect );
+
+ ~EmbeddedObjectRef();
+ EmbeddedObjectRef( const EmbeddedObjectRef& );
+
+ // assigning to a container enables the object to exchange graphical representations with a storage
+ void AssignToContainer( comphelper::EmbeddedObjectContainer* pContainer, const OUString& rPersistName );
+ comphelper::EmbeddedObjectContainer* GetContainer() const;
+
+ sal_Int64 GetViewAspect() const;
+ void SetViewAspect( sal_Int64 nAspect );
+ const Graphic* GetGraphic( OUString* pMediaType = NULL ) const;
+
+ // the original size of the object ( size of the icon for iconified object )
+ // no conversion is done if no target mode is provided
+ Size GetSize( MapMode* pTargetMapMode = NULL ) const;
+
+ void SetGraphic( const Graphic& rGraphic, const OUString& rMediaType );
+ void SetGraphicStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInGrStream,
+ const OUString& rMediaType );
+
+ void UpdateReplacement();
+ void UpdateReplacementOnDemand();
+ void Lock( bool bLock = true );
+ void Clear();
+ bool is() const;
+
+ bool IsLocked() const;
+ bool IsChart() const;
+
+ // #i104867#
+ // Provides a graphic version number for the fetchable Graphic during this object's lifetime. Internally,
+ // that number is incremented at each change of the Graphic. This mechanism is needed to identify if a
+ // remembered Graphic (e.g. primitives) has changed compared to the current one, but without actively
+ // fetching the Graphic what would be too expensive e.g. for charts
+ sal_uInt32 getGraphicVersion() const;
+ void SetDefaultSizeForChart( const Size& rSizeIn_100TH_MM );//#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/embedtransfer.hxx b/include/svtools/embedtransfer.hxx
new file mode 100644
index 000000000000..9da80b87f37a
--- /dev/null
+++ b/include/svtools/embedtransfer.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 _EMBEDTRANSFER_HXX
+#define _EMBEDTRANSFER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <svtools/transfer.hxx>
+
+class Graphic;
+class SVT_DLLPUBLIC SvEmbedTransferHelper : public TransferableHelper
+{
+private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject > m_xObj;
+ Graphic* m_pGraphic;
+ sal_Int64 m_nAspect;
+
+protected:
+
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void ObjectReleased();
+
+public:
+ // object, replacement image, and the aspect
+ SvEmbedTransferHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj,
+ const Graphic* pGraphic,
+ sal_Int64 nAspect );
+ ~SvEmbedTransferHelper();
+
+ static void FillTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj,
+ const Graphic* pGraphic,
+ sal_Int64 nAspect );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/extcolorcfg.hxx b/include/svtools/extcolorcfg.hxx
new file mode 100644
index 000000000000..226e6065d5b0
--- /dev/null
+++ b/include/svtools/extcolorcfg.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_SVTOOLS_EXTCOLORCFG_HXX
+#define INCLUDED_SVTOOLS_EXTCOLORCFG_HXX
+
+#include "svtools/svtdllapi.h"
+#include <rtl/ustring.hxx>
+#include <tools/color.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+
+//-----------------------------------------------------------------------------
+namespace svtools{
+
+class ExtendedColorConfig_Impl;
+class ExtendedColorConfigValue
+{
+ OUString m_sName;
+ OUString m_sDisplayName;
+ sal_Int32 m_nColor;
+ sal_Int32 m_nDefaultColor;
+public:
+ ExtendedColorConfigValue() : m_nColor(0),m_nDefaultColor(0){}
+ ExtendedColorConfigValue(const OUString& _sName
+ ,const OUString& _sDisplayName
+ ,sal_Int32 _nColor
+ ,sal_Int32 _nDefaultColor)
+ : m_sName(_sName)
+ ,m_sDisplayName(_sDisplayName)
+ ,m_nColor(_nColor)
+ ,m_nDefaultColor(_nDefaultColor)
+ {}
+
+ inline OUString getName() const { return m_sName; }
+ inline OUString getDisplayName() const { return m_sDisplayName; }
+ inline sal_Int32 getColor() const { return m_nColor; }
+ inline sal_Int32 getDefaultColor() const { return m_nDefaultColor; }
+
+ inline void setColor(sal_Int32 _nColor) { m_nColor = _nColor; }
+
+ sal_Bool operator !=(const ExtendedColorConfigValue& rCmp) const
+ { return m_nColor != rCmp.m_nColor;}
+};
+
+class SVT_DLLPUBLIC ExtendedColorConfig : public SfxBroadcaster, public SfxListener
+{
+ friend class ExtendedColorConfig_Impl;
+private:
+ static ExtendedColorConfig_Impl* m_pImpl;
+public:
+ ExtendedColorConfig();
+ ~ExtendedColorConfig();
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+ // get the configured value
+ ExtendedColorConfigValue GetColorValue(const OUString& _sComponentName,const OUString& _sName)const;
+ sal_Int32 GetComponentCount() const;
+ OUString GetComponentName(sal_uInt32 _nPos) const;
+ OUString GetComponentDisplayName(const OUString& _sComponentName) const;
+ sal_Int32 GetComponentColorCount(const OUString& _sName) const;
+ ExtendedColorConfigValue GetComponentColorConfigValue(const OUString& _sComponentName,sal_uInt32 _nPos) const;
+};
+
+class SVT_DLLPUBLIC EditableExtendedColorConfig
+{
+ ExtendedColorConfig_Impl* m_pImpl;
+ sal_Bool m_bModified;
+public:
+ EditableExtendedColorConfig();
+ ~EditableExtendedColorConfig();
+
+ void DeleteScheme(const OUString& rScheme );
+ void AddScheme(const OUString& rScheme );
+ sal_Bool LoadScheme(const OUString& rScheme );
+ void SetCurrentSchemeName(const OUString& rScheme);
+
+ sal_Int32 GetComponentCount() const;
+ OUString GetComponentName(sal_uInt32 _nPos) const;
+ sal_Int32 GetComponentColorCount(const OUString& _sName) const;
+ ExtendedColorConfigValue GetComponentColorConfigValue(const OUString& _sName,sal_uInt32 _nPos) const;
+ void SetColorValue(const OUString& _sComponentName, const ExtendedColorConfigValue& rValue);
+ void SetModified();
+ void ClearModified(){m_bModified = sal_False;}
+ sal_Bool IsModified()const{return m_bModified;}
+ void Commit();
+
+ void DisableBroadcast();
+ void EnableBroadcast();
+};
+}//namespace svtools
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/extensionlistbox.hxx b/include/svtools/extensionlistbox.hxx
new file mode 100644
index 000000000000..62f5c383579a
--- /dev/null
+++ b/include/svtools/extensionlistbox.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 _SVTOOLS_EXTENSIONLISTBOX_HXX
+#define _SVTOOLS_EXTENSIONLISTBOX_HXX
+
+#include <vcl/ctrl.hxx>
+#include <rtl/ustring.hxx>
+
+// ============================================================================
+
+namespace svt
+{
+
+// ============================================================================
+
+/** This abstract class provides methods to implement an extension list box.
+ This header is needed for the automatic test tool
+*/
+class IExtensionListBox: public Control
+{
+public:
+ enum { ENTRY_NOTFOUND = -1 };
+
+ IExtensionListBox( Window* pParent, WinBits nWinStyle = 0 ): Control( pParent, nWinStyle ){}
+
+ /** @return The count of the entries in the list box. */
+ virtual sal_Int32 getItemCount() const = 0;
+
+ /** @return The index of the first selected entry in the list box.
+ When nothing is selected, which is the case when getItemCount returns '0',
+ then this function returns ENTRY_NOTFOUND */
+ virtual sal_Int32 getSelIndex() const = 0;
+
+ /** @return The item name of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual OUString getItemName( sal_Int32 index ) const = 0;
+
+ /** @return The version string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual OUString getItemVersion( sal_Int32 index ) const = 0;
+
+ /** @return The description string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual OUString getItemDescription( sal_Int32 index ) const = 0;
+
+ /** @return The publisher string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual OUString getItemPublisher( sal_Int32 index ) const = 0;
+
+ /** @return The link behind the publisher text of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual OUString getItemPublisherLink( sal_Int32 index ) const = 0;
+
+ /** The entry at the given position will be selected
+ Index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual void select( sal_Int32 index ) = 0;
+
+ /** The first found entry with the given name will be selected
+ When there was no entry found with the name, the selection doesn't change.
+ Please note that there might be more than one entry with the same
+ name, because:
+ 1. the name is not unique
+ 2. one extension can be installed as user and shared extension.
+ */
+ virtual void select( const OUString & sName ) = 0;
+};
+// ============================================================================
+
+} // namespace svt
+
+// ============================================================================
+
+#endif // _SVTOOLS_EXTENSIONLISTBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/filechangedchecker.hxx b/include/svtools/filechangedchecker.hxx
new file mode 100644
index 000000000000..2b8caa9d2da5
--- /dev/null
+++ b/include/svtools/filechangedchecker.hxx
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Surendran Mahendran <surenspost@gmail.com>]
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef SVTOOLS_INCLUDED_FILECHANGEDCHECKER_HXX
+#define SVTOOLS_INCLUDED_FILECHANGEDCHECKER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <boost/function.hpp>
+#include <osl/file.hxx>
+#include <vcl/timer.hxx>
+
+/** Periodically checks if a file has been modified
+
+ Instances of this class setup a vcl timer to occasionally wake up
+ check whether file modification time has changed.
+ */
+class SVT_DLLPUBLIC FileChangedChecker
+{
+private :
+ Timer mTimer;
+ OUString mFileName;
+ TimeValue mLastModTime;
+ ::boost::function0<void> mpCallback;
+
+ bool SVT_DLLPRIVATE getCurrentModTime(TimeValue& o_rValue) const;
+ DECL_LINK(TimerHandler, void *);
+
+public :
+ void resetTimer();
+ bool hasFileChanged();
+ FileChangedChecker(const OUString& rFilename, const ::boost::function0<void>& rCallback);
+};
+
+#endif
diff --git a/include/svtools/filectrl.hxx b/include/svtools/filectrl.hxx
new file mode 100644
index 000000000000..5654f004f69c
--- /dev/null
+++ b/include/svtools/filectrl.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_FILECTRL_HXX
+#define _SV_FILECTRL_HXX
+
+#include "svtools/svtdllapi.h"
+#include <vcl/window.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/button.hxx>
+
+
+#define STR_FILECTRL_BUTTONTEXT 333 // ID-Range?!
+
+// Flags for FileControl
+typedef sal_uInt16 FileControlMode;
+#define FILECTRL_RESIZEBUTTONBYPATHLEN ((sal_uInt16)0x0001)//if this is set, the button will become small as soon as the Text in the Edit Field is to long to be shown completely
+
+
+// Flags for internal use of FileControl
+typedef sal_uInt16 FileControlMode_Internal;
+#define FILECTRL_INRESIZE ((sal_uInt16)0x0001)
+#define FILECTRL_ORIGINALBUTTONTEXT ((sal_uInt16)0x0002)
+
+
+class SVT_DLLPUBLIC FileControl : public Window
+{
+private:
+ Edit maEdit;
+ PushButton maButton;
+
+ String maButtonText;
+ sal_Bool mbOpenDlg;
+
+ Link maDialogCreatedHdl;
+
+ FileControlMode mnFlags;
+ FileControlMode_Internal mnInternalFlags;
+
+private:
+ SVT_DLLPRIVATE void ImplBrowseFile( );
+
+protected:
+ SVT_DLLPRIVATE void Resize();
+ SVT_DLLPRIVATE void GetFocus();
+ SVT_DLLPRIVATE void StateChanged( StateChangedType nType );
+ SVT_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
+ DECL_DLLPRIVATE_LINK( ButtonHdl, void* );
+
+public:
+ FileControl( Window* pParent, WinBits nStyle, FileControlMode = 0 );
+ ~FileControl();
+
+ Edit& GetEdit() { return maEdit; }
+ PushButton& GetButton() { return maButton; }
+
+ void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+
+ void SetOpenDialog( sal_Bool bOpen ) { mbOpenDlg = bOpen; }
+ sal_Bool IsOpenDialog() const { return mbOpenDlg; }
+
+ void SetText( const OUString& rStr );
+ OUString GetText() const;
+ OUString GetSelectedText() const { return maEdit.GetSelected(); }
+
+ void SetSelection( const Selection& rSelection ) { maEdit.SetSelection( rSelection ); }
+ Selection GetSelection() const { return maEdit.GetSelection(); }
+
+ void SetReadOnly( sal_Bool bReadOnly = sal_True ) { maEdit.SetReadOnly( bReadOnly ); }
+ sal_Bool IsReadOnly() const { return maEdit.IsReadOnly(); }
+
+ //------
+ //use this to manipulate the dialog bevore executing it:
+ void SetDialogCreatedHdl( const Link& rLink ) { maDialogCreatedHdl = rLink; }
+ const Link& GetDialogCreatedHdl() const { return maDialogCreatedHdl; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/filedlg2.hrc b/include/svtools/filedlg2.hrc
new file mode 100644
index 000000000000..4da7f5e0f894
--- /dev/null
+++ b/include/svtools/filedlg2.hrc
@@ -0,0 +1,23 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#define STR_FILEDLG_OPEN 1002
+#define STR_FILEDLG_TYPE 1005
+#define STR_FILEDLG_SAVE 1010
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/fileurlbox.hxx b/include/svtools/fileurlbox.hxx
new file mode 100644
index 000000000000..5a9219d48050
--- /dev/null
+++ b/include/svtools/fileurlbox.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 SVTOOLS_FILEURLBOX_HXX
+#define SVTOOLS_FILEURLBOX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/inettbc.hxx>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=====================================================================
+ //= FileURLBox
+ //=====================================================================
+ class SVT_DLLPUBLIC FileURLBox : public SvtURLBox
+ {
+ protected:
+ String m_sPreservedText;
+
+ public:
+ FileURLBox( Window* _pParent, WinBits _nStyle );
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ public:
+ /** transforms the given URL content into a system-dependent notation, if possible, and
+ sets it as current display text
+
+ <p>If the user enters an URL such as "file:///c:/some%20directory", then this will be converted
+ to "c:\some directory" for better readability.</p>
+
+ @param _rURL
+ denotes the URL to set. Note that no check is made whether it is a valid URL - this
+ is the responsibility of the caller.
+
+ @see SvtURLBox::GetURL
+ */
+ void DisplayURL( const String& _rURL );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // SVTOOLS_FILEURLBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/fileview.hxx b/include/svtools/fileview.hxx
new file mode 100644
index 000000000000..d7cb77a19a47
--- /dev/null
+++ b/include/svtools/fileview.hxx
@@ -0,0 +1,258 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVT_FILEVIEW_HXX
+#define _SVT_FILEVIEW_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/ucb/XContent.hpp>
+#include <vcl/ctrl.hxx>
+#include <vcl/image.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <rtl/ustring.hxx>
+
+// class SvtFileView -----------------------------------------------------
+
+#define FILEVIEW_ONLYFOLDER 0x0001
+#define FILEVIEW_MULTISELECTION 0x0002
+
+#define FILEVIEW_SHOW_ONLYTITLE 0x0010
+#define FILEVIEW_SHOW_NONE 0x0020
+
+class ViewTabListBox_Impl;
+class SvtFileView_Impl;
+class SvTreeListEntry;
+class HeaderBar;
+class IUrlFilter;
+
+/// the result of an action in the FileView
+enum FileViewResult
+{
+ eSuccess,
+ eFailure,
+ eTimeout,
+ eStillRunning
+};
+
+/// describes parameters for doing an action on the FileView asynchronously
+struct FileViewAsyncAction
+{
+ sal_uInt32 nMinTimeout; /// minimum time to wait for a result, in milliseconds
+ sal_uInt32 nMaxTimeout; /// maximum time to wait for a result, in milliseconds, until eTimeout is returned
+ Link aFinishHandler; /// the handler to be called when the action is finished. Called in every case, no matter of the result
+
+ FileViewAsyncAction()
+ {
+ nMinTimeout = nMaxTimeout = 0;
+ }
+};
+
+class SVT_DLLPUBLIC SvtFileView : public Control
+{
+private:
+ SvtFileView_Impl* mpImp;
+ sal_Bool bSortColumn;
+
+ ::com::sun::star::uno::Sequence< OUString > mpBlackList;
+
+ DECL_DLLPRIVATE_LINK( HeaderSelect_Impl, HeaderBar * );
+ DECL_DLLPRIVATE_LINK( HeaderEndDrag_Impl, HeaderBar * );
+
+protected:
+ virtual void GetFocus();
+
+public:
+ SvtFileView( Window* pParent, const ResId& rResId, sal_Bool bOnlyFolder, sal_Bool bMultiSelection );
+ SvtFileView( Window* pParent, const ResId& rResId, sal_uInt8 nFlags );
+ ~SvtFileView();
+
+ const String& GetViewURL() const;
+ String GetURL( SvTreeListEntry* pEntry ) const;
+ String GetCurrentURL() const;
+
+ sal_Bool GetParentURL( String& _rParentURL ) const;
+ void CreatedFolder( const String& rUrl, const String& rNewFolder );
+
+ void SetHelpId( const OString& rHelpId );
+ const OString& GetHelpId( ) const;
+ void SetSizePixel( const Size& rNewSize );
+ virtual void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize );
+ void SetSortColumn( sal_Bool bValue ) { bSortColumn = bValue; }
+ sal_Bool GetSortColumn() { return bSortColumn; }
+
+ /** initialize the view with the content of a folder given by URL, and aply an immediate filter
+
+ @param rFolderURL
+ the URL of the folder whose content is to be read
+ @param rFilter
+ the initial filter to be applied
+ @param pAsyncDescriptor
+ If not <NULL/>, this struct describes the parameters for doing the
+ action asynchronously.
+ */
+ FileViewResult Initialize(
+ const String& rFolderURL,
+ const String& rFilter,
+ const FileViewAsyncAction* pAsyncDescriptor,
+ const ::com::sun::star::uno::Sequence< OUString >& rBlackList
+ );
+
+ FileViewResult Initialize(
+ const String& rFolderURL,
+ const String& rFilter,
+ const FileViewAsyncAction* pAsyncDescriptor );
+ /** initialze the view with a sequence of contents, which have already been obtained elsewhere
+
+ This method will never return <member>eStillRunning</member>, since it will fill the
+ view synchronously
+ */
+ sal_Bool Initialize( const ::com::sun::star::uno::Sequence< OUString >& aContents );
+
+ /** initializes the view with the content of a folder given by an UCB content
+ */
+ sal_Bool Initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>& _xContent,
+ const String& rFilter );
+
+ /** reads the current content of the current folder again, and applies the given filter to it
+
+ Note 1: The folder is really read a second time. This implies that any new elements (which were
+ not present when you called Initialize the last time) are now displayed.
+
+ Note 2: This method must not be called when you previously initialized the view from a sequence
+ of strings, or a UNO content object.
+
+ @param rFilter
+ the filter to be applied
+ @param pAsyncDescriptor
+ If not <NULL/>, this struct describes the parameters for doing the
+ action asynchronously.
+ */
+ FileViewResult ExecuteFilter(
+ const String& rFilter,
+ const FileViewAsyncAction* pAsyncDescriptor
+ );
+
+ /** cancels a running async action (if any)
+
+ @seealso Initialize
+ @seealso ExecuteFilter
+ @seealso FileViewAsyncAction
+ */
+ void CancelRunningAsyncAction();
+
+ /** initializes the view with the parent folder of the current folder
+
+ @param rNewURL
+ the URL of the folder which we just navigated to
+ @param pAsyncDescriptor
+ If not <NULL/>, this struct describes the parameters for doing the
+ action asynchronously.
+ */
+ FileViewResult PreviousLevel(
+ const FileViewAsyncAction* pAsyncDescriptor
+ );
+
+ void SetNoSelection();
+
+ void SetSelectHdl( const Link& rHdl );
+ void SetDoubleClickHdl( const Link& rHdl );
+ void SetOpenDoneHdl( const Link& rHdl );
+
+ sal_uLong GetSelectionCount() const;
+ SvTreeListEntry* FirstSelected() const;
+ SvTreeListEntry* NextSelected( SvTreeListEntry* pEntry ) const;
+ void EnableAutoResize();
+ void SetFocus();
+
+ void EnableContextMenu( sal_Bool bEnable );
+ void EnableDelete( sal_Bool bEnable );
+ void EnableNameReplacing( sal_Bool bEnable = sal_True );
+ // translate folder names or display doc-title instead of file name
+ // EnableContextMenu( sal_True )/EnableDelete(sal_True) disable name replacing!
+
+ // save and load column size and sort order
+ String GetConfigString() const;
+ void SetConfigString( const String& rCfgStr );
+
+ void SetUrlFilter( const IUrlFilter* _pFilter );
+
+ void EndInplaceEditing( bool _bCancel );
+
+protected:
+ virtual void StateChanged( StateChangedType nStateChange );
+};
+
+// struct SvtContentEntry ------------------------------------------------
+
+struct SvtContentEntry
+{
+ sal_Bool mbIsFolder;
+ OUString maURL;
+
+ SvtContentEntry( const OUString& rURL, sal_Bool bIsFolder ) :
+ mbIsFolder( bIsFolder ), maURL( rURL ) {}
+};
+
+namespace svtools {
+
+// -----------------------------------------------------------------------
+// QueryDeleteDlg_Impl
+// -----------------------------------------------------------------------
+
+enum QueryDeleteResult_Impl
+{
+ QUERYDELETE_YES = 0,
+ QUERYDELETE_NO,
+ QUERYDELETE_ALL,
+ QUERYDELETE_CANCEL
+};
+
+class SVT_DLLPUBLIC QueryDeleteDlg_Impl : public ModalDialog
+{
+ FixedText _aEntryLabel;
+ FixedText _aEntry;
+ FixedText _aQueryMsg;
+
+ PushButton _aYesButton;
+ PushButton _aAllButton;
+ PushButton _aNoButton;
+ CancelButton _aCancelButton;
+
+ QueryDeleteResult_Impl _eResult;
+
+private:
+
+ DECL_DLLPRIVATE_STATIC_LINK( QueryDeleteDlg_Impl, ClickLink, PushButton* );
+
+public:
+
+ QueryDeleteDlg_Impl( Window* pParent,
+ const String& rName );
+
+ void EnableAllButton() { _aAllButton.Enable( sal_True ); }
+ QueryDeleteResult_Impl GetResult() const { return _eResult; }
+};
+
+}
+
+#endif // _SVT_FILEVIEW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/fmtfield.hxx b/include/svtools/fmtfield.hxx
new file mode 100644
index 000000000000..8486926e53a9
--- /dev/null
+++ b/include/svtools/fmtfield.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 _FMTFIELD_HXX_
+#define _FMTFIELD_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <vcl/spinfld.hxx>
+#include <svl/zforlist.hxx>
+
+namespace validation { class NumberValidator; }
+
+typedef sal_uInt16 FORMAT_CHANGE_TYPE;
+#define FCT_KEYONLY 0x00 // only a new key was set
+#define FCT_FORMATTER 0x01 // a new formatter weas set, usually implies a change of the key, too
+#define FCT_PRECISION 0x02 // a new precision was set
+#define FCT_THOUSANDSSEP 0x03 // the thousands separator setting changed
+
+//------------------------------------------------------------------------------
+class SVT_DLLPUBLIC FormattedField : public SpinField
+{
+private:
+ // Da ein SvNumberFormatter eine ziemlich teure (sowohl zeit- als auch platz-maessig) Angelegenheit ist,
+ // haelt sich nicht jedes Field, an dem kein Formatter gesetzt wurde, eine eigenen Instanz, sondern es gibt nur eine
+ // einzige statische.
+ class StaticFormatter
+ {
+ static SvNumberFormatter* s_cFormatter;
+ static sal_uLong s_nReferences;
+ public:
+ StaticFormatter();
+ ~StaticFormatter();
+
+ operator SvNumberFormatter* () { return GetFormatter(); }
+ SVT_DLLPUBLIC SvNumberFormatter* GetFormatter();
+ };
+
+protected:
+ String m_sLastValidText;
+ // hat nichts mit dem current value zu tun, ist der letzte Text, der waehrend einer Eingabe als gueltig erkannt
+ // wurde (also durch CheckText geprueft, nicht durch den Formatter gejagt)
+ Selection m_aLastSelection;
+
+ double m_dMinValue;
+ double m_dMaxValue;
+ sal_Bool m_bHasMin : 1;
+ sal_Bool m_bHasMax : 1;
+
+ sal_Bool m_bStrictFormat : 1;
+
+ sal_Bool m_bValueDirty : 1;
+ sal_Bool m_bEnableEmptyField : 1;
+ sal_Bool m_bAutoColor : 1;
+ sal_Bool m_bEnableNaN : 1;
+ double m_dCurrentValue;
+ double m_dDefaultValue;
+
+ sal_uLong m_nFormatKey;
+ SvNumberFormatter* m_pFormatter;
+ StaticFormatter m_aStaticFormatter;
+
+ double m_dSpinSize;
+ double m_dSpinFirst;
+ double m_dSpinLast;
+
+ // es macht einen Unterschied, ob man bei eingestellter Textformatierung beim LostFocus den aktuellen String durch
+ // den Formatter jagt und das Ergebnis anzeigt oder erst aus dem String ein double macht, das formatiert und dann
+ // ausgibt
+ sal_Bool m_bTreatAsNumber;
+ // und mit den folgenden Members koennen wir das Ganze hier auch zur formatierten Text-Ausgabe benutzen ...
+ String m_sCurrentTextValue;
+ String m_sDefaultText;
+
+ // die bei der letzten Ausgabe-Operation vom Formatter gelieferte Farbe (nicht dass wir sie beachten wuerden, aber
+ // man kann sie von aussen abfragen)
+ Color* m_pLastOutputColor;
+
+ bool m_bUseInputStringForFormatting;
+
+public:
+ FormattedField(Window* pParent, WinBits nStyle = 0, SvNumberFormatter* pInitialFormatter = NULL, sal_Int32 nFormatKey = 0);
+ FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter = NULL, sal_Int32 nFormatKey = 0);
+ virtual ~FormattedField();
+
+ // Min-/Max-Verwaltung
+ sal_Bool HasMinValue() const { return m_bHasMin; }
+ void ClearMinValue() { m_bHasMin = sal_False; }
+ void SetMinValue(double dMin);
+ double GetMinValue() const { return m_dMinValue; }
+
+ sal_Bool HasMaxValue() const { return m_bHasMax; }
+ void ClearMaxValue() { m_bHasMax = sal_False; }
+ void SetMaxValue(double dMax);
+ double GetMaxValue() const { return m_dMaxValue; }
+
+ // aktueller Wert
+ virtual void SetValue(double dVal);
+ virtual double GetValue();
+ // die Standard-Implementierung jagt die Eingabe jeweils durch den Formatter, so einer vorhanden ist
+
+ void GetColor() const;
+
+ void SetTextValue(const OUString& rText);
+ // der String wird in ein double umgewandelt (durch den Formatter) und anschliessen in SetValue gesteckt
+
+ sal_Bool IsEmptyFieldEnabled() const { return m_bEnableEmptyField; }
+ void EnableEmptyField(sal_Bool bEnable);
+ // wenn nicht enabled, wird beim Verlassen des Feldes der Text auf den letzten gueltigen zurueckgesetzt
+
+ void SetDefaultValue(double dDefault) { m_dDefaultValue = dDefault; m_bValueDirty = sal_True; }
+ // wenn der aktuelle String ungueltig ist, liefert GetValue() diesen Default-Wert
+ double GetDefaultValue() const { return m_dDefaultValue; }
+
+ // Einstellungen fuer das Format
+ sal_uLong GetFormatKey() const { return m_nFormatKey; }
+ void SetFormatKey(sal_uLong nFormatKey);
+
+ SvNumberFormatter* GetFormatter() const { return m_pFormatter; }
+ void SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bResetFormat = sal_True);
+ // wenn bResetFormat sal_False ist, wird versucht, das alte eingestellte Format mit 'hinueberzuretten' (teuer, wenn es sich nicht
+ // um eines der Standard-Formate handelt, die in allen Formattern gleich sind)
+ // wenn sal_True, wird als neuer FormatKey 0 gesetzt
+
+ sal_Bool GetThousandsSep() const;
+ void SetThousandsSep(sal_Bool _bUseSeparator);
+ // the is no check if the current format is numeric, so be cautious when calling these functions
+
+ sal_uInt16 GetDecimalDigits() const;
+ void SetDecimalDigits(sal_uInt16 _nPrecision);
+ // the is no check if the current format is numeric, so be cautious when calling these functions
+
+ SvNumberFormatter* StandardFormatter() { return m_aStaticFormatter; }
+ // Wenn man keinen eigenen Formatter explizit anlegen will, kann man diesen hier in SetFormatter stecken ...
+ // Das hier gelieferte Objekt wird allerdings zwischen allen Instanzen der Klasse geteilt (aus Zeit- und Platzgruenden),
+ // also ist etwas Vorsicht angebracht ...
+
+ OUString GetFormat(LanguageType& eLang) const;
+ sal_Bool SetFormat(const OUString& rFormatString, LanguageType eLang);
+ // sal_False, wenn der FormatString nicht gesetzt werden konnte (also wahrscheinlich ungueltig ist)
+
+ sal_Bool IsStrictFormat() const { return m_bStrictFormat; }
+ void SetStrictFormat(sal_Bool bEnable) { m_bStrictFormat = bEnable; }
+ // Formatueberpruefung waehrend der Eingabe ?
+
+ // Spin-Handling
+ virtual void Up();
+ virtual void Down();
+ // Standard-Implementierung : hoch- oder runterzaehlen des aktuellen double einfach um die gesetzte SpinSize
+ virtual void First();
+ virtual void Last();
+ // Standard-Implementierung : aktuelles double setzen auf eingestellten first respektive last value
+
+ void SetSpinSize(double dStep) { m_dSpinSize = dStep; }
+ double GetSpinSize() const { return m_dSpinSize; }
+
+ void SetSpinFirst(double dFirst) { m_dSpinFirst = dFirst; }
+ double GetSpinFirst() const { return m_dSpinFirst; }
+
+ void SetSpinLast(double dLast) { m_dSpinLast = dLast; }
+ double GetSpinLast() const { return m_dSpinLast; }
+
+ sal_Bool TreatingAsNumber() const { return m_bTreatAsNumber; }
+ void TreatAsNumber(sal_Bool bDoSo) { m_bTreatAsNumber = bDoSo; }
+
+public:
+ virtual void SetText( const OUString& rStr );
+ virtual void SetText( const OUString& rStr, const Selection& rNewSelection );
+
+ // die folgenden Methoden sind interesant, wenn m_bTreatAsNumber auf sal_False sitzt
+ /** nehmen wir mal an, irgendjemand will das ganze schoene double-Handling gar nicht haben, sondern
+ einfach den Text formatiert ausgeben ...
+ (der Text wird einfach nur durch den Formatter gejagt und dann gesetzt)
+ */
+ void SetTextFormatted(const OUString& rText);
+ String GetTextValue() const;
+
+ void SetDefaultText(const OUString& rDefault) { m_sDefaultText = rDefault; }
+ String GetDefaultText() const { return m_sDefaultText; }
+
+ // die bei der letzten Ausgabe-Operation vom Formatter gelieferte Farbe (Ausgabe-Operationen werden getriggert durch
+ // SetValue, SetTextValue, SetTextFormatted, also indirekt eventuell auch durch SetMin-/-MaxValue)
+ Color* GetLastOutputColor() const { return m_pLastOutputColor; }
+
+ /** reformats the current text. Interesting if the user entered some text in an "input format", and
+ this should be formatted in the "output format" (which may differ, e.g. by additional numeric
+ digits or such).
+ */
+ void Commit();
+
+ // enable automatic coloring. if set to sal_True, and the format the field is working with for any current value
+ // says that it has to be painted in a special color (e.g. a format where negative numbers should be printed
+ // red), the text is painted with that color automatically.
+ // The color used is the same as returned by GetLastOutputColor()
+ void SetAutoColor(sal_Bool _bAutomatic);
+ sal_Bool GetAutoColor() const { return m_bAutoColor; }
+
+ /** enables handling of not-a-number value.
+
+ When this is set to <FALSE/> (the default), then invalid inputs (i.e. text which cannot be
+ intepreted, according to the current formatting) will be handled as if the default value
+ has been entered. GetValue the will return this default value.
+
+ When set to <TRUE/>, then GetValue will return NaN (not a number, see <method scope="rtl::math">isNan</method>)
+ when the current input is invalid.
+
+ Note that setting this to <TRUE/> implies that upon leaving the control, the input
+ will *not* be corrected to a valid value. For example, if the user enters "foo" in the
+ control, and then tabs out of it, the text "foo" will persist, and GetValue will
+ return NaN in subsequent calls.
+ */
+ void EnableNotANumber( sal_Bool _bEnable );
+ sal_Bool IsNotANumberEnabled( ) const { return m_bEnableNaN; }
+
+ /** When being set to true, the strings in the field are formatted using the
+ InputLine format. That's also what you get in Calc when you edit a cell
+ using F2
+ */
+ void UseInputStringForFormatting( bool bUseInputStr = true );
+ bool IsUsingInputStringForFormatting() const;
+
+protected:
+ virtual long Notify(NotifyEvent& rNEvt);
+ virtual void Modify();
+
+ // CheckText ueberschreiben fuer Ueberpruefung zur Eingabezeit
+ virtual sal_Bool CheckText(const OUString&) const { return sal_True; }
+
+ // any aspect of the current format has changed
+ virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat);
+
+ void ImplSetTextImpl(const OUString& rNew, Selection* pNewSel);
+ void ImplSetValue(double dValue, sal_Bool bForce);
+ sal_Bool ImplGetValue(double& dNewVal);
+
+ void ImplSetFormatKey(sal_uLong nFormatKey);
+ // SetFormatKey without FormatChanged notification
+
+ virtual SvNumberFormatter* CreateFormatter() { SetFormatter(StandardFormatter()); return m_pFormatter; }
+ SvNumberFormatter* ImplGetFormatter() const { return m_pFormatter ? m_pFormatter : ((FormattedField*)this)->CreateFormatter(); }
+
+ long PreNotify(NotifyEvent& rNEvt);
+
+ virtual void ReFormat();
+};
+
+//------------------------------------------------------------------------------
+class SVT_DLLPUBLIC DoubleNumericField : public FormattedField
+{
+protected:
+ validation::NumberValidator* m_pNumberValidator;
+
+public:
+ DoubleNumericField(Window* pParent, WinBits nStyle = 0)
+ :FormattedField(pParent, nStyle)
+ ,m_pNumberValidator( NULL )
+ {
+ ResetConformanceTester();
+ }
+
+ DoubleNumericField(Window* pParent, const ResId& rResId)
+ :FormattedField(pParent, rResId)
+ ,m_pNumberValidator( NULL )
+ {
+ ResetConformanceTester();
+ }
+ virtual ~DoubleNumericField();
+
+protected:
+ virtual sal_Bool CheckText(const OUString& sText) const;
+
+ virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat);
+ void ResetConformanceTester();
+};
+
+//==============================================================================
+#define FCT_CURRENCY_SYMBOL 0x10
+#define FCT_CURRSYM_POSITION 0x20
+
+//------------------------------------------------------------------------------
+class DoubleCurrencyField : public FormattedField
+{
+ OUString m_sCurrencySymbol;
+ sal_Bool m_bPrependCurrSym;
+ sal_Bool m_bChangingFormat;
+
+public:
+ DoubleCurrencyField(Window* pParent, WinBits nStyle = 0);
+
+ OUString getCurrencySymbol() const { return m_sCurrencySymbol; }
+ void setCurrencySymbol(const OUString& rSymbol);
+
+ sal_Bool getPrependCurrSym() const { return m_bPrependCurrSym; }
+ void setPrependCurrSym(sal_Bool _bPrepend);
+
+protected:
+ virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat);
+
+ void UpdateCurrencyFormat();
+};
+
+#endif // _FMTFIELD_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/fontsubstconfig.hxx b/include/svtools/fontsubstconfig.hxx
new file mode 100644
index 000000000000..5221e29aa585
--- /dev/null
+++ b/include/svtools/fontsubstconfig.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 _SVT_FONTSUBSTCONFIG_HXX
+#define _SVT_FONTSUBSTCONFIG_HXX
+
+#include "svtools/svtdllapi.h"
+#include <unotools/configitem.hxx>
+
+struct SvtFontSubstConfig_Impl;
+
+//-----------------------------------------------------------------------------
+struct SubstitutionStruct
+{
+ OUString sFont;
+ OUString sReplaceBy;
+ sal_Bool bReplaceAlways;
+ sal_Bool bReplaceOnScreenOnly;
+};
+//-----------------------------------------------------------------------------
+class SVT_DLLPUBLIC SvtFontSubstConfig : public utl::ConfigItem
+{
+ sal_Bool bIsEnabled;
+ SvtFontSubstConfig_Impl* pImpl;
+public:
+ SvtFontSubstConfig();
+ virtual ~SvtFontSubstConfig();
+
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence< OUString >& _rPropertyNames);
+
+ sal_Bool IsEnabled() const {return bIsEnabled;}
+ void Enable(sal_Bool bSet) {bIsEnabled = bSet; SetModified();}
+
+ sal_Int32 SubstitutionCount() const;
+ void ClearSubstitutions();
+ const SubstitutionStruct* GetSubstitution(sal_Int32 nPos);
+ void AddSubstitution(const SubstitutionStruct& rToAdd);
+ void Apply();
+};
+
+#endif
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/framestatuslistener.hxx b/include/svtools/framestatuslistener.hxx
new file mode 100644
index 000000000000..7543788f5afc
--- /dev/null
+++ b/include/svtools/framestatuslistener.hxx
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVTOOLS_FRAMESTATUSLISTENER_HXX
+#define _SVTOOLS_FRAMESTATUSLISTENER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XFrameActionListener.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/broadcasthelper.hxx>
+
+#include <boost/unordered_map.hpp>
+
+namespace svt
+{
+
+class SVT_DLLPUBLIC FrameStatusListener : public ::com::sun::star::frame::XStatusListener,
+ public ::com::sun::star::frame::XFrameActionListener,
+ public ::com::sun::star::lang::XComponent,
+ public ::comphelper::OBaseMutex,
+ public ::cppu::OWeakObject
+{
+ public:
+ FrameStatusListener( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame );
+ virtual ~FrameStatusListener();
+
+ // methods to support status forwarder, known by the old sfx2 toolbox controller implementation
+ void addStatusListener( const OUString& aCommandURL );
+ void bindListener();
+ void unbindListener();
+ sal_Bool isBound() const;
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XFrameActionListener
+ virtual void SAL_CALL frameAction( const com::sun::star::frame::FrameActionEvent& Action ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ protected:
+ struct Listener
+ {
+ Listener( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& rDispatch ) :
+ aURL( rURL ), xDispatch( rDispatch ) {}
+
+ ::com::sun::star::util::URL aURL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
+ };
+
+ typedef ::boost::unordered_map< OUString,
+ com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >,
+ OUStringHash,
+ ::std::equal_to< OUString > > URLToDispatchMap;
+
+ sal_Bool m_bInitialized : 1,
+ m_bDisposed : 1;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ URLToDispatchMap m_aListenerMap;
+};
+
+}
+
+#endif // _SVTOOLS_FRAMESTATUSLISTENER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/generictoolboxcontroller.hxx b/include/svtools/generictoolboxcontroller.hxx
new file mode 100644
index 000000000000..f01d5428a44f
--- /dev/null
+++ b/include/svtools/generictoolboxcontroller.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 __SVTOOLS_GENERICTOOLBOXCONTROLLER_HXX_
+#define __SVTOOLS_GENERICTOOLBOXCONTROLLER_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <svtools/toolboxcontroller.hxx>
+#include <vcl/toolbox.hxx>
+
+namespace svt
+{
+
+struct ExecuteInfo;
+class SVT_DLLPUBLIC GenericToolboxController : public svt::ToolboxController
+{
+ public:
+ GenericToolboxController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
+ ToolBox* pToolBox,
+ sal_uInt16 nID,
+ const OUString& aCommand );
+ virtual ~GenericToolboxController();
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ DECL_STATIC_LINK( GenericToolboxController, ExecuteHdl_Impl, ExecuteInfo* );
+
+ private:
+ ToolBox* m_pToolbox;
+ sal_uInt16 m_nID;
+};
+
+}
+
+#endif // __SVTOOLS_GENERICTOOLBOXCONTROLLER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/genericunodialog.hxx b/include/svtools/genericunodialog.hxx
new file mode 100644
index 000000000000..808282255bf5
--- /dev/null
+++ b/include/svtools/genericunodialog.hxx
@@ -0,0 +1,185 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVT_GENERICUNODIALOG_HXX_
+#define _SVT_GENERICUNODIALOG_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/lang/NotInitializedException.hpp>
+
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/propertycontainer.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <tools/link.hxx>
+
+class Dialog;
+class Window;
+class VclWindowEvent;
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=========================================================================
+#define UNODIALOG_PROPERTY_ID_TITLE 1
+#define UNODIALOG_PROPERTY_ID_PARENT 2
+
+#define UNODIALOG_PROPERTY_TITLE "Title"
+#define UNODIALOG_PROPERTY_PARENT "ParentWindow"
+
+
+ //=========================================================================
+ typedef ::cppu::WeakImplHelper3 < com::sun::star::ui::dialogs::XExecutableDialog
+ , com::sun::star::lang::XServiceInfo
+ , com::sun::star::lang::XInitialization
+ > OGenericUnoDialogBase;
+
+ /** abstract base class for implementing UNO objects representing dialogs (<type scope="com.sun.star.awt">XDialog</type>)
+ */
+ class SVT_DLLPUBLIC OGenericUnoDialog
+ :public OGenericUnoDialogBase
+ ,public ::comphelper::OMutexAndBroadcastHelper
+ ,public ::comphelper::OPropertyContainer
+ {
+ private:
+ ::osl::Mutex m_aExecutionMutex; /// acess safety for execute/cancel
+
+ protected:
+ Dialog* m_pDialog; /// the dialog to execute
+ sal_Bool m_bExecuting : 1; /// we're currently executing the dialog
+ sal_Bool m_bCanceled : 1; /// endDialog was called while we were executing
+ sal_Bool m_bTitleAmbiguous : 1; /// m_sTitle has not been set yet
+ bool m_bInitialized : 1; /// has "initialize" been called?
+ bool m_bNeedInitialization : 1; /// do we need to be initialized before any other API call is allowed?
+
+ // <properties>
+ OUString m_sTitle; /// title of the dialog
+ com::sun::star::uno::Reference<com::sun::star::awt::XWindow> m_xParent; /// parent window
+ // </properties>
+
+ com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> m_aContext;
+
+ public:
+ inline bool needInitialization() const { return m_bNeedInitialization && !m_bInitialized; }
+
+ protected:
+ OGenericUnoDialog(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& _rxContext);
+ virtual ~OGenericUnoDialog();
+
+ public:
+ // UNO
+ DECLARE_UNO3_DEFAULTS(OGenericUnoDialog, OGenericUnoDialogBase);
+ virtual com::sun::star::uno::Any SAL_CALL queryInterface(const com::sun::star::uno::Type& _rType) throw (com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence<com::sun::star::uno::Type> SAL_CALL getTypes( ) throw(com::sun::star::uno::RuntimeException);
+ virtual com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(com::sun::star::uno::RuntimeException) = 0;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(com::sun::star::uno::RuntimeException) = 0;
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw(com::sun::star::uno::RuntimeException);
+ virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException) = 0;
+
+ // OPropertySetHelper
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const com::sun::star::uno::Any& rValue ) throw(com::sun::star::uno::Exception);
+ virtual sal_Bool SAL_CALL convertFastPropertyValue( com::sun::star::uno::Any& rConvertedValue, com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const com::sun::star::uno::Any& rValue) throw(com::sun::star::lang::IllegalArgumentException);
+
+ // XExecutableDialog
+ virtual void SAL_CALL setTitle( const OUString& aTitle ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL execute( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments ) throw(com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
+
+ protected:
+ /** create the concret dialog instance. note that m_aMutex is not locked when this method get's called,
+ but the application-wide solar mutex is (to guard the not thread-safe ctor of the dialog).
+ @param pParent the parent window for the new dialog
+ */
+ virtual Dialog* createDialog(Window* _pParent) = 0;
+
+ /// called to destroy the dialog used. the default implementation just deletes m_pDialog and resets it to NULL
+ virtual void destroyDialog();
+
+ /** called after the dialog has been executed
+ @param _nExecutionResult the execution result as returned by Dialog::Execute
+ */
+ virtual void executedDialog(sal_Int16 /*_nExecutionResult*/) { }
+
+ /** smaller form of <method>initialize</method>.<p/>
+ The <method>initialize</method> method is called with a sequence of <type scope="com.sun.star.uno">Any</type>'s,
+ which is split up into the single elements, which are passed to implInitialize. The default implementation
+ tries to exract an <type scope="com.sun.star.beans">PropertyValue</type> from the value an pass it to the
+ <type scope="com.sun.star.beans">XPropertySet</type> interface of the object.
+ */
+ virtual void implInitialize(const com::sun::star::uno::Any& _rValue);
+
+ private:
+ DECL_LINK( OnDialogDying, VclWindowEvent* );
+
+ /** ensures that m_pDialog is not <NULL/>
+
+ This method does nothing if m_pDialog is already non-<NULL/>. Else, it calls createDialog and does
+ all necessary initializations of the new dialog instance.
+
+ @precond
+ m_aMutex is locked
+
+ @return
+ <TRUE/> if and only if m_pDialog is non-<NULL/> upon returning from the method. Note that the only
+ case where m_pDialog is <NULL/> is when createDialog returned <NULL/>, which is will fire an assertion
+ in non-product builds.
+ */
+ bool impl_ensureDialog_lck();
+ };
+
+ /// helper class for guarding access to methods of a OGenericUnoDialog
+ class UnoDialogEntryGuard
+ {
+ public:
+ UnoDialogEntryGuard( OGenericUnoDialog& _rDialog )
+ :m_aGuard( _rDialog.GetMutex() )
+ {
+ if ( _rDialog.needInitialization() )
+ throw ::com::sun::star::lang::NotInitializedException();
+ }
+
+ private:
+ ::osl::MutexGuard m_aGuard;
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // _SVT_GENERICUNODIALOG_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
new file mode 100644
index 000000000000..9a3bd8c1d1ff
--- /dev/null
+++ b/include/svtools/grfmgr.hxx
@@ -0,0 +1,624 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _GRFMGR_HXX
+#define _GRFMGR_HXX
+
+#include <vcl/graph.hxx>
+#include <svtools/svtdllapi.h>
+
+#define GRFMGR_DRAW_NOTCACHED 0x00000000UL
+#define GRFMGR_DRAW_CACHED 0x00000001UL
+#define GRFMGR_DRAW_SMOOTHSCALE 0x00000002UL
+#define GRFMGR_DRAW_USE_DRAWMODE_SETTINGS 0x00000004UL
+#define GRFMGR_DRAW_SUBSTITUTE 0x00000008UL
+#define GRFMGR_DRAW_NO_SUBSTITUTE 0x00000010UL
+#define GRFMGR_DRAW_STANDARD (GRFMGR_DRAW_CACHED|GRFMGR_DRAW_SMOOTHSCALE)
+
+// AutoSwap defines
+
+#define GRFMGR_AUTOSWAPSTREAM_LINK ((SvStream*)0x00000000UL)
+#define GRFMGR_AUTOSWAPSTREAM_LOADED ((SvStream*)0xfffffffdUL)
+#define GRFMGR_AUTOSWAPSTREAM_TEMP ((SvStream*)0xfffffffeUL)
+#define GRFMGR_AUTOSWAPSTREAM_NONE ((SvStream*)0xffffffffUL)
+
+// Adjustment defines
+
+#define ADJUSTMENT_NONE 0x00000000UL
+#define ADJUSTMENT_DRAWMODE 0x00000001UL
+#define ADJUSTMENT_COLORS 0x00000002UL
+#define ADJUSTMENT_MIRROR 0x00000004UL
+#define ADJUSTMENT_ROTATE 0x00000008UL
+#define ADJUSTMENT_TRANSPARENCY 0x00000010UL
+#define ADJUSTMENT_ALL 0xFFFFFFFFUL
+
+enum GraphicDrawMode
+{
+ GRAPHICDRAWMODE_STANDARD = 0,
+ GRAPHICDRAWMODE_GREYS = 1,
+ GRAPHICDRAWMODE_MONO = 2,
+ GRAPHICDRAWMODE_WATERMARK = 3
+};
+
+class GraphicManager;
+class SvStream;
+class BitmapWriteAccess;
+class GraphicCache;
+class VirtualDevice;
+struct GrfSimpleCacheObj;
+struct ImplTileInfo;
+
+class SVT_DLLPUBLIC GraphicAttr
+{
+private:
+
+ double mfGamma;
+ sal_uInt32 mnMirrFlags;
+ long mnLeftCrop;
+ long mnTopCrop;
+ long mnRightCrop;
+ long mnBottomCrop;
+ sal_uInt16 mnRotate10;
+ short mnContPercent;
+ short mnLumPercent;
+ short mnRPercent;
+ short mnGPercent;
+ short mnBPercent;
+ sal_Bool mbInvert;
+ sal_uInt8 mcTransparency;
+ GraphicDrawMode meDrawMode;
+
+public:
+
+ GraphicAttr();
+ ~GraphicAttr();
+
+ sal_Bool operator==( const GraphicAttr& rAttr ) const;
+ sal_Bool operator!=( const GraphicAttr& rAttr ) const { return !( *this == rAttr ); }
+
+ void SetDrawMode( GraphicDrawMode eDrawMode ) { meDrawMode = eDrawMode; }
+ GraphicDrawMode GetDrawMode() const { return meDrawMode; }
+
+ void SetMirrorFlags( sal_uLong nMirrFlags ) { mnMirrFlags = nMirrFlags; }
+ sal_uLong GetMirrorFlags() const { return mnMirrFlags; }
+
+ void SetCrop( long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM, long nBottom_100TH_MM )
+ {
+ mnLeftCrop = nLeft_100TH_MM; mnTopCrop = nTop_100TH_MM;
+ mnRightCrop = nRight_100TH_MM; mnBottomCrop = nBottom_100TH_MM;
+ }
+ long GetLeftCrop() const { return mnLeftCrop; }
+ long GetTopCrop() const { return mnTopCrop; }
+ long GetRightCrop() const { return mnRightCrop; }
+ long GetBottomCrop() const { return mnBottomCrop; }
+
+ void SetRotation( sal_uInt16 nRotate10 ) { mnRotate10 = nRotate10; }
+ sal_uInt16 GetRotation() const { return mnRotate10; }
+
+ void SetLuminance( short nLuminancePercent ) { mnLumPercent = nLuminancePercent; }
+ short GetLuminance() const { return mnLumPercent; }
+
+ void SetContrast( short nContrastPercent ) { mnContPercent = nContrastPercent; }
+ short GetContrast() const { return mnContPercent; }
+
+ void SetChannelR( short nChannelRPercent ) { mnRPercent = nChannelRPercent; }
+ short GetChannelR() const { return mnRPercent; }
+
+ void SetChannelG( short nChannelGPercent ) { mnGPercent = nChannelGPercent; }
+ short GetChannelG() const { return mnGPercent; }
+
+ void SetChannelB( short nChannelBPercent ) { mnBPercent = nChannelBPercent; }
+ short GetChannelB() const { return mnBPercent; }
+
+ void SetGamma( double fGamma ) { mfGamma = fGamma; }
+ double GetGamma() const { return mfGamma; }
+
+ void SetInvert( sal_Bool bInvert ) { mbInvert = bInvert; }
+ sal_Bool IsInvert() const { return mbInvert; }
+
+ void SetTransparency( sal_uInt8 cTransparency ) { mcTransparency = cTransparency; }
+ sal_uInt8 GetTransparency() const { return mcTransparency; }
+
+ sal_Bool IsSpecialDrawMode() const { return( meDrawMode != GRAPHICDRAWMODE_STANDARD ); }
+ sal_Bool IsMirrored() const { return( mnMirrFlags != 0UL ); }
+ sal_Bool IsCropped() const
+ {
+ return( mnLeftCrop != 0 || mnTopCrop != 0 ||
+ mnRightCrop != 0 || mnBottomCrop != 0 );
+ }
+ sal_Bool IsRotated() const { return( ( mnRotate10 % 3600 ) != 0 ); }
+ sal_Bool IsTransparent() const { return( mcTransparency > 0 ); }
+ sal_Bool IsAdjusted() const
+ {
+ return( mnLumPercent != 0 || mnContPercent != 0 || mnRPercent != 0 ||
+ mnGPercent != 0 || mnBPercent != 0 || mfGamma != 1.0 || mbInvert );
+ }
+
+ friend SvStream& operator<<( SvStream& rOStm, const GraphicAttr& rAttr );
+ friend SvStream& operator>>( SvStream& rIStm, GraphicAttr& rAttr );
+};
+
+class SVT_DLLPUBLIC GraphicObject : public SvDataCopyStream
+{
+ friend class GraphicManager;
+
+private:
+
+ static GraphicManager* mpGlobalMgr;
+
+ Graphic maGraphic;
+ GraphicAttr maAttr;
+ Size maPrefSize;
+ MapMode maPrefMapMode;
+ sal_uLong mnSizeBytes;
+ GraphicType meType;
+ GraphicManager* mpMgr;
+ String* mpLink;
+ Link* mpSwapStreamHdl;
+ String* mpUserData;
+ Timer* mpSwapOutTimer;
+ GrfSimpleCacheObj* mpSimpleCache;
+ sal_uLong mnAnimationLoopCount;
+ sal_Bool mbAutoSwapped : 1;
+ sal_Bool mbTransparent : 1;
+ sal_Bool mbAnimated : 1;
+ sal_Bool mbEPS : 1;
+ sal_Bool mbIsInSwapIn : 1;
+ sal_Bool mbIsInSwapOut : 1;
+ sal_Bool mbAlpha : 1;
+
+ void SVT_DLLPRIVATE ImplConstruct();
+ void SVT_DLLPRIVATE ImplAssignGraphicData();
+ void SVT_DLLPRIVATE ImplSetGraphicManager(
+ const GraphicManager* pMgr,
+ const OString* pID = NULL,
+ const GraphicObject* pCopyObj = NULL
+ );
+ void SVT_DLLPRIVATE ImplAutoSwapIn();
+ sal_Bool SVT_DLLPRIVATE ImplIsAutoSwapped() const { return mbAutoSwapped; }
+ sal_Bool SVT_DLLPRIVATE ImplGetCropParams(
+ OutputDevice* pOut,
+ Point& rPt,
+ Size& rSz,
+ const GraphicAttr* pAttr,
+ PolyPolygon& rClipPolyPoly,
+ sal_Bool& bRectClipRegion
+ ) const;
+
+ /** Render a given number of tiles in an optimized way
+
+ This method recursively subdivides the tile rendering problem
+ in smaller parts, i.e. rendering output size x with few tiles
+ of size y, which in turn are generated from the original
+ bitmap in a recursive fashion. The subdivision size can be
+ controlled by the exponent argument, which specifies the
+ minimal number of smaller tiles used in one recursion
+ step. The resulting tile size is given as the integer number
+ of repetitions of the original bitmap along x and y. As the
+ exponent need not necessarily divide these numbers without
+ remainder, the repetition counts are effectively converted to
+ base-exponent numbers, where each place denotes the number of
+ times the corresponding tile size is rendered.
+
+ @param rVDev
+ Virtual device to render everything into
+
+ @param nExponent
+ Number of repetitions per subdivision step, _must_ be greater than 1
+
+ @param nNumTilesX
+ Number of original tiles to generate in x direction
+
+ @param nNumTilesY
+ Number of original tiles to generate in y direction
+
+ @param rTileSizePixel
+ Size in pixel of the original tile bitmap to render it in
+
+ @param pAttr
+ Graphic attributes to be used for rendering
+
+ @param nFlags
+ Graphic flags to be used for rendering
+
+ @param rCurrPos
+ Current output point for this recursion level (should start with (0,0))
+
+ @return true, if everything was successfully rendered.
+ */
+ bool SVT_DLLPRIVATE ImplRenderTempTile(
+ VirtualDevice& rVDev,
+ int nExponent,
+ int nNumTilesX,
+ int nNumTilesY,
+ const Size& rTileSizePixel,
+ const GraphicAttr* pAttr,
+ sal_uLong nFlags
+ );
+
+ /// internally called by ImplRenderTempTile()
+ bool SVT_DLLPRIVATE ImplRenderTileRecursive(
+ VirtualDevice& rVDev,
+ int nExponent,
+ int nMSBFactor,
+ int nNumOrigTilesX,
+ int nNumOrigTilesY,
+ int nRemainderTilesX,
+ int nRemainderTilesY,
+ const Size& rTileSizePixel,
+ const GraphicAttr* pAttr,
+ sal_uLong nFlags,
+ ImplTileInfo& rTileInfo
+ );
+
+ bool SVT_DLLPRIVATE ImplDrawTiled(
+ OutputDevice* pOut,
+ const Rectangle& rArea,
+ const Size& rSizePixel,
+ const Size& rOffset,
+ const GraphicAttr* pAttr,
+ sal_uLong nFlags,
+ int nTileCacheSize1D
+ );
+
+ bool SVT_DLLPRIVATE ImplDrawTiled(
+ OutputDevice& rOut,
+ const Point& rPos,
+ int nNumTilesX,
+ int nNumTilesY,
+ const Size& rTileSize,
+ const GraphicAttr* pAttr,
+ sal_uLong nFlags
+ );
+
+ void SVT_DLLPRIVATE ImplTransformBitmap(
+ BitmapEx& rBmpEx,
+ const GraphicAttr& rAttr,
+ const Size& rCropLeftTop,
+ const Size& rCropRightBottom,
+ const Rectangle& rCropRect,
+ const Size& rDstSize,
+ sal_Bool bEnlarge
+ ) const;
+
+ DECL_LINK( ImplAutoSwapOutHdl, void* );
+
+protected:
+
+ virtual void GraphicManagerDestroyed();
+ virtual SvStream* GetSwapStream() const;
+
+ virtual void Load( SvStream& );
+ virtual void Save( SvStream& );
+ virtual void Assign( const SvDataCopyStream& );
+
+public:
+
+ TYPEINFO();
+
+ GraphicObject( const GraphicManager* pMgr = NULL );
+ GraphicObject( const Graphic& rGraphic, const GraphicManager* pMgr = NULL );
+ GraphicObject( const GraphicObject& rCacheObj, const GraphicManager* pMgr = NULL );
+ explicit GraphicObject( const OString& rUniqueID, const GraphicManager* pMgr = NULL );
+ ~GraphicObject();
+
+ GraphicObject& operator=( const GraphicObject& rCacheObj );
+ sal_Bool operator==( const GraphicObject& rCacheObj ) const;
+ sal_Bool operator!=( const GraphicObject& rCacheObj ) const { return !( *this == rCacheObj ); }
+
+ sal_Bool HasSwapStreamHdl() const { return( mpSwapStreamHdl != NULL && mpSwapStreamHdl->IsSet() ); }
+ void SetSwapStreamHdl();
+ void SetSwapStreamHdl( const Link& rHdl, const sal_uLong nSwapOutTimeout = 0UL );
+ sal_uLong GetSwapOutTimeout() const { return( mpSwapOutTimer ? mpSwapOutTimer->GetTimeout() : 0 ); }
+
+ void FireSwapInRequest();
+ void FireSwapOutRequest();
+
+ GraphicManager& GetGraphicManager() const { return *mpMgr; }
+
+ sal_Bool IsCached(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ const GraphicAttr* pAttr = NULL,
+ sal_uLong nFlags = GRFMGR_DRAW_STANDARD
+ ) const;
+ void ReleaseFromCache();
+
+ const Graphic& GetGraphic() const;
+ void SetGraphic( const Graphic& rGraphic, const GraphicObject* pCopyObj = 0);
+ void SetGraphic( const Graphic& rGraphic, const String& rLink );
+
+ /** Get graphic transformed according to given attributes
+
+ This method returns a Graphic transformed, cropped and scaled
+ to the given parameters, ready to be rendered to printer or
+ display. The returned graphic has the same visual appearance
+ as if it had been drawn via GraphicObject::Draw() to a
+ specific output device.
+
+ @param rDestSize
+ Desired output size in logical coordinates. The mapmode to
+ interpret these logical coordinates in is given by the second
+ parameter, rDestMap.
+
+ @param rDestMap
+ Mapmode the output should be interpreted in. This is used to
+ interpret rDestSize, to set the appropriate PrefMapMode on the
+ returned Graphic, and to deal correctly with metafile graphics.
+
+ @param rAttr
+ Graphic attributes used to transform the graphic. This
+ includes cropping, rotation, mirroring, and various color
+ adjustment parameters.
+
+ @return the readily transformed Graphic
+ */
+ Graphic GetTransformedGraphic(
+ const Size& rDestSize,
+ const MapMode& rDestMap,
+ const GraphicAttr& rAttr
+ ) const;
+ Graphic GetTransformedGraphic( const GraphicAttr* pAttr = NULL ) const; // TODO: Change to Impl
+
+ void SetAttr( const GraphicAttr& rAttr );
+ const GraphicAttr& GetAttr() const { return maAttr; }
+
+ sal_Bool HasLink() const { return( mpLink != NULL && mpLink->Len() > 0 ); }
+ void SetLink();
+ void SetLink( const String& rLink );
+ String GetLink() const;
+
+ sal_Bool HasUserData() const { return( mpUserData != NULL && mpUserData->Len() > 0 ); }
+ void SetUserData();
+ void SetUserData( const String& rUserData );
+ String GetUserData() const;
+
+ OString GetUniqueID() const;
+
+ GraphicType GetType() const { return meType; }
+ const Size& GetPrefSize() const { return maPrefSize; }
+ const MapMode& GetPrefMapMode() const { return maPrefMapMode; }
+ sal_uLong GetSizeBytes() const { return mnSizeBytes; }
+ sal_Bool IsTransparent() const { return mbTransparent; }
+ sal_Bool IsAlpha() const { return mbAlpha; }
+ sal_Bool IsAnimated() const { return mbAnimated; }
+ sal_Bool IsEPS() const { return mbEPS; }
+
+ Link GetAnimationNotifyHdl() const { return maGraphic.GetAnimationNotifyHdl(); }
+
+ sal_Bool SwapOut();
+ sal_Bool SwapOut( SvStream* pOStm );
+ sal_Bool SwapIn();
+
+ sal_Bool IsInSwapIn() const { return mbIsInSwapIn; }
+ sal_Bool IsInSwapOut() const { return mbIsInSwapOut; }
+ sal_Bool IsInSwap() const { return( mbIsInSwapOut || mbIsInSwapOut ); }
+ sal_Bool IsSwappedOut() const { return( mbAutoSwapped || maGraphic.IsSwapOut() ); }
+ void SetSwapState();
+
+ bool Draw(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ const GraphicAttr* pAttr = NULL,
+ sal_uLong nFlags = GRFMGR_DRAW_STANDARD
+ );
+
+ sal_Bool DrawWithPDFHandling(
+ OutputDevice& rOutDev,
+ const Point& rPt,
+ const Size& rSz,
+ const GraphicAttr* pGrfAttr = NULL,
+ const sal_uLong nFlags = GRFMGR_DRAW_STANDARD
+ );
+
+ /** Draw the graphic repeatedly into the given output rectangle
+
+ @param pOut
+ OutputDevice where the rendering should take place
+
+ @param rArea
+ The output area that is filled with tiled instances of this graphic
+
+ @param rSize
+ The actual size of a single tile
+
+ @param rOffset
+ Offset from the left, top position of rArea, where to start
+ the tiling. The upper left corner of the graphic tilings will
+ virtually start at this position. Concretely, only that many
+ tiles are drawn to completely fill the given output area.
+
+ @param pAttr
+ Optional GraphicAttr
+
+ @param nFlags
+ Optional rendering flags
+
+ @param nTileCacheSize1D
+ Optional dimension of the generated cache tiles. The pOut sees
+ a number of tile draws, which have approximately
+ nTileCacheSize1D times nTileCacheSize1D bitmap sizes if the
+ tile bitmap is smaller. Otherwise, the tile is drawn as
+ is. This is useful if e.g. you want only a few, very large
+ bitmap drawings appear on the outdev.
+
+ @return sal_True, if drawing completed successfully
+ */
+ sal_Bool DrawTiled(
+ OutputDevice* pOut,
+ const Rectangle& rArea,
+ const Size& rSize,
+ const Size& rOffset,
+ const GraphicAttr* pAttr = NULL,
+ sal_uLong nFlags = GRFMGR_DRAW_STANDARD,
+ int nTileCacheSize1D=128
+ );
+
+ sal_Bool StartAnimation(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ long nExtraData = 0L,
+ const GraphicAttr* pAttr = NULL,
+ sal_uLong nFlags = GRFMGR_DRAW_STANDARD,
+ OutputDevice* pFirstFrameOutDev = NULL
+ );
+
+ void StopAnimation( OutputDevice* pOut = NULL, long nExtraData = 0L );
+
+ friend SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj );
+ friend SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj );
+
+ static GraphicObject CreateGraphicObjectFromURL( const OUString &rURL );
+ // will inspect an object ( e.g. a control ) for any 'ImageURL'
+ // properties and return these in a vector. Note: this implementation
+ // will cater for XNameContainer objects and deepinspect any containees
+ // if they exist
+ static void InspectForGraphicObjectImageURL( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIf, std::vector< OUString >& rvEmbedImgUrls );
+};
+
+typedef ::std::vector< GraphicObject* > GraphicObjectList_impl;
+
+class SVT_DLLPUBLIC GraphicManager
+{
+ friend class GraphicObject;
+ friend class GraphicDisplayCacheEntry;
+
+private:
+
+ GraphicObjectList_impl maObjList;
+ GraphicCache* mpCache;
+
+ GraphicManager( const GraphicManager& ) {}
+ GraphicManager& operator=( const GraphicManager& ) { return *this; }
+
+ sal_Bool SVT_DLLPRIVATE ImplDraw(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ GraphicObject& rObj,
+ const GraphicAttr& rAttr,
+ const sal_uLong nFlags,
+ sal_Bool& rCached
+ );
+
+ sal_Bool SVT_DLLPRIVATE ImplCreateOutput(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ const BitmapEx& rBmpEx,
+ const GraphicAttr& rAttr,
+ const sal_uLong nFlags,
+ BitmapEx* pBmpEx = NULL
+ );
+ sal_Bool SVT_DLLPRIVATE ImplCreateOutput(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ const GDIMetaFile& rMtf,
+ const GraphicAttr& rAttr,
+ const sal_uLong nFlags,
+ GDIMetaFile& rOutMtf,
+ BitmapEx& rOutBmpEx
+ );
+
+ static void SVT_DLLPRIVATE ImplAdjust(
+ BitmapEx& rBmpEx,
+ const GraphicAttr& rAttr,
+ sal_uLong nAdjustmentFlags
+ );
+ static void SVT_DLLPRIVATE ImplAdjust(
+ GDIMetaFile& rMtf,
+ const GraphicAttr& rAttr,
+ sal_uLong nAdjustmentFlags
+ );
+ static void SVT_DLLPRIVATE ImplAdjust(
+ Animation& rAnimation,
+ const GraphicAttr& rAttr,
+ sal_uLong nAdjustmentFlags
+ );
+
+ static void SVT_DLLPRIVATE ImplDraw(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ const GDIMetaFile& rMtf,
+ const GraphicAttr& rAttr
+ );
+
+ // Only used by GraphicObject's Ctor's and Dtor's
+ void SVT_DLLPRIVATE ImplRegisterObj(
+ const GraphicObject& rObj,
+ Graphic& rSubstitute,
+ const OString* pID = NULL,
+ const GraphicObject* pCopyObj = NULL
+ );
+ void SVT_DLLPRIVATE ImplUnregisterObj( const GraphicObject& rObj );
+ inline sal_Bool SVT_DLLPRIVATE ImplHasObjects() const { return !maObjList.empty(); }
+
+ // Only used in swap case by GraphicObject
+ void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj );
+ sal_Bool SVT_DLLPRIVATE ImplFillSwappedGraphicObject(
+ const GraphicObject& rObj,
+ Graphic& rSubstitute
+ );
+ void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj );
+
+ OString SVT_DLLPRIVATE ImplGetUniqueID( const GraphicObject& rObj ) const;
+
+public:
+
+ GraphicManager( sal_uLong nCacheSize = 10000000UL, sal_uLong nMaxObjCacheSize = 2400000UL );
+ ~GraphicManager();
+
+ void SetMaxCacheSize( sal_uLong nNewCacheSize );
+
+ void SetMaxObjCacheSize(
+ sal_uLong nNewMaxObjSize,
+ sal_Bool bDestroyGreaterCached = sal_False
+ );
+
+ void SetCacheTimeout( sal_uLong nTimeoutSeconds );
+
+ void ReleaseFromCache( const GraphicObject& rObj );
+
+ sal_Bool IsInCache(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ const GraphicObject& rObj,
+ const GraphicAttr& rAttr
+ ) const;
+
+ sal_Bool DrawObj(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ GraphicObject& rObj,
+ const GraphicAttr& rAttr,
+ const sal_uLong nFlags,
+ sal_Bool& rCached
+ );
+};
+
+#endif // _GRFMGR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/headbar.hxx b/include/svtools/headbar.hxx
new file mode 100644
index 000000000000..9be63ce3229d
--- /dev/null
+++ b/include/svtools/headbar.hxx
@@ -0,0 +1,377 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _HEADBAR_HXX
+#define _HEADBAR_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <vcl/window.hxx>
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class HeaderBar
+
+Diese Klasse dient zur Anzeige einer Ueberschiftszeile. Diese kann Texte,
+Images oder beides anzeigen. Man kann die Items in der Groesse aendern,
+verschieben oder anklicken. In vielen Faellen macht es zum Beispiel Sinn,
+dieses Control mit einer SvTabListBox zu verbinden.
+
+--------------------------------------------------------------------------
+
+WinBits
+
+WB_BORDER Oben und unten wird ein Border gezeichnet
+WB_BOTTOMBORDER Unten wird ein Border gezeichnet
+WB_BUTTONSTYLE Die Items sehen aus wie Buttons, ansonsten sind sie flach
+WB_3DLOOK 3D-Darstellung
+WB_DRAG Items koennen verschoben werden
+WB_STDHEADERBAR WB_BUTTONSTYLE | WB_BOTTOMBORDER
+
+--------------------------------------------------------------------------
+
+ItemBits
+
+HIB_LEFT Inhalt wird im Item linksbuendig ausgegeben
+HIB_CENTER Inhalt wird im Item zentriert ausgegeben
+HIB_RIGHT Inhalt wird im Item rechtsbuendig ausgegeben
+HIB_TOP Inhalt wird im Item an der oberen Kante ausgegeben
+HIB_VCENTER Inhalt wird im Item vertikal zentiert ausgegeben
+HIB_BOTTOM Inhalt wird im Item an der unteren Kante ausgegeben
+HIB_LEFTIMAGE Bei Text und Image, wird Image links vom Text ausgegeben
+HIB_RIGHTIMAGE Bei Text und Image, wird Image rechts vom Text ausgegeben
+HIB_FIXED Item laesst sich nicht in der Groesse aendern
+HIB_FIXEDPOS Item laesst sich nicht verschieben
+HIB_CLICKABLE Item laesst sich anklicken
+ (Select-Handler wird erst bei MouseButtonUp gerufen)
+HIB_FLAT Item wird flach dargestellt, auch wenn WB_BUTTONSTYLE gesetzt ist
+HIB_DOWNARROW Es wird ein Pfeil nach unter hinter dem Text ausgegeben,
+ welcher zum Beispiel angezeigt werden sollte, wenn nach
+ diesem Item eine dazugehoerende Liste absteigend sortiert
+ ist. Der Status des Pfeils kann mit SetItemBits()
+ gesetzt/zurueckgesetzt werden.
+HIB_UPARROW Es wird ein Pfeil nach oben hinter dem Text ausgegeben,
+ welcher zum Beispiel angezeigt werden sollte, wenn nach
+ diesem Item eine dazugehoerende Liste aufsteigend sortiert
+ ist.Der Status des Pfeils kann mit SetItemBits()
+ gesetzt/zurueckgesetzt werden.
+HIB_USERDRAW Zu diesem Item wird auch der UserDraw-Handler gerufen.
+HIB_STDSTYLE (HIB_LEFT | HIB_LEFTIMAGE | HIB_VCENTER | HIB_CLICKABLE)
+
+--------------------------------------------------------------------------
+
+Handler
+
+Select() Wird gerufen, wenn Item angeklickt wird. Wenn
+ HIB_CLICKABLE beim Item gesetzt ist und nicht HIB_FLAT,
+ wird der Handler erst im MouseButtonUp-Handler gerufen,
+ wenn die Maus ueber dem Item losgelassen wurde. Dann
+ verhaellt sich der Select-Handler wie bei einem
+ ToolBox-Button.
+DoubleClick() Dieser Handler wird gerufen, wenn ein Item
+ doppelt geklickt wird. Ob das Item oder der
+ Trenner angeklickt wurden, kann mit IsItemMode()
+ abgefragt werden. Wenn ein Trenner doppelt angeklickt
+ wird, sollte normalerweise die optimale Spaltenbreite
+ berechnet werden und diese gesetzt werden.
+StartDrag() Dieser Handler wird gerufen, wenn Draggen gestartet
+ wird, bzw. wenn ein Item angeklickt wurde.
+ In diesem Handler sollte spaetestens mit SetDragSize()
+ die Groesse der Size-Linie gesetzt werden, wenn
+ IsItemMode() sal_False zurueckliefert.
+Drag() Dieser Handler wird gerufen, wenn gedraggt wird. Wenn
+ mit SetDragSize() keine Groesse gesetzt wird, kann
+ dieser Handler dafuer benutzt werden, um die
+ Linie im angrenzenden Fenster selber zu zeichnen. Mit
+ GetDragPos() kann die aktuelle Drag-Position abgefragt
+ werden. Mit IsItemMode() sollte in diesem Fall
+ abgefragt werden, ob auch ein Trenner gedraggt wird.
+EndDrag() Dieser Handler wird gerufen, wenn ein Drag-Vorgang
+ beendet wurde. Wenn im EndDrag-Handler GetCurItemId()
+ 0 zurueckliefert, wurde der Drag-Vorgang abgebrochen.
+ Wenn dies nicht der Fall ist und IsItemMode() sal_False
+ zurueckliefert, sollte von dem gedraggten Item
+ die neue Groesse mit GetItemSize() abgefragt werden
+ und entsprechend im dazugehoerigem Control uebernommen
+ werden. Wenn IsItemMode() sal_True, GetCurItemId() eine Id
+ und IsItemDrag() sal_True zurueckliefert, wurde dieses
+ Item verschoben. Es sollte dann mit GetItemPos() die
+ neue Position abgefragt werden und auch die Daten
+ im dazugehoerigem Control angepasst werden. Ansonsten
+ koennte auch mit GetItemDragPos() die Position abgefragt
+ werden, an welche Stelle das Item verschoben wurde.
+
+
+Weitere Methoden, die fuer die Handler wichtig sind.
+
+GetCurItemId() Liefert die Id vom Item zurueck, fuer welches gerade
+ der Handler gerufen wurde. Liefert nur eine gueltige
+ Id in den Handlern Select(), DoubleClick(), StartDrag(),
+ Drag() und EndDrag(). Im EndDrag-Handler leifert
+ diese Methode die Id vom gedraggten Item zurueck oder
+ 0, wenn der Drag-Vorgang abgebrochen wurde.
+GetItemDragPos() Liefert die Position zurueck, an der ein Item verschoben
+ wird bzw. wurde. HEADERBAR_ITEM_NOTFOUND wird
+ zurueckgeliefert, wenn der Vorgang abgebrochen wurde
+ oder wenn kein ItemDrag aktiv ist.
+IsItemMode() Mit dieser Methode kann abgefragt werden, ob fuer ein
+ Item oder einen Trenner der Handler gerufen wurde.
+ sal_True - Handler wurde fuer das Item gerufen
+ sal_False - Handler wurde fuer den Trenner gerufen
+IsItemDrag() Mit dieser Methode kann abgefragt werden, ob ein
+ Item gedragt oder selektiert wurde.
+ sal_True - Item wird verschoben
+ sal_False - Item wird selektiert
+SetDragSize() Mit dieser Methode wird gesetzt, wir gross der
+ Trennstrich sein soll, der vom Control gemalt wird.
+ Dies sollte so gross sein, wie das angrenzende Fenster
+ hoch ist. Die Hoehe vom HeaderBar wird automatisch
+ dazugerechnet.
+
+--------------------------------------------------------------------------
+
+Weitere Methoden
+
+SetOffset() Mit dieser Methode wird der Offset gesetzt, ab dem
+ die Items ausgegeben werden. Dies wird benoetigt,
+ wenn das dazugehoerige Fenster gescrollt wird.
+CalcWindowSizePixel() Mit dieser Methode kann man die Hoehe des Fensters
+ berechnen, damit der Inhalt der Items ausgegeben
+ werden kann.
+
+--------------------------------------------------------------------------
+
+Tips und Tricks:
+
+1) KontextMenu
+Wenn ein kontextsensitives PopupMenu anzeigt werden soll, muss der
+Command-Handler ueberlagert werden. Mit GetItemId() und bei
+Uebergabe der Mausposition kann ermittelt werden, ob der Mausclick
+ueber einem bzw. ueber welchem Item durchgefuehrt wurde.
+
+2) Letztes Item
+Wenn man ButtonStyle gesetzt hat, sieht es besser aus, wenn man am
+Ende noch ein leeres Item setzt, was den restlichen Platz einnimmt.
+Dazu fuegt man ein Item mit einem leeren String ein und uebergibt als
+Groesse HEADERBAR_FULLSIZE. Bei diesem Item sollte man dann auch
+nicht HIB_CLICKABLE setzen und dafuer HIB_FIXEDPOS.
+
+*************************************************************************/
+
+class Accelerator;
+class ImplHeadItem;
+
+typedef ::std::vector< ImplHeadItem* > ImplHeadItemList;
+
+// -----------
+// - WinBits -
+// -----------
+
+#define WB_BOTTOMBORDER ((WinBits)0x0400)
+#define WB_BUTTONSTYLE ((WinBits)0x0800)
+#define WB_STDHEADERBAR (WB_BUTTONSTYLE | WB_BOTTOMBORDER)
+
+// ---------------------
+// - HeaderBarItemBits -
+// ---------------------
+
+typedef sal_uInt16 HeaderBarItemBits;
+
+// ----------------------------
+// - Bits fuer HeaderBarItems -
+// ----------------------------
+
+#define HIB_LEFT ((HeaderBarItemBits)0x0001)
+#define HIB_CENTER ((HeaderBarItemBits)0x0002)
+#define HIB_RIGHT ((HeaderBarItemBits)0x0004)
+#define HIB_TOP ((HeaderBarItemBits)0x0008)
+#define HIB_VCENTER ((HeaderBarItemBits)0x0010)
+#define HIB_BOTTOM ((HeaderBarItemBits)0x0020)
+#define HIB_LEFTIMAGE ((HeaderBarItemBits)0x0040)
+#define HIB_RIGHTIMAGE ((HeaderBarItemBits)0x0080)
+#define HIB_FIXED ((HeaderBarItemBits)0x0100)
+#define HIB_FIXEDPOS ((HeaderBarItemBits)0x0200)
+#define HIB_CLICKABLE ((HeaderBarItemBits)0x0400)
+#define HIB_FLAT ((HeaderBarItemBits)0x0800)
+#define HIB_DOWNARROW ((HeaderBarItemBits)0x1000)
+#define HIB_UPARROW ((HeaderBarItemBits)0x2000)
+#define HIB_USERDRAW ((HeaderBarItemBits)0x4000)
+#define HIB_STDSTYLE (HIB_LEFT | HIB_LEFTIMAGE | HIB_VCENTER | HIB_CLICKABLE)
+
+// -------------------
+// - HeaderBar-Types -
+// -------------------
+
+#define HEADERBAR_APPEND ((sal_uInt16)0xFFFF)
+#define HEADERBAR_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
+#define HEADERBAR_FULLSIZE ((long)1000000000)
+
+#define HEADERBAR_TEXTOFF 2
+
+// -------------
+// - HeaderBar -
+// -------------
+
+class SVT_DLLPUBLIC HeaderBar : public Window
+{
+private:
+ ImplHeadItemList* mpItemList;
+ long mnBorderOff1;
+ long mnBorderOff2;
+ long mnOffset;
+ long mnDX;
+ long mnDY;
+ long mnDragSize;
+ long mnStartPos;
+ long mnDragPos;
+ long mnMouseOff;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnItemDragPos;
+ sal_Bool mbDragable;
+ sal_Bool mbDrag;
+ sal_Bool mbItemDrag;
+ sal_Bool mbOutDrag;
+ sal_Bool mbButtonStyle;
+ sal_Bool mbItemMode;
+ Link maStartDragHdl;
+ Link maDragHdl;
+ Link maEndDragHdl;
+ Link maSelectHdl;
+ Link maDoubleClickHdl;
+ Link maCreateAccessibleHdl;
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ mxAccessible;
+
+#ifdef _SV_HEADBAR_CXX
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle );
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SVT_DLLPRIVATE long ImplGetItemPos( sal_uInt16 nPos ) const;
+ SVT_DLLPRIVATE Rectangle ImplGetItemRect( sal_uInt16 nPos ) const;
+ using Window::ImplHitTest;
+ SVT_DLLPRIVATE sal_uInt16 ImplHitTest( const Point& rPos, long& nMouseOff, sal_uInt16& nPos ) const;
+ SVT_DLLPRIVATE void ImplInvertDrag( sal_uInt16 nStartPos, sal_uInt16 nEndPos );
+ SVT_DLLPRIVATE void ImplDrawItem( OutputDevice* pDev,
+ sal_uInt16 nPos, sal_Bool bHigh, sal_Bool bDrag,
+ const Rectangle& rItemRect,
+ const Rectangle* pRect,
+ sal_uLong nFlags );
+ SVT_DLLPRIVATE void ImplDrawItem( sal_uInt16 nPos, sal_Bool bHigh = sal_False,
+ sal_Bool bDrag = sal_False,
+ const Rectangle* pRect = NULL );
+ SVT_DLLPRIVATE void ImplUpdate( sal_uInt16 nPos,
+ sal_Bool bEnd = sal_False, sal_Bool bDirect = sal_False );
+ SVT_DLLPRIVATE void ImplStartDrag( const Point& rPos, sal_Bool bCommand );
+ SVT_DLLPRIVATE void ImplDrag( const Point& rPos );
+ SVT_DLLPRIVATE void ImplEndDrag( sal_Bool bCancel );
+#endif
+
+public:
+ HeaderBar( Window* pParent, WinBits nWinBits = WB_STDHEADERBAR );
+ HeaderBar( Window* pParent, const ResId& rResId );
+ ~HeaderBar();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+ virtual void StartDrag();
+ virtual void Drag();
+ virtual void EndDrag();
+ virtual void Select();
+ virtual void DoubleClick();
+
+ void InsertItem( sal_uInt16 nItemId, const XubString& rText,
+ long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
+ sal_uInt16 nPos = HEADERBAR_APPEND );
+ void RemoveItem( sal_uInt16 nItemId );
+ void MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos );
+ void Clear();
+
+ void SetOffset( long nNewOffset = 0 );
+ long GetOffset() const { return mnOffset; }
+ inline void SetDragSize( long nNewSize = 0 ) { mnDragSize = nNewSize; }
+ long GetDragSize() const { return mnDragSize; }
+
+ sal_uInt16 GetItemCount() const;
+ sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ Rectangle GetItemRect( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetCurItemId() const { return mnCurItemId; }
+ long GetDragPos() const { return mnDragPos; }
+ sal_uInt16 GetItemDragPos() const { return mnItemDragPos; }
+ sal_Bool IsItemMode() const { return mbItemMode; }
+ sal_Bool IsItemDrag() const { return mbItemDrag; }
+
+ void SetItemSize( sal_uInt16 nItemId, long nNewSize );
+ long GetItemSize( sal_uInt16 nItemId ) const;
+ void SetItemBits( sal_uInt16 nItemId, HeaderBarItemBits nNewBits );
+ HeaderBarItemBits GetItemBits( sal_uInt16 nItemId ) const;
+
+ void SetItemText( sal_uInt16 nItemId, const XubString& rText );
+ XubString GetItemText( sal_uInt16 nItemId ) const;
+
+ XubString GetHelpText( sal_uInt16 nItemId ) const;
+ OString GetHelpId( sal_uInt16 nItemId ) const;
+
+ Size CalcWindowSizePixel() const;
+
+ inline void SetHelpText( const String& rText ) { Window::SetHelpText( rText ); }
+ inline const String& GetHelpText() const { return Window::GetHelpText(); }
+ inline void SetHelpId( const OString& rId ) { Window::SetHelpId( rId ); }
+ inline const OString& GetHelpId() const { return Window::GetHelpId(); }
+
+ inline void SetStartDragHdl( const Link& rLink ) { maStartDragHdl = rLink; }
+ inline const Link& GetStartDragHdl() const { return maStartDragHdl; }
+ inline void SetDragHdl( const Link& rLink ) { maDragHdl = rLink; }
+ inline const Link& GetDragHdl() const { return maDragHdl; }
+ inline void SetEndDragHdl( const Link& rLink ) { maEndDragHdl = rLink; }
+ inline const Link& GetEndDragHdl() const { return maEndDragHdl; }
+ inline void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ inline const Link& GetSelectHdl() const { return maSelectHdl; }
+ inline void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ inline const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ inline void SetCreateAccessibleHdl( const Link& rLink ) { maCreateAccessibleHdl = rLink; }
+ inline const Link& GetCreateAccessibleHdl() const { return maCreateAccessibleHdl; }
+
+ inline sal_Bool IsDragable() const { return mbDragable; }
+
+ /** Creates and returns the accessible object of the header bar. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+ void SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > );
+};
+
+#endif // _HEADBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/helpid.hrc b/include/svtools/helpid.hrc
new file mode 100644
index 000000000000..0751c5b70cd7
--- /dev/null
+++ b/include/svtools/helpid.hrc
@@ -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 _SVT_HELPID_HRC
+#define _SVT_HELPID_HRC
+
+#define HID_FILEDLG_PATHDLG "SVT_HID_FILEDLG_PATHDLG"
+#define HID_FILEDLG_DIR "SVT_HID_FILEDLG_DIR"
+#define HID_FILEDLG_EDIT "SVT_HID_FILEDLG_EDIT"
+#define HID_FILEDLG_DIRS "SVT_HID_FILEDLG_DIRS"
+#define HID_FILEDLG_DRIVE "SVT_HID_FILEDLG_DRIVE"
+#define HID_FILEDLG_DRIVES "SVT_HID_FILEDLG_DRIVES"
+#define HID_FILEDLG_NEWDIR "SVT_HID_FILEDLG_NEWDIR"
+#define HID_FILEDLG_HOME "SVT_HID_FILEDLG_HOME"
+#define HID_FILEDLG_FILE "SVT_HID_FILEDLG_FILE"
+#define HID_FILEDLG_LINK_CB "SVT_HID_FILEDLG_LINK_CB"
+#define HID_FILEDLG_PREVIEW_CB "SVT_HID_FILEDLG_PREVIEW_CB"
+#define HID_FILEDLG_STANDARD "SVT_HID_FILEDLG_STANDARD"
+#define HID_FILEDLG_MANAGER "SVT_HID_FILEDLG_MANAGER"
+#define HID_FILEDLG_URL "SVT_HID_FILEDLG_URL"
+#define HID_FILEDLG_USE_PASSWD "SVT_HID_FILEDLG_USE_PASSWD"
+#define HID_FILEDLG_READ_ONLY "SVT_HID_FILEDLG_READ_ONLY"
+#define HID_FILEDLG_AUTOCOMPLETEBOX "SVT_HID_FILEDLG_AUTOCOMPLETEBOX"
+#define HID_FILEDLG_SAVE_BTN "SVT_HID_FILEDLG_SAVE_BTN"
+#define HID_FILEDLG_SAVE_FILENAME "SVT_HID_FILEDLG_SAVE_FILENAME"
+#define HID_FILEDLG_SAVE_FILETYPE "SVT_HID_FILEDLG_SAVE_FILETYPE"
+#define HID_FILEDLG_INSERT_BTN "SVT_HID_FILEDLG_INSERT_BTN"
+#define HID_FILEDLG_PATH_BTN "SVT_HID_FILEDLG_PATH_BTN"
+#define HID_FILEDLG_PATH_FILENAME "SVT_HID_FILEDLG_PATH_FILENAME"
+#define HID_FILEDLG_FOLDER_BTN "SVT_HID_FILEDLG_FOLDER_BTN"
+#define HID_FILEDLG_FOLDER_FILENAME "SVT_HID_FILEDLG_FOLDER_FILENAME"
+#define HID_FILEDLG_SRCHFOLDER_BTN "SVT_HID_FILEDLG_SRCHFOLDER_BTN"
+#define HID_FILEDLG_EDIT_FAVORITES_LISTBOX "SVT_HID_FILEDLG_EDIT_FAVORITES_LISTBOX"
+#define HID_FILEDLG_EDIT_FAVORITES_HEADERBAR "SVT_HID_FILEDLG_EDIT_FAVORITES_HEADERBAR"
+
+// Help ids of template dialog
+#define HID_TEMPLATEDLG_DIALOG "SVT_HID_TEMPLATEDLG_DIALOG"
+#define HID_TEMPLATEDLG_ICONCTRL "SVT_HID_TEMPLATEDLG_ICONCTRL"
+#define HID_TEMPLATEDLG_FILEVIEW "SVT_HID_TEMPLATEDLG_FILEVIEW"
+#define HID_TEMPLATEDLG_TB_BACK "SVT_HID_TEMPLATEDLG_TB_BACK"
+#define HID_TEMPLATEDLG_TB_PREV "SVT_HID_TEMPLATEDLG_TB_PREV"
+#define HID_TEMPLATEDLG_TB_PRINT "SVT_HID_TEMPLATEDLG_TB_PRINT"
+#define HID_TEMPLATEDLG_TB_DOCINFO "SVT_HID_TEMPLATEDLG_TB_DOCINFO"
+#define HID_TEMPLATEDLG_TB_PREVIEW "SVT_HID_TEMPLATEDLG_TB_PREVIEW"
+
+// Help ids for the filepicker dialogs
+#define HID_EXPLORERDLG_FILE "SVT_HID_EXPLORERDLG_FILE"
+
+// help ids for fileview contextmenu
+#define HID_FILEVIEW_MENU_DELETE "SVT_HID_FILEVIEW_MENU_DELETE"
+#define HID_FILEVIEW_MENU_RENAME "SVT_HID_FILEVIEW_MENU_RENAME"
+
+// help ids for the different modi of the file picker dialog
+ // FREE
+#define HID_FILESAVE_LEVELUP "SVT_HID_FILESAVE_LEVELUP"
+#define HID_FILESAVE_CREATEDIRECTORY "SVT_HID_FILESAVE_CREATEDIRECTORY"
+#define HID_FILESAVE_DEFAULTDIRECTORY "SVT_HID_FILESAVE_DEFAULTDIRECTORY"
+#define HID_FILESAVE_FILEVIEW "SVT_HID_FILESAVE_FILEVIEW"
+#define HID_FILESAVE_TEMPLATE "SVT_HID_FILESAVE_TEMPLATE"
+#define HID_FILESAVE_FILEURL "SVT_HID_FILESAVE_FILEURL"
+#define HID_FILESAVE_FILETYPE "SVT_HID_FILESAVE_FILETYPE"
+#define HID_FILESAVE_DOSAVE "SVT_HID_FILESAVE_DOSAVE"
+#define HID_FILESAVE_AUTOEXTENSION "SVT_HID_FILESAVE_AUTOEXTENSION"
+#define HID_FILESAVE_SAVEWITHPASSWORD "SVT_HID_FILESAVE_SAVEWITHPASSWORD"
+#define HID_FILESAVE_CUSTOMIZEFILTER "SVT_HID_FILESAVE_CUSTOMIZEFILTER"
+#define HID_FILESAVE_SELECTION "SVT_HID_FILESAVE_SELECTION"
+#define HID_FILESAVE_DIALOG "SVT_HID_FILESAVE_DIALOG"
+#define HID_FILESAVE_DOPLAY "SVT_HID_FILESAVE_DOPLAY"
+
+#define HID_FILEOPEN_READONLY "SVT_HID_FILEOPEN_READONLY"
+#define HID_FILEOPEN_VERSION "SVT_HID_FILEOPEN_VERSION"
+#define HID_FILEOPEN_IMAGE_TEMPLATE "SVT_HID_FILEOPEN_IMAGE_TEMPLATE"
+
+#define HID_PRINTDIALOG_TOFILE "SVT_HID_PRINTDIALOG_TOFILE"
+
+#define HID_WIZARD_NEXT "SVT_HID_WIZARD_NEXT"
+#define HID_WIZARD_PREVIOUS "SVT_HID_WIZARD_PREVIOUS"
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/helpopt.hxx b/include/svtools/helpopt.hxx
new file mode 100644
index 000000000000..6004ab4dd77a
--- /dev/null
+++ b/include/svtools/helpopt.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_SVTOOLS_HELPOPT_HXX
+#define INCLUDED_SVTOOLS_HELPOPT_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <list>
+#include <tools/string.hxx>
+#include <unotools/options.hxx>
+
+typedef std::list< sal_Int32 > IdList;
+
+class SvtHelpOptions_Impl;
+
+class SVT_DLLPUBLIC SvtHelpOptions: public utl::detail::Options
+{
+ SvtHelpOptions_Impl* pImp;
+
+public:
+ SvtHelpOptions();
+ virtual ~SvtHelpOptions();
+
+ void SetExtendedHelp( sal_Bool b );
+ sal_Bool IsExtendedHelp() const;
+ void SetHelpTips( sal_Bool b );
+ sal_Bool IsHelpTips() const;
+
+ void SetHelpAgentAutoStartMode( sal_Bool b );
+ sal_Bool IsHelpAgentAutoStartMode() const;
+ void SetHelpAgentTimeoutPeriod( sal_Int32 _nSeconds );
+ sal_Int32 GetHelpAgentTimeoutPeriod( ) const;
+
+ const String& GetHelpStyleSheet()const;
+ void SetHelpStyleSheet(const String& rStyleSheet);
+
+ /** resets the help agent's ignore counter for all URL's
+ */
+ void resetAgentIgnoreURLCounter();
+
+ void SetWelcomeScreen( sal_Bool b );
+ sal_Bool IsWelcomeScreen() const;
+
+ String GetSystem() const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/htmlcfg.hxx b/include/svtools/htmlcfg.hxx
new file mode 100644
index 000000000000..62640e2bffe6
--- /dev/null
+++ b/include/svtools/htmlcfg.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 _SVX_HTMLCFG_HXX
+#define _SVX_HTMLCFG_HXX
+
+// -----------------------------------------------------------------------
+
+#include <tools/solar.h>
+#include <unotools/configitem.hxx>
+#include <svtools/svtdllapi.h>
+
+#define HTML_FONT_COUNT 7
+
+// !!!be aware!!!: the following defines are _not_ used as values in the configuration file
+// this is because of compatibility reasons
+#define HTML_CFG_MSIE 1 // Internet Explorer
+#define HTML_CFG_WRITER 2 // Writer
+#define HTML_CFG_NS40 3 // Netscape 4.0
+
+#define HTML_CFG_MAX HTML_CFG_NS40
+
+class Link;
+struct HtmlOptions_Impl;
+// -----------------------------------------------------------------------
+
+class SVT_DLLPUBLIC SvxHtmlOptions : public utl::ConfigItem
+{
+ HtmlOptions_Impl*pImp;
+ const com::sun::star::uno::Sequence<OUString>& GetPropertyNames();
+ void Load( const com::sun::star::uno::Sequence< OUString >& rPropertyNames );
+ void CallListeners();
+
+public:
+ SvxHtmlOptions();
+ ~SvxHtmlOptions();
+
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence< OUString >& _rPropertyNames);
+
+ sal_uInt16 GetFontSize(sal_uInt16 nPos) const;
+ void SetFontSize(sal_uInt16 nPos, sal_uInt16 nSize);
+
+ sal_Bool IsImportUnknown() const;
+ void SetImportUnknown(sal_Bool bSet);
+
+ sal_uInt16 GetExportMode() const;
+ void SetExportMode(sal_uInt16 nSet);
+
+ sal_Bool IsStarBasic() const;
+ void SetStarBasic(sal_Bool bSet);
+
+ sal_Bool IsStarBasicWarning() const;
+ void SetStarBasicWarning(sal_Bool bSet);
+
+ sal_Bool IsSaveGraphicsLocal() const;
+ void SetSaveGraphicsLocal(sal_Bool bSet);
+
+ sal_Bool IsPrintLayoutExtension() const;
+ void SetPrintLayoutExtension(sal_Bool bSet);
+
+ sal_Bool IsIgnoreFontFamily() const;
+ void SetIgnoreFontFamily(sal_Bool bSet);
+
+ sal_Bool IsDefaultTextEncoding() const;
+ rtl_TextEncoding GetTextEncoding() const;
+ void SetTextEncoding( rtl_TextEncoding );
+ static SvxHtmlOptions& Get();
+
+ sal_Bool IsNumbersEnglishUS() const;
+ void SetNumbersEnglishUS(sal_Bool bSet);
+};
+
+#endif
+
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/htmlkywd.hxx b/include/svtools/htmlkywd.hxx
new file mode 100644
index 000000000000..72b48c417aa3
--- /dev/null
+++ b/include/svtools/htmlkywd.hxx
@@ -0,0 +1,796 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _HTMLKYWD_HXX
+#define _HTMLKYWD_HXX
+
+#include "sal/config.h"
+
+#define OOO_STRING_SVTOOLS_HTML_doctype32 \
+ "HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\""
+#define OOO_STRING_SVTOOLS_HTML_doctype40 \
+ "HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\""
+
+// diese werden nur eingeschaltet
+#define OOO_STRING_SVTOOLS_HTML_area "AREA"
+#define OOO_STRING_SVTOOLS_HTML_base "BASE"
+#define OOO_STRING_SVTOOLS_HTML_comment "!--"
+#define OOO_STRING_SVTOOLS_HTML_doctype "!DOCTYPE"
+#define OOO_STRING_SVTOOLS_HTML_embed "EMBED"
+#define OOO_STRING_SVTOOLS_HTML_figureoverlay "OVERLAY"
+#define OOO_STRING_SVTOOLS_HTML_horzrule "HR"
+#define OOO_STRING_SVTOOLS_HTML_horztab "TAB"
+#define OOO_STRING_SVTOOLS_HTML_image "IMG"
+#define OOO_STRING_SVTOOLS_HTML_image2 "IMAGE"
+#define OOO_STRING_SVTOOLS_HTML_input "INPUT"
+#define OOO_STRING_SVTOOLS_HTML_isindex "ISINDEX"
+#define OOO_STRING_SVTOOLS_HTML_linebreak "BR"
+#define OOO_STRING_SVTOOLS_HTML_li "LI"
+#define OOO_STRING_SVTOOLS_HTML_link "LINK"
+#define OOO_STRING_SVTOOLS_HTML_meta "META"
+#define OOO_STRING_SVTOOLS_HTML_nextid "NEXTID"
+#define OOO_STRING_SVTOOLS_HTML_nobr "NOBR"
+#define OOO_STRING_SVTOOLS_HTML_of "OF"
+#define OOO_STRING_SVTOOLS_HTML_option "OPTION"
+#define OOO_STRING_SVTOOLS_HTML_param "PARAM"
+#define OOO_STRING_SVTOOLS_HTML_range "RANGE"
+#define OOO_STRING_SVTOOLS_HTML_spacer "SPACER"
+#define OOO_STRING_SVTOOLS_HTML_wbr "WBR"
+
+// diese werden wieder abgeschaltet
+#define OOO_STRING_SVTOOLS_HTML_abbreviation "ABBREV"
+#define OOO_STRING_SVTOOLS_HTML_above "ABOVE"
+#define OOO_STRING_SVTOOLS_HTML_acronym "ACRONYM"
+#define OOO_STRING_SVTOOLS_HTML_address "ADDRESS"
+#define OOO_STRING_SVTOOLS_HTML_anchor "A"
+#define OOO_STRING_SVTOOLS_HTML_applet "APPLET"
+#define OOO_STRING_SVTOOLS_HTML_array "ARRAY"
+#define OOO_STRING_SVTOOLS_HTML_author "AU"
+#define OOO_STRING_SVTOOLS_HTML_banner "BANNER"
+#define OOO_STRING_SVTOOLS_HTML_bar "BAR"
+#define OOO_STRING_SVTOOLS_HTML_basefont "BASEFONT"
+#define OOO_STRING_SVTOOLS_HTML_below "BELOW"
+#define OOO_STRING_SVTOOLS_HTML_bigprint "BIG"
+#define OOO_STRING_SVTOOLS_HTML_blink "BLINK"
+#define OOO_STRING_SVTOOLS_HTML_blockquote "BLOCKQUOTE"
+#define OOO_STRING_SVTOOLS_HTML_blockquote30 "BQ"
+#define OOO_STRING_SVTOOLS_HTML_body "BODY"
+#define OOO_STRING_SVTOOLS_HTML_bold "B"
+#define OOO_STRING_SVTOOLS_HTML_boldtext "BT"
+#define OOO_STRING_SVTOOLS_HTML_box "BOX"
+#define OOO_STRING_SVTOOLS_HTML_caption "CAPTION"
+#define OOO_STRING_SVTOOLS_HTML_center "CENTER"
+#define OOO_STRING_SVTOOLS_HTML_citiation "CITE"
+#define OOO_STRING_SVTOOLS_HTML_code "CODE"
+#define OOO_STRING_SVTOOLS_HTML_col "COL"
+#define OOO_STRING_SVTOOLS_HTML_colgroup "COLGROUP"
+#define OOO_STRING_SVTOOLS_HTML_credit "CREDIT"
+#define OOO_STRING_SVTOOLS_HTML_dd "DD"
+#define OOO_STRING_SVTOOLS_HTML_deflist "DL"
+#define OOO_STRING_SVTOOLS_HTML_deletedtext "DEL"
+#define OOO_STRING_SVTOOLS_HTML_dirlist "DIR"
+#define OOO_STRING_SVTOOLS_HTML_division "DIV"
+#define OOO_STRING_SVTOOLS_HTML_dot "DOT"
+#define OOO_STRING_SVTOOLS_HTML_doubledot "DDOT"
+#define OOO_STRING_SVTOOLS_HTML_dt "DT"
+#define OOO_STRING_SVTOOLS_HTML_emphasis "EM"
+#define OOO_STRING_SVTOOLS_HTML_figure "FIG"
+#define OOO_STRING_SVTOOLS_HTML_font "FONT"
+#define OOO_STRING_SVTOOLS_HTML_footnote "FN"
+#define OOO_STRING_SVTOOLS_HTML_form "FORM"
+#define OOO_STRING_SVTOOLS_HTML_frame "FRAME"
+#define OOO_STRING_SVTOOLS_HTML_frameset "FRAMESET"
+#define OOO_STRING_SVTOOLS_HTML_hat "HAT"
+#define OOO_STRING_SVTOOLS_HTML_head1 "H1"
+#define OOO_STRING_SVTOOLS_HTML_head2 "H2"
+#define OOO_STRING_SVTOOLS_HTML_head3 "H3"
+#define OOO_STRING_SVTOOLS_HTML_head4 "H4"
+#define OOO_STRING_SVTOOLS_HTML_head5 "H5"
+#define OOO_STRING_SVTOOLS_HTML_head6 "H6"
+#define OOO_STRING_SVTOOLS_HTML_head "HEAD"
+#define OOO_STRING_SVTOOLS_HTML_html "HTML"
+#define OOO_STRING_SVTOOLS_HTML_iframe "IFRAME"
+#define OOO_STRING_SVTOOLS_HTML_ilayer "ILAYER"
+#define OOO_STRING_SVTOOLS_HTML_insertedtext "INS"
+#define OOO_STRING_SVTOOLS_HTML_italic "I"
+#define OOO_STRING_SVTOOLS_HTML_item "ITEM"
+#define OOO_STRING_SVTOOLS_HTML_keyboard "KBD"
+#define OOO_STRING_SVTOOLS_HTML_language "LANG"
+#define OOO_STRING_SVTOOLS_HTML_layer "LAYER"
+#define OOO_STRING_SVTOOLS_HTML_listheader "LH"
+#define OOO_STRING_SVTOOLS_HTML_map "MAP"
+#define OOO_STRING_SVTOOLS_HTML_math "MATH"
+#define OOO_STRING_SVTOOLS_HTML_menulist "MENU"
+#define OOO_STRING_SVTOOLS_HTML_multicol "MULTICOL"
+#define OOO_STRING_SVTOOLS_HTML_noembed "NOEMBED"
+#define OOO_STRING_SVTOOLS_HTML_noframe "NOFRAME"
+#define OOO_STRING_SVTOOLS_HTML_noframes "NOFRAMES"
+#define OOO_STRING_SVTOOLS_HTML_noscript "NOSCRIPT"
+#define OOO_STRING_SVTOOLS_HTML_note "NOTE"
+#define OOO_STRING_SVTOOLS_HTML_object "OBJECT"
+#define OOO_STRING_SVTOOLS_HTML_orderlist "OL"
+#define OOO_STRING_SVTOOLS_HTML_parabreak "P"
+#define OOO_STRING_SVTOOLS_HTML_person "PERSON"
+#define OOO_STRING_SVTOOLS_HTML_plaintext "T"
+#define OOO_STRING_SVTOOLS_HTML_preformtxt "PRE"
+#define OOO_STRING_SVTOOLS_HTML_root "ROOT"
+#define OOO_STRING_SVTOOLS_HTML_row "ROW"
+#define OOO_STRING_SVTOOLS_HTML_sample "SAMP"
+#define OOO_STRING_SVTOOLS_HTML_script "SCRIPT"
+#define OOO_STRING_SVTOOLS_HTML_select "SELECT"
+#define OOO_STRING_SVTOOLS_HTML_shortquote "Q"
+#define OOO_STRING_SVTOOLS_HTML_smallprint "SMALL"
+#define OOO_STRING_SVTOOLS_HTML_span "SPAN"
+#define OOO_STRING_SVTOOLS_HTML_squareroot "AQRT"
+#define OOO_STRING_SVTOOLS_HTML_strikethrough "S"
+#define OOO_STRING_SVTOOLS_HTML_strong "STRONG"
+#define OOO_STRING_SVTOOLS_HTML_style "STYLE"
+#define OOO_STRING_SVTOOLS_HTML_subscript "SUB"
+#define OOO_STRING_SVTOOLS_HTML_superscript "SUP"
+#define OOO_STRING_SVTOOLS_HTML_table "TABLE"
+#define OOO_STRING_SVTOOLS_HTML_tablerow "TR"
+#define OOO_STRING_SVTOOLS_HTML_tabledata "TD"
+#define OOO_STRING_SVTOOLS_HTML_tableheader "TH"
+#define OOO_STRING_SVTOOLS_HTML_tbody "TBODY"
+#define OOO_STRING_SVTOOLS_HTML_teletype "TT"
+#define OOO_STRING_SVTOOLS_HTML_text "TEXT"
+#define OOO_STRING_SVTOOLS_HTML_textarea "TEXTAREA"
+#define OOO_STRING_SVTOOLS_HTML_textflow "TEXTFLOW"
+#define OOO_STRING_SVTOOLS_HTML_tfoot "TFOOT"
+#define OOO_STRING_SVTOOLS_HTML_thead "THEAD"
+#define OOO_STRING_SVTOOLS_HTML_tilde "TILDE"
+#define OOO_STRING_SVTOOLS_HTML_title "TITLE"
+#define OOO_STRING_SVTOOLS_HTML_underline "U"
+#define OOO_STRING_SVTOOLS_HTML_unorderlist "UL"
+#define OOO_STRING_SVTOOLS_HTML_variable "VAR"
+#define OOO_STRING_SVTOOLS_HTML_vector "VEC"
+
+// obsolete features
+#define OOO_STRING_SVTOOLS_HTML_xmp "XMP"
+#define OOO_STRING_SVTOOLS_HTML_listing "LISTING"
+
+// proposed features
+#define OOO_STRING_SVTOOLS_HTML_definstance "DFN"
+#define OOO_STRING_SVTOOLS_HTML_strike "STRIKE"
+#define OOO_STRING_SVTOOLS_HTML_bgsound "BGSOUND"
+#define OOO_STRING_SVTOOLS_HTML_comment2 "COMMENT"
+#define OOO_STRING_SVTOOLS_HTML_marquee "MARQUEE"
+#define OOO_STRING_SVTOOLS_HTML_plaintext2 "PLAINTEXT"
+#define OOO_STRING_SVTOOLS_HTML_sdfield "SDFIELD"
+
+// die Namen fuer alle Zeichen
+#define OOO_STRING_SVTOOLS_HTML_C_lt "lt"
+#define OOO_STRING_SVTOOLS_HTML_C_gt "gt"
+#define OOO_STRING_SVTOOLS_HTML_C_amp "amp"
+#define OOO_STRING_SVTOOLS_HTML_C_quot "quot"
+#define OOO_STRING_SVTOOLS_HTML_C_Aacute "Aacute"
+#define OOO_STRING_SVTOOLS_HTML_C_Agrave "Agrave"
+#define OOO_STRING_SVTOOLS_HTML_C_Acirc "Acirc"
+#define OOO_STRING_SVTOOLS_HTML_C_Atilde "Atilde"
+#define OOO_STRING_SVTOOLS_HTML_C_Aring "Aring"
+#define OOO_STRING_SVTOOLS_HTML_C_Auml "Auml"
+#define OOO_STRING_SVTOOLS_HTML_C_AElig "AElig"
+#define OOO_STRING_SVTOOLS_HTML_C_Ccedil "Ccedil"
+#define OOO_STRING_SVTOOLS_HTML_C_Eacute "Eacute"
+#define OOO_STRING_SVTOOLS_HTML_C_Egrave "Egrave"
+#define OOO_STRING_SVTOOLS_HTML_C_Ecirc "Ecirc"
+#define OOO_STRING_SVTOOLS_HTML_C_Euml "Euml"
+#define OOO_STRING_SVTOOLS_HTML_C_Iacute "Iacute"
+#define OOO_STRING_SVTOOLS_HTML_C_Igrave "Igrave"
+#define OOO_STRING_SVTOOLS_HTML_C_Icirc "Icirc"
+#define OOO_STRING_SVTOOLS_HTML_C_Iuml "Iuml"
+#define OOO_STRING_SVTOOLS_HTML_C_ETH "ETH"
+#define OOO_STRING_SVTOOLS_HTML_C_Ntilde "Ntilde"
+#define OOO_STRING_SVTOOLS_HTML_C_Oacute "Oacute"
+#define OOO_STRING_SVTOOLS_HTML_C_Ograve "Ograve"
+#define OOO_STRING_SVTOOLS_HTML_C_Ocirc "Ocirc"
+#define OOO_STRING_SVTOOLS_HTML_C_Otilde "Otilde"
+#define OOO_STRING_SVTOOLS_HTML_C_Ouml "Ouml"
+#define OOO_STRING_SVTOOLS_HTML_C_Oslash "Oslash"
+#define OOO_STRING_SVTOOLS_HTML_C_Uacute "Uacute"
+#define OOO_STRING_SVTOOLS_HTML_C_Ugrave "Ugrave"
+#define OOO_STRING_SVTOOLS_HTML_C_Ucirc "Ucirc"
+#define OOO_STRING_SVTOOLS_HTML_C_Uuml "Uuml"
+#define OOO_STRING_SVTOOLS_HTML_C_Yacute "Yacute"
+#define OOO_STRING_SVTOOLS_HTML_C_THORN "THORN"
+#define OOO_STRING_SVTOOLS_HTML_C_szlig "szlig"
+#define OOO_STRING_SVTOOLS_HTML_S_aacute "aacute"
+#define OOO_STRING_SVTOOLS_HTML_S_agrave "agrave"
+#define OOO_STRING_SVTOOLS_HTML_S_acirc "acirc"
+#define OOO_STRING_SVTOOLS_HTML_S_atilde "atilde"
+#define OOO_STRING_SVTOOLS_HTML_S_aring "aring"
+#define OOO_STRING_SVTOOLS_HTML_S_auml "auml"
+#define OOO_STRING_SVTOOLS_HTML_S_aelig "aelig"
+#define OOO_STRING_SVTOOLS_HTML_S_ccedil "ccedil"
+#define OOO_STRING_SVTOOLS_HTML_S_eacute "eacute"
+#define OOO_STRING_SVTOOLS_HTML_S_egrave "egrave"
+#define OOO_STRING_SVTOOLS_HTML_S_ecirc "ecirc"
+#define OOO_STRING_SVTOOLS_HTML_S_euml "euml"
+#define OOO_STRING_SVTOOLS_HTML_S_iacute "iacute"
+#define OOO_STRING_SVTOOLS_HTML_S_igrave "igrave"
+#define OOO_STRING_SVTOOLS_HTML_S_icirc "icirc"
+#define OOO_STRING_SVTOOLS_HTML_S_iuml "iuml"
+#define OOO_STRING_SVTOOLS_HTML_S_eth "eth"
+#define OOO_STRING_SVTOOLS_HTML_S_ntilde "ntilde"
+#define OOO_STRING_SVTOOLS_HTML_S_oacute "oacute"
+#define OOO_STRING_SVTOOLS_HTML_S_ograve "ograve"
+#define OOO_STRING_SVTOOLS_HTML_S_ocirc "ocirc"
+#define OOO_STRING_SVTOOLS_HTML_S_otilde "otilde"
+#define OOO_STRING_SVTOOLS_HTML_S_ouml "ouml"
+#define OOO_STRING_SVTOOLS_HTML_S_oslash "oslash"
+#define OOO_STRING_SVTOOLS_HTML_S_uacute "uacute"
+#define OOO_STRING_SVTOOLS_HTML_S_ugrave "ugrave"
+#define OOO_STRING_SVTOOLS_HTML_S_ucirc "ucirc"
+#define OOO_STRING_SVTOOLS_HTML_S_uuml "uuml"
+#define OOO_STRING_SVTOOLS_HTML_S_yacute "yacute"
+#define OOO_STRING_SVTOOLS_HTML_S_thorn "thorn"
+#define OOO_STRING_SVTOOLS_HTML_S_yuml "yuml"
+#define OOO_STRING_SVTOOLS_HTML_S_acute "acute"
+#define OOO_STRING_SVTOOLS_HTML_S_brvbar "brvbar"
+#define OOO_STRING_SVTOOLS_HTML_S_cedil "cedil"
+#define OOO_STRING_SVTOOLS_HTML_S_cent "cent"
+#define OOO_STRING_SVTOOLS_HTML_S_copy "copy"
+#define OOO_STRING_SVTOOLS_HTML_S_curren "curren"
+#define OOO_STRING_SVTOOLS_HTML_S_deg "deg"
+#define OOO_STRING_SVTOOLS_HTML_S_divide "divide"
+#define OOO_STRING_SVTOOLS_HTML_S_frac12 "frac12"
+#define OOO_STRING_SVTOOLS_HTML_S_frac14 "frac14"
+#define OOO_STRING_SVTOOLS_HTML_S_frac34 "frac34"
+#define OOO_STRING_SVTOOLS_HTML_S_iexcl "iexcl"
+#define OOO_STRING_SVTOOLS_HTML_S_iquest "iquest"
+#define OOO_STRING_SVTOOLS_HTML_S_laquo "laquo"
+#define OOO_STRING_SVTOOLS_HTML_S_macr "macr"
+#define OOO_STRING_SVTOOLS_HTML_S_micro "micro"
+#define OOO_STRING_SVTOOLS_HTML_S_middot "middot"
+#define OOO_STRING_SVTOOLS_HTML_S_nbsp "nbsp"
+#define OOO_STRING_SVTOOLS_HTML_S_not "not"
+#define OOO_STRING_SVTOOLS_HTML_S_ordf "ordf"
+#define OOO_STRING_SVTOOLS_HTML_S_ordm "ordm"
+#define OOO_STRING_SVTOOLS_HTML_S_para "para"
+#define OOO_STRING_SVTOOLS_HTML_S_plusmn "plusmn"
+#define OOO_STRING_SVTOOLS_HTML_S_pound "pound"
+#define OOO_STRING_SVTOOLS_HTML_S_raquo "raquo"
+#define OOO_STRING_SVTOOLS_HTML_S_reg "reg"
+#define OOO_STRING_SVTOOLS_HTML_S_sect "sect"
+#define OOO_STRING_SVTOOLS_HTML_S_shy "shy"
+#define OOO_STRING_SVTOOLS_HTML_S_sup1 "sup1"
+#define OOO_STRING_SVTOOLS_HTML_S_sup2 "sup2"
+#define OOO_STRING_SVTOOLS_HTML_S_sup3 "sup3"
+#define OOO_STRING_SVTOOLS_HTML_S_times "times"
+#define OOO_STRING_SVTOOLS_HTML_S_uml "uml"
+#define OOO_STRING_SVTOOLS_HTML_S_yen "yen"
+
+// Netscape kennt noch ein paar in Grossbuchstaben ...
+#define OOO_STRING_SVTOOLS_HTML_C_LT "LT"
+#define OOO_STRING_SVTOOLS_HTML_C_GT "GT"
+#define OOO_STRING_SVTOOLS_HTML_C_AMP "AMP"
+#define OOO_STRING_SVTOOLS_HTML_C_QUOT "QUOT"
+#define OOO_STRING_SVTOOLS_HTML_S_COPY "COPY"
+#define OOO_STRING_SVTOOLS_HTML_S_REG "REG"
+
+// HTML4
+#define OOO_STRING_SVTOOLS_HTML_S_alefsym "alefsym"
+#define OOO_STRING_SVTOOLS_HTML_S_Alpha "Alpha"
+#define OOO_STRING_SVTOOLS_HTML_S_alpha "alpha"
+#define OOO_STRING_SVTOOLS_HTML_S_and "and"
+#define OOO_STRING_SVTOOLS_HTML_S_ang "ang"
+#define OOO_STRING_SVTOOLS_HTML_S_asymp "asymp"
+#define OOO_STRING_SVTOOLS_HTML_S_bdquo "bdquo"
+#define OOO_STRING_SVTOOLS_HTML_S_Beta "Beta"
+#define OOO_STRING_SVTOOLS_HTML_S_beta "beta"
+#define OOO_STRING_SVTOOLS_HTML_S_bull "bull"
+#define OOO_STRING_SVTOOLS_HTML_S_cap "cap"
+#define OOO_STRING_SVTOOLS_HTML_S_chi "chi"
+#define OOO_STRING_SVTOOLS_HTML_S_Chi "Chi"
+#define OOO_STRING_SVTOOLS_HTML_S_circ "circ"
+#define OOO_STRING_SVTOOLS_HTML_S_clubs "clubs"
+#define OOO_STRING_SVTOOLS_HTML_S_cong "cong"
+#define OOO_STRING_SVTOOLS_HTML_S_crarr "crarr"
+#define OOO_STRING_SVTOOLS_HTML_S_cup "cup"
+#define OOO_STRING_SVTOOLS_HTML_S_dagger "dagger"
+#define OOO_STRING_SVTOOLS_HTML_S_Dagger "Dagger"
+#define OOO_STRING_SVTOOLS_HTML_S_darr "darr"
+#define OOO_STRING_SVTOOLS_HTML_S_dArr "dArr"
+#define OOO_STRING_SVTOOLS_HTML_S_Delta "Delta"
+#define OOO_STRING_SVTOOLS_HTML_S_delta "delta"
+#define OOO_STRING_SVTOOLS_HTML_S_diams "diams"
+#define OOO_STRING_SVTOOLS_HTML_S_empty "empty"
+#define OOO_STRING_SVTOOLS_HTML_S_emsp "emsp"
+#define OOO_STRING_SVTOOLS_HTML_S_ensp "ensp"
+#define OOO_STRING_SVTOOLS_HTML_S_Epsilon "Epsilon"
+#define OOO_STRING_SVTOOLS_HTML_S_epsilon "epsilon"
+#define OOO_STRING_SVTOOLS_HTML_S_equiv "equiv"
+#define OOO_STRING_SVTOOLS_HTML_S_Eta "Eta"
+#define OOO_STRING_SVTOOLS_HTML_S_eta "eta"
+#define OOO_STRING_SVTOOLS_HTML_S_euro "euro"
+#define OOO_STRING_SVTOOLS_HTML_S_exist "exist"
+#define OOO_STRING_SVTOOLS_HTML_S_notexist "not exist"
+#define OOO_STRING_SVTOOLS_HTML_S_fnof "fnof"
+#define OOO_STRING_SVTOOLS_HTML_S_forall "forall"
+#define OOO_STRING_SVTOOLS_HTML_S_frasl "frasl"
+#define OOO_STRING_SVTOOLS_HTML_S_Gamma "Gamma"
+#define OOO_STRING_SVTOOLS_HTML_S_gamma "gamma"
+#define OOO_STRING_SVTOOLS_HTML_S_ge "ge"
+#define OOO_STRING_SVTOOLS_HTML_S_harr "harr"
+#define OOO_STRING_SVTOOLS_HTML_S_hArr "hArr"
+#define OOO_STRING_SVTOOLS_HTML_S_hearts "hearts"
+#define OOO_STRING_SVTOOLS_HTML_S_hellip "hellip"
+#define OOO_STRING_SVTOOLS_HTML_S_image "image"
+#define OOO_STRING_SVTOOLS_HTML_S_infin "infin"
+#define OOO_STRING_SVTOOLS_HTML_S_int "int"
+#define OOO_STRING_SVTOOLS_HTML_S_Iota "Iota"
+#define OOO_STRING_SVTOOLS_HTML_S_iota "iota"
+#define OOO_STRING_SVTOOLS_HTML_S_isin "isin"
+#define OOO_STRING_SVTOOLS_HTML_S_Kappa "Kappa"
+#define OOO_STRING_SVTOOLS_HTML_S_kappa "kappa"
+#define OOO_STRING_SVTOOLS_HTML_S_Lambda "Lambda"
+#define OOO_STRING_SVTOOLS_HTML_S_lambda "lambda"
+#define OOO_STRING_SVTOOLS_HTML_S_lang "lang"
+#define OOO_STRING_SVTOOLS_HTML_S_larr "larr"
+#define OOO_STRING_SVTOOLS_HTML_S_lArr "lArr"
+#define OOO_STRING_SVTOOLS_HTML_S_lceil "lceil"
+#define OOO_STRING_SVTOOLS_HTML_S_ldquo "ldquo"
+#define OOO_STRING_SVTOOLS_HTML_S_le "le"
+#define OOO_STRING_SVTOOLS_HTML_S_lfloor "lfloor"
+#define OOO_STRING_SVTOOLS_HTML_S_lowast "lowast"
+#define OOO_STRING_SVTOOLS_HTML_S_loz "loz"
+#define OOO_STRING_SVTOOLS_HTML_S_lrm "lrm"
+#define OOO_STRING_SVTOOLS_HTML_S_lsaquo "lsaquo"
+#define OOO_STRING_SVTOOLS_HTML_S_lsquo "lsquo"
+#define OOO_STRING_SVTOOLS_HTML_S_mdash "mdash"
+#define OOO_STRING_SVTOOLS_HTML_S_minus "minus"
+#define OOO_STRING_SVTOOLS_HTML_S_Mu "Mu"
+#define OOO_STRING_SVTOOLS_HTML_S_mu "mu"
+#define OOO_STRING_SVTOOLS_HTML_S_nabla "nabla"
+#define OOO_STRING_SVTOOLS_HTML_S_ndash "ndash"
+#define OOO_STRING_SVTOOLS_HTML_S_ne "ne"
+#define OOO_STRING_SVTOOLS_HTML_S_ni "ni"
+#define OOO_STRING_SVTOOLS_HTML_S_notin "notin"
+#define OOO_STRING_SVTOOLS_HTML_S_nsub "nsub"
+#define OOO_STRING_SVTOOLS_HTML_S_Nu "Nu"
+#define OOO_STRING_SVTOOLS_HTML_S_nu "nu"
+#define OOO_STRING_SVTOOLS_HTML_S_OElig "OElig"
+#define OOO_STRING_SVTOOLS_HTML_S_oelig "oelig"
+#define OOO_STRING_SVTOOLS_HTML_S_oline "oline"
+#define OOO_STRING_SVTOOLS_HTML_S_Omega "Omega"
+#define OOO_STRING_SVTOOLS_HTML_S_omega "omega"
+#define OOO_STRING_SVTOOLS_HTML_S_Omicron "Omicron"
+#define OOO_STRING_SVTOOLS_HTML_S_omicron "omicron"
+#define OOO_STRING_SVTOOLS_HTML_S_oplus "oplus"
+#define OOO_STRING_SVTOOLS_HTML_S_or "or"
+#define OOO_STRING_SVTOOLS_HTML_S_otimes "otimes"
+#define OOO_STRING_SVTOOLS_HTML_S_part "part"
+#define OOO_STRING_SVTOOLS_HTML_S_permil "permil"
+#define OOO_STRING_SVTOOLS_HTML_S_perp "perp"
+#define OOO_STRING_SVTOOLS_HTML_S_Phi "Phi"
+#define OOO_STRING_SVTOOLS_HTML_S_phi "phi"
+#define OOO_STRING_SVTOOLS_HTML_S_Pi "Pi"
+#define OOO_STRING_SVTOOLS_HTML_S_pi "pi"
+#define OOO_STRING_SVTOOLS_HTML_S_piv "piv"
+#define OOO_STRING_SVTOOLS_HTML_S_prime "prime"
+#define OOO_STRING_SVTOOLS_HTML_S_Prime "Prime"
+#define OOO_STRING_SVTOOLS_HTML_S_prod "prod"
+#define OOO_STRING_SVTOOLS_HTML_S_prop "prop"
+#define OOO_STRING_SVTOOLS_HTML_S_Psi "Psi"
+#define OOO_STRING_SVTOOLS_HTML_S_psi "psi"
+#define OOO_STRING_SVTOOLS_HTML_S_radic "radic"
+#define OOO_STRING_SVTOOLS_HTML_S_rang "rang"
+#define OOO_STRING_SVTOOLS_HTML_S_rarr "rarr"
+#define OOO_STRING_SVTOOLS_HTML_S_rArr "rArr"
+#define OOO_STRING_SVTOOLS_HTML_S_rceil "rceil"
+#define OOO_STRING_SVTOOLS_HTML_S_rdquo "rdquo"
+#define OOO_STRING_SVTOOLS_HTML_S_real "real"
+#define OOO_STRING_SVTOOLS_HTML_S_rfloor "rfloor"
+#define OOO_STRING_SVTOOLS_HTML_S_Rho "Rho"
+#define OOO_STRING_SVTOOLS_HTML_S_rho "rho"
+#define OOO_STRING_SVTOOLS_HTML_S_rlm "rlm"
+#define OOO_STRING_SVTOOLS_HTML_S_rsaquo "rsaquo"
+#define OOO_STRING_SVTOOLS_HTML_S_rsquo "rsquo"
+#define OOO_STRING_SVTOOLS_HTML_S_sbquo "sbquo"
+#define OOO_STRING_SVTOOLS_HTML_S_Scaron "Scaron"
+#define OOO_STRING_SVTOOLS_HTML_S_scaron "scaron"
+#define OOO_STRING_SVTOOLS_HTML_S_sdot "sdot"
+#define OOO_STRING_SVTOOLS_HTML_S_Sigma "Sigma"
+#define OOO_STRING_SVTOOLS_HTML_S_sigma "sigma"
+#define OOO_STRING_SVTOOLS_HTML_S_sigmaf "sigmaf"
+#define OOO_STRING_SVTOOLS_HTML_S_sim "sim"
+#define OOO_STRING_SVTOOLS_HTML_S_spades "spades"
+#define OOO_STRING_SVTOOLS_HTML_S_sub "sub"
+#define OOO_STRING_SVTOOLS_HTML_S_sube "sube"
+#define OOO_STRING_SVTOOLS_HTML_S_sum "sum"
+#define OOO_STRING_SVTOOLS_HTML_S_sup "sup"
+#define OOO_STRING_SVTOOLS_HTML_S_supe "supe"
+#define OOO_STRING_SVTOOLS_HTML_S_Tau "Tau"
+#define OOO_STRING_SVTOOLS_HTML_S_tau "tau"
+#define OOO_STRING_SVTOOLS_HTML_S_there4 "there4"
+#define OOO_STRING_SVTOOLS_HTML_S_Theta "Theta"
+#define OOO_STRING_SVTOOLS_HTML_S_theta "theta"
+#define OOO_STRING_SVTOOLS_HTML_S_thetasym "thetasym"
+#define OOO_STRING_SVTOOLS_HTML_S_thinsp "thinsp"
+#define OOO_STRING_SVTOOLS_HTML_S_tilde "tilde"
+#define OOO_STRING_SVTOOLS_HTML_S_trade "trade"
+#define OOO_STRING_SVTOOLS_HTML_S_uarr "uarr"
+#define OOO_STRING_SVTOOLS_HTML_S_uArr "uArr"
+#define OOO_STRING_SVTOOLS_HTML_S_upsih "upsih"
+#define OOO_STRING_SVTOOLS_HTML_S_Upsilon "Upsilon"
+#define OOO_STRING_SVTOOLS_HTML_S_upsilon "upsilon"
+#define OOO_STRING_SVTOOLS_HTML_S_weierp "weierp"
+#define OOO_STRING_SVTOOLS_HTML_S_Xi "Xi"
+#define OOO_STRING_SVTOOLS_HTML_S_xi "xi"
+#define OOO_STRING_SVTOOLS_HTML_S_Yuml "Yuml"
+#define OOO_STRING_SVTOOLS_HTML_S_Zeta "Zeta"
+#define OOO_STRING_SVTOOLS_HTML_S_zeta "zeta"
+#define OOO_STRING_SVTOOLS_HTML_S_zwj "zwj"
+#define OOO_STRING_SVTOOLS_HTML_S_zwnj "zwnj"
+
+// HTML Attribut-Token (=Optionen)
+
+// Attribute ohne Wert
+#define OOO_STRING_SVTOOLS_HTML_O_box "BOX"
+#define OOO_STRING_SVTOOLS_HTML_O_checked "CHECKED"
+#define OOO_STRING_SVTOOLS_HTML_O_compact "COMPACT"
+#define OOO_STRING_SVTOOLS_HTML_O_continue "CONTINUE"
+#define OOO_STRING_SVTOOLS_HTML_O_controls "CONTROLS"
+#define OOO_STRING_SVTOOLS_HTML_O_declare "DECLARE"
+#define OOO_STRING_SVTOOLS_HTML_O_disabled "DISABLED"
+#define OOO_STRING_SVTOOLS_HTML_O_folded "FOLDED"
+#define OOO_STRING_SVTOOLS_HTML_O_ismap "ISMAP"
+#define OOO_STRING_SVTOOLS_HTML_O_mayscript "MAYSCRIPT"
+#define OOO_STRING_SVTOOLS_HTML_O_multiple "MULTIPLE"
+#define OOO_STRING_SVTOOLS_HTML_O_noflow "NOFLOW"
+#define OOO_STRING_SVTOOLS_HTML_O_nohref "NOHREF"
+#define OOO_STRING_SVTOOLS_HTML_O_noresize "NORESIZE"
+#define OOO_STRING_SVTOOLS_HTML_O_noshade "NOSHADE"
+#define OOO_STRING_SVTOOLS_HTML_O_nowrap "NOWRAP"
+#define OOO_STRING_SVTOOLS_HTML_O_plain "PLAIN"
+#define OOO_STRING_SVTOOLS_HTML_O_sdfixed "SDFIXED"
+#define OOO_STRING_SVTOOLS_HTML_O_selected "SELECTED"
+#define OOO_STRING_SVTOOLS_HTML_O_shapes "SHAPES"
+
+// Attribute mit einem String als Wert
+#define OOO_STRING_SVTOOLS_HTML_O_above "ABOVE"
+#define OOO_STRING_SVTOOLS_HTML_O_accesskey "ACCESSKEY"
+#define OOO_STRING_SVTOOLS_HTML_O_accept "ACCEPT"
+#define OOO_STRING_SVTOOLS_HTML_O_add_date "ADD_DATE"
+#define OOO_STRING_SVTOOLS_HTML_O_alt "ALT"
+#define OOO_STRING_SVTOOLS_HTML_O_axes "AXES"
+#define OOO_STRING_SVTOOLS_HTML_O_axis "AXIS"
+#define OOO_STRING_SVTOOLS_HTML_O_below "BELOW"
+#define OOO_STRING_SVTOOLS_HTML_O_char "CHAR"
+#define OOO_STRING_SVTOOLS_HTML_O_class "CLASS"
+#define OOO_STRING_SVTOOLS_HTML_O_clip "CLIP"
+#define OOO_STRING_SVTOOLS_HTML_O_code "CODE"
+#define OOO_STRING_SVTOOLS_HTML_O_codetype "CODETYPE"
+#define OOO_STRING_SVTOOLS_HTML_O_colspec "COLSPEC"
+#define OOO_STRING_SVTOOLS_HTML_O_content "CONTENT"
+#define OOO_STRING_SVTOOLS_HTML_O_coords "COORDS"
+#define OOO_STRING_SVTOOLS_HTML_O_dp "DP"
+#define OOO_STRING_SVTOOLS_HTML_O_enctype "ENCTYPE"
+#define OOO_STRING_SVTOOLS_HTML_O_error "ERROR"
+#define OOO_STRING_SVTOOLS_HTML_O_face "FACE"
+#define OOO_STRING_SVTOOLS_HTML_O_frameborder "FRAMEBORDER"
+#define OOO_STRING_SVTOOLS_HTML_O_httpequiv "HTTP-EQUIV"
+#define OOO_STRING_SVTOOLS_HTML_O_language "LANGUAGE"
+#define OOO_STRING_SVTOOLS_HTML_O_last_modified "LAST_MODIFIED"
+#define OOO_STRING_SVTOOLS_HTML_O_last_visit "LAST_VISIT"
+#define OOO_STRING_SVTOOLS_HTML_O_md "MD"
+#define OOO_STRING_SVTOOLS_HTML_O_n "N"
+#define OOO_STRING_SVTOOLS_HTML_O_name "NAME"
+#define OOO_STRING_SVTOOLS_HTML_O_notation "NOTATION"
+#define OOO_STRING_SVTOOLS_HTML_O_prompt "PROMPT"
+#define OOO_STRING_SVTOOLS_HTML_O_shape "SHAPE"
+#define OOO_STRING_SVTOOLS_HTML_O_standby "STANDBY"
+#define OOO_STRING_SVTOOLS_HTML_O_style "STYLE"
+#define OOO_STRING_SVTOOLS_HTML_O_title "TITLE"
+#define OOO_STRING_SVTOOLS_HTML_O_value "VALUE"
+#define OOO_STRING_SVTOOLS_HTML_O_SDval "SDVAL"
+#define OOO_STRING_SVTOOLS_HTML_O_SDnum "SDNUM"
+#define OOO_STRING_SVTOOLS_HTML_O_sdlibrary "SDLIBRARY"
+#define OOO_STRING_SVTOOLS_HTML_O_sdmodule "SDMODULE"
+#define OOO_STRING_SVTOOLS_HTML_O_sdevent "SDEVENT-"
+#define OOO_STRING_SVTOOLS_HTML_O_sdaddparam "SDADDPARAM-"
+
+// Attribute mit einem SGML-Identifier als Wert
+#define OOO_STRING_SVTOOLS_HTML_O_from "FROM"
+#define OOO_STRING_SVTOOLS_HTML_O_id "ID"
+#define OOO_STRING_SVTOOLS_HTML_O_target "TARGET"
+#define OOO_STRING_SVTOOLS_HTML_O_to "TO"
+#define OOO_STRING_SVTOOLS_HTML_O_until "UNTIL"
+
+// Attribute mit einem URI als Wert
+#define OOO_STRING_SVTOOLS_HTML_O_action "ACTION"
+#define OOO_STRING_SVTOOLS_HTML_O_archive "ARCHIVE"
+#define OOO_STRING_SVTOOLS_HTML_O_background "BACKGROUND"
+#define OOO_STRING_SVTOOLS_HTML_O_classid "CLASSID"
+#define OOO_STRING_SVTOOLS_HTML_O_codebase "CODEBASE"
+#define OOO_STRING_SVTOOLS_HTML_O_data "DATA"
+#define OOO_STRING_SVTOOLS_HTML_O_dynsrc "DYNSRC"
+#define OOO_STRING_SVTOOLS_HTML_O_dynsync "DYNSYNC"
+#define OOO_STRING_SVTOOLS_HTML_O_imagemap "IMAGEMAP"
+#define OOO_STRING_SVTOOLS_HTML_O_href "HREF"
+#define OOO_STRING_SVTOOLS_HTML_O_lowsrc "LOWSRC"
+#define OOO_STRING_SVTOOLS_HTML_O_script "SCRIPT"
+#define OOO_STRING_SVTOOLS_HTML_O_src "SRC"
+#define OOO_STRING_SVTOOLS_HTML_O_usemap "USEMAP"
+
+// Attribute mit Entity-Namen als Wert
+#define OOO_STRING_SVTOOLS_HTML_O_dingbat "DINGBAT"
+#define OOO_STRING_SVTOOLS_HTML_O_sym "SYM"
+
+// Attribute mit einer Farbe als Wert (alle Netscape)
+#define OOO_STRING_SVTOOLS_HTML_O_alink "ALINK"
+#define OOO_STRING_SVTOOLS_HTML_O_bgcolor "BGCOLOR"
+#define OOO_STRING_SVTOOLS_HTML_O_bordercolor "BORDERCOLOR"
+#define OOO_STRING_SVTOOLS_HTML_O_bordercolorlight "BORDERCOLORLIGHT"
+#define OOO_STRING_SVTOOLS_HTML_O_bordercolordark "BORDERCOLORDARK"
+#define OOO_STRING_SVTOOLS_HTML_O_color "COLOR"
+#define OOO_STRING_SVTOOLS_HTML_O_link "LINK"
+#define OOO_STRING_SVTOOLS_HTML_O_text "TEXT"
+#define OOO_STRING_SVTOOLS_HTML_O_vlink "VLINK"
+
+// Attribute mit einem numerischen Wert
+#define OOO_STRING_SVTOOLS_HTML_O_border "BORDER"
+#define OOO_STRING_SVTOOLS_HTML_O_cellspacing "CELLSPACING"
+#define OOO_STRING_SVTOOLS_HTML_O_cellpadding "CELLPADDING"
+#define OOO_STRING_SVTOOLS_HTML_O_charoff "CHAROFF"
+#define OOO_STRING_SVTOOLS_HTML_O_colspan "COLSPAN"
+#define OOO_STRING_SVTOOLS_HTML_O_framespacing "FRAMESPACING"
+#define OOO_STRING_SVTOOLS_HTML_O_gutter "GUTTER"
+#define OOO_STRING_SVTOOLS_HTML_O_indent "INDENT"
+#define OOO_STRING_SVTOOLS_HTML_O_height "HEIGHT"
+#define OOO_STRING_SVTOOLS_HTML_O_hspace "HSPACE"
+#define OOO_STRING_SVTOOLS_HTML_O_left "LEFT"
+#define OOO_STRING_SVTOOLS_HTML_O_leftmargin "LEFTMARGIN"
+#define OOO_STRING_SVTOOLS_HTML_O_loop "LOOP"
+#define OOO_STRING_SVTOOLS_HTML_O_marginheight "MARGINHEIGHT"
+#define OOO_STRING_SVTOOLS_HTML_O_marginwidth "MARGINWIDTH"
+#define OOO_STRING_SVTOOLS_HTML_O_max "MAX"
+#define OOO_STRING_SVTOOLS_HTML_O_maxlength "MAXLENGTH"
+#define OOO_STRING_SVTOOLS_HTML_O_min "MIN"
+#define OOO_STRING_SVTOOLS_HTML_O_pagex "PAGEX"
+#define OOO_STRING_SVTOOLS_HTML_O_pagey "PAGEY"
+#define OOO_STRING_SVTOOLS_HTML_O_pointsize "POINT-SIZE"
+#define OOO_STRING_SVTOOLS_HTML_O_rowspan "ROWSPAN"
+#define OOO_STRING_SVTOOLS_HTML_O_scrollamount "SCROLLAMOUNT"
+#define OOO_STRING_SVTOOLS_HTML_O_scrolldelay "SCROLLDELAY"
+#define OOO_STRING_SVTOOLS_HTML_O_seqnum "SEQNUM"
+#define OOO_STRING_SVTOOLS_HTML_O_skip "SKIP"
+#define OOO_STRING_SVTOOLS_HTML_O_span "SPAN"
+#define OOO_STRING_SVTOOLS_HTML_O_tabindex "TABINDEX"
+#define OOO_STRING_SVTOOLS_HTML_O_top "TOP"
+#define OOO_STRING_SVTOOLS_HTML_O_topmargin "TOPMARGIN"
+#define OOO_STRING_SVTOOLS_HTML_O_vspace "VSPACE"
+#define OOO_STRING_SVTOOLS_HTML_O_weight "WEIGHT"
+#define OOO_STRING_SVTOOLS_HTML_O_width "WIDTH"
+#define OOO_STRING_SVTOOLS_HTML_O_x "X"
+#define OOO_STRING_SVTOOLS_HTML_O_y "Y"
+#define OOO_STRING_SVTOOLS_HTML_O_zindex "Z-INDEX"
+
+// Attribute mit Enum-Werten
+#define OOO_STRING_SVTOOLS_HTML_O_behavior "BEHAVIOR"
+#define OOO_STRING_SVTOOLS_HTML_O_bgproperties "BGPROPERTIES"
+#define OOO_STRING_SVTOOLS_HTML_O_clear "CLEAR"
+#define OOO_STRING_SVTOOLS_HTML_O_dir "DIR"
+#define OOO_STRING_SVTOOLS_HTML_O_direction "DIRECTION"
+#define OOO_STRING_SVTOOLS_HTML_O_format "FORMAT"
+#define OOO_STRING_SVTOOLS_HTML_O_frame "FRAME"
+#define OOO_STRING_SVTOOLS_HTML_O_lang "LANG"
+#define OOO_STRING_SVTOOLS_HTML_O_method "METHOD"
+#define OOO_STRING_SVTOOLS_HTML_O_palette "PALETTE"
+#define OOO_STRING_SVTOOLS_HTML_O_rel "REL"
+#define OOO_STRING_SVTOOLS_HTML_O_rev "REV"
+#define OOO_STRING_SVTOOLS_HTML_O_rules "RULES"
+#define OOO_STRING_SVTOOLS_HTML_O_scrolling "SCROLLING"
+#define OOO_STRING_SVTOOLS_HTML_O_sdreadonly "READONLY"
+#define OOO_STRING_SVTOOLS_HTML_O_subtype "SUBTYPE"
+#define OOO_STRING_SVTOOLS_HTML_O_type "TYPE"
+#define OOO_STRING_SVTOOLS_HTML_O_valign "VALIGN"
+#define OOO_STRING_SVTOOLS_HTML_O_valuetype "VALUETYPE"
+#define OOO_STRING_SVTOOLS_HTML_O_visibility "VISIBILITY"
+#define OOO_STRING_SVTOOLS_HTML_O_wrap "WRAP"
+
+// Attribute mit Script-Code als Wert
+#define OOO_STRING_SVTOOLS_HTML_O_onblur "ONBLUR"
+#define OOO_STRING_SVTOOLS_HTML_O_onchange "ONCHANGE"
+#define OOO_STRING_SVTOOLS_HTML_O_onclick "ONCLICK"
+#define OOO_STRING_SVTOOLS_HTML_O_onfocus "ONFOCUS"
+#define OOO_STRING_SVTOOLS_HTML_O_onload "ONLOAD"
+#define OOO_STRING_SVTOOLS_HTML_O_onmouseover "ONMOUSEOVER"
+#define OOO_STRING_SVTOOLS_HTML_O_onreset "ONRESET"
+#define OOO_STRING_SVTOOLS_HTML_O_onselect "ONSELECT"
+#define OOO_STRING_SVTOOLS_HTML_O_onsubmit "ONSUBMIT"
+#define OOO_STRING_SVTOOLS_HTML_O_onunload "ONUNLOAD"
+#define OOO_STRING_SVTOOLS_HTML_O_onabort "ONABORT"
+#define OOO_STRING_SVTOOLS_HTML_O_onerror "ONERROR"
+#define OOO_STRING_SVTOOLS_HTML_O_onmouseout "ONMOUSEOUT"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonblur "SDONBLUR"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonchange "SDONCHANGE"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonclick "SDONCLICK"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonfocus "SDONFOCUS"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonload "SDONLOAD"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonmouseover "SDONMOUSEOVER"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonreset "SDONRESET"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonselect "SDONSELECT"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonsubmit "SDONSUBMIT"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonunload "SDONUNLOAD"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonabort "SDONABORT"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonerror "SDONERROR"
+#define OOO_STRING_SVTOOLS_HTML_O_SDonmouseout "SDONMOUSEOUT"
+
+// Attribute mit Kontext-abhaengigen Werten
+#define OOO_STRING_SVTOOLS_HTML_O_align "ALIGN"
+#define OOO_STRING_SVTOOLS_HTML_O_cols "COLS"
+#define OOO_STRING_SVTOOLS_HTML_O_rows "ROWS"
+#define OOO_STRING_SVTOOLS_HTML_O_start "START"
+#define OOO_STRING_SVTOOLS_HTML_O_size "SIZE"
+#define OOO_STRING_SVTOOLS_HTML_O_units "UNITS"
+
+// Werte von <INPUT TYPE=...>
+#define OOO_STRING_SVTOOLS_HTML_IT_text "TEXT"
+#define OOO_STRING_SVTOOLS_HTML_IT_password "PASSWORD"
+#define OOO_STRING_SVTOOLS_HTML_IT_checkbox "CHECKBOX"
+#define OOO_STRING_SVTOOLS_HTML_IT_radio "RADIO"
+#define OOO_STRING_SVTOOLS_HTML_IT_range "RANGE"
+#define OOO_STRING_SVTOOLS_HTML_IT_scribble "SCRIBBLE"
+#define OOO_STRING_SVTOOLS_HTML_IT_file "FILE"
+#define OOO_STRING_SVTOOLS_HTML_IT_hidden "HIDDEN"
+#define OOO_STRING_SVTOOLS_HTML_IT_submit "SUBMIT"
+#define OOO_STRING_SVTOOLS_HTML_IT_image "IMAGE"
+#define OOO_STRING_SVTOOLS_HTML_IT_reset "RESET"
+#define OOO_STRING_SVTOOLS_HTML_IT_button "BUTTON"
+
+// Werte von <TABLE FRAME=...>
+#define OOO_STRING_SVTOOLS_HTML_TF_void "VOID"
+#define OOO_STRING_SVTOOLS_HTML_TF_above "ABOVE"
+#define OOO_STRING_SVTOOLS_HTML_TF_below "BELOW"
+#define OOO_STRING_SVTOOLS_HTML_TF_hsides "HSIDES"
+#define OOO_STRING_SVTOOLS_HTML_TF_lhs "LHS"
+#define OOO_STRING_SVTOOLS_HTML_TF_rhs "RHS"
+#define OOO_STRING_SVTOOLS_HTML_TF_vsides "VSIDES"
+#define OOO_STRING_SVTOOLS_HTML_TF_box "BOX"
+#define OOO_STRING_SVTOOLS_HTML_TF_border "BORDER"
+
+// Werte von <TABLE RULES=...>
+#define OOO_STRING_SVTOOLS_HTML_TR_none "NONE"
+#define OOO_STRING_SVTOOLS_HTML_TR_groups "GROUPS"
+#define OOO_STRING_SVTOOLS_HTML_TR_rows "ROWS"
+#define OOO_STRING_SVTOOLS_HTML_TR_cols "COLS"
+#define OOO_STRING_SVTOOLS_HTML_TR_all "ALL"
+
+// Werte von <P, H?, TR, TH, TD ALIGN=...>
+#define OOO_STRING_SVTOOLS_HTML_AL_left "LEFT"
+#define OOO_STRING_SVTOOLS_HTML_AL_center "CENTER"
+#define OOO_STRING_SVTOOLS_HTML_AL_middle "MIDDLE"
+#define OOO_STRING_SVTOOLS_HTML_AL_right "RIGHT"
+#define OOO_STRING_SVTOOLS_HTML_AL_justify "JUSTIFY"
+#define OOO_STRING_SVTOOLS_HTML_AL_char "CHAR"
+#define OOO_STRING_SVTOOLS_HTML_AL_all "ALL"
+#define OOO_STRING_SVTOOLS_HTML_AL_none "NONE"
+
+// Werte von <TR VALIGN=...>, <IMG ALIGN=...>
+#define OOO_STRING_SVTOOLS_HTML_VA_top "TOP"
+#define OOO_STRING_SVTOOLS_HTML_VA_middle "MIDDLE"
+#define OOO_STRING_SVTOOLS_HTML_VA_bottom "BOTTOM"
+#define OOO_STRING_SVTOOLS_HTML_VA_baseline "BASELINE"
+#define OOO_STRING_SVTOOLS_HTML_VA_texttop "TEXTTOP"
+#define OOO_STRING_SVTOOLS_HTML_VA_absmiddle "ABSMIDDLE"
+#define OOO_STRING_SVTOOLS_HTML_VA_absbottom "ABSBOTTOM"
+
+// Werte von <AREA SHAPE=...>
+#define OOO_STRING_SVTOOLS_HTML_SH_rect "RECT"
+#define OOO_STRING_SVTOOLS_HTML_SH_rectangle "RECTANGLE"
+#define OOO_STRING_SVTOOLS_HTML_SH_circ "CIRC"
+#define OOO_STRING_SVTOOLS_HTML_SH_circle "CIRCLE"
+#define OOO_STRING_SVTOOLS_HTML_SH_poly "POLY"
+#define OOO_STRING_SVTOOLS_HTML_SH_polygon "POLYGON"
+#define OOO_STRING_SVTOOLS_HTML_SH_default "DEFAULT"
+
+#define OOO_STRING_SVTOOLS_HTML_LG_starbasic "STARBASIC"
+#define OOO_STRING_SVTOOLS_HTML_LG_javascript "JAVASCRIPT"
+#define OOO_STRING_SVTOOLS_HTML_LG_javascript11 "JAVASCRIPT1.1"
+#define OOO_STRING_SVTOOLS_HTML_LG_livescript "LIVESCRIPT"
+
+// ein par Werte fuer unser StarBASIC-Support
+#define OOO_STRING_SVTOOLS_HTML_SB_library "$LIBRARY:"
+#define OOO_STRING_SVTOOLS_HTML_SB_module "$MODULE:"
+
+// Werte von <FORM METHOD=...>
+#define OOO_STRING_SVTOOLS_HTML_METHOD_get "GET"
+#define OOO_STRING_SVTOOLS_HTML_METHOD_post "POST"
+
+// Werte von <META CONTENT/HTTP-EQUIV=...>
+#define OOO_STRING_SVTOOLS_HTML_META_refresh "REFRESH"
+#define OOO_STRING_SVTOOLS_HTML_META_generator "GENERATOR"
+#define OOO_STRING_SVTOOLS_HTML_META_author "AUTHOR"
+#define OOO_STRING_SVTOOLS_HTML_META_classification "CLASSIFICATION"
+#define OOO_STRING_SVTOOLS_HTML_META_description "DESCRIPTION"
+#define OOO_STRING_SVTOOLS_HTML_META_keywords "KEYWORDS"
+#define OOO_STRING_SVTOOLS_HTML_META_changed "CHANGED"
+#define OOO_STRING_SVTOOLS_HTML_META_changedby "CHANGEDBY"
+#define OOO_STRING_SVTOOLS_HTML_META_created "CREATED"
+#define OOO_STRING_SVTOOLS_HTML_META_content_type "CONTENT-TYPE"
+#define OOO_STRING_SVTOOLS_HTML_META_content_script_type "CONTENT-SCRIPT-TYPE"
+#define OOO_STRING_SVTOOLS_HTML_META_sdendnote "SDENDNOTE"
+#define OOO_STRING_SVTOOLS_HTML_META_sdfootnote "SDFOOTNOTE"
+
+// Werte von <UL TYPE=...>
+#define OOO_STRING_SVTOOLS_HTML_ULTYPE_disc "DISC"
+#define OOO_STRING_SVTOOLS_HTML_ULTYPE_square "SQUARE"
+#define OOO_STRING_SVTOOLS_HTML_ULTYPE_circle "CIRCLE"
+
+// Werte von <FRAMESET SCROLLING=...>
+#define OOO_STRING_SVTOOLS_HTML_SCROLL_yes "YES"
+#define OOO_STRING_SVTOOLS_HTML_SCROLL_no "NO"
+#define OOO_STRING_SVTOOLS_HTML_SCROLL_auto "AUTO"
+
+// Werte von <MULTICOL TYPE=...>
+#define OOO_STRING_SVTOOLS_HTML_MCTYPE_horizontal "HORIZONTAL"
+#define OOO_STRING_SVTOOLS_HTML_MCTYPE_vertical "VERTICAL"
+#define OOO_STRING_SVTOOLS_HTML_MCTYPE_box "BOX"
+
+// Werte von <MARQUEE BEHAVIOUR=...>
+#define OOO_STRING_SVTOOLS_HTML_BEHAV_scroll "SCROLL"
+#define OOO_STRING_SVTOOLS_HTML_BEHAV_slide "SLIDE"
+#define OOO_STRING_SVTOOLS_HTML_BEHAV_alternate "ALTERNATE"
+
+// Werte von <MARQUEE LOOP=...>
+#define OOO_STRING_SVTOOLS_HTML_LOOP_infinite "INFINITE"
+#define OOO_STRING_SVTOOLS_HTML_SPTYPE_block "BLOCK"
+#define OOO_STRING_SVTOOLS_HTML_SPTYPE_horizontal "HORIZONTAL"
+#define OOO_STRING_SVTOOLS_HTML_SPTYPE_vertical "VERTICAL"
+
+// interne Grafik-Namen
+#define OOO_STRING_SVTOOLS_HTML_private_image "private:image/"
+#define OOO_STRING_SVTOOLS_HTML_internal_gopher "internal-gopher-"
+#define OOO_STRING_SVTOOLS_HTML_internal_icon "internal-icon-"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_binary "binary"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_image "image"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_index "index"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_menu "menu"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_movie "movie"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_sound "sound"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_telnet "telnet"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_text "text"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_unknown "unknown"
+#define OOO_STRING_SVTOOLS_HTML_INT_ICON_baddata "baddata"
+#define OOO_STRING_SVTOOLS_HTML_INT_ICON_delayed "delayed"
+#define OOO_STRING_SVTOOLS_HTML_INT_ICON_embed "embed"
+#define OOO_STRING_SVTOOLS_HTML_INT_ICON_insecure "insecure"
+#define OOO_STRING_SVTOOLS_HTML_INT_ICON_notfound "notfound"
+#define OOO_STRING_SVTOOLS_HTML_sdendnote "sdendnote"
+#define OOO_STRING_SVTOOLS_HTML_sdendnote_anc "sdendnoteanc"
+#define OOO_STRING_SVTOOLS_HTML_sdendnote_sym "sdendnotesym"
+#define OOO_STRING_SVTOOLS_HTML_sdfootnote "sdfootnote"
+#define OOO_STRING_SVTOOLS_HTML_sdfootnote_anc "sdfootnoteanc"
+#define OOO_STRING_SVTOOLS_HTML_sdfootnote_sym "sdfootnotesym"
+#define OOO_STRING_SVTOOLS_HTML_FTN_anchor "anc"
+#define OOO_STRING_SVTOOLS_HTML_FTN_symbol "sym"
+#define OOO_STRING_SVTOOLS_HTML_WW_off "OFF"
+#define OOO_STRING_SVTOOLS_HTML_WW_hard "HARD"
+#define OOO_STRING_SVTOOLS_HTML_WW_soft "SOFT"
+#define OOO_STRING_SVTOOLS_HTML_WW_virtual "VIRTUAL"
+#define OOO_STRING_SVTOOLS_HTML_WW_physical "PHYSICAL"
+#define OOO_STRING_SVTOOLS_HTML_on "on"
+#define OOO_STRING_SVTOOLS_HTML_ET_url "application/x-www-form-urlencoded"
+#define OOO_STRING_SVTOOLS_HTML_ET_multipart "multipart/form-data"
+#define OOO_STRING_SVTOOLS_HTML_ET_text "text/plain"
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/htmlout.hxx b/include/svtools/htmlout.hxx
new file mode 100644
index 000000000000..33c76fed1876
--- /dev/null
+++ b/include/svtools/htmlout.hxx
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _HTMLOUT_HXX
+#define _HTMLOUT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/solar.h>
+#include <rtl/textenc.h>
+#include <rtl/string.hxx>
+#include <svl/macitem.hxx>
+
+class Color;
+class ImageMap;
+class String;
+class SvStream;
+class SvxMacroTableDtor;
+class SvNumberFormatter;
+
+struct HTMLOutEvent
+{
+ const sal_Char *pBasicName;
+ const sal_Char *pJavaName;
+ sal_uInt16 nEvent;
+};
+
+struct SVT_DLLPUBLIC HTMLOutContext
+{
+ rtl_TextEncoding m_eDestEnc;
+ rtl_TextToUnicodeConverter m_hConv;
+ rtl_TextToUnicodeContext m_hContext;
+
+ HTMLOutContext( rtl_TextEncoding eDestEnc );
+ ~HTMLOutContext();
+};
+
+struct HTMLOutFuncs
+{
+#if defined(UNX)
+ static const sal_Char sNewLine; // nur \012 oder \015
+#else
+ static const sal_Char sNewLine[]; // \015\012
+#endif
+
+ SVT_DLLPUBLIC static OString ConvertStringToHTML( const String& sSrc,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+
+ SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, const sal_Char* pStr,
+ sal_Bool bOn = sal_True,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252);
+ SVT_DLLPUBLIC static SvStream& Out_Char( SvStream&, sal_Unicode cChar,
+ HTMLOutContext& rContext,
+ String *pNonConvertableChars = 0 );
+ SVT_DLLPUBLIC static SvStream& Out_String( SvStream&, const String&,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+ SVT_DLLPUBLIC static SvStream& Out_Hex( SvStream&, sal_uLong nHex, sal_uInt8 nLen,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
+ SVT_DLLPUBLIC static SvStream& Out_Color( SvStream&, const Color&,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
+ SVT_DLLPUBLIC static SvStream& Out_ImageMap( SvStream&, const String&, const ImageMap&, const String&,
+ const HTMLOutEvent *pEventTable,
+ sal_Bool bOutStarBasic,
+ const sal_Char *pDelim = 0,
+ const sal_Char *pIndentArea = 0,
+ const sal_Char *pIndentMap = 0,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+ SVT_DLLPUBLIC static SvStream& FlushToAscii( SvStream&, HTMLOutContext& rContext );
+
+ SVT_DLLPUBLIC static SvStream& OutScript( SvStream& rStrm,
+ const String& rBaseURL,
+ const String& rSource,
+ const String& rLanguage,
+ ScriptType eScriptType,
+ const String& rSrc,
+ const String *pSBLibrary = 0,
+ const String *pSBModule = 0,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+
+ // der 3. Parameter ist ein Array von HTMLOutEvents, das mit einem
+ // nur aus 0 bestehen Eintrag terminiert ist.
+ SVT_DLLPUBLIC static SvStream& Out_Events( SvStream&, const SvxMacroTableDtor&,
+ const HTMLOutEvent*, sal_Bool bOutStarBasic,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+
+ // <TD SDVAL="..." SDNUM="...">
+ SVT_DLLPUBLIC static OString CreateTableDataOptionsValNum(
+ sal_Bool bValue, double fVal, sal_uLong nFormat,
+ SvNumberFormatter& rFormatter,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0);
+
+ SVT_DLLPUBLIC static sal_Bool PrivateURLToInternalImg( String& rURL );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/htmltokn.h b/include/svtools/htmltokn.h
new file mode 100644
index 000000000000..97e73cb4090a
--- /dev/null
+++ b/include/svtools/htmltokn.h
@@ -0,0 +1,561 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _HTMLTOKN_H
+#define _HTMLTOKN_H
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <tools/solar.h>
+
+class String;
+
+// suche das Char zu dem CharNamen
+sal_Unicode GetHTMLCharName( const String& rName );
+
+// suche die TokenID zu dem Token
+SVT_DLLPUBLIC int GetHTMLToken( const String& rName );
+
+// suche die TokenId zu einemm Attribut-Token
+int GetHTMLOption( const String& rName );
+
+// suche die 24-bit-Farbe zu einem Farbnamen (nicht gefunden = ULONG_MAX)
+SVT_DLLPUBLIC sal_uInt32 GetHTMLColor( const String& rName );
+
+// beginnen immer ab 256, groesser als ein char
+const int HTML_TOKEN_START = 0x100;
+const int HTML_TOKEN_ONOFF = 0x200;
+const int HTML_TOKEN_MICROSOFT = 0x1000;
+
+enum HTML_TOKEN_IDS
+{
+ HTML_TEXTTOKEN = HTML_TOKEN_START,
+ HTML_SINGLECHAR,
+ HTML_NEWPARA,
+ HTML_TABCHAR,
+ HTML_RAWDATA,
+ HTML_LINEFEEDCHAR,
+
+ // diese werden nur eingeschaltet
+ HTML_AREA, // Netscape 2.0
+ HTML_BASE, // HTML 3.0
+ HTML_COMMENT,
+ HTML_DOCTYPE,
+ HTML_EMBED, // Netscape 2.0 </EMBED> ignorieren
+ HTML_FIGUREOVERLAY, // HTML 3.0
+ HTML_HORZRULE, // </HR> ignorieren
+ HTML_HORZTAB, // HTML 3.0
+ HTML_IMAGE, // </IMG> ignorieren
+ HTML_INPUT, // </INPUT> ignorieren
+ HTML_ISINDEX, // HTML 3.0
+ HTML_LINEBREAK, // </BR> -> <BR>
+ HTML_LINK, // HTML 3.0
+ HTML_META, // HTML 3.0 </META> ignorieren
+ HTML_NEXTID, // HTML 3.0
+ HTML_OF, // HTML 3.0
+ HTML_OPTION, // </OPTION> ignorieren
+ HTML_PARAM, // HotJava
+ HTML_RANGE, // HTML 3.0
+ HTML_SPACER, // Netscape 3.0b5 // </SPACER> ignorieren
+ HTML_WBR, // Netscape
+
+ // Tokens, die ueber HTML-Charakter erkannt werden
+ HTML_NONBREAKSPACE,
+ HTML_SOFTHYPH,
+
+ // diese werden wieder abgeschaltet,
+ // der off-Wert liegt immer dahinter (+1) !!
+ HTML_ABBREVIATION_ON = HTML_TOKEN_ONOFF, // HTML 3.0
+ HTML_ABBREVIATION_OFF, // HTML 3.0
+ HTML_ABOVE_ON, // HTML 3.0
+ HTML_ABOVE_OFF, // HTML 3.0
+ HTML_ACRONYM_ON, // HTML 3.0
+ HTML_ACRONYM_OFF, // HTML 3.0
+ HTML_ADDRESS_ON,
+ HTML_ADDRESS_OFF,
+ HTML_ANCHOR_ON,
+ HTML_ANCHOR_OFF,
+ HTML_APPLET_ON, // HotJava
+ HTML_APPLET_OFF, // HotJava
+ HTML_ARRAY_ON, // HTML 3.0
+ HTML_ARRAY_OFF, // HTML 3.0
+ HTML_AUTHOR_ON, // HTML 3.0
+ HTML_AUTHOR_OFF, // HTML 3.0
+ HTML_BANNER_ON, // HTML 3.0
+ HTML_BANNER_OFF, // HTML 3.0
+ HTML_BAR_ON, // HTML 3.0
+ HTML_BAR_OFF, // HTML 3.0
+ HTML_BASEFONT_ON, // Netscape
+ HTML_BASEFONT_OFF, // Netscape
+ HTML_BELOW_ON, // HTML 3.0
+ HTML_BELOW_OFF, // HTML 3.0
+ HTML_BIGPRINT_ON, // HTML 3.0
+ HTML_BIGPRINT_OFF, // HTML 3.0
+ HTML_BLINK_ON, // Netscape
+ HTML_BLINK_OFF, // Netscape
+ HTML_BLOCKQUOTE30_ON, // HTML 3.0
+ HTML_BLOCKQUOTE30_OFF, // HTML 3.0
+ HTML_BLOCKQUOTE_ON,
+ HTML_BLOCKQUOTE_OFF,
+ HTML_BODY_ON,
+ HTML_BODY_OFF,
+ HTML_BOLDTEXT_ON, // HTML 3.0
+ HTML_BOLDTEXT_OFF, // HTML 3.0
+ HTML_BOLD_ON,
+ HTML_BOLD_OFF,
+ HTML_BOX_ON, // HTML 3.0
+ HTML_BOX_OFF, // HTML 3.0
+ HTML_CAPTION_ON, // HTML 3.0
+ HTML_CAPTION_OFF, // HTML 3.0
+ HTML_CENTER_ON, // Netscape
+ HTML_CENTER_OFF, // Netscape
+ HTML_CITIATION_ON,
+ HTML_CITIATION_OFF,
+ HTML_CODE_ON,
+ HTML_CODE_OFF,
+ HTML_COL_ON, // HTML3 Table Model Draft
+ HTML_COL_OFF, // HTML3 Table Model Draft
+ HTML_COLGROUP_ON, // HTML3 Table Model Draft
+ HTML_COLGROUP_OFF, // HTML3 Table Model Draft
+ HTML_CREDIT_ON, // HTML 3.0
+ HTML_CREDIT_OFF, // HTML 3.0
+ HTML_DD_ON,
+ HTML_DD_OFF,
+ HTML_DEFLIST_ON,
+ HTML_DEFLIST_OFF,
+ HTML_DELETEDTEXT_ON, // HTML 3.0
+ HTML_DELETEDTEXT_OFF, // HTML 3.0
+ HTML_DIRLIST_ON,
+ HTML_DIRLIST_OFF,
+ HTML_DIVISION_ON, // HTML 3.0
+ HTML_DIVISION_OFF, // HTML 3.0
+ HTML_DOT_ON, // HTML 3.0
+ HTML_DOT_OFF, // HTML 3.0
+ HTML_DOUBLEDOT_ON, // HTML 3.0
+ HTML_DOUBLEDOT_OFF, // HTML 3.0
+ HTML_DT_ON,
+ HTML_DT_OFF,
+ HTML_EMPHASIS_ON,
+ HTML_EMPHASIS_OFF,
+ HTML_FIGURE_ON, // HTML 3.0
+ HTML_FIGURE_OFF, // HTML 3.0
+ HTML_FONT_ON, // Netscape
+ HTML_FONT_OFF, // Netscape
+ HTML_FOOTNOTE_ON, // HTML 3.0
+ HTML_FOOTNOTE_OFF, // HTML 3.0
+ HTML_FORM_ON,
+ HTML_FORM_OFF,
+ HTML_FRAME_ON, // Netscape 2.0
+ HTML_FRAME_OFF, // Netscape 2.0
+ HTML_FRAMESET_ON, // Netscape 2.0
+ HTML_FRAMESET_OFF, // Netscape 2.0
+ HTML_HAT_ON, // HTML 3.0
+ HTML_HAT_OFF, // HTML 3.0
+ HTML_HEAD1_ON,
+ HTML_HEAD1_OFF,
+ HTML_HEAD2_ON,
+ HTML_HEAD2_OFF,
+ HTML_HEAD3_ON,
+ HTML_HEAD3_OFF,
+ HTML_HEAD4_ON,
+ HTML_HEAD4_OFF,
+ HTML_HEAD5_ON,
+ HTML_HEAD5_OFF,
+ HTML_HEAD6_ON,
+ HTML_HEAD6_OFF,
+ HTML_HEAD_ON,
+ HTML_HEAD_OFF,
+ HTML_HTML_ON,
+ HTML_HTML_OFF,
+ HTML_IFRAME_ON, // IE 3.0b2
+ HTML_IFRAME_OFF, // IE 3.0b2
+ HTML_ILAYER_ON,
+ HTML_ILAYER_OFF,
+ HTML_INSERTEDTEXT_ON, // HTML 3.0
+ HTML_INSERTEDTEXT_OFF, // HTML 3.0
+ HTML_ITALIC_ON,
+ HTML_ITALIC_OFF,
+ HTML_ITEM_ON, // HTML 3.0
+ HTML_ITEM_OFF, // HTML 3.0
+ HTML_KEYBOARD_ON,
+ HTML_KEYBOARD_OFF,
+ HTML_LAYER_ON,
+ HTML_LAYER_OFF,
+ HTML_LANGUAGE_ON, // HTML 3.0
+ HTML_LANGUAGE_OFF, // HTML 3.0
+ HTML_LISTHEADER_ON, // HTML 3.0
+ HTML_LISTHEADER_OFF, // HTML 3.0
+ HTML_LI_ON,
+ HTML_LI_OFF,
+ HTML_MAP_ON, // Netscape 2.0
+ HTML_MAP_OFF, // Netscape 2.0
+ HTML_MATH_ON, // HTML 3.0
+ HTML_MATH_OFF, // HTML 3.0
+ HTML_MENULIST_ON,
+ HTML_MENULIST_OFF,
+ HTML_MULTICOL_ON, // Netscape 3.0b5
+ HTML_MULTICOL_OFF, // Netscape 3.0b5
+ HTML_NOBR_ON, // Netscape
+ HTML_NOBR_OFF, // Netscape
+ HTML_NOEMBED_ON, // Netscape 2.0
+ HTML_NOEMBED_OFF, // Netscape 2.0
+ HTML_NOFRAMES_ON, // Netscape 2.0
+ HTML_NOFRAMES_OFF, // Netscape 2.0
+ HTML_NOSCRIPT_ON, // Netscape 2.0
+ HTML_NOSCRIPT_OFF, // Netscape 3.0
+ HTML_NOTE_ON, // HTML 3.0
+ HTML_NOTE_OFF, // HTML 3.0
+ HTML_OBJECT_ON, // HotJava
+ HTML_OBJECT_OFF, // HotJava
+ HTML_ORDERLIST_ON,
+ HTML_ORDERLIST_OFF,
+ HTML_PARABREAK_ON,
+ HTML_PARABREAK_OFF,
+ HTML_PERSON_ON, // HTML 3.0
+ HTML_PERSON_OFF, // HTML 3.0
+ HTML_PLAINTEXT_ON, // HTML 3.0
+ HTML_PLAINTEXT_OFF, // HTML 3.0
+ HTML_PREFORMTXT_ON,
+ HTML_PREFORMTXT_OFF,
+ HTML_ROOT_ON, // HTML 3.0
+ HTML_ROOT_OFF, // HTML 3.0
+ HTML_ROW_ON, // HTML 3.0
+ HTML_ROW_OFF, // HTML 3.0
+ HTML_SAMPLE_ON,
+ HTML_SAMPLE_OFF,
+ HTML_SCRIPT_ON, // HTML 3.2
+ HTML_SCRIPT_OFF, // HTML 3.2
+ HTML_SELECT_ON,
+ HTML_SELECT_OFF,
+ HTML_SHORTQUOTE_ON, // HTML 3.0
+ HTML_SHORTQUOTE_OFF, // HTML 3.0
+ HTML_SMALLPRINT_ON, // HTML 3.0
+ HTML_SMALLPRINT_OFF, // HTML 3.0
+ HTML_SPAN_ON, // Style Sheets
+ HTML_SPAN_OFF, // Style Sheets
+ HTML_SQUAREROOT_ON, // HTML 3.0
+ HTML_SQUAREROOT_OFF, // HTML 3.0
+ HTML_STRIKETHROUGH_ON, // HTML 3.0
+ HTML_STRIKETHROUGH_OFF, // HTML 3.0
+ HTML_STRONG_ON,
+ HTML_STRONG_OFF,
+ HTML_STYLE_ON, // HTML 3.0
+ HTML_STYLE_OFF, // HTML 3.0
+ HTML_SUBSCRIPT_ON, // HTML 3.0
+ HTML_SUBSCRIPT_OFF, // HTML 3.0
+ HTML_SUPERSCRIPT_ON, // HTML 3.0
+ HTML_SUPERSCRIPT_OFF, // HTML 3.0
+ HTML_TABLE_ON, // HTML 3.0
+ HTML_TABLE_OFF, // HTML 3.0
+ HTML_TABLEDATA_ON, // HTML 3.0
+ HTML_TABLEDATA_OFF, // HTML 3.0
+ HTML_TABLEHEADER_ON, // HTML 3.0
+ HTML_TABLEHEADER_OFF, // HTML 3.0
+ HTML_TABLEROW_ON, // HTML 3.0
+ HTML_TABLEROW_OFF, // HTML 3.0
+ HTML_TBODY_ON, // HTML3 Table Model Draft
+ HTML_TBODY_OFF, // HTML3 Table Model Draft
+ HTML_TELETYPE_ON,
+ HTML_TELETYPE_OFF,
+ HTML_TEXTAREA_ON,
+ HTML_TEXTAREA_OFF,
+ HTML_TEXTFLOW_ON, // HTML 3.2
+ HTML_TEXTFLOW_OFF, // HTML 3.2
+ HTML_TEXT_ON, // HTML 3.0
+ HTML_TEXT_OFF, // HTML 3.0
+ HTML_TFOOT_ON, // HTML3 Table Model Draft
+ HTML_TFOOT_OFF, // HTML3 Table Model Draft
+ HTML_THEAD_ON, // HTML3 Table Model Draft
+ HTML_THEAD_OFF, // HTML3 Table Model Draft
+ HTML_TILDE_ON, // HTML 3.0
+ HTML_TILDE_OFF, // HTML 3.0
+ HTML_TITLE_ON,
+ HTML_TITLE_OFF,
+ HTML_UNDERLINE_ON,
+ HTML_UNDERLINE_OFF,
+ HTML_UNORDERLIST_ON,
+ HTML_UNORDERLIST_OFF,
+ HTML_VARIABLE_ON,
+ HTML_VARIABLE_OFF,
+ HTML_VECTOR_ON, // HTML 3.0
+ HTML_VECTOR_OFF, // HTML 3.0
+
+ // obsolete features
+ HTML_XMP_ON,
+ HTML_XMP_OFF,
+ HTML_LISTING_ON,
+ HTML_LISTING_OFF,
+
+ // proposed features
+ HTML_DEFINSTANCE_ON,
+ HTML_DEFINSTANCE_OFF,
+ HTML_STRIKE_ON,
+ HTML_STRIKE_OFF,
+
+ HTML_UNKNOWNCONTROL_ON,
+ HTML_UNKNOWNCONTROL_OFF,
+
+ HTML_BGSOUND = HTML_TOKEN_MICROSOFT|HTML_TOKEN_START,
+
+ HTML_COMMENT2_ON = HTML_TOKEN_MICROSOFT|HTML_TOKEN_ONOFF, // HTML 2.0 ?
+ HTML_COMMENT2_OFF, // HTML 2.0 ?
+ HTML_MARQUEE_ON,
+ HTML_MARQUEE_OFF,
+ HTML_PLAINTEXT2_ON, // HTML 2.0 ?
+ HTML_PLAINTEXT2_OFF, // HTML 2.0 ?
+
+ HTML_SDFIELD_ON,
+ HTML_SDFIELD_OFF
+};
+
+// HTML Attribut-Token (=Optionen)
+
+// beginnen immer ab 256, groesser als ein char
+const int HTML_OPTION_START = 0x100;
+
+enum HTML_OPTION_IDS
+{
+HTML_OPTION_BOOL_START = HTML_OPTION_START,
+
+// Attribute ohne Wert
+ HTML_O_BOX = HTML_OPTION_BOOL_START,
+ HTML_O_CHECKED,
+ HTML_O_COMPACT,
+ HTML_O_CONTINUE,
+ HTML_O_CONTROLS, // IExplorer 2.0
+ HTML_O_DECLARE, // IExplorer 3.0b5
+ HTML_O_DISABLED,
+ HTML_O_FOLDED, // Netscape internal
+ HTML_O_ISMAP,
+ HTML_O_MAYSCRIPT, // Netcape 3.0
+ HTML_O_MULTIPLE,
+ HTML_O_NOFLOW,
+ HTML_O_NOHREF, // Netscape
+ HTML_O_NORESIZE, // Netscape 2.0
+ HTML_O_NOSHADE, // Netscape
+ HTML_O_NOWRAP,
+ HTML_O_PLAIN,
+ HTML_O_SDFIXED,
+ HTML_O_SELECTED,
+ HTML_O_SHAPES, // IExplorer 3.0b5
+HTML_OPTION_BOOL_END,
+
+// Attribute mit einem String als Wert
+HTML_OPTION_STRING_START = HTML_OPTION_BOOL_END,
+ HTML_O_ABOVE = HTML_OPTION_STRING_START,
+ HTML_O_ACCEPT,
+ HTML_O_ACCESSKEY,
+ HTML_O_ADD_DATE, // Netscape internal
+ HTML_O_ALT,
+ HTML_O_AXES,
+ HTML_O_AXIS,
+ HTML_O_BELOW,
+ HTML_O_CHAR, // HTML3 Table Model Draft
+ HTML_O_CLASS,
+ HTML_O_CLIP,
+ HTML_O_CODE, // HotJava
+ HTML_O_CODETYPE,
+ HTML_O_COLSPEC,
+ HTML_O_CONTENT,
+ HTML_O_COORDS, // Netscape 2.0
+ HTML_O_DP,
+ HTML_O_ENCTYPE,
+ HTML_O_ERROR,
+ HTML_O_FACE, // IExplorer 2.0
+ HTML_O_FRAMEBORDER, // IExplorer 3.0
+ HTML_O_HTTPEQUIV,
+ HTML_O_LANGUAGE, // JavaScript
+ HTML_O_LAST_MODIFIED, // Netscape internal
+ HTML_O_LAST_VISIT, // Netscape internal
+ HTML_O_MD,
+ HTML_O_N,
+ HTML_O_NAME,
+ HTML_O_NOTATION,
+ HTML_O_PROMPT,
+ HTML_O_SHAPE,
+ HTML_O_STANDBY,
+ HTML_O_STYLE, // Style Sheets
+ HTML_O_TITLE,
+ HTML_O_VALUE,
+ HTML_O_SDVAL, // StarDiv NumberValue
+ HTML_O_SDNUM, // StarDiv NumberFormat
+ HTML_O_SDLIBRARY,
+ HTML_O_SDMODULE,
+HTML_OPTION_STRING_END,
+
+// Attribute mit einem SGML-Identifier als Wert
+HTML_OPTION_SGMLID_START = HTML_OPTION_STRING_END,
+ HTML_O_FROM = HTML_OPTION_SGMLID_START,
+ HTML_O_ID,
+ HTML_O_TARGET, // Netscape 2.0
+ HTML_O_TO,
+ HTML_O_UNTIL,
+HTML_OPTION_SGMLID_END,
+
+// Attribute mit einem URI als Wert
+HTML_OPTION_URI_START = HTML_OPTION_SGMLID_END,
+ HTML_O_ACTION = HTML_OPTION_URI_START,
+ HTML_O_ARCHIVE,
+ HTML_O_BACKGROUND,
+ HTML_O_CLASSID,
+ HTML_O_CODEBASE, // HotJava
+ HTML_O_DATA,
+ HTML_O_DYNSRC, // IExplorer 3.0
+ HTML_O_DYNSYNC, // IExplorer 2.0
+ HTML_O_IMAGEMAP,
+ HTML_O_HREF,
+ HTML_O_LOWSRC, // Netscape 3.0
+ HTML_O_SCRIPT,
+ HTML_O_SRC,
+ HTML_O_USEMAP, // Netscape 2.0
+HTML_OPTION_URI_END,
+
+// Attribute mit Entity-Namen als Wert
+HTML_OPTION_ENTITY_START = HTML_OPTION_URI_END,
+ HTML_O_DINGBAT = HTML_OPTION_ENTITY_START,
+ HTML_O_SYM,
+HTML_OPTION_ENTITY_END,
+
+// Attribute mit einer Farbe als Wert (alle Netscape)
+HTML_OPTION_COLOR_START = HTML_OPTION_ENTITY_END,
+ HTML_O_ALINK = HTML_OPTION_COLOR_START,
+ HTML_O_BGCOLOR,
+ HTML_O_BORDERCOLOR, // IExplorer 2.0
+ HTML_O_BORDERCOLORLIGHT, // IExplorer 2.0
+ HTML_O_BORDERCOLORDARK, // IExplorer 2.0
+ HTML_O_COLOR,
+ HTML_O_LINK,
+ HTML_O_TEXT,
+ HTML_O_VLINK,
+HTML_OPTION_COLOR_END,
+
+// Attribute mit einem numerischen Wert
+HTML_OPTION_NUMBER_START = HTML_OPTION_COLOR_END,
+ HTML_O_BORDER = HTML_OPTION_NUMBER_START,
+ HTML_O_CELLSPACING, // HTML3 Table Model Draft
+ HTML_O_CELLPADDING, // HTML3 Table Model Draft
+ HTML_O_CHAROFF, // HTML3 Table Model Draft
+ HTML_O_COLSPAN,
+ HTML_O_FRAMESPACING, // IExplorer 3.0
+ HTML_O_GUTTER, // Netscape 3.0b5
+ HTML_O_INDENT,
+ HTML_O_HEIGHT,
+ HTML_O_HSPACE, // Netscape
+ HTML_O_LEFT,
+ HTML_O_LEFTMARGIN, // IExplorer 2.0
+ HTML_O_LOOP, // IExplorer 2.0
+ HTML_O_MARGINWIDTH, // Netscape 2.0
+ HTML_O_MARGINHEIGHT, // Netscape 2.0
+ HTML_O_MAX,
+ HTML_O_MAXLENGTH,
+ HTML_O_MIN,
+ HTML_O_PAGEX,
+ HTML_O_PAGEY,
+ HTML_O_POINTSIZE,
+ HTML_O_ROWSPAN,
+ HTML_O_SCROLLAMOUNT, // IExplorer 2.0
+ HTML_O_SCROLLDELAY, // IExplorer 2.0
+ HTML_O_SEQNUM,
+ HTML_O_SKIP,
+ HTML_O_SPAN, // HTML3 Table Model Draft
+ HTML_O_TABINDEX,
+ HTML_O_TOP,
+ HTML_O_TOPMARGIN, // IExplorer 2.0
+ HTML_O_VSPACE, // Netscape
+ HTML_O_WEIGHT,
+ HTML_O_WIDTH,
+ HTML_O_X,
+ HTML_O_Y,
+ HTML_O_ZINDEX,
+HTML_OPTION_NUMBER_END,
+
+// Attribute mit Enum-Werten
+HTML_OPTION_ENUM_START = HTML_OPTION_NUMBER_END,
+ HTML_O_BEHAVIOR = HTML_OPTION_ENUM_START, // IExplorer 2.0
+ HTML_O_BGPROPERTIES, // IExplorer 2.0
+ HTML_O_CLEAR,
+ HTML_O_DIR,
+ HTML_O_DIRECTION, // IExplorer 2.0
+ HTML_O_FORMAT,
+ HTML_O_FRAME, // HTML3 Table Model Draft
+ HTML_O_LANG,
+ HTML_O_METHOD,
+ HTML_O_PALETTE,
+ HTML_O_REL,
+ HTML_O_REV,
+ HTML_O_RULES, // HTML3 Table Model Draft
+ HTML_O_SCROLLING, // Netscape 2.0
+ HTML_O_SDREADONLY,
+ HTML_O_SUBTYPE,
+ HTML_O_TYPE,
+ HTML_O_VALIGN,
+ HTML_O_VALUETYPE,
+ HTML_O_VISIBILITY,
+ HTML_O_WRAP,
+HTML_OPTION_ENUM_END,
+
+// Attribute mit Script-Code als Wert
+HTML_OPTION_SCRIPT_START = HTML_OPTION_ENUM_END,
+ HTML_O_ONABORT = HTML_OPTION_SCRIPT_START, // JavaScript
+ HTML_O_ONBLUR, // JavaScript
+ HTML_O_ONCHANGE, // JavaScript
+ HTML_O_ONCLICK, // JavaScript
+ HTML_O_ONERROR, // JavaScript
+ HTML_O_ONFOCUS, // JavaScript
+ HTML_O_ONLOAD, // JavaScript
+ HTML_O_ONMOUSEOUT, // JavaScript
+ HTML_O_ONMOUSEOVER, // JavaScript
+ HTML_O_ONRESET, // JavaScript
+ HTML_O_ONSELECT, // JavaScript
+ HTML_O_ONSUBMIT, // JavaScript
+ HTML_O_ONUNLOAD, // JavaScript
+
+ HTML_O_SDONABORT, // StarBasic
+ HTML_O_SDONBLUR, // StarBasic
+ HTML_O_SDONCHANGE, // StarBasic
+ HTML_O_SDONCLICK, // StarBasic
+ HTML_O_SDONERROR, // StarBasic
+ HTML_O_SDONFOCUS, // StarBasic
+ HTML_O_SDONLOAD, // StarBasic
+ HTML_O_SDONMOUSEOUT, // StarBasic
+ HTML_O_SDONMOUSEOVER, // StarBasic
+ HTML_O_SDONRESET, // StarBasic
+ HTML_O_SDONSELECT, // StarBasic
+ HTML_O_SDONSUBMIT, // StarBasic
+ HTML_O_SDONUNLOAD, // StarBasic
+HTML_OPTION_SCRIPT_END,
+
+// Attribute mit Kontext-abhaengigen Werten
+HTML_OPTION_CONTEXT_START = HTML_OPTION_SCRIPT_END,
+ HTML_O_ALIGN = HTML_OPTION_CONTEXT_START,
+ HTML_O_COLS, // Netscape 2.0 vs HTML 2.0
+ HTML_O_ROWS, // Netscape 2.0 vs HTML 2.0
+ HTML_O_SIZE,
+ HTML_O_START,
+ HTML_O_UNITS,
+HTML_OPTION_CONTEXT_END,
+
+// eine unbekannte Option
+HTML_O_UNKNOWN = HTML_OPTION_CONTEXT_END,
+HTML_OPTION_END
+};
+
+#endif // _HTMLTOKN_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/hyperlabel.hxx b/include/svtools/hyperlabel.hxx
new file mode 100644
index 000000000000..745c50798f1d
--- /dev/null
+++ b/include/svtools/hyperlabel.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 SVTOOLS_HYPERLABEL_HXX
+#define SVTOOLS_HYPERLABEL_HXX
+
+#include <vcl/event.hxx>
+
+
+#include <vcl/fixed.hxx>
+
+#define LABELBASEMAPHEIGHT 8
+
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ class HyperLabelImpl;
+
+ class HyperLabel : public FixedText
+ {
+ protected:
+ HyperLabelImpl* m_pImpl;
+ Link maClickHdl;
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+ void DeactivateHyperMode(Font aFont, const Color aColor);
+ void ActivateHyperMode(Font aFont, const Color aColor);
+
+ protected:
+ void implInit();
+
+ public:
+ HyperLabel( Window* _pParent, WinBits _nWinStyle = 0 );
+ ~HyperLabel( );
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void SetID( sal_Int16 _ID );
+ sal_Int16 GetID() const;
+
+ void SetIndex( sal_Int32 _Index );
+ sal_Int32 GetIndex() const;
+
+ void SetLabel( const OUString& _rText );
+
+ void ToggleBackgroundColor( const Color& _rGBColor );
+ void SetInteractive( sal_Bool _bInteractive );
+
+ void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
+ const Link& GetClickHdl() const { return maClickHdl; }
+
+ Size CalcMinimumSize( long nMaxWidth = 0 ) const;
+
+ private:
+
+ DECL_LINK(ImplClickHdl, HyperLabel*);
+
+ private:
+ using FixedText::CalcMinimumSize;
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imagemgr.hrc b/include/svtools/imagemgr.hrc
new file mode 100644
index 000000000000..1d86788e69fe
--- /dev/null
+++ b/include/svtools/imagemgr.hrc
@@ -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 _SVTOOLS_IMAGEMGR_HRC
+#define _SVTOOLS_IMAGEMGR_HRC
+
+#define IMAGELIST_START 3076 // must match to old Id's in SFX!
+
+#define IMG_IMPRESS (IMAGELIST_START + 47)
+#define IMG_BITMAP (IMAGELIST_START + 49)
+#define IMG_CALC (IMAGELIST_START + 50)
+#define IMG_CALCTEMPLATE (IMAGELIST_START + 51)
+#define IMG_DATABASE (IMAGELIST_START + 53)
+#define IMG_IMPRESSTEMPLATE (IMAGELIST_START + 54)
+#define IMG_GIF (IMAGELIST_START + 61)
+#define IMG_HTML (IMAGELIST_START + 63)
+#define IMG_JPG (IMAGELIST_START + 64)
+#define IMG_MATH (IMAGELIST_START + 68)
+#define IMG_MATHTEMPLATE (IMAGELIST_START + 69)
+#define IMG_FILE (IMAGELIST_START + 74)
+#define IMG_PCD (IMAGELIST_START + 76)
+#define IMG_PCT (IMAGELIST_START + 77)
+#define IMG_PCX (IMAGELIST_START + 78)
+#define IMG_SIM (IMAGELIST_START + 79)
+#define IMG_TEXTFILE (IMAGELIST_START + 80)
+#define IMG_TIFF (IMAGELIST_START + 82)
+#define IMG_WMF (IMAGELIST_START + 84)
+#define IMG_WRITER (IMAGELIST_START + 86)
+#define IMG_WRITERTEMPLATE (IMAGELIST_START + 87)
+#define IMG_FIXEDDEV (IMAGELIST_START + 88)
+#define IMG_REMOVEABLEDEV (IMAGELIST_START + 89)
+#define IMG_CDROMDEV (IMAGELIST_START + 90)
+#define IMG_NETWORKDEV (IMAGELIST_START + 91)
+#define IMG_TABLE (IMAGELIST_START + 112)
+#define IMG_FOLDER (IMAGELIST_START + 113)
+#define IMG_DXF (IMAGELIST_START + 141)
+#define IMG_MET (IMAGELIST_START + 142)
+#define IMG_PNG (IMAGELIST_START + 143)
+#define IMG_SGF (IMAGELIST_START + 144)
+#define IMG_SGV (IMAGELIST_START + 145)
+#define IMG_SVM (IMAGELIST_START + 146)
+#define IMG_GLOBAL_DOC (IMAGELIST_START + 150)
+#define IMG_DRAW (IMAGELIST_START + 151)
+#define IMG_DRAWTEMPLATE (IMAGELIST_START + 152)
+#define IMG_OO_DATABASE_DOC (IMAGELIST_START + 169)
+#define IMG_OO_DRAW_DOC (IMAGELIST_START + 170)
+#define IMG_OO_MATH_DOC (IMAGELIST_START + 171)
+#define IMG_OO_GLOBAL_DOC (IMAGELIST_START + 172)
+#define IMG_OO_IMPRESS_DOC (IMAGELIST_START + 173)
+#define IMG_OO_CALC_DOC (IMAGELIST_START + 174)
+#define IMG_OO_WRITER_DOC (IMAGELIST_START + 175)
+#define IMG_OO_DRAW_TEMPLATE (IMAGELIST_START + 176)
+#define IMG_OO_IMPRESS_TEMPLATE (IMAGELIST_START + 177)
+#define IMG_OO_CALC_TEMPLATE (IMAGELIST_START + 178)
+#define IMG_OO_WRITER_TEMPLATE (IMAGELIST_START + 179)
+#define IMG_EXTENSION (IMAGELIST_START + 180)
+
+#define RID_DESCRIPTION_START 256
+
+#define STR_DESCRIPTION_SOURCEFILE (RID_DESCRIPTION_START + 0)
+#define STR_DESCRIPTION_BOOKMARKFILE (RID_DESCRIPTION_START + 1)
+#define STR_DESCRIPTION_GRAPHIC_DOC (RID_DESCRIPTION_START + 2)
+#define STR_DESCRIPTION_CFGFILE (RID_DESCRIPTION_START + 3)
+#define STR_DESCRIPTION_APPLICATION (RID_DESCRIPTION_START + 4)
+#define STR_DESCRIPTION_DATABASE_TABLE (RID_DESCRIPTION_START + 5)
+#define STR_DESCRIPTION_SYSFILE (RID_DESCRIPTION_START + 6)
+#define STR_DESCRIPTION_WORD_DOC (RID_DESCRIPTION_START + 7)
+#define STR_DESCRIPTION_HELP_DOC (RID_DESCRIPTION_START + 8)
+#define STR_DESCRIPTION_HTMLFILE (RID_DESCRIPTION_START + 9)
+#define STR_DESCRIPTION_ARCHIVFILE (RID_DESCRIPTION_START + 10)
+#define STR_DESCRIPTION_LOGFILE (RID_DESCRIPTION_START + 11)
+#define STR_DESCRIPTION_SMATH_DOC (RID_DESCRIPTION_START + 12)
+#define STR_DESCRIPTION_SCHART_DOC (RID_DESCRIPTION_START + 13)
+#define STR_DESCRIPTION_SDRAW_DOC (RID_DESCRIPTION_START + 14)
+#define STR_DESCRIPTION_SCALC_DOC (RID_DESCRIPTION_START + 15)
+#define STR_DESCRIPTION_SIMPRESS_DOC (RID_DESCRIPTION_START + 16)
+#define STR_DESCRIPTION_SWRITER_DOC (RID_DESCRIPTION_START + 17)
+#define STR_DESCRIPTION_GLOBALDOC (RID_DESCRIPTION_START + 18)
+#define STR_DESCRIPTION_SIMAGE_DOC (RID_DESCRIPTION_START + 19)
+#define STR_DESCRIPTION_TEXTFILE (RID_DESCRIPTION_START + 20)
+#define STR_DESCRIPTION_LINK (RID_DESCRIPTION_START + 21)
+#define STR_DESCRIPTION_SOFFICE_TEMPLATE_DOC (RID_DESCRIPTION_START + 22)
+#define STR_DESCRIPTION_EXCEL_DOC (RID_DESCRIPTION_START + 23)
+#define STR_DESCRIPTION_EXCEL_TEMPLATE_DOC (RID_DESCRIPTION_START + 24)
+#define STR_DESCRIPTION_BATCHFILE (RID_DESCRIPTION_START + 25)
+#define STR_DESCRIPTION_FILE (RID_DESCRIPTION_START + 26)
+#define STR_DESCRIPTION_FOLDER (RID_DESCRIPTION_START + 27)
+#define STR_DESCRIPTION_FACTORY_WRITER (RID_DESCRIPTION_START + 28)
+#define STR_DESCRIPTION_FACTORY_CALC (RID_DESCRIPTION_START + 29)
+#define STR_DESCRIPTION_FACTORY_IMPRESS (RID_DESCRIPTION_START + 30)
+#define STR_DESCRIPTION_FACTORY_DRAW (RID_DESCRIPTION_START + 31)
+#define STR_DESCRIPTION_FACTORY_WRITERWEB (RID_DESCRIPTION_START + 32)
+#define STR_DESCRIPTION_FACTORY_GLOBALDOC (RID_DESCRIPTION_START + 33)
+#define STR_DESCRIPTION_FACTORY_MATH (RID_DESCRIPTION_START + 34)
+#define STR_DESCRIPTION_CALC_TEMPLATE (RID_DESCRIPTION_START + 35)
+#define STR_DESCRIPTION_DRAW_TEMPLATE (RID_DESCRIPTION_START + 36)
+#define STR_DESCRIPTION_IMPRESS_TEMPLATE (RID_DESCRIPTION_START + 37)
+#define STR_DESCRIPTION_WRITER_TEMPLATE (RID_DESCRIPTION_START + 38)
+#define STR_DESCRIPTION_LOCALE_VOLUME (RID_DESCRIPTION_START + 39)
+#define STR_DESCRIPTION_FLOPPY_VOLUME (RID_DESCRIPTION_START + 40)
+#define STR_DESCRIPTION_CDROM_VOLUME (RID_DESCRIPTION_START + 41)
+#define STR_DESCRIPTION_REMOTE_VOLUME (RID_DESCRIPTION_START + 42)
+#define STR_DESCRIPTION_POWERPOINT (RID_DESCRIPTION_START + 43)
+#define STR_DESCRIPTION_POWERPOINT_TEMPLATE (RID_DESCRIPTION_START + 44)
+#define STR_DESCRIPTION_POWERPOINT_SHOW (RID_DESCRIPTION_START + 45)
+#define STR_DESCRIPTION_SXMATH_DOC (RID_DESCRIPTION_START + 46)
+#define STR_DESCRIPTION_SXCHART_DOC (RID_DESCRIPTION_START + 47)
+#define STR_DESCRIPTION_SXDRAW_DOC (RID_DESCRIPTION_START + 48)
+#define STR_DESCRIPTION_SXCALC_DOC (RID_DESCRIPTION_START + 49)
+#define STR_DESCRIPTION_SXIMPRESS_DOC (RID_DESCRIPTION_START + 50)
+#define STR_DESCRIPTION_SXWRITER_DOC (RID_DESCRIPTION_START + 51)
+#define STR_DESCRIPTION_SXGLOBAL_DOC (RID_DESCRIPTION_START + 52)
+#define STR_DESCRIPTION_MATHML_DOC (RID_DESCRIPTION_START + 53)
+#define STR_DESCRIPTION_SDATABASE_DOC (RID_DESCRIPTION_START + 54)
+#define STR_DESCRIPTION_OO_DATABASE_DOC (RID_DESCRIPTION_START + 55)
+#define STR_DESCRIPTION_OO_DRAW_DOC (RID_DESCRIPTION_START + 56)
+#define STR_DESCRIPTION_OO_MATH_DOC (RID_DESCRIPTION_START + 57)
+#define STR_DESCRIPTION_OO_GLOBAL_DOC (RID_DESCRIPTION_START + 58)
+#define STR_DESCRIPTION_OO_IMPRESS_DOC (RID_DESCRIPTION_START + 59)
+#define STR_DESCRIPTION_OO_CALC_DOC (RID_DESCRIPTION_START + 60)
+#define STR_DESCRIPTION_OO_WRITER_DOC (RID_DESCRIPTION_START + 61)
+#define STR_DESCRIPTION_OO_DRAW_TEMPLATE (RID_DESCRIPTION_START + 62)
+#define STR_DESCRIPTION_OO_IMPRESS_TEMPLATE (RID_DESCRIPTION_START + 63)
+#define STR_DESCRIPTION_OO_CALC_TEMPLATE (RID_DESCRIPTION_START + 64)
+#define STR_DESCRIPTION_OO_WRITER_TEMPLATE (RID_DESCRIPTION_START + 65)
+#define STR_DESCRIPTION_FACTORY_DATABASE (RID_DESCRIPTION_START + 66)
+#define STR_DESCRIPTION_EXTENSION (RID_DESCRIPTION_START + 67)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imagemgr.hxx b/include/svtools/imagemgr.hxx
new file mode 100644
index 000000000000..860190f835a3
--- /dev/null
+++ b/include/svtools/imagemgr.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 _SVTOOLS_IMAGEMGR_HXX
+#define _SVTOOLS_IMAGEMGR_HXX
+
+#include "svtools/svtdllapi.h"
+#include "sal/types.h"
+
+class Image;
+class String;
+class INetURLObject;
+
+namespace svtools {
+
+struct VolumeInfo
+{
+ sal_Bool m_bIsVolume;
+ sal_Bool m_bIsRemote;
+ sal_Bool m_bIsRemoveable;
+ sal_Bool m_bIsFloppy;
+ sal_Bool m_bIsCompactDisc;
+
+ VolumeInfo() :
+ m_bIsVolume ( sal_False ),
+ m_bIsRemote ( sal_False ),
+ m_bIsRemoveable ( sal_False ),
+ m_bIsFloppy ( sal_False ),
+ m_bIsCompactDisc( sal_False ) {}
+
+ VolumeInfo( sal_Bool _bIsVolume,
+ sal_Bool _bIsRemote,
+ sal_Bool _bIsRemoveable,
+ sal_Bool _bIsFloppy,
+ sal_Bool _bIsCompactDisc ) :
+ m_bIsVolume ( _bIsVolume ),
+ m_bIsRemote ( _bIsRemote ),
+ m_bIsRemoveable ( _bIsRemoveable ),
+ m_bIsFloppy ( _bIsFloppy ),
+ m_bIsCompactDisc( _bIsCompactDisc ) {}
+};
+
+}
+
+class SvFileInformationManager
+{
+private:
+ SVT_DLLPRIVATE static String GetDescription_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder );
+
+public:
+ SVT_DLLPUBLIC static Image GetImage( const INetURLObject& rURL, sal_Bool bBig = sal_False );
+ SVT_DLLPUBLIC static Image GetFileImage( const INetURLObject& rURL, sal_Bool bBig = sal_False );
+ SVT_DLLPUBLIC static Image GetImageNoDefault( const INetURLObject& rURL, sal_Bool bBig = sal_False );
+ SVT_DLLPUBLIC static Image GetFolderImage( const svtools::VolumeInfo& rInfo, sal_Bool bBig = sal_False );
+
+ SVT_DLLPUBLIC static String GetDescription( const INetURLObject& rObject );
+ SVT_DLLPUBLIC static String GetFileDescription( const INetURLObject& rObject );
+ SVT_DLLPUBLIC static String GetFolderDescription( const svtools::VolumeInfo& rInfo );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imageresourceaccess.hxx b/include/svtools/imageresourceaccess.hxx
new file mode 100644
index 000000000000..b8282da72167
--- /dev/null
+++ b/include/svtools/imageresourceaccess.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
+#define SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+class SvStream;
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= GraphicAccess
+ //====================================================================
+ /** helper class for obtaining streams (which also can be used with the ImageProducer)
+ from a resource
+ */
+ class GraphicAccess
+ {
+ private:
+ GraphicAccess(); // never implemented
+
+ public:
+ /** determines whether the given URL denotes an image within a resource
+ ( or an image specified by a vnd.sun.star.GraphicObject scheme URL )
+ */
+ SVT_DLLPUBLIC static bool isSupportedURL( const OUString& _rURL );
+
+ /** for a given URL of an image within a resource ( or an image specified by a vnd.sun.star.GraphicObject scheme URL ), this method retrieves
+ an SvStream for this image.
+
+ This method works for arbitrary URLs denoting an image, since the
+ <type scope="com::sun::star::graphics">GraphicsProvider</type> service is used
+ to resolve the URL. However, obtaining the stream is expensive (since
+ the image must be copied), so you are strongly encouraged to only use it
+ when you know that the image is small enough.
+ */
+ SVT_DLLPUBLIC static SvStream* getImageStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ const OUString& _rImageResourceURL
+ );
+
+ /** for a given URL of an image within a resource ( or an image specified by a vnd.sun.star.GraphicObject scheme URL ), this method retrieves
+ an <type scope="com::sun::star::io">XInputStream</type> for this image.
+ */
+ SVT_DLLPUBLIC static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ getImageXStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ const OUString& _rImageResourceURL
+ );
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // DBA14_SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imap.hxx b/include/svtools/imap.hxx
new file mode 100644
index 000000000000..790cdebef60f
--- /dev/null
+++ b/include/svtools/imap.hxx
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _IMAP_HXX
+#define _IMAP_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <tools/stream.hxx>
+#include <vector>
+
+class Point;
+class Rectangle;
+class Size;
+class Fraction;
+class IMapObject;
+
+typedef ::std::vector< IMapObject* > IMapObjectList_impl;
+
+class SVT_DLLPUBLIC ImageMap
+{
+private:
+
+ IMapObjectList_impl maList;
+ String aName;
+
+protected:
+
+ // Binaer laden/speichern
+ void ImpWriteImageMap( SvStream& rOStm, const String& ) const ;
+ void ImpReadImageMap( SvStream& rIStm, size_t nCount, const String& );
+
+ // Im-/Export
+ void ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
+ void ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+ sal_uLong ImpReadCERN( SvStream& rOStm, const String& rBaseURL );
+ sal_uLong ImpReadNCSA( SvStream& rOStm, const String& rBaseURL );
+
+ void ImpReadCERNLine( const OString& rLine, const String& rBaseURL );
+ Point ImpReadCERNCoords( const char** ppStr );
+ long ImpReadCERNRadius( const char** ppStr );
+ String ImpReadCERNURL( const char** ppStr, const String& rBaseURL );
+
+ void ImpReadNCSALine( const OString& rLine, const String& rBaseURL );
+ String ImpReadNCSAURL( const char** ppStr, const String& rBaseURL );
+ Point ImpReadNCSACoords( const char** ppStr );
+
+ sal_uLong ImpDetectFormat( SvStream& rIStm );
+
+public:
+
+ TYPEINFO();
+
+ ImageMap() {};
+ ImageMap( const String& rName );
+ ImageMap( const ImageMap& rImageMap );
+
+ // Der Dtor gibt den intern belegten
+ // Speicher wieder frei;
+ // alle IMapObjekte werden im Dtor zerstoert;
+ virtual ~ImageMap();
+
+ // Zuweisungsoperator
+ ImageMap& operator=( const ImageMap& rImageMap );
+
+ // Vergleichsoperator (es wird alles auf Gleichheit geprueft)
+ sal_Bool operator==( const ImageMap& rImageMap );
+ sal_Bool operator!=( const ImageMap& rImageMap );
+
+ // In die Map wird ein neues IMap-Obkekt ans Ende eingefuegt
+ void InsertIMapObject( const IMapObject& rIMapObject );
+
+ // Zugriff auf einzelne IMapObjekte; die Objekte
+ // duerfen von aussen _nicht_ zerstoert werden
+ IMapObject* GetIMapObject( size_t nPos ) const
+ {
+ return ( nPos < maList.size() ) ? maList[ nPos ] : NULL;
+ }
+
+ // Gibt das Objekt zurueck, das zuerst getroffen wurde oder NULL;
+ // Groessen- und Positionsangaben sind in 1/100mm;
+ // rTotalSize ist die Originalgroesse des Bildes;
+ // rDisplaySize die aktuelle Darstellungsgroesse;
+ // rRelPoint bezieht sich auf die Darstellungsgroesse
+ // und die linke oebere Ecke des Bildes
+ IMapObject* GetHitIMapObject( const Size& rOriginalSize,
+ const Size& rDisplaySize,
+ const Point& rRelHitPoint,
+ sal_uLong nFlags = 0 );
+
+ // Gibt die Gesamtanzahl der IMap-Objekte zurueck
+ size_t GetIMapObjectCount() const { return maList.size(); }
+
+ // Loescht alle internen Objekte
+ void ClearImageMap();
+
+ // liefert die aktuelle Versionsnummer
+ sal_uInt16 GetVersion() const;
+
+ // liefert / setzt den Namen der ImageMap
+ const String& GetName() const { return aName; }
+ void SetName( const String& rName ) { aName = rName; }
+
+ // skaliert alle Objekte der ImageMap entpr. dem uebergebenen Faktor
+ void Scale( const Fraction& rFractX, const Fraction& rFracY );
+
+ // Im-/Export
+ void Write ( SvStream& rOStm, const String& rBaseURL ) const;
+ void Read( SvStream& rIStm, const String& rBaseURL );
+
+ void Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL ) const;
+ sal_uLong Read( SvStream& rIStm, sal_uLong nFormat, const String& rBaseURL );
+};
+
+class IMapCompat
+{
+ SvStream* pRWStm;
+ sal_uLong nCompatPos;
+ sal_uLong nTotalSize;
+ sal_uInt16 nStmMode;
+
+ IMapCompat() {}
+ IMapCompat( const IMapCompat& ) {}
+ IMapCompat& operator=( const IMapCompat& ) { return *this; }
+ sal_Bool operator==( const IMapCompat& ) { return sal_False; }
+
+public:
+
+ IMapCompat( SvStream& rStm, const sal_uInt16 nStreamMode );
+ ~IMapCompat();
+};
+
+#endif // _IMAP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imapcirc.hxx b/include/svtools/imapcirc.hxx
new file mode 100644
index 000000000000..057561adad98
--- /dev/null
+++ b/include/svtools/imapcirc.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 _GOODIES_IMAPCIRC_HXX
+#define _GOODIES_IMAPCIRC_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/gen.hxx>
+#include <svtools/imapobj.hxx>
+
+class Fraction;
+
+class SVT_DLLPUBLIC IMapCircleObject : public IMapObject
+{
+ Point aCenter;
+ sal_Int32 nRadius;
+
+ void ImpConstruct( const Point& rCenter, sal_uLong nRad, sal_Bool bPixel );
+
+protected:
+
+ // Binaer-Im-/Export
+ virtual void WriteIMapObject( SvStream& rOStm ) const;
+ virtual void ReadIMapObject( SvStream& rIStm );
+
+public:
+
+ IMapCircleObject() {};
+ IMapCircleObject( const Point& rCenter, sal_uLong nRad,
+ const String& rURL,
+ const String& rAltText,
+ const String& rDesc,
+ const String& rTarget,
+ const String& rName,
+ sal_Bool bActive = sal_True,
+ sal_Bool bPixelCoords = sal_True );
+ virtual ~IMapCircleObject() {};
+
+ virtual sal_uInt16 GetType() const;
+ virtual sal_Bool IsHit( const Point& rPoint ) const;
+
+ Point GetCenter( sal_Bool bPixelCoords = sal_True ) const;
+ sal_uLong GetRadius( sal_Bool bPixelCoords = sal_True ) const;
+
+ // liefert das BoundRect des Kreis-Objektes in 1/100mm
+ virtual Rectangle GetBoundRect() const;
+
+ void Scale( const Fraction& rFractX, const Fraction& rFracY );
+
+ using IMapObject::IsEqual;
+ sal_Bool IsEqual( const IMapCircleObject& rEqObj );
+
+ // Im-/Export
+ void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
+ void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imapobj.hxx b/include/svtools/imapobj.hxx
new file mode 100644
index 000000000000..e90902bec0f0
--- /dev/null
+++ b/include/svtools/imapobj.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 _GOODIES_IMAPOBJ_HXX
+#define _GOODIES_IMAPOBJ_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <svl/macitem.hxx>
+#include <rtl/strbuf.hxx>
+
+class Point;
+class Rectangle;
+class SvStream;
+
+#define IMAP_OBJ_NONE ((sal_uInt16)0x0000)
+#define IMAP_OBJ_RECTANGLE ((sal_uInt16)0x0001)
+#define IMAP_OBJ_CIRCLE ((sal_uInt16)0x0002)
+#define IMAP_OBJ_POLYGON ((sal_uInt16)0x0003)
+#define IMAP_OBJ_VERSION ((sal_uInt16)0x0005)
+
+#define IMAGE_MAP_VERSION ((sal_uInt16)0x0001)
+
+#define IMAPMAGIC "SDIMAP"
+
+#define IMAP_MIRROR_HORZ 0x00000001L
+#define IMAP_MIRROR_VERT 0x00000002L
+
+#define IMAP_FORMAT_BIN 0x00000001L
+#define IMAP_FORMAT_CERN 0x00000002L
+#define IMAP_FORMAT_NCSA 0x00000004L
+#define IMAP_FORMAT_DETECT 0xffffffffL
+
+#define IMAP_ERR_OK 0x00000000L
+#define IMAP_ERR_FORMAT 0x00000001L
+
+class SVT_DLLPUBLIC IMapObject
+{
+ friend class ImageMap;
+
+ String aURL;
+ String aAltText;
+ String aDesc;
+ String aTarget;
+ String aName;
+ SvxMacroTableDtor aEventList;
+ sal_Bool bActive;
+
+protected:
+ sal_uInt16 nReadVersion;
+
+ // Binaer-Im-/Export
+ virtual void WriteIMapObject( SvStream& rOStm ) const = 0;
+ virtual void ReadIMapObject( SvStream& rIStm ) = 0;
+
+ // Hilfsmethoden
+ void AppendCERNCoords(OStringBuffer& rBuf, const Point& rPoint100) const;
+ void AppendCERNURL(OStringBuffer& rBuf, const String& rBaseURL) const;
+ void AppendNCSACoords(OStringBuffer& rBuf, const Point& rPoint100) const;
+ void AppendNCSAURL(OStringBuffer&rBuf, const String& rBaseURL) const;
+
+public:
+
+ static rtl_TextEncoding nActualTextEncoding;
+
+ IMapObject();
+ IMapObject( const String& rURL,
+ const String& rAltText,
+ const String& rDesc,
+ const String& rTarget,
+ const String& rName,
+ sal_Bool bActive );
+ virtual ~IMapObject() {};
+
+ virtual sal_uInt16 GetVersion() const;
+ virtual sal_uInt16 GetType() const = 0;
+ virtual sal_Bool IsHit( const Point& rPoint ) const = 0;
+
+ void Write ( SvStream& rOStm, const String& rBaseURL ) const;
+ void Read( SvStream& rIStm, const String& rBaseURL );
+
+ virtual Rectangle GetBoundRect() const = 0;
+
+ const String& GetURL() const { return aURL; }
+ void SetURL( const String& rURL ) { aURL = rURL; }
+
+ const String& GetAltText() const { return aAltText; }
+ void SetAltText( const String& rAltText) { aAltText = rAltText; }
+
+ const String& GetDesc() const { return aDesc; }
+ void SetDesc( const String& rDesc ) { aDesc = rDesc; }
+
+ const String& GetTarget() const { return aTarget; }
+ void SetTarget( const String& rTarget ) { aTarget = rTarget; }
+
+ const String& GetName() const { return aName; }
+ void SetName( const String& rName ) { aName = rName; }
+
+ sal_Bool IsActive() const { return bActive; }
+ void SetActive( sal_Bool bSetActive = sal_True ) { bActive = bSetActive; }
+
+ sal_Bool IsEqual( const IMapObject& rEqObj );
+
+ // IMap-Events
+ inline const SvxMacroTableDtor& GetMacroTable() const { return aEventList;}
+ inline void SetMacroTable( const SvxMacroTableDtor& rTbl ) { aEventList = rTbl; }
+
+ inline const SvxMacro& GetEvent( sal_uInt16 nEvent ) const;
+ inline sal_Bool HasEvent( sal_uInt16 nEvent ) const;
+ void SetEvent( sal_uInt16 nEvent, const SvxMacro& );
+ inline sal_Bool DelEvent( sal_uInt16 nEvent );
+};
+
+inline sal_Bool IMapObject::HasEvent( sal_uInt16 nEvent ) const
+{
+ return aEventList.IsKeyValid( nEvent );
+}
+inline const SvxMacro& IMapObject::GetEvent( sal_uInt16 nEvent ) const
+{
+ return *(aEventList.Get( nEvent ));
+}
+inline sal_Bool IMapObject::DelEvent( sal_uInt16 nEvent )
+{
+ return aEventList.Erase( nEvent );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imappoly.hxx b/include/svtools/imappoly.hxx
new file mode 100644
index 000000000000..b4a0eafdb07d
--- /dev/null
+++ b/include/svtools/imappoly.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _GOODIES_IMAPPOLY_HXX
+#define _GOODIES_IMAPPOLY_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/imapobj.hxx>
+#include <tools/poly.hxx>
+
+class Fraction;
+
+class SVT_DLLPUBLIC IMapPolygonObject : public IMapObject
+{
+ Polygon aPoly;
+ Rectangle aEllipse;
+ sal_Bool bEllipse;
+
+ SVT_DLLPRIVATE void ImpConstruct( const Polygon& rPoly, sal_Bool bPixel );
+
+protected:
+
+ // Binaer-Im-/Export
+ virtual void WriteIMapObject( SvStream& rOStm ) const;
+ virtual void ReadIMapObject( SvStream& rIStm );
+
+ sal_Bool ReadPreProLine( SvStream& rIStm, String& rStr );
+
+public:
+ IMapPolygonObject() {};
+ IMapPolygonObject( const Polygon& rPoly,
+ const String& rURL,
+ const String& rAltText,
+ const String& rDesc,
+ const String& rTarget,
+ const String& rName,
+ sal_Bool bActive = sal_True,
+ sal_Bool bPixelCoords = sal_True );
+ virtual ~IMapPolygonObject() {};
+
+ virtual sal_uInt16 GetType() const;
+ virtual sal_Bool IsHit( const Point& rPoint ) const;
+
+ Polygon GetPolygon( sal_Bool bPixelCoords = sal_True ) const;
+
+ // liefert das BoundRect des Polygon-Objektes in 1/100mm
+ virtual Rectangle GetBoundRect() const { return aPoly.GetBoundRect(); }
+
+ sal_Bool HasExtraEllipse() const { return bEllipse; }
+ const Rectangle& GetExtraEllipse() const { return aEllipse; }
+ void SetExtraEllipse( const Rectangle& rEllipse );
+
+ void Scale( const Fraction& rFractX, const Fraction& rFracY );
+
+ using IMapObject::IsEqual;
+ sal_Bool IsEqual( const IMapPolygonObject& rEqObj );
+
+ // Im-/Export
+ void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
+ void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imaprect.hxx b/include/svtools/imaprect.hxx
new file mode 100644
index 000000000000..b7d6ab54288a
--- /dev/null
+++ b/include/svtools/imaprect.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 _GOODIES_IMAPRECT_HXX
+#define _GOODIES_IMAPRECT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/imapobj.hxx>
+#include <tools/gen.hxx>
+
+class Fraction;
+
+class SVT_DLLPUBLIC IMapRectangleObject : public IMapObject
+{
+ Rectangle aRect;
+
+ SVT_DLLPRIVATE void ImpConstruct( const Rectangle& rRect, sal_Bool bPixel );
+
+protected:
+
+ // Binaer-Im-/Export
+ virtual void WriteIMapObject( SvStream& rOStm ) const;
+ virtual void ReadIMapObject( SvStream& rIStm );
+
+public:
+
+ IMapRectangleObject() {};
+ IMapRectangleObject( const Rectangle& rRect,
+ const String& rURL,
+ const String& rAltText,
+ const String& rDesc,
+ const String& rTarget,
+ const String& rName,
+ sal_Bool bActive = sal_True,
+ sal_Bool bPixelCoords = sal_True );
+ virtual ~IMapRectangleObject() {};
+
+ virtual sal_uInt16 GetType() const;
+ virtual sal_Bool IsHit( const Point& rPoint ) const;
+
+ Rectangle GetRectangle( sal_Bool bPixelCoords = sal_True ) const;
+
+ // liefert das BoundRect des Rechteck-Objektes in 1/100mm
+ virtual Rectangle GetBoundRect() const { return aRect; }
+
+ void Scale( const Fraction& rFractX, const Fraction& rFracY );
+
+ using IMapObject::IsEqual;
+ sal_Bool IsEqual( const IMapRectangleObject& rEqObj );
+
+ // Im-/Export
+ void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
+ void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imgdef.hxx b/include/svtools/imgdef.hxx
new file mode 100644
index 000000000000..e243d9fd4231
--- /dev/null
+++ b/include/svtools/imgdef.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 _SVTOOLS_IMGDEF_HXX
+#define _SVTOOLS_IMGDEF_HXX
+
+enum SfxSymbolsSize
+{
+ SFX_SYMBOLS_SIZE_SMALL,
+ SFX_SYMBOLS_SIZE_LARGE,
+ SFX_SYMBOLS_SIZE_AUTO
+};
+
+#define SFX_TOOLBOX_CHANGESYMBOLSET 0x0001
+#define SFX_TOOLBOX_CHANGEOUTSTYLE 0x0002
+#define SFX_TOOLBOX_CHANGEBUTTONTYPE 0x0004
+
+#endif // _SVTOOLS_IMGDEF_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/indexentryres.hxx b/include/svtools/indexentryres.hxx
new file mode 100644
index 000000000000..9e2a54a8ef0b
--- /dev/null
+++ b/include/svtools/indexentryres.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 SVTOOLS_INDEXENTRYRESOURCE_HXX
+#define SVTOOLS_INDEXENTRYRESOURCE_HXX
+
+#include "svtools/svtdllapi.h"
+#include <rtl/ustring.hxx>
+
+class IndexEntryResourceData;
+
+class SVT_DLLPUBLIC IndexEntryResource
+{
+ private:
+ IndexEntryResourceData *mp_Data;
+
+ public:
+ IndexEntryResource ();
+ ~IndexEntryResource ();
+ const OUString& GetTranslation (const OUString& r_Algorithm);
+};
+
+#endif /* SVTOOLS_INDEXENTRYRESOURCE_HXX */
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/inetimg.hxx b/include/svtools/inetimg.hxx
new file mode 100644
index 000000000000..f28ac2cdedfe
--- /dev/null
+++ b/include/svtools/inetimg.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 _INETIMG_HXX
+#define _INETIMG_HXX
+
+#include <tools/string.hxx>
+#include <tools/gen.hxx>
+
+class SvData;
+class SotDataObject;
+
+//=========================================================================
+
+class INetImage
+{
+ String aImageURL;
+ String aTargetURL;
+ String aTargetFrame;
+ String aAlternateText;
+ Size aSizePixel;
+
+protected:
+ String CopyExchange() const;
+ void PasteExchange( const String& rString );
+
+ void SetImageURL( const String& rS ) { aImageURL = rS; }
+ void SetTargetURL( const String& rS ) { aTargetURL = rS; }
+ void SetTargetFrame( const String& rS ) { aTargetFrame = rS; }
+ void SetAlternateText( const String& rS ){ aAlternateText = rS; }
+ void SetSizePixel( const Size& rSize ) { aSizePixel = rSize; }
+
+public:
+ INetImage(
+ const String& rImageURL,
+ const String& rTargetURL,
+ const String& rTargetFrame,
+ const String& rAlternateText,
+ const Size& rSizePixel )
+ : aImageURL( rImageURL ),
+ aTargetURL( rTargetURL ),
+ aTargetFrame( rTargetFrame ),
+ aAlternateText( rAlternateText ),
+ aSizePixel( rSizePixel )
+ {}
+ INetImage()
+ {}
+
+ const String& GetImageURL() const { return aImageURL; }
+ const String& GetTargetURL() const { return aTargetURL; }
+ const String& GetTargetFrame() const { return aTargetFrame; }
+ const String& GetAlternateText() const { return aAlternateText; }
+ const Size& GetSizePixel() const { return aSizePixel; }
+
+ // Im-/Export
+ sal_Bool Write( SvStream& rOStm, sal_uLong nFormat ) const;
+ sal_Bool Read( SvStream& rIStm, sal_uLong nFormat );
+};
+
+#endif // #ifndef _INETIMG_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx
new file mode 100644
index 000000000000..a8e85eaf7647
--- /dev/null
+++ b/include/svtools/inettbc.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 _SVTOOLS_INETTBC_HXX
+#define _SVTOOLS_INETTBC_HXX
+
+#include "rtl/ref.hxx"
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <tools/urlobj.hxx>
+
+#include <vcl/combobox.hxx>
+
+class IUrlFilter;
+class SvtMatchContext_Impl;
+class SvtURLBox_Impl;
+class SVT_DLLPUBLIC SvtURLBox : public ComboBox
+{
+friend class SvtMatchContext_Impl;
+friend class SvtURLBox_Impl;
+ Link aOpenHdl;
+ String aBaseURL;
+ String aPlaceHolder;
+ rtl::Reference< SvtMatchContext_Impl > pCtx;
+ SvtURLBox_Impl* pImp;
+ INetProtocol eSmartProtocol;
+ sal_Bool bAutoCompleteMode : 1;
+ sal_Bool bOnlyDirectories : 1;
+ sal_Bool bCtrlClick : 1;
+ sal_Bool bHistoryDisabled : 1;
+ sal_Bool bNoSelection : 1;
+ sal_Bool bIsAutoCompleteEnabled : 1;
+
+ SVT_DLLPRIVATE sal_Bool ProcessKey( const KeyCode& rCode );
+ SVT_DLLPRIVATE void TryAutoComplete();
+ SVT_DLLPRIVATE void UpdatePicklistForSmartProtocol_Impl();
+ DECL_DLLPRIVATE_LINK( AutoCompleteHdl_Impl, void* );
+ SVT_DLLPRIVATE void Init(bool bSetDefaultHelpID);
+
+protected:
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void Select();
+ virtual void Modify();
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+public:
+ SvtURLBox( Window* pParent, INetProtocol eSmart = INET_PROT_NOT_VALID, bool bSetDefaultHelpID = true );
+ SvtURLBox( Window* pParent, WinBits _nStyle, INetProtocol eSmart = INET_PROT_NOT_VALID, bool bSetDefaultHelpID = true );
+ SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart = INET_PROT_NOT_VALID, bool bSetDefaultHelpID = true );
+ ~SvtURLBox();
+
+ void SetBaseURL( const String& rURL );
+ const String& GetBaseURL() const { return aBaseURL; }
+ void SetOpenHdl( const Link& rLink ) { aOpenHdl = rLink; }
+ const Link& GetOpenHdl() const { return aOpenHdl; }
+ void SetOnlyDirectories( sal_Bool bDir = sal_True );
+ void SetNoURLSelection( sal_Bool bSet = sal_True );
+ INetProtocol GetSmartProtocol() const { return eSmartProtocol; }
+ void SetSmartProtocol( INetProtocol eProt );
+ sal_Bool IsCtrlOpen()
+ { return bCtrlClick; }
+ String GetURL();
+ void DisableHistory();
+
+ void UpdatePickList( );
+
+ static String ParseSmart( String aText, String aBaseURL, String aWorkDir );
+
+ void SetFilter(const String& _sFilter);
+ void SetUrlFilter( const IUrlFilter* _pFilter );
+
+ inline void EnableAutocompletion( sal_Bool _bEnable = sal_True )
+ { bIsAutoCompleteEnabled = _bEnable; }
+ void SetPlaceHolder( const String& sPlaceHolder ) { aPlaceHolder = sPlaceHolder; }
+ String GetPlaceHolder() { return aPlaceHolder; }
+ bool MatchesPlaceHolder( const String& sToMatch ) { return ( ( aPlaceHolder.Len() > 0 ) && ( aPlaceHolder == sToMatch ) ); }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/insdlg.hxx b/include/svtools/insdlg.hxx
new file mode 100644
index 000000000000..241f3cd128d2
--- /dev/null
+++ b/include/svtools/insdlg.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 _SVTOOLS_INSDLG_HXX
+#define _SVTOOLS_INSDLG_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <tools/globname.hxx>
+#include <sot/formats.hxx>
+
+#include <vector>
+#include <svtools/transfer.hxx>
+
+class SvObjectServer
+{
+private:
+ SvGlobalName aClassName;
+ String aHumanName;
+
+public:
+ SvObjectServer( const SvGlobalName & rClassP, const String & rHumanP ) :
+ aClassName( rClassP ),
+ aHumanName( rHumanP ) {}
+
+ const SvGlobalName & GetClassName() const { return aClassName; }
+ const String & GetHumanName() const { return aHumanName; }
+};
+
+typedef ::std::vector< SvObjectServer > SvObjectServerList_impl;
+
+class SVT_DLLPUBLIC SvObjectServerList
+{
+private:
+ SvObjectServerList_impl aObjectServerList;
+
+public:
+ const SvObjectServer * Get( const String & rHumanName ) const;
+ const SvObjectServer * Get( const SvGlobalName & ) const;
+ void Remove( const SvGlobalName & );
+ void FillInsertObjects();
+ size_t Count() const
+ {
+ return aObjectServerList.size();
+ }
+
+ const SvObjectServer operator[]( size_t n ) const
+ {
+ return aObjectServerList[ n ];
+ }
+};
+
+class SVT_DLLPUBLIC SvPasteObjectHelper
+{
+public:
+ static String GetSotFormatUIName( SotFormatStringId nId );
+ static sal_Bool GetEmbeddedName(const TransferableDataHelper& rData, String& _rName, String& _rSource, SotFormatStringId& _nFormat);
+};
+
+#endif // _SVTOOLS_INSDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/itemdel.hxx b/include/svtools/itemdel.hxx
new file mode 100644
index 000000000000..acb2637e04cb
--- /dev/null
+++ b/include/svtools/itemdel.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 _SVTOOLS_ITEMDEL_HXX
+#define _SVTOOLS_ITEMDEL_HXX
+
+#include "svtools/svtdllapi.h"
+
+class SfxPoolItem;
+
+SVT_DLLPUBLIC SfxPoolItem* DeleteItemOnIdle( SfxPoolItem* pItem );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/ivctrl.hxx b/include/svtools/ivctrl.hxx
new file mode 100644
index 000000000000..3c5aafc57848
--- /dev/null
+++ b/include/svtools/ivctrl.hxx
@@ -0,0 +1,353 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _ICNVW_HXX
+#define _ICNVW_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <vcl/ctrl.hxx>
+#include <tools/link.hxx>
+#include <tools/contnr.hxx>
+#include <vcl/image.hxx>
+#include <vcl/seleng.hxx>
+
+class ResId;
+class Point;
+class SvxIconChoiceCtrl_Impl;
+class Image;
+
+#define ICNVIEW_FLAG_POS_LOCKED 0x0001
+#define ICNVIEW_FLAG_SELECTED 0x0002
+#define ICNVIEW_FLAG_FOCUSED 0x0004
+#define ICNVIEW_FLAG_IN_USE 0x0008
+#define ICNVIEW_FLAG_CURSORED 0x0010 // Rahmen um Image
+#define ICNVIEW_FLAG_POS_MOVED 0x0020 // per D&D verschoben aber nicht gelockt
+#define ICNVIEW_FLAG_DROP_TARGET 0x0040 // im QueryDrop gesetzt
+#define ICNVIEW_FLAG_BLOCK_EMPHASIS 0x0080 // Emphasis nicht painten
+#define ICNVIEW_FLAG_USER1 0x0100
+#define ICNVIEW_FLAG_USER2 0x0200
+#define ICNVIEW_FLAG_PRED_SET 0x0400 // Predecessor wurde umgesetzt
+
+enum SvxIconChoiceCtrlTextMode
+{
+ IcnShowTextFull = 1, // BoundRect nach unten aufplustern
+ IcnShowTextShort, // Abkuerzung mit "..."
+ IcnShowTextSmart, // Text komplett anzeigen, wenn moeglich (n.i.)
+ IcnShowTextDontKnow // Einstellung der View
+};
+
+enum SvxIconChoiceCtrlPositionMode
+{
+ IcnViewPositionModeFree = 0, // freies pixelgenaues Positionieren
+ IcnViewPositionModeAutoArrange = 1, // automatisches Ausrichten
+ IcnViewPositionModeAutoAdjust = 2, // automatisches Anordnen
+ IcnViewPositionModeLast = IcnViewPositionModeAutoAdjust
+};
+
+class SvxIconChoiceCtrlEntry
+{
+ Image aImage;
+
+ OUString aText;
+ String aQuickHelpText;
+ void* pUserData;
+
+ friend class SvxIconChoiceCtrl_Impl;
+ friend class IcnCursor_Impl;
+ friend class EntryList_Impl;
+ friend class IcnGridMap_Impl;
+
+ Rectangle aRect; // Bounding-Rect des Entries
+ Rectangle aGridRect; // nur gesetzt im Grid-Modus
+ sal_uLong nPos;
+
+ // die Eintragsposition in der Eintragsliste entspricht der beim Insert vorgegebenen
+ // [Sortier-]Reihenfolge (->Reihenfolge der Anker in der Ankerliste!). Im AutoArrange-Modus
+ // kann die sichtbare Reihenfolge aber anders sein. Die Eintraege werden deshalb dann
+ // verkettet
+ SvxIconChoiceCtrlEntry* pblink; // backward (linker Nachbar)
+ SvxIconChoiceCtrlEntry* pflink; // forward (rechter Nachbar)
+
+ SvxIconChoiceCtrlTextMode eTextMode;
+ sal_uInt16 nX,nY; // fuer Tastatursteuerung
+ sal_uInt16 nFlags;
+
+ void ClearFlags( sal_uInt16 nMask ) { nFlags &= (~nMask); }
+ void SetFlags( sal_uInt16 nMask ) { nFlags |= nMask; }
+ void AssignFlags( sal_uInt16 _nFlags ) { nFlags = _nFlags; }
+
+ // setzt den linken Nachbarn (A <-> B ==> A <-> this <-> B)
+ void SetBacklink( SvxIconChoiceCtrlEntry* pA )
+ {
+ pA->pflink->pblink = this; // X <- B
+ this->pflink = pA->pflink; // X -> B
+ this->pblink = pA; // A <- X
+ pA->pflink = this; // A -> X
+ }
+ // loest eine Verbindung (A <-> this <-> B ==> A <-> B)
+ void Unlink()
+ {
+ this->pblink->pflink = this->pflink;
+ this->pflink->pblink = this->pblink;
+ this->pflink = 0;
+ this->pblink = 0;
+ }
+
+public:
+ SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, sal_uInt16 nFlags = 0 );
+ ~SvxIconChoiceCtrlEntry () {}
+
+ void SetImage ( const Image& rImage ) { aImage = rImage; }
+ Image GetImage () const { return aImage; }
+ void SetText ( const OUString& rText ) { aText = rText; }
+ OUString GetText () const { return aText; }
+ String SVT_DLLPUBLIC GetDisplayText() const;
+ void SetQuickHelpText( const String& rText ) { aQuickHelpText = rText; }
+ String GetQuickHelpText() const { return aQuickHelpText; }
+ void SetUserData ( void* _pUserData ) { pUserData = _pUserData; }
+ void* GetUserData () { return pUserData; }
+
+ const Rectangle & GetBoundRect() const { return aRect; }
+
+ void SetFocus ( sal_Bool bSet )
+ { nFlags = ( bSet ? nFlags | ICNVIEW_FLAG_FOCUSED : nFlags & ~ICNVIEW_FLAG_FOCUSED ); }
+
+ SvxIconChoiceCtrlTextMode GetTextMode() const { return eTextMode; }
+ sal_uInt16 GetFlags() const { return nFlags; }
+ sal_Bool IsSelected() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_SELECTED) !=0); }
+ sal_Bool IsFocused() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_FOCUSED) !=0); }
+ sal_Bool IsInUse() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_IN_USE) !=0); }
+ sal_Bool IsCursored() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_CURSORED) !=0); }
+ sal_Bool IsDropTarget() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_DROP_TARGET) !=0); }
+ sal_Bool IsBlockingEmphasis() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_BLOCK_EMPHASIS) !=0); }
+ sal_Bool IsPosLocked() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_POS_LOCKED) !=0); }
+
+ // Nur bei AutoArrange gesetzt. Den Kopf der Liste gibts per SvxIconChoiceCtrl::GetPredecessorHead
+ SvxIconChoiceCtrlEntry* GetSuccessor() const { return pflink; }
+ SvxIconChoiceCtrlEntry* GetPredecessor() const { return pblink; }
+
+// sal_Unicode GetMnemonicChar() const;
+};
+
+enum SvxIconChoiceCtrlColumnAlign
+{
+ IcnViewAlignLeft = 1,
+ IcnViewAlignRight,
+ IcnViewAlignCenter
+};
+
+class SvxIconChoiceCtrlColumnInfo
+{
+ OUString aColText;
+ Image aColImage;
+ long nWidth;
+ SvxIconChoiceCtrlColumnAlign eAlignment;
+ sal_uInt16 nSubItem;
+
+public:
+ SvxIconChoiceCtrlColumnInfo( sal_uInt16 nSub, long nWd,
+ SvxIconChoiceCtrlColumnAlign eAlign ) :
+ nWidth( nWd ), eAlignment( eAlign ), nSubItem( nSub ) {}
+ SvxIconChoiceCtrlColumnInfo( const SvxIconChoiceCtrlColumnInfo& );
+
+ void SetText( const OUString& rText ) { aColText = rText; }
+ void SetImage( const Image& rImg ) { aColImage = rImg; }
+ void SetWidth( long nWd ) { nWidth = nWd; }
+ void SetAlignment( SvxIconChoiceCtrlColumnAlign eAlign ) { eAlignment = eAlign; }
+ void SetSubItem( sal_uInt16 nSub) { nSubItem = nSub; }
+
+ const OUString& GetText() const { return aColText; }
+ const Image& GetImage() const { return aColImage; }
+ long GetWidth() const { return nWidth; }
+ SvxIconChoiceCtrlColumnAlign GetAlignment() const { return eAlignment; }
+ sal_uInt16 GetSubItem() const { return nSubItem; }
+};
+
+//###################################################################################################################################
+/*
+ Window-Bits:
+ WB_ICON // Text unter dem Icon
+ WB_SMALL_ICON // Text rechts neben Icon, beliebige Positionierung
+ WB_DETAILS // Text rechts neben Icon, eingeschraenkte Posit.
+ WB_BORDER
+ WB_NOHIDESELECTION // Selektion inaktiv zeichnen, wenn kein Fokus
+ WB_NOHSCROLL
+ WB_NOVSCROLL
+ WB_NOSELECTION
+ WB_SMART_ARRANGE // im Arrange die Vis-Area beibehalten
+ WB_ALIGN_TOP // Anordnung zeilenweise von links nach rechts
+ WB_ALIGN_LEFT // Anordnung spaltenweise von oben nach unten
+ WB_NODRAGSELECTION // Keine Selektion per Tracking-Rect
+ WB_NOCOLUMNHEADER // keine Headerbar in Detailsview (Headerbar not implemented)
+ WB_NOPOINTERFOCUS // Kein GrabFocus im MouseButtonDown
+ WB_HIGHLIGHTFRAME // der unter der Maus befindliche Eintrag wird hervorgehoben
+ WB_NOASYNCSELECTHDL // Selektionshandler synchron aufrufen, d.h. Events nicht sammeln
+*/
+
+#define WB_ICON WB_RECTSTYLE
+#define WB_SMALLICON WB_SMALLSTYLE
+#define WB_DETAILS WB_VCENTER
+#define WB_NOHSCROLL WB_SPIN
+#define WB_NOVSCROLL WB_DRAG
+#define WB_NOSELECTION WB_REPEAT
+#define WB_NODRAGSELECTION WB_PATHELLIPSIS
+#define WB_SMART_ARRANGE WB_PASSWORD
+#define WB_ALIGN_TOP WB_TOP
+#define WB_ALIGN_LEFT WB_LEFT
+#define WB_NOCOLUMNHEADER WB_CENTER
+#define WB_HIGHLIGHTFRAME WB_INFO
+#define WB_NOASYNCSELECTHDL WB_NOLABEL
+
+class MnemonicGenerator;
+
+class SVT_DLLPUBLIC SvtIconChoiceCtrl : public Control
+{
+ friend class SvxIconChoiceCtrl_Impl;
+
+ Link _aClickIconHdl;
+ Link _aDocRectChangedHdl;
+ Link _aVisRectChangedHdl;
+ KeyEvent* _pCurKeyEvent;
+ SvxIconChoiceCtrl_Impl* _pImp;
+ sal_Bool _bAutoFontColor;
+
+protected:
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual sal_Bool EditedEntry( SvxIconChoiceCtrlEntry*, const OUString& rNewText, sal_Bool bCancelled );
+ virtual void DocumentRectChanged();
+ virtual void VisibleRectChanged();
+ virtual sal_Bool EditingEntry( SvxIconChoiceCtrlEntry* pEntry );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void ClickIcon();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void DrawEntryImage(
+ SvxIconChoiceCtrlEntry* pEntry,
+ const Point& rPos,
+ OutputDevice& rDev );
+
+ virtual String GetEntryText(
+ SvxIconChoiceCtrlEntry* pEntry,
+ sal_Bool bInplaceEdit );
+
+ virtual void FillLayoutData() const;
+
+ void CallImplEventListeners(sal_uLong nEvent, void* pData);
+
+public:
+
+ SvtIconChoiceCtrl( Window* pParent, WinBits nWinStyle = WB_ICON | WB_BORDER );
+ virtual ~SvtIconChoiceCtrl();
+
+ void SetStyle( WinBits nWinStyle );
+ WinBits GetStyle() const;
+
+ sal_Bool SetChoiceWithCursor ( sal_Bool bDo = sal_True );
+
+ void SetFont( const Font& rFont );
+ void SetPointFont( const Font& rFont );
+
+ void SetClickHdl( const Link& rLink ) { _aClickIconHdl = rLink; }
+ const Link& GetClickHdl() const { return _aClickIconHdl; }
+
+ using OutputDevice::SetBackground;
+ void SetBackground( const Wallpaper& rWallpaper );
+
+ void ArrangeIcons();
+
+
+ SvxIconChoiceCtrlEntry* InsertEntry( const String& rText,
+ const Image& rImage,
+ sal_uLong nPos = LIST_APPEND,
+ const Point* pPos = 0,
+ sal_uInt16 nFlags = 0
+ );
+
+ /** creates automatic mnemonics for all icon texts in the control
+ */
+ void CreateAutoMnemonics( void );
+
+ /** creates automatic mnemonics for all icon texts in the control
+
+ @param _rUsedMnemonics
+ a <type>MnemonicGenerator</type> at which some other mnemonics are already registered.
+ This can be used if the control needs to share the "mnemonic space" with other elements,
+ such as a menu bar.
+ */
+ void CreateAutoMnemonics( MnemonicGenerator& _rUsedMnemonics );
+
+ sal_Bool DoKeyInput( const KeyEvent& rKEvt );
+
+ sal_Bool IsEntryEditing() const;
+
+ sal_uLong GetEntryCount() const;
+ SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const;
+ sal_uLong GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const;
+ using Window::SetCursor;
+ void SetCursor( SvxIconChoiceCtrlEntry* pEntry );
+ SvxIconChoiceCtrlEntry* GetCursor() const;
+
+ // Neu-Berechnung gecachter View-Daten und Invalidierung im Fenster
+ void InvalidateEntry( SvxIconChoiceCtrlEntry* pEntry );
+
+ // bHit==sal_False: Eintrag gilt als getroffen, wenn Position im BoundRect liegt
+ // ==sal_True : Bitmap oder Text muss getroffen sein
+ SvxIconChoiceCtrlEntry* GetEntry( const Point& rPosPixel, sal_Bool bHit = sal_False ) const;
+
+ // in dem sal_uLong wird die Position in der Liste des gefunden Eintrags zurueckgegeben
+ SvxIconChoiceCtrlEntry* GetSelectedEntry( sal_uLong& rPos ) const;
+
+ void SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry* pEntry = 0 );
+
+ virtual sal_Bool HasBackground() const;
+ virtual sal_Bool HasFont() const;
+ virtual sal_Bool HasFontTextColor() const;
+ virtual sal_Bool HasFontFillColor() const;
+
+ void SetFontColorToBackground ( sal_Bool bDo = sal_True ) { _bAutoFontColor = bDo; }
+ sal_Bool AutoFontColor () { return _bAutoFontColor; }
+
+ Point GetPixelPos( const Point& rPosLogic ) const;
+ void SetSelectionMode( SelectionMode eMode );
+
+ Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const;
+ Rectangle GetEntryCharacterBounds( const sal_Int32 _nEntryPos, const sal_Int32 _nCharacterIndex ) const;
+
+ void SetNoSelection();
+
+ // ACCESSIBILITY ==========================================================
+
+ /** Creates and returns the accessible object of the Box. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+};
+
+#endif // _ICNVW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/javacontext.hxx b/include/svtools/javacontext.hxx
new file mode 100644
index 000000000000..2c81cbf43d42
--- /dev/null
+++ b/include/svtools/javacontext.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 _SVTOOLS_JAVACONTEXT_HXX_
+#define _SVTOOLS_JAVACONTEXT_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <osl/mutex.hxx>
+
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <com/sun/star/uno/XCurrentContext.hpp>
+
+
+namespace svt
+{
+// We cannot derive from cppu::WeakImplHelper because we would export the inline
+//generated class. This conflicts with other libraries if they use the same inline
+//class.
+ class SVT_DLLPUBLIC JavaContext :
+ public com::sun::star::uno::XCurrentContext
+ {
+
+ public:
+ /** The parameter bShowErrorsOnce controls whether a message box is
+ only displayed once for a reocurring Java error. That is only
+ the first time JavaInteractionHandler.handle is called with a
+ particular Request then the message box is shown. Afterwards
+ nothing happens.
+ */
+ JavaContext( const com::sun::star::uno::Reference<
+ com::sun::star::uno::XCurrentContext> & ctx,
+ bool bReportErrorOnce = true );
+ virtual ~JavaContext();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
+ const ::com::sun::star::uno::Type& aType )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL acquire() throw ();
+
+ virtual void SAL_CALL release() throw ();
+
+ // XCurrentContext
+ virtual com::sun::star::uno::Any SAL_CALL getValueByName( const OUString& Name )
+ throw (com::sun::star::uno::RuntimeException);
+
+ private:
+ SVT_DLLPRIVATE JavaContext(); //not implemented
+ SVT_DLLPRIVATE JavaContext(JavaContext&); //not implemented
+ SVT_DLLPRIVATE JavaContext& operator = (JavaContext&); //not implemented
+
+ oslInterlockedCount m_aRefCount;
+
+ com::sun::star::uno::Reference<
+ com::sun::star::uno::XCurrentContext > m_xNextContext;
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionHandler> m_xHandler;
+ bool m_bShowErrorsOnce;
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/javainteractionhandler.hxx b/include/svtools/javainteractionhandler.hxx
new file mode 100644
index 000000000000..fed409f41ec5
--- /dev/null
+++ b/include/svtools/javainteractionhandler.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 _SVTOOLS_JAVAINTERACTION_HXX_
+#define _SVTOOLS_JAVAINTERACTION_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <osl/mutex.hxx>
+#include <sal/types.h>
+
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <svtools/javacontext.hxx>
+
+#define JAVA_INTERACTION_HANDLER_NAME "java-vm.interaction-handler"
+
+namespace svt
+{
+// We cannot derive from cppu::WeakImplHelper because we would export the inline
+//generated class. This conflicts with other libraries if they use the same inline
+//class.
+
+class SVT_DLLPUBLIC JavaInteractionHandler:
+ public com::sun::star::task::XInteractionHandler
+{
+public:
+ JavaInteractionHandler(bool bReportErrorOnce = true);
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
+ const ::com::sun::star::uno::Type& aType )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL acquire() throw();
+
+ virtual void SAL_CALL release() throw();
+
+ // XCurrentContext
+ virtual void SAL_CALL handle( const com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest >& Request )
+ throw (com::sun::star::uno::RuntimeException);
+
+private:
+ oslInterlockedCount m_aRefCount;
+ SVT_DLLPRIVATE JavaInteractionHandler(JavaInteractionHandler const&); //not implemented
+ SVT_DLLPRIVATE JavaInteractionHandler& operator = (JavaInteractionHandler const &); //not implemented
+ SVT_DLLPRIVATE virtual ~JavaInteractionHandler();
+ bool m_bShowErrorsOnce;
+ bool m_bJavaDisabled_Handled;
+ bool m_bInvalidSettings_Handled;
+ bool m_bJavaNotFound_Handled;
+ bool m_bVMCreationFailure_Handled;
+ bool m_bRestartRequired_Handled;
+ sal_uInt16 m_nResult_JavaDisabled;
+};
+}
+
+#endif // _DESKTOP_JAVAINTERACTION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/langhelp.hxx b/include/svtools/langhelp.hxx
new file mode 100644
index 000000000000..1231e6b0e380
--- /dev/null
+++ b/include/svtools/langhelp.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:
+ *
+ */
+
+#ifndef _SVTOOLS_LANGHELP_HXX_
+#define _SVTOOLS_LANGHELP_HXX_
+
+#include <svtools/svtdllapi.h>
+
+#include <rtl/ustring.hxx>
+
+/** Localize a URI to one of the foundation's webservices
+
+ @param io_rURI
+ URI to localize - depending on your UI locale, a country local
+ part is appended to the URI (like "en", or "fr", or "es")
+ */
+SVT_DLLPUBLIC void localizeWebserviceURI( OUString& io_rURI );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/langtab.hxx b/include/svtools/langtab.hxx
new file mode 100644
index 000000000000..1ef5875d2948
--- /dev/null
+++ b/include/svtools/langtab.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 _SVTOOLS_LANGTAB_HXX_
+#define _SVTOOLS_LANGTAB_HXX_
+
+
+#include <tools/resary.hxx>
+#include <i18nlangtag/lang.h>
+#include <svtools/svtdllapi.h>
+
+//========================================================================
+// class SvtLanguageTable
+//========================================================================
+
+class SVT_DLLPUBLIC SvtLanguageTable : public ResStringArray
+{
+public:
+ SvtLanguageTable();
+ ~SvtLanguageTable();
+
+ /**
+ @param bUserInterfaceSelection
+ If TRUE, don't replace an UI-only locale. Only use for
+ Tools->Options->LanguageSettings->UserInterface listbox.
+ If FALSE, do replace.
+ */
+ const OUString GetString( const LanguageType eType, bool bUserInterfaceSelection = false ) const;
+ LanguageType GetType( const String& rStr ) const;
+
+ sal_uInt32 GetEntryCount() const;
+ LanguageType GetTypeAtIndex( sal_uInt32 nIndex ) const;
+ static String GetLanguageString( const LanguageType eType );
+};
+
+// Add LRE or RLE embedding characters to the string based on the
+// String content (see #i78466#, #i32179#)
+SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/localresaccess.hxx b/include/svtools/localresaccess.hxx
new file mode 100644
index 000000000000..8e80f9462cf2
--- /dev/null
+++ b/include/svtools/localresaccess.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 _SVTOOLS_LOCALRESACCESS_HXX_
+#define _SVTOOLS_LOCALRESACCESS_HXX_
+
+#include <tools/rc.hxx>
+#include <tools/rcid.h>
+#include <osl/diagnose.h>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=========================================================================
+ //= OLocalResourceAccess
+ //=========================================================================
+ /** helper class for acessing local resources
+ */
+ class OLocalResourceAccess : public Resource
+ {
+ protected:
+ ResMgr* m_pManager;
+
+ public:
+ OLocalResourceAccess( const ResId& _rId )
+ :Resource( _rId.SetAutoRelease( sal_False ) )
+ ,m_pManager( _rId.GetResMgr() )
+ {
+ }
+
+ OLocalResourceAccess(const ResId& _rId, RESOURCE_TYPE _rType)
+ :Resource(_rId.SetRT(_rType).SetAutoRelease(sal_False))
+ ,m_pManager(_rId.GetResMgr())
+ {
+ OSL_ENSURE( m_pManager != NULL, "OLocalResourceAccess::OLocalResourceAccess: invalid resource manager!" );
+ }
+
+ ~OLocalResourceAccess()
+ {
+ if ( m_pManager )
+ m_pManager->Increment( m_pManager->GetRemainSize() );
+ FreeResource();
+ }
+
+ inline sal_Bool IsAvailableRes( const ResId& _rId ) const
+ {
+ return Resource::IsAvailableRes( _rId );
+ }
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // _SVTOOLS_LOCALRESACCESS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/menuoptions.hxx b/include/svtools/menuoptions.hxx
new file mode 100644
index 000000000000..527319c52380
--- /dev/null
+++ b/include/svtools/menuoptions.hxx
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_SVTOOLS_MENUOPTIONS_HXX
+#define INCLUDED_SVTOOLS_MENUOPTIONS_HXX
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <unotools/options.hxx>
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class Link;
+class SvtMenuOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about menu features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class SVT_DLLPUBLIC SAL_WARN_UNUSED SvtMenuOptions: public utl::detail::Options
+{
+ public:
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtMenuOptions();
+ virtual ~SvtMenuOptions();
+
+ void AddListenerLink( const Link& rLink );
+ void RemoveListenerLink( const Link& rLink );
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/View/Menu/..."
+ @descr These options describe internal states to enable/disable features of installed office.
+
+ IsEntryHidingEnabled()
+ SetEntryHidingState() => Activate this field for viewing all deactivated menu entries.
+ Menu commands that are normally not necessary are hidden by default.
+ Default=false
+
+ IsFollowMouseEnabled()
+ SetFollowMouseState() => Automatic selection while moving the mouse on a menu.
+ Default=true
+
+ @seealso configuration package "org.openoffice.Office.Common/View/Menu"
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsEntryHidingEnabled() const;
+ sal_Int16 GetMenuIconsState() const;
+ void SetMenuIconsState( sal_Int16 bState );
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SVT_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtMenuOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtMenuOptions
+
+#endif // #ifndef INCLUDED_SVTOOLS_MENUOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/miscopt.hxx b/include/svtools/miscopt.hxx
new file mode 100644
index 000000000000..85c5b604e689
--- /dev/null
+++ b/include/svtools/miscopt.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_SVTOOLS_MISCOPT_HXX
+#define INCLUDED_SVTOOLS_MISCOPT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtMiscOptions_Impl;
+class Link;
+
+/*-************************************************************************************************************//**
+ @short collect information about misc group
+ @descr -
+
+ @implements -
+ @base -
+
+ @ATTENTION This class is partially threadsafe.
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class SVT_DLLPUBLIC SvtMiscOptions: public utl::detail::Options
+{
+ public:
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtMiscOptions();
+ virtual ~SvtMiscOptions();
+
+ void AddListenerLink( const Link& rLink );
+ void RemoveListenerLink( const Link& rLink );
+
+ sal_Bool UseSystemFileDialog() const;
+ void SetUseSystemFileDialog( sal_Bool bSet );
+ sal_Bool IsUseSystemFileDialogReadOnly() const;
+
+ sal_Bool DisableUICustomization() const;
+
+ sal_Bool IsPluginsEnabled() const;
+
+ sal_Int16 GetSymbolsSize() const;
+ void SetSymbolsSize( sal_Int16 eSet );
+ sal_Int16 GetCurrentSymbolsSize() const;
+ bool AreCurrentSymbolsLarge() const;
+
+ sal_Int16 GetSymbolsStyle() const;
+ void SetSymbolsStyle( sal_Int16 eSet );
+ sal_Int16 GetCurrentSymbolsStyle() const;
+
+ sal_Int16 GetToolboxStyle() const;
+ void SetToolboxStyle( sal_Int16 nStyle );
+
+ sal_Bool IsModifyByPrinting() const;
+ void SetModifyByPrinting(sal_Bool bSet );
+
+ sal_Bool UseSystemPrintDialog() const;
+ void SetUseSystemPrintDialog( sal_Bool bSet );
+
+ sal_Bool ShowLinkWarningDialog() const;
+ void SetShowLinkWarningDialog( sal_Bool bSet );
+ sal_Bool IsShowLinkWarningDialogReadOnly() const;
+
+ void SetSaveAlwaysAllowed( sal_Bool bSet );
+ sal_Bool IsSaveAlwaysAllowed() const;
+
+ void SetExperimentalMode( sal_Bool bSet );
+ sal_Bool IsExperimentalMode() const;
+
+ void SetMacroRecorderMode( sal_Bool bSet );
+ sal_Bool IsMacroRecorderMode() const;
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SVT_DLLPRIVATE static ::osl::Mutex& GetInitMutex();
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtMiscOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtMiscOptions
+
+#endif // #ifndef INCLUDED_SVTOOLS_MISCOPT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/optionsdrawinglayer.hxx b/include/svtools/optionsdrawinglayer.hxx
new file mode 100644
index 000000000000..f2d493be21de
--- /dev/null
+++ b/include/svtools/optionsdrawinglayer.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_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
+#define INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
+#include <tools/color.hxx>
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtOptionsDrawinglayer_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about startup features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class SVT_DLLPUBLIC SvtOptionsDrawinglayer
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtOptionsDrawinglayer();
+ ~SvtOptionsDrawinglayer();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Drawinglayer/..."
+ @descr These options describe internal states to enable/disable features of installed office.
+
+ IsOverlayBuffer()
+ SetOverlayBuffer() => Activate this field for letting Overlay use a buffer
+
+ IsPaintBuffer()
+ SetPaintBuffer() => Activate this field for letting Paint use a prerender buffer
+
+ GetStripeColorA()
+ SetStripeColorA() => Set first of two colors which overlay uses to draw stripes
+
+ GetStripeColorB()
+ SetStripeColorB() => Set second of two colors which overlay uses to draw stripes
+
+ GetStripeLength()
+ SetStripeLength() => Set length of a single stripe in pixels
+
+ @seealso configuration package "org.openoffice.Office.Common/Drawinglayer"
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsOverlayBuffer() const;
+ sal_Bool IsPaintBuffer() const;
+ Color GetStripeColorA() const;
+ Color GetStripeColorB() const;
+ sal_uInt16 GetStripeLength() const;
+
+ // #i73602#
+ sal_Bool IsOverlayBuffer_Calc() const;
+ sal_Bool IsOverlayBuffer_Writer() const;
+ sal_Bool IsOverlayBuffer_DrawImpress() const;
+
+ // #i74769#, #i75172#
+ sal_Bool IsPaintBuffer_Calc() const;
+ sal_Bool IsPaintBuffer_Writer() const;
+ sal_Bool IsPaintBuffer_DrawImpress() const;
+
+ // #i4219#
+ sal_uInt32 GetMaximumPaperWidth() const;
+ sal_uInt32 GetMaximumPaperHeight() const;
+ sal_uInt32 GetMaximumPaperLeftMargin() const;
+ sal_uInt32 GetMaximumPaperRightMargin() const;
+ sal_uInt32 GetMaximumPaperTopMargin() const;
+ sal_uInt32 GetMaximumPaperBottomMargin() const;
+
+ // #i95644# helper to check if AA is allowed on this system. Currently, for WIN its disabled
+ // and OutDevSupport_TransparentRect is checked (this hits XRenderExtension, e.g.
+ // currently for SunRay as long as not supported there)
+ sal_Bool IsAAPossibleOnThisSystem() const;
+
+ // primitives
+ sal_Bool IsAntiAliasing() const;
+ sal_Bool IsSnapHorVerLinesToDiscrete() const;
+ sal_Bool IsSolidDragCreate() const;
+ sal_Bool IsRenderDecoratedTextDirect() const;
+ sal_Bool IsRenderSimpleTextDirect() const;
+ sal_uInt32 GetQuadratic3DRenderLimit() const;
+ sal_uInt32 GetQuadraticFormControlRenderLimit() const;
+
+ void SetAntiAliasing( sal_Bool bState );
+
+ // #i97672# selection settings
+ sal_Bool IsTransparentSelection() const;
+ sal_uInt16 GetTransparentSelectionPercent() const;
+ sal_uInt16 GetSelectionMaximumLuminancePercent() const;
+
+ void SetTransparentSelection( sal_Bool bState );
+ void SetTransparentSelectionPercent( sal_uInt16 nPercent );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class use his own static mutex to be threadsafe.
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+ SVT_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtOptionsDrawinglayer_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtOptionsDrawinglayer
+
+#endif // #ifndef INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/parhtml.hxx b/include/svtools/parhtml.hxx
new file mode 100644
index 000000000000..9011dad9a266
--- /dev/null
+++ b/include/svtools/parhtml.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 _PARHTML_HXX
+#define _PARHTML_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <svtools/svparser.hxx>
+
+#include <boost/ptr_container/ptr_vector.hpp>
+
+namespace com { namespace sun { namespace star {
+ namespace document {
+ class XDocumentProperties;
+ }
+} } }
+
+class Color;
+class SvNumberFormatter;
+class SvKeyValueIterator;
+
+#define HTMLFONTSZ1_DFLT 7
+#define HTMLFONTSZ2_DFLT 10
+#define HTMLFONTSZ3_DFLT 12
+#define HTMLFONTSZ4_DFLT 14
+#define HTMLFONTSZ5_DFLT 18
+#define HTMLFONTSZ6_DFLT 24
+#define HTMLFONTSZ7_DFLT 36
+
+enum HTMLTableFrame { HTML_TF_VOID, HTML_TF_ABOVE, HTML_TF_BELOW,
+ HTML_TF_HSIDES, HTML_TF_LHS, HTML_TF_RHS, HTML_TF_VSIDES, HTML_TF_BOX };
+
+enum HTMLTableRules { HTML_TR_NONE, HTML_TR_GROUPS, HTML_TR_ROWS,
+ HTML_TR_COLS, HTML_TR_ALL };
+
+enum HTMLInputType
+{
+ HTML_IT_TEXT = 0x01,
+ HTML_IT_PASSWORD = 0x02,
+ HTML_IT_CHECKBOX = 0x03,
+ HTML_IT_RADIO = 0x04,
+ HTML_IT_RANGE = 0x05,
+ HTML_IT_SCRIBBLE = 0x06,
+ HTML_IT_FILE = 0x07,
+ HTML_IT_HIDDEN = 0x08,
+ HTML_IT_SUBMIT = 0x09,
+ HTML_IT_IMAGE = 0x0a,
+ HTML_IT_RESET = 0x0b,
+ HTML_IT_BUTTON = 0x0c
+};
+
+enum HTMLScriptLanguage
+{
+ HTML_SL_STARBASIC,
+ HTML_SL_JAVASCRIPT,
+ HTML_SL_UNKNOWN
+};
+
+struct HTMLOptionEnum
+{
+ const sal_Char *pName; // Wert einer HTML-Option
+ sal_uInt16 nValue; // und der dazugehoerige Wert eines Enums
+};
+
+// Repraesentation einer HTML-Option (=Atrribut in einem Start-Tag)
+// Die Werte der Optionen werden immer als String gespeichert.
+// Die Methoden GetNumber, ... duerfen nur aufgerufen werden, wenn
+// die Option auch numerisch, ... ist.
+
+class SVT_DLLPUBLIC HTMLOption
+{
+ String aValue; // der Wert der Option (immer als String)
+ String aToken; // der Name der Option als String
+ sal_uInt16 nToken; // und das entsprechende Token
+
+public:
+
+ HTMLOption( sal_uInt16 nTyp, const String& rToken, const String& rValue );
+
+ // der Name der Option ...
+ sal_uInt16 GetToken() const { return nToken; } // ... als Enum
+ const String& GetTokenString() const { return aToken; } // ... als String
+
+ // der Wert der Option ...
+ const String& GetString() const { return aValue; } // ... als String
+
+ sal_uInt32 GetNumber() const; // ... als Zahl
+ sal_Int32 GetSNumber() const; // ... als Zahl
+ void GetNumbers( std::vector<sal_uInt32> &rNumbers, // ... als Zahlen
+ bool bSpaceDelim=false ) const;
+ void GetColor( Color& ) const; // ... als Farbe
+
+ // ... als Enum pOptEnums ist ein HTMLOptionEnum-Array
+ sal_uInt16 GetEnum( const HTMLOptionEnum *pOptEnums,
+ sal_uInt16 nDflt=0 ) const;
+ bool GetEnum( sal_uInt16 &rEnum, const HTMLOptionEnum *pOptEnums ) const;
+
+ // ... und als ein par spezielle Enums
+ HTMLInputType GetInputType() const; // <INPUT TYPE=...>
+ HTMLTableFrame GetTableFrame() const; // <TABLE FRAME=...>
+ HTMLTableRules GetTableRules() const; // <TABLE RULES=...>
+ //SvxAdjust GetAdjust() const; // <P,TH,TD ALIGN=>
+};
+
+typedef ::boost::ptr_vector<HTMLOption> HTMLOptions;
+
+class SVT_DLLPUBLIC HTMLParser : public SvParser
+{
+private:
+ mutable HTMLOptions maOptions; // die Optionen des Start-Tags
+
+ bool bNewDoc : 1; // neues Doc lesen ?
+ bool bIsInHeader : 1; // scanne Header-Bereich
+ bool bIsInBody : 1; // scanne Body-Bereich
+ bool bReadListing : 1; // Lese Listings
+ bool bReadXMP : 1; // Lese XMP
+ bool bReadPRE : 1; // Lese preformatted Text
+ bool bReadTextArea : 1; // Lese TEXTAREA
+ bool bReadScript : 1; // Lesen von <SCRIPT>
+ bool bReadStyle : 1; // Lesen von <STYLE>
+ bool bEndTokenFound : 1; // </SCRIPT> oder </STYLE> gefunden
+
+ bool bPre_IgnoreNewPara : 1; // Flags fuers lesen von PRE-Absaetzen
+ bool bReadNextChar : 1; // true: NextChar nochmals lesen (JavaScript!)
+ bool bReadComment : 1; // true: NextChar nochmals lesen (JavaScript!)
+
+ sal_uInt32 nPre_LinePos; // Pos in der Line im PRE-Tag
+
+ String aEndToken;
+
+protected:
+ String sSaveToken; // das gelesene Tag als String
+
+ int ScanText( const sal_Unicode cBreak = 0U );
+
+ int _GetNextRawToken();
+
+ // scanne das naechste Token,
+ virtual int _GetNextToken();
+
+ virtual ~HTMLParser();
+
+ void FinishHeader( bool bBody ) { bIsInHeader = false; bIsInBody = bBody; }
+
+public:
+ HTMLParser( SvStream& rIn, bool bReadNewDoc = true );
+
+ virtual SvParserState CallParser(); // Aufruf des Parsers
+
+ bool IsNewDoc() const { return bNewDoc; }
+ bool IsInHeader() const { return bIsInHeader; }
+ bool IsInBody() const { return bIsInBody; }
+ bool IsValidSyntax() const { return true; }
+ bool IsReadListing() const { return bReadListing; }
+ bool IsReadXMP() const { return bReadXMP; }
+ bool IsReadPRE() const { return bReadPRE; }
+ bool IsReadScript() const { return bReadScript; }
+ bool IsReadStyle() const { return bReadStyle; }
+
+ void SetReadNextChar() { bReadNextChar = true; }
+
+ // PRE-/LISTING oder XMP-Modus starten/beenden oder Tags entsprechend
+ // filtern
+ inline void StartPRE( bool bRestart=false );
+ void FinishPRE() { bReadPRE = false; }
+ int FilterPRE( int nToken );
+
+ inline void StartListing( bool bRestart=false );
+ void FinishListing() { bReadListing = false; }
+ int FilterListing( int nToken );
+
+ inline void StartXMP( bool bRestart=false );
+ void FinishXMP() { bReadXMP = false; }
+ int FilterXMP( int nToken );
+
+ void FinishTextArea() { bReadTextArea = false; }
+
+ // PRE-/LSITING- und XMP-Modus beenden
+ void FinishPREListingXMP() { bReadPRE = bReadListing = bReadXMP = false; }
+
+ // Das aktuelle Token dem aktuellen Modus (PRE, XMP, ...) entsprechend
+ // Filtern und die Flags setzen. Wird von Continue aufgerufen, bevor
+ // NextToken gerufen wird. Wer eigene Schleifen implementiert bzw.
+ // selbst NextToken aufruft, sollte diese Methode vorher rufen.
+ int FilterToken( int nToken );
+
+ // Scannen eines Scripts beenden (sollte nur unmittelbar nach dem
+ // Lesen eines <SCRIPT> aufgerufen werden
+ void EndScanScript() { bReadScript = false; }
+
+ void ReadRawData( const sal_Char *pEndToken ) { aEndToken.AssignAscii(pEndToken); }
+
+ // Token ohne \-Sequenzen
+ void UnescapeToken();
+
+ // Ermitteln der Optionen. pNoConvertToken ist das optionale Token
+ // einer Option, fuer die CR/LFs nicht aus dem Wert der Option
+ // geloescht werden.
+ const HTMLOptions& GetOptions( sal_uInt16 *pNoConvertToken=0 ) const;
+
+ // fuers asynchrone lesen aus dem SvStream
+ virtual void Continue( int nToken );
+
+
+protected:
+
+ static rtl_TextEncoding GetEncodingByMIME( const String& rMime );
+
+ /// template method: called when ParseMetaOptions adds a user-defined meta
+ virtual void AddMetaUserDefined( OUString const & i_rMetaName );
+
+private:
+ /// parse meta options into XDocumentProperties and encoding
+ bool ParseMetaOptionsImpl( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>&,
+ SvKeyValueIterator*,
+ const HTMLOptions&,
+ rtl_TextEncoding& rEnc );
+
+public:
+ /// overriding method must call this implementation!
+ virtual bool ParseMetaOptions( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>&,
+ SvKeyValueIterator* );
+
+ // Ist der uebergebene 0-terminierte String (vermutlich) der Anfang
+ // eines HTML-Files? Er sollte mind. 80 Zeichen lang sein.
+ // Mit Ausnahme des Falls, dass SwitchToUCS2==false und
+ // SVPAR_CS_DONTKNOW uebergeben wird muss der String mit zwei(!)
+ // 0-Bytes an einer geraden(!) Position terminiert sein.
+ static bool IsHTMLFormat( const sal_Char* pHeader,
+ bool bSwitchToUCS2 = false,
+ rtl_TextEncoding eEnc=RTL_TEXTENCODING_DONTKNOW );
+
+ bool ParseScriptOptions( String& rLangString, const String&, HTMLScriptLanguage& rLang,
+ String& rSrc, String& rLibrary, String& rModule );
+
+ // Einen Kommentar um den Inhalt von <SCRIPT> oder <STYLE> entfernen
+ // Bei 'bFull' wird ggf. die gesammte Zeile hinter einem "<!--"
+ // entfernt (fuer JavaSript)
+ static void RemoveSGMLComment( String &rString, sal_Bool bFull );
+
+ static bool InternalImgToPrivateURL( String& rURL );
+ static rtl_TextEncoding GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPHeader );
+ bool SetEncodingByHTTPHeader( SvKeyValueIterator *pHTTPHeader );
+};
+
+inline void HTMLParser::StartPRE( bool bRestart )
+{
+ bReadPRE = true;
+ bPre_IgnoreNewPara = !bRestart;
+ nPre_LinePos = 0UL;
+}
+
+inline void HTMLParser::StartListing( bool bRestart )
+{
+ bReadListing = true;
+ bPre_IgnoreNewPara = !bRestart;
+ nPre_LinePos = 0UL;
+}
+
+inline void HTMLParser::StartXMP( bool bRestart )
+{
+ bReadXMP = true;
+ bPre_IgnoreNewPara = !bRestart;
+ nPre_LinePos = 0UL;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/parrtf.hxx b/include/svtools/parrtf.hxx
new file mode 100644
index 000000000000..73e1bdd42c6a
--- /dev/null
+++ b/include/svtools/parrtf.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 _PARRTF_HXX
+#define _PARRTF_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/svparser.hxx>
+#include <stack>
+
+struct RtfParserState_Impl
+{
+ rtl_TextEncoding eCodeSet;
+ sal_uInt8 nUCharOverread;
+
+ RtfParserState_Impl( sal_uInt8 nUOverread, rtl_TextEncoding eCdSt )
+ : eCodeSet( eCdSt ), nUCharOverread( nUOverread )
+ {}
+};
+
+typedef std::stack< RtfParserState_Impl > RtfParserStates_Impl;
+
+class SVT_DLLPUBLIC SvRTFParser : public SvParser
+{
+ RtfParserStates_Impl aParserStates;
+
+ int nOpenBrakets;
+ rtl_TextEncoding eCodeSet, eUNICodeSet;
+ sal_uInt8 nUCharOverread;
+
+private:
+ static short _inSkipGroup;
+
+protected:
+ sal_Unicode GetHexValue();
+ void ScanText( const sal_Unicode = 0 );
+ void SkipGroup();
+
+ // scanne das naechste Token,
+ virtual int _GetNextToken();
+
+ virtual void ReadUnknownData();
+ virtual void ReadBitmapData();
+ virtual void ReadOLEData();
+
+ virtual ~SvRTFParser();
+
+ rtl_TextEncoding GetCodeSet() const { return eCodeSet; }
+ void SetEncoding( rtl_TextEncoding eEnc );
+
+ rtl_TextEncoding GetUNICodeSet() const { return eUNICodeSet; }
+ void SetUNICodeSet( rtl_TextEncoding eSet ) { eUNICodeSet = eSet; }
+
+public:
+ SvRTFParser( SvStream& rIn, sal_uInt8 nStackSize = 3 );
+
+ virtual SvParserState CallParser(); // Aufruf des Parsers
+
+ int GetOpenBrakets() const { return nOpenBrakets; }
+
+ // fuers asynchrone lesen aus dem SvStream
+// virtual void SaveState( int nToken );
+// virtual void RestoreState();
+ virtual void Continue( int nToken );
+};
+
+#endif //_PARRTF_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/place.hxx b/include/svtools/place.hxx
new file mode 100644
index 000000000000..f6ca8cd7f7b0
--- /dev/null
+++ b/include/svtools/place.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 __SVTOOLS_PLACE_HXX__
+#define __SVTOOLS_PLACE_HXX__
+
+#include <tools/urlobj.hxx>
+
+class Place
+{
+private:
+ OUString msName;
+ INetURLObject maUrl;
+
+ bool mbEditable;
+
+public:
+
+ Place( OUString sName, OUString sUrl, bool bEditable = false ) :
+ msName( sName ),
+ maUrl( sUrl ),
+ mbEditable( bEditable ) {};
+
+ void SetName(const OUString& aName ) { msName = aName; }
+ void SetUrl(const OUString& aUrl ) { maUrl.SetURL( aUrl ); }
+
+ OUString& GetName( ) { return msName; }
+ OUString GetUrl( ) { return maUrl.GetMainURL( INetURLObject::NO_DECODE ); }
+ INetURLObject& GetUrlObject( ) { return maUrl; }
+ bool IsLocal( ) { return maUrl.GetProtocol() == INET_PROT_FILE; }
+ bool IsEditable( ) { return mbEditable; }
+};
+
+#endif // __SVTOOLS_PLACE_HXX__
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/popupmenucontrollerbase.hxx b/include/svtools/popupmenucontrollerbase.hxx
new file mode 100644
index 000000000000..daddbed7e9fd
--- /dev/null
+++ b/include/svtools/popupmenucontrollerbase.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 __SVTOOLS_POPUPMENUCONTROLLERBASE_HXX_
+#define __SVTOOLS_POPUPMENUCONTROLLERBASE_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/XPopupMenuController.hpp>
+#include <com/sun/star/uri/XUriReferenceFactory.hpp>
+#include <com/sun/star/uri/XUriReference.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+
+#include <toolkit/awt/vclxmenu.hxx>
+#include <cppuhelper/compbase7.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <cppuhelper/weak.hxx>
+#include <rtl/ustring.hxx>
+
+namespace svt
+{
+ struct PopupMenuControllerBaseDispatchInfo;
+
+ typedef ::cppu::WeakComponentImplHelper7<
+ com::sun::star::lang::XServiceInfo ,
+ com::sun::star::frame::XPopupMenuController ,
+ com::sun::star::lang::XInitialization ,
+ com::sun::star::frame::XStatusListener ,
+ com::sun::star::awt::XMenuListener ,
+ com::sun::star::frame::XDispatchProvider ,
+ com::sun::star::frame::XDispatch > PopupMenuControllerBaseType;
+
+ class SVT_DLLPUBLIC PopupMenuControllerBase : protected ::comphelper::OBaseMutex, // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public PopupMenuControllerBaseType
+ {
+ public:
+ PopupMenuControllerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
+ virtual ~PopupMenuControllerBase();
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+
+ // XPopupMenuController
+ virtual void SAL_CALL setPopupMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& PopupMenu ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updatePopupMenu() throw (::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XMenuListener
+ virtual void SAL_CALL highlight( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deactivate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XDispatchProvider
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const OUString& sTarget, sal_Int32 nFlags ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches( const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& lDescriptor ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XDispatch
+ virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& seqProperties ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL addStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, const ::com::sun::star::util::URL& aURL ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL removeStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, const ::com::sun::star::util::URL& aURL ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ void dispatchCommand( const OUString& sCommandURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
+
+ protected:
+ void throwIfDisposed() throw ( ::com::sun::star::uno::RuntimeException );
+
+ /** helper method to cause statusChanged is called once for the given command url */
+ void SAL_CALL updateCommand( const OUString& rCommandURL );
+
+ /** this function is called upon disposing the component
+ */
+ virtual void SAL_CALL disposing();
+
+ virtual void resetPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
+ virtual void impl_setPopupMenu();
+ virtual void impl_select(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aURL);
+ OUString determineBaseURL( const OUString& aURL );
+
+ DECL_STATIC_LINK( PopupMenuControllerBase, ExecuteHdl_Impl, PopupMenuControllerBaseDispatchInfo* );
+
+
+ bool m_bInitialized;
+ OUString m_aCommandURL;
+ OUString m_aBaseURL;
+ OUString m_aModuleName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xDispatch;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > m_xPopupMenu;
+ };
+}
+
+#endif // __SVTOOLS_POPUPMENUCONTROLLERBASE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/popupwindowcontroller.hxx b/include/svtools/popupwindowcontroller.hxx
new file mode 100644
index 000000000000..ec2719cebd5c
--- /dev/null
+++ b/include/svtools/popupwindowcontroller.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 __SVTOOLS_POPUPWINDOWCONTROLLER_HXX_
+#define __SVTOOLS_POPUPWINDOWCONTROLLER_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+#include "svtools/toolboxcontroller.hxx"
+#include "boost/scoped_ptr.hpp"
+
+class Window;
+
+namespace svt
+{
+class PopupWindowControllerImpl;
+
+class SVT_DLLPUBLIC PopupWindowController : public svt::ToolboxController, public ::com::sun::star::lang::XServiceInfo
+{
+public:
+ PopupWindowController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
+ const OUString& aCommandURL );
+ ~PopupWindowController();
+
+ virtual ::Window* createPopupWindow( ::Window* pParent ) = 0;
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) = 0;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
+private:
+ boost::scoped_ptr< PopupWindowControllerImpl > mpImpl;
+};
+
+} // namespace svt
+
+#endif // __SVTOOLS_POPUPWINDOWCONTROLLER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/printoptions.hxx b/include/svtools/printoptions.hxx
new file mode 100644
index 000000000000..e3e70e7750e6
--- /dev/null
+++ b/include/svtools/printoptions.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_SVTOOLS_PRINTOPTIONS_HXX
+#define INCLUDED_SVTOOLS_PRINTOPTIONS_HXX
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+class SvtPrintOptions_Impl;
+
+// -----------------------
+// - SvtBasePrintOptions -
+// -----------------------
+
+class PrinterOptions;
+
+class SVT_DLLPUBLIC SvtBasePrintOptions: public utl::detail::Options
+{
+protected:
+
+ SvtPrintOptions_Impl* m_pDataContainer;
+
+ void SetDataContainer( SvtPrintOptions_Impl* pDataContainer ) { m_pDataContainer = pDataContainer; }
+
+public:
+
+ static ::osl::Mutex& GetOwnStaticMutex();
+
+public:
+
+ SvtBasePrintOptions();
+ virtual ~SvtBasePrintOptions();
+
+ sal_Bool IsReduceTransparency() const;
+ sal_Int16 GetReducedTransparencyMode() const;
+ sal_Bool IsReduceGradients() const;
+ sal_Int16 GetReducedGradientMode() const;
+ sal_Int16 GetReducedGradientStepCount() const;
+ sal_Bool IsReduceBitmaps() const;
+ sal_Int16 GetReducedBitmapMode() const;
+ sal_Int16 GetReducedBitmapResolution() const;
+ sal_Bool IsReducedBitmapIncludesTransparency() const;
+ sal_Bool IsConvertToGreyscales() const;
+ sal_Bool IsPDFAsStandardPrintJobFormat() const;
+
+ void SetReduceTransparency( sal_Bool bState );
+ void SetReducedTransparencyMode( sal_Int16 nMode );
+ void SetReduceGradients( sal_Bool bState );
+ void SetReducedGradientMode( sal_Int16 nMode );
+ void SetReducedGradientStepCount( sal_Int16 nStepCount );
+ void SetReduceBitmaps( sal_Bool bState );
+ void SetReducedBitmapMode( sal_Int16 bState );
+ void SetReducedBitmapResolution( sal_Int16 nResolution );
+ void SetReducedBitmapIncludesTransparency( sal_Bool bState );
+ void SetConvertToGreyscales( sal_Bool bState );
+ void SetPDFAsStandardPrintJobFormat( sal_Bool bState );
+
+public:
+
+ void GetPrinterOptions( PrinterOptions& rOptions ) const;
+ void SetPrinterOptions( const PrinterOptions& rOptions );
+};
+
+// ---------------------
+// - SvtPrinterOptions -
+// ---------------------
+
+class SVT_DLLPUBLIC SvtPrinterOptions : public SvtBasePrintOptions
+{
+private:
+
+ static SvtPrintOptions_Impl* m_pStaticDataContainer; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount; /// internal ref count mechanism
+
+public:
+
+ SvtPrinterOptions();
+ virtual ~SvtPrinterOptions();
+};
+
+// -----------------------
+// - SvtPrintFileOptions -
+// -----------------------
+
+class SVT_DLLPUBLIC SvtPrintFileOptions : public SvtBasePrintOptions
+{
+private:
+
+ static SvtPrintOptions_Impl* m_pStaticDataContainer; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount; /// internal ref count mechanism
+
+public:
+
+ SvtPrintFileOptions();
+ virtual ~SvtPrintFileOptions();
+};
+
+#endif // INCLUDED_SVTOOLS_PRINTOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/prnsetup.hxx b/include/svtools/prnsetup.hxx
new file mode 100644
index 000000000000..9999fdb8846b
--- /dev/null
+++ b/include/svtools/prnsetup.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 _SV_PRNSETUP_HXX_
+#define _SV_PRNSETUP_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <vcl/dialog.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+#include <vcl/group.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/timer.hxx>
+#include <svtools/stdctrl.hxx>
+
+class Printer;
+class QueueInfo;
+
+// ----------------------
+// - PrinterSetupDialog -
+// ----------------------
+
+class SVT_DLLPUBLIC PrinterSetupDialog : public ModalDialog
+{
+private:
+ ListBox* m_pLbName;
+ PushButton* m_pBtnProperties;
+ PushButton* m_pBtnOptions;
+ FixedText* m_pFiStatus;
+ FixedText* m_pFiType;
+ FixedText* m_pFiLocation;
+ FixedText* m_pFiComment;
+ AutoTimer maStatusTimer;
+ Printer* mpPrinter;
+ Printer* mpTempPrinter;
+
+ SVT_DLLPRIVATE void ImplSetInfo();
+
+ DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplOptionsHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplStatusHdl, void* );
+
+public:
+ PrinterSetupDialog( Window* pWindow );
+ ~PrinterSetupDialog();
+
+ void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; }
+ Printer* GetPrinter() const { return mpPrinter; }
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ virtual short Execute();
+
+ void SetOptionsHdl( const Link& rLink );
+};
+
+// --------------------------------------
+// - Hilfsfunktionen fuer Print-Dialoge -
+// --------------------------------------
+
+#define IMPL_PRINTDLG_STATUS_UPDATE 15000
+
+void ImplFillPrnDlgListBox( const Printer* pPrinter,
+ ListBox* pBox, PushButton* pPropBtn );
+void ImplFreePrnDlgListBox( ListBox* pBox, sal_Bool bClear = sal_True );
+Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn,
+ Printer* pPrinter, Printer* pTempPrinter );
+Printer* ImplPrnDlgUpdatePrinter( Printer* pPrinter, Printer* pTempPrinter );
+void ImplPrnDlgUpdateQueueInfo( ListBox* pBox, QueueInfo& rInfo );
+XubString ImplPrnDlgGetStatusText( const QueueInfo& rInfo );
+
+#endif // _SV_PRNSETUP_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/restartdialog.hxx b/include/svtools/restartdialog.hxx
new file mode 100644
index 000000000000..993b0998aa0b
--- /dev/null
+++ b/include/svtools/restartdialog.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/.
+ */
+
+#ifndef INCLUDED_SVTOOLS_RESTARTDIALOG_HXX
+#define INCLUDED_SVTOOLS_RESTARTDIALOG_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "svtools/svtdllapi.h"
+
+class Window;
+namespace com { namespace sun { namespace star { namespace uno {
+ class XComponentContext;
+} } } }
+
+namespace svtools {
+
+enum RestartReason {
+ RESTART_REASON_JAVA,
+ // "For the selected Java runtime environment to work properly,
+ // %PRODUCTNAME must be restarted."
+ RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT,
+ // For the modified default print job format to take effect,
+ // %PRODUCTNAME must be restarted.
+ RESTART_REASON_BIBLIOGRAPHY_INSTALL
+ // "For the bibliography to work properly,
+ // %PRODUCTNAME must be restarted."
+};
+
+// Must be called with the solar mutex locked:
+SVT_DLLPUBLIC void executeRestartDialog(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context,
+ Window * parent, RestartReason reason);
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/roadmap.hxx b/include/svtools/roadmap.hxx
new file mode 100644
index 000000000000..d36a1a3165bb
--- /dev/null
+++ b/include/svtools/roadmap.hxx
@@ -0,0 +1,123 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVTOOLS_ROADMAP_HXX
+#define _SVTOOLS_ROADMAP_HXX
+
+#include "svtools/svtdllapi.h"
+#include <vcl/ctrl.hxx>
+#include <vcl/imgctrl.hxx>
+
+#include "svtools/hyperlabel.hxx"
+
+
+
+
+class Bitmap;
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ struct RoadmapTypes
+ {
+ public:
+ typedef sal_Int16 ItemId;
+ typedef sal_Int32 ItemIndex;
+ };
+
+ class RoadmapImpl;
+ class RoadmapItem;
+
+ //=====================================================================
+ //= Roadmap
+ //=====================================================================
+ class SVT_DLLPUBLIC ORoadmap : public Control, public RoadmapTypes
+ {
+ protected:
+ RoadmapImpl* m_pImpl;
+ // Window overridables
+ void Paint( const Rectangle& _rRect );
+ void implInit();
+
+ public:
+ ORoadmap( Window* _pParent, WinBits _nWinStyle = 0 );
+ ~ORoadmap( );
+
+ void SetRoadmapBitmap( const BitmapEx& maBitmap, sal_Bool _bInvalidate = sal_True );
+
+ void EnableRoadmapItem( ItemId _nItemId, sal_Bool _bEnable, ItemIndex _nStartIndex = 0 );
+
+ void ChangeRoadmapItemLabel( ItemId _nID, const OUString& sLabel, ItemIndex _nStartIndex = 0 );
+ void ChangeRoadmapItemID( ItemId _nID, ItemId _NewID, ItemIndex _nStartIndex = 0 );
+
+ void SetRoadmapInteractive( sal_Bool _bInteractive );
+ sal_Bool IsRoadmapInteractive();
+
+ void SetRoadmapComplete( sal_Bool _bComplete );
+ sal_Bool IsRoadmapComplete() const;
+
+ ItemIndex GetItemCount() const;
+ ItemId GetItemID( ItemIndex _nIndex ) const;
+
+ void InsertRoadmapItem( ItemIndex _Index, const OUString& _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled = sal_True );
+ void ReplaceRoadmapItem( ItemIndex _Index, const OUString& _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled );
+ void DeleteRoadmapItem( ItemIndex _nIndex );
+
+ ItemId GetCurrentRoadmapItemID() const;
+ sal_Bool SelectRoadmapItemByID( ItemId _nItemID );
+
+ void SetItemSelectHdl( const Link& _rHdl );
+ Link GetItemSelectHdl( ) const;
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void GetFocus();
+
+
+ protected:
+ long PreNotify( NotifyEvent& rNEvt );
+
+ protected:
+ /// called when an item has been selected by any means
+ virtual void Select();
+
+ private:
+ DECL_LINK(ImplClickHdl, HyperLabel*);
+
+ RoadmapItem* GetByIndex( ItemIndex _nItemIndex );
+ const RoadmapItem* GetByIndex( ItemIndex _nItemIndex ) const;
+
+ RoadmapItem* GetByID( ItemId _nID, ItemIndex _nStartIndex = 0 );
+ const RoadmapItem* GetByID( ItemId _nID, ItemIndex _nStartIndex = 0 ) const;
+ RoadmapItem* GetPreviousHyperLabel( ItemIndex _Index);
+
+ void DrawHeadline();
+ void DeselectOldRoadmapItems();
+ ItemId GetNextAvailableItemId( ItemIndex _NewIndex );
+ ItemId GetPreviousAvailableItemId( ItemIndex _NewIndex );
+ RoadmapItem* GetByPointer(Window* pWindow);
+ RoadmapItem* InsertHyperLabel( ItemIndex _Index, const OUString& _aStr, ItemId _RMID, sal_Bool _bEnabled = sal_True );
+ void UpdatefollowingHyperLabels( ItemIndex _Index );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/roadmapwizard.hxx b/include/svtools/roadmapwizard.hxx
new file mode 100644
index 000000000000..aae7ebfc5d7b
--- /dev/null
+++ b/include/svtools/roadmapwizard.hxx
@@ -0,0 +1,246 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVTOOLS_INC_ROADMAPWIZARD_HXX
+#define SVTOOLS_INC_ROADMAPWIZARD_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/wizardmachine.hxx>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ struct RoadmapWizardImpl;
+ class RoadmapWizard;
+
+ struct RoadmapWizardTypes
+ {
+ public:
+ typedef sal_Int16 PathId;
+ typedef ::std::vector< WizardTypes::WizardState > WizardPath;
+ typedef TabPage* (* RoadmapPageFactory)( RoadmapWizard& );
+ };
+
+ //====================================================================
+ //= RoadmapWizard
+ //====================================================================
+ /** is - no, not a wizard for a raodmap, but the base class for wizards
+ <em>supporting</em> a roadmap.
+
+ The basic new concept introduced is a <em>path</em>:<br/>
+ A <em>path</em> is a sequence of states, which are to be executed in a linear order.
+ Elements in the path can be skipped, depending on choices the user makes.
+
+ In the most simple wizards, you will have only one path consisting of <code>n</code> elements,
+ which are to be visited successively.
+
+ In a slightly more complex wizard, you will have one linear path, were certain
+ steps might be skipped due to user input. For instance, the user may decide to not specify
+ certain aspects of the to-be-created object (e.g. by unchecking a check box),
+ and the wizard then will simply disable the step which corresponds to this step.
+
+ In a yet more advanced wizards, you will have several paths of length <code>n1</code> and
+ <code>n2</code>, which share at least the first <code>k</code> states (where <code>k</code>
+ is at least 1), and an arbitrary number of other states.
+ */
+ class SVT_DLLPUBLIC RoadmapWizard : public OWizardMachine, public RoadmapWizardTypes
+ {
+ private:
+ RoadmapWizardImpl* m_pImpl;
+
+ public:
+ RoadmapWizard(
+ Window* _pParent,
+ const ResId& _rRes,
+ sal_uInt32 _nButtonFlags = WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP
+ );
+ RoadmapWizard(
+ Window* _pParent,
+ const WinBits i_nStyle,
+ sal_uInt32 _nButtonFlags = WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP
+ );
+ ~RoadmapWizard( );
+
+ void SetRoadmapHelpId( const OString& _rId );
+
+ void SetRoadmapInteractive( sal_Bool _bInteractive );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+
+ // returns whether a given state is enabled
+ bool isStateEnabled( WizardState _nState ) const;
+
+ // WizardDialog overridables
+ virtual bool canAdvance() const;
+ virtual void updateTravelUI();
+
+protected:
+ /** declares a valid path in the wizard
+
+ The very first path which is declared is automatically activated.
+
+ Note that all paths which are declared must have the very first state in
+ common. Also note that due to a restriction of the very base class (<type>WizardDialog</type>),
+ this common first state must be 0.
+
+ You cannot declare new paths once the wizard started, so it's recommended that
+ you do all declarations within your derivee's constructor.
+
+ @see activatePath
+
+ @param _nId
+ the unique id you wish to give this path. This id can later on be used
+ to refer to the path which you just declared
+
+ @param _nFirstState
+ the first state in this path. Must not be WZS_INVALID_STATE.<br/>
+ Declare an arbitrary number of states after this one, and terminate the sequence
+ with a WZS_INVALID_STATE.
+ */
+ void declarePath( PathId _nPathId, WizardState _nFirstState, ... );
+ void declarePath( PathId _nPathId, const WizardPath& _lWizardStates);
+
+ /** provides basic information about a state
+
+ The given display name is used in the default implementation of getStateDisplayName,
+ and the given factory is used in the default implementation of createPage.
+ */
+ void describeState( WizardState _nState, const String& _rStateDisplayName, RoadmapPageFactory _pPageFactory );
+
+ /** activates a path which has previously been declared with <member>declarePath</member>
+
+ You can only activate paths which share the first <code>k</code> states with the path
+ which is previously active (if any), where <code>k</code> is the index of the
+ current state within the current path.
+
+ <example>
+ Say you have paths, <code>(0,1,2,5)</code> and <code>(0,1,4,5)</code>. This means that after
+ step <code>1</code>, you either continue with state <code>2</code> or state <code>4</code>,
+ and after this, you finish in state <code>5</code>.<br/>
+ Now if the first path is active, and your current state is <code>1</code>, then you can
+ easily switch to the second path, since both paths start with <code>(0,1)</code>.<br/>
+ However, if your current state is <code>2</code>, then you can not switch to the second
+ path anymore.
+ </example>
+
+ @param _nPathId
+ the id of the path. The path must have been declared (under this id) with
+ <member>declarePath</member> before it can be activated.
+
+ @param _bDecideForIt
+ If <TRUE/>, the path will be completely activated, even if it is a conflicting path
+ (i.e. there is another path which shares the first <code>k</code> states with
+ the to-be-activated path.)<br/>
+ If <FALSE/>, then the new path is checked for conflicts with other paths. If such
+ conflicts exists, the path is not completely activated, but only up to the point
+ where it does <em>not</em> conflict.<br/>
+ With the paths in the example above, if you activate the second path (when both are
+ already declared), then only steps <code>0</code> and <code>1</code> are activated,
+ since they are common to both paths.
+ */
+ void activatePath( PathId _nPathId, bool _bDecideForIt = false );
+
+ /** determine the next state to travel from the given one
+
+ This method (which is declared in <type>OWizardMachine</type> and overwritten here)
+ ensures that traveling happens along the active path.
+
+ @see activatePath
+ */
+ virtual WizardState determineNextState( WizardState _nCurrentState ) const;
+
+ /** en- or disables a state
+
+ In the wizard's roadmap, states to travel to can be freely chosen. To prevent
+ users from selecting a state which is currently not available, you can declare this
+ state as being disabled.
+
+ A situation where you need this may be when you have a checkbox which, when checked
+ by the user, enables a page with additional settings. As long as this checkbox is
+ not checked, the respective state would be disabled.
+
+ Note that in theory, you can declare multiple paths, instead of disabling states.
+ For instance, if you have a path where one state can be potentially disabled, then
+ you could declare a second path, which does not contain this state. However, the
+ disadvantage is that then, not the complete path would be visible in the roadmap,
+ but only all steps up to the point where the both paths diverge.<br/>
+ Another disadvantage is that the number of needed paths grows exponentially with
+ the number of states which can be potentially disabled.
+
+ @see declarePath
+ */
+ void enableState( WizardState _nState, bool _bEnable = true );
+
+ /** returns true if and only if the given state is known in at least one declared path
+ */
+ bool knowsState( WizardState _nState ) const;
+
+ // OWizardMachine overriables
+ virtual void enterState( WizardState _nState );
+
+ /** returns a human readable name for a given state
+
+ There is a default implementation for this method, which returns the display name
+ as given in a call to describeState. If there is no description for the given state,
+ this is worth an assertion in a non-product build, and then an empty string is
+ returned.
+ */
+ virtual String getStateDisplayName( WizardState _nState ) const;
+
+ /** creates a page for a given state
+
+ This member is inherited from OWizardMachine, and default-implemented in this class
+ for all states which have been described using describeState.
+ */
+ virtual TabPage* createPage( WizardState _nState );
+
+ /** asks for a new label of the wizard page
+
+ */
+ void updateRoadmapItemLabel( WizardState _nState );
+
+ protected:
+#ifdef DBG_UTIL
+ const sal_Char* checkInvariants() const;
+ friend const char* CheckInvariants( const void* pVoid );
+#endif
+
+ private:
+ SVT_DLLPRIVATE void ResizeFixedLine();
+
+ DECL_DLLPRIVATE_LINK( OnRoadmapItemSelected, void* );
+
+ /** updates the roadmap control to show the given path, as far as possible
+ (modulo conflicts with other paths)
+ */
+ SVT_DLLPRIVATE void implUpdateRoadmap( );
+
+ private:
+ SVT_DLLPRIVATE void impl_construct();
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // OOO_SVTOOLS_INC_ROADMAPWIZARD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/rtfkeywd.hxx b/include/svtools/rtfkeywd.hxx
new file mode 100644
index 000000000000..cf4e908a696c
--- /dev/null
+++ b/include/svtools/rtfkeywd.hxx
@@ -0,0 +1,1212 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _RTFKEYWD_HXX
+#define _RTFKEYWD_HXX
+
+#include "sal/config.h"
+
+#define OOO_STRING_SVTOOLS_RTF_HEXCHAR "\\'"
+#define OOO_STRING_SVTOOLS_RTF_IGNORE "\\*"
+#define OOO_STRING_SVTOOLS_RTF_OPTHYPH "\\-"
+#define OOO_STRING_SVTOOLS_RTF_SUBENTRY "\\:"
+#define OOO_STRING_SVTOOLS_RTF_ABSH "\\absh"
+#define OOO_STRING_SVTOOLS_RTF_ABSW "\\absw"
+#define OOO_STRING_SVTOOLS_RTF_ALT "\\alt"
+#define OOO_STRING_SVTOOLS_RTF_ANNOTATION "\\annotation"
+#define OOO_STRING_SVTOOLS_RTF_ANSI "\\ansi"
+#define OOO_STRING_SVTOOLS_RTF_ATNDATE "\\atndate"
+#define OOO_STRING_SVTOOLS_RTF_ATNID "\\atnid"
+#define OOO_STRING_SVTOOLS_RTF_AUTHOR "\\author"
+#define OOO_STRING_SVTOOLS_RTF_B "\\b"
+#define OOO_STRING_SVTOOLS_RTF_BGBDIAG "\\bgbdiag"
+#define OOO_STRING_SVTOOLS_RTF_BGCROSS "\\bgcross"
+#define OOO_STRING_SVTOOLS_RTF_BGDCROSS "\\bgdcross"
+#define OOO_STRING_SVTOOLS_RTF_BGDKBDIAG "\\bgdkbdiag"
+#define OOO_STRING_SVTOOLS_RTF_BGDKCROSS "\\bgdkcross"
+#define OOO_STRING_SVTOOLS_RTF_BGDKDCROSS "\\bgdkdcross"
+#define OOO_STRING_SVTOOLS_RTF_BGDKFDIAG "\\bgdkfdiag"
+#define OOO_STRING_SVTOOLS_RTF_BGDKHORIZ "\\bgdkhoriz"
+#define OOO_STRING_SVTOOLS_RTF_BGDKVERT "\\bgdkvert"
+#define OOO_STRING_SVTOOLS_RTF_BGFDIAG "\\bgfdiag"
+#define OOO_STRING_SVTOOLS_RTF_BGHORIZ "\\bghoriz"
+#define OOO_STRING_SVTOOLS_RTF_BGVERT "\\bgvert"
+#define OOO_STRING_SVTOOLS_RTF_BIN "\\bin"
+#define OOO_STRING_SVTOOLS_RTF_BINFSXN "\\binfsxn"
+#define OOO_STRING_SVTOOLS_RTF_BINSXN "\\binsxn"
+#define OOO_STRING_SVTOOLS_RTF_BKMKCOLF "\\bkmkcolf"
+#define OOO_STRING_SVTOOLS_RTF_BKMKCOLL "\\bkmkcoll"
+#define OOO_STRING_SVTOOLS_RTF_BKMKEND "\\bkmkend"
+#define OOO_STRING_SVTOOLS_RTF_BKMKSTART "\\bkmkstart"
+#define OOO_STRING_SVTOOLS_RTF_BLUE "\\blue"
+#define OOO_STRING_SVTOOLS_RTF_BOX "\\box"
+#define OOO_STRING_SVTOOLS_RTF_BRDRB "\\brdrb"
+#define OOO_STRING_SVTOOLS_RTF_BRDRBAR "\\brdrbar"
+#define OOO_STRING_SVTOOLS_RTF_BRDRBTW "\\brdrbtw"
+#define OOO_STRING_SVTOOLS_RTF_BRDRCF "\\brdrcf"
+#define OOO_STRING_SVTOOLS_RTF_BRDRDB "\\brdrdb"
+#define OOO_STRING_SVTOOLS_RTF_BRDRDOT "\\brdrdot"
+#define OOO_STRING_SVTOOLS_RTF_BRDRDASH "\\brdrdash"
+#define OOO_STRING_SVTOOLS_RTF_BRDRDASHSM "\\brdrdashsm"
+#define OOO_STRING_SVTOOLS_RTF_BRDRHAIR "\\brdrhair"
+#define OOO_STRING_SVTOOLS_RTF_BRDRL "\\brdrl"
+#define OOO_STRING_SVTOOLS_RTF_BRDRR "\\brdrr"
+#define OOO_STRING_SVTOOLS_RTF_BRDRS "\\brdrs"
+#define OOO_STRING_SVTOOLS_RTF_BRDRSH "\\brdrsh"
+#define OOO_STRING_SVTOOLS_RTF_BRDRT "\\brdrt"
+#define OOO_STRING_SVTOOLS_RTF_BRDRTH "\\brdrth"
+#define OOO_STRING_SVTOOLS_RTF_BRDRW "\\brdrw"
+#define OOO_STRING_SVTOOLS_RTF_BRSP "\\brsp"
+#define OOO_STRING_SVTOOLS_RTF_BULLET "\\bullet"
+#define OOO_STRING_SVTOOLS_RTF_BUPTIM "\\buptim"
+#define OOO_STRING_SVTOOLS_RTF_BXE "\\bxe"
+#define OOO_STRING_SVTOOLS_RTF_CAPS "\\caps"
+#define OOO_STRING_SVTOOLS_RTF_CB "\\cb"
+#define OOO_STRING_SVTOOLS_RTF_CBPAT "\\cbpat"
+#define OOO_STRING_SVTOOLS_RTF_CELL "\\cell"
+#define OOO_STRING_SVTOOLS_RTF_CELLX "\\cellx"
+#define OOO_STRING_SVTOOLS_RTF_CF "\\cf"
+#define OOO_STRING_SVTOOLS_RTF_CFPAT "\\cfpat"
+#define OOO_STRING_SVTOOLS_RTF_CHATN "\\chatn"
+#define OOO_STRING_SVTOOLS_RTF_CHDATE "\\chdate"
+#define OOO_STRING_SVTOOLS_RTF_CHDPA "\\chdpa"
+#define OOO_STRING_SVTOOLS_RTF_CHDPL "\\chdpl"
+#define OOO_STRING_SVTOOLS_RTF_CHFTN "\\chftn"
+#define OOO_STRING_SVTOOLS_RTF_CHFTNSEP "\\chftnsep"
+#define OOO_STRING_SVTOOLS_RTF_CHFTNSEPC "\\chftnsepc"
+#define OOO_STRING_SVTOOLS_RTF_CHPGN "\\chpgn"
+#define OOO_STRING_SVTOOLS_RTF_CHTIME "\\chtime"
+#define OOO_STRING_SVTOOLS_RTF_CLBGBDIAG "\\clbgbdiag"
+#define OOO_STRING_SVTOOLS_RTF_CLBGCROSS "\\clbgcross"
+#define OOO_STRING_SVTOOLS_RTF_CLBGDCROSS "\\clbgdcross"
+#define OOO_STRING_SVTOOLS_RTF_CLBGDKBDIAG "\\clbgdkbdiag"
+#define OOO_STRING_SVTOOLS_RTF_CLBGDKCROSS "\\clbgdkcross"
+#define OOO_STRING_SVTOOLS_RTF_CLBGDKDCROSS "\\clbgdkdcross"
+#define OOO_STRING_SVTOOLS_RTF_CLBGDKFDIAG "\\clbgdkfdiag"
+#define OOO_STRING_SVTOOLS_RTF_CLBGDKHOR "\\clbgdkhor"
+#define OOO_STRING_SVTOOLS_RTF_CLBGDKVERT "\\clbgdkvert"
+#define OOO_STRING_SVTOOLS_RTF_CLBGFDIAG "\\clbgfdiag"
+#define OOO_STRING_SVTOOLS_RTF_CLBGHORIZ "\\clbghoriz"
+#define OOO_STRING_SVTOOLS_RTF_CLBGVERT "\\clbgvert"
+#define OOO_STRING_SVTOOLS_RTF_CLBRDRB "\\clbrdrb"
+#define OOO_STRING_SVTOOLS_RTF_CLBRDRL "\\clbrdrl"
+#define OOO_STRING_SVTOOLS_RTF_CLBRDRR "\\clbrdrr"
+#define OOO_STRING_SVTOOLS_RTF_CLBRDRT "\\clbrdrt"
+#define OOO_STRING_SVTOOLS_RTF_CLCBPAT "\\clcbpat"
+#define OOO_STRING_SVTOOLS_RTF_CLCFPAT "\\clcfpat"
+#define OOO_STRING_SVTOOLS_RTF_CLMGF "\\clmgf"
+#define OOO_STRING_SVTOOLS_RTF_CLMRG "\\clmrg"
+#define OOO_STRING_SVTOOLS_RTF_CLSHDNG "\\clshdng"
+#define OOO_STRING_SVTOOLS_RTF_COLNO "\\colno"
+#define OOO_STRING_SVTOOLS_RTF_COLORTBL "\\colortbl"
+#define OOO_STRING_SVTOOLS_RTF_COLS "\\cols"
+#define OOO_STRING_SVTOOLS_RTF_COLSR "\\colsr"
+#define OOO_STRING_SVTOOLS_RTF_COLSX "\\colsx"
+#define OOO_STRING_SVTOOLS_RTF_COLUMN "\\column"
+#define OOO_STRING_SVTOOLS_RTF_COLW "\\colw"
+#define OOO_STRING_SVTOOLS_RTF_COMMENT "\\comment"
+#define OOO_STRING_SVTOOLS_RTF_CONTEXTUALSPACE "\\contextualspace"
+#define OOO_STRING_SVTOOLS_RTF_CREATIM "\\creatim"
+#define OOO_STRING_SVTOOLS_RTF_CTRL "\\ctrl"
+#define OOO_STRING_SVTOOLS_RTF_DEFF "\\deff"
+#define OOO_STRING_SVTOOLS_RTF_DEFFORMAT "\\defformat"
+#define OOO_STRING_SVTOOLS_RTF_DEFLANG "\\deflang"
+#define OOO_STRING_SVTOOLS_RTF_DEFTAB "\\deftab"
+#define OOO_STRING_SVTOOLS_RTF_DELETED "\\deleted"
+#define OOO_STRING_SVTOOLS_RTF_DFRMTXTX "\\dfrmtxtx"
+#define OOO_STRING_SVTOOLS_RTF_DFRMTXTY "\\dfrmtxty"
+#define OOO_STRING_SVTOOLS_RTF_DIBITMAP "\\dibitmap"
+#define OOO_STRING_SVTOOLS_RTF_DN "\\dn"
+#define OOO_STRING_SVTOOLS_RTF_DOCCOMM "\\doccomm"
+#define OOO_STRING_SVTOOLS_RTF_DOCTEMP "\\doctemp"
+#define OOO_STRING_SVTOOLS_RTF_DROPCAPLI "\\dropcapli"
+#define OOO_STRING_SVTOOLS_RTF_DROPCAPT "\\dropcapt"
+#define OOO_STRING_SVTOOLS_RTF_ABSNOOVRLP "\\absnoovrlp"
+#define OOO_STRING_SVTOOLS_RTF_DXFRTEXT "\\dxfrtext"
+#define OOO_STRING_SVTOOLS_RTF_DY "\\dy"
+#define OOO_STRING_SVTOOLS_RTF_EDMINS "\\edmins"
+#define OOO_STRING_SVTOOLS_RTF_EMDASH "\\emdash"
+#define OOO_STRING_SVTOOLS_RTF_ENDASH "\\endash"
+#define OOO_STRING_SVTOOLS_RTF_ENDDOC "\\enddoc"
+#define OOO_STRING_SVTOOLS_RTF_ENDNHERE "\\endnhere"
+#define OOO_STRING_SVTOOLS_RTF_ENDNOTES "\\endnotes"
+#define OOO_STRING_SVTOOLS_RTF_EXPND "\\expnd"
+#define OOO_STRING_SVTOOLS_RTF_EXPNDTW "\\expndtw"
+#define OOO_STRING_SVTOOLS_RTF_F "\\f"
+#define OOO_STRING_SVTOOLS_RTF_FACINGP "\\facingp"
+#define OOO_STRING_SVTOOLS_RTF_FACPGSXN "\\facpgsxn"
+#define OOO_STRING_SVTOOLS_RTF_FALT "\\falt"
+#define OOO_STRING_SVTOOLS_RTF_FCHARSET "\\fcharset"
+#define OOO_STRING_SVTOOLS_RTF_FDECOR "\\fdecor"
+#define OOO_STRING_SVTOOLS_RTF_FI "\\fi"
+#define OOO_STRING_SVTOOLS_RTF_FIELD "\\field"
+#define OOO_STRING_SVTOOLS_RTF_FLDDIRTY "\\flddirty"
+#define OOO_STRING_SVTOOLS_RTF_FLDEDIT "\\fldedit"
+#define OOO_STRING_SVTOOLS_RTF_FLDINST "\\fldinst"
+#define OOO_STRING_SVTOOLS_RTF_FLDLOCK "\\fldlock"
+#define OOO_STRING_SVTOOLS_RTF_FLDPRIV "\\fldpriv"
+#define OOO_STRING_SVTOOLS_RTF_FLDRSLT "\\fldrslt"
+#define OOO_STRING_SVTOOLS_RTF_FMODERN "\\fmodern"
+#define OOO_STRING_SVTOOLS_RTF_FN "\\fn"
+#define OOO_STRING_SVTOOLS_RTF_FNIL "\\fnil"
+#define OOO_STRING_SVTOOLS_RTF_FONTTBL "\\fonttbl"
+#define OOO_STRING_SVTOOLS_RTF_FOOTER "\\footer"
+#define OOO_STRING_SVTOOLS_RTF_FOOTERF "\\footerf"
+#define OOO_STRING_SVTOOLS_RTF_FOOTERL "\\footerl"
+#define OOO_STRING_SVTOOLS_RTF_FOOTERR "\\footerr"
+#define OOO_STRING_SVTOOLS_RTF_FOOTERY "\\footery"
+#define OOO_STRING_SVTOOLS_RTF_FOOTNOTE "\\footnote"
+#define OOO_STRING_SVTOOLS_RTF_FPRQ "\\fprq"
+#define OOO_STRING_SVTOOLS_RTF_FRACWIDTH "\\fracwidth"
+#define OOO_STRING_SVTOOLS_RTF_FROMAN "\\froman"
+#define OOO_STRING_SVTOOLS_RTF_FS "\\fs"
+#define OOO_STRING_SVTOOLS_RTF_FSCRIPT "\\fscript"
+#define OOO_STRING_SVTOOLS_RTF_FSWISS "\\fswiss"
+#define OOO_STRING_SVTOOLS_RTF_FTECH "\\ftech"
+#define OOO_STRING_SVTOOLS_RTF_FTNBJ "\\ftnbj"
+#define OOO_STRING_SVTOOLS_RTF_FTNCN "\\ftncn"
+#define OOO_STRING_SVTOOLS_RTF_FTNRESTART "\\ftnrestart"
+#define OOO_STRING_SVTOOLS_RTF_FTNSEP "\\ftnsep"
+#define OOO_STRING_SVTOOLS_RTF_FTNSEPC "\\ftnsepc"
+#define OOO_STRING_SVTOOLS_RTF_FTNSTART "\\ftnstart"
+#define OOO_STRING_SVTOOLS_RTF_FTNTJ "\\ftntj"
+#define OOO_STRING_SVTOOLS_RTF_GREEN "\\green"
+#define OOO_STRING_SVTOOLS_RTF_GUTTER "\\gutter"
+#define OOO_STRING_SVTOOLS_RTF_GUTTERSXN "\\guttersxn"
+#define OOO_STRING_SVTOOLS_RTF_HEADER "\\header"
+#define OOO_STRING_SVTOOLS_RTF_HEADERF "\\headerf"
+#define OOO_STRING_SVTOOLS_RTF_HEADERL "\\headerl"
+#define OOO_STRING_SVTOOLS_RTF_HEADERR "\\headerr"
+#define OOO_STRING_SVTOOLS_RTF_HEADERY "\\headery"
+#define OOO_STRING_SVTOOLS_RTF_HR "\\hr"
+#define OOO_STRING_SVTOOLS_RTF_HYPHHOTZ "\\hyphhotz"
+#define OOO_STRING_SVTOOLS_RTF_I "\\i"
+#define OOO_STRING_SVTOOLS_RTF_ID "\\id"
+#define OOO_STRING_SVTOOLS_RTF_INFO "\\info"
+#define OOO_STRING_SVTOOLS_RTF_INTBL "\\intbl"
+#define OOO_STRING_SVTOOLS_RTF_IXE "\\ixe"
+#define OOO_STRING_SVTOOLS_RTF_KEEP "\\keep"
+#define OOO_STRING_SVTOOLS_RTF_KEEPN "\\keepn"
+#define OOO_STRING_SVTOOLS_RTF_KERNING "\\kerning"
+#define OOO_STRING_SVTOOLS_RTF_KEYCODE "\\keycode"
+#define OOO_STRING_SVTOOLS_RTF_KEYWORDS "\\keywords"
+#define OOO_STRING_SVTOOLS_RTF_LANDSCAPE "\\landscape"
+#define OOO_STRING_SVTOOLS_RTF_LANG "\\lang"
+#define OOO_STRING_SVTOOLS_RTF_LDBLQUOTE "\\ldblquote"
+#define OOO_STRING_SVTOOLS_RTF_LEVEL "\\level"
+#define OOO_STRING_SVTOOLS_RTF_LI "\\li"
+#define OOO_STRING_SVTOOLS_RTF_LIN "\\lin"
+#define OOO_STRING_SVTOOLS_RTF_LINE "\\line"
+#define OOO_STRING_SVTOOLS_RTF_LINEBETCOL "\\linebetcol"
+#define OOO_STRING_SVTOOLS_RTF_LINECONT "\\linecont"
+#define OOO_STRING_SVTOOLS_RTF_LINEMOD "\\linemod"
+#define OOO_STRING_SVTOOLS_RTF_LINEPPAGE "\\lineppage"
+#define OOO_STRING_SVTOOLS_RTF_LINERESTART "\\linerestart"
+#define OOO_STRING_SVTOOLS_RTF_LINESTART "\\linestart"
+#define OOO_STRING_SVTOOLS_RTF_LINESTARTS "\\linestarts"
+#define OOO_STRING_SVTOOLS_RTF_LINEX "\\linex"
+#define OOO_STRING_SVTOOLS_RTF_LNDSCPSXN "\\lndscpsxn"
+#define OOO_STRING_SVTOOLS_RTF_LQUOTE "\\lquote"
+#define OOO_STRING_SVTOOLS_RTF_MAC "\\mac"
+#define OOO_STRING_SVTOOLS_RTF_MACPICT "\\macpict"
+#define OOO_STRING_SVTOOLS_RTF_MAKEBACKUP "\\makebackup"
+#define OOO_STRING_SVTOOLS_RTF_MARGB "\\margb"
+#define OOO_STRING_SVTOOLS_RTF_MARGBSXN "\\margbsxn"
+#define OOO_STRING_SVTOOLS_RTF_MARGL "\\margl"
+#define OOO_STRING_SVTOOLS_RTF_MARGLSXN "\\marglsxn"
+#define OOO_STRING_SVTOOLS_RTF_MARGMIRROR "\\margmirror"
+#define OOO_STRING_SVTOOLS_RTF_MARGR "\\margr"
+#define OOO_STRING_SVTOOLS_RTF_MARGRSXN "\\margrsxn"
+#define OOO_STRING_SVTOOLS_RTF_MARGT "\\margt"
+#define OOO_STRING_SVTOOLS_RTF_MARGTSXN "\\margtsxn"
+#define OOO_STRING_SVTOOLS_RTF_MIN "\\min"
+#define OOO_STRING_SVTOOLS_RTF_MO "\\mo"
+#define OOO_STRING_SVTOOLS_RTF_NEXTCSET "\\nextcset"
+#define OOO_STRING_SVTOOLS_RTF_NEXTFILE "\\nextfile"
+#define OOO_STRING_SVTOOLS_RTF_NOFCHARS "\\nofchars"
+#define OOO_STRING_SVTOOLS_RTF_NOFPAGES "\\nofpages"
+#define OOO_STRING_SVTOOLS_RTF_NOFWORDS "\\nofwords"
+#define OOO_STRING_SVTOOLS_RTF_NOLINE "\\noline"
+#define OOO_STRING_SVTOOLS_RTF_NOSUPERSUB "\\nosupersub"
+#define OOO_STRING_SVTOOLS_RTF_NOWRAP "\\nowrap"
+#define OOO_STRING_SVTOOLS_RTF_OPERATOR "\\operator"
+#define OOO_STRING_SVTOOLS_RTF_OUTL "\\outl"
+#define OOO_STRING_SVTOOLS_RTF_PAGE "\\page"
+#define OOO_STRING_SVTOOLS_RTF_PAGEBB "\\pagebb"
+#define OOO_STRING_SVTOOLS_RTF_PAPERH "\\paperh"
+#define OOO_STRING_SVTOOLS_RTF_PAPERW "\\paperw"
+#define OOO_STRING_SVTOOLS_RTF_PAR "\\par"
+#define OOO_STRING_SVTOOLS_RTF_PARD "\\pard"
+#define OOO_STRING_SVTOOLS_RTF_PC "\\pc"
+#define OOO_STRING_SVTOOLS_RTF_PCA "\\pca"
+#define OOO_STRING_SVTOOLS_RTF_PGHSXN "\\pghsxn"
+#define OOO_STRING_SVTOOLS_RTF_PGNCONT "\\pgncont"
+#define OOO_STRING_SVTOOLS_RTF_PGNDEC "\\pgndec"
+#define OOO_STRING_SVTOOLS_RTF_PGNLCLTR "\\pgnlcltr"
+#define OOO_STRING_SVTOOLS_RTF_PGNLCRM "\\pgnlcrm"
+#define OOO_STRING_SVTOOLS_RTF_PGNRESTART "\\pgnrestart"
+#define OOO_STRING_SVTOOLS_RTF_PGNSTART "\\pgnstart"
+#define OOO_STRING_SVTOOLS_RTF_PGNSTARTS "\\pgnstarts"
+#define OOO_STRING_SVTOOLS_RTF_PGNUCLTR "\\pgnucltr"
+#define OOO_STRING_SVTOOLS_RTF_PGNUCRM "\\pgnucrm"
+#define OOO_STRING_SVTOOLS_RTF_PGNX "\\pgnx"
+#define OOO_STRING_SVTOOLS_RTF_PGNY "\\pgny"
+#define OOO_STRING_SVTOOLS_RTF_PGWSXN "\\pgwsxn"
+#define OOO_STRING_SVTOOLS_RTF_PHCOL "\\phcol"
+#define OOO_STRING_SVTOOLS_RTF_PHMRG "\\phmrg"
+#define OOO_STRING_SVTOOLS_RTF_PHPG "\\phpg"
+#define OOO_STRING_SVTOOLS_RTF_PICCROPB "\\piccropb"
+#define OOO_STRING_SVTOOLS_RTF_PICCROPL "\\piccropl"
+#define OOO_STRING_SVTOOLS_RTF_PICCROPR "\\piccropr"
+#define OOO_STRING_SVTOOLS_RTF_PICCROPT "\\piccropt"
+#define OOO_STRING_SVTOOLS_RTF_PICH "\\pich"
+#define OOO_STRING_SVTOOLS_RTF_PICHGOAL "\\pichgoal"
+#define OOO_STRING_SVTOOLS_RTF_PICSCALED "\\picscaled"
+#define OOO_STRING_SVTOOLS_RTF_PICSCALEX "\\picscalex"
+#define OOO_STRING_SVTOOLS_RTF_PICSCALEY "\\picscaley"
+#define OOO_STRING_SVTOOLS_RTF_PICT "\\pict"
+#define OOO_STRING_SVTOOLS_RTF_PICW "\\picw"
+#define OOO_STRING_SVTOOLS_RTF_PICWGOAL "\\picwgoal"
+#define OOO_STRING_SVTOOLS_RTF_PLAIN "\\plain"
+#define OOO_STRING_SVTOOLS_RTF_PMMETAFILE "\\pmmetafile"
+#define OOO_STRING_SVTOOLS_RTF_POSNEGX "\\posnegx"
+#define OOO_STRING_SVTOOLS_RTF_POSNEGY "\\posnegy"
+#define OOO_STRING_SVTOOLS_RTF_POSX "\\posx"
+#define OOO_STRING_SVTOOLS_RTF_POSXC "\\posxc"
+#define OOO_STRING_SVTOOLS_RTF_POSXI "\\posxi"
+#define OOO_STRING_SVTOOLS_RTF_POSXL "\\posxl"
+#define OOO_STRING_SVTOOLS_RTF_POSXO "\\posxo"
+#define OOO_STRING_SVTOOLS_RTF_POSXR "\\posxr"
+#define OOO_STRING_SVTOOLS_RTF_POSY "\\posy"
+#define OOO_STRING_SVTOOLS_RTF_POSYB "\\posyb"
+#define OOO_STRING_SVTOOLS_RTF_POSYC "\\posyc"
+#define OOO_STRING_SVTOOLS_RTF_POSYIL "\\posyil"
+#define OOO_STRING_SVTOOLS_RTF_POSYT "\\posyt"
+#define OOO_STRING_SVTOOLS_RTF_PRINTIM "\\printim"
+#define OOO_STRING_SVTOOLS_RTF_PSOVER "\\psover"
+#define OOO_STRING_SVTOOLS_RTF_PVMRG "\\pvmrg"
+#define OOO_STRING_SVTOOLS_RTF_PVPARA "\\pvpara"
+#define OOO_STRING_SVTOOLS_RTF_PVPG "\\pvpg"
+#define OOO_STRING_SVTOOLS_RTF_QC "\\qc"
+#define OOO_STRING_SVTOOLS_RTF_QJ "\\qj"
+#define OOO_STRING_SVTOOLS_RTF_QL "\\ql"
+#define OOO_STRING_SVTOOLS_RTF_QR "\\qr"
+#define OOO_STRING_SVTOOLS_RTF_RDBLQUOTE "\\rdblquote"
+#define OOO_STRING_SVTOOLS_RTF_RED "\\red"
+#define OOO_STRING_SVTOOLS_RTF_REVBAR "\\revbar"
+#define OOO_STRING_SVTOOLS_RTF_REVISED "\\revised"
+#define OOO_STRING_SVTOOLS_RTF_REVISIONS "\\revisions"
+#define OOO_STRING_SVTOOLS_RTF_REVPROP "\\revprop"
+#define OOO_STRING_SVTOOLS_RTF_REVTIM "\\revtim"
+#define OOO_STRING_SVTOOLS_RTF_RI "\\ri"
+#define OOO_STRING_SVTOOLS_RTF_RIN "\\rin"
+#define OOO_STRING_SVTOOLS_RTF_ROW "\\row"
+#define OOO_STRING_SVTOOLS_RTF_RQUOTE "\\rquote"
+#define OOO_STRING_SVTOOLS_RTF_RTF "\\rtf"
+#define OOO_STRING_SVTOOLS_RTF_RXE "\\rxe"
+#define OOO_STRING_SVTOOLS_RTF_S "\\s"
+#define OOO_STRING_SVTOOLS_RTF_SA "\\sa"
+#define OOO_STRING_SVTOOLS_RTF_SB "\\sb"
+#define OOO_STRING_SVTOOLS_RTF_SBASEDON "\\sbasedon"
+#define OOO_STRING_SVTOOLS_RTF_SBKCOL "\\sbkcol"
+#define OOO_STRING_SVTOOLS_RTF_SBKEVEN "\\sbkeven"
+#define OOO_STRING_SVTOOLS_RTF_SBKNONE "\\sbknone"
+#define OOO_STRING_SVTOOLS_RTF_SBKODD "\\sbkodd"
+#define OOO_STRING_SVTOOLS_RTF_SBKPAGE "\\sbkpage"
+#define OOO_STRING_SVTOOLS_RTF_SBYS "\\sbys"
+#define OOO_STRING_SVTOOLS_RTF_SCAPS "\\scaps"
+#define OOO_STRING_SVTOOLS_RTF_SECT "\\sect"
+#define OOO_STRING_SVTOOLS_RTF_SECTD "\\sectd"
+#define OOO_STRING_SVTOOLS_RTF_SHAD "\\shad"
+#define OOO_STRING_SVTOOLS_RTF_SHADING "\\shading"
+#define OOO_STRING_SVTOOLS_RTF_SHIFT "\\shift"
+#define OOO_STRING_SVTOOLS_RTF_SL "\\sl"
+#define OOO_STRING_SVTOOLS_RTF_SNEXT "\\snext"
+#define OOO_STRING_SVTOOLS_RTF_STRIKE "\\strike"
+#define OOO_STRING_SVTOOLS_RTF_STYLESHEET "\\stylesheet"
+#define OOO_STRING_SVTOOLS_RTF_SUB "\\sub"
+#define OOO_STRING_SVTOOLS_RTF_SUBJECT "\\subject"
+#define OOO_STRING_SVTOOLS_RTF_SUPER "\\super"
+#define OOO_STRING_SVTOOLS_RTF_TAB "\\tab"
+#define OOO_STRING_SVTOOLS_RTF_TB "\\tb"
+#define OOO_STRING_SVTOOLS_RTF_TC "\\tc"
+#define OOO_STRING_SVTOOLS_RTF_TCF "\\tcf"
+#define OOO_STRING_SVTOOLS_RTF_TCL "\\tcl"
+#define OOO_STRING_SVTOOLS_RTF_TEMPLATE "\\template"
+#define OOO_STRING_SVTOOLS_RTF_TITLE "\\title"
+#define OOO_STRING_SVTOOLS_RTF_TITLEPG "\\titlepg"
+#define OOO_STRING_SVTOOLS_RTF_TLDOT "\\tldot"
+#define OOO_STRING_SVTOOLS_RTF_TLEQ "\\tleq"
+#define OOO_STRING_SVTOOLS_RTF_TLHYPH "\\tlhyph"
+#define OOO_STRING_SVTOOLS_RTF_TLTH "\\tlth"
+#define OOO_STRING_SVTOOLS_RTF_TLUL "\\tlul"
+#define OOO_STRING_SVTOOLS_RTF_TQC "\\tqc"
+#define OOO_STRING_SVTOOLS_RTF_TQDEC "\\tqdec"
+#define OOO_STRING_SVTOOLS_RTF_TQR "\\tqr"
+#define OOO_STRING_SVTOOLS_RTF_TQL "\\tql"
+#define OOO_STRING_SVTOOLS_RTF_TRGAPH "\\trgaph"
+#define OOO_STRING_SVTOOLS_RTF_TRLEFT "\\trleft"
+#define OOO_STRING_SVTOOLS_RTF_TROWD "\\trowd"
+#define OOO_STRING_SVTOOLS_RTF_TRQC "\\trqc"
+#define OOO_STRING_SVTOOLS_RTF_TRQL "\\trql"
+#define OOO_STRING_SVTOOLS_RTF_TRQR "\\trqr"
+#define OOO_STRING_SVTOOLS_RTF_TRRH "\\trrh"
+#define OOO_STRING_SVTOOLS_RTF_TX "\\tx"
+#define OOO_STRING_SVTOOLS_RTF_TXE "\\txe"
+#define OOO_STRING_SVTOOLS_RTF_UL "\\ul"
+#define OOO_STRING_SVTOOLS_RTF_ULD "\\uld"
+#define OOO_STRING_SVTOOLS_RTF_ULDB "\\uldb"
+#define OOO_STRING_SVTOOLS_RTF_ULNONE "\\ulnone"
+#define OOO_STRING_SVTOOLS_RTF_ULW "\\ulw"
+#define OOO_STRING_SVTOOLS_RTF_UP "\\up"
+#define OOO_STRING_SVTOOLS_RTF_V "\\v"
+#define OOO_STRING_SVTOOLS_RTF_VERN "\\vern"
+#define OOO_STRING_SVTOOLS_RTF_VERSION "\\version"
+#define OOO_STRING_SVTOOLS_RTF_VERTALB "\\vertalb"
+#define OOO_STRING_SVTOOLS_RTF_VERTALC "\\vertalc"
+#define OOO_STRING_SVTOOLS_RTF_VERTALJ "\\vertalj"
+#define OOO_STRING_SVTOOLS_RTF_VERTALT "\\vertalt"
+#define OOO_STRING_SVTOOLS_RTF_WBITMAP "\\wbitmap"
+#define OOO_STRING_SVTOOLS_RTF_WBMBITSPIXEL "\\wbmbitspixel"
+#define OOO_STRING_SVTOOLS_RTF_WBMPLANES "\\wbmplanes"
+#define OOO_STRING_SVTOOLS_RTF_WBMWIDTHBYTES "\\wbmwidthbytes"
+#define OOO_STRING_SVTOOLS_RTF_WIDOWCTRL "\\widowctrl"
+#define OOO_STRING_SVTOOLS_RTF_WMETAFILE "\\wmetafile"
+#define OOO_STRING_SVTOOLS_RTF_XE "\\xe"
+#define OOO_STRING_SVTOOLS_RTF_YR "\\yr"
+#define OOO_STRING_SVTOOLS_RTF_NOBRKHYPH "\\_"
+#define OOO_STRING_SVTOOLS_RTF_FORMULA "\\|"
+#define OOO_STRING_SVTOOLS_RTF_NOBREAK "\\~"
+#define OOO_STRING_SVTOOLS_RTF_AB "\\ab"
+#define OOO_STRING_SVTOOLS_RTF_ACAPS "\\acaps"
+#define OOO_STRING_SVTOOLS_RTF_ACF "\\acf"
+#define OOO_STRING_SVTOOLS_RTF_ADDITIVE "\\additive"
+#define OOO_STRING_SVTOOLS_RTF_ADN "\\adn"
+#define OOO_STRING_SVTOOLS_RTF_AENDDOC "\\aenddoc"
+#define OOO_STRING_SVTOOLS_RTF_AENDNOTES "\\aendnotes"
+#define OOO_STRING_SVTOOLS_RTF_AEXPND "\\aexpnd"
+#define OOO_STRING_SVTOOLS_RTF_AF "\\af"
+#define OOO_STRING_SVTOOLS_RTF_AFS "\\afs"
+#define OOO_STRING_SVTOOLS_RTF_AFTNBJ "\\aftnbj"
+#define OOO_STRING_SVTOOLS_RTF_AFTNCN "\\aftncn"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNALC "\\aftnnalc"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNAR "\\aftnnar"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNAUC "\\aftnnauc"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNCHI "\\aftnnchi"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNRLC "\\aftnnrlc"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNRUC "\\aftnnruc"
+#define OOO_STRING_SVTOOLS_RTF_AFTNRESTART "\\aftnrestart"
+#define OOO_STRING_SVTOOLS_RTF_AFTNRSTCONT "\\aftnrstcont"
+#define OOO_STRING_SVTOOLS_RTF_AFTNSEP "\\aftnsep"
+#define OOO_STRING_SVTOOLS_RTF_AFTNSEPC "\\aftnsepc"
+#define OOO_STRING_SVTOOLS_RTF_AFTNSTART "\\aftnstart"
+#define OOO_STRING_SVTOOLS_RTF_AFTNTJ "\\aftntj"
+#define OOO_STRING_SVTOOLS_RTF_AI "\\ai"
+#define OOO_STRING_SVTOOLS_RTF_ALANG "\\alang"
+#define OOO_STRING_SVTOOLS_RTF_ALLPROT "\\allprot"
+#define OOO_STRING_SVTOOLS_RTF_ANNOTPROT "\\annotprot"
+#define OOO_STRING_SVTOOLS_RTF_AOUTL "\\aoutl"
+#define OOO_STRING_SVTOOLS_RTF_ASCAPS "\\ascaps"
+#define OOO_STRING_SVTOOLS_RTF_ASHAD "\\ashad"
+#define OOO_STRING_SVTOOLS_RTF_ASTRIKE "\\astrike"
+#define OOO_STRING_SVTOOLS_RTF_ATNAUTHOR "\\atnauthor"
+#define OOO_STRING_SVTOOLS_RTF_ATNICN "\\atnicn"
+#define OOO_STRING_SVTOOLS_RTF_ATNREF "\\atnref"
+#define OOO_STRING_SVTOOLS_RTF_ATNTIME "\\atntime"
+#define OOO_STRING_SVTOOLS_RTF_ATRFEND "\\atrfend"
+#define OOO_STRING_SVTOOLS_RTF_ATRFSTART "\\atrfstart"
+#define OOO_STRING_SVTOOLS_RTF_AUL "\\aul"
+#define OOO_STRING_SVTOOLS_RTF_AULD "\\auld"
+#define OOO_STRING_SVTOOLS_RTF_AULDB "\\auldb"
+#define OOO_STRING_SVTOOLS_RTF_AULNONE "\\aulnone"
+#define OOO_STRING_SVTOOLS_RTF_AULW "\\aulw"
+#define OOO_STRING_SVTOOLS_RTF_AUP "\\aup"
+#define OOO_STRING_SVTOOLS_RTF_BKMKPUB "\\bkmkpub"
+#define OOO_STRING_SVTOOLS_RTF_BRDRDASH "\\brdrdash"
+#define OOO_STRING_SVTOOLS_RTF_BRKFRM "\\brkfrm"
+#define OOO_STRING_SVTOOLS_RTF_CCHS "\\cchs"
+#define OOO_STRING_SVTOOLS_RTF_CPG "\\cpg"
+#define OOO_STRING_SVTOOLS_RTF_CS "\\cs"
+#define OOO_STRING_SVTOOLS_RTF_CVMME "\\cvmme"
+#define OOO_STRING_SVTOOLS_RTF_DATAFIELD "\\datafield"
+#define OOO_STRING_SVTOOLS_RTF_DO "\\do"
+#define OOO_STRING_SVTOOLS_RTF_DOBXCOLUMN "\\dobxcolumn"
+#define OOO_STRING_SVTOOLS_RTF_DOBXMARGIN "\\dobxmargin"
+#define OOO_STRING_SVTOOLS_RTF_DOBXPAGE "\\dobxpage"
+#define OOO_STRING_SVTOOLS_RTF_DOBYMARGIN "\\dobymargin"
+#define OOO_STRING_SVTOOLS_RTF_DOBYPAGE "\\dobypage"
+#define OOO_STRING_SVTOOLS_RTF_DOBYPARA "\\dobypara"
+#define OOO_STRING_SVTOOLS_RTF_DODHGT "\\dodhgt"
+#define OOO_STRING_SVTOOLS_RTF_DOLOCK "\\dolock"
+#define OOO_STRING_SVTOOLS_RTF_DPAENDHOL "\\dpaendhol"
+#define OOO_STRING_SVTOOLS_RTF_DPAENDL "\\dpaendl"
+#define OOO_STRING_SVTOOLS_RTF_DPAENDSOL "\\dpaendsol"
+#define OOO_STRING_SVTOOLS_RTF_DPAENDW "\\dpaendw"
+#define OOO_STRING_SVTOOLS_RTF_DPARC "\\dparc"
+#define OOO_STRING_SVTOOLS_RTF_DPARCFLIPX "\\dparcflipx"
+#define OOO_STRING_SVTOOLS_RTF_DPARCFLIPY "\\dparcflipy"
+#define OOO_STRING_SVTOOLS_RTF_DPASTARTHOL "\\dpastarthol"
+#define OOO_STRING_SVTOOLS_RTF_DPASTARTL "\\dpastartl"
+#define OOO_STRING_SVTOOLS_RTF_DPASTARTSOL "\\dpastartsol"
+#define OOO_STRING_SVTOOLS_RTF_DPASTARTW "\\dpastartw"
+#define OOO_STRING_SVTOOLS_RTF_DPCALLOUT "\\dpcallout"
+#define OOO_STRING_SVTOOLS_RTF_DPCOA "\\dpcoa"
+#define OOO_STRING_SVTOOLS_RTF_DPCOACCENT "\\dpcoaccent"
+#define OOO_STRING_SVTOOLS_RTF_DPCOBESTFIT "\\dpcobestfit"
+#define OOO_STRING_SVTOOLS_RTF_DPCOBORDER "\\dpcoborder"
+#define OOO_STRING_SVTOOLS_RTF_DPCODABS "\\dpcodabs"
+#define OOO_STRING_SVTOOLS_RTF_DPCODBOTTOM "\\dpcodbottom"
+#define OOO_STRING_SVTOOLS_RTF_DPCODCENTER "\\dpcodcenter"
+#define OOO_STRING_SVTOOLS_RTF_DPCODTOP "\\dpcodtop"
+#define OOO_STRING_SVTOOLS_RTF_DPCOLENGTH "\\dpcolength"
+#define OOO_STRING_SVTOOLS_RTF_DPCOMINUSX "\\dpcominusx"
+#define OOO_STRING_SVTOOLS_RTF_DPCOMINUSY "\\dpcominusy"
+#define OOO_STRING_SVTOOLS_RTF_DPCOOFFSET "\\dpcooffset"
+#define OOO_STRING_SVTOOLS_RTF_DPCOSMARTA "\\dpcosmarta"
+#define OOO_STRING_SVTOOLS_RTF_DPCOTDOUBLE "\\dpcotdouble"
+#define OOO_STRING_SVTOOLS_RTF_DPCOTRIGHT "\\dpcotright"
+#define OOO_STRING_SVTOOLS_RTF_DPCOTSINGLE "\\dpcotsingle"
+#define OOO_STRING_SVTOOLS_RTF_DPCOTTRIPLE "\\dpcottriple"
+#define OOO_STRING_SVTOOLS_RTF_DPCOUNT "\\dpcount"
+#define OOO_STRING_SVTOOLS_RTF_DPELLIPSE "\\dpellipse"
+#define OOO_STRING_SVTOOLS_RTF_DPENDGROUP "\\dpendgroup"
+#define OOO_STRING_SVTOOLS_RTF_DPFILLBGCB "\\dpfillbgcb"
+#define OOO_STRING_SVTOOLS_RTF_DPFILLBGCG "\\dpfillbgcg"
+#define OOO_STRING_SVTOOLS_RTF_DPFILLBGCR "\\dpfillbgcr"
+#define OOO_STRING_SVTOOLS_RTF_DPFILLBGGRAY "\\dpfillbggray"
+#define OOO_STRING_SVTOOLS_RTF_DPFILLBGPAL "\\dpfillbgpal"
+#define OOO_STRING_SVTOOLS_RTF_DPFILLFGCB "\\dpfillfgcb"
+#define OOO_STRING_SVTOOLS_RTF_DPFILLFGCG "\\dpfillfgcg"
+#define OOO_STRING_SVTOOLS_RTF_DPFILLFGCR "\\dpfillfgcr"
+#define OOO_STRING_SVTOOLS_RTF_DPFILLFGGRAY "\\dpfillfggray"
+#define OOO_STRING_SVTOOLS_RTF_DPFILLFGPAL "\\dpfillfgpal"
+#define OOO_STRING_SVTOOLS_RTF_DPFILLPAT "\\dpfillpat"
+#define OOO_STRING_SVTOOLS_RTF_DPGROUP "\\dpgroup"
+#define OOO_STRING_SVTOOLS_RTF_DPLINE "\\dpline"
+#define OOO_STRING_SVTOOLS_RTF_DPLINECOB "\\dplinecob"
+#define OOO_STRING_SVTOOLS_RTF_DPLINECOG "\\dplinecog"
+#define OOO_STRING_SVTOOLS_RTF_DPLINECOR "\\dplinecor"
+#define OOO_STRING_SVTOOLS_RTF_DPLINEDADO "\\dplinedado"
+#define OOO_STRING_SVTOOLS_RTF_DPLINEDADODO "\\dplinedadodo"
+#define OOO_STRING_SVTOOLS_RTF_DPLINEDASH "\\dplinedash"
+#define OOO_STRING_SVTOOLS_RTF_DPLINEDOT "\\dplinedot"
+#define OOO_STRING_SVTOOLS_RTF_DPLINEGRAY "\\dplinegray"
+#define OOO_STRING_SVTOOLS_RTF_DPLINEHOLLOW "\\dplinehollow"
+#define OOO_STRING_SVTOOLS_RTF_DPLINEPAL "\\dplinepal"
+#define OOO_STRING_SVTOOLS_RTF_DPLINESOLID "\\dplinesolid"
+#define OOO_STRING_SVTOOLS_RTF_DPLINEW "\\dplinew"
+#define OOO_STRING_SVTOOLS_RTF_DPPOLYCOUNT "\\dppolycount"
+#define OOO_STRING_SVTOOLS_RTF_DPPOLYGON "\\dppolygon"
+#define OOO_STRING_SVTOOLS_RTF_DPPOLYLINE "\\dppolyline"
+#define OOO_STRING_SVTOOLS_RTF_DPPTX "\\dpptx"
+#define OOO_STRING_SVTOOLS_RTF_DPPTY "\\dppty"
+#define OOO_STRING_SVTOOLS_RTF_DPRECT "\\dprect"
+#define OOO_STRING_SVTOOLS_RTF_DPROUNDR "\\dproundr"
+#define OOO_STRING_SVTOOLS_RTF_DPSHADOW "\\dpshadow"
+#define OOO_STRING_SVTOOLS_RTF_DPSHADX "\\dpshadx"
+#define OOO_STRING_SVTOOLS_RTF_DPSHADY "\\dpshady"
+#define OOO_STRING_SVTOOLS_RTF_DPTXBX "\\dptxbx"
+#define OOO_STRING_SVTOOLS_RTF_DPTXBXMAR "\\dptxbxmar"
+#define OOO_STRING_SVTOOLS_RTF_DPTXBXTEXT "\\dptxbxtext"
+#define OOO_STRING_SVTOOLS_RTF_DPX "\\dpx"
+#define OOO_STRING_SVTOOLS_RTF_DPXSIZE "\\dpxsize"
+#define OOO_STRING_SVTOOLS_RTF_DPY "\\dpy"
+#define OOO_STRING_SVTOOLS_RTF_DPYSIZE "\\dpysize"
+#define OOO_STRING_SVTOOLS_RTF_DS "\\ds"
+#define OOO_STRING_SVTOOLS_RTF_EMSPACE "\\emspace"
+#define OOO_STRING_SVTOOLS_RTF_ENSPACE "\\enspace"
+#define OOO_STRING_SVTOOLS_RTF_FBIDI "\\fbidi"
+#define OOO_STRING_SVTOOLS_RTF_FET "\\fet"
+#define OOO_STRING_SVTOOLS_RTF_FID "\\fid"
+#define OOO_STRING_SVTOOLS_RTF_FILE "\\file"
+#define OOO_STRING_SVTOOLS_RTF_FILETBL "\\filetbl"
+#define OOO_STRING_SVTOOLS_RTF_FLDALT "\\fldalt"
+#define OOO_STRING_SVTOOLS_RTF_FNETWORK "\\fnetwork"
+#define OOO_STRING_SVTOOLS_RTF_FONTEMB "\\fontemb"
+#define OOO_STRING_SVTOOLS_RTF_FONTFILE "\\fontfile"
+#define OOO_STRING_SVTOOLS_RTF_FORMDISP "\\formdisp"
+#define OOO_STRING_SVTOOLS_RTF_FORMPROT "\\formprot"
+#define OOO_STRING_SVTOOLS_RTF_FORMSHADE "\\formshade"
+#define OOO_STRING_SVTOOLS_RTF_FOSNUM "\\fosnum"
+#define OOO_STRING_SVTOOLS_RTF_FRELATIVE "\\frelative"
+#define OOO_STRING_SVTOOLS_RTF_FTNALT "\\ftnalt"
+#define OOO_STRING_SVTOOLS_RTF_FTNIL "\\ftnil"
+#define OOO_STRING_SVTOOLS_RTF_FTNNALC "\\ftnnalc"
+#define OOO_STRING_SVTOOLS_RTF_FTNNAR "\\ftnnar"
+#define OOO_STRING_SVTOOLS_RTF_FTNNAUC "\\ftnnauc"
+#define OOO_STRING_SVTOOLS_RTF_FTNNCHI "\\ftnnchi"
+#define OOO_STRING_SVTOOLS_RTF_FTNNRLC "\\ftnnrlc"
+#define OOO_STRING_SVTOOLS_RTF_FTNNRUC "\\ftnnruc"
+#define OOO_STRING_SVTOOLS_RTF_FTNRSTCONT "\\ftnrstcont"
+#define OOO_STRING_SVTOOLS_RTF_FTNRSTPG "\\ftnrstpg"
+#define OOO_STRING_SVTOOLS_RTF_FTTRUETYPE "\\fttruetype"
+#define OOO_STRING_SVTOOLS_RTF_FVALIDDOS "\\fvaliddos"
+#define OOO_STRING_SVTOOLS_RTF_FVALIDHPFS "\\fvalidhpfs"
+#define OOO_STRING_SVTOOLS_RTF_FVALIDMAC "\\fvalidmac"
+#define OOO_STRING_SVTOOLS_RTF_FVALIDNTFS "\\fvalidntfs"
+#define OOO_STRING_SVTOOLS_RTF_HYPHAUTO "\\hyphauto"
+#define OOO_STRING_SVTOOLS_RTF_HYPHCAPS "\\hyphcaps"
+#define OOO_STRING_SVTOOLS_RTF_HYPHCONSEC "\\hyphconsec"
+#define OOO_STRING_SVTOOLS_RTF_HYPHPAR "\\hyphpar"
+#define OOO_STRING_SVTOOLS_RTF_LINKSELF "\\linkself"
+#define OOO_STRING_SVTOOLS_RTF_LINKSTYLES "\\linkstyles"
+#define OOO_STRING_SVTOOLS_RTF_LTRCH "\\ltrch"
+#define OOO_STRING_SVTOOLS_RTF_LTRDOC "\\ltrdoc"
+#define OOO_STRING_SVTOOLS_RTF_LTRMARK "\\ltrmark"
+#define OOO_STRING_SVTOOLS_RTF_LTRPAR "\\ltrpar"
+#define OOO_STRING_SVTOOLS_RTF_LTRROW "\\ltrrow"
+#define OOO_STRING_SVTOOLS_RTF_LTRSECT "\\ltrsect"
+#define OOO_STRING_SVTOOLS_RTF_NOCOLBAL "\\nocolbal"
+#define OOO_STRING_SVTOOLS_RTF_NOEXTRASPRL "\\noextrasprl"
+#define OOO_STRING_SVTOOLS_RTF_NOTABIND "\\notabind"
+#define OOO_STRING_SVTOOLS_RTF_NOWIDCTLPAR "\\nowidctlpar"
+#define OOO_STRING_SVTOOLS_RTF_OBJALIAS "\\objalias"
+#define OOO_STRING_SVTOOLS_RTF_OBJALIGN "\\objalign"
+#define OOO_STRING_SVTOOLS_RTF_OBJAUTLINK "\\objautlink"
+#define OOO_STRING_SVTOOLS_RTF_OBJCLASS "\\objclass"
+#define OOO_STRING_SVTOOLS_RTF_OBJCROPB "\\objcropb"
+#define OOO_STRING_SVTOOLS_RTF_OBJCROPL "\\objcropl"
+#define OOO_STRING_SVTOOLS_RTF_OBJCROPR "\\objcropr"
+#define OOO_STRING_SVTOOLS_RTF_OBJCROPT "\\objcropt"
+#define OOO_STRING_SVTOOLS_RTF_OBJDATA "\\objdata"
+#define OOO_STRING_SVTOOLS_RTF_OBJECT "\\object"
+#define OOO_STRING_SVTOOLS_RTF_OBJEMB "\\objemb"
+#define OOO_STRING_SVTOOLS_RTF_OBJH "\\objh"
+#define OOO_STRING_SVTOOLS_RTF_OBJICEMB "\\objicemb"
+#define OOO_STRING_SVTOOLS_RTF_OBJLINK "\\objlink"
+#define OOO_STRING_SVTOOLS_RTF_OBJLOCK "\\objlock"
+#define OOO_STRING_SVTOOLS_RTF_OBJNAME "\\objname"
+#define OOO_STRING_SVTOOLS_RTF_OBJPUB "\\objpub"
+#define OOO_STRING_SVTOOLS_RTF_OBJSCALEX "\\objscalex"
+#define OOO_STRING_SVTOOLS_RTF_OBJSCALEY "\\objscaley"
+#define OOO_STRING_SVTOOLS_RTF_OBJSECT "\\objsect"
+#define OOO_STRING_SVTOOLS_RTF_OBJSETSIZE "\\objsetsize"
+#define OOO_STRING_SVTOOLS_RTF_OBJSUB "\\objsub"
+#define OOO_STRING_SVTOOLS_RTF_OBJTIME "\\objtime"
+#define OOO_STRING_SVTOOLS_RTF_OBJTRANSY "\\objtransy"
+#define OOO_STRING_SVTOOLS_RTF_OBJUPDATE "\\objupdate"
+#define OOO_STRING_SVTOOLS_RTF_OBJW "\\objw"
+#define OOO_STRING_SVTOOLS_RTF_OTBLRUL "\\otblrul"
+#define OOO_STRING_SVTOOLS_RTF_PGNHN "\\pgnhn"
+#define OOO_STRING_SVTOOLS_RTF_PGNHNSC "\\pgnhnsc"
+#define OOO_STRING_SVTOOLS_RTF_PGNHNSH "\\pgnhnsh"
+#define OOO_STRING_SVTOOLS_RTF_PGNHNSM "\\pgnhnsm"
+#define OOO_STRING_SVTOOLS_RTF_PGNHNSN "\\pgnhnsn"
+#define OOO_STRING_SVTOOLS_RTF_PGNHNSP "\\pgnhnsp"
+#define OOO_STRING_SVTOOLS_RTF_PICBMP "\\picbmp"
+#define OOO_STRING_SVTOOLS_RTF_PICBPP "\\picbpp"
+#define OOO_STRING_SVTOOLS_RTF_PN "\\pn"
+#define OOO_STRING_SVTOOLS_RTF_PNACROSS "\\pnacross"
+#define OOO_STRING_SVTOOLS_RTF_PNB "\\pnb"
+#define OOO_STRING_SVTOOLS_RTF_PNCAPS "\\pncaps"
+#define OOO_STRING_SVTOOLS_RTF_PNCARD "\\pncard"
+#define OOO_STRING_SVTOOLS_RTF_PNCF "\\pncf"
+#define OOO_STRING_SVTOOLS_RTF_PNDEC "\\pndec"
+#define OOO_STRING_SVTOOLS_RTF_PNF "\\pnf"
+#define OOO_STRING_SVTOOLS_RTF_PNFS "\\pnfs"
+#define OOO_STRING_SVTOOLS_RTF_PNHANG "\\pnhang"
+#define OOO_STRING_SVTOOLS_RTF_PNI "\\pni"
+#define OOO_STRING_SVTOOLS_RTF_PNINDENT "\\pnindent"
+#define OOO_STRING_SVTOOLS_RTF_PNLCLTR "\\pnlcltr"
+#define OOO_STRING_SVTOOLS_RTF_PNLCRM "\\pnlcrm"
+#define OOO_STRING_SVTOOLS_RTF_PNLVL "\\pnlvl"
+#define OOO_STRING_SVTOOLS_RTF_PNLVLBLT "\\pnlvlblt"
+#define OOO_STRING_SVTOOLS_RTF_PNLVLBODY "\\pnlvlbody"
+#define OOO_STRING_SVTOOLS_RTF_PNLVLCONT "\\pnlvlcont"
+#define OOO_STRING_SVTOOLS_RTF_PNNUMONCE "\\pnnumonce"
+#define OOO_STRING_SVTOOLS_RTF_PNORD "\\pnord"
+#define OOO_STRING_SVTOOLS_RTF_PNORDT "\\pnordt"
+#define OOO_STRING_SVTOOLS_RTF_PNPREV "\\pnprev"
+#define OOO_STRING_SVTOOLS_RTF_PNQC "\\pnqc"
+#define OOO_STRING_SVTOOLS_RTF_PNQL "\\pnql"
+#define OOO_STRING_SVTOOLS_RTF_PNQR "\\pnqr"
+#define OOO_STRING_SVTOOLS_RTF_PNRESTART "\\pnrestart"
+#define OOO_STRING_SVTOOLS_RTF_PNSCAPS "\\pnscaps"
+#define OOO_STRING_SVTOOLS_RTF_PNSECLVL "\\pnseclvl"
+#define OOO_STRING_SVTOOLS_RTF_PNSP "\\pnsp"
+#define OOO_STRING_SVTOOLS_RTF_PNSTART "\\pnstart"
+#define OOO_STRING_SVTOOLS_RTF_PNSTRIKE "\\pnstrike"
+#define OOO_STRING_SVTOOLS_RTF_PNTEXT "\\pntext"
+#define OOO_STRING_SVTOOLS_RTF_PNTXTA "\\pntxta"
+#define OOO_STRING_SVTOOLS_RTF_PNTXTB "\\pntxtb"
+#define OOO_STRING_SVTOOLS_RTF_PNUCLTR "\\pnucltr"
+#define OOO_STRING_SVTOOLS_RTF_PNUCRM "\\pnucrm"
+#define OOO_STRING_SVTOOLS_RTF_PNUL "\\pnul"
+#define OOO_STRING_SVTOOLS_RTF_PNULD "\\pnuld"
+#define OOO_STRING_SVTOOLS_RTF_PNULDB "\\pnuldb"
+#define OOO_STRING_SVTOOLS_RTF_PNULNONE "\\pnulnone"
+#define OOO_STRING_SVTOOLS_RTF_PNULW "\\pnulw"
+#define OOO_STRING_SVTOOLS_RTF_PRCOLBL "\\prcolbl"
+#define OOO_STRING_SVTOOLS_RTF_PRINTDATA "\\printdata"
+#define OOO_STRING_SVTOOLS_RTF_PSZ "\\psz"
+#define OOO_STRING_SVTOOLS_RTF_PUBAUTO "\\pubauto"
+#define OOO_STRING_SVTOOLS_RTF_RESULT "\\result"
+#define OOO_STRING_SVTOOLS_RTF_REVAUTH "\\revauth"
+#define OOO_STRING_SVTOOLS_RTF_REVDTTM "\\revdttm"
+#define OOO_STRING_SVTOOLS_RTF_REVPROT "\\revprot"
+#define OOO_STRING_SVTOOLS_RTF_REVTBL "\\revtbl"
+#define OOO_STRING_SVTOOLS_RTF_RSLTBMP "\\rsltbmp"
+#define OOO_STRING_SVTOOLS_RTF_RSLTMERGE "\\rsltmerge"
+#define OOO_STRING_SVTOOLS_RTF_RSLTPICT "\\rsltpict"
+#define OOO_STRING_SVTOOLS_RTF_RSLTRTF "\\rsltrtf"
+#define OOO_STRING_SVTOOLS_RTF_RSLTTXT "\\rslttxt"
+#define OOO_STRING_SVTOOLS_RTF_RTLCH "\\rtlch"
+#define OOO_STRING_SVTOOLS_RTF_RTLDOC "\\rtldoc"
+#define OOO_STRING_SVTOOLS_RTF_RTLMARK "\\rtlmark"
+#define OOO_STRING_SVTOOLS_RTF_RTLPAR "\\rtlpar"
+#define OOO_STRING_SVTOOLS_RTF_RTLROW "\\rtlrow"
+#define OOO_STRING_SVTOOLS_RTF_RTLSECT "\\rtlsect"
+#define OOO_STRING_SVTOOLS_RTF_SEC "\\sec"
+#define OOO_STRING_SVTOOLS_RTF_SECTNUM "\\sectnum"
+#define OOO_STRING_SVTOOLS_RTF_SECTUNLOCKED "\\sectunlocked"
+#define OOO_STRING_SVTOOLS_RTF_SLMULT "\\slmult"
+#define OOO_STRING_SVTOOLS_RTF_SOFTCOL "\\softcol"
+#define OOO_STRING_SVTOOLS_RTF_SOFTLHEIGHT "\\softlheight"
+#define OOO_STRING_SVTOOLS_RTF_SOFTLINE "\\softline"
+#define OOO_STRING_SVTOOLS_RTF_SOFTPAGE "\\softpage"
+#define OOO_STRING_SVTOOLS_RTF_SPRSSPBF "\\sprsspbf"
+#define OOO_STRING_SVTOOLS_RTF_SPRSTSP "\\sprstsp"
+#define OOO_STRING_SVTOOLS_RTF_SUBDOCUMENT "\\subdocument"
+#define OOO_STRING_SVTOOLS_RTF_SWPBDR "\\swpbdr"
+#define OOO_STRING_SVTOOLS_RTF_TCN "\\tcn"
+#define OOO_STRING_SVTOOLS_RTF_TRANSMF "\\transmf"
+#define OOO_STRING_SVTOOLS_RTF_TRBRDRB "\\trbrdrb"
+#define OOO_STRING_SVTOOLS_RTF_TRBRDRH "\\trbrdrh"
+#define OOO_STRING_SVTOOLS_RTF_TRBRDRL "\\trbrdrl"
+#define OOO_STRING_SVTOOLS_RTF_TRBRDRR "\\trbrdrr"
+#define OOO_STRING_SVTOOLS_RTF_TRBRDRT "\\trbrdrt"
+#define OOO_STRING_SVTOOLS_RTF_TRBRDRV "\\trbrdrv"
+#define OOO_STRING_SVTOOLS_RTF_TRHDR "\\trhdr"
+#define OOO_STRING_SVTOOLS_RTF_TRKEEP "\\trkeep"
+#define OOO_STRING_SVTOOLS_RTF_TRPADDB "\\trpaddb"
+#define OOO_STRING_SVTOOLS_RTF_TRPADDL "\\trpaddl"
+#define OOO_STRING_SVTOOLS_RTF_TRPADDR "\\trpaddr"
+#define OOO_STRING_SVTOOLS_RTF_TRPADDT "\\trpaddt"
+#define OOO_STRING_SVTOOLS_RTF_TRPADDFB "\\trpaddfb"
+#define OOO_STRING_SVTOOLS_RTF_TRPADDFL "\\trpaddfl"
+#define OOO_STRING_SVTOOLS_RTF_TRPADDFR "\\trpaddfr"
+#define OOO_STRING_SVTOOLS_RTF_TRPADDFT "\\trpaddft"
+#define OOO_STRING_SVTOOLS_RTF_WRAPTRSP "\\wraptrsp"
+#define OOO_STRING_SVTOOLS_RTF_XEF "\\xef"
+#define OOO_STRING_SVTOOLS_RTF_ZWJ "\\zwj"
+#define OOO_STRING_SVTOOLS_RTF_ZWNJ "\\zwnj"
+
+// neue Tokens zur 1.5
+#define OOO_STRING_SVTOOLS_RTF_ABSLOCK "\\abslock"
+#define OOO_STRING_SVTOOLS_RTF_ADJUSTRIGHT "\\adjustright"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNCHOSUNG "\\aftnnchosung"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNCNUM "\\aftnncnum"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNDBAR "\\aftnndbar"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNDBNUM "\\aftnndbnum"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNDBNUMD "\\aftnndbnumd"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNDBNUMK "\\aftnndbnumk"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNDBNUMT "\\aftnndbnumt"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNGANADA "\\aftnnganada"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNGBNUM "\\aftnngbnum"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNGBNUMD "\\aftnngbnumd"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNGBNUMK "\\aftnngbnumk"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNGBNUML "\\aftnngbnuml"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNZODIAC "\\aftnnzodiac"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNZODIACD "\\aftnnzodiacd"
+#define OOO_STRING_SVTOOLS_RTF_AFTNNZODIACL "\\aftnnzodiacl"
+#define OOO_STRING_SVTOOLS_RTF_ANIMTEXT "\\animtext"
+#define OOO_STRING_SVTOOLS_RTF_ANSICPG "\\ansicpg"
+#define OOO_STRING_SVTOOLS_RTF_BACKGROUND "\\background"
+#define OOO_STRING_SVTOOLS_RTF_BDBFHDR "\\bdbfhdr"
+#define OOO_STRING_SVTOOLS_RTF_BLIPTAG "\\bliptag"
+#define OOO_STRING_SVTOOLS_RTF_BLIPUID "\\blipuid"
+#define OOO_STRING_SVTOOLS_RTF_BLIPUPI "\\blipupi"
+#define OOO_STRING_SVTOOLS_RTF_BRDRART "\\brdrart"
+#define OOO_STRING_SVTOOLS_RTF_BRDRDASHD "\\brdrdashd"
+#define OOO_STRING_SVTOOLS_RTF_BRDRDASHDD "\\brdrdashdd"
+#define OOO_STRING_SVTOOLS_RTF_BRDRDASHDOTSTR "\\brdrdashdotstr"
+#define OOO_STRING_SVTOOLS_RTF_BRDRDASHSM "\\brdrdashsm"
+#define OOO_STRING_SVTOOLS_RTF_BRDREMBOSS "\\brdremboss"
+#define OOO_STRING_SVTOOLS_RTF_BRDRENGRAVE "\\brdrengrave"
+#define OOO_STRING_SVTOOLS_RTF_BRDROUTSET "\\brdroutset"
+#define OOO_STRING_SVTOOLS_RTF_BRDRINSET "\\brdrinset"
+#define OOO_STRING_SVTOOLS_RTF_BRDRNONE "\\brdrnone"
+#define OOO_STRING_SVTOOLS_RTF_BRDRFRAME "\\brdrframe"
+#define OOO_STRING_SVTOOLS_RTF_BRDRTHTNLG "\\brdrthtnlg"
+#define OOO_STRING_SVTOOLS_RTF_BRDRTHTNMG "\\brdrthtnmg"
+#define OOO_STRING_SVTOOLS_RTF_BRDRTHTNSG "\\brdrthtnsg"
+#define OOO_STRING_SVTOOLS_RTF_BRDRTNTHLG "\\brdrtnthlg"
+#define OOO_STRING_SVTOOLS_RTF_BRDRTNTHMG "\\brdrtnthmg"
+#define OOO_STRING_SVTOOLS_RTF_BRDRTNTHSG "\\brdrtnthsg"
+#define OOO_STRING_SVTOOLS_RTF_BRDRTNTHTNLG "\\brdrtnthtnlg"
+#define OOO_STRING_SVTOOLS_RTF_BRDRTNTHTNMG "\\brdrtnthtnmg"
+#define OOO_STRING_SVTOOLS_RTF_BRDRTNTHTNSG "\\brdrtnthtnsg"
+#define OOO_STRING_SVTOOLS_RTF_BRDRTRIPLE "\\brdrtriple"
+#define OOO_STRING_SVTOOLS_RTF_BRDRWAVY "\\brdrwavy"
+#define OOO_STRING_SVTOOLS_RTF_BRDRWAVYDB "\\brdrwavydb"
+#define OOO_STRING_SVTOOLS_RTF_CATEGORY "\\category"
+#define OOO_STRING_SVTOOLS_RTF_CGRID "\\cgrid"
+#define OOO_STRING_SVTOOLS_RTF_CHARSCALEX "\\charscalex"
+#define OOO_STRING_SVTOOLS_RTF_CHBGBDIAG "\\chbgbdiag"
+#define OOO_STRING_SVTOOLS_RTF_CHBGCROSS "\\chbgcross"
+#define OOO_STRING_SVTOOLS_RTF_CHBGDCROSS "\\chbgdcross"
+#define OOO_STRING_SVTOOLS_RTF_CHBGDKBDIAG "\\chbgdkbdiag"
+#define OOO_STRING_SVTOOLS_RTF_CHBGDKCROSS "\\chbgdkcross"
+#define OOO_STRING_SVTOOLS_RTF_CHBGDKDCROSS "\\chbgdkdcross"
+#define OOO_STRING_SVTOOLS_RTF_CHBGDKFDIAG "\\chbgdkfdiag"
+#define OOO_STRING_SVTOOLS_RTF_CHBGDKHORIZ "\\chbgdkhoriz"
+#define OOO_STRING_SVTOOLS_RTF_CHBGDKVERT "\\chbgdkvert"
+#define OOO_STRING_SVTOOLS_RTF_CHBGFDIAG "\\chbgfdiag"
+#define OOO_STRING_SVTOOLS_RTF_CHBGHORIZ "\\chbghoriz"
+#define OOO_STRING_SVTOOLS_RTF_CHBGVERT "\\chbgvert"
+#define OOO_STRING_SVTOOLS_RTF_CHBRDR "\\chbrdr"
+#define OOO_STRING_SVTOOLS_RTF_CHCBPAT "\\chcbpat"
+#define OOO_STRING_SVTOOLS_RTF_CHCFPAT "\\chcfpat"
+#define OOO_STRING_SVTOOLS_RTF_CHSHDNG "\\chshdng"
+#define OOO_STRING_SVTOOLS_RTF_CLPADL "\\clpadl"
+#define OOO_STRING_SVTOOLS_RTF_CLPADT "\\clpadt"
+#define OOO_STRING_SVTOOLS_RTF_CLPADB "\\clpadb"
+#define OOO_STRING_SVTOOLS_RTF_CLPADR "\\clpadr"
+#define OOO_STRING_SVTOOLS_RTF_CLPADFL "\\clpadfl"
+#define OOO_STRING_SVTOOLS_RTF_CLPADFT "\\clpadft"
+#define OOO_STRING_SVTOOLS_RTF_CLPADFB "\\clpadfb"
+#define OOO_STRING_SVTOOLS_RTF_CLPADFR "\\clpadfr"
+#define OOO_STRING_SVTOOLS_RTF_CLTXLRTB "\\cltxlrtb"
+#define OOO_STRING_SVTOOLS_RTF_CLTXTBRL "\\cltxtbrl"
+#define OOO_STRING_SVTOOLS_RTF_CLVERTALB "\\clvertalb"
+#define OOO_STRING_SVTOOLS_RTF_CLVERTALC "\\clvertalc"
+#define OOO_STRING_SVTOOLS_RTF_CLVERTALT "\\clvertalt"
+#define OOO_STRING_SVTOOLS_RTF_CLVMGF "\\clvmgf"
+#define OOO_STRING_SVTOOLS_RTF_CLVMRG "\\clvmrg"
+#define OOO_STRING_SVTOOLS_RTF_CLTXTBRLV "\\cltxtbrlv"
+#define OOO_STRING_SVTOOLS_RTF_CLTXBTLR "\\cltxbtlr"
+#define OOO_STRING_SVTOOLS_RTF_CLTXLRTBV "\\cltxlrtbv"
+#define OOO_STRING_SVTOOLS_RTF_COMPANY "\\company"
+#define OOO_STRING_SVTOOLS_RTF_CRAUTH "\\crauth"
+#define OOO_STRING_SVTOOLS_RTF_CRDATE "\\crdate"
+#define OOO_STRING_SVTOOLS_RTF_DATE "\\date"
+#define OOO_STRING_SVTOOLS_RTF_DEFLANGFE "\\deflangfe"
+#define OOO_STRING_SVTOOLS_RTF_DFRAUTH "\\dfrauth"
+#define OOO_STRING_SVTOOLS_RTF_DFRDATE "\\dfrdate"
+#define OOO_STRING_SVTOOLS_RTF_DFRSTART "\\dfrstart"
+#define OOO_STRING_SVTOOLS_RTF_DFRSTOP "\\dfrstop"
+#define OOO_STRING_SVTOOLS_RTF_DFRXST "\\dfrxst"
+#define OOO_STRING_SVTOOLS_RTF_DGMARGIN "\\dgmargin"
+#define OOO_STRING_SVTOOLS_RTF_DNTBLNSBDB "\\dntblnsbdb"
+#define OOO_STRING_SVTOOLS_RTF_DOCTYPE "\\doctype"
+#define OOO_STRING_SVTOOLS_RTF_DOCVAR "\\docvar"
+#define OOO_STRING_SVTOOLS_RTF_DPCODESCENT "\\dpcodescent"
+#define OOO_STRING_SVTOOLS_RTF_EMBO "\\embo"
+#define OOO_STRING_SVTOOLS_RTF_EMFBLIP "\\emfblip"
+#define OOO_STRING_SVTOOLS_RTF_EXPSHRTN "\\expshrtn"
+#define OOO_STRING_SVTOOLS_RTF_FAAUTO "\\faauto"
+#define OOO_STRING_SVTOOLS_RTF_FBIAS "\\fbias"
+#define OOO_STRING_SVTOOLS_RTF_FFDEFRES "\\ffdefres"
+#define OOO_STRING_SVTOOLS_RTF_FFDEFTEXT "\\ffdeftext"
+#define OOO_STRING_SVTOOLS_RTF_FFENTRYMCR "\\ffentrymcr"
+#define OOO_STRING_SVTOOLS_RTF_FFEXITMCR "\\ffexitmcr"
+#define OOO_STRING_SVTOOLS_RTF_FFFORMAT "\\ffformat"
+#define OOO_STRING_SVTOOLS_RTF_FFHASLISTBOX "\\ffhaslistbox"
+#define OOO_STRING_SVTOOLS_RTF_FFHELPTEXT "\\ffhelptext"
+#define OOO_STRING_SVTOOLS_RTF_FFHPS "\\ffhps"
+#define OOO_STRING_SVTOOLS_RTF_FFL "\\ffl"
+#define OOO_STRING_SVTOOLS_RTF_FFMAXLEN "\\ffmaxlen"
+#define OOO_STRING_SVTOOLS_RTF_FFNAME "\\ffname"
+#define OOO_STRING_SVTOOLS_RTF_FFOWNHELP "\\ffownhelp"
+#define OOO_STRING_SVTOOLS_RTF_FFOWNSTAT "\\ffownstat"
+#define OOO_STRING_SVTOOLS_RTF_FFPROT "\\ffprot"
+#define OOO_STRING_SVTOOLS_RTF_FFRECALC "\\ffrecalc"
+#define OOO_STRING_SVTOOLS_RTF_FFRES "\\ffres"
+#define OOO_STRING_SVTOOLS_RTF_FFSIZE "\\ffsize"
+#define OOO_STRING_SVTOOLS_RTF_FFSTATTEXT "\\ffstattext"
+#define OOO_STRING_SVTOOLS_RTF_FFTYPE "\\fftype"
+#define OOO_STRING_SVTOOLS_RTF_FFTYPETXT "\\fftypetxt"
+#define OOO_STRING_SVTOOLS_RTF_FLDTYPE "\\fldtype"
+#define OOO_STRING_SVTOOLS_RTF_FNAME "\\fname"
+#define OOO_STRING_SVTOOLS_RTF_FORMFIELD "\\formfield"
+#define OOO_STRING_SVTOOLS_RTF_FROMTEXT "\\fromtext"
+#define OOO_STRING_SVTOOLS_RTF_FTNNCHOSUNG "\\ftnnchosung"
+#define OOO_STRING_SVTOOLS_RTF_FTNNCNUM "\\ftnncnum"
+#define OOO_STRING_SVTOOLS_RTF_FTNNDBAR "\\ftnndbar"
+#define OOO_STRING_SVTOOLS_RTF_FTNNDBNUM "\\ftnndbnum"
+#define OOO_STRING_SVTOOLS_RTF_FTNNDBNUMD "\\ftnndbnumd"
+#define OOO_STRING_SVTOOLS_RTF_FTNNDBNUMK "\\ftnndbnumk"
+#define OOO_STRING_SVTOOLS_RTF_FTNNDBNUMT "\\ftnndbnumt"
+#define OOO_STRING_SVTOOLS_RTF_FTNNGANADA "\\ftnnganada"
+#define OOO_STRING_SVTOOLS_RTF_FTNNGBNUM "\\ftnngbnum"
+#define OOO_STRING_SVTOOLS_RTF_FTNNGBNUMD "\\ftnngbnumd"
+#define OOO_STRING_SVTOOLS_RTF_FTNNGBNUMK "\\ftnngbnumk"
+#define OOO_STRING_SVTOOLS_RTF_FTNNGBNUML "\\ftnngbnuml"
+#define OOO_STRING_SVTOOLS_RTF_FTNNZODIAC "\\ftnnzodiac"
+#define OOO_STRING_SVTOOLS_RTF_FTNNZODIACD "\\ftnnzodiacd"
+#define OOO_STRING_SVTOOLS_RTF_FTNNZODIACL "\\ftnnzodiacl"
+#define OOO_STRING_SVTOOLS_RTF_G "\\g"
+#define OOO_STRING_SVTOOLS_RTF_GCW "\\gcw"
+#define OOO_STRING_SVTOOLS_RTF_GRIDTBL "\\gridtbl"
+#define OOO_STRING_SVTOOLS_RTF_HIGHLIGHT "\\highlight"
+#define OOO_STRING_SVTOOLS_RTF_HLFR "\\hlfr"
+#define OOO_STRING_SVTOOLS_RTF_HLINKBASE "\\hlinkbase"
+#define OOO_STRING_SVTOOLS_RTF_HLLOC "\\hlloc"
+#define OOO_STRING_SVTOOLS_RTF_HLSRC "\\hlsrc"
+#define OOO_STRING_SVTOOLS_RTF_ILVL "\\ilvl"
+#define OOO_STRING_SVTOOLS_RTF_IMPR "\\impr"
+#define OOO_STRING_SVTOOLS_RTF_JPEGBLIP "\\jpegblip"
+#define OOO_STRING_SVTOOLS_RTF_LEVELFOLLOW "\\levelfollow"
+#define OOO_STRING_SVTOOLS_RTF_LEVELINDENT "\\levelindent"
+#define OOO_STRING_SVTOOLS_RTF_LEVELJC "\\leveljc"
+#define OOO_STRING_SVTOOLS_RTF_LEVELLEGAL "\\levellegal"
+#define OOO_STRING_SVTOOLS_RTF_LEVELNFC "\\levelnfc"
+#define OOO_STRING_SVTOOLS_RTF_LEVELNORESTART "\\levelnorestart"
+#define OOO_STRING_SVTOOLS_RTF_LEVELNUMBERS "\\levelnumbers"
+#define OOO_STRING_SVTOOLS_RTF_LEVELOLD "\\levelold"
+#define OOO_STRING_SVTOOLS_RTF_LEVELPREV "\\levelprev"
+#define OOO_STRING_SVTOOLS_RTF_LEVELPREVSPACE "\\levelprevspace"
+#define OOO_STRING_SVTOOLS_RTF_LEVELSPACE "\\levelspace"
+#define OOO_STRING_SVTOOLS_RTF_LEVELSTARTAT "\\levelstartat"
+#define OOO_STRING_SVTOOLS_RTF_LEVELTEXT "\\leveltext"
+#define OOO_STRING_SVTOOLS_RTF_LINKVAL "\\linkval"
+#define OOO_STRING_SVTOOLS_RTF_LIST "\\list"
+#define OOO_STRING_SVTOOLS_RTF_LISTID "\\listid"
+#define OOO_STRING_SVTOOLS_RTF_LISTLEVEL "\\listlevel"
+#define OOO_STRING_SVTOOLS_RTF_LISTNAME "\\listname"
+#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDE "\\listoverride"
+#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDECOUNT "\\listoverridecount"
+#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDEFORMAT "\\listoverrideformat"
+#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDESTART "\\listoverridestart"
+#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDETABLE "\\listoverridetable"
+#define OOO_STRING_SVTOOLS_RTF_LISTRESTARTHDN "\\listrestarthdn"
+#define OOO_STRING_SVTOOLS_RTF_LISTSIMPLE "\\listsimple"
+#define OOO_STRING_SVTOOLS_RTF_LISTTABLE "\\listtable"
+#define OOO_STRING_SVTOOLS_RTF_LISTTEMPLATEID "\\listtemplateid"
+#define OOO_STRING_SVTOOLS_RTF_LISTTEXT "\\listtext"
+#define OOO_STRING_SVTOOLS_RTF_LS "\\ls"
+#define OOO_STRING_SVTOOLS_RTF_LYTEXCTTP "\\lytexcttp"
+#define OOO_STRING_SVTOOLS_RTF_LYTPRTMET "\\lytprtmet"
+#define OOO_STRING_SVTOOLS_RTF_MANAGER "\\manager"
+#define OOO_STRING_SVTOOLS_RTF_MSMCAP "\\msmcap"
+#define OOO_STRING_SVTOOLS_RTF_NOFCHARSWS "\\nofcharsws"
+#define OOO_STRING_SVTOOLS_RTF_NOLEAD "\\nolead"
+#define OOO_STRING_SVTOOLS_RTF_NONSHPPICT "\\nonshppict"
+#define OOO_STRING_SVTOOLS_RTF_NOSECTEXPAND "\\nosectexpand"
+#define OOO_STRING_SVTOOLS_RTF_NOSNAPLINEGRID "\\nosnaplinegrid"
+#define OOO_STRING_SVTOOLS_RTF_NOSPACEFORUL "\\nospaceforul"
+#define OOO_STRING_SVTOOLS_RTF_NOULTRLSPC "\\noultrlspc"
+#define OOO_STRING_SVTOOLS_RTF_NOXLATTOYEN "\\noxlattoyen"
+#define OOO_STRING_SVTOOLS_RTF_OBJATTPH "\\objattph"
+#define OOO_STRING_SVTOOLS_RTF_OBJHTML "\\objhtml"
+#define OOO_STRING_SVTOOLS_RTF_OBJOCX "\\objocx"
+#define OOO_STRING_SVTOOLS_RTF_OLDLINEWRAP "\\oldlinewrap"
+#define OOO_STRING_SVTOOLS_RTF_OUTLINELEVEL "\\outlinelevel"
+#define OOO_STRING_SVTOOLS_RTF_OVERLAY "\\overlay"
+#define OOO_STRING_SVTOOLS_RTF_PANOSE "\\panose"
+#define OOO_STRING_SVTOOLS_RTF_PGBRDRB "\\pgbrdrb"
+#define OOO_STRING_SVTOOLS_RTF_PGBRDRFOOT "\\pgbrdrfoot"
+#define OOO_STRING_SVTOOLS_RTF_PGBRDRHEAD "\\pgbrdrhead"
+#define OOO_STRING_SVTOOLS_RTF_PGBRDRL "\\pgbrdrl"
+#define OOO_STRING_SVTOOLS_RTF_PGBRDROPT "\\pgbrdropt"
+#define OOO_STRING_SVTOOLS_RTF_PGBRDRR "\\pgbrdrr"
+#define OOO_STRING_SVTOOLS_RTF_PGBRDRSNAP "\\pgbrdrsnap"
+#define OOO_STRING_SVTOOLS_RTF_PGBRDRT "\\pgbrdrt"
+#define OOO_STRING_SVTOOLS_RTF_PGNCHOSUNG "\\pgnchosung"
+#define OOO_STRING_SVTOOLS_RTF_PGNCNUM "\\pgncnum"
+#define OOO_STRING_SVTOOLS_RTF_PGNDBNUMK "\\pgndbnumk"
+#define OOO_STRING_SVTOOLS_RTF_PGNDBNUMT "\\pgndbnumt"
+#define OOO_STRING_SVTOOLS_RTF_PGNGANADA "\\pgnganada"
+#define OOO_STRING_SVTOOLS_RTF_PGNGBNUM "\\pgngbnum"
+#define OOO_STRING_SVTOOLS_RTF_PGNGBNUMD "\\pgngbnumd"
+#define OOO_STRING_SVTOOLS_RTF_PGNGBNUMK "\\pgngbnumk"
+#define OOO_STRING_SVTOOLS_RTF_PGNGBNUML "\\pgngbnuml"
+#define OOO_STRING_SVTOOLS_RTF_PGNZODIAC "\\pgnzodiac"
+#define OOO_STRING_SVTOOLS_RTF_PGNZODIACD "\\pgnzodiacd"
+#define OOO_STRING_SVTOOLS_RTF_PGNZODIACL "\\pgnzodiacl"
+#define OOO_STRING_SVTOOLS_RTF_PICPROP "\\picprop"
+#define OOO_STRING_SVTOOLS_RTF_PNAIUEO "\\pnaiueo"
+#define OOO_STRING_SVTOOLS_RTF_PNAIUEOD "\\pnaiueod"
+#define OOO_STRING_SVTOOLS_RTF_PNCHOSUNG "\\pnchosung"
+#define OOO_STRING_SVTOOLS_RTF_PNDBNUMD "\\pndbnumd"
+#define OOO_STRING_SVTOOLS_RTF_PNDBNUMK "\\pndbnumk"
+#define OOO_STRING_SVTOOLS_RTF_PNDBNUML "\\pndbnuml"
+#define OOO_STRING_SVTOOLS_RTF_PNDBNUMT "\\pndbnumt"
+#define OOO_STRING_SVTOOLS_RTF_PNGANADA "\\pnganada"
+#define OOO_STRING_SVTOOLS_RTF_PNGBLIP "\\pngblip"
+#define OOO_STRING_SVTOOLS_RTF_PNGBNUM "\\pngbnum"
+#define OOO_STRING_SVTOOLS_RTF_PNGBNUMD "\\pngbnumd"
+#define OOO_STRING_SVTOOLS_RTF_PNGBNUMK "\\pngbnumk"
+#define OOO_STRING_SVTOOLS_RTF_PNGBNUML "\\pngbnuml"
+#define OOO_STRING_SVTOOLS_RTF_PNRAUTH "\\pnrauth"
+#define OOO_STRING_SVTOOLS_RTF_PNRDATE "\\pnrdate"
+#define OOO_STRING_SVTOOLS_RTF_PNRNFC "\\pnrnfc"
+#define OOO_STRING_SVTOOLS_RTF_PNRNOT "\\pnrnot"
+#define OOO_STRING_SVTOOLS_RTF_PNRPNBR "\\pnrpnbr"
+#define OOO_STRING_SVTOOLS_RTF_PNRRGB "\\pnrrgb"
+#define OOO_STRING_SVTOOLS_RTF_PNRSTART "\\pnrstart"
+#define OOO_STRING_SVTOOLS_RTF_PNRSTOP "\\pnrstop"
+#define OOO_STRING_SVTOOLS_RTF_PNRXST "\\pnrxst"
+#define OOO_STRING_SVTOOLS_RTF_PNZODIAC "\\pnzodiac"
+#define OOO_STRING_SVTOOLS_RTF_PNZODIACD "\\pnzodiacd"
+#define OOO_STRING_SVTOOLS_RTF_PNZODIACL "\\pnzodiacl"
+#define OOO_STRING_SVTOOLS_RTF_LFOLEVEL "\\lfolevel"
+#define OOO_STRING_SVTOOLS_RTF_POSYIN "\\posyin"
+#define OOO_STRING_SVTOOLS_RTF_POSYOUT "\\posyout"
+#define OOO_STRING_SVTOOLS_RTF_PRIVATE "\\private"
+#define OOO_STRING_SVTOOLS_RTF_PROPNAME "\\propname"
+#define OOO_STRING_SVTOOLS_RTF_PROPTYPE "\\proptype"
+#define OOO_STRING_SVTOOLS_RTF_REVAUTHDEL "\\revauthdel"
+#define OOO_STRING_SVTOOLS_RTF_REVDTTMDEL "\\revdttmdel"
+#define OOO_STRING_SVTOOLS_RTF_SAUTOUPD "\\sautoupd"
+#define OOO_STRING_SVTOOLS_RTF_SECTDEFAULTCL "\\sectdefaultcl"
+#define OOO_STRING_SVTOOLS_RTF_SECTEXPAND "\\sectexpand"
+#define OOO_STRING_SVTOOLS_RTF_SECTLINEGRID "\\sectlinegrid"
+#define OOO_STRING_SVTOOLS_RTF_SECTSPECIFYCL "\\sectspecifycl"
+#define OOO_STRING_SVTOOLS_RTF_SECTSPECIFYL "\\sectspecifyl"
+#define OOO_STRING_SVTOOLS_RTF_SHIDDEN "\\shidden"
+#define OOO_STRING_SVTOOLS_RTF_SHPBOTTOM "\\shpbottom"
+#define OOO_STRING_SVTOOLS_RTF_SHPBXCOLUMN "\\shpbxcolumn"
+#define OOO_STRING_SVTOOLS_RTF_SHPBXMARGIN "\\shpbxmargin"
+#define OOO_STRING_SVTOOLS_RTF_SHPBXPAGE "\\shpbxpage"
+#define OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE "\\shpbxignore"
+#define OOO_STRING_SVTOOLS_RTF_SHPBYMARGIN "\\shpbymargin"
+#define OOO_STRING_SVTOOLS_RTF_SHPBYPAGE "\\shpbypage"
+#define OOO_STRING_SVTOOLS_RTF_SHPBYPARA "\\shpbypara"
+#define OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE "\\shpbyignore"
+#define OOO_STRING_SVTOOLS_RTF_SHPFBLWTXT "\\shpfblwtxt"
+#define OOO_STRING_SVTOOLS_RTF_SHPFHDR "\\shpfhdr"
+#define OOO_STRING_SVTOOLS_RTF_SHPGRP "\\shpgrp"
+#define OOO_STRING_SVTOOLS_RTF_SHPINST "\\shpinst"
+#define OOO_STRING_SVTOOLS_RTF_SHPLEFT "\\shpleft"
+#define OOO_STRING_SVTOOLS_RTF_SHPLID "\\shplid"
+#define OOO_STRING_SVTOOLS_RTF_SHPLOCKANCHOR "\\shplockanchor"
+#define OOO_STRING_SVTOOLS_RTF_SHPPICT "\\shppict"
+#define OOO_STRING_SVTOOLS_RTF_SHPRIGHT "\\shpright"
+#define OOO_STRING_SVTOOLS_RTF_SHPRSLT "\\shprslt"
+#define OOO_STRING_SVTOOLS_RTF_SHPTOP "\\shptop"
+#define OOO_STRING_SVTOOLS_RTF_SHPTXT "\\shptxt"
+#define OOO_STRING_SVTOOLS_RTF_SHPWRK "\\shpwrk"
+#define OOO_STRING_SVTOOLS_RTF_SHPWR "\\shpwr"
+#define OOO_STRING_SVTOOLS_RTF_SHPZ "\\shpz"
+#define OOO_STRING_SVTOOLS_RTF_SP "\\sp"
+#define OOO_STRING_SVTOOLS_RTF_SPRSBSP "\\sprsbsp"
+#define OOO_STRING_SVTOOLS_RTF_SPRSLNSP "\\sprslnsp"
+#define OOO_STRING_SVTOOLS_RTF_SPRSTSM "\\sprstsm"
+#define OOO_STRING_SVTOOLS_RTF_STATICVAL "\\staticval"
+#define OOO_STRING_SVTOOLS_RTF_STEXTFLOW "\\stextflow"
+#define OOO_STRING_SVTOOLS_RTF_STRIKED "\\striked"
+#define OOO_STRING_SVTOOLS_RTF_SUBFONTBYSIZE "\\subfontbysize"
+#define OOO_STRING_SVTOOLS_RTF_TCELLD "\\tcelld"
+#define OOO_STRING_SVTOOLS_RTF_TIME "\\time"
+#define OOO_STRING_SVTOOLS_RTF_TRUNCATEFONTHEIGHT "\\truncatefontheight"
+#define OOO_STRING_SVTOOLS_RTF_UC "\\uc"
+#define OOO_STRING_SVTOOLS_RTF_UD "\\ud"
+#define OOO_STRING_SVTOOLS_RTF_ULDASH "\\uldash"
+#define OOO_STRING_SVTOOLS_RTF_ULDASHD "\\uldashd"
+#define OOO_STRING_SVTOOLS_RTF_ULDASHDD "\\uldashdd"
+#define OOO_STRING_SVTOOLS_RTF_ULTH "\\ulth"
+#define OOO_STRING_SVTOOLS_RTF_ULWAVE "\\ulwave"
+#define OOO_STRING_SVTOOLS_RTF_ULC "\\ulc"
+#define OOO_STRING_SVTOOLS_RTF_U "\\u"
+#define OOO_STRING_SVTOOLS_RTF_UPR "\\upr"
+#define OOO_STRING_SVTOOLS_RTF_USERPROPS "\\userprops"
+#define OOO_STRING_SVTOOLS_RTF_VIEWKIND "\\viewkind"
+#define OOO_STRING_SVTOOLS_RTF_VIEWSCALE "\\viewscale"
+#define OOO_STRING_SVTOOLS_RTF_VIEWZK "\\viewzk"
+#define OOO_STRING_SVTOOLS_RTF_WIDCTLPAR "\\widctlpar"
+#define OOO_STRING_SVTOOLS_RTF_WINDOWCAPTION "\\windowcaption"
+#define OOO_STRING_SVTOOLS_RTF_WPEQN "\\wpeqn"
+#define OOO_STRING_SVTOOLS_RTF_WPJST "\\wpjst"
+#define OOO_STRING_SVTOOLS_RTF_WPSP "\\wpsp"
+#define OOO_STRING_SVTOOLS_RTF_YXE "\\yxe"
+#define OOO_STRING_SVTOOLS_RTF_FRMTXLRTB "\\frmtxlrtb"
+#define OOO_STRING_SVTOOLS_RTF_FRMTXTBRL "\\frmtxtbrl"
+#define OOO_STRING_SVTOOLS_RTF_FRMTXBTLR "\\frmtxbtlr"
+#define OOO_STRING_SVTOOLS_RTF_FRMTXLRTBV "\\frmtxlrtbv"
+#define OOO_STRING_SVTOOLS_RTF_FRMTXTBRLV "\\frmtxtbrlv"
+
+// MS-2000 Tokens
+#define OOO_STRING_SVTOOLS_RTF_ULTHD "\\ulthd"
+#define OOO_STRING_SVTOOLS_RTF_ULTHDASH "\\ulthdash"
+#define OOO_STRING_SVTOOLS_RTF_ULLDASH "\\ulldash"
+#define OOO_STRING_SVTOOLS_RTF_ULTHLDASH "\\ulthldash"
+#define OOO_STRING_SVTOOLS_RTF_ULTHDASHD "\\ulthdashd"
+#define OOO_STRING_SVTOOLS_RTF_ULTHDASHDD "\\ulthdashdd"
+#define OOO_STRING_SVTOOLS_RTF_ULHWAVE "\\ulhwave"
+#define OOO_STRING_SVTOOLS_RTF_ULULDBWAVE "\\ululdbwave"
+#define OOO_STRING_SVTOOLS_RTF_LOCH "\\loch"
+#define OOO_STRING_SVTOOLS_RTF_HICH "\\hich"
+#define OOO_STRING_SVTOOLS_RTF_DBCH "\\dbch"
+#define OOO_STRING_SVTOOLS_RTF_LANGFE "\\langfe"
+#define OOO_STRING_SVTOOLS_RTF_ADEFLANG "\\adeflang"
+#define OOO_STRING_SVTOOLS_RTF_ADEFF "\\adeff"
+#define OOO_STRING_SVTOOLS_RTF_ACCNONE "\\accnone"
+#define OOO_STRING_SVTOOLS_RTF_ACCDOT "\\accdot"
+#define OOO_STRING_SVTOOLS_RTF_ACCCOMMA "\\acccomma"
+#define OOO_STRING_SVTOOLS_RTF_TWOINONE "\\twoinone"
+#define OOO_STRING_SVTOOLS_RTF_HORZVERT "\\horzvert"
+#define OOO_STRING_SVTOOLS_RTF_FAHANG "\\fahang"
+#define OOO_STRING_SVTOOLS_RTF_FAVAR "\\favar"
+#define OOO_STRING_SVTOOLS_RTF_FACENTER "\\facenter"
+#define OOO_STRING_SVTOOLS_RTF_FAROMAN "\\faroman"
+#define OOO_STRING_SVTOOLS_RTF_FAFIXED "\\fafixed"
+#define OOO_STRING_SVTOOLS_RTF_NOCWRAP "\\nocwrap"
+#define OOO_STRING_SVTOOLS_RTF_NOOVERFLOW "\\nooverflow"
+#define OOO_STRING_SVTOOLS_RTF_ASPALPHA "\\aspalpha"
+
+// SWG spezifische Attribute
+#define OOO_STRING_SVTOOLS_RTF_GRFALIGNV "\\grfalignv"
+#define OOO_STRING_SVTOOLS_RTF_GRFALIGNH "\\grfalignh"
+#define OOO_STRING_SVTOOLS_RTF_GRFMIRROR "\\grfmirror"
+#define OOO_STRING_SVTOOLS_RTF_HEADERYB "\\headeryb"
+#define OOO_STRING_SVTOOLS_RTF_HEADERXL "\\headerxl"
+#define OOO_STRING_SVTOOLS_RTF_HEADERXR "\\headerxr"
+#define OOO_STRING_SVTOOLS_RTF_FOOTERYT "\\footeryt"
+#define OOO_STRING_SVTOOLS_RTF_FOOTERXL "\\footerxl"
+#define OOO_STRING_SVTOOLS_RTF_FOOTERXR "\\footerxr"
+#define OOO_STRING_SVTOOLS_RTF_HEADERYH "\\headeryh"
+#define OOO_STRING_SVTOOLS_RTF_FOOTERYH "\\footeryh"
+#define OOO_STRING_SVTOOLS_RTF_BALANCEDCOLUMN "\\swcolmnblnc"
+#define OOO_STRING_SVTOOLS_RTF_UPDNPROP "\\updnprop"
+#define OOO_STRING_SVTOOLS_RTF_PRTDATA "\\prtdata"
+#define OOO_STRING_SVTOOLS_RTF_BKMKKEY "\\bkmkkey"
+
+// Attribute fuer die freifliegenden Rahmen
+#define OOO_STRING_SVTOOLS_RTF_FLYPRINT "\\flyprint"
+#define OOO_STRING_SVTOOLS_RTF_FLYOPAQUE "\\flyopaque"
+#define OOO_STRING_SVTOOLS_RTF_FLYPRTCTD "\\flyprtctd"
+#define OOO_STRING_SVTOOLS_RTF_FLYMAINCNT "\\flymaincnt"
+#define OOO_STRING_SVTOOLS_RTF_FLYVERT "\\flyvert"
+#define OOO_STRING_SVTOOLS_RTF_FLYHORZ "\\flyhorz"
+#define OOO_STRING_SVTOOLS_RTF_DFRMTXTL "\\dfrmtxtl"
+#define OOO_STRING_SVTOOLS_RTF_DFRMTXTR "\\dfrmtxtr"
+#define OOO_STRING_SVTOOLS_RTF_DFRMTXTU "\\dfrmtxtu"
+#define OOO_STRING_SVTOOLS_RTF_DFRMTXTW "\\dfrmtxtw"
+#define OOO_STRING_SVTOOLS_RTF_FLYANCHOR "\\flyanchor"
+#define OOO_STRING_SVTOOLS_RTF_FLYCNTNT "\\flycntnt"
+#define OOO_STRING_SVTOOLS_RTF_FLYCOLUMN "\\flycolumn"
+#define OOO_STRING_SVTOOLS_RTF_FLYPAGE "\\flypage"
+#define OOO_STRING_SVTOOLS_RTF_FLYINPARA "\\flyinpara"
+#define OOO_STRING_SVTOOLS_RTF_BRDBOX "\\brdbox"
+#define OOO_STRING_SVTOOLS_RTF_BRDLNCOL "\\brdlncol"
+#define OOO_STRING_SVTOOLS_RTF_BRDLNIN "\\brdlnin"
+#define OOO_STRING_SVTOOLS_RTF_BRDLNOUT "\\brdlnout"
+#define OOO_STRING_SVTOOLS_RTF_BRDLNDIST "\\brdlndist"
+#define OOO_STRING_SVTOOLS_RTF_SHADOW "\\shadow"
+#define OOO_STRING_SVTOOLS_RTF_SHDWDIST "\\shdwdist"
+#define OOO_STRING_SVTOOLS_RTF_SHDWSTYLE "\\shdwstyle"
+#define OOO_STRING_SVTOOLS_RTF_SHDWCOL "\\shdwcol"
+#define OOO_STRING_SVTOOLS_RTF_SHDWFCOL "\\shdwfcol"
+#define OOO_STRING_SVTOOLS_RTF_PGDSCTBL "\\pgdsctbl"
+#define OOO_STRING_SVTOOLS_RTF_PGDSC "\\pgdsc"
+#define OOO_STRING_SVTOOLS_RTF_PGDSCUSE "\\pgdscuse"
+#define OOO_STRING_SVTOOLS_RTF_PGDSCNXT "\\pgdscnxt"
+#define OOO_STRING_SVTOOLS_RTF_HYPHEN "\\hyphen"
+#define OOO_STRING_SVTOOLS_RTF_HYPHLEAD "\\hyphlead"
+#define OOO_STRING_SVTOOLS_RTF_HYPHTRAIL "\\hyphtrail"
+#define OOO_STRING_SVTOOLS_RTF_HYPHMAX "\\hyphmax"
+#define OOO_STRING_SVTOOLS_RTF_TLSWG "\\tlswg"
+#define OOO_STRING_SVTOOLS_RTF_PGBRK "\\pgbrk"
+#define OOO_STRING_SVTOOLS_RTF_PGDSCNO "\\pgdscno"
+#define OOO_STRING_SVTOOLS_RTF_SOUTLVL "\\soutlvl"
+#define OOO_STRING_SVTOOLS_RTF_SHP "\\shp"
+#define OOO_STRING_SVTOOLS_RTF_SN "\\sn"
+#define OOO_STRING_SVTOOLS_RTF_SV "\\sv"
+#define OOO_STRING_SVTOOLS_RTF_SP "\\sp"
+
+// Support for overline attributes
+#define OOO_STRING_SVTOOLS_RTF_OL "\\ol"
+#define OOO_STRING_SVTOOLS_RTF_OLD "\\old"
+#define OOO_STRING_SVTOOLS_RTF_OLDB "\\oldb"
+#define OOO_STRING_SVTOOLS_RTF_OLNONE "\\olnone"
+#define OOO_STRING_SVTOOLS_RTF_OLW "\\olw"
+#define OOO_STRING_SVTOOLS_RTF_OLDASH "\\oldash"
+#define OOO_STRING_SVTOOLS_RTF_OLDASHD "\\oldashd"
+#define OOO_STRING_SVTOOLS_RTF_OLDASHDD "\\oldashdd"
+#define OOO_STRING_SVTOOLS_RTF_OLTH "\\olth"
+#define OOO_STRING_SVTOOLS_RTF_OLWAVE "\\olwave"
+#define OOO_STRING_SVTOOLS_RTF_OLC "\\olc"
+#define OOO_STRING_SVTOOLS_RTF_OLTHD "\\olthd"
+#define OOO_STRING_SVTOOLS_RTF_OLTHDASH "\\olthdash"
+#define OOO_STRING_SVTOOLS_RTF_OLLDASH "\\olldash"
+#define OOO_STRING_SVTOOLS_RTF_OLTHLDASH "\\olthldash"
+#define OOO_STRING_SVTOOLS_RTF_OLTHDASHD "\\olthdashd"
+#define OOO_STRING_SVTOOLS_RTF_OLTHDASHDD "\\olthdashdd"
+#define OOO_STRING_SVTOOLS_RTF_OLHWAVE "\\olhwave"
+#define OOO_STRING_SVTOOLS_RTF_OLOLDBWAVE "\\ololdbwave"
+
+// Support for nested tables
+#define OOO_STRING_SVTOOLS_RTF_ITAP "\\itap"
+#define OOO_STRING_SVTOOLS_RTF_NESTCELL "\\nestcell"
+#define OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS "\\nesttableprops"
+#define OOO_STRING_SVTOOLS_RTF_NESTROW "\\nestrow"
+#define OOO_STRING_SVTOOLS_RTF_NONESTTABLES "\\nonesttables"
+
+// Math
+#define LO_STRING_SVTOOLS_RTF_MACC "\\macc"
+#define LO_STRING_SVTOOLS_RTF_MACCPR "\\maccPr"
+#define LO_STRING_SVTOOLS_RTF_MBAR "\\mbar"
+#define LO_STRING_SVTOOLS_RTF_MBARPR "\\mbarPr"
+#define LO_STRING_SVTOOLS_RTF_MBEGCHR "\\mbegChr"
+#define LO_STRING_SVTOOLS_RTF_MBORDERBOX "\\mborderBox"
+#define LO_STRING_SVTOOLS_RTF_MBORDERBOXPR "\\mborderBoxPr"
+#define LO_STRING_SVTOOLS_RTF_MCHR "\\mchr"
+#define LO_STRING_SVTOOLS_RTF_MDEGHIDE "\\mdegHide"
+#define LO_STRING_SVTOOLS_RTF_MDEG "\\mdeg"
+#define LO_STRING_SVTOOLS_RTF_MDEN "\\mden"
+#define LO_STRING_SVTOOLS_RTF_MD "\\md"
+#define LO_STRING_SVTOOLS_RTF_MDPR "\\mdPr"
+#define LO_STRING_SVTOOLS_RTF_ME "\\me"
+#define LO_STRING_SVTOOLS_RTF_MENDCHR "\\mendChr"
+#define LO_STRING_SVTOOLS_RTF_MEQARR "\\meqArr"
+#define LO_STRING_SVTOOLS_RTF_MF "\\mf"
+#define LO_STRING_SVTOOLS_RTF_MFNAME "\\mfName"
+#define LO_STRING_SVTOOLS_RTF_MFPR "\\mfPr"
+#define LO_STRING_SVTOOLS_RTF_MFUNC "\\mfunc"
+#define LO_STRING_SVTOOLS_RTF_MGROUPCHR "\\mgroupChr"
+#define LO_STRING_SVTOOLS_RTF_MGROUPCHRPR "\\mgroupChrPr"
+#define LO_STRING_SVTOOLS_RTF_MHIDEBOT "\\mhideBot"
+#define LO_STRING_SVTOOLS_RTF_MHIDELEFT "\\mhideLeft"
+#define LO_STRING_SVTOOLS_RTF_MHIDERIGHT "\\mhideRight"
+#define LO_STRING_SVTOOLS_RTF_MHIDETOP "\\mhideTop"
+#define LO_STRING_SVTOOLS_RTF_MLIMLOW "\\mlimLow"
+#define LO_STRING_SVTOOLS_RTF_MLIM "\\mlim"
+#define LO_STRING_SVTOOLS_RTF_MLIMUPP "\\mlimUpp"
+#define LO_STRING_SVTOOLS_RTF_MM "\\mm"
+#define LO_STRING_SVTOOLS_RTF_MMR "\\mmr"
+#define LO_STRING_SVTOOLS_RTF_MNARY "\\mnary"
+#define LO_STRING_SVTOOLS_RTF_MNARYPR "\\mnaryPr"
+#define LO_STRING_SVTOOLS_RTF_MNUM "\\mnum"
+#define LO_STRING_SVTOOLS_RTF_MOMATH "\\moMath"
+#define LO_STRING_SVTOOLS_RTF_MPOS "\\mpos"
+#define LO_STRING_SVTOOLS_RTF_MRAD "\\mrad"
+#define LO_STRING_SVTOOLS_RTF_MRADPR "\\mradPr"
+#define LO_STRING_SVTOOLS_RTF_MR "\\mr"
+#define LO_STRING_SVTOOLS_RTF_MSEPCHR "\\msepChr"
+#define LO_STRING_SVTOOLS_RTF_MSPRE "\\msPre"
+#define LO_STRING_SVTOOLS_RTF_MSSUB "\\msSub"
+#define LO_STRING_SVTOOLS_RTF_MSSUBSUP "\\msSubSup"
+#define LO_STRING_SVTOOLS_RTF_MSSUP "\\msSup"
+#define LO_STRING_SVTOOLS_RTF_MSTRIKEH "\\mstrikeH"
+#define LO_STRING_SVTOOLS_RTF_MSUBHIDE "\\msubHide"
+#define LO_STRING_SVTOOLS_RTF_MSUB "\\msub"
+#define LO_STRING_SVTOOLS_RTF_MSUPHIDE "\\msupHide"
+#define LO_STRING_SVTOOLS_RTF_MSUP "\\msup"
+#define LO_STRING_SVTOOLS_RTF_MTYPE "\\mtype"
+#define LO_STRING_SVTOOLS_RTF_MVERTJC "\\mvertJc"
+#define LO_STRING_SVTOOLS_RTF_MMATH "\\mmath"
+#define LO_STRING_SVTOOLS_RTF_MMATHPICT "\\mmathPict"
+#define LO_STRING_SVTOOLS_RTF_MNOR "\\mnor"
+#define LO_STRING_SVTOOLS_RTF_LISTPICTURE "\\listpicture"
+#define LO_STRING_SVTOOLS_RTF_LEVELPICTURE "\\levelpicture"
+
+#endif // _RTFKEYWD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/rtfout.hxx b/include/svtools/rtfout.hxx
new file mode 100644
index 000000000000..9910d8e8115d
--- /dev/null
+++ b/include/svtools/rtfout.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 _RTFOUT_HXX
+#define _RTFOUT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/solar.h>
+
+#include <rtl/textenc.h>
+
+class String;
+class SvStream;
+
+class SVT_DLLPUBLIC RTFOutFuncs
+{
+public:
+#if defined(UNX)
+ static const sal_Char sNewLine; // nur \012 oder \015
+#else
+ static const sal_Char sNewLine[]; // \015\012
+#endif
+
+ static SvStream& Out_Char( SvStream&, sal_Unicode cChar,
+ int *pUCMode,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ sal_Bool bWriteHelpFile = sal_False );
+ static SvStream& Out_String( SvStream&, const String&,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ sal_Bool bWriteHelpFile = sal_False );
+ static SvStream& Out_Fontname( SvStream&, const String&,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ sal_Bool bWriteHelpFile = sal_False );
+
+ static SvStream& Out_Hex( SvStream&, sal_uLong nHex, sal_uInt8 nLen );
+};
+
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/rtftoken.h b/include/svtools/rtftoken.h
new file mode 100644
index 000000000000..9a1e3dff167c
--- /dev/null
+++ b/include/svtools/rtftoken.h
@@ -0,0 +1,1265 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _RTFTOKEN_H
+#define _RTFTOKEN_H
+
+class String;
+
+// suche die TokenID zu dem Token
+int GetRTFToken( const String& rSearch );
+
+enum RTF_TOKEN_RANGES {
+ RTF_NOGROUP = 0x0100,
+ RTF_DOCFMT = 0x0200,
+ RTF_SECTFMT = 0x0300,
+ RTF_PARFMT = 0x0400,
+ RTF_TABSTOPDEF = 0x0500,
+ RTF_BRDRDEF = 0x0600,
+ RTF_CHRFMT = 0x0700,
+ RTF_SPECCHAR = 0x0800,
+ RTF_APOCTL = 0x0900,
+ RTF_SHADINGDEF = 0x0A00,
+ // free = 0x0B00,
+ RTF_DRAWOBJECTS = 0x0C00,
+ RTF_OBJECTS = 0x0D00,
+ RTF_NUMBULLETS = 0x0E00,
+
+ // !!! kann hinein verodert werden (Border/Background) !!!!
+ RTF_TABLEDEF = 0x1000,
+
+ // !!! kann hinein verodert werden (Border/Tab) !!!!
+ RTF_SWGDEFS = 0x4000
+};
+
+enum RTF_TOKEN_IDS {
+
+ RTF_TEXTTOKEN = RTF_NOGROUP,
+ RTF_SINGLECHAR,
+ RTF_UNKNOWNCONTROL,
+ RTF_UNKNOWNDATA,
+
+ RTF_RTF,
+ RTF_ANSITYPE,
+ RTF_MACTYPE,
+ RTF_PCTYPE,
+ RTF_PCATYPE,
+ RTF_NEXTTYPE,
+
+ RTF_STYLESHEET,
+ RTF_SBASEDON,
+ RTF_SNEXT,
+ RTF_SHIDDEN,
+ RTF_SAUTOUPD,
+
+ RTF_KEYCODE,
+ RTF_FNKEY,
+ RTF_ALTKEY,
+ RTF_SHIFTKEY,
+ RTF_CTRLKEY,
+
+ RTF_FONTTBL,
+ RTF_DEFF,
+ RTF_FNIL,
+ RTF_FROMAN,
+ RTF_FSWISS,
+ RTF_FMODERN,
+ RTF_FSCRIPT,
+ RTF_FDECOR,
+ RTF_FTECH,
+
+ RTF_COLORTBL,
+ RTF_RED,
+ RTF_GREEN,
+ RTF_BLUE,
+
+ RTF_INFO,
+ RTF_TITLE,
+ RTF_SUBJECT,
+ RTF_AUTHOR,
+ RTF_OPERATOR,
+ RTF_KEYWORDS,
+ RTF_COMMENT,
+ RTF_VERSION,
+ RTF_DOCCOMM,
+ RTF_VERN,
+ RTF_CREATIM,
+ RTF_REVTIM,
+ RTF_PRINTIM,
+ RTF_BUPTIM,
+ RTF_EDMINS,
+ RTF_NOFPAGES,
+ RTF_NOFWORDS,
+ RTF_NOFCHARS,
+ RTF_ID,
+ RTF_YR,
+ RTF_MO,
+ RTF_DY,
+ RTF_HR,
+ RTF_MIN,
+ RTF_USERPROPS,
+ RTF_CATEGORY,
+ RTF_COMPANY,
+ RTF_MANAGER,
+ RTF_PROPNAME,
+ RTF_LINKVAL,
+ RTF_NOFCHARSWS,
+ RTF_HLINKBASE,
+ RTF_STATICVAL,
+ RTF_PROPTYPE,
+
+ RTF_ANNOTATION,
+ RTF_ATNID,
+
+ RTF_FOOTNOTE,
+
+ RTF_XE,
+ RTF_BXE,
+ RTF_IXE,
+ RTF_RXE,
+ RTF_TXE,
+ RTF_YXE,
+
+ RTF_TC,
+ RTF_TCF,
+ RTF_TCL,
+
+ RTF_BKMKSTART,
+ RTF_BKMKEND,
+
+ RTF_PICT, // Bitmaps
+ RTF_PICW,
+ RTF_PICH,
+ RTF_WBMBITSPIXEL,
+ RTF_WBMPLANES,
+ RTF_WBMWIDTHBYTES,
+ RTF_PICWGOAL,
+ RTF_PICHGOAL,
+ RTF_BIN,
+ RTF_PICSCALEX,
+ RTF_PICSCALEY,
+ RTF_PICSCALED,
+ RTF_WBITMAP,
+ RTF_WMETAFILE,
+ RTF_MACPICT,
+ RTF_OSMETAFILE,
+ RTF_DIBITMAP,
+ RTF_PICCROPT,
+ RTF_PICCROPB,
+ RTF_PICCROPL,
+ RTF_PICCROPR,
+ RTF_PICDATA,
+ RTF_PICBMP,
+ RTF_PICBPP,
+ RTF_PICPROP,
+ RTF_SHPPICT,
+ RTF_EMFBLIP,
+ RTF_PNGBLIP,
+ RTF_JPEGBLIP,
+ RTF_NONSHPPICT,
+ RTF_BLIPTAG,
+ RTF_BLIPUID,
+ RTF_BLIPUPI,
+
+ RTF_FIELD, // Felder
+ RTF_FLDDIRTY,
+ RTF_FLDEDIT,
+ RTF_FLDLOCK,
+ RTF_FLDPRIV,
+ RTF_FLDINST,
+ RTF_FLDRSLT,
+ RTF_FLDTYPE,
+ RTF_TIME,
+ RTF_DATE,
+ RTF_WPEQN,
+
+ RTF_NOLINE,
+ RTF_REVISED,
+
+ RTF_BKMKCOLF,
+ RTF_BKMKCOLL,
+ RTF_PSOVER,
+ RTF_DOCTEMP,
+ RTF_DELETED,
+
+ RTF_FCHARSET,
+ RTF_FALT,
+ RTF_FPRQ,
+ RTF_PANOSE,
+ RTF_FNAME,
+ RTF_FBIAS,
+
+ RTF_ADDITIVE,
+ RTF_BKMKPUB,
+ RTF_CPG,
+ RTF_DATAFIELD,
+
+ RTF_FBIDI,
+ RTF_FID,
+ RTF_FILE,
+ RTF_FILETBL,
+ RTF_FNETWORK,
+ RTF_FONTEMB,
+ RTF_FONTFILE,
+ RTF_FOSNUM,
+ RTF_FRELATIVE,
+ RTF_FTNIL,
+ RTF_FTTRUETYPE,
+ RTF_FVALIDDOS,
+ RTF_FVALIDHPFS,
+ RTF_FVALIDMAC,
+ RTF_FVALIDNTFS,
+ RTF_LINKSELF,
+ RTF_PUBAUTO,
+ RTF_REVTBL,
+ RTF_RTLMARK,
+ RTF_SEC,
+ RTF_TCN,
+ RTF_XEF,
+
+ RTF_UD, // Unicode
+ RTF_UPR,
+ RTF_U,
+ RTF_UC,
+ RTF_ANSICPG,
+
+ RTF_FFEXITMCR, // Form Fields
+ RTF_FFENTRYMCR,
+ RTF_FFDEFTEXT,
+ RTF_FFFORMAT,
+ RTF_FFSTATTEXT,
+ RTF_FORMFIELD,
+ RTF_FFNAME,
+ RTF_FFHELPTEXT,
+ RTF_FFL,
+ RTF_FFOWNHELP,
+ RTF_FFOWNSTAT,
+ RTF_FFMAXLEN,
+ RTF_FFHASLISTBOX,
+ RTF_FFHPS,
+ RTF_FFPROT,
+ RTF_FFTYPE,
+ RTF_FFTYPETXT,
+ RTF_FFSIZE,
+ RTF_FFRECALC,
+ RTF_FFRES,
+ RTF_FFDEFRES,
+
+ RTF_HIGHLIGHT,
+
+/* */
+
+ RTF_DEFTAB = RTF_DOCFMT,
+ RTF_HYPHHOTZ,
+ RTF_LINESTART,
+ RTF_FRACWIDTH,
+ RTF_NEXTFILE,
+ RTF_TEMPLATE,
+ RTF_MAKEBACKUP,
+ RTF_DEFFORMAT,
+ RTF_DEFLANG,
+ RTF_FTNSEP,
+ RTF_FTNSEPC,
+ RTF_FTNCN,
+ RTF_ENDNOTES,
+ RTF_ENDDOC,
+ RTF_FTNTJ,
+ RTF_FTNBJ,
+ RTF_FTNSTART,
+ RTF_FTNRESTART,
+ RTF_PAPERW,
+ RTF_PAPERH,
+ RTF_MARGL,
+ RTF_MARGR,
+ RTF_MARGT,
+ RTF_MARGB,
+ RTF_FACINGP,
+ RTF_GUTTER,
+ RTF_MARGMIRROR,
+ RTF_LANDSCAPE,
+ RTF_PGNSTART,
+ RTF_WIDOWCTRL,
+ RTF_REVISIONS,
+ RTF_REVPROP,
+ RTF_REVBAR,
+
+ RTF_AENDDOC,
+ RTF_AENDNOTES,
+ RTF_AFTNBJ,
+ RTF_AFTNCN,
+ RTF_AFTNNALC,
+ RTF_AFTNNAR,
+ RTF_AFTNNAUC,
+ RTF_AFTNNCHI,
+ RTF_AFTNNRLC,
+ RTF_AFTNNRUC,
+ RTF_AFTNRESTART,
+ RTF_AFTNRSTCONT,
+ RTF_AFTNSEP,
+ RTF_AFTNSEPC,
+ RTF_AFTNSTART,
+ RTF_AFTNTJ,
+ RTF_ALLPROT,
+ RTF_ANNOTPROT,
+ RTF_ATNAUTHOR,
+ RTF_ATNICN,
+ RTF_ATNREF,
+ RTF_ATNTIME,
+ RTF_ATRFEND,
+ RTF_ATRFSTART,
+ RTF_BRKFRM,
+ RTF_CVMME,
+ RTF_FET,
+ RTF_FLDALT,
+ RTF_FORMDISP,
+ RTF_FORMPROT,
+ RTF_FORMSHADE,
+ RTF_FTNALT,
+ RTF_FTNNALC,
+ RTF_FTNNAR,
+ RTF_FTNNAUC,
+ RTF_FTNNCHI,
+ RTF_FTNNRLC,
+ RTF_FTNNRUC,
+ RTF_FTNRSTCONT,
+ RTF_FTNRSTPG,
+ RTF_HYPHAUTO,
+ RTF_HYPHCAPS,
+ RTF_HYPHCONSEC,
+ RTF_LINKSTYLES,
+ RTF_LTRDOC,
+ RTF_NOCOLBAL,
+ RTF_NOEXTRASPRL,
+ RTF_NOTABIND,
+ RTF_OTBLRUL,
+ RTF_PRCOLBL,
+ RTF_PRINTDATA,
+ RTF_PSZ,
+ RTF_REVPROT,
+ RTF_RTLDOC,
+ RTF_SPRSSPBF,
+ RTF_SPRSTSP,
+ RTF_SWPBDR,
+ RTF_TRANSMF,
+ RTF_WRAPTRSP,
+
+ RTF_PRIVATE,
+ RTF_NOULTRLSPC,
+ RTF_MSMCAP,
+ RTF_NOLEAD,
+ RTF_NOSPACEFORUL,
+ RTF_LYTEXCTTP,
+ RTF_LYTPRTMET,
+ RTF_DNTBLNSBDB,
+ RTF_FROMTEXT,
+ RTF_EXPSHRTN,
+ RTF_PGBRDRT,
+ RTF_SPRSBSP,
+ RTF_PGBRDRR,
+ RTF_PGBRDRSNAP,
+ RTF_BDBFHDR,
+ RTF_SUBFONTBYSIZE,
+ RTF_TRUNCATEFONTHEIGHT,
+ RTF_SPRSLNSP,
+ RTF_SPRSTSM,
+ RTF_PGBRDRL,
+ RTF_WPJST,
+ RTF_PGBRDRB,
+ RTF_WPSP,
+ RTF_NOXLATTOYEN,
+ RTF_OLDLINEWRAP,
+ RTF_PGBRDRFOOT,
+ RTF_PGBRDRHEAD,
+ RTF_DEFLANGFE,
+ RTF_DOCTYPE,
+ RTF_PGBRDROPT,
+ RTF_VIEWKIND,
+ RTF_VIEWSCALE,
+ RTF_WINDOWCAPTION,
+ RTF_BRDRART,
+ RTF_VIEWZK,
+ RTF_DOCVAR,
+
+ RTF_DGMARGIN,
+ RTF_AFTNNCHOSUNG,
+ RTF_AFTNNCNUM,
+ RTF_AFTNNDBAR,
+ RTF_AFTNNDBNUM,
+ RTF_AFTNNDBNUMD,
+ RTF_AFTNNDBNUMK,
+ RTF_AFTNNDBNUMT,
+ RTF_AFTNNGANADA,
+ RTF_AFTNNGBNUM,
+ RTF_AFTNNGBNUMD,
+ RTF_AFTNNGBNUMK,
+ RTF_AFTNNGBNUML,
+ RTF_AFTNNZODIAC,
+ RTF_AFTNNZODIACD,
+ RTF_AFTNNZODIACL,
+ RTF_FTNNCHOSUNG,
+ RTF_FTNNCNUM,
+ RTF_FTNNDBAR,
+ RTF_FTNNDBNUM,
+ RTF_FTNNDBNUMD,
+ RTF_FTNNDBNUMK,
+ RTF_FTNNDBNUMT,
+ RTF_FTNNGANADA,
+ RTF_FTNNGBNUM,
+ RTF_FTNNGBNUMD,
+ RTF_FTNNGBNUMK,
+ RTF_FTNNGBNUML,
+ RTF_FTNNZODIAC,
+ RTF_FTNNZODIACD,
+ RTF_FTNNZODIACL,
+
+ RTF_ADEFLANG,
+ RTF_ADEFF,
+
+/* */
+
+ RTF_SECTD = RTF_SECTFMT,
+ RTF_ENDNHERE,
+ RTF_BINFSXN,
+ RTF_BINSXN,
+ RTF_SBKNONE,
+ RTF_SBKCOL,
+ RTF_SBKPAGE,
+ RTF_SBKEVEN,
+ RTF_SBKODD,
+ RTF_COLS,
+ RTF_COLSX,
+ RTF_COLNO,
+ RTF_COLSR,
+ RTF_COLW,
+ RTF_LINEBETCOL,
+ RTF_LINEMOD,
+ RTF_LINEX,
+ RTF_LINESTARTS,
+ RTF_LINERESTART,
+ RTF_LINEPAGE,
+ RTF_LINECONT,
+ RTF_PGWSXN,
+ RTF_PGHSXN,
+ RTF_MARGLSXN,
+ RTF_MARGRSXN,
+ RTF_MARGTSXN,
+ RTF_MARGBSXN,
+ RTF_GUTTERSXN,
+ RTF_LNDSCPSXN,
+ RTF_FACPGSXN,
+ RTF_TITLEPG,
+ RTF_HEADERY,
+ RTF_FOOTERY,
+ RTF_PGNSTARTS,
+ RTF_PGNCONT,
+ RTF_PGNRESTART,
+ RTF_PGNX,
+ RTF_PGNY,
+ RTF_PGNDEC,
+ RTF_PGNUCRM,
+ RTF_PGNLCRM,
+ RTF_PGNUCLTR,
+ RTF_PGNLCLTR,
+ RTF_VERTALT,
+ RTF_VERTALB,
+ RTF_VERTALC,
+ RTF_VERTALJ,
+
+ RTF_FOOTER,
+ RTF_FOOTERL,
+ RTF_FOOTERR,
+ RTF_FOOTERF,
+ RTF_HEADER,
+ RTF_HEADERL,
+ RTF_HEADERR,
+ RTF_HEADERF,
+ RTF_DS,
+ RTF_LTRSECT,
+ RTF_PGNHN,
+ RTF_PGNHNSC,
+ RTF_PGNHNSH,
+ RTF_PGNHNSM,
+ RTF_PGNHNSN,
+ RTF_PGNHNSP,
+ RTF_RTLSECT,
+ RTF_SECTUNLOCKED,
+ RTF_STEXTFLOW,
+ RTF_PGNCHOSUNG,
+ RTF_PGNCNUM,
+ RTF_PGNDBNUMK,
+ RTF_PGNDBNUMT,
+ RTF_PGNGANADA,
+ RTF_PGNGBNUM,
+ RTF_PGNGBNUMD,
+ RTF_PGNGBNUMK,
+ RTF_PGNGBNUML,
+ RTF_PGNZODIAC,
+ RTF_PGNZODIACD,
+ RTF_PGNZODIACL,
+ RTF_SECTDEFAULTCL,
+ RTF_SECTEXPAND,
+ RTF_SECTLINEGRID,
+ RTF_SECTSPECIFYCL,
+ RTF_SECTSPECIFYL,
+
+ // Swg-Header/Footer-Tokens
+ RTF_HEADER_YB = (RTF_SECTFMT|RTF_SWGDEFS),
+ RTF_HEADER_XL,
+ RTF_HEADER_XR,
+ RTF_FOOTER_YT,
+ RTF_FOOTER_XL,
+ RTF_FOOTER_XR,
+ RTF_HEADER_YH,
+ RTF_FOOTER_YH,
+ RTF_BALANCED_COLUMN,
+
+
+/* */
+
+ RTF_PARD = RTF_PARFMT,
+ RTF_S,
+ RTF_INTBL,
+ RTF_KEEP,
+ RTF_KEEPN,
+ RTF_LEVEL,
+ RTF_PAGEBB,
+ RTF_SBYS,
+ RTF_QL,
+ RTF_QR,
+ RTF_QJ,
+ RTF_QC,
+ RTF_FI,
+ RTF_LI,
+ RTF_LIN,
+ RTF_RI,
+ RTF_RIN,
+ RTF_SB,
+ RTF_SA,
+ RTF_SL,
+ RTF_HYPHPAR,
+ RTF_LTRPAR,
+ RTF_NOWIDCTLPAR,
+ RTF_RTLPAR,
+ RTF_SLMULT,
+ RTF_SUBDOCUMENT,
+
+ RTF_WIDCTLPAR,
+
+ RTF_LISTTEXT,
+ RTF_POSYIN,
+ RTF_PNRNOT,
+ RTF_BRDRDASHDOTSTR,
+ RTF_POSYOUT,
+ RTF_BRDRDASHD,
+ RTF_BRDRDASHDD,
+ RTF_BRDRENGRAVE,
+ RTF_BRDRTHTNLG,
+ RTF_BRDREMBOSS,
+ RTF_BRDRTNTHTNLG,
+ RTF_BRDRDASHSM,
+ RTF_BRDRTHTNMG,
+ RTF_OVERLAY,
+ RTF_BRDRTNTHSG,
+ RTF_BRDRTNTHMG,
+ RTF_BRDRTHTNSG,
+ RTF_BRDRTNTHLG,
+ RTF_BRDRTRIPLE,
+ RTF_BRDRTNTHTNSG,
+ RTF_BRDRTNTHTNMG,
+ RTF_BRDRWAVYDB,
+ RTF_BRDRWAVY,
+ RTF_ILVL,
+ RTF_DFRSTOP,
+ RTF_DFRXST,
+ RTF_PNRAUTH,
+ RTF_DFRSTART,
+ RTF_OUTLINELEVEL,
+ RTF_DFRAUTH,
+ RTF_DFRDATE,
+ RTF_PNRRGB,
+ RTF_PNRPNBR,
+ RTF_PNRSTART,
+ RTF_PNRXST,
+ RTF_PNRSTOP,
+ RTF_PNRDATE,
+ RTF_PNRNFC,
+ RTF_NOSNAPLINEGRID,
+ RTF_FAAUTO,
+ RTF_FAHANG,
+ RTF_FAVAR,
+ RTF_FACENTER,
+ RTF_FAROMAN,
+ RTF_FAFIXED,
+ RTF_ADJUSTRIGHT,
+ RTF_LS,
+ RTF_NOCWRAP,
+ RTF_NOOVERFLOW,
+ RTF_ASPALPHA,
+
+
+/* */
+
+ RTF_TX = RTF_TABSTOPDEF,
+ RTF_TB,
+ RTF_TQL,
+ RTF_TQR,
+ RTF_TQC,
+ RTF_TQDEC,
+ RTF_TLDOT,
+ RTF_TLHYPH,
+ RTF_TLUL,
+ RTF_TLTH,
+ RTF_TLEQ,
+
+ // Swg-TabStop-Tokens
+ RTF_TLSWG = (RTF_TABSTOPDEF|RTF_SWGDEFS),
+
+/* */
+
+ RTF_BRDRT = RTF_BRDRDEF,
+ RTF_BRDRB,
+ RTF_BRDRL,
+ RTF_BRDRR,
+ RTF_BRDRBTW,
+ RTF_BRDRBAR,
+ RTF_BOX,
+ RTF_BRSP,
+ RTF_BRDRW,
+ RTF_BRDRCF,
+ RTF_BRDRS,
+ RTF_BRDRTH,
+ RTF_BRDRSH,
+ RTF_BRDRDB,
+ RTF_BRDRDOT,
+ RTF_BRDRHAIR,
+ RTF_BRDRDASH,
+ RTF_BRDRINSET,
+ RTF_BRDROUTSET,
+ RTF_BRDRFRAME,
+
+ // Swg-Border-Tokens
+ RTF_BRDBOX = (RTF_BRDRDEF|RTF_SWGDEFS),
+ RTF_BRDLINE_COL,
+ RTF_BRDLINE_IN,
+ RTF_BRDLINE_OUT,
+ RTF_BRDLINE_DIST,
+
+/* */
+
+ RTF_PLAIN = RTF_CHRFMT,
+ RTF_B,
+ RTF_CAPS,
+ RTF_DN,
+ RTF_SUB,
+ RTF_NOSUPERSUB,
+ RTF_EXPND,
+ RTF_EXPNDTW,
+ RTF_KERNING,
+ RTF_F,
+ RTF_FS,
+ RTF_I,
+ RTF_OUTL,
+ RTF_SCAPS,
+ RTF_SHAD,
+ RTF_STRIKE,
+ RTF_UL,
+ RTF_ULD,
+ RTF_ULDB,
+ RTF_ULNONE,
+ RTF_ULW,
+ RTF_OL,
+ RTF_OLD,
+ RTF_OLDB,
+ RTF_OLNONE,
+ RTF_OLW,
+ RTF_UP,
+ RTF_SUPER,
+ RTF_V,
+ RTF_CF,
+ RTF_CB,
+ RTF_LANG,
+ RTF_CCHS,
+ RTF_CS,
+ RTF_LTRCH,
+ RTF_REVAUTH,
+ RTF_REVDTTM,
+ RTF_RTLCH,
+
+ RTF_CHBGFDIAG,
+ RTF_CHBGDKVERT,
+ RTF_CHBGDKHORIZ,
+ RTF_CHBRDR,
+ RTF_CHBGVERT,
+ RTF_CHBGHORIZ,
+ RTF_CHBGDKFDIAG,
+ RTF_CHBGDCROSS,
+ RTF_CHBGCROSS,
+ RTF_CHBGBDIAG,
+ RTF_CHBGDKDCROSS,
+ RTF_CHBGDKCROSS,
+ RTF_CHBGDKBDIAG,
+ RTF_ULDASHD,
+ RTF_ULDASH,
+ RTF_ULDASHDD,
+ RTF_ULWAVE,
+ RTF_ULC,
+ RTF_ULTH,
+ RTF_OLDASHD,
+ RTF_OLDASH,
+ RTF_OLDASHDD,
+ RTF_OLWAVE,
+ RTF_OLC,
+ RTF_OLTH,
+ RTF_EMBO,
+ RTF_IMPR,
+ RTF_STRIKED,
+ RTF_CRDATE,
+ RTF_CRAUTH,
+ RTF_CHARSCALEX,
+ RTF_CHCBPAT,
+ RTF_CHCFPAT,
+ RTF_CHSHDNG,
+ RTF_REVAUTHDEL,
+ RTF_REVDTTMDEL,
+ RTF_CGRID,
+ RTF_GCW,
+ RTF_NOSECTEXPAND,
+ RTF_GRIDTBL,
+ RTF_G,
+ RTF_ANIMTEXT,
+ RTF_ULTHD,
+ RTF_ULTHDASH,
+ RTF_ULLDASH,
+ RTF_ULTHLDASH,
+ RTF_ULTHDASHD,
+ RTF_ULTHDASHDD,
+ RTF_ULHWAVE,
+ RTF_ULULDBWAVE,
+ RTF_OLTHD,
+ RTF_OLTHDASH,
+ RTF_OLLDASH,
+ RTF_OLTHLDASH,
+ RTF_OLTHDASHD,
+ RTF_OLTHDASHDD,
+ RTF_OLHWAVE,
+ RTF_OLOLDBWAVE,
+
+ // association control words
+ RTF_AB,
+ RTF_ACAPS,
+ RTF_ACF,
+ RTF_ADN,
+ RTF_AEXPND,
+ RTF_AF,
+ RTF_AFS,
+ RTF_AI,
+ RTF_ALANG,
+ RTF_AOUTL,
+ RTF_ASCAPS,
+ RTF_ASHAD,
+ RTF_ASTRIKE,
+ RTF_AUL,
+ RTF_AULD,
+ RTF_AULDB,
+ RTF_AULNONE,
+ RTF_AULW,
+ RTF_AUP,
+
+ RTF_LOCH,
+ RTF_HICH,
+ RTF_DBCH,
+ RTF_LANGFE,
+ RTF_ACCNONE,
+ RTF_ACCDOT,
+ RTF_ACCCOMMA,
+ RTF_TWOINONE,
+ RTF_HORZVERT,
+
+ // Swg-Border-Tokens
+ RTF_SWG_ESCPROP = (RTF_CHRFMT|RTF_SWGDEFS),
+ RTF_HYPHEN,
+ RTF_HYPHLEAD,
+ RTF_HYPHTRAIL,
+ RTF_HYPHMAX,
+
+
+/* */
+
+ RTF_CHDATE = RTF_SPECCHAR,
+ RTF_CHDATEL,
+ RTF_CHDATEA,
+ RTF_CHTIME,
+ RTF_CHPGN,
+ RTF_CHFTN,
+ RTF_CHATN,
+ RTF_CHFTNSEP,
+ RTF_CHFTNSEPC,
+ RTF_CELL,
+ RTF_ROW,
+ RTF_PAR,
+ RTF_SECT,
+ RTF_PAGE,
+ RTF_COLUM,
+ RTF_LINE,
+ RTF_TAB,
+ RTF_EMDASH,
+ RTF_ENDASH,
+ RTF_BULLET,
+ RTF_LQUOTE,
+ RTF_RQUOTE,
+ RTF_LDBLQUOTE,
+ RTF_RDBLQUOTE,
+ RTF_FORMULA,
+ RTF_NONBREAKINGSPACE,
+ RTF_OPTIONALHYPHEN,
+ RTF_NONBREAKINGHYPHEN,
+ RTF_SUBENTRYINDEX,
+ RTF_IGNOREFLAG,
+ RTF_HEX,
+ RTF_EMSPACE,
+ RTF_ENSPACE,
+ RTF_LTRMARK,
+ RTF_SECTNUM,
+ RTF_SOFTCOL,
+ RTF_SOFTLHEIGHT,
+ RTF_SOFTLINE,
+ RTF_SOFTPAGE,
+ RTF_ZWJ,
+ RTF_ZWNJ,
+
+/* */
+
+ RTF_ABSW = RTF_APOCTL,
+ RTF_ABSH,
+ RTF_NOWRAP,
+ RTF_DXFRTEXT,
+ RTF_DFRMTXTX,
+ RTF_DFRMTXTY,
+ RTF_DROPCAPLI,
+ RTF_DROPCAPT,
+ RTF_ABSNOOVRLP,
+ RTF_PHMRG,
+ RTF_PHPG,
+ RTF_PHCOL,
+ RTF_POSX,
+ RTF_POSNEGX,
+ RTF_POSXC,
+ RTF_POSXI,
+ RTF_POSXO,
+ RTF_POSXL,
+ RTF_POSXR,
+ RTF_PVMRG,
+ RTF_PVPG,
+ RTF_PVPARA,
+ RTF_POSY,
+ RTF_POSNEGY,
+ RTF_POSYT,
+ RTF_POSYIL,
+ RTF_POSYB,
+ RTF_POSYC,
+ RTF_ABSLOCK,
+ RTF_FRMTXLRTB,
+ RTF_FRMTXTBRL,
+ RTF_FRMTXBTLR,
+ RTF_FRMTXLRTBV,
+ RTF_FRMTXTBRLV,
+
+ // Swg-Frame-Tokens
+ RTF_FLYPRINT = (RTF_APOCTL|RTF_SWGDEFS),
+ RTF_FLYOPAQUE,
+ RTF_FLYPRTCTD,
+ RTF_FLYMAINCNT,
+ RTF_FLYVERT,
+ RTF_FLYHORZ,
+ RTF_FLYOUTLEFT,
+ RTF_FLYOUTRIGHT,
+ RTF_FLYOUTUPPER,
+ RTF_FLYOUTLOWER,
+ RTF_FLYANCHOR,
+ RTF_FLY_CNTNT,
+ RTF_FLY_COLUMN,
+ RTF_FLY_PAGE,
+ RTF_FLY_INPARA,
+
+
+/* */
+
+ RTF_SHADING = RTF_SHADINGDEF,
+ RTF_CFPAT,
+ RTF_CBPAT,
+ RTF_BGHORIZ,
+ RTF_BGVERT,
+ RTF_BGFDIAG,
+ RTF_BGBDIAG,
+ RTF_BGCROSS,
+ RTF_BGDCROSS,
+ RTF_BGDKHORIZ,
+ RTF_BGDKVERT,
+ RTF_BGDKFDIAG,
+ RTF_BGDKBDIAG,
+ RTF_BGDKCROSS,
+ RTF_BGDKDCROSS,
+
+/* */
+
+ RTF_TROWD = RTF_TABLEDEF,
+ RTF_TRGAPH,
+ RTF_TRLEFT,
+ RTF_TRRH,
+
+ RTF_TRQL,
+ RTF_TRQR,
+ RTF_TRQC,
+
+ RTF_CLMGF,
+ RTF_CLMRG,
+ RTF_CELLX,
+ RTF_LTRROW,
+ RTF_RTLROW,
+ RTF_TRBRDRB,
+ RTF_TRBRDRH,
+ RTF_TRBRDRL,
+ RTF_TRBRDRR,
+ RTF_TRBRDRT,
+ RTF_TRBRDRV,
+ RTF_TRHDR,
+ RTF_TRKEEP,
+ RTF_TRPADDB,
+ RTF_TRPADDL,
+ RTF_TRPADDR,
+ RTF_TRPADDT,
+ RTF_TRPADDFB,
+ RTF_TRPADDFL,
+ RTF_TRPADDFR,
+ RTF_TRPADDFT,
+ RTF_TCELLD,
+ RTF_CLTXTBRL,
+ RTF_CLTXLRTB,
+ RTF_CLVERTALB,
+ RTF_CLVERTALT,
+ RTF_CLVERTALC,
+ RTF_CLVMGF,
+ RTF_CLVMRG,
+ RTF_CLTXTBRLV,
+ RTF_CLTXBTLR,
+ RTF_CLTXLRTBV,
+ RTF_CLPADL,
+ RTF_CLPADT,
+ RTF_CLPADB,
+ RTF_CLPADR,
+ RTF_CLPADFL,
+ RTF_CLPADFT,
+ RTF_CLPADFB,
+ RTF_CLPADFR,
+
+
+ RTF_CLBRDRT = (RTF_BRDRDEF|RTF_TABLEDEF),
+ RTF_CLBRDRL,
+ RTF_CLBRDRB,
+ RTF_CLBRDRR,
+
+ RTF_CLCFPAT = (RTF_SHADINGDEF|RTF_TABLEDEF),
+ RTF_CLCBPAT,
+ RTF_CLSHDNG,
+ RTF_CLBGHORIZ,
+ RTF_CLBGVERT,
+ RTF_CLBGFDIAG,
+ RTF_CLBGBDIAG,
+ RTF_CLBGCROSS,
+ RTF_CLBGDCROSS,
+ RTF_CLBGDKHOR,
+ RTF_CLBGDKVERT,
+ RTF_CLBGDKFDIAG,
+ RTF_CLBGDKBDIAG,
+ RTF_CLBGDKCROSS,
+ RTF_CLBGDKDCROSS,
+
+/* */
+
+
+/* */
+
+ RTF_DO = RTF_DRAWOBJECTS,
+ RTF_DOBXCOLUMN,
+ RTF_DOBXMARGIN,
+ RTF_DOBXPAGE,
+ RTF_DOBYMARGIN,
+ RTF_DOBYPAGE,
+ RTF_DOBYPARA,
+ RTF_DODHGT,
+ RTF_DOLOCK,
+ RTF_DPAENDHOL,
+ RTF_DPAENDL,
+ RTF_DPAENDSOL,
+ RTF_DPAENDW,
+ RTF_DPARC,
+ RTF_DPARCFLIPX,
+ RTF_DPARCFLIPY,
+ RTF_DPASTARTHOL,
+ RTF_DPASTARTL,
+ RTF_DPASTARTSOL,
+ RTF_DPASTARTW,
+ RTF_DPCALLOUT,
+ RTF_DPCOA,
+ RTF_DPCOACCENT,
+ RTF_DPCOBESTFIT,
+ RTF_DPCOBORDER,
+ RTF_DPCODABS,
+ RTF_DPCODBOTTOM,
+ RTF_DPCODCENTER,
+ RTF_DPCODTOP,
+ RTF_DPCOLENGTH,
+ RTF_DPCOMINUSX,
+ RTF_DPCOMINUSY,
+ RTF_DPCOOFFSET,
+ RTF_DPCOSMARTA,
+ RTF_DPCOTDOUBLE,
+ RTF_DPCOTRIGHT,
+ RTF_DPCOTSINGLE,
+ RTF_DPCOTTRIPLE,
+ RTF_DPCOUNT,
+ RTF_DPELLIPSE,
+ RTF_DPENDGROUP,
+ RTF_DPFILLBGCB,
+ RTF_DPFILLBGCG,
+ RTF_DPFILLBGCR,
+ RTF_DPFILLBGGRAY,
+ RTF_DPFILLBGPAL,
+ RTF_DPFILLFGCB,
+ RTF_DPFILLFGCG,
+ RTF_DPFILLFGCR,
+ RTF_DPFILLFGGRAY,
+ RTF_DPFILLFGPAL,
+ RTF_DPFILLPAT,
+ RTF_DPGROUP,
+ RTF_DPLINE,
+ RTF_DPLINECOB,
+ RTF_DPLINECOG,
+ RTF_DPLINECOR,
+ RTF_DPLINEDADO,
+ RTF_DPLINEDADODO,
+ RTF_DPLINEDASH,
+ RTF_DPLINEDOT,
+ RTF_DPLINEGRAY,
+ RTF_DPLINEHOLLOW,
+ RTF_DPLINEPAL,
+ RTF_DPLINESOLID,
+ RTF_DPLINEW,
+ RTF_DPPOLYCOUNT,
+ RTF_DPPOLYGON,
+ RTF_DPPOLYLINE,
+ RTF_DPPTX,
+ RTF_DPPTY,
+ RTF_DPRECT,
+ RTF_DPROUNDR,
+ RTF_DPSHADOW,
+ RTF_DPSHADX,
+ RTF_DPSHADY,
+ RTF_DPTXBX,
+ RTF_DPTXBXMAR,
+ RTF_DPTXBXTEXT,
+ RTF_DPX,
+ RTF_DPXSIZE,
+ RTF_DPY,
+ RTF_DPYSIZE,
+
+ RTF_DPCODESCENT,
+ RTF_BACKGROUND,
+ RTF_SHPBYPAGE,
+ RTF_SHPBYPARA,
+ RTF_SHPBYMARGIN,
+ RTF_SHPBXCOLUMN,
+ RTF_SHPBXMARGIN,
+ RTF_SHPBXPAGE,
+ RTF_SHPLOCKANCHOR,
+ RTF_SHPWR,
+ RTF_HLLOC,
+ RTF_HLSRC,
+ RTF_SHPWRK,
+ RTF_SHPTOP,
+ RTF_SHPRSLT,
+ RTF_HLFR,
+ RTF_SHPTXT,
+ RTF_SHPFHDR,
+ RTF_SHPGRP,
+ RTF_SHPRIGHT,
+ RTF_SHPFBLWTXT,
+ RTF_SHPZ,
+ RTF_SHPBOTTOM,
+ RTF_SHPLEFT,
+ RTF_SHPLID,
+
+/* */
+
+ RTF_OBJALIAS = RTF_OBJECTS,
+ RTF_OBJALIGN,
+ RTF_OBJAUTLINK,
+ RTF_OBJCLASS,
+ RTF_OBJCROPB,
+ RTF_OBJCROPL,
+ RTF_OBJCROPR,
+ RTF_OBJCROPT,
+ RTF_OBJDATA,
+ RTF_OBJECT,
+ RTF_OBJEMB,
+ RTF_OBJH,
+ RTF_OBJICEMB,
+ RTF_OBJLINK,
+ RTF_OBJLOCK,
+ RTF_OBJNAME,
+ RTF_OBJPUB,
+ RTF_OBJSCALEX,
+ RTF_OBJSCALEY,
+ RTF_OBJSECT,
+ RTF_OBJSETSIZE,
+ RTF_OBJSUB,
+ RTF_OBJTIME,
+ RTF_OBJTRANSY,
+ RTF_OBJUPDATE,
+ RTF_OBJW,
+ RTF_RESULT,
+ RTF_RSLTBMP,
+ RTF_RSLTMERGE,
+ RTF_RSLTPICT,
+ RTF_RSLTRTF,
+ RTF_RSLTTXT,
+ RTF_OBJOCX,
+ RTF_OBJHTML,
+ RTF_OBJATTPH,
+
+/* */
+
+ RTF_PN = RTF_NUMBULLETS,
+ RTF_PNACROSS,
+ RTF_PNB,
+ RTF_PNCAPS,
+ RTF_PNCARD,
+ RTF_PNCF,
+ RTF_PNDEC,
+ RTF_PNF,
+ RTF_PNFS,
+ RTF_PNHANG,
+ RTF_PNI,
+ RTF_PNINDENT,
+ RTF_PNLCLTR,
+ RTF_PNLCRM,
+ RTF_PNLVL,
+ RTF_PNLVLBLT,
+ RTF_PNLVLBODY,
+ RTF_PNLVLCONT,
+ RTF_PNNUMONCE,
+ RTF_PNORD,
+ RTF_PNORDT,
+ RTF_PNPREV,
+ RTF_PNQC,
+ RTF_PNQL,
+ RTF_PNQR,
+ RTF_PNRESTART,
+ RTF_PNSCAPS,
+ RTF_PNSECLVL,
+ RTF_PNSP,
+ RTF_PNSTART,
+ RTF_PNSTRIKE,
+ RTF_PNTEXT,
+ RTF_PNTXTA,
+ RTF_PNTXTB,
+ RTF_PNUCLTR,
+ RTF_PNUCRM,
+ RTF_PNUL,
+ RTF_PNULD,
+ RTF_PNULDB,
+ RTF_PNULNONE,
+ RTF_PNULW,
+ RTF_LIST,
+ RTF_LISTLEVEL,
+ RTF_LISTOVERRIDE,
+ RTF_LISTOVERRIDETABLE,
+ RTF_LISTTABLE,
+ RTF_LISTNAME,
+ RTF_LEVELNUMBERS,
+ RTF_LEVELNORESTART,
+ RTF_LEVELNFC,
+ RTF_LEVELOLD,
+ RTF_LISTOVERRIDECOUNT,
+ RTF_LISTTEMPLATEID,
+ RTF_LEVELINDENT,
+ RTF_LEVELFOLLOW,
+ RTF_LEVELLEGAL,
+ RTF_LEVELJC,
+ RTF_LISTOVERRIDESTART,
+ RTF_LISTID,
+ RTF_LISTRESTARTHDN,
+ RTF_LEVELTEXT,
+ RTF_LISTOVERRIDEFORMAT,
+ RTF_LEVELPREVSPACE,
+ RTF_LEVELPREV,
+ RTF_LEVELSPACE,
+ RTF_LISTSIMPLE,
+ RTF_LEVELSTARTAT,
+ RTF_PNAIUEO,
+ RTF_PNAIUEOD,
+ RTF_PNCHOSUNG,
+ RTF_PNDBNUMD,
+ RTF_PNDBNUMK,
+ RTF_PNDBNUML,
+ RTF_PNDBNUMT,
+ RTF_PNGANADA,
+ RTF_PNGBNUM,
+ RTF_PNGBNUMD,
+ RTF_PNGBNUMK,
+ RTF_PNGBNUML,
+ RTF_PNZODIAC,
+ RTF_PNZODIACD,
+ RTF_PNZODIACL,
+ RTF_LFOLEVEL,
+
+/* */
+
+ RTF_GRF_ALIGNV= RTF_SWGDEFS,
+ RTF_GRF_ALIGNH,
+ RTF_GRF_MIRROR,
+ RTF_SWG_PRTDATA,
+ RTF_BKMK_KEY,
+ RTF_SHADOW,
+ RTF_SHDW_DIST,
+ RTF_SHDW_STYLE,
+ RTF_SHDW_COL,
+ RTF_SHDW_FCOL,
+ RTF_PGDSCTBL,
+ RTF_PGDSC,
+ RTF_PGDSCUSE,
+ RTF_PGDSCNXT,
+ RTF_PGDSCNO,
+ RTF_PGBRK,
+ RTF_SOUTLVL,
+
+// shapes
+ RTF_SHP, RTF_SN, RTF_SV, RTF_SP
+/*
+ RTF_SHPLEFT,
+ RTF_SHPTOP,
+ RTF_SHPBOTTOM,
+ RTF_SHPRIGHT
+*/
+
+};
+
+#endif // _RTFTOKEN_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
new file mode 100644
index 000000000000..a06109bca6a0
--- /dev/null
+++ b/include/svtools/ruler.hxx
@@ -0,0 +1,802 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _RULER_HXX
+#define _RULER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <vcl/window.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/field.hxx>
+
+class MouseEvent;
+class TrackingEvent;
+class DataChangedEvent;
+
+/*************************************************************************
+
+Description
+============
+
+class Ruler
+
+This class is used for displaying a ruler, but it can also be used
+for setting or moving tabs and margins.
+
+--------------------------------------------------------------------------
+
+WinBits
+
+WB_HORZ ruler is displayed horizontally
+WB_VERT ruler is displayed vertically
+WB_3DLOOK 3D look
+WB_BORDER border at the bottom/right margin
+WB_EXTRAFIELD Field in the upper left corner for
+ displaying and selecting tabs, origin of coordinates, ...
+WB_RIGHT_ALIGNED Marks the vertical ruler as right aligned
+
+--------------------------------------------------------------------------
+
+All ruler parameters are set in pixel units. This way double conversions
+and rounding errors are avoided and the ruler displays the margins
+at their actual position in the document. Because of this, the application can,
+for example in tables, do its own roundings and the positions on the ruler will
+still match those in the document. However, for the ruler to know how the
+document is displayed on the screen, some additional values have to be configured
+
+SetWinPos() sets the offset of the ruler's edit window. In doing so,
+the width of the window can also be configured. If there is a 0 among the
+values passed to the function, the position/width is automatically set to
+the width of the ruler.
+
+SetPagePos() sets the offset of the page relative to the edit window and the
+width of the page. If there is a 0 among the values passed to the function,
+the position/width is automatically set as if the page filled the whole edit window.
+
+SetBorderPos() sets the offset of the border. The position is relative to
+the upper/left margin of the window. This is needed when there are a horizontal
+and a vertical ruler visible at the same time. Example:
+ aHRuler.SetBorderPos( aVRuler.GetSizePixel().Width()-1 );
+
+SetNullOffset() sets the origin relative to the page.
+
+All the other values (margins, indentation, tabs, ...) refer to the origin,
+which is set with SetNullOffset().
+
+The values are computed as described below:
+
+- WinPos (if both windows have the same parent)
+
+ Point aHRulerPos = aHRuler.GetPosPixel();
+ Point aEditWinPos = aEditWin.GetPosPixel();
+ aHRuler.SetWinPos( aEditWinPos().X() - aHRulerPos.X() );
+
+- PagePos
+
+ Point aPagePos = aEditWin.LogicToPixel( aEditWin.GetPagePos() );
+ aHRuler.SetPagePos( aPagePos().X() );
+
+- All other values
+
+ Add the logical values, recompute as position and subtract the
+ previously saved pixel positions (of PagePos and Null Offset).
+
+--------------------------------------------------------------------------
+
+SetUnit() and SetZoom() configure which unit is used to display
+the values on the ruler. The following units are accepted:
+
+ FUNIT_MM
+ FUNIT_CM (Default)
+ FUNIT_M
+ FUNIT_KM
+ FUNIT_INCH
+ FUNIT_FOOT
+ FUNIT_MILE
+ FUNIT_POINT
+ FUNIT_PICA
+
+--------------------------------------------------------------------------
+
+SetMargin1() sets the upper/left margin and SetMargin2() sets the
+bottom/right margin. If these methods are called without arguments,
+no margins are displayed. Otherwise, the following arguments can be passed:
+
+ long nPos - offset in pixels relative to the origin
+ sal_uInt16 nStyle - bit style:
+ RULER_MARGIN_SIZEABLE
+ margin size can be changed
+
+ The following bits can be set in addition
+ to these styles:
+ RULER_STYLE_INVISIBLE
+
+
+SetBorders() sets an array of margins. To do this, an array of type RulerBorder
+has to be passed. In the array, the following values have to be initialized:
+
+ long nPos - offset in pixels relative to the origin
+ long nWidth - column spacing in pixels (can also be 0, for example,
+ for table columns)
+ sal_uInt16 nStyle - bit style:
+ RULER_BORDER_SIZEABLE
+ Column spacing can be changed. This flag should
+ only be set if the size of the spacing is changed,
+ not that of a cell.
+ RULER_BORDER_MOVEABLE
+ Column spacing/border can be moved. Whenever
+ table borders are to be moved, this flag should
+ be set instead of SIZEABLE (SIZEABLE indicates
+ that the size of a spacing, not that of a single
+ cell can be changed).
+ RULER_BORDER_VARIABLE
+ Not all of the column spacings are equal
+ RULER_BORDER_TABLE
+ Table border. Whenever this style ist set, the column
+ width must be 0.
+ RULER_BORDER_SNAP
+ Auxiliary line. Whenever this style is set, the
+ column width must be 0.
+ RULER_BORDER_MARGIN
+ Margin. Whenever this style is set, the column
+ width must be 0.
+
+ The following bits can be set in addition
+ to these styles:
+ RULER_STYLE_INVISIBLE
+
+SetIndents() sets an array of indents. This method may only be used for horizontal
+rulers. A Ruler Indent must be passed as an argument, with the following values
+initialized:
+
+ long nPos - offset relative to the origin in pixels
+ sal_uInt16 nStyle - bit style:
+ RULER_INDENT_TOP (indent of the first line)
+ RULER_INDENT_BOTTOM (left/right indent)
+ RULER_INDENT_BORDER (Vertical line that shows the border distance)
+ The following bits can be set in addition
+ to these styles:
+ RULER_STYLE_DONTKNOW (for old position or for
+ ambiguity)
+ RULER_STYLE_INVISIBLE
+
+SetTabs() sets an array of tabs. This method may only be used for horizontal rulers.
+An array of type RulerTab must be passed as an argument, with the following values
+initialized:
+
+ long nPos - offset relative to the origin in pixels
+ sal_uInt16 nStyle - bit style:
+ RULER_TAB_DEFAULT (can't be selected)
+ RULER_TAB_LEFT
+ RULER_TAB_CENTER
+ RULER_TAB_RIGHT
+ RULER_TAB_DECIMAL
+ The following bits can be set in addition
+ to these styles:
+ RULER_STYLE_DONTKNOW (for old position of for
+ ambiguity)
+ RULER_STYLE_INVISIBLE
+
+SetLines() displays position lines in the ruler. An array of type RulerLine must be passed, with
+the following values initialized:
+
+ long nPos - offset relative to the origin in pixels
+ sal_uInt16 nStyle - bit style (has to be 0 currently)
+
+--------------------------------------------------------------------------
+
+If the user should also be able to change the margins tabs, borders, ...
+in the ruler, a bit more effort is necessary. In this case, the StartDrag(),
+Drag() and EndDrag() methods have to be overridden. For the StartDrag() method
+it is possible to prevent dragging by returning FALSE. In the drag handler,
+the drag position must be queried and the values must be moved to the new
+position. This is done by calling the particular Set methods. While in the
+drag handler, the values are just cached and only afterward the ruler is redrawn.
+All the handlers can also be set as links with the particular Set..Hdl() methods.
+
+ - StartDrag()
+ Is called when dragging is started. If FALSE is returned, the dragging.
+ won't be executed. If TRUE is returned, the dragging will be permitted.
+ If the handler isn't overridden, FALSE will be returned.
+
+ - EndDrag()
+ Is called at the end of dragging.
+
+ - Drag()
+ Is called when dragging takes place.
+
+ - Click()
+ This handler is called when no element has been clicked on.
+ The position can be queried with GetClickPos(). This way it is possible
+ to, for example, ser tabs in the ruler. After calling the click handler,
+ the drag, if any, is immediately triggered. This makes it possible to
+ set a new tab in the click handler and then immediately move it.
+
+ - DoubleClick()
+ This handler is called when a double-click has been performed outside
+ the special panel. The methods GetClickType(), GetClickAryPos() and
+ GetClickPos() can be used to query what has been clicked on.
+ This way you can, for example, show the tab dialog when a double-click
+ is performed on a tab.
+
+In the drag handler it is possible to query what has been dragged and where
+it has been dragged. There are the following query methods:
+
+ - GetDragType()
+ Returns what has been dragged.
+ RULER_TYPE_MARGIN1
+ RULER_TYPE_MARGIN2
+ RULER_TYPE_BORDER
+ RULER_TYPE_INDENT
+ RULER_TYPE_TAB
+
+ - GetDragPos()
+ Returns the pixel position to which the user has moved the mouse
+ relative to the set zero-offset.
+
+ - GetDragAryPos()
+ Liefert den Index im Array zurueck, wenn ein Border, Indent oder ein
+ Tab gedragt wird. Achtung: Es wird die Array-Position waehrend des
+ gesammten Drag-Vorgangs von dem Item im Array was vor dem Drag gesetzt
+ war zurueckgeben. Dadurch ist es zum Beispiel auch moeglich, einen
+ Tab nicht mehr anzuzeigen, wenn die Maus nach unten/rechts aus dem
+ Lineal gezogen wird.
+
+ - GetDragSize()
+ Wenn Borders gedragt werden, kann hierueber abgefragt werden, ob
+ die Groesse bzw. welche Seite oder die Position geaendert werden soll.
+ RULER_DRAGSIZE_MOVE oder 0 - Move
+ RULER_DRAGSIZE_1 - Linke/obere Kante
+ RULER_DRAGSIZE_2 - Rechte/untere Kante
+
+ - IsDragDelete()
+ Mit dieser Methode kann abgefragt werden, ob beim Draggen die
+ Maus unten/rechts aus dem Fenster gezogen wurde. Damit kann
+ zum Beispiel festgestellt werden, ob der Benutzer einen Tab
+ loeschen will.
+
+ - IsDragCanceled()
+ Mit dieser Methode kann im EndDrag-Handler abgefragt werden,
+ ob die Aktion abgebrochen wurde, indem der Anwender die
+ Maus oben/links vom Fenster losgelassen hat oder ESC gedrueckt
+ hat. In diesem Fall werden die Werte nicht uebernommen. Wird
+ waehrend des Draggings die Maus oben/links aus dem Fenster
+ gezogen, werden automatisch die alten Werte dargestellt, ohne das
+ der Drag-Handler gerufen wird.
+ Falls der Benutzer jedoch den Wert auf die alte Position
+ zurueckgeschoben hat, liefert die Methode trotzdem sal_False. Falls
+ dies vermieden werden soll, muss sich die Applikation im StartDrag-
+ Handler den alten Wert merken und im EndDrag-Handler den Wert
+ vergleichen.
+
+ - GetDragScroll()
+ Mit dieser Methode kann abgefragt werden, ob gescrollt werden
+ soll. Es wird einer der folgenden Werte zurueckgegeben:
+ RULER_SCROLL_NO - Drag-Position befindet sich
+ an keinem Rand und somit
+ muss nicht gescrollt werden.
+ RULER_SCROLL_1 - Drag-Position befindet sich
+ am linken/oberen Rand und
+ somit sollte das Programm evt.
+ ein Srcoll ausloesen.
+ RULER_SCROLL_2 - Drag-Position befindet sich
+ am rechten/unteren Rand und
+ somit sollte das Programm evt.
+ ein Srcoll ausloesen.
+
+ - GetDragModifier()
+ Liefert die Modifier-Tasten zurueck, die beim Starten des Drag-
+ Vorgangs gedrueckt waren. Siehe MouseEvent.
+
+ - GetClickPos()
+ Liefert die Pixel-Position bezogen auf den eingestellten Null-Offset
+ zurueck, wo der Anwender die Maus gedrueckt hat.
+
+ - GetClickType()
+ Liefert zurueck, was per DoubleClick betaetigt wird:
+ RULER_TYPE_DONTKNOW (kein Element im Linealbereich)
+ RULER_TYPE_OUTSIDE (ausserhalb des Linealbereichs)
+ RULER_TYPE_MARGIN1 (nur Margin1-Kante)
+ RULER_TYPE_MARGIN2 (nur Margin2-Kante)
+ RULER_TYPE_BORDER (Border: GetClickAryPos())
+ RULER_TYPE_INDENT (Einzug: GetClickAryPos())
+ RULER_TYPE_TAB (Tab: GetClickAryPos())
+
+ - GetClickAryPos()
+ Liefert den Index im Array zurueck, wenn ein Border, Indent oder ein
+ Tab per DoubleClick betaetigt wird.
+
+ - GetType()
+ Mit dieser Methode kann man einen HitTest durchfuehren, um
+ gegebenenfalls ueber das Abfangen des MouseButtonDown-Handlers
+ auch ueber die rechte Maustaste etwas auf ein Item anzuwenden. Als
+ Paramter ueber gibt man die Fensterposition und gegebenenfalls
+ einen Pointer auf einen sal_uInt16, um die Array-Position eines
+ Tabs, Indent oder Borders mitzubekommen. Als Type werden folgende
+ Werte zurueckgegeben:
+ RULER_TYPE_DONTKNOW (kein Element im Linealbereich)
+ RULER_TYPE_OUTSIDE (ausserhalb des Linealbereichs)
+ RULER_TYPE_MARGIN1 (nur Margin1-Kante)
+ RULER_TYPE_MARGIN2 (nur Margin2-Kante)
+ RULER_TYPE_BORDER (Border: GetClickAryPos())
+ RULER_TYPE_INDENT (Einzug: GetClickAryPos())
+ RULER_TYPE_TAB (Tab: GetClickAryPos())
+
+Wenn der Drag-Vorgang abgebrochen werden soll, kann der Drag-Vorgang
+mit CancelDrag() abgebrochen werden. Folgende Methoden gibt es fuer die
+Drag-Steuerung:
+
+ - IsDrag()
+ Liefert sal_True zurueck, wenn sich das Lineal im Drag-Vorgang befindet.
+
+ - CancelDrag()
+ Bricht den Drag-Vorgang ab, falls einer durchgefuehrt wird. Dabei
+ werden die alten Werte wieder hergestellt und der Drag und der
+ EndDrag-Handler gerufen.
+
+Um vom Dokument ein Drag auszuloesen, gibt es folgende Methoden:
+
+ - StartDocDrag()
+ Dieser Methode werden der MouseEvent vom Dokumentfenster und
+ was gedragt werden soll uebergeben. Wenn als DragType
+ RULER_TYPE_DONTKNOW uebergeben wird, bestimmt das Lineal, was
+ verschoben werden soll. Bei den anderen, wird der Drag nur dann
+ gestartet, wenn auch an der uebergebenen Position ein entsprechendes
+ Element gefunden wurde. Dies ist zun Beispiel dann notwendig, wenn
+ zum Beispiel Einzuege und Spalten an der gleichen X-Position liegen.
+ Der Rueckgabewert gibt an, ob der Drag ausgeloest wurde. Wenn ein
+ Drag ausgeloest wird, uebernimmt das Lineal die normale Drag-Steuerung
+ und verhaelt sich dann so, wie als wenn direkt in das Lineal geklickt
+ wurde. So captured das Lineal die Mouse und uebernimmt auch die
+ Steuerung des Cancel (ueber Tastatur, oder wenn die Mouse ueber
+ oder links vom Lineal ruasgeschoben wird). Auch alle Handler werden
+ gerufen (inkl. des StartDrag-Handlers). Wenn ein MouseEvent mit
+ Click-Count 2 uebergeben wird auch der DoubleClick-Handler
+ entsprechend gerufen.
+
+--------------------------------------------------------------------------
+
+Fuer das Extra-Feld kann der Inhalt bestimmt werden und es gibt Handler,
+womit man bestimmte Aktionen abfangen kann.
+
+ - ExtraDown()
+ Dieser Handler wird gerufen, wenn im Extra-Feld die Maus
+ gedrueckt wird.
+
+ - SetExtraType()
+ Mit dieser Methode kann festgelegt werden, was im ExtraFeld
+ dargestellt werden soll.
+ - ExtraType Was im Extrafeld dargestellt werden soll
+ RULER_EXTRA_DONTKNOW (Nichts)
+ RULER_EXTRA_NULLOFFSET (Koordinaaten-Kreuz)
+ RULER_EXTRA_TAB (Tab)
+ - sal_uInt16 nStyle Bitfeld als Style:
+ RULER_STYLE_HIGHLIGHT (selektiert)
+ RULER_TAB_... (ein Tab-Style)
+
+ - GetExtraClick()
+ Liefert die Anzahl der Mausclicks zurueck. Dadurch ist es zum
+ Beispiel auch moeglich, auch durch einen DoubleClick im Extrafeld
+ eine Aktion auszuloesen.
+
+ - GetExtraModifier()
+ Liefert die Modifier-Tasten zurueck, die beim Klicken in das Extra-
+ Feld gedrueckt waren. Siehe MouseEvent.
+
+--------------------------------------------------------------------------
+
+Weitere Hilfsfunktionen:
+
+- static Ruler::DrawTab()
+ Mit dieser Methode kann ein Tab auf einem OutputDevice ausgegeben
+ werden. Dadurch ist es moeglich, auch in Dialogen die Tabs so
+ anzuzeigen, wie Sie im Lineal gemalt werden.
+
+ Diese Methode gibt den Tab zentriert an der uebergebenen Position
+ aus. Die Groesse der Tabs kann ueber die Defines RULER_TAB_WIDTH und
+ RULER_TAB_HEIGHT bestimmt werden.
+
+--------------------------------------------------------------------------
+
+Tips zur Benutzung des Lineals:
+
+- Bei dem Lineal muss weder im Drag-Modus noch sonst das Setzen der Werte
+ in SetUpdateMode() geklammert werden. Denn das Lineal sorgt von sich
+ aus dafuer, das wenn mehrere Werte gesetzt werden, diese automatisch
+ zusammengefast werden und flackerfrei ausgegeben werden.
+
+- Initial sollten beim Lineal zuerst die Groessen, Positionen und Werte
+ gesetzt werden, bevor es angezeigt wird. Dies ist deshalb wichtig, da
+ ansonsten viele Werte unnoetig berechnet werden.
+
+- Wenn das Dokumentfenster, in dem sich das Lineal befindet aktiv bzw.
+ deaktiv wird, sollten die Methoden Activate() und Deactivate() vom
+ Lineal gerufen werden. Denn je nach Einstellungen und System wird die
+ Anzeige entsprechend umgeschaltet.
+
+- Zum Beispiel sollte beim Drag von Tabs und Einzuegen nach Moeglichkeit die
+ alten Positionen noch mit angezeigt werden. Dazu sollte zusaetzlich beim
+ Setzen der Tabs und Einzuege als erstes im Array die alten Positionen
+ eingetragen werden und mit dem Style RULER_STYLE_DONTKNOW verknuepft
+ werden. Danach sollte im Array die restlichen Werte eingetragen werden.
+
+- Bei mehreren markierten Absaetzen und Tabellen-Zellen, sollten die Tabs
+ und Einzuege in grau von der ersten Zelle, bzw. vom ersten Absatz
+ angezeigt werden. Dies kann man auch ueber den Style RULER_STYLE_DONTKNOW
+ erreichen.
+
+- Die Bemassungspfeile sollten immer dann angezeigt, wenn beim Drag die
+ Alt-Taste (WW-Like) gedrueckt wird. Vielleicht sollte diese Einstellung
+ auch immer vornehmbar sein und vielleicht beim Drag immer die
+ Bemassungspfeile dargestellt werden. Bei allen Einstellung sollten die
+ Werte immer auf ein vielfaches eines Wertes gerundet werden, da die
+ Bildschirmausloesung sehr ungenau ist.
+
+- DoppelKlicks sollten folgendermassen behandelt werden (GetClickType()):
+ - RULER_TYPE_DONTKNOW
+ RULER_TYPE_MARGIN1
+ RULER_TYPE_MARGIN2
+ Wenn die Bedingunden GetClickPos() <= GetMargin1() oder
+ GetClickPos() >= GetMargin2() oder der Type gleich
+ RULER_TYPE_MARGIN1 oder RULER_TYPE_MARGIN2 ist, sollte
+ ein SeitenDialog angezeigt werden, wo der Focus auf dem
+ entsprechenden Rand steht
+ - RULER_TYPE_BORDER
+ Es sollte ein Spalten- oder Tabellen-Dialog angezeigt werden,
+ wo der Focus auf der entsprechenden Spalte steht, die mit
+ GetClickAryPos() abgefragt werden kann.
+ - RULER_TYPE_INDENT
+ Es sollte der Dialog angezeigt werden, wo die Einzuege eingestellt
+ werden koennen. Dabei sollte der Focus auf dem Einzug stehen, der
+ mit GetClickAryPos() ermittelt werden kann.
+ - RULER_TYPE_TAB
+ Es sollte ein TabDialog angezeigt werden, wo der Tab selektiert
+ sein sollte, der ueber GetClickAryPos() abgefragt werden kann.
+
+*************************************************************************/
+
+// -----------
+// - WinBits -
+// -----------
+
+#define WB_EXTRAFIELD ((WinBits)0x00004000)
+#define WB_RIGHT_ALIGNED ((WinBits)0x00008000)
+#define WB_STDRULER WB_HORZ
+
+// ---------------
+// - Ruler-Types -
+// ---------------
+
+struct ImplRulerHitTest;
+
+// --------------
+// - Ruler-Type -
+// --------------
+
+enum RulerType { RULER_TYPE_DONTKNOW, RULER_TYPE_OUTSIDE,
+ RULER_TYPE_MARGIN1, RULER_TYPE_MARGIN2,
+ RULER_TYPE_BORDER, RULER_TYPE_INDENT, RULER_TYPE_TAB };
+
+enum RulerExtra { RULER_EXTRA_DONTKNOW,
+ RULER_EXTRA_NULLOFFSET, RULER_EXTRA_TAB };
+
+#define RULER_STYLE_HIGHLIGHT ((sal_uInt16)0x8000)
+#define RULER_STYLE_DONTKNOW ((sal_uInt16)0x4000)
+#define RULER_STYLE_INVISIBLE ((sal_uInt16)0x2000)
+
+#define RULER_DRAGSIZE_MOVE 0
+#define RULER_DRAGSIZE_1 1
+#define RULER_DRAGSIZE_2 2
+
+#define RULER_MOUSE_BORDERMOVE 5
+#define RULER_MOUSE_BORDERWIDTH 5
+#define RULER_MOUSE_MARGINWIDTH 3
+
+#define RULER_SCROLL_NO 0
+#define RULER_SCROLL_1 1
+#define RULER_SCROLL_2 2
+
+// ---------------
+// - RulerMargin -
+// ---------------
+
+#define RULER_MARGIN_SIZEABLE ((sal_uInt16)0x0001)
+
+// ---------------
+// - RulerBorder -
+// ---------------
+
+#define RULER_BORDER_SIZEABLE ((sal_uInt16)0x0001)
+#define RULER_BORDER_MOVEABLE ((sal_uInt16)0x0002)
+#define RULER_BORDER_VARIABLE ((sal_uInt16)0x0004)
+#define RULER_BORDER_TABLE ((sal_uInt16)0x0008)
+#define RULER_BORDER_SNAP ((sal_uInt16)0x0010)
+#define RULER_BORDER_MARGIN ((sal_uInt16)0x0020)
+
+struct RulerBorder
+{
+ long nPos;
+ long nWidth;
+ sal_uInt16 nStyle;
+ //minimum/maximum position, supported for table borders/rows
+ long nMinPos;
+ long nMaxPos;
+};
+
+// ---------------
+// - RulerIndent -
+// ---------------
+
+#define RULER_INDENT_TOP ((sal_uInt16)0x0000)
+#define RULER_INDENT_BOTTOM ((sal_uInt16)0x0001)
+#define RULER_INDENT_BORDER ((sal_uInt16)0x0002)
+#define RULER_INDENT_STYLE ((sal_uInt16)0x000F)
+
+struct RulerIndent
+{
+ long nPos;
+ sal_uInt16 nStyle;
+};
+
+// ------------
+// - RulerTab -
+// ------------
+
+#define RULER_TAB_LEFT ((sal_uInt16)0x0000)
+#define RULER_TAB_RIGHT ((sal_uInt16)0x0001)
+#define RULER_TAB_DECIMAL ((sal_uInt16)0x0002)
+#define RULER_TAB_CENTER ((sal_uInt16)0x0003)
+#define RULER_TAB_DEFAULT ((sal_uInt16)0x0004)
+#define RULER_TAB_STYLE ((sal_uInt16)0x000F)
+#define RULER_TAB_RTL ((sal_uInt16)0x0010)
+
+struct RulerTab
+{
+ long nPos;
+ sal_uInt16 nStyle;
+};
+
+#define RULER_TAB_WIDTH 7
+#define RULER_TAB_HEIGHT 6
+
+// -------------
+// - RulerLine -
+// -------------
+
+struct RulerLine
+{
+ long nPos;
+ sal_uInt16 nStyle;
+};
+
+class ImplRulerData;
+// ---------
+// - Ruler -
+// ---------
+
+class SVT_DLLPUBLIC Ruler : public Window
+{
+private:
+ VirtualDevice maVirDev;
+ MapMode maMapMode;
+ long mnBorderOff;
+ long mnWinOff;
+ long mnWinWidth;
+ long mnWidth;
+ long mnHeight;
+ long mnVirOff;
+ long mnVirWidth;
+ long mnVirHeight;
+ long mnBorderWidth;
+ long mnStartDragPos;
+ long mnDragPos;
+ sal_uLong mnUpdateEvtId;
+ ImplRulerData* mpSaveData;
+ ImplRulerData* mpData;
+ ImplRulerData* mpDragData;
+ Rectangle maExtraRect;
+ WinBits mnWinStyle;
+ sal_uInt16 mnUnitIndex;
+ sal_uInt16 mnDragAryPos;
+ sal_uInt16 mnDragSize;
+ sal_uInt16 mnDragScroll;
+ sal_uInt16 mnDragModifier;
+ sal_uInt16 mnExtraStyle;
+ sal_uInt16 mnExtraClicks;
+ sal_uInt16 mnExtraModifier;
+ long mnCharWidth;
+ long mnLineHeight;
+
+ RulerExtra meExtraType;
+ RulerType meDragType;
+ MapUnit meSourceUnit;
+ FieldUnit meUnit;
+ Fraction maZoom;
+ sal_Bool mbCalc;
+ sal_Bool mbFormat;
+ sal_Bool mbDrag;
+ sal_Bool mbDragDelete;
+ sal_Bool mbDragCanceled;
+ sal_Bool mbAutoWinWidth;
+ sal_Bool mbActive;
+ sal_uInt8 mnUpdateFlags;
+ Link maStartDragHdl;
+ Link maDragHdl;
+ Link maEndDragHdl;
+ Link maClickHdl;
+ Link maDoubleClickHdl;
+ Link maExtraDownHdl;
+
+#ifdef _SV_RULER_CXX
+ SVT_DLLPRIVATE void ImplVDrawLine( long nX1, long nY1, long nX2, long nY2 );
+ SVT_DLLPRIVATE void ImplVDrawRect( long nX1, long nY1, long nX2, long nY2 );
+ SVT_DLLPRIVATE void ImplVDrawText( long nX, long nY, const String& rText, long nMin = LONG_MIN, long nMax = LONG_MAX );
+
+ SVT_DLLPRIVATE void ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter );
+ SVT_DLLPRIVATE void ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom );
+ SVT_DLLPRIVATE void ImplDrawIndent( const Polygon& rPoly, sal_uInt16 nStyle );
+ SVT_DLLPRIVATE void ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom );
+ SVT_DLLPRIVATE void ImplDrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle );
+ SVT_DLLPRIVATE void ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom );
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit( WinBits nWinBits );
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SVT_DLLPRIVATE void ImplCalc();
+ SVT_DLLPRIVATE void ImplFormat();
+ SVT_DLLPRIVATE void ImplInitExtraField( sal_Bool bUpdate );
+ SVT_DLLPRIVATE void ImplInvertLines( sal_Bool bErase = sal_False );
+ SVT_DLLPRIVATE void ImplDraw();
+ SVT_DLLPRIVATE void ImplDrawExtra( sal_Bool bPaint = sal_False );
+ SVT_DLLPRIVATE void ImplUpdate( sal_Bool bMustCalc = sal_False );
+ using Window::ImplHitTest;
+ SVT_DLLPRIVATE sal_Bool ImplHitTest( const Point& rPos,
+ ImplRulerHitTest* pHitTest,
+ sal_Bool bRequiredStyle = sal_False,
+ sal_uInt16 nRequiredStyle = 0 ) const;
+ SVT_DLLPRIVATE sal_Bool ImplDocHitTest( const Point& rPos, RulerType eDragType, ImplRulerHitTest* pHitTest ) const;
+ SVT_DLLPRIVATE sal_Bool ImplStartDrag( ImplRulerHitTest* pHitTest, sal_uInt16 nModifier );
+ SVT_DLLPRIVATE void ImplDrag( const Point& rPos );
+ SVT_DLLPRIVATE void ImplEndDrag();
+ DECL_DLLPRIVATE_LINK( ImplUpdateHdl, void* );
+#endif
+
+ // Forbidden and not implemented.
+ Ruler (const Ruler &);
+ Ruler & operator= (const Ruler &);
+
+protected:
+ long GetRulerVirHeight() const;
+
+public:
+ Ruler( Window* pParent, WinBits nWinStyle = WB_STDRULER );
+ virtual ~Ruler();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual long StartDrag();
+ virtual void Drag();
+ virtual void EndDrag();
+ virtual void Click();
+ virtual void DoubleClick();
+ virtual void ExtraDown();
+
+ void Activate();
+ void Deactivate();
+ sal_Bool IsActive() const { return mbActive; }
+
+ void SetWinPos( long nOff = 0, long nWidth = 0 );
+ long GetWinOffset() const { return mnWinOff; }
+ long GetWinWidth() const { return mnWinWidth; }
+ void SetPagePos( long nOff = 0, long nWidth = 0 );
+ long GetPageOffset() const;
+ long GetPageWidth() const;
+ void SetBorderPos( long nOff = 0 );
+ long GetBorderOffset() const { return mnBorderOff; }
+ Rectangle GetExtraRect() const { return maExtraRect; }
+
+ void SetUnit( FieldUnit eNewUnit );
+ FieldUnit GetUnit() const { return meUnit; }
+ void SetZoom( const Fraction& rNewZoom );
+ Fraction GetZoom() const { return maZoom; }
+
+ void SetSourceUnit( MapUnit eNewUnit ) { meSourceUnit = eNewUnit; }
+ MapUnit GetSourceUnit() const { return meSourceUnit; }
+
+ void SetExtraType( RulerExtra eNewExtraType, sal_uInt16 nStyle = 0 );
+ RulerExtra GetExtraType() const { return meExtraType; }
+ sal_uInt16 GetExtraStyle() const { return mnExtraStyle; }
+ sal_uInt16 GetExtraClicks() const { return mnExtraClicks; }
+ sal_uInt16 GetExtraModifier() const { return mnExtraModifier; }
+
+ sal_Bool StartDocDrag( const MouseEvent& rMEvt,
+ RulerType eDragType = RULER_TYPE_DONTKNOW );
+ RulerType GetDragType() const { return meDragType; }
+ long GetDragPos() const { return mnDragPos; }
+ sal_uInt16 GetDragAryPos() const { return mnDragAryPos; }
+ sal_uInt16 GetDragSize() const { return mnDragSize; }
+ sal_Bool IsDragDelete() const { return mbDragDelete; }
+ sal_Bool IsDragCanceled() const { return mbDragCanceled; }
+ sal_uInt16 GetDragScroll() const { return mnDragScroll; }
+ sal_uInt16 GetDragModifier() const { return mnDragModifier; }
+ sal_Bool IsDrag() const { return mbDrag; }
+ void CancelDrag();
+ long GetClickPos() const { return mnDragPos; }
+ RulerType GetClickType() const { return meDragType; }
+ sal_uInt16 GetClickAryPos() const { return mnDragAryPos; }
+ using Window::GetType;
+ RulerType GetType( const Point& rPos,
+ sal_uInt16* pAryPos = NULL ) const;
+
+ void SetNullOffset( long nPos );
+ long GetNullOffset() const;
+ void SetMargin1() { SetMargin1( 0, RULER_STYLE_INVISIBLE ); }
+ void SetMargin1( long nPos, sal_uInt16 nMarginStyle = RULER_MARGIN_SIZEABLE );
+ long GetMargin1() const;
+ void SetMargin2() { SetMargin2( 0, RULER_STYLE_INVISIBLE ); }
+ void SetMargin2( long nPos, sal_uInt16 nMarginStyle = RULER_MARGIN_SIZEABLE );
+ long GetMargin2() const;
+
+ void SetLines( sal_uInt16 n = 0, const RulerLine* pLineAry = NULL );
+
+ void SetBorders( sal_uInt16 n = 0, const RulerBorder* pBrdAry = NULL );
+
+ void SetIndents( sal_uInt16 n = 0, const RulerIndent* pIndentAry = NULL );
+
+ void SetTabs( sal_uInt16 n = 0, const RulerTab* pTabAry = NULL );
+ sal_uInt16 GetTabCount() const;
+ const RulerTab* GetTabs() const;
+
+ static void DrawTab( OutputDevice* pDevice,
+ const Point& rPos, sal_uInt16 nStyle );
+
+ void SetStyle( WinBits nStyle );
+ WinBits GetStyle() const { return mnWinStyle; }
+
+ void SetStartDragHdl( const Link& rLink ) { maStartDragHdl = rLink; }
+ const Link& GetStartDragHdl() const { return maStartDragHdl; }
+ void SetDragHdl( const Link& rLink ) { maDragHdl = rLink; }
+ const Link& GetDragHdl() const { return maDragHdl; }
+ void SetEndDragHdl( const Link& rLink ) { maEndDragHdl = rLink; }
+ const Link& GetEndDragHdl() const { return maEndDragHdl; }
+ void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
+ const Link& GetClickHdl() const { return maClickHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetExtraDownHdl( const Link& rLink ) { maExtraDownHdl = rLink; }
+ const Link& GetExtraDownHdl() const { return maExtraDownHdl; }
+
+ //set text direction right-to-left
+ void SetTextRTL(sal_Bool bRTL);
+
+ void SetCharWidth( long nWidth ) { mnCharWidth = nWidth ; }
+ void SetLineHeight( long nHeight ) { mnLineHeight = nHeight ; }
+
+ void DrawTicks();
+};
+
+#endif // _RULER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/sampletext.hxx b/include/svtools/sampletext.hxx
new file mode 100644
index 000000000000..9d491cf449bd
--- /dev/null
+++ b/include/svtools/sampletext.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:
+ *
+ */
+#ifndef INCLUDED_SVTOOLS_SAMPLETEXT_HXX
+#define INCLUDED_SVTOOLS_SAMPLETEXT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <rtl/ustring.hxx>
+#include <unicode/uscript.h>
+#include <i18nlangtag/lang.h>
+#include <com/sun/star/i18n/ScriptType.hpp>
+#include <vcl/fontcapabilities.hxx>
+
+class OutputDevice;
+class Font;
+
+SVT_DLLPUBLIC UScriptCode otCoverageToScript(vcl::UnicodeCoverage::UnicodeCoverageEnum eOTCoverage);
+
+SVT_DLLPUBLIC bool isSymbolFont(const Font &rFont);
+SVT_DLLPUBLIC bool isOpenSymbolFont(const Font &rFont);
+
+SVT_DLLPUBLIC bool canRenderNameOfSelectedFont(OutputDevice &rDevice);
+
+//These ones are typically for use in the font dropdown box beside the
+//fontname, so say things roughly like "Script/Alphabet/Name-Of-Major-Language"
+SVT_DLLPUBLIC OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice &rDevice);
+SVT_DLLPUBLIC OUString makeShortRepresentativeTextForSelectedFont(OutputDevice &rDevice);
+SVT_DLLPUBLIC OUString makeShortRepresentativeTextForScript(UScriptCode eScript);
+//For the cases where the font doesn't fully support a script, but has partial support
+//for a useful subset
+SVT_DLLPUBLIC OUString makeShortMinimalTextForScript(UScriptCode eScript);
+
+//These ones are typically for use in the font preview window in format character
+SVT_DLLPUBLIC OUString makeRepresentativeTextForFont(sal_Int16 nScriptType, const Font &rFont);
+SVT_DLLPUBLIC OUString makeRepresentativeTextForLanguage(LanguageType eLang);
+SVT_DLLPUBLIC OUString makeRepresentativeTextForScript(UScriptCode eScript);
+SVT_DLLPUBLIC OUString makeMinimalTextForScript(UScriptCode eScript);
+
+
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/scriptedtext.hxx b/include/svtools/scriptedtext.hxx
new file mode 100644
index 000000000000..7e3928640dfe
--- /dev/null
+++ b/include/svtools/scriptedtext.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 _SVTOOLS_SCRIPTEDTEXT_HXX
+#define _SVTOOLS_SCRIPTEDTEXT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/i18n/XBreakIterator.hpp>
+
+
+class OutputDevice;
+class Font;
+class SvtScriptedTextHelper_Impl;
+class Size;
+class Point;
+
+
+//_____________________________________________________________________________
+
+/**
+This class provides drawing text with different script types on any output devices.
+*/
+class SVT_DLLPUBLIC SvtScriptedTextHelper
+{
+private:
+ SvtScriptedTextHelper_Impl* mpImpl; /// Implementation of class functionality.
+
+ /** Assignment operator not implemented to prevent usage. */
+ SvtScriptedTextHelper& operator=( const SvtScriptedTextHelper& );
+
+public:
+ /** Constructor sets an output device and no fonts.
+ @param _rOutDevice
+ A reference to an output device. */
+ SvtScriptedTextHelper( OutputDevice& _rOutDevice );
+
+ /** Copy constructor. */
+ SvtScriptedTextHelper(
+ const SvtScriptedTextHelper& _rCopy );
+
+ /** Destructor. */
+ virtual ~SvtScriptedTextHelper();
+
+ /** Sets new fonts and recalculates the text width.
+ @param _pLatinFont
+ The font for latin characters.
+ @param _pAsianFont
+ The font for asian characters.
+ @param _pCmplxFont
+ The font for complex text layout. */
+ void SetFonts( Font* _pLatinFont, Font* _pAsianFont, Font* _pCmplxFont );
+
+ /** Sets the default font of the current output device to all script types. */
+ void SetDefaultFont();
+
+ /** Sets a new text and calculates all script breaks and the text width.
+ @param _rText
+ The new text.
+ @param _xBreakIter
+ The break iterator for iterating through the script portions. */
+ void SetText(
+ const OUString& _rText,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >& _xBreakIter );
+
+ /** Returns a size struct containing the width and height of the text in the current output device.
+ @return A size struct with the text dimensions. */
+ const Size& GetTextSize() const;
+
+ /** Draws the text in the current output device.
+ @param _rPos
+ The position of the top left edge of the text. */
+ void DrawText( const Point& _rPos );
+};
+
+//_____________________________________________________________________________
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/scrwin.hxx b/include/svtools/scrwin.hxx
new file mode 100644
index 000000000000..f9af5b9aa620
--- /dev/null
+++ b/include/svtools/scrwin.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 _SCRWIN_HXX
+#define _SCRWIN_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <vcl/scrbar.hxx>
+
+class DataChangedEvent;
+
+// -------------------------
+// - ScrollableWindow-Type -
+// -------------------------
+
+typedef sal_uInt16 ScrollableWindowFlags;
+
+#define SCRWIN_THUMBDRAGGING 1
+#define SCRWIN_VCENTER 2
+#define SCRWIN_HCENTER 4
+#define SCRWIN_DEFAULT (SCRWIN_THUMBDRAGGING | SCRWIN_VCENTER | SCRWIN_HCENTER)
+
+// --------------------
+// - ScrollableWindow -
+// --------------------
+
+class SVT_DLLPUBLIC ScrollableWindow: public Window
+{
+private:
+ Point aPixOffset; // offset to virtual window (pixel)
+ Size aTotPixSz; // total size of virtual window (pixel)
+ long nLinePixH; // size of a line/column (pixel)
+ long nColumnPixW;
+
+ ScrollBar aVScroll; // the scrollbars
+ ScrollBar aHScroll;
+ ScrollBarBox aCornerWin; // window in the bottom right corner
+ sal_Bool bScrolling:1, // user controlled scrolling
+ bHandleDragging:1, // scroll window while dragging
+ bHCenter:1,
+ bVCenter:1;
+
+#ifdef _SVT_SCRWIN_CXX
+ SVT_DLLPRIVATE void ImpInitialize( ScrollableWindowFlags nFlags );
+ DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * );
+ DECL_DLLPRIVATE_LINK( EndScrollHdl, ScrollBar * );
+#endif
+
+public:
+ ScrollableWindow( Window* pParent, WinBits nBits = 0,
+ ScrollableWindowFlags = SCRWIN_DEFAULT );
+
+ virtual void Resize();
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void DataChanged( const DataChangedEvent& rDEvt );
+
+ virtual void StartScroll();
+ virtual void EndScroll( long nDeltaX, long nDeltaY );
+
+ using OutputDevice::SetMapMode;
+ virtual void SetMapMode( const MapMode& rNewMapMode );
+ virtual MapMode GetMapMode() const;
+
+ void SetTotalSize( const Size& rNewSize );
+ Size GetTotalSize() { return PixelToLogic( aTotPixSz ); }
+
+ using Window::Scroll;
+ virtual void Scroll( long nDeltaX, long nDeltaY, sal_uInt16 nFlags = 0 );
+
+private:
+ SVT_DLLPRIVATE Size GetOutputSizePixel() const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/sfxecode.hxx b/include/svtools/sfxecode.hxx
new file mode 100644
index 000000000000..e5b4026a0ec0
--- /dev/null
+++ b/include/svtools/sfxecode.hxx
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SFXECODE_HXX
+#define _SFXECODE_HXX
+
+#include <tools/errcode.hxx>
+
+#define ERRCODE_SFX_NOSTDTEMPLATE (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|1)
+#define ERRCODE_SFX_NOTATEMPLATE (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|2)
+#define ERRCODE_SFX_GENERAL (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|3)
+#define ERRCODE_SFX_DOLOADFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_READ|4)
+#define ERRCODE_SFX_DOSAVECOMPLETEDFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_WRITE|5)
+#define ERRCODE_SFX_COMMITFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_WRITE|6)
+#define ERRCODE_SFX_HANDSOFFFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|7)
+#define ERRCODE_SFX_DOINITNEWFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|8)
+#define ERRCODE_SFX_CANTREADDOCINFO (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|9)
+#define ERRCODE_SFX_ALREADYOPEN (ERRCODE_AREA_SFX|ERRCODE_CLASS_ALREADYEXISTS|10)
+#define ERRCODE_SFX_WRONGPASSWORD (ERRCODE_AREA_SFX|ERRCODE_CLASS_READ|11)
+#define ERRCODE_SFX_DOCUMENTREADONLY (ERRCODE_AREA_SFX|ERRCODE_CLASS_WRITE|12)
+#define ERRCODE_SFX_OLEGENERAL (ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|14)
+#define ERRCODE_SFXMSG_STYLEREPLACE (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|13)
+#define ERRCODE_SFX_TEMPLATENOTFOUND (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|15)
+#define ERRCODE_SFX_ISRELATIVE (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|16)
+#define ERRCODE_SFX_FORCEDOCLOAD (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|17)
+
+#define ERRCODE_SFX_CANTFINDORIGINAL (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|19)
+#define ERRCODE_SFX_RESTART (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|20)
+#define ERRCODE_SFX_CANTCREATECONTENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|21)
+#define ERRCODE_SFX_CANTCREATELINK (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|22)
+#define ERRCODE_SFX_WRONGBMKFORMAT (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|23)
+#define ERRCODE_SFX_WRONGICONFILE (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|24)
+#define ERRCODE_SFX_CANTDELICONFILE (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|25)
+#define ERRCODE_SFX_CANTWRITEICONFILE (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|26)
+#define ERRCODE_SFX_CANTRENAMECONTENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|27)
+#define ERRCODE_SFX_INVALIDBMKPATH (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|28)
+#define ERRCODE_SFX_CANTWRITEURLCFGFILE (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|29)
+#define ERRCODE_SFX_WRONGURLCFGFORMAT (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|30)
+#define ERRCODE_SFX_NODOCUMENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|31)
+#define ERRCODE_SFX_INVALIDLINK (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|32)
+#define ERRCODE_SFX_INVALIDTRASHPATH (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|33)
+#define ERRCODE_SFX_NOTRESTORABLE (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|34)
+#define ERRCODE_SFX_NOTRASH (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|35)
+#define ERRCODE_SFX_INVALIDSYNTAX (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|36)
+#define ERRCODE_SFX_CANTCREATEFOLDER (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|37)
+#define ERRCODE_SFX_CANTRENAMEFOLDER (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|38)
+#define ERRCODE_SFX_WRONG_CDF_FORMAT (ERRCODE_AREA_SFX| ERRCODE_CLASS_READ | 39)
+#define ERRCODE_SFX_EMPTY_SERVER (ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|40)
+#define ERRCODE_SFX_NO_ABOBOX (ERRCODE_AREA_SFX| ERRCODE_CLASS_READ | 41)
+#define ERRCODE_SFX_CANTGETPASSWD (ERRCODE_AREA_SFX| ERRCODE_CLASS_READ | 42)
+#define ERRCODE_SFX_TARGETFILECORRUPTED (ERRCODE_AREA_SFX| ERRCODE_CLASS_READ | 43)
+#define ERRCODE_SFX_NOMOREDOCUMENTSALLOWED (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 44)
+#define ERRCODE_SFX_NOFILTER (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|45)
+#define ERRCODE_SFX_FORCEQUIET (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|47)
+#define ERRCODE_SFX_CONSULTUSER (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|48)
+#define ERRCODE_SFX_NEVERCHECKCONTENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|49)
+#define ERRCODE_SFX_CANTCREATEBACKUP (ERRCODE_AREA_SFX | ERRCODE_CLASS_CREATE | 50)
+#define ERRCODE_SFX_MACROS_SUPPORT_DISABLED (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 51)
+#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 52)
+#define ERRCODE_SFX_BROKENSIGNATURE (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 53)
+#define ERRCODE_SFX_SHARED_NOPASSWORDCHANGE (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 54)
+#define ERRCODE_SFX_INCOMPLETE_ENCRYPTION (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 55)
+#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED_MAC (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 56)
+#define ERRCODE_SFX_FORMAT_ROWCOL (ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 57)
+#define ERRCODE_SFX_VBASIC_CANTSAVE_STORAGE (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 58)
+
+
+//Dies und das
+#define ERRCTX_ERROR 21
+#define ERRCTX_WARNING 22
+
+//Documentkontexte
+#define ERRCTX_SFX_LOADTEMPLATE 1
+#define ERRCTX_SFX_SAVEDOC 2
+#define ERRCTX_SFX_SAVEASDOC 3
+#define ERRCTX_SFX_DOCINFO 4
+#define ERRCTX_SFX_DOCTEMPLATE 5
+#define ERRCTX_SFX_MOVEORCOPYCONTENTS 6
+
+//Appkontexte
+#define ERRCTX_SFX_DOCMANAGER 50
+#define ERRCTX_SFX_OPENDOC 51
+#define ERRCTX_SFX_NEWDOCDIRECT 52
+#define ERRCTX_SFX_NEWDOC 53
+
+//Organizerkontexte
+#define ERRCTX_SFX_CREATEOBJSH 70
+
+//BASIC-Kontexte
+#define ERRCTX_SFX_LOADBASIC 80
+
+//Addressbook contexts
+#define ERRCTX_SFX_SEARCHADDRESS 90
+
+#endif // #ifndef _SFXECODE_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/slidesorterbaropt.hxx b/include/svtools/slidesorterbaropt.hxx
new file mode 100644
index 000000000000..cb2d996fb03b
--- /dev/null
+++ b/include/svtools/slidesorterbaropt.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_SVTOOLS_SLIDESORTERBAROPT_HXX
+#define INCLUDED_SVTOOLS_SLIDESORTERBAROPT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+/** forward declaration to our private date container implementation
+
+ We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*/
+class SvtSlideSorterBarOptions_Impl;
+
+/** collect information about sidebar group
+
+ \attention This class is partially threadsafe.
+*/
+class SVT_DLLPUBLIC SvtSlideSorterBarOptions: public utl::detail::Options
+{
+ public:
+ /** standard constructor and destructor
+
+ This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ \sa member m_nRefCount
+ \sa member m_pDataContainer
+ */
+ SvtSlideSorterBarOptions();
+ virtual ~SvtSlideSorterBarOptions();
+
+ bool GetVisibleImpressView() const;
+ void SetVisibleImpressView( bool bVisible );
+ bool GetVisibleOutlineView() const;
+ void SetVisibleOutlineView( bool bVisible );
+ bool GetVisibleNotesView() const;
+ void SetVisibleNotesView( bool bVisible );
+ bool GetVisibleHandoutView() const;
+ void SetVisibleHandoutView( bool bVisible );
+ bool GetVisibleSlideSorterView() const;
+ void SetVisibleSlideSorterView( bool bVisible );
+ bool GetVisibleDrawView() const;
+ void SetVisibleDrawView( bool bVisible );
+
+
+ private:
+ /** return a reference to a static mutex
+
+ These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ \return A reference to a static mutex member.*/
+ SVT_DLLPRIVATE static ::osl::Mutex& GetInitMutex();
+
+ private:
+
+ /**
+ \attention
+ Don't initialize these static member in these header!
+ \li Double defined symbols will be detected ...
+ \li and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+ static SvtSlideSorterBarOptions_Impl* m_pDataContainer ; ///< impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; ///< internal ref count mechanism
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/soerr.hxx b/include/svtools/soerr.hxx
new file mode 100644
index 000000000000..e6d366327744
--- /dev/null
+++ b/include/svtools/soerr.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 _SOERR_HXX
+#define _SOERR_HXX
+
+#include <tools/errcode.hxx>
+
+// Fehler Codes
+#define RID_SO_ERROR_HANDLER 32000
+
+#define SO_ERR() (ERRCODE_AREA_SO | ERRCODE_CLASS_SO)
+#define SO_WRN() (ERRCODE_AREA_SO | ERRCODE_CLASS_SO | ERRCODE_WARNING_MASK)
+
+#define ERRCODE_SO_GENERALERROR (SO_ERR() | 1)
+#define ERRCODE_SO_CANT_BINDTOSOURCE (SO_ERR() | 2)
+#define ERRCODE_SO_NOCACHE_UPDATED (SO_ERR() | 3)
+#define ERRCODE_SO_SOMECACHES_NOTUPDATED (SO_WRN() | 4)
+#define ERRCODE_SO_MK_UNAVAILABLE (SO_ERR() | 5)
+#define ERRCODE_SO_E_CLASSDIFF (SO_ERR() | 6)
+#define ERRCODE_SO_MK_NO_OBJECT (SO_ERR() | 7)
+#define ERRCODE_SO_MK_EXCEEDED_DEADLINE (SO_ERR() | 8)
+#define ERRCODE_SO_MK_CONNECT_MANUALLY (SO_ERR() | 9)
+#define ERRCODE_SO_MK_INTERMEDIATE_INTERFACE_NOT_SUPPORTED (SO_ERR() | 10)
+#define ERRCODE_SO_NO_INTERFACE (SO_ERR() | 11)
+#define ERRCODE_SO_OUT_OF_MEMORY (SO_ERR() | 12)
+#define ERRCODE_SO_MK_SYNTAX (SO_ERR() | 13)
+#define ERRCODE_SO_MK_REDUCED_TO_SELF (SO_WRN() | 14)
+#define ERRCODE_SO_MK_NO_INVERSE (SO_ERR() | 15)
+#define ERRCODE_SO_MK_NO_PREFIX (SO_ERR() | 16)
+#define ERRCODE_SO_MK_HIM (SO_WRN() | 17)
+#define ERRCODE_SO_MK_US (SO_WRN() | 18)
+#define ERRCODE_SO_MK_ME (SO_WRN() | 19)
+#define ERRCODE_SO_MK_NOT_BINDABLE (SO_ERR() | 20)
+#define ERRCODE_SO_NOT_IMPLEMENTED (SO_ERR() | 21)
+#define ERRCODE_SO_MK_NO_STORAGE (SO_ERR() | 22)
+#define ERRCODE_SO_FALSE (SO_WRN() | 23)
+#define ERRCODE_SO_MK_NEED_GENERIC (SO_ERR() | 24)
+#define ERRCODE_SO_PENDING (SO_ERR() | 25)
+#define ERRCODE_SO_NOT_INPLACEACTIVE (SO_ERR() | 26)
+#define ERRCODE_SO_LINDEX (SO_ERR() | 27)
+#define ERRCODE_SO_CANNOT_DOVERB_NOW (SO_WRN() | 28)
+#define ERRCODE_SO_OLEOBJ_INVALIDHWND (SO_WRN() | 29)
+#define ERRCODE_SO_NOVERBS (SO_ERR() | 30)
+#define ERRCODE_SO_INVALIDVERB (SO_WRN() | 31)
+#define ERRCODE_SO_MK_CONNECT (SO_ERR() | 32)
+#define ERRCODE_SO_NOTIMPL (SO_ERR() | 33)
+#define ERRCODE_SO_MK_CANTOPENFILE (SO_ERR() | 34)
+
+// Fehler Contexte
+#define RID_SO_ERRCTX 32001
+
+#define ERRCTX_SO_DOVERB 1
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/sores.hxx b/include/svtools/sores.hxx
new file mode 100644
index 000000000000..4264f2197f62
--- /dev/null
+++ b/include/svtools/sores.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 .
+ */
+
+// Strings
+#define STR_ERROR_OBJNOCREATE 32014
+#define STR_ERROR_OBJNOCREATE_FROM_FILE 32015
+#define STR_ERROR_OBJNOCREATE_PLUGIN 32018
+#define STR_FURTHER_OBJECT 32026
+#define STR_UNKNOWN_SOURCE 32027
+
+#define BMP_PLUGIN 32000
+#define BMP_OLEOBJ 32001
+#define MB_PLUGIN 32000
+#define MI_PLUGIN 32000
+#define MI_PLUGIN_DEACTIVATE 1
+
+// Sot Format Strings
+#define STR_FORMAT_START 32100
+#define STR_FORMAT_STRING (STR_FORMAT_START + 1)
+#define STR_FORMAT_BITMAP (STR_FORMAT_START + 2)
+#define STR_FORMAT_GDIMETAFILE (STR_FORMAT_START + 3)
+#define STR_FORMAT_RTF (STR_FORMAT_START + 7)
+#define STR_FORMAT_ID_DRAWING (STR_FORMAT_START + 8)
+#define STR_FORMAT_ID_SVXB (STR_FORMAT_START + 9)
+#define STR_FORMAT_ID_INTERNALLINK_STATE (STR_FORMAT_START + 13)
+#define STR_FORMAT_ID_SOLK (STR_FORMAT_START + 14)
+#define STR_FORMAT_ID_NETSCAPE_BOOKMARK (STR_FORMAT_START + 15)
+#define STR_FORMAT_ID_STARSERVER (STR_FORMAT_START + 19)
+#define STR_FORMAT_ID_STAROBJECT (STR_FORMAT_START + 20)
+#define STR_FORMAT_ID_APPLETOBJECT (STR_FORMAT_START + 21)
+#define STR_FORMAT_ID_PLUGIN_OBJECT (STR_FORMAT_START + 22)
+#define STR_FORMAT_ID_STARWRITER_30 (STR_FORMAT_START + 23)
+#define STR_FORMAT_ID_STARWRITER_40 (STR_FORMAT_START + 24)
+#define STR_FORMAT_ID_STARWRITER_50 (STR_FORMAT_START + 25)
+#define STR_FORMAT_ID_STARWRITERWEB_40 (STR_FORMAT_START + 26)
+#define STR_FORMAT_ID_STARWRITERWEB_50 (STR_FORMAT_START + 27)
+#define STR_FORMAT_ID_STARWRITERGLOB_40 (STR_FORMAT_START + 28)
+#define STR_FORMAT_ID_STARWRITERGLOB_50 (STR_FORMAT_START + 29)
+#define STR_FORMAT_ID_STARDRAW (STR_FORMAT_START + 30)
+#define STR_FORMAT_ID_STARDRAW_40 (STR_FORMAT_START + 31)
+#define STR_FORMAT_ID_STARIMPRESS_50 (STR_FORMAT_START + 32)
+#define STR_FORMAT_ID_STARDRAW_50 (STR_FORMAT_START + 33)
+#define STR_FORMAT_ID_STARCALC (STR_FORMAT_START + 34)
+#define STR_FORMAT_ID_STARCALC_40 (STR_FORMAT_START + 35)
+#define STR_FORMAT_ID_STARCALC_50 (STR_FORMAT_START + 36)
+#define STR_FORMAT_ID_STARCHART (STR_FORMAT_START + 37)
+#define STR_FORMAT_ID_STARCHART_40 (STR_FORMAT_START + 38)
+#define STR_FORMAT_ID_STARCHART_50 (STR_FORMAT_START + 39)
+#define STR_FORMAT_ID_STARIMAGE (STR_FORMAT_START + 40)
+#define STR_FORMAT_ID_STARIMAGE_40 (STR_FORMAT_START + 41)
+#define STR_FORMAT_ID_STARIMAGE_50 (STR_FORMAT_START + 42)
+#define STR_FORMAT_ID_STARMATH (STR_FORMAT_START + 43)
+#define STR_FORMAT_ID_STARMATH_40 (STR_FORMAT_START + 44)
+#define STR_FORMAT_ID_STARMATH_50 (STR_FORMAT_START + 45)
+#define STR_FORMAT_ID_STAROBJECT_PAINTDOC (STR_FORMAT_START + 46)
+#define STR_FORMAT_ID_HTML (STR_FORMAT_START + 48)
+#define STR_FORMAT_ID_HTML_SIMPLE (STR_FORMAT_START + 49)
+#define STR_FORMAT_ID_BIFF_5 (STR_FORMAT_START + 52)
+#define STR_FORMAT_ID_BIFF_8 (STR_FORMAT_START + 53)
+#define STR_FORMAT_ID_SYLK (STR_FORMAT_START + 54)
+#define STR_FORMAT_ID_LINK (STR_FORMAT_START + 56)
+#define STR_FORMAT_ID_DIF (STR_FORMAT_START + 57)
+#define STR_FORMAT_ID_MSWORD_DOC (STR_FORMAT_START + 60)
+#define STR_FORMAT_ID_STAR_FRAMESET_DOC (STR_FORMAT_START + 61)
+#define STR_FORMAT_ID_OFFICE_DOC (STR_FORMAT_START + 62)
+#define STR_FORMAT_ID_NOTES_DOCINFO (STR_FORMAT_START + 63)
+#define STR_FORMAT_ID_SFX_DOC (STR_FORMAT_START + 66)
+#define STR_FORMAT_ID_FILEGRPDESCRIPTOR (STR_FORMAT_START + 86)
+#define STR_FORMAT_ID_STARCHARTDOCUMENT_50 (STR_FORMAT_START + 102)
+#define STR_FORMAT_ID_GRAPHOBJ (STR_FORMAT_START + 103)
+#define STR_FORMAT_ID_STARWRITER_60 (STR_FORMAT_START + 104)
+#define STR_FORMAT_ID_STARWRITERWEB_60 (STR_FORMAT_START + 105)
+#define STR_FORMAT_ID_STARWRITERGLOB_60 (STR_FORMAT_START + 106)
+#define STR_FORMAT_ID_STARDRAW_60 (STR_FORMAT_START + 107)
+#define STR_FORMAT_ID_STARIMPRESS_60 (STR_FORMAT_START + 108)
+#define STR_FORMAT_ID_STARCALC_60 (STR_FORMAT_START + 109)
+#define STR_FORMAT_ID_STARCHART_60 (STR_FORMAT_START + 110)
+#define STR_FORMAT_ID_STARMATH_60 (STR_FORMAT_START + 111)
+#define STR_FORMAT_ID_WMF (STR_FORMAT_START + 112)
+#define STR_FORMAT_ID_DBACCESS_QUERY (STR_FORMAT_START + 113)
+#define STR_FORMAT_ID_DBACCESS_TABLE (STR_FORMAT_START + 114)
+#define STR_FORMAT_ID_DBACCESS_COMMAND (STR_FORMAT_START + 115)
+#define STR_FORMAT_ID_DIALOG_60 (STR_FORMAT_START + 116)
+#define STR_FORMAT_ID_HTML_NO_COMMENT (STR_FORMAT_START + 119)
+#define STR_FORMAT_END (STR_FORMAT_ID_HTML_NO_COMMENT)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/statusbarcontroller.hxx b/include/svtools/statusbarcontroller.hxx
new file mode 100644
index 000000000000..eba45e543525
--- /dev/null
+++ b/include/svtools/statusbarcontroller.hxx
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVTOOLS_STATUSBARCONTROLLER_HXX
+#define _SVTOOLS_STATUSBARCONTROLLER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/util/XUpdatable.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/XStatusbarController.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/broadcasthelper.hxx>
+
+#include <boost/unordered_map.hpp>
+
+#include <tools/gen.hxx>
+
+namespace svt
+{
+
+class SVT_DLLPUBLIC StatusbarController : public ::com::sun::star::frame::XStatusListener,
+ public ::com::sun::star::frame::XStatusbarController,
+ public ::com::sun::star::lang::XInitialization,
+ public ::com::sun::star::util::XUpdatable,
+ public ::com::sun::star::lang::XComponent,
+ public ::comphelper::OBaseMutex,
+ public ::cppu::OWeakObject
+{
+ public:
+ StatusbarController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
+ const OUString& aCommandURL,
+ unsigned short nID );
+ StatusbarController();
+ virtual ~StatusbarController();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getFrameInterface() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > getURLTransformer() const;
+
+ ::Rectangle getControlRect() const;
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XUpdatable
+ virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XStatusbarController
+ virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL command( const ::com::sun::star::awt::Point& aPos,
+ ::sal_Int32 nCommand,
+ ::sal_Bool bMouseEvent,
+ const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
+ const ::com::sun::star::awt::Rectangle& rOutputRectangle,
+ ::sal_Int32 nItemId, ::sal_Int32 nStyle ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ struct Listener
+ {
+ Listener( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& rDispatch ) :
+ aURL( rURL ), xDispatch( rDispatch ) {}
+
+ ::com::sun::star::util::URL aURL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
+ };
+
+ typedef ::boost::unordered_map< OUString,
+ com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >,
+ OUStringHash,
+ ::std::equal_to< OUString > > URLToDispatchMap;
+
+ // methods to support status forwarder, known by the old sfx2 toolbox controller implementation
+ void addStatusListener( const OUString& aCommandURL );
+ void bindListener();
+
+ // execute methods
+ // execute bound status bar controller command/execute various commands
+ void execute( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs );
+ void execute( const OUString& aCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs );
+
+ sal_Bool m_bInitialized : 1,
+ m_bDisposed : 1;
+ unsigned short m_nID;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xParentWindow;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ OUString m_aCommandURL;
+ URLToDispatchMap m_aListenerMap;
+ ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
+};
+
+}
+
+#endif // _SVTOOLS_TOOLBOXCONTROLLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/stdctrl.hxx b/include/svtools/stdctrl.hxx
new file mode 100644
index 000000000000..77ca119ab363
--- /dev/null
+++ b/include/svtools/stdctrl.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 _STDCTRL_HXX
+#define _STDCTRL_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
+
+// -------------
+// - FixedInfo -
+// -------------
+
+class SVT_DLLPUBLIC FixedInfo : public FixedText
+{
+public:
+ FixedInfo( Window* pParent, WinBits nWinStyle = WB_LEFT );
+ FixedInfo( Window* pParent, const ResId& rResId );
+};
+
+#endif // _STDCTRL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/stdmenu.hxx b/include/svtools/stdmenu.hxx
new file mode 100644
index 000000000000..4c968db36842
--- /dev/null
+++ b/include/svtools/stdmenu.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 _STDMENU_HXX
+#define _STDMENU_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <vcl/menu.hxx>
+
+class FontList;
+class FontInfo;
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class FontNameMenu
+
+Beschreibung
+
+Erlaubt die Auswahl von Fonts. Das Menu wird ueber Fill mit den FontNamen
+gefuellt. Fill sortiert automatisch die FontNamen (inkl. aller Umlaute und
+sprachabhaengig). Mit SetCurName()/GetCurName() kann der aktuelle Fontname
+gesetzt/abgefragt werden. Wenn SetCurName() mit einem leeren String
+aufgerufen wird, wird kein Eintrag als aktueller angezeigt (fuer DontKnow).
+Vor dem Selectaufruf wird der ausgewaehlte Name automatisch als aktueller
+gesetzt und wuerde beim naechsten Aufruf auch als aktueller Name angezeigt
+werden. Deshalb sollte vor PopupMenu::Execute() gegebenenfalls mit
+SetCurName() der aktuelle Fontname gesetzt werden.
+
+Da die Id's und der interne Aufbau des Menus nicht bekannt ist, muss ein
+Select-Handler gesetzt werden, um die Auswahl eines Namens mitzubekommen.
+
+In dieses Menu koennen keine weiteren Items eingefuegt werden.
+
+Spaeter soll auch das Menu die gleichen Bitmaps anzeigen, wie die
+FontNameBox. Auf den Systemen, wo Menues nicht automatisch scrollen,
+wird spaeter wohl ein A-Z Menu ziwschengeschaltet. Da ein Menu bei vielen
+installierten Fonts bisher schon immer lange gebraucht hat, sollte dieses
+Menu schon jetzt nur einmal erzeugt werden (da sonst das Kontextmenu bis
+zu 10-Sekunden fuer die Erzeugung brauchen koennte).
+
+Querverweise
+
+FontList; FontSizeMenu; FontNameBox
+
+--------------------------------------------------------------------------
+
+class FontSizeMenu
+
+Beschreibung
+
+Erlaubt die Auswahl von Fontgroessen. Ueber Fill wird das FontSizeMenu
+gefuellt und ueber GetCurHeight() kann die ausgewaehlte Fontgroesse
+abgefragt werden. Mit SetCurHeight()/GetCurHeight() kann die aktuelle
+Fontgroesse gesetzt/abgefragt werden. Wenn SetCurHeight() mit 0 aufgerufen
+wird, wird kein Eintrag als aktueller angezeigt (fuer DontKnow). Vor dem
+Selectaufruf wird die ausgewaehlte Groesse automatisch als aktuelle gesetzt
+und wuerde beim naechsten Aufruf auch als aktuelle Groesse angezeigt werden.
+Deshalb sollte vor PopupMenu::Execute() gegebenenfalls mit SetCurHeight()
+die aktuelle Groesse gesetzt werden. Da die Groessen vom ausgewaehlten Font
+abhaengen, sollte nach einer Aenderung des Fontnamen das Menu mit Fill mit
+den Groessen des Fonts neu gefuellt werden.
+
+Da die Id's und der interne Aufbau des Menus nicht bekannt ist, muss ein
+Select-Handler gesetzt werden, um die Auswahl einer Groesse mitzubekommen.
+
+Alle Groessen werden in 10tel Point angegeben.
+
+In dieses Menu koennen keine weiteren Items eingefuegt werden.
+
+Spaeter soll das Menu je nach System die Groessen anders darstelllen. Zum
+Beispiel koennte der Mac spaeter vielleicht einmal die Groessen als Outline
+darstellen, die als Bitmap-Fonts vorhanden sind.
+
+Querverweise
+
+FontList; FontNameMenu; FontSizeBox
+
+*************************************************************************/
+
+// ----------------
+// - FontNameMenu -
+// ----------------
+
+class SVT_DLLPUBLIC FontNameMenu : public PopupMenu
+{
+private:
+ OUString maCurName;
+ Link maSelectHdl;
+ Link maHighlightHdl;
+
+public:
+ FontNameMenu();
+ virtual ~FontNameMenu();
+
+ virtual void Select();
+ virtual void Highlight();
+
+ void Fill( const FontList* pList );
+
+ void SetCurName( const OUString& rName );
+ const OUString& GetCurName() const { return maCurName; }
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetHighlightHdl( const Link& rLink ) { maHighlightHdl = rLink; }
+ const Link& GetHighlightHdl() const { return maHighlightHdl; }
+};
+
+// ----------------
+// - FontSizeMenu -
+// ----------------
+
+class SVT_DLLPUBLIC FontSizeMenu : public PopupMenu
+{
+private:
+ long* mpHeightAry;
+ long mnCurHeight;
+ Link maSelectHdl;
+ Link maHighlightHdl;
+
+public:
+ FontSizeMenu();
+ ~FontSizeMenu();
+
+ virtual void Select();
+ virtual void Highlight();
+
+ void Fill( const FontInfo& rInfo, const FontList* pList );
+
+ void SetCurHeight( long nHeight );
+ long GetCurHeight() const { return mnCurHeight; }
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetHighlightHdl( const Link& rLink ) { maHighlightHdl = rLink; }
+ const Link& GetHighlightHdl() const { return maHighlightHdl; }
+};
+
+#endif // _STDMENU_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/stringtransfer.hxx b/include/svtools/stringtransfer.hxx
new file mode 100644
index 000000000000..c496b34b1361
--- /dev/null
+++ b/include/svtools/stringtransfer.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 _SVTOOLS_STRINGTRANSFER_HXX_
+#define _SVTOOLS_STRINGTRANSFER_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <svtools/transfer.hxx>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= OStringTransferable
+ //====================================================================
+ class SVT_DLLPUBLIC OStringTransferable : public TransferableHelper
+ {
+ protected:
+ OUString m_sContent;
+
+ public:
+ OStringTransferable(const OUString& _rContent);
+
+ protected:
+ // TransferableHelper overridables
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& _rFlavor );
+ };
+
+ //====================================================================
+ //= OStringTransfer
+ //====================================================================
+ class OStringTransfer
+ {
+ public:
+ /** copies the string given into the system clipboard
+ <p>Beware: In opposite to the old DragServer::CopyString, this method does not <em>add</em> the string
+ to the clipboard, instead the old clipboard content is <em>replaced</em>!</p>
+ */
+ SVT_DLLPUBLIC static void CopyString( const OUString& _rContent, Window* _pWindow = NULL );
+
+ /** extracts a string from the system clipboard given
+ @return <TRUE/> if the extraction was successful, i.e. if the clipboard contained a string content
+ */
+ SVT_DLLPUBLIC static sal_Bool PasteString( OUString& _rContent, Window* _pWindow = NULL );
+
+ /** starts dragging a simple string
+ */
+ SVT_DLLPUBLIC static void StartStringDrag( const OUString& _rContent, Window* _pWindow, sal_Int8 _nDragSourceActions );
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // _SVTOOLS_STRINGTRANSFER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svlbitm.hxx b/include/svtools/svlbitm.hxx
new file mode 100644
index 000000000000..14784835fa6b
--- /dev/null
+++ b/include/svtools/svlbitm.hxx
@@ -0,0 +1,257 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#ifndef _SVLBOXITM_HXX
+#define _SVLBOXITM_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <tools/link.hxx>
+
+#include <vcl/image.hxx>
+#include <svtools/treelistbox.hxx>
+
+class SvTreeListEntry;
+
+
+#define SV_BMP_UNCHECKED 0
+#define SV_BMP_CHECKED 1
+#define SV_BMP_TRISTATE 2
+#define SV_BMP_HIUNCHECKED 3
+#define SV_BMP_HICHECKED 4
+#define SV_BMP_HITRISTATE 5
+#define SV_BMP_STATICIMAGE 6
+
+struct SvLBoxButtonData_Impl;
+
+class SVT_DLLPUBLIC SvLBoxButtonData
+{
+private:
+ Link aLink;
+ long nWidth;
+ long nHeight;
+ SvLBoxButtonData_Impl* pImpl;
+ sal_Bool bDataOk;
+ SvButtonState eState;
+
+ SVT_DLLPRIVATE void SetWidthAndHeight();
+ SVT_DLLPRIVATE void InitData( sal_Bool bImagesFromDefault,
+ bool _bRadioBtn, const Control* pControlForSettings = NULL );
+public:
+ // include creating default images (CheckBox or RadioButton)
+ SvLBoxButtonData( const Control* pControlForSettings );
+ SvLBoxButtonData( const Control* pControlForSettings, bool _bRadioBtn );
+
+ ~SvLBoxButtonData();
+
+ sal_uInt16 GetIndex( sal_uInt16 nItemState );
+ long Width();
+ long Height();
+ void SetLink( const Link& rLink) { aLink=rLink; }
+ const Link& GetLink() const { return aLink; }
+ sal_Bool IsRadio();
+ // weil Buttons nicht von LinkHdl abgeleitet sind
+ void CallLink();
+
+ void StoreButtonState( SvTreeListEntry* pEntry, sal_uInt16 nItemFlags );
+ SvButtonState ConvertToButtonState( sal_uInt16 nItemFlags ) const;
+
+ SvButtonState GetActButtonState() const
+ {
+ return eState;
+ }
+
+ SvTreeListEntry* GetActEntry() const;
+
+ Image aBmps[24]; // Indizes siehe Konstanten BMP_ ....
+
+ void SetDefaultImages( const Control* pControlForSettings = NULL );
+ // set images acording to the color scheeme of the Control
+ // pControlForSettings == NULL: settings are taken from Application
+ sal_Bool HasDefaultImages( void ) const;
+};
+
+// **********************************************************************
+
+class SVT_DLLPUBLIC SvLBoxString : public SvLBoxItem
+{
+protected:
+ OUString maText;
+public:
+ SvLBoxString(SvTreeListEntry*, sal_uInt16 nFlags, const OUString& rStr);
+ SvLBoxString();
+ virtual ~SvLBoxString();
+ virtual sal_uInt16 GetType() const;
+ virtual void InitViewData(SvTreeListBox*, SvTreeListEntry*, SvViewDataItem*);
+ OUString GetText() const { return maText; }
+ void SetText( const OUString& rText ) { maText = rText; }
+
+ virtual void Paint(
+ const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
+
+ virtual SvLBoxItem* Create() const;
+ virtual void Clone( SvLBoxItem* pSource );
+};
+
+class SvLBoxBmp : public SvLBoxItem
+{
+ Image aBmp;
+public:
+ SvLBoxBmp();
+ virtual ~SvLBoxBmp();
+ virtual sal_uInt16 GetType() const;
+ virtual void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
+ virtual void Paint(
+ const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
+ virtual SvLBoxItem* Create() const;
+ virtual void Clone( SvLBoxItem* pSource );
+};
+
+
+#define SV_ITEMSTATE_UNCHECKED 0x0001
+#define SV_ITEMSTATE_CHECKED 0x0002
+#define SV_ITEMSTATE_TRISTATE 0x0004
+#define SV_ITEMSTATE_HILIGHTED 0x0008
+#define SV_STATE_MASK 0xFFF8 // zum Loeschen von UNCHECKED,CHECKED,TRISTATE
+
+class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem
+{
+ SvLBoxButtonData* pData;
+ SvLBoxButtonKind eKind;
+ sal_uInt16 nItemFlags;
+ sal_uInt16 nBaseOffs;
+
+ void ImplAdjustBoxSize( Size& io_rCtrlSize, ControlType i_eType, Window* pParent );
+public:
+ // An SvLBoxButton can be of three different kinds: an
+ // enabled checkbox (the normal kind), a disabled checkbox
+ // (which cannot be modified via UI), or a static image
+ // (see SV_BMP_STATICIMAGE; nFlags are effectively ignored
+ // for that kind).
+ SvLBoxButton( SvTreeListEntry* pEntry,
+ SvLBoxButtonKind eTheKind, sal_uInt16 nFlags,
+ SvLBoxButtonData* pBData );
+ SvLBoxButton();
+ virtual ~SvLBoxButton();
+ virtual void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
+ virtual sal_uInt16 GetType() const;
+ virtual sal_Bool ClickHdl(SvTreeListBox* pView, SvTreeListEntry* );
+ virtual void Paint(
+ const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
+ virtual SvLBoxItem* Create() const;
+ virtual void Clone( SvLBoxItem* pSource );
+ sal_uInt16 GetButtonFlags() const { return nItemFlags; }
+ sal_Bool IsStateChecked() const { return (sal_Bool)(nItemFlags & SV_ITEMSTATE_CHECKED)!=0; }
+ sal_Bool IsStateUnchecked() const { return (sal_Bool)(nItemFlags & SV_ITEMSTATE_UNCHECKED)!=0; }
+ sal_Bool IsStateTristate() const { return (sal_Bool)(nItemFlags & SV_ITEMSTATE_TRISTATE)!=0; }
+ sal_Bool IsStateHilighted() const { return (sal_Bool)(nItemFlags & SV_ITEMSTATE_HILIGHTED)!=0; }
+ void SetStateChecked();
+ void SetStateUnchecked();
+ void SetStateTristate();
+ void SetStateHilighted( sal_Bool bHilight );
+
+ SvLBoxButtonKind GetKind() const { return eKind; }
+
+ void SetBaseOffs( sal_uInt16 nOffs ) { nBaseOffs = nOffs; }
+ sal_uInt16 GetBaseOffs() const { return nBaseOffs; }
+
+ // Check whether this button can be modified via UI
+ bool CheckModification() const;
+};
+
+inline void SvLBoxButton::SetStateChecked()
+{
+ nItemFlags &= SV_STATE_MASK;
+ nItemFlags |= SV_ITEMSTATE_CHECKED;
+}
+inline void SvLBoxButton::SetStateUnchecked()
+{
+ nItemFlags &= SV_STATE_MASK;
+ nItemFlags |= SV_ITEMSTATE_UNCHECKED;
+}
+inline void SvLBoxButton::SetStateTristate()
+{
+ nItemFlags &= SV_STATE_MASK;
+ nItemFlags |= SV_ITEMSTATE_TRISTATE;
+}
+inline void SvLBoxButton::SetStateHilighted( sal_Bool bHilight )
+{
+ if ( bHilight )
+ nItemFlags |= SV_ITEMSTATE_HILIGHTED;
+ else
+ nItemFlags &= ~SV_ITEMSTATE_HILIGHTED;
+}
+
+
+struct SvLBoxContextBmp_Impl;
+class SVT_DLLPUBLIC SvLBoxContextBmp : public SvLBoxItem
+{
+ SvLBoxContextBmp_Impl* m_pImpl;
+public:
+ SvLBoxContextBmp(
+ SvTreeListEntry* pEntry, sal_uInt16 nItemFlags, Image aBmp1, Image aBmp2, bool bExpanded);
+ SvLBoxContextBmp();
+
+ virtual ~SvLBoxContextBmp();
+ virtual sal_uInt16 GetType() const;
+ virtual void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
+ virtual void Paint(
+ const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
+ virtual SvLBoxItem* Create() const;
+ virtual void Clone( SvLBoxItem* pSource );
+
+
+ sal_Bool SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 );
+ void GetModeImages( Image& _rBitmap1, Image& _rBitmap2 ) const;
+
+ inline void SetBitmap1( const Image& _rImage );
+ inline void SetBitmap2( const Image& _rImage );
+ inline const Image& GetBitmap1( ) const;
+ inline const Image& GetBitmap2( ) const;
+
+private:
+ Image& implGetImageStore( sal_Bool _bFirst );
+};
+
+inline void SvLBoxContextBmp::SetBitmap1( const Image& _rImage )
+{
+ implGetImageStore( sal_True ) = _rImage;
+}
+
+inline void SvLBoxContextBmp::SetBitmap2( const Image& _rImage )
+{
+ implGetImageStore( sal_False ) = _rImage;
+}
+
+inline const Image& SvLBoxContextBmp::GetBitmap1( ) const
+{
+ Image& rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_True );
+ return rImage;
+}
+
+inline const Image& SvLBoxContextBmp::GetBitmap2( ) const
+{
+ Image& rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_False );
+ return rImage;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svmedit.hxx b/include/svtools/svmedit.hxx
new file mode 100644
index 000000000000..c0672a520824
--- /dev/null
+++ b/include/svtools/svmedit.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 _SVEDIT_HXX
+#define _SVEDIT_HXX
+
+#include <vcl/svapp.hxx>
+#include <vcl/vclmedit.hxx>
+
+#include <comphelper/syntaxhighlight.hxx>
+#include <svtools/svtdllapi.h>
+#include <svtools/colorcfg.hxx>
+
+
+
+class SVT_DLLPUBLIC MultiLineEdit : public VclMultiLineEdit
+{
+public:
+ MultiLineEdit( Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER );
+ MultiLineEdit( Window* pParent, const ResId& rResId );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
+ GetComponentInterface(sal_Bool bCreate = sal_True);
+};
+
+
+#endif //_SVEDIT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svmedit2.hxx b/include/svtools/svmedit2.hxx
new file mode 100644
index 000000000000..68b754163e19
--- /dev/null
+++ b/include/svtools/svmedit2.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 _SVTOOLS_SVMEDIT2_HXX
+#define _SVTOOLS_SVMEDIT2_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/svmedit.hxx>
+
+class TextAttrib;
+
+class SVT_DLLPUBLIC ExtMultiLineEdit : public MultiLineEdit
+{
+public:
+ ExtMultiLineEdit( Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER );
+ ExtMultiLineEdit( Window* pParent, const ResId& rResId );
+ ~ExtMultiLineEdit();
+
+ // methods of TextView
+ void InsertText( const String& rNew, sal_Bool bSelect = sal_False );
+ void SetAutoScroll( sal_Bool bAutoScroll );
+
+ // methods of TextEngine
+ void SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd );
+ void SetLeftMargin( sal_uInt16 nLeftMargin );
+ sal_uLong GetParagraphCount() const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx
new file mode 100644
index 000000000000..bd2ee966469a
--- /dev/null
+++ b/include/svtools/svparser.hxx
@@ -0,0 +1,278 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVPARSER_HXX
+#define _SVPARSER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <tools/string.hxx>
+#include <tools/ref.hxx>
+#include <rtl/textenc.h>
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/utility.hpp>
+#include <vector>
+
+struct SvParser_Impl;
+class SvStream;
+
+enum SvParserState
+{
+ SVPAR_ACCEPTED = 0,
+ SVPAR_NOTSTARTED,
+ SVPAR_WORKING,
+ SVPAR_PENDING,
+ SVPAR_WAITFORDATA,
+ SVPAR_ERROR
+};
+
+class SVT_DLLPUBLIC SvParser : public SvRefBase
+{
+ DECL_STATIC_LINK( SvParser, NewDataRead, void* );
+
+protected:
+ SvStream& rInput;
+ String aToken; // gescanntes Token
+ sal_uLong nlLineNr; // akt. Zeilen Nummer
+ sal_uLong nlLinePos; // akt. Spalten Nummer
+
+ SvParser_Impl *pImplData; // interne Daten
+ long nTokenValue; // zusaetzlicher Wert (RTF)
+ sal_Bool bTokenHasValue; // indicates whether nTokenValue is valid
+ SvParserState eState; // Status auch in abgl. Klassen
+
+ rtl_TextEncoding eSrcEnc; // Source encoding
+
+ sal_uLong nNextChPos;
+ sal_Unicode nNextCh; // Akt. Zeichen fuer die "lex"
+
+
+ sal_Bool bDownloadingFile : 1;// sal_True: Es wird gerade ein externes
+ // File geladen. d.h. alle
+ // DataAvailable Links muessen
+ // ignoriert werden.
+ // Wenn keibes der folgenden
+ // Flags gesetzt ist, wird der
+ // Stream als ANSI gelesen,
+ // aber als CharSet DONTKNOW
+ // zurueckgegeben.
+ sal_Bool bUCS2BSrcEnc : 1; // oder als big-endian UCS2
+ sal_Bool bSwitchToUCS2 : 1; // Umschalten des ist erlaubt
+
+ sal_Bool bRTF_InTextRead : 1; // only for RTF-Parser!!!
+
+ struct TokenStackType
+ {
+ String sToken;
+ long nTokenValue;
+ sal_Bool bTokenHasValue;
+ int nTokenId;
+
+ inline TokenStackType() { nTokenId = 0; }
+ inline ~TokenStackType() { }
+ };
+
+ // Methoden fuer Token-Stack
+ int SkipToken( short nCnt = -1 ); // n Tokens zurueck "skippen"
+ TokenStackType* GetStackPtr( short nCnt );
+ inline sal_uInt8 GetStackPos() const;
+
+ // scanne das naechste Token:
+ // Tokenstack abarbeiten und ggfs. _GetNextToken() rufen. Diese
+ // ist fuers erkennen von neuen Token verantwortlich
+ int GetNextToken();
+ virtual int _GetNextToken() = 0;
+
+ // wird fuer jedes Token gerufen, das in CallParser erkannt wird
+ virtual void NextToken( int nToken );
+
+ // zu Zeiten der SvRefBase-Ableitung darf nicht jeder loeschen
+ virtual ~SvParser();
+
+ void ClearTxtConvContext();
+
+private:
+ TokenStackType* pTokenStack;
+ TokenStackType *pTokenStackPos;
+ sal_uInt8 nTokenStackSize, nTokenStackPos;
+
+public:
+ // Konstruktor
+ SvParser( SvStream& rIn, sal_uInt8 nStackSize = 3 );
+
+ virtual SvParserState CallParser() = 0; // Aufruf des Parsers
+
+ inline SvParserState GetStatus() const { return eState; } // StatusInfo
+
+ inline sal_uLong GetLineNr() const { return nlLineNr; }
+ inline sal_uLong GetLinePos() const { return nlLinePos; }
+ inline sal_uLong IncLineNr() { return ++nlLineNr; }
+ inline sal_uLong IncLinePos() { return ++nlLinePos; }
+ inline sal_uLong SetLineNr( sal_uLong nlNum ); // inline unten
+ inline sal_uLong SetLinePos( sal_uLong nlPos ); // inline unten
+
+ sal_Unicode GetNextChar();
+ void RereadLookahead();
+
+ inline int IsParserWorking() const { return SVPAR_WORKING == eState; }
+
+ Link GetAsynchCallLink() const
+ { return STATIC_LINK( this, SvParser, NewDataRead ); }
+
+ long CallAsyncCallLink() { return NewDataRead( this, 0 ); }
+
+ // fuers asynchrone lesen aus dem SvStream
+ /*virtual*/ void SaveState( int nToken );
+ /*virtual*/ void RestoreState();
+ virtual void Continue( int nToken );
+
+ inline void SetDownloadingFile( sal_Bool bSet ) { bDownloadingFile = bSet; }
+ inline sal_Bool IsDownloadingFile() const { return bDownloadingFile; }
+
+ // Set/get source encoding. The UCS2BEncoding flag is valid if source
+ // encoding is UCS2. It specifies a big endian encoding.
+ void SetSrcEncoding( rtl_TextEncoding eSrcEnc );
+ rtl_TextEncoding GetSrcEncoding() const { return eSrcEnc; }
+
+ void SetSrcUCS2BEncoding( sal_Bool bSet ) { bUCS2BSrcEnc = bSet; }
+ sal_Bool IsSrcUCS2BEncoding() const { return bUCS2BSrcEnc; }
+
+ // Darf der Zeichensatz auf UCS/2 umgeschaltet werden, wenn
+ // in den ersten beiden Zeichen im Stream eine BOM steht?
+ void SetSwitchToUCS2( sal_Bool bSet ) { bSwitchToUCS2 = bSet; }
+ sal_Bool IsSwitchToUCS2() const { return bSwitchToUCS2; }
+
+ // Aus wie vielen Bytes betseht ein Zeichen
+ inline sal_uInt16 GetCharSize() const;
+
+ int GetSaveToken() const;
+
+ // Aufbau einer Which-Map 'rWhichMap' aus einem Array von
+ // 'pWhichIds' von Which-Ids. Es hat die Lange 'nWhichIds'.
+ // Die Which-Map wird nicht geloescht.
+ static void BuildWhichTbl( std::vector<sal_uInt16> &rWhichMap,
+ sal_uInt16 *pWhichIds,
+ sal_uInt16 nWhichIds );
+};
+
+
+#ifndef GOODIES_DECL_SVPARSER_DEFINED
+#define GOODIES_DECL_SVPARSER_DEFINED
+SV_DECL_REF(SvParser)
+#endif
+SV_IMPL_REF(SvParser)
+
+
+
+inline sal_uLong SvParser::SetLineNr( sal_uLong nlNum )
+{ sal_uLong nlOld = nlLineNr; nlLineNr = nlNum; return nlOld; }
+
+inline sal_uLong SvParser::SetLinePos( sal_uLong nlPos )
+{ sal_uLong nlOld = nlLinePos; nlLinePos = nlPos; return nlOld; }
+
+inline sal_uInt8 SvParser::GetStackPos() const
+{ return nTokenStackPos; }
+
+inline sal_uInt16 SvParser::GetCharSize() const
+{
+ return (RTL_TEXTENCODING_UCS2 == eSrcEnc) ? 2 : 1;
+}
+
+
+/*========================================================================
+ *
+ * SvKeyValue.
+ *
+ *======================================================================*/
+
+SV_DECL_REF(SvKeyValueIterator)
+
+class SvKeyValue
+{
+ /** Representation.
+ */
+ String m_aKey;
+ String m_aValue;
+
+public:
+ /** Construction.
+ */
+ SvKeyValue (void)
+ {}
+
+ SvKeyValue (const String &rKey, const String &rValue)
+ : m_aKey (rKey), m_aValue (rValue)
+ {}
+
+ SvKeyValue (const SvKeyValue &rOther)
+ : m_aKey (rOther.m_aKey), m_aValue (rOther.m_aValue)
+ {}
+
+ /** Assignment.
+ */
+ SvKeyValue& operator= (SvKeyValue &rOther)
+ {
+ m_aKey = rOther.m_aKey;
+ m_aValue = rOther.m_aValue;
+ return *this;
+ }
+
+ /** Operation.
+ */
+ const String& GetKey (void) const { return m_aKey; }
+ const String& GetValue (void) const { return m_aValue; }
+
+ void SetKey (const String &rKey ) { m_aKey = rKey; }
+ void SetValue (const String &rValue) { m_aValue = rValue; }
+};
+
+/*========================================================================
+ *
+ * SvKeyValueIterator.
+ *
+ *======================================================================*/
+
+typedef boost::ptr_vector<SvKeyValue> SvKeyValueList_Impl;
+
+class SVT_DLLPUBLIC SvKeyValueIterator : public SvRefBase,
+ private boost::noncopyable
+{
+ /** Representation.
+ */
+ SvKeyValueList_Impl* m_pList;
+ sal_uInt16 m_nPos;
+
+public:
+ /** Construction/Destruction.
+ */
+ SvKeyValueIterator (void);
+ virtual ~SvKeyValueIterator (void);
+
+ /** Operation.
+ */
+ virtual sal_Bool GetFirst (SvKeyValue &rKeyVal);
+ virtual sal_Bool GetNext (SvKeyValue &rKeyVal);
+ virtual void Append (const SvKeyValue &rKeyVal);
+};
+
+SV_IMPL_REF(SvKeyValueIterator);
+
+#endif //_SVPARSER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svtabbx.hxx b/include/svtools/svtabbx.hxx
new file mode 100644
index 000000000000..7bcd0591b2d1
--- /dev/null
+++ b/include/svtools/svtabbx.hxx
@@ -0,0 +1,255 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVTABBX_HXX
+#define _SVTABBX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/treelistbox.hxx>
+#include <svtools/accessibletableprovider.hxx>
+
+#include <vector>
+
+enum SvTabJustify
+{
+ AdjustRight = SV_LBOXTAB_ADJUST_RIGHT,
+ AdjustLeft = SV_LBOXTAB_ADJUST_LEFT,
+ AdjustCenter = SV_LBOXTAB_ADJUST_CENTER,
+ AdjustNumeric = SV_LBOXTAB_ADJUST_NUMERIC
+};
+
+struct TabListBoxEventData
+{
+ SvTreeListEntry* m_pEntry;
+ sal_uInt16 m_nColumn;
+ String m_sOldText;
+
+ TabListBoxEventData( SvTreeListEntry* pEntry, sal_uInt16 nColumn, const String& rOldText ) :
+ m_pEntry( pEntry ), m_nColumn( nColumn ), m_sOldText( rOldText ) {}
+};
+
+class SVT_DLLPUBLIC SvTabListBox : public SvTreeListBox
+{
+private:
+ SvLBoxTab* pTabList;
+ sal_uInt16 nTabCount;
+ XubString aCurEntry;
+
+protected:
+ SvTreeListEntry* pViewParent;
+
+ static const sal_Unicode* GetToken( const sal_Unicode* pPtr, sal_uInt16& rLen );
+
+ virtual void SetTabs();
+ virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind);
+
+ String GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const;
+ SvTreeListEntry* GetEntryOnPos( sal_uLong _nEntryPos ) const;
+ SvTreeListEntry* GetChildOnPos( SvTreeListEntry* _pParent, sal_uLong _nEntryPos, sal_uLong& _rPos ) const;
+
+public:
+ SvTabListBox( Window* pParent, WinBits = WB_BORDER );
+ SvTabListBox( Window* pParent, const ResId& );
+ ~SvTabListBox();
+ void SetTabs( long* pTabs, MapUnit = MAP_APPFONT );
+ sal_uInt16 TabCount() const { return (sal_uInt16)nTabCount; }
+ using SvTreeListBox::GetTab;
+ long GetTab( sal_uInt16 nTab ) const;
+ void SetTab( sal_uInt16 nTab, long nValue, MapUnit = MAP_APPFONT );
+ long GetLogicTab( sal_uInt16 nTab );
+
+ virtual SvTreeListEntry* InsertEntry( const XubString& rText, SvTreeListEntry* pParent = 0,
+ sal_Bool bChildrenOnDemand = sal_False,
+ sal_uLong nPos=LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ virtual SvTreeListEntry* InsertEntry( const XubString& rText,
+ const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp,
+ SvTreeListEntry* pParent = 0,
+ sal_Bool bChildrenOnDemand = sal_False,
+ sal_uLong nPos = LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, sal_uLong nPos = LIST_APPEND,
+ sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, SvTreeListEntry* pParent,
+ sal_uLong nPos, sal_uInt16 nCol, void* pUserData = NULL );
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent = NULL,
+ sal_uLong nPos = LIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+
+ virtual String GetEntryText( SvTreeListEntry* pEntry ) const;
+ String GetEntryText( SvTreeListEntry*, sal_uInt16 nCol ) const;
+ String GetEntryText( sal_uLong nPos, sal_uInt16 nCol = 0xffff ) const;
+ using SvTreeListBox::SetEntryText;
+ void SetEntryText( const XubString&, sal_uLong, sal_uInt16 nCol=0xffff );
+ void SetEntryText(const XubString&,SvTreeListEntry*,sal_uInt16 nCol=0xffff);
+ String GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const;
+ sal_uLong GetEntryPos( const XubString&, sal_uInt16 nCol = 0xffff );
+ sal_uLong GetEntryPos( const SvTreeListEntry* pEntry ) const;
+
+ virtual void Resize();
+ void SetTabJustify( sal_uInt16 nTab, SvTabJustify );
+};
+
+inline long SvTabListBox::GetTab( sal_uInt16 nTab ) const
+{
+ DBG_ASSERT( nTab < nTabCount, "GetTabPos:Invalid Tab" );
+ return pTabList[nTab].GetPos();
+}
+
+// class SvHeaderTabListBox ---------------------------------------------------
+
+class HeaderBar;
+namespace svt {
+ class AccessibleTabListBox;
+ class IAccessibleTabListBox;
+ struct SvHeaderTabListBoxImpl;
+}
+
+class SVT_DLLPUBLIC SvHeaderTabListBox : public SvTabListBox, public svt::IAccessibleTableProvider
+{
+private:
+ typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren;
+
+ sal_Bool m_bFirstPaint;
+ ::svt::SvHeaderTabListBoxImpl* m_pImpl;
+ ::svt::IAccessibleTabListBox* m_pAccessible;
+ AccessibleChildren m_aAccessibleChildren;
+
+ DECL_DLLPRIVATE_LINK( ScrollHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( CreateAccessibleHdl_Impl, void* );
+
+ void RecalculateAccessibleChildren();
+
+public:
+ SvHeaderTabListBox( Window* pParent, WinBits nBits );
+ SvHeaderTabListBox( Window* pParent, const ResId& );
+ ~SvHeaderTabListBox();
+
+ virtual void Paint( const Rectangle& );
+
+ void InitHeaderBar( HeaderBar* pHeaderBar );
+ sal_Bool IsItemChecked( SvTreeListEntry* pEntry, sal_uInt16 nCol ) const;
+
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, sal_uLong nPos = LIST_APPEND,
+ sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, SvTreeListEntry* pParent,
+ sal_uLong nPos, sal_uInt16 nCol, void* pUserData = NULL );
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent = NULL,
+ sal_uLong nPos = LIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+ virtual sal_uLong Insert( SvTreeListEntry* pEnt,SvTreeListEntry* pPar,sal_uLong nPos=LIST_APPEND);
+ virtual sal_uLong Insert( SvTreeListEntry* pEntry, sal_uLong nRootPos = LIST_APPEND );
+ void RemoveEntry( SvTreeListEntry* _pEntry );
+ void Clear();
+
+ // Accessible -------------------------------------------------------------
+
+ inline void DisableTransientChildren() { SetChildrenNotTransient(); }
+ inline sal_Bool IsTransientChildrenDisabled() const { return !AreChildrenTransient(); }
+
+ sal_Bool IsCellCheckBox( long _nRow, sal_uInt16 _nColumn, TriState& _rState );
+
+ /** @return The count of the rows. */
+ virtual long GetRowCount() const;
+ /** @return The count of the columns. */
+ virtual sal_uInt16 GetColumnCount() const;
+
+ /** @return The position of the current row. */
+ virtual sal_Int32 GetCurrRow() const;
+ /** @return The position of the current column. */
+ virtual sal_uInt16 GetCurrColumn() const;
+
+ /** @return The description of a row.
+ @param _nRow The row which description is in demand. */
+ virtual OUString GetRowDescription( sal_Int32 _nRow ) const;
+ /** @return The description of a column.
+ @param _nColumn The column which description is in demand. */
+ virtual OUString GetColumnDescription( sal_uInt16 _nColumn ) const;
+
+ /** @return <TRUE/>, if the object has a row header. */
+ virtual sal_Bool HasRowHeader() const; //GetColumnId
+ /** @return <TRUE/>, if the object can focus a cell. */
+ virtual sal_Bool IsCellFocusable() const;
+ virtual sal_Bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+
+ virtual void SetNoSelection();
+ using SvListView::SelectAll;
+ virtual void SelectAll();
+ virtual void SelectAll( sal_Bool bSelect, sal_Bool bPaint = sal_True );
+ virtual void SelectRow( long _nRow, sal_Bool _bSelect = sal_True, sal_Bool bExpand = sal_True );
+ virtual void SelectColumn( sal_uInt16 _nColumn, sal_Bool _bSelect = sal_True );
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual sal_Int32 GetSelectedColumnCount() const;
+ /** @return <TRUE/>, if the row is selected. */
+ virtual bool IsRowSelected( long _nRow ) const;
+ virtual sal_Bool IsColumnSelected( long _nColumn ) const;
+ virtual void GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& _rRows ) const;
+ virtual void GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumns ) const;
+
+ /** @return <TRUE/>, if the cell is visible. */
+ virtual sal_Bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
+ virtual String GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const;
+
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, sal_Bool _bIsHeader, sal_Bool _bOnScreen = sal_True );
+
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleRowHeader( sal_Int32 _nRow );
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos );
+
+ virtual sal_Int32 GetAccessibleControlCount() const;
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex );
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint );
+
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_uInt16& _rnColPos, const Point& _rPoint );
+ virtual sal_Bool ConvertPointToRowHeader( sal_Int32& _rnRow, const Point& _rPoint );
+ virtual sal_Bool ConvertPointToColumnHeader( sal_uInt16& _rnColPos, const Point& _rPoint );
+
+ virtual OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const;
+ virtual OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const;
+ virtual Window* GetWindowInstance();
+
+ using SvTreeListBox::FillAccessibleStateSet;
+ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& _rStateSet, ::svt::AccessibleBrowseBoxObjType _eType ) const;
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
+ virtual void GrabTableFocus();
+
+ // OutputDevice
+ virtual sal_Bool GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector );
+
+ // Window
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ virtual void GrabFocus();
+ virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True );
+ virtual Window* GetAccessibleParentWindow() const;
+
+ /** Creates and returns the accessible object of the whole BrowseBox. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible();
+
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+};
+
+#endif // #ifndef _SVTABBX_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svtdllapi.h b/include/svtools/svtdllapi.h
new file mode 100644
index 000000000000..d8c01a464f45
--- /dev/null
+++ b/include/svtools/svtdllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SVTDLLAPI_H
+#define INCLUDED_SVTDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(SVT_DLLIMPLEMENTATION)
+#define SVT_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define SVT_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define SVT_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_SVTDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
new file mode 100644
index 000000000000..ea04f469df35
--- /dev/null
+++ b/include/svtools/svtools.hrc
@@ -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 _SVTOOLS_HRC
+#define _SVTOOLS_HRC
+
+#include <svl/solar.hrc>
+
+#define RID_SVTOOLS_BITMAP_START (RID_SVTOOLS_START + 0)
+#define RID_SVTOOLS_IMAGELIST_START (RID_SVTOOLS_START + 0)
+
+//.............................................................................
+// various unsorted stuff
+
+#define DLG_SVT_QUERYDELETE (RID_SVTOOLS_START+6)
+
+#define STR_SVT_AUTOMATIC_COLOR (RID_SVTOOLS_START+16)
+
+#define STR_SVT_FILEVIEW_COLUMN_TITLE (RID_SVTOOLS_START + 20)
+#define STR_SVT_FILEVIEW_COLUMN_SIZE (RID_SVTOOLS_START + 21)
+#define STR_SVT_FILEVIEW_COLUMN_DATE (RID_SVTOOLS_START + 22)
+#define STR_SVT_FILEVIEW_ERR_MAKEFOLDER (RID_SVTOOLS_START + 24)
+#define STR_SVT_BYTES (RID_SVTOOLS_START + 25)
+#define STR_SVT_KB (RID_SVTOOLS_START + 26)
+#define STR_SVT_MB (RID_SVTOOLS_START + 27)
+#define STR_SVT_GB (RID_SVTOOLS_START + 28)
+#define STR_SVT_FILEVIEW_COLUMN_TYPE (RID_SVTOOLS_START + 29)
+#define STR_FILTERNAME_ALL (RID_SVTOOLS_START + 30)
+#define RID_FILEVIEW_CONTEXTMENU (RID_SVTOOLS_START + 31)
+#define STR_SVT_1BIT_THRESHOLD (RID_SVTOOLS_START + 32)
+#define STR_SVT_1BIT_DITHERED (RID_SVTOOLS_START + 33)
+#define STR_SVT_4BIT_GRAYSCALE (RID_SVTOOLS_START + 34)
+#define STR_SVT_4BIT_COLOR_PALETTE (RID_SVTOOLS_START + 35)
+#define STR_SVT_8BIT_GRAYSCALE (RID_SVTOOLS_START + 36)
+#define STR_SVT_8BIT_COLOR_PALETTE (RID_SVTOOLS_START + 37)
+#define STR_SVT_24BIT_TRUE_COLOR (RID_SVTOOLS_START + 38)
+#define STR_SVT_ESTIMATED_SIZE_PIX_1 (RID_SVTOOLS_START + 39)
+#define STR_SVT_ESTIMATED_SIZE_PIX_2 (RID_SVTOOLS_START + 40)
+#define STR_SVT_ESTIMATED_SIZE_VEC (RID_SVTOOLS_START + 41)
+
+// doc template dialog
+#define DLG_DOCTEMPLATE (RID_SVTOOLS_START+50)
+#define CTRL_FILEVIEW (RID_SVTOOLS_START+51)
+#define STR_SVT_NEWDOC (RID_SVTOOLS_START+52)
+#define STR_SVT_MYDOCS (RID_SVTOOLS_START+53)
+#define STR_SVT_TEMPLATES (RID_SVTOOLS_START+54)
+#define STR_SVT_SAMPLES (RID_SVTOOLS_START+55)
+#define TB_SVT_FILEVIEW (RID_SVTOOLS_START+56)
+#define TB_SVT_FRAMEWIN (RID_SVTOOLS_START+57)
+#define STRARY_SVT_DOCINFO (RID_SVTOOLS_START+58)
+#define STR_SVT_NEWDOC_HELP (RID_SVTOOLS_START+63)
+#define STR_SVT_MYDOCS_HELP (RID_SVTOOLS_START+64)
+#define STR_SVT_TEMPLATES_HELP (RID_SVTOOLS_START+65)
+#define STR_SVT_SAMPLES_HELP (RID_SVTOOLS_START+66)
+
+#define STR_BASICKEY_FORMAT_ON (RID_SVTOOLS_START+103)
+#define STR_BASICKEY_FORMAT_OFF (RID_SVTOOLS_START+104)
+#define STR_BASICKEY_FORMAT_YES (RID_SVTOOLS_START+105)
+#define STR_BASICKEY_FORMAT_NO (RID_SVTOOLS_START+106)
+#define STR_BASICKEY_FORMAT_TRUE (RID_SVTOOLS_START+107)
+#define STR_BASICKEY_FORMAT_FALSE (RID_SVTOOLS_START+108)
+#define STR_UNDO (RID_SVTOOLS_START+110)
+#define STR_REDO (RID_SVTOOLS_START+111)
+#define STR_REPEAT (RID_SVTOOLS_START+112)
+
+#define STR_BASICKEY_FORMAT_CURRENCY (RID_SVTOOLS_START+130)
+
+#define STR_SVT_PRNDLG_START (RID_SVTOOLS_START+141)
+
+#define STR_SVT_PRNDLG_READY (STR_SVT_PRNDLG_START+2)
+#define STR_SVT_PRNDLG_PAUSED (STR_SVT_PRNDLG_START+3)
+#define STR_SVT_PRNDLG_PENDING (STR_SVT_PRNDLG_START+4)
+#define STR_SVT_PRNDLG_BUSY (STR_SVT_PRNDLG_START+5)
+#define STR_SVT_PRNDLG_INITIALIZING (STR_SVT_PRNDLG_START+6)
+#define STR_SVT_PRNDLG_WAITING (STR_SVT_PRNDLG_START+7)
+#define STR_SVT_PRNDLG_WARMING_UP (STR_SVT_PRNDLG_START+8)
+#define STR_SVT_PRNDLG_PROCESSING (STR_SVT_PRNDLG_START+9)
+#define STR_SVT_PRNDLG_PRINTING (STR_SVT_PRNDLG_START+10)
+#define STR_SVT_PRNDLG_OFFLINE (STR_SVT_PRNDLG_START+11)
+#define STR_SVT_PRNDLG_ERROR (STR_SVT_PRNDLG_START+12)
+#define STR_SVT_PRNDLG_SERVER_UNKNOWN (STR_SVT_PRNDLG_START+13)
+#define STR_SVT_PRNDLG_PAPER_JAM (STR_SVT_PRNDLG_START+14)
+#define STR_SVT_PRNDLG_PAPER_OUT (STR_SVT_PRNDLG_START+15)
+#define STR_SVT_PRNDLG_MANUAL_FEED (STR_SVT_PRNDLG_START+16)
+#define STR_SVT_PRNDLG_PAPER_PROBLEM (STR_SVT_PRNDLG_START+17)
+#define STR_SVT_PRNDLG_IO_ACTIVE (STR_SVT_PRNDLG_START+18)
+#define STR_SVT_PRNDLG_OUTPUT_BIN_FULL (STR_SVT_PRNDLG_START+19)
+#define STR_SVT_PRNDLG_TONER_LOW (STR_SVT_PRNDLG_START+20)
+#define STR_SVT_PRNDLG_NO_TONER (STR_SVT_PRNDLG_START+21)
+#define STR_SVT_PRNDLG_PAGE_PUNT (STR_SVT_PRNDLG_START+22)
+#define STR_SVT_PRNDLG_USER_INTERVENTION (STR_SVT_PRNDLG_START+23)
+#define STR_SVT_PRNDLG_OUT_OF_MEMORY (STR_SVT_PRNDLG_START+24)
+#define STR_SVT_PRNDLG_DOOR_OPEN (STR_SVT_PRNDLG_START+25)
+#define STR_SVT_PRNDLG_POWER_SAVE (STR_SVT_PRNDLG_START+26)
+#define STR_SVT_PRNDLG_DEFPRINTER (STR_SVT_PRNDLG_START+27)
+#define STR_SVT_PRNDLG_JOBCOUNT (STR_SVT_PRNDLG_START+28)
+#define STR_SVT_PRNDLG_END (RID_IMG_PRNDLG_NOCOLLATE)
+
+#define STR_SVT_CALENDAR_START (STR_SVT_PRNDLG_END+1)
+#define STR_SVT_CALENDAR_DAY (STR_SVT_CALENDAR_START+0)
+#define STR_SVT_CALENDAR_WEEK (STR_SVT_CALENDAR_START+1)
+#define STR_SVT_CALENDAR_TODAY (STR_SVT_CALENDAR_START+2)
+#define STR_SVT_CALENDAR_NONE (STR_SVT_CALENDAR_START+3)
+#define STR_SVT_CALENDAR_END (STR_SVT_CALENDAR_NONE)
+
+#define STR_SVT_PVER_START (STR_SVT_CALENDAR_END+1)
+#define STR_SVT_PVER_OEM_PROFESSIONAL (STR_SVT_PVER_START+16)
+#define STR_SVT_PVER_END (STR_SVT_PVER_OEM_PROFESSIONAL)
+
+#define STR_SVT_STYLE_START (STR_SVT_PVER_END+1)
+#define STR_SVT_STYLE_LIGHT (STR_SVT_STYLE_START+0)
+#define STR_SVT_STYLE_LIGHT_ITALIC (STR_SVT_STYLE_START+1)
+#define STR_SVT_STYLE_NORMAL (STR_SVT_STYLE_START+2)
+#define STR_SVT_STYLE_NORMAL_ITALIC (STR_SVT_STYLE_START+3)
+#define STR_SVT_STYLE_BOLD (STR_SVT_STYLE_START+4)
+#define STR_SVT_STYLE_BOLD_ITALIC (STR_SVT_STYLE_START+5)
+#define STR_SVT_STYLE_BLACK (STR_SVT_STYLE_START+6)
+#define STR_SVT_STYLE_BLACK_ITALIC (STR_SVT_STYLE_START+7)
+#define STR_SVT_STYLE_END (STR_SVT_STYLE_BLACK_ITALIC)
+
+#define STR_SVT_FONTMAP_START (STR_SVT_STYLE_END+1)
+#define STR_SVT_FONTMAP_BOTH (STR_SVT_FONTMAP_START+0)
+#define STR_SVT_FONTMAP_PRINTERONLY (STR_SVT_FONTMAP_START+1)
+#define STR_SVT_FONTMAP_SCREENONLY (STR_SVT_FONTMAP_START+2)
+#define STR_SVT_FONTMAP_SIZENOTAVAILABLE (STR_SVT_FONTMAP_START+3)
+#define STR_SVT_FONTMAP_STYLENOTAVAILABLE (STR_SVT_FONTMAP_START+4)
+#define STR_SVT_FONTMAP_NOTAVAILABLE (STR_SVT_FONTMAP_START+5)
+#define STR_SVT_FONTMAP_END (STR_SVT_FONTMAP_NOTAVAILABLE)
+
+#define STR_SVT_ERRORCONTEXT_START (STR_SVT_FONTMAP_END+1)
+#define STR_ERR_HDLMESS (STR_SVT_ERRORCONTEXT_START+0)
+#define RID_ERRHDL_CLASS (STR_SVT_ERRORCONTEXT_START+1)
+#define RID_ERRCTX (STR_SVT_ERRORCONTEXT_START+2)
+#define RID_ERRHDL (STR_SVT_ERRORCONTEXT_START+3)
+#define STR_SVT_ERRORCONTEXT_END (RID_ERRHDL)
+
+#define STR_WIZARDDIALOG_START (STR_SVT_ERRORCONTEXT_END + 1)
+#define STR_WIZDLG_FINISH (STR_WIZARDDIALOG_START + 0)
+#define STR_WIZDLG_NEXT (STR_WIZARDDIALOG_START + 1)
+#define STR_WIZDLG_PREVIOUS (STR_WIZARDDIALOG_START + 2)
+#define STR_WIZDLG_ROADMAP_TITLE (STR_WIZARDDIALOG_START + 3)
+#define STR_WIZARDDIALOG_END (STR_WIZDLG_ROADMAP_TITLE)
+
+#define STR_SVT_COLLATE_START (STR_WIZARDDIALOG_END+1)
+#define STR_SVT_COLLATE_NORMAL (STR_SVT_COLLATE_START+0)
+#define STR_SVT_COLLATE_DICTIONARY (STR_SVT_COLLATE_START+1)
+#define STR_SVT_COLLATE_PINYIN (STR_SVT_COLLATE_START+2)
+#define STR_SVT_COLLATE_STROKE (STR_SVT_COLLATE_START+3)
+#define STR_SVT_COLLATE_RADICAL (STR_SVT_COLLATE_START+4)
+#define STR_SVT_COLLATE_CHARSET (STR_SVT_COLLATE_START+5)
+#define STR_SVT_COLLATE_ZHUYIN (STR_SVT_COLLATE_START+6)
+#define STR_SVT_COLLATE_ALPHANUMERIC (STR_SVT_COLLATE_START+7)
+#define STR_SVT_COLLATE_UNICODE (STR_SVT_COLLATE_START+8)
+#define STR_SVT_COLLATE_PHONEBOOK (STR_SVT_COLLATE_START+9)
+#define STR_SVT_COLLATE_PHONETIC_F (STR_SVT_COLLATE_START+10)
+#define STR_SVT_COLLATE_PHONETIC_L (STR_SVT_COLLATE_START+11)
+#define STR_SVT_COLLATE_END (STR_SVT_COLLATE_PHONETIC_L)
+
+// String-Ids for accessibility
+#define STR_SVT_ACC_BEGIN (STR_SVT_COLLATE_END+1)
+#define STR_SVT_TOOL_PANEL_BUTTON_FWD (STR_SVT_ACC_BEGIN+0)
+#define STR_SVT_TOOL_PANEL_BUTTON_BACK (STR_SVT_ACC_BEGIN+1)
+#define STR_SVT_ACC_DESC_TABLISTBOX (STR_SVT_ACC_BEGIN+2)
+#define STR_SVT_ACC_DESC_FILEVIEW (STR_SVT_ACC_BEGIN+3)
+#define STR_SVT_ACC_DESC_FOLDER (STR_SVT_ACC_BEGIN+4)
+#define STR_SVT_ACC_DESC_FILE (STR_SVT_ACC_BEGIN+5)
+#define STR_SVT_ACC_EMPTY_FIELD (STR_SVT_ACC_BEGIN+6)
+//IAccessible2 implementation
+#define STR_SVT_ACC_RULER_HORZ_NAME (STR_SVT_ACC_BEGIN+9)
+#define STR_SVT_ACC_END (STR_SVT_ACC_RULER_HORZ_NAME)
+
+#define STR_SVT_INDEXENTRY_START (STR_SVT_ACC_END + 1)
+#define STR_SVT_INDEXENTRY_ALPHANUMERIC (STR_SVT_INDEXENTRY_START+0)
+#define STR_SVT_INDEXENTRY_DICTIONARY (STR_SVT_INDEXENTRY_START+1)
+#define STR_SVT_INDEXENTRY_PINYIN (STR_SVT_INDEXENTRY_START+2)
+#define STR_SVT_INDEXENTRY_RADICAL (STR_SVT_INDEXENTRY_START+3)
+#define STR_SVT_INDEXENTRY_STROKE (STR_SVT_INDEXENTRY_START+4)
+#define STR_SVT_INDEXENTRY_ZHUYIN (STR_SVT_INDEXENTRY_START+5)
+#define STR_SVT_INDEXENTRY_PHONETIC_FS (STR_SVT_INDEXENTRY_START+6)
+#define STR_SVT_INDEXENTRY_PHONETIC_FC (STR_SVT_INDEXENTRY_START+7)
+#define STR_SVT_INDEXENTRY_PHONETIC_LS (STR_SVT_INDEXENTRY_START+8)
+#define STR_SVT_INDEXENTRY_PHONETIC_LC (STR_SVT_INDEXENTRY_START+9)
+#define STR_SVT_INDEXENTRY_END (STR_SVT_INDEXENTRY_PHONETIC_LC)
+
+//String - Ids for Java errors, messages
+//These strings come from project desktop
+//There was no time for translation, therefore the defines needed to
+//remain the same.
+#define STR_SVT_JAVAERROR_START (STR_SVT_INDEXENTRY_END + 1)
+#define STR_QUESTION_JAVADISABLED (STR_SVT_JAVAERROR_START+0)
+#define STR_ERROR_JVMCREATIONFAILED (STR_SVT_JAVAERROR_START+1)
+#define STR_WARNING_JAVANOTFOUND (STR_SVT_JAVAERROR_START+2)
+#define STR_WARNING_INVALIDJAVASETTINGS (STR_SVT_JAVAERROR_START+3)
+// STR_SVT_JAVAERROR_START + 4 unused
+#define STR_SVT_JAVAERROR_END (STR_SVT_JAVAERROR_START+4)
+
+// String array to match UI language names to LanguageType values and vice versa
+#define STR_ARR_SVT_LANGUAGE_TABLE_START (STR_SVT_JAVAERROR_END + 1)
+#define STR_ARR_SVT_LANGUAGE_TABLE (STR_ARR_SVT_LANGUAGE_TABLE_START + 0)
+//due to some horror wizards/com/sun/star/wizards/letter/LocaleCodes.java needs to be kept
+//manually in sync with STR_ARR_SVT_LANGUAGE_TABLE
+#define STR_ARR_SVT_LANGUAGE_TABLE_END (STR_ARR_SVT_LANGUAGE_TABLE)
+
+#define STR_SVT_ADDRESSTEMPLATE_START (STR_ARR_SVT_LANGUAGE_TABLE_END+1)
+#define STR_NO_FIELD_SELECTION (STR_SVT_ADDRESSTEMPLATE_START+0)
+#define STR_FIELD_COMPANY (STR_SVT_ADDRESSTEMPLATE_START+1)
+#define STR_FIELD_DEPARTMENT (STR_SVT_ADDRESSTEMPLATE_START+2)
+#define STR_FIELD_FIRSTNAME (STR_SVT_ADDRESSTEMPLATE_START+3)
+#define STR_FIELD_LASTNAME (STR_SVT_ADDRESSTEMPLATE_START+4)
+#define STR_FIELD_STREET (STR_SVT_ADDRESSTEMPLATE_START+5)
+#define STR_FIELD_COUNTRY (STR_SVT_ADDRESSTEMPLATE_START+6)
+#define STR_FIELD_ZIPCODE (STR_SVT_ADDRESSTEMPLATE_START+7)
+#define STR_FIELD_CITY (STR_SVT_ADDRESSTEMPLATE_START+8)
+#define STR_FIELD_TITLE (STR_SVT_ADDRESSTEMPLATE_START+9)
+#define STR_FIELD_POSITION (STR_SVT_ADDRESSTEMPLATE_START+10)
+#define STR_FIELD_ADDRFORM (STR_SVT_ADDRESSTEMPLATE_START+11)
+#define STR_FIELD_INITIALS (STR_SVT_ADDRESSTEMPLATE_START+12)
+#define STR_FIELD_SALUTATION (STR_SVT_ADDRESSTEMPLATE_START+13)
+#define STR_FIELD_HOMETEL (STR_SVT_ADDRESSTEMPLATE_START+14)
+#define STR_FIELD_WORKTEL (STR_SVT_ADDRESSTEMPLATE_START+15)
+#define STR_FIELD_FAX (STR_SVT_ADDRESSTEMPLATE_START+16)
+#define STR_FIELD_EMAIL (STR_SVT_ADDRESSTEMPLATE_START+17)
+#define STR_FIELD_URL (STR_SVT_ADDRESSTEMPLATE_START+18)
+#define STR_FIELD_NOTE (STR_SVT_ADDRESSTEMPLATE_START+19)
+#define STR_FIELD_USER1 (STR_SVT_ADDRESSTEMPLATE_START+20)
+#define STR_FIELD_USER2 (STR_SVT_ADDRESSTEMPLATE_START+21)
+#define STR_FIELD_USER3 (STR_SVT_ADDRESSTEMPLATE_START+22)
+#define STR_FIELD_USER4 (STR_SVT_ADDRESSTEMPLATE_START+23)
+#define STR_FIELD_ID (STR_SVT_ADDRESSTEMPLATE_START+24)
+#define STR_FIELD_STATE (STR_SVT_ADDRESSTEMPLATE_START+25)
+#define STR_FIELD_OFFICETEL (STR_SVT_ADDRESSTEMPLATE_START+26)
+#define STR_FIELD_PAGER (STR_SVT_ADDRESSTEMPLATE_START+27)
+#define STR_FIELD_MOBILE (STR_SVT_ADDRESSTEMPLATE_START+28)
+#define STR_FIELD_TELOTHER (STR_SVT_ADDRESSTEMPLATE_START+29)
+#define STR_FIELD_CALENDAR (STR_SVT_ADDRESSTEMPLATE_START+30)
+#define STR_FIELD_INVITE (STR_SVT_ADDRESSTEMPLATE_START+31)
+#define STR_LOGICAL_FIELD_NAMES (STR_SVT_ADDRESSTEMPLATE_START+32)
+#define STR_SVT_ADDRESSTEMPLATE_END (STR_LOGICAL_FIELD_NAMES)
+
+
+
+//.............................................................................
+// dialogs
+
+#define DLG_LOGIN (RID_SVTOOLS_START+113)
+#define DLG_ADDRESSBOOKSOURCE (RID_SVTOOLS_START+114)
+
+//.............................................................................
+// bitmaps
+
+#define BMP_HELP_AGENT_IMAGE (RID_SVTOOLS_BITMAP_START + 1)
+#define BMP_HELP_AGENT_CLOSER (RID_SVTOOLS_BITMAP_START + 2)
+#define BMP_PLUGIN (RID_SVTOOLS_BITMAP_START + 3)
+#define BMP_LIST_ADD (RID_SVTOOLS_BITMAP_START + 4)
+
+//.............................................................................
+// image lists
+
+#define RID_SVTOOLS_IMAGELIST_BIG (RID_SVTOOLS_IMAGELIST_START + 1)
+#define RID_SVTOOLS_IMAGELIST_SMALL (RID_SVTOOLS_IMAGELIST_START + 2)
+#define RID_SVTOOLS_IMAGELIST_EDITBROWSEBOX (RID_SVTOOLS_IMAGELIST_START + 3)
+
+// Java message boxes
+//These strings come from project desktop
+//There was no time for translation, therefore the defines needed to
+//remain the same.
+#define QBX_JAVADISABLED (RID_SVTOOLS_START+20)
+#define ERRORBOX_JVMCREATIONFAILED (RID_SVTOOLS_START+21)
+#define WARNINGBOX_JAVANOTFOUND (RID_SVTOOLS_START+22)
+#define WARNINGBOX_INVALIDJAVASETTINGS (RID_SVTOOLS_START+23)
+// RID_SVTOOLS_START + 24 unused
+#define WARNINGBOX_INVALIDJAVASETTINGS_MAC (RID_SVTOOLS_START+25)
+#define ERRORBOX_JVMCREATIONFAILED_MAC (RID_SVTOOLS_START+26)
+
+//.............................................................................
+// images
+#define RID_IMG_TREENODE_COLLAPSED (RID_SVTOOLS_START + 0)
+#define RID_IMG_TREENODE_EXPANDED (RID_SVTOOLS_START + 1)
+
+#define IMG_TRIANGLE_RIGHT (RID_SVTOOLS_START + 18)
+#define IMG_TRIANGLE_DOWN (RID_SVTOOLS_START + 20)
+
+#define IMG_SVT_FOLDER (RID_SVTOOLS_START + 42)
+
+#define IMG_SVT_NEWDOC (RID_SVTOOLS_START + 52)
+#define IMG_SVT_MYDOCS (RID_SVTOOLS_START + 53)
+#define IMG_SVT_TEMPLATES (RID_SVTOOLS_START + 54)
+#define IMG_SVT_SAMPLES (RID_SVTOOLS_START + 55)
+
+#define IMG_SVT_DOCTEMPLATE_BACK_SMALL (RID_SVTOOLS_START + 70)
+#define IMG_SVT_DOCTEMPLATE_BACK_LARGE (RID_SVTOOLS_START + 71)
+#define IMG_SVT_DOCTEMPLATE_PREV_SMALL (RID_SVTOOLS_START + 72)
+#define IMG_SVT_DOCTEMPLATE_PREV_LARGE (RID_SVTOOLS_START + 73)
+#define IMG_SVT_DOCTEMPLATE_PRINT_SMALL (RID_SVTOOLS_START + 74)
+#define IMG_SVT_DOCTEMPLATE_PRINT_LARGE (RID_SVTOOLS_START + 75)
+#define IMG_SVT_DOCTEMPLATE_DOCINFO_SMALL (RID_SVTOOLS_START + 76)
+#define IMG_SVT_DOCTEMPLATE_DOCINFO_LARGE (RID_SVTOOLS_START + 77)
+#define IMG_SVT_DOCTEMPLATE_PREVIEW_SMALL (RID_SVTOOLS_START + 78)
+#define IMG_SVT_DOCTEMPLATE_PREVIEW_LARGE (RID_SVTOOLS_START + 79)
+
+#define RID_IMG_PRNDLG_NOCOLLATE (STR_SVT_PRNDLG_START + 30)
+
+// IAccessible2 implementation in 2009
+#define STR_PARAGRAPH_START (STR_SVT_PRNDLG_START + 50)
+#define STR_PARAGRAPH (STR_PARAGRAPH_START + 0)
+
+#endif // #ifndef _SVTOOLS_HRC
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svtresid.hxx b/include/svtools/svtresid.hxx
new file mode 100644
index 000000000000..0340a1bd7c5d
--- /dev/null
+++ b/include/svtools/svtresid.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 _SVTOOLS_SVTRESID_HXX
+#define _SVTOOLS_SVTRESID_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/resid.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+
+class SVT_DLLPUBLIC SvtResId: public ResId
+{
+public:
+ SvtResId(sal_uInt16 nId);
+ static void DeleteResMgr();
+};
+
+#define SVT_RESSTR(i) SvtResId(i).toString()
+
+#endif // _SVTOOLS_SVTRESID_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svxbox.hxx b/include/svtools/svxbox.hxx
new file mode 100644
index 000000000000..4ccc566fd74d
--- /dev/null
+++ b/include/svtools/svxbox.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 _SVX_BOX_HXX
+#define _SVX_BOX_HXX
+
+#include <tools/string.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/combobox.hxx>
+#include <svtools/svtdllapi.h>
+
+// forward ---------------------------------------------------------------
+
+class SvxBoxEntry;
+
+typedef std::vector<SvxBoxEntry*> SvxEntryLst;
+
+// class SvxBoxEntry -----------------------------------------------------
+
+class SVT_DLLPUBLIC SvxBoxEntry
+{
+ friend class SvxListBox;
+ friend class SvxComboBox;
+
+public:
+ SvxBoxEntry( const String& aName, sal_uInt16 nId=0 );
+ SvxBoxEntry( const SvxBoxEntry& rOrg );
+ SvxBoxEntry();
+
+ String aName;
+ sal_uInt16 nId;
+
+private:
+ sal_Bool bModified;
+ sal_Bool bNew;
+};
+
+// class SvxListBox ------------------------------------------------------
+
+class SVT_DLLPUBLIC SvxListBox : public ListBox
+{
+ using ListBox::InsertEntry;
+ using ListBox::RemoveEntry;
+ using ListBox::GetEntryPos;
+ using ListBox::IsEntrySelected;
+ using ListBox::SelectEntry;
+
+public:
+ SvxListBox( Window* pParent, WinBits nBits = WB_BORDER );
+ SvxListBox( Window* pParent, const ResId& rId );
+ ~SvxListBox();
+
+ void InsertNewEntry( const SvxBoxEntry& rEntry );
+ void InsertEntry( const SvxBoxEntry& rEntry,
+ sal_uInt16 nId = LISTBOX_ENTRY_NOTFOUND );
+
+ void RemoveEntry( sal_uInt16 nPos );
+ void RemoveEntry( const SvxBoxEntry& rEntry );
+
+ void Clear();
+
+ sal_uInt16 GetEntryPos( const SvxBoxEntry& rEntry ) const;
+ const SvxBoxEntry& GetSvxBoxEntry( sal_uInt16 nIdx ) const;
+
+ inline sal_Bool IsEntrySelected( const SvxBoxEntry& rEntry ) const;
+ const SvxBoxEntry& GetSelectSvxBoxEntry( sal_uInt16 nIdx = 0 ) const;
+ inline void SelectEntry( const SvxBoxEntry& rEntry,
+ sal_Bool bSelect = sal_True );
+
+ void ModifyEntry( sal_uInt16 nPos, const String& aName );
+ sal_uInt16 GetModifiedCount() const;
+ const SvxBoxEntry& GetModifiedEntry( sal_uInt16 nPos ) const;
+
+ sal_uInt16 GetRemovedCount() const;
+ const SvxBoxEntry& GetRemovedEntry( sal_uInt16 nPos ) const;
+
+ sal_uInt16 GetNewCount() const;
+ const SvxBoxEntry& GetNewEntry( sal_uInt16 nPos ) const;
+
+private:
+ SvxEntryLst aEntryLst;
+ SvxEntryLst aDelEntryLst;
+ SvxBoxEntry aDefault;
+
+ void InitListBox();
+ void InsertSorted( SvxBoxEntry* pEntry );
+};
+
+// inlines ---------------------------------------------------------------
+
+inline sal_Bool SvxListBox::IsEntrySelected( const SvxBoxEntry& aEntry ) const
+ { return ListBox::IsEntrySelected( aEntry.aName ); }
+
+inline void SvxListBox::SelectEntry( const SvxBoxEntry& aEntry, sal_Bool bSelect )
+ { ListBox::SelectEntry( aEntry.aName, bSelect ); }
+
+// enum SvxComboBoxStyle -------------------------------------------------
+
+enum SvxComboBoxStyle
+{
+ SVX_CBS_UPPER = 0x01,
+ SVX_CBS_LOWER = 0x02,
+ SVX_CBS_ALL = 0x04,
+ SVX_CBS_FILENAME = 0x08,
+ SVX_CBS_SW_FILENAME = SVX_CBS_FILENAME
+};
+
+// class SvxComboBox -----------------------------------------------------
+
+class SVT_DLLPUBLIC SvxComboBox : public ComboBox
+{
+ using ComboBox::InsertEntry;
+ using ComboBox::RemoveEntry;
+ using ComboBox::GetEntryPos;
+ using Window::SetStyle;
+
+public:
+ SvxComboBox( Window* pParent,
+ WinBits nBits = WB_BORDER, sal_uInt16 nStyleBits = SVX_CBS_ALL );
+ SvxComboBox( Window* pParent, const ResId& rId, sal_uInt16 nStyleBits = SVX_CBS_ALL );
+ ~SvxComboBox();
+
+ void InsertNewEntry( const SvxBoxEntry& );
+ void InsertEntry( const SvxBoxEntry& );
+
+ void RemoveEntry( sal_uInt16 nPos );
+ void RemoveEntry( const SvxBoxEntry& rEntry );
+
+ void Clear();
+
+ sal_uInt16 GetEntryPos( const SvxBoxEntry& rEntry ) const;
+ const SvxBoxEntry& GetEntry( sal_uInt16 nIdx ) const;
+
+ void ModifyEntry( sal_uInt16 nPos, const String& aName );
+ sal_uInt16 GetModifiedCount() const;
+ const SvxBoxEntry& GetModifiedEntry( sal_uInt16 nPos ) const;
+
+ sal_uInt16 GetRemovedCount() const;
+ const SvxBoxEntry& GetRemovedEntry( sal_uInt16 nPos ) const;
+
+ sal_uInt16 GetNewCount() const;
+ const SvxBoxEntry& GetNewEntry( sal_uInt16 nPos ) const;
+
+ sal_uInt16 GetStyle() const { return nStyle; }
+ void SetStyle( const sal_uInt16 nSt ) { nStyle = nSt; }
+
+ OUString GetText() const;
+
+private:
+ SvxEntryLst aEntryLst;
+ SvxEntryLst aDelEntryLst;
+ SvxBoxEntry aDefault;
+ sal_uInt16 nStyle;
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+
+ void InitComboBox();
+ void InsertSorted( SvxBoxEntry* pEntry );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx
new file mode 100644
index 000000000000..265723ecf8b8
--- /dev/null
+++ b/include/svtools/tabbar.hxx
@@ -0,0 +1,557 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TABBAR_HXX
+#define _TABBAR_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <vcl/window.hxx>
+#include <vector>
+
+class MouseEvent;
+class TrackingEvent;
+class DataChangedEvent;
+class ImplTabButton;
+class ImplTabSizer;
+class TabBarEdit;
+
+struct ImplTabBarItem;
+typedef ::std::vector< ImplTabBarItem* > ImplTabBarList;
+
+// -----------------
+// - Dokumentation -
+// -----------------
+
+/*
+
+Erlaubte StyleBits
+------------------
+
+WB_SCROLL - Die Tabs koennen ueber ein Extra-Feld gescrollt werden
+WB_MINSCROLL - Die Tabs koennen ueber 2 zusaetzliche Buttons gescrollt werden
+WB_RANGESELECT - Zusammenhaengende Bereiche koennen selektiert werden
+WB_MULTISELECT - Einzelne Tabs koennen selektiert werden
+WB_BORDER - Oben und unten wird ein Strich gezeichnet
+WB_TOPBORDER - Oben wird ein Border gezeichnet
+WB_3DTAB - Die Tabs und der Border werden in 3D gezeichnet
+WB_DRAG - Vom TabBar wird ein StartDrag-Handler gerufen, wenn
+ Drag and Drop gestartet werden soll. Es wird ausserdem
+ im TabBar mit EnableDrop() Drag and Drop eingeschaltet.
+WB_SIZEABLE - Vom TabBar wird ein Split-Handler gerufen, wenn der Anwender
+ den TabBar in der Breite aendern will
+WB_STDTABBAR - WB_BORDER
+
+Wenn man den TabBar zum Beispiel als Property-Bar benutzen moechte, sollten
+die WinBits WB_TOPBORDER und WB_3DTAB anstatt WB_BORDER gesetzt werden.
+
+
+Erlaubte PageBits
+-----------------
+
+TPB_SPECIAL - Andere Darstellung des TabTextes, zum Beispiel fuer
+ Szenario-Seiten.
+
+
+Handler
+-------
+
+Select - Wird gerufen, wenn eine Tab selektiert oder
+ deselektiert wird
+DoubleClick - Wird gerufen, wenn ein DoubleClick im TabBar ausgeloest
+ wurde. Innerhalb des Handlers liefert GetCurPageId() die
+ angeklickte Tab zurueck oder 0, wenn keine Tab angeklickt
+ wurde
+ActivatePage - Wird gerufen, wenn eine andere Seite aktiviert wird.
+ GetCurPageId() gibt die aktivierte Seite zurueck.
+DeactivatePage - Wird gerufen, wenn eine Seite deaktiviert wird. Wenn
+ eine andere Seite aktiviert werden darf, muss sal_True
+ zurueckgegeben werden, wenn eine andere Seite von
+ der Aktivierung ausgeschlossen werden soll, muss
+ sal_False zurueckgegeben werden. GetCurPageId() gibt die
+ zu deaktivierende Seite zurueck.
+
+
+
+Drag and Drop
+-------------
+
+Fuer Drag and Drop muss das WinBit WB_DRAG gesetzt werden. Ausserdem
+muss der Command-, QueryDrop-Handler und der Drop-Handler ueberlagert
+werden. Dabei muss in den Handlern folgendes implementiert werden:
+
+Command - Wenn in diesem Handler das Dragging gestartet werden
+ soll, muss StartDrag() gerufen werden. Diese Methode
+ selektiert dann den entsprechenden Eintrag oder gibt
+ sal_False zurueck, wenn das Dragging nicht durchgefuhert
+ werden kann.
+
+QueryDrop - Dieser Handler wird von StarView immer dann gerufen, wenn
+ bei einem Drag-Vorgang die Maus ueber das Fenster gezogen
+ wird (siehe dazu auch SV-Doku). In diesem Handler muss
+ festgestellt werden, ob ein Drop moeglich ist. Die
+ Drop-Position kann im TabBar mit ShowDropPos() angezeigt
+ werden. Beim Aufruf muss die Position vom Event uebergeben
+ werden. Wenn sich die Position am linken oder rechten
+ Rand befindet, wird automatisch im TabBar gescrollt.
+ Diese Methode gibt auch die entsprechende Drop-Position
+ zurueck, die auch fuer ein Drop gebraucht wird. Wenn das
+ Fenster beim Drag verlassen wird, kann mit HideDropPos()
+ die DropPosition wieder weggenommen werden. Es ist dadurch
+ auch moeglich, ein von ausserhalb des TabBars ausgeloestes
+ Drag zu verarbeiten.
+
+Drop - Im Drop-Handler muessen dann die Pages verschoben werden,
+ oder die neuen Pages eingefuegt werden. Die entsprechende
+ Drop-Postion kann mit ShowDropPos() ermittelt werden.
+
+Folgende Methoden werden fuer Drag and Drop gebraucht und muessen von
+den Handlern gerufen werden:
+
+StartDrag - Muss aus dem Commnad-Handler gerufen werden. Als Parameter
+ muss der CommandEvent uebergeben werden und eine Referenz
+ auf eine Region. Diese Region muss dann bei ExecuteDrag()
+ uebergeben werden, wenn der Rueckgabewert sagt, das
+ ExecuteDrag durchgefuehrt werden soll. Falls der Eintrag
+ nicht selektiert ist, wird er vorher als aktueller
+ Eintrag gesetzt. Es ist daher darauf zu achten, das aus
+ dieser Methode heraus der Select-Handler gerufen werden
+ kann.
+
+ShowDropPos - Diese Methode muss vom QueryDrop-Handler gerufen werden,
+ damit der TabBar anzeigt, wo die Tabs eingefuegt werden.
+ Diese Methode kann auch im Drop-Handler benutzt werden,
+ um die Position zu ermitteln wo die Tabs eingefuegt werden
+ sollen. In der Methode muss die Position vom Event
+ uebergeben werden. Diese Methode gibt die Position zurueck,
+ wo die Tabs eingefuegt werden sollen.
+
+HideDropPos - Diese Methode nimmt die vorher mit ShowDropPos() angezeigte
+ DropPosition wieder zurueck. Diese Methode sollte dann
+ gerufen werden, wenn bei QueryDrop() das Fenster verlassen
+ wird oder der Dragvorgang beendet wurde.
+
+Folgende Methoden koennen eingesetzt werden, wenn bei D&D die Seiten
+umgeschaltet werden sollen:
+
+SwitchPage - Diese Methode muss vom QueryDrop-Handler gerufen werden,
+ wenn die Seite ueber der sich der Mousepointer befindet,
+ umgeschaltet werden soll. Diese Methode sollte jedesmal
+ gerufen werden, wenn der QueryDrop-Handler gerufen wird.
+ Das umschalten der Seite passiert zeitverzoegert (500 ms)
+ und wird automatisch von dieser Methode verwaltet.
+ In der Methode muss die Position vom Event uebergeben
+ werden. Diese Methode gibt sal_True zurueck, wenn die Page
+ umgeschaltet wurde.
+
+EndSwitchPage - Diese Methode setzt die Daten fuer das umschalten der
+ Seiten zurueck. Diese Methode sollte dann gerufen werden,
+ wenn bei QueryDrop() das Fenster verlassen wird oder
+ der Dragvorgang beendet wurde.
+
+IsInSwitching - Mit dieser Methode kann im ActivatePage()/DeactivatePage()
+ abgefragt werden, ob dies durch SwitchPage() veranlasst
+ wurde. So kann dann beispielsweise in DeactivatePage()
+ das Umschalten ohne eine Fehlerbox verhindert werden.
+
+
+Fenster-Resize
+--------------
+
+Wenn das Fenster vom Anwender in der Breite geaendert werden kann, dann
+muss das WinBit WB_SIZEABLE gesetzt werden. In diesem Fall muss noch
+folgender Handler ueberlagert werden:
+
+Split - Wenn dieser Handler gerufen wird, sollte das Fenster
+ auf die Breite angepasst werden, die von GetSplitSize()
+ zurueckgegeben wird. Dabei wird keine minimale und
+ maximale Breite beruecksichtig. Eine minimale Breite
+ kann mit GetMinSize() abgefragt werden und die maximale
+ Breite muss von der Anwendung selber berechnet werden.
+ Da nur Online-Resize unterstuetzt wird, muss das Fenster
+ innerhalb dieses Handlers in der Breite geaendert
+ werden und eventuell abhaengige Fenster ebenfalls. Fuer
+ diesen Handler kann auch mit SetSplitHdl() ein
+ Link gesetzt werden.
+
+Folgende Methoden liefern beim Splitten weitere Informationen:
+
+GetSplitSize() - Liefert die Breite des TabBars zurueck, auf die der
+ Anwender das Fenster resizen will. Dabei wird keine
+ minimale oder maximale Breite beruecksichtigt. Es wird
+ jedoch nie eine Breite < 5 zurueckgeliefert. Diese Methode
+ liefert nur solange richtige Werte, wie Splitten aktiv
+ ist.
+
+GetMinSize() - Mit dieser Methode kann eine minimale Fensterbreite
+ abgefragt werden, so das min. etwas eines Tabs sichtbar
+ ist. Jedoch kann der TabBar immer noch schmaler gesetzt
+ werden, als die Breite, die diese Methode zurueckliefert.
+ Diese Methode kann auch aufgerufen werden, wenn kein
+ Splitten aktiv ist.
+
+
+Edit-Modus
+----------
+
+Der Tabbar bietet auch Moeglichkeiten, das der Anwender in den Tabreitern
+die Namen aendern kann.
+
+EnableEditMode - Damit kann eingestellt werden, das bei Alt+LeftClick
+ StartEditMode() automatisch vom TabBar gerufen wird.
+ Im StartRenaming()-Handler kann dann das Umbenennen
+ noch abgelehnt werden.
+StartEditMode - Mit dieser Methode wird der EditModus auf einem
+ Tab gestartet. sal_False wird zurueckgegeben, wenn
+ der Editmodus schon aktiv ist, mit StartRenaming()
+ der Modus abgelehnt wurde oder kein Platz zum
+ Editieren vorhanden ist.
+EndEditMode - Mit dieser Methode wird der EditModus beendet.
+SetEditText - Mit dieser Methode kann der Text im AllowRenaming()-
+ Handler noch durch einen anderen Text ersetzt werden.
+GetEditText - Mit dieser Methode kann im AllowRenaming()-Handler
+ der Text abgefragt werden, den der Anwender eingegeben
+ hat.
+IsInEditMode - Mit dieser Methode kann abgefragt werden, ob der
+ Editmodus aktiv ist.
+IsEditModeCanceled - Mit dieser Methode kann im EndRenaming()-
+ Handler abgefragt werden, ob die Umbenenung
+ abgebrochen wurde.
+GetEditPageId - Mit dieser Methode wird in den Renaming-Handlern
+ abgefragt, welcher Tab umbenannt wird/wurde.
+
+StartRenaming() - Dieser Handler wird gerufen, wenn ueber StartEditMode()
+ der Editmodus gestartet wurde. Mit GetEditPageId()
+ kann abgefragt werden, welcher Tab umbenannt werden
+ soll. sal_False sollte zurueckgegeben werden, wenn
+ der Editmodus nicht gestartet werden soll.
+AllowRenaming() - Dieser Handler wird gerufen, wenn der Editmodus
+ beendet wird (nicht bei Cancel). In diesem Handler
+ kann dann getestet werden, ob der Text OK ist.
+ Mit GetEditPageId() kann abgefragt werden, welcher Tab
+ umbenannt wurde.
+ Es sollte einer der folgenden Werte zurueckgegeben
+ werden:
+ TAB_RENAMING_YES
+ Der Tab wird umbenannt.
+ TAB_RENAMING_NO
+ Der Tab wird nicht umbenannt, der Editmodus bleibt
+ jedoch aktiv, so das der Anwender den Namen
+ entsprechent anpassen kann.
+ TAB_RENAMING_CANCEL
+ Der Editmodus wird abgebrochen und der alte
+ Text wieder hergestellt.
+EndRenaming() - Dieser Handler wird gerufen, wenn der Editmodus
+ beendet wurde. Mit GetEditPageId() kann abgefragt
+ werden, welcher Tab umbenannt wurde. Mit
+ IsEditModeCanceled() kann abgefragt werden, ob der
+ Modus abgebrochen wurde und der Name dadurch nicht
+ geaendert wurde.
+
+
+Maximale Pagebreite
+-------------------
+
+Die Pagebreite der Tabs kann begrenzt werden, damit ein einfacheres
+Navigieren ueber diese moeglich ist. Wenn der Text dann nicht komplett
+angezeigt werden kann, wird er mit ... abgekuerzt und in der Tip-
+oder der aktiven Hilfe (wenn kein Hilfetext gesetzt ist) wird dann der
+ganze Text angezeigt. Mit EnableAutoMaxPageWidth() kann eingestellt
+werden, ob die maximale Pagebreite sich nach der gerade sichtbaren
+Breite richten soll (ist der default). Ansonsten kann auch die
+maximale Pagebreite mit SetMaxPageWidth() (in Pixeln) gesetzt werden
+(die AutoMaxPageWidth wird dann ignoriert).
+
+
+KontextMenu
+-----------
+
+Wenn ein kontextsensitives PopupMenu anzeigt werden soll, muss der
+Command-Handler ueberlagert werden. Mit GetPageId() und bei
+Uebergabe der Mausposition kann ermittelt werden, ob der Mausclick
+ueber einem bzw. ueber welchem Item durchgefuehrt wurde.
+*/
+
+// -----------
+// - WinBits -
+// -----------
+
+#define WB_RANGESELECT ((WinBits)0x00200000)
+#define WB_MULTISELECT ((WinBits)0x00400000)
+#define WB_TOPBORDER ((WinBits)0x04000000)
+#define WB_3DTAB ((WinBits)0x08000000)
+#define WB_MINSCROLL ((WinBits)0x20000000)
+#define WB_INSERTTAB ((WinBits)0x40000000)
+#define WB_STDTABBAR WB_BORDER
+
+// ------------------
+// - TabBarPageBits -
+// ------------------
+
+typedef sal_uInt16 TabBarPageBits;
+
+// -------------------------
+// - Bits fuer TabBarPages -
+// -------------------------
+
+#define TPB_SPECIAL ((TabBarPageBits)0x0001)
+
+// ----------------
+// - TabBar-Types -
+// ----------------
+
+#define TABBAR_RENAMING_YES ((long)sal_True)
+#define TABBAR_RENAMING_NO ((long)sal_False)
+#define TABBAR_RENAMING_CANCEL ((long)2)
+
+// ----------
+// - TabBar -
+// ----------
+struct TabBar_Impl;
+struct ImplTabBarItem;
+
+class SVT_DLLPUBLIC TabBar : public Window
+{
+ friend class ImplTabButton;
+ friend class ImplTabSizer;
+
+private:
+ ImplTabBarList* mpItemList;
+ ImplTabButton* mpFirstBtn;
+ ImplTabButton* mpPrevBtn;
+ ImplTabButton* mpNextBtn;
+ ImplTabButton* mpLastBtn;
+ TabBar_Impl* mpImpl;
+ TabBarEdit* mpEdit;
+ OUString maEditText;
+ Color maSelColor;
+ Color maSelTextColor;
+ Size maWinSize;
+ long mnMaxPageWidth;
+ long mnCurMaxWidth;
+ long mnOffX;
+ long mnOffY;
+ long mnLastOffX;
+ long mnSplitSize;
+ sal_uLong mnSwitchTime;
+ WinBits mnWinStyle;
+ sal_uInt16 mnCurPageId;
+ sal_uInt16 mnFirstPos;
+ sal_uInt16 mnDropPos;
+ sal_uInt16 mnSwitchId;
+ sal_uInt16 mnEditId;
+ sal_Bool mbFormat;
+ sal_Bool mbFirstFormat;
+ sal_Bool mbSizeFormat;
+ sal_Bool mbAutoMaxWidth;
+ sal_Bool mbInSwitching;
+ sal_Bool mbAutoEditMode;
+ sal_Bool mbEditCanceled;
+ sal_Bool mbDropPos;
+ sal_Bool mbInSelect;
+ sal_Bool mbSelColor;
+ sal_Bool mbSelTextColor;
+ bool mbMirrored;
+ bool mbHasInsertTab; // if true, the tab bar has an extra tab at the end.
+ Link maSelectHdl;
+ Link maDoubleClickHdl;
+ Link maSplitHdl;
+ Link maActivatePageHdl;
+ Link maDeactivatePageHdl;
+ Link maStartRenamingHdl;
+ Link maAllowRenamingHdl;
+ Link maEndRenamingHdl;
+ size_t maCurrentItemList;
+
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle );
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bBackground );
+ SVT_DLLPRIVATE void ImplGetColors( Color& rFaceColor, Color& rFaceTextColor,
+ Color& rSelectColor, Color& rSelectTextColor );
+ SVT_DLLPRIVATE void ImplShowPage( sal_uInt16 nPos );
+ SVT_DLLPRIVATE sal_Bool ImplCalcWidth();
+ SVT_DLLPRIVATE void ImplFormat();
+ SVT_DLLPRIVATE sal_uInt16 ImplGetLastFirstPos();
+ SVT_DLLPRIVATE void ImplInitControls();
+ SVT_DLLPRIVATE void ImplEnableControls();
+ SVT_DLLPRIVATE void ImplSelect();
+ SVT_DLLPRIVATE void ImplActivatePage();
+ SVT_DLLPRIVATE long ImplDeactivatePage();
+ SVT_DLLPRIVATE void ImplPrePaint();
+ SVT_DLLPRIVATE ImplTabBarItem* ImplGetLastTabBarItem( sal_uInt16 nItemCount );
+ SVT_DLLPRIVATE Rectangle ImplGetInsertTabRect(ImplTabBarItem* pItem) const;
+ DECL_DLLPRIVATE_LINK( ImplClickHdl, ImplTabButton* );
+
+ ImplTabBarItem* seek( size_t i );
+ ImplTabBarItem* prev();
+ ImplTabBarItem* next();
+
+public:
+ static const sal_uInt16 APPEND;
+ static const sal_uInt16 PAGE_NOT_FOUND;
+ static const sal_uInt16 INSERT_TAB_POS;
+
+ TabBar( Window* pParent, WinBits nWinStyle = WB_STDTABBAR );
+ virtual ~TabBar();
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Select();
+ virtual void DoubleClick();
+ virtual void Split();
+ virtual void ActivatePage();
+ virtual long DeactivatePage();
+ virtual long StartRenaming();
+ virtual long AllowRenaming();
+ virtual void EndRenaming();
+ virtual void Mirror();
+
+ void InsertPage( sal_uInt16 nPageId, const OUString& rText,
+ TabBarPageBits nBits = 0,
+ sal_uInt16 nPos = TabBar::APPEND );
+ void RemovePage( sal_uInt16 nPageId );
+ void MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos );
+
+ Color GetTabBgColor( sal_uInt16 nPageId ) const;
+ void SetTabBgColor( sal_uInt16 nPageId, const Color& aTabBgColor );
+ sal_Bool IsDefaultTabBgColor( sal_uInt16 nPageId );
+
+ void Clear();
+
+ sal_Bool IsPageEnabled( sal_uInt16 nPageId ) const;
+
+ void SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits = 0 );
+ TabBarPageBits GetPageBits( sal_uInt16 nPageId ) const;
+
+ sal_uInt16 GetPageCount() const;
+ sal_uInt16 GetPageId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetPagePos( sal_uInt16 nPageId ) const;
+ sal_uInt16 GetPageId( const Point& rPos, bool bCheckInsTab = false ) const;
+ Rectangle GetPageRect( sal_uInt16 nPageId ) const;
+ // returns the rectangle in which page tabs are drawn
+ Rectangle GetPageArea() const;
+
+ void SetCurPageId( sal_uInt16 nPageId );
+ sal_uInt16 GetCurPageId() const { return mnCurPageId; }
+
+ void SetFirstPageId( sal_uInt16 nPageId );
+ sal_uInt16 GetFirstPageId() const { return GetPageId( mnFirstPos ); }
+ void MakeVisible( sal_uInt16 nPageId );
+
+ void SelectPage( sal_uInt16 nPageId, sal_Bool bSelect = sal_True );
+ sal_uInt16 GetSelectPageCount() const;
+ sal_Bool IsPageSelected( sal_uInt16 nPageId ) const;
+
+ void EnableAutoMaxPageWidth( sal_Bool bEnable = sal_True ) { mbAutoMaxWidth = bEnable; }
+ sal_Bool IsAutoMaxPageWidthEnabled() const { return mbAutoMaxWidth; }
+ void SetMaxPageWidth( long nMaxWidth );
+ long GetMaxPageWidth() const { return mnMaxPageWidth; }
+ void ResetMaxPageWidth() { SetMaxPageWidth( 0 ); }
+ sal_Bool IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
+
+ void EnableEditMode( sal_Bool bEnable = sal_True ) { mbAutoEditMode = bEnable; }
+ sal_Bool IsEditModeEnabled() const { return mbAutoEditMode; }
+ sal_Bool StartEditMode( sal_uInt16 nPageId );
+ void EndEditMode( sal_Bool bCancel = sal_False );
+ void SetEditText( const OUString& rText ) { maEditText = rText; }
+ const OUString& GetEditText() const { return maEditText; }
+ sal_Bool IsInEditMode() const { return (mpEdit != NULL); }
+ sal_Bool IsEditModeCanceled() const { return mbEditCanceled; }
+ sal_uInt16 GetEditPageId() const { return mnEditId; }
+
+ /** Mirrors the entire control including position of buttons and splitter.
+ Mirroring is done relative to the current direction of the GUI.
+ @param bMirrored sal_True = the control will draw itself RTL in LTR GUI,
+ and vice versa; sal_False = the control behaves according to the
+ current direction of the GUI. */
+ void SetMirrored(bool bMirrored = true);
+ /** Returns sal_True, if the control is set to mirrored mode (see SetMirrored()). */
+ bool IsMirrored() const { return mbMirrored; }
+
+ /** Sets the control to LTR or RTL mode regardless of the GUI direction.
+ @param bRTL sal_False = the control will draw from left to right;
+ sal_True = the control will draw from right to left. */
+ void SetEffectiveRTL( bool bRTL );
+ /** Returns true, if the control draws from right to left (see SetEffectiveRTL()). */
+ bool IsEffectiveRTL() const;
+
+ sal_Bool StartDrag( const CommandEvent& rCEvt, Region& rRegion );
+ sal_uInt16 ShowDropPos( const Point& rPos );
+ void HideDropPos();
+ sal_Bool SwitchPage( const Point& rPos );
+ void EndSwitchPage();
+ sal_Bool IsInSwitching() { return mbInSwitching; }
+
+ const Color& GetSelectColor() const { return maSelColor; }
+ sal_Bool IsSelectColor() const { return mbSelColor; }
+ const Color& GetSelectTextColor() const { return maSelTextColor; }
+ sal_Bool IsSelectTextColor() const { return mbSelTextColor; }
+
+ void SetPageText( sal_uInt16 nPageId, const OUString& rText );
+ OUString GetPageText( sal_uInt16 nPageId ) const;
+ XubString GetHelpText( sal_uInt16 nPageId ) const;
+ OString GetHelpId( sal_uInt16 nPageId ) const;
+
+ long GetSplitSize() const { return mnSplitSize; }
+
+ void SetHelpText( const XubString& rText )
+ { Window::SetHelpText( rText ); }
+ XubString GetHelpText() const
+ { return Window::GetHelpText(); };
+ void SetHelpId( const OString& rId )
+ { Window::SetHelpId( rId ); }
+ const OString& GetHelpId() const
+ { return Window::GetHelpId(); }
+
+ void SetStyle( WinBits nStyle );
+ WinBits GetStyle() const { return mnWinStyle; }
+
+ Size CalcWindowSizePixel() const;
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetSplitHdl( const Link& rLink ) { maSplitHdl = rLink; }
+ const Link& GetSplitHdl() const { return maSplitHdl; }
+ void SetActivatePageHdl( const Link& rLink ) { maActivatePageHdl = rLink; }
+ const Link& GetActivatePageHdl() const { return maActivatePageHdl; }
+ void SetDeactivatePageHdl( const Link& rLink ) { maDeactivatePageHdl = rLink; }
+ const Link& GetDeactivatePageHdl() const { return maDeactivatePageHdl; }
+ void SetStartRenamingHdl( const Link& rLink ) { maStartRenamingHdl = rLink; }
+ const Link& GetStartRenamingHdl() const { return maStartRenamingHdl; }
+ void SetAllowRenamingHdl( const Link& rLink ) { maAllowRenamingHdl = rLink; }
+ const Link& GetAllowRenamingHdl() const { return maAllowRenamingHdl; }
+ void SetEndRenamingHdl( const Link& rLink ) { maEndRenamingHdl = rLink; }
+ const Link& GetEndRenamingHdl() const { return maEndRenamingHdl; }
+
+ // accessibility
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+};
+
+#endif // _TABBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/defaultinputhandler.hxx b/include/svtools/table/defaultinputhandler.hxx
new file mode 100644
index 000000000000..021b523f1bda
--- /dev/null
+++ b/include/svtools/table/defaultinputhandler.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 SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
+#define SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
+
+#include "svtools/table/tableinputhandler.hxx"
+#include "svtools/table/tabletypes.hxx"
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ struct DefaultInputHandler_Impl;
+
+ //==================================================================================================================
+ //= DefaultInputHandler
+ //==================================================================================================================
+ class DefaultInputHandler : public ITableInputHandler
+ {
+ private:
+ ::boost::scoped_ptr< DefaultInputHandler_Impl > m_pImpl;
+
+ public:
+ DefaultInputHandler();
+ ~DefaultInputHandler();
+
+ virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt );
+ virtual bool GetFocus ( ITableControl& _rControl );
+ virtual bool LoseFocus ( ITableControl& _rControl );
+ virtual bool RequestHelp ( ITableControl& _rControl, const HelpEvent& rHEvt );
+ virtual bool Command ( ITableControl& _rControl, const CommandEvent& rCEvt );
+ virtual bool PreNotify ( ITableControl& _rControl, NotifyEvent& rNEvt );
+ virtual bool Notify ( ITableControl& _rControl, NotifyEvent& rNEvt );
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/gridtablerenderer.hxx b/include/svtools/table/gridtablerenderer.hxx
new file mode 100644
index 000000000000..21a096268fe1
--- /dev/null
+++ b/include/svtools/table/gridtablerenderer.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 SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
+#define SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
+
+#include <svtools/table/tablemodel.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ struct GridTableRenderer_Impl;
+
+ //====================================================================
+ //= GridTableRenderer
+ //====================================================================
+ /** a default implementation for the ->ITableRenderer interface
+
+ This class is able to paint a table grid, table headers, and cell
+ backgrounds according to the selected/active state of cells.
+ */
+ class GridTableRenderer : public ITableRenderer
+ {
+ private:
+ ::boost::scoped_ptr< GridTableRenderer_Impl > m_pImpl;
+
+ public:
+ /** creates a table renderer associated with the given model
+
+ @param _rModel
+ the model which should be rendered. The caller is responsible
+ for lifetime control, that is, the model instance must live
+ at least as long as the renderer instance lives
+ */
+ GridTableRenderer( ITableModel& _rModel );
+ ~GridTableRenderer();
+
+ /** determines whether or not to paint grid lines
+ */
+ bool useGridLines() const;
+
+ /** controls whether or not to paint grid lines
+ */
+ void useGridLines( bool const i_use );
+
+ public:
+ // ITableRenderer overridables
+ virtual void PaintHeaderArea(
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
+ const StyleSettings& _rStyle );
+ virtual void PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle );
+ virtual void PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rRowArea,
+ const StyleSettings& _rStyle );
+ virtual void PaintRowHeader(
+ bool i_hasControlFocus, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle );
+ virtual void PaintCell( ColPos const i_col,
+ bool i_hasControlFocus, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle );
+ virtual void ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect);
+ virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect);
+ virtual bool FitsIntoCell(
+ ::com::sun::star::uno::Any const & i_cellContent,
+ ColPos const i_colPos, RowPos const i_rowPos,
+ bool const i_active, bool const i_selected,
+ OutputDevice& i_targetDevice, Rectangle const & i_targetArea
+ ) const;
+ virtual bool GetFormattedCellString(
+ ::com::sun::star::uno::Any const & i_cellValue,
+ ColPos const i_colPos, RowPos const i_rowPos,
+ OUString & o_cellString
+ ) const;
+
+ private:
+ struct CellRenderContext;
+
+ void impl_paintCellContent(
+ CellRenderContext const & i_context
+ );
+ void impl_paintCellImage(
+ CellRenderContext const & i_context,
+ Image const & i_image
+ );
+ void impl_paintCellText(
+ CellRenderContext const & i_context,
+ OUString const & i_text
+ );
+ };
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tablecontrol.hxx b/include/svtools/table/tablecontrol.hxx
new file mode 100644
index 000000000000..a170a38a4648
--- /dev/null
+++ b/include/svtools/table/tablecontrol.hxx
@@ -0,0 +1,218 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVTOOLS_INC_TABLE_TABLECONTROL_HXX
+#define SVTOOLS_INC_TABLE_TABLECONTROL_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/accessibletable.hxx"
+#include "svtools/accessiblefactory.hxx"
+
+#include <vcl/ctrl.hxx>
+#include <vcl/seleng.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
+
+//........................................................................
+
+namespace svt { namespace table
+{
+//........................................................................
+
+ class TableControl_Impl;
+
+ //====================================================================
+ //= TableControl
+ //====================================================================
+ /** a basic control which manages table-like data, i.e. a number of cells
+ organized in <code>m</code> rows and <code>n</code> columns.
+
+ The control itself does not do any assumptions about the concrete data
+ it displays, this is encapsulated in an instance supporting the
+ ->ITableModel interface.
+
+ Also, the control does not do any assumptions about how the model's
+ content is rendered. This is the responsibility of a component
+ supporting the ->ITableRenderer interface (the renderer is obtained from
+ the model).
+
+ The control supports the concept of a <em>current</em> (or <em>active</em>
+ cell).
+ The control supports accessibility, this is encapsulated in IAccessibleTable
+ */
+ class SVT_DLLPUBLIC TableControl : public Control, public IAccessibleTable
+ {
+ private:
+ ::boost::shared_ptr< TableControl_Impl > m_pImpl;
+
+
+ public:
+ TableControl( Window* _pParent, WinBits _nStyle );
+ ~TableControl();
+
+ /// sets a new table model
+ void SetModel( PTableModel _pModel );
+ /// retrieves the current table model
+ PTableModel GetModel() const;
+
+ /** retrieves the current row
+
+ The current row is the one which contains the active cell.
+
+ @return
+ the row index of the active cell, or ->ROW_INVALID
+ if there is no active cell, e.g. because the table does
+ not contain any rows or columns.
+ */
+ sal_Int32 GetCurrentRow() const;
+
+ ITableControl&
+ getTableControlInterface();
+
+ /** retrieves the current column
+
+ The current col is the one which contains the active cell.
+
+ @return
+ the column index of the active cell, or ->COL_INVALID
+ if there is no active cell, e.g. because the table does
+ not contain any rows or columns.
+ */
+ sal_Int32 GetCurrentColumn() const;
+
+ /** activates the cell at the given position
+
+ @return
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the move,
+ or impossibility to execute the move at all (for instance because
+ of invalid coordinates).
+ */
+ bool GoTo( ColPos _nColumnPos, RowPos _nRow);
+
+ /** moves the active cell to the given column, by keeping the active row
+
+ @return
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the move,
+ or impossibility to execute the move at all (for instance because
+ of invalid coordinates).
+ */
+ inline bool GoToColumn( ColPos _nColumn )
+ {
+ return GoTo( _nColumn, GetCurrentRow() );
+ }
+
+ /** moves the active cell to the given row, by keeping the active column
+
+ @return
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the move,
+ or impossibility to execute the move at all (for instance because
+ of invalid coordinates).
+ */
+ bool GoToRow( RowPos _nRow )
+ {
+ return GoTo( GetCurrentColumn(), _nRow );
+ }
+
+ SVT_DLLPRIVATE virtual void Resize();
+ virtual void Select();
+
+ /**after removing a row, updates the vector which contains the selected rows
+ if the row, which should be removed, is selected, it will be erased from the vector
+ */
+ SelectionEngine* getSelEngine();
+ Window& getDataWindow();
+
+ // Window overridables
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void StateChanged( StateChangedType i_nStateChange );
+
+ /** Creates and returns the accessible object of the whole GridControl. */
+ SVT_DLLPRIVATE virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible();
+ SVT_DLLPRIVATE virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex );
+ SVT_DLLPRIVATE virtual OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const;
+ SVT_DLLPRIVATE virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow );
+ SVT_DLLPRIVATE virtual OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const;
+ SVT_DLLPRIVATE virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet, AccessibleTableControlObjType eObjType ) const;
+
+ // temporary methods
+ // Those do not really belong into the public API - they're intended for firing A11Y-related events. However,
+ // firing those events should be an implementation internal to the TableControl resp. TableControl_Impl,
+ // instead of something triggered externally.
+ void commitCellEventIfAccessibleAlive( sal_Int16 const i_eventID, const css::uno::Any& i_newValue, const css::uno::Any& i_oldValue );
+ void commitTableEventIfAccessibleAlive( sal_Int16 const i_eventID, const css::uno::Any& i_newValue, const css::uno::Any& i_oldValue );
+
+ // .............................................................................................................
+ // IAccessibleTable
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ virtual void GrabFocus();
+ virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True );
+ virtual Window* GetAccessibleParentWindow() const;
+ virtual Window* GetWindowInstance();
+ virtual sal_Int32 GetAccessibleControlCount() const;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint );
+ virtual long GetRowCount() const;
+ virtual long GetColumnCount() const;
+ virtual sal_Bool HasRowHeader() const;
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint );
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle calcHeaderCellRect( sal_Bool _bIsColumnBar, sal_Int32 nPos);
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos );
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const;
+ virtual OUString GetRowDescription( sal_Int32 _nRow ) const;
+ virtual OUString GetRowName(sal_Int32 _nIndex) const;
+ virtual OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const;
+ virtual OUString GetColumnName( sal_Int32 _nIndex ) const;
+ virtual css::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+ virtual sal_Bool HasRowHeader();
+ virtual sal_Bool HasColHeader();
+ virtual OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const;
+ virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const;
+ virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select );
+ virtual void SelectAllRows( bool const i_select );
+ // .............................................................................................................
+
+ private:
+ DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
+
+ private:
+ TableControl(); // never implemented
+ TableControl( const TableControl& ); // never implemented
+ TableControl& operator=( const TableControl& ); // never implemented
+ };
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLECONTROL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tablecontrolinterface.hxx b/include/svtools/table/tablecontrolinterface.hxx
new file mode 100644
index 000000000000..a95cc282985c
--- /dev/null
+++ b/include/svtools/table/tablecontrolinterface.hxx
@@ -0,0 +1,257 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+#define SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+
+#include <sal/types.h>
+#include <vcl/event.hxx>
+#include <vcl/seleng.hxx>
+
+#include "svtools/table/tabletypes.hxx"
+#include "svtools/table/tablemodel.hxx"
+
+class Pointer;
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= TableControlAction
+ //==================================================================================================================
+ enum TableControlAction
+ {
+ /// moves the cursor in the table control one row up, if possible, by keeping the current column
+ cursorUp,
+ /// moves the cursor in the table control one row down, if possible, by keeping the current column
+ cursorDown,
+ /// moves the cursor in the table control one column to the left, if possible, by keeping the current row
+ cursorLeft,
+ /// moves the cursor in the table control one column to the right, if possible, by keeping the current row
+ cursorRight,
+ /// moves the cursor to the beginning of the current line
+ cursorToLineStart,
+ /// moves the cursor to the end of the current line
+ cursorToLineEnd,
+ /// moves the cursor to the first row, keeping the current column
+ cursorToFirstLine,
+ /// moves the cursor to the last row, keeping the current column
+ cursorToLastLine,
+ /// moves the cursor one page up, keeping the current column
+ cursorPageUp,
+ /// moves the cursor one page down, keeping the current column
+ cursorPageDown,
+ /// moves the cursor to the top-most, left-most cell
+ cursorTopLeft,
+ /// moves the cursor to the bottom-most, right-most cell
+ cursorBottomRight,
+ /// selects the row, where the actual cursor is
+ cursorSelectRow,
+ /// selects the rows, above the actual cursor is
+ cursorSelectRowUp,
+ /// selects the row, beneath the actual cursor is
+ cursorSelectRowDown,
+ /// selects the row, from the actual cursor till top
+ cursorSelectRowAreaTop,
+ /// selects the row, from the actual cursor till bottom
+ cursorSelectRowAreaBottom,
+
+ /// invalid and final enumeration value, not to be actually used
+ invalidTableControlAction
+ };
+
+ //==================================================================================================================
+ //= TableCellArea
+ //==================================================================================================================
+ enum TableCellArea
+ {
+ CellContent,
+ ColumnDivider
+ };
+
+ //==================================================================================================================
+ //= TableCell
+ //==================================================================================================================
+ struct TableCell
+ {
+ ColPos nColumn;
+ RowPos nRow;
+ TableCellArea eArea;
+
+ TableCell()
+ :nColumn( COL_INVALID )
+ ,nRow( ROW_INVALID )
+ ,eArea( CellContent )
+ {
+ }
+
+ TableCell( ColPos const i_column, RowPos const i_row )
+ :nColumn( i_column )
+ ,nRow( i_row )
+ ,eArea( CellContent )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= ColumnMetrics
+ //==================================================================================================================
+ struct ColumnMetrics
+ {
+ /** the start of the column, in pixels. Might be negative, in case the column is scrolled out of the visible
+ area. Note: see below.
+ */
+ long nStartPixel;
+
+ /** the end of the column, in pixels, plus 1. Effectively, this is the accumulated width of a all columns
+ up to the current one.
+
+ Huh? Earlier you said that the nStartPixel of columns
+ scrolled out (to the left) of the visible area is
+ negative. Also, where is the promise that there is no gap
+ between columns? The above claim would be true only if the
+ first column always started at zero, and there is never a
+ gap. So these doc comments are inconsistent. How
+ surprising.
+ */
+ long nEndPixel;
+
+ ColumnMetrics()
+ :nStartPixel(0)
+ ,nEndPixel(0)
+ {
+ }
+
+ ColumnMetrics( long const i_start, long const i_end )
+ :nStartPixel( i_start )
+ ,nEndPixel( i_end )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= TableArea
+ //==================================================================================================================
+ enum TableArea
+ {
+ TableAreaColumnHeaders,
+ TableAreaRowHeaders,
+ TableAreaDataArea,
+ TableAreaAll
+ };
+
+ //==================================================================================================================
+ //= ITableControl
+ //==================================================================================================================
+ /** defines a callback interface to be implemented by a concrete table control
+ */
+ class SAL_NO_VTABLE ITableControl
+ {
+ public:
+ /** hides the cell cursor
+
+ The method cares for successive calls, that is, for every call to
+ ->hideCursor(), you need one call to ->showCursor. Only if the number
+ of both calls matches, the cursor is really shown.
+
+ @see showCursor
+ */
+ virtual void hideCursor() = 0;
+
+ /** shows the cell cursor
+
+ @see hideCursor
+ */
+ virtual void showCursor() = 0;
+
+ /** dispatches an action to the table control
+
+ @return
+ <TRUE/> if the action could be dispatched successfully, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the action, or impossibility
+ to execute the action at all (for instance moving up one row when already positioned
+ on the very first row).
+
+ @see TableControlAction
+ */
+ virtual bool dispatchAction( TableControlAction _eAction ) = 0;
+
+ /** returns selection engine*/
+ virtual SelectionEngine* getSelEngine() = 0;
+
+ /** returns the table model
+
+ The returned model is guaranteed to not be <NULL/>.
+ */
+ virtual PTableModel getModel() const = 0;
+
+ /// returns the index of the currently active column
+ virtual ColPos getCurrentColumn() const = 0;
+
+ /// returns the index of the currently active row
+ virtual RowPos getCurrentRow() const = 0;
+
+ /// activates the given cell
+ virtual bool activateCell( ColPos const i_col, RowPos const i_row ) = 0;
+
+ /// retrieves the size of the table window, in pixels
+ virtual ::Size getTableSizePixel() const = 0;
+
+ /// sets a new mouse pointer for the table window
+ virtual void setPointer( Pointer const & i_pointer ) = 0;
+
+ /// captures the mouse to the table window
+ virtual void captureMouse() = 0;
+
+ /// releases the mouse, after it had previously been captured
+ virtual void releaseMouse() = 0;
+
+ /// invalidates the table window
+ virtual void invalidate( TableArea const i_what ) = 0;
+
+ /// calculates a width, given in pixels, into a AppFont-based width
+ virtual long pixelWidthToAppFont( long const i_pixels ) const = 0;
+
+ /// shows a trackign rectangle
+ virtual void showTracking( Rectangle const & i_location, sal_uInt16 const i_flags ) = 0;
+
+ /// hides a prviously shown tracking rectangle
+ virtual void hideTracking() = 0;
+
+ /// does a hit test for the given pixel coordinates
+ virtual TableCell hitTest( const Point& rPoint ) const = 0;
+
+ /// retrieves the metrics for a given column
+ virtual ColumnMetrics getColumnMetrics( ColPos const i_column ) const = 0;
+
+ /// determines whether a given row is selected
+ virtual bool isRowSelected( RowPos _nRow ) const = 0;
+
+ virtual ~ITableControl() {};
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tableinputhandler.hxx b/include/svtools/table/tableinputhandler.hxx
new file mode 100644
index 000000000000..2158d573bb2d
--- /dev/null
+++ b/include/svtools/table/tableinputhandler.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 SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
+#define SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
+
+#include <boost/shared_ptr.hpp>
+
+class MouseEvent;
+class KeyEvent;
+class HelpEvent;
+class CommandEvent;
+class NotifyEvent;
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ class ITableControl;
+
+ //====================================================================
+ //= ITableInputHandler
+ //====================================================================
+ /** interface for components handling input in a ->TableControl
+ */
+ class ITableInputHandler
+ {
+ public:
+ // all those methods have the same semantics as the equal-named methods of ->Window,
+ // with the additional option to return a boolean value indicating whether
+ // the event should be further processed by the ->Window implementations (<FALSE/>),
+ // or whether it has been sufficiently handled by the ->ITableInputHandler instance
+ // (<FALSE/>).
+
+ virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt ) = 0;
+ virtual bool GetFocus ( ITableControl& _rControl ) = 0;
+ virtual bool LoseFocus ( ITableControl& _rControl ) = 0;
+ virtual bool RequestHelp ( ITableControl& _rControl, const HelpEvent& rHEvt ) = 0;
+ virtual bool Command ( ITableControl& _rControl, const CommandEvent& rCEvt ) = 0;
+ virtual bool PreNotify ( ITableControl& _rControl, NotifyEvent& rNEvt ) = 0;
+ virtual bool Notify ( ITableControl& _rControl, NotifyEvent& rNEvt ) = 0;
+
+ virtual ~ITableInputHandler() { }
+ };
+ typedef ::boost::shared_ptr< ITableInputHandler > PTableInputHandler;
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tablemodel.hxx b/include/svtools/table/tablemodel.hxx
new file mode 100644
index 000000000000..cae54efb0ef0
--- /dev/null
+++ b/include/svtools/table/tablemodel.hxx
@@ -0,0 +1,539 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVTOOLS_INC_TABLE_TABLEMODEL_HXX
+#define SVTOOLS_INC_TABLE_TABLEMODEL_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/table/tabletypes.hxx"
+#include "svtools/table/tablerenderer.hxx"
+#include "svtools/table/tableinputhandler.hxx"
+#include "svtools/table/tablesort.hxx"
+
+#include <com/sun/star/util/Color.hpp>
+#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <com/sun/star/style/HorizontalAlignment.hpp>
+
+#include <rtl/ref.hxx>
+#include <sal/types.h>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include <boost/enable_shared_from_this.hpp>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+
+ //====================================================================
+ //= ScrollbarVisibility
+ //====================================================================
+ enum ScrollbarVisibility
+ {
+ /** enumeration value denoting that a scrollbar should never be visible, even
+ if needed normally
+ */
+ ScrollbarShowNever,
+ /** enumeration value denoting that a scrollbar should be visible when needed only
+ */
+ ScrollbarShowSmart,
+ /** enumeration value denoting that a scrollbar should always be visible, even
+ if not needed normally
+ */
+ ScrollbarShowAlways
+ };
+
+ //====================================================================
+ //= ITableModelListener
+ //====================================================================
+ typedef sal_Int32 ColumnAttributeGroup;
+ #define COL_ATTRS_NONE (0x00000000)
+ /// denotes column attributes related to the width of the column
+ #define COL_ATTRS_WIDTH (0x00000001)
+ /// denotes column attributes related to the appearance of the column, i.e. those relevant for rendering
+ #define COL_ATTRS_APPEARANCE (0x00000002)
+ /// denotes the entirety of column attributes
+ #define COL_ATTRS_ALL (0x7FFFFFFF)
+
+ //====================================================================
+ //= ITableModelListener
+ //====================================================================
+ /** declares an interface to be implemented by components interested in
+ changes in an ->ITableModel
+ */
+ class SAL_NO_VTABLE ITableModelListener : public ::boost::enable_shared_from_this< ITableModelListener >
+ {
+ public:
+ /** notifies the listener that one or more rows have been inserted into
+ the table
+
+ @param first
+ the index of the first newly inserted row
+ @param last
+ the index of the last newly inserted row. Must not be smaller
+ than ->first
+ */
+ virtual void rowsInserted( RowPos first, RowPos last ) = 0;
+
+ /** notifies the listener that one or more rows have been removed from
+ the table
+
+ @param first
+ the old index of the first removed row. If this is <code>-1</code>, then all
+ rows have been removed from the model.
+ @param last
+ the old index of the last removed row. Must not be smaller
+ than ->first
+ */
+ virtual void rowsRemoved( RowPos first, RowPos last ) = 0;
+
+ /** notifies the listener that one or more columns have been inserted into
+ the table
+
+ @param first
+ the index of the first newly inserted row
+ @param last
+ the index of the last newly inserted row. Must not be smaller
+ than ->first
+ */
+ virtual void columnInserted( ColPos const i_colIndex ) = 0;
+
+ /** notifies the listener that one or more columns have been removed from
+ the table
+
+ @param i_colIndex
+ the old index of the removed column
+ */
+ virtual void columnRemoved( ColPos const i_colIndex ) = 0;
+
+ /** notifies the listener that all columns have been removed form the model
+ */
+ virtual void allColumnsRemoved() = 0;
+
+ /** notifies the listener that a rectangular cell range in the table
+ has been updated
+
+ Listeners are required to discard any possibly cached information
+ they have about the cells in question, in particular any possibly
+ cached cell values.
+ */
+ virtual void cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow ) = 0;
+
+ /** notifies the listener that attributes of a given column changed
+
+ @param i_column
+ the position of the column whose attributes changed
+ @param i_attributeGroup
+ a combination of one or more <code>COL_ATTRS_*</code> flags, denoting the attribute group(s)
+ in which changes occurred.
+ */
+ virtual void columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup ) = 0;
+
+ /** notifies the listener that the metrics of the table changed.
+
+ Metrics here include the column header height, the row header width, the row height, and the presence
+ of both the row and column header.
+ */
+ virtual void tableMetricsChanged() = 0;
+
+ /// deletes the listener instance
+ virtual ~ITableModelListener(){};
+ };
+ typedef ::boost::shared_ptr< ITableModelListener > PTableModelListener;
+
+ //====================================================================
+ //= IColumnModel
+ //====================================================================
+ /** interface to be implemented by table column models
+ */
+ class SAL_NO_VTABLE IColumnModel
+ {
+ public:
+ /** retrieves the ID of the column
+
+ The semantics of a column id is not defined. It's up to the
+ implementor of the ->IColumnModel, respectively the ->ITableModel
+ which provides the column models, to define such a semantics.
+
+ @return
+ the ID of the column. May be 0 if the table which the column
+ belongs to does not need and support column ids.
+
+ @see setID
+ */
+ virtual ::com::sun::star::uno::Any
+ getID() const = 0;
+
+ /** sets a new column ID
+
+ @return
+ <TRUE/> if setting the new ID was successful. A possible error
+ conditions is if you try to set an ID which is already used
+ by another column within the same table.
+
+ @see getID
+ */
+ virtual void setID( const ::com::sun::star::uno::Any& _nID ) = 0;
+
+ /** returns the name of the column
+
+ Column names should be human-readable, but not necessarily unique
+ within a given table.
+
+ @see setName
+ */
+ virtual String getName() const = 0;
+
+ /** sets a new name for the column
+
+ @see getName
+ */
+ virtual void setName( const String& _rName ) = 0;
+
+ /** retrieves the help text to be displayed for the column.
+ */
+ virtual String getHelpText() const = 0;
+
+ /** sets a new the help text to be displayed for the column.
+ */
+ virtual void setHelpText( const String& i_helpText ) = 0;
+
+ /** determines whether the column can be interactively resized
+
+ @see getMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual bool isResizable() const = 0;
+
+ /** declares the column as resizable or fixed in width
+
+ @see getMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual void setResizable( bool _bResizable ) = 0;
+
+ /** denotes the relative flexibility of the column
+
+ This flexibility is taken into account when a table control auto-resizes its columns, because the available
+ space changed. In this case, the columns grow or shrink according to their flexibility.
+
+ A value of 0 means the column is not auto-resized at all.
+ */
+ virtual sal_Int32 getFlexibility() const = 0;
+
+ /** sets a new flexibility value for the column
+
+ @see getFlexibility
+ */
+ virtual void setFlexibility( sal_Int32 const i_flexibility ) = 0;
+
+ /** returns the width of the column, in app-font unitss
+
+ The returned value must be a positive ->TableMetrics value.
+
+ @see setWidth
+ @see getMinWidth
+ @see getMaxWidth
+ */
+ virtual TableMetrics getWidth() const = 0;
+
+ /** sets a new width for the column
+
+ @param _nWidth
+ the new width, app-font units
+
+ @see getWidth
+ */
+ virtual void setWidth( TableMetrics _nWidth ) = 0;
+
+ /** returns the minimum width of the column, in app-font units, or 0 if the column
+ does not have a minimal width
+
+ @see setMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual TableMetrics getMinWidth() const = 0;
+
+ /** sets the minimum width of the column, in app-font units
+
+ @see getMinWidth
+ @see setMaxWidth
+ @see setWidth
+ */
+ virtual void setMinWidth( TableMetrics _nMinWidth ) = 0;
+
+ /** returns the maximum width of the column, in app-font units, or 0 if the column
+ does not have a minimal width
+
+ @see setMaxWidth
+ @see getMinWidth
+ @see getWidth
+ */
+ virtual TableMetrics getMaxWidth() const = 0;
+
+ /** sets the maximum width of the column, in app-font units
+
+ @see getMaxWidth
+ @see setMinWidth
+ @see setWidth
+ */
+ virtual void setMaxWidth( TableMetrics _nMaxWidth ) = 0;
+
+ /** retrieves the horizontal alignment to be used for content in this cell
+ */
+ virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign() = 0;
+
+ /** sets a new the horizontal alignment to be used for content in this cell
+ */
+ virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign) = 0;
+
+ /// deletes the column model instance
+ virtual ~IColumnModel() { }
+ };
+ typedef ::boost::shared_ptr< IColumnModel > PColumnModel;
+
+ //====================================================================
+ //= ITableModel
+ //====================================================================
+ /** declares the interface to implement by an abtract table model
+ */
+ class SAL_NO_VTABLE SVT_DLLPUBLIC ITableModel
+ {
+ public:
+ /** returns the number of columns in the table
+ */
+ virtual TableSize getColumnCount() const = 0;
+
+ /** returns the number of rows in the table
+ */
+ virtual TableSize getRowCount() const = 0;
+
+ /** determines whether the table has column headers
+
+ If this method returns <TRUE/>, the renderer returned by
+ ->getRenderer must be able to render column headers.
+
+ @see IColumnRenderer
+ */
+ virtual bool hasColumnHeaders() const = 0;
+
+ /** determines whether the table has row headers
+
+ If this method returns <TRUE/>, the renderer returned by
+ ->getRenderer must be able to render row headers.
+
+ @see IColumnRenderer
+ */
+ virtual bool hasRowHeaders() const = 0;
+
+ /** determines whether the given cell is editable
+
+ @see ICellEditor
+ @todo
+ */
+ virtual bool isCellEditable( ColPos col, RowPos row ) const = 0;
+
+ /** returns a model for a certain column
+
+ @param column
+ the index of the column in question. Must be greater than or
+ equal 0, and smaller than the return value of ->getColumnCount()
+
+ @return
+ the model of the column in question. Must not be <NULL/>
+ */
+ virtual PColumnModel getColumnModel( ColPos column ) = 0;
+
+ /** returns a renderer which is able to paint the table represented
+ by this table model
+
+ @return the renderer to use. Must not be <NULL/>
+ */
+ virtual PTableRenderer getRenderer() const = 0;
+
+ /** returns the component handling input in a view associated with the model
+ */
+ virtual PTableInputHandler getInputHandler() const = 0;
+
+ /** determines the height of rows in the table.
+
+ @return
+ the logical height of rows in the table, in app-font units. The height must be
+ greater 0.
+ */
+ virtual TableMetrics getRowHeight() const = 0;
+
+ /** determines the height of the column header row
+
+ This method is not to be called if ->hasColumnHeaders()
+ returned <FALSE/>.
+
+ @return
+ the logical height of the column header row, in app-font units.
+ Must be greater than 0.
+ */
+ virtual TableMetrics getColumnHeaderHeight() const = 0;
+
+ /** determines the width of the row header column
+
+ This method is not to be called if ->hasRowHeaders()
+ returned <FALSE/>.
+
+ @return
+ the logical width of the row header column, in app-font units.
+ Must be greater than 0.
+ */
+ virtual TableMetrics getRowHeaderWidth() const = 0;
+
+ /** returns the visibilit mode of the vertical scrollbar
+ */
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility() const = 0;
+
+ /** returns the visibilit mode of the horizontal scrollbar
+ */
+ virtual ScrollbarVisibility getHorizontalScrollbarVisibility() const = 0;
+
+ /** adds a listener to be notified of changes in the table model
+ */
+ virtual void addTableModelListener( const PTableModelListener& i_listener ) = 0;
+
+ /** remove a listener to be notified of changes in the table model
+ */
+ virtual void removeTableModelListener( const PTableModelListener& i_listener ) = 0;
+
+ /** retrieves the content of the given cell
+ */
+ virtual void getCellContent( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any& o_cellContent ) = 0;
+
+ /** returns an object which should be displayed as tooltip for the given cell
+
+ At the moment, only string-convertible values are supported here. In the future, one might imagine displaying
+ scaled-down versions of a graphic in a cell, and a larger version of that very graphic as tooltip.
+
+ If no tooltip object is provided, then the cell content is used, and displayed as tooltip for the cell
+ if and only if it doesn't fit into the cell's space itself.
+
+ @param i_col
+ The column index of the cell in question. COL_ROW_HEADERS is a valid argument here.
+ @param i_row
+ The row index of the cell in question.
+ @param o_cellToolTip
+ takes the tooltip object upon return.
+ */
+ virtual void getCellToolTip( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any & o_cellToolTip ) = 0;
+
+ /** retrieves title of a given row
+ */
+ virtual ::com::sun::star::uno::Any getRowHeading( RowPos const i_rowPos ) const = 0;
+
+ /** returns the color to be used for rendering the grid lines.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getLineColor() const = 0;
+
+ /** returns the color to be used for rendering the header background.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getHeaderBackgroundColor() const = 0;
+
+ /** returns the color to be used for rendering the header text.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getHeaderTextColor() const = 0;
+
+ /** returns the color to be used for the background of selected cells, when the control has the focus
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getActiveSelectionBackColor() const = 0;
+
+ /** returns the color to be used for the background of selected cells, when the control does not have the focus
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getInactiveSelectionBackColor() const = 0;
+
+ /** returns the color to be used for the text of selected cells, when the control has the focus
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getActiveSelectionTextColor() const = 0;
+
+ /** returns the color to be used for the text of selected cells, when the control does not have the focus
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getInactiveSelectionTextColor() const = 0;
+
+ /** returns the color to be used for rendering cell texts.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getTextColor() const = 0;
+
+ /** returns the color to be used for text lines (underline, strikethrough) when rendering cell text.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getTextLineColor() const = 0;
+
+ /** returns the colors to be used for the row backgrounds.
+
+ If this value is not set, every second row will have a background color derived from the style settings's
+ selection color, the other rows will not have a special background at all.
+
+ If this value is an empty sequence, the rows will not have a special background at all, instead the
+ normal background of the complete control will be used.
+
+ If value is a non-empty sequence, then rows will have the background colors as specified in the sequence,
+ in alternating order.
+ */
+ virtual ::boost::optional< ::std::vector< ::Color > >
+ getRowBackgroundColors() const = 0;
+
+ /** determines the vertical alignment of content within a cell
+ */
+ virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign() const = 0;
+
+ /** returns an adapter to the sorting functionality of the model
+
+ It is legitimate to return <NULL/> here, in this case, the table model does not support sorting.
+ */
+ virtual ITableDataSort* getSortAdapter() = 0;
+
+ /// destroys the table model instance
+ virtual ~ITableModel() { }
+ };
+ typedef ::boost::shared_ptr< ITableModel > PTableModel;
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLEMODEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tablerenderer.hxx b/include/svtools/table/tablerenderer.hxx
new file mode 100644
index 000000000000..05ee87571c4c
--- /dev/null
+++ b/include/svtools/table/tablerenderer.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 SVTOOLS_INC_TABLE_TABLERENDERER_HXX
+#define SVTOOLS_INC_TABLE_TABLERENDERER_HXX
+
+#include <svtools/table/tabletypes.hxx>
+
+#include <vcl/outdev.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ //====================================================================
+ //= ITableRenderer
+ //====================================================================
+ /** interface to implement by components rendering a ->TableControl
+ */
+ class SAL_NO_VTABLE ITableRenderer
+ {
+ public:
+
+ /** paints a (part of) header area
+
+ There are two header areas in a table control:
+ <ul><li>The row containing all column headers, i.e. <em>above</em> all rows containing the data</li>
+ <li>The column containing all row headers. i.e. <em>left of</em> all columns containing the data</li>
+ </ul>
+
+ A header area is more than the union of the single column/row headers.
+
+ First, there might be less columns than fit into the view - in this case, right
+ beside the right-most column, there's still room which belongs to the column header
+ area, but is not occupied by any particular column header.<br/>
+ An equivalent statement holds for the row header area, if there are less rows than
+ fit into the view.
+
+ Second, if the table control has both a row header and a column header,
+ the intersection between those both belongs to both the column header area and the
+ row header area, but not to any particular column or row header.
+
+ There are two flags specifying whether the to-be-painted area is part of the column
+ and/or row header area.
+ <ul><li>If both are <TRUE/>, the intersection of both areas is to be painted.</li>
+ <li>If ->_bIsColHeaderArea is <TRUE/> and ->_bIsRowHeaderArea is <FALSE/>,
+ then ->_rArea denotes the column header area <em>excluding</em> the
+ intersection between row and column header area.</li>
+ <li>Equivalently for ->_bIsColHeaderArea being <FALSE/> and ->_bIsRowHeaderArea
+ being <TRUE/></li>
+ </ul>
+ Note that it's not possible for both ->_bIsColHeaderArea and ->_bIsRowHeaderArea
+ to be <FALSE/> at the same time.
+
+ @param _rDevice
+ the device to paint onto
+ @param _rArea
+ the area to paint into
+ @param _bIsColHeaderArea
+ <TRUE/> if and only if ->_rArea is part of the column header area.
+ @param _bIsRowHeaderArea
+ <TRUE/> if and only if ->_rArea is part of the row header area.
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintHeaderArea(
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** paints the header for a given column
+
+ @param _nCol
+ the index of the column to paint
+ @param _bActive
+ <TRUE/> if and only if the column whose column is to be painted
+ contains the active cell.
+ @param _bSelected
+ <TRUE/> if and only if the column whose column is to be painted
+ is selected currently.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the column header should be painted
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** prepares a row for painting
+
+ Painting a table means painting rows as necessary, in an increasing
+ order. The assumption is that retrieving data for two different rows
+ is (potentially) more expensive than retrieving data for two different
+ columns. Thus, the renderer will get the chance to "seek" to a certain
+ row, and then has to render all cells in this row, before another
+ row is going to be painted.
+
+ @param _nRow
+ the row which is going to be painted. The renderer should
+ at least remember this row, since subsequent calls to
+ ->PaintRowHeader(), ->PaintCell(), and ->FinishRow() will
+ not pass this parameter again.
+
+ However, the renderer is also allowed to render any
+ cell-independent content of this row.
+
+ @param i_hasControlFocus
+ <TRUE/> if and only if the table control currently has the focus
+ @param _bSelected
+ <TRUE/> if and only if the row to be prepared is
+ selected currently.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rRowArea
+ the are into which the row should be painted. This excludes
+ the row header area, if applicable.
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rRowArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** paints the header of a row
+
+ The row to be painted is denoted by the most recent call to
+ ->PrepareRow.
+
+ @param i_hasControlFocus
+ <TRUE/> if and only if the table control currently has the focus
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _bSelected
+ <TRUE/> if and only if the row whose header cell is to be
+ painted is selected currently.
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the row header should be painted
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintRowHeader( bool i_hasControlFocus, bool _bSelected,
+ OutputDevice& _rDevice, Rectangle const & _rArea,
+ StyleSettings const & _rStyle ) = 0;
+
+ /** paints a certain cell
+
+ The row to be painted is denoted by the most recent call to
+ ->PrepareRow.
+
+ @param _bSelected
+ <TRUE/> if and only if the cell to be painted is
+ selected currently. This is the case if either
+ the row or the column of the cell is currently selected.
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param i_hasControlFocus
+ <TRUE/> if and only if the table control currently has the focus
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the cell should be painted
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintCell( ColPos const i_col,
+ bool i_hasControlFocus, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** draws a cell cursor in the given rectangle
+
+ The cell cursor is used to indicate the active/current cell
+ of a table control.
+ */
+ virtual void ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect) = 0;
+
+ /** hides the cell cursor previously drawn into the given rectangle
+
+ The cell cursor is used to indicate the active/current cell
+ of a table control.
+ */
+ virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect) = 0;
+
+ /** checks whether a given cell content fits into a given target area on a given device.
+
+ @param i_colPos
+ denotes the column which the cell content would be painted into. Your renderer implementation
+ would only need this parameter if rendering is done differently for different columns.
+
+ @param i_rowPos
+ denotes the row which the cell content would be painted into. Your renderer implementation
+ would only need this parameter if rendering is done differently for different rows.
+
+ @param i_active
+ is <TRUE/> if and only if the renderer should assume the cell content would be painted for the active
+ cell.
+
+ @param i_selected
+ is <TRUE/> if and only if the renderer should assume the cell content would be painted for a selected
+ cell.
+
+ @param i_targetDevice
+ denotes the target device for the assumed rendering operation
+
+ @param i_targetArea
+ denotes the area within the target device for the assumed rendering operation.
+
+ @return
+ <TRUE/> if and only if the given cell content could be rendered into the given device and the
+ given area.
+ */
+ virtual bool FitsIntoCell(
+ ::com::sun::star::uno::Any const & i_cellContent,
+ ColPos const i_colPos, RowPos const i_rowPos,
+ bool const i_active, bool const i_selected,
+ OutputDevice& i_targetDevice, Rectangle const & i_targetArea
+ ) const = 0;
+
+ /** attempts to format the content of the given cell as string
+
+ @param i_cellValue
+ the value for which an attempt for a string conversion should be made
+ @param i_colPos
+ the column position of the cell in question
+ @param i_rowPos
+ the row position of the cell in question
+ @param o_cellString
+ the cell content, formatted as string
+ @return
+ <TRUE/> if and only if the content could be formatted as string
+ */
+ virtual bool GetFormattedCellString(
+ ::com::sun::star::uno::Any const & i_cellValue,
+ ColPos const i_colPos, RowPos const i_rowPos,
+ OUString & o_cellString
+ ) const = 0;
+
+ /// deletes the renderer instance
+ virtual ~ITableRenderer() { }
+ };
+ typedef ::boost::shared_ptr< ITableRenderer > PTableRenderer;
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLERENDERER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tablesort.hxx b/include/svtools/table/tablesort.hxx
new file mode 100644
index 000000000000..072e088cb3ee
--- /dev/null
+++ b/include/svtools/table/tablesort.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 SVTOOLS_TABLESORT_HXX
+#define SVTOOLS_TABLESORT_HXX
+
+#include "svtools/table/tabletypes.hxx"
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ColumnSortDirection
+ //==================================================================================================================
+ enum ColumnSortDirection
+ {
+ ColumnSortAscending,
+ ColumnSortDescending
+ };
+
+ //==================================================================================================================
+ //= ColumnSort
+ //==================================================================================================================
+ struct ColumnSort
+ {
+ ColPos nColumnPos;
+ ColumnSortDirection eSortDirection;
+
+ ColumnSort()
+ :nColumnPos( COL_INVALID )
+ ,eSortDirection( ColumnSortAscending )
+ {
+ }
+
+ ColumnSort( ColPos const i_columnPos, ColumnSortDirection const i_sortDirection )
+ :nColumnPos( i_columnPos )
+ ,eSortDirection( i_sortDirection )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= ITableDataSort
+ //==================================================================================================================
+ /** provides sorting functionality for the datta underlying an ITableModel
+ */
+ class SAL_NO_VTABLE ITableDataSort
+ {
+ public:
+ /** sorts the rows in the model by the given column's data, in the given direction.
+ */
+ virtual void sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection ) = 0;
+
+ /** retrieves the current sort order of the data
+
+ If the <code>nColumnIndex</code> member of the returned srtructure is <code>COL_INVALID</code>, then
+ the data is currently not sorted.
+ */
+ virtual ColumnSort getCurrentSortOrder() const = 0;
+
+ protected:
+ ~ITableDataSort() {}
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_TABLESORT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tabletypes.hxx b/include/svtools/table/tabletypes.hxx
new file mode 100644
index 000000000000..f0333a9a49d7
--- /dev/null
+++ b/include/svtools/table/tabletypes.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 SVTOOLS_INC_TABLE_TABLETYPES_HXX
+#define SVTOOLS_INC_TABLE_TABLETYPES_HXX
+
+#include <sal/types.h>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+ /// a value denoting the size of a table
+ typedef sal_Int32 TableSize;
+
+ /// a value denoting a column position within a table
+ typedef sal_Int32 ColPos;
+ /// a value denoting a row position within a table
+ typedef sal_Int32 RowPos;
+
+ /** a value denoting an arbitrary coordinate value of a position within
+ a table
+
+ Values of this type are guaranteed to be large enough to hold column
+ positions as well as row positions.
+ */
+ typedef sal_Int32 AnyPos;
+
+ typedef sal_Int32 TableMetrics;
+
+/// denotes the column containing the row headers
+#define COL_ROW_HEADERS ((::svt::table::ColPos)-1)
+/// denotes the row containing the column headers
+#define ROW_COL_HEADERS ((::svt::table::RowPos)-1)
+
+/// denotes an invalid column index
+#define COL_INVALID ((::svt::table::ColPos)-2)
+/// denotes an invalid row index
+#define ROW_INVALID ((::svt::table::RowPos)-2)
+
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLETYPES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/templatefoldercache.hxx b/include/svtools/templatefoldercache.hxx
new file mode 100644
index 000000000000..9000c3e8d7db
--- /dev/null
+++ b/include/svtools/templatefoldercache.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 SFX2_TEMPLATEFOLDERCACHE_HXX
+#define SFX2_TEMPLATEFOLDERCACHE_HXX
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=====================================================================
+ //= TemplateFolderCache
+ //=====================================================================
+ class TemplateFolderCacheImpl;
+ /** allows to cache the state of the template directories of OOo
+ <p>Usually, this class is used together with an instance of a the
+ <service scope="com.sun.star.frame">DocumentTemplates</service> service. It allows to scan the template folders
+ of the Office, and updates the configuration so that it reflects the most recent state of the folders.<br/>
+ As this is an expensive, the TemplateFolderCache has been introduced. It caches the state of the template
+ folders, and allows to determine if the DocumentTemplates service needs to be invoked to do the (much more expensive)
+ update.</p>
+ @example C++
+ <listing>
+ TemplateFolderCache aTemplateFolders;
+ if ( aTemplateFolders.needsUpdate() )
+ {
+ // store the current state
+ aCache.storeState();
+
+ // create the DocumentTemplates instance
+ Reference< XDocumentTemplates > xTemplates = ...;
+
+ // update the templates configuration
+ xTemplates->update();
+ }
+
+ // do anything which relies on a up-to-date template configuration
+ </listing>
+ */
+ class SVT_DLLPUBLIC TemplateFolderCache
+ {
+ private:
+ TemplateFolderCacheImpl* m_pImpl;
+
+ public:
+ /** ctor.
+ @param _bAutoStoreState
+ Set this to <TRUE/> if you want the instance to automatically store the state of the template folders upon
+ destruction.<br/>
+ If set to <FALSE/>, you would epplicitly need to call <method>storeState</method> to do this.<br/>
+ If the current state is not known (e.g. because you did not call needsUpdate, which retrieves it),
+ it is not retrieved in the dtor, regardless of the <arg>_bAutoStoreState</arg> flag.
+ */
+ TemplateFolderCache( sal_Bool _bAutoStoreState = sal_False );
+ ~TemplateFolderCache( );
+
+ /** determines whether or not the template configuration needs to be updated
+ @param _bForceCheck
+ set this to <TRUE/> if you want the object to rescan the template folders in every case. The default (<FALSE/>)
+ means that once the information has been retrieved in a first call, every second call returns the same result
+ as the first one, even if in the meantime the template folders changed.
+ @return
+ <TRUE/> if the template configuration needs to be updated
+ */
+ sal_Bool needsUpdate( sal_Bool _bForceCheck = sal_False );
+
+ /** stores the current state of the template folders in the cache
+ @param _bForceRetrieval
+ if set to <TRUE/>, the current state of the template folders is retrieved again, even if it is already known.
+ Usually, you set this to <FALSE/>: After calling <method>needsUpdate</method>, the state is know and does not
+ need to be read again.
+ */
+ void storeState( sal_Bool _bForceRetrieval = sal_False );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // SFX2_TEMPLATEFOLDERCACHE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/templdlg.hxx b/include/svtools/templdlg.hxx
new file mode 100644
index 000000000000..d8eeaa884845
--- /dev/null
+++ b/include/svtools/templdlg.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVTOOLS_TEMPLDLG_HXX
+#define _SVTOOLS_TEMPLDLG_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/fixedhyper.hxx>
+
+struct SvtTmplDlg_Impl;
+
+// class SvtDocumentTemplateDialog ---------------------------------------
+
+class SvtTemplateWindow;
+
+class SVT_DLLPUBLIC SvtDocumentTemplateDialog : public ModalDialog
+{
+private:
+ FixedHyperlink aMoreTemplatesLink;
+ FixedLine aLine;
+ PushButton aManageBtn;
+ PushButton aPackageBtn;
+ PushButton aEditBtn;
+ OKButton aOKBtn;
+ CancelButton aCancelBtn;
+ HelpButton aHelpBtn;
+
+ SvtTmplDlg_Impl* pImpl;
+
+ DECL_DLLPRIVATE_LINK( SelectHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( DoubleClickHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( NewFolderHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( SendFocusHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( OKHdl_Impl, PushButton* );
+ DECL_DLLPRIVATE_LINK( OrganizerHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( PackageHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( UpdateHdl_Impl, Timer* );
+ DECL_DLLPRIVATE_LINK( OpenLinkHdl_Impl, void* );
+
+public:
+ SvtDocumentTemplateDialog( Window* pParent );
+
+ /** ctor for calling the dialog for <em>selection</em> only, not for <em>opening</em> a document
+ <p>If you use this ctor, the dialog will behave differently in the following areas:
+ <ul><li>The <em>Edit</em> button will be hidden.</li>
+ <li>Upon pressing em>Open</em>, the selected file will not be opened. Instead, it's
+ URL is available (see <method>GetSelectedFileURL</method>).</li>
+ </ul>
+
+ */
+ ~SvtDocumentTemplateDialog();
+
+ void SelectTemplateFolder();
+
+private:
+ SVT_DLLPRIVATE void InitImpl( );
+ SVT_DLLPRIVATE sal_Bool CanEnableEditBtn() const;
+};
+
+#endif // _SVTOOLS_TEMPLDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/textwindowpeer.hxx b/include/svtools/textwindowpeer.hxx
new file mode 100644
index 000000000000..21de95eaa89c
--- /dev/null
+++ b/include/svtools/textwindowpeer.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_SVTOOLS_TEXTWINDOWPEER_HXX
+#define INCLUDED_SVTOOLS_TEXTWINDOWPEER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <toolkit/awt/vclxwindow.hxx>
+
+#include <memory>
+
+class TextEngine;
+class TextView;
+
+namespace svt
+{
+ class AccessibleFactoryAccess ;
+
+class TextWindowPeer: public ::VCLXWindow
+{
+public:
+ SVT_DLLPUBLIC TextWindowPeer(::TextView & rView, bool bCompoundControlChild = false);
+
+ virtual ~TextWindowPeer();
+
+private:
+ // VCLXWindow inherits funny copy constructor and assignment operator from
+ // ::cppu::OWeakObject, so override them here:
+
+ TextWindowPeer(TextWindowPeer &); // not implemented
+
+ void operator =(TextWindowPeer); // not implemented
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleContext >
+ CreateAccessibleContext();
+
+ ::TextEngine & m_rEngine;
+ ::TextView & m_rView;
+ bool m_bCompoundControlChild;
+
+ ::std::auto_ptr< ::svt::AccessibleFactoryAccess > m_pFactoryAccess;
+};
+
+}
+
+#endif // INCLUDED_SVTOOLS_TEXTWINDOWPEER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx
new file mode 100644
index 000000000000..247483440947
--- /dev/null
+++ b/include/svtools/toolbarmenu.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 _SVTOOLS_TOOLBARMENU_HXX_
+#define _SVTOOLS_TOOLBARMENU_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+
+#include <vector>
+
+#include <rtl/ref.hxx>
+
+#include <vcl/ctrl.hxx>
+#include <vcl/menu.hxx>
+#include <vcl/dockwin.hxx>
+
+class ValueSet;
+
+namespace svtools {
+
+class ToolbarMenuEntry;
+struct ToolbarMenu_Impl;
+
+class SVT_DLLPUBLIC ToolbarMenu : public DockingWindow
+{
+ friend class ToolbarMenuStatusListener;
+ friend struct ToolbarMenu_Impl;
+public:
+ ToolbarMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ Window* pParentWindow,
+ WinBits nBits );
+
+ ToolbarMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ Window* pParentWindow,
+ const ResId& rResId );
+
+ ~ToolbarMenu();
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvent );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+ void appendEntry( int nEntryId, const String& rStr, MenuItemBits nItemBits = 0 );
+ void appendEntry( int nEntryId, const String& rStr, const Image& rImage, MenuItemBits nItemBits = 0 );
+ void appendEntry( int nEntryId, Control* pControl, MenuItemBits nItemBits = 0 );
+ void appendSeparator();
+
+ /** creates an empty ValueSet that is initialized and can be inserted with appendEntry. */
+ ValueSet* createEmptyValueSetControl();
+
+ void checkEntry( int nEntryId, bool bCheck = true );
+
+ void enableEntry( int nEntryId, bool bEnable = true );
+
+ void setEntryText( int nEntryId, const String& rStr );
+
+ void setEntryImage( int nEntryId, const Image& rImage );
+
+ const Size& getMenuSize() const;
+
+ void SetSelectHdl( const Link& rLink );
+
+ int getSelectedEntryId() const;
+ int getHighlightedEntryId() const;
+
+ void highlightFirstEntry();
+
+protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+ // todo: move to new base class that will replace SfxPopupWindow
+ void AddStatusListener( const OUString& rCommandURL );
+
+ bool IsInPopupMode();
+ void EndPopupMode();
+
+ // XStatusListener (subclasses must override this one to get the status updates
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ void StateChanged( StateChangedType nType );
+ void DataChanged( const DataChangedEvent& rDCEvt );
+
+private:
+ DECL_LINK( HighlightHdl, Control * );
+
+ void initStatusListener();
+
+ void implInit( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
+ void initWindow();
+
+ Size implCalcSize();
+
+ void appendEntry( ToolbarMenuEntry* pEntry );
+
+ void implPaint( ToolbarMenuEntry* pThisOnly = NULL, bool bHighlight = false );
+
+ void implHighlightEntry( int nHighlightEntry, bool bHighlight );
+ void implHighlightEntry( const MouseEvent& rMEvt, bool bMBDown );
+
+ void implChangeHighlightEntry( int nEntry );
+ void implSelectEntry( int nSelectedEntry );
+
+ ToolbarMenuEntry* implCursorUpDown( bool bUp, bool bHomeEnd );
+ ToolbarMenuEntry* implGetEntry( int nEntry ) const;
+ ToolbarMenuEntry* implSearchEntry( int nEntryId ) const;
+
+ ToolbarMenu_Impl* mpImpl;
+};
+
+} // namespace svtools
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolboxcontroller.hxx b/include/svtools/toolboxcontroller.hxx
new file mode 100644
index 000000000000..6bccf935be9c
--- /dev/null
+++ b/include/svtools/toolboxcontroller.hxx
@@ -0,0 +1,162 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVTOOLS_TOOLBOXCONTROLLER_HXX
+#define _SVTOOLS_TOOLBOXCONTROLLER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/XToolbarController.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XUpdatable.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/property.hxx>
+#include <comphelper/propertycontainer.hxx>
+#include <cppuhelper/propshlp.hxx>
+
+#include <boost/unordered_map.hpp>
+
+class ToolBox;
+
+namespace svt
+{
+struct ToolboxController_Impl;
+
+class SVT_DLLPUBLIC ToolboxController : public ::com::sun::star::frame::XStatusListener,
+ public ::com::sun::star::frame::XToolbarController,
+ public ::com::sun::star::lang::XInitialization,
+ public ::com::sun::star::util::XUpdatable,
+ public ::com::sun::star::lang::XComponent,
+ public ::comphelper::OMutexAndBroadcastHelper,//shizhoubo
+ public ::comphelper::OPropertyContainer,//shizhoubo
+ public ::comphelper::OPropertyArrayUsageHelper< ToolboxController >,//shizhoubo
+ public ::cppu::OWeakObject
+{
+ private:
+ sal_Bool m_bSupportVisible; //shizhoubo
+ public:
+ ToolboxController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
+ const OUString& aCommandURL );
+ ToolboxController();
+ virtual ~ToolboxController();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getFrameInterface() const;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& getContext() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > getLayoutManager() const;
+
+ void updateStatus( const OUString aCommandURL );
+ void updateStatus();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XUpdatable
+ virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ using cppu::OPropertySetHelper::disposing;
+ virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
+ // OPropertySetHelper //shizhoubo
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const com::sun::star::uno::Any& rValue ) throw(com::sun::star::uno::Exception);
+ virtual sal_Bool SAL_CALL convertFastPropertyValue( com::sun::star::uno::Any& rConvertedValue, com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const com::sun::star::uno::Any& rValue) throw(com::sun::star::lang::IllegalArgumentException);
+ // XPropertySet //shizhoubo
+ virtual ::com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ // OPropertyArrayUsageHelper //shizhoubo
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
+
+
+ const OUString& getCommandURL() const { return m_aCommandURL; }
+ const OUString& getModuleName() const;
+
+ void dispatchCommand( const OUString& sCommandURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
+
+ void enable( bool bEnable );
+
+ protected:
+ bool getToolboxId( sal_uInt16& rItemId, ToolBox** ppToolBox );
+ void setSupportVisibleProperty(sal_Bool bValue); //shizhoubo
+ struct Listener
+ {
+ Listener( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& rDispatch ) :
+ aURL( rURL ), xDispatch( rDispatch ) {}
+
+ ::com::sun::star::util::URL aURL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
+ };
+
+ typedef ::boost::unordered_map< OUString,
+ com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >,
+ OUStringHash,
+ ::std::equal_to< OUString > > URLToDispatchMap;
+
+ // methods to support status forwarder, known by the old sfx2 toolbox controller implementation
+ void addStatusListener( const OUString& aCommandURL );
+ void removeStatusListener( const OUString& aCommandURL );
+ void bindListener();
+ void unbindListener();
+ sal_Bool isBound() const;
+ sal_Bool hasBigImages() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > getURLTransformer() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > getParent() const;
+
+ sal_Bool m_bInitialized : 1,
+ m_bDisposed : 1;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+ ToolboxController_Impl* m_pImpl;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ OUString m_aCommandURL;
+ URLToDispatchMap m_aListenerMap;
+ ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
+};
+
+}
+
+#endif // _SVTOOLS_TOOLBOXCONTROLLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/decklayouter.hxx b/include/svtools/toolpanel/decklayouter.hxx
new file mode 100644
index 000000000000..08022018ed38
--- /dev/null
+++ b/include/svtools/toolpanel/decklayouter.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 SVT_DECKLAYOUTER_HXX
+#define SVT_DECKLAYOUTER_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <rtl/ref.hxx>
+
+#include <boost/optional.hpp>
+
+namespace com { namespace sun { namespace star { namespace accessibility {
+ class XAccessible;
+} } } }
+class Rectangle;
+class Point;
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= IDeckLayouter
+ //====================================================================
+ class IDeckLayouter : public ::rtl::IReference
+ {
+ public:
+ /** re-arranges the elements of the tool deck, taking into account the
+ available space for the complete deck.
+
+ @param i_rDeckPlayground
+ the playground for the complete tool panel deck
+ @return
+ the content area for a single tool panel
+ */
+ virtual ::Rectangle Layout( const ::Rectangle& i_rDeckPlayground ) = 0;
+
+ /** destroys the instance
+
+ Since the layouter is ref-counted, but might keep references to non-ref-counted objects
+ (in particular, the ToolPanelDeck, which is a VCL-Window, and thus cannot be ref-counted),
+ Destroy is the definitive way to dispose the instance. Technically, it's still alive afterwards,
+ but non-functional.
+ */
+ virtual void Destroy() = 0;
+
+ /** assuming that a layouter neesds to provide some kind of panel selector control, this method
+ requests to set the focus to this control.
+ */
+ virtual void SetFocusToPanelSelector() = 0;
+
+ /** returns the number of components in the XAccessible hierarchy which are needed to represent all elements
+ the layouter is responsible form.
+
+ Note that the implementation must guarantee that the count is fixed over the life time of the layouter.
+ */
+ virtual size_t GetAccessibleChildCount() const = 0;
+
+ /** retrieves the XAccessible implementation for the <code>i_nChildIndex</code>'th child in the XAccessible
+ hierarchy.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetAccessibleChild(
+ const size_t i_nChildIndex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ ) = 0;
+
+ virtual ~IDeckLayouter()
+ {
+ }
+ };
+
+ typedef ::rtl::Reference< IDeckLayouter > PDeckLayouter;
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_DECKLAYOUTER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/drawerlayouter.hxx b/include/svtools/toolpanel/drawerlayouter.hxx
new file mode 100644
index 000000000000..0ee0560a8873
--- /dev/null
+++ b/include/svtools/toolpanel/drawerlayouter.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 SVT_DRAWERLAYOUTER_HXX
+#define SVT_DRAWERLAYOUTER_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/refbase.hxx"
+#include "svtools/toolpanel/toolpaneldeck.hxx"
+#include "svtools/toolpanel/decklayouter.hxx"
+
+#include <boost/shared_ptr.hpp>
+
+//......................................................................................................................
+namespace svt
+{
+//......................................................................................................................
+
+ class ToolPanelViewShell;
+ class ToolPanelDrawer;
+ typedef ::boost::shared_ptr< ToolPanelDrawer > PToolPanelDrawer;
+
+ //==================================================================================================================
+ //= ToolPanelDrawer
+ //==================================================================================================================
+ /** a class which implements a tool panel selector in the form of the classical drawers
+ */
+ class SVT_DLLPUBLIC DrawerDeckLayouter :public RefBase
+ ,public IDeckLayouter
+ ,public IToolPanelDeckListener
+ {
+ public:
+ DrawerDeckLayouter(
+ ::Window& i_rParentWindow,
+ IToolPanelDeck& i_rPanels
+ );
+ ~DrawerDeckLayouter();
+
+ // IReference
+ DECLARE_IREFERENCE()
+
+ // IDeckLayouter
+ virtual Rectangle Layout( const Rectangle& i_rDeckPlayground );
+ virtual void Destroy();
+ virtual void SetFocusToPanelSelector();
+ virtual size_t GetAccessibleChildCount() const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetAccessibleChild(
+ const size_t i_nChildIndex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ );
+
+ // IToolPanelDeckListener
+ virtual void PanelInserted( const PToolPanel& i_pPanel, const size_t i_nPosition );
+ virtual void PanelRemoved( const size_t i_nPosition );
+ virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive );
+ virtual void LayouterChanged( const PDeckLayouter& i_rNewLayouter );
+ virtual void Dying();
+
+ private:
+ // triggers a re-arrance of the panel deck elements
+ void impl_triggerRearrange() const;
+ size_t impl_getPanelPositionFromWindow( const Window* i_pDrawerWindow ) const;
+ void impl_removeDrawer( const size_t i_nPosition );
+
+ DECL_LINK( OnWindowEvent, VclSimpleEvent* );
+
+private:
+ Window& m_rParentWindow;
+ IToolPanelDeck& m_rPanelDeck;
+ ::std::vector< PToolPanelDrawer > m_aDrawers;
+ ::boost::optional< size_t > m_aLastKnownActivePanel;
+ };
+
+//......................................................................................................................
+} // namespace svt
+//......................................................................................................................
+
+#endif // SVT_DRAWERLAYOUTER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/paneltabbar.hxx b/include/svtools/toolpanel/paneltabbar.hxx
new file mode 100644
index 000000000000..0b534f88ed9b
--- /dev/null
+++ b/include/svtools/toolpanel/paneltabbar.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVT_PANELTABBAR_HXX
+#define SVT_PANELTABBAR_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/tabalignment.hxx"
+#include "svtools/toolpanel/tabitemcontent.hxx"
+
+#include <vcl/ctrl.hxx>
+
+#include <memory>
+#include <boost/optional.hpp>
+
+class PushButton;
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ class PanelTabBar_Impl;
+ class IToolPanelDeck;
+
+ //====================================================================
+ //= PanelTabBar
+ //====================================================================
+ /** a tab bar for selecting panels
+
+ At the moment, this control aligns the tabs vertically, this might be extended to also support a horizontal
+ layout in the future.
+ */
+ class SVT_DLLPUBLIC PanelTabBar : public Control
+ {
+ public:
+ PanelTabBar( Window& i_rParentWindow, IToolPanelDeck& i_rPanelDeck, const TabAlignment i_eAlignment, const TabItemContent i_eItemContent );
+ ~PanelTabBar();
+
+ // attribute access
+ TabItemContent GetTabItemContent() const;
+ void SetTabItemContent( const TabItemContent& i_eItemContent );
+
+ ::boost::optional< size_t > GetFocusedPanelItem() const;
+ void FocusPanelItem( const size_t i_nItemPos );
+ Rectangle GetItemScreenRect( const size_t i_nItemPos ) const;
+ bool IsVertical() const;
+ IToolPanelDeck& GetPanelDeck() const;
+ PushButton& GetScrollButton( const bool i_bForward );
+
+ // Window overridables
+ virtual Size GetOptimalSize() const;
+
+ protected:
+ // Window overridables
+ virtual void Paint( const Rectangle& i_rRect );
+ virtual void Resize();
+ virtual void MouseMove( const MouseEvent& i_rMouseEvent );
+ virtual void MouseButtonDown( const MouseEvent& i_rMouseEvent );
+ virtual void MouseButtonUp( const MouseEvent& i_rMouseEvent );
+ virtual void RequestHelp( const HelpEvent& i_rHelpEvent );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void KeyInput( const KeyEvent& i_rKeyEvent );
+ virtual void DataChanged( const DataChangedEvent& i_rDataChanedEvent );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
+ GetComponentInterface( sal_Bool i_bCreate );
+
+ private:
+ ::std::auto_ptr< PanelTabBar_Impl > m_pImpl;
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_PANELTABBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/refbase.hxx b/include/svtools/toolpanel/refbase.hxx
new file mode 100644
index 000000000000..18f86edbfbab
--- /dev/null
+++ b/include/svtools/toolpanel/refbase.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 SVT_REFBASE_HXX
+#define SVT_REFBASE_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <rtl/ref.hxx>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= RefBase
+ //====================================================================
+ class SVT_DLLPUBLIC RefBase : public ::rtl::IReference
+ {
+ protected:
+ RefBase()
+ :m_refCount( 0 )
+ {
+ }
+
+ virtual ~RefBase()
+ {
+ }
+
+ virtual oslInterlockedCount SAL_CALL acquire();
+ virtual oslInterlockedCount SAL_CALL release();
+
+ private:
+ oslInterlockedCount m_refCount;
+ };
+
+#define DECLARE_IREFERENCE() \
+ virtual oslInterlockedCount SAL_CALL acquire(); \
+ virtual oslInterlockedCount SAL_CALL release();
+
+
+#define IMPLEMENT_IREFERENCE( classname ) \
+ oslInterlockedCount classname::acquire() \
+ { \
+ return RefBase::acquire(); \
+ } \
+ oslInterlockedCount classname::release() \
+ { \
+ return RefBase::release(); \
+ }
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_REFBASE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/tabalignment.hxx b/include/svtools/toolpanel/tabalignment.hxx
new file mode 100644
index 000000000000..e626d03dc267
--- /dev/null
+++ b/include/svtools/toolpanel/tabalignment.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 SVT_TABALIGNMENT_HXX
+#define SVT_TABALIGNMENT_HXX
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ enum TabAlignment
+ {
+ TABS_LEFT,
+ TABS_RIGHT,
+ TABS_TOP,
+ TABS_BOTTOM
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TABALIGNMENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/tabitemcontent.hxx b/include/svtools/toolpanel/tabitemcontent.hxx
new file mode 100644
index 000000000000..07c7eeedc9fd
--- /dev/null
+++ b/include/svtools/toolpanel/tabitemcontent.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 SVT_TABITEMCONTENT_HXX
+#define SVT_TABITEMCONTENT_HXX
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ enum TabItemContent
+ {
+ TABITEM_IMAGE_AND_TEXT,
+ TABITEM_IMAGE_ONLY,
+ TABITEM_TEXT_ONLY,
+
+ TABITEM_AUTO
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TABITEMCONTENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/tablayouter.hxx b/include/svtools/toolpanel/tablayouter.hxx
new file mode 100644
index 000000000000..cf76879a4566
--- /dev/null
+++ b/include/svtools/toolpanel/tablayouter.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 SVT_TABLAYOUTER_HXX
+#define SVT_TABLAYOUTER_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/decklayouter.hxx"
+#include "svtools/toolpanel/tabalignment.hxx"
+#include "svtools/toolpanel/tabitemcontent.hxx"
+#include "svtools/toolpanel/refbase.hxx"
+
+#include <memory>
+
+#include <boost/noncopyable.hpp>
+
+class Window;
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ class IToolPanelDeck;
+
+ struct TabDeckLayouter_Data;
+
+ //====================================================================
+ //= TabDeckLayouter
+ //====================================================================
+ class SVT_DLLPUBLIC TabDeckLayouter :public RefBase
+ ,public IDeckLayouter
+ ,public ::boost::noncopyable
+ {
+ public:
+ /** creates a new layouter
+ @param i_rParent
+ is the parent window for any VCL windows the layouter needs to create.
+ @param i_rPanels
+ is the panel deck which the layouter is responsible for.
+ @param i_eAlignment
+ specifies the alignment of the panel selector
+ @param TabItemContent
+ specifies the content to show on the tab items
+ */
+ TabDeckLayouter(
+ Window& i_rParent,
+ IToolPanelDeck& i_rPanels,
+ const TabAlignment i_eAlignment,
+ const TabItemContent i_eItemContent
+ );
+ ~TabDeckLayouter();
+
+ // attribute access
+ TabItemContent GetTabItemContent() const;
+ void SetTabItemContent( const TabItemContent& i_eItemContent );
+ TabAlignment GetTabAlignment() const;
+
+ // IDeckLayouter
+ virtual Rectangle Layout( const Rectangle& i_rDeckPlayground );
+ virtual void Destroy();
+ virtual void SetFocusToPanelSelector();
+ virtual size_t GetAccessibleChildCount() const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetAccessibleChild(
+ const size_t i_nChildIndex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ );
+
+ // IReference
+ DECLARE_IREFERENCE()
+
+ private:
+ ::std::auto_ptr< TabDeckLayouter_Data > m_pData;
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TABLAYOUTER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/toolpanel.hxx b/include/svtools/toolpanel/toolpanel.hxx
new file mode 100644
index 000000000000..4c2d0f736ba0
--- /dev/null
+++ b/include/svtools/toolpanel/toolpanel.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 SVT_TOOLPANEL_HXX
+#define SVT_TOOLPANEL_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/refbase.hxx"
+
+#include <rtl/ustring.hxx>
+#include <vcl/image.hxx>
+
+#include <boost/noncopyable.hpp>
+
+class Rectangle;
+class Window;
+namespace com { namespace sun { namespace star { namespace accessibility {
+ class XAccessible;
+} } } }
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= IToolPanel
+ //====================================================================
+ /** abstract interface for a single tool panel
+ */
+ class SVT_DLLPUBLIC IToolPanel : public ::rtl::IReference
+ {
+ public:
+ /// retrieves the display name of the panel
+ virtual OUString GetDisplayName() const = 0;
+
+ /// retrieves the image associated with the panel, if any
+ virtual Image GetImage() const = 0;
+
+ /// retrieves the help ID associated with the panel, if any.
+ virtual OString GetHelpID() const = 0;
+
+ /** activates the panel
+
+ Usually, this means the panel's Window is created (if not previosly done so) and shown.
+
+ @param i_rParentWindow
+ the parent window to anchor the panel window at. Subsequent calls to the Activate
+ method will always get the same parent window. The complete area of this window is
+ available, and should be used, for the panel window.
+ */
+ virtual void Activate( Window& i_rParentWindow ) = 0;
+
+ /** deactivates the panel
+
+ There are different ways how an implementation could deactivate a panel. The easiest way
+ would be to simply hide the associated Window. Alternatively, you could completely destroy it,
+ or decide to cache it by re-parenting it to another (temporary, invisible) window.
+ */
+ virtual void Deactivate() = 0;
+
+ /** sets a new size for the panel's Window
+
+ The panel window is always expected to be positioned at (0,0), relative to the parent window
+ which was passed to the Activate member. Resizing the panel window is necessary when the size of
+ this parent window changes. Effectively, this method is a means of convenience, to relief panel
+ implementations from reacting on size changes of their parent window themselves.
+ */
+ virtual void SetSizePixel( const Size& i_rPanelWindowSize ) = 0;
+
+ /// sets the focus to the panel window
+ virtual void GrabFocus() = 0;
+
+ /** release any resources associated with the panel.
+
+ In particular, implementations should ultimately destroy the VCL window which implements the panel
+ window. No subsequent calls to any other method will happen after Destroy has been called.
+ */
+ virtual void Dispose() = 0;
+
+ /** creates an XAccessible for the tool panel
+
+ Implementations are allowed to create a new instance each time this method is called, the caller
+ is responsible for caching the XAccessible implementation, if this is desired.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ CreatePanelAccessible(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ ) = 0;
+
+ virtual ~IToolPanel()
+ {
+ }
+ };
+
+ typedef ::rtl::Reference< IToolPanel > PToolPanel;
+
+ //====================================================================
+ //= ToolPanelBase
+ //====================================================================
+ /** base class for tool panel implementations, adding ref count implementation to the IToolPanel interface,
+ but still being abstract
+ */
+ class SVT_DLLPUBLIC ToolPanelBase :public IToolPanel
+ ,public RefBase
+ ,public ::boost::noncopyable
+ {
+ protected:
+ ToolPanelBase();
+ ~ToolPanelBase();
+
+ public:
+ DECLARE_IREFERENCE()
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TOOLPANEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/toolpaneldeck.hxx b/include/svtools/toolpanel/toolpaneldeck.hxx
new file mode 100644
index 000000000000..d293aca8d017
--- /dev/null
+++ b/include/svtools/toolpanel/toolpaneldeck.hxx
@@ -0,0 +1,194 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVT_TOOLPANELDECK_HXX
+#define SVT_TOOLPANELDECK_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/toolpanel.hxx"
+#include "svtools/toolpanel/decklayouter.hxx"
+
+#include <vcl/ctrl.hxx>
+
+#include <boost/optional.hpp>
+#include <memory>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ class ToolPanelCollection;
+ class ToolPanelDeck_Impl;
+
+ //====================================================================
+ //= IToolPanelDeckListener
+ //====================================================================
+ class SAL_NO_VTABLE IToolPanelDeckListener
+ {
+ public:
+ /** called when a panel has been inserted into the deck
+ */
+ virtual void PanelInserted( const PToolPanel& i_pPanel, const size_t i_nPosition ) = 0;
+
+ /** called when a panel has been removed from the deck
+ */
+ virtual void PanelRemoved( const size_t i_nPosition ) = 0;
+
+ /** called when the active panel of the deck changed
+ */
+ virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ) = 0;
+
+ /** called when a new layouter has been set at a tool panel deck.
+
+ The method is called after the old layouter has been disposed (i.e. its Destroy method has been
+ invoked), and after the complete deck has been re-layouter.
+ */
+ virtual void LayouterChanged( const PDeckLayouter& i_rNewLayouter ) = 0;
+
+ /** called when the tool panel deck which the listener registered at is dying. The listener is required to
+ release all references to the deck then.
+ */
+ virtual void Dying() = 0;
+
+ protected:
+ ~IToolPanelDeckListener() {}
+ };
+
+ //====================================================================
+ //= IToolPanelDeck
+ //====================================================================
+ class SVT_DLLPUBLIC IToolPanelDeck
+ {
+ public:
+ /** returns the number of panels in the container
+ */
+ virtual size_t GetPanelCount() const = 0;
+
+ /** retrieves the panel with the given index. Invalid indexes will be reported via an assertion in the
+ non-product version, and silently ignored in the product version, with a NULL panel being returned.
+ */
+ virtual PToolPanel GetPanel( const size_t i_nPos ) const = 0;
+
+ /** returns the number of the currently active panel.
+ */
+ virtual ::boost::optional< size_t >
+ GetActivePanel() const = 0;
+
+ /** activates the panel with the given number. If the given number is larger or equal to the number of panels
+ in the deck, this will be reported via an assertion in non-product builds, and otherwise ignored.
+ @param i_rPanel
+ the number of the panel to activate. If this is not set, the currently active panel is de-activated,
+ and no new panel is activated at all. Whether or not this makes sense for your application is at
+ your own discretion.
+ */
+ virtual void ActivatePanel( const ::boost::optional< size_t >& i_rPanel ) = 0;
+
+ /** inserts a new panel into the container. NULL panels are not allowed, as are positions greater than the
+ current panel count. Violations of this will be reported via an assertion in the non-product version, and
+ silently ignored in the product version.
+ */
+ virtual size_t InsertPanel( const PToolPanel& i_pPanel, const size_t i_nPosition ) = 0;
+
+ /** removes a panel specified by its position.
+
+ Note: It is the responsibility of the caller to ensure that the panel is destroyed appropriately. That is,
+ the tool panel deck will <em>not</em> invoke <member>IToolPanel::Dispose</member> on the removed panel.
+ The advantage is that the panel might be re-used later, with the disadvantage that the owner of the panel
+ deck must know whether Dispose must be invoked after removal, or whether the panel will properly
+ dispose itself when its ref count drops to 0.
+ */
+ virtual PToolPanel RemovePanel( const size_t i_nPosition ) = 0;
+
+ /** adds a new listener to be notified when the container content changes. The caller is responsible
+ for life time control, i.e. removing the listener before it actually dies.
+ */
+ virtual void AddListener( IToolPanelDeckListener& i_rListener ) = 0;
+
+ /** removes a container listener previously added via addListener.
+ */
+ virtual void RemoveListener( IToolPanelDeckListener& i_rListener ) = 0;
+
+ protected:
+ ~IToolPanelDeck() {}
+ };
+
+ //====================================================================
+ //= ToolPanelDeck
+ //====================================================================
+ class SVT_DLLPUBLIC ToolPanelDeck :public Control
+ ,public IToolPanelDeck
+ {
+ public:
+ ToolPanelDeck( Window& i_rParent, const WinBits i_nStyle = WB_DIALOGCONTROL );
+ ~ToolPanelDeck();
+
+ // attributes
+ PDeckLayouter GetLayouter() const;
+ void SetLayouter( const PDeckLayouter& i_pNewLayouter );
+
+ /** returns the window which acts as anchor for the panel windows.
+
+ This is a single dedicated window, which is passed to the IToolPanel::ActivatePanel method
+ whenever a panel is activated, to act as parent window for the panel's VCL-Window.
+ */
+ ::Window& GetPanelWindowAnchor();
+ const ::Window& GetPanelWindowAnchor() const;
+
+ /** sets the window which should act as parent in the A11Y object hierarchy.
+
+ Calling this method has no effect if CreateAccessible had always been called.
+ */
+ void SetAccessibleParentWindow( ::Window* i_pAccessibleParent );
+ ::Window* GetAccessibleParentWindow() const;
+
+ // IToolPanelDeck
+ virtual size_t GetPanelCount() const;
+ virtual PToolPanel GetPanel( const size_t i_nPos ) const;
+ virtual ::boost::optional< size_t >
+ GetActivePanel() const;
+ virtual void ActivatePanel( const ::boost::optional< size_t >& i_rPanel );
+ virtual size_t InsertPanel( const PToolPanel& i_pPanel, const size_t i_nPosition );
+ virtual PToolPanel RemovePanel( const size_t i_nPosition );
+ virtual void AddListener( IToolPanelDeckListener& i_rListener );
+ virtual void RemoveListener( IToolPanelDeckListener& i_rListener );
+
+ protected:
+ // Window overridables
+ virtual void Resize();
+ virtual long Notify( NotifyEvent& i_rNotifyEvent );
+ virtual void GetFocus();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
+ GetComponentInterface( sal_Bool i_bCreate );
+
+ private:
+ ::std::auto_ptr< ToolPanelDeck_Impl > m_pImpl;
+
+ private:
+ using Window::GetAccessibleParentWindow;
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TOOLPANELDECK_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanelopt.hxx b/include/svtools/toolpanelopt.hxx
new file mode 100644
index 000000000000..9ca4f6fe239a
--- /dev/null
+++ b/include/svtools/toolpanelopt.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_SVTOOLS_TOOLPANELOPT_HXX
+#define INCLUDED_SVTOOLS_TOOLPANELOPT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+/** forward declaration to our private date container implementation
+
+ We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*/
+class SvtToolPanelOptions_Impl;
+class Link;
+
+/** collect information about sidebar group
+
+ \attention This class is partially threadsafe.
+*/
+class SVT_DLLPUBLIC SvtToolPanelOptions: public utl::detail::Options
+{
+ public:
+ /** standard constructor and destructor
+
+ This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ \sa member m_nRefCount
+ \sa member m_pDataContainer
+ */
+ SvtToolPanelOptions();
+ virtual ~SvtToolPanelOptions();
+
+ bool GetVisibleImpressView() const;
+ void SetVisibleImpressView( bool bVisible );
+ bool GetVisibleOutlineView() const;
+ void SetVisibleOutlineView( bool bVisible );
+ bool GetVisibleNotesView() const;
+ void SetVisibleNotesView( bool bVisible );
+ bool GetVisibleHandoutView() const;
+ void SetVisibleHandoutView( bool bVisible );
+ bool GetVisibleSlideSorterView() const;
+ void SetVisibleSlideSorterView( bool bVisible );
+ bool GetVisibleDrawView() const;
+ void SetVisibleDrawView( bool bVisible );
+
+
+ private:
+ /** return a reference to a static mutex
+
+ These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ \return A reference to a static mutex member.*/
+ SVT_DLLPRIVATE static ::osl::Mutex& GetInitMutex();
+
+ private:
+
+ /**
+ \attention
+ Don't initialize these static member in these header!
+ \li Double defined symbols will be detected ...
+ \li and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+ static SvtToolPanelOptions_Impl* m_pDataContainer; ///< impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount; ///< internal ref count mechanism
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/transfer.hxx b/include/svtools/transfer.hxx
new file mode 100644
index 000000000000..5d63d166bfa5
--- /dev/null
+++ b/include/svtools/transfer.hxx
@@ -0,0 +1,521 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TRANSFER_HXX
+#define _TRANSFER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/globname.hxx>
+#include <tools/gen.hxx>
+#include <sot/formats.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase4.hxx>
+#include <com/sun/star/frame/XTerminateListener.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
+#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
+#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
+#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
+#include <com/sun/star/datatransfer/dnd/DropTargetDragEvent.hpp>
+#include <com/sun/star/datatransfer/dnd/DropTargetDropEvent.hpp>
+#include <com/sun/star/datatransfer/dnd/XDragSourceListener.hpp>
+#include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
+#include <com/sun/star/embed/Aspects.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+
+class Bitmap;
+class GDIMetaFile;
+class Graphic;
+class ImageMap;
+class SotStorageStreamRef;
+class INetBookmark;
+class INetImage;
+class FileList;
+class Window;
+class Link;
+
+// Drag&Drop defines
+
+#define DND_ACTION_NONE ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE
+#define DND_ACTION_COPY ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY
+#define DND_ACTION_MOVE ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_MOVE
+#define DND_ACTION_COPYMOVE ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE
+#define DND_ACTION_LINK ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_LINK
+
+#define DND_POINTER_NONE 0
+#define DND_IMAGE_NONE 0
+
+struct TransferableObjectDescriptor
+{
+ SvGlobalName maClassName;
+ sal_uInt16 mnViewAspect;
+ Point maDragStartPos;
+ Size maSize;
+ sal_uInt32 mnOle2Misc;
+ OUString maTypeName;
+ OUString maDisplayName;
+ sal_Bool mbCanLink;
+
+ TransferableObjectDescriptor()
+ : mnViewAspect(::com::sun::star::embed::Aspects::MSOLE_CONTENT)
+ , mnOle2Misc(0)
+ , mbCanLink(false)
+ {}
+
+ SVT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, TransferableObjectDescriptor& rObjDesc );
+ SVT_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const TransferableObjectDescriptor& rObjDesc );
+};
+
+struct AcceptDropEvent
+{
+ sal_Int8 mnAction;
+ Point maPosPixel;
+ const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent maDragEvent;
+ sal_Bool mbLeaving;
+ sal_Bool mbDefault;
+
+ AcceptDropEvent() :
+ mnAction( DND_ACTION_NONE ),
+ mbLeaving( sal_False ),
+ mbDefault( sal_False ) {}
+
+ AcceptDropEvent( sal_Int8 nAction,
+ const Point& rPosPixel,
+ const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& rDragEvent,
+ sal_Bool bLeaving = sal_False ) :
+ mnAction( nAction ),
+ maPosPixel( rPosPixel ),
+ maDragEvent( rDragEvent ),
+ mbLeaving( bLeaving ),
+ mbDefault( sal_False ) {}
+};
+
+struct ExecuteDropEvent
+{
+ sal_Int8 mnAction;
+ Point maPosPixel;
+ const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent maDropEvent;
+ sal_Bool mbDefault;
+
+ ExecuteDropEvent() :
+ mnAction( DND_ACTION_NONE ),
+ mbDefault( sal_False ) {}
+
+ ExecuteDropEvent( sal_Int8 nAction,
+ const Point& rPosPixel,
+ const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& rDropEvent ) :
+ mnAction( nAction ),
+ maPosPixel( rPosPixel ),
+ maDropEvent( rDropEvent ),
+ mbDefault( sal_False ) {}
+};
+
+class SVT_DLLPUBLIC TransferableHelper : public ::cppu::WeakImplHelper4< ::com::sun::star::datatransfer::XTransferable,
+ ::com::sun::star::datatransfer::clipboard::XClipboardOwner,
+ ::com::sun::star::datatransfer::dnd::XDragSourceListener,
+ ::com::sun::star::lang::XUnoTunnel >
+{
+private:
+
+ // nested class to implement the XTerminateListener interface
+ class TerminateListener : public ::cppu::WeakImplHelper1< ::com::sun::star::frame::XTerminateListener >
+ {
+ private:
+
+ TransferableHelper& mrParent;
+
+ private:
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XTerminateListener
+ virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw( ::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw( ::com::sun::star::uno::RuntimeException );
+
+ public:
+
+ TerminateListener( TransferableHelper& rDropTargetHelper );
+ virtual ~TerminateListener();
+ };
+
+ friend class TransferableHelper::TerminateListener;
+
+private:
+
+ ::com::sun::star::uno::Any maAny;
+ OUString maLastFormat;
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTerminateListener > mxTerminateListener;
+ DataFlavorExVector* mpFormats;
+ TransferableObjectDescriptor* mpObjDesc;
+
+protected:
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >&
+ getOwnClipboard() const { return mxClipboard; }
+
+private:
+
+ // XTransferable
+ virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) throw(::com::sun::star::datatransfer::UnsupportedFlavorException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XDragSourceListener
+ virtual void SAL_CALL dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& dsde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent& dse ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw(::com::sun::star::uno::RuntimeException);
+
+private:
+
+ // XClipboardOwner
+ virtual void SAL_CALL lostOwnership( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& xClipboard, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans ) throw(::com::sun::star::uno::RuntimeException);
+
+protected:
+ // derivees need to access lostOwnership in case hey override it
+ // on windows, changing the access rights to a method gives unresolved externals, so we introduce
+ // this impl-method here 'til the next incompatible update
+ inline void implCallOwnLostOwnership(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& _rxClipboard,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& _rxTrans
+ )
+ {
+ TransferableHelper::lostOwnership( _rxClipboard, _rxTrans );
+ }
+
+
+private:
+
+ SVT_DLLPRIVATE void ImplFlush();
+
+protected:
+
+ virtual ~TransferableHelper();
+
+ void AddFormat( SotFormatStringId nFormat );
+ void AddFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ void RemoveFormat( SotFormatStringId nFormat );
+ void RemoveFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool HasFormat( SotFormatStringId nFormat );
+ inline sal_Bool HasFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) { return isDataFlavorSupported( rFlavor ); }
+ void ClearFormats();
+
+ sal_Bool SetAny( const ::com::sun::star::uno::Any& rAny, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetString( const OUString& rString, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetBitmap( const Bitmap& rBitmap, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetGDIMetaFile( const GDIMetaFile& rMtf, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetGraphic( const Graphic& rGraphic, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetImageMap( const ImageMap& rIMap, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetTransferableObjectDescriptor( const TransferableObjectDescriptor& rDesc, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetINetBookmark( const INetBookmark& rBmk, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetINetImage( const INetImage& rINtImg, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetObject( void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+
+protected:
+
+ virtual void AddSupportedFormats() = 0;
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) = 0;
+ virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void DragFinished( sal_Int8 nDropAction );
+ virtual void ObjectReleased();
+
+public:
+
+ TransferableHelper();
+
+ void PrepareOLE( const TransferableObjectDescriptor& rObjDesc );
+
+ void CopyToClipboard( Window *pWindow ) const;
+ void CopyToSelection( Window *pWindow ) const;
+ void StartDrag( Window* pWindow, sal_Int8 nDragSourceActions,
+ sal_Int32 nDragPointer = DND_POINTER_NONE,
+ sal_Int32 nDragImage = DND_IMAGE_NONE );
+
+ static void ClearSelection( Window *pWindow );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetSystemClipboard();
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
+
+public:
+
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException );
+};
+
+struct TransferableDataHelper_Impl;
+
+class SVT_DLLPUBLIC TransferableDataHelper
+{
+ friend class DropTargetHelper;
+
+private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > mxTransfer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard;
+ DataFlavorExVector* mpFormats;
+ TransferableObjectDescriptor* mpObjDesc;
+ TransferableDataHelper_Impl* mpImpl;
+
+protected:
+ void InitFormats();
+
+public:
+
+ static void FillDataFlavorExVector( const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& rDataFlavorSeq,
+ DataFlavorExVector& rDataFlavorExVector );
+
+ TransferableDataHelper();
+ TransferableDataHelper( const TransferableDataHelper& rDataHelper );
+ TransferableDataHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable );
+ ~TransferableDataHelper();
+
+ TransferableDataHelper& operator=( const TransferableDataHelper& rDataHelper );
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& GetTransferable() const { return mxTransfer; }
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > GetXTransferable() const;
+
+ sal_Bool HasFormat( SotFormatStringId nFormat ) const;
+ sal_Bool HasFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) const;
+
+ sal_uInt32 GetFormatCount() const;
+
+ SotFormatStringId GetFormat( sal_uInt32 nFormat ) const;
+ ::com::sun::star::datatransfer::DataFlavor GetFormatDataFlavor( sal_uInt32 nFormat ) const;
+
+ DataFlavorExVector& GetDataFlavorExVector() const {return *mpFormats; }
+
+ sal_Bool StartClipboardListening( );
+ void StopClipboardListening( );
+
+ void Rebind( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& _rxNewData );
+
+public:
+
+ ::com::sun::star::uno::Any GetAny( SotFormatStringId nFormat ) const;
+ ::com::sun::star::uno::Any GetAny( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) const;
+
+ sal_Bool GetString( SotFormatStringId nFormat, String& rStr );
+ sal_Bool GetString( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, String& rStr );
+
+ sal_Bool GetString( SotFormatStringId nFormat, OUString& rStr );
+ sal_Bool GetString( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, OUString& rStr );
+
+ sal_Bool GetBitmap( SotFormatStringId nFormat, Bitmap& rBmp );
+ sal_Bool GetBitmap( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, Bitmap& rBmp );
+
+ sal_Bool GetGDIMetaFile( SotFormatStringId nFormat, GDIMetaFile& rMtf );
+ sal_Bool GetGDIMetaFile( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, GDIMetaFile& rMtf );
+
+ sal_Bool GetGraphic( SotFormatStringId nFormat, Graphic& rGraphic );
+ sal_Bool GetGraphic( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, Graphic& rGraphic );
+
+ sal_Bool GetImageMap( SotFormatStringId nFormat, ImageMap& rIMap );
+ sal_Bool GetImageMap( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ImageMap& rImap );
+
+ sal_Bool GetTransferableObjectDescriptor( SotFormatStringId nFormat, TransferableObjectDescriptor& rDesc );
+ sal_Bool GetTransferableObjectDescriptor( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, TransferableObjectDescriptor& rDesc );
+
+ sal_Bool GetINetBookmark( SotFormatStringId nFormat, INetBookmark& rBmk );
+ sal_Bool GetINetBookmark( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, INetBookmark& rBmk );
+
+ sal_Bool GetINetImage( SotFormatStringId nFormat, INetImage& rINtImg );
+ sal_Bool GetINetImage( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, INetImage& rINtImg );
+
+ sal_Bool GetFileList( SotFormatStringId nFormat, FileList& rFileList );
+ sal_Bool GetFileList( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, FileList& rFileList );
+
+ sal_Bool GetSequence( SotFormatStringId nFormat, ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq );
+ sal_Bool GetSequence( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq );
+
+ sal_Bool GetSotStorageStream( SotFormatStringId nFormat, SotStorageStreamRef& rStreamRef );
+ sal_Bool GetSotStorageStream( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, SotStorageStreamRef& rStreamRef );
+
+ sal_Bool GetInputStream( SotFormatStringId nFormat, ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xStream );
+ sal_Bool GetInputStream( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xStream );
+
+ sal_Bool GetInterface( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf );
+
+public:
+
+ static TransferableDataHelper CreateFromSystemClipboard( Window * pWindow );
+ static TransferableDataHelper CreateFromSelection( Window * pWindow );
+ static sal_Bool IsEqual( const ::com::sun::star::datatransfer::DataFlavor& rInternalFlavor,
+ const ::com::sun::star::datatransfer::DataFlavor& rRequestFlavor,
+ sal_Bool bCompareParameters = sal_False );
+};
+
+class SVT_DLLPUBLIC DragSourceHelper
+{
+private:
+
+ // nested class to implement the XDragGestureListener interface
+ class DragGestureListener : public ::cppu::WeakImplHelper1< ::com::sun::star::datatransfer::dnd::XDragGestureListener >
+ {
+ private:
+
+ DragSourceHelper& mrParent;
+
+ private:
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XDragGestureListener
+ virtual void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& rDGE ) throw( ::com::sun::star::uno::RuntimeException );
+
+ public:
+
+ DragGestureListener( DragSourceHelper& rDragSourceHelper );
+ ~DragGestureListener();
+ };
+
+ friend class DragSourceHelper::DragGestureListener;
+
+private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > mxDragGestureRecognizer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener > mxDragGestureListener;
+
+ // not available
+ DragSourceHelper();
+ DragSourceHelper& operator=( const DragSourceHelper& rDragSourceHelper );
+ sal_Bool operator==( const DragSourceHelper& rDragSourceHelper ) const;
+
+public:
+
+ // to be overridden by the application
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+
+ DragSourceHelper( Window* pWindow );
+ virtual ~DragSourceHelper();
+};
+
+class SVT_DLLPUBLIC DropTargetHelper
+{
+private:
+
+ // nested class to implement the XDropTargetListener interface
+ class DropTargetListener : public ::cppu::WeakImplHelper1< ::com::sun::star::datatransfer::dnd::XDropTargetListener >
+ {
+ private:
+
+ DropTargetHelper& mrParent;
+ AcceptDropEvent* mpLastDragOverEvent;
+
+ private:
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XDropTargetListener
+ virtual void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
+
+ public:
+
+ DropTargetListener( DropTargetHelper& rDropTargetHelper );
+ ~DropTargetListener();
+ };
+
+ friend class DropTargetHelper::DropTargetListener;
+
+private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > mxDropTarget;
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > mxDropTargetListener;
+ DataFlavorExVector* mpFormats;
+
+ // not available
+ DropTargetHelper();
+ DropTargetHelper& operator=( const DropTargetHelper& rDropTargetHelper );
+ sal_Bool operator==( const DropTargetHelper& rDropTargetHelper ) const;
+
+ void ImplConstruct();
+
+ // called by our own implementation of XDropTargetListener (DropTargetListener instance)
+ void ImplBeginDrag( const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& rSupportedDataFlavors );
+ void ImplEndDrag();
+
+public:
+
+ // to be overridden by the application
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+
+ DropTargetHelper( Window* pWindow );
+ DropTargetHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget >& rxDropTarget );
+
+ virtual ~DropTargetHelper();
+
+ // typically called by the application in ::AcceptDrop and ::ExecuteDrop and (see above)
+ sal_Bool IsDropFormatSupported( SotFormatStringId nFormat );
+ sal_Bool IsDropFormatSupported( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+
+ DataFlavorExVector& GetDataFlavorExVector() const {return *mpFormats; }
+
+};
+
+struct TransferDataContainer_Impl;
+
+class SVT_DLLPUBLIC TransferDataContainer : public TransferableHelper
+{
+ TransferDataContainer_Impl* pImpl;
+
+protected:
+
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void DragFinished( sal_Int8 nDropAction );
+
+public:
+
+ TransferDataContainer();
+ ~TransferDataContainer();
+
+ void CopyINetBookmark( const INetBookmark& rBkmk );
+ void CopyINetImage( const INetImage& rINtImg );
+ void CopyImageMap( const ImageMap& rImgMap );
+ void CopyGraphic( const Graphic& rGrf );
+ void CopyString( const String& rStr );
+ void CopyString( sal_uInt16 nFmt, const String& rStr );
+ void CopyAny( sal_uInt16 nFmt, const ::com::sun::star::uno::Any& rAny );
+
+ void CopyByteString( sal_uLong nFormatId, const OString& rStr );
+ void CopyAnyData( sal_uLong nFormatId, const sal_Char* pData, sal_uLong nLen );
+
+ sal_Bool HasAnyData() const;
+
+ using TransferableHelper::StartDrag;
+ void StartDrag( Window* pWindow, sal_Int8 nDragSourceActions,
+ const Link& rCallbck,
+ sal_Int32 nDragPointer = DND_POINTER_NONE,
+ sal_Int32 nDragImage = DND_IMAGE_NONE );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/treelist.hxx b/include/svtools/treelist.hxx
new file mode 100644
index 000000000000..220b2f4c7f88
--- /dev/null
+++ b/include/svtools/treelist.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 _SVTREELIST_HXX
+#define _SVTREELIST_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/treelistentries.hxx"
+#include "svtools/viewdataentry.hxx"
+
+#include <tools/solar.h>
+#include <tools/link.hxx>
+#include <tools/string.hxx>
+#include <tools/debug.hxx>
+
+#include <limits.h>
+#include <vector>
+#include <boost/ptr_container/ptr_map.hpp>
+
+#define LISTACTION_INSERTED 1
+#define LISTACTION_REMOVING 2
+#define LISTACTION_REMOVED 3
+#define LISTACTION_MOVING 4
+#define LISTACTION_MOVED 5
+#define LISTACTION_CLEARING 6
+#define LISTACTION_INSERTED_TREE 7
+#define LISTACTION_INVALIDATE_ENTRY 8
+#define LISTACTION_RESORTING 9
+#define LISTACTION_RESORTED 10
+#define LISTACTION_CLEARED 11
+
+class SvTreeListEntry;
+class SvListView;
+
+enum SvSortMode { SortAscending, SortDescending, SortNone };
+
+// For the return values of Sortlink:
+// See International::Compare( pLeft, pRight )
+// ( Compare(a,b) ==> b.Compare(a) ==> strcmp(a,b) )
+struct SvSortData
+{
+ const SvTreeListEntry* pLeft;
+ const SvTreeListEntry* pRight;
+};
+
+class SVT_DLLPUBLIC SvTreeList
+{
+ typedef std::vector<SvListView*> ListViewsType;
+
+ friend class SvListView;
+
+ ListViewsType aViewList;
+ sal_uLong nEntryCount;
+
+ Link aCloneLink;
+ Link aCompareLink;
+ SvSortMode eSortMode;
+
+ sal_uInt16 nRefCount;
+
+ sal_Bool bAbsPositionsValid;
+
+ SvTreeListEntry* FirstVisible() const { return First(); }
+ SvTreeListEntry* NextVisible( const SvListView*,SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const;
+ SvTreeListEntry* PrevVisible( const SvListView*,SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const;
+ SvTreeListEntry* LastVisible( const SvListView*,sal_uInt16* pDepth=0 ) const;
+ SvTreeListEntry* NextVisible( const SvListView*,SvTreeListEntry* pEntry, sal_uInt16& rDelta ) const;
+ SvTreeListEntry* PrevVisible( const SvListView*,SvTreeListEntry* pEntry, sal_uInt16& rDelta ) const;
+
+ sal_Bool IsEntryVisible( const SvListView*,SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* GetEntryAtVisPos( const SvListView*,sal_uLong nVisPos ) const;
+ sal_uLong GetVisiblePos( const SvListView*,SvTreeListEntry* pEntry ) const;
+ sal_uLong GetVisibleCount( SvListView* ) const;
+ sal_uLong GetVisibleChildCount( const SvListView*,SvTreeListEntry* pParent ) const;
+
+ SvTreeListEntry* FirstSelected( const SvListView*) const;
+ SvTreeListEntry* NextSelected( const SvListView*,SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* PrevSelected( const SvListView*,SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* LastSelected( const SvListView*) const;
+
+ sal_Bool Select( SvListView*,SvTreeListEntry* pEntry, sal_Bool bSelect=sal_True );
+ void SelectAll( SvListView*,sal_Bool bSelect ); // Does not call Select Handler
+ sal_uLong GetChildSelectionCount( const SvListView*,SvTreeListEntry* pParent ) const;
+
+ void Expand( SvListView*,SvTreeListEntry* pParent );
+ void Collapse( SvListView*,SvTreeListEntry* pParent );
+
+ SVT_DLLPRIVATE void SetAbsolutePositions();
+
+ SVT_DLLPRIVATE void CloneChildren(
+ SvTreeListEntries& rDst, sal_uLong& rCloneCount, SvTreeListEntries& rSrc, SvTreeListEntry* pNewParent) const;
+
+ /**
+ * Invalidate the cached position data to have them re-generated before
+ * the next access.
+ */
+ SVT_DLLPRIVATE void SetListPositions( SvTreeListEntries& rEntries );
+
+ // rPos is not changed for SortModeNone
+ SVT_DLLPRIVATE void GetInsertionPos(
+ SvTreeListEntry* pEntry,
+ SvTreeListEntry* pParent,
+ sal_uLong& rPos
+ );
+
+ SVT_DLLPRIVATE void ResortChildren( SvTreeListEntry* pParent );
+
+ SvTreeList(const SvTreeList&); // disabled
+ SvTreeList& operator= (const SvTreeList&); // disabled
+
+protected:
+ SvTreeListEntry* pRootItem;
+
+public:
+
+ SvTreeList();
+ virtual ~SvTreeList();
+
+ void InsertView( SvListView* );
+ void RemoveView( SvListView* );
+ sal_uLong GetViewCount() const
+ { return aViewList.size(); }
+
+ SvListView* GetView( sal_uLong nPos ) const
+ { return ( nPos < aViewList.size() ) ? aViewList[ nPos ] : NULL; }
+
+ void Broadcast(
+ sal_uInt16 nActionId,
+ SvTreeListEntry* pEntry1=0,
+ SvTreeListEntry* pEntry2=0,
+ sal_uLong nPos=0
+ );
+
+ // Notify all Listeners
+ void InvalidateEntry( SvTreeListEntry* );
+
+ sal_uLong GetEntryCount() const { return nEntryCount; }
+ SvTreeListEntry* First() const;
+ SvTreeListEntry* Next( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const;
+ SvTreeListEntry* Prev( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const;
+ SvTreeListEntry* Last() const;
+
+ SvTreeListEntry* FirstChild( SvTreeListEntry* pParent ) const;
+ SvTreeListEntry* NextSibling( SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* PrevSibling( SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* LastSibling( SvTreeListEntry* pEntry ) const;
+
+ sal_uLong Insert( SvTreeListEntry* pEntry,SvTreeListEntry* pPar,sal_uLong nPos=ULONG_MAX);
+ sal_uLong Insert( SvTreeListEntry* pEntry,sal_uLong nRootPos = ULONG_MAX )
+ { return Insert(pEntry, pRootItem, nRootPos ); }
+
+ void InsertTree( SvTreeListEntry* pTree, SvTreeListEntry* pTargetParent, sal_uLong nListPos );
+
+ // Entries need to be in the same Model!
+ void Move( SvTreeListEntry* pSource, SvTreeListEntry* pTarget );
+
+ // Creates ChildList if needed
+ sal_uLong Move( SvTreeListEntry* pSource, SvTreeListEntry* pTargetParent, sal_uLong nListPos);
+ void Copy( SvTreeListEntry* pSource, SvTreeListEntry* pTarget );
+ sal_uLong Copy( SvTreeListEntry* pSource, SvTreeListEntry* pTargetParent, sal_uLong nListPos);
+
+ bool Remove( const SvTreeListEntry* pEntry );
+ void Clear();
+
+ bool HasChildren( const SvTreeListEntry* pEntry ) const;
+ bool HasParent( const SvTreeListEntry* pEntry ) const;
+
+ bool IsChild(const SvTreeListEntry* pParent, const SvTreeListEntry* pChild) const;
+ SvTreeListEntry* GetEntry( SvTreeListEntry* pParent, sal_uLong nPos ) const;
+ SvTreeListEntry* GetEntry( sal_uLong nRootPos ) const;
+ SvTreeListEntry* GetEntryAtAbsPos( sal_uLong nAbsPos ) const;
+
+ const SvTreeListEntry* GetParent( const SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* GetParent( SvTreeListEntry* pEntry );
+
+ SvTreeListEntry* GetRootLevelParent( SvTreeListEntry* pEntry ) const;
+ const SvTreeListEntries& GetChildList( SvTreeListEntry* pParent ) const;
+ SvTreeListEntries& GetChildList( SvTreeListEntry* pParent );
+
+ std::pair<SvTreeListEntries::iterator, SvTreeListEntries::iterator>
+ GetChildIterators(SvTreeListEntry* pParent);
+
+ sal_uLong GetAbsPos( const SvTreeListEntry* pEntry ) const;
+ sal_uLong GetRelPos( const SvTreeListEntry* pChild ) const;
+
+ sal_uLong GetChildCount( const SvTreeListEntry* pParent ) const;
+ sal_uInt16 GetDepth( const SvTreeListEntry* pEntry ) const;
+ bool IsAtRootDepth( const SvTreeListEntry* pEntry ) const;
+
+ // The Model calls the Clone Link to clone Entries.
+ // Thus we do not need to derive from the Model if we derive from SvTreeListEntry.
+ // Declaration of the Clone Handler:
+ // DECL_LINK(CloneHdl,SvTreeListEntry*);
+ // The Handler needs to return a SvTreeListEntry*
+ SvTreeListEntry* Clone( SvTreeListEntry* pEntry, sal_uLong& nCloneCount ) const;
+ void SetCloneLink( const Link& rLink )
+ { aCloneLink=rLink; }
+
+ const Link& GetCloneLink() const
+ { return aCloneLink; }
+
+ virtual SvTreeListEntry* CloneEntry( SvTreeListEntry* pSource ) const; // Calls the Clone Link
+ virtual SvTreeListEntry* CreateEntry() const; // To create Entries
+
+ sal_uInt16 GetRefCount() const { return nRefCount; }
+ void SetRefCount( sal_uInt16 nRef ) { nRefCount = nRef; }
+
+ void SetSortMode( SvSortMode eMode ) { eSortMode = eMode; }
+ SvSortMode GetSortMode() const { return eSortMode; }
+ StringCompare Compare(const SvTreeListEntry* pLeft, const SvTreeListEntry* pRight) const;
+ void SetCompareHdl( const Link& rLink ) { aCompareLink = rLink; }
+ const Link& GetCompareHdl() const { return aCompareLink; }
+ void Resort();
+};
+
+class SVT_DLLPUBLIC SvListView
+{
+ friend class SvTreeList;
+
+ typedef boost::ptr_map<SvTreeListEntry*, SvViewDataEntry> SvDataTable;
+
+ sal_uLong nVisibleCount;
+ sal_uLong nSelectionCount;
+ sal_Bool bVisPositionsValid;
+
+ SVT_DLLPRIVATE void InitTable();
+ SVT_DLLPRIVATE void RemoveViewData( SvTreeListEntry* pParent );
+
+ SvDataTable maDataTable; // Mapping SvTreeListEntry -> ViewData
+
+ void ActionMoving( SvTreeListEntry* pEntry,SvTreeListEntry* pTargetPrnt,sal_uLong nChildPos);
+ void ActionMoved( SvTreeListEntry* pEntry,SvTreeListEntry* pTargetPrnt,sal_uLong nChildPos);
+ void ActionInserted( SvTreeListEntry* pEntry );
+ void ActionInsertedTree( SvTreeListEntry* pEntry );
+ void ActionRemoving( SvTreeListEntry* pEntry );
+ void ActionRemoved( SvTreeListEntry* pEntry );
+ void ActionClear();
+
+protected:
+ SvTreeList* pModel;
+
+public:
+ SvListView(); // Sets the Model to 0
+ virtual ~SvListView();
+ void Clear();
+ virtual void SetModel( SvTreeList* );
+ virtual void ModelNotification(
+ sal_uInt16 nActionId,
+ SvTreeListEntry* pEntry1,
+ SvTreeListEntry* pEntry2,
+ sal_uLong nPos
+ );
+
+ sal_uLong GetVisibleCount() const
+ { return pModel->GetVisibleCount( (SvListView*)this ); }
+
+ SvTreeListEntry* FirstVisible() const
+ { return pModel->FirstVisible(); }
+
+ SvTreeListEntry* NextVisible( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const
+ { return pModel->NextVisible(this,pEntry,pDepth); }
+
+ SvTreeListEntry* PrevVisible( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const
+ { return pModel->PrevVisible(this,pEntry,pDepth); }
+
+ SvTreeListEntry* LastVisible( sal_uInt16* pDepth=0 ) const
+ { return pModel->LastVisible(this,pDepth); }
+
+ SvTreeListEntry* NextVisible( SvTreeListEntry* pEntry, sal_uInt16& rDelta ) const
+ { return pModel->NextVisible(this,pEntry,rDelta); }
+
+ SvTreeListEntry* PrevVisible( SvTreeListEntry* pEntry, sal_uInt16& rDelta ) const
+ { return pModel->PrevVisible(this,pEntry,rDelta); }
+
+ sal_uLong GetSelectionCount() const
+ { return nSelectionCount; }
+
+ SvTreeListEntry* FirstSelected() const
+ { return pModel->FirstSelected(this); }
+
+ SvTreeListEntry* NextSelected( SvTreeListEntry* pEntry ) const
+ { return pModel->NextSelected(this,pEntry); }
+
+ SvTreeListEntry* PrevSelected( SvTreeListEntry* pEntry ) const
+ { return pModel->PrevSelected(this,pEntry); }
+
+ SvTreeListEntry* LastSelected() const
+ { return pModel->LastSelected(this); }
+ SvTreeListEntry* GetEntryAtAbsPos( sal_uLong nAbsPos ) const
+ { return pModel->GetEntryAtAbsPos(nAbsPos); }
+
+ SvTreeListEntry* GetEntryAtVisPos( sal_uLong nVisPos ) const
+ { return pModel->GetEntryAtVisPos((SvListView*)this,nVisPos); }
+
+ sal_uLong GetAbsPos( SvTreeListEntry* pEntry ) const
+ { return pModel->GetAbsPos(pEntry); }
+
+ sal_uLong GetVisiblePos( SvTreeListEntry* pEntry ) const
+ { return pModel->GetVisiblePos((SvListView*)this,pEntry); }
+
+ sal_uLong GetVisibleChildCount(SvTreeListEntry* pParent ) const
+ { return pModel->GetVisibleChildCount((SvListView*)this,pParent); }
+
+ sal_uLong GetChildSelectionCount( SvTreeListEntry* pParent ) const
+ { return pModel->GetChildSelectionCount((SvListView*)this,pParent); }
+
+ void Expand( SvTreeListEntry* pParent )
+ { pModel->Expand((SvListView*)this,pParent); }
+
+ void Collapse( SvTreeListEntry* pParent )
+ { pModel->Collapse((SvListView*)this,pParent); }
+
+ sal_Bool Select( SvTreeListEntry* pEntry, sal_Bool bSelect=sal_True )
+ { return pModel->Select((SvListView*)this,pEntry,bSelect); }
+
+ // Does not call the Select Handler
+ virtual void SelectAll( sal_Bool bSelect, sal_Bool )
+ { pModel->SelectAll((SvListView*)this, bSelect); }
+
+ sal_Bool IsEntryVisible( SvTreeListEntry* pEntry ) const
+ { return pModel->IsEntryVisible((SvListView*)this,pEntry); }
+
+ sal_Bool IsExpanded( SvTreeListEntry* pEntry ) const;
+ sal_Bool IsSelected( SvTreeListEntry* pEntry ) const;
+ void SetEntryFocus( SvTreeListEntry* pEntry, sal_Bool bFocus );
+ const SvViewDataEntry* GetViewData( const SvTreeListEntry* pEntry ) const;
+ SvViewDataEntry* GetViewData( SvTreeListEntry* pEntry );
+ sal_Bool HasViewData() const
+ { return maDataTable.size() > 1; } // There's always a ROOT
+
+ virtual SvViewDataEntry* CreateViewData( SvTreeListEntry* pEntry );
+ virtual void InitViewData( SvViewDataEntry*, SvTreeListEntry* pEntry );
+
+ virtual void ModelHasCleared();
+ virtual void ModelHasInserted( SvTreeListEntry* pEntry );
+ virtual void ModelHasInsertedTree( SvTreeListEntry* pEntry );
+ virtual void ModelIsMoving(
+ SvTreeListEntry* pSource,
+ SvTreeListEntry* pTargetParent,
+ sal_uLong nPos
+ );
+ virtual void ModelHasMoved( SvTreeListEntry* pSource );
+ virtual void ModelIsRemoving( SvTreeListEntry* pEntry );
+ virtual void ModelHasRemoved( SvTreeListEntry* pEntry );
+ virtual void ModelHasEntryInvalidated( SvTreeListEntry* pEntry );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
new file mode 100644
index 000000000000..180050560bf9
--- /dev/null
+++ b/include/svtools/treelistbox.hxx
@@ -0,0 +1,806 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __SVTOOLS_TREELISTBOX_HXX__
+#define __SVTOOLS_TREELISTBOX_HXX__
+
+#include "svtools/svtdllapi.h"
+
+#include <deque>
+#include <vector>
+
+#include <vcl/ctrl.hxx>
+#include <vcl/seleng.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/timer.hxx>
+#include <vcl/accel.hxx>
+#include <vcl/mnemonicengine.hxx>
+#include <vcl/quickselectionengine.hxx>
+#include <vcl/image.hxx>
+#include <tools/gen.hxx>
+#include <tools/contnr.hxx>
+#include <svtools/treelist.hxx>
+#include <svtools/transfer.hxx>
+
+class Application;
+class SvTreeListBox;
+class SvTreeListEntry;
+struct SvViewDataItem;
+class SvViewDataEntry;
+class SvInplaceEdit2;
+class SvLBoxString;
+class SvLBoxButton;
+class SvLBoxContextBmp;
+class SvLBoxBmp;
+class SvImpLBox;
+class SvLBoxButtonData;
+struct SvLBoxDDInfo;
+
+namespace utl {
+ class AccessibleStateSetHelper;
+}
+
+enum SvLBoxButtonKind
+{
+ SvLBoxButtonKind_enabledCheckbox,
+ SvLBoxButtonKind_disabledCheckbox,
+ SvLBoxButtonKind_staticImage
+};
+
+enum SvButtonState { SV_BUTTON_UNCHECKED, SV_BUTTON_CHECKED, SV_BUTTON_TRISTATE };
+
+// *********************************************************************
+// *************************** Tabulators ******************************
+// *********************************************************************
+
+#define SV_LBOXTAB_DYNAMIC 0x0001 // Item's output column changes according to the Child Depth
+#define SV_LBOXTAB_ADJUST_RIGHT 0x0002 // Item's right margin at the tabulator
+#define SV_LBOXTAB_ADJUST_LEFT 0x0004 // Left margin
+#define SV_LBOXTAB_ADJUST_CENTER 0x0008 // Center the item at the tabulator
+#define SV_LBOXTAB_ADJUST_NUMERIC 0x0010 // Decimal point at the tabulator (strings)
+
+// Is not supported anymore! The focus is now controlled by selection!
+#define SV_LBOXTAB_SHOW_FOCUS 0x0020 // Visualize focus
+
+#define SV_LBOXTAB_SHOW_SELECTION 0x0040 // Visualize selection state
+ // Item needs to be able to return the surrounding polygon (D'n'D cursor)
+#define SV_LBOXTAB_EDITABLE 0x0100 // Item editable at the tabulator
+#define SV_LBOXTAB_PUSHABLE 0x0200 // Item acts like a Button
+#define SV_LBOXTAB_INV_ALWAYS 0x0400 // Always delete the background
+#define SV_LBOXTAB_FORCE 0x0800 // Switch off the default calculation of the first tabulator
+ // (on which Abo Tabpage/Extras/Option/Customize, etc. rely on)
+ // The first tab's position corresponds precisely to the Flags set
+ // and column widths
+
+#define SV_TAB_BORDER 8
+
+#define SV_ENTRYHEIGHTOFFS_PIXEL 2
+
+#define TREEFLAG_CHKBTN 0x0001
+#define TREEFLAG_USESEL 0x0002
+#define TREEFLAG_MANINS 0x0004
+#define TREEFLAG_RECALCTABS 0x0008
+
+typedef sal_Int64 ExtendedWinBits;
+
+// disable the behavior of automatically selecting a "CurEntry" upon painting the control
+#define EWB_NO_AUTO_CURENTRY 0x00000001
+
+#define SV_ITEM_ID_LBOXSTRING 1
+#define SV_ITEM_ID_LBOXBMP 2
+#define SV_ITEM_ID_LBOXBUTTON 3
+#define SV_ITEM_ID_LBOXCONTEXTBMP 4
+
+class SvLBoxTab
+{
+ long nPos;
+ void* pUserData;
+public:
+ SvLBoxTab();
+ SvLBoxTab( long nPos, sal_uInt16 nFlags=SV_LBOXTAB_ADJUST_LEFT );
+ SvLBoxTab( const SvLBoxTab& );
+ ~SvLBoxTab();
+
+ sal_uInt16 nFlags;
+
+ void SetUserData( void* pPtr ) { pUserData = pPtr; }
+ void* GetUserData() const { return pUserData; }
+ sal_Bool IsDynamic() const { return (sal_Bool)((nFlags & SV_LBOXTAB_DYNAMIC)!=0); }
+ void SetPos( long nNewPos) { nPos = nNewPos; }
+ long GetPos() const { return nPos; }
+ long CalcOffset( long nItemLength, long nTabWidth );
+ // long CalcOffset( const String&, const OutputDevice& );
+ sal_Bool IsEditable() const { return (sal_Bool)((nFlags & SV_LBOXTAB_EDITABLE)!=0); }
+ sal_Bool IsPushable() const { return (sal_Bool)((nFlags & SV_LBOXTAB_PUSHABLE)!=0); }
+};
+
+// *********************************************************************
+// ****************************** Items ********************************
+// *********************************************************************
+
+class SVT_DLLPUBLIC SvLBoxItem
+{
+public:
+ SvLBoxItem( SvTreeListEntry*, sal_uInt16 nFlags );
+ SvLBoxItem();
+ virtual ~SvLBoxItem();
+ virtual sal_uInt16 GetType() const = 0;
+ const Size& GetSize(const SvTreeListBox* pView, const SvTreeListEntry* pEntry) const;
+ const Size& GetSize(const SvViewDataEntry* pData, sal_uInt16 nItemPos) const;
+
+ virtual void Paint(
+ const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) = 0;
+
+ virtual void InitViewData( SvTreeListBox* pView, SvTreeListEntry* pEntry,
+ // If != 0: this Pointer must be used!
+ // If == 0: it needs to be retrieved via the View
+ SvViewDataItem* pViewData = 0) = 0;
+ virtual SvLBoxItem* Create() const = 0;
+ // View-dependent data is not cloned
+ virtual void Clone( SvLBoxItem* pSource ) = 0;
+};
+
+inline SvLBoxItem* new_clone(const SvLBoxItem& rSrc)
+{
+ SvLBoxItem* p = rSrc.Create();
+ p->Clone(const_cast<SvLBoxItem*>(&rSrc));
+ return p;
+}
+
+inline void delete_clone(const SvLBoxItem* p)
+{
+ delete p;
+}
+
+// *********************************************************************
+// ****************************** SvTreeListBox ************************
+// *********************************************************************
+
+#define WB_FORCE_SELECTION ((WinBits)0x8000)
+
+#define DragDropMode sal_uInt16
+#define SV_DRAGDROP_NONE (DragDropMode)0x0000
+#define SV_DRAGDROP_CTRL_MOVE (DragDropMode)0x0001
+#define SV_DRAGDROP_CTRL_COPY (DragDropMode)0x0002
+#define SV_DRAGDROP_APP_MOVE (DragDropMode)0x0004
+#define SV_DRAGDROP_APP_COPY (DragDropMode)0x0008
+#define SV_DRAGDROP_APP_DROP (DragDropMode)0x0010
+// Entries may be dropped via the uppermost Entry
+// The DropTarget is 0 in that case
+#define SV_DRAGDROP_ENABLE_TOP (DragDropMode)0x0020
+
+#define SVLISTBOX_ID_LBOX 0 // for SvTreeListBox::GetType()
+
+#define SVLBOX_IN_EDT 0x0001
+#define SVLBOX_EDT_ENABLED 0x0002
+#define SVLBOX_IS_EXPANDING 0x0004
+#define SVLBOX_IS_TRAVELSELECT 0x0008
+#define SVLBOX_TARGEMPH_VIS 0x0010
+#define SVLBOX_EDTEND_CALLED 0x0020
+
+struct SvTreeListBoxImpl;
+
+class SVT_DLLPUBLIC SvTreeListBox
+ :public Control
+ ,public SvListView
+ ,public DropTargetHelper
+ ,public DragSourceHelper
+ ,public ::vcl::IMnemonicEntryList
+ ,public ::vcl::ISearchableStringList
+{
+ friend class SvImpLBox;
+ friend class TreeControlPeer;
+
+ SvTreeListBoxImpl* mpImpl;
+ SvImpLBox* pImp;
+ Link aCheckButtonHdl;
+ Link aScrolledHdl;
+ Link aExpandedHdl;
+ Link aExpandingHdl;
+ Link aSelectHdl;
+ Link aDeselectHdl;
+
+ Accelerator aInpEditAcc;
+ Image aPrevInsertedExpBmp;
+ Image aPrevInsertedColBmp;
+ Image aCurInsertedExpBmp;
+ Image aCurInsertedColBmp;
+
+ short nContextBmpWidthMax;
+ short nEntryHeight;
+ short nEntryHeightOffs;
+ short nIndent;
+ short nFocusWidth;
+ sal_uInt16 nFirstSelTab;
+ sal_uInt16 nLastSelTab;
+ long mnCheckboxItemWidth;
+ bool mbContextBmpExpanded;
+
+ SvTreeListEntry* pHdlEntry;
+ SvLBoxItem* pHdlItem;
+
+ DragDropMode nDragDropMode;
+ DragDropMode nOldDragMode;
+ SelectionMode eSelMode;
+ sal_Int8 nDragOptions;
+
+ SvTreeListEntry* pEdEntry;
+ SvLBoxItem* pEdItem;
+
+protected:
+ Link aDoubleClickHdl;
+ SvTreeListEntry* pTargetEntry;
+ SvLBoxButtonData* pCheckButtonData;
+ std::vector<SvLBoxTab*> aTabs;
+ sal_uInt16 nTreeFlags;
+ sal_uInt16 nImpFlags;
+ // Move/CopySelection: Position of the current Entry in SelectionList
+ sal_uInt16 nCurEntrySelPos;
+
+private:
+ void SetBaseModel(SvTreeList* pNewModel);
+
+ DECL_DLLPRIVATE_LINK( CheckButtonClick, SvLBoxButtonData * );
+ DECL_DLLPRIVATE_LINK( TextEditEndedHdl_Impl, void * );
+ // Handler that is called by TreeList to clone an Entry
+ DECL_DLLPRIVATE_LINK( CloneHdl_Impl, SvTreeListEntry* );
+
+ // Handler and methods for Drag - finished handler.
+ // The Handle retrieved by GetDragFinishedHdl can be set on the
+ // TransferDataContainer. This link is a callback for the DragFinished
+ // call. The AddBox method is called from the GetDragFinishedHdl() and the
+ // remove is called in the link callback and in the dtor. So it can't be
+ // called for a deleted object.
+ SVT_DLLPRIVATE static void AddBoxToDDList_Impl( const SvTreeListBox& rB );
+ SVT_DLLPRIVATE static void RemoveBoxFromDDList_Impl( const SvTreeListBox& rB );
+ DECL_DLLPRIVATE_STATIC_LINK( SvTreeListBox, DragFinishHdl_Impl, sal_Int8* );
+
+protected:
+
+ sal_Bool CheckDragAndDropMode( SvTreeListBox* pSource, sal_Int8 );
+ void ImplShowTargetEmphasis( SvTreeListEntry* pEntry, sal_Bool bShow);
+ void EnableSelectionAsDropTarget( sal_Bool bEnable = sal_True,
+ sal_Bool bWithChildren = sal_True );
+ // Standard impl returns 0; must be overloaded by derived classes which support D'n'D
+ using Window::GetDropTarget;
+ virtual SvTreeListEntry* GetDropTarget( const Point& );
+
+ // Put View-specific data into the Dragserver
+ // Is called at the SourceView (in BeginDrag Handler)
+ virtual void WriteDragServerInfo( const Point&, SvLBoxDDInfo* );
+ // Is called at the TargetView (in Drop Handler)
+ virtual void ReadDragServerInfo( const Point&,SvLBoxDDInfo* );
+
+ // Invalidate children on enable/disable
+ virtual void StateChanged( StateChangedType eType );
+
+ virtual sal_uLong Insert( SvTreeListEntry* pEnt,SvTreeListEntry* pPar,sal_uLong nPos=LIST_APPEND);
+ virtual sal_uLong Insert( SvTreeListEntry* pEntry,sal_uLong nRootPos = LIST_APPEND );
+
+ // In-place editing
+ SvInplaceEdit2* pEdCtrl;
+ void EditText( const String&, const Rectangle&,const Selection&);
+ void EditText( const String&, const Rectangle&,const Selection&, sal_Bool bMulti);
+ void EditTextMultiLine( const String&, const Rectangle&,const Selection&);
+ void CancelTextEditing();
+ sal_Bool EditingCanceled() const;
+ bool IsEmptyTextAllowed() const;
+
+ // Return value must be derived from SvViewDataEntry!
+ virtual SvViewDataEntry* CreateViewData( SvTreeListEntry* );
+ // InitViewData is called right after CreateViewData
+ // The Entry is has not yet been added to the View in InitViewData!
+ virtual void InitViewData( SvViewDataEntry*, SvTreeListEntry* pEntry );
+ // Calls InitViewData for all Items
+ void RecalcViewData();
+ // Callback of RecalcViewData
+ virtual void ViewDataInitialized( SvTreeListEntry* );
+
+ // Handler and methods for Drag - finished handler. This link can be set
+ // to the TransferDataContainer. The AddBox/RemoveBox methods must be
+ // called before the StartDrag call.
+ // The Remove will be called from the handler, which then calls DragFinish.
+ // The Remove is also called in the DTOR of the SvTreeListBox -
+ // so it can't be called for a deleted object.
+ Link GetDragFinishedHdl() const;
+
+ // For asynchronous D'n'D
+ sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, SvTreeListBox* pSourceView );
+
+ void OnCurrentEntryChanged();
+
+ // IMnemonicEntryList
+ virtual const void* FirstSearchEntry( String& _rEntryText ) const;
+ virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const;
+ virtual void SelectSearchEntry( const void* _pEntry );
+ virtual void ExecuteSearchEntry( const void* _pEntry ) const;
+
+ // ISearchableStringList
+ virtual ::vcl::StringEntryIdentifier CurrentEntry( String& _out_entryText ) const;
+ virtual ::vcl::StringEntryIdentifier NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const;
+ virtual void SelectEntry( ::vcl::StringEntryIdentifier _entry );
+
+public:
+
+ SvTreeListBox( Window* pParent, WinBits nWinStyle=0 );
+ SvTreeListBox( Window* pParent, const ResId& rResId );
+ virtual ~SvTreeListBox();
+
+ SvTreeList* GetModel() const { return pModel; }
+ using SvListView::SetModel;
+ void SetModel(SvTreeList* pNewModel);
+
+ sal_uLong GetEntryCount() const {return pModel->GetEntryCount();}
+ SvTreeListEntry* First() const { return pModel->First(); }
+ SvTreeListEntry* Next( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const { return pModel->Next(pEntry,pDepth); }
+ SvTreeListEntry* Prev( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const { return pModel->Prev(pEntry,pDepth); }
+ SvTreeListEntry* Last() const { return pModel->Last(); }
+
+ SvTreeListEntry* FirstChild( SvTreeListEntry* pParent ) const;
+ SvTreeListEntry* NextSibling( SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* PrevSibling( SvTreeListEntry* pEntry ) const;
+
+ sal_Bool CopySelection( SvTreeListBox* pSource, SvTreeListEntry* pTarget );
+ sal_Bool MoveSelection( SvTreeListBox* pSource, SvTreeListEntry* pTarget );
+ sal_Bool MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, SvTreeListEntry* pTarget, sal_Bool bAllowCopyFallback );
+ void RemoveSelection();
+
+ DragDropMode GetDragDropMode() const { return nDragDropMode; }
+ SelectionMode GetSelectionMode() const { return eSelMode; }
+
+ // pParent == 0 -> Root level
+ SvTreeListEntry* GetEntry( SvTreeListEntry* pParent, sal_uLong nPos ) const;
+ SvTreeListEntry* GetEntry( sal_uLong nRootPos ) const;
+
+ SvTreeListEntry* GetEntryFromPath( const ::std::deque< sal_Int32 >& _rPath ) const;
+ void FillEntryPath( SvTreeListEntry* pEntry, ::std::deque< sal_Int32 >& _rPath ) const;
+
+ using Window::GetParent;
+ const SvTreeListEntry* GetParent( const SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* GetParent( SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* GetRootLevelParent(SvTreeListEntry* pEntry ) const;
+
+ using Window::GetChildCount;
+ sal_uLong GetChildCount( SvTreeListEntry* pParent ) const;
+ sal_uLong GetLevelChildCount( SvTreeListEntry* pParent ) const;
+
+ SvViewDataEntry* GetViewDataEntry( SvTreeListEntry* pEntry ) const;
+ SvViewDataItem* GetViewDataItem(SvTreeListEntry*, SvLBoxItem*);
+ const SvViewDataItem* GetViewDataItem(const SvTreeListEntry*, const SvLBoxItem*) const;
+
+ bool IsInplaceEditingEnabled() const { return ((nImpFlags & SVLBOX_EDT_ENABLED) != 0); }
+ bool IsEditingActive() const { return ((nImpFlags & SVLBOX_IN_EDT) != 0); }
+ void EndEditing( bool bCancel = false );
+ void ForbidEmptyText();
+
+ void Clear();
+
+ /** Enables or disables mnemonic characters in the entry texts.
+
+ If mnemonics are enabled, then entries are selected and made current when
+ there mnemonic character is pressed. If there are multiple entries with the
+ same mnemonic, the selection cycles between them.
+
+ Entries with an collapsed ancestor are not included in the calculation of
+ mnemonics. That is, if you press the accelerator key of an invisible
+ entry, then this entry is *not* selected.
+
+ Be aware that enabling mnemonics gets more expensive as you add to the list.
+ */
+ void EnableEntryMnemonics( bool _bEnable = true );
+ bool IsEntryMnemonicsEnabled() const;
+
+ /** Handles the given key event.
+
+ At the moment this merely checks for accelerator keys, if entry mnemonics
+ are enabled.
+
+ This method may come in handy if you want to use keyboard acceleration
+ while the control does not have the focus.
+
+ If the key event describes the pressing of a shortcut for an entry,
+ then SelectSearchEntry resp. ExecuteSearchEntry are called.
+
+ @see IMnemonicEntryList
+ @see MnemonicEngine
+
+ @return
+ <TRUE/> if the event has been consumed, <FALSE/> otherwise.
+ */
+ bool HandleKeyInput( const KeyEvent& rKEvt );
+
+ void SetSelectHdl( const Link& rNewHdl ) {aSelectHdl=rNewHdl; }
+ void SetDeselectHdl( const Link& rNewHdl ) {aDeselectHdl=rNewHdl; }
+ void SetDoubleClickHdl(const Link& rNewHdl) {aDoubleClickHdl=rNewHdl;}
+ const Link& GetSelectHdl() const { return aSelectHdl; }
+ const Link& GetDeselectHdl() const { return aDeselectHdl; }
+ const Link& GetDoubleClickHdl() const { return aDoubleClickHdl; }
+ void SetExpandingHdl(const Link& rNewHdl){aExpandingHdl=rNewHdl;}
+ void SetExpandedHdl(const Link& rNewHdl){aExpandedHdl=rNewHdl;}
+ const Link& GetExpandingHdl() const { return aExpandingHdl; }
+
+ virtual void ExpandedHdl();
+ virtual long ExpandingHdl();
+ virtual void SelectHdl();
+ virtual void DeselectHdl();
+ virtual sal_Bool DoubleClickHdl();
+ sal_Bool IsTravelSelect() const { return (sal_Bool)((nImpFlags&SVLBOX_IS_TRAVELSELECT)!=0);}
+ SvTreeListEntry* GetHdlEntry() const { return pHdlEntry; }
+ SvLBoxItem* GetHdlItem() const;
+
+ // Is called for an Entry that gets expanded with the Flag
+ // ENTRYFLAG_CHILDREN_ON_DEMAND set.
+ virtual void RequestingChildren( SvTreeListEntry* pParent );
+
+ // Drag & Drop
+ // New D'n'D API
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+ virtual DragDropMode NotifyStartDrag( TransferDataContainer& rData,
+ SvTreeListEntry* );
+ virtual void DragFinished( sal_Int8 nDropAction );
+ virtual sal_Bool NotifyAcceptDrop( SvTreeListEntry* );
+
+ void SetDragOptions( sal_Int8 nOptions ) { nDragOptions = nOptions; }
+ sal_Int8 GetDragOptions() const { return nDragOptions; }
+
+ SvTreeListBox* GetSourceView() const;
+
+ virtual void NotifyRemoving( SvTreeListEntry* );
+ virtual SvTreeListEntry* CloneEntry( SvTreeListEntry* pSource );
+ virtual SvTreeListEntry* CreateEntry() const; // To create new Entries
+
+ // Return value: sal_True == Ok, sal_False == Cancel
+ virtual sal_Bool NotifyMoving(
+ SvTreeListEntry* pTarget, // D'n'D DropPosition in this->GetModel()
+ SvTreeListEntry* pEntry, // Entry to be moved from GetSourceListBox()->GetModel()
+ SvTreeListEntry*& rpNewParent, // New TargetParent
+ sal_uLong& rNewChildPos); // The TargetParent's position in Childlist
+
+ // Return value: sal_True == Ok, sal_False == Cancel
+ virtual sal_Bool NotifyCopying(
+ SvTreeListEntry* pTarget, // D'n'D DropPosition in this->GetModel()
+ SvTreeListEntry* pEntry, // Entry to be copied from GetSourceListBox()->GetModel()
+ SvTreeListEntry*& rpNewParent, // New TargetParent
+ sal_uLong& rNewChildPos); // The TargetParent's position in Childlist
+
+ // ACCESSIBILITY ==========================================================
+
+ /** Creates and returns the accessible object of the Box. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+ /** Fills the StateSet with all states (except DEFUNC, done by the accessible object). */
+ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet ) const;
+
+ /** Fills the StateSet of one entry. */
+ virtual void FillAccessibleEntryStateSet( SvTreeListEntry* pEntry, ::utl::AccessibleStateSetHelper& rStateSet ) const;
+
+ /** Calculate and return the bounding rectangle of an entry.
+ @param pEntry
+ The entry.
+ @return The bounding rectangle of an entry. */
+ virtual Rectangle GetBoundingRect( SvTreeListEntry* pEntry );
+
+ /** Enables, that one cell of a tablistbox entry can be focused */
+ void EnableCellFocus();
+
+protected:
+ using SvListView::Expand;
+ using SvListView::Collapse;
+ using SvListView::Select;
+ using SvListView::SelectAll;
+
+ SVT_DLLPRIVATE short GetHeightOffset( const Image& rBmp, Size& rLogicSize);
+ SVT_DLLPRIVATE short GetHeightOffset( const Font& rFont, Size& rLogicSize);
+
+ SVT_DLLPRIVATE void SetEntryHeight( SvTreeListEntry* pEntry );
+ SVT_DLLPRIVATE void AdjustEntryHeight( const Image& rBmp );
+ SVT_DLLPRIVATE void AdjustEntryHeight( const Font& rFont );
+
+ SVT_DLLPRIVATE void ImpEntryInserted( SvTreeListEntry* pEntry );
+ SVT_DLLPRIVATE long PaintEntry1( SvTreeListEntry*, long nLine,
+ sal_uInt16 nTabFlagMask=0xffff,
+ sal_Bool bHasClipRegion=sal_False );
+
+ SVT_DLLPRIVATE void InitTreeView();
+ SVT_DLLPRIVATE SvLBoxItem* GetItem_Impl( SvTreeListEntry*, long nX, SvLBoxTab** ppTab,
+ sal_uInt16 nEmptyWidth );
+ SVT_DLLPRIVATE void ImplInitStyle();
+
+protected:
+
+ void EditItemText( SvTreeListEntry* pEntry, SvLBoxString* pItem,
+ const Selection& );
+ void EditedText( const XubString& );
+
+ // Recalculate all tabs depending on TreeListStyle and Bitmap sizes
+ // Is called automatically when inserting/changing Bitmaps, changing the Model etc.
+ virtual void SetTabs();
+ void SetTabs_Impl();
+ void AddTab( long nPos,sal_uInt16 nFlags=SV_LBOXTAB_ADJUST_LEFT,
+ void* pUserData = 0 );
+ sal_uInt16 TabCount() const { return aTabs.size(); }
+ SvLBoxTab* GetFirstDynamicTab() const;
+ SvLBoxTab* GetFirstDynamicTab( sal_uInt16& rTabPos ) const;
+ SvLBoxTab* GetFirstTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
+ SvLBoxTab* GetLastTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
+ SvLBoxTab* GetTab( SvTreeListEntry*, SvLBoxItem* ) const;
+ void ClearTabList();
+
+ virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind);
+
+ virtual void NotifyBeginScroll();
+ virtual void NotifyEndScroll();
+ // nLines == 0 => horizontal Scrolling
+ virtual void NotifyScrolling( long nLines );
+ virtual void NotifyScrolled();
+ void SetScrolledHdl( const Link& rLink ) { aScrolledHdl = rLink; }
+ const Link& GetScrolledHdl() const { return aScrolledHdl; }
+ long GetXOffset() const { return GetMapMode().GetOrigin().X(); }
+
+ // Is called _before_ Areas in the Control are invalidated.
+ // This can be used to hide Elements which are painted from outside into the Control
+ virtual void NotifyInvalidating();
+
+ virtual void Command( const CommandEvent& rCEvt );
+
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void CursorMoved( SvTreeListEntry* pNewCursor );
+ virtual void PreparePaint( SvTreeListEntry* );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground);
+ sal_Bool IsCellFocusEnabled() const;
+ bool SetCurrentTabPos( sal_uInt16 _nNewPos );
+ sal_uInt16 GetCurrentTabPos() const;
+ void CallImplEventListeners(sal_uLong nEvent, void* pData);
+
+ void ImplEditEntry( SvTreeListEntry* pEntry );
+
+ sal_Bool AreChildrenTransient() const;
+ void SetChildrenNotTransient();
+
+public:
+
+ void SetExtendedWinBits( ExtendedWinBits _nBits );
+
+ void DisconnectFromModel();
+
+ void EnableCheckButton( SvLBoxButtonData* );
+ void SetCheckButtonData( SvLBoxButtonData* );
+ void SetNodeBitmaps( const Image& rCollapsedNodeBmp, const Image& rExpandedNodeBmp );
+
+ /** Returns the default image which clients should use for expanded nodes, to have a consistent user
+ interface experience in the whole product.
+ */
+ static const Image& GetDefaultExpandedNodeImage( );
+
+ /** Returns the default image which clients should use for expanded nodes, to have a consistent user
+ interface experience in the whole product.
+ */
+ static const Image& GetDefaultCollapsedNodeImage( );
+
+ /** Sets default bitmaps for collapsed and expanded nodes.
+ */
+ inline void SetNodeDefaultImages( )
+ {
+ SetNodeBitmaps(
+ GetDefaultCollapsedNodeImage( ),
+ GetDefaultExpandedNodeImage( )
+ );
+ }
+
+ virtual SvTreeListEntry* InsertEntry( const XubString& rText, SvTreeListEntry* pParent = 0,
+ sal_Bool bChildrenOnDemand = sal_False,
+ sal_uLong nPos=LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ virtual SvTreeListEntry* InsertEntry( const XubString& rText,
+ const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp,
+ SvTreeListEntry* pParent = 0,
+ sal_Bool bChildrenOnDemand = sal_False,
+ sal_uLong nPos = LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ const Image& GetDefaultExpandedEntryBmp( ) const;
+ const Image& GetDefaultCollapsedEntryBmp( ) const;
+
+ void SetDefaultExpandedEntryBmp( const Image& rBmp );
+ void SetDefaultCollapsedEntryBmp( const Image& rBmp );
+
+ void SetCheckButtonState( SvTreeListEntry*, SvButtonState );
+ SvButtonState GetCheckButtonState( SvTreeListEntry* ) const;
+
+ void SetEntryText(SvTreeListEntry*, const XubString& );
+ void SetExpandedEntryBmp( SvTreeListEntry* _pEntry, const Image& _rImage );
+ void SetCollapsedEntryBmp( SvTreeListEntry* _pEntry, const Image& _rImage );
+
+ virtual String GetEntryText( SvTreeListEntry* pEntry ) const;
+ String SearchEntryText( SvTreeListEntry* pEntry ) const;
+ const Image& GetExpandedEntryBmp(const SvTreeListEntry* _pEntry ) const;
+ const Image& GetCollapsedEntryBmp(const SvTreeListEntry* _pEntry ) const;
+
+ void SetCheckButtonHdl( const Link& rLink ) { aCheckButtonHdl=rLink; }
+ Link GetCheckButtonHdl() const { return aCheckButtonHdl; }
+ virtual void CheckButtonHdl();
+
+ void SetSublistOpenWithReturn( sal_Bool bMode = sal_True ); // open/close sublist with return/enter
+ void SetSublistOpenWithLeftRight( sal_Bool bMode = sal_True ); // open/close sublist with cursor left/right
+
+ void EnableInplaceEditing( bool bEnable );
+ // Edits the Entry's first StringItem, 0 == Cursor
+ void EditEntry( SvTreeListEntry* pEntry = NULL );
+ virtual sal_Bool EditingEntry( SvTreeListEntry* pEntry, Selection& );
+ virtual sal_Bool EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewText );
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ void SetUpdateMode( sal_Bool );
+
+ virtual void ModelHasCleared();
+ virtual void ModelHasInserted( SvTreeListEntry* pEntry );
+ virtual void ModelHasInsertedTree( SvTreeListEntry* pEntry );
+ virtual void ModelIsMoving(SvTreeListEntry* pSource,
+ SvTreeListEntry* pTargetParent, sal_uLong nChildPos );
+ virtual void ModelHasMoved(SvTreeListEntry* pSource );
+ virtual void ModelIsRemoving( SvTreeListEntry* pEntry );
+ virtual void ModelHasRemoved( SvTreeListEntry* pEntry );
+ void ModelHasEntryInvalidated( SvTreeListEntry* pEntry );
+
+ void ShowTargetEmphasis( SvTreeListEntry*, sal_Bool bShow );
+ void ScrollOutputArea( short nDeltaEntries );
+
+ short GetEntryHeight() const { return nEntryHeight; }
+ void SetEntryHeight( short nHeight, sal_Bool bAlways = sal_False );
+ Size GetOutputSizePixel() const;
+ short GetIndent() const { return nIndent; }
+ void SetIndent( short nIndent );
+ void SetSpaceBetweenEntries( short nSpace );
+ short GetSpaceBetweenEntries() const {return nEntryHeightOffs;}
+ Point GetEntryPosition( SvTreeListEntry* ) const;
+ void ShowEntry( SvTreeListEntry* ); // !!!OBSOLETE, use MakeVisible
+ void MakeVisible( SvTreeListEntry* pEntry );
+ void MakeVisible( SvTreeListEntry* pEntry, sal_Bool bMoveToTop );
+
+ void SetCollapsedNodeBmp( const Image& );
+ void SetExpandedNodeBmp( const Image& );
+ Image GetExpandedNodeBmp( ) const;
+
+ void SetFont( const Font& rFont );
+
+ using Window::SetCursor;
+ void SetCursor( SvTreeListEntry* pEntry, sal_Bool bForceNoSelect = sal_False );
+
+ SvTreeListEntry* GetEntry( const Point& rPos, sal_Bool bHit = sal_False ) const;
+
+ void PaintEntry( SvTreeListEntry* );
+ long PaintEntry( SvTreeListEntry*, long nLine,
+ sal_uInt16 nTabFlagMask=0xffff );
+ virtual Rectangle GetFocusRect( SvTreeListEntry*, long nLine );
+ // Respects indentation
+ virtual long GetTabPos( SvTreeListEntry*, SvLBoxTab* );
+ void InvalidateEntry( SvTreeListEntry* );
+ SvLBoxItem* GetItem( SvTreeListEntry*, long nX, SvLBoxTab** ppTab);
+ SvLBoxItem* GetItem( SvTreeListEntry*, long nX );
+
+ void SetDragDropMode( DragDropMode );
+ void SetSelectionMode( SelectionMode );
+
+ sal_Bool Expand( SvTreeListEntry* pParent );
+ sal_Bool Collapse( SvTreeListEntry* pParent );
+ sal_Bool Select( SvTreeListEntry* pEntry, sal_Bool bSelect=sal_True );
+ sal_uLong SelectChildren( SvTreeListEntry* pParent, sal_Bool bSelect );
+ virtual void SelectAll( sal_Bool bSelect, sal_Bool bPaint = sal_True );
+
+ void SetCurEntry( SvTreeListEntry* _pEntry );
+ SvTreeListEntry* GetCurEntry() const;
+
+ using Window::Invalidate;
+ virtual void Invalidate( sal_uInt16 nFlags = 0);
+ virtual void Invalidate( const Rectangle&, sal_uInt16 nFlags = 0 );
+
+ void SetHighlightRange(sal_uInt16 nFirstTab=0,sal_uInt16 nLastTab=0xffff);
+
+ // A Parent's Children are turned into Children of the Parent which comes next in hierarchy
+ void RemoveParentKeepChildren( SvTreeListEntry* pParent );
+
+ DECL_LINK( DefaultCompare, SvSortData* );
+ virtual void ModelNotification( sal_uInt16 nActionId, SvTreeListEntry* pEntry1,
+ SvTreeListEntry* pEntry2, sal_uLong nPos );
+
+ void EndSelection();
+ void RepaintScrollBars() const;
+ ScrollBar* GetVScroll();
+ ScrollBar* GetHScroll();
+ void EnableAsyncDrag( sal_Bool b );
+
+ SvTreeListEntry* GetFirstEntryInView() const;
+ SvTreeListEntry* GetNextEntryInView(SvTreeListEntry*) const;
+ SvTreeListEntry* GetLastEntryInView() const;
+ void ScrollToAbsPos( long nPos );
+
+ void ShowFocusRect( const SvTreeListEntry* pEntry );
+ void InitStartEntry();
+
+ virtual PopupMenu* CreateContextMenu( void );
+ virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry );
+
+ void EnableContextMenuHandling( void );
+ void EnableContextMenuHandling( sal_Bool bEnable );
+ sal_Bool IsContextMenuHandlingEnabled( void ) const;
+
+ void EnableList( bool _bEnable );
+
+ long getPreferredDimensions(std::vector<long> &rWidths) const;
+
+ virtual Size GetOptimalSize() const;
+};
+
+#define SV_LBOX_DD_FORMAT "SV_LBOX_DD_FORMAT"
+struct SvLBoxDDInfo
+{
+ Application* pApp;
+ SvTreeListBox* pSource;
+ SvTreeListEntry* pDDStartEntry;
+ // Relative position in the Entry at DragBeginn (IconView)
+ long nMouseRelX,nMouseRelY;
+ sal_uLong nRes1,nRes2,nRes3,nRes4;
+};
+
+class SvInplaceEdit2
+{
+ Link aCallBackHdl;
+ Accelerator aAccReturn;
+ Accelerator aAccEscape;
+ Timer aTimer;
+ Edit* pEdit;
+ sal_Bool bCanceled;
+ sal_Bool bAlreadyInCallBack;
+
+ void CallCallBackHdl_Impl();
+ DECL_LINK( Timeout_Impl, void * );
+ DECL_LINK( ReturnHdl_Impl, void * );
+ DECL_LINK( EscapeHdl_Impl, void * );
+
+public:
+ SvInplaceEdit2( Window* pParent, const Point& rPos, const Size& rSize,
+ const String& rData, const Link& rNotifyEditEnd,
+ const Selection&, sal_Bool bMultiLine = sal_False );
+ ~SvInplaceEdit2();
+ sal_Bool KeyInput( const KeyEvent& rKEvt );
+ void LoseFocus();
+ sal_Bool EditingCanceled() const { return bCanceled; }
+ OUString GetText() const;
+ String GetSavedValue() const;
+ void StopEditing( sal_Bool bCancel = sal_False );
+ void Hide();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/treelistentries.hxx b/include/svtools/treelistentries.hxx
new file mode 100755
index 000000000000..d52d09aac107
--- /dev/null
+++ b/include/svtools/treelistentries.hxx
@@ -0,0 +1,20 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 __SVTOOLS_TREELISTENTRIES_HXX__
+#define __SVTOOLS_TREELISTENTRIES_HXX__
+
+#include <boost/ptr_container/ptr_vector.hpp>
+
+class SvTreeListEntry;
+typedef boost::ptr_vector<SvTreeListEntry> SvTreeListEntries;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/treelistentry.hxx b/include/svtools/treelistentry.hxx
new file mode 100644
index 000000000000..dfea2651eb0e
--- /dev/null
+++ b/include/svtools/treelistentry.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 __SVTOOLS_TREELISTENTRY_HXX__
+#define __SVTOOLS_TREELISTENTRY_HXX__
+
+#include "svtdllapi.h"
+#include "tools/solar.h"
+#include "treelistbox.hxx"
+#include "treelistentries.hxx"
+
+#include <boost/ptr_container/ptr_vector.hpp>
+
+// Flags, die am Model haengen
+#define SV_ENTRYFLAG_CHILDREN_ON_DEMAND 0x0001
+#define SV_ENTRYFLAG_DISABLE_DROP 0x0002
+#define SV_ENTRYFLAG_IN_USE 0x0004
+// wird gesetzt, wenn RequestingChildren keine Children gestzt hat
+#define SV_ENTRYFLAG_NO_NODEBMP 0x0008
+// Eintrag hatte oder hat Kinder
+#define SV_ENTRYFLAG_HAD_CHILDREN 0x0010
+
+#define SV_ENTRYFLAG_USER_FLAGS 0xF000
+#define SV_ENTRYFLAG_SEMITRANSPARENT 0x8000 // draw semi-transparent entry bitmaps
+
+
+class SVT_DLLPUBLIC SvTreeListEntry
+{
+ friend class SvTreeList;
+ friend class SvListView;
+ friend class SvTreeListBox;
+
+ typedef boost::ptr_vector<SvLBoxItem> ItemsType;
+
+ SvTreeListEntry* pParent;
+ SvTreeListEntries maChildren;
+ sal_uLong nAbsPos;
+ sal_uLong nListPos;
+ ItemsType maItems;
+ void* pUserData;
+ sal_uInt16 nEntryFlags;
+
+private:
+ void ClearChildren();
+ void SetListPositions();
+ void InvalidateChildrensListPositions();
+
+public:
+ static size_t ITEM_NOT_FOUND;
+
+ SvTreeListEntry();
+ SvTreeListEntry(const SvTreeListEntry& r);
+ virtual ~SvTreeListEntry();
+
+ bool HasChildren() const;
+ bool HasChildListPos() const;
+ sal_uLong GetChildListPos() const;
+
+ SvTreeListEntries& GetChildEntries();
+ const SvTreeListEntries& GetChildEntries() const;
+
+ void Clone(SvTreeListEntry* pSource);
+
+ size_t ItemCount() const;
+
+ // DARF NUR GERUFEN WERDEN, WENN DER EINTRAG NOCH NICHT IM MODEL
+ // EINGEFUEGT IST, DA SONST FUER DAS ITEM KEINE VIEW-ABHAENGIGEN
+ // DATEN ALLOZIERT WERDEN!
+ void AddItem( SvLBoxItem* pItem );
+ void ReplaceItem( SvLBoxItem* pNewItem, size_t nPos );
+ const SvLBoxItem* GetItem( size_t nPos ) const;
+ SvLBoxItem* GetItem( size_t nPos );
+ const SvLBoxItem* GetFirstItem( sal_uInt16 nId ) const;
+ SvLBoxItem* GetFirstItem( sal_uInt16 nId );
+ size_t GetPos( const SvLBoxItem* pItem ) const;
+ void* GetUserData() const;
+ void SetUserData( void* pPtr );
+ void EnableChildrenOnDemand( bool bEnable=true );
+ bool HasChildrenOnDemand() const;
+ bool HasInUseEmphasis() const;
+
+ sal_uInt16 GetFlags() const;
+ void SetFlags( sal_uInt16 nFlags );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/unitconv.hxx b/include/svtools/unitconv.hxx
new file mode 100644
index 000000000000..637f575eb9ee
--- /dev/null
+++ b/include/svtools/unitconv.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 _SVT_UNITCONV_HXX
+#define _SVT_UNITCONV_HXX
+
+#include <vcl/field.hxx>
+#include "svtools/svtdllapi.h"
+#include <svl/poolitem.hxx>
+
+// macro -----------------------------------------------------------------
+
+// typedef ---------------------------------------------------------------
+
+typedef long (*FUNC_CONVERT)(long);
+
+// Functions -------------------------------------------------------------
+
+SVT_DLLPUBLIC void SetFieldUnit( MetricField& rCtrl, FieldUnit eUnit, sal_Bool bAll = sal_False );
+SVT_DLLPUBLIC void SetFieldUnit( MetricBox& rCtrl, FieldUnit eUnit, sal_Bool bAll = sal_False );
+
+SVT_DLLPUBLIC long CalcToUnit( float nIn, SfxMapUnit eUnit );
+SVT_DLLPUBLIC long CalcToPoint( long nIn, SfxMapUnit eUnit, sal_uInt16 nFaktor );
+
+SVT_DLLPUBLIC long ItemToControl( long nIn, SfxMapUnit eItem, SfxFieldUnit eCtrl );
+SVT_DLLPUBLIC long ControlToItem( long nIn, SfxFieldUnit eCtrl, SfxMapUnit eItem );
+
+SVT_DLLPUBLIC FieldUnit MapToFieldUnit( const SfxMapUnit eUnit );
+
+SVT_DLLPUBLIC void SetMetricValue( MetricField& rField, long lCoreValue, SfxMapUnit eUnit );
+SVT_DLLPUBLIC long GetCoreValue( const MetricField& rField, SfxMapUnit eUnit );
+
+SVT_DLLPUBLIC long PointToTwips( long nIn );
+
+SVT_DLLPUBLIC long TransformMetric( long nVal, FieldUnit aOld, FieldUnit aNew );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/unoevent.hxx b/include/svtools/unoevent.hxx
new file mode 100644
index 000000000000..581df582a64e
--- /dev/null
+++ b/include/svtools/unoevent.hxx
@@ -0,0 +1,320 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVTOOLS_UNOEVENT_HXX_
+#define _SVTOOLS_UNOEVENT_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/container/XNameReplace.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+class SvxMacroTableDtor;
+class SvxMacroItem;
+class SvxMacro;
+
+/** SvEventDescription: Description of a single event.
+ mnEvent is the id used by SvxMacroItem
+ mpEventName is the api name for this event
+
+ the last event in an array is indicated by mnEvent && mpEventName == 0
+*/
+struct SvEventDescription
+{
+ sal_uInt16 mnEvent;
+ const sal_Char* mpEventName;
+};
+
+/**
+ * SvBaseEventDescriptor: Abstract class that implements the basics
+ * of an XNameReplace that is delivered by the
+ * XEventsSupplier::getEvents() method.
+ *
+ * The functionality this class provides is:
+ * 1) Which elements are in the XNameReplace?
+ * 2) Mapping from Api names to item IDs.
+ * 3) conversion from SvxMacroItem to Any and vice versa.
+ *
+ * All details of how to actually get and set SvxMacroItem(s) have to
+ * be supplied by the base class.
+ */
+class SVT_DLLPUBLIC SvBaseEventDescriptor : public cppu::WeakImplHelper2
+<
+ ::com::sun::star::container::XNameReplace,
+ ::com::sun::star::lang::XServiceInfo
+>
+{
+ const OUString sEventType;
+ const OUString sMacroName;
+ const OUString sLibrary;
+ const OUString sStarBasic;
+ const OUString sJavaScript;
+ const OUString sScript;
+ const OUString sNone;
+
+
+ /// name of own service
+ const OUString sServiceName;
+
+protected:
+ const OUString sEmpty;
+
+ /// last element is 0, 0
+ const SvEventDescription* mpSupportedMacroItems;
+ sal_Int16 mnMacroItems;
+
+public:
+
+ SvBaseEventDescriptor(const SvEventDescription* pSupportedMacroItems);
+
+ virtual ~SvBaseEventDescriptor();
+
+
+ // XNameReplace
+ /// calls replaceByName(const sal_uInt16, const SvxMacro&)
+ virtual void SAL_CALL replaceByName(
+ const OUString& rName, /// API name of event
+ const ::com::sun::star::uno::Any& rElement ) /// event (PropertyValues)
+ throw(
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // XNameAccess (via XNameReplace)
+ /// calls getByName(sal_uInt16)
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName(
+ const OUString& rName ) /// API name of event
+ throw(
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // XNameAxcess (via XNameReplace)
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
+ getElementNames()
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XNameAccess (via XNameReplace)
+ virtual sal_Bool SAL_CALL hasByName(
+ const OUString& rName )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess (via XNameReplace)
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess (via XNameReplace)
+ virtual sal_Bool SAL_CALL hasElements()
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ /// must be implemented in subclass
+ virtual OUString SAL_CALL getImplementationName(void)
+ throw( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XServiceInfo
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName)
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
+ getSupportedServiceNames(void)
+ throw( ::com::sun::star::uno::RuntimeException );
+
+protected:
+
+ /// Must be implemented in subclass.
+ virtual void replaceByName(
+ const sal_uInt16 nEvent, /// item ID of event
+ const SvxMacro& rMacro) /// event (will be copied)
+ throw(
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException) = 0;
+
+ /// Must be implemented in subclass.
+ virtual void getByName(
+ SvxMacro& rMacro,
+ const sal_uInt16 nEvent )
+ throw(
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException) = 0;
+
+ /// convert an API event name to the event ID as used by SvxMacroItem
+ sal_uInt16 mapNameToEventID(const OUString& rName) const;
+
+ /// get the event ID for the name; return 0 if not supported
+ sal_uInt16 getMacroID(const OUString& rName) const;
+
+ /// create PropertyValues and Any from macro
+ void getAnyFromMacro(
+ ::com::sun::star::uno::Any& aAny, // Any to be filled by Macro values
+ const SvxMacro& rMacro);
+
+ /// create macro from PropertyValues (in an Any)
+ void getMacroFromAny(
+ SvxMacro& aMacro, // reference to be filled by Any
+ const ::com::sun::star::uno::Any& rAny)
+ throw (
+ ::com::sun::star::lang::IllegalArgumentException);
+
+};
+
+
+
+
+/**
+ * SvEventDescriptor: Implement the XNameReplace that is delivered by
+ * the XEventsSupplier::getEvents() method. The SvEventDescriptor has
+ * to be subclassed to implement the events for a specific
+ * objects. The subclass has to
+ * 1) supply the super class constructor with a list of known events (item IDs)
+ * 2) supply the super class constructor with a reference of it's parent object
+ * (to prevent destruction)
+ * 3) implement getItem() and setItem(...) methods.
+ *
+ * If no object is available to which the SvEventDescriptor can attach itself,
+ * the class SvDetachedEventDescriptor should be used.
+ */
+class SVT_DLLPUBLIC SvEventDescriptor : public SvBaseEventDescriptor
+{
+ /// keep reference to parent to prevent it from being destroyed
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > xParentRef;
+
+public:
+
+ SvEventDescriptor(::com::sun::star::uno::XInterface& rParent,
+ const SvEventDescription* pSupportedMacroItems);
+
+ virtual ~SvEventDescriptor();
+
+
+protected:
+
+
+ using SvBaseEventDescriptor::replaceByName;
+ virtual void replaceByName(
+ const sal_uInt16 nEvent, /// item ID of event
+ const SvxMacro& rMacro) /// event (will be copied)
+ throw(
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ using SvBaseEventDescriptor::getByName;
+ virtual void getByName(
+ SvxMacro& rMacros, /// macro to be filled with values
+ const sal_uInt16 nEvent ) /// item ID of event
+ throw(
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+
+ /// Get the SvxMacroItem from the parent.
+ /// must be implemented by subclass
+ virtual const SvxMacroItem& getMacroItem() = 0;
+
+ /// Set the SvxMacroItem at the parent.
+ /// must be implemented by subclass
+ virtual void setMacroItem(const SvxMacroItem& rItem) = 0;
+
+ /// Get the SvxMacroItem Which Id needed for the current application
+ /// must be implemented by subclass
+ virtual sal_uInt16 getMacroItemWhich() const = 0;
+};
+
+
+/**
+ * SvDetachedEventDescriptor:
+ */
+class SVT_DLLPUBLIC SvDetachedEventDescriptor : public SvBaseEventDescriptor
+{
+ // the macros; aMacros[i] is the value for aSupportedMacroItemIDs[i]
+ SvxMacro** aMacros;
+
+ const OUString sImplName;
+
+public:
+
+ SvDetachedEventDescriptor(const SvEventDescription* pSupportedMacroItems);
+
+ virtual ~SvDetachedEventDescriptor();
+
+ //XServiceInfo
+ virtual OUString SAL_CALL getImplementationName(void)
+ throw( ::com::sun::star::uno::RuntimeException );
+
+protected:
+
+ sal_Int16 getIndex(const sal_uInt16 nID) const;
+
+ using SvBaseEventDescriptor::replaceByName;
+ virtual void replaceByName(
+ const sal_uInt16 nEvent, /// item ID of event
+ const SvxMacro& rMacro) /// event (will be copied)
+ throw(
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ using SvBaseEventDescriptor::getByName;
+ virtual void getByName(
+ SvxMacro& rMacro, /// macro to be filled
+ const sal_uInt16 nEvent ) /// item ID of event
+ throw(
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ /// do we have an event?
+ /// return sal_True: we have a macro for the event
+ /// return sal_False: no macro; getByName() will return an empty macro
+ /// IllegalArgumentException: the event is not supported
+ using SvBaseEventDescriptor::hasByName;
+ virtual sal_Bool hasByName(
+ const sal_uInt16 nEvent ) const /// item ID of event
+ throw(
+ ::com::sun::star::lang::IllegalArgumentException);
+
+};
+
+class SVT_DLLPUBLIC SvMacroTableEventDescriptor : public SvDetachedEventDescriptor
+{
+public:
+
+ SvMacroTableEventDescriptor(const SvEventDescription* pSupportedMacroItems);
+ SvMacroTableEventDescriptor(const SvxMacroTableDtor& aFmt,
+ const SvEventDescription* pSupportedMacroItems);
+
+ virtual ~SvMacroTableEventDescriptor();
+
+ void copyMacrosFromTable(const SvxMacroTableDtor& aFmt);
+ void copyMacrosIntoTable(SvxMacroTableDtor& aFmt);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/unoimap.hxx b/include/svtools/unoimap.hxx
new file mode 100644
index 000000000000..03fd3ea3e84b
--- /dev/null
+++ b/include/svtools/unoimap.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 _SVTOOLS_UNOIMAP_HXX
+#define _SVTOOLS_UNOIMAP_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/XInterface.hpp>
+
+class ImageMap;
+struct SvEventDescription;
+
+SVT_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvUnoImageMapRectangleObject_createInstance( const SvEventDescription* pSupportedMacroItems );
+SVT_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvUnoImageMapCircleObject_createInstance( const SvEventDescription* pSupportedMacroItems );
+SVT_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvUnoImageMapPolygonObject_createInstance( const SvEventDescription* pSupportedMacroItems );
+
+SVT_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvUnoImageMap_createInstance( const SvEventDescription* pSupportedMacroItems );
+SVT_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvUnoImageMap_createInstance( const ImageMap& rMap, const SvEventDescription* pSupportedMacroItems );
+SVT_DLLPUBLIC sal_Bool SvUnoImageMap_fillImageMap( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xImageMap, ImageMap& rMap );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/urlcontrol.hxx b/include/svtools/urlcontrol.hxx
new file mode 100644
index 000000000000..682573855000
--- /dev/null
+++ b/include/svtools/urlcontrol.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 SVTOOLS_URLCONTROL_HXX
+#define SVTOOLS_URLCONTROL_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/inettbc.hxx>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OFileURLControl
+ //=====================================================================
+ class SVT_DLLPUBLIC OFileURLControl : public SvtURLBox
+ {
+ protected:
+ String m_sPreservedText;
+
+ public:
+ OFileURLControl(Window* _pParent, const ResId& _rId);
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // SVTOOLS_URLCONTROL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
new file mode 100644
index 000000000000..ff032fd3baa4
--- /dev/null
+++ b/include/svtools/valueset.hxx
@@ -0,0 +1,391 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _VALUESET_HXX
+#define _VALUESET_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <vcl/ctrl.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/timer.hxx>
+#include <vector>
+
+class MouseEvent;
+class TrackingEvent;
+class HelpEvent;
+class KeyEvent;
+class DataChangedEvent;
+class ScrollBar;
+
+struct ValueSetItem;
+typedef ::std::vector< ValueSetItem* > ValueItemList;
+
+#ifdef _SV_VALUESET_CXX
+class ValueSetAcc;
+class ValueItemAcc;
+#endif
+
+/*************************************************************************
+
+Description
+============
+
+class ValueSet
+
+This class allows the selection of an item. In the process items are
+drawn side by side. The selection of items can be more clear than in a
+ListBox shape for example in case of colors or samples.
+The amount of columns drawn by the control and whether the items
+should be encircled can be specified. Optional a NoSelection or name
+field could be shown. By default image and color items are supported.
+Items could be drawn by oneself if InsertItem() is only called with
+an ID. To achieve this the UserDraw handler needs to be overloaded. The
+description text could be specified afterwards in case of UserDraw
+and any other items.
+
+Cross references
+
+class ListBox
+
+--------------------------------------------------------------------------
+
+WinBits
+
+WB_RADIOSEL If set the selection will be drawn like an
+ ImageRadioButton. This does only make sense if the image
+ is at least 8 pixel smaller on each side than the item
+ and also WB_DOUBLEBORDER is set and as color
+ COL_WINDOWWORKSPACE is specified.
+WB_FLATVALUESET Flat Look (if you set WB_ITEMBORDER or WB_DOUBLEBORDER,
+ then you get extra border space, but the Borders
+ aren't painted),
+WB_ITEMBORDER Items will be bordered
+WB_DOUBLEBORDER Items will be bordered twice. Additionally WB_ITEMBORDER
+ has to be set, as otherwise this WinBit wouldn't have any
+ effect. It is needed if there are items with a white
+ background, since otherwise the 3D effect wouldn't be
+ recognizable.
+WB_NAMEFIELD There is a namefield, where the name of an item will be
+ shown.
+WB_NONEFIELD There is a NoSelection field which can be selected if
+ 0 is passed along with SelectItem. Respectively
+ GetSelectItemId() returns 0 if this field or nothing
+ is selected. This field shows the text which is specified
+ by SetText() respectively no one, if no text was set. With
+ SetNoSelection() the selection can be disabled.
+WB_VSCROLL A scroolbar will be always shown. The visible number of
+ lines have to be specified with SetLineCount() if this
+ flag is set.
+WB_BORDER A border will be drawn around the window.
+WB_NOPOINTERFOCUS The focus won't be gathered, if the control was pressed by
+ the mouse.
+WB_TABSTOP It is possible to jump into the ValueSet with the tab key.
+WB_NOTABSTOP It is not possible to jump into the ValueSet with the
+ tab key.
+WB_NO_DIRECTSELECT Cursor travelling doesn't call select immediately. To
+ execute the selection <RETURN> has to be pressed.
+--------------------------------------------------------------------------
+
+The number of columns must be either set with SetColCount() or
+SetItemWidth(). If the number of colums is specified by SetColCount()
+the width of the items will be calculated by the visible range.
+If the items should have a static width, it has to be specified
+with SetItemWidth(). In this case the number of columns will be calculated
+by the visible range.
+
+The number of rows is given by the number of items / number of columns. The
+number of visible rows must either specified by SetLineCount() or
+SetItemWidth(). If the number of visible rows is specified by SetLineCount(),
+the height of the items will be calculated from the visible height. If the
+items should have a fixed height it has to be specified with SetItemHeight().
+In this case the number of visible rows is then calculated from the visible
+height. If the number of visible rows is neither specified by SetLineCount()
+nor by SetItemHeight() all rows will be shown. The height of the items will
+be calculated by the visible height. If the number of visible rows is
+specified by SetLineCount() or SetItemHeight() ValueSet does scroll
+automatically when more lines are available, as are visible. If scrolling
+should be also possible with a ScrollBar WB_VSCROLL needs to be set.
+
+The distance between the items can be increased by SetExtraSpacing(). The
+distance, which will be shown between two items (both in x and in y), is
+measured in pixels.
+
+The exact window size for a specific item size can be calculated by
+CalcWindowSizePixel(). To do this all relevant data (number of columns/...)
+have to be specified and if no number of rows was set, all items need to
+be inserted. If the window was created with WB_BORDER/Border=sal_True the
+size has to be specified with SetOutputSizePixel(). In other cases different
+size-methods can be used. With CalcItemSize() the inner and outer size of
+an item could be calculated (for this the free space defined by
+SetExtraSpacing() will not be included).
+
+The background color could be specified by SetColor(), with which the image
+or UserDraw items will be underlayed. If no color is specified the color
+of other windows (WindowColor) will be used for the background.
+
+--------------------------------------------------------------------------
+
+At first all items should be inserted and only then Show() should be called
+since the output area will be precomputed. If this is not done the first
+Paint will appear a little bit slower. Therefore the Control, if it is loaded
+from the resource and only supplied with items during runtime, should be
+loaded with Hide = sal_True and then displayed with Show().
+
+In case of a visible Control the creation of the new output area could be
+activated before Paint by calling Format().
+
+--------------------------------------------------------------------------
+
+If Drag and Drop will be called from the ValueSet the Command-Handler has to
+be overloaded. From this StartDrag needs to be called. If this method returns
+sal_True the drag-process could be initiated by ExecuteDrag(), otherwise no
+processing will take place. This method makes sure that ValueSet stops its
+processing and as appropriate selects the entry. Therefore the calling of
+Select-Handler within this function must be expected.
+
+For dropping QueryDrop() and Drop() need to be overloaded and ShowDropPos()
+and HideDropPos() should be called within these methods.
+To show the insertion point ShowDropPos() has to be called within the
+QueryDrop-Handler. ShowDropPos() also scrolls the ValueSet if the passed
+position is located at the window border. Furthermore ShowDropPos() returns
+the position, at which the item should be inserted respectively which
+insertion point was shown. If no insertion point was determined
+VALUESET_ITEM_NOTFOUND will be returned. If the window was left during dragging
+or the drag process is terminated HideDropPos() should be called in any case.
+
+--------------------------------------------------------------------------
+
+This class is currently still in the SV-Tools. That's why the ValueSet needs
+to be loaded as a Control out of the resource and the desired WinBits have
+to be set (before Show) with SetStyle().
+
+*************************************************************************/
+
+// ------------------
+// - ValueSet types -
+// ------------------
+
+#define WB_RADIOSEL ((WinBits)0x00008000)
+#define WB_ITEMBORDER ((WinBits)0x00010000)
+#define WB_DOUBLEBORDER ((WinBits)0x00020000)
+#define WB_NAMEFIELD ((WinBits)0x00040000)
+#define WB_NONEFIELD ((WinBits)0x00080000)
+#define WB_FLATVALUESET ((WinBits)0x02000000)
+#define WB_NO_DIRECTSELECT ((WinBits)0x04000000)
+#define WB_MENUSTYLEVALUESET ((WinBits)0x08000000)
+
+// ------------
+// - ValueSet -
+// ------------
+
+#define VALUESET_APPEND ((sal_uInt16)-1)
+#define VALUESET_ITEM_NOTFOUND ((sal_uInt16)-1)
+
+class SVT_DLLPUBLIC ValueSet : public Control
+{
+private:
+
+ VirtualDevice maVirDev;
+ Timer maTimer;
+ ValueItemList mItemList;
+ ValueSetItem* mpNoneItem;
+ ScrollBar* mpScrBar;
+ Rectangle maNoneItemRect;
+ Rectangle maItemListRect;
+ long mnItemWidth;
+ long mnItemHeight;
+ long mnTextOffset;
+ long mnVisLines;
+ long mnLines;
+ long mnUserItemWidth;
+ long mnUserItemHeight;
+ sal_uInt16 mnSelItemId;
+ sal_uInt16 mnHighItemId;
+ sal_uInt16 mnCols;
+ sal_uInt16 mnCurCol;
+ sal_uInt16 mnUserCols;
+ sal_uInt16 mnUserVisLines;
+ sal_uInt16 mnFirstLine;
+ sal_uInt16 mnSpacing;
+ sal_uInt16 mnFrameStyle;
+ bool mbFormat : 1;
+ bool mbHighlight : 1;
+ bool mbSelection : 1;
+ bool mbNoSelection : 1;
+ bool mbDrawSelection : 1;
+ bool mbBlackSel : 1;
+ bool mbDoubleSel : 1;
+ bool mbScroll : 1;
+ bool mbFullMode : 1;
+ bool mbIsTransientChildrenDisabled : 1;
+ bool mbHasVisibleItems : 1;
+ Color maColor;
+ Link maDoubleClickHdl;
+ Link maSelectHdl;
+ Link maHighlightHdl;
+
+#ifdef _SV_VALUESET_CXX
+ friend class ValueSetAcc;
+ friend class ValueItemAcc;
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit();
+ SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
+ SVT_DLLPRIVATE void ImplInitScrollBar();
+ SVT_DLLPRIVATE void ImplDeleteItems();
+ SVT_DLLPRIVATE void ImplFormatItem( ValueSetItem* pItem, Rectangle aRect );
+ SVT_DLLPRIVATE void ImplDrawItemText(const OUString& rStr);
+ SVT_DLLPRIVATE void ImplDrawSelect( sal_uInt16 nItemId, const bool bFocus, const bool bDrawSel );
+ SVT_DLLPRIVATE void ImplDrawSelect();
+ SVT_DLLPRIVATE void ImplHideSelect( sal_uInt16 nItemId );
+ SVT_DLLPRIVATE void ImplHighlightItem( sal_uInt16 nItemId, bool bIsSelection = true );
+ SVT_DLLPRIVATE void ImplDraw();
+ using Window::ImplScroll;
+ SVT_DLLPRIVATE bool ImplScroll( const Point& rPos );
+ SVT_DLLPRIVATE size_t ImplGetItem( const Point& rPoint, bool bMove = false ) const;
+ SVT_DLLPRIVATE ValueSetItem* ImplGetItem( size_t nPos );
+ SVT_DLLPRIVATE ValueSetItem* ImplGetFirstItem();
+ SVT_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
+ SVT_DLLPRIVATE ValueSetItem* ImplGetVisibleItem( sal_uInt16 nVisiblePos );
+ SVT_DLLPRIVATE void ImplInsertItem( ValueSetItem *const pItem, const size_t nPos );
+ SVT_DLLPRIVATE Rectangle ImplGetItemRect( size_t nPos ) const;
+ SVT_DLLPRIVATE void ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue );
+ SVT_DLLPRIVATE bool ImplHasAccessibleListeners();
+ SVT_DLLPRIVATE void ImplTracking( const Point& rPos, bool bRepeat );
+ SVT_DLLPRIVATE void ImplEndTracking( const Point& rPos, bool bCancel );
+ DECL_DLLPRIVATE_LINK( ImplScrollHdl, ScrollBar* );
+ DECL_DLLPRIVATE_LINK( ImplTimerHdl, void* );
+#endif
+
+ // Forbidden and not implemented.
+ ValueSet (const ValueSet &);
+ ValueSet & operator= (const ValueSet &);
+
+protected:
+
+ bool StartDrag( const CommandEvent& rCEvt, Region& rRegion );
+
+protected:
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+public:
+ ValueSet( Window* pParent, WinBits nWinStyle, bool bDisableTransientChildren = false );
+ ValueSet( Window* pParent, const ResId& rResId, bool bDisableTransientChildren = false );
+ ~ValueSet();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void Resize();
+ virtual Size GetOptimalSize() const;
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Select();
+ virtual void DoubleClick();
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ size_t nPos = VALUESET_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const Color& rColor,
+ size_t nPos = VALUESET_APPEND );
+ void InsertItem( sal_uInt16 nItemId,
+ const Image& rImage, const OUString& rStr,
+ size_t nPos = VALUESET_APPEND );
+ void InsertItem( sal_uInt16 nItemId,
+ const Color& rColor, const OUString& rStr,
+ size_t nPos = VALUESET_APPEND );
+ void InsertItem( sal_uInt16 nItemId,
+ size_t nPos = VALUESET_APPEND );
+ void RemoveItem( sal_uInt16 nItemId );
+
+ void Clear();
+
+ size_t GetItemCount() const;
+ size_t GetItemPos( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetItemId( size_t nPos ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ Rectangle GetItemRect( sal_uInt16 nItemId ) const;
+
+ void EnableFullItemMode( bool bFullMode = true );
+ bool IsFullItemModeEnabled() const { return mbFullMode; }
+ void SetColCount( sal_uInt16 nNewCols = 1 );
+ sal_uInt16 GetColCount() const { return mnUserCols; }
+ void SetLineCount( sal_uInt16 nNewLines = 0 );
+ sal_uInt16 GetLineCount() const { return mnUserVisLines; }
+ void SetItemWidth( long nItemWidth = 0 );
+ long GetItemWidth() const { return mnUserItemWidth; }
+ void SetItemHeight( long nLineHeight = 0 );
+ long GetItemHeight() const { return mnUserItemHeight; }
+ sal_uInt16 GetFirstLine() const { return mnFirstLine; }
+
+ void SelectItem( sal_uInt16 nItemId );
+ sal_uInt16 GetSelectItemId() const { return mnSelItemId; }
+ bool IsItemSelected( sal_uInt16 nItemId ) const
+ { return !mbNoSelection && (nItemId == mnSelItemId); }
+ void SetNoSelection();
+ bool IsNoSelection() const { return mbNoSelection; }
+
+ void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
+ Image GetItemImage( sal_uInt16 nItemId ) const;
+ void SetItemColor( sal_uInt16 nItemId, const Color& rColor );
+ Color GetItemColor( sal_uInt16 nItemId ) const;
+ void SetItemData( sal_uInt16 nItemId, void* pData );
+ void* GetItemData( sal_uInt16 nItemId ) const;
+ void SetItemText( sal_uInt16 nItemId, const OUString& rStr );
+ OUString GetItemText( sal_uInt16 nItemId ) const;
+ void SetColor( const Color& rColor );
+ void SetColor() { SetColor( Color( COL_TRANSPARENT ) ); }
+ Color GetColor() const { return maColor; }
+ bool IsColor() const { return maColor.GetTransparency() == 0; }
+
+ void SetExtraSpacing( sal_uInt16 nNewSpacing );
+ sal_uInt16 GetExtraSpacing() { return mnSpacing; }
+
+ void Format();
+
+ void StartSelection();
+ void EndSelection();
+
+ Size CalcWindowSizePixel( const Size& rItemSize,
+ sal_uInt16 nCalcCols = 0,
+ sal_uInt16 nCalcLines = 0 ) const;
+ Size CalcItemSizePixel( const Size& rSize, bool bOut = true ) const;
+ long GetScrollWidth() const;
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+
+ void SetHighlightHdl( const Link& rLink );
+};
+
+#endif // _VALUESET_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/viewdataentry.hxx b/include/svtools/viewdataentry.hxx
new file mode 100644
index 000000000000..3800b293fd2b
--- /dev/null
+++ b/include/svtools/viewdataentry.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __SVTOOLS_VIEWDATAENTRY_HXX__
+#define __SVTOOLS_VIEWDATAENTRY_HXX__
+
+#include "svtdllapi.h"
+#include "tools/solar.h"
+#include "tools/gen.hxx"
+
+#include <vector>
+
+struct SvViewDataItem
+{
+ Size maSize;
+};
+
+/**
+ * View-dependent data for a tree list entry created in the virtual function
+ * SvTreeListBox::CreateViewData(). The item array contains the same number
+ * of items as that of the items in its corresponding tree list entry.
+ *
+ * When an entry is selected, it is logically selected and visually
+ * highlighted. When an entry is only highlighted, it looks visually
+ * highlighted, but not logically selected.
+ */
+class SVT_DLLPUBLIC SvViewDataEntry
+{
+ friend class SvTreeList;
+
+ std::vector<SvViewDataItem> maItems;
+ sal_uLong nVisPos;
+ bool mbSelected:1;
+ bool mbHighlighted:1;
+ bool mbExpanded:1;
+ bool mbFocused:1;
+ bool mbCursored:1;
+ bool mbSelectable:1;
+
+public:
+ SvViewDataEntry();
+ SvViewDataEntry( const SvViewDataEntry& );
+ ~SvViewDataEntry();
+
+ bool IsSelected() const;
+ bool IsHighlighted() const;
+ bool IsExpanded() const;
+ bool HasFocus() const;
+ bool IsCursored() const;
+ bool IsSelectable() const;
+ void SetFocus( bool bFocus );
+ void SetSelected( bool bSelected );
+ void SetHighlighted( bool bHighlighted );
+ void SetExpanded( bool bExpanded );
+ void SetSelectable( bool bSelectable );
+
+ void Init(size_t nSize);
+
+ const SvViewDataItem* GetItem(size_t nPos) const;
+ SvViewDataItem* GetItem(size_t nPos);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/wizardmachine.hxx b/include/svtools/wizardmachine.hxx
new file mode 100644
index 000000000000..8283b131007d
--- /dev/null
+++ b/include/svtools/wizardmachine.hxx
@@ -0,0 +1,385 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVTOOLS_WIZARDMACHINE_HXX_
+#define _SVTOOLS_WIZARDMACHINE_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <svtools/wizdlg.hxx>
+#include <vcl/button.hxx>
+#include <vcl/tabpage.hxx>
+#include <comphelper/stl_types.hxx>
+
+class Bitmap;
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+// wizard buttons
+#define WZB_NONE 0x0000
+#define WZB_NEXT 0x0001
+#define WZB_PREVIOUS 0x0002
+#define WZB_FINISH 0x0004
+#define WZB_CANCEL 0x0008
+#define WZB_HELP 0x0010
+
+// wizard states
+#define WZS_INVALID_STATE ((WizardState)-1)
+
+ //=====================================================================
+ //= WizardTypes
+ //=====================================================================
+ struct WizardTypes
+ {
+ typedef sal_Int16 WizardState;
+ enum CommitPageReason
+ {
+ eTravelForward, // traveling forward (maybe with skipping pages)
+ eTravelBackward, // traveling backward (maybe with skipping pages)
+ eFinish, // the wizard is about to be finished
+ eValidate // the data should be validated only, no traveling wll happen
+ };
+ };
+
+ class SAL_NO_VTABLE IWizardPageController
+ {
+ public:
+ //-----------------------------------------------------------------
+ // This methods behave somewhat different than ActivatePage/DeactivatePage
+ // The latter are handled by the base class itself whenever changing the pages is in the offing,
+ // i.e., when it's already decided which page is the next.
+ // We may have situations where the next page depends on the state of the current, which needs
+ // to be committed for this.
+ // So initializePage and commitPage are designated to initialitzing/committing data on the page.
+ virtual void initializePage() = 0;
+ virtual sal_Bool commitPage( WizardTypes::CommitPageReason _eReason ) = 0;
+
+ /** determines whether or not it is allowed to advance to a next page
+
+ You should make this dependent on the current state of the page only, not on
+ states on other pages of the whole dialog.
+
+ The default implementation always returns <TRUE/>.
+ */
+ virtual bool canAdvance() const = 0;
+
+ protected:
+ ~IWizardPageController() {}
+ };
+
+ //=====================================================================
+ //= OWizardPage
+ //=====================================================================
+ class OWizardMachine;
+ struct WizardPageImplData;
+
+ class SVT_DLLPUBLIC OWizardPage : public TabPage, public IWizardPageController
+ {
+ private:
+ WizardPageImplData* m_pImpl;
+
+ public:
+ /** @param _pParent
+ if the OWizardPage is used in an OWizardMachine, this parameter
+ must be the OWizardMachine (which is derived from Window)
+ */
+ OWizardPage( Window* _pParent, const ResId& _rResId );
+ ~OWizardPage();
+
+ // IWizardPageController overridables
+ virtual void initializePage();
+ virtual sal_Bool commitPage( WizardTypes::CommitPageReason _eReason );
+ virtual bool canAdvance() const;
+
+ protected:
+ // TabPage overridables
+ virtual void ActivatePage();
+
+ /** updates the travel-related UI elements of the OWizardMachine we live in (if any)
+
+ If the parent of the tab page is a OWizardMachine, then updateTravelUI at this instance
+ is called. Otherwise, nothing happens.
+ */
+ void updateDialogTravelUI();
+ };
+
+ //=====================================================================
+ //= OWizardMachine
+ //=====================================================================
+ struct WizardMachineImplData;
+ /** implements some kind of finite automata, where the states of the automata exactly correlate
+ with tab pages.
+
+ That is, the machine can have up to n states, where at each point in time exactly one state is
+ the current one. A state being current is represented as one of n tab pages being displayed
+ currently.
+
+ The class handles the UI for traveling between the states (e.g. it administrates the <em>Next</em> and
+ <em>Previous</em> buttons which you usually find in a wizard.
+
+ Derived classes have to implement the travel logic by overriding <member>determineNextState</member>,
+ which has to determine the state which follows the current state. Since this may depend
+ on the actual data presented in the wizard (e.g. checkboxes checked, or something like this),
+ they can implement non-linear traveling this way.
+ */
+
+ class SVT_DLLPUBLIC OWizardMachine : public WizardDialog, public WizardTypes
+ {
+ private:
+ // restrict access to some aspects of our base class
+ SVT_DLLPRIVATE void AddPage( TabPage* pPage ) { WizardDialog::AddPage(pPage); }
+ SVT_DLLPRIVATE void RemovePage( TabPage* pPage ) { WizardDialog::RemovePage(pPage); }
+ SVT_DLLPRIVATE void SetPage( sal_uInt16 nLevel, TabPage* pPage ) { WizardDialog::SetPage(nLevel, pPage); }
+ // TabPage* GetPage( sal_uInt16 nLevel ) const { return WizardDialog::GetPage(nLevel); }
+ // TODO: probably the complete page handling (next, previous etc.) should be prohibited ...
+
+ // IMPORTANT:
+ // traveling pages should not be done by calling these base class member, some mechanisms of this class
+ // here (e.g. committing page data) depend on having full control over page traveling.
+ // So use the travelXXX methods if you need to travel
+
+ protected:
+ OKButton* m_pFinish;
+ CancelButton* m_pCancel;
+ PushButton* m_pNextPage;
+ PushButton* m_pPrevPage;
+ HelpButton* m_pHelp;
+
+ private:
+ WizardMachineImplData*
+ m_pImpl;
+ // hold members in this structure to allow keeping compatible when members are added
+
+ SVT_DLLPRIVATE void addButtons(Window* _pParent, sal_uInt32 _nButtonFlags);
+
+ public:
+ /** ctor
+
+ The ctor does not call FreeResource, this is the resposibility of the derived class.
+
+ For the button flags, use any combination of the WZB_* flags.
+ */
+ OWizardMachine(Window* _pParent, const ResId& _rRes, sal_uInt32 _nButtonFlags );
+ OWizardMachine(Window* _pParent, const WinBits i_nStyle, sal_uInt32 _nButtonFlags );
+ ~OWizardMachine();
+
+ /// enable (or disable) buttons
+ void enableButtons(sal_uInt32 _nWizardButtonFlags, sal_Bool _bEnable);
+ /// set the default style for a button
+ void defaultButton(sal_uInt32 _nWizardButtonFlags);
+ /// set the default style for a button
+ void defaultButton(PushButton* _pNewDefButton);
+
+ /// set the base of the title to use - the title of the current page is appended
+ void setTitleBase(const String& _rTitleBase);
+
+ /// determines whether there is a next state to which we can advance
+ virtual bool canAdvance() const;
+
+ /** updates the user interface which deals with traveling in the wizard
+
+ The default implementation simply checks whether both the current page and the wizard
+ itself allow to advance to the next state (<code>canAdvance</code>), and enables the "Next"
+ button if and only if this is the case.
+ */
+ virtual void updateTravelUI();
+
+ protected:
+ // WizardDialog overridables
+ virtual void ActivatePage();
+ virtual long DeactivatePage();
+
+ // our own overridables
+
+ /// to override to create new pages
+ virtual TabPage* createPage(WizardState _nState) = 0;
+
+ /// will be called when a new page is about to be displayed
+ virtual void enterState(WizardState _nState);
+
+ /** will be called when the current state is about to be left for the given reason
+
+ The base implementation in this class will simply call <member>OWizardPage::commitPage</member>
+ for the current page, and return whatever this call returns.
+
+ @param _eReason
+ The reason why the state is to be left.
+ @return
+ <TRUE/> if and only if the page is allowed to be left
+ */
+ virtual sal_Bool prepareLeaveCurrentState( CommitPageReason _eReason );
+
+ /** will be called when the given state is left
+
+ This is the very last possibility for derived classes to veto the deactivation
+ of a page.
+
+ @todo Normally, we would not need the return value here - derived classes now have
+ the possibility to veto page deactivations in <member>prepareLeaveCurrentState</member>. However,
+ changing this return type is too incompatible at the moment ...
+
+ @return
+ <TRUE/> if and only if the page is allowed to be left
+ */
+ virtual sal_Bool leaveState( WizardState _nState );
+
+ /** determine the next state to travel from the given one
+
+ The default behaviour is linear traveling, overwrite this to change it
+
+ Return WZS_INVALID_STATE to prevent traveling.
+ */
+ virtual WizardState determineNextState( WizardState _nCurrentState ) const;
+
+ /** called when the finish button is pressed
+ <p>By default, only the base class' Finnish method (which is not virtual) is called</p>
+ */
+ virtual sal_Bool onFinish();
+
+ /// travel to the next state
+ sal_Bool travelNext();
+
+ /// travel to the previous state
+ sal_Bool travelPrevious();
+
+ /** enables the automatic enabled/disabled state of the "Next" button
+
+ If this is <TRUE/>, then upon entering a new state, the "Next" button will automatically be
+ enabled if and only if determineNextState does not return WZS_INVALID_STATE.
+ */
+ void enableAutomaticNextButtonState( bool _bEnable = true );
+ bool isAutomaticNextButtonStateEnabled() const;
+
+ /** removes a page from the history. Should be called when the page is being disabled
+ */
+ void removePageFromHistory( WizardState nToRemove );
+
+ /** skip a state
+
+ The method behaves as if from the current state, <arg>_nSteps</arg> <method>travelNext</method>s were
+ called, but without actually creating or displaying the íntermediate pages. Only the
+ (<arg>_nSteps</arg> + 1)th page is created.
+
+ The skipped states appear in the state history, so <method>travelPrevious</method> will make use of them.
+
+ A very essential precondition for using this method is that your <method>determineNextState</method>
+ method is able to determine the next state without actually having the page of the current state.
+
+ @return
+ <TRUE/> if and only if traveling was successful
+
+ @see skipUntil
+ @see skipBackwardUntil
+ */
+ sal_Bool skip( sal_Int32 _nSteps = 1 );
+
+ /** skips one or more states, until a given state is reached
+
+ The method behaves as if from the current state, <method>travelNext</method>s were called
+ successively, until <arg>_nTargetState</arg> is reached, but without actually creating or
+ displaying the íntermediate pages.
+
+ The skipped states appear in the state history, so <method>travelPrevious</method> will make use of them.
+
+ @return
+ <TRUE/> if and only if traveling was successful
+
+ @see skip
+ @see skipBackwardUntil
+ */
+ sal_Bool skipUntil( WizardState _nTargetState );
+
+ /** moves back one or more states, until a given state is reached
+
+ This method allows traveling backwards more than one state without actually showing the intermediate
+ states.
+
+ For instance, if you want to travel two steps backward at a time, you could used
+ two travelPrevious calls, but this would <em>show</em> both pages, which is not necessary,
+ since you're interested in the target page only. Using <member>skipBackwardUntil</member> reliefs
+ you from this.
+
+ @return
+ <TRUE/> if and only if traveling was successful
+
+ @see skipUntil
+ @see skip
+ */
+ sal_Bool skipBackwardUntil( WizardState _nTargetState );
+
+ /** returns the current state of the machine
+
+ Vulgo, this is the identifier of the current tab page :)
+ */
+ WizardState getCurrentState() const { return WizardDialog::GetCurLevel(); }
+
+ virtual IWizardPageController*
+ getPageController( TabPage* _pCurrentPage ) const;
+
+ /** retrieves a copy of the state history, i.e. all states we already visited
+ */
+ void getStateHistory( ::std::vector< WizardState >& _out_rHistory );
+
+ public:
+ class AccessGuard { friend class WizardTravelSuspension; private: AccessGuard() { } };
+
+ void suspendTraveling( AccessGuard );
+ void resumeTraveling( AccessGuard );
+ bool isTravelingSuspended() const;
+
+ protected:
+ TabPage* GetOrCreatePage( const WizardState i_nState );
+
+ private:
+ // long OnNextPage( PushButton* );
+ DECL_DLLPRIVATE_LINK(OnNextPage, void*);
+ DECL_DLLPRIVATE_LINK(OnPrevPage, void*);
+ DECL_DLLPRIVATE_LINK(OnFinish, void*);
+
+ SVT_DLLPRIVATE void implResetDefault(Window* _pWindow);
+ SVT_DLLPRIVATE void implUpdateTitle();
+ SVT_DLLPRIVATE void implConstruct( const sal_uInt32 _nButtonFlags );
+ };
+
+ /// helper class to temporarily suspend any traveling in the wizard
+ class WizardTravelSuspension
+ {
+ public:
+ WizardTravelSuspension( OWizardMachine& _rWizard )
+ :m_rWizard( _rWizard )
+ {
+ m_rWizard.suspendTraveling( OWizardMachine::AccessGuard() );
+ }
+
+ ~WizardTravelSuspension()
+ {
+ m_rWizard.resumeTraveling( OWizardMachine::AccessGuard() );
+ }
+
+ private:
+ OWizardMachine& m_rWizard;
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // _SVTOOLS_WIZARDMACHINE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/wizdlg.hxx b/include/svtools/wizdlg.hxx
new file mode 100644
index 000000000000..f161b7339ff7
--- /dev/null
+++ b/include/svtools/wizdlg.hxx
@@ -0,0 +1,301 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVT_WIZDLG_HXX
+#define _SVT_WIZDLG_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <vcl/dialog.hxx>
+
+class TabPage;
+class Button;
+class PushButton;
+class FixedLine;
+struct ImplWizPageData;
+struct ImplWizButtonData;
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class WizardDialog
+
+Diese Klasse dient als Basis fuer einen WizardDialog. Als
+Basisfunktionalitaet wird das Anordnen der Controls angeboten und
+Hilfesmethoden fuer das Umschalten von TabPages. Der Dialog
+ordnet bei einer Groessenanderung die Controls auch wieder
+entsprechend an.
+
+--------------------------------------------------------------------------
+
+Mit SetPageSizePixel() kann als Groesse die Groesse der groessten
+TabPage vorgegeben werden. Wenn der Dialog angezeigt wird, wird
+zu dem Zeitpunkt wenn noch keine Groesse gesetzt wurde, dafuer
+die entsprechende Dialoggroesse berechnet und gesetzt. Wenn mit
+SetPageSizePixel() keine Groesse gesetzt wurde, wird als Groesse
+die maximale Groesse der zu diesem Zeitpunkt zugewiesenen TabPages
+berechnet und genommen.
+
+ShowPrevPage()/ShowNextPage() zeigt die vorherige/naechste TabPage
+an. Dazu wird zuerst der Deactivate-Handler vom Dialog gerufen und
+wenn dieser sal_True zurueckgegeben hat, wird der Acivate-Handler
+vom Dialog gerufen und die entsprechende TabPage angezeigt.
+Finnsh() kann gerufen werden, wenn der Finnish-Button betaetigt
+wird. Dort wird dann auch noch der Deactivate-Page-Handler vom
+Dialog und der aktuellen TabPage gerufen und dann der Dialog
+beendet (Close() oder EndDialog()).
+
+Mit AddPage()/RemovePage()/SetPage() koennen die TabPages dem Wizard
+bekannt gemacht werden. Es wird immer die TabPage des aktuellen Levels
+angezeigt, wenn fuer den aktuellen Level keine TabPage zugewiesen
+ist, wird die TabPages des hoechsten Levels angezeigt. Somit kann auch
+immer die aktuelle TabPage ausgetauscht werden, wobei zu
+beruecksichtigen ist, das im Activate-Handler die aktuelle TabPage
+nicht zerstoert werden darf.
+
+Mit SetPrevButton()/SetNextButton() werden der Prev-Button und der
+Next-Button dem Dialog bekannt gemacht. In dem Fall loest der
+Dialog bei Ctr+Tab, Shift+Ctrl+Tab den entsprechenden Click-Handler
+am zugewiesenen Button aus. Die Button werden nicht vom WizardDialog
+disablte. Eine entsprechende Steuerung muss der Benutzer dieses
+Dialoges selber programieren.
+
+Mit AddButton()/RemoveButton() koennen Buttons dem Wizard bekannt
+gemacht werden, die in der Reihenfolge der Hinzufuegung angeordnet
+werden. Die Buttons werden unabhengig von ihrem sichtbarkeitsstatus
+angeordnet, so das auch spaeter ein entsprechender Button angezeigt/
+gehidet werden kann. Der Offset wird in Pixeln angegeben und bezieht
+sich immer auf den nachfolgenden Button. Damit der Abstand zwischen
+den Buttons bei allen Dialogen gleich ist, gibt es das Define
+WIZARDDIALOG_BUTTON_STDOFFSET_X, welches als Standard-Offset genommen
+werden sollte.
+
+Mit ShowButtonFixedLine() kann gesteuert werden, ob die zwischen den
+Buttons und der TabPage eine Trennlinie angezeigt werden soll.
+
+Mit SetViewWindow() und SetViewAlign() kann ein Control gesetzt werden,
+welches als PreView-Window oder fuer die Anzeige von schoenen Bitmaps
+genutzt werden kann.
+
+--------------------------------------------------------------------------
+
+Der ActivatePage()-Handler wird gerufen, wenn eine neue TabPages
+angezeigt wird. In diesem Handler kann beispielsweise die neue
+TabPage erzeugt werden, wenn diese zu diesem Zeitpunkt noch nicht
+erzeugt wurde. Der Handler kann auch als Link gesetzt werden. Mit
+GetCurLevel() kann die aktuelle ebene abgefragt werden, wobei
+Level 0 die erste Seite ist.
+
+Der DeactivatePage()-Handler wird gerufen, wenn eine neue TabPage
+angezeigt werden soll. In diesem Handler kann noch eine Fehler-
+ueberprufung stattfinden und das Umschalten gegebenenfalls verhindert
+werden, indem sal_False zurueckgegeben wird. Der Handler kann auch als
+Link gesetzt werden. Die Defaultimplementierung ruft den Link und
+gibt den Rueckgabewert des Links zurueck und wenn kein Link gesetzt
+ist, wird sal_True zurueckgegeben.
+
+--------------------------------------------------------------------------
+
+Beispiel:
+
+MyWizardDlg-Ctor
+----------------
+
+// add buttons
+AddButton( &maHelpBtn, WIZARDDIALOG_BUTTON_STDOFFSET_X );
+AddButton( &maCancelBtn, WIZARDDIALOG_BUTTON_STDOFFSET_X );
+AddButton( &maPrevBtn );
+AddButton( &maNextBtn, WIZARDDIALOG_BUTTON_STDOFFSET_X );
+AddButton( &maFinnishBtn );
+SetPrevButton( &maPrevBtn );
+SetNextButton( &maNextBtn );
+
+// SetHandler
+maPrevBtn.SetClickHdl( LINK( this, MyWizardDlg, ImplPrevHdl ) );
+maNextBtn.SetClickHdl( LINK( this, MyWizardDlg, ImplNextHdl ) );
+
+// Set PreviewWindow
+SetViewWindow( &maPreview );
+
+// Show line between Buttons and Page
+ShowButtonFixedLine( sal_True );
+
+// Call ActivatePage, because the first page should be created an activated
+ActivatePage();
+
+
+MyWizardDlg-ActivatePage-Handler
+--------------------------------
+
+void MyWizardDlg::ActivatePage()
+{
+ WizardDialog::ActivatePage();
+
+ // Test, if Page is created already
+ if ( !GetPage( GetCurLevel() ) )
+ {
+ // Create and add new page
+ TabPage* pNewTabPage;
+ switch ( GetCurLevel() )
+ {
+ case 0:
+ pNewTabPage = CreateIntroPage();
+ break;
+ case 1:
+ pNewTabPage = CreateSecondPage();
+ break;
+ case 2:
+ pNewTabPage = CreateThirdPage();
+ break;
+ case 3:
+ pNewTabPage = CreateFinnishedPage();
+ break;
+
+ }
+ AddPage( pNewTabPage );
+ }
+}
+
+
+MyWizardDlg-Prev/Next-Handler
+-----------------------------
+
+IMPL_LINK( MyWizardDlg, ImplPrevHdl, PushButton*, pBtn )
+{
+ ShowPrevPage();
+ if ( !GetCurLevel() )
+ pBtn->Disable();
+ return 0;
+}
+
+IMPL_LINK( MyWizardDlg, ImplNextHdl, PushButton*, pBtn )
+{
+ ShowNextPage();
+ if ( GetCurLevel() < 3 )
+ pBtn->Disable();
+ return 0;
+}
+
+*************************************************************************/
+
+// ----------------------
+// - WizardDialog-Types -
+// ----------------------
+
+#define WIZARDDIALOG_BUTTON_STDOFFSET_X 6
+#define WIZARDDIALOG_BUTTON_SMALLSTDOFFSET_X 3
+
+// ----------------
+// - WizardDialog -
+// ----------------
+
+class SVT_DLLPUBLIC WizardDialog : public ModalDialog
+{
+private:
+ Size maPageSize;
+ ImplWizPageData* mpFirstPage;
+ ImplWizButtonData* mpFirstBtn;
+ FixedLine* mpFixedLine;
+ TabPage* mpCurTabPage;
+ PushButton* mpPrevBtn;
+ PushButton* mpNextBtn;
+ Window* mpViewWindow;
+ sal_uInt16 mnCurLevel;
+ WindowAlign meViewAlign;
+ Link maActivateHdl;
+ Link maDeactivateHdl;
+ sal_Int16 mnLeftAlignCount;
+ bool mbEmptyViewMargin;
+
+protected:
+ long LogicalCoordinateToPixel(int iCoordinate);
+ /**sets the number of buttons which should be left-aligned. Normally, buttons are right-aligned.
+
+ only to be used during construction, before any layouting happened
+ */
+ void SetLeftAlignedButtonCount( sal_Int16 _nCount );
+ /** declares the view area to have an empty margin
+
+ Normally, the view area has a certain margin to the top/left/bottom/right of the
+ dialog. By calling this method, you can reduce this margin to 0.
+ */
+ void SetEmptyViewMargin();
+
+#ifdef _SVT_WIZDLG_CXX
+private:
+ SVT_DLLPRIVATE void ImplInitData();
+ SVT_DLLPRIVATE void ImplCalcSize( Size& rSize );
+ SVT_DLLPRIVATE void ImplPosCtrls();
+ SVT_DLLPRIVATE void ImplPosTabPage();
+ SVT_DLLPRIVATE void ImplShowTabPage( TabPage* pPage );
+ SVT_DLLPRIVATE TabPage* ImplGetPage( sal_uInt16 nLevel ) const;
+#endif
+
+public:
+ WizardDialog( Window* pParent, WinBits nStyle = WB_STDTABDIALOG );
+ WizardDialog( Window* pParent, const ResId& rResId );
+ ~WizardDialog();
+
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ virtual void ActivatePage();
+ virtual long DeactivatePage();
+
+ sal_Bool ShowPrevPage();
+ sal_Bool ShowNextPage();
+ sal_Bool ShowPage( sal_uInt16 nLevel );
+ sal_Bool Finnish( long nResult = 0 );
+ sal_uInt16 GetCurLevel() const { return mnCurLevel; }
+
+ void AddPage( TabPage* pPage );
+ void RemovePage( TabPage* pPage );
+ void SetPage( sal_uInt16 nLevel, TabPage* pPage );
+ TabPage* GetPage( sal_uInt16 nLevel ) const;
+
+ void AddButton( Button* pButton, long nOffset = 0 );
+ void RemoveButton( Button* pButton );
+
+ void SetPrevButton( PushButton* pButton ) { mpPrevBtn = pButton; }
+ PushButton* GetPrevButton() const { return mpPrevBtn; }
+ void SetNextButton( PushButton* pButton ) { mpNextBtn = pButton; }
+ PushButton* GetNextButton() const { return mpNextBtn; }
+
+ void ShowButtonFixedLine( sal_Bool bVisible );
+
+ void SetViewWindow( Window* pWindow ) { mpViewWindow = pWindow; }
+ Window* GetViewWindow() const { return mpViewWindow; }
+ void SetViewAlign( WindowAlign eAlign ) { meViewAlign = eAlign; }
+ WindowAlign GetViewAlign() const { return meViewAlign; }
+
+ void SetPageSizePixel( const Size& rSize ) { maPageSize = rSize; }
+ const Size& GetPageSizePixel() const { return maPageSize; }
+
+ void SetActivatePageHdl( const Link& rLink ) { maActivateHdl = rLink; }
+ const Link& GetActivatePageHdl() const { return maActivateHdl; }
+ void SetDeactivatePageHdl( const Link& rLink ) { maDeactivateHdl = rLink; }
+ const Link& GetDeactivatePageHdl() const { return maDeactivateHdl; }
+};
+
+#endif // _SVT_WIZDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/xwindowitem.hxx b/include/svtools/xwindowitem.hxx
new file mode 100644
index 000000000000..fd7a8cd40ff9
--- /dev/null
+++ b/include/svtools/xwindowitem.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 _XWINDOWITEM_HXX_
+#define _XWINDOWITEM_HXX_
+
+
+#include "svtools/svtdllapi.h"
+
+#include <svl/poolitem.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+
+#include <com/sun/star/awt/XWindow.hpp>
+
+class Window;
+
+//////////////////////////////////////////////////////////////////////
+
+class SVT_DLLPUBLIC XWindowItem : public SfxPoolItem
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xWin;
+
+ // disallow use assignment operator
+ XWindowItem & operator = ( const XWindowItem & );
+
+public:
+ TYPEINFO();
+ XWindowItem();
+ XWindowItem( const XWindowItem &rItem );
+ ~XWindowItem();
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual int operator == ( const SfxPoolItem& rAttr ) const;
+
+ Window * GetWindowPtr() const { return VCLUnoHelper::GetWindow( m_xWin ); }
+ com::sun::star::uno::Reference< com::sun::star::awt::XWindow > GetXWindow() const { return m_xWin; }
+};
+
+//////////////////////////////////////////////////////////////////////
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/AccessibleControlShape.hxx b/include/svx/AccessibleControlShape.hxx
new file mode 100644
index 000000000000..54cdd7719c99
--- /dev/null
+++ b/include/svx/AccessibleControlShape.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 _SVX_ACCESSIBILITY_ACCESSIBLE_CONTROL_SHAPE_HXX
+#define _SVX_ACCESSIBILITY_ACCESSIBLE_CONTROL_SHAPE_HXX
+
+#include <svx/AccessibleShape.hxx>
+
+#include <com/sun/star/accessibility/XAccessibleAction.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
+#include <com/sun/star/util/XModeChangeBroadcaster.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include <cppuhelper/implbase3.hxx>
+#include <comphelper/uno3.hxx>
+
+namespace com { namespace sun { namespace star { namespace awt {
+ class XControl;
+} } } }
+
+namespace comphelper
+{
+ class OWrappedAccessibleChildrenManager;
+}
+
+class SdrObject;
+namespace accessibility {
+
+ typedef ::cppu::ImplHelper4 < ::com::sun::star::beans::XPropertyChangeListener
+ , ::com::sun::star::util::XModeChangeListener
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::accessibility::XAccessibleEventListener
+ > AccessibleControlShape_Base;
+/** @descr
+*/
+class AccessibleControlShape
+ :public AccessibleShape
+ ,public AccessibleControlShape_Base
+{
+public:
+ //===== internal ========================================================
+ AccessibleControlShape(
+ const AccessibleShapeInfo& rShapeInfo,
+ const AccessibleShapeTreeInfo& rShapeTreeInfo);
+ virtual ~AccessibleControlShape( );
+
+protected:
+ //--- XAccessible ----------------------------------------
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL getAccessibleContext( ) throw(::com::sun::star::uno::RuntimeException);
+
+ //--- XAccessibleComponent -------------------------------
+ /// forward the focus to the contained control(in alive mode)
+ virtual void SAL_CALL grabFocus( ) throw(::com::sun::star::uno::RuntimeException);
+
+ //--- XAccessibleContext ---------------------------------
+ virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException);
+
+ //--- XServiceInfo ---------------------------------------
+ virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+
+ //--- XInterface -----------------------------------------
+ DECLARE_XINTERFACE( )
+
+ //--- XTypeProvider --------------------------------------
+ DECLARE_XTYPEPROVIDER( )
+
+ //--- XPropertyChangeListener ----------------------------
+ virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ //--- XComponent -----------------------------------------
+ virtual void SAL_CALL disposing( );
+
+ //--- XEventListener -------------------------------------
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
+
+ //--- XModeChangeListener --------------------------------
+ virtual void SAL_CALL modeChanged( const ::com::sun::star::util::ModeChangeEvent& _rSource ) throw(::com::sun::star::uno::RuntimeException);
+
+ //--- XAccessibleEventListener ----------------------------
+ virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ //--- document::XEventListener ----------------------------
+ using AccessibleShape::notifyEvent;
+
+ // XVclContainerListener
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ /** Initialize a new shape. See the documentation of the base' constructor
+ for the reason of this method's existence.
+ */
+ virtual void Init( );
+
+ /// Create a name string that contains the accessible name.
+ virtual OUString
+ CreateAccessibleBaseName( )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ /** Create a unique name string that contains the accessible name. The
+ name consists of the base name and the index.
+ */
+ virtual OUString
+ CreateAccessibleName( )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ /// Create a description string that contains the accessible description.
+ virtual OUString
+ CreateAccessibleDescription( )
+ throw(::com::sun::star::uno::RuntimeException);
+
+#ifdef DBG_UTIL
+ /// Set the specified state
+ virtual sal_Bool SetState( sal_Int16 _nState );
+#endif // DBG_UTIL
+
+ /// (safely) reads the given property from the model of the UNO control
+ OUString getControlModelStringProperty( const OUString& _rPropertyName ) const SAL_THROW(( ));
+
+ /// ensure that our control model exists(will be retrieved upon need only)
+ sal_Bool ensureControlModelAccess( ) SAL_THROW(( ));
+
+ /// 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( );
+
+ /// retrieves the SdrObject of the shape we represent
+ SdrObject* getSdrObject( ) const;
+
+ /** adjusts our AccessibleRole, depending on the control type we're working for
+
+ <p>Only to be called during inituialization</p>
+ */
+ void adjustAccessibleRole( );
+
+ /** initializes composed states of the context
+
+ <p>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.</p>
+ */
+ void initializeComposedState( );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+ m_xControlModel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
+ m_xModelPropsMeta; // cache this for performance reasons
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >
+ m_xUnoControl; // our UNO control
+
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessibleContext >
+ m_aControlContext; // the AccessibleContext of the control
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >
+ m_xControlContextProxy; // the proxy for "aggregating" the AccessibleContext of the control
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider >
+ m_xControlContextTypeAccess; // cached interface of our aggregate
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
+ m_xControlContextComponent; // cached interface of our aggregate
+
+ ::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 ...
+
+private:
+ /** Don't use the default constructor. Use the public constructor that
+ takes the original shape and the parent as arguments instead.
+ */
+ AccessibleControlShape( );
+
+ /// Don't use the constructor. not implemented.
+ AccessibleControlShape(const AccessibleControlShape&);
+
+ /// Don't use the assignment operator. not implemented.
+ AccessibleControlShape& operator= (const AccessibleControlShape&);
+};
+
+} // 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 000000000000..cfe87332fe38
--- /dev/null
+++ b/include/svx/AccessibleGraphicShape.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 _SVX_ACCESSIBILITY_ACCESSIBLE_GRAPHIC_SHAPE_HXX
+#define _SVX_ACCESSIBILITY_ACCESSIBLE_GRAPHIC_SHAPE_HXX
+
+#include <svx/AccessibleShape.hxx>
+#include <com/sun/star/accessibility/XAccessibleImage.hpp>
+#include "svx/svxdllapi.h"
+
+namespace accessibility {
+
+/** @descr
+ This class makes graphic shapes accessible. With respect to its
+ base class <type>AccessibleShape</type> it supports the additional
+ <type>XAccessibleImage</type> interface.
+*/
+class SVX_DLLPUBLIC AccessibleGraphicShape
+ : public AccessibleShape,
+ public ::com::sun::star::accessibility::XAccessibleImage
+{
+public:
+ //===== internal ========================================================
+ AccessibleGraphicShape (
+ const AccessibleShapeInfo& rShapeInfo,
+ const AccessibleShapeTreeInfo& rShapeTreeInfo);
+
+ virtual ~AccessibleGraphicShape (void);
+
+ //===== XAccessibleImage ================================================
+
+ OUString SAL_CALL getAccessibleImageDescription (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ sal_Int32 SAL_CALL getAccessibleImageHeight (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ sal_Int32 SAL_CALL getAccessibleImageWidth (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== XInterface ======================================================
+
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface (const com::sun::star::uno::Type & rType)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL
+ acquire (void)
+ throw ();
+
+ virtual void SAL_CALL
+ release (void)
+ throw ();
+
+ //===== XServiceInfo ====================================================
+
+ /** Returns an identifier for the implementation of this object.
+ */
+ virtual OUString SAL_CALL
+ getImplementationName (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL
+ getSupportedServiceNames (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== XTypeProvider ===================================================
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL
+ getTypes (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ /// Create a name string that contains the accessible name.
+ virtual OUString
+ CreateAccessibleBaseName ()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Create a description string that contains the accessible description.
+ virtual OUString
+ CreateAccessibleDescription ()
+ throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ /** Don't use the default constructor. Use the public constructor that
+ takes the original shape and the parent as arguments instead.
+ */
+ SVX_DLLPRIVATE AccessibleGraphicShape (void);
+
+ /// Don't use the constructor. Not yet implemented.
+ SVX_DLLPRIVATE AccessibleGraphicShape (const AccessibleGraphicShape&);
+
+ /// Don't use the assignment operator. Not yet implemented.
+ SVX_DLLPRIVATE AccessibleGraphicShape& operator= (const AccessibleGraphicShape&);
+};
+
+} // 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 000000000000..1c3fe797ed59
--- /dev/null
+++ b/include/svx/AccessibleOLEShape.hxx
@@ -0,0 +1,123 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_OLE_SHAPE_HXX
+#define _SVX_ACCESSIBILITY_ACCESSIBLE_OLE_SHAPE_HXX
+
+#include <svx/AccessibleShape.hxx>
+
+#include <com/sun/star/accessibility/XAccessibleAction.hpp>
+#include "svx/svxdllapi.h"
+
+namespace accessibility {
+
+/** @descr
+ This class makes OLE objects accessible. With respect to its
+ base class <type>AccessibleShape</type> it supports the additional
+ <type>XAccessibleAction</type> interface.
+*/
+class SVX_DLLPUBLIC AccessibleOLEShape
+ : public AccessibleShape,
+ public ::com::sun::star::accessibility::XAccessibleAction
+{
+public:
+ //===== internal ========================================================
+ AccessibleOLEShape (
+ const AccessibleShapeInfo& rShapeInfo,
+ const AccessibleShapeTreeInfo& rShapeTreeInfo);
+ virtual ~AccessibleOLEShape (void);
+
+ //===== XAccessibleAction ===============================================
+
+ sal_Int32 SAL_CALL getAccessibleActionCount (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ sal_Bool SAL_CALL doAccessibleAction (sal_Int32 nIndex)
+ throw (::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+
+ OUString SAL_CALL getAccessibleActionDescription (sal_Int32 nIndex)
+ throw (::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleKeyBinding> SAL_CALL getAccessibleActionKeyBinding (
+ sal_Int32 nIndex)
+ throw (::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+
+ //===== XInterface ======================================================
+
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface (const com::sun::star::uno::Type & rType)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL
+ acquire (void)
+ throw ();
+
+ virtual void SAL_CALL
+ release (void)
+ throw ();
+
+ //===== XServiceInfo ====================================================
+
+ virtual OUString SAL_CALL
+ getImplementationName (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL
+ getSupportedServiceNames (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== XTypeProvider ===================================================
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL
+ getTypes (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ /// Create a name string that contains the accessible name.
+ virtual OUString
+ CreateAccessibleBaseName ()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Create a description string that contains the accessible description.
+ virtual OUString
+ CreateAccessibleDescription ()
+ throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ /** Don't use the default constructor. Use the public constructor that
+ takes the original shape and the parent as arguments instead.
+ */
+ SVX_DLLPRIVATE AccessibleOLEShape (void);
+
+ /// Don't use the constructor. Not yet implemented.
+ SVX_DLLPRIVATE AccessibleOLEShape (const AccessibleOLEShape&);
+
+ /// Don't use the assignment operator. Not yet implemented.
+ SVX_DLLPRIVATE AccessibleOLEShape& operator= (const AccessibleOLEShape&);
+};
+
+} // 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 000000000000..450b090f7562
--- /dev/null
+++ b/include/svx/AccessibleShape.hxx
@@ -0,0 +1,397 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_HXX
+#define _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_HXX
+
+#include <editeng/AccessibleContextBase.hxx>
+#include <editeng/AccessibleComponentBase.hxx>
+#include <svx/IAccessibleViewForwarderListener.hxx>
+#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <svx/AccessibleTextHelper.hxx>
+#include "svx/svxdllapi.h"
+#include "ChildrenManager.hxx"
+
+class SdrObject;
+
+namespace accessibility {
+
+class AccessibleShapeInfo;
+class AccessibleShapeTreeInfo;
+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,
+ <type>XAccessible</type>, <type>XAccessibleContext</type>,
+ <type>XAccessibleComponent</type> and
+ <type>XAccessibleExtendedComponent</type>.
+
+ <p>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 simultaniously to cope with future extensions or
+ shapes from other projects.
+ <ul>
+ <li>If this shape is a group shape, i.e. a
+ <type>SvxShapeGroup</type> or a <type>Svx3DSceneObject</type>, it
+ can have nested shapes.</li>
+ <li>If this shape is a descendant from <type>SvxShapeText</type>
+ then the text paragraphs are its children.</li>
+ </ul>
+ </p>
+
+ <p>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.</p>
+*/
+class SVX_DLLPUBLIC AccessibleShape
+ : public AccessibleContextBase,
+ public AccessibleComponentBase,
+ public IAccessibleViewForwarderListener,
+ public ::com::sun::star::document::XEventListener,
+ public ::com::sun::star::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
+ Bundel of information passed to this shape and all of its desendants.
+ @attention
+ Always call the <member>init</member> 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);
+
+ /** The destructor releases its children manager and text engine if
+ still existent. These are responsible to send appropriate events.
+ */
+ virtual ~AccessibleShape (void);
+
+ /** Initialize a new shape. See the documentation of the constructor
+ for the reason of this method's existence.
+ */
+ virtual void Init (void);
+
+ /** Compare two accessible shapes using object identity
+ @param rShape
+ This is the second operand.
+ @return
+ Returns true if both shapes are the same object.
+ */
+ virtual bool operator== (const AccessibleShape& rShape);
+
+ /** Set the specified state. If the state is <const>FOCUSED</const>
+ then, additionally to the inherited functionality, the focus
+ listeners registered with the <type>XAccessibleComponent</type>
+ 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 (<TRUE/>), i.e. it has formerly not been set.
+ */
+ virtual sal_Bool SetState (sal_Int16 aState);
+
+ /** Reset the specified state. If the state is <const>FOCUSED</const>
+ then, additionally to the inherited functionality, the focus
+ listeners registered with the <type>XAccessibleComponent</type>
+ 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 (<TRUE/>), i.e. it has formerly been set.
+ */
+ virtual sal_Bool ResetState (sal_Int16 aState);
+
+ /** Return the state of the specified state. Take the
+ <const>FOCUSED</const> state from the accessible edit engine.
+
+ @param aState
+ The state for which to return its value.
+ @return
+ A value of <TRUE/> indicates that the state is set. A <FALSE/>
+ value indicates an unset state or the inability to access the
+ entity that manages the state set.
+
+ */
+ sal_Bool GetState (sal_Int16 aState);
+
+
+ //===== XAccessibleContext ==============================================
+
+ /// Return the number of currently visible children.
+ virtual sal_Int32 SAL_CALL
+ getAccessibleChildCount (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** 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.
+ @raises IndexOutOfBoundsException
+ Throws an exception if the index is not valid.
+ */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible> SAL_CALL
+ getAccessibleChild (sal_Int32 nIndex)
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+
+ /// Return the set of current states.
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
+ getAccessibleStateSet (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return this objects index among the parents children.
+ virtual sal_Int32 SAL_CALL
+ getAccessibleIndexInParent (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== XAccessibleComponent ============================================
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > SAL_CALL
+ getAccessibleAtPoint (const ::com::sun::star::awt::Point& aPoint)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocation (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL getForeground (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL getBackground (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener)
+ throw (::com::sun::star::uno::RuntimeException);
+
+
+ //===== XInterface ======================================================
+
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface (const com::sun::star::uno::Type & rType)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL
+ acquire (void)
+ throw ();
+
+ virtual void SAL_CALL
+ release (void)
+ throw ();
+
+
+ //===== XServiceInfo ====================================================
+
+ /** Returns an identifier for the implementation of this object.
+ */
+ virtual OUString SAL_CALL
+ getImplementationName (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL
+ getSupportedServiceNames (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== XTypeProvider ===================================================
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL
+ getTypes (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== IAccessibleViewForwarderListener ================================
+ virtual void ViewForwarderChanged (ChangeType aChangeType,
+ const IAccessibleViewForwarder* pViewForwarder);
+
+ //===== lang::XEventListener ============================================
+
+ /** Listen for disposing events of the model. The accessible shape
+ remains functional when this happens.
+ */
+ virtual void SAL_CALL
+ disposing (const ::com::sun::star::lang::EventObject& Source)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== document::XEventListener ========================================
+
+ virtual void SAL_CALL
+ notifyEvent (const ::com::sun::star::document::EventObject& rEventObject)
+ throw (::com::sun::star::uno::RuntimeException);
+
+
+ //===== XUnoTunnel ========================================================
+
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelImplementationId() throw();
+ static AccessibleShape* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxIFace ) throw();
+ sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& _rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ //===== Misc ========================================================
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ GetXShape();
+
+ /** set the index _nIndex at the accessible shape
+ @param _nIndex
+ The new index in parent.
+ */
+ inline void setIndexInParent(sal_Int32 _nIndex) { m_nIndexInParent = _nIndex; }
+
+protected:
+ /// Children manager. May be empty if there are no children.
+ ChildrenManager* mpChildrenManager;
+
+ /// Reference to the actual shape.
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape> mxShape;
+
+ /** Bundle of information passed to all shapes in a document tree.
+ */
+ AccessibleShapeTreeInfo maShapeTreeInfo;
+
+ /** Index that is appended to the object's name to disambiguate between
+ different names with the otherwise same name.
+ */
+ long mnIndex;
+
+ /** the index in parent.
+ */
+ sal_Int32 m_nIndexInParent;
+
+ /** The accessible text engine. May be NULL if it can not be created.
+ */
+ AccessibleTextHelper* 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 (void);
+
+ /** Create a base name string that contains the accessible name.
+ */
+ virtual OUString
+ CreateAccessibleBaseName (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Create a unique name string that contains the accessible name. The
+ name consists of the base name and the index.
+ */
+ virtual OUString
+ CreateAccessibleName (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Create a description string that contains the accessible description.
+ virtual OUString
+ CreateAccessibleDescription (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Update the <const>OPAQUE</const> and <const>SELECTED</const> state.
+ */
+ virtual void UpdateStates (void);
+
+private:
+ /** Don't use the default constructor. Use the public constructor that
+ takes the original shape and the parent as arguments instead.
+ */
+ SVX_DLLPRIVATE explicit AccessibleShape (void);
+ /// Don't use the copy constructor. Is there any use for it?
+ SVX_DLLPRIVATE explicit AccessibleShape (const AccessibleShape&);
+ /// Don't use the assignment operator. Do we need this?
+ SVX_DLLPRIVATE AccessibleShape& operator= (const AccessibleShape&);
+
+ /** 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 (void);
+};
+
+} // 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 000000000000..c7ef007c9d65
--- /dev/null
+++ b/include/svx/AccessibleShapeInfo.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 _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_INFO_HXX
+#define _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_INFO_HXX
+
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <svx/IAccessibleParent.hxx>
+#include "svx/svxdllapi.h"
+
+namespace accessibility {
+
+/** @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 <type>AccessibleShapeInfo</type> definition.
+
+ <p>Note that this class complements the
+ <type>AccessibleShapeTreeInfo</type> interface which contains
+ information that is passed to all shapes in a subtree not just to a
+ single shape. </p>
+*/
+class SVX_DLLPUBLIC AccessibleShapeInfo
+{
+public:
+ /** The shape itself for which an accessible object is to be
+ constructed.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape> mxShape;
+
+ /** The accessible parent object of the shape.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible> mxParent;
+
+ /** This object that may be realized by the same implementation as that
+ of that of <member>mxParent</member> 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;
+
+ /** This index is used to disambiguate names of accessible objects. A
+ value of (the default) -1 leads to the use of the object's z-order
+ instead. Because that is not a good substitute, better pass an ever
+ increasing counter.
+ */
+ sal_Int32 mnIndex;
+
+ /** Copy the given values into the members described above.
+ */
+ AccessibleShapeInfo (
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape>& rxShape,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible>& rxParent,
+ IAccessibleParent* pChildrenManager,
+ sal_Int32 nIndex = -1);
+
+ /** Copy the given values into the members described above.
+ The accessible parent implementation object is set to NULL.
+ */
+ AccessibleShapeInfo (
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape>& rxShape,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible>& rxParent,
+ sal_Int32 nIndex = -1);
+
+ ~AccessibleShapeInfo (void);
+
+ AccessibleShapeInfo (const AccessibleShapeInfo&);
+private:
+ // Don't use these three methods.
+ SVX_DLLPRIVATE explicit AccessibleShapeInfo (void);
+ SVX_DLLPRIVATE AccessibleShapeInfo& operator= (const AccessibleShapeInfo&);
+};
+
+} // 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 000000000000..da234960977e
--- /dev/null
+++ b/include/svx/AccessibleShapeTreeInfo.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 _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_TREE_INFO_HXX
+#define _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_TREE_INFO_HXX
+
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <svx/IAccessibleViewForwarder.hxx>
+#include "svx/svxdllapi.h"
+
+class SdrView;
+class Window;
+
+namespace accessibility {
+
+/** 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:
+ <ul>
+ <li>The model broadcaster is used for getting notified about shape
+ changes. Using this broadcaster makes in unnecessary to register at
+ each shape seperately.</li>
+ <li>The view forwarder is responsible for transformation between
+ coordinate systems and for providing the visible area both with respect
+ to a specific window.</li>
+ <li>The SdrView is used for creating accessible edit engines.</li>
+ <li>The Window is used for creating accessible edit engines.</li>
+ </ul>
+*/
+class SVX_DLLPUBLIC AccessibleShapeTreeInfo
+{
+public:
+ /** Use this constructor to create an empty object that is filled later
+ with more meaningfull data.
+ */
+ AccessibleShapeTreeInfo (void);
+
+ /** Create a copy of the given shape info.
+ @param rInfo
+ The shape tree info object to copy.
+ */
+ AccessibleShapeTreeInfo (const AccessibleShapeTreeInfo& rInfo);
+
+ ~AccessibleShapeTreeInfo (void);
+
+ AccessibleShapeTreeInfo& operator= (const AccessibleShapeTreeInfo& rInfo);
+
+ /** Deprecated. Don't use this method.
+ */
+ void SetDocumentWindow (const ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleComponent>& rxViewWindow);
+
+ /** Deprecated. Use the correctly named SetModelBroadcaster method
+ instead.
+ */
+ void SetControllerBroadcaster (const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XEventBroadcaster>& rxControllerBroadcaster);
+ /** Deprecated. Use the correctly named GetModelBroadcaster method
+ instead.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XEventBroadcaster>
+ GetControllerBroadcaster (void) const;
+
+ /** 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XEventBroadcaster>& 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.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XEventBroadcaster>
+ GetModelBroadcaster (void) const;
+
+ /** 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 (void) const;
+
+ /** 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XController>& rxController);
+
+ /** Return the currently set controller.
+ @return
+ The reference to the currently set controller may be empty.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XController>
+ GetController (void) const;
+
+ /** Set the window that is used to construct SvxTextEditSources which in
+ turn is used to create accessible edit engines.
+ */
+ void SetWindow (Window* pWindow);
+
+ /** Return the current Window.
+ @return
+ The returned value may be NULL.
+ */
+ Window* GetWindow (void) const;
+
+ /** 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 (void) const;
+
+private:
+ /** Deprecated.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::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.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XEventBroadcaster> 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.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XController> mxController;
+
+ /** This window is necessary to construct an SvxTextEditSource which in
+ turn is used to create an accessible edit engine.
+ */
+ Window* 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/AccessibleTableShape.hxx b/include/svx/AccessibleTableShape.hxx
new file mode 100644
index 000000000000..fe239cf271c7
--- /dev/null
+++ b/include/svx/AccessibleTableShape.hxx
@@ -0,0 +1,126 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_TABLE_SHAPE_HXX
+#define _SVX_ACCESSIBILITY_ACCESSIBLE_TABLE_SHAPE_HXX
+
+#include <com/sun/star/table/XTable.hpp>
+#include <com/sun/star/accessibility/XAccessibleTable.hpp>
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+
+#include <rtl/ref.hxx>
+
+#include <cppuhelper/implbase2.hxx>
+
+#include <svx/AccessibleShape.hxx>
+
+#include <boost/noncopyable.hpp>
+
+namespace sdr { namespace table {
+ class SvxTableController;
+} }
+
+namespace accessibility
+{
+ class AccessibleTableShapeImpl;
+
+ typedef ::cppu::ImplInheritanceHelper2< AccessibleShape,
+ ::com::sun::star::accessibility::XAccessibleSelection,
+ ::com::sun::star::accessibility::XAccessibleTable
+ > AccessibleTableShape_Base;
+/** @descr
+*/
+class AccessibleTableShape : boost::noncopyable, public AccessibleTableShape_Base
+{
+public:
+ AccessibleTableShape( const AccessibleShapeInfo& rShapeInfo, const AccessibleShapeTreeInfo& rShapeTreeInfo );
+ virtual ~AccessibleTableShape( );
+
+ virtual void Init (void);
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
+ // XAccessible
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL getAccessibleContext( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleContext
+ virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL getAccessibleRole (void) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleTable
+ virtual sal_Int32 SAL_CALL getAccessibleRowCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAccessibleColumnCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleCaption( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleSummary( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleSelection
+ virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw ( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw ( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL clearAccessibleSelection( ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL selectAllAccessibleChildren( ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw ( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw ( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL disposing( );
+
+ using AccessibleShape::disposing;
+
+protected:
+ virtual OUString CreateAccessibleBaseName(void) throw (::com::sun::star::uno::RuntimeException);
+
+ sdr::table::SvxTableController* getTableController();
+
+ void checkCellPosition( sal_Int32 nCol, sal_Int32 nRow ) throw ( ::com::sun::star::lang::IndexOutOfBoundsException );
+ void getColumnAndRow( sal_Int32 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow ) throw (::com::sun::star::lang::IndexOutOfBoundsException );
+
+private:
+ rtl::Reference< AccessibleTableShapeImpl > mxImpl;
+};
+
+} // 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 000000000000..c930af0cb2e4
--- /dev/null
+++ b/include/svx/AccessibleTextHelper.hxx
@@ -0,0 +1,425 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_ACCESSILE_TEXT_HELPER_HXX_
+#define _SVX_ACCESSILE_TEXT_HELPER_HXX_
+
+#include <memory>
+#include <sal/types.h>
+#include <tools/gen.hxx>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+#include "svx/svxdllapi.h"
+
+
+class SvxTextForwarder;
+class SvxViewForwarder;
+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
+ every one 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
+ TEXT_HINT_PARAINSERTED 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. If the Remove/AddEventListener
+ methods are overwritten, make sure FireEvent is adapted,
+ too.
+
+ @see SvxEditSource
+ @see SvxTextForwarder
+ @see SvxViewForwarder
+ @see SvxEditViewForwarder
+ */
+ class SVX_DLLPUBLIC AccessibleTextHelper
+ {
+
+ 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.
+
+ */
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ explicit AccessibleTextHelper( ::std::auto_ptr< SvxEditSource > pEditSource );
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+ virtual ~AccessibleTextHelper();
+
+ protected:
+
+ // declared, but not defined
+ AccessibleTextHelper( const AccessibleTextHelper& );
+ // declared, but not defined
+ AccessibleTextHelper& operator= ( const AccessibleTextHelper& );
+
+ public:
+ /** Query the current edit source
+
+ @attention This method returns by reference, so you are
+ responsible for serialization (typically, you aquired the
+ solar mutex when calling this method). Thus, the method
+ should only be called from the main office thread.
+
+ */
+ virtual const SvxEditSource& GetEditSource() const SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** 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: EDITSOURCE_HINT_PARASMOVED,
+ EDITSOURCE_HINT_SELECTIONCHANGED, TEXT_HINT_MODIFIED,
+ TEXT_HINT_PARAINSERTED, TEXT_HINT_PARAREMOVED,
+ TEXT_HINT_TEXTHEIGHTCHANGED,
+ TEXT_HINT_VIEWSCROLLED. 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 SFX_HINT_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:
+ HINT_BEGEDIT and HINT_ENDEDIT. When the
+ AccessibleTextHelper receives a HINT_BEGEDIT, it expects
+ the SvxEditSource already in edit mode. On a HINT_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::auto_ptr<SvxEditSource>(NULL)) in
+ your dispose() method.
+
+ @param pEditSource
+ The new edit source to set. Object ownership is transferred
+ from the caller to the callee.
+ */
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ virtual void SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) SAL_THROW((::com::sun::star::uno::RuntimeException));
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+
+ /** 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.
+ */
+ virtual void SetEventSource( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rInterface );
+
+ /** Get the event source
+
+ @return the interface that is set as the source for
+ accessibility events sent by this object.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetEventSource() const;
+
+ /** 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)
+ */
+ virtual void SetOffset( const Point& rPoint );
+
+ /** Query offset of EditEngine/Outliner from parent
+
+ @return the offset in screen coordinates (i.e. pixel)
+ */
+ virtual Point GetOffset() const;
+
+ /** 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 it's 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.
+ */
+ virtual 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.
+ */
+ virtual 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
+ com::sun::star::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 TEXT_HINT_VIEWSCROLLED). Normally, there should
+ not be a need to call this method.
+ */
+ virtual void UpdateChildren() SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** 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).
+ */
+ virtual 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 sal_True if
+ focus is gotten, sal_False otherwise.
+
+ @see HaveFocus()
+ */
+ virtual void SetFocus( sal_Bool bHaveFocus = sal_True ) SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** 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(sal_True), this method might
+ return sal_False. This is the case if one of the children
+ actually got the focus.
+
+ @return the state of the focus ownership
+ */
+ virtual sal_Bool HaveFocus() SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ /** Call this method to invoke all event listeners with the given event
+
+ @attention Fires state change events, therefore, don't hold any mutex
+
+ @param nEventId
+ Id of the event to send, @see AccessibleEventId
+
+ @param rNewValue
+ The value we've changed into
+
+ @param rOldValue
+ The old value before the change
+ */
+ virtual void FireEvent( const sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue = ::com::sun::star::uno::Any(),
+ const ::com::sun::star::uno::Any& rOldValue = ::com::sun::star::uno::Any() ) const;
+
+ /** Call this method to invoke all event listeners with the given event
+
+ @attention Fires state change events, therefore, don't hold any mutex
+
+ @param rEvent
+ The event to send, @see AccessibleEventObject
+
+ */
+ // TODO: make that virtual next time
+ void FireEvent( const ::com::sun::star::accessibility::AccessibleEventObject& rEvent ) const;
+
+ /** Query select state of the text managed by this object
+
+ @attention Don't call with locked mutexes. You may hold
+ the solar mutex, but this method aquires it anyway.
+
+ @return sal_True, if the text or parts of it are currently selected
+ */
+ virtual sal_Bool IsSelected() const;
+
+ // XAccessibleContext child handling methods
+ //-----------------------------------------------------------------
+ /** Implements getAccessibleChildCount
+
+ @attention Don't call with locked mutexes. You may hold
+ the solar mutex, but this method aquires it anyway.
+ */
+ virtual sal_Int32 GetChildCount() SAL_THROW((::com::sun::star::uno::RuntimeException));
+ /** Implements getAccessibleChild
+
+ @attention Don't call with locked mutexes. You may hold
+ the solar mutex, but this method aquires it anyway.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetChild( sal_Int32 i ) SAL_THROW((::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException));
+
+ // XAccessibleEventBroadcaster child related methods
+ //-----------------------------------------------------------------
+ /** Implements addEventListener
+
+ @attention Don't call with locked mutexes
+ */
+ virtual void AddEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) SAL_THROW((::com::sun::star::uno::RuntimeException));
+ /** Implements removeEventListener
+
+ @attention Don't call with locked mutexes
+ */
+ virtual void RemoveEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ // XAccessibleComponent child related methods
+ //-----------------------------------------------------------------
+ /** Implements getAccessibleAt
+
+ @attention Don't call with locked mutexes. You may hold
+ the solar mutex, but this method aquires it anyway.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL GetAt( const ::com::sun::star::awt::Point& aPoint ) SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ private:
+
+ /// @dyn
+ const std::auto_ptr< AccessibleTextHelper_Impl > mpImpl;
+
+ };
+
+} // end of namespace accessibility
+
+#endif /* _SVX_ACCESSILE_TEXT_HELPER_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 000000000000..ce616409922e
--- /dev/null
+++ b/include/svx/ActionDescriptionProvider.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 _SVX_ACTIONDESCRIPTIONPROVIDER_HXX
+#define _SVX_ACTIONDESCRIPTIONPROVIDER_HXX
+
+#include "svx/svxdllapi.h"
+
+// header for class OUString
+#include <rtl/ustring.hxx>
+
+//-----------------------------------------------------------------------------
+/** 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 ActionType
+ {
+ INSERT
+ , DELETE
+ , CUT
+ , MOVE
+ , RESIZE
+ , ROTATE
+ , TRANSFORM
+ , FORMAT
+ , MOVE_TOTOP
+ , MOVE_TOBOTTOM
+ , POS_SIZE
+ };
+
+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 000000000000..6f05fe95426a
--- /dev/null
+++ b/include/svx/ChildrenManager.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 _SVX_ACCESSIBILITY_CHILDREN_MANAGER_HXX
+#define _SVX_ACCESSIBILITY_CHILDREN_MANAGER_HXX
+
+#include <svx/IAccessibleViewForwarderListener.hxx>
+#include <svx/AccessibleShapeTreeInfo.hxx>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <memory>
+#include "svx/svxdllapi.h"
+
+namespace accessibility {
+
+class AccessibleContextBase;
+class AccessibleShape;
+class ChildrenManagerImpl;
+
+/** The <type>AccessibleChildrenManager</type> 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.
+
+ <p>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
+ <member>SetShapeList</member>. Accessibility objects which represent
+ these shapes are constructed usually on demand. The second source is a
+ set of single <type>AccessibleShape</type> objects added by calls to
+ <member>AddAccessibleShape</member>. 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
+ <member>ClearAccessibleShapeList</member>. The actual set of children
+ accessible through the <member>GetChildrenCount</member> and
+ <member>GetChild</member> methods are the accessible objects that lie
+ completely or partially inside the visible area obtained from the view
+ forwarder in the shape tree info.</p>
+
+ <p>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 <type>document::XEventListener</type>, the change from
+ XShape references to the associated XAccessible reference, and the
+ creation of an XAccessibleEventObject. The event object is then passed
+ to the <method>fireEvent</method> method of the context and from there
+ forwarded to all listeners.</p>
+
+ <p>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.</p>
+*/
+class SVX_DLLPUBLIC ChildrenManager
+ : public IAccessibleViewForwarderListener
+{
+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 seperately 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
+ Bundel of information passed down the shape tree.
+ @param rContext
+ An accessible context object that is called for fireing events
+ for new and deleted children, i.e. that holds a list of
+ listeners to be informed.
+ */
+ ChildrenManager (const ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible>& rxParent,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShapes>& rxShapeList,
+ const AccessibleShapeTreeInfo& rShapeTreeInfo,
+ AccessibleContextBase& rContext);
+
+ /** If there still are managed children these are marked as DEFUNC and
+ released.
+ */
+ virtual ~ChildrenManager (void);
+
+ /** Return the number of currently visible accessible children.
+ @return
+ If there are no children a 0 is returned.
+ */
+ long GetChildCount (void) 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.
+ @raises
+ Throws an IndexOutOfBoundsException if the index is not valid.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible>
+ GetChild (long nIndex)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IndexOutOfBoundsException);
+
+ /** 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 seperate updates of a modified children list
+ and visible area.
+ @param bCreateNewObjectsOnDemand
+ If </true> then accessible objects associated with the visible
+ shapes are created only when asked for. No event is sent on
+ creation. If </false> 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::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 pShape
+ This class <em>does</em> take ownership of the argument.
+ */
+ void AddAccessibleShape (std::auto_ptr<AccessibleShape> pShape);
+
+ /** Clear the list of accessible shapes which have been added by
+ previous calls to <member>AddAccessibleShape</member>.
+ */
+ void ClearAccessibleShapeList (void);
+
+ /** 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& rShapeTreeInfo);
+
+ /** Update the SELECTED and FOCUSED states of all visible children
+ according to the given selection. This includes setting
+ <em>and</em> resetting the states.
+ */
+ void UpdateSelection (void);
+
+ /** Return whether one of the shapes managed by this object has
+ currently the focus.
+ @return
+ Returns <true/> when there is a shape that has the focus and
+ <false/> when there is no such shape.
+ */
+ bool HasFocus (void);
+
+ /** When there is a shape that currently has the focus,
+ i.e. <member>HasFocus()</member> returns <true/> then remove the
+ focus from that shape. Otherwise nothing changes.
+ */
+ void RemoveFocus (void);
+
+ //===== IAccessibleViewForwarderListener ================================
+ virtual void ViewForwarderChanged (ChangeType aChangeType,
+ const IAccessibleViewForwarder* pViewForwarder);
+
+protected:
+ ChildrenManagerImpl* mpImpl;
+
+private:
+ // Don't use the copy constructor or the assignment operator. They are
+ // not implemented (and are not intended to be).
+ SVX_DLLPRIVATE ChildrenManager (const ChildrenManager&);
+ SVX_DLLPRIVATE ChildrenManager& operator= (const ChildrenManager&);
+};
+
+} // end of namespace accessibility
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/DescriptionGenerator.hxx b/include/svx/DescriptionGenerator.hxx
new file mode 100644
index 000000000000..fce8478719c9
--- /dev/null
+++ b/include/svx/DescriptionGenerator.hxx
@@ -0,0 +1,200 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#ifndef _SVX_ACCESSIBILITY_DESCRIPTION_GENERATOR_HXX
+#define _SVX_ACCESSIBILITY_DESCRIPTION_GENERATOR_HXX
+
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "svx/svxdllapi.h"
+
+
+namespace accessibility {
+
+/** This class creates description strings for shapes.
+ <p>Initialized with a given shape additional calls to the
+ <member>addProperty</member> method will build a descriptive string that
+ starts with a general shape description and the shapes style. Appended
+ are all the specified property names and values that differ from the
+ default values in the style.</p>
+*/
+class SVX_DLLPUBLIC DescriptionGenerator
+{
+public:
+ enum PropertyType {
+ COLOR,
+ INTEGER,
+ STRING,
+ FILL_STYLE
+ };
+
+ /** Creates a new description generator with an empty description
+ string. Usually you will want to call initialize next to specifiy
+ a general description of the shape.
+ @param xShape
+ The shape from which properties will be extracted by later calls
+ to <member>addProperty</member>.
+ */
+ DescriptionGenerator (const ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape>& xShape);
+
+ ~DescriptionGenerator (void);
+
+ /** Initialize the description with the given prefix followed by the
+ shape's style in parantheses and a colon.
+ @param sPrefix
+ An introductory description of the shape that is made more
+ specific by later calls to <member>addProperty</member>.
+ */
+ void Initialize (OUString sPrefix);
+
+ /** Initialize the description with the specified string from the
+ resource followed by the shape's style in parantheses and a colon.
+ @param nResourceId
+ A resource id the specifies the introductory description of the
+ shape that is made more specific by later calls to
+ <member>addProperty</member>.
+ */
+ void Initialize (sal_Int32 nResourceId);
+
+ /** Returns the description string and then resets it. Usually called
+ as last method before destroying the object.
+ @return
+ The description string in its current form.
+ */
+ OUString operator() (void);
+
+ /** Add the given property name and its associated value to the
+ description string. If the property value does not differ from the
+ default value of the shape's style then the description string is
+ not modified.
+ @param sPropertyName
+ The Name of the property to append.
+ @param aType
+ Type of the property's value. It controls the transformation
+ into the value's string representation.
+ @param sLocalizedName
+ Localized name of the property. An empty string tells the
+ method to use the property name instead.
+ @param nWhichId
+ This which id is used to localize the property value. If it is
+ not known a value of -1 signals to use a default representation.
+ */
+ void AddProperty (const OUString& sPropertyName,
+ PropertyType aType,
+ const OUString& sLocalizedName=OUString(),
+ long nWhichId=-1);
+
+ /** Add the given property name and its associated value to the
+ description string. If the property value does not differ from the
+ default value of the shape's style then the description string is
+ not modified. This method forwards the request to its cousing but
+ first replaces the id of the localized name by the associated string
+ from the resource.
+ @param sPropertyName
+ The Name of the property to append.
+ @param aType
+ Type of the property's value. It controls the transformation
+ into the value's string representation.
+ @param nResourceId
+ Id of the kocalized name of the property int the resource.
+ @param nWhichId
+ This which id is used to localize the property value. If it is
+ not known a value of -1 signals to use a default representation.
+ */
+ void AddProperty (const OUString& sPropertyName,
+ PropertyType aType,
+ sal_Int32 nResourceId,
+ long nWhichId=-1);
+
+ /** Append the given string as is to the current description.
+ @param sString
+ String to append to the current description. It is not modified
+ in any way.
+ */
+ void AppendString (const OUString& sString);
+
+ /** Add properties that describe line and border attributes.
+ */
+ void AddLineProperties (void);
+
+ /** Add properties that describe how areas are filled.
+ */
+ void AddFillProperties (void);
+
+ /** Add properties that describesattributes of 3D objects.
+ */
+ void Add3DProperties (void);
+
+ /** Add properties that describe text attributes.
+ */
+ void AddTextProperties (void);
+
+private:
+ /// Reference to the shape from which the properties are extracted.
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> mxShape;
+
+ /// Reference to the shape's property set.
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> mxSet;
+
+ /// The description string that is build.
+ OUStringBuffer msDescription;
+
+ /** This flag is used to determine whether to insert a separator e.g. a
+ comma before the next property.
+ */
+ bool mbIsFirstProperty;
+
+ /** Add a property value formated as color to the description string.
+ */
+ SVX_DLLPRIVATE void AddColor (const OUString& sPropertyName,
+ const OUString& sLocalizedName);
+
+ /** Add a property value formated as integer to the description string.
+ */
+ SVX_DLLPRIVATE void AddInteger (const OUString& sPropertyName,
+ const OUString& sLocalizedName);
+
+ /** Add a property value formated as string to the description string.
+ @param sPropertyName
+ Name of the property.
+ */
+ SVX_DLLPRIVATE void AddString (const OUString& sPropertyName,
+ const OUString& sLocalizedName, long nWhichId = -1);
+
+ /** Add a property value formated as fill style to the description
+ string. If the fill style is <const>HATCH</const>,
+ <const>GRADIENT</const>, or <const>BITMAP</const>, then the of the
+ hatch, gradient, or bitmap is appended as well.
+ @param sPropertyName
+ Name of the property. Usually this will be "FillStyle".
+ */
+ SVX_DLLPRIVATE void AddFillStyle (const OUString& sPropertyName,
+ const OUString& sLocalizedName);
+};
+
+
+} // end of namespace accessibility
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/EnhancedCustomShape2d.hxx b/include/svx/EnhancedCustomShape2d.hxx
new file mode 100644
index 000000000000..600e247db6b5
--- /dev/null
+++ b/include/svx/EnhancedCustomShape2d.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 _ENHANCEDCUSTOMSHAPE2D_HXX
+#define _ENHANCEDCUSTOMSHAPE2D_HXX
+
+#include <svx/msdffdef.hxx>
+#include <svx/sdasitm.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <svl/itemset.hxx>
+#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeParameter.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
+#include <svx/EnhancedCustomShapeFunctionParser.hxx>
+#include <tools/gen.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <vector>
+
+#define DFF_CUSTOMSHAPE_FLIP_V 1
+#define DFF_CUSTOMSHAPE_FLIP_H 2
+#define DFF_CUSTOMSHAPE_EXCH 4
+
+class SdrModel;
+class SdrObject;
+class SfxItemSet;
+struct SvxMSDffVertPair;
+struct SvxMSDffCalculationData;
+struct SvxMSDffTextRectangles;
+
+#define HANDLE_FLAGS_MIRRORED_X 0x0001
+#define HANDLE_FLAGS_MIRRORED_Y 0x0002
+#define HANDLE_FLAGS_SWITCHED 0x0004
+#define HANDLE_FLAGS_POLAR 0x0008
+#define HANDLE_FLAGS_MAP 0x0010
+#define HANDLE_FLAGS_RANGE_X_MINIMUM 0x0020
+#define HANDLE_FLAGS_RANGE_X_MAXIMUM 0x0040
+#define HANDLE_FLAGS_RANGE_Y_MINIMUM 0x0080
+#define HANDLE_FLAGS_RANGE_Y_MAXIMUM 0x0100
+#define HANDLE_FLAGS_RADIUS_RANGE_MINIMUM 0x0200
+#define HANDLE_FLAGS_RADIUS_RANGE_MAXIMUM 0x0400
+#define HANDLE_FLAGS_REFX 0x0800
+#define HANDLE_FLAGS_REFY 0x1000
+#define HANDLE_FLAGS_REFANGLE 0x2000
+#define HANDLE_FLAGS_REFR 0x4000
+
+// 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 SdrPathObj;
+
+class EnhancedCustomShape2d : public SfxItemSet
+{
+ SdrObject* pCustomShapeObj;
+ MSO_SPT eSpType;
+
+ sal_Int32 nCoordLeft;
+ sal_Int32 nCoordTop;
+ sal_Int32 nCoordWidthG;
+ sal_Int32 nCoordHeightG;
+ sal_Int32 nCoordWidth;
+ sal_Int32 nCoordHeight;
+ Rectangle aLogicRect;
+
+ double fXScale;
+ double fYScale;
+ double fXRatio;
+ double fYRatio;
+
+ sal_Bool bOOXMLShape;
+
+ sal_Int32 nXRef;
+ sal_Int32 nYRef;
+ sal_uInt32 nFlags;
+ sal_uInt32 nColorData;
+
+ /*
+
+ */
+ struct EquationResult {
+ sal_Bool bReady;
+ double fValue;
+ };
+ com::sun::star::uno::Sequence< OUString > seqEquations;
+ std::vector< ::boost::shared_ptr< EnhancedCustomShape::ExpressionNode > > vNodesSharedPtr;
+ std::vector< EquationResult > vEquationResults;
+
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > seqSegments;
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair> seqCoordinates;
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > seqTextFrames;
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair> seqGluePoints;
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue > seqAdjustmentValues;
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValues > seqHandles;
+ com::sun::star::uno::Sequence< com::sun::star::awt::Size > seqSubViewSize;
+
+ sal_Bool bTextFlow : 1;
+ sal_Bool bFilled : 1;
+ sal_Bool bStroked : 1;
+
+ sal_Bool bFlipH;
+ sal_Bool bFlipV;
+ sal_Int32 nRotateAngle;
+
+ bool SetAdjustValueAsDouble( const double& rValue, const sal_Int32 nIndex );
+ sal_Int32 GetLuminanceChange( sal_uInt32 nIndex ) const;
+ Color GetColorData( const Color& rFillColor, sal_uInt32 nIndex, double dBrightness ) const;
+ void AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rCustomShapeSet,
+ sal_uInt32& nColorIndex, sal_uInt32 nColorCount);
+ bool GetParameter( double& rParameterReturnValue, const com::sun::star::drawing::EnhancedCustomShapeParameter&,
+ const bool bReplaceGeoWidth, const bool bReplaceGeoHeight ) const;
+ Point GetPoint( const com::sun::star::drawing::EnhancedCustomShapeParameterPair&,
+ const bool bScale = true, const bool bReplaceGeoSize = false ) const;
+
+ void CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegmentInd, std::vector< SdrPathObj* >& rObjectList,
+ sal_Bool bLineGeometryNeededOnly, sal_Bool bSortFilledObjectsToBack,
+ sal_Int32 nIndex );
+ SdrObject* CreatePathObj( sal_Bool bLineGeometryNeededOnly );
+ const sal_Int32* ApplyShapeAttributes( const SdrCustomShapeGeometryItem& rItem );
+
+ void SetPathSize( sal_Int32 nIndex = 0 );
+
+ public :
+
+ struct Handle
+ {
+ sal_uInt32 nFlags;
+
+ sal_Bool bMirroredX;
+ sal_Bool bMirroredY;
+ sal_Bool bSwitched;
+
+ com::sun::star::drawing::EnhancedCustomShapeParameterPair aPosition;
+ com::sun::star::drawing::EnhancedCustomShapeParameterPair aPolar;
+
+ sal_Int32 nRefX;
+ sal_Int32 nRefY;
+ sal_Int32 nRefAngle;
+ sal_Int32 nRefR;
+
+ com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum;
+ com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum;
+ com::sun::star::drawing::EnhancedCustomShapeParameter aXRangeMinimum;
+ com::sun::star::drawing::EnhancedCustomShapeParameter aXRangeMaximum;
+ com::sun::star::drawing::EnhancedCustomShapeParameter aYRangeMinimum;
+ com::sun::star::drawing::EnhancedCustomShapeParameter aYRangeMaximum;
+
+ Handle() : bMirroredX ( sal_False ), bMirroredY ( sal_False ), bSwitched( sal_False ),
+ nRefX( -1 ), nRefY( -1 ), nRefAngle( -1 ), nRefR( -1 ) {};
+ };
+
+ sal_Bool IsFlipVert() { return bFlipV; };
+ sal_Bool IsFlipHorz() { return bFlipH; };
+ sal_Int32 GetRotateAngle() { return nRotateAngle; };
+ SVX_DLLPUBLIC bool IsPostRotate() const;
+
+ SVX_DLLPUBLIC SdrObject* CreateLineGeometry();
+ SVX_DLLPUBLIC SdrObject* CreateObject( sal_Bool bLineGeometryNeededOnly );
+ SVX_DLLPUBLIC void ApplyGluePoints( SdrObject* pObj );
+ SVX_DLLPUBLIC Rectangle GetTextRect() const;
+
+ SVX_DLLPUBLIC sal_uInt32 GetHdlCount() const;
+ SVX_DLLPUBLIC bool GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const;
+ SVX_DLLPUBLIC bool SetHandleControllerPosition( const sal_uInt32 nIndex, const com::sun::star::awt::Point& rPosition );
+
+ SVX_DLLPUBLIC EnhancedCustomShape2d( SdrObject* pSdrObjCustomShape );
+ SVX_DLLPUBLIC ~EnhancedCustomShape2d();
+
+ enum EnumFunc
+ {
+ ENUM_FUNC_PI,
+ ENUM_FUNC_LEFT,
+ ENUM_FUNC_TOP,
+ ENUM_FUNC_RIGHT,
+ ENUM_FUNC_BOTTOM,
+ ENUM_FUNC_XSTRETCH,
+ ENUM_FUNC_YSTRETCH,
+ ENUM_FUNC_HASSTROKE,
+ ENUM_FUNC_HASFILL,
+ ENUM_FUNC_WIDTH,
+ ENUM_FUNC_HEIGHT,
+ ENUM_FUNC_LOGWIDTH,
+ ENUM_FUNC_LOGHEIGHT
+ };
+ double GetEnumFunc( const EnumFunc eVal ) const;
+
+ double GetAdjustValueAsDouble( const sal_Int32 nIndex ) const;
+ double GetEquationValueAsDouble( const sal_Int32 nIndex ) const;
+ sal_Int32 GetAdjustValueAsInteger( const sal_Int32 nIndex, const sal_Int32 nDefault = 0 ) const;
+
+ SVX_DLLPUBLIC static OUString GetEquation( const sal_uInt16 nFlags, sal_Int16 nPara1, sal_Int16 nPara2, sal_Int16 nPara3 );
+
+ static void AppendEnhancedCustomShapeEquationParameter( OUString& rParameter, const sal_Int16 nPara, const bool bIsSpecialValue );
+
+ static void SetEnhancedCustomShapeEquationParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
+ rParameter, const sal_Int16 nPara, const sal_Bool bIsSpecialValue );
+ SVX_DLLPUBLIC static void SetEnhancedCustomShapeParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
+ rParameter, const sal_Int32 nValue );
+ SVX_DLLPUBLIC static void SetEnhancedCustomShapeHandleParameter( com::sun::star::drawing::EnhancedCustomShapeParameter&
+ rParameter, const sal_Int32 nPara, const bool bIsSpecialValue, bool bHorz );
+ static bool ConvertSequenceToEnhancedCustomShape2dHandle( const com::sun::star::beans::PropertyValues& rHandleProperties,
+ EnhancedCustomShape2d::Handle& rDestinationHandle );
+ 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 000000000000..28df983df61c
--- /dev/null
+++ b/include/svx/EnhancedCustomShapeFunctionParser.hxx
@@ -0,0 +1,208 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _ENHANCEDCUSTOMSHAPEFUNCTIONPARSER_HXX
+#define _ENHANCEDCUSTOMSHAPEFUNCTIONPARSER_HXX
+
+#include <sal/config.h>
+#include <boost/shared_ptr.hpp>
+#include "EnhancedCustomShapeFunctionParser.hxx"
+#include <com/sun/star/drawing/EnhancedCustomShapeParameter.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
+#include <vector>
+
+#include <svx/svxdllapi.h>
+
+struct EnhancedCustomShapeEquation
+{
+ sal_Int32 nOperation;
+ sal_Int32 nPara[ 3 ];
+
+ EnhancedCustomShapeEquation() :
+ nOperation ( 0 )
+ {
+ nPara[ 0 ] = nPara[ 1 ] = nPara[ 2 ] = 0;
+ }
+};
+
+class EnhancedCustomShape2d;
+
+namespace EnhancedCustomShape {
+
+enum ExpressionFunct
+{
+ FUNC_CONST,
+
+ ENUM_FUNC_PI,
+ ENUM_FUNC_LEFT,
+ ENUM_FUNC_TOP,
+ ENUM_FUNC_RIGHT,
+ ENUM_FUNC_BOTTOM,
+ ENUM_FUNC_XSTRETCH,
+ ENUM_FUNC_YSTRETCH,
+ ENUM_FUNC_HASSTROKE,
+ ENUM_FUNC_HASFILL,
+ ENUM_FUNC_WIDTH,
+ ENUM_FUNC_HEIGHT,
+ ENUM_FUNC_LOGWIDTH,
+ ENUM_FUNC_LOGHEIGHT,
+ ENUM_FUNC_ADJUSTMENT,
+ ENUM_FUNC_EQUATION,
+
+ UNARY_FUNC_ABS,
+ UNARY_FUNC_SQRT,
+ UNARY_FUNC_SIN,
+ UNARY_FUNC_COS,
+ UNARY_FUNC_TAN,
+ UNARY_FUNC_ATAN,
+ UNARY_FUNC_NEG,
+
+ BINARY_FUNC_PLUS,
+ BINARY_FUNC_MINUS,
+ BINARY_FUNC_MUL,
+ BINARY_FUNC_DIV,
+ BINARY_FUNC_MIN,
+ BINARY_FUNC_MAX,
+ BINARY_FUNC_ATAN2,
+
+ TERNARY_FUNC_IF
+};
+
+#define EXPRESSION_FLAG_SUMANGLE_MODE 1
+
+SVX_DLLPUBLIC void FillEquationParameter( const com::sun::star::drawing::EnhancedCustomShapeParameter&, const sal_Int32, EnhancedCustomShapeEquation& );
+
+class 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 obtimizations, 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 com::sun::star::drawing::EnhancedCustomShapeParameter fillNode(
+ std::vector< EnhancedCustomShapeEquation >& rEquations, ExpressionNode* pOptionalArg, sal_uInt32 nFlags ) = 0;
+};
+typedef ::boost::shared_ptr< ExpressionNode > ExpressionNodeSharedPtr;
+
+/** This exception is thrown, when the arithmetic expression
+ parser failed to parse a string.
+ */
+struct ParseError
+{
+ ParseError() {}
+ ParseError( const char* ) {}
+};
+
+class FunctionParser
+{
+public:
+
+ /** Parse a string
+
+ The following grammar is accepted by this method:
+ <code>
+
+ 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
+
+ </code>
+
+ @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.
+ */
+
+ SVX_DLLPUBLIC static ExpressionNodeSharedPtr parseFunction( const OUString& rFunction, const EnhancedCustomShape2d& rCustoShape );
+
+private:
+ // disabled constructor/destructor, since this is
+ // supposed to be a singleton
+ FunctionParser();
+
+ // default: disabled copy/assignment
+ FunctionParser(const FunctionParser&);
+ FunctionParser& operator=( const FunctionParser& );
+};
+
+}
+
+#endif /* _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 000000000000..4669e68ca137
--- /dev/null
+++ b/include/svx/EnhancedCustomShapeGeometry.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 _ENHANCEDCUSTOMSHAPEGEOMETRY_HXX
+#define _ENHANCEDCUSTOMSHAPEGEOMETRY_HXX
+
+#include <sal/types.h>
+#include <svx/msdffdef.hxx>
+
+struct SvxMSDffVertPair
+{
+ sal_Int32 nValA;
+ sal_Int32 nValB;
+};
+struct SvxMSDffCalculationData
+{
+ sal_uInt16 nFlags;
+ sal_Int16 nVal[ 3 ];
+};
+struct SvxMSDffTextRectangles
+{
+ SvxMSDffVertPair nPairA;
+ SvxMSDffVertPair nPairB;
+};
+
+#define MSDFF_HANDLE_FLAGS_MIRRORED_X 0x0001
+#define MSDFF_HANDLE_FLAGS_MIRRORED_Y 0x0002
+#define MSDFF_HANDLE_FLAGS_SWITCHED 0x0004
+#define MSDFF_HANDLE_FLAGS_POLAR 0x0008
+#define MSDFF_HANDLE_FLAGS_MAP 0x0010
+#define MSDFF_HANDLE_FLAGS_RANGE 0x0020
+#define MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL 0x0080
+#define MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL 0x0100
+#define MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL 0x0200
+#define MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL 0x0400
+#define MSDFF_HANDLE_FLAGS_CENTER_X_IS_SPECIAL 0x0800
+#define MSDFF_HANDLE_FLAGS_CENTER_Y_IS_SPECIAL 0x1000
+#define MSDFF_HANDLE_FLAGS_RADIUS_RANGE 0x2000
+
+struct SvxMSDffHandle
+{
+ sal_uInt32 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
+
+sal_Bool SortFilledObjectsToBackByDefault( MSO_SPT eSpType );
+SVX_DLLPUBLIC sal_Bool IsCustomShapeFilledByDefault( MSO_SPT eSpType );
+SVX_DLLPUBLIC sal_Int16 GetCustomShapeConnectionTypeDefault( MSO_SPT eSpType );
+
+// #i28269#
+SVX_DLLPUBLIC sal_Bool IsCustomShapeStrokedByDefault( MSO_SPT eSpType );
+
+SVX_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 000000000000..6be004105956
--- /dev/null
+++ b/include/svx/EnhancedCustomShapeTypeNames.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _ENHANCED_CUSTOMSHAPE_TYPE_NAMES_HXX
+#define _ENHANCED_CUSTOMSHAPE_TYPE_NAMES_HXX
+#include <svx/msdffdef.hxx>
+#include <rtl/ustring.hxx>
+
+namespace EnhancedCustomShapeTypeNames
+{
+ SVX_DLLPUBLIC MSO_SPT Get( const OUString& );
+ SVX_DLLPUBLIC OUString Get( const MSO_SPT );
+}
+
+#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 000000000000..05854b66e3b8
--- /dev/null
+++ b/include/svx/IAccessibleParent.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 _SVX_ACCESSIBILITY_IACCESSIBLE_PARENT_HXX
+#define _SVX_ACCESSIBILITY_IACCESSIBLE_PARENT_HXX
+
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <sal/types.h>
+
+namespace accessibility {
+
+class AccessibleShape;
+class AccessibleShapeTreeInfo;
+
+/** This interface contains methods missing from the
+ <type>XAccessibleContext</type> interface that allow the modification of
+ parent/child relationship.
+*/
+class IAccessibleParent
+{
+public:
+ /** Allow for a virtual destructor.
+ */
+ virtual ~IAccessibleParent (void){};
+
+ /** 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 garanteed that the
+ replacement has the same index as the current child has.
+
+ <p>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.</p>
+
+ @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 <TRUE/> is
+ returned. If the replacement can not be carried out or an error
+ occurs that does not result in an exception then <FALSE/> is
+ returned.
+
+ @raises RuntimeException
+ in case something went heavily wrong
+ */
+ virtual sal_Bool ReplaceChild (
+ AccessibleShape* pCurrentChild,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _rxShape,
+ const long _nIndex,
+ const AccessibleShapeTreeInfo& _rShapeTreeInfo
+ ) throw (::com::sun::star::uno::RuntimeException) = 0;
+};
+
+} // 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 000000000000..60883e754ee3
--- /dev/null
+++ b/include/svx/IAccessibleViewForwarder.hxx
@@ -0,0 +1,126 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_ACCESSIBILITY_IACCESSIBLE_VIEW_FORWARDER_HXX
+#define _SVX_ACCESSIBILITY_IACCESSIBLE_VIEW_FORWARDER_HXX
+
+#include <sal/types.h>
+#include <tools/gen.hxx>
+
+
+namespace accessibility {
+
+
+
+/** <p>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
+ <method>GetVisibleArea</method> returns the visible rectangle that
+ corresponds to this window.</p>
+
+ <p>This interface is similar to the <type>SvxViewForwarder</type> but
+ differs in two important points: Firstly the <member>GetVisArea</member>
+ method returns a rectangle in internal coordinates and secondly the
+ transformation methods do not require explicit mapmodes. These have to
+ be provided implicitely by the classes that implement this
+ interface. A third, less important, difference are the additional
+ transfomation methods for sizes. The reasons for their existince are
+ convenience and improved performance.</p>
+
+ @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 seperately.
+*/
+class IAccessibleViewForwarder
+{
+public:
+ virtual ~IAccessibleViewForwarder (void){};
+
+ /** This method informs you about the state of the forwarder. Do not
+ use it when the returned value is <false/>.
+
+ @return
+ Return <true/> if the view forwarder is valid and <false/> else.
+ */
+ virtual sal_Bool IsValid (void) const = 0;
+
+ /** 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 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;
+
+ /** Transform the specified point from absolute screen coordinates to
+ internal coordinates (100th of mm).
+
+ @param rPoint
+ Point in screen coordinates relative to the upper left corner of
+ the (current) screen.
+
+ @return
+ The same point but in internal coordinates (100th of mm).
+ */
+ virtual Point PixelToLogic (const Point& rPoint) const = 0;
+
+ /** Transform the specified size from screen coordinates to internal
+ coordinates (100th of mm).
+
+ @param rSize
+ Size in screen coordinates.
+
+ @return
+ The same size but in internal coordinates (100th of mm).
+ */
+ virtual Size PixelToLogic (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 000000000000..8a9a061bfb5e
--- /dev/null
+++ b/include/svx/IAccessibleViewForwarderListener.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 _SVX_ACCESSIBILITY_IACCESSIBLE_VIEW_FORWARDER_LISTENER_HXX
+#define _SVX_ACCESSIBILITY_IACCESSIBLE_VIEW_FORWARDER_LISTENER_HXX
+
+#include <sal/types.h>
+
+
+namespace accessibility {
+
+class IAccessibleViewForwarder;
+
+/** <p>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:
+ <ul>
+ <li>Change of the coordinate transformation.</li>
+ <li>Change of the visible area (which in turn results in a change of the
+ coordinate transformation.</li>
+ <li>Change of the validity state of the view forwarder.</li>
+*/
+class IAccessibleViewForwarderListener
+{
+public:
+ /** Enumeration of the different change types.
+ */
+ enum ChangeType {TRANSFORMATION, VISIBLE_AREA, STATE};
+
+ /** This method is called to indicate a change of the specified view
+ forwarder.
+ @param aChangeType
+ The type of the change. TRANSFORMATION indicates a change of
+ the coordinate transformation with a constant visible area. If
+ the visible area changes, just use VISIBLE_AREA. This changes
+ the transformation implicitly. The value STATE indicates a
+ change of the validity state. Check the IsValid method of the
+ view forwarder before doing further calls.
+ @param pViewForwarder
+ The modified view forwarder. It is specified just in case that
+ there is more than one view forwarder in use at the same time.
+ */
+ virtual void ViewForwarderChanged (ChangeType aChangeType,
+ const IAccessibleViewForwarder* pViewForwarder) = 0;
+
+protected:
+ ~IAccessibleViewForwarderListener() {}
+};
+
+} // end of namespace accessibility
+
+#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 000000000000..55934efcc545
--- /dev/null
+++ b/include/svx/ParseContext.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 SVX_QUERYDESIGNCONTEXT_HXX
+#define SVX_QUERYDESIGNCONTEXT_HXX
+
+#include "svx/svxdllapi.h"
+#include <connectivity/IParseContext.hxx>
+#include <tools/string.hxx>
+#include <unotools/localedatawrapper.hxx>
+
+
+#include <vector>
+
+namespace svxform
+{
+ //==========================================================================
+ //= OSystemParseContext
+ //==========================================================================
+ class SVX_DLLPUBLIC OSystemParseContext : public ::connectivity::IParseContext
+ {
+ private:
+
+ ::std::vector< String > m_aLocalizedKeywords;
+
+ public:
+ OSystemParseContext();
+
+ virtual ~OSystemParseContext();
+ // retrieves language specific error messages
+ virtual OUString getErrorMessage(ErrorCode _eCodes) const;
+
+ // retrieves language specific keyword strings (only ASCII allowed)
+ virtual OString getIntlKeywordAscii(InternationalKeyCode _eKey) const;
+
+ // finds out, if we have an international keyword (only ASCII allowed)
+ virtual InternationalKeyCode getIntlKeyCode(const OString& rToken) const;
+
+ /** get's a locale instance which should be used when parsing in the context specified by this instance
+ <p>if this is not overridden by derived classes, it returns the static default locale.</p>
+ */
+ virtual ::com::sun::star::lang::Locale getPreferredLocale( ) const;
+
+ };
+
+ //==========================================================================
+ //= OParseContextClient
+ //==========================================================================
+ /** helper class which needs access to a (shared and ref-counted) OSystemParseContext
+ instance.
+ */
+ class SVX_DLLPUBLIC OParseContextClient
+ {
+ protected:
+ OParseContextClient();
+ virtual ~OParseContextClient();
+
+ const OSystemParseContext* getParseContext() const;
+ };
+}
+#endif // SVX_QUERYDESIGNCONTEXT_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 000000000000..4dea0232bc90
--- /dev/null
+++ b/include/svx/ShapeTypeHandler.hxx
@@ -0,0 +1,220 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_ACCESSIBILITY_SHAPE_TYPE_HANDLER_HXX
+#define _SVX_ACCESSIBILITY_SHAPE_TYPE_HANDLER_HXX
+
+#include <svx/AccessibleShapeTreeInfo.hxx>
+#include <svx/AccessibleShapeInfo.hxx>
+#include <svx/AccessibleShape.hxx>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <comphelper/stl_types.hxx>
+#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include "svx/svxdllapi.h"
+
+#include <rtl/ustring.hxx>
+#include <vector>
+#include <boost/unordered_map.hpp>
+
+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 (void)
+ : mnShapeTypeId (-1),
+ msServiceName (),
+ maCreateFunction (NULL)
+ {}
+};
+
+/** @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
+{
+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 <type>ShapeTypeHandler</type> object.
+ */
+ static ShapeTypeHandler& Instance (void);
+
+ /** 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
+ <type>XShapeDescriptor</type> interface.
+ */
+ ShapeTypeId GetTypeId (const ::com::sun::star::uno::Reference<
+ ::com::sun::star::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
+ <code>XAccessible</code> interface. This pointer may be NULL
+ if the specified shape is of unknown type.
+ */
+ AccessibleShape*
+ CreateAccessibleObject (
+ const AccessibleShapeInfo& rShapeInfo,
+ const AccessibleShapeTreeInfo& rShapeTreeInfo) const;
+
+ /** Compatibility function.
+ */
+ AccessibleShape*
+ CreateAccessibleObject (
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape>& rxShape,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible>& rxParent,
+ const AccessibleShapeTreeInfo& rShapeTreeInfo) const
+ {
+ AccessibleShapeInfo aShapeInfo(rxShape, rxParent);
+ return CreateAccessibleObject (aShapeInfo, rShapeTreeInfo);
+ }
+
+ /** Add new shape types to the internal tables. Each new shape type is
+ described by one shape type descriptor. See
+ <type>ShapeTypeDescriptor</type> for more details.
+
+ @param nDescriptorCount
+ Number of new shape types.
+ @param aDescriptorList
+ Array of new shape type descriptors.
+ @return
+ The returned flag indicates whether the specified shape
+ descriptors have been successfully added.
+ */
+ bool AddShapeTypeList (int nDescriptorCount,
+ ShapeTypeDescriptor aDescriptorList[]);
+
+ /// get the accessible base name for an object
+ static OUString CreateAccessibleBaseName (
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape)
+ throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ // 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 (void);
+ 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.
+ */
+ virtual ~ShapeTypeHandler (void);
+
+private:
+ /// 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<ShapeTypeDescriptor> maShapeTypeDescriptorList;
+
+ /** This hash map allows the fast look up of a type descriptor for a
+ given service name.
+ */
+ typedef ::boost::unordered_map<
+ OUString,ShapeTypeId,
+ OUStringHash,
+ ::comphelper::UStringEqual> 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape>& rxShape) const;
+};
+
+} // end of namespace accessible
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/SmartTagCtl.hxx b/include/svx/SmartTagCtl.hxx
new file mode 100644
index 000000000000..59a7c59168e3
--- /dev/null
+++ b/include/svx/SmartTagCtl.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 _SVX_SMARTTAGSCONTROL_HXX
+#define _SVX_SMARTTAGSCONTROL_HXX
+
+#include <tools/link.hxx>
+#include <sfx2/mnuitem.hxx>
+#include "svx/svxdllapi.h"
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <vector>
+
+class SfxBindings;
+class SvxSmartTagItem;
+class PopupMenu;
+
+namespace com { namespace sun { namespace star { namespace smarttags {
+ class XSmartTagAction;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace container {
+ class XStringKeyMap;
+} } } }
+
+// class SvxFontMenuControl ----------------------------------------------
+
+class SVX_DLLPUBLIC SvxSmartTagsControl : public SfxMenuControl
+{
+private:
+ PopupMenu* mpMenu;
+ Menu& mrParent;
+ const SvxSmartTagItem* mpSmartTagItem;
+
+ struct InvokeAction
+ {
+ com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > mxAction;
+ com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > mxSmartTagProperties;
+ sal_uInt32 mnActionID;
+ InvokeAction( com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > xAction,
+ com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xSmartTagProperties,
+ sal_uInt32 nActionID ) : mxAction( xAction ), mxSmartTagProperties( xSmartTagProperties ), mnActionID( nActionID ) {}
+ };
+
+ std::vector< InvokeAction > maInvokeActions;
+
+ void FillMenu();
+ DECL_LINK( MenuSelect, PopupMenu * );
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+
+public:
+ SvxSmartTagsControl( sal_uInt16 nId, Menu&, SfxBindings& );
+ ~SvxSmartTagsControl();
+
+ virtual PopupMenu* GetPopup() const;
+ SFX_DECL_MENU_CONTROL();
+};
+
+#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 000000000000..8b4364b979a8
--- /dev/null
+++ b/include/svx/SmartTagItem.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 _SVX_SMARTTAGITEM_HXX
+#define _SVX_SMARTTAGITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/smarttags/XSmartTagAction.hpp>
+#include "svx/svxdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace container {
+ class XStringKeyMap;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace text {
+ class XTextRange;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace frame {
+ class XController;
+} } } }
+
+// class SvxSmartTagItem -----------------------------------------------------
+
+class SVX_DLLPUBLIC SvxSmartTagItem : public SfxPoolItem
+{
+ const com::sun::star::uno::Sequence < com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > > > maActionComponentsSequence;
+ const com::sun::star::uno::Sequence < com::sun::star::uno::Sequence< sal_Int32 > > maActionIndicesSequence;
+ const com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > > maStringKeyMaps;
+ const com::sun::star::uno::Reference<com::sun::star::text::XTextRange> mxRange;
+ const com::sun::star::uno::Reference<com::sun::star::frame::XController> mxController;
+ const com::sun::star::lang::Locale maLocale;
+ const OUString maApplicationName;
+ const OUString maRangeText;
+
+public:
+ TYPEINFO();
+
+ SvxSmartTagItem( const sal_uInt16 nId,
+ const com::sun::star::uno::Sequence < com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > > >& rActionComponentsSequence,
+ const com::sun::star::uno::Sequence < com::sun::star::uno::Sequence< sal_Int32 > >& rActionIndicesSequence,
+ const com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > >& rStringKeyMaps,
+ const com::sun::star::uno::Reference<com::sun::star::text::XTextRange> rRange,
+ const com::sun::star::uno::Reference<com::sun::star::frame::XController> rController,
+ const com::sun::star::lang::Locale rLocale,
+ const OUString& rApplicationName,
+ const OUString& rRangeText );
+
+ // "pure virtual Methoden" vom SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; // leer
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; // leer
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ const com::sun::star::uno::Sequence < com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > > >& GetActionComponentsSequence() const { return maActionComponentsSequence; }
+ const com::sun::star::uno::Sequence < com::sun::star::uno::Sequence< sal_Int32 > >& GetActionIndicesSequence() const { return maActionIndicesSequence; }
+ const com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > >& GetStringKeyMaps() const { return maStringKeyMaps; }
+ const com::sun::star::uno::Reference<com::sun::star::text::XTextRange>& GetTextRange() const { return mxRange; }
+ const com::sun::star::uno::Reference<com::sun::star::frame::XController>& GetController() const { return mxController; }
+ const com::sun::star::lang::Locale& GetLocale() const { return maLocale; }
+ const OUString GetApplicationName() const { return maApplicationName; }
+ const OUString GetRangeText() const { return maRangeText; }
+};
+
+#endif // #ifndef _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 000000000000..836ff820650f
--- /dev/null
+++ b/include/svx/SmartTagMgr.hxx
@@ -0,0 +1,226 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SMARTTAGMGR_HXX
+#define _SMARTTAGMGR_HXX
+
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/util/XModifyListener.hpp>
+#include <com/sun/star/util/XChangesListener.hpp>
+#include "svx/svxdllapi.h"
+
+#include <vector>
+#include <map>
+#include <set>
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class XComponentContext;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace smarttags {
+ class XSmartTagRecognizer;
+ class XSmartTagAction;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace text {
+ class XTextMarkup;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace i18n {
+ class XBreakIterator;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace lang {
+ struct Locale;
+ struct EventObject;
+ struct ChangesEvent;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace beans {
+ class XPropertySet;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace 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 and index.
+ */
+struct ActionReference
+{
+ com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > mxSmartTagAction;
+ sal_Int32 mnSmartTagIndex;
+ ActionReference( com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > 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::WeakImplHelper2< ::com::sun::star::util::XModifyListener,
+ ::com::sun::star::util::XChangesListener >
+{
+private:
+
+ const OUString maApplicationName;
+ std::vector< com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagRecognizer > > maRecognizerList;
+ std::vector< com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > > maActionList;
+ std::set< OUString > maDisabledSmartTagTypes;
+ std::multimap < OUString, ActionReference > maSmartTagMap;
+ mutable com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > mxBreakIter;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext> mxContext;
+ com::sun::star::uno::Reference< com::sun::star::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 );
+
+ /** Registeres 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();
+
+ void CreateBreakIterator() const;
+
+public:
+
+ SmartTagMgr( const OUString& rApplicationName );
+ virtual ~SmartTagMgr();
+
+ /** Triggeres 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 Recognize( const OUString& rText,
+ const com::sun::star::uno::Reference< com::sun::star::text::XTextMarkup > xMarkup,
+ const com::sun::star::uno::Reference< com::sun::star::frame::XController > xController,
+ const com::sun::star::lang::Locale& rLocale,
+ sal_uInt32 nStart, sal_uInt32 nLen ) 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( com::sun::star::uno::Sequence < OUString >& rSmartTagTypes,
+ com::sun::star::uno::Sequence < com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > > >& rActionComponentsSequence,
+ com::sun::star::uno::Sequence < com::sun::star::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 com::sun::star::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.
+ */
+ com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagRecognizer >
+ GetRecognizer( sal_uInt32 i ) const { return maRecognizerList[i]; }
+
+ /** Is smart tag recognization 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; }
+
+ // ::com::sun::star::lang::XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::util::XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::util::XChangesListener
+ virtual void SAL_CALL changesOccurred( const ::com::sun::star::util::ChangesEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+#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 000000000000..669c5d193dfa
--- /dev/null
+++ b/include/svx/SpellDialogChildWindow.hxx
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVX_SPELL_DIALOG_CHILD_WINDOW_HXX
+#define SVX_SPELL_DIALOG_CHILD_WINDOW_HXX
+
+#include <sfx2/childwin.hxx>
+#include <editeng/SpellPortions.hxx>
+#include "svx/svxdllapi.h"
+#include <vcl/image.hxx>
+
+class AbstractSpellDialog;
+
+namespace svx {
+
+/** The child window wrapper of the actual spellin dialog. To use the
+ spelling dialog in an application you have to do the ususal things:
+ <ol>
+ <li>Call this class' RegisterChildWindow() method with the module
+ as second argument that you want the dialog included in.</li>
+ <li>In the SFX_IMPL_INTERFACE implementation of the view shell
+ that wants to use the dialog call SFX_CHILDWINDOW_REGISTRATION()
+ with the id returned by this class' GetChildWindowId()
+ method.</li>
+ <li>Include the item associated with this child window to the SDI
+ description of the view shell.</li>
+ </ol>
+*/
+class SVX_DLLPUBLIC SpellDialogChildWindow
+ : public SfxChildWindow
+{
+ friend class SpellDialog;
+ AbstractSpellDialog* m_pAbstractSpellDialog;
+public:
+ SpellDialogChildWindow (
+ Window*pParent,
+ sal_uInt16 nId,
+ SfxBindings* pBindings,
+ SfxChildWinInfo* pInfo);
+ virtual ~SpellDialogChildWindow ();
+
+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 too 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 String& rOld, const String& 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 (void) 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/SvxShapeTypes.hxx b/include/svx/SvxShapeTypes.hxx
new file mode 100644
index 000000000000..4821603938ed
--- /dev/null
+++ b/include/svx/SvxShapeTypes.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 _SVX_ACCESSIBILITY_SVX_SHAPE_TYPES_HXX
+#define _SVX_ACCESSIBILITY_SVX_SHAPE_TYPES_HXX
+
+#include <svx/ShapeTypeHandler.hxx>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+
+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 (void);
+
+/** 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/UnoNamespaceMap.hxx b/include/svx/UnoNamespaceMap.hxx
new file mode 100644
index 000000000000..be9d7788bbc1
--- /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 _SVX_UNONAMESPACEMAP_HXX_
+#define _SVX_UNONAMESPACEMAP_HXX_
+
+#include <com/sun/star/uno/XInterface.hpp>
+#include "svx/svxdllapi.h"
+
+class SfxItemPool;
+
+namespace svx {
+
+SVX_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL NamespaceMap_createInstance( sal_uInt16* pWhichIds, SfxItemPool* pPool );
+
+}
+
+#endif // _SVX_UNONAMESPACEMAP_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/XPropertyTable.hxx b/include/svx/XPropertyTable.hxx
new file mode 100644
index 000000000000..0722434963f9
--- /dev/null
+++ b/include/svx/XPropertyTable.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 _SVX_XPROPERTYTABLE_HXX
+#define _SVX_XPROPERTYTABLE_HXX
+
+#include <com/sun/star/uno/XInterface.hpp>
+#include "svx/svxdllapi.h"
+#include <svx/xtable.hxx>
+
+// FIXME: should have a single factory method with an enumeration here [!]
+
+::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL SvxUnoXColorTable_createInstance( XPropertyList* pList ) throw();
+::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL SvxUnoXLineEndTable_createInstance( XPropertyList* pList ) throw();
+::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL SvxUnoXDashTable_createInstance( XPropertyList* pList ) throw();
+::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL SvxUnoXHatchTable_createInstance( XPropertyList* pList ) throw();
+::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL SvxUnoXGradientTable_createInstance( XPropertyList* pList ) throw();
+::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL SvxUnoXBitmapTable_createInstance( XPropertyList* pList ) throw();
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/algitem.hxx b/include/svx/algitem.hxx
new file mode 100644
index 000000000000..00a554d6e5f9
--- /dev/null
+++ b/include/svx/algitem.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_ALGITEM_HXX
+#define _SVX_ALGITEM_HXX
+
+#include <svx/svxids.hrc>
+#include <svl/poolitem.hxx>
+#include <svl/eitem.hxx>
+#include <editeng/svxenum.hxx>
+#include "svx/svxdllapi.h"
+
+class SvStream;
+
+//------------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxOrientationItem: public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ SvxOrientationItem(
+ const SvxCellOrientation eOrientation /*= SVX_ORIENTATION_STANDARD*/,
+ const sal_uInt16 nId );
+
+ SvxOrientationItem(
+ sal_Int32 nRotation, sal_Bool bStacked,
+ const sal_uInt16 nId );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual sal_uInt16 GetValueCount() const;
+ virtual String GetValueText( sal_uInt16 nVal ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const;
+
+ inline SvxOrientationItem& operator=(const SvxOrientationItem& rOrientation)
+ {
+ SetValue( rOrientation.GetValue() );
+ return *this;
+ }
+
+ /** Returns sal_True, if the item represents STACKED state. */
+ sal_Bool IsStacked() const;
+ /** Returns the rotation this item represents (returns nStdAngle for STANDARD and STACKED state). */
+ sal_Int32 GetRotation( sal_Int32 nStdAngle = 0 ) const;
+ /** Fills this item according to passed item values. */
+ void SetFromRotation( sal_Int32 nRotation, sal_Bool bStacked );
+};
+
+//------------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxMarginItem: public SfxPoolItem
+{
+ sal_Int16 nLeftMargin;
+ sal_Int16 nTopMargin;
+ sal_Int16 nRightMargin;
+ sal_Int16 nBottomMargin;
+public:
+ TYPEINFO();
+ 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 );
+ SvxMarginItem( const SvxMarginItem& );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const;
+ virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ sal_Int16 GetLeftMargin() const {return nLeftMargin; }
+ sal_Bool SetLeftMargin(sal_Int16 nLeft);
+ sal_Int16 GetTopMargin() const {return nTopMargin; }
+ sal_Bool SetTopMargin(sal_Int16 nTop);
+ sal_Int16 GetRightMargin() const {return nRightMargin; }
+ sal_Bool SetRightMargin(sal_Int16 nRight);
+ sal_Int16 GetBottomMargin() const {return nBottomMargin; }
+ sal_Bool SetBottomMargin(sal_Int16 nBottom);
+
+ inline SvxMarginItem& operator=(const SvxMarginItem& rMargin)
+ {
+ nLeftMargin = rMargin.nLeftMargin;
+ nTopMargin = rMargin.nTopMargin;
+ nRightMargin = rMargin.nRightMargin;
+ nBottomMargin = rMargin.nBottomMargin;
+ return *this;
+ }
+};
+
+#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 000000000000..f532b34b3fb2
--- /dev/null
+++ b/include/svx/anchorid.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 _SVX_ANCHORID_HXX
+#define _SVX_ANCHORID_HXX
+
+
+enum SvxAnchorIds
+{
+ SVX_OBJ_AT_CNTNT = 0x01, // Frame bound to paragraph
+ SVX_OBJ_IN_CNTNT = 0x02, // Frame bound to character
+ SVX_OBJ_PAGE = 0x04, // Frame bound to page
+ SVX_OBJ_AT_FLY = 0x08 // Frame bound to other frame
+// SVX_OBJ_AUTO_CNTNT = 0x10 // Automatically positioned frame bound to paragraph
+};
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/bmpmask.hxx b/include/svx/bmpmask.hxx
new file mode 100644
index 000000000000..247beaafc7d2
--- /dev/null
+++ b/include/svx/bmpmask.hxx
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _BMPMASK_HXX_
+#define _BMPMASK_HXX_
+
+#include <sfx2/ctrlitem.hxx>
+#include <sfx2/dockwin.hxx>
+#include <vcl/toolbox.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/group.hxx>
+#include <vcl/graph.hxx>
+#include "svx/svxdllapi.h"
+
+#include <svx/dlgctrl.hxx>
+
+/*************************************************************************
+|*
+|* class SvxBmpMaskSelectItem
+|*
+\************************************************************************/
+class SvxBmpMask;
+
+class SvxBmpMaskSelectItem : public SfxControllerItem
+{
+private:
+ SvxBmpMask &rBmpMask;
+
+protected:
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+
+public:
+ SvxBmpMaskSelectItem( sal_uInt16 nId, SvxBmpMask& rMask,
+ SfxBindings& rBindings );
+};
+
+/*************************************************************************
+|*
+|* Derivative from SfxChildWindow as 'container' for Float
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxBmpMaskChildWindow : public SfxChildWindow
+{
+ public:
+ SvxBmpMaskChildWindow( Window*,
+ sal_uInt16, SfxBindings*,
+ SfxChildWinInfo* );
+
+ SFX_DECL_CHILDWINDOW_WITHID(SvxBmpMaskChildWindow);
+};
+
+/*************************************************************************
+|*
+|* class SvxBmpMask
+|*
+\************************************************************************/
+
+class MaskData;
+class MaskSet;
+class ColorWindow;
+
+class SVX_DLLPUBLIC SvxBmpMask : public SfxDockingWindow
+{
+ friend class MaskData;
+ friend class MaskSet;
+
+ Size aLastSize;
+ ToolBox aTbxPipette;
+ ColorWindow* pCtlPipette;
+ PushButton aBtnExec;
+ FixedLine aGrpQ;
+
+ FixedText aFt1;
+ FixedText aFt2;
+ FixedText aFt3;
+ CheckBox aCbx1;
+ MaskSet* pQSet1;
+ MetricField aSp1;
+ ColorLB aLbColor1;
+
+ CheckBox aCbx2;
+ MaskSet* pQSet2;
+ MetricField aSp2;
+ ColorLB aLbColor2;
+
+ CheckBox aCbx3;
+ MaskSet* pQSet3;
+ MetricField aSp3;
+ ColorLB aLbColor3;
+
+ CheckBox aCbx4;
+ MaskSet* pQSet4;
+ MetricField aSp4;
+ ColorLB aLbColor4;
+
+ MaskData* pData;
+ CheckBox aCbxTrans;
+ ColorLB aLbColorTrans;
+
+ XColorListRef pColLst;
+ Color aPipetteColor;
+ SvxBmpMaskSelectItem aSelItem;
+
+ Image maImgPipette;
+
+ virtual sal_Bool Close();
+
+#ifdef BMPMASK_PRIVATE
+
+ sal_uInt16 InitColorArrays( Color* pSrcCols, Color* pDstCols,
+ sal_uIntPtr* pTols );
+
+ Bitmap ImpMask( const Bitmap& rBitmap );
+ GDIMetaFile ImpMask( const GDIMetaFile& rMtf );
+ Animation ImpMask( const Animation& rAnimation );
+ BitmapEx ImpMaskTransparent( const BitmapEx& rBitmapEx,
+ const Color& rColor,
+ const long nTol );
+ BitmapEx ImpReplaceTransparency( const BitmapEx& rBmpEx,
+ const Color& rColor );
+ Animation ImpReplaceTransparency( const Animation& rAnim,
+ const Color& rColor );
+ GDIMetaFile ImpReplaceTransparency( const GDIMetaFile& rMtf,
+ const Color& rColor );
+
+#endif // BMPMASK_PRIVATE
+
+public:
+
+ SvxBmpMask( SfxBindings *pBindinx,
+ SfxChildWindow *pCW,
+ Window* pParent,
+ const ResId& rResId );
+ ~SvxBmpMask();
+
+ void SetColor( const Color& rColor );
+ void PipetteClicked();
+
+ sal_Bool NeedsColorList() const;
+ void SetColorList( const XColorListRef &pColorList );
+
+ void SetExecState( sal_Bool bEnable );
+
+ Graphic Mask( const Graphic& rGraphic );
+
+ sal_Bool IsEyedropping() const;
+
+ void onSelect( MaskSet* pSet );
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ void ApplyStyle();
+
+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 (void);
+};
+
+#endif // _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 000000000000..96a5526b4501
--- /dev/null
+++ b/include/svx/camera3d.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 _CAMERA3D_HXX
+#define _CAMERA3D_HXX
+
+#include <svx/viewpt3d.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* Camera derivative
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC Camera3D : public Viewport3D
+{
+ protected:
+ basegfx::B3DPoint aResetPos;
+ basegfx::B3DPoint aResetLookAt;
+ double fResetFocalLength;
+ double fResetBankAngle;
+
+ 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, double fBankAng = 0);
+ Camera3D();
+
+ void SetDefaults(const basegfx::B3DPoint& rPos, const basegfx::B3DPoint& rLookAt,
+ double fFocalLen = 35.0, double fBankAng = 0);
+
+ 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);
+ const basegfx::B3DPoint& GetLookAt() const { return aLookAt; }
+ 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 links/rechts
+ void SetBankAngle(double fAngle);
+ double GetBankAngle() const { return fBankAngle; }
+
+ void SetAutoAdjustProjection(bool bAdjust = true)
+ { bAutoAdjustProjection = bAdjust; }
+ bool IsAutoAdjustProjection() const { return bAutoAdjustProjection; }
+};
+
+#endif // _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 000000000000..8f1ff765f78d
--- /dev/null
+++ b/include/svx/charmap.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 _SVX_CHARMAP_HXX
+#define _SVX_CHARMAP_HXX
+
+#include <vcl/ctrl.hxx>
+#include <vcl/metric.hxx>
+#include <vcl/scrbar.hxx>
+#include <boost/shared_ptr.hpp>
+#include <map>
+#include <tools/shl.hxx>
+#include "svx/svxdllapi.h"
+
+// define ----------------------------------------------------------------
+
+#define COLUMN_COUNT 16
+#define ROW_COUNT 8
+
+namespace svx
+{
+ struct SvxShowCharSetItem;
+ class SvxShowCharSetVirtualAcc;
+}
+
+// class SvxShowCharSet --------------------------------------------------
+
+class SVX_DLLPUBLIC SvxShowCharSet : public Control
+{
+public:
+ SvxShowCharSet( Window* pParent, const ResId& rResId );
+ SvxShowCharSet( Window* pParent );
+ ~SvxShowCharSet();
+
+ void SetFont( const Font& rFont );
+
+ void SelectCharacter( sal_uInt32 cNew, sal_Bool bFocus = sal_False );
+ sal_UCS4 GetSelectCharacter() const;
+
+ Link GetDoubleClickHdl() const { return aDoubleClkHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { aDoubleClkHdl = rLink; }
+ Link GetSelectHdl() const { return aSelectHdl; }
+ void SetSelectHdl( const Link& rHdl ) { aSelectHdl = rHdl; }
+ Link GetHighlightHdl() const { return aHighHdl; }
+ void SetHighlightHdl( const Link& rHdl ) { aHighHdl = rHdl; }
+ Link GetPreSelectHdl() const { return aHighHdl; }
+ void SetPreSelectHdl( const Link& rHdl ) { aPreSelectHdl = rHdl; }
+ static sal_uInt32& getSelectedChar();
+
+#ifdef _SVX_CHARMAP_CXX_
+ ::svx::SvxShowCharSetItem* ImplGetItem( int _nPos );
+ int FirstInView( void) const;
+ int LastInView( void) const;
+ int PixelToMapIndex( const Point&) const;
+ void SelectIndex( int index, sal_Bool bFocus = sal_False );
+ void DeSelect();
+ inline sal_Bool IsSelected(sal_uInt16 _nPos) const { return _nPos == nSelectedIndex; }
+ inline sal_uInt16 GetSelectIndexId() const { return sal::static_int_cast<sal_uInt16>(nSelectedIndex); }
+ sal_uInt16 GetRowPos(sal_uInt16 _nPos) const;
+ sal_uInt16 GetColumnPos(sal_uInt16 _nPos) const;
+
+ ScrollBar* getScrollBar();
+ void ReleaseAccessible();
+ sal_Int32 getMaxCharCount() const;
+#endif // _SVX_CHARMAP_CXX_
+
+ virtual void Resize();
+
+protected:
+ virtual void Paint( const Rectangle& );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+
+
+private:
+ typedef ::std::map<sal_Int32, boost::shared_ptr<svx::SvxShowCharSetItem> > ItemsMap;
+ ItemsMap m_aItems;
+ Link aDoubleClkHdl;
+ Link aSelectHdl;
+ Link aHighHdl;
+ Link aPreSelectHdl;
+ ::svx::SvxShowCharSetVirtualAcc* m_pAccessible;
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xAccessible;
+ long nX;
+ long nY;
+ long m_nXGap;
+ long m_nYGap;
+ sal_Bool bDrag;
+
+ sal_Int32 nSelectedIndex;
+
+ FontCharMap maFontCharMap;
+ ScrollBar aVscrollSB;
+
+private:
+ void DrawChars_Impl( int n1, int n2);
+ void InitSettings( sal_Bool bForeground, sal_Bool bBackground);
+ // abstraction layers are: Unicode<->MapIndex<->Pixel
+ Point MapIndexToPixel( int) const;
+ DECL_LINK(VscrollHdl, void *);
+
+ void init();
+ 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 000000000000..3b43c4bb7f10
--- /dev/null
+++ b/include/svx/charthelper.hxx
@@ -0,0 +1,52 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CHARTHELPER_HXX
+#define CHARTHELPER_HXX
+
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <svx/svxdllapi.h>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace svt { class EmbeddedObjectRef; }
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC ChartHelper
+{
+public:
+ // test if given reference is a chart
+ static bool IsChart(const svt::EmbeddedObjectRef& xObjRef);
+
+ // try to access rXModel in case of a chart to 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::Primitive2DSequence tryToGetChartContentAsPrimitive2DSequence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rXModel,
+ basegfx::B2DRange& rRange);
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //CHARTHELPER_HXX
diff --git a/include/svx/checklbx.hxx b/include/svx/checklbx.hxx
new file mode 100644
index 000000000000..8a9b3558d272
--- /dev/null
+++ b/include/svx/checklbx.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_CHECKLBX_HXX
+#define _SVX_CHECKLBX_HXX
+
+#include <svtools/treelistbox.hxx>
+#include <svtools/svlbitm.hxx>
+
+#include <vcl/lstbox.hxx>
+#include "svx/svxdllapi.h"
+
+// class SvxCheckListBox -------------------------------------------------
+
+class SVX_DLLPUBLIC SvxCheckListBox : public SvTreeListBox
+{
+ using Window::GetText;
+
+private:
+ SvLBoxButtonData* pCheckButton;
+
+#ifdef _SVX_CHECKLBX_CXX
+ SVX_DLLPRIVATE void Init_Impl();
+#endif
+
+ using SvTreeListBox::InsertEntry;
+ // Avoid ambiguity with new InsertEntry:
+ virtual SvTreeListEntry* InsertEntry( const XubString& rText, SvTreeListEntry* pParent,
+ sal_Bool bChildrenOnDemand,
+ sal_uIntPtr nPos, void* pUserData,
+ SvLBoxButtonKind eButtonKind );
+
+public:
+ SvxCheckListBox( Window* pParent, WinBits nWinStyle = 0 );
+ SvxCheckListBox( Window* pParent, const ResId& rResId );
+ SvxCheckListBox( Window* pParent, const ResId& rResId,
+ const Image& rNormalStaticImage );
+ ~SvxCheckListBox();
+
+ void InsertEntry ( const String& rStr,
+ sal_uInt16 nPos = LISTBOX_APPEND,
+ void* pUserData = NULL,
+ SvLBoxButtonKind eButtonKind =
+ SvLBoxButtonKind_enabledCheckbox );
+ void RemoveEntry ( sal_uInt16 nPos );
+
+ void SelectEntryPos ( sal_uInt16 nPos, sal_Bool bSelect = sal_True );
+ sal_uInt16 GetSelectEntryPos () const;
+
+ String GetText ( sal_uInt16 nPos ) const;
+ sal_uInt16 GetCheckedEntryCount() const;
+ void CheckEntryPos ( sal_uInt16 nPos, sal_Bool bCheck = sal_True );
+ sal_Bool IsChecked ( sal_uInt16 nPos ) const;
+ void ToggleCheckButton ( SvTreeListEntry* pEntry );
+
+ void* SetEntryData ( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData ( sal_uInt16 nPos ) const;
+
+ virtual void MouseButtonDown ( const MouseEvent& rMEvt );
+ virtual void KeyInput ( const KeyEvent& rKEvt );
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/chrtitem.hxx b/include/svx/chrtitem.hxx
new file mode 100644
index 000000000000..92045aa37c77
--- /dev/null
+++ b/include/svx/chrtitem.hxx
@@ -0,0 +1,334 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_CHRTITEM_HXX
+#define _SVX_CHRTITEM_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+//------------------------------------------------------------------------
+
+enum SvxChartStyle
+{
+ CHSTYLE_2D_LINE,
+ CHSTYLE_2D_STACKEDLINE,
+ CHSTYLE_2D_PERCENTLINE,
+ CHSTYLE_2D_COLUMN,
+ CHSTYLE_2D_STACKEDCOLUMN,
+ CHSTYLE_2D_PERCENTCOLUMN,
+ CHSTYLE_2D_BAR,
+ CHSTYLE_2D_STACKEDBAR,
+ CHSTYLE_2D_PERCENTBAR,
+ CHSTYLE_2D_AREA,
+ CHSTYLE_2D_STACKEDAREA,
+ CHSTYLE_2D_PERCENTAREA,
+ CHSTYLE_2D_PIE,
+ CHSTYLE_3D_STRIPE,
+ CHSTYLE_3D_COLUMN,
+ CHSTYLE_3D_FLATCOLUMN,
+ CHSTYLE_3D_STACKEDFLATCOLUMN,
+ CHSTYLE_3D_PERCENTFLATCOLUMN,
+ CHSTYLE_3D_AREA,
+ CHSTYLE_3D_STACKEDAREA,
+ CHSTYLE_3D_PERCENTAREA,
+ CHSTYLE_3D_SURFACE,
+ CHSTYLE_3D_PIE,
+ CHSTYLE_2D_XY,
+ CHSTYLE_3D_XYZ,
+ CHSTYLE_2D_LINESYMBOLS,
+ CHSTYLE_2D_STACKEDLINESYM,
+ CHSTYLE_2D_PERCENTLINESYM,
+ CHSTYLE_2D_XYSYMBOLS,
+ CHSTYLE_3D_XYZSYMBOLS,
+ CHSTYLE_2D_DONUT1,
+ CHSTYLE_2D_DONUT2,
+ CHSTYLE_3D_BAR,
+ CHSTYLE_3D_FLATBAR,
+ CHSTYLE_3D_STACKEDFLATBAR,
+ CHSTYLE_3D_PERCENTFLATBAR,
+ CHSTYLE_2D_PIE_SEGOF1,
+ CHSTYLE_2D_PIE_SEGOFALL,
+ CHSTYLE_2D_NET,
+ CHSTYLE_2D_NET_SYMBOLS,
+ CHSTYLE_2D_NET_STACK,
+ CHSTYLE_2D_NET_SYMBOLS_STACK,
+ CHSTYLE_2D_NET_PERCENT,
+ CHSTYLE_2D_NET_SYMBOLS_PERCENT,
+ CHSTYLE_2D_CUBIC_SPLINE,
+ CHSTYLE_2D_CUBIC_SPLINE_SYMBOL,
+ CHSTYLE_2D_B_SPLINE,
+ CHSTYLE_2D_B_SPLINE_SYMBOL,
+ CHSTYLE_2D_CUBIC_SPLINE_XY,
+ CHSTYLE_2D_CUBIC_SPLINE_SYMBOL_XY,
+ CHSTYLE_2D_B_SPLINE_XY,
+ CHSTYLE_2D_B_SPLINE_SYMBOL_XY,
+ CHSTYLE_2D_XY_LINE,
+ CHSTYLE_2D_LINE_COLUMN,
+ CHSTYLE_2D_LINE_STACKEDCOLUMN,
+ CHSTYLE_2D_STOCK_1,
+ CHSTYLE_2D_STOCK_2,
+ CHSTYLE_2D_STOCK_3,
+ CHSTYLE_2D_STOCK_4,
+ CHSTYLE_ADDIN
+};
+
+#define CHSTYLE_COUNT (CHSTYLE_ADDIN + 1)
+
+enum SvxChartDataDescr
+{
+ CHDESCR_NONE,
+ CHDESCR_VALUE,
+ CHDESCR_PERCENT,
+ CHDESCR_TEXT,
+ CHDESCR_TEXTANDPERCENT,
+ CHDESCR_NUMFORMAT_PERCENT,
+ CHDESCR_NUMFORMAT_VALUE,
+ CHDESCR_TEXTANDVALUE
+};
+
+#define CHDESCR_COUNT (CHDESCR_TEXTANDVALUE + 1)
+
+enum SvxChartTextOrder
+{
+ CHTXTORDER_SIDEBYSIDE,
+ CHTXTORDER_UPDOWN,
+ CHTXTORDER_DOWNUP,
+ CHTXTORDER_AUTO
+};
+
+#define CHTXTORDER_COUNT (CHTXTORDER_AUTO + 1)
+
+enum SvxChartTextOrient
+{
+ CHTXTORIENT_AUTOMATIC,
+ CHTXTORIENT_STANDARD,
+ CHTXTORIENT_BOTTOMTOP,
+ CHTXTORIENT_STACKED,
+ CHTXTORIENT_TOPBOTTOM
+};
+
+#define CHTXTORIENT_COUNT (CHTXTORIENT_TOPBOTTOM + 1)
+
+enum SvxChartKindError
+{
+ CHERROR_NONE,
+ CHERROR_VARIANT,
+ CHERROR_SIGMA,
+ CHERROR_PERCENT,
+ CHERROR_BIGERROR,
+ CHERROR_CONST,
+ CHERROR_STDERROR,
+ CHERROR_RANGE
+};
+
+#define CHERROR_COUNT (CHERROR_RANGE + 1)
+
+enum SvxChartIndicate
+{
+ CHINDICATE_NONE,
+ CHINDICATE_BOTH,
+ CHINDICATE_UP,
+ CHINDICATE_DOWN
+};
+
+#define CHINDICATE_COUNT (CHINDICATE_DOWN + 1)
+
+enum SvxChartRegress
+{
+ CHREGRESS_NONE,
+ CHREGRESS_LINEAR,
+ CHREGRESS_LOG,
+ CHREGRESS_EXP,
+ CHREGRESS_POWER
+};
+
+#define CHREGRESS_COUNT (CHREGRESS_POWER + 1)
+
+//------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxChartStyleItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ SvxChartStyleItem(SvxChartStyle eStyle /*= CHSTYLE_2D_LINE*/,
+ sal_uInt16 nId );
+ SvxChartStyleItem(SvStream& rIn, sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ sal_uInt16 GetValueCount() const { return CHSTYLE_COUNT; }
+ SvxChartStyle GetValue() const
+ { return (SvxChartStyle)SfxEnumItem::GetValue(); }
+};
+
+//------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxChartRegressItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ SvxChartRegressItem(SvxChartRegress eRegress /*= CHREGRESS_LINEAR*/,
+ sal_uInt16 nId );
+ SvxChartRegressItem(SvStream& rIn, sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ sal_uInt16 GetValueCount() const { return CHREGRESS_COUNT; }
+ SvxChartRegress GetValue() const
+ { return (SvxChartRegress)SfxEnumItem::GetValue(); }
+ sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const;
+};
+
+//------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxChartDataDescrItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ SvxChartDataDescrItem(SvStream& rIn,
+ sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ sal_uInt16 GetValueCount() const { return CHDESCR_COUNT; }
+ SvxChartDataDescr GetValue() const
+ { return (SvxChartDataDescr)SfxEnumItem::GetValue(); }
+};
+
+//------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxChartTextOrderItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ SvxChartTextOrderItem(SvxChartTextOrder eOrder /*= CHTXTORDER_SIDEBYSIDE*/,
+ sal_uInt16 nId );
+ SvxChartTextOrderItem(SvStream& rIn,
+ sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ sal_uInt16 GetValueCount() const { return CHTXTORDER_COUNT; }
+ SvxChartTextOrder GetValue() const
+ { return (SvxChartTextOrder)SfxEnumItem::GetValue(); }
+};
+
+//------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxChartTextOrientItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ SvxChartTextOrientItem(SvStream& rIn,
+ sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ sal_uInt16 GetValueCount() const { return CHTXTORDER_COUNT; }
+ SvxChartTextOrient GetValue() const
+ { return (SvxChartTextOrient)SfxEnumItem::GetValue(); }
+};
+
+//------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxChartKindErrorItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ SvxChartKindErrorItem(SvxChartKindError /*eOrient = CHERROR_NONE*/,
+ sal_uInt16 nId );
+ SvxChartKindErrorItem(SvStream& rIn,
+ sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ sal_uInt16 GetValueCount() const { return CHERROR_COUNT; }
+ SvxChartKindError GetValue() const
+ { return (SvxChartKindError)SfxEnumItem::GetValue(); }
+
+ sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const;
+};
+
+//------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxChartIndicateItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ SvxChartIndicateItem(SvxChartIndicate eOrient /*= CHINDICATE_NONE*/,
+ sal_uInt16 nId );
+ SvxChartIndicateItem(SvStream& rIn,
+ sal_uInt16 nId );
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ sal_uInt16 GetValueCount() const { return CHINDICATE_COUNT; }
+ SvxChartIndicate GetValue() const
+ { return (SvxChartIndicate)SfxEnumItem::GetValue(); }
+
+ sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const;
+};
+
+//------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxDoubleItem : public SfxPoolItem
+{
+ double fVal;
+
+public:
+ TYPEINFO();
+ SvxDoubleItem(double fValue /*= 0.0*/, sal_uInt16 nId );
+ SvxDoubleItem(const SvxDoubleItem& rItem);
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual String GetValueText() const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0) const;
+
+ virtual int operator == (const SfxPoolItem&) const;
+ virtual SfxPoolItem* Clone(SfxItemPool *pPool = NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVersion) const;
+ virtual SvStream& Store(SvStream& rOut, sal_uInt16 nItemVersion ) const;
+
+ virtual double GetMin() const;
+ virtual double GetMax() const;
+
+ virtual SfxFieldUnit GetUnit() const;
+
+ double GetValue() const { return fVal; }
+ void SetValue(double fNewVal) { fVal = fNewVal; }
+};
+
+#endif // _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 000000000000..465436367fad
--- /dev/null
+++ b/include/svx/clipboardctl.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 _SVX_CLIPBOARDCTL_HXX_
+#define _SVX_CLIPBOARDCTL_HXX_
+
+#include <sfx2/tbxctrl.hxx>
+#include <sfx2/ctrlitem.hxx>
+#include <svl/poolitem.hxx>
+
+
+#include "svx/svxdllapi.h"
+
+class PopupMenu;
+class SvxClipboardFmtItem;
+
+
+class SVX_DLLPUBLIC SvxClipBoardControl : public SfxToolBoxControl
+{
+ SfxPoolItem* pClipboardFmtItem;
+ PopupMenu* pPopup;
+ sal_Bool bDisabled;
+
+ void DelPopup();
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxClipBoardControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxClipBoardControl();
+
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+ virtual void StateChanged( sal_uInt16 nSID,
+ SfxItemState eState,
+ const SfxPoolItem* pState );
+};
+
+
+#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 000000000000..2debc5e0747d
--- /dev/null
+++ b/include/svx/clipfmtitem.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 _SVX_CLIPFMTITEM_HXX
+#define _SVX_CLIPFMTITEM_HXX
+
+#include <rtl/ustring.hxx>
+#include <svl/poolitem.hxx>
+#include "svx/svxdllapi.h"
+
+struct SvxClipboardFmtItem_Impl;
+
+class SVX_DLLPUBLIC SvxClipboardFmtItem : public SfxPoolItem
+{
+ SvxClipboardFmtItem_Impl* pImpl;
+protected:
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+public:
+ TYPEINFO();
+ SvxClipboardFmtItem( sal_uInt16 nId = 0 );
+ SvxClipboardFmtItem( const SvxClipboardFmtItem& );
+ virtual ~SvxClipboardFmtItem();
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId );
+
+ void AddClipbrdFormat( sal_uIntPtr nId, sal_uInt16 nPos = USHRT_MAX );
+ void AddClipbrdFormat( sal_uIntPtr nId, const OUString& rName,
+ sal_uInt16 nPos = USHRT_MAX );
+ sal_uInt16 Count() const;
+
+ sal_uIntPtr GetClipbrdFormatId( sal_uInt16 nPos ) const;
+ const OUString GetClipbrdFormatName( sal_uInt16 nPos ) const;
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/colrctrl.hxx b/include/svx/colrctrl.hxx
new file mode 100644
index 000000000000..ee3451bc857c
--- /dev/null
+++ b/include/svx/colrctrl.hxx
@@ -0,0 +1,135 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_COLRCTRL_HXX
+#define _SVX_COLRCTRL_HXX
+
+#include <sfx2/dockwin.hxx>
+#include <sfx2/childwin.hxx>
+#include <svtools/valueset.hxx>
+#include <svtools/transfer.hxx>
+#include <svl/lstner.hxx>
+#include <svx/svxdllapi.h>
+#include <svx/xtable.hxx>
+
+class SvData;
+
+/*************************************************************************
+|*
+|* SvxColorValueSet
+|*
+\************************************************************************/
+
+class SvxColorValueSet : public ValueSet, public DragSourceHelper
+{
+ using ValueSet::StartDrag;
+
+private:
+
+ sal_Bool bLeft;
+ Point aDragPosPixel;
+
+protected:
+
+ void DoDrag();
+
+ // ValueSet
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void Command(const CommandEvent& rCEvt );
+
+ // DragSourceHelper
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPtPixel );
+
+ DECL_STATIC_LINK(SvxColorValueSet, ExecDragHdl, void*);
+
+public:
+ SvxColorValueSet( Window* pParent, const ResId& rResId );
+
+ sal_Bool IsLeftButton() const { return bLeft; }
+};
+
+/*************************************************************************
+|*
+|* Derivation from SfxChildWindow as "container" for Controller
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxColorChildWindow : public SfxChildWindow
+{
+ public:
+ SvxColorChildWindow( Window*, sal_uInt16, SfxBindings*,
+ SfxChildWinInfo* );
+
+ SFX_DECL_CHILDWINDOW_WITHID(SvxColorChildWindow);
+};
+
+/*************************************************************************
+|*
+|* SvxColorDockingWindow
+|*
+\************************************************************************/
+
+class SvxColorDockingWindow : public SfxDockingWindow, public SfxListener
+{
+ friend class SvxColorChildWindow;
+
+private:
+ XColorListRef pColorList;
+ SvxColorValueSet aColorSet;
+ sal_uInt16 nLeftSlot;
+ sal_uInt16 nRightSlot;
+ sal_uInt16 nCols;
+ sal_uInt16 nLines;
+ long nCount;
+ Size aColorSize;
+ Size aItemSize;
+
+ void FillValueSet();
+ void SetSize();
+ DECL_LINK( SelectHdl, void * );
+
+ /** This function is called when the window gets the focus. It grabs
+ the focus to the color value set so that it can be controlled with
+ the keyboard.
+ */
+ virtual void GetFocus (void);
+
+protected:
+ virtual sal_Bool Close();
+ virtual void Resize();
+ virtual void Resizing( Size& rSize );
+
+public:
+ SvxColorDockingWindow( SfxBindings* pBindings,
+ SfxChildWindow *pCW,
+ Window* pParent,
+ const ResId& rResId );
+ ~SvxColorDockingWindow();
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+ void SetSlotIDs( sal_uInt16 nLeft, sal_uInt16 nRight )
+ { nLeftSlot = nLeft; nRightSlot = nRight; }
+
+ virtual long Notify( NotifyEvent& rNEvt );
+};
+
+#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 000000000000..a733fa2b6298
--- /dev/null
+++ b/include/svx/compressgraphicdialog.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 _COMPRESS_GRAPHIC_DIALOG_HXX
+#define _COMPRESS_GRAPHIC_DIALOG_HXX
+
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/field.hxx>
+#include <sfx2/bindings.hxx>
+#include "svx/svxdllapi.h"
+
+class SdrGrafObj;
+
+class SVX_DLLPUBLIC CompressGraphicsDialog : public ModalDialog
+{
+private:
+ FixedText* m_pFixedText2;
+ FixedText* m_pFixedText3;
+ FixedText* m_pFixedText5;
+ FixedText* m_pFixedText6;
+
+ CheckBox* m_pReduceResolutionCB;
+ NumericField* m_pMFNewWidth;
+ NumericField* m_pMFNewHeight;
+ ComboBox* m_pResolutionLB;
+ RadioButton* m_pLosslessRB;
+ RadioButton* m_pJpegCompRB;
+ NumericField* m_pCompressionMF;
+ NumericField* m_pQualityMF;
+ PushButton* m_pBtnCalculate;
+ ListBox* m_pInterpolationCombo;
+
+ SdrGrafObj* m_pGraphicObj;
+ Graphic m_aGraphic;
+ Size m_aViewSize100mm;
+ Rectangle m_aCropRectangle;
+ SfxBindings& m_rBindings;
+
+ double m_dResolution;
+
+ void Initialize();
+
+ DECL_LINK( NewWidthModifiedHdl, void* );
+ DECL_LINK( NewHeightModifiedHdl, void* );
+ DECL_LINK( ResolutionModifiedHdl, void* );
+ DECL_LINK( ToggleCompressionRB, void* );
+ DECL_LINK( ToggleReduceResolutionRB, void* );
+
+ DECL_LINK( CalculateClickHdl, void* );
+
+ void Update();
+ void UpdateNewWidthMF();
+ void UpdateNewHeightMF();
+ void UpdateResolutionLB();
+
+ void Compress(SvStream& aStream);
+
+ double GetViewWidthInch();
+ double GetViewHeightInch();
+
+ sal_uLong GetSelectedInterpolationType();
+
+public:
+ CompressGraphicsDialog( Window* pParent, SdrGrafObj* pGraphicObj, SfxBindings& rBindings );
+ CompressGraphicsDialog( Window* pParent, Graphic& rGraphic, Size rViewSize100mm, Rectangle& rCropRectangle, SfxBindings& rBindings );
+
+ virtual ~CompressGraphicsDialog();
+
+ SdrGrafObj* GetCompressedSdrGrafObj();
+ Graphic GetCompressedGraphic();
+
+ Rectangle GetScaledCropRectangle();
+};
+
+#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 000000000000..a559f615c14c
--- /dev/null
+++ b/include/svx/connctrl.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 _SVX_CONNCTRL_HXX
+#define _SVX_CONNCTRL_HXX
+
+#include <vcl/ctrl.hxx>
+#include "svx/svxdllapi.h"
+
+class SfxItemSet;
+class SdrEdgeObj;
+class SdrView;
+class SdrObjList;
+
+/*************************************************************************
+|*
+|* SvxXConnectionPreview
+|*
+\************************************************************************/
+class SVX_DLLPUBLIC SvxXConnectionPreview : public Control
+{
+ friend class SvxConnectionPage;
+
+private:
+ const SfxItemSet& rAttrs;
+ SdrEdgeObj* pEdgeObj;
+ SdrObjList* pObjList;
+ const SdrView* pView;
+
+ SVX_DLLPRIVATE void SetStyles();
+public:
+ SvxXConnectionPreview( Window* pParent, const ResId& rResId,
+ const SfxItemSet& rInAttrs );
+ ~SvxXConnectionPreview();
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+
+ void SetAttributes( const SfxItemSet& rInAttrs );
+ sal_uInt16 GetLineDeltaAnz();
+
+ void Construct();
+ void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+};
+
+
+#endif // _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 000000000000..2ba38f1e9e31
--- /dev/null
+++ b/include/svx/contdlg.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 _CONTDLG_HXX_
+#define _CONTDLG_HXX_
+
+#include <sfx2/basedlgs.hxx>
+#include <sfx2/ctrlitem.hxx>
+#include <sfx2/childwin.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* Derivation from SfxChildWindow as "container" for Float
+|*
+\************************************************************************/
+
+class Graphic;
+
+class SVX_DLLPUBLIC SvxContourDlgChildWindow : public SfxChildWindow
+{
+ public:
+
+ SvxContourDlgChildWindow( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
+
+ SFX_DECL_CHILDWINDOW_WITHID( SvxContourDlgChildWindow );
+};
+
+#ifndef _REDUCED_ContourDlg_HXX_
+#define _REDUCED_CONTDLG_HXX_
+
+class SvxSuperContourDlg;
+
+class SvxContourDlgItem : public SfxControllerItem
+{
+ SvxSuperContourDlg& rDlg;
+
+protected:
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+
+public:
+
+ SvxContourDlgItem( sal_uInt16 nId, SvxSuperContourDlg& rDlg, SfxBindings& rBindings );
+};
+
+class SVX_DLLPUBLIC SvxContourDlg : public SfxFloatingWindow
+{
+ using Window::Update;
+
+ SvxSuperContourDlg* pSuperClass;
+
+
+protected:
+
+ void SetSuperClass( SvxSuperContourDlg& rSuperClass ) { pSuperClass = &rSuperClass; }
+
+public:
+
+ SvxContourDlg( SfxBindings *pBindings, SfxChildWindow *pCW,
+ Window* pParent, const ResId& rResId );
+ ~SvxContourDlg();
+
+ const Graphic& GetGraphic() const;
+ sal_Bool IsGraphicChanged() const;
+
+ PolyPolygon GetPolyPolygon();
+
+ const void* GetEditingObject() const;
+
+ void Update( const Graphic& rGraphic, sal_Bool bGraphicLinked,
+ const PolyPolygon* pPolyPoly = NULL, void* pEditingObj = NULL );
+
+ static PolyPolygon CreateAutoContour( const Graphic& rGraphic,
+ const Rectangle* pRect = NULL,
+ const sal_uIntPtr nFlags = 0L );
+};
+
+#endif // _REDUCED_CONTDLG_HXX_
+#endif // _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 000000000000..c88b74238ae9
--- /dev/null
+++ b/include/svx/ctredlin.hxx
@@ -0,0 +1,391 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_CTREDLIN_HXX
+#define _SVX_CTREDLIN_HXX
+
+#include <vcl/morebtn.hxx>
+#include <vcl/combobox.hxx>
+#include <svtools/headbar.hxx>
+#include <svtools/svtabbx.hxx>
+#include "svtools/svlbitm.hxx"
+#include <vcl/lstbox.hxx>
+#include <vcl/tabpage.hxx>
+#include <vcl/field.hxx>
+#include <vcl/fixed.hxx>
+
+#ifndef _SVX_SIMPTABL
+#include <svx/simptabl.hxx>
+#endif
+#include <vcl/tabctrl.hxx>
+#include <tools/datetime.hxx>
+#include <unotools/textsearch.hxx>
+#include "svtools/treelistentry.hxx"
+#include "svx/svxdllapi.h"
+
+#define FLT_DATE_BEFORE 0
+#define FLT_DATE_SINCE 1
+#define FLT_DATE_EQUAL 2
+#define FLT_DATE_NOTEQUAL 3
+#define FLT_DATE_BETWEEN 4
+#define FLT_DATE_SAVE 5
+
+
+// Struct for sorting data
+
+class SVX_DLLPUBLIC RedlinData
+{
+public:
+ RedlinData();
+ virtual ~RedlinData();
+ sal_Bool bDisabled;
+ DateTime aDateTime;
+ void* pData;
+};
+
+class SvxRedlinEntry : public SvTreeListEntry
+{
+public:
+ SvxRedlinEntry();
+ virtual ~SvxRedlinEntry();
+};
+
+// Class for the representation of Strings depending on the font
+class SvLBoxColorString : public SvLBoxString
+{
+private:
+
+ Color aPrivColor;
+
+public:
+ SvLBoxColorString( SvTreeListEntry*,sal_uInt16 nFlags,const XubString& rStr,
+ const Color& rCol);
+ SvLBoxColorString();
+ ~SvLBoxColorString();
+
+ virtual void Paint(
+ const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
+
+ SvLBoxItem* Create() const;
+};
+
+class SVX_DLLPUBLIC SvxRedlinTable : public SvxSimpleTable
+{
+ using SvTabListBox::InsertEntry;
+
+private:
+
+ sal_Bool bIsCalc;
+ sal_uInt16 nDatePos;
+ sal_Bool bAuthor;
+ sal_Bool bDate;
+ sal_Bool bComment;
+ sal_uInt16 nDaTiMode;
+ DateTime aDaTiFirst;
+ DateTime aDaTiLast;
+ DateTime aDaTiFilterFirst;
+ DateTime aDaTiFilterLast;
+ String aAuthor;
+ Color aEntryColor;
+ String aCurEntry;
+ utl::TextSearch* pCommentSearcher;
+ Link aColCompareLink;
+
+protected:
+
+ virtual StringCompare ColCompare(SvTreeListEntry*,SvTreeListEntry*);
+ virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind);
+
+
+
+public:
+
+ SvxRedlinTable(SvxSimpleTableContainer& rParent, WinBits nBits = WB_BORDER);
+ ~SvxRedlinTable();
+
+ // For FilterPage only {
+ void SetFilterDate(sal_Bool bFlag=sal_True);
+ void SetDateTimeMode(sal_uInt16 nMode);
+ void SetFirstDate(const Date&);
+ void SetLastDate(const Date&);
+ void SetFirstTime(const Time&);
+ void SetLastTime(const Time&);
+ void SetFilterAuthor(sal_Bool bFlag=sal_True);
+ void SetAuthor(const String &);
+ void SetFilterComment(sal_Bool bFlag=sal_True);
+ void SetCommentParams( const utl::SearchParam* pSearchPara );
+
+ void UpdateFilterTest();
+ // } For FilterPage only
+
+ void SetCalcView(sal_Bool bFlag=sal_True);
+
+ // no NULL-pointer checking {
+ sal_Bool IsValidEntry(const String* pAuthor,const DateTime *pDateTime,const String* pComment);
+ sal_Bool IsValidEntry(const String* pAuthor,const DateTime *pDateTime);
+ sal_Bool IsValidComment(const String* pComment);
+ // }
+
+ SvTreeListEntry* InsertEntry(const String& ,RedlinData *pUserData,
+ SvTreeListEntry* pParent=NULL,sal_uIntPtr nPos=LIST_APPEND);
+
+ SvTreeListEntry* InsertEntry(const String& ,RedlinData *pUserData,const Color&,
+ SvTreeListEntry* pParent=NULL,sal_uIntPtr nPos=LIST_APPEND);
+
+
+ virtual SvTreeListEntry* CreateEntry() const;
+
+ void SetColCompareHdl(const Link& rLink ) { aColCompareLink = rLink; }
+ const Link& GetColCompareHdl() const { return aColCompareLink; }
+
+
+};
+
+//==================================================================
+// Filter- Tabpage
+//==================================================================
+class SVX_DLLPUBLIC SvxTPFilter: public TabPage
+{
+private:
+
+ Link aReadyLink;
+ Link aModifyLink;
+ Link aModifyDateLink;
+ Link aModifyAuthorLink;
+ Link aModifyRefLink;
+ Link aRefLink;
+ Link aModifyComLink;
+
+ SvxRedlinTable* pRedlinTable;
+ CheckBox* m_pCbDate;
+ ListBox* m_pLbDate;
+ DateField* m_pDfDate;
+ TimeField* m_pTfDate;
+ PushButton* m_pIbClock;
+ FixedText* m_pFtDate2;
+ DateField* m_pDfDate2;
+ TimeField* m_pTfDate2;
+ PushButton* m_pIbClock2;
+ CheckBox* m_pCbAuthor;
+ ListBox* m_pLbAuthor;
+ CheckBox* m_pCbRange;
+ Edit* m_pEdRange;
+ PushButton* m_pBtnRange;
+ CheckBox* m_pCbAction;
+ ListBox* m_pLbAction;
+ CheckBox* m_pCbComment;
+ Edit* m_pEdComment;
+ sal_Bool bModified;
+
+ DECL_LINK( SelDateHdl, ListBox* );
+ DECL_LINK( RowEnableHdl, CheckBox* );
+ DECL_LINK( TimeHdl, ImageButton* );
+ DECL_LINK( ModifyHdl, void* );
+ DECL_LINK( ModifyDate, void* );
+ DECL_LINK( RefHandle, PushButton* );
+
+
+protected:
+
+ void ShowDateFields(sal_uInt16 nKind);
+ void EnableDateLine1(sal_Bool bFlag);
+ void EnableDateLine2(sal_Bool bFlag);
+
+public:
+ SvxTPFilter( Window * pParent);
+
+ virtual void DeactivatePage();
+ void SetRedlinTable(SvxRedlinTable*);
+
+ Date GetFirstDate() const;
+ void SetFirstDate(const Date &aDate);
+ Time GetFirstTime() const;
+ void SetFirstTime(const Time &aTime);
+
+ Date GetLastDate() const;
+ void SetLastDate(const Date &aDate);
+ Time GetLastTime() const;
+ void SetLastTime(const Time &aTime);
+
+ void SetDateMode(sal_uInt16 nMode);
+ sal_uInt16 GetDateMode();
+
+ void ClearAuthors();
+ void InsertAuthor( const String& rString, sal_uInt16 nPos = LISTBOX_APPEND );
+ String GetSelectedAuthor()const;
+ void SelectedAuthorPos(sal_uInt16 nPos);
+ sal_uInt16 SelectAuthor(const String& aString);
+ void SetComment(const String &rComment);
+ String GetComment()const;
+
+
+ // Methods for Calc {
+ void SetRange(const String& rString);
+ String GetRange() const;
+ void HideRange(sal_Bool bHide=sal_True);
+ void SetFocusToRange();
+ // } Methods for Calc
+
+ void DisableRef(sal_Bool bFlag);
+
+ sal_Bool IsDate();
+ sal_Bool IsAuthor();
+ sal_Bool IsRange();
+ sal_Bool IsAction();
+ sal_Bool IsComment();
+
+ void ShowAction(sal_Bool bShow=sal_True);
+
+ void CheckDate(sal_Bool bFlag=sal_True);
+ void CheckAuthor(sal_Bool bFlag=sal_True);
+ void CheckRange(sal_Bool bFlag=sal_True);
+ void CheckAction(sal_Bool bFlag=sal_True);
+ void CheckComment(sal_Bool bFlag=sal_True);
+
+ ListBox* GetLbAction();
+
+ void SetReadyHdl( const Link& rLink ) { aReadyLink= rLink; }
+ const Link& GetReadyHdl() const { return aReadyLink; }
+
+ void SetModifyHdl( const Link& rLink ) { aModifyLink = rLink; }
+ const Link& GetModifyHdl() const { return aModifyLink; }
+
+ void SetModifyDateHdl( const Link& rLink ) { aModifyDateLink = rLink; }
+ const Link& GetModifyDateHdl() const { return aModifyDateLink; }
+
+ void SetModifyAuthorHdl( const Link& rLink ) { aModifyAuthorLink = rLink; }
+ const Link& GetModifyAuthorHdl() const { return aModifyAuthorLink; }
+
+ void SetModifyCommentHdl(const Link& rLink ) { aModifyComLink = rLink; }
+ const Link& GetModifyCommentHdl() const { return aModifyComLink; }
+
+
+ // Methods for Calc {
+ void SetModifyRangeHdl( const Link& rLink ) { aModifyRefLink = rLink; }
+ const Link& GetModifyRangeHdl() const { return aModifyRefLink; }
+
+ void SetRefHdl( const Link& rLink ) { aRefLink = rLink; }
+ const Link& GetRefHdl() const { return aRefLink; }
+
+ void Enable( bool bEnable = true, bool bChild = true );
+ void Disable( bool bChild = true );
+
+ // } Methods for Calc
+};
+
+
+//==================================================================
+// View- Tabpage
+//==================================================================
+
+class SVX_DLLPUBLIC SvxTPView: public TabPage
+{
+private:
+
+ Link AcceptClickLk;
+ Link AcceptAllClickLk;
+ Link RejectClickLk;
+ Link RejectAllClickLk;
+ Link UndoClickLk;
+
+ SvxRedlinTable* m_pViewData;
+ PushButton* m_pAccept;
+ PushButton* m_pReject;
+ PushButton* m_pAcceptAll;
+ PushButton* m_pRejectAll;
+ PushButton* m_pUndo;
+
+ DECL_LINK( PbClickHdl, PushButton* );
+
+public:
+ SvxTPView(Window * pParent);
+ ~SvxTPView();
+
+ void InsertWriterHeader();
+ void InsertCalcHeader();
+ SvxRedlinTable* GetTableControl();
+
+ void EnableAccept(sal_Bool nFlag=sal_True);
+ void EnableAcceptAll(sal_Bool nFlag=sal_True);
+ void EnableReject(sal_Bool nFlag=sal_True);
+ void EnableRejectAll(sal_Bool nFlag=sal_True);
+ void EnableUndo(sal_Bool nFlag=sal_True);
+
+ void DisableAccept() {EnableAccept(sal_False);}
+ void DisableAcceptAll() {EnableAcceptAll(sal_False);}
+ void DisableReject() {EnableReject(sal_False);}
+ void DisableRejectAll() {EnableRejectAll(sal_False);}
+ void DisableUndo() {EnableUndo(sal_False);}
+
+ void ShowUndo(sal_Bool nFlag=sal_True);
+ void HideUndo() {ShowUndo(sal_False);}
+ sal_Bool IsUndoVisible();
+
+ void SetAcceptClickHdl( const Link& rLink ) { AcceptClickLk = rLink; }
+ const Link& GetAcceptClickHdl() const { return AcceptClickLk; }
+
+ void SetAcceptAllClickHdl( const Link& rLink ) { AcceptAllClickLk = rLink; }
+ const Link& GetAcceptAllClickHdl() const { return AcceptAllClickLk; }
+
+ void SetRejectClickHdl( const Link& rLink ) { RejectClickLk = rLink; }
+ const Link& GetRejectClickHdl() const { return RejectClickLk; }
+
+ void SetRejectAllClickHdl( const Link& rLink ) { RejectAllClickLk = rLink; }
+ const Link& GetRejectAllClickHdl() const { return RejectAllClickLk; }
+
+ void SetUndoClickHdl( const Link& rLink ) { UndoClickLk = rLink; }
+ const Link& GetUndoAllClickHdl() const { return UndoClickLk; }
+
+ virtual void ActivatePage();
+ virtual void DeactivatePage();
+};
+
+//==================================================================
+// Redlining - Control (Accept- Changes)
+//==================================================================
+
+class SVX_DLLPUBLIC SvxAcceptChgCtr
+ : public TabControl
+ , public VclBuilderContainer
+{
+private:
+
+ SvxTPFilter* pTPFilter;
+ SvxTPView* pTPView;
+
+ sal_uInt16 m_nViewPageId;
+ sal_uInt16 m_nFilterPageId;
+
+public:
+ SvxAcceptChgCtr(Window* pParent);
+
+ ~SvxAcceptChgCtr();
+
+ void ShowFilterPage();
+ void ShowViewPage();
+
+ SvxTPFilter* GetFilterPage();
+ SvxTPView* GetViewPage();
+ SvxRedlinTable* GetViewTable();
+};
+
+
+#endif // _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 000000000000..5d65cc5ad8ea
--- /dev/null
+++ b/include/svx/cube3d.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _E3D_CUBE3D_HXX
+#define _E3D_CUBE3D_HXX
+
+#include <svx/obj3d.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* |
+|* Create a 3D cuboid; aPos: Center oder 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).
+|*
+\************************************************************************/
+
+enum { CUBE_BOTTOM = 0x0001, CUBE_BACK = 0x0002, CUBE_LEFT = 0x0004,
+ CUBE_TOP = 0x0008, CUBE_RIGHT = 0x0010, CUBE_FRONT = 0x0020,
+ CUBE_FULL = 0x003F, CUBE_OPEN_TB = 0x0036, CUBE_OPEN_LR = 0x002B,
+ CUBE_OPEN_FB = 0x001D };
+
+class SVX_DLLPUBLIC E3dCubeObj : public E3dCompoundObject
+{
+private:
+ // Parameter
+ basegfx::B3DPoint aCubePos;
+ basegfx::B3DVector aCubeSize;
+ sal_uInt16 nSideFlags;
+
+ // BOOLeans
+ unsigned bPosIsCenter : 1;
+
+protected:
+ void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
+public:
+ TYPEINFO();
+ E3dCubeObj(E3dDefaultAttributes& rDefault, basegfx::B3DPoint aPos, const basegfx::B3DVector& r3DSize);
+ E3dCubeObj();
+
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+ virtual E3dCubeObj* Clone() const;
+
+ // Set local parameters with geometry recreation
+ void SetCubePos(const basegfx::B3DPoint& rNew);
+ const basegfx::B3DPoint& GetCubePos() { return aCubePos; }
+
+ void SetCubeSize(const basegfx::B3DVector& rNew);
+ const basegfx::B3DVector& GetCubeSize() { return aCubeSize; }
+
+ void SetPosIsCenter(sal_Bool bNew);
+ sal_Bool GetPosIsCenter() { return (sal_Bool)bPosIsCenter; }
+
+ sal_uInt16 GetSideFlags() { return nSideFlags; }
+
+ // TakeObjName...() is for the display in the UI, for example "3 frames selected".
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+};
+
+#endif // _E3D_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 000000000000..67ecb5165805
--- /dev/null
+++ b/include/svx/dataaccessdescriptor.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 _SVX_DATACCESSDESCRIPTOR_HXX_
+#define _SVX_DATACCESSDESCRIPTOR_HXX_
+
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include "svx/svxdllapi.h"
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+ class ODADescriptorImpl;
+
+ //====================================================================
+ //= DataAccessDescriptorProperty
+ //====================================================================
+ enum DataAccessDescriptorProperty
+ {
+ daDataSource, /// data source name (string)
+ daDatabaseLocation, /// database file URL (string)
+ daConnectionResource, /// database driver URL (string)
+ daConnection, /// connection (XConnection)
+
+ daCommand, /// command (string)
+ daCommandType, /// command type (long)
+ daEscapeProcessing, /// escape processing (boolean)
+ daFilter, /// additional filter (string)
+ daCursor, /// the cursor (XResultSet)
+
+ daColumnName, /// column name (string)
+ daColumnObject, /// column object (XPropertySet)
+
+ daSelection, /// selection (sequence< any >)
+ daBookmarkSelection, /// selection are bookmarks? (boolean)
+
+ daComponent /// component name (XContent)
+ };
+
+ //====================================================================
+ //= ODataAccessDescriptor
+ //====================================================================
+ /** class encapsulating the <type scope="com::sun::star::sdb">DataAccessDescriptor</type> service.
+ */
+ class SVX_DLLPUBLIC ODataAccessDescriptor
+ {
+ protected:
+ ODADescriptorImpl* m_pImpl;
+
+ public:
+ ODataAccessDescriptor();
+ ODataAccessDescriptor( const ODataAccessDescriptor& _rSource );
+ ODataAccessDescriptor( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rValues );
+ ODataAccessDescriptor( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rValues );
+
+ // allows to construct a descriptor from an Any containing either an XPropertySet or a property value sequence
+ ODataAccessDescriptor( const ::com::sun::star::uno::Any& _rValues );
+
+ const ODataAccessDescriptor& operator=(const ODataAccessDescriptor& _rSource);
+
+ ~ODataAccessDescriptor();
+
+ /** returns the descriptor as property value sequence
+ <p>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.</p>
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
+ createPropertyValueSequence();
+
+ /** initialized the descriptor from the property values given
+ <p>If <arg>_bClear</arg> is <TRUE/>, the descriptor will clear all it's current settings before
+ initializing with the new ones.</p>
+ */
+ void initializeFrom(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rValues,
+ sal_Bool _bClear = sal_True);
+
+ /// checks whether or not a given property is present in the descriptor
+ sal_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 ::com::sun::star::uno::Any& operator [] ( DataAccessDescriptorProperty _eWhich ) const;
+
+ /** return the (modifiable) value of a given property
+ <p>This operator is not allowed to be called if the descriptor is readonly.</p>
+ */
+ ::com::sun::star::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);
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // _SVX_DATACCESSDESCRIPTOR_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 000000000000..6acb2194a810
--- /dev/null
+++ b/include/svx/databaselocationinput.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVX_DATABASELOCATIONINPUT_HXX
+#define SVX_DATABASELOCATIONINPUT_HXX
+
+#include "svx/svxdllapi.h"
+
+class PushButton;
+class String;
+namespace svt { class OFileURLControl; }
+namespace comphelper { class ComponentContext; }
+
+#include <memory>
+
+//........................................................................
+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 a OFileURLControl for inputting the actual location, and a push button
+ to browse for a location.
+
+ This helper class controls such two UI elements.
+ */
+ class SVX_DLLPUBLIC DatabaseLocationInputController
+ {
+ public:
+ DatabaseLocationInputController(
+ const ::comphelper::ComponentContext& _rContext,
+ ::svt::OFileURLControl& _rLocationInput,
+ PushButton& _rBrowseButton
+ );
+ ~DatabaseLocationInputController();
+
+ /** sets the given URL at the input control, after translating it into a system path
+ */
+ void setURL( const String& _rURL );
+
+ /** returns the current database location, in form of an URL (not a system path)
+ */
+ String 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::auto_ptr< DatabaseLocationInputController_Impl >
+ m_pImpl;
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // 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 000000000000..c3efaa524359
--- /dev/null
+++ b/include/svx/databaseregistrationui.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 SVX_DATABASE_REGISTRATION_UI_HXX
+#define SVX_DATABASE_REGISTRATION_UI_HXX
+
+#include "svx/svxdllapi.h"
+#include <tools/solar.h>
+
+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( Window* _parentWindow );
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // SVX_DATABASE_REGISTRATION_UI_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 000000000000..f4f40673d87b
--- /dev/null
+++ b/include/svx/dbaexchange.hxx
@@ -0,0 +1,290 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_DBAEXCHANGE_HXX_
+#define _SVX_DBAEXCHANGE_HXX_
+
+#include <svtools/transfer.hxx>
+#include <comphelper/stl_types.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <svx/dataaccessdescriptor.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include "svx/svxdllapi.h"
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+// column transfer formats
+#define CTF_FIELD_DESCRIPTOR 0x0001 // the field descriptor format
+#define CTF_CONTROL_EXCHANGE 0x0002 // the control exchange format
+#define CTF_COLUMN_DESCRIPTOR 0x0004 // data access descriptor for a column
+
+ //====================================================================
+ //= OColumnTransferable
+ //====================================================================
+ class SVX_DLLPUBLIC OColumnTransferable : public TransferableHelper
+ {
+ protected:
+ ODataAccessDescriptor m_aDescriptor;
+ OUString m_sCompatibleFormat;
+ sal_Int32 m_nFormatFlags;
+
+ public:
+ /** construct the transferable
+ */
+ OColumnTransferable(
+ const OUString& _rDatasource
+ ,const OUString& _rConnectionResource
+ ,const sal_Int32 _nCommandType
+ ,const OUString& _rCommand
+ ,const OUString& _rFieldName
+ ,sal_Int32 _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
+ <ul><li>information sufficient to create a connection, that is, either one of DataSource, DatabaseLocation,
+ ConnectionResource, and daConnection</li>
+ <li>a Command</li>
+ <li>a CommandType</li>
+ <li>a ColumnName or ColumnObject</li>
+ </ul>
+ */
+ OColumnTransferable(
+ const ODataAccessDescriptor& _rDescriptor,
+ sal_Int32 _nFormats
+ );
+
+ /** 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 <arg>_nFormats</arg> does not include the CTF_COLUMN_DESCRIPTOR
+ flag.<br/>
+ May be <NULL/>.
+
+ @param _rxConnection
+ the connection the column belongs to. Won't be used if <arg>_nFormats</arg> does not include the CTF_COLUMN_DESCRIPTOR
+ flag.<br/>
+ May be <NULL/>.
+
+ @param _nFormats
+ supported formats. Must be a combination of the CTF_XXX flags
+ */
+ OColumnTransferable(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxForm,
+ const OUString& _rFieldName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ sal_Int32 _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 sal_Bool canExtractColumnDescriptor(const DataFlavorExVector& _rFlavors, sal_Int32 _nFormats);
+
+ /** extracts a column descriptor from the transferable given
+ */
+ static sal_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);
+
+ /** adds the data contained in the object to the given data container
+ <p>This method helps you treating this class as simple container class:<br/>
+ At the moment, it is a data container and a transferable.
+ Using <method>addDataToContainer</method>, you can treat the class as dumb data container,
+ doing the Drag'n'Drop with a <type>TransferDataContainer</type> instance (which may contain
+ additional formats)</p>
+ @TODO
+ split this class into a two separate classes: one for the data container aspect, one for
+ the transfer aspect
+ */
+ void addDataToContainer( TransferDataContainer* _pContainer );
+
+ protected:
+ // TransferableHelper overridables
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+
+ static sal_uInt32 getDescriptorFormatId();
+
+ private:
+ SVX_DLLPRIVATE void implConstruct(
+ const OUString& _rDatasource
+ ,const OUString& _rConnectionResource
+ ,const sal_Int32 _nCommandType
+ ,const OUString& _rCommand
+ ,const OUString& _rFieldName
+ );
+ };
+
+ //====================================================================
+ //= ODataAccessObjectTransferable
+ //====================================================================
+ /** class for transfering data access objects (tables, queries, statements ...)
+ */
+ class SVX_DLLPUBLIC ODataAccessObjectTransferable : public TransferableHelper
+ {
+ ODataAccessDescriptor m_aDescriptor;
+ OUString m_sCompatibleObjectDescription;
+ // needed to provide a SOT_FORMATSTR_ID_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 OUString& _rConnectionResource
+ ,const sal_Int32 _nCommandType
+ ,const OUString& _rCommand
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::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 OUString& _rConnectionResource
+ ,const sal_Int32 _nCommandType
+ ,const OUString& _rCommand
+ );
+
+ /** with this ctor, only the object descriptor format will be provided
+ */
+ ODataAccessObjectTransferable(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::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 sal_Bool canExtractObjectDescriptor(const DataFlavorExVector& _rFlavors);
+
+ /** extracts a object descriptor from the transferable given
+ */
+ static ODataAccessDescriptor
+ extractObjectDescriptor(const TransferableDataHelper& _rData);
+
+ protected:
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void ObjectReleased();
+
+ protected:
+ const ODataAccessDescriptor& getDescriptor() const { return m_aDescriptor; }
+ ODataAccessDescriptor& getDescriptor() { return m_aDescriptor; }
+ protected:
+ void addCompatibleSelectionDescription(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rSelRows
+ );
+ // normally, a derived class could simply access getDescriptor[daSelection] 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 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection
+ ,sal_Bool _bAddCommand
+ ,const OUString& _sActiveCommand);
+ };
+
+ //====================================================================
+ //= OMultiColumnTransferable
+ //====================================================================
+ /** class for transfering multiple columns
+ */
+ class SVX_DLLPUBLIC OMultiColumnTransferable : public TransferableHelper
+ {
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aDescriptors;
+
+ public:
+ OMultiColumnTransferable(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aDescriptors);
+
+ /** 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 sal_Bool canExtractDescriptor(const DataFlavorExVector& _rFlavors);
+
+ /** extracts a object descriptor from the transferable given
+ */
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > extractDescriptor(const TransferableDataHelper& _rData);
+
+ protected:
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void ObjectReleased();
+ static sal_uInt32 getDescriptorFormatId();
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // _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 000000000000..9be3bfbf0da2
--- /dev/null
+++ b/include/svx/dbaobjectex.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 SVX_DBAOBJECTEX_HXX
+#define SVX_DBAOBJECTEX_HXX
+
+#include <svtools/transfer.hxx>
+#include <comphelper/stl_types.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/ucb/XContent.hpp>
+#include <svx/dataaccessdescriptor.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include "svx/svxdllapi.h"
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+ //====================================================================
+ //= OComponentTransferable
+ //====================================================================
+ class SVX_DLLPUBLIC OComponentTransferable : public TransferableHelper
+ {
+ protected:
+ ODataAccessDescriptor m_aDescriptor;
+
+ public:
+ /** construct the transferable
+ */
+ OComponentTransferable(
+ const OUString& _rDatasourceOrLocation
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>& _xContent
+ );
+
+ /** checks whether or not a component descriptor can be extracted from the data flavor vector given
+ @param _rFlavors
+ available flavors
+ */
+ static sal_Bool canExtractComponentDescriptor(const DataFlavorExVector& _rFlavors,sal_Bool _bForm );
+
+ /** extracts a component descriptor from the transferable given
+ */
+ static ODataAccessDescriptor
+ extractComponentDescriptor(const TransferableDataHelper& _rData);
+
+ protected:
+ // TransferableHelper overridables
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+
+ static sal_uInt32 getDescriptorFormatId(sal_Bool _bExtractForm);
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // SVX_DBAOBJECTEX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/dbcharsethelper.hxx b/include/svx/dbcharsethelper.hxx
new file mode 100644
index 000000000000..318d35a54f69
--- /dev/null
+++ b/include/svx/dbcharsethelper.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 SVX_DBCHARSETHELPER_HXX
+#define SVX_DBCHARSETHELPER_HXX
+#include "svx/svxdllapi.h"
+#include "svx/dbtoolsclient.hxx"
+
+//........................................................................
+namespace svxform
+{
+//........................................................................
+
+ //====================================================================
+ //= ODataAccessCharsetHelper
+ //====================================================================
+ class SVX_DLLPUBLIC ODataAccessCharsetHelper : public ODbtoolsClient
+ {
+ protected:
+ mutable ::rtl::Reference< ::connectivity::simple::IDataAccessCharSet > m_xCharsetHelper;
+
+ protected:
+ virtual bool ensureLoaded() const;
+
+ public:
+ ODataAccessCharsetHelper( );
+
+ inline sal_Int32 getSupportedTextEncodings( ::std::vector< rtl_TextEncoding >& _rEncs ) const
+ {
+ if ( ensureLoaded() )
+ return m_xCharsetHelper->getSupportedTextEncodings( _rEncs );
+ return 0;
+ }
+ };
+
+//........................................................................
+} // namespace svxform
+//........................................................................
+
+#endif // SVX_DBCHARSETCLIENT_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/dbtoolsclient.hxx b/include/svx/dbtoolsclient.hxx
new file mode 100644
index 000000000000..c1afd4690509
--- /dev/null
+++ b/include/svx/dbtoolsclient.hxx
@@ -0,0 +1,204 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVX_DBTOOLSCLIENT_HXX
+#define SVX_DBTOOLSCLIENT_HXX
+
+#include <connectivity/virtualdbtools.hxx>
+#include <osl/mutex.hxx>
+#include <osl/module.h>
+#include <tools/solar.h>
+#include <unotools/sharedunocomponent.hxx>
+#include "svx/svxdllapi.h"
+
+//........................................................................
+namespace svxform
+{
+//........................................................................
+
+ typedef ::utl::SharedUNOComponent< ::com::sun::star::sdbc::XConnection > SharedConnection;
+
+ //====================================================================
+ //= ODbtoolsClient
+ //====================================================================
+ /** base class for classes which want to use dbtools features with load-on-call
+ of the dbtools lib.
+ */
+ class SVX_DLLPUBLIC ODbtoolsClient
+ {
+ private:
+ static sal_Int32 s_nClients;
+ static oslModule s_hDbtoolsModule;
+ static ::connectivity::simple::createDataAccessToolsFactoryFunction
+ s_pFactoryCreationFunc;
+
+ mutable sal_Bool m_bCreateAlready;
+
+ private:
+ mutable ::rtl::Reference< ::connectivity::simple::IDataAccessToolsFactory > m_xDataAccessFactory;
+
+ protected:
+ ODbtoolsClient();
+ virtual ~ODbtoolsClient();
+
+ virtual bool ensureLoaded() const;
+
+ protected:
+ const ::rtl::Reference< ::connectivity::simple::IDataAccessToolsFactory >&
+ getFactory() const { return m_xDataAccessFactory; }
+
+ private:
+ static void registerClient();
+ static void revokeClient();
+ };
+
+ //====================================================================
+ //= OStaticDataAccessTools
+ //====================================================================
+ class SVX_DLLPUBLIC OStaticDataAccessTools : public ODbtoolsClient
+ {
+ protected:
+ mutable ::rtl::Reference< ::connectivity::simple::IDataAccessTools > m_xDataAccessTools;
+
+ protected:
+ virtual bool ensureLoaded() const;
+
+ public:
+ OStaticDataAccessTools();
+
+ const ::rtl::Reference< ::connectivity::simple::IDataAccessTools >& getDataAccessTools() const { return m_xDataAccessTools; }
+
+ // ------------------------------------------------
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> getNumberFormats(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConn,
+ sal_Bool _bAllowDefault
+ ) const;
+
+ // ------------------------------------------------
+ sal_Int32 getDefaultNumberFormat(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xColumn,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes >& _xTypes,
+ const ::com::sun::star::lang::Locale& _rLocale );
+
+ // ------------------------------------------------
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection_withFeedback(
+ const OUString& _rDataSourceName,
+ const OUString& _rUser,
+ const OUString& _rPwd,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext
+ ) const SAL_THROW ( (::com::sun::star::sdbc::SQLException) );
+
+ // ------------------------------------------------
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> connectRowset(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext,
+ sal_Bool _bSetAsActiveConnection
+ ) const SAL_THROW ( ( ::com::sun::star::sdbc::SQLException
+ , ::com::sun::star::lang::WrappedTargetException
+ , ::com::sun::star::uno::RuntimeException) );
+
+ // ------------------------------------------------
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getRowSetConnection(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet)
+ const SAL_THROW ( (::com::sun::star::uno::RuntimeException) );
+
+ // ------------------------------------------------
+ void TransferFormComponentProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxOld,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxNew,
+ const ::com::sun::star::lang::Locale& _rLocale
+ ) const;
+
+ // ------------------------------------------------
+ OUString quoteName(
+ const OUString& _rQuote,
+ const OUString& _rName
+ ) const;
+
+ // ------------------------------------------------
+ OUString composeTableNameForSelect(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable
+ ) const;
+
+ // ------------------------------------------------
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > getDataSource(
+ const OUString& _rsRegisteredName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext
+ ) const;
+
+ // ------------------------------------------------
+ /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::INSERT
+ @param _rxCursorSet the property set
+ */
+ sal_Bool canInsert(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const;
+
+ // ------------------------------------------------
+ /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::UPDATE
+ @param _rxCursorSet the property set
+ */
+ sal_Bool canUpdate(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const;
+
+ // ------------------------------------------------
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
+ getFieldsByCommandDescriptor(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const sal_Int32 _nCommandType,
+ const OUString& _rCommand,
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxKeepFieldsAlive,
+ ::dbtools::SQLExceptionInfo* _pErrorInfo = NULL
+ ) SAL_THROW( ( ) );
+
+ // ------------------------------------------------
+ bool isEmbeddedInDatabase(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent,
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxActualConnection
+ );
+
+ // ------------------------------------------------
+ bool isEmbeddedInDatabase(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent
+ );
+ };
+
+ //====================================================================
+ //= DBToolsObjectFactory
+ //====================================================================
+ class SVX_DLLPUBLIC DBToolsObjectFactory : public ODbtoolsClient
+ {
+ public:
+ DBToolsObjectFactory();
+ ~DBToolsObjectFactory();
+
+ // ------------------------------------------------
+ ::std::auto_ptr< ::dbtools::FormattedColumnValue > createFormattedColumnValue(
+ const ::comphelper::ComponentContext& _rContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn
+ );
+ };
+
+//........................................................................
+} // namespace svxform
+//........................................................................
+
+#endif // SVX_DBTOOLSCLIENT_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 000000000000..565f396a6d3b
--- /dev/null
+++ b/include/svx/def3d.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 _SVX_DEF3D_HXX
+#define _SVX_DEF3D_HXX
+
+#ifndef _INC_MATH
+#include <math.h>
+#endif
+#include <tools/solar.h>
+
+const double fPiDiv180 = 0.01745329251994;
+const double EPSILON = 1e-06;
+
+#define DEG2RAD(fAngle) (fPiDiv180 * (fAngle))
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//+++ 3D helper functions ++++++++++++++++++++++++++++++++++++++++++++++++
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+enum E3dDragConstraint { E3DDRAG_CONSTR_X = 0x0001,
+ E3DDRAG_CONSTR_Y = 0x0002,
+ E3DDRAG_CONSTR_Z = 0x0004,
+ E3DDRAG_CONSTR_XY = 0x0003,
+ E3DDRAG_CONSTR_XZ = 0x0005,
+ E3DDRAG_CONSTR_YZ = 0x0006,
+ E3DDRAG_CONSTR_XYZ = 0x0007
+};
+
+#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 000000000000..a5db1345fc05
--- /dev/null
+++ b/include/svx/deflt3d.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 _E3D_DEFLT3D_HXX
+#define _E3D_DEFLT3D_HXX
+
+#include <basegfx/point/b3dpoint.hxx>
+#include <basegfx/vector/b3dvector.hxx>
+#include "svx/svxdllapi.h"
+#include <tools/color.hxx>
+
+/*************************************************************************
+|*
+|* Class for managing the 3D default attributes
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC E3dDefaultAttributes
+{
+private:
+ // Compound object
+ Color aDefaultAmbientColor;
+ sal_Bool bDefaultCreateNormals;
+ sal_Bool bDefaultCreateTexture;
+
+ // Cube object
+ basegfx::B3DPoint aDefaultCubePos;
+ basegfx::B3DVector aDefaultCubeSize;
+ sal_uInt16 nDefaultCubeSideFlags;
+ sal_Bool bDefaultCubePosIsCenter;
+
+ // Sphere object
+ basegfx::B3DPoint aDefaultSphereCenter;
+ basegfx::B3DVector aDefaultSphereSize;
+
+ // Lathe object
+ long nDefaultLatheEndAngle;
+ sal_Bool bDefaultLatheSmoothed;
+ sal_Bool bDefaultLatheSmoothFrontBack;
+ sal_Bool bDefaultLatheCharacterMode;
+ sal_Bool bDefaultLatheCloseFront;
+ sal_Bool bDefaultLatheCloseBack;
+
+ // Extrude object
+ sal_Bool bDefaultExtrudeSmoothed;
+ sal_Bool bDefaultExtrudeSmoothFrontBack;
+ sal_Bool bDefaultExtrudeCharacterMode;
+ sal_Bool bDefaultExtrudeCloseFront;
+ sal_Bool bDefaultExtrudeCloseBack;
+
+public:
+ // Construktor
+ E3dDefaultAttributes();
+
+ // Reset to defaults
+ void Reset();
+
+ // Getter/Setter for default values of all 3D objects
+ // Compound object
+ const Color& GetDefaultAmbientColor() { return aDefaultAmbientColor; }
+ void SetDefaultAmbientColor(const Color& rNew) { aDefaultAmbientColor = rNew; }
+
+ sal_Bool GetDefaultCreateNormals() const { return bDefaultCreateNormals; }
+ void SetDefaultCreateNormals(const sal_Bool bNew) { bDefaultCreateNormals = bNew; }
+ sal_Bool GetDefaultCreateTexture() const { return bDefaultCreateTexture; }
+ void SetDefaultCreateTexture(const sal_Bool bNew) { bDefaultCreateTexture = bNew; }
+
+ // Cube object
+ const basegfx::B3DPoint& GetDefaultCubePos() { return aDefaultCubePos; }
+ void SetDefaultCubePos(const basegfx::B3DPoint& rNew) { aDefaultCubePos = rNew; }
+ const basegfx::B3DVector& GetDefaultCubeSize() { return aDefaultCubeSize; }
+ void SetDefaultCubeSize(const basegfx::B3DVector& rNew) { aDefaultCubeSize = rNew; }
+ sal_uInt16 GetDefaultCubeSideFlags() const { return nDefaultCubeSideFlags; }
+ void SetDefaultCubeSideFlags(const sal_uInt16 nNew) { nDefaultCubeSideFlags = nNew; }
+ sal_Bool GetDefaultCubePosIsCenter() const { return bDefaultCubePosIsCenter; }
+ void SetDefaultCubePosIsCenter(const sal_Bool bNew) { bDefaultCubePosIsCenter = bNew; }
+
+ // Sphere object
+ const basegfx::B3DPoint& GetDefaultSphereCenter() { return aDefaultSphereCenter; }
+ void SetDefaultSphereCenter(const basegfx::B3DPoint& rNew) { aDefaultSphereCenter = rNew; }
+ const basegfx::B3DVector& GetDefaultSphereSize() { return aDefaultSphereSize; }
+ void SetDefaultSphereSize(const basegfx::B3DPoint& rNew) { aDefaultSphereSize = rNew; }
+
+ // Lathe object
+ long GetDefaultLatheEndAngle() const { return nDefaultLatheEndAngle; }
+ void SetDefaultLatheEndAngle(const long nNew) { nDefaultLatheEndAngle = nNew; }
+ sal_Bool GetDefaultLatheSmoothed() const { return bDefaultLatheSmoothed; }
+ void SetDefaultLatheSmoothed(const sal_Bool bNew) { bDefaultLatheSmoothed = bNew; }
+ sal_Bool GetDefaultLatheSmoothFrontBack() const { return bDefaultLatheSmoothFrontBack; }
+ void SetDefaultLatheSmoothFrontBack(const sal_Bool bNew) { bDefaultLatheSmoothFrontBack = bNew; }
+ sal_Bool GetDefaultLatheCharacterMode() const { return bDefaultLatheCharacterMode; }
+ void SetDefaultLatheCharacterMode(const sal_Bool bNew) { bDefaultLatheCharacterMode = bNew; }
+ sal_Bool GetDefaultLatheCloseFront() const { return bDefaultLatheCloseFront; }
+ void SetDefaultLatheCloseFront(const sal_Bool bNew) { bDefaultLatheCloseFront = bNew; }
+ sal_Bool GetDefaultLatheCloseBack() const { return bDefaultLatheCloseBack; }
+ void SetDefaultLatheCloseBack(const sal_Bool bNew) { bDefaultLatheCloseBack = bNew; }
+
+ // Extrude object
+ sal_Bool GetDefaultExtrudeSmoothed() const { return bDefaultExtrudeSmoothed; }
+ void SetDefaultExtrudeSmoothed(const sal_Bool bNew) { bDefaultExtrudeSmoothed = bNew; }
+ sal_Bool GetDefaultExtrudeSmoothFrontBack() const { return bDefaultExtrudeSmoothFrontBack; }
+ void SetDefaultExtrudeSmoothFrontBack(const sal_Bool bNew) { bDefaultExtrudeSmoothFrontBack = bNew; }
+ sal_Bool GetDefaultExtrudeCharacterMode() const { return bDefaultExtrudeCharacterMode; }
+ void SetDefaultExtrudeCharacterMode(const sal_Bool bNew) { bDefaultExtrudeCharacterMode = bNew; }
+ sal_Bool GetDefaultExtrudeCloseFront() const { return bDefaultExtrudeCloseFront; }
+ void SetDefaultExtrudeCloseFront(const sal_Bool bNew) { bDefaultExtrudeCloseFront = bNew; }
+ sal_Bool GetDefaultExtrudeCloseBack() const { return bDefaultExtrudeCloseBack; }
+ void SetDefaultExtrudeCloseBack(const sal_Bool bNew) { bDefaultExtrudeCloseBack = bNew; }
+};
+
+#endif // _E3D_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 000000000000..fbb4d271679d
--- /dev/null
+++ b/include/svx/dialcontrol.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 SVX_DIALCONTROL_HXX
+#define SVX_DIALCONTROL_HXX
+
+#include <memory>
+#include <vcl/ctrl.hxx>
+#include <sfx2/itemconnect.hxx>
+#include "svx/svxdllapi.h"
+
+class NumericField;
+
+namespace svx {
+
+// ============================================================================
+
+struct DialControl_Impl;
+
+/** 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 SVX_DLLPUBLIC DialControl : public Control
+{
+public:
+ explicit DialControl( Window* pParent, const ResId& rResId );
+ explicit DialControl( Window* pParent, WinBits nBits );
+
+ virtual ~DialControl();
+
+ virtual void Paint( const Rectangle& rRect );
+
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void LoseFocus();
+
+ virtual Size GetOptimalSize() const;
+ virtual void Resize();
+
+ /** 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();
+
+ /** 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 );
+
+ /** Links the passed numeric edit field to the control (bi-directional). */
+ void SetLinkedField( NumericField* pField );
+ /** Returns the linked numeric edit field, or 0. */
+ NumericField* GetLinkedField() const;
+
+ /** The passed handler is called whenever the totation value changes. */
+ void SetModifyHdl( const Link& rLink );
+ /** Returns the current modify handler. */
+ const Link& GetModifyHdl() const;
+
+ /** Save value for later comparison */
+ void SaveValue();
+
+ /** Compare value with the saved value */
+ bool IsValueModified();
+
+private:
+ void Init( const Size& rWinSize, const Font& rWinFont );
+ void Init( const Size& rWinSize );
+ void InvalidateControl();
+
+ void ImplSetRotation( sal_Int32 nAngle, bool bBroadcast );
+ void ImplSetFieldLink( const Link& rLink );
+
+ void HandleMouseEvent( const Point& rPos, bool bInitial );
+ void HandleEscapeEvent();
+
+ DECL_LINK( LinkedFieldModifyHdl, NumericField* );
+
+ std::auto_ptr< DialControl_Impl > mpImpl;
+};
+
+// ============================================================================
+
+/** Wrapper for usage of a DialControl in item connections. */
+class SVX_DLLPUBLIC DialControlWrapper : public sfx::SingleControlWrapper< DialControl, sal_Int32 >
+{
+public:
+ explicit DialControlWrapper( DialControl& rDial );
+
+ virtual bool IsControlDontKnow() const;
+ virtual void SetControlDontKnow( bool bSet );
+
+ virtual sal_Int32 GetControlValue() const;
+ virtual void SetControlValue( sal_Int32 nValue );
+};
+
+// ----------------------------------------------------------------------------
+
+/** An item<->control connection for a DialControl. */
+typedef sfx::ItemControlConnection< sfx::Int32ItemWrapper, DialControlWrapper > DialControlConnection;
+
+// ============================================================================
+
+} // namespace svx
+
+#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 000000000000..ba2941da2298
--- /dev/null
+++ b/include/svx/dialmgr.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 _SVX_DIALMGR_HXX
+#define _SVX_DIALMGR_HXX
+
+#include <tools/resid.hxx>
+#include "svx/svxdllapi.h"
+
+// forward ---------------------------------------------------------------
+
+class ResMgr;
+struct SVX_DLLPUBLIC DialogsResMgr
+{
+ static ResMgr* GetResMgr();
+};
+
+#define DIALOG_MGR() (*DialogsResMgr::GetResMgr())
+#define SVX_RES(i) ResId(i,DIALOG_MGR())
+#define SVX_RESSTR(i) SVX_RES(i).toString()
+
+#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 000000000000..d41157c46877
--- /dev/null
+++ b/include/svx/dialogs.hrc
@@ -0,0 +1,1031 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_DIALOGS_HRC
+#define _SVX_DIALOGS_HRC
+
+#include <svx/svxids.hrc>
+#include <sfx2/dialogs.hrc>
+
+// Resource-Id's ------------------------------------------------------------
+
+// Please maintain FIRSTFREE (does not apply to strings)
+#define RID_SVX_FIRSTFREE 314
+
+// some strings also used in CUI
+#define RID_SVXERRCTX (RID_SVX_START + 351)
+#define RID_SVXSTR_COLOR (RID_SVX_START + 179)
+#define RID_SVXSTR_TRANSPARENT (RID_SVX_START + 190)
+#define RID_SVXSTR_AUTOMATIC (RID_SVX_START + 841)
+#define RID_SVXSTR_INVISIBLE (RID_SVX_START + 178)
+#define RID_SVXSTR_NONE (RID_SVX_START + 183)
+#define RID_SVXSTR_SOLID (RID_SVX_START + 160)
+#define RID_SVXSTR_LINEEND (RID_SVX_START + 237)
+#define RID_SVXSTR_GRADIENT (RID_SVX_START + 161)
+#define RID_SVXSTR_HATCH (RID_SVX_START + 180)
+#define RID_SVXSTR_BITMAP (RID_SVX_START + 167)
+#define RID_SVXSTR_LINESTYLE (RID_SVX_START + 173)
+#define RID_SVXSTR_FIELDUNIT_TABLE (RID_SVX_START + 311)
+#define RID_SVXSTR_COLOR_USER (RID_SVX_START + 250)
+#define RID_SVXSTR_GALLERYPROPS_GALTHEME (RID_SVX_START + 251)
+#define RID_SVXSTR_GALLERY_THEMEITEMS (RID_SVX_START + 252)
+#define RID_SVXSTR_GALLERY_THEMENAME (RID_SVX_START + 253)
+#define RID_SVXSTR_GALLERY_FILESFOUND (RID_SVX_START + 254)
+#define RID_SVXSTR_GALLERY_PREVIEW (RID_SVX_START + 255)
+
+// 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_BACKGROUND (RID_SVX_START + 1)
+#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_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_CAPTION (RID_SVX_START + 150)
+#define RID_SVXPAGE_SWPOSSIZE (RID_SVX_START + 288)
+#define RID_SVXPAGE_POSITION_SIZE (RID_SVX_START + 87)
+#define RID_SVXPAGE_EVENTASSIGN (RID_SVX_START + 303)
+#define RID_SVXPAGE_HATCH (RID_SVX_START + 57)
+#define RID_SVXPAGE_BITMAP (RID_SVX_START + 58)
+#define RID_SVXPAGE_GRADIENT (RID_SVX_START + 59)
+#define RID_SVXPAGE_ANGLE (RID_SVX_START + 48)
+#define RID_SVXPAGE_SLANT (RID_SVX_START + 49)
+#define RID_SVXPAGE_DISTRIBUTE (RID_SVX_START + 236)
+#define RID_SVXPAGE_MACROASSIGN (RID_SVX_START + 296)
+
+
+// why extra defines for pages that already exist?
+#define RID_SCH_TransformTabDLG_SVXPAGE_ANGLE (RID_SVX_START + 998)
+#define RID_SCH_TransformTabDLG_SVXPAGE_SLANT (RID_SVX_START + 999)
+
+// ID of tabpages implemented in SVX, but used in CUI
+#define RID_SVXPAGE_GRID (RID_SVX_START + 152)
+
+// factory IDs of dialogs implemented in CUI
+#define RID_SVX_GRFFILTER_DLG_SEPIA (RID_SVX_START + 334)
+#define RID_SVX_GRFFILTER_DLG_POSTER (RID_SVX_START + 335)
+#define RID_SVX_GRFFILTER_DLG_MOSAIC (RID_SVX_START + 332)
+#define RID_SVX_GRFFILTER_DLG_SOLARIZE (RID_SVX_START + 333)
+#define RID_SVX_GRFFILTER_DLG_EMBOSS (RID_SVX_START + 336)
+#define RID_SVX_GRFFILTER_DLG_SMOOTH (RID_SVX_START + 337)
+#define RID_SVXDLG_SEARCHFORMAT (RID_SVX_START + 21)
+#define RID_SVXDLG_CHARMAP ( RID_SVX_START + 10 )
+
+// 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_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_INPUT (RID_OFA_START + 220)
+#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_OFA_TP_INTERNATIONAL_SD (RID_OFA_START + 253)
+#define RID_OFA_TP_INTERNATIONAL_IMPR (RID_OFA_START + 254)
+#define RID_OFA_TP_INTERNATIONAL (RID_OFA_START + 252) // calc
+#define RID_SC_TP_DEFAULTS (RID_OFA_START + 253)
+
+//---------------------------------------------------------------------
+
+// ResId fuer den Suchen/Ersetzen-Dialog
+#define RID_SVXDLG_SEARCH (RID_SVX_START + 20)
+
+// ResId fuer die PageDialog
+#define RID_SVXQBX_DELETE_HEADFOOT (RID_SVX_START + 28)
+
+// ResId's fuer Dialoge aus StarDraw
+#define RID_SVXSW_FRAMEPOSITIONS (RID_SVX_START + 289)
+
+#define RID_SVXIL_FRAME (RID_SVX_START + 65)
+
+#define RID_SVXFLOAT_3D (RID_SVX_START + 209)
+
+#define RID_SVXIMAGE_LIGHT_ON (RID_SVX_START + 210)
+#define RID_SVXIMAGE_LIGHT_OFF (RID_SVX_START + 211)
+#define RID_SVXIMAGE_COLORDLG (RID_SVX_START + 214)
+
+#define RID_SVXFLOAT3D_COLOR_LIGHT_PRE (RID_SVX_START + 72)
+#define RID_SVXFLOAT3D_FAVORITE (RID_SVX_START + 73)
+#define RID_SVXFLOAT3D_FIX_X (RID_SVX_START + 74)
+#define RID_SVXFLOAT3D_FIX_Y (RID_SVX_START + 75)
+#define RID_SVXFLOAT3D_FIX_Z (RID_SVX_START + 76)
+#define RID_SVXFLOAT3D_FIX_R (RID_SVX_START + 77)
+#define RID_SVXFLOAT3D_FIX_G (RID_SVX_START + 78)
+#define RID_SVXFLOAT3D_FIX_B (RID_SVX_START + 84)
+
+// ResId's for the FontMenu controls
+#define RID_MN_FONTSIZE (RID_SVX_START + 80)
+
+// ResId for zoom popup menu
+#define RID_SVXMNU_ZOOM (RID_SVX_START + 82)
+
+// ResId for funktion popup menue
+#define RID_SVXMNU_PSZ_FUNC (RID_SVX_START + 83)
+#define RID_SVXMNU_XMLSECSTATBAR (RID_SVX_START + 84)
+
+// ResId for position and size bitmap
+#define RID_SVXBMP_POSITION (RID_SVX_START + 85)
+#define RID_SVXBMP_SIZE (RID_SVX_START + 86)
+
+#define RID_SVXBMP_SIGNET (RID_SVX_START + 87)
+#define RID_SVXBMP_SIGNET_BROKEN (RID_SVX_START + 89)
+#define RID_SVXBMP_SIGNET_NOTVALIDATED (RID_SVX_START + 91)
+
+#define RID_SVXBMP_SLIDERBUTTON (RID_SVX_START + 67)
+#define RID_SVXBMP_SLIDERDECREASE (RID_SVX_START + 68)
+#define RID_SVXBMP_SLIDERINCREASE (RID_SVX_START + 69)
+
+// Menu for the ruler
+#define RID_SVXMN_RULER (RID_SVX_START + 92)
+
+// FontWork dialog
+#define RID_SVXDLG_FONTWORK (RID_SVX_START + 93)
+
+// FontWork ValueSet bitmaps
+#define RID_SVXBMP_FONTWORK_FORM1 (RID_SVX_START + 94)
+#define RID_SVXBMP_FONTWORK_FORM2 (RID_SVX_START + 95)
+#define RID_SVXBMP_FONTWORK_FORM3 (RID_SVX_START + 96)
+#define RID_SVXBMP_FONTWORK_FORM4 (RID_SVX_START + 97)
+#define RID_SVXBMP_FONTWORK_FORM5 (RID_SVX_START + 98)
+#define RID_SVXBMP_FONTWORK_FORM6 (RID_SVX_START + 99)
+#define RID_SVXBMP_FONTWORK_FORM7 (RID_SVX_START + 100)
+#define RID_SVXBMP_FONTWORK_FORM8 (RID_SVX_START + 101)
+#define RID_SVXBMP_FONTWORK_FORM9 (RID_SVX_START + 102)
+#define RID_SVXBMP_FONTWORK_FORM10 (RID_SVX_START + 103)
+#define RID_SVXBMP_FONTWORK_FORM11 (RID_SVX_START + 104)
+#define RID_SVXBMP_FONTWORK_FORM12 (RID_SVX_START + 105)
+
+#define RID_SVXCTRL_COLOR (RID_SVX_START + 117)
+
+// for Toolbox-Control style
+#define RID_SVXTBX_STYLE (RID_SVX_START + 120)
+
+#define RID_SVXDLG_PASSWORD (RID_SVX_START + 141)
+#define RID_SVXDLG_COMPRESSGRAPHICS (RID_SVX_START + 142)
+
+// Dialog for functions
+#define RID_SVXDLG_CALCFUNC (RID_SVX_START + 206)
+
+// QueryBox for Exit Recovery Wizard
+#define RID_SVXQB_EXIT_RECOVERY (RID_SVX_START + 215)
+
+#define RID_SVXCTRL_RECTBTNS (RID_SVX_START + 226)
+
+// ResId's for Starone impl. bitmaps
+#define RID_UNODRAW_OBJECTS (RID_SVX_START + 233)
+#define RID_UNODRAW_OLE2 (RID_SVX_START + 234)
+#define RID_UNODRAW_GRAPHICS (RID_SVX_START + 235)
+
+#define RID_SVXIMG_NOTCHECKED (RID_SVX_START + 243)
+#define RID_SVXIMG_CHECKED (RID_SVX_START + 244)
+
+#define RID_SVXDLG_TEXTCONTROL_CHARATTR (RID_SVX_START + 286)
+#define RID_SVXDLG_TEXTCONTROL_PARAATTR (RID_SVX_START + 287)
+
+#define RID_SVXDLG_LINK_WARNING (RID_SVX_START + 313)
+// !!! please update RID_SVX_FIRSTFREE !!! see line 46
+
+// Strings ------------------------------------------------------------------
+
+// Strings for the language
+#define RID_SVXSTR_LANGUAGE_ALL (RID_SVX_START + 15)
+
+// Strings from the search dialog
+#define RID_SVXSTR_SEARCH_STYLES (RID_SVX_START + 80)
+#define RID_SVXSTR_SEARCH (RID_SVX_START + 81)
+#define RID_SVXSTR_REPLACE (RID_SVX_START + 82)
+#define RID_SVXSTR_WRITER_STYLES (RID_SVX_START + 83)
+#define RID_SVXSTR_CALC_STYLES (RID_SVX_START + 85)
+// ResIds for the PageDialog
+
+// Strings of the ToolBox-Controls from tbcontrl.cxx
+#define RID_SVXSTR_FILLPATTERN (RID_SVX_START + 191)
+#define RID_SVXSTR_FRAME (RID_SVX_START + 192)
+#define RID_SVXSTR_FRAME_COLOR (RID_SVX_START + 194)
+#define RID_SVXSTR_FRAME_STYLE (RID_SVX_START + 195)
+#define RID_SVXSTR_EXTRAS_CHARBACKGROUND (RID_SVX_START + 196)
+#define RID_SVXSTR_CLEARFORM (RID_SVX_START + 197)
+#define RID_SVXSTR_MORE (RID_SVX_START + 198)
+#define RID_SVXSTR_CHARFONTNAME_NOTAVAILABLE (RID_SVX_START + 199)
+#define RID_SVXSTR_CHARFONTNAME (RID_SVX_START + 200)
+
+// Strings for insert/overwrite mode
+#define RID_SVXSTR_INSERT_HELPTEXT (RID_SVX_START + 210)
+#define RID_SVXSTR_OVERWRITE_HELPTEXT (RID_SVX_START + 211)
+#define RID_SVXSTR_OVERWRITE_TEXT (RID_SVX_START + 212)
+
+// Strings for the selection mode
+#define RID_SVXMENU_SELECTION (RID_SVX_START + 213)
+#define RID_SVXBMP_SELECTION (RID_SVX_START + 215)
+
+#define RID_SVXSTR_XMLSEC_SIG_OK (RID_SVX_START + 222)
+#define RID_SVXSTR_XMLSEC_SIG_OK_NO_VERIFY (RID_SVX_START + 223)
+#define RID_SVXSTR_XMLSEC_SIG_NOT_OK (RID_SVX_START + 224)
+#define RID_SVXSTR_XMLSEC_NO_SIG (RID_SVX_START + 225)
+#define RID_SVXSTR_XMLSEC_SIG_CERT_OK_PARTIAL_SIG (RID_SVX_START + 226)
+
+// Strings for the ruler
+#define RID_SVXSTR_RULER_START (RID_SVX_START + 245)
+#define RID_SVXSTR_RULER_TAB_LEFT (RID_SVX_START + 245)
+#define RID_SVXSTR_RULER_TAB_RIGHT (RID_SVX_START + 246)
+#define RID_SVXSTR_RULER_TAB_DECIMAL (RID_SVX_START + 247)
+#define RID_SVXSTR_RULER_TAB_CENTER (RID_SVX_START + 248)
+
+// Close (in TabDialog line/aria)
+#define RID_SVXSTR_CLOSE (RID_SVX_START + 260)
+
+// FontWork-ValueSet-Strings
+#define RID_SVXSTR_FONTWORK_FORM1 (RID_SVX_START + 261)
+#define RID_SVXSTR_FONTWORK_FORM2 (RID_SVX_START + 262)
+#define RID_SVXSTR_FONTWORK_FORM3 (RID_SVX_START + 263)
+#define RID_SVXSTR_FONTWORK_FORM4 (RID_SVX_START + 264)
+#define RID_SVXSTR_FONTWORK_FORM5 (RID_SVX_START + 265)
+#define RID_SVXSTR_FONTWORK_FORM6 (RID_SVX_START + 266)
+#define RID_SVXSTR_FONTWORK_FORM7 (RID_SVX_START + 267)
+#define RID_SVXSTR_FONTWORK_FORM8 (RID_SVX_START + 268)
+#define RID_SVXSTR_FONTWORK_FORM9 (RID_SVX_START + 269)
+#define RID_SVXSTR_FONTWORK_FORM10 (RID_SVX_START + 270)
+#define RID_SVXSTR_FONTWORK_FORM11 (RID_SVX_START + 271)
+#define RID_SVXSTR_FONTWORK_FORM12 (RID_SVX_START + 272)
+#define RID_SVXSTR_FONTWORK_UNDOCREATE (RID_SVX_START + 273)
+
+// Color strings
+#define RID_SVXSTR_BLACK (RID_SVX_START + 275)
+#define RID_SVXSTR_BLUE (RID_SVX_START + 276)
+#define RID_SVXSTR_GREEN (RID_SVX_START + 277)
+#define RID_SVXSTR_CYAN (RID_SVX_START + 278)
+#define RID_SVXSTR_RED (RID_SVX_START + 279)
+#define RID_SVXSTR_MAGENTA (RID_SVX_START + 280)
+#define RID_SVXSTR_BROWN (RID_SVX_START + 281)
+#define RID_SVXSTR_GREY (RID_SVX_START + 282)
+#define RID_SVXSTR_LIGHTGREY (RID_SVX_START + 283)
+#define RID_SVXSTR_LIGHTBLUE (RID_SVX_START + 284)
+#define RID_SVXSTR_LIGHTGREEN (RID_SVX_START + 285)
+#define RID_SVXSTR_LIGHTCYAN (RID_SVX_START + 286)
+#define RID_SVXSTR_LIGHTRED (RID_SVX_START + 287)
+#define RID_SVXSTR_LIGHTMAGENTA (RID_SVX_START + 288)
+#define RID_SVXSTR_YELLOW (RID_SVX_START + 289)
+#define RID_SVXSTR_WHITE (RID_SVX_START + 290)
+#define RID_SVXSTR_BLUEGREY (RID_SVX_START + 291)
+#define RID_SVXSTR_ORANGE (RID_SVX_START + 292)
+
+// Line endings strings
+#define RID_SVXSTR_ARROW (RID_SVX_START + 300)
+#define RID_SVXSTR_SQUARE (RID_SVX_START + 301)
+#define RID_SVXSTR_CIRCLE (RID_SVX_START + 302)
+
+#define RID_SVXSTR_TRANSPARENCE (RID_SVX_START + 305)
+#define RID_SVXSTR_CENTERED (RID_SVX_START + 306)
+#define RID_SVXSTR_NOTCENTERED (RID_SVX_START + 307)
+
+#define RID_SVXSTR_VIEW (RID_SVX_START + 308)
+#define RID_SVXSTR_FILTER (RID_SVX_START + 309)
+
+// String-Arrays
+#define RID_SVXSTR_TEXTENCODING_TABLE (RID_SVX_START + 312)
+
+// Graphic filter
+#define RID_SVXTBX_GRFFILTER (RID_SVX_START + 331)
+
+#define RID_SVXERRCODE (RID_SVX_START + 350)
+
+// gallery
+#define RID_SVX_GALLERY_START (RID_SVX_START + 360)
+// RID_SVX_GALLERY_END (RID_SVX_START + 410)
+
+// Define - Region for bitmap masking
+// !!! don't use defines from this region !!!
+#define RID_SVX_BMPMASK_START (RID_SVX_START + 420)
+// RID_SVX_BMPMASK_END (RID_SVX_START + 440)
+
+// Define - Region for IMAP editor
+// !!! don't use defines from this region !!!
+#define RID_SVX_IMAP_START (RID_SVX_START + 450)
+// RID_SVX_IMAP_END (RID_SVX_START + 460)
+
+// Define - Region for contour editor
+// !!! don't use defines from this region !!!
+#define RID_SVX_CONTOUR_START (RID_SVX_START + 461)
+// RID_SVX_CONTOUR_END (RID_SVX_START + 471)
+
+#define RID_SVXIMG_GRAF_RED (RID_SVX_START + 472)
+#define RID_SVXIMG_GRAF_GREEN (RID_SVX_START + 473)
+#define RID_SVXIMG_GRAF_BLUE (RID_SVX_START + 474)
+#define RID_SVXIMG_GRAF_LUMINANCE (RID_SVX_START + 475)
+#define RID_SVXIMG_GRAF_CONTRAST (RID_SVX_START + 476)
+#define RID_SVXIMG_GRAF_GAMMA (RID_SVX_START + 477)
+#define RID_SVXIMG_GRAF_TRANSPARENCE (RID_SVX_START + 478)
+
+#define RID_SVX_RELOAD_NORMAL (RID_SVX_START + 480)
+#define RID_SVX_RELOAD_SPECIAL (RID_SVX_START + 481)
+
+// Defines for the 3D engine
+#define RID_SVX_3D_UNDO_EXCHANGE_PASTE (RID_SVX_START + 489)
+#define RID_SVX_3D_CREATE_LATHE (RID_SVX_START + 490)
+#define RID_SVX_3D_UNDO_SEGMENTS (RID_SVX_START + 491)
+#define RID_SVX_3D_UNDO_DEEPTH (RID_SVX_START + 492)
+#define RID_SVX_3D_UNDO_FOCAL (RID_SVX_START + 493)
+#define RID_SVX_3D_UNDO_CAMPOS (RID_SVX_START + 494)
+#define RID_SVX_3D_UNDO_ROTATE (RID_SVX_START + 495)
+#define RID_SVX_3D_UNDO_EXTRUDE (RID_SVX_START + 496)
+#define RID_SVX_3D_UNDO_LATHE (RID_SVX_START + 497)
+#define RID_SVX_3D_UNDO_BREAK_LATHE (RID_SVX_START + 498)
+#define RID_SVX_3D_UNDO_ATTRIBUTES (RID_SVX_START + 499)
+
+// ResIds for graphics drawmode
+#define RID_SVXSTR_GRAFMODE_STANDARD (RID_SVX_START + 520)
+#define RID_SVXSTR_GRAFMODE_GREYS (RID_SVX_START + 521)
+#define RID_SVXSTR_GRAFMODE_MONO (RID_SVX_START + 522)
+#define RID_SVXSTR_GRAFMODE_WATERMARK (RID_SVX_START + 523)
+
+
+// Strings for Plugin-Filedialog
+#define STR_INSERT_VIDEO_EXTFILTER_IVF (RID_SVX_START + 524)
+#define STR_INSERT_VIDEO_EXTFILTER_AVI (RID_SVX_START + 525)
+#define STR_INSERT_VIDEO_EXTFILTER_MOV (RID_SVX_START + 526)
+#define STR_INSERT_VIDEO_EXTFILTER_MPEG (RID_SVX_START + 527)
+#define STR_EXTFILTER_ALL (RID_SVX_START + 528)
+#define STR_INSERT_SOUND_TITLE (RID_SVX_START + 529)
+#define STR_INSERT_VIDEO_TITLE (RID_SVX_START + 530)
+
+#define RID_SVXSTR_BACKGROUND (RID_SVX_START + 531)
+
+// BM: some additional standard colors
+#define RID_SVXSTR_VIOLET (RID_SVX_START + 540)
+#define RID_SVXSTR_BORDEAUX (RID_SVX_START + 541)
+#define RID_SVXSTR_PALE_YELLOW (RID_SVX_START + 542)
+#define RID_SVXSTR_PALE_GREEN (RID_SVX_START + 543)
+#define RID_SVXSTR_DKVIOLET (RID_SVX_START + 544)
+#define RID_SVXSTR_SALMON (RID_SVX_START + 545)
+#define RID_SVXSTR_SEABLUE (RID_SVX_START + 546)
+#define RID_SVXSTR_COLOR_SUN (RID_SVX_START + 547)
+
+// LibreOffice palette colors
+#define RID_SVXSTR_LIBRE_GREEN_1 (RID_SVX_START + 548)
+#define RID_SVXSTR_LIBRE_GREEN_ACCENT (RID_SVX_START + 549)
+#define RID_SVXSTR_LIBRE_BLUE_ACCENT (RID_SVX_START + 550)
+#define RID_SVXSTR_LIBRE_ORANGE_ACCENT (RID_SVX_START + 551)
+#define RID_SVXSTR_LIBRE_PURPLE (RID_SVX_START + 552)
+#define RID_SVXSTR_LIBRE_PURPLE_ACCENT (RID_SVX_START + 553)
+#define RID_SVXSTR_LIBRE_YELLOW_ACCENT (RID_SVX_START + 554)
+
+// JP: string resource ids for table-autoformat-names, used in SW/SC
+// !!! Urgent: the order of Ids is persistent. New Ids have to append !!!
+#define RID_SVXSTR_TBLAFMT_BEGIN (RID_SVX_START + 560)
+#define RID_SVXSTR_TBLAFMT_3D RID_SVXSTR_TBLAFMT_BEGIN
+#define RID_SVXSTR_TBLAFMT_BLACK1 (RID_SVX_START + 561)
+#define RID_SVXSTR_TBLAFMT_BLACK2 (RID_SVX_START + 562)
+#define RID_SVXSTR_TBLAFMT_BLUE (RID_SVX_START + 563)
+#define RID_SVXSTR_TBLAFMT_BROWN (RID_SVX_START + 564)
+#define RID_SVXSTR_TBLAFMT_CURRENCY (RID_SVX_START + 565)
+#define RID_SVXSTR_TBLAFMT_CURRENCY_3D (RID_SVX_START + 566)
+#define RID_SVXSTR_TBLAFMT_CURRENCY_GRAY (RID_SVX_START + 567)
+#define RID_SVXSTR_TBLAFMT_CURRENCY_LAVENDER (RID_SVX_START + 568)
+#define RID_SVXSTR_TBLAFMT_CURRENCY_TURQUOISE (RID_SVX_START + 569)
+#define RID_SVXSTR_TBLAFMT_GRAY (RID_SVX_START + 570)
+#define RID_SVXSTR_TBLAFMT_GREEN (RID_SVX_START + 571)
+#define RID_SVXSTR_TBLAFMT_LAVENDER (RID_SVX_START + 572)
+#define RID_SVXSTR_TBLAFMT_RED (RID_SVX_START + 573)
+#define RID_SVXSTR_TBLAFMT_TURQUOISE (RID_SVX_START + 574)
+#define RID_SVXSTR_TBLAFMT_YELLOW (RID_SVX_START + 575)
+#define RID_SVXSTR_TBLAFMT_END (RID_SVX_START + 576)
+
+// string resources for XLineCap item
+#define RID_SVXSTR_LINECAP_BUTT (RID_SVX_START + 586 )
+#define RID_SVXSTR_LINECAP_ROUND (RID_SVX_START + 587 )
+#define RID_SVXSTR_LINECAP_SQUARE (RID_SVX_START + 588 )
+
+// string resources for XLineJoint item
+#define RID_SVXSTR_LINEJOINT_NONE RID_SVXSTR_NONE
+#define RID_SVXSTR_LINEJOINT_MIDDLE (RID_SVX_START + 589 )
+#define RID_SVXSTR_LINEJOINT_BEVEL (RID_SVX_START + 590 )
+#define RID_SVXSTR_LINEJOINT_MITER (RID_SVX_START + 591 )
+#define RID_SVXSTR_LINEJOINT_ROUND (RID_SVX_START + 592 )
+
+// Default-Color-Names
+#define RID_SVXSTR_BLACK_DEF (RID_SVX_START + 595)
+#define RID_SVXSTR_BLUE_DEF (RID_SVX_START + 596)
+#define RID_SVXSTR_GREEN_DEF (RID_SVX_START + 597)
+#define RID_SVXSTR_CYAN_DEF (RID_SVX_START + 598)
+#define RID_SVXSTR_RED_DEF (RID_SVX_START + 599)
+#define RID_SVXSTR_MAGENTA_DEF (RID_SVX_START + 600)
+#define RID_SVXSTR_BROWN_DEF (RID_SVX_START + 601)
+#define RID_SVXSTR_GREY_DEF (RID_SVX_START + 602)
+#define RID_SVXSTR_LIGHTGREY_DEF (RID_SVX_START + 603)
+#define RID_SVXSTR_LIGHTBLUE_DEF (RID_SVX_START + 604)
+#define RID_SVXSTR_LIGHTGREEN_DEF (RID_SVX_START + 605)
+#define RID_SVXSTR_LIGHTCYAN_DEF (RID_SVX_START + 606)
+#define RID_SVXSTR_LIGHTRED_DEF (RID_SVX_START + 607)
+#define RID_SVXSTR_LIGHTMAGENTA_DEF (RID_SVX_START + 608)
+#define RID_SVXSTR_YELLOW_DEF (RID_SVX_START + 609)
+#define RID_SVXSTR_WHITE_DEF (RID_SVX_START + 610)
+#define RID_SVXSTR_BLUEGREY_DEF (RID_SVX_START + 611)
+#define RID_SVXSTR_ORANGE_DEF (RID_SVX_START + 612)
+#define RID_SVXSTR_VIOLET_DEF (RID_SVX_START + 613)
+#define RID_SVXSTR_BORDEAUX_DEF (RID_SVX_START + 614)
+#define RID_SVXSTR_PALE_YELLOW_DEF (RID_SVX_START + 615)
+#define RID_SVXSTR_PALE_GREEN_DEF (RID_SVX_START + 616)
+#define RID_SVXSTR_DKVIOLET_DEF (RID_SVX_START + 617)
+#define RID_SVXSTR_SALMON_DEF (RID_SVX_START + 618)
+#define RID_SVXSTR_SEABLUE_DEF (RID_SVX_START + 619)
+#define RID_SVXSTR_COLOR_SUN_DEF (RID_SVX_START + 620)
+#define RID_SVXSTR_COLOR_CHART (RID_SVX_START + 621)
+#define RID_SVXSTR_COLOR_CHART_DEF (RID_SVX_START + 622)
+// LibreOffice palette colors
+#define RID_SVXSTR_LIBRE_GREEN_1_DEF (RID_SVX_START + 623)
+#define RID_SVXSTR_LIBRE_GREEN_ACCENT_DEF (RID_SVX_START + 624)
+#define RID_SVXSTR_LIBRE_BLUE_ACCENT_DEF (RID_SVX_START + 625)
+#define RID_SVXSTR_LIBRE_ORANGE_ACCENT_DEF (RID_SVX_START + 626)
+#define RID_SVXSTR_LIBRE_PURPLE_DEF (RID_SVX_START + 627)
+#define RID_SVXSTR_LIBRE_PURPLE_ACCENT_DEF (RID_SVX_START + 628)
+#define RID_SVXSTR_LIBRE_YELLOW_ACCENT_DEF (RID_SVX_START + 629)
+
+// Tango palette colors
+#define RID_SVXSTR_TANGO_BUTTER (RID_SVX_START + 630)
+#define RID_SVXSTR_TANGO_ORANGE (RID_SVX_START + 631)
+#define RID_SVXSTR_TANGO_CHOCOLATE (RID_SVX_START + 632)
+#define RID_SVXSTR_TANGO_CHAMELEON (RID_SVX_START + 633)
+#define RID_SVXSTR_TANGO_SKY_BLUE (RID_SVX_START + 634)
+#define RID_SVXSTR_TANGO_PLUM (RID_SVX_START + 635)
+#define RID_SVXSTR_TANGO_SCARLET_RED (RID_SVX_START + 636)
+#define RID_SVXSTR_TANGO_ALUMINIUM (RID_SVX_START + 637)
+#define RID_SVXSTR_TANGO_BUTTER_DEF (RID_SVX_START + 638)
+#define RID_SVXSTR_TANGO_ORANGE_DEF (RID_SVX_START + 639)
+#define RID_SVXSTR_TANGO_CHOCOLATE_DEF (RID_SVX_START + 640)
+#define RID_SVXSTR_TANGO_CHAMELEON_DEF (RID_SVX_START + 641)
+#define RID_SVXSTR_TANGO_SKY_BLUE_DEF (RID_SVX_START + 642)
+#define RID_SVXSTR_TANGO_PLUM_DEF (RID_SVX_START + 643)
+#define RID_SVXSTR_TANGO_SCARLET_RED_DEF (RID_SVX_START + 644)
+#define RID_SVXSTR_TANGO_ALUMINIUM_DEF (RID_SVX_START + 645)
+
+// Default-Gradient-Names
+#define RID_SVXSTR_GRDT0_DEF (RID_SVX_START + 2000)
+#define RID_SVXSTR_GRDT1_DEF (RID_SVX_START + 2001)
+#define RID_SVXSTR_GRDT2_DEF (RID_SVX_START + 2002)
+#define RID_SVXSTR_GRDT3_DEF (RID_SVX_START + 2003)
+#define RID_SVXSTR_GRDT4_DEF (RID_SVX_START + 2004)
+#define RID_SVXSTR_GRDT5_DEF (RID_SVX_START + 2005)
+#define RID_SVXSTR_GRDT6_DEF (RID_SVX_START + 2006)
+#define RID_SVXSTR_GRDT7_DEF (RID_SVX_START + 2007)
+#define RID_SVXSTR_GRDT8_DEF (RID_SVX_START + 2008)
+#define RID_SVXSTR_GRDT9_DEF (RID_SVX_START + 2009)
+#define RID_SVXSTR_GRDT10_DEF (RID_SVX_START + 2010)
+#define RID_SVXSTR_GRDT11_DEF (RID_SVX_START + 2011)
+#define RID_SVXSTR_GRDT12_DEF (RID_SVX_START + 2012)
+#define RID_SVXSTR_GRDT13_DEF (RID_SVX_START + 2013)
+#define RID_SVXSTR_GRDT14_DEF (RID_SVX_START + 2014)
+#define RID_SVXSTR_GRDT15_DEF (RID_SVX_START + 2015)
+#define RID_SVXSTR_GRDT16_DEF (RID_SVX_START + 2016)
+#define RID_SVXSTR_GRDT17_DEF (RID_SVX_START + 2017)
+#define RID_SVXSTR_GRDT18_DEF (RID_SVX_START + 2018)
+#define RID_SVXSTR_GRDT19_DEF (RID_SVX_START + 2019)
+#define RID_SVXSTR_GRDT20_DEF (RID_SVX_START + 2020)
+#define RID_SVXSTR_GRDT21_DEF (RID_SVX_START + 2021)
+#define RID_SVXSTR_GRDT22_DEF (RID_SVX_START + 2022)
+#define RID_SVXSTR_GRDT23_DEF (RID_SVX_START + 2023)
+#define RID_SVXSTR_GRDT24_DEF (RID_SVX_START + 2024)
+#define RID_SVXSTR_GRDT25_DEF (RID_SVX_START + 2025)
+#define RID_SVXSTR_GRDT26_DEF (RID_SVX_START + 2026)
+#define RID_SVXSTR_GRDT27_DEF (RID_SVX_START + 2027)
+#define RID_SVXSTR_GRDT28_DEF (RID_SVX_START + 2028)
+#define RID_SVXSTR_GRDT29_DEF (RID_SVX_START + 2029)
+#define RID_SVXSTR_GRDT30_DEF (RID_SVX_START + 2030)
+#define RID_SVXSTR_GRDT31_DEF (RID_SVX_START + 2031)
+#define RID_SVXSTR_GRDT32_DEF (RID_SVX_START + 2032)
+#define RID_SVXSTR_GRDT33_DEF (RID_SVX_START + 2033)
+#define RID_SVXSTR_GRDT34_DEF (RID_SVX_START + 2034)
+#define RID_SVXSTR_GRDT35_DEF (RID_SVX_START + 2035)
+#define RID_SVXSTR_GRDT36_DEF (RID_SVX_START + 2036)
+#define RID_SVXSTR_GRDT37_DEF (RID_SVX_START + 2037)
+#define RID_SVXSTR_GRDT38_DEF (RID_SVX_START + 2038)
+#define RID_SVXSTR_GRDT39_DEF (RID_SVX_START + 2039)
+#define RID_SVXSTR_GRDT40_DEF (RID_SVX_START + 2040)
+#define RID_SVXSTR_GRDT41_DEF (RID_SVX_START + 2041)
+#define RID_SVXSTR_GRDT42_DEF (RID_SVX_START + 2042)
+#define RID_SVXSTR_GRDT43_DEF (RID_SVX_START + 2043)
+#define RID_SVXSTR_GRDT44_DEF (RID_SVX_START + 2044)
+#define RID_SVXSTR_GRDT45_DEF (RID_SVX_START + 2045)
+#define RID_SVXSTR_GRDT46_DEF (RID_SVX_START + 2046)
+#define RID_SVXSTR_GRDT47_DEF (RID_SVX_START + 2047)
+#define RID_SVXSTR_GRDT48_DEF (RID_SVX_START + 2048)
+#define RID_SVXSTR_GRDT49_DEF (RID_SVX_START + 2049)
+#define RID_SVXSTR_GRDT50_DEF (RID_SVX_START + 2050)
+#define RID_SVXSTR_GRDT51_DEF (RID_SVX_START + 2051)
+#define RID_SVXSTR_GRDT52_DEF (RID_SVX_START + 2052)
+#define RID_SVXSTR_GRDT53_DEF (RID_SVX_START + 2053)
+#define RID_SVXSTR_GRDT54_DEF (RID_SVX_START + 2054)
+#define RID_SVXSTR_GRDT55_DEF (RID_SVX_START + 2055)
+#define RID_SVXSTR_GRDT56_DEF (RID_SVX_START + 2056)
+#define RID_SVXSTR_GRDT57_DEF (RID_SVX_START + 2057)
+#define RID_SVXSTR_GRDT58_DEF (RID_SVX_START + 2058)
+#define RID_SVXSTR_GRDT0 (RID_SVX_START + 2060)
+#define RID_SVXSTR_GRDT1 (RID_SVX_START + 2061)
+#define RID_SVXSTR_GRDT2 (RID_SVX_START + 2062)
+#define RID_SVXSTR_GRDT3 (RID_SVX_START + 2063)
+#define RID_SVXSTR_GRDT4 (RID_SVX_START + 2064)
+#define RID_SVXSTR_GRDT5 (RID_SVX_START + 2065)
+#define RID_SVXSTR_GRDT6 (RID_SVX_START + 2066)
+#define RID_SVXSTR_GRDT7 (RID_SVX_START + 2067)
+#define RID_SVXSTR_GRDT8 (RID_SVX_START + 2068)
+#define RID_SVXSTR_GRDT9 (RID_SVX_START + 2069)
+#define RID_SVXSTR_GRDT10 (RID_SVX_START + 2070)
+#define RID_SVXSTR_GRDT11 (RID_SVX_START + 2071)
+#define RID_SVXSTR_GRDT12 (RID_SVX_START + 2072)
+#define RID_SVXSTR_GRDT13 (RID_SVX_START + 2073)
+#define RID_SVXSTR_GRDT14 (RID_SVX_START + 2074)
+#define RID_SVXSTR_GRDT15 (RID_SVX_START + 2075)
+#define RID_SVXSTR_GRDT16 (RID_SVX_START + 2076)
+#define RID_SVXSTR_GRDT17 (RID_SVX_START + 2077)
+#define RID_SVXSTR_GRDT18 (RID_SVX_START + 2078)
+#define RID_SVXSTR_GRDT19 (RID_SVX_START + 2079)
+#define RID_SVXSTR_GRDT20 (RID_SVX_START + 2080)
+#define RID_SVXSTR_GRDT21 (RID_SVX_START + 2081)
+#define RID_SVXSTR_GRDT22 (RID_SVX_START + 2082)
+#define RID_SVXSTR_GRDT23 (RID_SVX_START + 2083)
+#define RID_SVXSTR_GRDT24 (RID_SVX_START + 2084)
+#define RID_SVXSTR_GRDT25 (RID_SVX_START + 2085)
+#define RID_SVXSTR_GRDT26 (RID_SVX_START + 2086)
+#define RID_SVXSTR_GRDT27 (RID_SVX_START + 2087)
+#define RID_SVXSTR_GRDT28 (RID_SVX_START + 2088)
+#define RID_SVXSTR_GRDT29 (RID_SVX_START + 2089)
+#define RID_SVXSTR_GRDT30 (RID_SVX_START + 2090)
+#define RID_SVXSTR_GRDT31 (RID_SVX_START + 2091)
+#define RID_SVXSTR_GRDT32 (RID_SVX_START + 2092)
+#define RID_SVXSTR_GRDT33 (RID_SVX_START + 2093)
+#define RID_SVXSTR_GRDT34 (RID_SVX_START + 2094)
+#define RID_SVXSTR_GRDT35 (RID_SVX_START + 2095)
+#define RID_SVXSTR_GRDT36 (RID_SVX_START + 2096)
+#define RID_SVXSTR_GRDT37 (RID_SVX_START + 2097)
+#define RID_SVXSTR_GRDT38 (RID_SVX_START + 2098)
+#define RID_SVXSTR_GRDT39 (RID_SVX_START + 2099)
+#define RID_SVXSTR_GRDT40 (RID_SVX_START + 2100)
+#define RID_SVXSTR_GRDT41 (RID_SVX_START + 2101)
+#define RID_SVXSTR_GRDT42 (RID_SVX_START + 2102)
+#define RID_SVXSTR_GRDT43 (RID_SVX_START + 2103)
+#define RID_SVXSTR_GRDT44 (RID_SVX_START + 2104)
+#define RID_SVXSTR_GRDT45 (RID_SVX_START + 2105)
+#define RID_SVXSTR_GRDT46 (RID_SVX_START + 2106)
+#define RID_SVXSTR_GRDT47 (RID_SVX_START + 2107)
+#define RID_SVXSTR_GRDT48 (RID_SVX_START + 2108)
+#define RID_SVXSTR_GRDT49 (RID_SVX_START + 2109)
+#define RID_SVXSTR_GRDT50 (RID_SVX_START + 2110)
+#define RID_SVXSTR_GRDT51 (RID_SVX_START + 2111)
+#define RID_SVXSTR_GRDT52 (RID_SVX_START + 2112)
+#define RID_SVXSTR_GRDT53 (RID_SVX_START + 2113)
+#define RID_SVXSTR_GRDT54 (RID_SVX_START + 2114)
+#define RID_SVXSTR_GRDT55 (RID_SVX_START + 2115)
+#define RID_SVXSTR_GRDT56 (RID_SVX_START + 2116)
+#define RID_SVXSTR_GRDT57 (RID_SVX_START + 2117)
+#define RID_SVXSTR_GRDT58 (RID_SVX_START + 2118)
+#define RID_SVXSTR_GRDT_DEF_START RID_SVXSTR_GRDT0_DEF
+#define RID_SVXSTR_GRDT_DEF_END RID_SVXSTR_GRDT58_DEF
+#define RID_SVXSTR_GRDT_START RID_SVXSTR_GRDT0
+// RID_SVXSTR_GRDT_END RID_SVXSTR_GRDT58
+
+// Default-Hatch-Names
+#define RID_SVXSTR_HATCH0_DEF (RID_SVX_START + 661)
+#define RID_SVXSTR_HATCH1_DEF (RID_SVX_START + 662)
+#define RID_SVXSTR_HATCH2_DEF (RID_SVX_START + 663)
+#define RID_SVXSTR_HATCH3_DEF (RID_SVX_START + 664)
+#define RID_SVXSTR_HATCH4_DEF (RID_SVX_START + 665)
+#define RID_SVXSTR_HATCH5_DEF (RID_SVX_START + 666)
+#define RID_SVXSTR_HATCH6_DEF (RID_SVX_START + 667)
+#define RID_SVXSTR_HATCH7_DEF (RID_SVX_START + 668)
+#define RID_SVXSTR_HATCH8_DEF (RID_SVX_START + 669)
+#define RID_SVXSTR_HATCH9_DEF (RID_SVX_START + 670)
+#define RID_SVXSTR_HATCH10_DEF (RID_SVX_START + 671)
+#define RID_SVXSTR_HATCH0 (RID_SVX_START + 672)
+#define RID_SVXSTR_HATCH1 (RID_SVX_START + 673)
+#define RID_SVXSTR_HATCH2 (RID_SVX_START + 674)
+#define RID_SVXSTR_HATCH3 (RID_SVX_START + 675)
+#define RID_SVXSTR_HATCH4 (RID_SVX_START + 676)
+#define RID_SVXSTR_HATCH5 (RID_SVX_START + 677)
+#define RID_SVXSTR_HATCH6 (RID_SVX_START + 678)
+#define RID_SVXSTR_HATCH7 (RID_SVX_START + 679)
+#define RID_SVXSTR_HATCH8 (RID_SVX_START + 680)
+#define RID_SVXSTR_HATCH9 (RID_SVX_START + 681)
+#define RID_SVXSTR_HATCH10 (RID_SVX_START + 682)
+#define RID_SVXSTR_HATCH_DEF_START RID_SVXSTR_HATCH0_DEF
+#define RID_SVXSTR_HATCH_DEF_END RID_SVXSTR_HATCH10_DEF
+#define RID_SVXSTR_HATCH_START RID_SVXSTR_HATCH0
+// RID_SVXSTR_HATCH_END RID_SVXSTR_HATCH10
+
+// Default-Bitmap-Names
+#define RID_SVXSTR_BMP0_DEF (RID_SVX_START + 691)
+#define RID_SVXSTR_BMP1_DEF (RID_SVX_START + 692)
+#define RID_SVXSTR_BMP2_DEF (RID_SVX_START + 693)
+#define RID_SVXSTR_BMP3_DEF (RID_SVX_START + 694)
+#define RID_SVXSTR_BMP4_DEF (RID_SVX_START + 695)
+#define RID_SVXSTR_BMP5_DEF (RID_SVX_START + 696)
+#define RID_SVXSTR_BMP6_DEF (RID_SVX_START + 697)
+#define RID_SVXSTR_BMP7_DEF (RID_SVX_START + 698)
+#define RID_SVXSTR_BMP8_DEF (RID_SVX_START + 699)
+#define RID_SVXSTR_BMP9_DEF (RID_SVX_START + 700)
+#define RID_SVXSTR_BMP10_DEF (RID_SVX_START + 701)
+#define RID_SVXSTR_BMP11_DEF (RID_SVX_START + 702)
+#define RID_SVXSTR_BMP12_DEF (RID_SVX_START + 703)
+#define RID_SVXSTR_BMP13_DEF (RID_SVX_START + 704)
+#define RID_SVXSTR_BMP14_DEF (RID_SVX_START + 705)
+#define RID_SVXSTR_BMP15_DEF (RID_SVX_START + 706)
+#define RID_SVXSTR_BMP16_DEF (RID_SVX_START + 707)
+#define RID_SVXSTR_BMP17_DEF (RID_SVX_START + 708)
+#define RID_SVXSTR_BMP18_DEF (RID_SVX_START + 709)
+#define RID_SVXSTR_BMP19_DEF (RID_SVX_START + 710)
+#define RID_SVXSTR_BMP20_DEF (RID_SVX_START + 711)
+#define RID_SVXSTR_BMP21_DEF (RID_SVX_START + 712)
+#define RID_SVXSTR_BMP0 (RID_SVX_START + 713)
+#define RID_SVXSTR_BMP1 (RID_SVX_START + 714)
+#define RID_SVXSTR_BMP2 (RID_SVX_START + 715)
+#define RID_SVXSTR_BMP3 (RID_SVX_START + 716)
+#define RID_SVXSTR_BMP4 (RID_SVX_START + 717)
+#define RID_SVXSTR_BMP5 (RID_SVX_START + 718)
+#define RID_SVXSTR_BMP6 (RID_SVX_START + 719)
+#define RID_SVXSTR_BMP7 (RID_SVX_START + 720)
+#define RID_SVXSTR_BMP8 (RID_SVX_START + 721)
+#define RID_SVXSTR_BMP9 (RID_SVX_START + 722)
+#define RID_SVXSTR_BMP10 (RID_SVX_START + 723)
+#define RID_SVXSTR_BMP11 (RID_SVX_START + 724)
+#define RID_SVXSTR_BMP12 (RID_SVX_START + 725)
+#define RID_SVXSTR_BMP13 (RID_SVX_START + 726)
+#define RID_SVXSTR_BMP14 (RID_SVX_START + 727)
+#define RID_SVXSTR_BMP15 (RID_SVX_START + 728)
+#define RID_SVXSTR_BMP16 (RID_SVX_START + 729)
+#define RID_SVXSTR_BMP17 (RID_SVX_START + 730)
+#define RID_SVXSTR_BMP18 (RID_SVX_START + 731)
+#define RID_SVXSTR_BMP19 (RID_SVX_START + 732)
+#define RID_SVXSTR_BMP20 (RID_SVX_START + 733)
+#define RID_SVXSTR_BMP21 (RID_SVX_START + 734)
+#define RID_SVXSTR_BMP_DEF_START RID_SVXSTR_BMP0_DEF
+#define RID_SVXSTR_BMP_DEF_END RID_SVXSTR_BMP21_DEF
+#define RID_SVXSTR_BMP_START RID_SVXSTR_BMP0
+// RID_SVXSTR_BMP_END RID_SVXSTR_BMP21
+
+// Default-Linestyle-Names
+#define RID_SVXSTR_DASH0_DEF (RID_SVX_START + 740)
+#define RID_SVXSTR_DASH1_DEF (RID_SVX_START + 741)
+#define RID_SVXSTR_DASH2_DEF (RID_SVX_START + 742)
+#define RID_SVXSTR_DASH3_DEF (RID_SVX_START + 743)
+#define RID_SVXSTR_DASH4_DEF (RID_SVX_START + 744)
+#define RID_SVXSTR_DASH5_DEF (RID_SVX_START + 745)
+#define RID_SVXSTR_DASH6_DEF (RID_SVX_START + 746)
+#define RID_SVXSTR_DASH7_DEF (RID_SVX_START + 747)
+#define RID_SVXSTR_DASH8_DEF (RID_SVX_START + 748)
+#define RID_SVXSTR_DASH9_DEF (RID_SVX_START + 749)
+#define RID_SVXSTR_DASH10_DEF (RID_SVX_START + 750)
+#define RID_SVXSTR_DASH11_DEF (RID_SVX_START + 751)
+#define RID_SVXSTR_DASH12_DEF (RID_SVX_START + 752)
+#define RID_SVXSTR_DASH0 (RID_SVX_START + 753)
+#define RID_SVXSTR_DASH1 (RID_SVX_START + 754)
+#define RID_SVXSTR_DASH2 (RID_SVX_START + 755)
+#define RID_SVXSTR_DASH3 (RID_SVX_START + 756)
+#define RID_SVXSTR_DASH4 (RID_SVX_START + 757)
+#define RID_SVXSTR_DASH5 (RID_SVX_START + 758)
+#define RID_SVXSTR_DASH6 (RID_SVX_START + 759)
+#define RID_SVXSTR_DASH7 (RID_SVX_START + 760)
+#define RID_SVXSTR_DASH8 (RID_SVX_START + 761)
+#define RID_SVXSTR_DASH9 (RID_SVX_START + 762)
+#define RID_SVXSTR_DASH10 (RID_SVX_START + 763)
+#define RID_SVXSTR_DASH11 (RID_SVX_START + 764)
+#define RID_SVXSTR_DASH12 (RID_SVX_START + 765)
+#define RID_SVXSTR_DASH_DEF_START RID_SVXSTR_DASH0_DEF
+#define RID_SVXSTR_DASH_DEF_END RID_SVXSTR_DASH12_DEF
+#define RID_SVXSTR_DASH_START RID_SVXSTR_DASH0
+// RID_SVXSTR_DASH_END RID_SVXSTR_DASH12
+
+// Default-Line-End-Names
+// Shifted numbers. Old value range from +770 to +795 is unused now
+#define RID_SVXSTR_LEND0_DEF (RID_SVX_START + 2770)
+#define RID_SVXSTR_LEND1_DEF (RID_SVX_START + 2771)
+#define RID_SVXSTR_LEND2_DEF (RID_SVX_START + 2772)
+#define RID_SVXSTR_LEND3_DEF (RID_SVX_START + 2773)
+#define RID_SVXSTR_LEND4_DEF (RID_SVX_START + 2774)
+#define RID_SVXSTR_LEND5_DEF (RID_SVX_START + 2775)
+#define RID_SVXSTR_LEND6_DEF (RID_SVX_START + 2776)
+#define RID_SVXSTR_LEND7_DEF (RID_SVX_START + 2777)
+#define RID_SVXSTR_LEND8_DEF (RID_SVX_START + 2778)
+#define RID_SVXSTR_LEND9_DEF (RID_SVX_START + 2779)
+#define RID_SVXSTR_LEND10_DEF (RID_SVX_START + 2780)
+#define RID_SVXSTR_LEND11_DEF (RID_SVX_START + 2781)
+#define RID_SVXSTR_LEND12_DEF (RID_SVX_START + 2782)
+#define RID_SVXSTR_LEND13_DEF (RID_SVX_START + 2783)
+#define RID_SVXSTR_LEND14_DEF (RID_SVX_START + 2784)
+#define RID_SVXSTR_LEND15_DEF (RID_SVX_START + 2785)
+#define RID_SVXSTR_LEND16_DEF (RID_SVX_START + 2786)
+#define RID_SVXSTR_LEND17_DEF (RID_SVX_START + 2787)
+#define RID_SVXSTR_LEND18_DEF (RID_SVX_START + 2788)
+#define RID_SVXSTR_LEND19_DEF (RID_SVX_START + 2789)
+#define RID_SVXSTR_LEND20_DEF (RID_SVX_START + 2790)
+#define RID_SVXSTR_LEND0 (RID_SVX_START + 2791)
+#define RID_SVXSTR_LEND1 (RID_SVX_START + 2792)
+#define RID_SVXSTR_LEND2 (RID_SVX_START + 2793)
+#define RID_SVXSTR_LEND3 (RID_SVX_START + 2794)
+#define RID_SVXSTR_LEND4 (RID_SVX_START + 2795)
+#define RID_SVXSTR_LEND5 (RID_SVX_START + 2796)
+#define RID_SVXSTR_LEND6 (RID_SVX_START + 2797)
+#define RID_SVXSTR_LEND7 (RID_SVX_START + 2798)
+#define RID_SVXSTR_LEND8 (RID_SVX_START + 2799)
+#define RID_SVXSTR_LEND9 (RID_SVX_START + 2800)
+#define RID_SVXSTR_LEND10 (RID_SVX_START + 2801)
+#define RID_SVXSTR_LEND11 (RID_SVX_START + 2802)
+#define RID_SVXSTR_LEND12 (RID_SVX_START + 2803)
+#define RID_SVXSTR_LEND13 (RID_SVX_START + 2804)
+#define RID_SVXSTR_LEND14 (RID_SVX_START + 2805)
+#define RID_SVXSTR_LEND15 (RID_SVX_START + 2806)
+#define RID_SVXSTR_LEND16 (RID_SVX_START + 2807)
+#define RID_SVXSTR_LEND17 (RID_SVX_START + 2808)
+#define RID_SVXSTR_LEND18 (RID_SVX_START + 2809)
+#define RID_SVXSTR_LEND19 (RID_SVX_START + 2810)
+#define RID_SVXSTR_LEND20 (RID_SVX_START + 2811)
+#define RID_SVXSTR_LEND_DEF_START RID_SVXSTR_LEND0_DEF
+#define RID_SVXSTR_LEND_DEF_END RID_SVXSTR_LEND20_DEF
+#define RID_SVXSTR_LEND_START RID_SVXSTR_LEND0
+// RID_SVXSTR_LEND_END RID_SVXSTR_LEND20
+
+#define RID_SVXSTR_QRY_PRINT_TITLE (RID_SVX_START + 802)
+#define RID_SVXSTR_QRY_PRINT_MSG (RID_SVX_START + 803)
+#define RID_SVXSTR_QRY_PRINT_ALL (RID_SVX_START + 804)
+#define RID_SVXSTR_QRY_PRINT_SELECTION (RID_SVX_START + 805)
+
+// strings for graphic attributes/undo
+#define RID_SVXSTR_GRAFCROP (RID_SVX_START + 820)
+#define RID_SVXSTR_UNDO_GRAFMODE (RID_SVX_START + 821)
+#define RID_SVXSTR_UNDO_GRAFRED (RID_SVX_START + 822)
+#define RID_SVXSTR_UNDO_GRAFGREEN (RID_SVX_START + 823)
+#define RID_SVXSTR_UNDO_GRAFBLUE (RID_SVX_START + 824)
+#define RID_SVXSTR_UNDO_GRAFLUMINANCE (RID_SVX_START + 825)
+#define RID_SVXSTR_UNDO_GRAFCONTRAST (RID_SVX_START + 826)
+#define RID_SVXSTR_UNDO_GRAFGAMMA (RID_SVX_START + 827)
+#define RID_SVXSTR_UNDO_GRAFTRANSPARENCY (RID_SVX_START + 828)
+#define RID_SVXSTR_UNDO_GRAFCROP (RID_SVXSTR_GRAFCROP)
+
+// listbox control for UNDO and REDO
+#define RID_SVXTBX_UNDO_REDO_CTRL (RID_SVX_START + 845)
+#define RID_SVXSTR_NUM_UNDO_ACTIONS (RID_SVX_START + 846)
+#define RID_SVXSTR_NUM_REDO_ACTIONS (RID_SVX_START + 847)
+#define RID_SVXSTR_NUM_UNDO_ACTION (RID_SVX_START + 848)
+#define RID_SVXSTR_NUM_REDO_ACTION (RID_SVX_START + 849)
+
+// Default-transparence-gradient-names
+#define RID_SVXSTR_TRASNGR0_DEF (RID_SVX_START + 850)
+#define RID_SVXSTR_TRASNGR0 (RID_SVX_START + 851)
+#define RID_SVXSTR_TRASNGR_DEF_START RID_SVXSTR_TRASNGR0_DEF
+#define RID_SVXSTR_TRASNGR_DEF_END RID_SVXSTR_TRASNGR0_DEF
+#define RID_SVXSTR_TRASNGR_START RID_SVXSTR_TRASNGR0
+// RID_SVXSTR_TRASNGR_END RID_SVXSTR_TRASNGR0
+
+#define RID_SVXSTR_BORDER_CONTROL (RID_SVX_START + 852)
+
+// Accessibility strings. The actual string ids are defined in
+// svx/inc/accessibility.hrc, the strings are defined in
+// svx/source/accessibility/accessibility.src
+#define RID_SVXSTR_ACCESSIBILITY_START (RID_SVX_START + 860)
+// RID_SVXSTR_ACCESSIBILITY_END (RID_SVX_START + 950)
+
+#define RID_SVXSTR_EXPORT_GRAPHIC_TITLE (RID_SVX_START + 984)
+
+#define RID_SVXFLOAT_EXTRUSION_DIRECTION (RID_SVX_START + 985)
+
+#define RID_SVX_EXTRUSION_BAR (RID_SVX_START + 986)
+#define RID_SVX_FONTWORK_BAR (RID_SVX_START + 987)
+
+#define RID_SVXFLOAT_EXTRUSION_DEPTH (RID_SVX_START + 988)
+#define RID_SVXFLOAT_EXTRUSION_LIGHTING (RID_SVX_START + 989)
+#define RID_SVXFLOAT_EXTRUSION_SURFACE (RID_SVX_START + 990)
+#define RID_SVXSTR_EXTRUSION_COLOR (RID_SVX_START + 991)
+
+#define RID_SVXSTR_DEPTH_0 (RID_SVX_START + 992)
+#define RID_SVXSTR_DEPTH_1 (RID_SVX_START + 993)
+#define RID_SVXSTR_DEPTH_2 (RID_SVX_START + 994)
+#define RID_SVXSTR_DEPTH_3 (RID_SVX_START + 995)
+#define RID_SVXSTR_DEPTH_4 (RID_SVX_START + 996)
+
+#define RID_SVXSTR_DEPTH_0_INCH (RID_SVX_START + 997)
+#define RID_SVXSTR_DEPTH_1_INCH (RID_SVX_START + 998)
+#define RID_SVXSTR_DEPTH_2_INCH (RID_SVX_START + 999)
+#define RID_SVXSTR_DEPTH_3_INCH (RID_SVX_START + 1000)
+#define RID_SVXSTR_DEPTH_4_INCH (RID_SVX_START + 1001)
+
+#define RID_SVXFLOAT_FONTWORK_ALIGNMENT (RID_SVX_START + 1002)
+#define RID_SVXFLOAT_FONTWORK_CHARSPACING (RID_SVX_START + 1003)
+
+/* #i35426# DR 2004-10-19: (RID_SVX_START+1002) and (RID_SVX_START+1003) are
+ already used for RID_SVXFLOAT_FONTWORK_ALIGNMENT and
+ RID_SVXFLOAT_FONTWORK_CHARSPACING above. But these IDs describe floating
+ windows, and the following IDs are for strings, so this is no conflict. */
+#define RID_SVXSTR_PAGES (RID_SVX_START + 1002)
+
+#define RID_SVXSTR_UNDO_APPLY_FONTWORK_SHAPE (RID_SVX_START + 1118)
+#define RID_SVXSTR_UNDO_APPLY_FONTWORK_SAME_LETTER_HEIGHT (RID_SVX_START + 1119)
+#define RID_SVXSTR_UNDO_APPLY_FONTWORK_ALIGNMENT (RID_SVX_START + 1120)
+#define RID_SVXSTR_UNDO_APPLY_FONTWORK_CHARACTER_SPACING (RID_SVX_START + 1122)
+#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_ON_OFF (RID_SVX_START + 1123)
+#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_DOWN (RID_SVX_START + 1124)
+#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_UP (RID_SVX_START + 1125)
+#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_LEFT (RID_SVX_START + 1126)
+#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_RIGHT (RID_SVX_START + 1127)
+#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_DEPTH (RID_SVX_START + 1128)
+#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_ORIENTATION (RID_SVX_START + 1129)
+#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_PROJECTION (RID_SVX_START + 1130)
+#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_LIGHTING (RID_SVX_START + 1131)
+#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_BRIGHTNESS (RID_SVX_START + 1132)
+#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_SURFACE (RID_SVX_START + 1133)
+#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_COLOR (RID_SVX_START + 1134)
+
+#define RID_SVXSTR_STYLEFAMILY_TABLEDESIGN (RID_SVX_START + 1168)
+ // if you add here, remember to adjust RID_SVXSTR_NEXTFREE
+
+#define RID_SVXSTR_BULLET_DESCRIPTIONS (RID_SVX_START + 1138)//?
+#define RID_SVXSTR_SINGLENUM_DESCRIPTIONS (RID_SVX_START + 1146)//?
+#define RID_SVXSTR_OUTLINENUM_DESCRIPTIONS (RID_SVX_START + 1154)//?
+#define RID_SVXSTR_BULLET_DESCRIPTION_0 (RID_SVXSTR_BULLET_DESCRIPTIONS + 0)//?
+#define RID_SVXSTR_BULLET_DESCRIPTION_1 (RID_SVXSTR_BULLET_DESCRIPTIONS + 1)//?
+#define RID_SVXSTR_BULLET_DESCRIPTION_2 (RID_SVXSTR_BULLET_DESCRIPTIONS + 2)//?
+#define RID_SVXSTR_BULLET_DESCRIPTION_3 (RID_SVXSTR_BULLET_DESCRIPTIONS + 3)//?
+#define RID_SVXSTR_BULLET_DESCRIPTION_4 (RID_SVXSTR_BULLET_DESCRIPTIONS + 4)//?
+#define RID_SVXSTR_BULLET_DESCRIPTION_5 (RID_SVXSTR_BULLET_DESCRIPTIONS + 5)//?
+#define RID_SVXSTR_BULLET_DESCRIPTION_6 (RID_SVXSTR_BULLET_DESCRIPTIONS + 6)//?
+#define RID_SVXSTR_BULLET_DESCRIPTION_7 (RID_SVXSTR_BULLET_DESCRIPTIONS + 7)//?
+#define RID_SVXSTR_SINGLENUM_DESCRIPTION_0 (RID_SVXSTR_SINGLENUM_DESCRIPTIONS + 0)//?
+#define RID_SVXSTR_SINGLENUM_DESCRIPTION_1 (RID_SVXSTR_SINGLENUM_DESCRIPTIONS + 1)//?
+#define RID_SVXSTR_SINGLENUM_DESCRIPTION_2 (RID_SVXSTR_SINGLENUM_DESCRIPTIONS + 2)//?
+#define RID_SVXSTR_SINGLENUM_DESCRIPTION_3 (RID_SVXSTR_SINGLENUM_DESCRIPTIONS + 3)//?
+#define RID_SVXSTR_SINGLENUM_DESCRIPTION_4 (RID_SVXSTR_SINGLENUM_DESCRIPTIONS + 4)//?
+#define RID_SVXSTR_SINGLENUM_DESCRIPTION_5 (RID_SVXSTR_SINGLENUM_DESCRIPTIONS + 5)//?
+#define RID_SVXSTR_SINGLENUM_DESCRIPTION_6 (RID_SVXSTR_SINGLENUM_DESCRIPTIONS + 6)//?
+#define RID_SVXSTR_SINGLENUM_DESCRIPTION_7 (RID_SVXSTR_SINGLENUM_DESCRIPTIONS + 7)//?
+#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_0 (RID_SVXSTR_OUTLINENUM_DESCRIPTIONS + 0)//?
+#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_1 (RID_SVXSTR_OUTLINENUM_DESCRIPTIONS + 1)//?
+#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_2 (RID_SVXSTR_OUTLINENUM_DESCRIPTIONS + 2)//?
+#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_3 (RID_SVXSTR_OUTLINENUM_DESCRIPTIONS + 3)//?
+#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_4 (RID_SVXSTR_OUTLINENUM_DESCRIPTIONS + 4)//?
+#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_5 (RID_SVXSTR_OUTLINENUM_DESCRIPTIONS + 5)//?
+#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_6 (RID_SVXSTR_OUTLINENUM_DESCRIPTIONS + 6)//?
+#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_7 (RID_SVXSTR_OUTLINENUM_DESCRIPTIONS + 7)//?
+
+#define RID_SVXSTR_FINDBAR_FIND (RID_SVX_START + 1190)
+
+#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1191)
+
+#define RID_SVXSTR_TEXTCOLOR (RID_SVX_START + 1178)
+// ----------------------------------------------------------------------------
+// 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 gloablly (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
+
+// ----------------------------------------------------------------------------
+// "Window" resource ids
+
+
+// ----------------------------------------------------------------------------
+// "ModalDialog" resource ids
+
+#define RID_SVX_MDLG_FONTWORK_GALLERY ( RID_SVX_START + 2 )
+#define RID_SVX_MDLG_EXTRUSION_DEPTH ( RID_SVX_START + 3 )
+
+// ----------------------------------------------------------------------------
+// "Menu" resource ids
+#define RID_SVX_MDLG_FONTWORK_CHARSPACING ( RID_SVX_START + 19 )
+
+// document recovery and error report
+// recycling ids from DBMgr
+#define RID_SVX_MDLG_DOCRECOVERY_PROGR ( RID_SVX_START + 11 )
+#define RID_SVX_MDLG_DOCRECOVERY_BROKEN ( RID_SVX_START + 12 )
+#define RID_SVX_MDLG_ERR_REP_OPTIONS ( RID_SVX_START + 13 )
+#define RID_SVX_MDLG_ERR_REP_PREVIEW ( RID_SVX_START + 14 )
+
+#define RID_SVX_TABDLG_DOCRECOVERY ( RID_SVX_START + 0 )
+
+#define RID_SVXPAGE_DOCRECOVERY_SAVE ( RID_SVX_START + 8 )
+#define RID_SVXPAGE_DOCRECOVERY_RECOVER ( RID_SVX_START + 9 )
+#define RID_SVXPAGE_ERR_REP_WELCOME ( RID_SVX_START + 10 )
+#define RID_SVXPAGE_ERR_REP_SEND ( RID_SVX_START + 11 )
+
+// ----------------------------------------------------------------------------
+
+// !!!! double defined ID's (see below) !!!
+#define RID_OFA_AUTOCORR_DLG (RID_OFA_START + 101)
+
+#define RID_OFA_GENERAL_OPTIONS_DLG (RID_OFA_START + 105)
+#define RID_OFADLG_INTERNET (RID_OFA_START + 106)
+#define RID_OFA_TABNEW_DLG (RID_OFA_START + 107)
+#define RID_OFADLG_BROWSER (RID_OFA_START + 108)
+#define RID_OFA_FORMNEW_DLG (RID_OFA_START + 112)
+#define RID_OFA_TABPROPERTIES (RID_OFA_START + 113)
+#define RID_OFADLG_REGISTRATION (RID_OFA_START + 114)
+#define RID_OFADLG_AWCP_VALUES (RID_OFA_START + 117)
+
+// TabPages --------------------------------------------------------------
+
+// !!!! double defined ID's (see above) !!!
+
+#define OFA_TP_APPEARANCE (RID_OFA_START + 203)
+#define OFA_TP_TABPROPERTIES_GENERAL (RID_OFA_START + 204)
+
+//the RID_??_TP_* are duplicate in offids.hrc
+
+#define RID_SW_TP_LAYOUT_OPT (RID_OFA_START + 207)
+#define RID_SW_TP_OPTINSERT_PAGE (RID_OFA_START + 213)
+#define RID_SW_TP_OPTTEST_PAGE (RID_OFA_START + 215)
+#define RID_SW_TP_OPTSRCVIEW (RID_OFA_START + 216)
+#define RID_SW_TP_OPTINSERT_HTML_PAGE (RID_OFA_START + 238)
+#define RID_SW_TP_HTML_LAYOUT_OPT (RID_OFA_START + 241)
+#define SID_SD_TP_LAYOUT (RID_OFA_START + 226)
+#define SID_SD_TP_SCALE (RID_OFA_START + 228)
+#define SID_SD_TP_GRID (RID_OFA_START + 229)
+#define SID_SI_TP_LAYOUT (RID_OFA_START + 233)
+#define SID_SI_TP_GRID (RID_OFA_START + 235)
+#define SID_SC_TP_MISC (RID_OFA_START + 239)
+#define OFA_TP_TABPROPERTIES_TEXT (RID_OFA_START + 245)
+#define OFA_TP_HELPERPROG (RID_OFA_START + 249)
+#define STR_COLORTABLE (RID_OFA_START + 257)
+#define STR_SWITCH (RID_OFA_START + 258)
+#define SID_SC_TP_FORMULA (RID_OFA_START + 259)
+#define SID_SC_TP_COMPATIBILITY (RID_OFA_START + 260)
+
+// ----------------------------------------------------------------------------
+// ooo-build specific resources
+
+#define SVX_OOO_BUILD_START (RID_SVX_START + 1200)
+
+#define RID_SVXBMP_DOC_MODIFIED_YES (SVX_OOO_BUILD_START + 1)
+#define RID_SVXBMP_DOC_MODIFIED_NO (SVX_OOO_BUILD_START + 2)
+#define RID_SVXBMP_DOC_MODIFIED_FEEDBACK (SVX_OOO_BUILD_START + 3)
+#define RID_SVXSTR_DOC_MODIFIED_YES (SVX_OOO_BUILD_START + 4)
+#define RID_SVXSTR_DOC_MODIFIED_NO (SVX_OOO_BUILD_START + 5)
+#define RID_SVXSTR_DOC_LOAD (SVX_OOO_BUILD_START + 6)
+
+#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 000000000000..cc45a444c99c
--- /dev/null
+++ b/include/svx/dlgctl3d.hxx
@@ -0,0 +1,204 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_DLGCTL3D_HXX
+#define _SVX_DLGCTL3D_HXX
+
+#include <vcl/ctrl.hxx>
+#include <vcl/scrbar.hxx>
+#include <vcl/button.hxx>
+#include <svl/itemset.hxx>
+#include "svx/svxdllapi.h"
+#include <basegfx/vector/b3dvector.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+class FmFormModel;
+class FmFormPage;
+class E3dView;
+class E3dPolyScene;
+class E3dObject;
+
+//////////////////////////////////////////////////////////////////////////////
+
+#define PREVIEW_OBJECTTYPE_SPHERE 0x0000
+#define PREVIEW_OBJECTTYPE_CUBE 0x0001
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC Svx3DPreviewControl : public Control
+{
+protected:
+ FmFormModel* mpModel;
+ FmFormPage* mpFmPage;
+ E3dView* mp3DView;
+ E3dPolyScene* mpScene;
+ E3dObject* mp3DObj;
+ sal_uInt16 mnObjectType;
+
+ void Construct();
+
+public:
+ Svx3DPreviewControl(Window* pParent, const ResId& rResId);
+ Svx3DPreviewControl(Window* pParent, WinBits nStyle = 0);
+ ~Svx3DPreviewControl();
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Resize();
+
+ void Reset();
+ virtual void SetObjectType(sal_uInt16 nType);
+ sal_uInt16 GetObjectType() const { return( mnObjectType ); }
+ SfxItemSet Get3DAttributes() const;
+ virtual void Set3DAttributes(const SfxItemSet& rAttr);
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC Svx3DLightControl : public Svx3DPreviewControl
+{
+ // Callback for interactive changes
+ Link maUserInteractiveChangeCallback;
+ Link maUserSelectionChangeCallback;
+ 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;
+ sal_Int32 mnInteractionStartDistance;
+ double mfSaveActionStartHor;
+ double mfSaveActionStartVer;
+ double mfSaveActionStartRotZ;
+
+ // bitfield
+ unsigned mbMouseMoved : 1;
+ unsigned mbGeometrySelected : 1;
+
+ void Construct2();
+ void ConstructLightObjects();
+ void AdaptToSelectedLight();
+ void TrySelection(Point aPosPixel);
+
+public:
+ Svx3DLightControl(Window* pParent, WinBits nStyle = 0);
+ ~Svx3DLightControl();
+
+ virtual void Paint(const Rectangle& rRect);
+ virtual void MouseButtonDown(const MouseEvent& rMEvt);
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Resize();
+
+ virtual void SetObjectType(sal_uInt16 nType);
+
+ // register user callback
+ void SetUserInteractiveChangeCallback(Link aNew) { maUserInteractiveChangeCallback = aNew; }
+ void SetUserSelectionChangeCallback(Link aNew) { maUserSelectionChangeCallback = aNew; }
+ void SetChangeCallback(Link aNew) { maChangeCallback = aNew; }
+ void SetSelectionChangeCallback(Link aNew) { maSelectionChangeCallback = aNew; }
+
+ // selection checks
+ bool IsSelectionValid();
+ bool IsGeometrySelected() { 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);
+ sal_uInt32 GetSelectedLight() { 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 SVX_DLLPUBLIC SvxLightCtl3D : public Control
+{
+private:
+ // local controls
+ Svx3DLightControl maLightControl;
+ ScrollBar maHorScroller;
+ ScrollBar maVerScroller;
+ PushButton maSwitcher;
+
+ // callback for interactive changes
+ Link maUserInteractiveChangeCallback;
+ Link maUserSelectionChangeCallback;
+
+public:
+ SvxLightCtl3D( Window* pParent, const ResId& rResId);
+ ~SvxLightCtl3D();
+
+ // react to size changes
+ virtual void Resize();
+ void NewLayout();
+
+ // check the selection for validity
+ void CheckSelection();
+
+ // bring further settings to the outside world
+ Svx3DLightControl& GetSvx3DLightControl() { return maLightControl; }
+
+ // register user callback
+ void SetUserInteractiveChangeCallback(Link aNew) { maUserInteractiveChangeCallback = aNew; }
+ void SetUserSelectionChangeCallback(Link aNew) { maUserSelectionChangeCallback = aNew; }
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+protected:
+
+ DECL_LINK( InternalInteractiveChange, void*);
+ DECL_LINK( InternalSelectionChange, void*);
+ DECL_LINK( ScrollBarMove, void*);
+ DECL_LINK( ButtonPress, 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 000000000000..7297bd559bb5
--- /dev/null
+++ b/include/svx/dlgctrl.hxx
@@ -0,0 +1,449 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_DLG_CTRL_HXX
+#define _SVX_DLG_CTRL_HXX
+
+#include <svtools/ctrlbox.hxx>
+#include <sfx2/tabdlg.hxx>
+#include "svx/svxdllapi.h"
+#include <svx/rectenum.hxx>
+#include <vcl/graph.hxx>
+#include <svx/xtable.hxx>
+
+class XOBitmap;
+class XOutdevItemPool;
+
+namespace com { namespace sun { namespace star { namespace awt {
+ struct Point;
+} } } }
+
+/*************************************************************************
+|* Derived from SfxTabPage for being able to get notified through the
+|* virtual method from the control.
+\************************************************************************/
+
+class SvxTabPage : public SfxTabPage
+{
+
+public:
+ SvxTabPage(Window* pParent, ResId Id, const SfxItemSet& rInAttrs)
+ : SfxTabPage(pParent, Id, rInAttrs)
+ {
+ }
+ SvxTabPage(Window *pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet &rAttrSet)
+ : SfxTabPage(pParent, rID, rUIXMLDescription, rAttrSet)
+ {
+ }
+ virtual void PointChanged( Window* pWindow, RECT_POINT eRP ) = 0;
+};
+
+/*************************************************************************
+|* Control for display and selection of the corner and center points of
+|* an object
+\************************************************************************/
+
+typedef sal_uInt16 CTL_STATE;
+#define CS_NOHORZ 1 // no horizontal input information is used
+#define CS_NOVERT 2 // no vertikal input information is used
+
+class SvxRectCtlAccessibleContext;
+
+class SVX_DLLPUBLIC SvxRectCtl : public Control
+{
+private:
+ SVX_DLLPRIVATE void InitSettings( sal_Bool bForeground, sal_Bool bBackground );
+ SVX_DLLPRIVATE void InitRectBitmap( void );
+ SVX_DLLPRIVATE Bitmap& GetRectBitmap( void );
+ SVX_DLLPRIVATE void Resize_Impl();
+
+protected:
+ SvxRectCtlAccessibleContext* pAccContext;
+ sal_uInt16 nBorderWidth;
+ sal_uInt16 nRadius;
+ Size aSize;
+ Point aPtLT, aPtMT, aPtRT;
+ Point aPtLM, aPtMM, aPtRM;
+ Point aPtLB, aPtMB, aPtRB;
+ Point aPtNew;
+ RECT_POINT eRP, eDefRP;
+ CTL_STYLE eCS;
+ Bitmap* pBitmap;
+ CTL_STATE m_nState;
+
+ sal_Bool mbCompleteDisable;
+
+ RECT_POINT GetRPFromPoint( Point ) const;
+ Point GetPointFromRP( RECT_POINT ) const;
+ void SetFocusRect( const Rectangle* pRect = NULL ); // pRect == NULL -> calculate rectangle in method
+ Point SetActualRPWithoutInvalidate( RECT_POINT eNewRP ); // returns the last point
+
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+ Point GetApproxLogPtFromPixPt( const Point& rRoughPixelPoint ) const;
+public:
+ SvxRectCtl( Window* pParent, const ResId& rResId, RECT_POINT eRpt = RP_MM,
+ sal_uInt16 nBorder = 200, sal_uInt16 nCircle = 80, CTL_STYLE eStyle = CS_RECT );
+ SvxRectCtl( Window* pParent, RECT_POINT eRpt = RP_MM,
+ sal_uInt16 nBorder = 200, sal_uInt16 nCircle = 80, CTL_STYLE eStyle = CS_RECT );
+ virtual ~SvxRectCtl();
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKeyEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void Resize();
+
+ void Reset();
+ RECT_POINT GetActualRP() const;
+ void SetActualRP( RECT_POINT eNewRP );
+
+ void SetState( CTL_STATE nState );
+
+ sal_uInt8 GetNumOfChildren( void ) const; // returns number of usable radio buttons
+
+ Rectangle CalculateFocusRectangle( void ) const;
+ Rectangle CalculateFocusRectangle( RECT_POINT eRectPoint ) const;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+ RECT_POINT GetApproxRPFromPixPt( const ::com::sun::star::awt::Point& rPixelPoint ) const;
+
+ sal_Bool IsCompletelyDisabled() const { return mbCompleteDisable; }
+ void DoCompletelyDisable(sal_Bool bNew);
+};
+
+/*************************************************************************
+|* Preview control for the display of bitmaps
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxBitmapCtl
+{
+protected:
+ Size aSize;
+ sal_uInt16 nLines;
+ Color aPixelColor, aBackgroundColor;
+ const sal_uInt16* pBmpArray;
+
+public:
+ SvxBitmapCtl( Window* pParent, const Size& rSize );
+ ~SvxBitmapCtl();
+
+ BitmapEx GetBitmapEx();
+
+ void SetBmpArray( const sal_uInt16* pPixel ) { pBmpArray = pPixel; }
+ void SetLines( sal_uInt16 nLns ) { nLines = nLns; }
+ void SetPixelColor( Color aColor ) { aPixelColor = aColor; }
+ void SetBackgroundColor( Color aColor ) { aBackgroundColor = aColor; }
+};
+
+/*************************************************************************
+|* Control for editing bitmaps
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxPixelCtl : public Control
+{
+private:
+ using OutputDevice::SetLineColor;
+
+protected:
+ sal_uInt16 nLines, nSquares;
+ Color aPixelColor;
+ Color aBackgroundColor;
+ Color aLineColor;
+ Size aRectSize;
+ sal_uInt16* pPixel;
+ sal_Bool bPaintable;
+
+ void ChangePixel( sal_uInt16 nPixel );
+
+public:
+ SvxPixelCtl( Window* pParent, const ResId& rResId,
+ sal_uInt16 nNumber = 8 );
+ ~SvxPixelCtl();
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+
+ void SetXBitmap( const BitmapEx& rBitmapEx );
+
+ void SetPixelColor( const Color& rCol ) { aPixelColor = rCol; }
+ void SetBackgroundColor( const Color& rCol ) { aBackgroundColor = rCol; }
+ void SetLineColor( const Color& rCol ) { aLineColor = rCol; }
+
+ sal_uInt16 GetLineCount() const { return nLines; }
+ Color GetPixelColor() const { return aPixelColor; }
+ Color GetBackgroundColor() const { return aBackgroundColor; }
+
+ sal_uInt16* GetBitmapPixelPtr() { return pPixel; }
+
+ void SetPaintable( sal_Bool bTmp ) { bPaintable = bTmp; }
+ void Reset();
+};
+
+/************************************************************************/
+
+class SVX_DLLPUBLIC ColorLB : public ColorListBox
+{
+
+public:
+ ColorLB( Window* pParent, ResId Id ) : ColorListBox( pParent, Id ) {}
+ ColorLB( Window* pParent, WinBits aWB ) : ColorListBox( pParent, aWB ) {}
+
+ virtual void Fill( const XColorListRef &pTab );
+
+ void Append( XColorEntry* pEntry, Bitmap* pBmp = NULL );
+ void Modify( XColorEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp = NULL );
+};
+
+/************************************************************************/
+
+class SVX_DLLPUBLIC HatchingLB : public ListBox
+{
+ XHatchListRef mpList;
+ sal_Bool mbUserDraw;
+public:
+ HatchingLB( Window* pParent, ResId Id, sal_Bool bUserDraw = sal_True );
+
+ virtual void Fill( const XHatchListRef &pList );
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ void Append( XHatchEntry* pEntry, Bitmap* pBmp = NULL );
+ void Modify( XHatchEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp = NULL );
+};
+
+/************************************************************************/
+
+class SVX_DLLPUBLIC GradientLB : public ListBox
+{
+ XGradientListRef mpList;
+ sal_Bool mbUserDraw;
+public:
+ GradientLB( Window* pParent, ResId Id, sal_Bool bUserDraw = sal_True );
+ GradientLB( Window* pParent, WinBits aWB, sal_Bool bUserDraw = sal_True );
+
+ virtual void Fill( const XGradientListRef &pList );
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ void Append( XGradientEntry* pEntry, Bitmap* pBmp = NULL );
+ void Modify( XGradientEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp = NULL );
+ void SelectEntryByList( const XGradientListRef &pList, const String& rStr,
+ const XGradient& rXGradient, sal_uInt16 nDist = 0 );
+};
+
+/************************************************************************/
+
+class SVX_DLLPUBLIC BitmapLB : public ListBox
+{
+public:
+ BitmapLB(Window* pParent, ResId Id, bool bUserDraw = true);
+
+ virtual void Fill(const XBitmapListRef &pList);
+ virtual void UserDraw(const UserDrawEvent& rUDEvt);
+
+ void Append(XBitmapEntry* pEntry, BitmapEx* pBmpEx = NULL);
+ void Modify(XBitmapEntry* pEntry, sal_uInt16 nPos, BitmapEx* pBmpEx = NULL);
+
+private:
+ VirtualDevice maVD;
+ BitmapEx maBitmapEx;
+
+ XBitmapListRef mpList;
+ bool mbUserDraw;
+
+ SVX_DLLPRIVATE void SetVirtualDevice();
+};
+
+/************************************************************************/
+
+class FillAttrLB : public ColorListBox
+{
+private:
+ VirtualDevice maVD;
+ BitmapEx maBitmapEx;
+
+ void SetVirtualDevice();
+
+public:
+ FillAttrLB( Window* pParent, WinBits aWB );
+
+ virtual void Fill( const XColorListRef &pList );
+ virtual void Fill( const XHatchListRef &pList );
+ virtual void Fill( const XGradientListRef &pList );
+ virtual void Fill( const XBitmapListRef &pList );
+};
+
+/************************************************************************/
+
+class FillTypeLB : public ListBox
+{
+
+public:
+ FillTypeLB( Window* pParent, ResId Id ) : ListBox( pParent, Id ) {}
+ FillTypeLB( Window* pParent, WinBits aWB ) : ListBox( pParent, aWB ) {}
+
+ virtual void Fill();
+};
+
+/************************************************************************/
+
+class SVX_DLLPUBLIC LineLB : public ListBox
+{
+
+public:
+ LineLB( Window* pParent, ResId Id ) : ListBox( pParent, Id ) {}
+ LineLB( Window* pParent, WinBits aWB ) : ListBox( pParent, aWB ) {}
+
+ virtual void Fill( const XDashListRef &pList );
+
+ void Append( XDashEntry* pEntry, Bitmap* pBmp = NULL );
+ void Modify( XDashEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp = NULL );
+ void FillStyles();
+};
+
+/************************************************************************/
+
+class SVX_DLLPUBLIC LineEndLB : public ListBox
+{
+
+public:
+ LineEndLB( Window* pParent, ResId Id ) : ListBox( pParent, Id ) {}
+ LineEndLB( Window* pParent, WinBits aWB ) : ListBox( pParent, aWB ) {}
+
+ virtual void Fill( const XLineEndListRef &pList, sal_Bool bStart = sal_True );
+
+ void Append( XLineEndEntry* pEntry, Bitmap* pBmp = NULL,
+ sal_Bool bStart = sal_True );
+ void Modify( XLineEndEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp = NULL,
+ sal_Bool bStart = sal_True );
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SdrObject;
+class SdrModel;
+
+class SvxPreviewBase : public Control
+{
+private:
+ SdrModel* mpModel;
+ VirtualDevice* mpBufferDevice;
+
+protected:
+ void InitSettings(bool bForeground, bool bBackground);
+
+ // prepare buffered paint
+ void LocalPrePaint();
+
+ // end and output buffered paint
+ void LocalPostPaint();
+
+public:
+ SvxPreviewBase(Window* pParent, const ResId& rResId);
+ SvxPreviewBase(Window* pParent);
+ virtual ~SvxPreviewBase();
+
+ // change support
+ virtual void StateChanged(StateChangedType nStateChange);
+ virtual void DataChanged(const DataChangedEvent& rDCEvt);
+
+ // dada read access
+ SdrModel& getModel() const { return *mpModel; }
+ OutputDevice& getBufferDevice() const { return *mpBufferDevice; }
+};
+
+/*************************************************************************
+|*
+|* SvxLinePreview
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxXLinePreview : public SvxPreviewBase
+{
+private:
+ SdrObject* mpLineObjA;
+ SdrObject* mpLineObjB;
+ SdrObject* mpLineObjC;
+
+ Graphic* mpGraphic;
+ sal_Bool mbWithSymbol;
+ Size maSymbolSize;
+
+public:
+ SvxXLinePreview( Window* pParent, const ResId& rResId );
+ virtual ~SvxXLinePreview();
+
+ void SetLineAttributes(const SfxItemSet& rItemSet);
+
+ void ShowSymbol( sal_Bool b ) { mbWithSymbol = b; };
+ void SetSymbol( Graphic* p, const Size& s );
+ void ResizeSymbol( const Size& s );
+
+ virtual void Paint( const Rectangle& rRect );
+};
+
+/*************************************************************************
+|*
+|* SvxXRectPreview
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxXRectPreview : public SvxPreviewBase
+{
+private:
+ SdrObject* mpRectangleObject;
+
+public:
+ SvxXRectPreview(Window* pParent, const ResId& rResId);
+ SvxXRectPreview(Window* pParent);
+ virtual ~SvxXRectPreview();
+
+ void SetAttributes(const SfxItemSet& rItemSet);
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+};
+
+/*************************************************************************
+|*
+|* SvxXShadowPreview
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxXShadowPreview : public SvxPreviewBase
+{
+private:
+ SdrObject* mpRectangleObject;
+ SdrObject* mpRectangleShadow;
+
+public:
+ SvxXShadowPreview( Window* pParent, const ResId& rResId );
+ virtual ~SvxXShadowPreview();
+
+ void SetRectangleAttributes(const SfxItemSet& rItemSet);
+ void SetShadowAttributes(const SfxItemSet& rItemSet);
+ void SetShadowPosition(const Point& rPos);
+
+ virtual void Paint( const Rectangle& rRect );
+};
+
+#endif // _SVX_DLG_CTRL_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 000000000000..238a90dd121a
--- /dev/null
+++ b/include/svx/dlgutil.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 _SVX_DLGUTIL_HXX
+#define _SVX_DLGUTIL_HXX
+
+#include <svtools/unitconv.hxx>
+#include <svx/svxdllapi.h>
+
+// macro -----------------------------------------------------------------
+
+// typedef ---------------------------------------------------------------
+
+// Functions -------------------------------------------------------------
+class SfxItemSet;
+
+SVX_DLLPUBLIC FieldUnit GetModuleFieldUnit( const SfxItemSet& );
+SVX_DLLPUBLIC bool GetApplyCharUnit( const SfxItemSet& );
+
+static const int OUTPUT_DRAWMODE_COLOR = (DRAWMODE_DEFAULT);
+static const int OUTPUT_DRAWMODE_CONTRAST = (DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_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 000000000000..16447dce67cc
--- /dev/null
+++ b/include/svx/drawitem.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 _SVX_DRAWITEM_HXX
+#define _SVX_DRAWITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <svx/xtable.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/drawing/LineDash.hpp>
+#include "svx/svxdllapi.h"
+
+//==================================================================
+// SvxColorListItem
+//==================================================================
+
+class SVX_DLLPUBLIC SvxColorListItem: public SfxPoolItem
+{
+ XColorListRef pColorList;
+
+public:
+ TYPEINFO();
+ SvxColorListItem();
+ SvxColorListItem( XColorListRef pTable,
+ sal_uInt16 nWhich );
+ SvxColorListItem( const SvxColorListItem& );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId );
+
+ XColorListRef GetColorList() const { return pColorList; }
+ void SetColorList( const XColorListRef &pTable ) { pColorList = pTable; }
+};
+
+
+//==================================================================
+// SvxGradientListItem
+//==================================================================
+
+class SVX_DLLPUBLIC SvxGradientListItem: public SfxPoolItem
+{
+ XGradientListRef pGradientList;
+
+public:
+ TYPEINFO();
+ SvxGradientListItem();
+ SvxGradientListItem( XGradientListRef pList,
+ sal_uInt16 nWhich );
+ SvxGradientListItem( const SvxGradientListItem& );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId );
+
+ XGradientListRef GetGradientList() const { return pGradientList; }
+ void SetGradientList( XGradientListRef pList ) {
+ pGradientList = pList; }
+};
+
+
+//==================================================================
+// SvxHatchListItem
+//==================================================================
+class SVX_DLLPUBLIC SvxHatchListItem: public SfxPoolItem
+{
+ XHatchListRef pHatchList;
+
+public:
+ TYPEINFO();
+ SvxHatchListItem();
+ SvxHatchListItem( XHatchListRef pList,
+ sal_uInt16 nWhich );
+ SvxHatchListItem( const SvxHatchListItem& );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId );
+
+ XHatchListRef GetHatchList() const { return pHatchList; }
+ void SetHatchList( XHatchListRef pList ) {
+ pHatchList = pList; }
+};
+
+
+
+//==================================================================
+// SvxBitmapListItem
+//==================================================================
+class SVX_DLLPUBLIC SvxBitmapListItem: public SfxPoolItem
+{
+ XBitmapListRef pBitmapList;
+
+public:
+ TYPEINFO();
+ SvxBitmapListItem();
+ SvxBitmapListItem( XBitmapListRef pBL,
+ sal_uInt16 nWhich );
+ SvxBitmapListItem( const SvxBitmapListItem& );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId );
+
+ XBitmapListRef GetBitmapList() const { return pBitmapList; }
+ void SetBitmapList( XBitmapListRef pList ) {
+ pBitmapList = pList; }
+};
+
+
+
+//==================================================================
+// SvxDashListItem
+//==================================================================
+class SVX_DLLPUBLIC SvxDashListItem: public SfxPoolItem
+{
+ XDashListRef pDashList;
+
+public:
+ TYPEINFO();
+ SvxDashListItem();
+ SvxDashListItem( XDashListRef pList,
+ sal_uInt16 nWhich );
+ SvxDashListItem( const SvxDashListItem& );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId );
+
+ XDashListRef GetDashList() const { return pDashList; }
+};
+
+
+//==================================================================
+// SvxLineEndListItem
+//==================================================================
+class SVX_DLLPUBLIC SvxLineEndListItem: public SfxPoolItem
+{
+ XLineEndListRef pLineEndList;
+
+public:
+ TYPEINFO();
+ SvxLineEndListItem();
+ SvxLineEndListItem( XLineEndListRef pList,
+ sal_uInt16 nWhich );
+ SvxLineEndListItem( const SvxLineEndListItem& );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId );
+
+ XLineEndListRef GetLineEndList() const { return pLineEndList; }
+ void SetLineEndList( XLineEndListRef pList ) {
+ pLineEndList = pList; }
+};
+
+
+
+
+#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 000000000000..58d798311d3f
--- /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 _SVX_DSTRIBUT_ENUM_HXX
+#define _SVX_DSTRIBUT_ENUM_HXX
+
+enum SvxDistributeHorizontal
+{
+ SvxDistributeHorizontalNone = 0,
+ SvxDistributeHorizontalLeft,
+ SvxDistributeHorizontalCenter,
+ SvxDistributeHorizontalDistance,
+ SvxDistributeHorizontalRight
+};
+
+enum SvxDistributeVertical
+{
+ SvxDistributeVerticalNone = 0,
+ SvxDistributeVerticalTop,
+ SvxDistributeVerticalCenter,
+ SvxDistributeVerticalDistance,
+ SvxDistributeVerticalBottom
+};
+
+#endif // _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 000000000000..dfd722cd8347
--- /dev/null
+++ b/include/svx/e3ditem.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 _SVXE3DITEM_HXX
+#define _SVXE3DITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <basegfx/vector/b3dvector.hxx>
+#include "svx/svxdllapi.h"
+
+#ifndef _SVXVECT3DITEM_HXX
+#define _SVXVECT3DITEM_HXX
+
+class SvStream;
+
+class SVX_DLLPUBLIC SvxB3DVectorItem : public SfxPoolItem
+{
+ basegfx::B3DVector aVal;
+
+public:
+ TYPEINFO();
+ SvxB3DVectorItem();
+ SvxB3DVectorItem( sal_uInt16 nWhich, const basegfx::B3DVector& rVal );
+ SvxB3DVectorItem( const SvxB3DVectorItem& );
+ ~SvxB3DVectorItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ const basegfx::B3DVector& GetValue() const { return aVal; }
+ void SetValue( const basegfx::B3DVector& rNewVal ) {
+ DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
+ aVal = rNewVal;
+ }
+
+ virtual sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const;
+};
+
+#endif
+
+#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 000000000000..a0223fbf9ed4
--- /dev/null
+++ b/include/svx/e3dsceneupdater.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 _E3D_SCENEUPDATER_HXX
+#define _E3D_SCENEUPDATER_HXX
+
+#include <svx/svxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrObject;
+class E3dScene;
+namespace drawinglayer { namespace geometry {
+ class ViewInformation3D;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+// 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 it's 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 eventually changed
+// 3D content and tu use it. This is only wanted if changes to the scene's
+// content are intended to change the scene's 2D geometry attributes
+
+class SVX_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
+ drawinglayer::geometry::ViewInformation3D* mpViewInformation3D;
+
+public:
+ // the constructor evaluates and sets the members at construction time
+ E3DModifySceneSnapRectUpdater(const SdrObject* pObject);
+
+ // the destructor will take action if mpScene is not zero and modify the
+ // 2D geomeztry of the target scene
+ ~E3DModifySceneSnapRectUpdater();
+};
+
+#endif // _E3D_SCENEUPDATER_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 000000000000..468a7ad77ca0
--- /dev/null
+++ b/include/svx/e3dundo.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 _E3D_UNDO_HXX
+#define _E3D_UNDO_HXX
+
+#include <svx/svdundo.hxx>
+#include <svx/scene3d.hxx>
+#include "svx/svxdllapi.h"
+
+/************************************************************************\
+|*
+|* Base class for all 3D undo actions.
+|*
+\************************************************************************/
+class E3dUndoAction : public SdrUndoAction
+{
+
+ protected :
+ E3dObject *pMy3DObj;
+
+ public:
+ TYPEINFO();
+ E3dUndoAction (SdrModel *pModel,
+ E3dObject *p3DObj) :
+ SdrUndoAction (*pModel),
+ pMy3DObj (p3DObj)
+ {
+ }
+
+ virtual ~E3dUndoAction ();
+
+ virtual sal_Bool CanRepeat(SfxRepeatTarget&) const;
+};
+
+/************************************************************************\
+|*
+|* Undo for 3D rotation through the rotation matrices
+|*
+\************************************************************************/
+class E3dRotateUndoAction : public E3dUndoAction
+{
+ basegfx::B3DHomMatrix aMyOldRotation;
+ basegfx::B3DHomMatrix aMyNewRotation;
+
+ public:
+ TYPEINFO();
+ E3dRotateUndoAction (SdrModel *pModel,
+ E3dObject *p3DObj,
+ const basegfx::B3DHomMatrix &aOldRotation,
+ const basegfx::B3DHomMatrix &aNewRotation) :
+ E3dUndoAction (pModel, p3DObj),
+ aMyOldRotation (aOldRotation),
+ aMyNewRotation (aNewRotation)
+ {
+ }
+
+ virtual ~E3dRotateUndoAction ();
+
+ virtual void Undo();
+ virtual void Redo();
+
+};
+
+/************************************************************************\
+|*
+|* Undo for 3D attributes (implemented using Set3DAttributes())
+|*
+\************************************************************************/
+class SVX_DLLPUBLIC E3dAttributesUndoAction : public SdrUndoAction
+{
+ using SdrUndoAction::Repeat;
+
+ SdrObject* pObject;
+
+ const SfxItemSet aNewSet;
+ const SfxItemSet aOldSet;
+
+ public:
+ TYPEINFO();
+ E3dAttributesUndoAction( SdrModel &rModel,
+ E3dObject* pInObject,
+ const SfxItemSet& rNewSet,
+ const SfxItemSet& rOldSet);
+
+ virtual ~E3dAttributesUndoAction();
+
+ virtual sal_Bool CanRepeat(SfxRepeatTarget& rView) const;
+ virtual void Undo();
+ virtual void Redo();
+ virtual void Repeat();
+};
+
+#endif // _E3D_CUBE3D_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 000000000000..6f3c44afcbb0
--- /dev/null
+++ b/include/svx/extedit.hxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Surendran Mahendran <surenspost@gmail.com>]
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _EXTEDIT_HXX
+#define _EXTEDIT_HXX
+
+#include <svtools/grfmgr.hxx>
+#include <osl/file.hxx>
+#include <osl/process.h>
+#include <vcl/graph.hxx>
+#include <vcl/timer.hxx>
+#include <svx/svxdllapi.h>
+
+class SVX_DLLPUBLIC ExternalToolEdit
+{
+public:
+ GraphicObject* m_pGraphicObject;
+ OUString m_aFileName;
+
+ ExternalToolEdit();
+ virtual ~ExternalToolEdit();
+
+ virtual void Update( Graphic& aGraphic ) = 0;
+ void Edit( GraphicObject *pGraphic );
+
+ DECL_LINK( StartListeningEvent, void *pEvent );
+
+ static void threadWorker( void *pThreadData );
+ static void HandleCloseEvent( ExternalToolEdit* pData );
+};
+
+
+#endif
diff --git a/include/svx/exthelpid.hrc b/include/svx/exthelpid.hrc
new file mode 100644
index 000000000000..b89d2f5b9fa1
--- /dev/null
+++ b/include/svx/exthelpid.hrc
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_EXTHELPID_HRC
+#define _SVX_EXTHELPID_HRC
+
+// these HIDs are used in SVX and also in other modules, mainly CUI
+// the reason is that different controls have the same help texts assigned
+// but are implemented in different libraries
+// to avoid "exporting" the whole HID list only those few ones that are shared
+// are moved to this exported (delivered) hrc file
+
+// Help-Ids --------------------------------------------------------------
+#define HID_GALLERY_ACTUALIZE "SVX_HID_GALLERY_ACTUALIZE"
+#define HID_GALLERY_TITLE "SVX_HID_GALLERY_TITLE"
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/extrud3d.hxx b/include/svx/extrud3d.hxx
new file mode 100644
index 000000000000..60da90841abb
--- /dev/null
+++ b/include/svx/extrud3d.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 _E3D_EXTRUD3D_HXX
+#define _E3D_EXTRUD3D_HXX
+
+#include <svx/obj3d.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* 3D extrusion object created from the provided 2D polygon
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC E3dExtrudeObj : public E3dCompoundObject
+{
+private:
+ // to allow sdr::properties::E3dExtrudeProperties access to SetGeometryValid()
+ friend class sdr::properties::E3dExtrudeProperties;
+
+ // geometry, which determines the object
+ basegfx::B2DPolyPolygon maExtrudePolygon;
+
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+ void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+
+public:
+ TYPEINFO();
+
+ E3dExtrudeObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon& rPP, double fDepth);
+ E3dExtrudeObj();
+
+ // PercentDiagonal: 0..100, before 0.0..0.5
+ sal_uInt16 GetPercentDiagonal() const
+ { return ((const Svx3DPercentDiagonalItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); }
+
+ // BackScale: 0..100, before 0.0..1.0
+ sal_uInt16 GetPercentBackScale() const
+ { return ((const Svx3DBackscaleItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); }
+
+ // BackScale: 0..100, before 0.0..1.0
+ sal_uInt32 GetExtrudeDepth() const
+ { return ((const Svx3DDepthItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_DEPTH)).GetValue(); }
+
+ // #107245# GetSmoothNormals() for bExtrudeSmoothed
+ sal_Bool GetSmoothNormals() const
+ { return ((const Svx3DSmoothNormalsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS)).GetValue(); }
+
+ // #107245# GetSmoothLids() for bExtrudeSmoothFrontBack
+ sal_Bool GetSmoothLids() const
+ { return ((const Svx3DSmoothLidsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS)).GetValue(); }
+
+ // #107245# GetCharacterMode() for bExtrudeCharacterMode
+ sal_Bool GetCharacterMode() const
+ { return ((const Svx3DCharacterModeItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE)).GetValue(); }
+
+ // #107245# GetCloseFront() for bExtrudeCloseFront
+ sal_Bool GetCloseFront() const
+ { return ((const Svx3DCloseFrontItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT)).GetValue(); }
+
+ // #107245# GetCloseBack() for bExtrudeCloseBack
+ sal_Bool GetCloseBack() const
+ { return ((const Svx3DCloseBackItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK)).GetValue(); }
+
+ virtual sal_uInt16 GetObjIdentifier() const;
+
+ virtual E3dExtrudeObj* Clone() const;
+
+ // TakeObjName...() is for the display in the UI (for example "3 frames selected")
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ // set/get local parameters with geometry regeneration
+ void SetExtrudePolygon(const basegfx::B2DPolyPolygon &rNew);
+ const basegfx::B2DPolyPolygon &GetExtrudePolygon() { return maExtrudePolygon; }
+
+ virtual bool IsBreakObjPossible();
+ virtual SdrAttrObj* GetBreakObj();
+};
+
+#endif // _E3D_EXTRUD3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/extrusionbar.hxx b/include/svx/extrusionbar.hxx
new file mode 100644
index 000000000000..0cb9e829db45
--- /dev/null
+++ b/include/svx/extrusionbar.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 _SVX_EXTRUSION_BAR_HXX
+#define _SVX_EXTRUSION_BAR_HXX
+
+#include <sfx2/shell.hxx>
+#include <sfx2/module.hxx>
+#include <svx/ifaceids.hxx>
+#include "svx/svxdllapi.h"
+
+class SfxViewShell;
+class SdrView;
+
+/************************************************************************/
+
+namespace svx
+{
+
+SVX_DLLPUBLIC bool checkForSelectedCustomShapes( SdrView* pSdrView, bool bOnlyExtruded );
+
+class SVX_DLLPUBLIC ExtrusionBar : public SfxShell
+{
+public:
+ TYPEINFO();
+ SFX_DECL_INTERFACE(SVX_INTERFACE_EXTRUSION_BAR)
+
+ ExtrusionBar(SfxViewShell* pViewShell );
+ ~ExtrusionBar();
+
+ static void execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBindings );
+ static void getState( SdrView* pSdrView, SfxItemSet& rSet );
+};
+
+}
+
+#endif // _SVX_EXTRUSION_BAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/extrusioncolorcontrol.hxx b/include/svx/extrusioncolorcontrol.hxx
new file mode 100644
index 000000000000..1c2538832788
--- /dev/null
+++ b/include/svx/extrusioncolorcontrol.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 _SVX_EXTRUSIONCOLORCONTROL_HXX
+#define _SVX_EXTRUSIONCOLORCONTROL_HXX
+
+#include <sfx2/tbxctrl.hxx>
+#include "svx/svxdllapi.h"
+#include "svx/tbxcolorupdate.hxx"
+
+namespace svx {
+
+class SVX_DLLPUBLIC ExtrusionColorControl : public SfxToolBoxControl
+{
+private:
+ ToolboxButtonColorUpdater* mpBtnUpdater;
+ Color mLastColor;
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ ExtrusionColorControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~ExtrusionColorControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+};
+
+}
+
+#endif // _SVX_EXTRUSIONCOLORCONTROL_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 000000000000..8b0446d1cd83
--- /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 _SVX_F3DCHILD_HXX
+#define _SVX_F3DCHILD_HXX
+
+
+#include <sfx2/childwin.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* Derived from SfxChildWindow as "container" for 3D Window
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC Svx3DChildWindow : public SfxChildWindow
+{
+ public:
+ Svx3DChildWindow( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
+
+ SFX_DECL_CHILDWINDOW_WITHID(Svx3DChildWindow);
+};
+
+#endif // _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 000000000000..065321f51a64
--- /dev/null
+++ b/include/svx/fillctrl.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 _FILLCTRL_HXX
+#define _FILLCTRL_HXX
+
+#include <svl/lstner.hxx>
+#include <sfx2/tbxctrl.hxx>
+#include "svx/svxdllapi.h"
+
+class XFillStyleItem;
+class XFillColorItem;
+class XFillGradientItem;
+class XFillHatchItem;
+class XFillBitmapItem;
+class FillControl;
+class SvxFillTypeBox;
+class SvxFillAttrBox;
+class ListBox;
+
+/*************************************************************************
+|*
+|* Class for surface attributes (controls and controller)
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxFillToolBoxControl: public SfxToolBoxControl
+{
+private:
+ XFillStyleItem* pStyleItem;
+ XFillColorItem* pColorItem;
+ XFillGradientItem* pGradientItem;
+ XFillHatchItem* pHatchItem;
+ XFillBitmapItem* pBitmapItem;
+
+ FillControl* pFillControl;
+ SvxFillTypeBox* pFillTypeLB;
+ SvxFillAttrBox* pFillAttrLB;
+
+ sal_Bool bUpdate;
+ sal_Bool bIgnoreStatusUpdate;
+ sal_uInt16 eLastXFS;
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxFillToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxFillToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ void Update( const SfxPoolItem* pState );
+ virtual Window* CreateItemWindow( Window *pParent );
+ void IgnoreStatusUpdate( sal_Bool bSet );
+};
+
+//========================================================================
+
+class FillControl : public Window
+{
+private:
+ friend class SvxFillToolBoxControl;
+
+ SvxFillTypeBox* pLbFillType;
+ SvxFillAttrBox* pLbFillAttr;
+ Size aLogicalFillSize;
+ Size aLogicalAttrSize;
+ Timer aDelayTimer;
+
+ DECL_LINK( DelayHdl, void * );
+ DECL_LINK( SelectFillTypeHdl, ListBox * );
+ DECL_LINK( SelectFillAttrHdl, ListBox * );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+public:
+ FillControl( Window* pParent, WinBits nStyle = 0 );
+ ~FillControl();
+
+ virtual void Resize();
+};
+
+#endif // _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 000000000000..0b2ea7a6aa70
--- /dev/null
+++ b/include/svx/flagsdef.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 _SVX_FLAGSDEF_HXX
+#define _SVX_FLAGSDEF_HXX
+
+// defines ---------------------------------------------------------------
+
+// copy from border.hxx
+// Border-Modes for paragraphs, textframes and tables
+#define SW_BORDER_MODE_PARA 0x01
+#define SW_BORDER_MODE_TABLE 0x02
+#define SW_BORDER_MODE_FRAME 0x04
+
+// flags for SvxBackgroundTabPage
+#define SVX_SHOW_SELECTOR 0x01
+#define SVX_SHOW_PARACTL 0x02
+#define SVX_ENABLE_TRANSPARENCY 0x04
+#define SVX_SHOW_TBLCTL 0x08
+
+// flags for SvxBorderTabPage
+#define SVX_HIDESHADOWCTL 0x01
+
+// copy from chardlg.hxx
+#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
+
+
+// copy from numfmt.hxx
+#define SVX_NUMVAL_STANDARD -1234.12345678901234
+#define SVX_NUMVAL_CURRENCY -1234
+#define SVX_NUMVAL_PERCENT -0.1295
+#define SVX_NUMVAL_TIME 36525.5678935185
+#define SVX_NUMVAL_DATE 36525.5678935185
+#define SVX_NUMVAL_BOOLEAN 1
+
+// copy from page.hxx
+// enum ------------------------------------------------------------------
+
+enum SvxModeType
+{
+ SVX_PAGE_MODE_STANDARD,
+ SVX_PAGE_MODE_CENTER,
+ SVX_PAGE_MODE_PRESENTATION
+};
+// define ----------------------------------------------------------------
+
+// 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
+
+//--------------from original svx/inc/tabstpge.hxx
+#define TABTYPE_LEFT 0x0001
+#define TABTYPE_RIGHT 0x0002
+#define TABTYPE_CENTER 0x0004
+#define TABTYPE_DEZIMAL 0x0008
+#define TABTYPE_ALL 0x000F
+
+#define TABFILL_NONE 0x0010
+#define TABFILL_POINT 0x0020
+#define TABFILL_DASHLINE 0x0040
+#define TABFILL_SOLIDLINE 0x0080
+#define TABFILL_SPECIAL 0x0100
+#define TABFILL_ALL 0x01F0
+
+//-----
+
+#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 000000000000..1809e715c3ad
--- /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 _SVX_FLOAT3D_HXX
+#define _SVX_FLOAT3D_HXX
+
+#include <sfx2/ctrlitem.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <sfx2/dockwin.hxx>
+#include <vcl/button.hxx>
+#include <svtools/stdctrl.hxx>
+#include "svx/svxdllapi.h"
+
+#include <svx/f3dchild.hxx>
+#include <svx/dlgctl3d.hxx>
+#include <svx/dlgctrl.hxx>
+#include <svx/svdmodel.hxx>
+
+enum ViewType3D
+{
+ VIEWTYPE_GEO = 1,
+ VIEWTYPE_REPRESENTATION,
+ VIEWTYPE_LIGHT,
+ VIEWTYPE_TEXTURE,
+ VIEWTYPE_MATERIAL
+};
+
+class SdrModel;
+class FmFormModel;
+class VirtualDevice;
+class E3dView;
+class SdrPageView;
+class Svx3DCtrlItem;
+class SvxConvertTo3DItem;
+
+//------------------------------------------------------------------------
+struct Svx3DWinImpl;
+
+class SVX_DLLPUBLIC Svx3DWin : public SfxDockingWindow
+{
+ friend class Svx3DChildWindow;
+ friend class Svx3DCtrlItem;
+ using Window::Update;
+
+private:
+ ImageButton aBtnGeo;
+ ImageButton aBtnRepresentation;
+ ImageButton aBtnLight;
+ ImageButton aBtnTexture;
+ ImageButton aBtnMaterial;
+ ImageButton aBtnUpdate;
+ ImageButton aBtnAssign;
+
+// geometry
+ FixedLine aFLGeometrie;
+ FixedText aFtPercentDiagonal;
+ MetricField aMtrPercentDiagonal;
+ FixedText aFtBackscale;
+ MetricField aMtrBackscale;
+ FixedText aFtEndAngle;
+ MetricField aMtrEndAngle;
+ FixedText aFtDepth;
+ MetricField aMtrDepth;
+ FixedLine aFLSegments;
+
+ FixedText aFtHorizontal;
+ NumericField aNumHorizontal;
+ FixedText aFtVertical;
+ NumericField aNumVertical;
+ FixedLine aFLNormals;
+
+ ImageButton aBtnNormalsObj;
+ ImageButton aBtnNormalsFlat;
+ ImageButton aBtnNormalsSphere;
+ ImageButton aBtnNormalsInvert;
+ ImageButton aBtnTwoSidedLighting;
+
+ ImageButton aBtnDoubleSided;
+ FixedLine aFLRepresentation;
+// presentation
+ FixedText aFtShademode;
+ ListBox aLbShademode;
+ FixedLine aFLShadow;
+ ImageButton aBtnShadow3d;
+ FixedText aFtSlant;
+ MetricField aMtrSlant;
+ FixedText aFtDistance;
+ MetricField aMtrDistance;
+ FixedText aFtFocalLeng;
+ MetricField aMtrFocalLength;
+ FixedLine aFLCamera;
+ FixedLine aFLLight;
+
+// lighting
+ ImageButton aBtnLight1;
+ ImageButton aBtnLight2;
+ ImageButton aBtnLight3;
+ ImageButton aBtnLight4;
+ ImageButton aBtnLight5;
+ ImageButton aBtnLight6;
+ ImageButton aBtnLight7;
+ ImageButton aBtnLight8;
+ FixedText aFTLightsource;
+ ColorLB aLbLight1;
+ ColorLB aLbLight2;
+ ColorLB aLbLight3;
+ ColorLB aLbLight4;
+ ColorLB aLbLight5;
+ ColorLB aLbLight6;
+ ColorLB aLbLight7;
+ ColorLB aLbLight8;
+
+ ImageButton aBtnLightColor;
+
+ // #99694# Keyboard shortcuts activate the next control, so the
+ // order needed to be changed here
+ FixedText aFTAmbientlight; // Text label
+ ColorLB aLbAmbientlight; // ListBox
+ ImageButton aBtnAmbientColor; // color button
+
+ FixedLine aFLTexture;
+
+// Textures
+ FixedText aFtTexKind;
+ ImageButton aBtnTexLuminance;
+ ImageButton aBtnTexColor;
+ FixedText aFtTexMode;
+ ImageButton aBtnTexReplace;
+ ImageButton aBtnTexModulate;
+ ImageButton aBtnTexBlend;
+ FixedText aFtTexProjectionX;
+ ImageButton aBtnTexObjectX;
+ ImageButton aBtnTexParallelX;
+ ImageButton aBtnTexCircleX;
+ FixedText aFtTexProjectionY;
+ ImageButton aBtnTexObjectY;
+ ImageButton aBtnTexParallelY;
+ ImageButton aBtnTexCircleY;
+ FixedText aFtTexFilter;
+ ImageButton aBtnTexFilter;
+
+// material
+// material editor
+ FixedLine aFLMaterial;
+ FixedText aFtMatFavorites;
+ ListBox aLbMatFavorites;
+ FixedText aFtMatColor;
+ ColorLB aLbMatColor;
+ ImageButton aBtnMatColor;
+ FixedText aFtMatEmission;
+ ColorLB aLbMatEmission;
+ ImageButton aBtnEmissionColor;
+ FixedLine aFLMatSpecular;
+ FixedText aFtMatSpecular;
+ ColorLB aLbMatSpecular;
+ ImageButton aBtnSpecularColor;
+ FixedText aFtMatSpecularIntensity;
+ MetricField aMtrMatSpecularIntensity;
+
+ Svx3DPreviewControl aCtlPreview;
+ SvxLightCtl3D aCtlLightPreview;
+
+// bottom part
+ ImageButton aBtnConvertTo3D;
+ ImageButton aBtnLatheObject;
+ ImageButton aBtnPerspective;
+
+// the rest ...
+ Image aImgLightOn;
+ Image aImgLightOff;
+ sal_Bool bUpdate;
+ ViewType3D eViewType;
+ Size aSize;
+
+ // Model, Page, View etc. for favourites
+ FmFormModel* pModel;
+ VirtualDevice* pVDev;
+ E3dView* p3DView;
+
+ SfxBindings* pBindings;
+ Svx3DCtrlItem* pControllerItem;
+
+ SvxConvertTo3DItem* pConvertTo3DItem;
+ SvxConvertTo3DItem* pConvertTo3DLatheItem;
+
+ Svx3DWinImpl* mpImpl;
+ SfxMapUnit ePoolUnit;
+ FieldUnit eFUnit;
+
+ // ItemSet used to remember set 2d attributes
+ SfxItemSet* mpRemember2DAttributes;
+
+ sal_Bool bOnly3DChanged;
+
+ //------------------------------------
+
+ DECL_LINK( ClickViewTypeHdl, void * );
+ DECL_LINK( ClickUpdateHdl, void * );
+ DECL_LINK( ClickAssignHdl, void * );
+ DECL_LINK( ClickHdl, PushButton * );
+ DECL_LINK( ClickColorHdl, PushButton * );
+ DECL_LINK( SelectHdl, void * );
+ DECL_LINK( ModifyHdl, void * );
+ void ClickLight(PushButton &rBtn);
+
+ DECL_LINK( ChangeLightCallbackHdl, void * );
+ DECL_LINK( ChangeSelectionCallbackHdl, void * );
+
+ SVX_DLLPRIVATE void Construct();
+ SVX_DLLPRIVATE void Reset();
+
+ SVX_DLLPRIVATE sal_Bool LBSelectColor( ColorLB* pLb, const Color& rColor );
+ SVX_DLLPRIVATE sal_uInt16 GetLightSource( const PushButton* pBtn = NULL );
+ SVX_DLLPRIVATE ColorLB* GetLbByButton( const PushButton* pBtn = NULL );
+
+ SVX_DLLPRIVATE bool GetUILightState( const ImageButton& rBtn ) const;
+ SVX_DLLPRIVATE void SetUILightState( ImageButton& aBtn, bool bState );
+
+protected:
+ virtual void Resize();
+
+public:
+ Svx3DWin( SfxBindings* pBindings, SfxChildWindow *pCW,
+ Window* pParent );
+ ~Svx3DWin();
+
+ void InitColorLB( const SdrModel* pDoc );
+ sal_Bool IsUpdateMode() const { return bUpdate; }
+
+ void Update( SfxItemSet& rSet );
+ void GetAttr( SfxItemSet& rSet );
+
+ void UpdatePreview(); // nach oben (private)
+ void DocumentReload(); // #83951#
+};
+
+/*************************************************************************
+|*
+|* Controller item for 3D Window (Floating/Docking)
+|*
+\************************************************************************/
+
+class Svx3DCtrlItem : public SfxControllerItem
+{
+ protected:
+ virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
+ const SfxPoolItem* pState );
+
+ 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
+{
+ sal_Bool bState;
+
+protected:
+ virtual void StateChanged(sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pState);
+
+public:
+ SvxConvertTo3DItem(sal_uInt16 nId, SfxBindings* pBindings);
+ sal_Bool GetState() const { return bState; }
+};
+
+#endif // _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 000000000000..b59eb65c7f59
--- /dev/null
+++ b/include/svx/fmdmod.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 _SVX_FMDMOD_HXX
+#define _SVX_FMDMOD_HXX
+
+#include <svx/unomod.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_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) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments(const OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
+};
+
+#endif // _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 000000000000..50b99f8116a6
--- /dev/null
+++ b/include/svx/fmdpage.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 _SVX_FMDPAGE_HXX
+#define _SVX_FMDPAGE_HXX
+
+#include <com/sun/star/form/XFormsSupplier2.hpp>
+#include <svx/unopage.hxx>
+#include <comphelper/uno3.hxx>
+#include "svx/svxdllapi.h"
+
+//==================================================================
+// SvxFmDrawPage
+//==================================================================
+class SVX_DLLPUBLIC SvxFmDrawPage :public SvxDrawPage
+ ,public ::com::sun::star::form::XFormsSupplier2
+{
+protected:
+
+ // Creating a SdrObject based on a Description. Cann be used by derived classes to
+ // support own ::com::sun::star::drawing::Shapes (for example Controls)
+ virtual SdrObject *_CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & xShape )throw ();
+
+ // The following method is called when a SvxShape object should be created.
+ // Derived classes can create a derivation or an object aggregating SvxShape.
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > _CreateShape( SdrObject *pObj ) const throw ();
+
+public:
+ SvxFmDrawPage( SdrPage* pPage );
+ virtual ~SvxFmDrawPage() throw ();
+
+ // UNO connection
+ DECLARE_UNO3_AGG_DEFAULTS(SvxFmDrawPage, SvxDrawPage);
+
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XFormsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > SAL_CALL getForms(void) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XFormsSupplier2
+ virtual sal_Bool SAL_CALL hasForms(void) throw( ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
+};
+
+#endif // _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 000000000000..71909d43e8a9
--- /dev/null
+++ b/include/svx/fmglob.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 _SVX_FMGLOB_HXX
+#define _SVX_FMGLOB_HXX
+
+#include <tools/solar.h>
+#include <svx/svdobj.hxx>
+#include <com/sun/star/form/FormComponentType.hpp>
+
+const sal_uInt32 FmFormInventor = sal_uInt32('F')*0x00000001+
+ sal_uInt32('M')*0x00000100+
+ sal_uInt32('0')*0x00010000+
+ sal_uInt32('1')*0x01000000;
+
+const sal_uInt16 OBJ_FM_CONTROL = ::com::sun::star::form::FormComponentType::CONTROL;
+ // for form components
+const sal_uInt16 OBJ_FM_EDIT = ::com::sun::star::form::FormComponentType::TEXTFIELD;
+const sal_uInt16 OBJ_FM_BUTTON = ::com::sun::star::form::FormComponentType::COMMANDBUTTON;
+const sal_uInt16 OBJ_FM_FIXEDTEXT = ::com::sun::star::form::FormComponentType::FIXEDTEXT;
+const sal_uInt16 OBJ_FM_LISTBOX = ::com::sun::star::form::FormComponentType::LISTBOX;
+const sal_uInt16 OBJ_FM_CHECKBOX = ::com::sun::star::form::FormComponentType::CHECKBOX;
+const sal_uInt16 OBJ_FM_COMBOBOX = ::com::sun::star::form::FormComponentType::COMBOBOX;
+const sal_uInt16 OBJ_FM_RADIOBUTTON = ::com::sun::star::form::FormComponentType::RADIOBUTTON;
+const sal_uInt16 OBJ_FM_GROUPBOX = ::com::sun::star::form::FormComponentType::GROUPBOX;
+const sal_uInt16 OBJ_FM_GRID = ::com::sun::star::form::FormComponentType::GRIDCONTROL;
+const sal_uInt16 OBJ_FM_IMAGEBUTTON = ::com::sun::star::form::FormComponentType::IMAGEBUTTON;
+const sal_uInt16 OBJ_FM_FILECONTROL = ::com::sun::star::form::FormComponentType::FILECONTROL;
+const sal_uInt16 OBJ_FM_DATEFIELD = ::com::sun::star::form::FormComponentType::DATEFIELD;
+const sal_uInt16 OBJ_FM_TIMEFIELD = ::com::sun::star::form::FormComponentType::TIMEFIELD;
+const sal_uInt16 OBJ_FM_NUMERICFIELD = ::com::sun::star::form::FormComponentType::NUMERICFIELD;
+const sal_uInt16 OBJ_FM_CURRENCYFIELD = ::com::sun::star::form::FormComponentType::CURRENCYFIELD;
+const sal_uInt16 OBJ_FM_PATTERNFIELD = ::com::sun::star::form::FormComponentType::PATTERNFIELD;
+const sal_uInt16 OBJ_FM_HIDDEN = ::com::sun::star::form::FormComponentType::HIDDENCONTROL;
+const sal_uInt16 OBJ_FM_IMAGECONTROL = ::com::sun::star::form::FormComponentType::IMAGECONTROL;
+const sal_uInt16 OBJ_FM_FORMATTEDFIELD = ::com::sun::star::form::FormComponentType::PATTERNFIELD + 1;
+const sal_uInt16 OBJ_FM_SCROLLBAR = ::com::sun::star::form::FormComponentType::PATTERNFIELD + 2;
+const sal_uInt16 OBJ_FM_SPINBUTTON = ::com::sun::star::form::FormComponentType::PATTERNFIELD + 3;
+const sal_uInt16 OBJ_FM_NAVIGATIONBAR = ::com::sun::star::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 000000000000..b0d225ccef24
--- /dev/null
+++ b/include/svx/fmgridcl.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 _SVX_FMGRIDCL_HXX
+#define _SVX_FMGRIDCL_HXX
+
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+
+#include <svx/gridctrl.hxx>
+#include <svtools/transfer.hxx>
+#include "svx/svxdllapi.h"
+
+//==================================================================
+// FmGridHeader
+//==================================================================
+struct FmGridHeaderData;
+class SVX_DLLPUBLIC FmGridHeader
+ :public ::svt::EditBrowserHeader
+ ,public DropTargetHelper
+{
+protected:
+ FmGridHeaderData* m_pImpl;
+
+ // trigger context menu execution
+ void triggerColumnContextMenu( const ::Point& _rPreferredPos );
+
+public:
+ FmGridHeader( BrowseBox* pParent, WinBits nWinBits = WB_STDHEADERBAR | WB_DRAG );
+ ~FmGridHeader();
+
+public:
+ struct AccessControl { friend class FmGridControl; private: AccessControl() { } };
+
+ inline void triggerColumnContextMenu( const ::Point& _rPreferredPos, const AccessControl& )
+ {
+ triggerColumnContextMenu( _rPreferredPos );
+ }
+
+protected:
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void Select();
+
+ /** 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 );
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+
+ /** selects the column at the selection supplier.
+ @param nColumnId
+ The column id.
+ */
+ void notifyColumnSelect(sal_uInt16 nColumnId);
+private:
+ DECL_LINK( OnAsyncExecuteDrop, void* );
+};
+
+//==================================================================
+// FmGridControl
+//==================================================================
+class FmXGridPeer;
+class SVX_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) posisition ...
+ sal_uInt16 m_nMarkedColumnId;
+ sal_Bool m_bSelecting;
+ sal_Bool m_bInColumnMove : 1;
+
+public:
+ FmGridControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&,
+ Window* pParent,
+ FmXGridPeer* _pPeer,
+ WinBits nBits);
+
+ // Window
+ virtual void KeyInput( const KeyEvent& rKEvt );
+
+ // ::com::sun::star::beans::XPropertyChangeListener
+ void SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt);
+
+ // ::com::sun::star::form::XPositioningListener
+ void positioned(const ::com::sun::star::lang::EventObject& rEvent);
+
+ // XBound
+ sal_Bool commit();
+
+ // ::com::sun::star::form::XInsertListener
+ void inserted(const ::com::sun::star::lang::EventObject& rEvent);
+
+ void markColumn(sal_uInt16 nId);
+ sal_Bool isColumnMarked(sal_uInt16 nId) const;
+
+ sal_Int32 GetSelectedColumn() const;
+
+ /** 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 colum/row cell
+ @return
+ The name of the specified object.
+ */
+ virtual OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const;
+
+ /** 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 colum/row cell
+ @return
+ The description of the specified object.
+ */
+ virtual OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const;
+
+protected:
+ virtual void Command(const CommandEvent& rEvt);
+
+ virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent);
+ virtual long QueryMinimumRowHeight();
+ virtual void RowHeightChanged();
+ virtual void ColumnResized(sal_uInt16 nId);
+ virtual void ColumnMoved(sal_uInt16 nId);
+ virtual void DeleteSelectedRows();
+ virtual void SetDesignMode(sal_Bool bMode);
+ virtual void CellModified();
+ virtual void HideColumn(sal_uInt16 nId);
+ virtual void ShowColumn(sal_uInt16 nId);
+
+ sal_Bool IsInColumnMove() const {return m_bInColumnMove;}
+
+ virtual void BeginCursorAction();
+ virtual void EndCursorAction();
+ virtual void Select();
+
+ // Initialize columns
+ // a.) only by column description
+ virtual void InitColumnsByModels(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& xColumns);
+ // b.) during alivemode by database fields
+ virtual void InitColumnsByFields(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xFields);
+
+ // some kind of impl version (for one single column) of our version of InitColumnsByFields
+ void InitColumnByField(
+ DbGridColumn* _pColumn,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumnModel,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxFieldsByNames,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _rxFieldsByIndex
+ );
+
+ FmXGridPeer* GetPeer() const {return m_pPeer;}
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>
+ getSelectionBookmarks();
+ sal_Bool selectBookmarks(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& _rBookmarks);
+
+ /** returns if a column is selected
+ @param nColumnId
+ The column id.
+ @param _pColumn
+ The column to compare with.
+ @return
+ <TRUE/> if the column is selected, otherwise <FALSE/>
+ */
+ sal_Bool isColumnSelected(sal_uInt16 nColumnId,DbGridColumn* _pColumn);
+};
+
+#endif // _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 000000000000..7a1951d4dea0
--- /dev/null
+++ b/include/svx/fmgridif.hxx
@@ -0,0 +1,544 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_FMGRIDIF_HXX
+#define _SVX_FMGRIDIF_HXX
+
+#include "svx/svxdllapi.h"
+
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/container/XContainer.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include <com/sun/star/sdbc/XRowSetListener.hpp>
+#include <com/sun/star/sdb/XRowSetSupplier.hpp>
+#include <com/sun/star/form/XReset.hpp>
+#include <com/sun/star/form/XBoundComponent.hpp>
+#include <com/sun/star/form/XLoadListener.hpp>
+#include <com/sun/star/form/XGridControl.hpp>
+#include <com/sun/star/form/XGridPeer.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
+#include <com/sun/star/view/XSelectionChangeListener.hpp>
+#include <com/sun/star/util/XModeSelector.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+#include <com/sun/star/util/XModifyBroadcaster.hpp>
+
+#include <tools/wintypes.hxx>
+#include <toolkit/controls/unocontrol.hxx>
+#include <toolkit/awt/vclxwindow.hxx>
+#include <comphelper/uno3.hxx>
+#include <cppuhelper/implbase10.hxx>
+
+#ifndef INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_19
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_19
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 19
+#include <comphelper/implbase_var.hxx>
+#endif
+
+
+class DbGridColumn;
+
+class OWeakSubObject : public ::cppu::OWeakObject
+{
+protected:
+ ::cppu::OWeakObject& m_rParent;
+
+public:
+ OWeakSubObject(::cppu::OWeakObject& rParent) : m_rParent(rParent) { }
+
+ virtual void SAL_CALL acquire() throw() { m_rParent.acquire(); }
+ virtual void SAL_CALL release() throw() { m_rParent.release(); }
+};
+
+//==================================================================
+// FmXModifyMultiplexer
+//==================================================================
+class FmXModifyMultiplexer :public OWeakSubObject
+ ,public ::cppu::OInterfaceContainerHelper
+ ,public ::com::sun::star::util::XModifyListener
+{
+public:
+ FmXModifyMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex );
+ DECLARE_UNO3_DEFAULTS(FmXModifyMultiplexer,OWeakSubObject);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::lang::XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::util::XModifyListener
+ virtual void SAL_CALL modified(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
+
+// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
+ void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); }
+ void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); }
+};
+
+//==================================================================
+// FmXUpdateMultiplexer
+//==================================================================
+class FmXUpdateMultiplexer : public OWeakSubObject,
+ public ::cppu::OInterfaceContainerHelper,
+ public ::com::sun::star::form::XUpdateListener
+{
+public:
+ FmXUpdateMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex );
+ DECLARE_UNO3_DEFAULTS(FmXUpdateMultiplexer,OWeakSubObject);
+
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::lang::XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::form::XUpdateListener
+ virtual sal_Bool SAL_CALL approveUpdate(const ::com::sun::star::lang::EventObject &) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updated(const ::com::sun::star::lang::EventObject &) throw(::com::sun::star::uno::RuntimeException);
+
+// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
+ void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); }
+ void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); }
+};
+
+//==================================================================
+// FmXSelectionMultiplexer
+//==================================================================
+class FmXSelectionMultiplexer :public OWeakSubObject
+ ,public ::cppu::OInterfaceContainerHelper
+ ,public ::com::sun::star::view::XSelectionChangeListener
+{
+public:
+ FmXSelectionMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex );
+ DECLARE_UNO3_DEFAULTS(FmXSelectionMultiplexer, OWeakSubObject);
+
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::lang::XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::view::XSelectionChangeListener
+ virtual void SAL_CALL selectionChanged( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
+ void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); }
+ void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); }
+};
+
+//==================================================================
+// FmXGridControlMultiplexer
+//==================================================================
+class FmXGridControlMultiplexer :public OWeakSubObject
+ ,public ::cppu::OInterfaceContainerHelper
+ ,public ::com::sun::star::form::XGridControlListener
+{
+public:
+ FmXGridControlMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex );
+ DECLARE_UNO3_DEFAULTS( FmXGridControlMultiplexer, OWeakSubObject );
+
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::lang::XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::view::XSelectionChangeListener
+ virtual void SAL_CALL columnChanged( const ::com::sun::star::lang::EventObject& _event ) throw (::com::sun::star::uno::RuntimeException);
+
+// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
+ void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); }
+ void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); }
+};
+
+//==================================================================
+// FmXContainerMultiplexer
+//==================================================================
+class FmXContainerMultiplexer : public OWeakSubObject,
+ public ::cppu::OInterfaceContainerHelper,
+ public ::com::sun::star::container::XContainerListener
+{
+public:
+ FmXContainerMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex);
+ DECLARE_UNO3_DEFAULTS(FmXContainerMultiplexer,OWeakSubObject);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::lang::XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::container::XContainerListener
+ virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& Event) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& Event) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& Event) throw(::com::sun::star::uno::RuntimeException);
+
+// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
+ void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); }
+ void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); }
+};
+
+//==================================================================
+// FmXGridControl
+//==================================================================
+typedef ::cppu::ImplHelper10< ::com::sun::star::form::XBoundComponent,
+ ::com::sun::star::form::XGridControl,
+ ::com::sun::star::util::XModifyBroadcaster,
+ ::com::sun::star::container::XIndexAccess,
+ ::com::sun::star::container::XEnumerationAccess,
+ ::com::sun::star::util::XModeSelector,
+ ::com::sun::star::container::XContainer,
+ ::com::sun::star::frame::XDispatchProvider,
+ ::com::sun::star::frame::XDispatchProviderInterception,
+ ::com::sun::star::view::XSelectionSupplier
+ > FmXGridControl_BASE;
+
+class FmXGridPeer;
+class SVX_DLLPUBLIC FmXGridControl :public UnoControl
+ ,public FmXGridControl_BASE
+{
+ FmXModifyMultiplexer m_aModifyListeners;
+ FmXUpdateMultiplexer m_aUpdateListeners;
+ FmXContainerMultiplexer m_aContainerListeners;
+ FmXSelectionMultiplexer m_aSelectionListeners;
+ FmXGridControlMultiplexer m_aGridControlListeners;
+
+protected:
+ sal_uInt16 m_nPeerCreationLevel;
+ sal_Bool m_bInDraw;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+
+public:
+ FmXGridControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
+ virtual ~FmXGridControl();
+
+ // UNO connection
+ DECLARE_UNO3_AGG_DEFAULTS(FmXGridControl, UnoControl);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
+
+// XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::lang::XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::lang::XServiceInfo
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw();
+ virtual OUString SAL_CALL getImplementationName() throw();
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw();
+
+// ::com::sun::star::awt::XControl
+ virtual void SAL_CALL createPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& _rToolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDesignMode(sal_Bool bOn) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::awt::XView
+ virtual void SAL_CALL draw( sal_Int32 x, sal_Int32 y ) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::form::XBoundComponent
+ virtual void SAL_CALL addUpdateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XUpdateListener >& l) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeUpdateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XUpdateListener >& l) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL commit() throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::container::XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::container::XEnumerationAccess
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration() throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::container::XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 _rIndex) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::form::XGridControl
+ virtual void SAL_CALL addGridControlListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XGridControlListener >& _listener ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeGridControlListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XGridControlListener >& _listener ) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::form::XGrid (base of XGridControl)
+ virtual sal_Int16 SAL_CALL getCurrentColumnPosition() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCurrentColumnPosition(sal_Int16 nPos) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::form::XGridFieldDataSupplier (base of XGridControl)
+ virtual ::com::sun::star::uno::Sequence< sal_Bool > SAL_CALL queryFieldDataType( const ::com::sun::star::uno::Type& xType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL queryFieldData( sal_Int32 nRow, const ::com::sun::star::uno::Type& xType ) throw(::com::sun::star::uno::RuntimeException);
+
+// UnoControl
+ virtual OUString GetComponentServiceName();
+
+// ::com::sun::star::util::XModifyBroadcaster
+ virtual void SAL_CALL addModifyListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& l) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeModifyListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& l) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::util::XModeSelector
+ virtual void SAL_CALL setMode(const OUString& Mode) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getMode() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL getSupportedModes() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsMode(const OUString& Mode) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::container::XContainer
+ virtual void SAL_CALL addContainerListener(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& l) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& l) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::frame::XDispatchProvider
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch(const ::com::sun::star::util::URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches(const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& aDescripts) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::frame::XDispatchProviderInterception
+ virtual void SAL_CALL registerDispatchProviderInterceptor(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& xInterceptor) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL releaseDispatchProviderInterceptor(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& xInterceptor) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::view::XSelectionSupplier
+ virtual sal_Bool SAL_CALL select( const ::com::sun::star::uno::Any& aSelection ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getSelection( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ virtual FmXGridPeer* imp_CreatePeer(Window* pParent);
+ // ImplCreatePeer would be better, but doesn't work because it's not exported
+
+};
+
+//==================================================================
+// FmXGridPeer -> Peer for the Gridcontrol
+//==================================================================
+typedef ::comphelper::ImplHelper19 < ::com::sun::star::form::XGridPeer,
+ ::com::sun::star::form::XBoundComponent,
+ ::com::sun::star::form::XGridControl,
+ ::com::sun::star::sdb::XRowSetSupplier,
+ ::com::sun::star::util::XModifyBroadcaster,
+ ::com::sun::star::beans::XPropertyChangeListener,
+ ::com::sun::star::container::XContainerListener,
+ ::com::sun::star::sdbc::XRowSetListener,
+ ::com::sun::star::form::XLoadListener,
+ ::com::sun::star::view::XSelectionChangeListener,
+ ::com::sun::star::container::XIndexAccess,
+ ::com::sun::star::container::XEnumerationAccess,
+ ::com::sun::star::util::XModeSelector,
+ ::com::sun::star::container::XContainer,
+ ::com::sun::star::frame::XStatusListener,
+ ::com::sun::star::frame::XDispatchProvider,
+ ::com::sun::star::frame::XDispatchProviderInterception,
+ ::com::sun::star::form::XResetListener,
+ ::com::sun::star::view::XSelectionSupplier
+ > FmXGridPeer_BASE;
+class FmGridControl;
+class SVX_DLLPUBLIC FmXGridPeer :public VCLXWindow
+ ,public FmXGridPeer_BASE
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > m_xColumns;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xCursor;
+ ::cppu::OInterfaceContainerHelper m_aModifyListeners,
+ m_aUpdateListeners,
+ m_aContainerListeners,
+ m_aSelectionListeners,
+ m_aGridControlListeners;
+
+ OUString m_aMode;
+ sal_Int32 m_nCursorListening;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > m_xFirstDispatchInterceptor;
+
+ sal_Bool m_bInterceptingDispatch;
+
+ sal_Bool* m_pStateCache;
+ // one bool for each supported url
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > * 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 GridListenerDelegator;
+ friend class GridListenerDelegator;
+ GridListenerDelegator* m_pGridListener;
+
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::osl::Mutex m_aMutex;
+
+public:
+ FmXGridPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
+ ~FmXGridPeer();
+
+ // spaeter Constructor, immer nach dem realen Constructor zu rufen !
+ void Create(Window* pParent, WinBits nStyle);
+
+// UNO connection
+ DECLARE_UNO3_DEFAULTS(FmXGridPeer, VCLXWindow);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
+
+// XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::lang::XUnoTunnel
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelImplementationId() throw();
+ static FmXGridPeer* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxIFace ) throw();
+ sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& _rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::form::XGridPeer
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setColumns( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& aColumns ) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::lang::XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::lang::XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::form::XBoundComponent
+ virtual void SAL_CALL addUpdateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XUpdateListener >& l) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeUpdateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XUpdateListener >& l) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL commit() throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::container::XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::container::XEnumerationAccess
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration() throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::container::XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 _rIndex) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::beans::XPropertyChangeListener
+ virtual void SAL_CALL SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::form::XLoadListener
+ virtual void SAL_CALL loaded(const ::com::sun::star::lang::EventObject& rEvent) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL unloaded(const ::com::sun::star::lang::EventObject& rEvent) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL unloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL reloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL reloaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::sdbc::XRowSetListener
+ virtual void SAL_CALL cursorMoved(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowChanged(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowSetChanged(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::container::XContainerListener
+ virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& Event) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& Event) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& Event) throw(::com::sun::star::uno::RuntimeException);
+
+// VCLXWindow
+ virtual void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ CreateAccessibleContext();
+
+// ::com::sun::star::form::XGridControl
+ virtual void SAL_CALL addGridControlListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XGridControlListener >& _listener ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeGridControlListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XGridControlListener >& _listener ) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::form::XGrid (base of XGridControl)
+ virtual sal_Int16 SAL_CALL getCurrentColumnPosition() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCurrentColumnPosition(sal_Int16 nPos) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::form::XGridFieldDataSupplier (base of XGridControl)
+ virtual ::com::sun::star::uno::Sequence< sal_Bool > SAL_CALL queryFieldDataType( const ::com::sun::star::uno::Type& xType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL queryFieldData( sal_Int32 nRow, const ::com::sun::star::uno::Type& xType ) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::sdb::XRowSetSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > SAL_CALL getRowSet() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setRowSet(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xDataSource) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::util::XModifyBroadcaster
+ virtual void SAL_CALL addModifyListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& l) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeModifyListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& l) throw(::com::sun::star::uno::RuntimeException);
+
+// UnoControl
+ virtual void SAL_CALL SAL_CALL setDesignMode(sal_Bool bOn) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isDesignMode() throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::view::XSelectionChangeListener
+ virtual void SAL_CALL selectionChanged(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException);
+
+ void CellModified();
+
+// PropertyListening
+ void updateGrid(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rDatabaseCursor);
+ void startCursorListening();
+ void stopCursorListening();
+
+// ::com::sun::star::util::XModeSelector
+ virtual void SAL_CALL setMode(const OUString& Mode) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getMode() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedModes() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsMode(const OUString& Mode) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::container::XContainer
+ virtual void SAL_CALL addContainerListener(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& l) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& l) throw(::com::sun::star::uno::RuntimeException);
+
+ void columnVisible(DbGridColumn* pColumn);
+ void columnHidden(DbGridColumn* pColumn);
+
+// ::com::sun::star::awt::XView
+ virtual void SAL_CALL draw( sal_Int32 x, sal_Int32 y ) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::frame::XDispatchProvider
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch(const ::com::sun::star::util::URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches(const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& aDescripts) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::frame::XDispatchProviderInterception
+ virtual void SAL_CALL registerDispatchProviderInterceptor(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& xInterceptor) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL releaseDispatchProviderInterceptor(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& xInterceptor) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::frame::XStatusListener
+ virtual void SAL_CALL statusChanged(const ::com::sun::star::frame::FeatureStateEvent& Event) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::form::XResetListener
+ virtual sal_Bool SAL_CALL approveReset(const ::com::sun::star::lang::EventObject& rEvent) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL resetted(const ::com::sun::star::lang::EventObject& rEvent) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::view::XSelectionSupplier
+ virtual sal_Bool SAL_CALL select( const ::com::sun::star::uno::Any& aSelection ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getSelection( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ virtual FmGridControl* imp_CreateControl(Window* pParent, WinBits nStyle);
+
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::util::URL>& getSupportedURLs();
+ static ::com::sun::star::uno::Sequence<sal_uInt16>& 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 overload all methods affecting columns (setColumns, elementInserted, elementRemoved ...)
+ Instead it may use addColumnListeners and removeColumnListeners which are called in all
+ the cases.
+ */
+ virtual void addColumnListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xCol);
+ virtual void removeColumnListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xCol);
+
+ void selectionChanged();
+ void columnChanged();
+
+ DECL_LINK(OnQueryGridSlotState, void*);
+ DECL_LINK(OnExecuteGridSlot, void*);
+};
+
+
+
+#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 000000000000..980f2a58e3d8
--- /dev/null
+++ b/include/svx/fmmodel.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 _SVX_FMMODEL_HXX
+#define _SVX_FMMODEL_HXX
+
+#include <svx/svdmodel.hxx>
+#include "svx/svxdllapi.h"
+
+class SfxObjectShell;
+class SfxItemPool;
+class FmXUndoEnvironment;
+class SfxObjectShell;
+class SbxObject;
+class SbxArray;
+class SbxValue;
+
+struct FmFormModelImplData;
+class SVX_DLLPUBLIC FmFormModel :
+ public SdrModel
+{
+private:
+ FmFormModelImplData* m_pImpl;
+ SfxObjectShell* m_pObjShell;
+
+ sal_Bool m_bOpenInDesignMode : 1;
+ sal_Bool m_bAutoControlFocus : 1;
+
+ SVX_DLLPRIVATE FmFormModel( const FmFormModel& ); // never implemented
+ SVX_DLLPRIVATE void operator=(const FmFormModel& rSrcModel); // never implemented
+
+public:
+ TYPEINFO();
+
+ FmFormModel(SfxItemPool* pPool=NULL, SfxObjectShell* pPers=NULL );
+ FmFormModel(const XubString& rPath, SfxItemPool* pPool=NULL,
+ SfxObjectShell* pPers=NULL );
+ FmFormModel(const XubString& rPath, SfxItemPool* pPool, SfxObjectShell* pPers,
+ bool bUseExtColorTable);
+
+ virtual ~FmFormModel();
+
+ virtual SdrPage* AllocPage(bool bMasterPage);
+ virtual void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
+ virtual SdrPage* RemovePage(sal_uInt16 nPgNum);
+ virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
+ virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
+ virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum);
+
+ virtual SdrLayerID GetControlExportLayerId( const SdrObject& rObj ) const;
+ SfxObjectShell* GetObjectShell() const { return m_pObjShell; }
+ void SetObjectShell( SfxObjectShell* pShell );
+
+ sal_Bool GetOpenInDesignMode() const { return m_bOpenInDesignMode; }
+ void SetOpenInDesignMode( sal_Bool _bOpenDesignMode );
+
+ sal_Bool GetAutoControlFocus() const { return m_bAutoControlFocus; }
+ void SetAutoControlFocus( sal_Bool _bAutoControlFocus );
+
+ /** check whether the OpenInDesignMode has been set explicitly or been loaded (<FALSE/>)
+ or if it still has the default value from construction (<TRUE/>)
+ */
+ sal_Bool OpenInDesignModeIsDefaulted();
+
+ /** determines whether form controls should use the SdrModel's reference device for text rendering
+ */
+ sal_Bool ControlsUseRefDevice() const;
+
+ FmXUndoEnvironment& GetUndoEnv();
+
+private:
+ void implSetOpenInDesignMode( sal_Bool _bOpenDesignMode, sal_Bool _bForce );
+};
+
+#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 000000000000..1686f891f357
--- /dev/null
+++ b/include/svx/fmobjfac.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 _SVX_FMOBJFAC_HXX
+#define _SVX_FMOBJFAC_HXX
+
+#include <tools/link.hxx>
+#include "svx/svxdllapi.h"
+
+class SdrObjFactory;
+
+
+
+class SVX_DLLPUBLIC FmFormObjFactory
+{
+public:
+ FmFormObjFactory();
+ ~FmFormObjFactory();
+
+ DECL_LINK(MakeObject, SdrObjFactory*);
+};
+
+
+
+
+#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 000000000000..ba3bdd13679d
--- /dev/null
+++ b/include/svx/fmpage.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 _SVX_FMPAGE_HXX
+#define _SVX_FMPAGE_HXX
+
+#include <svx/svdpage.hxx>
+#include <comphelper/uno3.hxx>
+#include "svx/svxdllapi.h"
+#include <tools/contnr.hxx>
+
+class StarBASIC;
+class FmFormModel;
+class FmFormPageImpl; // contains a list of all forms
+
+namespace com { namespace sun { namespace star {
+ namespace form {
+ class XForms;
+ }
+}}}
+
+class SdrView;
+class HelpEvent;
+
+class SVX_DLLPUBLIC FmFormPage : public SdrPage
+{
+ friend class FmFormObj;
+ FmFormPageImpl* m_pImpl;
+ String m_sPageName;
+ StarBASIC* m_pBasic;
+
+public:
+ TYPEINFO();
+
+ FmFormPage(FmFormModel& rModel,StarBASIC*, bool bMasterPage=sal_False);
+ FmFormPage(const FmFormPage& rPage);
+ ~FmFormPage();
+
+ virtual void SetModel(SdrModel* pNewModel);
+
+ virtual SdrPage* Clone() const;
+ using SdrPage::Clone;
+
+ virtual void InsertObject(SdrObject* pObj, sal_uLong nPos = CONTAINER_APPEND,
+ const SdrInsertReason* pReason=NULL);
+
+ virtual SdrObject* RemoveObject(sal_uLong nObjNum);
+
+ // access to all forms
+ const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForms>& GetForms( bool _bForceCreate = true ) const;
+
+ FmFormPageImpl& GetImpl() const { return *m_pImpl; }
+
+public:
+ const String& GetName() const { return m_sPageName; }
+ void SetName( const String& rName ) { m_sPageName = rName; }
+ StarBASIC* GetBasic() const { return m_pBasic; }
+ sal_Bool RequestHelp(
+ Window* pWin,
+ SdrView* pView,
+ const HelpEvent& rEvt );
+};
+
+#endif // _SVX_FMPAGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/fmresids.hrc b/include/svx/fmresids.hrc
new file mode 100644
index 000000000000..73cf4c043e7a
--- /dev/null
+++ b/include/svx/fmresids.hrc
@@ -0,0 +1,227 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_FMRESIDS_HRC
+#define _SVX_FMRESIDS_HRC
+
+#include <svl/solar.hrc>
+
+// unnamed resources -------------------------------------------------------
+// sub resources .....................
+
+// ImageList-Id's -----------------------------------------------------------
+#define RID_SVXIMGLIST_FMEXPL (RID_FORMS_START + 0)
+
+// Image-Id's -----------------------------------------------------------
+#define RID_SVXIMG_FORM SID_FM_CONFIG
+#define RID_SVXIMG_CONTROL SID_CHOOSE_CONTROLS
+#define RID_SVXIMG_COLLAPSEDNODE (RID_FORMS_START + 2)
+#define RID_SVXIMG_EXPANDEDNODE (RID_FORMS_START + 3)
+#define RID_SVXIMG_BUTTON SID_FM_PUSHBUTTON
+#define RID_SVXIMG_RADIOBUTTON SID_FM_RADIOBUTTON
+#define RID_SVXIMG_CHECKBOX SID_FM_CHECKBOX
+#define RID_SVXIMG_FIXEDTEXT SID_FM_FIXEDTEXT
+#define RID_SVXIMG_GROUPBOX SID_FM_GROUPBOX
+#define RID_SVXIMG_EDIT SID_FM_EDIT
+#define RID_SVXIMG_LISTBOX SID_FM_LISTBOX
+#define RID_SVXIMG_COMBOBOX SID_FM_COMBOBOX
+#define RID_SVXIMG_FORMS (RID_FORMS_START +13)
+#define RID_SVXIMG_IMAGEBUTTON SID_FM_IMAGEBUTTON
+#define RID_SVXIMG_IMAGECONTROL SID_FM_IMAGECONTROL
+#define RID_SVXIMG_FILECONTROL SID_FM_FILECONTROL
+#define RID_SVXIMG_DATEFIELD SID_FM_DATEFIELD
+#define RID_SVXIMG_TIMEFIELD SID_FM_TIMEFIELD
+#define RID_SVXIMG_NUMERICFIELD SID_FM_NUMERICFIELD
+#define RID_SVXIMG_CURRENCYFIELD SID_FM_CURRENCYFIELD
+#define RID_SVXIMG_PATTERNFIELD SID_FM_PATTERNFIELD
+#define RID_SVXIMG_HIDDEN (RID_FORMS_START +22)
+#define RID_SVXIMG_GRID SID_FM_DBGRID
+#define RID_SVXIMG_FORMATTEDFIELD SID_FM_FORMATTEDFIELD
+#define RID_SVXIMG_FILTER SID_FM_FILTERCRIT
+#define RID_SVXIMG_DATE_N_TIME_FIELDS SID_FM_TWOFIELDS_DATE_N_TIME
+#define RID_SVXIMG_FIELD (RID_FORMS_START +27)
+#define RID_SVXIMG_SCROLLBAR SID_FM_SCROLLBAR
+#define RID_SVXIMG_SPINBUTTON SID_FM_SPINBUTTON
+#define RID_SVXIMG_NAVIGATIONBAR SID_FM_NAVIGATIONBAR
+
+// Dialog-Id's -----------------------------------------------------------
+#define RID_SVXDLG_SETFORM (RID_FORMS_START + 5)
+#define RID_SVX_FMEXPLORER (RID_FORMS_START + 6)
+#define RID_SVXDLG_ADD_DATAITEM (RID_FORMS_START + 12)
+#define RID_SVXDLG_ADD_CONDITION (RID_FORMS_START + 13)
+#define RID_SVXDLG_NAMESPACE_ITEM (RID_FORMS_START + 14)
+#define RID_SVXDLG_MANAGE_NAMESPACE (RID_FORMS_START + 15)
+#define RID_SVXDLG_ADD_SUBMISSION (RID_FORMS_START + 16)
+#define RID_SVXDLG_ADD_MODEL (RID_FORMS_START + 17)
+#define RID_SVXDLG_ADD_INSTANCE (RID_FORMS_START + 18)
+#define RID_SVXWIN_DATANAVIGATOR (RID_FORMS_START + 19)
+#define RID_SVX_XFORMS_TABPAGES (RID_FORMS_START + 20)
+
+// Toolbars ------------------------------------------------------------
+#define RID_SVXTBX_FORM_NAVIGATION (RID_FORMS_START + 1)
+#define RID_SVXTBX_FORM_FILTER (RID_FORMS_START + 2)
+#define RID_SVXTBX_TEXT_CONTROL_ATTRIBUTES (RID_FORMS_START + 3)
+#define RID_SVXTBX_CONTROLS (RID_FORMS_START + 4)
+#define RID_SVXTBX_MORECONTROLS (RID_FORMS_START + 5)
+#define RID_SVXTBX_FORMDESIGN (RID_FORMS_START + 6)
+
+// Menu-Id's -----------------------------------------------------------
+#define RID_FMEXPLORER_POPUPMENU (RID_FORMS_START + 0)
+#define RID_SVXMNU_ROWS (RID_FORMS_START + 1)
+#define RID_SVXMNU_COLS (RID_FORMS_START + 2)
+#define RID_SVXMNU_CELL (RID_FORMS_START + 3)
+#define RID_FMSHELL_CONVERSIONMENU (RID_FORMS_START + 4)
+#define RID_FM_FILTER_MENU (RID_FORMS_START + 5)
+#define RID_FM_TEXTATTRIBUTE_MENU (RID_FORMS_START + 6)
+#define MENU_FM_TEXTATTRIBITES_STYLE (RID_FORMS_START + 7)
+#define MENU_FM_TEXTATTRIBITES_ALIGNMENT (RID_FORMS_START + 8)
+#define MENU_FM_TEXTATTRIBITES_SPACING (RID_FORMS_START + 9)
+#define RID_MENU_DATANAVIGATOR (RID_FORMS_START + 10)
+
+// QueryBox-Id's -----------------------------------------------------------
+#define RID_QRY_SAVEMODIFIED (RID_FORMS_START + 1)
+#define RID_QRY_REMOVE_MODEL (RID_FORMS_START + 2)
+#define RID_QRY_REMOVE_INSTANCE (RID_FORMS_START + 3)
+#define RID_QRY_REMOVE_ELEMENT (RID_FORMS_START + 4)
+#define RID_QRY_REMOVE_ATTRIBUTE (RID_FORMS_START + 5)
+#define RID_QRY_LINK_WARNING (RID_FORMS_START + 6)
+#define RID_QRY_REMOVE_SUBMISSION (RID_FORMS_START + 7)
+#define RID_QRY_REMOVE_BINDING (RID_FORMS_START + 8)
+
+// ErrorBox-Id's -----------------------------------------------------------
+#define RID_ERR_INVALID_XMLNAME (RID_FORMS_START + 1)
+#define RID_ERR_INVALID_XMLPREFIX (RID_FORMS_START + 2)
+#define RID_ERR_DOUBLE_MODELNAME (RID_FORMS_START + 3)
+#define RID_ERR_EMPTY_SUBMISSIONNAME (RID_FORMS_START + 4)
+
+// String-Id's -----------------------------------------------------------
+#define RID_STR_FORMSHELL (RID_FORMS_START + 10)
+#define RID_STR_STDFORMNAME (RID_FORMS_START + 11)
+#define RID_STR_REC_TEXT (RID_FORMS_START + 12)
+#define RID_STR_REC_FROM_TEXT (RID_FORMS_START + 13)
+#define RID_STR_UNDO_PROPERTY (RID_FORMS_START + 14)
+#define RID_STR_UNDO_CONTAINER_INSERT (RID_FORMS_START + 15)
+#define RID_STR_UNDO_CONTAINER_REMOVE (RID_FORMS_START + 16)
+#define RID_STR_UNDO_CONTAINER_REMOVE_MULTIPLE (RID_FORMS_START + 27)
+#define RID_STR_UNDO_CONTAINER_REPLACE (RID_FORMS_START + 28)
+#define RID_STR_UNDO_DELETE_LOGICAL (RID_FORMS_START + 30)
+#define RID_STR_UNDO_MODEL_REPLACE (RID_FORMS_START + 31)
+#define RID_STR_NAVIGATIONBAR (RID_FORMS_START + 32)
+#define RID_STR_FORM (RID_FORMS_START + 36)
+#define RID_STR_FIELDSELECTION (RID_FORMS_START + 37)
+#define RID_STR_NO_PROPERTIES (RID_FORMS_START + 38)
+#define RID_STR_PROPERTIES_CONTROL (RID_FORMS_START + 39)
+#define RID_STR_PROPERTIES_FORM (RID_FORMS_START + 40)
+#define RID_STR_FMEXPLORER (RID_FORMS_START + 41)
+#define RID_STR_FORMS (RID_FORMS_START + 42)
+#define RID_STR_WRITEERROR (RID_FORMS_START + 43)
+#define RID_STR_DELETECONFIRM_RECORD (RID_FORMS_START + 44)
+#define RID_STR_DELETECONFIRM (RID_FORMS_START + 45)
+#define RID_STR_GROUPBOX (RID_FORMS_START + 46)
+#define RID_STR_NAVIGATION (RID_FORMS_START + 47)
+#define RID_STR_COLUMN (RID_FORMS_START + 48)
+#define RID_STR_DATE (RID_FORMS_START + 49)
+#define RID_STR_TIME (RID_FORMS_START + 50)
+#define RID_STR_PROPTITLE_NAVBAR (RID_FORMS_START + 51)
+#define RID_STR_PROPTITLE_PUSHBUTTON (RID_FORMS_START + 52)
+#define RID_STR_PROPTITLE_RADIOBUTTON (RID_FORMS_START + 53)
+#define RID_STR_PROPTITLE_CHECKBOX (RID_FORMS_START + 54)
+#define RID_STR_PROPTITLE_FIXEDTEXT (RID_FORMS_START + 55)
+#define RID_STR_PROPTITLE_GROUPBOX (RID_FORMS_START + 56)
+#define RID_STR_PROPTITLE_EDIT (RID_FORMS_START + 57)
+#define RID_STR_PROPTITLE_LISTBOX (RID_FORMS_START + 58)
+#define RID_STR_PROPTITLE_COMBOBOX (RID_FORMS_START + 59)
+#define RID_STR_PROPTITLE_IMAGEBUTTON (RID_FORMS_START + 60)
+#define RID_STR_PROPTITLE_IMAGECONTROL (RID_FORMS_START + 61)
+#define RID_STR_PROPTITLE_FILECONTROL (RID_FORMS_START + 62)
+#define RID_STR_PROPTITLE_DATEFIELD (RID_FORMS_START + 63)
+#define RID_STR_PROPTITLE_TIMEFIELD (RID_FORMS_START + 64)
+#define RID_STR_PROPTITLE_NUMERICFIELD (RID_FORMS_START + 65)
+#define RID_STR_PROPTITLE_CURRENCYFIELD (RID_FORMS_START + 66)
+#define RID_STR_PROPTITLE_PATTERNFIELD (RID_FORMS_START + 67)
+#define RID_STR_PROPTITLE_DBGRID (RID_FORMS_START + 68)
+#define RID_STR_PROPTITLE_MULTISELECT (RID_FORMS_START + 69)
+#define RID_STR_DELETECONFIRM_RECORDS (RID_FORMS_START + 70)
+#define RID_STR_CONTROL (RID_FORMS_START + 71)
+#define RID_STR_POSTFIX_DATE (RID_FORMS_START + 72)
+#define RID_STR_POSTFIX_TIME (RID_FORMS_START + 73)
+#define RID_STR_NODATACONTROLS (RID_FORMS_START + 77)
+#define RID_STR_FILTER_NAVIGATOR (RID_FORMS_START + 78)
+#define RID_STR_FILTER_FILTER_FOR (RID_FORMS_START + 79)
+#define RID_STR_FILTER_FILTER_OR (RID_FORMS_START + 80)
+#define RID_STR_PROPTITLE_FORMATTED (RID_FORMS_START + 81)
+#define RID_STR_SYNTAXERROR (RID_FORMS_START + 82)
+ // FREE
+#define RID_STR_NOCONTROLS_FOR_EXTERNALDISPLAY (RID_FORMS_START + 84)
+#define RID_STR_AUTOFIELD (RID_FORMS_START + 89)
+#define RID_STR_SVT_SQL_SYNTAX_ERROR (RID_FORMS_START + 90)
+#define RID_STR_SVT_SQL_SYNTAX_VALUE_NO_LIKE (RID_FORMS_START + 91)
+#define RID_STR_SVT_SQL_SYNTAX_FIELD_NO_LIKE (RID_FORMS_START + 92)
+#define RID_STR_SVT_SQL_SYNTAX_CRIT_NO_COMPARE (RID_FORMS_START + 93)
+#define RID_STR_SVT_SQL_SYNTAX_INT_NO_VALID (RID_FORMS_START + 94)
+#define RID_STR_SVT_SQL_SYNTAX_ACCESS_DAT_NO_VALID (RID_FORMS_START + 95)
+#define RID_STR_SVT_SQL_SYNTAX_REAL_NO_VALID (RID_FORMS_START + 96)
+#define RID_STR_SVT_SQL_SYNTAX_TABLE (RID_FORMS_START + 97)
+#define RID_STR_SVT_SQL_SYNTAX_COLUMN (RID_FORMS_START + 98)
+#define RID_STR_PROPTITLE_SCROLLBAR (RID_FORMS_START + 99)
+#define RID_STR_PROPTITLE_SPINBUTTON (RID_FORMS_START + 100)
+#define RID_STR_PROPTITLE_HIDDEN (RID_FORMS_START + 101)
+ // FREE
+#define RID_STR_DATANAVIGATOR (RID_FORMS_START + 124)
+#define RID_STR_DATANAV_SUBM_PARENT (RID_FORMS_START + 125)
+#define RID_STR_DATANAV_SUBM_ID (RID_FORMS_START + 126)
+#define RID_STR_DATANAV_SUBM_ACTION (RID_FORMS_START + 127)
+#define RID_STR_DATANAV_SUBM_METHOD (RID_FORMS_START + 128)
+#define RID_STR_DATANAV_SUBM_REF (RID_FORMS_START + 129)
+#define RID_STR_DATANAV_SUBM_BIND (RID_FORMS_START + 130)
+#define RID_STR_DATANAV_SUBM_REPLACE (RID_FORMS_START + 131)
+#define RID_STR_DATANAV_ADD_ELEMENT (RID_FORMS_START + 132)
+#define RID_STR_DATANAV_EDIT_ELEMENT (RID_FORMS_START + 133)
+#define RID_STR_DATANAV_REMOVE_ELEMENT (RID_FORMS_START + 134)
+#define RID_STR_DATANAV_ADD_ATTRIBUTE (RID_FORMS_START + 135)
+#define RID_STR_DATANAV_EDIT_ATTRIBUTE (RID_FORMS_START + 136)
+#define RID_STR_DATANAV_REMOVE_ATTRIBUTE (RID_FORMS_START + 137)
+#define RID_STR_DATANAV_ADD_BINDING (RID_FORMS_START + 138)
+#define RID_STR_DATANAV_EDIT_BINDING (RID_FORMS_START + 139)
+#define RID_STR_DATANAV_REMOVE_BINDING (RID_FORMS_START + 140)
+#define RID_STR_DATANAV_ADD_SUBMISSION (RID_FORMS_START + 141)
+#define RID_STR_DATANAV_EDIT_SUBMISSION (RID_FORMS_START + 142)
+#define RID_STR_DATANAV_REMOVE_SUBMISSION (RID_FORMS_START + 143)
+#define RID_STR_DATANAV_LINKWARN_BUTTON (RID_FORMS_START + 144)
+#define RID_STR_SVT_SQL_SYNTAX_TABLE_OR_QUERY (RID_FORMS_START + 145)
+#define RID_STR_SVT_SQL_SYNTAX_TABLE_EXISTS (RID_FORMS_START + 146)
+#define RID_STR_SVT_SQL_SYNTAX_QUERY_EXISTS (RID_FORMS_START + 147)
+#define RID_STR_READONLY_VIEW (RID_FORMS_START + 148)
+#define RID_STR_ALREADYEXISTOVERWRITE (RID_FORMS_START + 149)
+#define RID_STR_OBJECT_LABEL (RID_FORMS_START + 150)
+
+// Error-String-Id's -----------------------------------------------------------
+#define RID_ERR_START (RID_FORMS_START + 600)
+#define RID_ERR_CONTEXT_ADDFORM (RID_ERR_START + 0)
+#define RID_ERR_DUPLICATE_NAME (RID_ERR_START + 1)
+#define RID_ERR_FIELDREQUIRED (RID_ERR_START + 2)
+#define RID_ERR_NO_ELEMENT (RID_ERR_START + 4)
+
+// untyped resources ----------------------------------------------------------
+
+#define RID_RSC_TABWIN_PREFIX ( RID_FORMS_START + 0 )
+#define RID_RSC_SQL_INTERNATIONAL ( RID_FORMS_START + 1 )
+
+#endif // _FM_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 000000000000..2cd75167ea05
--- /dev/null
+++ b/include/svx/fmsearch.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 _FMSEARCH_HXX
+#define _FMSEARCH_HXX
+
+#include <com/sun/star/sdbc/XResultSet.hpp>
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/combobox.hxx>
+#include <vcl/lstbox.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/stl_types.hxx>
+#include <tools/string.hxx>
+#include "svx/svxdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace util {
+ class XNumberFormatsSupplier;
+ }
+}}}
+
+// ===================================================================================================
+// Hilfsmethoden
+
+SVX_DLLPUBLIC sal_Bool IsSearchableControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xControl,
+ OUString* pCurrentText = NULL);
+ // 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)
+
+// ===================================================================================================
+// Hilfsstrukturen
+
+struct FmFoundRecordInformation
+{
+ ::com::sun::star::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)
+};
+
+// ===================================================================================================
+// = struct FmSearchContext - information for the search in different contexts
+// ===================================================================================================
+
+struct FmSearchContext
+{
+ // [in]
+ sal_Int16 nContext; // the number of the context
+ // [out]
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> xCursor; // the iterator for the context
+ String strUsedFields; // a list of field names separeted by ';'
+ ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >
+ arrFields; // the corresponding text interfaces for the fields in strUsedFields
+ String sFieldDisplayNames; // if not empty : names to be displayed for the searchable fields (must have the same token count as strUsedFields !)
+};
+
+#endif // _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 000000000000..c6091aa4ba24
--- /dev/null
+++ b/include/svx/fmshell.hxx
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_FMSHELL_HXX
+#define _SVX_FMSHELL_HXX
+
+// ***************************************************************************************************
+// ***************************************************************************************************
+// ***************************************************************************************************
+
+#include <sfx2/shell.hxx>
+#include <sfx2/module.hxx>
+#include <vcl/event.hxx>
+
+#include <svx/svxids.hrc>
+#include <svx/fmview.hxx>
+#include "svx/svxdllapi.h"
+
+#include <svx/ifaceids.hxx>
+
+//========================================================================
+class FmFormModel;
+class FmFormPage;
+class FmXFormShell;
+class FmFormView;
+class SdrView;
+class SdrPage;
+class SdrUnoObj;
+
+namespace com { namespace sun { namespace star { namespace form {
+ class XForm;
+ namespace runtime {
+ class XFormController;
+ }
+} } } }
+
+namespace svx
+{
+ class ISdrObjectFilter;
+}
+
+//========================================================================
+class SVX_DLLPUBLIC FmDesignModeChangedHint : public SfxHint
+{
+ sal_Bool m_bDesignMode;
+
+public:
+ TYPEINFO();
+ FmDesignModeChangedHint( sal_Bool bDesMode );
+ virtual ~FmDesignModeChangedHint();
+
+ sal_Bool GetDesignMode() const { return m_bDesignMode; }
+};
+
+//========================================================================
+class SVX_DLLPUBLIC FmFormShell : public SfxShell
+{
+ friend class FmFormView;
+ friend class FmXFormShell;
+
+ FmXFormShell* m_pImpl;
+ FmFormView* m_pFormView;
+ FmFormModel* m_pFormModel;
+ SfxViewShell* m_pParentShell;
+
+ sal_uInt16 m_nLastSlot;
+ sal_Bool m_bDesignMode : 1;
+ sal_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)
+
+ class FormShellWaitObject
+ {
+ Window* m_pWindow;
+ public:
+ FormShellWaitObject(const FmFormShell* _pShell);
+ ~FormShellWaitObject();
+ };
+ friend class FormShellWaitObject;
+
+ const OutputDevice* GetCurrentViewDevice() const { return m_pFormView ? m_pFormView->GetActualOutDev() : NULL; }
+
+public:
+ SFX_DECL_INTERFACE(SVX_INTERFACE_FORM_SH)
+ TYPEINFO();
+
+ FmFormShell(SfxViewShell* pParent, FmFormView* pView = NULL);
+ virtual ~FmFormShell();
+
+ virtual void Execute( SfxRequest& );
+ virtual void GetState( SfxItemSet& );
+ virtual sal_Bool HasUIFeature( sal_uInt32 nFeature );
+
+ void ExecuteTextAttribute( SfxRequest& );
+ void GetTextAttributeState( SfxItemSet& );
+
+ sal_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;};
+
+ sal_uInt16 PrepareClose(sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False);
+
+ bool IsActiveControl() const;
+ void ForgetActiveControl();
+ void SetControlActivationHandler( const Link& _rHdl );
+
+ virtual void Activate(sal_Bool bMDI);
+ virtual void Deactivate(sal_Bool bMDI);
+
+ // helper methods for implementing XFormLayerAccess
+ SdrUnoObj* GetFormControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxModel,
+ const SdrView& _rView,
+ const OutputDevice& _rDevice,
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _out_rxControl
+ ) const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > GetFormController(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm,
+ const SdrView& _rView,
+ const OutputDevice& _rDevice
+ ) const;
+
+ /** 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;
+
+ ::std::auto_ptr< ::svx::ISdrObjectFilter >
+ CreateFocusableControlFilter(
+ const SdrView& i_rView,
+ const OutputDevice& i_rDevice
+ ) const;
+
+ sal_Bool IsDesignMode() const { return m_bDesignMode; }
+ void SetDesignMode( sal_Bool _bDesignMode );
+
+protected:
+ void GetFormState(SfxItemSet &rSet, sal_uInt16 nWhich);
+
+ // is there a form on the current page?
+ void DetermineForms(sal_Bool bInvalidate);
+ void impl_setDesignMode( sal_Bool bDesign);
+};
+
+// ***************************************************************************************************
+// ***************************************************************************************************
+// ***************************************************************************************************
+
+#endif // _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 000000000000..8ad3d2edc569
--- /dev/null
+++ b/include/svx/fmsrccfg.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 _FMSRCCF_HXX_
+#define _FMSRCCF_HXX_
+
+#include <unotools/configvaluecontainer.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include "svx/svxdllapi.h"
+
+// ===================================================================================================
+
+#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:
+ sal_Int32 nTransliterationFlags;
+ // they're way too sensitive for direct access ....
+
+ public:
+ // no bit fields at all (want to pass the addresses to the OConfigurationValueContainer)
+ ::com::sun::star::uno::Sequence< OUString >
+ aHistory;
+ OUString sSingleSearchField;
+
+ sal_Int16 nSearchForType;
+ sal_Int16 nPosition;
+ sal_Int16 nLevOther;
+ sal_Int16 nLevShorter;
+ sal_Int16 nLevLonger;
+ sal_Bool bLevRelaxed;
+
+ sal_Bool bAllFields;
+ sal_Bool bUseFormatter;
+ sal_Bool bBackwards;
+ sal_Bool bWildcard;
+ sal_Bool bRegular;
+ sal_Bool bApproxSearch;
+ // the last three are mutually exclusive
+
+ sal_Bool bSoundsLikeCJK;
+
+ // ......................................
+ FmSearchParams();
+
+ sal_Bool isIgnoreWidthCJK( ) const;
+
+ sal_Int32 getTransliterationFlags( ) const { return nTransliterationFlags; }
+ void setTransliterationFlags( sal_Int32 _nFlags ) { nTransliterationFlags = _nFlags; }
+
+ sal_Bool isCaseSensitive( ) const;
+ void setCaseSensitive( sal_Bool _bCase );
+ };
+
+ // ===================================================================================================
+ // = class FmSearchConfigItem - a ConfigItem, that remembers search parameters
+ // ===================================================================================================
+
+ class 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;
+
+ sal_Bool m_bIsMatchCase;
+ sal_Bool m_bIsMatchFullHalfWidthForms;
+ sal_Bool m_bIsMatchHiraganaKatakana;
+ sal_Bool m_bIsMatchContractions;
+ sal_Bool m_bIsMatchMinusDashCho_on;
+ sal_Bool m_bIsMatchRepeatCharMarks;
+ sal_Bool m_bIsMatchVariantFormKanji;
+ sal_Bool m_bIsMatchOldKanaForms;
+ sal_Bool m_bIsMatch_DiZi_DuZu;
+ sal_Bool m_bIsMatch_BaVa_HaFa;
+ sal_Bool m_bIsMatch_TsiThiChi_DhiZi;
+ sal_Bool m_bIsMatch_HyuIyu_ByuVyu;
+ sal_Bool m_bIsMatch_SeShe_ZeJe;
+ sal_Bool m_bIsMatch_IaIya;
+ sal_Bool m_bIsMatch_KiKu;
+ sal_Bool m_bIsIgnorePunctuation;
+ sal_Bool m_bIsIgnoreWhitespace;
+ sal_Bool m_bIsIgnoreProlongedSoundMark;
+ sal_Bool m_bIsIgnoreMiddleDot;
+
+ public:
+ FmSearchConfigItem();
+ ~FmSearchConfigItem();
+
+ const FmSearchParams& getParams( ) const;
+ void setParams( const FmSearchParams& _rParams );
+
+ private:
+ SVX_DLLPRIVATE void implTranslateFromConfig( );
+ SVX_DLLPRIVATE void implTranslateToConfig( );
+ };
+
+//........................................................................
+} // namespace svxform
+//........................................................................
+
+// ===================================================================================================
+
+#endif // _FMSRCCF_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 000000000000..6fc1a2aeaa4e
--- /dev/null
+++ b/include/svx/fmsrcimp.hxx
@@ -0,0 +1,390 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _FMSRCIMP_HXX
+#define _FMSRCIMP_HXX
+
+#include <svx/fmtools.hxx>
+#include "svx/svxdllapi.h"
+
+#include <com/sun/star/awt/XCheckBox.hpp>
+#include <com/sun/star/awt/XListBox.hpp>
+#include <com/sun/star/awt/XTextComponent.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/util/XNumberFormatter.hpp>
+
+#include <comphelper/stl_types.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <osl/mutex.hxx>
+#include <unotools/charclass.hxx>
+#include <unotools/collatorwrapper.hxx>
+#include <osl/thread.hxx>
+
+#include <deque>
+
+// ===================================================================================================
+// = class FmSearchThread
+// ===================================================================================================
+
+class FmSearchEngine;
+class FmSearchThread : public ::osl::Thread
+{
+ FmSearchEngine* m_pEngine;
+ Link m_aTerminationHdl;
+
+ virtual void SAL_CALL run();
+ virtual void SAL_CALL onTerminated();
+
+public:
+ FmSearchThread(FmSearchEngine* pEngine) : m_pEngine(pEngine) { }
+ void setTerminationHandler(Link aHdl) { m_aTerminationHdl = aHdl; }
+};
+
+// ===================================================================================================
+// = struct FmSearchProgress - the owner of SearchEngine receives this structure for status updates
+// = (at the end of the search)
+// ===================================================================================================
+
+struct FmSearchProgress
+{
+ enum STATE { STATE_PROGRESS, STATE_PROGRESS_COUNTING, STATE_CANCELED, STATE_SUCCESSFULL, STATE_NOTHINGFOUND, STATE_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
+ sal_Bool bOverflow;
+
+ // the position of the search cursor - valid in case of STATE_SUCCESSFULL, STATE_CANCELED and STATE_NOTHING_FOUND
+ ::com::sun::star::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 FmRecordCountListener : public ::cppu::WeakImplHelper1< ::com::sun::star::beans::XPropertyChangeListener>
+{
+// attribute
+ Link m_lnkWhoWantsToKnow;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xListening;
+
+// attribute access
+public:
+ Link SetPropChangeHandler(const Link& lnk);
+
+// methods
+public:
+ FmRecordCountListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& dbcCursor);
+ // the set has to support the sdb::ResultSet service
+ virtual ~FmRecordCountListener();
+
+ // DECLARE_UNO3_AGG_DEFAULTS(FmPropertyListener, UsrObject);
+ // virtual sal_Bool queryInterface(::com::sun::star::uno::Uik aUik, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rOut);
+
+// ::com::sun::star::lang::XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
+
+// ::com::sun::star::beans::XPropertyChangeListener
+ virtual void SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
+
+ 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 : ::com::sun::star::awt::XTextComponent, ::com::sun::star::awt::XListBox, ::com::sun::star::awt::XCheckBox.
+ // While searching we don't want to do this distinction for every control in every round. So we need some helpers.
+ class ControlTextWrapper
+ {
+ // attributes
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xControl;
+ // attribute access
+ public:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getControl() const{ return m_xControl; }
+ public:
+ ControlTextWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xControl) { m_xControl = _xControl; }
+ virtual ~ControlTextWrapper() { }
+
+ virtual OUString getCurrentText() const = 0;
+ };
+ class SimpleTextWrapper : public ControlTextWrapper
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextComponent > m_xText;
+ public:
+ SimpleTextWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextComponent >& _xText);
+ virtual OUString getCurrentText() const;
+ };
+ class ListBoxWrapper : public ControlTextWrapper
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XListBox > m_xBox;
+ public:
+ ListBoxWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XListBox >& _xBox);
+ virtual OUString getCurrentText() const;
+ };
+ class CheckBoxWrapper : public ControlTextWrapper
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XCheckBox > m_xBox;
+ public:
+ CheckBoxWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XCheckBox >& _xBox);
+ virtual OUString getCurrentText() const;
+ };
+}
+
+enum FMSEARCH_MODE { SM_BRUTE, SM_ALLOWSCHEDULE, SM_USETHREAD };
+
+DECLARE_STL_VECTOR( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>, InterfaceArray);
+
+class SVX_DLLPUBLIC FmSearchEngine
+{
+ friend class FmSearchThread;
+
+ enum SEARCH_RESULT { SR_FOUND, SR_NOTFOUND, SR_ERROR, SR_CANCELED };
+ enum SEARCHFOR_TYPE { SEARCHFOR_STRING, SEARCHFOR_NULL, SEARCHFOR_NOTNULL };
+
+ CursorWrapper m_xSearchCursor;
+ std::deque<sal_Int32> m_arrFieldMapping;
+ // since the iterator could have more columns, as managed here (in this field listbox),
+ // a mapping of this ::com::sun::star::form keys on the indices of the respective columns is kept in the iterator
+
+ // the formatter
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > m_xFormatSupplier;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter;
+
+ CharClass m_aCharacterClassficator;
+ CollatorWrapper m_aStringCompare;
+
+ // the collection of all interesting fields (or their ::com::sun::star::data::XDatabaseVariant interfaces and FormatKeys)
+ struct FieldInfo
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn > xContents;
+ sal_uInt32 nFormatKey;
+ sal_Bool bDoubleHandling;
+ };
+
+ DECLARE_STL_VECTOR(FieldInfo, FieldCollection);
+ FieldCollection m_arrUsedFields;
+ sal_Int32 m_nCurrentFieldIndex; // the last parameter of RebuildUsedFields, it allows checks in FormatField
+
+ DECLARE_STL_VECTOR(svxform::ControlTextWrapper*, ControlTextSuppliers);
+ ControlTextSuppliers m_aControlTexts;
+
+ sal_Bool m_bUsingTextComponents;
+ CursorWrapper m_xOriginalIterator;
+ CursorWrapper m_xClonedIterator;
+
+ // data for the decision in which field a "Found" is accepted
+ ::com::sun::star::uno::Any m_aPreviousLocBookmark; // position of the last finding
+ FieldCollectionIterator m_iterPreviousLocField; // field of the last finding
+
+ // Kommunikation mit dem Thread, der die eigentliche Suche durchfuehrt
+ OUString m_strSearchExpression; // forward direction
+ SEARCHFOR_TYPE m_eSearchForType; // ditto
+ SEARCH_RESULT m_srResult; // backward direction
+
+ // der Link, dem ich Fortschritte und Ergebnisse mitteile
+ Link m_aProgressHandler;
+ sal_Bool m_bSearchingCurrently : 1; // is an (asynchronous) search running?
+ sal_Bool m_bCancelAsynchRequest : 1; // should be cancelled ?
+ ::osl::Mutex m_aCancelAsynchAccess; // access to_bCancelAsynchRequest (technically only
+ // relevant for m_eMode == SM_USETHREAD)
+ FMSEARCH_MODE m_eMode; // current mode
+
+ // parameters for the search
+ sal_Bool m_bFormatter : 1; // use field formatting
+ sal_Bool m_bForward : 1; // direction
+ sal_Bool m_bWildcard : 1; // wildcard search
+ sal_Bool m_bRegular : 1; // regular expression
+ sal_Bool m_bLevenshtein : 1; // Levenshtein search
+ sal_Bool m_bTransliteration : 1; // Levenshtein search
+
+ sal_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
+
+ sal_Int32 m_nTransliterationFlags;
+
+// -------------
+// member access
+private:
+ SVX_DLLPRIVATE sal_Bool CancelRequested(); // provides a through m_aCancelAsynchAccess backed interpretation of m_bCancelAsynchRequest
+
+public:
+ void SetCaseSensitive(sal_Bool bSet);
+ sal_Bool GetCaseSensitive() const;
+
+ void SetFormatterUsing(sal_Bool bSet); // this is somewhat more extensive, so no inline ... here
+ sal_Bool GetFormatterUsing() const { return m_bFormatter; }
+
+ void SetDirection(sal_Bool bForward) { m_bForward = bForward; }
+ sal_Bool GetDirection() const { return m_bForward; }
+
+ void SetWildcard(sal_Bool bSet) { m_bWildcard = bSet; }
+ sal_Bool GetWildcard() const { return m_bWildcard; }
+
+ void SetRegular(sal_Bool bSet) { m_bRegular = bSet; }
+ sal_Bool GetRegular() const { return m_bRegular; }
+
+ void SetLevenshtein(sal_Bool bSet) { m_bLevenshtein = bSet; }
+ sal_Bool GetLevenshtein() const { return m_bLevenshtein; }
+
+ void SetIgnoreWidthCJK(sal_Bool bSet);
+ sal_Bool GetIgnoreWidthCJK() const;
+
+ void SetTransliteration(sal_Bool bSet) { m_bTransliteration = bSet; }
+ sal_Bool GetTransliteration() const { return m_bTransliteration; }
+
+ void SetLevRelaxed(sal_Bool bSet) { m_bLevRelaxed = bSet; }
+ sal_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(sal_Int32 _nFlags) { m_nTransliterationFlags = _nFlags; }
+ sal_Int32 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
+
+ FMSEARCH_MODE GetSearchMode() const { return m_eMode; }
+
+public:
+ /** two constructs, both analogical to FmSearchDialog, therefore look this up for explanations ....
+ xCursor has to implement ::com::sun::star::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 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& xCursor,
+ const OUString& strVisibleFields,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xFormat,
+ FMSEARCH_MODE eMode);
+ FmSearchEngine(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& xCursor,
+ const OUString& strVisibleFields,
+ const InterfaceArray& arrFields,
+ FMSEARCH_MODE eMode);
+
+ virtual ~FmSearchEngine();
+
+ /** 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(sal_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(sal_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, sal_Bool bForce = sal_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
+ */
+ sal_Bool SwitchToContext(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& xCursor, const OUString& strVisibleFields, const InterfaceArray& arrFields,
+ sal_Int32 nFieldIndex);
+
+protected:
+ 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();
+
+private:
+ SVX_DLLPRIVATE void clearControlTexts();
+ 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 do do a distinction only once per search (before
+ // starting the loop), not in every loop step
+ SVX_DLLPRIVATE SEARCH_RESULT SearchSpecial(sal_Bool _bSearchForNull, sal_Int32& nFieldPos, FieldCollectionIterator& iterFieldLoop,
+ const FieldCollectionIterator& iterBegin, const FieldCollectionIterator& iterEnd);
+ SVX_DLLPRIVATE SEARCH_RESULT SearchWildcard(const OUString& strExpression, sal_Int32& nFieldPos, FieldCollectionIterator& iterFieldLoop,
+ const FieldCollectionIterator& iterBegin, const FieldCollectionIterator& iterEnd);
+ SVX_DLLPRIVATE SEARCH_RESULT SearchRegularApprox(const OUString& strExpression, sal_Int32& nFieldPos, FieldCollectionIterator& iterFieldLoop,
+ const FieldCollectionIterator& iterBegin, const FieldCollectionIterator& iterEnd);
+
+ SVX_DLLPRIVATE void PropagateProgress(sal_Bool _bDontPropagateOverflow);
+ // call the ProgressHandler with STATE_PROGRESS and the current position of the search iterator
+
+ // helpers, that are needed several times
+ SVX_DLLPRIVATE sal_Bool MoveCursor();
+ // moves m_xSearchIterator with respect to direction/overflow cursor
+ SVX_DLLPRIVATE sal_Bool MoveField(sal_Int32& nPos, FieldCollectionIterator& iter, const FieldCollectionIterator& iterBegin, const FieldCollectionIterator& iterEnd);
+ // moves the iterator with respect to the direction/overflow iterator/overflow cursor
+ SVX_DLLPRIVATE void BuildAndInsertFieldInfo(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xAllFields, sal_Int32 nField);
+ // builds a FieldInfo in relation to field number nField (in xAllFields) and adds it to m_arrUsedFields
+ // xAllFields needs to support the DatabaseRecord service
+ SVX_DLLPRIVATE OUString FormatField(const FieldInfo& rField);
+ // formats the field with the NumberFormatter
+
+ SVX_DLLPRIVATE sal_Bool HasPreviousLoc() { return m_aPreviousLocBookmark.hasValue(); }
+
+ DECL_LINK(OnSearchTerminated, FmSearchThread*);
+ // is used by SearchThread, after the return from this handler the thread removes itself
+ DECL_LINK(OnNewRecordCount, void*);
+};
+
+#endif // _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 000000000000..bd24488c73a8
--- /dev/null
+++ b/include/svx/fmtools.hxx
@@ -0,0 +1,225 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_FMTOOLS_HXX
+#define _SVX_FMTOOLS_HXX
+
+#include "svx/svxdllapi.h"
+
+#include <com/sun/star/sdb/SQLContext.hpp>
+#include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp>
+#include <com/sun/star/sdbcx/Privilege.hpp>
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <com/sun/star/sdbc/XRowSet.hpp>
+#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
+#include <com/sun/star/sdb/XColumn.hpp>
+#include <com/sun/star/sdb/XColumnUpdate.hpp>
+#include <com/sun/star/sdb/SQLErrorEvent.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/sdbc/XResultSet.hpp>
+#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
+#include <com/sun/star/sdbcx/XRowLocate.hpp>
+#include <com/sun/star/sdbc/XDataSource.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
+#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XEnumeration.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/awt/XControlModel.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/FontSlant.hpp>
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/awt/FontUnderline.hpp>
+#include <com/sun/star/awt/FontStrikeout.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/io/XObjectInputStream.hpp>
+#include <com/sun/star/io/XObjectOutputStream.hpp>
+#include <com/sun/star/io/XPersistObject.hpp>
+#include <com/sun/star/util/XNumberFormatter.hpp>
+#include <com/sun/star/util/XNumberFormats.hpp>
+
+#include <tools/wintypes.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/stl_types.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+#include <set>
+
+class Window;
+
+//==================================================================
+// common types
+//==================================================================
+// displaying a database exception for the user
+// display info about a simple ::com::sun::star::sdbc::SQLException
+void displayException(const ::com::sun::star::sdbc::SQLException&, Window* _pParent = NULL);
+void displayException(const ::com::sun::star::sdbc::SQLWarning&, Window* _pParent = NULL);
+SVX_DLLPUBLIC void displayException(const ::com::sun::star::sdb::SQLContext&, Window* _pParent = NULL);
+void displayException(const ::com::sun::star::sdb::SQLErrorEvent&, Window* _pParent = NULL);
+void displayException(const ::com::sun::star::uno::Any&, Window* _pParent = NULL);
+
+sal_Int32 getElementPos(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& xCont, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElement);
+
+SVX_DLLPUBLIC OUString getLabelName(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xControlModel);
+
+// ===================================================================================================
+// = class CursorWrapper - a helper class which works in common with a ::com::sun::star::uno::Reference<XDatabaseUpdateCursor>,
+// XDatabaseBookmarkCursor and XDatabaseDirectCursor each
+// ===================================================================================================
+
+class CursorWrapper
+{
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xGeneric;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> m_xMoveOperations;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XRowLocate> m_xBookmarkOperations;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> m_xColumnsSupplier;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xPropertyAccess;
+
+public:
+ // Construction/Destruction
+ CursorWrapper() { }
+ CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxCursor, sal_Bool bUseCloned = sal_False);
+ SVX_DLLPUBLIC CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _rxCursor, sal_Bool bUseCloned = sal_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();
+ }
+
+ sal_Bool is() const { return m_xMoveOperations.is(); }
+ sal_Bool Is() const { return m_xMoveOperations.is(); }
+
+ CursorWrapper* operator ->() { return this; }
+ operator const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& () const{ return m_xGeneric; }
+
+ // 'Conversions'
+ const CursorWrapper& operator=(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& xCursor);
+ operator const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& () const { return m_xMoveOperations; }
+ operator const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XRowLocate>& () const { return m_xBookmarkOperations; }
+ operator const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier>& () const { return m_xColumnsSupplier; }
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& getPropertySet() const { return m_xPropertyAccess; }
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& getResultSet() const { return m_xMoveOperations; }
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XRowLocate >& getRowLocate() const { return m_xBookmarkOperations; }
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier >& getColumnsSupplier() const { return m_xColumnsSupplier; }
+
+ // the usual queryInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& type) throw ( ::com::sun::star::uno::RuntimeException )
+ { return m_xMoveOperations->queryInterface(type); }
+
+ // ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XRowLocate>
+ ::com::sun::star::uno::Any getBookmark(void)
+ throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException )
+ { return m_xBookmarkOperations->getBookmark(); }
+ sal_Bool moveToBookmark(const ::com::sun::star::uno::Any& bookmark) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ) { return m_xBookmarkOperations->moveToBookmark(bookmark); }
+ sal_Bool moveRelativeToBookmark(const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ) { return m_xBookmarkOperations->moveRelativeToBookmark(bookmark, rows); }
+ sal_Int32 compareBookmarks(const ::com::sun::star::uno::Any& lhs, const ::com::sun::star::uno::Any& rhs) const throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ) { return m_xBookmarkOperations->compareBookmarks(lhs, rhs); }
+ sal_Int32 hasOrderedBookmarks(void) const throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ) { return m_xBookmarkOperations->hasOrderedBookmarks(); }
+ sal_Int32 hashBookmark(const ::com::sun::star::uno::Any& bookmark) const throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ) { return m_xBookmarkOperations->hashBookmark(bookmark); }
+
+ // ::com::sun::star::sdbc::XResultSet
+ sal_Bool isBeforeFirst() const { return m_xMoveOperations->isBeforeFirst(); }
+ sal_Bool isAfterLast() const { return m_xMoveOperations->isAfterLast(); }
+ sal_Bool isFirst() const { return m_xMoveOperations->isFirst(); }
+ sal_Bool isLast() const { return m_xMoveOperations->isLast(); }
+ void beforeFirst() { m_xMoveOperations->beforeFirst(); }
+ sal_Bool first() { return m_xMoveOperations->first(); }
+ sal_Bool last() { return m_xMoveOperations->last(); }
+ sal_Int32 getRow() const { return m_xMoveOperations->getRow(); }
+ sal_Bool absolute(sal_Int32 nPosition) { return m_xMoveOperations->absolute(nPosition); }
+ sal_Bool relative(sal_Int32 nCount) { return m_xMoveOperations->relative(nCount); }
+ sal_Bool previous() { return m_xMoveOperations->previous(); }
+ sal_Bool next() { return m_xMoveOperations->next(); }
+ void refreshRow() { m_xMoveOperations->refreshRow(); }
+ sal_Bool rowUpdated() { return m_xMoveOperations->rowUpdated(); }
+ sal_Bool rowInserted() { return m_xMoveOperations->rowInserted(); }
+ sal_Bool rowDeleted() { return m_xMoveOperations->rowDeleted(); }
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> getStatement() { return m_xMoveOperations->getStatement(); }
+ // ::com::sun::star::sdbcx::XColumnsSupplier
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getColumns() const throw( ::com::sun::star::uno::RuntimeException ) { return m_xColumnsSupplier->getColumns(); }
+private:
+ void ImplConstruct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _rxCursor, sal_Bool bUseCloned);
+};
+
+
+class FmXDisposeMultiplexer;
+class FmXDisposeListener
+{
+ friend class FmXDisposeMultiplexer;
+
+ FmXDisposeMultiplexer* m_pAdapter;
+ ::osl::Mutex& m_rMutex;
+
+public:
+ FmXDisposeListener(::osl::Mutex& _rMutex) : m_pAdapter(NULL), m_rMutex(_rMutex) { }
+ virtual ~FmXDisposeListener();
+
+ virtual void disposing(const ::com::sun::star::lang::EventObject& _rEvent, sal_Int16 _nId) throw( ::com::sun::star::uno::RuntimeException ) = 0;
+
+protected:
+ void setAdapter(FmXDisposeMultiplexer* pAdapter);
+};
+
+//==============================================================================
+
+class FmXDisposeMultiplexer :public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener>
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> m_xObject;
+ FmXDisposeListener* m_pListener;
+ sal_Int16 m_nId;
+
+ virtual ~FmXDisposeMultiplexer();
+public:
+ FmXDisposeMultiplexer(FmXDisposeListener* _pListener, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>& _rxObject, sal_Int16 _nId = -1);
+
+// ::com::sun::star::lang::XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ void dispose();
+};
+
+// ==================================================================
+
+sal_Int16 getControlTypeByObject(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo>& _rxObject);
+ // get the object type (OBJ_FM_...) from the services the object supports
+
+//==================================================================
+sal_Bool isRowSetAlive(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rxRowSet);
+ // checks if the ::com::sun::star::sdbcx::XColumnsSupplier provided by _rxRowSet supllies any columns
+
+//==================================================================
+typedef ::std::set < ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ , ::comphelper::OInterfaceCompare< ::com::sun::star::uno::XInterface >
+ > InterfaceBag;
+
+#endif // _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 000000000000..07ce4c02c106
--- /dev/null
+++ b/include/svx/fmview.hxx
@@ -0,0 +1,164 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_FMVIEW_HXX
+#define _SVX_FMVIEW_HXX
+
+#include <svx/view3d.hxx>
+#include <comphelper/uno3.hxx>
+#include "svx/svxdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace beans {
+ class XPropertySet;
+ }
+ namespace util {
+ class XNumberFormats;
+ }
+}}}
+
+class OutputDevice;
+class FmFormModel;
+class FmFormObj;
+class FmFormPage;
+class FmFormShell;
+class FmXFormView;
+
+namespace svx {
+ class ODataAccessDescriptor;
+ struct OXFormsDescriptor;
+}
+
+class SdrUnoObj;
+namespace com { namespace sun { namespace star { namespace form {
+ class XForm;
+ namespace runtime {
+ class XFormController;
+ }
+} } } }
+
+class SVX_DLLPUBLIC FmFormView : public E3dView
+{
+ FmXFormView* pImpl;
+ FmFormShell* pFormShell;
+
+ void Init();
+
+public:
+ TYPEINFO();
+
+ FmFormView(FmFormModel* pModel, OutputDevice* pOut = 0L);
+ virtual ~FmFormView();
+
+ /** 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 a ODataAccessDescriptor instead.
+ */
+ SdrObject* CreateFieldControl(const OUString& rFieldDesc) const;
+
+ /** create a control pair (label/bound control) for the database field description given.
+ */
+ SdrObject* CreateFieldControl( const ::svx::ODataAccessDescriptor& _rColumnDescriptor );
+
+ /** create a control pair (label/bound control) for the xforms description given.
+ */
+ SdrObject* CreateXFormsControl( const ::svx::OXFormsDescriptor &_rDesc );
+
+ virtual void MarkListHasChanged();
+ virtual void AddWindowToPaintView(OutputDevice* pNewWin);
+ virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin);
+
+ static void createControlLabelPair(
+ OutputDevice* _pOutDev,
+ sal_Int32 _nXOffsetMM,
+ sal_Int32 _nYOffsetMM,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats >& _rxNumberFormats,
+ sal_uInt16 _nControlObjectID,
+ const OUString& _rFieldPostfix,
+ sal_uInt32 _nInventor,
+ sal_uInt16 _nLabelObjectID,
+ SdrPage* _pLabelPage,
+ SdrPage* _pControlPage,
+ SdrModel* _pModel,
+ SdrUnoObj*& _rpLabel,
+ SdrUnoObj*& _rpControl
+ );
+
+ virtual SdrPageView* ShowSdrPage(SdrPage* pPage);
+ virtual void HideSdrPage();
+
+ // for copying complete form structures, not only control models
+ virtual SdrModel* GetMarkedObjModel() const;
+ using E3dView::Paste;
+ virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+
+ virtual sal_Bool MouseButtonDown( const MouseEvent& _rMEvt, Window* _pWin );
+
+ /** grab the focus to the first form control on the view
+ @param _bForceSync
+ <TRUE/> if the handling should be done synchronously.
+ */
+ SVX_DLLPRIVATE void GrabFirstControlFocus( sal_Bool _bForceSync = sal_False );
+
+ /** returns the form controller for a given form and a given device
+ */
+ SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController >
+ GetFormController( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm, const OutputDevice& _rDevice ) const;
+
+ // SdrView
+ sal_Bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
+
+ /// shortcut to "GetSdrPageView() ? PTR_CAST( FmFormPage, GetSdrPageView() ) : NULL"
+ FmFormPage* GetCurPage();
+
+ SVX_DLLPRIVATE void ActivateControls(SdrPageView*);
+ SVX_DLLPRIVATE void DeactivateControls(SdrPageView*);
+
+ SVX_DLLPRIVATE void ChangeDesignMode(sal_Bool bDesign);
+
+ SVX_DLLPRIVATE FmXFormView* GetImpl() const { return pImpl; }
+ 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 ); }
+ virtual void InsertControlContainer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& xCC);
+ virtual void RemoveControlContainer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& xCC);
+
+ virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut);
+ virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer);
+
+ SVX_DLLPRIVATE const OutputDevice* GetActualOutDev() const {return pActualOutDev;}
+ SVX_DLLPRIVATE sal_Bool checkUnMarkAll(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xSource);
+
+private:
+ SVX_DLLPRIVATE void AdjustMarks(const SdrMarkList& rMarkList);
+ 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/fntctl.hxx b/include/svx/fntctl.hxx
new file mode 100644
index 000000000000..08f9f798b066
--- /dev/null
+++ b/include/svx/fntctl.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 _SVX_FNTCTL_HXX
+#define _SVX_FNTCTL_HXX
+
+#include <sfx2/mnuitem.hxx>
+#include <svl/lstner.hxx>
+#include "svx/svxdllapi.h"
+
+
+
+class FontNameMenu;
+class SfxBindings;
+
+// class SvxFontMenuControl ----------------------------------------------
+
+class SVX_DLLPUBLIC SvxFontMenuControl : public SfxMenuControl, public SfxListener
+{
+private:
+ FontNameMenu* pMenu;
+ Menu& rParent;
+
+ SVX_DLLPRIVATE void FillMenu();
+ DECL_LINK( MenuSelect, FontNameMenu * );
+ SVX_DLLPRIVATE virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ SVX_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+public:
+ SvxFontMenuControl( sal_uInt16 nId, Menu&, SfxBindings& );
+ ~SvxFontMenuControl();
+
+ virtual PopupMenu* GetPopup() const;
+
+ SFX_DECL_MENU_CONTROL();
+};
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/fntctrl.hxx b/include/svx/fntctrl.hxx
new file mode 100644
index 000000000000..cd8449117d76
--- /dev/null
+++ b/include/svx/fntctrl.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 _SVX_FNTCTRL_HXX
+#define _SVX_FNTCTRL_HXX
+
+#include <vcl/window.hxx>
+#include <editeng/svxfont.hxx>
+#include "svx/svxdllapi.h"
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
+
+#include <rtl/ustring.hxx>
+
+// forward ---------------------------------------------------------------
+
+class SfxItemSet;
+class FontPrevWin_Impl;
+
+// class SvxFontPrevWindow -----------------------------------------------
+
+class SVX_DLLPUBLIC SvxFontPrevWindow : public Window
+{
+ using OutputDevice::SetFont;
+private:
+ FontPrevWin_Impl* pImpl;
+
+ SVX_DLLPRIVATE void InitSettings( sal_Bool bForeground, sal_Bool bBackground );
+ SVX_DLLPRIVATE void Init ();
+ SVX_DLLPRIVATE void SetFontSize(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont);
+ SVX_DLLPRIVATE void SetFontLang(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont);
+
+ Size m_aInitialSize;
+
+public:
+ SvxFontPrevWindow( Window* pParent, const ResId& rId );
+ SvxFontPrevWindow(Window* pParent);
+ virtual ~SvxFontPrevWindow();
+
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void Init( const SfxItemSet& rSet );
+
+ // for reasons of efficiency not const
+ 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 UseResourceText( bool bUse = true );
+ void Paint( const Rectangle& );
+
+ bool IsTwoLines() const;
+ void SetTwoLines(bool bSet);
+
+ void SetBrackets(sal_Unicode cStart, sal_Unicode cEnd);
+
+ void SetFontWidthScale( sal_uInt16 nScaleInPercent );
+
+ void AutoCorrectFontColor( void );
+
+ void SetPreviewText( const OUString& rString );
+ void SetFontNameAsPreviewText();
+
+ void SetFont( const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont );
+ void SetFontStyle( const SfxItemSet& rSet, sal_uInt16 nSlotPosture, sal_uInt16 nSlotWeight, SvxFont& rFont ); // posture/weight
+ void SetFontWidthScale( const SfxItemSet& rSet );
+ void SetFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc );
+
+ void SetFromItemSet( const SfxItemSet &rSet,
+ bool bPreviewBackgroundToCharacter = false );
+
+ virtual Size GetOptimalSize() const;
+};
+
+#endif // #ifndef _SVX_FNTCTRL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/fntszctl.hxx b/include/svx/fntszctl.hxx
new file mode 100644
index 000000000000..117553e8e07b
--- /dev/null
+++ b/include/svx/fntszctl.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 _SVX_FNTSZCTL_HXX
+#define _SVX_FNTSZCTL_HXX
+
+#include <sfx2/mnuitem.hxx>
+#include "svx/svxdllapi.h"
+
+
+
+class SfxBindings;
+class FontSizeMenu;
+
+// class SvxFontSizeMenuControl ------------------------------------------
+
+class SVX_DLLPUBLIC SvxFontSizeMenuControl : public SfxMenuControl
+{
+private:
+ FontSizeMenu* pMenu;
+ Menu& rParent;
+ SfxStatusForwarder aFontNameForwarder;
+
+ DECL_LINK( MenuSelect, FontSizeMenu * );
+
+protected:
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+
+public:
+ SvxFontSizeMenuControl( sal_uInt16 nId, Menu&, SfxBindings& );
+ ~SvxFontSizeMenuControl();
+
+ virtual PopupMenu* GetPopup() const;
+
+ SFX_DECL_MENU_CONTROL();
+};
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/fontlb.hxx b/include/svx/fontlb.hxx
new file mode 100644
index 000000000000..b45ed086efd0
--- /dev/null
+++ b/include/svx/fontlb.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 SVX_FONTLB_HXX
+#define SVX_FONTLB_HXX
+
+#include <svtools/svtabbx.hxx>
+#include <svtools/svlbitm.hxx>
+#include <vcl/virdev.hxx>
+#include "svx/svxdllapi.h"
+
+// ============================================================================
+
+/** A list box string item which stores its text and font. */
+class SvLBoxFontString : public SvLBoxString
+{
+private:
+ Font maFont; /// The font used by this item.
+ bool mbUseColor; /// true = use font color, false = default listbox color.
+
+public:
+ SvLBoxFontString();
+ SvLBoxFontString(
+ SvTreeListEntry* pEntry,
+ sal_uInt16 nFlags,
+ const XubString& rString,
+ const Font& rFont,
+ const Color* pColor = NULL );
+
+ virtual ~SvLBoxFontString();
+
+ /** Creates a new empty list box item. */
+ virtual SvLBoxItem* Create() const;
+
+ void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
+
+ /** Paints this entry to the specified position, using the own font settings. */
+ virtual void Paint(
+ const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
+};
+
+
+// ============================================================================
+
+/** A list box supporting formatted string entries. */
+class SVX_DLLPUBLIC SvxFontListBox : public SvTabListBox
+{
+private:
+ Font maStdFont; /// Used for entries without specific font.
+
+ // The following members are used to store additional parameters for InitEntry().
+ Font maEntryFont; /// Current entry font used in InitEntry().
+ const Color* mpEntryColor; /// Current entry color used in InitEntry().
+ bool mbUseFont; /// true = Use maEntryFont/mpEntryColor in InitEntry().
+
+public:
+ SvxFontListBox(Window* pParent, WinBits nStyle = WB_BORDER);
+
+ /** Inserts a list entry and sets the font used for this entry.
+ @param pColor The font color. NULL = use default listbox text color. */
+ void InsertFontEntry(
+ const String& rString, const Font& rFont, const Color* pColor = NULL );
+
+ /** Selects/deselects an entry specified by its position in the list box. */
+ void SelectEntryPos( sal_uInt16 nPos, bool bSelect = true );
+ /** Removes a selection. */
+ void SetNoSelection();
+
+ /** Returns the position of the entry currently selected or LIST_APPEND. */
+ sal_uLong GetSelectEntryPos() const;
+ /** Returns the text of the selected entry or an empty string. */
+ XubString GetSelectEntry() const;
+
+protected:
+ /** Initializes a new SvLBoxFontString entry.
+ @descr Uses current value of maEntryFont to set the entry font (if mbUseFont is true). */
+ virtual void InitEntry(
+ SvTreeListEntry* pEntry,
+ const OUString& rEntryText,
+ const Image& rCollImg,
+ const Image& rExpImg,
+ SvLBoxButtonKind eButtonKind);
+};
+
+// ============================================================================
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/fontwork.hxx b/include/svx/fontwork.hxx
new file mode 100644
index 000000000000..4d2c4a0f6558
--- /dev/null
+++ b/include/svx/fontwork.hxx
@@ -0,0 +1,182 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_FONTWORK_HXX
+#define _SVX_FONTWORK_HXX
+
+#include <vcl/toolbox.hxx>
+#include <vcl/fixed.hxx>
+#include <svtools/valueset.hxx>
+#include <sfx2/dockwin.hxx>
+#include <sfx2/ctrlitem.hxx>
+#include <svx/xenum.hxx>
+#include <svx/dlgctrl.hxx>
+#include "svx/svxdllapi.h"
+
+// forward ---------------------------------------------------------------
+
+class SdrView;
+class SdrPageView;
+class SdrObject;
+
+class XFormTextAdjustItem;
+class XFormTextDistanceItem;
+class XFormTextStartItem;
+class XFormTextMirrorItem;
+class XFormTextStdFormItem;
+class XFormTextHideFormItem;
+class XFormTextOutlineItem;
+class XFormTextShadowItem;
+class XFormTextShadowColorItem;
+class XFormTextShadowXValItem;
+class XFormTextShadowYValItem;
+
+/*************************************************************************
+|*
+|* ControllerItem for Fontwork
+|*
+\************************************************************************/
+
+class SvxFontWorkDialog;
+
+class SvxFontWorkControllerItem : public SfxControllerItem
+{
+ SvxFontWorkDialog &rFontWorkDlg;
+
+protected:
+ virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState);
+
+public:
+ SvxFontWorkControllerItem(sal_uInt16 nId, SvxFontWorkDialog&, SfxBindings&);
+};
+
+/*************************************************************************
+|*
+|* Derived from SfxChildWindow as "container" for fontwork dialog
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxFontWorkChildWindow : public SfxChildWindow
+{
+ public:
+ SvxFontWorkChildWindow(Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo*);
+ SFX_DECL_CHILDWINDOW_WITHID(SvxFontWorkChildWindow);
+};
+
+/*************************************************************************
+|*
+|* Floating window for setting attributes of text effects
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxFontWorkDialog : public SfxDockingWindow
+{
+ #define CONTROLLER_COUNT 12
+
+ SvxFontWorkControllerItem* pCtrlItems[CONTROLLER_COUNT];
+
+ ValueSet aFormSet;
+
+ ToolBox aTbxStyle;
+ ToolBox aTbxAdjust;
+
+ FixedImage aFbDistance;
+ MetricField aMtrFldDistance;
+ FixedImage aFbTextStart;
+ MetricField aMtrFldTextStart;
+
+ ToolBox aTbxShadow;
+
+ FixedImage aFbShadowX;
+ MetricField aMtrFldShadowX;
+ FixedImage aFbShadowY;
+ MetricField aMtrFldShadowY;
+
+ ColorLB aShadowColorLB;
+
+ SfxBindings& rBindings;
+ Timer aInputTimer;
+
+ sal_uInt16 nLastStyleTbxId;
+ sal_uInt16 nLastAdjustTbxId;
+ sal_uInt16 nLastShadowTbxId;
+ long nSaveShadowX;
+ long nSaveShadowY;
+ long nSaveShadowAngle;
+ long nSaveShadowSize;
+
+ ImageList maImageList;
+
+ XColorListRef pColorList;
+
+#ifdef _SVX_FONTWORK_CXX
+ friend class SvxFontWorkChildWindow;
+ friend class SvxFontWorkControllerItem;
+
+ DECL_LINK( SelectStyleHdl_Impl, void * );
+ DECL_LINK( SelectAdjustHdl_Impl, void * );
+ DECL_LINK( SelectShadowHdl_Impl, void * );
+
+ DECL_LINK( ModifyInputHdl_Impl, void * );
+ DECL_LINK( InputTimoutHdl_Impl, void * );
+
+ DECL_LINK( FormSelectHdl_Impl, void * );
+ DECL_LINK( ColorSelectHdl_Impl, 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 SetStdForm_Impl(const XFormTextStdFormItem*);
+ 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*);
+#endif
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ void ApplyImageList();
+
+ protected:
+ virtual void Zoom();
+ virtual SfxChildAlignment CheckAlignment( SfxChildAlignment eActAlign,
+ SfxChildAlignment eAlign );
+
+ public:
+ SvxFontWorkDialog( SfxBindings *pBindinx,
+ SfxChildWindow *pCW,
+ Window* pParent,
+ const ResId& rResId );
+ ~SvxFontWorkDialog();
+
+ void SetColorList(const XColorListRef &pTable);
+ void SetActive(bool bActivate = true);
+
+ void CreateStdFormObj(SdrView& rView, SdrPageView& rPV,
+ const SfxItemSet& rAttr, SdrObject& rOldObj,
+ XFormTextStdForm eForm);
+};
+
+#endif // _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 000000000000..8b7d04ef8c3a
--- /dev/null
+++ b/include/svx/fontworkbar.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 _SVX_FONTWORK_BAR_HXX
+#define _SVX_FONTWORK_BAR_HXX
+
+#include <sfx2/shell.hxx>
+#include <sfx2/module.hxx>
+#include <svx/ifaceids.hxx>
+#include "svx/svxdllapi.h"
+
+class SfxViewShell;
+class SdrView;
+
+/************************************************************************/
+
+namespace svx
+{
+
+bool SVX_DLLPUBLIC checkForSelectedFontWork( SdrView* pSdrView, sal_uInt32& nCheckStatus );
+
+class SVX_DLLPUBLIC FontworkBar : public SfxShell
+{
+public:
+ TYPEINFO();
+ SFX_DECL_INTERFACE(SVX_INTERFACE_FONTWORK_BAR)
+
+ FontworkBar(SfxViewShell* pViewShell );
+ ~FontworkBar();
+
+ static void execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBindings );
+ static void getState( SdrView* pSdrView, SfxItemSet& rSet );
+};
+
+}
+
+#endif // _SVX_FONTWORK_BAR_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 000000000000..34f1bafabcb9
--- /dev/null
+++ b/include/svx/fontworkgallery.hxx
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#ifndef _SVX_FONTWORK_GALLERY_DIALOG_HXX
+#define _SVX_FONTWORK_GALLERY_DIALOG_HXX
+
+#include "svx/svxdllapi.h"
+
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/field.hxx>
+
+#include <svtools/valueset.hxx>
+
+#include <sfx2/tbxctrl.hxx>
+
+#include <vector>
+
+class FmFormModel;
+class SdrView;
+class Window;
+class SdrTextObj;
+class SdrObject;
+class SdrModel;
+
+class SfxBindings;
+class SfxStatusForwarder;
+
+//------------------------------------------------------------------------
+
+namespace svx
+{
+
+class SVX_DLLPUBLIC FontWorkShapeTypeControl : public SfxToolBoxControl
+{
+ using SfxToolBoxControl::Select;
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ FontWorkShapeTypeControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~FontWorkShapeTypeControl();
+
+ virtual void Select( sal_Bool bMod1 = sal_False );
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+};
+
+//------------------------------------------------------------------------
+
+class FontworkCharacterSpacingDialog : public ModalDialog
+{
+ FixedText maFLScale;
+ MetricField maMtrScale;
+ OKButton maOKButton;
+ CancelButton maCancelButton;
+ HelpButton maHelpButton;
+
+public:
+ FontworkCharacterSpacingDialog( Window* pParent, sal_Int32 nScale );
+ ~FontworkCharacterSpacingDialog();
+
+ sal_Int32 getScale() const;
+};
+
+
+class SVX_DLLPUBLIC FontWorkGalleryDialog : public ModalDialog
+{
+ FixedLine maFLFavorites;
+ ValueSet maCtlFavorites;
+ OKButton maOKButton;
+ CancelButton maCancelButton;
+ HelpButton maHelpButton;
+
+ sal_uInt16 mnThemeId;
+
+ SdrView* mpSdrView;
+ FmFormModel* mpModel;
+
+ String maStrClickToAddText;
+
+ DECL_LINK( DoubleClickFavoriteHdl, void * );
+ DECL_LINK( ClickOKHdl, void * );
+ DECL_LINK( ClickTextDirectionHdl, ImageButton * );
+
+ SdrObject** mppSdrObject;
+ SdrModel* mpDestModel;
+
+ void initfavorites(sal_uInt16 nThemeId, std::vector< Bitmap * >& rFavorites);
+ void insertSelectedFontwork();
+ void fillFavorites( sal_uInt16 nThemeId, std::vector< Bitmap * >& rFavorites );
+
+ std::vector< Bitmap * > maFavoritesHorizontal;
+
+public:
+ FontWorkGalleryDialog( SdrView* pView, Window* pParent, sal_uInt16 nSID );
+ ~FontWorkGalleryDialog();
+
+ // 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 000000000000..e77a12f00ef4
--- /dev/null
+++ b/include/svx/formatpaintbrushctrl.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 _SVX_FORMATPAINTBRUSHCTRL_HXX
+#define _SVX_FORMATPAINTBRUSHCTRL_HXX
+
+// header for class SfxToolBoxControl
+#include <sfx2/tbxctrl.hxx>
+// header for class Timer
+#include <vcl/timer.hxx>
+#include "svx/svxdllapi.h"
+
+//.............................................................................
+namespace svx
+{
+//.............................................................................
+
+//-----------------------------------------------------------------------------
+/**
+*/
+
+class SVX_DLLPUBLIC FormatPaintBrushToolBoxControl : public SfxToolBoxControl
+{
+ using SfxToolBoxControl::Select;
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ FormatPaintBrushToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~FormatPaintBrushToolBoxControl();
+
+ virtual void DoubleClick();
+ virtual void Click();
+ virtual void Select( sal_Bool bMod1 = sal_False );
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+private:
+ DECL_LINK( WaitDoubleClickHdl, 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 000000000000..18db6b901c0a
--- /dev/null
+++ b/include/svx/framebordertype.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 SVX_FRAMEBORDERTYPE_HXX
+#define SVX_FRAMEBORDERTYPE_HXX
+
+#include "svx/svxdllapi.h"
+
+namespace svx {
+
+// ============================================================================
+
+/** Enumerates all borders a frame selection control can contain. */
+enum FrameBorderType
+{
+ FRAMEBORDER_NONE, /// No border (special state).
+ FRAMEBORDER_LEFT, /// Left frame border.
+ FRAMEBORDER_RIGHT, /// Right frame border.
+ FRAMEBORDER_TOP, /// Top frame border.
+ FRAMEBORDER_BOTTOM, /// Bottom frame border.
+ FRAMEBORDER_HOR, /// Inner horizontal frame border.
+ FRAMEBORDER_VER, /// Inner vertical frame border.
+ FRAMEBORDER_TLBR, /// Top-left to bottom-right frame border.
+ FRAMEBORDER_BLTR /// Bottom-left to top-right frame border.
+};
+
+/** The number of valid frame border types (excluding FRAMEBORDER_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 );
+
+// ============================================================================
+
+} // namespace svx
+
+#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 000000000000..a8a05076f471
--- /dev/null
+++ b/include/svx/framelink.hxx
@@ -0,0 +1,699 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVX_FRAMELINK_HXX
+#define SVX_FRAMELINK_HXX
+
+#include <algorithm>
+#include <sal/types.h>
+#include <tools/color.hxx>
+#include "svx/svxdllapi.h"
+#include <vcl/outdev.hxx>
+#include <editeng/borderline.hxx>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+class Point;
+class Rectangle;
+class OutputDevice;
+
+namespace svx {
+namespace frame {
+
+// ============================================================================
+// Enums
+// ============================================================================
+
+/** Specifies how the reference points for frame borders are used.
+ */
+enum RefMode
+{
+ /** Frame borders are drawn centered to the reference points. */
+ REFMODE_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.
+ */
+ REFMODE_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.
+ */
+ REFMODE_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 SVX_DLLPUBLIC Style
+{
+public:
+ /** Constructs an invisible frame style. */
+ inline explicit Style()
+ : meRefMode( REFMODE_CENTERED )
+ , mnType( ::com::sun::star::table::BorderLineStyle::SOLID )
+ { Clear(); }
+ /** Constructs a frame style with passed line widths. */
+ inline explicit Style( double nP, double nD, double nS, editeng::SvxBorderStyle nType ) :
+ meRefMode( REFMODE_CENTERED ), mnType( nType )
+ { Clear(); Set( nP, nD, nS ); }
+ /** Constructs a frame style with passed color and line widths. */
+ inline explicit Style( const Color& rColorPrim, const Color& rColorSecn, const Color& rColorGap, bool bUseGapColor,
+ double nP, double nD, double nS, editeng::SvxBorderStyle nType ) :
+ meRefMode( REFMODE_CENTERED ), mnType( nType )
+ { Set( rColorPrim, rColorSecn, rColorGap, bUseGapColor, nP, nD, nS ); }
+ /** Constructs a frame style from the passed SvxBorderLine struct. */
+ inline explicit Style( const editeng::SvxBorderLine& rBorder, double fScale = 1.0, sal_uInt16 nMaxWidth = SAL_MAX_UINT16 ) :
+ meRefMode( REFMODE_CENTERED ) { Set( rBorder, fScale, nMaxWidth ); }
+ /** Constructs a frame style from the passed SvxBorderLine struct. Clears the style, if pBorder is 0. */
+ inline explicit Style( const editeng::SvxBorderLine* pBorder, double fScale = 1.0, sal_uInt16 nMaxWidth = SAL_MAX_UINT16 ) :
+ meRefMode( REFMODE_CENTERED ) { Set( pBorder, fScale, nMaxWidth ); }
+
+ inline RefMode GetRefMode() const { return meRefMode; }
+ inline const Color& GetColorPrim() const { return maColorPrim; }
+ inline const Color& GetColorSecn() const { return maColorSecn; }
+ inline const Color& GetColorGap() const { return maColorGap; }
+ inline bool UseGapColor() const { return mbUseGapColor; }
+ inline double Prim() const { return mnPrim; }
+ inline double Dist() const { return mnDist; }
+ inline double Secn() const { return mnSecn; }
+ inline editeng::SvxBorderStyle Type() const { return mnType; }
+
+ /** Returns the total width of this frame style. */
+ inline double GetWidth() const { return mnPrim + mnDist + mnSecn; }
+
+ /** 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. */
+ void Set( const editeng::SvxBorderLine& rBorder, double fScale = 1.0, sal_uInt16 nMaxWidth = SAL_MAX_UINT16 );
+ /** Sets the frame style to the passed SvxBorderLine struct. Clears the style, if pBorder is 0. */
+ void Set( const editeng::SvxBorderLine* pBorder, double fScale = 1.0, sal_uInt16 nMaxWidth = SAL_MAX_UINT16 );
+
+ /** Sets a new reference point handling mode, does not modify other settings. */
+ inline void SetRefMode( RefMode eRefMode ) { meRefMode = eRefMode; }
+ /** Sets a new color, does not modify other settings. */
+ inline void SetColorPrim( const Color& rColor ) { maColorPrim = rColor; }
+ inline void SetColorSecn( const Color& rColor ) { maColorSecn = rColor; }
+ inline void SetColorGap( bool bUseIt, const Color& rColor ) { maColorGap = rColor; mbUseGapColor = bUseIt; }
+ /** Sets whether to use dotted style for single hair lines. */
+ inline void SetType( editeng::SvxBorderStyle nType ) { mnType = nType; }
+
+ /** Mirrors this style (exchanges primary and secondary), if it is a double frame style. */
+ Style& MirrorSelf();
+ /** Returns this style mirrored, if it is a double frame style, otherwise a simple copy. */
+ Style Mirror() const;
+
+private:
+ Color maColorPrim;
+ Color maColorSecn;
+ Color maColorGap;
+ bool mbUseGapColor;
+ RefMode meRefMode; /// Reference point handling for this frame border.
+ double mnPrim; /// Width of primary (single, left, or top) line.
+ double mnDist; /// Distance between primary and secondary line.
+ double mnSecn; /// Width of secondary (right or bottom) line.
+ editeng::SvxBorderStyle mnType;
+};
+
+bool operator==( const Style& rL, const Style& rR );
+SVX_DLLPUBLIC bool operator<( const Style& rL, const Style& rR );
+
+inline bool operator!=( const Style& rL, const Style& rR ) { return !(rL == rR); }
+inline bool operator>( const Style& rL, const Style& rR ) { return rR < rL; }
+inline bool operator<=( const Style& rL, const Style& rR ) { return !(rR < rL); }
+inline bool operator>=( const Style& rL, const Style& rR ) { return !(rL < rR); }
+
+// ----------------------------------------------------------------------------
+
+/** Extends the Style struct with an angle for diagonal frame borders.
+
+ The angle is specified in radian (a full circle is equivalent to 2*PI).
+ It is dependent on the context, how the value is interpreted, i.e. it may
+ specify the angle to a horizontal or vertical frame border.
+ */
+class DiagStyle : public Style
+{
+public:
+ /** Constructs an invisible diagonal frame style. */
+ inline explicit DiagStyle() : mfAngle( 0.0 ) {}
+ /** Constructs a diagonal frame style passed style and angle. */
+ inline explicit DiagStyle( const Style& rStyle, double fAngle ) :
+ Style( rStyle ), mfAngle( fAngle ) {}
+
+ inline double GetAngle() const { return mfAngle; }
+
+ /** Returns this style mirrored, if it is a double frame style, otherwise a simple copy. */
+ inline DiagStyle Mirror() const { return DiagStyle( Style::Mirror(), mfAngle ); }
+
+private:
+ double mfAngle; /// Angle between this and hor. or vert. border.
+};
+
+// ============================================================================
+// Various helper functions
+// ============================================================================
+
+/** Returns the angle between horizontal border of a rectangle and its diagonal.
+
+ The returned values represents the inner angle between the diagonals and
+ horizontal borders, and is therefore in the range [0,PI/2] (inclusive). The
+ passed sizes may be negative, calculation is done with absolute values.
+ */
+SVX_DLLPUBLIC double GetHorDiagAngle( long nWidth, long nHeight );
+
+/** Returns the angle between horizontal border of a rectangle and its diagonal.
+
+ The returned values represents the inner angle between the diagonals and
+ horizontal borders, and is therefore in the range [0,PI/2] (inclusive). The
+ passed rectangle positions may be unordered, they are adjusted internally.
+ */
+inline double GetHorDiagAngle( long nX1, long nX2, long nY1, long nY2 )
+{ return GetHorDiagAngle( nX2 - nX1, nY2 - nY1 ); }
+
+/** Returns the angle between horizontal border of a rectangle and its diagonal.
+
+ The returned values represents the inner angle between the diagonals and
+ horizontal borders, and is therefore in the range [0,PI/2] (inclusive). The
+ passed rectangle edges may be unordered, they are adjusted internally.
+ */
+inline double GetHorDiagAngle( const Point& rP1, const Point& rP2 )
+{ return GetHorDiagAngle( rP2.X() - rP1.X(), rP2.Y() - rP1.Y() ); }
+
+/** Returns the angle between horizontal border of a rectangle and its diagonal.
+
+ The returned values represents the inner angle between the diagonals and
+ horizontal borders, and is therefore in the range [0,PI/2] (inclusive).
+ */
+inline double GetHorDiagAngle( const Rectangle& rRect )
+{ return GetHorDiagAngle( rRect.GetWidth(), rRect.GetHeight() ); }
+
+// ----------------------------------------------------------------------------
+
+/** Returns the angle between vertical border of a rectangle and its diagonal.
+
+ The returned values represents the inner angle between the diagonals and
+ vertical borders, and is therefore in the range [0,PI/2] (inclusive). The
+ passed sizes may be negative, calculation is done with absolute values.
+ */
+inline double GetVerDiagAngle( long nWidth, long nHeight )
+{ return GetHorDiagAngle( nHeight, nWidth ); }
+
+/** Returns the angle between vertical border of a rectangle and its diagonal.
+
+ The returned values represents the inner angle between the diagonals and
+ vertical borders, and is therefore in the range [0,PI/2] (inclusive). The
+ passed rectangle positions may be unordered, they are adjusted internally.
+ */
+inline double GetVerDiagAngle( long nX1, long nX2, long nY1, long nY2 )
+{ return GetVerDiagAngle( nX2 - nX1, nY2 - nY1 ); }
+
+/** Returns the angle between vertical border of a rectangle and its diagonal.
+
+ The returned values represents the inner angle between the diagonals and
+ vertical borders, and is therefore in the range [0,PI/2] (inclusive). The
+ passed rectangle edges may be unordered, they are adjusted internally.
+ */
+inline double GetVerDiagAngle( const Point& rP1, const Point& rP2 )
+{ return GetVerDiagAngle( rP2.X() - rP1.X(), rP2.Y() - rP1.Y() ); }
+
+/** Returns the angle between vertical border of a rectangle and its diagonal.
+
+ The returned values represents the inner angle between the diagonals and
+ vertical borders, and is therefore in the range [0,PI/2] (inclusive).
+ */
+inline double GetVerDiagAngle( const Rectangle& rRect )
+{ return GetVerDiagAngle( rRect.GetWidth(), rRect.GetHeight() ); }
+
+// ============================================================================
+
+/** Returns an X coordinate for a diagonal frame border in the specified height.
+
+ This function is for usage with the top-left end of a top-left to
+ bottom-right diagonal frame border, connected to the left end of a
+ horizontal frame border.
+
+ The function returns the relative X position (i.e. for a polygon) of the
+ diagonal frame border according to the specified relative Y position. The
+ mentioned positions are relative to the reference point of both frame
+ borders.
+
+ +----------------------------------------------------------
+ | The horizontal frame border.
+ | |
+ - - - - - - | --+-- <---- Reference point for horizontal and diagonal frame borders.
+ ^ | \ | \
+ nVerOffs | \ \ <--- The diagonal frame border.
+ v +---\ \------------------------------------------------
+ - - - - - - - - -\- - -X <----- The function calculates the X position of i.e.
+ \ \ this point (relative from X of reference point).
+ \ \
+ Primary -->\ \<-- Secondary
+
+ @param nVerOffs
+ The vertical position of the point to be calculated, relative to the Y
+ coordinate of the reference point.
+ @param nDiagOffs
+ The width offset across the diagonal frame border (0 = middle),
+ regardless of the gradient of the diagonal frame border (always
+ vertical to the direction of the diagonal frame border). This value is
+ not related in any way to the reference point. For details about
+ relative width offsets, see description of class Style.
+ @param fAngle
+ Inner (right) angle between diagonal and horizontal frame border.
+ */
+SVX_DLLPUBLIC long GetTLDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
+
+/** Returns an X coordinate for a diagonal frame border in the specified height.
+
+ This function is for usage with the bottom-left end of a bottom-left to
+ top-right diagonal frame border, connected to the left end of a horizontal
+ frame border.
+
+ The function returns the relative X position (i.e. for a polygon) of the
+ diagonal frame border according to the specified relative Y position. The
+ mentioned positions are relative to the reference point of both frame
+ borders.
+
+ Primary -->/ /<--- Secondary
+ / /
+ / / The function calculates the X position of i.e.
+ - - - - - - - - -/- - -X <----- this point (relative from X of reference point).
+ ^ +---/ /------------------------------------------------
+ nVerOffs | / / <--- The diagonal frame border.
+ v | / | /
+ - - - - - - | --+-- <---- Reference point for horizontal and diagonal frame borders.
+ | |
+ | The horizontal frame border.
+ +----------------------------------------------------------
+
+ @param nVerOffs
+ The vertical position of the point to be calculated, relative to the Y
+ coordinate of the reference point.
+ @param nDiagOffs
+ The width offset across the diagonal frame border (0 = middle),
+ regardless of the gradient of the diagonal frame border (always
+ vertical to the direction of the diagonal frame border). This value is
+ not related in any way to the reference point. For details about
+ relative width offsets, see description of class Style.
+ @param fAngle
+ Inner (right) angle between diagonal and horizontal frame border.
+ */
+long GetBLDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
+
+/** Returns an X coordinate for a diagonal frame border in the specified height.
+
+ This function is for usage with the bottom-right end of a top-left to
+ bottom-right diagonal frame border, connected to the right end of a
+ horizontal frame border.
+
+ @param nVerOffs
+ The vertical position of the point to be calculated, relative to the Y
+ coordinate of the reference point.
+ @param nDiagOffs
+ The width offset across the diagonal frame border (0 = middle),
+ regardless of the gradient of the diagonal frame border (always
+ vertical to the direction of the diagonal frame border). This value is
+ not related in any way to the reference point. For details about
+ relative width offsets, see description of class Style.
+ @param fAngle
+ Inner (left) angle between diagonal and horizontal frame border.
+ */
+long GetBRDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
+
+/** Returns an X coordinate for a diagonal frame border in the specified height.
+
+ This function is for usage with the top-right end of a bottom-left to
+ top-right diagonal frame border, connected to the right end of a horizontal
+ frame border.
+
+ @param nVerOffs
+ The vertical position of the point to be calculated, relative to the Y
+ coordinate of the reference point.
+ @param nDiagOffs
+ The width offset across the diagonal frame border (0 = middle),
+ regardless of the gradient of the diagonal frame border (always
+ vertical to the direction of the diagonal frame border). This value is
+ not related in any way to the reference point. For details about
+ relative width offsets, see description of class Style.
+ @param fAngle
+ Inner (left) angle between diagonal and horizontal frame border.
+ */
+long GetTRDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
+
+// ============================================================================
+
+/** Checks whether two horizontal frame borders are "connectable".
+
+ Two borders are "connectable" in terms of this function, if both can be
+ drawn with only one call of a border drawing function. This means, the two
+ frame borders must have equal style and color, and none of the other
+ vertical and diagonal frame borders break the lines of the two borders in
+ any way (i.e. two vertical double frame borders would break the horizonal
+ frame borders). Of course this function can be used for vertical frame
+ borders as well.
+
+ The follong picture shows the meaning of all passed parameters:
+
+ \ rTFromT /
+ \ | /
+ rTFromTL | rTFromTR
+ \ | /
+ \ | /
+ ======== rLBorder ========= ========== rRBorder =======
+ / | \
+ / | \
+ rBFromBL | rBFromBR
+ / | \
+ / rBFromB \
+
+ @return
+ True, if rLBorder and rRBorder can be drawn in one step without
+ interruption at their connection point.
+ */
+SVX_DLLPUBLIC bool CheckFrameBorderConnectable(
+ const Style& rLBorder, /// Style of the left frame border to connect.
+ const Style& rRBorder, /// Style of the right frame border to connect.
+
+ const Style& rTFromTL, /// Diagonal frame border from top-left to connection point.
+ const Style& rTFromT, /// Vertical frame border from top to connection point.
+ const Style& rTFromTR, /// Horizontal frame border from top-right to connection point.
+
+ const Style& rBFromBL, /// Diagonal frame border from bottom-left to connection point.
+ const Style& rBFromB, /// Vertical frame border from bottom to connection point.
+ const Style& rBFromBR /// Horizontal frame border from bottom-right to connection point.
+);
+
+// ============================================================================
+// Drawing functions
+// ============================================================================
+
+/** Draws a horizontal frame border, regards all connected frame styles.
+
+ The frame style to draw is passed as parameter rBorder. The function
+ calculates the adjustment in X direction for left and right end of primary
+ and secondary line of the frame border (the style may present a double
+ line). The line ends may differ according to the connected frame styles
+ coming from top, bottom, left, right, and/or diagonal.
+
+ Thick frame styles are always drawn centered (in width) to the passed
+ reference points. The Y coordinates of both reference points must be equal
+ (the line cannot be drawn slanted).
+
+ The function preserves all settings of the passed output device.
+
+ All parameters starting with "rL" refer to the left end of the processed
+ frame border, all parameters starting with "rR" refer to the right end.
+ The following part of the parameter name starting with "From" specifies
+ where the frame border comes from. Example: "rLFromTR" means the frame
+ border coming from top-right, connected to the left end of rBorder (and
+ therefore a diagonal frame border).
+
+ The follong picture shows the meaning of all passed parameters:
+
+ rLFromT / \ rRFromT
+ | / \ |
+ | rLFromTR rRFromTL |
+ | / \ |
+ | / \ |
+ --- rLFromL --- ============== rBorder ============== --- rRFromR ---
+ | \ / |
+ | \ / |
+ | rLFromBR rRFromBL |
+ | \ / |
+ rLFromB \ / rRFromB
+ */
+SVX_DLLPUBLIC drawinglayer::primitive2d::Primitive2DSequence CreateBorderPrimitives(
+ const Point& rLPos, /// Reference point for left end of the processed frame border.
+ const Point& rRPos, /// Reference point for right end of the processed frame border.
+ const Style& rBorder, /// Style of the processed frame border.
+
+ const DiagStyle& rLFromTR, /// Diagonal frame border from top-right to left end of rBorder.
+ const Style& rLFromT, /// Vertical frame border from top to left end of rBorder.
+ const Style& rLFromL, /// Horizontal frame border from left to left end of rBorder.
+ const Style& rLFromB, /// Vertical frame border from bottom to left end of rBorder.
+ const DiagStyle& rLFromBR, /// Diagonal frame border from bottom-right to left end of rBorder.
+
+ const DiagStyle& rRFromTL, /// Diagonal frame border from top-left to right end of rBorder.
+ const Style& rRFromT, /// Vertical frame border from top to right end of rBorder.
+ const Style& rRFromR, /// Horizontal frame border from right to right end of rBorder.
+ const Style& rRFromB, /// Vertical frame border from bottom to right end of rBorder.
+ const DiagStyle& rRFromBL, /// Diagonal frame border from bottom-left to right end of rBorder.
+
+ const Color* pForceColor = 0,/// If specified, overrides frame border color.
+ const long& rRotationT = 9000, /// Angle of the top slanted frames in 100th of degree
+ const long& rRotationB = 9000 /// Angle of the bottom slanted frames in 100th of degree
+);
+
+SVX_DLLPUBLIC drawinglayer::primitive2d::Primitive2DSequence CreateBorderPrimitives(
+ const Point& rLPos, /// Reference point for left end of the processed frame border.
+ const Point& rRPos, /// Reference point for right end of the processed frame border.
+ const Style& rBorder, /// Style of the processed frame border.
+
+ const Style& rLFromT, /// Vertical frame border from top to left end of rBorder.
+ const Style& rLFromL, /// Horizontal frame border from left to left end of rBorder.
+ const Style& rLFromB, /// Vertical frame border from bottom to left end of rBorder.
+
+ const Style& rRFromT, /// Vertical frame border from top to right end of rBorder.
+ const Style& rRFromR, /// Horizontal frame border from right to right end of rBorder.
+ const Style& rRFromB, /// Vertical frame border from bottom to right end of rBorder.
+
+ const Color* pForceColor = 0,/// If specified, overrides frame border color.
+ const long& rRotationT = 9000, /// Angle of the top slanted frame in 100th of degrees
+ const long& rRotationB = 9000 /// Angle of the bottom slanted frame in 100th of degrees
+);
+
+SVX_DLLPUBLIC drawinglayer::primitive2d::Primitive2DSequence CreateClippedBorderPrimitives (
+ const Point& rStart, const Point& rEnd, const Style& rBorder,
+ const Rectangle& rClipRect );
+
+/** Draws a horizontal frame border, regards all connected frame styles.
+
+ The frame style to draw is passed as parameter rBorder. The function
+ calculates the adjustment in X direction for left and right end of primary
+ and secondary line of the frame border (the style may present a double
+ line). The line ends may differ according to the connected frame styles
+ coming from top, bottom, left, right, and/or diagonal.
+
+ Thick frame styles are always drawn centered (in width) to the passed
+ reference points. The Y coordinates of both reference points must be equal
+ (the line cannot be drawn slanted).
+
+ The function preserves all settings of the passed output device.
+
+ All parameters starting with "rL" refer to the left end of the processed
+ frame border, all parameters starting with "rR" refer to the right end.
+ The following part of the parameter name starting with "From" specifies
+ where the frame border comes from. Example: "rLFromTR" means the frame
+ border coming from top-right, connected to the left end of rBorder (and
+ therefore a diagonal frame border).
+
+ The follong picture shows the meaning of all passed parameters:
+
+ rLFromT / \ rRFromT
+ | / \ |
+ | rLFromTR rRFromTL |
+ | / \ |
+ | / \ |
+ --- rLFromL --- ============== rBorder ============== --- rRFromR ---
+ | \ / |
+ | \ / |
+ | rLFromBR rRFromBL |
+ | \ / |
+ rLFromB \ / rRFromB
+ */
+SVX_DLLPUBLIC void DrawHorFrameBorder(
+ OutputDevice& rDev, /// The output device used to draw the frame border.
+
+ const Point& rLPos, /// Reference point for left end of the processed frame border.
+ const Point& rRPos, /// Reference point for right end of the processed frame border.
+ const Style& rBorder, /// Style of the processed frame border.
+
+ const DiagStyle& rLFromTR, /// Diagonal frame border from top-right to left end of rBorder.
+ const Style& rLFromT, /// Vertical frame border from top to left end of rBorder.
+ const Style& rLFromL, /// Horizontal frame border from left to left end of rBorder.
+ const Style& rLFromB, /// Vertical frame border from bottom to left end of rBorder.
+ const DiagStyle& rLFromBR, /// Diagonal frame border from bottom-right to left end of rBorder.
+
+ const DiagStyle& rRFromTL, /// Diagonal frame border from top-left to right end of rBorder.
+ const Style& rRFromT, /// Vertical frame border from top to right end of rBorder.
+ const Style& rRFromR, /// Horizontal frame border from right to right end of rBorder.
+ const Style& rRFromB, /// Vertical frame border from bottom to right end of rBorder.
+ const DiagStyle& rRFromBL, /// Diagonal frame border from bottom-left to right end of rBorder.
+
+ const Color* pForceColor = 0 /// If specified, overrides frame border color.
+);
+
+// ============================================================================
+
+/** Draws a vertical frame border, regards all connected frame styles.
+
+ The frame style to draw is passed as parameter rBorder. The function
+ calculates the adjustment in Y direction for top and bottom end of primary
+ and secondary line of the frame border (the style may present a double
+ line). The line ends may differ according to the connected frame styles
+ coming from left, right, top, bottom, and/or diagonal.
+
+ Thick frame styles are always drawn centered (in width) to the passed
+ reference points. The X coordinates of both reference points must be equal
+ (the line cannot be drawn slanted).
+
+ The function preserves all settings of the passed output device.
+
+ All parameters starting with "rT" refer to the top end of the processed
+ frame border, all parameters starting with "rB" refer to the bottom end.
+ The following part of the parameter name starting with "From" specifies
+ where the frame border comes from. Example: "rTFromBL" means the frame
+ border coming from bottom-left, connected to the top end of rBorder (and
+ therefore a diagonal frame border).
+
+ The follong picture shows the meaning of all passed parameters:
+
+ |
+ rTFromT
+ |
+ |
+ --- rTFromL --- --- rTFromR ---
+ / # \
+ / # \
+ rTFromBL # rTFromBR
+ / # \
+ / # \
+ #
+ rBorder
+ #
+ \ # /
+ \ # /
+ rBFromTL # rBFromTR
+ \ # /
+ \ # /
+ --- rBFromL --- --- rBFromR ---
+ |
+ |
+ rBFromB
+ |
+ */
+SVX_DLLPUBLIC void DrawVerFrameBorder(
+ OutputDevice& rDev, /// The output device used to draw the frame border.
+
+ const Point& rTPos, /// Reference point for top end of the processed frame border.
+ const Point& rBPos, /// Reference point for bottom end of the processed frame border.
+ const Style& rBorder, /// Style of the processed frame border.
+
+ const DiagStyle& rTFromBL, /// Diagonal frame border from bottom-right to top end of rBorder.
+ const Style& rTFromL, /// Horizontal frame border from left to top end of rBorder.
+ const Style& rTFromT, /// Vertical frame border from top to top end of rBorder.
+ const Style& rTFromR, /// Horizontal frame border from right to top end of rBorder.
+ const DiagStyle& rTFromBR, /// Diagonal frame border from bottom-right to top end of rBorder.
+
+ const DiagStyle& rBFromTL, /// Diagonal frame border from top-left to bottom end of rBorder.
+ const Style& rBFromL, /// Horizontal frame border from left to bottom end of rBorder.
+ const Style& rBFromB, /// Vertical frame border from bottom to bottom end of rBorder.
+ const Style& rBFromR, /// Horizontal frame border from right to bottom end of rBorder.
+ const DiagStyle& rBFromTR, /// Diagonal frame border from top-right to bottom end of rBorder.
+
+ const Color* pForceColor = 0 /// If specified, overrides frame border color.
+);
+
+// ============================================================================
+
+/** Draws both diagonal frame borders, regards all connected frame styles.
+
+ One or both passed diagonal frame styles may be invisible.
+
+ The function preserves all settings of the passed output device.
+ */
+SVX_DLLPUBLIC void DrawDiagFrameBorders(
+ OutputDevice& rDev, /// The output device used to draw the frame border.
+
+ const Rectangle& rRect, /// Rectangle for both diagonal frame borders.
+ const Style& rTLBR, /// Style of the processed top-left to bottom-right diagonal frame border.
+ const Style& rBLTR, /// Style of the processed bottom-left to top-right diagonal frame border.
+
+ const Style& rTLFromB, /// Vertical frame border from bottom to top-left end of rTLBR.
+ const Style& rTLFromR, /// Horizontal frame border from right to top-left end of rTLBR.
+ const Style& rBRFromT, /// Vertical frame border from top to bottom-right end of rTLBR.
+ const Style& rBRFromL, /// Horizontal frame border from left to bottom-right end of rTLBR.
+
+ const Style& rBLFromT, /// Vertical frame border from top to bottom-left end of rBLTR.
+ const Style& rBLFromR, /// Horizontal frame border from right to bottom-left end of rBLTR.
+ const Style& rTRFromB, /// Vertical frame border from bottom to top-right end of rBLTR.
+ const Style& rTRFromL, /// Horizontal frame border from left to top-right end of rBLTR.
+
+ const Color* pForceColor = 0, /// If specified, overrides frame border color.
+ bool bDiagDblClip = false /// true = Use clipping for crossing double frame borders.
+);
+
+// ============================================================================
+
+} // namespace frame
+} // namespace svx
+
+/* Yes, I love ASCII art. :-) -DR- */
+
+#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 000000000000..b0afbd4b4b30
--- /dev/null
+++ b/include/svx/framelinkarray.hxx
@@ -0,0 +1,479 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVX_FRAMELINKARRAY_HXX
+#define SVX_FRAMELINKARRAY_HXX
+
+#include <svx/framelink.hxx>
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+
+#include <memory>
+
+#include <vector>
+#include "svx/svxdllapi.h"
+
+namespace svx {
+namespace frame {
+
+// ============================================================================
+
+
+struct Cell
+{
+ Style maLeft;
+ Style maRight;
+ Style maTop;
+ Style maBottom;
+ Style maTLBR;
+ Style maBLTR;
+ long mnAddLeft;
+ long mnAddRight;
+ long mnAddTop;
+ long mnAddBottom;
+ bool mbMergeOrig;
+ bool mbOverlapX;
+ bool mbOverlapY;
+
+ explicit Cell();
+
+ inline bool IsMerged() const { return mbMergeOrig || mbOverlapX || mbOverlapY; }
+ inline bool IsOverlapped() const { return mbOverlapX || mbOverlapY; }
+
+ void MirrorSelfX( bool bMirrorStyles, bool bSwapDiag );
+};
+
+typedef std::vector< long > LongVec;
+typedef std::vector< Cell > CellVec;
+
+struct ArrayImpl
+{
+ CellVec maCells;
+ LongVec maWidths;
+ LongVec maHeights;
+ mutable LongVec maXCoords;
+ mutable LongVec maYCoords;
+ size_t mnWidth;
+ size_t mnHeight;
+ size_t mnFirstClipCol;
+ size_t mnFirstClipRow;
+ size_t mnLastClipCol;
+ size_t mnLastClipRow;
+ mutable bool mbXCoordsDirty;
+ mutable bool mbYCoordsDirty;
+ bool mbDiagDblClip;
+
+ explicit ArrayImpl( size_t nWidth, size_t nHeight, bool bDiagDblClip );
+
+ inline bool IsValidPos( size_t nCol, size_t nRow ) const
+ { return (nCol < mnWidth) && (nRow < mnHeight); }
+ inline size_t GetIndex( size_t nCol, size_t nRow ) const
+ { return nRow * mnWidth + nCol; }
+
+ const Cell& GetCell( size_t nCol, size_t nRow ) const;
+ Cell& GetCellAcc( size_t nCol, size_t nRow );
+
+ size_t GetMergedFirstCol( size_t nCol, size_t nRow ) const;
+ size_t GetMergedFirstRow( size_t nCol, size_t nRow ) const;
+ size_t GetMergedLastCol( size_t nCol, size_t nRow ) const;
+ size_t GetMergedLastRow( size_t nCol, size_t nRow ) const;
+
+ const Cell& GetMergedOriginCell( size_t nCol, size_t nRow ) const;
+
+ bool IsMergedOverlappedLeft( size_t nCol, size_t nRow ) const;
+ bool IsMergedOverlappedRight( size_t nCol, size_t nRow ) const;
+ bool IsMergedOverlappedTop( size_t nCol, size_t nRow ) const;
+ bool IsMergedOverlappedBottom( size_t nCol, size_t nRow ) const;
+
+ bool IsInClipRange( size_t nCol, size_t nRow ) const;
+ bool IsColInClipRange( size_t nCol ) const;
+ bool IsRowInClipRange( size_t nRow ) const;
+
+ inline size_t GetMirrorCol( size_t nCol ) const { return mnWidth - nCol - 1; }
+ inline size_t GetMirrorRow( size_t nRow ) const { return mnHeight - nRow - 1; }
+
+ long GetColPosition( size_t nCol ) const;
+ long GetRowPosition( size_t nRow ) const;
+
+ long GetColWidth( size_t nFirstCol, size_t nLastCol ) const;
+ long GetRowHeight( size_t nFirstRow, size_t nLastRow ) const;
+
+ double GetHorDiagAngle( size_t nCol, size_t nRow, bool bSimple = false ) const;
+ double GetVerDiagAngle( size_t nCol, size_t nRow, bool bSimple = false ) const;
+};
+
+/** 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,
+ especaially, 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 SVX_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 = false) 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 );
+
+ /** Returns the left frame style of the cell (nCol,nRow).
+ @param bSimple
+ true = Ignores merged ranges and neighbor cells;
+ false = 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, bool bSimple = false ) const;
+
+ /** Returns the right frame style of the cell (nCol,nRow).
+ @param bSimple
+ true = Ignores merged ranges and neighbor cells;
+ false = 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, bool bSimple = false ) const;
+
+ /** Returns the top frame style of the cell (nCol,nRow).
+ @param bSimple
+ true = Ignores merged ranges and neighbor cells;
+ false = 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, bool bSimple = false ) const;
+
+ /** Returns the top frame style of the cell (nCol,nRow).
+ @param bSimple
+ true = Ignores merged ranges and neighbor cells;
+ false = 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, bool bSimple = false ) const;
+
+ /** Returns the top-left to bottom-right frame style of the cell (nCol,nRow).
+ @param bSimple
+ true = Ignores merged ranges;
+ false = Returns the visible style (i.e. from top-left corner of a merged range).
+ @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, bool bSimple = false ) const;
+
+ /** Returns the bottom-left to top-right frame style of the cell (nCol,nRow).
+ @param bSimple
+ true = Ignores merged ranges;
+ false = Returns the visible style (i.e. from top-left corner of a merged range).
+ @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, bool bSimple = false ) 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 true, if the left border of the cell (nCol,nRow) is overlapped by a merged range. */
+ bool IsMergedOverlappedLeft( size_t nCol, size_t nRow ) const;
+
+ /** Returns true, if the right border of the cell (nCol,nRow) is overlapped by a merged range. */
+ bool IsMergedOverlappedRight( 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 DrawRange() 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 );
+
+ /** Returns the rectangle (output coordinates) of the current clipping range. */
+ Rectangle GetClipRangeRectangle() const;
+
+ // 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 <array-width> 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 <array-height> 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 top-left output position of the cell (nCol,nRow).
+ @param bSimple
+ true = Ignores merged ranges;
+ false = Returns output position of top-left corner of merged ranges. */
+ Point GetCellPosition( size_t nCol, size_t nRow, bool bSimple = false ) const;
+
+ /** Returns the output size of the cell (nCol,nRow).
+ @param bSimple
+ true = Ignores merged ranges;
+ false = Returns total output size of merged ranges. */
+ Size GetCellSize( size_t nCol, size_t nRow, bool bSimple = false ) const;
+
+ /** Returns the output rectangle of the cell (nCol,nRow).
+ @param bSimple
+ true = Ignores merged ranges;
+ false = Returns total output rectangle of merged ranges. */
+ Rectangle GetCellRect( size_t nCol, size_t nRow, bool bSimple = false ) const;
+
+ // diagonal frame borders -------------------------------------------------
+
+ /** Returns the angle between horizontal and diagonal border of the cell (nCol,nRow).
+ @param bSimple
+ true = Ignores merged ranges;
+ false = Returns the horizontal angle of merged ranges. */
+ double GetHorDiagAngle( size_t nCol, size_t nRow, bool bSimple = false ) const;
+
+ /** Returns the angle between vertical and diagonal border of the cell (nCol,nRow).
+ @param bSimple
+ true = Ignores merged ranges;
+ false = Returns the vertical angle of merged ranges. */
+ double GetVerDiagAngle( size_t nCol, size_t nRow, bool bSimple = false ) const;
+
+ /** Specifies whether to use polygon clipping to draw diagonal frame borders.
+ @descr
+ If enabled, diagonal frame borders are drawn interrupted, if they are
+ crossed by a double frame border. Polygon clipping is very expensive
+ and should only be used for very small output devices (i.e. in the
+ Border tab page). Default after construction is OFF. */
+ void SetUseDiagDoubleClipping( bool bSet );
+
+ // mirroring --------------------------------------------------------------
+
+ /** Mirrors the entire array horizontally.
+ @param bMirrorStyles
+ true = Swap primary and secondary line of all vertical double frame borders.
+ @param bSwapDiag
+ true = Swap top-left to bottom-right and bottom-left to top-right frame borders. */
+ void MirrorSelfX( bool bMirrorStyles, bool bSwapDiag );
+
+ // 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. */
+ void DrawRange( drawinglayer::processor2d::BaseProcessor2D* rDev,
+ size_t nFirstCol, size_t nFirstRow,
+ size_t nLastCol, size_t nLastRow,
+ const Color* pForceColor = 0 ) const;
+
+ /** 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. */
+ void DrawRange( OutputDevice& rDev,
+ size_t nFirstCol, size_t nFirstRow,
+ size_t nLastCol, size_t nLastRow,
+ const Color* pForceColor = 0 ) const;
+
+ /** Draws the part of the array, that is inside the clipping range.
+ @param pForceColor
+ If not NULL, only this color will be used to draw all frame borders. */
+ void DrawArray( OutputDevice& rDev, const Color* pForceColor = 0 ) const;
+
+ // ------------------------------------------------------------------------
+
+private:
+ typedef std::auto_ptr< ArrayImpl > ArrayImplPtr;
+
+ ArrayImplPtr mxImpl;
+};
+
+// ============================================================================
+
+} // namespace frame
+} // namespace svx
+
+#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 000000000000..1248e63558a5
--- /dev/null
+++ b/include/svx/frmdirlbox.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 _SVX_FRMDIRLBOX_HXX
+#define _SVX_FRMDIRLBOX_HXX
+
+#include <vcl/lstbox.hxx>
+#include <sfx2/itemconnect.hxx>
+#include <editeng/frmdir.hxx>
+#include "svx/svxdllapi.h"
+
+class SvxFrameDirectionItem;
+
+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 SVX_DLLPUBLIC FrameDirectionListBox : public ListBox
+{
+public:
+ explicit FrameDirectionListBox( Window* pParent, const ResId& rResId );
+ explicit FrameDirectionListBox( Window* pParent, WinBits nBits );
+ virtual ~FrameDirectionListBox();
+
+ /** Inserts a string with corresponding direction enum into the listbox. */
+ void InsertEntryValue(
+ const String& rString,
+ SvxFrameDirection eDirection,
+ sal_uInt16 nPos = LISTBOX_APPEND );
+ /** Removes the entry, that represents the specified frame direction. */
+ void RemoveEntryValue( SvxFrameDirection eDirection );
+
+ /** Selects the specified frame direction. */
+ void SelectEntryValue( SvxFrameDirection eDirection );
+ /** Returns the currently selected frame direction. */
+ SvxFrameDirection GetSelectEntryValue() const;
+
+ /** Saves the currently selected frame direction. */
+ inline void SaveValue() { meSaveValue = GetSelectEntryValue(); }
+ /** Returns the frame direction saved with SaveValue(). */
+ inline SvxFrameDirection GetSavedValue() const { return meSaveValue; }
+
+private:
+ SvxFrameDirection meSaveValue; /// Saved value for later comparison.
+};
+
+typedef FrameDirectionListBox FrameDirListBox;
+
+// ============================================================================
+
+/** Wrapper for usage of a FrameDirectionListBox in item connections. */
+class SVX_DLLPUBLIC FrameDirListBoxWrapper : public sfx::SingleControlWrapper< FrameDirListBox, SvxFrameDirection >
+{
+public:
+ explicit FrameDirListBoxWrapper( FrameDirListBox& rListBox );
+
+ virtual bool IsControlDontKnow() const;
+ virtual void SetControlDontKnow( bool bSet );
+
+ virtual SvxFrameDirection GetControlValue() const;
+ virtual void SetControlValue( SvxFrameDirection eValue );
+};
+
+/** Wrapper for usage of a SvxFrameDirectionItem in item connections. */
+typedef sfx::ValueItemWrapper< SvxFrameDirectionItem, SvxFrameDirection, sal_uInt16 > FrameDirItemWrapper;
+
+/** An item<->control connection for a FrameDirectionListBox. */
+typedef sfx::ItemControlConnection< FrameDirItemWrapper, FrameDirListBoxWrapper > FrameDirListBoxConnection;
+
+// ============================================================================
+
+} // namespace svx
+
+#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 000000000000..48b720856c86
--- /dev/null
+++ b/include/svx/frmsel.hxx
@@ -0,0 +1,202 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVX_FRMSEL_HXX
+#define SVX_FRMSEL_HXX
+
+#include <memory>
+#include <tools/color.hxx>
+#include <vcl/ctrl.hxx>
+#include <vcl/bitmap.hxx>
+#include <editeng/borderline.hxx>
+#include <svx/framebordertype.hxx>
+#include "svx/svxdllapi.h"
+
+namespace editeng {
+ class SvxBorderLine;
+}
+
+namespace svx {
+
+struct FrameSelectorImpl;
+
+// ============================================================================
+
+typedef int FrameSelFlags;
+
+const FrameSelFlags FRAMESEL_NONE = 0x0000;
+/** If set, the left frame border is enabled. */
+const FrameSelFlags FRAMESEL_LEFT = 0x0001;
+/** If set, the right frame border is enabled. */
+const FrameSelFlags FRAMESEL_RIGHT = 0x0002;
+/** If set, the top frame border is enabled. */
+const FrameSelFlags FRAMESEL_TOP = 0x0004;
+/** If set, the bottom frame border is enabled. */
+const FrameSelFlags FRAMESEL_BOTTOM = 0x0008;
+/** If set, the inner horizontal frame border is enabled. */
+const FrameSelFlags FRAMESEL_INNER_HOR = 0x0010;
+/** If set, the inner vertical frame border is enabled. */
+const FrameSelFlags FRAMESEL_INNER_VER = 0x0020;
+/** If set, the top-left to bottom-right diagonal frame border is enabled. */
+const FrameSelFlags FRAMESEL_DIAG_TLBR = 0x0040;
+/** If set, the bottom-left to top-right diagonal frame border is enabled. */
+const FrameSelFlags FRAMESEL_DIAG_BLTR = 0x0080;
+
+/** If set, all four outer frame borders are enabled. */
+const FrameSelFlags FRAMESEL_OUTER = FRAMESEL_LEFT|FRAMESEL_RIGHT|FRAMESEL_TOP|FRAMESEL_BOTTOM;
+/** If set, both inner frame borders are enabled. */
+const FrameSelFlags FRAMESEL_INNER = FRAMESEL_INNER_HOR|FRAMESEL_INNER_VER;
+/** If set, both diagonal frame borders are enabled. */
+const FrameSelFlags FRAMESEL_DIAGONAL = FRAMESEL_DIAG_TLBR|FRAMESEL_DIAG_BLTR;
+
+/** If set, all frame borders will support the don't care state. */
+const FrameSelFlags FRAMESEL_DONTCARE = 0x0100;
+
+// ----------------------------------------------------------------------------
+
+/** All possible states of a frame border. */
+enum FrameBorderState
+{
+ FRAMESTATE_SHOW, /// Frame border has a visible style.
+ FRAMESTATE_HIDE, /// Frame border is hidden (off).
+ FRAMESTATE_DONTCARE /// Frame border is in don't care state (if enabled).
+};
+
+// ============================================================================
+
+class SVX_DLLPUBLIC FrameSelector : public Control
+{
+public:
+ FrameSelector(Window* pParent);
+ virtual ~FrameSelector();
+
+ /** 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;
+ /** Returns the index of a frame border (counts only enabled borders) from passed type. */
+ sal_Int32 GetEnabledBorderIndex( FrameBorderType eBorder ) 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, editeng::SvxBorderStyle& 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, bool bSelect = true );
+ /** Deselects the specified frame border. */
+ inline void DeselectBorder( FrameBorderType eBorder ) { SelectBorder( eBorder, false ); }
+
+ /** Returns true, if any of the enabled frame borders is selected. */
+ bool IsAnyBorderSelected() const;
+ /** Selects or deselects all frame borders. */
+ void SelectAllBorders( bool bSelect = true );
+ /** Deselects all frame borders. */
+ inline void DeselectAllBorders() { SelectAllBorders( false ); }
+
+ /** Selects or deselects all visible frame borders (ignores hidden and "don't care" borders). */
+ void SelectAllVisibleBorders( bool bSelect = true );
+
+ /** Sets the passed line widths to all selected frame borders (in twips). */
+ void SetStyleToSelection( long nWidth, editeng::SvxBorderStyle nStyle );
+ /** Sets the passed color to all selected frame borders. */
+ void SetColorToSelection( const Color& rColor );
+
+ // accessibility ----------------------------------------------------------
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ CreateAccessible();
+
+ /** Returns the accessibility child object of the specified frame border (if enabled). */
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetChildAccessible( FrameBorderType eBorder );
+ /** Returns the accessibility child object with specified index (counts enabled frame borders only). */
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetChildAccessible( sal_Int32 nIndex );
+ /** Returns the accessibility child object at the specified position (relative to control). */
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetChildAccessible( const Point& rPos );
+
+ /** Returns true, if the passed point is inside the click area of any enabled frame border. */
+ bool ContainsClickPoint( const Point& rPos ) const;
+ /** Returns the bounding rectangle of the specified frame border (if enabled). */
+ Rectangle GetClickBoundRect( FrameBorderType eBorder ) const;
+
+ // ------------------------------------------------------------------------
+protected:
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void Resize();
+ virtual Size GetOptimalSize() const;
+
+private:
+ std::auto_ptr< FrameSelectorImpl > mxImpl;
+};
+
+// ============================================================================
+
+} // namespace svx
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/galbrws.hxx b/include/svx/galbrws.hxx
new file mode 100644
index 000000000000..0269643c658b
--- /dev/null
+++ b/include/svx/galbrws.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 _SVX_GALBRWS_HXX_
+#define _SVX_GALBRWS_HXX_
+
+#include <sfx2/ctrlitem.hxx>
+#include <sfx2/dockwin.hxx>
+#include <vcl/graph.hxx>
+#include <tools/urlobj.hxx>
+#include "svx/svxdllapi.h"
+
+#define GALLERYBROWSER() ((GalleryBrowser*)( SfxViewFrame::Current()->GetChildWindow(GalleryChildWindow::GetChildWindowId())->GetWindow()))
+
+class SVX_DLLPUBLIC GalleryChildWindow : public SfxChildWindow
+{
+public:
+ GalleryChildWindow( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
+ ~GalleryChildWindow();
+
+ SFX_DECL_CHILDWINDOW_WITHID( GalleryChildWindow );
+};
+
+class FmFormModel;
+class GalleryBrowser1;
+class GalleryBrowser2;
+class GallerySplitter;
+class Gallery;
+
+class GalleryBrowser : public SfxDockingWindow
+{
+ friend class GalleryBrowser1;
+ friend class GalleryBrowser2;
+ friend class GallerySplitter;
+ using Window::KeyInput;
+
+private:
+
+ Size maLastSize;
+ GallerySplitter* mpSplitter;
+ GalleryBrowser1* mpBrowser1;
+ GalleryBrowser2* mpBrowser2;
+ Gallery* mpGallery;
+
+ void InitSettings();
+
+ virtual sal_Bool Close();
+ virtual void Resize();
+ virtual void GetFocus();
+
+ DECL_LINK( SplitHdl, void* );
+
+protected:
+
+ void ThemeSelectionHasChanged();
+
+public:
+
+ GalleryBrowser( SfxBindings* pBindings, SfxChildWindow* pCW,
+ Window* pParent, const ResId& rResId );
+ ~GalleryBrowser();
+
+ INetURLObject GetURL() const;
+ String GetFilterName() const;
+ Graphic GetGraphic() const;
+ sal_Bool IsLinkage() const;
+
+ sal_Bool KeyInput( const KeyEvent& rKEvt, Window* pWindow );
+};
+
+#endif // _SVX_GALBRWS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/galctrl.hxx b/include/svx/galctrl.hxx
new file mode 100644
index 000000000000..782163aa95fd
--- /dev/null
+++ b/include/svx/galctrl.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 _SVX_GALCTRL_HXX_
+#define _SVX_GALCTRL_HXX_
+
+#include <vcl/dialog.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/group.hxx>
+#include <vcl/button.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/menu.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/combobox.hxx>
+#include <svl/slstitm.hxx>
+#include <svtools/transfer.hxx>
+#include <svtools/valueset.hxx>
+#include <svtools/brwbox.hxx>
+#include <svtools/grfmgr.hxx>
+#include "svx/galmisc.hxx"
+#include "svx/svxdllapi.h"
+
+class GalleryTheme;
+class GalleryBrowser2;
+
+class SVX_DLLPUBLIC GalleryPreview : public Window, public DropTargetHelper, public DragSourceHelper
+{
+private:
+
+ GraphicObject aGraphicObj;
+ Rectangle aPreviewRect;
+ GalleryTheme* mpTheme;
+
+ SVX_DLLPRIVATE sal_Bool ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const;
+ SVX_DLLPRIVATE void InitSettings();
+
+ // Window
+ SVX_DLLPRIVATE virtual void Paint(const Rectangle& rRect);
+ SVX_DLLPRIVATE virtual void MouseButtonDown(const MouseEvent& rMEvt);
+ SVX_DLLPRIVATE virtual void Command(const CommandEvent& rCEvt);
+ SVX_DLLPRIVATE virtual void KeyInput( const KeyEvent& rKEvt );
+ SVX_DLLPRIVATE virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+
+ // DropTargetHelper
+ SVX_DLLPRIVATE virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
+ SVX_DLLPRIVATE virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+
+ // DragSourceHelper
+ SVX_DLLPRIVATE virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+
+ DECL_LINK( MenuSelectHdl, Menu* );
+
+public:
+
+ GalleryPreview( GalleryBrowser2* pParent, GalleryTheme* pTheme );
+ GalleryPreview( Window* pParent, const ResId& rResId );
+ ~GalleryPreview();
+
+ void SetGraphic( const Graphic& rGraphic ) { aGraphicObj.SetGraphic( rGraphic ); }
+ bool SetGraphic( const INetURLObject& );
+ void PreviewMedia( const INetURLObject& rURL );
+};
+
+class GalleryIconView : public ValueSet, public DropTargetHelper, public DragSourceHelper
+{
+ using ValueSet::StartDrag;
+
+private:
+
+ GalleryTheme* mpTheme;
+
+ void InitSettings();
+
+ // ValueSet
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ // Window
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ // DropTargetHelper
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+
+ // DragSourceHelper
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+
+public:
+
+ GalleryIconView( GalleryBrowser2* pParent, GalleryTheme* pTheme );
+ ~GalleryIconView();
+};
+
+class GalleryListView : public BrowseBox
+{
+ using BrowseBox::AcceptDrop;
+ using BrowseBox::ExecuteDrop;
+
+private:
+
+ Link maSelectHdl;
+ GalleryTheme* mpTheme;
+ sal_uIntPtr mnCurRow;
+
+ void InitSettings();
+
+ // BrowseBox
+ virtual sal_Bool SeekRow( long nRow );
+ virtual void PaintField( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId ) const;
+ virtual void DoubleClick( const BrowserMouseEvent& rEvt );
+ virtual void Select();
+ virtual sal_Int8 AcceptDrop( const BrowserAcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const BrowserExecuteDropEvent& rEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+
+ // Window
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ // DragSourceHelper
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+
+public:
+
+ GalleryListView( GalleryBrowser2* pParent, GalleryTheme* pTheme );
+ ~GalleryListView();
+
+ void SetSelectHdl( const Link& rSelectHdl ) { maSelectHdl = rSelectHdl; }
+
+ /** 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 String GetCellText(long _nRow, sal_uInt16 _nColId) const;
+
+ // from IAccessibleTableProvider
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+};
+
+#endif // _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 000000000000..a2b010b9f4f0
--- /dev/null
+++ b/include/svx/gallery.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 _GALLERY_HXX_
+#define _GALLERY_HXX_
+
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <tools/urlobj.hxx>
+#include <vector>
+#include "svx/svxdllapi.h"
+
+#define SGA_FORMAT_NONE 0x00000000L
+#define SGA_FORMAT_STRING 0x00000001L
+#define SGA_FORMAT_GRAPHIC 0x00000010L
+#define SGA_FORMAT_SOUND 0x00000100L
+#define SGA_FORMAT_OLE 0x00001000L
+#define SGA_FORMAT_SVDRAW 0x00010000L
+#define SGA_FORMAT_ALL 0xFFFFFFFFL
+
+#define SVX_GALLERY() (GalleryExplorer::GetGallery())
+
+// Defines for preinstalled themes
+// Has to be in sync with svx/inc/galtheme.hrc
+#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_SOUNDS 18
+#define GALLERY_THEME_USERSOUNDS 21
+
+#define GALLERY_THEME_FONTWORK 37
+#define GALLERY_THEME_FONTWORK_VERTICAL 38
+
+class Gallery;
+class VCDrawModel;
+class FmFormModel;
+class SdrModel;
+class Graphic;
+class FmFormModel;
+class Bitmap;
+class OutputDevice;
+
+class SVX_DLLPUBLIC GalleryExplorer
+{
+private:
+
+ SVX_DLLPRIVATE static Gallery* ImplGetGallery();
+
+public:
+
+ static GalleryExplorer* GetGallery();
+
+public:
+
+ INetURLObject GetURL() const;
+ String GetFilterName() const;
+ Graphic GetGraphic() const;
+ sal_Bool IsLinkage() const;
+
+ static bool FillThemeList( std::vector<String>& rThemeList );
+
+ // FillObjList is filling rObjList with Strings of the internal Gallery Object URL
+ static sal_Bool FillObjList( const String& rThemeName, std::vector<String> &rObjList );
+ static sal_Bool FillObjList( const sal_uInt32 nThemeId, std::vector<String> &rObjList );
+ static bool FillObjList( const sal_uInt32 nThemeId, std::vector<OUString> &rObjList );
+
+ // FillObjTitleList is filling the rList with the title for each gallery object
+ static sal_Bool FillObjListTitle( const sal_uInt32 nThemeId, std::vector< OUString >& rList );
+
+ static sal_Bool InsertURL( const String& rThemeName, const String& rURL );
+ static sal_Bool InsertURL( sal_uIntPtr nThemeId, const String& rURL );
+
+ static sal_Bool InsertURL( const String& rThemeName, const String& rURL,
+ const sal_uIntPtr nSgaFormat /* = SGA_FORMAT_ALL */ );
+ static sal_Bool InsertURL( sal_uIntPtr nThemeId, const String& rURL,
+ const sal_uIntPtr nSgaFormat /* = SGA_FORMAT_ALL */ );
+
+ static sal_Bool GetGraphicObj( const String& rThemeName, sal_uIntPtr nPos,
+ Graphic* pGraphic = NULL, Bitmap* pThumb = NULL,
+ sal_Bool bProgess = sal_False );
+ static sal_Bool GetGraphicObj( sal_uIntPtr nThemeId, sal_uIntPtr nPos,
+ Graphic* pGraphic = NULL, Bitmap* pThumb = NULL,
+ sal_Bool bProgess = sal_False );
+
+ static sal_uIntPtr GetSdrObjCount( const String& rThemeName );
+ static sal_uIntPtr GetSdrObjCount( sal_uIntPtr nThemeId );
+
+ static sal_Bool GetSdrObj( const String& rThemeName, sal_uIntPtr nSdrModelPos,
+ SdrModel* pModel = NULL, Bitmap* pThumb = NULL );
+ static sal_Bool GetSdrObj( sal_uIntPtr nThemeId, sal_uIntPtr nSdrModelPos,
+ SdrModel* pModel = NULL, Bitmap* pThumb = NULL );
+
+ static sal_Bool BeginLocking( const String& rThemeName );
+ static sal_Bool BeginLocking( sal_uIntPtr nThemeId );
+
+ static sal_Bool EndLocking( const String& rThemeName );
+ static sal_Bool EndLocking( sal_uIntPtr nThemeId );
+};
+
+#endif // _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 000000000000..e116c14b8cf6
--- /dev/null
+++ b/include/svx/gallery1.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 _SVX_GALLERY1_HXX_
+#define _SVX_GALLERY1_HXX_
+
+#include <tools/string.hxx>
+#include <tools/urlobj.hxx>
+#include <svl/brdcst.hxx>
+#include "svx/svxdllapi.h"
+
+#include <cstdio>
+#include <vector>
+
+// ---------------------
+// - GalleryThemeEntry -
+// ---------------------
+
+class SvStream;
+
+class GalleryThemeEntry
+{
+private:
+
+ OUString aName;
+ INetURLObject aThmURL;
+ INetURLObject aSdgURL;
+ INetURLObject aSdvURL;
+ sal_uInt32 nFileNumber;
+ sal_uInt32 nId;
+ sal_Bool bReadOnly;
+ sal_Bool bModified;
+ sal_Bool bThemeNameFromResource;
+
+ GalleryThemeEntry();
+ INetURLObject ImplGetURLIgnoreCase( const INetURLObject& rURL ) const;
+
+public:
+
+ GalleryThemeEntry( const INetURLObject& rBaseURL, const String& rName,
+ sal_uInt32 nFileNumber, sal_Bool bReadOnly,
+ sal_Bool bNewFile, sal_uInt32 nId, sal_Bool bThemeNameFromResource );
+ ~GalleryThemeEntry() {};
+
+ const OUString& GetThemeName() const { return aName; }
+ sal_uInt32 GetFileNumber() const { return nFileNumber; }
+
+ const INetURLObject& GetThmURL() const { return aThmURL; }
+ const INetURLObject& GetSdgURL() const { return aSdgURL; }
+ const INetURLObject& GetSdvURL() const { return aSdvURL; }
+
+ sal_Bool IsReadOnly() const { return bReadOnly; }
+ sal_Bool IsDefault() const;
+
+ sal_Bool IsHidden() const { return aName.match("private://gallery/hidden/"); }
+
+ sal_Bool IsModified() const { return bModified; }
+ void SetModified( sal_Bool bSet ) { bModified = ( bSet && !IsReadOnly() ); }
+
+ void SetName( const OUString& rNewName );
+ sal_Bool IsNameFromResource() const { return bThemeNameFromResource; }
+
+ sal_uInt32 GetId() const { return nId; }
+ void SetId( sal_uInt32 nNewId, sal_Bool bResetThemeName );
+};
+
+typedef ::std::vector< GalleryThemeEntry* > GalleryThemeList;
+
+// ---------------------------
+// - GalleryImportThemeEntry -
+// ---------------------------
+
+struct GalleryImportThemeEntry
+{
+ OUString aThemeName;
+ OUString aUIName;
+ INetURLObject aURL;
+};
+
+typedef ::std::vector< GalleryImportThemeEntry* > GalleryImportThemeList;
+
+// -----------------------------------------------------------------------------
+
+SvStream& operator<<( SvStream& rOut, const GalleryImportThemeEntry& rEntry );
+SvStream& operator>>( SvStream& rIn, GalleryImportThemeEntry& rEntry );
+
+// -----------
+// - Gallery -
+// -----------
+
+class SfxListener;
+class GalleryTheme;
+class GalleryThemeCacheEntry;
+
+class Gallery : public SfxBroadcaster
+{
+ // only for gengal utility!
+ friend Gallery* createGallery( const OUString& );
+ friend void disposeGallery( Gallery* );
+
+ typedef std::vector<GalleryThemeCacheEntry*> GalleryCacheThemeList;
+
+private:
+
+ GalleryThemeList aThemeList;
+ GalleryImportThemeList aImportList;
+ GalleryCacheThemeList aThemeCache;
+ INetURLObject aRelURL;
+ INetURLObject aUserURL;
+ rtl_TextEncoding nReadTextEncoding;
+ sal_uIntPtr nLastFileNumber;
+ sal_Bool bMultiPath;
+
+ void ImplLoad( const OUString& rMultiPath );
+ void ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbIsReadOnly );
+
+ SVX_DLLPUBLIC GalleryThemeEntry* ImplGetThemeEntry( const OUString& rThemeName );
+ GalleryThemeEntry* ImplGetThemeEntry( sal_uIntPtr nThemeId );
+
+ GalleryTheme* ImplGetCachedTheme( const GalleryThemeEntry* pThemeEntry );
+ void ImplDeleteCachedTheme( GalleryTheme* pTheme );
+
+ SVX_DLLPUBLIC Gallery( const OUString& rMultiPath );
+ SVX_DLLPUBLIC ~Gallery();
+
+public:
+
+ SVX_DLLPUBLIC static Gallery* GetGalleryInstance();
+
+ size_t GetThemeCount() const { return aThemeList.size(); }
+ const GalleryThemeEntry* GetThemeInfo( size_t nPos )
+ { return nPos < aThemeList.size() ? aThemeList[ nPos ] : NULL; }
+ const GalleryThemeEntry* GetThemeInfo( const String& rThemeName ) { return ImplGetThemeEntry( rThemeName ); }
+
+ SVX_DLLPUBLIC sal_Bool HasTheme( const String& rThemeName );
+ OUString GetThemeName( sal_uIntPtr nThemeId ) const;
+
+ SVX_DLLPUBLIC sal_Bool CreateTheme( const String& rThemeName, sal_uInt32 nNumFrom = 0 );
+ sal_Bool RenameTheme( const String& rOldName, const String& rNewName );
+ SVX_DLLPUBLIC sal_Bool RemoveTheme( const String& rThemeName );
+
+ SVX_DLLPUBLIC GalleryTheme* AcquireTheme( const String& rThemeName, SfxListener& rListener );
+ SVX_DLLPUBLIC void ReleaseTheme( GalleryTheme* pTheme, SfxListener& rListener );
+
+public:
+
+ const INetURLObject& GetUserURL() const { return aUserURL; }
+ const INetURLObject& GetRelativeURL() const { return aRelURL; }
+
+ sal_Bool IsMultiPath() const { return bMultiPath; }
+};
+
+#endif // _SVX_GALLERY1_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx
new file mode 100644
index 000000000000..16f84cbe907b
--- /dev/null
+++ b/include/svx/galmisc.hxx
@@ -0,0 +1,223 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_GALMISC_HXX_
+#define _SVX_GALMISC_HXX_
+
+#include <sot/storage.hxx>
+#include <tools/urlobj.hxx>
+#include <svtools/imap.hxx>
+#include <svl/hint.hxx>
+#include <svtools/transfer.hxx>
+#include <svx/svdobj.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/awt/XProgressMonitor.hpp>
+#include "svx/svxdllapi.h"
+#include <tools/date.hxx>
+#include <tools/time.hxx>
+
+class GalleryTheme;
+
+struct ExchangeData
+{
+ GalleryTheme* pTheme;
+ String aEditedTitle;
+ Date aThemeChangeDate;
+ Time aThemeChangeTime;
+
+ ExchangeData() :
+ aThemeChangeDate( Date::EMPTY ),
+ aThemeChangeTime( Time::EMPTY )
+ {}
+};
+
+enum SgaObjKind
+{
+ SGA_OBJ_NONE = 0, // abstract object
+ SGA_OBJ_BMP = 1, // bitmap object
+ SGA_OBJ_SOUND = 2, // sound object
+ SGA_OBJ_VIDEO = 3, // video object
+ SGA_OBJ_ANIM = 4, // animation object
+ SGA_OBJ_SVDRAW = 5, // Svdraw object
+ SGA_OBJ_INET = 6 // graphics from the internet
+};
+
+#define IV_IMAPINFO (sal_uInt32('S')*0x00000001+sal_uInt32('D')*0x00000100+sal_uInt32('U')*0x00010000+sal_uInt32('D')*0x01000000)
+#define ID_IMAPINFO 2
+
+#define USERDATA_HDL() (LINK(this,SgaUserDataFactory,MakeUserData))
+
+#define GAL_RES(nId) ResId(nId, *GetGalleryResMgr())
+#define GAL_RESSTR(nId) GAL_RES(nId).toString()
+#define STREAMBUF_SIZE 16384L
+
+#define SGA_IMPORT_NONE 0x0000
+#define SGA_IMPORT_FILE 0x0001
+#define SGA_IMPORT_INET 0x0002
+
+#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 ResMgr;
+class String;
+class SvStream;
+class Graphic;
+class FmFormModel;
+class ImageMap;
+class Gallery;
+
+SVX_DLLPUBLIC ResMgr* GetGalleryResMgr();
+sal_uInt16 GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic, String& rFilterName, sal_Bool bShowProgress = sal_False );
+sal_Bool GallerySvDrawImport( SvStream& rIStm, SdrModel& rModel );
+sal_Bool CreateIMapGraphic( const FmFormModel& rModel, Graphic& rGraphic, ImageMap& rImageMap );
+SVX_DLLPUBLIC String GetReducedString( const INetURLObject& rURL, sal_uIntPtr nMaxLen );
+String GetSvDrawStreamNameFromURL( const INetURLObject& rSvDrawObjURL );
+
+sal_Bool FileExists( const INetURLObject& rURL );
+sal_Bool CreateDir( const INetURLObject& rURL );
+sal_Bool CopyFile( const INetURLObject& rSrcURL, const INetURLObject& rDstURL );
+sal_Bool KillFile( const INetURLObject& rURL );
+BitmapEx GalleryResGetBitmapEx( sal_uInt32 nId );
+
+class SgaIMapInfo : public SdrObjUserData, public SfxListener
+{
+ ImageMap aImageMap;
+
+public:
+ SgaIMapInfo() : SdrObjUserData( IV_IMAPINFO, ID_IMAPINFO, 0 ) {};
+
+ SgaIMapInfo( const ImageMap& rImageMap) :
+ SdrObjUserData( IV_IMAPINFO, ID_IMAPINFO, 0 ),
+ aImageMap( rImageMap ) {};
+
+ virtual ~SgaIMapInfo() {};
+
+ virtual SdrObjUserData* Clone( SdrObject* ) const
+ {
+ SgaIMapInfo* pInfo = new SgaIMapInfo;
+ pInfo->aImageMap = aImageMap;
+ return pInfo;
+ }
+
+ const ImageMap& GetImageMap() const { return aImageMap; }
+};
+
+class SgaUserDataFactory
+{
+public:
+ SgaUserDataFactory() { SdrObjFactory::InsertMakeUserDataHdl( USERDATA_HDL() ); }
+ ~SgaUserDataFactory() { SdrObjFactory::RemoveMakeUserDataHdl( USERDATA_HDL() ); }
+
+ DECL_LINK( MakeUserData, SdrObjFactory* );
+};
+
+class GraphicFilter;
+
+class SVX_DLLPUBLIC GalleryProgress
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XProgressBar > mxProgressBar;
+ GraphicFilter* mpFilter;
+
+ public:
+
+ GalleryProgress( GraphicFilter* pFilter = NULL );
+ ~GalleryProgress();
+
+ void Update( sal_uIntPtr nVal, sal_uIntPtr nMaxVal );
+};
+
+class Gallery;
+class GalleryTheme;
+class GraphicObject;
+
+class GalleryTransferable : public TransferableHelper
+{
+friend class GalleryTheme;
+using TransferableHelper::CopyToClipboard;
+
+private:
+
+ GalleryTheme* mpTheme;
+ SgaObjKind meObjectKind;
+ sal_uInt32 mnObjectPos;
+ SotStorageStreamRef mxModelStream;
+ GraphicObject* mpGraphicObject;
+ ImageMap* mpImageMap;
+ INetURLObject* mpURL;
+
+protected:
+
+ GalleryTransferable( GalleryTheme* pTheme, sal_uIntPtr nObjectPos, bool bLazy );
+ ~GalleryTransferable();
+
+ void InitData( bool bLazy );
+
+ // TransferableHelper
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void DragFinished( sal_Int8 nDropAction );
+ virtual void ObjectReleased();
+
+ void CopyToClipboard( Window* pWindow );
+ void StartDrag( Window* pWindow, sal_Int8 nDragSourceActions,
+ sal_Int32 nDragPointer = DND_POINTER_NONE,
+ sal_Int32 nDragImage = DND_IMAGE_NONE );
+};
+
+#define GALLERY_HINT_NONE 0x00000000
+#define GALLERY_HINT_CLOSE_THEME 0x00000001
+#define GALLERY_HINT_THEME_REMOVED 0x00000002
+#define GALLERY_HINT_THEME_RENAMED 0x00000004
+#define GALLERY_HINT_THEME_CREATED 0x00000008
+#define GALLERY_HINT_THEME_UPDATEVIEW 0x00000010
+#define GALLERY_HINT_CLOSE_OBJECT 0x00000020
+#define GALLERY_HINT_OBJECT_REMOVED 0x00000040
+
+class GalleryHint : public SfxHint
+{
+private:
+
+ sal_uIntPtr mnType;
+ OUString maThemeName;
+ OUString maStringData;
+ sal_uIntPtr mnData1;
+ sal_uIntPtr mnData2;
+
+public:
+
+ GalleryHint( sal_uIntPtr nType, const String& rThemeName, sal_uIntPtr nData1 = 0UL, sal_uIntPtr nData2 = 0UL ) :
+ mnType( nType ), maThemeName( rThemeName ), mnData1( nData1 ), mnData2( nData2 ) {}
+
+ GalleryHint( sal_uIntPtr nType, const String& rThemeName, const String& rStringData, sal_uIntPtr nData1 = 0UL, sal_uIntPtr nData2 = 0UL ) :
+ mnType( nType ), maThemeName( rThemeName ), maStringData( rStringData ), mnData1( nData1 ), mnData2( nData2 ) {}
+
+ sal_uIntPtr GetType() const { return mnType; }
+ const OUString& GetThemeName() const { return maThemeName; }
+ const OUString& GetStringData() const { return maStringData; }
+ sal_uIntPtr GetData1() const { return mnData1; }
+ sal_uIntPtr GetData2() const { return mnData2; }
+};
+
+ #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 000000000000..0326418e8e6a
--- /dev/null
+++ b/include/svx/galtheme.hxx
@@ -0,0 +1,225 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_GALTHEME_HXX_
+#define _SVX_GALTHEME_HXX_
+
+#include "svx/svxdllapi.h"
+
+#include <tools/debug.hxx>
+#include <tools/urlobj.hxx>
+#include <vcl/salctype.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <svtools/transfer.hxx>
+#include <sot/storage.hxx>
+#include <svx/svdmodel.hxx>
+#include <svx/galmisc.hxx>
+#include <vector>
+
+// -----------------
+// - GalleryObject -
+// -----------------
+// --------------
+// - SgaObjKind -
+// --------------
+
+struct GalleryObject
+{
+ INetURLObject aURL;
+ sal_uInt32 nOffset;
+ SgaObjKind eObjKind;
+ sal_Bool bDummy;
+};
+
+typedef ::std::vector< GalleryObject* > GalleryObjectList;
+
+class GalleryThemeEntry;
+class SgaObject;
+class FmFormModel;
+class ListBox;
+
+// -----------------
+// - GalDragParams -
+// -----------------
+
+struct GalDragParams
+{
+ Region aDragRegion;
+ sal_uIntPtr nDragObjPos;
+ OUString aThemeName;
+ OUString aFileName;
+ SgaObjKind eObjKind;
+};
+
+// ----------------
+// - GalleryTheme -
+// ----------------
+
+class Gallery;
+class GalleryProgress;
+namespace unogallery
+{
+ class GalleryTheme;
+ class GalleryItem;
+}
+
+class GalleryTheme : public SfxBroadcaster
+{
+ friend class Gallery;
+ friend class GalleryThemeCacheEntry;
+ friend class ::unogallery::GalleryTheme;
+ friend class ::unogallery::GalleryItem;
+
+private:
+
+ GalleryObjectList aObjectList;
+ String m_aDestDir;
+ SotStorageRef aSvDrawStorageRef;
+ Gallery* pParent;
+ GalleryThemeEntry* pThm;
+ sal_uIntPtr mnThemeLockCount;
+ sal_uIntPtr mnBroadcasterLockCount;
+ sal_uIntPtr nDragPos;
+ sal_Bool bDragging;
+ sal_Bool bAbortActualize;
+
+ void ImplCreateSvDrawStorage();
+ SVX_DLLPUBLIC SgaObject* ImplReadSgaObject( GalleryObject* pEntry );
+ sal_Bool ImplWriteSgaObject( const SgaObject& rObj, size_t nPos, GalleryObject* pExistentEntry );
+ void ImplWrite();
+ const GalleryObject* ImplGetGalleryObject( size_t nPos ) const
+ { return ( nPos < aObjectList.size() ) ? aObjectList[ nPos ] : NULL; }
+ SVX_DLLPUBLIC const GalleryObject* ImplGetGalleryObject( const INetURLObject& rURL );
+
+ size_t ImplGetGalleryObjectPos( const GalleryObject* pObj ) const
+ {
+ for ( size_t i = 0, n = aObjectList.size(); i < n; ++i )
+ if ( pObj == aObjectList[ i ] )
+ return i;
+ return size_t(-1);
+ }
+ INetURLObject ImplGetURL( const GalleryObject* pObject ) const;
+ INetURLObject ImplCreateUniqueURL( SgaObjKind eObjKind, sal_uIntPtr nFormat = CVT_UNKNOWN );
+ void ImplSetModified( sal_Bool bModified );
+ void ImplBroadcast( sal_uIntPtr nUpdatePos );
+
+ GalleryTheme();
+ GalleryTheme( Gallery* pGallery, GalleryThemeEntry* pThemeEntry );
+ ~GalleryTheme();
+
+public:
+
+ static GalleryThemeEntry* CreateThemeEntry( const INetURLObject& rURL, sal_Bool bReadOnly );
+
+ size_t GetObjectCount() const { return aObjectList.size(); }
+
+ SVX_DLLPUBLIC SgaObject* AcquireObject( size_t nPos );
+ SVX_DLLPUBLIC void ReleaseObject( SgaObject* pObj );
+
+ SVX_DLLPUBLIC bool InsertObject( const SgaObject& rObj, sal_uIntPtr nPos = LIST_APPEND );
+ SVX_DLLPUBLIC bool RemoveObject( size_t nPos );
+ bool ChangeObjectPos( size_t nOldPos, size_t nNewPos );
+
+ SVX_DLLPUBLIC const OUString& GetName() const;
+ const OUString& GetRealName() const;
+
+ const String& GetDestDir() const { return m_aDestDir; }
+ void SetDestDir(const String& rDestDir) { m_aDestDir = rDestDir; }
+
+ const INetURLObject& GetThmURL() const;
+ SVX_DLLPUBLIC const INetURLObject& GetSdgURL() const;
+ const INetURLObject& GetSdvURL() const;
+
+ SVX_DLLPUBLIC sal_uInt32 GetId() const;
+ void SetId( sal_uInt32 nNewId, sal_Bool bResetThemeName );
+
+ void SetDragging( sal_Bool bSet ) { bDragging = bSet; }
+ sal_Bool IsDragging() const { return bDragging; }
+
+ void LockTheme() { ++mnThemeLockCount; }
+ sal_Bool UnlockTheme();
+
+ void LockBroadcaster() { mnBroadcasterLockCount++; }
+ SVX_DLLPUBLIC void UnlockBroadcaster( sal_uIntPtr nUpdatePos = 0 );
+ sal_Bool IsBroadcasterLocked() const { return mnBroadcasterLockCount > 0; }
+
+ void SetDragPos( sal_uIntPtr nPos ) { nDragPos = nPos; }
+ sal_uIntPtr GetDragPos() const { return nDragPos; }
+
+ sal_Bool IsThemeNameFromResource() const;
+
+ SVX_DLLPUBLIC sal_Bool IsReadOnly() const;
+ SVX_DLLPUBLIC sal_Bool IsDefault() const;
+ sal_Bool IsModified() const;
+
+ SVX_DLLPUBLIC void Actualize( const Link& rActualizeLink, GalleryProgress* pProgress = NULL );
+ void AbortActualize() { bAbortActualize = sal_True; }
+
+ Gallery* GetParent() const { return pParent; }
+ SotStorageRef GetSvDrawStorage() const { return aSvDrawStorageRef; }
+
+public:
+
+ SgaObjKind GetObjectKind( sal_uIntPtr nPos ) const
+ {
+ DBG_ASSERT( nPos < GetObjectCount(), "Position out of range" );
+ return ImplGetGalleryObject( nPos )->eObjKind;
+ }
+
+
+ const INetURLObject& GetObjectURL( sal_uIntPtr nPos ) const
+ {
+ DBG_ASSERT( nPos < GetObjectCount(), "Position out of range" );
+ return ImplGetGalleryObject( nPos )->aURL;
+ }
+
+ sal_Bool GetThumb( sal_uIntPtr nPos, Bitmap& rBmp, sal_Bool bProgress = sal_False );
+
+ SVX_DLLPUBLIC sal_Bool GetGraphic( sal_uIntPtr nPos, Graphic& rGraphic, sal_Bool bProgress = sal_False );
+ SVX_DLLPUBLIC sal_Bool InsertGraphic( const Graphic& rGraphic, sal_uIntPtr nInsertPos = LIST_APPEND );
+
+ SVX_DLLPUBLIC sal_Bool GetModel( sal_uIntPtr nPos, SdrModel& rModel, sal_Bool bProgress = sal_False );
+ SVX_DLLPUBLIC sal_Bool InsertModel( const FmFormModel& rModel, sal_uIntPtr nInsertPos = LIST_APPEND );
+
+ sal_Bool GetModelStream( sal_uIntPtr nPos, SotStorageStreamRef& rModelStreamRef, sal_Bool bProgress = sal_False );
+ sal_Bool InsertModelStream( const SotStorageStreamRef& rModelStream, sal_uIntPtr nInsertPos = LIST_APPEND );
+
+ sal_Bool GetURL( sal_uIntPtr nPos, INetURLObject& rURL, sal_Bool bProgress = sal_False );
+ SVX_DLLPUBLIC sal_Bool InsertURL( const INetURLObject& rURL, sal_uIntPtr nInsertPos = LIST_APPEND );
+ sal_Bool InsertFileOrDirURL( const INetURLObject& rFileOrDirURL, sal_uIntPtr nInsertPos = LIST_APPEND );
+
+ sal_Bool InsertTransferable( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable, sal_uIntPtr nInsertPos );
+
+ void CopyToClipboard( Window* pWindow, sal_uIntPtr nPos );
+ void StartDrag( Window* pWindow, sal_uIntPtr nPos );
+
+public:
+
+ SvStream& WriteData( SvStream& rOut ) const;
+ SvStream& ReadData( SvStream& rIn );
+ static SVX_DLLPUBLIC void InsertAllThemes( ListBox& rListBox );
+};
+
+SvStream& operator<<( SvStream& rOut, const GalleryTheme& rTheme );
+SvStream& operator>>( SvStream& rIn, GalleryTheme& rTheme );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/globl3d.hxx b/include/svx/globl3d.hxx
new file mode 100644
index 000000000000..d5d495153a7b
--- /dev/null
+++ b/include/svx/globl3d.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 _E3D_GLOBL3D_HXX
+#define _E3D_GLOBL3D_HXX
+
+#include <tools/solar.h>
+
+const sal_uInt32 E3dInventor = sal_uInt32('E')*0x00000001+
+ sal_uInt32('3')*0x00000100+
+ sal_uInt32('D')*0x00010000+
+ sal_uInt32('1')*0x01000000;
+
+const sal_uInt16 E3D_SCENE_ID = 1;
+const sal_uInt16 E3D_POLYSCENE_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 // _E3D_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 000000000000..10b050990d62
--- /dev/null
+++ b/include/svx/grafctrl.hxx
@@ -0,0 +1,183 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_GRAFCTRL_HXX
+#define _SVX_GRAFCTRL_HXX
+
+#include <svl/lstner.hxx>
+#include <svl/intitem.hxx>
+#include <sfx2/tbxctrl.hxx>
+#include "svx/svxdllapi.h"
+
+// ----------------
+// - TbxImageItem -
+// ----------------
+
+class SVX_DLLPUBLIC TbxImageItem : public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+ TbxImageItem( sal_uInt16 nWhich = 0, sal_uInt16 nImage = 0 );
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+};
+
+// -------------------------------
+// - SvxGrafFilterToolBoxControl -
+// -------------------------------
+
+class SVX_DLLPUBLIC SvxGrafFilterToolBoxControl : public SfxToolBoxControl
+{
+public:
+
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxGrafFilterToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxGrafFilterToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+};
+
+// -------------------------
+// - SvxGrafToolBoxControl -
+// -------------------------
+
+class SvxGrafToolBoxControl : public SfxToolBoxControl
+{
+public:
+ SvxGrafToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxGrafToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual Window* CreateItemWindow( Window *pParent );
+};
+
+// ----------------------------
+// - SvxGrafRedToolBoxControl -
+// ----------------------------
+
+class SVX_DLLPUBLIC SvxGrafRedToolBoxControl : public SvxGrafToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxGrafRedToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+};
+
+// ------------------------------
+// - SvxGrafGreenToolBoxControl -
+// ------------------------------
+
+class SVX_DLLPUBLIC SvxGrafGreenToolBoxControl : public SvxGrafToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxGrafGreenToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+};
+
+// -----------------------------
+// - SvxGrafBlueToolBoxControl -
+// -----------------------------
+
+class SVX_DLLPUBLIC SvxGrafBlueToolBoxControl : public SvxGrafToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxGrafBlueToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+};
+
+// ----------------------------------
+// - SvxGrafLuminanceToolBoxControl -
+// ----------------------------------
+
+class SVX_DLLPUBLIC SvxGrafLuminanceToolBoxControl : public SvxGrafToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxGrafLuminanceToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+};
+
+// ---------------------------------
+// - SvxGrafContrastToolBoxControl -
+// ---------------------------------
+
+class SVX_DLLPUBLIC SvxGrafContrastToolBoxControl : public SvxGrafToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxGrafContrastToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+};
+
+// ------------------------------
+// - SvxGrafGammaToolBoxControl -
+// ------------------------------
+
+class SVX_DLLPUBLIC SvxGrafGammaToolBoxControl : public SvxGrafToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxGrafGammaToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+};
+
+// -------------------------------------
+// - SvxGrafTransparenceToolBoxControl -
+// -------------------------------------
+
+class SVX_DLLPUBLIC SvxGrafTransparenceToolBoxControl : public SvxGrafToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxGrafTransparenceToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+};
+
+// -----------------------------
+// - SvxGrafModeToolBoxControl -
+// -----------------------------
+
+class SVX_DLLPUBLIC SvxGrafModeToolBoxControl : public SfxToolBoxControl, public SfxListener
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxGrafModeToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxGrafModeToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual Window* CreateItemWindow( Window *pParent );
+};
+
+// ---------------------
+// - SvxGrafAttrHelper -
+// ---------------------
+
+class SdrView;
+class SfxRequest;
+
+class SVX_DLLPUBLIC SvxGrafAttrHelper
+{
+public:
+
+ static void ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView );
+ static void GetGrafAttrState( SfxItemSet& rSet, SdrView& rView );
+};
+
+#endif // _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 000000000000..1d91aa3ddd7e
--- /dev/null
+++ b/include/svx/graphctl.hxx
@@ -0,0 +1,160 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _GRAPHCTL_HXX
+#define _GRAPHCTL_HXX
+
+#include <vcl/ctrl.hxx>
+#include <vcl/graph.hxx>
+#include "svx/svxdllapi.h"
+
+#include <svx/svdview.hxx>
+#include <svx/svdobj.hxx>
+
+class GraphCtrlUserCall;
+class SvxGraphCtrlAccessibleContext;
+
+#define WB_SDRMODE ((WinBits)0x0080)
+#define WB_ANIMATION ((WinBits)0x0100)
+
+class SVX_DLLPUBLIC GraphCtrl : public Control
+{
+ friend class GraphCtrlView;
+ friend class GraphCtrlUserCall;
+
+ Graphic aGraphic;
+ Timer aUpdateTimer;
+ Link aMousePosLink;
+ Link aGraphSizeLink;
+ Link aMarkObjLink;
+ Link aUpdateLink;
+ MapMode aMap100;
+ Size aGraphSize;
+ Point aMousePos;
+ GraphCtrlUserCall* pUserCall;
+ WinBits nWinStyle;
+ SdrObjKind eObjKind;
+ sal_uInt16 nPolyEdit;
+ sal_Bool bEditMode;
+ sal_Bool bSdrMode;
+ sal_Bool bAnim;
+
+ DECL_LINK( UpdateHdl, Timer* );
+
+ SvxGraphCtrlAccessibleContext* mpAccContext;
+
+protected:
+
+ SdrModel* pModel;
+ SdrView* pView;
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void KeyInput(const KeyEvent& rKEvt);
+ virtual void MouseButtonDown(const MouseEvent& rMEvt);
+ virtual void MouseButtonUp(const MouseEvent& rMEvt);
+ virtual void MouseMove(const MouseEvent& rMEvt);
+
+ virtual void InitSdrModel();
+
+ virtual void SdrObjCreated( const SdrObject& rObj );
+ virtual void SdrObjChanged( const SdrObject& rObj );
+ virtual void MarkListHasChanged();
+
+ SdrObjUserCall* GetSdrUserCall() { return (SdrObjUserCall*) pUserCall; }
+
+public:
+
+ GraphCtrl( Window* pParent, const ResId& rResId );
+ ~GraphCtrl();
+
+ void SetWinStyle( WinBits nWinBits );
+ WinBits GetWinStyle() const { return nWinStyle; }
+
+ void SetGraphic( const Graphic& rGraphic, sal_Bool bNewModel = sal_True );
+ const Graphic& GetGraphic() const { return aGraphic; }
+ const Size& GetGraphicSize() const { return aGraphSize; }
+
+ const Point& GetMousePos() const { return aMousePos; }
+
+ void SetEditMode( const sal_Bool bEditMode );
+ sal_Bool IsEditMode() const { return bEditMode; }
+
+ void SetPolyEditMode( const sal_uInt16 nPolyEdit );
+ sal_uInt16 GetPolyEditMode() const { return nPolyEdit; }
+
+ void SetObjKind( const SdrObjKind eObjKind );
+ SdrObjKind GetObjKind() const { return eObjKind; }
+
+ SdrModel* GetSdrModel() const { return pModel; }
+ SdrView* GetSdrView() const { return pView; }
+ SdrObject* GetSelectedSdrObject() const;
+ sal_Bool IsChanged() const { return bSdrMode ? pModel->IsChanged() : sal_False; }
+
+ void SetMousePosLink( const Link& rLink ) { aMousePosLink = rLink; }
+ const Link& GetMousePosLink() const { return aMousePosLink; }
+
+ void SetGraphSizeLink( const Link& rLink ) { aGraphSizeLink = rLink; }
+ const Link& GetGraphSizeLink() const { return aGraphSizeLink; }
+
+ void SetMarkObjLink( const Link& rLink ) { aMarkObjLink = rLink; }
+ const Link& GetMarkObjLink() const { return aMarkObjLink; }
+
+ void SetUpdateLink( const Link& rLink ) { aUpdateLink = rLink; }
+ const Link& GetUpdateLink() const { return aUpdateLink; }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+};
+
+
+class GraphCtrlUserCall : public SdrObjUserCall
+{
+ GraphCtrl& rWin;
+
+public:
+
+ GraphCtrlUserCall( GraphCtrl& rGraphWin ) : rWin( rGraphWin ) {};
+ virtual ~GraphCtrlUserCall() {};
+
+ virtual void Changed( const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect );
+};
+
+class GraphCtrlView : public SdrView
+{
+ GraphCtrl& rGraphCtrl;
+
+protected:
+
+ virtual void MarkListHasChanged()
+ {
+ SdrView::MarkListHasChanged();
+ rGraphCtrl.MarkListHasChanged();
+ }
+
+public:
+
+ GraphCtrlView( SdrModel* pModel, GraphCtrl* pWindow) :
+ SdrView ( pModel, pWindow ),
+ rGraphCtrl ( *pWindow ) {};
+
+ virtual ~GraphCtrlView() {};
+};
+
+#endif // _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 000000000000..650a300b6da6
--- /dev/null
+++ b/include/svx/graphichelper.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 _GRAPHICHELPER_HXX
+#define _GRAPHICHELPER_HXX
+
+#include <vcl/graph.hxx>
+#include <svx/svxdllapi.h>
+
+#include <com/sun/star/drawing/XShape.hpp>
+
+class SVX_DLLPUBLIC GraphicHelper
+{
+
+public:
+ static void GetPreferedExtension( OUString& rExtension, const Graphic& rGraphic );
+ static OUString ExportGraphic( const Graphic& rGraphic, const OUString& rGraphicName );
+ static void SaveShapeAsGraphic( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
+};
+
+
+#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 000000000000..06836b2827cd
--- /dev/null
+++ b/include/svx/grfcrop.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 _SVX_GRFCROP_HXX
+#define _SVX_GRFCROP_HXX
+
+#include <svl/poolitem.hxx>
+#include "svx/svxdllapi.h"
+
+
+#define GRFCROP_VERSION_SWDEFAULT 0
+#define GRFCROP_VERSION_MOVETOSVX 1
+
+class SVX_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();
+
+ // "pure virtual methods" from SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVer) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nIVer) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText,
+ const IntlWrapper* pIntl = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal,
+ sal_uInt8 nMemberId = 0 );
+
+ 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; }
+
+ inline SvxGrfCrop& operator=( const SvxGrfCrop& rCrop )
+ {
+ nLeft = rCrop.GetLeft(); nTop = rCrop.GetTop();
+ nRight = rCrop.GetRight(); nBottom = rCrop.GetBottom();
+ return *this;
+ }
+};
+
+
+#endif // _GRFATR_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 000000000000..8557c121c648
--- /dev/null
+++ b/include/svx/grfflt.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 _SVX_GRFFLT_HXX
+#define _SVX_GRFFLT_HXX
+
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <vcl/button.hxx>
+#include <vcl/timer.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/group.hxx>
+#include <vcl/salbtype.hxx>
+#include <svtools/grfmgr.hxx>
+#include <svx/graphctl.hxx>
+#include <svx/dlgctrl.hxx>
+#include <svx/rectenum.hxx>
+#include "svx/svxdllapi.h"
+
+// ---------------
+// - Error codes -
+// ---------------
+
+#define SVX_GRAPHICFILTER_ERRCODE_NONE 0x00000000
+#define SVX_GRAPHICFILTER_UNSUPPORTED_GRAPHICTYPE 0x00000001
+#define SVX_GRAPHICFILTER_UNSUPPORTED_SLOT 0x00000002
+
+// --------------------
+// - SvxGraphicFilter -
+// --------------------
+
+class SfxRequest;
+class SfxItemSet;
+
+class SVX_DLLPUBLIC SvxGraphicFilter
+{
+public:
+
+ static sal_uLong ExecuteGrfFilterSlot( SfxRequest& 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 000000000000..9a146353950d
--- /dev/null
+++ b/include/svx/gridctrl.hxx
@@ -0,0 +1,606 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_GRIDCTRL_HXX
+#define _SVX_GRIDCTRL_HXX
+
+#include <com/sun/star/sdbc/XRowSet.hpp>
+#include <com/sun/star/sdbc/XRowSetListener.hpp>
+#include <com/sun/star/sdb/XRowsChangeListener.hpp>
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#include <com/sun/star/util/XNumberFormatter.hpp>
+#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+
+#include <vcl/button.hxx>
+#include <tools/ref.hxx>
+#include <svtools/editbrowsebox.hxx>
+#include <osl/mutex.hxx>
+#include <comphelper/propmultiplex.hxx>
+#include <svtools/transfer.hxx>
+#include "svx/svxdllapi.h"
+#include <vector>
+
+class DbGridControl;
+class CursorWrapper;
+
+sal_Bool CompareBookmark(const ::com::sun::star::uno::Any& aLeft, const ::com::sun::star::uno::Any& aRight);
+
+namespace svxform
+{
+ class DataColumn;
+}
+typedef ::std::vector< ::svxform::DataColumn* > DbDataColumns;
+
+enum GridRowStatus
+{
+ GRS_CLEAN,
+ GRS_MODIFIED,
+ GRS_DELETED,
+ GRS_INVALID
+};
+
+//==================================================================
+// DbGridRow, description of rows
+//==================================================================
+
+class DbGridRow : public SvRefBase
+{
+ ::com::sun::star::uno::Any m_aBookmark; // ::com::sun::star::text::Bookmark of the row, can be set
+ DbDataColumns m_aVariants;
+ GridRowStatus m_eStatus;
+ sal_Bool m_bIsNew;
+ // row is no longer valid
+ // is removed on the next positioning
+public:
+ DbGridRow():m_eStatus(GRS_CLEAN), m_bIsNew(sal_True) { }
+ DbGridRow(CursorWrapper* pCur, sal_Bool bPaintCursor);
+ void SetState(CursorWrapper* pCur, sal_Bool bPaintCursor);
+
+ ~DbGridRow();
+
+ sal_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(sal_Bool _bNew) { m_bIsNew = _bNew; }
+ sal_Bool IsNew() const { return m_bIsNew; }
+
+ const ::com::sun::star::uno::Any& GetBookmark() const { return m_aBookmark; }
+
+ sal_Bool IsValid() const { return m_eStatus == GRS_CLEAN || m_eStatus == GRS_MODIFIED; }
+ sal_Bool IsModified() const { return m_eStatus == GRS_MODIFIED; }
+};
+
+SV_DECL_REF(DbGridRow)
+
+//==================================================================
+// DbGridControl
+//==================================================================
+class DbGridColumn;
+typedef ::std::vector< DbGridColumn* > DbGridColumns;
+
+//==================================================================
+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 InitWindowFacet
+{
+ InitFont = 0x01,
+ InitForeground = 0x02,
+ InitBackground = 0x04,
+ InitWritingMode = 0x08,
+ InitAll = 0xFF
+};
+
+//==================================================================
+class FmXGridSourcePropListener;
+class DisposeListenerGridBridge;
+typedef ::svt::EditBrowseBox DbGridControl_Base;
+class SVX_DLLPUBLIC DbGridControl : public DbGridControl_Base
+{
+ friend class FmXGridSourcePropListener;
+ friend class GridFieldValueListener;
+ friend class DisposeListenerGridBridge;
+
+public:
+ //==================================================================
+ // NavigationBar
+ //==================================================================
+ class NavigationBar: public Control
+ {
+ class AbsolutePos : public NumericField
+ {
+ public:
+ AbsolutePos(Window* pParent, WinBits nStyle = 0);
+
+ virtual void KeyInput(const KeyEvent& rEvt);
+ virtual void LoseFocus();
+ };
+
+ friend class NavigationBar::AbsolutePos;
+
+ // zusaetzliche Controls
+ FixedText m_aRecordText;
+ AbsolutePos m_aAbsolute; // absolute positioning
+ FixedText m_aRecordOf;
+ FixedText m_aRecordCount;
+
+ ImageButton m_aFirstBtn; // ImageButton for 'go to the first record'
+ ImageButton m_aPrevBtn; // ImageButton for 'go to the previous record'
+ ImageButton m_aNextBtn; // ImageButton for 'go to the next record'
+ ImageButton m_aLastBtn; // ImageButton for 'go to the last record'
+ ImageButton m_aNewBtn; // ImageButton for 'go to a new record'
+ sal_uInt16 m_nDefaultWidth;
+ sal_Int32 m_nCurrentPos;
+
+ sal_Bool m_bPositioning; // protect PositionDataSource against recursion
+
+ public:
+ // StatusIds for Controls of the Bar
+ // important for invalidation
+ enum State
+ {
+ RECORD_TEXT = 1,
+ RECORD_ABSOLUTE,
+ RECORD_OF,
+ RECORD_COUNT,
+ RECORD_FIRST,
+ RECORD_NEXT,
+ RECORD_PREV,
+ RECORD_LAST,
+ RECORD_NEW
+ };
+
+ NavigationBar(Window* pParent, WinBits nStyle = 0);
+
+ // Status methods for Controls
+ void InvalidateAll(sal_Int32 nCurrentPos = -1, sal_Bool bAll = sal_False);
+ void InvalidateState(sal_uInt16 nWhich) {SetState(nWhich);}
+ void SetState(sal_uInt16 nWhich);
+ sal_Bool GetState(sal_uInt16 nWhich) const;
+ sal_uInt16 GetDefaultWidth() const {return m_nDefaultWidth;}
+
+ protected:
+ virtual void Resize();
+ virtual void Paint(const Rectangle& rRect);
+ virtual void StateChanged( StateChangedType nType );
+
+ private:
+ DECL_LINK(OnClick, Button*);
+ sal_uInt16 ArrangeControls();
+
+ void PositionDataSource(sal_Int32 nRecord);
+ };
+
+ friend class DbGridControl::NavigationBar;
+
+public:
+ // these options are or'ed and indicate, which of the single
+ // features can be released, default is readonly which means 0
+ enum Option
+ {
+ OPT_READONLY = 0x00,
+ OPT_INSERT = 0x01,
+ OPT_UPDATE = 0x02,
+ OPT_DELETE = 0x04
+ };
+
+private:
+ Font m_aDefaultFont;
+ Link m_aMasterStateProvider;
+ Link m_aMasterSlotExecutor;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+
+ DbGridColumns m_aColumns; // Column description
+ NavigationBar 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
+
+ sal_uInt32 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.
+ ::comphelper::OPropertyChangeMultiplexer* m_pDataSourcePropMultiplexer;
+ FmXGridSourcePropListener* m_pDataSourcePropListener;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowsChangeListener>
+ m_xRowSetListener; // get notification when rows were changed
+
+ void* m_pFieldListeners;
+ // property listeners for field values
+
+ DisposeListenerGridBridge* m_pCursorDisposeListener;
+ // need to know about the diposing 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:
+ CursorWrapper* m_pDataCursor; // Cursor for Updates
+ CursorWrapper* 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;
+
+ com::sun::star::util::Date
+ m_aNullDate; // NullDate of the Numberformatter;
+
+ BrowserMode m_nMode;
+ sal_Int32 m_nCurrentPos; // Current position;
+ sal_uInt32 m_nDeleteEvent; // EventId for asychronous deletion of rows
+ sal_uInt16 m_nOptions; // What is the able to do (Insert, Update, Delete)
+ // default readonly
+ sal_uInt16 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;
+
+ sal_Bool m_bDesignMode : 1; // default = sal_False
+ sal_Bool m_bRecordCountFinal : 1;
+ sal_Bool m_bMultiSelection : 1;
+ sal_Bool m_bNavigationBar : 1;
+
+ sal_Bool m_bSynchDisplay : 1;
+ sal_Bool m_bForceROController : 1;
+ sal_Bool m_bHandle : 1;
+ sal_Bool m_bFilterMode : 1;
+ sal_Bool m_bWantDestruction : 1;
+ sal_Bool m_bInAdjustDataSource : 1;
+ sal_Bool m_bPendingAdjustRows : 1; // if an async adjust is pending, is it for AdjustRows or AdjustDataSource ?
+ sal_Bool m_bHideScrollbars : 1;
+
+protected:
+ sal_Bool m_bUpdating : 1; // are any updates being executed right now?
+
+protected:
+ virtual sal_Bool SeekRow(long nRow);
+ virtual void VisibleRowsChanged( long nNewTopRow, sal_uInt16 nNumRows);
+ virtual void PaintStatusCell(OutputDevice& rDev, const Rectangle& rRect) const;
+ virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId) const;
+ virtual RowStatus GetRowStatus(long nRow) const;
+ virtual sal_Bool CursorMoving(long nNewRow, sal_uInt16 nNewCol);
+ virtual void CursorMoved();
+ virtual void ArrangeControls(sal_uInt16& nX, sal_uInt16 nY);
+ virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId);
+ virtual void Command(const CommandEvent& rEvt);
+ virtual long PreNotify(NotifyEvent& rEvt);
+ virtual void KeyInput(const KeyEvent& rEvt);
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void Select();
+
+ virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol);
+
+ virtual void CellModified();
+ virtual sal_Bool SaveModified();
+ virtual sal_Bool IsModified() const;
+
+ virtual sal_uInt16 AppendColumn(const String& rName, sal_uInt16 nWidth = 0, sal_uInt16 nPos = HEADERBAR_APPEND, sal_uInt16 nId = (sal_uInt16)-1);
+ virtual void RemoveColumn(sal_uInt16 nId);
+ virtual DbGridColumn* CreateColumn(sal_uInt16 nId) const;
+ virtual void ColumnMoved(sal_uInt16 nId);
+ virtual sal_Bool SaveRow();
+ virtual sal_Bool IsTabAllowed(sal_Bool bForward) const;
+
+ /// 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);
+
+ virtual void DataSourcePropertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
+
+ virtual void FieldValueChanged(sal_uInt16 _nId, const ::com::sun::star::beans::PropertyChangeEvent& _evt);
+ virtual void FieldListenerDisposing(sal_uInt16 _nId);
+
+ virtual void disposing(sal_uInt16 _nId, const ::com::sun::star::lang::EventObject& _rEvt);
+
+ // 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 );
+
+ void executeRowContextMenu( long _nRow, const Point& _rPreferredPos );
+
+public:
+ DbGridControl(
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >,
+ Window* pParent,
+ WinBits nBits = WB_BORDER);
+
+ virtual ~DbGridControl();
+
+ virtual void Init();
+ virtual void InitColumnsByFields(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xFields) = 0;
+ virtual void RemoveRows();
+
+ /** 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 String GetCellText(long _nRow, sal_uInt16 _nColId) const;
+
+ void RemoveRows(sal_Bool bNewCursor);
+
+ void InvalidateStatus();
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& getNumberFormatter() const {return m_xFormatter;}
+
+ // the data source
+ // the options can restrict but not extend the update abilities
+ virtual void setDataSource(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& rCursor,
+ sal_uInt16 nOpts = OPT_INSERT | OPT_UPDATE | OPT_DELETE);
+ virtual void Dispatch(sal_uInt16 nId);
+
+ CursorWrapper* getDataSource() const {return m_pDataCursor;}
+ const DbGridColumns& GetColumns() const {return m_aColumns;}
+
+ void EnableHandle(sal_Bool bEnable);
+ sal_Bool HasHandle() const {return m_bHandle;}
+ void InsertHandleColumn();
+
+ // which position does the column with the id in the ::com::sun::star::sdbcx::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 ::com::sun::star::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 (sal_uInt16)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(sal_Bool bMode);
+ sal_Bool IsDesignMode() const {return m_bDesignMode;}
+ sal_Bool IsOpen() const {return m_pSeekCursor != NULL;}
+
+ virtual void SetFilterMode(sal_Bool bMode);
+ sal_Bool IsFilterMode() const {return m_bFilterMode;}
+ sal_Bool IsFilterRow(long nRow) const {return m_bFilterMode && nRow == 0;}
+
+ void EnableNavigationBar(sal_Bool bEnable);
+ sal_Bool HasNavigationBar() const {return m_bNavigationBar;}
+
+ sal_uInt16 GetOptions() const {return m_nOptions;}
+ NavigationBar& GetNavigationBar() {return m_aBar;}
+ sal_uInt16 SetOptions(sal_uInt16 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 com::sun::star::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(sal_Bool bFull = sal_False);
+ void Undo();
+
+ virtual void BeginCursorAction();
+ virtual void EndCursorAction();
+
+ // is the current line being updated
+ sal_Bool IsUpdating() const {return m_bUpdating;}
+
+ virtual void RowRemoved( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True );
+ virtual void RowInserted( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True, sal_Bool bKeepSelection = sal_False );
+ virtual void RowModified( long nRow, sal_uInt16 nColId = USHRT_MAX );
+
+ void resetCurrentRow();
+
+ sal_Bool getDisplaySynchron() const { return m_bSynchDisplay; }
+ void setDisplaySynchron(sal_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(sal_Bool bEnable);
+ sal_Bool IsPermanentCursorEnabled() const;
+
+ /** forces both scrollbars to be hidden
+
+ For the horizontal srollbar, this is overruled by enabling the navigation bar: A navigation
+ bar <b>always</b> implies a horizontal scroll bar
+ @seealso EnableNavigationBar
+ */
+ void ForceHideScrollbars( sal_Bool _bForce );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ getContext() const { return m_xContext; }
+
+ /// returns <TRUE/> if the text of the given cell can be copied into the clipboard
+ sal_Bool canCopyCellText(sal_Int32 _nRow, sal_Int16 _nColId);
+ /// copies the text of the given cell into the clipboard
+ void copyCellText(sal_Int32 _nRow, sal_Int16 _nColId);
+
+ // selectin listener handling
+ FmGridListener* getGridListener() const { return m_pGridListener; }
+ void setGridListener( FmGridListener* _pListener ) { m_pGridListener = _pListener; }
+
+ // helper class to grant access to selected methods from within the DbCellControl class
+ struct GrantControlAccess
+ {
+ friend class DbCellControl;
+ friend class RowSetEventListener;
+ protected:
+ 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; }
+ 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;
+
+ /** 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleControl( sal_Int32 _nIndex );
+
+ // 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnId );
+
+protected:
+ void RecalcRows(long nNewTopRow, sal_uInt16 nLinesOnScreen, sal_Bool bUpdateCursor);
+ sal_Bool SeekCursor(long nRow, sal_Bool bAbsolute = sal_False);
+ void RemoveColumns(); // cleaning of own structures
+ void AdjustRows();
+ sal_Int32 AlignSeekCursor();
+ sal_Bool SetCurrent(long nNewRow);
+
+ String GetCurrentRowCellText(DbGridColumn* pCol,const DbGridRowRef& _rRow) const;
+ virtual void DeleteSelectedRows();
+ sal_Bool IsValid(const DbGridRowRef& _xRow) const {return _xRow && _xRow->IsValid();}
+
+ // row which is currently being appended
+ sal_Bool IsCurrentAppending() const;
+
+ // empty row for insertion
+ sal_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; }
+ CursorWrapper* GetSeekCursor() const { return m_pSeekCursor; }
+
+
+ void ConnectToFields();
+ void DisconnectFromFields();
+
+ void implAdjustInSolarThread(sal_Bool _bRows);
+ // calls AdjustRows or AdjustDataSource, synchron if the caller is running in the solar thread, else asynchron
+
+protected:
+ virtual void InitController(::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol);
+ void Construct();
+ void ImplInitWindow( const InitWindowFacet _eInitWhat );
+ DECL_LINK(OnDelete, void*);
+
+ DECL_LINK(OnAsyncAdjust, void*);
+ // if the param is != NULL, AdjustRows will be called, else AdjustDataSource
+
+private:
+ using BrowseBox::InsertHandleColumn;
+};
+
+
+SV_IMPL_REF(DbGridRow);
+
+
+#endif // _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 000000000000..bb1d2f507d3d
--- /dev/null
+++ b/include/svx/hdft.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 _SVX_HDFT_HXX
+#define _SVX_HDFT_HXX
+
+#include <sfx2/tabdlg.hxx>
+
+#include <vcl/fixed.hxx>
+
+#include <vcl/field.hxx>
+
+#include <vcl/group.hxx>
+#include <svx/pagectrl.hxx>
+#include "svx/svxdllapi.h"
+
+namespace svx
+{
+ SVX_DLLPUBLIC bool ShowBorderBackgroundDlg( Window* pParent, SfxItemSet* pBBSet,
+ bool bEnableBackgroundSelector );
+}
+
+// class SvxHFPage ------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxHFPage: public SfxTabPage
+{
+ using TabPage::ActivatePage;
+ using TabPage::DeactivatePage;
+
+public:
+
+ virtual sal_Bool FillItemSet( SfxItemSet& rOutSet );
+ virtual void Reset( const SfxItemSet& rSet );
+
+ virtual ~SvxHFPage();
+
+ void DisableDeleteQueryBox() { bDisableQueryBox = sal_True; }
+ void EnableBackgroundSelector( sal_Bool bNew ) { bEnableBackgroundSelector = bNew; }
+ void EnableDynamicSpacing();
+
+protected:
+ virtual void ActivatePage( const SfxItemSet& rSet );
+ virtual int DeactivatePage( SfxItemSet* pSet = 0 );
+
+ SvxHFPage( Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSetId );
+
+ FixedText* m_pPageLbl;
+ CheckBox* m_pTurnOnBox;
+ CheckBox* m_pCntSharedBox;
+ CheckBox* m_pCntSharedFirstBox;
+ FixedText* m_pLMLbl;
+ MetricField* m_pLMEdit;
+ FixedText* m_pRMLbl;
+ MetricField* m_pRMEdit;
+ FixedText* m_pDistFT;
+ MetricField* m_pDistEdit;
+ CheckBox* m_pDynSpacingCB;
+ FixedText* m_pHeightFT;
+ MetricField* m_pHeightEdit;
+ CheckBox* m_pHeightDynBtn;
+ SvxPageWindow* m_pBspWin;
+ PushButton* m_pBackgroundBtn;
+
+ sal_uInt16 nId;
+ SfxItemSet* pBBSet;
+ sal_Bool bDisableQueryBox;
+ sal_Bool bEnableBackgroundSelector;
+ bool bInReset;
+
+ void InitHandler();
+ DECL_LINK( TurnOnHdl, CheckBox*);
+ DECL_LINK(DistModify, void *);
+ DECL_LINK(HeightModify, void *);
+ DECL_LINK(BorderModify, void *);
+ DECL_LINK(BackgroundHdl, void *);
+
+ void UpdateExample();
+ DECL_LINK(RangeHdl, void *);
+
+private:
+#ifdef _SVX_HDFT_CXX
+ SVX_DLLPRIVATE void ResetBackground_Impl( const SfxItemSet& rSet );
+#endif
+};
+
+// class SvxHeaderPage ---------------------------------------------------
+
+class SVX_DLLPUBLIC SvxHeaderPage : public SvxHFPage
+{
+public:
+ static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
+ static sal_uInt16* GetRanges();
+
+private:
+ SvxHeaderPage( Window* pParent, const SfxItemSet& rSet );
+};
+
+// class SvxFooterPage ---------------------------------------------------
+
+class SVX_DLLPUBLIC SvxFooterPage : public SvxHFPage
+{
+public:
+ static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
+ static sal_uInt16* GetRanges();
+
+private:
+ SVX_DLLPRIVATE SvxFooterPage( Window* pParent, const SfxItemSet& rSet );
+};
+
+#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 000000000000..1c9ecd417732
--- /dev/null
+++ b/include/svx/helperhittest3d.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_HELPERHITTEST_HXX
+#define INCLUDED_SVX_HELPERHITTEST_HXX
+
+#include "svx/svxdllapi.h"
+#include <sal/types.h>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class B2DPoint;
+}
+
+namespace drawinglayer { namespace 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
+
+*/
+SVX_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_HELPERHITTEST_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 000000000000..d1bdcfe5aa71
--- /dev/null
+++ b/include/svx/hlnkitem.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 _SVX_HLNKITEM_HXX
+#define _SVX_HLNKITEM_HXX
+
+#include <tools/string.hxx>
+#include <svl/poolitem.hxx>
+#include <sfx2/sfxsids.hrc>
+#include <svl/macitem.hxx>
+#include "svx/svxdllapi.h"
+
+#define HYPERDLG_EVENT_MOUSEOVER_OBJECT 0x0001
+#define HYPERDLG_EVENT_MOUSECLICK_OBJECT 0x0002
+#define HYPERDLG_EVENT_MOUSEOUT_OBJECT 0x0004
+
+enum SvxLinkInsertMode
+{
+ HLINK_DEFAULT,
+ HLINK_FIELD,
+ HLINK_BUTTON,
+ HLINK_HTMLMODE = 0x0080
+};
+
+class SVX_DLLPUBLIC SvxHyperlinkItem : public SfxPoolItem
+{
+ String sName;
+ String sURL;
+ String sTarget;
+ SvxLinkInsertMode eType;
+
+ String sIntName;
+ SvxMacroTableDtor* pMacroTable;
+
+ sal_uInt16 nMacroEvents;
+
+public:
+ TYPEINFO();
+
+ SvxHyperlinkItem( sal_uInt16 _nWhich = SID_HYPERLINK_GETLINK ):
+ SfxPoolItem(_nWhich), pMacroTable(NULL) { eType = HLINK_DEFAULT; nMacroEvents=0; };
+ SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem );
+ SvxHyperlinkItem( sal_uInt16 nWhich, String& rName, String& rURL,
+ String& rTarget, String& rIntName,
+ SvxLinkInsertMode eTyp = HLINK_FIELD,
+ sal_uInt16 nEvents = 0,
+ SvxMacroTableDtor *pMacroTbl =NULL );
+ virtual ~SvxHyperlinkItem () { delete pMacroTable; }
+
+ inline SvxHyperlinkItem& operator=( const SvxHyperlinkItem &rItem );
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ const String& GetName() const { return sName; }
+ void SetName(const String& rName) { sName = rName; }
+
+ const String& GetURL() const { return sURL; }
+ void SetURL(const String& rURL) { sURL = rURL; }
+
+ const String& GetIntName () const { return sIntName; }
+ void SetIntName(const String& rIntName) { sIntName = rIntName; }
+
+ const String& GetTargetFrame() const { return sTarget; }
+ void SetTargetFrame(const String& rTarget) { sTarget = rTarget; }
+
+ SvxLinkInsertMode GetInsertMode() const { return eType; }
+ void SetInsertMode( SvxLinkInsertMode eNew ) { eType = eNew; }
+
+ void SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro );
+
+ void SetMacroTable( const SvxMacroTableDtor& rTbl );
+ const SvxMacroTableDtor* GetMacroTbl() const { return pMacroTable; }
+
+ void SetMacroEvents (const sal_uInt16 nEvents) { nMacroEvents = nEvents; }
+ sal_uInt16 GetMacroEvents() const { return nMacroEvents; }
+
+ virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVer ) const;
+
+};
+
+#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 000000000000..b7215ce1b732
--- /dev/null
+++ b/include/svx/hyperdlg.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 _SVX_TAB_HYPERLINK_HXX
+#define _SVX_TAB_HYPERLINK_HXX
+
+#include <sfx2/childwin.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* Hyperlink-Dialog
+|*
+\************************************************************************/
+
+class AbstractSvxHpLinkDlg;
+
+class SVX_DLLPUBLIC SvxHlinkDlgWrapper : public SfxChildWindow
+{
+private:
+ AbstractSvxHpLinkDlg* mpDlg;
+
+public:
+ SvxHlinkDlgWrapper( Window*pParent, sal_uInt16 nId,
+ SfxBindings* pBindings, SfxChildWinInfo* pInfo );
+
+ SFX_DECL_CHILDWINDOW_WITHID(SvxHlinkDlgWrapper);
+ virtual sal_Bool QueryClose();
+};
+
+#endif // _SVX_TAB_HYPERLINK_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 000000000000..20ab313de5e1
--- /dev/null
+++ b/include/svx/ifaceids.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 _SVX_IFACEIDS_HXX
+#define _SVX_IFACEIDS_HXX
+
+// -----------------------------------------------------------------------
+
+#include <sfx2/shell.hxx>
+
+#define SVX_INTERFACE_BASIDE_DOCSH (SFX_INTERFACE_IDE_START+ 0)
+#define SVX_INTERFACE_BASIDE_VIEWSH (SFX_INTERFACE_IDE_START+ 1)
+#define SVX_INTERFACE_EXTRUSION_BAR (SFX_INTERFACE_IDE_START+ 2)
+#define SVX_INTERFACE_FONTWORK_BAR (SFX_INTERFACE_IDE_START+ 3)
+
+#define HID_INTERFACE_BASIDE_VIEWSH SVX_INTERFACE_BASIDE_VIEWSH
+
+#define SVX_INTERFACE_FORM_SH (SFX_INTERFACE_IDE_END+ 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 000000000000..9afd8b01a6fa
--- /dev/null
+++ b/include/svx/imapdlg.hxx
@@ -0,0 +1,180 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#ifndef _IMAPDLG_HXX_
+#define _IMAPDLG_HXX_
+
+#include <svtools/inettbc.hxx>
+#include <sfx2/childwin.hxx>
+#include <sfx2/ctrlitem.hxx>
+#include <sfx2/basedlgs.hxx>
+
+#include <vcl/fixed.hxx>
+
+#include <vcl/combobox.hxx>
+
+#include <vcl/edit.hxx>
+
+#include <vcl/toolbox.hxx>
+
+#include <vcl/status.hxx>
+#include "svx/svxdllapi.h"
+#include <vector>
+
+
+#ifndef _GOMISC_HXX
+class ImageMap;
+#endif
+
+
+/*************************************************************************
+|*
+|* Derivation from SfxChildWindow as "container" for float
+|*
+\************************************************************************/
+
+class Graphic;
+typedef ::std::vector< String* > TargetList;
+
+class SVX_DLLPUBLIC SvxIMapDlgChildWindow : public SfxChildWindow
+{
+ public:
+
+ SvxIMapDlgChildWindow( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
+
+ SFX_DECL_CHILDWINDOW_WITHID( SvxIMapDlgChildWindow );
+
+ static void UpdateIMapDlg( const Graphic& rGraphic, const ImageMap* pImageMap = NULL,
+ const TargetList* pTargetList = NULL, void* pEditingObj = NULL );
+};
+
+
+#ifndef _REDUCED_IMAPDLG_HXX_
+#define _REDUCED_IMAPDLG_HXX_
+
+class SvxIMapDlg;
+
+class SvxIMapDlgItem : public SfxControllerItem
+{
+ SvxIMapDlg& rIMap;
+
+
+protected:
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+
+
+public:
+
+ SvxIMapDlgItem( sal_uInt16 nId, SvxIMapDlg& rIMapDlg, SfxBindings& rBindings );
+};
+
+class IMapOwnData;
+class IMapWindow;
+
+class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow
+{
+ friend class IMapOwnData;
+ friend class IMapWindow;
+ using Window::Update;
+
+ ToolBox aTbxIMapDlg1;
+ FixedText aFtURL;
+ SvtURLBox maURLBox;
+ FixedText aFtText;
+ Edit aEdtText;
+ FixedText maFtTarget;
+ ComboBox maCbbTarget;
+ StatusBar aStbStatus;
+ ImageList maImageList;
+
+ Size aLastSize;
+ IMapWindow* pIMapWnd;
+ IMapOwnData* pOwnData;
+ void* pCheckObj;
+ SvxIMapDlgItem aIMapItem;
+
+ virtual void Resize();
+ virtual sal_Bool Close();
+
+#ifdef _IMAPDLG_PRIVATE
+
+ DECL_LINK( TbxClickHdl, ToolBox* );
+ DECL_LINK( InfoHdl, IMapWindow* );
+ DECL_LINK( MousePosHdl, IMapWindow* );
+ DECL_LINK( GraphSizeHdl, IMapWindow* );
+ DECL_LINK( URLModifyHdl, void* );
+ DECL_LINK( URLLoseFocusHdl, void* );
+ DECL_LINK(UpdateHdl, void *);
+ DECL_LINK( TbxUpdateHdl, Timer* );
+ DECL_LINK( StateHdl, IMapWindow* );
+ DECL_LINK( MiscHdl, void* );
+
+ void DoOpen();
+ sal_Bool DoSave();
+
+#endif
+
+
+public:
+
+ SvxIMapDlg( SfxBindings *pBindings, SfxChildWindow *pCW,
+ Window* pParent, const ResId& rResId );
+ ~SvxIMapDlg();
+
+ void SetExecState( sal_Bool bEnable );
+
+ void SetGraphic( const Graphic& rGraphic );
+
+ void SetEditingObject( void* pObj ) { pCheckObj = pObj; }
+ const void* GetEditingObject() const { return pCheckObj; }
+
+ void SetImageMap( const ImageMap& rImageMap );
+ const ImageMap& GetImageMap() const;
+
+ void SetTargetList( const TargetList& rTargetList );
+
+ void Update( const Graphic& rGraphic, const ImageMap* pImageMap = NULL,
+ const TargetList* pTargetList = NULL, void* pEditingObj = NULL );
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ void ApplyImageList();
+};
+
+
+/*************************************************************************
+|*
+|* Defines
+|*
+\************************************************************************/
+
+#define SVXIMAPDLG() ( (SvxIMapDlg*) ( SfxViewFrame::Current()->GetChildWindow( \
+ SvxIMapDlgChildWindow::GetChildWindowId() )-> \
+ GetWindow() ) )
+
+
+#endif // _REDUCED_IMAPDLG_HXX_
+#endif // _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 000000000000..9fbcd4e0e490
--- /dev/null
+++ b/include/svx/insctrl.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 _SVX_INSCTRL_HXX
+#define _SVX_INSCTRL_HXX
+
+#include <sfx2/stbitem.hxx>
+#include "svx/svxdllapi.h"
+
+// class SvxInsertToolBoxControl -----------------------------------------
+
+class SVX_DLLPUBLIC SvxInsertStatusBarControl : public SfxStatusBarControl
+{
+public:
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual void Click();
+ virtual void Paint( const UserDrawEvent& rEvt );
+
+ SFX_DECL_STATUSBAR_CONTROL();
+
+ SvxInsertStatusBarControl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb );
+ ~SvxInsertStatusBarControl();
+
+private:
+ sal_Bool bInsert;
+
+#ifdef _SVX_INSCTRL_CXX
+ SVX_DLLPRIVATE void DrawItemText_Impl();
+#endif
+};
+
+
+#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 000000000000..870ebce0b922
--- /dev/null
+++ b/include/svx/ipolypolygoneditorcontroller.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 _SDR_IPOLYPOLYGONEDITORCONTROLLER_HXX
+#define _SDR_IPOLYPOLYGONEDITORCONTROLLER_HXX
+
+#include "svx/svxdllapi.h"
+#include <svx/svdedtv.hxx>
+
+//************************************************************
+// Defines
+//************************************************************
+
+enum SdrPathSmoothKind {SDRPATHSMOOTH_DONTCARE, // only for status query
+ SDRPATHSMOOTH_ANGULAR, // angular
+ SDRPATHSMOOTH_ASYMMETRIC, // asymmetric, normal Smooth
+ SDRPATHSMOOTH_SYMMETRIC}; // symmetric
+
+enum SdrPathSegmentKind {SDRPATHSEGMENT_DONTCARE, // only for status query
+ SDRPATHSEGMENT_LINE, // straight path segment
+ SDRPATHSEGMENT_CURVE, // curve path segment (Bezier)
+ SDRPATHSEGMENT_TOGGLE}; // only for Set: Toggle
+
+enum SdrObjClosedKind {SDROBJCLOSED_DONTCARE, // only for status query
+ SDROBJCLOSED_OPEN, // non-closed object (line, polyline, ...)
+ SDROBJCLOSED_CLOSED, // closed object (polygon, ...)
+ SDROBJCLOSED_TOGGLE}; // only for Set: Toggle (not implemented yet)
+
+class IPolyPolygonEditorController
+{
+public:
+ virtual void DeleteMarkedPoints() = 0;
+ virtual sal_Bool IsDeleteMarkedPointsPossible() const = 0;
+
+ virtual void RipUpAtMarkedPoints() = 0;
+ virtual bool IsRipUpAtMarkedPointsPossible() const = 0;
+
+ virtual sal_Bool IsSetMarkedSegmentsKindPossible() const = 0;
+ virtual SdrPathSegmentKind GetMarkedSegmentsKind() const = 0;
+ virtual void SetMarkedSegmentsKind(SdrPathSegmentKind eKind) = 0;
+
+ virtual sal_Bool IsSetMarkedPointsSmoothPossible() const = 0;
+ virtual SdrPathSmoothKind GetMarkedPointsSmooth() const = 0;
+ virtual void SetMarkedPointsSmooth(SdrPathSmoothKind eKind) = 0;
+
+ virtual void CloseMarkedObjects(sal_Bool bToggle, sal_Bool bOpen ) = 0;
+ virtual bool IsOpenCloseMarkedObjectsPossible() const = 0;
+ virtual SdrObjClosedKind GetMarkedObjectsClosedState() const = 0;
+
+protected:
+ ~IPolyPolygonEditorController() {}
+};
+
+#endif //_SDR_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 000000000000..d2a1b25997e0
--- /dev/null
+++ b/include/svx/itemwin.hxx
@@ -0,0 +1,186 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_ITEMWIN_HXX
+#define _SVX_ITEMWIN_HXX
+
+#include <vcl/bitmap.hxx>
+
+#include <svx/dlgctrl.hxx>
+#include "svx/svxdllapi.h"
+
+// forward ---------------------------------------------------------------
+
+class XLineColorItem;
+class XLineWidthItem;
+class SfxObjectShell;
+
+// class SvxLineBox ------------------------------------------------------
+
+class SvxLineBox : public LineLB
+{
+ sal_uInt16 nCurPos;
+ Timer aDelayTimer;
+ Size aLogicalSize;
+ sal_Bool bRelease;
+ SfxObjectShell* mpSh;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
+
+#ifdef _SVX_ITEMWIN_CXX
+ DECL_LINK(DelayHdl_Impl, void *);
+
+ void ReleaseFocus_Impl();
+#endif
+public:
+ SvxLineBox( Window* pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
+ ~SvxLineBox();
+
+ void FillControl();
+
+protected:
+ virtual void Select();
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+};
+
+// class SvxColorBox -----------------------------------------------------
+
+class SvxColorBox : public ColorLB
+{
+ using Window::Update;
+
+ sal_uInt16 nCurPos;
+ Timer aDelayTimer;
+ Size aLogicalSize;
+ sal_Bool bRelease;
+ OUString maCommand;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
+
+#ifdef _SVX_ITEMWIN_CXX
+ void ReleaseFocus_Impl();
+#endif
+
+public:
+ SvxColorBox( Window* pParent,
+ const OUString& rCommand,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
+ ~SvxColorBox();
+
+ void Update( const XLineColorItem* pItem );
+
+protected:
+ virtual void Select();
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+};
+
+// class SvxMetricField --------------------------------------------------
+
+class SVX_DLLPUBLIC SvxMetricField : public MetricField
+{
+ using Window::Update;
+
+ String aCurTxt;
+ SfxMapUnit ePoolUnit;
+ FieldUnit eDlgUnit;
+ Size aLogicalSize;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
+
+#ifdef _SVX_ITEMWIN_CXX
+ void ReleaseFocus_Impl();
+#endif
+
+protected:
+ virtual void Modify();
+ virtual void Down();
+ virtual void Up(); // just to be sure
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+public:
+ SvxMetricField( Window* pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ WinBits nBits = WB_BORDER | WB_SPIN | WB_REPEAT );
+ ~SvxMetricField();
+
+ void Update( const XLineWidthItem* pItem );
+ void SetCoreUnit( SfxMapUnit eUnit );
+ void RefreshDlgUnit();
+};
+
+// class SvxFillTypeBox --------------------------------------------------
+
+class SvxFillTypeBox : public FillTypeLB
+{
+public:
+ SvxFillTypeBox( Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
+ ~SvxFillTypeBox();
+
+ void Selected() { bSelect = sal_True; }
+ sal_Bool IsRelease() { return bRelease;}
+
+protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+private:
+ sal_uInt16 nCurPos;
+ sal_Bool bSelect;
+ sal_Bool bRelease;
+
+#ifdef _SVX_ITEMWIN_CXX
+ void ReleaseFocus_Impl();
+#endif
+};
+
+// class SvxFillAttrBox --------------------------------------------------
+
+class SvxFillAttrBox : public FillAttrLB
+{
+public:
+ SvxFillAttrBox( Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
+ ~SvxFillAttrBox();
+
+ sal_Bool IsRelease() { return bRelease;}
+
+protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void Select();
+
+private:
+ sal_uInt16 nCurPos;
+ sal_Bool bRelease;
+
+#ifdef _SVX_ITEMWIN_CXX
+ void ReleaseFocus_Impl();
+#endif
+};
+
+#endif // #ifndef _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 000000000000..3202e4d65495
--- /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/.
+ */
+
+#if !defined SVX_ITEXTPROVIDER_HXX_INCLUDED
+#define SVX_ITEXTPROVIDER_HXX_INCLUDED
+
+#include <sal/types.h>
+
+#include <svx/svxdllapi.h>
+
+class SdrText;
+
+namespace svx
+{
+
+ /** This interface provides access to text object(s) in an SdrObject.
+
+ */
+ class SVX_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/langbox.hxx b/include/svx/langbox.hxx
new file mode 100644
index 000000000000..106af28ee913
--- /dev/null
+++ b/include/svx/langbox.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 _SVX_LANGBOX_HXX
+#define _SVX_LANGBOX_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <vcl/lstbox.hxx>
+#include "svx/svxdllapi.h"
+#include <vcl/image.hxx>
+#include <tools/solar.h>
+
+class SvtLanguageTable;
+
+#define LANG_LIST_EMPTY 0x0000
+#define LANG_LIST_ALL 0x0001
+#define LANG_LIST_WESTERN 0x0002
+#define LANG_LIST_CTL 0x0004
+#define LANG_LIST_CJK 0x0008
+#define LANG_LIST_FBD_CHARS 0x0010
+#define LANG_LIST_SPELL_AVAIL 0x0020
+#define LANG_LIST_HYPH_AVAIL 0x0040
+#define LANG_LIST_THES_AVAIL 0x0080
+#define LANG_LIST_ONLY_KNOWN 0x0100 // list only locales provided by I18N
+#define LANG_LIST_SPELL_USED 0x0200
+#define LANG_LIST_HYPH_USED 0x0400
+#define LANG_LIST_THES_USED 0x0800
+#define LANG_LIST_ALSO_PRIMARY_ONLY 0x1000 // Do not exclude primary-only
+ // languages that do not form a
+ // locale, such as Arabic as
+ // opposed to Arabic-Egypt.
+
+
+// load language strings from resource
+SVX_DLLPUBLIC String GetDicInfoStr( const String& rName, const sal_uInt16 nLang, bool bNeg );
+
+class SVX_DLLPUBLIC SvxLanguageBox : public ListBox
+{
+public:
+
+private:
+ Image m_aNotCheckedImage;
+ Image m_aCheckedImage;
+ String m_aAllString;
+ com::sun::star::uno::Sequence< sal_Int16 > *m_pSpellUsedLang;
+ SvtLanguageTable* m_pLangTable;
+ sal_Int16 m_nLangList;
+ sal_Bool m_bHasLangNone;
+ sal_Bool m_bLangNoneIsLangAll;
+ sal_Bool m_bWithCheckmark;
+
+ SVX_DLLPRIVATE void Init();
+ SVX_DLLPRIVATE sal_uInt16 ImplInsertImgEntry( const String& rEntry, sal_uInt16 nPos, bool bChecked );
+ SVX_DLLPRIVATE sal_uInt16 ImplInsertLanguage(LanguageType, sal_uInt16, sal_Int16 );
+
+public:
+ SvxLanguageBox(Window* pParent, const ResId& rResId, sal_Bool bCheck = sal_False);
+ SvxLanguageBox(Window* pParent, WinBits nBits, sal_Bool bCheck = sal_False);
+ ~SvxLanguageBox();
+
+ void SetLanguageList( sal_Int16 nLangList,
+ sal_Bool bHasLangNone, sal_Bool bLangNoneIsLangAll = sal_False,
+ sal_Bool bCheckSpellAvail = sal_False );
+
+ sal_uInt16 InsertLanguage( const LanguageType eLangType, sal_uInt16 nPos = LISTBOX_APPEND );
+ sal_uInt16 InsertDefaultLanguage( sal_Int16 nType, sal_uInt16 nPos = LISTBOX_APPEND );
+ sal_uInt16 InsertSystemLanguage( sal_uInt16 nPos = LISTBOX_APPEND );
+ sal_uInt16 InsertLanguage( const LanguageType eLangType,
+ sal_Bool bCheckEntry, sal_uInt16 nPos = LISTBOX_APPEND );
+ void RemoveLanguage( const LanguageType eLangType );
+ void SelectLanguage( const LanguageType eLangType, sal_Bool bSelect = sal_True );
+ LanguageType GetSelectLanguage() const;
+ sal_Bool IsLanguageSelected( const LanguageType eLangType ) const;
+};
+
+#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 000000000000..c43c4265bb2c
--- /dev/null
+++ b/include/svx/lathe3d.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 _E3D_LATHE3D_HXX
+#define _E3D_LATHE3D_HXX
+
+#include <svx/obj3d.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* 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 SVX_DLLPUBLIC E3dLatheObj : public E3dCompoundObject
+{
+private:
+ // Part codes for Wireframe generation: standard oder cover surface
+ enum { LATHE_PART_STD = 1, LATHE_PART_COVER = 2 };
+ basegfx::B2DPolyPolygon maPolyPoly2D;
+
+ protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+ void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+
+ public:
+ TYPEINFO();
+ E3dLatheObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon rPoly2D);
+ E3dLatheObj();
+
+ // HorizontalSegments:
+ sal_uInt32 GetHorizontalSegments() const
+ { return ((const Svx3DHorizontalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); }
+
+ // VerticalSegments:
+ sal_uInt32 GetVerticalSegments() const
+ { return ((const Svx3DVerticalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); }
+
+ // PercentDiagonal: 0..100, before 0.0..0.5
+ sal_uInt16 GetPercentDiagonal() const
+ { return ((const Svx3DPercentDiagonalItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); }
+
+ // BackScale: 0..100, before 0.0..1.0
+ sal_uInt16 GetBackScale() const
+ { return ((const Svx3DBackscaleItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); }
+
+ // EndAngle: 0..10000
+ sal_uInt32 GetEndAngle() const
+ { return ((const Svx3DEndAngleItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_END_ANGLE)).GetValue(); }
+
+ // #107245# GetSmoothNormals() for bLatheSmoothed
+ sal_Bool GetSmoothNormals() const
+ { return ((const Svx3DSmoothNormalsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS)).GetValue(); }
+
+ // #107245# GetSmoothLids() for bLatheSmoothFrontBack
+ sal_Bool GetSmoothLids() const
+ { return ((const Svx3DSmoothLidsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS)).GetValue(); }
+
+ // #107245# GetCharacterMode() for bLatheCharacterMode
+ sal_Bool GetCharacterMode() const
+ { return ((const Svx3DCharacterModeItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE)).GetValue(); }
+
+ // #107245# GetCloseFront() for bLatheCloseFront
+ sal_Bool GetCloseFront() const
+ { return ((const Svx3DCloseFrontItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT)).GetValue(); }
+
+ // #107245# GetCloseBack() for bLatheCloseBack
+ sal_Bool GetCloseBack() const
+ { return ((const Svx3DCloseBackItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK)).GetValue(); }
+
+ virtual sal_uInt16 GetObjIdentifier() const;
+
+ virtual E3dLatheObj* Clone() const;
+
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+ // TakeObjName...() is for the display in the UI, for example "3 frames selected".
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ // set/get local parameters with geometry recreation
+ void SetPolyPoly2D(const basegfx::B2DPolyPolygon& rNew);
+ const basegfx::B2DPolyPolygon& GetPolyPoly2D() { return maPolyPoly2D; }
+
+ // break up
+ virtual bool IsBreakObjPossible();
+ virtual SdrAttrObj* GetBreakObj();
+};
+
+#endif // _E3D_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 000000000000..b32c2a514adc
--- /dev/null
+++ b/include/svx/layctrl.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 _SVX_LAYCTRL_HXX
+#define _SVX_LAYCTRL_HXX
+
+#include <sfx2/tbxctrl.hxx>
+#include "svx/svxdllapi.h"
+
+// class SvxTableToolBoxControl ------------------------------------------
+
+class SVX_DLLPUBLIC SvxTableToolBoxControl : public SfxToolBoxControl
+{
+private:
+ bool bEnabled;
+
+public:
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+ virtual SfxPopupWindow* CreatePopupWindowCascading();
+ virtual void StateChanged( sal_uInt16 nSID,
+ SfxItemState eState,
+ const SfxPoolItem* pState );
+
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxTableToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxTableToolBoxControl();
+};
+
+// class SvxColumnsToolBoxControl ----------------------------------------
+
+class SVX_DLLPUBLIC SvxColumnsToolBoxControl : public SfxToolBoxControl
+{
+ bool bEnabled;
+public:
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+ virtual SfxPopupWindow* CreatePopupWindowCascading();
+
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxColumnsToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxColumnsToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID,
+ SfxItemState eState,
+ const SfxPoolItem* pState );
+};
+
+
+#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 000000000000..2c449b0db745
--- /dev/null
+++ b/include/svx/lboxctrl.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 _SVX_LBOXCTRL_HXX_
+#define _SVX_LBOXCTRL_HXX_
+
+#include <sfx2/tbxctrl.hxx>
+#include <rtl/ustring.hxx>
+#include <vector>
+#include "svx/svxdllapi.h"
+
+class ToolBox;
+class SvxPopupWindowListBox;
+
+/////////////////////////////////////////////////////////////////
+
+class SvxListBoxControl : public SfxToolBoxControl
+{
+protected:
+ String aActionStr;
+ SvxPopupWindowListBox * pPopupWin;
+
+ void Impl_SetInfo( sal_uInt16 nCount );
+
+ DECL_LINK( PopupModeEndHdl, void * );
+ DECL_LINK( SelectHdl, void * );
+
+public:
+ SvxListBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ virtual ~SvxListBoxControl();
+
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+ virtual void StateChanged( sal_uInt16 nSID,
+ SfxItemState eState,
+ const SfxPoolItem* pState );
+};
+
+/////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SvxUndoRedoControl : public SvxListBoxControl
+{
+ std::vector< OUString > aUndoRedoList;
+ OUString aDefaultText;
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxUndoRedoControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+
+ virtual ~SvxUndoRedoControl();
+ virtual void StateChanged( sal_uInt16 nSID,
+ SfxItemState eState,
+ const SfxPoolItem* pState );
+
+ virtual SfxPopupWindow* CreatePopupWindow();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/linectrl.hxx b/include/svx/linectrl.hxx
new file mode 100644
index 000000000000..4d09d55183a4
--- /dev/null
+++ b/include/svx/linectrl.hxx
@@ -0,0 +1,168 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_LINECTRL_HXX
+#define _SVX_LINECTRL_HXX
+
+
+#include <svtools/valueset.hxx>
+#include <svl/lstner.hxx>
+#include <sfx2/tbxctrl.hxx>
+#include <svx/svxdllapi.h>
+#include <svx/xtable.hxx>
+
+class XLineStyleItem;
+class XLineDashItem;
+class SvxLineBox;
+class SvxMetricField;
+class SvxColorBox;
+
+//========================================================================
+// SvxLineStyleController:
+//========================================================================
+
+class SVX_DLLPUBLIC SvxLineStyleToolBoxControl : public SfxToolBoxControl
+{
+private:
+ XLineStyleItem* pStyleItem;
+ XLineDashItem* pDashItem;
+
+ sal_Bool bUpdate;
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxLineStyleToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxLineStyleToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ void Update( const SfxPoolItem* pState );
+ virtual Window* CreateItemWindow( Window *pParent );
+};
+
+//========================================================================
+// SvxLineWidthController:
+//========================================================================
+
+class SVX_DLLPUBLIC SvxLineWidthToolBoxControl : public SfxToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxLineWidthToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxLineWidthToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual Window* CreateItemWindow( Window *pParent );
+};
+
+//========================================================================
+// SvxLineColorController:
+//========================================================================
+
+class SVX_DLLPUBLIC SvxLineColorToolBoxControl : public SfxToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxLineColorToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxLineColorToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ void Update( const SfxPoolItem* pState );
+ virtual Window* CreateItemWindow( Window *pParent );
+};
+
+//========================================================================
+// class SvxLineEndWindow
+//========================================================================
+class SvxLineEndWindow : public SfxPopupWindow
+{
+ using FloatingWindow::StateChanged;
+
+private:
+ XLineEndListRef pLineEndList;
+ ValueSet aLineEndSet;
+ sal_uInt16 nCols;
+ sal_uInt16 nLines;
+ sal_uIntPtr nLineEndWidth;
+ Size aBmpSize;
+ sal_Bool bPopupMode;
+ bool mbInResize;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
+
+
+ DECL_LINK( SelectHdl, void * );
+ void FillValueSet();
+ void SetSize();
+ void implInit();
+
+protected:
+ virtual void Resizing( Size& rSize );
+ virtual void Resize();
+ virtual sal_Bool Close();
+ virtual void PopupModeEnd();
+
+ /** This function is called when the window gets the focus. It grabs
+ the focus to the line ends value set so that it can be controlled with
+ the keyboard.
+ */
+ virtual void GetFocus (void);
+
+public:
+ SvxLineEndWindow( sal_uInt16 nId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ const String& rWndTitle );
+ SvxLineEndWindow( sal_uInt16 nId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ Window* pParentWindow,
+ const String& rWndTitle );
+ ~SvxLineEndWindow();
+
+ void StartSelection();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual SfxPopupWindow* Clone() const;
+};
+
+//========================================================================
+// class SvxLineEndToolBoxControl
+//========================================================================
+
+class SVX_DLLPUBLIC SvxLineEndToolBoxControl : public SfxToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxLineEndToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxLineEndToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+};
+
+
+
+#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 000000000000..67d41adb6384
--- /dev/null
+++ b/include/svx/linkwarn.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 _SFX_LINKWARN_HXX
+#define _SFX_LINKWARN_HXX
+
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <sfx2/basedlgs.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC SvxLinkWarningDialog : public SfxModalDialog
+{
+private:
+ FixedImage m_aQueryImage;
+ FixedText m_aInfoText;
+ OKButton m_aLinkGraphicBtn;
+ CancelButton m_aEmbedGraphicBtn;
+ FixedLine m_aOptionLine;
+ CheckBox m_aWarningOnBox;
+
+ void InitSize();
+
+public:
+ SvxLinkWarningDialog( Window* pParent, const String& _rFileName );
+ virtual ~SvxLinkWarningDialog();
+};
+
+#endif // #ifndef _SFX_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 000000000000..dfd1ff7202de
--- /dev/null
+++ b/include/svx/measctrl.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 _SVX_MEASCTRL_HXX
+#define _SVX_MEASCTRL_HXX
+
+#include <vcl/ctrl.hxx>
+#include "svx/svxdllapi.h"
+
+
+class SfxItemSet;
+class SdrMeasureObj;
+class SdrModel;
+
+/*************************************************************************
+|*
+|* SvxXMeasurePreview
+|*
+\************************************************************************/
+class SVX_DLLPUBLIC SvxXMeasurePreview : public Control
+{
+ friend class SvxMeasurePage;
+
+private:
+ const SfxItemSet& rAttrs;
+ SdrMeasureObj* pMeasureObj;
+ SdrModel* pModel;
+
+public:
+ SvxXMeasurePreview( Window* pParent, const ResId& rResId,
+ const SfxItemSet& rInAttrs );
+ ~SvxXMeasurePreview();
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+
+ void SetAttributes( const SfxItemSet& rInAttrs );
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+};
+
+#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 000000000000..89ea37eefef3
--- /dev/null
+++ b/include/svx/modctrl.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 _SVX_MODCTRL_HXX
+#define _SVX_MODCTRL_HXX
+
+#include <tools/link.hxx>
+#include <sfx2/stbitem.hxx>
+#include "svx/svxdllapi.h"
+
+#include <boost/shared_ptr.hpp>
+
+// Forward declarations
+class Timer;
+
+// class SvxModifyControl ------------------------------------------------
+
+class SVX_DLLPUBLIC SvxModifyControl : public SfxStatusBarControl
+{
+public:
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual void Paint( const UserDrawEvent& rUsrEvt );
+ virtual void DoubleClick();
+
+ SFX_DECL_STATUSBAR_CONTROL();
+
+ SvxModifyControl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb );
+
+private: // Links
+ DECL_LINK( OnTimer, Timer * );
+
+private: // Functions
+ void _repaint();
+
+private:
+ struct ImplData;
+ ::boost::shared_ptr<ImplData> mpImpl;
+};
+
+
+#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 000000000000..3ff5a3dbebe8
--- /dev/null
+++ b/include/svx/msdffdef.hxx
@@ -0,0 +1,1184 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _MSDFFDEF_HXX
+#define _MSDFFDEF_HXX
+
+#include <sal/types.h>
+#include <tools/solar.h>
+#include <tools/stream.hxx>
+#include "svx/svxdllapi.h"
+
+#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_Unknown 0
+#define DFF_PST_SubContainerCompleted 1
+#define DFF_PST_IRRAtom 2
+#define DFF_PST_PSS 3
+#define DFF_PST_SubContainerException 4
+#define DFF_PST_ClientSignal1 6
+#define DFF_PST_ClientSignal2 7
+#define DFF_PST_PowerPointStateInfoAtom 10
+#define DFF_PST_Document 1000
+#define DFF_PST_DocumentAtom 1001
+#define DFF_PST_EndDocument 1002
+#define DFF_PST_SlidePersist 1003
+#define DFF_PST_SlideBase 1004
+#define DFF_PST_SlideBaseAtom 1005
+#define DFF_PST_Slide 1006
+#define DFF_PST_SlideAtom 1007
+#define DFF_PST_Notes 1008
+#define DFF_PST_NotesAtom 1009
+#define DFF_PST_Environment 1010
+#define DFF_PST_SlidePersistAtom 1011
+#define DFF_PST_Scheme 1012
+#define DFF_PST_SchemeAtom 1013
+#define DFF_PST_DocViewInfo 1014
+#define DFF_PST_SslideLayoutAtom 1015
+#define DFF_PST_MainMaster 1016
+#define DFF_PST_SSSlideInfoAtom 1017
+#define DFF_PST_SlideViewInfo 1018
+#define DFF_PST_GuideAtom 1019
+#define DFF_PST_ViewInfo 1020
+#define DFF_PST_ViewInfoAtom 1021
+#define DFF_PST_SlideViewInfoAtom 1022
+#define DFF_PST_VBAInfo 1023
+#define DFF_PST_VBAInfoAtom 1024
+#define DFF_PST_SSDocInfoAtom 1025
+#define DFF_PST_Summary 1026
+#define DFF_PST_Texture 1027
+#define DFF_PST_VBASlideInfo 1028
+#define DFF_PST_VBASlideInfoAtom 1029
+#define DFF_PST_DocRoutingSlip 1030
+#define DFF_PST_OutlineViewInfo 1031
+#define DFF_PST_SorterViewInfo 1032
+#define DFF_PST_ExObjList 1033
+#define DFF_PST_ExObjListAtom 1034
+#define DFF_PST_PPDrawingGroup 1035
+#define DFF_PST_PPDrawing 1036
+#define DFF_PST_NamedShows 1040
+#define DFF_PST_NamedShow 1041
+#define DFF_PST_NamedShowSlides 1042
+#define DFF_PST_List 2000
+#define DFF_PST_FontCollection 2005
+#define DFF_PST_ListPlaceholder 2017
+#define DFF_PST_BookmarkCollection 2019
+#define DFF_PST_SoundCollection 2020
+#define DFF_PST_SoundCollAtom 2021
+#define DFF_PST_Sound 2022
+#define DFF_PST_SoundData 2023
+#define DFF_PST_BookmarkSeedAtom 2025
+#define DFF_PST_GuideList 2026
+#define DFF_PST_RunArray 2028
+#define DFF_PST_RunArrayAtom 2029
+#define DFF_PST_ArrayElementAtom 2030
+#define DFF_PST_Int4ArrayAtom 2031
+#define DFF_PST_ColorSchemeAtom 2032
+#define DFF_PST_OEShape 3008
+#define DFF_PST_ExObjRefAtom 3009
+#define DFF_PST_OEPlaceholderAtom 3011
+#define DFF_PST_GrColor 3020
+#define DFF_PST_GrectAtom 3025
+#define DFF_PST_GratioAtom 3031
+#define DFF_PST_Gscaling 3032
+#define DFF_PST_GpointAtom 3034
+#define DFF_PST_OEShapeAtom 3035
+#define DFF_PST_OutlineTextRefAtom 3998
+#define DFF_PST_TextHeaderAtom 3999
+#define DFF_PST_TextCharsAtom 4000
+#define DFF_PST_StyleTextPropAtom 4001
+#define DFF_PST_BaseTextPropAtom 4002
+#define DFF_PST_TxMasterStyleAtom 4003
+#define DFF_PST_TxCFStyleAtom 4004
+#define DFF_PST_TxPFStyleAtom 4005
+#define DFF_PST_TextRulerAtom 4006
+#define DFF_PST_TextBookmarkAtom 4007
+#define DFF_PST_TextBytesAtom 4008
+#define DFF_PST_TxSIStyleAtom 4009
+#define DFF_PST_TextSpecInfoAtom 4010
+#define DFF_PST_DefaultRulerAtom 4011
+#define DFF_PST_FontEntityAtom 4023
+#define DFF_PST_FontEmbedData 4024
+#define DFF_PST_TypeFace 4025
+#define DFF_PST_CString 4026
+#define DFF_PST_ExternalObject 4027
+#define DFF_PST_MetaFile 4033
+#define DFF_PST_ExOleObj 4034
+#define DFF_PST_ExOleObjAtom 4035
+#define DFF_PST_ExPlainLinkAtom 4036
+#define DFF_PST_CorePict 4037
+#define DFF_PST_CorePictAtom 4038
+#define DFF_PST_ExPlainAtom 4039
+#define DFF_PST_SrKinsoku 4040
+#define DFF_PST_Handout 4041
+#define DFF_PST_ExEmbed 4044
+#define DFF_PST_ExEmbedAtom 4045
+#define DFF_PST_ExLink 4046
+#define DFF_PST_ExLinkAtom_old 4047
+#define DFF_PST_BookmarkEntityAtom 4048
+#define DFF_PST_ExLinkAtom 4049
+#define DFF_PST_SrKinsokuAtom 4050
+#define DFF_PST_ExHyperlinkAtom 4051
+#define DFF_PST_ExPlain 4053
+#define DFF_PST_ExPlainLink 4054
+#define DFF_PST_ExHyperlink 4055
+#define DFF_PST_SlideNumberMCAtom 4056
+#define DFF_PST_HeadersFooters 4057
+#define DFF_PST_HeadersFootersAtom 4058
+#define DFF_PST_RecolorEntryAtom 4062
+#define DFF_PST_TxInteractiveInfoAtom 4063
+#define DFF_PST_EmFormatAtom 4065
+#define DFF_PST_CharFormatAtom 4066
+#define DFF_PST_ParaFormatAtom 4067
+#define DFF_PST_MasterText 4068
+#define DFF_PST_RecolorInfoAtom 4071
+#define DFF_PST_ExQuickTime 4073
+#define DFF_PST_ExQuickTimeMovie 4074
+#define DFF_PST_ExQuickTimeMovieData 4075
+#define DFF_PST_ExSubscription 4076
+#define DFF_PST_ExSubscriptionSection 4077
+#define DFF_PST_ExControl 4078
+#define DFF_PST_ExControlAtom 4091
+#define DFF_PST_SlideListWithText 4080
+#define DFF_PST_AnimationInfoAtom 4081
+#define DFF_PST_InteractiveInfo 4082
+#define DFF_PST_InteractiveInfoAtom 4083
+#define DFF_PST_SlideList 4084
+#define DFF_PST_UserEditAtom 4085
+#define DFF_PST_CurrentUserAtom 4086
+#define DFF_PST_DateTimeMCAtom 4087
+#define DFF_PST_GenericDateMCAtom 4088
+#define DFF_PST_HeaderMCAtom 4089
+#define DFF_PST_FooterMCAtom 4090
+#define DFF_PST_ExMediaAtom 4100
+#define DFF_PST_ExVideo 4101
+#define DFF_PST_ExAviMovie 4102
+#define DFF_PST_ExMCIMovie 4103
+#define DFF_PST_ExMIDIAudio 4109
+#define DFF_PST_ExCDAudio 4110
+#define DFF_PST_ExWAVAudioEmbedded 4111
+#define DFF_PST_ExWAVAudioLink 4112
+#define DFF_PST_ExOleObjStg 4113
+#define DFF_PST_ExCDAudioAtom 4114
+#define DFF_PST_ExWAVAudioEmbeddedAtom 4115
+#define DFF_PST_AnimationInfo 4116
+#define DFF_PST_RTFDateTimeMCAtom 4117
+#define DFF_PST_ProgTags 5000
+#define DFF_PST_ProgStringTag 5001
+#define DFF_PST_ProgBinaryTag 5002
+#define DFF_PST_BinaryTagData 5003
+#define DFF_PST_PrintOptions 6000
+#define DFF_PST_PersistPtrFullBlock 6001
+#define DFF_PST_PersistPtrIncrementalBlock 6002
+#define DFF_PST_RulerIndentAtom 10000
+#define DFF_PST_GscalingAtom 10001
+#define DFF_PST_GrColorAtom 10002
+#define DFF_PST_GLPointAtom 10003
+#define DFF_PST_GlineAtom 10004
+
+// 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
+
+#define DFF_msofbtSelection 0xF119 // an FDGSL followed by the SPIDs of the shapes in the selection 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
+// Transform
+#define DFF_Prop_Rotation 4 // Fixed Point 16.16 degrees
+// Protection
+#define DFF_Prop_LockRotation 119 // sal_Bool No rotation
+#define DFF_Prop_LockAspectRatio 120 // sal_Bool Don't allow changes in aspect ratio
+#define DFF_Prop_LockPosition 121 // sal_Bool Don't allow the shape to be moved
+#define DFF_Prop_LockAgainstSelect 122 // sal_Bool Shape may not be selected
+#define DFF_Prop_LockCropping 123 // sal_Bool No cropping this shape
+#define DFF_Prop_LockVertices 124 // sal_Bool Edit Points not allowed
+#define DFF_Prop_LockText 125 // sal_Bool Do not edit text
+#define DFF_Prop_LockAdjustHandles 126 // sal_Bool Do not adjust
+#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_scaleText 134 // LONG Text zoom/scale (used if fFitTextToShape)
+#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_txdir 139 // MSO_TXDIR Bi-Di Text direction
+#define DFF_Prop_SelectText 187 // sal_Bool sal_True if single click selects text, sal_False if two clicks
+#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_FitShapeToText 190 // sal_Bool Size shape to fit text size
+#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_gtextRTF 193 // char* RTF 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_gtextFReverseRows 240 // sal_Bool 8000 Reverse row order
+#define DFF_Prop_fGtext 241 // sal_Bool 4000 Has text effect
+#define DFF_Prop_gtextFVertical 242 // sal_Bool 2000 Rotate characters
+#define DFF_Prop_gtextFKern 243 // sal_Bool 1000 Kern characters
+#define DFF_Prop_gtextFTight 244 // sal_Bool 800 Tightening or tracking
+#define DFF_Prop_gtextFStretch 245 // sal_Bool 400 Stretch to fit shape
+#define DFF_Prop_gtextFShrinkFit 246 // sal_Bool 200 Char bounding box
+#define DFF_Prop_gtextFBestFit 247 // sal_Bool 100 Scale text-on-path
+#define DFF_Prop_gtextFNormalize 248 // sal_Bool 80 Stretch char height
+#define DFF_Prop_gtextFDxMeasure 249 // sal_Bool 40 Do not measure along path
+#define DFF_Prop_gtextFBold 250 // sal_Bool 20 Bold font
+#define DFF_Prop_gtextFItalic 251 // sal_Bool 10 Italic font
+#define DFF_Prop_gtextFUnderline 252 // sal_Bool 8 Underline font
+#define DFF_Prop_gtextFShadow 253 // sal_Bool 4 Shadow font
+#define DFF_Prop_gtextFSmallcaps 254 // sal_Bool 2 Small caps 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_pictureDblCrMod 268 // MSO_CLR Modification used if shape has double shadow
+#define DFF_Prop_pictureFillCrMod 269 // MSO_CLR
+#define DFF_Prop_pictureLineCrMod 270 // MSO_CLR
+#define DFF_Prop_pibPrint 271 // IMsoBlip* Blip to display when printing
+#define DFF_Prop_pibPrintName 272 // WCHAR* Blip file name
+#define DFF_Prop_pibPrintFlags 273 // MSO_BLIPFLAGS Blip flags
+#define DFF_Prop_fNoHitTestPicture 316 // sal_Bool Do not hit test the picture
+#define DFF_Prop_pictureGray 317 // sal_Bool grayscale display
+#define DFF_Prop_pictureBiLevel 318 // sal_Bool bi-level display
+#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_shapePath 324 // MSO_SHAPEPATH
+#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_fShadowOK 378 // sal_Bool Shadow may be set
+#define DFF_Prop_f3DOK 379 // sal_Bool 3D may be set
+#define DFF_Prop_fLineOK 380 // sal_Bool Line style 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_fillCrMod 389 // MSO_CLR Modification for BW views
+#define DFF_Prop_fillBlip 390 // IMsoBlip* Pattern/texture
+#define DFF_Prop_fillBlipName 391 // WCHAR* Blip file name
+#define DFF_Prop_fillBlipFlags 392 // MSO_BLIPFLAGS Blip flags
+#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_fillToLeft 397 // LONG Fraction 16.16
+#define DFF_Prop_fillToTop 398 // LONG Fraction 16.16
+#define DFF_Prop_fillToRight 399 // LONG Fraction 16.16
+#define DFF_Prop_fillToBottom 400 // LONG Fraction 16.16
+#define DFF_Prop_fillRectLeft 401 // LONG For shaded fills, use the specified rectangle instead of the shape's bounding rect to define how large the fade is going to be.
+#define DFF_Prop_fillRectTop 402 // LONG
+#define DFF_Prop_fillRectRight 403 // LONG
+#define DFF_Prop_fillRectBottom 404 // LONG
+#define DFF_Prop_fillDztype 405 // MSO_DZTYPE
+#define DFF_Prop_fillShadePreset 406 // LONG Special shades
+#define DFF_Prop_fillShadeColors 407 // IMsoArray a preset array of colors
+#define DFF_Prop_fillOriginX 408 // LONG
+#define DFF_Prop_fillOriginY 409 // LONG
+#define DFF_Prop_fillShapeOriginX 410 // LONG
+#define DFF_Prop_fillShapeOriginY 411 // LONG
+#define DFF_Prop_fillShadeType 412 // MSO_SHADETYPE Type of shading, if a shaded (gradient) fill.
+#define DFF_Prop_fFilled 443 // sal_Bool Is shape filled?
+#define DFF_Prop_fHitTestFill 444 // sal_Bool Should we hit test fill?
+#define DFF_Prop_fillShape 445 // sal_Bool Register pattern on shape
+#define DFF_Prop_fillUseRect 446 // sal_Bool Use the large rect?
+#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_lineCrMod 451 // MSO_CLR Modification for BW views
+#define DFF_Prop_lineType 452 // MSO_LINETYPE Type of line
+#define DFF_Prop_lineFillBlip 453 // IMsoBlip* Pattern/texture
+#define DFF_Prop_lineFillBlipName 454 // WCHAR* Blip file name
+#define DFF_Prop_lineFillBlipFlags 455 // MSO_BLIPFLAGS Blip flags
+#define DFF_Prop_lineFillWidth 456 // LONG How big (A units) to make a metafile texture.
+#define DFF_Prop_lineFillHeight 457 // LONG
+#define DFF_Prop_lineFillDztype 458 // MSO_DZTYPE How to interpret fillWidth/Height numbers.
+#define DFF_Prop_lineWidth 459 // LONG A units; 1pt == 12700 EMUs
+#define DFF_Prop_lineMiterLimit 460 // LONG ratio (16.16) of width
+#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_fArrowheadsOK 507 // sal_Bool Allow arrowheads if prop. is set
+#define DFF_Prop_fLine 508 // sal_Bool Any line?
+#define DFF_Prop_fHitTestLine 509 // sal_Bool Should we hit test lines?
+#define DFF_Prop_lineFillShape 510 // sal_Bool Register pattern on shape
+#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_shadowHighlight 514 // MSO_CLR Embossed color
+#define DFF_Prop_shadowCrMod 515 // MSO_CLR Modification for BW views
+#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_shadowSecondOffsetX 519 // LONG Double offset shadow
+#define DFF_Prop_shadowSecondOffsetY 520 // LONG Double offset shadow
+#define DFF_Prop_shadowScaleXToX 521 // LONG 16.16
+#define DFF_Prop_shadowScaleYToX 522 // LONG 16.16
+#define DFF_Prop_shadowScaleXToY 523 // LONG 16.16
+#define DFF_Prop_shadowScaleYToY 524 // LONG 16.16
+#define DFF_Prop_shadowPerspectiveX 525 // LONG 16.16 / weight
+#define DFF_Prop_shadowPerspectiveY 526 // LONG 16.16 / weight
+#define DFF_Prop_shadowWeight 527 // LONG scaling factor
+#define DFF_Prop_shadowOriginX 528 // LONG
+#define DFF_Prop_shadowOriginY 529 // LONG
+#define DFF_Prop_fShadow 574 // sal_Bool Any shadow?
+#define DFF_Prop_fshadowObscured 575 // sal_Bool Excel5-style shadow
+// PerspectiveStyle
+#define DFF_Prop_perspectiveType 576 // MSO_XFORMTYPE Where transform applies
+#define DFF_Prop_perspectiveOffsetX 577 // LONG The LONG values define a transformation matrix, effectively, each value is scaled by the perspectiveWeight parameter.
+#define DFF_Prop_perspectiveOffsetY 578 // LONG
+#define DFF_Prop_perspectiveScaleXToX 579 // LONG
+#define DFF_Prop_perspectiveScaleYToX 580 // LONG
+#define DFF_Prop_perspectiveScaleXToY 581 // LONG
+#define DFF_Prop_perspectiveScaleYToY 582 // LONG
+#define DFF_Prop_perspectivePerspectiveX 583 // LONG
+#define DFF_Prop_perspectivePerspectiveY 584 // LONG
+#define DFF_Prop_perspectiveWeight 585 // LONG Scaling factor
+#define DFF_Prop_perspectiveOriginX 586 // LONG
+#define DFF_Prop_perspectiveOriginY 587 // LONG
+#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_c3DEdgeThickness 643 // LONG Specular edge thickness
+#define DFF_Prop_c3DExtrudeForward 644 // LONG Distance of extrusion in EMUs
+#define DFF_Prop_c3DExtrudeBackward 645 // LONG
+#define DFF_Prop_c3DExtrudePlane 646 // LONG Extrusion direction
+#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_c3DCrMod 648 // MSO_CLR Modification for BW views
+#define DFF_Prop_f3D 700 // sal_Bool Does this shape have a 3D effect?
+#define DFF_Prop_fc3DMetallic 701 // sal_Bool Use metallic specularity?
+#define DFF_Prop_fc3DUseExtrusionColor 702 // BOOL
+#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_c3DRotationAxisX 706 // LONG These specify the rotation axis; only their relative magnitudes matter.
+#define DFF_Prop_c3DRotationAxisY 707 // LONG
+#define DFF_Prop_c3DRotationAxisZ 708 // LONG
+#define DFF_Prop_c3DRotationAngle 709 // LONG degrees (16.16) about 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_fc3DConstrainRotation 763 // BOOL
+#define DFF_Prop_fc3DRotationCenterAuto 764 // BOOL
+#define DFF_Prop_fc3DParallel 765 // sal_Bool Parallel projection?
+#define DFF_Prop_fc3DKeyHarsh 766 // sal_Bool Is key lighting harsh?
+#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_bWMode 772 // MSO_BWMODE Settings for modifications to be made when in different forms of black-and-white mode.
+#define DFF_Prop_bWModePureBW 773 // MSO_BWMODE
+#define DFF_Prop_bWModeBW 774 // MSO_BWMODE
+#define DFF_Prop_fOleIcon 826 // sal_Bool For OLE objects, whether the object is in icon form
+#define DFF_Prop_fPreferRelativeResize 827 // sal_Bool For UI only. Prefer relative resizing.
+#define DFF_Prop_fLockShapeType 828 // sal_Bool Lock the shape type (don't allow Change Shape)
+#define DFF_Prop_fDeleteAttachedObject 830 // BOOL
+#define DFF_Prop_fBackground 831 // sal_Bool If sal_True, this is the background shape.
+
+// Callout
+#define DFF_Prop_spcot 832 // MSO_SPCOT Callout type
+#define DFF_Prop_dxyCalloutGap 833 // LONG Distance from box to first point.(EMUs)
+#define DFF_Prop_spcoa 834 // MSO_SPCOA Callout angle
+#define DFF_Prop_spcod 835 // MSO_SPCOD Callout drop type
+#define DFF_Prop_dxyCalloutDropSpecified 836 // LONG if mso_spcodSpecified, the actual drop distance
+#define DFF_Prop_dxyCalloutLengthSpecified 837 // LONG if fCalloutLengthSpecified, the actual distance
+#define DFF_Prop_fCallout 889 // sal_Bool Is the shape a callout?
+#define DFF_Prop_fCalloutAccentBar 890 // sal_Bool does callout have accent bar
+#define DFF_Prop_fCalloutTextBorder 891 // sal_Bool does callout have a text border
+#define DFF_Prop_fCalloutMinusX 892 // BOOL
+#define DFF_Prop_fCalloutMinusY 893 // BOOL
+#define DFF_Prop_fCalloutDropAuto 894 // sal_Bool If true, then we occasionally invert the drop distance
+#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_lidRegroup 904 // LONG Regroup ID
+#define DFF_Prop_tableProperties 927 // LONG
+#define DFF_Prop_tableRowProperties 928 // LONG*
+#define DFF_Prop_fEditedWrap 953 // sal_Bool Has the wrap polygon been edited?
+#define DFF_Prop_fBehindDocument 954 // sal_Bool Word-only (shape is behind text)
+#define DFF_Prop_fOnDblClickNotify 955 // sal_Bool Notify client on a double click
+#define DFF_Prop_fIsButton 956 // sal_Bool A button shape (i.e., clicking performs an action). Set for shapes with attached hyperlinks or macros.
+#define DFF_Prop_fOneD 957 // sal_Bool 1D adjustment
+#define DFF_Prop_fHidden 958 // sal_Bool Do not display
+#define DFF_Prop_fPrint 959 // sal_Bool Print this shape
+// entsprechende BitFlags
+#define DFF_PBit_EditedWrap 0x00000040
+#define DFF_PBit_BehindDocument 0x00000020
+#define DFF_PBit_OnDblClickNotify 0x00000010
+#define DFF_PBit_IsButton 0x00000008
+#define DFF_PBit_OneD 0x00000004
+#define DFF_PBit_Hidden 0x00000002
+#define DFF_PBit_Print 0x00000001
+
+// properties of the second property set
+#define DFF_Prop_metroBlob 937 // XML ZipPackage*
+
+//---------------------------------------------------------------------------
+// linchpin: the shape type
+//---------------------------------------------------------------------------
+typedef enum
+ {
+ 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,
+ mso_sptMax = 0x0FFF,
+ mso_sptNil = mso_sptMax
+ } MSO_SPT;
+
+// 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 thrusts 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
+};
+
+// MSO_SHADETYPE - how to interpret the colors in a shaded fill.
+enum MSO_ShadeType {
+ mso_shadeNone = 0, // Interpolate without correction between RGBs
+ mso_shadeGamma = 1, // Apply gamma correction to colors
+ mso_shadeSigma = 2, // Apply a sigma transfer function to position
+ mso_shadeBand = 4, // Add a flat band at the start of the shade
+ mso_shadeOneColor = 8, // This is a one color shade
+
+ /* A parameter for the band or sigma function can be stored in the top
+ 16 bits of the value - this is a proportion of *each* band of the
+ shade to make flat (or the approximate equal value for a sigma
+ function). NOTE: the parameter is not used for the sigma function,
+ instead a built in value is used. This value should not be changed
+ from the default! */
+ mso_shadeParameterShift = 16,
+ mso_shadeParameterMask = 0xffff0000,
+
+ mso_shadeDefault = (mso_shadeGamma|mso_shadeSigma|
+ (16384<<mso_shadeParameterShift))
+};
+
+// 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_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
+};
+// verschiedene enums aus der OfficeDraw-Doku, Appendix D - Ende
+
+// BStore-Container
+// FBSE - File Blip Store Entry
+typedef struct _MSOF_BSE {
+ sal_uInt8 btWin32; // Required type on Win32
+ sal_uInt8 btMacOS; // Required type on Mac
+ sal_uInt8 rgbUid[16]; // Identifier of blip
+ sal_uInt16 tag; // currently unused
+ sal_uIntPtr size; // Blip size in stream
+ sal_uIntPtr cRef; // Reference count on the blip
+ sal_uIntPtr /*MSOFO*/ foDelay; // File offset in the delay stream
+ sal_uInt8 usage; // How this blip is used (MSOBLIPUSAGE)
+ sal_uInt8 cbName; // length of the blip name
+ sal_uInt8 unused2; // for the future
+ sal_uInt8 unused3; // for the future
+} MSO_FBSE;
+
+typedef enum {
+ mso_blipUsageDefault, // All non-texture fill blips get this.
+ mso_blipUsageTexture,
+ mso_blipUsageMax = 255 // Since this is stored in a byte
+} MSO_BLIPUSAGE;
+
+typedef enum { // 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
+} MSO_BLIPTYPE;
+
+typedef enum {
+ 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
+} MSO_BI; // Blip signature as encoded in the MSO_FBH.inst
+
+typedef enum {
+ mso_compressionDeflate = 0,
+ mso_compressionNone = 254, // Used only if compression fails
+ mso_compressionTest = 255 // For testing only
+} MSO_BLIPCOMPRESSION;
+
+typedef enum {
+ mso_filterAdaptive = 0, // PNG type - not used/supported for metafile
+ mso_filterNone = 254,
+ mso_filterTest = 255 // For testing only
+} MSO_BLIPFILTER;
+
+typedef enum {
+ 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
+} MSO_SYSCOLORINDEX;
+
+#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 000000000000..2a8607c13b42
--- /dev/null
+++ b/include/svx/numfmtsh.hxx
@@ -0,0 +1,229 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_NUMFMTSH_HXX
+#define _SVX_NUMFMTSH_HXX
+
+#include <tools/string.hxx>
+#include <i18nlangtag/lang.h>
+
+#include "svx/svxdllapi.h"
+
+#include <svl/zforlist.hxx>
+
+#include <vector>
+#include <map>
+
+class Color;
+
+enum SvxNumberValueType
+{
+ SVX_VALUE_TYPE_UNDEFINED = 0,
+ SVX_VALUE_TYPE_NUMBER,
+ SVX_VALUE_TYPE_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 String& rNumStr );
+
+ SvxNumberFormatShell( SvNumberFormatter* pNumFormatter,
+ sal_uInt32 nFormatKey,
+ SvxNumberValueType eNumValType,
+ double nNumVal,
+ const String* pNumStr = NULL );
+
+ ~SvxNumberFormatShell();
+
+
+ static SvxNumberFormatShell* Create( SvNumberFormatter* pNumFormatter,
+ sal_uInt32 nFormatKey,
+ SvxNumberValueType eNumValType,
+ const String& rNumStr );
+
+ static SvxNumberFormatShell* Create( SvNumberFormatter* pNumFormatter,
+ sal_uInt32 nFormatKey,
+ SvxNumberValueType eNumValType,
+ double nNumVal,
+ const String* pNumStr = NULL );
+
+
+ void GetInitSettings( sal_uInt16& nCatLbPos,
+ LanguageType& rLangType,
+ sal_uInt16& nFmtLbSelPos,
+ std::vector<String*>& rFmtEntries,
+ String& rPrevString,
+ Color*& rpPrevColor );
+
+ void CategoryChanged( sal_uInt16 nCatLbPos,
+ short& rFmtSelPos,
+ std::vector<String*>& rFmtEntries );
+
+ void LanguageChanged( LanguageType eLangType,
+ short& rFmtSelPos,
+ std::vector<String*>& rFmtEntries );
+
+ void FormatChanged( sal_uInt16 nFmtLbPos,
+ String& rPreviewStr,
+ Color*& rpFontColor );
+
+ bool AddFormat( String& rFormat,
+ xub_StrLen& rErrPos,
+ sal_uInt16& rCatLbSelPos,
+ short& rFmtSelPos,
+ std::vector<String*>& rFmtEntries );
+
+ bool RemoveFormat( const String& rFormat,
+ sal_uInt16& rCatLbSelPos,
+ short& rFmtSelPos,
+ std::vector<String*>& rFmtEntries );
+
+ void MakeFormat( String& rFormat,
+ bool bThousand,
+ bool bNegRed,
+ sal_uInt16 nPrecision,
+ sal_uInt16 nLeadingZeroes,
+ sal_uInt16 nCurrencyEntryPos);
+
+ void GetOptions( const String& rFormat,
+ bool& rThousand,
+ bool& rNegRed,
+ sal_uInt16& rPrecision,
+ sal_uInt16& rLeadingZeroes,
+ sal_uInt16& rCatLbPos );
+
+ void MakePreviewString( const String& rFormatStr,
+ String& rPreviewStr,
+ Color*& rpFontColor );
+
+ void MakePrevStringFromVal( const String& rFormatStr,
+ String& rPreviewStr,
+ Color*& rpFontColor,
+ double nValue);
+
+ bool IsUserDefined( const String& rFmtString );
+ bool IsTmpCurrencyFormat( const String& rFmtString );
+ bool FindEntry( const String& rFmtString, sal_uInt32* pAt = NULL );
+
+ void ValidateNewEntries( bool bValidate = true ) { bUndoAddList = !bValidate; }
+ size_t GetUpdateDataCount() const;
+ void GetUpdateData( sal_uInt32* pDelArray, const sal_uInt32 nSize );
+
+ void SetCurNumFmtKey( sal_uInt32 nNew ) { nCurFormatKey = nNew; }
+ void SetCurLanguage( LanguageType eNew ) { eCurLanguage = eNew; }
+ sal_uInt32 GetCurNumFmtKey() const { return nCurFormatKey; }
+ LanguageType GetCurLanguage() const { return eCurLanguage; }
+
+ /** Returns the name of Standard, General, ... for the
+ current language. */
+ String GetStandardName() const;
+
+ String GetComment4Entry(short nEntry);
+ short GetCategory4Entry(short nEntry);
+ bool GetUserDefined4Entry(short nEntry);
+ String GetFormat4Entry(short nEntry);
+ void SetComment4Entry(short nEntry,String aCommentString);
+
+ void SetCurrencySymbol(sal_uInt16 nPos);
+ sal_uInt32 GetCurrencySymbol();
+ sal_uInt16 FindCurrencyFormat( const String& rFmtString );
+ sal_uInt16 FindCurrencyFormat(const NfCurrencyEntry* pTmpCurrencyEntry,bool bTmpBanking);
+ void SetCurCurrencyEntry(NfCurrencyEntry*);
+ short GetListPos4Entry(sal_uInt32 nIdx);
+ short GetListPos4Entry( const String& rFmtString );
+
+ void GetCurrencySymbols(std::vector<OUString>& rList, sal_uInt16* pPos );
+ void GetCurrencySymbols(std::vector<OUString>& rList, bool bFlag );
+
+ sal_uInt16 FindCurrencyTableEntry( const String& rFmtString, bool &bTestBanking );
+ bool IsInTable(sal_uInt16 nPos, bool bTmpBanking,
+ OUString const& rFmtString);
+
+ void SetUseStarFormat( bool bUse ) { bUseStarFormat = bUse; }
+ bool IsUseStarFormat( void ) { return bUseStarFormat; }
+private:
+ static const double DEFAULT_NUMVALUE;
+
+ SvNumberFormatter* pFormatter;
+ SvNumberFormatTable* pCurFmtTable;
+ SvxNumberValueType eValType;
+ String aValStr;
+ double nValNum;
+ bool bUndoAddList;
+ std::vector<sal_uInt32> aAddList;
+ std::vector<sal_uInt32> aDelList;
+ std::vector<sal_uInt32> aCurEntryList;
+ sal_uInt32 nCurFormatKey;
+ short nCurCategory;
+ LanguageType eCurLanguage;
+ std::vector<sal_uInt16> aCurCurrencyList;
+ NfCurrencyEntry* pCurCurrencyEntry;
+ bool bBankingSymbol;
+ sal_uInt16 nCurCurrencyEntryPos;
+ std::vector<String*> aCurrencyFormatList;
+ bool bUseStarFormat;
+#ifdef _SVX_NUMFMTSH_CXX
+ SVX_DLLPRIVATE short FillEntryList_Impl( std::vector<String*>& rList );
+ SVX_DLLPRIVATE void FillEListWithStd_Impl( std::vector<String*>& rList,sal_uInt16 aPrivCat, short &Pos);
+ SVX_DLLPRIVATE short FillEListWithFormats_Impl( std::vector<String*>& rList,short nSelPos,
+ NfIndexTableOffset eOffsetStart,
+ NfIndexTableOffset eOffsetEnd);
+ SVX_DLLPRIVATE short FillEListWithDateTime_Impl( std::vector<String*>& rList,short nSelPos);
+ SVX_DLLPRIVATE short FillEListWithCurrency_Impl( std::vector<String*>& rList,short nSelPos);
+ SVX_DLLPRIVATE short FillEListWithSysCurrencys( std::vector<String*>& rList,short nSelPos);
+ SVX_DLLPRIVATE short FillEListWithUserCurrencys( std::vector<String*>& rList,short nSelPos);
+ SVX_DLLPRIVATE short FillEListWithUsD_Impl( std::vector<String*>& rList, sal_uInt16 nPrivCat, short Pos );
+
+ SVX_DLLPRIVATE ::std::vector<sal_uInt32>::iterator GetRemoved_Impl( size_t nKey );
+ SVX_DLLPRIVATE bool IsRemoved_Impl( size_t nKey );
+ SVX_DLLPRIVATE ::std::vector<sal_uInt32>::iterator GetAdded_Impl( size_t nKey );
+ SVX_DLLPRIVATE bool IsAdded_Impl( size_t nKey );
+
+ SVX_DLLPRIVATE void GetPreviewString_Impl( String& rString,
+ Color*& rpColor );
+ SVX_DLLPRIVATE void PosToCategory_Impl( sal_uInt16 nPos, short& rCategory );
+ SVX_DLLPRIVATE void CategoryToPos_Impl( short nCategory, sal_uInt16& rPos );
+#endif
+};
+
+
+#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 000000000000..f6cd721e8cd9
--- /dev/null
+++ b/include/svx/numinf.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 _SVX_NUMINF_HXX
+#define _SVX_NUMINF_HXX
+
+#include <svl/itempool.hxx>
+#include <svx/numfmtsh.hxx>
+#include "svx/svxdllapi.h"
+
+// class SvxNumberInfoItem -----------------------------------------------
+
+
+
+/*
+This item is used as a transport medium for a number formatter
+*/
+
+class SVX_DLLPUBLIC SvxNumberInfoItem : public SfxPoolItem
+{
+public:
+ TYPEINFO();
+
+ SvxNumberInfoItem( const sal_uInt16 nId );
+ SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
+ const sal_uInt16 nId );
+ SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const String& 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 String& rValueStr, const sal_uInt16 nId );
+ SvxNumberInfoItem( const SvxNumberInfoItem& );
+ ~SvxNumberInfoItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const;
+ virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ SvNumberFormatter* GetNumberFormatter() const { return pFormatter; }
+ const String& GetValueString() const { return aStringVal; }
+ double GetValueDouble() const { return nDoubleVal; }
+
+ const sal_uInt32* GetDelArray() const { return pDelFormatArr; }
+ void SetDelFormatArray( const sal_uInt32* pData,
+ const sal_uInt32 nCount );
+
+ SvxNumberValueType GetValueType() const { return eValueType; }
+ sal_uInt32 GetDelCount() const { return nDelCount; }
+
+private:
+ SvNumberFormatter* pFormatter;
+ SvxNumberValueType eValueType;
+ String aStringVal;
+ double nDoubleVal;
+
+ sal_uInt32* pDelFormatArr;
+ sal_uInt32 nDelCount;
+};
+
+
+
+#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 000000000000..264f1ffa2459
--- /dev/null
+++ b/include/svx/numvset.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 _SVX_NUMVSET_HXX
+#define _SVX_NUMVSET_HXX
+
+#include <svtools/valueset.hxx>
+#include <limits.h>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/lang/Locale.hpp>
+#include "svx/svxdllapi.h"
+
+namespace com{namespace sun{ namespace star{
+ namespace container{
+ class XIndexAccess;
+ }
+ namespace beans{
+ struct PropertyValue;
+ }
+ namespace text{
+ class XNumberingFormatter;
+ }
+}}}
+
+class SvxBrushItem;
+class SvxNumRule;
+struct SvxBmpItemInfo
+{
+ SvxBrushItem* pBrushItem;
+ sal_uInt16 nItemId;
+};
+
+class SVX_DLLPUBLIC SvxNumValueSet : public ValueSet
+{
+ Color aLineColor;
+ sal_uInt16 nPageType;
+ sal_Bool bHTMLMode;
+ Rectangle aOrgRect;
+ VirtualDevice* pVDev;
+
+ com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter> xFormatter;
+ com::sun::star::lang::Locale aLocale;
+
+ com::sun::star::uno::Sequence<
+ com::sun::star::uno::Sequence<
+ com::sun::star::beans::PropertyValue> > aNumSettings;
+
+ com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XIndexAccess> > aOutlineSettings;
+
+ public:
+ SvxNumValueSet(Window* pParent, WinBits nWinBits = WB_TABSTOP);
+ void init(sal_uInt16 nType);
+ ~SvxNumValueSet();
+
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ void SetHTMLMode(sal_Bool bSet) {bHTMLMode = bSet;}
+ void SetNumberingSettings(
+ const com::sun::star::uno::Sequence<
+ com::sun::star::uno::Sequence<
+ com::sun::star::beans::PropertyValue> >& aNum,
+ com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter>& xFormatter,
+ const com::sun::star::lang::Locale& rLocale );
+
+ void SetOutlineNumberingSettings(
+ com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XIndexAccess> >& rOutline,
+ com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter>& xFormatter,
+ const com::sun::star::lang::Locale& rLocale);
+};
+
+class SVX_DLLPUBLIC SvxBmpNumValueSet : public SvxNumValueSet
+{
+ String sBullets;
+ Timer aFormatTimer;
+ sal_Bool bGrfNotFound;
+
+ void init();
+
+ protected:
+ DECL_LINK(FormatHdl_Impl, void *);
+
+ void SetGrfNotFound(sal_Bool bSet) {bGrfNotFound = bSet;}
+ sal_Bool IsGrfNotFound()const {return bGrfNotFound;}
+
+ Timer& GetFormatTimer() {return aFormatTimer;}
+
+ public:
+ SvxBmpNumValueSet(Window* pParent, WinBits nWinBits = WB_TABSTOP);
+ ~SvxBmpNumValueSet();
+
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+};
+
+#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 000000000000..1074fbccb256
--- /dev/null
+++ b/include/svx/obj3d.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 _E3D_OBJ3D_HXX
+#define _E3D_OBJ3D_HXX
+
+#include <svx/svdoattr.hxx>
+#include <svx/svdobj.hxx>
+#include <svx/def3d.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/deflt3d.hxx>
+#include <vcl/bitmap.hxx>
+#include <svx/svx3ditems.hxx>
+#include <svx/xflclit.hxx>
+#include <svl/itemset.hxx>
+#include <basegfx/range/b3drange.hxx>
+#include <basegfx/polygon/b3dpolypolygon.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/vector/b2enums.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Forward declaration
+//************************************************************
+
+class SfxPoolItem;
+class Viewport3D;
+class E3dScene;
+class E3dPolyScene;
+
+namespace basegfx { class B3DPolyPolygon; }
+namespace sdr { namespace properties {
+ class BaseProperties;
+ class E3dProperties;
+ 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; // lokal transformations
+
+ E3DObjGeoData() {}
+};
+
+/*************************************************************************
+|*
+|* List for 3D objects
+|*
+\************************************************************************/
+
+class E3dObjList : public SdrObjList
+{
+public:
+ TYPEINFO();
+ E3dObjList(SdrModel* pNewModel = 0, SdrPage* pNewPage = 0, E3dObjList* pNewUpList = 0);
+ SVX_DLLPUBLIC E3dObjList(const E3dObjList& rSrcList);
+ SVX_DLLPUBLIC virtual ~E3dObjList();
+
+ virtual void NbcInsertObject(SdrObject* pObj, sal_uIntPtr nPos=CONTAINER_APPEND, const SdrInsertReason* pReason=NULL);
+ virtual void InsertObject(SdrObject* pObj, sal_uIntPtr nPos=CONTAINER_APPEND, const SdrInsertReason* pReason=NULL);
+ virtual SdrObject* NbcRemoveObject(sal_uIntPtr nObjNum);
+ virtual SdrObject* RemoveObject(sal_uIntPtr nObjNum);
+};
+
+/*************************************************************************
+|*
+|* Base class for 3D objects
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC E3dObject : public SdrAttrObj
+{
+private:
+ // to allow sdr::properties::E3dProperties access to StructureChanged()
+ friend class sdr::properties::E3dProperties;
+
+ // Allow everything for E3dObjList and E3dDragMethod
+ friend class E3dObjList;
+ friend class E3dDragMethod;
+
+ protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
+ E3dObjList maSubList; // child objects
+
+ 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
+ unsigned mbTfHasChanged : 1;
+ unsigned mbIsSelected : 1;
+
+ public:
+ void SetBoundVolInvalid();
+
+ protected:
+ void SetTransformChanged();
+ virtual void NewObjectInserted(const E3dObject* p3DObj);
+ virtual void StructureChanged();
+ basegfx::B3DRange RecalcBoundVolume() const;
+
+protected:
+ // 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();
+ E3dObject(sal_Bool bIsFromChart);
+
+public:
+ TYPEINFO();
+ virtual void RecalcSnapRect();
+ virtual void SetRectsDirty(sal_Bool bNotMyself = sal_False);
+
+ virtual ~E3dObject();
+
+ virtual sal_uInt32 GetObjInventor() const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+
+ virtual void NbcSetLayer(SdrLayerID nLayer);
+
+ virtual void SetObjList(SdrObjList* pNewObjList);
+ virtual void SetPage(SdrPage* pNewPage);
+ virtual void SetModel(SdrModel* pNewModel);
+ virtual void NbcMove(const Size& rSize);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual SdrObjList* GetSubList() const;
+
+ // Insert 3D object into the group; transfer to other owner!
+ virtual void Insert3DObj(E3dObject* p3DObj);
+ void Remove3DObj(E3dObject* p3DObj);
+
+ E3dObject* GetParentObj() const;
+ virtual E3dScene* GetScene() 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;
+ 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 nWink, double sn, double cs);
+
+ // 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 void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+ sal_uInt16 GetLogicalGroup() { return 0; }
+ virtual E3dObject* Clone() const;
+ E3dObject& operator=( const E3dObject& rObj );
+
+ virtual SdrObjGeoData *NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+
+ // get/set the selection
+ bool GetSelected() const { return mbIsSelected; }
+ void SetSelected(bool bNew);
+
+ // break up
+ virtual bool IsBreakObjPossible();
+ virtual SdrAttrObj* 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 SVX_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 sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
+ // material of the object
+ Color aMaterialAmbientColor;
+
+ // attributes for geometry creation
+ unsigned bCreateNormals : 1;
+ unsigned bCreateTexture : 1;
+
+protected:
+ void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+
+ // convert given basegfx::B3DPolyPolygon to screen coor
+ basegfx::B2DPolyPolygon TransformToScreenCoor(const basegfx::B3DPolyPolygon& rCandidate);
+
+public :
+ TYPEINFO();
+
+ E3dCompoundObject();
+ E3dCompoundObject(E3dDefaultAttributes& rDefault);
+ virtual ~E3dCompoundObject();
+
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
+
+ // DoubleSided: sal_True/FALSE
+ sal_Bool GetDoubleSided() const
+ { return ((const Svx3DDoubleSidedItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_DOUBLE_SIDED)).GetValue(); }
+
+ // NormalsKind: 0 == sal_False/sal_False, 1 == sal_True/sal_False, else == sal_True/TRUE
+ sal_uInt16 GetNormalsKind() const
+ { return ((const Svx3DNormalsKindItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_NORMALS_KIND)).GetValue(); }
+
+ // NormalsInvert: sal_True/FALSE
+ sal_Bool GetNormalsInvert() const
+ { return ((const Svx3DNormalsInvertItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_NORMALS_INVERT)).GetValue(); }
+
+ // TextureProjX: 0 == sal_False/sal_False, 1 == sal_True/sal_False, else == sal_True/TRUE
+ sal_uInt16 GetTextureProjectionX() const
+ { return ((const Svx3DTextureProjectionXItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_TEXTURE_PROJ_X)).GetValue(); }
+
+ // TextureProjY: 0 == sal_False/sal_False, 1 == sal_True/sal_False, else == sal_True/TRUE
+ sal_uInt16 GetTextureProjectionY() const
+ { return ((const Svx3DTextureProjectionYItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_TEXTURE_PROJ_Y)).GetValue(); }
+
+ // Shadow3D: sal_True/FALSE
+ sal_Bool GetShadow3D() const
+ { return ((const Svx3DShadow3DItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SHADOW_3D)).GetValue(); }
+
+ // MaterialColor: Color
+ Color GetMaterialColor() const
+ { return ((const Svx3DMaterialColorItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_MAT_COLOR)).GetValue(); }
+
+ // MaterialEmission: Color
+ Color GetMaterialEmission() const
+ { return ((const Svx3DMaterialEmissionItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_MAT_EMISSION)).GetValue(); }
+
+ // MaterialSpecular: Color
+ Color GetMaterialSpecular() const
+ { return ((const Svx3DMaterialSpecularItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_MAT_SPECULAR)).GetValue(); }
+
+ // MaterialSpecularIntensity:
+ sal_uInt16 GetMaterialSpecularIntensity() const
+ { return ((const Svx3DMaterialSpecularIntensityItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY)).GetValue(); }
+
+ // TextureFilter: sal_True/FALSE
+ sal_Bool GetTextureFilter() const
+ { return ((const Svx3DTextureFilterItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_TEXTURE_FILTER)).GetValue(); }
+
+ // #i28528#
+ // Added extra Item (Bool) for chart2 to be able to show reduced line geometry
+ sal_Bool GetReducedLineGeometry() const
+ { return ((const Svx3DReducedLineGeometryItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY)).GetValue(); }
+
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual void RecalcSnapRect();
+
+ // set/get parameters for geometry creation
+ sal_Bool GetCreateNormals() const { return bCreateNormals; }
+
+ sal_Bool GetCreateTexture() const { return bCreateTexture; }
+
+ virtual E3dCompoundObject* Clone() const;
+
+ // material of the object
+ const Color& GetMaterialAmbientColor() const { return aMaterialAmbientColor; }
+
+ bool IsAOrdNumRemapCandidate(E3dScene*& prScene) const;
+};
+
+#endif // _E3D_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 000000000000..6f8c67288e1f
--- /dev/null
+++ b/include/svx/objfac3d.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 _OBJFAC3D_HXX
+#define _OBJFAC3D_HXX
+
+#include "svx/svxdllapi.h"
+
+
+/*************************************************************************
+|*
+|* Factory for chart-specific objects
+|*
+\************************************************************************/
+
+class SdrObjFactory;
+
+
+#include <tools/link.hxx>
+
+class SVX_DLLPUBLIC E3dObjFactory
+{
+public:
+ E3dObjFactory();
+ ~E3dObjFactory();
+
+ DECL_LINK(MakeObject, SdrObjFactory*);
+};
+
+
+
+#endif // _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 000000000000..61a0bb38950a
--- /dev/null
+++ b/include/svx/ofaitem.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 _OFF_OFAITEM_HXX
+#define _OFF_OFAITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <rtl/ref.hxx>
+#include "svx/svxdllapi.h"
+
+// class OfaPtrItem ------------------------------------------------------
+
+class SVX_DLLPUBLIC OfaPtrItem : public SfxPoolItem
+{
+private:
+ void* pPtr;
+
+public:
+ OfaPtrItem( sal_uInt16 nWhich, void *pPtr );
+ OfaPtrItem( const OfaPtrItem& );
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+ void* GetValue() const { return pPtr; }
+ void SetValue( void* pNewPtr ) { pPtr = pNewPtr; }
+};
+
+// class OfaRefItem - for ref counting items
+
+template <class reference_type>
+class OfaRefItem : public SfxPoolItem
+{
+ private:
+ rtl::Reference<reference_type> mxRef;
+public:
+ OfaRefItem( sal_uInt16 _nWhich, const rtl::Reference<reference_type> &xRef )
+ : SfxPoolItem( _nWhich ), mxRef( xRef )
+ {}
+ OfaRefItem( const OfaRefItem& rItem )
+ : SfxPoolItem( rItem.Which() ), mxRef( rItem.mxRef )
+ {}
+ virtual int operator==( const SfxPoolItem& rItem ) const
+ {
+ return mxRef == ((OfaRefItem<reference_type> &)rItem).mxRef;
+ }
+ virtual SfxPoolItem*Clone( SfxItemPool* /*pPool = 0*/ ) const
+ {
+ return new OfaRefItem( *this );
+ }
+ inline rtl::Reference<reference_type> GetValue() const
+ {
+ return mxRef;
+ }
+ inline void SetValue( const rtl::Reference<reference_type> &xRef )
+ {
+ mxRef = xRef;
+ }
+};
+
+#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 000000000000..54df8e21dbf2
--- /dev/null
+++ b/include/svx/optgenrl.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 _SVX_OPTGENRL_HXX
+#define _SVX_OPTGENRL_HXX
+
+// Defines for setting the focus of a Edit via a slot from external.
+#define UNKNOWN_EDIT ((sal_uInt16)0)
+#define COMPANY_EDIT ((sal_uInt16)1)
+#define FIRSTNAME_EDIT ((sal_uInt16)2)
+#define LASTNAME_EDIT ((sal_uInt16)3)
+#define STREET_EDIT ((sal_uInt16)4)
+#define COUNTRY_EDIT ((sal_uInt16)5)
+#define PLZ_EDIT ((sal_uInt16)6)
+#define CITY_EDIT ((sal_uInt16)7)
+#define STATE_EDIT ((sal_uInt16)8)
+#define TITLE_EDIT ((sal_uInt16)9)
+#define POSITION_EDIT ((sal_uInt16)10)
+#define SHORTNAME_EDIT ((sal_uInt16)11)
+#define TELPRIV_EDIT ((sal_uInt16)12)
+#define TELCOMPANY_EDIT ((sal_uInt16)13)
+#define FAX_EDIT ((sal_uInt16)14)
+#define EMAIL_EDIT ((sal_uInt16)15)
+
+#endif // #ifndef _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 000000000000..300dfaabcd4a
--- /dev/null
+++ b/include/svx/optgrid.hxx
@@ -0,0 +1,170 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_OPTGRID_HXX
+#define _SVX_OPTGRID_HXX
+
+#include <sfx2/tabdlg.hxx>
+#include <svl/eitem.hxx>
+#include <vcl/group.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include "svx/svxdllapi.h"
+
+class SvxGridTabPage;
+
+// class SvxOptionsGrid --------------------------------------------------
+
+class SVX_DLLPUBLIC SvxOptionsGrid
+{
+protected:
+ sal_uInt32 nFldDrawX;
+ sal_uInt32 nFldDivisionX;
+ sal_uInt32 nFldDrawY;
+ sal_uInt32 nFldDivisionY;
+ sal_uInt32 nFldSnapX;
+ sal_uInt32 nFldSnapY;
+ sal_Bool bUseGridsnap:1;
+ sal_Bool bSynchronize:1;
+ sal_Bool bGridVisible:1;
+ sal_Bool bEqualGrid: 1;
+
+public:
+ SvxOptionsGrid();
+ ~SvxOptionsGrid();
+
+ void SetFldDrawX( sal_uInt32 nSet){nFldDrawX = nSet;}
+ void SetFldDivisionX(sal_uInt32 nSet){nFldDivisionX = nSet;}
+ void SetFldDrawY ( sal_uInt32 nSet){nFldDrawY = nSet;}
+ void SetFldDivisionY(sal_uInt32 nSet){nFldDivisionY = nSet;}
+ void SetFldSnapX( sal_uInt32 nSet){nFldSnapX = nSet;}
+ void SetFldSnapY ( sal_uInt32 nSet){nFldSnapY = nSet;}
+ void SetUseGridSnap( sal_Bool bSet ) {bUseGridsnap = bSet;}
+ void SetSynchronize( sal_Bool bSet ) {bSynchronize = bSet;}
+ void SetGridVisible( sal_Bool bSet ) {bGridVisible = bSet;}
+ void SetEqualGrid( sal_Bool bSet ) {bEqualGrid = bSet;}
+
+ sal_uInt32 GetFldDrawX( ) const { return nFldDrawX; }
+ sal_uInt32 GetFldDivisionX() const { return nFldDivisionX;}
+ sal_uInt32 GetFldDrawY ( ) const { return nFldDrawY; }
+ sal_uInt32 GetFldDivisionY() const { return nFldDivisionY;}
+ sal_uInt32 GetFldSnapX( ) const { return nFldSnapX; }
+ sal_uInt32 GetFldSnapY ( ) const { return nFldSnapY; }
+ sal_Bool GetUseGridSnap( ) const { return bUseGridsnap; }
+ sal_Bool GetSynchronize( ) const { return bSynchronize; }
+ sal_Bool GetGridVisible( ) const { return bGridVisible; }
+ sal_Bool GetEqualGrid() const { return bEqualGrid; }
+};
+
+// class SvxGridItem -----------------------------------------------------
+
+class SVX_DLLPUBLIC SvxGridItem : public SvxOptionsGrid, public SfxPoolItem
+{
+ // #i9076#
+ friend class SvxGridTabPage;
+
+public:
+ SvxGridItem( sal_uInt16 _nWhich) : SfxPoolItem(_nWhich){};
+ SvxGridItem( const SvxGridItem& pTestItem );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+};
+
+// class SvxGridTabPage --------------------------------------------------
+
+class SVX_DLLPUBLIC SvxGridTabPage : public SfxTabPage
+{
+ using TabPage::ActivatePage;
+ using TabPage::DeactivatePage;
+
+public:
+ SvxGridTabPage( Window* pParent, const SfxItemSet& rSet );
+
+ static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
+
+ virtual sal_Bool FillItemSet( SfxItemSet& rSet );
+ virtual void Reset( const SfxItemSet& rSet );
+
+ virtual void ActivatePage( const SfxItemSet& rSet );
+ virtual int DeactivatePage( SfxItemSet* pSet );
+
+private:
+ CheckBox aCbxUseGridsnap;
+ CheckBox aCbxGridVisible;
+
+ FixedLine aFlResolution;
+ FixedText aFtDrawX;
+ MetricField aMtrFldDrawX;
+ FixedText aFtDrawY;
+ MetricField aMtrFldDrawY;
+
+ FixedLine aFlDivision;
+ FixedText aFtDivisionX;
+ NumericField aNumFldDivisionX;
+ FixedText aDivisionPointX;
+
+ FixedText aFtDivisionY;
+ NumericField aNumFldDivisionY;
+ FixedText aDivisionPointY;
+
+ CheckBox aCbxSynchronize;
+ FixedLine aGrpDrawGrid;
+
+protected:
+ //these controls are used in draw and impress
+ FixedLine aGrpSnap;
+ CheckBox aCbxSnapHelplines;
+ CheckBox aCbxSnapBorder;
+ CheckBox aCbxSnapFrame;
+ CheckBox aCbxSnapPoints;
+ FixedText aFtSnapArea;
+ MetricField aMtrFldSnapArea;
+
+ FixedLine aSeparatorFL;
+
+ FixedLine aGrpOrtho;
+ CheckBox aCbxOrtho;
+ CheckBox aCbxBigOrtho;
+ CheckBox aCbxRotate;
+ MetricField aMtrFldAngle;
+ FixedText aFtBezAngle;
+ MetricField aMtrFldBezAngle;
+
+private:
+ sal_Bool bAttrModified;
+
+#ifdef _SVX_OPTGRID_CXX
+ DECL_LINK( ClickRotateHdl_Impl, void * );
+ DECL_LINK( ChangeDrawHdl_Impl, MetricField * );
+ DECL_LINK( ChangeGridsnapHdl_Impl, void * );
+ DECL_LINK( ChangeDivisionHdl_Impl, NumericField * );
+
+#endif
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/orienthelper.hxx b/include/svx/orienthelper.hxx
new file mode 100644
index 000000000000..c012f1e4d8d0
--- /dev/null
+++ b/include/svx/orienthelper.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 SVX_ORIENTHELPER_HXX
+#define SVX_ORIENTHELPER_HXX
+
+#include <memory>
+#include <vcl/window.hxx>
+#include <sfx2/itemconnect.hxx>
+#include "svx/svxdllapi.h"
+
+class NumericField;
+class CheckBox;
+
+namespace svx {
+
+class DialControl;
+
+// ============================================================================
+
+struct OrientationHelper_Impl;
+
+/** A helper class that manages a DialControl and a "Stacked text" check box.
+
+ This helper remembers a DialControl for entering a rotation angle, and a
+ check box for stacked text, that enables/disables other controls dependent
+ on its state.
+
+ It is possible to register more controls that have to be enabled/disabled
+ together with this helper object (optionally dependent on the stacked text
+ check box), using the function AddDependentWindow(). All registered windows
+ are handled on a call of Enable(), or Show(), or on changing the state of
+ the "Stacked text" check box.
+
+ Note: The member function SetStackedState() should be used instead of
+ direct modifications of the "Stacked text" check box. Otherwise the update
+ mechanism of registered controls will not work.
+ */
+class SVX_DLLPUBLIC OrientationHelper
+{
+public:
+ /** @param rNfRotation A numeric field that will be connected to the DialControl. */
+ explicit OrientationHelper(
+ DialControl& rCtrlDial,
+ NumericField& rNfRotation,
+ CheckBox& rCbStacked );
+
+ virtual ~OrientationHelper();
+
+ /** Registers the passed window to be enabled/disabled on call of Enable().
+ @param eDisableIfStacked
+ STATE_CHECK: Window always disabled, if stacked text is turned on.
+ STATE_NOCHECK: Window always disabled, if stacked text is turned off.
+ STATE_DONTKNOW: Window will be enabled/disabled independent from stacked text. */
+ void AddDependentWindow( Window& rWindow, TriState eDisableIfStacked = STATE_DONTKNOW );
+
+ /** Enables or disables the dial control and all dependent windows. */
+ void Enable( bool bEnable = true );
+ /** Disables the dial control and all dependent windows. */
+ inline void Disable() { Enable( false ); }
+
+ /** Shows or hides the dial control and all dependent windows. */
+ void Show( bool bShow = true );
+ /** Hides the dial control and all dependent windows. */
+ inline void Hide() { Show( false ); }
+
+ /** Sets the "stacked" check box to the passed state and updates dependent controls. */
+ void SetStackedState( TriState eState );
+ /** Returns the state of the "stacked" check box. */
+ TriState GetStackedState() const;
+
+ /** Enables/disables the "don't know" state of the "Stacked text" check box. */
+ void EnableStackedTriState( bool bEnable = true );
+
+private:
+ std::auto_ptr< OrientationHelper_Impl > mpImpl;
+};
+
+// ============================================================================
+
+/** Wrapper for usage of the stacked attribute of an OrientationHelper in item connections. */
+class SVX_DLLPUBLIC OrientStackedWrapper : public sfx::SingleControlWrapper< OrientationHelper, bool >
+{
+public:
+ explicit OrientStackedWrapper( OrientationHelper& rOrientHlp );
+
+ virtual bool IsControlDontKnow() const;
+ virtual void SetControlDontKnow( bool bSet );
+
+ virtual bool GetControlValue() const;
+ virtual void SetControlValue( bool bValue );
+};
+
+// ----------------------------------------------------------------------------
+
+/** An item<->control connection for the stacked attribute of an OrientationHelper. */
+typedef sfx::ItemControlConnection< sfx::BoolItemWrapper, OrientStackedWrapper > OrientStackedConnection;
+
+// ============================================================================
+
+} // namespace
+
+#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 000000000000..9a6e2ca90821
--- /dev/null
+++ b/include/svx/pagectrl.hxx
@@ -0,0 +1,164 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_PAGECTRL_HXX
+#define _SVX_PAGECTRL_HXX
+
+#include <vcl/window.hxx>
+#include "svx/svxdllapi.h"
+
+// forward ---------------------------------------------------------------
+
+class SvxBoxItem;
+struct PageWindow_Impl;
+
+// class SvxPageWindow ---------------------------------------------------
+
+class SVX_DLLPUBLIC SvxPageWindow : public Window
+{
+ using Window::GetBorder;
+
+private:
+ Size aWinSize;
+ Size aSize;
+
+ long nTop;
+ long nBottom;
+ long nLeft;
+ long nRight;
+ Color aColor;
+
+ PageWindow_Impl* pImpl;
+
+ long nHdLeft;
+ long nHdRight;
+ long nHdDist;
+ long nHdHeight;
+ Color aHdColor;
+ SvxBoxItem* pHdBorder;
+
+ long nFtLeft;
+ long nFtRight;
+ long nFtDist;
+ long nFtHeight;
+ Color aFtColor;
+ SvxBoxItem* pFtBorder;
+
+ sal_Bool bFooter :1;
+ sal_Bool bHeader :1;
+ sal_Bool bTable :1;
+ sal_Bool bHorz :1;
+ sal_Bool bVert :1;
+
+ sal_uInt16 eUsage;
+
+ String aLeftText;
+ String aRightText;
+
+protected:
+ virtual void Paint( const Rectangle& rRect );
+
+ virtual void DrawPage( const Point& rPoint,
+ const sal_Bool bSecond,
+ const sal_Bool bEnabled );
+
+public:
+ SvxPageWindow( Window* pParent, const ResId& rId );
+ SvxPageWindow( Window* pParent );
+ ~SvxPageWindow();
+
+ void SetWidth( long nW ) { aSize.Width() = nW; }
+ void SetHeight( long nH ) { aSize.Height() = nH; }
+
+ void SetSize( const Size& rSz ) { aSize = rSz; }
+ 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; }
+ void SetColor( const Color& rNew ) { aColor = rNew; }
+ void SetBorder( const SvxBoxItem& rNew );
+ void SetBitmap( Bitmap* pBmp );
+
+ long GetTop() const { return nTop; }
+ long GetBottom() const { return nBottom;}
+ long GetLeft() const { return nLeft; }
+ long GetRight() const { return nRight; }
+
+ const Color& GetColor() const { return aColor; }
+ const SvxBoxItem& GetBorder() const;
+
+ void SetHdLeft( long nNew ) { nHdLeft = nNew; }
+ void SetHdRight( long nNew ) { nHdRight = nNew; }
+ void SetHdDist( long nNew ) { nHdDist = nNew; }
+ void SetHdHeight( long nNew ) { nHdHeight = nNew; }
+ void SetHdColor( const Color& aNew ) { aHdColor = aNew; }
+ void SetHdBorder( const SvxBoxItem& rNew );
+
+ long GetHdLeft() const { return nHdLeft; }
+ long GetHdRight() const { return nHdRight; }
+ long GetHdDist() const { return nHdDist; }
+ long GetHdHeight() const { return nHdHeight;}
+
+ const Color& GetHdColor() const { return aHdColor; }
+ const SvxBoxItem& GetHdBorder() const { return *pHdBorder; }
+
+ void SetFtLeft( long nNew ) { nFtLeft = nNew; }
+ void SetFtRight( long nNew ) { nFtRight = nNew; }
+ void SetFtDist( long nNew ) { nFtDist = nNew; }
+ void SetFtHeight( long nNew ) { nFtHeight = nNew; }
+ void SetFtColor( const Color& aNew ) { aFtColor = aNew; }
+ void SetFtBorder( const SvxBoxItem& rNew );
+
+ long GetFtLeft() const { return nFtLeft; }
+ long GetFtRight() const { return nFtRight; }
+ long GetFtDist() const { return nFtDist; }
+ long GetFtHeight() const { return nFtHeight;}
+
+ const Color& GetFtColor() const { return aFtColor; }
+ const SvxBoxItem& GetFtBorder() const { return *pFtBorder; }
+
+ void SetUsage( sal_uInt16 eU ) { eUsage = eU; }
+ sal_uInt16 GetUsage() const { return eUsage;}
+
+ void SetHeader( sal_Bool bNew ) { bHeader = bNew; }
+ sal_Bool GetHeader() const { return bHeader;}
+ void SetFooter( sal_Bool bNew ) { bFooter = bNew; }
+ sal_Bool GetFooter() const { return bFooter;}
+
+ void SetTable( sal_Bool bNew ) { bTable = bNew; }
+ sal_Bool GetTable() const { return bTable;}
+ void SetHorz( sal_Bool bNew ) { bHorz = bNew; }
+ sal_Bool GetHorz() const { return bHorz;}
+ void SetVert( sal_Bool bNew ) { bVert = bNew; }
+ sal_Bool GetVert() const { return bVert;}
+
+ void EnableFrameDirection(sal_Bool bEnable);
+ //uses enum SvxFrameDirection
+ void SetFrameDirection(sal_Int32 nFrameDirection);
+
+ void ResetBackground();
+
+ virtual Size GetOptimalSize() const;
+};
+
+#endif // #ifndef _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 000000000000..48d5dd98f04d
--- /dev/null
+++ b/include/svx/pageitem.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 _SVX_PAGEITEM_HXX
+#define _SVX_PAGEITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <tools/string.hxx>
+#include "svx/svxdllapi.h"
+
+
+enum SvxNumType
+{
+ SVX_CHARS_UPPER_LETTER,
+ SVX_CHARS_LOWER_LETTER,
+ SVX_ROMAN_UPPER,
+ SVX_ROMAN_LOWER,
+ SVX_ARABIC,
+ SVX_NUMBER_NONE,
+ SVX_CHAR_SPECIAL,
+ SVX_PAGEDESC
+};
+
+/*--------------------------------------------------------------------
+ usage of the page
+ --------------------------------------------------------------------*/
+
+enum SvxPageUsage
+{
+ SVX_PAGE_LEFT = 0x0001,
+ SVX_PAGE_RIGHT = 0x0002,
+ SVX_PAGE_ALL = 0x0003,
+ SVX_PAGE_MIRROR = 0x0007,
+ SVX_PAGE_HEADERSHARE = 0x0040,
+ SVX_PAGE_FOOTERSHARE = 0x0080
+};
+
+/*--------------------------------------------------------------------
+ parts of the page description
+ --------------------------------------------------------------------*/
+
+/*
+This item describes a page attribute (name of the template, enumeration,
+portait or landscape, layout)
+*/
+
+class SVX_DLLPUBLIC SvxPageItem: public SfxPoolItem
+{
+private:
+ String aDescName; // name of the template
+ SvxNumType eNumType; // enumeration
+ sal_Bool bLandscape; // Portrait / Landscape
+ sal_uInt16 eUse; // Layout
+
+public:
+
+ TYPEINFO();
+ SvxPageItem( const sal_uInt16 nId );
+ SvxPageItem( const SvxPageItem& rItem );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 ) const;
+ virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const;
+
+ // orientation
+ sal_uInt16 GetPageUsage() const { return eUse; }
+ void SetPageUsage(sal_uInt16 eU) { eUse= eU; }
+
+ sal_Bool IsLandscape() const { return bLandscape; }
+ void SetLandscape(sal_Bool bL) { bLandscape = bL; }
+
+ // enumeration
+ SvxNumType GetNumType() const { return eNumType; }
+ void SetNumType(SvxNumType eNum) { eNumType = eNum; }
+
+ // name of the descriptor
+ const String& GetDescName() const { return aDescName; }
+ void SetDescName(const String& rStr) { aDescName = rStr; }
+};
+
+
+
+/*--------------------------------------------------------------------
+ container for header/footer attributes
+ --------------------------------------------------------------------*/
+
+class SVX_DLLPUBLIC SvxSetItem: public SfxSetItem
+{
+public:
+ SvxSetItem( const sal_uInt16 nId, const SfxItemSet& rSet );
+ SvxSetItem( const SvxSetItem& rItem );
+ SvxSetItem( const sal_uInt16 nId, SfxItemSet* pSet );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nVersion ) const;
+ virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const;
+};
+
+
+
+
+#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 000000000000..ebef6399fcac
--- /dev/null
+++ b/include/svx/paraprev.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 _SVX_PARAPREV_HXX
+#define _SVX_PARAPREV_HXX
+
+#include <vcl/window.hxx>
+#include <editeng/svxenum.hxx>
+#include "svx/svxdllapi.h"
+
+// enum ------------------------------------------------------------------
+
+enum SvxPrevLineSpace
+{
+ SVX_PREV_LINESPACE_1 = 0,
+ SVX_PREV_LINESPACE_15,
+ SVX_PREV_LINESPACE_2,
+ SVX_PREV_LINESPACE_PROP,
+ SVX_PREV_LINESPACE_MIN,
+ SVX_PREV_LINESPACE_DURCH
+};
+
+// class SvxParaPrevWindow -----------------------------------------------
+
+class SVX_DLLPUBLIC SvxParaPrevWindow : public Window
+{
+ using Window::Draw;
+private:
+ Size aWinSize;
+ Size aSize;
+
+ // indentation
+ long nLeftMargin;
+ long nRightMargin;
+ short nFirstLineOfst;
+ // distances
+ sal_uInt16 nUpper;
+ sal_uInt16 nLower;
+ // adjustment
+ SvxAdjust eAdjust;
+ // last line in justification
+ SvxAdjust eLastLine;
+ // line distance
+ SvxPrevLineSpace eLine;
+ sal_uInt16 nLineVal;
+
+ String aText;
+ Rectangle Lines[9];
+
+protected:
+ virtual void Paint( const Rectangle& rRect );
+
+ void DrawParagraph( sal_Bool bAll );
+
+public:
+ SvxParaPrevWindow( Window* pParent, const ResId& rId );
+
+ void SetFirstLineOfst( short nNew ) { nFirstLineOfst = 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, sal_uInt16 nNew = 0 )
+ { eLine = eNew; nLineVal = nNew; }
+ void SetText( const OUString& rStr ) { aText = rStr; }
+ void SetSize( Size aNew ) { aSize = aNew; }
+
+ short GetFirstLineOfst() const { return nFirstLineOfst; }
+ long GetLeftMargin() const { return nLeftMargin; }
+ long GetRightMargin() const { return nRightMargin; }
+ sal_uInt16 GetUpper() const { return nUpper; }
+ sal_uInt16 GetLower() const { return nLower; }
+ SvxAdjust GetAdjust() const { return eAdjust; }
+
+ SvxPrevLineSpace GetLineEnum() const { return eLine; }
+ sal_uInt16 GetLineValue() const { return nLineVal; }
+ OUString GetText() const { return aText; }
+ Size GetSize() const { return aSize; }
+
+ void Draw( sal_Bool bAll ) { DrawParagraph( bAll ); }
+};
+
+#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 000000000000..b59898db66f7
--- /dev/null
+++ b/include/svx/passwd.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 _SVX_PASSWD_HXX
+#define _SVX_PASSWD_HXX
+
+#include <sfx2/basedlgs.hxx>
+
+#include <vcl/fixed.hxx>
+
+#include <vcl/edit.hxx>
+
+#include <vcl/button.hxx>
+#include "svx/svxdllapi.h"
+
+// class SvxPasswordDialog -----------------------------------------------
+
+class SVX_DLLPUBLIC SvxPasswordDialog : public SfxModalDialog
+{
+private:
+ FixedLine aOldFL;
+ FixedText aOldPasswdFT;
+ Edit aOldPasswdED;
+ FixedLine aNewFL;
+ FixedText aNewPasswdFT;
+ Edit aNewPasswdED;
+ FixedText aRepeatPasswdFT;
+ Edit aRepeatPasswdED;
+ OKButton aOKBtn;
+ CancelButton aEscBtn;
+ HelpButton aHelpBtn;
+
+ String aOldPasswdErrStr;
+ String aRepeatPasswdErrStr;
+
+ Link aCheckPasswordHdl;
+
+ sal_Bool bEmpty;
+
+ DECL_LINK(ButtonHdl, void *);
+ DECL_LINK(EditModifyHdl, void *);
+
+public:
+ SvxPasswordDialog( Window* pParent, sal_Bool bAllowEmptyPasswords = sal_False, sal_Bool bDisableOldPassword = sal_False );
+ ~SvxPasswordDialog();
+
+ String GetOldPassword() const { return aOldPasswdED.GetText(); }
+ String GetNewPassword() const { return aNewPasswdED.GetText(); }
+
+ void SetCheckPasswordHdl( const Link& rLink ) { aCheckPasswordHdl = rLink; }
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/pfiledlg.hxx b/include/svx/pfiledlg.hxx
new file mode 100644
index 000000000000..e472349a6c53
--- /dev/null
+++ b/include/svx/pfiledlg.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 _SVX_PFILEDLG_HXX
+#define _SVX_PFILEDLG_HXX
+
+#include <sfx2/filedlghelper.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* Filedialog to insert Plugin-Fileformats
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxPluginFileDlg
+{
+private:
+ sfx2::FileDialogHelper maFileDlg;
+
+public:
+ // with nKind = SID_INSERT_SOUND or
+ // nKind = SID_INSERT_VIDEO
+ SvxPluginFileDlg (Window *pParent, sal_uInt16 nKind );
+ ~SvxPluginFileDlg ();
+
+ ErrCode Execute();
+ String GetPath() const;
+
+ void SetContext( sfx2::FileDialogHelper::Context eNewContext );
+};
+
+#endif // _SVX_PFILEDLG_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/polygn3d.hxx b/include/svx/polygn3d.hxx
new file mode 100644
index 000000000000..843eac5c288a
--- /dev/null
+++ b/include/svx/polygn3d.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 _E3D_POLYGON3D_HXX
+#define _E3D_POLYGON3D_HXX
+
+#include <svx/obj3d.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC E3dPolygonObj : public E3dCompoundObject
+{
+private:
+ // parameters
+ basegfx::B3DPolyPolygon aPolyPoly3D;
+ basegfx::B3DPolyPolygon aPolyNormals3D;
+ basegfx::B2DPolyPolygon aPolyTexture2D;
+ sal_Bool bLineOnly;
+
+ SVX_DLLPRIVATE void CreateDefaultNormals();
+ SVX_DLLPRIVATE void CreateDefaultTexture();
+
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
+public:
+ void SetPolyPolygon3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D);
+ void SetPolyNormals3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D);
+ void SetPolyTexture2D(const basegfx::B2DPolyPolygon& rNewPolyPoly2D);
+
+ TYPEINFO();
+
+ E3dPolygonObj(
+ E3dDefaultAttributes& rDefault,
+ const basegfx::B3DPolyPolygon& rPolyPoly3D,
+ sal_Bool bLinOnly=sal_False);
+
+ E3dPolygonObj();
+ virtual ~E3dPolygonObj();
+
+ const basegfx::B3DPolyPolygon& GetPolyPolygon3D() const { return aPolyPoly3D; }
+ const basegfx::B3DPolyPolygon& GetPolyNormals3D() const { return aPolyNormals3D; }
+ const basegfx::B2DPolyPolygon& GetPolyTexture2D() const { return aPolyTexture2D; }
+
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+ virtual E3dPolygonObj* Clone() const;
+
+ // LineOnly?
+ sal_Bool GetLineOnly() { return bLineOnly; }
+ void SetLineOnly(sal_Bool bNew);
+};
+
+#endif // _E3D_POLYGON3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/polypolygoneditor.hxx b/include/svx/polypolygoneditor.hxx
new file mode 100644
index 000000000000..94fabbe4e292
--- /dev/null
+++ b/include/svx/polypolygoneditor.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 _SDR_POLYPOLYGONEDITOR_HXX_
+#define _SDR_POLYPOLYGONEDITOR_HXX_
+
+#include "svx/svxdllapi.h"
+
+#include "svx/ipolypolygoneditorcontroller.hxx"
+
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <set>
+
+namespace sdr
+{
+
+/** this class implements some helper functions to edit a B2DPolyPolygon */
+class SVX_DLLPUBLIC PolyPolygonEditor
+{
+public:
+ PolyPolygonEditor( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed );
+
+ 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 realative position ( polygon number and point number in that polygon ) from the absolut 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;
+ bool mbIsClosed;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/polysc3d.hxx b/include/svx/polysc3d.hxx
new file mode 100644
index 000000000000..e25a0bdb36b1
--- /dev/null
+++ b/include/svx/polysc3d.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 _E3D_POLYSC3D_HXX
+#define _E3D_POLYSC3D_HXX
+
+#include <svx/svdpage.hxx>
+#include <svx/scene3d.hxx>
+
+/*************************************************************************
+|*
+|* 3D scene displayed through 2D polygons
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC E3dPolyScene : public E3dScene
+{
+public:
+ TYPEINFO();
+ E3dPolyScene();
+ E3dPolyScene(E3dDefaultAttributes& rDefault);
+
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual E3dPolyScene* Clone() const;
+};
+
+#endif // _E3D_POLYSC3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/postattr.hxx b/include/svx/postattr.hxx
new file mode 100644
index 000000000000..9bdd2698551e
--- /dev/null
+++ b/include/svx/postattr.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_POSTATTR_HXX
+#define _SVX_POSTATTR_HXX
+
+#include <svl/stritem.hxx>
+#include "svx/svxdllapi.h"
+
+// class SvxPostItAuthorItem ---------------------------------------------
+
+
+
+/*
+The author shorthand symbol of a note
+*/
+
+class SVX_DLLPUBLIC SvxPostItAuthorItem: public SfxStringItem
+{
+public:
+ TYPEINFO();
+
+ SvxPostItAuthorItem( sal_uInt16 nWhich );
+
+ SvxPostItAuthorItem( const String& rAuthor, sal_uInt16 nWhich );
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+ inline SvxPostItAuthorItem& operator=( const SvxPostItAuthorItem& rAuthor )
+ {
+ SetValue( rAuthor.GetValue() );
+ return *this;
+ }
+};
+
+
+// class SvxPostItDateItem -----------------------------------------------
+
+
+
+/*
+The date of a note
+*/
+
+class SVX_DLLPUBLIC SvxPostItDateItem: public SfxStringItem
+{
+public:
+ TYPEINFO();
+
+ SvxPostItDateItem( sal_uInt16 nWhich );
+
+ SvxPostItDateItem( const String& rDate, sal_uInt16 nWhich );
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+ inline SvxPostItDateItem& operator=( const SvxPostItDateItem& rDate )
+ {
+ SetValue( rDate.GetValue() );
+ return *this;
+ }
+};
+
+
+// class SvxPostItTextItem -----------------------------------------------
+
+
+
+/*
+The text of a note
+*/
+
+class SVX_DLLPUBLIC SvxPostItTextItem: public SfxStringItem
+{
+public:
+ TYPEINFO();
+
+ SvxPostItTextItem( sal_uInt16 nWhich );
+
+ SvxPostItTextItem( const String& rText, sal_uInt16 nWhich );
+ // "pure virtual methods" from SfxPoolItem
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+ inline SvxPostItTextItem& operator=( const SvxPostItTextItem& rText )
+ {
+ SetValue( rText.GetValue() );
+ return *this;
+ }
+};
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/prtqry.hxx b/include/svx/prtqry.hxx
new file mode 100644
index 000000000000..558301a3c978
--- /dev/null
+++ b/include/svx/prtqry.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_PRTQRY_HXX
+#define _SVX_PRTQRY_HXX
+
+#include <vcl/msgbox.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC SvxPrtQryBox : public MessBox
+{
+public:
+ SvxPrtQryBox(Window* pParent);
+ ~SvxPrtQryBox();
+};
+
+#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 000000000000..a4280844099c
--- /dev/null
+++ b/include/svx/pszctrl.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 _SVX_PSZCTRL_HXX
+#define _SVX_PSZCTRL_HXX
+
+#include <sfx2/stbitem.hxx>
+#include "svx/svxdllapi.h"
+
+// forward ---------------------------------------------------------------
+
+class SvxSizeItem;
+struct SvxPosSizeStatusBarControl_Impl;
+
+// class SvxPosSizeToolBoxControl ----------------------------------------
+
+class SVX_DLLPUBLIC SvxPosSizeStatusBarControl : public SfxStatusBarControl
+{
+private:
+ SvxPosSizeStatusBarControl_Impl* pImp;
+ SVX_DLLPRIVATE String GetMetricStr_Impl( long nVal );
+public:
+ SFX_DECL_STATUSBAR_CONTROL();
+
+ SvxPosSizeStatusBarControl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb );
+ ~SvxPosSizeStatusBarControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual void Paint( const UserDrawEvent& rEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+};
+
+
+#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 000000000000..4e6c5486f2b6
--- /dev/null
+++ b/include/svx/rectenum.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 _SVX_RECTENUM_HXX
+#define _SVX_RECTENUM_HXX
+
+// enum ------------------------------------------------------------------
+
+enum RECT_POINT
+{
+ RP_LT, RP_MT, RP_RT, RP_LM, RP_MM, RP_RM, RP_LB, RP_MB, RP_RB
+};
+
+enum CTL_STYLE
+{
+ CS_RECT,
+ CS_LINE,
+ CS_ANGLE,
+ CS_SHADOW
+};
+
+
+#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 000000000000..fa544c2d00a5
--- /dev/null
+++ b/include/svx/relfld.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 _SVX_RELFLD_HXX
+#define _SVX_RELFLD_HXX
+
+#include <vcl/field.hxx>
+#include "svx/svxdllapi.h"
+
+
+// class SvxRelativeField ------------------------------------------------
+
+class SVX_DLLPUBLIC SvxRelativeField : public MetricField
+{
+private:
+ sal_uInt16 nRelMin;
+ sal_uInt16 nRelMax;
+ sal_uInt16 nRelStep;
+ sal_Bool bRelativeMode;
+ sal_Bool bRelative;
+ sal_Bool bNegativeEnabled;
+
+protected:
+ void Modify();
+
+public:
+ SvxRelativeField( Window* pParent, const ResId& rResId );
+
+ void EnableRelativeMode( sal_uInt16 nMin = 50, sal_uInt16 nMax = 150,
+ sal_uInt16 nStep = 5 );
+ sal_Bool IsRelativeMode() const { return bRelativeMode; }
+ void SetRelative( sal_Bool bRelative = sal_False );
+ sal_Bool IsRelative() const { return bRelative; }
+ void EnableNegativeMode() {bNegativeEnabled = sal_True;}
+};
+
+
+#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 000000000000..f945280fc2b2
--- /dev/null
+++ b/include/svx/rotmodit.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 _SVX_ROTMODIT_HXX
+#define _SVX_ROTMODIT_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+//----------------------------------------------------------------------------
+// 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: public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ SvxRotateModeItem( SvxRotateMode eMode=SVX_ROTATE_MODE_STANDARD, sal_uInt16 nWhich=0);
+ SvxRotateModeItem( const SvxRotateModeItem& rItem );
+ ~SvxRotateModeItem();
+
+ virtual sal_uInt16 GetValueCount() const;
+ virtual String GetValueText( sal_uInt16 nVal ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString& rText, const IntlWrapper * = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+
+#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 000000000000..f1538a32c3ec
--- /dev/null
+++ b/include/svx/rubydialog.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 _SVX_RUBYDLG_HXX_
+#define _SVX_RUBYDLG_HXX_
+
+#include <sfx2/childwin.hxx>
+#include <sfx2/basedlgs.hxx>
+#include <vcl/layout.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/scrbar.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include "svx/svxdllapi.h"
+
+namespace com{namespace sun{namespace star{
+ namespace view{
+ class XSelectionChangeListener;
+ }
+}}}
+
+
+class SvxRubyDialog;
+class RubyPreview : public Window
+{
+protected:
+ virtual void Paint( const Rectangle& rRect );
+ SvxRubyDialog* m_pParentDlg;
+
+public:
+ RubyPreview(Window *pParent);
+ void setRubyDialog(SvxRubyDialog* pParentDlg)
+ {
+ m_pParentDlg = pParentDlg;
+ }
+ virtual Size GetOptimalSize() const;
+};
+
+class SVX_DLLPUBLIC SvxRubyChildWindow : public SfxChildWindow
+{
+ public:
+
+ SvxRubyChildWindow( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
+
+ SFX_DECL_CHILDWINDOW( SvxRubyChildWindow );
+
+};
+class SvxRubyData_Impl;
+class RubyEdit : public Edit
+{
+ Link aScrollHdl;
+ Link aJumpHdl;
+ virtual void GetFocus();
+ virtual long PreNotify( NotifyEvent& rNEvt );
+public:
+ RubyEdit(Window* pParent, const ResId& rResId)
+ : Edit(pParent, rResId)
+ {
+ }
+ RubyEdit(Window* pParent)
+ : Edit(pParent, WB_BORDER)
+ {
+ }
+ void SetScrollHdl(Link& rLink) {aScrollHdl = rLink;}
+ void SetJumpHdl(Link& rLink) {aJumpHdl = rLink;}
+};
+
+
+class SvxRubyDialog : public SfxModelessDialog
+{
+ using Window::SetText;
+ using Window::GetText;
+
+ friend class RubyPreview;
+
+ FixedText* m_pLeftFT;
+ FixedText* m_pRightFT;
+ RubyEdit* m_pLeft1ED;
+ RubyEdit* m_pRight1ED;
+ RubyEdit* m_pLeft2ED;
+ RubyEdit* m_pRight2ED;
+ RubyEdit* m_pLeft3ED;
+ RubyEdit* m_pRight3ED;
+ RubyEdit* m_pLeft4ED;
+ RubyEdit* m_pRight4ED;
+
+ RubyEdit* aEditArr[8];
+ VclScrolledWindow* m_pScrolledWindow;
+ ScrollBar* m_pScrollSB;
+
+ ListBox* m_pAdjustLB;
+
+ ListBox* m_pPositionLB;
+
+ FixedText* m_pCharStyleFT;
+ ListBox* m_pCharStyleLB;
+ PushButton* m_pStylistPB;
+
+ RubyPreview* m_pPreviewWin;
+
+ PushButton* m_pApplyPB;
+ PushButton* m_pClosePB;
+
+ long nLastPos;
+ long nCurrentEdit;
+
+ sal_Bool bModified;
+
+ com::sun::star::uno::Reference<com::sun::star::view::XSelectionChangeListener> xImpl;
+ SfxBindings* pBindings;
+ SvxRubyData_Impl* pImpl;
+
+ DECL_LINK(ApplyHdl_Impl, void *);
+ DECL_LINK(CloseHdl_Impl, void *);
+ DECL_LINK(StylistHdl_Impl, void *);
+ DECL_LINK(ScrollHdl_Impl, ScrollBar*);
+ DECL_LINK(PositionHdl_Impl, ListBox*);
+ DECL_LINK(AdjustHdl_Impl, ListBox*);
+ DECL_LINK(CharStyleHdl_Impl, void *);
+ DECL_LINK(EditModifyHdl_Impl, Edit*);
+ DECL_LINK(EditScrollHdl_Impl, sal_Int32*);
+ DECL_LINK(EditJumpHdl_Impl, sal_Int32*);
+
+ void SetText(sal_Int32 nPos, Edit& rLeft, Edit& rRight);
+ void GetText();
+ void ClearCharStyleList();
+ void AssertOneEntry();
+
+ void Update();
+ virtual sal_Bool Close();
+
+ long GetLastPos() const {return nLastPos;}
+ void SetLastPos(long nSet) {nLastPos = nSet;}
+
+ sal_Bool IsModified() const {return bModified;}
+ void SetModified(sal_Bool bSet) {bModified = bSet;}
+
+ void EnableControls(bool bEnable);
+
+ void GetCurrentText(String& rBase, String& rRuby);
+
+ void UpdateColors( void );
+protected:
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+public:
+
+ SvxRubyDialog(SfxBindings *pBindings, SfxChildWindow *pCW,
+ Window* pParent);
+ virtual ~SvxRubyDialog();
+
+ virtual void Activate();
+ virtual void Deactivate();
+};
+
+#endif // _SVX_RUBYDLG_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 000000000000..aa18893ec3cc
--- /dev/null
+++ b/include/svx/ruler.hxx
@@ -0,0 +1,259 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_RULER_HXX
+#define _SVX_RULER_HXX
+
+#include <vcl/menu.hxx>
+#include <svtools/ruler.hxx>
+#include <svl/lstner.hxx>
+#include "svx/svxdllapi.h"
+
+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;
+
+class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener
+{
+ friend class SvxRulerItem;
+ using Window::Notify;
+
+ SvxRulerItem **pCtrlItem;
+ SvxLongLRSpaceItem *pLRSpaceItem; // left and right edge
+ SfxRectangleItem *pMinMaxItem; // maxima for dragging
+ SvxLongULSpaceItem *pULSpaceItem; // upper and lower edge
+ SvxTabStopItem *pTabStopItem; // tab stops
+ SvxLRSpaceItem *pParaItem; // paragraphs
+ SvxLRSpaceItem *pParaBorderItem; // border distance
+ SvxPagePosSizeItem *pPagePosItem; // page distance to the rule
+ SvxColumnItem *pColumnItem; // columns
+ SvxObjectItem *pObjectItem; // object
+ Window *pEditWin;
+ SvxRuler_Impl *pRuler_Imp;
+ sal_Bool bAppSetNullOffset :1;
+ sal_Bool bHorz :1;
+ long lLogicNullOffset; // in logic coordinates
+ long lAppNullOffset; // in logic coordinates
+ long lMinFrame; // minimal frame width in pixels
+ long lInitialDragPos;
+ sal_uInt16 nFlags;
+ enum {
+ NONE = 0x0000,
+ DRAG_OBJECT = 0x0001,
+ // reduce size of the last column, shift
+ DRAG_OBJECT_SIZE_LINEAR = 0x0002,
+ DRAG_OBJECT_SIZE_PROPORTIONAL = 0x0004, // proportional, Ctrl
+ // only current line (table; Shift-Ctrl)
+ DRAG_OBJECT_ACTLINE_ONLY = 0x0008,
+ // currently same key assignment
+ DRAG_OBJECT_LEFT_INDENT_ONLY = DRAG_OBJECT_SIZE_PROPORTIONAL
+ }
+ nDragType;
+ sal_uInt16 nDefTabType;
+ sal_uInt16 nTabCount;
+ sal_uInt16 nTabBufSize;
+ long lDefTabDist;
+ long lTabPos;
+ RulerTab *pTabs; // tab positions in pixel
+ RulerIndent *pIndents; // paragraph margins in pixel
+ RulerBorder *pBorders;
+ sal_uInt16 nBorderCount;
+ RulerBorder *pObjectBorders;
+ SfxBindings *pBindings;
+ long nDragOffset;
+ long nMaxLeft;
+ long nMaxRight;
+ sal_Bool bValid;
+ sal_Bool bListening;
+ sal_Bool bActive;
+ void StartListening_Impl();
+ long GetCorrectedDragPos( sal_Bool bLeft = sal_True, sal_Bool bRight = sal_True );
+ void DrawLine_Impl(long &lTabPos, int, sal_Bool Hori=sal_True);
+ sal_uInt16 GetObjectBordersOff(sal_uInt16 nIdx) const;
+
+ // page borders or surrounding frame
+ void UpdateFrame(const SvxLongLRSpaceItem *);
+ void UpdateFrame(const SvxLongULSpaceItem *);
+ void UpdateFrameMinMax(const SfxRectangleItem *);
+ // paragraph indentations
+ void UpdatePara(const SvxLRSpaceItem *);
+ // Border distance
+ void UpdateParaBorder(const SvxLRSpaceItem *);
+ // Tabs
+ void Update(const SvxTabStopItem *);
+ // page position and width
+ void Update(const SvxPagePosSizeItem *);
+ // columns
+ void Update(const SvxColumnItem *, sal_uInt16 nSID);
+ // object selection
+ void Update(const SvxObjectItem *);
+ // protect
+ void Update( const SvxProtectItem* );
+ // left-to-right text
+ void UpdateTextRTL( const SfxBoolItem* );
+ // paragraph indentations
+ void UpdatePara();
+ void UpdateTabs();
+ void UpdatePage();
+ void UpdateFrame();
+ void UpdateColumns();
+ void UpdateObject();
+
+ 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 GetFirstLineIndent() const;
+ long GetLeftIndent() const;
+ long GetRightIndent() const;
+ long GetLogicRightIndent() const;
+
+ inline 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;
+ void SetFrameLeft(long);
+
+ long GetLeftMin() const;
+ long GetRightMax() const;
+
+ DECL_LINK( TabMenuSelect, Menu * );
+ DECL_LINK( MenuSelect, Menu * );
+ void PrepareProportional_Impl(RulerType);
+
+ sal_uInt16 GetNextVisible(sal_uInt16 nColumn);
+ sal_uInt16 GetPrevVisible(sal_uInt16 nColumn);
+
+enum UpdateType {
+ MOVE_ALL,
+ MOVE_LEFT,
+ MOVE_RIGHT
+ };
+ void UpdateParaContents_Impl(long lDiff, UpdateType = MOVE_ALL);
+
+protected:
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Click();
+ virtual long StartDrag();
+ virtual void Drag();
+ virtual void EndDrag();
+ virtual void ExtraDown();
+ virtual void MouseMove( const MouseEvent& rMEvt );
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+ virtual void Update();
+
+ // calculation of boundary values for object borders
+ // values refer to the page
+ virtual sal_Bool CalcLimits(long &nMax1, long &nMax2, sal_Bool bFirst) const;
+ sal_Bool IsActLastColumn(
+ sal_Bool bForceDontConsiderHidden = sal_False, sal_uInt16 nAct=USHRT_MAX) const ;
+ sal_Bool IsActFirstColumn(
+ sal_Bool bForceDontConsiderHidden = sal_False, sal_uInt16 nAct=USHRT_MAX) const;
+ sal_uInt16 GetActLeftColumn(
+ sal_Bool bForceDontConsiderHidden = sal_False, sal_uInt16 nAct=USHRT_MAX ) const;
+ sal_uInt16 GetActRightColumn (
+ sal_Bool bForceDontConsiderHidden = sal_False, sal_uInt16 nAct=USHRT_MAX ) const;
+ long CalcPropMaxRight(sal_uInt16 nCol=USHRT_MAX) const;
+ long GetPageWidth() const;
+
+public:
+#define SVXRULER_SUPPORT_TABS 0x0001
+#define SVXRULER_SUPPORT_PARAGRAPH_MARGINS 0x0002
+#define SVXRULER_SUPPORT_BORDERS 0x0004
+#define SVXRULER_SUPPORT_OBJECT 0x0008
+#define SVXRULER_SUPPORT_SET_NULLOFFSET 0x0010
+#define SVXRULER_SUPPORT_NEGATIVE_MARGINS 0x0020
+#define SVXRULER_SUPPORT_PARAGRAPH_MARGINS_VERTICAL 0x0040
+#define SVXRULER_SUPPORT_REDUCED_METRIC 0x0080 //shorten the context menu to select metric
+
+ SvxRuler(Window* pParent,
+ Window *pEditWin,
+ sal_uInt16 nRulerFlags,
+ SfxBindings &rBindings,
+ WinBits nWinStyle = WB_STDRULER);
+ ~SvxRuler();
+
+ void SetMinFrameSize(long lSize);
+ long GetMinFrameSize() const ;
+
+ sal_uInt16 GetRulerFlags() const { return nFlags; }
+
+ void SetDefTabDist(long);
+
+ // set/get NullOffset in logic units
+ void SetNullOffsetLogic(long lOff = 0);
+ long GetNullOffsetLogic() const { return lAppNullOffset; }
+
+ void SetActive(sal_Bool bOn = sal_True);
+ sal_Bool IsActive() const { return bActive; }
+
+ void ForceUpdate() { Update(); }
+
+ //#i24363# tab stops relative to indent
+ void SetTabsRelativeToIndent( sal_Bool bRel = sal_True );
+};
+
+#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 000000000000..545edb4cda85
--- /dev/null
+++ b/include/svx/rulritem.hxx
@@ -0,0 +1,278 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_RULRITEM_HXX
+#define _SVX_RULRITEM_HXX
+
+#include <tools/gen.hxx>
+#include <svl/poolitem.hxx>
+#include "svx/svxdllapi.h"
+#include <vector>
+
+class SVX_DLLPUBLIC SvxLongLRSpaceItem : public SfxPoolItem
+{
+ long lLeft; // nLeft or the negativ first-line indentation
+ long lRight; // the unproblematic right edge
+
+ protected:
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual String GetValueText() const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+private:
+ SVX_DLLPRIVATE const SvxLongLRSpaceItem& operator=(const SvxLongLRSpaceItem &); // n.i.
+
+public:
+ TYPEINFO();
+ SvxLongLRSpaceItem(long lLeft, long lRight, sal_uInt16 nId);
+ SvxLongLRSpaceItem(const SvxLongLRSpaceItem &);
+ SvxLongLRSpaceItem();
+
+ long GetLeft() const { return lLeft; }
+ long GetRight() const { return lRight; }
+ void SetLeft(long lArgLeft) {lLeft=lArgLeft;}
+ void SetRight(long lArgRight) {lRight=lArgRight;}
+};
+
+class SVX_DLLPUBLIC SvxLongULSpaceItem : public SfxPoolItem
+{
+ long lLeft; // nLeft or the negative first-line indentation
+ long lRight; // the unproblematic right edge
+
+ protected:
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual String GetValueText() const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+private:
+ SVX_DLLPRIVATE const SvxLongULSpaceItem& operator=(const SvxLongULSpaceItem &); // n.i.
+
+public:
+ TYPEINFO();
+ SvxLongULSpaceItem(long lUpper, long lLower, sal_uInt16 nId);
+ SvxLongULSpaceItem(const SvxLongULSpaceItem &);
+ SvxLongULSpaceItem();
+
+ long GetUpper() const { return lLeft; }
+ long GetLower() const { return lRight; }
+ void SetUpper(long lArgLeft) {lLeft=lArgLeft;}
+ void SetLower(long lArgRight) {lRight=lArgRight;}
+};
+
+class SVX_DLLPUBLIC SvxPagePosSizeItem : public SfxPoolItem
+{
+ Point aPos;
+ long lWidth;
+ long lHeight;
+protected:
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual String GetValueText() const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+
+private:
+ SVX_DLLPRIVATE const SvxPagePosSizeItem& operator=(const SvxPagePosSizeItem &); // n.i.
+public:
+ TYPEINFO();
+ SvxPagePosSizeItem(const Point &rPos, long lWidth, long lHeight);
+ SvxPagePosSizeItem(const SvxPagePosSizeItem &);
+ SvxPagePosSizeItem();
+
+ const Point &GetPos() const { return aPos; }
+ long GetWidth() const { return lWidth; }
+ long GetHeight() const { return lHeight; }
+};
+
+struct SvxColumnDescription
+{
+ long nStart; /* Start of the column */
+ long nEnd; /* End of the column */
+ sal_Bool bVisible; /* Visibility */
+
+ long nEndMin; //min. possible position of end
+ long nEndMax; //max. possible position of end
+
+ SvxColumnDescription():
+ nStart(0), nEnd(0), bVisible(sal_True), nEndMin(0), nEndMax(0) {}
+
+ SvxColumnDescription(const SvxColumnDescription &rCopy) :
+ nStart(rCopy.nStart), nEnd(rCopy.nEnd),
+ bVisible(rCopy.bVisible),
+ nEndMin(rCopy.nEndMin), nEndMax(rCopy.nEndMax)
+ {}
+
+ SvxColumnDescription(long start, long end, sal_Bool bVis = sal_True):
+ nStart(start), nEnd(end),
+ bVisible(bVis),
+ nEndMin(0), nEndMax(0) {}
+
+ SvxColumnDescription(long start, long end,
+ long endMin, long endMax, sal_Bool bVis = sal_True):
+ nStart(start), nEnd(end),
+ bVisible(bVis),
+ nEndMin(endMin), nEndMax(endMax)
+ {}
+
+ int operator==(const SvxColumnDescription &rCmp) const {
+ return nStart == rCmp.nStart &&
+ bVisible == rCmp.bVisible &&
+ nEnd == rCmp.nEnd &&
+ nEndMin == rCmp.nEndMin &&
+ nEndMax == rCmp.nEndMax;
+ }
+ int operator!=(const SvxColumnDescription &rCmp) const {
+ return !operator==(rCmp);
+ }
+ long GetWidth() const { return nEnd - nStart; }
+};
+
+class SVX_DLLPUBLIC SvxColumnItem : public SfxPoolItem
+{
+ std::vector<SvxColumnDescription> aColumns;// Column array
+ long nLeft, // Left edge for the table
+ nRight; // Right edge for the table; for columns always
+ // equal to the surrounding frame
+ sal_uInt16 nActColumn; // the current column
+ sal_uInt8 bTable; // table?
+ sal_uInt8 bOrtho; // evenly spread columns
+
+protected:
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual String GetValueText() const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+public:
+ TYPEINFO();
+ // right edge of the surrounding frame
+ // nLeft, nRight each the distance to the surrounding frame
+ SvxColumnItem(sal_uInt16 nAct = 0); // columns
+ SvxColumnItem(sal_uInt16 nActCol,
+ sal_uInt16 nLeft, sal_uInt16 nRight = 0); // Table with borders
+ SvxColumnItem(const SvxColumnItem &);
+ ~SvxColumnItem();
+
+ const SvxColumnItem &operator=(const SvxColumnItem &);
+
+ sal_uInt16 Count() const { return aColumns.size(); }
+ SvxColumnDescription &operator[](sal_uInt16 i)
+ { return aColumns[i]; }
+ const SvxColumnDescription &operator[](sal_uInt16 i) const
+ { return aColumns[i]; }
+ void Insert(const SvxColumnDescription &rDesc, sal_uInt16 nPos) {
+ aColumns.insert(aColumns.begin() + nPos, rDesc);
+ }
+ void Append(const SvxColumnDescription &rDesc) { Insert(rDesc, Count()); }
+ void SetLeft(long left) { nLeft = left; }
+ void SetRight(long right) { nRight = right; }
+ void SetActColumn(sal_uInt16 nCol) { nActColumn = nCol; }
+
+ sal_uInt16 GetActColumn() const { return nActColumn; }
+ sal_Bool IsFirstAct() const { return nActColumn == 0; }
+ sal_Bool IsLastAct() const { return nActColumn == Count()-1; }
+ long GetLeft() { return nLeft; }
+ long GetRight() { return nRight; }
+
+ sal_Bool IsTable() const { return bTable; }
+
+ sal_Bool CalcOrtho() const;
+ void SetOrtho(sal_Bool bVal) { bOrtho = bVal; }
+ sal_Bool IsOrtho () const { return sal_False ; }
+
+ sal_Bool IsConsistent() const { return nActColumn < aColumns.size(); }
+};
+
+// class SvxObjectItem ---------------------------------------------------
+
+class SVX_DLLPUBLIC SvxObjectItem : public SfxPoolItem
+{
+private:
+ long nStartX; /* Start in x direction */
+ long nEndX; /* End in x direction */
+ long nStartY; /* Start in y direction */
+ long nEndY; /* Ende in y direction */
+ sal_Bool bLimits; /* boundary limit control by the application */
+protected:
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual String GetValueText() const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+private:
+ SVX_DLLPRIVATE const SvxObjectItem &operator=(const SvxObjectItem &); // n.i.
+public:
+ TYPEINFO();
+ SvxObjectItem(long nStartX, long nEndX,
+ long nStartY, long nEndY,
+ sal_Bool bLimits = sal_False);
+ SvxObjectItem(const SvxObjectItem &);
+
+ sal_Bool HasLimits() const { return bLimits; }
+
+ long GetStartX() const { return nStartX; }
+ long GetEndX() const { return nEndX; }
+ long GetStartY() const { return nStartY; }
+ long GetEndY() const { return nEndY; }
+
+ void SetStartX(long l) { nStartX = l; }
+ void SetEndX(long l) { nEndX = l; }
+ void SetStartY(long l) { nStartY = l; }
+ void SetEndY(long l) { nEndY = l; }
+};
+
+
+#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 000000000000..c2e9f7776b83
--- /dev/null
+++ b/include/svx/scene3d.hxx
@@ -0,0 +1,239 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _E3D_SCENE3D_HXX
+#define _E3D_SCENE3D_HXX
+
+#include <svx/camera3d.hxx>
+#include <tools/b3dtrans.hxx>
+#include <svx/svxdllapi.h>
+#include <svx/obj3d.hxx>
+
+namespace sdr { namespace properties {
+ class BaseProperties;
+ class E3dSceneProperties;
+}}
+
+namespace drawinglayer { namespace geometry {
+ class ViewInformation3D;
+}}
+
+/*************************************************************************
+|*
+|* GeoData relevant for undo actions
+|*
+\************************************************************************/
+
+class E3DSceneGeoData : public E3DObjGeoData
+{
+public:
+ Camera3D aCamera;
+
+ E3DSceneGeoData() {}
+};
+
+class Imp3DDepthRemapper;
+
+/*************************************************************************
+|*
+|* base class for 3D scenes
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC E3dScene : public E3dObject
+{
+private:
+ // to allow sdr::properties::E3dSceneProperties access to StructureChanged()
+ friend class sdr::properties::E3dSceneProperties;
+
+protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
+ // transformations
+ B3dCamera aCameraSet;
+ Camera3D aCamera;
+
+ Imp3DDepthRemapper* mp3DDepthRemapper;
+
+ // Flag to determine if only selected objects should be drawn
+ unsigned bDrawOnlySelected : 1;
+
+ virtual void NewObjectInserted(const E3dObject* p3DObj);
+ virtual void StructureChanged();
+
+ void RebuildLists();
+
+ virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint);
+
+protected:
+ void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+
+ void ImpCleanup3DDepthMapper();
+
+public:
+ TYPEINFO();
+ E3dScene();
+ E3dScene(E3dDefaultAttributes& rDefault);
+ virtual ~E3dScene();
+
+ virtual void SetBoundRectDirty();
+
+ // access to cleanup of depth mapper
+ void Cleanup3DDepthMapper() { ImpCleanup3DDepthMapper(); }
+
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+
+ sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const;
+
+ // Perspective: enum ProjectionType { PR_PARALLEL, PR_PERSPECTIVE }
+ ProjectionType GetPerspective() const
+ { return (ProjectionType)((const Svx3DPerspectiveItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_PERSPECTIVE)).GetValue(); }
+
+ // Distance:
+ double GetDistance() const
+ { return (double)((const Svx3DDistanceItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_DISTANCE)).GetValue(); }
+
+ // Focal length: before cm, now 1/10th mm (*100)
+ double GetFocalLength() const
+ { return ((const Svx3DFocalLengthItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue(); }
+
+ // Two sided lighting:
+ sal_Bool GetTwoSidedLighting() const
+ { return ((const Svx3DTwoSidedLightingItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue(); }
+
+ // Lightcolor:
+ Color GetLightColor1() const
+ { return ((const Svx3DLightcolor1Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue(); }
+ Color GetLightColor2() const
+ { return ((const Svx3DLightcolor2Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue(); }
+ Color GetLightColor3() const
+ { return ((const Svx3DLightcolor3Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue(); }
+ Color GetLightColor4() const
+ { return ((const Svx3DLightcolor4Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue(); }
+ Color GetLightColor5() const
+ { return ((const Svx3DLightcolor5Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue(); }
+ Color GetLightColor6() const
+ { return ((const Svx3DLightcolor6Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue(); }
+ Color GetLightColor7() const
+ { return ((const Svx3DLightcolor7Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue(); }
+ Color GetLightColor8() const
+ { return ((const Svx3DLightcolor8Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue(); }
+
+ // Ambient color:
+ Color GetGlobalAmbientColor() const
+ { return ((const Svx3DAmbientcolorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue(); }
+
+ // Light on/off:
+ sal_Bool GetLightOnOff1() const
+ { return ((const Svx3DLightOnOff1Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue(); }
+ sal_Bool GetLightOnOff2() const
+ { return ((const Svx3DLightOnOff2Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue(); }
+ sal_Bool GetLightOnOff3() const
+ { return ((const Svx3DLightOnOff3Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue(); }
+ sal_Bool GetLightOnOff4() const
+ { return ((const Svx3DLightOnOff4Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue(); }
+ sal_Bool GetLightOnOff5() const
+ { return ((const Svx3DLightOnOff5Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue(); }
+ sal_Bool GetLightOnOff6() const
+ { return ((const Svx3DLightOnOff6Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue(); }
+ sal_Bool GetLightOnOff7() const
+ { return ((const Svx3DLightOnOff7Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue(); }
+ sal_Bool GetLightOnOff8() const
+ { return ((const Svx3DLightOnOff8Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue(); }
+
+ // Light direction:
+ basegfx::B3DVector GetLightDirection1() const
+ { return ((const Svx3DLightDirection1Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue(); }
+ basegfx::B3DVector GetLightDirection2() const
+ { return ((const Svx3DLightDirection2Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue(); }
+ basegfx::B3DVector GetLightDirection3() const
+ { return ((const Svx3DLightDirection3Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue(); }
+ basegfx::B3DVector GetLightDirection4() const
+ { return ((const Svx3DLightDirection4Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue(); }
+ basegfx::B3DVector GetLightDirection5() const
+ { return ((const Svx3DLightDirection5Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue(); }
+ basegfx::B3DVector GetLightDirection6() const
+ { return ((const Svx3DLightDirection6Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue(); }
+ basegfx::B3DVector GetLightDirection7() const
+ { return ((const Svx3DLightDirection7Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue(); }
+ basegfx::B3DVector GetLightDirection8() const
+ { return ((const Svx3DLightDirection8Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue(); }
+
+ // ShadowSlant:
+ sal_uInt16 GetShadowSlant() const
+ { return ((const Svx3DShadowSlantItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_SHADOW_SLANT)).GetValue(); }
+
+ // ShadeMode: 0 == FLAT, 1 == PHONG, 2 == SMOOTH, 3 == ForceDraft
+ sal_uInt16 GetShadeMode() const
+ { return ((const Svx3DShadeModeItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_SHADE_MODE)).GetValue(); }
+
+ // set flag to draw only selected
+ void SetDrawOnlySelected(sal_Bool bNew) { bDrawOnlySelected = bNew; }
+ bool GetDrawOnlySelected() const { return bDrawOnlySelected; }
+ virtual sal_uInt16 GetObjIdentifier() const;
+
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+ virtual void NbcMove(const Size& rSize);
+ virtual void NbcResize(const Point& rRef, const Fraction& rXFact,
+ const Fraction& rYFact);
+ virtual void RecalcSnapRect();
+
+ virtual E3dScene* GetScene() const;
+ void SetCamera(const Camera3D& rNewCamera);
+ const Camera3D& GetCamera() const { return aCamera; }
+ void removeAllNonSelectedObjects();
+
+ virtual E3dScene* Clone() const;
+ E3dScene& operator=(const E3dScene&);
+
+ virtual SdrObjGeoData *NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+
+ virtual void NbcSetTransform(const basegfx::B3DHomMatrix& rMatrix);
+ virtual void SetTransform(const basegfx::B3DHomMatrix& rMatrix);
+
+ virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
+ void RotateScene(const Point& rRef, long nWink, double sn, double cs);
+
+ // TakeObjName...() is for the display in the UI, for example "3 frames selected".
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ // get transformations
+ B3dCamera& GetCameraSet() { return aCameraSet; }
+
+ // break up
+ virtual bool IsBreakObjPossible();
+
+ // polygon which is built during creation
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+
+ // create moves
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat); // true=Xor muss repainted werden
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+ virtual void BrkCreate(SdrDragStat& rStat);
+};
+
+#endif // _E3D_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 000000000000..1b5435067332
--- /dev/null
+++ b/include/svx/sdangitm.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 _SDANGITM_HXX
+#define _SDANGITM_HXX
+
+#include <svl/intitem.hxx>
+#include "svx/svxdllapi.h"
+
+
+//------------------------------------------------------------
+// class SdrAngleItem
+//------------------------------------------------------------
+class SVX_DLLPUBLIC SdrAngleItem: public SfxInt32Item {
+public:
+ TYPEINFO();
+ SdrAngleItem(): SfxInt32Item() {}
+ SdrAngleItem(sal_uInt16 nId, sal_Int32 nAngle=0): SfxInt32Item(nId,nAngle) {}
+ SdrAngleItem(sal_uInt16 nId, SvStream& rIn): SfxInt32Item(nId,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString& rText,
+ const IntlWrapper *
+ pIntlWrapper = 0) const;
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdasaitm.hxx b/include/svx/sdasaitm.hxx
new file mode 100644
index 000000000000..67e97fb0c454
--- /dev/null
+++ b/include/svx/sdasaitm.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 _SDASAITM_HXX
+#define _SDASAITM_HXX
+
+#include <vector>
+
+#include <svl/poolitem.hxx>
+
+class SdrCustomShapeAdjustmentValue
+{
+ sal_uInt32 nValue;
+
+ friend class SdrCustomShapeAdjustmentItem;
+
+ public :
+
+ void SetValue( sal_Int32 nVal ) { nValue = nVal; };
+ sal_Int32 GetValue() const { return nValue; };
+
+};
+
+class SdrCustomShapeAdjustmentItem : public SfxPoolItem
+{
+ std::vector<SdrCustomShapeAdjustmentValue> aAdjustmentValueList;
+
+ public :
+
+ TYPEINFO();
+ SVX_DLLPUBLIC SdrCustomShapeAdjustmentItem();
+ SdrCustomShapeAdjustmentItem( SvStream& rIn, sal_uInt16 nVersion );
+ SVX_DLLPUBLIC ~SdrCustomShapeAdjustmentItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation,
+ SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric,
+ OUString &rText, const IntlWrapper * = 0) const;
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItem ) const;
+ virtual SvStream& Store( SvStream&, sal_uInt16 nVersion ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ sal_uInt32 GetCount() const { return aAdjustmentValueList.size(); };
+ SVX_DLLPUBLIC const SdrCustomShapeAdjustmentValue& GetValue( sal_uInt32 nIndex ) const;
+ SVX_DLLPUBLIC void SetValue( sal_uInt32 nIndex,
+ const SdrCustomShapeAdjustmentValue& rVal );
+};
+
+#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 000000000000..e54bf1f654e2
--- /dev/null
+++ b/include/svx/sdasitm.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 _SDASITM_HXX
+#define _SDASITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdooitm.hxx>
+#include <svl/stritem.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/uno/Any.hxx>
+#include <rtl/ustring.hxx>
+#include <boost/unordered_map.hpp>
+#include <map>
+#include "svx/svxdllapi.h"
+
+class SdrCustomShapeEngineItem : public SfxStringItem
+{
+ public :
+ SdrCustomShapeEngineItem();
+};
+
+class SdrCustomShapeDataItem : public SfxStringItem
+{
+ public :
+ SdrCustomShapeDataItem();
+};
+
+class SVX_DLLPUBLIC SdrCustomShapeGeometryItem : public SfxPoolItem
+{
+public:
+ typedef std::pair < const OUString, const OUString > PropertyPair;
+
+private:
+ struct SVX_DLLPUBLIC PropertyEq
+ {
+ bool operator()( const OUString&, const OUString& ) const;
+ };
+ struct SVX_DLLPUBLIC PropertyPairEq
+ {
+ bool operator()( const SdrCustomShapeGeometryItem::PropertyPair&, const SdrCustomShapeGeometryItem::PropertyPair& ) const;
+ };
+ struct SVX_DLLPUBLIC PropertyPairHash
+ {
+ size_t operator()( const SdrCustomShapeGeometryItem::PropertyPair& ) const;
+ };
+ typedef boost::unordered_map < PropertyPair, sal_Int32, PropertyPairHash, PropertyPairEq > PropertyPairHashMap;
+ typedef boost::unordered_map< OUString, sal_Int32, OUStringHash, PropertyEq > PropertyHashMap;
+
+ PropertyHashMap aPropHashMap;
+ PropertyPairHashMap aPropPairHashMap;
+
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aPropSeq;
+
+ public :
+
+ TYPEINFO();
+
+ SdrCustomShapeGeometryItem();
+ SdrCustomShapeGeometryItem( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
+ SdrCustomShapeGeometryItem( SvStream& rIn, sal_uInt16 nVersion );
+ ~SdrCustomShapeGeometryItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation,
+ SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric,
+ OUString &rText, const IntlWrapper * = 0) const;
+
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItem ) const;
+ virtual SvStream& Store( SvStream&, sal_uInt16 nVersion ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& GetGeometry() const;
+
+ com::sun::star::uno::Any* GetPropertyValueByName( const OUString& rPropName );
+ com::sun::star::uno::Any* GetPropertyValueByName( const OUString& rPropName, const OUString& rPropName2 );
+
+ void SetPropertyValue( const com::sun::star::beans::PropertyValue& rPropVal );
+ void SetPropertyValue( const OUString& rSequenceName, const com::sun::star::beans::PropertyValue& rPropVal );
+
+ void ClearPropertyValue( const OUString& rPropertyName );
+};
+
+class SdrCustomShapeReplacementURLItem : public SfxStringItem
+{
+ public :
+ SdrCustomShapeReplacementURLItem();
+};
+
+//---------------------------
+// class SdrTextWordWrapItem
+//---------------------------
+class SdrTextWordWrapItem : public SdrOnOffItem {
+public:
+ SdrTextWordWrapItem( sal_Bool bAuto = sal_False ): SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, bAuto ) {}
+ SdrTextWordWrapItem( SvStream& rIn ) : SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, rIn ) {}
+};
+
+//-------------------------------
+// class SdrTextAutoGrowSizeItem
+//-------------------------------
+class SdrTextAutoGrowSizeItem : public SdrOnOffItem {
+public:
+ SdrTextAutoGrowSizeItem( sal_Bool bAuto = sal_False ): SdrOnOffItem( SDRATTR_TEXT_AUTOGROWSIZE, bAuto ) {}
+ SdrTextAutoGrowSizeItem( SvStream& rIn ) : SdrOnOffItem( SDRATTR_TEXT_AUTOGROWSIZE, rIn ) {}
+};
+
+#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 000000000000..61751bd3cad2
--- /dev/null
+++ b/include/svx/sderitm.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 _SDERITM_HXX
+#define _SDERITM_HXX
+
+#include <svx/sdmetitm.hxx>
+#include <svx/svddef.hxx>
+
+//------------------------------
+// class SdrEckenradiusItem
+//------------------------------
+class SdrEckenradiusItem: public SdrMetricItem {
+public:
+ SdrEckenradiusItem(long nRadius=0): SdrMetricItem(SDRATTR_ECKENRADIUS,nRadius) {}
+ SdrEckenradiusItem(SvStream& rIn) : SdrMetricItem(SDRATTR_ECKENRADIUS,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdgcoitm.hxx b/include/svx/sdgcoitm.hxx
new file mode 100644
index 000000000000..186c764d3d1b
--- /dev/null
+++ b/include/svx/sdgcoitm.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 _SDGCOITM_HXX
+#define _SDGCOITM_HXX
+
+#include <svx/sdprcitm.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+//-----------------
+// SdrGrafRedItem -
+//-----------------
+
+class SVX_DLLPUBLIC SdrGrafRedItem : public SdrSignedPercentItem
+{
+public:
+
+ TYPEINFO();
+
+ SdrGrafRedItem( short nRedPercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFRED, nRedPercent ) {}
+ SdrGrafRedItem( SvStream& rIn ) : SdrSignedPercentItem( SDRATTR_GRAFRED, rIn ) {}
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+};
+
+//-------------------
+// SdrGrafGreenItem -
+//-------------------
+
+class SVX_DLLPUBLIC SdrGrafGreenItem : public SdrSignedPercentItem
+{
+public:
+
+ TYPEINFO();
+
+ SdrGrafGreenItem( short nGreenPercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFGREEN, nGreenPercent ) {}
+ SdrGrafGreenItem( SvStream& rIn ) : SdrSignedPercentItem( SDRATTR_GRAFGREEN, rIn ) {}
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+};
+
+//-------------------
+// SdrGrafBlueItem -
+//-------------------
+
+class SVX_DLLPUBLIC SdrGrafBlueItem : public SdrSignedPercentItem
+{
+public:
+
+ TYPEINFO();
+
+ SdrGrafBlueItem( short nBluePercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFBLUE, nBluePercent ) {}
+ SdrGrafBlueItem( SvStream& rIn ) : SdrSignedPercentItem( SDRATTR_GRAFBLUE, rIn ) {}
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+};
+
+#endif // _SDGCOITM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdgcpitm.hxx b/include/svx/sdgcpitm.hxx
new file mode 100644
index 000000000000..48eea4733624
--- /dev/null
+++ b/include/svx/sdgcpitm.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 _SDGCPITM_HXX
+#define _SDGCPITM_HXX
+
+#include <svx/grfcrop.hxx>
+#include <svx/svddef.hxx>
+
+//------------------
+// SdrGrafCropItem -
+//------------------
+
+class SVX_DLLPUBLIC SdrGrafCropItem : public SvxGrfCrop
+{
+public:
+
+ TYPEINFO();
+
+ SdrGrafCropItem( sal_Int32 nLeftCrop = 0, sal_Int32 nTopCrop = 0,
+ sal_Int32 nRightCrop = 0, sal_Int32 nBottomCrop = 0,
+ sal_uInt16 nWhichId = SDRATTR_GRAFCROP ) :
+ SvxGrfCrop( nLeftCrop, nRightCrop, nTopCrop, nBottomCrop, nWhichId ) {}
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+};
+
+#endif // _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 000000000000..d7c44fe0918e
--- /dev/null
+++ b/include/svx/sdggaitm.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 _SDGGAITM_HXX
+#define _SDGGAITM_HXX
+
+#include <svl/intitem.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+//----------------------
+// SdrGrafGamma100Item -
+//----------------------
+
+class SVX_DLLPUBLIC SdrGrafGamma100Item : public SfxUInt32Item
+{
+public:
+
+ TYPEINFO();
+
+ SdrGrafGamma100Item( sal_uIntPtr nGamma100 = 100 ) : SfxUInt32Item( SDRATTR_GRAFGAMMA, nGamma100 ) {}
+ SdrGrafGamma100Item( SvStream& rIn ) : SfxUInt32Item( SDRATTR_GRAFGAMMA, rIn ) {}
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+#endif // _SDGGAITM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdginitm.hxx b/include/svx/sdginitm.hxx
new file mode 100644
index 000000000000..5b17ddef807d
--- /dev/null
+++ b/include/svx/sdginitm.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 _SDGINITM_HXX
+#define _SDGINITM_HXX
+
+#include <svx/sdooitm.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+//--------------------
+// SdrGrafInvertItem -
+//--------------------
+
+class SVX_DLLPUBLIC SdrGrafInvertItem : public SdrOnOffItem
+{
+public:
+
+ TYPEINFO();
+
+ SdrGrafInvertItem( sal_Bool bInvert = sal_False ) : SdrOnOffItem( SDRATTR_GRAFINVERT, bInvert ) {}
+ SdrGrafInvertItem( SvStream& rIn ) : SdrOnOffItem( SDRATTR_GRAFINVERT, rIn ) {}
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+};
+
+#endif // _SDGINITM_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 000000000000..2f2b21a83842
--- /dev/null
+++ b/include/svx/sdgluitm.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 _SDGLUITM_HXX
+#define _SDGLUITM_HXX
+
+#include <svx/sdprcitm.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+//-----------------------
+// SdrGrafLuminanceItem -
+//-----------------------
+
+class SVX_DLLPUBLIC SdrGrafLuminanceItem : public SdrSignedPercentItem
+{
+public:
+
+ TYPEINFO();
+
+ SdrGrafLuminanceItem( short nLuminancePercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFLUMINANCE, nLuminancePercent ) {}
+ SdrGrafLuminanceItem( SvStream& rIn ) : SdrSignedPercentItem( SDRATTR_GRAFLUMINANCE, rIn ) {}
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+};
+
+//----------------------
+// SdrGrafContrastItem -
+//----------------------
+
+class SVX_DLLPUBLIC SdrGrafContrastItem : public SdrSignedPercentItem
+{
+public:
+
+ TYPEINFO();
+
+ SdrGrafContrastItem( short nContrastPercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFCONTRAST, nContrastPercent ) {}
+ SdrGrafContrastItem( SvStream& rIn ) : SdrSignedPercentItem( SDRATTR_GRAFCONTRAST, rIn ) {}
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+};
+
+#endif // _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 000000000000..b97178357244
--- /dev/null
+++ b/include/svx/sdgmoitm.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 _SDGMOITM_HXX
+#define _SDGMOITM_HXX
+
+#include <svtools/grfmgr.hxx>
+#include <svl/eitem.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+//------------------
+// SdrGrafModeItem -
+//------------------
+
+class SVX_DLLPUBLIC SdrGrafModeItem : public SfxEnumItem
+{
+public:
+
+ TYPEINFO();
+
+ SdrGrafModeItem( GraphicDrawMode eMode = GRAPHICDRAWMODE_STANDARD ) : SfxEnumItem( SDRATTR_GRAFMODE, (sal_uInt16)eMode ) {}
+ SdrGrafModeItem( SvStream& rIn ) : SfxEnumItem( SDRATTR_GRAFMODE, rIn ) {}
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+ virtual sal_uInt16 GetValueCount() const;
+ GraphicDrawMode GetValue() const { return (GraphicDrawMode) SfxEnumItem::GetValue(); }
+
+ virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString& rText, const IntlWrapper * = 0) const;
+
+};
+
+#endif // _SDGMOITM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdgtritm.hxx b/include/svx/sdgtritm.hxx
new file mode 100644
index 000000000000..f09d5abbcba0
--- /dev/null
+++ b/include/svx/sdgtritm.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 _SDGTRITM_HXX
+#define _SDGTRITM_HXX
+
+#include <svx/sdprcitm.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+//--------------------------
+// SdrGrafTransparenceItem -
+//--------------------------
+
+class SVX_DLLPUBLIC SdrGrafTransparenceItem : public SdrPercentItem
+{
+public:
+
+ TYPEINFO();
+ SdrGrafTransparenceItem( sal_uInt16 nTransparencePercent = 0 ) : SdrPercentItem( SDRATTR_GRAFTRANSPARENCE, nTransparencePercent ) {}
+ SdrGrafTransparenceItem( SvStream& rIn ) : SdrPercentItem( SDRATTR_GRAFTRANSPARENCE, rIn ) {}
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+};
+
+#endif // _SDGTRITM_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 000000000000..9045dc91916d
--- /dev/null
+++ b/include/svx/sdmetitm.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 _SDMETITM_HXX
+#define _SDMETITM_HXX
+
+#include <svl/intitem.hxx>
+#include "svx/svxdllapi.h"
+
+
+//------------------------------------------------------------
+// class SdrAngleItem
+// For all metrics. GetPresentation returns for example for
+// Value=2500 a "25mm".
+//------------------------------------------------------------
+class SVX_DLLPUBLIC SdrMetricItem: public SfxInt32Item {
+public:
+ TYPEINFO();
+ SdrMetricItem(): SfxInt32Item() {}
+ SdrMetricItem(sal_uInt16 nId, sal_Int32 nVal=0): SfxInt32Item(nId,nVal) {}
+ SdrMetricItem(sal_uInt16 nId, SvStream& rIn): SfxInt32Item(nId,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual bool HasMetrics() const;
+ virtual bool ScaleMetrics(long nMul, long nDiv);
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString& rText, const IntlWrapper * = 0) const;
+};
+
+
+#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 000000000000..ff6a1f9b0bfa
--- /dev/null
+++ b/include/svx/sdooitm.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 _SDOOITM_HXX
+#define _SDOOITM_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+
+//------------------------------------------------------------
+// class SdrOnOffItem
+// here GetValueTextByVal() returns "an" or "aus" instead
+// of "TRUE" or "FALSE"
+//------------------------------------------------------------
+class SVX_DLLPUBLIC SdrOnOffItem: public SfxBoolItem {
+public:
+ TYPEINFO();
+ SdrOnOffItem(): SfxBoolItem() {}
+ SdrOnOffItem(sal_uInt16 nId, sal_Bool bOn=sal_False): SfxBoolItem(nId,bOn) {}
+ SdrOnOffItem(sal_uInt16 nId, SvStream& rIn): SfxBoolItem(nId,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual OUString GetValueTextByVal(sal_Bool bVal) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+
+#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 000000000000..7e01de417185
--- /dev/null
+++ b/include/svx/sdprcitm.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 _SDPRCITM_HXX
+#define _SDPRCITM_HXX
+
+#include <svl/intitem.hxx>
+#include "svx/svxdllapi.h"
+
+
+//------------------------------------------------------------
+// class SdrPercentItem
+// Integer percents of 0
+//------------------------------------------------------------
+
+class SVX_DLLPUBLIC SdrPercentItem : public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+ SdrPercentItem(): SfxUInt16Item() {}
+ SdrPercentItem(sal_uInt16 nId, sal_uInt16 nVal=0): SfxUInt16Item(nId,nVal) {}
+ SdrPercentItem(sal_uInt16 nId, SvStream& rIn): SfxUInt16Item(nId,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+//------------------------------------------------------------
+// class SdrSignedPercentItem
+// Integer percents of +/-
+//------------------------------------------------------------
+
+class SVX_DLLPUBLIC SdrSignedPercentItem : public SfxInt16Item
+{
+public:
+ TYPEINFO();
+ SdrSignedPercentItem(): SfxInt16Item() {}
+ SdrSignedPercentItem( sal_uInt16 nId, sal_Int16 nVal = 0 ) : SfxInt16Item( nId,nVal ) {}
+ SdrSignedPercentItem( sal_uInt16 nId, SvStream& rIn ) : SfxInt16Item( nId,rIn ) {}
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0 ) const;
+};
+
+
+#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 000000000000..39fcf8ae04f1
--- /dev/null
+++ b/include/svx/sdr/animation/animationstate.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 _SDR_ANIMATION_ANIMATIONSTATE_HXX
+#define _SDR_ANIMATION_ANIMATIONSTATE_HXX
+
+#include <sal/types.h>
+#include <vector>
+#include <svx/sdr/animation/scheduler.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewObjectContact;
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace animation
+ {
+ class PrimitiveAnimation : public Event
+ {
+ protected:
+ // the animated VOC
+ sdr::contact::ViewObjectContact& mrVOContact;
+
+ // the vetor of animated primitives
+ drawinglayer::primitive2d::Primitive2DSequence maAnimatedPrimitives;
+
+ // local helpers
+ double getSmallestNextTime(double fCurrentTime);
+ void prepareNextEvent();
+
+ public:
+ // basic constructor.
+ PrimitiveAnimation(sdr::contact::ViewObjectContact& rVOContact, const drawinglayer::primitive2d::Primitive2DSequence& rAnimatedPrimitives);
+
+ // destructor
+ virtual ~PrimitiveAnimation();
+
+ // execute event, from base class Event
+ virtual void Trigger(sal_uInt32 nTime);
+ };
+ } // end of namespace animation
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..0c59afee92f5
--- /dev/null
+++ b/include/svx/sdr/animation/objectanimator.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 _SDR_ANIMATION_OBJECTANIMATOR_HXX
+#define _SDR_ANIMATION_OBJECTANIMATOR_HXX
+
+#include <sal/types.h>
+#include <vector>
+#include <vcl/timer.hxx>
+#include <svx/sdr/animation/scheduler.hxx>
+#include <svx/sdr/animation/animationstate.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace animation
+ {
+ class primitiveAnimator : public Scheduler
+ {
+ public:
+ // basic constructor and destructor
+ primitiveAnimator();
+ SVX_DLLPUBLIC virtual ~primitiveAnimator();
+ };
+ } // end of namespace animation
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..a2681b740eb1
--- /dev/null
+++ b/include/svx/sdr/animation/scheduler.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 _SDR_ANIMATION_SCHEDULER_HXX
+#define _SDR_ANIMATION_SCHEDULER_HXX
+
+#include <sal/types.h>
+#include <vcl/timer.hxx>
+#include <svx/svxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// event class
+
+namespace sdr
+{
+ namespace animation
+ {
+ class Event
+ {
+ // time of event in ms
+ sal_uInt32 mnTime;
+
+ // pointer for simply linked list
+ Event* mpNext;
+
+ public:
+ // constructor/destructor
+ explicit Event(sal_uInt32 nTime);
+ SVX_DLLPUBLIC virtual ~Event();
+
+ // access to mpNext
+ Event* GetNext() const;
+ void SetNext(Event* pNew);
+
+ // get/set time
+ sal_uInt32 GetTime() const;
+ void SVX_DLLPUBLIC SetTime(sal_uInt32 nNew);
+
+ // execute event
+ virtual void Trigger(sal_uInt32 nTime) = 0;
+ };
+ } // end of namespace animation
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+// eventlist class
+
+namespace sdr
+{
+ namespace animation
+ {
+ class EventList
+ {
+ // pointer to first entry
+ Event* mpHead;
+
+ public:
+ // constructor/destructor
+ EventList();
+ SVX_DLLPUBLIC virtual ~EventList();
+
+ // insert/remove time dependent
+ void Insert(Event* pNew);
+ void Remove(Event* pOld);
+
+ // clear list
+ void Clear();
+
+ // get first
+ Event* GetFirst();
+ };
+ } // end of namespace animation
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+// scheduler class
+
+namespace sdr
+{
+ namespace animation
+ {
+ class Scheduler : public Timer
+ {
+ // time in ms
+ sal_uInt32 mnTime;
+
+ // next delta time
+ sal_uInt32 mnDeltaTime;
+
+ // list of events
+ EventList maList;
+
+ // Flag which remembers if this timer is paused. Default
+ // is false.
+ bool mbIsPaused;
+
+ public:
+ // constructor/destructor
+ Scheduler();
+ SVX_DLLPUBLIC virtual ~Scheduler();
+
+ // From baseclass Timer, the timeout call
+ SVX_DLLPUBLIC virtual void Timeout();
+
+ // get time
+ sal_uInt32 GetTime();
+
+ // #i38135#
+ void SetTime(sal_uInt32 nTime);
+
+ // execute all ripe events, removes executed ones from the scheduler
+ void triggerEvents();
+
+ // re-start or stop timer according to event list
+ void checkTimeout();
+
+ // insert/remove events, wrapper to EventList methods
+ void SVX_DLLPUBLIC InsertEvent(Event* pNew);
+ void RemoveEvent(Event* pOld);
+
+ // get/set pause
+ bool IsPaused() const { return mbIsPaused; }
+ void SetPaused(bool bNew);
+ };
+ } // end of namespace animation
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_ANIMATION_SCHEDULER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/attribute/sdrfilltextattribute.hxx b/include/svx/sdr/attribute/sdrfilltextattribute.hxx
new file mode 100644
index 000000000000..f64bac542a76
--- /dev/null
+++ b/include/svx/sdr/attribute/sdrfilltextattribute.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 _SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+#include <svx/sdr/attribute/sdrtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrFillTextAttribute
+ {
+ // shadow and text attributes
+ SdrFillAttribute maFill; // fill attributes (if used)
+ FillGradientAttribute maFillFloatTransGradient; // fill float transparence gradient (if used)
+ SdrTextAttribute maTextAttribute; // text and text attributes (if used)
+
+ public:
+ SdrFillTextAttribute(
+ const SdrFillAttribute& rFill,
+ const FillGradientAttribute& rFillFloatTransGradient,
+ const SdrTextAttribute& rTextAttribute);
+ SdrFillTextAttribute();
+ SdrFillTextAttribute(const SdrFillTextAttribute& rCandidate);
+ SdrFillTextAttribute& operator=(const SdrFillTextAttribute& rCandidate);
+
+ // compare operator
+ bool operator==(const SdrFillTextAttribute& rCandidate) const;
+
+ // data access
+ const SdrFillAttribute& getFill() const { return maFill; }
+ const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; }
+ const SdrTextAttribute& getText() const { return maTextAttribute; }
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/attribute/sdrformtextattribute.hxx b/include/svx/sdr/attribute/sdrformtextattribute.hxx
new file mode 100644
index 000000000000..5a406376dccd
--- /dev/null
+++ b/include/svx/sdr/attribute/sdrformtextattribute.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 _SDR_ATTRIBUTE_SDRFORMTEXTATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRFORMTEXTATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <svx/xenum.hxx>
+#include <tools/color.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+class SfxItemSet;
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrFormTextAttribute;
+ class SdrFormTextOutlineAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrFormTextAttribute
+ {
+ private:
+ ImpSdrFormTextAttribute* mpSdrFormTextAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrFormTextAttribute(const SfxItemSet& rSet);
+ SdrFormTextAttribute();
+ SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate);
+ SdrFormTextAttribute& operator=(const SdrFormTextAttribute& rCandidate);
+ ~SdrFormTextAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrFormTextAttribute& rCandidate) const;
+
+ // data read access
+ sal_Int32 getFormTextDistance() const;
+ sal_Int32 getFormTextStart() const;
+ sal_Int32 getFormTextShdwXVal() const;
+ sal_Int32 getFormTextShdwYVal() const;
+ XFormTextStyle getFormTextStyle() const;
+ XFormTextAdjust getFormTextAdjust() const;
+ XFormTextShadow getFormTextShadow() const;
+ Color getFormTextShdwColor() const;
+ const SdrFormTextOutlineAttribute& getOutline() const;
+ const SdrFormTextOutlineAttribute& getShadowOutline() const;
+ bool getFormTextMirror() const;
+ bool getFormTextOutline() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRFORMTEXTATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/attribute/sdrformtextoutlineattribute.hxx b/include/svx/sdr/attribute/sdrformtextoutlineattribute.hxx
new file mode 100644
index 000000000000..139fb0fd045e
--- /dev/null
+++ b/include/svx/sdr/attribute/sdrformtextoutlineattribute.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 _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrFormTextOutlineAttribute;
+ class LineAttribute;
+ class StrokeAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrFormTextOutlineAttribute
+ {
+ private:
+ ImpSdrFormTextOutlineAttribute* mpSdrFormTextOutlineAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrFormTextOutlineAttribute(
+ const LineAttribute& rLineAttribute,
+ const StrokeAttribute& rStrokeAttribute,
+ sal_uInt8 nTransparence);
+ SdrFormTextOutlineAttribute();
+ SdrFormTextOutlineAttribute(const SdrFormTextOutlineAttribute& rCandidate);
+ SdrFormTextOutlineAttribute& operator=(const SdrFormTextOutlineAttribute& rCandidate);
+ ~SdrFormTextOutlineAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrFormTextOutlineAttribute& rCandidate) const;
+
+ // data read access
+ const LineAttribute& getLineAttribute() const;
+ const StrokeAttribute& getStrokeAttribute() const;
+ sal_uInt8 getTransparence() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx b/include/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx
new file mode 100644
index 000000000000..20c853915737
--- /dev/null
+++ b/include/svx/sdr/attribute/sdrlinefillshadowtextattribute.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 _SDR_ATTRIBUTE_SDRLINEFILLSHADOWTEXTATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRLINEFILLSHADOWTEXTATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrLineFillShadowTextAttribute : public SdrLineShadowTextAttribute
+ {
+ // add fill and transGradient attributes
+ SdrFillAttribute maFill; // fill attributes (if used)
+ FillGradientAttribute maFillFloatTransGradient; // fill float transparence gradient (if used)
+
+ public:
+ SdrLineFillShadowTextAttribute(
+ const SdrLineAttribute& rLine,
+ const SdrFillAttribute& rFill,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const FillGradientAttribute& rFillFloatTransGradient,
+ const SdrTextAttribute& rTextAttribute);
+ SdrLineFillShadowTextAttribute();
+ SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate);
+ SdrLineFillShadowTextAttribute& operator=(const SdrLineFillShadowTextAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLineFillShadowTextAttribute& rCandidate) const;
+
+ // data access
+ const SdrFillAttribute& getFill() const { return maFill; }
+ const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; }
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRLINEFILLSHADOWTEXTATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/attribute/sdrlineshadowtextattribute.hxx b/include/svx/sdr/attribute/sdrlineshadowtextattribute.hxx
new file mode 100644
index 000000000000..4a82d683ec26
--- /dev/null
+++ b/include/svx/sdr/attribute/sdrlineshadowtextattribute.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 _SDR_ATTRIBUTE_SDRLINESHADOWTEXTATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRLINESHADOWTEXTATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrLineShadowTextAttribute : public SdrShadowTextAttribute
+ {
+ // line, shadow, lineStartEnd and text attributes
+ SdrLineAttribute maLine; // line attributes (if used)
+ SdrLineStartEndAttribute maLineStartEnd; // line start end (if used)
+
+ public:
+ SdrLineShadowTextAttribute(
+ const SdrLineAttribute& rLine,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const SdrTextAttribute& rTextAttribute);
+ SdrLineShadowTextAttribute();
+ SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate);
+ SdrLineShadowTextAttribute& operator=(const SdrLineShadowTextAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLineShadowTextAttribute& rCandidate) const;
+
+ // data access
+ const SdrLineAttribute& getLine() const { return maLine; }
+ const SdrLineStartEndAttribute& getLineStartEnd() const { return maLineStartEnd; }
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRLINESHADOWTEXTATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/attribute/sdrshadowtextattribute.hxx b/include/svx/sdr/attribute/sdrshadowtextattribute.hxx
new file mode 100644
index 000000000000..0b82edc12241
--- /dev/null
+++ b/include/svx/sdr/attribute/sdrshadowtextattribute.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 _SDR_ATTRIBUTE_SDRSHADOWTEXTATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRSHADOWTEXTATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
+#include <svx/sdr/attribute/sdrtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrShadowTextAttribute
+ {
+ // shadow and text attributes
+ SdrShadowAttribute maShadow; // shadow attributes (if used)
+ SdrTextAttribute maTextAttribute; // text and text attributes (if used)
+
+ public:
+ SdrShadowTextAttribute(
+ const SdrShadowAttribute& rShadow,
+ const SdrTextAttribute& rTextAttribute);
+ SdrShadowTextAttribute();
+ SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate);
+ SdrShadowTextAttribute& operator=(const SdrShadowTextAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrShadowTextAttribute& rCandidate) const;
+
+ // data access
+ const SdrShadowAttribute& getShadow() const { return maShadow; }
+ const SdrTextAttribute& getText() const { return maTextAttribute; }
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRSHADOWTEXTATTRIBUTE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/attribute/sdrtextattribute.hxx b/include/svx/sdr/attribute/sdrtextattribute.hxx
new file mode 100644
index 000000000000..ac85aebc8d46
--- /dev/null
+++ b/include/svx/sdr/attribute/sdrtextattribute.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDR_ATTRIBUTE_SDRTEXTATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRTEXTATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <svx/xenum.hxx>
+#include <editeng/outlobj.hxx>
+#include <svx/sdtaitm.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+class SdrText;
+
+namespace drawinglayer { namespace animation {
+ class AnimationEntryList;
+}}
+
+namespace drawinglayer { namespace attribute {
+ class SdrFormTextAttribute;
+}}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrTextAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrTextAttribute
+ {
+ private:
+ ImpSdrTextAttribute* mpSdrTextAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrTextAttribute(
+ const SdrText& rSdrText,
+ const OutlinerParaObject& rOutlinerParaObject,
+ XFormTextStyle eFormTextStyle,
+ sal_Int32 aTextLeftDistance,
+ sal_Int32 aTextUpperDistance,
+ sal_Int32 aTextRightDistance,
+ sal_Int32 aTextLowerDistance,
+ SdrTextHorzAdjust aSdrTextHorzAdjust,
+ SdrTextVertAdjust aSdrTextVertAdjust,
+ bool bContour,
+ bool bFitToSize,
+ bool bAutoFit,
+ bool bHideContour,
+ bool bBlink,
+ bool bScroll,
+ bool bInEditMode,
+ bool bFixedCellHeight,
+ bool bWrongSpell);
+ SdrTextAttribute();
+ SdrTextAttribute(const SdrTextAttribute& rCandidate);
+ SdrTextAttribute& operator=(const SdrTextAttribute& rCandidate);
+ ~SdrTextAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrTextAttribute& rCandidate) const;
+
+ // data read access
+ const SdrText& getSdrText() const;
+ const OutlinerParaObject& getOutlinerParaObject() const;
+ bool isContour() const;
+ bool isFitToSize() const;
+ bool isAutoFit() const;
+ bool isHideContour() const;
+ bool isBlink() const;
+ bool isScroll() const;
+ bool isInEditMode() const;
+ bool isFixedCellHeight() const;
+ const SdrFormTextAttribute& getSdrFormTextAttribute() const;
+ sal_Int32 getTextLeftDistance() const;
+ sal_Int32 getTextUpperDistance() const;
+ sal_Int32 getTextRightDistance() const;
+ sal_Int32 getTextLowerDistance() const;
+ SdrTextHorzAdjust getSdrTextHorzAdjust() const;
+ SdrTextVertAdjust getSdrTextVertAdjust() const;
+
+ // helpers: animation timing generators
+ void getBlinkTextTiming(
+ drawinglayer::animation::AnimationEntryList& rAnimList) const;
+ void getScrollTextTiming(
+ drawinglayer::animation::AnimationEntryList& rAnimList,
+ double fFrameLength,
+ double fTextLength) const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRTEXTATTRIBUTE_HXX
+
+/* 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 000000000000..6c4b85e6f989
--- /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 _SDR_CONTACT_DISPLAYINFO_HXX
+#define _SDR_CONTACT_DISPLAYINFO_HXX
+
+#include <svx/svdsob.hxx>
+#include <vcl/region.hxx>
+#include "svx/svxdllapi.h"
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC DisplayInfo
+ {
+ protected:
+ // The Layers which shall be processed (visible)
+ SetOfByte maProcessLayers;
+
+ // The redraw area, in logical coordinates of OutputDevice. If Region
+ // is empty, everything needs to be redrawn
+ Region maRedrawArea;
+
+ // bitfield
+
+ // 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
+ unsigned 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())
+ unsigned mbPageProcessingActive : 1;
+
+ // Internal flag to remember if EnteredGroupDrawMode is active. Default is true
+ // since this mode starts activated and gets switched off when reacing
+ // the current group level. Should only be changed by instances which do
+ // primitive processing
+ unsigned 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
+ unsigned mbSubContentActive : 1;
+
+ public:
+ // basic constructor.
+ DisplayInfo();
+
+ // destructor
+ virtual ~DisplayInfo();
+
+ // access to ProcessLayers
+ void SetProcessLayers(const SetOfByte& rSet);
+ const SetOfByte& GetProcessLayers() const { return maProcessLayers; }
+
+ // access to RedrawArea
+ void SetRedrawArea(const Region& rRegion);
+ const Region& GetRedrawArea() const { return maRedrawArea; }
+
+ // 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 //_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 000000000000..fb67a18803fd
--- /dev/null
+++ b/include/svx/sdr/contact/objectcontact.hxx
@@ -0,0 +1,221 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDR_CONTACT_OBJECTCONTACT_HXX
+#define _SDR_CONTACT_OBJECTCONTACT_HXX
+
+#include <svx/sdr/animation/objectanimator.hxx>
+#include "svx/svxdllapi.h"
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SetOfByte;
+class Rectangle;
+class SdrPageView;
+class OutputDevice;
+
+namespace sdr { namespace contact {
+ class DisplayInfo;
+ class ViewContact;
+ class ViewObjectContactRedirector;
+}}
+
+namespace sdr { namespace event {
+ class TimerEventHandler;
+}}
+
+namespace basegfx {
+ class B2DRange;
+ class B2DHomMatrix;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_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.
+ virtual void RemoveViewObjectContact(ViewObjectContact& rVOContact);
+
+ // the primitiveAnimator which is used if this View and/or the contained primitives
+ // support animatedSwitchPrimitives
+ sdr::animation::primitiveAnimator maPrimitiveAnimator;
+
+ // the EventHandler for e.g. asynchronious loading of graphics
+ sdr::event::TimerEventHandler* mpEventHandler;
+
+ // 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;
+
+ // bitfield
+ // flag for preview renderer
+ unsigned mbIsPreviewRenderer : 1;
+
+ // method to create a EventHandler. Needs to give a result.
+ sdr::event::TimerEventHandler* CreateEventHandler();
+
+ 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();
+
+ // LazyInvalidate request. This is used from the VOCs to mark that they
+ // got invalidated by an ActionCanged() call. An active view needs to remember
+ // this and take action on it. Default implementation directly calls back
+ // triggerLazyInvalidate() wich 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 if given Rectangle is visible in this view
+ virtual bool IsAreaVisible(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();
+
+ // method to get the EventHandler. It will
+ // return a existing one or create a new one using CreateEventHandler().
+ sdr::event::TimerEventHandler& GetEventHandler() const;
+
+ // delete the EventHandler
+ void DeleteEventHandler();
+
+ // test if there is an EventHandler without creating one on demand
+ bool HasEventHandler() const;
+
+ // 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;
+
+ // check if asynchronious graphis loading is allowed. Default is sal_False.
+ virtual bool IsAsynchronGraphicsLoadingAllowed() const;
+
+ // access to ViewObjectContactRedirector
+ ViewObjectContactRedirector* GetViewObjectContactRedirector() const;
+ void SetViewObjectContactRedirector(ViewObjectContactRedirector* pNew);
+
+ // check if buffering of MasterPages is allowed. Default is sal_False.
+ virtual bool IsMasterPageBufferingAllowed() const;
+
+ // print? Default is false
+ virtual bool isOutputToPrinter() const;
+
+ // window? Default is true
+ virtual bool isOutputToWindow() const;
+
+ // VirtualDevice? Default is false
+ virtual bool isOutputToVirtualDevice() 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;
+
+ // gray display mode
+ virtual bool isDrawModeBlackWhite() 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. Needs to be overloaded as needed.
+ virtual SdrPageView* TryToGetSdrPageView() const;
+
+ // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
+ virtual OutputDevice* TryToGetOutputDevice() const;
+
+ // reset ViewPort at internal ViewInformation2D. This is needed when the OC is used
+ // not for ProcessDisplay() but to get a VOC associated with it. When trying to get
+ // a sequence of primitives from the VOC then, the last initialized ViewPort from
+ // the last ProcessDisplay() is used for geometric visibility testing. If this is not
+ // wanted (like in such cases) this method is used. It will reuse the current
+ // ViewInformation2D, but clear the ViewPort (no ViewPort means all is visible)
+ void resetViewPort();
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_OBJECTCONTACT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/objectcontactofobjlistpainter.hxx b/include/svx/sdr/contact/objectcontactofobjlistpainter.hxx
new file mode 100644
index 000000000000..9c4a0bff1763
--- /dev/null
+++ b/include/svx/sdr/contact/objectcontactofobjlistpainter.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 _SDR_CONTACT_OBJECTCONTACTOFOBJLISTPAINTER_HXX
+#define _SDR_CONTACT_OBJECTCONTACTOFOBJLISTPAINTER_HXX
+
+#include <svx/sdr/contact/objectcontact.hxx>
+#include "svx/svxdllapi.h"
+#include <svx/svdpage.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrPage;
+class SdrObject;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ObjectContactPainter : public ObjectContact
+ {
+ protected:
+ // Hierarchy access methods
+ virtual sal_uInt32 GetPaintObjectCount() const = 0;
+ virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const = 0;
+
+ public:
+ // basic constructor/destructor
+ ObjectContactPainter();
+ virtual ~ObjectContactPainter();
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ // typedef for transferring SdrObject
+ typedef ::std::vector< SdrObject* > SdrObjectVector;
+
+ class SVX_DLLPUBLIC ObjectContactOfObjListPainter : public ObjectContactPainter
+ {
+ protected:
+ // Target OutputDevice
+ OutputDevice& mrTargetOutputDevice;
+
+ // Set StartPoint for next run, also given in constructor
+ SdrObjectVector maStartObjects;
+
+ // the processed page which is the base e.g. for PageNumberFields
+ const SdrPage* mpProcessedPage;
+
+ // Hierarchy access methods
+ virtual sal_uInt32 GetPaintObjectCount() const;
+ virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const;
+
+ public:
+ // basic constructor/destructor
+ ObjectContactOfObjListPainter(
+ OutputDevice& rTargetDevice,
+ const SdrObjectVector& rObjects,
+ const SdrPage* pProcessedPage);
+ virtual ~ObjectContactOfObjListPainter();
+
+ // Process the whole displaying
+ virtual void ProcessDisplay(DisplayInfo& rDisplayInfo);
+
+ // VirtualDevice? Default is false
+ virtual bool isOutputToVirtualDevice() const;
+
+ // recording MetaFile? Default is false
+ virtual bool isOutputToRecordingMetaFile() const;
+
+ // pdf export? Default is false
+ virtual bool isOutputToPDFFile() const;
+
+ // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
+ virtual OutputDevice* TryToGetOutputDevice() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ObjectContactOfPagePainter : public ObjectContactPainter
+ {
+ protected:
+ // the original ObjectContact this painter is working on
+ ObjectContact& mrOriginalObjectContact;
+
+ // Set StartPoint for next run, also given in constructor
+ SdrPageWeakRef mxStartPage;
+
+ // Hierarchy access methods
+ virtual sal_uInt32 GetPaintObjectCount() const;
+ virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const;
+
+ public:
+ // basic constructor
+ ObjectContactOfPagePainter(
+ const SdrPage* pPage,
+ ObjectContact& rOriginalObjectContact);
+ virtual ~ObjectContactOfPagePainter();
+
+ // set another page
+ void SetStartPage(const SdrPage* pPage);
+ const SdrPage* GetStartPage() const { return mxStartPage.get(); }
+
+ // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
+ virtual OutputDevice* TryToGetOutputDevice() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_OBJECTCONTACTOFOBJLISTPAINTER_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 000000000000..06371bf35b81
--- /dev/null
+++ b/include/svx/sdr/contact/objectcontactofpageview.hxx
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX
+#define _SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX
+
+#include <svx/sdr/contact/objectcontact.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrPageWindow;
+class SdrPage;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ObjectContactOfPageView : public ObjectContact, public Timer
+ {
+ protected:
+ // 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);
+ virtual ~ObjectContactOfPageView();
+
+ // LazyInvalidate request. This is used from the VOCs to mark that they
+ // got invalidated by an ActionCanged() call. An active view needs to remember
+ // this and take action on it. Default implementation directly calls back
+ // triggerLazyInvalidate() wich promptly handles the request
+ virtual void setLazyInvalidate(ViewObjectContact& rVOC);
+
+ // call this to support evtl. preparations for repaint
+ virtual void PrepareProcessDisplay();
+
+ // From baseclass Timer, the timeout call triggered by te LazyInvalidate mechanism
+ virtual void Timeout();
+
+ // Process the whole displaying
+ virtual void ProcessDisplay(DisplayInfo& rDisplayInfo);
+
+ // test if visualizing of entered groups is switched on at all
+ 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.
+ virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const;
+
+ // Get info if given Rectangle is visible in this view
+ virtual bool IsAreaVisible(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;
+
+ // check if text animation is allowed.
+ virtual bool IsTextAnimationAllowed() const;
+
+ // check if graphic animation is allowed.
+ virtual bool IsGraphicAnimationAllowed() const;
+
+ // check if asynchronious graphis loading is allowed. Default is sal_False.
+ virtual bool IsAsynchronGraphicsLoadingAllowed() const;
+
+ // check if buffering of MasterPages is allowed. Default is sal_False.
+ virtual bool IsMasterPageBufferingAllowed() const;
+
+ // print? Default is false
+ virtual bool isOutputToPrinter() const;
+
+ // window? Default is true
+ virtual bool isOutputToWindow() const;
+
+ // VirtualDevice? Default is false
+ virtual bool isOutputToVirtualDevice() 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;
+
+ // gray display mode
+ virtual bool isDrawModeBlackWhite() const;
+
+ // high contrast display mode
+ virtual bool isDrawModeHighContrast() const;
+
+ // overloaded access to SdrPageView
+ virtual SdrPageView* TryToGetSdrPageView() const;
+
+ // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
+ virtual OutputDevice* TryToGetOutputDevice() const;
+
+ /** 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 //_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 000000000000..8e136e03afba
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontact.hxx
@@ -0,0 +1,168 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDR_CONTACT_VIEWCONTACT_HXX
+#define _SDR_CONTACT_VIEWCONTACT_HXX
+
+#include <sal/types.h>
+#include "svx/svxdllapi.h"
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SetOfByte;
+class SdrPage;
+class SdrObject;
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ObjectContact;
+ class ViewObjectContact;
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_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;
+
+ // Primitive2DSequence 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::Primitive2DSequence 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 a 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::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+
+ // method for flushing View Independent Primitive2DSequence for VOC implementations
+ void flushViewIndependentPrimitive2DSequence() { mxViewIndependentPrimitive2DSequence.realloc(0); }
+
+ // basic constructor. Since this is a base class only, it shall
+ // never be called directly
+ ViewContact();
+
+ // Methods to react on start getting viewed or stop getting
+ // viewed. This info is derived from the count of members of
+ // registered ViewObjectContacts. Default does nothing.
+ virtual void StartGettingViewed();
+ virtual void StopGettingViewed();
+
+ public:
+ // basic destructor with needed cleanups
+ virtual ~ViewContact();
+
+ // get a Object-specific ViewObjectContact for a specific
+ // ObjectContact (->View). Always needs to return something.
+ ViewObjectContact& GetViewObjectContact(ObjectContact& rObjectContact);
+
+ // Test if this ViewContact has ViewObjectContacts at all. This can
+ // be used to test if this ViewContact is visualized ATM or not
+ bool HasViewObjectContacts(bool bExcludePreviews = false) const;
+
+ // Check if this primitive is animated in any OC (View) which means it has
+ // generated a PrimitiveAnimation in it's 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 overloaded.
+ 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);
+
+ // React on changes of the object of this ViewContact
+ virtual void ActionChanged();
+
+ // access to SdrObject and/or SdrPage. May return 0L like the default
+ // implementations do. Needs to be overloaded as needed.
+ virtual SdrObject* TryToGetSdrObject() const;
+ virtual SdrPage* TryToGetSdrPage() const;
+
+ // 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::Primitive2DSequence getViewIndependentPrimitive2DSequence() const;
+
+ // add Gluepoints (if available)
+ virtual drawinglayer::primitive2d::Primitive2DSequence createGluePointPrimitive2DSequence() const;
+
+ // allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This
+ // is a helper normally used from getViewIndependentPrimitive2DSequence(), but there is one exception
+ // for 3D scenes
+ virtual drawinglayer::primitive2d::Primitive2DSequence embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DSequence& rSource) 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);
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofe3d.hxx b/include/svx/sdr/contact/viewcontactofe3d.hxx
new file mode 100644
index 000000000000..02bdb36e53c0
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofe3d.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 _SDR_CONTACT_VIEWCONTACTOFE3D_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFE3D_HXX
+
+#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace sdr { namespace contact {
+ class ViewContactOfE3dScene;
+}}
+
+namespace drawinglayer { namespace attribute {
+ class SdrLineAttribute;
+}}
+
+namespace basegfx {
+ class BColor;
+ class B3DHomMatrix;
+}
+
+class E3dObject;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfE3d : public ViewContactOfSdrObj
+ {
+ protected:
+ // Create a Object-Specific ViewObjectContact, set ViewContact and
+ // ObjectContact. Always needs to return something.
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+
+ public:
+ // basic constructor, used from E3dObject.
+ explicit ViewContactOfE3d(E3dObject& rObj);
+ virtual ~ViewContactOfE3d();
+
+ // access to E3dObject
+ E3dObject& GetE3dObject() const
+ {
+ return (E3dObject&)GetSdrObject();
+ }
+
+ // public helpers
+ drawinglayer::primitive2d::Primitive2DSequence impCreateWithGivenPrimitive3DSequence(
+ const drawinglayer::primitive3d::Primitive3DSequence& rxContent3D) const;
+
+ //////////////////////////////////////////////////////////////////////////////
+ // primitive stuff
+
+ protected:
+ // Primitive3DSequence of the ViewContact. This contains all necessary information
+ // for the graphical visualisation and needs to be supported by all 3D VCs which
+ // can be visualized. It does NOT contain the object transformation to be able to
+ // buffer for all possible usages
+ drawinglayer::primitive3d::Primitive3DSequence mxViewIndependentPrimitive3DSequence;
+
+ // This method is responsible for creating the graphical visualisation data which is
+ // stored in mxViewIndependentPrimitive3DSequence, but without object transformation
+ virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const = 0;
+
+ // This method is responsible for creating the graphical visualisation data derived ONLY from
+ // the model data. The default implementation will try to create a 3D to 2D embedding (will work
+ // when scene is known) which can then be used for 2D processing concerning ranges
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+
+ public:
+ // access to the local primitive without the object's local 3D transform. This is e.g. needed
+ // to get the not-yet transformed BoundVolume for e.g. interactions
+ drawinglayer::primitive3d::Primitive3DSequence getVIP3DSWithoutObjectTransform() const;
+
+ // access to the local primitive. This will ensure that the list is
+ // current in comparing the local list content with a fresh created incarnation. It will
+ // use getVIP3DSWithoutObjectTransform and embed to 3d transform primitive when object's
+ // local 3d transform is used
+ drawinglayer::primitive3d::Primitive3DSequence getViewIndependentPrimitive3DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofe3dcube.hxx b/include/svx/sdr/contact/viewcontactofe3dcube.hxx
new file mode 100644
index 000000000000..8207fa558db0
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofe3dcube.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 _SDR_CONTACT_VIEWCONTACTOFE3DCUBE_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFE3DCUBE_HXX
+
+#include <svx/sdr/contact/viewcontactofe3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class E3dCubeObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfE3dCube : public ViewContactOfE3d
+ {
+ public:
+ // basic constructor, used from SdrObject.
+ ViewContactOfE3dCube(E3dCubeObj& rCubeObj);
+ virtual ~ViewContactOfE3dCube();
+
+ // access to SdrObject
+ E3dCubeObj& GetE3dCubeObj() const
+ {
+ return (E3dCubeObj&)GetE3dObject();
+ }
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data which is
+ // stored in the local primitive list. Default creates a yellow replacement rectangle.
+ virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFE3DCUBE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofe3dextrude.hxx b/include/svx/sdr/contact/viewcontactofe3dextrude.hxx
new file mode 100644
index 000000000000..53d6b17913d2
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofe3dextrude.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 _SDR_CONTACT_VIEWCONTACTOFE3DEXTRUDE_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFE3DEXTRUDE_HXX
+
+#include <svx/sdr/contact/viewcontactofe3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class E3dExtrudeObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfE3dExtrude : public ViewContactOfE3d
+ {
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfE3dExtrude(E3dExtrudeObj& rExtrude);
+ virtual ~ViewContactOfE3dExtrude();
+
+ // access to SdrObject
+ E3dExtrudeObj& GetE3dExtrudeObj() const
+ {
+ return (E3dExtrudeObj&)GetE3dObject();
+ }
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data which is
+ // stored in the local primitive list. Default creates a yellow replacement rectangle.
+ virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFE3DEXTRUDE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofe3dlathe.hxx b/include/svx/sdr/contact/viewcontactofe3dlathe.hxx
new file mode 100644
index 000000000000..ad57b5588195
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofe3dlathe.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 _SDR_CONTACT_VIEWCONTACTOFE3DLATHE_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFE3DLATHE_HXX
+
+#include <svx/sdr/contact/viewcontactofe3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class E3dLatheObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfE3dLathe : public ViewContactOfE3d
+ {
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfE3dLathe(E3dLatheObj& rLathe);
+ virtual ~ViewContactOfE3dLathe();
+
+ // access to SdrObject
+ E3dLatheObj& GetE3dLatheObj() const
+ {
+ return (E3dLatheObj&)GetE3dObject();
+ }
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data which is
+ // stored in the local primitive list. Default creates a yellow replacement rectangle.
+ virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFE3DLATHE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofe3dpolygon.hxx b/include/svx/sdr/contact/viewcontactofe3dpolygon.hxx
new file mode 100644
index 000000000000..295d1c308697
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofe3dpolygon.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 _SDR_CONTACT_VIEWCONTACTOFE3DPOLYGON_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFE3DPOLYGON_HXX
+
+#include <svx/sdr/contact/viewcontactofe3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class E3dPolygonObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfE3dPolygon : public ViewContactOfE3d
+ {
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfE3dPolygon(E3dPolygonObj& rPolygon);
+ virtual ~ViewContactOfE3dPolygon();
+
+ // access to SdrObject
+ E3dPolygonObj& GetE3dPolygonObj() const
+ {
+ return (E3dPolygonObj&)GetE3dObject();
+ }
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data which is
+ // stored in the local primitive list. Default creates a yellow replacement rectangle.
+ virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFE3DPOLYGON_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 000000000000..bd5879fc0b9d
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofe3dscene.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 _SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX
+
+#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <drawinglayer/geometry/viewinformation3d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class E3dScene;
+
+namespace basegfx {
+ class B3DRange;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewContactOfE3dScene : public ViewContactOfSdrObj
+ {
+ protected:
+ // Create a 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);
+
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfE3dScene(E3dScene& rScene);
+
+ // access to SdrObject
+ E3dScene& GetE3dScene() const
+ {
+ return (E3dScene&)GetSdrObject();
+ }
+
+ // React on changes of the object of this ViewContact
+ virtual void ActionChanged();
+
+ // 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 SetOfByte is done.
+ drawinglayer::primitive2d::Primitive2DSequence createScenePrimitive2DSequence(const SetOfByte* pLayerVisibility) const;
+
+ // helpers to get the sequence of all contained 3D primitives and it's range,
+ // regardless of layer or visibility constraints and using a neutral ViewInformation3D
+ drawinglayer::primitive3d::Primitive3DSequence getAllPrimitive3DSequence() const;
+ basegfx::B3DRange getAllContentRange3D() const;
+
+ protected:
+ // the 3d transformation stack
+ drawinglayer::geometry::ViewInformation3D maViewInformation3D;
+
+ // the object transformation
+ basegfx::B2DHomMatrix maObjectTransformation;
+
+ // attributes
+ drawinglayer::attribute::SdrSceneAttribute maSdrSceneAttribute;
+ drawinglayer::attribute::SdrLightingAttribute maSdrLightingAttribute;
+
+ // 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::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofe3dsphere.hxx b/include/svx/sdr/contact/viewcontactofe3dsphere.hxx
new file mode 100644
index 000000000000..dd245d7efa06
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofe3dsphere.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 _SDR_CONTACT_VIEWCONTACTOFE3DSPHERE_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFE3DSPHERE_HXX
+
+#include <svx/sdr/contact/viewcontactofe3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class E3dSphereObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfE3dSphere : public ViewContactOfE3d
+ {
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfE3dSphere(E3dSphereObj& rSphere);
+ virtual ~ViewContactOfE3dSphere();
+
+ // access to SdrObject
+ E3dSphereObj& GetE3dSphereObj() const
+ {
+ return (E3dSphereObj&)GetE3dObject();
+ }
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data which is
+ // stored in the local primitive list. Default creates a yellow replacement rectangle.
+ virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFE3DSPHERE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofgraphic.hxx b/include/svx/sdr/contact/viewcontactofgraphic.hxx
new file mode 100644
index 000000000000..303ff79bd180
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofgraphic.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 _SDR_CONTACT_VIEWCONTACTOFGRAPHIC_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFGRAPHIC_HXX
+
+#include <sal/types.h>
+#include <svx/sdr/contact/viewcontactoftextobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrGrafObj;
+namespace drawinglayer { namespace attribute { class SdrLineFillShadowTextAttribute; }}
+class GraphicAttr;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfGraphic : public ViewContactOfTextObj
+ {
+ private:
+ // helpers for constructing various primitive visualisations in various states
+ drawinglayer::primitive2d::Primitive2DSequence createVIP2DSForPresObj(
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute,
+ const GraphicAttr& rLocalGrafInfo) const;
+ drawinglayer::primitive2d::Primitive2DSequence createVIP2DSForDraft(
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute) const;
+
+ protected:
+ // Create a Object-Specific ViewObjectContact, set ViewContact and
+ // ObjectContact. Always needs to return something.
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+
+ public:
+ // access to SdrObject
+ SdrGrafObj& GetGrafObject() const
+ {
+ return ((SdrGrafObj&)GetSdrObject());
+ }
+
+ // basic constructor, destructor
+ explicit ViewContactOfGraphic(SdrGrafObj& rGrafObj);
+ virtual ~ViewContactOfGraphic();
+
+ // #i102380#
+ void flushGraphicObjects();
+
+ // helpers for viusualisation state
+ bool visualisationUsesPresObj() const;
+ bool visualisationUsesDraft() const;
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFGRAPHIC_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofgroup.hxx b/include/svx/sdr/contact/viewcontactofgroup.hxx
new file mode 100644
index 000000000000..eb1c4a2517ce
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofgroup.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 _SDR_CONTACT_VIEWCONTACTOFGROUP_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFGROUP_HXX
+
+#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrObjGroup;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfGroup : public ViewContactOfSdrObj
+ {
+ protected:
+ // Create a 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);
+
+ // internal access to SdrObject
+ SdrObjGroup& GetSdrObjGroup() const
+ {
+ return (SdrObjGroup&)GetSdrObject();
+ }
+
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfGroup(SdrObjGroup& rGroup);
+ virtual ~ViewContactOfGroup();
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFGROUP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofmasterpagedescriptor.hxx b/include/svx/sdr/contact/viewcontactofmasterpagedescriptor.hxx
new file mode 100644
index 000000000000..fc2df17d9e0a
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofmasterpagedescriptor.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 _SDR_CONTACT_VIEWCONTACTOFMASTERPAGEDESCRIPTOR_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFMASTERPAGEDESCRIPTOR_HXX
+
+#include <sal/types.h>
+#include <svx/sdr/contact/viewcontact.hxx>
+#include <svx/sdrmasterpagedescriptor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+class SfxItemSet;
+class Bitmap;
+class MapMode;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfMasterPageDescriptor : public ViewContact
+ {
+ protected:
+ // the owner of this ViewContact. Set from constructor and not
+ // to be changed in any way.
+ sdr::MasterPageDescriptor& mrMasterPageDescriptor;
+
+ // Create a Object-Specific ViewObjectContact
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+
+ // This method is responsible for creating the graphical visualisation data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+
+ public:
+ // basic constructor
+ explicit ViewContactOfMasterPageDescriptor(sdr::MasterPageDescriptor& rDescriptor);
+
+ // The destructor.
+ virtual ~ViewContactOfMasterPageDescriptor();
+
+ // access to MasterPageDescriptor
+ sdr::MasterPageDescriptor& GetMasterPageDescriptor() const
+ {
+ return mrMasterPageDescriptor;
+ }
+
+ // Access to possible sub-hierarchy and parent
+ virtual sal_uInt32 GetObjectCount() const;
+ virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const;
+ virtual ViewContact* GetParentContact() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFMASTERPAGEDESCRIPTOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofpageobj.hxx b/include/svx/sdr/contact/viewcontactofpageobj.hxx
new file mode 100644
index 000000000000..30a53e5eb9ac
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofpageobj.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 _SDR_CONTACT_VIEWCONTACTOFPAGEOBJ_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFPAGEOBJ_HXX
+
+#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrPageObj;
+class SdrPage;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewContactOfPageObj : public ViewContactOfSdrObj
+ {
+ protected:
+ // Create a Object-Specific ViewObjectContact, set ViewContact and
+ // ObjectContact. Always needs to return something.
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+
+ // create graphical visualisation data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfPageObj(SdrPageObj& rPageObj);
+ virtual ~ViewContactOfPageObj();
+
+ // #WIP# React on changes of the object of this ViewContact
+ virtual void ActionChanged();
+
+ // access to SdrObject
+ SdrPageObj& GetPageObj() const
+ {
+ return (SdrPageObj&)GetSdrObject();
+ }
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFPAGEOBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofsdrcaptionobj.hxx b/include/svx/sdr/contact/viewcontactofsdrcaptionobj.hxx
new file mode 100644
index 000000000000..19cc9976dbdf
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofsdrcaptionobj.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 _SDR_CONTACT_VIEWCONTACTOFSDRCAPTIONOBJ_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFSDRCAPTIONOBJ_HXX
+
+#include <svx/sdr/contact/viewcontactofsdrrectobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrCaptionObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfSdrCaptionObj : public ViewContactOfSdrRectObj
+ {
+ protected:
+ // internal access to SdrCaptionObj
+ SdrCaptionObj& GetCaptionObj() const
+ {
+ return (SdrCaptionObj&)GetSdrObject();
+ }
+
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrCaptionObj(SdrCaptionObj& rCaptionObj);
+ virtual ~ViewContactOfSdrCaptionObj();
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFSDRCAPTIONOBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofsdrcircobj.hxx b/include/svx/sdr/contact/viewcontactofsdrcircobj.hxx
new file mode 100644
index 000000000000..27059b275437
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofsdrcircobj.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 _SDR_CONTACT_VIEWCONTACTOFSDRCIRCOBJ_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFSDRCIRCOBJ_HXX
+
+#include <svx/sdr/contact/viewcontactofsdrrectobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrCircObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfSdrCircObj : public ViewContactOfSdrRectObj
+ {
+ protected:
+ // internal access to SdrCircObj
+ SdrCircObj& GetCircObj() const
+ {
+ return (SdrCircObj&)GetSdrObject();
+ }
+
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrCircObj(SdrCircObj& rCircObj);
+ virtual ~ViewContactOfSdrCircObj();
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFSDRCIRCOBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofsdredgeobj.hxx b/include/svx/sdr/contact/viewcontactofsdredgeobj.hxx
new file mode 100644
index 000000000000..0ca7d4101b7b
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofsdredgeobj.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 _SDR_CONTACT_VIEWCONTACTOFSDREDGEOBJ_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFSDREDGEOBJ_HXX
+
+#include <svx/sdr/contact/viewcontactoftextobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrEdgeObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfSdrEdgeObj : public ViewContactOfTextObj
+ {
+ protected:
+ // internal access to SdrEdgeObj
+ SdrEdgeObj& GetEdgeObj() const
+ {
+ return (SdrEdgeObj&)GetSdrObject();
+ }
+
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrEdgeObj(SdrEdgeObj& rEdgeObj);
+ virtual ~ViewContactOfSdrEdgeObj();
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFSDREDGEOBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofsdrmeasureobj.hxx b/include/svx/sdr/contact/viewcontactofsdrmeasureobj.hxx
new file mode 100644
index 000000000000..83a32a17a9ec
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofsdrmeasureobj.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 _SDR_CONTACT_VIEWCONTACTOFSDRMEASUREOBJ_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFSDRMEASUREOBJ_HXX
+
+#include <svx/sdr/contact/viewcontactoftextobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrMeasureObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfSdrMeasureObj : public ViewContactOfTextObj
+ {
+ protected:
+ // internal access to SdrMeasureObj
+ SdrMeasureObj& GetMeasureObj() const
+ {
+ return (SdrMeasureObj&)GetSdrObject();
+ }
+
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrMeasureObj(SdrMeasureObj& rMeasureObj);
+ virtual ~ViewContactOfSdrMeasureObj();
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFSDRMEASUREOBJ_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 000000000000..3ad8580cf12e
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofsdrmediaobj.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 _SDR_CONTACT_VIEWCONTACTOFSDRMEDIAOBJ_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFSDRMEDIAOBJ_HXX
+
+#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
+#include "svx/svxdllapi.h"
+#include <tools/gen.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrMediaObj;
+namespace avmedia { class MediaItem; }
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewContactOfSdrMediaObj : public ViewContactOfSdrObj
+ {
+ friend class ViewObjectContactOfSdrMediaObj;
+
+ public:
+
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrMediaObj( SdrMediaObj& rMediaObj );
+ virtual ~ViewContactOfSdrMediaObj();
+
+ public:
+
+ // access to SdrMediaObj
+ SdrMediaObj& GetSdrMediaObj() const
+ {
+ return (SdrMediaObj&)GetSdrObject();
+ }
+
+ Size getPreferredSize() const;
+
+ void updateMediaItem( ::avmedia::MediaItem& rItem ) const;
+ void executeMediaItem( const ::avmedia::MediaItem& rItem );
+
+ protected:
+
+ // Create a Object-Specific ViewObjectContact, set ViewContact and
+ // ObjectContact. Always needs to return something.
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+
+ // get notified if some properties have changed
+ virtual 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::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..b628637cb707
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofsdrobj.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDR_CONTACT_VIEWCONTACTOFSDROBJ_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFSDROBJ_HXX
+
+#include <sal/types.h>
+#include <svx/sdr/contact/viewcontact.hxx>
+#include <svx/sdtakitm.hxx>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrObject;
+class GeoStat;
+class Bitmap;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_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 a Object-Specific ViewObjectContact, set ViewContact and
+ // ObjectContact. Always needs to return something.
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+
+ public:
+ // access to SdrObject
+ SdrObject& GetSdrObject() const
+ {
+ return mrObject;
+ }
+
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrObj(SdrObject& rObj);
+ virtual ~ViewContactOfSdrObj();
+
+ // Access to possible sub-hierarchy
+ virtual sal_uInt32 GetObjectCount() const;
+ virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const;
+ virtual ViewContact* GetParentContact() const;
+
+ // React on changes of the object of this ViewContact
+ virtual void ActionChanged();
+
+ // overload for acessing the SdrObject
+ virtual SdrObject* TryToGetSdrObject() const;
+
+ //////////////////////////////////////////////////////////////////////////////
+ // primitive stuff
+
+ // add Gluepoints (if available)
+ virtual drawinglayer::primitive2d::Primitive2DSequence createGluePointPrimitive2DSequence() const;
+
+ // allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This
+ // is a helper normally used from getViewIndependentPrimitive2DSequence(), but there is one exception
+ // for 3D scenes
+ virtual drawinglayer::primitive2d::Primitive2DSequence embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DSequence& rSource) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFSDROBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx b/include/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx
new file mode 100644
index 000000000000..8b4e06100a0c
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofsdrobjcustomshape.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 _SDR_CONTACT_VIEWCONTACTOFSDROBJCUSTOMSHAPE_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFSDROBJCUSTOMSHAPE_HXX
+
+#include <svx/sdr/contact/viewcontactoftextobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrObjCustomShape;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfSdrObjCustomShape : public ViewContactOfTextObj
+ {
+ protected:
+ // internal access to SdrObjCustomShape
+ SdrObjCustomShape& GetCustomShapeObj() const
+ {
+ return (SdrObjCustomShape&)GetSdrObject();
+ }
+
+ // #i101684# internal tooling
+ basegfx::B2DRange getCorrectedTextBoundRect() const;
+
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrObjCustomShape(SdrObjCustomShape& rCustomShape);
+ virtual ~ViewContactOfSdrObjCustomShape();
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFSDROBJCUSTOMSHAPE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofsdrole2obj.hxx b/include/svx/sdr/contact/viewcontactofsdrole2obj.hxx
new file mode 100644
index 000000000000..fb97f3e49884
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofsdrole2obj.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 _SDR_CONTACT_VIEWCONTACTOFSDROLE2OBJ_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFSDROLE2OBJ_HXX
+
+#include <svx/sdr/contact/viewcontactofsdrrectobj.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrOle2Obj;
+class Graphic;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfSdrOle2Obj : public ViewContactOfSdrRectObj
+ {
+ protected:
+ // Create a Object-Specific ViewObjectContact, set ViewContact and
+ // ObjectContact. Always needs to return something.
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+
+ public:
+ // access to SdrOle2Obj
+ SdrOle2Obj& GetOle2Obj() const
+ {
+ return (SdrOle2Obj&)GetSdrObject();
+ }
+
+ /// helper to create transformation from SdrObject
+ basegfx::B2DHomMatrix createObjectTransform() const;
+
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrOle2Obj(SdrOle2Obj& rOle2Obj);
+ virtual ~ViewContactOfSdrOle2Obj();
+
+ // helper for creating a OLE sequence for this object. It takes care od attributes, needed
+ // scaling (e.g. for EmptyPresObj's), the correct graphic and other stuff. It is used from
+ // createViewIndependentPrimitive2DSequence with false, and with evtl. HighContrast true
+ // from the VOC which knows that
+ drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceWithParameters() const;
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data, just wraps to call createPrimitive2DSequenceWithParameters(false)
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFSDROLE2OBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofsdrpage.hxx b/include/svx/sdr/contact/viewcontactofsdrpage.hxx
new file mode 100644
index 000000000000..b194108541ac
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofsdrpage.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 _SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
+
+#include <sal/types.h>
+#include <svx/sdr/contact/viewcontact.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+class SdrPage;
+
+namespace sdr { namespace contact {
+ class ViewContactOfSdrPage;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfPageSubObject : public ViewContact
+ {
+ protected:
+ ViewContactOfSdrPage& mrParentViewContactOfSdrPage;
+
+ public:
+ explicit ViewContactOfPageSubObject(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
+ virtual ~ViewContactOfPageSubObject();
+
+ virtual ViewContact* GetParentContact() const;
+ const SdrPage& getPage() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfPageBackground : public ViewContactOfPageSubObject
+ {
+ protected:
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+
+ public:
+ explicit ViewContactOfPageBackground(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
+ virtual ~ViewContactOfPageBackground();
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfPageShadow : public ViewContactOfPageSubObject
+ {
+ protected:
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+
+ public:
+ explicit ViewContactOfPageShadow(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
+ virtual ~ViewContactOfPageShadow();
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfPageFill : public ViewContactOfPageSubObject
+ {
+ protected:
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+
+ public:
+ explicit ViewContactOfPageFill(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
+ virtual ~ViewContactOfPageFill();
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfMasterPage : public ViewContactOfPageSubObject
+ {
+ protected:
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+
+ public:
+ explicit ViewContactOfMasterPage(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
+ virtual ~ViewContactOfMasterPage();
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfOuterPageBorder : public ViewContactOfPageSubObject
+ {
+ protected:
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+
+ public:
+ explicit ViewContactOfOuterPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
+ virtual ~ViewContactOfOuterPageBorder();
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfInnerPageBorder : public ViewContactOfPageSubObject
+ {
+ protected:
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+
+ public:
+ explicit ViewContactOfInnerPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
+ virtual ~ViewContactOfInnerPageBorder();
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfPageHierarchy : public ViewContactOfPageSubObject
+ {
+ protected:
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+
+ public:
+ explicit ViewContactOfPageHierarchy(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
+ virtual ~ViewContactOfPageHierarchy();
+
+ virtual sal_uInt32 GetObjectCount() const;
+ virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfGrid : public ViewContactOfPageSubObject
+ {
+ protected:
+ // bitfield
+ unsigned mbFront : 1;
+
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+
+ public:
+ ViewContactOfGrid(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront);
+ virtual ~ViewContactOfGrid();
+
+ bool getFront() const { return mbFront; }
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfHelplines : public ViewContactOfPageSubObject
+ {
+ protected:
+ // bitfield
+ unsigned mbFront : 1;
+
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+
+ public:
+ ViewContactOfHelplines(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront);
+ virtual ~ViewContactOfHelplines();
+
+ bool getFront() const { return mbFront; }
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfSdrPage : public ViewContact
+ {
+ protected:
+ // the owner of this ViewContact. Set from constructor and not
+ // to be changed in any way.
+ SdrPage& mrPage;
+
+ // helper viewContacts to build a clear paint hierarchy
+ ViewContactOfPageBackground maViewContactOfPageBackground;
+ ViewContactOfPageShadow maViewContactOfPageShadow;
+ ViewContactOfPageFill maViewContactOfPageFill;
+ ViewContactOfMasterPage maViewContactOfMasterPage;
+ ViewContactOfOuterPageBorder maViewContactOfOuterPageBorder;
+ ViewContactOfInnerPageBorder maViewContactOfInnerPageBorder;
+ ViewContactOfGrid maViewContactOfGridBack;
+ ViewContactOfHelplines maViewContactOfHelplinesBack;
+ ViewContactOfPageHierarchy maViewContactOfPageHierarchy;
+ ViewContactOfGrid maViewContactOfGridFront;
+ ViewContactOfHelplines maViewContactOfHelplinesFront;
+
+ // Create a 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);
+
+ public:
+ // access to SdrObject
+ SdrPage& GetSdrPage() const
+ {
+ return mrPage;
+ }
+
+ // basic constructor, used from SdrPage.
+ explicit ViewContactOfSdrPage(SdrPage& rObj);
+ virtual ~ViewContactOfSdrPage();
+
+ // Access to possible sub-hierarchy
+ virtual sal_uInt32 GetObjectCount() const;
+ virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const;
+
+ // React on changes of the object of this ViewContact
+ virtual void ActionChanged();
+
+ // overload for acessing the SdrPage
+ virtual SdrPage* TryToGetSdrPage() const;
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofsdrpathobj.hxx b/include/svx/sdr/contact/viewcontactofsdrpathobj.hxx
new file mode 100644
index 000000000000..19ef798b8aaf
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofsdrpathobj.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 _SDR_CONTACT_VIEWCONTACTOFSDRPATHOBJ_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFSDRPATHOBJ_HXX
+
+#include <svx/sdr/contact/viewcontactoftextobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrPathObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfSdrPathObj : public ViewContactOfTextObj
+ {
+ protected:
+ // internal access to SdrPathObj
+ SdrPathObj& GetPathObj() const
+ {
+ return (SdrPathObj&)GetSdrObject();
+ }
+
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrPathObj(SdrPathObj& rTextObj);
+ virtual ~ViewContactOfSdrPathObj();
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFSDRPATHOBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofsdrrectobj.hxx b/include/svx/sdr/contact/viewcontactofsdrrectobj.hxx
new file mode 100644
index 000000000000..7d78befffe0e
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofsdrrectobj.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 _SDR_CONTACT_VIEWCONTACTOFSDRRECTOBJ_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFSDRRECTOBJ_HXX
+
+#include <svx/sdr/contact/viewcontactoftextobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrRectObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfSdrRectObj : public ViewContactOfTextObj
+ {
+ protected:
+ // internal access to SdrRectObj
+ SdrRectObj& GetRectObj() const
+ {
+ return (SdrRectObj&)GetSdrObject();
+ }
+
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrRectObj(SdrRectObj& rTextObj);
+ virtual ~ViewContactOfSdrRectObj();
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFSDRRECTOBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactoftextobj.hxx b/include/svx/sdr/contact/viewcontactoftextobj.hxx
new file mode 100644
index 000000000000..bb302ad8f9c0
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactoftextobj.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 _SDR_CONTACT_VIEWCONTACTOFTEXTOBJ_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFTEXTOBJ_HXX
+
+#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrTextObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContactOfTextObj : public ViewContactOfSdrObj
+ {
+ protected:
+ // internal access to SdrTextObj
+ SdrTextObj& GetTextObj() const
+ {
+ return (SdrTextObj&)GetSdrObject();
+ }
+
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfTextObj(SdrTextObj& rTextObj);
+ virtual ~ViewContactOfTextObj();
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWCONTACTOFTEXTOBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewcontactofunocontrol.hxx b/include/svx/sdr/contact/viewcontactofunocontrol.hxx
new file mode 100644
index 000000000000..aeeb2d6183c0
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofunocontrol.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 SVX_SDR_CONTACT_VIEWCONTACTOFUNOCONTROL_HXX
+#define SVX_SDR_CONTACT_VIEWCONTACTOFUNOCONTROL_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <svx/sdr/contact/viewcontactofsdrmediaobj.hxx>
+#include <svx/svxdllapi.h>
+
+#include <memory>
+
+class OutputDevice;
+class Window;
+class SdrUnoObj;
+namespace com { namespace sun { namespace star {
+ namespace awt {
+ class XControl;
+ class XControlContainer;
+ }
+} } }
+
+//........................................................................
+namespace sdr { namespace contact {
+//........................................................................
+
+ //====================================================================
+ //= ViewContactOfUnoControl
+ //====================================================================
+ class ViewContactOfUnoControl_Impl;
+ class SVX_DLLPRIVATE ViewContactOfUnoControl : public ViewContactOfSdrObj
+ {
+ private:
+ ::std::auto_ptr< ViewContactOfUnoControl_Impl > m_pImpl;
+
+ public:
+ // access to SdrObject
+ SdrUnoObj& GetSdrUnoObj() const
+ {
+ return ((SdrUnoObj&)GetSdrObject());
+ }
+
+ explicit ViewContactOfUnoControl( SdrUnoObj& _rUnoObject );
+ virtual ~ViewContactOfUnoControl();
+
+ /** access control to selected members
+ */
+ struct SdrUnoObjAccessControl { friend class ::SdrUnoObj; private: SdrUnoObjAccessControl() { } };
+
+ /** retrieves a temporary XControl instance, whose parent is the given window
+ @seealso SdrUnoObj::GetTemporaryControlForWindow
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >
+ getTemporaryControlForWindow( const Window& _rWindow, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _inout_ControlContainer ) const;
+
+ protected:
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact( ObjectContact& _rObjectContact );
+
+ private:
+ ViewContactOfUnoControl(); // never implemented
+ ViewContactOfUnoControl( const ViewContactOfUnoControl& ); // never implemented
+ ViewContactOfUnoControl& operator=( const ViewContactOfUnoControl& ); // never implemented
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+
+//........................................................................
+} } // namespace sdr::contact
+//........................................................................
+
+#endif // SVX_SDR_CONTACT_VIEWCONTACTOFUNOCONTROL_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 000000000000..8e3719eae357
--- /dev/null
+++ b/include/svx/sdr/contact/viewcontactofvirtobj.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 _SDR_CONTACT_VIEWCONTACTOFVIRTOBJ_HXX
+#define _SDR_CONTACT_VIEWCONTACTOFVIRTOBJ_HXX
+
+#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+class SdrVirtObj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewContactOfVirtObj : public ViewContactOfSdrObj
+ {
+ protected:
+ // internal access to SdrObject. Iplementation in *.cxx to avoid
+ // including SdrVirtObj here.
+ SdrVirtObj& GetVirtObj() const;
+
+ public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfVirtObj(SdrVirtObj& rObj);
+ virtual ~ViewContactOfVirtObj();
+
+ // Access to possible sub-hierarchy
+ virtual sal_uInt32 GetObjectCount() const;
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..96c3918a4c42
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontact.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 _SDR_CONTACT_VIEWOBJECTCONTACT_HXX
+#define _SDR_CONTACT_VIEWOBJECTCONTACT_HXX
+
+#include <sal/types.h>
+
+#include <vector>
+#include "svx/svxdllapi.h"
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class Region;
+
+namespace sdr { namespace contact {
+ class DisplayInfo;
+ class ObjectContact;
+ class ViewContact;
+ class ViewObjectContactRedirector;
+}}
+
+namespace sdr { namespace animation {
+ class PrimitiveAnimation;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_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::Primitive2DSequence mxPrimitive2DSequence;
+
+ // the PrimitiveAnimation if Primitive2DSequence contains animations
+ sdr::animation::PrimitiveAnimation* mpPrimitiveAnimation;
+
+ // bitfield
+ // This bool gets set when the object gets invalidated by ActionChanged() and
+ // can be used from the OC to late-invalidates
+ unsigned 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::getViewIndependentPrimitive2DSequence(), takes care of
+ // visibility, handles glue and ghosted.
+ // This method will not handle included hierarchies and not check geometric visibility.
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ // method for flushing Primitive2DSequence for VOC implementations
+ void flushPrimitive2DSequence() { mxPrimitive2DSequence.realloc(0); }
+
+ 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 oebject's size range
+ const basegfx::B2DRange& getObjectRange() const;
+
+ // A ViewObjectContact was deleted and shall be forgotten.
+ void RemoveViewObjectContact(ViewObjectContact& rVOContact);
+
+ // 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 (0 != mpPrimitiveAnimation); }
+
+ // Take some action when new objects are inserted
+ virtual 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::Primitive2DSequence 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::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const;
+
+ // just process the sub-hierarchy, used as tooling from getPrimitive2DSequenceHierarchy
+ drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWOBJECTCONTACT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewobjectcontactofe3d.hxx b/include/svx/sdr/contact/viewobjectcontactofe3d.hxx
new file mode 100644
index 000000000000..f0fa2758b7f3
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontactofe3d.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 _SDR_CONTACT_VIEWOBJECTCONTACTOFE3D_HXX
+#define _SDR_CONTACT_VIEWOBJECTCONTACTOFE3D_HXX
+
+#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
+#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace sdr { namespace contact {
+ class ViewObjectContactOfE3dScene;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewObjectContactOfE3d : public ViewObjectContactOfSdrObj
+ {
+ protected:
+ // Primitive3D sequence 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::primitive3d::Primitive3DSequence mxPrimitive3DSequence;
+
+ // This method is responsible for creating the graphical visualisation data which is
+ // stored/cached in the local primitive. Default gets view-independent Primitive3D
+ // from the ViewContact using ViewContact::getViewIndependentPrimitive3DSequence(), takes care of
+ // visibility and ghosted.
+ // This method will not handle included hierarchies and not check geometric visibility.
+ drawinglayer::primitive3d::Primitive3DSequence createPrimitive3DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ // also overload the 2d method to deliver a 2d object with embedd3d 3d and the 3d transformation which is able to
+ // answer the get2DRange question accordingly
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ public:
+ ViewObjectContactOfE3d(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfE3d();
+
+ // access to the local primitive sequence. This will ensure that the list is
+ // current in comparing the local list content with a fresh created incarnation
+ // This method will not handle included hierarchies or visibility.
+ drawinglayer::primitive3d::Primitive3DSequence getPrimitive3DSequence(const DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFE3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewobjectcontactofe3dscene.hxx b/include/svx/sdr/contact/viewobjectcontactofe3dscene.hxx
new file mode 100644
index 000000000000..d6d405f5ef95
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontactofe3dscene.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 _SDR_CONTACT_VIEWOBJECTCONTACTOFE3DSCENE_HXX
+#define _SDR_CONTACT_VIEWOBJECTCONTACTOFE3DSCENE_HXX
+
+#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfE3dScene : public ViewObjectContactOfSdrObj
+ {
+ protected:
+ // 2d primitive creator
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ public:
+ // basic constructor.
+ ViewObjectContactOfE3dScene(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfE3dScene();
+
+ // 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::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFE3DSCENE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewobjectcontactofgraphic.hxx b/include/svx/sdr/contact/viewobjectcontactofgraphic.hxx
new file mode 100644
index 000000000000..e8200d6a429a
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontactofgraphic.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 _SDR_CONTACT_VIEWOBJECTCONTACTOFGRAPHIC_HXX
+#define _SDR_CONTACT_VIEWOBJECTCONTACTOFGRAPHIC_HXX
+
+#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+class SdrGrafObj;
+
+namespace sdr { namespace event {
+ class AsynchGraphicLoadingEvent;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewObjectContactOfGraphic : public ViewObjectContactOfSdrObj
+ {
+ private:
+ // allow async loading event helper to call tooling methods
+ friend class sdr::event::AsynchGraphicLoadingEvent;
+
+ // Member which takes care for the asynch loading events which may be necessary
+ // for asynch graphics loading.
+ sdr::event::AsynchGraphicLoadingEvent* mpAsynchLoadEvent;
+
+ // async graphics loading helpers. Only to be used internally or from the
+ // event helper class (in .cxx file)
+ bool impPrepareGraphicWithAsynchroniousLoading();
+ bool impPrepareGraphicWithSynchroniousLoading();
+ void doAsynchGraphicLoading();
+ void forgetAsynchGraphicLoadingEvent(sdr::event::AsynchGraphicLoadingEvent* pEvent);
+
+ protected:
+ SdrGrafObj& getSdrGrafObj();
+
+ // This method is responsible for creating the graphical visualisation data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ public:
+ ViewObjectContactOfGraphic(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfGraphic();
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFGRAPHIC_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewobjectcontactofgroup.hxx b/include/svx/sdr/contact/viewobjectcontactofgroup.hxx
new file mode 100644
index 000000000000..fda5610e0568
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontactofgroup.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 _SDR_CONTACT_VIEWOBJECTCONTACTOFGROUP_HXX
+#define _SDR_CONTACT_VIEWOBJECTCONTACTOFGROUP_HXX
+
+#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfGroup : public ViewObjectContactOfSdrObj
+ {
+ public:
+ // basic constructor.
+ ViewObjectContactOfGroup(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfGroup();
+
+ // This method recursively paints the draw hierarchy.
+ virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const;
+
+ private:
+ virtual bool isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFGROUP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx b/include/svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx
new file mode 100644
index 000000000000..f09bd03d86a9
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.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 _SDR_CONTACT_VIEWOBJECTCONTACTOFMASTERPAGEDESCRIPTOR_HXX
+#define _SDR_CONTACT_VIEWOBJECTCONTACTOFMASTERPAGEDESCRIPTOR_HXX
+
+#include <svx/sdr/contact/viewobjectcontact.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace sdr {
+ class MasterPageDescriptor;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewObjectContactOfMasterPageDescriptor : public ViewObjectContact
+ {
+ public:
+ ViewObjectContactOfMasterPageDescriptor(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfMasterPageDescriptor();
+
+ // access to MasterPageDescriptor
+ sdr::MasterPageDescriptor& GetMasterPageDescriptor() const;
+
+ virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
+ virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFSDRPAGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewobjectcontactofpageobj.hxx b/include/svx/sdr/contact/viewobjectcontactofpageobj.hxx
new file mode 100644
index 000000000000..420a464319d5
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontactofpageobj.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 _SDR_CONTACT_VIEWOBJECTCONTACTOFPAGEOBJ_HXX
+#define _SDR_CONTACT_VIEWOBJECTCONTACTOFPAGEOBJ_HXX
+
+#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace sdr { namespace contact {
+ class PagePrimitiveExtractor;
+}}
+
+class SdrPage;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfPageObj : public ViewObjectContactOfSdrObj
+ {
+ private:
+ // the page painter helper
+ PagePrimitiveExtractor* mpExtractor;
+
+ protected:
+ // This method is responsible for creating the graphical visualisation data which is
+ // stored/cached in the local primitive.
+ // This method will not handle included hierarchies and not check geometric visibility.
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ public:
+ ViewObjectContactOfPageObj(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfPageObj();
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFPAGEOBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewobjectcontactofsdrmediaobj.hxx b/include/svx/sdr/contact/viewobjectcontactofsdrmediaobj.hxx
new file mode 100644
index 000000000000..e1e24dab8442
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontactofsdrmediaobj.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 _SDR_CONTACT_VIEWOBJECTCONTACTOFSDRMEDIAOBJ_HXX
+#define _SDR_CONTACT_VIEWOBJECTCONTACTOFSDRMEDIAOBJ_HXX
+
+#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
+#include <svx/sdr/contact/viewobjectcontact.hxx>
+#include <tools/gen.hxx>
+
+namespace avmedia { class MediaItem; }
+class Window;
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SdrMediaWindow;
+
+ class ViewObjectContactOfSdrMediaObj : public ViewObjectContactOfSdrObj
+ {
+ public:
+
+ ViewObjectContactOfSdrMediaObj( ObjectContact& rObjectContact,
+ ViewContact& rViewContact,
+ const ::avmedia::MediaItem& rMediaItem );
+ virtual ~ViewObjectContactOfSdrMediaObj();
+
+ public:
+
+ Window* getWindow() const;
+
+ Size getPreferredSize() const;
+
+ void updateMediaItem( ::avmedia::MediaItem& rItem ) const;
+ void executeMediaItem( const ::avmedia::MediaItem& rItem );
+
+ private:
+
+ ::sdr::contact::SdrMediaWindow* mpMediaWindow;
+
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_CONTACT_VIEWOBJECTCONTACTOFSDRMEDIAOBJ_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 000000000000..e0384426add3
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontactofsdrobj.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 _SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX
+#define _SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX
+
+#include <svx/sdr/contact/viewobjectcontact.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+class SdrObject;
+class SetOfByte;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfSdrObj : public ViewObjectContact
+ {
+ /** Test whether the primitive is visible on any layer from @c aLayers
+
+ This should be overriden by ViewObjectContacts of SDR classes
+ that have subparts which can be on different layers (that is,
+ SdrObjGroup .-)
+ */
+ virtual bool isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const;
+
+ protected:
+ const SdrObject& getSdrObject() const;
+
+ public:
+ ViewObjectContactOfSdrObj(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfSdrObj();
+
+ virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewobjectcontactofsdrole2obj.hxx b/include/svx/sdr/contact/viewobjectcontactofsdrole2obj.hxx
new file mode 100644
index 000000000000..6fe19c742481
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontactofsdrole2obj.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 _SDR_CONTACT_VIEWOBJECTCONTACTOFSDROLE2OBJ_HXX
+#define _SDR_CONTACT_VIEWOBJECTCONTACTOFSDROLE2OBJ_HXX
+
+#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+class SdrOle2Obj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewObjectContactOfSdrOle2Obj : public ViewObjectContactOfSdrObj
+ {
+ protected:
+ const SdrOle2Obj& getSdrOle2Object() const;
+
+ // This method is responsible for creating the graphical visualisation data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ public:
+ ViewObjectContactOfSdrOle2Obj(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfSdrOle2Obj();
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROLE2OBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewobjectcontactofsdrpage.hxx b/include/svx/sdr/contact/viewobjectcontactofsdrpage.hxx
new file mode 100644
index 000000000000..588554b7dd92
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontactofsdrpage.hxx
@@ -0,0 +1,238 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFSDRPAGE_HXX
+#define _SDR_CONTACT_VIEWOBJECTCONTACTOFSDRPAGE_HXX
+
+#include <svx/sdr/contact/viewobjectcontact.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrPage;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfPageSubObject : public ViewObjectContact
+ {
+ protected:
+ const SdrPage& getPage() const;
+
+ public:
+ ViewObjectContactOfPageSubObject(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfPageSubObject();
+
+ virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
+ virtual bool isPrimitiveGhosted(const DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfPageBackground : public ViewObjectContactOfPageSubObject
+ {
+ protected:
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ public:
+ ViewObjectContactOfPageBackground(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfPageBackground();
+
+ virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfMasterPage : public ViewObjectContactOfPageSubObject
+ {
+ protected:
+ public:
+ ViewObjectContactOfMasterPage(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfMasterPage();
+
+ virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfPageFill : public ViewObjectContactOfPageSubObject
+ {
+ protected:
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ public:
+ ViewObjectContactOfPageFill(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfPageFill();
+
+ virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfPageShadow : public ViewObjectContactOfPageSubObject
+ {
+ public:
+ ViewObjectContactOfPageShadow(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfPageShadow();
+
+ virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfOuterPageBorder : public ViewObjectContactOfPageSubObject
+ {
+ public:
+ ViewObjectContactOfOuterPageBorder(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfOuterPageBorder();
+
+ virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfInnerPageBorder : public ViewObjectContactOfPageSubObject
+ {
+ public:
+ ViewObjectContactOfInnerPageBorder(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfInnerPageBorder();
+
+ virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfPageHierarchy : public ViewObjectContactOfPageSubObject
+ {
+ public:
+ ViewObjectContactOfPageHierarchy(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfPageHierarchy();
+
+ virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfPageGrid : public ViewObjectContactOfPageSubObject
+ {
+ protected:
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ public:
+ ViewObjectContactOfPageGrid(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfPageGrid();
+
+ virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfPageHelplines : public ViewObjectContactOfPageSubObject
+ {
+ protected:
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ public:
+ ViewObjectContactOfPageHelplines(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfPageHelplines();
+
+ virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ class SVX_DLLPUBLIC ViewObjectContactOfSdrPage : public ViewObjectContact
+ {
+ public:
+ ViewObjectContactOfSdrPage(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfSdrPage();
+
+ virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const;
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWOBJECTCONTACTOFSDRPAGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/contact/viewobjectcontactofunocontrol.hxx b/include/svx/sdr/contact/viewobjectcontactofunocontrol.hxx
new file mode 100644
index 000000000000..a0077a3aa65e
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontactofunocontrol.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 SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX
+#define SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX
+
+#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <rtl/ref.hxx>
+#include <svx/svxdllapi.h>
+
+class OutputDevice;
+class Window;
+class SdrUnoObj;
+namespace com { namespace sun { namespace star {
+ namespace awt {
+ class XControl;
+ class XControlContainer;
+ }
+} } }
+
+//........................................................................
+namespace sdr { namespace contact {
+//........................................................................
+
+ class ViewContactOfUnoControl;
+ class ObjectContactOfPageView;
+ //====================================================================
+ //= ViewObjectContactOfUnoControl
+ //====================================================================
+ class ViewObjectContactOfUnoControl_Impl;
+ class SVX_DLLPRIVATE ViewObjectContactOfUnoControl : public ViewObjectContactOfSdrObj
+ {
+ protected:
+ ::rtl::Reference< ViewObjectContactOfUnoControl_Impl > m_pImpl;
+
+ public:
+ ViewObjectContactOfUnoControl( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
+
+ /// returns the ->XControl instance belonging to the instance, creates it if necessary
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >
+ getControl();
+
+ /** retrieves a temporary XControl instance, whose parent is the given device
+ @seealso SdrUnoObj::GetTemporaryControlForWindow
+ */
+ static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >
+ getTemporaryControlForWindow(
+ const Window& _rWindow,
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _inout_ControlContainer,
+ const SdrUnoObj& _rUnoObject
+ );
+
+ /// ensures that the control belonging to this instances has a given visibility
+ void ensureControlVisibility( bool _bVisible ) const;
+
+ /** sets the design/alive mode of the control
+ */
+ void setControlDesignMode( bool _bDesignMode ) const;
+
+ /** callback from impl class to react on changes of properties form the XControlModel
+ */
+ void propertyChange();
+
+ /** React on changes of the object of this ViewContact
+ */
+ virtual void ActionChanged();
+
+ /** to be called when any aspect of the control which requires view updates changed
+ */
+ struct ImplAccess { friend class ViewObjectContactOfUnoControl_Impl; friend class ViewObjectContactOfUnoControl; private: ImplAccess() { } };
+ void onControlChangedOrModified( ImplAccess ) { impl_onControlChangedOrModified(); }
+
+ protected:
+ ~ViewObjectContactOfUnoControl();
+
+ // support for Primitive2D
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+
+ // visibility check
+ virtual bool isPrimitiveVisible( const DisplayInfo& _rDisplayInfo ) const;
+ /// to be called when any aspect of the control which requires view updates changed
+ void impl_onControlChangedOrModified();
+
+ private:
+ ViewObjectContactOfUnoControl(); // never implemented
+ ViewObjectContactOfUnoControl( const ViewObjectContactOfUnoControl& ); // never implemented
+ ViewObjectContactOfUnoControl& operator=( const ViewObjectContactOfUnoControl& ); // never implemented
+ };
+
+ //====================================================================
+ //= UnoControlPrintOrPreviewContact
+ //====================================================================
+ class SVX_DLLPRIVATE UnoControlPrintOrPreviewContact : public ViewObjectContactOfUnoControl
+ {
+ public:
+ UnoControlPrintOrPreviewContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact );
+ ~UnoControlPrintOrPreviewContact();
+
+ private:
+ UnoControlPrintOrPreviewContact(); // never implemented
+ UnoControlPrintOrPreviewContact( const UnoControlPrintOrPreviewContact& ); // never implemented
+ UnoControlPrintOrPreviewContact& operator=( const UnoControlPrintOrPreviewContact& ); // never implemented
+
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo ) const;
+ };
+
+//........................................................................
+} } // namespace sdr::contact
+//........................................................................
+
+#endif // SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_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 000000000000..d7f16e1b60bd
--- /dev/null
+++ b/include/svx/sdr/contact/viewobjectcontactredirector.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 _SDR_CONTACT_VIEWOBJECTCONTACTREDIRECTOR_HXX
+#define _SDR_CONTACT_VIEWOBJECTCONTACTREDIRECTOR_HXX
+
+#include "svx/svxdllapi.h"
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace sdr { namespace contact {
+ class DisplayInfo;
+ class ViewObjectContact;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace contact
+ {
+ // 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 SVX_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, overload the method and at least do what the method does.
+ virtual drawinglayer::primitive2d::Primitive2DSequence createRedirectedPrimitive2DSequence(
+ const sdr::contact::ViewObjectContact& rOriginal,
+ const sdr::contact::DisplayInfo& rDisplayInfo);
+ };
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_CONTACT_VIEWOBJECTCONTACTREDIRECTOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/event/eventhandler.hxx b/include/svx/sdr/event/eventhandler.hxx
new file mode 100644
index 000000000000..91ac5491e5c6
--- /dev/null
+++ b/include/svx/sdr/event/eventhandler.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 _SDR_EVENT_EVENTHANDLER_HXX
+#define _SDR_EVENT_EVENTHANDLER_HXX
+
+#include <sal/types.h>
+
+#include <vector>
+#include <vcl/timer.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace sdr
+{
+ namespace event
+ {
+ class BaseEvent;
+ class EventHandler;
+
+ // typedefs for a list of BaseEvents
+ typedef ::std::vector< BaseEvent* > BaseEventVector;
+ } // end of namespace event
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace event
+ {
+ class BaseEvent
+ {
+ // the EventHandler this event is registered at
+ EventHandler& mrEventHandler;
+
+ public:
+ // basic constructor.
+ BaseEvent(EventHandler& rEventHandler);
+
+ // destructor
+ virtual ~BaseEvent();
+
+ // the called method if the event is triggered
+ virtual void ExecuteEvent() = 0;
+ };
+ } // end of namespace event
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace event
+ {
+ class EventHandler
+ {
+ BaseEventVector maVector;
+
+ // to allow BaseEvents to use the add/remove functionality
+ friend class BaseEvent;
+
+ // methods to add/remove events. These are private since
+ // they are used from BaseEvent only.
+ void AddEvent(BaseEvent& rBaseEvent);
+ void RemoveEvent(BaseEvent& rBaseEvent);
+
+ // access to a event, 0L when no more events
+ BaseEvent* GetEvent();
+
+ public:
+ // basic constructor.
+ EventHandler();
+
+ // destructor
+ virtual ~EventHandler();
+
+ // Trigger and consume the events
+ virtual void ExecuteEvents();
+
+ // for control
+ bool IsEmpty() const;
+ };
+ } // end of namespace event
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace event
+ {
+ class TimerEventHandler : public EventHandler, public Timer
+ {
+ public:
+ // basic constructor.
+ TimerEventHandler(sal_uInt32 nTimeout = 1L);
+
+ // destructor
+ virtual ~TimerEventHandler();
+
+ // The timer when it is triggered; from class Timer
+ virtual void Timeout();
+
+ // reset the timer
+ void Restart();
+ };
+ } // end of namespace event
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_EVENT_EVENTHANDLER_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 000000000000..756d2dac3731
--- /dev/null
+++ b/include/svx/sdr/overlay/overlayanimatedbitmapex.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 _SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX
+#define _SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <vcl/bitmapex.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class SVX_DLLPUBLIC OverlayAnimatedBitmapEx : public OverlayObjectWithBasePosition
+ {
+ protected:
+ // 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;
+
+ // bitfield
+ // Flag to remember which state to draw. Inited with sal_False (0)
+ unsigned mbOverlayState : 1;
+
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ // #i53216# check blink time value range (currently 25 < mnBlinkTime < 10000)
+ void impCheckBlinkTimeValueRange();
+
+ public:
+ OverlayAnimatedBitmapEx(
+ const basegfx::B2DPoint& rBasePos,
+ const BitmapEx& rBitmapEx1,
+ const BitmapEx& rBitmapEx2,
+ sal_uInt32 nBlinkTime = 500,
+ sal_uInt16 nCenX1 = 0,
+ sal_uInt16 nCenY1 = 0,
+ sal_uInt16 nCenX2 = 0,
+ sal_uInt16 nCenY2 = 0);
+ virtual ~OverlayAnimatedBitmapEx();
+
+ const BitmapEx& getBitmapEx1() const { return maBitmapEx1; }
+ const BitmapEx& getBitmapEx2() const { return maBitmapEx2; }
+
+ sal_uInt16 getCenterX1() const { return mnCenterX1; }
+ sal_uInt16 getCenterY1() const { return mnCenterY1; }
+ sal_uInt16 getCenterX2() const { return mnCenterX2; }
+ sal_uInt16 getCenterY2() const { return mnCenterY2; }
+
+ // #i53216# added CursorBlinkTime (in ms)
+ sal_uInt32 getBlinkTime() const { return mnBlinkTime; }
+
+ // 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);
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..bd841c6b4255
--- /dev/null
+++ b/include/svx/sdr/overlay/overlaybitmapex.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 _SDR_OVERLAY_OVERLAYBITMAPEX_HXX
+#define _SDR_OVERLAY_OVERLAYBITMAPEX_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <vcl/bitmapex.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class SVX_DLLPUBLIC OverlayBitmapEx : public OverlayObjectWithBasePosition
+ {
+ protected:
+ // the Bitmap itself
+ BitmapEx maBitmapEx;
+
+ // position of the basePosition inside the Bitmap, in pixels
+ sal_uInt16 mnCenterX;
+ sal_uInt16 mnCenterY;
+
+ // optional transparency
+ double mfAlpha;
+
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ OverlayBitmapEx(
+ const basegfx::B2DPoint& rBasePos,
+ const BitmapEx& rBitmapEx,
+ sal_uInt16 nCenX = 0, sal_uInt16 nCenY = 0, double fAlpha = 0.0 );
+ virtual ~OverlayBitmapEx();
+
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
+
+ sal_uInt16 getCenterX() const { return mnCenterX; }
+ sal_uInt16 getCenterY() const { return mnCenterY; }
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYBITMAPEX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/overlay/overlaycrosshair.hxx b/include/svx/sdr/overlay/overlaycrosshair.hxx
new file mode 100644
index 000000000000..436705536819
--- /dev/null
+++ b/include/svx/sdr/overlay/overlaycrosshair.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 _SDR_OVERLAY_OVERLAYCROSSHAIR_HXX
+#define _SDR_OVERLAY_OVERLAYCROSSHAIR_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class OverlayCrosshairStriped : public OverlayObjectWithBasePosition
+ {
+ protected:
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ explicit OverlayCrosshairStriped(const basegfx::B2DPoint& rBasePos);
+ virtual ~OverlayCrosshairStriped();
+
+ // react on stripe definition change
+ virtual void stripeDefinitionHasChanged();
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYCROSSHAIR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/overlay/overlayhatchrect.hxx b/include/svx/sdr/overlay/overlayhatchrect.hxx
new file mode 100644
index 000000000000..7f01c3537e42
--- /dev/null
+++ b/include/svx/sdr/overlay/overlayhatchrect.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 _SDR_OVERLAY_OVERLAYHATCHRECT_HXX
+#define _SDR_OVERLAY_OVERLAYHATCHRECT_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <vcl/hatch.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+class PolyPolygon;
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class OverlayHatchRect : public OverlayObjectWithBasePosition
+ {
+ // geometric definitions
+ basegfx::B2DPoint maSecondPosition;
+ const double mfDiscreteGrow;
+ const double mfDiscreteShrink;
+ const double mfHatchRotation;
+ const double mfRotation;
+
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ OverlayHatchRect(
+ const basegfx::B2DPoint& rBasePosition,
+ const basegfx::B2DPoint& rSecondPosition,
+ const Color& rHatchColor,
+ double fDiscreteGrow,
+ double fDiscreteShrink,
+ double fHatchRotation,
+ double fRotation);
+
+ const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; }
+
+ // data read access
+ double getDiscreteGrow() const { return mfDiscreteGrow; }
+ double getDiscreteShrink() const { return mfDiscreteShrink; }
+ double getHatchRotation() const { return mfHatchRotation; }
+ double getRotation() const { return mfRotation; }
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYHATCHRECT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/overlay/overlayhelpline.hxx b/include/svx/sdr/overlay/overlayhelpline.hxx
new file mode 100644
index 000000000000..3ab10df10626
--- /dev/null
+++ b/include/svx/sdr/overlay/overlayhelpline.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 _SDR_OVERLAY_OVERLAYHELPLINE_HXX
+#define _SDR_OVERLAY_OVERLAYHELPLINE_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <svx/svdhlpln.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class OverlayHelplineStriped : public OverlayObjectWithBasePosition
+ {
+ protected:
+ // remember HelpLineKind
+ SdrHelpLineKind meKind;
+
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ explicit OverlayHelplineStriped(
+ const basegfx::B2DPoint& rBasePos,
+ SdrHelpLineKind eNewKind = SDRHELPLINE_POINT);
+ virtual ~OverlayHelplineStriped();
+
+ // dat read access
+ SdrHelpLineKind getKind() const { return meKind; }
+
+ // react on stripe definition change
+ virtual void stripeDefinitionHasChanged();
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYHELPLINE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/overlay/overlayline.hxx b/include/svx/sdr/overlay/overlayline.hxx
new file mode 100644
index 000000000000..8b093fecbfb4
--- /dev/null
+++ b/include/svx/sdr/overlay/overlayline.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 _SDR_OVERLAY_OVERLAYLINE_HXX
+#define _SDR_OVERLAY_OVERLAYLINE_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class OverlayLineStriped : public OverlayObjectWithBasePosition
+ {
+ protected:
+ // second position in pixel
+ basegfx::B2DPoint maSecondPosition;
+
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ OverlayLineStriped(
+ const basegfx::B2DPoint& rBasePos,
+ const basegfx::B2DPoint& rSecondPos);
+ virtual ~OverlayLineStriped();
+
+ // change second position
+ const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; }
+
+ // react on stripe definition change
+ virtual void stripeDefinitionHasChanged();
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYLINE_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 000000000000..e2c23b5dc6df
--- /dev/null
+++ b/include/svx/sdr/overlay/overlaymanager.hxx
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDR_OVERLAY_OVERLAYMANAGER_HXX
+#define _SDR_OVERLAY_OVERLAYMANAGER_HXX
+
+#include <boost/utility.hpp>
+#include <rtl/ref.hxx>
+#include <svx/sdr/animation/scheduler.hxx>
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <vcl/mapmod.hxx>
+#include <tools/color.hxx>
+#include "svx/svxdllapi.h"
+#include <svtools/optionsdrawinglayer.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class OutputDevice;
+class Region;
+
+namespace sdr { namespace overlay {
+ class OverlayObject;
+}}
+
+namespace basegfx {
+ class B2DRange;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class SVX_DLLPUBLIC OverlayManager
+ : private boost::noncopyable
+ , protected ::sdr::animation::Scheduler
+ , public rtl::IReference
+ {
+ private:
+ oslInterlockedCount mnRefCount;
+ protected:
+ // the OutputDevice to work on, set on construction and not to be changed
+ OutputDevice& rmOutputDevice;
+
+ // 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 Color(COL_BLACK)
+ Color maStripeColorB; // defaults to Color(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;
+
+ OverlayManager(OutputDevice& rOutputDevice);
+ virtual ~OverlayManager();
+
+ public:
+ static rtl::Reference<OverlayManager> create(OutputDevice& rOutputDevice);
+
+ // access to current ViewInformation2D; this call checks and evtl. updates ViewInformation2D
+ const drawinglayer::geometry::ViewInformation2D getCurrentViewInformation2D() const;
+
+ // complete redraw
+ virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0) const;
+
+ // flush. Do buffered updates.
+ virtual void flush();
+
+ // #i68597# part of content gets copied, react on it
+ virtual void copyArea(const Point& rDestPt, const Point& rSrcPt, const Size& rSrcSize);
+
+ // restore part of background. Implemented form buffered versions only.
+ virtual void restoreBackground(const Region& rRegion) const;
+
+ // get the OutputDevice
+ OutputDevice& getOutputDevice() const { return rmOutputDevice; }
+
+ // 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
+ Color getStripeColorA() const { return maStripeColorA; }
+ void setStripeColorA(Color aNew= Color(COL_BLACK));
+
+ // stripe support ColB
+ Color getStripeColorB() const { return maStripeColorB; }
+ void setStripeColorB(Color aNew = Color(COL_WHITE));
+
+ // stripe support StripeLengthPixel
+ sal_uInt32 getStripeLengthPixel() const { return mnStripeLengthPixel; }
+ void setStripeLengthPixel(sal_uInt32 nNew = 5L);
+
+ // access to maDrawinglayerOpt
+ const SvtOptionsDrawinglayer& getDrawinglayerOpt() const { return maDrawinglayerOpt; }
+
+ void InsertEvent(sdr::animation::Event* pNew) { Scheduler::InsertEvent(pNew); }
+
+ virtual oslInterlockedCount SAL_CALL acquire();
+ virtual oslInterlockedCount SAL_CALL release();
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYMANAGER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/overlay/overlaymanagerbuffered.hxx b/include/svx/sdr/overlay/overlaymanagerbuffered.hxx
new file mode 100644
index 000000000000..7f6dbe05d9e6
--- /dev/null
+++ b/include/svx/sdr/overlay/overlaymanagerbuffered.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 _SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX
+#define _SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX
+
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <basegfx/range/b2irange.hxx>
+#include <vcl/virdev.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class OverlayManagerBuffered : public OverlayManager
+ {
+ protected:
+ // The VirtualDevice for draw window content buffering, this
+ // is the view content without overlay
+ VirtualDevice maBufferDevice;
+
+ // #i73602# The VirtualDevice for OverlayPaint buffering. This
+ // is an extra device to avoid flickering of overlay paints
+ VirtualDevice maOutputBufferDevice;
+
+ // Timer for buffering
+ Timer maBufferTimer;
+
+ // Range for buffering (in pixel to be independent from mapMode)
+ basegfx::B2IRange maBufferRememberedRangePixel;
+
+ // bitfield
+ // Flag to decide if PreRendering shall be used for overlay refreshes.
+ // Default is false.
+ unsigned mbRefreshWithPreRendering : 1;
+
+ // link for timer
+ DECL_LINK(ImpBufferTimerHandler, AutoTimer*);
+
+ // Internal methods for buffering
+ void ImpPrepareBufferDevice();
+ void ImpRestoreBackground() const ;
+ void ImpRestoreBackground(const Region& rRegionPixel) const;
+ void ImpSaveBackground(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L);
+
+ OverlayManagerBuffered(
+ OutputDevice& rOutputDevice,
+ bool bRefreshWithPreRendering = false);
+ virtual ~OverlayManagerBuffered();
+
+ public:
+ static rtl::Reference<OverlayManager> create(OutputDevice& rOutputDevice,
+ bool bRefreshWithPreRendering = false);
+
+ // complete redraw
+ virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L) const;
+
+ // flush. Do buffered updates.
+ virtual void flush();
+
+ // #i68597# part of content gets copied, react on it
+ virtual void copyArea(const Point& rDestPt, const Point& rSrcPt, const Size& rSrcSize);
+
+ // restore part of background. Implemented form buffered versions only.
+ virtual void restoreBackground(const Region& rRegion) const;
+
+ // invalidate the given range at local OutputDevice
+ virtual void invalidateRange(const basegfx::B2DRange& rRange);
+
+ // access to RefreshWithPreRendering Flag
+ bool DoRefreshWithPreRendering() const { return mbRefreshWithPreRendering; }
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_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 000000000000..263e9a9ab57c
--- /dev/null
+++ b/include/svx/sdr/overlay/overlayobject.hxx
@@ -0,0 +1,196 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDR_OVERLAY_OVERLAYOBJECT_HXX
+#define _SDR_OVERLAY_OVERLAYOBJECT_HXX
+
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <tools/color.hxx>
+#include <rtl/ref.hxx>
+#include <svx/sdr/animation/scheduler.hxx>
+#include "svx/svxdllapi.h"
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class OutputDevice;
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class OverlayManager;
+ } // end of namespace overlay
+} // end of namespace sdr
+
+namespace basegfx
+{
+ class B2DPolygon;
+ class B2DPolyPolygon;
+ class B2DRange;
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class SVX_DLLPUBLIC OverlayObject : private ::boost::noncopyable, public ::sdr::animation::Event
+ {
+ private:
+ // Manager is allowed access to private Member mpOverlayManager
+ friend class OverlayManager;
+
+ // pointer to OverlayManager, if object is added. Changed by
+ // OverlayManager, do not chnge Yourself.
+ OverlayManager* mpOverlayManager;
+
+ // Primitive2DSequence of the OverlayObject
+ drawinglayer::primitive2d::Primitive2DSequence maPrimitive2DSequence;
+
+ 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.
+ const drawinglayer::primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
+ void setPrimitive2DSequence(const drawinglayer::primitive2d::Primitive2DSequence& rNew) { maPrimitive2DSequence = rNew; }
+
+ // the creation method for Primitive2DSequence. 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::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ // region in logical coordinates
+ basegfx::B2DRange maBaseRange;
+
+ // base color of this OverlayObject
+ Color maBaseColor;
+
+ // bitfield
+ // Flag for visibility
+ unsigned mbIsVisible : 1;
+
+ // Flag to control hittability
+ unsigned mbIsHittable : 1;
+
+ // Flag to hold info if this objects supports animation. Default is
+ // false. If true, the Trigger() method should be overloaded
+ // to implement the animation effect and to re-initiate the event.
+ unsigned mbAllowsAnimation : 1;
+
+ // Flag tocontrol if this OverlayObject allows AntiAliased visualisation.
+ // Default is true, but e.g. for selection visualisation in SC and SW,
+ // it is switched to false
+ unsigned 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.
+ virtual void objectChange();
+
+ // write access to AntiAliase flag. This is protected since
+ // only implementations are allowed to change this, preferrably in their
+ // constructor
+ void allowAntiAliase(bool bNew);
+
+ public:
+ explicit OverlayObject(Color aBaseColor);
+ virtual ~OverlayObject();
+
+ // get OverlayManager
+ OverlayManager* getOverlayManager() const { return mpOverlayManager; }
+
+ // the access method for Primitive2DSequence. Will use createPrimitive2DSequence and
+ // setPrimitive2DSequence if needed. Overloading may be used to allow disposal of last
+ // created primitives to react on changed circumstances and to re-create primitives
+ virtual drawinglayer::primitive2d::Primitive2DSequence 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
+ Color getBaseColor() const { return maBaseColor; }
+ void setBaseColor(Color aNew);
+
+ // 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);
+
+ // acces 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 SVX_DLLPUBLIC OverlayObjectWithBasePosition : public OverlayObject
+ {
+ protected:
+ // base position in logical coordinates
+ basegfx::B2DPoint maBasePosition;
+
+ public:
+ OverlayObjectWithBasePosition(const basegfx::B2DPoint& rBasePos, Color aBaseColor);
+ virtual ~OverlayObjectWithBasePosition();
+
+ // 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 //_SDR_OVERLAY_OVERLAYOBJECT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/overlay/overlayobjectcell.hxx b/include/svx/sdr/overlay/overlayobjectcell.hxx
new file mode 100644
index 000000000000..6707c0fc61eb
--- /dev/null
+++ b/include/svx/sdr/overlay/overlayobjectcell.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 _SDR_OVERLAY_OVERLAYOBJECTCELL_HXX
+#define _SDR_OVERLAY_OVERLAYOBJECTCELL_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+
+// #114409#
+namespace sdr
+{
+ namespace overlay
+ {
+ enum CellOverlayType { CELL_OVERLAY_INVERT, CELL_OVERLAY_TRANSPARENT };
+
+ // OverlayObjectCell - used for cell cursor, selection and AutoFill handle
+
+ class SVX_DLLPUBLIC OverlayObjectCell : public OverlayObject
+ {
+ public:
+ typedef ::std::vector< basegfx::B2DRange > RangeVector;
+
+ private:
+ CellOverlayType mePaintType;
+ RangeVector maRectangles;
+
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ OverlayObjectCell( CellOverlayType eType, const Color& rColor, const RangeVector& rRects);
+ virtual ~OverlayObjectCell();
+ };
+
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYLINE_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 000000000000..ea75ace1e94a
--- /dev/null
+++ b/include/svx/sdr/overlay/overlayobjectlist.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 _SDR_OVERLAY_OVERLAYOBJECTLIST_HXX
+#define _SDR_OVERLAY_OVERLAYOBJECTLIST_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <sal/types.h>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+
+#define DEFAULT_VALUE_FOR_HITTEST_PIXEL (2L)
+
+//////////////////////////////////////////////////////////////////////////////
+
+class Point;
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class SVX_DLLPUBLIC OverlayObjectList
+ {
+ protected:
+ // the vector of OverlayObjects
+ OverlayObjectVector maVector;
+
+ // default value for HiTestPixel
+ sal_uInt32 getDefaultValueForHitTestPixel() const { return 4L; }
+
+ public:
+ OverlayObjectList() {}
+ ~OverlayObjectList();
+
+ // clear list, this includes deletion of all contained objects
+ void clear();
+
+ // append objects
+ void append(OverlayObject& rOverlayObject) { maVector.push_back(&rOverlayObject); }
+
+ // 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 and pixel tolerance
+ bool isHitPixel(const Point& rDiscretePosition, sal_uInt32 fDiscreteTolerance = DEFAULT_VALUE_FOR_HITTEST_PIXEL) const;
+
+ // calculate BaseRange of all included OverlayObjects and return
+ basegfx::B2DRange getBaseRange() const;
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..d7dd82751f53
--- /dev/null
+++ b/include/svx/sdr/overlay/overlaypolypolygon.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 _SDR_OVERLAY_OVERLAYPOLYPOLYGON_HXX
+#define _SDR_OVERLAY_OVERLAYPOLYPOLYGON_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class SVX_DLLPUBLIC OverlayPolyPolygonStriped : public OverlayObject
+ {
+ protected:
+ // geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ explicit OverlayPolyPolygonStriped(const basegfx::B2DPolyPolygon& rPolyPolygon);
+ virtual ~OverlayPolyPolygonStriped();
+
+ // change geometry
+ basegfx::B2DPolyPolygon getPolyPolygon() const { return maPolyPolygon; }
+
+ // react on stripe definition change
+ virtual void stripeDefinitionHasChanged();
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..a2e981c2c1a8
--- /dev/null
+++ b/include/svx/sdr/overlay/overlayprimitive2dsequenceobject.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 _SDR_OVERLAY_OVERLAYPRIMITIVE2DSEQUENCEOBJECT_HXX
+#define _SDR_OVERLAY_OVERLAYPRIMITIVE2DSEQUENCEOBJECT_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class SVX_DLLPUBLIC OverlayPrimitive2DSequenceObject : public OverlayObjectWithBasePosition
+ {
+ protected:
+ // the sequence of primitives to show
+ const drawinglayer::primitive2d::Primitive2DSequence maSequence;
+
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ private:
+ // internal helper to create a drawinglayer::geometry::ViewInformation2D
+ // using a OutputDevice and local knowledge
+ drawinglayer::geometry::ViewInformation2D impCreateViewInformation2D(OutputDevice& rOutputDevice) const;
+
+ public:
+ explicit OverlayPrimitive2DSequenceObject(const drawinglayer::primitive2d::Primitive2DSequence& rSequence);
+
+ virtual ~OverlayPrimitive2DSequenceObject();
+
+ // data read access
+ const drawinglayer::primitive2d::Primitive2DSequence& getSequence() const { return maSequence; }
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYPRIMITIVE2DSEQUENCEOBJECT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/overlay/overlayrollingrectangle.hxx b/include/svx/sdr/overlay/overlayrollingrectangle.hxx
new file mode 100644
index 000000000000..3a896aa3cdd8
--- /dev/null
+++ b/include/svx/sdr/overlay/overlayrollingrectangle.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 _SDR_OVERLAY_OVERLAYROOLINGRECTANGLE_HXX
+#define _SDR_OVERLAY_OVERLAYROOLINGRECTANGLE_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class OverlayRollingRectangleStriped : public OverlayObjectWithBasePosition
+ {
+ protected:
+ // second position in pixel
+ basegfx::B2DPoint maSecondPosition;
+
+ // bitfield
+ // Flag to switch on/off long lines to the OutputDevice bounds
+ unsigned mbExtendedLines : 1;
+
+ // Flag to switch on/off the bounds itself
+ unsigned mbShowBounds : 1;
+
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ OverlayRollingRectangleStriped(
+ const basegfx::B2DPoint& rBasePos,
+ const basegfx::B2DPoint& rSecondPos,
+ bool bExtendedLines = false,
+ bool bShowBounds = true);
+ virtual ~OverlayRollingRectangleStriped();
+
+ // change second position
+ const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; }
+ void setSecondPosition(const basegfx::B2DPoint& rNew);
+
+ // change extended lines
+ bool getExtendedLines() const { return mbExtendedLines; }
+
+ // change show bounds
+ bool getShowBounds() const { return mbShowBounds; }
+
+ // react on stripe definition change
+ virtual void stripeDefinitionHasChanged();
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYROOLINGRECTANGLE_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 000000000000..e96b8fa3281d
--- /dev/null
+++ b/include/svx/sdr/overlay/overlayselection.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 _SDR_OVERLAY_OVERLAYSELECTION_HXX
+#define _SDR_OVERLAY_OVERLAYSELECTION_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <vcl/region.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ // overlay type definition
+ enum OverlayType
+ {
+ OVERLAY_INVERT,
+ OVERLAY_SOLID,
+ OVERLAY_TRANSPARENT
+ };
+
+ class SVX_DLLPUBLIC OverlaySelection : public OverlayObject
+ {
+ protected:
+ // 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 Primitive2DSequence. This ensures that these values are up-to-date
+ // and are usable when creating primitives
+ OverlayType maLastOverlayType;
+ sal_uInt16 mnLastTransparence;
+
+ // bitfield
+ unsigned mbBorder : 1;
+
+ // geometry creation for OverlayObject, can use local *Last* values
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ OverlaySelection(
+ OverlayType eType,
+ const Color& rColor,
+ const std::vector< basegfx::B2DRange >& rRanges,
+ bool bBorder);
+ virtual ~OverlaySelection();
+
+ // data read access
+ OverlayType getOverlayType() const { return meOverlayType; }
+ const std::vector< basegfx::B2DRange >& getRanges() const { return maRanges; }
+ bool getBorder() const { return mbBorder; }
+
+ // overloaded to check conditions for last createOverlayObjectPrimitive2DSequence
+ virtual drawinglayer::primitive2d::Primitive2DSequence getOverlayObjectPrimitive2DSequence() const;
+
+ // data write access
+ void setRanges(const std::vector< basegfx::B2DRange >& rNew);
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYSELECTION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/overlay/overlaytools.hxx b/include/svx/sdr/overlay/overlaytools.hxx
new file mode 100644
index 000000000000..665d445e2d46
--- /dev/null
+++ b/include/svx/sdr/overlay/overlaytools.hxx
@@ -0,0 +1,270 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDR_OVERLAY_OVERLAYTOOLS_HXX
+#define _SDR_OVERLAY_OVERLAYTOOLS_HXX
+
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
+#include <vcl/bitmapex.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// Overlay helper class which holds a BotmapEx which is to be visualized
+// at the given logic position with the Bitmap's pixel size, unscaled and
+// unrotated (like a marker). The discrete pixel on the bitmap assocciated
+// with the target position is given in discrete X,Y coordinates
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class OverlayBitmapExPrimitive : public DiscreteMetricDependentPrimitive2D
+ {
+ private:
+ // The BitmapEx to use, PixelSize is used
+ BitmapEx maBitmapEx;
+
+ // The logic position
+ basegfx::B2DPoint maBasePosition;
+
+ // The pixel inside the BitmapEx which is assocciated with
+ // the target position (offset in the bitmap)
+ sal_uInt16 mnCenterX;
+ sal_uInt16 mnCenterY;
+
+ protected:
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ OverlayBitmapExPrimitive(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rBasePosition,
+ sal_uInt16 nCenterX,
+ sal_uInt16 nCenterY);
+
+ // data access
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
+ const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; }
+ sal_uInt16 getCenterX() const { return mnCenterX; }
+ sal_uInt16 getCenterY() const { return mnCenterY; }
+
+ // compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// Overlay helper class for a crosshair
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class OverlayCrosshairPrimitive : public ViewportDependentPrimitive2D
+ {
+ private:
+ // The logic position
+ basegfx::B2DPoint maBasePosition;
+
+ // The stripe colors and legth
+ basegfx::BColor maRGBColorA;
+ basegfx::BColor maRGBColorB;
+ double mfDiscreteDashLength;
+
+ protected:
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ OverlayCrosshairPrimitive(
+ const basegfx::B2DPoint& rBasePosition,
+ const basegfx::BColor& rRGBColorA,
+ const basegfx::BColor& rRGBColorB,
+ double fDiscreteDashLength);
+
+ // data access
+ const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; }
+ const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
+ const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
+ double getDiscreteDashLength() const { return mfDiscreteDashLength; }
+
+ // compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// Overlay helper class for a hatch rectangle as used e.g. for text object
+// selection hilighting
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class OverlayHatchRectanglePrimitive : public DiscreteMetricDependentPrimitive2D
+ {
+ private:
+ // the logic rectangle definition
+ basegfx::B2DRange maObjectRange;
+
+ // the hatch definition
+ double mfDiscreteHatchDistance;
+ double mfHatchRotation;
+ basegfx::BColor maHatchColor;
+
+ // the dscrete grow and shrink of the box
+ double mfDiscreteGrow;
+ double mfDiscreteShrink;
+
+ // the rotation of the primitive itself
+ double mfRotation;
+
+ protected:
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ OverlayHatchRectanglePrimitive(
+ const basegfx::B2DRange& rObjectRange,
+ double fDiscreteHatchDistance,
+ double fHatchRotation,
+ const basegfx::BColor& rHatchColor,
+ double fDiscreteGrow,
+ double fDiscreteShrink,
+ double fRotation);
+
+ // data access
+ const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
+ double getDiscreteHatchDistance() const { return mfDiscreteHatchDistance; }
+ double getHatchRotation() const { return mfHatchRotation; }
+ const basegfx::BColor& getHatchColor() const { return maHatchColor; }
+ double getDiscreteGrow() const { return mfDiscreteGrow; }
+ double getDiscreteShrink() const { return mfDiscreteShrink; }
+ double getRotation() const { return mfRotation; }
+
+ // compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// Overlay helper class for a striped helpline
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ enum HelplineStyle
+ {
+ HELPLINESTYLE_POINT,
+ HELPLINESTYLE_VERTICAL,
+ HELPLINESTYLE_HORIZONTAL
+ };
+
+ class OverlayHelplineStripedPrimitive : public ViewportDependentPrimitive2D
+ {
+ private:
+ // The logic position
+ basegfx::B2DPoint maBasePosition;
+
+ // the style
+ HelplineStyle meStyle;
+
+ // The stripe colors and legth
+ basegfx::BColor maRGBColorA;
+ basegfx::BColor maRGBColorB;
+ double mfDiscreteDashLength;
+
+ protected:
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ OverlayHelplineStripedPrimitive(
+ const basegfx::B2DPoint& rBasePosition,
+ HelplineStyle eStyle,
+ const basegfx::BColor& rRGBColorA,
+ const basegfx::BColor& rRGBColorB,
+ double fDiscreteDashLength);
+
+ // data access
+ const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; }
+ HelplineStyle getStyle() const { return meStyle; }
+ const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
+ const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
+ double getDiscreteDashLength() const { return mfDiscreteDashLength; }
+
+ // compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// Overlay helper class for rolling rectangle helplines. This primitive is
+// only for the extended lines to the ends of the view
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class OverlayRollingRectanglePrimitive : public ViewportDependentPrimitive2D
+ {
+ private:
+ // The logic range
+ basegfx::B2DRange maRollingRectangle;
+
+ // The stripe colors and legth
+ basegfx::BColor maRGBColorA;
+ basegfx::BColor maRGBColorB;
+ double mfDiscreteDashLength;
+
+ protected:
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ OverlayRollingRectanglePrimitive(
+ const basegfx::B2DRange& aRollingRectangle,
+ const basegfx::BColor& rRGBColorA,
+ const basegfx::BColor& rRGBColorB,
+ double fDiscreteDashLength);
+
+ // data access
+ const basegfx::B2DRange& getRollingRectangle() const { return maRollingRectangle; }
+ const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
+ const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
+ double getDiscreteDashLength() const { return mfDiscreteDashLength; }
+
+ // compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYTOOLS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/overlay/overlaytriangle.hxx b/include/svx/sdr/overlay/overlaytriangle.hxx
new file mode 100644
index 000000000000..b17e6be8a8c6
--- /dev/null
+++ b/include/svx/sdr/overlay/overlaytriangle.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 _SDR_OVERLAY_OVERLAYTRIANGLE_HXX
+#define _SDR_OVERLAY_OVERLAYTRIANGLE_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class OverlayTriangle : public OverlayObjectWithBasePosition
+ {
+ protected:
+ // second and third position in pixel
+ basegfx::B2DPoint maSecondPosition;
+ basegfx::B2DPoint maThirdPosition;
+
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ OverlayTriangle(
+ const basegfx::B2DPoint& rBasePos,
+ const basegfx::B2DPoint& rSecondPos,
+ const basegfx::B2DPoint& rThirdPos,
+ Color aTriangleColor);
+ virtual ~OverlayTriangle();
+
+ // change second position
+ const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; }
+
+ // change third position
+ const basegfx::B2DPoint& getThirdPosition() const { return maThirdPosition; }
+ };
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OVERLAY_OVERLAYTRIANGLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/primitiveFactory2d.hxx b/include/svx/sdr/primitive2d/primitiveFactory2d.hxx
new file mode 100644
index 000000000000..d602d28d4f5c
--- /dev/null
+++ b/include/svx/sdr/primitive2d/primitiveFactory2d.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_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX
+
+#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp>
+#include <cppuhelper/compbase1.hxx>
+#include <comphelper/broadcasthelper.hxx>
+
+#include <svx/svxdllapi.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// UNO API helper methods
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// PrimitiveFactory2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ // typedef for PrimitiveFactory2DImplBase
+ typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitiveFactory2D > PrimitiveFactory2DImplBase;
+
+ // base class for C++ implementation of com::sun::star::graphic::XPrimitiveFactory2D
+ class PrimitiveFactory2D
+ : protected comphelper::OBaseMutex,
+ public PrimitiveFactory2DImplBase
+ {
+ private:
+ protected:
+ public:
+ // constructor
+ PrimitiveFactory2D();
+
+ // Methods from XPrimitiveFactory2D
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXDrawPage( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException);
+
+ // UNO API helpers
+ SVX_DLLPUBLIC static OUString getImplementationName_Static();
+ SVX_DLLPUBLIC static com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static();
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrattributecreator.hxx b/include/svx/sdr/primitive2d/sdrattributecreator.hxx
new file mode 100644
index 000000000000..e3e940993790
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrattributecreator.hxx
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRATTRIBUTECREATOR_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDRATTRIBUTECREATOR_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+class SfxItemSet;
+class SdrText;
+
+namespace drawinglayer { namespace attribute {
+ class SdrLineAttribute;
+ class SdrLineStartEndAttribute;
+ class SdrShadowAttribute;
+ class SdrFillAttribute;
+ class SdrTextAttribute;
+ class FillGradientAttribute;
+ class SdrFillBitmapAttribute;
+ class SdrShadowTextAttribute;
+ class SdrLineShadowTextAttribute;
+ class SdrLineFillShadowTextAttribute;
+ class SdrLineFillShadowAttribute3D;
+ class SdrSceneAttribute;
+ class SdrLightingAttribute;
+ class SdrFillTextAttribute;
+}}
+
+namespace basegfx {
+ class B2DRange;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ // SdrAttribute creators
+ attribute::SdrLineAttribute createNewSdrLineAttribute(
+ const SfxItemSet& rSet);
+
+ attribute::SdrLineStartEndAttribute createNewSdrLineStartEndAttribute(
+ const SfxItemSet& rSet,
+ double fWidth);
+
+ attribute::SdrShadowAttribute createNewSdrShadowAttribute(
+ const SfxItemSet& rSet);
+
+ attribute::SdrFillAttribute createNewSdrFillAttribute(
+ const SfxItemSet& rSet);
+
+ // #i101508# Support handing over given text-to-border distances
+ attribute::SdrTextAttribute createNewSdrTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText& rText,
+ const sal_Int32* pLeft = 0,
+ const sal_Int32* pUpper = 0,
+ const sal_Int32* pRight = 0,
+ const sal_Int32* pLower = 0);
+
+ attribute::FillGradientAttribute createNewTransparenceGradientAttribute(
+ const SfxItemSet& rSet);
+
+ attribute::SdrFillBitmapAttribute createNewSdrFillBitmapAttribute(
+ const SfxItemSet& rSet);
+
+ attribute::SdrShadowTextAttribute createNewSdrShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText,
+ bool bSuppressText); // #i98072# added option to suppress text on demand
+
+ attribute::SdrLineShadowTextAttribute createNewSdrLineShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText);
+
+ attribute::SdrLineFillShadowTextAttribute createNewSdrLineFillShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText,
+ bool bHasContent); // used from OLE and graphic
+
+ attribute::SdrLineFillShadowAttribute3D createNewSdrLineFillShadowAttribute(
+ const SfxItemSet& rSet,
+ bool bSuppressFill);
+
+ attribute::SdrSceneAttribute createNewSdrSceneAttribute(
+ const SfxItemSet& rSet);
+
+ attribute::SdrLightingAttribute createNewSdrLightingAttribute(
+ const SfxItemSet& rSet);
+
+ // #i101508# Support handing over given text-to-border distances
+ attribute::SdrFillTextAttribute createNewSdrFillTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pSdrText,
+ const sal_Int32* pLeft = 0,
+ const sal_Int32* pUpper = 0,
+ const sal_Int32* pRight = 0,
+ const sal_Int32* pLower = 0);
+
+ // helpers
+ void calculateRelativeCornerRadius(
+ sal_Int32 nRadius,
+ const ::basegfx::B2DRange& rObjectRange,
+ double& rfCornerRadiusX,
+ double& rfCornerRadiusY);
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDRATTRIBUTECREATOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
new file mode 100644
index 000000000000..472c08861412
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrcaptionprimitive2d.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_SDR_PRIMITIVE2D_SDRCAPTIONPRIMITIVE2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDRCAPTIONPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrCaptionPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ ::basegfx::B2DHomMatrix maTransform;
+ attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute;
+ ::basegfx::B2DPolygon maTail;
+ double mfCornerRadiusX; // [0.0..1.0] relative to 1/2 width
+ double mfCornerRadiusY; // [0.0..1.0] relative to 1/2 height
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrCaptionPrimitive2D(
+ const ::basegfx::B2DHomMatrix& rTransform,
+ const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
+ const ::basegfx::B2DPolygon& rTail,
+ double fCornerRadiusX = 0.0,
+ double fCornerRadiusY = 0.0);
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // data access
+ const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
+ const ::basegfx::B2DPolygon& getTail() const { return maTail; }
+ double getCornerRadiusX() const { return mfCornerRadiusX; }
+ double getCornerRadiusY() const { return mfCornerRadiusY; }
+ bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDRCAPTIONPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx
new file mode 100644
index 000000000000..882c2895e0b8
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrconnectorprimitive2d.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_SDR_PRIMITIVE2D_SDRCONNECTORPRIMITIVE2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDRCONNECTORPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrConnectorPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ attribute::SdrLineShadowTextAttribute maSdrLSTAttribute;
+ ::basegfx::B2DPolygon maUnitPolygon;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrConnectorPrimitive2D(
+ const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute,
+ const ::basegfx::B2DPolygon& rUnitPolygon);
+
+ // data access
+ const attribute::SdrLineShadowTextAttribute& getSdrLSTAttribute() const { return maSdrLSTAttribute; }
+ const ::basegfx::B2DPolygon& getUnitPolygon() const { return maUnitPolygon; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDRCONNECTORPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
new file mode 100644
index 000000000000..a43bd2df72bd
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.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_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrCustomShapePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ attribute::SdrShadowTextAttribute maSdrSTAttribute;
+ Primitive2DSequence maSubPrimitives;
+ basegfx::B2DHomMatrix maTextBox;
+
+ // bitfield
+ // defines if SdrTextWordWrapItem was set at SdrObjCustomShape which means
+ // that the text needs to be block formatted
+ unsigned mbWordWrap : 1;
+
+ // defines that the object contains/is a 3D AutoShape. Needed for
+ // making exceptions with shadow generation
+ unsigned mb3DShape : 1;
+
+ // #SJ# Allow text clipping against TextBox in special cases (used for SC)
+ unsigned mbForceTextClipToTextRange : 1;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrCustomShapePrimitive2D(
+ const attribute::SdrShadowTextAttribute& rSdrSTAttribute,
+ const Primitive2DSequence& rSubPrimitives,
+ const basegfx::B2DHomMatrix& rTextBox,
+ bool bWordWrap,
+ bool b3DShape,
+ bool bForceTextClipToTextRange);
+
+ // data access
+ const attribute::SdrShadowTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; }
+ const Primitive2DSequence& getSubPrimitives() const { return maSubPrimitives; }
+ const basegfx::B2DHomMatrix& getTextBox() const { return maTextBox; }
+ bool getWordWrap() const { return mbWordWrap; }
+ bool get3DShape() const { return mb3DShape; }
+ bool isForceTextClipToTextRange() const { return mbForceTextClipToTextRange; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrdecompositiontools.hxx b/include/svx/sdr/primitive2d/sdrdecompositiontools.hxx
new file mode 100644
index 000000000000..cac426980dee
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrdecompositiontools.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_SDR_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+namespace basegfx {
+ class B2DPolygon;
+ class B2DPolyPolygon;
+ class B2DHomMatrix;
+}
+
+namespace drawinglayer { namespace attribute {
+ class SdrFillAttribute;
+ class SdrLineAttribute;
+ class FillGradientAttribute;
+ class SdrShadowAttribute;
+ class SdrLineStartEndAttribute;
+ class SdrTextAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DReference createPolyPolygonFillPrimitive(
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
+ const attribute::SdrFillAttribute& rFill,
+ const attribute::FillGradientAttribute& rFillGradient);
+
+ Primitive2DReference createPolygonLinePrimitive(
+ const basegfx::B2DPolygon& rUnitPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
+ const attribute::SdrLineAttribute& rLine,
+ const attribute::SdrLineStartEndAttribute& rStroke);
+
+ Primitive2DReference createTextPrimitive(
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
+ const attribute::SdrTextAttribute& rText,
+ const attribute::SdrLineAttribute& rStroke,
+ bool bCellText,
+ bool bWordWrap,
+ bool bClipOnBounds);
+
+ Primitive2DSequence createEmbeddedShadowPrimitive(
+ const Primitive2DSequence& rContent,
+ const attribute::SdrShadowAttribute& rShadow);
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx
new file mode 100644
index 000000000000..338fc52567c3
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrellipseprimitive2d.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_SDR_PRIMITIVE2D_SDRELLIPSEPRIMITIVE2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDRELLIPSEPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrEllipsePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ ::basegfx::B2DHomMatrix maTransform;
+ attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrEllipsePrimitive2D(
+ const ::basegfx::B2DHomMatrix& rTransform,
+ const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute);
+
+ // data access
+ const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrEllipseSegmentPrimitive2D : public SdrEllipsePrimitive2D
+ {
+ private:
+ double mfStartAngle;
+ double mfEndAngle;
+
+ // bitfield
+ unsigned mbCloseSegment : 1;
+ unsigned mbCloseUsingCenter : 1;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrEllipseSegmentPrimitive2D(
+ const ::basegfx::B2DHomMatrix& rTransform,
+ const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
+ double fStartAngle,
+ double fEndAngle,
+ bool bCloseSegment,
+ bool bCloseUsingCenter);
+
+ // data access
+ double getStartAngle() const { return mfStartAngle; }
+ double getEndAngle() const { return mfEndAngle; }
+ bool getCloseSegment() const { return mbCloseSegment; }
+ bool getCloseUsingCenter() const { return mbCloseUsingCenter; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDRELLIPSEPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx
new file mode 100644
index 000000000000..dfb098e9c010
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrgrafprimitive2d.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_SDR_PRIMITIVE2D_SDRGRAFPRIMITIVE2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDRGRAFPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svtools/grfmgr.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrGrafPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ ::basegfx::B2DHomMatrix maTransform;
+ attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute;
+ GraphicObject maGraphicObject;
+ GraphicAttr maGraphicAttr;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrGrafPrimitive2D(
+ const ::basegfx::B2DHomMatrix& rTransform,
+ const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
+ const GraphicObject& rGraphicObject,
+ const GraphicAttr& rGraphicAttr);
+
+ // data access
+ const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
+ const GraphicObject& getGraphicObject() const { return maGraphicObject; }
+ const GraphicAttr& getGraphicAttr() const { return maGraphicAttr; }
+ bool isTransparent() const;
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDRGRAFPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
new file mode 100644
index 000000000000..592f14afe742
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrmeasureprimitive2d.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_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace primitive2d {
+ enum MeasureTextPosition
+ {
+ MEASURETEXTPOSITION_AUTOMATIC,
+ MEASURETEXTPOSITION_NEGATIVE,
+ MEASURETEXTPOSITION_CENTERED,
+ MEASURETEXTPOSITION_POSITIVE
+ };
+}}
+
+namespace drawinglayer { namespace attribute {
+ class SdrLineAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrMeasurePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ attribute::SdrLineShadowTextAttribute maSdrLSTAttribute;
+ basegfx::B2DPoint maStart;
+ basegfx::B2DPoint maEnd;
+ MeasureTextPosition meHorizontal;
+ MeasureTextPosition meVertical;
+ double mfDistance;
+ double mfUpper;
+ double mfLower;
+ double mfLeftDelta;
+ double mfRightDelta;
+
+ // bitfield
+ unsigned mbBelow : 1;
+ unsigned mbTextRotation : 1;
+ unsigned mbTextAutoAngle : 1;
+
+ // internal decomposition helper
+ Primitive2DReference impCreatePart(
+ const attribute::SdrLineAttribute& rLineAttribute,
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
+ bool bLeftActive,
+ bool bRightActive) const;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrMeasurePrimitive2D(
+ const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
+ MeasureTextPosition eHorizontal,
+ MeasureTextPosition eVertical,
+ double fDistance,
+ double fUpper,
+ double fLower,
+ double fLeftDelta,
+ double fRightDelta,
+ bool bBelow,
+ bool bTextRotation,
+ bool bTextAutoAngle);
+
+ // data access
+ const attribute::SdrLineShadowTextAttribute& getSdrLSTAttribute() const { return maSdrLSTAttribute; }
+ const basegfx::B2DPoint& getStart() const { return maStart; }
+ const basegfx::B2DPoint& getEnd() const { return maEnd; }
+ MeasureTextPosition getHorizontal() const { return meHorizontal; }
+ MeasureTextPosition getVertical() const { return meVertical; }
+ double getDistance() const { return mfDistance; }
+ double getUpper() const { return mfUpper; }
+ double getLower() const { return mfLower; }
+ double getLeftDelta() const { return mfLeftDelta; }
+ double getRightDelta() const { return mfRightDelta; }
+ bool getBelow() const { return mbBelow; }
+ bool getTextRotation() const { return mbTextRotation; }
+ bool getTextAutoAngle() const { return mbTextAutoAngle; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrole2primitive2d.hxx b/include/svx/sdr/primitive2d/sdrole2primitive2d.hxx
new file mode 100644
index 000000000000..0ab554706493
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrole2primitive2d.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_SDR_PRIMITIVE2D_SDROLE2PRIMITIVE2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDROLE2PRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrOle2Primitive2D : public BasePrimitive2D
+ {
+ private:
+ Primitive2DSequence maOLEContent;
+ basegfx::B2DHomMatrix maTransform;
+ attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute;
+
+ public:
+ SdrOle2Primitive2D(
+ const Primitive2DSequence& rOLEContent,
+ const basegfx::B2DHomMatrix& rTransform,
+ const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute);
+
+ // data access
+ const Primitive2DSequence& getOLEContent() const { return maOLEContent; }
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // local decomposition.
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDROLE2PRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx
new file mode 100644
index 000000000000..2dfe0243717a
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrolecontentprimitive2d.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_SDR_PRIMITIVE2D_SdrOleContentPrimitive2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/svdobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefinitions
+
+class SdrOle2Obj;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrOleContentPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ SdrObjectWeakRef mpSdrOle2Obj;
+ basegfx::B2DHomMatrix maObjectTransform;
+
+ // #i104867# The GraphicVersion number to identify in operator== if
+ // the graphic has changed, but without fetching it (which may
+ // be expensive, e.g. triggering chart creation)
+ sal_uInt32 mnGraphicVersion;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrOleContentPrimitive2D(
+ const SdrOle2Obj& rSdrOle2Obj,
+ const basegfx::B2DHomMatrix& rObjectTransform,
+ sal_uInt32 nGraphicVersion
+ );
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // The default implementation will use getDecomposition results to create the range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ // data access
+ const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; }
+ sal_uInt32 getGraphicVersion() const { return mnGraphicVersion; }
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDROLECONTENTPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrpathprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrpathprimitive2d.hxx
new file mode 100644
index 000000000000..a4047bbe3d78
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrpathprimitive2d.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_SDR_PRIMITIVE2D_SDRPATHPRIMITIVE2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDRPATHPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrPathPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ basegfx::B2DHomMatrix maTransform;
+ attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute;
+ basegfx::B2DPolyPolygon maUnitPolyPolygon;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrPathPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon);
+
+ // data access
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
+ const basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDRPATHPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrprimitivetools.hxx b/include/svx/sdr/primitive2d/sdrprimitivetools.hxx
new file mode 100644
index 000000000000..885b9c945da5
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrprimitivetools.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_SDR_PRIMITIVE2D_PRIMITIVETOOLS_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_PRIMITIVETOOLS_HXX
+
+#include <vcl/bitmapex.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// helper methods
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ // create a 3x3 cross in given color as BitmapEx
+ BitmapEx createDefaultCross_3x3(const basegfx::BColor& rBColor);
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_PRIMITIVETOOLS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
new file mode 100644
index 000000000000..4c685497b1bc
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRRECTANGLEPRIMITIVE2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDRRECTANGLEPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrRectanglePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ basegfx::B2DHomMatrix maTransform;
+ attribute::SdrLineFillShadowTextAttribute maSdrLFSTAttribute;
+ double mfCornerRadiusX; // [0.0..1.0] relative to 1/2 width
+ double mfCornerRadiusY; // [0.0..1.0] relative to 1/2 height
+
+ // bitfield
+ // flag which decides if the HitArea should be the filled geometry
+ bool mbForceFillForHitTest : 1;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrRectanglePrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
+ double fCornerRadiusX,
+ double fCornerRadiusY,
+ bool bForceFillForHitTest);
+
+ // data access
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
+ double getCornerRadiusX() const { return mfCornerRadiusX; }
+ double getCornerRadiusY() const { return mfCornerRadiusY; }
+ bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
+ bool getForceFillForHitTest() const { return mbForceFillForHitTest; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDRRECTANGLEPRIMITIVE2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive2d/sdrtextprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrtextprimitive2d.hxx
new file mode 100644
index 000000000000..37264692f2d8
--- /dev/null
+++ b/include/svx/sdr/primitive2d/sdrtextprimitive2d.hxx
@@ -0,0 +1,338 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX
+#define INCLUDED_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <editeng/outlobj.hxx>
+#include <tools/color.hxx>
+#include <svx/sdr/attribute/sdrformtextattribute.hxx>
+#include <tools/weakbase.hxx>
+#include <svx/sdtaitm.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+class SdrText;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrTextPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ // The text model data; this sould later just be the OutlinerParaObject or
+ // something equal
+ ::tools::WeakReference< SdrText > mrSdrText;
+
+ // #i97628#
+ // The text content; now as local OutlinerParaObject copy (internally RefCounted and
+ // COW) and in exclusive, local form as needed in a primitive
+ const OutlinerParaObject maOutlinerParaObject;
+
+ // remember last VisualizingPage for which a decomposition was made. If the new target
+ // is not given or different, the decomposition needs to be potentially removed
+ // for supporting e.g. page number change on MasterPage objects or the different
+ // field renderings in SubGeometry and MasterPage mnode
+ com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > mxLastVisualizingPage;
+
+ // remember last PageNumber for which a decomposition was made. This is only used
+ // when mbContainsPageField is true, else it is 0
+ sal_Int16 mnLastPageNumber;
+
+ // remember last PageCount for which a decomposition was made. This is only used
+ // when mbContainsPageCountField is true, else it is 0
+ sal_Int16 mnLastPageCount;
+
+ // #i101443# remember last TextBackgroundColor to decide if a new decomposition is
+ // needed because of background color change
+ Color maLastTextBackgroundColor;
+
+ // bitfield
+ // is there a PageNumber, Header, Footer or DateTimeField used? Evaluated at construction
+ unsigned mbContainsPageField : 1;
+ unsigned mbContainsPageCountField : 1;
+ unsigned mbContainsOtherFields : 1;
+
+ protected:
+ // support for XTEXT_PAINTSHAPE_BEGIN/XTEXT_PAINTSHAPE_END Metafile comments
+ Primitive2DSequence encapsulateWithTextHierarchyBlockPrimitive2D(const Primitive2DSequence& rCandidate) const;
+
+ public:
+ SdrTextPrimitive2D(
+ const SdrText* pSdrText,
+ const OutlinerParaObject& rOutlinerParaObjectPtr);
+
+ // get data
+ const SdrText* getSdrText() const { return mrSdrText.get(); }
+ const OutlinerParaObject& getOutlinerParaObject() const { return maOutlinerParaObject; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // own get2DDecomposition to take aspect of decomposition with or without spell checker
+ // into account
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ // transformed clone operator
+ virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const = 0;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrContourTextPrimitive2D : public SdrTextPrimitive2D
+ {
+ private:
+ // unit contour polygon (scaled to [0.0 .. 1.0])
+ basegfx::B2DPolyPolygon maUnitPolyPolygon;
+
+ // complete contour polygon transform (scale, rotate, shear, translate)
+ basegfx::B2DHomMatrix maObjectTransform;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrContourTextPrimitive2D(
+ const SdrText* pSdrText,
+ const OutlinerParaObject& rOutlinerParaObjectPtr,
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform);
+
+ // get data
+ const basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; }
+ const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // transformed clone operator
+ virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrPathTextPrimitive2D : public SdrTextPrimitive2D
+ {
+ private:
+ // the path to use. Each paragraph will use one Polygon.
+ basegfx::B2DPolyPolygon maPathPolyPolygon;
+
+ // the Fontwork parameters
+ attribute::SdrFormTextAttribute maSdrFormTextAttribute;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrPathTextPrimitive2D(
+ const SdrText* pSdrText,
+ const OutlinerParaObject& rOutlinerParaObjectPtr,
+ const basegfx::B2DPolyPolygon& rPathPolyPolygon,
+ const attribute::SdrFormTextAttribute& rSdrFormTextAttribute);
+
+ // get data
+ const basegfx::B2DPolyPolygon& getPathPolyPolygon() const { return maPathPolyPolygon; }
+ const attribute::SdrFormTextAttribute& getSdrFormTextAttribute() const { return maSdrFormTextAttribute; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // transformed clone operator
+ virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrBlockTextPrimitive2D : public SdrTextPrimitive2D
+ {
+ private:
+ // text range transformation from unit range ([0.0 .. 1.0]) to text range
+ basegfx::B2DHomMatrix maTextRangeTransform;
+
+ // text alignments
+ SdrTextHorzAdjust maSdrTextHorzAdjust;
+ SdrTextVertAdjust maSdrTextVertAdjust;
+
+ // bitfield
+ unsigned mbFixedCellHeight : 1;
+ unsigned mbUnlimitedPage : 1; // force layout with no text break
+ unsigned mbCellText : 1; // this is a cell text as block text
+ unsigned mbWordWrap : 1; // for CustomShapes text layout
+ unsigned mbClipOnBounds : 1; // for CustomShapes text layout
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrBlockTextPrimitive2D(
+ const SdrText* pSdrText,
+ const OutlinerParaObject& rOutlinerParaObjectPtr,
+ const basegfx::B2DHomMatrix& rTextRangeTransform,
+ SdrTextHorzAdjust aSdrTextHorzAdjust,
+ SdrTextVertAdjust aSdrTextVertAdjust,
+ bool bFixedCellHeight,
+ bool bUnlimitedPage,
+ bool bCellText,
+ bool bWordWrap,
+ bool bClipOnBounds);
+
+ // get data
+ const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; }
+ SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; }
+ SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; }
+ bool isFixedCellHeight() const { return mbFixedCellHeight; }
+ bool getUnlimitedPage() const { return mbUnlimitedPage; }
+ bool getCellText() const { return mbCellText; }
+ bool getWordWrap() const { return mbWordWrap; }
+ bool getClipOnBounds() const { return mbClipOnBounds; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // transformed clone operator
+ virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrStretchTextPrimitive2D : public SdrTextPrimitive2D
+ {
+ private:
+ // text range transformation from unit range ([0.0 .. 1.0]) to text range
+ basegfx::B2DHomMatrix maTextRangeTransform;
+
+ // bitfield
+ unsigned mbFixedCellHeight : 1;
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrStretchTextPrimitive2D(
+ const SdrText* pSdrText,
+ const OutlinerParaObject& rOutlinerParaObjectPtr,
+ const basegfx::B2DHomMatrix& rTextRangeTransform,
+ bool bFixedCellHeight);
+
+ // get data
+ const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; }
+ bool isFixedCellHeight() const { return mbFixedCellHeight; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // transformed clone operator
+ virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class SdrAutoFitTextPrimitive2D : public SdrTextPrimitive2D
+ {
+ private:
+ ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range
+
+ // bitfield
+ unsigned mbWordWrap : 1; // for CustomShapes text layout
+
+ protected:
+ // local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
+
+ public:
+ SdrAutoFitTextPrimitive2D(
+ const SdrText* pSdrText,
+ const OutlinerParaObject& rOutlinerParaObjectPtr,
+ const ::basegfx::B2DHomMatrix& rTextRangeTransform,
+ bool bWordWrap);
+
+ // get data
+ const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; }
+ bool getWordWrap() const { return mbWordWrap; }
+
+ // compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ // transformed clone operator
+ virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_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 000000000000..6178695bf66d
--- /dev/null
+++ b/include/svx/sdr/primitive2d/svx_primitivetypes2d.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_PRIMITIVE2D_PRIMITIVETYPES2D_HXX
+#define INCLUDED_SVX_PRIMITIVE2D_PRIMITIVETYPES2D_HXX
+
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+#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_SDRBORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 15)
+#define PRIMITIVE2D_ID_OVERLAYBITMAPEXPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 16)
+#define PRIMITIVE2D_ID_OVERLAYCROSSHAIRPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 17)
+#define PRIMITIVE2D_ID_OVERLAYHATCHRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 18)
+#define PRIMITIVE2D_ID_OVERLAYHELPLINESTRIPEDPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 19)
+#define PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 20)
+#define PRIMITIVE2D_ID_SDRCONTROLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 21)
+#define PRIMITIVE2D_ID_SDROLECONTENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 22)
+#define PRIMITIVE2D_ID_SDRAUTOFITTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 23)
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_SVX_PRIMITIVE2D_PRIMITIVETYPES2D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/primitive3d/sdrattributecreator3d.hxx b/include/svx/sdr/primitive3d/sdrattributecreator3d.hxx
new file mode 100644
index 000000000000..1d730c054651
--- /dev/null
+++ b/include/svx/sdr/primitive3d/sdrattributecreator3d.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 _SDR_PRIMITIVE3D_SDRATTRIBUTECREATOR3D_HXX
+#define _SDR_PRIMITIVE3D_SDRATTRIBUTECREATOR3D_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+class SfxItemSet;
+
+namespace drawinglayer { namespace attribute {
+ class Sdr3DObjectAttribute;
+}}
+
+namespace basegfx {
+ class B2DRange;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ // SdrAttribute creators
+ attribute::Sdr3DObjectAttribute* createNewSdr3DObjectAttribute(const SfxItemSet& rSet);
+
+ // helpers
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PRIMITIVE3D_SDRATTRIBUTECREATOR3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/attributeproperties.hxx b/include/svx/sdr/properties/attributeproperties.hxx
new file mode 100644
index 000000000000..9f3e4d9f9ad3
--- /dev/null
+++ b/include/svx/sdr/properties/attributeproperties.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
+#define _SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
+
+#include <svl/lstner.hxx>
+#include <svl/stylesheetuser.hxx>
+#include <svx/sdr/properties/defaultproperties.hxx>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class SVX_DLLPUBLIC AttributeProperties : public DefaultProperties, public SfxListener, public svl::StyleSheetUser
+ {
+ // add style sheet, do all the necessary handling
+ void ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // remove StyleSheet, do all the necessary handling
+ void ImpRemoveStyleSheet();
+
+ protected:
+ // the SytleSheet of this object
+ SfxStyleSheet* mpStyleSheet;
+
+ // create a new itemset
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& pPool);
+
+ // Do the ItemChange, may do special handling
+ virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0);
+
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ public:
+ // basic constructor
+ explicit AttributeProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ AttributeProperties(const AttributeProperties& rProps, SdrObject& rObj);
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // destructor
+ virtual ~AttributeProperties();
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // get the installed StyleSheet
+ virtual SfxStyleSheet* GetStyleSheet() const;
+
+ // Move properties to a new ItemPool.
+ virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
+
+ // Set new model.
+ virtual void SetModel(SdrModel* pOldModel, SdrModel* pNewModel);
+
+ // force all attributes which come from styles to hard attributes
+ // to be able to live without the style.
+ virtual void ForceStyleToHardAttributes();
+
+ // This is the Notify(...) from 2nd base class SfxListener
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+ virtual bool isUsedByModel() const;
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/captionproperties.hxx b/include/svx/sdr/properties/captionproperties.hxx
new file mode 100644
index 000000000000..484d3139817c
--- /dev/null
+++ b/include/svx/sdr/properties/captionproperties.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 _SDR_PROPERTIES_CAPTIONPROPERTIES_HXX
+#define _SDR_PROPERTIES_CAPTIONPROPERTIES_HXX
+
+#include <svx/sdr/properties/rectangleproperties.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class CaptionProperties : public RectangleProperties
+ {
+ protected:
+ // create a new itemset
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
+
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ public:
+ // basic constructor
+ explicit CaptionProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ CaptionProperties(const CaptionProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~CaptionProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // force default attributes for a specific object type, called from
+ // DefaultProperties::GetObjectItemSet() if a new ItemSet is created
+ virtual void ForceDefaultAttributes();
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_PROPERTIES_CAPTIONPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/circleproperties.hxx b/include/svx/sdr/properties/circleproperties.hxx
new file mode 100644
index 000000000000..3a5ddb910d42
--- /dev/null
+++ b/include/svx/sdr/properties/circleproperties.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 _SDR_PROPERTIES_CIRCLEPROPERTIES_HXX
+#define _SDR_PROPERTIES_CIRCLEPROPERTIES_HXX
+
+#include <svx/sdr/properties/rectangleproperties.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class CircleProperties : public RectangleProperties
+ {
+ protected:
+ // create a new itemset
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
+
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ public:
+ // basic constructor
+ explicit CircleProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ CircleProperties(const CircleProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~CircleProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // force default attributes for a specific object type, called from
+ // DefaultProperties::GetObjectItemSet() if a new ItemSet is created
+ virtual void ForceDefaultAttributes();
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_CIRCLEPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/connectorproperties.hxx b/include/svx/sdr/properties/connectorproperties.hxx
new file mode 100644
index 000000000000..ae70c1d8b3d6
--- /dev/null
+++ b/include/svx/sdr/properties/connectorproperties.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 _SDR_PROPERTIES_CONNECTORPROPERTIES_HXX
+#define _SDR_PROPERTIES_CONNECTORPROPERTIES_HXX
+
+#include <svx/sdr/properties/textproperties.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class ConnectorProperties : public TextProperties
+ {
+ protected:
+ // create a new itemset
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
+
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ public:
+ // basic constructor
+ explicit ConnectorProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ ConnectorProperties(const ConnectorProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~ConnectorProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_CONNECTORPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/customshapeproperties.hxx b/include/svx/sdr/properties/customshapeproperties.hxx
new file mode 100644
index 000000000000..ae1e7a70451f
--- /dev/null
+++ b/include/svx/sdr/properties/customshapeproperties.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 _SDR_PROPERTIES_CUSTOMSHAPEPROPERTIES_HXX
+#define _SDR_PROPERTIES_CUSTOMSHAPEPROPERTIES_HXX
+
+#include <svx/sdr/properties/textproperties.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class CustomShapeProperties : public TextProperties
+ {
+ void UpdateTextFrameStatus();
+
+ protected:
+ // create a new itemset
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
+
+ // test changeability for a single item
+ virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
+
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ // react on Item change
+ virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem);
+
+ // clear single item
+ virtual void ClearObjectItem(const sal_uInt16 nWhich = 0);
+
+ // clear single item direct, do not do any notifies or things like that.
+ // Also supports complete deleteion of items when default parameter 0 is used.
+ virtual void ClearObjectItemDirect(const sal_uInt16 nWhich = 0);
+
+ public:
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // force default attributes for a specific object type, called from
+ // DefaultProperties::GetObjectItemSet() if a new ItemSet is created
+ virtual void ForceDefaultAttributes();
+
+ // basic constructor
+ explicit CustomShapeProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ CustomShapeProperties(const CustomShapeProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~CustomShapeProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // This is the notifyer from SfxListener
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_CUSTOMSHAPEPROPERTIES_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 000000000000..5b8b9f4f1c0e
--- /dev/null
+++ b/include/svx/sdr/properties/defaultproperties.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 _SDR_PROPERTIES_DEFAULTPROPERTIES_HXX
+#define _SDR_PROPERTIES_DEFAULTPROPERTIES_HXX
+
+#include <svx/sdr/properties/properties.hxx>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class SVX_DLLPUBLIC DefaultProperties : public BaseProperties
+ {
+ protected:
+ // the to be used ItemSet
+ SfxItemSet* mpItemSet;
+
+ // create a new itemset
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
+
+ // test changeability for a single item
+ virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
+
+ // Do the ItemChange, may do special handling
+ virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0);
+
+ // Called after ItemChange() is done for all items.
+ virtual void PostItemChange(const sal_uInt16 nWhich);
+
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ public:
+ // basic constructor
+ explicit DefaultProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ DefaultProperties(const DefaultProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~DefaultProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // get itemset
+ virtual const SfxItemSet& GetObjectItemSet() const;
+
+ // set single item
+ virtual void SetObjectItem(const SfxPoolItem& rItem);
+
+ // set single item direct, do not do any notifies or things like that
+ virtual void SetObjectItemDirect(const SfxPoolItem& rItem);
+
+ // clear single item
+ virtual void ClearObjectItem(const sal_uInt16 nWhich = 0);
+
+ // clear single item direct, do not do any notifies or things like that.
+ // Also supports complete deleteion of items when default parameter 0 is used.
+ virtual void ClearObjectItemDirect(const sal_uInt16 nWhich = 0);
+
+ // set complete item set
+ virtual void SetObjectItemSet(const SfxItemSet& rSet);
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // get the installed StyleSheet
+ virtual SfxStyleSheet* GetStyleSheet() const;
+
+ // 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();
+
+ // Scale the included ItemSet.
+ virtual void Scale(const Fraction& rScale);
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+#endif //_SDR_PROPERTIES_DEFAULTPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/e3dcompoundproperties.hxx b/include/svx/sdr/properties/e3dcompoundproperties.hxx
new file mode 100644
index 000000000000..9175042084aa
--- /dev/null
+++ b/include/svx/sdr/properties/e3dcompoundproperties.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 _SDR_PROPERTIES_E3DCOMPOUNDPROPERTIES_HXX
+#define _SDR_PROPERTIES_E3DCOMPOUNDPROPERTIES_HXX
+
+#include <svx/sdr/properties/e3dproperties.hxx>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class SVX_DLLPUBLIC E3dCompoundProperties : public E3dProperties
+ {
+ protected:
+ // Called after ItemChange() is done for all items.
+ virtual void PostItemChange(const sal_uInt16 nWhich);
+
+ public:
+ // basic constructor
+ explicit E3dCompoundProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ E3dCompoundProperties(const E3dCompoundProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~E3dCompoundProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // get itemset
+ virtual const SfxItemSet& GetObjectItemSet() const;
+
+ // Get merged ItemSet. Normally, this maps directly to GetObjectItemSet(), but may
+ // be overloaded 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
+ // SFX_ITEM_DONTCARE which means there were several such items with different
+ // values.
+ virtual const SfxItemSet& GetMergedItemSet() const;
+
+ // Set merged ItemSet. Normally, this maps to SetObjectItemSet().
+ virtual void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_PROPERTIES_E3DCOMPOUNDPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/e3dextrudeproperties.hxx b/include/svx/sdr/properties/e3dextrudeproperties.hxx
new file mode 100644
index 000000000000..ad7aa529a36c
--- /dev/null
+++ b/include/svx/sdr/properties/e3dextrudeproperties.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 _SDR_PROPERTIES_E3DEXTRUDEPROPERTIES_HXX
+#define _SDR_PROPERTIES_E3DEXTRUDEPROPERTIES_HXX
+
+#include <svx/sdr/properties/e3dcompoundproperties.hxx>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class SVX_DLLPUBLIC E3dExtrudeProperties : public E3dCompoundProperties
+ {
+ protected:
+ // Called after ItemChange() is done for all items.
+ virtual void PostItemChange(const sal_uInt16 nWhich);
+
+ public:
+ // basic constructor
+ explicit E3dExtrudeProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ E3dExtrudeProperties(const E3dExtrudeProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~E3dExtrudeProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_PROPERTIES_E3DEXTRUDEPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/e3dlatheproperties.hxx b/include/svx/sdr/properties/e3dlatheproperties.hxx
new file mode 100644
index 000000000000..17855a6b0658
--- /dev/null
+++ b/include/svx/sdr/properties/e3dlatheproperties.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 _SDR_PROPERTIES_E3DLATHEPROPERTIES_HXX
+#define _SDR_PROPERTIES_E3DLATHEPROPERTIES_HXX
+
+#include <svx/sdr/properties/e3dcompoundproperties.hxx>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class SVX_DLLPUBLIC E3dLatheProperties : public E3dCompoundProperties
+ {
+ protected:
+ // Called after ItemChange() is done for all items.
+ virtual void PostItemChange(const sal_uInt16 nWhich);
+
+ public:
+ // basic constructor
+ explicit E3dLatheProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ E3dLatheProperties(const E3dLatheProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~E3dLatheProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_PROPERTIES_E3DLATHEPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/e3dproperties.hxx b/include/svx/sdr/properties/e3dproperties.hxx
new file mode 100644
index 000000000000..4bebaab05c2a
--- /dev/null
+++ b/include/svx/sdr/properties/e3dproperties.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 _SDR_PROPERTIES_E3DPROPERTIES_HXX
+#define _SDR_PROPERTIES_E3DPROPERTIES_HXX
+
+#include <svx/sdr/properties/attributeproperties.hxx>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class SVX_DLLPUBLIC E3dProperties : public AttributeProperties
+ {
+ protected:
+ // create a new itemset
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
+
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ public:
+ // basic constructor
+ explicit E3dProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ E3dProperties(const E3dProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~E3dProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_PROPERTIES_E3DPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/e3dsceneproperties.hxx b/include/svx/sdr/properties/e3dsceneproperties.hxx
new file mode 100644
index 000000000000..e52c483b14e6
--- /dev/null
+++ b/include/svx/sdr/properties/e3dsceneproperties.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDR_PROPERTIES_E3DSCENEPROPERTIES_HXX
+#define _SDR_PROPERTIES_E3DSCENEPROPERTIES_HXX
+
+#include <svx/sdr/properties/e3dproperties.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class E3dSceneProperties : public E3dProperties
+ {
+ protected:
+ // Called after ItemChange() is done for all items.
+ virtual void PostItemChange(const sal_uInt16 nWhich);
+
+ public:
+ // basic constructor
+ explicit E3dSceneProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ E3dSceneProperties(const E3dSceneProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~E3dSceneProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // get itemset
+ virtual const SfxItemSet& GetObjectItemSet() const;
+
+ // get merged ItemSet. Normappl, this maps directly to GetObjectItemSet(), but may
+ // be overloaded 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
+ // SFX_ITEM_DONTCARE which means there were several such items with different
+ // values.
+ virtual const SfxItemSet& GetMergedItemSet() const;
+
+ // Set merged ItemSet. Normally, this maps to SetObjectItemSet().
+ virtual void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
+
+ // Set a single item, iterate over hierarchies if necessary.
+ virtual void SetMergedItem(const SfxPoolItem& rItem);
+
+ // Clear a single item, iterate over hierarchies if necessary.
+ virtual void ClearMergedItem(const sal_uInt16 nWhich = 0);
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // get the installed StyleSheet
+ virtual SfxStyleSheet* GetStyleSheet() const;
+
+ // Move properties to a new ItemPool. Default implementation does nothing.
+ virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
+
+ // Special for scene:
+ void SetSceneItemsFromCamera();
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_PROPERTIES_E3DSCENEPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/e3dsphereproperties.hxx b/include/svx/sdr/properties/e3dsphereproperties.hxx
new file mode 100644
index 000000000000..d99af2d38c85
--- /dev/null
+++ b/include/svx/sdr/properties/e3dsphereproperties.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 _SDR_PROPERTIES_E3DSPHEREPROPERTIES_HXX
+#define _SDR_PROPERTIES_E3DSPHEREPROPERTIES_HXX
+
+#include <svx/sdr/properties/e3dcompoundproperties.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class E3dSphereProperties : public E3dCompoundProperties
+ {
+ protected:
+ // Called after ItemChange() is done for all items.
+ virtual void PostItemChange(const sal_uInt16 nWhich);
+
+ public:
+ // basic constructor
+ explicit E3dSphereProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ E3dSphereProperties(const E3dSphereProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~E3dSphereProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_PROPERTIES_E3DSPHEREPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/emptyproperties.hxx b/include/svx/sdr/properties/emptyproperties.hxx
new file mode 100644
index 000000000000..102af739dcf6
--- /dev/null
+++ b/include/svx/sdr/properties/emptyproperties.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDR_PROPERTIES_EMPTYPROPERTIES_HXX
+#define _SDR_PROPERTIES_EMPTYPROPERTIES_HXX
+
+#include <svx/sdr/properties/properties.hxx>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class SVX_DLLPUBLIC EmptyProperties : public BaseProperties
+ {
+ protected:
+ // the to be used ItemSet
+ SfxItemSet* mpEmptyItemSet;
+
+ // create a new itemset
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
+
+ // test changeability for a single item
+ virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
+
+ // Do the ItemChange, may do special handling
+ virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0);
+
+ // Called after ItemChange() is done for all items.
+ virtual void PostItemChange(const sal_uInt16 nWhich);
+
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ public:
+ // basic constructor
+ explicit EmptyProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ EmptyProperties(const EmptyProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~EmptyProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // get itemset
+ virtual const SfxItemSet& GetObjectItemSet() const;
+
+ // set single item
+ virtual void SetObjectItem(const SfxPoolItem& rItem);
+
+ // set single item direct, do not do any notifies or things like that
+ virtual void SetObjectItemDirect(const SfxPoolItem& rItem);
+
+ // clear single item
+ virtual void ClearObjectItem(const sal_uInt16 nWhich = 0);
+
+ // clear single item direct, do not do any notifies or things like that.
+ // Also supports complete deleteion of items when default parameter 0 is used.
+ virtual void ClearObjectItemDirect(const sal_uInt16 nWhich = 0);
+
+ // set complete item set
+ virtual void SetObjectItemSet(const SfxItemSet& rSet);
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // get the installed StyleSheet
+ virtual SfxStyleSheet* GetStyleSheet() const;
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+#endif //_SDR_PROPERTIES_EMPTYPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/graphicproperties.hxx b/include/svx/sdr/properties/graphicproperties.hxx
new file mode 100644
index 000000000000..e2a3562440af
--- /dev/null
+++ b/include/svx/sdr/properties/graphicproperties.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 _SDR_PROPERTIES_GRAPHICPROPERTIES_HXX
+#define _SDR_PROPERTIES_GRAPHICPROPERTIES_HXX
+
+#include <svx/sdr/properties/rectangleproperties.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class GraphicProperties : public RectangleProperties
+ {
+ protected:
+ // create a new itemset
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
+
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ public:
+ // basic constructor
+ explicit GraphicProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ GraphicProperties(const GraphicProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~GraphicProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // force default attributes for a specific object type, called from
+ // DefaultProperties::GetObjectItemSet() if a new ItemSet is created
+ virtual void ForceDefaultAttributes();
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_GRAPHICPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/groupproperties.hxx b/include/svx/sdr/properties/groupproperties.hxx
new file mode 100644
index 000000000000..3de8abf71ea2
--- /dev/null
+++ b/include/svx/sdr/properties/groupproperties.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 _SDR_PROPERTIES_GROUPPROPERTIES_HXX
+#define _SDR_PROPERTIES_GROUPPROPERTIES_HXX
+
+#include <svx/sdr/properties/defaultproperties.hxx>
+
+/////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class GroupProperties : public DefaultProperties
+ {
+ protected:
+ // create a new itemset
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
+
+ // test changeability for a single item
+ virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
+
+ // Do the ItemChange, may do special handling
+ virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0);
+
+ // Called after ItemChange() is done for all items.
+ virtual void PostItemChange(const sal_uInt16 nWhich);
+
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ public:
+ // basic constructor
+ explicit GroupProperties(SdrObject& rObj);
+
+ // copy constructor
+ GroupProperties(const GroupProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~GroupProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // get itemset
+ virtual const SfxItemSet& GetObjectItemSet() const;
+
+ // get merged ItemSet. Normally, this maps directly to GetObjectItemSet(), but may
+ // be overloaded 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
+ // SFX_ITEM_DONTCARE which means there were several such items with different
+ // values.
+ virtual const SfxItemSet& GetMergedItemSet() const;
+
+ // Set merged ItemSet. Normally, this maps to SetObjectItemSet().
+ virtual void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
+
+ // set single item
+ virtual void SetObjectItem(const SfxPoolItem& rItem);
+
+ // set single item direct, do not do any notifies or things like that
+ virtual void SetObjectItemDirect(const SfxPoolItem& rItem);
+
+ // clear single item
+ virtual void ClearObjectItem(const sal_uInt16 nWhich = 0);
+
+ // clear single item direct, do not do any notifies or things like that.
+ // Also supports complete deleteion of items when default parameter 0 is used.
+ virtual void ClearObjectItemDirect(const sal_uInt16 nWhich = 0);
+
+ // Set a single item, iterate over hierarchies if necessary.
+ virtual void SetMergedItem(const SfxPoolItem& rItem);
+
+ // Clear a single item, iterate over hierarchies if necessary.
+ virtual void ClearMergedItem(const sal_uInt16 nWhich = 0);
+
+ // set complete item set
+ virtual void SetObjectItemSet(const SfxItemSet& rSet);
+
+ // set a new StyleSheet
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // get the local StyleSheet
+ virtual SfxStyleSheet* GetStyleSheet() const;
+
+ // force default attributes for a specific object type, called from
+ // DefaultProperties::GetObjectItemSet() if a new ItemSet is created
+ virtual void ForceDefaultAttributes();
+
+ // Move properties to a new ItemPool.
+ virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
+
+ // force all attributes which come from styles to hard attributes
+ // to be able to live without the style.
+ virtual void ForceStyleToHardAttributes();
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_GROUPPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/itemsettools.hxx b/include/svx/sdr/properties/itemsettools.hxx
new file mode 100644
index 000000000000..8649ffb3c10d
--- /dev/null
+++ b/include/svx/sdr/properties/itemsettools.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 _SDR_PROPERTIES_ITEMSETTOOLS_HXX
+#define _SDR_PROPERTIES_ITEMSETTOOLS_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrObject;
+class SfxItemSet;
+class Rectangle;
+class Fraction;
+
+//////////////////////////////////////////////////////////////////////////////
+// class to remember broadcast start positions
+namespace sdr
+{
+ namespace properties
+ {
+ class ItemChangeBroadcaster
+ {
+ sal_uInt32 mnCount;
+ void* mpData;
+
+ public:
+ explicit ItemChangeBroadcaster(const SdrObject& rObj);
+ ~ItemChangeBroadcaster();
+
+ sal_uInt32 GetRectangleCount() const;
+ const Rectangle& GetRectangle(sal_uInt32 nIndex) const;
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ void ScaleItemSet(SfxItemSet& rSet, const Fraction& rScale);
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_ITEMSETTOOLS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/measureproperties.hxx b/include/svx/sdr/properties/measureproperties.hxx
new file mode 100644
index 000000000000..22e42b80dac6
--- /dev/null
+++ b/include/svx/sdr/properties/measureproperties.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 _SDR_PROPERTIES_MEASUREPROPERTIES_HXX
+#define _SDR_PROPERTIES_MEASUREPROPERTIES_HXX
+
+#include <svx/sdr/properties/textproperties.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class MeasureProperties : public TextProperties
+ {
+ protected:
+ // create a new itemset
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
+
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ public:
+ // basic constructor
+ explicit MeasureProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ MeasureProperties(const MeasureProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~MeasureProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // force default attributes for a specific object type, called from
+ // DefaultProperties::GetObjectItemSet() if a new ItemSet is created
+ virtual void ForceDefaultAttributes();
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_MEASUREPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/oleproperties.hxx b/include/svx/sdr/properties/oleproperties.hxx
new file mode 100644
index 000000000000..184f840af272
--- /dev/null
+++ b/include/svx/sdr/properties/oleproperties.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 _SDR_PROPERTIES_OLEPROPERTIES_HXX
+#define _SDR_PROPERTIES_OLEPROPERTIES_HXX
+
+#include <svx/sdr/properties/rectangleproperties.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class OleProperties : public RectangleProperties
+ {
+ protected:
+ public:
+ // basic constructor
+ explicit OleProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ OleProperties(const OleProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~OleProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // force default attributes for a specific object type, called from
+ // DefaultProperties::GetObjectItemSet() if a new ItemSet is created
+ virtual void ForceDefaultAttributes();
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_OLEPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/pageproperties.hxx b/include/svx/sdr/properties/pageproperties.hxx
new file mode 100644
index 000000000000..fe7c333cec71
--- /dev/null
+++ b/include/svx/sdr/properties/pageproperties.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 _SDR_PROPERTIES_PAGEPROPERTIES_HXX
+#define _SDR_PROPERTIES_PAGEPROPERTIES_HXX
+
+#include <svx/sdr/properties/emptyproperties.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class PageProperties : public EmptyProperties
+ {
+ protected:
+ // create a new object specific itemset with object specific ranges.
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& pPool);
+
+ // Do the ItemChange, may do special handling
+ virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0);
+
+ // Called after ItemChange() is done for all items.
+ virtual void PostItemChange(const sal_uInt16 nWhich);
+
+ public:
+ // basic constructor
+ explicit PageProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ PageProperties(const PageProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~PageProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // get itemset. Overloaded here to allow creating the empty itemset
+ // without asserting
+ virtual const SfxItemSet& GetObjectItemSet() const;
+
+ // get the installed StyleSheet
+ virtual SfxStyleSheet* GetStyleSheet() const;
+
+ // clear single item
+ virtual void ClearObjectItem(const sal_uInt16 nWhich = 0);
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_PAGEPROPERTIES_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 000000000000..287cd5b93ef2
--- /dev/null
+++ b/include/svx/sdr/properties/properties.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 _SDR_PROPERTIES_PROPERTIES_HXX
+#define _SDR_PROPERTIES_PROPERTIES_HXX
+
+#include <sal/types.h>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SdrObject;
+class SfxItemSet;
+class SfxPoolItem;
+class SfxStyleSheet;
+class Fraction;
+class SfxItemPool;
+class SdrModel;
+
+namespace sdr
+{
+ namespace properties
+ {
+ class ItemChangeBroadcaster;
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class SVX_DLLPUBLIC BaseProperties
+ {
+ protected:
+ // the owner of this Properties. Set from constructor and not
+ // to be changed in any way.
+ SdrObject& mrObject;
+
+ // create a new object specific itemset with object specific ranges.
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& pPool) = 0;
+
+ // internal access to SdrObject
+ SdrObject& GetSdrObject() const
+ {
+ return mrObject;
+ }
+
+ // Test changeability for a single item. If a implementation wants to prevent
+ // changing an item this method may be overloaded.
+ virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) 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 = 0) = 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);
+
+ // constructor for copying, but using new object. Used from the Clone()
+ // method.
+ BaseProperties(const BaseProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~BaseProperties();
+
+ // Clone() operator, normally just calls the local copy constructor,
+ // see above.
+ virtual BaseProperties& 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. Normappl, this maps directly to GetObjectItemSet(), but may
+ // be overloaded 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
+ // SFX_ITEM_DONTCARE which means there were several such items with different
+ // values.
+ virtual const SfxItemSet& GetMergedItemSet() const;
+
+ // Sets all items which are on state SFX_ITEM_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, sal_Bool bClearAllItems = sal_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 = 0);
+
+ // 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) = 0;
+
+ // Set a new StyleSheet. Registers as listener at the StyleSheet to get knowledge
+ // of StyleSheet changes.
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr) = 0;
+
+ // Get the installed StyleSheet.
+ virtual SfxStyleSheet* GetStyleSheet() const = 0;
+
+ // Scale the local ItemSet as far as it contains metric items. This needs to be
+ // overloaded to do it for hierarchical objects like e.g. groups.
+ virtual void Scale(const Fraction& rScale);
+
+ // Move local items to a new ItemPool. This needs to be
+ // overloaded to do it for hierarchical objects like e.g. groups.
+ virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
+
+ // Set new model.
+ virtual void SetModel(SdrModel* pOldModel, SdrModel* pNewModel);
+
+ // 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, sal_Bool bClearAllItems = sal_False);
+
+ // Just a convenient shortcut for GetObjectItemSet().Get(nWhich).
+ const SfxPoolItem& GetItem(const sal_uInt16 nWhich) const;
+
+ // 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;
+ };
+
+ // checks the FillStyle item and removes unneeded Gradient, FillBitmap and Hatch items
+ void SVX_DLLPUBLIC CleanupFillProperties( SfxItemSet& rItemSet );
+
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_PROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/rectangleproperties.hxx b/include/svx/sdr/properties/rectangleproperties.hxx
new file mode 100644
index 000000000000..6314f1b136ca
--- /dev/null
+++ b/include/svx/sdr/properties/rectangleproperties.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 _SDR_PROPERTIES_RECTANGLEPROPERTIES_HXX
+#define _SDR_PROPERTIES_RECTANGLEPROPERTIES_HXX
+
+#include <svx/sdr/properties/textproperties.hxx>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class SVX_DLLPUBLIC RectangleProperties : public TextProperties
+ {
+ protected:
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ public:
+ // basic constructor
+ explicit RectangleProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ RectangleProperties(const RectangleProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~RectangleProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_RECTANGLEPROPERTIES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/properties/textproperties.hxx b/include/svx/sdr/properties/textproperties.hxx
new file mode 100644
index 000000000000..456b104e60ec
--- /dev/null
+++ b/include/svx/sdr/properties/textproperties.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 _SDR_PROPERTIES_TEXTPROPERTIES_HXX
+#define _SDR_PROPERTIES_TEXTPROPERTIES_HXX
+
+#include <svx/itextprovider.hxx>
+#include <svx/sdr/properties/attributeproperties.hxx>
+#include "svx/svxdllapi.h"
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ class SVX_DLLPUBLIC TextProperties : public AttributeProperties
+ {
+ private:
+ // #i101556# versioning support
+ sal_uInt32 maVersion;
+
+ protected:
+ // create a new itemset
+ virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
+
+ // Do the ItemChange, may do special handling
+ virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0);
+
+ // react on ItemSet changes
+ virtual void ItemSetChanged(const SfxItemSet& rSet);
+
+ /// Get the TextProvider related to our SdrObject
+ virtual const svx::ITextProvider& getTextProvider() const;
+
+ public:
+ // basic constructor
+ explicit TextProperties(SdrObject& rObj);
+
+ // constructor for copying, but using new object
+ TextProperties(const TextProperties& rProps, SdrObject& rObj);
+
+ // destructor
+ virtual ~TextProperties();
+
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
+
+ // set a new StyleSheet and broadcast
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // force default attributes for a specific object type, called from
+ // DefaultProperties::GetObjectItemSet() if a new ItemSet is created
+ virtual void ForceDefaultAttributes();
+
+ // force all attributes which come from styles to hard attributes
+ // to be able to live without the style.
+ virtual void ForceStyleToHardAttributes();
+
+ // This is the notifyer from SfxListener
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+ // Set single item at the local ItemSet. *Does not use* AllowItemChange(),
+ // ItemChange(), PostItemChange() and ItemSetChanged() calls.
+ void SetObjectItemNoBroadcast(const SfxPoolItem& rItem);
+
+ // #i101556# versioning support
+ virtual sal_uInt32 getVersion() const;
+ };
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_TEXTPROPERTIES_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 000000000000..8de846375f5b
--- /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 _SDR_TABLE_DESIGN_HXX
+#define _SDR_TABLE_DESIGN_HXX
+
+#include "svx/svxdllapi.h"
+
+#include <com/sun/star/container/XNameAccess.hpp>
+
+namespace sdr { namespace 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 ::com::sun::star::uno::Reference< ::com::sun::star::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 000000000000..ad867f867cfa
--- /dev/null
+++ b/include/svx/sdrhittesthelper.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 _SDRHITTESTHELPER_HXX
+#define _SDRHITTESTHELPER_HXX
+
+#include "svx/svxdllapi.h"
+#include <tools/gen.hxx>
+
+/////////////////////////////////////////////////////////////////////
+// #i101872# new Object HitTest as View-tooling
+
+class SdrObject;
+class SdrPageView;
+class SetOfByte;
+class SdrObjList;
+namespace sdr { namespace contact { class ViewObjectContact; }}
+namespace basegfx { class B2DPoint; }
+
+/////////////////////////////////////////////////////////////////////
+// Wrappers for classic Sdr* Mode/View classes
+
+SVX_DLLPUBLIC SdrObject* SdrObjectPrimitiveHit(
+ const SdrObject& rObject,
+ const Point& rPnt,
+ sal_uInt16 nTol,
+ const SdrPageView& rSdrPageView,
+ const SetOfByte* pVisiLayer,
+ bool bTextOnly);
+
+SVX_DLLPUBLIC SdrObject* SdrObjListPrimitiveHit(
+ const SdrObjList& rList,
+ const Point& rPnt,
+ sal_uInt16 nTol,
+ const SdrPageView& rSdrPageView,
+ const SetOfByte* pVisiLayer,
+ bool bTextOnly);
+
+/////////////////////////////////////////////////////////////////////
+// the pure HitTest based on a VOC
+
+SVX_DLLPUBLIC bool ViewObjectContactPrimitiveHit(
+ const sdr::contact::ViewObjectContact& rVOC,
+ const basegfx::B2DPoint& rHitPosition,
+ double fLogicHitTolerance,
+ bool bTextOnly);
+
+/////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..1917a681bb69
--- /dev/null
+++ b/include/svx/sdrmasterpagedescriptor.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 _SDR_MASTERPAGEDESCRIPTOR_HXX
+#define _SDR_MASTERPAGEDESCRIPTOR_HXX
+
+#include <svx/sdrpageuser.hxx>
+#include <svx/svdsob.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+class SdrObject;
+class SfxItemSet;
+class SdrPageProperties;
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContact;
+ } // end of namespace contact
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ class MasterPageDescriptor : public sdr::PageUser
+ {
+ private:
+ SdrPage& maOwnerPage;
+ SdrPage& maUsedPage;
+ SetOfByte maVisibleLayers;
+
+ // ViewContact part
+ sdr::contact::ViewContact* mpViewContact;
+
+ // assignment operator defined, but not implemented
+ void operator=(const MasterPageDescriptor& rCandidate);
+
+ protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
+ public:
+ MasterPageDescriptor(SdrPage& aOwnerPage, SdrPage& aUsedPage);
+ virtual ~MasterPageDescriptor();
+
+ // ViewContact part
+ sdr::contact::ViewContact& GetViewContact() const;
+
+ // this method is called form the destructor of the referenced page.
+ // do all necessary action to forget the page. It is not necessary to call
+ // RemovePageUser(), that is done form the destructor.
+ virtual void PageInDestruction(const SdrPage& rPage);
+
+ // member access to UsedPage
+ SdrPage& GetUsedPage() const { return maUsedPage; }
+
+ // member access to OwnerPage
+ SdrPage& GetOwnerPage() const { return maOwnerPage; }
+
+ // member access to VisibleLayers
+ const SetOfByte& GetVisibleLayers() const { return maVisibleLayers; }
+ void SetVisibleLayers(const SetOfByte& rNew);
+
+ // operators
+ bool operator==(const MasterPageDescriptor& rCandidate) const;
+ bool operator!=(const MasterPageDescriptor& rCandidate) const;
+
+ const SdrPageProperties* getCorrectSdrPageProperties() const;
+ };
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_MASTERPAGEDESCRIPTOR_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 000000000000..9741afb6f4cf
--- /dev/null
+++ b/include/svx/sdrobjectfilter.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 SDROBJECTFILTER_HXX
+#define SDROBJECTFILTER_HXX
+
+#include "svx/svxdllapi.h"
+
+class SdrObject;
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+ //====================================================================
+ //= SdrObjectFilter
+ //====================================================================
+ /** specifies a boolean predicate on the set of all SdrObjects - vulgo a filter.
+ */
+ class SVX_DLLPUBLIC SAL_NO_VTABLE ISdrObjectFilter
+ {
+ public:
+ virtual bool includeObject( const SdrObject& i_rObject ) const = 0;
+
+ virtual ~ISdrObjectFilter() = 0;
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // 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 000000000000..b1e0c7343066
--- /dev/null
+++ b/include/svx/sdrobjectuser.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 _SDR_OBJECTUSER_HXX
+#define _SDR_OBJECTUSER_HXX
+
+#include <vector>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predeclarations
+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 form the destructor of the referenced page.
+ // do all necessary action to forget the page. It is not necessary to call
+ // RemovePageUser(), that is done form the destructor.
+ virtual void ObjectInDestruction(const SdrObject& rObject) = 0;
+
+ protected:
+ ~ObjectUser() {}
+ };
+
+ // typedef for ObjectUserVector
+ typedef ::std::vector< ObjectUser* > ObjectUserVector;
+} // end of namespace sdr
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_OBJECTUSER_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 000000000000..39390fcf6247
--- /dev/null
+++ b/include/svx/sdrpageuser.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 _SDR_PAGEUSER_HXX
+#define _SDR_PAGEUSER_HXX
+
+#include <vector>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predeclarations
+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 form the destructor of the referenced page.
+ // do all necessary action to forget the page. It is not necessary to call
+ // RemovePageUser(), that is done form the destructor.
+ virtual void PageInDestruction(const SdrPage& rPage) = 0;
+
+ protected:
+ ~PageUser() {}
+ };
+
+ // typedef for PageUserVector
+ typedef ::std::vector< PageUser* > PageUserVector;
+} // end of namespace sdr
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PAGEUSER_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 000000000000..85584d724b67
--- /dev/null
+++ b/include/svx/sdrpagewindow.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 _SDRPAGEWINDOW_HXX
+#define _SDRPAGEWINDOW_HXX
+
+#include <com/sun/star/awt/XWindowListener.hpp>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/awt/XControlContainer.hpp>
+#include <com/sun/star/util/XModeChangeListener.hpp>
+#include <cppuhelper/implbase4.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <svx/svdtypes.hxx> // for SdrLayerID
+#include <svx/sdrpagewindow.hxx>
+#include "svx/svxdllapi.h"
+
+#include <vector>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class Region;
+class SdrUnoObj;
+class SdrPageView;
+
+// #110094#
+namespace sdr
+{
+ namespace contact
+ {
+ class ObjectContact;
+ class ViewObjectContactRedirector;
+ } // end of namespace contact
+
+ namespace overlay
+ {
+ class OverlayManager;
+ } // end of namespace overlay
+} // end of namespace sdr
+
+namespace basegfx
+{
+ class B2DRange;
+} // end of namespace basegfx
+
+class SdrPaintWindow;
+class Link;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrPageWindow
+{
+ // #110094# ObjectContact section
+ sdr::contact::ObjectContact* mpObjectContact;
+
+ // the SdrPageView this window belongs to
+ SdrPageView& mrPageView;
+
+ // the PaintWindow to paint on. Here is access to OutDev etc.
+ // #i72752# change to pointer to allow patcing it in DrawLayer() if necessary
+ SdrPaintWindow* mpPaintWindow;
+ SdrPaintWindow* mpOriginalPaintWindow;
+
+ // UNO stuff for xControls
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > mxControlContainer;
+
+ sdr::contact::ObjectContact* CreateViewSpecificObjectContact();
+
+public:
+ SdrPageWindow(SdrPageView& rNewPageView, SdrPaintWindow& rPaintWindow);
+ ~SdrPageWindow();
+
+ // data read accesses
+ SdrPageView& GetPageView() const { return mrPageView; }
+ SdrPaintWindow& GetPaintWindow() const { return *mpPaintWindow; }
+ const SdrPaintWindow* GetOriginalPaintWindow() const { return mpOriginalPaintWindow; }
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > GetControlContainer( bool _bCreateIfNecessary = true ) const;
+
+ // OVERLAYMANAGER
+ rtl::Reference< ::sdr::overlay::OverlayManager > GetOverlayManager() const;
+
+ // #i72752# allow patcing SdrPaintWindow from SdrPageView::DrawLayer if needed
+ void patchPaintWindow(SdrPaintWindow& rPaintWindow);
+ void unpatchPaintWindow();
+
+ // the repaint method. For migration from pPaintProc, use one more parameter
+ void PrePaint();
+ void PrepareRedraw(const Region& rReg);
+ void RedrawAll(sdr::contact::ViewObjectContactRedirector* pRedirector) const;
+ void RedrawLayer(const SdrLayerID* pId, sdr::contact::ViewObjectContactRedirector* pRedirector) const;
+
+ // Invalidate call, used from ObjectContact(OfPageView) in InvalidatePartOfView(...)
+ void InvalidatePageWindow(const basegfx::B2DRange& rRange);
+
+ // #110094# ObjectContact section
+ sdr::contact::ObjectContact& GetObjectContact() const;
+ /// determines whether there already exists an ObjectContact
+ bool HasObjectContact() const;
+
+ // #i26631#
+ void ResetObjectContact();
+
+ /** sets all elements in the view which support a design and a alive mode into the given mode
+ */
+ void SetDesignMode( bool _bDesignMode ) const;
+};
+
+// typedefs for a list of SdrPageWindow
+typedef ::std::vector< SdrPageWindow* > SdrPageWindowVector;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..bf8620ca8655
--- /dev/null
+++ b/include/svx/sdrpaintwindow.hxx
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SDRPAINTWINDOW_HXX
+#define _SDRPAINTWINDOW_HXX
+
+#include <rtl/ref.hxx>
+#include <vcl/virdev.hxx>
+#include "svx/svxdllapi.h"
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predeclarations
+class SdrPaintView;
+
+namespace sdr
+{
+ namespace overlay
+ {
+ class OverlayManager;
+ } // end of namespace overlay
+} // end of namespace sdr
+
+#ifdef _MSC_VER // broken msvc template instantiation
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SdrPreRenderDevice
+{
+ // The original OutputDevice
+ OutputDevice& mrOutputDevice;
+
+ // The VirtualDevice for PreRendering
+ VirtualDevice maPreRenderDevice;
+
+public:
+ explicit SdrPreRenderDevice(OutputDevice& rOriginal);
+ ~SdrPreRenderDevice();
+
+ void PreparePreRenderDevice();
+ void OutputPreRenderDevice(const Region& rExpandedRegion);
+
+ OutputDevice& GetOriginalOutputDevice() const { return mrOutputDevice; }
+ OutputDevice& GetPreRenderDevice() { return maPreRenderDevice; }
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrPaintWindow
+{
+private:
+ // the OutputDevice this window represents
+ OutputDevice& mrOutputDevice;
+
+ // 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
+ SdrPreRenderDevice* mpPreRenderDevice;
+
+ // The RedrawRegion used for rendering
+ Region maRedrawRegion;
+
+ // bitfield
+ // #i72889# flag if this is only a temporary target for repaint, default is false
+ unsigned mbTemporaryTarget : 1;
+
+ /** Remember whether the mxOverlayManager supports buffering. Using
+ this flags expensive dynamic_casts on mxOverlayManager in order to
+ detect this.
+ */
+ bool mbUseBuffer;
+
+ // helpers
+ void impCreateOverlayManager();
+
+public:
+ SdrPaintWindow(SdrPaintView& rNewPaintView, OutputDevice& rOut);
+ ~SdrPaintWindow();
+
+ // data read accesses
+ SdrPaintView& GetPaintView() const { return mrPaintView; }
+ OutputDevice& GetOutputDevice() const { return mrOutputDevice; }
+
+ // OVERLAYMANAGER
+ rtl::Reference< ::sdr::overlay::OverlayManager > GetOverlayManager() const;
+
+ // #i73602# add flag if buffer shall be used
+ void DrawOverlay(const Region& rRegion);
+
+ // calculate visible area and return
+ Rectangle GetVisibleArea() const;
+
+ // Is OutDev a printer?
+ bool OutputToPrinter() const { return (OUTDEV_PRINTER == mrOutputDevice.GetOutDevType()); }
+
+ // Is OutDev a window?
+ sal_Bool OutputToWindow() const { return (OUTDEV_WINDOW == mrOutputDevice.GetOutDevType()); }
+
+ // Is OutDev a VirtualDevice?
+ sal_Bool OutputToVirtualDevice() const { return (OUTDEV_VIRDEV == mrOutputDevice.GetOutDevType()); }
+
+ // Is OutDev a recording MetaFile?
+ bool OutputToRecordingMetaFile() const;
+
+ // prepare PreRendering (evtl.)
+ void PreparePreRenderDevice();
+ void DestroyPreRenderDevice();
+ void OutputPreRenderDevice(const Region& rExpandedRegion);
+ SdrPreRenderDevice* GetPreRenderDevice() const { return mpPreRenderDevice; }
+
+ // RedrawRegion
+ const Region& GetRedrawRegion() const;
+ void SetRedrawRegion(const Region& rNew);
+
+ // #i72889# read/write access to TempoparyTarget
+ bool getTemporaryTarget() const { return (bool)mbTemporaryTarget; }
+ void setTemporaryTarget(bool bNew) { if(bNew != (bool)mbTemporaryTarget) mbTemporaryTarget = bNew; }
+
+ // #i72889# get target output device, take into account output buffering
+ OutputDevice& GetTargetOutputDevice() { if(mpPreRenderDevice) return mpPreRenderDevice->GetPreRenderDevice(); else return mrOutputDevice; }
+};
+
+// typedefs for a list of SdrPaintWindows
+typedef ::std::vector< SdrPaintWindow* > SdrPaintWindowVector;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDRPAINTWINDOW_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 000000000000..f399a069ee61
--- /dev/null
+++ b/include/svx/sdshcitm.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 _SDSHCITM_HXX
+#define _SDSHCITM_HXX
+
+#include <svx/xcolit.hxx>
+#include <svx/svddef.hxx>
+
+class SdrShadowColorItem: public XColorItem
+{
+public:
+ SdrShadowColorItem(const Color& rTheColor)
+ : 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 000000000000..831fe9a4da5c
--- /dev/null
+++ b/include/svx/sdshitm.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 _SDSHITM_HXX
+#define _SDSHITM_HXX
+
+#include <svx/sdooitm.hxx>
+#include <svx/svddef.hxx>
+
+//------------------------------
+// class SdrShadowItem
+//------------------------------
+class SdrShadowItem: public SdrOnOffItem {
+public:
+ SdrShadowItem(sal_Bool bShadow=sal_False): SdrOnOffItem(SDRATTR_SHADOW, bShadow) {}
+ SdrShadowItem(SvStream& rIn): SdrOnOffItem(SDRATTR_SHADOW, rIn) {}
+};
+
+#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 000000000000..39c038a68bda
--- /dev/null
+++ b/include/svx/sdshtitm.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 _SDSHTITM_HXX
+#define _SDSHTITM_HXX
+
+#include <svx/sdprcitm.hxx>
+#include <svx/svddef.hxx>
+
+//---------------------
+// class SdrShadowTransparenceItem
+//---------------------
+class SdrShadowTransparenceItem: public SdrPercentItem {
+public:
+ SdrShadowTransparenceItem(sal_uInt16 nTransp=0): SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE,nTransp) {}
+ SdrShadowTransparenceItem(SvStream& rIn) : SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE,rIn) {}
+};
+
+#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 000000000000..84f614c36b97
--- /dev/null
+++ b/include/svx/sdsxyitm.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 _SDSXYITM_HXX
+#define _SDSXYITM_HXX
+
+#include <svx/sdmetitm.hxx>
+#include <svx/svddef.hxx>
+
+//---------------------
+// class SdrShadowXDistItem
+//---------------------
+class SdrShadowXDistItem: public SdrMetricItem {
+public:
+ SdrShadowXDistItem(long nDist=0) : SdrMetricItem(SDRATTR_SHADOWXDIST,nDist) {}
+ SdrShadowXDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_SHADOWXDIST,rIn) {}
+};
+
+//---------------------
+// class SdrShadowYDistItem
+//---------------------
+class SdrShadowYDistItem: public SdrMetricItem {
+public:
+ SdrShadowYDistItem(long nDist=0) : SdrMetricItem(SDRATTR_SHADOWYDIST,nDist) {}
+ SdrShadowYDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_SHADOWYDIST,rIn) {}
+};
+
+#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 000000000000..cf8b0d59f1ee
--- /dev/null
+++ b/include/svx/sdtaaitm.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 _SDTAAITM_HXX
+#define _SDTAAITM_HXX
+
+#include <svl/intitem.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC SdrTextAniAmountItem: public SfxInt16Item {
+public:
+ TYPEINFO();
+ SdrTextAniAmountItem(sal_Int16 nVal=0): SfxInt16Item(SDRATTR_TEXT_ANIAMOUNT,nVal) {}
+ SdrTextAniAmountItem(SvStream& rIn): SfxInt16Item(SDRATTR_TEXT_ANIAMOUNT,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual bool HasMetrics() const;
+ virtual bool ScaleMetrics(long nMul, long nDiv);
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+#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 000000000000..c80460b00700
--- /dev/null
+++ b/include/svx/sdtacitm.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef sdtacitm_hxx
+#define sdtacitm_hxx
+
+#include <svl/intitem.hxx>
+#include <svx/svddef.hxx>
+
+// Number of loops. 0=infinite.
+class SdrTextAniCountItem: public SfxUInt16Item {
+public:
+ SdrTextAniCountItem(sal_uInt16 nVal=0): SfxUInt16Item(SDRATTR_TEXT_ANICOUNT,nVal) {}
+ SdrTextAniCountItem(SvStream& rIn): SfxUInt16Item(SDRATTR_TEXT_ANICOUNT,rIn) {}
+};
+
+#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 000000000000..687e906bf2f0
--- /dev/null
+++ b/include/svx/sdtaditm.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 _SDTADITM_HXX
+#define _SDTADITM_HXX
+
+#include <svl/eitem.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+//------------------------------
+// class SdrTextAniDirectionItem
+//------------------------------
+
+enum SdrTextAniDirection {SDRTEXTANI_LEFT,
+ SDRTEXTANI_RIGHT,
+ SDRTEXTANI_UP,
+ SDRTEXTANI_DOWN};
+
+class SVX_DLLPUBLIC SdrTextAniDirectionItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrTextAniDirectionItem(SdrTextAniDirection eDir=SDRTEXTANI_LEFT): SfxEnumItem(SDRATTR_TEXT_ANIDIRECTION,(sal_uInt16)eDir) {}
+ SdrTextAniDirectionItem(SvStream& rIn) : SfxEnumItem(SDRATTR_TEXT_ANIDIRECTION,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const;
+ SdrTextAniDirection GetValue() const { return (SdrTextAniDirection)SfxEnumItem::GetValue(); }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+#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 000000000000..eec63d750a7f
--- /dev/null
+++ b/include/svx/sdtagitm.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 _SDTAGITM_HXX
+#define _SDTAGITM_HXX
+
+#include <svx/sdooitm.hxx>
+#include <svx/svddef.hxx>
+
+//------------------------------------
+// class SdrTextAutoGrowHeightItem
+//------------------------------------
+class SdrTextAutoGrowHeightItem: public SdrOnOffItem {
+public:
+ SdrTextAutoGrowHeightItem(sal_Bool bAuto=sal_True): SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT,bAuto) {}
+ SdrTextAutoGrowHeightItem(SvStream& rIn) : SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT,rIn) {}
+};
+
+//------------------------------------
+// class SdrTextAutoGrowWidthItem
+//------------------------------------
+class SdrTextAutoGrowWidthItem: public SdrOnOffItem {
+public:
+ SdrTextAutoGrowWidthItem(sal_Bool bAuto=sal_False): SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH,bAuto) {}
+ SdrTextAutoGrowWidthItem(SvStream& rIn) : SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH,rIn) {}
+};
+
+#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 000000000000..e9916e33baeb
--- /dev/null
+++ b/include/svx/sdtaiitm.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 _SDTAIITM_HXX
+#define _SDTAIITM_HXX
+
+#include <svx/sdynitm.hxx>
+#include <svx/svddef.hxx>
+
+class SdrTextAniStartInsideItem: public SdrYesNoItem {
+public:
+ SdrTextAniStartInsideItem(sal_Bool bOn=sal_False): SdrYesNoItem(SDRATTR_TEXT_ANISTARTINSIDE,bOn) {}
+ SdrTextAniStartInsideItem(SvStream& rIn) : SdrYesNoItem(SDRATTR_TEXT_ANISTARTINSIDE,rIn) {}
+};
+
+class SdrTextAniStopInsideItem: public SdrYesNoItem {
+public:
+ SdrTextAniStopInsideItem(sal_Bool bOn=sal_False): SdrYesNoItem(SDRATTR_TEXT_ANISTOPINSIDE,bOn) {}
+ SdrTextAniStopInsideItem(SvStream& rIn) : SdrYesNoItem(SDRATTR_TEXT_ANISTOPINSIDE,rIn) {}
+};
+
+#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 000000000000..82e002a95df2
--- /dev/null
+++ b/include/svx/sdtaitm.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 _SDTAITM_HXX
+#define _SDTAITM_HXX
+
+#include <svl/eitem.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+//------------------------------
+// class SdrTextVertAdjustItem
+//------------------------------
+
+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 SVX_DLLPUBLIC SdrTextVertAdjustItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrTextVertAdjustItem(SdrTextVertAdjust eAdj=SDRTEXTVERTADJUST_TOP): SfxEnumItem(SDRATTR_TEXT_VERTADJUST,(sal_uInt16)eAdj) {}
+ SdrTextVertAdjustItem(SvStream& rIn) : SfxEnumItem(SDRATTR_TEXT_VERTADJUST,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const; // { return 5; }
+ SdrTextVertAdjust GetValue() const { return (SdrTextVertAdjust)SfxEnumItem::GetValue(); }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+//------------------------------
+// class SdrTextHorzAdjustItem
+//------------------------------
+
+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 SVX_DLLPUBLIC SdrTextHorzAdjustItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrTextHorzAdjustItem(SdrTextHorzAdjust eAdj=SDRTEXTHORZADJUST_BLOCK): SfxEnumItem(SDRATTR_TEXT_HORZADJUST,(sal_uInt16)eAdj) {}
+ SdrTextHorzAdjustItem(SvStream& rIn) : SfxEnumItem(SDRATTR_TEXT_HORZADJUST,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const;
+ SdrTextHorzAdjust GetValue() const { return (SdrTextHorzAdjust)SfxEnumItem::GetValue(); }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+#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 000000000000..057bfe522535
--- /dev/null
+++ b/include/svx/sdtakitm.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 SDTAKITM_HXX
+#define SDTAKITM_HXX
+
+#include <svl/eitem.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+//------------------------------
+// class SdrTextAniKindItem
+//------------------------------
+
+enum SdrTextAniKind {SDRTEXTANI_NONE,
+ SDRTEXTANI_BLINK,
+ SDRTEXTANI_SCROLL,
+ SDRTEXTANI_ALTERNATE,
+ SDRTEXTANI_SLIDE};
+
+// - SDRTEXTANI_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)
+// - SDRTEXTANI_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.
+// - SDRTEXTANI_ALTERNATE:
+// Like SDRTEXTANI_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 SDRTEXTANI_SCROLL
+// Direction = the starting direction.
+// All Other Parameters: just like SDRTEXTANI_SCROLL
+// - SDRTEXTANI_SLIDE:
+// Text will slide in to 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 SDRTEXTANI_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 SVX_DLLPUBLIC SdrTextAniKindItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrTextAniKindItem(SdrTextAniKind eKind=SDRTEXTANI_NONE): SfxEnumItem(SDRATTR_TEXT_ANIKIND,(sal_uInt16)eKind) {}
+ SdrTextAniKindItem(SvStream& rIn) : SfxEnumItem(SDRATTR_TEXT_ANIKIND,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const; // { return 5; }
+ SdrTextAniKind GetValue() const { return (SdrTextAniKind)SfxEnumItem::GetValue(); }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+#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 000000000000..c852087b83a7
--- /dev/null
+++ b/include/svx/sdtayitm.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 _SDTAYITM_HXX
+#define _SDTAYITM_HXX
+
+#include <svl/intitem.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC SdrTextAniDelayItem: public SfxUInt16Item {
+public:
+ TYPEINFO();
+ SdrTextAniDelayItem(sal_uInt16 nVal=0): SfxUInt16Item(SDRATTR_TEXT_ANIDELAY,nVal) {}
+ SdrTextAniDelayItem(SvStream& rIn): SfxUInt16Item(SDRATTR_TEXT_ANIDELAY,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+#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 000000000000..b7f92f1d0e5a
--- /dev/null
+++ b/include/svx/sdtcfitm.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 _SDTCFITM_HXX
+#define _SDTCFITM_HXX
+
+#include <svx/sdooitm.hxx>
+#include <svx/svddef.hxx>
+
+//------------------------------------
+// class SdrTextContourFrameItem
+//------------------------------------
+class SdrTextContourFrameItem: public SdrOnOffItem {
+public:
+ SdrTextContourFrameItem(sal_Bool bOn=sal_False): SdrOnOffItem(SDRATTR_TEXT_CONTOURFRAME,bOn) {}
+ SdrTextContourFrameItem(SvStream& rIn) : SdrOnOffItem(SDRATTR_TEXT_CONTOURFRAME,rIn) {}
+};
+
+#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 000000000000..c33da1f406f3
--- /dev/null
+++ b/include/svx/sdtditm.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 SDTMITM_HXX
+#define SDTMITM_HXX
+
+#include <svx/sdmetitm.hxx>
+#include <svx/svddef.hxx>
+
+//----------------------------------------------
+// class SdrTextLeft/Right/Upper/LowerDistItem
+//----------------------------------------------
+class SdrTextLeftDistItem: public SdrMetricItem {
+public:
+ SdrTextLeftDistItem(long nHgt=0): SdrMetricItem(SDRATTR_TEXT_LEFTDIST,nHgt) {}
+ SdrTextLeftDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_TEXT_LEFTDIST,rIn) {}
+};
+
+class SdrTextRightDistItem: public SdrMetricItem {
+public:
+ SdrTextRightDistItem(long nHgt=0): SdrMetricItem(SDRATTR_TEXT_RIGHTDIST,nHgt) {}
+ SdrTextRightDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_TEXT_RIGHTDIST,rIn) {}
+};
+
+class SdrTextUpperDistItem: public SdrMetricItem {
+public:
+ SdrTextUpperDistItem(long nHgt=0): SdrMetricItem(SDRATTR_TEXT_UPPERDIST,nHgt) {}
+ SdrTextUpperDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_TEXT_UPPERDIST,rIn) {}
+};
+
+class SdrTextLowerDistItem: public SdrMetricItem {
+public:
+ SdrTextLowerDistItem(long nHgt=0): SdrMetricItem(SDRATTR_TEXT_LOWERDIST,nHgt) {}
+ SdrTextLowerDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_TEXT_LOWERDIST,rIn) {}
+};
+
+#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 000000000000..42874cbc6fb3
--- /dev/null
+++ b/include/svx/sdtfchim.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 _SDTFCHIM_HXX
+#define _SDTFCHIM_HXX
+
+#include <svx/svddef.hxx>
+
+class SVX_DLLPUBLIC SdrTextFixedCellHeightItem : public SfxBoolItem
+{
+public:
+
+ TYPEINFO();
+ SdrTextFixedCellHeightItem( sal_Bool bUseFixedCellHeight = sal_False );
+ SVX_DLLPRIVATE SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion );
+
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation,
+ SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric,
+ OUString &rText, const IntlWrapper * = 0) const;
+
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItem ) const;
+ SVX_DLLPRIVATE virtual SvStream& Store( SvStream&, sal_uInt16 nVersion ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ SVX_DLLPRIVATE virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+
+ SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+#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 000000000000..6d15c560e575
--- /dev/null
+++ b/include/svx/sdtfsitm.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 _SDTFSITM_HXX
+#define _SDTFSITM_HXX
+
+#include <svl/eitem.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+enum SdrFitToSizeType {
+ SDRTEXTFIT_NONE, // - no fit-to-size
+ SDRTEXTFIT_PROPORTIONAL, // - resize all glyhs proportionally
+ // (might scale anisotrophically)
+ SDRTEXTFIT_ALLLINES, // - like SDRTEXTFIT_PROPORTIONAL, but
+ // scales each line separately
+ SDRTEXTFIT_AUTOFIT}; // - mimics PPT's automatic adaption of
+ // font size to text rect - comparable
+ // to SDRTEXTFIT_PROPORTIONAL, but
+ // scales isotrophically
+
+// No AutoGrow and no automatic line breaks for
+// SDRTEXTFIT_PROPORTIONAL and SDRTEXTFIT_ALLLINES.
+// No automatic line breaks for AutoGrowingWidth as well (only if
+// TextMaxFrameWidth is reached).
+
+//--------------------------------
+// class SdrTextFitToSizeTypeItem
+//--------------------------------
+class SVX_DLLPUBLIC SdrTextFitToSizeTypeItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrTextFitToSizeTypeItem(SdrFitToSizeType eFit=SDRTEXTFIT_NONE): SfxEnumItem(SDRATTR_TEXT_FITTOSIZE,(sal_uInt16)eFit) {}
+ SdrTextFitToSizeTypeItem(SvStream& rIn) : SfxEnumItem(SDRATTR_TEXT_FITTOSIZE,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const; // { return 4; }
+ SdrFitToSizeType GetValue() const { return (SdrFitToSizeType)SfxEnumItem::GetValue(); }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+ virtual int HasBoolValue() const;
+ virtual sal_Bool GetBoolValue() const;
+ virtual void SetBoolValue(sal_Bool bVal);
+};
+
+#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 000000000000..6e6ddff28136
--- /dev/null
+++ b/include/svx/sdtmfitm.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 _SDTMFITM_HXX
+#define _SDTMFITM_HXX
+
+#include <svx/sdmetitm.hxx>
+#include <svx/svddef.hxx>
+
+//------------------------------
+// class SdrTextMinFrameHeighItem
+//------------------------------
+class SdrTextMinFrameHeightItem: public SdrMetricItem {
+public:
+ SdrTextMinFrameHeightItem(long nHgt=0): SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT,nHgt) {}
+ SdrTextMinFrameHeightItem(SvStream& rIn): SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT,rIn) {}
+};
+
+//------------------------------
+// class SdrTextMaxFrameHeightItem
+//------------------------------
+class SdrTextMaxFrameHeightItem: public SdrMetricItem {
+public:
+ SdrTextMaxFrameHeightItem(long nHgt=0): SdrMetricItem(SDRATTR_TEXT_MAXFRAMEHEIGHT,nHgt) {}
+ SdrTextMaxFrameHeightItem(SvStream& rIn): SdrMetricItem(SDRATTR_TEXT_MAXFRAMEHEIGHT,rIn) {}
+};
+
+//------------------------------
+// class SdrTextMinFrameWidthItem
+//------------------------------
+class SdrTextMinFrameWidthItem: public SdrMetricItem {
+public:
+ SdrTextMinFrameWidthItem(long nWdt=0): SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH,nWdt) {}
+ SdrTextMinFrameWidthItem(SvStream& rIn): SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH,rIn) {}
+};
+
+//------------------------------
+// class SdrTextMaxFrameWidthItem
+//------------------------------
+class SdrTextMaxFrameWidthItem: public SdrMetricItem {
+public:
+ SdrTextMaxFrameWidthItem(long nWdt=0): SdrMetricItem(SDRATTR_TEXT_MAXFRAMEWIDTH,nWdt) {}
+ SdrTextMaxFrameWidthItem(SvStream& rIn): SdrMetricItem(SDRATTR_TEXT_MAXFRAMEWIDTH,rIn) {}
+};
+
+#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 000000000000..387c3c40f725
--- /dev/null
+++ b/include/svx/sdynitm.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 _SDYNITM_HXX
+#define _SDYNITM_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+
+//------------------------------------------------------------
+// class SdrYesNoItem
+// GetValueTextByVal() returns "yes" or "no"
+// instead of "TRUE" and "FALSE"
+//-------------------------------------------------- ----------
+class SVX_DLLPUBLIC SdrYesNoItem: public SfxBoolItem {
+public:
+ TYPEINFO();
+ SdrYesNoItem(): SfxBoolItem() {}
+ SdrYesNoItem(sal_uInt16 nId, sal_Bool bOn=sal_False): SfxBoolItem(nId,bOn) {}
+ SdrYesNoItem(sal_uInt16 nId, SvStream& rIn): SfxBoolItem(nId,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual OUString GetValueTextByVal(sal_Bool bVal) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+
+#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 000000000000..eff2675eb5f1
--- /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 _SVX_SELCTRL_HXX
+#define _SVX_SELCTRL_HXX
+
+#include <vcl/image.hxx>
+#include <sfx2/stbitem.hxx>
+#include <svx/svxdllapi.h>
+
+/// Status bar control that indicates or changes the selection mode (standard / block / etc.)
+class SVX_DLLPUBLIC SvxSelectionModeControl : 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 );
+ virtual sal_Bool MouseButtonDown( const MouseEvent& rEvt );
+ virtual void Paint( const UserDrawEvent& rEvt );
+
+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 000000000000..e65bbe4b5e74
--- /dev/null
+++ b/include/svx/selectioncontroller.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 _SELECTIONCONTROLLER_HXX
+#define _SELECTIONCONTROLLER_HXX
+
+#include "svx/svxdllapi.h"
+
+#include <boost/shared_ptr.hpp>
+
+#include <cppuhelper/weak.hxx>
+
+class KeyEvent;
+class MouseEvent;
+class Window;
+class SfxItemSet;
+class SfxRequest;
+class SfxStyleSheet;
+class SdrPage;
+class SdrModel;
+
+namespace sdr
+{
+
+class SVX_DLLPUBLIC SelectionController: public cppu::OWeakObject
+{
+public:
+ virtual bool onKeyInput(const KeyEvent& rKEvt, Window* pWin);
+ virtual bool onMouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
+ virtual bool onMouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
+ virtual bool onMouseMove(const MouseEvent& rMEvt, 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 bool GetMarkedObjModel( SdrPage* pNewPage );
+ virtual bool PasteObjModel( const SdrModel& rModel );
+
+ /** returns a format paint brush set from the current selection */
+ virtual bool TakeFormatPaintBrush( boost::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.
+ */
+ virtual bool ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats );
+};
+
+}
+
+#endif //_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 000000000000..d46b6278b749
--- /dev/null
+++ b/include/svx/shapeproperty.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 SVX_SHAPEPROPERTY_HXX
+#define SVX_SHAPEPROPERTY_HXX
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+ //====================================================================
+ //= ShapeProperty
+ //====================================================================
+ enum ShapeProperty
+ {
+ // generic (UNO) shape properties
+ eShapePosition,
+ eShapeSize,
+ // text doc shape properties
+ eTextShapeAnchorType,
+ // spreadsheet doc shape properties
+ eSpreadsheetAnchor,
+
+ // invalid, not to be used
+ eInvalidShapeProperty
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // 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 000000000000..e16c23089658
--- /dev/null
+++ b/include/svx/shapepropertynotifier.hxx
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVX_PROPERTYCHANGENOTIFIER_HXX
+#define SVX_PROPERTYCHANGENOTIFIER_HXX
+
+#include "svx/svxdllapi.h"
+#include "svx/shapeproperty.hxx"
+
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+#include <memory>
+
+namespace cppu
+{
+ class OWeakObject;
+}
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+ //====================================================================
+ //= IPropertyValueProvider
+ //====================================================================
+ /** a provider for a property value
+ */
+ class SVX_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( ::com::sun::star::uno::Any& _out_rValue ) const = 0;
+
+ virtual ~IPropertyValueProvider();
+ };
+ typedef ::boost::shared_ptr< IPropertyValueProvider > PPropertyValueProvider;
+
+ //====================================================================
+ //= PropertyValueProvider
+ //====================================================================
+ /** default implementation of a IPropertyValueProvider
+
+ This default implementation queries the object which it is constructed with for the XPropertySet interface,
+ and calls the getPropertyValue method.
+ */
+ class SVX_DLLPUBLIC PropertyValueProvider :public IPropertyValueProvider
+ ,public ::boost::noncopyable
+ {
+ public:
+ PropertyValueProvider( ::cppu::OWeakObject& _rContext, const sal_Char* _pAsciiPropertyName )
+ :m_rContext( _rContext )
+ ,m_sPropertyName( OUString::createFromAscii( _pAsciiPropertyName ) )
+ {
+ }
+
+ virtual OUString getPropertyName() const;
+ virtual void getCurrentValue( ::com::sun::star::uno::Any& _out_rValue ) const;
+
+ protected:
+ ::cppu::OWeakObject& getContext() const { return m_rContext; }
+ 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 SVX_DLLPUBLIC PropertyChangeNotifier : public ::boost::noncopyable
+ {
+ 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 maintanance
+ void addPropertyChangeListener( const OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener );
+ void removePropertyChangeListener( const OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener );
+
+ /** registers a IPropertyValueProvider
+ */
+ void registerProvider( const ShapeProperty _eProperty, const PPropertyValueProvider _pProvider );
+
+ /** 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:
+ ::std::auto_ptr< PropertyChangeNotifier_Data > m_pData;
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // SVX_PROPERTYCHANGENOTIFIER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/simptabl.hxx b/include/svx/simptabl.hxx
new file mode 100644
index 000000000000..8e448bc8b2c0
--- /dev/null
+++ b/include/svx/simptabl.hxx
@@ -0,0 +1,157 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_SIMPTABL_HXX
+#define _SVX_SIMPTABL_HXX
+
+#include <vcl/morebtn.hxx>
+
+#include <vcl/combobox.hxx>
+
+#include <vcl/group.hxx>
+#include <svtools/headbar.hxx>
+#include <svtools/svtabbx.hxx>
+#include <vcl/lstbox.hxx>
+#include "svx/svxdllapi.h"
+
+class SvxSimpleTable;
+class SVX_DLLPUBLIC SvxSimpleTableContainer : public Control
+{
+private:
+ SvxSimpleTable* m_pTable;
+
+protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+public:
+ SvxSimpleTableContainer( Window* pParent, const ResId& rResId );
+ SvxSimpleTableContainer( Window* pParent, WinBits nBits = WB_BORDER );
+
+ void SetTable(SvxSimpleTable* pTable);
+
+ virtual void Resize();
+
+ virtual void GetFocus();
+};
+
+class SVX_DLLPUBLIC SvxSimpleTable : public SvHeaderTabListBox
+{
+private:
+ SvxSimpleTableContainer& m_rParentTableContainer;
+
+ Link aHeaderBarClickLink;
+ Link aHeaderBarDblClickLink;
+ Link aCommandLink;
+ CommandEvent aCEvt;
+ HeaderBar aHeaderBar;
+ long nOldPos;
+ sal_uInt16 nHeaderItemId;
+ sal_Bool bResizeFlag;
+ sal_Bool bPaintFlag;
+ sal_Bool bSortDirection;
+ sal_uInt16 nSortCol;
+
+ DECL_LINK( StartDragHdl, HeaderBar* );
+ DECL_LINK( DragHdl, HeaderBar* );
+ DECL_LINK( EndDragHdl, HeaderBar* );
+ DECL_LINK( HeaderBarClick, HeaderBar* );
+ DECL_LINK( HeaderBarDblClick, HeaderBar* );
+ DECL_LINK( CompareHdl, SvSortData* );
+
+protected:
+
+ virtual void NotifyScrolled();
+
+ virtual void SetTabs();
+ virtual void Paint( const Rectangle& rRect );
+
+ virtual void HBarClick();
+ virtual void HBarDblClick();
+ virtual void HBarStartDrag();
+ virtual void HBarDrag();
+ virtual void HBarEndDrag();
+
+ virtual void Command( const CommandEvent& rCEvt );
+
+ virtual StringCompare ColCompare(SvTreeListEntry*,SvTreeListEntry*);
+public:
+
+ SvxSimpleTable(SvxSimpleTableContainer& rParent, WinBits nBits = WB_BORDER);
+ ~SvxSimpleTable();
+
+ void UpdateViewSize();
+
+ void InsertHeaderEntry(const OUString& rText,
+ sal_uInt16 nCol=HEADERBAR_APPEND,
+ HeaderBarItemBits nBits = HIB_STDSTYLE);
+
+ void SetTabs( long* pTabs, MapUnit = MAP_APPFONT );
+
+ void ClearHeader();
+
+ // to be removed all calls of the related methods are redirected to *Table() methods
+ using Window::Show;
+ using Window::Hide;
+ using Window::Enable;
+ using Window::Disable;
+ using Window::ToTop;
+
+ void Show();
+ void Hide();
+ void Enable();
+ void Disable();
+ void ToTop();
+
+ // remove until this line
+
+ void ShowTable();
+ void HideTable();
+ sal_Bool IsVisible() const;
+
+ void EnableTable();
+ void DisableTable();
+ sal_Bool IsEnabled() const;
+
+ sal_uInt16 GetSelectedCol();
+ void SortByCol(sal_uInt16,sal_Bool bDir=sal_True);
+ sal_Bool GetSortDirection(){ return bSortDirection;}
+ sal_uInt16 GetSortedCol(){ return nSortCol;}
+ SvLBoxItem* GetEntryAtPos( SvTreeListEntry* pEntry, sal_uInt16 nPos ) const;
+
+ CommandEvent GetCommandEvent()const;
+ inline sal_Bool IsFocusOnCellEnabled() const { return IsCellFocusEnabled(); }
+
+ void SetCommandHdl( const Link& rLink ) { aCommandLink = rLink; }
+ const Link& GetCommandHdl() const { return aCommandLink; }
+
+ void SetHeaderBarClickHdl( const Link& rLink ) { aHeaderBarClickLink = rLink; }
+ const Link& GetHeaderBarClickHdl() const { return aHeaderBarClickLink; }
+
+ void SetHeaderBarDblClickHdl( const Link& rLink ) { aHeaderBarDblClickLink = rLink; }
+ const Link& GetHeaderBarDblClickHdl() const { return aHeaderBarDblClickLink; }
+
+ void SetHeaderBarHelpId(const OString& rHelpId) {aHeaderBar.SetHelpId(rHelpId);}
+
+ HeaderBar& GetTheHeaderBar() {return aHeaderBar;}
+};
+
+
+#endif // _SVX_SIMPTABL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sphere3d.hxx b/include/svx/sphere3d.hxx
new file mode 100644
index 000000000000..eb1bb7dfdb00
--- /dev/null
+++ b/include/svx/sphere3d.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 _E3D_SPHERE3D_HXX
+#define _E3D_SPHERE3D_HXX
+
+#include <svx/obj3d.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* Kugelobjekt mit Durchmesser r3DSize; Anzahl der Flaechen wird durch
+|* die horizontale und vertikale Segmentanzahl vorgegeben
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC E3dSphereObj : public E3dCompoundObject
+{
+private:
+ basegfx::B3DPoint aCenter;
+ basegfx::B3DVector aSize;
+
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+ void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+
+public:
+ TYPEINFO();
+ E3dSphereObj(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(int dummy);
+
+ // horizontal segments:
+ sal_uInt32 GetHorizontalSegments() const
+ { return ((const Svx3DHorizontalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); }
+
+ // VerticalSegments:
+ sal_uInt32 GetVerticalSegments() const
+ { return ((const Svx3DVerticalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); }
+
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+ virtual E3dSphereObj* Clone() const;
+
+ 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 void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+};
+
+#endif // _E3D_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 000000000000..9282e3e8cc7e
--- /dev/null
+++ b/include/svx/srchdlg.hxx
@@ -0,0 +1,282 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_SRCHDLG_HXX
+#define _SVX_SRCHDLG_HXX
+
+#include <svtools/stdctrl.hxx>
+#include <vcl/combobox.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/button.hxx>
+#include <vcl/group.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/dialog.hxx>
+#include <sfx2/childwin.hxx>
+#include <sfx2/basedlgs.hxx>
+#include <svtools/svmedit.hxx>
+#include <svl/srchdefs.hxx>
+#include "svx/svxdllapi.h"
+#include <vector>
+
+class SvxSearchItem;
+class MoreButton;
+class SfxStyleSheetBasePool;
+class SvxJSearchOptionsPage;
+class SvxSearchController;
+
+struct SearchDlg_Impl;
+
+#ifndef NO_SVX_SEARCH
+
+// struct SearchAttrItem -------------------------------------------------
+
+struct SearchAttrItem
+{
+ sal_uInt16 nSlot;
+ SfxPoolItem* pItem;
+};
+
+// class SearchAttrItemList ----------------------------------------------
+
+typedef std::vector<SearchAttrItem> 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, size_t nLen = 1);
+};
+
+#ifndef SV_NODIALOG
+
+// class SvxSearchDialogWrapper ------------------------------------------
+
+class SvxSearchDialog;
+class SVX_DLLPUBLIC SvxSearchDialogWrapper : public SfxChildWindow
+{
+ SvxSearchDialog *dialog;
+public:
+ SvxSearchDialogWrapper( Window*pParent, sal_uInt16 nId,
+ SfxBindings* pBindings, SfxChildWinInfo* pInfo );
+
+ ~SvxSearchDialogWrapper ();
+ SvxSearchDialog *getDialog ();
+ SFX_DECL_CHILDWINDOW_WITHID(SvxSearchDialogWrapper);
+};
+
+// class SvxSearchDialog -------------------------------------------------
+
+/*
+ {k:\svx\prototyp\dialog\svx/srchdlg.hxx}
+
+ [Description]
+ 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.
+
+ [Items]
+ <SvxSearchItem><SID_ATTR_SEARCH>
+*/
+
+class SvxSearchDialog : public SfxModelessDialog
+{
+friend class SvxSearchController;
+friend class SvxSearchDialogWrapper;
+friend class SvxJSearchOptionsDialog;
+
+public:
+ SvxSearchDialog( Window* pParent, SfxChildWindow* pChildWin, SfxBindings& rBind );
+ ~SvxSearchDialog();
+
+ virtual sal_Bool Close();
+
+ // Window
+ virtual void Activate();
+
+ const SearchAttrItemList* GetSearchItemList() const
+ { return pSearchList; }
+ const SearchAttrItemList* GetReplaceItemList() const
+ { return pReplaceList; }
+
+ inline sal_Bool HasSearchAttributes() const;
+ inline sal_Bool HasReplaceAttributes() const;
+
+ PushButton& GetReplaceBtn() { return aReplaceBtn; }
+
+ sal_Int32 GetTransliterationFlags() const;
+
+ void SetSaveToModule(bool b);
+
+private:
+ FixedText aSearchText;
+ ComboBox aSearchLB;
+ ListBox aSearchTmplLB;
+ FixedInfo aSearchAttrText;
+
+ FixedText aReplaceText;
+ ComboBox aReplaceLB;
+ ListBox aReplaceTmplLB;
+ FixedInfo aReplaceAttrText;
+
+ PushButton aSearchBtn;
+ PushButton aSearchAllBtn;
+ FixedLine aSearchCmdLine;
+ PushButton aReplaceBtn;
+ PushButton aReplaceAllBtn;
+
+ FixedLine aSearchComponentFL;
+ PushButton aSearchComponent1PB;
+ PushButton aSearchComponent2PB;
+
+ CheckBox aMatchCaseCB;
+ CheckBox aWordBtn;
+
+ FixedLine aButtonsFL;
+ MoreButton* pMoreBtn;
+ HelpButton aHelpBtn;
+ CancelButton aCloseBtn;
+
+ FixedLine aOptionsFL;
+ CheckBox aSelectionBtn;
+ CheckBox aBackwardsBtn;
+ CheckBox aRegExpBtn;
+ CheckBox aSimilarityBox;
+ PushButton aSimilarityBtn;
+ CheckBox aLayoutBtn;
+ CheckBox aNotesBtn;
+ CheckBox aJapMatchFullHalfWidthCB;
+ CheckBox aJapOptionsCB;
+ PushButton aJapOptionsBtn;
+
+ PushButton aAttributeBtn;
+ PushButton aFormatBtn;
+ PushButton aNoFormatBtn;
+
+ FixedLine aCalcFL;
+ FixedText aCalcSearchInFT;
+ ListBox aCalcSearchInLB;
+ FixedText aCalcSearchDirFT;
+ RadioButton aRowsBtn;
+ RadioButton aColumnsBtn;
+ CheckBox aAllSheetsCB;
+
+ SfxBindings& rBindings;
+ sal_Bool bWriter;
+ sal_Bool bSearch;
+ sal_Bool bFormat;
+ sal_uInt16 nOptions;
+ bool bSet;
+ bool bReadOnly;
+ bool bConstruct;
+ sal_uIntPtr nModifyFlag;
+ String aStylesStr;
+ String aLayoutStr;
+ String aLayoutWriterStr;
+ String aLayoutCalcStr;
+ String aCalcStr;
+
+ std::vector<OUString> aSearchStrings;
+ std::vector<OUString> aReplaceStrings;
+
+ SearchDlg_Impl* pImpl;
+ SearchAttrItemList* pSearchList;
+ SearchAttrItemList* pReplaceList;
+ SvxSearchItem* pSearchItem;
+
+ SvxSearchController* pSearchController;
+ SvxSearchController* pOptionsController;
+ SvxSearchController* pFamilyController;
+ SvxSearchController* pSearchSetController;
+ SvxSearchController* pReplaceSetController;
+
+ mutable sal_Int32 nTransliterationFlags;
+
+#ifdef _SVX_SRCHDLG_CXX
+ DECL_LINK( ModifyHdl_Impl, ComboBox* pEdit );
+ DECL_LINK( FlagHdl_Impl, Control* pCtrl );
+ DECL_LINK( CommandHdl_Impl, Button* pBtn );
+ DECL_LINK(TemplateHdl_Impl, void *);
+ DECL_LINK( FocusHdl_Impl, Control* );
+ DECL_LINK(LoseFocusHdl_Impl, void *);
+ DECL_LINK(FormatHdl_Impl, void *);
+ DECL_LINK(NoFormatHdl_Impl, void *);
+ DECL_LINK(AttributeHdl_Impl, void *);
+ DECL_LINK( TimeoutHdl_Impl, Timer* );
+
+ void Construct_Impl();
+ void InitControls_Impl();
+ void CalculateDelta_Impl();
+ void Init_Impl( int bHasItemSet );
+ void InitAttrList_Impl( const SfxItemSet* pSSet,
+ const SfxItemSet* pRSet );
+ void Remember_Impl( const String &rStr,sal_Bool bSearch );
+ void PaintAttrText_Impl();
+ String& BuildAttrText_Impl( String& rStr, sal_Bool bSrchFlag ) const;
+
+ void TemplatesChanged_Impl( SfxStyleSheetBasePool& rPool );
+ void EnableControls_Impl( const sal_uInt16 nFlags );
+ void EnableControl_Impl( Control* pCtrl );
+ void SetItem_Impl( const SvxSearchItem* pItem );
+
+ void SetModifyFlag_Impl( const Control* pCtrl );
+ void SaveToModule_Impl();
+
+ void ApplyTransliterationFlags_Impl( sal_Int32 nSettings );
+#endif
+};
+
+inline sal_Bool SvxSearchDialog::HasSearchAttributes() const
+{
+ sal_Bool bLen = !aSearchAttrText.GetText().isEmpty();
+ return ( aSearchAttrText.IsEnabled() && bLen );
+}
+
+inline sal_Bool SvxSearchDialog::HasReplaceAttributes() const
+{
+ sal_Bool bLen = !aReplaceAttrText.GetText().isEmpty();
+ return ( aReplaceAttrText.IsEnabled() && bLen );
+}
+
+
+//////////////////////////////////////////////////////////////////////
+
+
+#endif // SV_NODIALOG
+#endif // NO_SVX_SEARCH
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/stddlg.hxx b/include/svx/stddlg.hxx
new file mode 100644
index 000000000000..8f65c17a8781
--- /dev/null
+++ b/include/svx/stddlg.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 _SVX_STDDLG_HXX
+#define _SVX_STDDLG_HXX
+
+#include <sfx2/basedlgs.hxx>
+#include "svx/svxdllapi.h"
+
+// class SvxStandardDialog -----------------------------------------------
+
+class SVX_DLLPUBLIC SvxStandardDialog: public SfxModalDialog
+{
+public:
+ SvxStandardDialog( Window* pParent, const ResId& rResId );
+ SvxStandardDialog( Window* pParent, const OString& rID, const OUString& rUIXMLDescription );
+ ~SvxStandardDialog();
+
+ short Execute();
+
+protected:
+ virtual void Apply() = 0; // pure virtual!!!
+};
+
+
+#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 000000000000..9599ae3f3fc4
--- /dev/null
+++ b/include/svx/strarray.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 _SVX_STRARRAY_HXX
+#define _SVX_STRARRAY_HXX
+
+#include <tools/resary.hxx>
+#include "svx/svxdllapi.h"
+
+// class SvxStringArray -------------------------------------------------
+
+class SVX_DLLPUBLIC SvxStringArray : public ResStringArray
+{
+public:
+ SvxStringArray( sal_uInt32 nResId );
+ SvxStringArray( const ResId& rResId );
+ ~SvxStringArray();
+
+ const OUString GetStringByPos( sal_uInt32 nPos ) const;
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/subtoolboxcontrol.hxx b/include/svx/subtoolboxcontrol.hxx
new file mode 100644
index 000000000000..f3f1bb52cf04
--- /dev/null
+++ b/include/svx/subtoolboxcontrol.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 _SVX_SUBTOOLBOXCONTROL_HXX
+#define _SVX_SUBTOOLBOXCONTROL_HXX
+
+#include "svx/svxdllapi.h"
+#include <sfx2/tbxctrl.hxx>
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxSubToolBoxControl : public SfxToolBoxControl
+{
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxSubToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxSubToolBoxControl();
+
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+};
+
+//
+//----------------------------------------------------------------------------
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svdattr.hxx b/include/svx/svdattr.hxx
new file mode 100644
index 000000000000..dbe29bb9a874
--- /dev/null
+++ b/include/svx/svdattr.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 _SVDATTR_HXX
+#define _SVDATTR_HXX
+
+#include <svl/solar.hrc>
+#include <tools/solar.h>
+#include <svx/sdangitm.hxx>
+#include <svx/sderitm.hxx>
+#include <svx/sdmetitm.hxx>
+#include <svx/sdooitm.hxx>
+#include <svx/sdprcitm.hxx>
+#include <svx/sdshcitm.hxx>
+#include <svx/sdshitm.hxx>
+#include <svx/sdshtitm.hxx>
+#include <svx/sdsxyitm.hxx>
+#include <svx/sdtaaitm.hxx>
+#include <svx/sdtacitm.hxx>
+#include <svx/sdtaditm.hxx>
+#include <svx/sdtagitm.hxx>
+#include <svx/sdtaiitm.hxx>
+#include <svx/sdtaitm.hxx>
+#include <svx/sdtakitm.hxx>
+#include <svx/sdtayitm.hxx>
+#include <svx/sdtcfitm.hxx>
+#include <svx/sdtditm.hxx>
+#include <svx/sdtfsitm.hxx>
+#include <svx/sdtmfitm.hxx>
+#include <svx/sdynitm.hxx>
+#include <svx/sdgluitm.hxx>
+#include <svx/sdginitm.hxx>
+#include <svx/sdgtritm.hxx>
+#include <svx/sdgcoitm.hxx>
+#include <svx/sdggaitm.hxx>
+#include <svx/sdasitm.hxx>
+#include <svx/sdgmoitm.hxx>
+#include <svx/sdasaitm.hxx>
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svdattrx.hxx b/include/svx/svdattrx.hxx
new file mode 100644
index 000000000000..ca1aa00c4292
--- /dev/null
+++ b/include/svx/svdattrx.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 _SVDATTRX_HXX
+#define _SVDATTRX_HXX
+
+#include <svx/sxmlhitm.hxx>
+#include <svx/sxallitm.hxx>
+#include <svx/sxcaitm.hxx>
+#include <svx/sxcecitm.hxx>
+
+#include <svx/sxcgitm.hxx>
+#include <svx/sxciaitm.hxx>
+#include <svx/sxcikitm.hxx>
+#include <svx/sxcllitm.hxx>
+#include <svx/sxctitm.hxx>
+#include <svx/sxekitm.hxx>
+#include <svx/sxelditm.hxx>
+#include <svx/sxenditm.hxx>
+
+#include <svx/sxfiitm.hxx>
+
+#include <svx/sxlayitm.hxx>
+#include <svx/sxlogitm.hxx>
+#include <svx/sxmbritm.hxx>
+#include <svx/sxmfsitm.hxx>
+#include <svx/sxmkitm.hxx>
+#include <svx/sxmoitm.hxx>
+#include <svx/sxmovitm.hxx>
+
+#include <svx/sxmsitm.hxx>
+#include <svx/sxmspitm.hxx>
+#include <svx/sxmsuitm.hxx>
+#include <svx/sxmtaitm.hxx>
+#include <svx/sxmtfitm.hxx>
+#include <svx/sxmtpitm.hxx>
+#include <svx/sxmtritm.hxx>
+#include <svx/sxmuitm.hxx>
+#include <svx/sxoneitm.hxx>
+#include <svx/sxonitm.hxx>
+#include <svx/sxopitm.hxx>
+#include <svx/sxraitm.hxx>
+#include <svx/sxreaitm.hxx>
+#include <svx/sxreoitm.hxx>
+#include <svx/sxroaitm.hxx>
+#include <svx/sxrooitm.hxx>
+#include <svx/sxsaitm.hxx>
+#include <svx/sxsalitm.hxx>
+#include <svx/sxsiitm.hxx>
+#include <svx/sxsoitm.hxx>
+#include <svx/sxtraitm.hxx>
+
+#endif //_SVDATTRX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svdcrtv.hxx b/include/svx/svdcrtv.hxx
new file mode 100644
index 000000000000..9a95ba1d377d
--- /dev/null
+++ b/include/svx/svdcrtv.hxx
@@ -0,0 +1,200 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDCRTV_HXX
+#define _SVDCRTV_HXX
+
+#include <svx/svddrgv.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class XLineAttrSetItem;
+class XFillAttrSetItem;
+class SdrEdgeObj;
+class SdrObjConnection;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@@@ @@@@@ @@@@@ @@@@ @@@@@@ @@@@@ @@ @@ @@ @@@@@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
+// @@ @@@@@ @@@@ @@@@@@ @@ @@@@ @@@@@ @@ @@@@ @@@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
+// @@@@ @@ @@ @@@@@ @@ @@ @@ @@@@@ @ @@ @@@@@ @@ @@
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+class ImplConnectMarkerOverlay;
+class ImpSdrCreateViewExtraData;
+
+class SVX_DLLPUBLIC SdrCreateView: public SdrDragView
+{
+ friend class SdrPageView;
+
+protected:
+ SdrObject* pAktCreate; // Currently in creation of the located object
+ SdrPageView* pCreatePV; // Here, the creation is started
+ ImplConnectMarkerOverlay* mpCoMaOverlay;
+
+ // for migrating stuff from XOR, use ImpSdrCreateViewExtraData ATM to not need to
+ // compile the apps all the time
+ ImpSdrCreateViewExtraData* mpCreateViewExtraData;
+
+ Pointer aAktCreatePointer;
+
+ sal_Int32 nAutoCloseDistPix;
+ sal_Int32 nFreeHandMinDistPix;
+ sal_uInt32 nAktInvent; // set the current ones
+ sal_uInt16 nAktIdent; // Obj for re-creating
+
+ unsigned bAutoTextEdit : 1; // Textedit after we start the creation of a text frame
+ unsigned b1stPointAsCenter : 1;
+ unsigned bUseIncompatiblePathCreateInterface : 1;
+ unsigned bAutoClosePolys : 1;
+
+ void ImpClearConnectMarker();
+
+private:
+ SVX_DLLPRIVATE void ImpClearVars();
+
+protected:
+ sal_Bool ImpBegCreateObj(sal_uInt32 nInvent, sal_uInt16 nIdent, const Point& rPnt, OutputDevice* pOut,
+ sal_Int16 nMinMov, SdrPageView* pPV, const Rectangle& rLogRect, SdrObject* pPreparedFactoryObject);
+
+ void ShowCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/);
+ void HideCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/);
+ sal_Bool CheckEdgeMode();
+
+protected:
+ // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
+ SdrCreateView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ virtual ~SdrCreateView();
+
+public:
+ virtual sal_Bool IsAction() const;
+ virtual void MovAction(const Point& rPnt);
+ virtual void EndAction();
+ virtual void BckAction();
+ virtual void BrkAction();
+ virtual void TakeActionRect(Rectangle& rRect) const;
+
+ virtual sal_Bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
+
+ void SetActiveLayer(const String& rName) { aAktLayer=rName; }
+ const String& GetActiveLayer() const { return aAktLayer; }
+ void SetMeasureLayer(const String& rName) { aMeasureLayer=rName; }
+ const String& GetMeasureLayer() const { return aMeasureLayer; }
+
+ // 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(sal_Bool bOn=sal_True) { SdrDragView::SetEditMode(bOn); CheckEdgeMode(); }
+ void SetCreateMode(sal_Bool bOn=sal_True) { SdrDragView::SetCreateMode(bOn); CheckEdgeMode(); }
+ void SetGluePointEditMode(sal_Bool bOn=sal_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, sal_uInt32 nInvent=SdrInventor);
+ void TakeCurrentObj(sal_uInt16& nIdent, sal_uInt32& nInvent) const { nInvent=nAktInvent; nIdent=nAktIdent; }
+ sal_uInt32 GetCurrentObjInventor() const { return nAktInvent; }
+ sal_uInt16 GetCurrentObjIdentifier() const { return nAktIdent; }
+
+ // Starten des normalen Create
+ sal_Bool BegCreateObj(const Point& rPnt, OutputDevice* pOut=NULL, short nMinMov=-3, SdrPageView* pPV=NULL);
+ sal_Bool BegCreatePreparedObject(const Point& rPnt, sal_Int16 nMinMov, SdrObject* pPreparedFactoryObject);
+ void MovCreateObj(const Point& rPnt);
+ sal_Bool EndCreateObj(SdrCreateCmd eCmd);
+ void BckCreateObj(); // go back one polygon point
+ void BrkCreateObj();
+ sal_Bool IsCreateObj() const { return pAktCreate!=NULL; }
+ SdrObject* GetCreateObj() const { return pAktCreate; }
+
+ // BegCreateCaptionObj() creates a SdrCaptionObj (legend item).
+ // rObjSiz is the initial size of the legend text frame.
+ // only the length of the tip is dragged
+ sal_Bool BegCreateCaptionObj(const Point& rPnt, const Size& rObjSiz, OutputDevice* pOut=NULL, short nMinMov=-3, SdrPageView* pPV=NULL);
+
+ // If TextEditAfterCreate is sal_True (the default),
+ // then after the creation of a TextFrame object (OBJ_TEXT,
+ // OBJ_TEXTEXT, OBJ_OUTLINERTEXT, OBJ_TITLETEXT, OBJ_CAPTION)
+ // automatically start a TextEdit (SdrObjEditView: SdrBeginTextEdit)
+ sal_Bool IsTextEditAfterCreate() const { return bAutoTextEdit; }
+ void SetTextEditAfterCreate(sal_Bool bOn) { bAutoTextEdit = bOn; }
+
+ // 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.
+ sal_Bool IsCreate1stPointAsCenter() const { return b1stPointAsCenter; }
+ void SetCreate1stPointAsCenter(sal_Bool bOn) { b1stPointAsCenter = bOn; }
+
+ // For polylines (OBJ_PLIN) and freehand lines (OBJ_FREELINE). If this
+ // Flag is sal_True, these two types of objects are implicitly closed, and
+ // converted to Polygon (OBJ_POLY) or freehand fill (OBJ_FREEFILL) if
+ // the distance between the start point and end point of the
+ // Object <= nAutoCloseDistPix pixels.
+ // Default is TRUE.
+ sal_Bool IsAutoClosePolys() const { return bAutoClosePolys; }
+ void SetAutoClosePolys(sal_Bool bOn) { bAutoClosePolys=bOn; }
+
+ // Default=5 Pixel.
+ sal_uInt16 GetAutoCloseDistPix() const { return sal_uInt16(nAutoCloseDistPix); }
+ void SetAutoCloseDistPix(sal_uInt16 nVal) { nAutoCloseDistPix=nVal; }
+
+ // Vorgabe des minimalen Pixelabstands zwischen 2 Bezierpunkten bei der
+ // Erzeugung einer Freihandlinie.
+ // Default=10 Pixel.
+ sal_uInt16 GetFreeHandMinDistPix() const { return sal_uInt16(nFreeHandMinDistPix); }
+ void SetFreeHandMinDistPix(sal_uInt16 nVal) { nFreeHandMinDistPix=nVal; }
+
+ // Wer das (zur restlichen Create-Funktionalitaet von SvDraw) inkompatible
+ // Create-Interface am PathObj beibehalten moechte muss das nachfolgende
+ // Flag setzen. Dieses wirkt sich aus bei den Objekttypen:
+ // OBJ_POLY, OBJ_PLIN, OBJ_PATHLINE, OBJ_PATHFILL
+ // Dieses Flag hat nur voruebergehenden Character. Die betroffenen
+ // Applikationen sollten alsbald umgestellt werden.
+ // Default=sal_False;
+ sal_Bool IsUseIncompatiblePathCreateInterface() const { return bUseIncompatiblePathCreateInterface; }
+ void SetUseIncompatiblePathCreateInterface(sal_Bool bOn) { bUseIncompatiblePathCreateInterface = bOn; }
+ void SetConnectMarker(const SdrObjConnection& rCon, const SdrPageView& rPV);
+ void HideConnectMarker();
+
+ // Attribute des ggf. gerade in der Erzeugung befindlichen Objekts
+ /* new interface src537 */
+ sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const;
+
+ sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll);
+ SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(sal_Bool& rOk) const;
+ sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
+};
+
+#endif //_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 000000000000..af70697f5053
--- /dev/null
+++ b/include/svx/svddef.hxx
@@ -0,0 +1,306 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDDEF_HXX
+#define _SVDDEF_HXX
+
+#include <svx/xdef.hxx>
+
+/*************************************************************************/
+// SdrItemPool V2, 09-11-1995:
+// 7 neue Items fuer XLineAttrSetItem
+// 7 neue Items fuer XFillAttrSetItem
+// 8 neue Items fuer SdrShadowSetItem
+// 5 neue Items fuer SdrCaptionSetItem
+// 25 neue Items fuer SdrMiscSetItem
+// 6 neue Items fuer SdrNotPersist
+// SdrItemPool V3, 29-02-1996
+// 17 neue Items fuer XFillAttrSetItem (Bitmapfuellungen) (von KA)
+// SdrItemPool V4, 10-08-1996
+// 45 neue Items fuer Edge und Measure (Verbinder und Bemassungsobjekt) (von Joe)
+// SdrItemPool V4+, 18-10-1996
+// 8 neue Items fuer CircItems
+// 18 neue Items fuer NotPersist+Umbau dort
+// SdrItemPool V4++, 13-11-1996
+// 2 neue Items fuer NotPersist+(MoveX/Y)
+// SdrItemPool V4+++, 07-06-1999
+// 15 neue Items fuer NotPersist (Reserve)
+// 15 neue Items fuer GrafItems
+//
+// WhichMapping:
+// V1 Range = 1000..1065 (66)
+// V2 Range = 1000..1123 (124) (58 neue Whiches)
+// V3 Range = 1000..1140 (141) (17 neue Whiches)
+// V4 Range = 1000..1185 (186) (45 neue 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, und hinten noch 6 neue dran
+// |<------------ 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
+
+#define SDRATTR_START XATTR_START /* 1000 */
+ /* Pool V4*/ /* Pool V3*/ /* Pool V2*/
+#define SDRATTR_SHADOW_FIRST (XATTR_END + 1) /* 1067 */ /* 1067 */ /* 1050 */ /* Pool V1: 1036 */
+#define SDRATTR_SHADOW (SDRATTR_SHADOW_FIRST+ 0) /* 1067 */ /* 1067 */ /* 1050 */
+#define SDRATTR_SHADOWCOLOR (SDRATTR_SHADOW_FIRST+ 1) /* 1068 */ /* 1068 */ /* 1051 */
+#define SDRATTR_SHADOWXDIST (SDRATTR_SHADOW_FIRST+ 2) /* 1069 */ /* 1069 */ /* 1052 */
+#define SDRATTR_SHADOWYDIST (SDRATTR_SHADOW_FIRST+ 3) /* 1070 */ /* 1070 */ /* 1053 */
+#define SDRATTR_SHADOWTRANSPARENCE (SDRATTR_SHADOW_FIRST+ 4) /* 1071 */ /* 1071 */ /* 1054 */ /* Pool V2 */
+#define SDRATTR_SHADOW3D (SDRATTR_SHADOW_FIRST+ 5) /* 1072 */ /* 1072 */ /* 1055 */ /* Pool V2 */
+#define SDRATTR_SHADOWPERSP (SDRATTR_SHADOW_FIRST+ 6) /* 1073 */ /* 1073 */ /* 1056 */ /* Pool V2 */
+#define SDRATTR_SHADOW_LAST (SDRATTR_SHADOWPERSP) /* 1078 */ /* 1078 */ /* 1061 */ /* Pool V1: 1039 */
+
+#define SDRATTR_CAPTION_FIRST (SDRATTR_SHADOW_LAST + 1) /* 1080 */ /* 1080 */ /* 1063 */ /* Pool V1: 1041 */
+#define SDRATTR_CAPTIONTYPE (SDRATTR_CAPTION_FIRST+ 0) /* 1080 */ /* 1080 */ /* 1063 */
+#define SDRATTR_CAPTIONFIXEDANGLE (SDRATTR_CAPTION_FIRST+ 1) /* 1081 */ /* 1081 */ /* 1064 */
+#define SDRATTR_CAPTIONANGLE (SDRATTR_CAPTION_FIRST+ 2) /* 1082 */ /* 1082 */ /* 1065 */
+#define SDRATTR_CAPTIONGAP (SDRATTR_CAPTION_FIRST+ 3) /* 1083 */ /* 1083 */ /* 1066 */
+#define SDRATTR_CAPTIONESCDIR (SDRATTR_CAPTION_FIRST+ 4) /* 1084 */ /* 1084 */ /* 1067 */
+#define SDRATTR_CAPTIONESCISREL (SDRATTR_CAPTION_FIRST+ 5) /* 1085 */ /* 1085 */ /* 1068 */
+#define SDRATTR_CAPTIONESCREL (SDRATTR_CAPTION_FIRST+ 6) /* 1086 */ /* 1086 */ /* 1069 */
+#define SDRATTR_CAPTIONESCABS (SDRATTR_CAPTION_FIRST+ 7) /* 1087 */ /* 1087 */ /* 1070 */
+#define SDRATTR_CAPTIONLINELEN (SDRATTR_CAPTION_FIRST+ 8) /* 1088 */ /* 1088 */ /* 1071 */
+#define SDRATTR_CAPTIONFITLINELEN (SDRATTR_CAPTION_FIRST+ 9) /* 1089 */ /* 1089 */ /* 1072 */
+#define SDRATTR_CAPTION_LAST (SDRATTR_CAPTIONFITLINELEN) /* 1094 */ /* 1094 */ /* 1077 */ /* Pool V1: 1050 */
+
+#define SDRATTR_MISC_FIRST (SDRATTR_CAPTION_LAST + 1) /* 1097 */ /* 1097 */ /* 1080 */ /* Pool V1: 1053 */
+#define SDRATTR_ECKENRADIUS (SDRATTR_MISC_FIRST + 0) /* 1097 */ /* 1097 */ /* 1080 long, def=0 */
+#define SDRATTR_TEXT_MINFRAMEHEIGHT (SDRATTR_MISC_FIRST + 1) /* 1098 */ /* 1098 */ /* 1081 long, def=0 */
+#define SDRATTR_TEXT_AUTOGROWHEIGHT (SDRATTR_MISC_FIRST + 2) /* 1099 */ /* 1099 */ /* 1082 sal_Bool, def=sal_True */
+#define SDRATTR_TEXT_FITTOSIZE (SDRATTR_MISC_FIRST + 3) /* 1100 */ /* 1100 */ /* 1083 enum, def=SDRTEXTFIT_NONE */
+#define SDRATTR_TEXT_LEFTDIST (SDRATTR_MISC_FIRST + 4) /* 1101 */ /* 1101 */ /* 1084 long, def=0 */ /* Pool V2 */
+#define SDRATTR_TEXT_RIGHTDIST (SDRATTR_MISC_FIRST + 5) /* 1102 */ /* 1102 */ /* 1085 long, def=0 */ /* Pool V2 */
+#define SDRATTR_TEXT_UPPERDIST (SDRATTR_MISC_FIRST + 6) /* 1103 */ /* 1103 */ /* 1086 long, def=0 */ /* Pool V2 */
+#define SDRATTR_TEXT_LOWERDIST (SDRATTR_MISC_FIRST + 7) /* 1104 */ /* 1104 */ /* 1087 long, def=0 */ /* Pool V2 */
+#define SDRATTR_TEXT_VERTADJUST (SDRATTR_MISC_FIRST + 8) /* 1105 */ /* 1105 */ /* 1088 enum, def=SDRTEXTVERTADJUST_TOP */ /* Pool V2 */
+#define SDRATTR_TEXT_MAXFRAMEHEIGHT (SDRATTR_MISC_FIRST + 9) /* 1106 */ /* 1106 */ /* 1089 long, def=0 - Pool V2 */
+#define SDRATTR_TEXT_MINFRAMEWIDTH (SDRATTR_MISC_FIRST +10) /* 1107 */ /* 1107 */ /* 1090 long, def=0 - Pool V2 */
+#define SDRATTR_TEXT_MAXFRAMEWIDTH (SDRATTR_MISC_FIRST +11) /* 1108 */ /* 1108 */ /* 1091 long, def=0 - Pool V2 */
+#define SDRATTR_TEXT_AUTOGROWWIDTH (SDRATTR_MISC_FIRST +12) /* 1109 */ /* 1109 */ /* 1092 sal_Bool, def=sal_False - Pool V2 */
+#define SDRATTR_TEXT_HORZADJUST (SDRATTR_MISC_FIRST +13) /* 1110 */ /* 1110 */ /* 1093 enum, def=SDRTEXTHORZADJUST_LEFT */ /* Pool V2+ (04-12-1995) */
+#define SDRATTR_TEXT_ANIKIND (SDRATTR_MISC_FIRST +14) /* 1111 */ /* 1111 */ /* 1094 enum, def=SDRTEXTANI_NONE - Pool V2/V4 */
+#define SDRATTR_TEXT_ANIDIRECTION (SDRATTR_MISC_FIRST +15) /* 1112 */ /* 1112 */ /* 1095 enum, def=SDRTEXTANI_LEFT - Pool V2/V4 */
+#define SDRATTR_TEXT_ANISTARTINSIDE (SDRATTR_MISC_FIRST +16) /* 1113 */ /* 1113 */ /* 1096 sal_Bool, def=sal_False - Pool V2/V4 */
+#define SDRATTR_TEXT_ANISTOPINSIDE (SDRATTR_MISC_FIRST +17) /* 1114 */ /* 1114 */ /* 1097 sal_Bool, def=sal_False - Pool V2/V4 */
+#define SDRATTR_TEXT_ANICOUNT (SDRATTR_MISC_FIRST +18) /* 1115 */ /* 1115 */ /* 1098 sal_uInt16, def=0 - Pool V2/V4 */
+#define SDRATTR_TEXT_ANIDELAY (SDRATTR_MISC_FIRST +19) /* 1116 */ /* 1116 */ /* 1099 sal_uInt16, def=0 - Pool V2/V4 */
+#define SDRATTR_TEXT_ANIAMOUNT (SDRATTR_MISC_FIRST +20) /* 1117 */ /* 1117 */ /* 1100 sal_uInt16, def=0 - Pool V2/V4 */
+#define SDRATTR_TEXT_CONTOURFRAME (SDRATTR_MISC_FIRST +21) /* 1118 */ /* 1118 */ /* 1101 */ /* Pool V2 */
+#define SDRATTR_CUSTOMSHAPE_ADJUSTMENT (SDRATTR_MISC_FIRST +22) /* 1119 */ /* 1119 */ /* 1102 */ /* Pool V2 */
+#define SDRATTR_XMLATTRIBUTES (SDRATTR_MISC_FIRST +23) /* 1120 */ /* 1120 */ /* 1103 */ /* Pool V2 */
+#define SDRATTR_TEXT_USEFIXEDCELLHEIGHT (SDRATTR_MISC_FIRST +24) /* 1121 */ /* 1121 */ /* 1104 */ /* Pool V2 */
+#define SDRATTR_TEXT_WORDWRAP (SDRATTR_MISC_FIRST +25) /* 1122 */ /* 1122 */ /* 1105 */ /* Pool V2 */
+#define SDRATTR_TEXT_AUTOGROWSIZE (SDRATTR_MISC_FIRST +26) /* 1123 */ /* 1123 */ /* 1106 */ /* Pool V2 */
+#define SDRATTR_MISC_LAST (SDRATTR_TEXT_AUTOGROWSIZE) /* 1125 */ /* 1125 */ /* 1108 */ /* Pool V1: 1056 */
+
+#define SDRATTR_EDGE_FIRST (SDRATTR_MISC_LAST + 1) /* 1127 */ /* Pool V4 */
+#define SDRATTR_EDGEKIND (SDRATTR_EDGE_FIRST + 0) /* 1127 */ /* Pool V4 */
+#define SDRATTR_EDGENODE1HORZDIST (SDRATTR_EDGE_FIRST + 1) /* 1128 */ /* Pool V4 */
+#define SDRATTR_EDGENODE1VERTDIST (SDRATTR_EDGE_FIRST + 2) /* 1129 */ /* Pool V4 */
+#define SDRATTR_EDGENODE2HORZDIST (SDRATTR_EDGE_FIRST + 3) /* 1130 */ /* Pool V4 */
+#define SDRATTR_EDGENODE2VERTDIST (SDRATTR_EDGE_FIRST + 4) /* 1131 */ /* Pool V4 */
+#define SDRATTR_EDGENODE1GLUEDIST (SDRATTR_EDGE_FIRST + 5) /* 1132 */ /* Pool V4 */
+#define SDRATTR_EDGENODE2GLUEDIST (SDRATTR_EDGE_FIRST + 6) /* 1133 */ /* Pool V4 */
+#define SDRATTR_EDGELINEDELTAANZ (SDRATTR_EDGE_FIRST + 7) /* 1134 */ /* Pool V4 */
+#define SDRATTR_EDGELINE1DELTA (SDRATTR_EDGE_FIRST + 8) /* 1135 */ /* Pool V4 */
+#define SDRATTR_EDGELINE2DELTA (SDRATTR_EDGE_FIRST + 9) /* 1136 */ /* Pool V4 */
+#define SDRATTR_EDGELINE3DELTA (SDRATTR_EDGE_FIRST +10) /* 1137 */ /* Pool V4 */
+#define SDRATTR_EDGE_LAST (SDRATTR_EDGELINE3DELTA) /* 1145 */ /* Pool V4 */
+
+#define SDRATTR_MEASURE_FIRST (SDRATTR_EDGE_LAST + 1) /* 1147 */ /* Pool V4 */
+#define SDRATTR_MEASUREKIND (SDRATTR_MEASURE_FIRST+ 0) /* 1147 */ /* Pool V4 */
+#define SDRATTR_MEASURETEXTHPOS (SDRATTR_MEASURE_FIRST+ 1) /* 1148 */ /* Pool V4 */
+#define SDRATTR_MEASURETEXTVPOS (SDRATTR_MEASURE_FIRST+ 2) /* 1149 */ /* Pool V4 */
+#define SDRATTR_MEASURELINEDIST (SDRATTR_MEASURE_FIRST+ 3) /* 1150 */ /* Pool V4 */
+#define SDRATTR_MEASUREHELPLINEOVERHANG (SDRATTR_MEASURE_FIRST+ 4) /* 1151 */ /* Pool V4 */
+#define SDRATTR_MEASUREHELPLINEDIST (SDRATTR_MEASURE_FIRST+ 5) /* 1152 */ /* Pool V4 */
+#define SDRATTR_MEASUREHELPLINE1LEN (SDRATTR_MEASURE_FIRST+ 6) /* 1153 */ /* Pool V4 */
+#define SDRATTR_MEASUREHELPLINE2LEN (SDRATTR_MEASURE_FIRST+ 7) /* 1154 */ /* Pool V4 */
+#define SDRATTR_MEASUREBELOWREFEDGE (SDRATTR_MEASURE_FIRST+ 8) /* 1155 */ /* Pool V4 */
+#define SDRATTR_MEASURETEXTROTA90 (SDRATTR_MEASURE_FIRST+ 9) /* 1156 */ /* Pool V4 */
+#define SDRATTR_MEASURETEXTUPSIDEDOWN (SDRATTR_MEASURE_FIRST+10) /* 1157 */ /* Pool V4 */
+#define SDRATTR_MEASUREOVERHANG (SDRATTR_MEASURE_FIRST+11) /* 1158 */ /* Pool V4 */
+#define SDRATTR_MEASUREUNIT (SDRATTR_MEASURE_FIRST+12) /* 1159 */ /* Pool V4 */
+#define SDRATTR_MEASURESCALE (SDRATTR_MEASURE_FIRST+13) /* 1160 */ /* Pool V4 */
+#define SDRATTR_MEASURESHOWUNIT (SDRATTR_MEASURE_FIRST+14) /* 1161 */ /* Pool V4 */
+#define SDRATTR_MEASUREFORMATSTRING (SDRATTR_MEASURE_FIRST+15) /* 1162 */ /* Pool V4 */
+#define SDRATTR_MEASURETEXTAUTOANGLE (SDRATTR_MEASURE_FIRST+16) /* 1163 */ /* Pool V4, Nachtrag 25-9-1996 */
+#define SDRATTR_MEASURETEXTAUTOANGLEVIEW (SDRATTR_MEASURE_FIRST+17) /* 1164 */ /* Pool V4, Nachtrag 25-9-1996 */
+#define SDRATTR_MEASURETEXTISFIXEDANGLE (SDRATTR_MEASURE_FIRST+18) /* 1165 */ /* Pool V4, Nachtrag 25-9-1996 */
+#define SDRATTR_MEASURETEXTFIXEDANGLE (SDRATTR_MEASURE_FIRST+19) /* 1166 */ /* Pool V4, Nachtrag 25-9-1996 */
+#define SDRATTR_MEASUREDECIMALPLACES (SDRATTR_MEASURE_FIRST+20) /* 1167 */ /* Pool V4 */
+#define SDRATTR_MEASURE_LAST (SDRATTR_MEASUREDECIMALPLACES) /* 1170 */ /* Pool V4 */
+
+#define SDRATTR_CIRC_FIRST (SDRATTR_MEASURE_LAST+ 1) /* 1172 */ /* Pool V4+ */
+#define SDRATTR_CIRCKIND (SDRATTR_CIRC_FIRST+ 0) /* 1172 */ /* Pool V4+ */
+#define SDRATTR_CIRCSTARTANGLE (SDRATTR_CIRC_FIRST+ 1) /* 1173 */ /* Pool V4+ */
+#define SDRATTR_CIRCENDANGLE (SDRATTR_CIRC_FIRST+ 2) /* 1174 */ /* Pool V4+ */
+#define SDRATTR_CIRC_LAST (SDRATTR_CIRCENDANGLE) /* 1178 */ /* Pool V4+ */
+
+// Only for Interfaceing, not yet implemented. / * + * V4 /
+#define SDRATTR_NOTPERSIST_FIRST (SDRATTR_CIRC_LAST + 1) /* 1180 */ /* 1172 */ /* 1127 */ /* 1110 */ /* Pool V1: 1058 */
+#define SDRATTR_OBJMOVEPROTECT (SDRATTR_NOTPERSIST_FIRST+ 0) /* 1180 sal_Bool, def=sal_False */
+#define SDRATTR_OBJSIZEPROTECT (SDRATTR_NOTPERSIST_FIRST+ 1) /* 1181 sal_Bool, def=sal_False */
+#define SDRATTR_OBJPRINTABLE (SDRATTR_NOTPERSIST_FIRST+ 2) /* 1182 sal_Bool, def=sal_True */
+#define SDRATTR_LAYERID (SDRATTR_NOTPERSIST_FIRST+ 3) /* 1183 sal_uInt16, def=0 */
+#define SDRATTR_LAYERNAME (SDRATTR_NOTPERSIST_FIRST+ 4) /* 1184 String, def="" */
+#define SDRATTR_OBJECTNAME (SDRATTR_NOTPERSIST_FIRST+ 5) /* 1185 String, def="" */
+#define SDRATTR_ALLPOSITIONX (SDRATTR_NOTPERSIST_FIRST+ 6) /* 1186 long, def=0 */
+#define SDRATTR_ALLPOSITIONY (SDRATTR_NOTPERSIST_FIRST+ 7) /* 1187 long, def=0 */
+#define SDRATTR_ALLSIZEWIDTH (SDRATTR_NOTPERSIST_FIRST+ 8) /* 1188 long, def=0 */
+#define SDRATTR_ALLSIZEHEIGHT (SDRATTR_NOTPERSIST_FIRST+ 9) /* 1189 long, def=0 */
+#define SDRATTR_ONEPOSITIONX (SDRATTR_NOTPERSIST_FIRST+10) /* 1190 long, def=0 */
+#define SDRATTR_ONEPOSITIONY (SDRATTR_NOTPERSIST_FIRST+11) /* 1191 long, def=0 */
+#define SDRATTR_ONESIZEWIDTH (SDRATTR_NOTPERSIST_FIRST+12) /* 1192 long, def=0 */
+#define SDRATTR_ONESIZEHEIGHT (SDRATTR_NOTPERSIST_FIRST+13) /* 1193 long, def=0 */
+#define SDRATTR_LOGICSIZEWIDTH (SDRATTR_NOTPERSIST_FIRST+14) /* 1194 long, def=0 */
+#define SDRATTR_LOGICSIZEHEIGHT (SDRATTR_NOTPERSIST_FIRST+15) /* 1195 long, def=0 */
+#define SDRATTR_ROTATEANGLE (SDRATTR_NOTPERSIST_FIRST+16) /* 1196 long, def=0 */
+#define SDRATTR_SHEARANGLE (SDRATTR_NOTPERSIST_FIRST+17) /* 1197 long, def=0 */
+#define SDRATTR_MOVEX (SDRATTR_NOTPERSIST_FIRST+18) /* 1198 long, def=0 */
+#define SDRATTR_MOVEY (SDRATTR_NOTPERSIST_FIRST+19) /* 1199 long, def=0 */
+#define SDRATTR_RESIZEXONE (SDRATTR_NOTPERSIST_FIRST+20) /* 1200 long, def=0 */
+#define SDRATTR_RESIZEYONE (SDRATTR_NOTPERSIST_FIRST+21) /* 1201 long, def=0 */
+#define SDRATTR_ROTATEONE (SDRATTR_NOTPERSIST_FIRST+22) /* 1202 long, def=0 */
+#define SDRATTR_HORZSHEARONE (SDRATTR_NOTPERSIST_FIRST+23) /* 1203 long, def=0 */
+#define SDRATTR_VERTSHEARONE (SDRATTR_NOTPERSIST_FIRST+24) /* 1204 long, def=0 */
+#define SDRATTR_RESIZEXALL (SDRATTR_NOTPERSIST_FIRST+25) /* 1205 long, def=0 */
+#define SDRATTR_RESIZEYALL (SDRATTR_NOTPERSIST_FIRST+26) /* 1206 long, def=0 */
+#define SDRATTR_ROTATEALL (SDRATTR_NOTPERSIST_FIRST+27) /* 1207 long, def=0 */
+#define SDRATTR_HORZSHEARALL (SDRATTR_NOTPERSIST_FIRST+28) /* 1208 long, def=0 */
+#define SDRATTR_VERTSHEARALL (SDRATTR_NOTPERSIST_FIRST+29) /* 1209 long, def=0 */
+#define SDRATTR_TRANSFORMREF1X (SDRATTR_NOTPERSIST_FIRST+30) /* 1210 long, def=0 */
+#define SDRATTR_TRANSFORMREF1Y (SDRATTR_NOTPERSIST_FIRST+31) /* 1211 long, def=0 */
+#define SDRATTR_TRANSFORMREF2X (SDRATTR_NOTPERSIST_FIRST+32) /* 1212 long, def=0 */
+#define SDRATTR_TRANSFORMREF2Y (SDRATTR_NOTPERSIST_FIRST+33) /* 1213 long, def=0 */
+#define SDRATTR_TEXTDIRECTION (SDRATTR_NOTPERSIST_FIRST+34) /* 1214 V4+++ long, def=0 */
+#define SDRATTR_OBJVISIBLE (SDRATTR_NOTPERSIST_FIRST+35)
+#define SDRATTR_NOTPERSIST_LAST (SDRATTR_OBJVISIBLE) /* 1228 V4+++*/ /* 1213*/ /* 1085 */ /* 1040 */ /* 1123 */ /* Pool V1: 1065 */
+// no SetItem for this
+
+#define SDRATTR_GRAF_FIRST (SDRATTR_NOTPERSIST_LAST+1) /* 1229 V4+++*/
+#define SDRATTR_GRAFRED (SDRATTR_GRAF_FIRST+0) /* 1229 V4+++*/
+#define SDRATTR_GRAFGREEN (SDRATTR_GRAF_FIRST+1) /* 1230 V4+++*/
+#define SDRATTR_GRAFBLUE (SDRATTR_GRAF_FIRST+2) /* 1231 V4+++*/
+#define SDRATTR_GRAFLUMINANCE (SDRATTR_GRAF_FIRST+3) /* 1232 V4+++*/
+#define SDRATTR_GRAFCONTRAST (SDRATTR_GRAF_FIRST+4) /* 1233 V4+++*/
+#define SDRATTR_GRAFGAMMA (SDRATTR_GRAF_FIRST+5) /* 1234 V4+++*/
+#define SDRATTR_GRAFTRANSPARENCE (SDRATTR_GRAF_FIRST+6) /* 1235 V4+++*/
+#define SDRATTR_GRAFINVERT (SDRATTR_GRAF_FIRST+7) /* 1236 V4+++*/
+#define SDRATTR_GRAFMODE (SDRATTR_GRAF_FIRST+8) /* 1237 V4+++*/
+#define SDRATTR_GRAFCROP (SDRATTR_GRAF_FIRST+9) /* 1238 V4+++*/
+#define SDRATTR_GRAF_LAST (SDRATTR_GRAFCROP) /* 1242 V4+++*/
+
+#define SDRATTR_3D_FIRST (SDRATTR_GRAF_LAST + 1) /* 1244 V4+++*/
+
+#define SDRATTR_3DOBJ_FIRST (SDRATTR_3D_FIRST) /* 1244 V4+++*/
+#define SDRATTR_3DOBJ_PERCENT_DIAGONAL (SDRATTR_3DOBJ_FIRST + 0) /* 1244 V4+++*/
+#define SDRATTR_3DOBJ_BACKSCALE (SDRATTR_3DOBJ_FIRST + 1) /* 1245 V4+++*/
+#define SDRATTR_3DOBJ_DEPTH (SDRATTR_3DOBJ_FIRST + 2) /* 1246 V4+++*/
+#define SDRATTR_3DOBJ_HORZ_SEGS (SDRATTR_3DOBJ_FIRST + 3) /* 1247 V4+++*/
+#define SDRATTR_3DOBJ_VERT_SEGS (SDRATTR_3DOBJ_FIRST + 4) /* 1248 V4+++*/
+#define SDRATTR_3DOBJ_END_ANGLE (SDRATTR_3DOBJ_FIRST + 5) /* 1249 V4+++*/
+#define SDRATTR_3DOBJ_DOUBLE_SIDED (SDRATTR_3DOBJ_FIRST + 6) /* 1250 V4+++*/
+#define SDRATTR_3DOBJ_NORMALS_KIND (SDRATTR_3DOBJ_FIRST + 7) /* 1251 V4+++*/
+#define SDRATTR_3DOBJ_NORMALS_INVERT (SDRATTR_3DOBJ_FIRST + 8) /* 1252 V4+++*/
+#define SDRATTR_3DOBJ_TEXTURE_PROJ_X (SDRATTR_3DOBJ_FIRST + 9) /* 1253 V4+++*/
+#define SDRATTR_3DOBJ_TEXTURE_PROJ_Y (SDRATTR_3DOBJ_FIRST + 10) /* 1254 V4+++*/
+#define SDRATTR_3DOBJ_SHADOW_3D (SDRATTR_3DOBJ_FIRST + 11) /* 1255 V4+++*/
+#define SDRATTR_3DOBJ_MAT_COLOR (SDRATTR_3DOBJ_FIRST + 12) /* 1256 V4+++*/
+#define SDRATTR_3DOBJ_MAT_EMISSION (SDRATTR_3DOBJ_FIRST + 13) /* 1257 V4+++*/
+#define SDRATTR_3DOBJ_MAT_SPECULAR (SDRATTR_3DOBJ_FIRST + 14) /* 1258 V4+++*/
+#define SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY (SDRATTR_3DOBJ_FIRST + 15) /* 1259 V4+++*/
+#define SDRATTR_3DOBJ_TEXTURE_KIND (SDRATTR_3DOBJ_FIRST + 16) /* 1260 V4+++*/
+#define SDRATTR_3DOBJ_TEXTURE_MODE (SDRATTR_3DOBJ_FIRST + 17) /* 1261 V4+++*/
+#define 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
+#define SDRATTR_3DOBJ_SMOOTH_NORMALS (SDRATTR_3DOBJ_FIRST + 19) /* 1263 V4+++*/
+#define SDRATTR_3DOBJ_SMOOTH_LIDS (SDRATTR_3DOBJ_FIRST + 20) /* 1264 V4+++*/
+#define SDRATTR_3DOBJ_CHARACTER_MODE (SDRATTR_3DOBJ_FIRST + 21) /* 1265 V4+++*/
+#define SDRATTR_3DOBJ_CLOSE_FRONT (SDRATTR_3DOBJ_FIRST + 22) /* 1266 V4+++*/
+#define 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
+#define SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY (SDRATTR_3DOBJ_FIRST + 24) /* 1268 V4+++*/
+
+#define SDRATTR_3DOBJ_LAST (SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY) /* 1282 V4+++*/
+
+#define SDRATTR_3DSCENE_FIRST (SDRATTR_3DOBJ_LAST + 1) /* 1283 V4+++*/
+#define SDRATTR_3DSCENE_PERSPECTIVE (SDRATTR_3DSCENE_FIRST + 0) /* 1283 V4+++*/
+#define SDRATTR_3DSCENE_DISTANCE (SDRATTR_3DSCENE_FIRST + 1) /* 1284 V4+++*/
+#define SDRATTR_3DSCENE_FOCAL_LENGTH (SDRATTR_3DSCENE_FIRST + 2) /* 1285 V4+++*/
+#define SDRATTR_3DSCENE_TWO_SIDED_LIGHTING (SDRATTR_3DSCENE_FIRST + 3) /* 1286 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTCOLOR_1 (SDRATTR_3DSCENE_FIRST + 4) /* 1287 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTCOLOR_2 (SDRATTR_3DSCENE_FIRST + 5) /* 1288 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTCOLOR_3 (SDRATTR_3DSCENE_FIRST + 6) /* 1289 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTCOLOR_4 (SDRATTR_3DSCENE_FIRST + 7) /* 1290 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTCOLOR_5 (SDRATTR_3DSCENE_FIRST + 8) /* 1291 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTCOLOR_6 (SDRATTR_3DSCENE_FIRST + 9) /* 1292 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTCOLOR_7 (SDRATTR_3DSCENE_FIRST + 10) /* 1293 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTCOLOR_8 (SDRATTR_3DSCENE_FIRST + 11) /* 1294 V4+++*/
+#define SDRATTR_3DSCENE_AMBIENTCOLOR (SDRATTR_3DSCENE_FIRST + 12) /* 1295 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTON_1 (SDRATTR_3DSCENE_FIRST + 13) /* 1296 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTON_2 (SDRATTR_3DSCENE_FIRST + 14) /* 1297 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTON_3 (SDRATTR_3DSCENE_FIRST + 15) /* 1298 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTON_4 (SDRATTR_3DSCENE_FIRST + 16) /* 1299 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTON_5 (SDRATTR_3DSCENE_FIRST + 17) /* 1300 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTON_6 (SDRATTR_3DSCENE_FIRST + 18) /* 1301 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTON_7 (SDRATTR_3DSCENE_FIRST + 19) /* 1302 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTON_8 (SDRATTR_3DSCENE_FIRST + 20) /* 1303 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTDIRECTION_1 (SDRATTR_3DSCENE_FIRST + 21) /* 1304 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTDIRECTION_2 (SDRATTR_3DSCENE_FIRST + 22) /* 1305 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTDIRECTION_3 (SDRATTR_3DSCENE_FIRST + 23) /* 1306 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTDIRECTION_4 (SDRATTR_3DSCENE_FIRST + 24) /* 1307 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTDIRECTION_5 (SDRATTR_3DSCENE_FIRST + 25) /* 1308 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTDIRECTION_6 (SDRATTR_3DSCENE_FIRST + 26) /* 1309 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTDIRECTION_7 (SDRATTR_3DSCENE_FIRST + 27) /* 1310 V4+++*/
+#define SDRATTR_3DSCENE_LIGHTDIRECTION_8 (SDRATTR_3DSCENE_FIRST + 28) /* 1311 V4+++*/
+#define SDRATTR_3DSCENE_SHADOW_SLANT (SDRATTR_3DSCENE_FIRST + 29) /* 1312 V4+++*/
+#define SDRATTR_3DSCENE_SHADE_MODE (SDRATTR_3DSCENE_FIRST + 30) /* 1313 V4+++*/
+#define SDRATTR_3DSCENE_LAST (SDRATTR_3DSCENE_SHADE_MODE) /* 1333 V4+++*/
+#define SDRATTR_3D_LAST (SDRATTR_3DSCENE_LAST) /* 1333 V4+++*/
+
+#define SDRATTR_CUSTOMSHAPE_FIRST (SDRATTR_3D_LAST + 1) /* 1334 V4+++*/
+#define SDRATTR_CUSTOMSHAPE_ENGINE (SDRATTR_CUSTOMSHAPE_FIRST + 0) /* 1334 V4+++*/
+#define SDRATTR_CUSTOMSHAPE_DATA (SDRATTR_CUSTOMSHAPE_FIRST + 1) /* 1335 V4+++*/
+#define SDRATTR_CUSTOMSHAPE_GEOMETRY (SDRATTR_CUSTOMSHAPE_FIRST + 2) /* 1336 V4+++*/
+#define SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL (SDRATTR_CUSTOMSHAPE_FIRST + 3) /* 1337 V4+++*/
+#define SDRATTR_CUSTOMSHAPE_LAST (SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL) /* 1357 V4+++*/
+
+#define SDRATTR_TABLE_FIRST (SDRATTR_CUSTOMSHAPE_LAST+1)
+#define SDRATTR_TABLE_BORDER (SDRATTR_TABLE_FIRST+0)
+#define SDRATTR_TABLE_BORDER_INNER (SDRATTR_TABLE_FIRST+1)
+#define SDRATTR_TABLE_BORDER_TLBR (SDRATTR_TABLE_FIRST+2)
+#define SDRATTR_TABLE_BORDER_BLTR (SDRATTR_TABLE_FIRST+3)
+
+#define SDRATTR_TABLE_LAST (SDRATTR_TABLE_BORDER_BLTR)
+
+#define SDRATTR_END SDRATTR_TABLE_LAST /* 1357 */ /* 1333 V4+++*/ /* 1243 V4+++*/ /*1213*/ /*1085*/ /*1040*/ /*Pool V2: 1123,V1: 1065 */
+
+#endif // _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 000000000000..a5236e1579c2
--- /dev/null
+++ b/include/svx/svddrag.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 _SVDDRAG_HXX
+#define _SVDDRAG_HXX
+
+
+#include <tools/gen.hxx>
+#include <tools/fract.hxx>
+#include "svx/svxdllapi.h"
+
+// 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 SVX_DLLPUBLIC SdrDragStatUserData
+{
+};
+
+class SVX_DLLPUBLIC SdrDragStat {
+protected:
+ SdrHdl* pHdl; // Der Handle an dem der User zottelt
+ SdrView* pView;
+ SdrPageView* pPageView;
+ std::vector<Point*> aPnts; // Alle bisherigen Punkte: [0]=Start, [Count()-2]=Prev
+ Point aRef1; // Referenzpunkt: Resize-Fixpunkt, (Drehachse,
+ Point aRef2; // Spiegelachse, ...)
+ Point aPos0; // Position beim letzten Event
+ Point aRealPos0; // Position beim letzten Event
+ Point aRealNow; // Aktuelle Dragposition ohne Snap, Ortho und Limit
+ Point aRealLast; // RealPos des letzten Punkts (fuer MinMoved)
+ Rectangle aActionRect;
+
+ // Reserve fuer kompatible Erweiterungen, die sonst inkompatibel wuerden.
+ Point aReservePoint1;
+ Point aReservePoint2;
+ Point aReservePoint3;
+ Point aReservePoint4;
+ Rectangle aReserveRect1;
+ Rectangle aReserveRect2;
+ bool bEndDragChangesAttributes;
+ bool bEndDragChangesGeoAndAttributes;
+ bool bMouseIsUp;
+ bool aReserveBool3;
+ bool aReserveBool4;
+ long aReserveLong1;
+ long aReserveLong2;
+ long aReserveLong3;
+ long aReserveLong4;
+ void* aReservePtr1;
+ void* aReservePtr2;
+ void* aReservePtr3;
+ void* aReservePtr4;
+
+ 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;
+
+protected:
+ void Clear(bool bLeaveOne);
+ Point& Pnt(sal_uIntPtr nNum) { return *aPnts[nNum]; }
+//public:
+ SdrDragStatUserData* pUser; // Userdata
+public:
+ SdrDragStat(): aPnts() { pUser=NULL; Reset(); }
+ ~SdrDragStat() { Clear(sal_False); }
+ 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_uIntPtr nNum) const { return *aPnts[nNum]; }
+ sal_uIntPtr GetPointAnz() const { return aPnts.size(); }
+ const Point& GetStart() const { return GetPoint(0); }
+ Point& Start() { return Pnt(0); }
+ const Point& GetPrev() const { return GetPoint(GetPointAnz()-(GetPointAnz()>=2 ? 2:1)); }
+ Point& Prev() { return Pnt(GetPointAnz()-(GetPointAnz()>=2 ? 2:1)); }
+ const Point& GetPos0() const { return aPos0; }
+ Point& Pos0() { return aPos0; }
+ const Point& GetNow() const { return GetPoint(GetPointAnz()-1); }
+ Point& Now() { return Pnt(GetPointAnz()-1); }
+ const Point& GetRealNow() const { return aRealNow; }
+ Point& RealNow() { return aRealNow; }
+ const Point& GetRef1() const { return aRef1; }
+ Point& Ref1() { return aRef1; }
+ const Point& GetRef2() const { return aRef2; }
+ Point& Ref2() { return aRef2; }
+ const SdrHdl* GetHdl() const { return pHdl; }
+ void SetHdl(SdrHdl* pH) { pHdl=pH; }
+ SdrDragStatUserData* GetUser() const { return pUser; }
+ void SetUser(SdrDragStatUserData* pU) { pUser=pU; }
+ bool IsShown() const { return bShown; }
+ void SetShown(bool bOn) { bShown=bOn; }
+
+ bool IsMinMoved() const { return bMinMoved; }
+ void SetMinMoved() { bMinMoved=sal_True; }
+ void ResetMinMoved() { bMinMoved=sal_False; }
+ void SetMinMove(sal_uInt16 nDist) { nMinMov=nDist; if (nMinMov<1) nMinMov=1; }
+ sal_uInt16 GetMinMove() const { return nMinMov; }
+
+ 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; }
+
+ // Is set by the view and can be evaluated by Obj
+ bool IsMouseDown() const { return !bMouseIsUp; }
+ void SetMouseDown(bool bDown) { bMouseIsUp=!bDown; }
+
+ Point KorregPos(const Point& rNow, const Point& rPrev) const;
+ void Reset(const Point& rPnt);
+ void NextMove(const Point& rPnt);
+ void NextPoint(bool bSaveReal=sal_False);
+ 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 Rectangle& GetActionRect() const { return aActionRect; }
+ void SetActionRect(const Rectangle& rR) { aActionRect=rR; }
+
+ // also considering 1stPointAsCenter
+ void TakeCreateRect(Rectangle& rRect) const;
+};
+
+#endif //_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 000000000000..3fc7fbb38168
--- /dev/null
+++ b/include/svx/svddrgmt.hxx
@@ -0,0 +1,320 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDDRGMT_HXX
+#define _SVDDRGMT_HXX
+
+#include <svx/svddrgv.hxx>
+#include "svx/svxdllapi.h"
+#include <svx/sdr/contact/objectcontact.hxx>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@@@@ @@@@@ @@@@ @@@@ @@ @@ @@@@@ @@@@@@ @@ @@ @@@@ @@@@@ @@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@@@@ @@@@@@ @@ @@@ @@@@@@@ @@@@ @@ @@@@@@ @@ @@ @@ @@ @@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@@@@ @@ @@ @@ @@ @@@@@ @@ @@ @@@@@ @@ @@ @@ @@@@ @@@@@ @@@@
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SdrDragView;
+class SdrDragStat;
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrDragEntry
+{
+private:
+ // bitfield
+ unsigned mbAddToTransparent : 1;
+
+protected:
+ // access for derived classes
+ void setAddToTransparent(bool bNew) { mbAddToTransparent = bNew; }
+
+public:
+ SdrDragEntry();
+ virtual ~SdrDragEntry();
+
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) = 0;
+
+ // data read access
+ bool getAddToTransparent() const { return mbAddToTransparent; }
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrDragEntryPolyPolygon : public SdrDragEntry
+{
+private:
+ basegfx::B2DPolyPolygon maOriginalPolyPolygon;
+
+public:
+ SdrDragEntryPolyPolygon(const basegfx::B2DPolyPolygon& rOriginalPolyPolygon);
+ virtual ~SdrDragEntryPolyPolygon();
+
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod);
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SdrDragEntrySdrObject : public SdrDragEntry
+{
+private:
+ const SdrObject& maOriginal;
+ SdrObject* mpClone;
+ sdr::contact::ObjectContact& mrObjectContact;
+ bool mbModify;
+
+public:
+ SdrDragEntrySdrObject(const SdrObject& rOriginal, sdr::contact::ObjectContact& rObjectContact, bool bModify);
+ virtual ~SdrDragEntrySdrObject();
+
+ // #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 mpClone; }
+
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod);
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SdrDragEntryPrimitive2DSequence : public SdrDragEntry
+{
+private:
+ drawinglayer::primitive2d::Primitive2DSequence maPrimitive2DSequence;
+
+public:
+ SdrDragEntryPrimitive2DSequence(
+ const drawinglayer::primitive2d::Primitive2DSequence& rSequence,
+ bool bAddToTransparent);
+ virtual ~SdrDragEntryPrimitive2DSequence();
+
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod);
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SdrDragEntryPointGlueDrag : public SdrDragEntry
+{
+private:
+ std::vector< basegfx::B2DPoint > maPositions;
+ bool mbIsPointDrag;
+
+public:
+ SdrDragEntryPointGlueDrag(const std::vector< basegfx::B2DPoint >& rPositions, bool bIsPointDrag);
+ virtual ~SdrDragEntryPointGlueDrag();
+
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod);
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrDragMethod
+{
+private:
+ std::vector< SdrDragEntry* > maSdrDragEntries;
+ sdr::overlay::OverlayObjectList maOverlayObjectList;
+ SdrDragView& mrSdrDragView;
+
+ // bitfield
+ unsigned mbMoveOnly : 1;
+ unsigned mbSolidDraggingActive : 1;
+
+protected:
+ // access for derivated classes to maSdrDragEntries
+ void clearSdrDragEntries();
+ void addSdrDragEntry(SdrDragEntry* pNew);
+ virtual void createSdrDragEntries();
+ virtual void createSdrDragEntryForSdrObject(const SdrObject& rOriginal, sdr::contact::ObjectContact& rObjectContact, bool bModify);
+
+ // access for derivated classes to maOverlayObjectList
+ void clearOverlayObjectList() { maOverlayObjectList.clear(); }
+ void addToOverlayObjectList(sdr::overlay::OverlayObject& rNew) { maOverlayObjectList.append(rNew); }
+ basegfx::B2DRange getB2DRangeFromOverlayObjectList() const { return maOverlayObjectList.getBaseRange(); }
+
+ // 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
+ void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 nVal=0) const;
+ SdrHdl* GetDragHdl() const { return getSdrDragView().pDragHdl; }
+ SdrHdlKind GetDragHdlKind() const { return getSdrDragView().eDragHdl; }
+ SdrDragStat& DragStat() { return getSdrDragView().aDragStat; }
+ const SdrDragStat& DragStat() const { return getSdrDragView().aDragStat; }
+ Point& Ref1() const { return mrSdrDragView.aRef1; }
+ Point& Ref2() const { return mrSdrDragView.aRef2; }
+ const SdrHdlList& GetHdlList() const { return getSdrDragView().aHdl; }
+ void AddUndo(SdrUndoAction* pUndo) { getSdrDragView().AddUndo(pUndo); }
+ bool IsDragLimit() { return getSdrDragView().bDragLimit; }
+ const Rectangle& GetDragLimitRect() { return getSdrDragView().aDragLimit; }
+ const SdrMarkList& GetMarkedObjectList() { return getSdrDragView().GetMarkedObjectList(); }
+ Point GetSnapPos(const Point& rPt) const { return getSdrDragView().GetSnapPos(rPt,getSdrDragView().pMarkedPV); }
+ sal_uInt16 SnapPos(Point& rPt) const { return getSdrDragView().SnapPos(rPt,getSdrDragView().pMarkedPV); }
+ inline const Rectangle& GetMarkedRect() const;
+ SdrPageView* GetDragPV() const;
+ SdrObject* GetDragObj() const;
+ OutputDevice* GetDragWin() const { return getSdrDragView().pDragWin; }
+ bool IsDraggingPoints() const { return getSdrDragView().IsDraggingPoints(); }
+ bool IsDraggingGluePoints() const { return getSdrDragView().IsDraggingGluePoints(); }
+
+ bool DoAddConnectorOverlays();
+ drawinglayer::primitive2d::Primitive2DSequence AddConnectorOverlays();
+
+public:
+ TYPEINFO();
+
+ 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();
+ virtual void TakeSdrDragComment(String& rStr) const=0;
+ virtual bool BeginSdrDrag()=0;
+ virtual void MoveSdrDrag(const Point& rPnt)=0;
+ virtual bool EndSdrDrag(bool bCopy)=0;
+ virtual void CancelSdrDrag();
+ virtual Pointer GetSdrDragPointer() const=0;
+
+ virtual void CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlayManager);
+ 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 Rectangle& SdrDragMethod::GetMarkedRect() const
+{
+ return getSdrDragView().eDragHdl==HDL_POLY ? getSdrDragView().GetMarkedPointsRect() :
+ getSdrDragView().eDragHdl==HDL_GLUE ? getSdrDragView().GetMarkedGluePointsRect() :
+ getSdrDragView().GetMarkedObjRect();
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// SdrDragMove
+
+class SVX_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, sdr::contact::ObjectContact& rObjectContact, bool bModify);
+
+public:
+ TYPEINFO();
+ SdrDragMove(SdrDragView& rNewView);
+
+ virtual void TakeSdrDragComment(String& rStr) const;
+ virtual bool BeginSdrDrag();
+ virtual void MoveSdrDrag(const Point& rPnt);
+ virtual bool EndSdrDrag(bool bCopy);
+ virtual Pointer GetSdrDragPointer() const;
+
+ virtual basegfx::B2DHomMatrix getCurrentTransformation();
+ virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// SdrDragResize
+
+class SVX_DLLPUBLIC SdrDragResize : public SdrDragMethod
+{
+protected:
+ Fraction aXFact;
+ Fraction aYFact;
+
+public:
+ TYPEINFO();
+ SdrDragResize(SdrDragView& rNewView);
+
+ virtual void TakeSdrDragComment(String& rStr) const;
+ virtual bool BeginSdrDrag();
+ virtual void MoveSdrDrag(const Point& rPnt);
+ virtual bool EndSdrDrag(bool bCopy);
+ virtual Pointer GetSdrDragPointer() const;
+
+ virtual basegfx::B2DHomMatrix getCurrentTransformation();
+ virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// SdrDragObjOwn
+
+class SVX_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
+ SdrObject* mpClone;
+
+protected:
+ virtual void createSdrDragEntries();
+
+public:
+ TYPEINFO();
+ SdrDragObjOwn(SdrDragView& rNewView);
+ virtual ~SdrDragObjOwn();
+
+ virtual void TakeSdrDragComment(String& rStr) const;
+ virtual bool BeginSdrDrag();
+ virtual void MoveSdrDrag(const Point& rPnt);
+ virtual bool EndSdrDrag(bool bCopy);
+ virtual Pointer GetSdrDragPointer() const;
+};
+
+#endif //_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 000000000000..3a5f09cdb6d8
--- /dev/null
+++ b/include/svx/svddrgv.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 _SVDDRGV_HXX
+#define _SVDDRGV_HXX
+
+#include "svx/svxdllapi.h"
+#include <svx/svdxcgv.hxx>
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class SdrUndoGeoObj;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@@@@ @@@@@ @@@@ @@@@ @@ @@ @@ @@@@@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
+// @@ @@ @@@@@ @@@@@@ @@ @@@ @@@@@ @@ @@@@ @@@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
+// @@@@@ @@ @@ @@ @@ @@@@@ @ @@ @@@@@ @@ @@
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrDragView: public SdrExchangeView
+{
+ friend class SdrPageView;
+ friend class SdrDragMethod;
+
+protected:
+ SdrHdl* pDragHdl;
+ SdrDragMethod* mpCurrentSdrDragMethod;
+ SdrUndoGeoObj* pInsPointUndo;
+ Rectangle aDragLimit;
+ OUString aInsPointUndoStr;
+ SdrMarkList aFollowingEdges; // If nodes are dragged, all edges should follow as Xor
+ SdrHdlKind eDragHdl;
+
+ sal_uIntPtr nDragXorPolyLimit;
+ sal_uIntPtr nDragXorPointLimit;
+ sal_uInt16 nDetailedEdgeDraggingLimit;
+
+ unsigned bFramDrag : 1; // currently frame dragging
+ unsigned bDragSpecial : 1; // currently Special Obj-dragging
+ unsigned bMarkedHitMovesAlways : 1; // Persistent
+ unsigned bDragLimit : 1; // Limit on SnapRect instead of BoundRect
+ unsigned bDragHdl : 1; // TRUE: RefPt is slid
+ unsigned bDragStripes : 1; // Persistent
+ unsigned bMirrRefDragObj : 1; // Persistent - During the drag, show the mirror axis of the mirrored objects as Xor
+ unsigned mbSolidDragging : 1; // allow solid create/drag of objects
+ unsigned bMouseHideWhileDraggingPoints : 1;
+ unsigned bResizeAtCenter : 1;
+ unsigned bCrookAtCenter : 1;
+ unsigned bDragWithCopy : 1;
+ unsigned bInsGluePoint : 1;
+ unsigned bInsObjPointMode : 1;
+ unsigned bInsGluePointMode : 1;
+ unsigned bNoDragXorPolys : 1;
+ unsigned bAutoVertexCon : 1; // Automatische Konnektorgenerierung an den Scheitelpunkten
+ unsigned bAutoCornerCon : 1; // Automatische Konnektorgenerierung an den Eckpunkten
+ unsigned bRubberEdgeDragging : 1;
+ unsigned bDetailedEdgeDragging : 1;
+
+private:
+ SVX_DLLPRIVATE void ImpClearVars();
+
+protected:
+ virtual void SetMarkHandles();
+ void ShowDragObj();
+ void HideDragObj();
+ sal_Bool ImpBegInsObjPoint(sal_Bool bIdxZwang, sal_uInt32 nIdx, const Point& rPnt, sal_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* pModel1, OutputDevice* pOut = 0L);
+ virtual ~SdrDragView();
+
+public:
+ virtual sal_Bool IsAction() const;
+ virtual void MovAction(const Point& rPnt);
+ virtual void EndAction();
+ virtual void BckAction();
+ virtual void BrkAction();
+ virtual void TakeActionRect(Rectangle& rRect) const;
+
+ // Spezialimplementation fuer den Writer:
+ // TakeDragObjAnchorPos() liefert die Position an der ein Objekt
+ // beim Draggen einer Einfachselektion ungefaehr landet wenn es
+ // "losgelassen" wird (EndDrag).
+ // In der Regel ist das die linke obere Ecke des zu erwartenden neuen
+ // SnapRects. Ausnahme: CaptionObj. Dort ist es die Position des
+ // "Schwanzendes".
+ // Bei Returncode sal_False konnte ich die Position nicht bestimmen
+ // (z.B. Punktverschiebung, Mehrfachselektion, Schieben der
+ // Spiegelschse, ...)
+ sal_Bool TakeDragObjAnchorPos(Point& rPos, sal_Bool bTopRight = sal_False ) const;
+
+ // Wird pForcedMeth uebergeben, so wird pHdl, ... nicht ausgewerten, sondern diese
+ // Drag-Methode verwendet. Die Instanz geht dabei ins Eigentum der View ueber und
+ // wird zum Ende des Draggings destruiert.
+ virtual sal_Bool BegDragObj(const Point& rPnt, OutputDevice* pOut=NULL, SdrHdl* pHdl=NULL, short nMinMov=-3, SdrDragMethod* pForcedMeth=NULL);
+ void MovDragObj(const Point& rPnt);
+ sal_Bool EndDragObj(sal_Bool bCopy=sal_False);
+ void BrkDragObj();
+ sal_Bool IsDragObj() const { return mpCurrentSdrDragMethod && !bInsPolyPoint && !bInsGluePoint; }
+ SdrHdl* GetDragHdl() const { return pDragHdl; }
+ SdrDragMethod* GetDragMethod() const { return mpCurrentSdrDragMethod; }
+ sal_Bool IsDraggingPoints() const { return eDragHdl==HDL_POLY; }
+ sal_Bool IsDraggingGluePoints() const { return eDragHdl==HDL_GLUE; }
+
+ // Wer das beim BegDrag oder mittendrin schon festlegen will.
+ // (Wird bei jedem BegDrag auf sal_False zurueckgesetzt, also nach
+ // BegDrag setzen.)
+ void SetDragWithCopy(sal_Bool bOn) { bDragWithCopy = bOn; }
+ sal_Bool IsDragWithCopy() const { return bDragWithCopy; }
+
+ void SetInsertGluePoint(sal_Bool bOn) { bInsGluePoint = bOn; }
+ sal_Bool IsInsertGluePoint() const { return bInsGluePoint; }
+
+ // Interaktives einfuegen eines neuen Punktes. nIdx=0 => vor dem ersten Punkt.
+ bool IsInsObjPointPossible() const;
+ sal_Bool BegInsObjPoint(const Point& rPnt, sal_Bool bNewObj) { return ImpBegInsObjPoint(sal_False, 0L, rPnt, bNewObj, 0L); }
+ void MovInsObjPoint(const Point& rPnt) { MovDragObj(rPnt); }
+ sal_Bool EndInsObjPoint(SdrCreateCmd eCmd);
+ void BrkInsObjPoint() { BrkDragObj(); }
+ sal_Bool IsInsObjPoint() const { return mpCurrentSdrDragMethod && bInsPolyPoint; }
+
+ // Fuer die App zum Verwalten des Status. GetPreferedPointer() wird
+ // spaeter vielleicht einen passenden Pointer dafuer liefern
+ void SetInsObjPointMode(sal_Bool bOn) { bInsObjPointMode = bOn; }
+ sal_Bool IsInsObjPointMode() const { return bInsObjPointMode; }
+
+ sal_Bool IsInsGluePointPossible() const;
+ sal_Bool BegInsGluePoint(const Point& rPnt);
+ void MovInsGluePoint(const Point& rPnt) { MovDragObj(rPnt); }
+ sal_Bool EndInsGluePoint() { return EndDragObj(); }
+ void BrkInsGluePoint() { BrkDragObj(); }
+ sal_Bool IsInsGluePoint() const { return mpCurrentSdrDragMethod && bInsGluePoint; }
+
+ // Fuer die App zum Verwalten des Status. GetPreferedPointer() wird
+ // spaeter vielleicht einen passenden Pointer dafuer liefern
+ void SetInsGluePointMode(sal_Bool bOn) { bInsGluePointMode = bOn; }
+ sal_Bool IsInsGluePointMode() const { return bInsGluePointMode; }
+
+ // Begrenzungslinien ueber's gesamte Win waehrend des Draggens
+ // Persistent. Default=FALSE.
+ void SetDragStripes(sal_Bool bOn);
+ sal_Bool IsDragStripes() const { return bDragStripes; }
+
+ // Handles waehrend des Draggens verstecken
+ //HMHvoid SetDragHdlHide(sal_Bool bOn);
+ //HMHBOOL IsDragHdlHide() const { return bNoDragHdl; }
+
+ // Beim Draggen von Polygonpunkten und Klebepunkten
+ // die Maus verstecken. Default=FALSE
+ void SetMouseHideWhileDraggingPoints(sal_Bool bOn) { bMouseHideWhileDraggingPoints = bOn; }
+ sal_Bool IsMouseHideWhileDraggingPoints() const { return bMouseHideWhileDraggingPoints; }
+
+ // Beim Draggen werden i.d.R. die Konturen der markierten Objekte
+ // als Xor-Polygone dargestellt. Wird dieses Flag hier gesetzt,
+ // wird (z.B. bei Mehrfachselektion) nur ein Xor-Frame gezeichnet.
+ // Bei objektspeziefischem Dragging (Polygonpunkte,Eckenradius,...
+ // hat diese Einstellung keine Auswirkung.
+ // Auch waerend des Draggens umschaltbar.
+ // Default=Off
+ void SetNoDragXorPolys(sal_Bool bOn);
+ sal_Bool IsNoDragXorPolys() const { return bNoDragXorPolys; }
+
+ // Uebersteigt die Anzahl der markierten Objekte den hier eingestellten
+ // Wert, wird implizit (temporaer) auf NoDragPolys geschaltet.
+ // PolyPolygone etc werden entsprechend als mehrere Objekte gewertet.
+ // Default=100
+ void SetDragXorPolyLimit(sal_uIntPtr nObjAnz) { nDragXorPolyLimit=nObjAnz; }
+ sal_uIntPtr GetDragXorPolyLimit() const { return nDragXorPolyLimit; }
+
+ // Wie DragXorPolyLimit, jedoch bezogen auf die Gesamtpunktanzahl
+ // aller Polygone. Default=500.
+ // Auf NoDragPolys wird (temporaer) geschaltet, wenn eins der Limits
+ // ueberstiegen wird.
+ void SetDragXorPointLimit(sal_uIntPtr nPntAnz) { nDragXorPointLimit=nPntAnz; }
+ sal_uIntPtr GetDragXorPointLimit() const { return nDragXorPointLimit; }
+
+ void SetSolidDragging(bool bOn);
+ bool IsSolidDragging() const;
+
+ // Dragging/Creating von Verbindern:
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ // Verbinder an Objektscheitelpunkte ankleben
+ // Default=sal_True=Ja
+ void SetAutoVertexConnectors(sal_Bool bOn) { bAutoVertexCon = bOn; }
+ sal_Bool IsAutoVertexConnectors() const { return bAutoVertexCon; }
+
+ // Verbinder an Objektecken ankleben
+ // Default=sal_False=Nein
+ void SetAutoCornerConnectors(sal_Bool bOn) { bAutoCornerCon = bOn; }
+ sal_Bool IsAutoCornerConnectors() const { return bAutoCornerCon; }
+
+ // Dragging von verbundenen Objekten (Nodes):
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ // DetailedEdgeDraggingLimit: Wie RubberEdgeDraggingLimit, jedoch bezieht
+ // sich dieses Limit auf die detalierte Darstellung, d.h. nicht nur
+ // Gummibaender sondern komplette Neuberechnunen sind beim Draggen sichtbar.
+ // Diese detalierte Darstellung ist eh nur beim MoveDrag moeglich.
+ // Defaultwert ist 10
+ sal_Bool IsDetailedEdgeDragging() const { return bDetailedEdgeDragging; }
+
+ sal_uInt16 GetDetailedEdgeDraggingLimit() const { return nDetailedEdgeDraggingLimit; }
+
+ // EdgeDraggingLimit: Sind mehr als nEdgeObjAnz Kanten betroffen, werden
+ // diese beim interaktiven Draggen nicht mit angezeigt.
+ // Gemeint sind hier die "Gummibaender", die weniger Rechenzeit benoetigen
+ // als die kompletten Neuberechnungen beim DetailedEdgeDragging.
+ // Defaultwert ist 100
+ sal_Bool IsRubberEdgeDragging() const { return bRubberEdgeDragging; }
+
+ // Verbinderhandling also zu deutsch wie folgt (bei Defaulteinstellungen):
+ // - Sind bis max 10 Verbinder betroffen werden diese bei jedem
+ // MouseMove neu berechnet
+ // - Sind zwischen 11 und 100 Verbinder betroffen werden die
+ // Verbindungen beim Draggen als gerade Linien dargestellt.
+ // - Bei mehr als 100 betroffenen Verbindern wird beim Draggen nichts
+ // mehr gezeichnet was auf Verbinder hinweist.
+
+ // Ist ein spezieller Dragmode eingeschaltet, wie Rotate, Mirror oder Crook,
+ // dann leitet ein Hit auf das markierte Objekt genau dieses Dragging ein.
+ // Setzt man MarkedHitMovesAlways auf sal_True, so leitet ein Hit auf das
+ // markierte Objekt immer ein Moven ein, unabhaengig vom gesetzten DragMode.
+ // Dieses Flag ist persistent und sollte von der App fuer den Anwender
+ // konfigurierbar sein!
+ void SetMarkedHitMovesAlways(sal_Bool bOn) { bMarkedHitMovesAlways = bOn; }
+ sal_Bool IsMarkedHitMovesAlways() const { return bMarkedHitMovesAlways; }
+
+ // Beim Draggen der Spiegelachse das Spiegelbild der markierten Objekte
+ // als Xor darstellen? Persistent. Noch nicht implementiert. Default TRUE.
+ void SetMirrRefDragObj(sal_Bool bOn) { bMirrRefDragObj = bOn; }
+ sal_Bool IsMirrRefDragObj() const { return bMirrRefDragObj; }
+
+ sal_Bool IsOrthoDesired() const;
+
+ // Beim Resize die Mitte als Referenz
+ // Default=FALSE.
+ sal_Bool IsResizeAtCenter() const { return bResizeAtCenter; }
+ void SetResizeAtCenter(sal_Bool bOn) { bResizeAtCenter = bOn; }
+
+ // Symmetrisches Crook
+ // Default=FALSE.
+ sal_Bool IsCrookAtCenter() const { return bCrookAtCenter; }
+ void SetCrookAtCenter(sal_Bool bOn) { bCrookAtCenter = bOn; }
+
+ // Begrenzung des Arbeitsbereichs. Die Begrenzung bezieht sich auf die
+ // View, nicht auf die einzelnen PageViews. Von der View wird diese
+ // Begrenzung nur bei Interaktionen wie Dragging und Create ausgewertet.
+ // Bei von der App algorithmisch oder UI-gesteuerte Aktionen (SetGeoAttr,
+ // MoveMarkedObj, ...) muss die App dieses Limit selbst beruecksichtigen.
+ // Ferner ist dieses Limit als Grob-Limit zu sehen. U.U. koennen Objekte
+ // (z.B. beim Drehen) nicht exakt bis an dieses Limit herangedraggt werden,
+ // koennen Objekte durch Rundungsfehler doch etwas ueberstehen, ... .
+ // Default=EmptyRect=keine Begrenzung.
+ // erst z.T. impl.
+ // (besser in die DragView?)
+ void SetWorkArea(const Rectangle& rRect) { aMaxWorkArea=rRect; }
+ const Rectangle& GetWorkArea() const { return aMaxWorkArea; }
+
+
+ // Das DragLimit ist bezogen auf die Page des Objekts.
+ // (Oder auf die View??? Muss ich mal^^^^recherchieren. Joe.)
+ // sal_False=Kein Limit.
+ // Das Rueckgabe-Rect muss absolute Koordinaten enthalten. Der Maximale
+ // Dragbereich wird von der View dann so gewaehlt, dass das SnapRect des
+ // Objekts bis Maximal auf die Kante des LimitRects gemoved bzw. gesized
+ // wird. Bei Objekten wie Bezierkurven, gedrehten Rechtecken ist zu beachten
+ // das durch anschliessende Neuberechnung des SnapRects (bei Resize)
+ // Rundungsfehler auftreten koennen, wodurch das LimitRect minnimal
+ // ueberschritten werden koennte...
+ // Implementiert fuer Move und Resize.
+ virtual sal_Bool TakeDragLimit(SdrDragMode eMode, Rectangle& rRect) const;
+};
+
+#endif //_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 000000000000..39e75ad18738
--- /dev/null
+++ b/include/svx/svdedtv.hxx
@@ -0,0 +1,450 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDEDTV_HXX
+#define _SVDEDTV_HXX
+
+#include <svx/svdmrkv.hxx>
+#include <svx/xpoly.hxx>
+#include <svx/svdmodel.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class SfxUndoAction;
+class SdrUndoAction;
+class SdrUndoGroup;
+class SfxStyleSheet;
+class SdrLayer;
+class SvdProgressInfo;
+
+//************************************************************
+// Defines
+//************************************************************
+
+enum SdrHorAlign {
+ SDRHALIGN_NONE,
+ SDRHALIGN_LEFT,
+ SDRHALIGN_RIGHT,
+ SDRHALIGN_CENTER
+};
+
+enum SdrVertAlign {
+ SDRVALIGN_NONE,
+ SDRVALIGN_TOP,
+ SDRVALIGN_BOTTOM,
+ SDRVALIGN_CENTER
+};
+
+enum SdrMergeMode {
+ SDR_MERGE_MERGE,
+ SDR_MERGE_SUBSTRACT,
+ SDR_MERGE_INTERSECT
+};
+
+// Optionen fuer InsertObject()
+#define SDRINSERT_DONTMARK 0x0001 /* Obj wird nicht markiert (aktuelle Markierung bleibt bestehen) */
+#define SDRINSERT_ADDMARK 0x0002 /* Das Obj wird zu einer ggf. bereits bestehenden Selektion hinzumarkiert */
+#define SDRINSERT_SETDEFATTR 0x0004 /* Die aktuellen Attribute (+StyleSheet) werden dem Obj zugewiesen */
+#define SDRINSERT_SETDEFLAYER 0x0008 /* Der aktuelle Layer wird dem Obj zugewiesen */
+#define SDRINSERT_NOBROADCAST 0x0010 /* Einfuegen mit NbcInsertObject() fuer SolidDragging */
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
+// @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@
+// @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
+// @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
+// @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrEditView: public SdrMarkView
+{
+ friend class SdrPageView;
+ friend class SdrDragDistort;
+ friend class SdrDragCrook;
+
+protected:
+
+ // Die Transformationsnachfragen, etc. etwas cachen
+ unsigned bPossibilitiesDirty : 1;
+ unsigned bReadOnly : 1;
+ unsigned bGroupPossible : 1;
+ unsigned bUnGroupPossible : 1;
+ unsigned bGrpEnterPossible : 1;
+ unsigned bDeletePossible : 1;
+ unsigned bToTopPossible : 1;
+ unsigned bToBtmPossible : 1;
+ unsigned bReverseOrderPossible : 1;
+ unsigned bImportMtfPossible : 1;
+ unsigned bCombinePossible : 1;
+ unsigned bDismantlePossible : 1;
+ unsigned bCombineNoPolyPolyPossible : 1;
+ unsigned bDismantleMakeLinesPossible : 1;
+ unsigned bOrthoDesiredOnMarked : 1;
+ unsigned bMoreThanOneNotMovable : 1; // Es ist mehr als ein Objekt nicht verschiebbar
+ unsigned bOneOrMoreMovable : 1; // Wenigstens 1 Obj verschiebbar
+ unsigned bMoreThanOneNoMovRot : 1; // Es ist mehr als ein Objekt nicht verschieb- und drehbar (Crook)
+ unsigned bContortionPossible : 1; // Alles Polygone (ggf. gruppiert)
+ unsigned bAllPolys : 1; // Alles Polygone (nicht gruppiert)
+ unsigned bOneOrMorePolys : 1; // Mindestens 1 Polygon (nicht gruppiert)
+ unsigned bMoveAllowed : 1;
+ unsigned bResizeFreeAllowed : 1;
+ unsigned bResizePropAllowed : 1;
+ unsigned bRotateFreeAllowed : 1;
+ unsigned bRotate90Allowed : 1;
+ unsigned bMirrorFreeAllowed : 1;
+ unsigned bMirror45Allowed : 1;
+ unsigned bMirror90Allowed : 1;
+ unsigned bShearAllowed : 1;
+ unsigned bEdgeRadiusAllowed : 1;
+ unsigned bTransparenceAllowed : 1;
+ unsigned bGradientAllowed : 1;
+ unsigned bCanConvToPath : 1;
+ unsigned bCanConvToPoly : 1;
+ unsigned bCanConvToContour : 1;
+ unsigned bCanConvToPathLineToArea : 1;
+ unsigned bCanConvToPolyLineToArea : 1;
+ unsigned bMoveProtect : 1;
+ unsigned bResizeProtect : 1;
+ // Z-Order von virtuellen Objekten zusammenhalten (Writer)
+ unsigned bBundleVirtObj : 1;
+
+private:
+ SVX_DLLPRIVATE void ImpClearVars();
+ SVX_DLLPRIVATE void ImpResetPossibilityFlags();
+
+protected:
+ void ImpBroadcastEdgesOfMarkedNodes();
+
+ // Konvertierung der markierten Objekte in Poly bzw. Bezier.
+ void ImpConvertTo(sal_Bool bPath, sal_Bool bLineToArea);
+
+ // Konvertiert ein Obj, wirft bei Erfolg das alte as seiner Liste und
+ // fuegt das neue an dessen Position ein. Inkl Undo. Es wird weder ein
+ // MarkEntry noch ein ModelChgBroadcast generiert.
+ SdrObject* ImpConvertOneObj(SdrObject* pObj, sal_Bool bPath, sal_Bool bLineToArea);
+
+ // Setzen der beiden Flags bToTopPossible und bToBtmPossible.
+ // bToTopPossibleDirty und bToBtmPossibleDirty werden dabei gleichzeitig
+ // zurueckgesetzt.
+ void ImpCheckToTopBtmPossible();
+
+ // fuer CombineMarkedObjects und DismantleMarkedObjects
+ void ImpCopyAttributes(const SdrObject* pSource, SdrObject* pDest) const;
+
+ // fuer CombineMarkedObjects
+ sal_Bool ImpCanConvertForCombine1(const SdrObject* pObj) const;
+ sal_Bool ImpCanConvertForCombine(const SdrObject* pObj) const;
+ basegfx::B2DPolyPolygon ImpGetPolyPolygon1(const SdrObject* pObj, sal_Bool bCombine) const;
+ basegfx::B2DPolyPolygon ImpGetPolyPolygon(const SdrObject* pObj, sal_Bool bCombine) const;
+ basegfx::B2DPolygon ImpCombineToSinglePolygon(const basegfx::B2DPolyPolygon& rPolyPolygon) const;
+
+ // fuer DismantleMarkedObjects
+ sal_Bool ImpCanDismantle(const basegfx::B2DPolyPolygon& rPpolyPpolygon, sal_Bool bMakeLines) const;
+ sal_Bool ImpCanDismantle(const SdrObject* pObj, sal_Bool bMakeLines) const;
+ void ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, sal_uIntPtr& rPos, SdrPageView* pPV, sal_Bool bMakeLines);
+ void ImpCrookObj(SdrObject* pO, const Point& rRef, const Point& rRad, SdrCrookMode eMode,
+ sal_Bool bVertical, sal_Bool bNoContortion, sal_Bool bRotate, const Rectangle& rMarkRect);
+ void ImpDistortObj(SdrObject* pO, const Rectangle& rRef, const XPolygon& rDistortedRect, sal_Bool bNoContortion);
+ sal_Bool ImpDelLayerCheck(SdrObjList* pOL, SdrLayerID nDelID) const;
+ void ImpDelLayerDelObjs(SdrObjList* pOL, SdrLayerID nDelID);
+
+ // Entfernt alle Obj der MarkList aus ihren ObjLists inkl Undo.
+ // Die Eintraege in rMark bleiben erhalten.
+ void DeleteMarkedList(const SdrMarkList& rMark); // DeleteMarked -> DeleteMarkedList
+
+ // Die Transformationsnachfragen etwas cachen
+ //void ImpCheckMarkTransform() const; veraltet
+ // Checken, was man so mit den markierten Objekten alles machen kann
+ virtual void CheckPossibilities();
+ void ForcePossibilities() const { if (bPossibilitiesDirty || bSomeObjChgdFlag) ((SdrEditView*)this)->CheckPossibilities(); }
+
+protected:
+ // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
+ SdrEditView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ virtual ~SdrEditView();
+
+public:
+ // Jeder Aufruf einer undofaehigen Methode an der View generiert eine
+ // UndoAction. Moechte man mehrere
+ // Methodenaufrufe zu einer UndoAction zusammenfassen, so kann man diese
+ // mit BegUndo() / EndUndo() klammern (beliebig tief). Als Kommentar der
+ // UndoAction wird der des ersten BegUndo(String) aller Klammerungen
+ // verwendet. NotifyNewUndoAction() wird in diesem Fall erst beim letzten
+ // EndUndo() gerufen. NotifyNewUndoAction() wird nicht gerufen bei einer
+ // leeren Klammerung.
+ void BegUndo() { pMod->BegUndo(); } // Undo-Klammerung auf
+ void BegUndo(const String& rComment) { pMod->BegUndo(rComment); } // Undo-Klammerung auf
+ void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE) { pMod->BegUndo(rComment,rObjDescr,eFunc); } // Undo-Klammerung auf
+ void EndUndo(); // Undo-Klammerung zu (inkl BroadcastEdges)
+ void AddUndo(SdrUndoAction* pUndo) { pMod->AddUndo(pUndo); } // Action hinzufuegen
+ // nur nach dem 1. BegUndo oder vor dem letzten EndUndo:
+ void SetUndoComment(const String& rComment) { pMod->SetUndoComment(rComment); }
+ void SetUndoComment(const String& rComment, const String& rObjDescr) { pMod->SetUndoComment(rComment,rObjDescr); }
+ bool IsUndoEnabled() const;
+
+ std::vector< SdrUndoAction* > CreateConnectorUndo( SdrObject& rO );
+ void AddUndoActions( std::vector< SdrUndoAction* >& );
+
+ // Layerverwaltung. Mit Undo.
+ SdrLayer* InsertNewLayer(const String& rName, sal_uInt16 nPos=0xFFFF);
+ // Loeschen eines Layer inkl. aller darauf befindlichen Objekte
+ void DeleteLayer(const String& rName);
+ // Verschieben eines Layer (Layerreihenfolge aendern)
+ void MoveLayer(const String& rName, sal_uInt16 nNewPos);
+
+ // Markierte Objekte die ausserhalb ihrer Page liegen
+ // werden ggf. einer anderen Page zugewiesen
+ // z.Zt. noch ohne Undo!!!
+ void ForceMarkedObjToAnotherPage();
+ void ForceMarkedToAnotherPage() { ForceMarkedObjToAnotherPage(); }
+
+ sal_Bool IsReadOnly() const { ForcePossibilities(); return bReadOnly; }
+
+ // Loeschen aller markierten Objekte
+ void DeleteMarkedObj();
+ sal_Bool IsDeleteMarkedObjPossible() const { ForcePossibilities(); return bDeletePossible; }
+
+ // Logisch- umschliessendes Rect aller markierten Objekte setzen.
+ // Das das wirklich geschieht ist nicht garantiert, denn eine
+ // waagerechte Linie hat z.B. immer eine Hoehe von 0.
+ void SetMarkedObjRect(const Rectangle& rRect, sal_Bool bCopy=sal_False);
+ void MoveMarkedObj(const Size& rSiz, bool bCopy=false);
+ void ResizeMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false);
+ long GetMarkedObjRotate() const;
+ void RotateMarkedObj(const Point& rRef, long nWink, bool bCopy=false);
+ void MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool bCopy=false);
+ void MirrorMarkedObjHorizontal(sal_Bool bCopy=sal_False);
+ void MirrorMarkedObjVertical(sal_Bool bCopy=sal_False);
+ long GetMarkedObjShear() const;
+ void ShearMarkedObj(const Point& rRef, long nWink, bool bVShear=false, bool bCopy=false);
+ void CrookMarkedObj(const Point& rRef, const Point& rRad, SdrCrookMode eMode, bool bVertical=false, bool bNoContortion=false, bool bCopy=false);
+ void DistortMarkedObj(const Rectangle& rRef, const XPolygon& rDistortedRect, bool bNoContortion=false, bool bCopy=false);
+
+ // Markierte Objekte kopieren und anstelle der alten markieren
+ void CopyMarkedObj();
+ void SetAllMarkedRect(const Rectangle& rRect, sal_Bool bCopy=sal_False) { SetMarkedObjRect(rRect,bCopy); }
+ void MoveAllMarked(const Size& rSiz, sal_Bool bCopy=sal_False) { MoveMarkedObj (rSiz,bCopy); }
+ void ResizeAllMarked(const Point& rRef, const Fraction& xFact, const Fraction& yFact, sal_Bool bCopy=sal_False) { ResizeMarkedObj (rRef,xFact,yFact,bCopy); }
+ long GetAllMarkedRotate() const { return GetMarkedObjRotate(); }
+ void RotateAllMarked(const Point& rRef, long nWink, sal_Bool bCopy=sal_False) { RotateMarkedObj(rRef,nWink,bCopy); }
+ void MirrorAllMarked(const Point& rRef1, const Point& rRef2, sal_Bool bCopy=sal_False) { MirrorMarkedObj(rRef1,rRef2,bCopy); }
+ void MirrorAllMarkedHorizontal(sal_Bool bCopy=sal_False) { MirrorMarkedObjHorizontal(bCopy); }
+ void MirrorAllMarkedVertical(sal_Bool bCopy=sal_False) { MirrorMarkedObjVertical(bCopy); }
+ long GetAllMarkedShear() const { return GetMarkedObjShear(); }
+ void ShearAllMarked(const Point& rRef, long nWink, sal_Bool bVShear=sal_False, sal_Bool bCopy=sal_False) { ShearMarkedObj(rRef,nWink,bVShear,bCopy); }
+ void CrookAllMarked(const Point& rRef, const Point& rRad, SdrCrookMode eMode, sal_Bool bVertical=sal_False, sal_Bool bNoContortion=sal_False, sal_Bool bCopy=sal_False) { CrookMarkedObj(rRef,rRad,eMode,bVertical,bNoContortion,bCopy); }
+ void CopyMarked() { CopyMarkedObj(); }
+ sal_Bool IsMoveAllowed() const { ForcePossibilities(); return bMoveAllowed && !bMoveProtect; }
+ sal_Bool IsResizeAllowed(sal_Bool bProp=sal_False) const;
+ sal_Bool IsRotateAllowed(sal_Bool b90Deg=sal_False) const;
+ sal_Bool IsMirrorAllowed(sal_Bool b45Deg=sal_False, sal_Bool b90Deg=sal_False) const;
+ sal_Bool IsTransparenceAllowed() const;
+ sal_Bool IsGradientAllowed() const;
+ sal_Bool IsShearAllowed() const;
+ sal_Bool IsEdgeRadiusAllowed() const;
+ sal_Bool IsCrookAllowed(sal_Bool bNoContortion=sal_False) const;
+ sal_Bool IsDistortAllowed(sal_Bool bNoContortion=sal_False) const;
+
+ // Vereinigen mehrerer Objekte zu einem PolyPolygon:
+ // - Rechtecke/Kreise/Text... werden implizit gewandelt.
+ // - Polylines werden automatisch geschlossen.
+ // - Die Attribute und der Layer werden vom Ersten der markierten Objekte
+ // uebernommen (also vom untersten der Z-Order).
+ // - Gruppenobjekte werden miteinbezogen, wenn alle! Memberobjekte der
+ // Gruppe wandelbar sind. Beinhaltet eine Gruppe also beispielsweise
+ // eine Bitmap oder ein OLE-Objekt, wird die gesamte Gruppe nicht
+ // beruecksichtigt.
+ // bNoPolyPoly=TRUE: Alles wird zu einem einzigen Polygon zusammengefasst
+ void CombineMarkedObjects(sal_Bool bNoPolyPoly = sal_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();
+
+ // Markierte Polypolygonobjekte in Polygone zerlegen
+ // Gruppenobjekte werden durchsucht und zerlegt, wenn es sich bei allen
+ // Memberobjekten um PathObjs handelt.
+ // bMakeLines=TRUE: alle Polygone werden in einzelne Linien bzw.
+ // Beziersegmente zerlegt
+ void DismantleMarkedObjects(sal_Bool bMakeLines=sal_False);
+ sal_Bool IsCombinePossible(sal_Bool bNoPolyPoly=sal_False) const;
+ sal_Bool IsDismantlePossible(sal_Bool bMakeLines=sal_False) const;
+
+ // Ein neues bereits fertig konstruiertes Obj einfuegen. Das Obj gehoert
+ // anschliessend dem Model. Nach dem Einfuegen wird das neue Objekt
+ // markiert (wenn dies nicht via nOptions unterbunden wird).
+ // U.U. wird das Obj jedoch nicht eingefuegt, sondern deleted, naemlich
+ // wenn der Ziel-Layer gesperrt oder nicht sichtbar ist. In diesem Fall
+ // returniert die Methode mit FALSE.
+ // Die Methode generiert u.a. auch eine Undo-Action.
+ sal_Bool InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, sal_uIntPtr nOptions=0);
+
+ // Ein Zeichenobjekt durch ein neues ersetzen. *pNewObj gehoert
+ // anschliessend mir, *pOldObj wandert ins Undo.
+ // Sollte in jedem Fall mit einer Undo-Klammerung versehen werden, z.B.:
+ // aStr+=" ersetzen";
+ // BegUndo(aStr);
+ // ReplaceObject(...);
+ // ...
+ // EndUndo();
+ void ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrObject* pNewObj, sal_Bool bMark=sal_True);
+
+ void SetNotPersistAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll);
+ void MergeNotPersistAttrFromMarked(SfxItemSet& rAttr, sal_Bool bOnlyHardAttr) const;
+ void MergeAttrFromMarked(SfxItemSet& rAttr, sal_Bool bOnlyHardAttr) const;
+ SfxItemSet GetAttrFromMarked(sal_Bool bOnlyHardAttr) const;
+ void SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll);
+
+ // Geometrische Attribute (Position, Groesse, Drehwinkel)
+ // Bei der Position wird ein evtl. gesetzter PageOrigin beruecksichtigt.
+ SfxItemSet GetGeoAttrFromMarked() const;
+ void SetGeoAttrToMarked(const SfxItemSet& rAttr);
+
+ // Returnt NULL wenn:
+ // - Nix markiert,
+ // - kein StyleSheet an den markierten Objekten gesetzt
+ // - Bei Mehrfachselektion die markierten Objekte auf unterschiedliche
+ // StyleSheets verweisen.
+ SfxStyleSheet* GetStyleSheetFromMarked() const;
+
+ // z.Zt. noch ohne Undo :(
+ void SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ /* new interface src537 */
+ sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr) const;
+
+ sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll);
+ SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(sal_Bool& rOk) const;
+ sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // Alle markierten Objekte zu einer Gruppe zusammenfassen.
+ // Anschliessend wird die neue Gruppe markiert. Bei einer
+ // seitenuebergreifenden Markierung wird eine Gruppe je Seite erzeugt.
+ // Alle erzeugten Gruppen sind anschliessend markiert.
+ // Ueber pUserGrp kann ein eigenes Gruppenobjekt vorgegeben werden. Dieses
+ // wird jedoch nicht direkt verwendet, sondern via Clone kopiert.
+ // Wird NULL uebergeben, macht sich die Methode SdrObjGroup-Instanzen.
+ void GroupMarked(const SdrObject* pUserGrp=NULL);
+
+ // Alle markierten Objektgruppen werden aufgeloesst (1 Level).
+ // Anschliessend sind statt der Gruppenobjekte alle ehemaligen
+ // Memberobjekte der aufgeloesten Gruppen markiert. Waren zum auch Objekte
+ // markiert, die keine Gruppenobjekte sind, so bleiben diese weiterhin
+ // zusaetzlich markiert.
+ void UnGroupMarked();
+
+ sal_Bool IsGroupPossible() const { ForcePossibilities(); return bGroupPossible; }
+ sal_Bool IsUnGroupPossible() const { ForcePossibilities(); return bUnGroupPossible; }
+ sal_Bool IsGroupEnterPossible() const { ForcePossibilities(); return bGrpEnterPossible; }
+
+ // Markierte Objekte in Polygone/Bezierkurven verwandeln. Die sal_Bool-
+ // Funktionen returnen sal_True, wenn wenigstens eins der markierten
+ // Objekte gewandelt werden kann. Memberobjekte von Gruppenobjekten
+ // werden ebenfalls gewandelt. Naehere Beschreibung siehe SdrObj.HXX.
+ sal_Bool IsConvertToPathObjPossible(sal_Bool bLineToArea) const { ForcePossibilities(); return sal_Bool(bLineToArea ? bCanConvToPathLineToArea : bCanConvToPath); }
+ sal_Bool IsConvertToPolyObjPossible(sal_Bool bLineToArea) const { ForcePossibilities(); return sal_Bool(bLineToArea ? bCanConvToPolyLineToArea : bCanConvToPoly); }
+ sal_Bool IsConvertToContourPossible() const { ForcePossibilities(); return bCanConvToContour; }
+ void ConvertMarkedToPathObj(sal_Bool bLineToArea);
+ void ConvertMarkedToPolyObj(sal_Bool bLineToArea);
+
+ // Alle markierten Objekte untereinander ausrichten. Normalerweise werden
+ // das SnapRect der Obj verwendet. Ist bBoundRects=sal_True, werden stattdessen
+ // die BoundRects ausgerichtet.
+ void AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert, sal_Bool bBoundRects=sal_False);
+ sal_Bool IsAlignPossible() const;
+
+ // Markierte Objekte etwas nach "oben" holen
+ void MovMarkedToTop();
+
+ // Markierte Objekte etwas nach "unten" holen
+ void MovMarkedToBtm();
+
+ // Markierte Objekte ganz nach "oben" stellen
+ void PutMarkedToTop();
+
+ // Markierte Objekte ganz nach "unten" stellen
+ void PutMarkedToBtm();
+
+ // Markierte direkt vor das uebergebene Objekt stellen
+ // NULL -> wie PutMarkedToTop();
+ void PutMarkedInFrontOfObj(const SdrObject* pRefObj);
+
+ // Markierte direkt hinter das uebergebene Objekt stellen
+ // NULL -> wie PutMarkedToBtm();
+ void PutMarkedBehindObj(const SdrObject* pRefObj);
+
+ // Z-Order der markierten Objekte vertauschen
+ void ReverseOrderOfMarked();
+
+ // Feststellen, ob nach vorn/hinten stellen moeglich ist
+ // GetMaxToTop/BtmObj() wird von diesen Methoden nur begrenzt
+ // beruecksichtigt, d.h. es kann vorkommen dass IsToTopPossible()
+ // sal_True liefert, MovMarkedToTop() jedoch nichts aendert (z.B. bei
+ // Mehrfachselektion), weil eine von der abgeleiteten View ueber
+ // GetMaxToTopObj() auferlegte Restriktion dies verhindert.
+ sal_Bool IsToTopPossible() const { ForcePossibilities(); return bToTopPossible; }
+ sal_Bool IsToBtmPossible() const { ForcePossibilities(); return bToBtmPossible; }
+ sal_Bool IsReverseOrderPossible() const { ForcePossibilities(); return bReverseOrderPossible; }
+
+ // Ueber diese Methoden stellt die View fest, wie weit ein Objekt
+ // nach vorn bzw. nach hinten gestellt werden darf (Z-Order). Das
+ // zurueckgegebene Objekt wird dann nicht "ueberholt". Bei Rueckgabe
+ // von NULL (Defaultverhalten) bestehen keine Restriktionen.
+ virtual SdrObject* GetMaxToTopObj(SdrObject* pObj) const;
+ virtual SdrObject* GetMaxToBtmObj(SdrObject* pObj) const;
+
+ // Folgende Methode wird gerufen, wenn z.B. durch ToTop, ToBtm, ... die
+ // Reihenfolgen der Objekte geaendert wurde. Der Aufruf erfolgt dann nach
+ // jedem SdrObjList::SetObjectOrdNum(nOldPos,nNewPos);
+ virtual void ObjOrderChanged(SdrObject* pObj, sal_uIntPtr nOldPos, sal_uIntPtr nNewPos);
+
+ // Falls ein oder mehrere Objekte des Types SdrGrafObj oder SdrOle2Obj
+ // markiert sind und diese in der Lage sind ein StarView-Metafile zu
+ // liefern, konvertiert diese Methode das Metafile in Drawingobjekte.
+ // Die SdrGrafObjs/SdrOle2Objs werden dann durch die neue Objekte ersetzt.
+ void DoImportMarkedMtf(SvdProgressInfo *pProgrInfo=NULL);
+ sal_Bool IsImportMtfPossible() const { ForcePossibilities(); return bImportMtfPossible; }
+
+ // Wird der Modus VirtualObjectBundling eingeschaltet, werden beim
+ // ToTop/ToBtm virtuelle Objekte die dasselbe Objekt referenzieren
+ // in ihrer Z-Order buendig zusammengehalten (Writer).
+ // Defaulteinstellung ist sal_False=ausgeschaltet.
+ void SetVirtualObjectBundling(sal_Bool bOn) { bBundleVirtObj=bOn; }
+ sal_Bool IsVirtualObjectBundling() const { return bBundleVirtObj; }
+
+ // von der SdrMarkView ueberladen fuer den internen gebrauch
+ virtual void MarkListHasChanged();
+ virtual void ModelHasChanged();
+};
+
+#endif //_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 000000000000..13cf6f05b5ef
--- /dev/null
+++ b/include/svx/svdedxv.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 _SVDEDXV_HXX
+#define _SVDEDXV_HXX
+
+#include <rtl/ref.hxx>
+#include "svx/svxdllapi.h"
+#include <svx/svdglev.hxx>
+
+#include <svx/selectioncontroller.hxx>
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+#include <boost/shared_ptr.hpp>
+
+class SdrOutliner;
+class OutlinerView;
+class EditStatus;
+class EditFieldInfo;
+class ImpSdrEditPara;
+struct PasteOrDropInfos;
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+
+namespace sdr {
+ class SelectionController;
+}
+
+//************************************************************
+// Defines
+//************************************************************
+
+enum SdrEndTextEditKind {SDRENDTEXTEDIT_UNCHANGED, // Textobjekt unveraendert
+ SDRENDTEXTEDIT_CHANGED, // Textobjekt wurde geaendert
+ SDRENDTEXTEDIT_DELETED, // Textobjekt implizit geloescht
+ SDRENDTEXTEDIT_SHOULDBEDELETED}; // Fuer Writer: Textobjekt sollte geloescht werden
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@@@ @@@@@ @@@@@@ @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
+// @@ @@ @@@@@ @@ @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
+// @@@@ @@@@@ @@@@ @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@
+//
+// - Allgemeines Edit fuer objektspeziefische Eigenschaften
+// - Textedit fuer alle vom SdrTextObj abgeleiteten Zeichenobjekte
+// - Macromodus
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrObjEditView: public SdrGlueEditView
+{
+ friend class SdrPageView;
+ friend class ImpSdrEditPara;
+
+protected:
+ // TextEdit
+ SdrObjectWeakRef mxTextEditObj; // Aktuell im TextEdit befindliches Obj
+ SdrPageView* pTextEditPV;
+ SdrOutliner* pTextEditOutliner; // Na eben der Outliner fuers TextEdit
+ OutlinerView* pTextEditOutlinerView; // die aktuelle View des Outliners
+ Window* pTextEditWin; // passendes Win zu pTextEditOutlinerView
+ Cursor* pTextEditCursorMerker; // Zum Restaurieren des Cursors am jeweiligen Win
+ ImpSdrEditPara* pEditPara; // Da hau' ich erstmal alles rein um kompatibel zu bleiben...
+ SdrObject* pMacroObj;
+ SdrPageView* pMacroPV;
+ Window* pMacroWin;
+
+ Rectangle aTextEditArea;
+ Rectangle aMinTextEditArea;
+ Link aOldCalcFieldValueLink; // Zum rufen des alten Handlers
+ Point aMacroDownPos;
+
+ sal_uInt16 nMacroTol;
+
+ unsigned bTextEditDontDelete : 1; // Outliner und View bei SdrEndTextEdit nicht deleten (f. Rechtschreibpruefung)
+ unsigned bTextEditOnlyOneView : 1; // Nur eine OutlinerView (f. Rechtschreibpruefung)
+ unsigned bTextEditNewObj : 1; // Aktuell editiertes Objekt wurde gerade neu erzeugt
+ unsigned bQuickTextEditMode : 1; // persistent(->CrtV). Default=TRUE
+ unsigned bMacroMode : 1; // persistent(->CrtV). Default=TRUE
+ unsigned bMacroDown : 1;
+
+ rtl::Reference< sdr::SelectionController > mxSelectionController;
+ rtl::Reference< sdr::SelectionController > mxLastSelectionController;
+
+private:
+ SVX_DLLPRIVATE void ImpClearVars();
+
+protected:
+ OutlinerView* ImpFindOutlinerView(Window* pWin) const;
+
+ // Eine neue OutlinerView auf dem Heap anlegen und alle erforderlichen Parameter setzen.
+ // pTextEditObj, pTextEditPV und pTextEditOutliner muessen initiallisiert sein.
+ OutlinerView* ImpMakeOutlinerView(Window* pWin, bool bNoPaint, OutlinerView* pGivenView) const;
+ void ImpPaintOutlinerView(OutlinerView& rOutlView, const Rectangle& rRect, OutputDevice& rTargetDevice) const;
+ void ImpInvalidateOutlinerView(OutlinerView& rOutlView) const;
+
+ // Feststellen, ob der gesamte Text markiert ist. Liefert auch sal_True wenn
+ // kein Text vorhanden ist.
+ sal_Bool ImpIsTextEditAllSelected() const;
+ void ImpMakeTextCursorAreaVisible();
+
+ // Handler fuer AutoGrowing Text bei aktivem Outliner
+ DECL_LINK(ImpOutlinerStatusEventHdl,EditStatus*);
+ DECL_LINK(ImpOutlinerCalcFieldValueHdl,EditFieldInfo*);
+
+ void ImpMacroUp(const Point& rUpPos);
+ void ImpMacroDown(const Point& rDownPos);
+
+ DECL_LINK( BeginPasteOrDropHdl, PasteOrDropInfos* );
+ DECL_LINK( EndPasteOrDropHdl, PasteOrDropInfos* );
+
+protected:
+ // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
+ SdrObjEditView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ virtual ~SdrObjEditView();
+
+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) const;
+
+ // Actionhandling fuer Macromodus
+ virtual sal_Bool IsAction() const;
+ virtual void MovAction(const Point& rPnt);
+ virtual void EndAction();
+ virtual void BrkAction();
+ virtual void BckAction();
+ virtual void TakeActionRect(Rectangle& rRect) const;
+
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+ virtual void ModelHasChanged();
+
+ //************************************************************************
+ // TextEdit ueber einen Outliner
+ //************************************************************************
+ // QuickTextEditMode bedeutet, dass Objekte mit Text sofort beim Anklicken
+ // editiert werden sollen. Default=TRUE. Persistent.
+ void SetQuickTextEditMode(sal_Bool bOn) { bQuickTextEditMode=bOn; }
+ sal_Bool IsQuickTextEditMode() const { return bQuickTextEditMode; }
+
+ // Starten des TextEditMode. Ist pWin==NULL, wird das erste an der View
+ // angemeldete Win verwendet.
+ // Der Cursor des Fensters an dem Editiert wird wird bei
+ // SdrBeginTextEdit() gemerkt und bei SdrEndTextEdit() wieder restauriert.
+ // Die App muss sicherstellen, das die zum Zeitpunkt des BegEdit am
+ // Windows angemeldete Cursorinstanz beim SdrEndTextEdit noch gueltig ist.
+ // Ueber den Parameter pEditOutliner kann die Applikation einen eigenen
+ // Outliner vorgeben, der zum Editieren verwendet wird. Dieser gehoert
+ // nach Aufruf von SdrBeginTextEdit der SdrObjEditView und wird von dieser
+ // spaeter via delete zerstoert (falls bDontDeleteOutliner=sal_False). Die
+ // SdrObjEditView setzt dann das Modusflag (EditEngine/Outliner) an
+ // dieser Instanz und ausserdem auch den StatusEventHdl.
+ // Ebenso kann eine spezifische OutlinerView vorgegeben werden.
+
+ virtual sal_Bool SdrBeginTextEdit(SdrObject* pObj, SdrPageView* pPV = 0L, ::Window* pWin = 0L, sal_Bool bIsNewObj = sal_False,
+ SdrOutliner* pGivenOutliner = 0L, OutlinerView* pGivenOutlinerView = 0L,
+ sal_Bool bDontDeleteOutliner = sal_False, sal_Bool bOnlyOneView = sal_False, sal_Bool bGrabFocus = sal_True);
+ // bDontDeleteReally ist ein Spezialparameter fuer den Writer.
+ // Ist dieses Flag gesetzt, dann wird ein evtl. leeres Textobjekt
+ // nicht geloescht. Stattdessen gibt es dann einen Returncode
+ // SDRENDTEXTEDIT_SHOULDBEDELETED (anstelle von SDRENDTEXTEDIT_BEDELETED)
+ // der besagt, dass das Objekt geloescht werden sollte.
+ virtual SdrEndTextEditKind SdrEndTextEdit(sal_Bool bDontDeleteReally = sal_False);
+ virtual bool IsTextEdit() const;
+
+ // Diese Methode liefert sal_True, wenn der Punkt rHit innerhalb der
+ // des Objektbereichs oder der OutlinerView liegt.
+ sal_Bool IsTextEditHit(const Point& rHit, short nTol) const;
+
+ // Diese Methode liefert sal_True, wenn der Punkt rHit innerhalb des
+ // Handle-dicken Rahmens liegt, der die OutlinerView bei TextFrames
+ // umschliesst.
+ sal_Bool IsTextEditFrameHit(const Point& rHit) const;
+
+ // Bei aktiver Selektion, also zwischen MouseButtonDown und
+ // MouseButtonUp liefert diese Methode immer TRUE.
+ sal_Bool IsTextEditInSelectionMode() const;
+
+ // Wer das z.Zt. im TextEdit befindliche Objekt braucht:
+ SdrObject* GetTextEditObject() const { return mxTextEditObj.get(); }
+
+ // info about TextEditPageView. Default is 0L.
+ virtual SdrPageView* GetTextEditPageView() const;
+
+ // Das aktuelle Win des Outliners
+ Window* GetTextEditWin() const { return pTextEditWin; }
+ void SetTextEditWin(Window* pWin);
+
+ // An den hier abgeholten Outliner kann man schliesslich
+ // Events versenden, Attribute setzen, Cut/Copy/Paste rufen,
+ // Undo/Redo rufen, etc.
+ const SdrOutliner* GetTextEditOutliner() const { return pTextEditOutliner; }
+ SdrOutliner* GetTextEditOutliner() { return pTextEditOutliner; }
+ const OutlinerView* GetTextEditOutlinerView() const { return pTextEditOutlinerView; }
+ OutlinerView* GetTextEditOutlinerView() { return pTextEditOutlinerView; }
+
+ virtual sal_Bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
+ virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
+ virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
+ virtual sal_Bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
+ virtual sal_Bool Command(const CommandEvent& rCEvt, Window* pWin);
+
+ // #97766# make virtual to change implementation e.g. for SdOutlineView
+ virtual sal_uInt16 GetScriptType() const;
+
+ /* new interface src537 */
+ sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const;
+
+ sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll);
+ SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(sal_Bool& rOk) const;
+ sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ // Intern: Beim Splitteraufziehen neue OutlinerView...
+ virtual void AddWindowToPaintView(OutputDevice* pNewWin);
+ virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin);
+
+ //************************************************************************
+ // Object-MacroModus (z.B. Rect als Button oder sowas):
+ //************************************************************************
+ // Persistent. Default TRUE. SvDraw wertet das Flag u.a. bei
+ // SdrView::GetPreferedPointer() aus. Hat nur Wirkung, wenn das Dokument
+ // Draw-Objekte mit Macrofunktionalitaet hat (SdrObject::HasMacro()==sal_True).
+ void SetMacroMode(sal_Bool bOn) { bMacroMode=bOn; }
+ sal_Bool IsMacroMode() const { return bMacroMode; }
+ sal_Bool BegMacroObj(const Point& rPnt, short nTol, SdrObject* pObj, SdrPageView* pPV, Window* pWin);
+ sal_Bool BegMacroObj(const Point& rPnt, SdrObject* pObj, SdrPageView* pPV, Window* pWin) { return BegMacroObj(rPnt,-2,pObj,pPV,pWin); }
+ void MovMacroObj(const Point& rPnt);
+ void BrkMacroObj();
+ sal_Bool EndMacroObj();
+ sal_Bool IsMacroObj() const { return pMacroObj!=NULL; }
+ sal_Bool IsMacroObjDown() const { return bMacroDown; }
+
+ /** 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( ::com::sun::star::uno::Any& rSelection );
+
+ virtual void MarkListHasChanged();
+
+ rtl::Reference< sdr::SelectionController > getSelectionController() const { return mxSelectionController; }
+
+ /** returns true if the shape identified by its inventor and identifier supports format paint brush operation */
+ virtual bool SupportsFormatPaintbrush( sal_uInt32 nObjectInventor, sal_uInt16 nObjectIdentifier ) const;
+
+ /** returns a format paint brush set from the current selection */
+ virtual bool TakeFormatPaintBrush( boost::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.
+ */
+ virtual void ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats );
+
+ /** helper function for selections with multiple SdrText for one SdrTextObj (f.e. tables ) */
+ void ApplyFormatPaintBrushToText( SfxItemSet& rFormatSet, SdrTextObj& rTextObj, SdrText* pText, bool bNoCharacterFormats, bool bNoParagraphFormats );
+
+protected:
+ virtual void OnBeginPasteOrDrop( PasteOrDropInfos* pInfos );
+ virtual void OnEndPasteOrDrop( PasteOrDropInfos* pInfos );
+
+};
+
+#endif //_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 000000000000..22a91d3e55c1
--- /dev/null
+++ b/include/svx/svdetc.hxx
@@ -0,0 +1,266 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDETC_HXX
+#define _SVDETC_HXX
+
+#include <tools/string.hxx>
+
+#include <vcl/outdev.hxx>
+#include <tools/shl.hxx>
+#include <editeng/outliner.hxx>
+#include "svx/svxdllapi.h"
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// ExchangeFormat-Id der DrawingEngine holen. Daten koennen dann per
+// static sal_Bool CopyData(pData,nLen,nFormat);
+// bereitgestellt werden, wobei pData/nLen einen SvMemoryStream beschreiben in
+// dem ein SdrModel gestreamt wird an dem fuer die Zeitdauer des Streamens das
+// Flag SdrModel::SetStreamingSdrModel(sal_True) gesetzt wird.
+// sal_uIntPtr SdrGetExchangeFormat(); -- JP 18.01.99 - dafuer gibt es ein define
+
+class SdrOutliner;
+class SdrModel;
+class SvtSysLocale;
+class LocaleDataWrapper;
+
+namespace com { namespace sun { namespace star { namespace lang {
+ struct Locale;
+}}}}
+
+// Einen Outliner mit den engineglobalen
+// Defaulteinstellungen auf dem Heap erzeugen.
+// Ist pMod<>NULL, dann wird der MapMode des uebergebenen
+// Models verwendet. Die resultierende Default-Fonthoehe bleibt
+// jedoch dieselbe (die logische Fonthoehe wird umgerechnet).
+SVX_DLLPUBLIC SdrOutliner* SdrMakeOutliner( sal_uInt16 nOutlinerMode, SdrModel* pMod );
+
+// Globale Defaulteinstellungen fuer die DrawingEngine.
+// Diese Einstellungen sollte man direkt beim Applikationsstart
+// vornehmen, noch bevor andere Methoden der Engine gerufen werden.
+class SVX_DLLPUBLIC SdrEngineDefaults
+{
+friend class SdrAttrObj;
+ String aFontName;
+ FontFamily eFontFamily;
+ Color aFontColor;
+ sal_uIntPtr nFontHeight;
+ MapUnit eMapUnit;
+ Fraction aMapFraction;
+
+private:
+ static SdrEngineDefaults& GetDefaults();
+
+public:
+ SdrEngineDefaults();
+ // Default Fontname ist "Times New Roman"
+ static void SetFontName(const String& rFontName) { GetDefaults().aFontName=rFontName; }
+ static String GetFontName() { return GetDefaults().aFontName; }
+ // Default FontFamily ist FAMILY_ROMAN
+ static void SetFontFamily(FontFamily eFam) { GetDefaults().eFontFamily=eFam; }
+ static FontFamily GetFontFamily() { return GetDefaults().eFontFamily; }
+ // Default FontColor ist COL_BLACK
+ static void SetFontColor(const Color& rColor) { GetDefaults().aFontColor=rColor; }
+ static Color GetFontColor() { return GetDefaults().aFontColor; }
+ // Default FontHeight ist 847. Die Fonthoehe wird in logischen Einheiten
+ // (MapUnit/MapFraction (siehe unten)) angegeben. Die Defaulteinstellung
+ // 847/100mm entspricht also ca. 24 Point. Verwendet man stattdessen
+ // beispielsweise Twips (SetMapUnit(MAP_TWIP)) (20 Twip = 1 Point) muss
+ // man als Fonthoehe 480 angeben um 24 Point als default zu erhalten.
+ static void SetFontHeight(sal_uIntPtr nHeight) { GetDefaults().nFontHeight=nHeight; }
+ static sal_uIntPtr GetFontHeight() { return GetDefaults().nFontHeight; }
+ // Der MapMode wird fuer den globalen Outliner benoetigt.
+ // Gleichzeitig bekommt auch jedes neu instanziierte SdrModel
+ // diesen MapMode default zugewiesen.
+ // Default MapUnit ist MAP_100TH_MM
+ static void SetMapUnit(MapUnit eMap) { GetDefaults().eMapUnit=eMap; }
+ static MapUnit GetMapUnit() { return GetDefaults().eMapUnit; }
+ // Default MapFraction ist 1/1.
+ static void SetMapFraction(const Fraction& rMap) { GetDefaults().aMapFraction=rMap; }
+ static Fraction GetMapFraction() { return GetDefaults().aMapFraction; }
+
+ // Einen Outliner mit den engineglobalen
+ // Defaulteinstellungen auf dem Heap erzeugen.
+ // Ist pMod<>NULL, dann wird der MapMode des uebergebenen
+ // Models verwendet. Die resultierende Default-Fonthoehe bleibt
+ // jedoch dieselbe (die logische Fonthoehe wird umgerechnet).
+ friend SVX_DLLPUBLIC SdrOutliner* SdrMakeOutliner( sal_uInt16 nOutlinerMode, SdrModel* pMod );
+};
+
+class SfxItemSet;
+// Liefert eine Ersatzdarstellung fuer einen XFillStyle
+// Bei XFILL_NONE gibt's sal_False und rCol bleibt unveraendert.
+SVX_DLLPUBLIC bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol);
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// Ein ItemSet auf Outliner- bzw. EditEngine-Items durchsuchen
+// Liefert sal_True, wenn der Set solchen Items enthaelt.
+sal_Bool SearchOutlinerItems(const SfxItemSet& rSet, sal_Bool bInklDefaults, sal_Bool* pbOnlyEE=NULL);
+
+// zurueck erhaelt man einen neuen WhichTable den
+// man dann irgendwann mit delete platthauen muss.
+sal_uInt16* RemoveWhichRange(const sal_uInt16* pOldWhichTable, sal_uInt16 nRangeBeg, sal_uInt16 nRangeEnd);
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class Link;
+
+// Hilfsklasse zur kommunikation zwischen dem Dialog
+// zum aufbrechen von Metafiles (sd/source/ui/dlg/brkdlg.cxx),
+// SdrEditView::DoImportMarkedMtf() und
+// ImpSdrGDIMetaFileImport::DoImport()
+class SVX_DLLPUBLIC SvdProgressInfo
+{
+private:
+ sal_uIntPtr nSumActionCount; // Summe aller Actions
+ sal_uIntPtr nSumCurAction; // Summe aller bearbeiteten Actions
+
+ sal_uIntPtr nActionCount; // Anzahl der Actions im akt. Obj.
+ sal_uIntPtr nCurAction; // Anzahl bearbeiteter Act. im akt. Obj.
+
+ sal_uIntPtr nInsertCount; // Anzahl einzufuegender Act. im akt. Obj.
+ sal_uIntPtr nCurInsert; // Anzahl bereits eingefuegter Actions
+
+ sal_uIntPtr nObjCount; // Anzahl der selektierten Objekte
+ sal_uIntPtr nCurObj; // Aktuelles Objekt
+
+ Link *pLink;
+
+public:
+ SvdProgressInfo( Link *_pLink );
+
+ void Init( sal_uIntPtr _nSumActionCount, sal_uIntPtr _nObjCount );
+
+ sal_Bool SetNextObject();
+
+ void SetActionCount( sal_uIntPtr _nActionCount );
+ void SetInsertCount( sal_uIntPtr _nInsertCount );
+
+ sal_Bool ReportActions( sal_uIntPtr nAnzActions );
+ sal_Bool ReportInserts( sal_uIntPtr nAnzInserts );
+
+ sal_uIntPtr GetSumActionCount() const { return nSumActionCount; };
+ sal_uIntPtr GetSumCurAction() const { return nSumCurAction; };
+ sal_uIntPtr GetObjCount() const { return nObjCount; };
+ sal_uIntPtr GetCurObj() const { return nCurObj; };
+
+ sal_uIntPtr GetActionCount() const { return nActionCount; };
+ sal_uIntPtr GetCurAction() const { return nCurAction; };
+
+ sal_uIntPtr GetInsertCount() const { return nInsertCount; };
+ sal_uIntPtr GetCurInsert() const { return nCurInsert; };
+
+ void ReportError();
+ sal_Bool ReportRescales( sal_uIntPtr nAnzRescales );
+};
+
+
+
+class SdrLinkList
+{
+ std::vector<Link*> aList;
+protected:
+ unsigned FindEntry(const Link& rLink) const;
+public:
+ SdrLinkList(): aList() {}
+ ~SdrLinkList() { Clear(); }
+ SVX_DLLPUBLIC void Clear();
+ unsigned GetLinkCount() const { return (unsigned)aList.size(); }
+ Link& GetLink(unsigned nNum) { return *aList[nNum]; }
+ const Link& GetLink(unsigned nNum) const { return *aList[nNum]; }
+ void InsertLink(const Link& rLink, unsigned nPos=0xFFFF);
+ void RemoveLink(const Link& rLink);
+ bool HasLink(const Link& rLink) const { return FindEntry(rLink)!=0xFFFF; }
+};
+
+SdrLinkList& ImpGetUserMakeObjHdl();
+SdrLinkList& ImpGetUserMakeObjUserDataHdl();
+
+class SdrOle2Obj;
+class AutoTimer;
+
+class OLEObjCache : public std::vector<SdrOle2Obj*>
+{
+ sal_uIntPtr nSize;
+ AutoTimer* pTimer;
+
+ void UnloadOnDemand();
+ sal_Bool UnloadObj( SdrOle2Obj* pObj );
+ DECL_LINK( UnloadCheckHdl, AutoTimer* );
+
+public:
+ OLEObjCache();
+ SVX_DLLPUBLIC ~OLEObjCache();
+
+ void InsertObj(SdrOle2Obj* pObj);
+ void RemoveObj(SdrOle2Obj* pObj);
+};
+
+
+class SVX_DLLPUBLIC SdrGlobalData
+{
+ const SvtSysLocale* pSysLocale; // follows always locale settings
+ const LocaleDataWrapper* pLocaleData; // follows always SysLocale
+public:
+ SdrLinkList aUserMakeObjHdl;
+ SdrLinkList aUserMakeObjUserDataHdl;
+ SdrOutliner* pOutliner;
+ SdrEngineDefaults* pDefaults;
+ ResMgr* pResMgr;
+ sal_uIntPtr nExchangeFormat;
+ OLEObjCache aOLEObjCache;
+
+
+ const SvtSysLocale* GetSysLocale(); // follows always locale settings
+ const LocaleDataWrapper* GetLocaleData(); // follows always SysLocale
+public:
+ SdrGlobalData();
+
+ OLEObjCache& GetOLEObjCache() { return aOLEObjCache; }
+};
+
+inline SdrGlobalData& GetSdrGlobalData()
+{
+ void** ppAppData=GetAppData(SHL_SVD);
+ if (*ppAppData==NULL) {
+ *ppAppData=new SdrGlobalData;
+ }
+ return *((SdrGlobalData*)*ppAppData);
+}
+
+namespace sdr
+{
+
+SVX_DLLPUBLIC String GetResourceString(sal_uInt16 nResID);
+
+}
+
+/////////////////////////////////////////////////////////////////////
+// #i101872# isolated GetTextEditBackgroundColor for tooling
+class SdrObjEditView;
+
+SVX_DLLPUBLIC Color GetTextEditBackgroundColor(const SdrObjEditView& rView);
+
+/////////////////////////////////////////////////////////////////////
+
+#endif //_SVDETC_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svdfield.hxx b/include/svx/svdfield.hxx
new file mode 100644
index 000000000000..9a4fbd8caf00
--- /dev/null
+++ b/include/svx/svdfield.hxx
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDFIELD_HXX
+#define _SVDFIELD_HXX
+
+#include "svx/svxdllapi.h"
+
+void SVX_DLLPUBLIC SdrRegisterFieldClasses();
+
+#endif //_SVDFIELD_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 000000000000..c0a460d021d6
--- /dev/null
+++ b/include/svx/svdglev.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 _SVDGLEV_HXX
+#define _SVDGLEV_HXX
+
+#include "svx/svxdllapi.h"
+#include <svx/svdpoev.hxx>
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class SdrGluePoint;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@@@ @@ @@ @@ @@@@@ @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
+// @@ @@@ @@ @@ @@ @@@@ @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
+// @@@@@ @@@@@ @@@@ @@@@@ @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@
+//
+// Editieren von Klebepunkten an den Objekten (Klebepunkte fuer Verbinder)
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrGlueEditView: public SdrPolyEditView
+{
+ void ImpClearVars();
+
+ // Markierte Klebepunkte kopieren und anstelle der alten markieren
+ void ImpCopyMarkedGluePoints();
+ typedef void (*PGlueDoFunc)(SdrGluePoint&, const SdrObject* pObj, const void*, const void*, const void*, const void*, const void*);
+ typedef void (*PGlueTrFunc)(Point&, const void*, const void*, const void*, const void*, const void*);
+ void ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, sal_Bool bConst, const void* p1=NULL, const void* p2=NULL, const void* p3=NULL, const void* p4=NULL, const void* p5=NULL);
+ void ImpTransformMarkedGluePoints(PGlueTrFunc pTrFunc, const void* p1=NULL, const void* p2=NULL, const void* p3=NULL, const void* p4=NULL, const void* p5=NULL);
+
+protected:
+ // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
+ SdrGlueEditView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ virtual ~SdrGlueEditView();
+
+public:
+ // Durch den Parameter nThisEsc uebergibt man die Richtung, die man
+ // checken bzw. setzen/loeschen will.
+ // Moegliche Werte fuer nThisEsc sind z.Zt.
+ // SDRESC_LEFT, SDRESC_RIGHT, SDRESC_TOP und SDRESC_BOTTOM
+ TRISTATE IsMarkedGluePointsEscDir(sal_uInt16 nThisEsc) const;
+ void SetMarkedGluePointsEscDir(sal_uInt16 nThisEsc, sal_Bool bOn);
+ sal_Bool IsSetMarkedGluePointsEscDirPossible() const { return !IsReadOnly() && HasMarkedGluePoints(); }
+
+ // Checken/setzen, ob die Klebepunktpositionen relativ zur
+ // Objektgroesse sind (Percent=sal_True) oder nicht (Percent=sal_False)
+ TRISTATE IsMarkedGluePointsPercent() const;
+ void SetMarkedGluePointsPercent(sal_Bool bOn);
+ sal_Bool IsSetMarkedGluePointsPercentPossible() const { return !IsReadOnly() && HasMarkedGluePoints(); }
+
+ // bVert=FALSE: Horizontales Alignment checken/setzen
+ // SDRHORZALIGN_CENTER
+ // SDRHORZALIGN_LEFT
+ // SDRHORZALIGN_RIGHT
+ // SDRHORZALIGN_DONTCARE (nur bei Get())
+ // bVert=TRUE: Vertikales Alignment checken/setzen
+ // SDRVERTALIGN_CENTER
+ // SDRVERTALIGN_TOP
+ // SDRVERTALIGN_BOTTOM
+ // SDRVERTALIGN_DONTCARE (nur bei Get())
+ sal_uInt16 GetMarkedGluePointsAlign(sal_Bool bVert) const;
+ void SetMarkedGluePointsAlign(sal_Bool bVert, sal_uInt16 nAlign);
+ sal_Bool IsSetMarkedGluePointsAlignPossible() const { return !IsReadOnly() && HasMarkedGluePoints(); }
+
+ // Alle merkierten Klebepunkte entfernen
+ void DeleteMarkedGluePoints();
+
+ void MoveMarkedGluePoints (const Size& rSiz, bool bCopy=false);
+ void ResizeMarkedGluePoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false);
+ void RotateMarkedGluePoints(const Point& rRef, long nWink, bool bCopy=false);
+ void MirrorMarkedGluePoints(const Point& rRef1, const Point& rRef2, sal_Bool bCopy=sal_False);
+ void MirrorMarkedGluePointsHorizontal(sal_Bool bCopy=sal_False);
+ void MirrorMarkedGluePointsVertical(sal_Bool bCopy=sal_False);
+ void ShearMarkedGluePoints(const Point& rRef, long nWink, sal_Bool bVShear=sal_False, sal_Bool bCopy=sal_False);
+ void CrookMarkedGluePoints(const Point& rRef, const Point& rRad, SdrCrookMode eMode, sal_Bool bVertical=sal_False, sal_Bool bNoContortion=sal_False, sal_Bool bCopy=sal_False);
+ void DistortMarkedGluePoints(const Rectangle& rRef, const XPolygon& rDistortedRect, sal_Bool bNoContortion=sal_False, sal_Bool bCopy=sal_False);
+
+ void AlignMarkedGluePoints(SdrHorAlign eHor, SdrVertAlign eVert);
+};
+
+#endif //_SVDGLEV_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svdglob.hxx b/include/svx/svdglob.hxx
new file mode 100644
index 000000000000..dbec676cfbb5
--- /dev/null
+++ b/include/svx/svdglob.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 _SVDGLOB_HXX
+#define _SVDGLOB_HXX
+
+#include <sal/config.h>
+#include <tools/string.hxx>
+
+#include <svx/svxdllapi.h>
+
+//************************************************************
+// forward declaration
+//************************************************************
+
+class ResMgr;
+
+// Get the resource manager for the app
+ResMgr* ImpGetResMgr();
+
+// ResourceCache for frequently used strings.
+// Global string resources with the IDs from
+// SDR_StringCacheBegin (256) to SDR_StringCacheEnd
+// are cached.
+// See also SvdStr.Hrc
+SVX_DLLPUBLIC String ImpGetResStr(sal_uInt16 nResID);
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_SVDGLOB_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 000000000000..f667f4f0d743
--- /dev/null
+++ b/include/svx/svdglue.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 _SVDGLUE_HXX
+#define _SVDGLUE_HXX
+
+class Window;
+class OutputDevice;
+class SvStream;
+class SdrObject;
+
+#include <tools/gen.hxx>
+#include "svx/svxdllapi.h"
+#include <vector>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define SDRESC_SMART 0x0000
+#define SDRESC_LEFT 0x0001
+#define SDRESC_RIGHT 0x0002
+#define SDRESC_TOP 0x0004
+#define SDRESC_BOTTOM 0x0008
+#define SDRESC_LO 0x0010 /* ni */
+#define SDRESC_LU 0x0020 /* ni */
+#define SDRESC_RO 0x0040 /* ni */
+#define SDRESC_RU 0x0080 /* ni */
+#define SDRESC_HORZ (SDRESC_LEFT|SDRESC_RIGHT)
+#define SDRESC_VERT (SDRESC_TOP|SDRESC_BOTTOM)
+#define SDRESC_ALL 0x00FF
+
+#define SDRHORZALIGN_CENTER 0x0000
+#define SDRHORZALIGN_LEFT 0x0001
+#define SDRHORZALIGN_RIGHT 0x0002
+#define SDRHORZALIGN_DONTCARE 0x0010
+#define SDRVERTALIGN_CENTER 0x0000
+#define SDRVERTALIGN_TOP 0x0100
+#define SDRVERTALIGN_BOTTOM 0x0200
+#define SDRVERTALIGN_DONTCARE 0x1000
+
+class SVX_DLLPUBLIC SdrGluePoint {
+ // Bezugspunkt ist SdrObject::GetSnapRect().Center()
+ // bNoPercent=FALSE: Position ist -5000..5000 (1/100)% bzw. 0..10000 (je nach Align)
+ // bNoPercent=sal_True : Position ist in log Einh, rel zum Bezugspunkt
+ Point aPos;
+ sal_uInt16 nEscDir;
+ sal_uInt16 nId;
+ sal_uInt16 nAlign;
+ sal_uInt8 bNoPercent:1;
+ sal_uInt8 bReallyAbsolute:1; // Temporaer zu setzen fuer Transformationen am Bezugsobjekt
+ sal_uInt8 bUserDefined:1; // #i38892#
+public:
+ SdrGluePoint(): nEscDir(SDRESC_SMART),nId(0),nAlign(0) { bNoPercent=sal_False; bReallyAbsolute=sal_False; bUserDefined=sal_True; }
+ SdrGluePoint(const Point& rNewPos, bool bNewPercent= sal_True, sal_uInt16 nNewAlign=0): aPos(rNewPos),nEscDir(SDRESC_SMART),nId(0),nAlign(nNewAlign) { bNoPercent=!bNewPercent; bReallyAbsolute = sal_False; bUserDefined = sal_True; }
+ bool operator==(const SdrGluePoint& rCmpGP) const { return aPos==rCmpGP.aPos && nEscDir==rCmpGP.nEscDir && nId==rCmpGP.nId && nAlign==rCmpGP.nAlign && bNoPercent==rCmpGP.bNoPercent && bReallyAbsolute==rCmpGP.bReallyAbsolute && bUserDefined==rCmpGP.bUserDefined; }
+ bool operator!=(const SdrGluePoint& rCmpGP) const { return !operator==(rCmpGP); }
+ const Point& GetPos() const { return aPos; }
+ void SetPos(const Point& rNewPos) { aPos=rNewPos; }
+ sal_uInt16 GetEscDir() const { return nEscDir; }
+ void SetEscDir(sal_uInt16 nNewEsc) { nEscDir=nNewEsc; }
+ sal_uInt16 GetId() const { return nId; }
+ void SetId(sal_uInt16 nNewId) { nId=nNewId; }
+ bool IsPercent() const { return bNoPercent ? false : true; }
+ void SetPercent(bool bOn) { bNoPercent = !bOn; }
+ // Temporaer zu setzen fuer Transformationen am Bezugsobjekt
+ bool IsReallyAbsolute() const { return bReallyAbsolute ? true : false; }
+ void SetReallyAbsolute(bool bOn, const SdrObject& rObj);
+
+ // #i38892#
+ bool IsUserDefined() const { return bUserDefined ? true : false; }
+ void SetUserDefined(bool bNew) { bUserDefined = bNew ? true : false; }
+
+ sal_uInt16 GetAlign() const { return nAlign; }
+ void SetAlign(sal_uInt16 nAlg) { nAlign=nAlg; }
+ sal_uInt16 GetHorzAlign() const { return nAlign&0x00FF; }
+ void SetHorzAlign(sal_uInt16 nAlg) { nAlign=(nAlign&0xFF00)|(nAlg&0x00FF); }
+ sal_uInt16 GetVertAlign() const { return nAlign&0xFF00; }
+ void SetVertAlign(sal_uInt16 nAlg) { nAlign=(nAlign&0x00FF)|(nAlg&0xFF00); }
+ bool IsHit(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj) const;
+ void Invalidate(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 nWink);
+ long EscDirToAngle(sal_uInt16 nEsc) const;
+ sal_uInt16 EscAngleToDir(long nWink) const;
+ void Rotate(const Point& rRef, long nWink, double sn, double cs, const SdrObject* pObj);
+ void Mirror(const Point& rRef1, const Point& rRef2, long nWink, const SdrObject* pObj);
+ void Shear (const Point& rRef, long nWink, double tn, bool bVShear, const SdrObject* pObj);
+};
+
+#define SDRGLUEPOINT_NOTFOUND 0xFFFF
+
+class SVX_DLLPUBLIC SdrGluePointList {
+ std::vector<SdrGluePoint*> aList;
+protected:
+ SdrGluePoint* GetObject(sal_uInt16 i) const { return aList[i]; }
+public:
+ SdrGluePointList(): aList() {}
+ SdrGluePointList(const SdrGluePointList& rSrcList): aList() { *this=rSrcList; }
+ ~SdrGluePointList() { Clear(); }
+ void Clear();
+ void operator=(const SdrGluePointList& rSrcList);
+ sal_uInt16 GetCount() const { return sal_uInt16(aList.size()); }
+ // Beim Insert wird dem Objekt (also dem GluePoint) automatisch eine Id zugewiesen.
+ // ReturnCode ist der Index des neuen GluePoints in der Liste
+ sal_uInt16 Insert(const SdrGluePoint& rGP);
+ void Delete(sal_uInt16 nPos)
+ {
+ SdrGluePoint* p = aList[nPos];
+ aList.erase(aList.begin()+nPos);
+ delete p;
+ }
+ SdrGluePoint& operator[](sal_uInt16 nPos) { return *GetObject(nPos); }
+ const SdrGluePoint& operator[](sal_uInt16 nPos) const { return *GetObject(nPos); }
+ sal_uInt16 FindGluePoint(sal_uInt16 nId) const;
+ sal_uInt16 HitTest(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj, bool bBack = false, bool bNext = false, sal_uInt16 nId0=0) const;
+ void Invalidate(Window& rWin, const SdrObject* pObj) const;
+ // Temporaer zu setzen fuer Transformationen am Bezugsobjekt
+ void SetReallyAbsolute(bool bOn, const SdrObject& rObj);
+ void Rotate(const Point& rRef, long nWink, 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 nWink, const SdrObject* pObj);
+ void Shear (const Point& rRef, long nWink, double tn, bool bVShear, const SdrObject* pObj);
+};
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..2a58f612ec8c
--- /dev/null
+++ b/include/svx/svdhdl.hxx
@@ -0,0 +1,515 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDHDL_HXX
+#define _SVDHDL_HXX
+
+#include <tools/gen.hxx>
+
+#include <vcl/pointr.hxx>
+
+#include <svl/solar.hrc>
+
+#include <svx/xpoly.hxx>
+#include <svx/svdoedge.hxx>
+#include <svx/sdr/overlay/overlayobjectlist.hxx>
+#include "svx/svxdllapi.h"
+
+class VirtualDevice;
+class OutputDevice;
+class Region;
+class Window;
+class SdrHdlList;
+class SdrMarkView;
+class SdrObject;
+class SdrPageView;
+class MouseEvent;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// Jedes Objekt muss in der Lage seine Handles zu erzeugen. Diese werden dann
+// bei einer Selektion abgeholt, bei der View angemeldet und sichtbar gemacht.
+// Wird ein Handle von der Maus beruehrt (IsHit()), so wird von der View der
+// entsprechende Mauszeiger vom Handle abgeholt und der App auf Anfrage zum
+// reinschalten uebergeben.
+// Handles wie z.B. der Rotationsmittelpunkt oder die Spiegelachse werden von
+// der View generiert, wenn vom Controller der entsprechende Transformations-
+// Modus selektiert wird.
+// HDL_MOVE...HDL_LWRGT muessen im enum immer zusammen stehen bleiben!
+
+enum SdrHdlKind
+{
+ HDL_MOVE, // Handle zum Verschieben des Objekts
+ HDL_UPLFT, // Oben links
+ HDL_UPPER, // Oben
+ HDL_UPRGT, // Oben rechts
+ HDL_LEFT, // Links
+ HDL_RIGHT, // Rechts
+ HDL_LWLFT, // Unten links
+ HDL_LOWER, // Unten
+ HDL_LWRGT, // Unten rechts
+ HDL_POLY, // Punktselektion an Polygon oder Bezierkurve
+ HDL_BWGT, // Gewicht an einer Bezierkurve
+ HDL_CIRC, // Winkel an Kreissegmenten, Eckenradius am Rect
+ HDL_REF1, // Referenzpunkt 1, z.B. Rotationsmitte
+ HDL_REF2, // Referenzpunkt 2, z.B. Endpunkt der Spiegelachse
+ HDL_MIRX, // Die Spiegelachse selbst
+ HDL_GLUE, // GluePoint
+ HDL_GLUE_DESELECTED, // GluePoint
+ HDL_ANCHOR, // anchor symbol (SD, SW)
+ HDL_TRNS, // interactive transparence
+ HDL_GRAD, // interactive gradient
+ HDL_COLR, // interactive color
+ HDL_USER,
+ HDL_ANCHOR_TR, // #101688# Anchor handle with (0,0) at top right for SW
+
+ // for SJ and the CustomShapeHandles:
+ HDL_CUSTOMSHAPE1,
+
+ HDL_SMARTTAG
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+enum BitmapColorIndex
+{
+ LightGreen,
+ Cyan,
+ LightCyan,
+ Red,
+ LightRed,
+ Yellow
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+enum 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 aninate anchor control, too.
+ AnchorPressed,
+
+ // #101688# AnchorTR for SW
+ AnchorTR,
+ AnchorPressedTR,
+
+ // for SJ and the CustomShapeHandles:
+ Customshape1
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrHdl
+{
+ friend class SdrMarkView; // fuer den Zugriff auf nObjHdlNum
+ friend class SdrHdlList;
+
+ static BitmapEx ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd);
+
+protected:
+ SdrObject* pObj; // Gehoert das Handle zu einem Objekt?
+ SdrPageView* pPV; // Gehoert das Handle zu einem Objekt in einer bestimmten PageView?
+ SdrHdlList* pHdlList; // Zum Feststelen der Handlegroesse
+
+ // OVERLAYMANAGER
+ ::sdr::overlay::OverlayObjectList maOverlayGroup;
+
+ Point aPos;
+
+ SdrHdlKind eKind;
+
+ long nDrehWink; // Handles bzw. Mauszeiger drehen
+ sal_uInt32 nObjHdlNum; // wird von der MarkView benoetigt
+ sal_uInt32 nPolyNum; // Polygonpunktes
+ sal_uInt32 nPPntNum; // Punktnummer des Polygons
+ sal_uInt32 nSourceHdlNum; // ist noch vollstaendig zu implementieren
+
+ unsigned bSelect : 1; // Ein selektierter Polygonpunkt?
+ unsigned b1PixMore : 1; // True=Handle wird 1 Pixel groesser dargestellt
+ unsigned bPlusHdl : 1; // u.a. fuer Hld-Paint Optimierung bei MarkPoint/UnmarkPoint, ...
+
+ 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:
+ ::sdr::overlay::OverlayObject* CreateOverlayObject(
+ const basegfx::B2DPoint& rPos,
+ BitmapColorIndex eColIndex, BitmapMarkerKind eKindOfMarker, Point aMoveOutsideOffset = Point());
+ BitmapMarkerKind GetNextBigger(BitmapMarkerKind eKnd) const;
+
+public:
+ SdrHdl();
+ explicit SdrHdl(const Point& rPnt, SdrHdlKind eNewKind=HDL_MOVE);
+ 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);
+
+ sal_Bool IsSelected() const { return bSelect; }
+ void SetSelected(sal_Bool bJa=sal_True);
+
+ void Set1PixMore(sal_Bool bJa=sal_True);
+ void SetDrehWink(long n);
+
+ sal_Bool IsCornerHdl() const { return eKind==HDL_UPLFT || eKind==HDL_UPRGT || eKind==HDL_LWLFT || eKind==HDL_LWRGT; }
+ sal_Bool IsVertexHdl() const { return eKind==HDL_UPPER || eKind==HDL_LOWER || eKind==HDL_LEFT || eKind==HDL_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(sal_Bool bOn) { bPlusHdl=bOn; }
+ sal_Bool IsPlusHdl() const { return bPlusHdl; }
+
+ void SetSourceHdlNum(sal_uInt32 nNum) { nSourceHdlNum=nNum; }
+ sal_uInt32 GetSourceHdlNum() const { return nSourceHdlNum; }
+
+ virtual Pointer GetPointer() const;
+ bool IsHdlHit(const Point& rPnt) const;
+
+ // #97016# II
+ virtual sal_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 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() { return ImpGetBitmapEx(Glue_Deselected, 0); }
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define SDR_HANDLE_COLOR_SIZE_NORMAL Size(13, 13)
+#define SDR_HANDLE_COLOR_SIZE_SELECTED Size(17, 17)
+
+class SVX_DLLPUBLIC SdrHdlColor : public SdrHdl
+{
+private:
+ // size of colr markers
+ Size aMarkerSize;
+
+ // color
+ Color aMarkerColor;
+
+ // callback link when value changed
+ Link aColorChangeHdl;
+
+ // use luminance values only
+ unsigned bUseLuminance : 1;
+
+ // create marker for this kind
+ SVX_DLLPRIVATE virtual void CreateB2dIAObject();
+
+ // help functions
+ SVX_DLLPRIVATE Bitmap CreateColorDropper(Color aCol);
+ SVX_DLLPRIVATE Color GetLuminance(const Color& rCol);
+ SVX_DLLPRIVATE void CallColorChangeLink();
+
+public:
+ explicit SdrHdlColor(const Point& rRef, Color aCol = Color(COL_BLACK), const Size& rSize = Size(11, 11), sal_Bool bLum = sal_False);
+ virtual ~SdrHdlColor();
+
+ sal_Bool IsUseLuminance() const { return bUseLuminance; }
+
+ Color GetColor() const { return aMarkerColor; }
+ void SetColor(Color aNew, sal_Bool bCallLink = sal_False);
+
+ const Size& GetSize() const { return aMarkerSize; }
+ void SetSize(const Size& rNew);
+
+ void SetColorChangeHdl(const Link& rLink) { aColorChangeHdl = rLink; }
+ const Link& GetColorChangeHdl() const { return aColorChangeHdl; }
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SdrHdlGradient : public SdrHdl
+{
+private:
+ // pointer to used color handles
+ SdrHdlColor* pColHdl1;
+ SdrHdlColor* pColHdl2;
+
+ // 2nd position
+ Point a2ndPos;
+
+ // is this a gradient or a transparence
+ unsigned bGradient : 1;
+
+ // select which handle to move
+ bool bMoveSingleHandle : 1;
+ bool bMoveFirstHandle : 1;
+
+ // create marker for this kind
+ virtual void CreateB2dIAObject();
+
+public:
+ SdrHdlGradient(const Point& rRef1, const Point& rRef2, sal_Bool bGrad = sal_True);
+ virtual ~SdrHdlGradient();
+
+ sal_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, SdrHdl*);
+
+ // transformation call, create gradient from this handle
+ void FromIAOToItem(SdrObject* pObj, sal_Bool bSetItemOnObject, sal_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: public SdrHdl
+{
+ // create marker for this kind
+ virtual void CreateB2dIAObject();
+
+protected:
+ SdrHdl* pHdl1;
+ SdrHdl* pHdl2;
+
+public:
+ SdrHdlLine(SdrHdl& rHdl1, SdrHdl& rHdl2, SdrHdlKind eNewKind=HDL_MIRX) { eKind=eNewKind; pHdl1=&rHdl1; pHdl2=&rHdl2; }
+ virtual ~SdrHdlLine();
+
+ virtual Pointer GetPointer() const;
+};
+
+// Ein SdrHdlBezWgt hat Kenntnis von seinem "BasisHandle". Seine Draw-Methode
+// zeichnet zusaetzlich eine Linie von seiner Position zur Position dieses
+// BasisHandles.
+class SdrHdlBezWgt: public SdrHdl
+{
+ // create marker for this kind
+ virtual void CreateB2dIAObject();
+
+protected:
+ const SdrHdl* pHdl1;
+
+public:
+ // das ist kein Copy-Ctor!!!
+ SdrHdlBezWgt(const SdrHdl* pRefHdl1, SdrHdlKind eNewKind=HDL_BWGT) { eKind=eNewKind; pHdl1=pRefHdl1; }
+ virtual ~SdrHdlBezWgt();
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class E3dVolumeMarker : public SdrHdl
+{
+ basegfx::B2DPolyPolygon aWireframePoly;
+
+ // create marker for this kind
+ virtual void CreateB2dIAObject();
+
+public:
+ explicit E3dVolumeMarker(const basegfx::B2DPolyPolygon& rWireframePoly);
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class ImpEdgeHdl: public SdrHdl
+{
+ SdrEdgeLineCode eLineCode;
+
+ // create marker for this kind
+ virtual void CreateB2dIAObject();
+
+public:
+ ImpEdgeHdl(const Point& rPnt, SdrHdlKind eNewKind): SdrHdl(rPnt,eNewKind),eLineCode(MIDDLELINE) {}
+ virtual ~ImpEdgeHdl();
+
+ void SetLineCode(SdrEdgeLineCode eCode);
+ SdrEdgeLineCode GetLineCode() const { return eLineCode; }
+ sal_Bool IsHorzDrag() const;
+ virtual Pointer GetPointer() const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class ImpMeasureHdl: public SdrHdl
+{
+ // create marker for this kind
+ virtual void CreateB2dIAObject();
+
+public:
+ ImpMeasureHdl(const Point& rPnt, SdrHdlKind eNewKind): SdrHdl(rPnt,eNewKind) {}
+ virtual ~ImpMeasureHdl();
+
+ virtual Pointer GetPointer() const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class ImpTextframeHdl: public SdrHdl
+{
+ const Rectangle maRect;
+
+ // create marker for this kind
+ virtual void CreateB2dIAObject();
+
+public:
+ explicit ImpTextframeHdl(const Rectangle& rRect);
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrHdlList
+{
+protected:
+ sal_uIntPtr mnFocusIndex;
+ SdrMarkView* pView;
+ std::deque<SdrHdl*> aList;
+ sal_uInt16 nHdlSize;
+
+ unsigned bRotateShear : 1;
+ unsigned bDistortShear : 1;
+ unsigned bMoveOutside : 1; // Handles nach aussen ruecken (fuer TextEdit)
+
+private:
+ SVX_DLLPRIVATE SdrHdlList(const SdrHdlList&): aList() {}
+ SVX_DLLPRIVATE void operator=(const SdrHdlList&) {}
+ SVX_DLLPRIVATE sal_Bool operator==(const SdrHdlList&) const { return sal_False; }
+ SVX_DLLPRIVATE sal_Bool operator!=(const SdrHdlList&) const { return sal_False; }
+
+public:
+ explicit SdrHdlList(SdrMarkView* pV);
+ ~SdrHdlList();
+ void Clear();
+
+ // #97016# II
+ void TravelFocusHdl(sal_Bool bForward);
+ SdrHdl* GetFocusHdl() const;
+ void SetFocusHdl(SdrHdl* pNew);
+ void ResetFocusHdl();
+
+ // Access to View
+ SdrMarkView* GetView() const;
+
+ // Sortierung: 1.Level Erst Refpunkt-Handles, dann normale Handles, dann Glue, dann User, dann Plushandles
+ // 2.Level PageView (Pointer)
+ // 3.Level Position (x+y)
+ void Sort();
+ sal_uIntPtr GetHdlCount() const { return aList.size(); }
+ SdrHdl* GetHdl(sal_uIntPtr nNum) const { return nNum != CONTAINER_ENTRY_NOTFOUND ? aList[nNum] : NULL; }
+ sal_uIntPtr GetHdlNum(const SdrHdl* pHdl) const;
+ void SetHdlSize(sal_uInt16 nSiz);
+ sal_uInt16 GetHdlSize() const { return nHdlSize; }
+ void SetMoveOutside(sal_Bool bOn);
+ sal_Bool IsMoveOutside() const { return bMoveOutside; }
+ void SetRotateShear(sal_Bool bOn);
+ sal_Bool IsRotateShear() const { return bRotateShear; }
+ void SetDistortShear(sal_Bool bOn);
+ sal_Bool IsDistortShear() const { return bDistortShear; }
+
+ // AddHdl uebernimmt das Handle in sein Eigentum. Es muss
+ // also auf dem Heap stehen, da Clear() ein delete macht.
+ void AddHdl(SdrHdl* pHdl, sal_Bool bAtBegin=sal_False);
+ SdrHdl* RemoveHdl(sal_uIntPtr nNum);
+ void RemoveAllByKind(SdrHdlKind eKind);
+
+ // Zuletzt eingefuegte Handles werden am ehesten getroffen
+ // (wenn Handles uebereinander liegen).
+ SdrHdl* IsHdlListHit(const Point& rPnt, sal_Bool bBack=sal_False, sal_Bool bNext=sal_False, SdrHdl* pHdl0=NULL) const;
+ SdrHdl* GetHdl(SdrHdlKind eKind1) const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrCropHdl : public SdrHdl
+{
+public:
+ SdrCropHdl(const Point& rPnt, SdrHdlKind eNewKind);
+
+protected:
+ // create marker for this kind
+ virtual void CreateB2dIAObject();
+
+ BitmapEx GetBitmapForHandle( const BitmapEx& rBitmap, int nSize );
+
+ static BitmapEx GetHandlesBitmap();
+};
+
+#endif //_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 000000000000..1c011808cb47
--- /dev/null
+++ b/include/svx/svdhlpln.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 _SVDHLPLN_HXX
+#define _SVDHLPLN_HXX
+
+#include <sal/types.h>
+#include <tools/color.hxx>
+#include <tools/gen.hxx>
+
+#include <vcl/pointr.hxx>
+#include "svx/svxdllapi.h"
+
+class OutputDevice;
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+enum SdrHelpLineKind {SDRHELPLINE_POINT,SDRHELPLINE_VERTICAL,SDRHELPLINE_HORIZONTAL};
+
+#define SDRHELPLINE_POINT_PIXELSIZE 15 /* Tatsaechliche Groesse= PIXELSIZE*2+1 */
+
+class SdrHelpLine {
+ Point aPos; // je nach Wert von eKind ist X oder Y evtl. belanglos
+ SdrHelpLineKind eKind;
+
+ // #i27493#
+ // Helper method to draw a hor or ver two-colored dashed line
+ void ImpDrawDashedTwoColorLine(OutputDevice& rOut, sal_Int32 nStart, sal_Int32 nEnd, sal_Int32 nFixPos,
+ sal_Int32 nStepWidth, Color aColA, Color aColB, sal_Bool bHorizontal) const;
+
+public:
+ explicit SdrHelpLine(SdrHelpLineKind eNewKind=SDRHELPLINE_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; }
+
+ Pointer GetPointer() const;
+ bool IsHit(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const;
+ // OutputDevice wird benoetigt, da Fangpunkte eine feste Pixelgroesse haben
+ Rectangle GetBoundRect(const OutputDevice& rOut) const;
+};
+
+#define SDRHELPLINE_NOTFOUND 0xFFFF
+
+class SVX_DLLPUBLIC SdrHelpLineList {
+ std::vector<SdrHelpLine*> aList;
+protected:
+ SdrHelpLine* GetObject(sal_uInt16 i) const { return aList[i]; }
+public:
+ SdrHelpLineList(): aList() {}
+ SdrHelpLineList(const SdrHelpLineList& rSrcList): aList() { *this=rSrcList; }
+ ~SdrHelpLineList() { Clear(); }
+ void Clear();
+ void 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.push_back(new SdrHelpLine(rHL)); }
+ void Insert(const SdrHelpLine& rHL, sal_uInt16 nPos)
+ {
+ if(nPos==0xFFFF)
+ aList.push_back(new SdrHelpLine(rHL));
+ else
+ aList.insert(aList.begin() + nPos, new SdrHelpLine(rHL));
+ }
+ void Delete(sal_uInt16 nPos)
+ {
+ SdrHelpLine* p = aList[nPos];
+ delete p;
+ aList.erase(aList.begin() + nPos);
+ }
+ void Move(sal_uInt16 nPos, sal_uInt16 nNewPos)
+ {
+ SdrHelpLine* p = aList[nPos];
+ aList.erase(aList.begin() + nPos);
+ aList.insert(aList.begin() + nNewPos, p);
+ }
+ SdrHelpLine& operator[](sal_uInt16 nPos) { return *GetObject(nPos); }
+ const SdrHelpLine& operator[](sal_uInt16 nPos) const { return *GetObject(nPos); }
+ sal_uInt16 HitTest(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..d58512138b79
--- /dev/null
+++ b/include/svx/svditer.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 _SVDITER_HXX
+#define _SVDITER_HXX
+
+#include <vector>
+
+#include <sal/types.h>
+#include "svx/svxdllapi.h"
+
+class SdrObjList;
+class SdrObject;
+class SdrMarkList;
+
+// SdrObjListIter methods:
+// IM_FLAT : Flat over the list
+// IM_DEEPWITHGROUPS : With recursive descent parser, Next() also returns group objects
+// IM_DEEPNOGROUPS : With recursive descent parser, Next() returns no group objects
+enum SdrIterMode { IM_FLAT, IM_DEEPWITHGROUPS, IM_DEEPNOGROUPS};
+
+class SVX_DLLPUBLIC SdrObjListIter
+{
+ std::vector<SdrObject*> maObjList;
+ sal_uInt32 mnIndex;
+ bool mbReverse;
+
+ void ImpProcessObjectList(const SdrObjList& rObjList, SdrIterMode eMode, bool bUseZOrder);
+ void ImpProcessMarkList(const SdrMarkList& rMarkList, SdrIterMode eMode);
+ void ImpProcessObj(SdrObject* pObj, SdrIterMode eMode, bool bUseZOrder);
+
+public:
+ explicit SdrObjListIter(const SdrObjList& rObjList, SdrIterMode eMode = IM_DEEPNOGROUPS, bool bReverse = false);
+ /** This variant lets the user choose the order in which to travel over
+ the objects.
+ @param bUseZOrder
+ When <TRUE/> then the z-order defines the order of iteration.
+ Otherwise the navigation position as returned by
+ SdrObject::GetNavigationPosition() is used.
+ */
+ SdrObjListIter(const SdrObjList& rObjList, bool bUseZOrder, SdrIterMode eMode = IM_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& rObj, SdrIterMode eMode = IM_DEEPNOGROUPS, bool bReverse = false);
+
+ /** Iterates over a list of marked objects received from the SdrMarkView. */
+ explicit SdrObjListIter(const SdrMarkList& rMarkList, SdrIterMode eMode = IM_DEEPNOGROUPS, bool bReverse = false);
+
+ void Reset() { mnIndex = (mbReverse ? maObjList.size() : 0L); }
+ bool IsMore() const { return (mbReverse ? mnIndex != 0 : ( mnIndex < maObjList.size())); }
+ SdrObject* Next()
+ {
+ sal_uInt32 idx = (mbReverse ? --mnIndex : mnIndex++);
+ return idx < maObjList.size() ? maObjList[idx] : NULL;
+ }
+
+ sal_uInt32 Count() { return maObjList.size(); }
+};
+
+#endif //_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 000000000000..c405cdb8f32f
--- /dev/null
+++ b/include/svx/svdlayer.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 _SVDLAYER_HXX
+#define _SVDLAYER_HXX
+
+#include <tools/stream.hxx>
+#include <svx/svdsob.hxx>
+#include <svx/svdtypes.hxx> // fuer typedef SdrLayerID
+#include "svx/svxdllapi.h"
+#include <algorithm>
+
+class SdrModel;
+
+class SVX_DLLPUBLIC SdrLayer
+{
+ friend class SdrLayerAdmin;
+
+ OUString maName;
+ OUString maTitle;
+ OUString maDescription;
+ SdrModel* pModel; // zum Broadcasten
+ sal_uInt16 nType; // 0=Userdefined,1=Standardlayer
+ SdrLayerID nID;
+
+ SdrLayer(SdrLayerID nNewID, const OUString& rNewName);
+
+public:
+ bool operator==(const SdrLayer& rCmpLayer) const;
+ bool operator!=(const SdrLayer& rCmpLayer) const { return !operator==(rCmpLayer); }
+
+ 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; }
+
+ SdrLayerID GetID() const { return nID; }
+ void SetModel(SdrModel* pNewModel) { pModel=pNewModel; }
+ SdrModel* GetModel() const { return pModel; }
+ // Einem SdrLayer kann man sagen dass er ein (der) Standardlayer sein soll.
+ // Es wird dann laenderspeziefisch der passende Name gesetzt. SetName()
+ // setzt das Flag "StandardLayer" ggf. zurueck auf "Userdefined".
+ void SetStandardLayer(bool bStd = true);
+ bool IsStandardLayer() const { return nType==1; }
+};
+
+// Beim Aendern von Layerdaten muss man derzeit
+// noch selbst das Modify-Flag am Model setzen.
+#define SDRLAYER_MAXCOUNT 255
+class SVX_DLLPUBLIC SdrLayerAdmin {
+friend class SdrView;
+friend class SdrModel;
+friend class SdrPage;
+
+protected:
+ std::vector<SdrLayer*> aLayer;
+ SdrLayerAdmin* pParent; // Der Admin der Seite kennt den Admin des Docs
+ SdrModel* pModel; // zum Broadcasten
+ OUString maControlLayerName;
+protected:
+ // Eine noch nicht verwendete LayerID raussuchen. Sind bereits alle
+ // verbraucht, so gibt's 'ne 0. Wer sicher gehen will, muss vorher
+ // GetLayerCount()<SDRLAYER_MAXCOUNT abfragen, denn sonst sind alle
+ // vergeben.
+ SdrLayerID GetUniqueLayerID() const;
+ void Broadcast() const;
+public:
+ explicit SdrLayerAdmin(SdrLayerAdmin* pNewParent=NULL);
+ SdrLayerAdmin(const SdrLayerAdmin& rSrcLayerAdmin);
+ ~SdrLayerAdmin();
+ const SdrLayerAdmin& operator=(const SdrLayerAdmin& rSrcLayerAdmin);
+ bool operator==(const SdrLayerAdmin& rCmpLayerAdmin) const;
+ bool operator!=(const SdrLayerAdmin& rCmpLayerAdmin) const { return !operator==(rCmpLayerAdmin); }
+ SdrLayerAdmin* GetParent() const { return pParent; }
+ void SetParent(SdrLayerAdmin* pNewParent) { pParent=pNewParent; }
+ void SetModel(SdrModel* pNewModel);
+ SdrModel* GetModel() const { return pModel; }
+ void InsertLayer(SdrLayer* pLayer)
+ {
+ aLayer.push_back(pLayer);
+ pLayer->SetModel(pModel);
+ Broadcast();
+ }
+ void InsertLayer(SdrLayer* pLayer, sal_uInt16 nPos)
+ {
+ if(nPos==0xFFFF)
+ aLayer.push_back(pLayer);
+ else
+ aLayer.insert(aLayer.begin() + nPos, pLayer);
+ pLayer->SetModel(pModel);
+ Broadcast();
+ }
+ SdrLayer* RemoveLayer(sal_uInt16 nPos);
+ // Alle Layer loeschen
+ void ClearLayer();
+ // Neuer Layer wird angelegt und eingefuegt
+ SdrLayer* NewLayer(const OUString& rName, sal_uInt16 nPos=0xFFFF);
+ void DeleteLayer(SdrLayer* pLayer)
+ {
+ std::vector<SdrLayer*>::iterator it = std::find(aLayer.begin(), aLayer.end(), pLayer);
+ if( it == aLayer.end() )
+ return;
+ aLayer.erase(it);
+ delete pLayer;
+ Broadcast();
+ }
+ // Neuer Layer, Name wird aus der Resource geholt
+ SdrLayer* NewStandardLayer(sal_uInt16 nPos=0xFFFF);
+
+ // Iterieren ueber alle Layer
+ sal_uInt16 GetLayerCount() const { return sal_uInt16(aLayer.size()); }
+ SdrLayer* GetLayer(sal_uInt16 i) { return aLayer[i]; }
+ const SdrLayer* GetLayer(sal_uInt16 i) const { return aLayer[i]; }
+
+ sal_uInt16 GetLayerPos(SdrLayer* pLayer) const;
+
+ SdrLayer* GetLayer(const OUString& rName, bool bInherited);
+ const SdrLayer* GetLayer(const OUString& rName, bool bInherited) const;
+ SdrLayerID GetLayerID(const OUString& rName, bool bInherited) const;
+ SdrLayer* GetLayerPerID(sal_uInt16 nID) { return (SdrLayer*)(((const SdrLayerAdmin*)this)->GetLayerPerID(nID)); }
+ const SdrLayer* GetLayerPerID(sal_uInt16 nID) const;
+
+ void SetControlLayerName(const OUString& rNewName);
+ const OUString& GetControlLayerName() const { return maControlLayerName; }
+};
+
+/*
+Anmerkung zu den Layer - Gemischt symbolisch/ID-basierendes Interface
+ Einen neuen Layer macht man sich mit:
+ pLayerAdmin->NewLayer("Der neue Layer");
+ Der Layer wird dann automatisch an das Ende der Liste angehaengt.
+ Entsprechdes gilt fuer Layersets gleichermassen.
+ Das Interface am SdrLayerSet basiert auf LayerID's. Die App muss sich
+ dafuer am SdrLayerAdmin eine ID abholen:
+ SdrLayerID nLayerID=pLayerAdmin->GetLayerID("Der neue Layer");
+ Wird der Layer nicht gefunden, so liefert die Methode SDRLAYER_NOTFOUND
+ zurueck. Die Methoden mit ID-Interface fangen diesen Wert jedoch i.d.R
+ sinnvoll ab.
+ Hat man nicht nur den Namen, sondern gar einen SdrLayer*, so kann man
+ sich die ID natuerlich wesentlich schneller direkt vom Layer abholen.
+bInherited:
+ TRUE: Wird der Layer/LayerSet nicht gefunden, so wird im Parent-LayerAdmin
+ nachgesehen, ob es dort einen entsprechende Definition gibt.
+ FALSE: Es wird nur dieser LayerAdmin durchsucht.
+ Jeder LayerAdmin einer Seite hat einen Parent-LayerAdmin, n�mlich den des
+ Model. Das Model selbst hat keinen Parent.
+*/
+
+#endif //_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 000000000000..d8058fb41357
--- /dev/null
+++ b/include/svx/svdmark.hxx
@@ -0,0 +1,298 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDMARK_HXX
+#define _SVDMARK_HXX
+
+#include <vector>
+
+#include <tools/string.hxx>
+#include "svx/svxdllapi.h"
+#include <svx/sdrobjectuser.hxx>
+
+#include <set>
+
+class Rectangle;
+class SdrPage;
+class SdrObjList;
+class SdrObject;
+class SdrPageView;
+
+typedef std::set<sal_uInt16> SdrUShortCont;
+
+
+// Alles was eine View ueber ein markiertes Objekt wissen muss
+class SVX_DLLPUBLIC SdrMark : public sdr::ObjectUser
+{
+protected:
+ SdrObject* mpSelectedSdrObject; // the seleceted object
+ SdrPageView* mpPageView;
+ SdrUShortCont* mpPoints; // Markierte Punkte
+ SdrUShortCont* mpLines; // Markierte Linienabschnitte
+ SdrUShortCont* mpGluePoints; // Markierte Klebepunkte (deren Id's)
+ sal_Bool mbCon1; // fuer Connectoren
+ sal_Bool mbCon2; // fuer Connectoren
+ sal_uInt16 mnUser; // z.B. fuer CopyObjects, mitkopieren von Edges
+
+public:
+ explicit SdrMark(SdrObject* pNewObj = 0L, SdrPageView* pNewPageView = 0L);
+ SdrMark(const SdrMark& rMark);
+ virtual ~SdrMark();
+
+ // derived from ObjectUser
+ virtual void ObjectInDestruction(const SdrObject& rObject);
+
+ SdrMark& operator=(const SdrMark& rMark);
+ sal_Bool operator==(const SdrMark& rMark) const;
+ sal_Bool operator!=(const SdrMark& rMark) const
+ {
+ return !(operator==(rMark));
+ }
+
+ void SetMarkedSdrObj(SdrObject* pNewObj);
+ SdrObject* GetMarkedSdrObj() const;
+
+ SdrPageView* GetPageView() const
+ {
+ return mpPageView;
+ }
+
+ void SetPageView(SdrPageView* pNewPageView)
+ {
+ mpPageView = pNewPageView;
+ }
+
+ void SetCon1(sal_Bool bOn)
+ {
+ mbCon1 = bOn;
+ }
+
+ sal_Bool IsCon1() const
+ {
+ return mbCon1;
+ }
+
+ void SetCon2(sal_Bool bOn)
+ {
+ mbCon2 = bOn;
+ }
+
+ sal_Bool IsCon2() const
+ {
+ return mbCon2;
+ }
+
+ void SetUser(sal_uInt16 nVal)
+ {
+ mnUser = nVal;
+ }
+
+ sal_uInt16 GetUser() const
+ {
+ return mnUser;
+ }
+
+ const SdrUShortCont* GetMarkedPoints() const
+ {
+ return mpPoints;
+ }
+
+ const SdrUShortCont* GetMarkedLines() const
+ {
+ return mpLines;
+ }
+
+ const SdrUShortCont* GetMarkedGluePoints() const
+ {
+ return mpGluePoints;
+ }
+
+ SdrUShortCont* GetMarkedPoints()
+ {
+ return mpPoints;
+ }
+
+ SdrUShortCont* GetMarkedLines()
+ {
+ return mpLines;
+ }
+
+ SdrUShortCont* GetMarkedGluePoints()
+ {
+ return mpGluePoints;
+ }
+
+ SdrUShortCont* ForceMarkedPoints()
+ {
+ if(!mpPoints)
+ mpPoints = new SdrUShortCont;
+
+ return mpPoints;
+ }
+
+ SdrUShortCont* ForceMarkedLines()
+ {
+ if(!mpLines)
+ mpLines = new SdrUShortCont;
+
+ return mpLines;
+ }
+
+ SdrUShortCont* ForceMarkedGluePoints()
+ {
+ if(!mpGluePoints)
+ mpGluePoints = new SdrUShortCont;
+
+ return mpGluePoints;
+ }
+};
+
+class SVX_DLLPUBLIC SdrMarkList
+{
+protected:
+ std::vector<SdrMark*> maList;
+
+ String maMarkName;
+ String maPointName;
+ String maGluePointName;
+
+ sal_Bool mbPointNameOk;
+ sal_Bool mbGluePointNameOk;
+ sal_Bool mbNameOk;
+ sal_Bool mbSorted;
+
+private:
+ SVX_DLLPRIVATE sal_Bool operator==(const SdrMarkList& rCmpMarkList) const;
+ SVX_DLLPRIVATE void ImpForceSort();
+
+private:
+ SVX_DLLPRIVATE const XubString& GetPointMarkDescription(sal_Bool bGlue) const;
+
+public:
+ SdrMarkList()
+ : maList(),
+ mbPointNameOk(sal_False),
+ mbGluePointNameOk(sal_False),
+ mbNameOk(sal_False),
+ mbSorted(sal_True)
+ {
+ }
+
+ SdrMarkList(const SdrMarkList& rLst)
+ : maList()
+ {
+ *this = rLst;
+ }
+
+ ~SdrMarkList()
+ {
+ Clear();
+ }
+
+ void Clear();
+ void ForceSort() const;
+ void SetUnsorted()
+ {
+ mbSorted = sal_False;
+ }
+
+ sal_uLong GetMarkCount() const
+ {
+ return maList.size();
+ }
+
+ SdrMark* GetMark(sal_uLong nNum) const;
+ sal_uLong FindObject(const SdrObject* pObj) const;
+ void InsertEntry(const SdrMark& rMark, sal_Bool bChkSort = sal_True);
+ void DeleteMark(sal_uLong nNum);
+ void ReplaceMark(const SdrMark& rNewMark, sal_uLong nNum);
+ void Merge(const SdrMarkList& rSrcList, sal_Bool bReverse = sal_False);
+ sal_Bool DeletePageView(const SdrPageView& rPV);
+ sal_Bool InsertPageView(const SdrPageView& rPV);
+
+ void SetNameDirty()
+ {
+ mbNameOk = sal_False;
+ mbPointNameOk = sal_False;
+ mbGluePointNameOk = sal_False;
+ }
+
+ // Eine verbale Beschreibung der markierten Objekte z.B.:
+ // "27 Linien", "12 Objekte", "Polygon" oder auch "Kein Objekt"
+ const String& GetMarkDescription() const;
+ const String& GetPointMarkDescription() const
+ {
+ return GetPointMarkDescription(sal_False);
+ }
+
+ const String& GetGluePointMarkDescription() const
+ {
+ return GetPointMarkDescription(sal_True);
+ }
+
+ // pPage=0L: Die Markierungen aller! Seiten beruecksichtigen
+ sal_Bool TakeBoundRect(SdrPageView* pPageView, Rectangle& rRect) const;
+ sal_Bool TakeSnapRect(SdrPageView* pPageView, Rectangle& rRect) const;
+
+ // Es werden saemtliche Entries kopiert!
+ void operator=(const SdrMarkList& rLst);
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// migrate selections
+
+namespace sdr
+{
+ class SVX_DLLPUBLIC ViewSelection
+ {
+ SdrMarkList maMarkedObjectList;
+ SdrMarkList maEdgesOfMarkedNodes;
+ SdrMarkList maMarkedEdgesOfMarkedNodes;
+ std::vector<SdrObject*> maAllMarkedObjects;
+
+ // bitfield
+ unsigned 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<SdrObject*>& GetAllMarkedObjects() const;
+
+ SdrMarkList& GetMarkedObjectListWriteAccess()
+ {
+ return maMarkedObjectList;
+ }
+ };
+} // end of namespace sdr
+
+#endif //_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 000000000000..d57c992f3ace
--- /dev/null
+++ b/include/svx/svdmodel.hxx
@@ -0,0 +1,712 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDMODEL_HXX
+#define _SVDMODEL_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <sot/storage.hxx>
+#include <tools/link.hxx>
+#include <tools/weakbase.hxx>
+#include <vcl/mapmod.hxx>
+#include <svl/brdcst.hxx>
+#include <tools/string.hxx>
+#include <tools/datetime.hxx>
+#include <svl/hint.hxx>
+
+#include <svl/style.hxx>
+#include <svx/xtable.hxx>
+#include <svx/pageitem.hxx>
+#include <vcl/field.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+class OutputDevice;
+#include <svx/svdtypes.hxx> // fuer enum RepeatFuncts
+#include "svx/svxdllapi.h"
+
+#include <rtl/ref.hxx>
+#include <deque>
+
+#if defined(UNX) || defined(WNT)
+#define DEGREE_CHAR ((sal_Unicode)176) /* 0xB0 = Ansi */
+#endif
+
+#ifndef DEGREE_CHAR
+#error unbekannte Plattrorm
+#endif
+
+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 SotStorage;
+class SdrOutlinerCache;
+class SotStorageRef;
+class SdrUndoFactory;
+namespace comphelper
+{
+ class IEmbeddedHelper;
+ class LifecycleProxy;
+}
+namespace sfx2
+{
+ class LinkManager;
+}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define SDR_SWAPGRAPHICSMODE_NONE 0x00000000
+#define SDR_SWAPGRAPHICSMODE_TEMP 0x00000001
+#define SDR_SWAPGRAPHICSMODE_DOC 0x00000002
+#define SDR_SWAPGRAPHICSMODE_PURGE 0x00000100
+#define SDR_SWAPGRAPHICSMODE_DEFAULT (SDR_SWAPGRAPHICSMODE_TEMP|SDR_SWAPGRAPHICSMODE_DOC|SDR_SWAPGRAPHICSMODE_PURGE)
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+enum SdrHintKind
+{
+ HINT_UNKNOWN, // Unbekannt
+ HINT_LAYERCHG, // Layerdefinition geaendert
+ HINT_LAYERORDERCHG, // Layerreihenfolge geaendert (Insert/Remove/ChangePos)
+ HINT_PAGEORDERCHG, // Reihenfolge der Seiten (Zeichenseiten oder Masterpages) geaendert (Insert/Remove/ChangePos)
+ HINT_OBJCHG, // Objekt geaendert
+ HINT_OBJINSERTED, // Neues Zeichenobjekt eingefuegt
+ HINT_OBJREMOVED, // Zeichenobjekt aus Liste entfernt
+ HINT_MODELCLEARED, // gesamtes Model geloescht (keine Pages mehr da). not impl.
+ HINT_REFDEVICECHG, // RefDevice geaendert
+ HINT_DEFAULTTABCHG, // Default Tabulatorweite geaendert
+ HINT_DEFFONTHGTCHG, // Default FontHeight geaendert
+ HINT_MODELSAVED, // Dokument wurde gesichert
+ HINT_SWITCHTOPAGE, // #94278# UNDO/REDO at an object evtl. on another page
+ HINT_BEGEDIT, // Is called after the object has entered text edit mode
+ HINT_ENDEDIT // Is called after the object has left text edit mode
+};
+
+class SVX_DLLPUBLIC SdrHint: public SfxHint
+{
+public:
+ Rectangle maRectangle;
+ const SdrPage* mpPage;
+ const SdrObject* mpObj;
+ const SdrObjList* mpObjList;
+ SdrHintKind meHint;
+
+public:
+ TYPEINFO();
+
+ explicit SdrHint(SdrHintKind eNewHint);
+ explicit SdrHint(const SdrObject& rNewObj);
+
+ void SetPage(const SdrPage* pNewPage);
+ void SetObject(const SdrObject* pNewObj);
+ void SetKind(SdrHintKind eNewKind);
+
+ const SdrPage* GetPage() const;
+ const SdrObject* GetObject() const;
+ SdrHintKind GetKind() const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// Flag um nach dem Laden des Pools Aufzuraeumen (d.h. die RefCounts
+// neu zu bestimmen und unbenutztes wegzuwerfen). sal_False == aktiv
+#define LOADREFCOUNTS (false)
+
+struct SdrModelImpl;
+
+class SVX_DLLPUBLIC SdrModel : public SfxBroadcaster, public tools::WeakBase< SdrModel >
+{
+protected:
+ DateTime aReadDate; // Datum des Einstreamens
+ std::vector<SdrPage*> maMaPag; // StammSeiten (Masterpages)
+ std::vector<SdrPage*> maPages;
+ Link aUndoLink; // Link fuer einen NotifyUndo-Handler
+ Link aIOProgressLink;
+ String aTablePath;
+ Size aMaxObjSize; // z.B. fuer Autogrowing Text
+ Fraction aObjUnit; // Beschreibung der Koordinateneinheiten fuer ClipBoard, Drag&Drop, ...
+ MapUnit eObjUnit; // see above
+ FieldUnit eUIUnit; // Masseinheit, Masstab (z.B. 1/1000) fuer die UI (Statuszeile) wird von ImpSetUIUnit() gesetzt
+ Fraction aUIScale; // see above
+ String aUIUnitStr; // see above
+ Fraction aUIUnitFact; // see above
+ int nUIUnitKomma; // see above
+
+ SdrLayerAdmin* pLayerAdmin;
+ SfxItemPool* pItemPool;
+ comphelper::IEmbeddedHelper*
+ m_pEmbeddedHelper; // helper for embedded objects to get rid of the SfxObjectShell
+ SdrOutliner* pDrawOutliner; // ein Outliner zur Textausgabe
+ SdrOutliner* pHitTestOutliner;// ein Outliner fuer den HitTest
+ sal_uIntPtr nDefTextHgt; // Default Texthoehe in logischen Einheiten
+ OutputDevice* pRefOutDev; // ReferenzDevice fuer die EditEngine
+ sal_uIntPtr nProgressAkt; // fuer den
+ sal_uIntPtr nProgressMax; // ProgressBar-
+ sal_uIntPtr nProgressOfs; // -Handler
+ rtl::Reference< SfxStyleSheetBasePool > mxStyleSheetPool;
+ SfxStyleSheet* pDefaultStyleSheet;
+ SfxStyleSheet* mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj; // #i119287#
+ sfx2::LinkManager* pLinkManager; // LinkManager
+ std::deque<SfxUndoAction*>* pUndoStack;
+ std::deque<SfxUndoAction*>* pRedoStack;
+ SdrUndoGroup* pAktUndoGroup; // Fuer mehrstufige
+ sal_uInt16 nUndoLevel; // Undo-Klammerung
+ sal_uInt16 nProgressPercent; // fuer den ProgressBar-Handler
+ sal_uInt16 nLoadVersion; // Versionsnummer der geladenen Datei
+ bool bMyPool:1; // zum Aufraeumen von pMyPool ab 303a
+ bool bUIOnlyKomma:1; // see eUIUnit
+ bool mbUndoEnabled:1; // If false no undo is recorded or we are during the execution of an undo action
+ bool bExtColorTable:1; // Keinen eigenen ColorTable
+ bool mbChanged:1;
+ bool bInfoChanged:1;
+ bool bPagNumsDirty:1;
+ bool bMPgNumsDirty:1;
+ bool bPageNotValid:1; // TRUE=Doc ist nur ObjektTraeger. Page ist nicht gueltig.
+ bool bSavePortable:1; // Metafiles portabel speichern
+ bool bNoBitmapCaching:1; // Bitmaps fuer Screenoutput cachen
+ bool bReadOnly:1;
+ bool bTransparentTextFrames:1;
+ bool bSaveCompressed:1;
+ bool bSwapGraphics:1;
+ bool bPasteResize:1; // Objekte werden gerade resized wegen Paste mit anderem MapMode
+ bool bSaveOLEPreview:1; // save preview metafile of OLE objects
+ bool bSaveNative:1;
+ bool bStarDrawPreviewMode:1;
+ sal_uInt16 nStreamCompressMode; // Komprimiert schreiben?
+ sal_uInt16 nStreamNumberFormat;
+ sal_uInt16 nDefaultTabulator;
+ sal_uInt32 nMaxUndoCount;
+
+
+//////////////////////////////////////////////////////////////////////////////
+// sdr::Comment interface
+private:
+ // the next unique comment ID, used for counting added comments. Initialized
+ // to 0. UI shows one more due to the fact that 0 is a no-no for users.
+ sal_uInt32 mnUniqueCommentID;
+
+public:
+ // create a new, unique comment ID
+ sal_uInt32 GetNextUniqueCommentID();
+
+ // get the author name
+ OUString GetDocumentAuthorName() const;
+
+ // for export
+ sal_uInt32 GetUniqueCommentID() const { return mnUniqueCommentID; }
+
+ // for import
+ void SetUniqueCommentID(sal_uInt32 nNewID) { if(nNewID != mnUniqueCommentID) { mnUniqueCommentID = nNewID; } }
+
+ sal_uInt16 nStarDrawPreviewMasterPageNum;
+ SvxForbiddenCharactersTable* mpForbiddenCharactersTable;
+ sal_uIntPtr nSwapGraphicsMode;
+
+ SdrOutlinerCache* mpOutlinerCache;
+ SdrModelImpl* mpImpl;
+ sal_uInt16 mnCharCompressType;
+ sal_uInt16 mnHandoutPageCount;
+ sal_uInt16 nReserveUInt6;
+ sal_uInt16 nReserveUInt7;
+ bool mbModelLocked;
+ bool mbKernAsianPunctuation;
+ bool mbAddExtLeading;
+ bool mbInDestruction;
+
+ // Color, Dash, Line-End, Hatch, Gradient, Bitmap property lists ...
+ XPropertyListRef maProperties[XPROPERTY_LIST_COUNT];
+
+ // New src638: NumberFormatter for drawing layer and
+ // method for getting it. It is constructed on demand
+ // and destroyed when destroying the SdrModel.
+ SvNumberFormatter* mpNumberFormatter;
+public:
+ sal_uInt16 getHandoutPageCount() const { return mnHandoutPageCount; }
+ void setHandoutPageCount( sal_uInt16 nHandoutPageCount ) { mnHandoutPageCount = nHandoutPageCount; }
+
+protected:
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
+
+private:
+ // Nicht implementiert:
+ SVX_DLLPRIVATE SdrModel(const SdrModel& rSrcModel);
+ SVX_DLLPRIVATE void operator=(const SdrModel& rSrcModel);
+ SVX_DLLPRIVATE bool operator==(const SdrModel& rCmpModel) const;
+ SVX_DLLPRIVATE void ImpPostUndoAction(SdrUndoAction* pUndo);
+ SVX_DLLPRIVATE void ImpSetUIUnit();
+ SVX_DLLPRIVATE void ImpSetOutlinerDefaults( SdrOutliner* pOutliner, sal_Bool bInit = sal_False );
+ SVX_DLLPRIVATE void ImpReformatAllTextObjects();
+ SVX_DLLPRIVATE void ImpReformatAllEdgeObjects(); // #103122#
+ SVX_DLLPRIVATE void ImpCreateTables();
+ SVX_DLLPRIVATE void ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable,
+ bool bLoadRefCounts = true);
+
+
+ // this is a weak reference to a possible living api wrapper for this model
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoModel;
+
+public:
+ bool IsPasteResize() const { return bPasteResize; }
+ void SetPasteResize(bool bOn) { bPasteResize=bOn; }
+ TYPEINFO();
+ // Steckt man hier seinen eigenen Pool rein, so wird die Klasse auch
+ // Aktionen an ihm vornehmen (Put(),Remove()). Bei Zerstoerung von
+ // SdrModel wird dieser Pool ver delete geloescht!
+ // Gibt man den Konstruktor stattdessen eine NULL mit, so macht sich
+ // die Klasse einen eigenen Pool (SdrItemPool), den sie dann auch im
+ // Destruktor zerstoert.
+ // Bei Verwendung eines eigenen Pools ist darauf zu achten, dass dieser
+ // von SdrItemPool abgeleitet ist, falls man von SdrAttrObj abgeleitete
+ // Zeichenobjekte verwenden moechte. Setzt man degegen nur vom abstrakten
+ // Basisobjekt SdrObject abgeleitete Objekte ein, so ist man frei in der
+ // Wahl des Pools.
+ explicit SdrModel(SfxItemPool* pPool=NULL, ::comphelper::IEmbeddedHelper* pPers=NULL, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
+ explicit SdrModel(const String& rPath, SfxItemPool* pPool=NULL, ::comphelper::IEmbeddedHelper* pPers=NULL, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
+ SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
+ SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
+ virtual ~SdrModel();
+ void ClearModel(sal_Bool bCalledFromDestructor);
+
+ // Hier kann man erfragen, ob das Model gerade eingrstreamt wird
+ bool IsLoading() const { return sal_False /*BFS01 bLoading */; }
+ // Muss z.B. ueberladen werden, um das Swappen/LoadOnDemand von Grafiken
+ // zu ermoeglichen. Wird rbDeleteAfterUse auf sal_True gesetzt, so wird
+ // die SvStream-Instanz vom Aufrufer nach Gebrauch destruiert.
+ // Wenn diese Methode NULL liefert, wird zum Swappen eine temporaere
+ // Datei angelegt.
+ // Geliefert werden muss der Stream, aus dem das Model geladen wurde
+ // bzw. in den es zuletzt gespeichert wurde.
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::embed::XStorage> GetDocumentStorage() const;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream >
+ GetDocumentStream(OUString const& rURL,
+ ::comphelper::LifecycleProxy & rProxy) const;
+ // Die Vorlagenattribute der Zeichenobjekte in harte Attribute verwandeln.
+ void BurnInStyleSheetAttributes();
+ // Wer sich von SdrPage ableitet muss sich auch von SdrModel ableiten
+ // und diese beiden VM AllocPage() und AllocModel() ueberladen...
+ virtual SdrPage* AllocPage(bool bMasterPage);
+ virtual SdrModel* AllocModel() const;
+
+ // Aenderungen an den Layern setzen das Modified-Flag und broadcasten am Model!
+ const SdrLayerAdmin& GetLayerAdmin() const { return *pLayerAdmin; }
+ SdrLayerAdmin& GetLayerAdmin() { return *pLayerAdmin; }
+
+ const SfxItemPool& GetItemPool() const { return *pItemPool; }
+ SfxItemPool& GetItemPool() { return *pItemPool; }
+
+ SdrOutliner& GetDrawOutliner(const SdrTextObj* pObj=NULL) const;
+
+ SdrOutliner& GetHitTestOutliner() const { return *pHitTestOutliner; }
+ const SdrTextObj* GetFormattingTextObj() const;
+ // Die TextDefaults (Font,Hoehe,Farbe) in ein Set putten
+ void SetTextDefaults() const;
+ static void SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt );
+
+ // ReferenzDevice fuer die EditEngine
+ void SetRefDevice(OutputDevice* pDev);
+ OutputDevice* GetRefDevice() const { return pRefOutDev; }
+ // Wenn ein neuer MapMode am RefDevice gesetzt wird o.ae.
+ void RefDeviceChanged(); // noch nicht implementiert
+ // Default-Schrifthoehe in logischen Einheiten
+ void SetDefaultFontHeight(sal_uIntPtr nVal);
+ sal_uIntPtr GetDefaultFontHeight() const { return nDefTextHgt; }
+ // Default-Tabulatorweite fuer die EditEngine
+ void SetDefaultTabulator(sal_uInt16 nVal);
+ sal_uInt16 GetDefaultTabulator() const { return nDefaultTabulator; }
+
+ // Der DefaultStyleSheet wird jedem Zeichenobjekt verbraten das in diesem
+ // Model eingefuegt wird und kein StyleSheet gesetzt hat.
+ SfxStyleSheet* GetDefaultStyleSheet() const { return pDefaultStyleSheet; }
+ void SetDefaultStyleSheet(SfxStyleSheet* pDefSS) { pDefaultStyleSheet = pDefSS; }
+
+ // #i119287# default StyleSheet for SdrGrafObj and SdrOle2Obj
+ SfxStyleSheet* GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj() const { return mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj; }
+ void SetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(SfxStyleSheet* pDefSS) { mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj = pDefSS; }
+
+ sfx2::LinkManager* GetLinkManager() { return pLinkManager; }
+ void SetLinkManager( sfx2::LinkManager* pLinkMgr ) { pLinkManager = pLinkMgr; }
+
+ ::comphelper::IEmbeddedHelper* GetPersist() const { return m_pEmbeddedHelper; }
+ void ClearPersist() { m_pEmbeddedHelper = 0; }
+ void SetPersist( ::comphelper::IEmbeddedHelper *p ) { m_pEmbeddedHelper = p; }
+
+ // Masseinheit fuer die Zeichenkoordinaten.
+ // Default ist 1 logische Einheit = 1/100mm (Unit=MAP_100TH_MM, Fract=(1,1)).
+ // Beispiele:
+ // MAP_POINT, Fraction(72,1) : 1 log Einh = 72 Point = 1 Inch
+ // MAP_POINT, Fraction(1,20) : 1 log Einh = 1/20 Point = 1 Twip
+ // MAP_TWIP, Fraction(1,1) : 1 log Einh = 1 Twip
+ // MAP_100TH_MM, Fraction(1,10) : 1 log Einh = 1/1000mm
+ // MAP_MM, Fraction(1000,1) : 1 log Einh = 1000mm = 1m
+ // MAP_CM, Fraction(100,1) : 1 log Einh = 100cm = 1m
+ // MAP_CM, Fraction(100000,1): 1 log Einh = 100000cm = 1km
+ // (PS: Lichtjahre sind somit also nicht darstellbar).
+ // Die Skalierungseinheit wird benoetigt, damit die Engine das Clipboard
+ // mit den richtigen Groessen beliefern kann.
+ MapUnit GetScaleUnit() const { return eObjUnit; }
+ void SetScaleUnit(MapUnit eMap);
+ const Fraction& GetScaleFraction() const { return aObjUnit; }
+ void SetScaleFraction(const Fraction& rFrac);
+ // Beides gleichzeitig setzen ist etwas performanter
+ void SetScaleUnit(MapUnit eMap, const Fraction& rFrac);
+
+ // Maximale Groesse z.B. fuer Autogrowing-Texte
+ const Size& GetMaxObjSize() const { return aMaxObjSize; }
+ void SetMaxObjSize(const Size& rSiz) { aMaxObjSize=rSiz; }
+
+ // Damit die View! in der Statuszeile vernuenftige Zahlen anzeigen kann:
+ // Default ist mm.
+ void SetUIUnit(FieldUnit eUnit);
+ FieldUnit GetUIUnit() const { return eUIUnit; }
+ // Der Masstab der Zeichnung. Default 1/1.
+ void SetUIScale(const Fraction& rScale);
+ const Fraction& GetUIScale() const { return aUIScale; }
+ // Beides gleichzeitig setzen ist etwas performanter
+ void SetUIUnit(FieldUnit eUnit, const Fraction& rScale);
+
+ const Fraction& GetUIUnitFact() const { return aUIUnitFact; }
+ const String& GetUIUnitStr() const { return aUIUnitStr; }
+ int GetUIUnitKomma() const { return nUIUnitKomma; }
+ bool IsUIOnlyKomma() const { return bUIOnlyKomma; }
+
+ static void TakeUnitStr(FieldUnit eUnit, String& rStr);
+ void TakeMetricStr(long nVal, OUString& rStr, bool bNoUnitChars = false, sal_Int32 nNumDigits = -1) const;
+ void TakeWinkStr(long nWink, OUString& rStr, bool bNoDegChar = false) const;
+ void TakePercentStr(const Fraction& rVal, String& rStr, bool bNoPercentChar = false) const;
+
+ // RecalcPageNums wird idR. nur von der Page gerufen.
+ bool IsPagNumsDirty() const { return bPagNumsDirty; };
+ bool IsMPgNumsDirty() const { return bMPgNumsDirty; };
+ void RecalcPageNums(bool bMaster);
+ // Nach dem Insert gehoert die Page dem SdrModel.
+ virtual void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
+ virtual void DeletePage(sal_uInt16 nPgNum);
+ // Remove bedeutet Eigentumsuebereignung an den Aufrufer (Gegenteil von 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;
+ // #109538#
+ virtual void PageListChanged();
+
+ // Masterpages
+ virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
+ virtual void DeleteMasterPage(sal_uInt16 nPgNum);
+ // Remove bedeutet Eigentumsuebereignung an den Aufrufer (Gegenteil von Insert)
+ virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum);
+ virtual void MoveMasterPage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
+ const SdrPage* GetMasterPage(sal_uInt16 nPgNum) const;
+ SdrPage* GetMasterPage(sal_uInt16 nPgNum);
+ sal_uInt16 GetMasterPageCount() const;
+ // #109538#
+ virtual void MasterPageListChanged();
+
+ // Modified-Flag. Wird automatisch gesetzt, wenn an den Pages oder
+ // Zeichenobjekten was geaendert wird. Zuruecksetzen muss man es
+ // jedoch selbst (z.B. bei Save() ...).
+ sal_Bool IsChanged() const { return mbChanged; }
+ virtual void SetChanged(sal_Bool bFlg = sal_True);
+
+ // PageNotValid bedeutet, dass das Model lediglich Objekte traegt die zwar
+ // auf einer Page verankert sind, die Page aber nicht gueltig ist. Diese
+ // Kennzeichnung wird fuers Clipboard/Drag&Drop benoetigt.
+ bool IsPageNotValid() const { return bPageNotValid; }
+ void SetPageNotValid(bool bJa = true) { bPageNotValid=bJa; }
+
+ // Schaltet man dieses Flag auf sal_True, so werden Grafikobjekte
+ // portabel gespeichert. Es findet dann beim Speichern ggf.
+ // eine implizite Wandlung von Metafiles statt.
+ // Default=FALSE. Flag ist nicht persistent.
+ bool IsSavePortable() const { return bSavePortable; }
+ void SetSavePortable(bool bJa = true) { bSavePortable=bJa; }
+
+ // Schaltet man dieses Flag auf sal_True, so werden
+ // Pixelobjekte (stark) komprimiert gespeichert.
+ // Default=FALSE. Flag ist nicht persistent.
+ bool IsSaveCompressed() const { return bSaveCompressed; }
+ void SetSaveCompressed(bool bJa = true) { bSaveCompressed=bJa; }
+
+ // Schaltet man dieses Flag auf sal_True, so werden
+ // Grafikobjekte mit gesetztem Native-Link
+ // native gespeichert.
+ // Default=FALSE. Flag ist nicht persistent.
+ bool IsSaveNative() const { return bSaveNative; }
+ void SetSaveNative(bool bJa = true) { bSaveNative=bJa; }
+
+ // Schaltet man dieses Flag auf sal_True, so werden die Grafiken
+ // von Grafikobjekten:
+ // - beim Laden eines Dokuments nicht sofort mitgeladen,
+ // sondern erst wenn sie gebraucht (z.B. angezeigt) werden.
+ // - ggf. wieder aus dem Speicher geworfen, falls Sie gerade
+ // nicht benoetigt werden.
+ // Damit das funktioniert, muss die virtuelle Methode
+ // GetDocumentStream() ueberladen werden.
+ // Default=FALSE. Flag ist nicht persistent.
+ bool IsSwapGraphics() const { return bSwapGraphics; }
+ void SetSwapGraphics(bool bJa = true);
+ void SetSwapGraphicsMode(sal_uIntPtr nMode) { nSwapGraphicsMode = nMode; }
+ sal_uIntPtr GetSwapGraphicsMode() const { return nSwapGraphicsMode; }
+
+ bool IsSaveOLEPreview() const { return bSaveOLEPreview; }
+ void SetSaveOLEPreview( bool bSet) { bSaveOLEPreview = bSet; }
+
+ // Damit die Bildschirmausgabe von Bitmaps (insbesondere bei gedrehten)
+ // etwas schneller wird, werden sie gecachet. Diesen Cache kann man mit
+ // diesem Flag ein-/ausschalten. Beim naechsten Paint wird an den Objekten
+ // dann ggf. ein Image gemerkt bzw. freigegeben. Wandert ein Bitmapobjekt
+ // in's Undo, so wird der Cache fuer dieses Objekt sofort ausgeschaltet
+ // (Speicher sparen).
+ // Default=Cache eingeschaltet. Flag ist nicht persistent.
+ bool IsBitmapCaching() const { return !bNoBitmapCaching; }
+ void SetBitmapCaching(bool bJa = true) { bNoBitmapCaching=!bJa; }
+
+ // Defaultmaessig (sal_False) kann man Textrahmen ohne Fuellung durch
+ // Mausklick selektieren. Nach Aktivierung dieses Flags trifft man sie
+ // nur noch in dem Bereich, wo sich auch tatsaechlich Text befindet.
+ bool IsPickThroughTransparentTextFrames() const { return bTransparentTextFrames; }
+ void SetPickThroughTransparentTextFrames(bool bOn) { bTransparentTextFrames=bOn; }
+
+ // Darf denn das Model ueberhaupt veraendert werden?
+ // Wird nur von den Possibility-Methoden der View ausgewerdet.
+ // Direkte Manipulationen am Model, ... berueksichtigen dieses Flag nicht.
+ // Sollte ueberladen werden und entsprechend des ReadOnly-Status des Files
+ // sal_True oder sal_False liefern (Methode wird oeffters gerufen, also ein Flag
+ // verwenden!).
+ virtual bool IsReadOnly() const;
+ virtual void SetReadOnly(bool bYes);
+
+ // Vermischen zweier SdrModel. Zu beachten sei, dass rSourceModel nicht
+ // const ist. Die Pages werden beim einfuegen nicht kopiert, sondern gemoved.
+ // rSourceModel ist anschliessend u.U. weitgehend leer.
+ // nFirstPageNum,nLastPageNum: Die aus rSourceModel zu uebernehmenden Seiten
+ // nDestPos..................: Einfuegeposition
+ // bMergeMasterPages.........: sal_True =benoetigte MasterPages werden aus
+ // rSourceModel ebenfalls uebernommen
+ // sal_False=Die MasterPageDescriptoren der Seiten
+ // aus rSourceModel werden auf die
+ // vorhandenen MasterPages gemappt.
+ // bUndo.....................: Fuer das Merging wird eine UndoAction generiert.
+ // Undo ist nur fuer das ZielModel, nicht fuer
+ // rSourceModel.
+ // bTreadSourceAsConst.......: sal_True=Das SourceModel wird nicht veraendert,.
+ // d.h die Seiten werden kopiert.
+ virtual void Merge(SdrModel& rSourceModel,
+ sal_uInt16 nFirstPageNum=0, sal_uInt16 nLastPageNum=0xFFFF,
+ sal_uInt16 nDestPos=0xFFFF,
+ bool bMergeMasterPages = false, bool bAllMasterPages = false,
+ bool bUndo = true, bool bTreadSourceAsConst = false);
+
+ // Ist wie 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 = true, bool bMoveNoCopy = false);
+
+ // Mit BegUndo() / EndUndo() ist es moeglich beliebig viele UndoActions
+ // beliebig tief zu klammern. Als Kommentar der
+ // UndoAction wird der des ersten BegUndo(String) aller Klammerungen
+ // verwendet. Der NotifyUndoActionHdl wird in diesem Fall erst beim letzten
+ // EndUndo() gerufen. Bei einer leeren Klammerung wird keine UndoAction
+ // generiert.
+ // Alle direkten Aktionen am SdrModel erzeugen keine UndoActions, die
+ // Aktionen an der SdrView dagegen generieren solche.
+ void BegUndo(); // Undo-Klammerung auf
+ void BegUndo(const String& rComment); // Undo-Klammerung auf
+ void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE); // Undo-Klammerung auf
+ void EndUndo(); // Undo-Klammerung zu
+ void AddUndo(SdrUndoAction* pUndo);
+ sal_uInt16 GetUndoBracketLevel() const { return nUndoLevel; }
+ const SdrUndoGroup* GetAktUndoGroup() const { return pAktUndoGroup; }
+ // nur nach dem 1. BegUndo oder vor dem letzten EndUndo:
+ void SetUndoComment(const String& rComment);
+ void SetUndoComment(const String& rComment, const String& rObjDescr);
+
+ // Das Undo-Management findet nur statt, wenn kein NotifyUndoAction-Handler
+ // gesetzt ist.
+ // Default ist 16. Minimaler MaxUndoActionCount ist 1!
+ void SetMaxUndoActionCount(sal_uIntPtr nAnz);
+ sal_uIntPtr GetMaxUndoActionCount() const { return nMaxUndoCount; }
+ void ClearUndoBuffer();
+
+ bool HasUndoActions() const;
+ bool HasRedoActions() const;
+ bool Undo();
+ bool Redo();
+ bool Repeat(SfxRepeatTarget&);
+
+ // Hier kann die Applikation einen Handler setzen, der die auflaufenden
+ // UndoActions einsammelt. Der Handler hat folgendes Aussehen:
+ // void NotifyUndoActionHdl(SfxUndoAction* pUndoAction);
+ // Beim Aufruf des Handlers findet eine Eigentumsuebereignung statt; die
+ // UndoAction gehoert somit dem Handler, nicht mehr dem SdrModel.
+ void SetNotifyUndoActionHdl(const Link& rLink) { aUndoLink=rLink; }
+ const Link& GetNotifyUndoActionHdl() const { return aUndoLink; }
+
+ /** application can set it's own undo manager, BegUndo, EndUndo and AddUndoAction
+ calls are routet to this interface if given */
+ void SetSdrUndoManager( SfxUndoManager* pUndoManager );
+ SfxUndoManager* GetSdrUndoManager() const;
+
+ /** applications can set their own undo factory to overide 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;
+
+ // Hier kann man einen Handler setzen der beim Streamen mehrfach gerufen
+ // wird und ungefaehre Auskunft ueber den Fortschreitungszustand der
+ // Funktion gibt. Der Handler muss folgendes Aussehen haben:
+ // void class::IOProgressHdl(const USHORT& nPercent);
+ // Der erste Aufruf des Handlers erfolgt grundsaetzlich mit 0, der letzte
+ // mit 100. Dazwischen erfolgen maximal 99 Aufrufe mit Werten 1...99.
+ // Man kann also durchaus bei 0 den Progressbar Initiallisieren und bei
+ // 100 wieder schliessen. Zu beachten sei, dass der Handler auch gerufen
+ // wird, wenn die App Draw-Daten im officeweiten Draw-Exchange-Format
+ // bereitstellt, denn dies geschieht durch streamen in einen MemoryStream.
+ void SetIOProgressHdl(const Link& rLink) { aIOProgressLink=rLink; }
+ const Link& GetIOProgressHdl() const { return aIOProgressLink; }
+
+ // Accessor methods for Palettes, Lists and Tabeles
+ // FIXME: this badly needs re-factoring ...
+ XPropertyListRef GetPropertyList( XPropertyListType t ) const { return maProperties[ t ]; }
+ void SetPropertyList( XPropertyListRef p ) { maProperties[ p->Type() ] = p; }
+
+ // friendlier helpers
+ XDashListRef GetDashList() const { return GetPropertyList( XDASH_LIST )->AsDashList(); }
+ XHatchListRef GetHatchList() const { return GetPropertyList( XHATCH_LIST )->AsHatchList(); }
+ XColorListRef GetColorList() const { return GetPropertyList( XCOLOR_LIST )->AsColorList(); }
+ XBitmapListRef GetBitmapList() const { return GetPropertyList( XBITMAP_LIST )->AsBitmapList(); }
+ XLineEndListRef GetLineEndList() const { return GetPropertyList( XLINE_END_LIST )->AsLineEndList(); }
+ XGradientListRef GetGradientList() const { return GetPropertyList( XGRADIENT_LIST )->AsGradientList(); }
+
+ // Der StyleSheetPool wird der DrawingEngine nur bekanntgemacht.
+ // Zu loeschen hat ihn schliesslich der, der ihn auch konstruiert hat.
+ SfxStyleSheetBasePool* GetStyleSheetPool() const { return mxStyleSheetPool.get(); }
+ void SetStyleSheetPool(SfxStyleSheetBasePool* pPool) { mxStyleSheetPool=pPool; }
+
+ void SetStarDrawPreviewMode(sal_Bool bPreview);
+ sal_Bool IsStarDrawPreviewMode() { return bStarDrawPreviewMode; }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoModel();
+ void setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::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( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars );
+ rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharsTable() const;
+
+ void SetCharCompressType( sal_uInt16 nType );
+ sal_uInt16 GetCharCompressType() const { return mnCharCompressType; }
+
+ void SetKernAsianPunctuation( sal_Bool bEnabled );
+ sal_Bool IsKernAsianPunctuation() const { return (sal_Bool)mbKernAsianPunctuation; }
+
+ void SetAddExtLeading( sal_Bool bEnabled );
+ sal_Bool IsAddExtLeading() const { return (sal_Bool)mbAddExtLeading; }
+
+ void ReformatAllTextObjects();
+
+ SdrOutliner* createOutliner( sal_uInt16 nOutlinerMode );
+ void disposeOutliner( SdrOutliner* pOutliner );
+
+ sal_Bool IsWriter() const { return !bMyPool; }
+
+ /** 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. If pNewModel is optional. If it is null,
+ this model is used. */
+
+ void MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSet, SdrModel* pNewModel );
+
+ bool IsInDestruction() const;
+
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelImplementationId();
+
+ /** 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;
+
+ void SetDrawingLayerPoolDefaults();
+};
+
+typedef tools::WeakReference< SdrModel > SdrModelWeakRef;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_SVDMODEL_HXX
+
+/* /////////////////////////////////////////////////////////////////////////////////////////////////
+ +-----------+
+ | SdrModel |
+ +--+------+-+
+ | +-----------+
+ +----+-----+ |
+ | ... | |
+ +----+---+ +----+---+ +-----+--------+
+ |SdrPage | |SdrPage | |SdrLayerAdmin |
+ +---+----+ +-+--+--++ +---+-------+--+
+ | | | | | +-------------------+
+ +----+----+ +-----+-----+ +-------+-------+
+ | ... | | ... | | ... |
++---+---+ +---+---+ +----+----+ +----+----+ +-----+------+ +------+-----+
+|SdrObj | |SdrObj | |SdrLayer | |SdrLayer | |SdrLayerSet | |SdrLayerSet |
++-------+ +-------+ +---------+ +---------+ +------------+ +------------+
+This class: SdrModel is the head of the data modells 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 000000000000..133a438bd58f
--- /dev/null
+++ b/include/svx/svdmrkv.hxx
@@ -0,0 +1,500 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDMRKV_HXX
+#define _SVDMRKV_HXX
+
+#include <svx/svdmark.hxx>
+#include <svx/svdhdl.hxx>
+#include <svx/svdsnpv.hxx>
+#include <svx/svdtypes.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Defines
+//************************************************************
+
+// folgendes ist noch nicht bzw. erst zum Teil implementiert:
+#define SDRSEARCH_DEEP 0x0001 /* rekursiv in Gruppenobjekte hinein */
+#define SDRSEARCH_ALSOONMASTER 0x0002 /* MasterPages werden auch durchsucht */
+#define SDRSEARCH_WHOLEPAGE 0x0004 /* Nicht nur die ObjList der PageView */
+#define SDRSEARCH_TESTMARKABLE 0x0008 /* nur markierbare Objekte/Punkte/Handles/... */
+#define SDRSEARCH_TESTMACRO 0x0010 /* Nur Objekte mit Macro */
+#define SDRSEARCH_TESTTEXTEDIT 0x0020 /* Nur TextEdit-faehige Objekte */
+#define SDRSEARCH_WITHTEXT 0x0040 /* Nur Objekte mit Text */
+#define SDRSEARCH_TESTTEXTAREA 0x0080 /* Den Textbereich von Objekten mit Text (TextEditHit) */
+#define SDRSEARCH_BACKWARD 0x0100 /* Rueckwaertssuche */
+#define SDRSEARCH_NEXT 0x0200 /* Suche startet hinter dem uebergebenen Objekt/Punkt/... */
+#define SDRSEARCH_MARKED 0x0400 /* Nur markierte Objekte/Punkte/... */
+#define SDRSEARCH_PASS2BOUND 0x0800 /* Wenn nix gefunden, dann neuer 2. Versuch mit BoundRectHit */
+#define SDRSEARCH_PASS3NEAREST 0x1000 /* Wenn nix gefunden, dann neuer 3. Versuch mit NearestBoundRectHit */
+#define SDRSEARCH_BEFOREMARK 0x2000 /* if one marked one found, ignore all behind that */
+
+#define SDRSEARCH_PICKMARKABLE (SDRSEARCH_TESTMARKABLE)
+#define SDRSEARCH_PICKTEXTEDIT (SDRSEARCH_DEEP|SDRSEARCH_TESTMARKABLE|SDRSEARCH_TESTTEXTEDIT)
+#define SDRSEARCH_PICKMACRO (SDRSEARCH_DEEP|SDRSEARCH_ALSOONMASTER|SDRSEARCH_WHOLEPAGE|SDRSEARCH_TESTMACRO)
+
+// SDRSEARCHPASS_... ist Rueckgabeparameterwert bei PickObj().
+#define SDRSEARCHPASS_DIRECT 0x0000 /* Objekt durch direkten Hit getroffen */
+#define SDRSEARCHPASS_INACTIVELIST 0x0001 /* Obj auf der Page, nicht jedoch in der AktGroup (bei WHOLEPAGE) */
+#define SDRSEARCHPASS_MASTERPAGE 0x0002 /* Objekt auf der MasterPage gefunden */
+#define SDRSEARCHPASS_BOUND 0x0010 /* Objekt erst beim Bound-Check gefunden */
+#define SDRSEARCHPASS_NEAREST 0x0020 /* Objekt erst beim Nearest-Check gefunden */
+
+enum SdrHitKind {SDRHIT_NONE, // Nicht getroffen, Schnaps gesoffen
+ SDRHIT_OBJECT, // Treffer versenkt
+ SDRHIT_BOUNDRECT, // Treffer am BoundRect
+ SDRHIT_BOUNDTL, // Treffer am BoundRect TopLeft
+ SDRHIT_BOUNDTC, // Treffer am BoundRect TopCenter
+ SDRHIT_BOUNDTR, // Treffer am BoundRect TopRight
+ SDRHIT_BOUNDCL, // Treffer am BoundRect CenterLeft
+ SDRHIT_BOUNDCR, // Treffer am BoundRect CenterRight
+ SDRHIT_BOUNDBL, // Treffer am BoundRect BottomLeft
+ SDRHIT_BOUNDBC, // Treffer am BoundRect BottomCenter
+ SDRHIT_BOUNDBR,/*,*/ // Treffer am BoundRect BottomRight
+ /*SDRHIT_REFPOINT*/ // Referenzpunkt (Rotationsachse,Spiegelachse) getroffen
+ // ab hier neu am 01-07-1996:
+ SDRHIT_HANDLE, // Markierungshandle
+ SDRHIT_HELPLINE, // Hilfslinie
+ SDRHIT_GLUEPOINT, // Klebepunkt
+ SDRHIT_TEXTEDIT, // Offene OutlinerView getroffen
+ SDRHIT_TEXTEDITOBJ, // Objekt fuer SdrBeginTextEdit (Textbereich)
+ SDRHIT_URLFIELD, // Feld im TextObj getroffen (wird gerade nicht editiert)
+ SDRHIT_MACRO, // Objekt fuer BegMacroObj
+ SDRHIT_MARKEDOBJECT, // Markiertes Objekt (z.B. zum Draggen)
+ SDRHIT_UNMARKEDOBJECT, // nichtmarkiertes Objekt (z.B. zum markieren)
+ SDRHIT_CELL}; // hit on a cell inside a table shape (outside of the cells text area)
+
+enum SdrViewEditMode {SDREDITMODE_EDIT, // Auch bekannt aus Pfeil- oder Zeigermodus
+ SDREDITMODE_CREATE, // Objekterzeugungswerkzeug
+ SDREDITMODE_GLUEPOINTEDIT}; // Klebepunkteditiermodus
+
+#define IMPSDR_MARKOBJDESCRIPTION 0x0000
+#define IMPSDR_POINTSDESCRIPTION 0x0001
+#define IMPSDR_GLUEPOINTSDESCRIPTION 0x0002
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@ @@ @@@@ @@@@@ @@ @@ @@ @@ @@ @@@@@ @@ @@
+// @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
+// @@@@@@@ @@@@@@ @@@@@ @@@@ @@@@@ @@ @@@@ @@@@@@@
+// @@ @ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @ @@ @@@@@ @@ @@
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+class ImplMarkingOverlay;
+
+class SVX_DLLPUBLIC SdrMarkView : public SdrSnapView
+{
+ friend class SdrPageView;
+
+ // #114409#-3 Migrate selections
+ ImplMarkingOverlay* mpMarkObjOverlay;
+ ImplMarkingOverlay* mpMarkPointsOverlay;
+ ImplMarkingOverlay* mpMarkGluePointsOverlay;
+
+protected:
+ SdrObject* pMarkedObj; // Wenn nur ein Objekt markiert ist.
+ SdrPageView* pMarkedPV; // Wenn alle markierten Objekt auf derselben PageView liegen.
+
+ Point aRef1; // Persistent - Drehmittelpunkt/Spiegelachse
+ Point aRef2; // Persistent
+ Point aLastCrookCenter; // Persistent
+ SdrHdlList aHdl;
+ sdr::ViewSelection* mpSdrViewSelection;
+
+ Rectangle aMarkedObjRect;
+ Rectangle aMarkedObjRectNoOffset;
+ Rectangle aMarkedPointsRect;
+ Rectangle aMarkedGluePointsRect;
+
+ sal_uInt16 nFrameHandlesLimit;
+ sal_uIntPtr mnInsPointNum; // Nummer des InsPoint
+ sal_uIntPtr nMarkableObjCount;
+
+ SdrDragMode eDragMode; // Persistent
+ SdrViewEditMode eEditMode; // Persistent
+ SdrViewEditMode eEditMode0; // Persistent
+
+ //HMHunsigned bHdlShown : 1;
+ unsigned bRefHdlShownOnly : 1; // Spiegelachse waerend Dragging (ni)
+ unsigned bDesignMode : 1; // DesignMode fuer SdrUnoObj
+ unsigned bForceFrameHandles : 1; // Persistent - FrameDrag auch bei Einzelobjekten
+ unsigned bPlusHdlAlways : 1; // Persistent
+ unsigned bMarkHdlWhenTextEdit : 1; // Persistent, default=FALSE
+ unsigned bInsPolyPoint : 1; // z.Zt InsPolyPointDragging
+ unsigned bMarkedObjRectDirty : 1;
+ unsigned bMrkPntDirty : 1;
+ unsigned bMarkedPointsRectsDirty : 1;
+ unsigned bMarkableObjCountDirty : 1;
+
+ // flag to completely disable handles at the view
+ unsigned mbMarkHandlesHidden : 1;
+
+private:
+ SVX_DLLPRIVATE void ImpClearVars();
+ SVX_DLLPRIVATE void ImpSetPointsRects() const;
+ void UndirtyMrkPnt() const;
+
+protected:
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+ virtual void ModelHasChanged(); // Wird von der PaintView gerufen
+ virtual void SetMarkHandles(); // aHdl (Liste der Handles) fuellen
+ virtual void SetMarkRects(); // Rects an den PageViews
+ virtual void CheckMarked(); // MarkList nach Del und Lock Layer durchsuchen...
+ virtual void AddDragModeHdl(SdrDragMode eMode);
+ virtual sal_Bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
+
+ // add custom handles (used by other apps, e.g. AnchorPos)
+ virtual void AddCustomHdl();
+
+ void ForceRefToMarked();
+ void ForceUndirtyMrkPnt() const { if (bMrkPntDirty) UndirtyMrkPnt(); }
+
+ //HMHvoid ImpShowMarkHdl(bool bNoRefHdl);
+ virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay) const;
+ virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const;
+ virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj,const SdrMarkList * pMarkList) const;
+ sal_Bool ImpIsFrameHandles() const;
+ void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 nVal=0, sal_uInt16 nOpt=0) const;
+
+ // Macht aus einer Winkelangabe in 1/100deg einen String inkl. Grad-Zeichen
+ sal_Bool ImpMarkPoint(SdrHdl* pHdl, SdrMark* pMark, sal_Bool bUnmark);
+ virtual sal_Bool MarkPoints(const Rectangle* pRect, sal_Bool bUnmark);
+ sal_Bool MarkGluePoints(const Rectangle* pRect, sal_Bool bUnmark);
+
+ void SetMoveOutside(sal_Bool bOn);
+
+protected:
+ // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
+ SdrMarkView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ virtual ~SdrMarkView();
+
+public:
+ virtual sal_Bool IsAction() const;
+ virtual void MovAction(const Point& rPnt);
+ virtual void EndAction();
+ virtual void BckAction();
+ virtual void BrkAction();
+ virtual void TakeActionRect(Rectangle& rRect) const;
+
+ virtual void ClearPageView();
+ virtual void HideSdrPage();
+ virtual sal_Bool IsObjMarkable(SdrObject* pObj, SdrPageView* pPV) const;
+
+ // Liefert sal_True wenn Objekte, Punkte oder Klebepunkte durch Rahmenaufziehen
+ // selektiert werden (solange wie der Rahmen aufgezogen wird).
+ sal_Bool IsMarking() const { return IsMarkObj() || IsMarkPoints() || IsMarkGluePoints(); }
+
+ // Objekte durch Aufziehen eines Selektionsrahmens markieren
+ sal_Bool BegMarkObj(const Point& rPnt, sal_Bool bUnmark = sal_False);
+ void MovMarkObj(const Point& rPnt);
+ sal_Bool EndMarkObj();
+ void BrkMarkObj();
+ sal_Bool IsMarkObj() const { return (0L != mpMarkObjOverlay); }
+
+ // DragModes: SDRDRAG_CREATE,SDRDRAG_MOVE,SDRDRAG_RESIZE,SDRDRAG_ROTATE,SDRDRAG_MIRROR,SDRDRAG_SHEAR,SDRDRAG_CROOK
+ // Move==Resize
+ // Das Interface wird hier evtl noch geaendert wg. Ortho-Drag
+ void SetDragMode(SdrDragMode eMode);
+ SdrDragMode GetDragMode() const { return eDragMode; }
+ sal_Bool ChkDragMode(SdrDragMode eMode) const;
+ void SetFrameHandles(sal_Bool bOn);
+ sal_Bool IsFrameHandles() const { return bForceFrameHandles; }
+
+ // Limit, ab wann implizit auf FrameHandles umgeschaltet wird. default=50.
+ void SetFrameHandlesLimit(sal_uInt16 nAnz) { nFrameHandlesLimit=nAnz; }
+ sal_uInt16 GetFrameHandlesLimit() const { return nFrameHandlesLimit; }
+
+ void SetEditMode(SdrViewEditMode eMode);
+ SdrViewEditMode GetEditMode() const { return eEditMode; }
+
+ void SetEditMode(sal_Bool bOn=sal_True) { SetEditMode(bOn?SDREDITMODE_EDIT:SDREDITMODE_CREATE); }
+ sal_Bool IsEditMode() const { return eEditMode==SDREDITMODE_EDIT; }
+ void SetCreateMode(sal_Bool bOn=sal_True) { SetEditMode(bOn?SDREDITMODE_CREATE:SDREDITMODE_EDIT); }
+ sal_Bool IsCreateMode() const { return eEditMode==SDREDITMODE_CREATE; }
+ void SetGluePointEditMode(sal_Bool bOn=sal_True) { SetEditMode(bOn?SDREDITMODE_GLUEPOINTEDIT:eEditMode0); }
+ sal_Bool IsGluePointEditMode() const { return eEditMode==SDREDITMODE_GLUEPOINTEDIT; }
+
+ void SetDesignMode(sal_Bool bOn=sal_True);
+ sal_Bool IsDesignMode() const { return bDesignMode; }
+
+ void SetFrameDragSingles(sal_Bool bOn=sal_True) { SetFrameHandles(bOn); }
+ sal_Bool IsFrameDragSingles() const { return IsFrameHandles(); }
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// migrate selections
+
+protected:
+ // all available changing methods
+ SdrMarkList& GetMarkedObjectListWriteAccess() { return mpSdrViewSelection->GetMarkedObjectListWriteAccess(); }
+ void SetEdgesOfMarkedNodesDirty() { mpSdrViewSelection->SetEdgesOfMarkedNodesDirty(); }
+
+public:
+ // all available const methods for read access to selection
+ const SdrMarkList& GetMarkedObjectList() const { return mpSdrViewSelection->GetMarkedObjectList(); }
+ sal_uIntPtr TryToFindMarkedObject(const SdrObject* pObj) const { return GetMarkedObjectList().FindObject(pObj); }
+ SdrPageView* GetSdrPageViewOfMarkedByIndex(sal_uIntPtr nNum) const { return GetMarkedObjectList().GetMark(nNum)->GetPageView(); }
+ SdrMark* GetSdrMarkByIndex(sal_uIntPtr nNum) const { return GetMarkedObjectList().GetMark(nNum); }
+ SdrObject* GetMarkedObjectByIndex(sal_uIntPtr nNum) const { return (GetMarkedObjectList().GetMark(nNum))->GetMarkedSdrObj(); }
+ sal_uIntPtr GetMarkedObjectCount() const { return GetMarkedObjectList().GetMarkCount(); }
+ void SortMarkedObjects() const { GetMarkedObjectList().ForceSort(); }
+ sal_Bool AreObjectsMarked() const { return (0L != GetMarkedObjectList().GetMarkCount()); }
+ String GetDescriptionOfMarkedObjects() const { return GetMarkedObjectList().GetMarkDescription(); }
+ String GetDescriptionOfMarkedPoints() const { return GetMarkedObjectList().GetPointMarkDescription(); }
+ String GetDescriptionOfMarkedGluePoints() const { return GetMarkedObjectList().GetGluePointMarkDescription(); }
+ sal_Bool GetBoundRectFromMarkedObjects(SdrPageView* pPageView, Rectangle& rRect) const { return GetMarkedObjectList().TakeBoundRect(pPageView, rRect); }
+ sal_Bool GetSnapRectFromMarkedObjects(SdrPageView* pPageView, Rectangle& rRect) const { return GetMarkedObjectList().TakeSnapRect(pPageView, rRect); }
+
+ // Eine Liste aller an markierten Knoten gebundenen Kanten holen,
+ // die selbst jedoch nicht markiert sind.
+ const SdrMarkList& GetEdgesOfMarkedNodes() const { return mpSdrViewSelection->GetEdgesOfMarkedNodes(); }
+ const SdrMarkList& GetMarkedEdgesOfMarkedNodes() const { return mpSdrViewSelection->GetMarkedEdgesOfMarkedNodes(); }
+ const std::vector<SdrObject*>& GetTransitiveHullOfMarkedObjects() const { return mpSdrViewSelection->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; }
+
+ sal_Bool IsMarkedHit(const Point& rPnt, short nTol=-2) const { return IsMarkedObjHit(rPnt,nTol); }
+ sal_Bool IsMarkedObjHit(const Point& rPnt, short nTol=-2) const;
+
+ // Pick: Unterstuetzte Optionen fuer nOptions sind SEARCH_NEXT, SEARCH_BACKWARD (ni)
+ SdrHdl* PickHandle(const Point& rPnt, sal_uIntPtr nOptions=0, SdrHdl* pHdl0=NULL) const;
+
+ // Pick: Unterstuetzte Optionen fuer nOptions sind:
+ // SDRSEARCH_DEEP SDRSEARCH_ALSOONMASTER SDRSEARCH_TESTMARKABLE SDRSEARCH_TESTTEXTEDIT
+ // SDRSEARCH_WITHTEXT SDRSEARCH_TESTTEXTAREA SDRSEARCH_BACKWARD SDRSEARCH_MARKED
+ // SDRSEARCH_WHOLEPAGE
+ virtual sal_Bool PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions, SdrObject** ppRootObj, sal_uIntPtr* pnMarkNum=NULL, sal_uInt16* pnPassNum=NULL) const;
+ virtual sal_Bool PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions=0) const;
+ // sal_Bool PickObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions=0) const { return PickObj(rPnt,nHitTolLog,rpObj,rpPV,nOptions); }
+ sal_Bool MarkObj(const Point& rPnt, short nTol=-2, sal_Bool bToggle=sal_False, sal_Bool bDeep=sal_False);
+
+ // Pick: Unterstuetzte Optionen fuer nOptions sind SDRSEARCH_PASS2BOUND und SDRSEARCH_PASS3NEAREST
+ sal_Bool PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr* pnMarkNum=NULL, sal_uIntPtr nOptions=0) const;
+
+ // Sucht sich das Oberste der markierten Objekte (O1) und sucht von dort
+ // aus in Richtung nach Unten dann das erste nichtmarkierte Objekt (O2).
+ // Bei Erfolg wird die Markierung von O1 entfernt, an O2 gesetzt und TRUE
+ // returniert. Mit dem Parameter bPrev=sal_True geht die Suche genau in die
+ // andere Richtung.
+ sal_Bool MarkNextObj(sal_Bool bPrev=sal_False);
+
+ // Sucht sich das Oberste der markierten Objekte (O1) das von rPnt/nTol
+ // getroffen wird und sucht von dort aus in Richtung nach Unten dann das
+ // erste nichtmarkierte Objekt (O2). Bei Erfolg wird die Markierung von
+ // O1 entfernt, an O2 gesetzt und sal_True returniert.
+ // Mit dem Parameter bPrev=sal_True geht die Suche genau in die andere Richtung.
+ sal_Bool MarkNextObj(const Point& rPnt, short nTol=-2, sal_Bool bPrev=sal_False);
+
+ // Alle Objekte innerhalb eines rechteckigen Bereichs markieren
+ // Markiert werden nur Objekte, die vollstaendig eingeschlossen sind.
+ sal_Bool MarkObj(const Rectangle& rRect, sal_Bool bUnmark=sal_False);
+ void MarkObj(SdrObject* pObj, SdrPageView* pPV, sal_Bool bUnmark=sal_False, sal_Bool bImpNoSetMarkHdl=sal_False);
+ void MarkAllObj(SdrPageView* pPV=NULL); // pPage=NULL => alle angezeigten Seiten
+ void UnmarkAllObj(SdrPageView* pPV=NULL); // pPage=NULL => alle angezeigten Seiten
+
+ // Diese Funktion kostet etwas Zeit, da die MarkList durchsucht werden muss.
+ sal_Bool IsObjMarked(SdrObject* pObj) const;
+ // void MarkAll(SdrPageView* pPV=NULL) { MarkAllObj(pPV); } -> replace with inline
+ void UnMarkAll(SdrPageView* pPV=NULL) { UnmarkAllObj(pPV); }
+
+ // Groesse der Markierungs-Handles abfragen/setzen. Angabe in Pixel.
+ // Der Wert ist als Kantenlaenge zu betrachten. Gerade Werte werden
+ // auf Ungerade aufgerundet: 3->3, 4->5, 5->5, 6->7, 7->7, ...
+ // Defaultwert ist 7, Mindestwert 3 Pixel.
+ sal_uInt16 GetMarkHdlSizePixel() const;
+ void SetMarkHdlSizePixel(sal_uInt16 nSiz);
+
+ virtual sal_Bool HasMarkablePoints() const;
+ virtual sal_uIntPtr GetMarkablePointCount() const;
+ virtual sal_Bool HasMarkedPoints() const;
+ virtual sal_uIntPtr GetMarkedPointCount() const;
+
+ // Nicht alle Punkte lassen sich markieren:
+ virtual sal_Bool IsPointMarkable(const SdrHdl& rHdl) const;
+ virtual sal_Bool MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark=sal_False);
+
+ /** should only be used from outside svx for special ui elements */
+ sal_Bool MarkPointHelper(SdrHdl* pHdl, SdrMark* pMark, sal_Bool bUnmark);
+
+ // alle Punkte innerhalb dieses Rechtecks markieren (Viewkoordinaten)
+ sal_Bool MarkPoints(const Rectangle& rRect, sal_Bool bUnmark=sal_False) { return MarkPoints(&rRect,bUnmark); }
+ sal_Bool UnmarkPoint(SdrHdl& rHdl) { return MarkPoint(rHdl,sal_True); }
+ sal_Bool UnMarkPoint(SdrHdl& rHdl) { return MarkPoint(rHdl,sal_True); }
+ sal_Bool IsPointMarked(const SdrHdl& rHdl) const { ForceUndirtyMrkPnt(); return &rHdl!=NULL && rHdl.IsSelected(); }
+ sal_Bool MarkAllPoints() { return MarkPoints(NULL,sal_False); }
+ sal_Bool UnmarkAllPoints() { return MarkPoints(NULL,sal_True); }
+ sal_Bool UnMarkAllPoints() { return MarkPoints(NULL,sal_True); }
+
+ // Sucht sich den ersten markierten Punkt (P1) das von rPnt
+ // getroffen wird und sucht von dort aus den
+ // ersten nichtmarkierten Punkt (P2). Bei Erfolg wird die Markierung von
+ // P1 entfernt, an P2 gesetzt und sal_True returniert.
+ // Mit dem Parameter bPrev=sal_True geht die Suche genau in die andere Richtung.
+ sal_Bool MarkNextPoint(const Point& rPnt, sal_Bool bPrev=sal_False);
+
+ // Die Nummer des passenden Handles raussuchen. Nicht gefunden
+ // liefert CONTAINER_ENTRY_NOTFOUND.
+ sal_uIntPtr GetHdlNum(SdrHdl* pHdl) const { return aHdl.GetHdlNum(pHdl); }
+ SdrHdl* GetHdl(sal_uIntPtr nHdlNum) const { return aHdl.GetHdl(nHdlNum); }
+ const SdrHdlList& GetHdlList() const { return aHdl; }
+
+ // Selektionsrahmen fuer Punktmarkierung aufziehen.
+ // Wird nur gestartet, wenn HasMarkablePoints() sal_True liefert.
+ // sal_Bool BegMarkPoints(const Point& rPnt, OutputDevice* pOut);
+ sal_Bool BegMarkPoints(const Point& rPnt, sal_Bool bUnmark = sal_False);
+ void MovMarkPoints(const Point& rPnt);
+ sal_Bool EndMarkPoints();
+ void BrkMarkPoints();
+ sal_Bool IsMarkPoints() const { return (0L != mpMarkPointsOverlay); }
+
+ // Zusatzhandles dauerhaft sichtbar schalten
+ void SetPlusHandlesAlwaysVisible(sal_Bool bOn);
+ sal_Bool IsPlusHandlesAlwaysVisible() const { return bPlusHdlAlways; }
+
+ // Handles sichrbar waerend TextEdit (in doppelter Groesse)?
+ // Persistent, default=FALSE
+ void SetMarkHdlWhenTextEdit(sal_Bool bOn) { bMarkHdlWhenTextEdit=bOn; }
+ sal_Bool IsMarkHdlWhenTextEdit() const { return bMarkHdlWhenTextEdit; }
+
+ sal_Bool HasMarkableGluePoints() const;
+ sal_Bool HasMarkedGluePoints() const;
+
+ // Ein Klebepunkt wird eindeutig identifiziert durch das SdrObject
+ // (dem er zugehoert) sowie einem sal_uInt16 nId (da jedes SdrObject je
+ // mehrere Klebepunkte haben kann. Hier an der View kommt zudem noch
+ // eine SdrPageView, die stets korrekt gesetzt sein sollte.
+ // Alternativ kann ein Klebepunkt durch ein SdrHdl bezeichnet werden.
+ // Die SdrHdl-Instanz beinhaltet dann aller erforderlichen Informationen.
+ // Der Klebepunkt ist in diesem Fall dann zwangslaeufig markiert (nur auf
+ // markierten Klebepunkten sitzen Anfasser).
+ // Achtung: Bei jeder Aenderung des Klebepunktmarkierungsstatus wird die
+ // Handleliste erneut berechnet. Alle vorher gemerkten SdrHdl* sind
+ // damit ungueltig, ebenso die Punkt-Id's!
+ // Pick: Unterstuetzte Optionen fuer nOptions sind SEARCH_NEXT, SEARCH_BACKWARD
+ sal_Bool PickGluePoint(const Point& rPnt, SdrObject*& rpObj, sal_uInt16& rnId, SdrPageView*& rpPV, sal_uIntPtr nOptions=0) const;
+ sal_Bool MarkGluePoint(const SdrObject* pObj, sal_uInt16 nId, const SdrPageView* pPV, sal_Bool bUnmark=sal_False);
+ sal_Bool UnmarkGluePoint(const SdrObject* pObj, sal_uInt16 nId, const SdrPageView* pPV) { return MarkGluePoint(pObj,nId,pPV,sal_True); }
+ sal_Bool IsGluePointMarked(const SdrObject* pObj, sal_uInt16 nId) const;
+
+ // Hdl eines markierten GluePoints holen. Nicht markierte
+ // GluePoints haben keine Handles
+ SdrHdl* GetGluePointHdl(const SdrObject* pObj, sal_uInt16 nId) const;
+ sal_Bool IsGluePoint(const SdrHdl& rHdl) const { return &rHdl!=NULL && rHdl.GetKind()==HDL_GLUE; }
+
+ // alle Punkte innerhalb dieses Rechtecks markieren (Viewkoordinaten)
+ sal_Bool MarkGluePoints(const Rectangle& rRect) { return MarkGluePoints(&rRect,sal_False); }
+ sal_Bool UnmarkGluePoints(const Rectangle& rRect) { return MarkGluePoints(&rRect,sal_True); }
+ sal_Bool MarkAllGluePoints() { return MarkGluePoints(NULL,sal_False); }
+ sal_Bool UnmarkAllGluePoints() { return MarkGluePoints(NULL,sal_True); }
+
+ // Sucht sich den ersten markierten Klebepunkt (P1) das von rPnt
+ // getroffen wird und sucht von dort aus den
+ // ersten nichtmarkierten Klebepunkt (P2). Bei Erfolg wird die Markierung
+ // von P1 entfernt, an P2 gesetzt und sal_True returniert.
+ // Mit dem Parameter bPrev=sal_True geht die Suche genau in die andere Richtung.
+ sal_Bool MarkNextGluePoint(const Point& rPnt, sal_Bool bPrev=sal_False);
+
+ // Selektionsrahmen fuer Klebepunktmarkierung aufziehen.
+ // Wird nur gestartet, wenn HasMarkableGluePoints() sal_True liefert.
+ // Der GlueEditMode sal_True wird nicht abgefragt.
+ // sal_Bool BegMarkGluePoints(const Point& rPnt, OutputDevice* pOut);
+ sal_Bool BegMarkGluePoints(const Point& rPnt, sal_Bool bUnmark = sal_False);
+ void MovMarkGluePoints(const Point& rPnt);
+ sal_Bool EndMarkGluePoints();
+ void BrkMarkGluePoints();
+ sal_Bool IsMarkGluePoints() const { return (0L != mpMarkGluePointsOverlay); }
+
+ // bRestraintPaint=sal_False bewirkt, dass die Handles nicht sofort wieder gemalt werden.
+ // AdjustMarkHdl wird eh' nur gerufen, wenn was geaendert wurde; was idR ein Invalidate
+ // zur Folge hat. Am Ende von des Redraw werden die Handles automatisch gezeichnet.
+ // Der Zweck ist, unnoetiges Flackern zu vermeiden. -> Funkt noch nich, deshalb sal_True!
+ void AdjustMarkHdl(); //HMHBOOL bRestraintPaint=sal_True);
+
+ const Rectangle& GetMarkedObjRect() const; // SnapRects der Objekte, ohne Strichstaerke
+ Rectangle GetMarkedObjBoundRect() const; // inkl. Strichstaerke, ueberstehende Fetzen, ...
+ const Rectangle& GetMarkedPointsRect() const; // Umschliessendes Rechteck aller markierten Punkte
+ const Rectangle& GetMarkedGluePointsRect() const; // Umschliessendes Rechteck aller markierten Klebepunkte
+ const Rectangle& GetAllMarkedRect() const { return GetMarkedObjRect(); }
+ Rectangle GetAllMarkedBoundRect() const { return GetMarkedObjBoundRect(); }
+ const Rectangle& GetAllMarkedPointsRect() const { return GetMarkedPointsRect(); }
+ Point GetGridOffset() const;
+
+ // Wird immer dann gerufen, wenn sich die Liste der markierten Objekte
+ // moeglicherweise geaendert hat. Wer ueberlaed muss unbedingt auch die
+ // Methode der Basisklasse rufen!
+ virtual void MarkListHasChanged();
+
+ // Betreten (Editieren) einer evtl markierten Objektgruppe. Sind mehrere
+ // Objektgruppen markiert, so wird die Oberste genommen. Anschliessend
+ // liegen alle Memberobjekte der Gruppe im direkten Zugriff. Alle anderen
+ // Objekte koennen waerendessen nicht bearbeitet werden (bis zum naechsten
+ // LeaveGroup()). Bei einer seitenuebergreifenden Markierung wird jede Page
+ // separat abgearbeitet. Die Methode liefert sal_True, wenn wenigstens eine
+ // Gruppe betreten wurde.
+ sal_Bool EnterMarkedGroup();
+
+ // Den Mittelpunkt des letzten Crook-Dragging abholen. Den kann man
+ // bei einem anschliessenden Rotate sinnvoll als Drehmittelpunkt setzen.
+ const Point& GetLastCrookCenter() const { return aLastCrookCenter; }
+
+ // Wird automatisch von der DragView beim beenden eines Crook-Drag gesetzt.
+ void SetLastCrookCenter(const Point& rPt) { aLastCrookCenter=rPt; }
+
+ // Rotationsmittelpunkt bzw. Startpunkt der Spiegelachse
+ const Point& GetRef1() const { return aRef1; }
+ void SetRef1(const Point& rPt);
+
+ // Endpunkt der Spiegelachse
+ const Point& GetRef2() const { return aRef1; }
+ void SetRef2(const Point& rPt);
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// - Hit-Toleranzen:
+// Die muessen natuerlich immer in logischen Koordinaten angegeben werden. Also
+// immer brav den gewuenschten Pixelwert mit PixelToLogic in Logischen umrechnen.
+// Angenommen ein Wert 100 (logisch)
+// - Bei einer waagerechten Haarlinie (Objekt mit Hoehe 0) waere dann +/-100,
+// also ein vertikaler Bereich von 200 logischen Einheiten sensitiv.
+// - Bei Polygonen wird ein Rect mit der Groesse (200,200) generiert und ein
+// Touch-Test zwischen Poly und diesem Rect durchgefuehrt.
+// - Eine Sonderbehandlung erfahren Objekte, die bei SdrObject::HasEdit()==TRUE
+// liefern (z.B. Textrahmen). Hierbei wird ein weiterer sensitiver Bereich mit
+// einer Breite von 2*Tol (in diesem Beispiel also 200 Einheiten) um das Objekt
+// herumgelegt. Waerend ein Hit direkt ins Objekt die Edit-Methode ruft,
+// ermoeglicht ein Hit in den umliegenden sensitiven Bereich ein Dragging.
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..ee7e11ba194a
--- /dev/null
+++ b/include/svx/svdoashp.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 _SVDOASHP_HXX
+#define _SVDOASHP_HXX
+
+#include <svx/svdobj.hxx>
+#include <svx/svdotext.hxx>
+#include <svx/svdhdl.hxx>
+#include <vector>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/drawing/XCustomShapeEngine.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class SdrObjList;
+class SdrObjListIter;
+class SfxItemSet;
+
+namespace sdr
+{
+ namespace properties
+ {
+ class CustomShapeProperties;
+ } // end of namespace properties
+} // end of namespace sdr
+
+class SdrAShapeObjGeoData : public SdrTextObjGeoData
+{
+ public:
+
+ sal_Bool bMirroredX;
+ sal_Bool bMirroredY;
+ double fObjectRotation;
+
+ com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue >
+ aAdjustmentSeq;
+};
+
+#define CUSTOMSHAPE_HANDLE_RESIZE_FIXED 1
+#define CUSTOMSHAPE_HANDLE_CREATE_FIXED 2
+#define CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_X 4
+#define CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_Y 8
+#define CUSTOMSHAPE_HANDLE_MOVE_SHAPE 16
+#define CUSTOMSHAPE_HANDLE_ORTHO4 32
+
+struct SdrCustomShapeInteraction
+{
+ com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeHandle > xInteraction;
+ com::sun::star::awt::Point aPosition;
+ sal_Int32 nMode;
+};
+
+//************************************************************
+// SdrObjCustomShape
+//************************************************************
+
+class SVX_DLLPUBLIC SdrObjCustomShape : public SdrTextObj
+{
+private:
+ // fObjectRotation is containing the object rotation in degrees.
+ double fObjectRotation;
+
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual void impl_setUnoShape(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>& rxUnoShape);
+
+public:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
+ // to allow sdr::properties::CustomShapeProperties access
+ friend class sdr::properties::CustomShapeProperties;
+
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mXRenderedCustomShape;
+
+ mutable com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeEngine > mxCustomShapeEngine;
+
+ // #i37011# render geometry shadow
+ SdrObject* mpLastShadowGeometry;
+
+ com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeEngine > GetCustomShapeEngine() const;
+
+// SVX_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeHandle > >
+// SdrObjCustomShape::GetInteraction( const SdrObjCustomShape* pCustomShape ) const;
+// #i47293#
+// SVX_DLLPRIVATE std::vector< com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeHandle > > GetFixedInteractionHandle() const;
+
+ SVX_DLLPRIVATE std::vector< SdrCustomShapeInteraction > GetInteractionHandles( const SdrObjCustomShape* pCustomShape ) const;
+
+ SVX_DLLPRIVATE void DragCreateObject( SdrDragStat& rDrag );
+
+ SVX_DLLPRIVATE void DragResizeCustomShape( const Rectangle& rNewRect, SdrObjCustomShape* pObj ) const;
+ SVX_DLLPRIVATE void DragMoveCustomShapeHdl( const Point aDestination, const sal_uInt16 nCustomShapeHdlNum, SdrObjCustomShape* pObj ) const;
+
+ // #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.
+ Rectangle ImpCalculateTextFrame( const bool bHgt, const bool bWdt );
+
+public:
+ // #i37011#
+ const SdrObject* GetSdrObjectFromCustomShape() const;
+ const SdrObject* GetSdrObjectShadowFromCustomShape() const;
+ sal_Bool GetTextBounds( Rectangle& rTextBound ) const;
+ sal_Bool IsTextPath() const;
+ static basegfx::B2DPolyPolygon GetLineGeometry( const SdrObjCustomShape* pCustomShape, const sal_Bool bBezierAllowed );
+
+protected:
+
+ String aName;
+
+public:
+
+ sal_Bool UseNoFillStyle() const;
+
+ sal_Bool IsMirroredX() const;
+ sal_Bool IsMirroredY() const;
+ bool IsPostRotate() const;
+ void SetMirroredX( const sal_Bool bMirroredX );
+ void SetMirroredY( const sal_Bool bMirroredY );
+
+ double GetObjectRotation() const;
+ double GetExtraTextRotation( const bool bPreRotation = false ) const;
+
+ TYPEINFO();
+ SdrObjCustomShape();
+ virtual ~SdrObjCustomShape();
+
+ /* is merging default attributes from type-shype 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 = NULL );
+
+ /* the method is checking if the geometry data is unchanged/default, in this case the data might not be stored */
+ enum DefaultType
+ {
+ DEFAULT_PATH,
+ DEFAULT_VIEWBOX,
+ DEFAULT_SEGMENTS,
+ DEFAULT_GLUEPOINTS,
+ DEFAULT_STRETCHX,
+ DEFAULT_STRETCHY,
+ DEFAULT_EQUATIONS,
+ DEFAULT_HANDLES,
+ DEFAULT_TEXTFRAMES
+ };
+ sal_Bool IsDefaultGeometry( const DefaultType eDefaultType ) const;
+
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+
+ virtual void SetModel(SdrModel* pNewModel);
+
+ virtual void RecalcSnapRect();
+
+ virtual const Rectangle& GetSnapRect() const;
+ virtual const Rectangle& GetCurrentBoundRect() const;
+ virtual const Rectangle& GetLogicRect() const;
+
+ virtual void Move(const Size& rSiz);
+ virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true);
+ virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear);
+ virtual void SetSnapRect(const Rectangle& rRect);
+ virtual void SetLogicRect(const Rectangle& rRect);
+
+ virtual void NbcMove(const Size& rSiz);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
+ virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
+ virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear);
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+ virtual void NbcSetLogicRect(const Rectangle& rRect);
+
+ virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const;
+
+ virtual void NbcSetStyleSheet( SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr );
+
+ // special drag methods
+ virtual bool hasSpecialDrag() const;
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+
+ virtual bool BegCreate( SdrDragStat& rStat );
+ virtual bool MovCreate(SdrDragStat& rStat); // #i37448#
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+
+ virtual bool AdjustTextFrameWidthAndHeight(Rectangle& rR, bool bHgt = true, bool bWdt = true) const;
+ virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
+ virtual bool AdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
+ virtual bool IsAutoGrowHeight() const;
+ virtual bool IsAutoGrowWidth() const;
+ virtual void SetVerticalWriting( sal_Bool bVertical );
+ virtual sal_Bool BegTextEdit( SdrOutliner& rOutl );
+ virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
+ virtual void EndTextEdit( SdrOutliner& rOutl );
+ virtual void TakeTextAnchorRect( Rectangle& rAnchorRect ) const;
+ virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, bool bNoEditText = false,
+ Rectangle* pAnchorRect=NULL, bool bLineWidth = true ) const;
+ virtual SdrObjCustomShape* Clone() const;
+ SdrObjCustomShape& operator=(const SdrObjCustomShape& rObj);
+
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly( const SdrDragStat& rDrag) const;
+
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+ virtual basegfx::B2DPolyPolygon TakeContour() const;
+
+ virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
+
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+ virtual void SetPage( SdrPage* pNewPage );
+
+ virtual SdrObjGeoData *NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData &rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData &rGeo);
+
+ // need to take fObjectRotation instead of aGeo.nWink, replace it temporary
+ virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const;
+ virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
+
+ virtual const SdrGluePointList* GetGluePointList() const;
+ //virtual SdrGluePointList* GetGluePointList();
+ virtual SdrGluePointList* ForceGluePointList();
+
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual SdrHdl* GetHdl( sal_uInt32 nHdlNum ) const;
+
+ // #i33136#
+ static bool doConstructOrthogonal(const OUString& rName);
+
+ using SdrTextObj::NbcSetOutlinerParaObject;
+};
+
+#endif //_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 000000000000..46f1da0da01f
--- /dev/null
+++ b/include/svx/svdoattr.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 _SVDOATTR_HXX
+#define _SVDOATTR_HXX
+
+#include <svx/xfillit0.hxx>
+#include <svx/xflasit.hxx>
+#include <svx/xlineit0.hxx>
+#include <svx/xlnasit.hxx>
+#include <svx/svdobj.hxx>
+#include <svx/svdattr.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class SfxPoolItem;
+class SfxSetItem;
+class SdrOutliner;
+class SfxItemSet;
+class SfxItemPool;
+
+//************************************************************
+// SdrAttrObj
+//************************************************************
+
+class SVX_DLLPUBLIC SdrAttrObj : public SdrObject
+{
+private:
+ friend class SdrOutliner;
+
+protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
+ Rectangle maSnapRect;
+
+protected:
+ // Strichstaerke ermitteln. Keine Linie -> 0.
+ sal_Int32 ImpGetLineWdt() const;
+
+ // Zuhoeren, ob sich ein StyleSheet aendert
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+ SdrAttrObj();
+ virtual ~SdrAttrObj();
+
+public:
+ TYPEINFO();
+
+ // Feststellen, ob bFilledObj && Fuellung!=FillNone
+ sal_Bool HasFill() const;
+
+ // Feststellen, ob Linie!=LineNone
+ sal_Bool HasLine() const;
+
+ virtual const Rectangle& GetSnapRect() const;
+
+ virtual void SetModel(SdrModel* pNewModel);
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..5d4f76d0b804
--- /dev/null
+++ b/include/svx/svdobj.hxx
@@ -0,0 +1,1135 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDOBJ_HXX
+#define _SVDOBJ_HXX
+
+#include <memory>
+#include <typeinfo>
+#include <cppuhelper/weakref.hxx>
+#include <vcl/mapmod.hxx>
+#include <tools/weakbase.hxx>
+#include <svl/lstner.hxx>
+#include <vcl/timer.hxx>
+#include <svx/svdsob.hxx>
+#include <svx/svdtypes.hxx> // fuer SdrLayerID
+#include <svx/svdglue.hxx> // Klebepunkte
+#include <svx/xdash.hxx>
+#include <svx/xpoly.hxx>
+#include <svx/xenum.hxx>
+#include <vcl/bitmapex.hxx>
+#include <svx/sdrobjectuser.hxx>
+#include "svx/svxdllapi.h"
+#include "svx/shapeproperty.hxx"
+
+#include <boost/optional.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class SfxBroadcaster;
+class Pointer;
+class AutoTimer;
+class OutlinerParaObject;
+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 SfxSetItem;
+class SfxStyleSheet;
+class SfxUndoAction;
+class XFillAttrSetItem;
+class XLineAttrSetItem;
+class SfxItemPool;
+class PolyPolygon;
+class SfxPoolItem;
+class SdrVirtObj;
+class SdrDragView;
+
+namespace sdr
+{
+ namespace properties
+ {
+ class BaseProperties;
+ } // end of namespace properties
+} // end of namespace sdr
+
+// #110094#
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewContact;
+ } // end of namespace contact
+} // end of namespace sdr
+
+namespace svx
+{
+ class PropertyChangeNotifier;
+}
+
+//************************************************************
+// Defines
+//************************************************************
+
+enum SdrObjKind {OBJ_NONE = 0, // Abstraktes Objekt (SdrObject)
+ OBJ_GRUP = 1, // Objektgruppe
+ OBJ_LINE = 2, // Strecke
+ OBJ_RECT = 3, // Rechteck ww. mit runden Ecken
+ OBJ_CIRC = 4, // Kreis, Ellipse
+ OBJ_SECT = 5, // Kreissektor
+ OBJ_CARC = 6, // Kreisbogen
+ OBJ_CCUT = 7, // Kreisabschnitt
+ OBJ_POLY = 8, // Polygon, PolyPolygon
+ OBJ_PLIN = 9, // PolyLine
+ OBJ_PATHLINE =10, // Offene Bezierkurve
+ OBJ_PATHFILL =11, // Geschlossene Bezierkurve
+ OBJ_FREELINE =12, // Offene Freihandlinie
+ OBJ_FREEFILL =13, // Geschlossene Freihandlinie
+ OBJ_SPLNLINE =14, // Natuerlicher kubischer Spline (ni)
+ OBJ_SPLNFILL =15, // Periodischer kubischer Spline (ni)
+ OBJ_TEXT =16, // Textobjekt
+ OBJ_TEXTEXT =17, // Texterweiterungsrahmen (ni)
+ OBJ_wegFITTEXT, // FitToSize-Text (alle Zeilen gleich)
+ OBJ_wegFITALLTEXT, // FitToSize-Text (Zeilenweise) (ni)
+ OBJ_TITLETEXT =20, // Titeltext. Spezial-Textobjekt fuer StarDraw
+ OBJ_OUTLINETEXT=21, // OutlineText. Spezial-Textobjekt fuer StarDraw
+ OBJ_GRAF =22, // Fremdgrafik - (StarView Graphic)
+ OBJ_OLE2 =23, // OLE-Objekt
+ OBJ_EDGE =24, // Verbindungsobjekt fuer Konnektoren
+ OBJ_CAPTION =25, // Legendenobjekt
+ OBJ_PATHPOLY =26, // Polygon/PolyPolygon dargestellt durch SdrPathObj
+ OBJ_PATHPLIN =27, // Polyline dargestellt durch SdrPathObj
+ OBJ_PAGE =28, // Objekt, das eine SdrPage darstellt
+ OBJ_MEASURE =29, // Bemassungsobjekt
+ OBJ_DUMMY =30, // Dummyobjekt zum speichern von Luecken (zur anschliessenden Wiederherstellung der Surrogate)
+ OBJ_FRAME =31, // staendig aktives OLE (PlugIn-Frame oder sowas)
+ OBJ_UNO =32, // Universal Network Object im SvDraw-Obj eingepackt
+ OBJ_CUSTOMSHAPE=33, // CustomShape
+ OBJ_MEDIA =34, // Media shape
+ OBJ_TABLE =35, // Table
+ OBJ_MAXI};
+
+enum SdrUserCallType {SDRUSERCALL_MOVEONLY, // Nur verschoben, Groesse unveraendert
+ SDRUSERCALL_RESIZE, // Groesse und evtl. auch Pos veraendert
+ SDRUSERCALL_CHGATTR, // Attribute veraendert. Moeglicherweise neue Groesse wg. Linienbreite
+ SDRUSERCALL_DELETE, // Obj gibt es gleich nicht mehr. Schon keine Attr mehr.
+ SDRUSERCALL_COPY, // Zuweisungsoperator gerufen. Kann alles geaendert sein
+ SDRUSERCALL_INSERTED, // In eine Objektliste (z.B. Page) eingefuegt
+ SDRUSERCALL_REMOVED, // Aus der Objektliste entfernt
+ SDRUSERCALL_CHILD_MOVEONLY, // Ein Child einer Gruppe hat sich veraendert
+ SDRUSERCALL_CHILD_RESIZE, // Ein Child einer Gruppe hat sich veraendert
+ SDRUSERCALL_CHILD_CHGATTR, // Ein Child einer Gruppe hat sich veraendert
+ SDRUSERCALL_CHILD_DELETE, // Ein Child einer Gruppe hat sich veraendert
+ SDRUSERCALL_CHILD_COPY, // Ein Child einer Gruppe hat sich veraendert
+ SDRUSERCALL_CHILD_INSERTED, // Ein Child einer Gruppe hat sich veraendert
+ SDRUSERCALL_CHILD_REMOVED}; // Ein Child einer Gruppe hat sich veraendert
+
+//************************************************************
+// Hilfsklasse SdrObjUserCall
+//************************************************************
+
+class SVX_DLLPUBLIC SdrObjUserCall
+{
+public:
+ TYPEINFO();
+ virtual ~SdrObjUserCall();
+ virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect);
+};
+
+//************************************************************
+// Hilfsklasse SdrObjMacroHitRec
+//************************************************************
+
+class SVX_DLLPUBLIC SdrObjMacroHitRec
+{
+public:
+ Point aPos;
+ Point aDownPos;
+ OutputDevice* pOut;
+ const SetOfByte* pVisiLayer;
+ const SdrPageView* pPageView;
+ sal_uInt16 nTol;
+ bool bDown;
+
+ SdrObjMacroHitRec();
+};
+
+//************************************************************
+// Hilfsklasse SdrObjUserData
+//
+// Anwenderdaten an einem Zeichenobjekt, z.B. applikationsspezifische Daten.
+// Jedes Zeichenobjekt kann beliebig viele dieser Records haben (SV-Liste).
+// Wer hier Daten halten will, muss sich ableiten und auch an der Factory
+// einen entsprechenden Link setzen.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrObjUserData
+{
+protected:
+ sal_uInt32 nInventor;
+ sal_uInt16 nIdentifier;
+ sal_uInt16 nVersion;
+
+private:
+ SVX_DLLPRIVATE void operator=(const SdrObjUserData& rData); // not implemented
+ SVX_DLLPRIVATE bool operator==(const SdrObjUserData& rData) const; // not implemented
+ SVX_DLLPRIVATE bool operator!=(const SdrObjUserData& rData) const; // not implemented
+
+public:
+ TYPEINFO();
+
+ SdrObjUserData(sal_uInt32 nInv, sal_uInt16 nId, sal_uInt16 nVer);
+ SdrObjUserData(const SdrObjUserData& rData);
+ virtual ~SdrObjUserData();
+
+ virtual SdrObjUserData* Clone(SdrObject* pObj1) const = 0; // #i71039# NULL -> 0
+ sal_uInt32 GetInventor() const;
+ sal_uInt16 GetId() const;
+
+ virtual bool HasMacro (const SdrObject* pObj) const;
+ virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
+ virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
+ virtual void PaintMacro (OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
+ virtual bool DoMacro (const SdrObjMacroHitRec& rRec, SdrObject* pObj);
+ virtual OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
+};
+
+//************************************************************
+// Hilfsklasse SdrObjUserDataList
+//************************************************************
+
+class SdrObjUserDataList
+{
+ typedef boost::ptr_vector<SdrObjUserData> ListType;
+ ListType maList;
+
+public:
+ SdrObjUserDataList();
+ ~SdrObjUserDataList();
+
+ size_t GetUserDataCount() const;
+ const SdrObjUserData* GetUserData(size_t nNum) const;
+ SdrObjUserData* GetUserData(size_t nNum);
+ void AppendUserData(SdrObjUserData* pData);
+ void DeleteUserData(size_t nNum);
+};
+
+//************************************************************
+// Hilfsklasse SdrObjGeoData
+//
+// Alle geometrischen Daten eines beliebigen Objektes zur �bergabe an's Undo/Redo
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrObjGeoData
+{
+public:
+ Rectangle aBoundRect;
+ Point aAnchor;
+ SdrGluePointList* pGPL;
+ bool bMovProt;
+ bool bSizProt;
+ bool bNoPrint;
+ bool bClosedObj;
+ bool mbVisible;
+ SdrLayerID mnLayerID;
+
+public:
+ SdrObjGeoData();
+ virtual ~SdrObjGeoData();
+};
+
+//************************************************************
+// Hilfsklasse SdrObjPlusData
+//
+// Bitsack fuer DrawObjekte
+//
+//************************************************************
+
+class SdrObjPlusData
+{
+ friend class SdrObject;
+
+ SfxBroadcaster* pBroadcast; // Broadcaster, falls dieses Obj referenziert wird (bVirtObj=true). Auch fuer Konnektoren etc.
+ SdrObjUserDataList* pUserDataList; // applikationsspeziefische Daten
+ SdrGluePointList* pGluePoints; // Klebepunkte zum Ankleben von Objektverbindern
+
+ // #i68101#
+ // object name, title and description
+ OUString aObjName;
+ OUString aObjTitle;
+ OUString aObjDescription;
+
+public:
+ TYPEINFO();
+ SdrObjPlusData();
+ virtual ~SdrObjPlusData();
+ virtual SdrObjPlusData* Clone(SdrObject* pObj1) const;
+
+ void SetGluePoints(const SdrGluePointList& rPts);
+};
+
+//************************************************************
+// Hilfsklasse SdrObjTransformInfoRec
+//
+// gibt Auskunft ueber verschiedene Eigenschaften eines ZObjects
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrObjTransformInfoRec
+{
+public:
+ bool bSelectAllowed : 1; // false=Obj kann nicht selektiert werden
+ bool bMoveAllowed : 1; // false=Obj kann nicht verschoben werden
+ bool bResizeFreeAllowed : 1; // false=Obj kann nicht frei resized werden
+ bool bResizePropAllowed : 1; // false=Obj kann nichtmal proportional resized werden
+ bool bRotateFreeAllowed : 1; // false=Obj kann nicht frei gedreht werden
+ bool bRotate90Allowed : 1; // false=Obj kann nichtmal im 90deg Raster gedreht werden
+ bool bMirrorFreeAllowed : 1; // false=Obj kann nicht frei gespiegelt werden
+ bool bMirror45Allowed : 1; // false=Obj kann nichtmal ueber Achse im 45deg Raster gespiegelt werden
+ bool bMirror90Allowed : 1; // false=Obj kann ebenfalls nicht ueber Achse im 90deg Raster gespiegelt werden
+ bool bTransparenceAllowed : 1; // false=Obj does not have an interactive transparence control
+ bool bGradientAllowed : 1; // false=Obj dooes not have an interactive gradient control
+ bool bShearAllowed : 1; // false=Obj kann nicht verzerrt werden
+ bool bEdgeRadiusAllowed : 1;
+ bool bNoOrthoDesired : 1; // true bei Rect; ... false bei BMP,MTF;
+ bool bNoContortion : 1; // false=Kein verzerren (bei Crook) moeglich (nur true bei PathObj und Gruppierten PathObjs)
+ bool bCanConvToPath : 1; // false=Keine Konvertierung in PathObj moeglich
+ bool bCanConvToPoly : 1; // false=Keine Konvertierung in PolyObj moeglich
+ bool bCanConvToContour : 1; // false=no conversion down to whole contour possible
+ bool bCanConvToPathLineToArea : 1; // false=Keine Konvertierung in PathObj moeglich mit Wandlung von LineToArea
+ bool bCanConvToPolyLineToArea : 1; // false=Keine Konvertierung in PolyObj moeglich mit Wandlung von LineToArea
+
+ SdrObjTransformInfoRec();
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@@@ @@@@@ @@@@@@ @@@@@ @@@@ @@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@@@@ @@ @@@@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@@@ @@@@@ @@@@ @@@@@ @@@@ @@
+//
+// Abstraktes DrawObject
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SvxShape;
+class SVX_DLLPUBLIC SdrObject: public SfxListener, public tools::WeakBase< SdrObject >
+{
+private:
+ // ObjectUser section
+ sdr::ObjectUserVector maObjectUsers;
+
+public:
+ void AddObjectUser(sdr::ObjectUser& rNewUser);
+ void RemoveObjectUser(sdr::ObjectUser& rOldUser);
+
+ // BaseProperties section
+private:
+ sdr::properties::BaseProperties* mpProperties;
+protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+public:
+ virtual sdr::properties::BaseProperties& GetProperties() const;
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // #110094# DrawContact section
+private:
+ sdr::contact::ViewContact* mpViewContact;
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+public:
+ sdr::contact::ViewContact& GetViewContact() const;
+
+ // DrawContact support: Methods for handling Object changes
+ void ActionChanged() const;
+
+private:
+ friend class SdrObjListIter;
+ friend class SdrVirtObj;
+ friend class SdrRectObj;
+
+protected:
+ Rectangle aOutRect; // umschliessendes Rechteck fuer Paint (inkl. LineWdt, ...)
+ Point aAnchor; // Ankerposition (Writer)
+ Point aGridOffset; // hack (Calc)
+ SdrObjList* pObjList; // Liste, in dem das Obj eingefuegt ist.
+ SdrPage* pPage;
+ SdrModel* pModel;
+ SdrObjUserCall* pUserCall;
+ SdrObjPlusData* pPlusData; // Broadcaster, UserData, Konnektoren, ... (Das ist der Bitsack)
+
+ sal_uInt32 nOrdNum; // Rangnummer des Obj in der Liste
+
+ /** Position in the navigation order. SAL_MAX_UINT32 when not used.
+ */
+ sal_uInt32 mnNavigationPosition;
+ SdrLayerID mnLayerID;
+
+ // Objekt zeigt nur auf ein Anderes
+ bool bVirtObj : 1;
+ bool bSnapRectDirty : 1;
+ bool bNetLock : 1; // ni
+ bool bInserted : 1; // nur wenn true gibt's RepaintBroadcast & SetModify
+ bool bGrouped : 1; // Member eines GroupObjektes?
+
+ // Die folgende Flags werden gestreamt
+ bool bMovProt : 1; // If true, the position is protected
+ bool bSizProt : 1; // If true, the size is protected
+ 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
+ // Wenn bEmptyPresObj true ist, handelt es sich um ein
+ // Praesentationsobjekt, dem noch kein Inhalt zugewiesen
+ // wurde. Default ist das Flag auf FALSE. Die Verwaltung
+ // uebernimmt die Applikation. Im Zuweisungsoperator sowie
+ // beim Clone wird das Flag nicht mitkopiert!
+ // Das Flag ist persistent.
+ bool bEmptyPresObj : 1; // Leeres Praesentationsobjekt (Draw)
+
+ // true=Objekt ist als Objekt der MasterPage nicht sichtbar
+ bool bNotVisibleAsMaster : 1;
+
+ // true=Es handelt sich hierbei um ein geschlossenes Objekt, also nicht Linie oder Kreisbogen ...
+ bool bClosedObj : 1;
+
+ bool bIsEdge : 1;
+ bool bIs3DObj : 1;
+ bool bMarkProt : 1; // Markieren verboten. Persistent
+ bool bIsUnoObj : 1;
+ bool bNotMasterCachable : 1;
+
+ // #i25616#
+ bool mbLineIsOutsideGeometry : 1;
+
+ // #i25616#
+ bool mbSupportTextIndentingOnLineWidthChange : 1;
+
+ // 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
+ Rectangle maBLIPSizeRectangle;
+
+ // global static ItemPool for not-yet-insetred items
+private:
+ static SdrItemPool* mpGlobalItemPool;
+ boost::optional<double> mnRelativeWidth;
+ boost::optional<double> mnRelativeHeight;
+public:
+ static SdrItemPool& GetGlobalDrawObjectItemPool();
+ void SetRelativeWidth( double nValue ) { mnRelativeWidth.reset( nValue ); }
+ void SetRelativeHeight( double nValue ) { mnRelativeHeight.reset( nValue ); }
+ boost::optional<double> GetRelativeWidth( ) const { return mnRelativeWidth; }
+ boost::optional<double> GetRelativeHeight( ) const { return mnRelativeHeight; }
+ // evil calc grid/shape drawlayer syncing
+ Point GetGridOffset() const { return aGridOffset; }
+ void SetGridOffset( const Point& rGridOffset ){ aGridOffset = rGridOffset; }
+protected:
+ void ImpDeleteUserData();
+ SdrObjUserData* ImpGetMacroUserData() const;
+ Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
+
+ // Fuer GetDragComment
+ void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, OUString& rStr, sal_uInt16 nVal=0) const;
+
+ void ImpForcePlusData();
+
+ OUString GetWinkStr(long nWink, bool bNoDegChar = false) const;
+ OUString GetMetrStr(long nVal, MapUnit eWantMap=MAP_MM, bool bNoUnitChars = false) const;
+
+ // bNotMyself=true bedeutet: Nur die ObjList auf Dirty setzen, nicht mich.
+ // Wird z.B. benoetigt fuer NbcMove, denn da movt man SnapRect und aOutRect
+ // i.d.R. gleich mit um die Neuberechnung zu sparen.
+public:
+ virtual void SetRectsDirty(sal_Bool bNotMyself = false);
+protected:
+
+ // ueberladen, wenn man sich von SdrObjPlusData abgeleitet hat:
+ virtual SdrObjPlusData* NewPlusData() const;
+
+protected:
+ // Diese 3 Methoden muss ein abgeleitetes Objekt ueberladen, wenn es eigene
+ // geometrische Daten besitzt, die fuer den Undo-Fall gesichert werden
+ // sollen. NewGeoData() erzeugt lediglich eine leere Instanz auf eine von
+ // SdrObjGeoData abgeleitete Klasse.
+ virtual SdrObjGeoData* NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+
+protected:
+ virtual ~SdrObject();
+
+public:
+ TYPEINFO();
+ SdrObject();
+
+ /** 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();
+
+ virtual void SetObjList(SdrObjList* pNewObjList);
+ SdrObjList* GetObjList() const;
+
+ virtual void SetPage(SdrPage* pNewPage);
+ SdrPage* GetPage() const;
+
+ virtual void SetModel(SdrModel* pNewModel);
+ SdrModel* GetModel() const;
+ SdrItemPool* GetObjectItemPool() const;
+
+ void AddListener(SfxListener& rListener);
+ void RemoveListener(SfxListener& rListener);
+ const SfxBroadcaster* GetBroadcaster() const;
+
+ virtual void AddReference(SdrVirtObj& rVrtObj);
+ virtual void DelReference(SdrVirtObj& rVrtObj);
+ virtual sal_uInt32 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 GetLayerSet -> getMergedHierarchyLayerSet to make clear what happens here. rSet needs to be empty.
+ virtual void getMergedHierarchyLayerSet(SetOfByte& rSet) const;
+
+ // UserCall interface
+ void SetUserCall(SdrObjUserCall* pUser);
+ SdrObjUserCall* GetUserCall() const;
+ void SendUserCall(SdrUserCallType eUserCall, const Rectangle& rBoundRect) const;
+
+ // Ein solcher Referenzpunkt ist z.B. der Punkt eines Symbols, der
+ // der beim Einfuegen des Symbols auf das Raster gefangen werden soll
+ // oder der Fixpunkt eines Bildes innerhalb eines Animationsobjektes.
+ virtual bool HasRefPoint() const;
+ virtual Point GetRefPoint() const;
+ virtual void SetRefPoint(const Point& rPnt);
+
+ // #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 SetTitle(const OUString& rStr);
+ OUString GetTitle() const;
+ void SetDescription(const OUString& rStr);
+ OUString GetDescription() const;
+
+ // Fuer Gruppenobjekte
+ bool IsGroupObject() const;
+ virtual SdrObjList* GetSubList() const;
+ SdrObject* GetUpGroup() const;
+
+ // Ueber die Objekt-Ordnungsnummer kann man feststellen, ob ein Objekt vor
+ // oder hinter einem anderen liegt. Objekte mit kleinen Ordnungsnummern werden
+ // zuerst gezeichnet, Objekte mit grossen Ordnungsnummern zuletzt.
+ // Wird die Reihenfolge der Objekte in der Liste veraendert, so wird ein
+ // Dirty-Flag gesetzt (an der Page). Beim naechsten SdrObject::GetOrdNum()
+ // werden die Ordnungsnummer aller Objekte der Liste neu bestimmt.
+ sal_uInt32 GetOrdNum() const;
+
+ // Diese Methode sollte nur verwendet werden, wenn man ganz genau weiss,
+ // was man macht:
+ sal_uInt32 GetOrdNumDirect() const;
+
+ // Das Setzen der Ordnungsnummer sollte nur vom Model bzw. von der Page
+ // geschehen.
+ void SetOrdNum(sal_uInt32 nNum);
+
+ /** 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 (void);
+
+ /** 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);
+
+ // #111111#
+ // 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 Rectangle& GetCurrentBoundRect() const;
+
+ // #111111#
+ // 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 Rectangle& GetLastBoundRect() const;
+
+ virtual void RecalcBoundRect();
+
+ void BroadcastObjectChange() const;
+
+ // Modified-Flag am Model setzen
+ virtual void SetChanged();
+
+ // Tooling for painting a single object to a OutputDevice. This will be needed as long
+ // as not all painting is changed to use DrawContact objects.
+ bool SingleObjectPainter(OutputDevice& rOut) const;
+ bool LineGeometryUsageIsNecessary() const;
+
+ /**
+ Returns a copy of the object. Every inherited class must reimplement this (in class Foo
+ it should be sufficient to do "virtual Foo* Clone() const { return CloneHelper< Foo >(); }".
+ Note that this function uses operator= internally.
+ */
+ virtual SdrObject* Clone() const;
+ /**
+ Implemented mainly for the purposes of Clone().
+ */
+ SdrObject& operator=(const SdrObject& rObj);
+
+ // TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ // Das Xor-Polygon wird von der View zu Draggen des Objektes benoetigt.
+ // Alle Polygone innerhalb des PolyPolygon werden als PolyLine interpretiert.
+ // Moechte man ein geschlossenes Polygon, so muss man es explizit schliessen.
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+
+ // Die Kontur fuer TextToContour
+ virtual basegfx::B2DPolyPolygon TakeContour() const;
+
+ // Ueber GetHdlCount gibt ein Objekt die Anzahl seiner Handles preis.
+ // Im Normalfall werden dies 8 sein, bei einer Strecke 2. Bei Polygonobjekten
+ // (Polygon,Spline,Bezier) kann die Handleanzahl wesentlich groesser werden.
+ // Polygonobjekten wird ausserdem die Moeglichkeit eingeraeumt einen Punkt
+ // eines selektierten Objekts zu selektieren. Das Handle dieses Punktes wird
+ // dann durch einen Satz neuer Handles ausgetauscht (PlusHdl). Bei einem
+ // Polygon wird das wohl ein einfacher Selektionshandle sein, bei einer
+ // Bezierkurve dagegen koennen das schon bis zu 3 Handles werden (inkl Gewichte).
+ // GetHdl() und GetPlusHdl() muessen Handleinstanzen mit new erzeugen!
+ // Ein Objekt, das bei HasSpacialDrag() true liefert muss diese Methoden
+ // zur Verfuegung stellen (inkl. FillHdlList).
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+ virtual sal_uInt32 GetPlusHdlCount(const SdrHdl& rHdl) const;
+ virtual SdrHdl* GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlNum) const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
+
+ // Die Standardtransformationen (Move,Resize,Rotate,Mirror,Shear) werden von der
+ // View uebernommen (TakeXorPoly(),...).
+ // Objektspeziefisches draggen wie z.B. Eckenradius bei Rechtecken,
+ // Stuetzstellen bei Splines, Gewichte bei Bezierkurven und Pointer von
+ // Labelobjekten muss vom Objekt selbst gehandled werden. Um das Model
+ // Statusfrei zu halten werden die Statusdaten an der View gehalten und dem
+ // Objekt dann uebergeben. EndDrag liefrt im Normalfall true fuer Erfolg.
+ // false kann zurueckgegeben werden, wenn das Dragging das Objekt nicht
+ // veraendert hat, wobei dir evtl. Tatsache das die Maus nicht bewegt wurde
+ // bereits von der View abgefangen wird.
+ virtual bool hasSpecialDrag() const;
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+ virtual String 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 SdrObject* getFullDragClone() const;
+
+ // Jedes Objekt muss in der Lage sein sich selbst interaktiv zu erzeugen.
+ // Beim MausDown wird zunaechst ein neues Objekt erzeugt und dann seine
+ // BegCreate()-Methode gerufen. Bei jedem MausMode wird dann MovCreate
+ // gerufen. BrkCreate() bedeutet, dass der User die interaktive Objekt-
+ // erzeugung abgebrochen hat. EndCreate() wird gerufen beim MouseUp-Event.
+ // Liefert EndCreate() ein true, so ist die Objekterzeugung abgeschlossen;
+ // das Objekt wird in die entsprechende Liste eingefuegt. Andernfalls
+ // (EndCreate()==false) gehe ich davon aus, dass weitere Punkte zur
+ // Objekterzeugung notwendig sind (Polygon,...). Der Parameter eCmd
+ // enthaelt die Anzahl der Mausklicks (so die App diese durchreicht).
+ // BckCreate() -> Letztes EndCreate() rueckgaengig machen (z.B. letzten
+ // Polygonpunkt wieder loeschen).
+ // RetrunCode: true=Weiter gehts, false=Create dadurch abgebrochen.
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat); // TRUE=Xor muss repainted werden
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+ virtual void BrkCreate(SdrDragStat& rStat);
+
+ // damit holt man sich den Pointer, der das Createn dieses Objekts symbolisiert
+ virtual Pointer GetCreatePointer() const;
+
+ // Polygon das waehrend des Erzeugens aufgezogen wird
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+
+ // Die Methoden Move, Resize, Rotate, Mirror, Shear, SetSnapRect und
+ // SetLogicRect rufen jeweils die entsprechenden Nbc-Methoden, versenden einen
+ // Repaint-Broadcast und setzen den Modified-Status am Model. Abgeleitete
+ // Objekte sollten i.d.R. nur die Nbc-Methoden ueberladen.
+ // Nbc bedeutet: 'NoBroadcast'.
+ virtual void NbcMove (const Size& rSiz);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
+ virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
+ virtual void NbcShear (const Point& rRef, long nWink, 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 Rotate(const Point& rRef, long nWink, double sn, double cs);
+ virtual void Mirror(const Point& rRef1, const Point& rRef2);
+ virtual void Shear (const Point& rRef, long nWink, double tn, bool bVShear);
+
+ // Die relative Position eines Zeichenobjektes ist die Entfernung der
+ // linken oberen Eche des logisch umschliessenden Rechtecks (SnapRect)
+ // zum Anker.
+ 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);
+ virtual const Point& GetAnchorPos() const;
+
+ // Snap wird nicht auf dem BoundRect ausgefuehrt, sondern nach Moeglichkeit auf
+ // logischen Koordinaten (also ohne Beruecksichtigung von Strichstaerke, ... ).
+ // SetSnapRect() versucht das Objekt so hinzusizen, dass es in das uebergebene
+ // Rect passt (ohne Strichstaerke, ...)
+ virtual void RecalcSnapRect();
+ virtual const Rectangle& GetSnapRect() const;
+ virtual void SetSnapRect(const Rectangle& rRect);
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+
+ // Logic Rect: Beim Rect z.B. ohne Beruecksichtigung des Drehwinkels, Shear, ...
+ virtual const Rectangle& GetLogicRect() const;
+ virtual void SetLogicRect(const Rectangle& rRect);
+ virtual void NbcSetLogicRect(const Rectangle& rRect);
+
+ /** the defaul 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 Rectangle& rMaxRect, bool bShrinkOnly = false );
+
+ // Drehwinkel und Shear
+ virtual long GetRotateAngle() const;
+ virtual long GetShearAngle(bool bVertical = false) const;
+
+ // Zum Fangen von/auf ausgezeichneten Punkten eines Obj (Polygonpunkte,
+ // Kreismittelpunkt, ...)
+ virtual sal_uInt32 GetSnapPointCount() const;
+ virtual Point GetSnapPoint(sal_uInt32 i) const;
+
+ // Fuer Objekte, bei denen jeder einzelne Punkt verschoben werden kann,
+ // z.B. Polygone, Polylines, Linien, ... . Bei diesen Objekten werden
+ // Punkte selektiert (ggf. Mehrfachselektion), geloescht, eingefuegt,
+ // als Mehrfachselektion verschoben und gedreht, ...
+ // Nur solche Objekte koennen PlusHandles haben (z.B. die Gewichte an den
+ // Bezierkurven.
+ virtual sal_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);
+
+ // Alle geometrischen Daten holen fuer's 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;
+
+ // internal versions
+protected:
+ const SfxItemSet& GetObjectItemSet() const;
+ void SetObjectItem(const SfxPoolItem& rItem);
+ void SetObjectItemSet(const SfxItemSet& rSet);
+ const SfxPoolItem& GetObjectItem(const sal_uInt16 nWhich) const;
+
+public:
+ // syntactical sugar for ItemSet accesses
+ void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems = false);
+
+ // NotPersistAttr fuer Layer, ObjName, geometrische Transformationen, ...
+ void TakeNotPersistAttr(SfxItemSet& rAttr, bool bMerge) const;
+ void ApplyNotPersistAttr(const SfxItemSet& rAttr);
+ void NbcApplyNotPersistAttr(const SfxItemSet& rAttr);
+
+ // bDontRemoveHardAttr=FALSE: alle in der Vorlage gesetzten Attribute werden am
+ // Zeichenobjekt auf Default gesetzt; TRUE: alle harten Attribute bleiben erhalten.
+ void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
+ virtual void NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ SfxStyleSheet* GetStyleSheet() const;
+
+ // TextEdit
+ virtual bool HasTextEdit() const;
+
+ // Return==TRUE: TextEditMode gestartet
+ virtual sal_Bool BegTextEdit(SdrOutliner& rOutl);
+ virtual void EndTextEdit(SdrOutliner& rOutl);
+
+ // Text wird im Format des Outliners gehalten
+ // SetOutlinerParaObject: Eigentumsuebereignung von *pTextObject!
+ virtual void SetOutlinerParaObject(OutlinerParaObject* pTextObject);
+ virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
+ virtual OutlinerParaObject* GetOutlinerParaObject() const;
+ virtual void NbcReformatText();
+ virtual void ReformatText();
+
+ void BurnInStyleSheetAttributes();
+
+ // Macrofaehigkeit, z.B. ein Rechteck als PushButton.
+ virtual bool HasMacro() const;
+ virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec) const;
+ virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec) const;
+ virtual void PaintMacro (OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const;
+ virtual bool DoMacro (const SdrObjMacroHitRec& rRec);
+ virtual OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
+ bool IsMacroHit(const SdrObjMacroHitRec& rRec) const;
+
+ // Konnektoren. (siehe auch Dokumentation in SvdoEdge.HXX, SdrEdgeObj
+ // sowie SvdGlue.HXX und SvdGlEV.HXX)
+ // Es gibt Knoten und Kanten. Eine Kante kann theoretisch auch Knoten
+ // sein, das ist jedoch in dieser Version noch nicht implementiert.
+ // Ein Knoten hat eine Anzahl von Klebepunkten, wo Kanten angeklebt
+ // werden koennen.
+ // Eine Kante kann
+ // - ohne Verbindungen sein
+ // - an einem Ende auf der Wiese stehen und am anderen Ende an
+ // genau einem Knoten gebunden sein
+ // - an beiden Enden mit jeweils genau einem Knoten verbunden sein.
+ // Die Kante ist Listener bei seinen bis zu 2 Knoten.
+ // Wird der Knoten verschoben oder Resized, folgen alle angebundenen
+ // Kanten. Ebenso bei SetGluePoint()... am Knoten.
+ // Beim Verschieben/Resizen der Kante wird dagegen die Verbindung
+ // geloesst.
+ // Objekt ist ein Knoten?
+ virtual bool IsNode() const;
+
+ // Automatische Klebepunkte:
+ // je 4 Scheitelpunkt- und Eckpositionen muss ein Knotenobjekt liefern
+ // i.d.R. 0=oben, 1=rechts, 2=unten, 3=links
+ virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const;
+
+ // i.d.R. 0=linksoben, 1=rechtsoben, 2=rechtsunten, 3=linksunten
+ virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const;
+
+ // Liste aller Klebepunkte. Kann NULL sein.
+ virtual const SdrGluePointList* GetGluePointList() const;
+ //virtual SdrGluePointList* GetGluePointList();
+
+ // Nach veraendern der GluePointList muss man am Obj SendRepaintBroadcast rufen!
+ virtual SdrGluePointList* ForceGluePointList();
+
+ // Temporaer zu setzen fuer Transformationen am Bezugsobjekt
+ void SetGlueReallyAbsolute(bool bOn);
+ void NbcRotateGluePoints(const Point& rRef, long nWink, double sn, double cs);
+ void NbcMirrorGluePoints(const Point& rRef1, const Point& rRef2);
+ void NbcShearGluePoints (const Point& rRef, long nWink, double tn, bool bVShear);
+
+ // Objekt ist eine Kante?
+ virtual bool IsEdge() const;
+
+ // bTail1=TRUE: Linienanfang, sonst LinienEnde
+ // pObj=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 );
+
+ // Wenn ein Objekt in der Lage ist, sich in ein Polygon oder in eine
+ // Bezierkurve (oder beides) zu verwandeln, dann sollten die folgenden
+ // Methoden ueberladen werden.
+ // Z.B. Ein RectObj mit Strichstaerke 10, SOLID_PEN in Polygon wandeln:
+ // Im Modus bLineToArea=false soll ein PolyObj mit 4 Stuetzstellen,
+ // Strichstaerke 10 und SOLiD_PEN erzeugt werden.
+ // Im Modus bLineToArea=true dagegen soll das generierte Obj immer ein
+ // LinienAttribut NULL_PEN haben, und die Linie (auch Linienmuster) selbst
+ // durch Polygonflaechen emuliert werden, die dadurch anschliessend vom
+ // Anwender manipuliert werden koennen. Das RectObj kann sich somit also
+ // nur korrekt konvertieren, wenn es als Flaechenattribut NULL_BRUSH
+ // besitzt. Es muesste in diesem Fall dann:
+ // - SOLID_BRUSH mit der Farbe des gesetzten Pen setzen
+ // - NULL_PEN setzen
+ // - PolyPolygon mit 2 Polygonen zu je 4 Stuetzstellen generieren.
+ // Der Returnwert ist jeweils ein SdrObject*, da als Rueckgabe zur Not
+ // auch Gruppenobjekte erlaubt sind (z.B. fuer SdrTextObj).
+ // Bei der Konvertierung von TextObj nach PathObj wird es wohl so sein,
+ // dass beide Modi (bLineToArea=true/false) identisch sind.
+ // Defaulted sind diese Methoden auf "Ich kann das nicht" (FALSE/NULL).
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+ SdrObject* 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;
+ SdrObject* ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDash = false) const;
+
+ // TRUE: Referenz auf ein Obj
+ bool IsVirtualObj() const;
+
+ // true=Obj kann warsch. gefuellt werden; false=Obj kann warsch. Linienenden haben.
+ // ungueltig, wenn es sich um ein GroupObj handelt.
+ bool IsClosedObj() const;
+
+ bool IsEdgeObj() const;
+ bool Is3DObj() const;
+ bool IsUnoObj() const;
+ void SetMarkProtect(bool bProt);
+ bool IsMarkProtect() const;
+ void SetInserted(bool bIns);
+ bool IsInserted() const;
+ void SetMoveProtect(bool bProt);
+ bool IsMoveProtect() const;
+ void SetResizeProtect(bool bProt);
+ bool IsResizeProtect() const;
+ void SetPrintable(bool bPrn);
+ bool IsPrintable() const;
+ void SetVisible(bool bVisible);
+ bool IsVisible() const;
+ void SetEmptyPresObj(bool bEpt);
+ bool IsEmptyPresObj() const;
+ void SetNotVisibleAsMaster(bool bFlg);
+ bool IsNotVisibleAsMaster() const;
+
+ // #i25616#
+ bool LineIsOutsideGeometry() const;
+
+ // #i25616#
+ bool DoesSupportTextIndentingOnLineWidthChange() const;
+
+ // applikationsspeziefische Daten
+ sal_uInt16 GetUserDataCount() const;
+ SdrObjUserData* GetUserData(sal_uInt16 nNum) const;
+
+ void AppendUserData(SdrObjUserData* pData);
+
+ // Delete entfernt den Record aus der Liste und ruft
+ // ein delete (FreeMem+Dtor).
+ void DeleteUserData(sal_uInt16 nNum);
+
+ // ItemPool fuer dieses Objekt wechseln
+ void MigrateItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////////
+ // access to the UNO representation of the shape
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape();
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface > getWeakUnoShape() const { return maWeakUnoShape; }
+
+ static SdrObject* getSdrObjectFromXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xInt );
+
+ /** 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 com::sun::star::uno::Reference<
+ com::sun::star::uno::XInterface>& _rxUnoShape);
+
+ /** 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 ::com::sun::star::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 sal_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);
+
+ // #116168#
+ // 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 sence after the import is finished, since the object
+ // might be resized
+ Rectangle GetBLIPSizeRectangle() const;
+ void SetBLIPSizeRectangle( const Rectangle& aRect );
+
+protected:
+ /** 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 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxUnoShape );
+
+ /**
+ Helper function for reimplementing Clone().
+ */
+ template< typename T > T* CloneHelper() const;
+
+private:
+ /** only for internal use!
+ */
+ SvxShape* getSvxShape();
+
+ /** do not use directly, always use getSvxShape() if you have to! */
+ SvxShape* mpSvxShape;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface >
+ maWeakUnoShape;
+};
+
+//************************************************************
+// SdrDummyObj
+//
+// Wer sich eigene Objekte schafft muss einen Link in der Klasse
+// SdrObjFactory setzen. Der Handler hat folgendes aussehen:
+// void Hdl(SdrObjFactory*)
+// Er muss sich aus der uebergebenen Instanz die Werte nInventor und
+// nIdentifier ansehen und entsprechend mit new eine Zeichenobjektinstanz
+// erzeugen. Einen Zeiger auf diese Instanz hat er in der Membervariablen
+// pNewObj zu hinterlassen.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrObjFactory
+{
+public:
+ sal_uInt32 nInventor;
+ sal_uInt16 nIdentifier;
+
+ // fuer MakeNewObj():
+ SdrPage* pPage;
+ SdrModel* pModel;
+ SdrObject* pNewObj;
+
+ // fuer MakeNewObjUserData():
+ SdrObject* pObj;
+ SdrObjUserData* pNewData;
+
+private:
+ SVX_DLLPRIVATE SdrObjFactory(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pNewPage, SdrModel* pNewModel);
+
+public:
+ static SdrObject* MakeNewObject(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pPage, SdrModel* pModel=NULL);
+ static void InsertMakeObjectHdl(const Link& rLink);
+ static void RemoveMakeObjectHdl(const Link& rLink);
+ static void InsertMakeUserDataHdl(const Link& rLink);
+ static void RemoveMakeUserDataHdl(const Link& rLink);
+};
+
+typedef tools::WeakReference< SdrObject > SdrObjectWeakRef;
+
+template< typename T > T* SdrObject::CloneHelper() const
+{
+ OSL_ASSERT( typeid( T ) == typeid( *this ));
+ T* pObj = dynamic_cast< T* >( SdrObjFactory::MakeNewObject(GetObjInventor(),GetObjIdentifier(),NULL));
+ if (pObj!=NULL)
+ *pObj=*static_cast< const T* >( this );
+ return pObj;
+}
+
+#endif //_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 000000000000..54c67fb849f3
--- /dev/null
+++ b/include/svx/svdocapt.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 _SVDCAPT_HXX
+#define _SVDCAPT_HXX
+
+#include <svx/svdorect.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class ImpCaptParams;
+
+namespace sdr { namespace properties {
+ class CaptionProperties;
+}}
+
+//************************************************************
+// Hilfsklasse SdrCaptObjGeoData
+//************************************************************
+
+// #109872#
+class SdrCaptObjGeoData : public SdrTextObjGeoData
+{
+public:
+ Polygon aTailPoly;
+};
+
+//************************************************************
+// SdrCaptionObj
+//************************************************************
+
+class SVX_DLLPUBLIC SdrCaptionObj : public SdrRectObj
+{
+private:
+ // to allow sdr::properties::CaptionProperties access to ImpRecalcTail()
+ friend class sdr::properties::CaptionProperties;
+ friend class SdrTextObj; // fuer ImpRecalcTail() bei AutoGrow
+
+protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
+private:
+ Polygon aTailPoly; // das ganze Polygon des Schwanzes
+ sal_Bool mbSpecialTextBoxShadow; // for calc special shadow, default FALSE
+ sal_Bool mbFixedTail; // for calc note box fixed tail, default FALSE
+ Point maFixedTailPos; // for calc note box fixed tail position.
+
+private:
+ SVX_DLLPRIVATE void ImpGetCaptParams(ImpCaptParams& rPara) const;
+ SVX_DLLPRIVATE void ImpCalcTail1(const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const;
+ SVX_DLLPRIVATE void ImpCalcTail2(const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const;
+ SVX_DLLPRIVATE void ImpCalcTail3(const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const;
+ SVX_DLLPRIVATE void ImpCalcTail4(const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const;
+ SVX_DLLPRIVATE void ImpCalcTail (const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const;
+ SVX_DLLPRIVATE void ImpRecalcTail();
+
+public:
+ TYPEINFO();
+ SdrCaptionObj();
+ SdrCaptionObj(const Rectangle& rRect, const Point& rTail);
+ virtual ~SdrCaptionObj();
+
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual SdrCaptionObj* Clone() const;
+
+ // for calc: special shadow only for text box
+ void SetSpecialTextBoxShadow() { mbSpecialTextBoxShadow = sal_True; }
+ sal_Bool GetSpecialTextBoxShadow() const { return mbSpecialTextBoxShadow; }
+
+ // for calc: fixed note tail position.
+ void SetFixedTail() { mbFixedTail = sal_True; }
+
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+ virtual void SetModel(SdrModel* pNewModel);
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+
+ // special drag methods
+ virtual bool hasSpecialDrag() const;
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+ virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
+
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+ virtual void BrkCreate(SdrDragStat& rStat);
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+ virtual Pointer GetCreatePointer() const;
+
+ virtual void NbcMove(const Size& rSiz);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+
+ virtual void NbcSetRelativePos(const Point& rPnt);
+ virtual Point GetRelativePos() const;
+ virtual void NbcSetAnchorPos(const Point& rPnt);
+ virtual const Point& GetAnchorPos() const;
+
+ virtual void RecalcSnapRect();
+ virtual const Rectangle& GetSnapRect() const;
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+ virtual const Rectangle& GetLogicRect() const;
+ virtual void NbcSetLogicRect(const Rectangle& rRect);
+
+ virtual sal_uInt32 GetSnapPointCount() const;
+ virtual Point GetSnapPoint(sal_uInt32 i) const;
+
+protected:
+ virtual SdrObjGeoData* NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+
+public:
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+ 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);
+
+ inline 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 000000000000..d613327b309b
--- /dev/null
+++ b/include/svx/svdocirc.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 _SVDOCIRC_HXX
+#define _SVDOCIRC_HXX
+
+#include <svx/svdorect.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+namespace sdr { namespace properties {
+ class CircleProperties;
+}}
+
+//************************************************************
+// Hilfsklasse SdrCircObjGeoData
+//************************************************************
+
+// #109872#
+class SdrCircObjGeoData : public SdrTextObjGeoData
+{
+public:
+ long nStartWink;
+ long nEndWink;
+};
+
+//************************************************************
+// SdrCircObj
+//************************************************************
+
+class SVX_DLLPUBLIC SdrCircObj : public SdrRectObj
+{
+private:
+ // to allow sdr::properties::CircleProperties access to ImpSetAttrToCircInfo()
+ friend class sdr::properties::CircleProperties;
+
+ // only for SdrCircleAttributes
+ SdrObjKind GetCircleKind() const { return meCircleKind; }
+
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
+ SdrObjKind meCircleKind;
+ long nStartWink;
+ long nEndWink;
+
+ // bitfield
+ unsigned mbPolygonIsLine : 1;
+
+private:
+ SVX_DLLPRIVATE basegfx::B2DPolygon ImpCalcXPolyCirc(const SdrObjKind eKind, const Rectangle& rRect1, long nStart, long nEnd) const;
+ SVX_DLLPRIVATE void ImpSetCreateParams(SdrDragStat& rStat) const;
+ SVX_DLLPRIVATE void ImpSetAttrToCircInfo(); // Werte vom Pool kopieren
+ SVX_DLLPRIVATE void ImpSetCircInfoToAttr(); // Werte in den Pool kopieren
+
+ // Liefert sal_True, wenn das Painten ein XPolygon erfordert.
+ SVX_DLLPRIVATE bool PaintNeedsXPolyCirc() const; // PaintNeedsXPoly-> PaintNeedsXPolyCirc
+ SVX_DLLPRIVATE virtual void RecalcXPoly();
+
+protected:
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+public:
+ TYPEINFO();
+ SdrCircObj(SdrObjKind eNewKind); // Circ, CArc, Sect oder CCut
+ SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect);
+
+ // 0=0.00Deg=3h 9000=90.00Deg=12h 18000=180.00Deg=9h 27000=270.00Deg=6h
+ // Der Verlauf des Kreises von StartWink nach EndWink ist immer entgegen
+ // dem Uhrzeigersinn.
+ // Wenn nNewStartWink==nNewEndWink hat der Kreisbogen einen Verlaufswinkel
+ // von 0 Grad. Bei nNewStartWink+36000==nNewEndWink ist der Verlaufswinkel
+ // 360.00 Grad.
+ SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect, long nNewStartWink, long nNewEndWink);
+ virtual ~SdrCircObj();
+
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
+
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ virtual SdrCircObj* Clone() const;
+ virtual void RecalcSnapRect();
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+
+ virtual sal_uInt32 GetSnapPointCount() const;
+ virtual Point GetSnapPoint(sal_uInt32 i) const;
+
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+
+ // special drag methods
+ virtual bool hasSpecialDrag() const;
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+ virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
+
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+ virtual void BrkCreate(SdrDragStat& rStat);
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+ virtual Pointer GetCreatePointer() const;
+ virtual void NbcMove(const Size& aSiz);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
+ virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear);
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+protected:
+ virtual SdrObjGeoData* NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+public:
+ long GetStartWink() const { return nStartWink; }
+ long GetEndWink() const { return nEndWink; }
+
+};
+
+#endif //_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 000000000000..ea0968cd9487
--- /dev/null
+++ b/include/svx/svdoedge.hxx
@@ -0,0 +1,434 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDOEDGE_HXX
+#define _SVDOEDGE_HXX
+
+#include <svx/svdotext.hxx>
+#include <svx/svdglue.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class SdrDragMethod;
+class SdrPageView;
+
+namespace sdr { namespace properties {
+ class ConnectorProperties;
+}}
+
+//************************************************************
+// Hilfsklasse SdrObjConnection
+//************************************************************
+
+class SdrObjConnection
+{
+ friend class SdrEdgeObj;
+ friend class ImpEdgeHdl;
+ friend class SdrCreateView;
+
+protected:
+ Point aObjOfs; // Wird beim Draggen eines Knotens gesetzt
+ SdrObject* pObj; // Referenziertes Objekt
+ long nXDist; // Hor. Objektabstand wenn bXDistOvr=TRUE
+ long nYDist; // Vert. Objektabstand wenn bYDistOvr=TRUE
+ sal_uInt16 nConId; // Konnektornummer
+
+ // bitfield
+ unsigned bBestConn : 1; // sal_True= es wird der guenstigste Konnektor gesucht
+ unsigned bBestVertex : 1; // sal_True= es wird der guenstigste Scheitelpunkt zum konnekten gesucht
+ unsigned bXDistOvr : 1; // sal_True= Hor. Objektabstand wurde gedragt (Overwrite)
+ unsigned bYDistOvr : 1; // sal_True= Vert. Objektabstand wurde gedragt (Overwrite)
+ unsigned bAutoVertex : 1; // AutoConnector am Scheitelpunkt nCon
+ unsigned bAutoCorner : 1; // AutoConnector am Eckpunkt nCon
+
+public:
+ SdrObjConnection() { ResetVars(); }
+ SVX_DLLPUBLIC ~SdrObjConnection();
+
+ void ResetVars();
+ bool TakeGluePoint(SdrGluePoint& rGP, bool bSetAbsolutePos) const;
+
+ inline void SetBestConnection( sal_Bool rB ) { bBestConn = rB; };
+ inline void SetBestVertex( sal_Bool rB ) { bBestVertex = rB; };
+ inline void SetAutoVertex( sal_Bool rB ) { bAutoVertex = rB; };
+ inline void SetConnectorId( sal_uInt16 nId ) { nConId = nId; };
+
+ inline sal_Bool IsBestConnection() const { return bBestConn; };
+ inline sal_Bool IsBestVertex() const { return bBestVertex; };
+ inline sal_Bool IsAutoVertex() const { return bAutoVertex; };
+ inline sal_uInt16 GetConnectorId() const { return nConId; };
+ inline SdrObject* GetObject() const { return pObj; }
+};
+
+//************************************************************
+// Hilfsklasse SdrEdgeInfoRec
+//************************************************************
+
+enum SdrEdgeLineCode {OBJ1LINE2,OBJ1LINE3,OBJ2LINE2,OBJ2LINE3,MIDDLELINE};
+
+class SdrEdgeInfoRec
+{
+public:
+ // Die 5 Distanzen werden beim draggen bzw. per SetAttr gesetzt und von
+ // ImpCalcEdgeTrack ausgewertet. Per Get/SetAttr/Get/SetStyleSh werden
+ // jedoch nur 0-3 longs transportiert.
+ Point aObj1Line2;
+ Point aObj1Line3;
+ Point aObj2Line2;
+ Point aObj2Line3;
+ Point aMiddleLine;
+
+ // Nachfolgende Werte werden von ImpCalcEdgeTrack gesetzt
+ long nAngle1; // Austrittswinkel am Obj1
+ long nAngle2; // Austrittswinkel am Obj2
+ sal_uInt16 nObj1Lines; // 1..3
+ sal_uInt16 nObj2Lines; // 1..3
+ sal_uInt16 nMiddleLine; // 0xFFFF=keine, sonst Punktnummer des Linienbeginns
+ char cOrthoForm; // Form des Ortho-Verbindes, z.B. 'Z','U',I','L','S',...
+
+public:
+ SdrEdgeInfoRec()
+ : nAngle1(0),
+ nAngle2(0),
+ nObj1Lines(0),
+ nObj2Lines(0),
+ nMiddleLine(0xFFFF),
+ cOrthoForm(0)
+ {}
+
+ Point& ImpGetLineVersatzPoint(SdrEdgeLineCode eLineCode);
+ const Point& ImpGetLineVersatzPoint(SdrEdgeLineCode eLineCode) const { return ((SdrEdgeInfoRec*)this)->ImpGetLineVersatzPoint(eLineCode); }
+ sal_uInt16 ImpGetPolyIdx(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const;
+ bool ImpIsHorzLine(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const;
+ void ImpSetLineVersatz(SdrEdgeLineCode eLineCode, const XPolygon& rXP, long nVal);
+ long ImpGetLineVersatz(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const;
+};
+
+//************************************************************
+// Hilfsklasse SdrEdgeObjGeoData
+//************************************************************
+
+class SdrEdgeObjGeoData : public SdrTextObjGeoData
+{
+public:
+ SdrObjConnection aCon1; // Verbindungszustand des Linienanfangs
+ SdrObjConnection aCon2; // Verbindungszustand des Linienendes
+ XPolygon* pEdgeTrack;
+ sal_Bool bEdgeTrackDirty;// sal_True=Verbindungsverlauf muss neu berechnet werden.
+ sal_Bool bEdgeTrackUserDefined;
+ SdrEdgeInfoRec aEdgeInfo;
+
+public:
+ SdrEdgeObjGeoData();
+ virtual ~SdrEdgeObjGeoData();
+};
+
+//************************************************************
+// Hilfsklasse SdrEdgeObj
+//************************************************************
+
+class SVX_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 sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
+ SdrObjConnection aCon1; // Verbindungszustand des Linienanfangs
+ SdrObjConnection aCon2; // Verbindungszustand des Linienendes
+
+ XPolygon* pEdgeTrack;
+ sal_uInt16 nNotifyingCount; // Verrieglung
+ SdrEdgeInfoRec aEdgeInfo;
+
+ // bitfield
+ unsigned bEdgeTrackDirty : 1; // sal_True=Verbindungsverlauf muss neu berechnet werden.
+ unsigned bEdgeTrackUserDefined : 1;
+
+ // #109007#
+ // Bool to allow supporession of default connects at object
+ // inside test (HitTest) and object center test (see ImpFindConnector())
+ unsigned mbSuppressDefaultConnect : 1;
+
+ // #110649#
+ // Flag value for avoiding death loops when calculating BoundRects
+ // from circularly connected connectors. A coloring algorythm is used
+ // here. When the GetCurrentBoundRect() calculation of a SdrEdgeObj
+ // is running, the flag is set, else it is always sal_False.
+ unsigned mbBoundRectCalculationRunning : 1;
+
+public:
+ // #109007#
+ // Interface to default connect suppression
+ void SetSuppressDefaultConnect(sal_Bool bNew) { mbSuppressDefaultConnect = bNew; }
+ sal_Bool GetSuppressDefaultConnect() const { return mbSuppressDefaultConnect; }
+
+ // #110649#
+ sal_Bool IsBoundRectCalculationRunning() const { return mbBoundRectCalculationRunning; }
+
+protected:
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+ XPolygon ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, const Rectangle& rRect, const Point& rCenter) const;
+ void ImpRecalcEdgeTrack(); // Neuberechnung des Verbindungsverlaufs
+ XPolygon ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& rCon1, SdrObjConnection& rCon2, SdrEdgeInfoRec* pInfo) const;
+ XPolygon ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rectangle& rBoundRect1, const Rectangle& rBewareRect1,
+ const Point& rPt2, long nAngle2, const Rectangle& rBoundRect2, const Rectangle& rBewareRect2,
+ sal_uIntPtr* pnQuality, SdrEdgeInfoRec* pInfo) const;
+ static bool ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut=NULL);
+ sal_uInt16 ImpCalcEscAngle(SdrObject* pObj, const Point& aPt2) const;
+ void ImpSetTailPoint(bool bTail1, const Point& rPt);
+ void ImpUndirtyEdgeTrack(); // eventuelle Neuberechnung des Verbindungsverlaufs
+ void ImpDirtyEdgeTrack(); // invalidate connector path, so it will be recalculated next time
+ void ImpSetAttrToEdgeInfo(); // Werte vom Pool nach aEdgeInfo kopieren
+ void ImpSetEdgeInfoToAttr(); // Werte vom aEdgeInfo in den Pool kopieren
+
+public:
+ TYPEINFO();
+
+ SdrEdgeObj();
+ virtual ~SdrEdgeObj();
+
+ SdrObjConnection& GetConnection(bool bTail1) { return *(bTail1 ? &aCon1 : &aCon2); }
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual const Rectangle& GetCurrentBoundRect() const;
+ virtual const Rectangle& GetSnapRect() const;
+ virtual bool IsNode() const;
+ virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const;
+ virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const;
+ virtual const SdrGluePointList* GetGluePointList() const;
+ virtual SdrGluePointList* ForceGluePointList();
+ virtual bool IsEdge() const;
+
+ // bTail1=TRUE: Linienanfang, sonst LinienEnde
+ // pObj=NULL: Disconnect
+ void SetEdgeTrackDirty() { bEdgeTrackDirty=sal_True; }
+ void ConnectToNode(bool bTail1, SdrObject* pObj);
+ void DisconnectFromNode(bool bTail1);
+ SdrObject* GetConnectedNode(bool bTail1) const;
+ const SdrObjConnection& GetConnection(bool bTail1) const { return *(bTail1 ? &aCon1 : &aCon2); }
+ bool CheckNodeConnection(bool bTail1) const;
+
+ virtual void RecalcSnapRect();
+ virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
+ virtual SdrEdgeObj* Clone() const;
+ SdrEdgeObj& operator=(const SdrEdgeObj& rObj);
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ void SetEdgeTrackPath( const basegfx::B2DPolyPolygon& rPoly );
+ basegfx::B2DPolyPolygon GetEdgeTrackPath() const;
+
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+
+ // special drag methods
+ virtual bool hasSpecialDrag() const;
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+ virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
+
+ // FullDrag support
+ virtual SdrObject* getFullDragClone() const;
+
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+ virtual void NbcMove(const Size& aSize);
+ virtual void NbcResize(const Point& rRefPnt, const Fraction& aXFact, const Fraction& aYFact);
+
+ // #i54102# added rotate, mirrorn and shear support
+ virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
+ virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
+ virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear);
+
+ // #102344# Added missing implementation
+ virtual void NbcSetAnchorPos(const Point& rPnt);
+
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+ virtual void BrkCreate(SdrDragStat& rStat);
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+ virtual Pointer GetCreatePointer() const;
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+ virtual sal_uInt32 GetSnapPointCount() const;
+ virtual Point GetSnapPoint(sal_uInt32 i) const;
+ virtual sal_Bool IsPolyObj() const;
+ virtual sal_uInt32 GetPointCount() const;
+ virtual Point GetPoint(sal_uInt32 i) const;
+ virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i);
+
+ virtual SdrObjGeoData* NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+
+ /** 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( sal_Bool bTail ) const;
+ void SetTailPoint( sal_Bool bTail, const Point& rPt );
+ void setGluePointIndex( sal_Bool bTail, sal_Int32 nId = -1 );
+ sal_Int32 getGluePointIndex( sal_Bool bTail );
+
+ virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const;
+ virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
+
+ // for geometry access
+ ::basegfx::B2DPolygon getEdgeTrack() const;
+
+ // helper method for SdrDragMethod::AddConnectorOverlays. Adds a overlay polygon for
+ // this connector to rResult.
+ basegfx::B2DPolygon ImplAddConnectorOverlay(SdrDragMethod& rDragMethod, bool bTail1, bool bTail2, bool bDetail) const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Zur Bestimmung der Verlaufslinie werden folgende Item-Parameter des SdrItemPool verwendet:
+//
+// sal_uInt16 EdgeFlowAngle Default 9000 (=90.00 Deg), min 0, max 9000
+// Verlauffreiheitswinkel.
+// Der Winkel, in dem die Verbindungslinie verlaufen darf.
+//
+// sal_uInt16 EdgeEscAngle Default 9000 (=90.00 Deg), min 0, max 9000
+// Objektaustrittswinkel.
+// Der Winkel, in dem die Verbindungslinie aus dem Objekt austreten darf.
+//
+// sal_Bool EdgeEscAsRay Default FALSE
+// sal_True= die Verbindungslinie tritt aus dem Obj Strahlenfoermig aus.
+// Also Winkelvorgabe durch die Strecke ObjMitte/Konnektor.
+//
+// sal_Bool EdgeEscUseObjAngle Default FALSE
+// Objektdrehwinkelberuecksichtigung.
+// sal_True= Bei der Bestimmung des Objektaustrittswinkels wird der
+// Drehwinkel des Objekts als Offset beruecksichtigt.
+//
+// sal_uIntPtr EdgeFlowDefDist Default 0, min 0, max ?
+// Das ist der Default-Mindestabstand der bei der Berechnung der
+// Verbindungslinie zu den angedockten Objekten in logischen Einheiten.
+// Dieser Abstand wird innerhalb des Objektes "ueberschrieben", sobald
+// der User an den Linien draggd. Beim Andocken an ein neues Objekt wird
+// dann jedoch wieder dieser Default verwendet.
+//
+//
+// Allgemeines zu Konnektoren:
+//
+// Es gibt Knoten und Kantenobjekte. Zwei Knoten koennen durch eine Kante
+// miteinander verbunden werden. Ist eine Kante nur an einem Ende an einen
+// Knoten geklebt, ist das andere Ende auf einer absoluten Position im Doc
+// fixiert. Ebenso ist es natuerlich auch moeglich, dass eine Kante an beiden
+// Enden "frei", also nicht mit einem Knotenobjekt verbunden ist.
+//
+// Ein Kantenobjekt kann theoretisch auch gleichzeitig Knotenobjekt sein. In
+// der ersten Version wird das jedoch noch nicht realisiert werden.
+//
+// Eine Verbindung zwischen Knoten und Kante kann hergestellt werden durch:
+// - Interaktives erzeugen eines neuen Kantenobjekts an der SdrView wobei
+// Anfangs- bzw. Endpunkt der Kante auf ein Konnektor (Klebestelle) eines
+// bereits vorhandenen Knotenobjekts gelegt wird.
+// - Interaktives draggen des Anfangs- bzw. Endpunkts eines bestehenden
+// Kantenobjekts an der SdrView auf ein Konnektor (Klebestelle) eines
+// bereits vorhandenen Knotenobjekts.
+// - Undo/Redo
+// Verschieben von Knotenobjekten stellt keine Verbindungen her. Ebenso auch
+// nicht das direkte Verschieben von Kantenendpunkten am SdrModel...
+// Verbindungen koennen auch hergestellt werden, wenn die Konnektoren an der
+// View nicht sichtbar geschaltet sind.
+//
+// Eine vorhandene Verbindung zwischen Knoten und Kante bleibt erhalten bei:
+// - Draggen (Move/Resize/Rotate/...) des Knotenobjekts
+// - Verschieben einer Konnektorposition im Knotemobjekt
+// - gleichzeitiges Draggen (Move/Resize/Rotate/...) von Knoten und Kante
+//
+// Eine Verbindung zwischen Knoten und Kante kann geloesst werden durch:
+// - Loeschen eines der Objekte
+// - Draggen des Kantenobjekts ohne gleichzeitiges Draggen des Knotens
+// - Loeschen des Konnektors am Knotenobjekt
+// - Undo/Redo/Repeat
+// Beim Draggen muss die Aufforderung zum loesen der Verbindung von ausserhalb
+// des Models befohlen werden (z.B. von der SdrView). SdrEdgeObj::Move() loesst
+// die Verbindung nicht selbsttaetig.
+//
+// Jedes Knotenobjekt kann Konnektoren, sog. Klebestellen besitzen. Das sind die
+// geometrischen Punkte, an denen das verbindende Kantenobjekt bei hergestellter
+// Verbindung endet. Defaultmaessig hat jedes Objekt keine Konnektoren. Trotzdem
+// kann man bei bestimmten View-Einstellungen eine Kante andocken, da dann z.B.
+// an den 4 Scheitelpunkten des Knotenobjekts bei Bedarf automatisch Konnektoren
+// generiert werden. Jedes Objekt liefert dafuer 2x4 sog. Default-Konnektorposi-
+// tionen, 4 an den Scheitelpunkten und 4 an den Eckpositionen. Im Normalfall
+// liegen diese an den 8 Handlepositionen; Ausnahmen bilden hier Ellipsen,
+// Parallelogramme, ... . Darueberhinaus koennen auch an jedem Knotenobjekt
+// anwenderspeziefische Konnektoren gesetzt werden.
+//
+// Dann gibt es noch die Moeglichkeit, ein Kante an einem Objekt mit dem
+// Attribut "bUseBestConnector" anzudocken. Es wird dann aus dem Angebot der
+// Konnektoren des Objekts oder/und der Scheitelpunkte, jeweils die fuer den
+// Verlauf der Verbindungslinie guenstigste Konnektorposition verwendet. Der
+// Anwender vergibt dieses Attribut, indem er den Knoten in seiner Mitte
+// andockt (siehe z.B. Visio).
+// 09-06-1996: bUseBestConnector verwendet nur Scheitelpunktklebepunkte.
+//
+// Und hier noch etwas Begriffsdefinition:
+// Verbinder : Eben das Verbinderobjekt (Kantenobjekt)
+// Knoten : Ein beliebiges Objekt, an dem ein Verbinder drangeklebt
+// werden kann, z.B. ein Rechteck, ...
+// Klebepunkt: Der Punkt, an dem der Verbinder an das Knotenobjekt
+// geklebt wird. Hierbei gibt es:
+// Scheitelpunktklebepunkte: Jedes Knotenobjekt hat diese
+// Klebepunkte von Natur aus. Moeglicherweise gibt es
+// im Draw bereits die Option "Automatisch ankleben an
+// Objektscheitelpunkte" (default an)
+// Eckpunktklebepunkte: Auch diese Klebepunkte sind den
+// Objekten von mir bereits mitgegeben. Wie die oben
+// erwaehnten gibt es fuer diese moeglicherweise
+// bereits auch eine Option im Draw. (default aus)
+// Scheitelpunktklebepunkte und Eckpunktklebepunkte sind
+// im Gegensatz zu Visio nicht optisch sichtbar; sie
+// sind eben einfach da (wenn Option eingeschaltet).
+// Benutzerdefinierte Klebepunkte: Gibt es an jedem
+// Knotenobjekt beliebig viele. Per Option koennen sie
+// sichtbar geschaltet werden (beim editieren immer
+// sichtbar). Zur Zeit sind die jedoch noch nicht ganz
+// fertigimplementiert.
+// Automatische Klebepunktwahl: Wird der Verbinder so an
+// das Knotenobjekt gedockt, dass der schwarke Rahmen
+// das gesamte Objekt umfasst, so versucht der
+// Verbinder von den 4 Scheitelpunktklebepunkten (und
+// zwar nur von denen) den guenstigsten herauszufinden.
+//
+//////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..036a83e6144a
--- /dev/null
+++ b/include/svx/svdograf.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 _SVDOGRAF_HXX
+#define _SVDOGRAF_HXX
+
+#include <com/sun/star/io/XInputStream.hpp>
+#include <vcl/graph.hxx>
+#include <svx/svdorect.hxx>
+#include <svtools/grfmgr.hxx>
+#include "svx/svxdllapi.h"
+
+namespace sdr
+{
+ namespace properties
+ {
+ class GraphicProperties;
+ } // end of namespace properties
+ namespace contact
+ {
+ class ViewObjectContactOfGraphic;
+ } // end of namespace contact
+} // end of namespace sdr
+
+#define SDRGRAFOBJ_TRANSFORMATTR_NONE 0x00000000UL
+#define SDRGRAFOBJ_TRANSFORMATTR_COLOR 0x00000001UL
+#define SDRGRAFOBJ_TRANSFORMATTR_MIRROR 0x00000002UL
+#define SDRGRAFOBJ_TRANSFORMATTR_ROTATE 0x00000004UL
+#define SDRGRAFOBJ_TRANSFORMATTR_ALL 0xffffffffUL
+
+class SdrGrafObjGeoData : public SdrTextObjGeoData
+{
+public:
+ sal_Bool bMirrored;
+
+ SdrGrafObjGeoData()
+ : bMirrored(false)
+ {
+ }
+};
+
+class GraphicObject;
+class SdrGraphicLink;
+
+/**
+ * This class represents an embedded or linked bitmap graphic object.
+ */
+class SVX_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 SdrGraphicLink;
+
+private:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
+ void ImpSetAttrToGrafInfo(); // Werte vom Pool kopieren
+ GraphicAttr aGrafInfo;
+
+ OUString aFileName; // Wenn es sich um einen Link handelt, steht hier der Dateiname drin.
+ OUString aFilterName;
+ GraphicObject* pGraphic; // Zur Beschleunigung von Bitmapausgaben, besonders von gedrehten.
+ GraphicObject* mpReplacementGraphic;
+ SdrGraphicLink* pGraphicLink; // Und hier noch ein Pointer fuer gelinkte Grafiken
+ bool bMirrored:1; // True bedeutet, die Grafik ist horizontal, d.h. ueber die Y-Achse gespiegelt auszugeben.
+
+ // #111096#
+ // Flag for allowing text animation. Default is sal_true.
+ bool mbGrafAnimationAllowed:1;
+
+ // #i25616#
+ bool mbInsidePaint:1;
+ bool mbIsPreview:1;
+
+private:
+
+ void ImpLinkAnmeldung();
+ void ImpLinkAbmeldung();
+ bool ImpUpdateGraphicLink( bool bAsynchron = true ) const;
+ void ImpSetLinkedGraphic( const Graphic& rGraphic );
+ DECL_LINK( ImpSwapHdl, GraphicObject* );
+ void onGraphicChanged();
+
+public:
+ TYPEINFO();
+
+ SdrGrafObj();
+ SdrGrafObj(const Graphic& rGrf);
+ SdrGrafObj(const Graphic& rGrf, const Rectangle& rRect);
+ virtual ~SdrGrafObj();
+
+ 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( sal_uIntPtr nTransformFlags = SDRGRAFOBJ_TRANSFORMATTR_ALL ) const;
+
+ GraphicType GetGraphicType() const;
+
+ // #111096#
+ // Keep ATM for SD.
+ bool IsAnimated() const;
+ bool IsEPS() const;
+ bool IsSwappedOut() const;
+
+ const MapMode& GetGrafPrefMapMode() const;
+ const Size& GetGrafPrefSize() const;
+
+ void SetGrafStreamURL( const String& rGraphicStreamURL );
+ String GetGrafStreamURL() const;
+
+ void ForceSwapIn() const;
+ void ForceSwapOut() const;
+
+ void SetGraphicLink(const OUString& rFileName, const String& rFilterName);
+ void ReleaseGraphicLink();
+ bool IsLinkedGraphic() const;
+
+ const OUString& GetFileName() const;
+ const OUString& GetFilterName() const;
+
+ void StartAnimation(OutputDevice* pOutDev, const Point& rPoint, const Size& rSize, long nExtraData=0L);
+
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ // #i25616#
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+
+ virtual SdrGrafObj* Clone() const;
+ SdrGrafObj& operator=(const SdrGrafObj& rObj);
+
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
+ virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
+ virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear);
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+ virtual void NbcSetLogicRect(const Rectangle& rRect);
+ virtual SdrObjGeoData* NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+
+ bool HasGDIMetaFile() const;
+
+ virtual void SetPage(SdrPage* pNewPage);
+ virtual void SetModel(SdrModel* pNewModel);
+
+ bool isEmbeddedSvg() const;
+ GDIMetaFile getMetafileFromEmbeddedSvg() const;
+
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+ virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+ bool IsMirrored() const;
+ void SetMirrored( bool _bMirrored );
+
+ // #111096#
+ // Access to GrafAnimationAllowed flag
+ void SetGrafAnimationAllowed(bool bNew);
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > getInputStream();
+
+ // #i103116# FullDrag support
+ virtual SdrObject* getFullDragClone() const;
+};
+
+#endif //_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 000000000000..57842579b54e
--- /dev/null
+++ b/include/svx/svdogrp.hxx
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDOGRP_HXX
+#define _SVDOGRP_HXX
+
+#include <svx/svdobj.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class SdrObjList;
+class SdrObjListIter;
+class SfxItemSet;
+
+//************************************************************
+// SdrObjGroup
+//************************************************************
+
+class SVX_DLLPUBLIC SdrObjGroup : public SdrObject
+{
+private:
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
+ SdrObjList* pSub; // Subliste (Kinder)
+ long nDrehWink;
+ long nShearWink;
+
+ Point aRefPoint; // Referenzpunkt innerhalb der Objektgruppe
+ bool bRefPoint; // Ist ein RefPoint gesetzt?
+
+public:
+ TYPEINFO();
+ SdrObjGroup();
+ virtual ~SdrObjGroup();
+
+ virtual void SetBoundRectDirty();
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual SdrLayerID GetLayer() const;
+ virtual void NbcSetLayer(SdrLayerID nLayer);
+ virtual void SetObjList(SdrObjList* pNewObjList);
+ virtual void SetPage(SdrPage* pNewPage);
+ virtual void SetModel(SdrModel* pNewModel);
+ virtual bool HasRefPoint() const;
+ virtual Point GetRefPoint() const;
+ virtual void SetRefPoint(const Point& rPnt);
+ virtual SdrObjList* GetSubList() const;
+
+ virtual const Rectangle& GetCurrentBoundRect() const;
+ virtual const Rectangle& GetSnapRect() const;
+
+ virtual SdrObjGroup* Clone() const;
+ SdrObjGroup& operator=(const SdrObjGroup& rObj);
+
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ virtual void RecalcSnapRect();
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+
+ // special drag methods
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+
+ virtual bool BegCreate(SdrDragStat& rStat);
+
+ virtual long GetRotateAngle() const;
+ virtual long GetShearAngle(bool bVertical = false) const;
+
+ virtual void Move(const Size& rSiz);
+ virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true);
+ virtual void Rotate(const Point& rRef, long nWink, double sn, double cs);
+ virtual void Mirror(const Point& rRef1, const Point& rRef2);
+ virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear);
+ virtual void SetAnchorPos(const Point& rPnt);
+ virtual void SetRelativePos(const Point& rPnt);
+ virtual void SetSnapRect(const Rectangle& rRect);
+ virtual void SetLogicRect(const Rectangle& rRect);
+
+ virtual void NbcMove(const Size& rSiz);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
+ virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
+ virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear);
+ virtual void NbcSetAnchorPos(const Point& rPnt);
+ virtual void NbcSetRelativePos(const Point& rPnt);
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+ virtual void NbcSetLogicRect(const Rectangle& rRect);
+
+ virtual void NbcReformatText();
+ virtual void ReformatText();
+
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+};
+
+#endif //_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 000000000000..439ceb25682d
--- /dev/null
+++ b/include/svx/svdomeas.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 _SVDOMEAS_HXX
+#define _SVDOMEAS_HXX
+
+#include <svx/svdotext.hxx>
+#include "svx/svxdllapi.h"
+#include <editeng/measfld.hxx>
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class SdrOutliner;
+struct ImpMeasureRec;
+struct ImpMeasurePoly;
+
+namespace sdr { namespace properties {
+ class MeasureProperties;
+}}
+
+//************************************************************
+// Hilfsklasse SdrMeasureObjGeoData
+//************************************************************
+
+class SdrMeasureObjGeoData : public SdrTextObjGeoData
+{
+public:
+ Point aPt1;
+ Point aPt2;
+
+public:
+ SdrMeasureObjGeoData();
+ virtual ~SdrMeasureObjGeoData();
+};
+
+//************************************************************
+// SdrMeasureObj
+//************************************************************
+
+class SVX_DLLPUBLIC SdrMeasureObj : public SdrTextObj
+{
+private:
+ // to allow sdr::properties::MeasureProperties access to SetTextDirty()
+ friend class sdr::properties::MeasureProperties;
+
+ friend class SdrMeasureField;
+
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
+ Point aPt1;
+ Point aPt2;
+ bool bTextDirty;
+
+protected:
+ void ImpTakeAttr(ImpMeasureRec& rRec) const;
+ void TakeRepresentation( XubString& rStr, SdrMeasureFieldKind eMeasureFieldKind ) const;
+ void ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol) const;
+ basegfx::B2DPolyPolygon ImpCalcXPoly(const ImpMeasurePoly& rPol) const;
+ void ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) const;
+ void SetTextDirty() { bTextDirty=sal_True; SetTextSizeDirty(); if (!aOutRect.IsEmpty()) { SetBoundRectDirty(); SetRectsDirty(sal_True); } }
+ void UndirtyText() const;
+
+ virtual SdrObjGeoData* NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+
+public:
+ TYPEINFO();
+ SdrMeasureObj();
+ SdrMeasureObj(const Point& rPt1, const Point& rPt2);
+ virtual ~SdrMeasureObj();
+
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
+ virtual SdrMeasureObj* Clone() const;
+
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+
+ // special drag methods
+ virtual bool hasSpecialDrag() const;
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+ virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
+
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+ virtual void BrkCreate(SdrDragStat& rStat);
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+ virtual Pointer GetCreatePointer() const;
+
+ virtual void NbcMove(const Size& rSiz);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
+ virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
+ virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear);
+ virtual long GetRotateAngle() const;
+ virtual void RecalcSnapRect();
+
+ virtual sal_uInt32 GetSnapPointCount() const;
+ virtual Point GetSnapPoint(sal_uInt32 i) const;
+
+ virtual sal_Bool IsPolyObj() const;
+ virtual sal_uInt32 GetPointCount() const;
+ virtual Point GetPoint(sal_uInt32 i) const;
+ virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i);
+
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+ virtual sal_Bool BegTextEdit(SdrOutliner& rOutl);
+ virtual const Size& GetTextSize() const;
+ virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, bool bNoEditText = false,
+ Rectangle* pAnchorRect=NULL, bool bLineWidth = true ) const;
+ virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const;
+ virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
+ virtual sal_uInt16 GetOutlinerViewAnchorMode() const;
+ virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
+ virtual OutlinerParaObject* GetOutlinerParaObject() const;
+
+ virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
+ bool bEdit, Color*& rpTxtColor, Color*& rpFldColor, String& rRet) const;
+
+ // #i97878#
+ virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const;
+ virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Creating:
+// ~~~~~~~~~
+// Dragging von Bezugspunkt 1 zu Bezugspunkt 2 -> Bezugskante
+//
+// Die Defaults:
+// ~~~~~~~~~~~~~
+// Masslinie und Masshilfslinien: Haarlinien solid schwarz
+// Pfeile: 2mm x 4mm
+// Textgroesse
+// ___
+// | Masszahl | 2mm
+// |<--------------------->|---
+// | | 8mm
+// | |
+// Pt1============# Pt2-- <----Bezugskante (von Pt1 nach Pt2)
+// # # |___ <- Ueberstand der Masshilfslinie(n)
+// # #=========#
+// # Zu bemassendes Objekt #
+// #=======================#
+//
+// Attribute:
+// ~~~~~~~~~~
+// 1. Wo steht der Text: mitte, rechts oder links (def=automatik)
+// 2. Text oberhalb der Linie oder unterhalb oder Linie unterbrochen durch Text (def=automatik)
+// 3. Den Abstand der Masslinie zur Bezugskante (=zum bemassten Objekt).
+// Default=8mm
+// 4. Masslinie unterhalb der Bezugskante (default=nein)
+// 5. Die Ueberlaenge(n) der Masshilfslinien ueber die Bezugskante (2x, default=0)
+// 6. Den Ueberhang der Masshilfslinien ueber die Masslinie (default=2mm)
+// 7. Den Abstand der Masshilfslinien zur Bezugskante
+//
+// Dragging: Handle Shift
+// ~~~~~~~~~
+// - Die Bezugspunkte SolidQuadHdl nur die Laenge
+// 1.+2. Anpacken des Textes
+// 3.+4. Hdl am Pfeil (2x) SolidQuadHdl nur den Bool
+// 5. Hdl am Endpunkt CircHdl beide Laengen?
+// 6.+7. Kein Dragging
+//
+// Offen:
+// ~~~~~~
+// - Radien (gleich als Typ verankern
+//
+// Special:
+// ~~~~~~~~
+// Connecting an max. 2 Objekte
+// -> Bei Copy, etc. den entspr. Code der Verbinder verwenden?!?
+// wird wohl recht kompliziert werden ...
+//
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..48a29cb029f7
--- /dev/null
+++ b/include/svx/svdomedia.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVDOMEDIA_HXX
+#define SVDOMEDIA_HXX
+
+#include <svx/svdorect.hxx>
+#include <avmedia/mediaitem.hxx>
+#include "svx/svxdllapi.h"
+
+class Graphic;
+
+namespace sdr { namespace contact { class ViewContactOfSdrMediaObj; } }
+
+// ---------------
+// - SdrMediaObj -
+// ---------------
+
+class SVX_DLLPUBLIC SdrMediaObj : public SdrRectObj
+{
+ friend class ::sdr::contact::ViewContactOfSdrMediaObj;
+
+public:
+
+ TYPEINFO();
+
+ SdrMediaObj();
+ SdrMediaObj( const Rectangle& rRect );
+
+ virtual ~SdrMediaObj();
+
+ virtual bool HasTextEdit() const;
+
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ virtual SdrMediaObj* Clone() const;
+ SdrMediaObj& operator=(const SdrMediaObj& rObj);
+
+ virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
+
+public:
+
+ void setURL( const OUString& rURL );
+ const OUString& getURL() const;
+
+ void setMediaProperties( const ::avmedia::MediaItem& rState );
+ const ::avmedia::MediaItem& getMediaProperties() const;
+
+ Size getPreferredSize() const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
+ getSnapshot();
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>
+ GetInputStream();
+
+protected:
+
+ virtual void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState );
+ virtual ::sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
+private:
+ struct Impl;
+ ::boost::scoped_ptr<Impl> m_pImpl;
+};
+
+#endif // 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 000000000000..ee5542c90def
--- /dev/null
+++ b/include/svx/svdoole2.hxx
@@ -0,0 +1,195 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDOOLE2_HXX
+#define _SVDOOLE2_HXX
+
+#include <svtools/embedhlp.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include "com/sun/star/awt/XWindow.hpp"
+#include <svx/svdorect.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/gdimtf.hxx>
+#include <sot/storage.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// SdrOle2Obj
+//************************************************************
+
+class SvxUnoShapeModifyListener;
+class SdrOle2ObjImpl;
+
+class SVX_DLLPUBLIC SdrOle2Obj : public SdrRectObj
+{
+private:
+
+ SVX_DLLPRIVATE void Connect_Impl();
+ SVX_DLLPRIVATE void Disconnect_Impl();
+ SVX_DLLPRIVATE void Reconnect_Impl();
+ SVX_DLLPRIVATE void AddListeners_Impl();
+ SVX_DLLPRIVATE void RemoveListeners_Impl();
+ SVX_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::datatransfer::XTransferable > GetTransferable_Impl() const;
+ SVX_DLLPRIVATE void GetObjRef_Impl();
+ SVX_DLLPRIVATE void SetGraphic_Impl(const Graphic* pGrf);
+
+ // #i118485# helper added
+ SdrObject* createSdrGrafObjReplacement(bool bAddText, bool bUseHCGraphic) const;
+
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
+ svt::EmbeddedObjectRef xObjRef;
+ Graphic* pGraphic;
+ String aProgName;
+
+ // wg. Kompatibilitaet erstmal am SdrTextObj
+ bool bFrame:1;
+ bool bInDestruction:1;
+ // #i118524#
+ bool mbSuppressSetVisAreaSize:1;
+ mutable bool m_bTypeAsked:1;
+ mutable bool m_bChart:1;
+
+ SdrOle2ObjImpl* mpImpl;
+
+ SvxUnoShapeModifyListener* pModifyListener;
+
+protected:
+
+ void ImpSetVisAreaSize();
+ void Init();
+
+public:
+ TYPEINFO();
+
+ SdrOle2Obj(bool bFrame_ = false);
+ SdrOle2Obj(const svt::EmbeddedObjectRef& rNewObjRef, const String& rNewObjName, const Rectangle& rNewRect, bool bFrame_ = false);
+ virtual ~SdrOle2Obj();
+
+ // access to svt::EmbeddedObjectRef
+ const svt::EmbeddedObjectRef& getEmbeddedObjectRef() const { return xObjRef; }
+
+ sal_Int64 GetAspect() const { return xObjRef.GetViewAspect(); }
+ bool isInplaceActive() const;
+ bool isUiActive() const;
+ void SetAspect( sal_Int64 nAspect );
+
+ // Ein OLE-Zeichenobjekt kann eine StarView-Grafik beinhalten.
+ // Diese wird angezeigt, wenn das OLE-Objekt leer ist.
+ void SetGraphic(const Graphic* pGrf);
+ 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* pTargetMapMode = NULL ) const;
+
+ // #i118524# Allow suppress SetVisAreaSize in changing methods when call
+ // comes from OLE client
+ void setSuppressSetVisAreaSize(bool bNew) { mbSuppressSetVisAreaSize = bNew; }
+
+ // OLE object has got a separate PersistName member now;
+ // !!! use ::SetPersistName( ... ) only, if you know what you do !!!
+ String GetPersistName() const;
+ void SetPersistName( const String& rPersistName );
+
+ // Einem SdrOle2Obj kann man ein Applikationsnamen verpassen, den man
+ // spaeter wieder abfragen kann (SD braucht das fuer Praesentationsobjekte).
+ void SetProgName(const String& rNam) { aProgName=rNam; }
+ const String& GetProgName() const { return aProgName; }
+ bool IsEmpty() const;
+
+ void SetObjRef(const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& rNewObjRef);
+ com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObjRef() const;
+
+ SVX_DLLPRIVATE com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObjRef_NoInit() const;
+
+ void AbandonObject();
+
+ virtual void SetPage(SdrPage* pNewPage);
+ virtual void SetModel(SdrModel* pModel);
+
+ /** Change the IsClosedObj attribute
+
+ @param bIsClosed
+ Whether the OLE object is closed, i.e. has opaque background
+ */
+ void SetClosedObj( bool bIsClosed );
+
+ // FullDrag support
+ virtual SdrObject* getFullDragClone() const;
+
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ SdrOle2Obj* Clone() const;
+ SdrOle2Obj& operator=(const SdrOle2Obj& rObj);
+
+ virtual void NbcMove(const Size& rSize);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+ virtual void NbcSetLogicRect(const Rectangle& rRect);
+ virtual void SetGeoData(const SdrObjGeoData& rGeo);
+
+ static sal_Bool CanUnloadRunningObj( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj,
+ sal_Int64 nAspect );
+ static sal_Bool Unload( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect );
+ sal_Bool Unload();
+ void Connect();
+ void Disconnect();
+ void ObjectLoaded();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getXModel() const;
+
+ // #109985#
+ sal_Bool IsChart() const;
+ sal_Bool IsCalc() const;
+
+ sal_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, const OUString& aMediaType );
+ void SetGraphicToObj( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xGrStream,
+ const OUString& aMediaType );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetParentXModel() const;
+ sal_Bool CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize );
+ sal_Bool AddOwnLightClient();
+
+ // handy to get the empty replacement bitmap without accessing all the old stuff
+ static Bitmap GetEmtyOLEReplacementBitmap();
+
+ void SetWindow(const com::sun::star::uno::Reference < com::sun::star::awt::XWindow >& _xWindow);
+
+ // #i118485# missing converter added
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+};
+
+#endif //_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 000000000000..2109dfbf9e54
--- /dev/null
+++ b/include/svx/svdopage.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 _SVDOPAGE_HXX
+#define _SVDOPAGE_HXX
+
+#include <svx/svdobj.hxx>
+#include <svx/sdrpageuser.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC SdrPageObj : public SdrObject, public sdr::PageUser
+{
+public:
+ // this method is called form the destructor of the referenced page.
+ // do all necessary action to forget the page. It is not necessary to call
+ // RemovePageUser(), that is done form the destructor.
+ virtual void PageInDestruction(const SdrPage& rPage);
+
+private:
+ // #111111#
+ // To make things more safe, remember the page, not a number
+ SdrPage* mpShownPage;
+
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
+public:
+ TYPEINFO();
+ SdrPageObj(SdrPage* pNewPage = 0L);
+ SdrPageObj(const Rectangle& rRect, SdrPage* pNewPage = 0L);
+ ~SdrPageObj();
+
+ // #111111#
+ SdrPage* GetReferencedPage() const;
+ void SetReferencedPage(SdrPage* pNewPage);
+
+ // #i96598#
+ virtual void SetBoundRectDirty();
+
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual SdrPageObj* Clone() const;
+ SdrPageObj& operator=(const SdrPageObj& rObj);
+
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..61f3c90720a8
--- /dev/null
+++ b/include/svx/svdopath.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 _SVDOPATH_HXX
+#define _SVDOPATH_HXX
+
+#include <svx/svdotext.hxx>
+#include <svx/xpoly.hxx>
+#include "svx/svxdllapi.h"
+#include <basegfx/vector/b2enums.hxx>
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class ImpPathForDragAndCreate;
+
+//************************************************************
+// Hilfsklasse SdrPathObjGeoData
+//
+// fuer Undo/Redo
+//
+//************************************************************
+
+class SdrPathObjGeoData : public SdrTextObjGeoData
+{
+public:
+ basegfx::B2DPolyPolygon maPathPolygon;
+ SdrObjKind meKind;
+
+ SdrPathObjGeoData();
+ virtual ~SdrPathObjGeoData();
+};
+
+//************************************************************
+// SdrPathObj
+//************************************************************
+
+class SVX_DLLPUBLIC SdrPathObj : public SdrTextObj
+{
+private:
+ friend class ImpPathForDragAndCreate;
+
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
+ basegfx::B2DPolyPolygon maPathPolygon;
+ SdrObjKind meKind;
+
+ // for isolation of old Drag/Create code
+ ImpPathForDragAndCreate* mpDAC;
+
+ // brightness - used in EnhancedCustomShapes2d.cxx for DARKEN[LESS] and LIGHTEN[LESS] segments implementation
+ double mdBrightness;
+
+protected:
+ // Hilfsfunktion fuer GET/SET/INS/etc. PNT
+ void ImpSetClosed(sal_Bool bClose);
+ void ImpForceKind();
+ void ImpForceLineWink();
+ ImpPathForDragAndCreate& impGetDAC() const;
+ void impDeleteDAC() const;
+
+public:
+ static sal_Bool ImpFindPolyPnt(const basegfx::B2DPolyPolygon& rPoly, sal_uInt32 nAbsPnt, sal_uInt32& rPolyNum, sal_uInt32& rPointNum);
+ virtual void SetRectsDirty(sal_Bool bNotMyself = sal_False);
+ double GetBrightness() { return mdBrightness; }
+
+public:
+ TYPEINFO();
+ SdrPathObj(SdrObjKind eNewKind);
+ SdrPathObj(SdrObjKind eNewKind, const basegfx::B2DPolyPolygon& rPathPoly, double dBrightness = 1.0);
+ virtual ~SdrPathObj();
+
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
+ virtual SdrPathObj* Clone() const;
+ SdrPathObj& operator=(const SdrPathObj& rObj);
+
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+ virtual void RecalcSnapRect();
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+ virtual sal_uInt32 GetPlusHdlCount(const SdrHdl& rHdl) const;
+ virtual SdrHdl* GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlNum) const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
+
+ // special drag methods
+ virtual bool hasSpecialDrag() const;
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+ virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
+ virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const;
+
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+ virtual void BrkCreate(SdrDragStat& rStat);
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+ Pointer GetCreatePointer() const;
+
+ // 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);
+ virtual void NbcResize(const Point& rRefPnt, const Fraction& aXFact, const Fraction& aYFact);
+ virtual void NbcRotate(const Point& rRefPnt, long nAngle, double fSin, double fCos);
+ virtual void NbcMirror(const Point& rRefPnt1, const Point& rRefPnt2);
+ virtual void NbcShear(const Point& rRefPnt, long nAngle, double fTan, bool bVShear);
+
+ virtual sal_uInt32 GetSnapPointCount() const;
+ virtual Point GetSnapPoint(sal_uInt32 i) const;
+
+ virtual sal_Bool IsPolyObj() const;
+ virtual sal_uInt32 GetPointCount() const;
+ virtual Point GetPoint(sal_uInt32 nHdlNum) const;
+ virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 nHdlNum);
+
+ // Punkt einfuegen
+ sal_uInt32 NbcInsPointOld(const Point& rPos, sal_Bool bNewObj, sal_Bool bHideHim);
+ sal_uInt32 NbcInsPoint(sal_uInt32 i, const Point& rPos, sal_Bool bNewObj, sal_Bool bHideHim);
+
+ // An diesem Punkt auftrennen
+ SdrObject* RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index);
+
+protected:
+ virtual SdrObjGeoData* NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+
+public:
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+ // Bezierpolygon holen/setzen
+ const basegfx::B2DPolyPolygon& GetPathPoly() const { return maPathPolygon; }
+ void SetPathPoly(const basegfx::B2DPolyPolygon& rPathPoly);
+ void NbcSetPathPoly(const basegfx::B2DPolyPolygon& rPathPoly);
+
+ // Spezialfunktionen fuer Bezierpolygon-Bearbeitung
+ sal_Bool IsClosed() const { return meKind==OBJ_POLY || meKind==OBJ_PATHPOLY || meKind==OBJ_PATHFILL || meKind==OBJ_FREEFILL || meKind==OBJ_SPLNFILL; }
+ sal_Bool IsLine() const { return meKind==OBJ_PLIN || meKind==OBJ_PATHPLIN || meKind==OBJ_PATHLINE || meKind==OBJ_FREELINE || meKind==OBJ_SPLNLINE || meKind==OBJ_LINE; }
+ sal_Bool IsFreeHand() const { return meKind==OBJ_FREELINE || meKind==OBJ_FREEFILL; }
+ sal_Bool IsBezier() const { return meKind==OBJ_PATHLINE || meKind==OBJ_PATHFILL; }
+ sal_Bool IsSpline() const { return meKind==OBJ_SPLNLINE || meKind==OBJ_SPLNFILL; }
+
+ // Pfad schliessen bzw. oeffnen; im letzteren Fall den Endpunkt um
+ // "nOpenDistance" verschieben
+ 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 sal_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);
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..f984bb2c68ad
--- /dev/null
+++ b/include/svx/svdorect.hxx
@@ -0,0 +1,126 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDORECT_HXX
+#define _SVDORECT_HXX
+
+#include <svx/svdotext.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class XPolygon;
+
+namespace sdr { namespace properties {
+ class RectangleProperties;
+}}
+
+//************************************************************
+// SdrRectObj
+//
+// Rechteck-Objekte (Rechteck,Kreis,...)
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrRectObj : public SdrTextObj
+{
+private:
+ // to allow sdr::properties::RectangleProperties access to SetXPolyDirty()
+ friend class sdr::properties::RectangleProperties;
+ friend class SdrTextObj; // wg SetXPolyDirty bei GrowAdjust
+
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
+ XPolygon* mpXPoly;
+
+protected:
+ XPolygon ImpCalcXPoly(const Rectangle& rRect1, long nRad1) const;
+ void SetXPolyDirty();
+
+ // RecalcXPoly sollte ueberladen werden. Dabei muss dann eine XPolygon
+ // Instanz generiert (new) und an mpXPoly zugewiesen werden.
+ virtual void RecalcXPoly();
+ const XPolygon& GetXPoly() const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+
+public:
+ TYPEINFO();
+ // Der Eckenradius-Parameter fliegt irgendwann raus. Der Eckenradius
+ // ist dann (spaeter) ueber SfxItems einzustellen (SetAttributes()).
+ // Konstruktion eines Rechteck-Zeichenobjekts
+
+ SdrRectObj();
+ SdrRectObj(const Rectangle& rRect);
+
+ SdrRectObj& operator=(const SdrRectObj& rCopy);
+
+ // Konstruktion eines Textrahmens
+ SdrRectObj(SdrObjKind eNewTextKind);
+ SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rRect);
+ virtual ~SdrRectObj();
+
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
+
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ virtual SdrRectObj* Clone() const;
+ virtual void RecalcSnapRect();
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+ virtual void NbcSetLogicRect(const Rectangle& rRect);
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+
+ // special drag methods
+ virtual bool hasSpecialDrag() const;
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+ virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
+
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+ virtual Pointer GetCreatePointer() const;
+
+ virtual void NbcMove(const Size& rSiz);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
+ virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
+ virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear);
+
+ virtual bool DoMacro(const SdrObjMacroHitRec& rRec);
+ virtual OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
+
+ virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const;
+ virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const;
+
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+};
+
+#endif //_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 000000000000..6ec0334c2d21
--- /dev/null
+++ b/include/svx/svdotable.hxx
@@ -0,0 +1,326 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_SVDOTABLE_HXX
+#define _SVX_SVDOTABLE_HXX
+
+#include <com/sun/star/text/WritingMode.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/table/XTable.hpp>
+#include <rtl/ref.hxx>
+#include "svdotext.hxx"
+#include "svx/svxdllapi.h"
+
+//------------------------------------------------------------------------
+
+class SvStream;
+class SfxStyleSheet;
+
+namespace sdr { namespace contact {
+ class ViewContactOfTableObj;
+}}
+
+namespace sdr { namespace table {
+
+class TableLayouter;
+struct ImplTableShadowPaintInfo;
+
+#ifndef CellRef
+ class Cell;
+ typedef rtl::Reference< Cell > CellRef;
+#endif
+
+//------------------------------------------------------------------------
+// SdrTableHitKind
+//------------------------------------------------------------------------
+
+enum TableHitKind
+{
+ SDRTABLEHIT_NONE,
+ SDRTABLEHIT_CELL,
+ SDRTABLEHIT_CELLTEXTAREA,
+ SDRTABLEHIT_HORIZONTAL_BORDER,
+ SDRTABLEHIT_VERTICAL_BORDER
+};
+
+//------------------------------------------------------------------------
+
+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 SVX_DLLPUBLIC 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 SVX_DLLPUBLIC SdrTableObj : public ::SdrTextObj
+{
+ friend class Cell;
+ friend class SdrTableObjImpl;
+
+public:
+ SdrTableObj(SdrModel* _pModel);
+ SdrTableObj(SdrModel* _pModel, const ::Rectangle& rNewRect, sal_Int32 nColumns, sal_Int32 nRows);
+ virtual ~SdrTableObj();
+
+ TYPEINFO();
+
+ // table stuff
+
+ SdrTableObj* CloneRange( const CellPos& rStartPos, const CellPos& rEndPos );
+ void DistributeColumns( sal_Int32 nFirstColumn, sal_Int32 nLastColumn );
+ void DistributeRows( sal_Int32 nFirstRow, sal_Int32 nLastRow );
+
+ com::sun::star::uno::Reference< com::sun::star::table::XTable > getTable() const;
+
+ bool isValid( const sdr::table::CellPos& rPos ) const;
+ CellPos getFirstCell() const;
+ 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, int nTol ) 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 getRowCount() const;
+ sal_Int32 getColumnCount() const;
+ void getCellBounds( const sdr::table::CellPos& rPos, ::Rectangle& rCellRect );
+
+ const SfxItemSet& GetActiveCellItemSet() const;
+
+ void setTableStyle( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xAutoFormatStyle );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& getTableStyle() const;
+
+ // text stuff
+
+ /** returns the currently active text. */
+ virtual SdrText* getActiveText() const;
+
+ /** returns the nth available text. */
+ virtual SdrText* getText( sal_Int32 nIndex ) const;
+
+ /** returns the number of texts available for this object. */
+ virtual sal_Int32 getTextCount() 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;
+
+ virtual bool HasText() const;
+ sal_Bool IsTextEditActive() const { return (pEdtOutl != 0L); }
+ bool IsTextEditActive( const sdr::table::CellPos& rPos );
+
+ /** returns true only if we are in edit mode and the user actually changed anything */
+ virtual bool IsRealyEdited() const;
+
+ // Gleichzeitig wird der Text in den Outliner gesetzt (ggf.
+ // der des EditOutliners) und die PaperSize gesetzt.
+ virtual void TakeTextRect( const sdr::table::CellPos& rPos, SdrOutliner& rOutliner, ::Rectangle& rTextRect, bool bNoEditText = false, ::Rectangle* pAnchorRect=NULL, bool bLineWidth = true ) const;
+ virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, bool bNoEditText = false, Rectangle* pAnchorRect=NULL, bool bLineWidth = true ) const;
+ virtual void TakeTextAnchorRect(const sdr::table::CellPos& rPos, ::Rectangle& rAnchorRect ) const;
+ virtual void TakeTextAnchorRect(::Rectangle& rAnchorRect) const;
+
+ virtual bool IsAutoGrowHeight() const;
+ long GetMinTextFrameHeight() const;
+ long GetMaxTextFrameHeight() const;
+ virtual bool IsAutoGrowWidth() const;
+ long GetMinTextFrameWidth() const;
+ long GetMaxTextFrameWidth() const;
+
+ virtual bool IsFontwork() const;
+
+ virtual void SetPage(SdrPage* pNewPage);
+ virtual void SetModel(SdrModel* pNewModel);
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual void SetChanged();
+
+ virtual bool AdjustTextFrameWidthAndHeight(Rectangle& rR, bool bHgt = true, bool bWdt = true) const;
+ virtual bool AdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+ virtual SdrTableObj* Clone() const;
+ SdrTableObj& operator=(const SdrTableObj& rObj);
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+ virtual basegfx::B2DPolyPolygon TakeContour() const;
+ virtual void RecalcSnapRect();
+ virtual const Rectangle& GetSnapRect() const;
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+
+ virtual const Rectangle& GetLogicRect() const;
+ virtual void NbcSetLogicRect(const Rectangle& rRect);
+ virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
+
+ virtual sal_uInt32 GetSnapPointCount() const;
+ virtual Point GetSnapPoint(sal_uInt32 i) const;
+
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
+
+ // special drag methods
+ virtual bool hasSpecialDrag() const;
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+ virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
+ virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const;
+
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+ virtual void BrkCreate(SdrDragStat& rStat);
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+ virtual Pointer GetCreatePointer() const;
+
+ virtual void NbcMove(const Size& rSiz);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+
+ virtual sal_Bool BegTextEdit(SdrOutliner& rOutl);
+ virtual void EndTextEdit(SdrOutliner& rOutl);
+ virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
+ virtual void TakeTextEditArea(const sdr::table::CellPos& rPos, Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
+ virtual sal_uInt16 GetOutlinerViewAnchorMode() const;
+
+ virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
+
+ virtual OutlinerParaObject* GetOutlinerParaObject() const;
+ virtual OutlinerParaObject* GetEditOutlinerParaObject() const;
+
+ virtual void NbcReformatText();
+ virtual void ReformatText();
+
+ void SetTextEditOutliner(SdrOutliner* pOutl) { pEdtOutl=pOutl; }
+
+ virtual sal_Bool IsVerticalWriting() const;
+ virtual void SetVerticalWriting(sal_Bool bVertical);
+
+ com::sun::star::text::WritingMode GetWritingMode() const;
+
+ virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus );
+
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // 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 sal_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);
+
+ // #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
+// virtual void RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>& rCharWhichIds );
+
+ /** hack for clipboard with calc and writer, export and import table content as rtf table */
+ static void ExportAsRTF( SvStream& rStrm, SdrTableObj& rObj );
+ static void ImportAsRTF( SvStream& rStrm, SdrTableObj& rObj );
+
+private:
+ void init( sal_Int32 nColumns, sal_Int32 nRows );
+
+protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
+ virtual SdrObjGeoData* NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+
+private:
+ SdrOutliner* GetCellTextEditOutliner( const ::sdr::table::Cell& rCell ) const;
+
+private:
+ // 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;
+
+ Rectangle maLogicRect;
+private:
+ SdrTableObjImpl* mpImpl;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+} }
+
+#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 000000000000..a5df49bdd24f
--- /dev/null
+++ b/include/svx/svdotext.hxx
@@ -0,0 +1,595 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDOTEXT_HXX
+#define _SVDOTEXT_HXX
+
+#include <vcl/field.hxx>
+#include <svx/itextprovider.hxx>
+#include <svx/svdoattr.hxx>
+#include <svx/svdtrans.hxx> // GeoStat
+#include <tools/datetime.hxx>
+#include <svx/xtextit0.hxx>
+#include "svdtext.hxx"
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include "svx/svxdllapi.h"
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <svx/svdpagv.hxx>
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class OutlinerParaObject;
+class SdrOutliner;
+class SdrTextObj;
+class SvxFieldItem;
+class ImpSdrObjTextLink;
+class EditStatus;
+
+namespace sdr { namespace properties {
+ class TextProperties;
+}}
+
+namespace drawinglayer { namespace primitive2d {
+ class SdrContourTextPrimitive2D;
+ class SdrPathTextPrimitive2D;
+ class SdrBlockTextPrimitive2D;
+ class SdrAutoFitTextPrimitive2D;
+ class SdrStretchTextPrimitive2D;
+}}
+
+namespace drawinglayer { namespace animation {
+ class AnimationEntryList;
+}}
+
+namespace drawinglayer { namespace geometry {
+ class ViewInformation2D;
+}}
+
+namespace sdr { namespace table {
+ class Cell;
+ class SdrTableRtfExporter;
+ class SdrTableRTFParser;
+}}
+
+//************************************************************
+// Defines
+//************************************************************
+
+#define SDRUSERDATA_OBJTEXTLINK (1)
+
+//************************************************************
+// Hilfsklasse SdrTextObjGeoData
+//************************************************************
+
+class SdrTextObjGeoData : public SdrObjGeoData
+{
+public:
+ Rectangle aRect;
+ GeoStat aGeo;
+};
+
+//************************************************************
+// Hilfsklasse ImpSdrObjTextLinkUserData
+//************************************************************
+
+class ImpSdrObjTextLinkUserData : public SdrObjUserData
+{
+ friend class SdrTextObj;
+ friend class ImpSdrObjTextLink;
+
+ SdrTextObj* pObj;
+ String aFileName; // Name des referenzierten Dokuments
+ String aFilterName; // ggf. ein Filter
+ DateTime aFileDate0; // Unnoetiges neuladen vermeiden
+ ImpSdrObjTextLink* pLink;
+ rtl_TextEncoding eCharSet;
+
+public:
+ TYPEINFO();
+ ImpSdrObjTextLinkUserData(SdrTextObj* pObj1);
+ virtual ~ImpSdrObjTextLinkUserData();
+
+ virtual SdrObjUserData* Clone(SdrObject* pObj1) const;
+};
+
+namespace sdr
+{
+ namespace properties
+ {
+ class CustomShapeProperties;
+ class CellProperties;
+ } // end of namespace properties
+} // end of namespace sdr
+
+//************************************************************
+// SdrTextObj
+//************************************************************
+
+class SVX_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;
+
+ // CustomShapeproperties need to access the "bTextFrame" member:
+ friend class sdr::properties::CustomShapeProperties;
+
+protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
+private:
+ // This method is only allowed for sdr::properties::TextProperties
+ SVX_DLLPRIVATE SdrOutliner* GetTextEditOutliner() const
+ {
+ return pEdtOutl;
+ }
+
+ // This method is only allowed for sdr::properties::TextProperties
+ SVX_DLLPRIVATE void SetPortionInfoChecked(sal_Bool bNew)
+ {
+ bPortionInfoChecked = bNew;
+ }
+
+ // 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; // fuer PowerPointImport
+ friend class SdrExchangeView; // fuer ImpGetDrawOutliner
+ friend class SdrView; // fuer ImpGetDrawOutliner
+ friend class SdrObjEditView; // fuer TextEdit
+ friend class SdrMeasureObj; // fuer ImpGetDrawOutliner
+ friend class SvxMSDffManager; // fuer ImpGetDrawOutliner
+ friend class SdrObjCustomShape;// fuer ImpGetDrawOutliner
+ friend class SdrText; // fuer ImpGetDrawOutliner
+
+protected:
+ // Das aRect ist gleichzeig auch das Rect vom RectObj und CircObj.
+ // Bei bTextFrame=sal_True wird der Text in dieses Rect hineinformatiert.
+ // Bei bTextFrame=sal_False wird der Text am Mittelpunkt des Rect zentriert.
+ Rectangle aRect;
+
+ // Der GeoStat enthaelt den Drehwinkel und einen Shearwinkel
+ GeoStat aGeo;
+
+ // this is the active text
+ SdrText* mpText;
+
+ // Hier merke ich mir die Ausmasse des Textes (n.i.)
+ Size aTextSize;
+
+ // Ein Outliner*, damit
+ // 1. das TextObj nicht von mehreren Views gleichzeitig editiert und
+ // 2. beim Streamen waerend des Editierens ein Flush() ausgefuehrt
+ // werden kann
+ SdrOutliner* pEdtOutl;
+
+ // Bei Fontwork muss soviel auf's BoundRect draufgerechnet werden
+ // damit es ausreichend gross ist.
+ Rectangle* pFormTextBoundRect;
+
+ // Moegliche Werte fuer eTextKind sind:
+ // OBJ_TEXT normaler Textrahmen
+ // OBJ_TEXTEXT Textfortsetzungsrahmen
+ // OBJ_TITLETEXT TitleText fuer StarDraw-Praesentation
+ // OBJ_OUTLINETEXT OutlineText fuer StarDraw-Praesentation
+ // eTextKind hat nur Bedeutung, wenn bTextFrame=sal_True, da es sich sonst
+ // um ein beschriftetes Grafikobjekt handelt.
+ SdrObjKind eTextKind;
+
+ // #108784#
+ // For text editing in SW Haeder/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;
+public:
+ const Point& GetTextEditOffset() const { return maTextEditOffset; }
+ void SetTextEditOffset(const Point& rNew) { maTextEditOffset = rNew; }
+
+protected:
+ // Fuer beschriftete Zeichenobjekte ist bTextFrame=FALSE. Der Textblock
+ // wird dann hoizontal und vertikal an aRect zentriert. Bei bTextFrame=
+ // sal_True wird der Text in aRect hineinformatiert. Der eigentliche Textrahmen
+ // ist durch ein SdrRectObj mit bTextFrame=sal_True realisiert.
+ sal_Bool bTextFrame : 1;
+ sal_Bool bPortionInfoChecked : 1; // Fuer Optimierung von Textobjekten
+ sal_Bool bNoShear : 1; // Obj darf nicht gesheart werden (->Graf+Ole+TextFrame)
+ sal_Bool bNoRotate : 1; // Obj darf nicht gedreht werden (->Ole)
+ sal_Bool bNoMirror : 1; // Obj darf nicht gespiegelt werden (->Ole,TextFrame)
+ sal_Bool bTextSizeDirty : 1;
+
+ // #101684#
+ sal_Bool mbInEditMode : 1; // Is this text obejct in edit mode?
+
+ // Fuer Objekt mit freier Groesse im Draw (Mengentext). Das Flag wird vom
+ // der App beim Create gesetzt.
+ // Wenn das Objekt dann spaeter in der Breite resized wird, wird
+ // AutoGrowWidth abgeschaltet (Hart auf sal_False attributiert). Das Flag wird
+ // dann ebenfalls auf sal_False gesetzt, sodass sich das Objekt anschliessend
+ // wie ein normales Textobjekt verhaelt.
+ // Resize in der Breite kann sein:
+ // - Interaktives Resize in Einfach- oder Mehrfachselektion
+ // - Positions+Groesse Dialog
+ sal_Bool bDisableAutoWidthOnDragging : 1;
+
+ // #111096#
+ // Allow text suppression
+ sal_Bool mbTextHidden : 1;
+
+ // #111096#
+ // Flag for allowing text animation. Default is sal_true.
+ sal_Bool mbTextAnimationAllowed : 1;
+
+ // flag for preventing recursive onEditOutlinerStatusEvent calls
+ sal_Bool mbInDownScale : 1;
+
+ SdrOutliner& ImpGetDrawOutliner() const;
+
+private:
+ SVX_DLLPRIVATE void ImpCheckMasterCachable();
+ // #101029#: Extracted from ImpGetDrawOutliner()
+ SVX_DLLPRIVATE void ImpInitDrawOutliner( SdrOutliner& rOutl ) const;
+ // #101029#: Extracted from Paint()
+ SVX_DLLPRIVATE void ImpSetupDrawOutlinerForPaint( bool bContourFrame,
+ SdrOutliner& rOutliner,
+ Rectangle& rTextRect,
+ Rectangle& rAnchorRect,
+ Rectangle& rPaintRect,
+ Fraction& aFitXKorreg ) const;
+ void ImpAutoFitText( SdrOutliner& rOutliner ) const;
+ static void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting );
+ SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
+ SVX_DLLPRIVATE void ImpLinkAnmeldung();
+ SVX_DLLPRIVATE void ImpLinkAbmeldung();
+ SVX_DLLPRIVATE ImpSdrObjTextLinkUserData* GetLinkUserData() const;
+// void ImpCheckItemSetChanges(const SfxItemSet& rAttr);
+
+protected:
+ bool ImpCanConvTextToCurve() const;
+ SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, sal_Bool bClosed, sal_Bool bBezier, sal_Bool bNoSetAttr = sal_False) const;
+ SdrObject* ImpConvertAddText(SdrObject* pObj, bool bBezier) const;
+ void ImpSetTextStyleSheetListeners();
+ void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXKorreg) const;
+ void ImpJustifyRect(Rectangle& rRect) const;
+ void ImpCheckShear();
+ Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
+ void ImpSetTextEditParams() const;
+ void SetTextSizeDirty() { bTextSizeDirty=sal_True; }
+
+ // rAnchorRect ist InOut-Parameter!
+ void ImpSetContourPolygon( SdrOutliner& rOutliner, Rectangle& rAnchorRect, sal_Bool bLineWidth ) const;
+
+ virtual SdrObjGeoData* NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+ bool NbcSetEckenradius(long nRad);
+ bool NbcSetMinTextFrameHeight(long nHgt);
+ bool NbcSetMinTextFrameWidth(long nWdt);
+
+ // Konstruktoren fuer beschriftete Zeichenobjekte
+ SdrTextObj();
+ SdrTextObj(const Rectangle& rNewRect);
+
+ // Konstruktoren fuer Textrahmen
+ SdrTextObj(SdrObjKind eNewTextKind);
+ SdrTextObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect);
+
+ virtual ~SdrTextObj();
+
+public:
+ TYPEINFO();
+
+ // #101684#
+ sal_Bool IsInEditMode() const { return mbInEditMode; }
+
+ // via eCharSet kann der CharSet der vorliegenden Datei uebergeben werden.
+ // Bei RTL_TEXTENCODING_DONTKNOW wird der CharSet der aktuellen Plattform verwendet.
+ // Derzeit unterstuetzt wird ASCII und RTF wobei ich die Unterscheidung
+ // selbst treffe. rFilterName ist noch ohne Bedeutung und muss leer gelassen
+ // werden.
+ // I.d.R. muss die App nur SetTextLink() rufen - der Rest geschieht von
+ // selbst (SfxLinkManager). Die Methode LoadText() kann ausserdem verwendet
+ // werden, um eine Datei in ein Textobjekt zu laden (ohne Verknuepfung).
+ // TextLinks koennen nicht editiert werden (allenfalls spaeter mal ReadOnly).
+ // Eine Attributierung kann nur am Textrahmen vollzogen werden.
+ void SetTextLink(const String& rFileName, const String& rFilterName, rtl_TextEncoding eCharSet);
+ void ReleaseTextLink();
+ bool IsLinkedText() const { return pPlusData!=NULL && GetLinkUserData()!=NULL; }
+ bool ReloadLinkedText(bool bForceLoad = false);
+ bool LoadText(const String& rFileName, const String& rFilterName, rtl_TextEncoding eCharSet);
+
+ virtual bool AdjustTextFrameWidthAndHeight(Rectangle& rR, bool bHgt = true, bool bWdt = true) const;
+ virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
+ virtual bool AdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
+ 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;
+ SdrObjKind GetTextKind() const { return eTextKind; }
+
+ virtual bool HasText() const;
+ bool HasEditText() const;
+ sal_Bool IsTextEditActive() const { return (pEdtOutl != 0L); }
+
+ /** returns the currently active text. */
+ virtual SdrText* getActiveText() const;
+
+ /** returns the nth available text. */
+ virtual SdrText* getText( sal_Int32 nIndex ) const;
+
+ /** returns the number of texts available for this object. */
+ virtual sal_Int32 getTextCount() const;
+
+ /** returns true only if we are in edit mode and the user actually changed anything */
+ virtual bool IsRealyEdited() 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; }
+ bool IsDisableAutoWidthOnDragging() { return bDisableAutoWidthOnDragging; }
+ void NbcSetText(const String& rStr);
+ void SetText(const String& rStr);
+ void NbcSetText(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat);
+ void SetText(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat);
+
+ // FitToSize und Fontwork wird bei GetTextSize() nicht berueksichtigt!
+ virtual const Size& GetTextSize() const;
+ void FitFrameToTextSize();
+
+ // Gleichzeitig wird der Text in den Outliner gesetzt (ggf.
+ // der des EditOutliners) und die PaperSize gesetzt.
+ virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, bool bNoEditText = false,
+ Rectangle* pAnchorRect=NULL, bool bLineWidth = true ) const;
+ virtual void TakeTextAnchorRect(::Rectangle& rAnchorRect) const;
+ const GeoStat& GetGeoStat() const { return aGeo; }
+
+ long GetEckenradius() const;
+ virtual bool IsAutoGrowHeight() const;
+ long GetMinTextFrameHeight() const;
+ long GetMaxTextFrameHeight() const;
+ virtual bool IsAutoGrowWidth() const;
+ long GetMinTextFrameWidth() const;
+ long GetMaxTextFrameWidth() const;
+
+ SdrFitToSizeType GetFitToSize() const;
+ const Rectangle &GetGeoRect() const { return aRect; }
+
+ // Feststellen, ob TextFontwork
+ virtual bool IsFontwork() const;
+
+ // Soll die Fontwork-Kontour versteckt werden?
+ bool IsHideContour() const;
+
+ // Textfluss innerhalb Kontur
+ bool IsContourTextFrame() const;
+
+ // Horizontale Textausrichtung
+ SdrTextHorzAdjust GetTextHorizontalAdjust(const SfxItemSet& rSet) const;
+ SdrTextHorzAdjust GetTextHorizontalAdjust() const;
+
+ // Vertikale Textausrichtung
+ SdrTextVertAdjust GetTextVerticalAdjust(const SfxItemSet& rSet) const;
+ SdrTextVertAdjust GetTextVerticalAdjust() const;
+
+ // Textrahmenabstaende
+ long GetTextLeftDistance() const;
+ long GetTextRightDistance() const;
+ long GetTextUpperDistance() const;
+ long GetTextLowerDistance() const;
+ SdrTextAniKind GetTextAniKind() const;
+ SdrTextAniDirection GetTextAniDirection() const;
+
+ virtual void SetPage(SdrPage* pNewPage);
+ virtual void SetModel(SdrModel* pNewModel);
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+
+ // Wird zur Bestimmung des Textankerbereichs benoetigt
+ virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+ virtual SdrTextObj* Clone() const;
+ SdrTextObj& operator=(const SdrTextObj& rObj);
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+ virtual basegfx::B2DPolyPolygon TakeContour() const;
+ virtual void RecalcSnapRect();
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+ virtual void NbcSetLogicRect(const Rectangle& rRect);
+ virtual const Rectangle& GetLogicRect() const;
+ virtual long GetRotateAngle() const;
+ virtual long GetShearAngle(bool bVertical = false) const;
+
+ virtual sal_uInt32 GetSnapPointCount() const;
+ virtual Point GetSnapPoint(sal_uInt32 i) const;
+
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+
+ // special drag methods
+ virtual bool hasSpecialDrag() const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+ virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
+
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+ virtual void BrkCreate(SdrDragStat& rStat);
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+ virtual Pointer GetCreatePointer() const;
+
+ virtual void NbcMove(const Size& rSiz);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
+ virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
+ virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear);
+
+ virtual bool HasTextEdit() const;
+ virtual sal_Bool BegTextEdit(SdrOutliner& rOutl);
+ virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
+ virtual void EndTextEdit(SdrOutliner& rOutl);
+ virtual sal_uInt16 GetOutlinerViewAnchorMode() const;
+
+ virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
+ void NbcSetOutlinerParaObjectForText( OutlinerParaObject* pTextObject, SdrText* pText );
+ virtual OutlinerParaObject* GetOutlinerParaObject() const;
+ virtual OutlinerParaObject* GetEditOutlinerParaObject() const;
+
+ virtual void NbcReformatText();
+ virtual void ReformatText();
+
+ virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
+ bool bEdit, Color*& rpTxtColor, Color*& rpFldColor, String& rRet) const;
+
+ virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+
+ 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, 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, Rectangle& rPaintRect ) const;
+ void ForceOutlinerParaObject();
+ virtual sal_Bool IsVerticalWriting() const;
+ virtual void SetVerticalWriting(sal_Bool bVertical);
+
+ /** called from the SdrObjEditView during text edit when the status of the edit outliner changes */
+ virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus );
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // 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 sal_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);
+
+ // #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
+ virtual void RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>& rCharWhichIds );
+
+ // #111096#
+ // 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(Rectangle& rScrollRectangle, Rectangle& rPaintRectangle);
+
+ // #111096#
+ // Access to TextAnimationAllowed flag
+ void SetTextAnimationAllowed(sal_Bool bNew);
+
+ // #i8824#
+ // Set single item at the local ItemSet. *Does not use* AllowItemChange(),
+ // ItemChange(), PostItemChange() and ItemSetChanged() calls.
+ void SetObjectItemNoBroadcast(const SfxPoolItem& rItem);
+
+public:
+ //////////////////////////////////////////////////////////////////////////////
+ // text primitive decomposition helpers
+ void impDecomposeContourTextPrimitive(
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const drawinglayer::primitive2d::SdrContourTextPrimitive2D& rSdrContourTextPrimitive,
+ const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
+ void impDecomposePathTextPrimitive(
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const drawinglayer::primitive2d::SdrPathTextPrimitive2D& rSdrPathTextPrimitive,
+ const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
+ void impDecomposeBlockTextPrimitive(
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive,
+ const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
+ void impDecomposeAutoFitTextPrimitive(
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D& rSdrAutofitTextPrimitive,
+ const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
+ void impDecomposeStretchTextPrimitive(
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive,
+ const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
+
+ //////////////////////////////////////////////////////////////////////////////
+ // timing generators
+ void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const;
+ void impGetScrollTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList, double fFrameLength, double fTextLength) const;
+
+ /** 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* pOutliner );
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..243bcce4f61d
--- /dev/null
+++ b/include/svx/svdouno.hxx
@@ -0,0 +1,155 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDOUNO_HXX
+#define _SVDOUNO_HXX
+
+#include <com/sun/star/awt/XControlModel.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/awt/XControlContainer.hpp>
+#include "svx/svxdllapi.h"
+#include <svx/svdorect.hxx>
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class SdrView;
+class SdrPageWindow;
+class SdrControlEventListenerImpl;
+
+namespace sdr { namespace contact {
+ class ViewContactOfUnoControl;
+}}
+
+//************************************************************
+// SdrUnoObj
+//************************************************************
+
+struct SdrUnoObjDataHolder;
+class SVX_DLLPUBLIC SdrUnoObj : public SdrRectObj
+{
+ friend class SdrPageView;
+ friend class SdrControlEventListenerImpl;
+
+ SdrUnoObjDataHolder* m_pImpl;
+
+ String aUnoControlModelTypeName;
+ String aUnoControlTypeName;
+ sal_Bool bOwnUnoControlModel;
+
+protected:
+ ::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > xUnoControlModel; // kann auch von aussen gesetzt werden
+
+private:
+ SVX_DLLPRIVATE void CreateUnoControlModel(const String& rModelName);
+ SVX_DLLPRIVATE void CreateUnoControlModel(const String& rModelName,
+ const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac );
+
+public:
+ TYPEINFO();
+
+ explicit SdrUnoObj(const String& rModelName, sal_Bool bOwnsModel = sal_True);
+ SdrUnoObj(const String& rModelName,
+ const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac,
+ sal_Bool bOwnsModel = sal_True);
+ virtual ~SdrUnoObj();
+
+ virtual void SetPage(SdrPage* pNewPage);
+ virtual void SetModel(SdrModel* pModel);
+
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+
+ virtual SdrUnoObj* Clone() const;
+ SdrUnoObj& operator= (const SdrUnoObj& rObj);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcSetLayer(SdrLayerID nLayer);
+
+ // SpecialDrag support
+ virtual bool hasSpecialDrag() const;
+
+ // FullDrag support
+ virtual bool supportsFullDrag() const;
+ virtual SdrObject* getFullDragClone() const;
+
+ virtual void TakeObjNameSingul(XubString& rName) const;
+ virtual void TakeObjNamePlural(XubString& rName) const;
+
+ virtual void SetContextWritingMode( const sal_Int16 _nContextWritingMode );
+
+ ::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > GetUnoControlModel() const {return xUnoControlModel;}
+ ::com::sun::star::uno::Reference< com::sun::star::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 an UNO control.
+
+ For those cases, you can ontain 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 <NULL/>, 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.
+
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >
+ GetTemporaryControlForWindow(
+ const Window& _rWindow,
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _inout_ControlContainer
+ ) const;
+
+ const String& GetUnoControlModelTypeName() const { return aUnoControlTypeName; }
+ const String& GetUnoControlTypeName() const { return aUnoControlTypeName; }
+
+ virtual void SetUnoControlModel( const ::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& xModel );
+
+protected:
+ // SdrObject overridables
+ virtual ::sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
+private:
+ /** retrieves the typed ViewContact for the object
+ @param _out_rpContact
+ Upon successful return, ->_out_rpContact contains the ViewContact.
+ @return
+ <TRUE/> 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 // _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 000000000000..43d5468c259a
--- /dev/null
+++ b/include/svx/svdoutl.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 _SVDOUTL_HXX
+#define _SVDOUTL_HXX
+
+#include <editeng/outliner.hxx>
+#include "svx/svxdllapi.h"
+#include <svx/svdobj.hxx>
+
+class SdrTextObj;
+class SdrPage;
+
+class SVX_DLLPUBLIC SdrOutliner : public Outliner
+{
+protected:
+ SdrObjectWeakRef mpTextObj;
+ const SdrPage* mpVisualizedPage;
+
+public:
+ SdrOutliner( SfxItemPool* pItemPool, sal_uInt16 nMode );
+ virtual ~SdrOutliner() ;
+
+ 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 String CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor);
+};
+
+#endif //_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 000000000000..e7493f55ac90
--- /dev/null
+++ b/include/svx/svdovirt.hxx
@@ -0,0 +1,157 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDOVIRT_HXX
+#define _SVDOVIRT_HXX
+
+#include <svx/svdobj.hxx>
+#include "svx/svxdllapi.h"
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// SdrVirtObj
+//
+// Achtung! Das virtuelle Objekt ist noch nicht bis in alle Feinheiten
+// durchprogrammiert und getestet. Z.Zt. kommt es nur in abgeleiteter
+// beim Writer zum Einsatz.
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrVirtObj : public SdrObject
+{
+public:
+ virtual sdr::properties::BaseProperties& GetProperties() const;
+
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
+ SdrObject& rRefObj; // Referenziertes Zeichenobjekt
+ Rectangle aSnapRect;
+
+protected:
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+ virtual SdrObjGeoData* NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+
+public:
+ TYPEINFO();
+ SdrVirtObj(SdrObject& rNewObj);
+ virtual ~SdrVirtObj();
+ virtual SdrObject& ReferencedObj();
+ virtual const SdrObject& GetReferencedObj() const;
+ virtual void NbcSetAnchorPos(const Point& rAnchorPos);
+ virtual void SetModel(SdrModel* pNewModel);
+
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt32 GetObjInventor() const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual SdrObjList* GetSubList() const;
+
+ virtual const Rectangle& GetCurrentBoundRect() const;
+ virtual const Rectangle& GetLastBoundRect() const;
+ virtual void RecalcBoundRect();
+ virtual void SetChanged();
+ virtual SdrVirtObj* Clone() const;
+ SdrVirtObj& operator=(const SdrVirtObj& rObj);
+
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+
+ virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
+ virtual sal_uInt32 GetHdlCount() const;
+ virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+ virtual sal_uInt32 GetPlusHdlCount(const SdrHdl& rHdl) const;
+ virtual SdrHdl* GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlNum) const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
+
+ // special drag methods
+ virtual bool hasSpecialDrag() const;
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+ virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
+ virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const;
+
+ // FullDrag support
+ virtual bool supportsFullDrag() const;
+ virtual SdrObject* getFullDragClone() const;
+
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+ virtual void BrkCreate(SdrDragStat& rStat);
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+
+ virtual void NbcMove(const Size& rSiz);
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
+ virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
+ virtual void NbcShear(const Point& rRef, long nWink, 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 Rotate(const Point& rRef, long nWink, double sn, double cs);
+ virtual void Mirror(const Point& rRef1, const Point& rRef2);
+ virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear);
+
+ virtual void RecalcSnapRect();
+ virtual const Rectangle& GetSnapRect() const;
+ virtual void SetSnapRect(const Rectangle& rRect);
+ virtual void NbcSetSnapRect(const Rectangle& rRect);
+
+ virtual const Rectangle& GetLogicRect() const;
+ virtual void SetLogicRect(const Rectangle& rRect);
+ virtual void NbcSetLogicRect(const Rectangle& rRect);
+
+ virtual long GetRotateAngle() const;
+ virtual long GetShearAngle(bool bVertical = false) const;
+
+ virtual sal_uInt32 GetSnapPointCount() const;
+ virtual Point GetSnapPoint(sal_uInt32 i) const;
+
+ virtual sal_Bool IsPolyObj() const;
+ virtual sal_uInt32 GetPointCount() const;
+ virtual Point GetPoint(sal_uInt32 i) const;
+ virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i);
+
+ virtual SdrObjGeoData* GetGeoData() const;
+ virtual void SetGeoData(const SdrObjGeoData& rGeo);
+
+ virtual void NbcReformatText();
+ virtual void ReformatText();
+
+ virtual bool HasMacro() const;
+ virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec) const;
+ virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec) const;
+ virtual void PaintMacro (OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const;
+ virtual bool DoMacro (const SdrObjMacroHitRec& rRec);
+ virtual OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
+
+ // OD 30.06.2003 #108784# - virtual <GetOffset()> returns Point(0,0)
+ // #i73248# for default SdrVirtObj, offset is aAnchor, not (0,0)
+ virtual const Point GetOffset() const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..c8dd083019a4
--- /dev/null
+++ b/include/svx/svdpage.hxx
@@ -0,0 +1,605 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDPAGE_HXX
+#define _SVDPAGE_HXX
+
+#include <svl/stylesheetuser.hxx>
+#include <vcl/bitmap.hxx>
+#include <vcl/print.hxx>
+#include <vcl/gdimtf.hxx>
+#include <tools/weakbase.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <svx/svdtypes.hxx>
+#include <svx/svdlayer.hxx>
+#include <vector>
+#include <svx/sdrpageuser.hxx>
+#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
+#include <svx/sdrmasterpagedescriptor.hxx>
+#include "svx/svxdllapi.h"
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <svx/svdobj.hxx>
+#include <boost/scoped_ptr.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace reportdesign { class OSection; }
+namespace sdr { namespace contact { class ViewContact; }}
+class SdrPage;
+class SdrModel;
+class SfxItemPool;
+class SdrPageView;
+class SdrLayerAdmin;
+class SetOfByte;
+class Color;
+class SfxStyleSheet;
+class SvxUnoDrawPagesAccess;
+
+enum SdrInsertReasonKind {SDRREASON_UNKNOWN, // unbekannt
+ SDRREASON_STREAMING, // einlesen eines Doks
+ SDRREASON_UNDO, // kommt aus dem Undo
+ SDRREASON_COPY, // irgendjemand kopiert...
+ SDRREASON_VIEWCREATE, // vom Anwender interaktiv erzeugt
+ SDRREASON_VIEWCALL}; // Durch SdrView::Group(), ...
+
+class SdrInsertReason {
+ const SdrObject* pRefObj;
+ SdrInsertReasonKind eReason;
+public:
+ SdrInsertReason(): pRefObj(NULL),eReason(SDRREASON_UNKNOWN) {}
+ SdrInsertReason(SdrInsertReasonKind eR,const SdrObject* pO=NULL): pRefObj(pO),eReason(eR) {}
+ void SetReferenceObject(const SdrObject* pO) { pRefObj=pO; }
+ const SdrObject* GetReferenceObject() const { return pRefObj; }
+ void SetReason(SdrInsertReasonKind eR) { eReason=eR; }
+ SdrInsertReasonKind GetReason() const { return eReason; }
+};
+
+//////////////////////////////////////////////////////////////////////////////
+// class SdrObjList
+
+class SVX_DLLPUBLIC SdrObjList
+{
+private:
+ typedef ::std::vector<SdrObject*> SdrObjectContainerType;
+ SdrObjectContainerType maList;
+
+protected:
+friend class SdrObjListIter;
+friend class SdrEditView;
+ SdrObjList* pUpList; // Vaterliste
+ SdrModel* pModel; // Diese Liste gehoert zu diesem Model (Layer,ItemPool,Storage).
+ SdrPage* pPage; // Page, in die Liste haengt. Kann auch this sein.
+ SdrObject* pOwnerObj; // OwnerObject, falls Liste eines GruppenObjekts.
+ Rectangle aOutRect;
+ Rectangle aSnapRect;
+ SdrObjListKind eListKind;
+ bool bObjOrdNumsDirty;
+ bool bRectsDirty;
+protected:
+ virtual void RecalcRects();
+
+private:
+ /// simple ActionChildInserted forwarder to have it on a central place
+ void impChildInserted(SdrObject& rChild) const;
+public:
+ TYPEINFO();
+ SdrObjList(SdrModel* pNewModel, SdrPage* pNewPage, SdrObjList* pNewUpList=NULL);
+ SdrObjList(const SdrObjList& rSrcList);
+ virtual ~SdrObjList();
+ // !!! Diese Methode nur fuer Leute, die ganz genau wissen was sie tun !!!
+
+ // #110094# This should not be needed (!)
+ void SetObjOrdNumsDirty() { bObjOrdNumsDirty=sal_True; }
+ // pModel, pPage, pUpList und pOwnerObj werden Zuweisungeoperator nicht veraendert!
+ void operator=(const SdrObjList& rSrcList);
+ void CopyObjects(const SdrObjList& rSrcList);
+ // alles Aufraeumen (ohne Undo)
+ void Clear();
+ SdrObjListKind GetListKind() const { return eListKind; }
+ void SetListKind(SdrObjListKind eNewKind) { eListKind=eNewKind; }
+ SdrObjList* GetUpList() const { return pUpList; }
+ void SetUpList(SdrObjList* pNewUpList) { pUpList=pNewUpList; }
+ SdrObject* GetOwnerObj() const { return pOwnerObj; }
+ void SetOwnerObj(SdrObject* pNewOwner) { pOwnerObj=pNewOwner; }
+ virtual SdrPage* GetPage() const;
+ virtual void SetPage(SdrPage* pNewPage);
+ virtual SdrModel* GetModel() const;
+ virtual void SetModel(SdrModel* pNewModel);
+ // Neuberechnung der Objekt-Ordnungsnummern
+ void RecalcObjOrdNums();
+ bool IsObjOrdNumsDirty() const { return bObjOrdNumsDirty; }
+ virtual void NbcInsertObject(SdrObject* pObj, sal_uIntPtr nPos=0xFFFF
+ , const SdrInsertReason* pReason=NULL
+ );
+ virtual void InsertObject(SdrObject* pObj, sal_uIntPtr nPos=0xFFFF
+ , const SdrInsertReason* pReason=NULL
+ );
+ // aus Liste entfernen ohne delete
+ virtual SdrObject* NbcRemoveObject(sal_uIntPtr nObjNum);
+ virtual SdrObject* RemoveObject(sal_uIntPtr nObjNum);
+ // Vorhandenes Objekt durch ein anderes ersetzen.
+ // Wie Remove&Insert jedoch performanter, da die Ordnungsnummern
+ // nicht Dirty gesetzt werden muessen.
+ virtual SdrObject* NbcReplaceObject(SdrObject* pNewObj, sal_uIntPtr nObjNum);
+ virtual SdrObject* ReplaceObject(SdrObject* pNewObj, sal_uIntPtr nObjNum);
+ // Die Z-Order eines Objekts veraendern
+ virtual SdrObject* NbcSetObjectOrdNum(sal_uIntPtr nOldObjNum, sal_uIntPtr nNewObjNum);
+ virtual SdrObject* SetObjectOrdNum(sal_uIntPtr nOldObjNum, sal_uIntPtr nNewObjNum);
+
+ virtual void SetRectsDirty();
+
+ const Rectangle& GetAllObjSnapRect() const;
+ const Rectangle& GetAllObjBoundRect() const;
+
+ // Alle Textobjekte neu formatieren, z.B. bei Druckerwechsel
+ void NbcReformatAllTextObjects();
+ void ReformatAllTextObjects();
+
+ /** #103122# reformats all edge objects that are connected to other objects */
+ void ReformatAllEdgeObjects();
+
+ // Die Vorlagenattribute der Zeichenobjekte in harte Attribute verwandeln.
+ void BurnInStyleSheetAttributes();
+
+ sal_uIntPtr GetObjCount() const;
+ SdrObject* GetObj(sal_uIntPtr nNum) const;
+
+ // Gelinkte Seite oder gelinktes Gruppenobjekt
+ virtual bool IsReadOnly() const;
+
+ // Zaehlt alle Objekte inkl. Objekte in Objektgruppen, ...
+ sal_uIntPtr CountAllObjects() const;
+
+ // Alle aufgelagerten Teile (z.B. Grafiken) der Liste in den
+ // Speicher laden.
+ void ForceSwapInObjects() const;
+ void ForceSwapOutObjects() const;
+
+ void SwapInAll() const { ForceSwapInObjects(); }
+ void SwapOutAll() const { ForceSwapOutObjects(); }
+
+ /** 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.
+ */
+ virtual 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.
+ */
+ virtual void UnGroupObj( sal_uIntPtr nObjNum );
+
+ /** Return whether there is an explicit, user defined, object navigation
+ order. When there is one this method returns <TRUE/> and the
+ GetObjectForNavigationPosition() and
+ SdrObject::GetNavigationPosition() methods will return values
+ different from those returne by SdrObject::GetOrdNum() and
+ GetObj().
+ */
+ bool HasObjectNavigationOrder (void) 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. mpNavigationOrder 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 (void);
+
+ /** Set the navigation position of all SdrObjects to their position in
+ the mpNavigationOrder list. This method returns immediately when no
+ update is necessary.
+ @return
+ This method returns <TRUE/> when the navigation positions stored
+ in SdrObjects are up to date.
+ It returns <FALSE/> when the navigation positions are not valid,
+ for example because no explicit navigation order has been
+ defined, i.e. HasObjectNavigationOrder() would return <FALSE/>.
+ */
+ bool RecalcNavigationPositions (void);
+
+ /** 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XIndexAccess>& rxOrder);
+
+private:
+ class WeakSdrObjectContainerType;
+ /// This list, if it exists, defines the navigation order. It it does
+ /// not exist then maList defines the navigation order.
+ ::boost::scoped_ptr<WeakSdrObjectContainerType> mpNavigationOrder;
+
+ /// This flag is <TRUE/> 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);
+};
+
+/*
+Eine Sdraw-Seite enthaelt genau eine Objektliste sowie eine Beschreibung
+der physikalischen Seitendimensionen (Groesse/Raender). Letzteres wird
+lediglich zum Fangen von Objekten beim Draggen benoetigt.
+An der Seite lassen sich (ueber SdrObjList) Objekte einfuegen und loeschen,
+nach vorn und nach hinten stellen. Ausserdem kann die Ordnungszahl eines
+Objektes abgefragt sowie direkt gesetzt werden.
+*/
+
+// Used for all methods which return a page number
+#define SDRPAGE_NOTFOUND 0xFFFF
+
+//////////////////////////////////////////////////////////////////////////////
+// class SdrPageGridFrame
+
+// Fuer das Fangraster/Punkgitter im Writer
+class SdrPageGridFrame
+{
+ Rectangle aPaper;
+ Rectangle aUserArea;
+public:
+ SdrPageGridFrame(const Rectangle& rPaper): aPaper(rPaper), aUserArea(rPaper) {}
+ SdrPageGridFrame(const Rectangle& rPaper, const Rectangle& rUser): aPaper(rPaper), aUserArea(rUser) {}
+ void SetPaperRect(const Rectangle& rPaper) { aPaper=rPaper; }
+ void SetUserArea(const Rectangle& rUser) { aUserArea=rUser; }
+ const Rectangle& GetPaperRect() const { return aPaper; }
+ const Rectangle& GetUserArea() const { return aUserArea; }
+};
+
+class SVX_DLLPUBLIC SdrPageGridFrameList {
+ std::vector<SdrPageGridFrame*> aList;
+private:
+ SVX_DLLPRIVATE SdrPageGridFrameList(const SdrPageGridFrameList& rSrcList); // never implemented
+ SVX_DLLPRIVATE void operator=(const SdrPageGridFrameList& rSrcList); // never implemented
+protected:
+ 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)); }
+ void Insert(const SdrPageGridFrame& rGF, sal_uInt16 nPos)
+ {
+ if(nPos==0xFFFF)
+ aList.push_back(new SdrPageGridFrame(rGF));
+ else
+ aList.insert(aList.begin()+nPos,new SdrPageGridFrame(rGF));
+ }
+ void Delete(sal_uInt16 nPos)
+ {
+ SdrPageGridFrame* p = aList[nPos];
+ aList.erase(aList.begin()+nPos);
+ delete p;
+ }
+ void Move(sal_uInt16 nPos, sal_uInt16 nNewPos)
+ {
+ SdrPageGridFrame* p = aList[nPos];
+ aList.erase(aList.begin()+nPos);
+ aList.insert(aList.begin()+nNewPos,p);
+ }
+ SdrPageGridFrame& operator[](sal_uInt16 nPos) { return *GetObject(nPos); }
+ const SdrPageGridFrame& operator[](sal_uInt16 nPos) const { return *GetObject(nPos); }
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// class SdrPageProperties
+
+class SVX_DLLPUBLIC SdrPageProperties : public SfxListener, public svl::StyleSheetUser
+{
+private:
+ // data
+ SdrPage* mpSdrPage;
+ SfxStyleSheet* mpStyleSheet;
+ SfxItemSet* mpProperties;
+
+ // internal helpers
+ void ImpRemoveStyleSheet();
+ void ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet);
+
+ // not implemented
+ SdrPageProperties& operator=(const SdrPageProperties& rCandidate);
+
+public:
+ // construct/destruct
+ SdrPageProperties(SdrPage& rSdrPage);
+ virtual ~SdrPageProperties();
+
+ // Notify(...) from baseclass SfxListener
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+ virtual bool isUsedByModel() const;
+
+ // data read/write
+ const SfxItemSet& GetItemSet() const;
+ 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;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// class SdrPage
+
+class SVX_DLLPUBLIC SdrPage : public SdrObjList, public tools::WeakBase< SdrPage >
+{
+ ///////////////////////////////////////////////////////////////////////////////
+ // start PageUser section
+private:
+ // #111111# PageUser section
+ sdr::PageUserVector maPageUsers;
+
+public:
+ void AddPageUser(sdr::PageUser& rNewUser);
+ void RemovePageUser(sdr::PageUser& rOldUser);
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // end PageUser section
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // #110094# DrawContact section
+private:
+ sdr::contact::ViewContact* mpViewContact;
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+public:
+ sdr::contact::ViewContact& GetViewContact() const;
+
+ // #110094# DrawContact support: Methods for handling Page changes
+ void ActionChanged() const;
+
+ // #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;
+
+ sal_Int32 nWdt; // Seitengroesse
+ sal_Int32 nHgt; // Seitengroesse
+ sal_Int32 nBordLft; // Seitenrand links
+ sal_Int32 nBordUpp; // Seitenrand oben
+ sal_Int32 nBordRgt; // Seitenrand rechts
+ sal_Int32 nBordLwr; // Seitenrand unten
+
+protected:
+ SdrLayerAdmin* pLayerAdmin;
+private:
+ SdrPageProperties* mpSdrPageProperties;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoPage;
+
+public:
+ SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; }
+ const SdrPageProperties& getSdrPageProperties() const { return *mpSdrPageProperties; }
+ const SdrPageProperties* getCorrectSdrPageProperties() const;
+
+protected:
+ // new MasterPageDescriptorVector
+ ::sdr::MasterPageDescriptor* mpMasterPageDescriptor;
+
+ SetOfByte aPrefVisiLayers;
+ sal_uInt16 nPageNum;
+
+ // bitfield
+ unsigned mbMaster : 1; // flag if this is a MasterPage
+ unsigned mbInserted : 1;
+ unsigned mbObjectsNotPersistent : 1;
+ unsigned mbSwappingLocked : 1;
+
+ // #i93597#
+ unsigned mbPageBorderOnlyLeftRight : 1;
+
+ void SetUnoPage(::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XDrawPage> const&);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
+
+public:
+ TYPEINFO();
+ SdrPage(SdrModel& rNewModel, bool bMasterPage=false);
+ // Copy-Ctor und Zuweisungeoperator sind nicht getestet!
+ SdrPage(const SdrPage& rSrcPage);
+ virtual ~SdrPage();
+ // pModel, pPage, pUpList, pOwnerObj und mbInserted werden Zuweisungeoperator nicht veraendert!
+ SdrPage& operator=(const SdrPage& rSrcPage);
+ virtual SdrPage* Clone() const;
+ virtual SdrPage* Clone(SdrModel* pNewModel) const;
+ bool IsMasterPage() const { return mbMaster; }
+ void SetInserted(bool bNew = true);
+ bool IsInserted() const { return mbInserted; }
+ virtual void SetChanged();
+
+ // #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);
+ virtual Size GetSize() const;
+ virtual void SetOrientation(Orientation eOri);
+ virtual Orientation GetOrientation() const;
+ virtual sal_Int32 GetWdt() const;
+ virtual sal_Int32 GetHgt() const;
+ virtual void SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr);
+ virtual void SetLftBorder(sal_Int32 nBorder);
+ virtual void SetUppBorder(sal_Int32 nBorder);
+ virtual void SetRgtBorder(sal_Int32 nBorder);
+ virtual void SetLwrBorder(sal_Int32 nBorder);
+ virtual sal_Int32 GetLftBorder() const;
+ virtual sal_Int32 GetUppBorder() const;
+ virtual sal_Int32 GetRgtBorder() const;
+ virtual sal_Int32 GetLwrBorder() const;
+
+ virtual void SetModel(SdrModel* pNewModel);
+
+ // New MasterPage interface
+ sal_Bool TRG_HasMasterPage() const { return (0L != mpMasterPageDescriptor); }
+ void TRG_SetMasterPage(SdrPage& rNew);
+ void TRG_ClearMasterPage();
+ SdrPage& TRG_GetMasterPage() const;
+ const SetOfByte& TRG_GetMasterPageVisibleLayers() const;
+ void TRG_SetMasterPageVisibleLayers(const SetOfByte& rNew);
+ sdr::contact::ViewContact& TRG_GetMasterPageDescriptorViewContact() const;
+
+protected:
+ void TRG_ImpMasterPageRemoved(const SdrPage& rRemovedPage);
+public:
+
+ // Aenderungen an den Layern setzen nicht das Modified-Flag !
+ const SdrLayerAdmin& GetLayerAdmin() const { return *pLayerAdmin; }
+ SdrLayerAdmin& GetLayerAdmin() { return *pLayerAdmin; }
+
+ virtual OUString GetLayoutName() const;
+
+ // fuer's Raster im Writer, auch fuer AlignObjects wenn 1 Objekt markiert ist
+ // wenn pRect!=NULL, dann die Seiten, die von diesem Rect intersected werden
+ // ansonsten die sichtbaren Seiten.
+ virtual const SdrPageGridFrameList* GetGridFrameList(const SdrPageView* pPV, const Rectangle* pRect) const;
+ bool IsObjectsNotPersistent() const { return mbObjectsNotPersistent; }
+ void SetObjectsNotPersistent(bool b) { mbObjectsNotPersistent = b; }
+ // Durch Setzen dieses Flags, kann das Auslagern (Swappen) von
+ // Teilen der Page (z.B. Grafiken) unterbunden werden.
+ // Es werden hierdurch jedoch nicht automatisch alle ausgelagerten
+ // Teile nachgeladen, dies geschieht erst bei konkretem Bedarf oder
+ // durch Aufruf von SwapInAll().
+ // Fuer die MasterPage(s) der Page muss dies ggf. separat gemacht werden.
+ bool IsSwappingLocked() const { return mbSwappingLocked; }
+ void SetSwappingLocked(bool bLock) { mbSwappingLocked = bLock; }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > 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* 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 );
+};
+
+typedef tools::WeakReference< SdrPage > SdrPageWeakRef;
+
+//////////////////////////////////////////////////////////////////////////////
+// use new redirector instead of pPaintProc
+
+class SVX_DLLPUBLIC StandardCheckVisisbilityRedirector : public ::sdr::contact::ViewObjectContactRedirector
+{
+public:
+ StandardCheckVisisbilityRedirector();
+ virtual ~StandardCheckVisisbilityRedirector();
+
+ // all default implementations just call the same methods at the original. To do something
+ // different, overload the method and at least do what the method does.
+ virtual drawinglayer::primitive2d::Primitive2DSequence createRedirectedPrimitive2DSequence(
+ const sdr::contact::ViewObjectContact& rOriginal,
+ const sdr::contact::DisplayInfo& rDisplayInfo);
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..b43db7da37ed
--- /dev/null
+++ b/include/svx/svdpagv.hxx
@@ -0,0 +1,268 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDPAGV_HXX
+#define _SVDPAGV_HXX
+
+#include <com/sun/star/awt/XControlContainer.hpp>
+#include <svl/lstner.hxx>
+#include <svx/svdhlpln.hxx>
+#include <cppuhelper/implbase4.hxx>
+#include <svx/svdsob.hxx>
+#include <svx/svdtypes.hxx>
+#include "svx/svxdllapi.h"
+
+#include <cppuhelper/implbase3.hxx>
+#include <vector>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class Region;
+class SdrObjList;
+class SdrObject;
+class SdrPage;
+class SdrUnoObj;
+class SdrPaintWindow;
+class SdrView;
+class SdrPageObj;
+class SdrPageView;
+
+// #110094#
+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;
+typedef ::std::vector< SdrPageWindow* > SdrPageWindowVector;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrPageView
+{
+private:
+ SdrView& mrView;
+ SdrPage* mpPage;
+ Point aPgOrg; // Nullpunkt der Page
+
+ Rectangle aMarkBound; // wird
+ Rectangle aMarkSnap; // von
+ sal_Bool mbHasMarked;
+ sal_Bool mbVisible;
+
+ SetOfByte aLayerVisi; // Menge der sichtbaren Layer
+ SetOfByte aLayerLock; // Menge der nicht editierbaren Layer
+ SetOfByte aLayerPrn; // Menge der druckbaren Layer
+
+ SdrObjList* pAktList; // Aktuelle Liste, in der Regel die Page.
+ SdrObject* pAktGroup; // Aktuelle Gruppe. NULL=Keine.
+
+ SdrHelpLineList aHelpLines; // Hilfslinien und -punkte
+
+ // #103911# Use one reserved slot (bReserveBool2) for the document color
+ Color maDocumentColor;
+
+ // #103834# Use one reserved slot (bReserveBool1) for the background color
+ Color maBackgroundColor;
+
+ SdrPageWindowVector maPageWindows;
+
+ // #i72752# member to remember with which SdrPageWindow the BeginDrawLayer
+ // was done
+ SdrPageWindow* mpPreparedPageWindow;
+
+ // interface to SdrPageWindow
+private:
+ void ClearPageWindows();
+ void AppendPageWindow(SdrPageWindow& rNew);
+ SdrPageWindow* RemovePageWindow(SdrPageWindow& rOld);
+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:
+ SVX_DLLPRIVATE SdrPageWindow& CreateNewPageWindowEntry(SdrPaintWindow& rPaintWindow);
+
+ void ImpInvalidateHelpLineArea(sal_uInt16 nNum) const;
+
+ void SetLayer(const String& rName, SetOfByte& rBS, sal_Bool bJa);
+ sal_Bool IsLayer(const String& rName, const SetOfByte& rBS) const;
+
+ // Nachsehen, ob AktGroup noch Inserted ist.
+ void CheckAktGroup();
+
+ void AdjHdl();
+
+public:
+ SdrPageView(SdrPage* pPage1, SdrView& rNewView);
+ ~SdrPageView();
+
+ // Wird von der PaintView gerufen, wenn Modelaenderungen abgeschlossen sind
+ 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, <NULL/>
+ otherwise.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
+ GetControlContainer( const OutputDevice& _rDevice ) const;
+
+ /** sets all elements in the view which support a design and a alive mode into the given mode
+ */
+ void SetDesignMode( bool _bDesignMode ) const;
+
+ sal_Bool IsVisible() const { return mbVisible; }
+
+ // Invalidiert den gesamten Bereich der Page
+ void InvalidateAllWin();
+
+ // PrePaint call forwarded from app windows
+ void PrePaint();
+
+ // rReg bezieht sich auf's OutDev, nicht auf die Page
+ void CompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L) const;
+
+ // write access to mpPreparedPageWindow
+ void setPreparedPageWindow(SdrPageWindow* pKnownTarget);
+
+ void DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget = 0, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L,
+ const Rectangle& rRect = Rectangle()) const;
+ void DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, Color aColor = Color( COL_BLACK ) );
+
+ Rectangle GetPageRect() const;
+ SdrPage* GetPage() const { return mpPage; }
+
+ // Betretene Liste rausreichen
+ SdrObjList* GetObjList() const { return pAktList; }
+
+ // Betretene Gruppe rausreichen
+ SdrObject* GetAktGroup() const { return pAktGroup; }
+
+ // Betretene Gruppe und Liste setzen
+ void SetAktGroupAndList(SdrObject* pNewGroup, SdrObjList* pNewList);
+
+ sal_Bool HasMarkedObjPageView() const { return mbHasMarked; }
+ void SetHasMarkedObj(sal_Bool bOn) { mbHasMarked = bOn; }
+
+ const Rectangle& MarkBound() const { return aMarkBound; }
+ const Rectangle& MarkSnap() const { return aMarkSnap; }
+ Rectangle& MarkBound() { return aMarkBound; }
+ Rectangle& MarkSnap() { return aMarkSnap; }
+
+ void SetLayerVisible(const String& rName, sal_Bool bShow = sal_True) { SetLayer(rName, aLayerVisi, bShow); if(!bShow) AdjHdl(); InvalidateAllWin(); }
+ sal_Bool IsLayerVisible(const String& rName) const { return IsLayer(rName, aLayerVisi); }
+
+ void SetLayerLocked(const String& rName, sal_Bool bLock = sal_True) { SetLayer(rName, aLayerLock, bLock); if(bLock) AdjHdl(); }
+ sal_Bool IsLayerLocked(const String& rName) const { return IsLayer(rName,aLayerLock); }
+
+ void SetLayerPrintable(const String& rName, sal_Bool bPrn = sal_True) { SetLayer(rName, aLayerPrn, bPrn); }
+ sal_Bool IsLayerPrintable(const String& rName) const { return IsLayer(rName, aLayerPrn); }
+
+ // PV stellt eine RefPage oder eine SubList eines RefObj dar oder Model ist ReadOnly
+ sal_Bool IsReadOnly() const;
+
+ // der Origin bezieht sich immer auf die obere linke Ecke der Page
+ const Point& GetPageOrigin() const { return aPgOrg; }
+ void SetPageOrigin(const Point& rOrg);
+
+ void LogicToPagePos(Point& rPnt) const { rPnt-=aPgOrg; }
+ void LogicToPagePos(Rectangle& rRect) const { rRect.Move(-aPgOrg.X(),-aPgOrg.Y()); }
+ void PagePosToLogic(Point& rPnt) const { rPnt+=aPgOrg; }
+ void PagePosToLogic(Rectangle& rRect) const { rRect.Move(aPgOrg.X(),aPgOrg.Y()); }
+
+ void SetVisibleLayers(const SetOfByte& rSet) { aLayerVisi=rSet; InvalidateAllWin(); }
+ const SetOfByte& GetVisibleLayers() const { return aLayerVisi; }
+ void SetPrintableLayers(const SetOfByte& rSet) { aLayerPrn=rSet; }
+ const SetOfByte& GetPrintableLayers() const { return aLayerPrn; }
+ void SetLockedLayers(const SetOfByte& rSet) { aLayerLock=rSet; }
+ const SetOfByte& 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, sal_uInt16 nNum=0xFFFF);
+ void MoveHelpLine(sal_uInt16 nNum, sal_uInt16 nNewNum) { aHelpLines.Move(nNum,nNewNum); }
+
+ // Liefert sal_True, wenn Layer des Obj sichtbar und nicht gesperrt.
+ // Beim Gruppenobjekt muss wenigstens ein Member sichtbar sein,
+ // gesperrt sein darf keiner.
+ sal_Bool IsObjMarkable(SdrObject* pObj) const;
+
+ // Betreten (Editieren) einer Objektgruppe. Anschliessend liegen alle
+ // Memberobjekte der Gruppe im direkten Zugriff. Alle anderen Objekte
+ // koennen waerendessen nicht bearbeitet werden (bis zum naechsten
+ // LeaveGroup()). (wie MsDos chdir bla).
+ sal_Bool EnterGroup(SdrObject* pObj);
+
+ // Verlassen einer betretenen Objektgruppe. (wie MsDos chdir ..)
+ void LeaveOneGroup();
+
+ // Verlassen aller betretenen Objektgruppen. (wie MsDos chdir \)
+ void LeaveAllGroup();
+
+ // Feststellen, wie weit hinabgestiegen wurde (0=Root(Page))
+ sal_uInt16 GetEnteredLevel() const;
+
+ // #103834# Set background color for svx at SdrPageViews
+ void SetApplicationBackgroundColor(Color aBackgroundColor);
+
+ // #109585#
+ Color GetApplicationBackgroundColor() const;
+
+ // #103911# Set/Get document color for svx at SdrPageViews
+ void SetApplicationDocumentColor(Color aDocumentColor);
+ Color GetApplicationDocumentColor() const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..2e9bc2534adb
--- /dev/null
+++ b/include/svx/svdpntv.hxx
@@ -0,0 +1,554 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDPNTV_HXX
+#define _SVDPNTV_HXX
+
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <svl/smplhint.hxx>
+#include <svl/undo.hxx>
+#include <svx/svddrag.hxx>
+#include <svx/svdlayer.hxx> // fuer SetOfByte
+#include <vcl/window.hxx>
+#include <svtools/colorcfg.hxx>
+#include <com/sun/star/awt/XControlContainer.hpp>
+#include <svl/itemset.hxx>
+#include <vcl/timer.hxx>
+#include "svx/svxdllapi.h"
+#include <svtools/optionsdrawinglayer.hxx>
+#include <unotools/options.hxx>
+
+//************************************************************
+// Pre-Defines
+//************************************************************
+
+class SdrPageWindow;
+
+namespace com { namespace sun { namespace star { namespace awt {
+ class XControlContainer;
+}}}}
+
+class SdrPage;
+class SdrView;
+class SfxItemSet;
+class SfxStyleSheet;
+class SdrOle2Obj;
+class SdrModel;
+class SdrObject;
+
+#ifdef DBG_UTIL
+class SdrItemBrowser;
+#endif
+
+namespace sdr { namespace contact {
+ class ViewObjectContactRedirector;
+}}
+
+//************************************************************
+// Defines for AnimationMode
+//************************************************************
+
+enum SdrAnimationMode
+{
+ SDR_ANIMATION_ANIMATE,
+ SDR_ANIMATION_DONT_ANIMATE,
+ SDR_ANIMATION_DISABLE
+};
+
+//************************************************************
+// Typedef's und defines
+//************************************************************
+
+typedef unsigned char TRISTATE;
+#define FUZZY (2)
+#define SDR_ANYFORMAT (0xFFFFFFFF)
+#define SDR_ANYITEM (0xFFFF)
+#define SDRVIEWWIN_NOTFOUND (0xFFFF)
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+class SdrPaintView;
+
+namespace sdr
+{
+ namespace contact
+ {
+ class ViewObjectContactRedirector;
+ } // end of namespace contact
+} // end of namespace sdr
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+class SVX_DLLPUBLIC SvxViewHint : public SfxHint
+{
+public:
+ enum HintType { SVX_HINT_VIEWCHANGED };
+ TYPEINFO();
+ explicit SvxViewHint (HintType eType);
+ HintType GetHintType (void) const;
+
+private:
+ HintType meHintType;
+};
+
+// typedefs for a list of SdrPaintWindows
+class SdrPaintWindow;
+typedef ::std::vector< SdrPaintWindow* > SdrPaintWindowVector;
+
+//////////////////////////////////////////////////////////////////////////////
+// helper to convert any GDIMetaFile to a good quality BitmapEx,
+// using default parameters and graphic::XPrimitive2DRenderer
+
+BitmapEx SVX_DLLPUBLIC convertMetafileToBitmapEx(
+ const GDIMetaFile& rMtf,
+ const basegfx::B2DRange& rTargetRange,
+ const sal_uInt32 nMaximumQuadraticPixels = 500000);
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrPaintView : public SfxListener, public SfxRepeatTarget, public SfxBroadcaster, public ::utl::ConfigurationListener
+{
+ friend class SdrPageView;
+ friend class SdrGrafObj;
+
+ SdrPageView* mpPageView;
+protected:
+ SdrModel* pMod;
+#ifdef DBG_UTIL
+ SdrItemBrowser* pItemBrowser;
+#endif
+ const OutputDevice* pActualOutDev; // Nur zum vergleichen
+ OutputDevice* pDragWin;
+ SfxStyleSheet* pDefaultStyleSheet;
+
+ String aAktLayer; // Aktueller Zeichenlayer
+ String aMeasureLayer; // Aktueller Layer fuer Bemassung
+
+// Container aPagV; // Liste von SdrPageViews
+
+ // All windows this view is displayed on
+ SdrPaintWindowVector maPaintWindows;
+
+ MapMode aActualMapMode;
+ Size aGridBig; // muss dann mal raus
+ Size aGridFin; // muss dann mal raus
+ SdrDragStat aDragStat;
+ Rectangle aMaxWorkArea;
+ SfxItemSet aDefaultAttr;
+ Timer aComeBackTimer;
+
+ SdrAnimationMode eAnimationMode;
+
+ sal_uInt16 nHitTolPix;
+ sal_uInt16 nMinMovPix;
+ sal_uInt16 nHitTolLog;
+ sal_uInt16 nMinMovLog;
+ sal_uIntPtr nMasterCacheMode;
+ sal_uIntPtr nGraphicManagerDrawMode;
+
+ // hold an incarnation of Drawinglayer configuration options
+ SvtOptionsDrawinglayer maDrawinglayerOpt;
+
+ unsigned bPageVisible : 1;
+ unsigned bPageBorderVisible : 1;
+ unsigned bBordVisible : 1;
+ unsigned bGridVisible : 1;
+ unsigned bGridFront : 1;
+ unsigned bHlplVisible : 1;
+ unsigned bHlplFront : 1;
+ unsigned bGlueVisible : 1; // Persistent. Klebepunkte anzeigen
+ unsigned bGlueVisible2 : 1; // Klebepunkte auch bei GluePointEdit anzeigen
+ unsigned bGlueVisible3 : 1; // Klebepunkte auch bei EdgeTool anzeigen
+ unsigned bGlueVisible4 : 1; // Klebepunkte anzeigen, wenn 1 Edge markiert
+ unsigned bRestoreColors : 1; // Pens und Brushes werden zurueckgesetzt.
+ unsigned bSomeObjChgdFlag : 1;
+ unsigned bSwapAsynchron : 1;
+ unsigned bPrintPreview : 1;
+
+ // sal_Bool fuer die Verwaltung des anzuzeigenden Status
+ // Gruppe Betreten/Verlassen. Default ist sal_True, wird aber
+ // beispielsweise beim Chart auf sal_False gesetzt, da dort
+ // die Ghosted-Effekte zur Darstellug unerwuenscht sind.
+ unsigned bVisualizeEnteredGroup : 1;
+ unsigned bAnimationPause : 1;
+
+ // #114898#
+ // Flag which decides if buffered output for this view is allowed. When
+ // set, PreRendering for PageView rendering will be used. Default is sal_False
+ unsigned mbBufferedOutputAllowed : 1;
+
+ // #114898#
+ // 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.
+ unsigned mbBufferedOverlayAllowed : 1;
+
+ // allow page painting at all?
+ unsigned mbPagePaintingAllowed : 1;
+
+ // is this a preview renderer?
+ unsigned mbPreviewRenderer : 1;
+
+ // flags for calc and sw for suppressing OLE, CHART or DRAW objects
+ unsigned mbHideOle : 1;
+ unsigned mbHideChart : 1;
+ unsigned mbHideDraw : 1; // hide draw objects other than form controls
+ unsigned mbHideFormControl : 1; // hide form controls only
+
+public:
+ // #114898#
+ // 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?
+ sal_Bool IsPagePaintingAllowed() const;
+ void SetPagePaintingAllowed(bool bNew);
+
+protected:
+ svtools::ColorConfig maColorConfig;
+ Color maGridColor;
+
+ // interface to SdrPaintWindow
+protected:
+ void AppendPaintWindow(SdrPaintWindow& rNew);
+ SdrPaintWindow* RemovePaintWindow(SdrPaintWindow& rOld);
+ void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, sal_uInt32 );
+
+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,void*);
+
+protected:
+ sal_uInt16 ImpGetMinMovLogic(short nMinMov, const OutputDevice* pOut) const;
+ sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice* pOut) const;
+
+ // Wenn man den IdleStatus des Systems nicht abwarten will (auf const geschummelt):
+ void FlushComeBackTimer() const;
+ void TheresNewMapMode();
+ void ImpSetGlueVisible2(bool bOn) { if (bGlueVisible2!=(unsigned)bOn) { bGlueVisible2=bOn; if (!bGlueVisible && !bGlueVisible3 && !bGlueVisible4) GlueInvalidate(); } }
+ void ImpSetGlueVisible3(bool bOn) { if (bGlueVisible3!=(unsigned)bOn) { bGlueVisible3=bOn; if (!bGlueVisible && !bGlueVisible2 && !bGlueVisible4) GlueInvalidate(); } }
+ void ImpSetGlueVisible4(bool bOn) { if (bGlueVisible4!=(unsigned)bOn) { bGlueVisible4=bOn; if (!bGlueVisible && !bGlueVisible2 && !bGlueVisible3) GlueInvalidate(); } }
+ sal_Bool ImpIsGlueVisible2() const { return bGlueVisible2; }
+ sal_Bool ImpIsGlueVisible3() const { return bGlueVisible3; }
+ sal_Bool ImpIsGlueVisible4() const { return bGlueVisible4; }
+
+public:
+ sal_Bool ImpIsGlueVisible() { return bGlueVisible || bGlueVisible2 || bGlueVisible3 || bGlueVisible4; }
+protected:
+
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+ void GlueInvalidate() const;
+
+ void ShowEncirclement(OutputDevice* pOut);
+ void HideEncirclement(OutputDevice* pOut);
+ void DrawEncirclement(OutputDevice* pOut) const;
+
+ // ModelHasChanged wird gerufen, sobald nach beliebig vielen HINT_OBJCHG
+ // das System wieder idle ist (StarView-Timer). Wer diese Methode ueberlaed,
+ // muss unbedingt ModelHasChanged() der Basisklasse rufen.
+ virtual void ModelHasChanged();
+
+protected:
+ // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
+ SdrPaintView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ virtual ~SdrPaintView();
+
+public:
+ TYPEINFO();
+
+ virtual void ClearPageView();
+ SdrModel* GetModel() const { return pMod; }
+
+ virtual sal_Bool IsAction() const;
+ virtual void MovAction(const Point& rPnt);
+ virtual void EndAction();
+ virtual void BckAction();
+ virtual void BrkAction(); // Alle Actions z.B. Draggen abbrechen.
+ virtual void TakeActionRect(Rectangle& rRect) const;
+
+ // info about TextEdit. Default is sal_False.
+ virtual bool IsTextEdit() const;
+
+ // info about TextEditPageView. Default is 0L.
+ virtual SdrPageView* GetTextEditPageView() const;
+
+ // Muss dann bei jedem Fensterwechsel (wenn die SdrView in mehreren
+ // Fenstern gleichzeitig dargestellt wird (->z.B. Splitter)) und bei
+ // jedem MapMode(Scaling)-wechsel gerufen werden, damit ich aus meinen
+ // Pixelwerten logische Werte berechnen kann.
+ void SetActualWin(const OutputDevice* pWin);
+ void SetMinMoveDistancePixel(sal_uInt16 nVal) { nMinMovPix=nVal; TheresNewMapMode(); }
+ sal_uInt16 GetMinMoveDistancePixel() const { return (sal_uInt16)nMinMovPix; }
+ void SetHitTolerancePixel(sal_uInt16 nVal) { nHitTolPix=nVal; TheresNewMapMode(); }
+ sal_uInt16 GetHitTolerancePixel() const { return (sal_uInt16)nHitTolPix; }
+
+ // data read access on logic HitTolerance and MinMoveTolerance
+ sal_uInt16 getHitTolLog() const { return nHitTolLog; }
+ sal_uInt16 getMinMovLog() const { return nMinMovLog; }
+
+ // Flag zur Visualisierung von Gruppen abfragen/testen
+ sal_Bool DoVisualizeEnteredGroup() const { return bVisualizeEnteredGroup; }
+ void SetVisualizeEnteredGroup(sal_Bool bNew) { bVisualizeEnteredGroup = bNew; }
+
+ // Am DragStatus laesst sich beispielsweise erfragen, welche
+ // entfernung bereits gedraggd wurde, etc.
+ const SdrDragStat& GetDragStat() const { return aDragStat; }
+
+ // Anmelden/Abmelden einer PageView an der View.
+ // Dieselbe // Seite kann nicht mehrfach angemeldet werden.
+ // Methoden mit dem Suffix PgNum erwarten als numerischen Parameter
+ // eine Seitennummer (0...). Methoden mit dem Suffix PvNum erwarten
+ // degagen als numerischen Parameter die Nummer der PageView an der
+ // SdrView (Iterieren ueber alle angemeldeten Pages).
+ virtual SdrPageView* ShowSdrPage(SdrPage* pPage);
+ virtual void HideSdrPage();
+
+ // Iterieren ueber alle angemeldeten PageViews
+// sal_uInt16 GetPageViewCount() const { return sal_uInt16(aPagV.Count()); }
+// SdrPageView* GetPageViewByIndex(sal_uInt16 nPvNum) const { return ((SdrPageView*)aPagV.GetObject(nPvNum)); }
+ SdrPageView* GetSdrPageView() const { return mpPageView; }
+
+ // Pageview einer bestimmten Seite ermitteln
+// SdrPageView* GetPageViewByPage(const SdrPage* pPage) const;
+// sal_uInt16 GetIndexByPageView(const SdrPageView* pPV) const;
+
+ // Test, ob eine Seite getroffen
+// SdrPageView* HitPage(const Point& rPnt) const;
+
+ // Die Seite, die dem Punkt am naechsten ist. Liefert nur NULL,
+ // wenn absolut keine Seite angemeldet ist.
+// SdrPageView* GetPageViewByPosition(const Point& rPnt) const;
+
+ // Eine SdrView kann auf mehreren Fenstern gleichzeitig abgebiltet sein:
+ virtual void AddWindowToPaintView(OutputDevice* pNewWin);
+ virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin);
+
+ void SetLayerVisible(const String& rName, sal_Bool bShow=sal_True);
+ bool IsLayerVisible(const String& rName) const;
+
+ void SetLayerLocked(const String& rName, sal_Bool bLock=sal_True);
+ bool IsLayerLocked(const String& rName) const;
+
+ void SetLayerPrintable(const String& rName, sal_Bool bPrn=sal_True);
+ bool IsLayerPrintable(const String& rName) const;
+
+ // PrePaint call forwarded from app windows
+ void PrePaint();
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////////
+ // used internally for Draw/Impress/sch/chart2
+ virtual void CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0);
+
+ // #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 shall then be used as
+ // target for paints. Since paints may be buffered, use it's GetTargetOutputDevice() method which will
+ // return the buffer in case of bufered.
+ // DoCompleteRedraw draws the DrawingLayer hierarchy then.
+ // EndCompleteRedraw does the necessary refreshes, evtl. paints text edit and overlay and evtl destroys the
+ // SdrPaintWindow again. This means: the SdrPaintWindow is no longer safe after this closing call.
+ virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut);
+ virtual void DoCompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0);
+ 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 Region& rReg, bool bDisableIntersect = false);
+ // used when the region passed to BeginDrawLayers needs to be changed
+ void UpdateDrawLayersRegion(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect = false);
+ 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) const;
+
+ Region OptimizeDrawLayersRegion(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect);
+
+public:
+ sal_Bool IsPageVisible() const { return bPageVisible; } // Seite (weisse Flaeche) malen oder nicht
+ sal_Bool IsPageBorderVisible() const { return bPageBorderVisible; } // Seite (weisse Flaeche) malen oder nicht
+ sal_Bool IsBordVisible() const { return bBordVisible; } // Seitenrandlinie malen oder nicht
+ sal_Bool IsGridVisible() const { return bGridVisible; } // Rastergitter malen oder nicht
+ sal_Bool IsGridFront() const { return bGridFront ; } // Rastergitter ueber die Objekte druebermalen oder dahinter
+ sal_Bool IsHlplVisible() const { return bHlplVisible; } // Hilfslinien der Seiten malen oder nicht
+ sal_Bool IsHlplFront() const { return bHlplFront ; } // Hilfslinie ueber die Objekte druebermalen oder dahinter
+ sal_Bool IsGlueVisible() const { return bGlueVisible; } // Konnektoren der objekte sichtbar oder nicht
+ Color GetGridColor() const;
+ void SetPageVisible(bool bOn = true) { bPageVisible=bOn; InvalidateAllWin(); }
+ void SetPageBorderVisible(bool bOn = true) { bPageBorderVisible=bOn; InvalidateAllWin(); }
+ void SetBordVisible(bool bOn = true) { bBordVisible=bOn; InvalidateAllWin(); }
+ void SetGridVisible(bool bOn = true) { bGridVisible=bOn; InvalidateAllWin(); }
+ void SetGridFront(bool bOn = true) { bGridFront =bOn; InvalidateAllWin(); }
+ void SetHlplVisible(bool bOn = true) { bHlplVisible=bOn; InvalidateAllWin(); }
+ void SetHlplFront(bool bOn = true) { bHlplFront =bOn; InvalidateAllWin(); }
+ void SetGlueVisible(bool bOn = true) { if (bGlueVisible!=(unsigned)bOn) { bGlueVisible=bOn; if (!bGlueVisible2 && !bGlueVisible3 && !bGlueVisible4) GlueInvalidate(); } }
+ void SetGridColor( Color aColor );
+
+ sal_Bool IsPreviewRenderer() const { return (sal_Bool )mbPreviewRenderer; }
+ void SetPreviewRenderer(bool bOn) { if((unsigned)bOn != mbPreviewRenderer) { 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 != (bool)mbHideOle) mbHideOle = bNew; }
+ void setHideChart(bool bNew) { if(bNew != (bool)mbHideChart) mbHideChart = bNew; }
+ void setHideDraw(bool bNew) { if(bNew != (bool)mbHideDraw) mbHideDraw = bNew; }
+ void setHideFormControl(bool bNew) { if(bNew != (bool)mbHideFormControl) mbHideFormControl = bNew; }
+
+ void SetGridCoarse(const Size& rSiz) { aGridBig=rSiz; }
+ void SetGridFine(const Size& rSiz) { aGridFin=rSiz; if (aGridFin.Height()==0) aGridFin.Height()=aGridFin.Width(); if (bGridVisible) InvalidateAllWin(); } // #40479#
+ const Size& GetGridCoarse() const { return aGridBig; }
+ const Size& GetGridFine() const { return aGridFin; }
+
+ void InvalidateAllWin();
+ void InvalidateAllWin(const Rectangle& rRect, sal_Bool bPlus1Pix=sal_False);
+
+ // Wenn die View kein Invalidate() an den Fenstern durchfuehren soll, muss
+ // man diese beiden folgenden Methoden ueberladen und entsprechend anders
+ // reagieren.
+ virtual void InvalidateOneWin(Window& rWin);
+ virtual void InvalidateOneWin(Window& rWin, const Rectangle& rRect);
+
+ void SetActiveLayer(const String& rName) { aAktLayer=rName; }
+ const String& GetActiveLayer() const { return aAktLayer; }
+
+ // Verlassen einer betretenen Objektgruppe aller sichtbaren Seiten.
+ // (wie MsDos chdir ..)
+ void LeaveOneGroup();
+
+ // Verlassen aller betretenen Objektgruppen aller sichtbaren Seiten.
+ // (wie MsDos chdir \)
+ void LeaveAllGroup();
+
+ // Feststellen, ob Leave sinnvoll ist.
+ bool IsGroupEntered() const;
+
+ // DefaultAttribute an der View: Neu erzeugte Objekte bekommen diese
+ // Attribute direkt nach dem Erzeugen erstmal zugewiesen.
+ void SetDefaultAttr(const SfxItemSet& rAttr, sal_Bool bReplaceAll);
+ const SfxItemSet& GetDefaultAttr() const { return aDefaultAttr; }
+ void SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
+ SfxStyleSheet* GetDefaultStyleSheet() const { return pDefaultStyleSheet; }
+
+ void SetNotPersistDefaultAttr(const SfxItemSet& rAttr, sal_Bool bReplaceAll);
+ void MergeNotPersistDefaultAttr(SfxItemSet& rAttr, sal_Bool bOnlyHardAttr) const;
+
+ // use this mode as mode to draw all internal GraphicManager objects with
+ sal_uIntPtr GetGraphicManagerDrawMode() const { return nGraphicManagerDrawMode; }
+ void SetGraphicManagerDrawMode( sal_uIntPtr nMode ) { nGraphicManagerDrawMode = nMode; }
+
+ // SwapIn (z.B. von Grafiken) asynchron durchfuehren. Also nicht
+ // beim Paint sofort nachladen, sondern dort das Nachladen anstossen.
+ // Nach Abschluss des Nachladens wird das Objekt dann angezeigt.
+ // Hat nur z.Zt. Wirkung, wenn SwapGraphics am Model eingeschaltet ist.
+ // Default=FALSE. Flag ist nicht persistent.
+ sal_Bool IsSwapAsynchron() const { return bSwapAsynchron; }
+ void SetSwapAsynchron(sal_Bool bJa=sal_True) { bSwapAsynchron=bJa; }
+ virtual sal_Bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
+
+ virtual sal_Bool MouseButtonDown(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return sal_False; }
+ virtual sal_Bool MouseButtonUp(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return sal_False; }
+ virtual sal_Bool MouseMove(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return sal_False; }
+ virtual sal_Bool Command(const CommandEvent& /*rCEvt*/, Window* /*pWin*/) { return sal_False; }
+ sal_Bool Cut(sal_uIntPtr /*nFormat*/=SDR_ANYFORMAT) { return sal_False; }
+ sal_Bool Yank(sal_uIntPtr /*nFormat*/=SDR_ANYFORMAT) { return sal_False; }
+ sal_Bool Paste(Window* /*pWin*/=NULL, sal_uIntPtr /*nFormat*/=SDR_ANYFORMAT) { return sal_False; }
+
+ /* new interface src537 */
+ sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const;
+
+ sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll);
+ SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(sal_Bool& rOk) const;
+ sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
+
+ virtual void MakeVisible(const Rectangle& rRect, Window& rWin);
+
+ // Fuer PlugIn. Wird vom Paint des OLE-Obj gerufen.
+ virtual void DoConnect(SdrOle2Obj* pOleObj);
+
+ // Animation aktivieren/deaktivieren fuer ::Paint
+ // wird z.Zt. ausgewertet von SdrGrafObj, wenn in dem eine Animation steckt
+ // Das Unterbinden der automatischen Animation wird z.B. fuer die Dia-Show benoetigt
+ sal_Bool IsAnimationEnabled() const { return ( SDR_ANIMATION_ANIMATE == eAnimationMode ); }
+ void SetAnimationEnabled( sal_Bool bEnable=sal_True );
+
+ // set/unset pause state for animations
+ bool IsAnimationPause() const { return bAnimationPause; }
+ void SetAnimationPause( bool bSet );
+
+ // Verhalten beim Starten von Animation im Paint-Handler:
+ // 1. Animation normal starten( SDR_ANIMATION_ANIMATE ) => DEFAULT
+ // 2. Nur die Ersatzdarstellung der Animation zeichnen ( SDR_ANIMATION_DONT_ANIMATE )
+ // 3. Nicht starten und nichts ersatzweise ausgeben ( SDR_ANIMATION_DISABLE )
+ void SetAnimationMode( const SdrAnimationMode eMode );
+ SdrAnimationMode GetAnimationMode() const { return eAnimationMode; }
+
+ // bei bShow=sal_False wird der Browser destruiert
+#ifdef DBG_UTIL
+ void ShowItemBrowser(sal_Bool bShow=sal_True);
+ sal_Bool IsItemBrowserVisible() const { return pItemBrowser!=NULL && ((Window*)pItemBrowser)->IsVisible(); }
+ Window* GetItemBrowser() const { return (Window*)pItemBrowser; }
+#endif
+
+ // Muss von App beim Scrollen usw. gerufen werden, damit ein u.U.
+ // aktives FormularControl mitverschoben werden kann
+ void VisAreaChanged(const OutputDevice* pOut=NULL);
+ void VisAreaChanged(const SdrPageWindow& rWindow);
+
+ sal_Bool IsPrintPreview() const { return bPrintPreview; }
+ void SetPrintPreview(bool bOn = true) { bPrintPreview=bOn; }
+
+ virtual 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 //_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 000000000000..d89fdc1ac51d
--- /dev/null
+++ b/include/svx/svdpoev.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 _SVDPOEV_HXX
+#define _SVDPOEV_HXX
+
+#include "svx/svxdllapi.h"
+#include <svx/svdedtv.hxx>
+
+#include "svx/ipolypolygoneditorcontroller.hxx"
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@@@@ @@@@ @@ @@ @@ @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
+// @@@@@ @@ @@ @@ @@@@ @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
+// @@ @@@@ @@@@@ @@ @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrPolyEditView: public SdrEditView, public IPolyPolygonEditorController
+{
+ friend class SdrEditView;
+
+protected:
+ sal_Bool bSetMarkedPointsSmoothPossible : 1;
+ sal_Bool bSetMarkedSegmentsKindPossible : 1;
+
+ SdrPathSmoothKind eMarkedPointsSmooth;
+ SdrPathSegmentKind eMarkedSegmentsKind;
+
+private:
+ SVX_DLLPRIVATE void ImpClearVars();
+ SVX_DLLPRIVATE void ImpResetPolyPossibilityFlags();
+ SVX_DLLPRIVATE void ImpCheckPolyPossibilities();
+
+ typedef void (*PPolyTrFunc)(Point&, Point*, Point*, const void*, const void*, const void*, const void*, const void*);
+ SVX_DLLPRIVATE void ImpTransformMarkedPoints(PPolyTrFunc pTrFunc, const void* p1=NULL, const void* p2=NULL, const void* p3=NULL, const void* p4=NULL, const void* p5=NULL);
+
+protected:
+ // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
+ SdrPolyEditView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ virtual ~SdrPolyEditView();
+
+public:
+ sal_Bool IsSetMarkedPointsSmoothPossible() const;
+ SdrPathSmoothKind GetMarkedPointsSmooth() const;
+ void SetMarkedPointsSmooth(SdrPathSmoothKind eKind);
+
+ // Ein PolySegment kann eine Strecke oder eine Bezierkurve sein.
+ sal_Bool IsSetMarkedSegmentsKindPossible() const;
+ SdrPathSegmentKind GetMarkedSegmentsKind() const;
+ void SetMarkedSegmentsKind(SdrPathSegmentKind eKind);
+
+ // Moeglicherweise ist das Obj hinterher geloescht:
+ void DeleteMarkedPoints();
+ sal_Bool IsDeleteMarkedPointsPossible() const;
+
+ void MoveMarkedPoints(const Size& rSiz, bool bCopy=false);
+ void ResizeMarkedPoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false);
+ void RotateMarkedPoints(const Point& rRef, long nWink, bool bCopy=false);
+
+ // Hierbei entstehen eventuell beliebig viele neue Objekte:
+ void RipUpAtMarkedPoints();
+ bool IsRipUpAtMarkedPointsPossible() const;
+
+ // Alle markierten Polylines werden zu Polygonen, alle offenen
+ // Bezierkurven zu geschlossenen.
+ void CloseMarkedObjects(sal_Bool bToggle=sal_False, sal_Bool bOpen=sal_False); // , long nOpenDistance=0);
+ bool IsOpenCloseMarkedObjectsPossible() const;
+ SdrObjClosedKind GetMarkedObjectsClosedState() const;
+
+ void CheckPolyPossibilitiesHelper( SdrMark* pM, bool& b1stSmooth, bool& b1stSegm, bool& bCurve, bool& bSmoothFuz, bool& bSegmFuz, basegfx::B2VectorContinuity& eSmooth );
+};
+
+#endif //_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 000000000000..e90e6d89c5f9
--- /dev/null
+++ b/include/svx/svdpool.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 _SVDPOOL_HXX
+#define _SVDPOOL_HXX
+
+#include <svx/xpool.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+class XLineAttrSetItem;
+class XFillAttrSetItem;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrItemPool : public XOutdevItemPool
+{
+public:
+ SdrItemPool(SfxItemPool* pMaster = 0L, sal_Bool bLoadRefCounts = sal_True);
+ SdrItemPool(const SdrItemPool& rPool);
+protected:
+ virtual ~SdrItemPool();
+public:
+
+ virtual SfxItemPool* Clone() const;
+ virtual SfxItemPresentation GetPresentation(const SfxPoolItem& rItem,
+ SfxItemPresentation ePresentation,
+ SfxMapUnit ePresentationMetric,
+ OUString& rText,
+ const IntlWrapper * pIntlWrapper
+ = 0) const;
+
+ static void TakeItemName(sal_uInt16 nWhich, OUString& rItemName);
+};
+
+#endif // _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 000000000000..95e93858467e
--- /dev/null
+++ b/include/svx/svdsnpv.hxx
@@ -0,0 +1,330 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDSNPV_HXX
+#define _SVDSNPV_HXX
+
+#include <svx/svdpntv.hxx>
+#include <svx/svdhlpln.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Defines
+//************************************************************
+
+#define SDRSNAP_NOTSNAPPED 0x0000
+#define SDRSNAP_XSNAPPED 0x0001
+#define SDRSNAP_YSNAPPED 0x0002
+#define SDRSNAP_XYSNAPPED 0x0003
+
+// SDRCROOK_STRETCH ist noch nicht implementiert!
+enum SdrCrookMode {
+ SDRCROOK_ROTATE,
+ SDRCROOK_SLANT,
+ SDRCROOK_STRETCH
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@@@ @@ @@ @@@@ @@@@@ @@ @@ @@ @@@@@ @@ @@
+// @@ @@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
+// @@@@ @@@@@@ @@@@@@ @@@@@ @@@@@ @@ @@@@ @@@@@@@
+// @@ @@ @@@ @@ @@ @@ @@@ @@ @@ @@@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
+// @@@@ @@ @@ @@ @@ @@ @ @@ @@@@@ @@ @@
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// #114409#-1 Migrate PageOrigin
+class ImplPageOriginOverlay;
+
+class SVX_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;
+
+ unsigned bSnapEnab : 1;
+ unsigned bGridSnap : 1;
+ unsigned bSnapTo1Pix : 1; // Wenn GridSnap aus, auf ein Pixel fangen um Werte wie 10.01 zu vermeiden
+ unsigned bBordSnap : 1;
+ unsigned bHlplSnap : 1;
+ unsigned bOFrmSnap : 1;
+ unsigned bOPntSnap : 1;
+ unsigned bOConSnap : 1;
+ unsigned bMoveMFrmSnap : 1;
+ unsigned bMoveOFrmSnap : 1;
+ unsigned bMoveOPntSnap : 1;
+ unsigned bMoveOConSnap : 1;
+ unsigned bMoveSnapOnlyTopLeft : 1; // Speacial fuer den Dialogeditor
+ unsigned bOrtho : 1;
+ unsigned bBigOrtho : 1;
+ unsigned bAngleSnapEnab : 1;
+ unsigned bMoveOnlyDragging : 1; // Objekte nur verschieben bei Resize/Rotate/...
+ unsigned bSlantButShear : 1; // Slant anstelle von Shear anwenden
+ unsigned bCrookNoContortion : 1; // Objekte bei Crook nicht verzerren
+ unsigned bHlplFixed : 1; // sal_True=Hilfslinien fixiert, also nicht verschiebbar
+ unsigned bEliminatePolyPoints : 1;
+
+private:
+ SVX_DLLPRIVATE void ClearVars();
+
+protected:
+ // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
+ SdrSnapView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ virtual ~SdrSnapView();
+
+public:
+ virtual sal_Bool IsAction() const;
+ virtual void MovAction(const Point& rPnt);
+ virtual void EndAction();
+ virtual void BckAction();
+ virtual void BrkAction(); // f.abg.Klassen Actions z,B, Draggen abbrechen.
+ virtual void TakeActionRect(Rectangle& rRect) const;
+
+ 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; } }
+ const Size& GetSnapMagnetic() const { return aMagnSiz; }
+ void SetSnapMagneticPixel(sal_uInt16 nPix) { nMagnSizPix=nPix; }
+ sal_uInt16 GetSnapMagneticPixel() const { return nMagnSizPix; }
+
+ // RecalcLogicSnapMagnetic muss bei jedem Wechsel des OutputDevices
+ // sowie bei jedem Wechsel des MapModes gerufen werden!
+ void RecalcLogicSnapMagnetic(const OutputDevice& rOut) { SetSnapMagnetic(rOut.PixelToLogic(Size(nMagnSizPix,nMagnSizPix))); }
+ void SetActualWin(const OutputDevice* pWin) { SdrPaintView::SetActualWin(pWin); if (pWin!=NULL) RecalcLogicSnapMagnetic(*pWin); }
+
+ // Auf die View bezogene Koordinaten!
+ // Rueckgabewerte sind SDRSNAP_NOTSNAPPED,SDRSNAP_XSNAPPED,
+ // SDRSNAP_YSNAPPED oder SDRSNAP_XYSNAPPED
+ sal_uInt16 SnapPos(Point& rPnt, const SdrPageView* pPV) const;
+ Point GetSnapPos(const Point& rPnt, const SdrPageView* pPV) const;
+ void CheckSnap(const Point& rPt, const SdrPageView* pPV, long& nBestXSnap, long& nBestYSnap, bool& bXSnapped, bool& bYSnapped) const;
+
+ // Alle Fangeinstellungen sind Persistent.
+ sal_Bool IsSnapEnabled() const { return bSnapEnab; }
+ sal_Bool IsGridSnap() const { return bGridSnap; } // Fang auf Rastergitter
+ sal_Bool IsBordSnap() const { return bBordSnap; } // Fang auf Seitenraender
+ sal_Bool IsHlplSnap() const { return bHlplSnap; } // Fang auf Hilfslinien
+ sal_Bool IsOFrmSnap() const { return bOFrmSnap; } // Fang auf LogFram von umgebenden Zeichenobjekten
+ sal_Bool IsOPntSnap() const { return bOPntSnap; } // Fang auf ausgepraegte Punkte von umgebenden Zeichenobjekten
+ sal_Bool IsOConSnap() const { return bOConSnap; } // Fang auf Konnektoren der Zeichenobjekte
+ void SetSnapEnabled(sal_Bool bOn) { bSnapEnab=bOn; }
+ void SetGridSnap(sal_Bool bOn) { bGridSnap=bOn; }
+ void SetBordSnap(sal_Bool bOn) { bBordSnap=bOn; }
+ void SetHlplSnap(sal_Bool bOn) { bHlplSnap=bOn; }
+ void SetOFrmSnap(sal_Bool bOn) { bOFrmSnap=bOn; }
+ void SetOPntSnap(sal_Bool bOn) { bOPntSnap=bOn; }
+ void SetOConSnap(sal_Bool bOn) { bOConSnap=bOn; }
+
+ // Normalerweise werden beim Move-Dragging von Zeichenobjekten alle
+ // 4 Ecken des Object-SnapRects gefangen. Folgende Einstellmoeglichkeit,
+ // wenn man nur auf die linke obere Ecke fangen will (z.B. DialogEditor):
+ // Persistent, Default=FALSE.
+ void SetMoveSnapOnlyTopLeft(sal_Bool bOn) { bMoveSnapOnlyTopLeft=bOn; }
+ sal_Bool IsMoveSnapOnlyTopLeft() const { return bMoveSnapOnlyTopLeft; }
+
+ // Hilfslinien fixiert (nicht verschiebbar)
+ // Persistent, Default=FALSE.
+ sal_Bool IsHlplFixed() const { return bHlplFixed; }
+ void SetHlplFixed(sal_Bool bOn) { bHlplFixed=bOn; }
+
+ sal_Bool IsMoveMFrmSnap() const { return bMoveMFrmSnap; } // Fang des LogFram aller markierten Objekte
+ sal_Bool IsMoveOFrmSnap() const { return bMoveOFrmSnap; } // Fang aller LogFram der markierten Objekte
+ sal_Bool IsMoveOPntSnap() const { return bMoveOPntSnap; } // Fang ausgepraegter Punkte der markierten Objekte
+ sal_Bool IsMoveOConSnap() const { return bMoveOConSnap; } // Fang der Konnektoren der markierten Objekte
+
+ void SetMoveMFrmSnap(sal_Bool bOn) { bMoveMFrmSnap=bOn; }
+ void SetMoveOFrmSnap(sal_Bool bOn) { bMoveOFrmSnap=bOn; }
+ void SetMoveOPntSnap(sal_Bool bOn) { bMoveOPntSnap=bOn; }
+ void SetMoveOConSnap(sal_Bool bOn) { bMoveOConSnap=bOn; }
+
+ // #114409#-1 Migrate PageOrigin
+ sal_Bool BegSetPageOrg(const Point& rPnt);
+ void MovSetPageOrg(const Point& rPnt);
+ sal_Bool EndSetPageOrg();
+ void BrkSetPageOrg();
+ sal_Bool IsSetPageOrg() const { return (0L != mpPageOriginOverlay); }
+
+ // HitTest. Bei sal_True steht in rnHelpLineNum die Nummer der Hilfslinie und in rpPV
+ // die zugehoerige PageView.
+ sal_Bool PickHelpLine(const Point& rPnt, short nTol, const OutputDevice& rOut, sal_uInt16& rnHelpLineNum, SdrPageView*& rpPV) const;
+
+ // Verschieben einer vorhandenen Hilfslinie. nHelpLineNum und pPV von PickHelpLine verwenden.
+ sal_Bool BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView* pPV);
+ // Interaktives einfuegen einer neuen Hilfslinie
+ sal_Bool BegDragHelpLine(const Point& rPnt, SdrHelpLineKind eNewKind);
+ Pointer GetDraggedHelpLinePointer() const;
+
+ // Aendern des Hilfslinientyps waerend des draggens
+ // void SetDraggedHelpLineKind(SdrHelpLineKind eNewKind);
+ void MovDragHelpLine(const Point& rPnt);
+ sal_Bool EndDragHelpLine();
+ void BrkDragHelpLine();
+ sal_Bool IsDragHelpLine() const { return (0L != mpHelpLineOverlay); }
+
+ // SnapAngle ist fuer Winkel im Kreis, RotateDragging, ...
+ // Der Winkelfang wird unterdrueckt, wenn er mit
+ // durch SetAngleSnapEnabled(sal_False) ausgeschaltet ist.
+ // Der Winkelfang ist unabhaengig vom Koordinatenfang
+ // und somit von der Einstellung IsSnapEnabled()
+ // Es sollten nur Werte angegeben werden fuer die gilt:
+ // 36000 modulu nWink = 0
+ // Implementiert fuer:
+ // - Rotate (Dragging)
+ // - Shear (Dragging)
+ // - Kreisbogen/-sektor/-abschnitt Winkel (Create und Dragging)
+ // Persistent.
+ void SetAngleSnapEnabled(sal_Bool bOn) { bAngleSnapEnab=bOn; }
+ sal_Bool IsAngleSnapEnabled() const { return bAngleSnapEnab; }
+ void SetSnapAngle(long nWink) { nSnapAngle=nWink; }
+ long GetSnapAngle() const { return nSnapAngle; }
+
+ // Ortho hat je nach Kontext verschiedene Effekte:
+ // - Create
+ // - Linien werden nur im 45deg Raster zugelassen
+ // - Statt Rechtecke werden Quadrate erzeugt
+ // - Statt Ellipsen werden Kreise erzeugt
+ // - Dragging
+ // - allgemeines Dragging
+ // - Move nur Hor, Vert oder 45deg
+ // - Resize proportional
+ // - Mirror: nichts
+ // - Shear ohne Resize
+ // - Crook ohne Resize
+ // - verschieben der Handles
+ // - Spiegelachse nur 45deg Raster
+ // - Objekteigenes Dragging
+ // - Rechteck Eckenradius: nichts
+ // - Kreisobjekt Winkel: nichts
+ // - Linie behaelt beim Draggen ihren Winkel bei und wird nur (ni)
+ // verlaengert bzw. verkuerzt.
+ // Defaultmaessig ist Ortho ausgeschaltet. Persistent.
+ void SetOrtho(bool bOn) { bOrtho=bOn; } // unvollstaendig
+ bool IsOrtho() const { return bOrtho; }
+
+ // BigOrtho hat nur Relevanz wenn Ortho eingeschaltet ist.
+ // Beispiel: Ein Rechteck wird mit eingeschaltetem Ortho (also ein Quadrat)
+ // erzeugt und die Maus wurde dabei vom Nullpunkt zu den Koordinaten
+ // (80,30) gedraggt. Dann stuenden nun 2 Alternativen zur Bestimmung der
+ // Kantenlaenge des Quadrats zur Wahl: 30 und 80.
+ // Die normale Ortho-Funktuionalitaet brachte hierbei ein Quadrat mit
+ // Kantenlaenge 30 (also immer die kleinere Groesse). Bei hinzugeschal-
+ // tetem BigOrtho bekaeme man dagegen ein Quadrat der Kantenlaenge 80.
+ // Gleiches gilt auch fuer Resize.
+ // Defaultmaessig ist BigOrtho eingeschaltet. Persistent.
+ void SetBigOrtho(bool bOn) { bBigOrtho=bOn; }
+ bool IsBigOrtho() const { return bBigOrtho; }
+
+ // bei MoveOnlyDragging=sal_True wird bei Resize/Rotate/Shear/Mirror/Crook
+ // nur das Zentrum der markierten Objekte transformiert. Groesse, Form
+ // und Drehwinkel der Objekte bleiben erhalten, nur ihre Positionen
+ // aendern sich. Persistent. Default=FALSE. (ni)
+ void SetMoveOnlyDragging(sal_Bool bOn) { bMoveOnlyDragging=bOn; }
+ sal_Bool IsMoveOnlyDragging() const { return bMoveOnlyDragging; }
+
+ // Slant anstelle von Shear anwenden. Persistent. Default=FALSE.
+ void SetSlantButShear(sal_Bool bOn) { bSlantButShear=bOn; }
+ sal_Bool IsSlantButShear() const { return bSlantButShear; }
+
+ // Objekte bei Crook nicht verzerren. Persistent. Default=FALSE. (ni)
+ void SetCrookNoContortion(sal_Bool bOn) { bCrookNoContortion=bOn; }
+ sal_Bool IsCrookNoContortion() const { return bCrookNoContortion; }
+
+ // Crook-Modus. Persistent. Default=SDRCROOK_ROTATE. (ni)
+ void SetCrookMode(SdrCrookMode eMode) { eCrookMode=eMode; }
+ SdrCrookMode GetCrookMode() const { return eCrookMode; }
+
+ // Special fuer IBM: Beim Draggen eines Polygonpunkts wird dieser
+ // geloescht, wenn seine beiden angrenzenden Linien eh' fast eine
+ // durchgehende Linie sind.
+ void SetEliminatePolyPoints(sal_Bool bOn) { bEliminatePolyPoints=bOn; }
+ sal_Bool IsEliminatePolyPoints() const { return bEliminatePolyPoints; }
+ void SetEliminatePolyPointLimitAngle(long nAngle) { nEliminatePolyPointLimitAngle=nAngle; }
+ long GetEliminatePolyPointLimitAngle() const { return nEliminatePolyPointLimitAngle; }
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Begriffsdefinition:
+// - Etwas fangen=Gefangen werden kann z.B. der Mauszeiger oder die z.Zt. im
+// Drag befindlichen markierten Objekte.
+// - Auf etwas fangen=Man kann z.B. auf das Grid oder auf Hilfslinien fangen.
+//
+// Grundsaetzlich wird nur gefangen auf sichtbare Elemente (-> Border,
+// Hilfslinien, Konnektoren; Ausnahme: Grid). Ebenso koennen nur sichtbare
+// Elemente gefangen werden (->Konnektoren).
+//
+// Auf's Grid wird immer erst dann gefangen, wenn nix Anderes in der Naehe
+// (->Magnetic) ist.
+//
+// Der "Cursor" (also der Mauszeiger) beim Erzeugen von Objekten, beim Draggen
+// von Polygonpunkten, ... wird immer auf allen eingeschalteten Fangalternativen
+// gefangen (max 6).
+//
+// Beim Verschieben markierter Objekte ist das etwas anders. Statt des einen
+// Mauscursors gibt es hier 4 Alternativen an den markierten Objekten, die
+// gefangen werden koennen:
+// 1. die logisch-umschliessenden Rahmen der einzelnen Objekte
+// 2. der logisch-umschliessende Rahmen aller markierten Objekte
+// 3. ausgezeichnete Punkte der markierten Objekte (Polygonpunkte, ...)
+// 4. die Konnektoren der markierten Objekte
+// Da 1. und 2. einander ausschliessen (2. ist eine Verfeinerung von 1.)
+// bleiben 3 voneinander unabhaengige Alternativen. Bei 6. Moeglichkeiten auf
+// die gefangen werden kann kaeme man auf max. 18 Kombinationsmoeglichkeiten!
+// Deshalb werden folgende Vereinfachungen festgelegt:
+// 1. Konnektoren fangen sich nur auf Konnektoren.
+// Verbleiben also nun noch max. 2x5+1=11 Fangkombinationen beim MoveDrag:
+// 1-3. umschliessende(r) Rahmen auf Grid/Border/Hilfslinien
+// 4. umschliessende(r) Rahmen auf ausgezeichnete Objektpunkte
+// 5. umschliessende(r) Rahmen auf umschliessenden Rahmen
+// 6-8. ausgezeichnete Punkte auf Grid/Border/Hilfslinien
+// 7. ausgezeichnete Punkte auf ausgezeichnete Objektpunkte
+// 8-10. ausgezeichnete Punkte auf umschliessenden Rahmen
+// 11. Konnektoren auf Konnektoren
+// Beim MouseMove-Event im DragMove werden also diese bis zu max. 11 moeglichen
+// Alternativen durchgetestet und die mit dem gerigsten Korrekturaufwand
+// vollzogen.
+//
+// Beim Resize, ... wird immer nur der logisch-umschliessende Rahmen der
+// markierten Objekte gefangen.
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..146731c996e8
--- /dev/null
+++ b/include/svx/svdsob.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 _SVDSOB_HXX
+#define _SVDSOB_HXX
+
+#include <com/sun/star/uno/Any.hxx>
+#include <tools/stream.hxx>
+
+#include "svx/svxdllapi.h"
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/*
+ Deklaration eines statischen Mengentyps. Die Menge kann die Elemente
+ 0..255 aufnehmen und verbraucht stets 32 Bytes.
+*/
+
+class SVX_DLLPUBLIC SetOfByte
+{
+protected:
+ sal_uInt8 aData[32];
+
+public:
+ explicit SetOfByte(sal_Bool bInitVal = sal_False)
+ {
+ memset(aData, bInitVal ? 0xFF : 0x00, sizeof(aData));
+ }
+
+ sal_Bool operator==(const SetOfByte& rCmpSet) const
+ {
+ return (memcmp(aData, rCmpSet.aData, sizeof(aData)) == 0);
+ }
+
+ sal_Bool operator!=(const SetOfByte& rCmpSet) const
+ {
+ return (memcmp(aData, rCmpSet.aData, sizeof(aData))!=0);
+ }
+
+ void Set(sal_uInt8 a)
+ {
+ aData[a/8] |= 1<<a%8;
+ }
+
+ void Clear(sal_uInt8 a)
+ {
+ aData[a/8] &= ~(1<<a%8);
+ }
+
+ void Set(sal_uInt8 a, sal_Bool b)
+ {
+ if(b)
+ Set(a);
+ else
+ Clear(a);
+ }
+
+ sal_Bool IsSet(sal_uInt8 a) const
+ {
+ return (aData[a/8] & 1<<a%8) != 0;
+ }
+
+ void SetAll()
+ {
+ memset(aData, 0xFF, sizeof(aData));
+ }
+
+ void ClearAll()
+ {
+ memset(aData, 0x00, sizeof(aData));
+ }
+
+ sal_Bool IsEmpty() const;
+
+ void operator&=(const SetOfByte& r2ndSet);
+ void operator|=(const SetOfByte& r2ndSet);
+
+ friend inline SvStream& operator<<(SvStream& rOut, const SetOfByte& rSet);
+ friend inline SvStream& operator>>(SvStream& rIn, SetOfByte& rSet);
+
+ // initialize this set with a uno sequence of sal_Int8
+ void PutValue(const com::sun::star::uno::Any & rAny);
+
+ // returns a uno sequence of sal_Int8
+ void QueryValue(com::sun::star::uno::Any & rAny) const;
+};
+
+inline SvStream& operator<<(SvStream& rOut, const SetOfByte& rSet)
+{
+ rOut.Write((char*)rSet.aData,32);
+ return rOut;
+}
+
+inline SvStream& operator>>(SvStream& rIn, SetOfByte& rSet)
+{
+ rIn.Read((char*)rSet.aData,32);
+ return rIn;
+}
+
+#endif // _SVDSOB_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svdstr.hrc b/include/svx/svdstr.hrc
new file mode 100644
index 000000000000..a78d88dfdb2d
--- /dev/null
+++ b/include/svx/svdstr.hrc
@@ -0,0 +1,718 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#define SDR_ResourceBegin 2560
+
+// Attention: All strings between SDR_StringCacheBegin and
+// SDR_StringCacheEnd must be aligned next to each other.
+
+#define STR_ObjNameBegin (SDR_ResourceBegin)
+#define STR_ObjNameSingulNONE (STR_ObjNameBegin + 0)
+#define STR_ObjNamePluralNONE (STR_ObjNameBegin + 1)
+#define STR_ObjNameSingulGRUP (STR_ObjNameBegin + 2)
+#define STR_ObjNamePluralGRUP (STR_ObjNameBegin + 3)
+#define STR_ObjNameSingulGRUPEMPTY (STR_ObjNameBegin + 4)
+#define STR_ObjNamePluralGRUPEMPTY (STR_ObjNameBegin + 5)
+#define STR_ObjNameSingulTable (STR_ObjNameBegin + 6)
+#define STR_ObjNamePluralTable (STR_ObjNameBegin + 7)
+#define STR_ObjNameSingulLINE (STR_ObjNameBegin + 8)
+#define STR_ObjNameSingulLINE_Hori (STR_ObjNameBegin + 9)
+#define STR_ObjNameSingulLINE_Vert (STR_ObjNameBegin + 10)
+#define STR_ObjNameSingulLINE_Diag (STR_ObjNameBegin + 11)
+#define STR_ObjNamePluralLINE (STR_ObjNameBegin + 12)
+#define STR_ObjNameSingulRECT (STR_ObjNameBegin + 13)
+#define STR_ObjNamePluralRECT (STR_ObjNameBegin + 14)
+#define STR_ObjNameSingulQUAD (STR_ObjNameBegin + 15)
+#define STR_ObjNamePluralQUAD (STR_ObjNameBegin + 16)
+#define STR_ObjNameSingulPARAL (STR_ObjNameBegin + 17)
+#define STR_ObjNamePluralPARAL (STR_ObjNameBegin + 18)
+#define STR_ObjNameSingulRAUTE (STR_ObjNameBegin + 19)
+#define STR_ObjNamePluralRAUTE (STR_ObjNameBegin + 20)
+#define STR_ObjNameSingulRECTRND (STR_ObjNameBegin + 21)
+#define STR_ObjNamePluralRECTRND (STR_ObjNameBegin + 22)
+#define STR_ObjNameSingulQUADRND (STR_ObjNameBegin + 23)
+#define STR_ObjNamePluralQUADRND (STR_ObjNameBegin + 24)
+#define STR_ObjNameSingulPARALRND (STR_ObjNameBegin + 25)
+#define STR_ObjNamePluralPARALRND (STR_ObjNameBegin + 26)
+#define STR_ObjNameSingulRAUTERND (STR_ObjNameBegin + 27)
+#define STR_ObjNamePluralRAUTERND (STR_ObjNameBegin + 28)
+#define STR_ObjNameSingulCIRC (STR_ObjNameBegin + 29)
+#define STR_ObjNamePluralCIRC (STR_ObjNameBegin + 30)
+#define STR_ObjNameSingulSECT (STR_ObjNameBegin + 31)
+#define STR_ObjNamePluralSECT (STR_ObjNameBegin + 32)
+#define STR_ObjNameSingulCARC (STR_ObjNameBegin + 33)
+#define STR_ObjNamePluralCARC (STR_ObjNameBegin + 34)
+#define STR_ObjNameSingulCCUT (STR_ObjNameBegin + 35)
+#define STR_ObjNamePluralCCUT (STR_ObjNameBegin + 36)
+#define STR_ObjNameSingulCIRCE (STR_ObjNameBegin + 37)
+#define STR_ObjNamePluralCIRCE (STR_ObjNameBegin + 38)
+#define STR_ObjNameSingulSECTE (STR_ObjNameBegin + 39)
+#define STR_ObjNamePluralSECTE (STR_ObjNameBegin + 40)
+#define STR_ObjNameSingulCARCE (STR_ObjNameBegin + 41)
+#define STR_ObjNamePluralCARCE (STR_ObjNameBegin + 42)
+#define STR_ObjNameSingulCCUTE (STR_ObjNameBegin + 43)
+#define STR_ObjNamePluralCCUTE (STR_ObjNameBegin + 44)
+#define STR_ObjNameSingulPOLY (STR_ObjNameBegin + 45)
+#define STR_ObjNameSingulPOLY_PntAnz (STR_ObjNameBegin + 46)
+#define STR_ObjNamePluralPOLY (STR_ObjNameBegin + 47)
+#define STR_ObjNameSingulPLIN (STR_ObjNameBegin + 48)
+#define STR_ObjNameSingulPLIN_PntAnz (STR_ObjNameBegin + 49)
+#define STR_ObjNamePluralPLIN (STR_ObjNameBegin + 50)
+#define STR_ObjNameSingulPATHLINE (STR_ObjNameBegin + 51)
+#define STR_ObjNamePluralPATHLINE (STR_ObjNameBegin + 52)
+#define STR_ObjNameSingulPATHFILL (STR_ObjNameBegin + 53)
+#define STR_ObjNamePluralPATHFILL (STR_ObjNameBegin + 54)
+#define STR_ObjNameSingulFREELINE (STR_ObjNameBegin + 55)
+#define STR_ObjNamePluralFREELINE (STR_ObjNameBegin + 56)
+#define STR_ObjNameSingulFREEFILL (STR_ObjNameBegin + 57)
+#define STR_ObjNamePluralFREEFILL (STR_ObjNameBegin + 58)
+#define STR_ObjNameSingulCOMBLINE (STR_ObjNameBegin + 59)
+#define STR_ObjNamePluralCOMBLINE (STR_ObjNameBegin + 60)
+#define STR_ObjNameSingulCOMBFILL (STR_ObjNameBegin + 61)
+#define STR_ObjNamePluralCOMBFILL (STR_ObjNameBegin + 62)
+#define STR_ObjNameSingulNATSPLN (STR_ObjNameBegin + 63)
+#define STR_ObjNamePluralNATSPLN (STR_ObjNameBegin + 64)
+#define STR_ObjNameSingulPERSPLN (STR_ObjNameBegin + 65)
+#define STR_ObjNamePluralPERSPLN (STR_ObjNameBegin + 66)
+#define STR_ObjNameSingulTEXT (STR_ObjNameBegin + 67)
+#define STR_ObjNamePluralTEXT (STR_ObjNameBegin + 68)
+#define STR_ObjNameSingulTEXTLNK (STR_ObjNameBegin + 69)
+#define STR_ObjNamePluralTEXTLNK (STR_ObjNameBegin + 70)
+#define STR_ObjNameSingulFITTEXT (STR_ObjNameBegin + 71)
+#define STR_ObjNamePluralFITTEXT (STR_ObjNameBegin + 72)
+#define STR_ObjNameSingulFITALLTEXT (STR_ObjNameBegin + 73)
+#define STR_ObjNamePluralFITALLTEXT (STR_ObjNameBegin + 74)
+#define STR_ObjNameSingulTITLETEXT (STR_ObjNameBegin + 75)
+#define STR_ObjNamePluralTITLETEXT (STR_ObjNameBegin + 76)
+#define STR_ObjNameSingulOUTLINETEXT (STR_ObjNameBegin + 77)
+#define STR_ObjNamePluralOUTLINETEXT (STR_ObjNameBegin + 78)
+#define STR_ObjNameSingulGRAF (STR_ObjNameBegin + 79)
+#define STR_ObjNamePluralGRAF (STR_ObjNameBegin + 80)
+#define STR_ObjNameSingulGRAFLNK (STR_ObjNameBegin + 81)
+#define STR_ObjNamePluralGRAFLNK (STR_ObjNameBegin + 82)
+#define STR_ObjNameSingulGRAFNONE (STR_ObjNameBegin + 83)
+#define STR_ObjNamePluralGRAFNONE (STR_ObjNameBegin + 84)
+#define STR_ObjNameSingulGRAFNONELNK (STR_ObjNameBegin + 85)
+#define STR_ObjNamePluralGRAFNONELNK (STR_ObjNameBegin + 86)
+#define STR_ObjNameSingulGRAFMTF (STR_ObjNameBegin + 87)
+#define STR_ObjNamePluralGRAFMTF (STR_ObjNameBegin + 88)
+#define STR_ObjNameSingulGRAFMTFLNK (STR_ObjNameBegin + 89)
+#define STR_ObjNamePluralGRAFMTFLNK (STR_ObjNameBegin + 90)
+#define STR_ObjNameSingulGRAFBMP (STR_ObjNameBegin + 91)
+#define STR_ObjNamePluralGRAFBMP (STR_ObjNameBegin + 92)
+#define STR_ObjNameSingulGRAFBMPLNK (STR_ObjNameBegin + 93)
+#define STR_ObjNamePluralGRAFBMPLNK (STR_ObjNameBegin + 94)
+#define STR_ObjNameSingulGRAFMAC (STR_ObjNameBegin + 95)
+#define STR_ObjNamePluralGRAFMAC (STR_ObjNameBegin + 96)
+#define STR_ObjNameSingulGRAFMACLNK (STR_ObjNameBegin + 97)
+#define STR_ObjNamePluralGRAFMACLNK (STR_ObjNameBegin + 98)
+#define STR_ObjNameSingulOLE2 (STR_ObjNameBegin + 99)
+#define STR_ObjNamePluralOLE2 (STR_ObjNameBegin +100)
+#define STR_ObjNameSingulOLE2LNK (STR_ObjNameBegin +101)
+#define STR_ObjNamePluralOLE2LNK (STR_ObjNameBegin +102)
+#define STR_ObjOLE2NamePrefix (STR_ObjNameBegin +103)
+#define STR_ObjNameSingulFrame (STR_ObjNameBegin +104)
+#define STR_ObjNamePluralFrame (STR_ObjNameBegin +105)
+#define STR_ObjFrameNamePrefix (STR_ObjNameBegin +106)
+#define STR_ObjNameSingulEDGE (STR_ObjNameBegin +107)
+#define STR_ObjNamePluralEDGE (STR_ObjNameBegin +108)
+#define STR_ObjNameSingulCAPTION (STR_ObjNameBegin +109)
+#define STR_ObjNamePluralCAPTION (STR_ObjNameBegin +110)
+#define STR_ObjNameSingulPAGE (STR_ObjNameBegin +111)
+#define STR_ObjNamePluralPAGE (STR_ObjNameBegin +112)
+#define STR_ObjNameSingulMEASURE (STR_ObjNameBegin +113)
+#define STR_ObjNamePluralMEASURE (STR_ObjNameBegin +114)
+#define STR_ObjNamePlural (STR_ObjNameBegin +115)
+#define STR_ObjNameNoObj (STR_ObjNameBegin +116)
+#define STR_ObjNameAnd (STR_ObjNameBegin +117)
+#define STR_ObjNameSingulPlural (STR_ObjNameBegin +118)
+#define STR_ObjNameSingulUno (STR_ObjNameBegin +119)
+#define STR_ObjNamePluralUno (STR_ObjNameBegin +120)
+
+#define STR_ObjNameSingulCube3d (STR_ObjNameBegin + 121)
+#define STR_ObjNamePluralCube3d (STR_ObjNameBegin + 122)
+#define STR_ObjNameSingulExtrude3d (STR_ObjNameBegin + 123)
+#define STR_ObjNamePluralExtrude3d (STR_ObjNameBegin + 124)
+#define STR_ObjNameSingulLabel3d (STR_ObjNameBegin + 125)
+#define STR_ObjNamePluralLabel3d (STR_ObjNameBegin + 126)
+#define STR_ObjNameSingulLathe3d (STR_ObjNameBegin + 127)
+#define STR_ObjNamePluralLathe3d (STR_ObjNameBegin + 128)
+#define STR_ObjNameSingulObj3d (STR_ObjNameBegin + 129)
+#define STR_ObjNamePluralObj3d (STR_ObjNameBegin + 130)
+#define STR_ObjNamePluralPoly3d (STR_ObjNameBegin + 132)
+#define STR_ObjNameSingulScene3d (STR_ObjNameBegin + 133)
+#define STR_ObjNamePluralScene3d (STR_ObjNameBegin + 134)
+#define STR_ObjNameSingulSphere3d (STR_ObjNameBegin + 135)
+#define STR_ObjNamePluralSphere3d (STR_ObjNameBegin + 136)
+
+#define STR_ObjNameSingulGRAFBMPTRANS (STR_ObjNameBegin + 137)
+#define STR_ObjNameSingulGRAFBMPTRANSLNK (STR_ObjNameBegin + 138)
+
+#define STR_ObjNamePluralGRAFBMPTRANS (STR_ObjNameBegin + 139)
+#define STR_ObjNamePluralGRAFBMPTRANSLNK (STR_ObjNameBegin + 140)
+
+#define STR_ObjNameSingulCUSTOMSHAPE (STR_ObjNameBegin + 141)
+#define STR_ObjNamePluralCUSTOMSHAPE (STR_ObjNameBegin + 142)
+
+#define STR_ObjNameSingulMEDIA (STR_ObjNameBegin + 143)
+#define STR_ObjNamePluralMEDIA (STR_ObjNameBegin + 144)
+
+#define STR_ObjNameSingulFONTWORK (STR_ObjNameBegin+145)
+#define STR_ObjNamePluralFONTWORK (STR_ObjNameBegin+146)
+
+// Svg support
+#define STR_ObjNameSingulGRAFSVG (STR_ObjNameBegin + 147)
+#define STR_ObjNamePluralGRAFSVG (STR_ObjNameBegin + 148)
+
+#define STR_ObjNameEnd (STR_ObjNamePluralGRAFSVG)
+
+#define STR_EditBegin (STR_ObjNameEnd+1)
+#define STR_EditWithCopy (STR_EditBegin + 0)
+#define STR_EditPosSize (STR_EditBegin + 1)
+#define STR_EditDelete (STR_EditBegin + 2)
+#define STR_EditMovToTop (STR_EditBegin + 3)
+#define STR_EditMovToBtm (STR_EditBegin + 4)
+#define STR_EditPutToTop (STR_EditBegin + 5)
+#define STR_EditPutToBtm (STR_EditBegin + 6)
+#define STR_EditRevOrder (STR_EditBegin + 7)
+#define STR_EditMove (STR_EditBegin + 8)
+#define STR_EditResize (STR_EditBegin + 9)
+#define STR_EditRotate (STR_EditBegin + 10)
+#define STR_EditMirrorHori (STR_EditBegin + 11)
+#define STR_EditMirrorVert (STR_EditBegin + 12)
+#define STR_EditMirrorDiag (STR_EditBegin + 13)
+#define STR_EditMirrorFree (STR_EditBegin + 14)
+#define STR_EditShear (STR_EditBegin + 15)
+#define STR_EditCrook (STR_EditBegin + 16)
+#define STR_EditCrookContortion (STR_EditBegin + 17)
+#define STR_EditDistort (STR_EditBegin + 18)
+#define STR_EditRipUp (STR_EditBegin + 19)
+#define STR_EditSetPointsSmooth (STR_EditBegin + 20)
+#define STR_EditSetSegmentsKind (STR_EditBegin + 21)
+#define STR_EditShut (STR_EditBegin + 22)
+#define STR_EditSetGlueEscDir (STR_EditBegin + 23)
+#define STR_EditSetGluePercent (STR_EditBegin + 24)
+#define STR_EditSetGlueAlign (STR_EditBegin + 25)
+#define STR_EditGroup (STR_EditBegin + 26)
+#define STR_EditUngroup (STR_EditBegin + 27)
+#define STR_EditSetAttributes (STR_EditBegin + 28)
+#define STR_EditSetStylesheet (STR_EditBegin + 29)
+#define STR_EditDelStylesheet (STR_EditBegin + 30)
+#define STR_EditConvToPoly (STR_EditBegin + 31)
+#define STR_EditConvToPolys (STR_EditBegin + 32)
+#define STR_EditConvToCurve (STR_EditBegin + 33)
+#define STR_EditConvToCurves (STR_EditBegin + 34)
+#define STR_EditAlign (STR_EditBegin + 35)
+#define STR_EditAlignVTop (STR_EditBegin + 36)
+#define STR_EditAlignVBottom (STR_EditBegin + 37)
+#define STR_EditAlignVCenter (STR_EditBegin + 38)
+#define STR_EditAlignHLeft (STR_EditBegin + 39)
+#define STR_EditAlignHRight (STR_EditBegin + 40)
+#define STR_EditAlignHCenter (STR_EditBegin + 41)
+#define STR_EditAlignCenter (STR_EditBegin + 42)
+#define STR_EditTransform (STR_EditBegin + 43)
+#define STR_EditCombine_PolyPoly (STR_EditBegin + 44)
+#define STR_EditCombine_OnePoly (STR_EditBegin + 45)
+#define STR_EditDismantle_Polys (STR_EditBegin + 46)
+#define STR_EditDismantle_Lines (STR_EditBegin + 47)
+#define STR_EditImportMtf (STR_EditBegin + 48)
+#define STR_EditImportSGV (STR_EditBegin + 49)
+#define STR_EditImportHPGL (STR_EditBegin + 50)
+#define STR_EditImportDXF (STR_EditBegin + 51)
+#define STR_EditConvToContour (STR_EditBegin + 52)
+#define STR_EditConvToContours (STR_EditBegin + 53)
+#define STR_EditMergeMergePoly (STR_EditBegin + 54)
+#define STR_EditMergeSubstractPoly (STR_EditBegin + 55)
+#define STR_EditMergeIntersectPoly (STR_EditBegin + 56)
+#define STR_DistributeMarkedObjects (STR_EditBegin + 57)
+#define STR_EditEnd (STR_DistributeMarkedObjects)
+
+#define STR_ExchangeBegin (STR_EditEnd+1)
+#define STR_ExchangePaste (STR_ExchangeBegin +0)
+#define STR_ExchangeClpCut (STR_ExchangeBegin +1)
+#define STR_ExchangeClpPaste (STR_ExchangeBegin +2)
+#define STR_ExchangeDD (STR_ExchangeBegin +3)
+#define STR_ExchangeDDPaste (STR_ExchangeBegin +4)
+#define STR_ExchangeEnd (STR_ExchangeDDPaste)
+
+#define STR_DragBegin (STR_ExchangeEnd+1)
+#define STR_DragInsertPoint (STR_DragBegin + 0)
+#define STR_DragInsertGluePoint (STR_DragBegin + 1)
+#define STR_DragMethMovHdl (STR_DragBegin + 2)
+#define STR_DragMethObjOwn (STR_DragBegin + 3)
+#define STR_DragMethMove (STR_DragBegin + 4)
+#define STR_DragMethResize (STR_DragBegin + 5)
+#define STR_DragMethRotate (STR_DragBegin + 6)
+#define STR_DragMethMirrorHori (STR_DragBegin + 7)
+#define STR_DragMethMirrorVert (STR_DragBegin + 8)
+#define STR_DragMethMirrorDiag (STR_DragBegin + 9)
+#define STR_DragMethMirrorFree (STR_DragBegin +10)
+#define STR_DragMethShear (STR_DragBegin +11)
+#define STR_DragMethCrook (STR_DragBegin +12)
+#define STR_DragMethCrookContortion (STR_DragBegin +13)
+#define STR_DragMethDistort (STR_DragBegin +14)
+#define STR_DragRectEckRad (STR_DragBegin +15)
+#define STR_DragPathObj (STR_DragBegin +16)
+#define STR_DragRectResize (STR_DragBegin +17)
+#define STR_DragCaptFram (STR_DragBegin +18)
+#define STR_DragCaptTail (STR_DragBegin +19)
+#define STR_DragCircAngle (STR_DragBegin +20)
+#define STR_DragEdgeTail (STR_DragBegin +21)
+#define STR_DragMethGradient (STR_DragBegin +22)
+#define STR_DragMethTransparence (STR_DragBegin +23)
+#define STR_DragMethCrop (STR_DragBegin +24)
+#define STR_DragEnd (STR_DragMethCrop)
+
+#define STR_ViewBegin (STR_DragEnd+1)
+#define STR_ViewTextEdit (STR_ViewBegin + 0)
+#define STR_ViewMarked (STR_ViewBegin + 1)
+#define STR_ViewMarkedPoint (STR_ViewBegin + 2)
+#define STR_ViewMarkedPoints (STR_ViewBegin + 3)
+#define STR_ViewMarkedGluePoint (STR_ViewBegin + 4)
+#define STR_ViewMarkedGluePoints (STR_ViewBegin + 5)
+#define STR_ViewMarkObjs (STR_ViewBegin + 6)
+#define STR_ViewMarkMoreObjs (STR_ViewBegin + 7)
+#define STR_ViewMarkPoints (STR_ViewBegin + 8)
+#define STR_ViewMarkMorePoints (STR_ViewBegin + 9)
+#define STR_ViewMarkGluePoints (STR_ViewBegin +10)
+#define STR_ViewMarkMoreGluePoints (STR_ViewBegin +11)
+#define STR_ViewCreateObj (STR_ViewBegin +12)
+#define STR_ViewEnd (STR_ViewCreateObj)
+
+#define STR_UndoBegin (STR_ViewEnd+1)
+#define STR_UndoInsertObj (STR_UndoBegin + 0)
+#define STR_UndoCopyObj (STR_UndoBegin + 1)
+#define STR_UndoObjOrdNum (STR_UndoBegin + 2)
+#define STR_UndoObjSetText (STR_UndoBegin + 3)
+
+#define STR_UndoNewPage (STR_UndoBegin + 4)
+#define STR_UndoDelPage (STR_UndoBegin + 5)
+#define STR_UndoCopPage (STR_UndoBegin + 6)
+#define STR_UndoMovPage (STR_UndoBegin + 7)
+
+#define STR_UndoNewPageMasterDscr (STR_UndoBegin + 8)
+#define STR_UndoDelPageMasterDscr (STR_UndoBegin + 9)
+#define STR_UndoMovPageMasterDscr (STR_UndoBegin +10)
+#define STR_UndoChgPageMasterDscr (STR_UndoBegin +11)
+
+#define STR_UndoMergeModel (STR_UndoBegin +12)
+
+#define STR_UndoNewLayer (STR_UndoBegin +13)
+#define STR_UndoDelLayer (STR_UndoBegin +14)
+#define STR_UndoMovLayer (STR_UndoBegin +15)
+
+// #i73249#
+#define STR_UndoObjName (STR_UndoBegin +16)
+#define STR_UndoObjTitle (STR_UndoBegin +17)
+#define STR_UndoObjDescription (STR_UndoBegin +18)
+#define STR_UndoEnd (STR_UndoObjDescription)
+
+
+#define STR_LayerBegin (STR_UndoEnd+1)
+#define STR_StandardLayerName (STR_LayerBegin +0)
+#define STR_LayerEnd (STR_StandardLayerName)
+
+
+#define STR_ItemBegin (STR_LayerEnd+1)
+#define STR_ItemValBegin (STR_ItemBegin)
+#define STR_ItemValON (STR_ItemValBegin + 0)
+#define STR_ItemValOFF (STR_ItemValBegin + 1)
+#define STR_ItemValYES (STR_ItemValBegin + 2)
+#define STR_ItemValNO (STR_ItemValBegin + 3)
+#define STR_ItemValCAPTIONTYPE1 (STR_ItemValBegin + 4)
+#define STR_ItemValCAPTIONTYPE2 (STR_ItemValBegin + 5)
+#define STR_ItemValCAPTIONTYPE3 (STR_ItemValBegin + 6)
+#define STR_ItemValCAPTIONTYPE4 (STR_ItemValBegin + 7)
+#define STR_ItemValCAPTIONESCHORI (STR_ItemValBegin + 8)
+#define STR_ItemValCAPTIONESCVERT (STR_ItemValBegin + 9)
+#define STR_ItemValCAPTIONESCBESTFIT (STR_ItemValBegin + 10)
+#define STR_ItemValFITTOSIZENONE (STR_ItemValBegin + 11)
+#define STR_ItemValFITTOSIZEPROP (STR_ItemValBegin + 12)
+#define STR_ItemValFITTOSIZEALLLINES (STR_ItemValBegin + 13)
+#define STR_ItemValFITTOSIZERESIZEAT (STR_ItemValBegin + 14)
+#define STR_ItemValTEXTVADJTOP (STR_ItemValBegin + 15)
+#define STR_ItemValTEXTVADJCENTER (STR_ItemValBegin + 16)
+#define STR_ItemValTEXTVADJBOTTOM (STR_ItemValBegin + 17)
+#define STR_ItemValTEXTVADJBLOCK (STR_ItemValBegin + 18)
+#define STR_ItemValTEXTVADJSTRETCH (STR_ItemValBegin + 19)
+#define STR_ItemValTEXTHADJLEFT (STR_ItemValBegin + 20)
+#define STR_ItemValTEXTHADJCENTER (STR_ItemValBegin + 21)
+#define STR_ItemValTEXTHADJRIGHT (STR_ItemValBegin + 22)
+#define STR_ItemValTEXTHADJBLOCK (STR_ItemValBegin + 23)
+#define STR_ItemValTEXTHADJSTRETCH (STR_ItemValBegin + 24)
+#define STR_ItemValTEXTANI_NONE (STR_ItemValBegin + 25)
+#define STR_ItemValTEXTANI_BLINK (STR_ItemValBegin + 26)
+#define STR_ItemValTEXTANI_SCROLL (STR_ItemValBegin + 27)
+#define STR_ItemValTEXTANI_ALTERNATE (STR_ItemValBegin + 28)
+#define STR_ItemValTEXTANI_SLIDE (STR_ItemValBegin + 29)
+#define STR_ItemValTEXTANI_LEFT (STR_ItemValBegin + 30)
+#define STR_ItemValTEXTANI_RIGHT (STR_ItemValBegin + 31)
+#define STR_ItemValTEXTANI_UP (STR_ItemValBegin + 32)
+#define STR_ItemValTEXTANI_DOWN (STR_ItemValBegin + 33)
+#define STR_ItemValEDGE_ORTHOLINES (STR_ItemValBegin + 34)
+#define STR_ItemValEDGE_THREELINES (STR_ItemValBegin + 35)
+#define STR_ItemValEDGE_ONELINE (STR_ItemValBegin + 36)
+#define STR_ItemValEDGE_BEZIER (STR_ItemValBegin + 37)
+#define STR_ItemValMEASURE_STD (STR_ItemValBegin + 38)
+#define STR_ItemValMEASURE_RADIUS (STR_ItemValBegin + 39)
+#define STR_ItemValMEASURE_TEXTHAUTO (STR_ItemValBegin + 40)
+#define STR_ItemValMEASURE_TEXTLEFTOUTSIDE (STR_ItemValBegin + 41)
+#define STR_ItemValMEASURE_TEXTINSIDE (STR_ItemValBegin + 42)
+#define STR_ItemValMEASURE_TEXTRIGHTOUTSID (STR_ItemValBegin + 43)
+#define STR_ItemValMEASURE_TEXTVAUTO (STR_ItemValBegin + 44)
+#define STR_ItemValMEASURE_ABOVE (STR_ItemValBegin + 45)
+#define STR_ItemValMEASURETEXT_BREAKEDLINE (STR_ItemValBegin + 46)
+#define STR_ItemValMEASURE_BELOW (STR_ItemValBegin + 47)
+#define STR_ItemValMEASURETEXT_VERTICALCEN (STR_ItemValBegin + 48)
+#define STR_ItemValCIRC_FULL (STR_ItemValBegin + 49)
+#define STR_ItemValCIRC_SECT (STR_ItemValBegin + 50)
+#define STR_ItemValCIRC_CUT (STR_ItemValBegin + 51)
+#define STR_ItemValCIRC_ARC (STR_ItemValBegin + 52)
+#define STR_ItemValEnd (STR_ItemValCIRC_ARC)
+
+#define STR_ItemNamBegin (STR_ItemValEnd+1)
+#define STR_ItemNam_SHADOW (STR_ItemNamBegin + 0)
+#define STR_ItemNam_SHADOWCOLOR (STR_ItemNamBegin + 1)
+#define STR_ItemNam_SHADOWXDIST (STR_ItemNamBegin + 2)
+#define STR_ItemNam_SHADOWYDIST (STR_ItemNamBegin + 3)
+#define STR_ItemNam_SHADOWTRANSPARENCE (STR_ItemNamBegin + 4)
+#define STR_ItemNam_SHADOW3D (STR_ItemNamBegin + 5)
+#define STR_ItemNam_SHADOWPERSP (STR_ItemNamBegin + 6)
+#define STR_ItemNam_CAPTIONTYPE (STR_ItemNamBegin + 13)
+#define STR_ItemNam_CAPTIONFIXEDANGLE (STR_ItemNamBegin + 14)
+#define STR_ItemNam_CAPTIONANGLE (STR_ItemNamBegin + 15)
+#define STR_ItemNam_CAPTIONGAP (STR_ItemNamBegin + 16)
+#define STR_ItemNam_CAPTIONESCDIR (STR_ItemNamBegin + 17)
+#define STR_ItemNam_CAPTIONESCISREL (STR_ItemNamBegin + 18)
+#define STR_ItemNam_CAPTIONESCREL (STR_ItemNamBegin + 19)
+#define STR_ItemNam_CAPTIONESCABS (STR_ItemNamBegin + 20)
+#define STR_ItemNam_CAPTIONLINELEN (STR_ItemNamBegin + 21)
+#define STR_ItemNam_CAPTIONFITLINELEN (STR_ItemNamBegin + 22)
+
+#define STR_ItemNam_ECKENRADIUS (STR_ItemNamBegin + 30)
+#define STR_ItemNam_TEXT_LEFTDIST (STR_ItemNamBegin + 31)
+#define STR_ItemNam_TEXT_RIGHTDIST (STR_ItemNamBegin + 32)
+#define STR_ItemNam_TEXT_UPPERDIST (STR_ItemNamBegin + 33)
+#define STR_ItemNam_TEXT_LOWERDIST (STR_ItemNamBegin + 34)
+#define STR_ItemNam_TEXT_AUTOGROWHEIGHT (STR_ItemNamBegin + 35)
+#define STR_ItemNam_TEXT_MINFRAMEHEIGHT (STR_ItemNamBegin + 36)
+#define STR_ItemNam_TEXT_MAXFRAMEHEIGHT (STR_ItemNamBegin + 37)
+#define STR_ItemNam_TEXT_AUTOGROWWIDTH (STR_ItemNamBegin + 38)
+#define STR_ItemNam_TEXT_MINFRAMEWIDTH (STR_ItemNamBegin + 39)
+#define STR_ItemNam_TEXT_MAXFRAMEWIDTH (STR_ItemNamBegin + 40)
+#define STR_ItemNam_TEXT_VERTADJUST (STR_ItemNamBegin + 41)
+#define STR_ItemNam_TEXT_HORZADJUST (STR_ItemNamBegin + 42)
+#define STR_ItemNam_TEXT_FITTOSIZE (STR_ItemNamBegin + 43)
+#define STR_ItemNam_GRAFRED (STR_ItemNamBegin + 44)
+#define STR_ItemNam_GRAFGREEN (STR_ItemNamBegin + 45)
+#define STR_ItemNam_GRAFBLUE (STR_ItemNamBegin + 46)
+#define STR_ItemNam_GRAFLUMINANCE (STR_ItemNamBegin + 47)
+#define STR_ItemNam_GRAFCONTRAST (STR_ItemNamBegin + 48)
+#define STR_ItemNam_GRAFGAMMA (STR_ItemNamBegin + 49)
+#define STR_ItemNam_GRAFTRANSPARENCE (STR_ItemNamBegin + 50)
+#define STR_ItemNam_GRAFINVERT (STR_ItemNamBegin + 51)
+#define STR_ItemNam_GRAFMODE (STR_ItemNamBegin + 52)
+#define STR_ItemNam_GRAFRESERVE2 (STR_ItemNamBegin + 53)
+#define STR_ItemNam_GRAFRESERVE3 (STR_ItemNamBegin + 54)
+#define STR_ItemNam_GRAFRESERVE4 (STR_ItemNamBegin + 55)
+#define STR_ItemNam_GRAFRESERVE5 (STR_ItemNamBegin + 56)
+#define STR_ItemNam_GRAFRESERVE6 (STR_ItemNamBegin + 57)
+#define STR_ItemNam_RESERVE19 (STR_ItemNamBegin + 58)
+#define STR_ItemNamSET_MISC (STR_ItemNamBegin + 59)
+#define STR_ItemNam_OBJMOVEPROTECT (STR_ItemNamBegin + 60)
+#define STR_ItemNam_OBJSIZEPROTECT (STR_ItemNamBegin + 61)
+#define STR_ItemNam_OBJPRINTABLE (STR_ItemNamBegin + 62)
+#define STR_ItemNam_LAYERID (STR_ItemNamBegin + 63)
+#define STR_ItemNam_LAYERNAME (STR_ItemNamBegin + 64)
+#define STR_ItemNam_OBJECTNAME (STR_ItemNamBegin + 65)
+#define STR_ItemNam_STARTANGLE (STR_ItemNamBegin + 66)
+#define STR_ItemNam_ENDANGLE (STR_ItemNamBegin + 67)
+#define STR_ItemNam_POSITIONX (STR_ItemNamBegin + 68)
+#define STR_ItemNam_POSITIONY (STR_ItemNamBegin + 69)
+#define STR_ItemNam_SIZEWIDTH (STR_ItemNamBegin + 70)
+#define STR_ItemNam_SIZEHEIGHT (STR_ItemNamBegin + 71)
+#define STR_ItemNam_ROTATEANGLE (STR_ItemNamBegin + 72)
+#define STR_ItemNam_SHEARANGLE (STR_ItemNamBegin + 73)
+#define STR_ItemNamEnd (STR_ItemNam_SHEARANGLE)
+#define STR_ItemEnd STR_ItemNamEnd
+
+#define BMAP_Begin (STR_ItemEnd+1)
+#define BMAP_GrafikEi (BMAP_Begin +0)
+#define BMAP_GrafikDe (BMAP_Begin +1)
+#define BMAP_End (BMAP_GrafikDe)
+
+// Strings for the template dialog
+#define SIP_Begin (BMAP_End)
+
+#define SIP_UNKNOWN_ATTR (SIP_Begin + 0)
+#define SIP_XA_LINESTYLE (SIP_Begin + 1)
+#define SIP_XA_LINEDASH (SIP_Begin + 2)
+#define SIP_XA_LINEWIDTH (SIP_Begin + 3)
+#define SIP_XA_LINECOLOR (SIP_Begin + 4)
+#define SIP_XA_LINESTART (SIP_Begin + 5)
+#define SIP_XA_LINEEND (SIP_Begin + 6)
+#define SIP_XA_LINESTARTWIDTH (SIP_Begin + 7)
+#define SIP_XA_LINEENDWIDTH (SIP_Begin + 8)
+#define SIP_XA_LINESTARTCENTER (SIP_Begin + 9)
+#define SIP_XA_LINEENDCENTER (SIP_Begin + 10)
+#define SIP_XA_LINETRANSPARENCE (SIP_Begin + 11)
+#define SIP_XA_LINEJOINT (SIP_Begin + 12)
+#define SIP_XA_LINERESERVED2 (SIP_Begin + 13)
+#define SIP_XA_LINERESERVED3 (SIP_Begin + 14)
+#define SIP_XA_LINERESERVED4 (SIP_Begin + 15)
+#define SIP_XA_LINERESERVED5 (SIP_Begin + 16)
+#define SIP_XA_LINERESERVED_LAST (SIP_Begin + 17)
+#define SIP_XATTRSET_LINE (SIP_Begin + 18)
+#define SIP_XA_FILLSTYLE (SIP_Begin + 19)
+#define SIP_XA_FILLCOLOR (SIP_Begin + 20)
+#define SIP_XA_FILLGRADIENT (SIP_Begin + 21)
+#define SIP_XA_FILLHATCH (SIP_Begin + 22)
+#define SIP_XA_FILLBITMAP (SIP_Begin + 23)
+#define SIP_XA_FILLTRANSPARENCE (SIP_Begin + 24)
+#define SIP_XA_GRADIENTSTEPCOUNT (SIP_Begin + 25)
+#define SIP_XA_FILLBMP_TILE (SIP_Begin + 26)
+#define SIP_XA_FILLBMP_POS (SIP_Begin + 27)
+#define SIP_XA_FILLBMP_SIZEX (SIP_Begin + 28)
+#define SIP_XA_FILLBMP_SIZEY (SIP_Begin + 29)
+#define SIP_XA_FILLFLOATTRANSPARENCE (SIP_Begin + 30)
+#define SIP_XA_SECONDARYFILLCOLOR (SIP_Begin + 31)
+#define SIP_XA_FILLBMP_SIZELOG (SIP_Begin + 32)
+#define SIP_XA_FILLBMP_TILEOFFSETX (SIP_Begin + 33)
+#define SIP_XA_FILLBMP_TILEOFFSETY (SIP_Begin + 34)
+#define SIP_XA_FILLBMP_STRETCH (SIP_Begin + 35)
+#define SIP_XA_FILLRESERVED3 (SIP_Begin + 36)
+#define SIP_XA_FILLRESERVED4 (SIP_Begin + 37)
+#define SIP_XA_FILLRESERVED5 (SIP_Begin + 38)
+#define SIP_XA_FILLRESERVED6 (SIP_Begin + 39)
+#define SIP_XA_FILLRESERVED7 (SIP_Begin + 40)
+#define SIP_XA_FILLRESERVED8 (SIP_Begin + 41)
+#define SIP_XA_FILLBMP_POSOFFSETX (SIP_Begin + 42)
+#define SIP_XA_FILLBMP_POSOFFSETY (SIP_Begin + 43)
+#define SIP_XA_FILLBACKGROUND (SIP_Begin + 44)
+#define SIP_XA_FILLRESERVED10 (SIP_Begin + 45)
+#define SIP_XA_FILLRESERVED11 (SIP_Begin + 46)
+#define SIP_XA_FILLRESERVED_LAST (SIP_Begin + 47)
+#define SIP_XATTRSET_FILL (SIP_Begin + 48)
+#define SIP_XA_FORMTXTSTYLE (SIP_Begin + 49)
+#define SIP_XA_FORMTXTADJUST (SIP_Begin + 50)
+#define SIP_XA_FORMTXTDISTANCE (SIP_Begin + 51)
+#define SIP_XA_FORMTXTSTART (SIP_Begin + 52)
+#define SIP_XA_FORMTXTMIRROR (SIP_Begin + 53)
+#define SIP_XA_FORMTXTOUTLINE (SIP_Begin + 54)
+#define SIP_XA_FORMTXTSHADOW (SIP_Begin + 55)
+#define SIP_XA_FORMTXTSHDWCOLOR (SIP_Begin + 56)
+#define SIP_XA_FORMTXTSHDWXVAL (SIP_Begin + 57)
+#define SIP_XA_FORMTXTSHDWYVAL (SIP_Begin + 58)
+#define SIP_XA_FORMTXTSTDFORM (SIP_Begin + 59)
+#define SIP_XA_FORMTXTHIDEFORM (SIP_Begin + 60)
+#define SIP_XA_FORMTXTSHDWTRANSP (SIP_Begin + 61)
+#define SIP_XA_FTRESERVED2 (SIP_Begin + 62)
+#define SIP_XA_FTRESERVED3 (SIP_Begin + 63)
+#define SIP_XA_FTRESERVED4 (SIP_Begin + 64)
+#define SIP_XA_FTRESERVED5 (SIP_Begin + 65)
+#define SIP_XA_FTRESERVED_LAST (SIP_Begin + 66)
+#define SIP_SA_SHADOW (SIP_Begin + 68)
+#define SIP_SA_SHADOWCOLOR (SIP_Begin + 69)
+#define SIP_SA_SHADOWXDIST (SIP_Begin + 70)
+#define SIP_SA_SHADOWYDIST (SIP_Begin + 71)
+#define SIP_SA_SHADOWTRANSPARENCE (SIP_Begin + 72)
+#define SIP_SA_SHADOW3D (SIP_Begin + 73)
+#define SIP_SA_SHADOWPERSP (SIP_Begin + 74)
+#define SIP_SA_CAPTIONTYPE (SIP_Begin + 81)
+#define SIP_SA_CAPTIONFIXEDANGLE (SIP_Begin + 82)
+#define SIP_SA_CAPTIONANGLE (SIP_Begin + 83)
+#define SIP_SA_CAPTIONGAP (SIP_Begin + 84)
+#define SIP_SA_CAPTIONESCDIR (SIP_Begin + 85)
+#define SIP_SA_CAPTIONESCISREL (SIP_Begin + 86)
+#define SIP_SA_CAPTIONESCREL (SIP_Begin + 87)
+#define SIP_SA_CAPTIONESCABS (SIP_Begin + 88)
+#define SIP_SA_CAPTIONLINELEN (SIP_Begin + 89)
+#define SIP_SA_CAPTIONFITLINELEN (SIP_Begin + 90)
+#define SIP_SA_ECKENRADIUS (SIP_Begin + 98)
+#define SIP_SA_TEXT_MINFRAMEHEIGHT (SIP_Begin + 99)
+#define SIP_SA_TEXT_AUTOGROWHEIGHT (SIP_Begin + 100)
+#define SIP_SA_TEXT_FITTOSIZE (SIP_Begin + 101)
+#define SIP_SA_TEXT_LEFTDIST (SIP_Begin + 102)
+#define SIP_SA_TEXT_RIGHTDIST (SIP_Begin + 103)
+#define SIP_SA_TEXT_UPPERDIST (SIP_Begin + 104)
+#define SIP_SA_TEXT_LOWERDIST (SIP_Begin + 105)
+#define SIP_SA_TEXT_VERTADJUST (SIP_Begin + 106)
+#define SIP_SA_TEXT_MAXFRAMEHEIGHT (SIP_Begin + 107)
+#define SIP_SA_TEXT_MINFRAMEWIDTH (SIP_Begin + 108)
+#define SIP_SA_TEXT_MAXFRAMEWIDTH (SIP_Begin + 109)
+#define SIP_SA_TEXT_AUTOGROWWIDTH (SIP_Begin + 110)
+#define SIP_SA_TEXT_HORZADJUST (SIP_Begin + 111)
+#define SIP_SA_TEXT_ANIKIND (SIP_Begin + 112)
+#define SIP_SA_TEXT_ANIDIRECTION (SIP_Begin + 113)
+#define SIP_SA_TEXT_ANISTARTINSIDE (SIP_Begin + 114)
+#define SIP_SA_TEXT_ANISTOPINSIDE (SIP_Begin + 115)
+#define SIP_SA_TEXT_ANICOUNT (SIP_Begin + 116)
+#define SIP_SA_TEXT_ANIDELAY (SIP_Begin + 117)
+#define SIP_SA_TEXT_ANIAMOUNT (SIP_Begin + 118)
+#define SIP_SA_TEXT_CONTOURFRAME (SIP_Begin + 119)
+#define SIP_SA_CUSTOMSHAPE_ADJUSTMENT (SIP_Begin + 120)
+#define SIP_SA_XMLATTRIBUTES (SIP_Begin + 121)
+#define SIP_SA_TEXT_USEFIXEDCELLHEIGHT (SIP_Begin + 122)
+#define SIP_SA_WORDWRAP (SIP_Begin + 123)
+#define SIP_SA_AUTOGROWSIZE (SIP_Begin + 124)
+#define SIP_SA_RESERVE18 (SIP_Begin + 125)
+#define SIP_SA_RESERVE19 (SIP_Begin + 126)
+#define SIP_SA_EDGEKIND (SIP_Begin + 128)
+#define SIP_SA_EDGENODE1HORZDIST (SIP_Begin + 129)
+#define SIP_SA_EDGENODE1VERTDIST (SIP_Begin + 130)
+#define SIP_SA_EDGENODE2HORZDIST (SIP_Begin + 131)
+#define SIP_SA_EDGENODE2VERTDIST (SIP_Begin + 132)
+#define SIP_SA_EDGENODE1GLUEDIST (SIP_Begin + 133)
+#define SIP_SA_EDGENODE2GLUEDIST (SIP_Begin + 134)
+#define SIP_SA_EDGELINEDELTAANZ (SIP_Begin + 135)
+#define SIP_SA_EDGELINE1DELTA (SIP_Begin + 136)
+#define SIP_SA_EDGELINE2DELTA (SIP_Begin + 137)
+#define SIP_SA_EDGELINE3DELTA (SIP_Begin + 138)
+#define SIP_SA_MEASUREKIND (SIP_Begin + 148)
+#define SIP_SA_MEASURETEXTHPOS (SIP_Begin + 149)
+#define SIP_SA_MEASURETEXTVPOS (SIP_Begin + 150)
+#define SIP_SA_MEASURELINEDIST (SIP_Begin + 151)
+#define SIP_SA_MEASUREHELPLINEOVERHANG (SIP_Begin + 152)
+#define SIP_SA_MEASUREHELPLINEDIST (SIP_Begin + 153)
+#define SIP_SA_MEASUREHELPLINE1LEN (SIP_Begin + 154)
+#define SIP_SA_MEASUREHELPLINE2LEN (SIP_Begin + 155)
+#define SIP_SA_MEASUREBELOWREFEDGE (SIP_Begin + 156)
+#define SIP_SA_MEASURETEXTROTA90 (SIP_Begin + 157)
+#define SIP_SA_MEASURETEXTUPSIDEDOWN (SIP_Begin + 158)
+#define SIP_SA_MEASUREOVERHANG (SIP_Begin + 159)
+#define SIP_SA_MEASUREUNIT (SIP_Begin + 160)
+#define SIP_SA_MEASURESCALE (SIP_Begin + 161)
+#define SIP_SA_MEASURESHOWUNIT (SIP_Begin + 162)
+#define SIP_SA_MEASUREFORMATSTRING (SIP_Begin + 163)
+#define SIP_SA_MEASURETEXTAUTOANGLE (SIP_Begin + 164)
+#define SIP_SA_MEASURETEXTAUTOANGLEVIEW (SIP_Begin + 165)
+#define SIP_SA_MEASURETEXTISFIXEDANGLE (SIP_Begin + 166)
+#define SIP_SA_MEASURETEXTFIXEDANGLE (SIP_Begin + 167)
+#define SIP_SA_MEASUREDECIMALPLACES (SIP_Begin + 168)
+#define SIP_SA_MEASURERESERVE05 (SIP_Begin + 169)
+#define SIP_SA_MEASURERESERVE06 (SIP_Begin + 170)
+#define SIP_SA_MEASURERESERVE07 (SIP_Begin + 171)
+#define SIP_SA_CIRCKIND (SIP_Begin + 173)
+#define SIP_SA_CIRCSTARTANGLE (SIP_Begin + 174)
+#define SIP_SA_CIRCENDANGLE (SIP_Begin + 175)
+#define SIP_SA_CIRCRESERVE0 (SIP_Begin + 176)
+#define SIP_SA_CIRCRESERVE1 (SIP_Begin + 177)
+#define SIP_SA_CIRCRESERVE2 (SIP_Begin + 178)
+#define SIP_SA_CIRCRESERVE3 (SIP_Begin + 179)
+#define SIP_SA_OBJVISIBLE (SIP_Begin + 180)
+#define SIP_SA_OBJMOVEPROTECT (SIP_Begin + 181)
+#define SIP_SA_OBJSIZEPROTECT (SIP_Begin + 182)
+#define SIP_SA_OBJPRINTABLE (SIP_Begin + 183)
+#define SIP_SA_LAYERID (SIP_Begin + 184)
+#define SIP_SA_LAYERNAME (SIP_Begin + 185)
+#define SIP_SA_OBJECTNAME (SIP_Begin + 186)
+#define SIP_SA_ALLPOSITIONX (SIP_Begin + 187)
+#define SIP_SA_ALLPOSITIONY (SIP_Begin + 188)
+#define SIP_SA_ALLSIZEWIDTH (SIP_Begin + 189)
+#define SIP_SA_ALLSIZEHEIGHT (SIP_Begin + 190)
+#define SIP_SA_ONEPOSITIONX (SIP_Begin + 191)
+#define SIP_SA_ONEPOSITIONY (SIP_Begin + 192)
+#define SIP_SA_ONESIZEWIDTH (SIP_Begin + 193)
+#define SIP_SA_ONESIZEHEIGHT (SIP_Begin + 194)
+#define SIP_SA_LOGICSIZEWIDTH (SIP_Begin + 195)
+#define SIP_SA_LOGICSIZEHEIGHT (SIP_Begin + 196)
+#define SIP_SA_ROTATEANGLE (SIP_Begin + 197)
+#define SIP_SA_SHEARANGLE (SIP_Begin + 198)
+#define SIP_SA_MOVEX (SIP_Begin + 199)
+#define SIP_SA_MOVEY (SIP_Begin + 200)
+#define SIP_SA_RESIZEXONE (SIP_Begin + 201)
+#define SIP_SA_RESIZEYONE (SIP_Begin + 202)
+#define SIP_SA_ROTATEONE (SIP_Begin + 203)
+#define SIP_SA_HORZSHEARONE (SIP_Begin + 204)
+#define SIP_SA_VERTSHEARONE (SIP_Begin + 205)
+#define SIP_SA_RESIZEXALL (SIP_Begin + 206)
+#define SIP_SA_RESIZEYALL (SIP_Begin + 207)
+#define SIP_SA_ROTATEALL (SIP_Begin + 208)
+#define SIP_SA_HORZSHEARALL (SIP_Begin + 209)
+#define SIP_SA_VERTSHEARALL (SIP_Begin + 210)
+#define SIP_SA_TRANSFORMREF1X (SIP_Begin + 211)
+#define SIP_SA_TRANSFORMREF1Y (SIP_Begin + 212)
+#define SIP_SA_TRANSFORMREF2X (SIP_Begin + 213)
+#define SIP_SA_TRANSFORMREF2Y (SIP_Begin + 214)
+#define SIP_EE_PARA_HYPHENATE (SIP_Begin + 215)
+#define SIP_EE_PARA_BULLETSTATE (SIP_Begin + 216)
+#define SIP_EE_PARA_OUTLLRSPACE (SIP_Begin + 217)
+#define SIP_EE_PARA_OUTLLEVEL (SIP_Begin + 218)
+#define SIP_EE_PARA_BULLET (SIP_Begin + 219)
+#define SIP_EE_PARA_LRSPACE (SIP_Begin + 220)
+#define SIP_EE_PARA_ULSPACE (SIP_Begin + 221)
+#define SIP_EE_PARA_SBL (SIP_Begin + 222)
+#define SIP_EE_PARA_JUST (SIP_Begin + 223)
+#define SIP_EE_PARA_TABS (SIP_Begin + 224)
+#define SIP_EE_CHAR_COLOR (SIP_Begin + 225)
+#define SIP_EE_CHAR_FONTINFO (SIP_Begin + 226)
+#define SIP_EE_CHAR_FONTHEIGHT (SIP_Begin + 227)
+#define SIP_EE_CHAR_FONTWIDTH (SIP_Begin + 228)
+#define SIP_EE_CHAR_WEIGHT (SIP_Begin + 229)
+#define SIP_EE_CHAR_UNDERLINE (SIP_Begin + 230)
+#define SIP_EE_CHAR_OVERLINE (SIP_Begin + 231)
+#define SIP_EE_CHAR_STRIKEOUT (SIP_Begin + 232)
+#define SIP_EE_CHAR_ITALIC (SIP_Begin + 233)
+#define SIP_EE_CHAR_OUTLINE (SIP_Begin + 234)
+#define SIP_EE_CHAR_SHADOW (SIP_Begin + 235)
+#define SIP_EE_CHAR_ESCAPEMENT (SIP_Begin + 236)
+#define SIP_EE_CHAR_PAIRKERNING (SIP_Begin + 237)
+#define SIP_EE_CHAR_KERNING (SIP_Begin + 238)
+#define SIP_EE_CHAR_WLM (SIP_Begin + 239)
+#define SIP_EE_FEATURE_TAB (SIP_Begin + 240)
+#define SIP_EE_FEATURE_LINEBR (SIP_Begin + 241)
+#define SIP_EE_FEATURE_NOTCONV (SIP_Begin + 242)
+#define SIP_EE_FEATURE_FIELD (SIP_Begin + 243)
+
+#define SIP_SA_GRAFRED (SIP_Begin + 244)
+#define SIP_SA_GRAFGREEN (SIP_Begin + 245)
+#define SIP_SA_GRAFBLUE (SIP_Begin + 246)
+#define SIP_SA_GRAFLUMINANCE (SIP_Begin + 247)
+#define SIP_SA_GRAFCONTRAST (SIP_Begin + 248)
+#define SIP_SA_GRAFGAMMA (SIP_Begin + 249)
+#define SIP_SA_GRAFTRANSPARENCE (SIP_Begin + 250)
+#define SIP_SA_GRAFINVERT (SIP_Begin + 251)
+#define SIP_SA_GRAFMODE (SIP_Begin + 252)
+#define SIP_SA_GRAFCROP (SIP_Begin + 253)
+#define SIP_SA_GRAFRESERVE3 (SIP_Begin + 254)
+#define SIP_SA_GRAFRESERVE4 (SIP_Begin + 255)
+#define SIP_SA_GRAFRESERVE5 (SIP_Begin + 256)
+#define SIP_SA_GRAFRESERVE6 (SIP_Begin + 257)
+
+#define SIP_SA_MARKERS (SIP_Begin + 258)
+#define SIP_SA_PAGESHADOW35X35 (SIP_Begin + 259)
+
+#define BMP_SVXOLEOBJ (SIP_Begin + 261)
+
+#define STR_TABLE_ATTR (SIP_Begin + 263)
+#define STR_TABLE_AUTOFMT (SIP_Begin + 264)
+#define STR_TABLE_INSCOL (SIP_Begin + 265)
+#define STR_TABLE_INSROW (SIP_Begin + 266)
+#define STR_UNDO_COL_DELETE (SIP_Begin + 267)
+#define STR_UNDO_ROW_DELETE (SIP_Begin + 268)
+#define STR_TABLE_SPLIT (SIP_Begin + 269)
+#define STR_TABLE_MERGE (SIP_Begin + 270)
+#define STR_TABLE_NUMFORMAT (SIP_Begin + 271)
+#define STR_TABLE_DISTRIBUTE_ROWS (SIP_Begin + 272)
+#define STR_TABLE_DISTRIBUTE_COLUMNS (SIP_Begin + 273)
+#define STR_TABLE_STYLE (SIP_Begin + 274)
+#define STR_TABLE_STYLE_SETTINGS (SIP_Begin + 275)
+#define SIP_SA_CROP_MARKERS (SIP_Begin + 276)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svdtext.hxx b/include/svx/svdtext.hxx
new file mode 100644
index 000000000000..810f701d55fc
--- /dev/null
+++ b/include/svx/svdtext.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 _SVDTEXT_HXX
+#define _SVDTEXT_HXX
+
+#include <sal/types.h>
+#include "svx/svxdllapi.h"
+#include <tools/weakbase.hxx>
+
+// --------------------------------------------------------------------
+
+class OutlinerParaObject;
+class SdrOutliner;
+class SdrTextObj;
+class SdrModel;
+class SfxItemSet;
+
+namespace sdr { namespace properties {
+ class TextProperties;
+}}
+
+/** This class stores information about one text inside a shape.
+*/
+
+class SfxStyleSheet;
+class SVX_DLLPUBLIC SdrText : public tools::WeakBase< SdrText >
+{
+public:
+ SdrText( SdrTextObj& rObject, OutlinerParaObject* pOutlinerParaObject = 0 );
+ virtual ~SdrText();
+
+ virtual void SetModel(SdrModel* pNewModel);
+ virtual void ForceOutlinerParaObject( sal_uInt16 nOutlMode );
+
+ virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject );
+ virtual OutlinerParaObject* GetOutlinerParaObject() const;
+
+ virtual void CheckPortionInfo( SdrOutliner& rOutliner );
+ virtual void ReformatText();
+
+ // default uses GetObjectItemSet, but may be overloaded to
+ // return a text-specific ItemSet
+ virtual const SfxItemSet& GetItemSet() const;
+
+ SdrModel* GetModel() const { return mpModel; }
+ SdrTextObj& GetObject() const { return mrObject; }
+
+ /** returns the current OutlinerParaObject and removes it from this instance */
+ OutlinerParaObject* RemoveOutlinerParaObject();
+
+protected:
+ virtual const SfxItemSet& GetObjectItemSet();
+ virtual void SetObjectItem(const SfxPoolItem& rItem);
+ virtual SfxStyleSheet* GetStyleSheet() const;
+
+private:
+ OutlinerParaObject* mpOutlinerParaObject;
+ SdrTextObj& mrObject;
+ SdrModel* mpModel;
+ bool mbPortionInfoChecked;
+};
+
+#endif //_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 000000000000..c86fd0d35582
--- /dev/null
+++ b/include/svx/svdtrans.hxx
@@ -0,0 +1,304 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDTRANS_HXX
+#define _SVDTRANS_HXX
+
+#include <tools/gen.hxx>
+#include <tools/poly.hxx>
+#include <tools/fract.hxx>
+
+#include <vcl/mapmod.hxx>
+#include <tools/string.hxx>
+#include "svx/svxdllapi.h"
+
+#include <vcl/field.hxx>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// Winkelangaben der DrawingEngine sind 1/100 Degree
+// #i19054# nowhere used, removed // const int nWinkDiv=100;
+// Um Winkel der DrawingEngine mit den Trigonometrischen Funktionen
+// verarbeiten zu koennen, muessen sie zunaest ins Bogenmass umgerechnet
+// werden. Dies gestaltet sich recht einfach mit der folgenden Konstanten
+// nPi180. Sei nWink ein Winkel in 1/100 Deg so schreibt man z.B.:
+// double nSin=sin(nWink*nPi180);
+// Rueckwandlung entsprechend durch Teilen.
+const double nPi=3.14159265358979323846;
+const double nPi180=0.000174532925199432957692222; // Bei zuweing Stellen ist tan(4500*nPi180)!=1.0
+
+// Der maximale Shearwinkel
+#define SDRMAXSHEAR 8900
+
+class XPolygon;
+class XPolyPolygon;
+
+inline long Round(double a) { return a>0.0 ? (long)(a+0.5) : -(long)((-a)+0.5); }
+
+inline void MoveRect(Rectangle& rRect, const Size& S) { rRect.Move(S.Width(),S.Height()); }
+inline void MovePoint(Point& rPnt, const Size& S) { rPnt.X()+=S.Width(); rPnt.Y()+=S.Height(); }
+inline void MovePoly(Polygon& rPoly, const Size& S) { rPoly.Move(S.Width(),S.Height()); }
+inline void MovePoly(PolyPolygon& rPoly, const Size& S) { rPoly.Move(S.Width(),S.Height()); }
+void MoveXPoly(XPolygon& rPoly, const Size& S);
+
+SVX_DLLPUBLIC void ResizeRect(Rectangle& rRect, const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bNoJustify = false);
+inline void ResizePoint(Point& rPnt, const Point& rRef, Fraction xFact, Fraction yFact);
+void ResizePoly(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);
+SVX_DLLPUBLIC void RotatePoly(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 MirrorPoly(Polygon& rPoly, 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);
+SVX_DLLPUBLIC void ShearPoly(Polygon& rPoly, const Point& rRef, double tn, bool bVShear = false);
+void ShearXPoly(XPolygon& rPoly, const Point& rRef, double tn, bool bVShear = false);
+
+// rPnt.X bzw rPnt.Y wird auf rCenter.X bzw. rCenter.Y gesetzt!
+// anschliessend muss rPnt nur noch um rCenter gedreht werden.
+// Der Rueckgabewinkel ist ausnahmsweise in Rad.
+inline double GetCrookAngle(Point& rPnt, const Point& rCenter, const Point& rRad, bool bVertical);
+// Die folgenden Methoden behandeln einen Punkt eines XPolygons, wobei die
+// benachbarten Kontrollpunkte des eigentlichen Punktes ggf. in pC1/pC2
+// uebergeben werden. Ueber rSin/rCos wird gleichzeitig sin(nWink) und cos(nWink)
+// zurueckgegeben.
+// Der Rueckgabewinkel ist hier ebenfalls 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 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 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 Rectangle rRefRect);
+
+/**************************************************************************************************/
+/* Inline */
+/**************************************************************************************************/
+
+inline void ResizePoint(Point& rPnt, const Point& rRef, Fraction xFact, Fraction yFact)
+{
+ if (xFact.GetDenominator()==0) xFact=Fraction(xFact.GetNumerator(),1); // DivZero abfangen
+ if (yFact.GetDenominator()==0) yFact=Fraction(yFact.GetNumerator(),1); // DivZero abfangen
+ rPnt.X()=rRef.X()+ Round(((double)(rPnt.X()-rRef.X())*xFact.GetNumerator())/xFact.GetDenominator());
+ rPnt.Y()=rRef.Y()+ Round(((double)(rPnt.Y()-rRef.Y())*yFact.GetNumerator())/yFact.GetDenominator());
+}
+
+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.X()=Round(rRef.X()+dx*cs+dy*sn);
+ rPnt.Y()=Round(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()) { // sonst nicht noetig
+ rPnt.X()-=Round((rPnt.Y()-rRef.Y())*tn);
+ }
+ } else { // ansonsten vertikal
+ if (rPnt.X()!=rRef.X()) { // sonst nicht noetig
+ rPnt.Y()-=Round((rPnt.X()-rRef.X())*tn);
+ }
+ }
+}
+
+inline double GetCrookAngle(Point& rPnt, const Point& rCenter, const Point& rRad, bool bVertical)
+{
+ double nWink;
+ if (bVertical) {
+ long dy=rPnt.Y()-rCenter.Y();
+ nWink=(double)dy/(double)rRad.Y();
+ rPnt.Y()=rCenter.Y();
+ } else {
+ long dx=rCenter.X()-rPnt.X();
+ nWink=(double)dx/(double)rRad.X();
+ rPnt.X()=rCenter.X();
+ }
+ return nWink;
+}
+
+/**************************************************************************************************/
+/**************************************************************************************************/
+
+// Y-Achse zeigt nach unten! Die Funktion negiert bei der
+// Winkelberechnung die Y-Achse, sodass GetAngle(Point(0,-1))=90.00deg.
+// GetAngle(Point(0,0)) liefert 0.
+// Der Rueckgabewert liegt im Bereich -180.00..179.99 Degree und
+// ist in 1/100 Degree angegeben.
+SVX_DLLPUBLIC long GetAngle(const Point& rPnt);
+long NormAngle180(long a); // Winkel normalisieren auf -180.00..179.99
+SVX_DLLPUBLIC long NormAngle360(long a); // Winkel normalisieren auf 0.00..359.99
+sal_uInt16 GetAngleSector(long nWink); // Sektor im kartesischen Koordinatensystem bestimmen
+// Berechnet die Laenge von (0,0) via a^2 + b^2 = c^2
+// Zur Vermeidung von Ueberlaeufen werden ggf. einige Stellen ignoriert.
+long GetLen(const Point& rPnt);
+
+/*
+ Transformation eines Rechtecks in ein Polygon unter ------------
+ Anwendung der Winkelparameter aus GeoStat. /1 2/
+ Referenzpunkt ist stets der Punkt 0, also die linke / /
+ obere Ecke des Ausgangsrects. / /
+ Bei der Berechnung des Polygons ist die Reihenfolge / /
+ (erst Shear, dann Rotation vorgegeben). / / \
+ / / |
+ A) Ausgangsrechteck aRect B) Nach Anwendung von Shear /0 3/ Rot|
+ +------------------+ -------------------- ------------ ------
+ |0 1| \0 1\ C) Nach Anwendung
+ | | \ \ von Rotate
+ | | | \ \
+ |3 2| | \3 2\
+ +------------------+ | --------------------
+ |Shr |
+ Bei Rueckkonvertierung des Polygons in ein Rect ist die Reihenfolge
+ zwangslaeufig umgekehrt:
+ - Berechnung des Drehwinkels: Winkel der Strecke 0-1 aus Abb. C) zum Horizont
+ - Rueckdrehung des geshearten Rects (man erhaelt Abb B))
+ - Bestimmung der Breite des Rects=Laenge der Strecke 0-1 aus Abb. B)
+ - Bestimmung der Hoehe des Rects=vertikaler Abstand zwischen den Punkten
+ 0 und 3 aus Abb. B)
+ - Bestimmung des Shear-Winkels aus der Strecke 0-3 zur Senkrechten.
+ Es ist darauf zu achten, dass das Polygon bei einer zwischenzeitlichen
+ Transformation evtl. gespiegelt wurde (Mirror oder Resize mit neg. Faktor).
+ In diesem Fall muss zunaecht eine Normalisierung durch Vertauschung der
+ Punkte (z.B. 0 mit 3 und 1 mit 2) durchgefuehrt werden, damit der
+ Richtungssinn im Polygon wieder stimmig ist.
+ Hinweis: Positiver Shear-Winkel bedeutet Shear mit auf dem Bildschirm
+ sichtbarer positiver Kursivierung. Mathematisch waere dass eine negative
+ Kursivierung, da die Y-Achse auf dem Bildschirm von oben nach unten verlaeuft.
+ Drehwinkel: Positiv bedeutet auf dem Bildschirm sichtbare Linksdrehung.
+*/
+
+class GeoStat { // Geometrischer Status fuer ein Rect
+public:
+ long nDrehWink;
+ long nShearWink;
+ double nTan; // tan(nShearWink)
+ double nSin; // sin(nDrehWink)
+ double nCos; // cos(nDrehWink)
+ bool bMirrored; // Horizontal gespiegelt? (ni)
+public:
+ GeoStat(): nDrehWink(0),nShearWink(0),nTan(0.0),nSin(0.0),nCos(1.0),bMirrored(false) {}
+ void RecalcSinCos();
+ void RecalcTan();
+};
+
+Polygon Rect2Poly(const Rectangle& rRect, const GeoStat& rGeo);
+void Poly2Rect(const Polygon& rPol, Rectangle& rRect, GeoStat& rGeo);
+
+SVX_DLLPUBLIC void OrthoDistance8(const Point& rPt0, Point& rPt, bool bBigOrtho);
+SVX_DLLPUBLIC void OrthoDistance4(const Point& rPt0, Point& rPt, bool bBigOrtho);
+
+// Multiplikation und anschliessende Division.
+// Rechnung und Zwischenergebnis sind BigInt.
+SVX_DLLPUBLIC long BigMulDiv(long nVal, long nMul, long nDiv);
+
+// Fehlerbehaftetes Kuerzen einer Fraction.
+// nDigits gibt an, wieviele signifikante Stellen in
+// Zaehler/Nenner mindestens erhalten bleiben sollen.
+void Kuerzen(Fraction& rF, unsigned nDigits);
+
+
+class FrPair {
+ Fraction aX;
+ Fraction aY;
+public:
+ FrPair() : aX(0,1),aY(0,1) {}
+ 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; }
+};
+
+// Fuer die Umrechnung von Masseinheiten
+SVX_DLLPUBLIC FrPair GetMapFactor(MapUnit eS, MapUnit eD);
+FrPair GetMapFactor(FieldUnit eS, FieldUnit eD);
+
+inline bool IsMetric(MapUnit eU) {
+ return (eU==MAP_100TH_MM || eU==MAP_10TH_MM || eU==MAP_MM || eU==MAP_CM);
+}
+
+inline bool IsInch(MapUnit eU) {
+ return (eU==MAP_1000TH_INCH || eU==MAP_100TH_INCH || eU==MAP_10TH_INCH || eU==MAP_INCH ||
+ eU==MAP_POINT || eU==MAP_TWIP);
+}
+
+inline bool IsMetric(FieldUnit eU) {
+ return (eU==FUNIT_MM || eU==FUNIT_CM || eU==FUNIT_M || eU==FUNIT_KM || eU==FUNIT_100TH_MM);
+}
+
+inline bool IsInch(FieldUnit eU) {
+ return (eU==FUNIT_TWIP || eU==FUNIT_POINT || eU==FUNIT_PICA ||
+ eU==FUNIT_INCH || eU==FUNIT_FOOT || eU==FUNIT_MILE);
+}
+
+class SVX_DLLPUBLIC SdrFormatter {
+ Fraction aScale;
+ long nMul_;
+ long nDiv_;
+ short nKomma_;
+ bool bSrcFU;
+ bool bDstFU;
+ bool bDirty;
+ MapUnit eSrcMU;
+ MapUnit eDstMU;
+ FieldUnit eSrcFU;
+ FieldUnit eDstFU;
+private:
+ SVX_DLLPRIVATE void Undirty();
+ SVX_DLLPRIVATE void ForceUndirty() const { if (bDirty) ((SdrFormatter*)this)->Undirty(); }
+public:
+ SdrFormatter(MapUnit eSrc, MapUnit eDst) { eSrcMU=eSrc; bSrcFU=sal_False; eDstMU=eDst; bDstFU=sal_False; bDirty=sal_True; }
+ SdrFormatter(MapUnit eSrc, FieldUnit eDst) { eSrcMU=eSrc; bSrcFU=sal_False; eDstFU=eDst; bDstFU=sal_True; bDirty=sal_True; }
+ SdrFormatter(FieldUnit eSrc, MapUnit eDst) { eSrcFU=eSrc; bSrcFU=sal_True; eDstMU=eDst; bDstFU=sal_False; bDirty=sal_True; }
+ SdrFormatter(FieldUnit eSrc, FieldUnit eDst) { eSrcFU=eSrc; bSrcFU=sal_True; eDstFU=eDst; bDstFU=sal_True; bDirty=sal_True; }
+ void SetSourceUnit(MapUnit eSrc) { eSrcMU=eSrc; bSrcFU=sal_False; bDirty=sal_True; }
+ void SetSourceUnit(FieldUnit eSrc) { eSrcFU=eSrc; bSrcFU=sal_True; bDirty=sal_True; }
+ void SetDestinationUnit(MapUnit eDst) { eDstMU=eDst; bDstFU=sal_False; bDirty=sal_True; }
+ void SetDestinationUnit(FieldUnit eDst) { eDstFU=eDst; bDstFU=sal_True; bDirty=sal_True; }
+ void TakeStr(long nVal, OUString& rStr) const;
+ static void TakeUnitStr(MapUnit eUnit, OUString& rStr);
+ static void TakeUnitStr(FieldUnit eUnit, OUString& rStr);
+ static OUString GetUnitStr(MapUnit eUnit) { OUString aStr; TakeUnitStr(eUnit,aStr); return aStr; }
+ static OUString GetUnitStr(FieldUnit eUnit) { OUString aStr; TakeUnitStr(eUnit,aStr); return aStr; }
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..ff5f36281244
--- /dev/null
+++ b/include/svx/svdtypes.hxx
@@ -0,0 +1,162 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDTYPES_HXX
+#define _SVDTYPES_HXX
+
+#include <tools/solar.h>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// @@@@ @@@@@ @@@@@ @@@@ @@@@@ @@@@@@ @@@@@ @@@@ @@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@@@ @@ @@ @@@@@ @@ @@ @@@@@ @@ @@@@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@@@ @@@@@ @@ @@ @@@@ @@@@@ @@@@ @@@@@ @@@@ @@
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+const sal_uInt32 SdrInventor=sal_uInt32('S')*0x00000001+
+ sal_uInt32('V')*0x00000100+
+ sal_uInt32('D')*0x00010000+
+ sal_uInt32('r')*0x01000000;
+
+// Kommandos fuer EndCreate()
+enum SdrCreateCmd {SDRCREATE_NEXTPOINT, // Naechster Polygonpunkt, Kreissegment: Naechste Koordinate
+ SDRCREATE_NEXTOBJECT, // Naechstes Polygon im PolyPolygon
+ SDRCREATE_FORCEEND}; // Ende erzwungen
+
+enum SdrDragMode
+{
+ SDRDRAG_MOVE, // Verschieben
+ SDRDRAG_RESIZE, // Groesse aendern
+ SDRDRAG_ROTATE, // Drehen
+ SDRDRAG_MIRROR, // Spiegeln
+ SDRDRAG_SHEAR, // Schraegstellen
+ SDRDRAG_CROOK, // Kreisfoermig verbiegen
+ SDRDRAG_DISTORT, // Freies verzerren (Rect in beliebiges Viereck transformieren)
+
+ // new modes for interactive transparence and gradient tools
+ SDRDRAG_TRANSPARENCE,
+ SDRDRAG_GRADIENT,
+
+ // new mode for interactive cropping of graphics
+ SDRDRAG_CROP
+};
+
+
+// fuer SdrObject::ConvertToPoly()
+enum SdrConvertType {SDRCONVERT_POLY, // reines Polygon erzeugen
+ SDRCONVERT_BEZIER, // alles Beziersegmente
+ SDRCONVERT_MIXED}; // Gemischtes Objekt (optimal)
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// @@ @@@@ @@ @@ @@@@@ @@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@@@@@ @@@@ @@@@ @@@@@
+// @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@
+// @@@@@ @@ @@ @@ @@@@@ @@ @@
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Bei der Identifikation eines Layer kann es vorkommen, das dieser nicht
+// vorhanden ist. SdrLayerAdmin::GetLayerID(const String&) liefert
+// dann diesen Wert:
+#define SDRLAYER_NOTFOUND 0xFF
+// Man kann diesen Wert jodoch ohne Bedenken den Methoden des SdrLayerSet
+// zuwerfen, bekommt dann jedoch immer sal_False, bzw. tut die Methode nix.
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Typdeklaration fuer Layer-IDs
+typedef sal_uInt8 SdrLayerID;
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// @@@@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@@ @@ @@ @@@@ @@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@@@@ @@@@@@ @@ @@@ @@@@ @@@@ @@ @@ @@@@@ @@ @@ @@ @@@@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@@@@ @@@@@ @@@@ @@@@@ @@@@ @@@@@ @@ @@@@ @@
+////////////////////////////////////////////////////////////////////////////////////////////////////
+enum SdrObjListKind {SDROBJLIST_UNKNOWN =0x00, // Unbekannt
+ // reine Objektlisten:
+ SDROBJLIST_GROUPOBJ =0x01, // Objektliste eines Gruppenobjekts
+ SDROBJLIST_VIRTOBJECTS=0x02, // Liste ist die Liste der virtuellen Objekte
+ SDROBJLIST_SYMBOLTABLE=0x03, // Liste ist die Symboltabelle
+ // Hier haben zur Not noch 12 weitere Listentypen Platz
+ // Pages:
+ SDROBJLIST_DRAWPAGE =0x10, // Liste ist eine Zeichenseite
+ SDROBJLIST_MASTERPAGE =0x11 // Liste ist eine Masterpage
+ // Hier haben zur Not noch 8 weitere Pagetypen Platz
+}; // fuer die Surrogate reserviert
+
+inline bool SdrIsPageKind(SdrObjListKind eK) { return eK>=SDROBJLIST_DRAWPAGE && eK<=0x1A; }
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// @@@@@ @@@@@ @@@@@ @@@@@ @@@@ @@@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@@@@ @@@@ @@@@@ @@@@ @@@@@@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@@@@ @@ @@@@@ @@ @@ @@
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+enum SdrRepeatFunc {SDRREPFUNC_OBJ_NONE,
+ // Mit Parameter
+ SDRREPFUNC_OBJ_MOVE, // Distanz
+ SDRREPFUNC_OBJ_RESIZE, // Faktor, Referenz(%) bezogen auf MarkRect
+ SDRREPFUNC_OBJ_SETSNAPRECT, // Rectangle
+ SDRREPFUNC_OBJ_SETLOGICRECT, // Rectangle
+ SDRREPFUNC_OBJ_ROTATE, // Drehwinkel, Referenz(%) bezogen auf MarkRect
+ SDRREPFUNC_OBJ_SHEAR, // Winkel,Faktor, Referenz(%) bezogen auf MarkRect
+ SDRREPFUNC_OBJ_CROOKROTATE,
+ SDRREPFUNC_OBJ_CROOKSLANT,
+ SDRREPFUNC_OBJ_CROOKSTRETCH,
+ SDRREPFUNC_OBJ_ALIGN, // Hor/Vert/bBound
+ SDRREPFUNC_OBJ_SETATTRIBUTES,// ItemSet
+ SDRREPFUNC_OBJ_SETSTYLESHEET,// StyleSheet*
+ // Ohne Parameter
+ SDRREPFUNC_OBJ_DELETE,
+ SDRREPFUNC_OBJ_COMBINE_POLYPOLY,
+ SDRREPFUNC_OBJ_COMBINE_ONEPOLY,
+ SDRREPFUNC_OBJ_DISMANTLE_POLYS,
+ SDRREPFUNC_OBJ_DISMANTLE_LINES,
+ SDRREPFUNC_OBJ_CONVERTTOPOLY,
+ SDRREPFUNC_OBJ_CONVERTTOPATH,
+ SDRREPFUNC_OBJ_GROUP,
+ SDRREPFUNC_OBJ_UNGROUP,
+ SDRREPFUNC_OBJ_PUTTOTOP,
+ SDRREPFUNC_OBJ_PUTTOBTM,
+ SDRREPFUNC_OBJ_MOVTOTOP,
+ SDRREPFUNC_OBJ_MOVTOBTM,
+ SDRREPFUNC_OBJ_REVORDER,
+ SDRREPFUNC_OBJ_IMPORTMTF,
+ SDRREPFUNC_PAGE_DELETE,
+ SDRREPFUNC_LAST};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..22211640e148
--- /dev/null
+++ b/include/svx/svdundo.hxx
@@ -0,0 +1,879 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDUNDO_HXX
+#define _SVDUNDO_HXX
+
+#include <svl/solar.hrc>
+#include <svl/undo.hxx>
+#include <tools/gen.hxx>
+#include <svx/svdtypes.hxx> // fuer enum RepeatFuncts
+#include <svx/svdsob.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class SfxItemSet;
+class SfxStyleSheet;
+class SdrView;
+class SdrPageView;
+class SdrModel;
+class SdrObject;
+class SdrPage;
+class SdrObjList;
+class SdrLayer;
+class SdrLayerAdmin;
+class SdrObjGeoData;
+class OutlinerParaObject;
+
+//************************************************************
+// SdrUndoAction
+//
+// Abstrakte Basisklasse fuer alle UndoActions der DrawingEngine
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoAction : public SfxUndoAction
+{
+protected:
+ SdrModel& rMod;
+
+protected:
+ SdrUndoAction(SdrModel& rNewMod)
+ : rMod(rNewMod)
+ {}
+
+public:
+ TYPEINFO();
+ virtual ~SdrUndoAction();
+
+ virtual sal_Bool CanRepeat(SfxRepeatTarget& rView) const;
+ virtual void Repeat(SfxRepeatTarget& rView);
+
+ virtual OUString GetRepeatComment(SfxRepeatTarget& rView) const;
+ virtual OUString GetSdrRepeatComment(SdrView& rView) const;
+
+ virtual bool CanSdrRepeat(SdrView& rView) const;
+ virtual void SdrRepeat(SdrView& rView);
+};
+
+//************************************************************
+// SdrUndoGroup
+//
+// Zusammenfassung beliebig vieler einzelner UndoActions zu einer einzigen
+// UndoAction. Beim Undo() werden die Einzelactions rueckwaets aufgerufen
+// (die zuletzt angehaengte zuerst...), beim Redo() dagegen entspricht die
+// Aufrufreihenfolge der Einfuegereihenfolge.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoGroup : public SdrUndoAction
+{
+protected:
+ std::vector<SdrUndoAction*> aBuf;
+
+ // Beschreibung der Action, nicht expandiert (beinhaltet %O)
+ OUString aComment;
+ OUString aObjDescription;
+
+ SdrRepeatFunc eFunction;
+
+public:
+ SdrUndoGroup(SdrModel& rNewMod);
+ virtual ~SdrUndoGroup();
+
+ void Clear();
+ sal_uIntPtr GetActionCount() const { return aBuf.size(); }
+ SdrUndoAction* GetAction(sal_uIntPtr nNum) const { return aBuf[nNum]; }
+ void AddAction(SdrUndoAction* pAct);
+
+ void SetComment(const OUString& rStr) { aComment=rStr; }
+ void SetObjDescription(const OUString& rStr) { aObjDescription=rStr; }
+ virtual OUString GetComment() const;
+ virtual OUString GetSdrRepeatComment(SdrView& rView) const;
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual bool CanSdrRepeat(SdrView& rView) const;
+ virtual void SdrRepeat(SdrView& rView);
+ void SetRepeatFunction(SdrRepeatFunc eFunc) { eFunction=eFunc; }
+ SdrRepeatFunc GetRepeatFunction() const { return eFunction; }
+};
+
+//************************************************************
+// SdrUndoObj
+//
+// Abstrakte Basisklasse fuer alle UndoActions die mit Objekten zu tun haben.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoObj : public SdrUndoAction
+{
+protected:
+ SdrObject* pObj;
+
+protected:
+ SdrUndoObj(SdrObject& rNewObj);
+
+ void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, bool bRepeat = false) const;
+
+ static void GetDescriptionStringForObject( const SdrObject& _rForObject, sal_uInt16 nStrCacheID, String& rStr, bool bRepeat = false );
+
+ // #94278# new method for evtl. PageChange at UNDO/REDO
+ void ImpShowPageOfThisObject();
+};
+
+//************************************************************
+// SdrUndoAttrObj
+//
+// Aenderung der Objektattribute.
+// Action direkt vor dem Setzen der neuen Attribute konstruieren.
+// Auch fuer StyleSheets
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoAttrObj : public SdrUndoObj
+{
+protected:
+ SfxItemSet* pUndoSet;
+ SfxItemSet* pRedoSet;
+ SfxItemSet* pRepeatSet;
+
+ // oder besser den StyleSheetNamen merken?
+ SfxStyleSheet* pUndoStyleSheet;
+ SfxStyleSheet* pRedoStyleSheet;
+ SfxStyleSheet* pRepeatStyleSheet;
+ bool bStyleSheet;
+ bool bHaveToTakeRedoSet;
+
+ // Bei Zuweisung von TextItems auf ein Zeichenobjekt mit Text:
+ OutlinerParaObject* pTextUndo;
+ // #i8508#
+ // The text rescue mechanism needs also to be implemented for redo actions.
+ OutlinerParaObject* pTextRedo;
+
+ // Wenn sich um ein Gruppenobjekt handelt:
+ SdrUndoGroup* pUndoGroup;
+
+public:
+ SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1 = false, bool bSaveText = false);
+ virtual ~SdrUndoAttrObj();
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+ virtual OUString GetSdrRepeatComment(SdrView& rView) const;
+
+ virtual void SdrRepeat(SdrView& rView);
+ virtual bool CanSdrRepeat(SdrView& rView) const;
+};
+
+//************************************************************
+// SdrUndoMoveObj
+//
+// Blosses verschieben eines Objektes.
+// Action direkt vor dem Verschieben konstruieren.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoMoveObj : public SdrUndoObj
+{
+protected:
+ Size aDistance; // Entfernung, um die verschoben wird
+
+public:
+ SdrUndoMoveObj(SdrObject& rNewObj): SdrUndoObj(rNewObj) {}
+ SdrUndoMoveObj(SdrObject& rNewObj, const Size& rDist): SdrUndoObj(rNewObj),aDistance(rDist) {}
+ virtual ~SdrUndoMoveObj();
+
+ void SetDistance(const Size& rDist) { aDistance=rDist; }
+ const Size& GetDistance() const { return aDistance; }
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+ virtual OUString GetSdrRepeatComment(SdrView& rView) const;
+
+ virtual void SdrRepeat(SdrView& rView);
+ virtual bool CanSdrRepeat(SdrView& rView) const;
+};
+
+//************************************************************
+// SdrUndoGeoObj
+//
+// Aenderung der Geometrie eines Objektes.
+// Action direkt vor der geometrischen Transformation konstruieren.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoGeoObj : public SdrUndoObj
+{
+protected:
+ SdrObjGeoData* pUndoGeo;
+ SdrObjGeoData* pRedoGeo;
+ // Wenn sich um ein Gruppenobjekt handelt:
+ SdrUndoGroup* pUndoGroup;
+
+public:
+ SdrUndoGeoObj(SdrObject& rNewObj);
+ virtual ~SdrUndoGeoObj();
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+};
+
+//************************************************************
+// SdrUndoObjList
+//
+// Manipulationen an einer ObjList: Neues Obj, DeleteObj, SetObjZLevel, Grouping, ...
+// Abstrakte Basisklasse.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoObjList : public SdrUndoObj {
+ class ObjListListener;
+ friend class ObjListListener;
+
+private:
+ bool bOwner;
+
+protected:
+ SdrObjList* pObjList;
+ SdrView* pView; // um bei ObjDel, Undo die
+ SdrPageView* pPageView; // Selektion widerherstellen zu koennen
+ sal_uInt32 nOrdNum;
+ // Bei einem Undo/Redo findet moeglicherweise Uebereignung des Objektes
+ // statt. Im Dtor wird das Obj deleted, wenn bOwner==TRUE
+ ObjListListener* m_pListener;
+
+protected:
+ SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect = false);
+ virtual ~SdrUndoObjList();
+
+ void SetView(SdrView* pView1, SdrPageView* pPageView1) { pView=pView1; pPageView=pPageView1; }
+ bool IsOwner() { return bOwner; }
+ void SetOwner(bool bNew);
+
+private:
+ sal_uInt32 GetOrdNum() const;
+ void SetOrdNum(sal_uInt32 nOrdNum_);
+};
+
+//************************************************************
+// SdrUndoRemoveObj
+//
+// Entfernen Objekts aus einer Objektliste. Innerhalb einer UndoGroup
+// mit korrospondierenden Inserts zu verwenden.
+// Action vor dem entfernen aus der ObjList konstruieren.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoRemoveObj : public SdrUndoObjList
+{
+public:
+ SdrUndoRemoveObj(SdrObject& rNewObj, bool bOrdNumDirect = false)
+ : SdrUndoObjList(rNewObj,bOrdNumDirect) {}
+
+ virtual void Undo();
+ virtual void Redo();
+};
+
+//************************************************************
+// SdrUndoInsertObj
+//
+// Einfuegen Objekts in eine Objektliste. Innerhalb einer UndoGroup
+// mit korrospondierenden Removes zu verwenden.
+// Action vor dem entfernen aus der ObjList konstruieren.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoInsertObj : public SdrUndoObjList
+{
+public:
+ SdrUndoInsertObj(SdrObject& rNewObj, bool bOrdNumDirect = false)
+ : SdrUndoObjList(rNewObj,bOrdNumDirect) {}
+
+ virtual void Undo();
+ virtual void Redo();
+};
+
+//************************************************************
+// SdrUndoDelObj
+//
+// Loeschen eines Objekts.
+// Action vor dem entfernen aus der ObjList konstruieren.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoDelObj : public SdrUndoRemoveObj
+{
+public:
+ SdrUndoDelObj(SdrObject& rNewObj, bool bOrdNumDirect = false)
+ : SdrUndoRemoveObj(rNewObj,bOrdNumDirect) { SetOwner(sal_True); }
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+ virtual OUString GetSdrRepeatComment(SdrView& rView) const;
+
+ virtual void SdrRepeat(SdrView& rView);
+ virtual bool CanSdrRepeat(SdrView& rView) const;
+};
+
+//************************************************************
+// SdrUndoNewObj
+//
+// Einfuegen eines neuen Objektes.
+// Action nach dem einfuegen in die ObjList konstruieren.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoNewObj : public SdrUndoInsertObj
+{
+public:
+ SdrUndoNewObj(SdrObject& rNewObj, bool bOrdNumDirect = false)
+ : SdrUndoInsertObj(rNewObj,bOrdNumDirect) {}
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+
+ static OUString GetComment(const SdrObject& _rForObject);
+};
+
+//************************************************************
+// SdrUndoReplaceObj
+//
+// Austausch eines Objektes.
+// Action vor dem Replace an der ObjList konstruieren.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoReplaceObj : public SdrUndoObj
+{
+ bool bOldOwner;
+ bool bNewOwner;
+
+protected:
+ SdrObjList* pObjList;
+ sal_uInt32 nOrdNum;
+ SdrObject* pNewObj;
+
+public:
+ SdrUndoReplaceObj(SdrObject& rOldObj1, SdrObject& rNewObj1, bool bOrdNumDirect = false);
+ virtual ~SdrUndoReplaceObj();
+
+ virtual void Undo();
+ virtual void Redo();
+
+ bool IsNewOwner() { return bNewOwner; }
+ void SetNewOwner(bool bNew);
+
+ bool IsOldOwner() { return bOldOwner; }
+ void SetOldOwner(bool bNew);
+};
+
+//************************************************************
+// SdrUndoCopyObj
+//
+// Kopieren eines Objekts
+// Action nach dem einfuegen in die ObjList konstruieren.
+//
+//************************************************************
+
+class SdrUndoCopyObj : public SdrUndoNewObj
+{
+public:
+ SdrUndoCopyObj(SdrObject& rNewObj, bool bOrdNumDirect = false)
+ : SdrUndoNewObj(rNewObj,bOrdNumDirect) {}
+
+ virtual OUString GetComment() const;
+};
+
+//************************************************************
+// SdrUndoObjOrdNum
+//************************************************************
+
+class SdrUndoObjOrdNum : public SdrUndoObj
+{
+protected:
+ sal_uInt32 nOldOrdNum;
+ sal_uInt32 nNewOrdNum;
+
+public:
+ SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1);
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+};
+
+//////////////////////////////////////////////////////////////////////////////
+// #i11702#
+
+class SVX_DLLPUBLIC SdrUndoObjectLayerChange : public SdrUndoObj
+{
+protected:
+ SdrLayerID maOldLayer;
+ SdrLayerID maNewLayer;
+
+public:
+ SdrUndoObjectLayerChange(SdrObject& rObj, SdrLayerID aOldLayer, SdrLayerID aNewLayer);
+
+ virtual void Undo();
+ virtual void Redo();
+};
+
+//************************************************************
+// SdrUndoObjSetText
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoObjSetText : public SdrUndoObj
+{
+protected:
+ OutlinerParaObject* pOldText;
+ OutlinerParaObject* pNewText;
+ bool bNewTextAvailable;
+ sal_Bool bEmptyPresObj;
+ sal_Int32 mnText;
+
+public:
+ SdrUndoObjSetText(SdrObject& rNewObj, sal_Int32 nText );
+ virtual ~SdrUndoObjSetText();
+
+ bool IsDifferent() const { return pOldText!=pNewText; }
+ void AfterSetText();
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+ virtual OUString GetSdrRepeatComment(SdrView& rView) const;
+
+ virtual void SdrRepeat(SdrView& rView);
+ virtual bool CanSdrRepeat(SdrView& rView) const;
+};
+
+// Implement Title/Description Elements UI for Writer text frames, graphics and embedded objects (#i73249#)
+class SdrUndoObjStrAttr : public SdrUndoObj
+{
+public:
+ enum ObjStrAttrType
+ {
+ OBJ_NAME,
+ OBJ_TITLE,
+ OBJ_DESCRIPTION
+ };
+
+protected:
+ const ObjStrAttrType meObjStrAttr;
+ const String msOldStr;
+ const String msNewStr;
+
+public:
+ SdrUndoObjStrAttr( SdrObject& rNewObj,
+ const ObjStrAttrType eObjStrAttr,
+ const String& sOldStr,
+ const String& sNewStr);
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@ @@@@ @@ @@ @@@@@ @@@@@
+// @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@@@@@ @@@@ @@@@ @@@@@
+// @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@
+// @@@@@ @@ @@ @@ @@@@@ @@ @@
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//************************************************************
+// SdrUndoLayer
+//
+// Abstrakte Basisklasse fuer alle UndoActions die mit SdrLayer zu tun haben.
+//
+//************************************************************
+
+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();
+};
+
+//************************************************************
+// SdrUndoNewLayer
+//
+// Einfuegen eines neuen Layer. Action nach dem Einfuegen konstruieren.
+//
+//************************************************************
+
+class SdrUndoNewLayer : public SdrUndoLayer
+{
+public:
+ SdrUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
+ : SdrUndoLayer(nLayerNum,rNewLayerAdmin,rNewModel) {}
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+};
+
+//************************************************************
+// SdrUndoDelLayer
+//
+// Loeschen eines Layer. Action vor dem Remove konstruieren
+//
+//************************************************************
+
+class SdrUndoDelLayer : public SdrUndoLayer
+{
+public:
+ SdrUndoDelLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
+ : SdrUndoLayer(nLayerNum,rNewLayerAdmin,rNewModel) { bItsMine=sal_True; }
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+};
+
+//************************************************************
+// SdrUndoMoveLayer
+//
+// Verschieben eines Layer. Action vor dem Verschieben konstruieren.
+//
+//************************************************************
+
+class SdrUndoMoveLayer : public SdrUndoLayer
+{
+ sal_uInt16 nNeuPos;
+
+public:
+ SdrUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1)
+ : SdrUndoLayer(nLayerNum,rNewLayerAdmin,rNewModel), nNeuPos(nNeuPos1) {}
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@@@@ @@@@ @@@@ @@@@@ @@@@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@
+// @@@@@ @@@@@@ @@ @@@ @@@@ @@@@
+// @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@@@@ @@@@@ @@@@
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//************************************************************
+// SdrUndoPage
+//
+// Abstrakte Basisklasse fuer alle UndoActions die mit SdrPages zu tun haben.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC 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);
+
+ void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 n=0, bool bRepeat = false) const;
+};
+
+//************************************************************
+// SdrUndoPageList
+//
+// Manipulationen an einer PageList: Neue Page, DeletePage, MovePage(ChangePageNum)
+// Abstrakte Basisklasse.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoPageList : public SdrUndoPage
+{
+protected:
+ sal_uInt16 nPageNum;
+
+ // Bei einem Undo/Redo findet moeglicherweise Uebereignung der Page
+ // statt. Im Dtor wird die Page deleted, wenn bItsMine==TRUE
+ bool bItsMine;
+
+protected:
+ SdrUndoPageList(SdrPage& rNewPg);
+ virtual ~SdrUndoPageList();
+};
+
+//************************************************************
+// SdrUndoDelPage
+//
+// Loeschen einer Page.
+// Action vor dem entfernen aus der List konstruieren.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoDelPage : public SdrUndoPageList
+{
+ // Beim loeschen einer MasterPage merke ich mir in dieser UndoGroup
+ // alle Beziehungen der Zeichenseiten zu der geloeschten MasterPage
+ SdrUndoGroup* pUndoGroup;
+
+public:
+ SdrUndoDelPage(SdrPage& rNewPg);
+ virtual ~SdrUndoDelPage();
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+ virtual OUString GetSdrRepeatComment(SdrView& rView) const;
+
+ virtual void SdrRepeat(SdrView& rView);
+ virtual bool CanSdrRepeat(SdrView& rView) const;
+};
+
+//************************************************************
+// SdrUndoNewPage
+//
+// Einfuegen einer neuen Page.
+// Action nach dem einfuegen in die Liste konstruieren.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoNewPage : public SdrUndoPageList
+{
+public:
+ SdrUndoNewPage(SdrPage& rNewPg): SdrUndoPageList(rNewPg) {}
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+};
+
+//************************************************************
+// SdrUndoCopyPage
+//
+// Kopieren einer Page
+// Action nach dem einfuegen in die Liste konstruieren.
+//
+//************************************************************
+
+class SdrUndoCopyPage : public SdrUndoNewPage
+{
+public:
+ SdrUndoCopyPage(SdrPage& rNewPg): SdrUndoNewPage(rNewPg) {}
+
+ virtual OUString GetComment() const;
+ virtual OUString GetSdrRepeatComment(SdrView& rView) const;
+
+ virtual void SdrRepeat(SdrView& rView);
+ virtual bool CanSdrRepeat(SdrView& rView) const;
+};
+
+//************************************************************
+// SdrUndoSetPageNum
+//
+// Verschieben der Page innerhalb der Liste
+// Action vor dem Verschieben der Page konstruieren.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoSetPageNum : public SdrUndoPage
+{
+protected:
+ 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();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@ @@ @@@@ @@@@ @@@@@@ @@@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@
+// @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@@@@@@ @@@@@@ @@@@ @@ @@@@ @@@@@ @@@@@ @@@@@@ @@ @@@ @@@@ @@@@
+// @@ @ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@@@ @@ @@@@@ @@ @@ @@ @@ @@ @@@@@ @@@@@ @@@@
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//************************************************************
+// SdrUndoPageMasterPage
+//
+// Abstrakte Basisklasse fuer alle UndoActions die mit
+// MasterPage-Beziehungen zu tun haben.
+//
+//************************************************************
+
+class SdrUndoPageMasterPage : public SdrUndoPage
+{
+protected:
+ sal_Bool mbOldHadMasterPage;
+ SetOfByte maOldSet;
+ sal_uInt16 maOldMasterPageNumber;
+
+protected:
+ SdrUndoPageMasterPage(SdrPage& rChangedPage);
+
+public:
+ SVX_DLLPUBLIC virtual ~SdrUndoPageMasterPage();
+};
+
+//************************************************************
+// SdrUndoPageRemoveMasterPage
+//
+// Entfernen einer MasterPage von einer Zeichenseite.
+// Action vor dem Entfernen des MasterPageDescriptors erzeugen.
+//
+//************************************************************
+
+class SdrUndoPageRemoveMasterPage : public SdrUndoPageMasterPage
+{
+public:
+ SdrUndoPageRemoveMasterPage(SdrPage& rChangedPage);
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+};
+
+//************************************************************
+// SdrUndoPageChangeMasterPage
+//
+// Aenderung des MasterPageDescriptors (z.B. Aendern der VisibleLayer).
+// Action vor der Aenderung am MasterPageDescriptor erzeugen.
+//
+//************************************************************
+
+class SVX_DLLPUBLIC SdrUndoPageChangeMasterPage : public SdrUndoPageMasterPage
+{
+protected:
+ sal_Bool mbNewHadMasterPage;
+ SetOfByte maNewSet;
+ sal_uInt16 maNewMasterPageNumber;
+
+public:
+ SdrUndoPageChangeMasterPage(SdrPage& rChangedPage);
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual OUString GetComment() const;
+};
+
+///////////////////////////////////////////////////////////////////////
+
+/** 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 SVX_DLLPUBLIC SdrUndoFactory
+{
+public:
+ // shapes
+ virtual ~SdrUndoFactory();
+ virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject );
+ virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject, const Size& rDist );
+ virtual SdrUndoAction* CreateUndoGeoObject( SdrObject& rObject );
+ virtual SdrUndoAction* CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1 = false, bool bSaveText = false );
+ virtual SdrUndoAction* CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect = false);
+ virtual SdrUndoAction* CreateUndoInsertObject( SdrObject& rObject, bool bOrdNumDirect = false);
+ virtual SdrUndoAction* CreateUndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect = false);
+ virtual SdrUndoAction* CreateUndoNewObject( SdrObject& rObject, bool bOrdNumDirect = false);
+ virtual SdrUndoAction* CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect = false);
+
+ virtual SdrUndoAction* CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1);
+
+ virtual SdrUndoAction* CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect = false );
+ virtual SdrUndoAction* CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer );
+ virtual SdrUndoAction* CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText );
+
+ // Implement Title/Description Elements UI for Writer text frames, graphics and embedded objects (#i73249#)
+ virtual SdrUndoAction* CreateUndoObjectStrAttr( SdrObject& rObject,
+ SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType,
+ String sOldStr,
+ String sNewStr );
+
+ // layer
+ virtual SdrUndoAction* CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
+ virtual SdrUndoAction* CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
+ virtual SdrUndoAction* CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1);
+
+ // page
+ virtual SdrUndoAction* CreateUndoDeletePage(SdrPage& rPage);
+ virtual SdrUndoAction* CreateUndoNewPage(SdrPage& rPage);
+ virtual SdrUndoAction* CreateUndoCopyPage(SdrPage& rPage);
+ virtual SdrUndoAction* CreateUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1);
+
+ // master page
+ virtual SdrUndoAction* CreateUndoPageRemoveMasterPage(SdrPage& rChangedPage);
+ virtual SdrUndoAction* CreateUndoPageChangeMasterPage(SdrPage& rChangedPage);
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_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 000000000000..ef28a17f4513
--- /dev/null
+++ b/include/svx/svdview.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 _SVDVIEW_HXX
+#define _SVDVIEW_HXX
+
+// HACK to avoid too deep includes and to have some
+// levels free in svdmark itself (MS compiler include depth limit)
+#include <svx/svdhdl.hxx>
+#include <tools/weakbase.hxx>
+#include <svtools/accessibilityoptions.hxx>
+#include "svx/svxdllapi.h"
+#include <svx/svdcrtv.hxx>
+#include <unotools/options.hxx>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Klassenhierarchie der 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
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class SvxURLField;
+
+//************************************************************
+// Defines
+//************************************************************
+
+enum SdrViewContext {SDRCONTEXT_STANDARD,
+ SDRCONTEXT_POINTEDIT,
+ SDRCONTEXT_GLUEPOINTEDIT,
+ SDRCONTEXT_GRAPHIC,
+ SDRCONTEXT_MEDIA,
+ SDRCONTEXT_TABLE};
+
+enum SdrEventKind {SDREVENT_NONE,
+ SDREVENT_TEXTEDIT,
+ SDREVENT_MOVACTION,
+ SDREVENT_ENDACTION,
+ SDREVENT_BCKACTION,
+ SDREVENT_BRKACTION,
+ SDREVENT_ENDCREATE,
+ SDREVENT_ENDDRAG,
+ SDREVENT_MARKOBJ,
+ SDREVENT_MARKPOINT,
+ SDREVENT_MARKGLUEPOINT,
+ SDREVENT_BEGMARK,
+ SDREVENT_BEGINSOBJPOINT,
+ SDREVENT_ENDINSOBJPOINT,
+ SDREVENT_BEGINSGLUEPOINT,
+ SDREVENT_BEGDRAGHELPLINE,
+ SDREVENT_BEGDRAGOBJ,
+ SDREVENT_BEGCREATEOBJ,
+ SDREVENT_BEGMACROOBJ,
+ SDREVENT_BEGTEXTEDIT,
+ SDREVENT_ENDMARK,
+ SDREVENT_BRKMARK,
+ SDREVENT_EXECUTEURL};
+
+#define SDRMOUSEBUTTONDOWN 1
+#define SDRMOUSEMOVE 2
+#define SDRMOUSEBUTTONUP 3
+
+//************************************************************
+// Hilfsklasse SdrViewEvent
+//************************************************************
+
+struct SVX_DLLPUBLIC SdrViewEvent
+{
+ SdrHdl* pHdl;
+ SdrObject* pObj;
+ SdrObject* pRootObj; // Dieses Markieren bei SdrBeginTextEdit
+ SdrPageView* pPV;
+ const SvxURLField* pURLField;
+
+ Point aLogicPos;
+ SdrHitKind eHit;
+ SdrEventKind eEvent;
+ SdrHdlKind eHdlKind;
+ SdrCreateCmd eEndCreateCmd; // auch fuer EndInsPoint
+
+ sal_uInt16 nMouseClicks;
+ sal_uInt16 nMouseMode;
+ sal_uInt16 nMouseCode;
+ sal_uInt16 nHlplIdx;
+ sal_uInt16 nGlueId;
+
+ unsigned bMouseDown : 1;
+ unsigned bMouseUp : 1;
+ unsigned bDoubleHdlSize : 1; // Doppelte Handlegroesse wg. TextEdit
+ unsigned bIsAction : 1; // Action ist aktiv
+ unsigned bIsTextEdit : 1; // TextEdit laeuft zur Zeit
+ unsigned bTextEditHit : 1; // offene OutlinerView getroffen
+ unsigned bAddMark : 1;
+ unsigned bUnmark : 1;
+ unsigned bPrevNextMark : 1;
+ unsigned bMarkPrev : 1;
+ unsigned bInsPointNewObj : 1;
+ unsigned bDragWithCopy : 1;
+ unsigned bCaptureMouse : 1;
+ unsigned bReleaseMouse : 1;
+
+public:
+ SdrViewEvent();
+ ~SdrViewEvent();
+
+ // nEventKind ist SDRMOUSEBUTTONDOWN, SDRMOUSEMOVE oder SDRMOUSEBUTTONUP
+ void SetMouseEvent(const MouseEvent& rMEvt, sal_uInt16 nEventKind);
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// helper class for all D&D overlays
+
+class SVX_DLLPUBLIC SdrDropMarkerOverlay
+{
+ // The OverlayObjects
+ ::sdr::overlay::OverlayObjectList maObjects;
+
+ void ImplCreateOverlays(const SdrView& rView, const basegfx::B2DPolyPolygon& rPolyPolygon);
+
+public:
+ SdrDropMarkerOverlay(const SdrView& rView, const SdrObject& rObject);
+ SdrDropMarkerOverlay(const SdrView& rView, const Rectangle& rRectangle);
+ SdrDropMarkerOverlay(const SdrView& rView, const Point& rStart, const Point& rEnd);
+ ~SdrDropMarkerOverlay();
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@ @@ @@ @@@@@ @@ @@
+// @@ @@ @@ @@ @@ @@
+// @@ @@ @@ @@ @@ @ @@
+// @@@@@ @@ @@@@ @@@@@@@
+// @@@ @@ @@ @@@@@@@
+// @@@ @@ @@ @@@ @@@
+// @ @@ @@@@@ @@ @@
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrView: public SdrCreateView, public tools::WeakBase< SdrView >
+{
+ friend class SdrPageView;
+
+ unsigned bNoExtendedMouseDispatcher : 1;
+ unsigned bNoExtendedKeyDispatcher : 1;
+ unsigned bNoExtendedCommandDispatcher : 1;
+ unsigned bTextEditOnObjectsWithoutTextIfTextTool : 1;
+ unsigned mbMasterPagePaintCaching : 1;
+
+protected:
+ SvtAccessibilityOptions maAccessibilityOptions;
+
+public:
+ TYPEINFO();
+ explicit SdrView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ virtual ~SdrView();
+
+ // Default sind alle Dispatcher aktiviert. Will die App z.B. fuer
+ // Sonderbehandlungen im MouseDispatcher eingreifen, so muss sie
+ // den erweiterten MouseDispather mit unten stehender Methode deaktivieren
+ // und selbst nachimplementieren. Beispiel fuer MouseButtonDown:
+ // SdrViewEvent aVEvt;
+ // SdrHitKind eHit=pSdrView->PickAnything(rMEvt,SDRMOUSEBUTTONDOWN,aVEvt);
+ // ... hier Applikationsspezifischer Eingriff ...
+ // pSdrView->DoMouseEvent(aVEvt);
+ // SetPointer(GetPreferedPointer(...))
+ // CaptureMouse(...)
+ void EnableExtendedMouseEventDispatcher(sal_Bool bOn) { bNoExtendedMouseDispatcher = !bOn; }
+ sal_Bool IsExtendedMouseEventDispatcherEnabled() const { return bNoExtendedMouseDispatcher; }
+
+ void EnableExtendedKeyInputDispatcher(sal_Bool bOn) { bNoExtendedKeyDispatcher=!bOn; }
+ sal_Bool IsExtendedKeyInputDispatcherEnabled() const { return bNoExtendedKeyDispatcher; }
+
+ void EnableExtendedCommandEventDispatcher(sal_Bool bOn) { bNoExtendedCommandDispatcher=!bOn; }
+ sal_Bool IsExtendedCommandEventDispatcherEnabled() const { return bNoExtendedCommandDispatcher; }
+
+ void EnableTextEditOnObjectsWithoutTextIfTextTool(sal_Bool bOn) { bTextEditOnObjectsWithoutTextIfTextTool=bOn; }
+ sal_Bool IsEnableTextEditOnObjectsWithoutTextIfTextToolEnabled() const { return bTextEditOnObjectsWithoutTextIfTextTool; }
+
+ void SetMasterPagePaintCaching(sal_Bool bOn);
+ sal_Bool IsMasterPagePaintCaching() const { return mbMasterPagePaintCaching; }
+
+ sal_Bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
+ virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
+ virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
+ virtual sal_Bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
+ virtual sal_Bool Command(const CommandEvent& rCEvt, Window* pWin);
+
+ virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
+
+ sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll=sal_False) { return SdrCreateView::SetAttributes(rSet,bReplaceAll); }
+ sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr=sal_False) { return SdrCreateView::SetStyleSheet(pStyleSheet,bDontRemoveHardAttr); }
+
+ /* new interface src537 */
+ sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const;
+
+ SfxStyleSheet* GetStyleSheet() const;
+
+ // unvollstaendige Implementation:
+ // Das OutputDevice ist notwendig, damit ich die HandleSize ermitteln kann.
+ // Bei NULL wird das 1. angemeldete Win verwendet.
+ Pointer GetPreferedPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nModifier=0, sal_Bool bLeftDown=sal_False) const;
+ SdrHitKind PickAnything(const MouseEvent& rMEvt, sal_uInt16 nMouseDownOrMoveOrUp, SdrViewEvent& rVEvt) const;
+ SdrHitKind PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) const;
+ sal_Bool DoMouseEvent(const SdrViewEvent& rVEvt);
+ virtual SdrViewContext GetContext() const;
+
+ // Die Methoden beruecksichtigen den jeweiligen Kontex:
+ // - Einfaches Zeichnen
+ // - Punktbearbeitungs-Mode
+ // - Klebepunkt-Editmode
+ // - TextEdit
+ // - ... to be continued
+ void MarkAll();
+ void UnmarkAll();
+
+ const Rectangle& GetMarkedRect() const;
+
+ virtual void DeleteMarked();
+
+ // Markieren von Objekten, Polygonpunkten oder Klebepunkten (je nach View-
+ // Kontext) durch Aufziehen eines Selektionsrahmens.
+ // bAddMark=TRUE: zur bestehenden Selektion hinzumarkieren (->Shift)
+ // bUnmark=TRUE: Bereits selektierte Objekte/Punkte/Klebepunkte die innerhalb
+ // des aufgezogenen Rahmens liegen werden deselektiert.
+ sal_Bool BegMark(const Point& rPnt, sal_Bool bAddMark=sal_False, sal_Bool bUnmark=sal_False);
+
+ // Folgende Actions sind moeglich:
+ // - ObjectCreating
+ // - ObjectMarking
+ // - Object-specific dragging
+ // - General dragging
+ // und mehr...
+ String GetStatusText();
+
+ SvtAccessibilityOptions& getAccessibilityOptions();
+
+ virtual void onAccessibilityOptionsChanged();
+};
+
+#endif //_SVDVIEW_HXX
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Die App macht sich zunaechst ein SdrModel.
+// Anschliessend oeffnet sie ein Win und erzeugt dann eine SdrView.
+// An der SdrView meldet sie dann mit der Methode ShowSdrPage() eine Seite an.
+// Eine SdrView kann in beliebig vielen Fenstern gleichzeitig angezeigt werden.
+// Intern:
+// Eine SdrView kann beliebig viele Seiten gleichzeitig anzeigen. Seiten
+// werden an- und abgemeldet mit ShowSdrPage()/HideSdrPage(). Fuer jede angemeldete
+// Seite wird eine SdrPageView-Instanz im Container aPages angelegt. Bei
+// gleichzeitiger Anzeige mehrerer Seiten ist darauf zu achten, dass der Offset-
+// Parameter von ShowSdrPage() der Seitengroesse angepasst ist, da sich sonst die
+// Seiten ueberlappen koennten.
+//
+// Elementare Methoden:
+// ~~~~~~~~~~~~~~~~~~~~
+// Einfache Events:
+// ~~~~~~~~~~~~~~~~
+// sal_Bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
+// sal_Bool MouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
+// sal_Bool MouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
+// sal_Bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
+// sal_Bool Command(const CommandEvent& rCEvt, Window* pWin);
+//
+// Exchange (Clipboard derzeit noch ohne SdrPrivateData):
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// sal_Bool Cut(sal_uIntPtr nFormat=SDR_ANYFORMAT);
+// sal_Bool Yank(sal_uIntPtr nFormat=SDR_ANYFORMAT);
+// sal_Bool Paste(Window* pWin=NULL, sal_uIntPtr nFormat=SDR_ANYFORMAT);
+//
+// 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);
+//
+// Sonstiges:
+// ~~~~~~~~~~
+// Pointer GetPreferedPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nTol=0) const;
+// String GetStatusText();
+//
+///////////////////////////////////////////////////////////////////////////////////////////////// */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svdviter.hxx b/include/svx/svdviter.hxx
new file mode 100644
index 000000000000..1ad9f9c773e6
--- /dev/null
+++ b/include/svx/svdviter.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 _SVDVITER_HXX
+#define _SVDVITER_HXX
+
+#include <tools/solar.h>
+#include <sal/types.h>
+#include "svx/svxdllapi.h"
+
+/*
+
+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)
+- 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;
+class Window;
+class SdrView;
+class SdrPageView;
+class SdrModel;
+class SdrPage;
+class SdrObject;
+class SetOfByte;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrViewIter
+{
+ const SdrModel* mpModel;
+ const SdrPage* mpPage;
+ const SdrObject* mpObject;
+ SdrView* mpAktView;
+
+ sal_uInt32 mnListenerNum;
+ sal_uInt32 mnPageViewNum;
+ sal_uInt32 mnOutDevNum;
+
+ // bitfield
+ unsigned mbNoMasterPage : 1;
+
+private:
+ SVX_DLLPRIVATE void ImpInitVars();
+ SVX_DLLPRIVATE SdrView* ImpFindView();
+ SVX_DLLPRIVATE sal_Bool ImpCheckPageView(SdrPageView* pPV) const;
+
+public:
+ SdrViewIter(const SdrPage* pPage, sal_Bool bNoMasterPage = sal_False);
+ SdrViewIter(const SdrObject* pObject, sal_Bool bNoMasterPage = sal_False);
+
+ SdrView* FirstView();
+ SdrView* NextView();
+};
+
+#endif //_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 000000000000..1d7a16102164
--- /dev/null
+++ b/include/svx/svdxcgv.hxx
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVDXCGV_HXX
+#define _SVDXCGV_HXX
+
+#include <svx/svdedxv.hxx>
+
+#include <vcl/gdimtf.hxx>
+#include "svx/svxdllapi.h"
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// @@@@@ @@ @@ @@@@ @@ @@ @@@@ @@ @@ @@@@ @@@@@ @@ @@ @@ @@@@@ @@ @@
+// @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
+// @@ @@@@@ @@ @@ @@ @@ @@ @@@@@@ @@ @@ @@ @@ @@ @@ @@ @ @@
+// @@@@ @@@ @@ @@@@@@ @@@@@@ @@@@@@ @@ @@@ @@@@ @@@@@ @@ @@@@ @@@@@@@
+// @@ @@@@@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@ @@@ @@ @@ @@@@@@@
+// @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
+// @@@@@ @@ @@ @@@@ @@ @@ @@ @@ @@ @@ @@@@@ @@@@@ @ @@ @@@@@ @@ @@
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_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, sal_uInt32 nOptions);
+ sal_Bool ImpGetPasteLayer(const SdrObjList* pObjList, SdrLayerID& rLayer) const;
+
+ // liefert True, wenn rPt geaendert wurde
+ sal_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* pModel1, OutputDevice* pOut = 0L);
+
+public:
+ // Alle markierten Objekte auf dem angegebenen OutputDevice ausgeben.
+ virtual void DrawMarkedObj(OutputDevice& rOut) const;
+
+ // Z.B. fuer's Clipboard, Drag&Drop, ...
+ // Alle markierten Objekte in ein Metafile stecken. Z.Zt. noch etwas
+ // buggee (Offset..., Fremdgrafikobjekte (SdrGrafObj), Virtuelle
+ // Objektkopien (SdrVirtObj) mit Ankerpos<>(0,0)).
+ GDIMetaFile GetMarkedObjMetaFile(bool bNoVDevIfOneMtfMarked = false) const;
+
+ // Alle markierten Objekte auf eine Bitmap malen. Diese hat die Farbtiefe
+ // und Aufloesung des Bildschirms.
+ BitmapEx GetMarkedObjBitmapEx(bool bNoVDevIfOneBmpMarked = false) const;
+
+ // Alle markierten Objekte in ein neues Model kopieren. Dieses neue Model
+ // hat dann genau eine Page. Das Flag PageNotValid an diesem Model ist
+ // gesetzt. Daran ist zu erkennen, dass nur die Objekte der Page Gueltikeit
+ // haben, die Page sebst jedoch nicht (Seitengroesse, Raender). Das neue
+ // Model wird auf dem Heap erzeugt und wird an den Aufrufer dieser Methode
+ // uebergeben. Dieser hat es dann spaeter zu entsorgen.
+ // Beim einfuegen der markierten Objekte in die eine Page des neuen Model
+ // findet ein Merging der seitenlokalen Layer statt. Sollte kein Platz mehr
+ // fuer weitere seitenlokale Layer sein, wird den entsprechenden Objekten
+ // der Default-Layer zugewiesen (Layer 0, (dokumentglobaler Standardlayer).
+ virtual SdrModel* GetMarkedObjModel() const;
+
+ Graphic GetAllMarkedGraphic() const;
+
+ /** Generate a Graphic for the given draw object in the given model
+
+ @param pModel
+ Must not be NULL. Denotes the draw model the object is a part
+ of.
+
+ @param pObj
+ The object (can also be a group object) to retrieve a Graphic
+ for. Must not be NULL.
+
+ @return a graphical representation of the given object, as it
+ appears on screen (e.g. with rotation, if any, applied).
+ */
+ static Graphic GetObjGraphic( const SdrModel* pModel, const SdrObject* pObj );
+
+ // Bei allen Paste-Methoden werden die neuen Draw-Objekte markiert.
+ // Wird der Parameter bAddMark auf sal_True gesetzt, so werden die neuen
+ // DrawObjekte zu einer bereits bestehenden Selektion "hinzumarkiert".
+ // Dieser Fall ist fuer Drag&Drop mit mehreren Items gedacht.
+ // Die Methoden mit Point-Parameter fuegen neue Objekte zentriert an
+ // dieser Position ein, die anderen zentriert am 1.OutputDevice der View.
+ // Ist der Parameter pPg gesetzt, werden die Objekte and dieser Seite
+ // eingefuegt. Die Positionierung (rPos bzw. Zentrierung) bezieht sich
+ // dann nichtmehr auf die View sondern auf die Page.
+ // Hinweis: SdrObjList ist Basisklasse von SdrPage.
+ // Die Methoden liefern sal_True, wenn die Objekte erfolgreich erzeugt und
+ // eingefuegt wurden. Bei pLst=sal_False und kein TextEdit aktiv kann man
+ // sich dann auch darauf verlassen, dass diese an der View markiert sind.
+ // Andernfalls erfolgt die Markierung nur, wenn pLst z.Zt. auch an der
+ // View angezeigt wird.
+ // Gueltige Werte fuer nOptions sind SDRINSERT_DONTMARK und
+ // SDRINSERT_ADDMARK (siehe svdedtv.hxx).
+ virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+ sal_Bool Paste(const String& rStr, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+ sal_Bool Paste(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+
+ sal_Bool Cut( sal_uIntPtr nFormat = SDR_ANYFORMAT );
+
+ sal_Bool Yank( sal_uIntPtr nFormat = SDR_ANYFORMAT );
+
+ sal_Bool Paste( Window* pWin = NULL, sal_uIntPtr nFormat = SDR_ANYFORMAT );
+ sal_Bool PasteClipboard( OutputDevice* pOut = NULL, sal_uIntPtr nFormat = SDR_ANYFORMAT, sal_uInt32 nOptions = 0 );
+};
+
+#endif //_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 000000000000..bb8c4c26a19d
--- /dev/null
+++ b/include/svx/svx3ditems.hxx
@@ -0,0 +1,371 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX3DITEMS_HXX
+#define _SVX3DITEMS_HXX
+
+#include <svl/intitem.hxx>
+#include <svl/eitem.hxx>
+
+
+#include <editeng/colritem.hxx>
+#include <svx/e3ditem.hxx>
+#include <svx/viewpt3d.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+// Svx3D _3DOBJ_ Items
+class SVX_DLLPUBLIC Svx3DPercentDiagonalItem : public SfxUInt16Item {
+public:
+ Svx3DPercentDiagonalItem(sal_uInt16 nVal = 10);
+};
+
+class Svx3DBackscaleItem : public SfxUInt16Item {
+public:
+ SVX_DLLPUBLIC Svx3DBackscaleItem(sal_uInt16 nVal = 100);
+};
+
+class Svx3DDepthItem : public SfxUInt32Item {
+public:
+ SVX_DLLPUBLIC Svx3DDepthItem(sal_uInt32 nVal = 1000);
+};
+
+class SVX_DLLPUBLIC Svx3DHorizontalSegmentsItem : public SfxUInt32Item {
+public:
+ Svx3DHorizontalSegmentsItem(sal_uInt32 nVal = 24);
+};
+
+class Svx3DVerticalSegmentsItem : public SfxUInt32Item {
+public:
+ SVX_DLLPUBLIC Svx3DVerticalSegmentsItem(sal_uInt32 nVal = 24);
+};
+
+class Svx3DEndAngleItem : public SfxUInt32Item {
+public:
+ SVX_DLLPUBLIC Svx3DEndAngleItem(sal_uInt32 nVal = 3600);
+};
+
+class SVX_DLLPUBLIC Svx3DDoubleSidedItem : public SfxBoolItem {
+public:
+ Svx3DDoubleSidedItem(sal_Bool bVal = 0);
+};
+
+// #i28528#
+// Added extra Item (Bool) for chart2 to be able to show reduced line geometry
+class Svx3DReducedLineGeometryItem : public SfxBoolItem {
+public:
+ Svx3DReducedLineGeometryItem(sal_Bool bVal = 0);
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
+ virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+};
+
+class SVX_DLLPUBLIC Svx3DNormalsKindItem : public SfxUInt16Item {
+public:
+ Svx3DNormalsKindItem(sal_uInt16 nVal = 0);
+
+ // use drawing::NormalsKind
+ SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+};
+
+class Svx3DNormalsInvertItem : public SfxBoolItem {
+public:
+ SVX_DLLPUBLIC Svx3DNormalsInvertItem(sal_Bool bVal = 0);
+};
+
+class SVX_DLLPUBLIC Svx3DTextureProjectionXItem : public SfxUInt16Item {
+public:
+ Svx3DTextureProjectionXItem(sal_uInt16 nVal = 0);
+
+ // use drawing::TextureProjectionMode
+ SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+};
+
+class SVX_DLLPUBLIC Svx3DTextureProjectionYItem : public SfxUInt16Item {
+public:
+ Svx3DTextureProjectionYItem(sal_uInt16 nVal = 0);
+
+ // use drawing::TextureProjectionMode
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+};
+
+class Svx3DShadow3DItem : public SfxBoolItem {
+public:
+ SVX_DLLPUBLIC Svx3DShadow3DItem(sal_Bool bVal = 0);
+};
+
+class Svx3DMaterialColorItem : public SvxColorItem {
+public:
+ Svx3DMaterialColorItem(const Color& rCol = Color(0x0000b8ff));
+};
+
+class Svx3DMaterialEmissionItem : public SvxColorItem {
+public:
+ SVX_DLLPUBLIC Svx3DMaterialEmissionItem(const Color& rCol = Color(0x00000000));
+};
+
+class Svx3DMaterialSpecularItem : public SvxColorItem {
+public:
+ SVX_DLLPUBLIC Svx3DMaterialSpecularItem(const Color& rCol = Color(0x00ffffff));
+};
+
+class Svx3DMaterialSpecularIntensityItem : public SfxUInt16Item {
+public:
+ SVX_DLLPUBLIC Svx3DMaterialSpecularIntensityItem(sal_uInt16 nVal = 15);
+};
+
+class SVX_DLLPUBLIC Svx3DTextureKindItem : public SfxUInt16Item {
+public:
+ Svx3DTextureKindItem(sal_uInt16 nVal = 3);
+
+ // use drawing::TextureKind
+ SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+};
+
+class SVX_DLLPUBLIC Svx3DTextureModeItem : public SfxUInt16Item {
+public:
+ Svx3DTextureModeItem(sal_uInt16 nVal = 2);
+
+ // use drawing:TextureMode
+ SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+};
+
+class Svx3DTextureFilterItem : public SfxBoolItem {
+public:
+ SVX_DLLPUBLIC Svx3DTextureFilterItem(sal_Bool bVal = 0);
+};
+
+// Svx3D _3DSCENE_ Items
+class SVX_DLLPUBLIC Svx3DPerspectiveItem : public SfxUInt16Item {
+public:
+ Svx3DPerspectiveItem(sal_uInt16 nVal = (sal_uInt16)PR_PERSPECTIVE);
+
+ // use drawing::ProjectionMode
+ SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+};
+
+class Svx3DDistanceItem : public SfxUInt32Item {
+public:
+ SVX_DLLPUBLIC Svx3DDistanceItem(sal_uInt32 nVal = 100);
+};
+
+class Svx3DFocalLengthItem : public SfxUInt32Item {
+public:
+ SVX_DLLPUBLIC Svx3DFocalLengthItem(sal_uInt32 nVal = 100);
+};
+
+class Svx3DTwoSidedLightingItem : public SfxBoolItem {
+public:
+ SVX_DLLPUBLIC Svx3DTwoSidedLightingItem(sal_Bool bVal = 0);
+};
+
+class SVX_DLLPUBLIC Svx3DLightcolor1Item : public SvxColorItem {
+public:
+ Svx3DLightcolor1Item(const Color& rCol = Color(0xffcccccc));
+};
+
+class SVX_DLLPUBLIC Svx3DLightcolor2Item : public SvxColorItem {
+public:
+ Svx3DLightcolor2Item(const Color& rCol = Color(0x00000000));
+};
+
+class SVX_DLLPUBLIC Svx3DLightcolor3Item : public SvxColorItem {
+public:
+ Svx3DLightcolor3Item(const Color& rCol = Color(0x00000000));
+};
+
+class SVX_DLLPUBLIC Svx3DLightcolor4Item : public SvxColorItem {
+public:
+ Svx3DLightcolor4Item(const Color& rCol = Color(0x00000000));
+};
+
+class SVX_DLLPUBLIC Svx3DLightcolor5Item : public SvxColorItem {
+public:
+ Svx3DLightcolor5Item(const Color& rCol = Color(0x00000000));
+};
+
+class SVX_DLLPUBLIC Svx3DLightcolor6Item : public SvxColorItem {
+public:
+ Svx3DLightcolor6Item(const Color& rCol = Color(0x00000000));
+};
+
+class SVX_DLLPUBLIC Svx3DLightcolor7Item : public SvxColorItem {
+public:
+ Svx3DLightcolor7Item(const Color& rCol = Color(0x00000000));
+};
+
+class SVX_DLLPUBLIC Svx3DLightcolor8Item : public SvxColorItem {
+public:
+ Svx3DLightcolor8Item(const Color& rCol = Color(0x00000000));
+};
+
+class SVX_DLLPUBLIC Svx3DAmbientcolorItem : public SvxColorItem {
+public:
+ Svx3DAmbientcolorItem(const Color& rCol = Color(0x00666666));
+};
+
+class SVX_DLLPUBLIC Svx3DLightOnOff1Item : public SfxBoolItem {
+public:
+ Svx3DLightOnOff1Item(sal_Bool bVal = 1);
+};
+
+class SVX_DLLPUBLIC Svx3DLightOnOff2Item : public SfxBoolItem {
+public:
+ Svx3DLightOnOff2Item(sal_Bool bVal = 0);
+};
+
+class SVX_DLLPUBLIC Svx3DLightOnOff3Item : public SfxBoolItem {
+public:
+ Svx3DLightOnOff3Item(sal_Bool bVal = 0);
+};
+
+class SVX_DLLPUBLIC Svx3DLightOnOff4Item : public SfxBoolItem {
+public:
+ Svx3DLightOnOff4Item(sal_Bool bVal = 0);
+};
+
+class SVX_DLLPUBLIC Svx3DLightOnOff5Item : public SfxBoolItem {
+public:
+ Svx3DLightOnOff5Item(sal_Bool bVal = 0);
+};
+
+class SVX_DLLPUBLIC Svx3DLightOnOff6Item : public SfxBoolItem {
+public:
+ Svx3DLightOnOff6Item(sal_Bool bVal = 0);
+};
+
+class SVX_DLLPUBLIC Svx3DLightOnOff7Item : public SfxBoolItem {
+public:
+ Svx3DLightOnOff7Item(sal_Bool bVal = 0);
+};
+
+class SVX_DLLPUBLIC Svx3DLightOnOff8Item : public SfxBoolItem {
+public:
+ Svx3DLightOnOff8Item(sal_Bool bVal = 0);
+};
+
+class SVX_DLLPUBLIC Svx3DLightDirection1Item : public SvxB3DVectorItem {
+public:
+ Svx3DLightDirection1Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.57735026918963, 0.57735026918963, 0.57735026918963));
+};
+
+class SVX_DLLPUBLIC Svx3DLightDirection2Item : public SvxB3DVectorItem {
+public:
+ Svx3DLightDirection2Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
+};
+
+class SVX_DLLPUBLIC Svx3DLightDirection3Item : public SvxB3DVectorItem {
+public:
+ Svx3DLightDirection3Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
+};
+
+class SVX_DLLPUBLIC Svx3DLightDirection4Item : public SvxB3DVectorItem {
+public:
+ Svx3DLightDirection4Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
+};
+
+class SVX_DLLPUBLIC Svx3DLightDirection5Item : public SvxB3DVectorItem {
+public:
+ Svx3DLightDirection5Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
+};
+
+class SVX_DLLPUBLIC Svx3DLightDirection6Item : public SvxB3DVectorItem {
+public:
+ Svx3DLightDirection6Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
+};
+
+class SVX_DLLPUBLIC Svx3DLightDirection7Item : public SvxB3DVectorItem {
+public:
+ Svx3DLightDirection7Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
+};
+
+class SVX_DLLPUBLIC Svx3DLightDirection8Item : public SvxB3DVectorItem {
+public:
+ Svx3DLightDirection8Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
+};
+
+class Svx3DShadowSlantItem : public SfxUInt16Item {
+public:
+ SVX_DLLPUBLIC Svx3DShadowSlantItem(sal_uInt16 nVal = 0);
+};
+
+class SVX_DLLPUBLIC Svx3DShadeModeItem : public SfxUInt16Item {
+public:
+ Svx3DShadeModeItem(sal_uInt16 nVal = 2);
+
+ // use drawing::ShadeMode
+ SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+};
+
+//////////////////////////////////////////////////////////////////////////////
+// #107245# Item to replace bExtrudeSmoothed and bLatheSmoothed
+class Svx3DSmoothNormalsItem : public SfxBoolItem {
+public:
+ Svx3DSmoothNormalsItem(sal_Bool bVal = 1);
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
+ virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+};
+
+// #107245# Item to replace bExtrudeSmoothFrontBack and bLatheSmoothFrontBack
+class Svx3DSmoothLidsItem : public SfxBoolItem {
+public:
+ Svx3DSmoothLidsItem(sal_Bool bVal = 0);
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
+ virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+};
+
+// #107245# Item to replace bExtrudeCharacterMode and bLatheCharacterMode
+class Svx3DCharacterModeItem : public SfxBoolItem {
+public:
+ Svx3DCharacterModeItem(sal_Bool bVal = 0);
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
+ virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+};
+
+// #107245# Item to replace bExtrudeCloseFront and bLatheCloseFront
+class SVX_DLLPUBLIC Svx3DCloseFrontItem : public SfxBoolItem {
+public:
+ Svx3DCloseFrontItem(sal_Bool bVal = 1);
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
+ SVX_DLLPRIVATE virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+};
+
+// #107245# Item to replace bExtrudeCloseBack and bLatheCloseBack
+class SVX_DLLPUBLIC Svx3DCloseBackItem : public SfxBoolItem {
+public:
+ Svx3DCloseBackItem(sal_Bool bVal = 1);
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
+ SVX_DLLPRIVATE virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+};
+
+#endif // _SVX3DITEMS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svxcommands.h b/include/svx/svxcommands.h
new file mode 100644
index 000000000000..266d3d691df7
--- /dev/null
+++ b/include/svx/svxcommands.h
@@ -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 SVX_SVXCOMMANDS_HRC
+#define SVX_SVXCOMMANDS_HRC
+
+#define CMD_SID_INET_DLG ".uno:InternetDialog"
+#define CMD_SID_OBJECT_ALIGN_CENTER ".uno:AlignCenter"
+#define CMD_SID_OBJECT_ALIGN_DOWN ".uno:AlignDown"
+#define CMD_SID_OBJECT_ALIGN_LEFT ".uno:ObjectAlignLeft"
+#define CMD_SID_OBJECT_ALIGN_MIDDLE ".uno:AlignMiddle"
+#define CMD_SID_OBJECT_ALIGN_RIGHT ".uno:ObjectAlignRight"
+#define CMD_SID_OBJECT_ALIGN_UP ".uno:AlignUp"
+#define CMD_SID_FM_AUTOCONTROLFOCUS ".uno:AutoControlFocus"
+#define CMD_SID_AUTOFORMAT ".uno:AutoFormat"
+#define CMD_SID_BEZIER_CLOSE ".uno:BezierClose"
+#define CMD_SID_BEZIER_CONVERT ".uno:BezierConvert"
+#define CMD_SID_BEZIER_CUTLINE ".uno:BezierCutLine"
+#define CMD_SID_BEZIER_DELETE ".uno:BezierDelete"
+#define CMD_SID_BEZIER_EDGE ".uno:BezierEdge"
+#define CMD_SID_BEZIER_ELIMINATE_POINTS ".uno:BezierEliminatePoints"
+#define CMD_SID_BEZIER_INSERT ".uno:BezierInsert"
+#define CMD_SID_BEZIER_MOVE ".uno:BezierMove"
+#define CMD_SID_BEZIER_SMOOTH ".uno:BezierSmooth"
+#define CMD_SID_BEZIER_SYMMTR ".uno:BezierSymmetric"
+#define CMD_SID_BMPMASK ".uno:BmpMask"
+#define CMD_SID_ATTR_CHAR_WEIGHT ".uno:Bold"
+#define CMD_SID_FRAME_TO_TOP ".uno:BringToFront"
+#define CMD_SID_ATTR_PARA_ADJUST_CENTER ".uno:CenterPara"
+#define CMD_SID_FM_CHANGECONTROLTYPE ".uno:ChangeControlType"
+#define CMD_SID_ATTR_CHAR_FONT ".uno:CharFontName"
+#define CMD_SID_FM_CHECKBOX ".uno:CheckBox"
+#define CMD_SID_FM_COMBOBOX ".uno:ComboBox"
+#define CMD_SID_CONTOUR_DLG ".uno:ContourDialog"
+#define CMD_SID_FM_CONVERTTO_BUTTON ".uno:ConvertToButton"
+#define CMD_SID_FM_CONVERTTO_CHECKBOX ".uno:ConvertToCheckBox"
+#define CMD_SID_FM_CONVERTTO_COMBOBOX ".uno:ConvertToCombo"
+#define CMD_SID_FM_CONVERTTO_CURRENCY ".uno:ConvertToCurrency"
+#define CMD_SID_FM_CONVERTTO_DATE ".uno:ConvertToDate"
+#define CMD_SID_FM_CONVERTTO_EDIT ".uno:ConvertToEdit"
+#define CMD_SID_FM_CONVERTTO_FILECONTROL ".uno:ConvertToFileControl"
+#define CMD_SID_FM_CONVERTTO_FIXEDTEXT ".uno:ConvertToFixed"
+#define CMD_SID_FM_CONVERTTO_FORMATTED ".uno:ConvertToFormatted"
+#define CMD_SID_FM_CONVERTTO_SCROLLBAR ".uno:ConvertToScrollBar"
+#define CMD_SID_FM_CONVERTTO_SPINBUTTON ".uno:ConvertToSpinButton"
+#define CMD_SID_FM_CONVERTTO_GROUPBOX ".uno:ConvertToGroup"
+#define CMD_SID_FM_CONVERTTO_IMAGEBUTTON ".uno:ConvertToImageBtn"
+#define CMD_SID_FM_CONVERTTO_IMAGECONTROL ".uno:ConvertToImageControl"
+#define CMD_SID_FM_CONVERTTO_LISTBOX ".uno:ConvertToList"
+#define CMD_SID_FM_CONVERTTO_NUMERIC ".uno:ConvertToNumeric"
+#define CMD_SID_FM_CONVERTTO_PATTERN ".uno:ConvertToPattern"
+#define CMD_SID_FM_CONVERTTO_RADIOBUTTON ".uno:ConvertToRadio"
+#define CMD_SID_FM_CONVERTTO_TIME ".uno:ConvertToTime"
+#define CMD_SID_FM_CONVERTTO_NAVIGATIONBAR ".uno:ConvertToNavigationBar"
+#define CMD_SID_FM_CURRENCYFIELD ".uno:CurrencyField"
+#define CMD_SID_FM_DATEFIELD ".uno:DateField"
+#define CMD_SID_DISTRIBUTE_DLG ".uno:DistributeSelection"
+#define CMD_SID_FM_EDIT ".uno:Edit"
+#define CMD_SID_ENTER_GROUP ".uno:EnterGroup"
+#define CMD_SID_CHAR_DLG ".uno:FontDialog"
+#define CMD_SID_ATTR_CHAR_FONTHEIGHT ".uno:FontHeight"
+#define CMD_SID_FONTWORK ".uno:FontWork"
+#define CMD_SID_ATTRIBUTES_AREA ".uno:FormatArea"
+#define CMD_SID_GROUP ".uno:FormatGroup"
+#define CMD_SID_ATTRIBUTES_LINE ".uno:FormatLine"
+#define CMD_SID_FM_FORMATTEDFIELD ".uno:FormattedField"
+#define CMD_SID_UNGROUP ".uno:FormatUngroup"
+#define CMD_SID_ATTR_GRAF_CROP ".uno:GrafAttrCrop"
+#define CMD_SID_GRFFILTER_MOSAIC ".uno:GraphicFilterMosaic"
+#define CMD_SID_GRFFILTER_POSTER ".uno:GraphicFilterPoster"
+#define CMD_SID_GRFFILTER_EMBOSS ".uno:GraphicFilterRelief"
+#define CMD_SID_GRFFILTER_SEPIA ".uno:GraphicFilterSepia"
+#define CMD_SID_GRFFILTER_SMOOTH ".uno:GraphicFilterSmooth"
+#define CMD_SID_GRFFILTER_SOLARIZE ".uno:GraphicFilterSolarize"
+#define CMD_SID_GRID_USE ".uno:GridUse"
+#define CMD_SID_GRID_VISIBLE ".uno:GridVisible"
+#define CMD_SID_OUTLINE_MAKE ".uno:Group"
+#define CMD_SID_INSERT_POSTIT ".uno:InsertAnnotation"
+#define CMD_SID_REPLYTO_POSTIT ".uno:ReplyToAnnotation"
+#define CMD_SID_DELETE_POSTIT ".uno:DeleteAnnotation"
+#define CMD_SID_DELETEALL_POSTIT ".uno:DeleteAllAnnotation"
+#define CMD_SID_DELETEALLBYAUTHOR_POSTIT ".uno:DeleteAllAnnotationByAuthor"
+#define CMD_SID_CHARMAP ".uno:InsertSymbol"
+#define CMD_SID_ATTR_CHAR_POSTURE ".uno:Italic"
+#define CMD_SID_ATTR_PARA_ADJUST_BLOCK ".uno:JustifyPara"
+#define CMD_SID_LEAVE_GROUP ".uno:LeaveGroup"
+#define CMD_SID_ATTR_PARA_ADJUST_LEFT ".uno:LeftPara"
+#define CMD_SID_FM_LISTBOX ".uno:ListBox"
+#define CMD_SID_FM_NUMERICFIELD ".uno:NumericField"
+#define CMD_SID_OBJECT_ALIGN ".uno:ObjectAlign"
+#define CMD_SID_FRAME_DOWN ".uno:ObjectBackOne"
+#define CMD_SID_FRAME_UP ".uno:ObjectForwardOne"
+#define CMD_SID_FM_OPEN_READONLY ".uno:OpenReadOnly"
+#define CMD_SID_ATTR_CHAR_CONTOUR ".uno:OutlineFont"
+#define CMD_SID_PARA_DLG ".uno:ParagraphDialog"
+#define CMD_SID_FM_PATTERNFIELD ".uno:PatternField"
+#define CMD_SID_FM_RECORD_SAVE ".uno:RecSave"
+#define CMD_SID_FM_RECORD_UNDO ".uno:RecUndo"
+#define CMD_SID_ATTR_PARA_ADJUST_RIGHT ".uno:RightPara"
+#define CMD_SID_FRAME_TO_BOTTOM ".uno:SendToBack"
+#define CMD_SID_SET_DEFAULT ".uno:SetDefault"
+#define CMD_SID_ATTR_CHAR_SHADOWED ".uno:Shadowed"
+#define CMD_SID_SHOW_PROPERTYBROWSER ".uno:ShowPropBrowser"
+#define CMD_SID_FM_SHOW_PROPERTY_BROWSER ".uno:ShowPropertyBrowser"
+#define CMD_SID_ATTR_PARA_LINESPACE_10 ".uno:SpacePara1"
+#define CMD_SID_ATTR_PARA_LINESPACE_15 ".uno:SpacePara15"
+#define CMD_SID_ATTR_PARA_LINESPACE_20 ".uno:SpacePara2"
+#define CMD_SID_ATTR_CHAR_STRIKEOUT ".uno:Strikeout"
+#define CMD_SID_SET_SUB_SCRIPT ".uno:SubScript"
+#define CMD_SID_SET_SUPER_SCRIPT ".uno:SuperScript"
+#define CMD_SID_FM_TAB_DIALOG ".uno:TabDialog"
+#define CMD_SID_THESAURUS ".uno:ThesaurusDialog"
+#define CMD_SID_FM_TIMEFIELD ".uno:TimeField"
+#define CMD_SID_BEZIER_EDIT ".uno:ToggleObjectBezierMode"
+#define CMD_SID_OBJECT_ROTATE ".uno:ToggleObjectRotateMode"
+#define CMD_SID_ATTR_TRANSFORM ".uno:TransformDialog"
+#define CMD_SID_ATTR_CHAR_UNDERLINE ".uno:Underline"
+#define CMD_SID_ATTR_CHAR_OVERLINE ".uno:Overline"
+#define CMD_SID_OUTLINE_REMOVE ".uno:Ungroup"
+#define CMD_SID_3D_WIN ".uno:Window3D"
+#define CMD_SID_ATTR_ZOOM ".uno:Zoom"
+#define CMD_SID_OPEN_HYPERLINK ".uno:OpenHyperlinkOnCursor"
+#define CMD_SID_TABLE_MERGE_CELLS ".uno:MergeCells"
+#define CMD_SID_TABLE_SPLIT_CELLS ".uno:SplitCell"
+#define CMD_SID_TABLE_VERT_BOTTOM ".uno:CellVertBottom"
+#define CMD_SID_TABLE_VERT_CENTER ".uno:CellVertCenter"
+#define CMD_SID_TABLE_VERT_NONE ".uno:CellVertTop"
+#define CMD_SID_TABLE_DELETE_ROW ".uno:DeleteRows"
+#define CMD_SID_TABLE_DELETE_COL ".uno:DeleteColumns"
+#define CMD_SID_TABLE_SELECT_COL ".uno:EntireColumn"
+#define CMD_SID_TABLE_SELECT_ROW ".uno:EntireRow"
+#define CMD_SID_FORMAT_TABLE_DLG ".uno:TableDialog"
+#define CMD_SID_OPEN_SMARTTAGMENU ".uno:OpenSmartTagMenuOnCursor"
+#define CMD_SID_TABLE_INSERT_COL_DLG ".uno:InsertColumnDialog"
+#define CMD_SID_TABLE_INSERT_ROW_DLG ".uno:InsertRowDialog"
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
new file mode 100644
index 000000000000..fd8ced079923
--- /dev/null
+++ b/include/svx/svxdlg.hxx
@@ -0,0 +1,499 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_DIALOG_HXX
+#define _SVX_DIALOG_HXX
+
+#include <sfx2/sfxdlg.hxx>
+#include <editeng/edtdlg.hxx>
+
+class SdrModel;
+class SdrView;
+
+#include <svx/dstribut_enum.hxx>
+#include <svx/rectenum.hxx> //add for enum RECT_POINT
+#include <com/sun/star/container/XIndexContainer.hpp> //add for FmShowColsDialog
+#include <com/sun/star/container/XNameReplace.hpp> //add for SvxMacroAssignDlg
+#include "svx/svxdllapi.h"
+#include <vector>
+
+namespace com{namespace sun{namespace star{
+namespace linguistic2{
+ class XDictionary;
+ class XSpellChecker1;
+ class XSpellChecker;
+ class XThesaurus;
+ class XHyphenator;
+}}}}
+class SvxSpellWrapper; //add for SvxSpellCheckDialog
+typedef SfxTabPage* (*CreateSvxDistributePage)(Window *pParent, const SfxItemSet &rAttrSet, SvxDistributeHorizontal eHor, SvxDistributeVertical eVer);
+typedef sal_uInt16* (*DialogGetRanges)();
+
+struct ExchangeData;
+class INetURLObject;
+class GalleryTheme;
+class SvxHyperlinkTabPageBase;
+class SearchAttrItemList;
+class FmFormShell;
+class Graphic;
+class SdrObject;
+class SvxSpellWrapper;
+
+typedef ::std::vector< String* > TargetList;
+
+namespace svx{ class SpellDialogChildWindow;}
+
+class AbstractSvxDistributeDialog :public VclAbstractDialog //add for SvxDistributeDialog
+{
+public:
+ virtual SvxDistributeHorizontal GetDistributeHor() const = 0;
+ virtual SvxDistributeVertical GetDistributeVer() const = 0;
+};
+
+class AbstractFmShowColsDialog : public VclAbstractDialog //add for FmShowColsDialog
+{
+ public:
+ virtual void SetColumns(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>& xCols)= 0;
+};
+
+class AbstractSvxZoomDialog : public VclAbstractDialog //add for SvxZoomDialog
+{
+ public:
+ virtual void SetLimits( sal_uInt16 nMin, sal_uInt16 nMax ) = 0;
+ virtual void HideButton( sal_uInt16 nBtnId )= 0;
+ virtual const SfxItemSet* GetOutputItemSet() const = 0 ;
+};
+
+class AbstractSpellDialog : public VclAbstractDialog //
+{
+ public:
+ virtual void SetLanguage( sal_uInt16 nLang ) = 0;
+ virtual sal_Bool Close() = 0;
+ virtual void Invalidate() = 0;
+ virtual Window* GetWindow() = 0;
+ virtual SfxBindings& GetBindings() = 0;
+};
+
+typedef long (*PLinkStub)( void*, void* );
+
+class AbstractSearchProgress :public VclAbstractRefreshableDialog //add for SearchProgress
+{
+public:
+ virtual void SetFileType( const String& rType ) = 0;
+ virtual void SetDirectory( const INetURLObject& rURL ) = 0;
+ virtual PLinkStub GetLinkStubCleanUpHdl() = 0;
+};
+
+class AbstractTakeProgress :public VclAbstractRefreshableDialog //add for TakeProgress
+{
+public:
+ virtual void SetFile( const INetURLObject& rURL ) = 0;
+ virtual PLinkStub GetLinkStubCleanUpHdl() = 0;
+};
+
+class AbstractTitleDialog :public VclAbstractDialog //add for TitleDialog
+{
+public:
+ virtual String GetTitle() const =0;
+};
+
+class AbstractGalleryIdDialog :public VclAbstractDialog //add for GalleryIdDialog
+{
+public:
+ virtual sal_uIntPtr GetId() const =0;
+};
+
+class AbstractURLDlg :public VclAbstractDialog //add for URLDlg
+{
+public:
+ virtual String GetURL() const = 0;
+ virtual String GetAltText() const = 0;
+ virtual String GetDesc() const = 0;
+ virtual String GetTarget() const = 0;
+ virtual String GetName() const = 0;
+};
+
+class AbstractSvxHlinkDlgMarkWnd :public VclAbstractDialog //add for SvxHlinkDlgMarkWnd
+{
+public:
+ virtual sal_Bool MoveTo ( Point aNewPos )const = 0;
+ virtual sal_Bool ConnectToDialog( sal_Bool bDoit = sal_True )const = 0;
+ virtual void RefreshTree ( String aStrURL ) = 0;
+ virtual void SelectEntry ( String aStrMark ) = 0;
+ virtual sal_uInt16 SetError( sal_uInt16 nError) = 0;
+ // in class Window
+ virtual void SetSizePixel( const Size& rNewSize ) = 0;
+ virtual Size GetSizePixel() const = 0;
+ virtual void Hide( sal_uInt16 nFlags = 0 ) = 0;
+ virtual sal_Bool IsVisible() const = 0;
+ virtual void Invalidate( sal_uInt16 nFlags = 0 ) = 0;
+};
+
+class AbstractSvxSearchFormatDialog : public SfxAbstractTabDialog //for SvxSearchFormatDialog
+{
+public:
+ //From class Window.
+ virtual void SetText( const OUString& rStr ) =0 ;
+ virtual OUString GetText() const =0 ;
+};
+
+class AbstractSvxSearchSimilarityDialog :public VclAbstractDialog //add for SvxSearchSimilarityDialog
+{
+public:
+ virtual sal_uInt16 GetOther() =0 ;
+ virtual sal_uInt16 GetShorter() =0 ;
+ virtual sal_uInt16 GetLonger() =0 ;
+ virtual sal_Bool IsRelaxed() =0 ;
+};
+
+class AbstractSvxJSearchOptionsDialog :public VclAbstractDialog //add for SvxJSearchOptionsDialog
+{
+public:
+ virtual sal_Int32 GetTransliterationFlags() const = 0;
+};
+
+class AbstractFmInputRecordNoDialog :public VclAbstractDialog //add for FmInputRecordNoDialog
+{
+public:
+ virtual void SetValue(long dNew) = 0;
+ virtual long GetValue() const = 0;
+};
+
+class AbstractSvxNewDictionaryDialog :public VclAbstractDialog //add for SvxNewDictionaryDialog
+{
+public:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > GetNewDictionary() = 0;
+};
+
+class AbstractSvxNameDialog :public VclAbstractDialog //add for SvxNameDialog
+{
+public:
+ virtual void GetName( String& rName ) = 0;
+ virtual void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false ) = 0;
+ virtual void SetEditHelpId(const OString&) = 0;
+ //from class Window
+ virtual void SetHelpId( const OString& ) = 0;
+ virtual void SetText( const OUString& rStr ) = 0;
+};
+
+///////////////////////////////////////////////////////////////////////////////////////////////
+// #i68101#
+
+class AbstractSvxObjectNameDialog :public VclAbstractDialog
+{
+public:
+ virtual void GetName(String& rName) = 0;
+ virtual void SetCheckNameHdl(const Link& rLink, bool bCheckImmediately = false) = 0;
+};
+
+class AbstractSvxObjectTitleDescDialog :public VclAbstractDialog
+{
+public:
+ virtual void GetTitle(String& rTitle) = 0;
+ virtual void GetDescription(String& rDescription) = 0;
+};
+
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+class AbstractSvxMessDialog :public VclAbstractDialog //add for SvxMessDialog
+{
+public:
+ virtual void SetButtonText( sal_uInt16 nBtnId, const String& rNewTxt ) = 0;
+};
+
+class AbstractSvxMultiPathDialog :public VclAbstractDialog //add for SvxMultiPathDialog
+{
+public:
+ virtual String GetPath() const = 0;
+ virtual void SetPath( const String& rPath ) = 0;
+ virtual void EnableRadioButtonMode() = 0;
+ virtual void SetTitle( const String& rNewTitle ) = 0;
+};
+
+class AbstractSvxMultiFileDialog :public AbstractSvxMultiPathDialog //add for SvxMultiFileDialog
+{
+public:
+ virtual String GetFiles() const = 0;
+ virtual void SetFiles( const String& rPath ) = 0;
+ //from SvxMultiPathDialog
+ virtual void SetClassPathMode() = 0;
+ //From Class Window
+ virtual void SetHelpId( const OString& ) = 0;
+};
+
+class AbstractSvxHpLinkDlg : public VclAbstractDialog //add for SvxHpLinkDlg
+{
+public:
+ virtual Window* GetWindow() = 0;
+ virtual sal_Bool QueryClose() = 0;
+};
+
+class AbstractFmSearchDialog :public VclAbstractDialog //add for FmSearchDialog
+{
+public:
+ virtual void SetFoundHandler(const Link& lnk) = 0;
+ virtual void SetCanceledNotFoundHdl(const Link& lnk)=0;
+ virtual void SetActiveField(const String& strField)=0;
+};
+class AbstractGraphicFilterDialog :public VclAbstractDialog //add for GraphicFilterDialog
+{
+public:
+ virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) = 0;
+};
+
+class AbstractSvxAreaTabDialog :public SfxAbstractTabDialog //add for SvxAreaTabDialog
+{
+};
+
+class AbstractSvxTransformTabDialog : public SfxAbstractTabDialog
+{
+public:
+ virtual void SetValidateFramePosLink( const Link& rLink ) = 0;
+};
+class AbstractSvxCaptionDialog : public SfxAbstractTabDialog
+{
+public:
+ virtual void SetValidateFramePosLink( const Link& rLink ) = 0;
+};
+
+//-------------------------------------------------------------
+
+class AbstractSvxPostItDialog :public VclAbstractDialog //add for SvxPostItDialog
+{
+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(sal_Bool bNext, sal_Bool bPrev) = 0;
+ virtual String GetNote() = 0;
+ virtual void SetNote(const String& rTxt) = 0;
+ virtual void ShowLastAuthor(const String& rAuthor, const String& rDate) = 0;
+ virtual void DontChangeAuthor() = 0;
+ virtual void HideAuthor() = 0;
+ virtual void SetReadonlyPostIt(sal_Bool bDisable) = 0;
+ virtual sal_Bool IsOkEnabled() const = 0;
+ virtual Window * GetWindow() = 0;
+};
+
+//-------------------------------------------------------------
+
+class SvxAbstractSplittTableDialog : public VclAbstractDialog
+{
+public:
+ virtual bool IsHorizontal() const = 0;
+ virtual bool IsProportional() const = 0;
+ virtual long GetCount() const = 0;
+};
+
+//-------------------------------------------------------------
+
+class SvxAbstractNewTableDialog : public VclAbstractDialog
+{
+public:
+ virtual sal_Int32 getRows() const = 0;
+ virtual sal_Int32 getColumns() const = 0;
+};
+
+class SvxAbstractInsRowColDlg : public VclAbstractDialog
+{
+public:
+ virtual bool isInsertBefore() const = 0;
+ virtual sal_uInt16 getInsertCount() const = 0;
+};
+
+//-------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxAbstractDialogFactory : public SfxAbstractDialogFactory, public EditAbstractDialogFactory
+{
+public:
+ static SvxAbstractDialogFactory* Create();
+
+ // define dtor as this will create typeinfo and in svx library and export vtable
+ virtual ~SvxAbstractDialogFactory();
+
+ virtual SfxAbstractTabDialog* CreateTextTabDialog( Window* pParent,
+ const SfxItemSet* pAttrSet,
+ SdrView* pView,
+ SdrModel* pModel=0 ) = 0 ; //add for SvxTextTabDialog
+
+ virtual AbstractSvxCaptionDialog* CreateCaptionDialog( Window* pParent,
+ const SdrView* pView,
+ sal_uInt16 nAnchorTypes = 0 ) = 0; //add for SvxCaptionTabDialog
+
+ virtual AbstractSvxDistributeDialog* CreateSvxDistributeDialog(Window* pParent,
+ const SfxItemSet& rAttr,
+ SvxDistributeHorizontal eHor = SvxDistributeHorizontalNone,
+ SvxDistributeVertical eVer = SvxDistributeVerticalNone)= 0;
+
+ virtual AbstractFmShowColsDialog * CreateFmShowColsDialog( Window* pParent ) = 0;
+
+ virtual AbstractSvxZoomDialog * CreateSvxZoomDialog( Window* pParent, //add for SvxZoomDialog
+ const SfxItemSet& rCoreSet )=0;
+
+ virtual AbstractSpellDialog * CreateSvxSpellDialog(Window* pParent,
+ SfxBindings* pBindings,
+ svx::SpellDialogChildWindow* pSpellChildWindow )=0;
+
+ virtual VclAbstractRefreshableDialog * CreateActualizeProgressDialog( Window* pParent, //add for ActualizeProgress
+ GalleryTheme* pThm ) = 0;
+ virtual AbstractSearchProgress * CreateSearchProgressDialog( Window* pParent, //add for SearchProgress
+ const INetURLObject& rStartURL ) = 0;
+ virtual AbstractTakeProgress * CreateTakeProgressDialog( Window* pParent ) = 0;
+ virtual AbstractTitleDialog * CreateTitleDialog( Window* pParent, //add for TitleDialog
+ const String& rOldText ) = 0;
+ virtual AbstractGalleryIdDialog * CreateGalleryIdDialog( Window* pParent, //add for SvxZoomDialog
+ GalleryTheme* pThm ) = 0;
+ virtual VclAbstractDialog2 * CreateGalleryThemePropertiesDialog( Window* pParent, //add for GalleryThemeProperties
+ ExchangeData* pData,
+ SfxItemSet* pItemSet ) = 0;
+ virtual AbstractURLDlg * CreateURLDialog( Window* pParent,
+ const String& rURL, const String& rAltText, const String& rDescription,
+ const String& rTarget, const String& rName,
+ TargetList& rTargetList ) = 0;
+ virtual AbstractSvxHlinkDlgMarkWnd* CreateSvxHlinkDlgMarkWndDialog( SvxHyperlinkTabPageBase* pParent, sal_uInt32 nResId ) =0; //add for SvxHlinkDlgMarkWnd
+
+ virtual SfxAbstractTabDialog* CreateTabItemDialog( Window* pParent, //add for SvxSearchFormatDialog
+ const SfxItemSet& rSet,
+ sal_uInt32 nResId) = 0;
+ virtual VclAbstractDialog* CreateSvxSearchAttributeDialog( Window* pParent, //add for SvxSearchAttributeDialog
+ SearchAttrItemList& rLst,
+ const sal_uInt16* pWhRanges)=0;
+ virtual AbstractSvxSearchSimilarityDialog * CreateSvxSearchSimilarityDialog( Window* pParent, //add for SvxSearchSimilarityDialog
+ sal_Bool bRelax,
+ sal_uInt16 nOther,
+ sal_uInt16 nShorter,
+ sal_uInt16 nLonger ) = 0;
+ virtual SfxAbstractTabDialog* CreateSvxBorderBackgroundDlg( Window* pParent, //add for SvxBorderBackgroundDlg
+ const SfxItemSet& rCoreSet,
+ sal_Bool bEnableSelector = sal_False) = 0;
+ virtual AbstractSvxTransformTabDialog* CreateSvxTransformTabDialog( Window* pParent, //add for SvxTransformTabDialog
+ const SfxItemSet* pAttr,
+ const SdrView* pView,
+ sal_uInt16 nAnchorTypes = 0) = 0;
+ virtual SfxAbstractTabDialog* CreateSchTransformTabDialog( Window* pParent, //add for SchTransformTabDialog
+ const SfxItemSet* pAttr,
+ const SdrView* pSdrView,
+ sal_uInt32 nResId,
+ bool bSizeTabPage = false
+ )=0;
+ virtual AbstractSvxJSearchOptionsDialog * CreateSvxJSearchOptionsDialog( Window* pParent,
+ const SfxItemSet& rOptionsSet,
+ sal_Int32 nInitialFlags )=0;
+ virtual AbstractFmInputRecordNoDialog * CreateFmInputRecordNoDialog( Window* pParent ) = 0;
+ virtual AbstractSvxNewDictionaryDialog* CreateSvxNewDictionaryDialog( Window* pParent,
+ ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > &xSpl,
+ sal_uInt32 nResId ) = 0; //add for SvxNewDictionaryDialog
+ virtual VclAbstractDialog * CreateSvxEditDictionaryDialog( Window* pParent,
+ const String& rName,
+ ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1> &xSpl,
+ sal_uInt32 nResId) = 0;//add for SvxEditDictionaryDialog
+ virtual AbstractSvxNameDialog * CreateSvxNameDialog( Window* pParent,
+ const String& rName, const String& rDesc ) = 0; //add for SvxNameDialog
+
+ // #i68101#
+ virtual AbstractSvxObjectNameDialog* CreateSvxObjectNameDialog(Window* pParent, const String& rName ) = 0;
+ virtual AbstractSvxObjectTitleDescDialog* CreateSvxObjectTitleDescDialog(Window* pParent, const String& rTitle, const String& rDescription) = 0;
+
+ virtual AbstractSvxMessDialog * CreateSvxMessDialog( Window* pParent, sal_uInt32 nResId,
+ const String& rText, const String& rDesc,
+ Image* pImg = NULL ) = 0; //add for SvxMessDialog
+
+ virtual AbstractSvxMultiPathDialog * CreateSvxMultiPathDialog( Window* pParent, sal_Bool bEmptyAllowed = sal_False ) = 0 ; //add for SvxMultiPathDialog
+ virtual AbstractSvxMultiFileDialog * CreateSvxMultiFileDialog( Window* pParent, sal_Bool bEmptyAllowed = sal_False ) = 0 ; //add for SvxMultiFileDialog
+ virtual AbstractSvxHpLinkDlg * CreateSvxHpLinkDlg (Window* pParent, //add for SvxMultiFileDialog
+ SfxBindings* pBindings,
+ sal_uInt32 nResId)=0;
+ virtual AbstractFmSearchDialog* CreateFmSearchDialog(Window* pParent, //add for FmSearchDialog
+ const OUString& strInitialText,
+ const ::std::vector< OUString >& _rContexts,
+ sal_Int16 nInitialContext,
+ const Link& lnkContextSupplier)=0;
+ virtual AbstractGraphicFilterDialog * CreateGraphicFilterEmboss (Window* pParent, //add for GraphicFilterEmboss
+ const Graphic& rGraphic,
+ RECT_POINT eLightSource, sal_uInt32 nResId )=0;
+ virtual AbstractGraphicFilterDialog * CreateGraphicFilterPosterSepia (Window* pParent, //add for GraphicFilterPoster & GraphicFilterSepia
+ const Graphic& rGraphic,
+ sal_uInt16 nCount,
+ sal_uInt32 nResId)=0;
+ virtual AbstractGraphicFilterDialog * CreateGraphicFilterSmooth (Window* pParent, //add for GraphicFilterSmooth
+ const Graphic& rGraphic,
+ double nRadius, sal_uInt32 nResId)=0;
+ virtual AbstractGraphicFilterDialog * CreateGraphicFilterSolarize (Window* pParent, //add for GraphicFilterSolarize
+ const Graphic& rGraphic,
+ sal_uInt8 nGreyThreshold, sal_Bool bInvert, sal_uInt32 nResId)=0;
+ virtual AbstractGraphicFilterDialog * CreateGraphicFilterMosaic (Window* pParent, //add for GraphicFilterMosaic
+ const Graphic& rGraphic,
+ sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, sal_Bool bEnhanceEdges, sal_uInt32 nResId)=0;
+ virtual AbstractSvxAreaTabDialog* CreateSvxAreaTabDialog( Window* pParent,//add for SvxAreaTabDialog
+ const SfxItemSet* pAttr,
+ SdrModel* pModel,
+ const SdrView* pSdrView = NULL ) = 0 ;
+ virtual SfxAbstractTabDialog* CreateSvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr, //add forSvxLineTabDialog
+ SdrModel* pModel,
+ const SdrObject* pObj = NULL,
+ sal_Bool bHasObj = sal_True )=0;
+ virtual VclAbstractDialog* CreateSfxDialog( Window* pParent, const SfxBindings& rBindings, sal_uInt32 nResId ) = 0;
+ virtual SfxAbstractDialog* CreateSfxDialog( Window* pParent, //add for SvxMeasureDialog & SvxConnectionDialog
+ const SfxItemSet& rAttr,
+ const SdrView* pView,
+ sal_uInt32 nResId
+ )=0;
+ virtual SfxAbstractDialog* CreateSfxDialog( Window* pParent, //add for SvxMeasureDialog & SvxConnectionDialog
+ const SfxItemSet& rAttr,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame,
+ sal_uInt32 nResId
+ )=0;
+ virtual AbstractSvxPostItDialog* CreateSvxPostItDialog( Window* pParent, //add for SvxPostItDialog
+ const SfxItemSet& rCoreSet,
+ sal_Bool bPrevNext = sal_False) = 0;
+ virtual VclAbstractDialog* CreateSvxScriptOrgDialog( Window* pParent, const String& rLanguage ) = 0;
+
+ virtual CreateSvxDistributePage GetSvxDistributePageCreatorFunc() = 0; // add for SvxDistributePage
+ virtual DialogGetRanges GetDialogGetRangesFunc() = 0; //add for SvxPostItDialog
+
+ virtual AbstractScriptSelectorDialog*
+ CreateScriptSelectorDialog(
+ Window* pParent,
+ sal_Bool bShowSlots,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame
+ ) = 0;
+
+ virtual VclAbstractDialog* CreateScriptErrorDialog(
+ Window* pParent, com::sun::star::uno::Any aException) = 0;
+
+ virtual VclAbstractDialog* CreateSvxMacroAssignDlg(
+ Window* _pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxDocumentFrame,
+ const bool _bUnoDialogMode,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace >& _rxEvents,
+ const sal_uInt16 _nInitiallySelectedEvent
+ ) = 0;
+
+ virtual SfxAbstractTabDialog* CreateSvxFormatCellsDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, const SdrObject* pObj = NULL )=0;
+
+ virtual SvxAbstractSplittTableDialog* CreateSvxSplittTableDialog( Window* pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )=0;
+
+ virtual SvxAbstractNewTableDialog* CreateSvxNewTableDialog( Window* pParent ) = 0;
+
+ virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( Window* pParent, bool bCol, const OString& sHelpId ) = 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 000000000000..0d6bf0a8fecb
--- /dev/null
+++ b/include/svx/svxdllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SVXDLLAPI_H
+#define INCLUDED_SVXDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(SVX_DLLIMPLEMENTATION)
+#define SVX_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define SVX_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define SVX_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_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 000000000000..939bfecb71d4
--- /dev/null
+++ b/include/svx/svxerr.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVXERR_HXX
+#define _SVXERR_HXX
+
+#include <tools/errcode.hxx>
+
+// define ----------------------------------------------------------------
+
+#define ERRCODE_SVX_LINGU_THESAURUSNOTEXISTS (1UL | ERRCODE_AREA_SVX | \
+ ERRCODE_CLASS_NOTEXISTS)
+
+#define ERRCODE_SVX_LINGU_LINGUNOTEXISTS (3UL | ERRCODE_AREA_SVX | \
+ ERRCODE_CLASS_NOTEXISTS )
+#define ERRCODE_SVX_LINGU_HYPHENNOTEXISTS (4UL | ERRCODE_AREA_SVX | \
+ ERRCODE_CLASS_NOTEXISTS )
+#define ERRCODE_SVX_LINGU_DICT_NOTREADABLE (5UL | ERRCODE_AREA_SVX | \
+ ERRCODE_CLASS_READ )
+#define ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE (6UL | ERRCODE_AREA_SVX | \
+ ERRCODE_CLASS_WRITE )
+
+#define ERRCODE_SVX_GRAPHIC_NOTREADABLE (7UL | ERRCODE_AREA_SVX | \
+ ERRCODE_CLASS_READ )
+
+#define ERRCODE_SVX_LINGU_NOLANGUAGE (9UL | ERRCODE_AREA_SVX | \
+ ERRCODE_CLASS_NOTEXISTS )
+#define ERRCODE_SVX_FORMS_NOIOSERVICES (10UL | ERRCODE_AREA_SVX )
+#define ERRCODE_SVX_FORMS_READWRITEFAILED (11UL | ERRCODE_AREA_SVX )
+
+#define ERRCODE_SVX_BULLETITEM_NOBULLET (12UL | ERRCODE_AREA_SVX )
+
+#define ERRCODE_SVX_MODIFIED_VBASIC_STORAGE (13UL | ERRCODE_AREA_SVX \
+ | ERRCODE_WARNING_MASK \
+ | ERRCODE_CLASS_WRITE )
+
+#define ERRCODE_SVX_VBASIC_STORAGE_EXIST (14UL | ERRCODE_AREA_SVX \
+ | ERRCODE_WARNING_MASK \
+ | ERRCODE_CLASS_WRITE )
+
+/** Error message: "Wrong password." */
+#define ERRCODE_SVX_WRONGPASS (15UL | ERRCODE_AREA_SVX | ERRCODE_CLASS_NONE)
+
+/** Error message: "Read error. Unsupported encryption method." */
+#define ERRCODE_SVX_READ_FILTER_CRYPT (16UL | ERRCODE_AREA_SVX | ERRCODE_CLASS_READ)
+
+/** Error message: "Read error. Passwort encrypted Powerpoint documents..." */
+#define ERRCODE_SVX_READ_FILTER_PPOINT (17UL | ERRCODE_AREA_SVX | ERRCODE_CLASS_READ)
+
+/** Error message: "Warning. Passwort protection is not suppported when ..." */
+#define ERRCODE_SVX_EXPORT_FILTER_CRYPT (18UL | ERRCODE_AREA_SVX | ERRCODE_CLASS_EXPORT | ERRCODE_WARNING_MASK)
+
+
+// both codes will be used twice : with ERRCODE_CLASS_READ- and ERRCODE_CLASS_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 SvxErrorHandler -------------------------------------------------
+
+#ifndef __RSC
+
+#include <svtools/ehdl.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC SvxErrorHandler : private SfxErrorHandler
+{
+public:
+ SvxErrorHandler();
+ static void ensure();
+};
+
+#endif
+
+
+#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 000000000000..d18c8f3b6af2
--- /dev/null
+++ b/include/svx/svxgrahicitem.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 _SVX_GRAPHICITEM_HXX
+#define _SVX_GRAPHICITEM_HXX
+
+
+#include <svl/poolitem.hxx>
+#include "svx/svxdllapi.h"
+
+#include <vcl/graph.hxx>
+
+class SVX_DLLPUBLIC SvxGraphicItem: public SfxPoolItem
+{
+ Graphic aGraphic;
+
+public:
+ TYPEINFO();
+ SvxGraphicItem();
+ SvxGraphicItem( sal_uInt16 nWhich ,const Graphic& rGraphic);
+ SvxGraphicItem( const SvxGraphicItem& );
+
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) 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 000000000000..3c11c3686efe
--- /dev/null
+++ b/include/svx/svxids.hrc
@@ -0,0 +1,950 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_SVXIDS_HRC
+#define _SVX_SVXIDS_HRC
+
+#include <svl/memberid.hrc>
+#include <svl/solar.hrc>
+#include <sfx2/sfx.hrc>
+#include <sfx2/sfxsids.hrc>
+#include <editeng/editids.hrc>
+#include <svx/unomid.hxx>
+
+// solange noch im sfxids.hrc definiert -------------------------------------
+
+#ifdef SID_INSERT_FRAME
+#undef SID_INSERT_FRAME
+#endif
+
+// --------------------------------------------------------------------------
+// Member-Id's
+// --------------------------------------------------------------------------
+
+#define MID_APPFLAG 0x20
+#define MID_AUTOBREAK 0x21
+#define MID_BREAKxxx 0x22
+#define MID_BRUSHSTYLE 0x23
+#define MID_CELLTYPE 0x24
+#define MID_CHARSET 0x25
+#define MID_COMMAND 0x26
+#define MID_CONTENT 0x27
+#define MID_DESCNAMExxx 0x28
+
+#define MID_ESCAPEMENT 0x2a
+#define MID_FAMILY 0x2b
+#define MID_FIRSTLINE_OFFSET 0x2d
+#define MID_FONTFAMILY 0x2f
+#define MID_FONTFAMILYNAME 0x30
+#define MID_FONTSTYLE 0x32
+#define MID_HYPHEN 0x34
+#define MID_INTER_LINESPACE 0x36
+#define MID_INTER_SPACE 0x37
+#define MID_LANDSCAPE 0x38
+
+#define MID_LEFT_MARGIN 0x3a
+#define MID_LOWER 0x3d
+#define MID_MAXHYPHENS 0x3e
+#define MID_MINLEAD 0x3f
+#define MID_MINTRAIL 0x40
+#define MID_NUMTYPExxx 0x41
+#define MID_PAGEEND 0x42
+#define MID_POS 0x43
+#define MID_PROPORTIONAL 0x44
+#define MID_REPLACE_STRING 0x45
+#define MID_RIGHT 0x46
+#define MID_RIGHT_MARGIN 0x47
+#define MID_ROW_DIRECTION 0x48
+#define MID_SIZE 0x4a
+#define MID_UPPER 0x4b
+#define MID_USExxx 0x4c
+
+#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
+
+// --------------------------------------------------------------------------
+// Event-Id's Block 1
+// --------------------------------------------------------------------------
+
+#define SVX_EVENT_COLUM_WINDOW_EXECUTE (EVENT_SVX_START)
+
+// --------------------------------------------------------------------------
+// Event-Id's Block 2
+// --------------------------------------------------------------------------
+
+#define SVX_EVENT_IMAGE_LOAD (SID_LIB_START)
+#define SVX_EVENT_IMAGE_ABORT (SID_LIB_START + 1)
+#define SVX_EVENT_IMAGE_ERROR (SID_LIB_START + 2)
+
+// --------------------------------------------------------------------------
+// Function-Id's
+// --------------------------------------------------------------------------
+
+// Function-Id's
+#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-Id's
+// --------------------------------------------------------------------------
+
+#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_POLY_FORMEN (SID_SFX_START + 682)
+#define SID_DISTRIBUTE_DLG (SID_SFX_START + 683)
+
+// --------------------------------------------------------------------------
+// Basic IDE-Id's
+// --------------------------------------------------------------------------
+
+#define SID_BASICIDE_TOGGLEBRKPNT ( SID_BASICIDE_START + 0 )
+#define SID_BASICIDE_ADDWATCH ( SID_BASICIDE_START + 1 )
+#define SID_BASICIDE_CHOOSEMACRO ( SID_BASICIDE_START + 2 )
+#define SID_BASICIDE_EDITMACRO ( SID_BASICIDE_START + 3 )
+#define SID_BASICIDE_CREATEMACRO ( SID_BASICIDE_START + 4 )
+#define SID_BASICIDE_MODULEDLG ( SID_BASICIDE_START + 5 )
+#define SID_BASICIDE_OBJCAT ( SID_BASICIDE_START + 6 )
+#define SID_BASICIDE_REMOVEWATCH ( SID_BASICIDE_START + 7 )
+#define SID_BASICIDE_SHOWSBX ( SID_BASICIDE_START + 9 )
+#define SID_BASICIDE_HIDECURPAGE ( SID_BASICIDE_START + 10 )
+#define SID_BASICIDE_NAMECHANGEDONTAB ( SID_BASICIDE_START + 11 )
+#define SID_BASICIDE_UPDATEMODULESOURCE ( SID_BASICIDE_START + 12 )
+#define SID_BASICIDE_STOREMODULESOURCE ( SID_BASICIDE_START + 13 )
+#define SID_BASICIDE_MATCHGROUP ( SID_BASICIDE_START + 14 )
+#define SID_BASICIDE_APPEAR ( SID_BASICIDE_START + 15 )
+#define SID_BASICIDE_STOREALLMODULESOURCES ( SID_BASICIDE_START + 16 )
+#define SID_BASICIDE_UPDATEALLMODULESOURCES ( SID_BASICIDE_START + 17 )
+#define SID_BASICIDE_LIBSELECTED ( SID_BASICIDE_START + 18 )
+#define SID_BASICIDE_LIBSELECTOR ( SID_BASICIDE_START + 19 )
+#define SID_BASICIDE_NEWDIALOG ( SID_BASICIDE_START + 20 )
+#define SID_BASICIDE_NEWMODULE ( SID_BASICIDE_START + 21 )
+#define SID_BASICIDE_DELETECURRENT ( SID_BASICIDE_START + 22 )
+#define SID_BASICIDE_RENAMECURRENT ( SID_BASICIDE_START + 23 )
+#define SID_BASICIDE_SBXDELETED ( SID_BASICIDE_START + 24 )
+#define SID_BASICIDE_SBXINSERTED ( SID_BASICIDE_START + 25 )
+#define SID_BASICIDE_SBXRENAMED ( SID_BASICIDE_START + 26 )
+#define SID_BASICIDE_LIBLOADED ( SID_BASICIDE_START + 27 )
+#define SID_BASICIDE_LIBREMOVED ( SID_BASICIDE_START + 28 )
+#define SID_BASICIDE_ARG_TABID ( SID_BASICIDE_START + 30 )
+#define SID_BASICIDE_ARG_SBX ( SID_BASICIDE_START + 31 )
+#define SID_BASICIDE_ARG_MACROINFO ( SID_BASICIDE_START + 32 )
+#define SID_BASICIDE_ARG_LIBNAME ( SID_BASICIDE_START + 34 )
+#define SID_BASICIDE_ARG_MODULENAME ( SID_BASICIDE_START + 35 )
+#define SID_BASICIDE_BRKPNTSCHANGED ( SID_BASICIDE_START + 36 )
+#define SID_BASICIDE_STATUSBAR ( SID_BASICIDE_START + 37 )
+#define SID_BASICIDE_STAT_POS ( SID_BASICIDE_START + 38 )
+#define SID_BASICIDE_STAT_DATE ( SID_BASICIDE_START + 39 )
+#define SID_BASICIDE_STAT_TITLE ( SID_BASICIDE_START + 40 )
+#define SID_BASICIDE_NEWJAVAMODULE ( SID_BASICIDE_START + 41 )
+#define SID_BASICIDE_IMAGESTART ( SID_BASICIDE_START + 50 )
+#define SID_OPTIONS_TREEDIALOG ( SID_BASICIDE_START + 862)
+
+// --------------------------------------------------------------------------
+// StarBase-Id's
+// --------------------------------------------------------------------------
+
+#define SID_SBA_BRW_UPDATE (SID_SBA_START+100) // Daten in Felder
+#define SID_SBA_BRW_INSERT (SID_SBA_START+101) // Daten in Text
+#define SID_SBA_BRW_MERGE (SID_SBA_START+102) // Serienbrief
+
+// --------------------------------------------------------------------------
+// SD-Id's
+// --------------------------------------------------------------------------
+
+#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_IMAGE (SID_SD_START+105)
+#define SID_INSERT_MATH (SID_SD_START+106)
+#define SID_SIZE_VISAREA (SID_SD_START+114)
+#define SID_ATTR_SYMBOLTYPE (SID_SD_START+115) //wird vom Chart und von SvxLineTabPage genutzt
+#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)
+#define ID_VAL_LENGTH_X (SID_SD_START+202)
+#define ID_VAL_LENGTH_Y (SID_SD_START+203)
+#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-Id's
+// --------------------------------------------------------------------------
+#define FN_EDIT (SID_SW_START + 100)
+#define FN_NUM_BULLET_OFF (FN_EDIT + 37) /* Numerierung aus */
+#define FN_NUM_BULLET_ON (FN_EDIT + 38) /* Numerierung mit Bullets an */
+#define FN_NUM_NUMBERING_ON (FN_EDIT + 44) /* Numerierung an */
+
+#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_HARDHYPHEN (FN_INSERT + 85) /* hyphen withou 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
+// --------------------------------------------------------------------------
+
+#define SID_ATTR_BORDER_INNER ( SID_SVX_START + 23 )
+
+#define SID_ATTR_POSTIT_AUTHOR ( SID_SVX_START + 44 )
+#define SID_ATTR_POSTIT_DATE ( SID_SVX_START + 45 )
+#define SID_ATTR_POSTIT_TEXT ( SID_SVX_START + 46 )
+#define SID_ATTR_SEARCH ( SID_SVX_START + 47 )
+#define SID_ATTR_PAGE ( SID_SVX_START + 50 )
+#define SID_ATTR_PAGE_SIZE ( SID_SVX_START + 51 )
+#define SID_ATTR_PAGE_MAXSIZE ( SID_SVX_START + 52 )
+#define SID_ATTR_PAGE_PAPERBIN ( SID_SVX_START + 54 )
+#define SID_ATTR_PAGE_APP ( SID_SVX_START + 55 )
+#define SID_ATTR_PAGE_EXT1 ( SID_SVX_START + 56 )
+#define SID_ATTR_PAGE_EXT2 ( SID_SVX_START + 57 )
+#define SID_ATTR_PAGE_HEADERSET ( SID_SVX_START + 58 )
+#define SID_ATTR_PAGE_FOOTERSET ( SID_SVX_START + 59 )
+#define SID_ATTR_PAGE_ON ( SID_SVX_START + 60 )
+#define SID_ATTR_PAGE_DYNAMIC ( SID_SVX_START + 61 )
+#define SID_ATTR_PAGE_SHARED ( SID_SVX_START + 62 )
+#define SID_ATTR_PAGE_BSP ( SID_SVX_START + 63 )
+#define SID_ATTR_NUMBERFORMAT_VALUE ( SID_SVX_START + 85 )
+#define SID_ATTR_NUMBERFORMAT_INFO ( SID_SVX_START + 86 )
+#define SID_ATTR_TRANSFORM ( SID_SVX_START + 87 )
+#define SID_ATTR_TRANSFORM_POS_X ( SID_SVX_START + 88 )
+#define SID_ATTR_TRANSFORM_POS_Y ( SID_SVX_START + 89 )
+#define SID_ATTR_TRANSFORM_WIDTH ( SID_SVX_START + 90 )
+#define SID_ATTR_TRANSFORM_HEIGHT ( SID_SVX_START + 91 )
+#define SID_ATTR_TRANSFORM_SIZE_POINT ( SID_SVX_START + 92 )
+#define SID_ATTR_TRANSFORM_ROT_X ( SID_SVX_START + 93 )
+#define SID_ATTR_TRANSFORM_ROT_Y ( SID_SVX_START + 94 )
+#define SID_ATTR_TRANSFORM_ANGLE ( SID_SVX_START + 95 )
+#define SID_RULER_NULL_OFFSET ( SID_SVX_START + 79 )
+#define SID_RULER_BORDERS ( SID_SVX_START + 80 )
+#define SID_RULER_OBJECT ( SID_SVX_START + 81 )
+#define SID_RULER_PAGE_POS ( SID_SVX_START + 82 )
+#define SID_RULER_ACT_LINE_ONLY ( SID_SVX_START + 83 )
+#define SID_RULER_LR_MIN_MAX ( SID_SVX_START + 84 )
+#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_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 ( SID_SVX_START + 122 )
+#define SID_BEZIER_SMOOTH ( SID_SVX_START + 123 )
+#define SID_BEZIER_APPEND ( SID_SVX_START + 124 )
+#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 ( 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_FROM_FILE ( SID_SVX_START + 139 )
+#define SID_INSERT_DIAGRAM ( SID_SVX_START + 140 )
+#define SID_DRAW_CHART SID_INSERT_DIAGRAM
+#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_THIS_SLIDE ( SID_SVX_START + 158 )
+#define SID_REHEARSE_TIMINGS ( SID_SVX_START + 159 )
+#define SID_HIDE_SLIDE ( SID_SVX_START + 161 )
+#define SID_CHOOSE_POLYGON ( SID_SVX_START + 162 )
+#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 ( SID_SVX_START + 179 )
+#define SID_GRADIENT_LIST ( SID_SVX_START + 180 )
+#define SID_HATCH_LIST ( SID_SVX_START + 181 )
+#define SID_BITMAP_LIST ( SID_SVX_START + 182 )
+#define SID_DASH_LIST ( SID_SVX_START + 183 )
+#define SID_LINEEND_LIST ( SID_SVX_START + 184 )
+#define SID_BACKGROUND_COLOR ( SID_SVX_START + 185 )
+#define SID_BACKGROUND_PATTERN ( SID_SVX_START + 186 )
+#define SID_ATTR_BORDER ( SID_SVX_START + 187 )
+#define SID_INSERT_FIXEDTEXT ( SID_SVX_START + 188 )
+#define SID_INSERT_GROUPBOX ( SID_SVX_START + 189 )
+#define SID_INSERT_EDIT ( SID_SVX_START + 190 )
+#define SID_INSERT_LISTBOX ( SID_SVX_START + 191 )
+#define SID_INSERT_COMBOBOX ( SID_SVX_START + 192 )
+#define SID_INSERT_SPINBUTTON ( SID_SVX_START + 193 )
+#define SID_INSERT_HSCROLLBAR ( SID_SVX_START + 194 )
+#define SID_INSERT_VSCROLLBAR ( SID_SVX_START + 195 )
+#define SID_INSERT_PREVIEW ( SID_SVX_START + 196 )
+#define SID_INSERT_URLBUTTON ( SID_SVX_START + 197 )
+#define SID_INSERT_SELECT ( SID_SVX_START + 198 )
+#define SID_DIALOG_TESTMODE ( SID_SVX_START + 199 )
+#define SID_FRAME_LINESTYLE ( SID_SVX_START + 200 )
+#define SID_FRAME_LINECOLOR ( SID_SVX_START + 201 )
+#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 ( SID_SVX_START + 218 )
+#define SID_ATTR_TABLE_ROW ( SID_SVX_START + 219 )
+#define SID_ATTR_COLUMNS ( SID_SVX_START + 220 )
+#define SID_ATTR_INSERT ( SID_SVX_START + 221 )
+#define SID_ATTR_ZOOM_USER ( SID_SVX_START + 222 )
+#define SID_ATTR_POSITION ( SID_SVX_START + 223 )
+#define SID_ATTR_SIZE ( 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 ( SID_SVX_START + 236 )
+#define SID_ATTR_TRANSFORM_PROTECT_SIZE ( SID_SVX_START + 237 )
+#define SID_ATTR_TRANSFORM_AUTOSIZE ( SID_SVX_START + 238 ) // !!!
+#define SID_ATTR_TRANSFORM_INTERN ( SID_SVX_START + 239 )
+#define SID_INSERT_FRAME ( SID_SVX_START + 240 )
+#define SID_INSERT_GRAPHIC ( SID_SVX_START + 241 )
+#define SID_AUTOFORMAT ( 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_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_STDFORM ( SID_SVX_START + 267 )
+#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 )
+#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_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_BORDER_OBJECT ( SID_SVX_START + 340 )
+#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 )
+#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_SHOW_HIDDEN ( SID_SVX_START + 375 )
+#define SID_SHOW_FORMS ( SID_SVX_START + 376 )
+#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 )
+#define SID_ATTR_3D_LIGHT ( SID_SVX_START + 407 ) /* Slots mit --> koennen demnaechst entfallen */
+#define SID_ATTR_3D_START SID_ATTR_3D_LIGHT
+
+#define SID_RULER_PROTECT ( SID_SVX_START + 415 )
+#define SID_COLOR_CONTROL ( SID_SVX_START + 417 )
+#define SID_ATTR_3D_INTERN ( SID_SVX_START + 422 )
+#define SID_PSZ_FUNCTION ( SID_SVX_START + 423 )
+
+#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_SIM_EDITOPTIONS ( SID_SVX_START + 438 )
+#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 )
+#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_LINEEND_WIDTH_DEFAULT ( SID_SVX_START + 579 )
+#define SID_ATTR_NUMBERFORMAT_ONE_AREA ( SID_SVX_START + 580 )
+#define SID_PARA_BACKGRND_DESTINATION ( SID_SVX_START + 590 )
+
+#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 )
+#define SID_FM_CHANGECOL ( SID_SVX_START + 606 )
+#define SID_FM_NAVIGATIONBAR ( SID_SVX_START + 607 )
+#define SID_FM_NEW_HIDDEN ( SID_SVX_START + 608 )
+#define SID_FM_RENAME_OBJECT ( SID_SVX_START + 609 )
+#define SID_FM_DELETEROWS ( SID_SVX_START + 610 )
+#define SID_FM_INSERTCOL ( SID_SVX_START + 611 )
+#define SID_FM_DELETECOL ( SID_SVX_START + 612 )
+#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 )
+#define SID_FM_NEW ( SID_SVX_START + 638 )
+#define SID_FM_DELETE ( SID_SVX_START + 639 )
+#define SID_FM_NEW_FORM ( SID_SVX_START + 640 )
+#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_LIGHTDIRECTION_8 ( SID_SVX_START + 691 )
+#define SID_ATTR_3D_END SID_ATTR_3D_LIGHTDIRECTION_8
+#define SID_ATTR_NUMBERFORMAT_NOLANGUAGE ( SID_SVX_START + 700 )
+#define SID_MN_GROUP ( SID_SVX_START + 701 )
+
+#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_COUNTALL ( SID_SVX_START + 717 )
+#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 ) // Formcontroller-Button rauspoppen
+#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_FM_HIDECOL ( SID_SVX_START + 753 )
+#define SID_FM_SHOWCOLS ( SID_SVX_START + 754 )
+#define SID_FM_SHOWCOLS_MORE ( SID_SVX_START + 755 )
+#define SID_FM_SHOWALLCOLS ( SID_SVX_START + 756 )
+#define SID_FM_TWOFIELDS_DATE_N_TIME ( SID_SVX_START + 757 )
+#define SID_FM_FILTER_EDIT ( SID_SVX_START + 758 )
+#define SID_FM_FILTER_IS_NULL ( SID_SVX_START + 759 )
+#define SID_FM_FILTER_IS_NOT_NULL ( SID_SVX_START + 760 )
+#define SID_FM_VIEW_AS_GRID ( SID_SVX_START + 761 )
+#define SID_FM_FILTER_REMOVE ( SID_SVX_START + 762 )
+#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 )
+
+#define SID_HLINKBAR_LINK ( SID_SVX_START + 851 )
+#define SID_HLINKBAR_SEARCH ( SID_SVX_START + 853 )
+#define SID_HLINKBAR_TARGET ( SID_SVX_START + 854 )
+#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 )
+#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
+#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 )
+#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_KATAGANA ( SID_SVX_START + 917 )
+#define SID_MN_SUB_TRANSLITERATE ( SID_SVX_START + 918 )
+#define SID_LANGUAGE_OPTIONS ( SID_SVX_START + 921 )
+#define SID_GETUNDOSTRINGS ( SID_SVX_START + 923 )
+#define SID_GETREDOSTRINGS ( SID_SVX_START + 924 )
+
+#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_ATTR_AUTO_COLOR_INVALID ( SID_SVX_START + 933 )
+#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 )
+#define SID_ATTR_TABSTOP_VERTICAL ( SID_SVX_START + 946 )
+#define SID_RULER_BORDERS_VERTICAL ( SID_SVX_START + 948 )
+#define SID_ATTR_ALIGN_ASIANVERTICAL ( SID_SVX_START + 949 )
+#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_TOOGLE ( 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 )
+// free ( 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 )
+#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 )
+#define SID_ATTR_TRANSFORM_HORI_POSITION ( SID_SVX_START + 999 )
+#define SID_ATTR_TRANSFORM_VERT_POSITION ( SID_SVX_START + 1000 )
+#define SID_SHOW_ITEMBROWSER ( SID_SVX_START + 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 ( 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_CONTROLFLAGS ( SID_SVX_START + 1032 )
+#define SID_SVXTEXTATTRPAGE_VIEW ( 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_LINK_TYPE ( SID_SVX_START + 1037 )
+#define SID_ENUM_PAGE_MODE ( SID_SVX_START + 1038 )
+#define SID_PAPER_START ( SID_SVX_START + 1039 )
+#define SID_PAPER_END ( 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_MORE_CONTROLS ( SID_SVX_START + 1045 )
+#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 )
+#define SID_OPEN_SMARTTAGOPTIONS ( SID_SVX_START + 1062 )
+#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_FONTNAMELIST ( SID_SVX_START + 1066 )
+#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_SHOW_POSTIT (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_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_CHANGE_PICTURE (SID_SVX_START+1125)
+#define SID_ROTATE_GRAPHIC_LEFT (SID_SVX_START+1126)
+#define SID_ROTATE_GRAPHIC_RIGHT (SID_SVX_START+1127)
+#define SID_MENU_MANAGE_GRAPHIC (SID_SVX_START+1128)
+
+// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
+#define SID_SVX_FIRSTFREE (SID_MENU_MANAGE_GRAPHIC + 1)
+
+// --------------------------------------------------------------------------
+// Overflow check for slot IDs
+// --------------------------------------------------------------------------
+
+#if SID_SVX_FIRSTFREE > SID_SVX_END
+#error Resource-Ueberlauf in #line, #file
+#endif
+
+#endif // #ifndef _SVX_SVXIDS_HRC
+
+// ******************************************************************* EOF
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svxitems.hrc b/include/svx/svxitems.hrc
new file mode 100644
index 000000000000..44a68ebdbd9f
--- /dev/null
+++ b/include/svx/svxitems.hrc
@@ -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 _SVXITEMS_HRC
+#define _SVXITEMS_HRC
+
+#include <svl/solar.hrc>
+
+// Extras -------------------------------------------------------------------
+#define RID_SVXITEMS_EXTRAS_CHARCOLOR (RID_SVXITEMS_START + 2)
+
+// SvxSearchItem ------------------------------------------------------------
+// Kommando
+#define RID_SVXITEMS_SEARCHCMD_FIND (RID_SVXITEMS_START + 10)
+#define RID_SVXITEMS_SEARCHCMD_FIND_ALL (RID_SVXITEMS_START + 11)
+#define RID_SVXITEMS_SEARCHCMD_REPLACE (RID_SVXITEMS_START + 12)
+#define RID_SVXITEMS_SEARCHCMD_REPLACE_ALL (RID_SVXITEMS_START + 13)
+// Vorlagen
+#define RID_SVXITEMS_SEARCHSTYL_CHAR (RID_SVXITEMS_START + 14)
+#define RID_SVXITEMS_SEARCHSTYL_PARA (RID_SVXITEMS_START + 15)
+#define RID_SVXITEMS_SEARCHSTYL_FRAME (RID_SVXITEMS_START + 16)
+#define RID_SVXITEMS_SEARCHSTYL_PAGE (RID_SVXITEMS_START + 17)
+// Zellen-Typ
+#define RID_SVXITEMS_SEARCHIN_FORMULA (RID_SVXITEMS_START + 20)
+#define RID_SVXITEMS_SEARCHIN_VALUE (RID_SVXITEMS_START + 21)
+#define RID_SVXITEMS_SEARCHIN_NOTE (RID_SVXITEMS_START + 22)
+// Applikation
+#define RID_SVXITEMS_SEARCHAPP_WRITER (RID_SVXITEMS_START + 25)
+#define RID_SVXITEMS_SEARCHAPP_CALC (RID_SVXITEMS_START + 26)
+#define RID_SVXITEMS_SEARCHAPP_DRAW (RID_SVXITEMS_START + 27)
+#define RID_SVXITEMS_SEARCHAPP_BASE (RID_SVXITEMS_START + 28)
+
+// enum BrushStyle ----------------------------------------------------------
+#define RID_SVXITEMS_BRUSHSTYLE_NULL (RID_SVXITEMS_START + 45)
+#define RID_SVXITEMS_BRUSHSTYLE_SOLID (RID_SVXITEMS_START + 46)
+#define RID_SVXITEMS_BRUSHSTYLE_HORZ (RID_SVXITEMS_START + 47)
+#define RID_SVXITEMS_BRUSHSTYLE_VERT (RID_SVXITEMS_START + 48)
+#define RID_SVXITEMS_BRUSHSTYLE_CROSS (RID_SVXITEMS_START + 49)
+#define RID_SVXITEMS_BRUSHSTYLE_DIAGCROSS (RID_SVXITEMS_START + 50)
+#define RID_SVXITEMS_BRUSHSTYLE_UPDIAG (RID_SVXITEMS_START + 51)
+#define RID_SVXITEMS_BRUSHSTYLE_DOWNDIAG (RID_SVXITEMS_START + 52)
+#define RID_SVXITEMS_BRUSHSTYLE_25 (RID_SVXITEMS_START + 53)
+#define RID_SVXITEMS_BRUSHSTYLE_50 (RID_SVXITEMS_START + 54)
+#define RID_SVXITEMS_BRUSHSTYLE_75 (RID_SVXITEMS_START + 55)
+#define RID_SVXITEMS_BRUSHSTYLE_BITMAP (RID_SVXITEMS_START + 56)
+
+// enum SvxCellOrientation
+#define RID_SVXITEMS_ORI_STANDARD (RID_SVXITEMS_START + 410)
+#define RID_SVXITEMS_ORI_TOPBOTTOM (RID_SVXITEMS_START + 411)
+#define RID_SVXITEMS_ORI_BOTTOMTOP (RID_SVXITEMS_START + 412)
+#define RID_SVXITEMS_ORI_STACKED (RID_SVXITEMS_START + 413)
+
+// Id's fuer BoolItems
+#define RID_SVXITEMS_BOXINF_TABLE_TRUE (RID_SVXITEMS_START + 443)
+#define RID_SVXITEMS_BOXINF_TABLE_FALSE (RID_SVXITEMS_START + 444)
+#define RID_SVXITEMS_BOXINF_DIST_TRUE (RID_SVXITEMS_START + 445)
+#define RID_SVXITEMS_BOXINF_DIST_FALSE (RID_SVXITEMS_START + 446)
+#define RID_SVXITEMS_BOXINF_MDIST_TRUE (RID_SVXITEMS_START + 447)
+#define RID_SVXITEMS_BOXINF_MDIST_FALSE (RID_SVXITEMS_START + 448)
+
+// Complete-Texte -----------------------------------------------------------
+
+#define RID_SVXITEMS_MARGIN_LEFT (RID_SVXITEMS_START + 480)
+#define RID_SVXITEMS_MARGIN_TOP (RID_SVXITEMS_START + 481)
+#define RID_SVXITEMS_MARGIN_RIGHT (RID_SVXITEMS_START + 482)
+#define RID_SVXITEMS_MARGIN_BOTTOM (RID_SVXITEMS_START + 483)
+#define RID_SVXITEMS_PAGE_COMPLETE (RID_SVXITEMS_START + 498)
+#define RID_SVXITEMS_PAGE_NUM_BEGIN (RID_SVXITEMS_START + 499)
+#define RID_SVXITEMS_PAGE_NUM_CHR_UPPER (RID_SVXITEMS_START + 499)
+#define RID_SVXITEMS_PAGE_NUM_CHR_LOWER (RID_SVXITEMS_START + 500)
+#define RID_SVXITEMS_PAGE_NUM_ROM_UPPER (RID_SVXITEMS_START + 501)
+#define RID_SVXITEMS_PAGE_NUM_ROM_LOWER (RID_SVXITEMS_START + 502)
+#define RID_SVXITEMS_PAGE_NUM_ARABIC (RID_SVXITEMS_START + 503)
+#define RID_SVXITEMS_PAGE_NUM_NONE (RID_SVXITEMS_START + 504)
+#define RID_SVXITEMS_PAGE_LAND_TRUE (RID_SVXITEMS_START + 505)
+#define RID_SVXITEMS_PAGE_LAND_FALSE (RID_SVXITEMS_START + 506)
+#define RID_SVXITEMS_PAGE_USAGE_LEFT (RID_SVXITEMS_START + 507)
+#define RID_SVXITEMS_PAGE_USAGE_RIGHT (RID_SVXITEMS_START + 508)
+#define RID_SVXITEMS_PAGE_USAGE_ALL (RID_SVXITEMS_START + 509)
+#define RID_SVXITEMS_PAGE_USAGE_MIRROR (RID_SVXITEMS_START + 510)
+#define RID_SVXITEMS_AUTHOR_COMPLETE (RID_SVXITEMS_START + 521)
+#define RID_SVXITEMS_DATE_COMPLETE (RID_SVXITEMS_START + 522)
+#define RID_SVXITEMS_TEXT_COMPLETE (RID_SVXITEMS_START + 523)
+#define RID_SVXITEMS_BACKGROUND_COLOR (RID_SVXITEMS_START + 524)
+#define RID_SVXITEMS_PATTERN_COLOR (RID_SVXITEMS_START + 525)
+
+#define RID_SVXITEMS_BRUSH_CHAR (RID_SVXITEMS_START + 527)
+#define RID_ATTR_NAMES (RID_SVXITEMS_START + 528)
+
+// Ueberlaufpruefung --------------------------------------------------------
+
+// Resource-Id's
+#define ACT_RID_SVXITEMS_END RID_ATTR_NAMES
+#if ACT_RID_SVXITEMS_END > RID_SVXITEMS_END
+#error Resource-Ueberlauf in #line, #file
+#endif
+
+
+#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 000000000000..0f08f1506943
--- /dev/null
+++ b/include/svx/swframeexample.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 _SVXSWFRAMEEXAMPLE_HXX
+#define _SVXSWFRAMEEXAMPLE_HXX
+
+#include <vcl/window.hxx>
+#include <tools/color.hxx>
+#include <tools/gen.hxx>
+#include "svx/svxdllapi.h"
+
+// class SwFrmPagePreview -------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxSwFrameExample : public Window
+{
+ 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
+
+ Rectangle aPage;
+ Rectangle aPagePrtArea;
+ Rectangle aTextLine;
+ Rectangle aPara;
+ Rectangle aParaPrtArea;
+ Rectangle aFrameAtFrame;
+ Rectangle aDrawObj;
+ Rectangle aAutoCharFrame;
+ Size aFrmSize;
+
+ short nHAlign;
+ short nHRel;
+
+ short nVAlign;
+ short nVRel;
+
+ short nWrap;
+ short nAnchor;
+ sal_Bool bTrans;
+
+ Point aRelPos;
+
+ void InitColors_Impl( void );
+ void InitAllRects_Impl();
+ void CalcBoundRect_Impl(Rectangle &rRect);
+ Rectangle DrawInnerFrame_Impl(const Rectangle &rRect, const Color &rFillColor, const Color &rBorderColor);
+
+ void DrawRect_Impl(const Rectangle &rRect, const Color &rFillColor, const Color &rLineColor);
+ virtual void Paint(const Rectangle&);
+protected:
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+public:
+
+ SvxSwFrameExample(Window* pParent, const ResId& rResID);
+ ~SvxSwFrameExample();
+
+ inline void SetWrap(sal_uInt16 nW) { nWrap = nW; }
+
+ inline void SetHAlign(short nH) { nHAlign = nH; }
+ inline void SetHoriRel(short nR) { nHRel = nR; }
+
+ inline void SetVAlign(short nV) { nVAlign = nV; }
+ inline void SetVertRel(short nR) { nVRel = nR; }
+
+ inline void SetTransparent(sal_Bool bT) { bTrans = bT; }
+ inline void SetAnchor(short nA) { nAnchor = nA; }
+
+ void SetRelPos(const Point& rP);
+};
+
+
+#endif // _SVXSWFRAMEEXAMPLE_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 000000000000..a6ecc3a7605e
--- /dev/null
+++ b/include/svx/swframeposstrings.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 _SVXSWFRAMEPOSSTRINGS_HXX
+#define _SVXSWFRAMEPOSSTRINGS_HXX
+
+#include <tools/string.hxx>
+#include "svx/svxdllapi.h"
+
+/*
+ contains strings needed for positioning dialogs
+ of frames and drawing in Writer
+ */
+class SvxSwFramePosString_Impl;
+class SVX_DLLPUBLIC SvxSwFramePosString
+{
+ SvxSwFramePosString_Impl* pImpl;
+public:
+ SvxSwFramePosString();
+ ~SvxSwFramePosString();
+ 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_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
+ };
+ const String& GetString(StringId eId);
+};
+#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 000000000000..a42906eb28c7
--- /dev/null
+++ b/include/svx/swframevalidation.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 _SVXSWFRAMEVALIDATION_HXX
+#define _SVXSWFRAMEVALIDATION_HXX
+#include <sal/types.h>
+#include <tools/gen.hxx>
+#include <limits.h>
+
+/*
+ struct to determine min/max values for fly frame positioning in Writer
+ */
+struct SvxSwFrameValidation
+{
+ sal_Int16 nAnchorType; //com::sun::star::text::TextContentAnchorType
+ sal_Int16 nHoriOrient; //com::sun::star::text::HoriOrientation
+ sal_Int16 nVertOrient; //com::sun::star::text::VertOrientation
+ sal_Int16 nHRelOrient; //com::sun::star::text::RelOrientation
+ sal_Int16 nVRelOrient; //com::sun::star::text::RelOrientation
+ bool bAutoHeight;
+ bool bAutoWidth;
+ 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() :
+ bAutoHeight(false),
+ bAutoWidth(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
+ nMaxHeight(SAL_MAX_INT32)
+ {
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxallitm.hxx b/include/svx/sxallitm.hxx
new file mode 100644
index 000000000000..7d6c66a870cd
--- /dev/null
+++ b/include/svx/sxallitm.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 _SXALLITM_HXX
+#define _SXALLITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdmetitm.hxx>
+
+//------------------------------
+// class SdrAllPositionXItem
+//------------------------------
+class SdrAllPositionXItem: public SdrMetricItem {
+public:
+ SdrAllPositionXItem(long nPosX=0): SdrMetricItem(SDRATTR_ALLPOSITIONX,nPosX) {}
+ SdrAllPositionXItem(SvStream& rIn): SdrMetricItem(SDRATTR_ALLPOSITIONX,rIn) {}
+};
+
+//------------------------------
+// class SdrAllPositionYItem
+//------------------------------
+class SdrAllPositionYItem: public SdrMetricItem {
+public:
+ SdrAllPositionYItem(long nPosY=0): SdrMetricItem(SDRATTR_ALLPOSITIONY,nPosY) {}
+ SdrAllPositionYItem(SvStream& rIn): SdrMetricItem(SDRATTR_ALLPOSITIONY,rIn) {}
+};
+
+//------------------------------
+// class SdrAllSizeWidthItem
+//------------------------------
+class SdrAllSizeWidthItem: public SdrMetricItem {
+public:
+ SdrAllSizeWidthItem(long nWdt=0): SdrMetricItem(SDRATTR_ALLSIZEWIDTH,nWdt) {}
+ SdrAllSizeWidthItem(SvStream& rIn): SdrMetricItem(SDRATTR_ALLSIZEWIDTH,rIn) {}
+};
+
+//------------------------------
+// class SdrAllSizeWidthItem
+//------------------------------
+class SdrAllSizeHeightItem: public SdrMetricItem {
+public:
+ SdrAllSizeHeightItem(long nHgt=0): SdrMetricItem(SDRATTR_ALLSIZEHEIGHT,nHgt) {}
+ SdrAllSizeHeightItem(SvStream& rIn): SdrMetricItem(SDRATTR_ALLSIZEHEIGHT,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxcaitm.hxx b/include/svx/sxcaitm.hxx
new file mode 100644
index 000000000000..66856eb33fb0
--- /dev/null
+++ b/include/svx/sxcaitm.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 _SXCAITM_HXX
+#define _SXCAITM_HXX
+
+#include <svx/svddef.hxx>
+
+#include <svx/sdangitm.hxx>
+#include <svx/sdooitm.hxx>
+
+//------------------------------------
+// class SdrCaptionFixedAngleItem
+// sal_True=Winkel durch SdrCaptionAngleItem vorgegeben
+// sal_False=Freier Winkel
+//------------------------------------
+class SdrCaptionFixedAngleItem: public SdrOnOffItem {
+public:
+ SdrCaptionFixedAngleItem(sal_Bool bFix=sal_True): SdrOnOffItem(SDRATTR_CAPTIONFIXEDANGLE,bFix) {}
+ SdrCaptionFixedAngleItem(SvStream& rIn) : SdrOnOffItem(SDRATTR_CAPTIONFIXEDANGLE,rIn) {}
+};
+
+//------------------------------
+// class SdrCaptionAngleItem
+// Winkelangabe in 1/100 Degree
+// Nur bei Type2, Type3 und Type4
+// und nur wenn SdrCaptionIsFixedAngleItem=TRUE
+//------------------------------
+class SdrCaptionAngleItem: public SdrAngleItem {
+public:
+ SdrCaptionAngleItem(long nAngle=0): SdrAngleItem(SDRATTR_CAPTIONANGLE,nAngle) {}
+ SdrCaptionAngleItem(SvStream& rIn): SdrAngleItem(SDRATTR_CAPTIONANGLE,rIn) {}
+};
+
+#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 000000000000..eabbaeed1d9b
--- /dev/null
+++ b/include/svx/sxcecitm.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 _SXCECITM_HXX
+#define _SXCECITM_HXX
+
+#include <svl/eitem.hxx>
+#include <svx/svddef.hxx>
+#include <svx/sdynitm.hxx>
+#include <svx/sdmetitm.hxx>
+#include "svx/svxdllapi.h"
+
+enum SdrCaptionEscDir {SDRCAPT_ESCHORIZONTAL,SDRCAPT_ESCVERTICAL,SDRCAPT_ESCBESTFIT};
+
+//------------------------------
+// class SdrCaptionEscDirItem
+//------------------------------
+class SVX_DLLPUBLIC SdrCaptionEscDirItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrCaptionEscDirItem(SdrCaptionEscDir eDir=SDRCAPT_ESCHORIZONTAL): SfxEnumItem(SDRATTR_CAPTIONESCDIR,sal::static_int_cast< sal_uInt16 >(eDir)) {}
+ SdrCaptionEscDirItem(SvStream& rIn) : SfxEnumItem(SDRATTR_CAPTIONESCDIR,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const; // { return 3; }
+ SdrCaptionEscDir GetValue() const { return (SdrCaptionEscDir)SfxEnumItem::GetValue(); }
+
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+//------------------------------------
+// class SdrCaptionEscIsRelItem
+// sal_True=Linienaustrittsposition relativ
+// sal_False=Linienaustrittsposition absolut
+//------------------------------------
+class SdrCaptionEscIsRelItem: public SdrYesNoItem {
+public:
+ SdrCaptionEscIsRelItem(sal_Bool bRel=sal_True): SdrYesNoItem(SDRATTR_CAPTIONESCISREL,bRel) {}
+ SdrCaptionEscIsRelItem(SvStream& rIn) : SdrYesNoItem(SDRATTR_CAPTIONESCISREL,rIn) {}
+};
+
+//------------------------------------
+// class SdrCaptionEscRelItem
+// Relativer Linienaustritt
+// 0 = 0.00% = oben bzw. links,
+// 10000 = 100.00% = rechts bzw. unten
+// nur wenn SdrCaptionEscIsRelItem=TRUE
+//------------------------------------
+class SdrCaptionEscRelItem: public SfxInt32Item {
+public:
+ SdrCaptionEscRelItem(long nEscRel=5000): SfxInt32Item(SDRATTR_CAPTIONESCREL,nEscRel) {}
+ SdrCaptionEscRelItem(SvStream& rIn) : SfxInt32Item(SDRATTR_CAPTIONESCREL,rIn) {}
+};
+
+//------------------------------------
+// class SdrCaptionEscAbsItem
+// Absoluter Linienaustritt
+// 0 = oben bzw. links,
+// >0 = in Richtung rechts bzw. unten
+// nur wenn SdrCaptionEscIsRelItem=FALSE
+//------------------------------------
+class SdrCaptionEscAbsItem: public SdrMetricItem {
+public:
+ SdrCaptionEscAbsItem(long nEscAbs=0): SdrMetricItem(SDRATTR_CAPTIONESCABS,nEscAbs) {}
+ SdrCaptionEscAbsItem(SvStream& rIn) : SdrMetricItem(SDRATTR_CAPTIONESCABS,rIn) {}
+};
+
+#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 000000000000..56301de03c27
--- /dev/null
+++ b/include/svx/sxcgitm.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 _SXCGITM_HXX
+#define _SXCGITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdmetitm.hxx>
+
+//------------------------------------
+// class SdrCaptionGapItem
+// Abstand des Linienanfangs vom Rect
+//------------------------------------
+class SdrCaptionGapItem: public SdrMetricItem {
+public:
+ SdrCaptionGapItem(long nGap=0) : SdrMetricItem(SDRATTR_CAPTIONGAP,nGap) {}
+ SdrCaptionGapItem(SvStream& rIn): SdrMetricItem(SDRATTR_CAPTIONGAP,rIn) {}
+};
+
+#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 000000000000..16bb59d1c2eb
--- /dev/null
+++ b/include/svx/sxciaitm.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 _SXCIAITM_HXX
+#define _SXCIAITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdangitm.hxx>
+
+//------------------------------
+// class SdrCircStartAngleItem
+//------------------------------
+class SdrCircStartAngleItem: public SdrAngleItem {
+public:
+ SdrCircStartAngleItem(long nAngle=0): SdrAngleItem(SDRATTR_CIRCSTARTANGLE,nAngle) {}
+ SdrCircStartAngleItem(SvStream& rIn): SdrAngleItem(SDRATTR_CIRCSTARTANGLE,rIn) {}
+};
+
+//------------------------------
+// class SdrCircEndAngleItem
+//------------------------------
+class SdrCircEndAngleItem: public SdrAngleItem {
+public:
+ SdrCircEndAngleItem(long nAngle=36000): SdrAngleItem(SDRATTR_CIRCENDANGLE,nAngle) {}
+ SdrCircEndAngleItem(SvStream& rIn): SdrAngleItem(SDRATTR_CIRCENDANGLE,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxcikitm.hxx b/include/svx/sxcikitm.hxx
new file mode 100644
index 000000000000..436370e588b1
--- /dev/null
+++ b/include/svx/sxcikitm.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 _SXCIKITM_HXX
+#define _SXCIKITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svl/eitem.hxx>
+
+enum SdrCircKind {SDRCIRC_FULL,
+ SDRCIRC_SECT,
+ SDRCIRC_CUT,
+ SDRCIRC_ARC};
+
+class SdrCircKindItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrCircKindItem(SdrCircKind eKind=SDRCIRC_FULL): SfxEnumItem(SDRATTR_CIRCKIND,sal::static_int_cast< sal_uInt16 >(eKind)) {}
+ SdrCircKindItem(SvStream& rIn) : SfxEnumItem(SDRATTR_CIRCKIND,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const; // { return 4; }
+ SdrCircKind GetValue() const { return (SdrCircKind)SfxEnumItem::GetValue(); }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+#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 000000000000..04b9a5d75c03
--- /dev/null
+++ b/include/svx/sxcllitm.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 _SXCLLITM_HXX
+#define _SXCLLITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdynitm.hxx>
+#include <svx/sdmetitm.hxx>
+
+//------------------------------------
+// class SdrCaptionLineLenItem
+// Laenge der ersten Austrittslinie
+// Nur bei Type3 und Type4
+// Nur relevant, wenn SdrCaptionFitLineLenItem=FALSE
+//------------------------------------
+class SdrCaptionLineLenItem: public SdrMetricItem {
+public:
+ SdrCaptionLineLenItem(long nLineLen=0): SdrMetricItem(SDRATTR_CAPTIONLINELEN,nLineLen) {}
+ SdrCaptionLineLenItem(SvStream& rIn) : SdrMetricItem(SDRATTR_CAPTIONLINELEN,rIn) {}
+};
+
+//------------------------------------
+// class SdrCaptionFitLineLenItem
+// Laenge der ersten Austrittslinie automatisch berechnen oder
+// Vorgabe (SdrCaptionLineLenItem) verwenden.
+// Nur bei Type3 und Type4
+//------------------------------------
+class SdrCaptionFitLineLenItem: public SdrYesNoItem {
+public:
+ SdrCaptionFitLineLenItem(sal_Bool bBestFit=sal_True): SdrYesNoItem(SDRATTR_CAPTIONFITLINELEN,bBestFit) {}
+ SdrCaptionFitLineLenItem(SvStream& rIn) : SdrYesNoItem(SDRATTR_CAPTIONFITLINELEN,rIn) {}
+};
+
+#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 000000000000..ba8d01190b47
--- /dev/null
+++ b/include/svx/sxctitm.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 _SXCTITM_HXX
+#define _SXCTITM_HXX
+
+#include <svl/eitem.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+enum SdrCaptionType {SDRCAPT_TYPE1,SDRCAPT_TYPE2,SDRCAPT_TYPE3,SDRCAPT_TYPE4};
+
+//------------------------------
+// class SdrCaptionTypeItem
+//------------------------------
+class SVX_DLLPUBLIC SdrCaptionTypeItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrCaptionTypeItem(SdrCaptionType eStyle=SDRCAPT_TYPE3): SfxEnumItem(SDRATTR_CAPTIONTYPE,sal::static_int_cast< sal_uInt16 >(eStyle)) {}
+ SdrCaptionTypeItem(SvStream& rIn) : SfxEnumItem(SDRATTR_CAPTIONTYPE,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const; // { return 4; }
+ SdrCaptionType GetValue() const { return (SdrCaptionType)SfxEnumItem::GetValue(); }
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+#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 000000000000..73bb20959fd9
--- /dev/null
+++ b/include/svx/sxekitm.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 _SXEKITM_HXX
+#define _SXEKITM_HXX
+
+#include <svl/eitem.hxx>
+#include <svx/svddef.hxx>
+#include "svx/svxdllapi.h"
+
+enum SdrEdgeKind {SDREDGE_ORTHOLINES,
+ SDREDGE_THREELINES,
+ SDREDGE_ONELINE,
+ SDREDGE_BEZIER,
+ SDREDGE_ARC};
+
+//------------------------------
+// class SdrEdgeKindItem
+//------------------------------
+class SVX_DLLPUBLIC SdrEdgeKindItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrEdgeKindItem(SdrEdgeKind eStyle=SDREDGE_ORTHOLINES): SfxEnumItem(SDRATTR_EDGEKIND,sal::static_int_cast< sal_uInt16 >(eStyle)) {}
+ SdrEdgeKindItem(SvStream& rIn) : SfxEnumItem(SDRATTR_EDGEKIND,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const; // { return 5; }
+ SdrEdgeKind GetValue() const { return (SdrEdgeKind)SfxEnumItem::GetValue(); }
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+#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 000000000000..6a97f4f4df42
--- /dev/null
+++ b/include/svx/sxelditm.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 _SXELDITM_HXX
+#define _SXELDITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdmetitm.hxx>
+#include "svx/svxdllapi.h"
+
+class SdrEdgeLineDeltaAnzItem: public SfxUInt16Item {
+public:
+ SdrEdgeLineDeltaAnzItem(sal_uInt16 nVal=0): SfxUInt16Item(SDRATTR_EDGELINEDELTAANZ,nVal) {}
+ SdrEdgeLineDeltaAnzItem(SvStream& rIn): SfxUInt16Item(SDRATTR_EDGELINEDELTAANZ,rIn) {}
+};
+
+class SVX_DLLPUBLIC SdrEdgeLine1DeltaItem: public SdrMetricItem {
+public:
+ SdrEdgeLine1DeltaItem(long nVal=0): SdrMetricItem(SDRATTR_EDGELINE1DELTA,nVal) {}
+ SdrEdgeLine1DeltaItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGELINE1DELTA,rIn) {}
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+class SVX_DLLPUBLIC SdrEdgeLine2DeltaItem: public SdrMetricItem {
+public:
+ SdrEdgeLine2DeltaItem(long nVal=0): SdrMetricItem(SDRATTR_EDGELINE2DELTA,nVal) {}
+ SdrEdgeLine2DeltaItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGELINE2DELTA,rIn) {}
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+class SVX_DLLPUBLIC SdrEdgeLine3DeltaItem: public SdrMetricItem {
+public:
+ SdrEdgeLine3DeltaItem(long nVal=0): SdrMetricItem(SDRATTR_EDGELINE3DELTA,nVal) {}
+ SdrEdgeLine3DeltaItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGELINE3DELTA,rIn) {}
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+#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 000000000000..cd9d09b89632
--- /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 _SXENDITM_HXX
+#define _SXENDITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdmetitm.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC SdrEdgeNode1HorzDistItem: public SdrMetricItem {
+public:
+ SdrEdgeNode1HorzDistItem(long nVal=0): SdrMetricItem(SDRATTR_EDGENODE1HORZDIST,nVal) {}
+ SdrEdgeNode1HorzDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGENODE1HORZDIST,rIn) {}
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+class SVX_DLLPUBLIC SdrEdgeNode1VertDistItem: public SdrMetricItem {
+public:
+ SdrEdgeNode1VertDistItem(long nVal=0): SdrMetricItem(SDRATTR_EDGENODE1VERTDIST,nVal) {}
+ SdrEdgeNode1VertDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGENODE1VERTDIST,rIn) {}
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+class SVX_DLLPUBLIC SdrEdgeNode2HorzDistItem: public SdrMetricItem {
+public:
+ SdrEdgeNode2HorzDistItem(long nVal=0): SdrMetricItem(SDRATTR_EDGENODE2HORZDIST,nVal) {}
+ SdrEdgeNode2HorzDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGENODE2HORZDIST,rIn) {}
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+class SVX_DLLPUBLIC SdrEdgeNode2VertDistItem: public SdrMetricItem {
+public:
+ SdrEdgeNode2VertDistItem(long nVal=0): SdrMetricItem(SDRATTR_EDGENODE2VERTDIST,nVal) {}
+ SdrEdgeNode2VertDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGENODE2VERTDIST,rIn) {}
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+class SdrEdgeNode1GlueDistItem: public SdrMetricItem {
+public:
+ SdrEdgeNode1GlueDistItem(long nVal=0): SdrMetricItem(SDRATTR_EDGENODE1GLUEDIST,nVal) {}
+ SdrEdgeNode1GlueDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGENODE1GLUEDIST,rIn) {}
+};
+
+class SdrEdgeNode2GlueDistItem: public SdrMetricItem {
+public:
+ SdrEdgeNode2GlueDistItem(long nVal=0): SdrMetricItem(SDRATTR_EDGENODE2GLUEDIST,nVal) {}
+ SdrEdgeNode2GlueDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGENODE2GLUEDIST,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxfiitm.hxx b/include/svx/sxfiitm.hxx
new file mode 100644
index 000000000000..688f54bb65d5
--- /dev/null
+++ b/include/svx/sxfiitm.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 _SFXIITM_HXX
+#define _SFXIITM_HXX
+
+#include <svl/poolitem.hxx>
+#include <tools/fract.hxx>
+
+/*************************************************************************/
+/* FractionItem */
+/*************************************************************************/
+
+class SdrFractionItem: public SfxPoolItem {
+ Fraction nValue;
+public:
+ TYPEINFO_VISIBILITY( SVX_DLLPUBLIC );
+ SdrFractionItem(sal_uInt16 nId=0): SfxPoolItem(nId) {}
+ SdrFractionItem(sal_uInt16 nId, const Fraction& rVal): SfxPoolItem(nId), nValue(rVal) {}
+ SdrFractionItem(sal_uInt16 nId, SvStream& rIn);
+ virtual int operator==(const SfxPoolItem&) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation, SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric, OUString &rText, const IntlWrapper * = 0) const;
+ virtual SfxPoolItem* Create(SvStream&, sal_uInt16 nVer) const;
+ virtual SvStream& Store(SvStream&, sal_uInt16 nItemVers) const;
+ virtual SfxPoolItem* Clone(SfxItemPool *pPool=NULL) const;
+ const Fraction& GetValue() const { return nValue; }
+ void SetValue(const Fraction& rVal) { nValue = rVal; }
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxlayitm.hxx b/include/svx/sxlayitm.hxx
new file mode 100644
index 000000000000..205e755660bb
--- /dev/null
+++ b/include/svx/sxlayitm.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 _SYLAYITM_HXX
+#define _SYLAYITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svl/stritem.hxx>
+#include <svl/intitem.hxx>
+#include <svx/svdtypes.hxx>
+
+//------------------------------
+// class SdrLayerIdItem
+//------------------------------
+class SdrLayerIdItem: public SfxUInt16Item {
+public:
+ SdrLayerIdItem(sal_uInt16 nId=0): SfxUInt16Item(SDRATTR_LAYERID,nId) {}
+ SdrLayerIdItem(SvStream& rIn): SfxUInt16Item(SDRATTR_LAYERID,rIn) {}
+ SdrLayerID GetValue() const { return (SdrLayerID)SfxUInt16Item::GetValue(); }
+};
+
+//------------------------------
+// class SdrLayerNameItem
+//------------------------------
+
+class SdrLayerNameItem: public SfxStringItem {
+public:
+ SdrLayerNameItem() : SfxStringItem() { SetWhich(SDRATTR_LAYERNAME); }
+ SdrLayerNameItem(const String& rStr) : SfxStringItem(SDRATTR_LAYERNAME,rStr) {}
+ SdrLayerNameItem(SvStream& rIn) : SfxStringItem(SDRATTR_LAYERNAME,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxlogitm.hxx b/include/svx/sxlogitm.hxx
new file mode 100644
index 000000000000..c295522fe8de
--- /dev/null
+++ b/include/svx/sxlogitm.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 _SXLOGITM_HXX
+#define _SXLOGITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdmetitm.hxx>
+
+//------------------------------
+// class SdrLogicSizeWidthItem
+//------------------------------
+class SdrLogicSizeWidthItem: public SdrMetricItem {
+public:
+ SdrLogicSizeWidthItem(long nWdt=0): SdrMetricItem(SDRATTR_LOGICSIZEWIDTH,nWdt) {}
+ SdrLogicSizeWidthItem(SvStream& rIn): SdrMetricItem(SDRATTR_LOGICSIZEWIDTH,rIn) {}
+};
+
+//------------------------------
+// class SdrLogicSizeWidthItem
+//------------------------------
+class SdrLogicSizeHeightItem: public SdrMetricItem {
+public:
+ SdrLogicSizeHeightItem(long nHgt=0): SdrMetricItem(SDRATTR_LOGICSIZEHEIGHT,nHgt) {}
+ SdrLogicSizeHeightItem(SvStream& rIn): SdrMetricItem(SDRATTR_LOGICSIZEHEIGHT,rIn) {}
+};
+
+#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 000000000000..fd32430c58c6
--- /dev/null
+++ b/include/svx/sxmbritm.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 _SXMBRITM_HXX
+#define _SXMBRITM_HXX
+
+#include <svx/svddef.hxx>
+
+#include <svx/sdynitm.hxx>
+
+// Die Masslinie unterhalb der Bezugskante
+// Zur Bemassung einer Objektunterkante
+// (Redundant zum drehen der Bezugskante um 180deg +
+// TextUpsideDown, jedoch besser bedienbar)
+// laesst sich auch draggen, indem man den Masslinienabstand
+// (SdrMeasureLineDistItem) ueber die Bezugskante hinwegdraggt
+class SdrMeasureBelowRefEdgeItem: public SdrYesNoItem {
+public:
+ SdrMeasureBelowRefEdgeItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASUREBELOWREFEDGE,bOn) {}
+ SdrMeasureBelowRefEdgeItem(SvStream& rIn): SdrYesNoItem(SDRATTR_MEASUREBELOWREFEDGE,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxmfsitm.hxx b/include/svx/sxmfsitm.hxx
new file mode 100644
index 000000000000..e24bc150c9c1
--- /dev/null
+++ b/include/svx/sxmfsitm.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 _SXMFSITM_HXX
+#define _SXMFSITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svl/stritem.hxx>
+
+// Formatstring (aehnl. Calc), z.B. "#.###,00km"
+// ueberschreibt SdrMeasureUnitItem und SdrMeasureShowUnitItem (n.i.)
+class SdrMeasureFormatStringItem: public SfxStringItem {
+public:
+ SdrMeasureFormatStringItem() : SfxStringItem() { SetWhich(SDRATTR_MEASUREFORMATSTRING); }
+ SdrMeasureFormatStringItem(const String& rStr) : SfxStringItem(SDRATTR_MEASUREFORMATSTRING,rStr) {}
+ SdrMeasureFormatStringItem(SvStream& rIn) : SfxStringItem(SDRATTR_MEASUREFORMATSTRING,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxmkitm.hxx b/include/svx/sxmkitm.hxx
new file mode 100644
index 000000000000..56fe21d7478a
--- /dev/null
+++ b/include/svx/sxmkitm.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 _SXMKITM_HXX
+#define _SXMKITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svl/eitem.hxx>
+
+enum SdrMeasureKind {SDRMEASURE_STD,SDRMEASURE_RADIUS}; // n.i.
+
+//------------------------------
+// class SdrMeasureKindItem (n.i.)
+//------------------------------
+class SdrMeasureKindItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrMeasureKindItem(SdrMeasureKind eKind=SDRMEASURE_STD): SfxEnumItem(SDRATTR_MEASUREKIND,sal::static_int_cast< sal_uInt16 >(eKind)) {}
+ SdrMeasureKindItem(SvStream& rIn) : SfxEnumItem(SDRATTR_MEASUREKIND,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const; // { return 2; }
+ SdrMeasureKind GetValue() const { return (SdrMeasureKind)SfxEnumItem::GetValue(); }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+#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 000000000000..29e46cd616c3
--- /dev/null
+++ b/include/svx/sxmlhitm.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 _SXMLHITM_HXX
+#define _SXMLHITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdmetitm.hxx>
+
+/*************************************************************************/
+/* Measure */
+/*************************************************************************/
+// ___
+// | 100,00km | 2mm = SdrMeasureHelplineOverhangItem
+// |<--------------------->|---
+// | | 8mm = SdrMeasureLineDistItem
+// | |
+// #=============# |---
+// # # | SdrMeasureHelpline1/2LenItem
+// # #=========#---
+// # Zu bemassendes Objekt #
+// #=======================#
+
+// Abstand der Masslinie zur Bezugskante (Norm=8mm)
+// laesst sich auch draggen an den beiden Handles
+// die auf den Pfeilspitzen liegen
+class SdrMeasureLineDistItem: public SdrMetricItem {
+public:
+ SdrMeasureLineDistItem(long nVal=0): SdrMetricItem(SDRATTR_MEASURELINEDIST,nVal) {}
+ SdrMeasureLineDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_MEASURELINEDIST,rIn) {}
+};
+
+// Ueberhang der Masshilfslinien an der Masslinie (Norm=2mm)
+class SdrMeasureHelplineOverhangItem: public SdrMetricItem {
+public:
+ SdrMeasureHelplineOverhangItem(long nVal=0): SdrMetricItem(SDRATTR_MEASUREHELPLINEOVERHANG,nVal) {}
+ SdrMeasureHelplineOverhangItem(SvStream& rIn): SdrMetricItem(SDRATTR_MEASUREHELPLINEOVERHANG,rIn) {}
+};
+
+// Abstand der der Masshilfslinienenden zur Bezugskante
+// Damit die Masshilfslinien nicht das Objekt beruehren
+class SdrMeasureHelplineDistItem: public SdrMetricItem {
+public:
+ SdrMeasureHelplineDistItem(long nVal=0): SdrMetricItem(SDRATTR_MEASUREHELPLINEDIST,nVal) {}
+ SdrMeasureHelplineDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_MEASUREHELPLINEDIST,rIn) {}
+};
+
+// Ueberlaenge der Hilfslinien ueber die Bezugskante
+// laesst sich auch draggen an den beiden runden Handles,
+// die sich default unter den beiden Referenzpunkten befinden
+class SdrMeasureHelpline1LenItem: public SdrMetricItem {
+public:
+ SdrMeasureHelpline1LenItem(long nVal=0): SdrMetricItem(SDRATTR_MEASUREHELPLINE1LEN,nVal) {}
+ SdrMeasureHelpline1LenItem(SvStream& rIn): SdrMetricItem(SDRATTR_MEASUREHELPLINE1LEN,rIn) {}
+};
+class SdrMeasureHelpline2LenItem: public SdrMetricItem {
+public:
+ SdrMeasureHelpline2LenItem(long nVal=0): SdrMetricItem(SDRATTR_MEASUREHELPLINE2LEN,nVal) {}
+ SdrMeasureHelpline2LenItem(SvStream& rIn): SdrMetricItem(SDRATTR_MEASUREHELPLINE2LEN,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxmoitm.hxx b/include/svx/sxmoitm.hxx
new file mode 100644
index 000000000000..8b5cfc2a9cb4
--- /dev/null
+++ b/include/svx/sxmoitm.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 _SXMOITM_HXX
+#define _SXMOITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdmetitm.hxx>
+
+// Ueberstand der Masslinie ueber die Masshilfslinien
+// Nur wenn die Masspfeile aussen sind (n.i.)
+class SdrMeasureOverhangItem: public SdrMetricItem {
+public:
+ SdrMeasureOverhangItem(long nVal=0): SdrMetricItem(SDRATTR_MEASUREOVERHANG,nVal) {}
+ SdrMeasureOverhangItem(SvStream& rIn): SdrMetricItem(SDRATTR_MEASUREOVERHANG,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxmovitm.hxx b/include/svx/sxmovitm.hxx
new file mode 100644
index 000000000000..97fa1e1f71d4
--- /dev/null
+++ b/include/svx/sxmovitm.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 _SXMOVITM_HXX
+#define _SXMOVITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdmetitm.hxx>
+
+//------------------------------
+// class SdrMoveXItem
+//------------------------------
+class SdrMoveXItem: public SdrMetricItem {
+public:
+ SdrMoveXItem(long n=0): SdrMetricItem(SDRATTR_MOVEX,n) {}
+ SdrMoveXItem(SvStream& rIn): SdrMetricItem(SDRATTR_MOVEX,rIn) {}
+};
+
+//------------------------------
+// class SdrMoveYItem
+//------------------------------
+class SdrMoveYItem: public SdrMetricItem {
+public:
+ SdrMoveYItem(long n=0): SdrMetricItem(SDRATTR_MOVEY,n) {}
+ SdrMoveYItem(SvStream& rIn): SdrMetricItem(SDRATTR_MOVEY,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxmsitm.hxx b/include/svx/sxmsitm.hxx
new file mode 100644
index 000000000000..52beec424cd6
--- /dev/null
+++ b/include/svx/sxmsitm.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 _SXMSITM_HXX
+#define _SXMSITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sxsiitm.hxx>
+
+// Massstabsvorgabe. Wenn bereits am Model ein Massstab (UIScale) gesetzt
+// ist wird dieser nicht ueberschrieben. Stattdessen werden beide Massstaebe
+// miteinander multipliziert.
+class SdrMeasureScaleItem: public SdrScaleItem {
+public:
+ SdrMeasureScaleItem() : SdrScaleItem(SDRATTR_MEASURESCALE,Fraction(1,1)) {}
+ SdrMeasureScaleItem(const Fraction& rFr): SdrScaleItem(SDRATTR_MEASURESCALE,rFr) {}
+ SdrMeasureScaleItem(SvStream& rIn) : SdrScaleItem(SDRATTR_MEASURESCALE,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxmspitm.hxx b/include/svx/sxmspitm.hxx
new file mode 100644
index 000000000000..9f4116567b05
--- /dev/null
+++ b/include/svx/sxmspitm.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 _SXMSPITM_HXX
+#define _SXMSPITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdynitm.hxx>
+
+//------------------------------
+// class SdrMoveProtectItem
+//------------------------------
+class SdrObjMoveProtectItem: public SdrYesNoItem {
+public:
+ SdrObjMoveProtectItem(bool bOn=false): SdrYesNoItem(SDRATTR_OBJMOVEPROTECT,bOn) {}
+ SdrObjMoveProtectItem(SvStream& rIn): SdrYesNoItem(SDRATTR_OBJMOVEPROTECT,rIn) {}
+};
+
+//------------------------------
+// class SdrSizeProtectItem
+//------------------------------
+class SdrObjSizeProtectItem: public SdrYesNoItem {
+public:
+ SdrObjSizeProtectItem(bool bOn=false): SdrYesNoItem(SDRATTR_OBJSIZEPROTECT,bOn) {}
+ SdrObjSizeProtectItem(SvStream& rIn): SdrYesNoItem(SDRATTR_OBJSIZEPROTECT,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxmsuitm.hxx b/include/svx/sxmsuitm.hxx
new file mode 100644
index 000000000000..679435c66656
--- /dev/null
+++ b/include/svx/sxmsuitm.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SXMSUITM_HXX
+#define _SXMSUITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdynitm.hxx>
+
+// Die Masseinheit mit anzeigen
+class SdrMeasureShowUnitItem: public SdrYesNoItem {
+public:
+ SdrMeasureShowUnitItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURESHOWUNIT,bOn) {}
+ SdrMeasureShowUnitItem(SvStream& rIn): SdrYesNoItem(SDRATTR_MEASURESHOWUNIT,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxmtaitm.hxx b/include/svx/sxmtaitm.hxx
new file mode 100644
index 000000000000..583c0b18c7a6
--- /dev/null
+++ b/include/svx/sxmtaitm.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 _SXMTAITM_HXX
+#define _SXMTAITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdynitm.hxx>
+#include <svx/sdangitm.hxx>
+
+// Den Text automatisch zurechtdrehen (Automatisches UpsideDown).
+// TextUpsideDown bleibt trotzdem weiterhin wirksam und dreht
+// den Text bei sal_True nochmal.
+class SdrMeasureTextAutoAngleItem: public SdrYesNoItem {
+public:
+ SdrMeasureTextAutoAngleItem(bool bOn=true): SdrYesNoItem(SDRATTR_MEASURETEXTAUTOANGLE,bOn) {}
+ SdrMeasureTextAutoAngleItem(SvStream& rIn): SdrYesNoItem(SDRATTR_MEASURETEXTAUTOANGLE,rIn) {}
+};
+
+// Der bevorzugte Blickwinkel zum lesen des Textes. Wird nur ausgewertet, wenn
+// TextAutoAngle=TRUE. Winkel in 1/100deg aus der Zeichnung zum Betrachter.
+class SdrMeasureTextAutoAngleViewItem: public SdrAngleItem {
+public:
+ SdrMeasureTextAutoAngleViewItem(long nVal=31500): SdrAngleItem(SDRATTR_MEASURETEXTAUTOANGLEVIEW,nVal) {}
+ SdrMeasureTextAutoAngleViewItem(SvStream& rIn): SdrAngleItem(SDRATTR_MEASURETEXTAUTOANGLEVIEW,rIn) {}
+};
+
+#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 000000000000..4be65b5d72ae
--- /dev/null
+++ b/include/svx/sxmtfitm.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 _SXMTFITM_HXX
+#define _SXMTFITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdynitm.hxx>
+#include <svx/sdangitm.hxx>
+
+// die 2 folgenden sind noch nicht implementiert!
+// Text auf einen wirklich fixen Winkel festnageln.
+// Der Textwinkel ist dann auch unabhaengig vom Winkel der Masslinie.
+// Setzt TextUpsideDown, TextRota90 sowie TextAutoAngle ausser Kraft. (n.i.)
+class SdrMeasureTextIsFixedAngleItem: public SdrYesNoItem {
+public:
+ SdrMeasureTextIsFixedAngleItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURETEXTISFIXEDANGLE,bOn) {}
+ SdrMeasureTextIsFixedAngleItem(SvStream& rIn): SdrYesNoItem(SDRATTR_MEASURETEXTISFIXEDANGLE,rIn) {}
+};
+
+// Der Winkel des Textes in 1/100deg. 0=Horizontal von links nach rechts zu lesen. (n.i.)
+class SdrMeasureTextFixedAngleItem: public SdrAngleItem {
+public:
+ SdrMeasureTextFixedAngleItem(long nVal=0): SdrAngleItem(SDRATTR_MEASURETEXTFIXEDANGLE,nVal) {}
+ SdrMeasureTextFixedAngleItem(SvStream& rIn): SdrAngleItem(SDRATTR_MEASURETEXTFIXEDANGLE,rIn) {}
+};
+
+// The decimal places used for the measure value
+class SdrMeasureDecimalPlacesItem: public SfxInt16Item {
+public:
+ SdrMeasureDecimalPlacesItem(sal_Int16 nVal=2): SfxInt16Item(SDRATTR_MEASUREDECIMALPLACES,nVal) {}
+ SdrMeasureDecimalPlacesItem(SvStream& rIn): SfxInt16Item(SDRATTR_MEASUREDECIMALPLACES,rIn) {}
+};
+
+#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 000000000000..bc4966228c8c
--- /dev/null
+++ b/include/svx/sxmtpitm.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 _SXMTPITM_HXX
+#define _SXMTPITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+enum SdrMeasureTextHPos {SDRMEASURE_TEXTHAUTO,SDRMEASURE_TEXTLEFTOUTSIDE,SDRMEASURE_TEXTINSIDE,SDRMEASURE_TEXTRIGHTOUTSIDE};
+enum SdrMeasureTextVPos {SDRMEASURE_TEXTVAUTO,SDRMEASURE_ABOVE,SDRMEASURETEXT_BREAKEDLINE,SDRMEASURE_BELOW,SDRMEASURETEXT_VERTICALCENTERED};
+
+//------------------------------
+// class SdrMeasureTextHPosItem
+//------------------------------
+class SVX_DLLPUBLIC SdrMeasureTextHPosItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrMeasureTextHPosItem(SdrMeasureTextHPos ePos=SDRMEASURE_TEXTHAUTO): SfxEnumItem(SDRATTR_MEASURETEXTHPOS,sal::static_int_cast< sal_uInt16 >(ePos)) {}
+ SdrMeasureTextHPosItem(SvStream& rIn) : SfxEnumItem(SDRATTR_MEASURETEXTHPOS,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const; // { return 4; }
+ SdrMeasureTextHPos GetValue() const { return (SdrMeasureTextHPos)SfxEnumItem::GetValue(); }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+//------------------------------
+// class SdrMeasureTextVPosItem
+//------------------------------
+class SVX_DLLPUBLIC SdrMeasureTextVPosItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrMeasureTextVPosItem(SdrMeasureTextVPos ePos=SDRMEASURE_TEXTVAUTO): SfxEnumItem(SDRATTR_MEASURETEXTVPOS,sal::static_int_cast< sal_uInt16 >(ePos)) {}
+ SdrMeasureTextVPosItem(SvStream& rIn) : SfxEnumItem(SDRATTR_MEASURETEXTVPOS,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const; // { return 5; }
+ SdrMeasureTextVPos GetValue() const { return (SdrMeasureTextVPos)SfxEnumItem::GetValue(); }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+#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 000000000000..3ad063eba082
--- /dev/null
+++ b/include/svx/sxmtritm.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 _SXMTRITM_HXX
+#define _SXMTRITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdynitm.hxx>
+
+// Den Text quer zur Masslinie (90deg Drehung nach links)
+class SdrMeasureTextRota90Item: public SdrYesNoItem {
+public:
+ SdrMeasureTextRota90Item(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURETEXTROTA90,bOn) {}
+ SdrMeasureTextRota90Item(SvStream& rIn): SdrYesNoItem(SDRATTR_MEASURETEXTROTA90,rIn) {}
+};
+
+// Das von mir berechnete TextRect um 180 deg drehen
+// Der Text wird dann aber auch auf die andere Seite der
+// Masslinie gebracht (wenn nicht Rota90)
+class SdrMeasureTextUpsideDownItem: public SdrYesNoItem {
+public:
+ SdrMeasureTextUpsideDownItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURETEXTUPSIDEDOWN,bOn) {}
+ SdrMeasureTextUpsideDownItem(SvStream& rIn): SdrYesNoItem(SDRATTR_MEASURETEXTUPSIDEDOWN,rIn) {}
+};
+
+#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 000000000000..24a07a252e7f
--- /dev/null
+++ b/include/svx/sxmuitm.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 _SXMUITM_HXX
+#define _SXMUITM_HXX
+
+#include <vcl/field.hxx>
+#include <svx/svddef.hxx>
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+// Vorgabe einer Masseinheit. Der Zahlenwert wird in diese Einheit umgerechnet
+// (ausgehend von der MapUnit des Models). Diese Einheit wird dann ggf. auch angezeigt.
+class SVX_DLLPUBLIC SdrMeasureUnitItem: public SfxEnumItem {
+public:
+ TYPEINFO();
+ SdrMeasureUnitItem(FieldUnit eUnit=FUNIT_NONE): SfxEnumItem(SDRATTR_MEASUREUNIT,sal::static_int_cast< sal_uInt16 >(eUnit)) {}
+ SdrMeasureUnitItem(SvStream& rIn) : SfxEnumItem(SDRATTR_MEASUREUNIT,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const; // { return 14; }
+ FieldUnit GetValue() const { return (FieldUnit)SfxEnumItem::GetValue(); }
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual OUString GetValueTextByPos(sal_uInt16 nPos) const;
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper * = 0) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxoneitm.hxx b/include/svx/sxoneitm.hxx
new file mode 100644
index 000000000000..cf85d629f508
--- /dev/null
+++ b/include/svx/sxoneitm.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 _SXONEITM_HXX
+#define _SXONEITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdmetitm.hxx>
+
+//------------------------------
+// class SdrOnePositionXItem
+//------------------------------
+class SdrOnePositionXItem: public SdrMetricItem {
+public:
+ SdrOnePositionXItem(long nPosX=0): SdrMetricItem(SDRATTR_ONEPOSITIONX,nPosX) {}
+ SdrOnePositionXItem(SvStream& rIn): SdrMetricItem(SDRATTR_ONEPOSITIONX,rIn) {}
+};
+
+//------------------------------
+// class SdrOnePositionYItem
+//------------------------------
+class SdrOnePositionYItem: public SdrMetricItem {
+public:
+ SdrOnePositionYItem(long nPosY=0): SdrMetricItem(SDRATTR_ONEPOSITIONY,nPosY) {}
+ SdrOnePositionYItem(SvStream& rIn): SdrMetricItem(SDRATTR_ONEPOSITIONY,rIn) {}
+};
+
+//------------------------------
+// class SdrOneSizeWidthItem
+//------------------------------
+class SdrOneSizeWidthItem: public SdrMetricItem {
+public:
+ SdrOneSizeWidthItem(long nWdt=0): SdrMetricItem(SDRATTR_ONESIZEWIDTH,nWdt) {}
+ SdrOneSizeWidthItem(SvStream& rIn): SdrMetricItem(SDRATTR_ONESIZEWIDTH,rIn) {}
+};
+
+//------------------------------
+// class SdrOneSizeWidthItem
+//------------------------------
+class SdrOneSizeHeightItem: public SdrMetricItem {
+public:
+ SdrOneSizeHeightItem(long nHgt=0): SdrMetricItem(SDRATTR_ONESIZEHEIGHT,nHgt) {}
+ SdrOneSizeHeightItem(SvStream& rIn): SdrMetricItem(SDRATTR_ONESIZEHEIGHT,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxonitm.hxx b/include/svx/sxonitm.hxx
new file mode 100644
index 000000000000..047146b4fd8b
--- /dev/null
+++ b/include/svx/sxonitm.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 _SXONITM_HXX
+#define _SXONITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svl/stritem.hxx>
+
+//------------------------------
+// class SdrObjectNameItem
+//------------------------------
+
+class SdrObjectNameItem: public SfxStringItem {
+public:
+ SdrObjectNameItem() : SfxStringItem() { SetWhich(SDRATTR_OBJECTNAME); }
+ SdrObjectNameItem(const String& rStr) : SfxStringItem(SDRATTR_OBJECTNAME,rStr) {}
+ SdrObjectNameItem(SvStream& rIn) : SfxStringItem(SDRATTR_OBJECTNAME,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxopitm.hxx b/include/svx/sxopitm.hxx
new file mode 100644
index 000000000000..4b2a3c02b7af
--- /dev/null
+++ b/include/svx/sxopitm.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 _SXOPITM_HXX
+#define _SXOPITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdynitm.hxx>
+
+//------------------------------
+// class SdrObjPrintableItem
+//------------------------------
+class SdrObjPrintableItem: public SdrYesNoItem {
+public:
+ SdrObjPrintableItem(bool bOn=false): SdrYesNoItem(SDRATTR_OBJPRINTABLE,bOn) {}
+ SdrObjPrintableItem(SvStream& rIn): SdrYesNoItem(SDRATTR_OBJPRINTABLE,rIn) {}
+};
+
+class SdrObjVisibleItem: public SdrYesNoItem {
+public:
+ SdrObjVisibleItem(bool bOn=true): SdrYesNoItem(SDRATTR_OBJVISIBLE,bOn) {}
+ SdrObjVisibleItem(SvStream& rIn): SdrYesNoItem(SDRATTR_OBJVISIBLE,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxraitm.hxx b/include/svx/sxraitm.hxx
new file mode 100644
index 000000000000..f108e720bd1b
--- /dev/null
+++ b/include/svx/sxraitm.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 _SXRAITM_HXX
+#define _SXRAITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdangitm.hxx>
+
+//------------------------------
+// class SdrRotateAngleItem
+//------------------------------
+class SdrRotateAngleItem: public SdrAngleItem {
+public:
+ SdrRotateAngleItem(long nAngle=0): SdrAngleItem(SDRATTR_ROTATEANGLE,nAngle) {}
+ SdrRotateAngleItem(SvStream& rIn): SdrAngleItem(SDRATTR_ROTATEANGLE,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxreaitm.hxx b/include/svx/sxreaitm.hxx
new file mode 100644
index 000000000000..62ff9f979289
--- /dev/null
+++ b/include/svx/sxreaitm.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 _SXREAITM_HXX
+#define _SXREAITM_HXX
+
+#include <svx/svddef.hxx>
+
+#include <svx/sxfiitm.hxx>
+
+//------------------------------
+// class SdrResizeXAllItem
+//------------------------------
+class SdrResizeXAllItem: public SdrFractionItem {
+public:
+ SdrResizeXAllItem(): SdrFractionItem(SDRATTR_RESIZEXALL,Fraction(1,1)) {}
+ SdrResizeXAllItem(const Fraction& rFact): SdrFractionItem(SDRATTR_RESIZEXALL,rFact) {}
+ SdrResizeXAllItem(SvStream& rIn): SdrFractionItem(SDRATTR_RESIZEXALL,rIn) {}
+};
+
+//------------------------------
+// class SdrResizeYAllItem
+//------------------------------
+class SdrResizeYAllItem: public SdrFractionItem {
+public:
+ SdrResizeYAllItem(): SdrFractionItem(SDRATTR_RESIZEYALL,Fraction(1,1)) {}
+ SdrResizeYAllItem(const Fraction& rFact): SdrFractionItem(SDRATTR_RESIZEYALL,rFact) {}
+ SdrResizeYAllItem(SvStream& rIn): SdrFractionItem(SDRATTR_RESIZEYALL,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxreoitm.hxx b/include/svx/sxreoitm.hxx
new file mode 100644
index 000000000000..8b5ce5ea2748
--- /dev/null
+++ b/include/svx/sxreoitm.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 _SXREOITM_HXX
+#define _SXREOITM_HXX
+
+#include <svx/svddef.hxx>
+
+#include <svx/sxfiitm.hxx>
+
+//------------------------------
+// class SdrResizeXOneItem
+//------------------------------
+class SdrResizeXOneItem: public SdrFractionItem {
+public:
+ SdrResizeXOneItem(): SdrFractionItem(SDRATTR_RESIZEXONE,Fraction(1,1)) {}
+ SdrResizeXOneItem(const Fraction& rFact): SdrFractionItem(SDRATTR_RESIZEXONE,rFact) {}
+ SdrResizeXOneItem(SvStream& rIn): SdrFractionItem(SDRATTR_RESIZEXONE,rIn) {}
+};
+
+//------------------------------
+// class SdrResizeYOneItem
+//------------------------------
+class SdrResizeYOneItem: public SdrFractionItem {
+public:
+ SdrResizeYOneItem(): SdrFractionItem(SDRATTR_RESIZEYONE,Fraction(1,1)) {}
+ SdrResizeYOneItem(const Fraction& rFact): SdrFractionItem(SDRATTR_RESIZEYONE,rFact) {}
+ SdrResizeYOneItem(SvStream& rIn): SdrFractionItem(SDRATTR_RESIZEYONE,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxroaitm.hxx b/include/svx/sxroaitm.hxx
new file mode 100644
index 000000000000..bf9b2b6ef247
--- /dev/null
+++ b/include/svx/sxroaitm.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 _SXROAITM_HXX
+#define _SXROAITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdangitm.hxx>
+
+//------------------------------
+// class SdrRotateAllItem
+//------------------------------
+class SdrRotateAllItem: public SdrAngleItem {
+public:
+ SdrRotateAllItem(long nAngle=0): SdrAngleItem(SDRATTR_ROTATEALL,nAngle) {}
+ SdrRotateAllItem(SvStream& rIn): SdrAngleItem(SDRATTR_ROTATEALL,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxrooitm.hxx b/include/svx/sxrooitm.hxx
new file mode 100644
index 000000000000..ec171996ebb1
--- /dev/null
+++ b/include/svx/sxrooitm.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 _SXROOITM_HXX
+#define _SXROOITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdangitm.hxx>
+
+//------------------------------
+// class SdrRotateOneItem
+//------------------------------
+class SdrRotateOneItem: public SdrAngleItem {
+public:
+ SdrRotateOneItem(long nAngle=0): SdrAngleItem(SDRATTR_ROTATEONE,nAngle) {}
+ SdrRotateOneItem(SvStream& rIn): SdrAngleItem(SDRATTR_ROTATEONE,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxsaitm.hxx b/include/svx/sxsaitm.hxx
new file mode 100644
index 000000000000..1085b0d21fe3
--- /dev/null
+++ b/include/svx/sxsaitm.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 _SXSAITM_HXX
+#define _SXSAITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdangitm.hxx>
+
+//------------------------------
+// class SdrShearAngleItem
+//------------------------------
+class SdrShearAngleItem: public SdrAngleItem {
+public:
+ SdrShearAngleItem(long nAngle=0): SdrAngleItem(SDRATTR_SHEARANGLE,nAngle) {}
+ SdrShearAngleItem(SvStream& rIn): SdrAngleItem(SDRATTR_SHEARANGLE,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxsalitm.hxx b/include/svx/sxsalitm.hxx
new file mode 100644
index 000000000000..2d70e2ba480f
--- /dev/null
+++ b/include/svx/sxsalitm.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 _SXSALITM_HXX
+#define _SXSALITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdangitm.hxx>
+
+//------------------------------
+// class SdrHorzShearAllItem
+//------------------------------
+class SdrHorzShearAllItem: public SdrAngleItem {
+public:
+ SdrHorzShearAllItem(long nAngle=0): SdrAngleItem(SDRATTR_HORZSHEARALL,nAngle) {}
+ SdrHorzShearAllItem(SvStream& rIn): SdrAngleItem(SDRATTR_HORZSHEARALL,rIn) {}
+};
+
+//------------------------------
+// class SdrVertShearAllItem
+//------------------------------
+class SdrVertShearAllItem: public SdrAngleItem {
+public:
+ SdrVertShearAllItem(long nAngle=0): SdrAngleItem(SDRATTR_VERTSHEARALL,nAngle) {}
+ SdrVertShearAllItem(SvStream& rIn): SdrAngleItem(SDRATTR_VERTSHEARALL,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxsiitm.hxx b/include/svx/sxsiitm.hxx
new file mode 100644
index 000000000000..e2a0052eff67
--- /dev/null
+++ b/include/svx/sxsiitm.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 _SXSIITM_HXX
+#define _SXSIITM_HXX
+
+#include <svx/sxfiitm.hxx>
+
+class SdrScaleItem: public SdrFractionItem {
+public:
+ TYPEINFO();
+ SdrScaleItem(sal_uInt16 nId=0): SdrFractionItem(nId,Fraction(1,1)) {}
+ SdrScaleItem(sal_uInt16 nId, const Fraction& rVal): SdrFractionItem(nId,rVal) {}
+ SdrScaleItem(sal_uInt16 nId, SvStream& rIn): SdrFractionItem(nId,rIn) {}
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation, SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric, OUString &rText, const IntlWrapper * = 0) const;
+ virtual SfxPoolItem* Create(SvStream&, sal_uInt16 nVer) const;
+ virtual SfxPoolItem* Clone(SfxItemPool *pPool=NULL) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxsoitm.hxx b/include/svx/sxsoitm.hxx
new file mode 100644
index 000000000000..cf7b1ae84c57
--- /dev/null
+++ b/include/svx/sxsoitm.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 _SXSOITM_HXX
+#define _SXSOITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdangitm.hxx>
+
+//------------------------------
+// class SdrHorzShearOneItem
+//------------------------------
+class SdrHorzShearOneItem: public SdrAngleItem {
+public:
+ SdrHorzShearOneItem(long nAngle=0): SdrAngleItem(SDRATTR_HORZSHEARONE,nAngle) {}
+ SdrHorzShearOneItem(SvStream& rIn): SdrAngleItem(SDRATTR_HORZSHEARONE,rIn) {}
+};
+
+//------------------------------
+// class SdrVertShearOneItem
+//------------------------------
+class SdrVertShearOneItem: public SdrAngleItem {
+public:
+ SdrVertShearOneItem(long nAngle=0): SdrAngleItem(SDRATTR_VERTSHEARONE,nAngle) {}
+ SdrVertShearOneItem(SvStream& rIn): SdrAngleItem(SDRATTR_VERTSHEARONE,rIn) {}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sxtraitm.hxx b/include/svx/sxtraitm.hxx
new file mode 100644
index 000000000000..fb60bc54f53e
--- /dev/null
+++ b/include/svx/sxtraitm.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 _SXTRAITM_HXX
+#define _SXTRAITM_HXX
+
+#include <svx/svddef.hxx>
+#include <svx/sdmetitm.hxx>
+
+//------------------------------
+// class SdrTransformRef1XItem
+//------------------------------
+class SdrTransformRef1XItem: public SdrMetricItem {
+public:
+ SdrTransformRef1XItem(long nHgt=0): SdrMetricItem(SDRATTR_TRANSFORMREF1X,nHgt) {}
+ SdrTransformRef1XItem(SvStream& rIn): SdrMetricItem(SDRATTR_TRANSFORMREF1X,rIn) {}
+};
+
+//------------------------------
+// class SdrTransformRef1YItem
+//------------------------------
+class SdrTransformRef1YItem: public SdrMetricItem {
+public:
+ SdrTransformRef1YItem(long nHgt=0): SdrMetricItem(SDRATTR_TRANSFORMREF1Y,nHgt) {}
+ SdrTransformRef1YItem(SvStream& rIn): SdrMetricItem(SDRATTR_TRANSFORMREF1Y,rIn) {}
+};
+
+//------------------------------
+// class SdrTransformRef2XItem
+//------------------------------
+class SdrTransformRef2XItem: public SdrMetricItem {
+public:
+ SdrTransformRef2XItem(long nHgt=0): SdrMetricItem(SDRATTR_TRANSFORMREF2X,nHgt) {}
+ SdrTransformRef2XItem(SvStream& rIn): SdrMetricItem(SDRATTR_TRANSFORMREF2X,rIn) {}
+};
+
+//------------------------------
+// class SdrTransformRef2YItem
+//------------------------------
+class SdrTransformRef2YItem: public SdrMetricItem {
+public:
+ SdrTransformRef2YItem(long nHgt=0): SdrMetricItem(SDRATTR_TRANSFORMREF2Y,nHgt) {}
+ SdrTransformRef2YItem(SvStream& rIn): SdrMetricItem(SDRATTR_TRANSFORMREF2Y,rIn) {}
+};
+
+#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 000000000000..aa49d2a5fe94
--- /dev/null
+++ b/include/svx/tabarea.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 _SVX_TAB_AREA_HXX
+#define _SVX_TAB_AREA_HXX
+
+// enum ------------------------------------------------------------------
+
+enum ColorModel
+{
+ CM_RGB,
+ CM_CMYK // kann um weitere Modelle, z.B. HSV erweitert werden
+};
+
+enum PageType
+{
+ PT_AREA,
+ PT_GRADIENT,
+ PT_HATCH,
+ PT_BITMAP,
+ PT_COLOR,
+ PT_SHADOW,
+ PT_TRANSPARENCE
+};
+
+// define ----------------------------------------------------------------
+
+typedef sal_uInt16 ChangeType; // auch in tab_line.hxx (mitpflegen !!!)
+
+#define CT_NONE ( (ChangeType) 0x0000 )
+#define CT_MODIFIED ( (ChangeType) 0x0001 )
+#define CT_CHANGED ( (ChangeType) 0x0002 )
+#define CT_SAVED ( (ChangeType) 0x0004 )
+
+#endif // _SVX_TAB_AREA_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 000000000000..aa415988e197
--- /dev/null
+++ b/include/svx/tabline.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 _SVX_TAB_LINE_HXX
+#define _SVX_TAB_LINE_HXX
+
+#include <vcl/button.hxx>
+#include <vcl/group.hxx>
+#include <svtools/stdctrl.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/xlineit0.hxx>
+#include <svx/xlineit.hxx>
+#include <svx/xsetit.hxx>
+#include <svx/dlgctrl.hxx>
+#include <vcl/menubtn.hxx>
+class SvxBrushItem;
+// define ----------------------------------------------------------------
+
+typedef sal_uInt16 ChangeType; // auch in tab_area.hxx (mitpflegen !!!)
+
+#define CT_NONE ( (ChangeType) 0x0000 )
+#define CT_MODIFIED ( (ChangeType) 0x0001 )
+#define CT_CHANGED ( (ChangeType) 0x0002 )
+#define CT_SAVED ( (ChangeType) 0x0004 )
+
+class SdrModel;
+class SdrObject;
+
+//defines fuer die Symbolauswahl auf der Page
+//Positive Werte (0,...n) gibt den Indes in pSymbollist an, sonst :
+#define SVX_SYMBOLTYPE_NONE (-3) //Symbol unsichtbar
+#define SVX_SYMBOLTYPE_AUTO (-2) //Symbol automatisch erzeugen
+#define SVX_SYMBOLTYPE_BRUSHITEM (-1) //Symbol ist als Graphic im Item enthalten:
+#define SVX_SYMBOLTYPE_UNKNOWN (-100) //unbekannt/nicht initialisiert
+
+#endif // _SVX_TAB_LINE_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 000000000000..b4bffeee4831
--- /dev/null
+++ b/include/svx/tbcontrl.hxx
@@ -0,0 +1,389 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_TBCONTRL_HXX
+#define _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)
+
+ SvxFontColorToolBoxControl
+ --------------------------
+ Item type: SvxFontColorItem
+ Execute-Id: SID_ATTR_CHAR_COLOR
+ -> SvxFontColorItem
+ Additional information
+ from DocShell: presently none
+ in future: color palette
+
+ class SvxColorExtToolBoxControl
+ -----------------------------------
+ Item type: SvxColorItem
+ and SfxBoolItem
+
+ for font color (writer, ...)
+ Execute-Id SID_ATTR_CHAR_COLOR2
+ and SID_ATTR_CHAR_COLOR_EXT
+
+ for cell color (calc)
+ 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)
+ Execute-Id SID_BACKGROUND_COLOR
+
+ for cell background color (calc)
+ Execute-Id SID_ATTR_CHAR_COLOR_BACKGROUND
+
+ for table/cell border color (writer, calc)
+ Execute-Id SID_FRAME_LINECOLOR
+
+ SvxColorToolBoxControl
+ --------------------------------
+ Item type: SvxBrushItem
+ Execute-Id: SID_BACKGROUND_COLOR
+ -> SvxColorItem
+
+ 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
+ Bemerkung: provides dependant of chosen ValueSet-Item
+ only SvxBoxItem or additionally SvxBoxInfoItem
+ If the Controller ein 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 Tabel mode.
+
+ SvxFrameLineStyleToolBoxControl
+ -------------------------------
+ Item type: SvxLineItem
+ Execute-Id: SID_FRAME_LINESTYLE
+ -> SvxLineItem
+ Additional information
+ from DocShell: none
+ Bemerkung: provides a SvxLineItem, which provides a SvxBorderLine
+ without color information.
+
+ SvxFrameLineColorToolBoxControl
+ -------------------------------
+ Item type: SvxColorItem
+ Execute-Id: SID_FRAME_LINECOLOR
+ -> SvxColorItem
+ Additional information
+ from DocShell: none
+
+ SvxStyleToolBoxControl
+ ----------------------
+ Item type: SfxTemplateItem
+ Execute-Id: SID_TEMPLATE_APPLY
+ -> StyleName (SfxStringItem)
+ -> eStyleFamily (SfxUInt16Item)
+ Additional information
+ from DocShell: none
+ Bemerkung: Switch family by Invalidate
+ at the Bindings (->SfxStyleControllerItem)
+
+\*--------------------------------------------------------------*/
+
+// ITEMID_...-Defines i *.cxx
+
+#include <rsc/rscsfx.hxx>
+#include <svl/lstner.hxx>
+#include <sfx2/tbxctrl.hxx>
+#include <svx/strarray.hxx>
+#include "svx/svxdllapi.h"
+
+#include <com/sun/star/awt/FontDescriptor.hpp>
+
+// important im tbxctrls.hxx created HeDaBu !!!
+class SvxLineItem;
+class SvxBoxInfoItem;
+class SvxFontItem;
+class SfxStyleControllerItem_Impl;
+class SfxStyleSheetBasePool;
+class SfxTemplateItem;
+
+namespace svx
+{
+ class ToolboxButtonColorUpdater;
+}
+//########################################################################
+
+//========================================================================
+// class SvxStyleToolBoxControl ------------------------------------------
+//========================================================================
+class SVX_DLLPUBLIC SvxStyleToolBoxControl : public SfxToolBoxControl
+{
+ struct Impl;
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxStyleToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxStyleToolBoxControl();
+
+ virtual Window* CreateItemWindow( Window *pParent );
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+
+ DECL_LINK( VisibilityNotification, void* );
+protected:
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XUpdatable
+ virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+
+private:
+
+#define MAX_FAMILIES 5
+
+ SfxStyleSheetBasePool* pStyleSheetPool;
+ SfxStyleControllerItem_Impl* pBoundItems [MAX_FAMILIES];
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xBoundItems[MAX_FAMILIES];
+ SfxTemplateItem* pFamilyState[MAX_FAMILIES];
+ sal_uInt16 nActFamily; // Id in the ToolBox = Position - 1
+ String aCurSel;
+ Impl* pImpl;
+
+ SVX_DLLPRIVATE void Update();
+ SVX_DLLPRIVATE void FillStyleBox();
+ SVX_DLLPRIVATE void SelectStyle( const String& rStyleName );
+
+friend class SfxStyleControllerItem_Impl;
+
+ SVX_DLLPRIVATE void SetFamilyState ( sal_uInt16 nIdx, const SfxTemplateItem* pItem );
+ SVX_DLLPRIVATE SfxStyleFamily GetActFamily ();
+};
+
+//========================================================================
+// class SvxFontNameToolBoxControl ---------------------------------------
+//========================================================================
+
+
+class SVX_DLLPUBLIC SvxFontNameToolBoxControl : public SfxToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxFontNameToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+
+ virtual void StateChanged ( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual Window* CreateItemWindow ( Window *pParent );
+};
+
+
+
+//========================================================================
+// class SvxFontColorToolBoxControl --------------------------------------
+//========================================================================
+
+
+
+class SVX_DLLPUBLIC SvxFontColorToolBoxControl : public SfxToolBoxControl
+{
+ ::svx::ToolboxButtonColorUpdater* pBtnUpdater;
+ Color mLastColor;
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxFontColorToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxFontColorToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+};
+
+
+
+//========================================================================
+// class SvxColorExtToolBoxControl --------------------------------------
+//========================================================================
+
+
+
+class SVX_DLLPUBLIC SvxColorExtToolBoxControl : public SfxToolBoxControl
+{
+ using SfxToolBoxControl::StateChanged;
+ using SfxToolBoxControl::Select;
+
+ // SfxStatusForwarder aForward;
+ ::svx::ToolboxButtonColorUpdater* pBtnUpdater;
+ Color mLastColor;
+ sal_Bool bChoiceFromPalette;
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxColorExtToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxColorExtToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+ virtual void Select( sal_Bool bMod1 = sal_False );
+};
+
+
+
+//========================================================================
+// class SvxColorToolBoxControl ------------------------------------------
+//========================================================================
+
+
+class SVX_DLLPUBLIC SvxColorToolBoxControl : public SfxToolBoxControl
+{
+ ::svx::ToolboxButtonColorUpdater* pBtnUpdater;
+ Color mLastColor;
+
+public:
+ SvxColorToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxColorToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+};
+
+
+
+//========================================================================
+// class SvxFrameToolBoxControl ------------------------------------------
+//========================================================================
+
+
+class SVX_DLLPUBLIC SvxFrameToolBoxControl : public SfxToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxFrameToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+
+};
+
+
+
+//========================================================================
+// class SvxLineStyleToolBoxControl --------------------------------------
+//========================================================================
+
+
+class SVX_DLLPUBLIC SvxFrameLineStyleToolBoxControl : public SfxToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxFrameLineStyleToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+};
+
+
+
+//========================================================================
+// class SvxFrameLineColorToolBoxControl ---------------------------------
+//========================================================================
+
+
+class SVX_DLLPUBLIC SvxFrameLineColorToolBoxControl : public SfxToolBoxControl
+{
+ ::svx::ToolboxButtonColorUpdater* pBtnUpdater;
+ Color mLastColor;
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxFrameLineColorToolBoxControl( sal_uInt16 nSlotId,
+ sal_uInt16 nId,
+ ToolBox& rTbx );
+ ~SvxFrameLineColorToolBoxControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+};
+
+class SVX_DLLPUBLIC SvxSimpleUndoRedoController : public SfxToolBoxControl
+{
+private:
+ OUString aDefaultText;
+
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxSimpleUndoRedoController( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxSimpleUndoRedoController();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+};
+
+#endif // #ifndef _SVX_TBCONTRL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/tbxalign.hxx b/include/svx/tbxalign.hxx
new file mode 100644
index 000000000000..e41a07813404
--- /dev/null
+++ b/include/svx/tbxalign.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 _TBXALIGN_HXX
+#define _TBXALIGN_HXX
+
+#include <sfx2/tbxctrl.hxx>
+#include "svx/svxdllapi.h"
+
+
+class SVX_DLLPUBLIC SvxTbxCtlAlign: public SfxToolBoxControl
+{
+public:
+ virtual ::sal_Bool SAL_CALL opensSubToolbar() throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getSubToolbarName() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL functionSelected( const OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateImage() throw (::com::sun::star::uno::RuntimeException);
+
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxTbxCtlAlign( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxTbxCtlAlign() {}
+private:
+ OUString m_aSubTbName;
+ OUString m_aSubTbResName;
+ OUString m_aCommand;
+};
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/tbxcolor.hxx b/include/svx/tbxcolor.hxx
new file mode 100644
index 000000000000..e0a1d27f1aec
--- /dev/null
+++ b/include/svx/tbxcolor.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 _SVX_TBXCOLOR_HXX
+#define _SVX_TBXCOLOR_HXX
+
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include "svx/svxdllapi.h"
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+ //====================================================================
+ //= ToolboxAccess
+ //====================================================================
+ class SVX_DLLPUBLIC ToolboxAccess
+ {
+ private:
+ bool m_bDocking;
+ OUString m_sToolboxResName;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::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;
+
+ /** forces that the toolbox is docked
+ */
+ inline void forceDocking() { m_bDocking = true; }
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // #ifndef _SVX_TBXCOLOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/tbxcolorupdate.hxx b/include/svx/tbxcolorupdate.hxx
new file mode 100644
index 000000000000..0df0efde4090
--- /dev/null
+++ b/include/svx/tbxcolorupdate.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 SVX_TBXCOLORUPDATE_HXX
+#define SVX_TBXCOLORUPDATE_HXX
+
+#include <svx/svxdllapi.h>
+
+#include <tools/gen.hxx>
+#include <tools/color.hxx>
+
+class ToolBox;
+class VirtualDevice;
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+#define TBX_UPDATER_MODE_NONE 0x00
+#define TBX_UPDATER_MODE_CHAR_COLOR 0x01
+#define TBX_UPDATER_MODE_CHAR_BACKGROUND 0x02
+#define TBX_UPDATER_MODE_CHAR_COLOR_NEW 0x03
+
+ //====================================================================
+ //= 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 SVX_DLLPUBLIC ToolboxButtonColorUpdater
+ {
+ public:
+ ToolboxButtonColorUpdater( sal_uInt16 nSlotId,
+ sal_uInt16 nTbxBtnId,
+ ToolBox* ptrTbx,
+ sal_uInt16 nMode = 0 );
+ ~ToolboxButtonColorUpdater();
+
+ void Update( const Color& rColor );
+
+ private:
+ sal_uInt16 mnDrawMode;
+ sal_uInt16 mnBtnId;
+ sal_uInt16 mnSlotId;
+ ToolBox* mpTbx;
+ Color maCurColor;
+ Rectangle maUpdRect;
+ Size maBmpSize;
+ sal_Bool mbWasHiContrastMode;
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // 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 000000000000..07cf3a57c5ae
--- /dev/null
+++ b/include/svx/tbxctl.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 _TBXCTL_HXX
+#define _TBXCTL_HXX
+
+#include <sfx2/tbxctrl.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* Class for SwToolbox
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxTbxCtlDraw : public SfxToolBoxControl
+{
+private:
+ OUString m_sToolboxName;
+
+ void toggleToolbox();
+
+protected:
+ using SfxToolBoxControl::Select;
+
+public:
+ SvxTbxCtlDraw( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxTbxCtlDraw() {}
+
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ virtual void Select( sal_Bool bMod1 = sal_False );
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/tbxcustomshapes.hxx b/include/svx/tbxcustomshapes.hxx
new file mode 100644
index 000000000000..66fde8a2cb79
--- /dev/null
+++ b/include/svx/tbxcustomshapes.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 _SVX_TBXCUSTOMSHAPES_HXX
+#define _SVX_TBXCUSTOMSHAPES_HXX
+
+#include <sfx2/tbxctrl.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* SvxTbxCtlCustomShapes
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC SvxTbxCtlCustomShapes : public SfxToolBoxControl
+{
+public:
+ using SfxToolBoxControl::Select;
+ virtual void Select( sal_Bool bMod1 = sal_False );
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SvxTbxCtlCustomShapes( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxTbxCtlCustomShapes() {}
+
+ //interface XSubToolbarController:
+ virtual ::sal_Bool SAL_CALL opensSubToolbar() throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getSubToolbarName() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL functionSelected( const OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateImage() throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ OUString m_aSubTbName;
+ OUString m_aSubTbxResName;
+ OUString m_aCommand;
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/tbxdraw.hxx b/include/svx/tbxdraw.hxx
new file mode 100644
index 000000000000..f905cc657406
--- /dev/null
+++ b/include/svx/tbxdraw.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 _TBXDRAW_HXX
+#define _TBXDRAW_HXX
+
+#include <sfx2/tbxctrl.hxx>
+
+// class SvxPopupWindowTbxMgr --------------------------------------------
+
+class SvxPopupWindowTbxMgr : public SfxPopupWindow
+{
+ void* pNiemalsDenPointerAufDieErzeugendeToolBoxMerken; // MI!
+ ResId aRIdWinTemp;
+ ResId aRIdTbxTemp;
+
+ Link aTbxClickHdl;
+
+
+ DECL_LINK( TbxSelectHdl, ToolBox*);
+ DECL_LINK( TbxClickHdl, ToolBox*);
+
+protected:
+ using SfxPopupWindow::StateChanged;
+
+public:
+ SvxPopupWindowTbxMgr( sal_uInt16 nId,
+ SfxToolBoxControl* pTbxCtl,
+ ResId aRIdWin,
+ ResId aRIdTbx );
+ SvxPopupWindowTbxMgr( sal_uInt16 nId,
+ WindowAlign eAlign,
+ ResId aRIdWin,
+ ResId aRIdTbx );
+ ~SvxPopupWindowTbxMgr();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState);
+ virtual SfxPopupWindow* Clone() const;
+ virtual void PopupModeEnd();
+
+ void StartSelection();
+
+ // toolbox click or execute may chage the default selection in the tools toolbox
+ virtual void UserEvent( sal_uIntPtr nEvent, void* pEventData );
+};
+
+
+#endif // _TBX_DRAW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/txencbox.hxx b/include/svx/txencbox.hxx
new file mode 100644
index 000000000000..b8b470116019
--- /dev/null
+++ b/include/svx/txencbox.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 _SVX_TXENCBOX_HXX
+#define _SVX_TXENCBOX_HXX
+
+#include <vcl/lstbox.hxx>
+#include <rtl/textenc.h>
+#include "svx/svxdllapi.h"
+
+class SvxTextEncodingTable;
+
+class SVX_DLLPUBLIC SvxTextEncodingBox : public ListBox
+{
+private:
+ const SvxTextEncodingTable* m_pEncTable;
+
+ SVX_DLLPRIVATE sal_uInt16 EncodingToPos_Impl( rtl_TextEncoding nEnc ) const;
+
+public:
+ SvxTextEncodingBox( Window* pParent, const ResId& rResId );
+ SvxTextEncodingBox( Window* pParent, WinBits nBits );
+ ~SvxTextEncodingBox();
+
+ /** Fill with all known encodings but exclude those matching one or more
+ given flags as defined in rtl/tencinfo.h
+
+ <p> 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 </p>
+
+ @param bExcludeImportSubsets
+ If <TRUE/>, 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
+ <TRUE/> whenever the box is used in import dialogs. */
+ void FillFromTextEncodingTable(
+ sal_Bool bExcludeImportSubsets = sal_False,
+ 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
+
+ <p> 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 </p>
+
+ @param bExcludeImportSubsets
+ If <TRUE/>, 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
+ <TRUE/> whenever the box is used in import dialogs. */
+ void FillFromDbTextEncodingMap(
+ sal_Bool bExcludeImportSubsets = sal_False,
+ sal_uInt32 nExcludeInfoFlags = 0,
+ sal_uInt32 nButIncludeInfoFlags = 0
+ );
+
+ /** Fill with all known MIME encodings and select the best according to
+ <method>GetBestMimeEncoding</method>
+ */
+ void FillWithMimeAndSelectBest();
+
+ const SvxTextEncodingTable* GetTextEncodingTable() const
+ { return m_pEncTable; }
+
+ void InsertTextEncoding( const rtl_TextEncoding nEnc,
+ sal_uInt16 nPos = LISTBOX_APPEND );
+
+ void InsertTextEncoding( const rtl_TextEncoding nEnc,
+ const String& rEntry,
+ sal_uInt16 nPos = LISTBOX_APPEND );
+
+ void SelectTextEncoding( const rtl_TextEncoding nEnc,
+ sal_Bool bSelect = sal_True );
+
+ rtl_TextEncoding GetSelectTextEncoding() const;
+
+ const String& GetSelectTextString() const;
+};
+
+#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 000000000000..0b8d14e89b74
--- /dev/null
+++ b/include/svx/txenctab.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 _SVX_TXENCTAB_HXX
+#define _SVX_TXENCTAB_HXX
+
+#include <tools/resary.hxx>
+#include <rtl/textenc.h>
+#include "svx/svxdllapi.h"
+
+
+//========================================================================
+// class SvxTextEncodingTable
+//========================================================================
+
+class SVX_DLLPUBLIC SvxTextEncodingTable : public ResStringArray
+{
+public:
+ SvxTextEncodingTable();
+ ~SvxTextEncodingTable();
+
+ const OUString GetTextString( const rtl_TextEncoding nEnc ) const;
+ rtl_TextEncoding GetTextEncoding( const String& rStr ) const;
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/ucsubset.hrc b/include/svx/ucsubset.hrc
new file mode 100644
index 000000000000..f41d223fa13e
--- /dev/null
+++ b/include/svx/ucsubset.hrc
@@ -0,0 +1,255 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <svx/dialogs.hrc>
+
+// strings for unicode range descriptions (used e.g. by Charmap dialog)
+// (see the Unicode spec and TrueType::OS2.ulUnicodeRange description)
+#define RID_SUBSETMAP 1243
+#define RID_SUBSET_START (RID_SVX_START + 901)
+
+#define RID_SUBSETSTR_BASIC_LATIN (RID_SUBSET_START + 0)
+#define RID_SUBSETSTR_LATIN_1 (RID_SUBSET_START + 1)
+#define RID_SUBSETSTR_LATIN_EXTENDED_A (RID_SUBSET_START + 2)
+#define RID_SUBSETSTR_LATIN_EXTENDED_B (RID_SUBSET_START + 3)
+#define RID_SUBSETSTR_IPA_EXTENSIONS (RID_SUBSET_START + 4)
+#define RID_SUBSETSTR_SPACING_MODIFIERS (RID_SUBSET_START + 5)
+#define RID_SUBSETSTR_COMB_DIACRITICAL (RID_SUBSET_START + 6)
+#define RID_SUBSETSTR_BASIC_GREEK (RID_SUBSET_START + 7)
+#define RID_SUBSETSTR_GREEK_SYMS_COPTIC (RID_SUBSET_START + 8)
+#define RID_SUBSETSTR_CYRILLIC (RID_SUBSET_START + 9)
+#define RID_SUBSETSTR_ARMENIAN (RID_SUBSET_START + 10)
+#define RID_SUBSETSTR_HEBREW_EXTENDED (RID_SUBSET_START + 11)
+#define RID_SUBSETSTR_BASIC_HEBREW (RID_SUBSET_START + 12)
+#define RID_SUBSETSTR_BASIC_ARABIC (RID_SUBSET_START + 13)
+#define RID_SUBSETSTR_ARABIC_EXTENDED (RID_SUBSET_START + 14)
+#define RID_SUBSETSTR_DEVANAGARI (RID_SUBSET_START + 15)
+#define RID_SUBSETSTR_BENGALI (RID_SUBSET_START + 16)
+#define RID_SUBSETSTR_GURMUKHI (RID_SUBSET_START + 17)
+#define RID_SUBSETSTR_GUJARATI (RID_SUBSET_START + 18)
+#define RID_SUBSETSTR_ORIYA (RID_SUBSET_START + 19)
+#define RID_SUBSETSTR_TAMIL (RID_SUBSET_START + 20)
+#define RID_SUBSETSTR_TELUGU (RID_SUBSET_START + 21)
+#define RID_SUBSETSTR_KANNADA (RID_SUBSET_START + 22)
+#define RID_SUBSETSTR_MALAYALAM (RID_SUBSET_START + 23)
+#define RID_SUBSETSTR_THAI (RID_SUBSET_START + 24)
+#define RID_SUBSETSTR_LAO (RID_SUBSET_START + 25)
+#define RID_SUBSETSTR_BASIC_GEORGIAN (RID_SUBSET_START + 26)
+#define RID_SUBSETSTR_GEORGIAN_EXTENDED (RID_SUBSET_START + 27)
+#define RID_SUBSETSTR_HANGUL_JAMO (RID_SUBSET_START + 28)
+#define RID_SUBSETSTR_LATIN_EXTENDED_ADDS (RID_SUBSET_START + 29)
+#define RID_SUBSETSTR_GREEK_EXTENDED (RID_SUBSET_START + 30)
+#define RID_SUBSETSTR_GENERAL_PUNCTUATION (RID_SUBSET_START + 31)
+#define RID_SUBSETSTR_SUB_SUPER_SCRIPTS (RID_SUBSET_START + 32)
+#define RID_SUBSETSTR_CURRENCY_SYMBOLS (RID_SUBSET_START + 33)
+#define RID_SUBSETSTR_COMB_DIACRITIC_SYMS (RID_SUBSET_START + 34)
+#define RID_SUBSETSTR_LETTERLIKE_SYMBOLS (RID_SUBSET_START + 35)
+#define RID_SUBSETSTR_NUMBER_FORMS (RID_SUBSET_START + 36)
+#define RID_SUBSETSTR_ARROWS (RID_SUBSET_START + 37)
+#define RID_SUBSETSTR_MATH_OPERATORS (RID_SUBSET_START + 38)
+#define RID_SUBSETSTR_MISC_TECHNICAL (RID_SUBSET_START + 39)
+#define RID_SUBSETSTR_CONTROL_PICTURES (RID_SUBSET_START + 40)
+#define RID_SUBSETSTR_OPTICAL_CHAR_REC (RID_SUBSET_START + 41)
+#define RID_SUBSETSTR_ENCLOSED_ALPHANUM (RID_SUBSET_START + 42)
+#define RID_SUBSETSTR_BOX_DRAWING (RID_SUBSET_START + 43)
+#define RID_SUBSETSTR_BLOCK_ELEMENTS (RID_SUBSET_START + 44)
+#define RID_SUBSETSTR_GEOMETRIC_SHAPES (RID_SUBSET_START + 45)
+#define RID_SUBSETSTR_MISC_DINGBATS (RID_SUBSET_START + 46)
+#define RID_SUBSETSTR_DINGBATS (RID_SUBSET_START + 47)
+#define RID_SUBSETSTR_CJK_SYMS_PUNCTUATION (RID_SUBSET_START + 48)
+#define RID_SUBSETSTR_HIRAGANA (RID_SUBSET_START + 49)
+#define RID_SUBSETSTR_KATAKANA (RID_SUBSET_START + 50)
+#define RID_SUBSETSTR_BOPOMOFO (RID_SUBSET_START + 51)
+#define RID_SUBSETSTR_HANGUL_COMPAT_JAMO (RID_SUBSET_START + 52)
+#define RID_SUBSETSTR_CJK_MISC (RID_SUBSET_START + 53)
+#define RID_SUBSETSTR_ENCLOSED_CJK_LETTERS (RID_SUBSET_START + 54)
+#define RID_SUBSETSTR_CJK_COMPATIBILITY (RID_SUBSET_START + 55)
+#define RID_SUBSETSTR_HANGUL (RID_SUBSET_START + 56)
+
+#define RID_SUBSETSTR_CJK_UNIFIED_IDGRAPH (RID_SUBSET_START + 59)
+#define RID_SUBSETSTR_PRIVATE_USE_AREA (RID_SUBSET_START + 60)
+#define RID_SUBSETSTR_CJK_COMPAT_IDGRAPHS (RID_SUBSET_START + 61)
+#define RID_SUBSETSTR_ALPHA_PRESENTATION (RID_SUBSET_START + 62)
+#define RID_SUBSETSTR_ARABIC_PRESENT_A (RID_SUBSET_START + 63)
+#define RID_SUBSETSTR_COMBINING_HALF_MARKS (RID_SUBSET_START + 64)
+#define RID_SUBSETSTR_CJK_COMPAT_FORMS (RID_SUBSET_START + 65)
+#define RID_SUBSETSTR_SMALL_FORM_VARIANTS (RID_SUBSET_START + 66)
+#define RID_SUBSETSTR_ARABIC_PRESENT_B (RID_SUBSET_START + 67)
+#define RID_SUBSETSTR_HALFW_FULLW_FORMS (RID_SUBSET_START + 68)
+#define RID_SUBSETSTR_SPECIALS (RID_SUBSET_START + 69)
+
+#define RID_SUBSETSTR_YI_SYLLABLES (RID_SUBSET_START + 70)
+#define RID_SUBSETSTR_YI_RADICALS (RID_SUBSET_START + 71)
+#define RID_SUBSETSTR_OLD_ITALIC (RID_SUBSET_START + 72)
+#define RID_SUBSETSTR_GOTHIC (RID_SUBSET_START + 73)
+#define RID_SUBSETSTR_DESERET (RID_SUBSET_START + 74)
+#define RID_SUBSETSTR_BYZANTINE_MUSICAL_SYMBOLS (RID_SUBSET_START + 75)
+#define RID_SUBSETSTR_MUSICAL_SYMBOLS (RID_SUBSET_START + 76)
+#define RID_SUBSETSTR_MATHEMATICAL_ALPHANUMERIC_SYMBOLS (RID_SUBSET_START + 77)
+#define RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B (RID_SUBSET_START + 78)
+#define RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C (RID_SUBSET_START + 79)
+#define RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D (RID_SUBSET_START + 80)
+#define RID_SUBSETSTR_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT (RID_SUBSET_START + 81)
+#define RID_SUBSETSTR_TAGS (RID_SUBSET_START + 82)
+#define RID_SUBSETSTR_CYRILLIC_SUPPLEMENTARY (RID_SUBSET_START + 83)
+#define RID_SUBSETSTR_VARIATION_SELECTORS (RID_SUBSET_START + 84)
+#define RID_SUBSETSTR_SUPPLEMENTARY_PRIVATE_USE_AREA_A (RID_SUBSET_START + 85)
+#define RID_SUBSETSTR_SUPPLEMENTARY_PRIVATE_USE_AREA_B (RID_SUBSET_START + 86)
+#define RID_SUBSETSTR_LIMBU (RID_SUBSET_START + 87)
+#define RID_SUBSETSTR_TAI_LE (RID_SUBSET_START + 88)
+#define RID_SUBSETSTR_KHMER_SYMBOLS (RID_SUBSET_START + 89)
+#define RID_SUBSETSTR_PHONETIC_EXTENSIONS (RID_SUBSET_START + 90)
+#define RID_SUBSETSTR_MISCELLANEOUS_SYMBOLS_AND_ARROWS (RID_SUBSET_START + 91)
+#define RID_SUBSETSTR_YIJING_HEXAGRAM_SYMBOLS (RID_SUBSET_START + 92)
+#define RID_SUBSETSTR_LINEAR_B_SYLLABARY (RID_SUBSET_START + 93)
+#define RID_SUBSETSTR_LINEAR_B_IDEOGRAMS (RID_SUBSET_START + 94)
+#define RID_SUBSETSTR_AEGEAN_NUMBERS (RID_SUBSET_START + 95)
+#define RID_SUBSETSTR_UGARITIC (RID_SUBSET_START + 96)
+#define RID_SUBSETSTR_SHAVIAN (RID_SUBSET_START + 97)
+#define RID_SUBSETSTR_OSMANYA (RID_SUBSET_START + 98)
+#define RID_SUBSETSTR_CYPRIOT_SYLLABARY (RID_SUBSET_START + 99)
+#define RID_SUBSETSTR_TAI_XUAN_JING_SYMBOLS (RID_SUBSET_START + 100)
+#define RID_SUBSETSTR_VARIATION_SELECTORS_SUPPLEMENT (RID_SUBSET_START + 101)
+#define RID_SUBSETSTR_ANCIENT_GREEK_MUSICAL_NOTATION (RID_SUBSET_START + 102)
+#define RID_SUBSETSTR_ANCIENT_GREEK_NUMBERS (RID_SUBSET_START + 103)
+#define RID_SUBSETSTR_ARABIC_SUPPLEMENT (RID_SUBSET_START + 104)
+#define RID_SUBSETSTR_BUGINESE (RID_SUBSET_START + 105)
+#define RID_SUBSETSTR_CJK_STROKES (RID_SUBSET_START + 106)
+#define RID_SUBSETSTR_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT (RID_SUBSET_START + 107)
+#define RID_SUBSETSTR_COPTIC (RID_SUBSET_START + 108)
+#define RID_SUBSETSTR_ETHIOPIC_EXTENDED (RID_SUBSET_START + 109)
+#define RID_SUBSETSTR_ETHIOPIC_SUPPLEMENT (RID_SUBSET_START + 110)
+#define RID_SUBSETSTR_GEORGIAN_SUPPLEMENT (RID_SUBSET_START + 111)
+#define RID_SUBSETSTR_GLAGOLITIC (RID_SUBSET_START + 112)
+#define RID_SUBSETSTR_KHAROSHTHI (RID_SUBSET_START + 113)
+#define RID_SUBSETSTR_MODIFIER_TONE_LETTERS (RID_SUBSET_START + 114)
+#define RID_SUBSETSTR_NEW_TAI_LUE (RID_SUBSET_START + 115)
+#define RID_SUBSETSTR_OLD_PERSIAN (RID_SUBSET_START + 116)
+#define RID_SUBSETSTR_PHONETIC_EXTENSIONS_SUPPLEMENT (RID_SUBSET_START + 117)
+#define RID_SUBSETSTR_SUPPLEMENTAL_PUNCTUATION (RID_SUBSET_START + 118)
+#define RID_SUBSETSTR_SYLOTI_NAGRI (RID_SUBSET_START + 119)
+#define RID_SUBSETSTR_TIFINAGH (RID_SUBSET_START + 120)
+#define RID_SUBSETSTR_VERTICAL_FORMS (RID_SUBSET_START + 121)
+#define RID_SUBSETSTR_NKO (RID_SUBSET_START + 122)
+#define RID_SUBSETSTR_BALINESE (RID_SUBSET_START + 123)
+#define RID_SUBSETSTR_LATIN_EXTENDED_C (RID_SUBSET_START + 124)
+#define RID_SUBSETSTR_LATIN_EXTENDED_D (RID_SUBSET_START + 125)
+#define RID_SUBSETSTR_PHAGS_PA (RID_SUBSET_START + 126)
+#define RID_SUBSETSTR_PHOENICIAN (RID_SUBSET_START + 127)
+#define RID_SUBSETSTR_CUNEIFORM (RID_SUBSET_START + 128)
+#define RID_SUBSETSTR_CUNEIFORM_NUMBERS_AND_PUNCTUATION (RID_SUBSET_START + 129)
+#define RID_SUBSETSTR_COUNTING_ROD_NUMERALS (RID_SUBSET_START + 130)
+#define RID_SUBSETSTR_SUNDANESE (RID_SUBSET_START + 131)
+#define RID_SUBSETSTR_LEPCHA (RID_SUBSET_START + 132)
+#define RID_SUBSETSTR_OL_CHIKI (RID_SUBSET_START + 133)
+#define RID_SUBSETSTR_CYRILLIC_EXTENDED_A (RID_SUBSET_START + 134)
+#define RID_SUBSETSTR_VAI (RID_SUBSET_START + 135)
+#define RID_SUBSETSTR_CYRILLIC_EXTENDED_B (RID_SUBSET_START + 136)
+#define RID_SUBSETSTR_SAURASHTRA (RID_SUBSET_START + 137)
+#define RID_SUBSETSTR_KAYAH_LI (RID_SUBSET_START + 138)
+#define RID_SUBSETSTR_REJANG (RID_SUBSET_START + 139)
+#define RID_SUBSETSTR_CHAM (RID_SUBSET_START + 140)
+#define RID_SUBSETSTR_ANCIENT_SYMBOLS (RID_SUBSET_START + 141)
+#define RID_SUBSETSTR_PHAISTOS_DISC (RID_SUBSET_START + 142)
+#define RID_SUBSETSTR_LYCIAN (RID_SUBSET_START + 143)
+#define RID_SUBSETSTR_CARIAN (RID_SUBSET_START + 144)
+#define RID_SUBSETSTR_LYDIAN (RID_SUBSET_START + 145)
+#define RID_SUBSETSTR_MAHJONG_TILES (RID_SUBSET_START + 146)
+#define RID_SUBSETSTR_DOMINO_TILES (RID_SUBSET_START + 147)
+#define RID_SUBSETSTR_SAMARITAN (RID_SUBSET_START + 148)
+#define RID_SUBSETSTR_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED (RID_SUBSET_START + 149)
+#define RID_SUBSETSTR_TAI_THAM (RID_SUBSET_START + 150)
+#define RID_SUBSETSTR_VEDIC_EXTENSIONS (RID_SUBSET_START + 151)
+#define RID_SUBSETSTR_LISU (RID_SUBSET_START + 152)
+#define RID_SUBSETSTR_BAMUM (RID_SUBSET_START + 153)
+#define RID_SUBSETSTR_COMMON_INDIC_NUMBER_FORMS (RID_SUBSET_START + 154)
+#define RID_SUBSETSTR_DEVANAGARI_EXTENDED (RID_SUBSET_START + 155)
+#define RID_SUBSETSTR_HANGUL_JAMO_EXTENDED_A (RID_SUBSET_START + 156)
+#define RID_SUBSETSTR_JAVANESE (RID_SUBSET_START + 157)
+#define RID_SUBSETSTR_MYANMAR_EXTENDED_A (RID_SUBSET_START + 158)
+#define RID_SUBSETSTR_TAI_VIET (RID_SUBSET_START + 159)
+#define RID_SUBSETSTR_MEETEI_MAYEK (RID_SUBSET_START + 160)
+#define RID_SUBSETSTR_HANGUL_JAMO_EXTENDED_B (RID_SUBSET_START + 161)
+#define RID_SUBSETSTR_IMPERIAL_ARAMAIC (RID_SUBSET_START + 162)
+#define RID_SUBSETSTR_OLD_SOUTH_ARABIAN (RID_SUBSET_START + 163)
+#define RID_SUBSETSTR_AVESTAN (RID_SUBSET_START + 164)
+#define RID_SUBSETSTR_INSCRIPTIONAL_PARTHIAN (RID_SUBSET_START + 165)
+#define RID_SUBSETSTR_INSCRIPTIONAL_PAHLAVI (RID_SUBSET_START + 166)
+#define RID_SUBSETSTR_OLD_TURKIC (RID_SUBSET_START + 167)
+#define RID_SUBSETSTR_RUMI_NUMERAL_SYMBOLS (RID_SUBSET_START + 168)
+#define RID_SUBSETSTR_KAITHI (RID_SUBSET_START + 169)
+#define RID_SUBSETSTR_EGYPTIAN_HIEROGLYPHS (RID_SUBSET_START + 170)
+#define RID_SUBSETSTR_ENCLOSED_ALPHANUMERIC_SUPPLEMENT (RID_SUBSET_START + 171)
+#define RID_SUBSETSTR_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT (RID_SUBSET_START + 172)
+#define RID_SUBSETSTR_MANDAIC (RID_SUBSET_START + 174)
+#define RID_SUBSETSTR_BATAK (RID_SUBSET_START + 175)
+#define RID_SUBSETSTR_ETHIOPIC_EXTENDED_A (RID_SUBSET_START + 176)
+#define RID_SUBSETSTR_BRAHMI (RID_SUBSET_START + 177)
+#define RID_SUBSETSTR_BAMUM_SUPPLEMENT (RID_SUBSET_START + 178)
+#define RID_SUBSETSTR_KANA_SUPPLEMENT (RID_SUBSET_START + 179)
+#define RID_SUBSETSTR_PLAYING_CARDS (RID_SUBSET_START + 180)
+#define RID_SUBSETSTR_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS (RID_SUBSET_START + 181)
+#define RID_SUBSETSTR_EMOTICONS (RID_SUBSET_START + 182)
+#define RID_SUBSETSTR_TRANSPORT_AND_MAP_SYMBOLS (RID_SUBSET_START + 183)
+#define RID_SUBSETSTR_ALCHEMICAL_SYMBOLS (RID_SUBSET_START + 184)
+#define RID_SUBSETSTR_CJK_EXT_A_UNIFIED_IDGRAPH (RID_SUBSET_START + 185)
+#define RID_SUBSETSTR_ARABIC_EXTENDED_A (RID_SUBSET_START + 186)
+#define RID_SUBSETSTR_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS (RID_SUBSET_START + 187)
+#define RID_SUBSETSTR_CHAKMA (RID_SUBSET_START + 188)
+#define RID_SUBSETSTR_MEETEI_MAYEK_EXTENSIONS (RID_SUBSET_START + 189)
+#define RID_SUBSETSTR_MEROITIC_CURSIVE (RID_SUBSET_START + 190)
+#define RID_SUBSETSTR_MEROITIC_HIEROGLYPHS (RID_SUBSET_START + 191)
+#define RID_SUBSETSTR_MIAO (RID_SUBSET_START + 192)
+#define RID_SUBSETSTR_SHARADA (RID_SUBSET_START + 193)
+#define RID_SUBSETSTR_SORA_SOMPENG (RID_SUBSET_START + 194)
+#define RID_SUBSETSTR_SUNDANESE_SUPPLEMENT (RID_SUBSET_START + 195)
+#define RID_SUBSETSTR_TAKRI (RID_SUBSET_START + 196)
+#define RID_SUBSETSTR_SINHALA (RID_SUBSET_START + 197)
+#define RID_SUBSETSTR_TIBETAN (RID_SUBSET_START + 198)
+#define RID_SUBSETSTR_MYANMAR (RID_SUBSET_START + 199)
+#define RID_SUBSETSTR_KHMER (RID_SUBSET_START + 200)
+#define RID_SUBSETSTR_OGHAM (RID_SUBSET_START + 201)
+#define RID_SUBSETSTR_THAANA (RID_SUBSET_START + 202)
+#define RID_SUBSETSTR_CANADIAN_ABORIGINAL (RID_SUBSET_START + 203)
+
+#define RID_SUBSETSTR_BRAILLE_PATTERNS (RID_SUBSET_START + 204)
+#define RID_SUBSETSTR_CJK_RADICAL_SUPPL (RID_SUBSET_START + 205)
+
+#define RID_SUBSETSTR_TAGBANWA (RID_SUBSET_START + 206)
+#define RID_SUBSETSTR_BOPOMOFO_EXTENDED (RID_SUBSET_START + 207)
+#define RID_SUBSETSTR_KATAKANA_PHONETIC (RID_SUBSET_START + 208)
+#define RID_SUBSETSTR_RUNIC (RID_SUBSET_START + 209)
+#define RID_SUBSETSTR_SYRIAC (RID_SUBSET_START + 210)
+#define RID_SUBSETSTR_ETHIOPIC (RID_SUBSET_START + 211)
+#define RID_SUBSETSTR_CHEROKEE (RID_SUBSET_START + 212)
+#define RID_SUBSETSTR_MONGOLIAN (RID_SUBSET_START + 213)
+#define RID_SUBSETSTR_MISC_MATH_SYMS_A (RID_SUBSET_START + 214)
+#define RID_SUBSETSTR_SUPPL_ARROWS_A (RID_SUBSET_START + 215)
+#define RID_SUBSETSTR_SUPPL_ARROWS_B (RID_SUBSET_START + 216)
+#define RID_SUBSETSTR_MISC_MATH_SYMS_B (RID_SUBSET_START + 217)
+#define RID_SUBSETSTR_KANGXI_RADICALS (RID_SUBSET_START + 218)
+#define RID_SUBSETSTR_IDEO_DESC_CHARS (RID_SUBSET_START + 219)
+#define RID_SUBSETSTR_TAGALOG (RID_SUBSET_START + 220)
+#define RID_SUBSETSTR_HANUNOO (RID_SUBSET_START + 221)
+#define RID_SUBSETSTR_KANBUN (RID_SUBSET_START + 222)
+#define RID_SUBSETSTR_BUHID (RID_SUBSET_START + 223)
+
+// RID_SUBSET_END (RID_SUBSET_START + 299)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/ucsubset.hxx b/include/svx/ucsubset.hxx
new file mode 100644
index 000000000000..54dfbbdd5250
--- /dev/null
+++ b/include/svx/ucsubset.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 _SVX_SUBSETMAP_HXX
+#define _SVX_SUBSETMAP_HXX
+
+#include "svx/svxdllapi.h"
+
+#include <svx/ucsubset.hrc>
+#include <vcl/metric.hxx>
+
+#include <list>
+
+class FontCharMap;
+
+// classes Subset & SubsetMap --------------------------------------------
+// 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 String& aName )
+ : mnRangeMin(nMin), mnRangeMax(nMax), maRangeName(aName)
+ {}
+
+ Subset( sal_UCS4 nMin, sal_UCS4 nMax, int resId );
+
+ sal_UCS4 GetRangeMin() const { return mnRangeMin;}
+ sal_UCS4 GetRangeMax() const { return mnRangeMax;}
+ const String GetName() const { return maRangeName;}
+
+private:
+ sal_UCS4 mnRangeMin;
+ sal_UCS4 mnRangeMax;
+ String maRangeName;
+};
+
+inline bool operator<(const Subset &rLHS, const Subset &rRHS)
+{
+ return rLHS.GetRangeMin() < rRHS.GetRangeMin();
+}
+
+typedef ::std::list<Subset> SubsetList;
+
+class SVX_DLLPUBLIC SubsetMap : private Resource
+{
+public:
+ SubsetMap( const FontCharMap* );
+
+ const Subset* GetSubsetByUnicode( sal_UCS4 ) const;
+ const Subset* GetNextSubset( bool bFirst ) const;
+
+private:
+ SubsetList maSubsets;
+ mutable SubsetList::const_iterator maSubsetIterator;
+
+ SVX_DLLPRIVATE void InitList();
+ SVX_DLLPRIVATE void ApplyCharMap( const FontCharMap* );
+};
+
+#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 000000000000..2ceca3ec895d
--- /dev/null
+++ b/include/svx/unoapi.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 _SVX_UNOAPI_HXX_
+#define _SVX_UNOAPI_HXX_
+
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <sal/types.h>
+#include <svtools/grfmgr.hxx>
+#include <svl/poolitem.hxx>
+#include "svx/svxdllapi.h"
+
+class SvxShape;
+class SdrObject;
+class SdrPage;
+class SvxNumBulletItem;
+class SfxItemPool;
+class String;
+
+/** creates a StarOffice API wrapper with the given type and inventor
+ Deprecated: This will be replaced with a function returning XShape.
+*/
+SVX_DLLPUBLIC SvxShape* CreateSvxShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt32 nInventor ) throw();
+
+/** returns a StarOffice API wrapper for the given SdrObject */
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) throw ();
+
+/** returns the SdrObject from the given StarOffice API wrapper */
+SVX_DLLPUBLIC SdrObject* GetSdrObjectFromXShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ) throw() ;
+
+/** returns a StarOffice API wrapper for the given SdrPage */
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > GetXDrawPageForSdrPage( SdrPage* pPage ) throw ();
+
+/** returns the SdrPage from the given StarOffice API wrapper */
+SVX_DLLPUBLIC SdrPage* GetSdrPageFromXDrawPage( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xDrawPage ) throw() ;
+
+/** returns the SvxNumBulletItem with the given name from the pool or a null if there is no item
+ with that name
+*/
+SvxNumBulletItem* SvxGetNumBulletItemByName( SfxItemPool* pPool, const OUString& aName ) throw();
+
+/** maps the API constant MeasureUnit to a vcl MapUnit enum.
+ Returns false if conversion is not supported.
+
+ @cl: for warnings01 I found out that this method never worked so I thin
+ it is not used at all
+sal_Bool SvxMeasureUnitToMapUnit( const short eApi, short& nVcl ) throw();
+*/
+
+/** maps the vcl MapUnit enum to a API constant MeasureUnit.
+ Returns false if conversion is not supported.
+*/
+SVX_DLLPUBLIC sal_Bool SvxMapUnitToMeasureUnit( const short nVcl, short& eApi ) throw();
+
+/** maps the API constant MeasureUnit to a vcl MapUnit enum.
+ Returns false if conversion is not supported.
+*/
+SVX_DLLPUBLIC sal_Bool SvxMeasureUnitToFieldUnit( const short eApi, short& nVcl ) throw();
+
+/** maps the vcl MapUnit enum to a API constant MeasureUnit.
+ Returns false if conversion is not supported.
+*/
+SVX_DLLPUBLIC sal_Bool SvxFieldUnitToMeasureUnit( const short nVcl, short& eApi ) throw();
+
+/** if the given name is a predefined name for the current language it is replaced by
+ the corresponding api name.
+*/
+SVX_DLLPUBLIC SAL_WARN_UNUSED_RESULT OUString
+ SvxUnogetApiNameForItem(const sal_Int16 nWhich, const OUString& rInternalName) throw();
+
+/** if the given name is a predefined api name it is replaced by the predefined name
+ for the current language.
+*/
+SVX_DLLPUBLIC SAL_WARN_UNUSED_RESULT OUString
+ SvxUnogetInternalNameForItem(const sal_Int16 nWhich, const OUString& rApiName) throw();
+
+#endif // _SVX_UNOAPI_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/unofill.hxx b/include/svx/unofill.hxx
new file mode 100644
index 000000000000..523905a1d97a
--- /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 _SVX_UNOFILL_HXX_
+#define _SVX_UNOFILL_HXX_
+
+#include <com/sun/star/uno/XInterface.hpp>
+#include "svx/svxdllapi.h"
+
+class SdrModel;
+
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxUnoGradientTable_createInstance( SdrModel* pModel );
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxUnoHatchTable_createInstance( SdrModel* pModel );
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxUnoBitmapTable_createInstance( SdrModel* pModel );
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxUnoTransGradientTable_createInstance( SdrModel* pModel );
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxUnoMarkerTable_createInstance( SdrModel* pModel );
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxUnoDashTable_createInstance( SdrModel* pModel );
+
+#endif // _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 000000000000..c0f32d0f1346
--- /dev/null
+++ b/include/svx/unomaster.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 _SVX_UNOMASTER_HXX
+#define _SVX_UNOMASTER_HXX
+
+#include <com/sun/star/uno/Type.h>
+#include <com/sun/star/uno/Any.h>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
+
+/** 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 sal_Bool queryAggregation( const com::sun::star::uno::Type & rType, com::sun::star::uno::Any& aAny ) = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) = 0;
+ virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
+
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException) = 0;
+ virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException) = 0;
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException) = 0;
+
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) = 0;
+
+ virtual void dispose() = 0;
+
+ virtual void modelChanged( SdrModel* pNewModel ) = 0;
+ virtual void pageChanged( SdrPage* pNewPage ) = 0;
+ virtual void objectChanged( SdrObject* pNewObj ) = 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 000000000000..cf4c4f4e02c1
--- /dev/null
+++ b/include/svx/unomid.hxx
@@ -0,0 +1,108 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_UNOMID_HXX
+#define _SVX_UNOMID_HXX
+
+//AdjustItem
+#define MID_PARA_ADJUST 0
+#define MID_LAST_LINE_ADJUST 1
+#define MID_EXPAND_SINGLE 2
+
+//SvxPageItem
+#define MID_PAGE_NUMTYPE 0
+#define MID_PAGE_ORIENTATION 1
+#define MID_PAGE_LAYOUT 2
+
+//SvxMarginItem
+#define MID_MARGIN_LR_MARGIN 0
+#define MID_MARGIN_UL_MARGIN 1
+#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
+
+// SvxHorJustifyItem
+#define MID_HORJUST_HORJUST 0
+#define MID_HORJUST_ADJUST 1
+
+// 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 000000000000..fe648ea4419f
--- /dev/null
+++ b/include/svx/unomod.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 SVX_UNOMOD_HXX
+#define SVX_UNOMOD_HXX
+
+#include <com/sun/star/document/EventObject.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/container/XIndexReplace.hpp>
+#include "svx/svxdllapi.h"
+
+class SdrHint;
+class SdrModel;
+class SdrModel;
+
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > SvxCreateNumRule( SdrModel* pModel ) throw();
+
+class SVX_DLLPUBLIC SvxUnoDrawMSFactory : public ::com::sun::star::lang::XMultiServiceFactory
+{
+public:
+ SvxUnoDrawMSFactory() throw() {};
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createTextField( const OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ // internal
+ ::com::sun::star::uno::Sequence< OUString >
+ concatServiceNames( ::com::sun::star::uno::Sequence< OUString >& rServices1,
+ ::com::sun::star::uno::Sequence< OUString >& rServices2 ) throw();
+
+ /** fills the given EventObject from the given SdrHint.
+ @returns
+ true if the SdrHint could be translated to an EventObject<br>
+ false if not
+ */
+ static sal_Bool createEvent( const SdrModel* pDoc, const SdrHint* pSdrHint, ::com::sun::star::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 000000000000..fcf203fa47e8
--- /dev/null
+++ b/include/svx/unomodel.hxx
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVX_UNOMODEL_HXX
+#define SVX_UNOMODEL_HXX
+
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <sfx2/sfxbasemodel.hxx>
+#include <svx/fmdmod.hxx>
+#include "svx/svxdllapi.h"
+
+class SdrModel;
+
+class SVX_DLLPUBLIC SvxUnoDrawingModel : public SfxBaseModel, // implements SfxListener, OWEAKOBJECT & other
+ public SvxFmMSFactory,
+ public ::com::sun::star::drawing::XDrawPagesSupplier,
+ public ::com::sun::star::lang::XServiceInfo,
+ public ::com::sun::star::ucb::XAnyCompareFactory
+{
+ friend class SvxUnoDrawPagesAccess;
+
+private:
+ SdrModel* mpDoc;
+
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::drawing::XDrawPages > mxDrawPagesAccess;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDashTable;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxGradientTable;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxHatchTable;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxBitmapTable;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxTransGradientTable;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxMarkerTable;
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
+
+public:
+ SvxUnoDrawingModel( SdrModel* pDoc ) throw();
+ virtual ~SvxUnoDrawingModel() throw();
+
+ SdrModel* GetDoc() const { return mpDoc; }
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XModel
+ virtual void SAL_CALL lockControllers( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL unlockControllers( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasControllersLocked( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XDrawPagesSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPages > SAL_CALL getDrawPages( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XMultiServiceFactory ( SvxFmMSFactory )
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // XAnyCompareFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompare > SAL_CALL createAnyCompareByName( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>& xOut );
+SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>& xOut, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent );
+SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>& xOut, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent, const char* pExportService );
+SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream );
+SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent );
+SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream, const com::sun::star::uno::Reference< com::sun::star::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 000000000000..68150aff0312
--- /dev/null
+++ b/include/svx/unopage.hxx
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVX_UNOWPAGE_HXX
+#define _SVX_UNOWPAGE_HXX
+
+#include <com/sun/star/lang/XComponent.hpp>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/drawing/XShapeGrouper.hpp>
+#include <com/sun/star/drawing/XShapeCombiner.hpp>
+#include <com/sun/star/drawing/XShapeBinder.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/weakagg.hxx>
+#include <svl/lstner.hxx>
+#include <editeng/mutxhelp.hxx>
+#include "svx/svxdllapi.h"
+
+#include <cppuhelper/implbase5.hxx>
+#include <comphelper/servicehelper.hxx>
+
+#include <svx/unoprov.hxx>
+
+class SdrPage;
+class SdrModel;
+class SdrView;
+class SdrPageView;
+class SdrObject;
+class SvxShape;
+class SvxShapeGroup;
+class SvxShapeConnector;
+
+/***********************************************************************
+* Macros fuer Umrechnung Twips<->100tel mm *
+***********************************************************************/
+#define TWIPS_TO_MM(val) ((val * 127 + 36) / 72)
+#define MM_TO_TWIPS(val) ((val * 72 + 63) / 127)
+
+/***********************************************************************
+* *
+***********************************************************************/
+class SVX_DLLPUBLIC SvxDrawPage : public ::cppu::WeakAggImplHelper5< ::com::sun::star::drawing::XDrawPage,
+ ::com::sun::star::drawing::XShapeGrouper,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XUnoTunnel,
+ ::com::sun::star::lang::XComponent>,
+ public SfxListener,
+ protected SvxMutexHelper
+{
+ protected:
+ cppu::OBroadcastHelper mrBHelper;
+
+ SdrPage* mpPage;
+ SdrModel* mpModel;
+ SdrView* mpView;
+
+ void _SelectObjectsInView( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& aShapes, SdrPageView* pPageView ) throw ();
+ void _SelectObjectInView( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, SdrPageView* pPageView ) throw();
+
+ virtual void disposing() throw();
+
+ public:
+ SvxDrawPage( SdrPage* pPage ) throw();
+ virtual ~SvxDrawPage() throw();
+
+ // Internals
+ SdrPage* GetSdrPage() const { return mpPage; }
+ void ChangeModel( SdrModel* pNewModel );
+
+ // Erzeugen eines SdrObjects und Einfugen in die SdrPage
+ SdrObject *CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw();
+
+ // Typ und Inventor bestimmen
+ void GetTypeAndInventor( sal_uInt16& rType, sal_uInt32& rInventor, const OUString& aName ) const throw();
+
+ // Erzeugen eines SdrObjects anhand einer Description. Kann von
+ // abgeleiteten Klassen dazu benutzt werden, eigene Shapes zu
+ // unterstuetzen (z.B. Controls)
+ virtual SdrObject *_CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw();
+
+ static SvxShape* CreateShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt32 nInventor, SdrObject *pObj = NULL, SvxDrawPage *pPage = NULL ) throw();
+
+ // Die folgende Methode wird gerufen, wenn ein SvxShape-Objekt angelegt
+ // werden soll. abgeleitete Klassen koennen hier eine Ableitung oder
+ // ein ein SvxShape aggregierenden Objekt anlegen.
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > _CreateShape( SdrObject *pObj ) const throw();
+
+ UNO3_GETIMPLEMENTATION_DECL( SvxDrawPage )
+
+ // SfxListener
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+ // XInterface
+ virtual void SAL_CALL release() throw();
+
+ // XShapes
+ virtual void SAL_CALL add( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
+
+ // XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException) ;
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XShapeGrouper
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapeGroup > SAL_CALL group( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL ungroup( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapeGroup >& aGroup ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+#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 000000000000..7db02b2a85dd
--- /dev/null
+++ b/include/svx/unopool.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_UNOPOOL_HXX_
+#define _SVX_UNOPOOL_HXX_
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <comphelper/propertysethelper.hxx>
+#include <cppuhelper/implbase4.hxx>
+#include "svx/svxdllapi.h"
+
+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 overiding getModelPool().
+*/
+class SVX_DLLPUBLIC SvxUnoDrawPool : public ::cppu::OWeakAggObject,
+ public ::com::sun::star::lang::XServiceInfo,
+ public ::com::sun::star::lang::XTypeProvider,
+ public comphelper::PropertySetHelper
+{
+public:
+ SvxUnoDrawPool( SdrModel* pModel, sal_Int32 nServiceId ) throw();
+
+ /** deprecated */
+ SvxUnoDrawPool( SdrModel* pModel ) throw();
+ virtual ~SvxUnoDrawPool() throw();
+
+ /** 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( sal_Bool bReadOnly ) throw();
+
+ // overiden helpers from comphelper::PropertySetHelper
+ virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const ::com::sun::star::uno::Any* pValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
+ virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
+
+ virtual void _getPropertyStates( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::beans::PropertyState* pStates ) throw(::com::sun::star::beans::UnknownPropertyException );
+ virtual void _setPropertyToDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException );
+ virtual ::com::sun::star::uno::Any _getPropertyDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
+
+protected:
+ void init();
+
+ virtual void getAny( SfxItemPool* pPool, const comphelper::PropertyMapEntry* pEntry, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException);
+ virtual void putAny( SfxItemPool* pPool, const comphelper::PropertyMapEntry* pEntry, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::IllegalArgumentException);
+
+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 000000000000..0414e1228211
--- /dev/null
+++ b/include/svx/unoprov.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SVX_UNOPROV_HXX
+#define SVX_UNOPROV_HXX
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <svl/itemprop.hxx>
+#include "svx/svxdllapi.h"
+
+class SvxItemPropertySet;
+class SfxItemPool;
+
+/***********************************************************************
+* class UHashMap *
+***********************************************************************/
+
+#define UHASHMAP_NOTFOUND sal::static_int_cast< sal_uInt32 >(~0)
+class UHashMap
+{
+ UHashMap() {}
+public:
+ static sal_uInt32 getId( const OUString& rCompareString );
+ static OUString getNameFromId (sal_uInt32 nId);
+ static ::com::sun::star::uno::Sequence< OUString > getServiceNames();
+};
+
+/***********************************************************************
+* Soriterer *
+***********************************************************************/
+
+#define SVXMAP_SHAPE 0
+#define SVXMAP_CONNECTOR 1
+#define SVXMAP_DIMENSIONING 2
+#define SVXMAP_CIRCLE 3
+#define SVXMAP_POLYPOLYGON 4
+#define SVXMAP_POLYPOLYGONBEZIER 5
+#define SVXMAP_GRAPHICOBJECT 6
+#define SVXMAP_3DSCENEOBJECT 7
+#define SVXMAP_3DCUBEOBJEKT 8
+#define SVXMAP_3DSPHEREOBJECT 9
+#define SVXMAP_3DLATHEOBJECT 10
+#define SVXMAP_3DEXTRUDEOBJECT 11
+#define SVXMAP_3DPOLYGONOBJECT 12
+#define SVXMAP_ALL 13
+#define SVXMAP_GROUP 14
+#define SVXMAP_CAPTION 15
+#define SVXMAP_OLE2 16
+#define SVXMAP_PLUGIN 17
+#define SVXMAP_FRAME 18
+#define SVXMAP_APPLET 19
+#define SVXMAP_CONTROL 20
+#define SVXMAP_TEXT 21
+#define SVXMAP_CUSTOMSHAPE 22
+#define SVXMAP_MEDIA 23
+#define SVXMAP_TABLE 24
+#define SVXMAP_PAGE 25
+#define SVXMAP_END 26 // last+1 !
+/***********************************************************************
+* SvxUnoPropertyMapProvider *
+***********************************************************************/
+class SVX_DLLPUBLIC SvxUnoPropertyMapProvider
+{
+ SfxItemPropertyMapEntry* aMapArr[SVXMAP_END];
+ SvxItemPropertySet* 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)
+
+#include <editeng/unoipset.hxx>
+
+/***********************************************************************
+* 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:
+ SVX_DLLPUBLIC static comphelper::PropertySetInfo* getOrCreate( sal_Int32 nServiceId ) throw();
+
+private:
+ static comphelper::PropertySetInfo* mpInfos[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 000000000000..23cbf8811a3a
--- /dev/null
+++ b/include/svx/unoshape.hxx
@@ -0,0 +1,868 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_UNOSHAPE_HXX
+#define _SVX_UNOSHAPE_HXX
+
+#include <com/sun/star/document/XActionLockable.hpp>
+#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
+#include <com/sun/star/drawing/XGluePointsSupplier.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XAggregation.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/drawing/PolygonKind.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/beans/XMultiPropertyStates.hpp>
+#include <sal/types.h>
+#include <tools/weakbase.hxx>
+#include <svl/lstner.hxx>
+#include <editeng/unoipset.hxx>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/weakagg.hxx>
+#include <cppuhelper/interfacecontainer.h>
+#include <osl/mutex.hxx>
+#include "svx/svxdllapi.h"
+#include <rtl/ref.hxx>
+#include <com/sun/star/uno/Any.hxx>
+
+#include <svx/svdouno.hxx>
+
+#include <comphelper/servicehelper.hxx>
+
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase12.hxx>
+
+#include <svx/unoprov.hxx>
+
+class SfxItemSet;
+class SdrModel;
+class SvxDrawPage;
+class SvGlobalName;
+class Pair;
+
+// 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 SVX_DLLPUBLIC SvxItemPropertySet_setPropertyValue( const SvxItemPropertySet& rPropSet, const SfxItemPropertySimpleEntry* pMap,
+ const com::sun::star::uno::Any& rVal, SfxItemSet& rSet );
+
+com::sun::star::uno::Any SVX_DLLPUBLIC SvxItemPropertySet_getPropertyValue( const SvxItemPropertySet& rPropSet, const SfxItemPropertySimpleEntry* pMap, const SfxItemSet& rSet );
+
+
+// WARNING: if you update the supported interfaces,
+// also update SvxShape::_getTypes()
+typedef ::cppu::WeakAggImplHelper12<
+ ::com::sun::star::drawing::XShape,
+ ::com::sun::star::lang::XComponent,
+ ::com::sun::star::beans::XPropertySet,
+ ::com::sun::star::beans::XMultiPropertySet,
+ ::com::sun::star::beans::XPropertyState,
+ ::com::sun::star::lang::XUnoTunnel,
+ ::com::sun::star::container::XNamed,
+ ::com::sun::star::drawing::XGluePointsSupplier,
+ ::com::sun::star::container::XChild,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::document::XActionLockable,
+ ::com::sun::star::beans::XMultiPropertyStates> SvxShape_UnoImplHelper;
+
+class SVX_DLLPUBLIC SvxShape : public SvxShape_UnoImplHelper,
+ public SfxListener,
+ public SvxShapeMutex
+{
+private:
+ ::com::sun::star::awt::Size maSize;
+ ::com::sun::star::awt::Point maPosition;
+ OUString maShapeType;
+ OUString maShapeName;
+
+ /** these members are used to optimize XMultiProperty calls */
+ SvxShapeImpl* mpImpl;
+ bool mbIsMultiPropertyCall;
+
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::container::XIndexContainer > mxGluePoints;
+
+protected:
+ friend class SvxDrawPage;
+ friend class SvxShapeConnector;
+ friend class SdXShape;
+
+ const SvxItemPropertySet* mpPropSet;
+ const SfxItemPropertyMapEntry* maPropMapEntries;
+
+ ::tools::WeakReference< SdrObject > mpObj;
+ SdrModel* mpModel;
+ // Umrechnungen fuer den Writer, der in TWIPS arbeitet
+ void ForceMetricToItemPoolMetric(Pair& rPoint) const throw();
+ void ForceMetricTo100th_mm(Pair& rPoint) const throw();
+ // Dimension arrows change size/position on save/reload (#i59051#)
+ void ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const throw();
+ void ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const throw();
+
+ ::com::sun::star::uno::Any GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertySimpleEntry* pMap ) const;
+
+ sal_Bool SAL_CALL SetFillAttribute( sal_Int32 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();
+
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyStateImpl( const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::beans::PropertyState& rState ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual bool setPropertyToDefaultImpl( const SfxItemPropertySimpleEntry* pProperty ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+
+public:
+ SvxShape( SdrObject* pObj ) throw ();
+ SvxShape( SdrObject* pObject, const SfxItemPropertyMapEntry* pEntries, const SvxItemPropertySet* pPropertySet ) throw ();
+ SvxShape() throw ();
+ virtual ~SvxShape() throw ();
+
+ // Internals
+ void ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet);
+ virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL );
+ /** 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;
+
+ void ChangeModel( SdrModel* pNewModel );
+
+ void InvalidateSdrObject() { mpObj.reset( NULL ); };
+ const SvxItemPropertySet& GetPropertySet() { return *mpPropSet; }
+ SdrObject* GetSdrObject() const {return mpObj.get();}
+ void SetShapeType( const OUString& ShapeType ) { maShapeType = ShapeType; }
+ ::com::sun::star::uno::Any GetBitmap( sal_Bool bMetaFile = sal_False ) const throw ();
+
+ ::svx::PropertyChangeNotifier& getShapePropertyChangeNotifier();
+
+ void setShapeKind( sal_uInt32 nKind );
+ sal_uInt32 getShapeKind() const;
+
+ // styles need this
+ static sal_Bool SAL_CALL SetFillAttribute( sal_Int32 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel* pModel );
+ static sal_Bool SAL_CALL SetFillAttribute( sal_Int32 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
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL _getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL _setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL _getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ ::com::sun::star::beans::PropertyState SAL_CALL _getPropertyState( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL _setPropertyToDefault( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL _getPropertyDefault( const OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL _getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL _getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+
+ void setMaster( SvxShapeMaster* pMaster );
+
+ // SfxListener
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) throw ();
+
+ // XAggregation
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XNamed
+ virtual OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XShapeDescriptor
+ virtual OUString SAL_CALL getShapeType() throw(::com::sun::star::uno::RuntimeException);
+
+ // XShape
+ virtual ::com::sun::star::awt::Point SAL_CALL getPosition() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XMultiPropertySet
+ virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XPropertyState
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XMultiPropertyStates
+ virtual void SAL_CALL setAllPropertiesToDefault()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertiesToDefault(
+ const ::com::sun::star::uno::Sequence<
+ OUString >& aPropertyNames )
+ throw (::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+ SAL_CALL getPropertyDefaults(
+ const ::com::sun::star::uno::Sequence<
+ OUString >& aPropertyNames )
+ throw (::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XGluePointsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > SAL_CALL getGluePoints( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XActionLockable
+ virtual sal_Bool SAL_CALL isActionLocked( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addActionLock( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeActionLock( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActionLocks( sal_Int16 nLock ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL resetActionLocks( ) throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ /** initializes SdrObj-dependent members. Only to be called when GetSdrObject() != NULL
+ */
+ SVX_DLLPRIVATE void impl_initFromSdrObject();
+ /// CTOR-Impl
+ SVX_DLLPRIVATE void impl_construct();
+};
+
+#include <editeng/unotext.hxx>
+
+class SVX_DLLPUBLIC SvxShapeText : public SvxShape, public SvxUnoTextBase
+{
+protected:
+ /** called from the XActionLockable interface methods on initial locking */
+ virtual void lock();
+
+ /** called from the XActionLockable interface methods on final unlock */
+ virtual void unlock();
+
+protected:
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyStateImpl( const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::beans::PropertyState& rState ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual bool setPropertyToDefaultImpl( const SfxItemPropertySimpleEntry* pProperty ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+
+public:
+ SvxShapeText( SdrObject* pObj ) throw ();
+ SvxShapeText( SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet ) throw ();
+ virtual ~SvxShapeText() throw ();
+
+ virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL );
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::text::XTextRange
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd() throw(::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setString( const OUString& aString ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+class SvxShapeRect : public SvxShapeText
+{
+public:
+ SvxShapeRect( SdrObject* pObj ) throw ();
+ virtual ~SvxShapeRect() throw ();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+};
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/drawing/XShapeGroup.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+
+/***********************************************************************
+* *
+***********************************************************************/
+class SvxShapeGroup : public SvxShape,
+ public ::com::sun::star::drawing::XShapeGroup,
+ public ::com::sun::star::drawing::XShapes
+{
+private:
+ rtl::Reference< SvxDrawPage> mxPage;
+
+public:
+ SvxShapeGroup( SdrObject* pObj,SvxDrawPage* pDrawPage ) throw ();
+ virtual ~SvxShapeGroup() throw ();
+
+ virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL );
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XShapes
+ virtual void SAL_CALL add( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
+
+ // XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException) ;
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XShapeDescriptor
+ virtual OUString SAL_CALL getShapeType() throw(::com::sun::star::uno::RuntimeException);
+
+ // XShape
+ virtual ::com::sun::star::awt::Point SAL_CALL getPosition() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
+
+ // XShapeGroup
+ virtual void SAL_CALL enterGroup( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL leaveGroup( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+};
+#include <com/sun/star/drawing/XConnectorShape.hpp>
+
+/***********************************************************************
+* *
+***********************************************************************/
+class SvxShapeConnector : public ::com::sun::star::drawing::XConnectorShape,
+ public SvxShapeText
+{
+public:
+ SvxShapeConnector( SdrObject* pObj ) throw();
+ virtual ~SvxShapeConnector() throw();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XShapeDescriptor
+ virtual OUString SAL_CALL getShapeType() throw(::com::sun::star::uno::RuntimeException);
+
+ // XShape
+ virtual ::com::sun::star::awt::Point SAL_CALL getPosition() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
+
+ // XConnectorShape
+ virtual void SAL_CALL connectStart( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XConnectableShape >& xShape, ::com::sun::star::drawing::ConnectionType nPos ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL connectEnd( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XConnectableShape >& xShape, ::com::sun::star::drawing::ConnectionType nPos ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL disconnectBegin( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XConnectableShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL disconnectEnd( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XConnectableShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+};
+#include <com/sun/star/drawing/XControlShape.hpp>
+
+/***********************************************************************
+* *
+***********************************************************************/
+class SVX_DLLPUBLIC SvxShapeControl : public ::com::sun::star::drawing::XControlShape, public SvxShapeText
+{
+protected:
+ using SvxUnoTextRangeBase::setPropertyValue;
+ using SvxUnoTextRangeBase::getPropertyValue;
+
+public:
+ SvxShapeControl( SdrObject* pObj ) throw();
+ virtual ~SvxShapeControl() throw();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XPropertySet
+ virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XPropertyState
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XShapeDescriptor
+ virtual OUString SAL_CALL getShapeType() throw(::com::sun::star::uno::RuntimeException);
+
+ // XShape
+ virtual ::com::sun::star::awt::Point SAL_CALL getPosition() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
+
+ // XControlShape
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getControl() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xControl ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+class SvxShapeDimensioning : public SvxShapeText
+{
+public:
+ SvxShapeDimensioning( SdrObject* pObj ) throw();
+ virtual ~SvxShapeDimensioning() throw();
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+class SvxShapeCircle : public SvxShapeText
+{
+public:
+ SvxShapeCircle( SdrObject* pObj ) throw ();
+ virtual ~SvxShapeCircle() throw ();
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+
+// #i118485# changed parent to SvxShapeText to allow Text handling over UNO API
+class SVX_DLLPUBLIC SvxOle2Shape : public SvxShapeText
+{
+protected:
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ void resetModifiedState();
+
+ const SvGlobalName GetClassName_Impl(OUString& rHexCLSID);
+public:
+ SvxOle2Shape( SdrObject* pObj ) throw();
+ SvxOle2Shape( SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet ) throw ();
+ virtual ~SvxOle2Shape() throw();
+
+ sal_Bool createObject( const SvGlobalName &aClassName );
+
+ sal_Bool createLink( const OUString& aLinkURL );
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+/***********************************************************************
+* *
+***********************************************************************/
+class SvxShapePolyPolygon : public SvxShapeText
+{
+private:
+ ::com::sun::star::drawing::PolygonKind mePolygonKind;
+
+protected:
+ using SvxUnoTextRangeBase::setPropertyValue;
+ using SvxUnoTextRangeBase::getPropertyValue;
+
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+public:
+ SvxShapePolyPolygon( SdrObject* pObj , ::com::sun::star::drawing::PolygonKind eNew = com::sun::star::drawing::PolygonKind_LINE ) throw(com::sun::star::lang::IllegalArgumentException, com::sun::star::beans::PropertyVetoException);
+ virtual ~SvxShapePolyPolygon() throw();
+
+ // Local support functions
+ ::com::sun::star::drawing::PolygonKind GetPolygonKind() const throw();
+ void SetPolygon(const basegfx::B2DPolyPolygon& rNew) throw();
+ basegfx::B2DPolyPolygon GetPolygon() const throw();
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+
+class SvxShapePolyPolygonBezier : public SvxShapeText
+{
+private:
+ ::com::sun::star::drawing::PolygonKind mePolygonKind;
+
+protected:
+ using SvxUnoTextRangeBase::setPropertyValue;
+ using SvxUnoTextRangeBase::getPropertyValue;
+
+public:
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ SvxShapePolyPolygonBezier( SdrObject* pObj , ::com::sun::star::drawing::PolygonKind eNew = com::sun::star::drawing::PolygonKind_PATHLINE) throw();
+ virtual ~SvxShapePolyPolygonBezier() throw();
+
+ // Local support functions
+ ::com::sun::star::drawing::PolygonKind GetPolygonKind() const throw();
+ void SetPolygon(const basegfx::B2DPolyPolygon & rNew) throw();
+ basegfx::B2DPolyPolygon GetPolygon() const throw();
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+class SvxGraphicObject : public SvxShapeText
+{
+protected:
+ using SvxUnoTextRangeBase::setPropertyValue;
+ using SvxUnoTextRangeBase::getPropertyValue;
+
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+public:
+ SvxGraphicObject( SdrObject* pObj ) throw();
+ virtual ~SvxGraphicObject() throw();
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+class Svx3DSceneObject : public ::com::sun::star::drawing::XShapes, public SvxShape
+{
+private:
+ rtl::Reference< SvxDrawPage > mxPage;
+
+protected:
+ using SvxShape::setPropertyValue;
+ using SvxShape::getPropertyValue;
+
+public:
+ Svx3DSceneObject( SdrObject* pObj, SvxDrawPage* pDrawPage ) throw();
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ virtual ~Svx3DSceneObject() throw();
+
+ virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL );
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XShapes
+ virtual void SAL_CALL add( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException) ;
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+class Svx3DCubeObject : public SvxShape
+{
+protected:
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+public:
+ Svx3DCubeObject( SdrObject* pObj ) throw();
+ virtual ~Svx3DCubeObject() throw();
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+class Svx3DSphereObject : public SvxShape
+{
+public:
+ Svx3DSphereObject( SdrObject* pObj ) throw();
+protected:
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ virtual ~Svx3DSphereObject() throw();
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+class Svx3DLatheObject : public SvxShape
+{
+protected:
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+public:
+ Svx3DLatheObject( SdrObject* pObj ) throw();
+ virtual ~Svx3DLatheObject() throw();
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+class Svx3DExtrudeObject : public SvxShape
+{
+public:
+ Svx3DExtrudeObject( SdrObject* pObj ) throw();
+protected:
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ virtual ~Svx3DExtrudeObject() throw();
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+class Svx3DPolygonObject : public SvxShape
+{
+protected:
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+public:
+ Svx3DPolygonObject( SdrObject* pObj ) throw();
+ virtual ~Svx3DPolygonObject() throw();
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+typedef ::cppu::WeakAggImplHelper1<
+ ::com::sun::star::drawing::XEnhancedCustomShapeDefaulter
+ > SvxShape_UnoImplHelper1;
+
+class SVX_DLLPUBLIC SvxCustomShape : public SvxShapeText, public SvxShape_UnoImplHelper1
+{
+private:
+ rtl::Reference< SvxDrawPage > mxPage;
+
+protected:
+ using SvxUnoTextRangeBase::setPropertyValue;
+ using SvxUnoTextRangeBase::getPropertyValue;
+
+public:
+ SvxCustomShape( SdrObject* pObj ) throw ();
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+
+ virtual ~SvxCustomShape() throw ();
+
+ virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage = NULL );
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XShapeDescriptor
+ virtual OUString SAL_CALL getShapeType() throw(::com::sun::star::uno::RuntimeException);
+
+ // XShape
+ virtual ::com::sun::star::awt::Point SAL_CALL getPosition() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
+
+ // XPropertySet
+ void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, com::sun::star::beans::PropertyVetoException, com::sun::star::lang::IllegalArgumentException);
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+
+ //XEnhancedCustomShapeDefaulter
+ virtual void SAL_CALL createCustomShapeDefaults( const OUString& rShapeType ) throw (::com::sun::star::uno::RuntimeException);
+};
+
+/***********************************************************************
+* *
+***********************************************************************/
+
+class SvxMediaShape : public SvxShape
+{
+public:
+ SvxMediaShape( SdrObject* pObj ) throw();
+ virtual ~SvxMediaShape() throw();
+
+protected:
+ // overide these for special property handling in subcasses. Return true if property is handled
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/unoshcol.hxx b/include/svx/unoshcol.hxx
new file mode 100644
index 000000000000..7db908c88a92
--- /dev/null
+++ b/include/svx/unoshcol.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 _SVX_UNOSHGRP_HXX
+#define _SVX_UNOSHGRP_HXX
+
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <osl/mutex.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+
+#include <cppuhelper/implbase3.hxx>
+#include "svx/svxdllapi.h"
+
+class SvxShapeCollectionMutex
+{
+public:
+ ::osl::Mutex maMutex;
+};
+
+SVX_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvxShapeCollection_NewInstance() throw();
+
+/***********************************************************************
+* *
+***********************************************************************/
+class SVX_DLLPUBLIC SvxShapeCollection : public ::cppu::WeakAggImplHelper3<
+ ::com::sun::star::drawing::XShapes,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XComponent
+ >,
+ public SvxShapeCollectionMutex
+{
+private:
+ cppu::OInterfaceContainerHelper maShapeContainer;
+
+ cppu::OBroadcastHelper mrBHelper;
+
+ SVX_DLLPRIVATE virtual void disposing() throw();
+
+public:
+ SvxShapeCollection() throw();
+ virtual ~SvxShapeCollection() throw();
+
+ // XInterface
+ virtual void SAL_CALL release() throw();
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException) ;
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
+
+ // XShapes
+ virtual void SAL_CALL add( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ static com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static();
+ static OUString getImplementationName_Static();
+};
+
+::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL SvxShapeCollection_createInstance( const com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr );
+#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 000000000000..c39854f76b97
--- /dev/null
+++ b/include/svx/unoshprp.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 _SVX_UNOSHPRP_HXX
+#define _SVX_UNOSHPRP_HXX
+
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/drawing/PointSequence.hpp>
+#include <com/sun/star/drawing/PointSequenceSequence.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/drawing/RectanglePoint.hpp>
+#include <com/sun/star/awt/XBitmap.hpp>
+#include <com/sun/star/awt/Gradient.hpp>
+#include <com/sun/star/drawing/Hatch.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/LineCap.hpp>
+#include <com/sun/star/drawing/LineDash.hpp>
+#include <com/sun/star/drawing/LineJoint.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/drawing/TextAnimationDirection.hpp>
+#include <com/sun/star/drawing/TextAnimationKind.hpp>
+#include <com/sun/star/drawing/TextFitToSizeType.hpp>
+#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
+#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
+#include <com/sun/star/drawing/ConnectorType.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/MeasureKind.hpp>
+#include <com/sun/star/drawing/MeasureTextHorzPos.hpp>
+#include <com/sun/star/drawing/MeasureTextVertPos.hpp>
+#include <com/sun/star/drawing/HomogenMatrix3.hpp>
+#include <com/sun/star/drawing/CircleKind.hpp>
+#include <com/sun/star/drawing/PolygonKind.hpp>
+#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
+#include <com/sun/star/drawing/ColorMode.hpp>
+#include <com/sun/star/drawing/HomogenMatrix.hpp>
+#include <com/sun/star/drawing/Direction3D.hpp>
+#include <com/sun/star/drawing/ProjectionMode.hpp>
+#include <com/sun/star/drawing/ShadeMode.hpp>
+#include <com/sun/star/drawing/Position3D.hpp>
+#include <com/sun/star/drawing/NormalsKind.hpp>
+#include <com/sun/star/drawing/TextureKind.hpp>
+#include <com/sun/star/drawing/TextureMode.hpp>
+#include <com/sun/star/drawing/TextureProjectionMode.hpp>
+#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
+#include <com/sun/star/text/GraphicCrop.hpp>
+#include <com/sun/star/drawing/BitmapMode.hpp>
+#include <com/sun/star/drawing/CameraGeometry.hpp>
+#include <com/sun/star/text/WritingMode.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+
+#include <svx/unoprov.hxx>
+#include <editeng/unoprnms.hxx>
+#include <svx/unomid.hxx>
+#include <editeng/unotext.hxx>
+#include <svl/itemprop.hxx>
+
+#include <svx/svxids.hrc>
+
+#ifndef SEQTYPE
+ #if defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x500)
+ #define SEQTYPE(x) (new ::com::sun::star::uno::Type( x ))
+ #else
+ #define SEQTYPE(x) &(x)
+ #endif
+#endif
+
+#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_GRAFURL (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_REPLACEMENTGRAFURL (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)
+// ATTENTION: maximum is OWN_ATTR_VALUE_START+90, see svl/inc/svl/solar.hrc
+
+// #FontWork#
+#define FONTWORK_PROPERTIES \
+ { MAP_CHAR_LEN("FontWorkStyle"), XATTR_FORMTXTSTYLE, /*ENUM*/&::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN("FontWorkAdjust"), XATTR_FORMTXTADJUST, /*ENUM*/&::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN("FontWorkDistance"), XATTR_FORMTXTDISTANCE, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN("FontWorkStart"), XATTR_FORMTXTSTART, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN("FontWorkMirror"), XATTR_FORMTXTMIRROR, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN("FontWorkOutline"), XATTR_FORMTXTOUTLINE, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN("FontWorkShadow"), XATTR_FORMTXTSHADOW, /*ENUM*/&::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN("FontWorkShadowColor"), XATTR_FORMTXTSHDWCOLOR, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN("FontWorkShadowOffsetX"), XATTR_FORMTXTSHDWXVAL, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN("FontWorkShadowOffsetY"), XATTR_FORMTXTSHDWYVAL, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN("FontWorkForm"), XATTR_FORMTXTSTDFORM, /*ENUM*/&::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN("FontWorkHideForm"), XATTR_FORMTXTHIDEFORM, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN("FontWorkShadowTransparence"),XATTR_FORMTXTSHDWTRANSP, &::getCppuType((const sal_Int16*)0), 0, 0},
+
+#define SHADOW_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_SHADOW), SDRATTR_SHADOW, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_SHADOWCOLOR), SDRATTR_SHADOWCOLOR, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_SHADOWTRANSPARENCE),SDRATTR_SHADOWTRANSPARENCE, &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_SHADOWXDIST), SDRATTR_SHADOWXDIST, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_SHADOWYDIST), SDRATTR_SHADOWYDIST, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM},
+
+#define LINE_PROPERTIES_DEFAULTS\
+ { MAP_CHAR_LEN(UNO_NAME_LINECAP), XATTR_LINECAP, &::getCppuType((const ::com::sun::star::drawing::LineCap*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_LINECOLOR), XATTR_LINECOLOR, &::getCppuType((const sal_Int32*)0) , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_LINEENDCENTER), XATTR_LINEENDCENTER, &::getBooleanCppuType() , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_LINEENDWIDTH), XATTR_LINEENDWIDTH, &::getCppuType((const sal_Int32*)0) , 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_LINEJOINT), XATTR_LINEJOINT, &::getCppuType((const ::com::sun::star::drawing::LineJoint*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_LINESTARTCENTER), XATTR_LINESTARTCENTER, &::getBooleanCppuType() , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_LINESTARTWIDTH), XATTR_LINESTARTWIDTH, &::getCppuType((const sal_Int32*)0) , 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_LINESTYLE), XATTR_LINESTYLE, &::getCppuType((const ::com::sun::star::drawing::LineStyle*)0) , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_LINETRANSPARENCE), XATTR_LINETRANSPARENCE, &::getCppuType((const sal_Int16*)0) , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_LINEWIDTH), XATTR_LINEWIDTH, &::getCppuType((const sal_Int32*)0) , 0, SFX_METRIC_ITEM},
+
+#define LINE_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_LINEDASH), XATTR_LINEDASH, &::getCppuType((const ::com::sun::star::drawing::LineDash*)0) , 0, MID_LINEDASH}, \
+ { MAP_CHAR_LEN("LineDashName"), XATTR_LINEDASH, &::getCppuType((const OUString*)0) , 0, MID_NAME}, \
+ LINE_PROPERTIES_DEFAULTS
+
+#define LINE_PROPERTIES_START_END \
+ { MAP_CHAR_LEN(UNO_NAME_LINEEND), XATTR_LINEEND, SEQTYPE(::getCppuType((const ::com::sun::star::drawing::PolyPolygonBezierCoords*)0)), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, \
+ { MAP_CHAR_LEN("LineEndName"), XATTR_LINEEND, &::getCppuType((const OUString*)0), 0, MID_NAME }, \
+ { MAP_CHAR_LEN(UNO_NAME_LINESTART), XATTR_LINESTART, SEQTYPE(::getCppuType((const ::com::sun::star::drawing::PolyPolygonBezierCoords*)0)), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, \
+ { MAP_CHAR_LEN("LineStartName"), XATTR_LINESTART, &::getCppuType((const OUString*)0), 0, MID_NAME },
+
+#define FILL_PROPERTIES_BMP \
+ { MAP_CHAR_LEN(UNO_NAME_FILLBMP_LOGICAL_SIZE), XATTR_FILLBMP_SIZELOG, &::getBooleanCppuType() , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLBMP_OFFSET_X), XATTR_FILLBMP_TILEOFFSETX, &::getCppuType((const sal_Int32*)0) , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLBMP_OFFSET_Y), XATTR_FILLBMP_TILEOFFSETY, &::getCppuType((const sal_Int32*)0) , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLBMP_POSITION_OFFSET_X), XATTR_FILLBMP_POSOFFSETX, &::getCppuType((const sal_Int32*)0) , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLBMP_POSITION_OFFSET_Y), XATTR_FILLBMP_POSOFFSETY, &::getCppuType((const sal_Int32*)0) , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLBMP_RECTANGLE_POINT), XATTR_FILLBMP_POS, &::getCppuType((const ::com::sun::star::drawing::RectanglePoint*)0) , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLBMP_SIZE_X), XATTR_FILLBMP_SIZEX, &::getCppuType((const sal_Int32*)0) , 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLBMP_SIZE_Y), XATTR_FILLBMP_SIZEY, &::getCppuType((const sal_Int32*)0) , 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLBMP_STRETCH), XATTR_FILLBMP_STRETCH, &::getBooleanCppuType() , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLBMP_TILE), XATTR_FILLBMP_TILE, &::getBooleanCppuType() , 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_FILLBMP_MODE), OWN_ATTR_FILLBMP_MODE, &::getCppuType((const ::com::sun::star::drawing::BitmapMode*)0), 0, 0},
+
+#define FILL_PROPERTIES_DEFAULTS \
+ { MAP_CHAR_LEN(UNO_NAME_FILLCOLOR), XATTR_FILLCOLOR , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+
+#define FILL_PROPERTIES \
+ FILL_PROPERTIES_BMP \
+ FILL_PROPERTIES_DEFAULTS \
+ { MAP_CHAR_LEN(UNO_NAME_FILLBACKGROUND), XATTR_FILLBACKGROUND , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLBITMAP), XATTR_FILLBITMAP , &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap >*)0) , 0, MID_BITMAP}, \
+ { MAP_CHAR_LEN("FillBitmapName"), XATTR_FILLBITMAP , &::getCppuType((const OUString*)0), 0, MID_NAME }, \
+ { MAP_CHAR_LEN("FillBitmapURL"), XATTR_FILLBITMAP , &::getCppuType((const OUString*)0), 0, MID_GRAFURL }, \
+ { MAP_CHAR_LEN("FillGradientStepCount"), XATTR_GRADIENTSTEPCOUNT , &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLGRADIENT), XATTR_FILLGRADIENT , &::getCppuType((const ::com::sun::star::awt::Gradient*)0), 0, MID_FILLGRADIENT}, \
+ { MAP_CHAR_LEN("FillGradientName"), XATTR_FILLGRADIENT , &::getCppuType((const OUString*)0), 0, MID_NAME }, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLHATCH), XATTR_FILLHATCH , &::getCppuType((const ::com::sun::star::drawing::Hatch*)0), 0, MID_FILLHATCH}, \
+ { MAP_CHAR_LEN("FillHatchName"), XATTR_FILLHATCH , &::getCppuType((const OUString*)0), 0, MID_NAME }, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLSTYLE), XATTR_FILLSTYLE , &::getCppuType((const ::com::sun::star::drawing::FillStyle*)0) , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_FILL_TRANSPARENCE), XATTR_FILLTRANSPARENCE, &::getCppuType((const sal_Int16*)0) , 0, 0}, \
+ { MAP_CHAR_LEN("FillTransparenceGradient"), XATTR_FILLFLOATTRANSPARENCE, &::getCppuType((const ::com::sun::star::awt::Gradient*)0), 0, MID_FILLGRADIENT}, \
+ { MAP_CHAR_LEN("FillTransparenceGradientName"), XATTR_FILLFLOATTRANSPARENCE, &::getCppuType((const OUString*)0), 0, MID_NAME }, \
+ { MAP_CHAR_LEN(UNO_NAME_FILLCOLOR_2), XATTR_SECONDARYFILLCOLOR, &::getCppuType((const sal_Int32*)0), 0, 0},
+
+#define EDGERADIUS_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_EDGERADIUS), SDRATTR_ECKENRADIUS , &::getCppuType((const sal_Int32*)0) , 0, SFX_METRIC_ITEM},
+
+#define TEXT_PROPERTIES_DEFAULTS\
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_WRITINGMODE), SDRATTR_TEXTDIRECTION, &::getCppuType((const ::com::sun::star::text::WritingMode*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_ANIAMOUNT), SDRATTR_TEXT_ANIAMOUNT, &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_ANICOUNT), SDRATTR_TEXT_ANICOUNT, &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_ANIDELAY), SDRATTR_TEXT_ANIDELAY, &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_ANIDIRECTION), SDRATTR_TEXT_ANIDIRECTION, &::getCppuType((const ::com::sun::star::drawing::TextAnimationDirection*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_ANIKIND), SDRATTR_TEXT_ANIKIND, &::getCppuType((const ::com::sun::star::drawing::TextAnimationKind*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_ANISTARTINSIDE), SDRATTR_TEXT_ANISTARTINSIDE, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_ANISTOPINSIDE), SDRATTR_TEXT_ANISTOPINSIDE, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_AUTOGROWHEIGHT), SDRATTR_TEXT_AUTOGROWHEIGHT, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_AUTOGROWWIDTH), SDRATTR_TEXT_AUTOGROWWIDTH, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_CONTOURFRAME), SDRATTR_TEXT_CONTOURFRAME, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_FITTOSIZE), SDRATTR_TEXT_FITTOSIZE, &::getCppuType((const ::com::sun::star::drawing::TextFitToSizeType*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_HORZADJUST), SDRATTR_TEXT_HORZADJUST, &::getCppuType((const ::com::sun::star::drawing::TextHorizontalAdjust*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_LEFTDIST), SDRATTR_TEXT_LEFTDIST, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_LOWERDIST), SDRATTR_TEXT_LOWERDIST, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_MAXFRAMEHEIGHT), SDRATTR_TEXT_MAXFRAMEHEIGHT, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_MAXFRAMEWIDTH), SDRATTR_TEXT_MAXFRAMEWIDTH, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_MINFRAMEHEIGHT), SDRATTR_TEXT_MINFRAMEHEIGHT, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_MINFRAMEWIDTH), SDRATTR_TEXT_MINFRAMEWIDTH, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_RIGHTDIST), SDRATTR_TEXT_RIGHTDIST, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_UPPERDIST), SDRATTR_TEXT_UPPERDIST, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_FONTINDEPENDENTLINESPACING),SDRATTR_TEXT_USEFIXEDCELLHEIGHT,&::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_VERTADJUST), SDRATTR_TEXT_VERTADJUST, &::getCppuType((const ::com::sun::star::drawing::TextVerticalAdjust*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_TEXT_WORDWRAP), SDRATTR_TEXT_WORDWRAP, &::getBooleanCppuType(), 0, 0}, \
+ SVX_UNOEDIT_CHAR_PROPERTIES, \
+ SVX_UNOEDIT_PARA_PROPERTIES,
+
+#define TEXT_PROPERTIES \
+ SVX_UNOEDIT_NUMBERING_PROPERTIE, \
+ TEXT_PROPERTIES_DEFAULTS
+
+// { MAP_CHAR_LEN("HasLevels"), OWN_ATTR_HASLEVELS, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
+
+#define MISC_OBJ_PROPERTIES_NO_SHEAR \
+ { MAP_CHAR_LEN("Transformation"), OWN_ATTR_TRANSFORMATION, &::getCppuType((const struct com::sun::star::drawing::HomogenMatrix3*)0), 0, 0 }, \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_ZORDER), OWN_ATTR_ZORDER, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_FRAMERECT), OWN_ATTR_FRAMERECT, &::getCppuType((const ::com::sun::star::awt::Rectangle*)0), 0, 0 }, \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_ROTATEANGLE), SDRATTR_ROTATEANGLE, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_BITMAP), OWN_ATTR_BITMAP, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap >*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_OLE2_METAFILE), OWN_ATTR_METAFILE, SEQTYPE(::getCppuType((::com::sun::star::uno::Sequence<sal_Int8>*)0)), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, \
+ { MAP_CHAR_LEN("IsFontwork"), OWN_ATTR_ISFONTWORK, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_BOUNDRECT), OWN_ATTR_BOUNDRECT, &::getCppuType((const ::com::sun::star::awt::Rectangle*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
+
+#define MISC_OBJ_PROPERTIES \
+ MISC_OBJ_PROPERTIES_NO_SHEAR \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_SHEARANGLE), SDRATTR_SHEARANGLE, &::getCppuType((const sal_Int32*)0), 0, 0},
+
+
+#define SHAPE_DESCRIPTOR_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_LAYERID), SDRATTR_LAYERID , &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_LAYERNAME), SDRATTR_LAYERNAME , &::getCppuType((const OUString*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_MOVEPROTECT), SDRATTR_OBJMOVEPROTECT , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_NAME), SDRATTR_OBJECTNAME , &::getCppuType((const OUString*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_PRINTABLE), SDRATTR_OBJPRINTABLE , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN("Visible"), SDRATTR_OBJVISIBLE , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_SIZEPROTECT), SDRATTR_OBJSIZEPROTECT , &::getBooleanCppuType(), 0, 0},\
+ { MAP_CHAR_LEN("UINameSingular"), OWN_ATTR_UINAME_SINGULAR , &::getCppuType((const OUString*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, \
+ { MAP_CHAR_LEN("UINamePlural"), OWN_ATTR_UINAME_PLURAL , &::getCppuType((const OUString*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, \
+ /* #i68101# */ \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_TITLE), OWN_ATTR_MISC_OBJ_TITLE , &::getCppuType((const OUString*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_DESCRIPTION), OWN_ATTR_MISC_OBJ_DESCRIPTION , &::getCppuType((const OUString*)0), 0, 0},
+
+#define LINKTARGET_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_LINKDISPLAYNAME), OWN_ATTR_LDNAME , &::getCppuType((const OUString*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_LINKDISPLAYBITMAP), OWN_ATTR_LDBITMAP , &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap >*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
+
+
+#define CONNECTOR_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_EDGEKIND), SDRATTR_EDGEKIND, &::getCppuType((const ::com::sun::star::drawing::ConnectorType*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_EDGENODE1HORZDIST), SDRATTR_EDGENODE1HORZDIST, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_EDGENODE1VERTDIST), SDRATTR_EDGENODE1VERTDIST, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_EDGENODE2HORZDIST), SDRATTR_EDGENODE2HORZDIST, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_EDGENODE2VERTDIST), SDRATTR_EDGENODE2VERTDIST, &::getCppuType((const sal_Int32*)0), 0, 0},
+
+#define SPECIAL_CONNECTOR_PROPERTIES \
+ CONNECTOR_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_EDGELINE1DELTA), SDRATTR_EDGELINE1DELTA, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_EDGELINE2DELTA), SDRATTR_EDGELINE2DELTA, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_EDGELINE3DELTA), SDRATTR_EDGELINE3DELTA, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN("StartShape"), OWN_ATTR_EDGE_START_OBJ, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, \
+ { MAP_CHAR_LEN("StartGluePointIndex"), OWN_ATTR_GLUEID_HEAD, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN("StartPosition"), OWN_ATTR_EDGE_START_POS, &::getCppuType((const ::com::sun::star::awt::Point*)0), 0, 0}, \
+ { MAP_CHAR_LEN("EndShape"), OWN_ATTR_EDGE_END_OBJ, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, \
+ { MAP_CHAR_LEN("EndPosition"), OWN_ATTR_EDGE_END_POS, &::getCppuType((const ::com::sun::star::awt::Point*)0), 0, 0},\
+ { MAP_CHAR_LEN("EndGluePointIndex"), OWN_ATTR_GLUEID_TAIL, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+\
+ { MAP_CHAR_LEN("EdgeStartConnection"), OWN_ATTR_EDGE_START_OBJ, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, \
+ { MAP_CHAR_LEN("EdgeStartPoint"), OWN_ATTR_EDGE_START_POS, &::getCppuType((const ::com::sun::star::awt::Point*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, \
+ { MAP_CHAR_LEN("EdgeEndConnection"), OWN_ATTR_EDGE_END_OBJ, &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, \
+ { MAP_CHAR_LEN("EdgeEndPoint"), OWN_ATTR_EDGE_END_POS, &::getCppuType((const ::com::sun::star::awt::Point*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, \
+\
+ { MAP_CHAR_LEN(UNO_NAME_POLYPOLYGONBEZIER), OWN_ATTR_EDGE_POLYPOLYGONBEZIER, &::getCppuType((const ::com::sun::star::drawing::PolyPolygonBezierCoords*)0), 0, 0},
+
+#define SPECIAL_DIMENSIONING_PROPERTIES_DEFAULTS \
+ { MAP_CHAR_LEN(UNO_NAME_MEASUREBELOWREFEDGE), SDRATTR_MEASUREBELOWREFEDGE, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASUREFORMATSTRING), SDRATTR_MEASUREFORMATSTRING, &::getCppuType((const OUString*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASUREHELPLINE1LEN), SDRATTR_MEASUREHELPLINE1LEN, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASUREHELPLINE2LEN), SDRATTR_MEASUREHELPLINE2LEN, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASUREHELPLINEDIST), SDRATTR_MEASUREHELPLINEDIST, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASUREHELPLINEOVERHANG), SDRATTR_MEASUREHELPLINEOVERHANG, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASUREKIND), SDRATTR_MEASUREKIND, &::getCppuType((const ::com::sun::star::drawing::MeasureKind*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASURELINEDIST), SDRATTR_MEASURELINEDIST, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASUREOVERHANG), SDRATTR_MEASUREOVERHANG, &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASUREUNIT), SDRATTR_MEASUREUNIT, &::getCppuType((const sal_Int32*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_MEASURESHOWUNIT), SDRATTR_MEASURESHOWUNIT, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASURETEXTAUTOANGLE), SDRATTR_MEASURETEXTAUTOANGLE, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASURETEXTAUTOANGLEVIEW), SDRATTR_MEASURETEXTAUTOANGLEVIEW, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASURETEXTFIXEDANGLE), SDRATTR_MEASURETEXTFIXEDANGLE, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASURETEXTHPOS), SDRATTR_MEASURETEXTHPOS, &::getCppuType((const ::com::sun::star::drawing::MeasureTextHorzPos*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASURETEXTISFIXEDANGLE), SDRATTR_MEASURETEXTISFIXEDANGLE, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASURETEXTROTA90), SDRATTR_MEASURETEXTROTA90, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASURETEXTUPSIDEDOWN), SDRATTR_MEASURETEXTUPSIDEDOWN, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_MEASURETEXTVPOS), SDRATTR_MEASURETEXTVPOS, &::getCppuType((const ::com::sun::star::drawing::MeasureTextVertPos*)0), 0, 0}, \
+ { MAP_CHAR_LEN("MeasureDecimalPlaces"), SDRATTR_MEASUREDECIMALPLACES, &::getCppuType((const sal_Int16*)0), 0, 0},
+
+
+#define SPECIAL_DIMENSIONING_PROPERTIES \
+ SPECIAL_DIMENSIONING_PROPERTIES_DEFAULTS \
+ { MAP_CHAR_LEN("StartPosition"), OWN_ATTR_MEASURE_START_POS, &::getCppuType((const ::com::sun::star::awt::Point*)0), 0, 0},\
+ { MAP_CHAR_LEN("EndPosition"), OWN_ATTR_MEASURE_END_POS, &::getCppuType((const ::com::sun::star::awt::Point*)0), 0, 0},
+
+#define SPECIAL_CIRCLE_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_CIRCENDANGLE), SDRATTR_CIRCENDANGLE, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_CIRCKIND), SDRATTR_CIRCKIND, &::getCppuType((const ::com::sun::star::drawing::CircleKind*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_CIRCSTARTANGLE),SDRATTR_CIRCSTARTANGLE, &::getCppuType((const sal_Int32*)0), 0, 0},
+
+#define SPECIAL_POLYGON_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_POLYGONKIND), OWN_ATTR_VALUE_POLYGONKIND, &::getCppuType((const ::com::sun::star::drawing::PolygonKind*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
+
+#define SPECIAL_POLYPOLYGON_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_POLYPOLYGON), OWN_ATTR_VALUE_POLYPOLYGON, SEQTYPE(::getCppuType((const ::com::sun::star::drawing::PointSequenceSequence*)0)), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_POLYGON), OWN_ATTR_VALUE_POLYGON, SEQTYPE(::getCppuType((const ::com::sun::star::drawing::PointSequence*)0)), 0, 0},
+
+#define SPECIAL_POLYPOLYGONBEZIER_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_POLYPOLYGONBEZIER), OWN_ATTR_VALUE_POLYPOLYGONBEZIER, &::getCppuType((const ::com::sun::star::drawing::PolyPolygonBezierCoords*)0), 0, 0},
+
+#define SPECIAL_GRAPHOBJ_PROPERTIES_DEFAULTS \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHIC_LUMINANCE), SDRATTR_GRAFLUMINANCE , &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHIC_CONTRAST), SDRATTR_GRAFCONTRAST , &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHIC_RED), SDRATTR_GRAFRED , &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHIC_GREEN), SDRATTR_GRAFGREEN , &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHIC_BLUE), SDRATTR_GRAFBLUE , &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHIC_GAMMA), SDRATTR_GRAFGAMMA , &::getCppuType((const double*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHIC_TRANSPARENCY), SDRATTR_GRAFTRANSPARENCE , &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHIC_COLOR_MODE), SDRATTR_GRAFMODE , &::getCppuType((const ::com::sun::star::drawing::ColorMode*)0), 0, 0},
+
+#define SPECIAL_GRAPHOBJ_PROPERTIES \
+ SPECIAL_GRAPHOBJ_PROPERTIES_DEFAULTS \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHIC_GRAPHICCROP), SDRATTR_GRAFCROP , &::getCppuType((const ::com::sun::star::text::GraphicCrop*)0), 0, 0 }, \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHOBJ_GRAFURL), OWN_ATTR_GRAFURL , &::getCppuType((const OUString*)0), 0, 0 }, \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHOBJ_REPLACEMENTGRAFURL), OWN_ATTR_REPLACEMENTGRAFURL , &::getCppuType((const OUString*)0), 0, 0 }, \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHOBJ_GRAFSTREAMURL), OWN_ATTR_GRAFSTREAMURL , &::getCppuType((const OUString*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHOBJ_FILLBITMAP), OWN_ATTR_VALUE_FILLBITMAP , &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap>*)0) , 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_GRAPHOBJ_GRAPHIC), OWN_ATTR_VALUE_GRAPHIC , &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic>*)0) , 0, 0},
+
+
+#define SPECIAL_3DSCENEOBJECT_PROPERTIES_DEFAULTS \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_AMBIENTCOLOR), SDRATTR_3DSCENE_AMBIENTCOLOR , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_DISTANCE), SDRATTR_3DSCENE_DISTANCE , &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_FOCAL_LENGTH), SDRATTR_3DSCENE_FOCAL_LENGTH , &::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTCOLOR_1), SDRATTR_3DSCENE_LIGHTCOLOR_1 , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTCOLOR_2), SDRATTR_3DSCENE_LIGHTCOLOR_2 , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTCOLOR_3), SDRATTR_3DSCENE_LIGHTCOLOR_3 , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTCOLOR_4), SDRATTR_3DSCENE_LIGHTCOLOR_4 , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTCOLOR_5), SDRATTR_3DSCENE_LIGHTCOLOR_5 , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTCOLOR_6), SDRATTR_3DSCENE_LIGHTCOLOR_6 , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTCOLOR_7), SDRATTR_3DSCENE_LIGHTCOLOR_7 , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTCOLOR_8), SDRATTR_3DSCENE_LIGHTCOLOR_8 , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTDIRECTION_1), SDRATTR_3DSCENE_LIGHTDIRECTION_1 , &::getCppuType((const ::com::sun::star::drawing::Direction3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTDIRECTION_2), SDRATTR_3DSCENE_LIGHTDIRECTION_2 , &::getCppuType((const ::com::sun::star::drawing::Direction3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTDIRECTION_3), SDRATTR_3DSCENE_LIGHTDIRECTION_3 , &::getCppuType((const ::com::sun::star::drawing::Direction3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTDIRECTION_4), SDRATTR_3DSCENE_LIGHTDIRECTION_4 , &::getCppuType((const ::com::sun::star::drawing::Direction3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTDIRECTION_5), SDRATTR_3DSCENE_LIGHTDIRECTION_5 , &::getCppuType((const ::com::sun::star::drawing::Direction3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTDIRECTION_6), SDRATTR_3DSCENE_LIGHTDIRECTION_6 , &::getCppuType((const ::com::sun::star::drawing::Direction3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTDIRECTION_7), SDRATTR_3DSCENE_LIGHTDIRECTION_7 , &::getCppuType((const ::com::sun::star::drawing::Direction3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTDIRECTION_8), SDRATTR_3DSCENE_LIGHTDIRECTION_8 , &::getCppuType((const ::com::sun::star::drawing::Direction3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTON_1), SDRATTR_3DSCENE_LIGHTON_1 , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTON_2), SDRATTR_3DSCENE_LIGHTON_2 , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTON_3), SDRATTR_3DSCENE_LIGHTON_3 , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTON_4), SDRATTR_3DSCENE_LIGHTON_4 , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTON_5), SDRATTR_3DSCENE_LIGHTON_5 , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTON_6), SDRATTR_3DSCENE_LIGHTON_6 , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTON_7), SDRATTR_3DSCENE_LIGHTON_7 , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_LIGHTON_8), SDRATTR_3DSCENE_LIGHTON_8 , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_PERSPECTIVE), SDRATTR_3DSCENE_PERSPECTIVE , &::getCppuType((const ::com::sun::star::drawing::ProjectionMode*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_SHADOW_SLANT), SDRATTR_3DSCENE_SHADOW_SLANT , &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_SHADE_MODE), SDRATTR_3DSCENE_SHADE_MODE , &::getCppuType((const ::com::sun::star::drawing::ShadeMode*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SCENE_TWO_SIDED_LIGHTING),SDRATTR_3DSCENE_TWO_SIDED_LIGHTING, &::getBooleanCppuType(), 0, 0},
+
+#define SPECIAL_3DSCENEOBJECT_PROPERTIES \
+ SPECIAL_3DSCENEOBJECT_PROPERTIES_DEFAULTS \
+ { MAP_CHAR_LEN(UNO_NAME_3D_TRANSFORM_MATRIX), OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX , &::getCppuType((const ::com::sun::star::drawing::HomogenMatrix*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_CAMERA_GEOMETRY), OWN_ATTR_3D_VALUE_CAMERA_GEOMETRY , &::getCppuType((const ::com::sun::star::drawing::CameraGeometry*)0), 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 \
+ { MAP_CHAR_LEN(UNO_NAME_3D_DOUBLE_SIDED ),SDRATTR_3DOBJ_DOUBLE_SIDED , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_MAT_COLOR ),SDRATTR_3DOBJ_MAT_COLOR , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_MAT_EMISSION ),SDRATTR_3DOBJ_MAT_EMISSION , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_MAT_SPECULAR ),SDRATTR_3DOBJ_MAT_SPECULAR , &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_MAT_SPECULAR_INTENSITY ),SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY , &::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_NORMALS_INVERT ),SDRATTR_3DOBJ_NORMALS_INVERT , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_NORMALS_KIND ),SDRATTR_3DOBJ_NORMALS_KIND , &::getCppuType((const ::com::sun::star::drawing::NormalsKind*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SHADOW_3D ),SDRATTR_3DOBJ_SHADOW_3D , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_TEXTURE_FILTER ),SDRATTR_3DOBJ_TEXTURE_FILTER , &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_TEXTURE_KIND ),SDRATTR_3DOBJ_TEXTURE_KIND , &::getCppuType((const ::com::sun::star::drawing::TextureKind*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_TEXTURE_MODE ),SDRATTR_3DOBJ_TEXTURE_MODE , &::getCppuType((const ::com::sun::star::drawing::TextureMode*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_TEXTURE_PROJ_X ),SDRATTR_3DOBJ_TEXTURE_PROJ_X , &::getCppuType((const ::com::sun::star::drawing::TextureProjectionMode*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_TEXTURE_PROJ_Y ),SDRATTR_3DOBJ_TEXTURE_PROJ_Y , &::getCppuType((const ::com::sun::star::drawing::TextureProjectionMode*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_REDUCED_LINE_GEOMETRY ),SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY , &::getBooleanCppuType(), 0, 0},
+
+#define SPECIAL_3DCUBEOBJECT_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_3D_TRANSFORM_MATRIX ),OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX , &::getCppuType((const ::com::sun::star::drawing::HomogenMatrix*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_POS ),OWN_ATTR_3D_VALUE_POSITION , &::getCppuType((const ::com::sun::star::drawing::Position3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SIZE ),OWN_ATTR_3D_VALUE_SIZE , &::getCppuType((const ::com::sun::star::drawing::Direction3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_POS_IS_CENTER ),OWN_ATTR_3D_VALUE_POS_IS_CENTER , &::getBooleanCppuType(), 0, 0},
+
+#define SPECIAL_3DSPHEREOBJECT_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_3D_TRANSFORM_MATRIX ),OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX , &::getCppuType((const ::com::sun::star::drawing::HomogenMatrix*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_POS ),OWN_ATTR_3D_VALUE_POSITION , &::getCppuType((const ::com::sun::star::drawing::Position3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SIZE ),OWN_ATTR_3D_VALUE_SIZE , &::getCppuType((const ::com::sun::star::drawing::Direction3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_HORZ_SEGS ),SDRATTR_3DOBJ_HORZ_SEGS, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_VERT_SEGS ),SDRATTR_3DOBJ_VERT_SEGS, &::getCppuType((const sal_Int32*)0), 0, 0},
+
+// #107245# New 3D properties which are possible for lathe and extrude 3d objects
+#define SPECIAL_3DLATHEANDEXTRUDEOBJ_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SMOOTH_NORMALS ), SDRATTR_3DOBJ_SMOOTH_NORMALS, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_SMOOTH_LIDS ), SDRATTR_3DOBJ_SMOOTH_LIDS, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_CHARACTER_MODE ), SDRATTR_3DOBJ_CHARACTER_MODE, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_CLOSE_FRONT ), SDRATTR_3DOBJ_CLOSE_FRONT, &::getBooleanCppuType(), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_CLOSE_BACK ), SDRATTR_3DOBJ_CLOSE_BACK, &::getBooleanCppuType(), 0, 0},
+
+#define SPECIAL_3DLATHEOBJECT_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_3D_TRANSFORM_MATRIX ),OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX ,&::getCppuType((const ::com::sun::star::drawing::HomogenMatrix*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_POLYPOLYGON3D ),OWN_ATTR_3D_VALUE_POLYPOLYGON3D ,&::getCppuType((const ::com::sun::star::drawing::PolyPolygonShape3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_LATHE_END_ANGLE ),SDRATTR_3DOBJ_END_ANGLE ,&::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_HORZ_SEGS ),SDRATTR_3DOBJ_HORZ_SEGS ,&::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_PERCENT_DIAGONAL ),SDRATTR_3DOBJ_PERCENT_DIAGONAL ,&::getCppuType((const sal_Int16*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_VERT_SEGS ),SDRATTR_3DOBJ_VERT_SEGS ,&::getCppuType((const sal_Int32*)0), 0, 0},
+
+#define SPECIAL_3DEXTRUDEOBJECT_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_3D_TRANSFORM_MATRIX ),OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX ,&::getCppuType((const ::com::sun::star::drawing::HomogenMatrix*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_POLYPOLYGON3D ),OWN_ATTR_3D_VALUE_POLYPOLYGON3D ,&::getCppuType((const ::com::sun::star::drawing::PolyPolygonShape3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_EXTRUDE_DEPTH ),SDRATTR_3DOBJ_DEPTH ,&::getCppuType((const sal_Int32*)0), 0, SFX_METRIC_ITEM}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_PERCENT_DIAGONAL ),SDRATTR_3DOBJ_PERCENT_DIAGONAL ,&::getCppuType((const sal_Int16*)0), 0, 0},
+
+#define SPECIAL_3DPOLYGONOBJECT_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_3D_TRANSFORM_MATRIX ),OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX , &::getCppuType((const ::com::sun::star::drawing::HomogenMatrix*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_POLYPOLYGON3D ),OWN_ATTR_3D_VALUE_POLYPOLYGON3D , &::getCppuType((const ::com::sun::star::drawing::PolyPolygonShape3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_NORMALSPOLYGON3D ),OWN_ATTR_3D_VALUE_NORMALSPOLYGON3D, &::getCppuType((const ::com::sun::star::drawing::PolyPolygonShape3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_TEXTUREPOLYGON3D ),OWN_ATTR_3D_VALUE_TEXTUREPOLYGON3D, &::getCppuType((const ::com::sun::star::drawing::PolyPolygonShape3D*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_3D_LINEONLY ),OWN_ATTR_3D_VALUE_LINEONLY , &::getBooleanCppuType(), 0, 0},
+
+#define SPECIAL_3DBACKSCALE_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_3D_BACKSCALE ),SDRATTR_3DOBJ_BACKSCALE ,&::getCppuType((const sal_Int16*)0), 0, 0}, \
+
+#define CUSTOMSHAPE_PROPERTIES \
+ { MAP_CHAR_LEN(UNO_NAME_CUSTOMSHAPE_ADJUSTMENT),SDRATTR_CUSTOMSHAPE_ADJUSTMENT, SEQTYPE(::getCppuType((::com::sun::star::uno::Sequence<sal_Int32>*)0)), 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 000000000000..cefc7012a0fd
--- /dev/null
+++ b/include/svx/unoshtxt.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 SVX_UNOSHTXT_HXX
+#define SVX_UNOSHTXT_HXX
+
+#include <memory>
+#include <editeng/unoedsrc.hxx>
+#include "svx/svxdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XInterface;
+ }
+ namespace accessibility {
+ struct TextSegment;
+ }
+} } }
+
+class SvxTextForwarder;
+class SdrObject;
+class SdrModel;
+class SdrView;
+class Window;
+class SvxTextEditSourceImpl;
+class SdrText;
+
+class SVX_DLLPUBLIC SvxTextEditSource : public SvxEditSource, public SvxViewForwarder
+{
+public:
+ SvxTextEditSource( SdrObject* pObj, SdrText* pText, ::com::sun::star::uno::XInterface* pOwner);
+
+ /** 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 Window& rViewWindow );
+
+ virtual ~SvxTextEditSource();
+
+ virtual SvxEditSource* Clone() const;
+ virtual SvxTextForwarder* GetTextForwarder();
+ virtual SvxViewForwarder* GetViewForwarder();
+ virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate = sal_False );
+ virtual void UpdateData();
+
+ virtual void addRange( SvxUnoTextRangeBase* pNewRange );
+ virtual void removeRange( SvxUnoTextRangeBase* pOldRange );
+ virtual const SvxUnoTextRangeBaseList& getRanges() const;
+
+ virtual SfxBroadcaster& GetBroadcaster() const;
+
+ void lock();
+ void unlock();
+
+ // the SvxViewForwarder interface
+ virtual sal_Bool IsValid() const;
+ virtual Rectangle GetVisArea() const;
+ virtual Point LogicToPixel( const Point&, const MapMode& ) const;
+ virtual Point PixelToLogic( const Point&, const MapMode& ) const;
+
+ void ChangeModel( SdrModel* pNewModel );
+
+ void UpdateOutliner();
+
+private:
+ SVX_DLLPRIVATE SvxTextEditSource( SvxTextEditSourceImpl* pImpl );
+
+ SvxTextEditSourceImpl* 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 000000000000..f705be2ff882
--- /dev/null
+++ b/include/svx/verttexttbxctrl.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 _SVX_VERT_TEXT_TBXCTRL_HXX
+#define _SVX_VERT_TEXT_TBXCTRL_HXX
+
+#include <sfx2/tbxctrl.hxx>
+#include "svx/svxdllapi.h"
+
+/*
+ control to remove/insert cjk settings dependent vertical text toolbox item
+ */
+class SvxVertCTLTextTbxCtrl : public SfxToolBoxControl
+{
+ sal_Bool bCheckVertical; //determines whether vertical mode or CTL mode has to be checked
+public:
+ SvxVertCTLTextTbxCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ ~SvxVertCTLTextTbxCtrl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ void SetVert(sal_Bool bSet) {bCheckVertical = bSet;}
+
+};
+
+class SVX_DLLPUBLIC SvxCTLTextTbxCtrl : public SvxVertCTLTextTbxCtrl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxCTLTextTbxCtrl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+};
+
+class SVX_DLLPUBLIC SvxVertTextTbxCtrl : public SvxVertCTLTextTbxCtrl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+ SvxVertTextTbxCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+};
+
+#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 000000000000..7f4d52307450
--- /dev/null
+++ b/include/svx/view3d.hxx
@@ -0,0 +1,266 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _E3D_VIEW3D_HXX
+#define _E3D_VIEW3D_HXX
+
+#include <svx/svdview.hxx>
+#include <svx/def3d.hxx>
+#include <svx/deflt3d.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include "svx/svxdllapi.h"
+
+//************************************************************
+// Vorausdeklarationen
+//************************************************************
+
+class E3dObject;
+class E3dScene;
+class Impl3DMirrorConstructOverlay;
+
+/*************************************************************************
+|*
+|* Ableitung von SdrView zur Bearbeitung von 3D-Objekten
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC E3dView : public SdrView
+{
+protected:
+ E3dDefaultAttributes a3DDefaultAttr;
+ MouseEvent aMouseEvent; // Die Parameter der letzten Events (Mouse, Keyboard)
+ Color aDefaultLightColor; // dito mit den Farben
+ Color aDefaultAmbientColor;
+
+ double fDefaultScaleX; // Verzerrungen
+ double fDefaultScaleY;
+ double fDefaultScaleZ;
+ double fDefaultRotateX; // und Drehungen
+ double fDefaultRotateY;
+ double fDefaultRotateZ;
+ double fDefaultExtrusionDeepth; // Extrusionstiefe
+ double fDefaultLightIntensity; // Intensitaeten der beiden (notwendigen) Licht-
+ double fDefaultAmbientIntensity; // quellen
+ long nHDefaultSegments; // wieviele HSegmente braucht mein Lathe-Ojekt
+ long nVDefaultSegments; // wieviele VSegmente braucht mein Lathe-Ojekt
+
+ E3dDragConstraint eDragConstraint;
+
+ // Migrate selections
+ Impl3DMirrorConstructOverlay* mpMirrorOverlay;
+
+ sal_Bool bDoubleSided;
+
+ void InitView();
+
+ void ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat);
+ void ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat);
+ void ImpChangeSomeAttributesFor3DConversion(SdrObject* pObj);
+ void ImpChangeSomeAttributesFor3DConversion2(SdrObject* pObj);
+
+ void InitScene(E3dScene* pScene, double fW, double fH, double fCamZ);
+ void ImpIsConvertTo3DPossible(SdrObject* pObj, bool& rAny3D, bool& rGroupSelected) const;
+ void BreakSingle3DObj(E3dObject* pObj);
+
+public:
+ TYPEINFO();
+ E3dView(SdrModel* pModel, OutputDevice* pOut = 0L);
+ virtual ~E3dView();
+
+ // Alle markierten Objekte auf dem angegebenen OutputDevice ausgeben.
+ virtual void DrawMarkedObj(OutputDevice& rOut) const;
+
+ // Zugriff auf die Default-Attribute
+ E3dDefaultAttributes& Get3DDefaultAttributes() { return a3DDefaultAttr; }
+ virtual sal_Bool BegDragObj(const Point& rPnt, OutputDevice* pOut = NULL, SdrHdl* pHdl = NULL, short nMinMov = -3, SdrDragMethod* pForcedMeth = NULL);
+ virtual void CheckPossibilities();
+
+ // Event setzen/rausruecken
+ void SetMouseEvent(const MouseEvent& rNew) { aMouseEvent = rNew; }
+ const MouseEvent& GetMouseEvent() { return aMouseEvent; }
+
+ // Model holen ueberladen, da bei einzelnen 3D Objekten noch eine Szene
+ // untergeschoben werden muss
+ virtual SdrModel* GetMarkedObjModel() const;
+
+ // Bei Paste muss - falls in eine Scene eingefuegt wird - die
+ // Objekte der Szene eingefuegt werden, die Szene selbst aber nicht
+ using SdrView::Paste;
+ virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+
+ // #83403# Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...)
+ bool ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene, Point aOffset);
+
+ bool IsConvertTo3DObjPossible() const;
+ void ConvertMarkedObjTo3D(bool bExtrude=true, basegfx::B2DPoint aPnt1 = basegfx::B2DPoint(0.0, 0.0), basegfx::B2DPoint aPnt2 = basegfx::B2DPoint(0.0, 1.0));
+
+ // Nachtraeglichhe Korrekturmoeglichkeit um alle Extrudes in einer
+ // bestimmten Tiefensortierung anzulegen
+ void DoDepthArrange(E3dScene* pScene, double fDepth);
+ void ConvertMarkedToPolyObj(sal_Bool bLineToArea);
+ E3dScene* SetCurrent3DObj(E3dObject* p3DObj);
+ void Start3DCreation();
+
+ // migration of overlay
+ bool Is3DRotationCreationActive() const { return (0L != mpMirrorOverlay); }
+
+ virtual void MovAction(const Point& rPnt);
+ void End3DCreation(bool bUseDefaultValuesForMirrorAxes=false);
+ void ResetCreationActive();
+
+ double GetDefaultCamPosZ();
+
+ double &DefaultScaleX ()
+ {
+ return fDefaultScaleX;
+ }
+
+ double DefaultScaleX () const
+ {
+ return fDefaultScaleX;
+ }
+
+ double &DefaultScaleY ()
+ {
+ return fDefaultScaleY;
+ }
+
+ double DefaultScaleY () const
+ {
+ return fDefaultScaleY;
+ }
+
+ double &DefaultScaleZ ()
+ {
+ return fDefaultScaleZ;
+ }
+
+ double DefaultScaleZ () const
+ {
+ return fDefaultScaleZ;
+ }
+
+ double &DefaultRotateX ()
+ {
+ return fDefaultRotateX;
+ }
+
+ double DefaultRotateX () const
+ {
+ return fDefaultRotateX;
+ }
+
+ double &DefaultRotateY ()
+ {
+ return fDefaultRotateY;
+ }
+
+ double DefaultRotateY () const
+ {
+ return fDefaultRotateY;
+ }
+
+ double &DefaultRotateZ ()
+ {
+ return fDefaultRotateZ;
+ }
+
+ double DefaultRotateZ () const
+ {
+ return fDefaultRotateZ;
+ }
+
+ double &DefaultExtrusionDeepth ()
+ {
+ return fDefaultExtrusionDeepth;
+ }
+
+ double DefaultExtrusionDeepth () const
+ {
+ return fDefaultExtrusionDeepth;
+ }
+
+ double GetDefaultCamFocal();
+
+ double &DefaultLightIntensity ()
+ {
+ return fDefaultLightIntensity;
+ }
+
+ double DefaultLightIntensity () const
+ {
+ return fDefaultLightIntensity;
+ }
+
+ double &DefaultAmbientIntensity ()
+ {
+ return fDefaultAmbientIntensity;
+ }
+
+ double DefaultAmbientIntensity () const
+ {
+ return fDefaultAmbientIntensity;
+ }
+
+ const Color &DefaultLightColor () const
+ {
+ return aDefaultLightColor;
+ }
+
+ Color DefaultLightColor ()
+ {
+ return aDefaultLightColor;
+ }
+
+ const Color &DefaultAmbientColor () const
+ {
+ return aDefaultAmbientColor;
+ }
+
+ Color DefaultAmbientColor ()
+ {
+ return aDefaultAmbientColor;
+ }
+
+ long GetHDefaultSegments() const { return nHDefaultSegments; }
+ void SetHDefaultSegments(long nSegs) { nHDefaultSegments = nSegs; }
+
+ long GetVDefaultSegments() const { return nVDefaultSegments; }
+ void SetVDefaultSegments(long nSegs) { nVDefaultSegments = nSegs; }
+
+ bool IsBreak3DObjPossible() const;
+ void Break3DObj();
+
+ sal_Bool DoubleSided () const
+ {
+ return bDoubleSided;
+ }
+
+ sal_Bool &DoubleSided ()
+ {
+ return bDoubleSided;
+ }
+
+ SfxItemSet Get3DAttributes(E3dScene* pInScene = NULL, sal_Bool bOnly3DAttr=sal_False) const;
+ void Set3DAttributes(const SfxItemSet& rAttr, E3dScene* pInScene = NULL, sal_Bool bOnly3DAttr=sal_False);
+};
+
+#endif // _E3D_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 000000000000..c7509ea7c1d1
--- /dev/null
+++ b/include/svx/viewlayoutitem.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 _SVX_VIEWLAYOUTITEM_HXX
+#define _SVX_VIEWLAYOUTITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <svx/svxids.hrc>
+#include "svx/svxdllapi.h"
+
+//-------------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxViewLayoutItem: public SfxUInt16Item
+{
+ bool mbBookMode;
+
+public:
+ TYPEINFO();
+
+ SvxViewLayoutItem( sal_uInt16 nColumns = 0, bool bBookMode = false, sal_uInt16 nWhich = SID_ATTR_VIEWLAYOUT );
+ SvxViewLayoutItem( const SvxViewLayoutItem& );
+ ~SvxViewLayoutItem();
+
+ void SetBookMode( bool bNew ) {mbBookMode = bNew; }
+ bool IsBookMode() const {return mbBookMode; }
+
+ // "pure virtual Methoden" vom SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStrm, sal_uInt16 nVersion ) const; // leer
+ virtual SvStream& Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const; // leer
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; // leer
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); // leer
+};
+
+//------------------------------------------------------------------------
+
+#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 000000000000..6b00ae2fa186
--- /dev/null
+++ b/include/svx/viewpt3d.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 _VIEWPT3D_HXX
+#define _VIEWPT3D_HXX
+
+#include "svx/svxdllapi.h"
+#include <basegfx/matrix/b3dhommatrix.hxx>
+#include <basegfx/point/b3dpoint.hxx>
+#include <basegfx/vector/b3dvector.hxx>
+#include <tools/gen.hxx>
+
+// predefines
+namespace basegfx { class B3DRange; } // end of namespace basegfx
+
+/*************************************************************************
+|*
+|* enums fuer Projektion und Seitenverhaeltnis
+|*
+\************************************************************************/
+
+enum ProjectionType { PR_PARALLEL, PR_PERSPECTIVE };
+enum AspectMapType { AS_NO_MAPPING, AS_HOLD_SIZE, AS_HOLD_X, AS_HOLD_Y };
+
+
+/*************************************************************************
+|*
+|* 3D-Viewport nach PHIGS
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC Viewport3D
+{
+ protected:
+ basegfx::B3DHomMatrix aViewTf; // die eigentliche Transformationsmatrix
+ 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-Koordinaten)
+ // bisher wird nur die Z-Koordinate beachtet
+ double fVPD; // View Plane Distance
+ double fNearClipDist; // Abstand der vorderen Clippingebene
+ double fFarClipDist; // Abstand der hinteren Clippingebene
+
+ ProjectionType eProjection; // Art der Projektion
+ AspectMapType eAspectMapping; // Flag fuer Seitenverhaeltnis-Anpassung
+ // bei Ausgabe auf das Geraet
+ Rectangle aDeviceRect; // Position und Groesse des Ausgabebereichs
+
+ struct
+ {
+ double X, Y, W, H; // Position und Groesse des View-Windows
+ } aViewWin; // in View-Koordinaten
+
+ basegfx::B3DPoint aViewPoint; // Beobachterstandpunkt in Weltkoordinaten;
+ // wird mit der Transformation berechnet
+ sal_Bool bTfValid; // Flag, ob Transformation gueltig ist
+
+ double fWRatio; // Device/View-Seitenverhaeltnisse
+ double fHRatio;
+
+ void MakeTransform(void);
+
+ 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);
+ void SetVPD(double fNewVPD);
+
+ const basegfx::B3DPoint& GetVRP() const { return aVRP; }
+ const basegfx::B3DVector& GetVPN() const { return aVPN; }
+ const basegfx::B3DVector& GetVUV() const { return aVUV; }
+ const basegfx::B3DPoint& GetPRP() const { return aPRP; }
+ double GetVPD() const { return fVPD; }
+ double GetNearClipDist() const { return fNearClipDist; }
+ double GetFarClipDist() const { return fFarClipDist; }
+
+ void SetProjection(ProjectionType ePrj)
+ { eProjection = ePrj; bTfValid = sal_False; }
+ ProjectionType GetProjection() const { return(eProjection); }
+
+ void SetAspectMapping(AspectMapType eAsp)
+ { eAspectMapping = eAsp; bTfValid = sal_False; }
+ AspectMapType GetAspectMapping() { return eAspectMapping; }
+
+ void SetViewWindow(double fX, double fY, double fW, double fH);
+
+ void SetDeviceWindow(const Rectangle& rRect);
+ const Rectangle& GetDeviceWindow() const { return aDeviceRect; }
+
+ // Beobachterstandpunkt in Weltkoordinaten zurueckgeben
+ const basegfx::B3DPoint& GetViewPoint();
+};
+
+#endif // _VIEWPT3D_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/wrapfield.hxx b/include/svx/wrapfield.hxx
new file mode 100644
index 000000000000..c8fa94ece3ce
--- /dev/null
+++ b/include/svx/wrapfield.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 SVX_WRAPFIELD_HXX
+#define SVX_WRAPFIELD_HXX
+
+#include <vcl/field.hxx>
+#include "svx/svxdllapi.h"
+
+namespace svx {
+
+// ============================================================================
+
+/** A numeric spin field that wraps around the value on limits.
+ @descr Note: Use type "NumericField" in resources. */
+class SVX_DLLPUBLIC WrapField : public NumericField
+{
+public:
+ explicit WrapField( Window* pParent, const ResId& rResId );
+ explicit WrapField( Window* pParent, WinBits nBits );
+
+protected:
+ /** Up event with wrap-around functionality. */
+ virtual void Up();
+ /** Down event with wrap-around functionality. */
+ virtual void Down();
+};
+
+// ============================================================================
+
+} // namespace svx
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xattr.hxx b/include/svx/xattr.hxx
new file mode 100644
index 000000000000..d3d1a1b6e057
--- /dev/null
+++ b/include/svx/xattr.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 _XATTR_HXX
+#define _XATTR_HXX
+
+#include <svx/xit.hxx>
+#include <svx/xcolit.hxx>
+#include <svx/xgrad.hxx>
+#include <svx/xhatch.hxx>
+#include <svx/xlineit.hxx>
+#include <svx/xfillit.hxx>
+#include <svx/xtextit.hxx>
+#include <svx/xlineit0.hxx>
+#include <svx/xfillit0.hxx>
+#include <svx/xtextit0.hxx>
+#include <svx/xsetit.hxx>
+#include <svx/xlinjoit.hxx>
+#include <svx/xlncapit.hxx>
+
+#endif // _XATTR_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 000000000000..959ceafdbd72
--- /dev/null
+++ b/include/svx/xbitmap.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 _SVX_XBITMAP_HXX
+#define _SVX_XBITMAP_HXX
+
+#include <tools/color.hxx>
+#include <vcl/bitmap.hxx>
+#include <svtools/grfmgr.hxx>
+#include <svx/xenum.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC XOBitmap
+{
+private:
+ XBitmapType eType;
+ GraphicObject aGraphicObject;
+ sal_uInt16* pPixelArray;
+ Size aArraySize;
+ Color aPixelColor;
+ Color aBckgrColor;
+ sal_Bool bGraphicDirty;
+
+ const GraphicObject& GetGraphicObject() const;
+
+public:
+ XOBitmap( const Bitmap& rBitmap );
+ XOBitmap( const XOBitmap& rXBmp );
+ ~XOBitmap();
+
+ XOBitmap& operator=( const XOBitmap& rXOBitmap );
+ int operator==( const XOBitmap& rXOBitmap ) const;
+
+ void Bitmap2Array();
+ void Array2Bitmap();
+
+ void SetBitmapType( XBitmapType eNewType ) { eType = eNewType; }
+ void SetPixelColor( const Color& rColor ) { aPixelColor = rColor; bGraphicDirty = sal_True; }
+ void SetPixelSize( const Size& rSize ) { aArraySize = rSize; bGraphicDirty = sal_True; }
+ void SetBackgroundColor( const Color& rColor ) { aBckgrColor = rColor; bGraphicDirty = sal_True; }
+
+ XBitmapType GetBitmapType() const { return eType; }
+ Bitmap GetBitmap() const;
+ Color GetPixelColor() const { return aPixelColor; }
+ 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 000000000000..d30e2fd5001f
--- /dev/null
+++ b/include/svx/xbtmpit.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 _SVX_XBTMPIT_HXX
+#define _SVX_XBTMPIT_HXX
+
+#include <svx/svxdllapi.h>
+#include <svx/xit.hxx>
+#include <svtools/grfmgr.hxx>
+
+class SdrModel;
+class BitmapColor;
+
+//////////////////////////////////////////////////////////////////////////////
+// helper to construct historical 8x8 bitmaps with two colors
+
+Bitmap SVX_DLLPUBLIC createHistorical8x8FromArray(const sal_uInt16* pArray, Color aColorPix, Color aColorBack);
+bool SVX_DLLPUBLIC isHistorical8x8(const BitmapEx& rBitmapEx, BitmapColor& o_rBack, BitmapColor& o_rFront);
+
+//////////////////////////////////////////////////////////////////////////////
+// class XFillBitmapItem
+
+class SVX_DLLPUBLIC XFillBitmapItem : public NameOrIndex
+{
+private:
+ GraphicObject maGraphicObject;
+
+public:
+ TYPEINFO();
+ XFillBitmapItem() : NameOrIndex(XATTR_FILLBITMAP, -1 ) {}
+ XFillBitmapItem(const String& rName, const GraphicObject& rGraphicObject);
+ XFillBitmapItem(SfxItemPool* pPool, const GraphicObject& rGraphicObject);
+ XFillBitmapItem( const XFillBitmapItem& rItem );
+ XFillBitmapItem( SvStream& rIn, sal_uInt16 nVer = 0 );
+
+ virtual int operator==( const SfxPoolItem& rItem ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+ virtual SvStream& Store( SvStream& rOut, sal_uInt16 nItemVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ const GraphicObject& GetGraphicObject() const;
+ void SetGraphicObject(const GraphicObject& rGraphicObject);
+
+ static sal_Bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
+ XFillBitmapItem* checkForUniqueItem( SdrModel* pModel ) const;
+};
+
+#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 000000000000..461c2b38af7e
--- /dev/null
+++ b/include/svx/xcolit.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 _SVX_XCOLORITEM_HXX
+#define _SVX_XCOLORITEM_HXX
+
+#include <tools/color.hxx>
+#include "svx/svxdllapi.h"
+
+#include <svx/xit.hxx>
+
+class XColorList;
+
+//-----------------
+// class XColorItem
+//-----------------
+class SVX_DLLPUBLIC XColorItem : public NameOrIndex
+{
+ Color aColor;
+
+public:
+ TYPEINFO();
+ XColorItem() {}
+ XColorItem(sal_uInt16 nWhich, sal_Int32 nIndex, const Color& rTheColor);
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ XColorItem(sal_uInt16 nWhich, const Color& rTheColor);
+ XColorItem(sal_uInt16 nWhich, const String& rName, const Color& rTheColor);
+ XColorItem(sal_uInt16 nWhich, SvStream& rIn);
+ XColorItem(const XColorItem& rItem);
+
+ virtual int operator==(const SfxPoolItem& rItem) const;
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual SvStream& Store(SvStream& rOut, sal_uInt16 nItemVersion ) const;
+
+ const Color& GetColorValue(const XColorList* pTable = 0) 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 000000000000..a55d3b83fa67
--- /dev/null
+++ b/include/svx/xdash.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 _SVX_XDASH_HXX
+#define _SVX_XDASH_HXX
+
+//-------------
+// class XDash
+//-------------
+
+#include <svx/xenum.hxx>
+#include "svx/svxdllapi.h"
+
+#include <vector>
+
+class SVX_DLLPUBLIC XDash
+{
+protected:
+ XDashStyle eDash;
+ sal_uInt16 nDots;
+ sal_uIntPtr nDotLen;
+ sal_uInt16 nDashes;
+ sal_uIntPtr nDashLen;
+ sal_uIntPtr nDistance;
+
+public:
+ XDash(XDashStyle eDash = XDASH_RECT,
+ sal_uInt16 nDots = 1, sal_uIntPtr nDotLen = 20,
+ sal_uInt16 nDashes = 1, sal_uIntPtr nDashLen = 20, sal_uIntPtr nDistance = 20);
+
+ bool operator==(const XDash& rDash) const;
+
+ void SetDashStyle(XDashStyle eNewStyle) { eDash = eNewStyle; }
+ void SetDots(sal_uInt16 nNewDots) { nDots = nNewDots; }
+ void SetDotLen(sal_uIntPtr nNewDotLen) { nDotLen = nNewDotLen; }
+ void SetDashes(sal_uInt16 nNewDashes) { nDashes = nNewDashes; }
+ void SetDashLen(sal_uIntPtr nNewDashLen) { nDashLen = nNewDashLen; }
+ void SetDistance(sal_uIntPtr nNewDistance) { nDistance = nNewDistance; }
+
+ XDashStyle GetDashStyle() const { return eDash; }
+ sal_uInt16 GetDots() const { return nDots; }
+ sal_uIntPtr GetDotLen() const { return nDotLen; }
+ sal_uInt16 GetDashes() const { return nDashes; }
+ sal_uIntPtr GetDashLen() const { return nDashLen; }
+ sal_uIntPtr 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 000000000000..ea38bbbbf644
--- /dev/null
+++ b/include/svx/xdef.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 _XDEF_HXX
+#define _XDEF_HXX
+
+
+/*************************************************************************
+|*
+|* 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
+|*
+\************************************************************************/
+
+#define COL_DEFAULT_SHAPE_FILLING RGB_COLORDATA( 0x72, 0x9F, 0xCF )
+#define COL_DEFAULT_SHAPE_STROKE RGB_COLORDATA( 52, 101, 175 )
+
+#define XATTR_START 1000
+
+#define XATTR_LINE_FIRST XATTR_START /* V3: 1000 V2: 1000 */
+#define XATTR_LINESTYLE XATTR_LINE_FIRST
+#define XATTR_LINEDASH (XATTR_LINE_FIRST + 1) /* V3: 1001 V2: 1001 */
+#define XATTR_LINEWIDTH (XATTR_LINE_FIRST + 2) /* V3: 1002 V2: 1002 */
+#define XATTR_LINECOLOR (XATTR_LINE_FIRST + 3) /* V3: 1003 V2: 1003 */
+#define XATTR_LINESTART (XATTR_LINE_FIRST + 4) /* V3: 1004 V2: 1004 */
+#define XATTR_LINEEND (XATTR_LINE_FIRST + 5) /* V3: 1005 V2: 1005 */
+#define XATTR_LINESTARTWIDTH (XATTR_LINE_FIRST + 6) /* V3: 1006 V2: 1006 */
+#define XATTR_LINEENDWIDTH (XATTR_LINE_FIRST + 7) /* V3: 1007 V2: 1007 */
+#define XATTR_LINESTARTCENTER (XATTR_LINE_FIRST + 8) /* V3: 1008 V2: 1008 */
+#define XATTR_LINEENDCENTER (XATTR_LINE_FIRST + 9) /* V3: 1009 V2: 1009 */
+#define XATTR_LINETRANSPARENCE (XATTR_LINE_FIRST + 10) /* V3: 1010 V2: 1010 */
+#define XATTR_LINEJOINT (XATTR_LINE_FIRST + 11) /* V3: 1011 V2: 1011 */
+#define XATTR_LINECAP (XATTR_LINE_FIRST + 12) /* V3: 1012 */
+#define XATTR_LINE_LAST XATTR_LINECAP
+#define XATTRSET_LINE (XATTR_LINE_LAST + 1) /* V3: 1017 V2: 1017 */
+
+#define XATTR_FILL_FIRST (XATTRSET_LINE + 1) /* V3: 1018 V2: 1018 */
+#define XATTR_FILLSTYLE XATTR_FILL_FIRST
+#define XATTR_FILLCOLOR (XATTR_FILL_FIRST + 1) /* V3: 1019 V2: 1019 */
+#define XATTR_FILLGRADIENT (XATTR_FILL_FIRST + 2) /* V3: 1020 V2: 1020 */
+#define XATTR_FILLHATCH (XATTR_FILL_FIRST + 3) /* V3: 1021 V2: 1021 */
+#define XATTR_FILLBITMAP (XATTR_FILL_FIRST + 4) /* V3: 1022 V2: 1022 */
+#define XATTR_FILLTRANSPARENCE (XATTR_FILL_FIRST + 5) /* V3: 1023 V2: 1023 */
+#define XATTR_GRADIENTSTEPCOUNT (XATTR_FILL_FIRST + 6) /* V3: 1024 V2: 1024 */
+#define XATTR_FILLBMP_TILE (XATTR_FILL_FIRST + 7) /* V3: 1025 V2: 1025 */
+#define XATTR_FILLBMP_POS (XATTR_FILL_FIRST + 8) /* V3: 1026 V2: 1026 */
+#define XATTR_FILLBMP_SIZEX (XATTR_FILL_FIRST + 9) /* V3: 1027 V2: 1027 */
+#define XATTR_FILLBMP_SIZEY (XATTR_FILL_FIRST + 10) /* V3: 1028 V2: 1028 */
+#define XATTR_FILLFLOATTRANSPARENCE (XATTR_FILL_FIRST + 11) /* V3: 1029 V2: 1029 */
+#define XATTR_SECONDARYFILLCOLOR (XATTR_FILL_FIRST + 12) /* V3: 1030 */
+#define XATTR_FILLBMP_SIZELOG (XATTR_FILL_FIRST + 13) /* V3: 1031 */
+#define XATTR_FILLBMP_TILEOFFSETX (XATTR_FILL_FIRST + 14) /* V3: 1032 */
+#define XATTR_FILLBMP_TILEOFFSETY (XATTR_FILL_FIRST + 15) /* V3: 1033 */
+#define XATTR_FILLBMP_STRETCH (XATTR_FILL_FIRST + 16) /* V3: 1034 */
+#define XATTR_FILLBMP_POSOFFSETX (XATTR_FILL_FIRST + 17) /* V3: 1041 */
+#define XATTR_FILLBMP_POSOFFSETY (XATTR_FILL_FIRST + 18) /* V3: 1042 */
+#define XATTR_FILLBACKGROUND (XATTR_FILL_FIRST + 19) /* V3: 1043 */
+#define XATTR_FILL_LAST XATTR_FILLBACKGROUND
+#define XATTRSET_FILL (XATTR_FILL_LAST + 1) /* V3: 1047 V2: 1030 */
+
+#define XATTR_TEXT_FIRST (XATTRSET_FILL + 1)
+#define XATTR_FORMTXTSTYLE XATTR_TEXT_FIRST /* V3: 1048 V2: 1031 */
+#define XATTR_FORMTXTADJUST (XATTR_TEXT_FIRST + 1) /* V3: 1049 V2: 1032 */
+#define XATTR_FORMTXTDISTANCE (XATTR_TEXT_FIRST + 2) /* V3: 1050 V2: 1033 */
+#define XATTR_FORMTXTSTART (XATTR_TEXT_FIRST + 3) /* V3: 1051 V2: 1034 */
+#define XATTR_FORMTXTMIRROR (XATTR_TEXT_FIRST + 4) /* V3: 1052 V2: 1035 */
+#define XATTR_FORMTXTOUTLINE (XATTR_TEXT_FIRST + 5) /* V3: 1053 V2: 1036 */
+#define XATTR_FORMTXTSHADOW (XATTR_TEXT_FIRST + 6) /* V3: 1054 V2: 1037 */
+#define XATTR_FORMTXTSHDWCOLOR (XATTR_TEXT_FIRST + 7) /* V3: 1055 V2: 1038 */
+#define XATTR_FORMTXTSHDWXVAL (XATTR_TEXT_FIRST + 8) /* V3: 1056 V2: 1039 */
+#define XATTR_FORMTXTSHDWYVAL (XATTR_TEXT_FIRST + 9) /* V3: 1057 V2: 1040 */
+#define XATTR_FORMTXTSTDFORM (XATTR_TEXT_FIRST + 10) /* V3: 1058 V2: 1041 */
+#define XATTR_FORMTXTHIDEFORM (XATTR_TEXT_FIRST + 11) /* V3: 1059 V2: 1042 */
+#define XATTR_FORMTXTSHDWTRANSP (XATTR_TEXT_FIRST + 12) /* V3: 1060 V2: 1043 */
+#define XATTR_TEXT_LAST XATTR_FORMTXTSHDWTRANSP
+
+#define 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 000000000000..df0b629d5980
--- /dev/null
+++ b/include/svx/xenum.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 _XENUM_HXX
+#define _XENUM_HXX
+
+enum XLineStyle { XLINE_NONE, XLINE_SOLID, XLINE_DASH };
+enum XLineJoint
+{
+ XLINEJOINT_NONE, // no rounding
+ XLINEJOINT_MIDDLE, // calc middle value between joints
+ XLINEJOINT_BEVEL, // join edges with line
+ XLINEJOINT_MITER, // extend till cut
+ XLINEJOINT_ROUND // create arc
+};
+enum XDashStyle { XDASH_RECT, XDASH_ROUND, XDASH_RECTRELATIVE,
+ XDASH_ROUNDRELATIVE };
+enum XFillStyle { XFILL_NONE, XFILL_SOLID, XFILL_GRADIENT, XFILL_HATCH,
+ XFILL_BITMAP };
+enum XGradientStyle { XGRAD_LINEAR, XGRAD_AXIAL, XGRAD_RADIAL,
+ XGRAD_ELLIPTICAL, XGRAD_SQUARE, XGRAD_RECT };
+enum XHatchStyle { XHATCH_SINGLE, XHATCH_DOUBLE, XHATCH_TRIPLE };
+enum XFormTextStyle { XFT_ROTATE, XFT_UPRIGHT, XFT_SLANTX, XFT_SLANTY,
+ XFT_NONE };
+enum XFormTextAdjust { XFT_LEFT, XFT_RIGHT, XFT_AUTOSIZE, XFT_CENTER };
+enum XFormTextShadow { XFTSHADOW_NONE, XFTSHADOW_NORMAL, XFTSHADOW_SLANT};
+enum XFormTextStdForm { XFTFORM_NONE = 0, XFTFORM_TOPCIRC, XFTFORM_BOTCIRC,
+ XFTFORM_LFTCIRC, XFTFORM_RGTCIRC, XFTFORM_TOPARC,
+ XFTFORM_BOTARC, XFTFORM_LFTARC, XFTFORM_RGTARC,
+ XFTFORM_BUTTON1, XFTFORM_BUTTON2,
+ XFTFORM_BUTTON3, XFTFORM_BUTTON4};
+enum XBitmapType { XBITMAP_IMPORT, XBITMAP_8X8 };
+
+
+#endif // _XENUM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xexch.hxx b/include/svx/xexch.hxx
new file mode 100644
index 000000000000..bd0034d972a2
--- /dev/null
+++ b/include/svx/xexch.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 _SVX_XEXCH_HXX
+#define _SVX_XEXCH_HXX
+
+
+#include <tools/stream.hxx>
+#include "svx/svxdllapi.h"
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Clipboard format for XOutDev filling attributes
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+class XFillAttrSetItem;
+class SfxItemPool;
+
+
+
+class SVX_DLLPUBLIC XFillExchangeData
+{
+private:
+ XFillAttrSetItem* pXFillAttrSetItem;
+ SfxItemPool* pPool;
+
+public:
+ TYPEINFO();
+
+ XFillExchangeData();
+ XFillExchangeData(const XFillAttrSetItem rXFillAttrSetItem);
+ virtual ~XFillExchangeData();
+
+ XFillExchangeData& operator=( const XFillExchangeData& rXFillExchangeData );
+
+ SVX_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const XFillExchangeData& rXFillExchangeData );
+ SVX_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, XFillExchangeData& rXFillExchangeData );
+
+ XFillAttrSetItem* GetXFillAttrSetItem() { return pXFillAttrSetItem; }
+};
+
+#endif // _SVX_XEXCH_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xfillit.hxx b/include/svx/xfillit.hxx
new file mode 100644
index 000000000000..b0270a9d3aa9
--- /dev/null
+++ b/include/svx/xfillit.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 _SVX_FILLITEM_HXX
+#define _SVX_FILLITEM_HXX
+
+#include <vcl/bitmap.hxx>
+#include <svx/xcolit.hxx>
+#include <svx/xgrad.hxx>
+#include <svx/xhatch.hxx>
+#include <svx/xenum.hxx>
+#include <svl/eitem.hxx>
+
+#include <svx/xflclit.hxx>
+#include <svx/xsflclit.hxx>
+#include <svx/xflgrit.hxx>
+#include <svx/xflhtit.hxx>
+#include <svx/xbtmpit.hxx>
+#include <svx/xflftrit.hxx>
+
+class XGradient;
+class XOBitmap;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xfillit0.hxx b/include/svx/xfillit0.hxx
new file mode 100644
index 000000000000..596d9c9ae8b4
--- /dev/null
+++ b/include/svx/xfillit0.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 SVX_XFILLIT0_HXX
+#define SVX_XFILLIT0_HXX
+
+#include <svl/eitem.hxx>
+
+#include <svx/xdef.hxx>
+#include <svx/xenum.hxx>
+#include "svx/svxdllapi.h"
+
+//---------------------
+// class XFillStyleItem
+//---------------------
+
+class SVX_DLLPUBLIC XFillStyleItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ XFillStyleItem(XFillStyle = XFILL_SOLID);
+ XFillStyleItem(XFillStyle, sal_uInt16 nWhich);
+ XFillStyleItem(SvStream& rIn);
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+ virtual sal_uInt16 GetValueCount() const;
+ XFillStyle GetValue() const { return (XFillStyle) SfxEnumItem::GetValue(); }
+};
+
+#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 000000000000..44c95e08eabf
--- /dev/null
+++ b/include/svx/xflasit.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 _SVX_XFLASIT_HXX
+#define _SVX_XFLASIT_HXX
+
+#include <svl/poolitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* SetItem mit dem ItemSet aller Fuellattribute
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFillAttrSetItem : public SfxSetItem
+{
+public:
+ TYPEINFO();
+ XFillAttrSetItem(SfxItemSet* pItemSet );
+ XFillAttrSetItem(SfxItemPool* pItemPool);
+ XFillAttrSetItem(const XFillAttrSetItem& rAttr);
+ XFillAttrSetItem(const XFillAttrSetItem& rAttr,
+ SfxItemPool* pItemPool);
+ virtual SfxPoolItem* Clone( SfxItemPool* pToPool ) const;
+ virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVersion ) const;
+ virtual SvStream& Store( SvStream& rStream, sal_uInt16 nItemVersion ) const;
+};
+
+#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 000000000000..85bd4dabad17
--- /dev/null
+++ b/include/svx/xflbckit.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 _SVX_XFLBCKIT_HXX
+#define _SVX_XFLBCKIT_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* Item to enable background for filled objects
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFillBackgroundItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+
+ XFillBackgroundItem( sal_Bool bFill = sal_False );
+ SVX_DLLPRIVATE XFillBackgroundItem( SvStream& rIn );
+
+
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..3c9ea1ce5654
--- /dev/null
+++ b/include/svx/xflbmpit.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 _SVX_XFLBMPIT_HXX
+#define _SVX_XFLBMPIT_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC XFillBmpPosItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ XFillBmpPosItem( RECT_POINT eRP = RP_MM );
+ SVX_DLLPRIVATE XFillBmpPosItem( SvStream& rIn );
+
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ SVX_DLLPRIVATE virtual sal_uInt16 GetValueCount() const;
+ SVX_DLLPRIVATE RECT_POINT GetValue() const { return (RECT_POINT) SfxEnumItem::GetValue(); }
+};
+
+
+#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 000000000000..5ed01b015d99
--- /dev/null
+++ b/include/svx/xflbmsli.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 _SVX_XFLBMSLI_HXX
+#define _SVX_XFLBMSLI_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC XFillBmpSizeLogItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+ XFillBmpSizeLogItem( sal_Bool bLog = sal_True );
+ SVX_DLLPRIVATE XFillBmpSizeLogItem( SvStream& rIn );
+
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..0042e5ad57cd
--- /dev/null
+++ b/include/svx/xflbmsxy.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 _SVX_XFLBMSXY_HXX
+#define _SVX_XFLBMSXY_HXX
+
+#include <svl/metitem.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC XFillBmpSizeXItem : public SfxMetricItem
+{
+public:
+ TYPEINFO();
+ XFillBmpSizeXItem( long nSizeX = 0 );
+ SVX_DLLPRIVATE XFillBmpSizeXItem( SvStream& rIn );
+
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ // Dieses Item nimmt sowohl metrische als auch
+ // Prozentwerte ( sind negativ ) auf; das muessen
+ // wir hier beruecksichtigen
+ SVX_DLLPRIVATE virtual bool HasMetrics() const;
+};
+
+class SVX_DLLPUBLIC XFillBmpSizeYItem : public SfxMetricItem
+{
+public:
+ TYPEINFO();
+ XFillBmpSizeYItem( long nSizeY = 0 );
+ SVX_DLLPRIVATE XFillBmpSizeYItem( SvStream& rIn );
+
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ // Dieses Item nimmt sowohl metrische als auch
+ // Prozentwerte ( sind negativ ) auf; das muessen
+ // wir hier beruecksichtigen
+ SVX_DLLPRIVATE virtual bool HasMetrics() const;
+};
+
+#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 000000000000..c5517d0c6759
--- /dev/null
+++ b/include/svx/xflbmtit.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 _SVX_XFLBMTIT_HXX
+#define _SVX_XFLBMTIT_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC XFillBmpTileItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+ XFillBmpTileItem( sal_Bool bTile = sal_True );
+ XFillBmpTileItem( SvStream& rIn );
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..5304484d3892
--- /dev/null
+++ b/include/svx/xflboxy.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 _SVX_XFLBOXY_HXX
+#define _SVX_XFLBOXY_HXX
+
+#include <svl/intitem.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC XFillBmpPosOffsetXItem : public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+ XFillBmpPosOffsetXItem( sal_uInt16 nOffPosX = 0 );
+ SVX_DLLPRIVATE XFillBmpPosOffsetXItem( SvStream& rIn );
+
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+class SVX_DLLPUBLIC XFillBmpPosOffsetYItem : public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+ XFillBmpPosOffsetYItem( sal_uInt16 nOffPosY = 0 );
+ SVX_DLLPRIVATE XFillBmpPosOffsetYItem( SvStream& rIn );
+
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..ca14d6a341d8
--- /dev/null
+++ b/include/svx/xflbstit.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 _SVX_XFLBSTIT_HXX
+#define _SVX_XFLBSTIT_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC XFillBmpStretchItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+ XFillBmpStretchItem( sal_Bool bStretch = sal_True );
+ XFillBmpStretchItem( SvStream& rIn );
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..e02345abdd37
--- /dev/null
+++ b/include/svx/xflbtoxy.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 _SVX_XFLBTOXY_HXX
+#define _SVX_XFLBTOXY_HXX
+
+#include <svl/intitem.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC XFillBmpTileOffsetXItem : public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+ XFillBmpTileOffsetXItem( sal_uInt16 nOffX = 0 );
+ SVX_DLLPRIVATE XFillBmpTileOffsetXItem( SvStream& rIn );
+
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+class SVX_DLLPUBLIC XFillBmpTileOffsetYItem : public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+ XFillBmpTileOffsetYItem( sal_uInt16 nOffX = 0 );
+ SVX_DLLPRIVATE XFillBmpTileOffsetYItem( SvStream& rIn );
+
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..7c0320ffe2f7
--- /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 _SVX_XFLCLIT_HXX
+#define _SVX_XFLCLIT_HXX
+
+#include <svx/xcolit.hxx>
+#include "svx/svxdllapi.h"
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Fuellattribute
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+//---------------------
+// class XFillColorItem
+//---------------------
+class SVX_DLLPUBLIC XFillColorItem : public XColorItem
+{
+public:
+ TYPEINFO();
+ XFillColorItem() {}
+ XFillColorItem(sal_Int32 nIndex, const Color& rTheColor);
+ XFillColorItem(const String& rName, const Color& rTheColor);
+ XFillColorItem(SvStream& rIn);
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..494cc99f21fe
--- /dev/null
+++ b/include/svx/xflftrit.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 _SVX_XFLFTRIT_HXX
+#define _SVX_XFLFTRIT_HXX
+
+#include <svx/xflgrit.hxx>
+#include "svx/svxdllapi.h"
+
+//-----------------------------------
+// class XFillFloatTransparenceItem -
+//-----------------------------------
+
+class SVX_DLLPUBLIC XFillFloatTransparenceItem : public XFillGradientItem
+{
+private:
+
+ sal_Bool bEnabled;
+
+public:
+ TYPEINFO();
+
+ XFillFloatTransparenceItem();
+ XFillFloatTransparenceItem(const String& rName, const XGradient& rGradient, sal_Bool bEnable = sal_True );
+ XFillFloatTransparenceItem(SfxItemPool* pPool, const XGradient& rTheGradient, sal_Bool bEnable = sal_True );
+ XFillFloatTransparenceItem( const XFillFloatTransparenceItem& rItem );
+
+ virtual int operator==( const SfxPoolItem& rItem ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric, OUString &rText, const IntlWrapper * pIntlWrapper = 0 ) const;
+
+ sal_Bool IsEnabled() const { return bEnabled; }
+ void SetEnabled( sal_Bool bEnable ) { bEnabled = bEnable; }
+
+ static sal_Bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
+ XFillFloatTransparenceItem* checkForUniqueItem( SdrModel* pModel ) const;
+};
+
+#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 000000000000..1c2401f03dda
--- /dev/null
+++ b/include/svx/xflgrit.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 _SVX_XFLGRIT_HXX
+#define _SVX_XFLGRIT_HXX
+
+#include <svx/xit.hxx>
+#include <svx/xgrad.hxx>
+#include "svx/svxdllapi.h"
+
+class SdrModel;
+
+//------------------------
+// class XFillGradientItem
+//------------------------
+class SVX_DLLPUBLIC XFillGradientItem : public NameOrIndex
+{
+ XGradient aGradient;
+
+public:
+ TYPEINFO();
+ XFillGradientItem() : NameOrIndex(XATTR_FILLGRADIENT, -1) {}
+ XFillGradientItem(sal_uInt16 nWhich_) : NameOrIndex(nWhich_, -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);
+ XFillGradientItem(SvStream& rIn, sal_uInt16 nVer = 0);
+
+ virtual int operator==(const SfxPoolItem& rItem) const;
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual SvStream& Store(SvStream& rOut, sal_uInt16 nItemVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+ const XGradient& GetGradientValue() const; // GetValue -> GetGradientValue
+ void SetGradientValue(const XGradient& rNew) { aGradient = rNew; Detach(); } // SetValue -> SetGradientValue
+
+ static sal_Bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
+ XFillGradientItem* checkForUniqueItem( SdrModel* pModel ) const;
+};
+
+#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 000000000000..3b95e97c6a3c
--- /dev/null
+++ b/include/svx/xflhtit.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 _SVX_XFLHTIT_HXX
+#define _SVX_XFLHTIT_HXX
+
+#include <svx/xit.hxx>
+#include <svx/xhatch.hxx>
+#include "svx/svxdllapi.h"
+
+class SdrModel;
+
+//---------------------
+// class XFillHatchItem
+//---------------------
+class SVX_DLLPUBLIC XFillHatchItem : public NameOrIndex
+{
+ XHatch aHatch;
+
+public:
+ TYPEINFO();
+ XFillHatchItem() : NameOrIndex(XATTR_FILLHATCH, -1) {}
+ XFillHatchItem(const String& rName, const XHatch& rTheHatch);
+ XFillHatchItem(SfxItemPool* pPool, const XHatch& rTheHatch);
+ XFillHatchItem(const XFillHatchItem& rItem);
+ XFillHatchItem(SvStream& rIn);
+
+ virtual int operator==(const SfxPoolItem& rItem) const;
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual SvStream& Store(SvStream& rOut, sal_uInt16 nItemVersion ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+ virtual bool HasMetrics() const;
+ virtual bool ScaleMetrics(long nMul, long nDiv);
+
+ const XHatch& GetHatchValue() const; // GetValue -> GetHatchValue
+ void SetHatchValue(const XHatch& rNew) { aHatch = rNew; Detach(); } // SetValue -> SetHatchValue
+
+ static sal_Bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
+ XFillHatchItem* 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 000000000000..52f475c31845
--- /dev/null
+++ b/include/svx/xfltrit.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 _SVX_XFLTRIT_HXX
+#define _SVX_XFLTRIT_HXX
+
+#include <svl/intitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* Transparenz-Item fuer Fuellungen (Solid)
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFillTransparenceItem: public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+ XFillTransparenceItem(sal_uInt16 nFillTransparence = 0);
+ XFillTransparenceItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..0f52f64d3c05
--- /dev/null
+++ b/include/svx/xftadit.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 _SVX_XFTADIT_HXX
+#define _SVX_XFTADIT_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* FormText-AdjustItem
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFormTextAdjustItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ XFormTextAdjustItem(XFormTextAdjust = XFT_CENTER);
+ XFormTextAdjustItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const;
+ XFormTextAdjust GetValue() const { return (XFormTextAdjust) SfxEnumItem::GetValue(); }
+ // #FontWork#
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+#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 000000000000..0260e29687f9
--- /dev/null
+++ b/include/svx/xftdiit.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 _SVX_XFTDIIT_HXX
+#define _SVX_XFTDIIT_HXX
+
+#include <svl/metitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* FormText-DistanceItem
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFormTextDistanceItem : public SfxMetricItem
+{
+public:
+ TYPEINFO();
+ XFormTextDistanceItem(long nDist = 0);
+ XFormTextDistanceItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+};
+
+#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 000000000000..815049e3bb7c
--- /dev/null
+++ b/include/svx/xftmrit.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 _SVX_XFTMRIT_HXX
+#define _SVX_XFTMRIT_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* FormText-MirrorItem
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFormTextMirrorItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+ XFormTextMirrorItem(sal_Bool bMirror = sal_False);
+ XFormTextMirrorItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+};
+
+#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 000000000000..457247fa6cd2
--- /dev/null
+++ b/include/svx/xftouit.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 _SVX_XFTOUIT_HXX
+#define _SVX_XFTOUIT_HXX
+
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* FormText-OutlineItem
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFormTextOutlineItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+ XFormTextOutlineItem(sal_Bool bOutline = sal_False);
+ XFormTextOutlineItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xftsfit.hxx b/include/svx/xftsfit.hxx
new file mode 100644
index 000000000000..ca4bd2b3f7fb
--- /dev/null
+++ b/include/svx/xftsfit.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 _SVX_XFTSFIT_HXX
+#define _SVX_XFTSFIT_HXX
+
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* FormText-StdFormItem
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFormTextStdFormItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ XFormTextStdFormItem(XFormTextStdForm = XFTFORM_NONE);
+ XFormTextStdFormItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const;
+ XFormTextStdForm GetValue() const { return (XFormTextStdForm) SfxEnumItem::GetValue(); }
+ // #FontWork#
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+#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 000000000000..8a84b2c1c84b
--- /dev/null
+++ b/include/svx/xftshcit.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 _SVX_XFTSHCLIT_HXX
+#define _SVX_XFTSHCLIT_HXX
+
+#include <svx/xcolit.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* FormText-ShadowColorItem
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFormTextShadowColorItem : public XColorItem
+{
+public:
+ TYPEINFO();
+ XFormTextShadowColorItem() {}
+ XFormTextShadowColorItem(const String& rName, const Color& rTheColor);
+ XFormTextShadowColorItem(SvStream& rIn);
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+};
+
+#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 000000000000..5ae8fc76078f
--- /dev/null
+++ b/include/svx/xftshit.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 _SVX_XFTSHIT_HXX
+#define _SVX_XFTSHIT_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* FormText-ShadowItem
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFormTextShadowItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ XFormTextShadowItem(XFormTextShadow = XFTSHADOW_NONE);
+ XFormTextShadowItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const;
+ XFormTextShadow GetValue() const { return (XFormTextShadow) SfxEnumItem::GetValue(); }
+ // #FontWork#
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xftshtit.hxx b/include/svx/xftshtit.hxx
new file mode 100644
index 000000000000..e87e4a4f3cc5
--- /dev/null
+++ b/include/svx/xftshtit.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 _SVX_XFTSHTIT_HXX
+#define _SVX_XFTSHTIT_HXX
+
+#include <svl/intitem.hxx>
+
+/*************************************************************************
+|*
+|* FormText-Item fuer transparents Schatten
+|*
+\************************************************************************/
+
+class XFormTextShadowTranspItem: public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+ XFormTextShadowTranspItem(sal_uInt16 nShdwTransparence = 0);
+ XFormTextShadowTranspItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+};
+
+#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 000000000000..eb6ffb6020cc
--- /dev/null
+++ b/include/svx/xftshxy.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 _SVX_XFTSHXY_HXX
+#define _SVX_XFTSHXY_HXX
+
+#include <svl/metitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* FormText-ShadowXValItem
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFormTextShadowXValItem : public SfxMetricItem
+{
+public:
+ TYPEINFO();
+ XFormTextShadowXValItem(long nVal = 0);
+ XFormTextShadowXValItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+};
+
+/*************************************************************************
+|*
+|* FormText-ShadowYValItem
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFormTextShadowYValItem : public SfxMetricItem
+{
+public:
+ TYPEINFO();
+ XFormTextShadowYValItem(long nVal = 0);
+ XFormTextShadowYValItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+};
+
+#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 000000000000..2a53b26b41c1
--- /dev/null
+++ b/include/svx/xftstit.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 _SVX_XFTSTIT_HXX
+#define _SVX_XFTSTIT_HXX
+
+#include <svl/metitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* FormText-StartPositionItem
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFormTextStartItem : public SfxMetricItem
+{
+public:
+ TYPEINFO();
+ XFormTextStartItem(long nStart = 0);
+ XFormTextStartItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+};
+
+#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 000000000000..ba97db142e7d
--- /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 _SVX__XGRADIENT_HXX
+#define _SVX__XGRADIENT_HXX
+
+#include <svx/xenum.hxx>
+#include <tools/color.hxx>
+#include "svx/svxdllapi.h"
+
+class Gradient;
+
+//-----------------
+// class XGradient
+//-----------------
+
+class SVX_DLLPUBLIC XGradient
+{
+protected:
+ XGradientStyle 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;
+
+public:
+ XGradient();
+ XGradient( const Color& rStart, const Color& rEnd,
+ XGradientStyle eStyle = XGRAD_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(XGradientStyle 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; }
+
+ XGradientStyle GetGradientStyle() const { return eStyle; }
+ Color GetStartColor() const { return aStartColor; }
+ 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; }
+ Gradient VclGradient() const;
+};
+
+#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 000000000000..491a7d41d502
--- /dev/null
+++ b/include/svx/xgrscit.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 _SVX_XGRSCIT_HXX
+#define _SVX_XGRSCIT_HXX
+
+#include <svl/intitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* GradientenSchritte-Item fuer Gradienten-Fuellungen
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XGradientStepCountItem: public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+ XGradientStepCountItem( sal_uInt16 nStepCount = 0 );
+ XGradientStepCountItem( SvStream& rIn );
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..9db4a6a0364b
--- /dev/null
+++ b/include/svx/xhatch.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 _SVX_XHATCH_HXX
+#define _SVX_XHATCH_HXX
+
+#include <svx/xenum.hxx>
+#include <tools/color.hxx>
+#include "svx/svxdllapi.h"
+
+//--------------
+// class XHatch
+//--------------
+
+class SVX_DLLPUBLIC XHatch
+{
+protected:
+ XHatchStyle eStyle;
+ Color aColor;
+ long nDistance;
+ long nAngle;
+
+public:
+ XHatch() : eStyle(XHATCH_SINGLE), nDistance(0), nAngle(0) {}
+ XHatch(const Color& rCol, XHatchStyle eStyle = XHATCH_SINGLE,
+ long nDistance = 20, long nAngle = 0);
+
+ bool operator==(const XHatch& rHatch) const;
+
+ void SetHatchStyle(XHatchStyle eNewStyle) { eStyle = eNewStyle; }
+ void SetColor(const Color& rColor) { aColor = rColor; }
+ void SetDistance(long nNewDistance) { nDistance = nNewDistance; }
+ void SetAngle(long nNewAngle) { nAngle = nNewAngle; }
+
+ XHatchStyle GetHatchStyle() const { return eStyle; }
+ 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 000000000000..ee1dc376f122
--- /dev/null
+++ b/include/svx/xit.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 _SVX_XIT_HXX
+#define _SVX_XIT_HXX
+
+#include <svl/stritem.hxx>
+#include <svx/xtable.hxx>
+#include <svx/xdef.hxx>
+#include "svx/svxdllapi.h"
+
+/************************************************************************/
+
+class SfxItemPool;
+class NameOrIndex;
+
+typedef sal_Bool (*SvxCompareValueFunc)( const NameOrIndex* p1, const NameOrIndex* p2 );
+
+//-------------------
+// class NameOrIndex
+//-------------------
+class SVX_DLLPUBLIC NameOrIndex : public SfxStringItem
+{
+ sal_Int32 nPalIndex;
+
+protected:
+ void Detach() { nPalIndex = -1; }
+
+public:
+ TYPEINFO();
+ NameOrIndex() { nPalIndex = -1; }
+ NameOrIndex(sal_uInt16 nWhich, sal_Int32 nIndex);
+ NameOrIndex(sal_uInt16 nWhich,
+ const String& rName= String());
+ NameOrIndex(sal_uInt16 nWhich, SvStream& rIn);
+ NameOrIndex(const NameOrIndex& rNameOrIndex);
+ ~NameOrIndex() {};
+
+ virtual int operator==(const SfxPoolItem& rItem) const;
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual SvStream& Store(SvStream& rOut, sal_uInt16 nItemVersion ) const;
+
+ String GetName() const { return GetValue(); }
+ void SetName(const String& rName) { SetValue(rName); }
+ sal_Int32 GetIndex() const { return nPalIndex; }
+ void SetIndex(sal_Int32 nIndex) { nPalIndex = nIndex; }
+ sal_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 String CheckNamedItem( const NameOrIndex* pCheckItem, const sal_uInt16 nWhich, const SfxItemPool* pPool1, const SfxItemPool* pPool2, SvxCompareValueFunc pCompareValueFunc, sal_uInt16 nPrefixResId, const XPropertyListRef &pDefaults );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xlineit.hxx b/include/svx/xlineit.hxx
new file mode 100644
index 000000000000..f32193330b90
--- /dev/null
+++ b/include/svx/xlineit.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 _SVX_XLINIIT_HXX
+#define _SVX_XLINIIT_HXX
+
+#include <svx/xit.hxx>
+#include <svx/xcolit.hxx>
+#include <svx/xpoly.hxx>
+#include <svx/xenum.hxx>
+#include <svl/metitem.hxx>
+#include <svl/eitem.hxx>
+
+class XDash;
+class SvStream;
+
+#include <svx/xdash.hxx>
+#include <svx/xlndsit.hxx>
+#include <svx/xlnwtit.hxx>
+#include <svx/xlnclit.hxx>
+#include <svx/xlnstit.hxx>
+#include <svx/xlnedit.hxx>
+#include <svx/xlnstwit.hxx>
+#include <svx/xlnedwit.hxx>
+#include <svx/xlnstcit.hxx>
+#include <svx/xlnedcit.hxx>
+
+#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 000000000000..18fef85b45c7
--- /dev/null
+++ b/include/svx/xlineit0.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 _SVX_XLINEIT0_HXX
+#define _SVX_XLINEIT0_HXX
+
+#include <svx/xenum.hxx>
+#include <svl/eitem.hxx>
+//---------------------
+// class LineStyleItem
+//---------------------
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC XLineStyleItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ XLineStyleItem(XLineStyle = XLINE_SOLID);
+ XLineStyleItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+ virtual sal_uInt16 GetValueCount() const;
+ XLineStyle GetValue() const { return (XLineStyle) SfxEnumItem::GetValue(); }
+};
+
+#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 000000000000..321656d9ed72
--- /dev/null
+++ b/include/svx/xlinjoit.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 _SVX_XLINJOIT_HXX
+#define _SVX_XLINJOIT_HXX
+
+#include <svl/eitem.hxx>
+#include <svx/xenum.hxx>
+#include "svx/svxdllapi.h"
+
+//---------------------
+// class LineStyleItem
+//---------------------
+
+class SVX_DLLPUBLIC XLineJointItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ XLineJointItem( XLineJoint eLineJoint = XLINEJOINT_ROUND );
+ XLineJointItem( SvStream& rIn );
+
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual sal_uInt16 GetValueCount() const;
+ XLineJoint GetValue() const { return (XLineJoint) SfxEnumItem::GetValue(); }
+};
+
+#endif // _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 000000000000..3eea09f6ba02
--- /dev/null
+++ b/include/svx/xlnasit.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 _SVX_XLNASIT_HXX
+#define _SVX_XLNASIT_HXX
+
+
+#include <svl/poolitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* SetItem mit dem ItemSet aller Linienattribute
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XLineAttrSetItem : public SfxSetItem
+{
+public:
+ TYPEINFO();
+ XLineAttrSetItem(SfxItemSet* pItemSet );
+ XLineAttrSetItem(SfxItemPool* pItemPool);
+ XLineAttrSetItem(const XLineAttrSetItem& rAttr);
+ XLineAttrSetItem(const XLineAttrSetItem& rAttr,
+ SfxItemPool* pItemPool);
+ virtual SfxPoolItem* Clone( SfxItemPool* pToPool ) const;
+ virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVersion ) const;
+ virtual SvStream& Store( SvStream& rStream, sal_uInt16 nItemVersion ) const;
+};
+
+#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 000000000000..620a7adfc4b3
--- /dev/null
+++ b/include/svx/xlncapit.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 _SVX_XLNCAPIT_HXX
+#define _SVX_XLNCAPIT_HXX
+
+#include <svx/svxdllapi.h>
+#include <svl/eitem.hxx>
+#include <svx/xenum.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
+
+//---------------------
+// class LineStyleItem
+//---------------------
+
+class SVX_DLLPUBLIC XLineCapItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ XLineCapItem(com::sun::star::drawing::LineCap eLineCap = com::sun::star::drawing::LineCap_BUTT);
+ XLineCapItem(SvStream& rIn);
+
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ virtual sal_uInt16 GetValueCount() const;
+ com::sun::star::drawing::LineCap GetValue() const;
+};
+
+#endif // _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 000000000000..609efaec9e65
--- /dev/null
+++ b/include/svx/xlnclit.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 _SVX_XLNCLIT_HXX
+#define _SVX_XLNCLIT_HXX
+
+#include <svx/xcolit.hxx>
+#include "svx/svxdllapi.h"
+
+//---------------------
+// class XLineColorItem
+//---------------------
+class SVX_DLLPUBLIC XLineColorItem : public XColorItem
+{
+public:
+ TYPEINFO();
+ XLineColorItem() {}
+ XLineColorItem(sal_Int32 nIndex, const Color& rTheColor);
+ XLineColorItem(const String& rName, const Color& rTheColor);
+ XLineColorItem(SvStream& rIn);
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..a4d7a6ca7122
--- /dev/null
+++ b/include/svx/xlndsit.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 _SVX_XLNDSIT_HXX
+#define _SVX_XLNDSIT_HXX
+
+#include <svx/xit.hxx>
+
+#include <svx/xdash.hxx>
+#include "svx/svxdllapi.h"
+
+class SdrModel;
+
+//--------------------
+// class XLineDashItem
+//--------------------
+class SVX_DLLPUBLIC XLineDashItem : public NameOrIndex
+{
+ XDash aDash;
+
+public:
+ TYPEINFO();
+ XLineDashItem() : NameOrIndex(XATTR_LINEDASH, -1) {}
+ XLineDashItem(const String& rName, const XDash& rTheDash);
+ XLineDashItem(SfxItemPool* pPool, const XDash& rTheDash);
+ XLineDashItem(const XLineDashItem& rItem);
+ XLineDashItem(SvStream& rIn);
+
+ virtual int operator==(const SfxPoolItem& rItem) const;
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual SvStream& Store(SvStream& rOut, sal_uInt16 nItemVersion ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+ virtual bool HasMetrics() const;
+ virtual bool ScaleMetrics(long nMul, long nDiv);
+
+ const XDash& GetDashValue() const;
+ void SetDashValue(const XDash& rNew) { aDash = rNew; Detach(); } // SetValue -> SetDashValue
+
+ static sal_Bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
+ XLineDashItem* 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 000000000000..d06deb80a219
--- /dev/null
+++ b/include/svx/xlnedcit.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 _SVX_XLNEDCIT_HXX
+#define _SVX_XLNEDCIT_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+//----------------------------
+// class XLineEndCenterItem
+//----------------------------
+class SVX_DLLPUBLIC XLineEndCenterItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+ XLineEndCenterItem(sal_Bool bEndCenter = sal_False);
+ XLineEndCenterItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..fdf9abdda894
--- /dev/null
+++ b/include/svx/xlnedit.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 _SVX_XLNEDIT_HXX
+#define _SVX_XLNEDIT_HXX
+
+#include <svx/xit.hxx>
+#include "svx/svxdllapi.h"
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+class SdrModel;
+
+//----------------------
+// class XLineEndItem
+//----------------------
+class SVX_DLLPUBLIC XLineEndItem : public NameOrIndex
+{
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+public:
+ TYPEINFO();
+ XLineEndItem(sal_Int32 nIndex = -1);
+ XLineEndItem(const String& rName, const basegfx::B2DPolyPolygon& rPolyPolygon);
+ XLineEndItem(SfxItemPool* pPool, const basegfx::B2DPolyPolygon& rPolyPolygon);
+ XLineEndItem(const XLineEndItem& rItem);
+ XLineEndItem(SvStream& rIn);
+
+ virtual int operator==(const SfxPoolItem& rItem) const;
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual SvStream& Store(SvStream& rOut, sal_uInt16 nItemVersion ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ basegfx::B2DPolyPolygon GetLineEndValue() const;
+ void SetLineEndValue(const basegfx::B2DPolyPolygon& rPolyPolygon) { maPolyPolygon = rPolyPolygon; Detach(); }
+
+ XLineEndItem* 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 000000000000..e960ea24f8c5
--- /dev/null
+++ b/include/svx/xlnedwit.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 _SVX_XLNEDWIT_HXX
+#define _SVX_XLNEDWIT_HXX
+
+#include <svl/metitem.hxx>
+#include "svx/svxdllapi.h"
+
+#define LINE_END_WIDTH_DEFAULT (200)
+
+//---------------------------
+// class XLineEndWidthItem
+//---------------------------
+
+class SVX_DLLPUBLIC XLineEndWidthItem : public SfxMetricItem
+{
+public:
+ TYPEINFO();
+ XLineEndWidthItem(long nWidth = LINE_END_WIDTH_DEFAULT);
+ XLineEndWidthItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..241eb668a05e
--- /dev/null
+++ b/include/svx/xlnstcit.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 _SVX_XLNSTCIT_HXX
+#define _SVX_XLNSTCIT_HXX
+
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+//------------------------------
+// class XLineStartCenterItem
+//------------------------------
+class SVX_DLLPUBLIC XLineStartCenterItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+ XLineStartCenterItem(sal_Bool bStartCenter = sal_False);
+ XLineStartCenterItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..1d57bf009b7c
--- /dev/null
+++ b/include/svx/xlnstit.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 _SVX_XLNSTIT_HXX
+#define _SVX_XLNSTIT_HXX
+
+#include <svx/xit.hxx>
+#include "svx/svxdllapi.h"
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+class SdrModel;
+
+//------------------------
+// class XLineStartItem
+//------------------------
+class SVX_DLLPUBLIC XLineStartItem : public NameOrIndex
+{
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+public:
+ TYPEINFO();
+ XLineStartItem(sal_Int32 nIndex = -1);
+ XLineStartItem(const String& rName, const basegfx::B2DPolyPolygon& rPolyPolygon);
+ XLineStartItem(SfxItemPool* pPool, const basegfx::B2DPolyPolygon& rPolyPolygon);
+ XLineStartItem(const XLineStartItem& rItem);
+ XLineStartItem(SvStream& rIn);
+
+ virtual int operator==(const SfxPoolItem& rItem) const;
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual SvStream& Store(SvStream& rOut, sal_uInt16 nItemVersion ) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ basegfx::B2DPolyPolygon GetLineStartValue() const;
+ void SetLineStartValue(const basegfx::B2DPolyPolygon& rPolyPolygon) { maPolyPolygon = rPolyPolygon; Detach(); }
+
+ XLineStartItem* 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 000000000000..776b97519fcd
--- /dev/null
+++ b/include/svx/xlnstwit.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 _SVX_XLNSTWIT_HXX
+#define _SVX_XLNSTWIT_HXX
+
+#include <svl/metitem.hxx>
+#include "svx/svxdllapi.h"
+
+#define LINE_START_WIDTH_DEFAULT (200)
+
+//-----------------------------
+// class XLineStartWidthItem
+//-----------------------------
+class SVX_DLLPUBLIC XLineStartWidthItem : public SfxMetricItem
+{
+public:
+ TYPEINFO();
+ XLineStartWidthItem(long nWidth = LINE_START_WIDTH_DEFAULT);
+ XLineStartWidthItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+};
+
+#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 000000000000..8cb0e705ba87
--- /dev/null
+++ b/include/svx/xlntrit.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 _SVX_XLNTRIT_HXX
+#define _SVX_XLNTRIT_HXX
+
+#include <svl/intitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* Transparenz-Item fuer Linien
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XLineTransparenceItem: public SfxUInt16Item
+{
+public:
+ TYPEINFO();
+ XLineTransparenceItem(sal_uInt16 nLineTransparence = 0);
+ XLineTransparenceItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..d8d60ad9022b
--- /dev/null
+++ b/include/svx/xlnwtit.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 _SVX_XLNWTIT_HXX
+#define _SVX_XLNWTIT_HXX
+
+#include <svl/metitem.hxx>
+#include "svx/svxdllapi.h"
+
+//---------------------
+// class XLineWidthItem
+//---------------------
+class SVX_DLLPUBLIC XLineWidthItem : public SfxMetricItem
+{
+public:
+ TYPEINFO();
+ XLineWidthItem(long nWidth = 0);
+ XLineWidthItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+};
+
+#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 000000000000..934606fe8917
--- /dev/null
+++ b/include/svx/xmleohlp.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 _XMLEOHLP_HXX
+#define _XMLEOHLP_HXX
+
+#include <cppuhelper/compbase2.hxx>
+#include <osl/mutex.hxx>
+#include <sot/storage.hxx>
+#include <map>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include "svx/svxdllapi.h"
+
+// -----------------------------
+// - SvXMLEmbeddedObjectHelper -
+// -----------------------------
+
+enum SvXMLEmbeddedObjectHelperMode
+{
+ EMBEDDEDOBJECTHELPER_MODE_READ = 0,
+ EMBEDDEDOBJECTHELPER_MODE_WRITE = 1
+};
+
+// -----------------------------
+// - SvXMLEmbeddedObjectHelper -
+// -----------------------------
+
+namespace comphelper {
+class IEmbeddedHelper;
+}
+class SvGlobalName;
+struct OUStringLess;
+class OutputStorageWrapper_Impl;
+
+class SVX_DLLPUBLIC SvXMLEmbeddedObjectHelper : public ::cppu::WeakComponentImplHelper2<
+ ::com::sun::star::document::XEmbeddedObjectResolver,
+ ::com::sun::star::container::XNameAccess >
+{
+ typedef ::std::map< OUString, OutputStorageWrapper_Impl*,
+ OUStringLess > SvXMLEmbeddedObjectHelper_Impl;
+private:
+
+ ::osl::Mutex maMutex;
+
+ const OUString maReplacementGraphicsContainerStorageName;
+ const OUString maReplacementGraphicsContainerStorageName60;
+ OUString maCurContainerStorageName;
+
+
+ com::sun::star::uno::Reference < com::sun::star::embed::XStorage > mxRootStorage; // package
+ ::comphelper::IEmbeddedHelper* mpDocPersist;
+ com::sun::star::uno::Reference < com::sun::star::embed::XStorage > mxContainerStorage; // container sub package for
+ com::sun::star::uno::Reference < com::sun::star::embed::XStorage > mxTempStorage; // package
+ // objects
+ SvXMLEmbeddedObjectHelperMode meCreateMode;
+ SvXMLEmbeddedObjectHelper_Impl *mpStreamMap;
+
+ SVX_DLLPRIVATE sal_Bool ImplGetStorageNames(
+ const OUString& rURLStr,
+ OUString& rContainerStorageName,
+ OUString& rObjectStorageName,
+ sal_Bool bInternalToExternal,
+ sal_Bool *pGraphicRepl=0,
+ sal_Bool *pOasisFormat=0 ) const;
+
+ SVX_DLLPRIVATE com::sun::star::uno::Reference < com::sun::star::embed::XStorage > ImplGetContainerStorage(
+ const OUString& rStorageName );
+
+ SVX_DLLPRIVATE String ImplGetUniqueName( ::comphelper::IEmbeddedHelper*, const sal_Char* p ) const;
+ SVX_DLLPRIVATE sal_Bool ImplReadObject(
+ const OUString& rContainerStorageName,
+ OUString& rObjName,
+ const SvGlobalName *pClassId,
+ SvStream* pTemp );
+
+ SVX_DLLPRIVATE OUString ImplInsertEmbeddedObjectURL(
+ const OUString& rURLStr );
+
+ SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > ImplGetReplacementImage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj );
+
+protected:
+
+ SvXMLEmbeddedObjectHelper();
+ ~SvXMLEmbeddedObjectHelper();
+ void Init( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&,
+ ::comphelper::IEmbeddedHelper& rDocPersist,
+ SvXMLEmbeddedObjectHelperMode eCreateMode );
+
+ virtual void SAL_CALL disposing();
+
+public:
+ SvXMLEmbeddedObjectHelper(
+ ::comphelper::IEmbeddedHelper& rDocPersist,
+ SvXMLEmbeddedObjectHelperMode eCreateMode );
+
+ static SvXMLEmbeddedObjectHelper* Create(
+ const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&,
+ ::comphelper::IEmbeddedHelper& rDocPersist,
+ SvXMLEmbeddedObjectHelperMode eCreateMode,
+ sal_Bool bDirect = sal_True );
+ static SvXMLEmbeddedObjectHelper* Create(
+ ::comphelper::IEmbeddedHelper& rDocPersist,
+ SvXMLEmbeddedObjectHelperMode eCreateMode );
+ static void Destroy( SvXMLEmbeddedObjectHelper* pSvXMLEmbeddedObjectHelper );
+
+ void Flush();
+
+ // XEmbeddedObjectResolver
+ virtual OUString SAL_CALL resolveEmbeddedObjectURL( const OUString& aURL ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XNameAccess
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XNameAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException);
+
+
+ static void splitObjectURL(OUString aURLNoPar,
+ OUString& rContainerStorageName,
+ OUString& rObjectStorageName);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xmlexchg.hxx b/include/svx/xmlexchg.hxx
new file mode 100644
index 000000000000..8019779b3748
--- /dev/null
+++ b/include/svx/xmlexchg.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 _SVX_XMLEXCHG_HXX_
+#define _SVX_XMLEXCHG_HXX_
+
+#include <svtools/transfer.hxx>
+#include "svx/svxdllapi.h"
+
+namespace com {
+ namespace sun {
+ namespace star {
+ namespace beans {
+ class SAL_NO_VTABLE XPropertySet;
+ }
+ }
+ }
+}
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+
+ //====================================================================
+ //= OXFormsDescriptor
+ //====================================================================
+
+ struct SVX_DLLPUBLIC OXFormsDescriptor {
+
+ String szName;
+ String szServiceName;
+ ::com::sun::star::uno::Reference
+ < ::com::sun::star::beans::XPropertySet >
+ xPropSet;
+
+ inline OXFormsDescriptor( void ) {}
+ inline OXFormsDescriptor( const OXFormsDescriptor &rhs ) { *this=rhs; }
+ inline OXFormsDescriptor &operator = ( const OXFormsDescriptor &rhs ) {
+ szName = rhs.szName;
+ szServiceName = rhs.szServiceName;
+ xPropSet = rhs.xPropSet;
+ return (*this);
+ }
+ };
+
+ //====================================================================
+ //= OXFormsTransferable
+ //====================================================================
+ class SVX_DLLPUBLIC OXFormsTransferable : public TransferableHelper {
+
+ protected:
+
+ // TransferableHelper overridables
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+
+ 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 );
+ };
+
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // _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 000000000000..d14c9dc5cd23
--- /dev/null
+++ b/include/svx/xmlgrhlp.hxx
@@ -0,0 +1,158 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLGRHLP_HXX
+#define _XMLGRHLP_HXX
+
+#include <cppuhelper/compbase2.hxx>
+#include <osl/mutex.hxx>
+#include <svtools/grfmgr.hxx>
+#include <vector>
+#include <set>
+#include <utility>
+#include <com/sun/star/document/XGraphicObjectResolver.hpp>
+#include <com/sun/star/document/XBinaryStreamResolver.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include "svx/svxdllapi.h"
+
+// ----------------------
+// - SvXMLGraphicHelper -
+// ----------------------
+
+enum SvXMLGraphicHelperMode
+{
+ GRAPHICHELPER_MODE_READ = 0,
+ GRAPHICHELPER_MODE_WRITE = 1
+};
+
+// ----------------------
+// - SvXMLGraphicHelper -
+// ----------------------
+struct SvxGraphicHelperStream_Impl
+{
+ ::com::sun::star::uno::Reference < ::com::sun::star::embed::XStorage > xStorage;
+ ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream > xStream;
+};
+
+class SVX_DLLPUBLIC SvXMLGraphicHelper : public ::cppu::WeakComponentImplHelper2< ::com::sun::star::document::XGraphicObjectResolver,
+ ::com::sun::star::document::XBinaryStreamResolver >
+{
+private:
+
+ typedef ::std::pair< OUString, OUString > URLPair;
+ typedef ::std::vector< URLPair > URLPairVector;
+ typedef ::std::vector< GraphicObject > GraphicObjectVector;
+ typedef ::std::set< OUString > URLSet;
+ typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > > GraphicOutputStreamVector;
+
+ ::osl::Mutex maMutex;
+ ::com::sun::star::uno::Reference < ::com::sun::star::embed::XStorage > mxRootStorage;
+ OUString maCurStorageName;
+ URLPairVector maGrfURLs;
+ GraphicObjectVector maGrfObjs;
+ GraphicOutputStreamVector maGrfStms;
+ URLSet maURLSet;
+ SvXMLGraphicHelperMode meCreateMode;
+ sal_Bool mbDirect;
+
+ SVX_DLLPRIVATE sal_Bool ImplGetStreamNames( const OUString& rURLStr,
+ OUString& rPictureStorageName,
+ OUString& rPictureStreamName );
+ SVX_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::embed::XStorage > ImplGetGraphicStorage( const OUString& rPictureStorageName );
+ SVX_DLLPRIVATE SvxGraphicHelperStream_Impl ImplGetGraphicStream( const OUString& rPictureStorageName,
+ const OUString& rPictureStreamName,
+ sal_Bool bTruncate );
+ SVX_DLLPRIVATE String ImplGetGraphicMimeType( const String& rFileName ) const;
+ SVX_DLLPRIVATE Graphic ImplReadGraphic( const OUString& rPictureStorageName,
+ const OUString& rPictureStreamName );
+ SVX_DLLPRIVATE sal_Bool ImplWriteGraphic( const OUString& rPictureStorageName,
+ const OUString& rPictureStreamName,
+ const OUString& rGraphicId,
+ bool bUseGfxLink );
+ SVX_DLLPRIVATE void ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt32 nInsertPos, OUString& rRequestedFileName );
+
+protected:
+ SvXMLGraphicHelper();
+ ~SvXMLGraphicHelper();
+ void Init( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XStorage >& xXMLStorage,
+ SvXMLGraphicHelperMode eCreateMode,
+ sal_Bool bDirect );
+
+ virtual void SAL_CALL disposing();
+
+public:
+ SvXMLGraphicHelper( SvXMLGraphicHelperMode eCreateMode );
+
+ static SvXMLGraphicHelper* Create( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XStorage >& rXMLStorage,
+ SvXMLGraphicHelperMode eCreateMode,
+ sal_Bool bDirect = sal_True );
+ static SvXMLGraphicHelper* Create( SvXMLGraphicHelperMode eCreateMode );
+
+ static void Destroy( SvXMLGraphicHelper* pSvXMLGraphicHelper );
+
+public:
+
+ // XGraphicObjectResolver
+ virtual OUString SAL_CALL resolveGraphicObjectURL( const OUString& aURL ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XBinaryStreamResolver
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( const OUString& rURL ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL createOutputStream( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL resolveOutputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rxBinaryStream ) throw (::com::sun::star::uno::RuntimeException);
+};
+
+
+// for instantiation via service manager
+namespace svx
+{
+/** Create this with createInstanceWithArguments. service name
+ "com.sun.star.comp.Svx.GraphicImportHelper", one argument which is the
+ XStorage. Without arguments no helper class is created. With an empty
+ argument the helper class is created and initialized like in the CTOR to
+ SvXMLGraphicHelper that only gets the create mode.
+
+ You should call dispose after you no longer need this component.
+
+ uses eCreateMode == GRAPHICHELPER_MODE_READ, bDirect == sal_True in
+ SvXMLGraphicHelper
+ */
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicImportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
+SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< OUString > SAL_CALL SvXMLGraphicImportHelper_getSupportedServiceNames() throw();
+SVX_DLLPUBLIC OUString SAL_CALL SvXMLGraphicImportHelper_getImplementationName() throw();
+
+/** Create this with createInstanceWithArguments. service name
+ "com.sun.star.comp.Svx.GraphicExportHelper", one argument which is the
+ XStorage. Without arguments no helper class is created. With an empty
+ argument the helper class is created and initialized like in the CTOR to
+ SvXMLGraphicHelper that only gets the create mode
+
+ To write the Pictures stream, you have to call dispose at this component.
+ Make sure you call dipose before you commit the parent storage.
+
+ uses eCreateMode == GRAPHICHELPER_MODE_WRITE, bDirect == sal_True in
+ SvXMLGraphicHelper
+ */
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvXMLGraphicExportHelper_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
+SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< OUString > SAL_CALL SvXMLGraphicExportHelper_getSupportedServiceNames() throw();
+SVX_DLLPUBLIC OUString SAL_CALL SvXMLGraphicExportHelper_getImplementationName() throw();
+}
+
+#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 000000000000..8fd46b07c22f
--- /dev/null
+++ b/include/svx/xmlsecctrl.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 _XMLSECURITY_STBCONTRL_HXX
+#define _XMLSECURITY_STBCONTRL_HXX
+
+#include <sfx2/stbitem.hxx>
+#include "svx/svxdllapi.h"
+
+
+class SvxSizeItem;
+
+// class SvxPosSizeToolBoxControl ----------------------------------------
+
+class SVX_DLLPUBLIC XmlSecStatusBarControl : public SfxStatusBarControl
+{
+private:
+ struct XmlSecStatusBarControl_Impl;
+
+ XmlSecStatusBarControl_Impl* mpImpl;
+
+public:
+ SFX_DECL_STATUSBAR_CONTROL();
+
+ XmlSecStatusBarControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& _rStb );
+ ~XmlSecStatusBarControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual void Paint( const UserDrawEvent& rEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xoutbmp.hxx b/include/svx/xoutbmp.hxx
new file mode 100644
index 000000000000..0c614b93c356
--- /dev/null
+++ b/include/svx/xoutbmp.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 _XOUTBMP_HXX
+#define _XOUTBMP_HXX
+
+#include <vcl/graph.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include "svx/svxdllapi.h"
+
+#define XOUTBMP_MIRROR_HORZ 0x00000001L
+#define XOUTBMP_MIRROR_VERT 0x00000010L
+
+#define XOUTBMP_CONTOUR_HORZ 0x00000001L
+#define XOUTBMP_CONTOUR_VERT 0x00000002L
+#define XOUTBMP_CONTOUR_EDGEDETECT 0x00000004L
+#define XOUTBMP_DONT_ADD_EXTENSION 0x00000008L
+
+#define XOUTBMP_DONT_EXPAND_FILENAME 0x10000000L
+#define XOUTBMP_USE_GIF_IF_POSSIBLE 0x20000000L
+#define XOUTBMP_USE_GIF_IF_SENSIBLE 0x40000000L
+#define XOUTBMP_USE_NATIVE_IF_POSSIBLE 0x80000000L
+
+class GraphicFilter;
+class VirtualDevice;
+class INetURLObject;
+class Polygon;
+
+class SVX_DLLPUBLIC XOutBitmap
+{
+public:
+
+ static GraphicFilter* pGrfFilter;
+
+ static Graphic MirrorGraphic( const Graphic& rGraphic, const sal_uIntPtr nMirrorFlags );
+ static Animation MirrorAnimation( const Animation& rAnimation, sal_Bool bHMirr, sal_Bool bVMirr );
+ static sal_uInt16 WriteGraphic( const Graphic& rGraphic, String& rFileName,
+ const String& rFilterName, const sal_uIntPtr nFlags = 0L,
+ const Size* pMtfSize_100TH_MM = NULL );
+
+ static sal_uInt16 ExportGraphic( const Graphic& rGraphic, const INetURLObject& rURL,
+ GraphicFilter& rFilter, const sal_uInt16 nFormat,
+ const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData = NULL );
+
+ static Bitmap DetectEdges( const Bitmap& rBmp, const sal_uInt8 cThreshold );
+
+ static Polygon GetCountour( const Bitmap& rBmp, const sal_uIntPtr nContourFlags,
+ const sal_uInt8 cEdgeDetectThreshold = 50,
+ const Rectangle* pWorkRect = NULL );
+};
+
+SVX_DLLPUBLIC sal_Bool DitherBitmap( Bitmap& rBitmap );
+
+#endif // _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 000000000000..f6a846f6b470
--- /dev/null
+++ b/include/svx/xpoly.hxx
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _XPOLY_HXX
+#define _XPOLY_HXX
+
+#include <tools/solar.h>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include "svx/svxdllapi.h"
+
+class Point;
+class Rectangle;
+class SvStream;
+class Polygon;
+class PolyPolygon;
+class OutputDevice;
+
+/************************************************************************/
+
+#define XPOLYPOLY_APPEND 0xFFFF
+#define XPOLY_APPEND 0xFFFF
+
+#define XPOLY_MAXPOINTS 0xFFF0 /* Auch fuer die 32-Bitter etwas Luft lassen */
+
+/************************************************************************/
+// Punktstile im XPolygon:
+// NORMAL : Anfangs- oder Endpunkt einer Kurve oder Linie
+// SMOOTH : Glatter Uebergang zwischen Kurven
+// SYMMTR : glatter und symmetrischer Uebergang zwischen Kurven
+// CONTROL: Kontrollpunkt einer Bezierkurve
+
+enum XPolyFlags { XPOLY_NORMAL, XPOLY_SMOOTH, XPOLY_CONTROL, XPOLY_SYMMTR };
+
+
+/*************************************************************************
+|*
+|* Klasse XPolygon; hat neben dem Point-Array noch ein Array mit Flags,
+|* die Informationen ueber den jeweiligen Punkt enthalten
+|*
+\************************************************************************/
+
+class ImpXPolygon;
+
+class SVX_DLLPUBLIC XPolygon
+{
+protected:
+ ImpXPolygon* pImpXPolygon;
+
+ // ImpXPolygon-ReferenceCount pruefen und ggf. abkoppeln
+ void CheckReference();
+
+ // Hilfsfunktionen fuer Bezierkonvertierung
+ void SubdivideBezier(sal_uInt16 nPos, sal_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);
+ sal_Bool CheckAngles(sal_uInt16& nStart, sal_uInt16 nEnd, sal_uInt16& nA1, sal_uInt16& nA2);
+
+public:
+ XPolygon( sal_uInt16 nSize=16, sal_uInt16 nResize=16 );
+ XPolygon( const XPolygon& rXPoly );
+ XPolygon( const Rectangle& rRect, long nRx = 0, long nRy = 0 );
+ XPolygon( const Point& rCenter, long nRx, long nRy,
+ sal_uInt16 nStartAngle = 0, sal_uInt16 nEndAngle = 3600,
+ sal_Bool bClose = sal_True );
+
+ ~XPolygon();
+
+ void SetPointCount( sal_uInt16 nPoints );
+ sal_uInt16 GetPointCount() const;
+
+ void Insert( sal_uInt16 nPos, const Point& rPt, XPolyFlags eFlags );
+ void Insert( sal_uInt16 nPos, const XPolygon& rXPoly );
+ void Remove( sal_uInt16 nPos, sal_uInt16 nCount );
+ void Move( long nHorzMove, long nVertMove );
+ Rectangle GetBoundRect() const;
+
+ const Point& operator[]( sal_uInt16 nPos ) const;
+ Point& operator[]( sal_uInt16 nPos );
+ XPolygon& operator=( const XPolygon& rXPoly );
+ sal_Bool operator==( const XPolygon& rXPoly ) const;
+ sal_Bool operator!=( const XPolygon& rXPoly ) const;
+
+ XPolyFlags GetFlags( sal_uInt16 nPos ) const;
+ void SetFlags( sal_uInt16 nPos, XPolyFlags eFlags );
+ sal_Bool IsControl(sal_uInt16 nPos) const;
+ sal_Bool IsSmooth(sal_uInt16 nPos) const;
+
+ // Abstand zwischen zwei Punkten
+ double CalcDistance(sal_uInt16 nP1, sal_uInt16 nP2);
+
+ // Bezierkonvertierungen
+ 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);
+
+ // Transformationen
+ void Translate(const Point& rTrans);
+ void Scale(double fSx, double fSy);
+ void Distort(const 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);
+};
+
+/*************************************************************************
+|*
+|* Klasse XPolyPolygon; wie PolyPolygon, nur statt aus Polygonen aus
+|* XPolygonen bestehend
+|*
+\************************************************************************/
+
+class ImpXPolyPolygon;
+
+class SVX_DLLPUBLIC XPolyPolygon
+{
+protected:
+ ImpXPolyPolygon* pImpXPolyPolygon;
+
+ // ImpXPolyPolygon-ReferenceCount pruefen und ggf. abkoppeln
+ void CheckReference();
+
+public:
+ XPolyPolygon( sal_uInt16 nInitSize = 16, sal_uInt16 nResize = 16 );
+ XPolyPolygon( const XPolyPolygon& rXPolyPoly );
+
+ ~XPolyPolygon();
+
+ void Insert( const XPolygon& rXPoly,
+ sal_uInt16 nPos = XPOLYPOLY_APPEND );
+ void Insert( const XPolyPolygon& rXPoly,
+ sal_uInt16 nPos=XPOLYPOLY_APPEND );
+ XPolygon Remove( sal_uInt16 nPos );
+ const XPolygon& GetObject( sal_uInt16 nPos ) const;
+
+ void Clear();
+ sal_uInt16 Count() const;
+
+ Rectangle GetBoundRect() const;
+
+ const XPolygon& operator[]( sal_uInt16 nPos ) const
+ { return GetObject( nPos ); }
+ XPolygon& operator[]( sal_uInt16 nPos );
+
+ XPolyPolygon& operator=( const XPolyPolygon& rXPolyPoly );
+ sal_Bool operator==( const XPolyPolygon& rXPolyPoly ) const;
+ sal_Bool operator!=( const XPolyPolygon& rXPolyPoly ) const;
+
+ // Transformationen
+ void Distort(const 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 // _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 000000000000..e7838d6e8faa
--- /dev/null
+++ b/include/svx/xpool.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 _XPOOL_HXX
+#define _XPOOL_HXX
+
+#include <svl/itempool.hxx>
+#include <svx/xdef.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* Klassendeklaration
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XOutdevItemPool : public SfxItemPool
+{
+protected:
+ SfxPoolItem** mppLocalPoolDefaults;
+ SfxItemInfo* mpLocalItemInfos;
+
+public:
+ XOutdevItemPool(
+ SfxItemPool* pMaster = 0L,
+ sal_uInt16 nAttrStart = XATTR_START,
+ sal_uInt16 nAttrEnd = XATTR_END,
+ sal_Bool bLoadRefCounts = sal_True);
+ XOutdevItemPool(const XOutdevItemPool& rPool);
+
+ virtual SfxItemPool* Clone() const;
+protected:
+ virtual ~XOutdevItemPool();
+};
+
+#endif // _XPOOL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xsetit.hxx b/include/svx/xsetit.hxx
new file mode 100644
index 000000000000..c5f59d2fb1ae
--- /dev/null
+++ b/include/svx/xsetit.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 _SVX_XSETITEM_HXX
+#define _SVX_XSETITEM_HXX
+
+#include <svx/xit.hxx>
+#include <svl/metitem.hxx>
+#include <svl/eitem.hxx>
+#include <svx/rectenum.hxx>
+
+#include <svx/xlnasit.hxx>
+#include <svx/xflasit.hxx>
+#include <svx/xlntrit.hxx>
+#include <svx/xfltrit.hxx>
+#include <svx/xftshtit.hxx>
+#include <svx/xgrscit.hxx>
+#include <svx/xflbmtit.hxx>
+#include <svx/xflbmpit.hxx>
+#include <svx/xflbmsxy.hxx>
+#include <svx/xflbmsli.hxx>
+#include <svx/xflbtoxy.hxx>
+#include <svx/xflbstit.hxx>
+#include <svx/xflboxy.hxx>
+#include <svx/xflbckit.hxx>
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xsflclit.hxx b/include/svx/xsflclit.hxx
new file mode 100644
index 000000000000..1634eb053543
--- /dev/null
+++ b/include/svx/xsflclit.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 _SVX_XSFLCLIT_HXX
+#define _SVX_XSFLCLIT_HXX
+
+#include <svx/xcolit.hxx>
+
+//------------------------------
+// class XSecondaryFillColorItem
+//------------------------------
+class SVX_DLLPUBLIC XSecondaryFillColorItem : public XColorItem
+{
+public:
+ TYPEINFO();
+ SVX_DLLPRIVATE XSecondaryFillColorItem() {}
+ XSecondaryFillColorItem(const String& rName, const Color& rTheColor);
+ SVX_DLLPRIVATE XSecondaryFillColorItem(SvStream& rIn);
+
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+
+ SVX_DLLPRIVATE virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ OUString &rText, const IntlWrapper * = 0 ) const;
+
+ SVX_DLLPRIVATE virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+
+};
+
+#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 000000000000..93ad230ea75f
--- /dev/null
+++ b/include/svx/xtable.hxx
@@ -0,0 +1,501 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _XTABLE_HXX
+#define _XTABLE_HXX
+
+#include <rtl/ref.hxx>
+#include <svx/xpoly.hxx>
+#include <svx/xdash.hxx>
+#include <svx/xhatch.hxx>
+#include <svx/xgrad.hxx>
+#include <svx/xflasit.hxx>
+#include <svx/xlnasit.hxx>
+
+#include <tools/color.hxx>
+#include <tools/string.hxx>
+#include <tools/contnr.hxx>
+
+#include <cppuhelper/weak.hxx>
+
+#include "svx/svxdllapi.h"
+#include <com/sun/star/embed/XStorage.hpp>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <svtools/grfmgr.hxx>
+
+class Color;
+class Bitmap;
+class VirtualDevice;
+class XOutdevItemPool;
+
+// Breite und Hoehe der LB-Bitmaps
+#define BITMAP_WIDTH 32
+#define BITMAP_HEIGHT 12
+
+// Standard-Vergleichsstring
+extern sal_Unicode pszStandard[]; // "standard"
+
+// Funktion zum Konvertieren in echte RGB-Farben, da mit
+// enum COL_NAME nicht verglichen werden kann.
+SVX_DLLPUBLIC Color RGB_Color( ColorData nColorName );
+
+// ---------------------
+// class XPropertyEntry
+// ---------------------
+
+class XPropertyEntry
+{
+protected:
+ String aName;
+
+ XPropertyEntry(const String& rName) : aName(rName) {}
+ XPropertyEntry(const XPropertyEntry& rOther): aName(rOther.aName) {}
+public:
+
+ virtual ~XPropertyEntry() {}
+ void SetName(const String& rName) { aName = rName; }
+ String& GetName() { return aName; }
+};
+
+// ------------------
+// class XColorEntry
+// ------------------
+
+class XColorEntry : public XPropertyEntry
+{
+ Color aColor;
+
+public:
+ XColorEntry(const Color& rColor, const String& rName)
+ : XPropertyEntry(rName)
+ , aColor(rColor)
+ {}
+
+ void SetColor(const Color& rColor) { aColor = rColor; }
+ Color& GetColor() { return aColor; }
+};
+
+// --------------------
+// class XLineEndEntry
+// --------------------
+
+class XLineEndEntry : public XPropertyEntry
+{
+ basegfx::B2DPolyPolygon aB2DPolyPolygon;
+
+public:
+ XLineEndEntry(const basegfx::B2DPolyPolygon& rB2DPolyPolygon, const String& rName)
+ : XPropertyEntry(rName),
+ aB2DPolyPolygon(rB2DPolyPolygon)
+ {}
+
+ void SetLineEnd(const basegfx::B2DPolyPolygon& rB2DPolyPolygon)
+ {
+ aB2DPolyPolygon = rB2DPolyPolygon;
+ }
+
+ basegfx::B2DPolyPolygon& GetLineEnd()
+ {
+ return aB2DPolyPolygon;
+ }
+};
+
+// ------------------
+// class XDashEntry
+// ------------------
+
+class XDashEntry : public XPropertyEntry
+{
+ XDash aDash;
+
+public:
+ XDashEntry(const XDash& rDash, const String& rName) :
+ XPropertyEntry(rName), aDash(rDash) {}
+
+ void SetDash(const XDash& rDash) { aDash = rDash; }
+ XDash& GetDash() { return aDash; }
+};
+
+// ------------------
+// class XHatchEntry
+// ------------------
+
+class XHatchEntry : public XPropertyEntry
+{
+ XHatch aHatch;
+
+public:
+ XHatchEntry(const XHatch& rHatch, const String& rName) :
+ XPropertyEntry(rName), aHatch(rHatch) {}
+
+ void SetHatch(const XHatch& rHatch) { aHatch = rHatch; }
+ XHatch& GetHatch() { return aHatch; }
+};
+
+// ---------------------
+// class XGradientEntry
+// ---------------------
+
+class XGradientEntry : public XPropertyEntry
+{
+ XGradient aGradient;
+
+public:
+ XGradientEntry(const XGradient& rGradient, const String& rName):
+ XPropertyEntry(rName), aGradient(rGradient) {}
+
+ void SetGradient(const XGradient& rGrad) { aGradient = rGrad; }
+ XGradient& GetGradient() { return aGradient; }
+};
+
+// ---------------------
+// class XBitmapEntry
+// ---------------------
+
+class XBitmapEntry : public XPropertyEntry
+{
+private:
+ GraphicObject maGraphicObject;
+
+public:
+ XBitmapEntry(const GraphicObject& rGraphicObject, const String& rName)
+ : XPropertyEntry(rName),
+ maGraphicObject(rGraphicObject)
+ {
+ }
+
+ XBitmapEntry(const XBitmapEntry& rOther)
+ : XPropertyEntry(rOther),
+ maGraphicObject(rOther.maGraphicObject)
+ {
+ }
+
+ const GraphicObject& GetGraphicObject() const
+ {
+ return maGraphicObject;
+ }
+
+ void SetGraphicObject(const GraphicObject& rGraphicObject)
+ {
+ maGraphicObject = rGraphicObject;
+ }
+};
+
+// --------------------
+// class XPropertyList
+// --------------------
+
+enum XPropertyListType {
+ XCOLOR_LIST,
+ XLINE_END_LIST,
+ XDASH_LIST,
+ XHATCH_LIST,
+ XGRADIENT_LIST,
+ XBITMAP_LIST,
+ XPROPERTY_LIST_COUNT
+};
+
+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 XLineEndList ; typedef rtl::Reference< class XLineEndList > XLineEndListRef;
+class XGradientList ; typedef rtl::Reference< class XGradientList > XGradientListRef;
+
+class SVX_DLLPUBLIC XPropertyList : public cppu::OWeakObject
+{
+ private:
+ SAL_DLLPRIVATE void* operator new(size_t);
+ protected:
+ SAL_DLLPRIVATE void operator delete(void *);
+protected:
+ typedef ::std::vector< XPropertyEntry* > XPropertyEntryList_impl;
+ typedef ::std::vector< Bitmap* > BitmapList_impl;
+
+ XPropertyListType eType;
+ String aName; // not persistent
+ String aPath;
+ XOutdevItemPool* pXPool;
+
+ XPropertyEntryList_impl aList;
+ BitmapList_impl* pBmpList;
+
+ bool bListDirty;
+ bool bBitmapsDirty;
+ bool bOwnPool;
+ bool bEmbedInDocument;
+
+ XPropertyList( XPropertyListType t, const String& rPath,
+ XOutdevItemPool* pXPool = NULL );
+
+public:
+ virtual ~XPropertyList();
+
+ XPropertyListType Type() const { return eType; }
+ long Count() const;
+
+ void Insert( XPropertyEntry* pEntry, long nIndex = CONTAINER_APPEND );
+ XPropertyEntry* Replace( XPropertyEntry* pEntry, long nIndex );
+ XPropertyEntry* Remove( long nIndex );
+
+ // Note: Get(long) & Get( String& ) are ambiguous
+ XPropertyEntry* Get( long nIndex, sal_uInt16 nDummy ) const;
+ long Get(const String& rName);
+
+ Bitmap* GetBitmap( long nIndex ) const;
+
+ const String& GetName() const { return aName; }
+ void SetName( const String& rString );
+ const String& GetPath() const { return aPath; }
+ void SetPath( const String& rString ) { aPath = rString; }
+ sal_Bool IsDirty() const { return bListDirty && bBitmapsDirty; }
+ void SetDirty( sal_Bool bDirty = sal_True )
+ { bListDirty = bDirty; bBitmapsDirty = bDirty; }
+ bool IsEmbedInDocument() const { return bEmbedInDocument; }
+ void SetEmbedInDocument(bool b) { bEmbedInDocument = b; }
+
+ static OUString GetDefaultExt(XPropertyListType t);
+ static OUString GetDefaultExtFilter(XPropertyListType t);
+ OUString GetDefaultExt() const { return GetDefaultExt( eType ); }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ createInstance() = 0;
+ bool Load();
+ bool LoadFrom( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::embed::XStorage > &xStorage,
+ const OUString &rURL );
+ bool Save();
+ bool SaveTo ( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::embed::XStorage > &xStorage,
+ const OUString &rURL,
+ OUString *pOptName );
+ virtual sal_Bool Create() = 0;
+ virtual sal_Bool CreateBitmapsForUI() = 0;
+ virtual Bitmap* CreateBitmapForUI( long nIndex, sal_Bool bDelete = sal_True ) = 0;
+
+ // Factory method for sub-classes
+ static XPropertyListRef CreatePropertyList( XPropertyListType t,
+ const String& rPath,
+ XOutdevItemPool* pXPool = NULL );
+ // as above but initializes name as expected
+ static XPropertyListRef CreatePropertyListFromURL( XPropertyListType t,
+ const OUString & rUrl,
+ XOutdevItemPool* pXPool = NULL );
+
+ // helper accessors
+ inline XDashListRef AsDashList();
+ inline XHatchListRef AsHatchList();
+ inline XColorListRef AsColorList();
+ inline XBitmapListRef AsBitmapList();
+ inline XLineEndListRef AsLineEndList();
+ inline XGradientListRef AsGradientList();
+};
+
+// ------------------
+// class XColorList
+// ------------------
+
+class SVX_DLLPUBLIC XColorList : public XPropertyList
+{
+public:
+ explicit XColorList( const String& rPath,
+ XOutdevItemPool* pXInPool = NULL ) :
+ XPropertyList( XCOLOR_LIST, rPath, pXInPool ) {}
+
+ using XPropertyList::Replace;
+ using XPropertyList::Remove;
+ using XPropertyList::Get;
+
+ XColorEntry* Replace(long nIndex, XColorEntry* pEntry );
+ XColorEntry* Remove(long nIndex);
+ XColorEntry* GetColor(long nIndex) const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance();
+ virtual sal_Bool Create();
+ virtual sal_Bool CreateBitmapsForUI();
+ virtual Bitmap* CreateBitmapForUI( long nIndex, sal_Bool bDelete = sal_True );
+
+ static XColorListRef CreateStdColorList();
+ static XColorListRef GetStdColorList(); // returns a singleton
+};
+
+// -------------------
+// class XLineEndList
+// -------------------
+class impXLineEndList;
+
+class SVX_DLLPUBLIC XLineEndList : public XPropertyList
+{
+private:
+ impXLineEndList* mpData;
+
+ void impCreate();
+ void impDestroy();
+
+public:
+ explicit XLineEndList(
+ const String& rPath,
+ XOutdevItemPool* pXPool = 0
+ );
+ virtual ~XLineEndList();
+
+ using XPropertyList::Remove;
+ XLineEndEntry* Remove(long nIndex);
+ using XPropertyList::Get;
+ XLineEndEntry* GetLineEnd(long nIndex) const;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance();
+ virtual sal_Bool Create();
+ virtual sal_Bool CreateBitmapsForUI();
+ virtual Bitmap* CreateBitmapForUI(long nIndex, sal_Bool bDelete = sal_True);
+};
+
+// -------------------
+// class XDashList
+// -------------------
+class impXDashList;
+
+class SVX_DLLPUBLIC XDashList : public XPropertyList
+{
+private:
+ impXDashList* mpData;
+
+ void impCreate();
+ void impDestroy();
+
+public:
+ explicit XDashList(
+ const String& rPath,
+ XOutdevItemPool* pXPool = 0
+ );
+ virtual ~XDashList();
+
+ using XPropertyList::Replace;
+ XDashEntry* Replace(XDashEntry* pEntry, long nIndex);
+ using XPropertyList::Remove;
+ XDashEntry* Remove(long nIndex);
+ using XPropertyList::Get;
+ XDashEntry* GetDash(long nIndex) const;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance();
+ virtual sal_Bool Create();
+ virtual sal_Bool CreateBitmapsForUI();
+ virtual Bitmap* CreateBitmapForUI(long nIndex, sal_Bool bDelete = sal_True);
+};
+
+// -------------------
+// class XHatchList
+// -------------------
+class impXHatchList;
+
+class SVX_DLLPUBLIC XHatchList : public XPropertyList
+{
+private:
+ impXHatchList* mpData;
+
+ void impCreate();
+ void impDestroy();
+
+public:
+ explicit XHatchList( const String& rPath,
+ XOutdevItemPool* pXPool = 0 );
+ virtual ~XHatchList();
+
+ using XPropertyList::Replace;
+ XHatchEntry* Replace(XHatchEntry* pEntry, long nIndex);
+ using XPropertyList::Remove;
+ XHatchEntry* Remove(long nIndex);
+ using XPropertyList::Get;
+ XHatchEntry* GetHatch(long nIndex) const;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance();
+ virtual sal_Bool Create();
+ virtual sal_Bool CreateBitmapsForUI();
+ virtual Bitmap* CreateBitmapForUI(long nIndex, sal_Bool bDelete = sal_True);
+};
+
+// -------------------
+// class XGradientList
+// -------------------
+class impXGradientList;
+
+class SVX_DLLPUBLIC XGradientList : public XPropertyList
+{
+private:
+ impXGradientList* mpData;
+
+ void impCreate();
+ void impDestroy();
+
+public:
+ explicit XGradientList(
+ const String& rPath,
+ XOutdevItemPool* pXPool = 0
+ );
+ virtual ~XGradientList();
+
+ using XPropertyList::Replace;
+ XGradientEntry* Replace(XGradientEntry* pEntry, long nIndex);
+ using XPropertyList::Remove;
+ XGradientEntry* Remove(long nIndex);
+ using XPropertyList::Get;
+ XGradientEntry* GetGradient(long nIndex) const;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance();
+ virtual sal_Bool Create();
+ virtual sal_Bool CreateBitmapsForUI();
+ virtual Bitmap* CreateBitmapForUI(long nIndex, sal_Bool bDelete = sal_True);
+};
+
+// -------------------
+// class XBitmapList
+// -------------------
+
+class SVX_DLLPUBLIC XBitmapList : public XPropertyList
+{
+public:
+ explicit XBitmapList( const String& rPath,
+ XOutdevItemPool* pXInPool = NULL )
+ : XPropertyList( XBITMAP_LIST, rPath, pXInPool ) {}
+
+ using XPropertyList::Replace;
+ using XPropertyList::Remove;
+ XBitmapEntry* Remove(long nIndex);
+ using XPropertyList::Get;
+ XBitmapEntry* GetBitmap(long nIndex) const;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance();
+ virtual sal_Bool Create();
+ virtual sal_Bool CreateBitmapsForUI();
+ virtual Bitmap* CreateBitmapForUI( long nIndex, sal_Bool bDelete = sal_True );
+};
+
+
+// FIXME: could add type checking too ...
+inline XDashListRef XPropertyList::AsDashList() { return XDashListRef( static_cast<XDashList *> (this) ); }
+inline XHatchListRef XPropertyList::AsHatchList() { return XHatchListRef( static_cast<XHatchList *> (this) ); }
+inline XColorListRef XPropertyList::AsColorList() { return XColorListRef( static_cast<XColorList *> (this) ); }
+inline XBitmapListRef XPropertyList::AsBitmapList() { return XBitmapListRef( static_cast<XBitmapList *> (this) ); }
+inline XLineEndListRef XPropertyList::AsLineEndList() { return XLineEndListRef( static_cast<XLineEndList *> (this) ); }
+inline XGradientListRef XPropertyList::AsGradientList() { return XGradientListRef( static_cast<XGradientList *> (this) ); }
+
+#endif // _XTABLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xtextit.hxx b/include/svx/xtextit.hxx
new file mode 100644
index 000000000000..40a33b2afa32
--- /dev/null
+++ b/include/svx/xtextit.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 _SVX_XTEXTITEM_HXX
+#define _SVX_XTEXTITEM_HXX
+
+#include <svx/xenum.hxx>
+#include <svl/metitem.hxx>
+#include <svl/eitem.hxx>
+#include <svx/xit.hxx>
+#include <svx/xcolit.hxx>
+
+#include <svx/xftadit.hxx>
+#include <svx/xftdiit.hxx>
+#include <svx/xftstit.hxx>
+#include <svx/xftmrit.hxx>
+#include <svx/xftouit.hxx>
+#include <svx/xftshit.hxx>
+#include <svx/xftshcit.hxx>
+#include <svx/xftshxy.hxx>
+#include <svx/xftsfit.hxx>
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/xtextit0.hxx b/include/svx/xtextit0.hxx
new file mode 100644
index 000000000000..9e4478f2eec6
--- /dev/null
+++ b/include/svx/xtextit0.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 _SVX_TEXTIT0_HXX
+#define _SVX_TEXTIT0_HXX
+
+#include <svx/xenum.hxx>
+#include <svl/eitem.hxx>
+#include "svx/svxdllapi.h"
+
+/*************************************************************************
+|*
+|* FormText-StyleItem
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFormTextStyleItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+ XFormTextStyleItem(XFormTextStyle = XFT_NONE);
+ XFormTextStyleItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+ virtual sal_uInt16 GetValueCount() const;
+ XFormTextStyle GetValue() const { return (XFormTextStyle) SfxEnumItem::GetValue(); }
+ // #FontWork#
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+/*************************************************************************
+|*
+|* FormText-HideFormItem
+|*
+\************************************************************************/
+
+class SVX_DLLPUBLIC XFormTextHideFormItem : public SfxBoolItem
+{
+public:
+ TYPEINFO();
+ XFormTextHideFormItem(sal_Bool bHide = sal_False);
+ XFormTextHideFormItem(SvStream& rIn);
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
+};
+
+#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 000000000000..e71f12f36995
--- /dev/null
+++ b/include/svx/zoom_def.hxx
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SVX_ZOOM_DEF_HXX
+#define _SVX_ZOOM_DEF_HXX
+
+#define ZOOMBTN_OPTIMAL ((sal_uInt16)0x0001)
+#define ZOOMBTN_PAGEWIDTH ((sal_uInt16)0x0002)
+#define ZOOMBTN_WHOLEPAGE ((sal_uInt16)0x0004)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/zoomctrl.hxx b/include/svx/zoomctrl.hxx
new file mode 100644
index 000000000000..c09acf1d5901
--- /dev/null
+++ b/include/svx/zoomctrl.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 _SVX_ZOOMCTRL_HXX
+#define _SVX_ZOOMCTRL_HXX
+
+#include <sfx2/stbitem.hxx>
+#include "svx/svxdllapi.h"
+
+// class SvxZoomToolBoxControl -------------------------------------------
+
+class SVX_DLLPUBLIC SvxZoomStatusBarControl : public SfxStatusBarControl
+{
+private:
+ sal_uInt16 nZoom;
+ sal_uInt16 nValueSet;
+
+public:
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual void Paint( const UserDrawEvent& rEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+
+ SFX_DECL_STATUSBAR_CONTROL();
+
+ SvxZoomStatusBarControl( 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 000000000000..f6be6ed760d5
--- /dev/null
+++ b/include/svx/zoomsliderctrl.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 _ZOOMSLIDER_STBCONTRL_HXX
+#define _ZOOMSLIDER_STBCONTRL_HXX
+
+#include <sfx2/stbitem.hxx>
+#include "svx/svxdllapi.h"
+
+// class SvxZoomSliderControl ----------------------------------------
+
+class SVX_DLLPUBLIC SvxZoomSliderControl : public SfxStatusBarControl
+{
+private:
+
+ struct SvxZoomSliderControl_Impl;
+ SvxZoomSliderControl_Impl* mpImpl;
+
+ sal_uInt16 Offset2Zoom( long nOffset ) const;
+ long Zoom2Offset( sal_uInt16 nZoom ) const;
+
+public:
+
+ SFX_DECL_STATUSBAR_CONTROL();
+
+ SvxZoomSliderControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& _rStb );
+ ~SvxZoomSliderControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual void Paint( const UserDrawEvent& rEvt );
+ virtual sal_Bool MouseButtonDown( const MouseEvent & );
+ virtual sal_Bool MouseMove( const MouseEvent & rEvt );
+};
+
+#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 000000000000..d3b726cba6b8
--- /dev/null
+++ b/include/svx/zoomslideritem.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 _SVX_ZOOMSLIDERITEM_HXX
+#define _SVX_ZOOMSLIDERITEM_HXX
+
+#include <svl/intitem.hxx>
+#include <svx/svxids.hrc>
+#include <com/sun/star/uno/Sequence.hxx>
+#include "svx/svxdllapi.h"
+
+//-------------------------------------------------------------------------
+
+class SVX_DLLPUBLIC SvxZoomSliderItem: public SfxUInt16Item
+{
+ com::sun::star::uno::Sequence < sal_Int32 > maValues;
+ sal_uInt16 mnMinZoom;
+ sal_uInt16 mnMaxZoom;
+
+public:
+ TYPEINFO();
+
+ SvxZoomSliderItem( sal_uInt16 nCurrentZoom = 100, sal_uInt16 nMinZoom = 20, sal_uInt16 nMaxZoom = 600, sal_uInt16 nWhich = SID_ATTR_ZOOMSLIDER );
+ SvxZoomSliderItem( const SvxZoomSliderItem& );
+ ~SvxZoomSliderItem();
+
+ void AddSnappingPoint( sal_Int32 nNew );
+ const com::sun::star::uno::Sequence < sal_Int32 >& GetSnappingPoints() const;
+ sal_uInt16 GetMinZoom() const {return mnMinZoom;}
+ sal_uInt16 GetMaxZoom() const {return mnMaxZoom;}
+
+ // "pure virtual Methoden" vom SfxPoolItem
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStrm, sal_uInt16 nVersion ) const; // leer
+ virtual SvStream& Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const; // leer
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+};
+
+//------------------------------------------------------------------------
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/beans/xpropertyset.hxx b/include/test/beans/xpropertyset.hxx
new file mode 100644
index 000000000000..b5962665f56b
--- /dev/null
+++ b/include/test/beans/xpropertyset.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:
+ *
+ */
+
+#ifndef __TEST_BEANS_XPROPERTYSET_HXX__
+#define __TEST_BEANS_XPROPERTYSET_HXX__
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+
+#include "test/testdllapi.hxx"
+
+#include <vector>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XPropertySet
+{
+public:
+ virtual ~XPropertySet();
+
+ virtual uno::Reference<uno::XInterface> init() = 0;
+
+ void testGetPropertySetInfo();
+ void testAddPropertyChangeListener();
+ void testAddVetoableChangeListener();
+ void testSetPropertyValue();
+ void testGetPropertyValue();
+ void testRemovePropertyChangeListener();
+ void testRemoveVetoableChangeListener();
+
+protected:
+ virtual bool isPropertyValueChangeable(const OUString& rName);
+
+private:
+ void fillPropsToTest(const uno::Reference<beans::XPropertySetInfo>& xPropInfo);
+ static bool getSinglePropertyValue(
+ const uno::Reference<beans::XPropertySet>& xPropSet, const OUString& rName);
+
+ struct OOO_DLLPUBLIC_TEST PropsToTest
+ {
+ std::vector<OUString> constrained;
+ std::vector<OUString> bound;
+ std::vector<OUString> normal;
+ std::vector<OUString> readonly;
+
+ bool initialized;
+
+ PropsToTest();
+ };
+
+ PropsToTest maPropsToTest;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/bootstrapfixture.hxx b/include/test/bootstrapfixture.hxx
new file mode 100644
index 000000000000..d8eaa1d3831b
--- /dev/null
+++ b/include/test/bootstrapfixture.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/.
+ */
+#ifndef INCLUDED_TEST_BOOTSTRAPFIXTURE_HXX
+#define INCLUDED_TEST_BOOTSTRAPFIXTURE_HXX
+
+#include <sal/config.h>
+
+#include <rtl/string.hxx>
+#include <tools/link.hxx>
+#include <vcl/salctype.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+
+#include "cppunit/TestAssert.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/extensions/HelperMacros.h"
+#include "cppunit/plugin/TestPlugIn.h"
+#include "unotest/bootstrapfixturebase.hxx"
+#include "test/testdllapi.hxx"
+
+namespace test {
+
+// Class to do lots of heavy-lifting UNO & environment
+// bootstrapping for unit tests, such that we can use
+// almost an entire LibreOffice during compile - so
+// that we can get pieces of code alone to beat them up.
+
+// NB. this class is instantiated multiple times during a
+// run of unit tests ...
+class OOO_DLLPUBLIC_TEST BootstrapFixture : public BootstrapFixtureBase
+{
+ bool m_bNeedUCB;
+ bool m_bAssertOnDialog;
+
+public:
+ DECL_STATIC_LINK( BootstrapFixture, ImplInitFilterHdl, ConvertData* );
+
+ BootstrapFixture( bool bAssertOnDialog = true, bool bNeedUCB = true );
+ virtual ~BootstrapFixture();
+
+ virtual void setUp();
+ virtual void tearDown();
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/container/xelementaccess.hxx b/include/test/container/xelementaccess.hxx
new file mode 100644
index 000000000000..71306d345df7
--- /dev/null
+++ b/include/test/container/xelementaccess.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/.
+ */
+
+#include <com/sun/star/uno/Type.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class XElementAccess
+{
+public:
+ XElementAccess(uno::Type& rType): maType(rType) {}
+
+ void testGetElementType();
+ void testHasElements();
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ virtual ~XElementAccess() {}
+
+private:
+ uno::Type maType;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/container/xindexaccess.hxx b/include/test/container/xindexaccess.hxx
new file mode 100644
index 000000000000..1962f9f6eb13
--- /dev/null
+++ b/include/test/container/xindexaccess.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/.
+ */
+
+#include <com/sun/star/uno/Reference.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class XIndexAccess
+{
+public:
+ XIndexAccess(sal_Int32 nItems);
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+ void testGetCount();
+ void testGetByIndex();
+ // will throw an exception and should fail if not
+ void testGetByIndexException();
+
+protected:
+ ~XIndexAccess() {}
+
+private:
+ sal_Int32 mnItems;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/container/xnamecontainer.hxx b/include/test/container/xnamecontainer.hxx
new file mode 100644
index 000000000000..c231daecc0c9
--- /dev/null
+++ b/include/test/container/xnamecontainer.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/.
+ */
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XNameContainer
+{
+public:
+ // removes default entry
+ XNameContainer();
+ // removes given entry
+ XNameContainer(const OUString& rName);
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ void testRemoveByName();
+
+ virtual ~XNameContainer() {}
+
+private:
+ OUString maNameToRemove;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/container/xnamed.hxx b/include/test/container/xnamed.hxx
new file mode 100644
index 000000000000..acb367ead4a8
--- /dev/null
+++ b/include/test/container/xnamed.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/.
+ */
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XNamed
+{
+public:
+ XNamed(const OUString& rName): maName(rName) {}
+ virtual ~XNamed();
+
+ void testGetName();
+ void testSetName();
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+private:
+ OUString maName;
+
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/container/xnamereplace.hxx b/include/test/container/xnamereplace.hxx
new file mode 100644
index 000000000000..6b616cdec1a8
--- /dev/null
+++ b/include/test/container/xnamereplace.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/.
+ */
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <test/testdllapi.hxx>
+#include <com/sun/star/uno/Any.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XNameReplace
+{
+public:
+ XNameReplace(const OUString& rName): maName(rName) {}
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ void testReplaceByName();
+
+ virtual uno::Any getAnyElementForNameReplace() = 0;
+
+ virtual ~XNameReplace() {}
+
+private:
+ OUString maName;
+
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/cellproperties.hxx b/include/test/sheet/cellproperties.hxx
new file mode 100644
index 000000000000..49f9c37246cb
--- /dev/null
+++ b/include/test/sheet/cellproperties.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/.
+ */
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST CellProperties
+{
+public:
+ virtual uno::Reference < uno::XInterface > init() = 0;
+
+ void testVertJustify();
+ void testRotateReference();
+
+protected:
+ ~CellProperties() {}
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/datapilotfield.hxx b/include/test/sheet/datapilotfield.hxx
new file mode 100644
index 000000000000..253bdf474ac2
--- /dev/null
+++ b/include/test/sheet/datapilotfield.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST DataPilotField
+{
+public:
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ void testSortInfo();
+ void testLayoutInfo();
+ void testAutoShowInfo();
+ void testReference();
+ void testIsGroupField();
+
+protected:
+ ~DataPilotField() {}
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/tableautoformatfield.hxx b/include/test/sheet/tableautoformatfield.hxx
new file mode 100644
index 000000000000..6b6d79f1fe57
--- /dev/null
+++ b/include/test/sheet/tableautoformatfield.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/.
+ */
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class TableAutoFormatField
+{
+public:
+ //don't use virtual init() here
+ uno::Reference< beans::XPropertySet > initTest();
+
+ virtual uno::Reference< > getServiceFactory() = 0;
+
+ void testRotateReference();
+ void testVertJustify();
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xcellrangedata.hxx b/include/test/sheet/xcellrangedata.hxx
new file mode 100644
index 000000000000..dd56045b8649
--- /dev/null
+++ b/include/test/sheet/xcellrangedata.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/.
+ */
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XCellRangeData
+{
+public:
+
+ virtual uno::Reference< uno::XInterface > getXCellRangeData() = 0;
+
+ void testGetDataArray();
+ void testSetDataArray();
+
+protected:
+ ~XCellRangeData() {}
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xcellrangereferrer.hxx b/include/test/sheet/xcellrangereferrer.hxx
new file mode 100644
index 000000000000..22044302b087
--- /dev/null
+++ b/include/test/sheet/xcellrangereferrer.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/.
+ */
+
+#include <com/sun/star/table/CellRangeAddress.hpp>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XCellRangeReferrer
+{
+public:
+ XCellRangeReferrer( table::CellRangeAddress aCellRange ):
+ maCellRange( aCellRange ) {}
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ void testGetReferredCells();
+
+protected:
+ ~XCellRangeReferrer() {}
+
+private:
+ table::CellRangeAddress maCellRange;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xcellrangesquery.hxx b/include/test/sheet/xcellrangesquery.hxx
new file mode 100644
index 000000000000..3d419b7c8203
--- /dev/null
+++ b/include/test/sheet/xcellrangesquery.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/.
+ */
+
+#include <com/sun/star/uno/XInterface.hpp>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+
+namespace apitest {
+
+
+class OOO_DLLPUBLIC_TEST XCellRangesQuery
+{
+public:
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ //Testcases
+ void testQueryColumnDifference();
+ void testQueryContentDifference();
+ void testQueryEmptyCells();
+ void testQueryFormulaCells();
+ void testQueryIntersection();
+ void testQueryRowDifference();
+ void testQueryVisibleCells();
+
+protected:
+ ~XCellRangesQuery() {}
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xdatabaserange.hxx b/include/test/sheet/xdatabaserange.hxx
new file mode 100644
index 000000000000..2be7e4dc663f
--- /dev/null
+++ b/include/test/sheet/xdatabaserange.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/.
+ */
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XDatabaseRange
+{
+public:
+ virtual uno::Reference< uno::XInterface > init(const OUString& rDBName) = 0;
+
+ void testDataArea();
+ void testGetSortDescriptor();
+ void testGetSubtotalDescriptor();
+ void testGetImportDescriptor();
+ void testGetFilterDescriptor();
+ void testRefresh();
+
+protected:
+ ~XDatabaseRange() {}
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xdatapilotdescriptor.hxx b/include/test/sheet/xdatapilotdescriptor.hxx
new file mode 100644
index 000000000000..55b26a3bbfe7
--- /dev/null
+++ b/include/test/sheet/xdatapilotdescriptor.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/.
+ */
+
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/sheet/XDataPilotDescriptor.hpp>
+
+#include <test/testdllapi.hxx>
+
+#include <vector>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XDataPilotDescriptor
+{
+public:
+ void testSourceRange();
+ void testTag();
+ void testGetFilterDescriptor();
+ void testGetDataPilotFields();
+ void testGetColumnFields();
+ void testGetRowFields();
+ void testGetPageFields();
+ void testGetDataFields();
+ void testGetHiddenFields();
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+protected:
+ ~XDataPilotDescriptor() {}
+
+private:
+
+ void testGetDataPilotFields_Impl( uno::Reference< sheet::XDataPilotDescriptor > xDescr );
+
+ void checkName( uno::Reference< container::XIndexAccess > xIndex, sal_Int32 nIndex );
+ static std::vector<OUString> maFieldNames;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xdatapilotfieldgrouping.hxx b/include/test/sheet/xdatapilotfieldgrouping.hxx
new file mode 100644
index 000000000000..fd11a45cb051
--- /dev/null
+++ b/include/test/sheet/xdatapilotfieldgrouping.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/.
+ */
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XDataPilotFieldGrouping
+{
+public:
+ void testCreateNameGroup();
+ void testCreateDateGroup();
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+protected:
+ ~XDataPilotFieldGrouping() {}
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xdatapilottable.hxx b/include/test/sheet/xdatapilottable.hxx
new file mode 100644
index 000000000000..27c5f2a7ca8c
--- /dev/null
+++ b/include/test/sheet/xdatapilottable.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/.
+ */
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/table/XCell.hpp>
+#include <test/testdllapi.hxx>
+
+#include "cppunit/extensions/HelperMacros.h"
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XDataPilotTable
+{
+public:
+ virtual uno::Reference< uno::XInterface > init() = 0;
+ virtual ~XDataPilotTable();
+
+ void testGetOutputRange();
+ void testRefresh();
+
+protected:
+ uno::Reference< table::XCell > xCellForChange;
+ uno::Reference< table::XCell > xCellForCheck;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xdatapilottable2.hxx b/include/test/sheet/xdatapilottable2.hxx
new file mode 100644
index 000000000000..b1dc31159af3
--- /dev/null
+++ b/include/test/sheet/xdatapilottable2.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/.
+ */
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/table/CellRangeAddress.hpp>
+#include <com/sun/star/table/CellAddress.hpp>
+#include <com/sun/star/sheet/XDataPilotTable2.hpp>
+#include <com/sun/star/sheet/XSpreadsheet.hpp>
+#include <com/sun/star/uno/Sequence.h>
+
+#include "test/testdllapi.hxx"
+
+#include <vector>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XDataPilotTable2
+{
+public:
+ void testGetPositionData();
+ void testGetDrillDownData();
+ void testGetOutputRangeByType();
+ void testInsertDrillDownSheet();
+ virtual ~XDataPilotTable2();
+
+ virtual uno::Reference< uno::XInterface > initDP2() = 0;
+ virtual uno::Reference< uno::XInterface > getSheets() = 0;
+
+protected:
+
+private:
+ bool checkDrillDownSheetContent(uno::Reference< sheet::XSpreadsheet >, uno::Sequence< uno::Sequence < uno::Any > > aData);
+
+ void getOutputRanges(uno::Reference< sheet::XDataPilotTable2 >);
+ void buildDataFields(uno::Reference< sheet::XDataPilotTable2 >);
+ void buildResultCells(uno::Reference< sheet::XDataPilotTable2 >);
+
+ std::vector< table::CellAddress > maResultCells;
+ std::vector< sal_Int32 > maDataFieldDims;
+ table::CellRangeAddress maRangeWhole;
+ table::CellRangeAddress maRangeTable;
+ table::CellRangeAddress maRangeResult;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xgoalseek.hxx b/include/test/sheet/xgoalseek.hxx
new file mode 100644
index 000000000000..71fce12a356b
--- /dev/null
+++ b/include/test/sheet/xgoalseek.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/.
+ */
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XGoalSeek
+{
+public:
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ void testSeekGoal();
+
+protected:
+ virtual ~XGoalSeek() {}
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xnamedrange.hxx b/include/test/sheet/xnamedrange.hxx
new file mode 100644
index 000000000000..97a6afdf4926
--- /dev/null
+++ b/include/test/sheet/xnamedrange.hxx
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2011 Laurent Godard lgodard.libre@laposte.net (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/sheet/XNamedRange.hpp>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XNamedRange
+{
+public:
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ // XNamedRange
+ void testGetContent();
+ void testSetContent();
+ void testGetType();
+ void testSetType();
+ void testGetReferencePosition();
+ void testSetReferencePosition();
+protected:
+ ~XNamedRange() {}
+
+ virtual uno::Reference< sheet::XNamedRange> getNamedRange(const OUString&) = 0;
+
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xnamedranges.hxx b/include/test/sheet/xnamedranges.hxx
new file mode 100644
index 000000000000..d0d2eeedb66f
--- /dev/null
+++ b/include/test/sheet/xnamedranges.hxx
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2011 Laurent Godard lgodard.libre@laposte.net (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/sheet/XSpreadsheet.hpp>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XNamedRanges
+{
+public:
+ // remove default entry
+ XNamedRanges();
+ // removes given entry
+ XNamedRanges(const OUString& rNameToRemove);
+
+ virtual ~XNamedRanges();
+
+ virtual uno::Reference< uno::XInterface > init(sal_Int32 nSheets = 0) = 0;
+
+ // XNamedRanges
+ void testAddNewByName();
+ void testAddNewFromTitles();
+ void testRemoveByName();
+ void testOutputList();
+
+protected:
+ uno::Reference< sheet::XSpreadsheet > xSheet;
+
+private:
+ OUString maNameToRemove;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xprintareas.hxx b/include/test/sheet/xprintareas.hxx
new file mode 100644
index 000000000000..08f534877690
--- /dev/null
+++ b/include/test/sheet/xprintareas.hxx
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Artur Dorda <artur.dorda+libo@gmail.com> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+ #include <com/sun/star/sheet/XPrintAreas.hpp>
+ #include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XPrintAreas
+{
+public:
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ void testSetAndGetPrintTitleColumns(); //getter and setter in one test case
+ void testSetAndGetPrintTitleRows();
+
+ void testGetPrintAreas(); // returns a sequence containing all print areas of the sheet.
+ void testSetPrintAreas(); // sets the print areas of the sheet.
+ void testGetTitleColumns(); // returns the range that is specified as title columns range.
+ void testSetTitleColumns(); // specifies a range of columns as title columns range.
+ void testGetTitleRows(); // returns the range that is specified as title rows range.
+ void testSetTitleRows(); // specifies a range of rows as title rows range.
+
+protected:
+ ~XPrintAreas() {}
+
+
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xsheetannotation.hxx b/include/test/sheet/xsheetannotation.hxx
new file mode 100644
index 000000000000..9dd552d2803d
--- /dev/null
+++ b/include/test/sheet/xsheetannotation.hxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2013 Laurent Godard lgodard.libre@laposte.net (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/sheet/XSheetAnnotation.hpp>
+#include <test/testdllapi.hxx>
+
+#include <com/sun/star/table/CellAddress.hpp>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XSheetAnnotation
+{
+public:
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ // XSheetAnnotation
+ void testGetPosition();
+ void testGetAuthor();
+ void testGetDate();
+ void testGetIsVisible();
+ void testSetIsVisible();
+
+protected:
+ ~XSheetAnnotation() {}
+
+ virtual uno::Reference< sheet::XSheetAnnotation> getAnnotation(table::CellAddress&) = 0;
+
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xsheetannotations.hxx b/include/test/sheet/xsheetannotations.hxx
new file mode 100644
index 000000000000..9c1c2111008c
--- /dev/null
+++ b/include/test/sheet/xsheetannotations.hxx
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2013 Laurent Godard lgodard.libre@laposte.net (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/sheet/XSheetAnnotations.hpp>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XSheetAnnotations
+{
+public:
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ // XSheetAnnotations
+ void testInsertNew();
+ void testRemoveByIndex();
+
+
+protected:
+ ~XSheetAnnotations() {}
+
+ virtual uno::Reference< sheet::XSheetAnnotations> getAnnotations() = 0;
+
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xsheetoutline.hxx b/include/test/sheet/xsheetoutline.hxx
new file mode 100644
index 000000000000..b52ac0eeb7aa
--- /dev/null
+++ b/include/test/sheet/xsheetoutline.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2013 Laurent Godard lgodard.libre@laposte.net (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/sheet/XSheetOutline.hpp>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XSheetOutline
+{
+public:
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ // XSheetOutline
+ void testHideDetail();
+ void testShowDetail();
+ void testShowLevel();
+ void testUngroup();
+ void testGroup();
+ void testAutoOutline();
+ void testClearOutline();
+
+protected:
+ ~XSheetOutline() {}
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xspreadsheetdocument.hxx b/include/test/sheet/xspreadsheetdocument.hxx
new file mode 100644
index 000000000000..edeef9c4891c
--- /dev/null
+++ b/include/test/sheet/xspreadsheetdocument.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/.
+ */
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class XSpreadsheetDocument
+{
+public:
+ XSpreadsheetDocument(sal_Int32 nSheets) : mnSheets(nSheets) {}
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ void testGetSheets();
+
+protected:
+ ~XSpreadsheetDocument() {}
+
+private:
+ sal_Int32 mnSheets;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xspreadsheets2.hxx b/include/test/sheet/xspreadsheets2.hxx
new file mode 100644
index 000000000000..83b9eddd15e7
--- /dev/null
+++ b/include/test/sheet/xspreadsheets2.hxx
@@ -0,0 +1,84 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2011 Laurent Godard lgodard.libre@laposte.net (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "test/testdllapi.hxx"
+
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+#include <com/sun/star/sheet/XSpreadsheet.hpp>
+#include <com/sun/star/sheet/XNamedRanges.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+
+#include <rtl/ustring.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XSpreadsheets2
+{
+public:
+ XSpreadsheets2();
+ virtual ~XSpreadsheets2();
+
+ // XSpreadsheets2
+ void testImportedSheetNameAndIndex();
+ void testImportString();
+ void testImportValue();
+ void testImportFormulaBasicMath();
+ void testImportFormulaWithNamedRange();
+ void testImportOverExistingNamedRange();
+ void testImportNamedRangeDefinedInSource();
+ void testImportNamedRangeRedefinedInSource();
+ void testImportNewNamedRange();
+ void testImportCellStyle();
+
+ virtual uno::Reference< lang::XComponent > getComponent() = 0;
+ virtual uno::Reference< uno::XInterface > init() = 0;
+ virtual uno::Reference< lang::XComponent > loadFromDesktop(const OUString&) = 0;
+ virtual void createFileURL(const OUString&, OUString&) = 0;
+
+protected:
+ uno::Reference< sheet::XSpreadsheetDocument> xDocument;
+
+private:
+ uno::Reference< sheet::XSpreadsheetDocument> getDoc(const OUString&, uno::Reference< lang::XComponent >&);
+ uno::Reference< sheet::XNamedRanges> getNamedRanges(uno::Reference< sheet::XSpreadsheetDocument >);
+ void importSheetToCopy();
+ bool isExternalReference(const OUString& aDestContent, const OUString& aSrcContent );
+
+ uno::Reference< sheet::XSpreadsheetDocument> xDestDoc;
+ uno::Reference< sheet::XSpreadsheet > xDestSheet;
+ uno::Reference< sheet::XSpreadsheet > xSrcSheet;
+ OUString aSrcSheetName;
+ OUString aSrcFileName;
+ OUString aDestFileBase;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/testdllapi.hxx b/include/test/testdllapi.hxx
new file mode 100644
index 000000000000..83f49645bb84
--- /dev/null
+++ b/include/test/testdllapi.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_TEST_DETAIL_TESTDLLAPI_HXX
+#define INCLUDED_TEST_DETAIL_TESTDLLAPI_HXX
+
+#include "sal/config.h"
+#include "sal/types.h"
+
+#if defined OOO_DLLIMPLEMENTATION_TEST
+#define OOO_DLLPUBLIC_TEST SAL_DLLPUBLIC_EXPORT
+#else
+#define OOO_DLLPUBLIC_TEST SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/text/xtext.hxx b/include/test/text/xtext.hxx
new file mode 100644
index 000000000000..2afee6cdcaec
--- /dev/null
+++ b/include/test/text/xtext.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:
+ *
+ */
+
+#ifndef __TEST_TEXT_XTEXT_HXX__
+#define __TEST_TEXT_XTEXT_HXX__
+
+#include "test/testdllapi.hxx"
+
+#include <com/sun/star/text/XText.hpp>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XText
+{
+public:
+ virtual ~XText();
+
+ virtual uno::Reference<uno::XInterface> init() = 0;
+ virtual uno::Reference<text::XTextContent> getTextContent() = 0;
+
+ void testInsertRemoveTextContent();
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/text/xtextcontent.hxx b/include/test/text/xtextcontent.hxx
new file mode 100644
index 000000000000..80549b09655c
--- /dev/null
+++ b/include/test/text/xtextcontent.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/.
+ */
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/text/XTextRange.hpp>
+#include <com/sun/star/text/XTextContent.hpp>
+
+#include "test/testdllapi.hxx"
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XTextContent
+{
+public:
+ virtual ~XTextContent() {}
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+ virtual uno::Reference< text::XTextRange > getTextRange() = 0;
+ virtual uno::Reference< text::XTextContent > getTextContent() = 0;
+ virtual bool isAttachSupported() = 0;
+
+ void testGetAnchor();
+ void testAttach();
+
+
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/text/xtextfield.hxx b/include/test/text/xtextfield.hxx
new file mode 100644
index 000000000000..508a622724cf
--- /dev/null
+++ b/include/test/text/xtextfield.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/.
+ */
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include "test/testdllapi.hxx"
+
+using namespace com::sun::star;
+
+namespace apitest
+{
+
+class OOO_DLLPUBLIC_TEST XTextField
+{
+public:
+ virtual ~XTextField() {}
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ void testGetPresentation();
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
new file mode 100644
index 000000000000..171e47aa785d
--- /dev/null
+++ b/include/test/unoapi_test.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/.
+ */
+
+#include <sal/config.h>
+#include <test/bootstrapfixture.hxx>
+#include <unotest/macros_test.hxx>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <rtl/ustrbuf.hxx>
+#include <osl/file.hxx>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+// basic uno api test class
+
+class OOO_DLLPUBLIC_TEST UnoApiTest : public test::BootstrapFixture, public unotest::MacrosTest
+{
+public:
+ UnoApiTest(const OUString& path);
+
+ void createFileURL(const OUString& aFileBase, OUString& rFilePath);
+
+ virtual void setUp();
+ virtual void tearDown();
+
+protected:
+ void closeDocument( uno::Reference< lang::XComponent > xDocument );
+
+
+private:
+ uno::Reference<uno::XInterface> m_xCalcComponent;
+ OUString m_aBaseString;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/util/xreplaceable.hxx b/include/test/util/xreplaceable.hxx
new file mode 100644
index 000000000000..34b56b24514c
--- /dev/null
+++ b/include/test/util/xreplaceable.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/.
+ */
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XReplaceable
+{
+public:
+ XReplaceable( const OUString& rSearchString, const OUString& rReplaceString):
+ maSearchString(rSearchString), maReplaceString(rReplaceString) {}
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ void testCreateReplaceDescriptor();
+ void testReplaceAll();
+
+protected:
+ ~XReplaceable() {}
+
+private:
+ OUString maSearchString;
+ OUString maReplaceString;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/util/xsearchable.hxx b/include/test/util/xsearchable.hxx
new file mode 100644
index 000000000000..975ebb2a4a79
--- /dev/null
+++ b/include/test/util/xsearchable.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/.
+ */
+
+#include <rtl/ustring.hxx>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XSearchable
+{
+public:
+ XSearchable(const OUString& rString, sal_Int32 nCount) : maSearchString(rString), mnCount(nCount) {}
+ XSearchable() : maSearchString(RTL_CONSTASCII_USTRINGPARAM("SearchString")), mnCount(1) {}
+ virtual ~XSearchable();
+
+ void testFindFirst();
+ void testFindNext();
+ void testFindAll();
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+private:
+ OUString maSearchString;
+ sal_Int32 mnCount;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/xmldiff.hxx b/include/test/xmldiff.hxx
new file mode 100644
index 000000000000..93d09f2e85f4
--- /dev/null
+++ b/include/test/xmldiff.hxx
@@ -0,0 +1,16 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <test/testdllapi.hxx>
+
+bool OOO_DLLPUBLIC_TEST
+doXMLDiff(const char* pFileName, const char* pContent, int size,
+ const char* pToleranceFileName);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/animatedimagespeer.hxx b/include/toolkit/awt/animatedimagespeer.hxx
new file mode 100644
index 000000000000..9e22d41a948b
--- /dev/null
+++ b/include/toolkit/awt/animatedimagespeer.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 TOOLKIT_ANIMATEDIMAGEPEER_HXX
+#define TOOLKIT_ANIMATEDIMAGEPEER_HXX
+
+#include "toolkit/awt/vclxwindow.hxx"
+
+#include <com/sun/star/awt/XAnimation.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+
+#include <cppuhelper/implbase3.hxx>
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/noncopyable.hpp>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= AnimatedImagesPeer
+ //==================================================================================================================
+ struct AnimatedImagesPeer_Data;
+ typedef ::cppu::ImplInheritanceHelper3 < VCLXWindow
+ , ::com::sun::star::awt::XAnimation
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::util::XModifyListener
+ > AnimatedImagesPeer_Base;
+
+ class AnimatedImagesPeer :public AnimatedImagesPeer_Base
+ ,public ::boost::noncopyable
+ {
+ public:
+ AnimatedImagesPeer();
+
+ protected:
+ ~AnimatedImagesPeer();
+
+ public:
+ // XAnimation
+ virtual void SAL_CALL startAnimation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL stopAnimation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isAnimationRunning( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // VclWindowPeer
+ virtual void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ protected:
+ void ProcessWindowEvent( const VclWindowEvent& i_windowEvent );
+
+ private:
+ /** updates our images with the ones from the givem XAnimatedImages component
+ */
+ void impl_updateImages_nolck( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_animatedImages );
+
+ private:
+ ::boost::scoped_ptr< AnimatedImagesPeer_Data > m_pData;
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_ANIMATEDIMAGEPEER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/scrollabledialog.hxx b/include/toolkit/awt/scrollabledialog.hxx
new file mode 100644
index 000000000000..29651938806f
--- /dev/null
+++ b/include/toolkit/awt/scrollabledialog.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 TOOLKIT_AWT_SCROLLABLEDIALOG_HXX
+#define TOOLKIT_AWT_SCROLLABLEDIALOG_HXX
+
+#include <vcl/dialog.hxx>
+#include <vcl/scrbar.hxx>
+
+//........................................................................
+namespace toolkit
+{
+ class ScrollableInterface
+ {
+ public:
+ virtual ~ScrollableInterface() {}
+ virtual void SetScrollWidth( long nWidth ) = 0;
+ virtual long GetScrollWidth() = 0;
+ virtual void SetScrollHeight( long nHeight ) = 0;
+ virtual long GetScrollHeight() = 0;
+ virtual void SetScrollLeft( long nLeft ) = 0;
+ virtual long GetScrollLeft() = 0;
+ virtual void SetScrollTop( long Top ) = 0;
+ virtual long GetScrollTop() = 0;
+ };
+
+ template < class T >
+ class ScrollableWrapper : public T, public ScrollableInterface
+ {
+ ScrollBar maHScrollBar;
+ ScrollBar maVScrollBar;
+ Size maScrollArea;
+ bool mbHasHoriBar;
+ bool mbHasVertBar;
+ Point mnScrollPos;
+ long mnScrWidth;
+
+ public:
+ enum ScrollBarVisibility { None, Vert, Hori, Both };
+ private:
+ ScrollBarVisibility maScrollVis;
+ void lcl_Scroll( long nX, long nY );
+ public:
+ ScrollableWrapper( Window* pParent, WinBits nStyle = WB_STDDIALOG );
+ virtual ~ScrollableWrapper();
+ virtual void SetScrollWidth( long nWidth );
+ virtual long GetScrollWidth() { return maScrollArea.Width(); }
+ virtual void SetScrollHeight( long nHeight );
+ virtual long GetScrollHeight() { return maScrollArea.Height(); }
+ virtual void SetScrollLeft( long nLeft );
+ virtual long GetScrollLeft() { return mnScrollPos.X(); }
+ virtual void SetScrollTop( long Top );
+ virtual long GetScrollTop() { return mnScrollPos.Y() ; }
+
+ void setScrollVisibility( ScrollBarVisibility rState );
+ DECL_LINK( ScrollBarHdl, ScrollBar* );
+ virtual void ResetScrollBars();
+ // Window
+ virtual void Resize();
+ };
+//........................................................................
+} // namespacetoolkit
+//........................................................................
+
+#endif // TOOLKIT_AWT_SCROLLABLEDIALOG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxaccessiblecomponent.hxx b/include/toolkit/awt/vclxaccessiblecomponent.hxx
new file mode 100644
index 000000000000..379dbb5b7c8a
--- /dev/null
+++ b/include/toolkit/awt/vclxaccessiblecomponent.hxx
@@ -0,0 +1,155 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_AWT_VCLXACCESSIBLECOMPONENT_HXX_
+#define _TOOLKIT_AWT_VCLXACCESSIBLECOMPONENT_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/compbase3.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/accimplaccess.hxx>
+#include <comphelper/accessiblecomponenthelper.hxx>
+
+#include <tools/link.hxx>
+
+class Window;
+class VCLXWindow;
+class VclSimpleEvent;
+class VclWindowEvent;
+
+namespace utl {
+class AccessibleRelationSetHelper;
+class AccessibleStateSetHelper;
+}
+
+
+// ----------------------------------------------------
+// class VCLXAccessibleComponent
+// ----------------------------------------------------
+
+typedef ::comphelper::OAccessibleExtendedComponentHelper AccessibleExtendedComponentHelper_BASE;
+
+typedef ::cppu::ImplHelper1<
+ ::com::sun::star::lang::XServiceInfo > VCLXAccessibleComponent_BASE;
+
+class VCLExternalSolarLock;
+
+class TOOLKIT_DLLPUBLIC VCLXAccessibleComponent
+ :public AccessibleExtendedComponentHelper_BASE
+ ,public ::comphelper::OAccessibleImplementationAccess
+ ,public VCLXAccessibleComponent_BASE
+{
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> mxWindow;
+ VCLXWindow* mpVCLXindow;
+
+ VCLExternalSolarLock* m_pSolarLock;
+
+protected:
+ DECL_LINK( WindowEventListener, VclSimpleEvent* );
+ DECL_LINK( WindowChildEventListener, VclSimpleEvent* );
+
+ virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+ virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent );
+ virtual void FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet );
+ virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetChildAccessible( const VclWindowEvent& rVclWindowEvent );
+
+public:
+ VCLXAccessibleComponent( VCLXWindow* pVCLXindow );
+ ~VCLXAccessibleComponent();
+
+ VCLXWindow* GetVCLXWindow() const { return mpVCLXindow; }
+ Window* GetWindow() const;
+
+ virtual void SAL_CALL disposing();
+
+ // ::com::sun::star::uno::XInterface
+ DECLARE_XINTERFACE()
+ // ::com::sun::star::lang::XTypeProvider
+ DECLARE_XTYPEPROVIDER()
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::accessibility::XAccessibleContext
+ sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::accessibility::XAccessibleComponent
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ // base class overridables
+ ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ /** we may be reparented (if external components use OAccessibleImplementationAccess base class),
+ so this method here returns the parent in the VCL world, in opposite to the parent
+ an external component gave us
+ @precond
+ the caller must ensure thread safety, i.e. our mutex must be locked
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getVclParent() const;
+};
+
+/* ----------------------------------------------------------
+ Accessibility only for the Window hierarchy!
+ Maybe derived classes must overwrite these Accessibility interfaces:
+
+ // XAccessibleContext:
+ sal_Int16 getAccessibleRole() => VCL Window::GetAccessibleRole()
+ OUString getAccessibleDescription() => VCL Window::GetAccessibleDescription
+ OUString getAccessibleName() => VCL Window::GetAccessibleText() => Most windows return Window::GetText()
+ Reference< XAccessibleRelationSet > getAccessibleRelationSet()
+ Reference< XAccessibleStateSet > getAccessibleStateSet() => overload FillAccessibleStateSet( ... )
+
+---------------------------------------------------------- */
+
+
+#endif // _TOOLKIT_AWT_VCLXACCESSIBLECOMPONENT_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxbitmap.hxx b/include/toolkit/awt/vclxbitmap.hxx
new file mode 100644
index 000000000000..a8893040392d
--- /dev/null
+++ b/include/toolkit/awt/vclxbitmap.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 _TOOLKIT_AWT_VCLXBITMAP_HXX_
+#define _TOOLKIT_AWT_VCLXBITMAP_HXX_
+
+#include <com/sun/star/awt/XBitmap.hpp>
+#include <com/sun/star/awt/XDisplayBitmap.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/weak.hxx>
+#include <osl/mutex.hxx>
+#include <vcl/bitmapex.hxx>
+
+
+// ----------------------------------------------------
+// class VCLXBitmap
+// ----------------------------------------------------
+
+class VCLXBitmap : public ::com::sun::star::awt::XBitmap,
+ public ::com::sun::star::awt::XDisplayBitmap,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::com::sun::star::lang::XUnoTunnel,
+ public ::cppu::OWeakObject
+{
+private:
+ ::osl::Mutex maMutex;
+ BitmapEx maBitmap;
+
+protected:
+ ::osl::Mutex& GetMutex() { return maMutex; }
+
+
+public:
+ void SetBitmap( const BitmapEx& rBmp ) { maBitmap = rBmp; }
+ const BitmapEx& GetBitmap() const { return maBitmap; }
+
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XUnoTunnel
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
+ static VCLXBitmap* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
+ sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XBitmap
+ ::com::sun::star::awt::Size SAL_CALL getSize() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getDIB() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getMaskDIB() throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+
+
+#endif // _TOOLKIT_AWT_VCLXBITMAP_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxcontainer.hxx b/include/toolkit/awt/vclxcontainer.hxx
new file mode 100644
index 000000000000..0b4b0be97127
--- /dev/null
+++ b/include/toolkit/awt/vclxcontainer.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 _TOOLKIT_AWT_VCLXCONTAINER_HXX_
+#define _TOOLKIT_AWT_VCLXCONTAINER_HXX_
+
+
+#include <com/sun/star/awt/XVclContainer.hpp>
+#include <com/sun/star/awt/XVclContainerPeer.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <cppuhelper/weak.hxx>
+#include <osl/mutex.hxx>
+
+#include <toolkit/awt/vclxwindow.hxx>
+
+
+// ----------------------------------------------------
+// class VCLXContainer
+// ----------------------------------------------------
+
+class TOOLKIT_DLLPUBLIC VCLXContainer : public ::com::sun::star::awt::XVclContainer,
+ public ::com::sun::star::awt::XVclContainerPeer,
+ public VCLXWindow
+{
+public:
+ VCLXContainer();
+ ~VCLXContainer();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XVclContainer
+ void SAL_CALL addVclContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclContainerListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeVclContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclContainerListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > > SAL_CALL getWindows( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XVclContainerPeer
+ void SAL_CALL enableDialogControl( sal_Bool bEnable ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setTabOrder( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > >& WindowOrder, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Tabs, sal_Bool GroupControl ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setGroup( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > >& Windows ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XVclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+
+
+
+#endif // _TOOLKIT_AWT_VCLXCONTAINER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxdevice.hxx b/include/toolkit/awt/vclxdevice.hxx
new file mode 100644
index 000000000000..eb48f97d9ba6
--- /dev/null
+++ b/include/toolkit/awt/vclxdevice.hxx
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_AWT_VCLXDEVICE_HXX_
+#define _TOOLKIT_AWT_VCLXDEVICE_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/awt/XDevice.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/weak.hxx>
+#include <osl/mutex.hxx>
+
+#include <com/sun/star/awt/XUnitConversion.hpp>
+
+class OutputDevice;
+class VirtualDevice;
+
+// ----------------------------------------------------
+// class VCLXDevice
+// ----------------------------------------------------
+
+// For using nDummy, no incompatible update, add a sal_Bool bCreatedWithToolkitMember later...
+#define FLAGS_CREATEDWITHTOOLKIT 0x00000001
+
+class TOOLKIT_DLLPUBLIC VCLXDevice : public ::com::sun::star::awt::XDevice,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::com::sun::star::lang::XUnoTunnel,
+ public ::com::sun::star::awt::XUnitConversion,
+ public ::cppu::OWeakObject
+{
+ friend class VCLXGraphics;
+
+private:
+ OutputDevice* mpOutputDevice;
+
+public:
+ void* pDummy;
+ sal_uInt32 nFlags;
+
+protected:
+ void DestroyOutputDevice();
+
+public:
+ VCLXDevice();
+ ~VCLXDevice();
+
+ void SetOutputDevice( OutputDevice* pOutDev ) { mpOutputDevice = pOutDev; }
+ OutputDevice* GetOutputDevice() const { return mpOutputDevice; }
+
+ void SetCreatedWithToolkit( sal_Bool bCreatedWithToolkit );
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XUnoTunnel
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
+ static VCLXDevice* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
+ sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDevice,
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > SAL_CALL createGraphics( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createDevice( sal_Int32 nWidth, sal_Int32 nHeight ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::awt::FontDescriptor > SAL_CALL getFontDescriptors( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( const ::com::sun::star::awt::FontDescriptor& aDescriptor ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap > SAL_CALL createBitmap( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayBitmap > SAL_CALL createDisplayBitmap( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap >& Bitmap ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XUnitConversion
+ ::com::sun::star::awt::Point SAL_CALL convertPointToLogic( const ::com::sun::star::awt::Point& aPoint, ::sal_Int16 TargetUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Point SAL_CALL convertPointToPixel( const ::com::sun::star::awt::Point& aPoint, ::sal_Int16 SourceUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL convertSizeToLogic( const ::com::sun::star::awt::Size& aSize, ::sal_Int16 TargetUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL convertSizeToPixel( const ::com::sun::star::awt::Size& aSize, ::sal_Int16 SourceUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+
+};
+
+// ----------------------------------------------------
+// class VCLXVirtualDevice
+// ----------------------------------------------------
+
+class VCLXVirtualDevice : public VCLXDevice
+{
+public:
+ ~VCLXVirtualDevice();
+
+ void SetVirtualDevice( VirtualDevice* pVDev ) { SetOutputDevice( (OutputDevice*)pVDev ); }
+};
+
+
+
+
+#endif // _TOOLKIT_AWT_VCLXDEVICE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxfont.hxx b/include/toolkit/awt/vclxfont.hxx
new file mode 100644
index 000000000000..bb385f223ef6
--- /dev/null
+++ b/include/toolkit/awt/vclxfont.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 _TOOLKIT_AWT_VCLXFONT_HXX_
+#define _TOOLKIT_AWT_VCLXFONT_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/awt/XFont2.hpp>
+#include <com/sun/star/awt/XDevice.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/weak.hxx>
+#include <osl/mutex.hxx>
+#include <vcl/metric.hxx>
+
+// ----------------------------------------------------
+// class VCLXFont
+// ----------------------------------------------------
+
+class TOOLKIT_DLLPUBLIC VCLXFont : public ::com::sun::star::awt::XFont2,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::com::sun::star::lang::XUnoTunnel,
+ public ::cppu::OWeakObject
+{
+private:
+ ::osl::Mutex maMutex;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice> mxDevice;
+ Font maFont;
+ FontMetric* mpFontMetric;
+
+protected:
+ sal_Bool ImplAssertValidFontMetric();
+ ::osl::Mutex& GetMutex() { return maMutex; }
+
+public:
+ VCLXFont();
+ ~VCLXFont();
+
+ void Init( ::com::sun::star::awt::XDevice& rxDev, const Font& rFont );
+ const Font& GetFont() const { return maFont; }
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XUnoTunnel
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
+ static VCLXFont* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
+ sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XFont
+ ::com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptor( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::SimpleFontMetric SAL_CALL getFontMetric( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getCharWidth( sal_Unicode c ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getCharWidths( sal_Unicode nFirst, sal_Unicode nLast ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getStringWidth( const OUString& str ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getStringWidthArray( const OUString& str, ::com::sun::star::uno::Sequence< sal_Int32 >& rDXArray ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL getKernPairs( ::com::sun::star::uno::Sequence< sal_Unicode >& rnChars1, ::com::sun::star::uno::Sequence< sal_Unicode >& rnChars2, ::com::sun::star::uno::Sequence< sal_Int16 >& rnKerns ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XFont2
+ sal_Bool SAL_CALL hasGlyphs( const OUString& aText ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+
+#endif // _TOOLKIT_AWT_VCLXFONT_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxgraphics.hxx b/include/toolkit/awt/vclxgraphics.hxx
new file mode 100644
index 000000000000..a99e19fcd940
--- /dev/null
+++ b/include/toolkit/awt/vclxgraphics.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 _TOOLKIT_AWT_VCLXGRAPHICS_HXX_
+#define _TOOLKIT_AWT_VCLXGRAPHICS_HXX_
+
+
+#include <com/sun/star/awt/XGraphics.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/weak.hxx>
+#include <osl/mutex.hxx>
+
+#include <vcl/font.hxx>
+#include <tools/color.hxx>
+#include <vcl/vclenum.hxx>
+
+class OutputDevice;
+class Region;
+
+
+#define INITOUTDEV_FONT 0x0001
+#define INITOUTDEV_COLORS 0x0002
+#define INITOUTDEV_RASTEROP 0x0004
+#define INITOUTDEV_CLIPREGION 0x0008
+#define INITOUTDEV_ALL 0xFFFF
+
+
+// ----------------------------------------------------
+// class VCLXGraphics
+// ----------------------------------------------------
+
+class VCLXGraphics : public ::com::sun::star::awt::XGraphics,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::com::sun::star::lang::XUnoTunnel,
+ public ::cppu::OWeakObject
+{
+private:
+ // used to return same reference on each call to getDevice()
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice> mxDevice;
+
+ OutputDevice* mpOutputDevice;
+ Font maFont;
+ Color maTextColor;
+ Color maTextFillColor;
+ Color maLineColor;
+ Color maFillColor;
+ RasterOp meRasterOp;
+ Region* mpClipRegion;
+
+public:
+ VCLXGraphics();
+ ~VCLXGraphics();
+
+ void Init( OutputDevice* pOutDev );
+ void InitOutputDevice( sal_uInt16 nFlags );
+
+ void SetOutputDevice( OutputDevice* pOutDev );
+ OutputDevice* GetOutputDevice() const { return mpOutputDevice; }
+
+ const Font& GetFont() const { return maFont; }
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XUnoTunnel
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
+ static VCLXGraphics* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
+ sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XGraphics
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL getDevice( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::SimpleFontMetric SAL_CALL getFontMetric() throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFont( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont >& xNewFont ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL selectFont( const ::com::sun::star::awt::FontDescriptor& aDescription ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setTextColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setTextFillColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLineColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFillColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setRasterOp( ::com::sun::star::awt::RasterOperation ROP ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setClipRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& Clipping ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL intersectClipRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& xClipping ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL push( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL pop( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL copy( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice >& xSource, sal_Int32 nSourceX, sal_Int32 nSourceY, sal_Int32 nSourceWidth, sal_Int32 nSourceHeight, sal_Int32 nDestX, sal_Int32 nDestY, sal_Int32 nDestWidth, sal_Int32 nDestHeight ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL draw( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayBitmap >& xBitmapHandle, sal_Int32 SourceX, sal_Int32 SourceY, sal_Int32 SourceWidth, sal_Int32 SourceHeight, sal_Int32 DestX, sal_Int32 DestY, sal_Int32 DestWidth, sal_Int32 DestHeight ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawPixel( sal_Int32 X, sal_Int32 Y ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawLine( sal_Int32 X1, sal_Int32 Y1, sal_Int32 X2, sal_Int32 Y2 ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawRect( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawRoundedRect( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int32 nHorzRound, sal_Int32 nVertRound ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawPolyLine( const ::com::sun::star::uno::Sequence< sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< sal_Int32 >& DataY ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawPolygon( const ::com::sun::star::uno::Sequence< sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< sal_Int32 >& DataY ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawPolyPolygon( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int32 > >& DataX, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int32 > >& DataY ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawEllipse( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawArc( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int32 X1, sal_Int32 Y1, sal_Int32 X2, sal_Int32 Y2 ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawPie( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int32 X1, sal_Int32 Y1, sal_Int32 X2, sal_Int32 Y2 ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawChord( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2 ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawGradient( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 Height, const ::com::sun::star::awt::Gradient& aGradient ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawText( sal_Int32 X, sal_Int32 Y, const OUString& Text ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL drawTextArray( sal_Int32 X, sal_Int32 Y, const OUString& Text, const ::com::sun::star::uno::Sequence< sal_Int32 >& Longs ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+
+
+#endif // _TOOLKIT_AWT_VCLXGRAPHICS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxmenu.hxx b/include/toolkit/awt/vclxmenu.hxx
new file mode 100644
index 000000000000..495e8982ba94
--- /dev/null
+++ b/include/toolkit/awt/vclxmenu.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 _TOOLKIT_AWT_VCLXMENU_HXX_
+#define _TOOLKIT_AWT_VCLXMENU_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/awt/XMenuBarExtended.hpp>
+#include <com/sun/star/awt/XPopupMenuExtended.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/weak.hxx>
+#include <osl/mutex.hxx>
+
+#include <tools/link.hxx>
+
+#include <toolkit/helper/listenermultiplexer.hxx>
+#include <vector>
+
+class Menu;
+class MenuBar;
+class VclSimpleEvent;
+class PopupMenu;
+
+typedef ::std::vector<
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >*
+> PopupMenuRefList;
+
+// ----------------------------------------------------
+// class VCLXMenu
+// ----------------------------------------------------
+
+class TOOLKIT_DLLPUBLIC VCLXMenu : public ::com::sun::star::awt::XMenuBarExtended,
+ public ::com::sun::star::awt::XPopupMenuExtended,
+ public ::com::sun::star::lang::XServiceInfo,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::com::sun::star::lang::XUnoTunnel,
+ public ::cppu::OWeakObject
+{
+private:
+ ::osl::Mutex maMutex;
+ Menu* mpMenu;
+ MenuListenerMultiplexer maMenuListeners;
+ PopupMenuRefList maPopupMenuRefs;
+
+protected:
+ ::osl::Mutex& GetMutex() { return maMutex; }
+
+ DECL_LINK( MenuEventListener, VclSimpleEvent* );
+
+ void ImplCreateMenu( sal_Bool bPopup );
+
+public:
+ VCLXMenu();
+ VCLXMenu( Menu* pMenu );
+ ~VCLXMenu();
+
+
+ Menu* GetMenu() const { return mpMenu; }
+ sal_Bool IsPopupMenu() const;
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XUnoTunnel
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
+ static VCLXMenu* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
+ sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XMenu
+ void SAL_CALL addMenuListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeMenuListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL insertItem( sal_Int16 nItemId, const OUString& aText, sal_Int16 nItemStyle, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItem( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getItemId( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getItemPos( sal_Int16 nId ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL enableItem( sal_Int16 nItemId, sal_Bool bEnable ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isItemEnabled( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setItemText( sal_Int16 nItemId, const OUString& aText ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getItemText( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setPopupMenu( sal_Int16 nItemId, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& aPopupMenu ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > SAL_CALL getPopupMenu( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XPopupMenu
+ void SAL_CALL insertSeparator( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDefaultItem( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getDefaultItem( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL checkItem( sal_Int16 nItemId, sal_Bool bCheck ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isItemChecked( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL execute( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent, const ::com::sun::star::awt::Rectangle& Area, sal_Int16 Direction ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XMenuBar
+
+ // ::com::sun::star::awt::XMenuExtended
+ virtual void SAL_CALL setCommand( sal_Int16 nItemId, const OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getCommand( sal_Int16 nItemId ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpCommand( sal_Int16 nItemId, const OUString& aHelp ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getHelpCommand( sal_Int16 nItemId ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ========================================================================
+ // ========================================================================
+ // ========================================================================
+
+ // XMenuExtended2 Methods
+ virtual ::sal_Bool SAL_CALL isPopupMenu( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL clear( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::MenuItemType SAL_CALL getItemType( ::sal_Int16 nItemPos ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL hideDisabledEntries( ::sal_Bool bHide ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XMenuBarExtended Methods
+
+ // XPopupMenuExtended Methods
+ virtual ::sal_Bool SAL_CALL isInExecute( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endExecute( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setLogo( const ::com::sun::star::awt::MenuLogo& aMenuLogo ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::MenuLogo SAL_CALL getLogo( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL enableAutoMnemonics( ::sal_Bool bEnable ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAcceleratorKeyEvent( ::sal_Int16 nItemId, const ::com::sun::star::awt::KeyEvent& aKeyEvent ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::KeyEvent SAL_CALL getAcceleratorKeyEvent( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpText( ::sal_Int16 nItemId, const OUString& sHelpText ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getHelpText( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTipHelpText( ::sal_Int16 nItemId, const OUString& sTipHelpText ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getTipHelpText( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setItemImage( ::sal_Int16 nItemId, const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& xGraphic, ::sal_Bool bScale ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > SAL_CALL getItemImage( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setItemImageAngle( ::sal_Int16 nItemId, ::sal_Int32 nAngle ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getItemImageAngle( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setItemImageMirrorMode( ::sal_Int16 nItemId, ::sal_Bool bMirror ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isItemImageInMirrorMode( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
+};
+
+// ----------------------------------------------------
+// class VCLXMenuBar
+// ----------------------------------------------------
+class TOOLKIT_DLLPUBLIC VCLXMenuBar : public VCLXMenu
+{
+public:
+ VCLXMenuBar();
+ VCLXMenuBar( MenuBar* pMenuBar );
+};
+
+// ----------------------------------------------------
+// class VCLXPopupMenu
+// ----------------------------------------------------
+class TOOLKIT_DLLPUBLIC VCLXPopupMenu : public VCLXMenu
+{
+public:
+ VCLXPopupMenu();
+ VCLXPopupMenu( PopupMenu* pPopMenu );
+};
+
+#endif // _TOOLKIT_AWT_VCLXMENU_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxpointer.hxx b/include/toolkit/awt/vclxpointer.hxx
new file mode 100644
index 000000000000..56e25bbdd4ce
--- /dev/null
+++ b/include/toolkit/awt/vclxpointer.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 _TOOLKIT_AWT_VCLXPOINTER_HXX_
+#define _TOOLKIT_AWT_VCLXPOINTER_HXX_
+
+
+#include <com/sun/star/awt/XPointer.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/weak.hxx>
+#include <osl/mutex.hxx>
+
+#include <vcl/pointr.hxx>
+
+// ----------------------------------------------------
+// class VCLXPointer
+// ----------------------------------------------------
+
+class VCLXPointer : public ::com::sun::star::awt::XPointer,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::com::sun::star::lang::XUnoTunnel,
+ public ::cppu::OWeakObject
+{
+private:
+ ::osl::Mutex maMutex;
+ Pointer maPointer;
+
+protected:
+ ::osl::Mutex& GetMutex() { return maMutex; }
+
+public:
+ VCLXPointer();
+ ~VCLXPointer();
+
+ const Pointer& GetPointer() const { return maPointer; }
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XUnoTunnel
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
+ static VCLXPointer* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
+ sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XPointer
+ void SAL_CALL setType( sal_Int32 nType ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getType( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+
+
+#endif // _TOOLKIT_AWT_VCLXPOINTER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxprinter.hxx b/include/toolkit/awt/vclxprinter.hxx
new file mode 100644
index 000000000000..ca14b2d35f67
--- /dev/null
+++ b/include/toolkit/awt/vclxprinter.hxx
@@ -0,0 +1,219 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_AWT_VCLXPRINTER_HXX_
+#define _TOOLKIT_AWT_VCLXPRINTER_HXX_
+
+
+#include <com/sun/star/awt/XPrinterPropertySet.hpp>
+#include <com/sun/star/awt/XPrinter.hpp>
+#include <com/sun/star/awt/XPrinterServer.hpp>
+#include <com/sun/star/awt/XInfoPrinter.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <cppuhelper/weak.hxx>
+#include <osl/mutex.hxx>
+
+#include <toolkit/helper/mutexandbroadcasthelper.hxx>
+#include <cppuhelper/propshlp.hxx>
+
+#include "vcl/oldprintadaptor.hxx"
+
+// relevant properties for the printer:
+/*
+ sal_Bool Horizontal
+ sal_uInt16 CopyCount;
+ sal_Bool Collate;
+ String FormDescriptor;
+ sal_uInt16 Orientation; // PORTRAIT, LANDSCAPE
+*/
+
+// ----------------------------------------------------
+// class VCLXPrinterPropertySet
+// ----------------------------------------------------
+
+class VCLXPrinterPropertySet : public ::com::sun::star::awt::XPrinterPropertySet,
+ public ::com::sun::star::lang::XTypeProvider,
+ public MutexAndBroadcastHelper,
+ public ::cppu::OPropertySetHelper
+{
+protected:
+ boost::shared_ptr<Printer> mpPrinter;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > mxPrnDevice;
+
+ sal_Int16 mnOrientation;
+ sal_Bool mbHorizontal;
+public:
+ VCLXPrinterPropertySet( const OUString& rPrinterName );
+ virtual ~VCLXPrinterPropertySet();
+
+ Printer* GetPrinter() const { return mpPrinter.get(); }
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > GetDevice();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setPropertyValue( const OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::setPropertyValue( rPropertyName, aValue ); }
+ ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return OPropertySetHelper::getPropertyValue( rPropertyName ); }
+ void SAL_CALL addPropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::addPropertyChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL removePropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::removePropertyChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL addVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::addVetoableChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL removeVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::removeVetoableChangeListener( rPropertyName, rxListener ); }
+
+ // ::cppu::OPropertySetHelper
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::lang::IllegalArgumentException);
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+ using cppu::OPropertySetHelper::getFastPropertyValue;
+ void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
+
+ // ::com::sun::star::awt::XPrinterPropertySet
+ void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL selectForm( const OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+};
+
+// ----------------------------------------------------
+// class VCLXPrinter
+// ----------------------------------------------------
+
+class VCLXPrinter: public ::com::sun::star::awt::XPrinter,
+ public VCLXPrinterPropertySet,
+ public ::cppu::OWeakObject
+{
+ boost::shared_ptr<vcl::OldStylePrintAdaptor> mpListener;
+ JobSetup maInitJobSetup;
+public:
+ VCLXPrinter( const OUString& rPrinterName );
+ ~VCLXPrinter();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+
+ // ::com::sun::star::beans::XPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertySetInfo(); }
+ void SAL_CALL setPropertyValue( const OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setPropertyValue( rPropertyName, aValue ); }
+ ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertyValue( rPropertyName ); }
+ void SAL_CALL addPropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addPropertyChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL removePropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removePropertyChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL addVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addVetoableChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL removeVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removeVetoableChangeListener( rPropertyName, rxListener ); }
+
+ // ::com::sun::star::awt::XPrinterPropertySet
+ void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setHorizontal( bHorizontal ); }
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getFormDescriptions(); }
+ void SAL_CALL selectForm( const OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::selectForm( aFormDescription ); }
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getBinarySetup(); }
+ void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setBinarySetup( data ); }
+
+ // ::com::sun::star::awt::XPrinter
+ sal_Bool SAL_CALL start( const OUString& nJobName, sal_Int16 nCopies, sal_Bool nCollate ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL end( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL terminate( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL startPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL endPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException);
+};
+
+// ----------------------------------------------------
+// class VCLXInfoPrinter
+// ----------------------------------------------------
+
+class VCLXInfoPrinter: public ::com::sun::star::awt::XInfoPrinter,
+ public VCLXPrinterPropertySet,
+ public ::cppu::OWeakObject
+{
+public:
+ VCLXInfoPrinter( const OUString& rPrinterName );
+ ~VCLXInfoPrinter();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+
+ // ::com::sun::star::beans::XPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertySetInfo(); }
+ void SAL_CALL setPropertyValue( const OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setPropertyValue( rPropertyName, aValue ); }
+ ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertyValue( rPropertyName ); }
+ void SAL_CALL addPropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addPropertyChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL removePropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removePropertyChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL addVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addVetoableChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL removeVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removeVetoableChangeListener( rPropertyName, rxListener ); }
+
+ // ::com::sun::star::awt::XPrinterPropertySet
+ void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setHorizontal( bHorizontal ); }
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getFormDescriptions(); }
+ void SAL_CALL selectForm( const OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::selectForm( aFormDescription ); }
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getBinarySetup(); }
+ void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setBinarySetup( data ); }
+
+ // ::com::sun::star::awt::XInfoPrinter
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createDevice( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+// ----------------------------------------------------
+// class VCLXPrinterServer
+// ----------------------------------------------------
+
+class VCLXPrinterServer : public ::com::sun::star::awt::XPrinterServer,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::cppu::OWeakObject
+{
+public:
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XPrinterServer
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > SAL_CALL createPrinter( const OUString& printerName ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > SAL_CALL createInfoPrinter( const OUString& printerName ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+
+
+#endif // _TOOLKIT_AWT_VCLXPRINTER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxregion.hxx b/include/toolkit/awt/vclxregion.hxx
new file mode 100644
index 000000000000..aa0710425422
--- /dev/null
+++ b/include/toolkit/awt/vclxregion.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 _TOOLKIT_AWT_VCLXREGION_HXX_
+#define _TOOLKIT_AWT_VCLXREGION_HXX_
+
+
+#include <com/sun/star/awt/XRegion.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/weak.hxx>
+#include <osl/mutex.hxx>
+
+#include <vcl/region.hxx>
+
+// ----------------------------------------------------
+// class VCLXRegion
+// ----------------------------------------------------
+
+class VCLXRegion : public ::com::sun::star::awt::XRegion,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::com::sun::star::lang::XUnoTunnel,
+ public ::cppu::OWeakObject
+{
+private:
+ ::osl::Mutex maMutex;
+ Region maRegion;
+
+protected:
+ ::osl::Mutex& GetMutex() { return maMutex; }
+
+public:
+ VCLXRegion();
+ ~VCLXRegion();
+
+ void SetRegion( const Region& rRegion ) { maRegion = rRegion; }
+ const Region& GetRegion() const { return maRegion; }
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XUnoTunnel
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
+ static VCLXRegion* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
+ sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XRegion
+ ::com::sun::star::awt::Rectangle SAL_CALL getBounds() throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL clear() throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL move( sal_Int32 nHorzMove, sal_Int32 nVertMove ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL unionRectangle( const ::com::sun::star::awt::Rectangle& rRect ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL intersectRectangle( const ::com::sun::star::awt::Rectangle& rRect ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL excludeRectangle( const ::com::sun::star::awt::Rectangle& rRect ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL xOrRectangle( const ::com::sun::star::awt::Rectangle& rRect ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL unionRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL intersectRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL excludeRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL xOrRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::awt::Rectangle > SAL_CALL getRectangles() throw(::com::sun::star::uno::RuntimeException);
+
+};
+
+
+
+#endif // _TOOLKIT_AWT_VCLXREGION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxspinbutton.hxx b/include/toolkit/awt/vclxspinbutton.hxx
new file mode 100644
index 000000000000..f1abf21f77f2
--- /dev/null
+++ b/include/toolkit/awt/vclxspinbutton.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 TOOLKIT_AWT_VCLXSPINBUTTON_HXX
+#define TOOLKIT_AWT_VCLXSPINBUTTON_HXX
+
+#include <toolkit/awt/vclxwindow.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/uno3.hxx>
+#include <com/sun/star/awt/XSpinValue.hpp>
+
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ //====================================================================
+ //= VCLXSpinButton
+ //====================================================================
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XSpinValue
+ > VCLXSpinButton_Base;
+
+ class VCLXSpinButton :public VCLXWindow
+ ,public VCLXSpinButton_Base
+ {
+ private:
+ AdjustmentListenerMultiplexer maAdjustmentListeners;
+
+ public:
+ VCLXSpinButton();
+
+ protected:
+ ~VCLXSpinButton( );
+
+ // XInterface
+ DECLARE_XINTERFACE()
+
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER()
+
+ // XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XSpinValue
+ virtual void SAL_CALL addAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setValue( sal_Int32 n ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setValues( sal_Int32 minValue, sal_Int32 maxValue, sal_Int32 currentValue ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getValue( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMinimum( sal_Int32 minValue ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMaximum( sal_Int32 maxValue ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getMinimum( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getMaximum( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setSpinIncrement( sal_Int32 spinIncrement ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSpinIncrement( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setOrientation( sal_Int32 orientation ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getOrientation( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // VclWindowPeer
+ virtual void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ // VCLXWindow
+ void ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent );
+
+ private:
+ VCLXSpinButton( const VCLXSpinButton& ); // never implemented
+ VCLXSpinButton& operator=( const VCLXSpinButton& ); // never implemented
+ };
+
+//........................................................................
+} // namespacetoolkit
+//........................................................................
+
+#endif // TOOLKIT_INC_TOOLKIT_AWT_VCLXSPINBUTTON_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxsystemdependentwindow.hxx b/include/toolkit/awt/vclxsystemdependentwindow.hxx
new file mode 100644
index 000000000000..ebb4d2408942
--- /dev/null
+++ b/include/toolkit/awt/vclxsystemdependentwindow.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 _TOOLKIT_AWT_VCLXSYSTEMDEPENDENTWINDOW_HXX_
+#define _TOOLKIT_AWT_VCLXSYSTEMDEPENDENTWINDOW_HXX_
+
+
+#include <com/sun/star/awt/XSystemDependentWindowPeer.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <cppuhelper/weak.hxx>
+#include <osl/mutex.hxx>
+
+#include <toolkit/awt/vclxwindow.hxx>
+
+// ----------------------------------------------------
+// class VCLXSystemDependendtWindow
+// ----------------------------------------------------
+
+class TOOLKIT_DLLPUBLIC VCLXSystemDependentWindow : public ::com::sun::star::awt::XSystemDependentWindowPeer,
+ public VCLXWindow
+{
+public:
+ VCLXSystemDependentWindow();
+ ~VCLXSystemDependentWindow();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XSystemDependendtWindowPeer
+ ::com::sun::star::uno::Any SAL_CALL getWindowHandle( const ::com::sun::star::uno::Sequence< sal_Int8 >& ProcessId, sal_Int16 SystemType ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+
+
+#endif // _TOOLKIT_AWT_VCLXSYSTEMDEPENDENTWINDOW_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxtabpagecontainer.hxx b/include/toolkit/awt/vclxtabpagecontainer.hxx
new file mode 100644
index 000000000000..af55ed3d6ab4
--- /dev/null
+++ b/include/toolkit/awt/vclxtabpagecontainer.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_AWT_VCLXTABPAGECONTAINER_HXX_
+#define _TOOLKIT_AWT_VCLXTABPAGECONTAINER_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/PropertyState.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include "toolkit/awt/vclxwindow.hxx"
+#include <com/sun/star/awt/tab/XTabPageContainer.hpp>
+#include <toolkit/helper/listenermultiplexer.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <toolkit/awt/vclxcontainer.hxx>
+
+// ----------------------------------------------------
+typedef ::cppu::ImplInheritanceHelper2 < VCLXContainer
+ , ::com::sun::star::awt::tab::XTabPageContainer
+ , ::com::sun::star::container::XContainerListener
+ > VCLXTabPageContainer_Base;
+class VCLXTabPageContainer : public VCLXTabPageContainer_Base
+{
+public:
+ VCLXTabPageContainer();
+ ~VCLXTabPageContainer();
+
+ // ::com::sun::star::awt::XView
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDevice,
+ ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::grid::XTabPageContainer
+ virtual ::sal_Int16 SAL_CALL getActiveTabPageID() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getTabPageCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isTabPageActive( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPage( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPageByID( ::sal_Int16 tabPageID ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addTabPageContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeTabPageContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XVclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+protected:
+ virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+private:
+ TabPageListenerMultiplexer m_aTabPageListeners;
+ ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > > m_aTabPages;
+};
+#endif // _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxtabpagemodel.hxx b/include/toolkit/awt/vclxtabpagemodel.hxx
new file mode 100644
index 000000000000..091c5592a765
--- /dev/null
+++ b/include/toolkit/awt/vclxtabpagemodel.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 _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
+#define _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/PropertyState.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include "toolkit/awt/vclxwindow.hxx"
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/awt/tab/XTabPage.hpp>
+#include <cppuhelper/implbase1.hxx>
+// ----------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel,
+ ::com::sun::star::awt::tab::XTabPageModel
+ > VCLXTabPageModel_Base;
+class VCLXTabPageModel : public VCLXTabPageModel_Base
+{
+public:
+ VCLXTabPageModel();
+ VCLXTabPageModel( const VCLXTabPageModel& rModel ) : VCLXTabPageModel_Base( rModel ) {;}
+ ~VCLXTabPageModel();
+
+ // ::com::sun::star::awt::XView
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDevice,
+ ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
+
+ UnoControlModel* Clone() const { return new VCLXTabPageModel( *this ); }
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::awt::XVclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::tab::XTabPageModel
+ virtual ::sal_Int16 SAL_CALL getTabPageID() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getEnabled() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTitle( const OUString& _title ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setImageURL( const OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getToolTip() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setToolTip( const OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException);
+protected:
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+};
+#endif // _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxtoolkit.hxx b/include/toolkit/awt/vclxtoolkit.hxx
new file mode 100644
index 000000000000..00045968ac27
--- /dev/null
+++ b/include/toolkit/awt/vclxtoolkit.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 _TOOLKIT_AWT_VCLXTOOLKIT_HXX_
+#define _TOOLKIT_AWT_VCLXTOOLKIT_HXX_
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/awt/XToolkitExperimental.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/awt/XMessageBoxFactory.hpp>
+#include <cppuhelper/compbase2.hxx>
+#include "cppuhelper/interfacecontainer.hxx"
+#include <osl/mutex.hxx>
+#include <osl/module.h>
+#include <tools/link.hxx>
+#include <tools/wintypes.hxx>
+
+#include <toolkit/dllapi.h>
+
+TOOLKIT_DLLPUBLIC WinBits ImplGetWinBits( sal_uInt32 nComponentAttribs, sal_uInt16 nCompType );
+
+class Window;
+class VCLXWindow;
+class VclSimpleEvent;
+
+namespace com {
+namespace sun {
+namespace star {
+namespace lang {
+ struct EventObject;
+}
+namespace awt {
+ struct WindowDescriptor;
+} } } }
+
+extern "C" {
+ typedef Window* (SAL_CALL *FN_SvtCreateWindow)( VCLXWindow** ppNewComp, const ::com::sun::star::awt::WindowDescriptor* pDescriptor, Window* pParent, WinBits nWinBits );
+}
+
+
+// ----------------------------------------------------
+// class VCLXTOOLKIT
+// ----------------------------------------------------
+
+class VCLXToolkit_Impl
+{
+protected:
+ ::osl::Mutex maMutex;
+};
+
+class VCLXToolkit : public VCLXToolkit_Impl,
+ public cppu::WeakComponentImplHelper2<
+ ::com::sun::star::awt::XToolkitExperimental,
+ ::com::sun::star::lang::XServiceInfo >
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard;
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxSelection;
+
+ oslModule hSvToolsLib;
+ FN_SvtCreateWindow fnSvtCreateWindow;
+
+ ::cppu::OInterfaceContainerHelper m_aTopWindowListeners;
+ ::cppu::OInterfaceContainerHelper m_aKeyHandlers;
+ ::cppu::OInterfaceContainerHelper m_aFocusListeners;
+ ::Link m_aEventListenerLink;
+ ::Link m_aKeyListenerLink;
+ bool m_bEventListener;
+ bool m_bKeyListener;
+
+ DECL_LINK(eventListenerHandler, ::VclSimpleEvent const *);
+
+ DECL_LINK(keyListenerHandler, ::VclSimpleEvent const *);
+
+ void callTopWindowListeners(
+ ::VclSimpleEvent const * pEvent,
+ void (SAL_CALL ::com::sun::star::awt::XTopWindowListener::* pFn)(
+ ::com::sun::star::lang::EventObject const &));
+
+ long callKeyHandlers(::VclSimpleEvent const * pEvent, bool bPressed);
+
+ void callFocusListeners(::VclSimpleEvent const * pEvent, bool bGained);
+
+protected:
+ ::osl::Mutex& GetMutex() { return maMutex; }
+
+ virtual void SAL_CALL disposing();
+
+ Window* ImplCreateWindow( VCLXWindow** ppNewComp, const ::com::sun::star::awt::WindowDescriptor& rDescriptor, Window* pParent, WinBits nWinBits );
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > ImplCreateWindow( const ::com::sun::star::awt::WindowDescriptor& Descriptor, WinBits nWinBits );
+
+public:
+
+ VCLXToolkit();
+ ~VCLXToolkit();
+
+ // ::com::sun::star::awt::XToolkitExperimental
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createScreenCompatibleDeviceUsingBuffer( sal_Int32 Width, sal_Int32 Height, sal_Int32 ScaleNumerator, sal_Int32 ScaleDenominator, sal_Int32 XOffset, sal_Int32 YOffset, sal_Int64 AddressOfMemoryBufferForSharedArrayWrapper ) throw
+(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XToolkit
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL getDesktopWindow( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Rectangle SAL_CALL getWorkArea( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL createWindow( const ::com::sun::star::awt::WindowDescriptor& Descriptor ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > > SAL_CALL createWindows( const ::com::sun::star::uno::Sequence< ::com::sun::star::awt::WindowDescriptor >& Descriptors ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createScreenCompatibleDevice( sal_Int32 Width, sal_Int32 Height ) throw
+(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion > SAL_CALL createRegion( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XSystemChildFactory
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL createSystemChild( const ::com::sun::star::uno::Any& Parent, const ::com::sun::star::uno::Sequence< sal_Int8 >& ProcessId, sal_Int16 SystemType ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XMessageBoxFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMessageBox > SAL_CALL createMessageBox( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& aParent, const ::com::sun::star::awt::Rectangle& aPosSize, const OUString& aType, ::sal_Int32 aButtons, const OUString& aTitle, const OUString& aMessage ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDataTransfer
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > SAL_CALL getDragGestureRecognizer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& window ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > SAL_CALL getDragSource( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& window ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > SAL_CALL getDropTarget( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& window ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > SAL_CALL getClipboard( const OUString& clipboardName ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XExtendedToolkit:
+
+ virtual ::sal_Int32 SAL_CALL getTopWindowCount()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindow >
+ SAL_CALL getTopWindow(::sal_Int32 nIndex)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindow >
+ SAL_CALL getActiveTopWindow()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addTopWindowListener(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::awt::XTopWindowListener > const & rListener)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeTopWindowListener(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::awt::XTopWindowListener > const & rListener)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addKeyHandler(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::awt::XKeyHandler > const & rHandler)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeKeyHandler(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::awt::XKeyHandler > const & rHandler)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addFocusListener(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::awt::XFocusListener > const & rListener)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeFocusListener(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::awt::XFocusListener > const & rListener)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL fireFocusGained(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > const & source)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL fireFocusLost(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > const & source)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XReschedule:
+ virtual void SAL_CALL reschedule()
+ throw (::com::sun::star::uno::RuntimeException);
+
+
+};
+
+#endif // _TOOLKIT_AWT_VCLXTOOLKIT_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxtopwindow.hxx b/include/toolkit/awt/vclxtopwindow.hxx
new file mode 100644
index 000000000000..95a742572b94
--- /dev/null
+++ b/include/toolkit/awt/vclxtopwindow.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 _TOOLKIT_AWT_VCLXTOPWINDOW_HXX_
+#define _TOOLKIT_AWT_VCLXTOPWINDOW_HXX_
+
+#include <com/sun/star/awt/XSystemDependentWindowPeer.hpp>
+#include <com/sun/star/awt/XTopWindow2.hpp>
+#include <com/sun/star/awt/XMenuBar.hpp>
+#include <cppuhelper/weak.hxx>
+#include <osl/mutex.hxx>
+
+#include <cppuhelper/implbase1.hxx>
+
+#include <toolkit/awt/vclxcontainer.hxx>
+
+typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XTopWindow2
+ > VCLXTopWindow_XBase;
+typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XSystemDependentWindowPeer
+ > VCLXTopWindow_SBase;
+
+class TOOLKIT_DLLPUBLIC VCLXTopWindow_Base :public VCLXTopWindow_XBase
+ ,public VCLXTopWindow_SBase
+{
+private:
+ const bool m_bWHWND;
+
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar> mxMenuBar;
+
+ bool isSystemDependentWindowPeer() const { return m_bWHWND; }
+
+ virtual Window* GetWindowImpl() = 0;
+ virtual ::cppu::OInterfaceContainerHelper& GetTopWindowListenersImpl() = 0;
+
+ VCLXTopWindow_Base( const bool _bSupportSystemWindowPeer );
+
+public:
+ virtual ~VCLXTopWindow_Base();
+
+ // XInterface equivalents
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ // XTypeProvider equivalents
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XSystemDependentWindowPeer
+ ::com::sun::star::uno::Any SAL_CALL getWindowHandle( const ::com::sun::star::uno::Sequence< sal_Int8 >& ProcessId, sal_Int16 SystemType ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTopWindow
+ void SAL_CALL addTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL toFront() throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL toBack() throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMenuBar( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar >& xMenu ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTopWindow2
+ virtual ::sal_Bool SAL_CALL getIsMaximized() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setIsMaximized( ::sal_Bool _ismaximized ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getIsMinimized() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setIsMinimized( ::sal_Bool _isminimized ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getDisplay() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDisplay( ::sal_Int32 _display ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException);
+};
+
+// ----------------------------------------------------
+// class VCLXTopWindow
+// ----------------------------------------------------
+
+class TOOLKIT_DLLPUBLIC VCLXTopWindow: public VCLXTopWindow_Base,
+ public VCLXContainer
+{
+protected:
+ virtual Window* GetWindowImpl();
+ virtual ::cppu::OInterfaceContainerHelper& GetTopWindowListenersImpl();
+
+public:
+ VCLXTopWindow(bool bWHWND = false);
+ ~VCLXTopWindow();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+
+
+
+#endif // _TOOLKIT_AWT_VCLXTOPWINDOW_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxwindow.hxx b/include/toolkit/awt/vclxwindow.hxx
new file mode 100644
index 000000000000..7e415f21a8fd
--- /dev/null
+++ b/include/toolkit/awt/vclxwindow.hxx
@@ -0,0 +1,235 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_AWT_VCLXWINDOW_HXX_
+#define _TOOLKIT_AWT_VCLXWINDOW_HXX_
+
+#include <toolkit/dllapi.h>
+#include <toolkit/awt/vclxdevice.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+
+#include <com/sun/star/awt/XWindow2.hpp>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+#include <com/sun/star/awt/XLayoutConstrains.hpp>
+#include <com/sun/star/awt/XView.hpp>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/awt/XDockableWindow.hpp>
+#include <com/sun/star/awt/XStyleSettingsSupplier.hpp>
+
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase9.hxx>
+#include <osl/mutex.hxx>
+
+#include <tools/gen.hxx> // Size
+#include <tools/link.hxx>
+
+#include <stdarg.h>
+#include <list>
+#include <boost/function.hpp>
+
+class Window;
+class VclSimpleEvent;
+class VclWindowEvent;
+struct SystemParentData;
+
+namespace toolkit
+{
+ class IAccessibleFactory;
+}
+
+
+// ----------------------------------------------------
+// class VCLXWINDOW
+// ----------------------------------------------------
+
+class UnoPropertyArrayHelper;
+class VCLXWindowImpl;
+typedef ::cppu::ImplInheritanceHelper9 < VCLXDevice
+ , ::com::sun::star::awt::XWindow2
+ , ::com::sun::star::awt::XVclWindowPeer
+ , ::com::sun::star::awt::XLayoutConstrains
+ , ::com::sun::star::awt::XView
+ , ::com::sun::star::awt::XDockableWindow
+ , ::com::sun::star::accessibility::XAccessible
+ , ::com::sun::star::lang::XEventListener
+ , ::com::sun::star::beans::XPropertySetInfo
+ , ::com::sun::star::awt::XStyleSettingsSupplier
+ > VCLXWindow_Base;
+
+class TOOLKIT_DLLPUBLIC VCLXWindow : public VCLXWindow_Base
+{
+private:
+ VCLXWindowImpl* mpImpl;
+
+ UnoPropertyArrayHelper *GetPropHelper();
+
+protected:
+ Size ImplCalcWindowSize( const Size& rOutSz ) const;
+ DECL_LINK( WindowEventListener, VclSimpleEvent* );
+
+ virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ CreateAccessibleContext();
+
+ void SetSynthesizingVCLEvent( sal_Bool b );
+ sal_Bool IsSynthesizingVCLEvent() const;
+
+ void SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle );
+
+ ::toolkit::IAccessibleFactory& getAccessibleFactory();
+
+ // helper ...
+ static void PushPropertyIds( std::list< sal_uInt16 > &aIds, int nFirstId, ...);
+ // for use in controls/
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds,
+ bool bWithDefaults = false );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds );
+
+ ::cppu::OInterfaceContainerHelper& GetContainerListeners();
+ ::cppu::OInterfaceContainerHelper& GetTopWindowListeners();
+
+public:
+ typedef ::boost::function0< void > Callback;
+
+protected:
+ /** executes the given callback asynchronously
+
+ At the moment the callback is called, the Solar Mutex is not locked. In particular, this implies that
+ you cannot rely on |this| not being disposed. However, you *can* rely on |this| being still alive (i.e.
+ having a ref count > 0).
+
+ As a consequence, this can be used for doing listener notifications, using event multiplexers. Those multiplexers
+ care for the disposed state themself, and are alive as long as |this| is alive.
+ */
+ void ImplExecuteAsyncWithoutSolarLock(
+ const Callback& i_callback
+ );
+
+public:
+ VCLXWindow( bool bWithDefaultProps = false );
+ ~VCLXWindow();
+
+ virtual void SetWindow( Window* pWindow );
+ Window* GetWindow() const { return (Window*)GetOutputDevice(); }
+
+ void suspendVclEventListening( );
+ void resumeVclEventListening( );
+
+ void notifyWindowRemoved( Window& _rWindow );
+
+ // ::com::sun::star::lang::XUnoTunnel
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
+ static VCLXWindow* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
+ sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XWindow
+ void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Rectangle SAL_CALL getPosSize( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setVisible( sal_Bool Visible ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setEnable( sal_Bool Enable ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFocus( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removePaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XWindowPeer
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > SAL_CALL getToolkit( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setPointer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPointer >& Pointer ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setBackground( sal_Int32 Color ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL invalidate( sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL invalidateRect( const ::com::sun::star::awt::Rectangle& Rect, sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XVclWindowPeer
+ sal_Bool SAL_CALL isChild( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Peer ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isDesignMode( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL enableClipSiblings( sal_Bool bClip ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setForeground( sal_Int32 Color ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setControlFont( const ::com::sun::star::awt::FontDescriptor& aFont ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL getStyles( sal_Int16 nType, ::com::sun::star::awt::FontDescriptor& Font, sal_Int32& ForegroundColor, sal_Int32& BackgroundColor ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XView
+ sal_Bool SAL_CALL setGraphics( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& aDevice ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > SAL_CALL getGraphics( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getSize( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setZoom( float fZoomX, float fZoomY ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::accessibility::XAccessible
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDockableWindow
+ void SAL_CALL addDockableWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDockableWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeDockableWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDockableWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL enableDocking( sal_Bool bEnable ) throw (::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isFloating( ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFloatingMode( sal_Bool bFloating ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL lock( ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL unlock( ) throw (::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isLocked( ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL startPopupMode( const ::com::sun::star::awt::Rectangle& WindowRect ) throw (::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isInPopupMode( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XWindow2
+ void SAL_CALL setOutputSize( const ::com::sun::star::awt::Size& aSize ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getOutputSize( ) throw (::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isVisible( ) throw (::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isActive( ) throw (::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isEnabled( ) throw (::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL hasFocus( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XPropertySetInfo
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties( ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::beans::Property SAL_CALL getPropertyByName( const OUString& aName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ ::sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XStyleSettingsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleSettings > SAL_CALL getStyleSettings() throw (::com::sun::star::uno::RuntimeException);
+};
+
+#endif // _TOOLKIT_AWT_VCLXWINDOW_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/vclxwindows.hxx b/include/toolkit/awt/vclxwindows.hxx
new file mode 100644
index 000000000000..f822b0cc0e33
--- /dev/null
+++ b/include/toolkit/awt/vclxwindows.hxx
@@ -0,0 +1,1242 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_AWT_VCLXWINDOWS_HXX_
+#define _TOOLKIT_AWT_VCLXWINDOWS_HXX_
+
+#include <toolkit/dllapi.h>
+
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/PropertyState.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/beans/XFastPropertySet.hpp>
+#include <com/sun/star/beans/XVetoableChangeListener.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/beans/XPropertyAccess.hpp>
+#include <com/sun/star/beans/XPropertyContainer.hpp>
+#include <com/sun/star/beans/PropertyStateChangeEvent.hpp>
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#include <com/sun/star/awt/XFileDialog.hpp>
+#include <com/sun/star/awt/XTextComponent.hpp>
+#include <com/sun/star/awt/XListBox.hpp>
+#include <com/sun/star/awt/XProgressMonitor.hpp>
+#include <com/sun/star/awt/TextAlign.hpp>
+#include <com/sun/star/awt/XScrollBar.hpp>
+#include <com/sun/star/awt/XVclContainerPeer.hpp>
+#include <com/sun/star/awt/XTabControllerModel.hpp>
+#include <com/sun/star/awt/XMessageBox.hpp>
+#include <com/sun/star/awt/XTextEditField.hpp>
+#include <com/sun/star/awt/Style.hpp>
+#include <com/sun/star/awt/XTimeField.hpp>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+#include <com/sun/star/awt/XControlModel.hpp>
+#include <com/sun/star/awt/XSpinField.hpp>
+#include <com/sun/star/awt/XUnoControlContainer.hpp>
+#include <com/sun/star/awt/XTextLayoutConstrains.hpp>
+#include <com/sun/star/awt/XNumericField.hpp>
+#include <com/sun/star/awt/XMetricField.hpp>
+#include <com/sun/star/awt/XButton.hpp>
+#include <com/sun/star/awt/XToggleButton.hpp>
+#include <com/sun/star/awt/XPointer.hpp>
+#include <com/sun/star/awt/XTextArea.hpp>
+#include <com/sun/star/awt/XImageButton.hpp>
+#include <com/sun/star/awt/XFixedHyperlink.hpp>
+#include <com/sun/star/awt/XFixedText.hpp>
+#include <com/sun/star/awt/XControlContainer.hpp>
+#include <com/sun/star/awt/XDialog2.hpp>
+#include <com/sun/star/awt/XRadioButton.hpp>
+#include <com/sun/star/awt/XCurrencyField.hpp>
+#include <com/sun/star/awt/XPatternField.hpp>
+#include <com/sun/star/awt/XDateField.hpp>
+#include <com/sun/star/awt/XComboBox.hpp>
+#include <com/sun/star/awt/XCheckBox.hpp>
+#include <com/sun/star/awt/XItemListListener.hpp>
+#include <com/sun/star/awt/XImageConsumer.hpp>
+#include <com/sun/star/awt/XSimpleTabController.hpp>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase2.hxx>
+
+#include "toolkit/awt/vclxwindow.hxx"
+#include "toolkit/awt/vclxtopwindow.hxx"
+#include <cppuhelper/implbase1.hxx>
+
+#include <vcl/pointr.hxx>
+#include <vcl/image.hxx>
+#include <vcl/tabctrl.hxx>
+
+class Button;
+class CheckBox;
+class RadioButton;
+class ListBox;
+class ScrollBar;
+class Edit;
+class Menu;
+class ComboBox;
+class FormatterBase;
+class SpinField;
+class ToolBox;
+class VclSimpleEvent;
+class VclMenuEvent;
+
+// ----------------------------------------------------
+// class VCLXGraphicControl
+// deriving from VCLXWindow, drawing the graphic which exists as "Graphic" at the model
+// ----------------------------------------------------
+
+
+class TOOLKIT_DLLPUBLIC VCLXGraphicControl : public VCLXWindow
+{
+private:
+ /// the image we currently display
+ Image maImage;
+
+protected:
+ const Image& GetImage() const { return maImage; }
+
+protected:
+ // ::com::sun::star::awt::XWindow
+ void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+protected:
+ /** forward our bitmap to our window
+ @precond
+ our mutex is locked
+ @precond
+ GetWindow is not <NULL/>
+ @see GetBitmap
+ */
+ virtual void ImplSetNewImage();
+
+public:
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+
+};
+
+// ----------------------------------------------------
+// class VCLXButton
+// ----------------------------------------------------
+typedef ::cppu::ImplInheritanceHelper2 < VCLXGraphicControl
+ , ::com::sun::star::awt::XButton
+ , ::com::sun::star::awt::XToggleButton
+ > VCLXButton_Base;
+class VCLXButton :public VCLXButton_Base
+{
+private:
+ OUString maActionCommand;
+ ActionListenerMultiplexer maActionListeners;
+ ItemListenerMultiplexer maItemListeners;
+
+protected:
+ void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext();
+
+public:
+ VCLXButton();
+ ~VCLXButton();
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XButton
+ void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLabel( const OUString& Label ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setActionCommand( const OUString& Command ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XToggleButton
+ // ::com::sun::star::awt::XItemEventBroadcaster
+ void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXImageControl
+// ----------------------------------------------------
+class VCLXImageControl : public VCLXGraphicControl
+{
+public:
+ VCLXImageControl();
+ ~VCLXImageControl();
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+
+protected:
+ virtual void ImplSetNewImage();
+};
+
+// ----------------------------------------------------
+// class VCLXCheckBox
+// ----------------------------------------------------
+class VCLXCheckBox : public ::com::sun::star::awt::XCheckBox,
+ public ::com::sun::star::awt::XButton,
+ public VCLXGraphicControl
+{
+private:
+ ActionListenerMultiplexer maActionListeners;
+ OUString maActionCommand;
+ ItemListenerMultiplexer maItemListeners;
+
+protected:
+ void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext();
+
+public:
+ VCLXCheckBox();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XCheckBox
+ void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getState( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setState( sal_Int16 n ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLabel( const OUString& Label ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL enableTriState( sal_Bool b ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XButton:
+ void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setActionCommand( const OUString& Command ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXRadioButton
+// ----------------------------------------------------
+class VCLXRadioButton : public ::com::sun::star::awt::XRadioButton,
+ public ::com::sun::star::awt::XButton,
+ public VCLXGraphicControl
+{
+private:
+ ItemListenerMultiplexer maItemListeners;
+ ActionListenerMultiplexer maActionListeners;
+ OUString maActionCommand;
+
+protected:
+ void ImplClickedOrToggled( sal_Bool bToggled );
+ void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext();
+
+public:
+ VCLXRadioButton();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XRadioButton
+ void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL getState( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setState( sal_Bool b ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLabel( const OUString& Label ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XButton:
+ void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setActionCommand( const OUString& Command ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+
+};
+
+// ----------------------------------------------------
+// class VCLXMessageBox
+// ----------------------------------------------------
+class VCLXMessageBox : public ::com::sun::star::awt::XMessageBox,
+ public VCLXTopWindow
+{
+public:
+ VCLXMessageBox();
+ ~VCLXMessageBox();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+
+ // ::com::sun::star::awt::XMessageBox
+ void SAL_CALL setCaptionText( const OUString& aText ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getCaptionText( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMessageText( const OUString& aText ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getMessageText( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL execute( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize() throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXFrame
+// ----------------------------------------------------
+class VCLXFrame : public VCLXContainer
+{
+protected:
+ void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+
+public:
+ VCLXFrame();
+ ~VCLXFrame();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XView
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDevice,
+ ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XVclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+
+
+// ----------------------------------------------------
+// class VCLXDialog
+// ----------------------------------------------------
+class TOOLKIT_DLLPUBLIC VCLXDialog : public ::com::sun::star::awt::XDialog2,
+ public VCLXTopWindow
+{
+public:
+ VCLXDialog();
+ ~VCLXDialog();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDialog2
+ virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpId( const OUString& Id ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDialog
+ void SAL_CALL setTitle( const OUString& Title ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getTitle( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL execute( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL endExecute( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XView
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDevice,
+ ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+
+ // ::com::sun::star::awt::XVclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+
+};
+
+// ----------------------------------------------------
+// class VCLXTabPage
+// ----------------------------------------------------
+class VCLXTabPage : public VCLXContainer
+{
+public:
+ VCLXTabPage();
+ ~VCLXTabPage();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XView
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDevice,
+ ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XVclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+
+ TabPage* getTabPage() const throw ( ::com::sun::star::uno::RuntimeException);
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+class VCLXMultiPage : public ::com::sun::star::awt::XSimpleTabController, public VCLXContainer
+{
+ TabListenerMultiplexer maTabListeners;
+ sal_Int32 mTabId;
+protected:
+ void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+public:
+ VCLXMultiPage();
+ ~VCLXMultiPage();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XView
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDevice,
+ ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XVclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+ // XSimpleTabController
+ virtual ::sal_Int32 SAL_CALL insertTab() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setTabProps( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > SAL_CALL getTabProps( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL activateTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getActiveTabID() throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ // C++
+ TabControl* getTabControl() const throw ( ::com::sun::star::uno::RuntimeException);
+ sal_uInt16 insertTab( TabPage*, OUString& sTitle );
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXFixedHyperlink
+// ----------------------------------------------------
+class TOOLKIT_DLLPUBLIC VCLXFixedHyperlink :
+ public ::com::sun::star::awt::XFixedHyperlink,
+ public VCLXWindow
+{
+private:
+ ActionListenerMultiplexer maActionListeners;
+
+protected:
+ void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ CreateAccessibleContext();
+
+public:
+ VCLXFixedHyperlink();
+ ~VCLXFixedHyperlink();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XFixedHyperlink
+ void SAL_CALL setText( const OUString& Text ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setURL( const OUString& URL ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getURL( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setAlignment( sal_Int16 nAlign ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getAlignment( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXFixedText
+// ----------------------------------------------------
+class VCLXFixedText : public ::com::sun::star::awt::XFixedText,
+ public VCLXWindow
+{
+protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext();
+
+public:
+ VCLXFixedText();
+ ~VCLXFixedText();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XFixedText
+ void SAL_CALL setText( const OUString& Text ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setAlignment( sal_Int16 nAlign ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getAlignment( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXScrollBar
+// ----------------------------------------------------
+class VCLXScrollBar : public ::com::sun::star::awt::XScrollBar,
+ public VCLXWindow
+{
+private:
+ AdjustmentListenerMultiplexer maAdjustmentListeners;
+
+protected:
+ void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext();
+
+public:
+ VCLXScrollBar();
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XScrollbar
+ void SAL_CALL addAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setValue( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setValues( sal_Int32 nValue, sal_Int32 nVisible, sal_Int32 nMax ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMaximum( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getMaximum( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLineIncrement( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getLineIncrement( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setBlockIncrement( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getBlockIncrement( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setVisibleSize( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getVisibleSize( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setOrientation( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getOrientation( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // why isn't this part of the XScrollbar?
+ void SAL_CALL setMinimum( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getMinimum( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize() throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::awt::Size SAL_CALL implGetMinimumSize( Window* p ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXEdit
+// ----------------------------------------------------
+class TOOLKIT_DLLPUBLIC VCLXEdit : public ::com::sun::star::awt::XTextComponent,
+ public ::com::sun::star::awt::XTextEditField,
+ public ::com::sun::star::awt::XTextLayoutConstrains,
+ public VCLXWindow
+{
+private:
+ TextListenerMultiplexer maTextListeners;
+
+protected:
+ void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext();
+
+
+public:
+ VCLXEdit();
+
+ TextListenerMultiplexer& GetTextListeners() { return maTextListeners; }
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTextComponent
+ void SAL_CALL addTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setText( const OUString& aText ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL insertText( const ::com::sun::star::awt::Selection& Sel, const OUString& Text ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getSelectedText( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setSelection( const ::com::sun::star::awt::Selection& aSelection ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Selection SAL_CALL getSelection( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isEditable( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setEditable( sal_Bool bEditable ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getMaxTextLen( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTextEditField:
+ void SAL_CALL setEchoChar( sal_Unicode cEcho ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTextLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXListBox
+// ----------------------------------------------------
+typedef ::cppu::ImplInheritanceHelper3 < VCLXWindow
+ , ::com::sun::star::awt::XListBox
+ , ::com::sun::star::awt::XTextLayoutConstrains
+ , ::com::sun::star::awt::XItemListListener
+ > VCLXListBox_Base;
+class VCLXListBox : public VCLXListBox_Base
+{
+private:
+ ActionListenerMultiplexer maActionListeners;
+ ItemListenerMultiplexer maItemListeners;
+
+protected:
+ virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ CreateAccessibleContext();
+ void ImplCallItemListeners();
+
+public:
+ VCLXListBox();
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XListBox
+ void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addItem( const OUString& aItem, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< OUString >& aItems, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getItems( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getSelectedItemPos( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSelectedItemsPos( ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getSelectedItem( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSelectedItems( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL selectItemPos( sal_Int16 nPos, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL selectItemsPos( const ::com::sun::star::uno::Sequence< sal_Int16 >& aPositions, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL selectItem( const OUString& aItem, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isMutipleMode( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMultipleMode( sal_Bool bMulti ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getDropDownLineCount( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL makeVisible( sal_Int16 nEntry ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTextLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XItemListListener
+ virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_rEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXComboBox
+// ----------------------------------------------------
+typedef ::cppu::ImplInheritanceHelper2 < VCLXEdit
+ , ::com::sun::star::awt::XComboBox
+ , ::com::sun::star::awt::XItemListListener > VCLXComboBox_Base;
+class VCLXComboBox : public VCLXComboBox_Base
+{
+private:
+ ActionListenerMultiplexer maActionListeners;
+ ItemListenerMultiplexer maItemListeners;
+
+protected:
+ void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext();
+
+
+public:
+ VCLXComboBox();
+ ~VCLXComboBox();
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XComboBox
+ void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addItem( const OUString& aItem, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< OUString >& aItems, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getItems( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getDropDownLineCount( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTextLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XItemListListener
+ virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_rEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXSpinField
+// ----------------------------------------------------
+class TOOLKIT_DLLPUBLIC VCLXSpinField : public ::com::sun::star::awt::XSpinField,
+ public VCLXEdit
+{
+private:
+ SpinListenerMultiplexer maSpinListeners;
+
+protected:
+ void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+
+public:
+ VCLXSpinField();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+
+ // ::com::sun::star::awt::XSpinField
+ void SAL_CALL addSpinListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSpinListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeSpinListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSpinListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL up( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL down( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL first( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL last( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL enableRepeat( sal_Bool bRepeat ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXFormattedSpinField
+// ----------------------------------------------------
+class VCLXFormattedSpinField : public VCLXSpinField
+{
+private:
+ FormatterBase* mpFormatter;
+
+protected:
+ FormatterBase* GetFormatter() const { return GetWindow() ? mpFormatter : NULL; }
+
+public:
+ VCLXFormattedSpinField();
+ ~VCLXFormattedSpinField();
+
+ void SetFormatter( FormatterBase* pFormatter ) { mpFormatter = pFormatter; }
+
+ void setStrictFormat( sal_Bool bStrict );
+ sal_Bool isStrictFormat();
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXDateField
+// ----------------------------------------------------
+class TOOLKIT_DLLPUBLIC VCLXDateField : public ::com::sun::star::awt::XDateField,
+ public VCLXFormattedSpinField
+{
+public:
+ VCLXDateField();
+ ~VCLXDateField();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+
+ // ::com::sun::star::awt::XDateField
+ void SAL_CALL setDate( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getDate( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMin( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMax( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFirst( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLast( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLongFormat( sal_Bool bLong ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isLongFormat( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setEmpty( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isEmpty( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXTimeField
+// ----------------------------------------------------
+class VCLXTimeField : public ::com::sun::star::awt::XTimeField,
+ public VCLXFormattedSpinField
+{
+public:
+ VCLXTimeField();
+ ~VCLXTimeField();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTimeField
+ void SAL_CALL setTime( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getTime( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMin( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMax( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFirst( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLast( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setEmpty( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isEmpty( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXNumericField
+// ----------------------------------------------------
+class VCLXNumericField : public ::com::sun::star::awt::XNumericField,
+ public VCLXFormattedSpinField
+{
+public:
+ VCLXNumericField();
+ ~VCLXNumericField();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XNumericField
+ void SAL_CALL setValue( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMin( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMax( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLast( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getSpinSize( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getDecimalDigits( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXMetricField
+// ----------------------------------------------------
+class MetricFormatter;
+class MetricField;
+class VCLXMetricField : public ::com::sun::star::awt::XMetricField,
+ public VCLXFormattedSpinField
+{
+ MetricFormatter *GetMetricFormatter() throw(::com::sun::star::uno::RuntimeException);
+ MetricField *GetMetricField() throw(::com::sun::star::uno::RuntimeException);
+ void CallListeners();
+public:
+ VCLXMetricField();
+ ~VCLXMetricField();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XMetricField
+ virtual void SAL_CALL setValue( ::sal_Int64 Value, ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setUserValue( ::sal_Int64 Value, ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int64 SAL_CALL getValue( ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int64 SAL_CALL getCorrectedValue( ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMin( ::sal_Int64 Value, ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int64 SAL_CALL getMin( ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMax( ::sal_Int64 Value, ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int64 SAL_CALL getMax( ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFirst( ::sal_Int64 Value, ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int64 SAL_CALL getFirst( ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setLast( ::sal_Int64 Value, ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int64 SAL_CALL getLast( ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setSpinSize( ::sal_Int64 Value ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int64 SAL_CALL getSpinSize( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDecimalDigits( ::sal_Int16 nDigits ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getDecimalDigits( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setStrictFormat( ::sal_Bool bStrict ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isStrictFormat( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXCurrencyField
+// ----------------------------------------------------
+class VCLXCurrencyField : public ::com::sun::star::awt::XCurrencyField,
+ public VCLXFormattedSpinField
+{
+public:
+ VCLXCurrencyField();
+ ~VCLXCurrencyField();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+
+ // ::com::sun::star::awt::XCurrencyField
+ void SAL_CALL setValue( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMin( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMax( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLast( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getSpinSize( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getDecimalDigits( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXPatternField
+// ----------------------------------------------------
+class VCLXPatternField : public ::com::sun::star::awt::XPatternField,
+ public VCLXFormattedSpinField
+{
+public:
+ VCLXPatternField();
+ ~VCLXPatternField();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+
+ // ::com::sun::star::awt::XPatternField
+ void SAL_CALL setMasks( const OUString& EditMask, const OUString& LiteralMask ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL getMasks( OUString& EditMask, OUString& LiteralMask ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setString( const OUString& Str ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getString( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::VclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+};
+
+// ----------------------------------------------------
+// class VCLXToolBox
+// ----------------------------------------------------
+class VCLXToolBox : public VCLXWindow
+{
+private:
+
+protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ CreateAccessibleContext();
+
+public:
+ VCLXToolBox();
+ ~VCLXToolBox();
+};
+
+#endif // _TOOLKIT_AWT_VCLXWINDOWS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/xsimpleanimation.hxx b/include/toolkit/awt/xsimpleanimation.hxx
new file mode 100644
index 000000000000..3ab8499d63fc
--- /dev/null
+++ b/include/toolkit/awt/xsimpleanimation.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 TOOLKIT_AWT_XSIMPLEANIMATION_HXX
+#define TOOLKIT_AWT_XSIMPLEANIMATION_HXX
+
+#include <toolkit/awt/vclxwindow.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/uno3.hxx>
+#include <com/sun/star/awt/XSimpleAnimation.hpp>
+
+#include <boost/scoped_ptr.hpp>
+
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ //====================================================================
+ //= XSimpleAnimation
+ //====================================================================
+ typedef ::cppu::ImplInheritanceHelper1 < VCLXWindow
+ , ::com::sun::star::awt::XSimpleAnimation
+ > XSimpleAnimation_Base;
+
+ class XSimpleAnimation : public XSimpleAnimation_Base
+ {
+ public:
+ XSimpleAnimation();
+
+ protected:
+ ~XSimpleAnimation();
+
+ // XSimpleAnimation
+ virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setImageList( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& ImageList )
+ throw (::com::sun::star::uno::RuntimeException);
+ // VclWindowPeer
+ virtual void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ private:
+ XSimpleAnimation( const XSimpleAnimation& ); // never implemented
+ XSimpleAnimation& operator=( const XSimpleAnimation& ); // never implemented
+ };
+
+//........................................................................
+} // namespacetoolkit
+//........................................................................
+
+#endif // TOOLKIT_INC_TOOLKIT_AWT_XSIMPLEANIMATION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/awt/xthrobber.hxx b/include/toolkit/awt/xthrobber.hxx
new file mode 100644
index 000000000000..2c8ad5d0817e
--- /dev/null
+++ b/include/toolkit/awt/xthrobber.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 TOOLKIT_AWT_XTHROBBER_HXX
+#define TOOLKIT_AWT_XTHROBBER_HXX
+
+#include <toolkit/awt/vclxwindow.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/uno3.hxx>
+#include <com/sun/star/awt/XThrobber.hpp>
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/noncopyable.hpp>
+
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ //====================================================================
+ //= XThrobber
+ //====================================================================
+ typedef ::cppu::ImplInheritanceHelper1 < VCLXWindow
+ , ::com::sun::star::awt::XThrobber
+ > XThrobber_Base;
+
+ class XThrobber :public XThrobber_Base
+ ,public ::boost::noncopyable
+ {
+ private:
+ void SAL_CALL InitImageList() throw(::com::sun::star::uno::RuntimeException);
+
+ public:
+ XThrobber();
+
+ protected:
+ ~XThrobber();
+
+ // XThrobber
+ virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException);
+
+ // VCLXWindow
+ virtual void SetWindow( Window* pWindow );
+
+ private:
+ XThrobber( const XThrobber& ); // never implemented
+ XThrobber& operator=( const XThrobber& ); // never implemented
+ };
+
+//........................................................................
+} // namespacetoolkit
+//........................................................................
+
+#endif // TOOLKIT_AWT_XTHROBBER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/accessiblecontrolcontext.hxx b/include/toolkit/controls/accessiblecontrolcontext.hxx
new file mode 100644
index 000000000000..dedc5bcd842d
--- /dev/null
+++ b/include/toolkit/controls/accessiblecontrolcontext.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 TOOLKIT_ACCESSIBLE_CONTROL_CONTEXT_HXX
+#define TOOLKIT_ACCESSIBLE_CONTROL_CONTEXT_HXX
+
+#include <comphelper/accessiblecomponenthelper.hxx>
+#include <comphelper/accimplaccess.hxx>
+#include <comphelper/uno3.hxx>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+
+class Window;
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ //====================================================================
+ //= OAccessibleControlContext
+ //====================================================================
+
+ typedef ::comphelper::OAccessibleComponentHelper OAccessibleControlContext_Base;
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::lang::XEventListener
+ > OAccessibleControlContext_IBase;
+
+ /** class implementing the AccessibleContext for an UNO control - to be used in design mode of the control.
+ <p><b>life time control<b/><br/>
+ This control should be held weak by the creator (an UNO control), it itself holds a hard reference to the
+ control model, and a weak reference to the control. The reference to the model is freed when the model
+ is beeing disposed.</p>
+ */
+ class OAccessibleControlContext
+ :public ::comphelper::OAccessibleImplementationAccess
+ ,public OAccessibleControlContext_Base
+ ,public OAccessibleControlContext_IBase
+ {
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+ m_xControlModel; // the model of the control which's context we implement
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
+ m_xModelPropsInfo; // the cached property set info of the model
+
+ protected:
+ /// ctor. @see Init
+ OAccessibleControlContext();
+ ~OAccessibleControlContext();
+
+ /** late ctor
+ */
+ void Init(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxCreator
+ ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
+
+ // OCommonAccessibleComponent overridables
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException);
+
+ public:
+ /** creates an accessible context for an uno control
+ @param _rxCreator
+ the uno control's XAccessible interface. This must be an XControl, from which an XControlModel
+ can be retrieved.
+ */
+ static OAccessibleControlContext* create(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxCreator
+ ) SAL_THROW( ( ) );
+
+ protected:
+ // XInterface
+ DECLARE_XINTERFACE( )
+ DECLARE_XTYPEPROVIDER( )
+
+ // XAccessibleContext
+ virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleComponent
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ using comphelper::OAccessibleContextHelper::disposing;
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ // retrieves the value of a string property from the model, if the property is present
+ OUString getModelStringProperty( const sal_Char* _pPropertyName ) SAL_THROW( ( ) );
+
+ // starts listening at the control model (currently for disposal only)
+ void startModelListening( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
+ // stops listening at the control model
+ void stopModelListening( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
+
+ Window* implGetWindow( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >* _pxUNOWindow = NULL ) const;
+ };
+
+//........................................................................
+} // namespace toolkit
+//........................................................................
+
+#endif // TOOLKIT_ACCESSIBLE_CONTROL_CONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/animatedimages.hxx b/include/toolkit/controls/animatedimages.hxx
new file mode 100644
index 000000000000..dd0757a3e5a1
--- /dev/null
+++ b/include/toolkit/controls/animatedimages.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 TOOLKIT_ANIMATEDIMAGES_HXX
+#define TOOLKIT_ANIMATEDIMAGES_HXX
+
+#include "toolkit/controls/unocontrolbase.hxx"
+#include "toolkit/controls/unocontrolmodel.hxx"
+
+#include <com/sun/star/awt/XAnimation.hpp>
+#include <com/sun/star/awt/XAnimatedImages.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //=
+ //==================================================================================================================
+ typedef ::cppu::AggImplInheritanceHelper2 < UnoControlBase
+ , ::com::sun::star::awt::XAnimation
+ , ::com::sun::star::container::XContainerListener
+ > AnimatedImagesControl_Base;
+
+ class AnimatedImagesControl : public AnimatedImagesControl_Base
+ {
+ public:
+ AnimatedImagesControl();
+ OUString GetComponentServiceName();
+
+ // XAnimation
+ virtual void SAL_CALL startAnimation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL stopAnimation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isAnimationRunning( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // XControl
+ sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& i_rModel ) throw ( ::com::sun::star::uno::RuntimeException );
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& i_toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& i_parentPeer ) throw(::com::sun::star::uno::RuntimeException);
+
+
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
+ };
+
+ //==================================================================================================================
+ //= AnimatedImagesControlModel
+ //==================================================================================================================
+ struct AnimatedImagesControlModel_Data;
+ typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
+ , ::com::sun::star::awt::XAnimatedImages
+ > AnimatedImagesControlModel_Base;
+ class AnimatedImagesControlModel : public AnimatedImagesControlModel_Base
+ {
+ public:
+ AnimatedImagesControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & i_factory );
+ AnimatedImagesControlModel( const AnimatedImagesControlModel& i_copySource );
+
+ virtual UnoControlModel* Clone() const;
+
+ // XPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // XAnimatedImages
+ virtual ::sal_Int32 SAL_CALL getStepTime() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setStepTime( ::sal_Int32 _steptime ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getAutoRepeat() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAutoRepeat( ::sal_Bool _autorepeat ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getScaleMode() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setScaleMode( ::sal_Int16 _scalemode ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getImageSetCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getImageSet( ::sal_Int32 i_index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL insertImageSet( ::sal_Int32 i_index, const ::com::sun::star::uno::Sequence< OUString >& i_imageURLs ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL replaceImageSet( ::sal_Int32 i_index, const ::com::sun::star::uno::Sequence< OUString >& i_imageURLs ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeImageSet( ::sal_Int32 i_index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XAnimatedImages::XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ ~AnimatedImagesControlModel();
+
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+
+ private:
+ ::boost::scoped_ptr< AnimatedImagesControlModel_Data >
+ m_pData;
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_ANIMATEDIMAGES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/controlmodelcontainerbase.hxx b/include/toolkit/controls/controlmodelcontainerbase.hxx
new file mode 100644
index 000000000000..e84ddd1f0380
--- /dev/null
+++ b/include/toolkit/controls/controlmodelcontainerbase.hxx
@@ -0,0 +1,271 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef TOOLKIT_CONTROL_MODEL_CONTAINERBASE_HXX
+#define TOOLKIT_CONTROL_MODEL_CONTAINERBASE_HXX
+
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/XContainer.hpp>
+#include <com/sun/star/awt/XTabControllerModel.hpp>
+#include <com/sun/star/util/XChangesNotifier.hpp>
+#include <com/sun/star/util/XChangesListener.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
+#include <cppuhelper/implbase8.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/controls/unocontrolcontainer.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <tools/gen.hxx>
+// ----------------------------------------------------
+// class ControlModelContainerBase
+// ----------------------------------------------------
+typedef UnoControlModel ControlModel_Base;
+typedef ::cppu::AggImplInheritanceHelper8 < ControlModel_Base
+ , ::com::sun::star::lang::XMultiServiceFactory
+ , ::com::sun::star::container::XContainer
+ , ::com::sun::star::container::XNameContainer
+ , ::com::sun::star::awt::XTabControllerModel
+ , ::com::sun::star::util::XChangesNotifier
+ , ::com::sun::star::beans::XPropertyChangeListener
+ , ::com::sun::star::awt::tab::XTabPageModel
+ , ::com::sun::star::lang::XInitialization
+ > ControlModelContainer_IBase;
+
+class ControlModelContainerBase : public ControlModelContainer_IBase
+{
+public:
+ enum ChildOperation { Insert = 0, Remove };
+ // would like to make this typedef private, too, but the Forte 7 compiler does have
+ // problems with this .....
+ typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >, OUString >
+ UnoControlModelHolder;
+private:
+ typedef ::std::list< UnoControlModelHolder > UnoControlModelHolderList;
+
+public:
+ // for grouping control models (XTabControllerModel::getGroupXXX)
+ typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >
+ ModelGroup;
+ typedef ::std::vector< ModelGroup > AllGroups;
+
+ friend struct CloneControlModel;
+ friend struct FindControlModel;
+ friend struct CompareControlModel;
+
+protected:
+ ContainerListenerMultiplexer maContainerListeners;
+ ::cppu::OInterfaceContainerHelper maChangeListeners;
+ UnoControlModelHolderList maModels;
+
+ AllGroups maGroups;
+ sal_Bool mbGroupsUpToDate;
+
+ bool m_bEnabled;
+ OUString m_sTitle;
+ OUString m_sImageURL;
+ OUString m_sTooltip;
+ sal_Int16 m_nTabPageId;
+
+ void Clone_Impl(ControlModelContainerBase& _rClone) const;
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ UnoControlModelHolderList::iterator ImplFindElement( const OUString& rName );
+
+ void updateUserFormChildren( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xAllChildren, const OUString& aName, ChildOperation Operation, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xTarget ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+public:
+ ControlModelContainerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ ControlModelContainerBase( const ControlModelContainerBase& rModel );
+ ~ControlModelContainerBase();
+
+ UnoControlModel* Clone() const;
+
+ // ::com::sun::star::container::XContainer
+ void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XElementAcces
+ ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XNameContainer, XNameReplace, XNameAccess
+ void SAL_CALL replaceByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL hasByName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL insertByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeByName( const OUString& Name ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XMultiServiceFactory
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTabControllerModel
+ virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setGroupControl( sal_Bool GroupControl ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setControlModels( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Controls ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > SAL_CALL getControlModels( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setGroup( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, const OUString& GroupName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getGroupCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL getGroup( sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, OUString& Name ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL getGroupByName( const OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XChangesNotifier
+ virtual void SAL_CALL addChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ using cppu::OPropertySetHelper::disposing;
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& evt ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED(ControlModelContainerBase, ControlModel_Base, "toolkit.ControlModelContainerBase" )
+
+ // XInitialization
+ virtual void SAL_CALL initialize (const com::sun::star::uno::Sequence<com::sun::star::uno::Any>& rArguments)
+ throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::tab::XTabPageModel
+ virtual ::sal_Int16 SAL_CALL getTabPageID() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getEnabled() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTitle( const OUString& _title ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setImageURL( const OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getToolTip() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setToolTip( const OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ void startControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel );
+ void stopControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel );
+
+ void implNotifyTabModelChange( const OUString& _rAccessor );
+
+ void implUpdateGroupStructure();
+};
+
+class ResourceListener :public ::com::sun::star::util::XModifyListener,
+ public ::cppu::OWeakObject,
+ public ::cppu::BaseMutex
+{
+ public:
+ ResourceListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& xListener );
+ virtual ~ResourceListener();
+
+ void startListening( const ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver >& rResource );
+ void stopListening();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver > m_xResource;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xListener;
+ bool m_bListening;
+};
+
+typedef ::cppu::AggImplInheritanceHelper3 < UnoControlContainer
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::util::XChangesListener
+ , ::com::sun::star::util::XModifyListener
+ > ContainerControl_IBase;
+
+class ControlContainerBase : public ContainerControl_IBase
+{
+ ::Size ImplGetSizePixel( const ::Size& inSize );
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ bool mbSizeModified;
+ bool mbPosModified;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > mxTabController;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > mxListener;
+
+ void ImplInsertControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel, const OUString& rName );
+ void ImplRemoveControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel );
+ virtual void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl );
+ void ImplUpdateResourceResolver();
+ void ImplStartListingForResourceEvents();
+
+#ifdef _MSC_VER
+ // just implemented to let the various FooImplInheritanceHelper compile
+ ControlContainerBase();
+#endif
+
+public:
+ ControlContainerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ ~ControlContainerBase();
+
+ DECLIMPL_SERVICEINFO_DERIVED( ControlContainerBase, UnoControlBase, "toolkit.ControlContainerBase" )
+
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XContainerListener
+ void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XChangesListener
+ virtual void SAL_CALL changesOccurred( const ::com::sun::star::util::ChangesEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException);
+ // XModifyListener
+ // Using a dummy/no-op implementation here, not sure if every container control needs
+ // to implement this, certainly Dialog does, lets see about others
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException) {}
+protected:
+ virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void removingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
+ virtual void addingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
+};
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/dialogcontrol.hxx b/include/toolkit/controls/dialogcontrol.hxx
new file mode 100644
index 000000000000..e8b95647c80f
--- /dev/null
+++ b/include/toolkit/controls/dialogcontrol.hxx
@@ -0,0 +1,268 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef TOOLKIT_DIALOG_CONTROL_HXX
+#define TOOLKIT_DIALOG_CONTROL_HXX
+
+#include <toolkit/controls/controlmodelcontainerbase.hxx>
+#include <com/sun/star/awt/XTopWindow.hpp>
+#include <com/sun/star/awt/XDialog2.hpp>
+#include <com/sun/star/awt/XSimpleTabController.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
+#include <com/sun/star/graphic/XGraphicObject.hpp>
+#include "toolkit/helper/servicenames.hxx"
+#include "toolkit/helper/macros.hxx"
+#include <toolkit/controls/unocontrolcontainer.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <list>
+
+// ----------------------------------------------------
+// class UnoControlDialogModel
+// ----------------------------------------------------
+
+class UnoControlDialogModel : public ControlModelContainerBase
+{
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj;
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ // ::cppu::OPropertySetHelper
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+public:
+ UnoControlDialogModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlDialogModel( const UnoControlDialogModel& rModel );
+ ~UnoControlDialogModel();
+
+ UnoControlModel* Clone() const;
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlDialogModel, ControlModelContainerBase, szServiceName2_UnoControlDialogModel )
+
+};
+
+typedef ::cppu::AggImplInheritanceHelper3 < ControlContainerBase
+ , ::com::sun::star::awt::XTopWindow
+ , ::com::sun::star::awt::XDialog2
+ , ::com::sun::star::awt::XWindowListener
+ > UnoDialogControl_Base;
+class UnoDialogControl : public UnoDialogControl_Base
+{
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar > mxMenuBar;
+ TopWindowListenerMultiplexer maTopWindowListeners;
+ bool mbWindowListener;
+
+public:
+
+ UnoDialogControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ ~UnoDialogControl();
+ OUString GetComponentServiceName();
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTopWindow
+ void SAL_CALL addTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL toFront( ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL toBack( ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMenuBar( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar >& xMenu ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XWindowListener
+ virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDialog2
+ virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpId( const OUString& Id ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDialog
+ void SAL_CALL setTitle( const OUString& Title ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL execute() throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL endExecute() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO( UnoDialogControl, szServiceName2_UnoControlDialog )
+
+protected:
+ virtual void PrepareWindowDescriptor( ::com::sun::star::awt::WindowDescriptor& rDesc );
+ virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
+protected:
+};
+
+class UnoMultiPageModel : public ControlModelContainerBase
+{
+public:
+ UnoMultiPageModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ ~UnoMultiPageModel();
+ UnoMultiPageModel( const UnoMultiPageModel& rModel );
+
+ UnoControlModel* Clone() const;
+
+ DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageModel, ControlModelContainerBase, szServiceName_UnoMultiPageModel )
+
+ virtual OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw( ::com::sun::star::uno::RuntimeException);
+ // XNamedContainer
+ void SAL_CALL insertByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // Override the method of parent Class
+ virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException);
+protected:
+ virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+};
+
+class UnoMultiPageControl : public ControlContainerBase
+ ,public ::com::sun::star::awt::XSimpleTabController
+ ,public ::com::sun::star::awt::XTabListener
+{
+ TabListenerMultiplexer maTabListeners;
+ void bindPage( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
+public:
+ UnoMultiPageControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ ~UnoMultiPageControl();
+ OUString GetComponentServiceName();
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageControl, ControlContainerBase, szServiceName_UnoMultiPageControl )
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return ControlContainerBase::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ // com::sun::star::awt::XSimpleTabController
+ virtual ::sal_Int32 SAL_CALL insertTab() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setTabProps( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > SAL_CALL getTabProps( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL activateTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getActiveTabID() throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ // XTabListener
+ virtual void SAL_CALL inserted( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removed( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL changed( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL activated( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deactivated( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& evt ) throw (::com::sun::star::uno::RuntimeException);
+ // XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+protected:
+ virtual void impl_createControlPeerIfNecessary(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl
+ );
+
+};
+
+
+class UnoPageModel : public ControlModelContainerBase
+{
+public:
+ UnoPageModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ ~UnoPageModel();
+ UnoPageModel( const UnoPageModel& rModel );
+
+ UnoControlModel* Clone() const;
+
+ DECLIMPL_SERVICEINFO_DERIVED( UnoPageModel, ControlModelContainerBase, szServiceName_UnoPageModel )
+
+ virtual OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw( ::com::sun::star::uno::RuntimeException);
+
+ // Override the method of parent Class
+ virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException);
+protected:
+ virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+};
+
+class UnoPageControl : public ControlContainerBase
+{
+public:
+ UnoPageControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ ~UnoPageControl();
+ OUString GetComponentServiceName();
+
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoPageControl, ControlContainerBase, szServiceName_UnoPageControl )
+};
+
+class UnoFrameModel : public ControlModelContainerBase
+{
+public:
+ UnoFrameModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ ~UnoFrameModel();
+ UnoFrameModel( const UnoFrameModel& rModel );
+
+ UnoControlModel* Clone() const;
+
+ DECLIMPL_SERVICEINFO_DERIVED( UnoFrameModel, ControlModelContainerBase, szServiceName_UnoFrameModel )
+
+ virtual OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw( ::com::sun::star::uno::RuntimeException);
+
+protected:
+ virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+};
+
+class UnoFrameControl : public ControlContainerBase
+{
+protected:
+ virtual void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl );
+public:
+ UnoFrameControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ ~UnoFrameControl();
+ OUString GetComponentServiceName();
+
+// ::com::sun::star::lang::XServiceInfo
+DECLIMPL_SERVICEINFO_DERIVED( UnoFrameControl, ControlContainerBase, szServiceName_UnoPageControl )
+};
+
+#endif // TOOLKIT_DIALOG_CONTROL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/eventcontainer.hxx b/include/toolkit/controls/eventcontainer.hxx
new file mode 100644
index 000000000000..800ccdf35646
--- /dev/null
+++ b/include/toolkit/controls/eventcontainer.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 .
+ */
+
+
+#include <osl/diagnose.h>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/XContainer.hpp>
+
+#include <toolkit/helper/listenermultiplexer.hxx>
+
+#include <boost/unordered_map.hpp>
+#include <cppuhelper/implbase2.hxx>
+typedef ::cppu::WeakImplHelper2< ::com::sun::star::container::XNameContainer,
+ ::com::sun::star::container::XContainer > NameContainerHelper;
+
+
+namespace toolkit
+{
+
+// Hashtable to optimize
+struct hashName_Impl
+{
+ size_t operator()(const OUString Str) const
+ {
+ return (size_t)Str.hashCode();
+ }
+};
+
+struct eqName_Impl
+{
+ sal_Bool operator()(const OUString Str1, const OUString Str2) const
+ {
+ return ( Str1 == Str2 );
+ }
+};
+
+typedef boost::unordered_map
+<
+ OUString,
+ sal_Int32,
+ hashName_Impl,
+ eqName_Impl
+>
+NameContainerNameMap;
+
+
+class NameContainer_Impl : public NameContainerHelper
+{
+ NameContainerNameMap mHashMap;
+ ::com::sun::star::uno::Sequence< OUString > mNames;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > mValues;
+ sal_Int32 mnElementCount;
+ ::com::sun::star::uno::Type mType;
+
+ ContainerListenerMultiplexer maContainerListeners;
+
+public:
+ NameContainer_Impl( ::com::sun::star::uno::Type const & aType )
+ : mnElementCount( 0 ),
+ mType( aType ),
+ maContainerListeners( *this )
+ {
+ }
+
+ // Methods XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements( )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // Methods XNameAccess
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
+ throw(::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // Methods XNameReplace
+ virtual void SAL_CALL replaceByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement )
+ throw(::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // Methods XNameContainer
+ virtual void SAL_CALL insertByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement )
+ throw(::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::ElementExistException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByName( const OUString& Name )
+ throw(::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // Methods XContainer
+ void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener )
+ throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener )
+ throw(::com::sun::star::uno::RuntimeException);
+};
+
+class ScriptEventContainer : public NameContainer_Impl
+{
+public:
+ ScriptEventContainer( void );
+};
+
+
+} // namespace toolkit_namecontainer
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/formattedcontrol.hxx b/include/toolkit/controls/formattedcontrol.hxx
new file mode 100644
index 000000000000..ff5c5de51618
--- /dev/null
+++ b/include/toolkit/controls/formattedcontrol.hxx
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef TOOLKIT_FORMATTED_CONTROL_HXX
+#define TOOLKIT_FORMATTED_CONTROL_HXX
+
+#include <toolkit/controls/unocontrols.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/servicenames.hxx>
+
+#include <com/sun/star/util/XNumberFormatter.hpp>
+
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ // ===================================================================
+ // = UnoControlFormattedFieldModel
+ // ===================================================================
+ class UnoControlFormattedFieldModel : public UnoControlModel
+ {
+ protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ ::com::sun::star::uno::Any m_aCachedFormat;
+ bool m_bRevokedAsClient;
+ bool m_bSettingValueAndText;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >
+ m_xCachedFormatter;
+
+ protected:
+ sal_Bool SAL_CALL convertFastPropertyValue(
+ ::com::sun::star::uno::Any& rConvertedValue,
+ ::com::sun::star::uno::Any& rOldValue,
+ sal_Int32 nPropId,
+ const ::com::sun::star::uno::Any& rValue
+ ) throw (::com::sun::star::lang::IllegalArgumentException);
+
+ void SAL_CALL setFastPropertyValue_NoBroadcast(
+ sal_Int32 nHandle,
+ const ::com::sun::star::uno::Any& rValue
+ ) throw (::com::sun::star::uno::Exception);
+
+ public:
+ UnoControlFormattedFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel )
+ :UnoControlModel( rModel )
+ {
+ }
+
+ UnoControlModel* Clone() const { return new UnoControlFormattedFieldModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlFormattedFieldModel, UnoControlModel, szServiceName2_UnoControlFormattedFieldModel )
+
+ protected:
+ ~UnoControlFormattedFieldModel();
+
+ // XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPropertySet
+ void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& PropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Values ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // UnoControlModel
+ virtual void ImplNormalizePropertySequence(
+ const sal_Int32 _nCount, /// the number of entries in the arrays
+ sal_Int32* _pHandles, /// the handles of the properties to set
+ ::com::sun::star::uno::Any* _pValues, /// the values of the properties to set
+ sal_Int32* _pValidHandles /// pointer to the valid handles, allowed to be adjusted
+ ) const SAL_THROW(());
+ private:
+ void impl_updateTextFromValue_nothrow();
+ void impl_updateCachedFormatter_nothrow();
+ void impl_updateCachedFormatKey_nothrow();
+ };
+
+ // ===================================================================
+ // = UnoFormattedFieldControl
+ // ===================================================================
+ class UnoFormattedFieldControl : public UnoSpinFieldControl
+ {
+ public:
+ UnoFormattedFieldControl();
+ OUString GetComponentServiceName();
+
+ // ::com::sun::star::awt::XTextListener
+ void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoFormattedFieldControl, UnoEditControl, szServiceName2_UnoControlFormattedField )
+ };
+
+//........................................................................
+} // namespace toolkit
+//........................................................................
+
+#endif // TOOLKIT_FORMATTED_CONTROL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/geometrycontrolmodel.hxx b/include/toolkit/controls/geometrycontrolmodel.hxx
new file mode 100644
index 000000000000..2ed98907f796
--- /dev/null
+++ b/include/toolkit/controls/geometrycontrolmodel.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 _TOOLKIT_HELPERS_GEOMETRYCONTROLMODEL_HXX_
+#define _TOOLKIT_HELPERS_GEOMETRYCONTROLMODEL_HXX_
+
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/propagg.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/propertycontainer.hxx>
+#include <cppuhelper/weakagg.hxx>
+#include <cppuhelper/compbase2.hxx>
+#include <com/sun/star/util/XCloneable.hpp>
+#include <com/sun/star/script/XScriptEventsSupplier.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
+#include <cppuhelper/typeprovider.hxx>
+#include <comphelper/IdPropArrayHelper.hxx>
+#include <comphelper/stl_types.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace lang {
+ class XMultiServiceFactory;
+ }
+ namespace script {
+ class XNameContainer;
+ }
+}}}
+
+//........................................................................
+// namespace toolkit
+// {
+//........................................................................
+
+ //====================================================================
+ //= OGeometryControlModel_Base
+ //====================================================================
+ typedef ::cppu::WeakAggComponentImplHelper2 < ::com::sun::star::util::XCloneable
+ , ::com::sun::star::script::XScriptEventsSupplier
+ > OGCM_Base;
+ class OGeometryControlModel_Base
+ :public ::comphelper::OMutexAndBroadcastHelper
+ ,public ::comphelper::OPropertySetAggregationHelper
+ ,public ::comphelper::OPropertyContainer
+ ,public OGCM_Base
+ {
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >
+ m_xAggregate;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ mxEventContainer;
+
+ // <properties>
+ sal_Int32 m_nPosX;
+ sal_Int32 m_nPosY;
+ sal_Int32 m_nWidth;
+ sal_Int32 m_nHeight;
+ OUString m_aName;
+ sal_Int16 m_nTabIndex;
+ sal_Int32 m_nStep;
+ OUString m_aTag;
+ ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver > m_xStrResolver;
+ // </properties>
+
+ sal_Bool m_bCloneable;
+
+ protected:
+ virtual ::com::sun::star::uno::Any ImplGetDefaultValueByHandle(sal_Int32 nHandle) const;
+ virtual ::com::sun::star::uno::Any ImplGetPropertyValueByHandle(sal_Int32 nHandle) const;
+ virtual void ImplSetPropertyValueByHandle(sal_Int32 nHandle, const :: com::sun::star::uno::Any& aValue);
+
+ protected:
+ /**
+ @param _pAggregateInstance
+ the object to be aggregated. The refcount of the instance given MUST be 0!
+ */
+ OGeometryControlModel_Base(::com::sun::star::uno::XAggregation* _pAggregateInstance);
+
+ /**
+ @param _rxAggregateInstance
+ is the object to be aggregated. Must be aquired excatly once (by the reference object given).<br/>
+ Will be reset to NULL upon leaving
+ */
+ OGeometryControlModel_Base(::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance);
+
+ /** releases the aggregation
+ <p>Can be used if in a derived class, an exception has to be thrown after this base class here already
+ did the aggregation</p>
+ */
+ void releaseAggregation();
+
+ protected:
+ ~OGeometryControlModel_Base();
+
+ // XAggregation
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _aType ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire( ) throw();
+ virtual void SAL_CALL release( ) throw();
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // OPropertySetHelper overridables
+ virtual sal_Bool SAL_CALL convertFastPropertyValue(
+ ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue,
+ sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue )
+ throw (::com::sun::star::lang::IllegalArgumentException);
+
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
+ sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue)
+ throw (::com::sun::star::uno::Exception);
+
+ using comphelper::OPropertySetAggregationHelper::getFastPropertyValue;
+ virtual void SAL_CALL getFastPropertyValue(
+ ::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle) const;
+
+ // OPropertyStateHelper overridables
+ virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle);
+ virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle);
+ virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const;
+
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
+
+ // OPropertySetAggregationHelper overridables
+ using OPropertySetAggregationHelper::getInfoHelper;
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw(::com::sun::star::uno::RuntimeException);
+
+ //XScriptEventsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ SAL_CALL getEvents( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XCloneable implementation - to be overwritten
+ virtual OGeometryControlModel_Base* createClone_Impl(
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance) = 0;
+
+ // XComponent
+ using comphelper::OPropertySetAggregationHelper::disposing;
+ virtual void SAL_CALL disposing();
+
+ private:
+ void registerProperties();
+ };
+
+ //====================================================================
+ //= OTemplateInstanceDisambiguation
+ //====================================================================
+ template <class CONTROLMODEL>
+ class OTemplateInstanceDisambiguation
+ {
+ };
+
+ //====================================================================
+ //= OGeometryControlModel
+ //====================================================================
+ /* example for usage:
+ Reference< XAggregation > xIFace = new ::toolkit::OGeometryControlModel< UnoControlButtonModel > ();
+ */
+ template <class CONTROLMODEL>
+ class OGeometryControlModel
+ :public OGeometryControlModel_Base
+ ,public ::comphelper::OAggregationArrayUsageHelper< OTemplateInstanceDisambiguation< CONTROLMODEL > >
+ {
+ public:
+ OGeometryControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory );
+
+ private:
+ OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance);
+
+ protected:
+ // OAggregationArrayUsageHelper overridables
+ virtual void fillProperties(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& _rProps,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& _rAggregateProps
+ ) const;
+
+ // OPropertySetAggregationHelper overridables
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ // OGeometryControlModel_Base
+ virtual OGeometryControlModel_Base* createClone_Impl(
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance);
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException);
+ };
+
+ //====================================================================
+ //= OCommonGeometryControlModel
+ //====================================================================
+ /** allows to extend an arbitrary <type scope="com.sun.star.awt">UnoControlModel</type> with geometry
+ information.
+ */
+ class OCommonGeometryControlModel
+ :public OGeometryControlModel_Base
+ ,public ::comphelper::OIdPropertyArrayUsageHelper< OCommonGeometryControlModel >
+ {
+ private:
+ OUString m_sServiceSpecifier; // the service specifier of our aggregate
+ sal_Int32 m_nPropertyMapId; // our unique property info id, used to look up in s_aAggregateProperties
+
+ public:
+ /** instantiate the model
+
+ @param _rxAgg
+ the instance to aggregate. Must support the <type scope="com.sun.star.awt">UnoControlModel</type>
+ (this is not checked here)
+ */
+ OCommonGeometryControlModel(
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAgg,
+ const OUString& _rxServiceSpecifier
+ );
+
+ // OIdPropertyArrayUsageHelper overridables
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const;
+
+ // OPropertySetAggregationHelper overridables
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ // OGeometryControlModel_Base
+ virtual OGeometryControlModel_Base* createClone_Impl(
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance);
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
+ sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue)
+ throw (::com::sun::star::uno::Exception);
+ };
+
+#include "toolkit/controls/geometrycontrolmodel_impl.hxx"
+
+//........................................................................
+// } // namespace toolkit
+//........................................................................
+
+#endif // _TOOLKIT_HELPERS_GEOMETRYCONTROLMODEL_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/geometrycontrolmodel_impl.hxx b/include/toolkit/controls/geometrycontrolmodel_impl.hxx
new file mode 100644
index 000000000000..658c7410c910
--- /dev/null
+++ b/include/toolkit/controls/geometrycontrolmodel_impl.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 .
+ */
+
+// no include protection. This is included from within geometrycontrolmodel.hxx only
+
+//====================================================================
+//= OGeometryControlModel
+//====================================================================
+//--------------------------------------------------------------------
+template <class CONTROLMODEL>
+OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory )
+ :OGeometryControlModel_Base(new CONTROLMODEL( i_factory ) )
+{
+}
+
+//--------------------------------------------------------------------
+template <class CONTROLMODEL>
+OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance)
+ :OGeometryControlModel_Base(_rxAggregateInstance)
+{
+}
+
+//--------------------------------------------------------------------
+template <class CONTROLMODEL>
+::cppu::IPropertyArrayHelper& SAL_CALL OGeometryControlModel<CONTROLMODEL>::getInfoHelper()
+{
+ return *this->getArrayHelper();
+}
+
+//--------------------------------------------------------------------
+template <class CONTROLMODEL>
+void OGeometryControlModel<CONTROLMODEL>::fillProperties(::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& _rProps, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& _rAggregateProps) const
+{
+ // our own properties
+ OPropertyContainer::describeProperties(_rProps);
+ // the aggregate properties
+ if (m_xAggregateSet.is())
+ _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
+}
+
+//--------------------------------------------------------------------
+template <class CONTROLMODEL>
+::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL OGeometryControlModel<CONTROLMODEL>::getImplementationId( ) throw (::com::sun::star::uno::RuntimeException)
+{
+ static ::cppu::OImplementationId * pId = NULL;
+ if ( !pId )
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if ( !pId )
+ {
+ static ::cppu::OImplementationId s_aId;
+ pId = &s_aId;
+ }
+ }
+ return pId->getImplementationId();
+}
+
+//--------------------------------------------------------------------
+template <class CONTROLMODEL>
+OGeometryControlModel_Base* OGeometryControlModel<CONTROLMODEL>::createClone_Impl(
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance)
+{
+ return new OGeometryControlModel<CONTROLMODEL>(_rxAggregateInstance);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/roadmapcontrol.hxx b/include/toolkit/controls/roadmapcontrol.hxx
new file mode 100644
index 000000000000..1149f00e3056
--- /dev/null
+++ b/include/toolkit/controls/roadmapcontrol.hxx
@@ -0,0 +1,200 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef TOOLKIT_ROADMAP_CONTROL_HXX
+#define TOOLKIT_ROADMAP_CONTROL_HXX
+
+
+#include <toolkit/controls/unocontrols.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <toolkit/controls/roadmapentry.hxx>
+#include <com/sun/star/container/XContainer.hpp>
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include <com/sun/star/awt/XItemListener.hpp>
+#include <com/sun/star/awt/XItemEventBroadcaster.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase4.hxx>
+
+
+#include <comphelper/uno3.hxx>
+
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ typedef GraphicControlModel UnoControlRoadmapModel_Base;
+
+
+ typedef ::cppu::ImplHelper3 < ::com::sun::star::lang::XSingleServiceFactory
+ , ::com::sun::star::container::XContainer
+ , ::com::sun::star::container::XIndexContainer
+ > UnoControlRoadmapModel_IBase;
+
+
+
+ typedef UnoControlBase UnoControlRoadmap_Base;
+ typedef ::cppu::ImplHelper4 < ::com::sun::star::awt::XItemEventBroadcaster
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::awt::XItemListener
+ , ::com::sun::star::beans::XPropertyChangeListener
+ > UnoControlRoadmap_IBase;
+
+
+
+
+ typedef ::cppu::ImplHelper2< ::com::sun::star::container::XContainerListener,
+ ::com::sun::star::awt::XItemEventBroadcaster> SVTXRoadmap_Base;
+
+
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::awt;
+ using namespace ::com::sun::star::lang;
+ using namespace ::com::sun::star::beans;
+ using namespace ::com::sun::star::container;
+
+
+ // ===================================================================
+ // = UnoControlRoadmapModel
+ // ===================================================================
+ class UnoControlRoadmapModel : public UnoControlRoadmapModel_Base,
+ public UnoControlRoadmapModel_IBase
+
+ {
+ private:
+// PropertyChangeListenerMultiplexer maPropertyListeners;
+
+ typedef ::std::vector< Reference< XInterface > > RoadmapItemHolderList;
+
+ ContainerListenerMultiplexer maContainerListeners;
+ RoadmapItemHolderList maRoadmapItems;
+
+ void MakeRMItemValidation( sal_Int32 Index, Reference< XInterface > xRoadmapItem );
+ ContainerEvent GetContainerEvent(sal_Int32 Index, Reference< XInterface > );
+ void SetRMItemDefaultProperties( const sal_Int32 _Index, Reference< XInterface > );
+ sal_Int16 GetCurrentItemID( Reference< XPropertySet > xPropertySet );
+ sal_Int32 GetUniqueID();
+
+
+ protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ public:
+ UnoControlRoadmapModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory );
+ UnoControlRoadmapModel( const UnoControlRoadmapModel& rModel ) :
+ UnoControlRoadmapModel_Base( rModel ),
+ UnoControlRoadmapModel_IBase( rModel ),
+ maContainerListeners( *this ) {}
+ UnoControlModel* Clone() const { return new UnoControlRoadmapModel( *this ); }
+
+
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER( )
+
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlRoadmapModel, UnoControlRoadmapModel_Base, szServiceName2_UnoControlRoadmapModel )
+
+ sal_Int32 SAL_CALL getCount() throw (RuntimeException);
+ virtual Any SAL_CALL getByIndex( sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException );
+
+ virtual void SAL_CALL insertByIndex( sal_Int32 Index, const Any & _Element) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException );
+ virtual void SAL_CALL removeByIndex( sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException );
+ virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const Any & _Element) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException );
+
+ virtual void SAL_CALL addContainerListener( const Reference< XContainerListener >& xListener ) throw (RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const Reference< XContainerListener >& xListener ) throw (RuntimeException);
+
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlRoadmapModel_Base::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { UnoControlRoadmapModel_Base::acquire(); }
+ void SAL_CALL release() throw() { UnoControlRoadmapModel_Base::release(); }
+
+
+ // ::com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException);
+
+
+ virtual Reference< XInterface > SAL_CALL createInstance( ) throw (Exception, RuntimeException);
+ virtual Reference< XInterface > SAL_CALL createInstanceWithArguments( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException);
+
+ virtual Type SAL_CALL getElementType() throw (RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasElements() throw (RuntimeException);
+
+ };
+
+
+ // ===================================================================
+ // = UnoRoadmapControl
+ // ===================================================================
+ class UnoRoadmapControl : public UnoControlRoadmap_Base,
+ public UnoControlRoadmap_IBase
+ {
+ private:
+ ItemListenerMultiplexer maItemListeners;
+ public:
+ UnoRoadmapControl();
+ OUString GetComponentServiceName();
+
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
+
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+
+ sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException );
+
+ void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& rEvent )throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& rEvent )throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& rEvent )throw(::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addItemListener( const Reference< XItemListener >& l ) throw (RuntimeException);
+ virtual void SAL_CALL removeItemListener( const Reference< XItemListener >& l ) throw (RuntimeException);
+
+
+ virtual void SAL_CALL itemStateChanged( const ItemEvent& rEvent ) throw (RuntimeException);
+
+ virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER( )
+ DECLARE_XINTERFACE()
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoRoadmapControl, UnoControlBase, szServiceName2_UnoControlRoadmap )
+ };
+
+//........................................................................
+} // toolkit
+//........................................................................
+
+
+
+#endif // _TOOLKIT_ROADMAP_CONTROL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/roadmapentry.hxx b/include/toolkit/controls/roadmapentry.hxx
new file mode 100644
index 000000000000..d6a7a25be877
--- /dev/null
+++ b/include/toolkit/controls/roadmapentry.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 _TOOLKIT_ROADMAPENTRY_HXX_
+#define _TOOLKIT_ROADMAPENTRY_HXX_
+
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/propertycontainer.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+
+#define RM_PROPERTY_ID_LABEL 1
+#define RM_PROPERTY_ID_ID 2
+#define RM_PROPERTY_ID_ENABLED 4
+#define RM_PROPERTY_ID_INTERACTIVE 5
+
+typedef ::cppu::WeakImplHelper1 < ::com::sun::star::lang::XServiceInfo
+ > ORoadmapEntry_Base;
+
+class ORoadmapEntry :public ORoadmapEntry_Base
+ ,public ::comphelper::OMutexAndBroadcastHelper
+ ,public ::comphelper::OPropertyContainer
+ ,public ::comphelper::OPropertyArrayUsageHelper< ORoadmapEntry >
+{
+
+public:
+ ORoadmapEntry();
+
+protected:
+ DECLARE_XINTERFACE() // merge XInterface implementations
+ DECLARE_XTYPEPROVIDER() // merge XTypeProvider implementations
+
+ /// @see ::com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
+ SAL_CALL getPropertySetInfo()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
+
+ virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
+
+ // other stuff
+ // ...
+ // (e.g. DECLARE_SERVICE_INFO();)
+
+protected:
+ // <properties>
+ OUString m_sLabel;
+ sal_Int32 m_nID;
+ sal_Bool m_bEnabled;
+ sal_Bool m_bInteractive;
+
+ // </properties>
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/spinningprogress.hxx b/include/toolkit/controls/spinningprogress.hxx
new file mode 100644
index 000000000000..819749e0f28e
--- /dev/null
+++ b/include/toolkit/controls/spinningprogress.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 TOOLKIT_SPINNINGPROGRESS_HXX
+#define TOOLKIT_SPINNINGPROGRESS_HXX
+
+#include "toolkit/controls/animatedimages.hxx"
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= SpinningProgressControlModel
+ //==================================================================================================================
+ typedef AnimatedImagesControlModel SpinningProgressControlModel_Base;
+ class SpinningProgressControlModel : public SpinningProgressControlModel_Base
+ {
+ public:
+ SpinningProgressControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & i_factory );
+ SpinningProgressControlModel( const SpinningProgressControlModel& i_copySource );
+
+ virtual UnoControlModel* Clone() const;
+
+ // XPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ protected:
+ ~SpinningProgressControlModel();
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_SPINNINGPROGRESS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/stdtabcontroller.hxx b/include/toolkit/controls/stdtabcontroller.hxx
new file mode 100644
index 000000000000..dd54c9521b47
--- /dev/null
+++ b/include/toolkit/controls/stdtabcontroller.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 _TOOLKIT_CONTROLS_STDTABCONTROLLER_HXX_
+#define _TOOLKIT_CONTROLS_STDTABCONTROLLER_HXX_
+
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/awt/XTabController.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/XControlContainer.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <cppuhelper/weakagg.hxx>
+#include <osl/mutex.hxx>
+#include <toolkit/helper/macros.hxx>
+#include <toolkit/helper/servicenames.hxx>
+
+
+class StdTabController : public ::com::sun::star::awt::XTabController,
+ public ::com::sun::star::lang::XServiceInfo,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::cppu::OWeakAggObject
+{
+private:
+ ::osl::Mutex maMutex;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel > mxModel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > mxControlContainer;
+
+protected:
+ ::osl::Mutex& GetMutex() { return maMutex; }
+ sal_Bool ImplCreateComponentSequence( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > >& rControls, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& rModels, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > >& rComponents, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>* pTabStops, sal_Bool bPeerComponent ) const;
+ // if sequence length of rModels is less than rControls, return only the matching elements in rModels sequence and remove corresponding elements from rControls
+ void ImplActivateControl( sal_Bool bFirst ) const;
+
+public:
+ StdTabController();
+ ~StdTabController();
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > FindControl( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > >& rCtrls, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & rxCtrlModel );
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return OWeakAggObject::queryInterface(rType); }
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // XTabController
+ void SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel > SAL_CALL getModel( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& Container ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > SAL_CALL getContainer( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > SAL_CALL getControls( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL autoTabOrder( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL activateTabOrder( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL activateFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL activateLast( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO( StdTabController, szServiceName2_TabController )
+};
+
+
+
+#endif // _TOOLKIT_AWT_STDTABCONTROLLER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/stdtabcontrollermodel.hxx b/include/toolkit/controls/stdtabcontrollermodel.hxx
new file mode 100644
index 000000000000..06134170e556
--- /dev/null
+++ b/include/toolkit/controls/stdtabcontrollermodel.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 _TOOLKIT_CONTROLS_STDTABCONTROLLERMODEL_HXX_
+#define _TOOLKIT_CONTROLS_STDTABCONTROLLERMODEL_HXX_
+
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/io/XPersistObject.hpp>
+#include <com/sun/star/awt/XTabControllerModel.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <cppuhelper/weakagg.hxx>
+#include <toolkit/helper/macros.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <osl/mutex.hxx>
+
+#include <tools/gen.hxx>
+#include <vector>
+
+struct UnoControlModelEntry;
+typedef ::std::vector< UnoControlModelEntry* > UnoControlModelEntryListBase;
+
+class UnoControlModelEntryList
+{
+private:
+ UnoControlModelEntryListBase maList;
+ OUString maGroupName;
+
+public:
+ UnoControlModelEntryList();
+ ~UnoControlModelEntryList();
+
+ const OUString& GetName() const { return maGroupName; }
+ void SetName( const OUString& rName ) { maGroupName = rName; }
+
+ void Reset();
+ void DestroyEntry( size_t nEntry );
+ size_t size() const;
+ UnoControlModelEntry* operator[]( size_t i ) const;
+ void push_back( UnoControlModelEntry* item );
+ void insert( size_t i, UnoControlModelEntry* item );
+};
+
+struct UnoControlModelEntry
+{
+ sal_Bool bGroup;
+ union
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >* pxControl;
+ UnoControlModelEntryList* pGroup;
+ };
+};
+
+struct ComponentEntry
+{
+ ::com::sun::star::awt::XWindow* pComponent;
+ Point aPos;
+};
+
+typedef ::std::vector< ComponentEntry* > ComponentEntryList;
+
+#define CONTROLPOS_NOTFOUND 0xFFFFFFFF
+
+class StdTabControllerModel : public ::com::sun::star::awt::XTabControllerModel,
+ public ::com::sun::star::lang::XServiceInfo,
+ public ::com::sun::star::io::XPersistObject,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::cppu::OWeakAggObject
+{
+private:
+ ::osl::Mutex maMutex;
+ UnoControlModelEntryList maControls;
+ sal_Bool mbGroupControl;
+
+protected:
+ ::osl::Mutex& GetMutex() { return maMutex; }
+ sal_uInt32 ImplGetControlCount( const UnoControlModelEntryList& rList ) const;
+ void ImplGetControlModels( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > ** pRefs, const UnoControlModelEntryList& rList ) const;
+ void ImplSetControlModels( UnoControlModelEntryList& rList, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Controls ) const;
+ sal_uInt32 ImplGetControlPos( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > xCtrl, const UnoControlModelEntryList& rList ) const;
+
+public:
+ StdTabControllerModel();
+ ~StdTabControllerModel();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return OWeakAggObject::queryInterface(rType); }
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTabControllerModel
+ sal_Bool SAL_CALL getGroupControl( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setGroupControl( sal_Bool GroupControl ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setControlModels( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Controls ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > SAL_CALL getControlModels( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setGroup( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, const OUString& GroupName ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getGroupCount( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL getGroup( sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, OUString& Name ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL getGroupByName( const OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL write( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream >& OutStream ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL read( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream >& InStream ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO( StdTabControllerModel, szServiceName2_TabControllerModel )
+};
+
+
+
+#endif // _TOOLKIT_HELPER_STDTABCONTROLLERMODEL_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/tabpagecontainer.hxx b/include/toolkit/controls/tabpagecontainer.hxx
new file mode 100644
index 000000000000..622da638f851
--- /dev/null
+++ b/include/toolkit/controls/tabpagecontainer.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 TOOLKIT_TABPAGE_CONTAINER_HXX
+#define TOOLKIT_TABPAGE_CONTAINER_HXX
+
+#include <com/sun/star/awt/tab/XTabPageContainer.hpp>
+#include <com/sun/star/awt/tab/XTabPageContainerModel.hpp>
+#include <com/sun/star/awt/tab/XTabPageContainerListener.hpp>
+#include <com/sun/star/awt/tab/XTabPage.hpp>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <toolkit/controls/unocontrolbase.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/sequence.hxx>
+#include <toolkit/controls/controlmodelcontainerbase.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+
+// ------------------------------------------------------------------
+// class ::com::sun::star::awt::tab::UnoControlTabPageContainerModel
+// ------------------------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
+ , ::com::sun::star::awt::tab::XTabPageContainerModel
+ > UnoControlTabPageContainerModel_Base;
+class UnoControlTabPageContainerModel : public UnoControlTabPageContainerModel_Base
+{
+private:
+ std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageModel > > m_aTabPageVector;
+ ContainerListenerMultiplexer maContainerListeners;
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+public:
+ UnoControlTabPageContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory );
+ UnoControlTabPageContainerModel( const UnoControlTabPageContainerModel& rModel ) : UnoControlTabPageContainerModel_Base( rModel ),maContainerListeners( *this ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlTabPageContainerModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageContainerModel, UnoControlModel, szServiceName_UnoControlTabPageContainerModel )
+
+ // XTabPageContainerModel
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageModel > SAL_CALL createTabPage( ::sal_Int16 TabPageID ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageModel > SAL_CALL loadTabPage( ::sal_Int16 TabPageID, const OUString& ResourceURL ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XIndexContainer
+ virtual void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByIndex( sal_Int32 Index )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexReplace
+ virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XContainer
+ void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+};
+// ===================================================================
+// = UnoControlTabPageContainer
+// ===================================================================
+typedef ::cppu::AggImplInheritanceHelper1 < ControlContainerBase
+ , ::com::sun::star::awt::tab::XTabPageContainer
+ > UnoControlTabPageContainer_Base;
+class UnoControlTabPageContainer : public UnoControlTabPageContainer_Base
+{
+public:
+ UnoControlTabPageContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ OUString GetComponentServiceName();
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::tab::XTabPageContainer
+ virtual ::sal_Int16 SAL_CALL getActiveTabPageID() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getTabPageCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isTabPageActive( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPage( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPageByID( ::sal_Int16 tabPageID ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addTabPageContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeTabPageContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addControl( const OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& Control ) throw (::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageContainer, UnoControlBase, szServiceName_UnoControlTabPageContainer )
+
+// using UnoControl::getPeer;
+protected:
+ virtual void updateFromModel();
+private:
+ TabPageListenerMultiplexer m_aTabPageListeners;
+};
+
+#endif // _TOOLKIT_TABPAGE_CONTAINER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/tabpagemodel.hxx b/include/toolkit/controls/tabpagemodel.hxx
new file mode 100644
index 000000000000..63684751fe4d
--- /dev/null
+++ b/include/toolkit/controls/tabpagemodel.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 TOOLKIT_TABPAGE_MODEL_HXX
+#define TOOLKIT_TABPAGE_MODEL_HXX
+
+#include <toolkit/controls/controlmodelcontainerbase.hxx>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/awt/tab/XTabPage.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include "toolkit/helper/servicenames.hxx"
+#include "toolkit/helper/macros.hxx"
+#include <toolkit/controls/unocontrolcontainer.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <list>
+#include <cppuhelper/implbase2.hxx>
+
+class UnoControlTabPageModel : public ControlModelContainerBase
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+public:
+ UnoControlTabPageModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & i_factory);
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XInitialization
+ virtual void SAL_CALL initialize (const com::sun::star::uno::Sequence<com::sun::star::uno::Any>& rArguments)
+ throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageModel, ControlModelContainerBase, szServiceName_UnoControlTabPageModel )
+
+};
+
+// ----------------------------------------------------
+// class UnoTabPageControl
+// ----------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper2 < ControlContainerBase
+ , ::com::sun::star::awt::tab::XTabPage
+ , ::com::sun::star::awt::XWindowListener
+ > UnoControlTabPage_Base;
+class UnoControlTabPage : public UnoControlTabPage_Base
+{
+private:
+ bool m_bWindowListener;
+public:
+
+ UnoControlTabPage( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ ~UnoControlTabPage();
+ OUString GetComponentServiceName();
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XWindowListener
+ virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO( UnoControlTabPage, szServiceName_UnoControlTabPage)
+};
+
+#endif // TOOLKIT_TABPAGE_MODEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/tkscrollbar.hxx b/include/toolkit/controls/tkscrollbar.hxx
new file mode 100644
index 000000000000..b6e59119b2f1
--- /dev/null
+++ b/include/toolkit/controls/tkscrollbar.hxx
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef TOOLKIT_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX
+#define TOOLKIT_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX
+
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <toolkit/controls/unocontrolbase.hxx>
+#include <toolkit/helper/macros.hxx>
+#include <com/sun/star/awt/XScrollBar.hpp>
+#include <com/sun/star/awt/XAdjustmentListener.hpp>
+#include <com/sun/star/awt/AdjustmentType.hpp>
+
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ //====================================================================
+ //= UnoControlScrollBarModel
+ //====================================================================
+ class UnoControlScrollBarModel : public UnoControlModel
+ {
+ protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ public:
+ UnoControlScrollBarModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory );
+ UnoControlScrollBarModel( const UnoControlScrollBarModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlScrollBarModel( *this ); }
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlScrollBarModel, UnoControlModel, szServiceName2_UnoControlScrollBarModel )
+ };
+
+ //====================================================================
+ //= UnoControlScrollBarModel
+ //====================================================================
+ class UnoScrollBarControl : public UnoControlBase,
+ public ::com::sun::star::awt::XAdjustmentListener,
+ public ::com::sun::star::awt::XScrollBar
+ {
+ private:
+ AdjustmentListenerMultiplexer maAdjustmentListeners;
+
+ public:
+ UnoScrollBarControl();
+ OUString GetComponentServiceName();
+
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XAdjustmentListener
+ void SAL_CALL adjustmentValueChanged( const ::com::sun::star::awt::AdjustmentEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XScrollBar
+ void SAL_CALL addAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setValue( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setValues( sal_Int32 nValue, sal_Int32 nVisible, sal_Int32 nMax ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMaximum( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getMaximum( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLineIncrement( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getLineIncrement( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setBlockIncrement( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getBlockIncrement( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setVisibleSize( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getVisibleSize( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setOrientation( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getOrientation( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoScrollBarControl, UnoControlBase, szServiceName2_UnoControlScrollBar )
+ };
+
+
+
+//........................................................................
+} // namespacetoolkit
+//........................................................................
+
+#endif // TOOLKIT_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/tksimpleanimation.hxx b/include/toolkit/controls/tksimpleanimation.hxx
new file mode 100644
index 000000000000..8604097567c3
--- /dev/null
+++ b/include/toolkit/controls/tksimpleanimation.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 TOOLKIT_CONTROLS_TKSIMPLEANIMATION_HXX
+#define TOOLKIT_CONTROLS_TKSIMPLEANIMATION_HXX
+
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <toolkit/controls/unocontrolbase.hxx>
+#include <toolkit/helper/macros.hxx>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/awt/XSimpleAnimation.hpp>
+#include <comphelper/uno3.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ //====================================================================
+ //= UnoSimpleAnimationControlModel
+ //====================================================================
+ class UnoSimpleAnimationControlModel : public UnoControlModel
+ {
+ protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ public:
+ UnoSimpleAnimationControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory );
+ UnoSimpleAnimationControlModel( const UnoSimpleAnimationControlModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoSimpleAnimationControlModel( *this ); }
+
+ // XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ };
+
+ //====================================================================
+ //= UnoSimpleAnimationControl
+ //====================================================================
+
+ typedef ::cppu::AggImplInheritanceHelper1 < UnoControlBase
+ , ::com::sun::star::awt::XSimpleAnimation
+ > UnoSimpleAnimationControl_Base;
+
+ class UnoSimpleAnimationControl : public UnoSimpleAnimationControl_Base
+ {
+ private:
+
+ public:
+ UnoSimpleAnimationControl();
+ OUString GetComponentServiceName();
+
+ // XSimpleAnimation
+ virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setImageList( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& ImageList )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ };
+
+//........................................................................
+} // namespacetoolkit
+//........................................................................
+
+#endif // TOOLKIT_CONTROLS_TKSIMPLEANIMATION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/tkspinbutton.hxx b/include/toolkit/controls/tkspinbutton.hxx
new file mode 100644
index 000000000000..ff134d292a98
--- /dev/null
+++ b/include/toolkit/controls/tkspinbutton.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 TOOLKIT_CONTROLS_TKSPINBUTTON_HXX
+#define TOOLKIT_CONTROLS_TKSPINBUTTON_HXX
+
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <toolkit/controls/unocontrolbase.hxx>
+#include <toolkit/helper/macros.hxx>
+#include <com/sun/star/awt/XSpinValue.hpp>
+#include <com/sun/star/awt/XAdjustmentListener.hpp>
+#include <comphelper/uno3.hxx>
+#include <cppuhelper/implbase2.hxx>
+
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ //====================================================================
+ //= UnoSpinButtonModel
+ //====================================================================
+ class UnoSpinButtonModel : public UnoControlModel
+ {
+ protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ public:
+ UnoSpinButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory );
+ UnoSpinButtonModel( const UnoSpinButtonModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoSpinButtonModel( *this ); }
+
+ // XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ };
+
+ //====================================================================
+ //= UnoSpinButtonControl
+ //====================================================================
+
+ typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XAdjustmentListener
+ , ::com::sun::star::awt::XSpinValue
+ > UnoSpinButtonControl_Base;
+
+ class UnoSpinButtonControl :public UnoControlBase
+ ,public UnoSpinButtonControl_Base
+ {
+ private:
+ AdjustmentListenerMultiplexer maAdjustmentListeners;
+
+ public:
+ UnoSpinButtonControl();
+ OUString GetComponentServiceName();
+
+ DECLARE_UNO3_AGG_DEFAULTS( UnoSpinButtonControl, UnoControlBase );
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER()
+
+ // XAdjustmentListener
+ void SAL_CALL adjustmentValueChanged( const ::com::sun::star::awt::AdjustmentEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XSpinValue
+ virtual void SAL_CALL addAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setValue( sal_Int32 value ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setValues( sal_Int32 minValue, sal_Int32 maxValue, sal_Int32 currentValue ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getValue( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMinimum( sal_Int32 minValue ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMaximum( sal_Int32 maxValue ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getMinimum( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getMaximum( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setSpinIncrement( sal_Int32 spinIncrement ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSpinIncrement( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setOrientation( sal_Int32 orientation ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getOrientation( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ };
+
+
+
+//........................................................................
+} // namespacetoolkit
+//........................................................................
+
+#endif // TOOLKIT_CONTROLS_TKSPINBUTTON_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/tkthrobber.hxx b/include/toolkit/controls/tkthrobber.hxx
new file mode 100644
index 000000000000..24868600aaaf
--- /dev/null
+++ b/include/toolkit/controls/tkthrobber.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 TOOLKIT_CONTROLS_TKTHROBBER_HXX
+#define TOOLKIT_CONTROLS_TKTHROBBER_HXX
+
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <toolkit/controls/unocontrolbase.hxx>
+#include <toolkit/helper/macros.hxx>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/awt/XThrobber.hpp>
+#include <comphelper/uno3.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ //====================================================================
+ //= UnoThrobberControlModel
+ //====================================================================
+ class UnoThrobberControlModel : public UnoControlModel
+ {
+ protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ public:
+ UnoThrobberControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory );
+ UnoThrobberControlModel( const UnoThrobberControlModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoThrobberControlModel( *this ); }
+
+ // XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ };
+
+ //====================================================================
+ //= UnoThrobberControl
+ //====================================================================
+
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XThrobber
+ > UnoThrobberControl_Base;
+
+ class UnoThrobberControl :public UnoControlBase
+ ,public UnoThrobberControl_Base
+ {
+ private:
+
+ public:
+ UnoThrobberControl();
+ OUString GetComponentServiceName();
+
+ DECLARE_UNO3_AGG_DEFAULTS( UnoThrobberControl, UnoControlBase );
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER()
+
+ // XThrobber
+ virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ };
+
+//........................................................................
+} // namespacetoolkit
+//........................................................................
+
+#endif // TOOLKIT_CONTROLS_TKTHROBBER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/unocontrol.hxx b/include/toolkit/controls/unocontrol.hxx
new file mode 100644
index 000000000000..df5806be7e49
--- /dev/null
+++ b/include/toolkit/controls/unocontrol.hxx
@@ -0,0 +1,237 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_CONTROLS_UNOCONTROL_HXX_
+#define _TOOLKIT_CONTROLS_UNOCONTROL_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/XWindow2.hpp>
+#include <com/sun/star/awt/XView.hpp>
+#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/awt/XUnitConversion.hpp>
+#include <com/sun/star/awt/XStyleSettingsSupplier.hpp>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <cppuhelper/weakagg.hxx>
+#include <osl/mutex.hxx>
+#include <toolkit/helper/mutexandbroadcasthelper.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <cppuhelper/implbase9.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <com/sun/star/util/XModeChangeBroadcaster.hpp>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+
+
+struct UnoControlComponentInfos
+{
+ sal_Bool bVisible;
+ sal_Bool bEnable;
+ long nX, nY, nWidth, nHeight;
+ sal_uInt16 nFlags;
+ float nZoomX, nZoomY;
+
+ UnoControlComponentInfos()
+ {
+ bVisible = sal_True;
+ bEnable = sal_True;
+ nX = nY = nWidth = nHeight = 0;
+ nFlags = 0; // POSSIZE_POSSIZE;
+ nZoomX = nZoomY = 1.0f;
+ }
+};
+
+struct UnoControl_Data;
+// ----------------------------------------------------
+// class UnoControl
+// ----------------------------------------------------
+typedef ::cppu::WeakAggImplHelper9 < ::com::sun::star::awt::XControl
+ , ::com::sun::star::awt::XWindow2
+ , ::com::sun::star::awt::XView
+ , ::com::sun::star::beans::XPropertiesChangeListener
+ , ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::accessibility::XAccessible
+ , ::com::sun::star::util::XModeChangeBroadcaster
+ , ::com::sun::star::awt::XUnitConversion
+ , ::com::sun::star::awt::XStyleSettingsSupplier
+ > UnoControl_Base;
+
+class TOOLKIT_DLLPUBLIC UnoControl : public UnoControl_Base
+{
+private:
+ ::osl::Mutex maMutex;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > mxPeer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer > mxVclWindowPeer; // just to avoid the query_interface thing
+
+protected:
+ EventListenerMultiplexer maDisposeListeners;
+ WindowListenerMultiplexer maWindowListeners;
+ FocusListenerMultiplexer maFocusListeners;
+ KeyListenerMultiplexer maKeyListeners;
+ MouseListenerMultiplexer maMouseListeners;
+ MouseMotionListenerMultiplexer maMouseMotionListeners;
+ PaintListenerMultiplexer maPaintListeners;
+ ::cppu::OInterfaceContainerHelper maModeChangeListeners;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > mxModel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > mxGraphics;
+
+ ::com::sun::star::uno::WeakReferenceHelper
+ maAccessibleContext; /// our most recent XAccessibleContext instance
+
+ sal_Bool mbDisposePeer;
+ sal_Bool mbRefeshingPeer;
+ sal_Bool mbCreatingPeer;
+ sal_Bool mbCreatingCompatiblePeer;
+ sal_Bool mbDesignMode;
+
+ UnoControlComponentInfos maComponentInfos;
+ UnoControl_Data* mpData;
+
+ ::osl::Mutex& GetMutex() { return maMutex; }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > getParentPeer() const;
+ virtual void updateFromModel();
+ void peerCreated();
+ bool ImplCheckLocalize( OUString& _rPossiblyLocalizable );
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > ImplGetCompatiblePeer( sal_Bool bAcceptExistingPeer );
+ virtual void ImplSetPeerProperty( const OUString& rPropName, const ::com::sun::star::uno::Any& rVal );
+ virtual void PrepareWindowDescriptor( ::com::sun::star::awt::WindowDescriptor& rDesc );
+ virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents );
+
+ void ImplLockPropertyChangeNotification( const OUString& rPropertyName, bool bLock );
+ void ImplLockPropertyChangeNotifications( const ::com::sun::star::uno::Sequence< OUString >& rPropertyNames, bool bLock );
+
+ void disposeAccessibleContext();
+
+ inline void setPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& _xPeer)
+ {
+ mxPeer = _xPeer;
+ mxVclWindowPeer = ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer >(mxPeer,::com::sun::star::uno::UNO_QUERY); // just to avoid the query_interface thing
+ }
+
+ virtual sal_Bool requiresNewPeer( const OUString& _rPropertyName ) const;
+
+public:
+ UnoControl();
+ ~UnoControl();
+
+ UnoControlComponentInfos& GetComponentInfos() { return maComponentInfos; }
+
+
+ virtual OUString GetComponentServiceName();
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XWindow2
+ virtual void SAL_CALL setOutputSize( const ::com::sun::star::awt::Size& aSize ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL getOutputSize( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isVisible( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isActive( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isEnabled( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasFocus( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XWindow
+ void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Rectangle SAL_CALL getPosSize( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setVisible( sal_Bool Visible ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setEnable( sal_Bool Enable ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFocus( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removePaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XView
+ sal_Bool SAL_CALL setGraphics( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& aDevice ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > SAL_CALL getGraphics( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getSize( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setZoom( float fZoomX, float fZoomY ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ void SAL_CALL setContext( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Context ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getContext( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL getPeer( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XView > SAL_CALL getView( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isDesignMode( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XAccessible
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XModeChangeBroadcaster
+ virtual void SAL_CALL addModeChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModeChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeModeChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModeChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addModeChangeApproveListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModeChangeApproveListener >& _rxListener ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeModeChangeApproveListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModeChangeApproveListener >& _rxListener ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+ // XUnitConversion
+ virtual ::com::sun::star::awt::Point SAL_CALL convertPointToLogic( const ::com::sun::star::awt::Point& Point, ::sal_Int16 TargetUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Point SAL_CALL convertPointToPixel( const ::com::sun::star::awt::Point& aPoint, ::sal_Int16 SourceUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL convertSizeToLogic( const ::com::sun::star::awt::Size& aSize, ::sal_Int16 TargetUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL convertSizeToPixel( const ::com::sun::star::awt::Size& aSize, ::sal_Int16 SourceUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ // XStyleSettingsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleSettings > SAL_CALL getStyleSettings() throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ // ::com::sun::star::beans::XPropertiesChangeListener
+ void SAL_CALL propertiesChange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& evt ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+
+
+#endif // _TOOLKIT_CONTROLS_UNOCONTROL_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/unocontrolbase.hxx b/include/toolkit/controls/unocontrolbase.hxx
new file mode 100644
index 000000000000..30f1bf664206
--- /dev/null
+++ b/include/toolkit/controls/unocontrolbase.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 _TOOLKIT_AWT_UNOCONTROLBASE_HXX_
+#define _TOOLKIT_AWT_UNOCONTROLBASE_HXX_
+
+#include <com/sun/star/awt/Size.hpp>
+
+#include <toolkit/controls/unocontrol.hxx>
+
+// ----------------------------------------------------
+// class UnoControlBase
+// ----------------------------------------------------
+
+class TOOLKIT_DLLPUBLIC UnoControlBase : public UnoControl
+{
+protected:
+ UnoControlBase() :UnoControl() {}
+
+ sal_Bool ImplHasProperty( sal_uInt16 nProp );
+ sal_Bool ImplHasProperty( const OUString& aPropertyName );
+ void ImplSetPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue, sal_Bool bUpdateThis );
+ void ImplSetPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues, sal_Bool bUpdateThis );
+ ::com::sun::star::uno::Any ImplGetPropertyValue( const OUString& aPropertyName );
+
+ sal_Bool ImplGetPropertyValue_BOOL( sal_uInt16 nProp );
+ sal_Int16 ImplGetPropertyValue_INT16( sal_uInt16 nProp );
+ sal_Int32 ImplGetPropertyValue_INT32( sal_uInt16 nProp );
+ double ImplGetPropertyValue_DOUBLE( sal_uInt16 nProp );
+ OUString ImplGetPropertyValue_UString( sal_uInt16 nProp );
+
+ // XLayoutConstrains (nur wenn das Control es unterstuetzt!)
+ ::com::sun::star::awt::Size Impl_getMinimumSize();
+ ::com::sun::star::awt::Size Impl_getPreferredSize();
+ ::com::sun::star::awt::Size Impl_calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize );
+
+ // XTextLayoutConstrains (nur wenn das Control es unterstuetzt!)
+ ::com::sun::star::awt::Size Impl_getMinimumSize( sal_Int16 nCols, sal_Int16 nLines );
+ void Impl_getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines );
+};
+
+
+
+#endif // _TOOLKIT_AWT_UNOCONTROLBASE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/unocontrolcontainer.hxx b/include/toolkit/controls/unocontrolcontainer.hxx
new file mode 100644
index 000000000000..d4595459dfaf
--- /dev/null
+++ b/include/toolkit/controls/unocontrolcontainer.hxx
@@ -0,0 +1,160 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_CONTROLS_UNOCONTROLCONTAINER_HXX_
+#define _TOOLKIT_CONTROLS_UNOCONTROLCONTAINER_HXX_
+
+
+#include <com/sun/star/awt/XControlContainer.hpp>
+#include <com/sun/star/awt/XUnoControlContainer.hpp>
+#include <com/sun/star/container/XContainer.hpp>
+#include <com/sun/star/container/XIdentifierContainer.hpp>
+
+#include <toolkit/controls/unocontrol.hxx>
+#include <toolkit/controls/unocontrolbase.hxx>
+#include <toolkit/helper/macros.hxx>
+#include <toolkit/helper/servicenames.hxx>
+
+#include <cppuhelper/implbase4.hxx>
+
+class UnoControlHolderList;
+
+// ----------------------------------------------------
+// class UnoControlContainer
+// ----------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase
+ , ::com::sun::star::awt::XUnoControlContainer
+ , ::com::sun::star::awt::XControlContainer
+ , ::com::sun::star::container::XContainer
+ , ::com::sun::star::container::XIdentifierContainer
+ > UnoControlContainer_Base;
+
+class UnoControlContainer : public UnoControlContainer_Base
+{
+private:
+ UnoControlHolderList* mpControls;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > > maTabControllers;
+ ContainerListenerMultiplexer maCListeners;
+
+protected:
+ void ImplActivateTabControllers();
+
+public:
+ UnoControlContainer();
+ UnoControlContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xPeer );
+ ~UnoControlContainer();
+
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XEventListener
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XContainer
+ void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XIdentifierContainer
+ virtual ::sal_Int32 SAL_CALL insert( const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XIdentifierReplace
+ virtual void SAL_CALL removeByIdentifier( ::sal_Int32 Identifier ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL replaceByIdentifer( ::sal_Int32 Identifier, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XIdentifierAccess
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIdentifier( ::sal_Int32 Identifierr ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getIdentifiers( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControlContainer
+ void SAL_CALL setStatusText( const OUString& StatusText ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > SAL_CALL getControls( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > SAL_CALL getControl( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addControl( const OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& Control ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& Control ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XUnoControlContainer
+ void SAL_CALL setTabControllers( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > >& TabControllers ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > > SAL_CALL getTabControllers( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addTabController( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController >& TabController ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeTabController( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController >& TabController ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XWindow
+ void SAL_CALL setVisible( sal_Bool Visible ) throw(::com::sun::star::uno::RuntimeException);
+
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlContainer, UnoControlBase, szServiceName2_UnoControlContainer )
+
+protected:
+ virtual void PrepareWindowDescriptor( ::com::sun::star::awt::WindowDescriptor& rDesc );
+ virtual void removingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
+ virtual void addingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
+
+ /** ensures that the given control has a peer, if necessary and possible
+ @param _rxControl
+ an ->XControl which has just been inserted into the container. Must not be <NULL/>.
+ @precond
+ our mutex is locked
+ */
+ virtual void impl_createControlPeerIfNecessary(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl
+ );
+private:
+ /** adds the control to the container, does necessary notifications, and the like
+ @param _rxControl
+ the control to add. Must not be <NULL/>
+ @param _pName
+ Pointer to a name for the control. Might be <NULL/>, in this case an auotmatic name is generated
+ @return
+ the ID of the newly added control
+ */
+ sal_Int32 impl_addControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl,
+ const OUString* _pName = NULL
+ );
+
+ /** removes the given control from the container, including necessary notifications and the like
+ @param _nId
+ the ID of the control to remove
+ @param _rxControl
+ the control itself. Must be the one which is stored under the given ID. This parameter could also be
+ obtained inside the method, but callers usually have obtained it, anyway.
+ @param _pNameAccessor
+ the name which the control was registered for. Might be <NULL/>, in this case
+ container event broadcasts use the ID as accessor.
+ */
+ void impl_removeControl(
+ sal_Int32 _nId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl,
+ const OUString* _pNameAccessor
+ );
+
+};
+
+
+
+#endif // _TOOLKIT_CONTROLS_UNOCONTROLCONTAINER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/unocontrolcontainermodel.hxx b/include/toolkit/controls/unocontrolcontainermodel.hxx
new file mode 100644
index 000000000000..bd5802c3993b
--- /dev/null
+++ b/include/toolkit/controls/unocontrolcontainermodel.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 _TOOLKIT_CONTROLS_UNOCONTROLCONTAINERMODEL_HXX_
+#define _TOOLKIT_CONTROLS_UNOCONTROLCONTAINERMODEL_HXX_
+
+
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/macros.hxx>
+#include <toolkit/helper/servicenames.hxx>
+
+
+// ----------------------------------------------------
+// class ::com::sun::star::awt::UnoControlContainerModel
+// ----------------------------------------------------
+class UnoControlContainerModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > getPropertySetInfo() const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory );
+ UnoControlContainerModel( const UnoControlContainerModel& rModel ) : UnoControlModel( rModel ) {}
+
+ UnoControlModel* Clone() const { return new UnoControlContainerModel( *this ); }
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlContainerModel, UnoControlModel, szServiceName2_UnoControlContainerModel )
+};
+
+
+
+#endif // _TOOLKIT_CONTROLS_UNOCONTROLCONTAINERMODEL_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/unocontrolmodel.hxx b/include/toolkit/controls/unocontrolmodel.hxx
new file mode 100644
index 000000000000..397a4df497c4
--- /dev/null
+++ b/include/toolkit/controls/unocontrolmodel.hxx
@@ -0,0 +1,186 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_AWT_UNOCONTROLMODEL_HXX_
+#define _TOOLKIT_AWT_UNOCONTROLMODEL_HXX_
+
+#include <com/sun/star/awt/XControlModel.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/io/XPersistObject.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
+#include <cppuhelper/weakagg.hxx>
+#include <osl/mutex.hxx>
+
+#include <toolkit/helper/mutexandbroadcasthelper.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+
+#include <cppuhelper/propshlp.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <cppuhelper/implbase7.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/uno3.hxx>
+
+#include <list>
+#include <map>
+
+typedef std::map<sal_uInt16, ::com::sun::star::uno::Any> ImplPropertyTable;
+
+// ----------------------------------------------------
+// class UnoControlModel
+// ----------------------------------------------------
+
+typedef ::cppu::WeakAggImplHelper7 < ::com::sun::star::awt::XControlModel
+ , ::com::sun::star::beans::XPropertyState
+ , ::com::sun::star::io::XPersistObject
+ , ::com::sun::star::lang::XComponent
+ , ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::lang::XUnoTunnel
+ , ::com::sun::star::util::XCloneable
+ > UnoControlModel_Base;
+
+class TOOLKIT_DLLPUBLIC UnoControlModel :public UnoControlModel_Base
+ ,public MutexAndBroadcastHelper
+ ,public ::cppu::OPropertySetHelper
+{
+private:
+ ImplPropertyTable maData;
+ EventListenerMultiplexer maDisposeListeners;
+
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+
+protected:
+ void ImplRegisterProperty( sal_uInt16 nPropType );
+ void ImplRegisterProperties( const std::list< sal_uInt16 > &rIds );
+ void ImplRegisterProperty( sal_uInt16 nPropId, const ::com::sun::star::uno::Any& rDefault );
+ ::com::sun::star::uno::Sequence<sal_Int32> ImplGetPropertyIds() const;
+ virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ sal_Bool ImplHasProperty( sal_uInt16 nPropId ) const;
+
+ /** called before setting multiple properties, allows to care for property dependencies
+
+ <p>When multiple property values are set (e.g. XPropertySet::setPropertyValues), it may happen that some
+ of them are dependent. For this, derivees which know such dependencies can affect the order in which
+ the properties are internally really set.</p>
+ */
+ virtual void ImplNormalizePropertySequence(
+ const sal_Int32 _nCount, /// the number of entries in the arrays
+ sal_Int32* _pHandles, /// the handles of the properties to set
+ ::com::sun::star::uno::Any* _pValues, /// the values of the properties to set
+ sal_Int32* _pValidHandles /// pointer to the valid handles, allowed to be adjusted
+ ) const SAL_THROW(());
+
+ /// ensures that two property values in a sequence have a certain order
+ void ImplEnsureHandleOrder(
+ const sal_Int32 _nCount, /// number of entries in the array
+ sal_Int32* _pHandles, /// pointer to the handles
+ ::com::sun::star::uno::Any* _pValues, /// pointer to the values
+ sal_Int32 _nFirstHandle, /// first handle, which should precede _nSecondHandle in the sequence
+ sal_Int32 _nSecondHandle /// second handle, which should supersede _nFirstHandle in the sequence
+ ) const;
+
+protected:
+#ifdef _MSC_VER
+ UnoControlModel() //do not use! needed by MSVC at compile time to satisfy WeakAggImplHelper7
+ : UnoControlModel_Base()
+ , MutexAndBroadcastHelper()
+ , OPropertySetHelper( BrdcstHelper )
+ , maDisposeListeners( *this )
+ , m_xContext( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >() )
+ {
+ assert(false);
+ }
+#endif
+
+public:
+ UnoControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlModel( const UnoControlModel& rModel );
+
+ virtual UnoControlModel* Clone() const = 0;
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return OWeakAggObject::queryInterface(rType); }
+ void SAL_CALL acquire() throw();
+ void SAL_CALL release() throw();
+
+ // ::com::sun::star::uno::XAggregation
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XUnoTunnel
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
+ sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::util::XCloneable
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ DECLARE_XTYPEPROVIDER()
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XPropertyState
+ ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL write( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream >& OutStream ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL read( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream >& InStream ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::cppu::OPropertySetHelper
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() = 0;
+ sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::lang::IllegalArgumentException);
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+ using cppu::OPropertySetHelper::getFastPropertyValue;
+ void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
+
+ // setValue-Methoden ueberladen, um die Einzelproperties des FontDescriptors abzufangen
+ // ::com::sun::star::beans::XPropertySet
+ void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::beans::XFastPropertySet
+ void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& PropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Values ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+};
+
+#define UNO_CONTROL_MODEL_REGISTER_PROPERTIES(a) \
+ do { \
+ std::list< sal_uInt16 > aIds; \
+ a::ImplGetPropertyIds( aIds ); \
+ ImplRegisterProperties( aIds ); \
+ } while (0)
+
+#endif // _TOOLKIT_AWT_UNOCONTROLMODEL_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/controls/unocontrols.hxx b/include/toolkit/controls/unocontrols.hxx
new file mode 100644
index 000000000000..0d3119fd8025
--- /dev/null
+++ b/include/toolkit/controls/unocontrols.hxx
@@ -0,0 +1,1518 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_HELPER_UNOCONTROLS_HXX_
+#define _TOOLKIT_HELPER_UNOCONTROLS_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/awt/XTextComponent.hpp>
+#include <com/sun/star/awt/XTextListener.hpp>
+#include <com/sun/star/awt/XLayoutConstrains.hpp>
+#include <com/sun/star/awt/XTextLayoutConstrains.hpp>
+#include <com/sun/star/awt/XButton.hpp>
+#include <com/sun/star/awt/XToggleButton.hpp>
+#include <com/sun/star/awt/XRadioButton.hpp>
+#include <com/sun/star/awt/XItemListener.hpp>
+#include <com/sun/star/awt/XCheckBox.hpp>
+#include <com/sun/star/awt/XFixedHyperlink.hpp>
+#include <com/sun/star/awt/XFixedText.hpp>
+#include <com/sun/star/awt/XListBox.hpp>
+#include <com/sun/star/awt/XComboBox.hpp>
+#include <com/sun/star/awt/XDateField.hpp>
+#include <com/sun/star/awt/XSpinField.hpp>
+#include <com/sun/star/awt/XTimeField.hpp>
+#include <com/sun/star/awt/XNumericField.hpp>
+#include <com/sun/star/awt/XCurrencyField.hpp>
+#include <com/sun/star/awt/XPatternField.hpp>
+#include <com/sun/star/awt/XProgressBar.hpp>
+#include <com/sun/star/awt/XItemList.hpp>
+#include <com/sun/star/graphic/XGraphicObject.hpp>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/controls/unocontrolbase.hxx>
+#include <toolkit/helper/macros.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <vcl/bitmapex.hxx>
+#include <cppuhelper/implbase5.hxx>
+#include <cppuhelper/implbase4.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/uno3.hxx>
+
+#include <list>
+#include <vector>
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/optional.hpp>
+
+#define UNO_NAME_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:"
+#define UNO_NAME_GRAPHOBJ_URLPKGPREFIX "vnd.sun.star.Package:"
+
+class ImageHelper
+{
+public:
+ // The routine will always attempt to return a valid XGraphic for the
+ // passed _rURL, additionallly xOutGraphicObject will contain the
+ // associated XGraphicObject ( if url is valid for that ) and is set
+ // appropriately ( e.g. NULL if non GraphicObject scheme ) or a valid
+ // object if the rURL points to a valid object
+ static ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > getGraphicAndGraphicObjectFromURL_nothrow( ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject >& xOutGraphicObject, const OUString& _rURL );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > getGraphicFromURL_nothrow( const OUString& _rURL );
+
+};
+
+// ----------------------------------------------------
+// class UnoControlEditModel
+// ----------------------------------------------------
+class UnoControlEditModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlEditModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlEditModel( const UnoControlEditModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlEditModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlEditModel, UnoControlModel, szServiceName2_UnoControlEditModel )
+};
+
+// ----------------------------------------------------
+// class UnoEditControl
+// ----------------------------------------------------
+typedef ::cppu::ImplHelper4 < ::com::sun::star::awt::XTextComponent
+ , ::com::sun::star::awt::XTextListener
+ , ::com::sun::star::awt::XLayoutConstrains
+ , ::com::sun::star::awt::XTextLayoutConstrains
+ > UnoEditControl_Base;
+class TOOLKIT_DLLPUBLIC UnoEditControl :public UnoControlBase
+ ,public UnoEditControl_Base
+{
+private:
+ TextListenerMultiplexer maTextListeners;
+
+ // Not all fields derived from UnoEditCOntrol have the property "Text"
+ // They only support XTextComponent, so keep the text
+ // here, maybe there is no Peer when calling setText()...
+ OUString maText;
+ sal_uInt16 mnMaxTextLen;
+
+ sal_Bool mbSetTextInPeer;
+ sal_Bool mbSetMaxTextLenInPeer;
+ sal_Bool mbHasTextProperty;
+
+public:
+
+ UnoEditControl();
+ OUString GetComponentServiceName();
+ TextListenerMultiplexer& GetTextListeners() { return maTextListeners; }
+
+ void ImplSetPeerProperty( const OUString& rPropName, const ::com::sun::star::uno::Any& rVal );
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // disambiguate XInterface
+ DECLARE_XINTERFACE()
+
+ // XAggregation
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER()
+
+ // XTextListener
+ void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTextComponent
+ void SAL_CALL addTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setText( const OUString& aText ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL insertText( const ::com::sun::star::awt::Selection& Sel, const OUString& Text ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getSelectedText( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setSelection( const ::com::sun::star::awt::Selection& aSelection ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Selection SAL_CALL getSelection( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isEditable( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setEditable( sal_Bool bEditable ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getMaxTextLen( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTextLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException );
+};
+
+// ----------------------------------------------------
+// class UnoControlFileControlModel
+// ----------------------------------------------------
+class UnoControlFileControlModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlFileControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlFileControlModel( const UnoControlFileControlModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlFileControlModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlFileControlModel, UnoControlModel, szServiceName2_UnoControlFileControlModel )
+};
+
+// ----------------------------------------------------
+// class UnoFileControl
+// ----------------------------------------------------
+class UnoFileControl : public UnoEditControl
+{
+public:
+ UnoFileControl();
+ OUString GetComponentServiceName();
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoFileControl, UnoEditControl, szServiceName2_UnoControlFileControl )
+};
+
+// ----------------------------------------------------
+// class GraphicControlModel
+// ----------------------------------------------------
+class GraphicControlModel : public UnoControlModel
+{
+private:
+ bool mbAdjustingImagePosition;
+ bool mbAdjustingGraphic;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj;
+
+protected:
+ GraphicControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ :UnoControlModel( rxContext )
+ ,mbAdjustingImagePosition( false )
+ ,mbAdjustingGraphic( false )
+ {
+ }
+ GraphicControlModel( const GraphicControlModel& _rSource ) : UnoControlModel( _rSource ), mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { }
+
+ // ::cppu::OPropertySetHelper
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+
+ // UnoControlModel
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+
+private:
+ GraphicControlModel& operator=( const GraphicControlModel& ); // never implemented
+};
+
+// ----------------------------------------------------
+// class UnoControlButtonModel
+// ----------------------------------------------------
+class UnoControlButtonModel : public GraphicControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlButtonModel( const UnoControlButtonModel& rModel ) : GraphicControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlButtonModel( *this ); }
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlButtonModel, GraphicControlModel, szServiceName2_UnoControlButtonModel )
+};
+
+// ----------------------------------------------------
+// class UnoButtonControl
+// ----------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase
+ , ::com::sun::star::awt::XButton
+ , ::com::sun::star::awt::XToggleButton
+ , ::com::sun::star::awt::XLayoutConstrains
+ , ::com::sun::star::awt::XItemListener
+ > UnoButtonControl_Base;
+class UnoButtonControl : public UnoButtonControl_Base
+{
+private:
+ ActionListenerMultiplexer maActionListeners;
+ ItemListenerMultiplexer maItemListeners;
+ OUString maActionCommand;
+
+public:
+
+ UnoButtonControl();
+ OUString GetComponentServiceName();
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XButton
+ void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLabel( const OUString& Label ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setActionCommand( const OUString& Command ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XToggleButton
+ // ::com::sun::star::awt::XItemEventBroadcaster
+ void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XItemListener
+ virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoButtonControl, UnoControlBase, szServiceName2_UnoControlButton )
+};
+
+// ----------------------------------------------------
+// class UnoControlImageControlModel
+// ----------------------------------------------------
+class UnoControlImageControlModel : public GraphicControlModel
+{
+private:
+ bool mbAdjustingImageScaleMode;
+
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlImageControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlImageControlModel( const UnoControlImageControlModel& rModel ) : GraphicControlModel( rModel ), mbAdjustingImageScaleMode( false ) { }
+
+ UnoControlModel* Clone() const { return new UnoControlImageControlModel( *this ); }
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlImageControlModel, GraphicControlModel, szServiceName2_UnoControlImageControlModel )
+
+ // ::cppu::OPropertySetHelper
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+};
+
+// ----------------------------------------------------
+// class UnoImageControlControl
+// ----------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper1 < UnoControlBase
+ , ::com::sun::star::awt::XLayoutConstrains
+ > UnoImageControlControl_Base;
+class UnoImageControlControl : public UnoImageControlControl_Base
+{
+private:
+ ActionListenerMultiplexer maActionListeners;
+ OUString maActionCommand;
+
+public:
+
+ UnoImageControlControl();
+ OUString GetComponentServiceName();
+
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoImageControlControl, UnoControlBase, szServiceName2_UnoControlImageControl )
+};
+
+// ----------------------------------------------------
+// class UnoControlRadioButtonModel
+// ----------------------------------------------------
+class UnoControlRadioButtonModel : public GraphicControlModel
+
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlRadioButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlRadioButtonModel( const UnoControlRadioButtonModel& rModel ) : GraphicControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlRadioButtonModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlRadioButtonModel, GraphicControlModel, szServiceName2_UnoControlRadioButtonModel )
+
+};
+
+// ----------------------------------------------------
+// class UnoRadioButtonControl
+// ----------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase
+ , ::com::sun::star::awt::XButton
+ , ::com::sun::star::awt::XRadioButton
+ , ::com::sun::star::awt::XItemListener
+ , ::com::sun::star::awt::XLayoutConstrains
+ > UnoRadioButtonControl_Base;
+class UnoRadioButtonControl : public UnoRadioButtonControl_Base
+{
+private:
+ ItemListenerMultiplexer maItemListeners;
+ ActionListenerMultiplexer maActionListeners;
+ OUString maActionCommand;
+
+public:
+
+ UnoRadioButtonControl();
+ OUString GetComponentServiceName();
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
+
+ // ::com::sun::star::awt::XControl
+ sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XButton
+ void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setActionCommand( const OUString& Command ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XRadioButton
+ void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL getState( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setState( sal_Bool b ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLabel( const OUString& Label ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XItemListener
+ void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoRadioButtonControl, UnoControlBase, szServiceName2_UnoControlRadioButton )
+
+};
+
+// ----------------------------------------------------
+// class UnoControlCheckBoxModel
+// ----------------------------------------------------
+class UnoControlCheckBoxModel : public GraphicControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlCheckBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlCheckBoxModel( const UnoControlCheckBoxModel& rModel ) : GraphicControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlCheckBoxModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlCheckBoxModel, GraphicControlModel, szServiceName2_UnoControlCheckBoxModel )
+};
+
+// ----------------------------------------------------
+// class UnoCheckBoxControl
+// ----------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase
+ , ::com::sun::star::awt::XButton
+ , ::com::sun::star::awt::XCheckBox
+ , ::com::sun::star::awt::XItemListener
+ , ::com::sun::star::awt::XLayoutConstrains
+ > UnoCheckBoxControl_Base;
+class UnoCheckBoxControl : public UnoCheckBoxControl_Base
+{
+private:
+ ItemListenerMultiplexer maItemListeners;
+ ActionListenerMultiplexer maActionListeners;
+ OUString maActionCommand;
+
+public:
+
+ UnoCheckBoxControl();
+ ~UnoCheckBoxControl(){;}
+ OUString GetComponentServiceName();
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
+
+ // ::com::sun::star::awt::XControl
+ sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XButton
+ void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setActionCommand( const OUString& Command ) throw(::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw (::com::sun::star::uno::RuntimeException);
+
+
+ sal_Int16 SAL_CALL getState( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setState( sal_Int16 n ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLabel( const OUString& Label ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL enableTriState( sal_Bool b ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XItemListener
+ void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoCheckBoxControl, UnoControlBase, szServiceName2_UnoControlCheckBox )
+
+};
+
+// ----------------------------------------------------
+// class UnoControlFixedTextModel
+// ----------------------------------------------------
+class UnoControlFixedHyperlinkModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlFixedHyperlinkModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlFixedHyperlinkModel( const UnoControlFixedHyperlinkModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlFixedHyperlinkModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlFixedHyperlinkModel, UnoControlModel, szServiceName_UnoControlFixedHyperlinkModel )
+};
+
+// ----------------------------------------------------
+// class UnoFixedHyperlinkControl
+// ----------------------------------------------------
+class UnoFixedHyperlinkControl : public UnoControlBase,
+ public ::com::sun::star::awt::XFixedHyperlink,
+ public ::com::sun::star::awt::XLayoutConstrains
+{
+private:
+ ActionListenerMultiplexer maActionListeners;
+
+public:
+ UnoFixedHyperlinkControl();
+
+ OUString GetComponentServiceName();
+
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XFixedHyperlink
+ void SAL_CALL setText( const OUString& Text ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setURL( const OUString& URL ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getURL( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setAlignment( sal_Int16 nAlign ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getAlignment( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoFixedHyperlinkControl, UnoControlBase, szServiceName_UnoControlFixedHyperlink )
+};
+
+// ----------------------------------------------------
+// class UnoControlFixedTextModel
+// ----------------------------------------------------
+class UnoControlFixedTextModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlFixedTextModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlFixedTextModel( const UnoControlFixedTextModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlFixedTextModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlFixedTextModel, UnoControlModel, szServiceName2_UnoControlFixedTextModel )
+
+};
+
+// ----------------------------------------------------
+// class UnoFixedTextControl
+// ----------------------------------------------------
+class UnoFixedTextControl : public UnoControlBase,
+ public ::com::sun::star::awt::XFixedText,
+ public ::com::sun::star::awt::XLayoutConstrains
+{
+public:
+ UnoFixedTextControl();
+ OUString GetComponentServiceName();
+
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XFixedText
+ void SAL_CALL setText( const OUString& Text ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setAlignment( sal_Int16 nAlign ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getAlignment( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoFixedTextControl, UnoControlBase, szServiceName2_UnoControlFixedText )
+
+};
+
+// ----------------------------------------------------
+// class UnoControlGroupBoxModel
+// ----------------------------------------------------
+class UnoControlGroupBoxModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlGroupBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlGroupBoxModel( const UnoControlGroupBoxModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlGroupBoxModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlGroupBoxModel, UnoControlModel, szServiceName2_UnoControlGroupBoxModel )
+
+};
+
+// ----------------------------------------------------
+// class UnoGroupBoxControl
+// ----------------------------------------------------
+class UnoGroupBoxControl : public UnoControlBase
+{
+public:
+ UnoGroupBoxControl();
+ OUString GetComponentServiceName();
+
+ sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoGroupBoxControl, UnoControlBase, szServiceName2_UnoControlGroupBox )
+
+};
+
+// ----------------------------------------------------
+// class UnoControlListBoxModel
+// ----------------------------------------------------
+struct UnoControlListBoxModel_Data;
+typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
+ , ::com::sun::star::awt::XItemList
+ > UnoControlListBoxModel_Base;
+class TOOLKIT_DLLPUBLIC UnoControlListBoxModel : public UnoControlListBoxModel_Base
+{
+protected:
+ enum ConstructorMode
+ {
+ ConstructDefault,
+ ConstructWithoutProperties
+ };
+
+public:
+ UnoControlListBoxModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ ConstructorMode const i_mode = ConstructDefault
+ );
+ UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource );
+ ~UnoControlListBoxModel();
+
+ UnoControlModel* Clone() const { return new UnoControlListBoxModel( *this ); }
+
+ virtual void ImplNormalizePropertySequence(
+ const sal_Int32 _nCount, /// the number of entries in the arrays
+ sal_Int32* _pHandles, /// the handles of the properties to set
+ ::com::sun::star::uno::Any* _pValues, /// the values of the properties to set
+ sal_Int32* _pValidHandles /// pointer to the valid handles, allowed to be adjusted
+ ) const SAL_THROW(());
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XItemList
+ virtual ::sal_Int32 SAL_CALL getItemCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL insertItem( ::sal_Int32 Position, const OUString& ItemText, const OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL insertItemText( ::sal_Int32 Position, const OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL insertItemImage( ::sal_Int32 Position, const OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeItem( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeAllItems( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setItemText( ::sal_Int32 Position, const OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setItemImage( ::sal_Int32 Position, const OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setItemTextAndImage( ::sal_Int32 Position, const OUString& ItemText, const OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setItemData( ::sal_Int32 Position, const ::com::sun::star::uno::Any& DataValue ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getItemText( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getItemImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::beans::Pair< OUString, OUString > SAL_CALL getItemTextAndImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getItemData( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Pair< OUString, OUString > > SAL_CALL getAllItems( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // OPropertySetHelper
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+private:
+ void impl_notifyItemListEvent_nolck(
+ const sal_Int32 i_nItemPosition,
+ const ::boost::optional< OUString >& i_rItemText,
+ const ::boost::optional< OUString >& i_rItemImageURL,
+ void ( SAL_CALL ::com::sun::star::awt::XItemListListener::*NotificationMethod )( const ::com::sun::star::awt::ItemListEvent& )
+ );
+
+ void impl_handleInsert(
+ const sal_Int32 i_nItemPosition,
+ const ::boost::optional< OUString >& i_rItemText,
+ const ::boost::optional< OUString >& i_rItemImageURL,
+ ::osl::ClearableMutexGuard& i_rClearBeforeNotify
+ );
+
+ void impl_handleRemove(
+ const sal_Int32 i_nItemPosition,
+ ::osl::ClearableMutexGuard& i_rClearBeforeNotify
+ );
+
+ void impl_handleModify(
+ const sal_Int32 i_nItemPosition,
+ const ::boost::optional< OUString >& i_rItemText,
+ const ::boost::optional< OUString >& i_rItemImageURL,
+ ::osl::ClearableMutexGuard& i_rClearBeforeNotify
+ );
+
+ void impl_getStringItemList( ::std::vector< OUString >& o_rStringItems ) const;
+ void impl_setStringItemList_nolck( const ::std::vector< OUString >& i_rStringItems );
+
+protected:
+ ::boost::scoped_ptr< UnoControlListBoxModel_Data > m_pData;
+ ::cppu::OInterfaceContainerHelper m_aItemListListeners;
+};
+
+// ----------------------------------------------------
+// class UnoListBoxControl
+// ----------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase
+ , ::com::sun::star::awt::XListBox
+ , ::com::sun::star::awt::XItemListener
+ , ::com::sun::star::awt::XLayoutConstrains
+ , ::com::sun::star::awt::XTextLayoutConstrains
+ , ::com::sun::star::awt::XItemListListener
+ > UnoListBoxControl_Base;
+class TOOLKIT_DLLPUBLIC UnoListBoxControl : public UnoListBoxControl_Base
+{
+public:
+ UnoListBoxControl();
+ OUString GetComponentServiceName();
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
+
+ // ::com::sun::star::awt::XListBox
+ void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addItem( const OUString& aItem, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< OUString >& aItems, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getItems( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getSelectedItemPos( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSelectedItemsPos( ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getSelectedItem( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSelectedItems( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL selectItemPos( sal_Int16 nPos, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL selectItemsPos( const ::com::sun::star::uno::Sequence< sal_Int16 >& aPositions, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL selectItem( const OUString& aItem, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isMutipleMode( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMultipleMode( sal_Bool bMulti ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getDropDownLineCount( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL makeVisible( sal_Int16 nEntry ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XItemListener
+ void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTextLayoutConstrains
+ ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XUnoControl
+ sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XItemListListener
+ virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+protected:
+ void ImplUpdateSelectedItemsProperty();
+ virtual void ImplSetPeerProperty( const OUString& rPropName, const ::com::sun::star::uno::Any& rVal );
+ virtual void updateFromModel();
+
+private:
+ ActionListenerMultiplexer maActionListeners;
+ ItemListenerMultiplexer maItemListeners;
+};
+
+// ----------------------------------------------------
+// class UnoControlComboBoxModel
+// ----------------------------------------------------
+class UnoControlComboBoxModel : public UnoControlListBoxModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlComboBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlListBoxModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlComboBoxModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // OPropertySetHelper
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+
+ // ::com::sun::star::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+};
+
+// ----------------------------------------------------
+// class UnoComboBoxControl
+// ----------------------------------------------------
+class UnoComboBoxControl : public UnoEditControl
+ , public ::com::sun::star::awt::XComboBox
+ , public ::com::sun::star::awt::XItemListener
+ , public ::com::sun::star::awt::XItemListListener
+{
+private:
+ ActionListenerMultiplexer maActionListeners;
+ ItemListenerMultiplexer maItemListeners;
+
+public:
+
+ UnoComboBoxControl();
+ OUString GetComponentServiceName();
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoEditControl::disposing( Source ); }
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XComboBox
+ void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addItem( const OUString& aItem, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< OUString >& aItems, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getItems( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getDropDownLineCount( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XUnoControl
+ virtual sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XItemListListener
+ virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XItemListener
+ virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+protected:
+ virtual void ImplSetPeerProperty( const OUString& rPropName, const ::com::sun::star::uno::Any& rVal );
+ virtual void updateFromModel();
+ ActionListenerMultiplexer& getActionListeners();
+ ItemListenerMultiplexer& getItemListeners();
+
+};
+
+// ----------------------------------------------------
+// class UnoSpinFieldControl
+// ----------------------------------------------------
+class UnoSpinFieldControl : public UnoEditControl,
+ public ::com::sun::star::awt::XSpinField
+{
+private:
+ SpinListenerMultiplexer maSpinListeners;
+ sal_Bool mbRepeat;
+
+public:
+ UnoSpinFieldControl();
+
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XSpinField
+ void SAL_CALL addSpinListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSpinListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeSpinListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSpinListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL up() throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL down() throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL first() throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL last() throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL enableRepeat( sal_Bool bRepeat ) throw(::com::sun::star::uno::RuntimeException);
+
+
+ // ::com::sun::star::lang::XServiceInfo
+ // No service info, only base class for other fields.
+};
+
+
+// ----------------------------------------------------
+// class UnoControlDateFieldModel
+// ----------------------------------------------------
+class UnoControlDateFieldModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlDateFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlDateFieldModel( const UnoControlDateFieldModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlDateFieldModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlDateFieldModel, UnoControlModel, szServiceName2_UnoControlDateFieldModel )
+
+};
+
+// ----------------------------------------------------
+// class UnoDateFieldControl
+// ----------------------------------------------------
+class UnoDateFieldControl : public UnoSpinFieldControl,
+ public ::com::sun::star::awt::XDateField
+{
+private:
+ sal_Int32 mnFirst;
+ sal_Int32 mnLast;
+ sal_Bool mbLongFormat;
+public:
+ UnoDateFieldControl();
+ OUString GetComponentServiceName();
+
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTextListener
+ void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ //XDateField
+ void SAL_CALL setDate( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getDate( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMin( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMax( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFirst( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLast( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLongFormat( sal_Bool bLong ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isLongFormat( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setEmpty( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isEmpty( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoDateFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlDateField )
+};
+
+// ----------------------------------------------------
+// class UnoControlTimeFieldModel
+// ----------------------------------------------------
+class UnoControlTimeFieldModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlTimeFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlTimeFieldModel( const UnoControlTimeFieldModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlTimeFieldModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlTimeFieldModel, UnoControlModel, szServiceName2_UnoControlTimeFieldModel )
+
+};
+
+// ----------------------------------------------------
+// class UnoTimeFieldControl
+// ----------------------------------------------------
+class UnoTimeFieldControl : public UnoSpinFieldControl,
+ public ::com::sun::star::awt::XTimeField
+{
+private:
+ sal_Int32 mnFirst;
+ sal_Int32 mnLast;
+
+public:
+ UnoTimeFieldControl();
+ OUString GetComponentServiceName();
+
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTextListener
+ void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ //XTimeField
+ void SAL_CALL setTime( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getTime( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMin( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMax( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFirst( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLast( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setEmpty( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isEmpty( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoTimeFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlTimeField )
+
+};
+
+// ----------------------------------------------------
+// class UnoControlNumericFieldModel
+// ----------------------------------------------------
+class UnoControlNumericFieldModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlNumericFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlNumericFieldModel( const UnoControlNumericFieldModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlNumericFieldModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlNumericFieldModel, UnoControlModel, szServiceName2_UnoControlNumericFieldModel )
+
+};
+
+// ----------------------------------------------------
+// class UnoNumericFieldControl
+// ----------------------------------------------------
+class UnoNumericFieldControl : public UnoSpinFieldControl,
+ public ::com::sun::star::awt::XNumericField
+{
+private:
+ double mnFirst;
+ double mnLast;
+
+public:
+ UnoNumericFieldControl();
+ OUString GetComponentServiceName();
+
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTextListener
+ void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XNumericField
+ void SAL_CALL setValue( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMin( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMax( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLast( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getSpinSize( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getDecimalDigits( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoNumericFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlNumericField )
+
+};
+
+// ----------------------------------------------------
+// class UnoControlCurrencyFieldModel
+// ----------------------------------------------------
+class UnoControlCurrencyFieldModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlCurrencyFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlCurrencyFieldModel( const UnoControlCurrencyFieldModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlCurrencyFieldModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlCurrencyFieldModel, UnoControlModel, szServiceName2_UnoControlCurrencyFieldModel )
+
+};
+
+// ----------------------------------------------------
+// class UnoCurrencyFieldControl
+// ----------------------------------------------------
+class UnoCurrencyFieldControl : public UnoSpinFieldControl,
+ public ::com::sun::star::awt::XCurrencyField
+{
+private:
+ double mnFirst;
+ double mnLast;
+
+public:
+ UnoCurrencyFieldControl();
+ OUString GetComponentServiceName();
+
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XTextListener
+ void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XCurrencyField
+ void SAL_CALL setValue( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMin( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setMax( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setLast( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException);
+ double SAL_CALL getSpinSize( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int16 SAL_CALL getDecimalDigits( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoCurrencyFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlCurrencyField )
+};
+
+// ----------------------------------------------------
+// class UnoControlPatternFieldModel
+// ----------------------------------------------------
+class UnoControlPatternFieldModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlPatternFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlPatternFieldModel( const UnoControlPatternFieldModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlPatternFieldModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlPatternFieldModel, UnoControlModel, szServiceName2_UnoControlPatternFieldModel )
+
+};
+
+// ----------------------------------------------------
+// class UnoPatternFieldControl
+// ----------------------------------------------------
+class UnoPatternFieldControl : public UnoSpinFieldControl,
+ public ::com::sun::star::awt::XPatternField
+{
+protected:
+ void ImplSetPeerProperty( const OUString& rPropName, const ::com::sun::star::uno::Any& rVal );
+
+public:
+ UnoPatternFieldControl();
+ OUString GetComponentServiceName();
+
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XPatternField
+ void SAL_CALL setMasks( const OUString& EditMask, const OUString& LiteralMask ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL getMasks( OUString& EditMask, OUString& LiteralMask ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setString( const OUString& Str ) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getString( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoPatternFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlPatternField )
+
+};
+
+// ----------------------------------------------------
+// class UnoControlProgressBarModel
+// ----------------------------------------------------
+class UnoControlProgressBarModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlProgressBarModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlProgressBarModel( const UnoControlProgressBarModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlProgressBarModel( *this ); }
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlProgressBarModel, UnoControlModel, szServiceName2_UnoControlProgressBarModel )
+};
+
+// ----------------------------------------------------
+// class UnoProgressBarControl
+// ----------------------------------------------------
+class UnoProgressBarControl : public UnoControlBase,
+ public ::com::sun::star::awt::XProgressBar
+{
+public:
+ UnoProgressBarControl();
+ OUString GetComponentServiceName();
+
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakAggObject::release(); }
+
+ // ::com::sun::star::lang::XTypeProvider
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XProgressBar
+ void SAL_CALL setForegroundColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setBackgroundColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setValue( sal_Int32 nValue ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setRange( sal_Int32 nMin, sal_Int32 nMax ) throw(::com::sun::star::uno::RuntimeException );
+ sal_Int32 SAL_CALL getValue() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoProgressBarControl, UnoControlBase, szServiceName2_UnoControlProgressBar )
+};
+
+
+// ----------------------------------------------------
+// class UnoControlFixedLineModel
+// ----------------------------------------------------
+class UnoControlFixedLineModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoControlFixedLineModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+ UnoControlFixedLineModel( const UnoControlFixedLineModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlFixedLineModel( *this ); }
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::io::XPersistObject
+ OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlFixedLineModel, UnoControlModel, szServiceName2_UnoControlFixedLineModel )
+
+};
+
+// ----------------------------------------------------
+// class UnoFixedLineControl
+// ----------------------------------------------------
+class UnoFixedLineControl : public UnoControlBase
+{
+public:
+ UnoFixedLineControl();
+ OUString GetComponentServiceName();
+
+ sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoFixedLineControl, UnoControlBase, szServiceName2_UnoControlFixedLine )
+
+};
+
+
+
+#endif // _TOOLKIT_HELPER_UNOCONTROLS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/dllapi.h b/include/toolkit/dllapi.h
new file mode 100644
index 000000000000..bf5615cb3547
--- /dev/null
+++ b/include/toolkit/dllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef TOOLKIT_DLLAPI_H
+#define TOOLKIT_DLLAPI_H
+
+#include "sal/config.h"
+#include "sal/types.h"
+
+#if defined TOOLKIT_DLLIMPLEMENTATION
+#define TOOLKIT_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define TOOLKIT_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/accessibilityclient.hxx b/include/toolkit/helper/accessibilityclient.hxx
new file mode 100644
index 000000000000..02e44e6c47e8
--- /dev/null
+++ b/include/toolkit/helper/accessibilityclient.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 TOOLKIT_HELPER_ACCESSIBILITY_CLIENT_HXX
+#define TOOLKIT_HELPER_ACCESSIBILITY_CLIENT_HXX
+
+#include <toolkit/helper/accessiblefactory.hxx>
+
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ //====================================================================
+ //= AccessibilityClient
+ //====================================================================
+ /** a client for the accessibility implementations which have been
+ outsourced from the main toolkit library
+
+ All instances of this class share a reference to a common IAccessibleFactory
+ instance, which is used for creating all kind of Accessibility related
+ components.
+
+ When the AccessibilityClient goes aways, this factory goes aways, to, and the respective
+ library is unloaded.
+
+ This class is not thread-safe.
+ */
+ class AccessibilityClient
+ {
+ private:
+ bool m_bInitialized;
+
+ public:
+ AccessibilityClient();
+ ~AccessibilityClient();
+
+ IAccessibleFactory& getFactory();
+
+ private:
+ void ensureInitialized();
+ };
+
+//........................................................................
+} // namespace toolkit
+//........................................................................
+
+#endif // TOOLKIT_HELPER_ACCESSIBILITY_CLIENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/accessiblefactory.hxx b/include/toolkit/helper/accessiblefactory.hxx
new file mode 100644
index 000000000000..66117a6bdbba
--- /dev/null
+++ b/include/toolkit/helper/accessiblefactory.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 TOOLKIT_HELPER_ACCESSIBLE_FACTORY_HXX
+#define TOOLKIT_HELPER_ACCESSIBLE_FACTORY_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <rtl/ref.hxx>
+
+namespace com { namespace sun { namespace star { namespace accessibility {
+ class XAccessible;
+ class XAccessibleContext;
+} } } }
+class VCLXButton;
+class VCLXCheckBox;
+class VCLXRadioButton;
+class VCLXListBox;
+class VCLXFixedHyperlink;
+class VCLXFixedText;
+class VCLXScrollBar;
+class VCLXEdit;
+class VCLXComboBox;
+class VCLXToolBox;
+class VCLXWindow;
+class Menu;
+
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ /** a function which is able to create a factory for the standard Accessible/Context
+ components needed for standard toolkit controls
+
+ The returned pointer denotes an instance of the IAccessibleFactory, which has been acquired
+ <em>once</em>. The caller is responsible for holding this reference as long as it needs the
+ factory, and release it afterwards.
+ */
+ typedef void* (SAL_CALL * GetStandardAccComponentFactory)( );
+
+ //================================================================
+ //= IAccessibleFactory
+ //================================================================
+ class IAccessibleFactory : public ::rtl::IReference
+ {
+ public:
+ /** creates an accessible context for a button window
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleContext( VCLXButton* _pXWindow ) = 0;
+
+ /** creates an accessible context for a checkbox window
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleContext( VCLXCheckBox* _pXWindow ) = 0;
+
+ /** creates an accessible context for a radio button window
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleContext( VCLXRadioButton* _pXWindow ) = 0;
+
+ /** creates an accessible context for a listbox window
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleContext( VCLXListBox* _pXWindow ) = 0;
+
+ /** creates an accessible context for a fixed hyperlink window
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleContext( VCLXFixedHyperlink* _pXWindow ) = 0;
+
+ /** creates an accessible context for a fixed text window
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleContext( VCLXFixedText* _pXWindow ) = 0;
+
+ /** creates an accessible context for a scrollbar window
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleContext( VCLXScrollBar* _pXWindow ) = 0;
+
+ /** creates an accessible context for a edit window
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleContext( VCLXEdit* _pXWindow ) = 0;
+
+ /** creates an accessible context for a combo box window
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleContext( VCLXComboBox* _pXWindow ) = 0;
+
+ /** creates an accessible context for a toolbox window
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleContext( VCLXToolBox* _pXWindow ) = 0;
+
+ /** creates an accessible context for a generic window
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleContext( VCLXWindow* _pXWindow ) = 0;
+
+ /** creates an accessible component for the given menu
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessible( Menu* _pMenu, sal_Bool _bIsMenuBar ) = 0;
+
+ protected:
+ ~IAccessibleFactory() {}
+ };
+
+//........................................................................
+} // namespace toolkit
+//........................................................................
+
+#endif // TOOLKIT_HELPER_ACCESSIBLE_FACTORY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/convert.hxx b/include/toolkit/helper/convert.hxx
new file mode 100644
index 000000000000..27ad9aa17a0e
--- /dev/null
+++ b/include/toolkit/helper/convert.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 _TOOLKIT_HELPER_CONVERT_HXX_
+#define _TOOLKIT_HELPER_CONVERT_HXX_
+
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/awt/Point.hpp>
+
+#include <tools/gen.hxx>
+
+inline ::com::sun::star::awt::Size AWTSize( const Size& rVCLSize )
+{
+ return ::com::sun::star::awt::Size( rVCLSize.Width(), rVCLSize.Height() );
+}
+
+inline ::Size VCLSize( const ::com::sun::star::awt::Size& rAWTSize )
+{
+ return ::Size( rAWTSize.Width, rAWTSize.Height );
+}
+
+inline ::com::sun::star::awt::Point AWTPoint( const ::Point& rVCLPoint )
+{
+ return ::com::sun::star::awt::Point( rVCLPoint.X(), rVCLPoint.Y() );
+}
+
+inline ::Point VCLPoint( const ::com::sun::star::awt::Point& rAWTPoint )
+{
+ return ::Point( rAWTPoint.X, rAWTPoint.Y );
+}
+
+inline ::com::sun::star::awt::Rectangle AWTRectangle( const ::Rectangle& rVCLRect )
+{
+ return ::com::sun::star::awt::Rectangle( rVCLRect.Left(), rVCLRect.Top(), rVCLRect.GetWidth(), rVCLRect.GetHeight() );
+}
+
+inline ::Rectangle VCLRectangle( const ::com::sun::star::awt::Rectangle& rAWTRect )
+{
+ return ::Rectangle( ::Point( rAWTRect.X, rAWTRect.Y ), ::Size( rAWTRect.Width, rAWTRect.Height ) );
+}
+
+#endif // _TOOLKIT_HELPER_CONVERT_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/emptyfontdescriptor.hxx b/include/toolkit/helper/emptyfontdescriptor.hxx
new file mode 100644
index 000000000000..3110d8195f5a
--- /dev/null
+++ b/include/toolkit/helper/emptyfontdescriptor.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 _TOOLKIT_HELPER_EMPTYFONTDESCRIPTOR_HXX_
+#define _TOOLKIT_HELPER_EMPTYFONTDESCRIPTOR_HXX_
+
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/awt/FontSlant.hpp>
+#include <com/sun/star/awt/FontUnderline.hpp>
+#include <com/sun/star/awt/FontStrikeout.hpp>
+
+// ----------------------------------------------------
+// class EmptyFontDescriptor
+// ----------------------------------------------------
+class EmptyFontDescriptor : public ::com::sun::star::awt::FontDescriptor
+{
+public:
+ EmptyFontDescriptor()
+ {
+ // Not all enums are initialized correctly in FontDescriptor-CTOR because
+ // they are set to the first enum value, this is not always the default value.
+ Slant = ::com::sun::star::awt::FontSlant_DONTKNOW;
+ Underline = ::com::sun::star::awt::FontUnderline::DONTKNOW;
+ Strikeout = ::com::sun::star::awt::FontStrikeout::DONTKNOW;
+ }
+};
+
+
+
+
+#endif // _TOOLKIT_HELPER_EMPTYFONTDESCRIPTOR_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/externallock.hxx b/include/toolkit/helper/externallock.hxx
new file mode 100644
index 000000000000..5b0421d558e2
--- /dev/null
+++ b/include/toolkit/helper/externallock.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 _TOOLKIT_HELPER_EXTERNALLOCK_HXX_
+#define _TOOLKIT_HELPER_EXTERNALLOCK_HXX_
+
+#include <toolkit/dllapi.h>
+#include <comphelper/accessiblecontexthelper.hxx>
+
+// -----------------------------------------------------------------------------
+// class VCLExternalSolarLock
+// -----------------------------------------------------------------------------
+
+class TOOLKIT_DLLPUBLIC VCLExternalSolarLock : public ::comphelper::IMutex
+{
+public:
+ virtual void acquire();
+ virtual void release();
+};
+
+#endif // _TOOLKIT_HELPER_EXTERNALLOCK_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/formpdfexport.hxx b/include/toolkit/helper/formpdfexport.hxx
new file mode 100644
index 000000000000..9e88d71f5b3f
--- /dev/null
+++ b/include/toolkit/helper/formpdfexport.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 _TOOLKIT_HELPER_FORM_FORMPDFEXPORT_HXX
+#define _TOOLKIT_HELPER_FORM_FORMPDFEXPORT_HXX
+
+#include <toolkit/dllapi.h>
+
+#include <com/sun/star/awt/XControl.hpp>
+
+#include <vcl/pdfwriter.hxx>
+
+#include <memory>
+
+namespace vcl
+{
+ class PDFExtOutDevData;
+}
+
+//........................................................................
+namespace toolkitform
+{
+//........................................................................
+
+ /** creates a PDF compatible control descriptor for the given control
+ */
+ void TOOLKIT_DLLPUBLIC describePDFControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl,
+ ::std::auto_ptr< ::vcl::PDFWriter::AnyWidget >& _rpDescriptor,
+ ::vcl::PDFExtOutDevData& i_pdfExportData
+ ) SAL_THROW(());
+
+//........................................................................
+} // namespace toolkitform
+//........................................................................
+
+#endif // _TOOLKIT_HELPER_FORM_FORMPDFEXPORT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/imagealign.hxx b/include/toolkit/helper/imagealign.hxx
new file mode 100644
index 000000000000..f6f2ac5e3860
--- /dev/null
+++ b/include/toolkit/helper/imagealign.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 TOOLKIT_INC_TOOLKIT_HELPER_IMAGEALIGN_HXX
+#define TOOLKIT_INC_TOOLKIT_HELPER_IMAGEALIGN_HXX
+
+#include <sal/types.h>
+#include <vcl/button.hxx>
+
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+
+ /** translates a VCL ImageAlign value into an css.awt.ImagePosition value
+ */
+ sal_Int16 translateImagePosition( ImageAlign _eVCLAlign );
+
+ /** translates a css.awt.ImagePosition value into an VCL ImageAlign
+ */
+ ImageAlign translateImagePosition( sal_Int16 _nImagePosition );
+
+ /** translates a VCL ImageAlign value into a compatible css.awt.ImageAlign value
+ */
+ sal_Int16 getCompatibleImageAlign( ImageAlign _eAlign );
+
+ /** translates a css.awt.ImageAlign value into a css.awt.ImagePosition value
+ */
+ sal_Int16 getExtendedImagePosition( sal_Int16 _nImageAlign );
+
+//........................................................................
+} // namespace toolkit
+//........................................................................
+
+#endif // TOOLKIT_INC_TOOLKIT_HELPER_IMAGEALIGN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/listenermultiplexer.hxx b/include/toolkit/helper/listenermultiplexer.hxx
new file mode 100644
index 000000000000..dc0626893e37
--- /dev/null
+++ b/include/toolkit/helper/listenermultiplexer.hxx
@@ -0,0 +1,268 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_HELPER_LISTENERMULTIPLEXER_HXX_
+#define _TOOLKIT_HELPER_LISTENERMULTIPLEXER_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/awt/XFocusListener.hpp>
+#include <com/sun/star/awt/XWindowListener.hpp>
+#include <com/sun/star/awt/XVclContainerListener.hpp>
+#include <com/sun/star/awt/XKeyListener.hpp>
+#include <com/sun/star/awt/XMouseListener.hpp>
+#include <com/sun/star/awt/XMouseMotionListener.hpp>
+#include <com/sun/star/awt/XPaintListener.hpp>
+#include <com/sun/star/awt/XTopWindowListener.hpp>
+#include <com/sun/star/awt/XTextListener.hpp>
+#include <com/sun/star/awt/XActionListener.hpp>
+#include <com/sun/star/awt/XItemListener.hpp>
+#include <com/sun/star/awt/XTabListener.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include <com/sun/star/awt/XSpinListener.hpp>
+#include <com/sun/star/awt/XAdjustmentListener.hpp>
+#include <com/sun/star/awt/XMenuListener.hpp>
+#include <com/sun/star/awt/tree/XTreeExpansionListener.hpp>
+#include <com/sun/star/awt/tree/XTreeEditListener.hpp>
+#include <com/sun/star/view/XSelectionChangeListener.hpp>
+#include <com/sun/star/util/VetoException.hpp>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <osl/mutex.hxx>
+#include <toolkit/helper/mutexhelper.hxx>
+#include <toolkit/helper/macros.hxx>
+#include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
+#include <com/sun/star/awt/tab/XTabPageContainerListener.hpp>
+// ----------------------------------------------------
+// class ListenerMultiplexerBase
+// ----------------------------------------------------
+
+class TOOLKIT_DLLPUBLIC ListenerMultiplexerBase : public MutexHelper,
+ public ::cppu::OInterfaceContainerHelper,
+ public ::com::sun::star::uno::XInterface
+{
+private:
+ ::cppu::OWeakObject& mrContext;
+
+protected:
+ ::cppu::OWeakObject& GetContext() { return mrContext; }
+
+public:
+ ListenerMultiplexerBase( ::cppu::OWeakObject& rSource );
+ virtual ~ListenerMultiplexerBase();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { mrContext.acquire(); }
+ void SAL_CALL release() throw() { mrContext.release(); }
+};
+
+
+// ----------------------------------------------------
+// class EventListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START( EventListenerMultiplexer, ::com::sun::star::lang::XEventListener )
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class FocusListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START( FocusListenerMultiplexer, ::com::sun::star::awt::XFocusListener )
+ void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+
+// ----------------------------------------------------
+// class WindowListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START( WindowListenerMultiplexer, ::com::sun::star::awt::XWindowListener )
+ void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+
+
+// ----------------------------------------------------
+// class VclContainerListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START( VclContainerListenerMultiplexer, ::com::sun::star::awt::XVclContainerListener )
+ void SAL_CALL windowAdded( const ::com::sun::star::awt::VclContainerEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL windowRemoved( const ::com::sun::star::awt::VclContainerEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class KeyListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START( KeyListenerMultiplexer, ::com::sun::star::awt::XKeyListener )
+ void SAL_CALL keyPressed( const ::com::sun::star::awt::KeyEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL keyReleased( const ::com::sun::star::awt::KeyEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class MouseListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( MouseListenerMultiplexer, ::com::sun::star::awt::XMouseListener )
+ void SAL_CALL mousePressed( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL mouseReleased( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL mouseEntered( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL mouseExited( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class MouseMotionListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START( MouseMotionListenerMultiplexer, ::com::sun::star::awt::XMouseMotionListener )
+ void SAL_CALL mouseDragged( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL mouseMoved( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class PaintListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START( PaintListenerMultiplexer, ::com::sun::star::awt::XPaintListener )
+ void SAL_CALL windowPaint( const ::com::sun::star::awt::PaintEvent& e ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class TopWindowListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START( TopWindowListenerMultiplexer, ::com::sun::star::awt::XTopWindowListener )
+ void SAL_CALL windowOpened( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL windowClosing( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL windowClosed( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL windowMinimized( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL windowNormalized( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL windowActivated( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL windowDeactivated( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class TextListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( TextListenerMultiplexer, ::com::sun::star::awt::XTextListener )
+ void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class ActionListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( ActionListenerMultiplexer, ::com::sun::star::awt::XActionListener )
+ void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class ItemListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( ItemListenerMultiplexer, ::com::sun::star::awt::XItemListener )
+ void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class TabListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( TabListenerMultiplexer, ::com::sun::star::awt::XTabListener )
+ void SAL_CALL inserted( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removed( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL changed( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL activated( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL deactivated( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class ContainerListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START( ContainerListenerMultiplexer, ::com::sun::star::container::XContainerListener )
+ void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class SpinListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( SpinListenerMultiplexer, ::com::sun::star::awt::XSpinListener )
+ void SAL_CALL up( const ::com::sun::star::awt::SpinEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL down( const ::com::sun::star::awt::SpinEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL first( const ::com::sun::star::awt::SpinEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL last( const ::com::sun::star::awt::SpinEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class AdjustmentListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START( AdjustmentListenerMultiplexer, ::com::sun::star::awt::XAdjustmentListener )
+ void SAL_CALL adjustmentValueChanged( const ::com::sun::star::awt::AdjustmentEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class MenuListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START( MenuListenerMultiplexer, ::com::sun::star::awt::XMenuListener )
+ void SAL_CALL highlight( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL deactivate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class TreeSelectionListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( TreeSelectionListenerMultiplexer, ::com::sun::star::view::XSelectionChangeListener )
+ virtual void SAL_CALL selectionChanged( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class TreeExpansionListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( TreeExpansionListenerMultiplexer, ::com::sun::star::awt::tree::XTreeExpansionListener )
+ virtual void SAL_CALL requestChildNodes( const ::com::sun::star::awt::tree::TreeExpansionEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL treeExpanding( const ::com::sun::star::awt::tree::TreeExpansionEvent& aEvent ) throw (::com::sun::star::awt::tree::ExpandVetoException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL treeCollapsing( const ::com::sun::star::awt::tree::TreeExpansionEvent& aEvent ) throw (::com::sun::star::awt::tree::ExpandVetoException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL treeExpanded( const ::com::sun::star::awt::tree::TreeExpansionEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL treeCollapsed( const ::com::sun::star::awt::tree::TreeExpansionEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class TreeEditListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( TreeEditListenerMultiplexer, ::com::sun::star::awt::tree::XTreeEditListener )
+ virtual void SAL_CALL nodeEditing( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& Node ) throw (::com::sun::star::uno::RuntimeException,::com::sun::star::util::VetoException);
+ virtual void SAL_CALL nodeEdited( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& Node, const OUString& NewText ) throw (::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class SelectionListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( SelectionListenerMultiplexer, ::com::sun::star::awt::grid::XGridSelectionListener )
+ void SAL_CALL selectionChanged( const ::com::sun::star::awt::grid::GridSelectionEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+// ----------------------------------------------------
+// class TabPageListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( TabPageListenerMultiplexer, ::com::sun::star::awt::tab::XTabPageContainerListener )
+ void SAL_CALL tabPageActivated( const ::com::sun::star::awt::tab::TabPageActivatedEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
+#endif // _TOOLKIT_HELPER_LISTENERMULTIPLEXER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/macros.hxx b/include/toolkit/helper/macros.hxx
new file mode 100644
index 000000000000..7d2eaea67403
--- /dev/null
+++ b/include/toolkit/helper/macros.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 _TOOLKIT_HELPER_MACROS_HXX_
+#define _TOOLKIT_HELPER_MACROS_HXX_
+
+#include <string.h>
+
+#include <comphelper/servicehelper.hxx>
+
+#define IMPL_XUNOTUNNEL_MINIMAL( ClassName ) \
+sal_Int64 ClassName::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException) \
+{ \
+ if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( ClassName::GetUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) ) ) \
+ { \
+ return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(this)); \
+ } \
+ return 0; \
+} \
+namespace \
+{ \
+ class the##ClassName##UnoTunnelId : public rtl::Static< UnoTunnelIdInit, the##ClassName##UnoTunnelId> {}; \
+} \
+const ::com::sun::star::uno::Sequence< sal_Int8 >& ClassName::GetUnoTunnelId() throw() \
+{ \
+ return the##ClassName##UnoTunnelId::get().getSeq(); \
+}
+
+#define IMPL_XUNOTUNNEL( ClassName ) \
+IMPL_XUNOTUNNEL_MINIMAL( ClassName ) \
+ClassName* ClassName::GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw() \
+{ \
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xUT( rxIFace, ::com::sun::star::uno::UNO_QUERY ); \
+ return xUT.is() ? reinterpret_cast<ClassName*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething( ClassName::GetUnoTunnelId() ))) : NULL; \
+}
+
+#define IMPL_XUNOTUNNEL2( ClassName, BaseClass ) \
+sal_Int64 ClassName::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException) \
+{ \
+ if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( ClassName::GetUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) ) ) \
+ { \
+ return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(this)); \
+ } \
+ return BaseClass::getSomething( rIdentifier ); \
+} \
+namespace \
+{ \
+ class the##ClassName##UnoTunnelId : public rtl::Static< UnoTunnelIdInit, the##ClassName##UnoTunnelId> {}; \
+} \
+const ::com::sun::star::uno::Sequence< sal_Int8 >& ClassName::GetUnoTunnelId() throw() \
+{ \
+ return the##ClassName##UnoTunnelId::get().getSeq(); \
+} \
+ClassName* ClassName::GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw() \
+{ \
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xUT( rxIFace, ::com::sun::star::uno::UNO_QUERY ); \
+ return xUT.is() ? reinterpret_cast<ClassName*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething( ClassName::GetUnoTunnelId() ))) : NULL; \
+}
+
+// -------------------------------------------------------------------------------------
+
+#define IMPL_IMPLEMENTATION_ID( ClassName ) \
+::com::sun::star::uno::Sequence< sal_Int8 > ClassName::getImplementationId() throw(::com::sun::star::uno::RuntimeException) \
+{ \
+ static ::cppu::OImplementationId* pId = NULL; \
+ if( !pId ) \
+ { \
+ ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ); \
+ if( ! pId ) \
+ { \
+ static ::cppu::OImplementationId id( sal_False ); \
+ pId = &id; \
+ } \
+ } \
+ return (*pId).getImplementationId(); \
+}
+
+#define IMPL_XTYPEPROVIDER_START( ClassName ) \
+IMPL_IMPLEMENTATION_ID( ClassName ) \
+::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > ClassName::getTypes() throw(::com::sun::star::uno::RuntimeException) \
+{ \
+ static ::cppu::OTypeCollection* pCollection = NULL; \
+ if( !pCollection ) \
+ { \
+ ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ); \
+ if( !pCollection ) \
+ { \
+ static ::cppu::OTypeCollection collection( \
+ getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider>* ) NULL ),
+
+// -------------------------------------------------------------------------------------
+
+#define IMPL_XTYPEPROVIDER_END \
+ ); \
+ pCollection = &collection; \
+ } \
+ } \
+ return (*pCollection).getTypes(); \
+}
+
+// -------------------------------------------------------------------------------------
+
+#define DECL_LISTENERMULTIPLEXER_START( ClassName, InterfaceName ) \
+class ClassName : public ListenerMultiplexerBase, public InterfaceName \
+{ \
+public: \
+ ClassName( ::cppu::OWeakObject& rSource ); \
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); \
+ void SAL_CALL acquire() throw() { ListenerMultiplexerBase::acquire(); } \
+ void SAL_CALL release() throw() { ListenerMultiplexerBase::release(); } \
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+// -------------------------------------------------------------------------------------
+
+#define DECL_LISTENERMULTIPLEXER_START_DLLPUB( ClassName, InterfaceName ) \
+class TOOLKIT_DLLPUBLIC ClassName : public ListenerMultiplexerBase, public InterfaceName \
+{ \
+public: \
+ ClassName( ::cppu::OWeakObject& rSource ); \
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); \
+ void SAL_CALL acquire() throw() { ListenerMultiplexerBase::acquire(); } \
+ void SAL_CALL release() throw() { ListenerMultiplexerBase::release(); } \
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+// -------------------------------------------------------------------------------------
+
+#define DECL_LISTENERMULTIPLEXER_END \
+};
+
+// -------------------------------------------------------------------------------------
+
+#define IMPL_LISTENERMULTIPLEXER_BASEMETHODS( ClassName, InterfaceName ) \
+ClassName::ClassName( ::cppu::OWeakObject& rSource ) \
+ : ListenerMultiplexerBase( rSource ) \
+{ \
+} \
+::com::sun::star::uno::Any ClassName::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) \
+{ \
+ ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, \
+ (static_cast< ::com::sun::star::lang::XEventListener* >(this)), \
+ (static_cast< InterfaceName* >(this)) ); \
+ return (aRet.hasValue() ? aRet : ListenerMultiplexerBase::queryInterface( rType )); \
+} \
+void ClassName::disposing( const ::com::sun::star::lang::EventObject& ) throw(::com::sun::star::uno::RuntimeException) \
+{ \
+}
+
+// -------------------------------------------------------------------------------------
+
+#if OSL_DEBUG_LEVEL > 0
+ #define DISPLAY_EXCEPTION( ClassName, MethodName, e ) \
+ OString sMessage( #ClassName "::" #MethodName ": caught an exception!\n" ); \
+ sMessage += OString( e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_ASCII_US ); \
+ OSL_FAIL( sMessage.getStr() );
+#else
+ #define DISPLAY_EXCEPTION( ClassName, MethodName, e ) (void)e;
+#endif
+
+#define IMPL_TABLISTENERMULTIPLEXER_LISTENERMETHOD_BODY_2PARAM( ClassName, InterfaceName, MethodName, ParamType1, ParamType2 ) \
+{ \
+ ParamType1 aMulti( evt ); \
+ ParamType2 aMulti2( evt2 ); \
+ ::cppu::OInterfaceIteratorHelper aIt( *this ); \
+ while( aIt.hasMoreElements() ) \
+ { \
+ ::com::sun::star::uno::Reference< InterfaceName > xListener( \
+ static_cast< InterfaceName* >( aIt.next() ) ); \
+ try \
+ { \
+ xListener->MethodName( aMulti, aMulti2 ); \
+ } \
+ catch(const ::com::sun::star::lang::DisposedException& e) \
+ { \
+ OSL_ENSURE( e.Context.is(), "caught DisposedException with empty Context field" ); \
+ if ( e.Context == xListener || !e.Context.is() ) \
+ aIt.remove(); \
+ } \
+ catch(const ::com::sun::star::uno::RuntimeException& e) \
+ { \
+ DISPLAY_EXCEPTION( ClassName, MethodName, e ) \
+ } \
+ } \
+}
+
+#define IMPL_TABLISTENERMULTIPLEXER_LISTENERMETHOD_BODY_1PARAM( ClassName, InterfaceName, MethodName, ParamType1 ) \
+{ \
+ ParamType1 aMulti( evt ); \
+ ::cppu::OInterfaceIteratorHelper aIt( *this ); \
+ while( aIt.hasMoreElements() ) \
+ { \
+ ::com::sun::star::uno::Reference< InterfaceName > xListener( \
+ static_cast< InterfaceName* >( aIt.next() ) ); \
+ try \
+ { \
+ xListener->MethodName( aMulti ); \
+ } \
+ catch(const ::com::sun::star::lang::DisposedException& e) \
+ { \
+ OSL_ENSURE( e.Context.is(), "caught DisposedException with empty Context field" ); \
+ if ( e.Context == xListener || !e.Context.is() ) \
+ aIt.remove(); \
+ } \
+ catch(const ::com::sun::star::uno::RuntimeException& e) \
+ { \
+ DISPLAY_EXCEPTION( ClassName, MethodName, e ) \
+ } \
+ } \
+}
+
+#define IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD_BODY( ClassName, InterfaceName, MethodName, EventType ) \
+{ \
+ EventType aMulti( evt ); \
+ aMulti.Source = &GetContext(); \
+ ::cppu::OInterfaceIteratorHelper aIt( *this ); \
+ while( aIt.hasMoreElements() ) \
+ { \
+ ::com::sun::star::uno::Reference< InterfaceName > xListener( \
+ static_cast< InterfaceName* >( aIt.next() ) ); \
+ try \
+ { \
+ xListener->MethodName( aMulti ); \
+ } \
+ catch(const ::com::sun::star::lang::DisposedException& e) \
+ { \
+ OSL_ENSURE( e.Context.is(), "caught DisposedException with empty Context field" ); \
+ if ( e.Context == xListener || !e.Context.is() ) \
+ aIt.remove(); \
+ } \
+ catch(const ::com::sun::star::uno::RuntimeException& e) \
+ { \
+ DISPLAY_EXCEPTION( ClassName, MethodName, e ) \
+ } \
+ } \
+}
+
+#define IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD_EXCEPTION( ClassName, InterfaceName, MethodName, EventType, Exception ) \
+void ClassName::MethodName( const EventType& evt ) throw(::com::sun::star::uno::RuntimeException, Exception) \
+IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD_BODY( ClassName, InterfaceName, MethodName, EventType )
+
+#define IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( ClassName, InterfaceName, MethodName, EventType ) \
+void ClassName::MethodName( const EventType& evt ) throw(::com::sun::star::uno::RuntimeException) \
+IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD_BODY( ClassName, InterfaceName, MethodName, EventType )
+
+// -------------------------------------------------------------------------------------
+
+#define DECLIMPL_SUPPORTS_SERVICE( ) \
+ sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw(::com::sun::star::uno::RuntimeException) \
+ { \
+ ::com::sun::star::uno::Sequence< OUString > aServiceNames( getSupportedServiceNames() ); \
+ const OUString* pSupported = aServiceNames.getConstArray(); \
+ const OUString* pSupportedEnd = pSupported + aServiceNames.getLength(); \
+ for ( ; pSupported != pSupportedEnd; ++pSupported ) \
+ if ( *pSupported == rServiceName ) \
+ return sal_True; \
+ return sal_False; \
+ }
+
+// -------------------------------------------------------------------------------------
+
+#define DECLIMPL_SERVICEINFO_DERIVED( ImplName, BaseClass, ServiceName ) \
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException) { return OUString("stardiv.Toolkit." #ImplName ); } \
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) \
+ { \
+ ::com::sun::star::uno::Sequence< OUString > aNames = BaseClass::getSupportedServiceNames( ); \
+ aNames.realloc( aNames.getLength() + 1 ); \
+ aNames[ aNames.getLength() - 1 ] = OUString::createFromAscii( ServiceName ); \
+ return aNames; \
+ } \
+
+// -------------------------------------------------------------------------------------
+
+#define DECLIMPL_SERVICEINFO( ImplName, ServiceName ) \
+ OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException) { return OUString("stardiv.Toolkit." #ImplName ); } \
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) \
+ { \
+ ::com::sun::star::uno::Sequence< OUString > aNames( 1 ); \
+ aNames[ 0 ] = OUString::createFromAscii( ServiceName ); \
+ return aNames; \
+ } \
+ DECLIMPL_SUPPORTS_SERVICE( )
+
+
+
+
+
+
+#endif // _TOOLKIT_HELPER_MACROS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/mutexandbroadcasthelper.hxx b/include/toolkit/helper/mutexandbroadcasthelper.hxx
new file mode 100644
index 000000000000..f887e018452d
--- /dev/null
+++ b/include/toolkit/helper/mutexandbroadcasthelper.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 _TOOLKIT_HELPER_MUTEXANDBROADCASTHELPER_HXX_
+#define _TOOLKIT_HELPER_MUTEXANDBROADCASTHELPER_HXX_
+
+#include <cppuhelper/interfacecontainer.h>
+
+
+// Helper class with Mutex and BroadcastHelper, because they must be
+// initialized before calling the OPropertySetHelper-CTOR
+
+class MutexAndBroadcastHelper
+{
+public:
+ MutexAndBroadcastHelper() : BrdcstHelper( Mutex ) {}
+
+ ::osl::Mutex Mutex;
+ ::cppu::OBroadcastHelper BrdcstHelper;
+
+ ::osl::Mutex& GetMutex() { return Mutex; }
+ ::cppu::OBroadcastHelper& GetBroadcastHelper() { return BrdcstHelper; }
+};
+
+#endif // _TOOLKIT_HELPER_MUTEXANDBROADCASTHELPER_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/mutexhelper.hxx b/include/toolkit/helper/mutexhelper.hxx
new file mode 100644
index 000000000000..85f98635ab73
--- /dev/null
+++ b/include/toolkit/helper/mutexhelper.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 _TOOLKIT_HELPER_MUTEXHELPER_HXX_
+#define _TOOLKIT_HELPER_MUTEXHELPER_HXX_
+
+#include <osl/mutex.hxx>
+
+// ----------------------------------------------------
+// class MutexHelper
+// ----------------------------------------------------
+
+class MutexHelper
+{
+private:
+ ::osl::Mutex maMutex;
+
+public:
+ ::osl::Mutex& GetMutex() { return maMutex; }
+
+};
+
+
+
+
+#endif // _TOOLKIT_HELPER_MUTEXHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/property.hxx b/include/toolkit/helper/property.hxx
new file mode 100644
index 000000000000..fa1fbbf2a125
--- /dev/null
+++ b/include/toolkit/helper/property.hxx
@@ -0,0 +1,254 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_HELPER_PROPERTY_HXX_
+#define _TOOLKIT_HELPER_PROPERTY_HXX_
+
+#include <toolkit/dllapi.h>
+
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+
+namespace com {
+namespace sun {
+namespace star {
+namespace uno {
+ class Type;
+ class Any;
+} } } }
+
+
+#define BASEPROPERTY_NOTFOUND 0
+
+#define BASEPROPERTY_TEXT 1 // OUString
+#define BASEPROPERTY_BACKGROUNDCOLOR 2 // sal_Int32
+#define BASEPROPERTY_FILLCOLOR 3 // sal_Int32
+#define BASEPROPERTY_TEXTCOLOR 4 // sal_Int32
+#define BASEPROPERTY_LINECOLOR 5 // sal_Int32
+#define BASEPROPERTY_BORDER 6 // sal_Int16
+#define BASEPROPERTY_ALIGN 7 // sal_Int16
+#define BASEPROPERTY_FONTDESCRIPTOR 8 // ::com::sun::star::awt::FontDescriptor
+#define BASEPROPERTY_DROPDOWN 9 // sal_Bool
+#define BASEPROPERTY_MULTILINE 10 // sal_Bool
+#define BASEPROPERTY_STRINGITEMLIST 11 // UStringSequence
+#define BASEPROPERTY_HSCROLL 12 // sal_Bool
+#define BASEPROPERTY_VSCROLL 13 // sal_Bool
+#define BASEPROPERTY_TABSTOP 14 // sal_Bool
+#define BASEPROPERTY_STATE 15 // sal_Int16
+#define BASEPROPERTY_FONT_TYPE 16 // OLD: Font_Type
+#define BASEPROPERTY_FONT_SIZE 17 // OLD: Font_Size
+#define BASEPROPERTY_FONT_ATTRIBS 18 // OLD: Font_Attribs
+#define BASEPROPERTY_DEFAULTCONTROL 19 // OUString (ServiceName)
+#define BASEPROPERTY_LABEL 20 // OUString
+#define BASEPROPERTY_LINECOUNT 21 // sal_Int16
+#define BASEPROPERTY_EXTDATEFORMAT 22 // sal_Int16
+#define BASEPROPERTY_DATESHOWCENTURY 23 // sal_Bool
+#define BASEPROPERTY_EXTTIMEFORMAT 24 // sal_Int16
+#define BASEPROPERTY_NUMSHOWTHOUSANDSEP 25 // sal_Bool
+#define BASEPROPERTY_CURRENCYSYMBOL 26 // OUString
+#define BASEPROPERTY_SPIN 27 // sal_Bool
+#define BASEPROPERTY_STRICTFORMAT 28 // sal_Bool
+#define BASEPROPERTY_DECIMALACCURACY 29 // sal_Int16
+#define BASEPROPERTY_DATE 30 // sal_Int32
+#define BASEPROPERTY_DATEMIN 31 // sal_Int32
+#define BASEPROPERTY_DATEMAX 32 // sal_Int32
+#define BASEPROPERTY_TIME 33 // sal_Int32
+#define BASEPROPERTY_TIMEMIN 34 // sal_Int32
+#define BASEPROPERTY_TIMEMAX 35 // sal_Int32
+#define BASEPROPERTY_VALUE_INT32 36 // sal_Int32
+#define BASEPROPERTY_VALUEMIN_INT32 37 // sal_Int32
+#define BASEPROPERTY_VALUEMAX_INT32 38 // sal_Int32
+#define BASEPROPERTY_VALUESTEP_INT32 39 // sal_Int32
+#define BASEPROPERTY_EDITMASK 40 // OUString
+#define BASEPROPERTY_LITERALMASK 41 // OUString
+#define BASEPROPERTY_IMAGEURL 42 // OUString
+#define BASEPROPERTY_READONLY 43 // sal_Bool
+#define BASEPROPERTY_ENABLED 44 // sal_Bool
+#define BASEPROPERTY_PRINTABLE 45 // sal_Bool
+#define BASEPROPERTY_ECHOCHAR 46 // sal_Int16
+#define BASEPROPERTY_MAXTEXTLEN 47 // sal_Int16
+#define BASEPROPERTY_HARDLINEBREAKS 48 // sal_Int16
+#define BASEPROPERTY_AUTOCOMPLETE 49 // sal_Bool
+#define BASEPROPERTY_MULTISELECTION 50 // sal_Bool
+#define BASEPROPERTY_SELECTEDITEMS 51 // INT16Sequence
+#define BASEPROPERTY_VALUE_DOUBLE 52 // DOUBLE
+#define BASEPROPERTY_VALUEMIN_DOUBLE 53 // DOUBLE
+#define BASEPROPERTY_VALUEMAX_DOUBLE 54 // DOUBLE
+#define BASEPROPERTY_VALUESTEP_DOUBLE 55 // DOUBLE
+#define BASEPROPERTY_TRISTATE 56 // sal_Bool
+#define BASEPROPERTY_DEFAULTBUTTON 57 // sal_Bool
+#define BASEPROPERTY_HELPURL 58 // OUString
+#define BASEPROPERTY_AUTOTOGGLE 59 // sal_Bool
+//#define BASEPROPERTY_FOCUSSELECTIONHIDE 60 // sal_Bool
+#define BASEPROPERTY_FORMATKEY 61 // sal_Bool
+#define BASEPROPERTY_FORMATSSUPPLIER 62 // ::com::sun::star::util::XNumberFormatsSupplier
+#define BASEPROPERTY_EFFECTIVE_VALUE 63 // Any (double or string)
+#define BASEPROPERTY_TREATASNUMBER 64 // sal_Bool
+#define BASEPROPERTY_EFFECTIVE_DEFAULT 65 // Any (double or string)
+#define BASEPROPERTY_EFFECTIVE_MIN 66 // Double
+#define BASEPROPERTY_EFFECTIVE_MAX 67 // Double
+#define BASEPROPERTY_CURSYM_POSITION 68 // sal_Bool
+#define BASEPROPERTY_TITLE 69 // OUString
+#define BASEPROPERTY_MOVEABLE 70 // sal_Bool
+#define BASEPROPERTY_CLOSEABLE 71 // sal_Bool
+#define BASEPROPERTY_SIZEABLE 72 // sal_Bool
+#define BASEPROPERTY_HELPTEXT 73 // OUString
+#define BASEPROPERTY_PROGRESSVALUE 74 // sal_Int32
+#define BASEPROPERTY_PROGRESSVALUE_MIN 75 // sal_Int32
+#define BASEPROPERTY_PROGRESSVALUE_MAX 76 // sal_Int32
+#define BASEPROPERTY_SCROLLVALUE 77 // sal_Int32
+#define BASEPROPERTY_SCROLLVALUE_MAX 78 // sal_Int32
+#define BASEPROPERTY_LINEINCREMENT 79 // sal_Int32
+#define BASEPROPERTY_BLOCKINCREMENT 80 // sal_Int32
+#define BASEPROPERTY_VISIBLESIZE 81 // sal_Int32
+#define BASEPROPERTY_ORIENTATION 82 // sal_Int32
+#define BASEPROPERTY_FONTRELIEF 83 // sal_Int16
+#define BASEPROPERTY_FONTEMPHASISMARK 84 // sal_Int16
+#define BASEPROPERTY_TEXTLINECOLOR 85 // sal_Int32
+#define BASEPROPERTY_IMAGEALIGN 86 // sal_Int16
+#define BASEPROPERTY_SCALEIMAGE 87 // sal_Bool
+#define BASEPROPERTY_PUSHBUTTONTYPE 88 // sal_Int16
+#define BASEPROPERTY_DISPLAYBACKGROUNDCOLOR 89 // sal_Int32
+#define BASEPROPERTY_AUTOMNEMONICS 90 // sal_Bool
+#define BASEPROPERTY_MOUSETRANSPARENT 91 // sal_Bool
+#define BASEPROPERTY_ACCESSIBLENAME 92 // OUString
+#define BASEPROPERTY_PLUGINPARENT 93 // sal_Int64
+#define BASEPROPERTY_SCROLLVALUE_MIN 94 // sal_Int32
+#define BASEPROPERTY_REPEAT_DELAY 95 // sal_Int32
+#define BASEPROPERTY_SYMBOL_COLOR 96 // sal_Int32
+#define BASEPROPERTY_SPINVALUE 97 // sal_Int32
+#define BASEPROPERTY_SPINVALUE_MIN 98 // sal_Int32
+#define BASEPROPERTY_SPINVALUE_MAX 99 // sal_Int32
+#define BASEPROPERTY_SPININCREMENT 100 // sal_Int32
+#define BASEPROPERTY_REPEAT 101 // sal_Bool
+#define BASEPROPERTY_ENFORCE_FORMAT 102 // sal_Bool
+#define BASEPROPERTY_LIVE_SCROLL 103 // sal_Bool
+#define BASEPROPERTY_LINE_END_FORMAT 104 // sal_Int16
+#define BASEPROPERTY_ACTIVATED 105 // sal Bool
+#define BASEPROPERTY_COMPLETE 106 // sal_Bool
+#define BASEPROPERTY_CURRENTITEMID 107 // sal_Int16
+#define BASEPROPERTY_TOGGLE 108 // sal_Bool
+#define BASEPROPERTY_FOCUSONCLICK 109 // sal_Bool
+#define BASEPROPERTY_HIDEINACTIVESELECTION 110 // sal_Bool
+#define BASEPROPERTY_VISUALEFFECT 111 // sal_Int16
+#define BASEPROPERTY_BORDERCOLOR 112 // sal_Int32
+#define BASEPROPERTY_IMAGEPOSITION 113 // sal_Int16
+#define BASEPROPERTY_NATIVE_WIDGET_LOOK 114 // sal_Bool
+#define BASEPROPERTY_VERTICALALIGN 115 // VerticalAlignment
+#define BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR 116 // sal_Int16
+#define BASEPROPERTY_GRAPHIC 117 // css.graphic.XGraphic
+#define BASEPROPERTY_STEP_TIME 118 // sal_Int32
+#define BASEPROPERTY_DECORATION 119 // sal_Bool
+#define BASEPROPERTY_PAINTTRANSPARENT 120 // sal_Bool
+#define BASEPROPERTY_AUTOHSCROLL 121 // sal_Bool
+#define BASEPROPERTY_AUTOVSCROLL 122 // sal_Bool
+#define BASEPROPERTY_DESKTOP_AS_PARENT 123 // sal_Bool
+#define BASEPROPERTY_TREE_START 124
+#define BASEPROPERTY_TREE_SELECTIONTYPE 124
+#define BASEPROPERTY_TREE_EDITABLE 125
+#define BASEPROPERTY_TREE_DATAMODEL 126
+#define BASEPROPERTY_TREE_ROOTDISPLAYED 127
+#define BASEPROPERTY_TREE_SHOWSHANDLES 128
+#define BASEPROPERTY_TREE_SHOWSROOTHANDLES 129
+#define BASEPROPERTY_ROW_HEIGHT 130
+#define BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING 131
+#define BASEPROPERTY_TREE_END 131
+#define BASEPROPERTY_DIALOGSOURCEURL 132
+#define BASEPROPERTY_NOLABEL 133 // OUString added for issue79712
+#define BASEPROPERTY_URL 134 // OUString
+#define BASEPROPERTY_UNIT 135 // ::awt::FieldUnit
+#define BASEPROPERTY_CUSTOMUNITTEXT 136 // OUString
+#define BASEPROPERTY_IMAGE_SCALE_MODE 137
+#define BASEPROPERTY_WRITING_MODE 138
+#define BASEPROPERTY_CONTEXT_WRITING_MODE 139
+#define BASEPROPERTY_GRID_SHOWROWHEADER 140
+#define BASEPROPERTY_GRID_SHOWCOLUMNHEADER 141
+#define BASEPROPERTY_GRID_DATAMODEL 142
+#define BASEPROPERTY_GRID_COLUMNMODEL 143
+#define BASEPROPERTY_GRID_SELECTIONMODE 144
+#define BASEPROPERTY_ENABLEVISIBLE 145 // sal_Bool
+#define BASEPROPERTY_REFERENCE_DEVICE 146
+
+#define BASEPROPERTY_HIGHCONTRASTMODE 147
+#define BASEPROPERTY_GRID_HEADER_BACKGROUND 148
+#define BASEPROPERTY_GRID_HEADER_TEXT_COLOR 149
+#define BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS 150
+#define BASEPROPERTY_GRID_LINE_COLOR 151
+#define BASEPROPERTY_MULTISELECTION_SIMPLEMODE 152
+#define BASEPROPERTY_ITEM_SEPARATOR_POS 153
+#define BASEPROPERTY_GROUPNAME 154 // OUString
+#define BASEPROPERTY_MULTIPAGEVALUE 155 // sal_Int32
+#define BASEPROPERTY_USERFORMCONTAINEES 156 // css::container::XNameContainer
+#define BASEPROPERTY_AUTO_REPEAT 157
+#define BASEPROPERTY_ROW_HEADER_WIDTH 158
+#define BASEPROPERTY_COLUMN_HEADER_HEIGHT 159
+#define BASEPROPERTY_USE_GRID_LINES 160
+#define BASEPROPERTY_SCROLLWIDTH 161
+#define BASEPROPERTY_SCROLLHEIGHT 162
+#define BASEPROPERTY_SCROLLTOP 163
+#define BASEPROPERTY_SCROLLLEFT 164
+#define BASEPROPERTY_ACTIVE_SEL_BACKGROUND_COLOR 165
+#define BASEPROPERTY_INACTIVE_SEL_BACKGROUND_COLOR 166
+#define BASEPROPERTY_ACTIVE_SEL_TEXT_COLOR 167
+#define BASEPROPERTY_INACTIVE_SEL_TEXT_COLOR 168
+
+
+// These properties are not bound, they are always extracted from the BASEPROPERTY_FONTDESCRIPTOR property
+#define BASEPROPERTY_FONTDESCRIPTORPART_START 1000
+#define BASEPROPERTY_FONTDESCRIPTORPART_NAME 1000 // OUString, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_STYLENAME 1001 // OUString, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_FAMILY 1002 // sal_Int16, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_CHARSET 1003 // sal_Int16, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_HEIGHT 1004 // sal_Int16, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_WEIGHT 1005 // Float, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_SLANT 1006 // sal_Int16, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_UNDERLINE 1007 // sal_Int16, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_STRIKEOUT 1008 // sal_Int16, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_WIDTH 1009 // sal_Int16, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_PITCH 1010 // sal_Int16, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_CHARWIDTH 1011 // Float, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_ORIENTATION 1012 // Float, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_KERNING 1013 // sal_Bool, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_WORDLINEMODE 1014 // sal_Bool, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_TYPE 1015 // sal_Int16, not bound
+#define BASEPROPERTY_FONTDESCRIPTORPART_END 1015
+
+#define PROPERTY_ALIGN_LEFT 0
+#define PROPERTY_ALIGN_CENTER 1
+#define PROPERTY_ALIGN_RIGHT 2
+
+#define PROPERTY_STATE_OFF 0
+#define PROPERTY_STATE_ON 1
+#define PROPERTY_STATE_DONTCARE 2
+
+TOOLKIT_DLLPUBLIC sal_uInt16 GetPropertyId( const OUString& rPropertyName );
+const ::com::sun::star::uno::Type* GetPropertyType( sal_uInt16 nPropertyId );
+TOOLKIT_DLLPUBLIC const OUString& GetPropertyName( sal_uInt16 nPropertyId );
+sal_Int16 GetPropertyAttribs( sal_uInt16 nPropertyId );
+sal_uInt16 GetPropertyOrderNr( sal_uInt16 nPropertyId );
+sal_Bool DoesDependOnOthers( sal_uInt16 nPropertyId );
+sal_Bool CompareProperties( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 );
+
+
+
+
+#endif // _TOOLKIT_HELPER_PROPERTY_HXX_
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/servicenames.hxx b/include/toolkit/helper/servicenames.hxx
new file mode 100644
index 000000000000..5105fc12484b
--- /dev/null
+++ b/include/toolkit/helper/servicenames.hxx
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_HELPER_SERVICENAMES_HXX_
+#define _TOOLKIT_HELPER_SERVICENAMES_HXX_
+
+#include <sal/types.h>
+#include <tools/solar.h>
+
+extern const sal_Char szServiceName_Toolkit[], szServiceName2_Toolkit[];
+extern const sal_Char szServiceName_MVCIntrospection[], szServiceName2_MVCIntrospection[];
+extern const sal_Char szServiceName_PopupMenu[], szServiceName2_PopupMenu[];
+extern const sal_Char szServiceName_MenuBar[], szServiceName2_MenuBar[];
+extern const sal_Char szServiceName_Pointer[], szServiceName2_Pointer[];
+extern const sal_Char szServiceName_UnoControlContainer[], szServiceName2_UnoControlContainer[];
+extern const sal_Char szServiceName_UnoControlContainerModel[], szServiceName2_UnoControlContainerModel[];
+extern const sal_Char szServiceName_UnoMultiPageControl[], szServiceName2_UnoMultiPageControl[];
+extern const sal_Char szServiceName_UnoMultiPageModel[], szServiceName2_UnoMultiPageModel[];
+extern const sal_Char szServiceName_UnoPageControl[], szServiceName2_UnoPageControl[];
+extern const sal_Char szServiceName_UnoPageModel[], szServiceName2_UnoPageModel[];
+extern const sal_Char szServiceName_UnoFrameControl[], szServiceName2_UnoFrameControl[];
+extern const sal_Char szServiceName_UnoFrameModel[], szServiceName2_UnoFrameModel[];
+extern const sal_Char szServiceName_TabController[], szServiceName2_TabController[];
+extern const sal_Char szServiceName_TabControllerModel[], szServiceName2_TabControllerModel[];
+extern const sal_Char szServiceName_UnoControlDialog[], szServiceName2_UnoControlDialog[];
+extern const sal_Char szServiceName_UnoControlDialogModel[], szServiceName2_UnoControlDialogModel[];
+extern const sal_Char szServiceName_UnoControlEdit[], szServiceName2_UnoControlEdit[];
+extern const sal_Char szServiceName_UnoControlEditModel[], szServiceName2_UnoControlEditModel[];
+extern const sal_Char szServiceName_UnoControlFileControl[], szServiceName2_UnoControlFileControl[];
+extern const sal_Char szServiceName_UnoControlFileControlModel[], szServiceName2_UnoControlFileControlModel[];
+extern const sal_Char szServiceName_UnoControlButton[], szServiceName2_UnoControlButton[];
+extern const sal_Char szServiceName_UnoControlButtonModel[], szServiceName2_UnoControlButtonModel[];
+extern const sal_Char szServiceName_UnoControlImageButton[], szServiceName2_UnoControlImageButton[];
+extern const sal_Char szServiceName_UnoControlImageButtonModel[], szServiceName2_UnoControlImageButtonModel[];
+extern const sal_Char szServiceName_UnoControlImageControl[], szServiceName2_UnoControlImageControl[];
+extern const sal_Char szServiceName_UnoControlImageControlModel[], szServiceName2_UnoControlImageControlModel[];
+extern const sal_Char szServiceName_UnoControlRadioButton[], szServiceName2_UnoControlRadioButton[];
+extern const sal_Char szServiceName_UnoControlRadioButtonModel[], szServiceName2_UnoControlRadioButtonModel[];
+extern const sal_Char szServiceName_UnoControlCheckBox[], szServiceName2_UnoControlCheckBox[];
+extern const sal_Char szServiceName_UnoControlCheckBoxModel[], szServiceName2_UnoControlCheckBoxModel[];
+extern const sal_Char szServiceName_UnoControlListBox[], szServiceName2_UnoControlListBox[];
+extern const sal_Char szServiceName_UnoControlListBoxModel[], szServiceName2_UnoControlListBoxModel[];
+extern const sal_Char szServiceName_UnoControlComboBox[], szServiceName2_UnoControlComboBox[];
+extern const sal_Char szServiceName_UnoControlComboBoxModel[], szServiceName2_UnoControlComboBoxModel[];
+extern const sal_Char szServiceName_UnoControlFixedText[], szServiceName2_UnoControlFixedText[];
+extern const sal_Char szServiceName_UnoControlFixedTextModel[], szServiceName2_UnoControlFixedTextModel[];
+extern const sal_Char szServiceName_UnoControlGroupBox[], szServiceName2_UnoControlGroupBox[];
+extern const sal_Char szServiceName_UnoControlGroupBoxModel[], szServiceName2_UnoControlGroupBoxModel[];
+extern const sal_Char szServiceName_UnoControlDateField[], szServiceName2_UnoControlDateField[];
+extern const sal_Char szServiceName_UnoControlDateFieldModel[], szServiceName2_UnoControlDateFieldModel[];
+extern const sal_Char szServiceName_UnoControlTimeField[], szServiceName2_UnoControlTimeField[];
+extern const sal_Char szServiceName_UnoControlTimeFieldModel[], szServiceName2_UnoControlTimeFieldModel[];
+extern const sal_Char szServiceName_UnoControlNumericField[], szServiceName2_UnoControlNumericField[];
+extern const sal_Char szServiceName_UnoControlNumericFieldModel[], szServiceName2_UnoControlNumericFieldModel[];
+extern const sal_Char szServiceName_UnoControlCurrencyField[], szServiceName2_UnoControlCurrencyField[];
+extern const sal_Char szServiceName_UnoControlCurrencyFieldModel[], szServiceName2_UnoControlCurrencyFieldModel[];
+extern const sal_Char szServiceName_UnoControlPatternField[], szServiceName2_UnoControlPatternField[];
+extern const sal_Char szServiceName_UnoControlPatternFieldModel[], szServiceName2_UnoControlPatternFieldModel[];
+extern const sal_Char szServiceName_UnoControlFormattedField[], szServiceName2_UnoControlFormattedField[];
+extern const sal_Char szServiceName_UnoControlFormattedFieldModel[], szServiceName2_UnoControlFormattedFieldModel[];
+extern const sal_Char szServiceName_UnoControlProgressBar[], szServiceName2_UnoControlProgressBar[];
+extern const sal_Char szServiceName_UnoControlProgressBarModel[], szServiceName2_UnoControlProgressBarModel[];
+extern const sal_Char szServiceName_UnoControlScrollBar[], szServiceName2_UnoControlScrollBar[];
+extern const sal_Char szServiceName_UnoControlScrollBarModel[], szServiceName2_UnoControlScrollBarModel[];
+extern const sal_Char szServiceName_UnoControlFixedLine[], szServiceName2_UnoControlFixedLine[];
+extern const sal_Char szServiceName_UnoControlFixedLineModel[], szServiceName2_UnoControlFixedLineModel[];
+extern const sal_Char szServiceName_PrinterServer[], szServiceName2_PrinterServer[];
+extern const sal_Char szServiceName_UnoControlRoadmap[], szServiceName2_UnoControlRoadmap[];
+extern const sal_Char szServiceName_UnoControlRoadmapModel[], szServiceName2_UnoControlRoadmapModel[];
+
+extern const sal_Char szServiceName_UnoSpinButtonControl[], szServiceName_UnoSpinButtonModel[];
+
+extern const sal_Char szServiceName_TreeControl[];
+extern const sal_Char szServiceName_TreeControlModel[];
+extern const sal_Char szServiceName_MutableTreeDataModel[];
+
+extern const sal_Char szServiceName_GridControl[];
+extern const sal_Char szServiceName_GridControlModel[];
+extern const sal_Char szServiceName_DefaultGridDataModel[];
+extern const sal_Char szServiceName_DefaultGridColumnModel[];
+extern const sal_Char szServiceName_GridColumn[];
+extern const sal_Char szServiceName_SortableGridDataModel[];
+
+extern const sal_Char szServiceName_UnoSimpleAnimationControl[], szServiceName2_UnoSimpleAnimationControl[];
+extern const sal_Char szServiceName_UnoSimpleAnimationControlModel[], szServiceName2_UnoSimpleAnimationControlModel[];
+extern const sal_Char szServiceName_UnoThrobberControl[], szServiceName2_UnoThrobberControl[];
+extern const sal_Char szServiceName_UnoThrobberControlModel[], szServiceName2_UnoThrobberControlModel[];
+extern const sal_Char szServiceName_AnimatedImagesControl[];
+extern const sal_Char szServiceName_AnimatedImagesControlModel[];
+extern const sal_Char szServiceName_SpinningProgressControlModel[];
+extern const sal_Char szServiceName_UnoControlFixedHyperlink[], szServiceName_UnoControlFixedHyperlinkModel[];
+
+extern const sal_Char szServiceName_UnoControlTabPageModel[], szServiceName2_UnoControlTabPageModel[];
+extern const sal_Char szServiceName_UnoControlTabPage[];
+extern const sal_Char szServiceName_UnoControlTabPageContainerModel[];
+extern const sal_Char szServiceName_UnoControlTabPageContainer[];
+
+// ExtUnoWrapper:
+extern const char szServiceName_ImageProducer[], szServiceName2_ImageProducer[];
+#endif // _TOOLKIT_HELPER_SERVICENAMES_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/tkresmgr.hxx b/include/toolkit/helper/tkresmgr.hxx
new file mode 100644
index 000000000000..362220aa0393
--- /dev/null
+++ b/include/toolkit/helper/tkresmgr.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 _TOOLKIT_HELPER_TKRESMGR_HXX_
+#define _TOOLKIT_HELPER_TKRESMGR_HXX_
+
+#include <rtl/ustring.hxx>
+#include <vcl/image.hxx>
+
+class SimpleResMgr;
+class ResMgr;
+
+#define TK_RES_STRING(id) TkResMgr::loadString(id)
+#define TK_RES_IMAGE(id) TkResMgr::loadImage(id)
+
+// -----------------------------------------------------------------------------
+// TkResMgr
+// -----------------------------------------------------------------------------
+
+class TkResMgr
+{
+ static SimpleResMgr* m_pSimpleResMgr;
+ static ResMgr* m_pResMgr;
+
+private:
+ // no instantiation allowed
+ TkResMgr() { }
+ ~TkResMgr() { }
+
+ // we'll instantiate one static member of the following class,
+ // which in it's dtor ensures that m_pSimpleResMgr will be deleted
+ class EnsureDelete
+ {
+ public:
+ EnsureDelete() { }
+ ~EnsureDelete();
+ };
+ friend class EnsureDelete;
+
+protected:
+ static void ensureImplExists();
+
+public:
+ // loads the string with the specified resource id
+ static OUString loadString( sal_uInt16 nResId );
+
+ // loads the image with the specified resource id
+ static Image loadImage( sal_uInt16 nResId );
+ static Image getImageFromURL( const OUString& i_rImageURL );
+};
+
+
+#endif // _TOOLKIT_HELPER_TKRESMGR_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/unopropertyarrayhelper.hxx b/include/toolkit/helper/unopropertyarrayhelper.hxx
new file mode 100644
index 000000000000..b46dcfe9bc99
--- /dev/null
+++ b/include/toolkit/helper/unopropertyarrayhelper.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 _TOOLKIT_HELPER_UNOPROPERTYARRAYHELPER_HXX_
+#define _TOOLKIT_HELPER_UNOPROPERTYARRAYHELPER_HXX_
+
+#include <toolkit/dllapi.h>
+#include <cppuhelper/propshlp.hxx>
+
+#include <list>
+#include <set>
+#include "toolkit/dllapi.h"
+
+// ----------------------------------------------------
+// class UnoPropertyArrayHelper
+// ----------------------------------------------------
+class TOOLKIT_DLLPUBLIC UnoPropertyArrayHelper : public ::cppu::IPropertyArrayHelper
+{
+private:
+ std::set<sal_Int32> maIDs;
+
+protected:
+ sal_Bool ImplHasProperty( sal_uInt16 nPropId ) const;
+
+public:
+ UnoPropertyArrayHelper( const ::com::sun::star::uno::Sequence<sal_Int32>& rIDs );
+ UnoPropertyArrayHelper( const std::list< sal_uInt16 > &rIDs );
+
+ // ::cppu::IPropertyArrayHelper
+ sal_Bool SAL_CALL fillPropertyMembersByHandle( OUString * pPropName, sal_Int16 * pAttributes, sal_Int32 nHandle );
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties();
+ ::com::sun::star::beans::Property SAL_CALL getPropertyByName(const OUString& rPropertyName) throw (::com::sun::star::beans::UnknownPropertyException);
+ sal_Bool SAL_CALL hasPropertyByName(const OUString& rPropertyName);
+ sal_Int32 SAL_CALL getHandleByName( const OUString & rPropertyName );
+ sal_Int32 SAL_CALL fillHandles( sal_Int32* pHandles, const ::com::sun::star::uno::Sequence< OUString > & rPropNames );
+};
+
+
+
+#endif // _TOOLKIT_HELPER_UNOPROPERTYARRAYHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/unowrapper.hxx b/include/toolkit/helper/unowrapper.hxx
new file mode 100644
index 000000000000..a0b82f4c175d
--- /dev/null
+++ b/include/toolkit/helper/unowrapper.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 _TOOLKIT_HELPER_UNOWRAPPER_HXX_
+#define _TOOLKIT_HELPER_UNOWRAPPER_HXX_
+
+#include <com/sun/star/awt/XToolkit.hpp>
+#include <com/sun/star/awt/XGraphics.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <toolkit/helper/accessibilityclient.hxx>
+
+#include <vcl/unowrap.hxx>
+#include <vcl/window.hxx>
+
+// ----------------------------------------------------
+// class UnoWrapper
+// ----------------------------------------------------
+
+class UnoWrapper : public UnoWrapperBase
+{
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit> mxToolkit;
+ ::toolkit::AccessibilityClient maAccessibleFactoryAccess;
+
+public:
+ UnoWrapper( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit>& rxToolkit );
+
+ virtual void Destroy();
+
+ // Toolkit
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit> GetVCLToolkit();
+
+ // Graphics
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics> CreateGraphics( OutputDevice* pOutDev );
+ virtual void ReleaseAllGraphics( OutputDevice* pOutDev );
+
+ // Window
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer> GetWindowInterface( Window* pWindow, sal_Bool bCreate );
+ virtual void SetWindowInterface( Window* pWindow, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer> xIFace );
+
+ void WindowDestroyed( Window* pWindow );
+ void WindowEvent_Move( Window* pWindow );
+ void WindowEvent_Resize( Window* pWindow );
+ void WindowEvent_Show( Window* pWindow, sal_Bool bShow );
+ void WindowEvent_Close( Window* pWindow );
+ void WindowEvent_Minimize( Window* pWindow );
+ void WindowEvent_Normalize( Window* pWindow );
+ void WindowEvent_Activate( Window* pWindow, sal_Bool bActivated );
+ void WindowEvent_MouseButtonUp( Window* pWindow, const MouseEvent& rEvt );
+ void WindowEvent_MouseButtonDown( Window* pWindow, const MouseEvent& rEvt );
+ void WindowEvent_MouseMove( Window* pWindow, const MouseEvent& rEvt );
+ void WindowEvent_Command( Window* pWindow, const CommandEvent& rCEvt );
+ void WindowEvent_KeyInput( Window* pWindow, const KeyEvent& rEvt );
+ void WindowEvent_KeyUp( Window* pWindow, const KeyEvent& rEvt );
+ void WindowEvent_GetFocus( Window* pWindow );
+ void WindowEvent_LoseFocus( Window* pWindow );
+ void WindowEvent_Paint( Window* pWindow, const Rectangle& rRect );
+
+ // Accessibility
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ CreateAccessible( Menu* pMenu, sal_Bool bIsMenuBar );
+
+private:
+ virtual ~UnoWrapper();
+};
+
+#endif // _TOOLKIT_HELPER_UNOWRAPPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/helper/vclunohelper.hxx b/include/toolkit/helper/vclunohelper.hxx
new file mode 100644
index 000000000000..cb1da9ffe4d2
--- /dev/null
+++ b/include/toolkit/helper/vclunohelper.hxx
@@ -0,0 +1,155 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+#define _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/Sequence.h>
+
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/awt/MouseEvent.hpp>
+
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class XInterface;
+}}}}
+
+namespace com { namespace sun { namespace star { namespace awt {
+ class XBitmap;
+ class XWindow;
+ class XWindow2;
+ class XWindowPeer;
+ class XGraphics;
+ class XRegion;
+ class XDevice;
+ class XPointer;
+ class XToolkit;
+ class XFont;
+ class XControlContainer;
+ struct Size;
+ struct Point;
+ struct SimpleFontMetric;
+ struct FontDescriptor;
+ struct Rectangle;
+ struct KeyEvent;
+}}}}
+
+
+#include <vcl/bitmapex.hxx>
+#include <vcl/region.hxx>
+#include <vcl/metric.hxx>
+#include <tools/mapunit.hxx>
+#include <tools/fldunit.hxx>
+#include <tools/poly.hxx>
+
+class Window;
+class OutputDevice;
+class MouseEvent;
+class KeyEvent;
+
+// ----------------------------------------------------
+// class VclUnoHelper
+// ----------------------------------------------------
+class TOOLKIT_DLLPUBLIC VCLUnoHelper
+{
+public:
+ // Toolkit
+ static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit> CreateToolkit();
+
+ // Bitmap
+ static BitmapEx GetBitmap( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap>& rxBitmap );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap> CreateBitmap( const BitmapEx& rBitmap );
+
+ // Window
+ static Window* GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& rxWindow );
+ static Window* GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow2>& rxWindow2 );
+ static Window* GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>& rxWindowPeer );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> GetInterface( Window* pWindow );
+
+ // OutputDevice
+ static OutputDevice* GetOutputDevice( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice>& rxDevice );
+ static OutputDevice* GetOutputDevice( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics>& rxGraphics );
+
+ // Region
+ static Region GetRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion );
+
+ // Polygon
+ static Polygon CreatePolygon( const ::com::sun::star::uno::Sequence< sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< sal_Int32 >& DataY );
+
+ /** convert Font to ::com::sun::star::awt::FontDescriptor
+ @param rFont Font to be converted
+ @return the new FontDescriptor
+ */
+ static ::com::sun::star::awt::FontDescriptor CreateFontDescriptor( const Font& rFont );
+ static Font CreateFont( const ::com::sun::star::awt::FontDescriptor& rDescr, const Font& rInitFont );
+ static Font CreateFont( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont >& rxFont );
+ static ::com::sun::star::awt::SimpleFontMetric CreateFontMetric( const FontMetric& rFontMetric );
+ static float ConvertFontWidth( FontWidth eWidth );
+ static FontWidth ConvertFontWidth( float f );
+ static float ConvertFontWeight( FontWeight eWeight );
+ static FontWeight ConvertFontWeight( float f );
+
+ // Rectangle
+ static sal_Bool IsZero( ::com::sun::star::awt::Rectangle rRect );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer> CreateControlContainer( Window* pWindow );
+
+ // MapUnits
+ static MapUnit UnoEmbed2VCLMapUnit( sal_Int32 nUnoEmbedMapUnit );
+ static sal_Int32 VCL2UnoEmbedMapUnit( MapUnit nVCLMapUnit );
+
+ //========================================================================
+ //= MeasurementUnitConversion
+ //========================================================================
+ /** small helper to convert between <type>MeasurementUnit</type> and
+ <type>FieldUnit</type>
+ */
+ static sal_Int16 ConvertToMeasurementUnit( FieldUnit _nFieldUnit, sal_Int16 _rFieldToUNOValueFactor );
+ static FieldUnit ConvertToFieldUnit( sal_Int16 _nMeasurementUnit, sal_Int16& _rFieldToUNOValueFactor );
+
+ static MapUnit /* MapModeUnit */ ConvertToMapModeUnit(sal_Int16 /* com.sun.star.util.MeasureUnit.* */ _nMeasureUnit) throw (::com::sun::star::lang::IllegalArgumentException);
+
+ static ::Size /* VCLSize */ ConvertToVCLSize(::com::sun::star::awt::Size const& _aSize);
+ static ::com::sun::star::awt::Size ConvertToAWTSize(::Size /* VCLSize */ const& _aSize);
+
+ static ::Point /* VCLPoint */ ConvertToVCLPoint(::com::sun::star::awt::Point const& _aPoint);
+ static ::com::sun::star::awt::Point ConvertToAWTPoint(::Point /* VCLPoint */ const& _aPoint);
+
+ static ::Rectangle ConvertToVCLRect( ::com::sun::star::awt::Rectangle const & _rRect );
+ static ::com::sun::star::awt::Rectangle ConvertToAWTRect( ::Rectangle const & _rRect );
+
+ static ::com::sun::star::awt::MouseEvent
+ createMouseEvent(
+ const ::MouseEvent& _rVclEvent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext
+ );
+
+ static ::com::sun::star::awt::KeyEvent
+ createKeyEvent(
+ const ::KeyEvent& _rVclEvent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext
+ );
+};
+
+
+#endif // _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/toolkit/unohlp.hxx b/include/toolkit/unohlp.hxx
new file mode 100644
index 000000000000..eb3bd19f1fe5
--- /dev/null
+++ b/include/toolkit/unohlp.hxx
@@ -0,0 +1,3 @@
+// ah, yes: thats a sane thing to do -- deliver the same header _twice_ with different names
+// please kill me (this file)!
+#include <toolkit/helper/vclunohelper.hxx>
diff --git a/include/tools/StringListResource.hxx b/include/tools/StringListResource.hxx
new file mode 100644
index 000000000000..52f22e48a8ef
--- /dev/null
+++ b/include/tools/StringListResource.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 TOOLS_STRINGLISTRESOURCE_HXX
+#define TOOLS_STRINGLISTRESOURCE_HXX
+
+#include <vector>
+#include <tools/resid.hxx>
+#include <tools/rcid.h>
+#include <tools/rc.hxx>
+
+namespace tools
+{
+ class StringListResource : public Resource
+ {
+ public:
+ StringListResource(const ResId& _aResId,::std::vector< OUString>& _rToFill ) : Resource(_aResId)
+ {
+ sal_uInt16 i = 1;
+ while( IsAvailableRes(ResId(i,*m_pResMgr).SetRT(RSC_STRING)) )
+ {
+ String sStr = String(ResId(i,*m_pResMgr));
+ _rToFill.push_back(sStr);
+ ++i;
+ }
+ }
+ ~StringListResource()
+ {
+ FreeResource();
+ }
+ };
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/appendunixshellword.hxx b/include/tools/appendunixshellword.hxx
new file mode 100644
index 000000000000..98fcdf8023a5
--- /dev/null
+++ b/include/tools/appendunixshellword.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_TOOLS_APPENDUNIXSHELLWORD_HXX
+#define INCLUDED_TOOLS_APPENDUNIXSHELLWORD_HXX
+
+#include "sal/config.h"
+
+#if defined UNX
+#include "tools/toolsdllapi.h"
+
+
+namespace tools {
+
+/** append arbitrary bytes as a properly quoted Unix-style shell word
+
+ @param accumulator
+ the string buffer to which the word is appended (without any surrounding
+ whitespace); must not be null
+ @param text
+ the text to add
+*/
+TOOLS_DLLPUBLIC void appendUnixShellWord(
+ OStringBuffer * accumulator, OString const & text);
+
+}
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/b3dtrans.hxx b/include/tools/b3dtrans.hxx
new file mode 100644
index 000000000000..c9e65950b1b6
--- /dev/null
+++ b/include/tools/b3dtrans.hxx
@@ -0,0 +1,259 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _B3D_B3DTRANS_HXX
+#define _B3D_B3DTRANS_HXX
+
+#define ZBUFFER_DEPTH_RANGE ((double)(256L * 256L * 256L))
+
+#include <basegfx/matrix/b3dhommatrix.hxx>
+#include <basegfx/range/b3drange.hxx>
+#include <tools/gen.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include <tools/toolsdllapi.h>
+
+/// Supported methods for setting the aspect ratio
+enum Base3DRatio
+{
+ Base3DRatioGrow = 1,
+ Base3DRatioShrink,
+ Base3DRatioMiddle
+};
+
+/// Supported projection types
+enum Base3DProjectionType
+{
+ Base3DProjectionTypeParallel = 1,
+ Base3DProjectionTypePerspective
+};
+
+/// Transformation sets for 3D output
+class TOOLS_DLLPUBLIC B3dTransformationSet
+{
+private:
+ // Object Matrix Object -> World
+ basegfx::B3DHomMatrix maObjectTrans;
+ basegfx::B3DHomMatrix maInvObjectTrans;
+
+ // Orientation Matrix
+ basegfx::B3DHomMatrix maOrientation;
+ basegfx::B3DHomMatrix maInvOrientation;
+
+ // Projection Matrix
+ basegfx::B3DHomMatrix maProjection;
+ basegfx::B3DHomMatrix maInvProjection;
+
+ // Texture Matrices
+ basegfx::B2DHomMatrix maTexture;
+
+ // Special transformation set for converting Object -> Device
+ basegfx::B3DHomMatrix maObjectToDevice;
+
+ // Transposed and inversed matrix for vector transformations
+ basegfx::B3DHomMatrix maInvTransObjectToEye;
+
+ // Transformation for World->View
+ basegfx::B3DHomMatrix maMatFromWorldToView;
+ basegfx::B3DHomMatrix maInvMatFromWorldToView;
+
+ // Parameters for ViewportTransformation
+ basegfx::B3DVector maScale;
+ basegfx::B3DVector maTranslate;
+
+ // ViewPlane DeviceRectangle (user-defined)
+ double mfLeftBound;
+ double mfRightBound;
+ double mfBottomBound;
+ double mfTopBound;
+
+ // Near and far clipping planes
+ double mfNearBound;
+ double mfFarBound;
+
+ // Aspect ratio of 3D transformation (Y / X)
+ // default: 1:1 -> 1.0
+ // Disable with value 0.0
+ double mfRatio;
+
+ // Viewport area in logical coordinates
+ Rectangle maViewportRectangle;
+ // Visible area within viewport
+ Rectangle maVisibleRectangle;
+
+ // Actual coordinates as set by CalcViewport
+ // of visible viewport area (logical coordinates)
+ Rectangle maSetBound;
+
+ // Method of keeping defined aspect ratio
+ // default: Base3DRatioGrow
+ Base3DRatio meRatio;
+
+ // Flags
+ unsigned mbPerspective : 1;
+ unsigned mbWorldToViewValid : 1;
+ unsigned mbInvTransObjectToEyeValid : 1;
+ unsigned mbObjectToDeviceValid : 1;
+ unsigned mbProjectionValid : 1;
+
+public:
+ B3dTransformationSet();
+ virtual ~B3dTransformationSet();
+
+ void Reset();
+
+ // ObjectTrans
+ const basegfx::B3DHomMatrix& GetObjectTrans() { return maObjectTrans; }
+ const basegfx::B3DHomMatrix& GetInvObjectTrans() { return maInvObjectTrans; }
+
+ // Orientation
+ void SetOrientation(
+ basegfx::B3DPoint aVRP = basegfx::B3DPoint(0.0,0.0,1.0),
+ basegfx::B3DVector aVPN = basegfx::B3DVector(0.0,0.0,1.0),
+ basegfx::B3DVector aVUP = basegfx::B3DVector(0.0,1.0,0.0));
+ const basegfx::B3DHomMatrix& GetOrientation() { return maOrientation; }
+ const basegfx::B3DHomMatrix& GetInvOrientation() { return maInvOrientation; }
+
+ // Projection
+ void SetProjection(const basegfx::B3DHomMatrix& mProject);
+ const basegfx::B3DHomMatrix& GetProjection();
+
+ // Texture
+ const basegfx::B2DHomMatrix& GetTexture() { return maTexture; }
+
+ // aspect ratio accessors and the defined method of keeping defined aspect ratio
+ double GetRatio() { return mfRatio; }
+ void SetRatio(double fNew=1.0);
+ Base3DRatio GetRatioMode() { return meRatio; }
+
+ // Parameters of ViewportTransformation
+ void SetDeviceRectangle(double fL=-1.0, double fR=1.0,
+ double fB=-1.0, double fT=1.0,
+ sal_Bool bBroadCastChange=sal_True);
+ double GetDeviceRectangleWidth() const { return mfRightBound - mfLeftBound; }
+ double GetDeviceRectangleHeight() const { return mfTopBound - mfBottomBound; }
+ double GetFrontClippingPlane() { return mfNearBound; }
+ double GetBackClippingPlane() { return mfFarBound; }
+ void SetPerspective(sal_Bool bNew);
+ sal_Bool GetPerspective() { return mbPerspective; }
+ void SetViewportRectangle(Rectangle& rRect, Rectangle& rVisible);
+ void SetViewportRectangle(Rectangle& rRect) { SetViewportRectangle(rRect, rRect); }
+ const Rectangle& GetViewportRectangle() { return maViewportRectangle; }
+ void CalcViewport();
+
+ // Direct accessors for miscellaneous transformations
+ const basegfx::B3DPoint WorldToEyeCoor(const basegfx::B3DPoint& rVec);
+ const basegfx::B3DPoint EyeToWorldCoor(const basegfx::B3DPoint& rVec);
+
+ static void Frustum(
+ basegfx::B3DHomMatrix& rTarget,
+ double fLeft = -1.0, double fRight = 1.0,
+ double fBottom = -1.0, double fTop = 1.0,
+ double fNear = 0.001, double fFar = 1.0);
+ static void Ortho(
+ basegfx::B3DHomMatrix& rTarget,
+ double fLeft = -1.0, double fRight = 1.0,
+ double fBottom = -1.0, double fTop = 1.0,
+ double fNear = 0.0, double fFar = 1.0);
+ static void Orientation(
+ basegfx::B3DHomMatrix& rTarget,
+ basegfx::B3DPoint aVRP = basegfx::B3DPoint(0.0,0.0,1.0),
+ basegfx::B3DVector aVPN = basegfx::B3DVector(0.0,0.0,1.0),
+ basegfx::B3DVector aVUP = basegfx::B3DVector(0.0,1.0,0.0));
+
+protected:
+ void PostSetObjectTrans();
+ void PostSetOrientation();
+ void PostSetProjection();
+ void PostSetViewport();
+
+ virtual void DeviceRectangleChange();
+};
+
+/** Viewport for B3D
+
+ Uses a simplified model, in which a point is described using a View
+ Reference Point (VRP).
+*/
+class TOOLS_DLLPUBLIC B3dViewport : public B3dTransformationSet
+{
+private:
+ basegfx::B3DPoint aVRP; // View Reference Point
+ basegfx::B3DVector aVPN; // View Plane Normal
+ basegfx::B3DVector aVUV; // View Up Vector
+
+public:
+ B3dViewport();
+ virtual ~B3dViewport();
+
+ void SetVUV(const basegfx::B3DVector& rNewVUV);
+ void SetViewportValues(
+ const basegfx::B3DPoint& rNewVRP,
+ const basegfx::B3DVector& rNewVPN,
+ const basegfx::B3DVector& rNewVUV);
+
+ const basegfx::B3DPoint& GetVRP() const { return aVRP; }
+ const basegfx::B3DVector& GetVPN() const { return aVPN; }
+ const basegfx::B3DVector& GetVUV() const { return aVUV; }
+
+protected:
+ void CalcOrientation();
+};
+
+// B3D camera
+
+class TOOLS_DLLPUBLIC B3dCamera : public B3dViewport
+{
+private:
+ basegfx::B3DPoint aPosition;
+ basegfx::B3DPoint aCorrectedPosition;
+ basegfx::B3DVector aLookAt;
+ double fFocalLength;
+ double fBankAngle;
+
+ unsigned bUseFocalLength : 1;
+
+public:
+ B3dCamera(
+ const basegfx::B3DPoint& rPos = basegfx::B3DPoint(0.0, 0.0, 1.0),
+ const basegfx::B3DVector& rLkAt = basegfx::B3DVector(0.0, 0.0, 0.0),
+ double fFocLen = 35.0, double fBnkAng = 0.0,
+ sal_Bool bUseFocLen = sal_False);
+ virtual ~B3dCamera();
+
+ const basegfx::B3DPoint& GetPosition() const { return aPosition; }
+ const basegfx::B3DVector& GetLookAt() const { return aLookAt; }
+
+ // Focal length in mm
+ double GetFocalLength() const { return fFocalLength; }
+
+ double GetBankAngle() const { return fBankAngle; }
+
+ sal_Bool GetUseFocalLength() const { return (sal_Bool)bUseFocalLength; }
+
+protected:
+ void CalcNewViewportValues();
+ sal_Bool CalcFocalLength();
+
+ virtual void DeviceRectangleChange();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/bigint.hxx b/include/tools/bigint.hxx
new file mode 100644
index 000000000000..d3a2c2f2cff5
--- /dev/null
+++ b/include/tools/bigint.hxx
@@ -0,0 +1,311 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _BIGINT_HXX
+#define _BIGINT_HXX
+
+#include <climits>
+#include <rtl/ustring.hxx>
+#include "tools/toolsdllapi.h"
+#include <tools/solar.h>
+
+class SvStream;
+
+#ifdef _TLBIGINT_INT64
+struct SbxINT64;
+struct SbxUINT64;
+#endif
+
+#define MAX_DIGITS 8
+
+class Fraction;
+
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED BigInt
+{
+private:
+ long nVal;
+ unsigned short nNum[MAX_DIGITS];
+ sal_uInt8 nLen : 5; // current length
+ sal_Bool bIsNeg : 1, // Is Sign negative?
+ bIsBig : 1, // sal_True == BigInt
+ bIsSet : 1; // Not "Null" (not "not 0")
+
+ TOOLS_DLLPRIVATE void MakeBigInt(BigInt const &);
+ TOOLS_DLLPRIVATE void Normalize();
+ TOOLS_DLLPRIVATE void Mult(BigInt const &, sal_uInt16);
+ TOOLS_DLLPRIVATE void Div(sal_uInt16, sal_uInt16 &);
+ TOOLS_DLLPRIVATE sal_Bool IsLess(BigInt const &) const;
+ TOOLS_DLLPRIVATE void AddLong(BigInt &, BigInt &);
+ TOOLS_DLLPRIVATE void SubLong(BigInt &, BigInt &);
+ TOOLS_DLLPRIVATE void MultLong(BigInt const &, BigInt &) const;
+ TOOLS_DLLPRIVATE void DivLong(BigInt const &, BigInt &) const;
+ TOOLS_DLLPRIVATE void ModLong(BigInt const &, BigInt &) const;
+ TOOLS_DLLPRIVATE sal_Bool ABS_IsLess(BigInt const &) const;
+
+public:
+ BigInt();
+ BigInt( short nVal );
+ BigInt( long nVal );
+ BigInt( int nVal );
+ BigInt( double nVal );
+ BigInt( sal_uInt16 nVal );
+ BigInt( sal_uInt32 nVal );
+ BigInt( const BigInt& rBigInt );
+ BigInt( const OUString& rString );
+#ifdef _TLBIGINT_INT64
+ BigInt( const SbxINT64 &r );
+ BigInt( const SbxUINT64 &r );
+#endif
+
+ operator short() const;
+ operator long() const;
+ operator int() const;
+ operator double() const;
+ operator sal_uInt16() const;
+ operator sal_uIntPtr() const;
+
+ void Set( sal_Bool bSet ) { bIsSet = bSet; }
+ OUString GetString() const;
+
+ sal_Bool IsSet() const { return bIsSet; }
+ sal_Bool IsNeg() const;
+ sal_Bool IsZero() const;
+ sal_Bool IsOne() const;
+ sal_Bool IsLong() const { return !bIsBig; }
+ void Abs();
+#ifdef _TLBIGINT_INT64
+ sal_Bool INT64 ( SbxINT64 *p ) const;
+ sal_Bool UINT64( SbxUINT64 *p ) const;
+#endif
+
+ BigInt& operator =( const BigInt& rVal );
+ BigInt& operator +=( const BigInt& rVal );
+ BigInt& operator -=( const BigInt& rVal );
+ BigInt& operator *=( const BigInt& rVal );
+ BigInt& operator /=( const BigInt& rVal );
+ BigInt& operator %=( const BigInt& rVal );
+
+ BigInt& operator =( const short nValue );
+ BigInt& operator =( const long nValue );
+ BigInt& operator =( const int nValue );
+ BigInt& operator =( const sal_uInt16 nValue );
+
+ friend inline BigInt operator +( const BigInt& rVal1, const BigInt& rVal2 );
+ friend inline BigInt operator -( const BigInt& rVal1, const BigInt& rVal2 );
+ friend inline BigInt operator *( const BigInt& rVal1, const BigInt& rVal2 );
+ friend inline BigInt operator /( const BigInt& rVal1, const BigInt& rVal2 );
+ friend inline BigInt operator %( const BigInt& rVal1, const BigInt& rVal2 );
+
+ TOOLS_DLLPUBLIC friend sal_Bool operator==( const BigInt& rVal1, const BigInt& rVal2 );
+ friend inline sal_Bool operator!=( const BigInt& rVal1, const BigInt& rVal2 );
+ TOOLS_DLLPUBLIC friend sal_Bool operator< ( const BigInt& rVal1, const BigInt& rVal2 );
+ TOOLS_DLLPUBLIC friend sal_Bool operator> ( const BigInt& rVal1, const BigInt& rVal2 );
+ friend inline sal_Bool operator<=( const BigInt& rVal1, const BigInt& rVal2 );
+ friend inline sal_Bool operator>=( const BigInt& rVal1, const BigInt& rVal2 );
+
+ friend class Fraction;
+};
+
+inline BigInt::BigInt()
+{
+ bIsSet = sal_False;
+ bIsBig = sal_False;
+ nVal = 0;
+}
+
+inline BigInt::BigInt( short nValue )
+{
+ bIsSet = sal_True;
+ bIsBig = sal_False;
+ nVal = nValue;
+}
+
+inline BigInt::BigInt( long nValue )
+{
+ bIsSet = sal_True;
+ bIsBig = sal_False;
+ nVal = nValue;
+}
+
+inline BigInt::BigInt( int nValue )
+{
+ bIsSet = sal_True;
+ bIsBig = sal_False;
+ nVal = nValue;
+}
+
+inline BigInt::BigInt( sal_uInt16 nValue )
+{
+ bIsSet = sal_True;
+ bIsBig = sal_False;
+ nVal = nValue;
+}
+
+inline BigInt::operator short() const
+{
+ if ( !bIsBig && nVal >= SHRT_MIN && nVal <= SHRT_MAX )
+ return (short)nVal;
+ else
+ return 0;
+}
+
+inline BigInt::operator long() const
+{
+ if ( !bIsBig )
+ return nVal;
+ else
+ return 0;
+}
+
+inline BigInt::operator int() const
+{
+ if ( !bIsBig && (nVal == (long)(int)nVal) )
+ return (int)nVal;
+ else
+ return 0;
+}
+
+inline BigInt::operator sal_uInt16() const
+{
+ if ( !bIsBig && nVal >= 0 && nVal <= USHRT_MAX )
+ return (sal_uInt16)nVal;
+ else
+ return 0;
+}
+
+inline BigInt& BigInt::operator =( const short nValue )
+{
+ bIsSet = sal_True;
+ bIsBig = sal_False;
+ nVal = nValue;
+
+ return *this;
+}
+
+inline BigInt& BigInt::operator =( const long nValue )
+{
+ bIsSet = sal_True;
+ bIsBig = sal_False;
+ nVal = nValue;
+
+ return *this;
+}
+
+inline BigInt& BigInt::operator =( const int nValue )
+{
+ bIsSet = sal_True;
+ bIsBig = sal_False;
+ nVal = nValue;
+
+ return *this;
+}
+
+inline BigInt& BigInt::operator =( const sal_uInt16 nValue )
+{
+ bIsSet = sal_True;
+ bIsBig = sal_False;
+ nVal = nValue;
+
+ return *this;
+}
+
+inline sal_Bool BigInt::IsNeg() const
+{
+ if ( !bIsBig )
+ return (nVal < 0);
+ else
+ return (sal_Bool)bIsNeg;
+}
+
+inline sal_Bool BigInt::IsZero() const
+{
+ if ( bIsBig )
+ return sal_False;
+ else
+ return (nVal == 0);
+}
+
+inline sal_Bool BigInt::IsOne() const
+{
+ if ( bIsBig )
+ return sal_False;
+ else
+ return (nVal == 1);
+}
+
+inline void BigInt::Abs()
+{
+ if ( bIsBig )
+ bIsNeg = sal_False;
+ else if ( nVal < 0 )
+ nVal = -nVal;
+}
+
+inline BigInt operator+( const BigInt &rVal1, const BigInt &rVal2 )
+{
+ BigInt aErg( rVal1 );
+ aErg += rVal2;
+ return aErg;
+}
+
+inline BigInt operator-( const BigInt &rVal1, const BigInt &rVal2 )
+{
+ BigInt aErg( rVal1 );
+ aErg -= rVal2;
+ return aErg;
+}
+
+inline BigInt operator*( const BigInt &rVal1, const BigInt &rVal2 )
+{
+ BigInt aErg( rVal1 );
+ aErg *= rVal2;
+ return aErg;
+}
+
+inline BigInt operator/( const BigInt &rVal1, const BigInt &rVal2 )
+{
+ BigInt aErg( rVal1 );
+ aErg /= rVal2;
+ return aErg;
+}
+
+inline BigInt operator%( const BigInt &rVal1, const BigInt &rVal2 )
+{
+ BigInt aErg( rVal1 );
+ aErg %= rVal2;
+ return aErg;
+}
+
+inline sal_Bool operator!=( const BigInt& rVal1, const BigInt& rVal2 )
+{
+ return !(rVal1 == rVal2);
+}
+
+inline sal_Bool operator<=( const BigInt& rVal1, const BigInt& rVal2 )
+{
+ return !( rVal1 > rVal2);
+}
+
+inline sal_Bool operator>=( const BigInt& rVal1, const BigInt& rVal2 )
+{
+ return !(rVal1 < rVal2);
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/cachestr.hxx b/include/tools/cachestr.hxx
new file mode 100644
index 000000000000..60c31e298cf8
--- /dev/null
+++ b/include/tools/cachestr.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 _CACHESTR_HXX
+#define _CACHESTR_HXX
+
+#include <tools/stream.hxx>
+#include <tools/string.hxx>
+#include "tools/toolsdllapi.h"
+
+class TempFile;
+
+class TOOLS_DLLPUBLIC SvCacheStream : public SvStream
+{
+private:
+ String aFileName;
+ sal_uIntPtr nMaxSize;
+ int bPersistent;
+
+ SvStream* pSwapStream;
+ SvStream* pCurrentStream;
+ TempFile* pTempFile;
+
+ TOOLS_DLLPRIVATE virtual sal_uIntPtr GetData( void* pData,
+ sal_uIntPtr nSize );
+ TOOLS_DLLPRIVATE virtual sal_uIntPtr PutData( const void* pData,
+ sal_uIntPtr nSize );
+ TOOLS_DLLPRIVATE virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos );
+ TOOLS_DLLPRIVATE virtual void FlushData();
+ TOOLS_DLLPRIVATE virtual void SetSize( sal_uIntPtr nSize );
+
+public:
+ SvCacheStream( sal_uIntPtr nMaxMemSize = 0 );
+ ~SvCacheStream();
+
+ void SetFilename( const String& rFN )
+ { aFileName = rFN; } // call only from FilenameHdl
+ const String& GetFilename() const { return aFileName; }
+
+ void SwapOut();
+ const void* GetBuffer();
+ sal_uIntPtr GetSize();
+
+ sal_Bool IsPersistent() { return bPersistent != 0; }
+ void SetPersistence( sal_Bool b = sal_True ) { bPersistent = b; }
+ void SetSwapStream( SvStream *p )
+ { pSwapStream = p; } // call only from FilenameHdl
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
new file mode 100644
index 000000000000..911088b9cad1
--- /dev/null
+++ b/include/tools/color.hxx
@@ -0,0 +1,215 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _TOOLS_COLOR_HXX
+#define _TOOLS_COLOR_HXX
+
+#include "tools/toolsdllapi.h"
+
+class SvStream;
+class ResId;
+
+#include <tools/solar.h>
+#include <basegfx/color/bcolor.hxx>
+
+// Color types
+typedef sal_uInt32 ColorData;
+#define RGB_COLORDATA( r,g,b ) ((ColorData)(((sal_uInt32)((sal_uInt8)(b))))|(((sal_uInt32)((sal_uInt8)(g)))<<8)|(((sal_uInt32)((sal_uInt8)(r)))<<16))
+#define TRGB_COLORDATA( t,r,g,b ) ((ColorData)(((sal_uInt32)((sal_uInt8)(b))))|(((sal_uInt32)((sal_uInt8)(g)))<<8)|(((sal_uInt32)((sal_uInt8)(r)))<<16)|(((sal_uInt32)((sal_uInt8)(t)))<<24))
+#define COLORDATA_RED( n ) ((sal_uInt8)((n)>>16))
+#define COLORDATA_GREEN( n ) ((sal_uInt8)(((sal_uInt16)(n)) >> 8))
+#define COLORDATA_BLUE( n ) ((sal_uInt8)(n))
+#define COLORDATA_TRANSPARENCY( n ) ((sal_uInt8)((n)>>24))
+#define COLORDATA_RGB( n ) ((ColorData)((n) & 0x00FFFFFF))
+
+#define COL_BLACK RGB_COLORDATA( 0x00, 0x00, 0x00 )
+#define COL_BLUE RGB_COLORDATA( 0x00, 0x00, 0x80 )
+#define COL_GREEN RGB_COLORDATA( 0x00, 0x80, 0x00 )
+#define COL_CYAN RGB_COLORDATA( 0x00, 0x80, 0x80 )
+#define COL_RED RGB_COLORDATA( 0x80, 0x00, 0x00 )
+#define COL_MAGENTA RGB_COLORDATA( 0x80, 0x00, 0x80 )
+#define COL_BROWN RGB_COLORDATA( 0x80, 0x80, 0x00 )
+#define COL_GRAY RGB_COLORDATA( 0x80, 0x80, 0x80 )
+#define COL_LIGHTGRAY RGB_COLORDATA( 0xC0, 0xC0, 0xC0 )
+#define COL_LIGHTBLUE RGB_COLORDATA( 0x00, 0x00, 0xFF )
+#define COL_LIGHTGREEN RGB_COLORDATA( 0x00, 0xFF, 0x00 )
+#define COL_LIGHTCYAN RGB_COLORDATA( 0x00, 0xFF, 0xFF )
+#define COL_LIGHTRED RGB_COLORDATA( 0xFF, 0x00, 0x00 )
+#define COL_LIGHTMAGENTA RGB_COLORDATA( 0xFF, 0x00, 0xFF )
+#define COL_LIGHTGRAYBLUE RGB_COLORDATA( 0xE0, 0xE0, 0xFF )
+#define COL_YELLOW RGB_COLORDATA( 0xFF, 0xFF, 0x00 )
+#define COL_WHITE RGB_COLORDATA( 0xFF, 0xFF, 0xFF )
+#define COL_TRANSPARENT TRGB_COLORDATA( 0xFF, 0xFF, 0xFF, 0xFF )
+#define COL_AUTO (ColorData)0xFFFFFFFF
+#define COL_AUTHOR1_DARK RGB_COLORDATA(198, 146, 0)
+#define COL_AUTHOR1_NORMAL RGB_COLORDATA(255, 255, 158)
+#define COL_AUTHOR1_LIGHT RGB_COLORDATA(255, 255, 195)
+#define COL_AUTHOR2_DARK RGB_COLORDATA(6, 70, 162)
+#define COL_AUTHOR2_NORMAL RGB_COLORDATA(216, 232, 255)
+#define COL_AUTHOR2_LIGHT RGB_COLORDATA(233, 242, 255)
+#define COL_AUTHOR3_DARK RGB_COLORDATA(87, 157, 28)
+#define COL_AUTHOR3_NORMAL RGB_COLORDATA(218, 248, 193)
+#define COL_AUTHOR3_LIGHT RGB_COLORDATA(226, 250, 207)
+#define COL_AUTHOR4_DARK RGB_COLORDATA(105, 43, 157)
+#define COL_AUTHOR4_NORMAL RGB_COLORDATA(228, 210, 245)
+#define COL_AUTHOR4_LIGHT RGB_COLORDATA(239, 228, 248)
+#define COL_AUTHOR5_DARK RGB_COLORDATA(197, 0, 11)
+#define COL_AUTHOR5_NORMAL RGB_COLORDATA(254, 205, 208)
+#define COL_AUTHOR5_LIGHT RGB_COLORDATA(255, 227, 229)
+#define COL_AUTHOR6_DARK RGB_COLORDATA(0, 128, 128)
+#define COL_AUTHOR6_NORMAL RGB_COLORDATA(210, 246, 246)
+#define COL_AUTHOR6_LIGHT RGB_COLORDATA(230, 250, 250)
+#define COL_AUTHOR7_DARK RGB_COLORDATA(140, 132, 0)
+#define COL_AUTHOR7_NORMAL RGB_COLORDATA(237, 252, 163)
+#define COL_AUTHOR7_LIGHT RGB_COLORDATA(242, 254, 181)
+#define COL_AUTHOR8_DARK RGB_COLORDATA(53, 85, 107)
+#define COL_AUTHOR8_NORMAL RGB_COLORDATA(211, 222, 232)
+#define COL_AUTHOR8_LIGHT RGB_COLORDATA(226, 234, 241)
+#define COL_AUTHOR9_DARK RGB_COLORDATA(209, 118, 0)
+#define COL_AUTHOR9_NORMAL RGB_COLORDATA(255, 226, 185)
+#define COL_AUTHOR9_LIGHT RGB_COLORDATA(255, 231, 199)
+
+#define COLOR_CHANNEL_MERGE( _def_cDst, _def_cSrc, _def_cSrcTrans ) \
+ ((sal_uInt8)((((long)(_def_cDst)-(_def_cSrc))*(_def_cSrcTrans)+(((_def_cSrc)<<8L)|(_def_cDst)))>>8L))
+
+// Color
+
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Color
+{
+protected:
+ ColorData mnColor;
+
+public:
+ Color() { mnColor = COL_BLACK; }
+ Color( ColorData nColor ) { mnColor = nColor; }
+ Color( sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue )
+ { mnColor = RGB_COLORDATA( nRed, nGreen, nBlue ); }
+ Color( sal_uInt8 nTransparency, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue )
+ { mnColor = TRGB_COLORDATA( nTransparency, nRed, nGreen, nBlue ); }
+ // This ctor is defined in svtools, not tools!
+ Color( const ResId& rResId );
+
+ // constructor to create a tools-Color from ::basegfx::BColor
+ explicit Color(const ::basegfx::BColor& rBColor)
+ {
+ mnColor = RGB_COLORDATA(
+ sal_uInt8((rBColor.getRed() * 255.0) + 0.5),
+ sal_uInt8((rBColor.getGreen() * 255.0) + 0.5),
+ sal_uInt8((rBColor.getBlue() * 255.0) + 0.5));
+ }
+
+ void SetRed( sal_uInt8 nRed );
+ sal_uInt8 GetRed() const { return COLORDATA_RED( mnColor ); }
+ void SetGreen( sal_uInt8 nGreen );
+ sal_uInt8 GetGreen() const { return COLORDATA_GREEN( mnColor ); }
+ void SetBlue( sal_uInt8 nBlue );
+ sal_uInt8 GetBlue() const { return COLORDATA_BLUE( mnColor ); }
+ void SetTransparency( sal_uInt8 nTransparency );
+ sal_uInt8 GetTransparency() const { return COLORDATA_TRANSPARENCY( mnColor ); }
+
+ void SetColor( ColorData nColor ) { mnColor = nColor; }
+ ColorData GetColor() const { return mnColor; }
+ ColorData GetRGBColor() const { return COLORDATA_RGB( mnColor ); }
+
+ sal_uInt8 GetColorError( const Color& rCompareColor ) const;
+
+ sal_uInt8 GetLuminance() const;
+ void IncreaseLuminance( sal_uInt8 cLumInc );
+ void DecreaseLuminance( sal_uInt8 cLumDec );
+
+ void DecreaseContrast( sal_uInt8 cContDec );
+
+ void Invert();
+
+ void Merge( const Color& rMergeColor, sal_uInt8 cTransparency );
+
+ sal_Bool IsRGBEqual( const Color& rColor ) const;
+
+ // comparison with luminance thresholds
+ sal_Bool IsDark() const;
+ sal_Bool IsBright() const;
+
+ // color space conversion tools
+ // the range for h/s/b is:
+ // Hue: 0-360 degree
+ // Saturation: 0-100 %
+ // Brightness: 0-100 %
+ static ColorData HSBtoRGB( sal_uInt16 nHue, sal_uInt16 nSat, sal_uInt16 nBri );
+ void RGBtoHSB( sal_uInt16& nHue, sal_uInt16& nSat, sal_uInt16& nBri ) const;
+
+ sal_Bool operator==( const Color& rColor ) const
+ { return (mnColor == rColor.mnColor); }
+ sal_Bool operator!=( const Color& rColor ) const
+ { return !(Color::operator==( rColor )); }
+
+ SvStream& Read( SvStream& rIStm, sal_Bool bNewFormat = sal_True );
+ SvStream& Write( SvStream& rOStm, sal_Bool bNewFormat = sal_True );
+
+ TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Color& rColor );
+ TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Color& rColor );
+
+ // get ::basegfx::BColor from this color
+ ::basegfx::BColor getBColor() const { return ::basegfx::BColor(GetRed() / 255.0, GetGreen() / 255.0, GetBlue() / 255.0); }
+};
+
+inline void Color::SetRed( sal_uInt8 nRed )
+{
+ mnColor &= 0xFF00FFFF;
+ mnColor |= ((sal_uInt32)nRed)<<16;
+}
+
+inline void Color::SetGreen( sal_uInt8 nGreen )
+{
+ mnColor &= 0xFFFF00FF;
+ mnColor |= ((sal_uInt16)nGreen)<<8;
+}
+
+inline void Color::SetBlue( sal_uInt8 nBlue )
+{
+ mnColor &= 0xFFFFFF00;
+ mnColor |= nBlue;
+}
+
+inline void Color::SetTransparency( sal_uInt8 nTransparency )
+{
+ mnColor &= 0x00FFFFFF;
+ mnColor |= ((sal_uInt32)nTransparency)<<24;
+}
+
+inline sal_Bool Color::IsRGBEqual( const Color& rColor ) const
+{
+ return (COLORDATA_RGB( mnColor ) == COLORDATA_RGB( rColor.mnColor ));
+}
+
+inline sal_uInt8 Color::GetLuminance() const
+{
+ return( (sal_uInt8) ( ( COLORDATA_BLUE( mnColor ) * 29UL +
+ COLORDATA_GREEN( mnColor ) * 151UL +
+ COLORDATA_RED( mnColor ) * 76UL ) >> 8UL ) );
+}
+
+inline void Color::Merge( const Color& rMergeColor, sal_uInt8 cTransparency )
+{
+ SetRed( COLOR_CHANNEL_MERGE( COLORDATA_RED( mnColor ), COLORDATA_RED( rMergeColor.mnColor ), cTransparency ) );
+ SetGreen( COLOR_CHANNEL_MERGE( COLORDATA_GREEN( mnColor ), COLORDATA_GREEN( rMergeColor.mnColor ), cTransparency ) );
+ SetBlue( COLOR_CHANNEL_MERGE( COLORDATA_BLUE( mnColor ), COLORDATA_BLUE( rMergeColor.mnColor ), cTransparency ) );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/config.hxx b/include/tools/config.hxx
new file mode 100644
index 000000000000..1e73d32b5a33
--- /dev/null
+++ b/include/tools/config.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _CONFIG_HXX
+#define _CONFIG_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/string.hxx>
+
+struct ImplConfigData;
+struct ImplGroupData;
+
+class TOOLS_DLLPUBLIC Config
+{
+private:
+ OUString maFileName;
+ OString maGroupName;
+ ImplConfigData* mpData;
+ ImplGroupData* mpActGroup;
+ sal_uIntPtr mnDataUpdateId;
+ sal_uInt16 mnLockCount;
+ sal_Bool mbPersistence;
+ sal_Bool mbDummy1;
+
+#ifdef _CONFIG_CXX
+ TOOLS_DLLPRIVATE sal_Bool ImplUpdateConfig() const;
+ TOOLS_DLLPRIVATE ImplGroupData* ImplGetGroup() const;
+#endif
+
+public:
+ Config( const OUString& rFileName );
+ ~Config();
+
+ const OUString& GetPathName() const { return maFileName; }
+
+ void SetGroup(const OString& rGroup);
+ const OString& GetGroup() const { return maGroupName; }
+ void DeleteGroup(const OString& rGroup);
+ OString GetGroupName(sal_uInt16 nGroup) const;
+ sal_uInt16 GetGroupCount() const;
+ sal_Bool HasGroup(const OString& rGroup) const;
+
+ OString ReadKey(const OString& rKey) const;
+ OUString ReadKey(const OString& rKey, rtl_TextEncoding eEncoding) const;
+ OString ReadKey(const OString& rKey, const OString& rDefault) const;
+ void WriteKey(const OString& rKey, const OString& rValue);
+ void DeleteKey(const OString& rKey);
+ OString GetKeyName(sal_uInt16 nKey) const;
+ OString ReadKey(sal_uInt16 nKey) const;
+ sal_uInt16 GetKeyCount() const;
+
+ sal_Bool IsLocked() const { return (mnLockCount != 0); }
+ void Flush();
+
+ void EnablePersistence( sal_Bool bPersistence = sal_True )
+ { mbPersistence = bPersistence; }
+ sal_Bool IsPersistenceEnabled() const { return mbPersistence; }
+
+private:
+ TOOLS_DLLPRIVATE Config( const Config& rConfig );
+ TOOLS_DLLPRIVATE Config& operator = ( const Config& rConfig );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/contnr.hxx b/include/tools/contnr.hxx
new file mode 100644
index 000000000000..5b31f6897d77
--- /dev/null
+++ b/include/tools/contnr.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _CONTNR_HXX
+#define _CONTNR_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/solar.h>
+
+#include <limits.h>
+
+#define CONTAINER_APPEND ULONG_MAX
+#define CONTAINER_ENTRY_NOTFOUND ULONG_MAX
+#define LIST_APPEND CONTAINER_APPEND
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/date.hxx b/include/tools/date.hxx
new file mode 100644
index 000000000000..22586c4aaf47
--- /dev/null
+++ b/include/tools/date.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 _DATE_HXX
+#define _DATE_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/solar.h>
+
+class ResId;
+
+enum DayOfWeek { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY,
+ SATURDAY, SUNDAY };
+
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Date
+{
+private:
+ sal_uInt32 nDate;
+
+public:
+ enum DateInitSystem
+ {
+ SYSTEM
+ };
+
+ // TODO temporary until all uses are inspected and resolved
+ enum DateInitEmpty
+ {
+ EMPTY
+ };
+
+ Date( DateInitEmpty)
+ { nDate = 0; }
+ Date( DateInitSystem );
+ Date( const ResId & rResId );
+ Date( sal_uInt32 _nDate ) { Date::nDate = _nDate; }
+ Date( const Date& rDate )
+ { nDate = rDate.nDate; }
+ Date( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear )
+ { nDate = ( sal_uInt32( nDay % 100 ) ) +
+ ( ( sal_uInt32( nMonth % 100 ) ) * 100 ) +
+ ( ( sal_uInt32( nYear % 10000 ) ) * 10000); }
+
+ void SetDate( sal_uInt32 nNewDate ) { nDate = nNewDate; }
+ sal_uInt32 GetDate() const { return nDate; }
+
+ void SetDay( sal_uInt16 nNewDay );
+ void SetMonth( sal_uInt16 nNewMonth );
+ void SetYear( sal_uInt16 nNewYear );
+ sal_uInt16 GetDay() const { return (sal_uInt16)(nDate % 100); }
+ sal_uInt16 GetMonth() const { return (sal_uInt16)((nDate / 100) % 100); }
+ sal_uInt16 GetYear() const { return (sal_uInt16)(nDate / 10000); }
+
+ /// Internally normalizes a copy of values.
+ DayOfWeek GetDayOfWeek() const;
+
+ /// Internally normalizes a copy of values.
+ sal_uInt16 GetDayOfYear() const;
+
+ /** nMinimumNumberOfDaysInWeek: how many days of a week must reside in the
+ first week of a year.
+ Internally normalizes a copy of values. */
+ sal_uInt16 GetWeekOfYear( DayOfWeek eStartDay = MONDAY,
+ sal_Int16 nMinimumNumberOfDaysInWeek = 4 ) const;
+
+ /// Internally normalizes a copy of values.
+ sal_uInt16 GetDaysInMonth() const;
+
+ sal_uInt16 GetDaysInYear() const { return (IsLeapYear()) ? 366 : 365; }
+ sal_Bool IsLeapYear() const;
+
+ /** If the represented date is valid (1<=month<=12, 1<=day<=(28,29,30,31)
+ depending on month/year) AND is of the Gregorian calendar (1582-10-15
+ <= date) (AND implicitly date <= 9999-12-31 due to internal
+ representation) */
+ sal_Bool IsValidAndGregorian() const;
+
+ /** If the represented date is valid (1<=month<=12, 1<=day<=(28,29,30,31)
+ depending on month/year) */
+ bool IsValidDate() const;
+
+ /** Normalize date, invalid day or month values are adapted such that they
+ carry over to the next month or/and year, for example 1999-02-32
+ becomes 1999-03-04, 1999-13-01 becomes 2000-01-01, 1999-13-42 becomes
+ 2000-02-11. Truncates at 9999-12-31, 0000-00-x will yield the
+ normalized value of 0000-01-max(1,(x-31))
+
+ This may be necessary after Date ctors or if the SetDate(), SetDay(),
+ SetMonth(), SetYear() methods set individual non-matching values.
+ Adding/subtracting to/from dates never produces invalid dates.
+
+ @returns TRUE if the date was normalized, i.e. not valid before.
+ */
+ bool Normalize();
+
+ sal_Bool IsBetween( const Date& rFrom, const Date& rTo ) const
+ { return ((nDate >= rFrom.nDate) &&
+ (nDate <= rTo.nDate)); }
+
+ sal_Bool operator ==( const Date& rDate ) const
+ { return (nDate == rDate.nDate); }
+ sal_Bool operator !=( const Date& rDate ) const
+ { return (nDate != rDate.nDate); }
+ sal_Bool operator >( const Date& rDate ) const
+ { return (nDate > rDate.nDate); }
+ sal_Bool operator <( const Date& rDate ) const
+ { return (nDate < rDate.nDate); }
+ sal_Bool operator >=( const Date& rDate ) const
+ { return (nDate >= rDate.nDate); }
+ sal_Bool operator <=( const Date& rDate ) const
+ { return (nDate <= rDate.nDate); }
+
+ Date& operator =( const Date& rDate )
+ { nDate = rDate.nDate; return *this; }
+ Date& operator +=( long nDays );
+ Date& operator -=( long nDays );
+ Date& operator ++();
+ Date& operator --();
+ Date operator ++( int );
+ Date operator --( int );
+
+ TOOLS_DLLPUBLIC friend Date operator +( const Date& rDate, long nDays );
+ TOOLS_DLLPUBLIC friend Date operator -( const Date& rDate, long nDays );
+ TOOLS_DLLPUBLIC friend long operator -( const Date& rDate1, const Date& rDate2 );
+
+ /// Internally normalizes values.
+ static long DateToDays( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear );
+ /// Semantically identical to IsValidDate() member method.
+ static bool IsValidDate( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear );
+ /// Semantically identical to Normalize() member method.
+ static bool Normalize( sal_uInt16 & rDay, sal_uInt16 & rMonth, sal_uInt16 & rYear );
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/datetime.hxx b/include/tools/datetime.hxx
new file mode 100644
index 000000000000..1de0f3d6432c
--- /dev/null
+++ b/include/tools/datetime.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 _DATETIME_HXX
+#define _DATETIME_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/solar.h>
+#include <tools/date.hxx>
+#include <tools/time.hxx>
+
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED DateTime : public Date, public Time
+{
+public:
+ enum DateTimeInitSystem
+ {
+ SYSTEM
+ };
+
+ // TODO temporary until all uses are inspected and resolved
+ enum DateTimeInitEmpty
+ {
+ EMPTY
+ };
+
+ DateTime( DateTimeInitEmpty ) : Date( Date::EMPTY ), Time( Time::EMPTY ) {}
+ DateTime( DateTimeInitSystem ) : Date( Date::SYSTEM ), Time( Time::SYSTEM ) {}
+ DateTime( const DateTime& rDateTime ) :
+ Date( rDateTime ), Time( rDateTime ) {}
+ DateTime( const Date& rDate ) : Date( rDate ), Time(0) {}
+ DateTime( const Time& rTime ) : Date(0), Time( rTime ) {}
+ DateTime( const Date& rDate, const Time& rTime ) :
+ Date( rDate ), Time( rTime ) {}
+
+ sal_Bool IsBetween( const DateTime& rFrom,
+ const DateTime& rTo ) const;
+
+ sal_Bool IsEqualIgnoreNanoSec( const DateTime& rDateTime ) const
+ {
+ if ( Date::operator!=( rDateTime ) )
+ return sal_False;
+ return Time::IsEqualIgnoreNanoSec( rDateTime );
+ }
+
+ sal_Bool operator ==( const DateTime& rDateTime ) const
+ { return (Date::operator==( rDateTime ) &&
+ Time::operator==( rDateTime )); }
+ sal_Bool operator !=( const DateTime& rDateTime ) const
+ { return (Date::operator!=( rDateTime ) ||
+ Time::operator!=( rDateTime )); }
+ sal_Bool operator >( const DateTime& rDateTime ) const;
+ sal_Bool operator <( const DateTime& rDateTime ) const;
+ sal_Bool operator >=( const DateTime& rDateTime ) const;
+ sal_Bool operator <=( const DateTime& rDateTime ) const;
+
+ long GetSecFromDateTime( const Date& rDate ) const;
+
+ void ConvertToUTC() { *this -= Time::GetUTCOffset(); }
+ void ConvertToLocalTime() { *this += Time::GetUTCOffset(); }
+
+ DateTime& operator +=( long nDays )
+ { Date::operator+=( nDays ); return *this; }
+ DateTime& operator -=( long nDays )
+ { Date::operator-=( nDays ); return *this; }
+ DateTime& operator +=( double fTimeInDays );
+ DateTime& operator -=( double fTimeInDays )
+ { return operator+=( -fTimeInDays ); }
+ DateTime& operator +=( const Time& rTime );
+ DateTime& operator -=( const Time& rTime );
+
+ TOOLS_DLLPUBLIC friend DateTime operator +( const DateTime& rDateTime, long nDays );
+ TOOLS_DLLPUBLIC friend DateTime operator -( const DateTime& rDateTime, long nDays );
+ TOOLS_DLLPUBLIC friend DateTime operator +( const DateTime& rDateTime, double fTimeInDays );
+ TOOLS_DLLPUBLIC friend DateTime operator -( const DateTime& rDateTime, double fTimeInDays )
+ { return operator+( rDateTime, -fTimeInDays ); }
+ TOOLS_DLLPUBLIC friend DateTime operator +( const DateTime& rDateTime, const Time& rTime );
+ TOOLS_DLLPUBLIC friend DateTime operator -( const DateTime& rDateTime, const Time& rTime );
+ TOOLS_DLLPUBLIC friend double operator -( const DateTime& rDateTime1, const DateTime& rDateTime2 );
+ TOOLS_DLLPUBLIC friend long operator -( const DateTime& rDateTime, const Date& rDate )
+ { return (const Date&) rDateTime - rDate; }
+
+ DateTime& operator =( const DateTime& rDateTime );
+
+ void GetWin32FileDateTime( sal_uInt32 & rLower, sal_uInt32 & rUpper );
+ static DateTime CreateFromWin32FileDateTime( const sal_uInt32 & rLower, const sal_uInt32 & rUpper );
+};
+
+inline DateTime& DateTime::operator =( const DateTime& rDateTime )
+{
+ Date::operator=( rDateTime );
+ Time::operator=( rDateTime );
+ return *this;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/debug.hxx b/include/tools/debug.hxx
new file mode 100644
index 000000000000..54160502257a
--- /dev/null
+++ b/include/tools/debug.hxx
@@ -0,0 +1,496 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _TOOLS_DEBUG_HXX
+#define _TOOLS_DEBUG_HXX
+
+#include "tools/toolsdllapi.h"
+
+#include <sal/detail/log.h>
+#include <sal/types.h>
+#include <tools/solar.h>
+
+/** The facilities provided by this header are deprecated. True assertions
+ (that detect broken program logic) should use standard assert (which aborts
+ if an assertion fails, and is controlled by the standard NDEBUG macro).
+ Logging of warnings (e.g., about malformed input) and traces (e.g., about
+ steps taken while executing some protocol) should use the facilities
+ provided by sal/log.hxx.
+
+ Because the assertion macro (DBG_ASSERT) has been used for
+ true assertions as well as to log warnings, it maps to SAL_WARN instead of
+ standard assert. The warning and error macros (DBG_ASSERTWARNING,
+ DBG_WARNING, DBG_WARNING1, ..., DBG_WARNING3, DBG_ERRORFILE) all map to
+ SAL_INFO.
+*/
+
+#ifdef DBG_UTIL
+
+typedef void (*DbgPrintLine)( const sal_Char* pLine );
+typedef const sal_Char* (*DbgUsr)(const void* pThis );
+typedef void (*DbgTestSolarMutexProc)();
+
+#define DBG_BUF_MAXLEN 16384
+
+#define DBG_TEST_XTOR (0x00000FFF)
+#define DBG_TEST_XTOR_THIS (0x00000001)
+#define DBG_TEST_XTOR_FUNC (0x00000002)
+#define DBG_TEST_XTOR_EXIT (0x00000004)
+#define DBG_TEST_XTOR_REPORT (0x00000008)
+#define DBG_TEST_XTOR_TRACE (0x00000010)
+
+#define DBG_TEST_PROFILING (0x01000000)
+#define DBG_TEST_RESOURCE (0x02000000)
+#define DBG_TEST_DIALOG (0x04000000)
+#define DBG_TEST_BOLDAPPFONT (0x08000000)
+
+#define DBG_OUT_NULL 0
+#define DBG_OUT_FILE 1
+#define DBG_OUT_WINDOW 2
+#define DBG_OUT_SHELL 3
+#define DBG_OUT_MSGBOX 4
+#define DBG_OUT_TESTTOOL 5
+#define DBG_OUT_DEBUGGER 6
+#define DBG_OUT_ABORT 7
+
+#define DBG_OUT_COUNT 8
+
+// user (runtime) defined output channels
+#define DBG_OUT_USER_CHANNEL_0 100
+
+struct DbgData
+{
+ sal_uIntPtr nTestFlags;
+ sal_uIntPtr bOverwrite;
+ sal_uIntPtr nTraceOut;
+ sal_uIntPtr nWarningOut;
+ sal_uIntPtr nErrorOut;
+ sal_uIntPtr bHookOSLAssert;
+ sal_Char aDebugName[260];
+ sal_Char aInclFilter[512];
+ sal_Char aExclFilter[512];
+ sal_Char aInclClassFilter[512];
+ sal_Char aExclClassFilter[512];
+ sal_Char aDbgWinState[50]; // DbgGUIData for VCL
+};
+
+struct DbgDataType
+{
+ void* pData;
+ sal_Char const * pName;
+};
+
+// Dbg prototypes
+#define DBG_FUNC_DEBUGSTART 1
+#define DBG_FUNC_DEBUGEND 2
+#define DBG_FUNC_GLOBALDEBUGEND 3
+#define DBG_FUNC_GETDATA 4
+#define DBG_FUNC_SAVEDATA 5
+#define DBG_FUNC_SETPRINTMSGBOX 6
+#define DBG_FUNC_SETPRINTWINDOW 7
+#define DBG_FUNC_SETPRINTTESTTOOL 8
+#define DBG_FUNC_XTORINFO 10
+#define DBG_FUNC_COREDUMP 12
+#define DBG_FUNC_ALLERROROUT 13
+#define DBG_FUNC_SETTESTSOLARMUTEX 14
+#define DBG_FUNC_TESTSOLARMUTEX 15
+#define DBG_FUNC_PRINTFILE 16
+#define DBG_FUNC_GETPRINTMSGBOX 17
+#define DBG_FUNC_FILTERMESSAGE 18 // new for #i38967
+#define DBG_FUNC_UPDATEOSLHOOK 19
+#define DBG_FUNC_SET_ABORT 20
+
+TOOLS_DLLPUBLIC void* DbgFunc( sal_uInt16 nAction, void* pData = NULL );
+
+inline void DbgUpdateOslHook( DbgData* pData )
+{
+ DbgFunc( DBG_FUNC_UPDATEOSLHOOK, pData );
+}
+
+inline void DbgDebugStart()
+{
+ DbgFunc( DBG_FUNC_DEBUGSTART );
+}
+
+inline void DbgDebugEnd()
+{
+ DbgFunc( DBG_FUNC_DEBUGEND );
+}
+
+inline void DbgGlobalDebugEnd()
+{
+ DbgFunc( DBG_FUNC_GLOBALDEBUGEND );
+}
+
+inline void DbgSetPrintMsgBox( DbgPrintLine pProc )
+{
+ DbgFunc( DBG_FUNC_SETPRINTMSGBOX, (void*)(long)pProc );
+}
+
+inline DbgPrintLine DbgGetPrintMsgBox()
+{
+ return (DbgPrintLine)(long)DbgFunc( DBG_FUNC_GETPRINTMSGBOX );
+}
+
+inline void DbgSetPrintWindow( DbgPrintLine pProc )
+{
+ DbgFunc( DBG_FUNC_SETPRINTWINDOW, (void*)(long)pProc );
+}
+
+inline void DbgSetPrintTestTool( DbgPrintLine pProc )
+{
+ DbgFunc( DBG_FUNC_SETPRINTTESTTOOL, (void*)(long)pProc );
+}
+
+inline void DbgSetAbort( DbgPrintLine pProc )
+{
+ DbgFunc( DBG_FUNC_SET_ABORT, (void*)(long)pProc );
+}
+
+typedef sal_uInt16 DbgChannelId;
+
+/** registers a user-defined channel for emitting the diagnostic messages
+
+ Note that such a user-defined channel cannot be revoked during the lifetime
+ of the process. Thus, it's the caller's responsibility to ensure that the
+ procedure to which ->pProc points remains valid.
+
+ @param pProc
+ the function for emitting the diagnostic messages
+ @return
+ a unique number for this channel, which can be used for ->DbgData::nErrorOut,
+ ->DbgData::nWarningOut and ->DbgData::nTraceOut
+ @see DBG_OUT_USER_CHANNEL_0
+
+ (In theory, this function could replace the other hard-coded channels. Well, at least
+ the ones for MsgBox, Window, Shell, TestTool. Perhaps in the next life ...)
+*/
+TOOLS_DLLPUBLIC DbgChannelId DbgRegisterUserChannel( DbgPrintLine pProc );
+
+inline sal_Bool DbgFilterMessage( const char* pMsg )
+{
+ return (sal_Bool)(long) DbgFunc( DBG_FUNC_FILTERMESSAGE, (void*)pMsg );
+}
+
+inline int DbgIsAllErrorOut()
+{
+ return (DbgFunc( DBG_FUNC_ALLERROROUT ) != 0);
+}
+
+inline DbgData* DbgGetData()
+{
+ return (DbgData*)DbgFunc( DBG_FUNC_GETDATA );
+}
+
+inline void DbgSaveData( const DbgData& rData )
+{
+ DbgFunc( DBG_FUNC_SAVEDATA, (void*)&rData );
+}
+
+inline sal_uIntPtr DbgIsTraceOut()
+{
+ DbgData* pData = DbgGetData();
+ if ( pData )
+ return (pData->nTraceOut != DBG_OUT_NULL);
+ else
+ return sal_False;
+}
+
+inline sal_uIntPtr DbgIsWarningOut()
+{
+ DbgData* pData = DbgGetData();
+ if ( pData )
+ return (pData->nWarningOut != DBG_OUT_NULL);
+ else
+ return sal_False;
+}
+
+inline sal_uIntPtr DbgIsErrorOut()
+{
+ DbgData* pData = DbgGetData();
+ if ( pData )
+ return (pData->nErrorOut != DBG_OUT_NULL);
+ else
+ return sal_False;
+}
+
+inline sal_uIntPtr DbgGetErrorOut() // Testtool: test whether to collect OSL_ASSERTions as well
+{
+ DbgData* pData = DbgGetData();
+ if ( pData )
+ return pData->nErrorOut;
+ else
+ return DBG_OUT_NULL;
+}
+
+inline sal_uIntPtr DbgIsAssertWarning()
+{
+ return DbgIsWarningOut();
+}
+
+inline sal_uIntPtr DbgIsAssert()
+{
+ return DbgIsErrorOut();
+}
+
+inline sal_uIntPtr DbgIsResource()
+{
+ DbgData* pData = DbgGetData();
+ if ( pData )
+ return pData->nTestFlags & DBG_TEST_RESOURCE;
+ else
+ return sal_False;
+}
+
+inline sal_uIntPtr DbgIsDialog()
+{
+ DbgData* pData = DbgGetData();
+ if ( pData )
+ return pData->nTestFlags & DBG_TEST_DIALOG;
+ else
+ return sal_False;
+}
+
+inline sal_uIntPtr DbgIsBoldAppFont()
+{
+ DbgData* pData = DbgGetData();
+ if ( pData )
+ return pData->nTestFlags & DBG_TEST_BOLDAPPFONT;
+ else
+ return sal_False;
+}
+
+inline void DbgXtorInfo( sal_Char* pBuf )
+{
+ DbgFunc( DBG_FUNC_XTORINFO, (void*)pBuf );
+}
+
+inline void DbgCoreDump()
+{
+ DbgFunc( DBG_FUNC_COREDUMP );
+}
+
+inline void DbgSetTestSolarMutex( DbgTestSolarMutexProc pProc )
+{
+ DbgFunc( DBG_FUNC_SETTESTSOLARMUTEX, (void*)(long)pProc );
+}
+
+inline void DbgTestSolarMutex()
+{
+ DbgFunc( DBG_FUNC_TESTSOLARMUTEX );
+}
+
+inline void DbgPrintFile( const sal_Char* pLine )
+{
+ DbgFunc( DBG_FUNC_PRINTFILE, (void*)(sal_Char*)pLine );
+}
+
+// Dbg output
+#define DBG_OUT_TRACE 1
+#define DBG_OUT_WARNING 2
+#define DBG_OUT_ERROR 3
+
+TOOLS_DLLPUBLIC void DbgOut( const sal_Char* pMsg, sal_uInt16 nOutType = DBG_OUT_TRACE,
+ const sal_Char* pFile = NULL, sal_uInt16 nLine = 0 );
+TOOLS_DLLPUBLIC void DbgPrintShell(char const * message);
+TOOLS_DLLPUBLIC void DbgOutTypef( sal_uInt16 nOutType, const sal_Char* pFStr, ... );
+TOOLS_DLLPUBLIC void DbgOutf( const sal_Char* pFStr, ... );
+TOOLS_DLLPUBLIC void ImpDbgOutfBuf( sal_Char* pBuf, const sal_Char* pFStr, ... );
+
+// Dbg test functions
+
+#define DBG_PROF_START 1
+#define DBG_PROF_STOP 2
+#define DBG_PROF_CONTINUE 3
+#define DBG_PROF_PAUSE 4
+
+TOOLS_DLLPUBLIC void DbgProf( sal_uInt16 nAction, DbgDataType* );
+
+#define DBG_XTOR_CTOR 1
+#define DBG_XTOR_DTOR 2
+#define DBG_XTOR_CHKTHIS 3
+#define DBG_XTOR_CHKOBJ 4
+#define DBG_XTOR_DTOROBJ 0x8000
+
+TOOLS_DLLPUBLIC void DbgXtor( DbgDataType* pDbgData,
+ sal_uInt16 nAction, const void* pThis, DbgUsr fDbgUsr );
+
+class DbgXtorObj
+{
+private:
+ DbgDataType* pDbgData;
+ const void* pThis;
+ DbgUsr fDbgUsr;
+ sal_uInt16 nAction;
+
+public:
+ DbgXtorObj( DbgDataType* pData,
+ sal_uInt16 nAct, const void* pThs, DbgUsr fUsr )
+ {
+ DbgXtor( pData, nAct, pThs, fUsr );
+ pDbgData = pData;
+ nAction = nAct;
+ pThis = pThs;
+ fDbgUsr = fUsr;
+ }
+
+ ~DbgXtorObj()
+ {
+ DbgXtor( pDbgData, nAction | DBG_XTOR_DTOROBJ,
+ pThis, fDbgUsr );
+ }
+};
+
+// (internally used) defines
+
+#define DBG_FUNC( aName ) DbgName_##aName()
+#define DBG_NAME( aName ) static DbgDataType aImpDbgData_##aName = { 0, #aName }; \
+ DbgDataType* DBG_FUNC( aName ) { return &aImpDbgData_##aName; }
+#define DBG_NAMEEX_VISIBILITY( aName, vis ) vis DbgDataType* DBG_FUNC( aName );
+#define DBG_NAMEEX( aName ) DBG_NAMEEX_VISIBILITY( aName, )
+
+// (externally used) defines
+
+#define DBG_DEBUGSTART() DbgDebugStart()
+#define DBG_DEBUGEND() DbgDebugEnd()
+#define DBG_GLOBALDEBUGEND() DbgGlobalDebugEnd()
+
+#define DBG_PROFSTART( aName ) \
+ DbgProf( DBG_PROF_START, DBG_FUNC( aName ) )
+
+#define DBG_PROFSTOP( aName ) \
+ DbgProf( DBG_PROF_STOP, DBG_FUNC( aName ) )
+
+#define DBG_PROFCONTINUE( aName ) \
+ DbgProf( DBG_PROF_CONTINUE, DBG_FUNC( aName ) )
+
+#define DBG_PROFPAUSE( aName ) \
+ DbgProf( DBG_PROF_PAUSE, DBG_FUNC( aName ) )
+
+#define DBG_CTOR( aName, fTest ) \
+ DbgXtorObj aDbgXtorObj( DBG_FUNC( aName ), \
+ DBG_XTOR_CTOR, \
+ (const void*)this, \
+ fTest )
+
+#define DBG_DTOR( aName, fTest ) \
+ DbgXtorObj aDbgXtorObj( DBG_FUNC( aName ), \
+ DBG_XTOR_DTOR, \
+ (const void*)this, \
+ fTest )
+
+#define DBG_CHKTHIS( aName, fTest ) \
+ DbgXtorObj aDbgXtorObj( DBG_FUNC( aName ), \
+ DBG_XTOR_CHKTHIS, \
+ (const void*)this, \
+ fTest )
+
+#define DBG_CHKOBJ( pObj, aName, fTest ) \
+ DbgXtor( DBG_FUNC( aName ), DBG_XTOR_CHKOBJ, \
+ (const void*)pObj, (DbgUsr)fTest )
+
+#define DBG_ASSERTWARNING( sCon, aWarning ) \
+ SAL_DETAIL_INFO_IF_FORMAT(!(sCon), "legacy.tools", aWarning)
+
+#define DBG_ASSERT( sCon, aError ) \
+ SAL_DETAIL_WARN_IF_FORMAT(!(sCon), "legacy.tools", aError)
+
+#define DBG_WARNING( aWarning ) \
+ SAL_DETAIL_INFO_IF_FORMAT(true, "legacy.tools", aWarning)
+#define DBG_WARNING1( aWarning, x1 ) \
+ SAL_DETAIL_INFO_IF_FORMAT(true, "legacy.tools", aWarning, x1)
+#define DBG_WARNING2( aWarning, x1, x2 ) \
+ SAL_DETAIL_INFO_IF_FORMAT(true, "legacy.tools", aWarning, x1, x2)
+#define DBG_WARNING3( aWarning, x1, x2, x3 ) \
+ SAL_DETAIL_INFO_IF_FORMAT(true, "legacy.tools", aWarning, x1, x2, x3)
+
+#define DBG_ERRORFILE( aError ) \
+ SAL_DETAIL_INFO_IF_FORMAT(true, "legacy.tools", aError, __FILE__, __LINE__)
+
+#define DBG_TESTSOLARMUTEX() \
+do \
+{ \
+ DbgTestSolarMutex(); \
+} while(0)
+
+// en-/disable debug defines
+
+#define DBG_INSTOUTTRACE( nOut ) \
+do \
+{ \
+ DbgGetData()->nTraceOut = nOut; \
+} while(0)
+
+#define DBG_INSTOUTWARNING( nOut ) \
+do \
+{ \
+ DbgGetData()->nWarningOut = nOut; \
+} while(0)
+
+#define DBG_INSTOUTERROR( nOut ) \
+do \
+{ \
+ DbgGetData()->nErrorOut = nOut; \
+} while(0)
+
+#else
+// NO DBG_UITL
+
+struct DbgData;
+struct DbgDataType;
+
+typedef void (*DbgPrintLine)( const sal_Char* pLine );
+typedef const sal_Char* (*DbgUsr)(const void* pThis );
+
+#define DBG_DEBUGSTART() ((void)0)
+#define DBG_DEBUGEND() ((void)0)
+#define DBG_GLOBALDEBUGEND() ((void)0)
+
+#define DBG_NAME( aName )
+#define DBG_NAMEEX( aName )
+#define DBG_NAMEEX_VISIBILITY( aName, vis )
+
+#define DBG_PROFSTART( aName ) ((void)0)
+#define DBG_PROFSTOP( aName ) ((void)0)
+#define DBG_PROFCONTINUE( aName ) ((void)0)
+#define DBG_PROFPAUSE( aName ) ((void)0)
+
+#define DBG_CTOR( aName, fTest ) ((void)0)
+#define DBG_DTOR( aName, fTest ) ((void)0)
+#define DBG_CHKTHIS( aName, fTest ) ((void)0)
+#define DBG_CHKOBJ( pObj, aName, fTest ) ((void)0)
+
+#define DBG_ASSERTWARNING( sCon, aWarning ) ((void)0)
+#define DBG_ASSERT( sCon, aError ) ((void)0)
+#define DBG_WARNING( aWarning ) ((void)0)
+#define DBG_WARNING1( aWarning, x1 ) ((void)0)
+#define DBG_WARNING2( aWarning, x1, x2 ) ((void)0)
+#define DBG_WARNING3( aWarning, x1, x2, x3 ) ((void)0)
+#define DBG_ERRORFILE( aError ) ((void)0)
+
+#define DBG_TESTSOLARMUTEX() ((void)0)
+
+#define DBG_INSTOUTTRACE( nOut ) ((void)0)
+#define DBG_INSTOUTWARNING( nOut ) ((void)0)
+#define DBG_INSTOUTERROR( nOut ) ((void)0)
+
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/diagnose_ex.h b/include/tools/diagnose_ex.h
new file mode 100644
index 000000000000..261c0aecaf6d
--- /dev/null
+++ b/include/tools/diagnose_ex.h
@@ -0,0 +1,186 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef TOOLS_DIAGNOSE_EX_H
+#define TOOLS_DIAGNOSE_EX_H
+
+#include <osl/diagnose.h>
+#include <rtl/ustring.hxx>
+
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+
+#include <boost/current_function.hpp>
+
+#define OSL_UNUSED( expression ) \
+ (void)(expression)
+
+#if OSL_DEBUG_LEVEL > 0
+ #include <com/sun/star/configuration/CorruptedConfigurationException.hpp>
+ #include <com/sun/star/task/ErrorCodeIOException.hpp>
+ #include <cppuhelper/exc_hlp.hxx>
+ #include <osl/diagnose.h>
+ #include <osl/thread.h>
+ #include <boost/current_function.hpp>
+ #include <typeinfo>
+
+ /** reports a caught UNO exception via OSL diagnostics
+
+ Note that whenever you use this, it might be an indicator that your error
+ handling is not correct ....
+ */
+ #define DBG_UNHANDLED_EXCEPTION() \
+ ::com::sun::star::uno::Any caught( ::cppu::getCaughtException() ); \
+ OString sMessage( "caught an exception!" ); \
+ sMessage += "\nin function:"; \
+ sMessage += BOOST_CURRENT_FUNCTION; \
+ sMessage += "\ntype: "; \
+ sMessage += OUStringToOString( caught.getValueTypeName(), osl_getThreadTextEncoding() ); \
+ ::com::sun::star::uno::Exception exception; \
+ caught >>= exception; \
+ if ( !exception.Message.isEmpty() ) \
+ { \
+ sMessage += "\nmessage: "; \
+ sMessage += OUStringToOString( exception.Message, osl_getThreadTextEncoding() ); \
+ } \
+ if ( exception.Context.is() ) \
+ { \
+ const char* pContext = typeid( *exception.Context.get() ).name(); \
+ sMessage += "\ncontext: "; \
+ sMessage += pContext; \
+ } \
+ { \
+ ::com::sun::star::configuration::CorruptedConfigurationException \
+ specialized; \
+ if ( caught >>= specialized ) \
+ { \
+ sMessage += "\ndetails: "; \
+ sMessage += OUStringToOString( \
+ specialized.Details, osl_getThreadTextEncoding() ); \
+ } \
+ } \
+ { \
+ ::com::sun::star::task::ErrorCodeIOException specialized; \
+ if ( caught >>= specialized ) \
+ { \
+ sMessage += "\ndetails: "; \
+ sMessage += OString::valueOf( specialized.ErrCode ); \
+ } \
+ } \
+ sMessage += "\n"; \
+ OSL_ENSURE( false, sMessage.getStr() )
+
+#else // OSL_DEBUG_LEVEL
+ #define DBG_UNHANDLED_EXCEPTION()
+#endif // OSL_DEBUG_LEVEL
+
+/** This macro asserts the given condition (in debug mode), and throws
+ an IllegalArgumentException afterwards.
+ */
+#define ENSURE_ARG_OR_THROW(c, m) if( !(c) ) { \
+ OSL_ENSURE(c, m); \
+ throw ::com::sun::star::lang::IllegalArgumentException( \
+ OUString(BOOST_CURRENT_FUNCTION) + \
+ OUString( ",\n" m ), \
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(), \
+ 0 ); }
+#define ENSURE_ARG_OR_THROW2(c, m, ifc, arg) if( !(c) ) { \
+ OSL_ENSURE(c, m); \
+ throw ::com::sun::star::lang::IllegalArgumentException( \
+ OUString(BOOST_CURRENT_FUNCTION) + \
+ OUString( ",\n" m ), \
+ ifc, \
+ arg ); }
+
+/** This macro asserts the given condition (in debug mode), and throws
+ an RuntimeException afterwards.
+ */
+#define ENSURE_OR_THROW(c, m) \
+ if( !(c) ){ \
+ OSL_ENSURE(c, m); \
+ throw ::com::sun::star::uno::RuntimeException( \
+ OUString(BOOST_CURRENT_FUNCTION) + \
+ OUString( ",\n" m ), \
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); }
+
+#define ENSURE_OR_THROW2(c, m, ifc) \
+ if( !(c) ) { \
+ OSL_ENSURE(c, m); \
+ throw ::com::sun::star::uno::RuntimeException( \
+ OUString(BOOST_CURRENT_FUNCTION) + \
+ OUString( ",\n" m ), \
+ ifc ); }
+
+/** This macro asserts the given condition (in debug mode), and
+ returns the given value afterwards.
+ */
+#define ENSURE_OR_RETURN(c, m, r) if( !(c) ) { \
+ OSL_ENSURE(c, m); \
+ return r; }
+
+/** This macro asserts the given condition (in debug mode), and
+ returns false afterwards.
+ */
+#define ENSURE_OR_RETURN_FALSE(c, m) \
+ ENSURE_OR_RETURN(c, m, false)
+
+/** This macro asserts the given condition (in debug mode), and
+ returns afterwards, without return value "void".
+ */
+#define ENSURE_OR_RETURN_VOID( c, m ) \
+ if( !(c) ) \
+ { \
+ OSL_ENSURE( c, m ); \
+ return; \
+ }
+
+
+
+/** This macro asserts the given condition (in debug mode), and
+ returns afterwards, without return value "void".
+ */
+#define ENSURE_OR_RETURN_VOID( c, m ) \
+ if( !(c) ) \
+ { \
+ OSL_ENSURE( c, m ); \
+ return; \
+ }
+
+/** asserts a given condition (in debug mode), and continues the most-inner
+ loop if the condition is not met
+*/
+#define ENSURE_OR_CONTINUE( c, m ) \
+ if ( !(c) ) \
+ { \
+ OSL_ENSURE( false, m ); \
+ continue; \
+ }
+
+/** asserts a given condition (in debug mode), and continues the most-inner
+ loop if the condition is not met
+*/
+#define ENSURE_OR_BREAK( c, m ) \
+ if ( !(c) ) \
+ { \
+ OSL_ENSURE( false, m ); \
+ break; \
+ }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/errcode.hxx b/include/tools/errcode.hxx
new file mode 100644
index 000000000000..884e9f09748e
--- /dev/null
+++ b/include/tools/errcode.hxx
@@ -0,0 +1,313 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _ERRCODE_HXX
+#define _ERRCODE_HXX
+
+#ifndef __RSC
+#include <tools/solar.h>
+#endif
+
+/*
+
+01234567012345670123456701234567
+|| || ||| || |
+Warning || || |
+ | || || || |
+ Dynamic || || |
+ | || || |
+ Subsystemarea| || |
+ | || |
+ | || |
+ | || |
+ Class| |
+ | |
+ | |
+ | |
+ Code
+*/
+
+#define ERRCODE_BUTTON_OK 0x01
+#define ERRCODE_BUTTON_CANCEL 0x02
+#define ERRCODE_BUTTON_RETRY 0x04
+#define ERRCODE_BUTTON_OK_CANCEL 0x03
+#define ERRCODE_BUTTON_OK_RETRY_CANCEL 0x07
+#define ERRCODE_BUTTON_NO 0x08
+#define ERRCODE_BUTTON_YES 0x10
+#define ERRCODE_BUTTON_YES_NO 0x18
+#define ERRCODE_BUTTON_YES_NO_CANCEL 0x1a
+
+#define ERRCODE_BUTTON_DEF_OK 0x100
+#define ERRCODE_BUTTON_DEF_CANCEL 0x200
+#define ERRCODE_BUTTON_DEF_YES 0x300
+#define ERRCODE_BUTTON_DEF_NO 0x400
+
+#define ERRCODE_MSG_ERROR 0x1000
+#define ERRCODE_MSG_WARNING 0x2000
+#define ERRCODE_MSG_INFO 0x3000
+#define ERRCODE_MSG_QUERY 0x4000
+
+#define ERRCODE_ERROR_MASK 0x3fffffffUL
+#define ERRCODE_WARNING_MASK 0x80000000UL
+#define ERRCODE_RES_MASK 0x7fff
+
+#define ERRCODE_CLASS_SHIFT 8
+#define ERRCODE_AREA_SHIFT 13
+#define ERRCODE_DYNAMIC_SHIFT 26
+
+#define ERRCODE_CLASS_MASK (31UL <<ERRCODE_CLASS_SHIFT)
+
+#define ERRCODE_DYNAMIC_START (1UL <<ERRCODE_DYNAMIC_SHIFT)
+#define ERRCODE_DYNAMIC_COUNT 31UL
+#define ERRCODE_DYNAMIC_MASK (31UL <<ERRCODE_DYNAMIC_SHIFT)
+
+#ifdef __RSC
+
+#define ERRCODE_TOERRID(x) (x & ~ERRCODE_DYNAMIC_MASK)
+#define ERRCODE_TOERROR(x) \
+ ((x & ERRCODE_WARNING_MASK) ? 0 : (x & ERRCODE_ERROR_MASK))
+
+#else
+
+typedef sal_uIntPtr ErrCode;
+
+inline sal_uIntPtr ERRCODE_TOERRID( sal_uIntPtr x )
+{
+ return x & ~ERRCODE_DYNAMIC_MASK;
+}
+
+inline sal_uIntPtr ERRCODE_TOERROR( sal_uIntPtr x )
+{
+ return ((x & ERRCODE_WARNING_MASK) ? 0 : (x & ERRCODE_ERROR_MASK));
+}
+
+#endif
+
+#define ERRCODE_AREA_TOOLS (0UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_SV (1UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_SFX (2UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_INET (3UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_IO ERRCODE_AREA_TOOLS
+
+#define ERRCODE_AREA_LIB1 (8UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_SVX ERRCODE_AREA_LIB1
+#define ERRCODE_AREA_SVX_END (ERRCODE_AREA_SO-1)
+#define ERRCODE_AREA_SO (9UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_SO_END (ERRCODE_AREA_SBX-1)
+#define ERRCODE_AREA_SBX (10UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_SBX_END ((11UL << ERRCODE_AREA_SHIFT) - 1)
+#define ERRCODE_AREA_DB (11UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_DB_END ((12UL << ERRCODE_AREA_SHIFT) - 1)
+#define ERRCODE_AREA_JAVA (12UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_JAVA_END ((13UL << ERRCODE_AREA_SHIFT) - 1)
+#define ERRCODE_AREA_UUI (13UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_UUI_END ((14UL << ERRCODE_AREA_SHIFT) - 1)
+#define ERRCODE_AREA_LIB2 (14UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_LIB2_END ((15UL << ERRCODE_AREA_SHIFT) - 1)
+#define ERRCODE_AREA_CHAOS (15UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_CHAOS_END ((16UL << ERRCODE_AREA_SHIFT) - 1)
+
+#define ERRCODE_AREA_APP1 (32UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_APP2 (40UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_APP3 (48UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_APP4 (56UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_APP5 (64UL << ERRCODE_AREA_SHIFT)
+#define ERRCODE_AREA_APP6 (72UL << ERRCODE_AREA_SHIFT)
+
+#define ERRCODE_AREA_SC ERRCODE_AREA_APP1
+#define ERRCODE_AREA_SC_END (ERRCODE_AREA_APP2-1)
+
+#define ERRCODE_AREA_SD ERRCODE_AREA_APP2
+#define ERRCODE_AREA_SD_END (ERRCODE_AREA_APP3-1)
+
+#define ERRCODE_AREA_SW ERRCODE_AREA_APP4
+#define ERRCODE_AREA_SW_END (ERRCODE_AREA_APP5-1)
+
+#define ERRCODE_AREA_OFA ERRCODE_AREA_APP5
+#define ERRCODE_AREA_OFA_END (ERRCODE_AREA_APP6-1)
+
+#define ERRCODE_CLASS_NONE (0UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_ABORT (1UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_GENERAL (2UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_NOTEXISTS (3UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_ALREADYEXISTS (4UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_ACCESS (5UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_PATH (6UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_LOCKING (7UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_PARAMETER (8UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_SPACE (9UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_NOTSUPPORTED (10UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_READ (11UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_WRITE (12UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_UNKNOWN (13UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_VERSION (14UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_FORMAT (15UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_CREATE (16UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_IMPORT (17UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_EXPORT (18UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_FILTER (19UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_SO (20UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_SBX (21UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_RUNTIME (22UL << ERRCODE_CLASS_SHIFT)
+#define ERRCODE_CLASS_COMPILER (23UL << ERRCODE_CLASS_SHIFT)
+
+#define ERRCODE_NONE (0UL)
+#define ERRCODE_ABORT ERRCODE_IO_ABORT
+
+#define ERRCODE_IO_MISPLACEDCHAR (1UL |ERRCODE_CLASS_PARAMETER|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_NOTEXISTS (2UL |ERRCODE_CLASS_NOTEXISTS|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_ALREADYEXISTS (3UL |ERRCODE_CLASS_ALREADYEXISTS|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_NOTADIRECTORY (4UL |ERRCODE_CLASS_PARAMETER|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_NOTAFILE (5UL |ERRCODE_CLASS_PARAMETER|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_INVALIDDEVICE (6UL |ERRCODE_CLASS_PATH|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_ACCESSDENIED (7UL |ERRCODE_CLASS_ACCESS|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_LOCKVIOLATION (8UL |ERRCODE_CLASS_LOCKING|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_OUTOFSPACE (9UL |ERRCODE_CLASS_SPACE|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_ISWILDCARD (11UL|ERRCODE_CLASS_PARAMETER|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_NOTSUPPORTED (12UL|ERRCODE_CLASS_NOTSUPPORTED|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_GENERAL (13UL|ERRCODE_CLASS_GENERAL|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_TOOMANYOPENFILES (14UL|ERRCODE_CLASS_SPACE|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_CANTREAD (15UL|ERRCODE_CLASS_READ|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_CANTWRITE (16UL|ERRCODE_CLASS_WRITE|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_OUTOFMEMORY (17UL|ERRCODE_CLASS_SPACE|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_CANTSEEK (18UL|ERRCODE_CLASS_GENERAL|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_CANTTELL (19UL|ERRCODE_CLASS_GENERAL|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_WRONGVERSION (20UL|ERRCODE_CLASS_VERSION|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_WRONGFORMAT (21UL|ERRCODE_CLASS_FORMAT|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_INVALIDCHAR (22UL|ERRCODE_CLASS_PARAMETER|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_UNKNOWN (23UL|ERRCODE_CLASS_UNKNOWN|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_INVALIDACCESS (24UL|ERRCODE_CLASS_ACCESS|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_CANTCREATE (25UL|ERRCODE_CLASS_CREATE|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_INVALIDPARAMETER (26UL|ERRCODE_CLASS_PARAMETER|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_ABORT (27UL|ERRCODE_CLASS_ABORT|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_NOTEXISTSPATH (28UL |ERRCODE_CLASS_NOTEXISTS|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_PENDING (29UL |ERRCODE_CLASS_NOTEXISTS|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_RECURSIVE (30UL |ERRCODE_CLASS_PARAMETER|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_NAMETOOLONG (31UL |ERRCODE_CLASS_PARAMETER|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_INVALIDLENGTH (32UL |ERRCODE_CLASS_PARAMETER|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_CURRENTDIR (33UL |ERRCODE_CLASS_PARAMETER|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_NOTSAMEDEVICE (34UL |ERRCODE_CLASS_PARAMETER|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_DEVICENOTREADY (35UL |ERRCODE_CLASS_READ|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_BADCRC (36UL |ERRCODE_CLASS_READ|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_WRITEPROTECTED (37UL |ERRCODE_CLASS_ACCESS|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_BROKENPACKAGE (38UL |ERRCODE_CLASS_FORMAT|\
+ ERRCODE_AREA_IO)
+#define ERRCODE_IO_NOTSTORABLEINBINARYFORMAT (39UL |ERRCODE_CLASS_FORMAT|\
+ ERRCODE_AREA_IO)
+
+// FsysErrorCodes
+#define FSYS_ERR_OK ERRCODE_NONE
+#define FSYS_ERR_MISPLACEDCHAR ERRCODE_IO_MISPLACEDCHAR
+#define FSYS_ERR_INVALIDCHAR ERRCODE_IO_INVALIDCHAR
+#define FSYS_ERR_NOTEXISTS ERRCODE_IO_NOTEXISTS
+#define FSYS_ERR_ALREADYEXISTS ERRCODE_IO_ALREADYEXISTS
+#define FSYS_ERR_NOTADIRECTORY ERRCODE_IO_NOTADIRECTORY
+#define FSYS_ERR_NOTAFILE ERRCODE_IO_NOTAFILE
+#define FSYS_ERR_INVALIDDEVICE ERRCODE_IO_INVALIDDEVICE
+#define FSYS_ERR_ACCESSDENIED ERRCODE_IO_ACCESSDENIED
+#define FSYS_ERR_LOCKVIOLATION ERRCODE_IO_LOCKVIOLATION
+#define FSYS_ERR_VOLUMEFULL ERRCODE_IO_OUTOFSPACE
+#define FSYS_ERR_ISWILDCARD ERRCODE_IO_ISWILDCARD
+#define FSYS_ERR_NOTSUPPORTED ERRCODE_IO_NOTSUPPORTED
+#define FSYS_ERR_UNKNOWN ERRCODE_IO_UNKNOWN
+
+// StreamErrorCodes
+#define SVSTREAM_OK ERRCODE_NONE
+
+#define SVSTREAM_GENERALERROR ERRCODE_IO_GENERAL
+#define SVSTREAM_FILE_NOT_FOUND ERRCODE_IO_NOTEXISTS
+#define SVSTREAM_PATH_NOT_FOUND ERRCODE_IO_NOTEXISTSPATH
+#define SVSTREAM_TOO_MANY_OPEN_FILES ERRCODE_IO_TOOMANYOPENFILES
+#define SVSTREAM_ACCESS_DENIED ERRCODE_IO_ACCESSDENIED
+#define SVSTREAM_SHARING_VIOLATION ERRCODE_IO_LOCKVIOLATION
+#define SVSTREAM_LOCKING_VIOLATION ERRCODE_IO_LOCKVIOLATION
+#define SVSTREAM_SHARE_BUFF_EXCEEDED ERRCODE_IO_LOCKVIOLATION
+
+#define SVSTREAM_INVALID_ACCESS ERRCODE_IO_INVALIDACCESS
+#define SVSTREAM_INVALID_HANDLE ERRCODE_IO_GENERAL
+#define SVSTREAM_CANNOT_MAKE ERRCODE_IO_CANTCREATE
+#define SVSTREAM_INVALID_PARAMETER ERRCODE_IO_INVALIDPARAMETER
+
+#define SVSTREAM_READ_ERROR ERRCODE_IO_CANTREAD
+#define SVSTREAM_WRITE_ERROR ERRCODE_IO_CANTWRITE
+#define SVSTREAM_SEEK_ERROR ERRCODE_IO_CANTSEEK
+#define SVSTREAM_TELL_ERROR ERRCODE_IO_CANTTELL
+
+#define SVSTREAM_OUTOFMEMORY ERRCODE_IO_OUTOFMEMORY
+
+#define SVSTREAM_FILEFORMAT_ERROR ERRCODE_IO_WRONGFORMAT
+#define SVSTREAM_WRONGVERSION ERRCODE_IO_WRONGVERSION
+
+#define SVSTREAM_DISK_FULL ERRCODE_IO_OUTOFSPACE
+
+// For the EditEngine:
+#define SVSTREAM_ERRBASE_USER ERRCODE_AREA_LIB1
+
+#define PRINTER_OK ERRCODE_NONE
+#define PRINTER_ABORT ERRCODE_IO_ABORT
+#define PRINTER_OUTOFMEMORY ERRCODE_IO_OUTOFMEMORY
+#define PRINTER_GENERALERROR ERRCODE_IO_GENERAL
+#define PRINTER_ACCESSDENIED ERRCODE_IO_ACCESSDENIED
+
+#define ERRCODE_INET_NAME_RESOLVE (ERRCODE_AREA_INET | ERRCODE_CLASS_READ | 1)
+#define ERRCODE_INET_CONNECT (ERRCODE_AREA_INET | ERRCODE_CLASS_READ | 2)
+#define ERRCODE_INET_READ (ERRCODE_AREA_INET | ERRCODE_CLASS_READ | 3)
+#define ERRCODE_INET_WRITE (ERRCODE_AREA_INET | ERRCODE_CLASS_WRITE| 4)
+#define ERRCODE_INET_GENERAL (ERRCODE_AREA_INET | ERRCODE_CLASS_WRITE |5)
+#define ERRCODE_INET_OFFLINE (ERRCODE_AREA_INET | ERRCODE_CLASS_READ |6)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/errinf.hxx b/include/tools/errinf.hxx
new file mode 100644
index 000000000000..815447b7372f
--- /dev/null
+++ b/include/tools/errinf.hxx
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __RSC
+
+#ifndef _EINF_HXX
+#define _EINF_HXX
+
+#include <limits.h>
+#include <tools/rtti.hxx>
+#include <tools/errcode.hxx>
+#include <tools/string.hxx>
+#include "tools/toolsdllapi.h"
+
+class EDcr_Impl;
+class ErrHdl_Impl;
+class Window;
+
+class ErrorInfo
+{
+private:
+ sal_uIntPtr lUserId;
+
+public:
+ TYPEINFO();
+
+ ErrorInfo( sal_uIntPtr lArgUserId ) :
+ lUserId( lArgUserId ){}
+ virtual ~ErrorInfo(){}
+
+ sal_uIntPtr GetErrorCode() const { return lUserId; }
+
+ static ErrorInfo* GetErrorInfo(sal_uIntPtr);
+};
+
+class TOOLS_DLLPUBLIC DynamicErrorInfo : public ErrorInfo
+{
+ friend class EDcr_Impl;
+
+private:
+ EDcr_Impl* pImpl;
+
+public:
+ TYPEINFO();
+
+ DynamicErrorInfo(sal_uIntPtr lUserId, sal_uInt16 nMask);
+ virtual ~DynamicErrorInfo();
+
+ operator sal_uIntPtr() const;
+ sal_uInt16 GetDialogMask() const;
+};
+
+class TOOLS_DLLPUBLIC StringErrorInfo : public DynamicErrorInfo
+{
+private:
+ OUString aString;
+
+public:
+ TYPEINFO();
+
+ StringErrorInfo( sal_uIntPtr lUserId,
+ const OUString& aStringP,
+ sal_uInt16 nFlags = 0);
+ const OUString& GetErrorString() const { return aString; }
+};
+
+class TOOLS_DLLPUBLIC TwoStringErrorInfo: public DynamicErrorInfo
+{
+private:
+ OUString aArg1;
+ OUString aArg2;
+
+public:
+ TYPEINFO();
+
+ TwoStringErrorInfo(sal_uIntPtr nUserID, const OUString & rTheArg1,
+ const OUString & rTheArg2, sal_uInt16 nFlags = 0):
+ DynamicErrorInfo(nUserID, nFlags), aArg1(rTheArg1), aArg2(rTheArg2) {}
+
+ virtual ~TwoStringErrorInfo() {}
+
+ const OUString& GetArg1() const { return aArg1; }
+ const OUString& GetArg2() const { return aArg2; }
+};
+
+class TOOLS_DLLPUBLIC MessageInfo : public DynamicErrorInfo
+{
+public:
+ TYPEINFO();
+
+ MessageInfo(sal_uIntPtr UserId, sal_uInt16 nFlags = 0) :
+ DynamicErrorInfo(UserId, nFlags) {}
+ MessageInfo(sal_uIntPtr UserId, const OUString &rArg, sal_uInt16 nFlags = 0 ) :
+ DynamicErrorInfo(UserId, nFlags), aArg(rArg) {}
+
+ const OUString& GetMessageArg() const { return aArg; }
+
+private:
+ OUString aArg;
+};
+
+class TOOLS_DLLPUBLIC ErrorContext
+{
+ friend class ErrorHandler;
+
+private:
+ ErrorContext* pNext;
+ Window* pWin;
+
+public:
+ ErrorContext(Window *pWin=0);
+ virtual ~ErrorContext();
+
+ virtual sal_Bool GetString( sal_uIntPtr nErrId, OUString& rCtxStr ) = 0;
+ Window* GetParent() { return pWin; }
+
+ static ErrorContext* GetContext();
+};
+
+typedef sal_uInt16 WindowDisplayErrorFunc(
+ Window *, sal_uInt16 nMask, const OUString &rErr, const OUString &rAction);
+
+typedef void BasicDisplayErrorFunc(
+ const OUString &rErr, const OUString &rAction);
+
+class TOOLS_DLLPUBLIC ErrorHandler
+{
+ friend class ErrHdl_Impl;
+
+private:
+ ErrHdl_Impl* pImpl;
+
+ static sal_uInt16 HandleError_Impl( sal_uIntPtr lId,
+ sal_uInt16 nFlags,
+ sal_Bool bJustCreateString,
+ OUString & rError);
+protected:
+ virtual sal_Bool CreateString( const ErrorInfo *,
+ OUString &, sal_uInt16& nMask ) const = 0;
+
+public:
+ ErrorHandler();
+ virtual ~ErrorHandler();
+
+ static sal_uInt16 HandleError ( sal_uIntPtr lId, sal_uInt16 nMask = USHRT_MAX );
+ static sal_Bool GetErrorString( sal_uIntPtr lId, OUString& rStr );
+
+ static void RegisterDisplay( BasicDisplayErrorFunc* );
+ static void RegisterDisplay( WindowDisplayErrorFunc* );
+};
+
+class TOOLS_DLLPUBLIC SimpleErrorHandler : private ErrorHandler
+{
+protected:
+ virtual sal_Bool CreateString( const ErrorInfo*, OUString &,
+ sal_uInt16 &nMask ) const;
+
+public:
+ SimpleErrorHandler();
+};
+
+#endif
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/extendapplicationenvironment.hxx b/include/tools/extendapplicationenvironment.hxx
new file mode 100644
index 000000000000..b6ccbf8d5491
--- /dev/null
+++ b/include/tools/extendapplicationenvironment.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_TOOLS_EXTENDAPPLICATIONENVIRONMENT_HXX
+#define INCLUDED_TOOLS_EXTENDAPPLICATIONENVIRONMENT_HXX
+
+#include "sal/config.h"
+#include "tools/toolsdllapi.h"
+
+namespace tools {
+
+// Extend the environment of the process in a platform specifc way as necessary
+// for OOo-related applications; must be called first thing in main:
+TOOLS_DLLPUBLIC void extendApplicationEnvironment();
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/fldunit.hxx b/include/tools/fldunit.hxx
new file mode 100644
index 000000000000..2b4a9158dfec
--- /dev/null
+++ b/include/tools/fldunit.hxx
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _TOOLS_FLDUNIT_HXX
+#define _TOOLS_FLDUNIT_HXX
+
+enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM,
+ FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA,
+ FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CHAR, FUNIT_LINE, FUNIT_CUSTOM,
+ FUNIT_PERCENT, FUNIT_100TH_MM };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/fontenum.hxx b/include/tools/fontenum.hxx
new file mode 100644
index 000000000000..7a53e931cc1c
--- /dev/null
+++ b/include/tools/fontenum.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 _TOOLS_FONTENUM_HXX
+#define _TOOLS_FONTENUM_HXX
+
+#include <sal/types.h>
+#include <tools/solar.h>
+
+#ifndef ENUM_FONTFAMILY_DECLARED
+#define ENUM_FONTFAMILY_DECLARED
+enum FontFamily { FAMILY_DONTKNOW, FAMILY_DECORATIVE, FAMILY_MODERN,
+ FAMILY_ROMAN, FAMILY_SCRIPT, FAMILY_SWISS, FAMILY_SYSTEM, FontFamily_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+#endif
+
+#ifndef ENUM_FONTPITCH_DECLARED
+#define ENUM_FONTPITCH_DECLARED
+enum FontPitch { PITCH_DONTKNOW, PITCH_FIXED, PITCH_VARIABLE, FontPitch_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+#endif
+
+#ifndef ENUM_TEXTALIGN_DECLARED
+#define ENUM_TEXTALIGN_DECLARED
+enum TextAlign { ALIGN_TOP, ALIGN_BASELINE, ALIGN_BOTTOM, TextAlign_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+#endif
+
+#ifndef ENUM_FONTWEIGHT_DECLARED
+#define ENUM_FONTWEIGHT_DECLARED
+enum FontWeight { WEIGHT_DONTKNOW, WEIGHT_THIN, WEIGHT_ULTRALIGHT,
+ WEIGHT_LIGHT, WEIGHT_SEMILIGHT, WEIGHT_NORMAL,
+ WEIGHT_MEDIUM, WEIGHT_SEMIBOLD, WEIGHT_BOLD,
+ WEIGHT_ULTRABOLD, WEIGHT_BLACK, FontWeight_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+#endif
+
+#ifndef ENUM_FONTWIDTH_DECLARED
+#define ENUM_FONTWIDTH_DECLARED
+enum FontWidth { WIDTH_DONTKNOW, WIDTH_ULTRA_CONDENSED, WIDTH_EXTRA_CONDENSED,
+ WIDTH_CONDENSED, WIDTH_SEMI_CONDENSED, WIDTH_NORMAL,
+ WIDTH_SEMI_EXPANDED, WIDTH_EXPANDED, WIDTH_EXTRA_EXPANDED,
+ WIDTH_ULTRA_EXPANDED,
+ FontWidth_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+#endif
+
+#ifndef ENUM_FONTITALIC_DECLARED
+#define ENUM_FONTITALIC_DECLARED
+enum FontItalic { ITALIC_NONE, ITALIC_OBLIQUE, ITALIC_NORMAL, ITALIC_DONTKNOW, FontItalic_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+#endif
+
+#ifndef ENUM_FONTUNDERLINE_DECLARED
+#define ENUM_FONTUNDERLINE_DECLARED
+enum FontUnderline { UNDERLINE_NONE, UNDERLINE_SINGLE, UNDERLINE_DOUBLE,
+ UNDERLINE_DOTTED, UNDERLINE_DONTKNOW,
+ UNDERLINE_DASH, UNDERLINE_LONGDASH,
+ UNDERLINE_DASHDOT, UNDERLINE_DASHDOTDOT,
+ UNDERLINE_SMALLWAVE,
+ UNDERLINE_WAVE, UNDERLINE_DOUBLEWAVE,
+ UNDERLINE_BOLD, UNDERLINE_BOLDDOTTED,
+ UNDERLINE_BOLDDASH, UNDERLINE_BOLDLONGDASH,
+ UNDERLINE_BOLDDASHDOT, UNDERLINE_BOLDDASHDOTDOT,
+ UNDERLINE_BOLDWAVE,
+ FontUnderline_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+#endif
+
+#ifndef ENUM_FONTSTRIKEOUT_DECLARED
+#define ENUM_FONTSTRIKEOUT_DECLARED
+enum FontStrikeout { STRIKEOUT_NONE, STRIKEOUT_SINGLE, STRIKEOUT_DOUBLE,
+ STRIKEOUT_DONTKNOW, STRIKEOUT_BOLD,
+ STRIKEOUT_SLASH, STRIKEOUT_X,
+ FontStrikeout_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+#endif
+
+#ifndef ENUM_FONTEMPHASISMARK_DECLARED
+#define ENUM_FONTEMPHASISMARK_DECLARED
+
+typedef sal_uInt16 FontEmphasisMark;
+#define EMPHASISMARK_NONE ((FontEmphasisMark)0x0000)
+#define EMPHASISMARK_DOT ((FontEmphasisMark)0x0001)
+#define EMPHASISMARK_CIRCLE ((FontEmphasisMark)0x0002)
+#define EMPHASISMARK_DISC ((FontEmphasisMark)0x0003)
+#define EMPHASISMARK_ACCENT ((FontEmphasisMark)0x0004)
+#define EMPHASISMARK_STYLE ((FontEmphasisMark)0x00FF)
+#define EMPHASISMARK_POS_ABOVE ((FontEmphasisMark)0x1000)
+#define EMPHASISMARK_POS_BELOW ((FontEmphasisMark)0x2000)
+
+// Only for compability
+#define EMPHASISMARK_DOTS_ABOVE (EMPHASISMARK_DOT | EMPHASISMARK_POS_ABOVE)
+#define EMPHASISMARK_DOTS_BELOW (EMPHASISMARK_DOT | EMPHASISMARK_POS_BELOW)
+#define EMPHASISMARK_SIDE_DOTS (EMPHASISMARK_ACCENT | EMPHASISMARK_POS_ABOVE)
+#define EMPHASISMARK_CIRCLE_ABOVE (EMPHASISMARK_CIRCLE | EMPHASISMARK_POS_ABOVE)
+
+#endif
+
+#ifndef ENUM_FONTTYPE_DECLARED
+#define ENUM_FONTTYPE_DECLARED
+enum FontType { TYPE_DONTKNOW, TYPE_RASTER, TYPE_VECTOR, TYPE_SCALABLE,
+ FontType_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+#endif
+
+#ifndef ENUM_FONTEMBEDDEDBITMAP_DECLARED
+#define ENUM_FONTEMBEDDEDBITMAP_DECLARED
+enum FontEmbeddedBitmap { EMBEDDEDBITMAP_DONTKNOW, EMBEDDEDBITMAP_FALSE, EMBEDDEDBITMAP_TRUE };
+#endif
+
+#ifndef ENUM_FONTANTIALIAS_DECLARED
+#define ENUM_FONTANTIALIAS_DECLARED
+enum FontAntiAlias { ANTIALIAS_DONTKNOW, ANTIALIAS_FALSE, ANTIALIAS_TRUE };
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/fract.hxx b/include/tools/fract.hxx
new file mode 100644
index 000000000000..24c6721f0fa3
--- /dev/null
+++ b/include/tools/fract.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 _FRACT_HXX
+#define _FRACT_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/solar.h>
+
+class SvStream;
+
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Fraction
+{
+private:
+ long nNumerator;
+ long nDenominator;
+
+public:
+ Fraction() { nNumerator = 0; nDenominator = 1; }
+ Fraction( const Fraction & rFrac );
+ Fraction( long nNum, long nDen=1 );
+ Fraction( double dVal );
+
+ bool IsValid() const;
+
+ long GetNumerator() const { return nNumerator; }
+ long GetDenominator() const { return nDenominator; }
+
+ operator long() const;
+ operator double() const;
+
+ Fraction& operator=( const Fraction& rfrFrac );
+
+ Fraction& operator+=( const Fraction& rfrFrac );
+ Fraction& operator-=( const Fraction& rfrFrac );
+ Fraction& operator*=( const Fraction& rfrFrac );
+ Fraction& operator/=( const Fraction& rfrFrac );
+
+ void ReduceInaccurate( unsigned nSignificantBits );
+
+ friend inline Fraction operator+( const Fraction& rVal1, const Fraction& rVal2 );
+ friend inline Fraction operator-( const Fraction& rVal1, const Fraction& rVal2 );
+ friend inline Fraction operator*( const Fraction& rVal1, const Fraction& rVal2 );
+ friend inline Fraction operator/( const Fraction& rVal1, const Fraction& rVal2 );
+
+ TOOLS_DLLPUBLIC friend bool operator==( const Fraction& rVal1, const Fraction& rVal2 );
+ friend inline bool operator!=( const Fraction& rVal1, const Fraction& rVal2 );
+ TOOLS_DLLPUBLIC friend bool operator< ( const Fraction& rVal1, const Fraction& rVal2 );
+ TOOLS_DLLPUBLIC friend bool operator> ( const Fraction& rVal1, const Fraction& rVal2 );
+ friend inline bool operator<=( const Fraction& rVal1, const Fraction& rVal2 );
+ friend inline bool operator>=( const Fraction& rVal1, const Fraction& rVal2 );
+
+ TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Fraction& rFract );
+ TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Fraction& rFract );
+};
+
+inline Fraction::Fraction( const Fraction& rFrac )
+{
+ nNumerator = rFrac.nNumerator;
+ nDenominator = rFrac.nDenominator;
+}
+
+inline Fraction& Fraction::operator=( const Fraction& rFrac )
+{
+ nNumerator = rFrac.nNumerator;
+ nDenominator = rFrac.nDenominator;
+ return *this;
+}
+
+inline bool Fraction::IsValid() const
+{
+ return (nDenominator > 0);
+}
+
+inline Fraction::operator long() const
+{
+ if ( nDenominator > 0 )
+ return (nNumerator / nDenominator);
+ else
+ return 0;
+}
+
+inline Fraction operator+( const Fraction& rVal1, const Fraction& rVal2 )
+{
+ Fraction aErg( rVal1 );
+ aErg += rVal2;
+ return aErg;
+}
+
+inline Fraction operator-( const Fraction& rVal1, const Fraction& rVal2 )
+{
+ Fraction aErg( rVal1 );
+ aErg -= rVal2;
+ return aErg;
+}
+
+inline Fraction operator*( const Fraction& rVal1, const Fraction& rVal2 )
+{
+ Fraction aErg( rVal1 );
+ aErg *= rVal2;
+ return aErg;
+}
+
+inline Fraction operator/( const Fraction& rVal1, const Fraction& rVal2 )
+{
+ Fraction aErg( rVal1 );
+ aErg /= rVal2;
+ return aErg;
+}
+
+inline bool operator !=( const Fraction& rVal1, const Fraction& rVal2 )
+{
+ return !(rVal1 == rVal2);
+}
+
+inline bool operator <=( const Fraction& rVal1, const Fraction& rVal2 )
+{
+ return !(rVal1 > rVal2);
+}
+
+inline bool operator >=( const Fraction& rVal1, const Fraction& rVal2 )
+{
+ return !(rVal1 < rVal2);
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
new file mode 100644
index 000000000000..c1a1e359bccc
--- /dev/null
+++ b/include/tools/gen.hxx
@@ -0,0 +1,692 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SV_GEN_HXX
+#define _SV_GEN_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/solar.h>
+
+#include <limits.h>
+#include <ostream>
+#include <cstdlib>
+
+class SvStream;
+
+// Pair
+
+class SAL_WARN_UNUSED Pair
+{
+public:
+ Pair();
+ Pair( long nA, long nB );
+
+ long A() const { return nA; }
+ long B() const { return nB; }
+
+ long& A() { return nA; }
+ long& B() { return nB; }
+
+ sal_Bool operator == ( const Pair& rPair ) const;
+ sal_Bool operator != ( const Pair& rPair ) const;
+
+ TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Pair& rPair );
+ TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Pair& rPair );
+
+protected:
+ long nA;
+ long nB;
+};
+
+inline Pair::Pair()
+{
+ nA = nB = 0;
+}
+
+inline Pair::Pair( long _nA, long _nB )
+{
+ Pair::nA = _nA;
+ Pair::nB = _nB;
+}
+
+inline sal_Bool Pair::operator == ( const Pair& rPair ) const
+{
+ return ((nA == rPair.nA) && (nB == rPair.nB));
+}
+
+inline sal_Bool Pair::operator != ( const Pair& rPair ) const
+{
+ return ((nA != rPair.nA) || (nB != rPair.nB));
+}
+
+// Point
+
+class SAL_WARN_UNUSED Point : public Pair
+{
+public:
+ Point();
+ Point( long nX, long nY );
+
+ long X() const { return nA; }
+ long Y() const { return nB; }
+
+ long& X() { return nA; }
+ long& Y() { return nB; }
+
+ void Move( long nHorzMove, long nVertMove );
+ sal_Bool IsAbove( const Point& rPoint ) const;
+ sal_Bool IsBelow( const Point& rPoint ) const;
+ sal_Bool IsLeft( const Point& rPoint ) const;
+ sal_Bool IsRight( const Point& rPoint ) const;
+
+ Point& operator += ( const Point& rPoint );
+ Point& operator -= ( const Point& rPoint );
+ Point& operator *= ( const long nVal );
+ Point& operator /= ( const long nVal );
+
+ friend inline Point operator+( const Point &rVal1, const Point &rVal2 );
+ friend inline Point operator-( const Point &rVal1, const Point &rVal2 );
+ friend inline Point operator*( const Point &rVal1, const long nVal2 );
+ friend inline Point operator/( const Point &rVal1, const long nVal2 );
+
+ long getX() const { return X(); }
+ long getY() const { return Y(); }
+ void setX(long nX) { X() = nX; }
+ void setY(long nY) { Y() = nY; }
+};
+
+inline Point::Point()
+{
+}
+
+inline Point::Point( long nX, long nY ) : Pair( nX, nY )
+{
+}
+
+inline void Point::Move( long nHorzMove, long nVertMove )
+{
+ nA += nHorzMove;
+ nB += nVertMove;
+}
+
+inline sal_Bool Point::IsAbove( const Point& rPoint ) const
+{
+ return (nB > rPoint.nB);
+}
+
+inline sal_Bool Point::IsBelow( const Point& rPoint ) const
+{
+ return (nB < rPoint.nB);
+}
+
+inline sal_Bool Point::IsLeft( const Point& rPoint ) const
+{
+ return (nA < rPoint.nA);
+}
+
+inline sal_Bool Point::IsRight( const Point& rPoint ) const
+{
+ return (nA > rPoint.nA);
+}
+
+inline Point& Point::operator += ( const Point& rPoint )
+{
+ nA += rPoint.nA;
+ nB += rPoint.nB;
+ return *this;
+}
+
+inline Point& Point::operator -= ( const Point& rPoint )
+{
+ nA -= rPoint.nA;
+ nB -= rPoint.nB;
+ return *this;
+}
+
+inline Point& Point::operator *= ( const long nVal )
+{
+ nA *= nVal;
+ nB *= nVal;
+ return *this;
+}
+
+inline Point& Point::operator /= ( const long nVal )
+{
+ nA /= nVal;
+ nB /= nVal;
+ return *this;
+}
+
+inline Point operator+( const Point &rVal1, const Point &rVal2 )
+{
+ return Point( rVal1.nA+rVal2.nA, rVal1.nB+rVal2.nB );
+}
+
+inline Point operator-( const Point &rVal1, const Point &rVal2 )
+{
+ return Point( rVal1.nA-rVal2.nA, rVal1.nB-rVal2.nB );
+}
+
+inline Point operator*( const Point &rVal1, const long nVal2 )
+{
+ return Point( rVal1.nA*nVal2, rVal1.nB*nVal2 );
+}
+
+inline Point operator/( const Point &rVal1, const long nVal2 )
+{
+ return Point( rVal1.nA/nVal2, rVal1.nB/nVal2 );
+}
+
+template< typename charT, typename traits >
+inline std::basic_ostream<charT, traits> & operator <<(
+ std::basic_ostream<charT, traits> & stream, const Point& point )
+{
+ return stream << point.X() << ',' << point.Y();
+}
+
+// Size
+
+class SAL_WARN_UNUSED Size : public Pair
+{
+public:
+ Size();
+ Size( long nWidth, long nHeight );
+
+ long Width() const { return nA; }
+ long Height() const { return nB; }
+
+ long& Width() { return nA; }
+ long& Height() { return nB; }
+
+ long getWidth() const { return Width(); }
+ long getHeight() const { return Height(); }
+ void setWidth(long nWidth) { Width() = nWidth; }
+ void setHeight(long nHeight) { Height() = nHeight; }
+};
+
+inline Size::Size()
+{
+}
+
+inline Size::Size( long nWidth, long nHeight ) :
+ Pair( nWidth, nHeight )
+{
+}
+
+template< typename charT, typename traits >
+inline std::basic_ostream<charT, traits> & operator <<(
+ std::basic_ostream<charT, traits> & stream, const Size& size )
+{
+ return stream << size.Width() << 'x' << size.Height();
+}
+
+// Range
+
+#define RANGE_MAX LONG_MAX
+
+class SAL_WARN_UNUSED Range : public Pair
+{
+public:
+ Range();
+ Range( long nMin, long nMax );
+
+ long Min() const { return nA; }
+ long Max() const { return nB; }
+ long Len() const { return nB - nA + 1; }
+
+ long& Min() { return nA; }
+ long& Max() { return nB; }
+
+ sal_Bool IsInside( long nIs ) const;
+
+ void Justify();
+};
+
+inline Range::Range()
+{
+}
+
+inline Range::Range( long nMin, long nMax ) : Pair( nMin, nMax )
+{
+}
+
+inline sal_Bool Range::IsInside( long nIs ) const
+{
+ return ((nA <= nIs) && (nIs <= nB ));
+}
+
+inline void Range::Justify()
+{
+ if ( nA > nB )
+ {
+ long nHelp = nA;
+ nA = nB;
+ nB = nHelp;
+ }
+}
+
+template< typename charT, typename traits >
+inline std::basic_ostream<charT, traits> & operator <<(
+ std::basic_ostream<charT, traits> & stream, const Range& range )
+{
+ return stream << range.Min() << '-' << range.Max();
+}
+
+// Selection
+
+#define SELECTION_MIN LONG_MIN
+#define SELECTION_MAX LONG_MAX
+
+class SAL_WARN_UNUSED Selection : public Pair
+{
+public:
+ Selection();
+ Selection( long nPos );
+ Selection( long nMin, long nMax );
+
+ long Min() const { return nA; }
+ long Max() const { return nB; }
+ long Len() const { return nB - nA; }
+
+ long& Min() { return nA; }
+ long& Max() { return nB; }
+
+ sal_Bool IsInside( long nIs ) const;
+
+ void Justify();
+
+ sal_Bool operator !() const { return !Len(); }
+
+ long getMin() const { return Min(); }
+ long getMax() const { return Max(); }
+ void setMin(long nMin) { Min() = nMin; }
+ void setMax(long nMax) { Max() = nMax; }
+};
+
+inline Selection::Selection()
+{
+}
+
+inline Selection::Selection( long nPos ) : Pair( nPos, nPos )
+{
+}
+
+inline Selection::Selection( long nMin, long nMax ) :
+ Pair( nMin, nMax )
+{
+}
+
+inline sal_Bool Selection::IsInside( long nIs ) const
+{
+ return ((nA <= nIs) && (nIs < nB ));
+}
+
+inline void Selection::Justify()
+{
+ if ( nA > nB )
+ {
+ long nHelp = nA;
+ nA = nB;
+ nB = nHelp;
+ }
+}
+
+template< typename charT, typename traits >
+inline std::basic_ostream<charT, traits> & operator <<(
+ std::basic_ostream<charT, traits> & stream, const Selection& selection )
+{
+ return stream << selection.Min() << '-' << selection.Max();
+}
+// Rectangle
+
+#define RECT_EMPTY ((short)-32767)
+
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Rectangle
+{
+public:
+ Rectangle();
+ Rectangle( const Point& rLT, const Point& rRB );
+ Rectangle( long nLeft, long nTop,
+ long nRight, long nBottom );
+ Rectangle( const Point& rLT, const Size& rSize );
+
+ long Left() const { return nLeft; }
+ long Right() const { return nRight; }
+ long Top() const { return nTop; }
+ long Bottom() const { return nBottom; }
+
+ long& Left() { return nLeft; }
+ long& Right() { return nRight; }
+ long& Top() { return nTop; }
+ long& Bottom() { return nBottom; }
+
+ inline Point TopLeft() const;
+ inline Point TopRight() const;
+ inline Point TopCenter() const;
+ inline Point BottomLeft() const;
+ inline Point BottomRight() const;
+ inline Point BottomCenter() const;
+ inline Point LeftCenter() const;
+ inline Point RightCenter() const;
+ inline Point Center() const;
+
+ inline void Move( long nHorzMove, long nVertMove );
+ inline void Transpose();
+ inline void SetPos( const Point& rPoint );
+ void SetSize( const Size& rSize );
+ inline Size GetSize() const;
+
+ inline long GetWidth() const;
+ inline long GetHeight() const;
+
+ Rectangle& Union( const Rectangle& rRect );
+ Rectangle& Intersection( const Rectangle& rRect );
+ inline Rectangle GetUnion( const Rectangle& rRect ) const;
+ inline Rectangle GetIntersection( const Rectangle& rRect ) const;
+
+ void Justify();
+
+ sal_Bool IsInside( const Point& rPOINT ) const;
+ sal_Bool IsInside( const Rectangle& rRect ) const;
+ sal_Bool IsOver( const Rectangle& rRect ) const;
+
+ void SetEmpty() { nRight = nBottom = RECT_EMPTY; }
+ inline sal_Bool IsEmpty() const;
+
+ inline sal_Bool operator == ( const Rectangle& rRect ) const;
+ inline sal_Bool operator != ( const Rectangle& rRect ) const;
+
+ inline Rectangle& operator += ( const Point& rPt );
+ inline Rectangle& operator -= ( const Point& rPt );
+
+ friend inline Rectangle operator + ( const Rectangle& rRect, const Point& rPt );
+ friend inline Rectangle operator - ( const Rectangle& rRect, const Point& rPt );
+
+ TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Rectangle& rRect );
+ TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Rectangle& rRect );
+
+ // ONE
+ long getX() const { return nLeft; }
+ long getY() const { return nTop; }
+ long getWidth() const { return nRight - nLeft; }
+ long getHeight() const { return nBottom - nTop; }
+ void setX( long n ) { nRight += n-nLeft; nLeft = n; }
+ void setY( long n ) { nBottom += n-nTop; nTop = n; }
+ void setWidth( long n ) { nRight = nLeft + n; }
+ void setHeight( long n ) { nBottom = nTop + n; }
+
+private:
+ long nLeft;
+ long nTop;
+ long nRight;
+ long nBottom;
+};
+
+inline Rectangle::Rectangle()
+{
+ nLeft = nTop = 0;
+ nRight = nBottom = RECT_EMPTY;
+}
+
+inline Rectangle::Rectangle( const Point& rLT, const Point& rRB )
+{
+ nLeft = rLT.X();
+ nTop = rLT.Y();
+ nRight = rRB.X();
+ nBottom = rRB.Y();
+}
+
+inline Rectangle::Rectangle( long _nLeft, long _nTop,
+ long _nRight, long _nBottom )
+{
+ nLeft = _nLeft;
+ nTop = _nTop;
+ nRight = _nRight;
+ nBottom = _nBottom;
+}
+
+inline Rectangle::Rectangle( const Point& rLT, const Size& rSize )
+{
+ nLeft = rLT.X();
+ nTop = rLT.Y();
+ nRight = rSize.Width() ? nLeft+rSize.Width()-1 : RECT_EMPTY;
+ nBottom = rSize.Height() ? nTop+rSize.Height()-1 : RECT_EMPTY;
+}
+
+inline sal_Bool Rectangle::IsEmpty() const
+{
+ return ((nRight == RECT_EMPTY) || (nBottom == RECT_EMPTY));
+}
+
+inline Point Rectangle::TopLeft() const
+{
+ return Point( nLeft, nTop );
+}
+
+inline Point Rectangle::TopRight() const
+{
+ return Point( (nRight == RECT_EMPTY) ? nLeft : nRight, nTop );
+}
+
+inline Point Rectangle::BottomLeft() const
+{
+ return Point( nLeft, (nBottom == RECT_EMPTY) ? nTop : nBottom );
+}
+
+inline Point Rectangle::BottomRight() const
+{
+ return Point( (nRight == RECT_EMPTY) ? nLeft : nRight,
+ (nBottom == RECT_EMPTY) ? nTop : nBottom );
+}
+
+inline Point Rectangle::TopCenter() const
+{
+ if ( IsEmpty() )
+ return Point( nLeft, nTop );
+ else
+ return Point( std::min( nLeft, nRight ) + std::abs( (nRight - nLeft)/2 ),
+ std::min( nTop, nBottom) );
+}
+
+inline Point Rectangle::BottomCenter() const
+{
+ if ( IsEmpty() )
+ return Point( nLeft, nTop );
+ else
+ return Point( std::min( nLeft, nRight ) + std::abs( (nRight - nLeft)/2 ),
+ std::max( nTop, nBottom) );
+}
+
+inline Point Rectangle::LeftCenter() const
+{
+ if ( IsEmpty() )
+ return Point( nLeft, nTop );
+ else
+ return Point( std::min( nLeft, nRight ), nTop + (nBottom - nTop)/2 );
+}
+
+inline Point Rectangle::RightCenter() const
+{
+ if ( IsEmpty() )
+ return Point( nLeft, nTop );
+ else
+ return Point( std::max( nLeft, nRight ), nTop + (nBottom - nTop)/2 );
+}
+
+inline Point Rectangle::Center() const
+{
+ if ( IsEmpty() )
+ return Point( nLeft, nTop );
+ else
+ return Point( nLeft+(nRight-nLeft)/2 , nTop+(nBottom-nTop)/2 );
+}
+
+inline void Rectangle::Move( long nHorzMove, long nVertMove )
+{
+ nLeft += nHorzMove;
+ nTop += nVertMove;
+ if ( nRight != RECT_EMPTY )
+ nRight += nHorzMove;
+ if ( nBottom != RECT_EMPTY )
+ nBottom += nVertMove;
+}
+
+void Rectangle::Transpose()
+{
+ if ( !IsEmpty() )
+ {
+ long swap( nLeft );
+ nLeft = nTop;
+ nTop = swap;
+
+ swap = nRight;
+ nRight = nBottom;
+ nBottom = swap;
+ }
+}
+
+inline void Rectangle::SetPos( const Point& rPoint )
+{
+ if ( nRight != RECT_EMPTY )
+ nRight += rPoint.X() - nLeft;
+ if ( nBottom != RECT_EMPTY )
+ nBottom += rPoint.Y() - nTop;
+ nLeft = rPoint.X();
+ nTop = rPoint.Y();
+}
+
+inline long Rectangle::GetWidth() const
+{
+ long n;
+ if ( nRight == RECT_EMPTY )
+ n = 0;
+ else
+ {
+ n = nRight - nLeft;
+ if( n < 0 )
+ n--;
+ else
+ n++;
+ }
+
+ return n;
+}
+
+inline long Rectangle::GetHeight() const
+{
+ long n;
+ if ( nBottom == RECT_EMPTY )
+ n = 0;
+ else
+ {
+ n = nBottom - nTop;
+ if ( n < 0 )
+ n--;
+ else
+ n++;
+ }
+
+ return n;
+}
+
+inline Size Rectangle::GetSize() const
+{
+ return Size( GetWidth(), GetHeight() );
+}
+
+inline Rectangle Rectangle::GetUnion( const Rectangle& rRect ) const
+{
+ Rectangle aTmpRect( *this );
+ return aTmpRect.Union( rRect );
+}
+
+inline Rectangle Rectangle::GetIntersection( const Rectangle& rRect ) const
+{
+ Rectangle aTmpRect( *this );
+ return aTmpRect.Intersection( rRect );
+}
+
+inline sal_Bool Rectangle::operator == ( const Rectangle& rRect ) const
+{
+ return ((nLeft == rRect.nLeft ) &&
+ (nTop == rRect.nTop ) &&
+ (nRight == rRect.nRight ) &&
+ (nBottom == rRect.nBottom ));
+}
+
+inline sal_Bool Rectangle::operator != ( const Rectangle& rRect ) const
+{
+ return ((nLeft != rRect.nLeft ) ||
+ (nTop != rRect.nTop ) ||
+ (nRight != rRect.nRight ) ||
+ (nBottom != rRect.nBottom ));
+}
+
+inline Rectangle& Rectangle::operator +=( const Point& rPt )
+{
+ nLeft += rPt.X();
+ nTop += rPt.Y();
+ if ( nRight != RECT_EMPTY )
+ nRight += rPt.X();
+ if ( nBottom != RECT_EMPTY )
+ nBottom += rPt.Y();
+ return *this;
+}
+
+inline Rectangle& Rectangle::operator -= ( const Point& rPt )
+{
+ nLeft -= rPt.X();
+ nTop -= rPt.Y();
+ if ( nRight != RECT_EMPTY )
+ nRight -= rPt.X();
+ if ( nBottom != RECT_EMPTY )
+ nBottom -= rPt.Y();
+ return *this;
+}
+
+inline Rectangle operator + ( const Rectangle& rRect, const Point& rPt )
+{
+ Rectangle aRect( rRect.nLeft + rPt.X(), rRect.nTop + rPt.Y(),
+ (rRect.nRight == RECT_EMPTY) ? RECT_EMPTY : rRect.nRight + rPt.X(),
+ (rRect.nBottom == RECT_EMPTY) ? RECT_EMPTY : rRect.nBottom + rPt.Y() );
+ return aRect;
+}
+
+inline Rectangle operator - ( const Rectangle& rRect, const Point& rPt )
+{
+ Rectangle aRect( rRect.nLeft - rPt.X(),
+ rRect.nTop - rPt.Y(),
+ (rRect.nRight == RECT_EMPTY) ? RECT_EMPTY : rRect.nRight - rPt.X(),
+ (rRect.nBottom == RECT_EMPTY) ? RECT_EMPTY : rRect.nBottom - rPt.Y() );
+ return aRect;
+}
+
+template< typename charT, typename traits >
+inline std::basic_ostream<charT, traits> & operator <<(
+ std::basic_ostream<charT, traits> & stream, const Rectangle& rectangle )
+{
+ if (rectangle.IsEmpty())
+ return stream << "EMPTY";
+ else
+ return stream << rectangle.getWidth() << 'x' << rectangle.getHeight()
+ << "@(" << rectangle.getX() << ',' << rectangle.getY() << ")";
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/getprocessworkingdir.hxx b/include/tools/getprocessworkingdir.hxx
new file mode 100644
index 000000000000..f780c86c9a21
--- /dev/null
+++ b/include/tools/getprocessworkingdir.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_TOOLS_GETPROCESSWORKINGDIR_HXX
+#define INCLUDED_TOOLS_GETPROCESSWORKINGDIR_HXX
+
+#include "sal/config.h"
+#include "tools/toolsdllapi.h"
+
+
+namespace tools {
+
+// get the process's current working directory, taking OOO_CWD into account
+//
+// @param rUrl
+// Receives the directory URL (with or without a final slash) upon successful
+// return, and the empty string upon unsuccessful return
+TOOLS_DLLPUBLIC bool getProcessWorkingDir(OUString& rUrl);
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/globname.hxx b/include/tools/globname.hxx
new file mode 100644
index 000000000000..2ea6850801d1
--- /dev/null
+++ b/include/tools/globname.hxx
@@ -0,0 +1,108 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _GLOBNAME_HXX
+#define _GLOBNAME_HXX
+
+#include <vector>
+
+#include "tools/toolsdllapi.h"
+#include <com/sun/star/uno/Sequence.hxx>
+#include <tools/string.hxx>
+
+struct ImpSvGlobalName
+{
+ sal_uInt8 szData[ 16 ];
+ sal_uInt16 nRefCount;
+
+ enum Empty { EMPTY };
+
+ ImpSvGlobalName()
+ {
+ nRefCount = 0;
+ }
+ ImpSvGlobalName( const ImpSvGlobalName & rObj );
+ ImpSvGlobalName( Empty );
+
+ sal_Bool operator == ( const ImpSvGlobalName & rObj ) const;
+};
+
+#ifdef WNT
+struct _GUID;
+typedef struct _GUID GUID;
+#else
+struct GUID;
+#endif
+
+typedef GUID CLSID;
+class SvStream;
+
+class TOOLS_DLLPUBLIC SvGlobalName
+{
+ ImpSvGlobalName * pImp;
+ void NewImp();
+
+public:
+ SvGlobalName();
+ SvGlobalName( const SvGlobalName & rObj )
+ {
+ pImp = rObj.pImp;
+ pImp->nRefCount++;
+ }
+ SvGlobalName( ImpSvGlobalName * pImpP )
+ {
+ pImp = pImpP;
+ pImp->nRefCount++;
+ }
+ SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
+ sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11,
+ sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 );
+
+ // create SvGlobalName from a platform independent representation
+ SvGlobalName( const ::com::sun::star::uno::Sequence< sal_Int8 >& aSeq );
+
+ SvGlobalName & operator = ( const SvGlobalName & rObj );
+ ~SvGlobalName();
+
+ TOOLS_DLLPUBLIC friend SvStream & operator >> ( SvStream &, SvGlobalName & );
+ TOOLS_DLLPUBLIC friend SvStream & operator << ( SvStream &, const SvGlobalName & );
+
+ sal_Bool operator < ( const SvGlobalName & rObj ) const;
+ SvGlobalName & operator += ( sal_uInt32 );
+ SvGlobalName & operator ++ () { return operator += ( 1 ); }
+
+ sal_Bool operator == ( const SvGlobalName & rObj ) const;
+ sal_Bool operator != ( const SvGlobalName & rObj ) const
+ { return !(*this == rObj); }
+
+ void MakeFromMemory( void * pData );
+ sal_Bool MakeId( const String & rId );
+ String GetHexName() const;
+
+ SvGlobalName( const CLSID & rId );
+ const CLSID & GetCLSID() const { return *(CLSID *)pImp->szData; }
+ const sal_uInt8* GetBytes() const { return pImp->szData; }
+
+ // platform independent representation of a "GlobalName"
+ // maybe transported remotely
+ com::sun::star::uno::Sequence < sal_Int8 > GetByteSequence() const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/helpers.hxx b/include/tools/helpers.hxx
new file mode 100644
index 000000000000..5a525872ae50
--- /dev/null
+++ b/include/tools/helpers.hxx
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+#ifndef _TOOLS_HELPERS_HXX
+#define _TOOLS_HELPERS_HXX
+
+inline long MinMax( long nVal, long nMin, long nMax )
+{
+ return nVal >= nMin ? ( nVal <= nMax ? nVal : nMax ) : nMin;
+}
+
+inline long AlignedWidth4Bytes( long nWidthBits )
+{
+ return ( ( nWidthBits + 31 ) >> 5 ) << 2;
+}
+
+inline long FRound( double fVal )
+{
+ return fVal > 0.0 ? static_cast<long>( fVal + 0.5 ) : -static_cast<long>( -fVal + 0.5 );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/inetmime.hxx b/include/tools/inetmime.hxx
new file mode 100644
index 000000000000..afe4247c6612
--- /dev/null
+++ b/include/tools/inetmime.hxx
@@ -0,0 +1,1261 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef TOOLS_INETMIME_HXX
+#define TOOLS_INETMIME_HXX
+
+#include <boost/ptr_container/ptr_vector.hpp>
+
+#include "tools/toolsdllapi.h"
+#include <rtl/alloc.h>
+#include <rtl/character.hxx>
+#include <rtl/string.hxx>
+#include <rtl/strbuf.hxx>
+#include <rtl/tencinfo.h>
+#include <tools/debug.hxx>
+#include <tools/errcode.hxx>
+#include <tools/string.hxx>
+
+class DateTime;
+class INetContentTypeParameterList;
+class INetMIMECharsetList_Impl;
+class INetMIMEOutputSink;
+
+class TOOLS_DLLPUBLIC INetMIME
+{
+public:
+ enum { SOFT_LINE_LENGTH_LIMIT = 76,
+ HARD_LINE_LENGTH_LIMIT = 998 };
+
+ /** The various types of message header field bodies, with respect to
+ encoding and decoding them.
+
+ @descr At the moment, five different types of header fields suffice
+ to describe how to encoded and decode any known message header field
+ body, but need for more types may arise in the future as new header
+ fields are introduced.
+
+ @descr The following is an exhaustive list of all the header fields
+ currently known to our implementation. For every header field, it
+ includes a 'canonic' (with regard to capitalization) name, a grammar
+ rule for the body (using RFC 822 and RFC 2234 conventions), a list of
+ relevant sources of information, and the HeaderFieldType value to use
+ with that header field. The list is based on RFC 2076 and draft-
+ palme-mailext-headers-02.txt (see also <http://www.dsv.su.se/~jpalme/
+ ietf/jp-ietf-home.html#anchor1003783>).
+
+ Approved: address ;RFC 1036; HEADER_FIELD_ADDRESS
+ bcc: #address ;RFCs 822, 2047; HEADER_FIELD_ADDRESS
+ cc: 1#address ;RFCs 822, 2047; HEADER_FIELD_ADDRESS
+ Comments: *text ;RFCs 822, RFC 2047; HEADER_FIELD_TEXT
+ Content-Base: absoluteURI ;RFC 2110; HEADER_FIELD_TEXT
+ Content-Description: *text ;RFC 2045, RFC 2047; HEADER_FIELD_TEXT
+ Content-Disposition: disposition-type *(";" disposition-parm)
+ ;RFC 1806; HEADER_FIELD_STRUCTURED
+ Content-ID: msg-id ;RFC 2045, RFC 2047; HEADER_FIELD_MESSAGE_ID
+ Content-Location: absoluteURI / relativeURI ;RFC 2110;
+ HEADER_FIELD_TEXT
+ Content-Transfer-Encoding: mechanism ;RFC 2045, RFC 2047;
+ HEADER_FIELD_STRUCTURED
+ Content-Type: type "/" subtype *(";" parameter) ;RFC 2045, RFC 2047;
+ HEADER_FIELD_STRUCTURED
+ Control: *text ;RFC 1036; HEADER_FIELD_TEXT
+ Date: date-time ;RFC 822, RFC 1123, RFC 2047; HEADER_FIELD_STRUCTURED
+ Distribution: 1#atom ;RFC 1036; HEADER_FIELD_STRUCTURED
+ Encrypted: 1#2word ;RFC 822, RFC 2047; HEADER_FIELD_STRUCTURED
+ Expires: date-time ;RFC 1036; HEADER_FIELD_STRUCTURED
+ Followup-To: 1#(atom *("." atom)) ;RFC 1036; HEADER_FIELD_STRUCTURED
+ From: mailbox / 1#mailbox ;RFC 822, RFC 2047; HEADER_FIELD_ADDRESS
+ In-Reply-To: *(phrase / msg-id) ;RFC 822, RFC 2047;
+ HEADER_FIELD_ADDRESS
+ Keywords: #phrase ;RFC 822, RFC 2047; HEADER_FIELD_PHRASE
+ MIME-Version: 1*DIGIT "." 1*DIGIT ;RFC 2045, RFC 2047;
+ HEADER_FIELD_STRUCTURED
+ Message-ID: msg-id ;RFC 822, RFC 2047; HEADER_FIELD_MESSAGE_ID
+ Newsgroups: 1#(atom *("." atom)) ;RFC 1036, RFC 2047;
+ HEADER_FIELD_STRUCTURED
+ Organization: *text ;RFC 1036; HEADER_FIELD_TEXT
+ Received: ["from" domain] ["by" domain] ["via" atom] *("with" atom)
+ ["id" msg-id] ["for" addr-spec] ";" date-time ;RFC 822, RFC 1123,
+ RFC 2047; HEADER_FIELD_STRUCTURED
+ References: *(phrase / msg-id) ;RFC 822, RFC 2047;
+ HEADER_FIELD_ADDRESS
+ Reply-To: 1#address ;RFC 822, RFC 2047; HEADER_FIELD_ADDRESS
+ Resent-Date: date-time ;RFC 822, RFC 1123, RFC 2047;
+ HEADER_FIELD_STRUCTURED
+ Resent-From: mailbox / 1#mailbox ;RFC 822, RFC 2047;
+ HEADER_FIELD_ADDRESS
+ Resent-Message-ID: msg-id ;RFC 822, RFC 2047; HEADER_FIELD_MESSAGE_ID
+ Resent-Reply-To: 1#address ;RFC 822, RFC 2047; HEADER_FIELD_ADDRESS
+ Resent-Sender: mailbox ;RFC 822, RFC 2047; HEADER_FIELD_ADDRESS
+ Resent-To: 1#address ;RFC 822, RFC 2047; HEADER_FIELD_ADDRESS
+ Resent-bcc: #address ;RFC 822, RFC 2047; HEADER_FIELD_ADDRESS
+ Resent-cc: 1#address ;RFC 822, RFC 2047; HEADER_FIELD_ADDRESS
+ Return-path: route-addr / ("<" ">") ;RFC 822, RFC 1123, RFC 2047;
+ HEADER_FIELD_STRUCTURED
+ Return-Receipt-To: address ;Not Internet standard;
+ HEADER_FIELD_ADDRES
+ Sender: mailbox ;RFC 822, RFC 2047; HEADER_FIELD_ADDRESS
+ Subject: *text ;RFC 822, RFC 2047; HEADER_FIELD_TEXT
+ Summary: *text ;RFC 1036; HEADER_FIELD_TEXT
+ To: 1#address ;RFC 822, RFC 2047; HEADER_FIELD_ADDRESS
+ X-CHAOS-Marked: "YES" / "NO" ;local; HEADER_FIELD_STRUCTURED
+ X-CHAOS-Read: "YES" / "NO" ;local; HEADER_FIELD_STRUCTURED
+ X-CHAOS-Recipients: #*("<" atom word ">") ;local;
+ HEADER_FIELD_STRUCTURED
+ X-CHAOS-Size: 1*DIGIT ;local; HEADER_FIELD_STRUCTURED
+ X-Mailer: *text ;Not Internet standard; HEADER_FIELD_TEXT
+ X-Mozilla-Status: 4HEXDIG ;Mozilla; HEADER_FIELD_STRUCTURED
+ X-Newsreader: *text ;Not Internet standard; HEADER_FIELD_TEXT
+ X-Priority: "1" / "2" / "3" / "4" / "5" ;Not Internet standard;
+ HEADER_FIELD_STRUCTURED
+ Xref: sub-domain
+ 1*((atom / string) *("." (atom / string)) ":" msg-number)
+ ;RFCs 1036, 2047, local; HEADER_FIELD_STRUCTURED
+ */
+ enum HeaderFieldType
+ {
+ HEADER_FIELD_TEXT,
+ HEADER_FIELD_STRUCTURED,
+ HEADER_FIELD_PHRASE,
+ HEADER_FIELD_MESSAGE_ID,
+ HEADER_FIELD_ADDRESS
+ };
+
+ /** Check for US-ASCII character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a US-ASCII character (0x00--0x7F).
+ */
+ static inline bool isUSASCII(sal_uInt32 nChar);
+
+ /** Check for ISO 8859-1 character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a ISO 8859-1 character (0x00--0xFF).
+ */
+ static inline bool isISO88591(sal_uInt32 nChar);
+
+ /** Check for US-ASCII control character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a US-ASCII control character (US-ASCII
+ 0x00--0x1F or 0x7F).
+ */
+ static inline bool isControl(sal_uInt32 nChar);
+
+ /** Check for US-ASCII white space character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a US-ASCII white space character (US-ASCII
+ 0x09 or 0x20).
+ */
+ static inline bool isWhiteSpace(sal_uInt32 nChar);
+
+ /** Check for US-ASCII visible character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a US-ASCII visible character (US-ASCII
+ 0x21--0x7E).
+ */
+ static inline bool isVisible(sal_uInt32 nChar);
+
+ /** Check for US-ASCII digit character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a US-ASCII (decimal) digit character (US-
+ ASCII '0'--'9').
+ */
+ static inline bool isDigit(sal_uInt32 nChar);
+
+ /** Check for US-ASCII canonic hexadecimal digit character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a US-ASCII canonic (i.e., upper case)
+ hexadecimal digit character (US-ASCII '0'--'9' or 'A'--'F').
+ */
+ static inline bool isCanonicHexDigit(sal_uInt32 nChar);
+
+ /** Check for US-ASCII hexadecimal digit character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a US-ASCII hexadecimal digit character (US-
+ ASCII '0'--'9', 'A'--'F', 'a'--'f').
+ */
+ static inline bool isHexDigit(sal_uInt32 nChar);
+
+ /** Check for US-ASCII upper case character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a US-ASCII upper case alphabetic character
+ (US-ASCII 'A'--'Z').
+ */
+ static inline bool isUpperCase(sal_uInt32 nChar);
+
+ /** Check for US-ASCII lower case character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a US-ASCII lower case alphabetic character
+ (US-ASCII 'a'--'z').
+ */
+ static inline bool isLowerCase(sal_uInt32 nChar);
+
+ /** Check for US-ASCII alphabetic character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a US-ASCII alphabetic character (US-ASCII
+ 'A'--'Z' or 'a'--'z').
+ */
+ static inline bool isAlpha(sal_uInt32 nChar);
+
+ /** Check for US-ASCII alphanumeric character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a US-ASCII alphanumeric character (US-ASCII
+ '0'--'9', 'A'--'Z' or 'a'--'z').
+ */
+ static inline bool isAlphanumeric(sal_uInt32 nChar);
+
+ /** Check for US-ASCII Base 64 digit character.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is a US-ASCII Base 64 digit character (US-ASCII
+ 'A'--'Z', 'a'--'z', '0'--'9', '+', or '/').
+ */
+ static inline bool isBase64Digit(sal_uInt32 nChar);
+
+ /** Check whether some character is valid within an RFC 822 <atom>.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is valid within an RFC 822 <atom> (US-ASCII
+ 'A'--'Z', 'a'--'z', '0'--'9', '!', '#', '$', '%', '&', ''', '*', '+',
+ '-', '/', '=', '?', '^', '_', '`', '{', '|', '}', or '~').
+ */
+ static bool isAtomChar(sal_uInt32 nChar);
+
+ /** Check whether some character is valid within an RFC 2045 <token>.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is valid within an RFC 2047 <token> (US-ASCII
+ 'A'--'Z', 'a'--'z', '0'--'9', '!', '#', '$', '%', '&', ''', '*', '+',
+ '-', '.', '^', '_', '`', '{', '|', '}', or '~').
+ */
+ static bool isTokenChar(sal_uInt32 nChar);
+
+ /** Check whether some character is valid within an RFC 2047 <token>.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is valid within an RFC 2047 <token> (US-ASCII
+ 'A'--'Z', 'a'--'z', '0'--'9', '!', '#', '$', '%', '&', ''', '*', '+',
+ '-', '^', '_', '`', '{', '|', '}', or '~').
+ */
+ static bool isEncodedWordTokenChar(sal_uInt32 nChar);
+
+ /** Check whether some character is valid within an RFC 2060 <atom>.
+
+ @param nChar Some UCS-4 character.
+
+ @return True if nChar is valid within an RFC 2060 <atom> (US-ASCII
+ 'A'--'Z', 'a'--'z', '0'--'9', '!', '#', '$', '&', ''', '+', ',', '-',
+ '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', ']', '^', '_', '`',
+ '|', '}', or '~').
+ */
+ static bool isIMAPAtomChar(sal_uInt32 nChar);
+
+ /** Translate an US-ASCII character to upper case.
+
+ @param nChar Some UCS-4 character.
+
+ @return If nChar is a US-ASCII upper case character (US-ASCII
+ 'A'--'Z'), return the corresponding US-ASCII lower case character (US-
+ ASCII 'a'--'z'); otherwise, return nChar unchanged.
+ */
+ static inline sal_uInt32 toUpperCase(sal_uInt32 nChar);
+
+ /** Translate an US-ASCII character to lower case.
+
+ @param nChar Some UCS-4 character.
+
+ @return If nChar is a US-ASCII lower case character (US-ASCII
+ 'a'--'z'), return the corresponding US-ASCII upper case character (US-
+ ASCII 'A'--'Z'); otherwise, return nChar unchanged.
+ */
+ static inline sal_uInt32 toLowerCase(sal_uInt32 nChar);
+
+ /** Get the digit weight of a US-ASCII character.
+
+ @param nChar Some UCS-4 character.
+
+ @return If nChar is a US-ASCII (decimal) digit character (US-ASCII
+ '0'--'9'), return the corresponding weight (0--9); otherwise,
+ return -1.
+ */
+ static inline int getWeight(sal_uInt32 nChar);
+
+ /** Get the hexadecimal digit weight of a US-ASCII character.
+
+ @param nChar Some UCS-4 character.
+
+ @return If nChar is a US-ASCII hexadecimal digit character (US-ASCII
+ '0'--'9', 'A'--'F', or 'a'--'f'), return the corresponding weight
+ (0--15); otherwise, return -1.
+ */
+ static inline int getHexWeight(sal_uInt32 nChar);
+
+ /** Get the Base 64 digit weight of a US-ASCII character.
+
+ @param nChar Some UCS-4 character.
+
+ @return If nChar is a US-ASCII Base 64 digit character (US-ASCII
+ 'A'--'F', or 'a'--'f', '0'--'9', '+', or '/'), return the
+ corresponding weight (0--63); if nChar is the US-ASCII Base 64 padding
+ character (US-ASCII '='), return -1; otherwise, return -2.
+ */
+ static inline int getBase64Weight(sal_uInt32 nChar);
+
+ /** Get a hexadecimal digit encoded as US-ASCII.
+
+ @param nWeight Must be in the range 0--15, inclusive.
+
+ @return The canonic (i.e., upper case) hexadecimal digit
+ corresponding to nWeight (US-ASCII '0'--'9' or 'A'--'F').
+ */
+ static sal_uInt32 getHexDigit(int nWeight);
+
+ static inline bool isHighSurrogate(sal_uInt32 nUTF16);
+
+ static inline bool isLowSurrogate(sal_uInt32 nUTF16);
+
+ static inline sal_uInt32 toUTF32(sal_Unicode cHighSurrogate,
+ sal_Unicode cLowSurrogate);
+
+ /** Check two US-ASCII strings for equality, ignoring case.
+
+ @param pBegin1 Points to the start of the first string, must not be
+ null.
+
+ @param pEnd1 Points past the end of the first string, must be >=
+ pBegin1.
+
+ @param pString2 Points to the start of the null terminated second
+ string, must not be null.
+
+ @return True if the two strings are equal, ignoring the case of US-
+ ASCII alphabetic characters (US-ASCII 'A'--'Z' and 'a'--'z').
+ */
+ static bool equalIgnoreCase(const sal_Char * pBegin1,
+ const sal_Char * pEnd1,
+ const sal_Char * pString2);
+
+ /** Check two US-ASCII strings for equality, ignoring case.
+
+ @param pBegin1 Points to the start of the first string, must not be
+ null.
+
+ @param pEnd1 Points past the end of the first string, must be >=
+ pBegin1.
+
+ @param pString2 Points to the start of the null terminated second
+ string, must not be null.
+
+ @return True if the two strings are equal, ignoring the case of US-
+ ASCII alphabetic characters (US-ASCII 'A'--'Z' and 'a'--'z').
+ */
+ static bool equalIgnoreCase(const sal_Unicode * pBegin1,
+ const sal_Unicode * pEnd1,
+ const sal_Char * pString2);
+
+ static inline bool startsWithLineBreak(const sal_Char * pBegin,
+ const sal_Char * pEnd);
+
+ static inline bool startsWithLineBreak(const sal_Unicode * pBegin,
+ const sal_Unicode * pEnd);
+
+ static inline bool startsWithLineFolding(const sal_Char * pBegin,
+ const sal_Char * pEnd);
+
+ static inline bool startsWithLineFolding(const sal_Unicode * pBegin,
+ const sal_Unicode * pEnd);
+
+ static bool startsWithLinearWhiteSpace(const sal_Char * pBegin,
+ const sal_Char * pEnd);
+
+ static const sal_Unicode * skipLinearWhiteSpace(const sal_Unicode *
+ pBegin,
+ const sal_Unicode * pEnd);
+
+ static const sal_Unicode * skipComment(const sal_Unicode * pBegin,
+ const sal_Unicode * pEnd);
+
+ static const sal_Unicode * skipLinearWhiteSpaceComment(const sal_Unicode *
+ pBegin,
+ const sal_Unicode *
+ pEnd);
+
+ static inline bool needsQuotedStringEscape(sal_uInt32 nChar);
+
+ static const sal_Char * skipQuotedString(const sal_Char * pBegin,
+ const sal_Char * pEnd);
+
+ static const sal_Unicode * skipQuotedString(const sal_Unicode * pBegin,
+ const sal_Unicode * pEnd);
+
+ static bool scanUnsigned(const sal_Unicode *& rBegin,
+ const sal_Unicode * pEnd, bool bLeadingZeroes,
+ sal_uInt32 & rValue);
+
+ static const sal_Unicode * scanQuotedBlock(const sal_Unicode * pBegin,
+ const sal_Unicode * pEnd,
+ sal_uInt32 nOpening,
+ sal_uInt32 nClosing,
+ sal_Size & rLength,
+ bool & rModify);
+
+ static sal_Unicode const * scanParameters(sal_Unicode const * pBegin,
+ sal_Unicode const * pEnd,
+ INetContentTypeParameterList *
+ pParameters);
+
+ static inline rtl_TextEncoding translateToMIME(rtl_TextEncoding
+ eEncoding);
+
+ static inline rtl_TextEncoding translateFromMIME(rtl_TextEncoding
+ eEncoding);
+
+ static const sal_Char * getCharsetName(rtl_TextEncoding eEncoding);
+
+ static rtl_TextEncoding getCharsetEncoding(const sal_Char * pBegin,
+ const sal_Char * pEnd);
+
+ static inline bool isMIMECharsetEncoding(rtl_TextEncoding eEncoding);
+
+ static INetMIMECharsetList_Impl *
+ createPreferredCharsetList(rtl_TextEncoding eEncoding);
+
+ static sal_Unicode * convertToUnicode(const sal_Char * pBegin,
+ const sal_Char * pEnd,
+ rtl_TextEncoding eEncoding,
+ sal_Size & rSize);
+
+ static sal_Char * convertFromUnicode(const sal_Unicode * pBegin,
+ const sal_Unicode * pEnd,
+ rtl_TextEncoding eEncoding,
+ sal_Size & rSize);
+
+ /** Get the number of octets required to encode an UCS-4 character using
+ UTF-8 encoding.
+
+ @param nChar Some UCS-4 character.
+
+ @return The number of octets required (in the range 1--6, inclusive).
+ */
+ static inline int getUTF8OctetCount(sal_uInt32 nChar);
+
+ static inline void writeEscapeSequence(INetMIMEOutputSink & rSink,
+ sal_uInt32 nChar);
+
+ static void writeUTF8(INetMIMEOutputSink & rSink, sal_uInt32 nChar);
+
+ static void writeHeaderFieldBody(INetMIMEOutputSink & rSink,
+ HeaderFieldType eType,
+ const OUString& rBody,
+ rtl_TextEncoding ePreferredEncoding,
+ bool bInitialSpace = true);
+
+ static bool translateUTF8Char(const sal_Char *& rBegin,
+ const sal_Char * pEnd,
+ rtl_TextEncoding eEncoding,
+ sal_uInt32 & rCharacter);
+
+ static OUString decodeHeaderFieldBody(HeaderFieldType eType,
+ const OString& rBody);
+
+// #i70651#: Prevent warnings on Mac OS X.
+#ifdef MACOSX
+#pragma GCC system_header
+#endif
+
+ /** Get the UTF-32 character at the head of a UTF-16 encoded string.
+
+ @param rBegin Points to the start of the UTF-16 encoded string, must
+ not be null. On exit, it points past the first UTF-32 character's
+ encoding.
+
+ @param pEnd Points past the end of the UTF-16 encoded string, must be
+ strictly greater than rBegin.
+
+ @return The UCS-4 character at the head of the UTF-16 encoded string.
+ If the string does not start with the UTF-16 encoding of a UCS-32
+ character, the first UTF-16 value is returned.
+ */
+ static inline sal_uInt32 getUTF32Character(const sal_Unicode *& rBegin,
+ const sal_Unicode * pEnd);
+
+ /** Put the UTF-16 encoding of a UTF-32 character into a buffer.
+
+ @param pBuffer Points to a buffer, must not be null.
+
+ @param nUTF32 An UTF-32 character, must be in the range 0..0x10FFFF.
+
+ @return A pointer past the UTF-16 characters put into the buffer
+ (i.e., pBuffer + 1 or pBuffer + 2).
+ */
+ static inline sal_Unicode * putUTF32Character(sal_Unicode * pBuffer,
+ sal_uInt32 nUTF32);
+};
+
+// static
+inline bool INetMIME::isUSASCII(sal_uInt32 nChar)
+{
+ return rtl::isAscii(nChar);
+}
+
+// static
+inline bool INetMIME::isISO88591(sal_uInt32 nChar)
+{
+ return nChar <= 0xFF;
+}
+
+// static
+inline bool INetMIME::isControl(sal_uInt32 nChar)
+{
+ return nChar <= 0x1F || nChar == 0x7F;
+}
+
+// static
+inline bool INetMIME::isWhiteSpace(sal_uInt32 nChar)
+{
+ return nChar == '\t' || nChar == ' ';
+}
+
+// static
+inline bool INetMIME::isVisible(sal_uInt32 nChar)
+{
+ return nChar >= '!' && nChar <= '~';
+}
+
+// static
+inline bool INetMIME::isDigit(sal_uInt32 nChar)
+{
+ return rtl::isAsciiDigit(nChar);
+}
+
+// static
+inline bool INetMIME::isCanonicHexDigit(sal_uInt32 nChar)
+{
+ return rtl::isAsciiCanonicHexDigit(nChar);
+}
+
+// static
+inline bool INetMIME::isHexDigit(sal_uInt32 nChar)
+{
+ return rtl::isAsciiHexDigit(nChar);
+}
+
+// static
+inline bool INetMIME::isUpperCase(sal_uInt32 nChar)
+{
+ return rtl::isAsciiUpperCase(nChar);
+}
+
+// static
+inline bool INetMIME::isLowerCase(sal_uInt32 nChar)
+{
+ return rtl::isAsciiLowerCase(nChar);
+}
+
+// static
+inline bool INetMIME::isAlpha(sal_uInt32 nChar)
+{
+ return rtl::isAsciiAlpha(nChar);
+}
+
+// static
+inline bool INetMIME::isAlphanumeric(sal_uInt32 nChar)
+{
+ return rtl::isAsciiAlphanumeric(nChar);
+}
+
+// static
+inline bool INetMIME::isBase64Digit(sal_uInt32 nChar)
+{
+ return rtl::isAsciiUpperCase(nChar) || rtl::isAsciiLowerCase(nChar) || rtl::isAsciiDigit(nChar)
+ || nChar == '+' || nChar == '/';
+}
+
+// static
+inline sal_uInt32 INetMIME::toUpperCase(sal_uInt32 nChar)
+{
+ return rtl::isAsciiLowerCase(nChar) ? nChar - ('a' - 'A') : nChar;
+}
+
+// static
+inline sal_uInt32 INetMIME::toLowerCase(sal_uInt32 nChar)
+{
+ return rtl::isAsciiUpperCase(nChar) ? nChar + ('a' - 'A') : nChar;
+}
+
+// static
+inline int INetMIME::getWeight(sal_uInt32 nChar)
+{
+ return rtl::isAsciiDigit(nChar) ? int(nChar - '0') : -1;
+}
+
+// static
+inline int INetMIME::getHexWeight(sal_uInt32 nChar)
+{
+ return rtl::isAsciiDigit(nChar) ? int(nChar - '0') :
+ nChar >= 'A' && nChar <= 'F' ? int(nChar - 'A' + 10) :
+ nChar >= 'a' && nChar <= 'f' ? int(nChar - 'a' + 10) : -1;
+}
+
+// static
+inline int INetMIME::getBase64Weight(sal_uInt32 nChar)
+{
+ return rtl::isAsciiUpperCase(nChar) ? int(nChar - 'A') :
+ rtl::isAsciiLowerCase(nChar) ? int(nChar - 'a' + 26) :
+ rtl::isAsciiDigit(nChar) ? int(nChar - '0' + 52) :
+ nChar == '+' ? 62 :
+ nChar == '/' ? 63 :
+ nChar == '=' ? -1 : -2;
+}
+
+// static
+inline bool INetMIME::isHighSurrogate(sal_uInt32 nUTF16)
+{
+ return nUTF16 >= 0xD800 && nUTF16 <= 0xDBFF;
+}
+
+// static
+inline bool INetMIME::isLowSurrogate(sal_uInt32 nUTF16)
+{
+ return nUTF16 >= 0xDC00 && nUTF16 <= 0xDFFF;
+}
+
+// static
+inline sal_uInt32 INetMIME::toUTF32(sal_Unicode cHighSurrogate,
+ sal_Unicode cLowSurrogate)
+{
+ DBG_ASSERT(isHighSurrogate(cHighSurrogate)
+ && isLowSurrogate(cLowSurrogate),
+ "INetMIME::toUTF32(): Bad chars");
+ return ((sal_uInt32(cHighSurrogate) & 0x3FF) << 10)
+ | (sal_uInt32(cLowSurrogate) & 0x3FF);
+}
+
+// static
+inline bool INetMIME::startsWithLineBreak(const sal_Char * pBegin,
+ const sal_Char * pEnd)
+{
+ DBG_ASSERT(pBegin && pBegin <= pEnd,
+ "INetMIME::startsWithLineBreak(): Bad sequence");
+
+ return pEnd - pBegin >= 2 && pBegin[0] == 0x0D && pBegin[1] == 0x0A;
+ // CR, LF
+}
+
+// static
+inline bool INetMIME::startsWithLineBreak(const sal_Unicode * pBegin,
+ const sal_Unicode * pEnd)
+{
+ DBG_ASSERT(pBegin && pBegin <= pEnd,
+ "INetMIME::startsWithLineBreak(): Bad sequence");
+
+ return pEnd - pBegin >= 2 && pBegin[0] == 0x0D && pBegin[1] == 0x0A;
+ // CR, LF
+}
+
+// static
+inline bool INetMIME::startsWithLineFolding(const sal_Char * pBegin,
+ const sal_Char * pEnd)
+{
+ DBG_ASSERT(pBegin && pBegin <= pEnd,
+ "INetMIME::startsWithLineFolding(): Bad sequence");
+
+ return pEnd - pBegin >= 3 && pBegin[0] == 0x0D && pBegin[1] == 0x0A
+ && isWhiteSpace(pBegin[2]); // CR, LF
+}
+
+// static
+inline bool INetMIME::startsWithLineFolding(const sal_Unicode * pBegin,
+ const sal_Unicode * pEnd)
+{
+ DBG_ASSERT(pBegin && pBegin <= pEnd,
+ "INetMIME::startsWithLineFolding(): Bad sequence");
+
+ return pEnd - pBegin >= 3 && pBegin[0] == 0x0D && pBegin[1] == 0x0A
+ && isWhiteSpace(pBegin[2]); // CR, LF
+}
+
+// static
+inline bool INetMIME::startsWithLinearWhiteSpace(const sal_Char * pBegin,
+ const sal_Char * pEnd)
+{
+ DBG_ASSERT(pBegin && pBegin <= pEnd,
+ "INetMIME::startsWithLinearWhiteSpace(): Bad sequence");
+
+ return pBegin != pEnd
+ && (isWhiteSpace(*pBegin) || startsWithLineFolding(pBegin, pEnd));
+}
+
+// static
+inline bool INetMIME::needsQuotedStringEscape(sal_uInt32 nChar)
+{
+ return nChar == '"' || nChar == '\\';
+}
+
+// static
+inline rtl_TextEncoding INetMIME::translateToMIME(rtl_TextEncoding eEncoding)
+{
+#if defined WNT
+ return eEncoding == RTL_TEXTENCODING_MS_1252 ?
+ RTL_TEXTENCODING_ISO_8859_1 : eEncoding;
+#else // WNT
+ return eEncoding;
+#endif // WNT
+}
+
+// static
+inline rtl_TextEncoding INetMIME::translateFromMIME(rtl_TextEncoding
+ eEncoding)
+{
+#if defined WNT
+ return eEncoding == RTL_TEXTENCODING_ISO_8859_1 ?
+ RTL_TEXTENCODING_MS_1252 : eEncoding;
+#else
+ return eEncoding;
+#endif
+}
+
+// static
+inline bool INetMIME::isMIMECharsetEncoding(rtl_TextEncoding eEncoding)
+{
+ return ( rtl_isOctetTextEncoding(eEncoding) == sal_True );
+}
+
+// static
+inline int INetMIME::getUTF8OctetCount(sal_uInt32 nChar)
+{
+ DBG_ASSERT(nChar < 0x80000000, "INetMIME::getUTF8OctetCount(): Bad char");
+
+ return nChar < 0x80 ? 1 :
+ nChar < 0x800 ? 2 :
+ nChar <= 0x10000 ? 3 :
+ nChar <= 0x200000 ? 4 :
+ nChar <= 0x4000000 ? 5 : 6;
+}
+
+// static
+inline sal_uInt32 INetMIME::getUTF32Character(const sal_Unicode *& rBegin,
+ const sal_Unicode * pEnd)
+{
+ DBG_ASSERT(rBegin && rBegin < pEnd,
+ "INetMIME::getUTF32Character(): Bad sequence");
+ if (rBegin + 1 < pEnd && rBegin[0] >= 0xD800 && rBegin[0] <= 0xDBFF
+ && rBegin[1] >= 0xDC00 && rBegin[1] <= 0xDFFF)
+ {
+ sal_uInt32 nUTF32 = sal_uInt32(*rBegin++ & 0x3FF) << 10;
+ return (nUTF32 | (*rBegin++ & 0x3FF)) + 0x10000;
+ }
+ else
+ return *rBegin++;
+}
+
+// static
+inline sal_Unicode * INetMIME::putUTF32Character(sal_Unicode * pBuffer,
+ sal_uInt32 nUTF32)
+{
+ DBG_ASSERT(nUTF32 <= 0x10FFFF, "INetMIME::putUTF32Character(): Bad char");
+ if (nUTF32 < 0x10000)
+ *pBuffer++ = sal_Unicode(nUTF32);
+ else
+ {
+ nUTF32 -= 0x10000;
+ *pBuffer++ = sal_Unicode(0xD800 | (nUTF32 >> 10));
+ *pBuffer++ = sal_Unicode(0xDC00 | (nUTF32 & 0x3FF));
+ }
+ return pBuffer;
+}
+
+class INetMIMEOutputSink
+{
+public:
+ static sal_uInt32 const NO_LINE_LENGTH_LIMIT = SAL_MAX_UINT32;
+
+private:
+ sal_uInt32 m_nColumn;
+ sal_uInt32 m_nLineLengthLimit;
+
+protected:
+ /** Write a sequence of octets.
+
+ @param pBegin Points to the start of the sequence, must not be null.
+
+ @param pEnd Points past the end of the sequence, must be >= pBegin.
+ */
+ virtual void writeSequence(const sal_Char * pBegin,
+ const sal_Char * pEnd) = 0;
+
+ /** Write a null terminated sequence of octets (without the terminating
+ null).
+
+ @param pOctets A null terminated sequence of octets, must not be
+ null.
+
+ @return The length of pOctets (without the terminating null).
+ */
+ virtual sal_Size writeSequence(const sal_Char * pSequence);
+
+ /** Write a sequence of octets.
+
+ @descr The supplied sequence of UCS-4 characters is interpreted as a
+ sequence of octets. It is an error if any of the elements of the
+ sequence has a numerical value greater than 255.
+
+ @param pBegin Points to the start of the sequence, must not be null.
+
+ @param pEnd Points past the end of the sequence, must be >= pBegin.
+ */
+ virtual void writeSequence(const sal_uInt32 * pBegin,
+ const sal_uInt32 * pEnd);
+
+ /** Write a sequence of octets.
+
+ @descr The supplied sequence of Unicode characters is interpreted as
+ a sequence of octets. It is an error if any of the elements of the
+ sequence has a numerical value greater than 255.
+
+ @param pBegin Points to the start of the sequence, must not be null.
+
+ @param pEnd Points past the end of the sequence, must be >= pBegin.
+ */
+ virtual void writeSequence(const sal_Unicode * pBegin,
+ const sal_Unicode * pEnd);
+
+public:
+ INetMIMEOutputSink(sal_uInt32 nTheColumn = 0,
+ sal_uInt32 nTheLineLengthLimit
+ = INetMIME::SOFT_LINE_LENGTH_LIMIT):
+ m_nColumn(nTheColumn), m_nLineLengthLimit(nTheLineLengthLimit) {}
+
+ virtual ~INetMIMEOutputSink() {}
+
+ /** Get the current column.
+
+ @return The current column (starting from zero).
+ */
+ sal_uInt32 getColumn() const { return m_nColumn; }
+
+ sal_uInt32 getLineLengthLimit() const { return m_nLineLengthLimit; }
+
+ void setLineLengthLimit(sal_uInt32 nTheLineLengthLimit)
+ { m_nLineLengthLimit = nTheLineLengthLimit; }
+
+ virtual ErrCode getError() const;
+
+ /** Write a sequence of octets.
+
+ @param pBegin Points to the start of the sequence, must not be null.
+
+ @param pEnd Points past the end of the sequence, must be >= pBegin.
+ */
+ inline void write(const sal_Char * pBegin, const sal_Char * pEnd);
+
+ /** Write a sequence of octets.
+
+ @param pBegin Points to the start of the sequence, must not be null.
+
+ @param nLength The length of the sequence.
+ */
+ void write(const sal_Char * pBegin, sal_Size nLength)
+ { write(pBegin, pBegin + nLength); }
+
+ /** Write a sequence of octets.
+
+ @descr The supplied sequence of UCS-4 characters is interpreted as a
+ sequence of octets. It is an error if any of the elements of the
+ sequence has a numerical value greater than 255.
+
+ @param pBegin Points to the start of the sequence, must not be null.
+
+ @param pEnd Points past the end of the sequence, must be >= pBegin.
+ */
+ inline void write(const sal_uInt32 * pBegin, const sal_uInt32 * pEnd);
+
+ /** Write a sequence of octets.
+
+ @descr The supplied sequence of Unicode characters is interpreted as
+ a sequence of octets. It is an error if any of the elements of the
+ sequence has a numerical value greater than 255.
+
+ @param pBegin Points to the start of the sequence, must not be null.
+
+ @param pEnd Points past the end of the sequence, must be >= pBegin.
+ */
+ inline void write(const sal_Unicode * pBegin, const sal_Unicode * pEnd);
+
+ /** Write a sequence of octets.
+
+ @param rOctets A OString, interpreted as a sequence of octets.
+
+ @param nBegin The offset of the first character to write.
+
+ @param nEnd The offset past the last character to write.
+ */
+ void write(const OString& rOctets, xub_StrLen nBegin,
+ xub_StrLen nEnd)
+ {
+ writeSequence(rOctets.getStr() + nBegin, rOctets.getStr() + nEnd);
+ m_nColumn += nEnd - nBegin;
+ }
+
+ /** Write a single octet.
+
+ @param nOctet Some octet.
+
+ @return This instance.
+ */
+ inline INetMIMEOutputSink & operator <<(sal_Char nOctet);
+
+ /** Write a null terminated sequence of octets (without the terminating
+ null).
+
+ @param pOctets A null terminated sequence of octets, must not be
+ null.
+
+ @return This instance.
+ */
+ inline INetMIMEOutputSink & operator <<(const sal_Char * pOctets);
+
+ /** Write a sequence of octets.
+
+ @param rOctets A OString, interpreted as a sequence of octets.
+
+ @return This instance.
+ */
+ INetMIMEOutputSink & operator <<(const OString& rOctets)
+ {
+ writeSequence(rOctets.getStr(), rOctets.getStr() + rOctets.getLength());
+ m_nColumn += rOctets.getLength();
+ return *this;
+ }
+
+ /** Call a manipulator function.
+
+ @param pManipulator A manipulator function.
+
+ @return Whatever the manipulator function returns.
+ */
+ INetMIMEOutputSink &
+ operator <<(INetMIMEOutputSink & (* pManipulator)(INetMIMEOutputSink &))
+ { return pManipulator(*this); }
+
+ /** Write a line end (CR LF).
+ */
+ void writeLineEnd();
+
+ /** A manipulator function that writes a line end (CR LF).
+
+ @param rSink Some sink.
+
+ @return The sink rSink.
+ */
+ static inline INetMIMEOutputSink & endl(INetMIMEOutputSink & rSink);
+};
+
+inline void INetMIMEOutputSink::write(const sal_Char * pBegin,
+ const sal_Char * pEnd)
+{
+ writeSequence(pBegin, pEnd);
+ m_nColumn += pEnd - pBegin;
+}
+
+inline void INetMIMEOutputSink::write(const sal_uInt32 * pBegin,
+ const sal_uInt32 * pEnd)
+{
+ writeSequence(pBegin, pEnd);
+ m_nColumn += pEnd - pBegin;
+}
+
+inline void INetMIMEOutputSink::write(const sal_Unicode * pBegin,
+ const sal_Unicode * pEnd)
+{
+ writeSequence(pBegin, pEnd);
+ m_nColumn += pEnd - pBegin;
+}
+
+inline INetMIMEOutputSink & INetMIMEOutputSink::operator <<(sal_Char nOctet)
+{
+ writeSequence(&nOctet, &nOctet + 1);
+ ++m_nColumn;
+ return *this;
+}
+
+inline INetMIMEOutputSink & INetMIMEOutputSink::operator <<(const sal_Char *
+ pOctets)
+{
+ m_nColumn += writeSequence(pOctets);
+ return *this;
+}
+
+// static
+inline INetMIMEOutputSink & INetMIMEOutputSink::endl(INetMIMEOutputSink &
+ rSink)
+{
+ rSink.writeLineEnd();
+ return rSink;
+}
+
+// static
+inline void INetMIME::writeEscapeSequence(INetMIMEOutputSink & rSink,
+ sal_uInt32 nChar)
+{
+ DBG_ASSERT(nChar <= 0xFF, "INetMIME::writeEscapeSequence(): Bad char");
+ rSink << '=' << sal_uInt8(getHexDigit(nChar >> 4))
+ << sal_uInt8(getHexDigit(nChar & 15));
+}
+
+class INetMIMEStringOutputSink: public INetMIMEOutputSink
+{
+ OStringBuffer m_aBuffer;
+
+ using INetMIMEOutputSink::writeSequence;
+
+ virtual void writeSequence(const sal_Char * pBegin,
+ const sal_Char * pEnd);
+
+public:
+ inline INetMIMEStringOutputSink(sal_uInt32 nColumn = 0,
+ sal_uInt32 nLineLengthLimit
+ = INetMIME::SOFT_LINE_LENGTH_LIMIT):
+ INetMIMEOutputSink(nColumn, nLineLengthLimit) {}
+
+ virtual ErrCode getError() const;
+
+ OString takeBuffer()
+ {
+ return m_aBuffer.makeStringAndClear();
+ }
+};
+
+class INetMIMEEncodedWordOutputSink
+{
+public:
+ enum Context { CONTEXT_TEXT = 1,
+ CONTEXT_COMMENT = 2,
+ CONTEXT_PHRASE = 4 };
+
+ enum Space { SPACE_NO, SPACE_ENCODED, SPACE_ALWAYS };
+
+private:
+ enum { BUFFER_SIZE = 256 };
+
+ enum Coding { CODING_NONE, CODING_QUOTED, CODING_ENCODED,
+ CODING_ENCODED_TERMINATED };
+
+ enum EncodedWordState { STATE_INITIAL, STATE_FIRST_EQUALS,
+ STATE_FIRST_QUESTION, STATE_CHARSET,
+ STATE_SECOND_QUESTION, STATE_ENCODING,
+ STATE_THIRD_QUESTION, STATE_ENCODED_TEXT,
+ STATE_FOURTH_QUESTION, STATE_SECOND_EQUALS,
+ STATE_BAD };
+
+ INetMIMEOutputSink & m_rSink;
+ Context m_eContext;
+ Space m_eInitialSpace;
+ sal_uInt32 m_nExtraSpaces;
+ INetMIMECharsetList_Impl * m_pEncodingList;
+ sal_Unicode * m_pBuffer;
+ sal_uInt32 m_nBufferSize;
+ sal_Unicode * m_pBufferEnd;
+ Coding m_ePrevCoding;
+ rtl_TextEncoding m_ePrevMIMEEncoding;
+ Coding m_eCoding;
+ sal_uInt32 m_nQuotedEscaped;
+ EncodedWordState m_eEncodedWordState;
+
+ inline bool needsEncodedWordEscape(sal_uInt32 nChar) const;
+
+ void finish(bool bWriteTrailer);
+
+public:
+ inline INetMIMEEncodedWordOutputSink(INetMIMEOutputSink & rTheSink,
+ Context eTheContext,
+ Space eTheInitialSpace,
+ rtl_TextEncoding ePreferredEncoding);
+
+ ~INetMIMEEncodedWordOutputSink();
+
+ INetMIMEEncodedWordOutputSink & operator <<(sal_uInt32 nChar);
+
+ inline void write(const sal_Char * pBegin, const sal_Char * pEnd);
+
+ inline void write(const sal_Unicode * pBegin, const sal_Unicode * pEnd);
+
+ inline bool flush();
+};
+
+inline INetMIMEEncodedWordOutputSink::INetMIMEEncodedWordOutputSink(
+ INetMIMEOutputSink & rTheSink, Context eTheContext,
+ Space eTheInitialSpace, rtl_TextEncoding ePreferredEncoding):
+ m_rSink(rTheSink),
+ m_eContext(eTheContext),
+ m_eInitialSpace(eTheInitialSpace),
+ m_nExtraSpaces(0),
+ m_pEncodingList(INetMIME::createPreferredCharsetList(ePreferredEncoding)),
+ m_ePrevCoding(CODING_NONE),
+ m_eCoding(CODING_NONE),
+ m_nQuotedEscaped(0),
+ m_eEncodedWordState(STATE_INITIAL)
+{
+ m_nBufferSize = BUFFER_SIZE;
+ m_pBuffer = static_cast< sal_Unicode * >(rtl_allocateMemory(
+ m_nBufferSize
+ * sizeof (sal_Unicode)));
+ m_pBufferEnd = m_pBuffer;
+}
+
+inline void INetMIMEEncodedWordOutputSink::write(const sal_Char * pBegin,
+ const sal_Char * pEnd)
+{
+ DBG_ASSERT(pBegin && pBegin <= pEnd,
+ "INetMIMEEncodedWordOutputSink::write(): Bad sequence");
+
+ while (pBegin != pEnd)
+ operator <<(*pBegin++);
+}
+
+inline void INetMIMEEncodedWordOutputSink::write(const sal_Unicode * pBegin,
+ const sal_Unicode * pEnd)
+{
+ DBG_ASSERT(pBegin && pBegin <= pEnd,
+ "INetMIMEEncodedWordOutputSink::write(): Bad sequence");
+
+ while (pBegin != pEnd)
+ operator <<(*pBegin++);
+}
+
+inline bool INetMIMEEncodedWordOutputSink::flush()
+{
+ finish(true);
+ return m_ePrevCoding != CODING_NONE;
+}
+
+struct INetContentTypeParameter
+{
+ /** The name of the attribute, in US-ASCII encoding and converted to lower
+ case. If a parameter value is split as described in RFC 2231, there
+ will only be one item for the complete parameter, with the attribute
+ name lacking any section suffix.
+ */
+ const OString m_sAttribute;
+
+ /** The optional character set specification (see RFC 2231), in US-ASCII
+ encoding and converted to lower case.
+ */
+ const OString m_sCharset;
+
+ /** The optional language specification (see RFC 2231), in US-ASCII
+ encoding and converted to lower case.
+ */
+ const OString m_sLanguage;
+
+ /** The attribute value. If the value is a quoted-string, it is
+ 'unpacked.' If a character set is specified, and the value can be
+ converted to Unicode, this is done. Also, if no character set is
+ specified, it is first tried to convert the value from UTF-8 encoding
+ to Unicode, and if that doesn't work (because the value is not in
+ UTF-8 encoding), it is converted from ISO-8859-1 encoding to Unicode
+ (which will always work). But if a character set is specified and the
+ value cannot be converted from that character set to Unicode, special
+ action is taken to produce a value that can possibly be transformed
+ back into its original form: Any 8-bit character from a non-encoded
+ part of the original value is directly converted to Unicode
+ (effectively handling it as if it was ISO-8859-1 encoded), and any
+ 8-bit character from an encoded part of the original value is mapped
+ to the range U+F800..U+F8FF at the top of the Corporate Use Subarea
+ within Unicode's Private Use Area (effectively adding 0xF800 to the
+ character's numeric value).
+ */
+ const OUString m_sValue;
+
+ /** This is true if the value is successfully converted to Unicode, and
+ false if the value is a special mixture of ISO-LATIN-1 characters and
+ characters from Unicode's Private Use Area.
+ */
+ const bool m_bConverted;
+
+ INetContentTypeParameter(const OString& rTheAttribute,
+ const OString& rTheCharset, const OString& rTheLanguage,
+ const OUString& rTheValue, bool bTheConverted)
+ : m_sAttribute(rTheAttribute)
+ , m_sCharset(rTheCharset)
+ , m_sLanguage(rTheLanguage)
+ , m_sValue(rTheValue)
+ , m_bConverted(bTheConverted)
+ {
+ }
+};
+
+class TOOLS_DLLPUBLIC INetContentTypeParameterList
+{
+public:
+
+ void Clear();
+
+ void Insert(INetContentTypeParameter * pParameter, sal_uIntPtr nIndex)
+ {
+ maEntries.insert(maEntries.begin()+nIndex,pParameter);
+ }
+
+ void Append(INetContentTypeParameter *pParameter)
+ {
+ maEntries.push_back(pParameter);
+ }
+
+ inline const INetContentTypeParameter * GetObject(sal_uIntPtr nIndex) const
+ {
+ return &(maEntries[nIndex]);
+ }
+
+ const INetContentTypeParameter * find(const OString& rAttribute) const;
+
+private:
+
+ boost::ptr_vector<INetContentTypeParameter> maEntries;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/inetmsg.hxx b/include/tools/inetmsg.hxx
new file mode 100644
index 000000000000..395286a04db2
--- /dev/null
+++ b/include/tools/inetmsg.hxx
@@ -0,0 +1,518 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _TOOLS_INETMSG_HXX
+#define _TOOLS_INETMSG_HXX
+
+#include "tools/toolsdllapi.h"
+#include <rtl/string.hxx>
+#include <rtl/textenc.h>
+#include <rtl/ustring.hxx>
+#include <tools/inetmime.hxx>
+#include <tools/stream.hxx>
+
+#include <vector>
+
+class DateTime;
+
+class INetMessageHeader
+{
+ OString m_aName;
+ OString m_aValue;
+
+public:
+ INetMessageHeader()
+ {}
+
+ INetMessageHeader (
+ const OString& rName, const OString& rValue)
+ : m_aName (rName), m_aValue (rValue)
+ {}
+
+ INetMessageHeader (
+ const INetMessageHeader& rHdr)
+ : m_aName (rHdr.m_aName), m_aValue (rHdr.m_aValue)
+ {}
+
+ ~INetMessageHeader()
+ {}
+
+ INetMessageHeader& operator= (const INetMessageHeader& rHdr)
+ {
+ m_aName = rHdr.m_aName;
+ m_aValue = rHdr.m_aValue;
+ return *this;
+ }
+
+ const OString& GetName() const { return m_aName; }
+ const OString& GetValue() const { return m_aValue; }
+
+ friend SvStream& operator<< (
+ SvStream& rStrm, const INetMessageHeader& rHdr)
+ {
+ write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStrm, rHdr.m_aName);
+ write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStrm, rHdr.m_aValue);
+ return rStrm;
+ }
+
+ friend SvStream& operator>> (
+ SvStream& rStrm, INetMessageHeader& rHdr)
+ {
+ rHdr.m_aName = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStrm);
+ rHdr.m_aValue = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStrm);
+ return rStrm;
+ }
+};
+
+typedef ::std::vector< INetMessageHeader* > HeaderList_impl;
+
+class INetMessage
+{
+ HeaderList_impl m_aHeaderList;
+
+ sal_uIntPtr m_nDocSize;
+ OUString m_aDocName;
+ SvLockBytesRef m_xDocLB;
+
+ void ListCleanup_Impl();
+ void ListCopy (const INetMessage& rMsg);
+
+protected:
+ OUString GetHeaderName_Impl (
+ sal_uIntPtr nIndex, rtl_TextEncoding eEncoding) const
+ {
+ if ( nIndex < m_aHeaderList.size() ) {
+ return OStringToOUString(m_aHeaderList[ nIndex ]->GetName(), eEncoding);
+ } else {
+ return OUString();
+ }
+ }
+
+ OUString GetHeaderValue_Impl (
+ sal_uIntPtr nIndex, INetMIME::HeaderFieldType eType) const
+ {
+ if ( nIndex < m_aHeaderList.size() ) {
+ return INetMIME::decodeHeaderFieldBody(eType, m_aHeaderList[ nIndex ]->GetValue());
+ } else {
+ return OUString();
+ }
+ }
+
+ void SetHeaderField_Impl (
+ const INetMessageHeader &rHeader, sal_uIntPtr &rnIndex)
+ {
+ INetMessageHeader *p = new INetMessageHeader (rHeader);
+ if (m_aHeaderList.size() <= rnIndex)
+ {
+ rnIndex = m_aHeaderList.size();
+ m_aHeaderList.push_back( p );
+ }
+ else
+ {
+ delete m_aHeaderList[ rnIndex ];
+ m_aHeaderList[ rnIndex ] = p;
+ }
+ }
+
+ void SetHeaderField_Impl (
+ INetMIME::HeaderFieldType eType,
+ const OString &rName,
+ const OUString &rValue,
+ sal_uIntPtr &rnIndex);
+
+ virtual SvStream& operator<< (SvStream& rStrm) const;
+ virtual SvStream& operator>> (SvStream& rStrm);
+
+public:
+ INetMessage() : m_nDocSize(0) {}
+ virtual ~INetMessage();
+
+ INetMessage (const INetMessage& rMsg)
+ : m_nDocSize (rMsg.m_nDocSize),
+ m_aDocName (rMsg.m_aDocName),
+ m_xDocLB (rMsg.m_xDocLB)
+ {
+ ListCopy (rMsg);
+ }
+
+ INetMessage& operator= (const INetMessage& rMsg)
+ {
+ m_nDocSize = rMsg.m_nDocSize;
+ m_aDocName = rMsg.m_aDocName;
+ m_xDocLB = rMsg.m_xDocLB;
+ ListCopy (rMsg);
+ return *this;
+ }
+
+ sal_uIntPtr GetHeaderCount() const { return m_aHeaderList.size(); }
+
+ OUString GetHeaderName (sal_uIntPtr nIndex) const
+ {
+ return GetHeaderName_Impl (nIndex, RTL_TEXTENCODING_ASCII_US);
+ }
+
+ OUString GetHeaderValue (sal_uIntPtr nIndex) const
+ {
+ return GetHeaderValue_Impl (nIndex, INetMIME::HEADER_FIELD_TEXT);
+ }
+
+ INetMessageHeader GetHeaderField (sal_uIntPtr nIndex) const
+ {
+ if ( nIndex < m_aHeaderList.size() ) {
+ return INetMessageHeader( *m_aHeaderList[ nIndex ] );
+ } else {
+ return INetMessageHeader();
+ }
+ }
+
+ virtual sal_uIntPtr SetHeaderField (
+ const INetMessageHeader &rField,
+ sal_uIntPtr nIndex = ((sal_uIntPtr)-1)
+ );
+
+ sal_uIntPtr GetDocumentSize() const { return m_nDocSize; }
+ void SetDocumentSize (sal_uIntPtr nSize) { m_nDocSize = nSize; }
+
+ const OUString& GetDocumentName() const { return m_aDocName; }
+ void SetDocumentName (const OUString& rName) { m_aDocName = rName; }
+
+ SvLockBytes* GetDocumentLB() const { return m_xDocLB; }
+ void SetDocumentLB (SvLockBytes *pDocLB) { m_xDocLB = pDocLB; }
+
+ friend SvStream& operator<< (
+ SvStream& rStrm, const INetMessage& rMsg)
+ {
+ return rMsg.operator<< (rStrm);
+ }
+
+ friend SvStream& operator>> (
+ SvStream& rStrm, INetMessage& rMsg)
+ {
+ return rMsg.operator>> (rStrm);
+ }
+};
+
+#define INETMSG_RFC822_BCC 0
+#define INETMSG_RFC822_CC 1
+#define INETMSG_RFC822_COMMENTS 2
+#define INETMSG_RFC822_DATE 3
+#define INETMSG_RFC822_FROM 4
+#define INETMSG_RFC822_IN_REPLY_TO 5
+#define INETMSG_RFC822_KEYWORDS 6
+#define INETMSG_RFC822_MESSAGE_ID 7
+#define INETMSG_RFC822_REFERENCES 8
+#define INETMSG_RFC822_REPLY_TO 9
+#define INETMSG_RFC822_RETURN_PATH 10
+#define INETMSG_RFC822_SENDER 11
+#define INETMSG_RFC822_SUBJECT 12
+#define INETMSG_RFC822_TO 13
+#define INETMSG_RFC822_X_MAILER 14
+#define INETMSG_RFC822_RETURN_RECEIPT_TO 15
+#define INETMSG_RFC822_NUMHDR 16
+
+class TOOLS_DLLPUBLIC INetRFC822Message : public INetMessage
+{
+ sal_uIntPtr m_nIndex[INETMSG_RFC822_NUMHDR];
+
+protected:
+ virtual SvStream& operator<< (SvStream& rStrm) const;
+ virtual SvStream& operator>> (SvStream& rStrm);
+
+public:
+ INetRFC822Message();
+ INetRFC822Message (const INetRFC822Message& rMsg);
+ virtual ~INetRFC822Message();
+
+ INetRFC822Message& operator= (const INetRFC822Message& rMsg);
+
+ static bool ParseDateField (
+ const OUString& rDateField, DateTime& rDateTime);
+
+ using INetMessage::SetHeaderField;
+ virtual sal_uIntPtr SetHeaderField (
+ const INetMessageHeader &rHeader,
+ sal_uIntPtr nIndex = ((sal_uIntPtr)-1)
+ );
+
+ // Header fields.
+
+ OUString GetBCC() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_BCC],
+ INetMIME::HEADER_FIELD_ADDRESS);
+ }
+
+ OUString GetCC() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_CC],
+ INetMIME::HEADER_FIELD_ADDRESS);
+ }
+
+ OUString GetComments() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_COMMENTS],
+ INetMIME::HEADER_FIELD_TEXT);
+ }
+
+ OUString GetDate() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_DATE],
+ INetMIME::HEADER_FIELD_STRUCTURED);
+ }
+
+ OUString GetFrom() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_FROM],
+ INetMIME::HEADER_FIELD_ADDRESS);
+ }
+
+ OUString GetInReplyTo() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_IN_REPLY_TO],
+ INetMIME::HEADER_FIELD_ADDRESS); // ??? MESSAGE_ID ???
+ }
+
+ OUString GetKeywords() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_KEYWORDS],
+ INetMIME::HEADER_FIELD_PHRASE);
+ }
+
+ OUString GetMessageID() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_MESSAGE_ID],
+ INetMIME::HEADER_FIELD_MESSAGE_ID);
+ }
+
+ OUString GetReferences() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_REFERENCES],
+ INetMIME::HEADER_FIELD_ADDRESS);
+ }
+
+ OUString GetReplyTo() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_REPLY_TO],
+ INetMIME::HEADER_FIELD_ADDRESS);
+ }
+
+ OUString GetReturnPath() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_RETURN_PATH],
+ INetMIME::HEADER_FIELD_ADDRESS);
+ }
+
+ OUString GetReturnReceiptTo() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_RETURN_RECEIPT_TO],
+ INetMIME::HEADER_FIELD_ADDRESS);
+ }
+
+ OUString GetSender() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_SENDER],
+ INetMIME::HEADER_FIELD_ADDRESS);
+ }
+
+ OUString GetSubject() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_SUBJECT],
+ INetMIME::HEADER_FIELD_TEXT);
+ }
+
+ OUString GetTo() const
+ {
+ return GetHeaderValue_Impl (
+ m_nIndex[INETMSG_RFC822_TO],
+ INetMIME::HEADER_FIELD_TEXT);
+ }
+
+ // Stream operators.
+
+ friend SvStream& operator<< (
+ SvStream& rStrm, const INetRFC822Message& rMsg)
+ {
+ return rMsg.operator<< (rStrm);
+ }
+
+ friend SvStream& operator>> (
+ SvStream& rStrm, INetRFC822Message& rMsg)
+ {
+ return rMsg.operator>> (rStrm);
+ }
+};
+
+#define INETMSG_MIME_VERSION 0
+#define INETMSG_MIME_CONTENT_DESCRIPTION 1
+#define INETMSG_MIME_CONTENT_DISPOSITION 2
+#define INETMSG_MIME_CONTENT_ID 3
+#define INETMSG_MIME_CONTENT_TYPE 4
+#define INETMSG_MIME_CONTENT_TRANSFER_ENCODING 5
+#define INETMSG_MIME_NUMHDR 6
+
+enum INetMessageContainerType
+{
+ INETMSG_MESSAGE_RFC822,
+ INETMSG_MULTIPART_MIXED,
+ INETMSG_MULTIPART_ALTERNATIVE,
+ INETMSG_MULTIPART_DIGEST,
+ INETMSG_MULTIPART_PARALLEL,
+ INETMSG_MULTIPART_RELATED,
+ INETMSG_MULTIPART_FORM_DATA
+};
+
+class INetMIMEMessage;
+typedef ::std::vector< INetMIMEMessage* > INetMIMEMessgeList_impl;
+
+class TOOLS_DLLPUBLIC INetMIMEMessage : public INetRFC822Message
+{
+ sal_uIntPtr m_nIndex[INETMSG_MIME_NUMHDR];
+ INetMIMEMessage* pParent;
+ INetMIMEMessgeList_impl aChildren;
+ OString m_aBoundary;
+ bool bHeaderParsed;
+
+ friend class INetMIMEMessageStream;
+
+ const OString& GetMultipartBoundary() const { return m_aBoundary; }
+ void SetMultipartBoundary (const OString& rBnd) { m_aBoundary = rBnd; }
+
+ void CleanupImp();
+ void CopyImp (const INetMIMEMessage& rMsg);
+ void SetHeaderParsed() { bHeaderParsed = sal_True; }
+
+protected:
+ virtual SvStream& operator<< (SvStream& rStrm) const;
+ virtual SvStream& operator>> (SvStream& rStrm);
+
+public:
+ INetMIMEMessage();
+ INetMIMEMessage (const INetMIMEMessage& rMsg);
+ virtual ~INetMIMEMessage();
+
+ INetMIMEMessage& operator= (const INetMIMEMessage& rMsg);
+
+ bool HeaderParsed() const { return bHeaderParsed; }
+
+ virtual INetMIMEMessage* CreateMessage (
+ const INetMIMEMessage& rMsg) const;
+
+ using INetRFC822Message::SetHeaderField;
+ virtual sal_uIntPtr SetHeaderField (
+ const INetMessageHeader &rHeader,
+ sal_uIntPtr nIndex = ((sal_uIntPtr)-1)
+ );
+
+ // Header fields.
+
+ void SetMIMEVersion (const OUString& rVersion);
+ OUString GetMIMEVersion() const
+ {
+ return GetHeaderValue (m_nIndex[INETMSG_MIME_VERSION]);
+ }
+
+ OUString GetContentDescription() const
+ {
+ return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_DESCRIPTION]);
+ }
+
+ void SetContentDisposition (const OUString& rDisposition);
+ OUString GetContentDisposition() const
+ {
+ return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_DISPOSITION]);
+ }
+
+ OUString GetContentID() const
+ {
+ return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_ID]);
+ }
+
+ void SetContentType (const OUString& rType);
+ OUString GetContentType() const
+ {
+ return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_TYPE]);
+ }
+
+ void SetContentTransferEncoding (const OUString& rEncoding);
+ OUString GetContentTransferEncoding() const
+ {
+ return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_TRANSFER_ENCODING]);
+ }
+
+ OUString GetDefaultContentType ();
+
+ // Message container methods.
+
+ bool IsContainer() const
+ {
+ return (IsMessage() || IsMultipart());
+ }
+ bool IsMessage() const
+ {
+ OUString aType (GetContentType());
+ return aType.matchIgnoreAsciiCase("message/");
+ }
+ bool IsMultipart() const
+ {
+ OUString aType (GetContentType());
+ return aType.matchIgnoreAsciiCase("multipart/");
+ }
+
+ INetMIMEMessage* GetChild (sal_uIntPtr nIndex) const
+ {
+ return ( nIndex < aChildren.size() ) ? aChildren[ nIndex ] : NULL;
+ }
+ INetMIMEMessage* GetParent() const { return pParent; }
+
+ bool EnableAttachChild (
+ INetMessageContainerType eType = INETMSG_MULTIPART_MIXED);
+ bool AttachChild (
+ INetMIMEMessage& rChildMsg, bool bOwner = true );
+
+ // Stream operators.
+
+ friend SvStream& operator<< (
+ SvStream& rStrm, const INetMIMEMessage& rMsg)
+ {
+ return rMsg.operator<< (rStrm);
+ }
+
+ friend SvStream& operator>> (
+ SvStream& rStrm, INetMIMEMessage& rMsg)
+ {
+ return rMsg.operator>> (rStrm);
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/inetstrm.hxx b/include/tools/inetstrm.hxx
new file mode 100644
index 000000000000..d7b4e149d798
--- /dev/null
+++ b/include/tools/inetstrm.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 _TOOLS_INETSTRM_HXX
+#define _TOOLS_INETSTRM_HXX
+
+#include "tools/toolsdllapi.h"
+#include <sal/types.h>
+#include <tools/string.hxx>
+
+class INetMessage;
+class INetMIMEMessage;
+class SvMemoryStream;
+class SvStream;
+
+enum INetStreamStatus
+{
+ INETSTREAM_STATUS_LOADED = -4,
+ INETSTREAM_STATUS_WOULDBLOCK = -3,
+ INETSTREAM_STATUS_OK = -2,
+ INETSTREAM_STATUS_ERROR = -1
+};
+
+class TOOLS_DLLPUBLIC INetIStream
+{
+ // Not implemented.
+ INetIStream (const INetIStream& rStrm);
+ INetIStream& operator= (const INetIStream& rStrm);
+
+protected:
+ virtual int GetData (sal_Char *pData, sal_uIntPtr nSize) = 0;
+
+public:
+ INetIStream ();
+ virtual ~INetIStream (void);
+
+ int Read (sal_Char *pData, sal_uIntPtr nSize);
+};
+
+class INetOStream
+{
+ // Not implemented.
+ INetOStream (const INetOStream& rStrm);
+ INetOStream& operator= (const INetOStream& rStrm);
+
+protected:
+ virtual int PutData (
+ const sal_Char *pData, sal_uIntPtr nSize) = 0;
+
+public:
+ INetOStream ();
+ virtual ~INetOStream (void);
+
+ int Write (const sal_Char *pData, sal_uIntPtr nSize);
+};
+
+enum INetMessageStreamState
+{
+ INETMSG_EOL_BEGIN,
+ INETMSG_EOL_DONE,
+ INETMSG_EOL_SCR,
+ INETMSG_EOL_FCR,
+ INETMSG_EOL_FLF,
+ INETMSG_EOL_FSP,
+ INETMSG_EOL_FESC
+};
+
+/// Message Generator Interface.
+class INetMessageIStream : public INetIStream
+{
+ INetMessage *pSourceMsg;
+ sal_Bool bHeaderGenerated;
+
+ sal_uIntPtr nBufSiz;
+ sal_Char *pBuffer;
+ sal_Char *pRead;
+ sal_Char *pWrite;
+
+ SvStream *pMsgStrm;
+ SvMemoryStream *pMsgBuffer;
+ sal_Char *pMsgRead;
+ sal_Char *pMsgWrite;
+
+ virtual int GetData (sal_Char *pData, sal_uIntPtr nSize);
+
+ // Not implemented.
+ INetMessageIStream (const INetMessageIStream& rStrm);
+ INetMessageIStream& operator= (const INetMessageIStream& rStrm);
+
+protected:
+ virtual int GetMsgLine (sal_Char *pData, sal_uIntPtr nSize);
+
+public:
+ INetMessageIStream (sal_uIntPtr nBufferSize = 2048);
+ virtual ~INetMessageIStream (void);
+
+ INetMessage *GetSourceMessage (void) const { return pSourceMsg; }
+ void SetSourceMessage (INetMessage *pMsg) { pSourceMsg = pMsg; }
+
+ void GenerateHeader (sal_Bool bGen = sal_True) { bHeaderGenerated = !bGen; }
+ sal_Bool IsHeaderGenerated (void) const { return bHeaderGenerated; }
+};
+
+/// Message Parser Interface.
+class INetMessageOStream : public INetOStream
+{
+ INetMessage *pTargetMsg;
+ sal_Bool bHeaderParsed;
+
+ INetMessageStreamState eOState;
+
+ SvMemoryStream *pMsgBuffer;
+
+ virtual int PutData (const sal_Char *pData, sal_uIntPtr nSize);
+
+ // Not implemented.
+ INetMessageOStream (const INetMessageOStream& rStrm);
+ INetMessageOStream& operator= (const INetMessageOStream& rStrm);
+
+protected:
+ virtual int PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize);
+
+public:
+ INetMessageOStream (void);
+ virtual ~INetMessageOStream (void);
+
+ INetMessage *GetTargetMessage (void) const { return pTargetMsg; }
+ void SetTargetMessage (INetMessage *pMsg) { pTargetMsg = pMsg; }
+
+ void ParseHeader (sal_Bool bParse = sal_True) { bHeaderParsed = !bParse; }
+ sal_Bool IsHeaderParsed (void) const { return bHeaderParsed; }
+};
+
+class INetMessageIOStream
+ : public INetMessageIStream,
+ public INetMessageOStream
+{
+ // Not implemented.
+ INetMessageIOStream (const INetMessageIOStream& rStrm);
+ INetMessageIOStream& operator= (const INetMessageIOStream& rStrm);
+
+public:
+ INetMessageIOStream (sal_uIntPtr nBufferSize = 2048);
+ virtual ~INetMessageIOStream (void);
+};
+
+enum INetMessageEncoding
+{
+ INETMSG_ENCODING_7BIT,
+ INETMSG_ENCODING_8BIT,
+ INETMSG_ENCODING_BINARY,
+ INETMSG_ENCODING_QUOTED,
+ INETMSG_ENCODING_BASE64
+};
+
+class TOOLS_DLLPUBLIC INetMIMEMessageStream : public INetMessageIOStream
+{
+ int eState;
+
+ sal_uIntPtr nChildIndex;
+ INetMIMEMessageStream *pChildStrm;
+
+ INetMessageEncoding eEncoding;
+ INetMessageIStream *pEncodeStrm;
+ INetMessageOStream *pDecodeStrm;
+
+ SvMemoryStream *pMsgBuffer;
+
+ static INetMessageEncoding GetMsgEncoding (
+ const String& rContentType);
+
+ // Not implemented.
+ INetMIMEMessageStream (const INetMIMEMessageStream& rStrm);
+ INetMIMEMessageStream& operator= (const INetMIMEMessageStream& rStrm);
+
+protected:
+ virtual int GetMsgLine (sal_Char *pData, sal_uIntPtr nSize);
+ virtual int PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize);
+
+public:
+ INetMIMEMessageStream (sal_uIntPtr nBufferSize = 2048);
+ virtual ~INetMIMEMessageStream (void);
+
+ using INetMessageIStream::SetSourceMessage;
+ void SetSourceMessage (INetMIMEMessage *pMsg)
+ {
+ INetMessageIStream::SetSourceMessage ((INetMessage *)pMsg);
+ }
+ INetMIMEMessage *GetSourceMessage (void) const
+ {
+ return ((INetMIMEMessage *)INetMessageIStream::GetSourceMessage());
+ }
+
+ using INetMessageOStream::SetTargetMessage;
+ void SetTargetMessage (INetMIMEMessage *pMsg)
+ {
+ INetMessageOStream::SetTargetMessage ((INetMessage *)pMsg);
+ }
+ INetMIMEMessage *GetTargetMessage (void) const
+ {
+ return ((INetMIMEMessage *)INetMessageOStream::GetTargetMessage());
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/line.hxx b/include/tools/line.hxx
new file mode 100644
index 000000000000..e1b62ffd00f8
--- /dev/null
+++ b/include/tools/line.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 _LINE_HXX
+#define _LINE_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/gen.hxx>
+
+class Link;
+
+class TOOLS_DLLPUBLIC Line
+{
+private:
+ Point maStart;
+ Point maEnd;
+
+public:
+ Line() {};
+ Line( const Point& rStartPt, const Point& rEndPt ) : maStart( rStartPt ), maEnd( rEndPt ) {}
+
+ void SetStart( const Point& rStartPt ) { maStart = rStartPt; }
+ const Point& GetStart() const { return maStart; }
+
+ void SetEnd( const Point& rEndPt ) { maEnd = rEndPt; }
+ const Point& GetEnd() const { return maEnd; }
+
+ long Left() const { return ( maStart.X() < maEnd.X() ) ? maStart.X() : maEnd.X(); }
+ long Top() const { return ( maStart.Y() < maEnd.Y() ) ? maStart.Y() : maEnd.Y(); }
+ long Right() const { return ( maStart.X() > maEnd.X() ) ? maStart.X() : maEnd.X(); }
+ long Bottom() const { return ( maStart.Y() > maEnd.Y() ) ? maStart.Y() : maEnd.Y(); }
+
+ double GetLength() const;
+
+ sal_Bool Intersection( const Line& rLine, double& rIntersectionX, double& rIntersectionY ) const;
+ sal_Bool Intersection( const Line& rLine, Point& rIntersection ) const;
+
+ double GetDistance( const double& rPtX, const double& rPtY ) const;
+ double GetDistance( const Point& rPoint ) const { return( GetDistance( rPoint.X(), rPoint.Y() ) ); }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/lineend.hxx b/include/tools/lineend.hxx
new file mode 100644
index 000000000000..c24e91cf83d8
--- /dev/null
+++ b/include/tools/lineend.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef _LINEEND_HXX
+#define _LINEEND_HXX
+
+#include <rtl/string.hxx>
+#include <rtl/ustring.hxx>
+#include "tools/toolsdllapi.h"
+
+enum LineEnd { LINEEND_CR, LINEEND_LF, LINEEND_CRLF };
+
+inline LineEnd GetSystemLineEnd()
+{
+#if defined WNT
+ return LINEEND_CRLF;
+#else
+ return LINEEND_LF;
+#endif
+}
+
+TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd);
+TOOLS_DLLPUBLIC OUString convertLineEnd(const OUString &rIn, LineEnd eLineEnd);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/link.hxx b/include/tools/link.hxx
new file mode 100644
index 000000000000..c325b67bae76
--- /dev/null
+++ b/include/tools/link.hxx
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _LINK_HXX
+#define _LINK_HXX
+
+#include "tools/toolsdllapi.h"
+#include "sal/config.h"
+#include "sal/types.h"
+#include <tools/solar.h>
+
+typedef long (*PSTUB)( void*, void* );
+
+#define DECL_LINK( Method, ArgType ) \
+ long Method( ArgType ); \
+ static long LinkStub##Method( void* pThis, void* )
+
+#define DECL_STATIC_LINK( Class, Method, ArgType ) \
+ static long Method( Class*, ArgType )
+
+#define DECL_DLLPRIVATE_LINK(Method, ArgType) \
+ SAL_DLLPRIVATE long Method(ArgType); \
+ SAL_DLLPRIVATE static long LinkStub##Method(void * pThis, void *)
+
+#define DECL_DLLPRIVATE_STATIC_LINK(Class, Method, ArgType) \
+ SAL_DLLPRIVATE static long Method(Class *, ArgType)
+
+#define IMPL_STUB(Class, Method, ArgType) \
+ long Class::LinkStub##Method( void* pThis, void* pCaller) \
+ { \
+ return ((Class*)pThis )->Method( (ArgType)pCaller ); \
+ }
+
+#define IMPL_STATIC_LINK( Class, Method, ArgType, ArgName ) \
+ long Class::Method( Class* pThis, ArgType ArgName )
+
+#define IMPL_STATIC_LINK_NOINSTANCE( Class, Method, ArgType, ArgName ) \
+ long Class::Method( SAL_UNUSED_PARAMETER Class*, ArgType ArgName )
+
+#define LINK( Inst, Class, Member ) \
+ Link( (Class*)Inst, (PSTUB)&Class::LinkStub##Member )
+
+#define STATIC_LINK( Inst, Class, Member ) \
+ Link( (Class*)Inst, (PSTUB)&Class::Member )
+
+#define IMPL_LINK( Class, Method, ArgType, ArgName ) \
+ IMPL_STUB( Class, Method, ArgType ) \
+ long Class::Method( ArgType ArgName )
+
+#define IMPL_LINK_NOARG( Class, Method ) \
+ IMPL_STUB( Class, Method, void* ) \
+ long Class::Method( SAL_UNUSED_PARAMETER void* )
+
+#define IMPL_LINK_INLINE_START( Class, Method, ArgType, ArgName ) \
+ inline long Class::Method( ArgType ArgName )
+
+#define IMPL_LINK_INLINE_END( Class, Method, ArgType, ArgName ) \
+ IMPL_STUB( Class, Method, ArgType )
+
+#define IMPL_LINK_NOARG_INLINE_START( Class, Method ) \
+ inline long Class::Method( SAL_UNUSED_PARAMETER void* )
+
+#define IMPL_LINK_NOARG_INLINE_END( Class, Method ) \
+ IMPL_STUB( Class, Method, void* )
+
+#define IMPL_LINK_INLINE( Class, Method, ArgType, ArgName, Body ) \
+ long Class::Method( ArgType ArgName ) \
+ Body \
+ IMPL_STUB( Class, Method, ArgType )
+
+#define EMPTYARG
+
+class TOOLS_DLLPUBLIC Link
+{
+ void* pInst;
+ PSTUB pFunc;
+
+public:
+ Link();
+ Link( void* pLinkHdl, PSTUB pMemFunc );
+
+ long Call( void* pCaller ) const;
+
+ sal_Bool IsSet() const;
+ sal_Bool operator !() const;
+
+ sal_Bool operator==( const Link& rLink ) const;
+ sal_Bool operator!=( const Link& rLink ) const
+ { return !(Link::operator==( rLink )); }
+ sal_Bool operator<( const Link& rLink ) const
+ { return ((sal_uIntPtr)rLink.pFunc < (sal_uIntPtr)pFunc); }
+};
+
+inline Link::Link()
+{
+ pInst = 0;
+ pFunc = 0;
+}
+
+inline Link::Link( void* pLinkHdl, PSTUB pMemFunc )
+{
+ pInst = pLinkHdl;
+ pFunc = pMemFunc;
+}
+
+inline long Link::Call(void *pCaller) const
+{
+ return pFunc ? (*pFunc)(pInst, pCaller) : 0;
+}
+
+inline sal_Bool Link::IsSet() const
+{
+ if ( pFunc )
+ return sal_True;
+ else
+ return sal_False;
+}
+
+inline sal_Bool Link::operator !() const
+{
+ if ( !pFunc )
+ return sal_True;
+ else
+ return sal_False;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/mapunit.hxx b/include/tools/mapunit.hxx
new file mode 100644
index 000000000000..55d68911b957
--- /dev/null
+++ b/include/tools/mapunit.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 _TOOLS_MAPUNIT_HXX
+#define _TOOLS_MAPUNIT_HXX
+
+enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM,
+ MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH,
+ MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT,
+ MAP_RELATIVE, MAP_REALAPPFONT, MAP_LASTENUMDUMMY };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/mempool.hxx b/include/tools/mempool.hxx
new file mode 100644
index 000000000000..3fa27ff50773
--- /dev/null
+++ b/include/tools/mempool.hxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SVMEMPOOL_HXX
+#define _SVMEMPOOL_HXX
+
+#include "sal/config.h"
+
+#include "sal/macros.h"
+#include "tools/toolsdllapi.h"
+#include "tools/solar.h"
+
+struct FixedMemPool_Impl;
+
+class TOOLS_DLLPUBLIC FixedMemPool
+{
+ FixedMemPool_Impl * m_pImpl;
+ char const * m_pTypeName;
+
+public:
+ FixedMemPool( char const * pTypeName,
+ sal_uInt16 nTypeSize );
+ ~FixedMemPool();
+
+ void* Alloc();
+ void Free( void* p );
+};
+
+#define DECL_FIXEDMEMPOOL_NEW_DECL() \
+static void * operator new( size_t n )
+
+#define DECL_FIXEDMEMPOOL_NEW_IMPL( Class ) \
+void * Class::operator new( size_t n )
+
+#define IMPL_FIXEDMEMPOOL_NEW_BODY( Class, aPool ) \
+{ \
+ if ( n == sizeof( Class ) ) \
+ return (aPool).Alloc(); \
+ else \
+ return ::operator new(n); \
+}
+
+#define DECL_FIXEDMEMPOOL_NEW_INLINE( Class, aPool ) \
+DECL_FIXEDMEMPOOL_NEW_DECL() \
+IMPL_FIXEDMEMPOOL_NEW_BODY( Class, aPool )
+
+#define DECL_FIXEDMEMPOOL_DEL_DECL() \
+static void operator delete( void * p, size_t n )
+
+#define DECL_FIXEDMEMPOOL_DEL_IMPL( Class ) \
+void Class::operator delete( void * p, size_t n )
+
+#define IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool ) \
+{ \
+ if ( n == sizeof( Class ) ) \
+ (aPool).Free(p); \
+ else \
+ ::operator delete(p); \
+}
+
+#define DECL_FIXEDMEMPOOL_DEL_INLINE( Class, aPool ) \
+DECL_FIXEDMEMPOOL_DEL_DECL() \
+IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool )
+
+#define DECL_FIXEDMEMPOOL_NEWDEL( Class ) \
+ private: \
+ static FixedMemPool aPool; \
+ public: \
+ DECL_FIXEDMEMPOOL_NEW_INLINE( Class, aPool ) \
+ DECL_FIXEDMEMPOOL_DEL_INLINE( Class, aPool )
+
+#define IMPL_FIXEDMEMPOOL_NEWDEL( Class ) \
+ FixedMemPool Class::aPool( SAL_STRINGIFY( Class ), sizeof( Class ) );
+
+#define DECL_FIXEDMEMPOOL_NEWDEL_DLL( Class ) \
+ private: \
+ static FixedMemPool aPool; \
+ public: \
+ DECL_FIXEDMEMPOOL_NEW_DECL(); \
+ DECL_FIXEDMEMPOOL_DEL_DECL();
+
+#define IMPL_FIXEDMEMPOOL_NEWDEL_DLL( Class ) \
+ FixedMemPool Class::aPool( SAL_STRINGIFY( Class ), sizeof( Class ) ); \
+ DECL_FIXEDMEMPOOL_NEW_IMPL( Class ) \
+ IMPL_FIXEDMEMPOOL_NEW_BODY( Class, aPool ) \
+ DECL_FIXEDMEMPOOL_DEL_IMPL( Class ) \
+ IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool )
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/multisel.hxx b/include/tools/multisel.hxx
new file mode 100644
index 000000000000..678fc94a998a
--- /dev/null
+++ b/include/tools/multisel.hxx
@@ -0,0 +1,186 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _SV_MULTISEL_HXX
+#define _SV_MULTISEL_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/gen.hxx>
+#include <rtl/ustring.hxx>
+
+#include <vector>
+#include <set>
+
+typedef ::std::vector< Range* > ImpSelList;
+
+#define SFX_ENDOFSELECTION ULONG_MAX
+
+class TOOLS_DLLPUBLIC MultiSelection
+{
+private:
+ ImpSelList aSels; // array of SV-selections
+ Range aTotRange; // total range of indexes
+ sal_uIntPtr nCurSubSel; // index in aSels of current selected index
+ long nCurIndex; // current selected entry
+ sal_uIntPtr nSelCount; // number of selected indexes
+ sal_Bool bInverseCur;// inverse cursor
+ sal_Bool bCurValid; // are nCurIndex and nCurSubSel valid
+ sal_Bool bSelectNew; // auto-select newly inserted indexes
+
+#ifdef _SV_MULTISEL_CXX
+ TOOLS_DLLPRIVATE void ImplClear();
+ TOOLS_DLLPRIVATE size_t ImplFindSubSelection( long nIndex ) const;
+ TOOLS_DLLPRIVATE sal_Bool ImplMergeSubSelections( size_t nPos1, size_t nPos2 );
+ TOOLS_DLLPRIVATE long ImplFwdUnselected();
+#endif
+
+public:
+ MultiSelection();
+ MultiSelection( const MultiSelection& rOrig );
+ MultiSelection( const Range& rRange );
+ ~MultiSelection();
+
+ MultiSelection& operator= ( const MultiSelection& rOrig );
+ sal_Bool operator== ( MultiSelection& rOrig );
+ sal_Bool operator!= ( MultiSelection& rOrig )
+ { return !operator==( rOrig ); }
+ sal_Bool operator !() const
+ { return nSelCount == 0; }
+
+ void SelectAll( sal_Bool bSelect = sal_True );
+ sal_Bool Select( long nIndex, sal_Bool bSelect = sal_True );
+ void Select( const Range& rIndexRange, sal_Bool bSelect = sal_True );
+ sal_Bool IsSelected( long nIndex ) const;
+ sal_Bool IsAllSelected() const
+ { return nSelCount == sal_uIntPtr(aTotRange.Len()); }
+ long GetSelectCount() const { return nSelCount; }
+
+ void SetTotalRange( const Range& rTotRange );
+ void Insert( long nIndex, long nCount = 1 );
+ void Remove( long nIndex );
+
+ const Range& GetTotalRange() const { return aTotRange; }
+ sal_Bool IsCurValid() const { return bCurValid; }
+ long GetCurSelected() const { return nCurIndex; }
+ long FirstSelected( sal_Bool bInverse = sal_False );
+ long LastSelected();
+ long NextSelected();
+
+ size_t GetRangeCount() const { return aSels.size(); }
+ const Range& GetRange( size_t nRange ) const {
+ return *(const Range*)aSels[nRange];
+ }
+};
+
+class TOOLS_DLLPUBLIC StringRangeEnumerator
+{
+ struct Range
+ {
+ sal_Int32 nFirst;
+ sal_Int32 nLast;
+
+ Range() : nFirst( -1 ), nLast( -1 ) {}
+ Range( sal_Int32 i_nFirst, sal_Int32 i_nLast ) : nFirst( i_nFirst ), nLast( i_nLast ) {}
+ };
+ std::vector< StringRangeEnumerator::Range > maSequence;
+ sal_Int32 mnCount;
+ sal_Int32 mnMin;
+ sal_Int32 mnMax;
+ sal_Int32 mnOffset;
+ bool mbValidInput;
+
+ bool setRange( const OUString& i_rNewRange, bool i_bStrict = false );
+ bool insertRange( sal_Int32 nFirst, sal_Int32 nLast, bool bSequence, bool bMayAdjust );
+ bool insertJoinedRanges( const std::vector< sal_Int32 >& rNumbers, bool i_bStrict );
+ bool checkValue( sal_Int32, const std::set< sal_Int32 >* i_pPossibleValues = NULL ) const;
+public:
+ class TOOLS_DLLPUBLIC Iterator
+ {
+ const StringRangeEnumerator* pEnumerator;
+ const std::set< sal_Int32 >* pPossibleValues;
+ sal_Int32 nRangeIndex;
+ sal_Int32 nCurrent;
+
+ friend class StringRangeEnumerator;
+ Iterator( const StringRangeEnumerator* i_pEnum,
+ const std::set< sal_Int32 >* i_pPossibleValues,
+ sal_Int32 i_nRange,
+ sal_Int32 i_nCurrent )
+ : pEnumerator( i_pEnum ), pPossibleValues( i_pPossibleValues )
+ , nRangeIndex( i_nRange ), nCurrent( i_nCurrent ) {}
+
+ public:
+ Iterator() : pEnumerator( NULL ), pPossibleValues( NULL ), nRangeIndex( -1 ), nCurrent( -1 ) {}
+ Iterator& operator++();
+ sal_Int32 operator*() const;
+ bool operator==(const Iterator&) const;
+ bool operator!=(const Iterator& i_rComp) const
+ { return ! (*this == i_rComp); }
+ };
+
+ friend class StringRangeEnumerator::Iterator;
+
+ StringRangeEnumerator( const OUString& i_rInput,
+ sal_Int32 i_nMinNumber,
+ sal_Int32 i_nMaxNumber,
+ sal_Int32 i_nLogicalOffset = -1
+ );
+
+ sal_Int32 size() const { return mnCount; }
+ Iterator begin( const std::set< sal_Int32 >* i_pPossibleValues = NULL ) const;
+ Iterator end( const std::set< sal_Int32 >* i_pPossibleValues = NULL ) const;
+
+ bool isValidInput() const { return mbValidInput; }
+ bool hasValue( sal_Int32 nValue, const std::set< sal_Int32 >* i_pPossibleValues = NULL ) const;
+
+ /**
+ i_rPageRange: the string to be changed into a sequence of numbers
+ valid format example "5-3,9,9,7-8" ; instead of ',' ';' or ' ' are allowed as well
+ o_rPageVector: the output sequence of numbers
+ i_nLogicalOffset: an offset to be applied to each number in the string before inserting it in the resulting sequence
+ example: a user enters page numbers from 1 to n (since that is logical)
+ of course usable page numbers in code would start from 0 and end at n-1
+ so the logical offset would be -1
+ i_nMinNumber: the minimum allowed number
+ i_nMaxNumber: the maximum allowed number
+
+ @returns: true if the input string was valid, o_rPageVector will contain the resulting sequence
+ false if the input string was invalid, o_rPageVector will contain
+ the sequence that parser is able to extract
+
+ behavior:
+ - only non-negative sequence numbers are allowed
+ - only non-negative values in the input string are allowed
+ - the string "-3" means the sequence i_nMinNumber to 3
+ - the string "3-" means the sequence 3 to i_nMaxNumber
+ - the string "-" means the sequence i_nMinNumber to i_nMaxNumber
+ - single number that doesn't fit in [i_nMinNumber,i_nMaxNumber] will be ignored
+ - range that doesn't fit in [i_nMinNumber,i_nMaxNumber] will be adjusted
+ */
+ static bool getRangesFromString( const OUString& i_rPageRange,
+ std::vector< sal_Int32 >& o_rPageVector,
+ sal_Int32 i_nMinNumber,
+ sal_Int32 i_nMaxNumber,
+ sal_Int32 i_nLogicalOffset = -1,
+ std::set< sal_Int32 >* i_pPossibleValues = NULL
+ );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/pathutils.hxx b/include/tools/pathutils.hxx
new file mode 100644
index 000000000000..2153db7c7c3f
--- /dev/null
+++ b/include/tools/pathutils.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_TOOLS_PATHUTILS_HXX
+#define INCLUDED_TOOLS_PATHUTILS_HXX
+
+#include "sal/config.h"
+
+#if defined WNT
+#include <cstddef>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+// The compiled code is not part of the tl dynamic library, but is delivered as
+// pathutils-obj and pathutils-slo objects (it is linked into special
+// executables and dynamic libraries that do not link against OOo libraries):
+namespace tools {
+
+/** Determine the filename part of a path.
+ @param path
+ A non-NULL pointer to a null-terminated path.
+ @return
+ A pointer to the trailing filename part of the given path.
+*/
+WCHAR * filename(WCHAR * path);
+
+/** Concatenate two paths.
+
+ Either the first path is empty and the second path is an absolute path. Or
+ the first path is an absolute path that ends in a backslash and the second
+ path is a relative path. In the latter case, to avoid paths that grow too
+ long, leading .. segments of the second path are removed together with
+ trailing segments from the first path. This should not cause problems as long
+ as there are no symbolic links on Windows (as with symbolic links, x\y\.. and
+ x might denote different directories).
+
+ @param path
+ An output paremeter taking the resulting path; must point at a valid
+ range of memory of size at least MAX_PATH. If NULL is returned, the
+ content is unspecified.
+ @param frontBegin, frontEnd
+ Forms a valid range [frontBegin .. frontEnd) of less than MAX_PATH size.
+ @param backBegin, backLength
+ Forms a valid range [backBeghin .. backBegin + backLength) of less than
+ MAX_PATH size.
+ @return
+ A pointer to the terminating null character of the concatenation, or NULL
+ if a failure occurred.
+*/
+WCHAR * buildPath(
+ WCHAR * path, WCHAR const * frontBegin, WCHAR const * frontEnd,
+ WCHAR const * backBegin, std::size_t backLength);
+
+/** Resolve a link file.
+
+ @param path
+ An input/output parameter taking the path; must point at a valid range of
+ memory of size at least MAX_PATH. On input, contains the null-terminated
+ full path of the link file. On output, contains the null-terminated full
+ path of the resolved link; if NULL is returned, the content is unspecified.
+ @return
+ A pointer to the terminating null character of path, or NULL if a failure
+ occurred.
+*/
+WCHAR * resolveLink(WCHAR * path);
+
+}
+
+#endif
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx
new file mode 100644
index 000000000000..980840f66008
--- /dev/null
+++ b/include/tools/poly.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 _TL_POLY_HXX
+#define _TL_POLY_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/gen.hxx>
+#include <tools/debug.hxx>
+
+#include <vector>
+
+#define POLY_APPEND (0xFFFF)
+#define POLYPOLY_APPEND (0xFFFF)
+
+#define POLY_OPTIMIZE_NONE 0x00000000UL
+#define POLY_OPTIMIZE_OPEN 0x00000001UL
+#define POLY_OPTIMIZE_CLOSE 0x00000002UL
+#define POLY_OPTIMIZE_NO_SAME 0x00000004UL
+#define POLY_OPTIMIZE_REDUCE 0x00000008UL
+#define POLY_OPTIMIZE_EDGES 0x00000010UL
+
+enum PolyStyle
+{
+ POLY_ARC = 1,
+ POLY_PIE = 2,
+ POLY_CHORD = 3
+};
+
+#ifndef ENUM_POLYFLAGS_DECLARED
+#define ENUM_POLYFLAGS_DECLARED
+enum PolyFlags
+{
+ POLY_NORMAL,
+ POLY_SMOOTH,
+ POLY_CONTROL,
+ POLY_SYMMTR
+};
+#endif
+
+class SAL_WARN_UNUSED PolyOptimizeData
+{
+private:
+
+ enum DataType { DATA_NONE = 0, DATA_ABSOLUT = 1, DATA_PERCENT = 2 };
+ DataType eType;
+ union { sal_uIntPtr mnAbsolut; sal_uInt16 mnPercent; };
+
+public:
+ PolyOptimizeData() : eType( DATA_NONE ) {}
+ PolyOptimizeData( sal_uIntPtr nAbsolut ) : eType( DATA_ABSOLUT ), mnAbsolut( nAbsolut ) {}
+ PolyOptimizeData( sal_uInt16 nPercent ) : eType( DATA_PERCENT ), mnPercent( nPercent ) {}
+
+ sal_uIntPtr GetAbsValue() const { (void) eType; DBG_ASSERT( eType == DATA_ABSOLUT, "Wrong data type" ); return mnAbsolut; }
+ sal_uInt16 GetPercentValue() const { (void) eType; DBG_ASSERT( eType == DATA_PERCENT, "Wrong data type" ); return mnPercent; }
+};
+
+class SvStream;
+class ImplPolygon;
+class ImplPolyPolygon;
+class PolyPolygon;
+
+namespace basegfx
+{
+ class B2DPolygon;
+ class B2DPolyPolygon;
+}
+
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Polygon
+{
+private:
+ ImplPolygon* mpImplPolygon;
+
+ TOOLS_DLLPRIVATE inline void ImplMakeUnique();
+
+public:
+ static void ImplReduceEdges( Polygon& rPoly, const double& rArea, sal_uInt16 nPercent );
+ void ImplRead( SvStream& rIStream );
+ void ImplWrite( SvStream& rOStream ) const;
+
+public:
+ Polygon();
+ Polygon( sal_uInt16 nSize );
+ Polygon( sal_uInt16 nPoints, const Point* pPtAry,
+ const sal_uInt8* pFlagAry = NULL );
+ Polygon( const Rectangle& rRect );
+ Polygon( const Rectangle& rRect,
+ sal_uIntPtr nHorzRound, sal_uIntPtr nVertRound );
+ Polygon( const Point& rCenter,
+ long nRadX, long nRadY,
+ sal_uInt16 nPoints = 0 );
+ Polygon( const Rectangle& rBound,
+ const Point& rStart, const Point& rEnd,
+ PolyStyle ePolyStyle = POLY_ARC,
+ sal_Bool bWholeCircle = sal_False );
+ Polygon( const Point& rBezPt1, const Point& rCtrlPt1,
+ const Point& rBezPt2, const Point& rCtrlPt2,
+ sal_uInt16 nPoints = 0 );
+
+ Polygon( const Polygon& rPoly );
+ ~Polygon();
+
+ void SetPoint( const Point& rPt, sal_uInt16 nPos );
+ const Point& GetPoint( sal_uInt16 nPos ) const;
+
+ void SetFlags( sal_uInt16 nPos, PolyFlags eFlags );
+ PolyFlags GetFlags( sal_uInt16 nPos ) const;
+ sal_Bool HasFlags() const;
+
+ sal_Bool IsRect() const;
+
+ void SetSize( sal_uInt16 nNewSize );
+ sal_uInt16 GetSize() const;
+
+ void Clear();
+
+ Rectangle GetBoundRect() const;
+ double GetSignedArea() const;
+ sal_Bool IsInside( const Point& rPt ) const;
+ sal_Bool IsRightOrientated() const;
+ double CalcDistance( sal_uInt16 nPt1, sal_uInt16 nPt2 );
+ void Clip( const Rectangle& rRect, sal_Bool bPolygon = sal_True );
+ void Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData = NULL );
+
+ /** Adaptive subdivision of polygons with curves
+
+ This method adaptively subdivides bezier arcs within the
+ polygon to straight line segments and returns the resulting
+ polygon.
+
+ @param rResult
+ The resulting subdivided polygon
+
+ @param d
+ This parameter controls the amount of subdivision. The
+ original curve is guaranteed to not differ by more than this
+ amount per bezier segment from the subdivided
+ lines. Concretely, if the polygon is in device coordinates and
+ d equals 1.0, then the difference between the subdivided and
+ the original polygon is guaranteed to be smaller than one
+ pixel.
+ */
+ void AdaptiveSubdivide( Polygon& rResult, const double d = 1.0 ) const;
+
+ void Move( long nHorzMove, long nVertMove );
+ void Translate( const Point& rTrans );
+ void Scale( double fScaleX, double fScaleY );
+ void Rotate( const Point& rCenter, double fSin, double fCos );
+ void Rotate( const Point& rCenter, sal_uInt16 nAngle10 );
+
+ void Insert( sal_uInt16 nPos, const Point& rPt, PolyFlags eFlags = POLY_NORMAL );
+ void Insert( sal_uInt16 nPos, const Polygon& rPoly );
+
+ const Point& operator[]( sal_uInt16 nPos ) const { return GetPoint( nPos ); }
+ Point& operator[]( sal_uInt16 nPos );
+
+ Polygon& operator=( const Polygon& rPoly );
+ sal_Bool operator==( const Polygon& rPoly ) const;
+ sal_Bool operator!=( const Polygon& rPoly ) const
+ { return !(Polygon::operator==( rPoly )); }
+ sal_Bool IsEqual( const Polygon& rPoly ) const;
+
+ // streaming a Polygon does ignore PolyFlags, so use the Write Or Read
+ // method to take care of PolyFlags
+ TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Polygon& rPoly );
+ TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Polygon& rPoly );
+
+ void Read( SvStream& rIStream );
+ void Write( SvStream& rOStream ) const;
+
+ const Point* GetConstPointAry() const;
+ const sal_uInt8* GetConstFlagAry() const;
+
+ // convert to ::basegfx::B2DPolygon and return
+ ::basegfx::B2DPolygon getB2DPolygon() const;
+
+ // constructor to convert from ::basegfx::B2DPolygon
+ // #i76339# made explicit
+ explicit Polygon(const ::basegfx::B2DPolygon& rPolygon);
+};
+
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED PolyPolygon
+{
+private:
+ ImplPolyPolygon* mpImplPolyPolygon;
+
+ TOOLS_DLLPRIVATE void ImplDoOperation( const PolyPolygon& rPolyPoly, PolyPolygon& rResult, sal_uIntPtr nOperation ) const;
+ TOOLS_DLLPRIVATE void *ImplCreateArtVpath() const;
+ TOOLS_DLLPRIVATE void ImplSetFromArtVpath( void *pVpath );
+
+public:
+ PolyPolygon( sal_uInt16 nInitSize = 16, sal_uInt16 nResize = 16 );
+ PolyPolygon( const Polygon& rPoly );
+ PolyPolygon( sal_uInt16 nPoly, const sal_uInt16* pPointCountAry,
+ const Point* pPtAry );
+ PolyPolygon( const PolyPolygon& rPolyPoly );
+ ~PolyPolygon();
+
+ void Insert( const Polygon& rPoly, sal_uInt16 nPos = POLYPOLY_APPEND );
+ void Remove( sal_uInt16 nPos );
+ void Replace( const Polygon& rPoly, sal_uInt16 nPos );
+ const Polygon& GetObject( sal_uInt16 nPos ) const;
+
+ sal_Bool IsRect() const;
+
+ void Clear();
+
+ sal_uInt16 Count() const;
+ Rectangle GetBoundRect() const;
+ void Clip( const Rectangle& rRect );
+ void Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData = NULL );
+
+ /** Adaptive subdivision of polygons with curves
+
+ This method adaptively subdivides bezier arcs within the
+ polygon to straight line segments and returns the resulting
+ polygon.
+
+ @param rResult
+ The resulting subdivided polygon
+
+ @param d
+ This parameter controls the amount of subdivision. The
+ original curve is guaranteed to not differ by more than this
+ amount per bezier segment from the subdivided
+ lines. Concretely, if the polygon is in device coordinates and
+ d equals 1.0, then the difference between the subdivided and
+ the original polygon is guaranteed to be smaller than one
+ pixel.
+ */
+ void AdaptiveSubdivide( PolyPolygon& rResult, const double d = 1.0 ) const;
+
+ void GetIntersection( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const;
+ void GetUnion( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const;
+
+ void Move( long nHorzMove, long nVertMove );
+ void Translate( const Point& rTrans );
+ void Scale( double fScaleX, double fScaleY );
+ void Rotate( const Point& rCenter, double fSin, double fCos );
+ void Rotate( const Point& rCenter, sal_uInt16 nAngle10 );
+
+ const Polygon& operator[]( sal_uInt16 nPos ) const { return GetObject( nPos ); }
+ Polygon& operator[]( sal_uInt16 nPos );
+
+ PolyPolygon& operator=( const PolyPolygon& rPolyPoly );
+ sal_Bool operator==( const PolyPolygon& rPolyPoly ) const;
+ sal_Bool operator!=( const PolyPolygon& rPolyPoly ) const
+ { return !(PolyPolygon::operator==( rPolyPoly )); }
+
+ sal_Bool IsEqual( const PolyPolygon& rPolyPoly ) const;
+
+ TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, PolyPolygon& rPolyPoly );
+ TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const PolyPolygon& rPolyPoly );
+
+ void Read( SvStream& rIStream );
+ void Write( SvStream& rOStream ) const;
+
+ // convert to ::basegfx::B2DPolyPolygon and return
+ ::basegfx::B2DPolyPolygon getB2DPolyPolygon() const;
+
+ // constructor to convert from ::basegfx::B2DPolyPolygon
+ // #i76339# made explicit
+ explicit PolyPolygon(const ::basegfx::B2DPolyPolygon& rPolyPolygon);
+};
+
+typedef std::vector< PolyPolygon > PolyPolyVector;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/postsys.h b/include/tools/postsys.h
new file mode 100644
index 000000000000..3c3431e50b8d
--- /dev/null
+++ b/include/tools/postsys.h
@@ -0,0 +1,234 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+/* not protected, must be included together with prestl.h! */
+
+#if defined WNT
+
+#undef Region
+#undef PolyPolygon
+#undef Polygon
+#undef Rectangle
+#undef DELETE
+
+/* rename help IDs */
+#define WIN_HELP_INDEX 0x0003
+#define WIN_HELP_HELPONHELP 0x0004
+#undef HELP_INDEX
+#undef HELP_HELPONHELP
+
+#define WIN_MOUSE_MOVED 0x0001
+#undef MOUSE_MOVED
+
+#define WIN_WB_LEFT 0
+#define WIN_WB_RIGHT 1
+#undef WB_LEFT
+#undef WB_RIGHT
+
+#ifdef GetObject
+#undef GetObject
+#ifdef UNICODE
+#define WIN_GetObject GetObjectW
+#else
+#define WIN_GetObject GetObjectA
+#endif
+#else
+#define WIN_GetObject GetObject
+#endif
+
+#ifdef SetPrinter
+#undef SetPrinter
+#ifdef UNICODE
+#define WIN_SetPrinter SetPrinterW
+#else
+#define WIN_SetPrinter SetPrinterA
+#endif
+#else
+#define WIN_SetPrinter SetPrinter
+#endif
+
+#ifdef GetPrinter
+#undef GetPrinter
+#ifdef UNICODE
+#define WIN_GetPrinter GetPrinterW
+#else
+#define WIN_GetPrinter GetPrinterA
+#endif
+#else
+#define WIN_GetPrinter GetPrinter
+#endif
+
+#ifdef DrawText
+#undef DrawText
+#ifdef UNICODE
+#define WIN_DrawText DrawTextW
+#else
+#define WIN_DrawText DrawTextA
+#endif
+#else
+#define WIN_DrawText DrawText
+#endif
+
+#ifdef mciSetCommand
+#undef mciSetCommand
+#ifdef UNICODE
+#define WIN_mciSetCommand mciSetCommandW
+#else
+#define WIN_mciSetCommand mciSetCommandA
+#endif
+#else
+#define mciSetCommand mciSetCommand
+#endif
+
+#ifdef SetPort
+#undef SetPort
+#ifdef UNICODE
+#define WIN_SetPort SetPortW
+#else
+#define WIN_SetPort SetPortA
+#endif
+#else
+#define WIN_SetPort SetPort
+#endif
+
+#ifdef CopyFile
+#undef CopyFile
+#ifdef UNICODE
+#define WIN_CopyFile CopyFileW
+#else
+#define WIN_CopyFile CopyFileA
+#endif
+#else
+#define WIN_CopyFile CopyFile
+#endif
+
+#ifdef GetUserName
+#undef GetUserName
+#ifdef UNICODE
+#define WIN_GetUserName GetUserNameW
+#else
+#define WIN_GetUserName GetUserNameA
+#endif
+#else
+#define WIN_GetUserName GetUserName
+#endif
+
+#ifdef GetClassName
+#undef GetClassName
+#ifdef UNICODE
+#define WIN_GetClassName GetClassNameW
+#else
+#define WIN_GetClassName GetClassNameA
+#endif
+#else
+#define WIN_GetClassName GetClassName
+#endif
+
+#ifdef GetCharWidth
+#undef GetCharWidth
+#ifdef UNICODE
+#define WIN_GetCharWidth GetCharWidthW
+#else
+#define WIN_GetCharWidth GetCharWidthA
+#endif
+#else
+#define WIN_GetCharWidth GetCharWidth
+#endif
+
+#ifdef GetMetaFile
+#undef GetMetaFile
+#ifdef UNICODE
+#define WIN_GetMetaFile GetMetaFileW
+#else
+#define WIN_GetMetaFile GetMetaFileA
+#endif
+#else
+#define WIN_GetMetaFile GetMetaFile
+#endif
+
+#ifdef GetNumberFormat
+#undef GetNumberFormat
+#ifdef UNICODE
+#define WIN_GetNumberFormat GetNumberFormatW
+#else
+#define WIN_GetNumberFormat GetNumberFormatA
+#endif
+#else
+#define WIN_GetNumberFormat GetNumberFormat
+#endif
+
+#ifdef GetGlyphOutline
+#undef GetGlyphOutline
+#ifdef UNICODE
+#define WIN_GetGlyphOutline GetGlyphOutlineW
+#else
+#define WIN_GetGlyphOutline GetGlyphOutlineA
+#endif
+#else
+#define WIN_GetGlyphOutline GetGlyphOutline
+#endif
+
+#ifdef GetKerningPairs
+#undef GetKerningPairs
+#ifdef UNICODE
+#define WIN_GetKerningPairs GetKerningPairsW
+#else
+#define WIN_GetKerningPairs GetKerningPairsA
+#endif
+#else
+#define WIN_GetKerningPairs GetKerningPairs
+#endif
+
+#ifdef FindWindow
+#undef FindWindow
+#ifdef UNICODE
+#define WIN_FindWindow FindWindowW
+#else
+#define WIN_FindWindow FindWindowA
+#endif
+#else
+#define WIN_FindWindow FindWindow
+#endif
+
+#undef Yield
+
+/* new StretchBlt() Modes (simpler names) */
+#ifndef STRETCH_ANDSCANS
+#define STRETCH_ANDSCANS 1
+#endif
+#ifndef STRETCH_ORSCANS
+#define STRETCH_ORSCANS 2
+#endif
+#ifndef STRETCH_DELETESCANS
+#define STRETCH_DELETESCANS 3
+#endif
+
+extern "C"
+{
+ BOOL WINAPI WIN_Rectangle( HDC hDC, int X1, int Y1, int X2, int Y2 );
+ BOOL WINAPI WIN_Polygon( HDC hDC, CONST POINT * ppt, int ncnt );
+ BOOL WINAPI WIN_PolyPolygon( HDC hDC, CONST POINT * ppt, LPINT npcnt, int ncnt );
+}
+
+#endif
+
+// avoid conflict with Pair in tools
+#undef Pair
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/presys.h b/include/tools/presys.h
new file mode 100644
index 000000000000..521768685aa9
--- /dev/null
+++ b/include/tools/presys.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+/* not protected, do only include once! */
+
+// avoid conflict with pair in tools
+#define Pair StlPair
+
+#if defined WNT
+
+#define Rectangle BLA_Rectangle
+#define Polygon BLA_Polygon
+#define PolyPolygon BLA_PolyPolygon
+#define Region WIN_Region
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/pstm.hxx b/include/tools/pstm.hxx
new file mode 100644
index 000000000000..6f971ca7014a
--- /dev/null
+++ b/include/tools/pstm.hxx
@@ -0,0 +1,245 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _PSTM_HXX
+#define _PSTM_HXX
+
+#include <boost/unordered_map.hpp>
+#include "tools/toolsdllapi.h"
+#include <tools/unqidx.hxx>
+#include <tools/ref.hxx>
+#include <tools/rtti.hxx>
+#include <tools/stream.hxx>
+#include <map>
+
+#define ERRCODE_IO_NOFACTORY ERRCODE_IO_WRONGFORMAT
+
+class SvPersistBase;
+
+typedef void * (*SvCreateInstancePersist)( SvPersistBase ** );
+
+#define SV_CLASS_REGISTER( Class ) \
+ Register( Class::StaticClassId(), Class::CreateInstance )
+
+class TOOLS_DLLPUBLIC SvClassManager
+{
+ typedef boost::unordered_map<sal_Int32, SvCreateInstancePersist> Map;
+ Map aAssocTable;
+
+public:
+ void Register( sal_Int32 nClassId, SvCreateInstancePersist pFunc );
+ SvCreateInstancePersist Get( sal_Int32 nClassId );
+};
+
+class TOOLS_DLLPUBLIC SvRttiBase : public SvRefBase
+{
+public:
+ TYPEINFO();
+};
+SV_DECL_IMPL_REF(SvRttiBase)
+
+#define SV_DECL_PERSIST( Class, CLASS_ID ) \
+ TYPEINFO(); \
+ static sal_Int32 StaticClassId() { return CLASS_ID; } \
+ static void * CreateInstance( SvPersistBase ** ppBase ); \
+ friend SvPersistStream& operator >> ( SvPersistStream & rStm, \
+ Class *& rpObj); \
+ virtual sal_Int32 GetClassId() const; \
+ virtual void Load( SvPersistStream & ); \
+ virtual void Save( SvPersistStream & );
+
+#define SV_DECL_PERSIST1( Class, Super1, CLASS_ID ) \
+ SV_DECL_PERSIST( Class, CLASS_ID )
+
+#define PRV_SV_IMPL_PERSIST( Class ) \
+ void * Class::CreateInstance( SvPersistBase ** ppBase )\
+ { \
+ Class * p = new Class(); \
+ *ppBase = p; \
+ return p; \
+ } \
+ sal_Int32 Class::GetClassId() const \
+ { return StaticClassId(); } \
+ SvPersistStream& operator >> (SvPersistStream & rStm, Class *& rpObj)\
+ { \
+ SvPersistBase * pObj; \
+ rStm >> pObj; \
+ rpObj = PTR_CAST( Class, pObj ); \
+ return rStm; \
+ }
+
+#define SV_IMPL_PERSIST1( Class, Super1 ) \
+ TYPEINIT1( Class, Super1 ) \
+ PRV_SV_IMPL_PERSIST( Class )
+
+class SvPersistStream;
+
+class SvPersistBase : public SvRttiBase
+{
+public:
+ virtual sal_Int32 GetClassId() const = 0;
+ virtual void Load( SvPersistStream & ) = 0;
+ virtual void Save( SvPersistStream & ) = 0;
+ TOOLS_DLLPUBLIC friend SvPersistStream& operator >> ( SvPersistStream & rStm,
+ SvPersistBase *& rpObj );
+};
+SV_DECL_IMPL_REF(SvPersistBase)
+
+class SvPersistListWriteable
+{
+public:
+ virtual ~SvPersistListWriteable() {}
+ virtual size_t size() const = 0;
+ virtual SvPersistBase* GetPersistBase(size_t idx) const = 0;
+};
+
+class SvPersistListReadable
+{
+public:
+ virtual ~SvPersistListReadable() {}
+ virtual void push_back(SvPersistBase* p) = 0;
+};
+
+void TOOLS_DLLPUBLIC WritePersistListObjects(const SvPersistListWriteable& rList, SvPersistStream & rStm, bool bOnlyStreamed = false );
+
+void TOOLS_DLLPUBLIC ReadObjects( SvPersistListReadable& rLst, SvPersistStream & rStm);
+
+// <T> has to be a subtype of "SvPersistBase*"
+template<typename T>
+class SvDeclPersistList : public SvRefMemberList<T>,
+ public SvPersistListWriteable,
+ public SvPersistListReadable
+{
+public:
+ // implement the reader/writer adapter methods
+ size_t size() const { return SvRefMemberList<T>::size(); }
+ SvPersistBase* GetPersistBase(size_t idx) const { return SvRefMemberList<T>::operator[](idx); }
+ void push_back(SvPersistBase* p) { SvRefMemberList<T>::push_back(static_cast<T>(p)); }
+ void WriteObjects(SvPersistStream & rStm, bool bOnlyStreamed ) const { WritePersistListObjects(*this, rStm, bOnlyStreamed); }
+};
+
+template<typename T>
+SvPersistStream& operator << (SvPersistStream &rStm, const SvDeclPersistList<T> &rLst)
+{
+ WritePersistListObjects( rLst, rStm );
+ return rStm;
+};
+
+template<typename T>
+SvPersistStream& operator >> (SvPersistStream &rStm, SvDeclPersistList<T> &rLst)
+{
+ ReadObjects( rLst, rStm );
+ return rStm;
+};
+
+typedef UniqueIndex<SvPersistBase> SvPersistUIdx;
+typedef std::map<SvPersistBase*, sal_uIntPtr> PersistBaseMap;
+
+class SvStream;
+
+/** Persistent Stream
+
+ This class provides accessor to storing and loading runtime objects.
+ All dependent objects have to be stored as well.
+ In order to load objects automatically, every object class must
+ provide a Factory method to read an object from stream.
+ The list of all classes is stored in a <SvClassManager> object
+ and is sent to SvPersistStream upon initialization.
+ By using the Method SvPersistStream::WriteCompressed and
+ SvPersistStream::ReadCompressed, compressed sal_uInt32 values may be
+ written to / read from the Stream.
+ Several helper methods exists for writing and reading
+ object lengths to the stream: SvPersistStream::WriteDummyLen,
+ SvPersistStream::WriteLen and SvPersistStream::ReadLen.
+
+ [Example]
+
+ One example is described in the constructor.
+ Assume a ring-like dependency, where A referenes B,
+ B itself references C, and C references to both D and A.
+
+ The order of the objects upon saving and loading does not matter,
+ as long objects are loaded in the same order they were stored.
+
+ Saving: Loading:
+ A,B,C,D A,B,C,D correct
+ B,A,C,D B,A,C,D correct
+ C,A,B,D A,B,C,D wrong
+ A,B,C,D A,B,C wrong
+
+ @note The file formats DBG_UTIL and !DBG_UTIL differ, but we can read from
+ both versions.
+*/
+class TOOLS_DLLPUBLIC SvPersistStream : public SvStream
+{
+ SvClassManager & rClassMgr;
+ SvStream * pStm;
+ PersistBaseMap aPTable; // reversed pointer and key
+ SvPersistUIdx aPUIdx;
+ sal_uIntPtr nStartIdx;
+ const SvPersistStream * pRefStm;
+ sal_uInt32 nFlags;
+
+ virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize );
+ virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize );
+ virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos );
+ virtual void FlushData();
+
+protected:
+ void WriteObj( sal_uInt8 nHdr, SvPersistBase * pObj );
+ sal_uInt32 ReadObj( SvPersistBase * & rpObj, sal_Bool bRegister );
+
+public:
+ sal_Bool IsStreamed( SvPersistBase * pObj ) const
+ { return 0 != GetIndex( pObj ); }
+ virtual void ResetError();
+
+ SvPersistStream( SvClassManager &, SvStream * pStream,
+ sal_uInt32 nStartIdx = 1 );
+ ~SvPersistStream();
+
+ void SetStream( SvStream * pStream );
+ SvStream * GetStream() const { return pStm; }
+ virtual sal_uInt16 IsA() const;
+
+ SvPersistBase * GetObject( sal_uIntPtr nIdx ) const;
+ sal_uIntPtr GetIndex( SvPersistBase * ) const;
+
+ void SetContextFlags( sal_uInt32 n ) { nFlags = n; }
+ sal_uInt32 GetContextFlags() const { return nFlags; }
+
+ static void WriteCompressed( SvStream & rStm, sal_uInt32 nVal );
+ static sal_uInt32 ReadCompressed( SvStream & rStm );
+
+ sal_uInt32 WriteDummyLen();
+ void WriteLen( sal_uInt32 nLenPos );
+ sal_uInt32 ReadLen( sal_uInt32 * pTestPos );
+
+ SvPersistStream& WritePointer( SvPersistBase * pObj );
+ SvPersistStream& ReadPointer( SvPersistBase * & rpObj );
+ TOOLS_DLLPUBLIC friend SvPersistStream& operator << (SvPersistStream &, SvPersistBase *);
+ TOOLS_DLLPUBLIC friend SvPersistStream& operator >> (SvPersistStream &, SvPersistBase * &);
+
+ // Objects maintain their IDs while storing and loading to/from stream
+ friend SvStream& operator >> ( SvStream &, SvPersistStream & );
+ friend SvStream& operator << ( SvStream &, SvPersistStream & );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/rc.h b/include/tools/rc.h
new file mode 100644
index 000000000000..5bcd4cb7f3b7
--- /dev/null
+++ b/include/tools/rc.h
@@ -0,0 +1,216 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLS_RC_H
+#define _TOOLS_RC_H
+
+#include <tools/rcid.h>
+
+// Defines for all "Window" resources.
+// (Here are all window styles that are not in WinBits)
+#define RSC_EXTRAMAPUNIT 0xFFFF // do not change that value!
+
+typedef short RSWND_STYLE;
+
+#define RSWND_DISABLED 0x01
+#define RSWND_CLIENTSIZE 0x02
+
+#define WINDOW_XYMAPMODE 0x0001
+#define WINDOW_X 0x0002
+#define WINDOW_Y 0x0004
+#define WINDOW_WHMAPMODE 0x0008
+#define WINDOW_WIDTH 0x0010
+#define WINDOW_HEIGHT 0x0020
+#define WINDOW_TEXT 0x0080
+#define WINDOW_HELPTEXT 0x0100
+#define WINDOW_QUICKTEXT 0x0200
+#define WINDOW_EXTRALONG 0x0800
+#define WINDOW_UNIQUEID 0x1000
+#define WINDOW_BORDER_STYLE 0x2000
+#define WINDOW_HELPID 0x4000
+
+// For "WorkWindow" resources:
+#define WORKWIN_SHOWNORMAL 0
+#define WORKWIN_SHOWMINIMIZED 1
+#define WORKWIN_SHOWMAXIMIZED 2
+
+// For "FixedBitmap" resource:
+#define RSC_FIXEDBITMAP_BITMAP 0x0001
+
+// For "FixedImage" resource:
+#define RSC_FIXEDIMAGE_IMAGE 0x0001
+
+// For "MenuButton" resources:
+#define RSCMENUBUTTON_MENU 0x01
+
+// For all menu resources:
+#define RSC_MENU_ITEMS 0x01
+#define RSC_MENU_TEXT 0x02
+#define RSC_MENU_DEFAULTITEMID 0x04
+
+// "MenuItem" resource options:
+#define RSC_MENUITEM_SEPARATOR 0x001
+#define RSC_MENUITEM_ID 0x002
+#define RSC_MENUITEM_STATUS 0x004
+#define RSC_MENUITEM_TEXT 0x008
+#define RSC_MENUITEM_BITMAP 0x010
+#define RSC_MENUITEM_HELPTEXT 0x020
+#define RSC_MENUITEM_HELPID 0x040
+#define RSC_MENUITEM_KEYCODE 0x080
+#define RSC_MENUITEM_MENU 0x100
+#define RSC_MENUITEM_CHECKED 0x200
+#define RSC_MENUITEM_DISABLE 0x400
+#define RSC_MENUITEM_COMMAND 0x800
+
+// "AccelKey" resource options:
+#define ACCELITEM_ACCEL 0x01
+#define ACCELITEM_KEY 0x02
+
+// For "Field" resources:
+#define PATTERNFORMATTER_STRICTFORMAT 0x01
+#define PATTERNFORMATTER_EDITMASK 0x02
+#define PATTERNFORMATTER_LITTERALMASK 0x04
+
+#define NUMERICFORMATTER_MIN 0x01
+#define NUMERICFORMATTER_MAX 0x02
+#define NUMERICFORMATTER_STRICTFORMAT 0x04
+//#define NUMERICFORMATTER_I12 0x08 // removed (2005-06-17)
+#define NUMERICFORMATTER_DECIMALDIGITS 0x10
+#define NUMERICFORMATTER_VALUE 0x20
+#define NUMERICFORMATTER_NOTHOUSANDSEP 0x40
+
+#define METRICFORMATTER_UNIT 0x01
+#define METRICFORMATTER_CUSTOMUNITTEXT 0x02
+
+#define DATEFORMATTER_MIN 0x01
+#define DATEFORMATTER_MAX 0x02
+#define DATEFORMATTER_LONGFORMAT 0x04
+#define DATEFORMATTER_STRICTFORMAT 0x08
+//#define DATEFORMATTER_I12 0x10 // removed (2005-06-17)
+#define DATEFORMATTER_VALUE 0x20
+
+#define TIMEFORMATTER_MIN 0x01
+#define TIMEFORMATTER_MAX 0x02
+#define TIMEFORMATTER_TIMEFIELDFORMAT 0x04
+#define TIMEFORMATTER_DURATION 0x08
+#define TIMEFORMATTER_STRICTFORMAT 0x10
+//#define TIMEFORMATTER_I12 0x20 // removed (2005-06-17)
+#define TIMEFORMATTER_VALUE 0x40
+
+#define NUMERICFIELD_FIRST 0x01
+#define NUMERICFIELD_LAST 0x02
+#define NUMERICFIELD_SPINSIZE 0x04
+
+#define METRICFIELD_FIRST 0x01
+#define METRICFIELD_LAST 0x02
+#define METRICFIELD_SPINSIZE 0x04
+
+#define CURRENCYFIELD_FIRST 0x01
+#define CURRENCYFIELD_LAST 0x02
+#define CURRENCYFIELD_SPINSIZE 0x04
+
+#define DATEFIELD_FIRST 0x01
+#define DATEFIELD_LAST 0x02
+
+#define TIMEFIELD_FIRST 0x01
+#define TIMEFIELD_LAST 0x02
+
+// For "ToolBoxItem" resources:
+#define RSC_TOOLBOXITEM_ID 0x0001
+#define RSC_TOOLBOXITEM_TYPE 0x0002
+#define RSC_TOOLBOXITEM_STATUS 0x0004
+#define RSC_TOOLBOXITEM_HELPID 0x0008
+#define RSC_TOOLBOXITEM_TEXT 0x0010
+#define RSC_TOOLBOXITEM_HELPTEXT 0x0020
+#define RSC_TOOLBOXITEM_BITMAP 0x0040
+#define RSC_TOOLBOXITEM_IMAGE 0x0080
+#define RSC_TOOLBOXITEM_DISABLE 0x0100
+#define RSC_TOOLBOXITEM_STATE 0x0200
+#define RSC_TOOLBOXITEM_HIDE 0x0400
+#define RSC_TOOLBOXITEM_COMMAND 0x0800
+#define RSC_TOOLBOXITEM_MENUSTRINGS 0x1000
+
+// For "ToolBox" resources:
+#define RSC_TOOLBOX_BUTTONTYPE 0x01
+#define RSC_TOOLBOX_ALIGN 0x02
+#define RSC_TOOLBOX_LINECOUNT 0x04
+#define RSC_TOOLBOX_FLOATLINES 0x08
+#define RSC_TOOLBOX_CUSTOMIZE 0x10
+#define RSC_TOOLBOX_MENUSTRINGS 0x20
+#define RSC_TOOLBOX_ITEMIMAGELIST 0x40
+#define RSC_TOOLBOX_ITEMLIST 0x80
+
+// For "MoreButton" resources:
+#define RSC_MOREBUTTON_STATE 0x01
+#define RSC_MOREBUTTON_MAPUNIT 0x02
+#define RSC_MOREBUTTON_DELTA 0x04
+
+// For "FloatingWindow" resources:
+#define RSC_FLOATINGWINDOW_WHMAPMODE 0x01
+#define RSC_FLOATINGWINDOW_WIDTH 0x02
+#define RSC_FLOATINGWINDOW_HEIGHT 0x04
+#define RSC_FLOATINGWINDOW_ZOOMIN 0x08
+
+// For "DockingWindow" resources:
+#define RSC_DOCKINGWINDOW_XYMAPMODE 0x01
+#define RSC_DOCKINGWINDOW_X 0x02
+#define RSC_DOCKINGWINDOW_Y 0x04
+#define RSC_DOCKINGWINDOW_FLOATING 0x08
+
+// For "TabControlItem" resources:
+#define RSC_TABCONTROLITEM_ID 0x0001
+#define RSC_TABCONTROLITEM_TEXT 0x0002
+#define RSC_TABCONTROLITEM_PAGERESID 0x0008
+
+// For "TabControl" resources:
+#define RSC_TABCONTROL_ITEMLIST 0x01
+
+// For "ImageButtons":
+#define RSC_IMAGEBUTTON_IMAGE 0x01
+#define RSC_IMAGEBUTTON_SYMBOL 0x02
+#define RSC_IMAGEBUTTON_STATE 0x04
+
+// For "ImageRadioButtons":
+#define RSC_IMAGERADIOBUTTON_IMAGE 0x01
+
+// For "Image":
+#define RSC_IMAGE_IMAGEBITMAP 0x01
+#define RSC_IMAGE_MASKBITMAP 0x02
+#define RSC_IMAGE_MASKCOLOR 0x04
+
+// For "ImageList":
+#define RSC_IMAGELIST_IMAGEBITMAP 0x01
+#define RSC_IMAGELIST_MASKBITMAP 0x02
+#define RSC_IMAGELIST_MASKCOLOR 0x04
+#define RSC_IMAGELIST_IDLIST 0x08
+#define RSC_IMAGELIST_IDCOUNT 0x10
+
+// FIXME obsolete, should be removed by MM
+#define RSC_COLOR (RSC_NOTYPE + 0x16)
+#define TIME_HOUR 0x01
+#define TIME_MINUTE 0x02
+#define TIME_SECOND 0x04
+#define TIME_SEC100 0x08
+#define DATE_YEAR 0x01
+#define DATE_MONTH 0x02
+#define DATE_DAY 0x04
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/rc.hxx b/include/tools/rc.hxx
new file mode 100644
index 000000000000..a043db47d4d5
--- /dev/null
+++ b/include/tools/rc.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _TOOLS_RC_HXX
+#define _TOOLS_RC_HXX
+
+#include "tools/toolsdllapi.h"
+#include <i18nlangtag/lang.h>
+#include <tools/string.hxx>
+#include <tools/resmgr.hxx>
+
+class TOOLS_DLLPUBLIC Resource
+{
+protected:
+ ResMgr* m_pResMgr;
+
+ // check availability of Resource
+ sal_Bool IsAvailableRes( const ResId& rId ) const
+ { return m_pResMgr->IsAvailable( rId, this ); }
+
+ // Load a Resource
+ void GetRes( const ResId& rResId );
+
+ // check Resource state
+ void TestRes();
+
+ // Get a pointer to the Resource's data
+ void* GetClassRes()
+ { return m_pResMgr->GetClass(); }
+
+ // increase the memory pointer gotten by GetClassRes()
+ void* IncrementRes( sal_uInt32 nBytes )
+ { return m_pResMgr->Increment( nBytes ); }
+
+ // return the memory size of a Resource data block
+ static sal_uInt32 GetObjSizeRes( RSHEADER_TYPE * pHT )
+ { return ResMgr::GetObjSize( pHT ); }
+
+ // return the remaining size of this Resource's data
+ sal_uInt32 GetRemainSizeRes()
+ { return m_pResMgr->GetRemainSize(); }
+
+ // get a 32bit value from Resource data
+ static sal_Int32 GetLongRes( void * pLong )
+ { return ResMgr::GetLong( pLong ); }
+ // get a 16bit value from Resource data
+ static sal_Int16 GetShortRes( void * pShort )
+ { return ResMgr::GetShort( pShort ); }
+
+ // read a 32bit value from resource data and increment pointer
+ sal_Int32 ReadLongRes()
+ { return m_pResMgr->ReadLong(); }
+ // read a 16bit value from resource data and increment pointer
+ sal_Int16 ReadShortRes()
+ { return m_pResMgr->ReadShort(); }
+ // read a string from resource data and increment pointer
+ OUString ReadStringRes()
+ { return m_pResMgr->ReadString(); }
+ // read a byte string from resource data and increment pointer
+ OString ReadByteStringRes()
+ { return m_pResMgr->ReadByteString(); }
+
+ // free the resource from m_pResMgr's stack (pass this ptr for validation)
+ void FreeResource()
+ { m_pResMgr->PopContext( this ); }
+
+ // constructors
+ Resource() : m_pResMgr( NULL ) {}
+ Resource( const ResId& rResId );
+
+public:
+#ifdef DBG_UTIL
+ ~Resource() { TestRes(); }
+#else
+ ~Resource() {}
+#endif
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/rcid.h b/include/tools/rcid.h
new file mode 100644
index 000000000000..d257639a99f8
--- /dev/null
+++ b/include/tools/rcid.h
@@ -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 _TOOLS_RCID_H
+#define _TOOLS_RCID_H
+
+#include <tools/resid.hxx>
+
+// Definition of the version number
+#define RSCVERSION_ID 200U
+// Definition of an invalid identifier
+#define RC_NO_ID (sal_uInt32(0xFFFFFFFF))
+
+// Resource types
+// Minimum is 0x100 due to MS-Windows resource types
+// (RSC_NOTYPE=0x100) is defined in resid.hxx
+#define RSC_BYNAME (RSC_NOTYPE + 0x01)
+#define RSC_VERSIONCONTROL (RSC_NOTYPE + 0x02) // Version control
+
+#define RSC_RESOURCE (RSC_NOTYPE + 0x10)
+#define RSC_STRING (RSC_NOTYPE + 0x11)
+#define RSC_BITMAP (RSC_NOTYPE + 0x13)
+#define RSC_ACCEL (RSC_NOTYPE + 0x1a)
+#define RSC_ACCELITEM (RSC_NOTYPE + 0x1b) // only used internally
+#define RSC_MENU (RSC_NOTYPE + 0x1c)
+#define RSC_MENUITEM (RSC_NOTYPE + 0x1d) // only used internally
+#define RSC_KEYCODE (RSC_NOTYPE + 0x1f)
+#define RSC_TIME (RSC_NOTYPE + 0x20)
+#define RSC_DATE (RSC_NOTYPE + 0x21)
+//#define RSC_INTERNATIONAL (RSC_NOTYPE + 0x22) // removed (2005-06-17)
+#define RSC_IMAGE (RSC_NOTYPE + 0x23)
+#define RSC_IMAGELIST (RSC_NOTYPE + 0x24)
+
+#define RSC_MESSBOX (RSC_NOTYPE + 0x30)
+#define RSC_INFOBOX (RSC_NOTYPE + 0x31)
+#define RSC_WARNINGBOX (RSC_NOTYPE + 0x32)
+#define RSC_ERRORBOX (RSC_NOTYPE + 0x33)
+#define RSC_QUERYBOX (RSC_NOTYPE + 0x34)
+#define RSC_WINDOW (RSC_NOTYPE + 0x35)
+#define RSC_SYSWINDOW (RSC_NOTYPE + 0x36)
+#define RSC_WORKWIN (RSC_NOTYPE + 0x37)
+#define RSC_MDIWINDOW (RSC_NOTYPE + 0x38)
+#define RSC_FLOATINGWINDOW (RSC_NOTYPE + 0x39)
+#define RSC_DIALOG (RSC_NOTYPE + 0x3a)
+#define RSC_MODELESSDIALOG (RSC_NOTYPE + 0x3b)
+#define RSC_MODALDIALOG (RSC_NOTYPE + 0x3c)
+#define RSC_CONTROL (RSC_NOTYPE + 0x44)
+#define RSC_BUTTON (RSC_NOTYPE + 0x45)
+#define RSC_PUSHBUTTON (RSC_NOTYPE + 0x46)
+#define RSC_OKBUTTON (RSC_NOTYPE + 0x47)
+#define RSC_CANCELBUTTON (RSC_NOTYPE + 0x48)
+#define RSC_HELPBUTTON (RSC_NOTYPE + 0x49)
+#define RSC_IMAGEBUTTON (RSC_NOTYPE + 0x4a)
+#define RSC_MENUBUTTON (RSC_NOTYPE + 0x4b)
+#define RSC_MOREBUTTON (RSC_NOTYPE + 0x4c)
+#define RSC_SPINBUTTON (RSC_NOTYPE + 0x4d)
+#define RSC_RADIOBUTTON (RSC_NOTYPE + 0x4e)
+#define RSC_IMAGERADIOBUTTON (RSC_NOTYPE + 0x4f)
+#define RSC_CHECKBOX (RSC_NOTYPE + 0x50)
+#define RSC_TRISTATEBOX (RSC_NOTYPE + 0x51)
+#define RSC_EDIT (RSC_NOTYPE + 0x52)
+#define RSC_MULTILINEEDIT (RSC_NOTYPE + 0x53)
+#define RSC_COMBOBOX (RSC_NOTYPE + 0x54)
+#define RSC_LISTBOX (RSC_NOTYPE + 0x55)
+#define RSC_MULTILISTBOX (RSC_NOTYPE + 0x56)
+#define RSC_TEXT (RSC_NOTYPE + 0x57)
+#define RSC_FIXEDLINE (RSC_NOTYPE + 0x58)
+#define RSC_FIXEDBITMAP (RSC_NOTYPE + 0x59)
+#define RSC_FIXEDIMAGE (RSC_NOTYPE + 0x5a)
+#define RSC_GROUPBOX (RSC_NOTYPE + 0x5c)
+#define RSC_SCROLLBAR (RSC_NOTYPE + 0x5d)
+#define RSC_SCROLLBARBOX (RSC_NOTYPE + 0x5e)
+#define RSC_SPLITTER (RSC_NOTYPE + 0x5f)
+#define RSC_SPLITWINDOW (RSC_NOTYPE + 0x60)
+#define RSC_SPINFIELD (RSC_NOTYPE + 0x61)
+#define RSC_PATTERNFIELD (RSC_NOTYPE + 0x62)
+#define RSC_NUMERICFIELD (RSC_NOTYPE + 0x63)
+#define RSC_METRICFIELD (RSC_NOTYPE + 0x64)
+#define RSC_CURRENCYFIELD (RSC_NOTYPE + 0x65)
+#define RSC_DATEFIELD (RSC_NOTYPE + 0x66)
+#define RSC_TIMEFIELD (RSC_NOTYPE + 0x67)
+#define RSC_PATTERNBOX (RSC_NOTYPE + 0x68)
+#define RSC_NUMERICBOX (RSC_NOTYPE + 0x69)
+#define RSC_METRICBOX (RSC_NOTYPE + 0x6a)
+#define RSC_CURRENCYBOX (RSC_NOTYPE + 0x6b)
+#define RSC_DATEBOX (RSC_NOTYPE + 0x6c)
+#define RSC_TIMEBOX (RSC_NOTYPE + 0x6d)
+#define RSC_LONGCURRENCYFIELD (RSC_NOTYPE + 0x6e)
+#define RSC_LONGCURRENCYBOX (RSC_NOTYPE + 0x6f)
+#define RSC_TOOLBOXITEM (RSC_NOTYPE + 0x70)
+#define RSC_TOOLBOX (RSC_NOTYPE + 0x71)
+#define RSC_DOCKINGWINDOW (RSC_NOTYPE + 0x72)
+#define RSC_STATUSBAR (RSC_NOTYPE + 0x73)
+#define RSC_TABPAGE (RSC_NOTYPE + 0x74)
+#define RSC_TABCONTROL (RSC_NOTYPE + 0x75)
+#define RSC_TABDIALOG (RSC_NOTYPE + 0x76)
+#define RSC_TABCONTROLITEM (RSC_NOTYPE + 0x77)
+#define RSC_TREELISTBOX (RSC_NOTYPE + 0x78)
+#define RSC_STRINGARRAY (RSC_NOTYPE + 0x79)
+
+// (RSC_NOTYPE + 0x200) - (RSC_NOTYPE + 0x300) reserved for Sfx
+
+#define RT_SYS_BITMAP (RSC_NOTYPE + 0xf2)
+#define RT_SYS_STRING (RSC_NOTYPE + 0xf3) // special case
+#define RT_SYS_FILE (RSC_NOTYPE + 0xf4) // not implemented
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/ref.hxx b/include/tools/ref.hxx
new file mode 100644
index 000000000000..ac7a42bc2e3e
--- /dev/null
+++ b/include/tools/ref.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 _REF_HXX
+#define _REF_HXX
+
+#include "tools/toolsdllapi.h"
+#include <vector>
+
+#define PRV_SV_IMPL_REF_COUNTERS( ClassName, Ref, AddRef, AddNextRef, ReleaseRef, Init, pRefbase ) \
+inline ClassName##Ref::ClassName##Ref( const ClassName##Ref & rObj ) \
+ { pObj = rObj.pObj; if( pObj ) { Init pRefbase->AddNextRef; } } \
+inline ClassName##Ref::ClassName##Ref( ClassName * pObjP ) \
+{ pObj = pObjP; if( pObj ) { Init pRefbase->AddRef; } } \
+inline void ClassName##Ref::Clear() \
+{ \
+ if( pObj ) \
+ { \
+ ClassName* const pRefObj = pRefbase; \
+ pObj = 0; \
+ pRefObj->ReleaseRef; \
+ } \
+} \
+inline ClassName##Ref::~ClassName##Ref() \
+{ if( pObj ) { pRefbase->ReleaseRef; } } \
+inline ClassName##Ref & ClassName##Ref:: \
+ operator = ( const ClassName##Ref & rObj ) \
+{ \
+ if( rObj.pObj ) rObj.pRefbase->AddNextRef; \
+ ClassName* const pRefObj = pRefbase; \
+ pObj = rObj.pObj; \
+ Init if( pRefObj ) { pRefObj->ReleaseRef; } \
+ return *this; \
+} \
+inline ClassName##Ref & ClassName##Ref::operator = ( ClassName * pObjP ) \
+{ return *this = ClassName##Ref( pObjP ); }
+
+#define PRV_SV_DECL_REF_LOCK(ClassName, Ref) \
+protected: \
+ ClassName * pObj; \
+public: \
+ inline ClassName##Ref() { pObj = 0; } \
+ inline ClassName##Ref( const ClassName##Ref & rObj ); \
+ inline ClassName##Ref( ClassName * pObjP ); \
+ inline void Clear(); \
+ inline ~ClassName##Ref(); \
+ inline ClassName##Ref & operator = ( const ClassName##Ref & rObj ); \
+ inline ClassName##Ref & operator = ( ClassName * pObj ); \
+ inline sal_Bool Is() const { return pObj != NULL; } \
+ inline ClassName * operator & () const { return pObj; } \
+ inline ClassName * operator -> () const { return pObj; } \
+ inline ClassName & operator * () const { return *pObj; } \
+ inline operator ClassName * () const { return pObj; }
+
+#define PRV_SV_DECL_REF( ClassName ) \
+PRV_SV_DECL_REF_LOCK( ClassName, Ref )
+
+#define SV_DECL_REF( ClassName ) \
+class ClassName; \
+class ClassName##Ref \
+{ \
+ PRV_SV_DECL_REF( ClassName ) \
+};
+
+#define SV_DECL_LOCK( ClassName ) \
+class ClassName; \
+class ClassName##Lock \
+{ \
+ PRV_SV_DECL_REF_LOCK( ClassName, Lock ) \
+};
+
+#define SV_IMPL_REF( ClassName ) \
+PRV_SV_IMPL_REF_COUNTERS( ClassName, Ref, AddRef(), AddNextRef(),\
+ ReleaseReference(), EMPTYARG, pObj )
+
+#define SV_IMPL_LOCK( ClassName ) \
+PRV_SV_IMPL_REF_COUNTERS( ClassName, Lock, OwnerLock( sal_True ), \
+ OwnerLock( sal_True ), OwnerLock( sal_False ), \
+ EMPTYARG, pObj )
+
+#define SV_DECL_IMPL_REF(ClassName) \
+ SV_DECL_REF(ClassName) \
+ SV_IMPL_REF(ClassName)
+
+template<typename T>
+class SvRefMemberList : private std::vector<T>
+{
+private:
+ typedef typename std::vector<T> base_t;
+
+public:
+ using base_t::size;
+ using base_t::front;
+ using base_t::back;
+ using base_t::operator[];
+ using base_t::begin;
+ using base_t::end;
+ using typename base_t::iterator;
+ using typename base_t::const_iterator;
+ using base_t::rbegin;
+ using base_t::rend;
+ using typename base_t::reverse_iterator;
+ using base_t::empty;
+
+ inline ~SvRefMemberList() { clear(); }
+ inline void clear()
+ {
+ for( typename base_t::const_iterator it = base_t::begin(); it != base_t::end(); ++it )
+ {
+ T p = *it;
+ if( p )
+ p->ReleaseReference();
+ }
+ base_t::clear();
+ }
+
+ inline void push_back( T p )
+ {
+ base_t::push_back( p );
+ p->AddRef();
+ }
+
+ inline void insert(const SvRefMemberList& rOther)
+ {
+ for( typename base_t::const_iterator it = rOther.begin(); it != rOther.end(); ++it )
+ {
+ push_back(*it);
+ }
+ }
+
+ inline T pop_back()
+ {
+ T p = base_t::back();
+ base_t::pop_back();
+ if( p )
+ p->ReleaseReference();
+ return p;
+ }
+};
+
+#define SV_NO_DELETE_REFCOUNT 0x80000000
+
+class TOOLS_DLLPUBLIC SvRefBase
+{
+ sal_uIntPtr nRefCount;
+
+protected:
+ virtual ~SvRefBase();
+ virtual void QueryDelete();
+
+public:
+ SvRefBase() { nRefCount = SV_NO_DELETE_REFCOUNT; }
+ SvRefBase( const SvRefBase & /* rObj */ )
+ { nRefCount = SV_NO_DELETE_REFCOUNT; }
+ SvRefBase & operator = ( const SvRefBase & ) { return *this; }
+
+ void RestoreNoDelete()
+ {
+ if( nRefCount < SV_NO_DELETE_REFCOUNT )
+ nRefCount += SV_NO_DELETE_REFCOUNT;
+ }
+ sal_uIntPtr AddMulRef( sal_uIntPtr n ) { return nRefCount += n; }
+ sal_uIntPtr AddNextRef() { return ++nRefCount; }
+ sal_uIntPtr AddRef()
+ {
+ if( nRefCount >= SV_NO_DELETE_REFCOUNT )
+ nRefCount -= SV_NO_DELETE_REFCOUNT;
+ return ++nRefCount;
+ }
+ void ReleaseReference()
+ {
+ if( !--nRefCount )
+ QueryDelete();
+ }
+ sal_uIntPtr ReleaseRef()
+ {
+ sal_uIntPtr n = --nRefCount;
+ if( !n )
+ QueryDelete();
+ return n;
+ }
+ sal_uIntPtr GetRefCount() const { return nRefCount; }
+};
+
+#ifndef EMPTYARG
+#define EMPTYARG
+#endif
+
+SV_DECL_IMPL_REF(SvRefBase)
+
+class SvCompatWeakHdl : public SvRefBase
+{
+ friend class SvCompatWeakBase;
+ void* _pObj;
+ SvCompatWeakHdl( void* pObj ) : _pObj( pObj ) {}
+
+public:
+ void ResetWeakBase( ) { _pObj = 0; }
+ void* GetObj() { return _pObj; }
+};
+
+SV_DECL_IMPL_REF( SvCompatWeakHdl )
+
+class SvCompatWeakBase
+{
+ SvCompatWeakHdlRef _xHdl;
+
+public:
+ SvCompatWeakHdl* GetHdl() { return _xHdl; }
+
+ // does not use Initalizer due to compiler warnings
+ SvCompatWeakBase( void* pObj ) { _xHdl = new SvCompatWeakHdl( pObj ); }
+ ~SvCompatWeakBase() { _xHdl->ResetWeakBase(); }
+};
+
+#define SV_DECL_COMPAT_WEAK( ClassName ) \
+class ClassName##Weak \
+{ \
+ SvCompatWeakHdlRef _xHdl; \
+public: \
+ inline ClassName##Weak( ) {} \
+ inline ClassName##Weak( ClassName* pObj ) { \
+ if( pObj ) _xHdl = pObj->GetHdl(); } \
+ inline void Clear() { _xHdl.Clear(); } \
+ inline ClassName##Weak& operator = ( ClassName * pObj ) { \
+ _xHdl = pObj ? pObj->GetHdl() : 0; return *this; } \
+ inline sal_Bool Is() const { \
+ return _xHdl.Is() && _xHdl->GetObj(); } \
+ inline ClassName * operator & () const { \
+ return (ClassName*) ( _xHdl.Is() ? _xHdl->GetObj() : 0 ); } \
+ inline ClassName * operator -> () const { \
+ return (ClassName*) ( _xHdl.Is() ? _xHdl->GetObj() : 0 ); } \
+ inline ClassName & operator * () const { \
+ return *(ClassName*) _xHdl->GetObj(); } \
+ inline operator ClassName * () const { \
+ return (ClassName*) (_xHdl.Is() ? _xHdl->GetObj() : 0 ); } \
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/resary.hxx b/include/tools/resary.hxx
new file mode 100644
index 000000000000..515dd779120b
--- /dev/null
+++ b/include/tools/resary.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 _TOOLS_RESARY_HXX
+#define _TOOLS_RESARY_HXX
+
+#include "boost/noncopyable.hpp"
+#include <vector>
+#include "tools/toolsdllapi.h"
+#include <tools/string.hxx>
+#include <tools/resid.hxx>
+
+#define RESARRAY_INDEX_NOTFOUND (0xffffffff)
+
+class TOOLS_DLLPUBLIC ResStringArray : private boost::noncopyable
+{
+private:
+ struct ImplResStringItem
+ {
+ OUString m_aStr;
+ long m_nValue;
+
+ ImplResStringItem( const OUString& rStr, long nValue = 0 ) :
+ m_aStr( rStr ),
+ m_nValue( nValue )
+ {}
+ };
+
+ std::vector< ImplResStringItem > m_aStrings;
+
+public:
+ ResStringArray( const ResId& rResId );
+ ~ResStringArray();
+
+ const OUString GetString( sal_uInt32 nIndex ) const
+ { return (nIndex < m_aStrings.size()) ? m_aStrings[nIndex].m_aStr : OUString(); }
+ long GetValue( sal_uInt32 nIndex ) const
+ { return (nIndex < m_aStrings.size()) ? m_aStrings[nIndex].m_nValue : -1; }
+ sal_uInt32 Count() const { return sal_uInt32(m_aStrings.size()); }
+
+ sal_uInt32 FindIndex( long nValue ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/resid.hxx b/include/tools/resid.hxx
new file mode 100644
index 000000000000..14c0a11915f7
--- /dev/null
+++ b/include/tools/resid.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 _TOOLS_RESID_HXX
+#define _TOOLS_RESID_HXX
+
+#include <osl/diagnose.h>
+#include <rtl/ustring.hxx>
+#include <tools/solar.h>
+#include "tools/toolsdllapi.h"
+
+struct RSHEADER_TYPE;
+typedef sal_uInt32 RESOURCE_TYPE;
+#define RSC_NOTYPE 0x100
+#define RSC_DONTRELEASE (sal_uInt32(1 << 31))
+
+class ResMgr;
+
+class ResId
+{
+ /*
+ consider two cases: either m_pResource is valid and points
+ two a resource data buffer; then m_nResId and m_pResMgr are
+ not used and may be 0 resp. NULL
+ or m_pResource is NULL, the m_nResId and m_pResMgr must be valid.
+ In this case the highest bit if set decides whether to
+ not to release the Resource context after loading this id
+ */
+ RSHEADER_TYPE* m_pResource;
+
+ mutable sal_uInt32 m_nResId; // Resource Identifier
+ mutable RESOURCE_TYPE m_nRT; // type for loading (mutable to be set later)
+ mutable ResMgr * m_pResMgr; // load from this ResMgr (mutable for setting on demand)
+ mutable RESOURCE_TYPE m_nRT2; // type for loading (supercedes m_nRT)
+ mutable sal_uInt32 m_nWinBits; // container for original style bits on a window in a resource
+
+ void ImplInit( sal_uInt32 nId, ResMgr& rMgr, RSHEADER_TYPE* pRes )
+ {
+ m_pResource = pRes; m_nResId = nId; m_nRT = RSC_NOTYPE; m_pResMgr = &rMgr; m_nRT2 = RSC_NOTYPE; m_nWinBits = 0;
+ OSL_ENSURE( m_pResMgr != NULL, "ResId without ResMgr created" );
+ }
+
+public:
+ ResId( RSHEADER_TYPE * pRc, ResMgr& rMgr )
+ {
+ ImplInit( 0, rMgr, pRc );
+ }
+ ResId( sal_uInt32 nId, ResMgr& rMgr )
+ {
+ ImplInit( nId, rMgr, NULL );
+ }
+ // backwards compatibility; avoid ambiguities
+ ResId( sal_uInt16 nId, ResMgr& rMgr )
+ {
+ ImplInit( sal_uInt32(nId), rMgr, NULL );
+ }
+ ResId( int nId, ResMgr& rMgr )
+ {
+ ImplInit( sal_uInt32(nId), rMgr, NULL );
+ }
+ ResId( long nId, ResMgr& rMgr )
+ {
+ ImplInit( sal_uInt32(nId), rMgr, NULL );
+ }
+
+ sal_uInt32 GetWinBits() const { return m_nWinBits; }
+ void SetWinBits( sal_uInt32 nBits ) const { m_nWinBits = nBits; }
+
+ RESOURCE_TYPE GetRT() const { return( m_nRT ); }
+
+ /** Set the type if not already set. Ask for tye with GetRT()
+
+ [Example]
+ ResId aId( 1000 );
+ aId.SetRT( RSC_WINDOW ); // settype window Window
+ aId.SetRT( RSC_BUTTON ); // will not set type Button
+ //aId.GetRT() == RSC_WINDOW is true
+
+ @see
+ ResId::GetRT2(), ResId::GetRT()
+ */
+ const ResId & SetRT( RESOURCE_TYPE nType ) const
+ {
+ if( RSC_NOTYPE == m_nRT )
+ m_nRT = nType;
+ return *this;
+ }
+
+ /** Get the effective type (m_nRT2 or m_nRT1)
+
+ A second resource type is used to supercede settings
+ of the base class ( e.g. Window )
+ */
+ RESOURCE_TYPE GetRT2() const
+ {
+ return (RSC_NOTYPE == m_nRT2) ? m_nRT : m_nRT2;
+ }
+
+ /** Set the superceding type. Ask spcifically for it with GetRT2()
+
+ SetRT2() may only be called if no derived class calls SetRT in its
+ Resource constructor.
+ */
+ const ResId & SetRT2( RESOURCE_TYPE nTyp ) const
+ {
+ if( RSC_NOTYPE == m_nRT2 )
+ m_nRT2 = nTyp;
+ return *this;
+ }
+
+ ResMgr * GetResMgr() const { return m_pResMgr; }
+ const ResId & SetResMgr( ResMgr * pMgr ) const
+ {
+ m_pResMgr = pMgr;
+ OSL_ENSURE( m_pResMgr != NULL, "invalid ResMgr set on ResId" );
+ return *this;
+ }
+
+ const ResId & SetAutoRelease(sal_Bool bRelease) const
+ {
+ if( bRelease )
+ m_nResId &= ~RSC_DONTRELEASE;
+ else
+ m_nResId |= RSC_DONTRELEASE;
+ return *this;
+ }
+
+ sal_Bool IsAutoRelease() const
+ { return !(m_nResId & RSC_DONTRELEASE); }
+
+ sal_uInt32 GetId() const { return m_nResId & ~RSC_DONTRELEASE; }
+ RSHEADER_TYPE* GetpResource() const { return m_pResource; }
+
+ TOOLS_DLLPUBLIC OUString toString() const;
+ TOOLS_DLLPUBLIC operator OUString() const { return toString(); }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/resmgr.hxx b/include/tools/resmgr.hxx
new file mode 100644
index 000000000000..603a2c7a2eb5
--- /dev/null
+++ b/include/tools/resmgr.hxx
@@ -0,0 +1,223 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _TOOLS_RESMGR_HXX
+#define _TOOLS_RESMGR_HXX
+
+#include "tools/toolsdllapi.h"
+#include <i18nlangtag/languagetag.hxx>
+#include <tools/string.hxx>
+#include <tools/resid.hxx>
+
+#include <vector>
+
+class SvStream;
+class InternalResMgr;
+
+/// Defines structure used to build resource
+struct RSHEADER_TYPE
+{
+private:
+ sal_uInt32 nId; ///< Identifier of resource
+ RESOURCE_TYPE nRT; ///< Resource type
+ sal_uInt32 nGlobOff; ///< Global offset
+ sal_uInt32 nLocalOff; ///< Local offset
+
+public:
+ inline sal_uInt32 GetId(); ///< Identifier of resource
+ inline RESOURCE_TYPE GetRT(); ///< Resource type
+ inline sal_uInt32 GetGlobOff(); ///< Global offset
+ inline sal_uInt32 GetLocalOff(); ///< Local offset
+};
+
+typedef OUString (*ResHookProc)( const OUString& rStr );
+
+// Initialization
+#define RC_NOTYPE 0x00
+// Global resource
+#define RC_GLOBAL 0x01
+#define RC_AUTORELEASE 0x02
+#define RC_NOTFOUND 0x04
+#define RC_FALLBACK_DOWN 0x08
+#define RC_FALLBACK_UP 0x10
+
+class Resource;
+class ResMgr;
+
+struct ImpRCStack
+{
+ // pResource and pClassRes equal NULL: resource was not loaded
+ RSHEADER_TYPE * pResource; ///< pointer to resource
+ void * pClassRes; ///< pointer to class specified init data
+ short Flags; ///< resource status
+ void * aResHandle; ///< Resource-Identifier from InternalResMgr
+ const Resource* pResObj; ///< pointer to Resource object
+ sal_uInt32 nId; ///< ResId used for error message
+ ResMgr* pResMgr; ///< ResMgr for Resource pResObj
+
+ void Clear();
+ void Init( ResMgr * pMgr, const Resource * pObj, sal_uInt32 nId );
+};
+
+class TOOLS_DLLPUBLIC ResMgr
+{
+private:
+ InternalResMgr* pImpRes;
+ std::vector< ImpRCStack > aStack; ///< resource context stack
+ int nCurStack;
+ ResMgr* pFallbackResMgr; ///< fallback ResMgr in case the Resource
+ ///< was not contained in this ResMgr
+ ResMgr* pOriginalResMgr; ///< the res mgr that fell back to this
+ ///< stack level
+
+ TOOLS_DLLPRIVATE void incStack();
+ TOOLS_DLLPRIVATE void decStack();
+
+ TOOLS_DLLPRIVATE const ImpRCStack * StackTop( sal_uInt32 nOff = 0 ) const
+ {
+ return (((int)nOff >= nCurStack) ? NULL : &aStack[nCurStack-nOff]);
+ }
+ TOOLS_DLLPRIVATE void Init( const OUString& rFileName );
+
+ TOOLS_DLLPRIVATE ResMgr( InternalResMgr * pImp );
+
+ #ifdef DBG_UTIL
+ TOOLS_DLLPRIVATE static void RscError_Impl( const sal_Char* pMessage,
+ ResMgr* pResMgr,
+ RESOURCE_TYPE nRT,
+ sal_uInt32 nId,
+ std::vector< ImpRCStack >& rResStack,
+ int nDepth );
+ #endif
+
+ // called from within GetResource() if a resource could not be found
+ TOOLS_DLLPRIVATE ResMgr* CreateFallbackResMgr( const ResId& rId,
+ const Resource* pResource );
+ // creates a 1k sized buffer set to zero for unfound resources
+ // used in case RC_NOTFOUND
+ static void* pEmptyBuffer;
+ TOOLS_DLLPRIVATE static void* getEmptyBuffer();
+
+ // the next two methods are needed to prevent the string hook called
+ // with the res mgr mutex locked
+ // like GetString, but doesn't call the string hook
+ TOOLS_DLLPRIVATE static sal_uInt32 GetStringWithoutHook( OUString& rStr,
+ const sal_uInt8* pStr );
+ // like ReadString but doesn't call the string hook
+ TOOLS_DLLPRIVATE OUString ReadStringWithoutHook();
+
+ static ResMgr* ImplCreateResMgr( InternalResMgr* pImpl ) { return new ResMgr( pImpl ); }
+
+ // no copying
+ ResMgr(const ResMgr&);
+ ResMgr& operator=(const ResMgr&);
+
+public:
+ static void DestroyAllResMgr(); ///< Called upon app shutdown
+
+ ~ResMgr();
+
+ /// Language-dependent resource library
+ static const sal_Char* GetLang( LanguageType& eLanguage, sal_uInt16 nPrio = 0 ); ///< @deprecated see "tools/source/rc/resmgr.cxx"
+ static ResMgr* SearchCreateResMgr( const sal_Char* pPrefixName,
+ LanguageTag& rLocale );
+ static ResMgr* CreateResMgr( const sal_Char* pPrefixName,
+ LanguageTag aLocale = LanguageTag( LANGUAGE_SYSTEM) );
+
+ /// Test whether resource still exists
+ void TestStack( const Resource * );
+
+ /// Check whether resource is available
+ sal_Bool IsAvailable( const ResId& rId,
+ const Resource* = NULL) const;
+
+ /// Search and load resource, given its ID
+ sal_Bool GetResource( const ResId& rId, const Resource * = NULL );
+ static void * GetResourceSkipHeader( const ResId& rResId, ResMgr ** ppResMgr );
+ /// Free resource context
+ void PopContext( const Resource* = NULL );
+
+ /// Increment resource pointer
+ void* Increment( sal_uInt32 nSize );
+
+ /// Size of an object within the resource
+ static sal_uInt32 GetObjSize( RSHEADER_TYPE* pHT )
+ { return( pHT->GetGlobOff() ); }
+
+ /// Return a string and its length out of the resource
+ static sal_uInt32 GetString( OUString& rStr, const sal_uInt8* pStr );
+ /// Return a byte string and its length out of the resource
+ static sal_uInt32 GetByteString( OString& rStr, const sal_uInt8* pStr );
+
+ /// Return the size of a string in the resource
+ static sal_uInt32 GetStringSize( sal_uInt32 nLen )
+ { nLen++; return (nLen + nLen%2); }
+ static sal_uInt32 GetStringSize( const sal_uInt8* pStr, sal_uInt32& nLen );
+
+ /// Return a int64
+ static sal_uInt64 GetUInt64( void* pDatum );
+ /// Return a long
+ static sal_Int32 GetLong( void * pLong );
+ /// Return a short
+ static sal_Int16 GetShort( void * pShort );
+
+ /// Return a pointer to the resource
+ void * GetClass();
+
+ RSHEADER_TYPE * CreateBlock( const ResId & rId );
+
+ sal_uInt32 GetRemainSize();
+
+ const OUString& GetFileName() const;
+
+ sal_Int16 ReadShort();
+ sal_Int32 ReadLong();
+ OUString ReadString();
+ OString ReadByteString();
+
+ /// Generate auto help ID for current resource stack
+ OString GetAutoHelpId();
+
+ static void SetReadStringHook( ResHookProc pProc );
+ static ResHookProc GetReadStringHook();
+ static void SetDefaultLocale( const LanguageTag& rLocale );
+};
+
+inline sal_uInt32 RSHEADER_TYPE::GetId()
+{
+ return (sal_uInt32)ResMgr::GetLong( &nId );
+}
+
+inline RESOURCE_TYPE RSHEADER_TYPE::GetRT()
+{
+ return (RESOURCE_TYPE)ResMgr::GetLong( &nRT );
+}
+
+inline sal_uInt32 RSHEADER_TYPE::GetGlobOff()
+{
+ return (sal_uInt32)ResMgr::GetLong( &nGlobOff );
+}
+
+inline sal_uInt32 RSHEADER_TYPE::GetLocalOff()
+{
+ return (sal_uInt32)ResMgr::GetLong( &nLocalOff );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/rtti.hxx b/include/tools/rtti.hxx
new file mode 100644
index 000000000000..a3501b75459b
--- /dev/null
+++ b/include/tools/rtti.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 _RTTI_HXX
+#define _RTTI_HXX
+
+#include <string.h>
+#include <tools/solar.h>
+
+typedef void* (*TypeId)();
+
+#define TYPEINFO() \
+ static void* CreateType(); \
+ static TypeId StaticType(); \
+ static sal_Bool IsOf( TypeId aSameOrSuperType ); \
+ virtual TypeId Type() const; \
+ virtual sal_Bool IsA( TypeId aSameOrSuperType ) const
+
+#define TYPEINFO_VISIBILITY(visibility) \
+ visibility static void* CreateType(); \
+ visibility static TypeId StaticType(); \
+ visibility static sal_Bool IsOf( TypeId aSameOrSuperType ); \
+ visibility virtual TypeId Type() const; \
+ visibility virtual sal_Bool IsA( TypeId aSameOrSuperType ) const
+
+#define TYPEINIT_FACTORY(sType, Factory ) \
+ void* sType::CreateType() { return Factory; } \
+ TypeId sType::StaticType() { return &CreateType; } \
+ TypeId sType::Type() const { return &CreateType; } \
+ sal_Bool sType::IsOf( TypeId aSameOrSuperType ) \
+ { \
+ if ( aSameOrSuperType == StaticType() ) \
+ return sal_True
+
+#define STATICTYPE(sType) (sType::StaticType())
+
+#define SUPERTYPE(sSuper) \
+ if ( sSuper::IsOf(aSameOrSuperType ) ) \
+ return sal_True
+
+#define TYPEINIT_END(sType) \
+ return sal_False; \
+ } \
+ sal_Bool sType::IsA( TypeId aSameOrSuperType ) const \
+ { return IsOf( aSameOrSuperType ); }
+
+#define TYPEINIT0_FACTORY(sType, Factory) \
+ TYPEINIT_FACTORY(sType, Factory); \
+ TYPEINIT_END(sType)
+#define TYPEINIT0_AUTOFACTORY(sType) TYPEINIT0_FACTORY(sType, new sType)
+#define TYPEINIT0(sType) TYPEINIT0_FACTORY(sType, 0)
+
+#define TYPEINIT1_FACTORY(sType, sSuper, Factory) \
+ TYPEINIT_FACTORY(sType, Factory); \
+ SUPERTYPE(sSuper); \
+ TYPEINIT_END(sType)
+#define TYPEINIT1_AUTOFACTORY(sType, sSuper) \
+ TYPEINIT1_FACTORY(sType, sSuper, new sType)
+#define TYPEINIT1(sType, sSuper) \
+ TYPEINIT1_FACTORY(sType, sSuper, 0)
+
+#define TYPEINIT2_FACTORY(sType, sSuper1, sSuper2, Factory) \
+ TYPEINIT_FACTORY(sType, Factory); \
+ SUPERTYPE(sSuper1); \
+ SUPERTYPE(sSuper2); \
+ TYPEINIT_END(sType)
+#define TYPEINIT2_AUTOFACTORY(sType, sSuper1, sSuper2) \
+ TYPEINIT2_FACTORY(sType, sSuper1, sSuper2, new sType)
+#define TYPEINIT2(sType, sSuper1, sSuper2) \
+ TYPEINIT2_FACTORY(sType, sSuper1, sSuper2, 0)
+
+#define TYPEINIT3_FACTORY(sType, sSuper1, sSuper2, sSuper3, Factory) \
+ TYPEINIT_FACTORY(sType, Factory); \
+ SUPERTYPE(sSuper1); \
+ SUPERTYPE(sSuper2); \
+ SUPERTYPE(sSuper3); \
+ TYPEINIT_END(sType)
+#define TYPEINIT3(sType, sSuper1, sSuper2, sSuper3) \
+ TYPEINIT3_FACTORY(sType, sSuper1, sSuper2, sSuper3, 0)
+
+#define TYPE(sType) (sType::StaticType())
+#define ISA(sType) IsA(sType::StaticType())
+#define ISOF(sType) IsOf(sType::StaticType())
+#define CREATE(TypeId) (TypeId())
+
+/** Exemplary application macros for pointers
+ (can be extended for use with references)
+
+ PTR_CAST: Safe pointer casting to a derived class.
+ Returns NULL pointer on cast error
+
+ T: Target type to cast into
+ p: Pointer to be cast into T
+*/
+#define PTR_CAST( T, pObj ) \
+ ( pObj && (pObj)->IsA( TYPE(T) ) ? (T*)(pObj) : 0 )
+
+/** Check whether object pObj has a Base Class T
+ (or if pObj is an instance of T) */
+#define HAS_BASE( T, pObj ) \
+ ( pObj && (pObj)->IsA( TYPE(T) ) )
+
+/** Check whether a pointer is targetting and object of type T. */
+#define IS_TYPE(T,pObj) \
+ ( pObj && (pObj)->Type() == TYPE(T) )
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/shl.hxx b/include/tools/shl.hxx
new file mode 100644
index 000000000000..945921fa114a
--- /dev/null
+++ b/include/tools/shl.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SHL_HXX
+#define _SHL_HXX
+
+#include <tools/solar.h>
+#include "tools/toolsdllapi.h"
+
+// GetAppData()
+
+// 0 (SHL_SHL1) removed
+#define SHL_SHL2 1
+// 2 (SHL_SHL3) removed
+// 3 (SHL_APP1) removed
+// 4 (SHL_APP2) removed
+// 5 (SHL_APP3) removed
+// 6 (SHL_TOOLS) removed
+// 7 (SHL_SV) removed
+// 8 (SHL_SVT) removed
+#define SHL_SVDDE 9
+#define SHL_ERR 10
+//11 (SHL_IPC) removed
+//12 (SHL_SVX) removed
+//13 (SHL_ITEM) removed
+#define SHL_SVD 14
+//15 (SHL_SI) removed
+//16 (SHL_SFC) removed
+//17 (SHL_SFX) removed
+//18 (SHL_SO2) removed
+#define SHL_IDL 19
+//20 (SHL_IDE) removed
+//21 (SHL_EDIT) removed
+//22 (SHL_VCED) removed
+#define SHL_BASIC 23
+//24 (SHL_HELP) removed
+//25 (SHL_LNKCCH) removed
+//26 (SHL_CHANNEL) removed
+//27 (SHL_SBX) removed
+//28 (SHL_SBC) removed
+//29 (SHL_SDB) removed
+//30 (SHL_SBA) removed
+//31 (SHL_SBA2) removed
+//32 (SHL_SCH) removed
+//33 (SHL_SIM) removed
+#define SHL_SM 34
+//35 (SHL_SGA) removed
+//36 (SHL_DOCMGR) removed
+//37 removed
+//38 (SHL_MAIL) removed
+//39 (SHL_NEWS) removed
+//40 (SHL_OFFAPP) removed
+//41 (SHL_INET) removed
+//43 (SHL_CHAOS) removed
+//43 (SHL_HISTORY) removed
+//44 (SHL_SJ) removed
+#define SHL_CALC 45
+#define SHL_DRAW 46
+#define SHL_WRITER 47
+//48 (SHL_MONEY) removed
+//49 (SHL_HBCI) removed
+//50 (SHL_BASE3D) removed
+//51 (SHL_BRUSHITEM) removed
+//52 (SHL_SFONTITEM) removed
+
+#define SHL_COUNT 53
+
+TOOLS_DLLPUBLIC void** GetAppData( sal_uInt16 nSharedLib );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/simplerm.hxx b/include/tools/simplerm.hxx
new file mode 100644
index 000000000000..667454c6150c
--- /dev/null
+++ b/include/tools/simplerm.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 .
+ */
+
+// a simple resource manager : no stacks, no sharing of the impl class, only loading of strings and blobs
+// but thread-safety !! :)
+
+#ifndef _TOOLS_SIMPLERESMGR_HXX_
+#define _TOOLS_SIMPLERESMGR_HXX_
+
+#include <osl/mutex.hxx>
+#include <tools/resid.hxx>
+#include <i18nlangtag/languagetag.hxx>
+#include <tools/string.hxx>
+#include "tools/toolsdllapi.h"
+
+class InternalResMgr;
+
+class TOOLS_DLLPUBLIC SimpleResMgr
+{
+protected:
+ osl::Mutex m_aAccessSafety;
+ InternalResMgr* m_pResImpl;
+
+public:
+ /** creates a new SimpleResManager
+ @param pPrefixName
+ denotes the prefix of the resource file name,
+ in ThreadTextEncoding
+ @param rLocale
+ denotes the locale of the resource file to
+ load. If empty (SYSTEM), a default locale will be used.
+ */
+ SimpleResMgr( const sal_Char* pPrefixName,
+ const LanguageTag& rLocale);
+
+ virtual ~SimpleResMgr();
+
+ static SimpleResMgr* Create( const sal_Char* pPrefixName,
+ LanguageTag aLocale = LanguageTag( LANGUAGE_SYSTEM) );// only in VCL
+
+ bool IsValid() const { return m_pResImpl != NULL; }
+
+ /** reads the string with the given resource id
+ @param nId
+ the resource id of the string to read
+ @return
+ the string with the given resource id, or an empty string if the id does not denote
+ an existent string
+ @seealso IsAvailable
+ */
+ OUString ReadString( sal_uInt32 nId );
+
+ /** checks whether a certain resource is availble
+ @param _resourceType
+ the type of the resource to check. Currently, only RSC_STRING (strings) and RSC_RESOURCE (blobs)
+ are supported, for every other type, <FALSE/> will be returned.
+ @param _resourceId
+ the id of the resource to lookup.
+ @return
+ <TRUE/> if and only if a resource of the given type, with the given id, is available.
+ */
+ bool IsAvailable( RESOURCE_TYPE _resourceType, sal_uInt32 _resourceId );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/solar.h b/include/tools/solar.h
new file mode 100644
index 000000000000..58d5849c5f42
--- /dev/null
+++ b/include/tools/solar.h
@@ -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 _SOLAR_H
+#define _SOLAR_H
+
+#include <sal/types.h>
+#include <osl/endian.h>
+#include <comphelper/fileformat.h>
+
+/** Intermediate type to solve type clash with Windows headers.
+ Should be removed as soon as all code parts have been reviewed
+ and the correct type is known. Most of the times ULONG is meant
+ to be a 32-Bit unsigned integer type as sal_uInt32 is often
+ used for data exchange or for similar method args. */
+typedef sal_uIntPtr sal_uLong; /* Replaces type ULONG */
+
+// misc. macros to leverage platform and compiler differences
+
+#define DELETEZ( p ) ( delete p,p = 0 )
+
+// solar binary types
+
+/* Solar (portable) Binary (exchange) Type; OSI 6 subset
+ always little endian;
+ not necessarily aligned */
+
+typedef sal_uInt8 SVBT8[1];
+typedef sal_uInt8 SVBT16[2];
+typedef sal_uInt8 SVBT32[4];
+typedef sal_uInt8 SVBT64[8];
+
+#ifdef __cplusplus
+
+inline sal_uInt8 SVBT8ToByte ( const SVBT8 p ) { return p[0]; }
+inline sal_uInt16 SVBT16ToShort( const SVBT16 p ) { return (sal_uInt16)p[0]
+ + ((sal_uInt16)p[1] << 8); }
+inline sal_uInt32 SVBT32ToUInt32 ( const SVBT32 p ) { return (sal_uInt32)p[0]
+ + ((sal_uInt32)p[1] << 8)
+ + ((sal_uInt32)p[2] << 16)
+ + ((sal_uInt32)p[3] << 24); }
+#if defined OSL_LITENDIAN
+inline double SVBT64ToDouble( const SVBT64 p ) { double n;
+ ((sal_uInt8*)&n)[0] = p[0];
+ ((sal_uInt8*)&n)[1] = p[1];
+ ((sal_uInt8*)&n)[2] = p[2];
+ ((sal_uInt8*)&n)[3] = p[3];
+ ((sal_uInt8*)&n)[4] = p[4];
+ ((sal_uInt8*)&n)[5] = p[5];
+ ((sal_uInt8*)&n)[6] = p[6];
+ ((sal_uInt8*)&n)[7] = p[7];
+ return n; }
+#else
+inline double SVBT64ToDouble( const SVBT64 p ) { double n;
+ ((sal_uInt8*)&n)[0] = p[7];
+ ((sal_uInt8*)&n)[1] = p[6];
+ ((sal_uInt8*)&n)[2] = p[5];
+ ((sal_uInt8*)&n)[3] = p[4];
+ ((sal_uInt8*)&n)[4] = p[3];
+ ((sal_uInt8*)&n)[5] = p[2];
+ ((sal_uInt8*)&n)[6] = p[1];
+ ((sal_uInt8*)&n)[7] = p[0];
+ return n; }
+#endif
+
+inline void ByteToSVBT8 ( sal_uInt8 n, SVBT8 p ) { p[0] = n; }
+inline void ShortToSVBT16( sal_uInt16 n, SVBT16 p ) { p[0] = (sal_uInt8) n;
+ p[1] = (sal_uInt8)(n >> 8); }
+inline void UInt32ToSVBT32 ( sal_uInt32 n, SVBT32 p ) { p[0] = (sal_uInt8) n;
+ p[1] = (sal_uInt8)(n >> 8);
+ p[2] = (sal_uInt8)(n >> 16);
+ p[3] = (sal_uInt8)(n >> 24); }
+#if defined OSL_LITENDIAN
+inline void DoubleToSVBT64( double n, SVBT64 p ) { p[0] = ((sal_uInt8*)&n)[0];
+ p[1] = ((sal_uInt8*)&n)[1];
+ p[2] = ((sal_uInt8*)&n)[2];
+ p[3] = ((sal_uInt8*)&n)[3];
+ p[4] = ((sal_uInt8*)&n)[4];
+ p[5] = ((sal_uInt8*)&n)[5];
+ p[6] = ((sal_uInt8*)&n)[6];
+ p[7] = ((sal_uInt8*)&n)[7]; }
+#else
+inline void DoubleToSVBT64( double n, SVBT64 p ) { p[0] = ((sal_uInt8*)&n)[7];
+ p[1] = ((sal_uInt8*)&n)[6];
+ p[2] = ((sal_uInt8*)&n)[5];
+ p[3] = ((sal_uInt8*)&n)[4];
+ p[4] = ((sal_uInt8*)&n)[3];
+ p[5] = ((sal_uInt8*)&n)[2];
+ p[6] = ((sal_uInt8*)&n)[1];
+ p[7] = ((sal_uInt8*)&n)[0]; }
+#endif
+#endif
+
+#ifdef __cplusplus
+#define EXTERN_C extern "C"
+#else
+#define EXTERN_C
+#endif
+
+#define _LF ((char)0x0A)
+#define _CR ((char)0x0D)
+
+// pragmas
+
+#if defined _MSC_VER
+/* deletion of pointer to incomplete type '...'; no destructor called
+ serious error, memory deleted without call of dtor */
+#pragma warning( error: 4150 )
+// warning C4002: too many actual parameters for macro
+// warning C4003: not enough actual parameters for macro
+#pragma warning(error : 4002 4003)
+#endif
+
+#define UniString String
+#define XubString String
+#define xub_StrLen sal_uInt16
+
+#define STRING_CONCAT3( s1, s2, s3 ) \
+ s1 s2 s3
+
+// dll file extensions
+
+#if defined WNT
+#define SVLIBRARY( Base ) \
+ STRING_CONCAT3( Base, "lo", ".dll" )
+#elif defined MACOSX
+#define SVLIBRARY( Base ) \
+ STRING_CONCAT3( "lib", Base, "lo.dylib" )
+#elif defined UNX
+#define SVLIBRARY( Base ) \
+ STRING_CONCAT3( "lib", Base, "lo.so" )
+#else
+ #error unknown platform
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/solarmutex.hxx b/include/tools/solarmutex.hxx
new file mode 100644
index 000000000000..1d6b13c59655
--- /dev/null
+++ b/include/tools/solarmutex.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 _TOOLS_SOLARMUTEX_HXX
+#define _TOOLS_SOLARMUTEX_HXX
+
+#include "tools/toolsdllapi.h"
+#include <osl/mutex.hxx>
+
+namespace tools
+{
+ class TOOLS_DLLPUBLIC SolarMutex
+ {
+ public:
+ static void SetSolarMutex( ::osl::SolarMutex* pMutex );
+ static bool Acquire();
+ static void Release();
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
new file mode 100644
index 000000000000..78a0bc3df96f
--- /dev/null
+++ b/include/tools/stream.hxx
@@ -0,0 +1,779 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _STREAM_HXX
+#define _STREAM_HXX
+
+#include <limits>
+#include "tools/toolsdllapi.h"
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <tools/errinf.hxx>
+#include <tools/ref.hxx>
+#include <tools/rtti.hxx>
+#include <rtl/string.hxx>
+
+class StreamData;
+
+inline rtl_TextEncoding GetStoreCharSet( rtl_TextEncoding eEncoding )
+{
+ if ( eEncoding == RTL_TEXTENCODING_ISO_8859_1 )
+ return RTL_TEXTENCODING_MS_1252;
+ else
+ return eEncoding;
+}
+
+// StreamTypes
+
+typedef sal_uInt16 StreamMode;
+
+// read, write, create,... options
+#define STREAM_READ 0x0001 ///< allow read accesses
+#define STREAM_WRITE 0x0002 ///< allow write accesses
+// file i/o
+#define STREAM_NOCREATE 0x0004 ///< 1 == Dont create file
+#define STREAM_TRUNC 0x0008 ///< Truncate _existing_ file to zero length
+#define STREAM_COPY_ON_SYMLINK 0x0010 ///< copy-on-write for symlinks (UNX)
+
+#define STREAM_READWRITEBITS (STREAM_READ | STREAM_WRITE | \
+ STREAM_NOCREATE | STREAM_TRUNC)
+
+// sharing options
+#define STREAM_SHARE_DENYNONE 0x0100
+#define STREAM_SHARE_DENYREAD 0x0200 // overrides denynone
+#define STREAM_SHARE_DENYWRITE 0x0400 // overrides denynone
+#define STREAM_SHARE_DENYALL 0x0800 // overrides denyread,write,none
+
+#define STREAM_SHAREBITS (STREAM_SHARE_DENYNONE | STREAM_SHARE_DENYREAD |\
+ STREAM_SHARE_DENYWRITE | STREAM_SHARE_DENYALL)
+
+#define STREAM_READWRITE (STREAM_READ | STREAM_WRITE)
+#define STREAM_SHARE_DENYREADWRITE (STREAM_SHARE_DENYREAD | STREAM_SHARE_DENYWRITE)
+
+#define STREAM_STD_READ (STREAM_READ | STREAM_SHARE_DENYNONE | STREAM_NOCREATE)
+#define STREAM_STD_WRITE (STREAM_WRITE | STREAM_SHARE_DENYALL)
+#define STREAM_STD_READWRITE (STREAM_READWRITE | STREAM_SHARE_DENYALL)
+
+#define STREAM_SEEK_TO_BEGIN 0L
+#define STREAM_SEEK_TO_END ULONG_MAX
+
+#define NUMBERFORMAT_INT_BIGENDIAN (sal_uInt16)0x0000
+#define NUMBERFORMAT_INT_LITTLEENDIAN (sal_uInt16)0xFFFF
+
+#define COMPRESSMODE_NONE (sal_uInt16)0x0000
+#define COMPRESSMODE_ZBITMAP (sal_uInt16)0x0001
+#define COMPRESSMODE_NATIVE (sal_uInt16)0x0010
+
+#define STREAM_IO_DONTKNOW 0
+#define STREAM_IO_READ 1
+#define STREAM_IO_WRITE 2
+
+#define ID_STREAM 1
+#define ID_FILESTREAM 2
+#define ID_MEMORYSTREAM 3
+#define ID_SHAREDMEMORYSTREAM 4
+#define ID_STORAGESTREAM 5
+#define ID_PERSISTSTREAM 6
+
+class SvStream;
+
+typedef SvStream& (*SvStrPtr)( SvStream& );
+
+inline SvStream& operator<<( SvStream& rStr, SvStrPtr f );
+
+// SvLockBytes
+
+enum LockType {};
+
+struct SvLockBytesStat
+{
+ sal_Size nSize;
+
+ SvLockBytesStat() : nSize(0) {}
+};
+
+enum SvLockBytesStatFlag { SVSTATFLAG_DEFAULT };
+
+class TOOLS_DLLPUBLIC SvLockBytes: public virtual SvRefBase
+{
+ SvStream * m_pStream;
+ sal_Bool m_bOwner;
+ sal_Bool m_bSync;
+
+protected:
+ void close();
+
+public:
+ TYPEINFO();
+
+ SvLockBytes() : m_pStream(0), m_bOwner(sal_False), m_bSync(sal_False) {}
+
+ SvLockBytes(SvStream * pTheStream, sal_Bool bTheOwner = sal_False) :
+ m_pStream(pTheStream), m_bOwner(bTheOwner), m_bSync(sal_False) {}
+
+ virtual ~SvLockBytes() { close(); }
+
+ virtual const SvStream * GetStream() const { return m_pStream; }
+
+ virtual void SetSynchronMode(sal_Bool bTheSync = sal_True) { m_bSync = bTheSync; }
+ virtual sal_Bool IsSynchronMode() const { return m_bSync; }
+
+ virtual ErrCode ReadAt(sal_Size nPos, void * pBuffer, sal_Size nCount,
+ sal_Size * pRead) const;
+ virtual ErrCode WriteAt(sal_Size nPos, const void * pBuffer, sal_Size nCount,
+ sal_Size * pWritten);
+
+ virtual ErrCode Flush() const;
+
+ virtual ErrCode SetSize(sal_Size nSize);
+
+ virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const;
+};
+
+SV_DECL_IMPL_REF(SvLockBytes);
+
+// SvOpenLockBytes
+
+class TOOLS_DLLPUBLIC SvOpenLockBytes: public SvLockBytes
+{
+public:
+ TYPEINFO();
+
+ SvOpenLockBytes() : SvLockBytes(0, sal_False) {}
+ SvOpenLockBytes(SvStream * pStream, sal_Bool bOwner):
+ SvLockBytes(pStream, bOwner) {}
+
+ virtual ErrCode FillAppend(const void * pBuffer, sal_Size nCount,
+ sal_Size * pWritten) = 0;
+
+ virtual sal_Size Tell() const = 0;
+
+ virtual sal_Size Seek(sal_Size nPos) = 0;
+
+ virtual void Terminate() = 0;
+};
+
+SV_DECL_IMPL_REF(SvOpenLockBytes);
+
+// SvAsyncLockBytes
+
+class SvAsyncLockBytes: public SvOpenLockBytes
+{
+ sal_Size m_nSize;
+ sal_Bool m_bTerminated;
+
+public:
+ TYPEINFO();
+
+ SvAsyncLockBytes(SvStream * pStream, sal_Bool bOwner):
+ SvOpenLockBytes(pStream, bOwner), m_nSize(0), m_bTerminated(sal_False) {}
+
+ virtual ErrCode ReadAt(sal_Size nPos, void * pBuffer, sal_Size nCount,
+ sal_Size * pRead) const;
+ virtual ErrCode WriteAt(sal_Size nPos, const void * pBuffer, sal_Size nCount,
+ sal_Size * pWritten);
+
+ virtual ErrCode FillAppend(const void * pBuffer, sal_Size nCount,
+ sal_Size * pWritten);
+
+ virtual sal_Size Tell() const { return m_nSize; }
+
+ virtual sal_Size Seek(sal_Size nPos);
+
+ virtual void Terminate() { m_bTerminated = sal_True; }
+};
+
+SV_DECL_IMPL_REF(SvAsyncLockBytes);
+
+// SvStream
+
+class TOOLS_DLLPUBLIC SvStream
+{
+private:
+ // LockBytes Interface
+ void* pImp; // unused
+ SvLockBytesRef xLockBytes; // Default implementation
+ sal_Size nActPos;
+
+ // Puffer-Verwaltung
+ sal_uInt8* pRWBuf; // Points to read/write buffer
+ sal_uInt8* pBufPos; // pRWBuf + nBufActualPos
+ sal_uInt16 nBufSize; // Allocated size of buffer
+ sal_uInt16 nBufActualLen; // Length of used segment of puffer
+ // = nBufSize, if EOF did not occur
+ sal_uInt16 nBufActualPos; // current position in buffer (0..nBufSize-1)
+ sal_uInt16 nBufFree; // number of free slots in buffer to IO of type eIOMode
+ unsigned int eIOMode : 2;// STREAM_IO_*
+
+ // Error codes, conversion, compression, ...
+ int bIsDirty : 1; // sal_True: Stream != buffer content
+ int bIsConsistent : 1;// sal_False: Buffer contains data, which were
+ // NOT allowed to be written by PutData
+ // into the derived stream (cf. PutBack)
+ int bSwap : 1;
+ int bIsEof : 1;
+ sal_uInt32 nError;
+ sal_uInt16 nNumberFormatInt;
+ sal_uInt16 nCompressMode;
+ LineEnd eLineDelimiter;
+ CharSet eStreamCharSet;
+
+ // Encryption
+ OString m_aCryptMaskKey;// aCryptMaskKey.getLength != 0 -> Encryption used
+ unsigned char nCryptMask;
+
+ // Userdata
+ long nVersion; // for external use
+
+ // helper methods
+ TOOLS_DLLPRIVATE void ImpInit();
+
+ SvStream ( const SvStream& rStream ); // not implemented
+ SvStream& operator=( const SvStream& rStream ); // not implemented
+
+protected:
+ sal_Size nBufFilePos;///< File position of pBuf[0]
+ sal_uInt16 eStreamMode;
+ sal_Bool bIsWritable;
+
+ virtual sal_Size GetData( void* pData, sal_Size nSize );
+ virtual sal_Size PutData( const void* pData, sal_Size nSize );
+ virtual sal_Size SeekPos( sal_Size nPos );
+ virtual void FlushData();
+ virtual void SetSize( sal_Size nSize );
+
+ void ClearError();
+ void ClearBuffer();
+
+ // encrypt and write in blocks
+ sal_Size CryptAndWriteBuffer( const void* pStart, sal_Size nLen );
+ sal_Bool EncryptBuffer( void* pStart, sal_Size nLen );
+
+ void SyncSvStream( sal_Size nNewStreamPos ); ///< SvStream <- Medium
+ void SyncSysStream(); ///< SvStream -> Medium
+
+public:
+ SvStream();
+ SvStream( SvLockBytes *pLockBytes);
+ virtual ~SvStream();
+
+ SvLockBytes* GetLockBytes() const { return xLockBytes; }
+
+ sal_uInt32 GetError() const { return ERRCODE_TOERROR(nError); }
+ sal_uInt32 GetErrorCode() const { return nError; }
+
+ void SetError( sal_uInt32 nErrorCode );
+ virtual void ResetError();
+
+ void SetNumberFormatInt( sal_uInt16 nNewFormat );
+ sal_uInt16 GetNumberFormatInt() const { return nNumberFormatInt; }
+ /// Enable/disable swapping of endians, may be needed for Unicode import/export
+ inline void SetEndianSwap( sal_Bool bVal );
+ /// returns status of endian swap flag
+ sal_Bool IsEndianSwap() const { return 0 != bSwap; }
+
+ void SetCompressMode( sal_uInt16 nNewMode )
+ { nCompressMode = nNewMode; }
+ sal_uInt16 GetCompressMode() const { return nCompressMode; }
+
+ void SetCryptMaskKey(const OString& rCryptMaskKey);
+ const OString& GetCryptMaskKey() const { return m_aCryptMaskKey; }
+
+ void SetStreamCharSet( CharSet eCharSet )
+ { eStreamCharSet = eCharSet; }
+ CharSet GetStreamCharSet() const { return eStreamCharSet; }
+
+ void SetLineDelimiter( LineEnd eLineEnd )
+ { eLineDelimiter = eLineEnd; }
+ LineEnd GetLineDelimiter() const { return eLineDelimiter; }
+
+ SvStream& operator>>( sal_uInt16& rUInt16 );
+ SvStream& operator>>( sal_uInt32& rUInt32 );
+ SvStream& operator>>( sal_uInt64& rUInt64 );
+ SvStream& operator>>( sal_Int16& rInt16 );
+ SvStream& operator>>( sal_Int32& rInt32 );
+ SvStream& operator>>( sal_Int64& rInt64 );
+
+ SvStream& operator>>( signed char& rChar );
+ SvStream& operator>>( char& rChar );
+ SvStream& operator>>( unsigned char& rChar );
+ SvStream& operator>>( float& rFloat );
+ SvStream& operator>>( double& rDouble );
+ SvStream& operator>>( SvStream& rStream );
+
+ SvStream& operator<<( sal_uInt16 nUInt16 );
+ SvStream& operator<<( sal_uInt32 nUInt32 );
+ SvStream& operator<<( sal_uInt64 nuInt64 );
+ SvStream& operator<<( sal_Int16 nInt16 );
+ SvStream& operator<<( sal_Int32 nInt32 );
+ SvStream& operator<<( sal_Int64 nInt64 );
+
+ SvStream& operator<<( bool b )
+ { return operator<<(static_cast< sal_Bool >(b)); }
+ SvStream& operator<<( signed char nChar );
+ SvStream& operator<<( char nChar );
+ SvStream& operator<<( unsigned char nChar );
+ SvStream& operator<<( float nFloat );
+ SvStream& operator<<( const double& rDouble );
+ SvStream& operator<<( const char* pBuf );
+ SvStream& operator<<( const unsigned char* pBuf );
+ SvStream& operator<<( SvStream& rStream );
+
+ SvStream& WriteNumber( sal_uInt32 nUInt32 );
+ SvStream& WriteNumber( sal_Int32 nInt32 );
+
+ sal_Size Read( void* pData, sal_Size nSize );
+ sal_Size Write( const void* pData, sal_Size nSize );
+ sal_Size Seek( sal_Size nPos );
+ sal_Size SeekRel( sal_sSize nPos );
+ sal_Size Tell() const { return nBufFilePos+nBufActualPos; }
+ // length between current (Tell()) pos and end of stream
+ virtual sal_Size remainingSize();
+ void Flush();
+ sal_Bool IsEof() const { return bIsEof; }
+ // next Tell() <= nSize
+ sal_Bool SetStreamSize( sal_Size nSize );
+
+ /** Read a line of bytes.
+
+ @param nMaxBytesToRead
+ Maximum of bytes to read, if line is longer it will be
+ truncated.
+
+ @note NOTE that the default is one character less than STRING_MAXLEN to
+ prevent problems after conversion to String that may be lurking
+ in various places doing something like
+ @code
+ for (sal_uInt16 i=0; i < aString.Len(); ++i)
+ @endcode
+ causing endless loops ...
+ */
+ sal_Bool ReadLine( OString& rStr, sal_Int32 nMaxBytesToRead = 0xFFFE );
+ sal_Bool WriteLine( const OString& rStr );
+
+ /** Read a line of bytes.
+
+ @param nMaxBytesToRead
+ Maximum of bytes to read, if line is longer it will be
+ truncated.
+
+ @note NOTE that the default is one character less than STRING_MAXLEN to
+ prevent problems after conversion to String that may be lurking
+ in various places doing something like
+ @code
+ for (sal_uInt16 i=0; i < aString.Len(); ++i)
+ @endcode
+ causing endless loops ...
+ */
+ sal_Bool ReadByteStringLine( OUString& rStr, rtl_TextEncoding eSrcCharSet,
+ sal_Int32 nMaxBytesToRead = 0xFFFE );
+ sal_Bool ReadByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSet );
+ sal_Bool WriteByteStringLine( const String& rStr, rtl_TextEncoding eDestCharSet );
+
+ /// Switch to no endian swapping and write 0xfeff
+ sal_Bool StartWritingUnicodeText();
+
+ /** If eReadBomCharSet==RTL_TEXTENCODING_DONTKNOW: read 16bit, if 0xfeff do
+ nothing (UTF-16), if 0xfffe switch endian swapping (UTF-16), if 0xefbb
+ or 0xbbef read another byte and check for UTF-8. If no UTF-* BOM was
+ detected put all read bytes back. This means that if 2 bytes were read
+ it was an UTF-16 BOM, if 3 bytes were read it was an UTF-8 BOM. There
+ is no UTF-7, UTF-32 or UTF-EBCDIC BOM detection!
+
+ If eReadBomCharSet!=RTL_TEXTENCODING_DONTKNOW: only read a BOM of that
+ encoding and switch endian swapping if UTF-16 and 0xfffe. */
+ sal_Bool StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet );
+
+ /** Read a line of Unicode.
+
+ @param nMaxCodepointsToRead
+ Maximum of codepoints (UCS-2 or UTF-16 pairs, not bytes) to
+ read, if line is longer it will be truncated.
+
+ @note NOTE that the default is one character less than STRING_MAXLEN to
+ prevent problems after conversion to String that may be lurking in
+ various places doing something like
+ @code
+ for (sal_uInt16 i=0; i < aString.Len(); ++i)
+ @endcode
+ causing endless loops ...
+ */
+ sal_Bool ReadUniStringLine( OUString& rStr, sal_Int32 nMaxCodepointsToRead = 0xFFFE );
+ /** Read a 32bit length prefixed sequence of utf-16 if
+ eSrcCharSet==RTL_TEXTENCODING_UNICODE, otherwise read a 16bit length
+ prefixed sequence of bytes and convert from eSrcCharSet */
+ OUString ReadUniOrByteString(rtl_TextEncoding eSrcCharSet);
+ /** Write a 32bit length prefixed sequence of utf-16 if
+ eSrcCharSet==RTL_TEXTENCODING_UNICODE, otherwise convert to eSrcCharSet
+ and write a 16bit length prefixed sequence of bytes */
+ SvStream& WriteUniOrByteString( const OUString& rStr, rtl_TextEncoding eDestCharSet );
+
+ /** Read a line of Unicode if eSrcCharSet==RTL_TEXTENCODING_UNICODE,
+ otherwise read a line of Bytecode and convert from eSrcCharSet
+
+ @param nMaxCodepointsToRead
+ Maximum of codepoints (2 bytes if Unicode, bytes if not
+ Unicode) to read, if line is longer it will be truncated.
+
+ @note NOTE that the default is one character less than STRING_MAXLEN to
+ prevent problems after conversion to String that may be lurking in
+ various places doing something like
+ @code
+ for (sal_uInt16 i=0; i < aString.Len(); ++i)
+ @endcode
+ causing endless loops ...
+ */
+ sal_Bool ReadUniOrByteStringLine( OUString& rStr, rtl_TextEncoding eSrcCharSet,
+ sal_Int32 nMaxCodepointsToRead = 0xFFFE );
+ /** Write a sequence of Unicode characters if
+ eDestCharSet==RTL_TEXTENCODING_UNICODE, otherwise write a sequence of
+ Bytecodes converted to eDestCharSet */
+ sal_Bool WriteUnicodeOrByteText( const String& rStr, rtl_TextEncoding eDestCharSet );
+ sal_Bool WriteUnicodeOrByteText( const String& rStr )
+ { return WriteUnicodeOrByteText( rStr, GetStreamCharSet() ); }
+
+ /** Write a Unicode character if eDestCharSet==RTL_TEXTENCODING_UNICODE,
+ otherwise write as Bytecode converted to eDestCharSet.
+
+ This may result in more than one byte being written if a multi byte
+ encoding (e.g. UTF7, UTF8) is chosen. */
+ sal_Bool WriteUniOrByteChar( sal_Unicode ch, rtl_TextEncoding eDestCharSet );
+ sal_Bool WriteUniOrByteChar( sal_Unicode ch )
+ { return WriteUniOrByteChar( ch, GetStreamCharSet() ); }
+
+ void SetBufferSize( sal_uInt16 nBufSize );
+ sal_uInt16 GetBufferSize() const { return nBufSize; }
+
+ void RefreshBuffer();
+ SvStream& PutBack( char aCh );
+
+ sal_Bool IsWritable() const { return bIsWritable; }
+ StreamMode GetStreamMode() const { return eStreamMode; }
+ virtual sal_uInt16 IsA() const;
+
+ long GetVersion() { return nVersion; }
+ void SetVersion( long n ) { nVersion = n; }
+
+ friend SvStream& operator<<( SvStream& rStr, SvStrPtr f ); // for Manips
+
+ /// end of input seen during previous i/o operation
+ bool eof() const { return bIsEof; }
+
+ /// stream is broken
+ bool bad() const { return GetError() != 0; }
+
+ /** Get state
+
+ If the state is good() the previous i/o operation succeeded.
+
+ If the state is good(), the next input operation might succeed;
+ otherwise, it will fail.
+
+ Applying an input operation to a stream that is not in the good() state
+ is a null operation as far as the variable being read into is concerned.
+
+ If we try to read into a variable v and the operation fails, the value
+ of v should be unchanged,
+ */
+ bool good() const { return !(eof() || bad()); }
+};
+
+inline SvStream& operator<<( SvStream& rStr, SvStrPtr f )
+{
+ (*f)(rStr);
+ return rStr;
+}
+
+inline void SvStream::SetEndianSwap( sal_Bool bVal )
+{
+#ifdef OSL_BIGENDIAN
+ SetNumberFormatInt( bVal ? NUMBERFORMAT_INT_LITTLEENDIAN : NUMBERFORMAT_INT_BIGENDIAN );
+#else
+ SetNumberFormatInt( bVal ? NUMBERFORMAT_INT_BIGENDIAN : NUMBERFORMAT_INT_LITTLEENDIAN );
+#endif
+}
+
+TOOLS_DLLPUBLIC SvStream& endl( SvStream& rStr );
+/// same as endl() but Unicode
+TOOLS_DLLPUBLIC SvStream& endlu( SvStream& rStr );
+/// call endlu() if eStreamCharSet==RTL_TEXTECODING_UNICODE otherwise endl()
+TOOLS_DLLPUBLIC SvStream& endlub( SvStream& rStr );
+
+/// Attempt to read nUnits 8bit units to an OString, returned OString's
+/// length is number of units successfully read
+TOOLS_DLLPUBLIC OString read_uInt8s_ToOString(SvStream& rStrm,
+ sal_Size nUnits);
+
+/// Attempt to read nUnits 8bit units to an OUString
+TOOLS_DLLPUBLIC inline OUString read_uInt8s_ToOUString(SvStream& rStrm,
+ sal_Size nUnits, rtl_TextEncoding eEnc)
+{
+ return OStringToOUString(read_uInt8s_ToOString(rStrm, nUnits), eEnc);
+}
+
+/// Attempt to read nUnits 16bit units to an OUString, returned
+/// OUString's length is number of units successfully read
+TOOLS_DLLPUBLIC OUString read_uInt16s_ToOUString(SvStream& rStrm,
+ sal_Size nUnits);
+
+/// Attempt to read a pascal-style length (of type prefix) prefixed sequence of
+/// 16bit units to an OUString, returned OString's length is number of
+/// units successfully read.
+template<typename prefix>
+OUString read_lenPrefixed_uInt16s_ToOUString(SvStream& rStrm)
+{
+ prefix nUnits = 0;
+ rStrm >> nUnits;
+ return read_uInt16s_ToOUString(rStrm, nUnits);
+}
+
+/// Attempt to write a prefixed sequence of nUnits 16bit units from an OUString,
+/// returned value is number of bytes written
+TOOLS_DLLPUBLIC sal_Size write_uInt16s_FromOUString(SvStream& rStrm,
+ const OUString& rStr, sal_Size nUnits);
+
+TOOLS_DLLPUBLIC inline sal_Size write_uInt16s_FromOUString(SvStream& rStrm,
+ const OUString& rStr)
+{
+ return write_uInt16s_FromOUString(rStrm, rStr, rStr.getLength());
+}
+
+namespace streamdetail
+{
+ /// Attempt to write a pascal-style length (of type prefix) prefixed
+ /// sequence of units from a string-type, returned value is number of bytes
+ /// written (including byte-count of prefix)
+ template<typename prefix, typename S, sal_Size (*writeOper)(SvStream&, const S&, sal_Size)>
+ sal_Size write_lenPrefixed_seq_From_str(SvStream& rStrm, const S &rStr)
+ {
+ sal_Size nWritten = 0;
+ prefix nUnits = std::min<sal_Size>(rStr.getLength(), std::numeric_limits<prefix>::max());
+ SAL_WARN_IF(static_cast<sal_Size>(nUnits) != static_cast<sal_Size>(rStr.getLength()),
+ "tools.stream",
+ "string too long for prefix count to fit in output type");
+ rStrm << nUnits;
+ if (rStrm.good())
+ {
+ nWritten += sizeof(prefix);
+ nWritten += writeOper(rStrm, rStr, nUnits);
+ }
+ return nWritten;
+ }
+}
+
+/// Attempt to write a pascal-style length (of type prefix) prefixed sequence
+/// of 16bit units from an OUString, returned value is number of bytes written
+/// (including byte-count of prefix)
+template<typename prefix> sal_Size write_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm,
+ const OUString &rStr)
+{
+ return streamdetail::write_lenPrefixed_seq_From_str<prefix, OUString, write_uInt16s_FromOUString>(rStrm, rStr);
+}
+
+/// Attempt to read 8bit units to an OString until a zero terminator is
+/// encountered, returned OString's length is number of units *definitely*
+/// successfully read, check SvStream::good() to see if null terminator was
+/// successfully read
+TOOLS_DLLPUBLIC OString read_zeroTerminated_uInt8s_ToOString(SvStream& rStrm);
+
+/// Attempt to read 8bit units assuming source encoding eEnc to an OUString
+/// until a zero terminator is encountered. Check SvStream::good() to see if
+/// null terminator was successfully read
+TOOLS_DLLPUBLIC OUString read_zeroTerminated_uInt8s_ToOUString(SvStream& rStrm, rtl_TextEncoding eEnc);
+
+/// Attempt to read a pascal-style length (of type prefix) prefixed sequence of
+/// 8bit units to an OString, returned OString's length is number of units
+/// successfully read.
+template<typename prefix>
+OString read_lenPrefixed_uInt8s_ToOString(SvStream& rStrm)
+{
+ prefix nUnits = 0;
+ rStrm >> nUnits;
+ return read_uInt8s_ToOString(rStrm, nUnits);
+}
+
+/// Attempt to read a pascal-style length (of type prefix) prefixed sequence of
+/// 8bit units to an OUString
+template<typename prefix>
+OUString read_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm,
+ rtl_TextEncoding eEnc)
+{
+ return OStringToOUString(read_lenPrefixed_uInt8s_ToOString<prefix>(rStrm), eEnc);
+}
+
+/// Attempt to write a prefixed sequence of nUnits 8bit units from an OString,
+/// returned value is number of bytes written
+TOOLS_DLLPUBLIC inline sal_Size write_uInt8s_FromOString(SvStream& rStrm, const OString& rStr,
+ sal_Size nUnits)
+{
+ return rStrm.Write(rStr.getStr(), nUnits);
+}
+
+TOOLS_DLLPUBLIC inline sal_Size write_uInt8s_FromOString(SvStream& rStrm, const OString& rStr)
+{
+ return write_uInt8s_FromOString(rStrm, rStr, rStr.getLength());
+}
+
+/// Attempt to write a pascal-style length (of type prefix) prefixed sequence
+/// of 8bit units from an OString, returned value is number of bytes written
+/// (including byte-count of prefix)
+template<typename prefix> sal_Size write_lenPrefixed_uInt8s_FromOString(SvStream& rStrm,
+ const OString &rStr)
+{
+ return streamdetail::write_lenPrefixed_seq_From_str<prefix, OString, write_uInt8s_FromOString>(rStrm, rStr);
+}
+
+/// Attempt to write a pascal-style length (of type prefix) prefixed sequence
+/// of 8bit units from an OUString, returned value is number of bytes written
+/// (including byte-count of prefix)
+template<typename prefix> sal_Size write_lenPrefixed_uInt8s_FromOUString(SvStream& rStrm,
+ const OUString &rStr, rtl_TextEncoding eEnc)
+{
+ return write_lenPrefixed_uInt8s_FromOString<prefix>(rStrm, OUStringToOString(rStr, eEnc));
+}
+
+// FileStream
+
+class TOOLS_DLLPUBLIC SvFileStream : public SvStream
+{
+private:
+ StreamData* pInstanceData;
+ String aFilename;
+ sal_uInt16 nLockCounter;
+ sal_Bool bIsOpen;
+#ifdef UNX
+ sal_uInt32 GetFileHandle() const;
+#endif
+ // Forbidden and not implemented.
+ SvFileStream (const SvFileStream&);
+ SvFileStream & operator= (const SvFileStream&);
+
+ sal_Bool LockRange( sal_Size nByteOffset, sal_Size nBytes );
+ sal_Bool UnlockRange( sal_Size nByteOffset, sal_Size nBytes );
+ sal_Bool LockFile();
+ sal_Bool UnlockFile();
+
+protected:
+ virtual sal_Size GetData( void* pData, sal_Size nSize );
+ virtual sal_Size PutData( const void* pData, sal_Size nSize );
+ virtual sal_Size SeekPos( sal_Size nPos );
+ virtual void SetSize( sal_Size nSize );
+ virtual void FlushData();
+
+public:
+ // Switches to Read StreamMode on failed attempt of Write opening
+ SvFileStream( const String& rFileName, StreamMode eOpenMode );
+ SvFileStream();
+ ~SvFileStream();
+
+ virtual void ResetError();
+
+ void Open( const String& rFileName, StreamMode eOpenMode );
+ void Close();
+ sal_Bool IsOpen() const { return bIsOpen; }
+ sal_Bool IsLocked() const { return ( nLockCounter!=0 ); }
+ virtual sal_uInt16 IsA() const;
+
+ const String& GetFileName() const { return aFilename; }
+};
+
+// MemoryStream
+
+class TOOLS_DLLPUBLIC SvMemoryStream : public SvStream
+{
+ // Forbidden and not implemented.
+ SvMemoryStream (const SvMemoryStream&);
+ SvMemoryStream & operator= (const SvMemoryStream&);
+
+ friend class SvCacheStream;
+ sal_Size GetSize() const { return nSize; }
+
+protected:
+ sal_Size nSize;
+ sal_Size nResize;
+ sal_Size nPos;
+ sal_Size nEndOfData;
+ sal_uInt8* pBuf;
+ sal_Bool bOwnsData;
+
+ virtual sal_Size GetData( void* pData, sal_Size nSize );
+ virtual sal_Size PutData( const void* pData, sal_Size nSize );
+ virtual sal_Size SeekPos( sal_Size nPos );
+ virtual void SetSize( sal_Size nSize );
+ virtual void FlushData();
+
+ /// AllocateMemory must update pBuf accordingly
+ /// - pBuf: Address of new block
+ virtual sal_Bool AllocateMemory( sal_Size nSize );
+
+ /// ReAllocateMemory must update the following variables:
+ /// - pBuf: Address of new block
+ /// - nEndOfData: Set to nNewSize-1L , if outside of block
+ /// Set to 0 , if new block size is 0 bytes
+ /// - nSize: New block size
+ /// - nPos: Set to 0 if position outside of block
+ virtual sal_Bool ReAllocateMemory( long nDiff );
+
+ /// Is called when this stream allocated the buffer or the buffer is
+ /// resized. FreeMemory may need to NULLify handles in derived classes.
+ virtual void FreeMemory();
+
+ SvMemoryStream(void*) { } // for sub-classes
+
+public:
+ SvMemoryStream( void* pBuf, sal_Size nSize, StreamMode eMode);
+ SvMemoryStream( sal_Size nInitSize=512, sal_Size nResize=64 );
+ ~SvMemoryStream();
+
+ virtual void ResetError();
+
+ sal_Size GetEndOfData() const { return nEndOfData; }
+ const void* GetData() { Flush(); return pBuf; }
+ operator const void*() { Flush(); return pBuf; }
+ virtual sal_uInt16 IsA() const;
+
+ void* SwitchBuffer( sal_Size nInitSize=512, sal_Size nResize=64 );
+ void* SetBuffer( void* pBuf, sal_Size nSize,
+ sal_Bool bOwnsData=sal_True, sal_Size nEOF=0 );
+
+ void ObjectOwnsMemory( sal_Bool bOwn ) { bOwnsData = bOwn; }
+ sal_Bool IsObjectMemoryOwner() { return bOwnsData; }
+ void SetResizeOffset( sal_Size nNewResize ) { nResize = nNewResize; }
+ sal_Size GetResizeOffset() const { return nResize; }
+ virtual sal_Size remainingSize() { return GetSize() - Tell(); }
+};
+
+/** Data Copy Stream
+
+ This class is the foundation for all classes, using SvData
+ (SO2\DTRANS.HXX/CXX) for transportation (e.g., graphics).
+*/
+class TOOLS_DLLPUBLIC SvDataCopyStream
+{
+public:
+ // repeated execution of Load or Assign is allowed
+ TYPEINFO();
+ virtual ~SvDataCopyStream(){}
+ virtual void Load( SvStream & ) = 0;
+ virtual void Save( SvStream & ) = 0;
+ virtual void Assign( const SvDataCopyStream & );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
new file mode 100644
index 000000000000..5efcd3e3d933
--- /dev/null
+++ b/include/tools/string.hxx
@@ -0,0 +1,411 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _STRING_HXX
+#define _STRING_HXX
+
+#include <tools/solar.h>
+#include <osl/thread.h>
+#include <rtl/textenc.h>
+#include <rtl/textcvt.h>
+#include <rtl/ustrbuf.h>
+#include <rtl/string.hxx>
+#include <rtl/ustring.hxx>
+#include "tools/toolsdllapi.h"
+#include "tools/lineend.hxx"
+
+/*******************************************************************************
+ *
+ * THIS CODE IS DEPRECATED. DO NOT USE IT IN ANY NEW CODE.
+ *
+ * Use the string classes in rtl/ustring.hxx and rtl/ustrbuf.hxx (and
+ * rtl/string.hxx and rtl/strbuf.hxx for byte-sized strings) instead. If you
+ * feel functionality missing from those string classes, please request
+ * improvements on discuss@openoffice.org.
+ *
+ * There will not be any fixes to the code here.
+ ******************************************************************************/
+
+class ResId;
+class String;
+class UniString;
+
+#define BYTESTRING_TO_UNISTRING_CVTFLAGS (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |\
+ RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |\
+ RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT)
+
+// CharSet
+
+#ifndef ENUM_CHARSET_DECLARED
+#define ENUM_CHARSET_DECLARED
+
+typedef rtl_TextEncoding CharSet;
+
+#endif
+
+// String-Types
+
+#ifdef STRING32
+#define STRING_NOTFOUND ((xub_StrLen)0x7FFFFFFF)
+#define STRING_MATCH ((xub_StrLen)0x7FFFFFFF)
+#define STRING_LEN ((xub_StrLen)0x7FFFFFFF)
+#define STRING_MAXLEN ((xub_StrLen)0x7FFFFFFF)
+#else
+#define STRING_NOTFOUND ((xub_StrLen)0xFFFF)
+#define STRING_MATCH ((xub_StrLen)0xFFFF)
+#define STRING_LEN ((xub_StrLen)0xFFFF)
+#define STRING_MAXLEN ((xub_StrLen)0xFFFF)
+#endif
+
+enum StringCompare { COMPARE_LESS = -1, COMPARE_EQUAL = 0, COMPARE_GREATER = 1 };
+
+//Internal String data
+
+// Data used for the management of this String
+// use only for debugging purposes (never assign to String directly!)
+
+#ifdef SAL_W32
+#pragma pack(push, 4)
+#endif
+
+typedef struct _UniStringData
+{
+ sal_Int32 mnRefCount; // reference counter
+ sal_Int32 mnLen; // Length of the String
+ sal_Unicode maStr[1]; // CharArray (String)
+} UniStringData;
+
+#ifdef SAL_W32
+#pragma pack(pop)
+#endif
+
+// UniString
+
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED UniString
+{
+private:
+ UniStringData* mpData;
+
+ TOOLS_DLLPRIVATE inline void ImplCopyData();
+ TOOLS_DLLPRIVATE inline sal_Unicode * ImplCopyStringData(sal_Unicode *);
+
+ UniString( const int* pDummy ); // not implemented: to prevent UniString( NULL )
+ UniString(int); // not implemented; to detect misuses of
+ // UniString(sal_Unicode)
+ void Assign(int); // not implemented; to detect misuses of
+ // Assign(sal_Unicode)
+ void operator =(int); // not implemented; to detect misuses
+ // of operator =(sal_Unicode)
+ void Append(int); // not implemented; to detect misuses of
+ // Append(sal_Unicode)
+ void operator +=(int); // not implemented; to detect misuses
+ // of operator +=(sal_Unicode)
+
+ //detect and reject use of RTL_CONSTASCII_STRINGPARAM instead of RTL_CONSTASCII_USTRINGPARAM
+ TOOLS_DLLPRIVATE UniString( const sal_Char*, sal_Int32 );
+
+ //detect and reject wrong way to attempt to create a UniString from a substring of
+ //a OString
+ TOOLS_DLLPRIVATE UniString(const OString& rByteStr, xub_StrLen nPos, xub_StrLen nLen,
+ sal_uInt32 nCvtFlags = BYTESTRING_TO_UNISTRING_CVTFLAGS);
+
+ //no longer implemented
+ TOOLS_DLLPRIVATE UniString( const OString& rByteStr,
+ rtl_TextEncoding eTextEncoding,
+ sal_uInt32 nCvtFlags = BYTESTRING_TO_UNISTRING_CVTFLAGS );
+ TOOLS_DLLPRIVATE UniString( const sal_Unicode* pCharStr );
+ TOOLS_DLLPRIVATE UniString( const sal_Unicode* pCharStr, xub_StrLen nLen );
+ TOOLS_DLLPRIVATE UniString( sal_Unicode c );
+ TOOLS_DLLPRIVATE UniString& Assign( const sal_Unicode* pCharStr, xub_StrLen nLen );
+ TOOLS_DLLPRIVATE UniString& Expand( xub_StrLen nCount, sal_Unicode cExpandChar );
+public:
+ UniString();
+ UniString( const ResId& rResId );
+ UniString( const UniString& rStr );
+ UniString( const UniString& rStr, xub_StrLen nPos, xub_StrLen nLen );
+ UniString( const OUString& rStr );
+ UniString(char c); // ...but allow "UniString('a')"
+ UniString( const sal_Char* pByteStr,
+ rtl_TextEncoding eTextEncoding,
+ sal_uInt32 nCvtFlags = BYTESTRING_TO_UNISTRING_CVTFLAGS );
+ UniString( const sal_Char* pByteStr, xub_StrLen nLen,
+ rtl_TextEncoding eTextEncoding,
+ sal_uInt32 nCvtFlags = BYTESTRING_TO_UNISTRING_CVTFLAGS );
+ ~UniString();
+
+ operator OUString () const
+ {
+ return OUString( rtl_uStringBuffer_refReturn(
+ reinterpret_cast<rtl_uString*>(mpData)), SAL_NO_ACQUIRE );
+ }
+
+#ifdef RTL_FAST_STRING
+ template< typename T1, typename T2 >
+ UniString( const rtl::OUStringConcat< T1, T2 >& concat )
+ : mpData(NULL) { Assign( OUString( concat )); }
+ template< typename T1, typename T2 >
+ UniString& operator =( const rtl::OUStringConcat< T1, T2 >& concat )
+ { return Assign( OUString( concat )); }
+ template< typename T1, typename T2 >
+ UniString& operator +=( const rtl::OUStringConcat< T1, T2 >& concat )
+ { return Append( UniString( concat ) ); }
+#endif
+
+ static const UniString& EmptyString();
+ sal_Int32 ToInt32() const;
+ sal_Int64 ToInt64() const;
+
+ UniString& Assign( const UniString& rStr );
+ UniString& Assign( const OUString& rStr );
+ UniString& Assign( const sal_Unicode* pCharStr );
+ UniString& Assign( sal_Unicode c );
+ inline UniString & Assign(char c) // ...but allow "Assign('a')"
+ { return Assign(static_cast< sal_Unicode >(c)); }
+ UniString& AssignAscii( const sal_Char* pAsciiStr );
+ UniString& AssignAscii( const sal_Char* pAsciiStr, xub_StrLen nLen );
+ UniString& operator =( const UniString& rStr )
+ { return Assign( rStr ); }
+ UniString& operator =( const OUString& rStr )
+ { return Assign( rStr ); }
+ UniString& operator =( const sal_Unicode* pCharStr )
+ { return Assign( pCharStr ); }
+ UniString& operator =( sal_Unicode c )
+ { return Assign( c ); }
+ inline UniString & operator =(char c) // ...but allow "= 'a'"
+ { return operator =(static_cast< sal_Unicode >(c)); }
+
+ UniString& Append( const UniString& rStr );
+ UniString& Append( const sal_Unicode* pCharStr );
+ UniString& Append( const sal_Unicode* pCharStr, xub_StrLen nLen );
+ UniString& Append( sal_Unicode c );
+ inline UniString & Append(char c) // ...but allow "Append('a')"
+ { return Append(static_cast< sal_Unicode >(c)); }
+ UniString& AppendAscii( const sal_Char* pAsciiStr );
+ UniString& AppendAscii( const sal_Char* pAsciiStr, xub_StrLen nLen );
+ UniString& operator +=( const UniString& rStr )
+ { return Append( rStr ); }
+ UniString& operator +=( const OUString& rStr )
+ { return Append( UniString(rStr) ); }
+ UniString& operator +=( const sal_Unicode* pCharStr )
+ { return Append( pCharStr ); }
+ UniString& operator +=( sal_Unicode c )
+ { return Append( c ); }
+ inline UniString & operator +=(char c) // ...but allow "+= 'a'"
+ { return operator +=(static_cast< sal_Unicode >(c)); }
+
+ void SetChar( xub_StrLen nIndex, sal_Unicode c );
+ sal_Unicode GetChar( xub_StrLen nIndex ) const
+ { return mpData->maStr[nIndex]; }
+
+ xub_StrLen Len() const { return (xub_StrLen)mpData->mnLen; }
+
+ UniString& Insert( const UniString& rStr, xub_StrLen nIndex = STRING_LEN );
+ UniString& Insert( const UniString& rStr, xub_StrLen nPos, xub_StrLen nLen,
+ xub_StrLen nIndex = STRING_LEN );
+ UniString& Insert( sal_Unicode c, xub_StrLen nIndex = STRING_LEN );
+ UniString& InsertAscii( const sal_Char* pAsciiStr, xub_StrLen nIndex = STRING_LEN );
+ UniString& Replace( xub_StrLen nIndex, xub_StrLen nLen, const UniString& rStr );
+ UniString& ReplaceAscii( xub_StrLen nIndex, xub_StrLen nLen,
+ const sal_Char* pAsciiStr, xub_StrLen nStrLen = STRING_LEN );
+ UniString& Erase( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN );
+ UniString Copy( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN ) const;
+
+ UniString& ToLowerAscii();
+ UniString& ToUpperAscii();
+
+ StringCompare CompareTo( const UniString& rStr,
+ xub_StrLen nLen = STRING_LEN ) const;
+ StringCompare CompareToAscii( const sal_Char* pAsciiStr,
+ xub_StrLen nLen = STRING_LEN ) const;
+ StringCompare CompareIgnoreCaseToAscii( const UniString& rStr,
+ xub_StrLen nLen = STRING_LEN ) const;
+ StringCompare CompareIgnoreCaseToAscii( const sal_Char* pAsciiStr,
+ xub_StrLen nLen = STRING_LEN ) const;
+ sal_Bool Equals( const UniString& rStr ) const;
+ sal_Bool EqualsAscii( const sal_Char* pAsciiStr ) const;
+ sal_Bool EqualsIgnoreCaseAscii( const UniString& rStr ) const;
+ sal_Bool EqualsIgnoreCaseAscii( const sal_Unicode* pCharStr ) const;
+ sal_Bool EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr ) const;
+ sal_Bool Equals( const UniString& rStr,
+ xub_StrLen nIndex, xub_StrLen nLen ) const;
+ sal_Bool Equals( const sal_Unicode* pCharStr,
+ xub_StrLen nIndex, xub_StrLen nLen ) const;
+ sal_Bool EqualsAscii( const sal_Char* pAsciiStr,
+ xub_StrLen nIndex, xub_StrLen nLen ) const;
+ sal_Bool EqualsIgnoreCaseAscii( const UniString& rStr,
+ xub_StrLen nIndex, xub_StrLen nLen ) const;
+ sal_Bool EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr,
+ xub_StrLen nIndex, xub_StrLen nLen ) const;
+
+ xub_StrLen Match( const UniString& rStr ) const;
+
+ xub_StrLen Search( sal_Unicode c, xub_StrLen nIndex = 0 ) const;
+ xub_StrLen Search( const UniString& rStr, xub_StrLen nIndex = 0 ) const;
+ xub_StrLen Search( const sal_Unicode* pCharStr, xub_StrLen nIndex = 0 ) const;
+ xub_StrLen SearchAscii( const sal_Char* pAsciiStr, xub_StrLen nIndex = 0 ) const;
+ xub_StrLen SearchBackward( sal_Unicode c, xub_StrLen nIndex = STRING_LEN ) const;
+ xub_StrLen SearchChar( const sal_Unicode* pChars, xub_StrLen nIndex = 0 ) const;
+
+ xub_StrLen SearchAndReplace( sal_Unicode c, sal_Unicode cRep,
+ xub_StrLen nIndex = 0 );
+ xub_StrLen SearchAndReplace( const UniString& rStr, const UniString& rRepStr,
+ xub_StrLen nIndex = 0 );
+ xub_StrLen SearchAndReplaceAscii( const sal_Char* pAsciiStr, const UniString& rRepStr,
+ xub_StrLen nIndex = 0 );
+ void SearchAndReplaceAll( sal_Unicode c, sal_Unicode cRep );
+ void SearchAndReplaceAll( const UniString& rStr, const UniString& rRepStr );
+ void SearchAndReplaceAllAscii( const sal_Char* pAsciiStr, const UniString& rRepStr );
+
+ void SetToken( xub_StrLen nToken, sal_Unicode cTok, const UniString& rStr,
+ xub_StrLen nIndex = 0 );
+ UniString GetToken( xub_StrLen nToken, sal_Unicode cTok, sal_Int32& rIndex ) const;
+ UniString GetToken( xub_StrLen nToken, sal_Unicode cTok = ';' ) const;
+
+ const sal_Unicode* GetBuffer() const { return mpData->maStr; }
+ sal_Unicode* GetBufferAccess();
+ void ReleaseBufferAccess( xub_StrLen nLen = STRING_LEN );
+ sal_Unicode* AllocBuffer( xub_StrLen nLen );
+
+ friend sal_Bool operator == ( const UniString& rStr1, const UniString& rStr2 )
+ { return rStr1.Equals( rStr2 ); }
+ friend sal_Bool operator != ( const UniString& rStr1, const UniString& rStr2 )
+ { return !(operator == ( rStr1, rStr2 )); }
+ friend sal_Bool operator < ( const UniString& rStr1, const UniString& rStr2 )
+ { return (rStr1.CompareTo( rStr2 ) == COMPARE_LESS); }
+ friend sal_Bool operator > ( const UniString& rStr1, const UniString& rStr2 )
+ { return (rStr1.CompareTo( rStr2 ) == COMPARE_GREATER); }
+ friend sal_Bool operator <= ( const UniString& rStr1, const UniString& rStr2 )
+ { return !(operator > ( rStr1, rStr2 )); }
+ friend sal_Bool operator >= ( const UniString& rStr1, const UniString& rStr2 )
+ { return !(operator < ( rStr1, rStr2 )); }
+};
+
+inline UniString UniString::Copy( xub_StrLen nIndex, xub_StrLen nCount ) const
+{
+ return UniString( *this, nIndex, nCount );
+}
+
+inline UniString UniString::GetToken( xub_StrLen nToken, sal_Unicode cTok ) const
+{
+ sal_Int32 nTempPos = 0;
+ return GetToken( nToken, cTok, nTempPos );
+}
+
+template< typename charT, typename traits > std::basic_ostream<charT, traits> &
+operator <<(
+ std::basic_ostream<charT, traits> & stream, UniString const & string)
+{
+ return stream <<
+ OUStringToOString(string, RTL_TEXTENCODING_UTF8).getStr();
+ // best effort; potentially loses data due to conversion failures
+ // (stray surrogate halves) and embedded null characters
+}
+
+#ifdef RTL_FAST_STRING
+namespace rtl
+{
+template<>
+struct ToStringHelper< UniString >
+ {
+ static int length( const UniString& s ) { return s.Len(); }
+ static sal_Unicode* addData( sal_Unicode* buffer, const UniString& s ) { return addDataHelper( buffer, s.GetBuffer(), s.Len()); }
+ static const bool allowOStringConcat = false;
+ static const bool allowOUStringConcat = true;
+ };
+}
+
+#endif
+
+// some compare operators, so that conversions from String to OUString don't
+// have to insert conversions all over the place
+inline bool operator==(UniString const& rLeft, OUString const& rRight)
+{
+ return OUString(rLeft) == rRight;
+}
+
+inline bool operator==(OUString const& rLeft, UniString const& rRight)
+{
+ return rLeft == OUString(rRight);
+}
+
+inline bool operator!=(UniString const& rLeft, OUString const& rRight)
+{
+ return OUString(rLeft) != rRight;
+}
+
+inline bool operator!=(OUString const& rLeft, UniString const& rRight)
+{
+ return rLeft != OUString(rRight);
+}
+
+#ifdef RTL_FAST_STRING
+// The above operators make comparisons involving fast string concatenation ambiguous, so provide explicit overloads.
+template< typename T1, typename T2 >
+inline bool operator==( const rtl::OUStringConcat< T1, T2 >& concat, const OUString& str )
+{
+ return OUString( concat ) == str;
+}
+
+template< typename T1, typename T2 >
+inline bool operator!=( const rtl::OUStringConcat< T1, T2 >& concat, const OUString& str )
+{
+ return OUString( concat ) == str;
+}
+
+template< typename T1, typename T2 >
+inline bool operator==( const OUString& str, const rtl::OUStringConcat< T1, T2 >& concat )
+{
+ return str == OUString( concat );
+}
+
+template< typename T1, typename T2 >
+inline bool operator!=( const OUString& str, const rtl::OUStringConcat< T1, T2 >& concat )
+{
+ return str != OUString( concat );
+}
+
+template< typename T1, typename T2 >
+inline bool operator==( const rtl::OUStringConcat< T1, T2 >& concat, const UniString& str )
+{
+ return UniString( concat ) == str;
+}
+
+template< typename T1, typename T2 >
+inline bool operator!=( const rtl::OUStringConcat< T1, T2 >& concat, const UniString& str )
+{
+ return UniString( concat ) == str;
+}
+
+template< typename T1, typename T2 >
+inline bool operator==( const UniString& str, const rtl::OUStringConcat< T1, T2 >& concat )
+{
+ return str == UniString( concat );
+}
+
+template< typename T1, typename T2 >
+inline bool operator!=( const UniString& str, const rtl::OUStringConcat< T1, T2 >& concat )
+{
+ return str != UniString( concat );
+}
+
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/svborder.hxx b/include/tools/svborder.hxx
new file mode 100644
index 000000000000..de4a8666cbd8
--- /dev/null
+++ b/include/tools/svborder.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 _SVBORDER_HXX
+#define _SVBORDER_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/gen.hxx>
+
+class TOOLS_DLLPUBLIC SvBorder
+{
+ long nTop, nRight, nBottom, nLeft;
+
+public:
+ SvBorder()
+ {
+ nTop = nRight = nBottom = nLeft = 0;
+ }
+ SvBorder( const Size & rSz )
+ {
+ nTop = nBottom = rSz.Height();
+ nRight = nLeft = rSz.Width();
+ }
+ SvBorder( long nLeftP, long nTopP, long nRightP, long nBottomP )
+ {
+ nLeft = nLeftP;
+ nTop = nTopP;
+ nRight = nRightP;
+ nBottom = nBottomP;
+ }
+ sal_Bool operator == ( const SvBorder & rObj ) const
+ {
+ return nTop == rObj.nTop && nRight == rObj.nRight &&
+ nBottom == rObj.nBottom && nLeft == rObj.nLeft;
+ }
+ sal_Bool operator != ( const SvBorder & rObj ) const
+ { return !(*this == rObj); }
+ SvBorder & operator = ( const SvBorder & rBorder )
+ {
+ Left() = rBorder.Left();
+ Top() = rBorder.Top();
+ Right() = rBorder.Right();
+ Bottom() = rBorder.Bottom();
+ return *this;
+ }
+ SvBorder & operator += ( const SvBorder & rBorder )
+ {
+ Left() += rBorder.Left();
+ Top() += rBorder.Top();
+ Right() += rBorder.Right();
+ Bottom() += rBorder.Bottom();
+ return *this;
+ }
+ SvBorder & operator -= ( const SvBorder & rBorder )
+ {
+ Left() -= rBorder.Left();
+ Top() -= rBorder.Top();
+ Right() -= rBorder.Right();
+ Bottom() -= rBorder.Bottom();
+ return *this;
+ }
+ sal_Bool IsInside( const SvBorder & rInside )
+ {
+ return nTop >= rInside.nTop && nRight >= rInside.nRight &&
+ nBottom >= rInside.nBottom && nLeft >= rInside.nLeft;
+ }
+ long & Top() { return nTop; }
+ long & Right() { return nRight; }
+ long & Bottom() { return nBottom; }
+ long & Left() { return nLeft; }
+ long Top() const { return nTop; }
+ long Right() const { return nRight; }
+ long Bottom() const { return nBottom; }
+ long Left() const { return nLeft; }
+};
+
+TOOLS_DLLPUBLIC Rectangle & operator += ( Rectangle & rRect, const SvBorder & rBorder );
+TOOLS_DLLPUBLIC Rectangle & operator -= ( Rectangle & rRect, const SvBorder & rBorder );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/tempfile.hxx b/include/tools/tempfile.hxx
new file mode 100644
index 000000000000..8ef8c574cf7c
--- /dev/null
+++ b/include/tools/tempfile.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 _TOOLS_TEMPFILE_HXX
+#define _TOOLS_TEMPFILE_HXX
+
+#include <tools/string.hxx>
+#include "tools/toolsdllapi.h"
+
+struct TempFile_Impl;
+class TOOLS_DLLPUBLIC TempFile
+{
+ TempFile_Impl* pImp;
+ sal_Bool bKillingFileEnabled;
+
+public:
+ /** Create a temporary file in the default tempfile folder. */
+ TempFile();
+
+ /** Create a temporary file in the default tempfile folder; its name starts
+ with some given characters followed by a counter ( example:
+ rLeadingChars="abc" means "abc0", "abc1" and so on, depending on
+ existing files in that folder ).
+
+ The extension string may be f.e. ".txt" or "", if no extension string is
+ given, ".tmp" is used.
+ */
+ TempFile( const String& rLeadingChars, const String* pExtension=NULL );
+
+ /** TempFile will be removed from disk in dtor if EnableKillingTempFile was
+ called before. TempDirs will be removed recursively in that case. */
+ ~TempFile();
+
+ sal_Bool IsValid() const;
+
+ /** Returns the real name of the tempfile in file URL scheme. */
+ String GetName() const;
+
+ /** If enabled the file will be removed from disk when the dtor is called
+ (default is not enabled) */
+ void EnableKillingFile( sal_Bool bEnable=sal_True ) { bKillingFileEnabled = bEnable; }
+
+ sal_Bool IsKillingFileEnabled() const { return bKillingFileEnabled; }
+
+ /** Only create a name for a temporary file that would be valid at that moment. */
+ static String CreateTempName();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/tenccvt.hxx b/include/tools/tenccvt.hxx
new file mode 100644
index 000000000000..9cae3a79927f
--- /dev/null
+++ b/include/tools/tenccvt.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 _TOOLS_TENCCVT_HXX
+#define _TOOLS_TENCCVT_HXX
+
+#include <rtl/textenc.h>
+#include "tools/toolsdllapi.h"
+
+// Functions for handling Import/Export
+
+/// return an encoding which has more defined Characters as the given
+/// encoding, but have the same definition for the defined characters
+/// e.g.: windows-1252 for iso-8859-1 or windows-1254 for iso-8859-9
+TOOLS_DLLPUBLIC rtl_TextEncoding GetExtendedCompatibilityTextEncoding( rtl_TextEncoding eEncoding );
+
+/// return an encoding which has more defined Characters as the given
+/// encoding. The encodings could be different.
+/// e.g.: windows-1251 for iso-8859-5
+TOOLS_DLLPUBLIC rtl_TextEncoding GetExtendedTextEncoding( rtl_TextEncoding eEncoding );
+
+/// if the given encoding is an multi-byte encoding (which allows more than
+/// one byte per char, e.g. UTF-8 or Shift-JIS), a one-byte encoding
+/// is returned (normally windows-1252).
+TOOLS_DLLPUBLIC rtl_TextEncoding GetOneByteTextEncoding( rtl_TextEncoding eEncoding );
+
+TOOLS_DLLPUBLIC rtl_TextEncoding GetSOLoadTextEncoding( rtl_TextEncoding eEncoding );
+TOOLS_DLLPUBLIC rtl_TextEncoding GetSOStoreTextEncoding( rtl_TextEncoding eEncoding );
+
+/**
+ * Given a Unicode character, return a legacy Microsoft Encoding which
+ * supports it. Returns RTL_TEXTENCODING_DONTKNOW if there is
+ * no encoding which could support the character
+ *
+ * Useful as a utility to categorize unicode characters into the best fit
+ * windows charset range for exporting to ww6 & wmf or as a hint to non \u
+ * unicode token aware rtf readers
+ */
+TOOLS_DLLPUBLIC rtl_TextEncoding getBestMSEncodingByChar(sal_Unicode c);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/time.hxx b/include/tools/time.hxx
new file mode 100644
index 000000000000..64751af42284
--- /dev/null
+++ b/include/tools/time.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 _TOOLS_TIME_HXX
+#define _TOOLS_TIME_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/solar.h>
+
+class ResId;
+
+/**
+ @WARNING: This class can serve both as wall clock time and time duration, and
+ the mixing of these concepts leads to problems such as there being
+ 25 hours or 10 minus 20 seconds being (non-negative) 10 seconds.
+*/
+
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Time
+{
+private:
+ sal_Int64 nTime;
+
+public:
+ enum TimeInitSystem
+ {
+ SYSTEM
+ };
+
+ // temporary until all uses are inspected and resolved
+ enum TimeInitEmpty
+ {
+ EMPTY
+ };
+ static const sal_Int64 hourPerDay = 24;
+ static const sal_Int64 minutePerHour = 60;
+ static const sal_Int64 secondPerMinute = 60;
+ static const sal_Int64 nanoSecPerSec = 1000000000;
+ static const sal_Int64 nanoSecPerMinute = nanoSecPerSec * secondPerMinute;
+ static const sal_Int64 nanoSecPerHour = nanoSecPerSec * secondPerMinute * minutePerHour;
+ static const sal_Int64 nanoSecPerDay = nanoSecPerSec * secondPerMinute * minutePerHour * hourPerDay;
+ static const sal_Int64 secondPerHour = secondPerMinute * minutePerHour;
+ static const sal_Int64 secondPerDay = secondPerMinute * minutePerHour * hourPerDay;
+ static const sal_Int64 minutePerDay = minutePerHour * hourPerDay;
+ static const sal_Int64 nanoPerMicro = 1000;
+ static const sal_Int64 nanoPerMilli = 1000000;
+ static const sal_Int64 nanoPerCenti = 10000000;
+
+ Time( TimeInitEmpty )
+ { nTime = 0; }
+ Time( TimeInitSystem );
+ Time( const ResId & rResId );
+ Time( sal_Int64 _nTime ) { Time::nTime = _nTime; }
+ Time( const Time& rTime );
+ Time( sal_uInt32 nHour, sal_uInt32 nMin,
+ sal_uInt32 nSec = 0, sal_uInt64 nNanoSec = 0 );
+
+ void SetTime( sal_Int64 nNewTime ) { nTime = nNewTime; }
+ sal_Int64 GetTime() const { return nTime; }
+
+ void SetHour( sal_uInt16 nNewHour );
+ void SetMin( sal_uInt16 nNewMin );
+ void SetSec( sal_uInt16 nNewSec );
+ void SetNanoSec( sal_uInt32 nNewNanoSec );
+ sal_uInt16 GetHour() const
+ { sal_uInt64 nTempTime = (nTime >= 0) ? nTime : -nTime;
+ return static_cast<sal_uInt16>(nTempTime / SAL_CONST_UINT64(10000000000000)); }
+ sal_uInt16 GetMin() const
+ { sal_uInt64 nTempTime = (nTime >= 0) ? nTime : -nTime;
+ return static_cast<sal_uInt16>((nTempTime / SAL_CONST_UINT64(100000000000)) % 100); }
+ sal_uInt16 GetSec() const
+ { sal_uInt64 nTempTime = (nTime >= 0) ? nTime : -nTime;
+ return static_cast<sal_uInt16>((nTempTime / SAL_CONST_UINT64(1000000000)) % 100); }
+ sal_uInt32 GetNanoSec() const
+ { sal_uInt64 nTempTime = (nTime >= 0) ? nTime : -nTime;
+ return static_cast<sal_uInt32>( nTempTime % SAL_CONST_UINT64(1000000000)); }
+
+ // TODO: consider removing GetMSFromTime and MakeTimeFromMS?
+ sal_Int32 GetMSFromTime() const;
+ void MakeTimeFromMS( sal_Int32 nMS );
+ sal_Int64 GetNSFromTime() const;
+ void MakeTimeFromNS( sal_Int64 nNS );
+
+ /// 12 hours == 0.5 days
+ double GetTimeInDays() const;
+
+ sal_Bool IsBetween( const Time& rFrom, const Time& rTo ) const
+ { return ((nTime >= rFrom.nTime) && (nTime <= rTo.nTime)); }
+
+ sal_Bool IsEqualIgnoreNanoSec( const Time& rTime ) const;
+
+ sal_Bool operator ==( const Time& rTime ) const
+ { return (nTime == rTime.nTime); }
+ sal_Bool operator !=( const Time& rTime ) const
+ { return (nTime != rTime.nTime); }
+ sal_Bool operator >( const Time& rTime ) const
+ { return (nTime > rTime.nTime); }
+ sal_Bool operator <( const Time& rTime ) const
+ { return (nTime < rTime.nTime); }
+ sal_Bool operator >=( const Time& rTime ) const
+ { return (nTime >= rTime.nTime); }
+ sal_Bool operator <=( const Time& rTime ) const
+ { return (nTime <= rTime.nTime); }
+
+ static Time GetUTCOffset();
+ static sal_uIntPtr GetSystemTicks(); // Elapsed time
+
+ void ConvertToUTC() { *this -= Time::GetUTCOffset(); }
+ void ConvertToLocalTime() { *this += Time::GetUTCOffset(); }
+
+ Time& operator =( const Time& rTime );
+ Time operator -() const
+ { return Time( -nTime ); }
+ Time& operator +=( const Time& rTime );
+ Time& operator -=( const Time& rTime );
+ TOOLS_DLLPUBLIC friend Time operator +( const Time& rTime1, const Time& rTime2 );
+ TOOLS_DLLPUBLIC friend Time operator -( const Time& rTime1, const Time& rTime2 );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/tools.h b/include/tools/tools.h
new file mode 100644
index 000000000000..c015042d6d42
--- /dev/null
+++ b/include/tools/tools.h
@@ -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 _TOOLS_H
+#define _TOOLS_H
+
+#include "tools/toolsdllapi.h"
+#include <tools/solar.h>
+
+// Methoden, die von VCL gerufen werden muessen
+TOOLS_DLLPUBLIC void InitTools();
+TOOLS_DLLPUBLIC void DeInitTools();
+TOOLS_DLLPUBLIC void GlobalDeInitTools();
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/toolsdllapi.h b/include/tools/toolsdllapi.h
new file mode 100644
index 000000000000..6e72930e3bc0
--- /dev/null
+++ b/include/tools/toolsdllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_TOOLSDLLAPI_H
+#define INCLUDED_TOOLSDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(TOOLS_DLLIMPLEMENTATION)
+#define TOOLS_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define TOOLS_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define TOOLS_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/unqidx.hxx b/include/tools/unqidx.hxx
new file mode 100644
index 000000000000..3a3ba979d092
--- /dev/null
+++ b/include/tools/unqidx.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 _UNQIDX_HXX
+#define _UNQIDX_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/solar.h>
+#include <tools/contnr.hxx>
+#include <map>
+
+#define UNIQUEINDEX_ENTRY_NOTFOUND CONTAINER_ENTRY_NOTFOUND
+
+class TOOLS_DLLPUBLIC SAL_WARN_UNUSED UniqueIndexImpl : public std::map<sal_uInt32, void*>
+{
+private:
+ sal_uIntPtr nStartIndex;
+ sal_uIntPtr nUniqIndex;
+ sal_uIntPtr nCount;
+
+public:
+ UniqueIndexImpl( sal_uIntPtr _nStartIndex = 0 )
+ : std::map<sal_uInt32, void*>(),
+ nStartIndex(_nStartIndex), nUniqIndex(_nStartIndex), nCount(0) {}
+
+ sal_uIntPtr Insert( void* p );
+ // insert value with key, replacing existing entry if necessary
+ void Insert( sal_uIntPtr aIndex, void* p );
+ void* Remove( sal_uIntPtr aIndex );
+ void* Get( sal_uIntPtr aIndex ) const;
+
+ sal_uIntPtr GetIndexOf( void* p ) const;
+ sal_uIntPtr FirstIndex() const;
+ sal_uIntPtr LastIndex() const;
+ sal_uIntPtr NextIndex( sal_uIntPtr aCurrIndex ) const;
+};
+
+template<typename T>
+class UniqueIndex : private UniqueIndexImpl
+{
+public:
+ UniqueIndex<T>( sal_uIntPtr _nStartIndex = 0 ) : UniqueIndexImpl(_nStartIndex) {}
+
+ sal_uIntPtr Insert(T* p) { return UniqueIndexImpl::Insert(p); }
+ void Insert(sal_uIntPtr aIdx, T* p) { return UniqueIndexImpl::Insert(aIdx, p); }
+ T* Get(sal_uIntPtr idx) const { return static_cast<T*>( UniqueIndexImpl::Get(idx) ); }
+ T* Remove(sal_uIntPtr idx) { return static_cast<T*>( UniqueIndexImpl::Remove(idx) ); }
+ sal_uIntPtr Count() const { return UniqueIndexImpl::size(); }
+ sal_uIntPtr GetIndexOf(T* p) const { return UniqueIndexImpl::GetIndexOf(p); }
+
+ using UniqueIndexImpl::FirstIndex;
+ using UniqueIndexImpl::LastIndex;
+ using UniqueIndexImpl::NextIndex;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx
new file mode 100644
index 000000000000..fef9f469c359
--- /dev/null
+++ b/include/tools/urlobj.hxx
@@ -0,0 +1,1783 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _URLOBJ_HXX
+#define _URLOBJ_HXX
+
+#include "tools/toolsdllapi.h"
+#include "com/sun/star/uno/Reference.hxx"
+#include "rtl/string.h"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/textenc.h"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star { namespace util {
+ class XStringWidth;
+} } } }
+
+// Special tokens:
+#define INET_PATH_TOKEN '/'
+#define INET_MARK_TOKEN '#'
+#define INET_HEX_ESCAPE '%'
+
+// Common URL prefixes for various schemes:
+#define INET_FTP_SCHEME "ftp://"
+#define INET_HTTP_SCHEME "http://"
+#define INET_HTTPS_SCHEME "https://"
+#define INET_FILE_SCHEME "file://"
+#define INET_MAILTO_SCHEME "mailto:"
+#define INET_NEWS_SCHEME "news:"
+#define INET_HID_SCHEME "hid:"
+
+#define URL_PREFIX_PRIV_SOFFICE "private:"
+enum
+{
+ URL_PREFIX_PRIV_SOFFICE_LEN
+ = RTL_CONSTASCII_LENGTH(URL_PREFIX_PRIV_SOFFICE)
+};
+
+#define URL_PREFIX_PRIV_OBSOLETE URL_PREFIX_PRIV_SOFFICE
+enum
+{
+ URL_PREFIX_PRIV_OBSOLETE_LEN
+ = RTL_CONSTASCII_LENGTH(URL_PREFIX_PRIV_OBSOLETE)
+};
+
+#define URL_PREFIX_PRIV_EXTERN "staroffice:"
+enum
+{
+ URL_PREFIX_PRIV_EXTERN_LEN = RTL_CONSTASCII_LENGTH(URL_PREFIX_PRIV_EXTERN)
+};
+
+// Schemes:
+enum INetProtocol
+{
+ INET_PROT_NOT_VALID = 0,
+ INET_PROT_FTP = 1,
+ INET_PROT_HTTP = 2,
+ INET_PROT_FILE = 3,
+ INET_PROT_MAILTO = 4,
+ INET_PROT_VND_SUN_STAR_WEBDAV = 5,
+ INET_PROT_NEWS = 6,
+ INET_PROT_PRIV_SOFFICE = 7,
+ INET_PROT_PRIVATE = INET_PROT_PRIV_SOFFICE, // obsolete
+ INET_PROT_VND_SUN_STAR_HELP = 8,
+ INET_PROT_HTTPS = 9,
+ INET_PROT_SLOT = 10,
+ INET_PROT_MACRO = 11,
+ INET_PROT_JAVASCRIPT = 12,
+ INET_PROT_IMAP = 13,
+ INET_PROT_POP3 = 14,
+ INET_PROT_DATA = 15,
+ INET_PROT_CID = 16,
+ INET_PROT_OUT = 17,
+ INET_PROT_VND_SUN_STAR_HIER = 18,
+ INET_PROT_VIM = 19,
+ INET_PROT_UNO = 20,
+ INET_PROT_COMPONENT = 21,
+ INET_PROT_VND_SUN_STAR_PKG = 22,
+ INET_PROT_LDAP = 23,
+ INET_PROT_DB = 24,
+ INET_PROT_VND_SUN_STAR_CMD = 25,
+ INET_PROT_TELNET = 27,
+ INET_PROT_VND_SUN_STAR_EXPAND = 28,
+ INET_PROT_VND_SUN_STAR_TDOC = 29,
+ INET_PROT_GENERIC = 30,
+ INET_PROT_SMB = 31,
+ INET_PROT_HID = 32,
+ INET_PROT_SFTP = 33,
+ INET_PROT_CMIS = 34,
+ INET_PROT_END = 35
+};
+
+class TOOLS_DLLPUBLIC INetURLObject
+{
+public:
+ // Get- and Set-Methods:
+
+ /** The way input strings that represent (parts of) URIs are interpreted
+ in set-methods.
+
+ @descr Most set-methods accept either a OString or a OUString
+ as input. Using a OString, octets in the range 0x80--0xFF are
+ replaced by single escape sequences. Using a OUString , UTF-32
+ characters in the range 0x80--0x10FFFF are replaced by sequences of
+ escape sequences, representing the UTF-8 coded characters.
+
+ @descr Along with an EncodeMechanism parameter, the set-methods all
+ take an rtl_TextEncoding parameter, which is ignored unless the
+ EncodeMechanism is WAS_ENCODED.
+ */
+ enum EncodeMechanism
+ {
+ /** All escape sequences that are already present are ignored, and are
+ interpreted as literal sequences of three characters.
+ */
+ ENCODE_ALL,
+
+ /** Sequences of escape sequences, that represent characters from the
+ specified character set and that can be converted to UTF-32
+ characters, are first decoded. If they have to be encoded, they
+ are converted to UTF-8 characters and are than translated into
+ (sequences of) escape sequences. Other escape sequences are
+ copied verbatim (but using upper case hex digits).
+ */
+ WAS_ENCODED,
+
+ /** All escape sequences that are already present are copied verbatim
+ (but using upper case hex digits).
+ */
+ NOT_CANONIC
+ };
+
+ /** The way strings that represent (parts of) URIs are returned from get-
+ methods.
+
+ @descr Along with a DecodeMechanism parameter, the get-methods all
+ take an rtl_TextEncoding parameter, which is ignored unless the
+ DecodeMechanism is DECODE_WITH_CHARSET or DECODE_UNAMBIGUOUS.
+ */
+ enum DecodeMechanism
+ {
+ /** The (part of the) URI is returned unchanged. Since URIs are
+ written using a subset of US-ASCII, the returned string is
+ guaranteed to contain only US-ASCII characters.
+ */
+ NO_DECODE,
+
+ /** All sequences of escape sequences that represent UTF-8 coded
+ UTF-32 characters with a numerical value greater than 0x7F, are
+ replaced by the respective UTF-16 characters. All other escape
+ sequences are not decoded.
+ */
+ DECODE_TO_IURI,
+
+ /** All (sequences of) escape sequences that represent characters from
+ the specified character set, and that can be converted to UTF-32,
+ are replaced by the respective UTF-16 characters. All other
+ escape sequences are not decoded.
+ */
+ DECODE_WITH_CHARSET,
+
+ /** All (sequences of) escape sequences that represent characters from
+ the specified character set, that can be converted to UTF-32, and
+ that (in the case of ASCII characters) can safely be decoded
+ without altering the meaning of the (part of the) URI, are
+ replaced by the respective UTF-16 characters. All other escape
+ sequences are not decoded.
+ */
+ DECODE_UNAMBIGUOUS
+ };
+
+ // General Structure:
+
+ inline INetURLObject():
+ m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP) {}
+
+ inline bool HasError() const { return m_eScheme == INET_PROT_NOT_VALID; }
+
+ inline OUString GetMainURL(DecodeMechanism eMechanism,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8) const
+ { return decode(m_aAbsURIRef, getEscapePrefix(), eMechanism, eCharset); }
+
+ OUString GetURLNoPass(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ const;
+
+ OUString GetURLNoMark(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ const;
+
+ OUString
+ getAbbreviated(com::sun::star::uno::Reference<
+ com::sun::star::util::XStringWidth > const &
+ rStringWidth,
+ sal_Int32 nWidth,
+ DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ const;
+
+ bool operator ==(INetURLObject const & rObject) const;
+
+ inline bool operator !=(INetURLObject const & rObject) const
+ { return !(*this == rObject); }
+
+ bool operator <(INetURLObject const & rObject) const;
+
+ inline bool operator >(INetURLObject const & rObject) const
+ { return rObject < *this; }
+
+ // Strict Parsing:
+
+ inline INetURLObject(const OString& rTheAbsURIRef,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ inline INetURLObject(OUString const & rTheAbsURIRef,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ inline bool SetURL(const OString& rTheAbsURIRef,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ inline bool SetURL(OUString const & rTheAbsURIRef,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ bool ConcatData(INetProtocol eTheScheme, OUString const & rTheUser,
+ OUString const & rThePassword,
+ OUString const & rTheHost, sal_uInt32 nThePort,
+ OUString const & rThePath,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ // Smart Parsing:
+
+ /** The supported notations for file system paths.
+ */
+ enum FSysStyle
+ {
+ /** VOS notation (e.g., "//server/dir/file").
+ */
+ FSYS_VOS = 0x1,
+
+ /** Unix notation (e.g., "/dir/file").
+ */
+ FSYS_UNX = 0x2,
+
+ /** DOS notation (e.g., "a:\dir\file" and "\\server\dir\file").
+ */
+ FSYS_DOS = 0x4,
+
+ /** Mac notation (e.g., "dir:file").
+ */
+ FSYS_MAC = 0x8,
+
+ /** Detect the used notation.
+
+ @descr For the following descriptions, please note that
+ whereas FSYS_DEFAULT includes all style bits, combinations of only
+ a few style bits are also possible, and are also described.
+
+ @descr When used to translate a file system path to a file URL,
+ the subset of the following productions for which the appropriate
+ style bit is set are checked in order (using the conventions of
+ RFC 2234, RFC 2396, and RFC 2732; UCS4 stands for any UCS4
+ character):
+
+ Production T1 (VOS local; FSYS_VOS only):
+ "//." ["/" *UCS4]
+ becomes
+ "file:///" *UCS4
+
+ Production T2 (VOS host; FSYS_VOS only):
+ "//" [host] ["/" *UCS4]
+ becomes
+ "file://" host "/" *UCS4
+
+ Production T3 (UNC; FSYS_DOS only):
+ "\\" [host] ["\" *UCS4]
+ becomes
+ "file://" host "/" *UCS4
+ replacing "\" by "/" within <*UCS4>
+
+ Production T4 (Unix-like DOS; FSYS_DOS only):
+ ALPHA ":" ["/" *UCS4]
+ becomes
+ "file:///" ALPHA ":/" *UCS4
+ replacing "\" by "/" within <*UCS4>
+
+ Production T5 (DOS; FSYS_DOS only):
+ ALPHA ":" ["\" *UCS4]
+ becomes
+ "file:///" ALPHA ":/" *UCS4
+ replacing "\" by "/" within <*UCS4>
+
+ Production T6 (any):
+ *UCS4
+ becomes
+ "file:///" *UCS4
+ replacing the delimiter by "/" within <*UCS4>. The delimiter is
+ that character from the set { "/", "\", ":" } which appears most
+ often in <*UCS4> (if FSYS_UNX is not among the style bits, "/"
+ is removed from the set; if FSYS_DOS is not among the style
+ bits, "\" is removed from the set; if FSYS_MAC is not among the
+ style bits, ":" is removed from the set). If two or more
+ characters appear the same number of times, the character
+ mentioned first in that set is chosen. If the first character
+ of <*UCS4> is the delimiter, that character is not copied.
+
+ @descr When used to translate a file URL to a file system path,
+ the following productions are checked in order (using the
+ conventions of RFC 2234, RFC 2396, and RFC 2732):
+
+ Production F1 (VOS; FSYS_VOS):
+ "file://" host "/" fpath ["#" fragment]
+ becomes
+ "//" host "/" fpath
+
+ Production F2 (DOS; FSYS_DOS):
+ "file:///" ALPHA ":" ["/" fpath] ["#" fragment]
+ becomes
+ ALPHA ":" ["\" fpath]
+ replacing "/" by "\" in <fpath>
+
+ Production F3 (Unix; FSYS_UNX):
+ "file:///" fpath ["#" fragment]
+ becomes
+ "/" fpath
+ */
+ FSYS_DETECT = FSYS_VOS | FSYS_UNX | FSYS_DOS
+ };
+
+ inline INetURLObject(OUString const & rTheAbsURIRef,
+ INetProtocol eTheSmartScheme,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ FSysStyle eStyle = FSYS_DETECT);
+
+ inline void SetSmartProtocol(INetProtocol eTheSmartScheme)
+ { m_eSmartScheme = eTheSmartScheme; }
+
+ inline bool
+ SetSmartURL(const OString& rTheAbsURIRef,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ FSysStyle eStyle = FSYS_DETECT);
+
+ inline bool
+ SetSmartURL(OUString const & rTheAbsURIRef,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ FSysStyle eStyle = FSYS_DETECT);
+
+ inline INetURLObject
+ smartRel2Abs(const OString& rTheRelURIRef,
+ bool & rWasAbsolute,
+ bool bIgnoreFragment = false,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ bool bRelativeNonURIs = false,
+ FSysStyle eStyle = FSYS_DETECT) const;
+
+ inline INetURLObject
+ smartRel2Abs(OUString const & rTheRelURIRef,
+ bool & rWasAbsolute,
+ bool bIgnoreFragment = false,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ bool bRelativeNonURIs = false,
+ FSysStyle eStyle = FSYS_DETECT) const;
+
+ // Relative URLs:
+
+ inline bool
+ GetNewAbsURL(const OString& rTheRelURIRef,
+ INetURLObject * pTheAbsURIRef,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ FSysStyle eStyle = FSYS_DETECT, bool bIgnoreFragment = false)
+ const;
+
+ inline bool
+ GetNewAbsURL(OUString const & rTheRelURIRef,
+ INetURLObject * pTheAbsURIRef,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ FSysStyle eStyle = FSYS_DETECT, bool bIgnoreFragment = false)
+ const;
+
+ /** @descr If rTheRelURIRef cannot be converted to an absolute URL
+ (because of syntactic reasons), either rTheRelURIRef or an empty
+ string is returned: If all of the parameters eEncodeMechanism,
+ eDecodeMechanism and eCharset have their respective default values,
+ then rTheRelURIRef is returned unmodified; otherwise, an empty string
+ is returned.
+ */
+ static OUString
+ GetAbsURL(OUString const & rTheBaseURIRef,
+ OUString const & rTheRelURIRef,
+ bool bIgnoreFragment = false,
+ EncodeMechanism eEncodeMechanism = WAS_ENCODED,
+ DecodeMechanism eDecodeMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ FSysStyle eStyle = FSYS_DETECT);
+
+ static inline OUString
+ GetRelURL(const OString& rTheBaseURIRef,
+ const OString& rTheAbsURIRef,
+ EncodeMechanism eEncodeMechanism = WAS_ENCODED,
+ DecodeMechanism eDecodeMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ FSysStyle eStyle = FSYS_DETECT);
+
+ static inline OUString
+ GetRelURL(OUString const & rTheBaseURIRef,
+ OUString const & rTheAbsURIRef,
+ EncodeMechanism eEncodeMechanism = WAS_ENCODED,
+ DecodeMechanism eDecodeMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ FSysStyle eStyle = FSYS_DETECT);
+
+ // External URLs:
+
+ OUString getExternalURL(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8) const;
+
+ static inline bool translateToExternal(const OString& rTheIntURIRef,
+ OUString & rTheExtURIRef,
+ DecodeMechanism eDecodeMechanism
+ = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8);
+
+ static inline bool translateToExternal(OUString const & rTheIntURIRef,
+ OUString & rTheExtURIRef,
+ DecodeMechanism eDecodeMechanism
+ = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8);
+
+ static inline bool translateToInternal(const OString& rTheExtURIRef,
+ OUString & rTheIntURIRef,
+ DecodeMechanism eDecodeMechanism
+ = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8);
+
+ static inline bool translateToInternal(OUString const & rTheExtURIRef,
+ OUString & rTheIntURIRef,
+ DecodeMechanism eDecodeMechanism
+ = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8);
+
+ // Scheme:
+
+ struct SchemeInfo;
+
+ inline INetProtocol GetProtocol() const { return m_eScheme; }
+
+ /** Return the URL 'prefix' for a given scheme.
+
+ @param eTheScheme One of the supported URL schemes.
+
+ @return The 'prefix' of URLs of the given scheme.
+ */
+ static OUString GetScheme(INetProtocol eTheScheme);
+
+ static inline INetProtocol CompareProtocolScheme(const OString&
+ rTheAbsURIRef)
+ { return CompareProtocolScheme(extend(rTheAbsURIRef)); }
+
+ static INetProtocol CompareProtocolScheme(OUString const &
+ rTheAbsURIRef);
+
+ // User Info:
+
+ inline bool HasUserData() const { return m_aUser.isPresent(); }
+
+ inline bool IsEmptyUser() const
+ { return m_aUser.isPresent() && m_aUser.isEmpty(); }
+
+ inline OUString GetUser(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8) const
+ { return decode(m_aUser, getEscapePrefix(), eMechanism, eCharset); }
+
+ inline OUString GetPass(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8) const
+ { return decode(m_aAuth, getEscapePrefix(), eMechanism, eCharset); }
+
+ inline bool SetUser(const OString& rTheUser,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ { return setUser(extend(rTheUser), true, eMechanism, eCharset); }
+
+ inline bool SetUser(OUString const & rTheUser,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ { return setUser(rTheUser, false, eMechanism, eCharset); }
+
+ inline bool SetPass(const OString& rThePassword,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ inline bool SetPass(OUString const & rThePassword,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ inline bool SetUserAndPass(const OString& rTheUser,
+ const OString& rThePassword,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8);
+
+ inline bool SetUserAndPass(OUString const & rTheUser,
+ OUString const & rThePassword,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8);
+
+ // Host and Port:
+
+ inline bool HasPort() const { return m_aPort.isPresent(); }
+
+ inline OUString GetHost(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8) const
+ { return decode(m_aHost, getEscapePrefix(), eMechanism, eCharset); }
+
+ OUString GetHostPort(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ sal_uInt32 GetPort() const;
+
+ inline bool SetHost(const OString& rTheHost,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ { return setHost(extend(rTheHost), true, eMechanism, eCharset); }
+
+ inline bool SetHost(OUString const & rTheHost,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ { return setHost(rTheHost, false, eMechanism, eCharset); }
+
+ bool SetPort(sal_uInt32 nThePort);
+
+ // Path:
+
+ inline bool HasURLPath() const { return !m_aPath.isEmpty(); }
+
+ inline OUString GetURLPath(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8) const
+ { return decode(m_aPath, getEscapePrefix(), eMechanism, eCharset); }
+
+ inline bool SetURLPath(const OString& rThePath,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ { return setPath(extend(rThePath), true, eMechanism, eCharset); }
+
+ inline bool SetURLPath(OUString const & rThePath,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ { return setPath(rThePath, false, eMechanism, eCharset); }
+
+ // Hierarchical Path:
+
+ /** A constant to address the last segment in various methods dealing with
+ hierarchical paths.
+
+ @descr It is often more efficient to address the last segment using
+ this constant, than to determine its ordinal value using
+ getSegmentCount().
+ */
+ enum { LAST_SEGMENT = -1 };
+
+ /** The number of segments in the hierarchical path.
+
+ @descr Using RFC 2396 and RFC 2234, a hierarchical path is of the
+ form
+
+ hierarchical-path = 1*("/" segment)
+
+ segment = name *(";" param)
+
+ name = [base ["." extension]]
+
+ base = 1*pchar
+
+ extension = *<any pchar except ".">
+
+ param = *pchar
+
+ @param bIgnoreFinalSlash If true, a final slash at the end of the
+ hierarchical path does not denote an empty segment, but is ignored.
+
+ @return The number of segments in the hierarchical path. If the path
+ is not hierarchical, 0 is returned.
+ */
+ sal_Int32 getSegmentCount(bool bIgnoreFinalSlash = true) const;
+
+ /** Remove a segment from the hierarchical path.
+
+ @param nIndex The non-negative index of the segment, or LAST_SEGMENT
+ if addressing the last segment.
+
+ @param bIgnoreFinalSlash If true, a final slash at the end of the
+ hierarchical path does not denote an empty segment, but is ignored.
+
+ @return True if the segment has successfully been removed (and the
+ resulting URI is still valid). If the path is not hierarchical, or
+ the specified segment does not exist, false is returned. If false is
+ returned, the object is not modified.
+ */
+ bool removeSegment(sal_Int32 nIndex = LAST_SEGMENT,
+ bool bIgnoreFinalSlash = true);
+
+ /** Insert a new segment into the hierarchical path.
+
+ @param rTheName The name part of the new segment. The new segment
+ will contain no parameters.
+
+ @param bAppendFinalSlash If the new segment is appended at the end of
+ the hierarchical path, this parameter specifies whether to add a final
+ slash after it or not.
+
+ @param nIndex The non-negative index of the segment before which
+ to insert the new segment. LAST_SEGMENT or an nIndex that equals
+ getSegmentCount() inserts the new segment at the end of the
+ hierarchical path.
+
+ @param bIgnoreFinalSlash If true, a final slash at the end of the
+ hierarchical path does not denote an empty segment, but is ignored.
+
+ @param eMechanism See the general discussion for set-methods.
+
+ @param eCharset See the general discussion for set-methods.
+
+ @return True if the segment has successfully been inserted (and the
+ resulting URI is still valid). If the path is not hierarchical, or
+ the specified place to insert the new segment does not exist, false is
+ returned. If false is returned, the object is not modified.
+ */
+ inline bool insertName(OUString const & rTheName,
+ bool bAppendFinalSlash = false,
+ sal_Int32 nIndex = LAST_SEGMENT,
+ bool bIgnoreFinalSlash = true,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ /** Get the name of a segment of the hierarchical path.
+
+ @param nIndex The non-negative index of the segment, or LAST_SEGMENT
+ if addressing the last segment.
+
+ @param bIgnoreFinalSlash If true, a final slash at the end of the
+ hierarchical path does not denote an empty segment, but is ignored.
+
+ @param eMechanism See the general discussion for get-methods.
+
+ @param eCharset See the general discussion for get-methods.
+
+ @return The name part of the specified segment. If the path is not
+ hierarchical, or the specified segment does not exits, an empty string
+ is returned.
+ */
+ OUString getName(sal_Int32 nIndex = LAST_SEGMENT,
+ bool bIgnoreFinalSlash = true,
+ DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ const;
+
+ /** Set the name of a segment (preserving any parameters and any query or
+ fragment part).
+
+ @param rTheName The new name.
+
+ @param nIndex The non-negative index of the segment, or LAST_SEGMENT
+ if addressing the last segment.
+
+ @param bIgnoreFinalSlash If true, a final slash at the end of the
+ hierarchical path does not denote an empty segment, but is ignored.
+
+ @param eMechanism See the general discussion for set-methods.
+
+ @param eCharset See the general discussion for set-methods.
+
+ @return True if the name has successfully been modified (and the
+ resulting URI is still valid). If the path is not hierarchical, or
+ the specified segment does not exist, false is returned. If false is
+ returned, the object is not modified.
+ */
+ bool setName(OUString const & rTheName,
+ sal_Int32 nIndex = LAST_SEGMENT,
+ bool bIgnoreFinalSlash = true,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ /** Get the base of the name of a segment.
+
+ @param nIndex The non-negative index of the segment, or LAST_SEGMENT
+ if addressing the last segment.
+
+ @param bIgnoreFinalSlash If true, a final slash at the end of the
+ hierarchical path does not denote an empty segment, but is ignored.
+
+ @param eMechanism See the general discussion for get-methods.
+
+ @param eCharset See the general discussion for get-methods.
+
+ @return The base part of the specified segment. If the path is
+ not hierarchical, or the specified segment does not exits, an empty
+ string is returned.
+ */
+ OUString getBase(sal_Int32 nIndex = LAST_SEGMENT,
+ bool bIgnoreFinalSlash = true,
+ DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ const;
+
+ /** Set the base of the name of a segment (preserving the extension).
+
+ @param rTheBase The new base.
+
+ @param nIndex The non-negative index of the segment, or LAST_SEGMENT
+ if addressing the last segment.
+
+ @param bIgnoreFinalSlash If true, a final slash at the end of the
+ hierarchical path does not denote an empty segment, but is ignored.
+
+ @param eMechanism See the general discussion for set-methods.
+
+ @param eCharset See the general discussion for set-methods.
+
+ @return True if the base has successfully been modified (and the
+ resulting URI is still valid). If the path is not hierarchical, or
+ the specified segment does not exist, false is returned. If false is
+ returned, the object is not modified.
+ */
+ bool setBase(OUString const & rTheBase,
+ sal_Int32 nIndex = LAST_SEGMENT,
+ bool bIgnoreFinalSlash = true,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ /** Determine whether the name of a segment has an extension.
+
+ @param nIndex The non-negative index of the segment, or LAST_SEGMENT
+ if addressing the last segment.
+
+ @param bIgnoreFinalSlash If true, a final slash at the end of the
+ hierarchical path does not denote an empty segment, but is ignored.
+
+ @return True if the name of the specified segment has an extension.
+ If the path is not hierarchical, or the specified segment does not
+ exist, false is returned.
+ */
+ bool hasExtension(sal_Int32 nIndex = LAST_SEGMENT,
+ bool bIgnoreFinalSlash = true) const;
+
+ /** Get the extension of the name of a segment.
+
+ @param nIndex The non-negative index of the segment, or LAST_SEGMENT
+ if addressing the last segment.
+
+ @param bIgnoreFinalSlash If true, a final slash at the end of the
+ hierarchical path does not denote an empty segment, but is ignored.
+
+ @param eMechanism See the general discussion for get-methods.
+
+ @param eCharset See the general discussion for get-methods.
+
+ @return The extension part of the specified segment. If the path is
+ not hierarchical, or the specified segment does not exits, an empty
+ string is returned.
+ */
+ OUString getExtension(sal_Int32 nIndex = LAST_SEGMENT,
+ bool bIgnoreFinalSlash = true,
+ DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ const;
+
+ /** Set the extension of the name of a segment (replacing an already
+ existing extension).
+
+ @param rTheExtension The new extension.
+
+ @param nIndex The non-negative index of the segment, or LAST_SEGMENT
+ if addressing the last segment.
+
+ @param bIgnoreFinalSlash If true, a final slash at the end of the
+ hierarchical path does not denote an empty segment, but is ignored.
+
+ @param eMechanism See the general discussion for set-methods.
+
+ @param eCharset See the general discussion for set-methods.
+
+ @return True if the extension has successfully been modified (and the
+ resulting URI is still valid). If the path is not hierarchical, or
+ the specified segment does not exist, false is returned. If false is
+ returned, the object is not modified.
+ */
+ bool setExtension(OUString const & rTheExtension,
+ sal_Int32 nIndex = LAST_SEGMENT,
+ bool bIgnoreFinalSlash = true,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ /** Remove the extension of the name of a segment.
+
+ @param nIndex The non-negative index of the segment, or LAST_SEGMENT
+ if addressing the last segment.
+
+ @param bIgnoreFinalSlash If true, a final slash at the end of the
+ hierarchical path does not denote an empty segment, but is ignored.
+
+ @return True if the extension has successfully been removed (and the
+ resulting URI is still valid), or if the name did not have an
+ extension. If the path is not hierarchical, or the specified segment
+ does not exist, false is returned. If false is returned, the object
+ is not modified.
+ */
+ bool removeExtension(sal_Int32 nIndex = LAST_SEGMENT,
+ bool bIgnoreFinalSlash = true);
+
+ /** Determine whether the hierarchical path ends in a final slash.
+
+ @return True if the hierarchical path ends in a final slash. If the
+ path is not hierarchical, false is returned.
+ */
+ bool hasFinalSlash() const;
+
+ /** Make the hierarchical path end in a final slash (if it does not
+ already do so).
+
+ @return True if a final slash has successfully been appended (and the
+ resulting URI is still valid), or if the hierarchical path already
+ ended in a final slash. If the path is not hierarchical, false is
+ returned. If false is returned, the object is not modified.
+ */
+ bool setFinalSlash();
+
+ /** Remove a final slash from the hierarchical path.
+
+ @return True if a final slash has successfully been removed (and the
+ resulting URI is still valid), or if the hierarchical path already did
+ not end in a final slash. If the path is not hierarchical, false is
+ returned. If false is returned, the object is not modified.
+ */
+ bool removeFinalSlash();
+
+ // Query:
+
+ inline bool HasParam() const { return m_aQuery.isPresent(); }
+
+ inline OUString GetParam(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8) const
+ { return decode(m_aQuery, getEscapePrefix(), eMechanism, eCharset); }
+
+ inline bool SetParam(const OString& rTheQuery,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ inline bool SetParam(OUString const & rTheQuery,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ // Fragment:
+
+ inline bool HasMark() const { return m_aFragment.isPresent(); }
+
+ inline OUString GetMark(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8) const
+ { return decode(m_aFragment, getEscapePrefix(), eMechanism, eCharset); }
+
+ inline bool SetMark(const OString& rTheFragment,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ inline bool SetMark(OUString const & rTheFragment,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ // File URLs:
+
+ /** Create an INetURLObject from a file system path.
+
+ @param rFSysPath A file system path. An URL is not allowed here!
+
+ @param eStyle The notation of rFSysPath.
+ */
+ inline INetURLObject(OUString const & rFSysPath, FSysStyle eStyle);
+
+ /** Set this INetURLObject to a file URL constructed from a file system
+ path.
+
+ @param rFSysPath A file system path. An URL is not allowed here!
+
+ @param eStyle The notation of rFSysPath.
+
+ @return True if this INetURLObject has successfully been changed. If
+ false is returned, this INetURLObject has not been modified.
+ */
+ bool setFSysPath(OUString const & rFSysPath, FSysStyle eStyle);
+
+ /** Return the file system path represented by a file URL (ignoring any
+ fragment part).
+
+ @param eStyle The notation of the returned file system path.
+
+ @param pDelimiter Upon successful return, this parameter can return
+ the character that is the 'main' delimiter within the returned file
+ system path (e.g., "/" for Unix, "\" for DOS, ":" for Mac). This is
+ especially useful for routines that later try to shorten the returned
+ file system path at a 'good' position, e.g. to fit it into some
+ limited display space.
+
+ @return The file system path represented by this file URL. If this
+ file URL does not represent a file system path according to the
+ specified notation, or if this is not a file URL at all, an empty
+ string is returned.
+ */
+ OUString getFSysPath(FSysStyle eStyle, sal_Unicode * pDelimiter = 0)
+ const;
+
+ // POP3 and URLs:
+
+ OUString GetMsgId(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ const;
+
+ // Coding:
+
+ enum Part
+ {
+ PART_OBSOLETE_NORMAL = 0x001, // Obsolete, do not use!
+ PART_OBSOLETE_FILE = 0x002, // Obsolete, do not use!
+ PART_OBSOLETE_PARAM = 0x004, // Obsolete, do not use!
+ PART_USER_PASSWORD = 0x008,
+ PART_IMAP_ACHAR = 0x010,
+ PART_VIM = 0x020,
+ PART_HOST_EXTRA = 0x040,
+ PART_FPATH = 0x080,
+ PART_AUTHORITY = 0x100,
+ PART_PATH_SEGMENTS_EXTRA = 0x200,
+ PART_REL_SEGMENT_EXTRA = 0x400,
+ PART_URIC = 0x800,
+ PART_HTTP_PATH = 0x1000,
+ PART_FILE_SEGMENT_EXTRA = 0x2000, // Obsolete, do not use!
+ PART_MESSAGE_ID = 0x4000,
+ PART_MESSAGE_ID_PATH = 0x8000,
+ PART_MAILTO = 0x10000,
+ PART_PATH_BEFORE_QUERY = 0x20000,
+ PART_PCHAR = 0x40000,
+ PART_FRAGMENT = 0x80000, // Obsolete, do not use!
+ PART_VISIBLE = 0x100000,
+ PART_VISIBLE_NONSPECIAL = 0x200000,
+ PART_CREATEFRAGMENT = 0x400000,
+ PART_UNO_PARAM_VALUE = 0x800000,
+ PART_UNAMBIGUOUS = 0x1000000,
+ PART_URIC_NO_SLASH = 0x2000000,
+ PART_HTTP_QUERY = 0x4000000, //TODO! unused?
+ PART_NEWS_ARTICLE_LOCALPART = 0x8000000,
+ max_part = 0x80000000
+ // Do not use! Only there to allow compatible changes in the
+ // future.
+ };
+
+ enum EscapeType
+ {
+ ESCAPE_NO,
+ ESCAPE_OCTET,
+ ESCAPE_UTF32
+ };
+
+ /** Encode some text as part of a URI.
+
+ @param rText Some text (for its interpretation, see the general
+ discussion for set-methods).
+
+ @param ePart The part says which characters are 'forbidden' and must
+ be encoded (replaced by escape sequences). Characters outside the US-
+ ASCII range are always 'forbidden.'
+
+ @param cEscapePrefix The first character in an escape sequence
+ (normally '%').
+
+ @param eMechanism See the general discussion for set-methods.
+
+ @param eCharset See the general discussion for set-methods.
+
+ @return The encoded representation of the text ('forbidden'
+ characters replaced by escape sequences).
+ */
+ static inline OUString encode(const OString& rText, Part ePart,
+ sal_Char cEscapePrefix,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8);
+
+ /** Encode some text as part of a URI.
+
+ @param rText Some text (for its interpretation, see the general
+ discussion for set-methods).
+
+ @param ePart The part says which characters are 'forbidden' and must
+ be encoded (replaced by escape sequences). Characters outside the US-
+ ASCII range are always 'forbidden.'
+
+ @param cEscapePrefix The first character in an escape sequence
+ (normally '%').
+
+ @param eMechanism See the general discussion for set-methods.
+
+ @param eCharset See the general discussion for set-methods.
+
+ @return The text, encoded according to the given mechanism and
+ charset ('forbidden' characters replaced by escape sequences).
+ */
+ static inline OUString encode(OUString const & rText, Part ePart,
+ sal_Char cEscapePrefix,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8);
+
+ /** Decode some text.
+
+ @param rText Some (encoded) text.
+
+ @param cEscapePrefix The first character in an escape sequence
+ (normally '%').
+
+ @param eMechanism See the general discussion for get-methods.
+
+ @param eCharset See the general discussion for get-methods.
+
+ @return The text, decoded according to the given mechanism and
+ charset (escape sequences replaced by 'raw' characters).
+ */
+ static inline OUString decode(OUString const & rText,
+ sal_Char cEscapePrefix,
+ DecodeMechanism eMechanism,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8);
+
+ static inline OUString decode(OUStringBuffer const & rText,
+ sal_Char cEscapePrefix,
+ DecodeMechanism eMechanism,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8);
+
+ static void appendUCS4Escape(OUStringBuffer & rTheText,
+ sal_Char cEscapePrefix,
+ sal_uInt32 nUCS4);
+
+ static void appendUCS4(OUStringBuffer & rTheText, sal_uInt32 nUCS4,
+ EscapeType eEscapeType, bool bOctets, Part ePart,
+ sal_Char cEscapePrefix, rtl_TextEncoding eCharset,
+ bool bKeepVisibleEscapes);
+
+ static sal_uInt32 getUTF32(sal_Unicode const *& rBegin,
+ sal_Unicode const * pEnd, bool bOctets,
+ sal_Char cEscapePrefix,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset,
+ EscapeType & rEscapeType);
+
+ // Specialized helpers:
+
+ static sal_uInt32 scanDomain(sal_Unicode const *& rBegin,
+ sal_Unicode const * pEnd,
+ bool bEager = true);
+
+ // OBSOLETE Hierarchical Path:
+
+ OUString GetPartBeforeLastName(DecodeMechanism eMechanism
+ = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8) const;
+
+ /** Get the last segment in the path.
+
+ @param eMechanism See the general discussion for get-methods.
+
+ @param eCharset See the general discussion for get-methods.
+
+ @return For a hierarchical URL, the last segment (everything after
+ the last unencoded '/'). Not that this last segment may be empty. If
+ the URL is not hierarchical, an empty string is returned.
+ */
+ OUString GetLastName(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ const;
+
+ /** Get the 'extension' of the last segment in the path.
+
+ @param eMechanism See the general discussion for get-methods.
+
+ @param eCharset See the general discussion for get-methods.
+
+ @return For a hierarchical URL, everything after the first unencoded
+ '.' in the last segment of the path. Note that this 'extension' may
+ be empty. If the URL is not hierarchical, or if the last segment does
+ not contain an unencoded '.', an empty string is returned.
+ */
+ OUString GetFileExtension(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8) const;
+
+ inline bool Append(const OString& rTheSegment,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ { return appendSegment(extend(rTheSegment), true, eMechanism, eCharset); }
+
+ inline bool Append(OUString const & rTheSegment,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
+ { return appendSegment(rTheSegment, false, eMechanism, eCharset); }
+
+ bool CutLastName();
+
+ // OBSOLETE File URLs:
+
+ OUString PathToFileName() const;
+
+ OUString GetFull() const;
+
+ OUString GetPath() const;
+
+ void SetBase(OUString const & rTheBase);
+
+ OUString GetBase() const;
+
+ void SetName(OUString const & rTheName,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ inline OUString GetName(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8) const
+ { return GetLastName(eMechanism, eCharset); }
+
+ void SetExtension(OUString const & rTheExtension,
+ EncodeMechanism eMechanism = WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ inline OUString GetExtension(
+ DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset
+ = RTL_TEXTENCODING_UTF8) const
+ { return GetFileExtension(eMechanism, eCharset); }
+
+ OUString CutExtension(DecodeMechanism eMechanism = DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+ bool IsCaseSensitive() const;
+
+
+private:
+ // General Structure:
+
+ class SubString
+ {
+ sal_Int32 m_nBegin;
+ sal_Int32 m_nLength;
+
+ public:
+ explicit inline SubString(sal_Int32 nTheBegin = -1,
+ sal_Int32 nTheLength = 0):
+ m_nBegin(nTheBegin), m_nLength(nTheLength) {}
+
+ inline bool isPresent() const { return m_nBegin != -1; }
+
+ inline bool isEmpty() const { return m_nLength == 0; }
+
+ inline sal_Int32 getBegin() const { return m_nBegin; }
+
+ inline sal_Int32 getLength() const { return m_nLength; }
+
+ inline sal_Int32 getEnd() const { return m_nBegin + m_nLength; }
+
+ inline sal_Int32 clear();
+
+ inline sal_Int32 set(OUStringBuffer & rString,
+ OUString const & rSubString,
+ sal_Int32 nTheBegin);
+
+ inline sal_Int32 set(OUString & rString,
+ OUString const & rSubString);
+
+ inline sal_Int32 set(OUStringBuffer & rString,
+ OUString const & rSubString);
+
+ inline void operator +=(sal_Int32 nDelta);
+
+ int compare(SubString const & rOther,
+ OUStringBuffer const & rThisString,
+ OUStringBuffer const & rOtherString) const;
+ };
+
+ OUStringBuffer m_aAbsURIRef;
+ SubString m_aScheme;
+ SubString m_aUser;
+ SubString m_aAuth;
+ SubString m_aHost;
+ SubString m_aPort;
+ SubString m_aPath;
+ SubString m_aQuery;
+ SubString m_aFragment;
+ INetProtocol m_eScheme;
+ INetProtocol m_eSmartScheme;
+
+ TOOLS_DLLPRIVATE void setInvalid();
+
+ bool setAbsURIRef(
+ OUString const & rTheAbsURIRef, bool bOctets,
+ EncodeMechanism eMechanism, rtl_TextEncoding eCharset, bool bSmart,
+ FSysStyle eStyle);
+
+ // Relative URLs:
+
+ bool convertRelToAbs(
+ OUString const & rTheRelURIRef, bool bOctets,
+ INetURLObject & rTheAbsURIRef, bool & rWasAbsolute,
+ EncodeMechanism eMechanism, rtl_TextEncoding eCharset,
+ bool bIgnoreFragment, bool bSmart, bool bRelativeNonURIs,
+ FSysStyle eStyle) const;
+
+ bool convertAbsToRel(
+ OUString const & rTheAbsURIRef, bool bOctets,
+ OUString & rTheRelURIRef, EncodeMechanism eEncodeMechanism,
+ DecodeMechanism eDecodeMechanism, rtl_TextEncoding eCharset,
+ FSysStyle eStyle) const;
+
+ // External URLs:
+
+ static bool convertIntToExt(
+ OUString const & rTheIntURIRef, bool bOctets,
+ OUString & rTheExtURIRef, DecodeMechanism eDecodeMechanism,
+ rtl_TextEncoding eCharset);
+
+ static bool convertExtToInt(
+ OUString const & rTheExtURIRef, bool bOctets,
+ OUString & rTheIntURIRef, DecodeMechanism eDecodeMechanism,
+ rtl_TextEncoding eCharset);
+
+ // Scheme:
+
+ struct PrefixInfo;
+
+ TOOLS_DLLPRIVATE static inline SchemeInfo const & getSchemeInfo(
+ INetProtocol eTheScheme);
+
+ TOOLS_DLLPRIVATE inline SchemeInfo const & getSchemeInfo() const;
+
+ TOOLS_DLLPRIVATE static PrefixInfo const * getPrefix(
+ sal_Unicode const *& rBegin, sal_Unicode const * pEnd);
+
+ // Authority:
+
+ TOOLS_DLLPRIVATE sal_Int32 getAuthorityBegin() const;
+
+ TOOLS_DLLPRIVATE SubString getAuthority() const;
+
+ // User Info:
+
+ bool setUser(
+ OUString const & rTheUser, bool bOctets,
+ EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
+
+ bool clearPassword();
+
+ bool setPassword(
+ OUString const & rThePassword, bool bOctets,
+ EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
+
+ // Host and Port:
+
+ TOOLS_DLLPRIVATE static bool parseHost(
+ sal_Unicode const *& rBegin, sal_Unicode const * pEnd,
+ OUString & rCanonic);
+
+ TOOLS_DLLPRIVATE static bool parseHostOrNetBiosName(
+ sal_Unicode const * pBegin, sal_Unicode const * pEnd, bool bOctets,
+ EncodeMechanism eMechanism, rtl_TextEncoding eCharset,
+ bool bNetBiosName, OUStringBuffer* pCanonic);
+
+ bool setHost(
+ OUString const & rTheHost, bool bOctets,
+ EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
+
+ // Path:
+
+ TOOLS_DLLPRIVATE static bool parsePath(
+ INetProtocol eScheme, sal_Unicode const ** pBegin,
+ sal_Unicode const * pEnd, bool bOctets, EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset, bool bSkippedInitialSlash,
+ sal_uInt32 nSegmentDelimiter, sal_uInt32 nAltSegmentDelimiter,
+ sal_uInt32 nQueryDelimiter, sal_uInt32 nFragmentDelimiter,
+ OUStringBuffer &rSynPath);
+
+ bool setPath(
+ OUString const & rThePath, bool bOctets,
+ EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
+
+ // Hierarchical Path:
+
+ TOOLS_DLLPRIVATE bool checkHierarchical() const;
+
+ bool appendSegment(
+ OUString const & rTheSegment, bool bOctets,
+ EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
+
+ TOOLS_DLLPRIVATE SubString getSegment(
+ sal_Int32 nIndex, bool bIgnoreFinalSlash) const;
+
+ bool insertName(
+ OUString const & rTheName, bool bOctets, bool bAppendFinalSlash,
+ sal_Int32 nIndex, bool bIgnoreFinalSlash, EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset);
+
+ // Query:
+
+ bool clearQuery();
+
+ bool setQuery(
+ OUString const & rTheQuery, bool bOctets,
+ EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
+
+ // Fragment:
+
+ bool clearFragment();
+
+ bool setFragment(
+ OUString const & rTheMark, bool bOctets,
+ EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
+
+ // FILE URLs:
+
+ TOOLS_DLLPRIVATE bool hasDosVolume(FSysStyle eStyle) const;
+
+ // Coding:
+
+ static inline OUString extend(const OString& rOctets)
+ {
+ return OStringToOUString(rOctets, RTL_TEXTENCODING_ISO_8859_1);
+ }
+
+ static inline sal_Char getEscapePrefix(INetProtocol eTheScheme)
+ { return eTheScheme == INET_PROT_VIM ? '=' : '%'; }
+
+ inline sal_Char getEscapePrefix() const
+ { return getEscapePrefix(m_eScheme); }
+
+ TOOLS_DLLPRIVATE static inline void appendEscape(
+ OUStringBuffer & rTheText, sal_Char cEscapePrefix,
+ sal_uInt32 nOctet);
+
+ static OUString encodeText(
+ sal_Unicode const * pBegin, sal_Unicode const * pEnd, bool bOctets,
+ Part ePart, sal_Char cEscapePrefix, EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset, bool bKeepVisibleEscapes);
+
+ static inline OUString encodeText(
+ OUString const & rTheText, bool bOctets, Part ePart,
+ sal_Char cEscapePrefix, EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset, bool bKeepVisibleEscapes);
+
+ static OUString decode(
+ sal_Unicode const * pBegin, sal_Unicode const * pEnd,
+ sal_Char cEscapePrefix, DecodeMechanism, rtl_TextEncoding eCharset);
+
+ inline OUString decode(
+ SubString const & rSubString, sal_Char cEscapePrefix,
+ DecodeMechanism eMechanism, rtl_TextEncoding eCharset) const;
+
+ // Specialized helpers:
+
+ TOOLS_DLLPRIVATE static bool scanIPv6reference(
+ sal_Unicode const *& rBegin, sal_Unicode const * pEnd);
+
+private:
+ void changeScheme(INetProtocol eTargetScheme);
+};
+
+// static
+inline OUString INetURLObject::encodeText(OUString const & rTheText,
+ bool bOctets, Part ePart,
+ sal_Char cEscapePrefix,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset,
+ bool bKeepVisibleEscapes)
+{
+ return encodeText(rTheText.getStr(),
+ rTheText.getStr() + rTheText.getLength(), bOctets, ePart,
+ cEscapePrefix, eMechanism, eCharset,
+ bKeepVisibleEscapes);
+}
+
+inline OUString INetURLObject::decode(SubString const & rSubString,
+ sal_Char cEscapePrefix,
+ DecodeMechanism eMechanism,
+ rtl_TextEncoding eCharset) const
+{
+ return rSubString.isPresent() ?
+ decode(m_aAbsURIRef.getStr() + rSubString.getBegin(),
+ m_aAbsURIRef.getStr() + rSubString.getEnd(),
+ cEscapePrefix, eMechanism, eCharset) :
+ OUString();
+}
+
+inline INetURLObject::INetURLObject(const OString& rTheAbsURIRef,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset):
+ m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP)
+{
+ setAbsURIRef(extend(rTheAbsURIRef), true, eMechanism, eCharset, false,
+ FSysStyle(0));
+}
+
+inline INetURLObject::INetURLObject(OUString const & rTheAbsURIRef,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset):
+ m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP)
+{
+ setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, false,
+ FSysStyle(0));
+}
+
+inline bool INetURLObject::SetURL(const OString& rTheAbsURIRef,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return setAbsURIRef(extend(rTheAbsURIRef), true, eMechanism, eCharset,
+ false, FSysStyle(0));
+}
+
+inline bool INetURLObject::SetURL(OUString const & rTheAbsURIRef,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, false,
+ FSysStyle(0));
+}
+
+inline INetURLObject::INetURLObject(OUString const & rTheAbsURIRef,
+ INetProtocol eTheSmartScheme,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset,
+ FSysStyle eStyle):
+ m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(eTheSmartScheme)
+{
+ setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, true, eStyle);
+}
+
+inline bool INetURLObject::SetSmartURL(const OString& rTheAbsURIRef,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset,
+ FSysStyle eStyle)
+{
+ return setAbsURIRef(extend(rTheAbsURIRef), true, eMechanism, eCharset,
+ true, eStyle);
+}
+
+inline bool INetURLObject::SetSmartURL(OUString const & rTheAbsURIRef,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset,
+ FSysStyle eStyle)
+{
+ return setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, true,
+ eStyle);
+}
+
+inline INetURLObject
+INetURLObject::smartRel2Abs(const OString& rTheRelURIRef,
+ bool & rWasAbsolute,
+ bool bIgnoreFragment,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset,
+ bool bRelativeNonURIs,
+ FSysStyle eStyle) const
+{
+ INetURLObject aTheAbsURIRef;
+ convertRelToAbs(extend(rTheRelURIRef), true, aTheAbsURIRef, rWasAbsolute,
+ eMechanism, eCharset, bIgnoreFragment, true,
+ bRelativeNonURIs, eStyle);
+ return aTheAbsURIRef;
+}
+
+inline INetURLObject
+INetURLObject::smartRel2Abs(OUString const & rTheRelURIRef,
+ bool & rWasAbsolute,
+ bool bIgnoreFragment,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset,
+ bool bRelativeNonURIs,
+ FSysStyle eStyle) const
+{
+ INetURLObject aTheAbsURIRef;
+ convertRelToAbs(rTheRelURIRef, false, aTheAbsURIRef, rWasAbsolute,
+ eMechanism, eCharset, bIgnoreFragment, true,
+ bRelativeNonURIs, eStyle);
+ return aTheAbsURIRef;
+}
+
+inline bool INetURLObject::GetNewAbsURL(const OString& rTheRelURIRef,
+ INetURLObject * pTheAbsURIRef,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset,
+ FSysStyle eStyle, bool bIgnoreFragment)
+ const
+{
+ INetURLObject aTheAbsURIRef;
+ bool bWasAbsolute;
+ if (!convertRelToAbs(extend(rTheRelURIRef), true, aTheAbsURIRef,
+ bWasAbsolute, eMechanism, eCharset, bIgnoreFragment,
+ false, false, eStyle))
+ return false;
+ if (pTheAbsURIRef)
+ *pTheAbsURIRef = aTheAbsURIRef;
+ return true;
+}
+
+inline bool INetURLObject::GetNewAbsURL(OUString const & rTheRelURIRef,
+ INetURLObject * pTheAbsURIRef,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset,
+ FSysStyle eStyle, bool bIgnoreFragment)
+ const
+{
+ INetURLObject aTheAbsURIRef;
+ bool bWasAbsolute;
+ if (!convertRelToAbs(rTheRelURIRef, false, aTheAbsURIRef, bWasAbsolute,
+ eMechanism, eCharset, bIgnoreFragment, false, false,
+ eStyle))
+ return false;
+ if (pTheAbsURIRef)
+ *pTheAbsURIRef = aTheAbsURIRef;
+ return true;
+}
+
+// static
+inline OUString INetURLObject::GetRelURL(const OString& rTheBaseURIRef,
+ const OString& rTheAbsURIRef,
+ EncodeMechanism eEncodeMechanism,
+ DecodeMechanism eDecodeMechanism,
+ rtl_TextEncoding eCharset,
+ FSysStyle eStyle)
+{
+ OUString aTheRelURIRef;
+ INetURLObject(rTheBaseURIRef, eEncodeMechanism, eCharset).
+ convertAbsToRel(extend(rTheAbsURIRef), true, aTheRelURIRef,
+ eEncodeMechanism, eDecodeMechanism, eCharset, eStyle);
+ return aTheRelURIRef;
+}
+
+// static
+inline OUString INetURLObject::GetRelURL(OUString const & rTheBaseURIRef,
+ OUString const & rTheAbsURIRef,
+ EncodeMechanism eEncodeMechanism,
+ DecodeMechanism eDecodeMechanism,
+ rtl_TextEncoding eCharset,
+ FSysStyle eStyle)
+{
+ OUString aTheRelURIRef;
+ INetURLObject(rTheBaseURIRef, eEncodeMechanism, eCharset).
+ convertAbsToRel(rTheAbsURIRef, false, aTheRelURIRef, eEncodeMechanism,
+ eDecodeMechanism, eCharset, eStyle);
+ return aTheRelURIRef;
+}
+
+// static
+inline bool INetURLObject::translateToExternal(const OString& rTheIntURIRef,
+ OUString & rTheExtURIRef,
+ DecodeMechanism
+ eDecodeMechanism,
+ rtl_TextEncoding eCharset)
+{
+ OUString aTheExtURIRef;
+ bool bRet = convertIntToExt(extend(rTheIntURIRef), true, aTheExtURIRef,
+ eDecodeMechanism, eCharset);
+ rTheExtURIRef = aTheExtURIRef;
+ return bRet;
+}
+
+// static
+inline bool INetURLObject::translateToExternal(OUString const &
+ rTheIntURIRef,
+ OUString & rTheExtURIRef,
+ DecodeMechanism
+ eDecodeMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return convertIntToExt(rTheIntURIRef, false, rTheExtURIRef,
+ eDecodeMechanism, eCharset);
+}
+
+// static
+inline bool INetURLObject::translateToInternal(const OString&
+ rTheExtURIRef,
+ OUString & rTheIntURIRef,
+ DecodeMechanism
+ eDecodeMechanism,
+ rtl_TextEncoding eCharset)
+{
+ OUString aTheIntURIRef;
+ bool bRet = convertExtToInt(extend(rTheExtURIRef), true, aTheIntURIRef,
+ eDecodeMechanism, eCharset);
+ rTheIntURIRef = aTheIntURIRef;
+ return bRet;
+}
+
+// static
+inline bool INetURLObject::translateToInternal(OUString const &
+ rTheExtURIRef,
+ OUString & rTheIntURIRef,
+ DecodeMechanism
+ eDecodeMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return convertExtToInt(rTheExtURIRef, false, rTheIntURIRef,
+ eDecodeMechanism, eCharset);
+}
+
+inline bool INetURLObject::SetPass(const OString& rThePassword,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return rThePassword.isEmpty() ?
+ clearPassword() :
+ setPassword(extend(rThePassword), true, eMechanism, eCharset);
+}
+
+inline bool INetURLObject::SetPass(OUString const & rThePassword,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return rThePassword.isEmpty() ?
+ clearPassword() :
+ setPassword(rThePassword, false, eMechanism, eCharset);
+}
+
+inline bool INetURLObject::SetUserAndPass(const OString& rTheUser,
+ const OString& rThePassword,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return setUser(extend(rTheUser), true, eMechanism, eCharset)
+ && (rThePassword.isEmpty() ?
+ clearPassword() :
+ setPassword(extend(rThePassword), true, eMechanism,
+ eCharset));
+}
+
+inline bool INetURLObject::SetUserAndPass(OUString const & rTheUser,
+ OUString const & rThePassword,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return setUser(rTheUser, false, eMechanism, eCharset)
+ && (rThePassword.isEmpty() ?
+ clearPassword() :
+ setPassword(rThePassword, false, eMechanism, eCharset));
+}
+
+inline bool INetURLObject::insertName(OUString const & rTheName,
+ bool bAppendFinalSlash,
+ sal_Int32 nIndex,
+ bool bIgnoreFinalSlash,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return insertName(rTheName, false, bAppendFinalSlash, nIndex,
+ bIgnoreFinalSlash, eMechanism, eCharset);
+}
+
+inline bool INetURLObject::SetParam(const OString& rTheQuery,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return rTheQuery.isEmpty() ?
+ clearQuery() :
+ setQuery(extend(rTheQuery), true, eMechanism, eCharset);
+}
+
+inline bool INetURLObject::SetParam(OUString const & rTheQuery,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return rTheQuery.isEmpty() ?
+ clearQuery() :
+ setQuery(rTheQuery, false, eMechanism, eCharset);
+}
+
+inline bool INetURLObject::SetMark(const OString& rTheFragment,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return rTheFragment.isEmpty() ?
+ clearFragment() :
+ setFragment(extend(rTheFragment), true, eMechanism, eCharset);
+}
+
+inline bool INetURLObject::SetMark(OUString const & rTheFragment,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return rTheFragment.isEmpty() ?
+ clearFragment() :
+ setFragment(rTheFragment, false, eMechanism, eCharset);
+}
+
+inline INetURLObject::INetURLObject(OUString const & rFSysPath,
+ FSysStyle eStyle):
+ m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP)
+{
+ setFSysPath(rFSysPath, eStyle);
+}
+
+// static
+inline OUString INetURLObject::encode(const OString& rText, Part ePart,
+ sal_Char cEscapePrefix,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return encodeText(extend(rText), true, ePart, cEscapePrefix, eMechanism,
+ eCharset, false);
+}
+
+// static
+inline OUString INetURLObject::encode(OUString const & rText, Part ePart,
+ sal_Char cEscapePrefix,
+ EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return encodeText(rText, false, ePart, cEscapePrefix, eMechanism,
+ eCharset, false);
+}
+
+// static
+inline OUString INetURLObject::decode(OUString const & rText,
+ sal_Char cEscapePrefix,
+ DecodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return decode(rText.getStr(), rText.getStr() + rText.getLength(),
+ cEscapePrefix, eMechanism, eCharset);
+}
+
+inline OUString INetURLObject::decode(OUStringBuffer const & rText,
+ sal_Char cEscapePrefix,
+ DecodeMechanism eMechanism,
+ rtl_TextEncoding eCharset)
+{
+ return decode(rText.getStr(), rText.getStr() + rText.getLength(),
+ cEscapePrefix, eMechanism, eCharset);
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/vcompat.hxx b/include/tools/vcompat.hxx
new file mode 100644
index 000000000000..cb3c29701e36
--- /dev/null
+++ b/include/tools/vcompat.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 _VCOMPAT_HXX
+#define _VCOMPAT_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/solar.h>
+
+#define COMPAT_FORMAT( char1, char2, char3, char4 ) \
+ ((sal_uInt32)((((sal_uInt32)(char)(char1)))| \
+ (((sal_uInt32)(char)(char2))<<8UL)| \
+ (((sal_uInt32)(char)(char3))<<16UL)| \
+ ((sal_uInt32)(char)(char4))<<24UL))
+
+class SvStream;
+
+class TOOLS_DLLPUBLIC VersionCompat
+{
+ SvStream* mpRWStm;
+ sal_uInt32 mnCompatPos;
+ sal_uInt32 mnTotalSize;
+ sal_uInt16 mnStmMode;
+ sal_uInt16 mnVersion;
+
+ VersionCompat() {}
+ VersionCompat( const VersionCompat& ) {}
+ VersionCompat& operator=( const VersionCompat& ) { return *this; }
+ sal_Bool operator==( const VersionCompat& ) { return sal_False; }
+
+public:
+
+ VersionCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion = 1 );
+ ~VersionCompat();
+
+ sal_uInt16 GetVersion() const { return mnVersion; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/vector2d.hxx b/include/tools/vector2d.hxx
new file mode 100644
index 000000000000..d3d1c5c0c805
--- /dev/null
+++ b/include/tools/vector2d.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 _VECTOR2D_HXX
+#define _VECTOR2D_HXX
+
+#include <math.h>
+#include <tools/gen.hxx>
+
+class Vector2D
+{
+private:
+ double mfX;
+ double mfY;
+
+public:
+ inline Vector2D() : mfX( 0.0 ), mfY( 0.0 ) {}
+ inline Vector2D( double fX, double fY ) : mfX( fX ), mfY( fY ) {}
+ inline Vector2D( const Vector2D& rVec ) : mfX( rVec.mfX ), mfY( rVec.mfY ) {}
+ inline Vector2D( const Pair& rPair ) : mfX( rPair.A() ), mfY( rPair.B() ) {};
+ inline ~Vector2D() {}
+
+ inline const double& X() const { return mfX; }
+ inline const double& Y() const { return mfY; }
+ inline double& X() { return mfX; }
+ inline double& Y() { return mfY; }
+ inline const double& operator[] (int nPos) const { return (nPos ? mfY : mfX); }
+ inline double& operator[] (int nPos) { return (nPos ? mfY : mfX); }
+
+ inline double GetLength() const { return hypot( mfX, mfY ); }
+ inline Vector2D& Normalize();
+
+ inline void Min(const Vector2D& rVec) { if(rVec.mfX < mfX) mfX = rVec.mfX; if(rVec.mfY < mfY) mfY = rVec.mfY; }
+ inline void Max(const Vector2D& rVec) { if(rVec.mfX > mfX) mfX = rVec.mfX; if(rVec.mfY > mfY) mfY = rVec.mfY; }
+ inline void Abs() { if(mfX < 0.0) mfX = -mfX; if(mfY < 0.0) mfY = -mfY; }
+
+ inline void CalcInBetween(Vector2D& rOld1, Vector2D& rOld2, double t)
+ { mfX = ((rOld2.mfX - rOld1.mfX) + t) + rOld1.mfX; mfY = ((rOld2.mfY - rOld1.mfY) + t) + rOld1.mfY; }
+ inline void CalcMiddle(Vector2D& rOld1, Vector2D& rOld2)
+ { mfX = (rOld1.mfX + rOld2.mfX) / 2.0; mfY = (rOld1.mfY + rOld2.mfY) / 2.0; }
+ inline void CalcMiddle(Vector2D& rOld1, Vector2D& rOld2, Vector2D& rOld3)
+ { mfX = (rOld1.mfX + rOld2.mfX + rOld3.mfX) / 3.0; mfY = (rOld1.mfY + rOld2.mfY + rOld3.mfY) / 3.0; }
+
+ inline Vector2D& operator+=( const Vector2D& rVec ) { mfX += rVec.mfX, mfY += rVec.mfY; return *this; }
+ inline Vector2D& operator-=( const Vector2D& rVec ) { mfX -= rVec.mfX, mfY -= rVec.mfY; return *this; }
+ inline Vector2D operator+(const Vector2D& rVec) const { Vector2D aSum(*this); aSum += rVec; return aSum; }
+ inline Vector2D operator-(const Vector2D& rVec) const { Vector2D aSub(*this); aSub -= rVec; return aSub; }
+ inline Vector2D operator-(void) const { return Vector2D(-mfX, -mfY); }
+
+ inline double Scalar( const Vector2D& rVec ) const { return( mfX * rVec.mfX + mfY * rVec.mfY ); }
+
+ inline Vector2D& operator/=( const Vector2D& rVec ) { mfX /= rVec.mfX, mfY /= rVec.mfY; return *this; }
+ inline Vector2D& operator*=( const Vector2D& rVec ) { mfX *= rVec.mfX, mfY *= rVec.mfY; return *this; }
+ inline Vector2D operator/(const Vector2D& rVec) const { Vector2D aDiv(*this); aDiv /= rVec; return aDiv; }
+ inline Vector2D operator*(const Vector2D& rVec) const { Vector2D aMul(*this); aMul *= rVec; return aMul; }
+
+ inline Vector2D& operator*=(double t) { mfX *= t; mfY *= t; return *this; }
+ inline Vector2D operator*(double t) const { Vector2D aNew(*this); aNew *= t; return aNew; }
+ inline Vector2D& operator/=(double t) { mfX /= t; mfY /= t; return *this; }
+ inline Vector2D operator/(double t) const { Vector2D aNew(*this); aNew /= t; return aNew; }
+
+ inline sal_Bool operator==( const Vector2D& rVec ) const { return( mfX == rVec.mfX && mfY == rVec.mfY ); }
+ inline sal_Bool operator!=( const Vector2D& rVec ) const { return !( *this == rVec ); }
+
+ inline Vector2D& operator=( const Vector2D& rVec ) { mfX = rVec.mfX, mfY = rVec.mfY; return *this; }
+ inline Vector2D& operator=( const Pair& rPair ) { mfX = rPair.A(), mfY = rPair.B(); return *this; }
+ inline Vector2D& operator-=( const Pair& rPair ) { mfX -= rPair.A(), mfY -= rPair.B(); return *this; }
+ inline Vector2D& operator+=( const Pair& rPair ) { mfX += rPair.A(), mfY += rPair.B(); return *this; }
+ inline Vector2D& operator*=( const Pair& rPair ) { mfX *= rPair.A(), mfY *= rPair.B(); return *this; }
+ inline Vector2D& operator/=( const Pair& rPair ) { mfX /= rPair.A(), mfY /= rPair.B(); return *this; }
+
+ inline sal_Bool operator==( const Pair& rPair ) const { return( mfX == rPair.A() && mfY == rPair.B() ); }
+ inline sal_Bool operator!=( const Pair& rPair ) const { return !( *this == rPair ); }
+
+ inline sal_Bool IsPositive( Vector2D& rVec ) const { return( ( mfX * rVec.mfY - mfY * rVec.mfX ) >= 0.0 ); }
+ inline sal_Bool IsNegative( Vector2D& rVec ) const { return !IsPositive( rVec ); }
+};
+
+inline Vector2D& Vector2D::Normalize()
+{
+ double fLen = Scalar( *this );
+
+ if( ( fLen != 0.0 ) && ( fLen != 1.0 ) && ( ( fLen = sqrt( fLen ) ) != 0.0 ) )
+ mfX /= fLen, mfY /= fLen;
+
+ return *this;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/weakbase.h b/include/tools/weakbase.h
new file mode 100644
index 000000000000..a4ce1d0962e8
--- /dev/null
+++ b/include/tools/weakbase.h
@@ -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 _TOOLS_WEAKBASE_H_
+#define _TOOLS_WEAKBASE_H_
+
+#include <sal/types.h>
+#include <osl/diagnose.h>
+
+/** the template classes in this header are helper to implement weak references
+ to implementation objects that are not refcounted.
+
+ THIS IS NOT THREADSAFE
+
+ Use this only to have 'safe' pointers to implementation objects that you
+ don't own but that you reference with a pointer.
+
+ Example:
+
+ class ImplClass : public tools::WeakBase< ImplClass >
+ {
+ ~ImplClass() { clearWeek(); } // not needed but safer, see method description
+ ...
+ };
+
+ class UserClass
+ {
+ tools::WeakReference< ImplClass > mxWeakRef;
+
+ UserClass( ImplClass* pOjbect ) : mxWeakRef( pObject ) {}
+
+ DoSomething()
+ {
+ if( mxWeakRef.is() )
+ mxWeakRef->DoSomethingMore();
+ }
+ };
+*/
+namespace tools
+{
+
+/** private connection helper, do not use directly */
+template <class reference_type>
+struct WeakConnection
+{
+ sal_Int32 mnRefCount;
+ reference_type* mpReference;
+
+ WeakConnection( reference_type* pReference ) : mnRefCount( 0 ), mpReference( pReference ) {};
+ void acquire() { mnRefCount++; }
+ void release() { mnRefCount--; if( mnRefCount == 0 ) delete this; }
+};
+
+/** template implementation to hold a weak reference to an instance of type reference_type */
+template <class reference_type>
+class WeakReference
+{
+public:
+ /** constructs an empty reference */
+ inline WeakReference();
+
+ /** constructs a reference with a pointer to a class derived from WeakBase */
+ inline WeakReference( reference_type* pReference );
+
+ /** constructs a reference with another reference */
+ inline WeakReference( const WeakReference< reference_type >& rWeakRef );
+
+ inline ~WeakReference();
+
+ /** returns true if the reference object is not null and still alive */
+ inline bool is() const;
+
+ /** returns the pointer to the reference object or null */
+ inline reference_type * get() const;
+
+ /** sets this reference to the given object or null */
+ inline void reset( reference_type* pReference );
+
+ /** returns the pointer to the reference object or null */
+ inline reference_type * operator->() const;
+
+ /** returns true if this instance references pReferenceObject */
+ inline sal_Bool operator== (const reference_type * pReferenceObject) const;
+
+ /** returns true if this instance and the given weakref reference the same object */
+ inline sal_Bool operator== (const WeakReference<reference_type> & handle) const;
+
+ /** only needed for using this class with stl containers */
+ inline sal_Bool operator!= (const WeakReference<reference_type> & handle) const;
+
+ /** only needed for using this class with stl containers */
+ inline sal_Bool operator< (const WeakReference<reference_type> & handle) const;
+
+ /** only needed for using this class with stl containers */
+ inline sal_Bool operator> (const WeakReference<reference_type> & handle) const;
+
+ /** the assignment operator */
+ inline WeakReference<reference_type>& operator= (const WeakReference<reference_type> & handle);
+
+private:
+ WeakConnection< reference_type >* mpWeakConnection;
+};
+
+/** derive your implementation classes from this class if you want them to support weak references */
+template <class reference_type>
+class WeakBase
+{
+ friend class WeakReference<reference_type>;
+
+public:
+ inline WeakBase();
+
+ inline ~WeakBase();
+ /** clears the reference pointer in all living weak references for this instance.
+ Further created weak references will also be invalid.
+ You should call this method in the d'tor of your derived classes for an early
+ invalidate of all living weak references while youre object is already inside
+ it d'tor.
+ */
+ inline void clearWeak();
+
+private:
+ inline WeakConnection< reference_type >* getWeakConnection();
+ WeakConnection< reference_type >* mpWeakConnection;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/weakbase.hxx b/include/tools/weakbase.hxx
new file mode 100644
index 000000000000..08e85e17d69b
--- /dev/null
+++ b/include/tools/weakbase.hxx
@@ -0,0 +1,176 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TOOLS_WEAKBASE_HXX_
+#define _TOOLS_WEAKBASE_HXX_
+
+#include <tools/weakbase.h>
+
+/// see weakbase.h for documentation
+
+namespace tools
+{
+
+template< class reference_type >
+inline WeakReference< reference_type >::WeakReference()
+{
+ mpWeakConnection = new WeakConnection<reference_type>( 0 );
+ mpWeakConnection->acquire();
+}
+
+template< class reference_type >
+inline WeakReference< reference_type >::WeakReference( reference_type* pReference )
+{
+ if( pReference )
+ mpWeakConnection = pReference->getWeakConnection();
+ else
+ mpWeakConnection = new WeakConnection<reference_type>( 0 );
+
+ mpWeakConnection->acquire();
+}
+
+template< class reference_type >
+inline WeakReference< reference_type >::WeakReference( const WeakReference< reference_type >& rWeakRef )
+{
+ mpWeakConnection = rWeakRef.mpWeakConnection;
+ mpWeakConnection->acquire();
+}
+
+template< class reference_type >
+inline WeakReference< reference_type >::~WeakReference()
+{
+ mpWeakConnection->release();
+}
+
+template< class reference_type >
+inline bool WeakReference< reference_type >::is() const
+{
+ return mpWeakConnection->mpReference != 0;
+}
+
+template< class reference_type >
+inline reference_type * WeakReference< reference_type >::get() const
+{
+ return mpWeakConnection->mpReference;
+}
+
+template< class reference_type >
+inline void WeakReference< reference_type >::reset( reference_type* pReference )
+{
+ mpWeakConnection->release();
+
+ if( pReference )
+ mpWeakConnection = pReference->getWeakConnection();
+ else
+ mpWeakConnection = new WeakConnection<reference_type>( 0 );
+
+ mpWeakConnection->acquire();
+}
+
+template< class reference_type >
+inline reference_type * WeakReference< reference_type >::operator->() const
+{
+ OSL_PRECOND(mpWeakConnection, "tools::WeakReference::operator->() : null body");
+ return mpWeakConnection->mpReference;
+}
+
+template< class reference_type >
+inline sal_Bool WeakReference< reference_type >::operator==(const reference_type * pReferenceObject) const
+{
+ return mpWeakConnection->mpReference == pReferenceObject;
+}
+
+template< class reference_type >
+inline sal_Bool WeakReference< reference_type >::operator==(const WeakReference<reference_type> & handle) const
+{
+ return mpWeakConnection == handle.mpWeakConnection;
+}
+
+template< class reference_type >
+inline sal_Bool WeakReference< reference_type >::operator!=(const WeakReference<reference_type> & handle) const
+{
+ return mpWeakConnection != handle.mpWeakConnection;
+}
+
+template< class reference_type >
+inline sal_Bool WeakReference< reference_type >::operator<(const WeakReference<reference_type> & handle) const
+{
+ return mpWeakConnection->mpReference < handle.mpWeakConnection->mpReference;
+}
+
+template< class reference_type >
+inline sal_Bool WeakReference< reference_type >::operator>(const WeakReference<reference_type> & handle) const
+{
+ return mpWeakConnection->mpReference > handle.mpWeakConnection->mpReference;
+}
+
+template< class reference_type >
+inline WeakReference<reference_type>& WeakReference<reference_type>::operator= (
+ const WeakReference<reference_type>& rReference)
+{
+ if (&rReference != this)
+ {
+ mpWeakConnection->release();
+
+ mpWeakConnection = rReference.mpWeakConnection;
+ mpWeakConnection->acquire();
+ }
+ return *this;
+}
+
+template< class reference_type >
+inline WeakBase< reference_type >::WeakBase()
+{
+ mpWeakConnection = 0;
+}
+
+template< class reference_type >
+inline WeakBase< reference_type >::~WeakBase()
+{
+ if( mpWeakConnection )
+ {
+ mpWeakConnection->mpReference = 0;
+ mpWeakConnection->release();
+ mpWeakConnection = 0;
+ }
+}
+
+template< class reference_type >
+inline void WeakBase< reference_type >::clearWeak()
+{
+ if( mpWeakConnection )
+ mpWeakConnection->mpReference = 0;
+}
+
+template< class reference_type >
+inline WeakConnection< reference_type >* WeakBase< reference_type >::getWeakConnection()
+{
+ if( !mpWeakConnection )
+ {
+ mpWeakConnection = new WeakConnection< reference_type >( static_cast< reference_type* >( this ) );
+ mpWeakConnection->acquire();
+ }
+ return mpWeakConnection;
+}
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx
new file mode 100644
index 000000000000..acd1162ac4e3
--- /dev/null
+++ b/include/tools/wintypes.hxx
@@ -0,0 +1,325 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _TOOLS_WINTYPES_HXX
+#define _TOOLS_WINTYPES_HXX
+
+#include <tools/solar.h>
+#include <sal/types.h>
+
+// Window-Types
+
+typedef sal_uInt16 WindowType;
+#define WINDOW_BASE 0x0100
+#define WINDOW_FIRST (WINDOW_BASE + 0x30)
+#define WINDOW_MESSBOX (WINDOW_FIRST)
+#define WINDOW_INFOBOX (WINDOW_FIRST + 0x01)
+#define WINDOW_WARNINGBOX (WINDOW_FIRST + 0x02)
+#define WINDOW_ERRORBOX (WINDOW_FIRST + 0x03)
+#define WINDOW_QUERYBOX (WINDOW_FIRST + 0x04)
+#define WINDOW_WINDOW (WINDOW_FIRST + 0x05)
+#define WINDOW_SYSWINDOW (WINDOW_FIRST + 0x06)
+#define WINDOW_WORKWINDOW (WINDOW_FIRST + 0x07)
+#define WINDOW_CONTAINER (WINDOW_FIRST + 0x08)
+#define WINDOW_FLOATINGWINDOW (WINDOW_FIRST + 0x09)
+#define WINDOW_DIALOG (WINDOW_FIRST + 0x0a)
+#define WINDOW_MODELESSDIALOG (WINDOW_FIRST + 0x0b)
+#define WINDOW_MODALDIALOG (WINDOW_FIRST + 0x0c)
+#define WINDOW_SYSTEMDIALOG (WINDOW_FIRST + 0x0d)
+#define WINDOW_PATHDIALOG (WINDOW_FIRST + 0x0e)
+#define WINDOW_FILEDIALOG (WINDOW_FIRST + 0x0f)
+#define WINDOW_PRINTERSETUPDIALOG (WINDOW_FIRST + 0x10)
+#define WINDOW_PRINTDIALOG (WINDOW_FIRST + 0x11)
+#define WINDOW_COLORDIALOG (WINDOW_FIRST + 0x12)
+#define WINDOW_FONTDIALOG (WINDOW_FIRST + 0x13)
+#define WINDOW_CONTROL (WINDOW_FIRST + 0x14)
+#define WINDOW_BUTTON (WINDOW_FIRST + 0x15)
+#define WINDOW_PUSHBUTTON (WINDOW_FIRST + 0x16)
+#define WINDOW_OKBUTTON (WINDOW_FIRST + 0x17)
+#define WINDOW_CANCELBUTTON (WINDOW_FIRST + 0x18)
+#define WINDOW_HELPBUTTON (WINDOW_FIRST + 0x19)
+#define WINDOW_IMAGEBUTTON (WINDOW_FIRST + 0x1a)
+#define WINDOW_MENUBUTTON (WINDOW_FIRST + 0x1b)
+#define WINDOW_MOREBUTTON (WINDOW_FIRST + 0x1c)
+#define WINDOW_SPINBUTTON (WINDOW_FIRST + 0x1d)
+#define WINDOW_RADIOBUTTON (WINDOW_FIRST + 0x1e)
+#define WINDOW_IMAGERADIOBUTTON (WINDOW_FIRST + 0x1f)
+#define WINDOW_CHECKBOX (WINDOW_FIRST + 0x20)
+#define WINDOW_TRISTATEBOX (WINDOW_FIRST + 0x21)
+#define WINDOW_EDIT (WINDOW_FIRST + 0x22)
+#define WINDOW_MULTILINEEDIT (WINDOW_FIRST + 0x23)
+#define WINDOW_COMBOBOX (WINDOW_FIRST + 0x24)
+#define WINDOW_LISTBOX (WINDOW_FIRST + 0x25)
+#define WINDOW_MULTILISTBOX (WINDOW_FIRST + 0x26)
+#define WINDOW_FIXEDTEXT (WINDOW_FIRST + 0x27)
+#define WINDOW_FIXEDLINE (WINDOW_FIRST + 0x28)
+#define WINDOW_FIXEDBITMAP (WINDOW_FIRST + 0x29)
+#define WINDOW_FIXEDIMAGE (WINDOW_FIRST + 0x2a)
+#define WINDOW_GROUPBOX (WINDOW_FIRST + 0x2c)
+#define WINDOW_SCROLLBAR (WINDOW_FIRST + 0x2d)
+#define WINDOW_SCROLLBARBOX (WINDOW_FIRST + 0x2e)
+#define WINDOW_SPLITTER (WINDOW_FIRST + 0x2f)
+#define WINDOW_SPLITWINDOW (WINDOW_FIRST + 0x30)
+#define WINDOW_SPINFIELD (WINDOW_FIRST + 0x31)
+#define WINDOW_PATTERNFIELD (WINDOW_FIRST + 0x32)
+#define WINDOW_NUMERICFIELD (WINDOW_FIRST + 0x33)
+#define WINDOW_METRICFIELD (WINDOW_FIRST + 0x34)
+#define WINDOW_CURRENCYFIELD (WINDOW_FIRST + 0x35)
+#define WINDOW_DATEFIELD (WINDOW_FIRST + 0x36)
+#define WINDOW_TIMEFIELD (WINDOW_FIRST + 0x37)
+#define WINDOW_PATTERNBOX (WINDOW_FIRST + 0x38)
+#define WINDOW_NUMERICBOX (WINDOW_FIRST + 0x39)
+#define WINDOW_METRICBOX (WINDOW_FIRST + 0x3a)
+#define WINDOW_CURRENCYBOX (WINDOW_FIRST + 0x3b)
+#define WINDOW_DATEBOX (WINDOW_FIRST + 0x3c)
+#define WINDOW_TIMEBOX (WINDOW_FIRST + 0x3d)
+#define WINDOW_LONGCURRENCYFIELD (WINDOW_FIRST + 0x3e)
+#define WINDOW_LONGCURRENCYBOX (WINDOW_FIRST + 0x3f)
+#define WINDOW_SCROLLWINDOW (WINDOW_FIRST + 0x40)
+#define WINDOW_TOOLBOX (WINDOW_FIRST + 0x41)
+#define WINDOW_DOCKINGWINDOW (WINDOW_FIRST + 0x42)
+#define WINDOW_STATUSBAR (WINDOW_FIRST + 0x43)
+#define WINDOW_TABPAGE (WINDOW_FIRST + 0x44)
+#define WINDOW_TABCONTROL (WINDOW_FIRST + 0x45)
+#define WINDOW_TABDIALOG (WINDOW_FIRST + 0x46)
+#define WINDOW_BORDERWINDOW (WINDOW_FIRST + 0x47)
+#define WINDOW_BUTTONDIALOG (WINDOW_FIRST + 0x48)
+#define WINDOW_SYSTEMCHILDWINDOW (WINDOW_FIRST + 0x49)
+#define WINDOW_SLIDER (WINDOW_FIRST + 0x4a)
+#define WINDOW_MENUBARWINDOW (WINDOW_FIRST + 0x4b)
+#define WINDOW_TREELISTBOX (WINDOW_FIRST + 0x4c)
+#define WINDOW_HELPTEXTWINDOW (WINDOW_FIRST + 0x4d)
+#define WINDOW_INTROWINDOW (WINDOW_FIRST + 0x4e)
+#define WINDOW_LISTBOXWINDOW (WINDOW_FIRST + 0x4f)
+#define WINDOW_DOCKINGAREA (WINDOW_FIRST + 0x50)
+#define WINDOW_RULER (WINDOW_FIRST + 0x51)
+#define WINDOW_CALCINPUTLINE (WINDOW_FIRST + 0x52)
+#define WINDOW_LAST (WINDOW_CALCINPUTLINE)
+
+// Window-Bits
+
+typedef sal_Int64 WinBits;
+
+// Window-Bits for Window
+#define WB_CLIPCHILDREN ((WinBits)0x00000001)
+#define WB_DIALOGCONTROL ((WinBits)0x00000002)
+#define WB_NODIALOGCONTROL ((WinBits)0x00000004)
+#define WB_BORDER ((WinBits)0x00000008)
+#define WB_NOBORDER ((WinBits)0x00000010)
+#define WB_SIZEABLE ((WinBits)0x00000020)
+#define WB_3DLOOK ((WinBits)0x00000040)
+#define WB_AUTOSIZE ((WinBits)0x00000080)
+
+// Window-Bits for SystemWindows
+#define WB_MOVEABLE ((WinBits)0x00000100)
+#define WB_ROLLABLE ((WinBits)0x00000200)
+#define WB_CLOSEABLE ((WinBits)0x00000400)
+#define WB_STANDALONE ((WinBits)0x00000800)
+#define WB_APP ((WinBits)0x00001000)
+#define WB_PINABLE ((WinBits)0x00002000)
+#define WB_SYSTEMWINDOW ((WinBits)SAL_CONST_INT64(0x40000000))
+// warning: do not confuse WB_SYSTEMCHILDWINDOW with the SystemChildWindow class
+//
+// the SystemChildWindow class was there first and is a very specialized
+// sytem child window type for plugged applications. The SystemChildWindow class
+// explicitly should never use the WB_SYSTEMCHILDWINDOW WinBit
+//
+// WB_SYSTEMCHILDWINDOW on the other hand is to be used on system windows
+// which should be created as system child windows with (more or less)
+// normal event handling
+#define WB_SYSTEMCHILDWINDOW ((WinBits)SAL_CONST_INT64(0x8000000000))
+#define WB_SIZEMOVE (WB_SIZEABLE | WB_MOVEABLE)
+
+// Standard-Window-Bits for ChildWindows
+#define WB_TABSTOP ((WinBits)0x00000100)
+#define WB_NOTABSTOP ((WinBits)0x00000200)
+#define WB_GROUP ((WinBits)0x00000400)
+#define WB_NOGROUP ((WinBits)0x00000800)
+#define WB_HORZ ((WinBits)0x00001000)
+#define WB_VERT ((WinBits)0x00002000)
+#define WB_LEFT ((WinBits)0x00004000)
+#define WB_CENTER ((WinBits)0x00008000)
+#define WB_RIGHT ((WinBits)0x00010000)
+#define WB_TOP ((WinBits)0x00020000)
+#define WB_VCENTER ((WinBits)0x00040000)
+#define WB_BOTTOM ((WinBits)0x00080000)
+#define WB_DRAG ((WinBits)0x00100000)
+#define WB_SPIN ((WinBits)0x00200000)
+#define WB_REPEAT ((WinBits)0x00400000)
+#define WB_NOPOINTERFOCUS ((WinBits)0x00800000)
+#define WB_WORDBREAK ((WinBits)0x01000000)
+#define WB_NOLABEL ((WinBits)0x02000000)
+#define WB_SORT ((WinBits)0x04000000)
+#define WB_DROPDOWN ((WinBits)0x08000000)
+#define WB_HIDE ((WinBits)SAL_CONST_INT64(0x80000000))
+#define WB_AUTOHSCROLL ((WinBits)SAL_CONST_INT64(0x10000000))
+#define WB_DOCKABLE ((WinBits)SAL_CONST_INT64(0x20000000))
+#define WB_AUTOVSCROLL ((WinBits)SAL_CONST_INT64(0x40000000))
+#define WB_HYPHENATION (((WinBits)SAL_CONST_INT64(0x800000000)) | WB_WORDBREAK)
+#define WB_CHILDDLGCTRL ((WinBits)SAL_CONST_INT64(0x100000000000))
+#define WB_REFMODE ((WinBits)SAL_CONST_INT64(0x200000000000))
+
+// system floating window
+#define WB_SYSTEMFLOATWIN ((WinBits)SAL_CONST_INT64(0x100000000))
+#define WB_INTROWIN ((WinBits)SAL_CONST_INT64(0x200000000))
+#define WB_NOSHADOW ((WinBits)SAL_CONST_INT64(0x400000000))
+#define WB_TOOLTIPWIN ((WinBits)SAL_CONST_INT64(0x800000000))
+#define WB_OWNERDRAWDECORATION ((WinBits)SAL_CONST_INT64(0x2000000000))
+#define WB_DEFAULTWIN ((WinBits)SAL_CONST_INT64(0x4000000000))
+#define WB_NEEDSFOCUS ((WinBits)SAL_CONST_INT64(0x1000000000))
+#define WB_POPUP ((WinBits)SAL_CONST_INT64(0x20000000))
+
+#define WB_HSCROLL WB_HORZ
+#define WB_VSCROLL WB_VERT
+#define WB_TOPIMAGE WB_TOP
+
+// Window-Bits for PushButtons
+#define WB_DEFBUTTON ((WinBits)0x10000000)
+#define WB_NOLIGHTBORDER ((WinBits)0x20000000)
+#define WB_RECTSTYLE ((WinBits)0x08000000)
+#define WB_SMALLSTYLE ((WinBits)0x04000000)
+#define WB_TOGGLE ((WinBits)SAL_CONST_INT64(0x1000000000))
+#define WB_BEVELBUTTON ((WinBits)SAL_CONST_INT64(0x2000000000))
+#define WB_FLATBUTTON ((WinBits)SAL_CONST_INT64(0x4000000000))
+
+// Window-Bits for FixedText
+#define WB_PATHELLIPSIS ((WinBits)0x00100000)
+#define WB_EXTRAOFFSET ((WinBits)0x02000000)
+#define WB_NOMULTILINE ((WinBits)0x10000000)
+#define WB_INFO ((WinBits)0x20000000)
+
+// Window-Bits for CheckBox
+#define WB_CBLINESTYLE ((WinBits)SAL_CONST_INT64(0x2000000000))
+#define WB_EARLYTOGGLE ((WinBits)SAL_CONST_INT64(0x4000000000))
+
+// Window-Bits for Edit
+#define WB_PASSWORD ((WinBits)0x01000000)
+#define WB_READONLY ((WinBits)0x02000000)
+#define WB_NOHIDESELECTION ((WinBits)SAL_CONST_INT64(0x1000000000))
+#define WB_FORCECTRLBACKGROUND ((WinBits)0x80000000)
+
+// Window-Bits for MultiLineEdit
+#define WB_IGNORETAB ((WinBits)0x20000000)
+
+// Window-Bits for ListBox and MultiListBox
+#define WB_SIMPLEMODE ((WinBits)0x20000000)
+
+// Window-Bits for FixedBitmap
+#define WB_FAST ((WinBits)0x04000000)
+#define WB_SCALE ((WinBits)0x08000000)
+#define WB_TOPLEFTVISIBLE ((WinBits)0x10000000)
+
+// Window-Bits for ToolBox
+#define WB_LINESPACING ((WinBits)0x01000000)
+#define WB_SCROLL ((WinBits)0x02000000)
+#define WB_FORCETABCYCLE ((WinBits)0x04000000)
+
+// Window-Bits for DockingWindows
+#define WB_DOCKBORDER ((WinBits)0x00001000)
+
+// Window-Bits for SplitWindow
+#define WB_NOSPLITDRAW ((WinBits)0x01000000)
+#define WB_FLATSPLITDRAW ((WinBits)0x02000000)
+
+// Window-Bits for MessageBoxen
+#define WB_OK ((WinBits)0x00100000)
+#define WB_OK_CANCEL ((WinBits)0x00200000)
+#define WB_YES_NO ((WinBits)0x00400000)
+#define WB_YES_NO_CANCEL ((WinBits)0x00800000)
+#define WB_RETRY_CANCEL ((WinBits)0x01000000)
+#define WB_DEF_OK ((WinBits)0x02000000)
+#define WB_DEF_CANCEL ((WinBits)0x04000000)
+#define WB_DEF_RETRY ((WinBits)0x08000000)
+#define WB_DEF_YES ((WinBits)SAL_CONST_INT64(0x10000000))
+#define WB_DEF_NO ((WinBits)SAL_CONST_INT64(0x20000000))
+#define WB_ABORT_RETRY_IGNORE ((WinBits)SAL_CONST_INT64(0x1000000000))
+#define WB_DEF_IGNORE ((WinBits)SAL_CONST_INT64(0x2000000000))
+
+// Standard-WinBits
+#define WB_STDWORK (WB_SIZEMOVE | WB_CLOSEABLE)
+#define WB_STDDOCKWIN (WB_DOCKABLE | WB_MOVEABLE | WB_CLOSEABLE)
+#define WB_STDFLOATWIN (WB_SIZEMOVE | WB_CLOSEABLE | WB_ROLLABLE)
+#define WB_STDDIALOG (WB_MOVEABLE | WB_CLOSEABLE)
+#define WB_STDMODELESS (WB_STDDIALOG)
+#define WB_STDMODAL (WB_STDDIALOG)
+#define WB_STDTABDIALOG (WB_STDDIALOG)
+#define WB_STDTABCONTROL 0
+#define WB_STDPOPUP (WB_BORDER | WB_POPUP | WB_SYSTEMWINDOW | WB_3DLOOK | WB_DIALOGCONTROL)
+
+// For TreeListBox
+#define WB_HASBUTTONS ((WinBits)SAL_CONST_INT64(0x000100000000))
+#define WB_HASLINES ((WinBits)SAL_CONST_INT64(0x000200000000))
+#define WB_HASLINESATROOT ((WinBits)SAL_CONST_INT64(0x000400000000))
+#define WB_HASBUTTONSATROOT ((WinBits)SAL_CONST_INT64(0x000800000000))
+#define WB_NOINITIALSELECTION ((WinBits)SAL_CONST_INT64(0x001000000000))
+#define WB_HIDESELECTION ((WinBits)SAL_CONST_INT64(0x002000000000))
+#define WB_FORCE_MAKEVISIBLE ((WinBits)SAL_CONST_INT64(0x004000000000))
+// DO NOT USE: 0x008000000000, that's WB_SYSTEMCHILDWINDOW
+#define WB_QUICK_SEARCH ((WinBits)SAL_CONST_INT64(0x010000000000))
+
+// For FileOpen Dialog
+#define WB_PATH ((WinBits)0x00100000)
+#define WB_OPEN ((WinBits)0x00200000)
+#define WB_SAVEAS ((WinBits)0x00400000)
+
+// For Slider
+// Window-Bits for TabControl
+#define WB_SLIDERSET ((WinBits)0x02000000)
+
+// extended WinBits
+#define WB_EXT_DOCUMENT ((WinBits)0x00000001)
+#define WB_EXT_DOCMODIFIED ((WinBits)0x00000002)
+
+// WindowAlign
+
+enum WindowAlign { WINDOWALIGN_LEFT, WINDOWALIGN_TOP, WINDOWALIGN_RIGHT, WINDOWALIGN_BOTTOM };
+enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_BOTTOM,
+ IMAGEALIGN_LEFT_TOP, IMAGEALIGN_LEFT_BOTTOM, IMAGEALIGN_TOP_LEFT,
+ IMAGEALIGN_TOP_RIGHT, IMAGEALIGN_RIGHT_TOP, IMAGEALIGN_RIGHT_BOTTOM,
+ IMAGEALIGN_BOTTOM_LEFT, IMAGEALIGN_BOTTOM_RIGHT, IMAGEALIGN_CENTER };
+enum SymbolAlign { SYMBOLALIGN_LEFT, SYMBOLALIGN_RIGHT };
+
+// TriState
+
+enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW };
+
+
+// ButtonDialog-Types
+
+typedef sal_uInt16 StandardButtonType;
+#define BUTTON_OK ((StandardButtonType)0)
+#define BUTTON_CANCEL ((StandardButtonType)1)
+#define BUTTON_YES ((StandardButtonType)2)
+#define BUTTON_NO ((StandardButtonType)3)
+#define BUTTON_RETRY ((StandardButtonType)4)
+#define BUTTON_HELP ((StandardButtonType)5)
+#define BUTTON_CLOSE ((StandardButtonType)6)
+#define BUTTON_MORE ((StandardButtonType)7)
+#define BUTTON_IGNORE ((StandardButtonType)8)
+#define BUTTON_ABORT ((StandardButtonType)9)
+#define BUTTON_LESS ((StandardButtonType)10)
+#define BUTTON_RESET ((StandardButtonType)11)
+#define BUTTON_COUNT 12
+
+// prominent place for ListBox window types
+
+enum ProminentEntry { PROMINENT_TOP, PROMINENT_MIDDLE };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/wldcrd.hxx b/include/tools/wldcrd.hxx
new file mode 100644
index 000000000000..8991b8882474
--- /dev/null
+++ b/include/tools/wldcrd.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 _WLDCRD_HXX
+#define _WLDCRD_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/string.hxx>
+#include <osl/thread.h>
+
+class TOOLS_DLLPUBLIC WildCard
+{
+private:
+ OString aWildString;
+ char cSepSymbol;
+
+ sal_uInt16 ImpMatch( const char *pWild, const char *pStr ) const;
+
+public:
+ WildCard()
+ : aWildString('*')
+ , cSepSymbol('\0')
+ {
+ }
+
+ WildCard(const OUString& rWildCard, const char cSeparator = '\0')
+ : aWildString(OUStringToOString(rWildCard, osl_getThreadTextEncoding()))
+ , cSepSymbol(cSeparator)
+ {
+ }
+
+ const OUString getGlob() const
+ {
+ return OStringToOUString(aWildString, osl_getThreadTextEncoding());
+ }
+
+ void setGlob(const OUString& rString)
+ {
+ aWildString = OUStringToOString(rString, osl_getThreadTextEncoding());
+ }
+
+ sal_Bool Matches( const String& rStr ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/zcodec.hxx b/include/tools/zcodec.hxx
new file mode 100644
index 000000000000..185cb1d9ecb0
--- /dev/null
+++ b/include/tools/zcodec.hxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _ZCODEC_HXX
+#define _ZCODEC_HXX
+
+#include "tools/toolsdllapi.h"
+#include <tools/solar.h>
+
+// Defines
+
+#define DEFAULT_IN_BUFSIZE (0x00008000UL)
+#define DEFAULT_OUT_BUFSIZE (0x00008000UL)
+
+#define MAX_MEM_USAGE 8
+
+// memory requirement using compress:
+// [ INBUFFER ] + [ OUTBUFFER ] + 128KB + 1 << (MEM_USAGE+9)
+// memory requirement using decompress:
+// [ INBUFFER ] + [ OUTBUFFER ] + 32KB
+
+#define ZCODEC_NO_COMPRESSION (0x00000000UL)
+#define ZCODEC_BEST_SPEED (0x00000001UL)
+#define ZCODEC_DEFAULT_COMPRESSION (0x00000006UL)
+#define ZCODEC_BEST_COMPRESSION (0x00000009UL)
+
+#define ZCODEC_DEFAULT_STRATEGY (0x00000000UL)
+#define ZCODEC_ZFILTERED (0x00000100UL)
+#define ZCODEC_ZHUFFMAN_ONLY (0x00000200UL)
+
+#define ZCODEC_UPDATE_CRC (0x00010000UL)
+#define ZCODEC_GZ_LIB (0x00020000UL)
+
+#define ZCODEC_PNG_DEFAULT ( ZCODEC_NO_COMPRESSION | ZCODEC_DEFAULT_STRATEGY | ZCODEC_UPDATE_CRC )
+#define ZCODEC_DEFAULT ( ZCODEC_DEFAULT_COMPRESSION | ZCODEC_DEFAULT_STRATEGY )
+
+class SvStream;
+
+class TOOLS_DLLPUBLIC ZCodec
+{
+private:
+ sal_uIntPtr mbInit;
+ sal_Bool mbStatus;
+ sal_Bool mbFinish;
+ sal_uIntPtr mnMemUsage;
+ SvStream* mpIStm;
+ sal_uInt8* mpInBuf;
+ sal_uIntPtr mnInBufSize;
+ sal_uIntPtr mnInToRead;
+ SvStream* mpOStm;
+ sal_uInt8* mpOutBuf;
+ sal_uIntPtr mnOutBufSize;
+
+ sal_uIntPtr mnCRC;
+ sal_uIntPtr mnCompressMethod;
+ void* mpsC_Stream;
+
+ void ImplInitBuf( sal_Bool nIOFlag );
+ void ImplWriteBack( void );
+
+public:
+ ZCodec( sal_uIntPtr nInBuf, sal_uIntPtr nOutBuf, sal_uIntPtr nMemUsage = MAX_MEM_USAGE );
+ ZCodec( void );
+ virtual ~ZCodec();
+
+ virtual void BeginCompression( sal_uIntPtr nCompressMethod = ZCODEC_DEFAULT );
+ virtual long EndCompression();
+ sal_Bool IsFinished () const { return mbFinish; }
+
+ long Compress( SvStream& rIStm, SvStream& rOStm );
+ long Decompress( SvStream& rIStm, SvStream& rOStm );
+
+ long Write( SvStream& rOStm, const sal_uInt8* pData, sal_uIntPtr nSize );
+ long Read( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize );
+ long ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize );
+
+ void SetBreak( sal_uIntPtr );
+ sal_uIntPtr GetBreak( void );
+ void SetCRC( sal_uIntPtr nCurrentCRC );
+ sal_uIntPtr UpdateCRC( sal_uIntPtr nLatestCRC, sal_uInt8* pSource, long nDatSize );
+ sal_uIntPtr GetCRC();
+};
+
+class GZCodec : public ZCodec
+{
+public:
+ GZCodec(){};
+ ~GZCodec(){};
+ virtual void BeginCompression( sal_uIntPtr nCompressMethod = ZCODEC_DEFAULT );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/touch/touch.h b/include/touch/touch.h
new file mode 100644
index 000000000000..8fa2dd16d26c
--- /dev/null
+++ b/include/touch/touch.h
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright 2013 LibreOffice contributors.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_TOUCH_TOUCH_H
+#define INCLUDED_TOUCH_TOUCH_H
+
+#include <config_features.h>
+
+#if !HAVE_FEATURE_DESKTOP
+
+// Functions to be implemented by the app-specifc upper or less
+// app-specific but platform-specific medium layer on touch-based
+// platforms. The same API is used on each such platform. There are
+// called from low level LibreOffice code. Note that these are just
+// declared here in this header in the "touch" module, the
+// per-platform implementations are elsewhere.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void lo_show_keyboard();
+void lo_hide_keyboard();
+
+// Functions to be implemented in the medium platform-specific layer
+// to be called from the app-specific UI layer.
+
+void lo_keyboard_did_hide();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // HAVE_FEATURE_DESKTOP
+
+#endif // INCLUDED_TOUCH_TOUCH_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tubes/collaboration.hxx b/include/tubes/collaboration.hxx
new file mode 100644
index 000000000000..3f32d4188dbe
--- /dev/null
+++ b/include/tubes/collaboration.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/.
+ */
+
+#ifndef INCLUDED_TUBES_COLLABORATION_HXX
+#define INCLUDED_TUBES_COLLABORATION_HXX
+
+#include <sal/config.h>
+
+#include <rtl/ustring.hxx>
+#include <tubes/tubesdllapi.h>
+
+class TeleConference;
+typedef struct _TpContact TpContact;
+
+class TUBES_DLLPUBLIC Collaboration
+{
+ TeleConference* mpConference;
+ // This is in fact of type TubeContacts* from anonymous namespace
+ void* mpContacts;
+public:
+ Collaboration();
+ virtual ~Collaboration();
+
+ /** Returns to normal editing mode */
+ virtual void EndCollaboration() const = 0;
+ virtual void PacketReceived( const OString& rPacket ) const = 0;
+ /** Saves current document and then calls SendFile() with the file URL */
+ virtual void SaveAndSendFile( TpContact* pContact ) const = 0;
+ /** Prepares document for collaboration and should call SetConference() */
+ virtual void StartCollaboration( TeleConference* pConference ) = 0;
+
+ TUBES_DLLPRIVATE sal_uInt64 GetId() const;
+ TUBES_DLLPRIVATE void Invite( TpContact* pContact ) const;
+
+ /** Application calls this to display contacts dialog from where can the collaboration start */
+ void DisplayContacts();
+ void SendFile( TpContact* pContact, const OUString& rURL ) const;
+ void SendPacket( const OString& rPacket ) const;
+ void SetConference( TeleConference* pConference );
+};
+
+#endif // INCLUDED_TUBES_COLLABORATION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tubes/conference.hxx b/include/tubes/conference.hxx
new file mode 100644
index 000000000000..7dfd744d959a
--- /dev/null
+++ b/include/tubes/conference.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/.
+ */
+
+#ifndef INCLUDED_TUBES_CONFERENCE_HXX
+#define INCLUDED_TUBES_CONFERENCE_HXX
+
+#include <sal/config.h>
+#include <rtl/ustring.hxx>
+
+class Collaboration;
+class TeleConferenceImpl;
+typedef struct _TpAccount TpAccount;
+typedef struct _TpContact TpContact;
+typedef struct _TpDBusTubeChannel TpDBusTubeChannel;
+typedef struct _GDBusConnection GDBusConnection;
+
+/** Conference setup by TeleManager */
+class TeleConference
+{
+public:
+
+ TeleConference( TpAccount* pAccount,
+ TpDBusTubeChannel* pChannel,
+ const OString sUuid = OString(),
+ bool bMaster = false );
+ ~TeleConference();
+
+ /// Close channel and call finalize()
+ void close();
+
+ /// Unrefs, unregisters from manager and calls dtor if last reference!
+ void finalize();
+
+ bool sendPacket( const OString& rPacket );
+
+ void invite( TpContact *pContact );
+
+ typedef void (*FileSentCallback)( bool aSuccess, void* pUserData);
+ void sendFile( TpContact* pContact, const OUString& rURL, FileSentCallback pCallback, void* pUserData);
+ const OString& getUuid() const { return msUuid; }
+
+ Collaboration* getCollaboration() const;
+ void setCollaboration( Collaboration* pCollaboration );
+
+ // --- following only to be called only by manager's callbacks ---
+ // TODO: make friends instead
+ void setChannel( TpAccount* pAccount, TpDBusTubeChannel* pChannel );
+ bool offerTube();
+ bool acceptTube();
+
+ // Only for callbacks.
+ bool setTube( GDBusConnection* pTube );
+ void setTubeOfferedHandlerInvoked( bool b );
+ bool isTubeOfferedHandlerInvoked() const;
+ bool isMaster() const;
+ void setUuid( const OString& rUuid ) { msUuid = rUuid; }
+
+private:
+ friend class TeleManager;
+ // Used only by TeleManager:
+ /// got tube accepted on other end as well?
+ bool isReady() const;
+
+ // Private:
+ bool spinUntilTubeEstablished();
+
+ Collaboration* mpCollaboration;
+ TpAccount* mpAccount;
+ TpDBusTubeChannel* mpChannel;
+ OString msUuid;
+ bool mbMaster;
+ TeleConferenceImpl* pImpl;
+};
+
+#endif // INCLUDED_TUBES_CONFERENCE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tubes/constants.h b/include/tubes/constants.h
new file mode 100644
index 000000000000..5c34534c8e37
--- /dev/null
+++ b/include/tubes/constants.h
@@ -0,0 +1,54 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Collabora Ltd.
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef INCLUDED_TUBES_CONSTANTS_H
+#define INCLUDED_TUBES_CONSTANTS_H
+
+/* DBusTube.ServiceName.
+ *
+ * FIXME: Should be something like
+ *
+ * org.libreoffice.calc
+ * org.libreoffice.writer
+ *
+ * etc. This does not need to include the org.freedesktop.Telepathy.Client
+ * stuff.
+ */
+#define LIBO_DTUBE_SERVICE "org.libreoffice.calc"
+
+/* Client name suffix, for passing as 'name' to
+ * tp_simple_handler_new_with_am(). */
+#define LIBO_CLIENT_SUFFIX "LibreOffice"
+
+/* Key value storing UUID for TeleConference
+ */
+#define LIBO_TUBES_UUID "LIBO_TUBES_UUID"
+
+#endif // INCLUDED_TUBES_CONSTANTS_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tubes/file-transfer-helper.h b/include/tubes/file-transfer-helper.h
new file mode 100644
index 000000000000..016aed8fdec7
--- /dev/null
+++ b/include/tubes/file-transfer-helper.h
@@ -0,0 +1,125 @@
+/*
+ * empathy-ft-handler.h - Header for EmpathyFTHandler
+ * Copyright (C) 2009 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author: Cosimo Cecchi <cosimo.cecchi@collabora.co.uk>
+ */
+
+/* empathy-ft-handler.h */
+
+#ifndef __EMPATHY_FT_HANDLER_H__
+#define __EMPATHY_FT_HANDLER_H__
+
+#include <glib-object.h>
+#include <gio/gio.h>
+
+#include <telepathy-glib/contact.h>
+#include <telepathy-glib/file-transfer-channel.h>
+
+G_BEGIN_DECLS
+
+#define EMPATHY_TYPE_FT_HANDLER empathy_ft_handler_get_type()
+#define EMPATHY_FT_HANDLER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ EMPATHY_TYPE_FT_HANDLER, EmpathyFTHandler))
+#define EMPATHY_FT_HANDLER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ EMPATHY_TYPE_FT_HANDLER, EmpathyFTHandlerClass))
+#define EMPATHY_IS_FT_HANDLER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMPATHY_TYPE_FT_HANDLER))
+#define EMPATHY_IS_FT_HANDLER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), EMPATHY_TYPE_FT_HANDLER))
+#define EMPATHY_FT_HANDLER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ EMPATHY_TYPE_FT_HANDLER, EmpathyFTHandlerClass))
+
+typedef struct _EmpathyFTHandlerPriv EmpathyFTHandlerPriv;
+
+typedef struct {
+ GObject parent;
+ EmpathyFTHandlerPriv *priv;
+} EmpathyFTHandler;
+
+typedef struct {
+ GObjectClass parent_class;
+} EmpathyFTHandlerClass;
+
+#define EMPATHY_FT_ERROR_QUARK g_quark_from_static_string ("EmpathyFTError")
+
+typedef enum {
+ EMPATHY_FT_ERROR_FAILED,
+ EMPATHY_FT_ERROR_HASH_MISMATCH,
+ EMPATHY_FT_ERROR_TP_ERROR,
+ EMPATHY_FT_ERROR_SOCKET,
+ EMPATHY_FT_ERROR_NOT_SUPPORTED,
+ EMPATHY_FT_ERROR_INVALID_SOURCE_FILE,
+ EMPATHY_FT_ERROR_EMPTY_SOURCE_FILE
+} EmpathyFTErrorEnum;
+
+/**
+ * EmpathyFTHandlerReadyCallback:
+ * @handler: the handler which is now ready
+ * @error: a #GError if the operation failed, or %NULL
+ * @user_data: user data passed to the callback
+ */
+typedef void (* EmpathyFTHandlerReadyCallback) (EmpathyFTHandler *handler,
+ GError *error,
+ gpointer user_data);
+
+GType empathy_ft_handler_get_type (void);
+
+/* public methods */
+void empathy_ft_handler_new_outgoing (
+ TpAccount *account,
+ TpContact *contact,
+ GFile *source,
+ gint64 action_time,
+ EmpathyFTHandlerReadyCallback callback,
+ gpointer user_data);
+void empathy_ft_handler_set_service_name (
+ EmpathyFTHandler *self,
+ const gchar *service_name);
+void empathy_ft_handler_set_description (
+ EmpathyFTHandler *self,
+ const gchar *description);
+
+
+void empathy_ft_handler_new_incoming (TpFileTransferChannel *channel,
+ EmpathyFTHandlerReadyCallback callback,
+ gpointer user_data);
+void empathy_ft_handler_incoming_set_destination (EmpathyFTHandler *handler,
+ GFile *destination);
+
+void empathy_ft_handler_start_transfer (EmpathyFTHandler *handler);
+void empathy_ft_handler_cancel_transfer (EmpathyFTHandler *handler);
+
+/* properties of the transfer */
+const char * empathy_ft_handler_get_filename (EmpathyFTHandler *handler);
+const char * empathy_ft_handler_get_content_type (EmpathyFTHandler *handler);
+TpContact * empathy_ft_handler_get_contact (EmpathyFTHandler *handler);
+GFile * empathy_ft_handler_get_gfile (EmpathyFTHandler *handler);
+const char *empathy_ft_handler_get_description(EmpathyFTHandler*);
+gboolean empathy_ft_handler_get_use_hash (EmpathyFTHandler *handler);
+gboolean empathy_ft_handler_is_incoming (EmpathyFTHandler *handler);
+guint64 empathy_ft_handler_get_transferred_bytes (EmpathyFTHandler *handler);
+guint64 empathy_ft_handler_get_total_bytes (EmpathyFTHandler *handler);
+gboolean empathy_ft_handler_is_completed (EmpathyFTHandler *handler);
+gboolean empathy_ft_handler_is_cancelled (EmpathyFTHandler *handler);
+
+G_END_DECLS
+
+#endif /* __EMPATHY_FT_HANDLER_H__ */
diff --git a/include/tubes/manager.hxx b/include/tubes/manager.hxx
new file mode 100644
index 000000000000..e906e9fd7dd0
--- /dev/null
+++ b/include/tubes/manager.hxx
@@ -0,0 +1,155 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_TUBES_MANAGER_HXX
+#define INCLUDED_TUBES_MANAGER_HXX
+
+#include <sal/config.h>
+#include <tubes/tubesdllapi.h>
+#include <rtl/ustring.hxx>
+
+#include <utility>
+#include <vector>
+
+// For testing purposes, we might need more in future.
+#define LIBO_TUBES_DBUS_INTERFACE "org.libreoffice.calc"
+#define LIBO_TUBES_DBUS_MSG_METHOD "LibOMsg"
+#define LIBO_TUBES_DBUS_PATH "/org/libreoffice/calc"
+
+namespace osl { class Mutex; }
+class Collaboration;
+class TeleConference;
+class TeleManagerImpl;
+typedef struct _TpAccount TpAccount;
+typedef struct _TpContact TpContact;
+
+typedef ::std::pair< TpAccount *, TpContact * > AccountContactPair;
+typedef ::std::vector< AccountContactPair > AccountContactPairV;
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/** Interface to Telepathy DBus Tubes.
+
+ Fragile, not working yet.
+
+ Accounts need to have been setup within Empathy already.
+ */
+
+class TeleManager
+{
+public:
+ /** Prepare tube manager with account and service to be offered/listened
+ to.
+ */
+ TUBES_DLLPUBLIC static bool init( bool bListen );
+
+ TUBES_DLLPUBLIC static void finalize();
+
+ /** True if there has been tube channel received and is still not used. */
+ TUBES_DLLPUBLIC static bool hasWaitingConference();
+
+ /** Get a conference with current UUID to set a session. */
+ TUBES_DLLPUBLIC static TeleConference* getConference();
+
+ /** Connect to DBus, create and prepare the Telepathy Account Manager. */
+ static bool createAccountManager();
+
+ /** Setup client handlers. */
+ static bool registerClients();
+
+ /** Fetches the contact list.
+ Is non-functional until createAccountManager().
+ */
+ // exported for unit test
+ TUBES_DLLPUBLIC static AccountContactPairV getContacts();
+
+ /** Start a demo session where all local documents are shared to each other */
+ static TeleConference* startDemoSession();
+
+ /** Start a group session in a MUC.
+
+ @param pAccount
+ The account to use. This must be a valid Jabber account.
+
+ @param rConferenceRoom
+ The MUC to be created/joined, e.g. "LibreOffice". If empty, the
+ conference's UUID is used.
+
+ @param rConferenceServer
+ Server to create the MUC on, e.g. "conference.example.org". If
+ empty, only the conference's UUID is used and rConferenceRoom is
+ ignored, hopefully resulting in a local DBus tube.
+ */
+ static TeleConference* startGroupSession( TpAccount *pAccount,
+ const OUString& rConferenceRoom,
+ const OUString& rConferenceServer );
+
+ /** Start a session with a buddy.
+
+ @param pAccount
+ The account to use. This must be a valid Jabber account.
+
+ @param pBuddy
+ The buddy to be connected. Must be a contact of pAccount.
+ */
+ // exported for unit test
+ TUBES_DLLPUBLIC static TeleConference* startBuddySession( TpAccount *pAccount, TpContact *pBuddy );
+
+ static void registerCollaboration( Collaboration* pCollaboration );
+ static void unregisterCollaboration( Collaboration* pCollaboration );
+ /** Used to determine whether we are closing the channel by ourselves.
+ * @return true if the Collaboration is still registered */
+ static bool existsCollaboration( Collaboration* pCollaboration );
+ /** Display contact list dialog for all documents. */
+ static void displayAllContacts();
+
+ static void registerDemoConference( TeleConference* pConference );
+ static void unregisterDemoConference( TeleConference* pConference );
+ /** Broadcast packet to all conferences. Used for demo mode. */
+ static void broadcastPacket( const OString& rPacket );
+
+
+ // Only for callbacks.
+ static void addConference( TeleConference* pConference );
+ static OString createUuid();
+ /** @param rUuid
+ is stored so that accepted conference with this UUID could be
+ then retrieved by getConference() when loading new document
+ */
+ static void setCurrentUuid( const OString& rUuid );
+
+ /// "LibreOfficeWhatEver"
+ static OString getFullClientName();
+
+ /// "org.libreoffice.calcWhatEver"
+ static OString getFullServiceName();
+
+ /// "/org/libreoffice/calcWhatEver"
+ static OString getFullObjectPath();
+
+ /** Add a suffix to the client name and DBus tube names, e.g. "WhatEver"
+
+ Normally the client name is LibreOffice and the DBus tube service name
+ is something like org.libreoffice.calc, this modifies the names to
+ "LibreOffice"+pName and "org.libreoffice.calc"+pName to make tests not
+ interfere with the real world. This is not to be used otherwise. If
+ used it must be called before the first TeleManager is instanciated and
+ connects.
+ */
+ // exported for unit test
+ TUBES_DLLPUBLIC static void addSuffixToNames( const char* pName );
+
+private:
+ static TeleManagerImpl* pImpl;
+
+ static ::osl::Mutex& GetMutex();
+};
+
+#endif // INCLUDED_TUBES_MANAGER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tubes/tubesdllapi.h b/include/tubes/tubesdllapi.h
new file mode 100644
index 000000000000..ea1b70770277
--- /dev/null
+++ b/include/tubes/tubesdllapi.h
@@ -0,0 +1,16 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+#ifndef INCLUDED_TUBESDLLAPI_H
+#define INCLUDED_TUBESDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(TUBES_DLLIMPLEMENTATION)
+#define TUBES_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define TUBES_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define TUBES_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_TUBESDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/activedatasink.hxx b/include/ucbhelper/activedatasink.hxx
new file mode 100644
index 000000000000..f58fef55a4c9
--- /dev/null
+++ b/include/ucbhelper/activedatasink.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 _UCBHELPER_ACTIVEDATASINK_HXX
+#define _UCBHELPER_ACTIVEDATASINK_HXX
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/io/XActiveDataSink.hpp>
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper
+{
+
+//=========================================================================
+
+/**
+ * This class implements the interface com::sun::star::io::XActiveDataSink.
+ * Instances of this class can be passed with the parameters of an
+ * "open" command.
+ */
+
+class UCBHELPER_DLLPUBLIC ActiveDataSink : public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::io::XActiveDataSink
+{
+ com::sun::star::uno::Reference<
+ com::sun::star::io::XInputStream > m_xStream;
+
+public:
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XActiveDataSink methods.
+ virtual void SAL_CALL
+ setInputStream( const com::sun::star::uno::Reference<
+ com::sun::star::io::XInputStream >& aStream )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::io::XInputStream > SAL_CALL
+ getInputStream()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+} /* namespace ucbhelper */
+
+#endif /* !_UCBHELPER_ACTIVEDATASINK_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/activedatastreamer.hxx b/include/ucbhelper/activedatastreamer.hxx
new file mode 100644
index 000000000000..2f84ff7543e0
--- /dev/null
+++ b/include/ucbhelper/activedatastreamer.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 _UCBHELPER_ACTIVEDATASTREAMER_HXX
+#define _UCBHELPER_ACTIVEDATASTREAMER_HXX
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/io/XActiveDataStreamer.hpp>
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+
+namespace ucbhelper
+{
+
+//=========================================================================
+
+/**
+ * This class implements the interface com::sun::star::io::XActiveDataStreamer.
+ * Instances of this class can be passed with the parameters of an
+ * "open" command.
+ */
+
+class ActiveDataStreamer : public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::io::XActiveDataStreamer
+{
+ com::sun::star::uno::Reference<
+ com::sun::star::io::XStream > m_xStream;
+
+public:
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XActiveDataStreamer methods.
+ virtual void SAL_CALL setStream( const com::sun::star::uno::Reference< com::sun::star::io::XStream >& xStream )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference< com::sun::star::io::XStream > SAL_CALL getStream()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+} /* namespace ucbhelper */
+
+#endif /* !_UCBHELPER_ACTIVEDATASTREAMER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/cancelcommandexecution.hxx b/include/ucbhelper/cancelcommandexecution.hxx
new file mode 100644
index 000000000000..67e000b33fb3
--- /dev/null
+++ b/include/ucbhelper/cancelcommandexecution.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 _UCBHELPER_CANCELCOMMANDEXECUTION_HXX_
+#define _UCBHELPER_CANCELCOMMANDEXECUTION_HXX_
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Exception.hpp>
+#include <com/sun/star/ucb/IOErrorCode.hpp>
+#include <com/sun/star/ucb/XCommandProcessor.hpp>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace uno { class Any; }
+ namespace ucb { class XCommandEnvironment; }
+} } }
+
+namespace ucbhelper
+{
+
+//============================================================================
+/** Cancel the execution of a command by throwing the appropriate exception.
+ If an Interaction Handler is given with the command environment and the
+ handler handles the exception by selecting the supplied continuation,
+ then this function will put the original exception supplied into a
+ com::sun::star::ucb::CommandFailedException and throw the
+ CommandFailedException. If no handler was given or the handler was not
+ able to handle the exception, then the given exception will be thrown
+ directly.
+
+ NOTE THAT THIS FUNCTION NEVER RETURNS! IT ALWAYS THROWS AN EXCEPTION!
+
+ @param rException is the exception describing the error to handle.
+
+ @param xEnv is the command environment that may contain an Interaction
+ Handler to use before throwing the appropriate exception.
+ */
+UCBHELPER_DLLPUBLIC void cancelCommandExecution( const com::sun::star::uno::Any & rException,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > &
+ xEnv )
+ throw( com::sun::star::uno::Exception );
+
+/** Cancel the execution of a command by throwing the appropriate exception.
+ If an Interaction Handler is given with the command environment and the
+ handler handles the exception by selecting the supplied continuation,
+ then this function will put the original exception supplied into a
+ com::sun::star::ucb::CommandFailedException and throw the
+ CommandFailedException. If no handler was given or the handler was not
+ able to handle the exception, then the given exception will be thrown
+ directly.
+
+ NOTE THAT THIS FUNCTION NEVER RETURNS! IT ALWAYS THROWS AN EXCEPTION!
+
+ @param eError is an IO error code.
+
+ @param rArgs is a sequeence containing the arguments to pass along with
+ the exception. Each IO error code can be combined with one or
+ more additional arguments. Refer to com/sun/star/ucb/IOErroprCode.idl
+ for details.
+
+ @param xEnv is the command environment that may contain an Interaction
+ Handler to use before throwing the appropriate exception.
+
+ @param rMessage is a text containing additional error information.
+ Used as debugging aid only. Passed to the member 'Message' of the
+ uno::Exception thrown by this function.
+
+ @param xContext is the command processor executing the command to cancel.
+ Used as debugging aid only. Passed to the member 'Context' of the
+ uno::Exception thrown by this function.
+ */
+UCBHELPER_DLLPUBLIC void cancelCommandExecution( const com::sun::star::ucb::IOErrorCode eError,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::uno::Any > & rArgs,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > &
+ xEnv,
+ const OUString & rMessage = OUString(),
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandProcessor > &
+ xContext = 0 )
+ throw( com::sun::star::uno::Exception );
+}
+
+#endif // _UCBHELPER_CANCELCOMMANDEXECUTION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/commandenvironment.hxx b/include/ucbhelper/commandenvironment.hxx
new file mode 100644
index 000000000000..01883eee335e
--- /dev/null
+++ b/include/ucbhelper/commandenvironment.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 _UCBHELPER_COMMANDENVIRONMENT_HXX
+#define _UCBHELPER_COMMANDENVIRONMENT_HXX
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper
+{
+
+struct CommandEnvironment_Impl;
+
+//=========================================================================
+
+/**
+ * This class implements the interface
+ * com::sun::star::ucb::XCommandEnvironement. Instances of this class can
+ * be used to supply environments to commands executed by UCB contents.
+ */
+class UCBHELPER_DLLPUBLIC CommandEnvironment : public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XCommandEnvironment
+{
+ CommandEnvironment_Impl* m_pImpl;
+
+private:
+ UCBHELPER_DLLPRIVATE CommandEnvironment( const CommandEnvironment& ); // n.i.
+ UCBHELPER_DLLPRIVATE CommandEnvironment& operator=( const CommandEnvironment& ); // n.i.
+
+public:
+ /**
+ * Constructor.
+ *
+ * @param rxInteractionHandler is the implementation of an Interaction
+ * Handler or an empty reference.
+ * @param rxProgressHandler is the implementation of a Progress
+ * Handler or an empty reference.
+ */
+ CommandEnvironment(
+ const com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionHandler >&
+ rxInteractionHandler,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XProgressHandler >&
+ rxProgressHandler );
+ /**
+ * Destructor.
+ */
+ virtual ~CommandEnvironment();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XCommandEnvironemnt
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionHandler > SAL_CALL
+ getInteractionHandler()
+ throw ( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::ucb::XProgressHandler > SAL_CALL
+ getProgressHandler()
+ throw ( com::sun::star::uno::RuntimeException );
+};
+
+} /* namespace ucbhelper */
+
+#endif /* !_UCBHELPER_COMMANDENVIRONMENT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/content.hxx b/include/ucbhelper/content.hxx
new file mode 100644
index 000000000000..0c5a2b45db5b
--- /dev/null
+++ b/include/ucbhelper/content.hxx
@@ -0,0 +1,719 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _UCBHELPER_CONTENT_HXX
+#define _UCBHELPER_CONTENT_HXX
+
+#include "rtl/ref.hxx"
+#include <com/sun/star/ucb/ContentCreationException.hpp>
+#include <com/sun/star/ucb/CommandAbortedException.hpp>
+#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace beans {
+ class XPropertySetInfo;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace io {
+ class XActiveDataSink;
+ class XOutputStream;
+ class XInputStream;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace sdbc {
+ class XResultSet;
+ class XRow;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ class XCommandEnvironment;
+ class XCommandInfo;
+ class XContent;
+ class XContentIdentifier;
+ class XDynamicResultSet;
+ class XAnyCompareFactory;
+ struct ContentInfo;
+ struct NumberedSortingInfo;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class XComponentContext;
+} } } }
+
+namespace ucbhelper
+{
+
+//=========================================================================
+
+/**
+ * These are the possible values for the parameter eMode of method
+ * ucbhelper::Content::createCursor.
+ */
+enum ResultSetInclude
+{
+ INCLUDE_FOLDERS_ONLY,
+ INCLUDE_DOCUMENTS_ONLY,
+ INCLUDE_FOLDERS_AND_DOCUMENTS
+};
+
+/**
+ * These are the possible values for the parameter eOperation of method
+ * ucbhelper::Content::insertNewContent.
+ */
+enum InsertOperation
+{
+ InsertOperation_COPY, // copy source data
+ InsertOperation_MOVE, // move source data
+ InsertOperation_LINK, // create a link to source
+ InsertOperation_CHECKIN // check-in source data
+};
+
+//=========================================================================
+
+class Content_Impl;
+
+/**
+ * This class simplifies access to UCB contents by providing a more
+ * convenient API for frequently used functionality then the "raw"
+ * UCB-API does.
+ */
+class UCBHELPER_DLLPUBLIC Content
+{
+ rtl::Reference< Content_Impl > m_xImpl;
+
+protected:
+ ::com::sun::star::uno::Any createCursorAny( const ::com::sun::star::uno::Sequence<
+ OUString >& rPropertyNames,
+ ResultSetInclude eMode )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+public:
+ /**
+ * Constructor.
+ */
+ Content();
+
+ /**
+ * Constructor.
+ *
+ * @param rURL is the URL of the content to create.
+ * @param rEnv is the environment to use for commands executed by the
+ * content. The command environment is used by the content
+ * implementation to interact with the client and to propagate
+ * errors.
+ */
+ Content( const OUString& rURL,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >& rEnv,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& rCtx )
+ throw ( ::com::sun::star::ucb::ContentCreationException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Constructor.
+ *
+ * @param rContent is the content object of the content to create.
+ * @param rEnv is the environment to use for commands executed by the
+ * content. The command environment is used by the content
+ * implementation to interact with the client and to propagate
+ * errors.
+ */
+ Content( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContent >& rContent,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >& rEnv,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& rCtx )
+ throw ( ::com::sun::star::ucb::ContentCreationException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Copy Constructor.
+ *
+ * @param rContent is the content this content shall be a copy of.
+ */
+ Content( const Content& rOther );
+
+ /**
+ * Destructor.
+ */
+ ~Content();
+
+ /**
+ * Assignment operator.
+ *
+ * @param rContent is the content this content shall be a copy of.
+ */
+ Content& operator=( const Content& rOther );
+
+ /**
+ * Constructor. This method should be used, if the exception thrown
+ * by the direct ctors of this class are to 'expensive' for your
+ * application
+ *
+ * @param rURL is the URL of the content to create.
+ * @param rEnv is the environment to use for commands executed by the
+ * content. The command environment is used by the content
+ * implementation to interact with the client and to propagate
+ * errors.
+ * @param rContent will be filled by this method with the content created.
+ * @return true, if the operation was successful - false, otherwise.
+ */
+ static sal_Bool
+ create( const OUString& rURL,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >& rEnv,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& rCtx,
+ Content& rContent );
+
+ //////////////////////////////////////////////////////////////////////
+ // Direct access to UCB content.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method provides access to the "native" UCB content interface(s).
+ * This is useful in case the convenience methods provided by this
+ * class are insufficient for your needs. You may obtain all interfaces
+ * supported by the underlying UCB content by calling this method and
+ * after that doing a queryInterface call.
+ *
+ * @return the XContent interface of the underlying UCB content.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent >
+ get() const;
+
+ //////////////////////////////////////////////////////////////////////
+ // Object identity.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns the URL of the content.
+ *
+ * @return the URL of the content.
+ */
+ const OUString& getURL() const;
+
+ //////////////////////////////////////////////////////////////////////
+ // Command environment.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns the environment to use when executing commands.
+ *
+ * @return the command environment.
+ */
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >&
+ getCommandEnvironment() const;
+
+ /**
+ * This method sets a new command environment.
+ *
+ * @param xNewEnv is the new command environment.
+ */
+ void setCommandEnvironment(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >& xNewEnv );
+
+ //////////////////////////////////////////////////////////////////////
+ // Access to supported commands/properties.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This methods provides access to meta data of the commands supported
+ * by this content.
+ *
+ * @return an XCommandInfo interface implementation, which can be used
+ * to obtain meta data of the commands supported by this content.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandInfo >
+ getCommands()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods provides access to meta data of the properties supported
+ * by this content.
+ *
+ * @return an XPropertSetInfo interface implementation, which can be used
+ * to obtain meta data of the properties supported by this content.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySetInfo >
+ getProperties()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ //////////////////////////////////////////////////////////////////////
+ // Access to property value(s).
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method can be used to read a single property value.
+ *
+ * @param rPropertyName is the name of the property for that the value
+ * shall be obtained.
+ * @return the property value.
+ */
+ ::com::sun::star::uno::Any
+ getPropertyValue( const OUString& rPropertyName )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to set a single property value.
+ *
+ * @param rPropertyName is the name of the property for that the
+ * value shall be set.
+ * @return an any containing:
+ * - No value indicates, that the property value was set
+ * successfully.
+ * - com::sun::star::beans::UnknownPropertyException indicates,
+ * that the property is not known to the content implementation.
+ * - com::sun::star::beans::IllegalTypeException indicates, that
+ * the data type of the property value is not acceptable.
+ * - com::sun::star::lang::IllegalAccessException indicates, that
+ * the property is constant.
+ * - com::sun::star::lang::IllegalArgumentException indicates,
+ * that the property value is not acceptable. For instance,
+ * setting an empty title may be illegal.
+ * - Any other execption derived from
+ * com::sun::star::uno::Exception indicates, that the value was
+ * not set successfully. For example, this can be a
+ * com::sun:star::ucb::InteractiveAugmentedIOException
+ * transporting the error code
+ * com::sun::star::ucb::IOErrorCode::ACCESS_DENIED.
+ */
+ ::com::sun::star::uno::Any
+ setPropertyValue( const OUString& rPropertyName,
+ const ::com::sun::star::uno::Any& rValue )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to read multiple property values.
+ *
+ * @param rPropertyNames is a sequence of names of properties for
+ * that the values shall be obtained.
+ * @return the property values.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+ getPropertyValues( const ::com::sun::star::uno::Sequence<
+ OUString >& rPropertyNames )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to read multiple property values.
+ *
+ * @param rPropertyNames is a sequence of names of properties for
+ * that the values shall be obtained.
+ * @return the property values.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
+ getPropertyValuesInterface( const ::com::sun::star::uno::Sequence<
+ OUString >& rPropertyNames )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ /**
+ * This method can be used to set multiple property values.
+ *
+ * @param rPropertyNames is a sequence of names of properties for
+ * that values shall be set.
+ * @return a sequence of any's which has exactly the same number
+ * of elements as the number of properties to set. Every
+ * sequence element contains the status for a property. The
+ * first sequence elements corresponds to the first element in
+ * the sequence of property names and so on.
+ *
+ * An any containing:
+ * - No value indicates, that the property value was set
+ * successfully.
+ * - com::sun::star::beans::UnknownPropertyException indicates,
+ * that the property is not known to the content implementation.
+ * - com::sun::star::beans::IllegalTypeException indicates, that
+ * the data type of the property value is not acceptable.
+ * - com::sun::star::lang::IllegalAccessException indicates, that
+ * the property is constant.
+ * - com::sun::star::lang::IllegalArgumentException indicates,
+ * that the property value is not acceptable. For instance,
+ * setting an empty title may be illegal.
+ * - Any other execption derived from
+ * com::sun::star::uno::Exception indicates, that the value was
+ * not set successfully. For example, this can be a
+ * com::sun:star::ucb::InteractiveAugmentedIOException
+ * transporting the error code
+ * com::sun::star::ucb::IOErrorCode::ACCESS_DENIED.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+ setPropertyValues( const ::com::sun::star::uno::Sequence<
+ OUString >& rPropertyNames,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any >& rValues )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ //////////////////////////////////////////////////////////////////////
+ // General command execution.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method can be used to execute any command supported by the
+ * content.
+ *
+ * @param rCommandName is the name of the command to execute.
+ * @param rCommandArgument is the argument for the command. Type and
+ * values of this parameter must correspond to the command
+ * specification.
+ * @return the result of the command according to its specification.
+ */
+ ::com::sun::star::uno::Any
+ executeCommand( const OUString& rCommandName,
+ const ::com::sun::star::uno::Any& rCommandArgument )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ //////////////////////////////////////////////////////////////////////
+ // Special commands.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This methods gives access to the children of a folder content.
+ * Additionally, the result set returned provides efficient access to
+ * preselected property values of the children.
+ * Internally it executes the command "open" at the content.
+ *
+ * @param rPropertyNames is a sequence of names of properties for
+ * that the values should be accessible via the resultset
+ * returned by this method.
+ * @param eMode is a very simple filter for the children contained
+ * in the resultset.
+ * @return an implementation of the service
+ * com.cun.star.ucb.ContentResultSet, which can be used to
+ * get access to the children of a content.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
+ createCursor( const ::com::sun::star::uno::Sequence<
+ OUString >& rPropertyNames,
+ ResultSetInclude eMode = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods gives access to the children of a folder content.
+ * Additionally, the result set returned provides efficient access to
+ * preselected property values of the children.
+ * Internally it executes the command "open" at the content.
+ *
+ * @param rPropertyNames is a sequence of names of properties for
+ * that the values should be accessible via the resultset
+ * returned by this method.
+ * @param eMode is a very simple filter for the children contained
+ * in the resultset.
+ * @return an implementation of the service
+ * com.cun.star.ucb.DynamicResultSet, which can be used to
+ * get access to the children of a content.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet >
+ createDynamicCursor( const ::com::sun::star::uno::Sequence<
+ OUString >& rPropertyNames,
+ ResultSetInclude eMode
+ = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
+ createSortedCursor( const ::com::sun::star::uno::Sequence< OUString >& rPropertyNames,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo,
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompareFactory > rAnyCompareFactory,
+ ResultSetInclude eMode = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ /**
+ * This methods gives read access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "open" at the content.
+ *
+ * @return an implementation of the interface XInputStream, which can
+ * be used to read the content's data.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ openStream()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods gives read access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "open" at the content.
+ * The method requests opening without locking.
+ *
+ * @return an implementation of the interface XInputStream, which can
+ * be used to read the content's data.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ openStreamNoLock()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ /**
+ * This methods gives read/write access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "open" at the content.
+ *
+ * @return an implementation of the interface XStream, which can
+ * be used to read/write the content's data.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
+ openWriteableStream()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods gives read/write access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "open" at the content.
+ * The method requests opening without locking.
+ *
+ * @return an implementation of the interface XStream, which can
+ * be used to read/write the content's data.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
+ openWriteableStreamNoLock()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ /**
+ * This methods gives read access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "open" at the content.
+ *
+ * @param rSink is the implementation of an XActiveDataSink interface,
+ * which shall be used by the content to deliver the data.
+ */
+ sal_Bool
+ openStream( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XActiveDataSink >& rSink )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods gives read access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "open" at the content.
+ *
+ * @param rStream is the implementation of an XOutputStream interface,
+ * which shall be used by the content to deliver the data.
+ */
+ sal_Bool
+ openStream( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XOutputStream >& rStream )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods gives write access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "insert" at the content.
+ *
+ * @param rStream is the implementation of an XInputStream interface,
+ * which contains the content data to write.
+ * @param bReplaceExisting specifies, whether any existing content data
+ * shall be overwritten.
+ */
+ void
+ writeStream( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream >& rStream,
+ sal_Bool bReplaceExisting )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ /**
+ * This method returns the different types of contents this content
+ * can create.
+ *
+ * @return the content types or an empty sequence if no contents can be
+ * created by this content.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::ContentInfo >
+ queryCreatableContentsInfo()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ /**
+ * This method creates, initializes and inserts ( commits ) a new content
+ * (i.e. it could be used to create a new file system folder).
+ * Internally this method does a
+ * XCommandProcessor::execute( "createNewContent", ... );
+ * XCommandProcessor::execute( "setPropertyValues", ... );
+ * XCommandProcessor::execute( "insert", ... ); calling sequence.
+ *
+ * @param rContentType is the type for the new UCB content. Each content
+ * provider implementation may introduce own types for its content
+ * objects (See queryCreatableContentsInfo()).
+ * @param rPropertyNames is a sequence of names of properties for that
+ * values are to set at the new content before it will be inserted
+ * ( commited ).
+ * The order of the names must correspond to the order of the
+ * property values.
+ * @param rPropertyValues is a sequence of property values that are to
+ * set at the new content before it will be inserted ( commited ).
+ * The order of the values must correspond to the order of the
+ * property names.
+ * @param rNewContent will be filled by the implementation of this method
+ * with the new content.
+ */
+ sal_Bool
+ insertNewContent( const OUString& rContentType,
+ const ::com::sun::star::uno::Sequence<
+ OUString >& rPropertyNames,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any >& rPropertyValues,
+ Content& rNewContent )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method creates, initializes and inserts (commits) a new content
+ * inside this (the target folder) content. For example, it can be used to
+ * create a new file system file.
+ * Internally this method does a
+ * XCommandProcessor::execute( "createNewContent", ... );
+ * XCommandProcessor::execute( "setPropertyValues", ... );
+ * XCommandProcessor::execute( "insert", ... ); calling sequence.
+ *
+ * @param rContentType is the type for the new UCB content. Each content
+ * provider implementation may introduce own types for its content
+ * objects (See queryCreatableContentsInfo()).
+ * @param rPropertyNames is a sequence of names of properties for that
+ * values are to set at the new content before it will be inserted
+ * ( commited ).
+ * The order of the names must correspond to the order of the
+ * property values.
+ * @param rPropertyValues is a sequence of property values that are to
+ * set at the new content before it will be inserted ( commited ).
+ * The order of the values must correspond to the order of the
+ * property names.
+ * @param rStream is a stream containing the content data for the new
+ * content (i.e. the content of a file to create)
+ * @param rNewContent will be filled by the implementation of this method
+ * with the new content.
+ */
+ sal_Bool
+ insertNewContent( const OUString& rContentType,
+ const ::com::sun::star::uno::Sequence<
+ OUString >& rPropertyNames,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any >& rPropertyValues,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream >& rStream,
+ Content& rNewContent )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ /**
+ * This method transfers (copies/moves) a content. It creates a new
+ * resource inside this (the target folder) content.
+ * The implementation is able to do cross-provider transfers (like copying
+ * a file from the local file system to a directory located on an HTTP
+ * server).
+ * Internally this method executes the command "globalTransfer" at the UCB.
+ *
+ * @param rSourceContent is the content that contains the data for the
+ * new UCB content.
+ * @param eOperation defines what shall be done with the source data
+ * ( COPY, MOVE, LINK ).
+ * @param rTitle contains a title for the new content. If this is an empty
+ * string, the new content will have the same title as the source
+ * content.
+ * @param rNameClashAction describes how the implementation shall behave
+ * in case a content with a clashing name exists in the target
+ * folder.
+ * NameClash::ERROR will abort the operation, NameClash::OVERWRITE
+ * will overwrite the clashing content and all its data,
+ * NameClash::RENAME will generate and supply a non-clashing title.
+ * @see com/sun/star/ucb/NameClash.idl
+ * @param rMimeType contains the MIME type of the document to write.
+ * @param bMajorVersion tells to create a new major version for checkin operations
+ * @param rCommentVersion contains the comment to use for checkin operations
+ * @param rResultURL is a hacky way to get the update URL after the operation in
+ * case there was a change (introduced for the checkin operation)
+ */
+ sal_Bool
+ transferContent( const Content& rSourceContent,
+ InsertOperation eOperation,
+ const OUString & rTitle,
+ const sal_Int32 nNameClashAction,
+ const OUString & rMimeType = OUString( ),
+ bool bMajorVersion = false,
+ const OUString & rCommentVersion = OUString( ),
+ OUString* pResultURL = NULL )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ //////////////////////////////////////////////////////////////////////
+ // Required properties.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns the value of the content's property "IsFolder".
+ *
+ * @return true, if the content is a folder ( it can contain other
+ * UCB contents). false, otherwise.
+ */
+ sal_Bool
+ isFolder()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method returns the value of the content's property "IsDocument".
+ *
+ * @return true, if the content is a document ( it has a content stream ).
+ * false, otherwise.
+ */
+ sal_Bool
+ isDocument()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+};
+
+} /* namespace ucbhelper */
+
+#endif /* !_UCBHELPER_CONTENT_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/contenthelper.hxx b/include/ucbhelper/contenthelper.hxx
new file mode 100644
index 000000000000..e903d97f193a
--- /dev/null
+++ b/include/ucbhelper/contenthelper.hxx
@@ -0,0 +1,504 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UCBHELPER_CONTENTHELPER_HXX
+#define _UCBHELPER_CONTENTHELPER_HXX
+
+#include <com/sun/star/beans/XPropertyContainer.hpp>
+#include <com/sun/star/beans/XPropertiesChangeNotifier.hpp>
+#include <com/sun/star/ucb/XCommandProcessor.hpp>
+#include <com/sun/star/ucb/XContent.hpp>
+#include <com/sun/star/beans/XPropertySetInfoChangeNotifier.hpp>
+#include <com/sun/star/ucb/XCommandInfoChangeNotifier.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/ucb/CommandAbortedException.hpp>
+#include <cppuhelper/weak.hxx>
+
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ struct CommandInfo;
+ class XCommandEnvironment;
+ class XCommandInfo;
+ class XPersistentPropertySet;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace beans {
+ struct Property;
+ class XPropertySetInfo;
+} } } }
+
+namespace ucbhelper_impl { struct ContentImplHelper_Impl; }
+
+namespace ucbhelper
+{
+
+//=========================================================================
+
+class ContentProviderImplHelper;
+
+/**
+ * This is an abstract base class for implementations of the service
+ * com.sun.star.ucb.Content. Implementations derived from this class are
+ * objects provided by implementations derived from
+ * class ucb::ContentProviderImplHelper.
+ *
+ * Features of the base class implementation:
+ * - standard interfaces ( XInterface, XTypeProvider, XServiceInfo )
+ * - all required interfaces for service com::sun::star::ucb::Content
+ * - all required listener containers
+ * ( XComponent, XPropertiesChangeNotifier, XPropertySetInfoChangeNotifier,
+ * XCommandInfoChangeNotifier )
+ * - XPropertyContainer implementation ( persistence is implemented using
+ * service com.sun.star.ucb.Store )
+ * - complete XPropertySetInfo implementation ( including Additioanl Core
+ * Properties supplied via XPropertyContainer interface )
+ * -> protected method: getPropertySetInfo
+ * - complete XCommandInfo implementation
+ * -> protected method: getCommandInfo
+ */
+class UCBHELPER_DLLPUBLIC ContentImplHelper :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::lang::XServiceInfo,
+ public com::sun::star::lang::XComponent,
+ public com::sun::star::ucb::XContent,
+ public com::sun::star::ucb::XCommandProcessor,
+ public com::sun::star::beans::XPropertiesChangeNotifier,
+ public com::sun::star::beans::XPropertyContainer,
+ public com::sun::star::beans::XPropertySetInfoChangeNotifier,
+ public com::sun::star::ucb::XCommandInfoChangeNotifier,
+ public com::sun::star::container::XChild
+{
+ friend class PropertySetInfo;
+ friend class CommandProcessorInfo;
+
+ ucbhelper_impl::ContentImplHelper_Impl* m_pImpl;
+
+protected:
+ osl::Mutex m_aMutex;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ m_xContext;
+ com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >
+ m_xIdentifier;
+ rtl::Reference< ContentProviderImplHelper >
+ m_xProvider;
+ sal_uInt32 m_nCommandId;
+
+private:
+ /**
+ * Your implementation of this method must return a sequence containing
+ * the meta data of the properties supported by the content.
+ * Note: If you wish to provide your own implementation of the interface
+ * XPropertyContainer ( completely override addContent and removeContent
+ * implementation of this base class in this case ), you can supply the
+ * meta data for your Additional Core Properties here to get a fully
+ * featured getPropertySetInfo method ( see below ).
+ *
+ * @param xEnv is an environment to use for example, for interactions.
+ * @return a sequence containing the property meta data.
+ */
+ UCBHELPER_DLLPRIVATE
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
+ getProperties( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > & xEnv ) = 0;
+
+ /**
+ * Your implementation of this method must return a sequence containing
+ * the meta data of the commands supported by the content.
+ *
+ * @param xEnv is an environment to use for example, for interactions.
+ * @return a sequence containing the command meta data.
+ */
+ UCBHELPER_DLLPRIVATE
+ virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo >
+ getCommands( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > & xEnv ) = 0;
+
+ /**
+ * The implementation of this method shall return the URL of the parent
+ * of your content.
+ *
+ * @return the URL of the parent content or an empty string.
+ * Note that not all contents must have one parent. There may
+ * be contents with no parent. In that case an empty string must
+ * be returned. If your content has more than one parent you may
+ * return the URL of one "preferred" parent or an empty string.
+ */
+ UCBHELPER_DLLPRIVATE virtual OUString getParentURL() = 0;
+
+protected:
+ /**
+ * This method returns complete meta data for the properties ( including
+ * Additional Core Properties supplied via XPropertyContainer interface )
+ * supported by the content. To implement the required command
+ * "getPropertySetInfo" simply return the return value of this method.
+ *
+ * @param xEnv is an environment to use for example, for interactions.
+ * @param bCache indicates, whether the implemetation should use
+ * cached data, if exist.
+ * @return an XPropertySetInfo implementation object containing meta data
+ * for the properties supported by this content.
+ */
+ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo >
+ getPropertySetInfo( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > & xEnv,
+ sal_Bool bCache = sal_True );
+
+ /**
+ * This method returns complete meta data for the commands supported by
+ * the content. To implement the required command "getCommandInfo" simply
+ * return the return value of this method.
+ *
+ * @param xEnv is an environment to use for example, for interactions.
+ * @param bCache indicates, whether the implemetation should use
+ * cached data, if exist.
+ * @return an XCommandInfo implementation object containing meta data
+ * for the commands supported by this content.
+ */
+ com::sun::star::uno::Reference< com::sun::star::ucb::XCommandInfo >
+ getCommandInfo( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > & xEnv,
+ sal_Bool bCache = sal_True );
+
+ /**
+ * This method can be used to propagate changes of property values.
+ *
+ * @param evt is a sequence of property change events.
+ */
+ void notifyPropertiesChange(
+ const com::sun::star::uno::Sequence<
+ com::sun::star::beans::PropertyChangeEvent >& evt ) const;
+
+ /**
+ * This method can be used to propagate changes of the propertyset
+ * info of your content (i.e. this happens if a new property is added
+ * to your content via its XPropertyContainer interface). This base class
+ * automatically generates events when the propertyset info changes. If
+ * you provide your own implementations of addproperty and removeProperty,
+ * then you must call "notifyPropertySetInfoChange" by yourself.
+ *
+ * @param evt is a sequence of property change events.
+ */
+ void notifyPropertySetInfoChange(
+ const com::sun::star::beans::PropertySetInfoChangeEvent& evt ) const;
+
+ /**
+ * This method can be used to propagate content events.
+ *
+ * @param evt is a sequence of content events.
+ */
+ void notifyContentEvent(
+ const com::sun::star::ucb::ContentEvent& evt ) const;
+
+ /**
+ * Use this method to announce the insertion of this content at
+ * the end of your implementation of the command "insert". The
+ * implementation of is method propagates a ContentEvent( INSERTED ).
+ */
+ void inserted();
+
+ /**
+ * Use this method to announce the destruction of this content at
+ * the end of your implementation of the command "delete". The
+ * implementation of is method propagates a ContentEvent( DELETED )
+ * and a ContentEvent( REMOVED ) at the parent of the deleted content,
+ * if a parent exists.
+ */
+ void deleted();
+
+ /**
+ * Use this method to change the identity of a content. The implementation
+ * of this method will replace the content identifier of the content and
+ * propagate the appropriate ContentEvent( EXCHANGED ).
+ *
+ * @param rNewId is the new content identifier for the contant.
+ * @return a success indicator.
+ */
+ sal_Bool exchange( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentIdentifier >& rNewId );
+
+ /**
+ * Use this method to get access to the Additional Core Properties of
+ * the content ( added using content's XPropertyContainer interface ).
+ * If you supply your own XPropertyContainer implementation, this method
+ * will always return an empty propertyset.
+ *
+ * @param bCreate indicates whether a new propertyset shall be created
+ * if it does not exist.
+ * @return the implementation of the service
+ * com.sun.star.ucb.PersistentPropertySet.
+ */
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XPersistentPropertySet >
+ getAdditionalPropertySet( sal_Bool bCreate );
+
+ /**
+ * This method renames the propertyset containing the Additional Core
+ * Properties of the content.
+ *
+ * @param rOldKey is the old key of the propertyset.
+ * @param rNewKey is the new key for the propertyset.
+ * @param bRecursive is a flag indicating whether propertysets for
+ * children described by rOldKey shall be renamed too.
+ * @return True, if the operation succeeded - False, otherwise.
+ */
+ sal_Bool renameAdditionalPropertySet( const OUString& rOldKey,
+ const OUString& rNewKey,
+ sal_Bool bRecursive );
+
+ /**
+ * This method copies the propertyset containing the Additional Core
+ * Properties of the content.
+ *
+ * @param rSourceKey is the key of the source propertyset.
+ * @param rTargetKey is the key of the target propertyset.
+ * @param bRecursive is a flag indicating whether propertysets for
+ * children described by rSourceKey shall be copied too.
+ * @return True, if the operation succeeded - False, otherwise.
+ */
+ sal_Bool copyAdditionalPropertySet( const OUString& rSourceKey,
+ const OUString& rTargetKey,
+ sal_Bool bRecursive );
+
+ /**
+ * This method removes the propertyset containing the Additional Core
+ * Properties of the content.
+ *
+ * @param bRecursive is a flag indicating whether propertysets for
+ * children described by rOldKey shall be removed too.
+ * @return True, if the operation succeeded - False, otherwise.
+ */
+ sal_Bool removeAdditionalPropertySet( sal_Bool bRecursive );
+
+public:
+ /**
+ * Constructor.
+ *
+ * Note that the implementation of this ctor registers itself at its
+ * content provider. The provider implementation inserts the content
+ * in a hash map. So it easyly can be found and reused when the provider
+ * is asked for a content.
+ *
+ * @param rxContext is a Service Manager.
+ * @param rxProvider is the provider for the content.
+ * @param Identifier is the content identifier for the content.
+ */
+ ContentImplHelper(
+ const com::sun::star::uno::Reference<
+ com::sun::star::uno::XComponentContext >& rxContext,
+ const rtl::Reference< ContentProviderImplHelper >& rxProvider,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentIdentifier >& Identifier );
+
+ /**
+ * Destructor.
+ *
+ * Note that the implementation of this dtor deregisters itself from its
+ * content provider. The provider implementation removes the content
+ * from a hash map.
+ */
+ virtual ~ContentImplHelper();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XServiceInfo
+ virtual OUString SAL_CALL
+ getImplementationName()
+ throw( ::com::sun::star::uno::RuntimeException ) = 0;
+ virtual sal_Bool SAL_CALL
+ supportsService( const OUString& ServiceName )
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
+ getSupportedServiceNames()
+ throw( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XComponent
+ virtual void SAL_CALL
+ dispose()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ addEventListener( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removeEventListener( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XContent
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentIdentifier > SAL_CALL
+ getIdentifier()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL
+ getContentType()
+ throw( com::sun::star::uno::RuntimeException ) = 0;
+ virtual void SAL_CALL
+ addContentEventListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removeContentEventListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XCommandProcessor
+ virtual sal_Int32 SAL_CALL
+ createCommandIdentifier()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Any SAL_CALL
+ execute( const com::sun::star::ucb::Command& aCommand,
+ sal_Int32 CommandId,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >& Environment )
+ throw( com::sun::star::uno::Exception,
+ com::sun::star::ucb::CommandAbortedException,
+ com::sun::star::uno::RuntimeException ) = 0;
+ virtual void SAL_CALL
+ abort( sal_Int32 CommandId )
+ throw( com::sun::star::uno::RuntimeException ) = 0;
+
+ // XPropertiesChangeNotifier
+ virtual void SAL_CALL
+ addPropertiesChangeListener(
+ const com::sun::star::uno::Sequence< OUString >& PropertyNames,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removePropertiesChangeListener(
+ const com::sun::star::uno::Sequence< OUString >& PropertyNames,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XCommandInfoChangeNotifier
+ virtual void SAL_CALL
+ addCommandInfoChangeListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandInfoChangeListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removeCommandInfoChangeListener(
+ const com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandInfoChangeListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XPropertyContainer
+
+ /**
+ * This method adds a property to the content according to the interface
+ * specification. The properties will be stored using the service
+ * com.sun.star.ucb.Store.
+ *
+ * Note: You may provide your own implementation of this method, for
+ * instance, if your data source supports adding/removing of properties.
+ * Don't forget to return the meta data for these properties in your
+ * implementation of getPropertyInfoTable.
+ */
+ virtual void SAL_CALL
+ addProperty( const OUString& Name,
+ sal_Int16 Attributes,
+ const com::sun::star::uno::Any& DefaultValue )
+ throw( com::sun::star::beans::PropertyExistException,
+ com::sun::star::beans::IllegalTypeException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::uno::RuntimeException );
+
+ /**
+ * This method removes a property from the content according to the
+ * interface specification. The properties will be stored using the
+ * service com.sun.star.ucb.Store.
+ *
+ * Note: You may provide your own implementation of this method, for
+ * instance, if your data source supports adding/removing of properties.
+ * Don't forget to return the meta data for these properties in your
+ * implementation of getPropertyInfoTable.
+ */
+ virtual void SAL_CALL
+ removeProperty( const OUString& Name )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::beans::NotRemoveableException,
+ com::sun::star::uno::RuntimeException );
+
+ // XPropertySetInfoChangeNotifier
+ virtual void SAL_CALL
+ addPropertySetInfoChangeListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySetInfoChangeListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removePropertySetInfoChangeListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySetInfoChangeListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XChild
+
+ /**
+ * This method returns the content representing the parent of a content,
+ * if such a parent exists. The implementation of this method uses your
+ * implementation of getParentURL.
+ */
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::uno::XInterface > SAL_CALL
+ getParent()
+ throw( com::sun::star::uno::RuntimeException );
+
+ /**
+ * The implementation of this method always throws a NoSupportException.
+ */
+ virtual void SAL_CALL
+ setParent( const com::sun::star::uno::Reference<
+ com::sun::star::uno::XInterface >& Parent )
+ throw( com::sun::star::lang::NoSupportException,
+ com::sun::star::uno::RuntimeException );
+
+ //////////////////////////////////////////////////////////////////////
+ // Non-interface methods.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns the provider of the content.
+ *
+ * @return the provider of the content.
+ */
+ const rtl::Reference< ContentProviderImplHelper >& getProvider() const
+ { return m_xProvider; }
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_CONTENTHELPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/contentidentifier.hxx b/include/ucbhelper/contentidentifier.hxx
new file mode 100644
index 000000000000..4aa5459806f1
--- /dev/null
+++ b/include/ucbhelper/contentidentifier.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 _UCBHELPER_CONTENTIDENTIFIER_HXX
+#define _UCBHELPER_CONTENTIDENTIFIER_HXX
+
+#include <cppuhelper/weak.hxx>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/ucb/XContentIdentifier.hpp>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+
+namespace ucbhelper
+{
+
+struct ContentIdentifier_Impl;
+
+//=========================================================================
+
+/**
+ * This class implements a simple identifier object for UCB contents.
+ * It mainly stores and returns the URL as it was passed to the constructor -
+ * The only difference is that the URL scheme will be lower cased. This can
+ * be done, because URL schemes are never case sensitive.
+ */
+class UCBHELPER_DLLPUBLIC ContentIdentifier :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XContentIdentifier
+{
+public:
+ ContentIdentifier( const OUString& rURL );
+ virtual ~ContentIdentifier();
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ acquire() throw();
+ virtual void SAL_CALL
+ release() throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XContentIdentifier
+ virtual OUString SAL_CALL
+ getContentIdentifier()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL
+ getContentProviderScheme()
+ throw( com::sun::star::uno::RuntimeException );
+
+private:
+ ContentIdentifier_Impl* m_pImpl;
+};
+
+} /* namespace ucbhelper */
+
+#endif /* !_UCBHELPER_CONTENTIDENTIFIER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/contentinfo.hxx b/include/ucbhelper/contentinfo.hxx
new file mode 100644
index 000000000000..347c86304359
--- /dev/null
+++ b/include/ucbhelper/contentinfo.hxx
@@ -0,0 +1,162 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UCBHELPER_CONTENTINFO_HXX
+#define _UCBHELPER_CONTENTINFO_HXX
+
+#include <com/sun/star/ucb/XCommandInfo.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <cppuhelper/weak.hxx>
+
+#include "osl/mutex.hxx"
+#include <ucbhelper/macros.hxx>
+
+namespace ucbhelper {
+
+//============================================================================
+//
+// class PropertySetInfo.
+//
+//============================================================================
+
+class ContentImplHelper;
+
+/**
+ * This class provides a propertyset info ( the complete implementation of
+ * the interface XPropertySetInfo ) for an object derived from class
+ * ucb::ContentImplHelper. The implementation takes care about Additional
+ * Core Properties that may have been added to the content.
+ */
+class PropertySetInfo :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::beans::XPropertySetInfo
+{
+ com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >
+ m_xEnv;
+ com::sun::star::uno::Sequence< com::sun::star::beans::Property >*
+ m_pProps;
+ osl::Mutex m_aMutex;
+ ContentImplHelper* m_pContent;
+
+private:
+ sal_Bool queryProperty( const OUString& rName,
+ com::sun::star::beans::Property& rProp );
+
+public:
+ PropertySetInfo( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >& rxEnv,
+ ContentImplHelper* pContent );
+ virtual ~PropertySetInfo();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XPropertySetInfo
+ virtual com::sun::star::uno::Sequence<
+ com::sun::star::beans::Property > SAL_CALL
+ getProperties()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::beans::Property SAL_CALL
+ getPropertyByName( const OUString& aName )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ hasPropertyByName( const OUString& Name )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // Non-Interface methods.
+ void reset();
+};
+
+//============================================================================
+//
+// class CommandProcessorInfo.
+//
+//============================================================================
+
+/**
+ * This class provides a command info ( the complete implementation of
+ * the interface XCommandInfo ) for an object derived from class
+ * ucb::ContentImplHelper.
+ */
+class CommandProcessorInfo :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XCommandInfo
+{
+ com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >
+ m_xEnv;
+ com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo >*
+ m_pCommands;
+ osl::Mutex m_aMutex;
+ ContentImplHelper* m_pContent;
+
+private:
+ sal_Bool queryCommand( const OUString& rName,
+ com::sun::star::ucb::CommandInfo& rCommand );
+ sal_Bool queryCommand( sal_Int32 nHandle,
+ com::sun::star::ucb::CommandInfo& rCommand );
+
+public:
+ CommandProcessorInfo( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >& rxEnv,
+ ContentImplHelper* pContent );
+ virtual ~CommandProcessorInfo();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XCommandInfo
+ virtual com::sun::star::uno::Sequence<
+ com::sun::star::ucb::CommandInfo > SAL_CALL
+ getCommands()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::ucb::CommandInfo SAL_CALL
+ getCommandInfoByName( const OUString& Name )
+ throw( com::sun::star::ucb::UnsupportedCommandException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::ucb::CommandInfo SAL_CALL
+ getCommandInfoByHandle( sal_Int32 Handle )
+ throw( com::sun::star::ucb::UnsupportedCommandException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ hasCommandByName( const OUString& Name )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ hasCommandByHandle( sal_Int32 Handle )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // Non-Interface methods.
+ void reset();
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_CONTENTINFO_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/fd_inputstream.hxx b/include/ucbhelper/fd_inputstream.hxx
new file mode 100644
index 000000000000..df3d6e386b67
--- /dev/null
+++ b/include/ucbhelper/fd_inputstream.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 _UCBHELPER_FD_INPUTSTREAM_HXX_
+#define _UCBHELPER_FD_INPUTSTREAM_HXX_
+
+#include <rtl/ustring.hxx>
+#include <osl/mutex.hxx>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/queryinterface.hxx>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <stdio.h>
+
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper
+{
+ /** Implements a seekable InputStream
+ * working on a buffer.
+ */
+ class UCBHELPER_DLLPUBLIC FdInputStream
+ : public cppu::OWeakObject,
+ public com::sun::star::io::XInputStream,
+ public com::sun::star::io::XSeekable
+ {
+ public:
+
+ /** Defines the storage kind found
+ * on which the inputstream acts.
+ */
+
+ FdInputStream(FILE* tmpfl = 0);
+
+ ~FdInputStream();
+
+ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& rType)
+ throw(css::uno::RuntimeException);
+
+ virtual void SAL_CALL acquire(void) throw();
+
+ virtual void SAL_CALL release(void) throw();
+
+ virtual sal_Int32 SAL_CALL
+ readBytes(css::uno::Sequence< sal_Int8 >& aData,
+ sal_Int32 nBytesToRead)
+ throw( css::io::NotConnectedException,
+ css::io::BufferSizeExceededException,
+ css::io::IOException,
+ css::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL
+ readSomeBytes(css::uno::Sequence< sal_Int8 >& aData,
+ sal_Int32 nMaxBytesToRead )
+ throw( css::io::NotConnectedException,
+ css::io::BufferSizeExceededException,
+ css::io::IOException,
+ css::uno::RuntimeException);
+
+ virtual void SAL_CALL
+ skipBytes(sal_Int32 nBytesToSkip)
+ throw(css::io::NotConnectedException,
+ css::io::BufferSizeExceededException,
+ css::io::IOException,
+ css::uno::RuntimeException );
+
+ virtual sal_Int32 SAL_CALL
+ available(void)
+ throw(css::io::NotConnectedException,
+ css::io::IOException,
+ css::uno::RuntimeException );
+
+ virtual void SAL_CALL
+ closeInput(void)
+ throw(css::io::NotConnectedException,
+ css::io::IOException,
+ css::uno::RuntimeException);
+
+
+ /** XSeekable
+ */
+
+ virtual void SAL_CALL
+ seek(sal_Int64 location)
+ throw(css::lang::IllegalArgumentException,
+ css::io::IOException,
+ css::uno::RuntimeException);
+
+
+ virtual sal_Int64 SAL_CALL
+ getPosition(void)
+ throw(css::io::IOException,
+ css::uno::RuntimeException);
+
+
+ virtual sal_Int64 SAL_CALL
+ getLength(void)
+ throw(css::io::IOException,
+ css::uno::RuntimeException);
+
+ // additional
+// void append(const void* pBuffer,size_t size,size_t nmemb);
+
+ private:
+
+ osl::Mutex m_aMutex;
+ FILE* m_tmpfl;
+ sal_Int64 m_nLength;
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/fileidentifierconverter.hxx b/include/ucbhelper/fileidentifierconverter.hxx
new file mode 100644
index 000000000000..052a7413bf93
--- /dev/null
+++ b/include/ucbhelper/fileidentifierconverter.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 _UCBHELPER_FILEIDENTIFIERCONVERTER_HXX_
+#define _UCBHELPER_FILEIDENTIFIERCONVERTER_HXX_
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <sal/types.h>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ class XUniversalContentBroker;
+} } } }
+
+namespace ucbhelper {
+
+//============================================================================
+/** Get a 'root' URL for the most 'local' file content provider.
+
+ @descr
+ The result can be used as the rBaseURL parameter of
+ ucb::getFileURLFromSystemPath().
+
+ @returns
+ either a 'root' URL for the most 'local' file content provider, or an
+ empty string, if no such URL can meaningfully be constructed.
+ */
+UCBHELPER_DLLPUBLIC OUString getLocalFileURL()
+ SAL_THROW((com::sun::star::uno::RuntimeException));
+
+//============================================================================
+/** Using a specific content provider manager, convert a file path in system
+ dependent notation to a (file) URL.
+
+ @param rManager
+ A content provider manager. Must not be null.
+
+ @param rBaseURL
+ See the corresponding parameter of
+ com::sun::star::ucb::XFileIdentifierConverter::getFileURLFromSystemPath().
+
+ @param rURL
+ See the corresponding parameter of
+ com::sun::star::ucb::XFileIdentifierConverter::getFileURLFromSystemPath().
+
+ @returns
+ a URL, if the content provider registered at the content provider manager
+ that is responsible for the base URL returns a URL when calling
+ com::sun::star::ucb::XFileIdentiferConverter::getFileURLFromSystemPath()
+ on it. Otherwise, an empty string is returned.
+
+ @see
+ com::sun::star::ucb::XFileIdentiferConverter::getFileURLFromSystemPath().
+ */
+UCBHELPER_DLLPUBLIC OUString
+getFileURLFromSystemPath(
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XUniversalContentBroker > const &
+ rUcb,
+ OUString const & rBaseURL,
+ OUString const & rSystemPath)
+ SAL_THROW((com::sun::star::uno::RuntimeException));
+
+//============================================================================
+/** Using a specific content provider manager, convert a (file) URL to a
+ file path in system dependent notation.
+
+ @param rManager
+ A content provider manager. Must not be null.
+
+ @param rURL
+ See the corresponding parameter of
+ com::sun::star::ucb::XFileIdentiferConverter::getSystemPathFromFileURL().
+
+ @returns
+ a system path, if the content provider registered at the content provider
+ manager that is responsible for the base URL returns a system path when
+ calling
+ com::sun::star::ucb::XFileIdentiferConverter::getSystemPathFromFileURL()
+ on it. Otherwise, an empty string is returned.
+
+ @see
+ com::sun::star::ucb::XFileIdentiferConverter::getSystemPathFromFileURL().
+ */
+UCBHELPER_DLLPUBLIC OUString
+getSystemPathFromFileURL(
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XUniversalContentBroker > const &
+ rUcb,
+ OUString const & rURL)
+ SAL_THROW((com::sun::star::uno::RuntimeException));
+
+}
+
+#endif // _UCBHELPER_FILEIDENTIFIERCONVERTER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/getcomponentcontext.hxx b/include/ucbhelper/getcomponentcontext.hxx
new file mode 100644
index 000000000000..5d25e6cf8e9b
--- /dev/null
+++ b/include/ucbhelper/getcomponentcontext.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_UCBHELPER_GETCOMPONENTCONTEXT_HXX
+#define INCLUDED_UCBHELPER_GETCOMPONENTCONTEXT_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace lang { class XMultiServiceFactory; }
+ namespace uno { class XComponentContext; }
+} } }
+
+namespace ucbhelper {
+
+//TODO: a duplicate of comphelper::getComponentContext
+// (comphelper/processfactory.hxx)
+UCBHELPER_DLLPUBLIC
+com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+getComponentContext(
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ const & factory);
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/interactionrequest.hxx b/include/ucbhelper/interactionrequest.hxx
new file mode 100644
index 000000000000..6de19931238c
--- /dev/null
+++ b/include/ucbhelper/interactionrequest.hxx
@@ -0,0 +1,721 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UCBHELPER_INTERATIONREQUEST_HXX
+#define _UCBHELPER_INTERATIONREQUEST_HXX
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <com/sun/star/task/XInteractionAbort.hpp>
+#include <com/sun/star/task/XInteractionRetry.hpp>
+#include <com/sun/star/task/XInteractionApprove.hpp>
+#include <com/sun/star/task/XInteractionDisapprove.hpp>
+#include <com/sun/star/ucb/XInteractionReplaceExistingData.hpp>
+#include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp>
+#include <com/sun/star/ucb/XInteractionSupplyName.hpp>
+#include <rtl/ref.hxx>
+#include <cppuhelper/weak.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper {
+
+class InteractionContinuation;
+
+//============================================================================
+struct InteractionRequest_Impl;
+
+/**
+ * This class implements the interface XInteractionRequest. Instances can
+ * be passed directly to XInteractionHandler::handle(...). Each interaction
+ * request contains an exception describing the error and a number of
+ * interaction continuations describing the possible "answers" for the request.
+ * After the request was passed to XInteractionHandler::handle(...) the method
+ * getSelection() returns the continuation choosen by the interaction handler.
+ *
+ * The typical usage of this class would be:
+ *
+ * 1) Create exception object that shall be handled by the interaction handler.
+ * 2) Create InteractionRequest, supply exception as ctor parameter
+ * 3) Create continuations needed and add them to a sequence
+ * 4) Supply the continuations to the InteractionRequest by calling
+ * setContinuations(...)
+ *
+ * This class can also be used as base class for more specialized requests,
+ * like authentication requests.
+ */
+class UCBHELPER_DLLPUBLIC InteractionRequest : public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::task::XInteractionRequest
+{
+ InteractionRequest_Impl * m_pImpl;
+
+protected:
+ void setRequest( const com::sun::star::uno::Any & rRequest );
+
+ InteractionRequest();
+ virtual ~InteractionRequest();
+
+public:
+ /**
+ * Constructor.
+ *
+ * @param rRequest is the exception describing the error.
+ */
+ InteractionRequest( const com::sun::star::uno::Any & rRequest );
+
+ /**
+ * This method sets the continuations for the request.
+ *
+ * @param rContinuations contains the possible continuations.
+ */
+ void setContinuations(
+ const com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > > &
+ rContinuations );
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionRequest
+ virtual com::sun::star::uno::Any SAL_CALL
+ getRequest()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > > SAL_CALL
+ getContinuations()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // Non-interface methods.
+
+ /**
+ * After passing this request to XInteractionHandler::handle, this method
+ * returns the continuation that was choosen by the interaction handler.
+ *
+ * @return the continuation choosen by an interaction handler or an empty
+ * reference, if the request was not (yet) handled.
+ */
+ rtl::Reference< InteractionContinuation > getSelection() const;
+
+ /**
+ * This method sets a continuation for the request. It also can be used
+ * to reset the continuation set by a previous XInteractionHandler::handle
+ * call in order to use this request object more then once.
+ *
+ * @param rxSelection is the interaction continuation to activate for
+ * the request or an empty reference in order to reset the
+ * current selection.
+ */
+ void
+ setSelection(
+ const rtl::Reference< InteractionContinuation > & rxSelection );
+};
+
+//============================================================================
+struct InteractionContinuation_Impl;
+
+/**
+ * This class is the base for implementations of the interface
+ * XInteractionContinuation. Classes derived from this bas class work together
+ * with class InteractionRequest.
+ *
+ * Derived classes must implement their XInteractionContinuation::select()
+ * method the way that they simply call recordSelection() which is provided by
+ * this class.
+ */
+class UCBHELPER_DLLPUBLIC InteractionContinuation : public cppu::OWeakObject
+{
+ InteractionContinuation_Impl * m_pImpl;
+
+protected:
+ /**
+ * This method marks this continuation as "selected" at the request it
+ * belongs to.
+ *
+ * Derived classes must implement their XInteractionContinuation::select()
+ * method the way that they call this method.
+ */
+ void recordSelection();
+ virtual ~InteractionContinuation();
+
+public:
+ InteractionContinuation( InteractionRequest * pRequest );
+};
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionAbort. Instances of this class can be passed
+ * along with an interaction request to indicate the possiblity to abort
+ * the operation that caused the request.
+ */
+class UCBHELPER_DLLPUBLIC InteractionAbort : public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::task::XInteractionAbort
+{
+public:
+ InteractionAbort( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionRetry. Instances of this class can be passed
+ * along with an interaction request to indicate the possiblity to retry
+ * the operation that caused the request.
+ */
+class UCBHELPER_DLLPUBLIC InteractionRetry : public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::task::XInteractionRetry
+{
+public:
+ InteractionRetry( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionApprove. Instances of this class can be passed
+ * along with an interaction request to indicate the possiblity to approve
+ * the request.
+ */
+class UCBHELPER_DLLPUBLIC InteractionApprove : public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::task::XInteractionApprove
+{
+public:
+ InteractionApprove( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionDisapprove. Instances of this class can be passed
+ * along with an interaction request to indicate the possiblity to disapprove
+ * the request.
+ */
+class UCBHELPER_DLLPUBLIC InteractionDisapprove : public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::task::XInteractionDisapprove
+{
+public:
+ InteractionDisapprove( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionSupplyAuthentication. Instances of this class can be
+ * passed along with an authentication interaction request to enable the
+ * interaction handler to supply the missing authentication data.
+ */
+class UCBHELPER_DLLPUBLIC InteractionSupplyAuthentication :
+ public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XInteractionSupplyAuthentication2
+{
+ com::sun::star::uno::Sequence< com::sun::star::ucb::RememberAuthentication >
+ m_aRememberPasswordModes;
+ com::sun::star::uno::Sequence< com::sun::star::ucb::RememberAuthentication >
+ m_aRememberAccountModes;
+ OUString m_aRealm;
+ OUString m_aUserName;
+ OUString m_aPassword;
+ OUString m_aAccount;
+ com::sun::star::ucb::RememberAuthentication m_eRememberPasswordMode;
+ com::sun::star::ucb::RememberAuthentication m_eDefaultRememberPasswordMode;
+ com::sun::star::ucb::RememberAuthentication m_eRememberAccountMode;
+ com::sun::star::ucb::RememberAuthentication m_eDefaultRememberAccountMode;
+ unsigned m_bCanSetRealm : 1;
+ unsigned m_bCanSetUserName : 1;
+ unsigned m_bCanSetPassword : 1;
+ unsigned m_bCanSetAccount : 1;
+ unsigned m_bCanUseSystemCredentials : 1;
+ unsigned m_bDefaultUseSystemCredentials : 1;
+ unsigned m_bUseSystemCredentials : 1;
+
+public:
+ /**
+ * Constructor.
+ *
+ * @param rxRequest is the interaction request that owns this continuation.
+ * @param bCanSetRealm indicates, whether the realm given with the
+ * authentication request is read-only.
+ * @param bCanSetUserName indicates, whether the username given with the
+ * authentication request is read-only.
+ * @param bCanSetPassword indicates, whether the password given with the
+ * authentication request is read-only.
+ * @param bCanSetAccount indicates, whether the account given with the
+ * authentication request is read-only.
+ *
+ * @see com::sun::star::ucb::AuthenticationRequest
+ */
+ inline InteractionSupplyAuthentication(
+ InteractionRequest * pRequest,
+ sal_Bool bCanSetRealm,
+ sal_Bool bCanSetUserName,
+ sal_Bool bCanSetPassword,
+ sal_Bool bCanSetAccount);
+ /**
+ * Constructor.
+ *
+ * Note: The remember-authentication stuff is interesting only for
+ * clients implementing own password storage functionality.
+ *
+ * @param rxRequest is the interaction request that owns this continuation.
+ * @param bCanSetRealm indicates, whether the realm given with the
+ * authentication request is read-only.
+ * @param bCanSetUserName indicates, whether the username given with the
+ * authentication request is read-only.
+ * @param bCanSetPassword indicates, whether the password given with the
+ * authentication request is read-only.
+ * @param bCanSetAccount indicates, whether the account given with the
+ * authentication request is read-only.
+ * @param rRememberPasswordModes specifies the authentication-remember-
+ * modes for passwords supported by the requesting client.
+ * @param eDefaultRememberPasswordMode specifies the default
+ * authentication-remember-mode for passwords preferred by the
+ * requesting client.
+ * @param rRememberAccountModes specifies the authentication-remember-
+ * modes for accounts supported by the requesting client.
+ * @param eDefaultRememberAccountMode specifies the default
+ * authentication-remember-mode for accounts preferred by the
+ * requesting client.
+ * @param bCanUseSystemCredentials indicates whether issuer of the
+ * authetication request can obtain and use system credentials
+ * for authentication.
+ * @param bDefaultUseSystemCredentials specifies the default system
+ * credentials usage preferred by the requesting client
+ *
+ * @see com::sun::star::ucb::AuthenticationRequest
+ * @see com::sun::star::ucb::RememberAuthentication
+ */
+ inline InteractionSupplyAuthentication(
+ InteractionRequest * pRequest,
+ sal_Bool bCanSetRealm,
+ sal_Bool bCanSetUserName,
+ sal_Bool bCanSetPassword,
+ sal_Bool bCanSetAccount,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication > &
+ rRememberPasswordModes,
+ const com::sun::star::ucb::RememberAuthentication
+ eDefaultRememberPasswordMode,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication > &
+ rRememberAccountModes,
+ const com::sun::star::ucb::RememberAuthentication
+ eDefaultRememberAccountMode,
+ sal_Bool bCanUseSystemCredentials,
+ sal_Bool bDefaultUseSystemCredentials );
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionSupplyAuthentication
+ virtual sal_Bool SAL_CALL
+ canSetRealm()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setRealm( const OUString& Realm )
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL
+ canSetUserName()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setUserName( const OUString& UserName )
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL
+ canSetPassword()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setPassword( const OUString& Password )
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication > SAL_CALL
+ getRememberPasswordModes(
+ com::sun::star::ucb::RememberAuthentication& Default )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setRememberPassword( com::sun::star::ucb::RememberAuthentication Remember )
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL
+ canSetAccount()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setAccount( const OUString& Account )
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication > SAL_CALL
+ getRememberAccountModes(
+ com::sun::star::ucb::RememberAuthentication& Default )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setRememberAccount( com::sun::star::ucb::RememberAuthentication Remember )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionSupplyAuthentication2
+ virtual ::sal_Bool SAL_CALL canUseSystemCredentials( ::sal_Bool& Default )
+ throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setUseSystemCredentials( ::sal_Bool UseSystemCredentials )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ // Non-interface methods.
+
+ /**
+ * This method returns the realm that was supplied by the interaction
+ * handler.
+ *
+ * @return the realm.
+ */
+ const OUString & getRealm() const { return m_aRealm; }
+
+ /**
+ * This method returns the username that was supplied by the interaction
+ * handler.
+ *
+ * @return the username.
+ */
+ const OUString & getUserName() const { return m_aUserName; }
+
+ /**
+ * This method returns the password that was supplied by the interaction
+ * handler.
+ *
+ * @return the password.
+ */
+ const OUString & getPassword() const { return m_aPassword; }
+
+ /**
+ * This method returns the account that was supplied by the interaction
+ * handler.
+ *
+ * @return the account.
+ */
+ const OUString & getAccount() const { return m_aAccount; }
+
+ /**
+ * This method returns the authentication remember-mode for the password
+ * that was supplied by the interaction handler.
+ *
+ * @return the remember-mode for the password.
+ */
+ const com::sun::star::ucb::RememberAuthentication &
+ getRememberPasswordMode() const { return m_eRememberPasswordMode; }
+
+ /**
+ * This method returns the authentication remember-mode for the account
+ * that was supplied by the interaction handler.
+ *
+ * @return the remember-mode for the account.
+ */
+ const com::sun::star::ucb::RememberAuthentication &
+ getRememberAccountMode() const { return m_eRememberAccountMode; }
+
+ sal_Bool getUseSystemCredentials() const { return m_bUseSystemCredentials; }
+};
+
+//============================================================================
+inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
+ InteractionRequest * pRequest,
+ sal_Bool bCanSetRealm,
+ sal_Bool bCanSetUserName,
+ sal_Bool bCanSetPassword,
+ sal_Bool bCanSetAccount )
+: InteractionContinuation( pRequest ),
+ m_aRememberPasswordModes( com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication >( 1 ) ),
+ m_aRememberAccountModes( com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication >( 1 ) ),
+ m_eRememberPasswordMode( com::sun::star::ucb::RememberAuthentication_NO ),
+ m_eDefaultRememberPasswordMode(
+ com::sun::star::ucb::RememberAuthentication_NO ),
+ m_eRememberAccountMode( com::sun::star::ucb::RememberAuthentication_NO ),
+ m_eDefaultRememberAccountMode(
+ com::sun::star::ucb::RememberAuthentication_NO ),
+ m_bCanSetRealm( bCanSetRealm ),
+ m_bCanSetUserName( bCanSetUserName ),
+ m_bCanSetPassword( bCanSetPassword ),
+ m_bCanSetAccount( bCanSetAccount ),
+ m_bCanUseSystemCredentials( sal_False ),
+ m_bDefaultUseSystemCredentials( sal_False ),
+ m_bUseSystemCredentials( sal_False )
+{
+ m_aRememberPasswordModes[ 0 ]
+ = com::sun::star::ucb::RememberAuthentication_NO;
+ m_aRememberAccountModes [ 0 ]
+ = com::sun::star::ucb::RememberAuthentication_NO;
+}
+
+//============================================================================
+inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
+ InteractionRequest * pRequest,
+ sal_Bool bCanSetRealm,
+ sal_Bool bCanSetUserName,
+ sal_Bool bCanSetPassword,
+ sal_Bool bCanSetAccount,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication > & rRememberPasswordModes,
+ const com::sun::star::ucb::RememberAuthentication
+ eDefaultRememberPasswordMode,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication > & rRememberAccountModes,
+ const com::sun::star::ucb::RememberAuthentication
+ eDefaultRememberAccountMode,
+ sal_Bool bCanUseSystemCredentials,
+ sal_Bool bDefaultUseSystemCredentials )
+: InteractionContinuation( pRequest ),
+ m_aRememberPasswordModes( rRememberPasswordModes ),
+ m_aRememberAccountModes( rRememberAccountModes ),
+ m_eRememberPasswordMode( eDefaultRememberPasswordMode ),
+ m_eDefaultRememberPasswordMode( eDefaultRememberPasswordMode ),
+ m_eRememberAccountMode( eDefaultRememberAccountMode ),
+ m_eDefaultRememberAccountMode( eDefaultRememberAccountMode ),
+ m_bCanSetRealm( bCanSetRealm ),
+ m_bCanSetUserName( bCanSetUserName ),
+ m_bCanSetPassword( bCanSetPassword ),
+ m_bCanSetAccount( bCanSetAccount ),
+ m_bCanUseSystemCredentials( bCanUseSystemCredentials ),
+ m_bDefaultUseSystemCredentials( bDefaultUseSystemCredentials ),
+ m_bUseSystemCredentials( bDefaultUseSystemCredentials & bCanUseSystemCredentials )
+{
+}
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionSupplyName. Instances of this class can be passed
+ * along with an interaction request to indicate the possiblity to
+ * supply a new name.
+ */
+class InteractionSupplyName : public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XInteractionSupplyName
+{
+ OUString m_aName;
+
+public:
+ InteractionSupplyName( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionSupplyName
+ virtual void SAL_CALL setName( const OUString& Name )
+ throw ( com::sun::star::uno::RuntimeException );
+
+ // Non-interface methods.
+
+ /**
+ * This method returns the name that was supplied by the interaction
+ * handler.
+ *
+ * @return the name.
+ */
+ const OUString & getName() const { return m_aName; }
+};
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionReplaceExistingData. Instances of this class can be
+ * passed along with an interaction request to indicate the possiblity to
+ * replace existing data.
+ */
+class InteractionReplaceExistingData :
+ public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XInteractionReplaceExistingData
+{
+public:
+ InteractionReplaceExistingData( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_INTERATIONREQUEST_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/interceptedinteraction.hxx b/include/ucbhelper/interceptedinteraction.hxx
new file mode 100644
index 000000000000..8c9b52239ad6
--- /dev/null
+++ b/include/ucbhelper/interceptedinteraction.hxx
@@ -0,0 +1,334 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UCBHELPER_INTERCEPTEDINTERACTION_HXX_
+#define _UCBHELPER_INTERCEPTEDINTERACTION_HXX_
+
+#include <vector>
+
+#include <com/sun/star/task/XInteractionHandler.hpp>
+
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+
+namespace ucbhelper{
+
+
+/** @short it wraps any other interaction handler and intercept
+ its handle() requests.
+
+ @descr This class can be used as:
+ - instance if special interactions must be supressed
+ only
+ - or as base class if interactions must be modified.
+ */
+class UCBHELPER_DLLPUBLIC InterceptedInteraction : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionHandler >
+{
+ //-------------------------------------------
+ // types
+ public:
+
+ struct InterceptedRequest
+ {
+ //-----------------------------------
+ /** @short marks an Handle as invalid.
+ */
+ static const sal_Int32 INVALID_HANDLE = -1;
+
+ //-----------------------------------
+ /** @short contains the interaction request, which should be intercepted. */
+ ::com::sun::star::uno::Any Request;
+
+ //-----------------------------------
+ /** @short specify the fix continuation, which must be selected, if the
+ interaction could be intercepted successfully.
+ */
+ ::com::sun::star::uno::Type Continuation;
+
+ //-----------------------------------
+ /** @short specify, if both interactions must have the same type
+ or can be derived from.
+
+ @descr Interaction base on exceptions - and exceptions are real types.
+ So they can be checked in its type. These parameter "MatchExact"
+ influence the type-check in the following way:
+ TRUE => the exception will be intercepted only
+ if it supports exactly the same type ...
+ or
+ FALSE => derived exceptions will be intercepted too.
+
+ @attention This parameter does not influence the check of the continuation
+ type! The continuation must be matched exactly everytimes ...
+ */
+ sal_Bool MatchExact;
+
+ //-----------------------------------
+ /** @short its an unique identifier, which must be managed by the outside code.
+
+ @descr If there is a derived class, which overwrites the InterceptedInteraction::intercepted()
+ method, it will be called with a reference to an InterceptedRequest struct.
+ Then it can use the handle to react without checking the request type again.
+ */
+ sal_Int32 Handle;
+
+ //-----------------------------------
+ /** @short default ctor.
+
+ @descr Such constructed object cant be used realy.
+ Might it will crash if its used!
+ Dont forget to initialize all(!) members ...
+ */
+ InterceptedRequest()
+ {
+ MatchExact = sal_False;
+ Handle = INVALID_HANDLE;
+ }
+
+ //-----------------------------------
+ /** @short initialize this instance.
+
+ @param nHandle
+ used to identify every intercepted request
+
+ @param aRequest
+ must contain an exception object, which can be checked
+ in its uno-type against the later handled interaction.
+
+ @param aContinuation
+ must contain a continuation object, which is used
+ in its uno-type to locate the same continuation
+ inside the list of possible ones.
+
+ @param bMatchExact
+ influence the type check of the interception request.
+ Its not used to check the continuation!
+ */
+ InterceptedRequest( sal_Int32 nHandle ,
+ const ::com::sun::star::uno::Any& aRequest ,
+ const ::com::sun::star::uno::Type& aContinuation,
+ sal_Bool bMatchExact )
+ {
+ Handle = nHandle;
+ Request = aRequest;
+ Continuation = aContinuation;
+ MatchExact = bMatchExact;
+ }
+ };
+
+ //---------------------------------------
+ /** @short represent the different states, which can occure
+ as result of an interception.
+
+ @see impl_interceptRequest()
+ */
+ enum EInterceptionState
+ {
+ /** none of the specified interceptions match the incoming request */
+ E_NOT_INTERCEPTED,
+ /** the request could be intercepted - but the specified continuation could not be located.
+ Thats normaly an error of the programmer. May be the interaction request does not use
+ the right set of continuations ... or the interception list contains the wrong continuation. */
+ E_NO_CONTINUATION_FOUND,
+ /** the request could be intercepted and the specified continuation could be selected successfully. */
+ E_INTERCEPTED
+ };
+
+ //-------------------------------------------
+ // member
+ protected:
+
+ //---------------------------------------
+ /** @short reference to the intercepted interaction handler.
+
+ @descr NULL is allowed for this member!
+ All interaction will be aborted then ...
+ expecting th handle() was overwritten by
+ a derived class.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > m_xInterceptedHandler;
+
+ //---------------------------------------
+ /** @short these list contains the requests, which should be intercepted.
+ */
+ ::std::vector< InterceptedRequest > m_lInterceptions;
+
+ //-------------------------------------------
+ // native interface
+ public:
+
+ //---------------------------------------
+ /** @short initialize a new instance with default values.
+ */
+ InterceptedInteraction();
+
+ //---------------------------------------
+ /** @short initialize a new instance with real values.
+
+ @param xInterceptedHandler
+ the outside interaction handler, which should
+ be intercepted here.
+
+ @param lInterceptions
+ the list of intercepted requests.
+ */
+ InterceptedInteraction(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xInterceptedHandler,
+ const ::std::vector< InterceptedRequest >& lInterceptions );
+
+ //---------------------------------------
+ /** @short initialize a new instance with the interaction handler,
+ which should be intercepted.
+
+ @attention If such interaction handler isnt set here,
+ all incoming requests will be aborted ...
+ if the right continuation is available!
+
+ @param xInterceptedHandler
+ the outside interaction handler, which should
+ be intercepted here.
+ */
+ void setInterceptedHandler(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xInterceptedHandler);
+
+ //---------------------------------------
+ /** @short set a new list of intercepted interactions.
+
+ @attention If the interface method handle() will be overwritten by
+ a derived class, the functionality behind these static list
+ cant be used.
+
+ @param lInterceptions
+ the list of intercepted requests.
+ */
+ void setInterceptions(const ::std::vector< InterceptedRequest >& lInterceptions);
+
+ //---------------------------------------
+ /** @short extract a requested continuation from te list of available ones.
+
+ @param lContinuations
+ the list of available continuations.
+
+ @param aType
+ is used to locate the right continuation,
+ by checking its interface type.
+
+ @return A valid reference to the continuation, if it could be located ...
+ or an empty reference otherwise.
+ */
+ static ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > extractContinuation(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > >& lContinuations,
+ const ::com::sun::star::uno::Type& aType );
+
+ //-------------------------------------------
+ // useable for derived classes
+ protected:
+
+ //---------------------------------------
+ /** @short can be overwritten by a derived class to handle interceptions
+ outside.
+
+ @descr This base implementation checks, if the request could be intercepted
+ successfully. Then this method intercepted() is called.
+ The default implementation returns "NOT_INTERCEPTED" everytimes.
+ So the method impl_interceptRequest() uses the right continuation automaticly.
+
+ If this method was overwritten and something different "NO_INTERCEPTED"
+ is returned, the method impl_interceptRequest() will return immediately with
+ the result, which is returned by this intercepted() method.
+ Then the continuations must be selected inside the intercepted() call!
+
+ @param rRequest
+ it points to the intercepted request (means the item of the
+ set interception list). e.g. its "Handle" member can be used
+ to identify it and react very easy, without the need to check the
+ type of the exception ...
+
+ @param xOrgRequest
+ points to the original interaction, which was intercepted.
+ It provides access to the exception and the list of possible
+ continuations.
+
+ @return The result of this operation.
+ Note: If E_NOT_INTERCEPTED is returned the default handling of the base class
+ will be used automaticly for this request!
+ */
+ virtual EInterceptionState intercepted(const InterceptedRequest& rRequest ,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xOrgRequest);
+
+ //-------------------------------------------
+ // uno interface
+ public:
+
+ //---------------------------------------
+ /** @short implements the default handling of this class ....
+ or can be overwritten by any derived class.
+
+ @descr If no further class is derived from this one
+ -> the default implementation is used. Then the
+ internal list of requests is used to handle different
+ interactions automaticly.
+ (see impl_interceptRequest())
+
+ If this method was overwritten by a derived implementation
+ -> the new implementation has to do everything by itself.
+ Of course it can access all members/helpers and work with it.
+ But the default implementation isnt used automaticly then.
+
+ @param xRequest
+ the interaction request, which should be intercepted.
+ */
+ virtual void SAL_CALL handle(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xRequest)
+ throw(::com::sun::star::uno::RuntimeException);
+
+ //-------------------------------------------
+ // helper
+ private:
+
+ //---------------------------------------
+ /** @short implements the default handling:
+ - intercept or forward to internal handler.
+ */
+ UCBHELPER_DLLPRIVATE void impl_handleDefault(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xRequest);
+
+ //---------------------------------------
+ /** @short implements the interception of requests.
+
+ @descr The incoming request will be analyzed, if it match
+ any request of the m_lIntercepions list.
+ If an interception could be found, its continuation will be
+ searched and selected.
+
+ The method return the state of that operation.
+ But it doesnt call the intercepted and here set
+ interaction handler. That has to be done in the outside method.
+
+ @param xRequest
+ the interaction request, which should be intercepted.
+
+ @return A identifier, which inidicates if the request was intercepted,
+ the continuation was found and selected ... or not.
+ */
+ UCBHELPER_DLLPRIVATE EInterceptionState impl_interceptRequest(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xRequest);
+};
+
+} // namespace ucbhelper
+
+#endif // _UCBHELPER_INTERCEPTEDINTERACTION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/macros.hxx b/include/ucbhelper/macros.hxx
new file mode 100644
index 000000000000..2f31e3098545
--- /dev/null
+++ b/include/ucbhelper/macros.hxx
@@ -0,0 +1,761 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UCBHELPER_MACROS_HXX
+#define _UCBHELPER_MACROS_HXX
+
+#include <sal/types.h>
+#include <cppuhelper/queryinterface.hxx>
+#include <cppuhelper/factory.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <cppuhelper/typeprovider.hxx>
+
+#include "osl/mutex.hxx"
+#include "ucbhelper/getcomponentcontext.hxx"
+
+//=========================================================================
+
+#define CPPU_TYPE( T ) getCppuType( static_cast< T * >( 0 ) )
+#define CPPU_TYPE_REF( T ) CPPU_TYPE( com::sun::star::uno::Reference< T > )
+
+//=========================================================================
+//
+// XInterface decl.
+//
+//=========================================================================
+
+#define XINTERFACE_DECL() \
+ virtual com::sun::star::uno::Any SAL_CALL \
+ queryInterface( const com::sun::star::uno::Type & rType ) \
+ throw( com::sun::star::uno::RuntimeException ); \
+ virtual void SAL_CALL \
+ acquire() \
+ throw(); \
+ virtual void SAL_CALL \
+ release() \
+ throw();
+
+//=========================================================================
+//
+// XInterface impl. internals.
+//
+//=========================================================================
+
+#define XINTERFACE_COMMON_IMPL( Class ) \
+void SAL_CALL Class::acquire() \
+ throw() \
+{ \
+ OWeakObject::acquire(); \
+} \
+ \
+void SAL_CALL Class::release() \
+ throw() \
+{ \
+ OWeakObject::release(); \
+}
+
+#define QUERYINTERFACE_IMPL_START( Class ) \
+com::sun::star::uno::Any SAL_CALL Class::queryInterface( \
+ const com::sun::star::uno::Type & rType ) \
+ throw( com::sun::star::uno::RuntimeException ) \
+{ \
+ com::sun::star::uno::Any aRet = cppu::queryInterface( rType,
+
+#define QUERYINTERFACE_IMPL_END \
+ ); \
+ return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); \
+}
+
+//=========================================================================
+//
+// XInterface impl.
+//
+//=========================================================================
+
+// 1 interface implemented
+#define XINTERFACE_IMPL_1( Class, Ifc1 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< Ifc1* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 2 interfaces implemented
+#define XINTERFACE_IMPL_2( Class, Ifc1, Ifc2 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< Ifc1* >(this)), \
+ (static_cast< Ifc2* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 3 interfaces implemented
+#define XINTERFACE_IMPL_3( Class, Ifc1, Ifc2, Ifc3 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< Ifc1* >(this)), \
+ (static_cast< Ifc2* >(this)), \
+ (static_cast< Ifc3* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 4 interfaces implemented
+#define XINTERFACE_IMPL_4( Class, Ifc1, Ifc2, Ifc3, Ifc4 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< Ifc1* >(this)), \
+ (static_cast< Ifc2* >(this)), \
+ (static_cast< Ifc3* >(this)), \
+ (static_cast< Ifc4* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 5 interfaces implemented
+#define XINTERFACE_IMPL_5( Class, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< Ifc1* >(this)), \
+ (static_cast< Ifc2* >(this)), \
+ (static_cast< Ifc3* >(this)), \
+ (static_cast< Ifc4* >(this)), \
+ (static_cast< Ifc5* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 6 interfaces implemented
+#define XINTERFACE_IMPL_6( Class,I1,I2,I3,I4,I5,I6 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< I1* >(this)), \
+ (static_cast< I2* >(this)), \
+ (static_cast< I3* >(this)), \
+ (static_cast< I4* >(this)), \
+ (static_cast< I5* >(this)), \
+ (static_cast< I6* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 7 interfaces implemented
+#define XINTERFACE_IMPL_7( Class,I1,I2,I3,I4,I5,I6,I7 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< I1* >(this)), \
+ (static_cast< I2* >(this)), \
+ (static_cast< I3* >(this)), \
+ (static_cast< I4* >(this)), \
+ (static_cast< I5* >(this)), \
+ (static_cast< I6* >(this)), \
+ (static_cast< I7* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 8 interfaces implemented
+#define XINTERFACE_IMPL_8( Class,I1,I2,I3,I4,I5,I6,I7,I8 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< I1* >(this)), \
+ (static_cast< I2* >(this)), \
+ (static_cast< I3* >(this)), \
+ (static_cast< I4* >(this)), \
+ (static_cast< I5* >(this)), \
+ (static_cast< I6* >(this)), \
+ (static_cast< I7* >(this)), \
+ (static_cast< I8* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 9 interfaces implemented
+#define XINTERFACE_IMPL_9( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< I1* >(this)), \
+ (static_cast< I2* >(this)), \
+ (static_cast< I3* >(this)), \
+ (static_cast< I4* >(this)), \
+ (static_cast< I5* >(this)), \
+ (static_cast< I6* >(this)), \
+ (static_cast< I7* >(this)), \
+ (static_cast< I8* >(this)), \
+ (static_cast< I9* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 10 interfaces implemented
+#define XINTERFACE_IMPL_10( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9,I10 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< I1* >(this)), \
+ (static_cast< I2* >(this)), \
+ (static_cast< I3* >(this)), \
+ (static_cast< I4* >(this)), \
+ (static_cast< I5* >(this)), \
+ (static_cast< I6* >(this)), \
+ (static_cast< I7* >(this)), \
+ (static_cast< I8* >(this)), \
+ (static_cast< I9* >(this)), \
+ (static_cast< I10* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 11 interfaces implemented
+#define XINTERFACE_IMPL_11( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< I1* >(this)), \
+ (static_cast< I2* >(this)), \
+ (static_cast< I3* >(this)), \
+ (static_cast< I4* >(this)), \
+ (static_cast< I5* >(this)), \
+ (static_cast< I6* >(this)), \
+ (static_cast< I7* >(this)), \
+ (static_cast< I8* >(this)), \
+ (static_cast< I9* >(this)), \
+ (static_cast< I10* >(this)), \
+ (static_cast< I11* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 12 interfaces implemented
+#define XINTERFACE_IMPL_12( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< I1* >(this)), \
+ (static_cast< I2* >(this)), \
+ (static_cast< I3* >(this)), \
+ (static_cast< I4* >(this)), \
+ (static_cast< I5* >(this)), \
+ (static_cast< I6* >(this)), \
+ (static_cast< I7* >(this)), \
+ (static_cast< I8* >(this)), \
+ (static_cast< I9* >(this)), \
+ (static_cast< I10* >(this)), \
+ (static_cast< I11* >(this)), \
+ (static_cast< I12* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 13 interfaces implemented
+#define XINTERFACE_IMPL_13( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< I1* >(this)), \
+ (static_cast< I2* >(this)), \
+ (static_cast< I3* >(this)), \
+ (static_cast< I4* >(this)), \
+ (static_cast< I5* >(this)), \
+ (static_cast< I6* >(this)), \
+ (static_cast< I7* >(this)), \
+ (static_cast< I8* >(this)), \
+ (static_cast< I9* >(this)), \
+ (static_cast< I10* >(this)), \
+ (static_cast< I11* >(this)), \
+ (static_cast< I12* >(this)), \
+ (static_cast< I13* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 14 interfaces implemented
+#define XINTERFACE_IMPL_14( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13,I14 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< I1* >(this)), \
+ (static_cast< I2* >(this)), \
+ (static_cast< I3* >(this)), \
+ (static_cast< I4* >(this)), \
+ (static_cast< I5* >(this)), \
+ (static_cast< I6* >(this)), \
+ (static_cast< I7* >(this)), \
+ (static_cast< I8* >(this)), \
+ (static_cast< I9* >(this)), \
+ (static_cast< I10* >(this)), \
+ (static_cast< I11* >(this)), \
+ (static_cast< I12* >(this)), \
+ (static_cast< I13* >(this)), \
+ (static_cast< I14* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+// 15 interfaces implemented
+#define XINTERFACE_IMPL_15( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13,I14,I15 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ (static_cast< I1* >(this)), \
+ (static_cast< I2* >(this)), \
+ (static_cast< I3* >(this)), \
+ (static_cast< I4* >(this)), \
+ (static_cast< I5* >(this)), \
+ (static_cast< I6* >(this)), \
+ (static_cast< I7* >(this)), \
+ (static_cast< I8* >(this)), \
+ (static_cast< I9* >(this)), \
+ (static_cast< I10* >(this)), \
+ (static_cast< I11* >(this)), \
+ (static_cast< I12* >(this)), \
+ (static_cast< I13* >(this)), \
+ (static_cast< I14* >(this)), \
+ (static_cast< I15* >(this)) \
+QUERYINTERFACE_IMPL_END
+
+//=========================================================================
+//
+// XTypeProvider decl.
+//
+//=========================================================================
+
+#define XTYPEPROVIDER_DECL() \
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL \
+ getImplementationId() \
+ throw( com::sun::star::uno::RuntimeException ); \
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL \
+ getTypes() \
+ throw( com::sun::star::uno::RuntimeException );
+
+//=========================================================================
+//
+// XTypeProvider impl. internals
+//
+//=========================================================================
+
+#define XTYPEPROVIDER_COMMON_IMPL( Class ) \
+com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL \
+Class::getImplementationId() \
+ throw( com::sun::star::uno::RuntimeException ) \
+{ \
+ static cppu::OImplementationId* pId = NULL; \
+ if ( !pId ) \
+ { \
+ osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); \
+ if ( !pId ) \
+ { \
+ static cppu::OImplementationId id( sal_False ); \
+ pId = &id; \
+ } \
+ } \
+ return (*pId).getImplementationId(); \
+}
+
+#define GETTYPES_IMPL_START( Class ) \
+com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL \
+Class::getTypes() \
+ throw( com::sun::star::uno::RuntimeException ) \
+{ \
+ static cppu::OTypeCollection* pCollection = NULL; \
+ if ( !pCollection ) \
+ { \
+ osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); \
+ if ( !pCollection ) \
+ { \
+ static cppu::OTypeCollection collection(
+
+#define GETTYPES_IMPL_END \
+ ); \
+ pCollection = &collection; \
+ } \
+ } \
+ return (*pCollection).getTypes(); \
+}
+
+//=========================================================================
+//
+// XTypeProvider impl.
+//
+//=========================================================================
+
+// 1 interface supported
+#define XTYPEPROVIDER_IMPL_1( Class, I1 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ) \
+GETTYPES_IMPL_END
+
+// 2 interfaces supported
+#define XTYPEPROVIDER_IMPL_2( Class, I1,I2 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ) \
+GETTYPES_IMPL_END
+
+// 3 interfaces supported
+#define XTYPEPROVIDER_IMPL_3( Class, I1,I2,I3 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ) \
+GETTYPES_IMPL_END
+
+// 4 interfaces supported
+#define XTYPEPROVIDER_IMPL_4( Class, I1,I2,I3,I4 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ) \
+GETTYPES_IMPL_END
+
+// 5 interfaces supported
+#define XTYPEPROVIDER_IMPL_5( Class, I1,I2,I3,I4,I5 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ) \
+GETTYPES_IMPL_END
+
+// 6 interfaces supported
+#define XTYPEPROVIDER_IMPL_6( Class, I1,I2,I3,I4,I5,I6 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ) \
+GETTYPES_IMPL_END
+
+// 7 interfaces supported
+#define XTYPEPROVIDER_IMPL_7( Class, I1,I2,I3,I4,I5,I6,I7 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ) \
+GETTYPES_IMPL_END
+
+// 8 interfaces supported
+#define XTYPEPROVIDER_IMPL_8( Class, I1,I2,I3,I4,I5,I6,I7,I8 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ) \
+GETTYPES_IMPL_END
+
+// 9 interfaces supported
+#define XTYPEPROVIDER_IMPL_9( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ) \
+GETTYPES_IMPL_END
+
+// 10 interfaces supported
+#define XTYPEPROVIDER_IMPL_10( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9,I10 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ), \
+ CPPU_TYPE_REF( I10 ) \
+GETTYPES_IMPL_END
+
+// 11 interfaces supported
+#define XTYPEPROVIDER_IMPL_11( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ), \
+ CPPU_TYPE_REF( I10 ), \
+ CPPU_TYPE_REF( I11 ) \
+GETTYPES_IMPL_END
+
+// 12 interfaces supported
+#define XTYPEPROVIDER_IMPL_12( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ), \
+ CPPU_TYPE_REF( I10 ), \
+ CPPU_TYPE_REF( I11 ), \
+ CPPU_TYPE_REF( I12 ) \
+GETTYPES_IMPL_END
+
+// 13 interfaces supported
+#define XTYPEPROVIDER_IMPL_13( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ), \
+ CPPU_TYPE_REF( I10 ), \
+ CPPU_TYPE_REF( I11 ), \
+ CPPU_TYPE_REF( I12 ), \
+ CPPU_TYPE_REF( I13 ) \
+GETTYPES_IMPL_END
+
+// 14 interfaces supported
+#define XTYPEPROVIDER_IMPL_14( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13,I14 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ), \
+ CPPU_TYPE_REF( I10 ), \
+ CPPU_TYPE_REF( I11 ), \
+ CPPU_TYPE_REF( I12 ), \
+ CPPU_TYPE_REF( I13 ), \
+ CPPU_TYPE_REF( I14 ) \
+GETTYPES_IMPL_END
+
+// 15 interfaces supported
+#define XTYPEPROVIDER_IMPL_15( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13,I14,I15 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ), \
+ CPPU_TYPE_REF( I10 ), \
+ CPPU_TYPE_REF( I11 ), \
+ CPPU_TYPE_REF( I12 ), \
+ CPPU_TYPE_REF( I13 ), \
+ CPPU_TYPE_REF( I14 ), \
+ CPPU_TYPE_REF( I15 ) \
+GETTYPES_IMPL_END
+
+//=========================================================================
+//
+// XServiceInfo decl.
+//
+//=========================================================================
+
+#define XSERVICEINFO_NOFACTORY_DECL() \
+ virtual OUString SAL_CALL \
+ getImplementationName() \
+ throw( com::sun::star::uno::RuntimeException ); \
+ virtual sal_Bool SAL_CALL \
+ supportsService( const OUString& ServiceName ) \
+ throw( com::sun::star::uno::RuntimeException ); \
+ virtual com::sun::star::uno::Sequence< OUString > SAL_CALL \
+ getSupportedServiceNames() \
+ throw( com::sun::star::uno::RuntimeException ); \
+ \
+ static OUString \
+ getImplementationName_Static(); \
+ static com::sun::star::uno::Sequence< OUString > \
+ getSupportedServiceNames_Static();
+
+#define XSERVICEINFO_DECL() \
+ XSERVICEINFO_NOFACTORY_DECL() \
+ \
+ static com::sun::star::uno::Reference< \
+ com::sun::star::lang::XSingleServiceFactory > \
+ createServiceFactory( const com::sun::star::uno::Reference< \
+ com::sun::star::lang::XMultiServiceFactory >& rxServiceMgr );
+
+//=========================================================================
+//
+// XServiceInfo impl. internals
+//
+//=========================================================================
+
+#define XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+OUString SAL_CALL Class::getImplementationName() \
+ throw( com::sun::star::uno::RuntimeException ) \
+{ \
+ return getImplementationName_Static(); \
+} \
+ \
+OUString Class::getImplementationName_Static() \
+{ \
+ return ImplName; \
+} \
+ \
+sal_Bool SAL_CALL \
+Class::supportsService( const OUString& ServiceName ) \
+ throw( com::sun::star::uno::RuntimeException ) \
+{ \
+ com::sun::star::uno::Sequence< OUString > aSNL = \
+ getSupportedServiceNames(); \
+ const OUString* pArray = aSNL.getArray(); \
+ for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) \
+ { \
+ if( pArray[ i ] == ServiceName ) \
+ return sal_True; \
+ } \
+ \
+ return sal_False; \
+} \
+ \
+com::sun::star::uno::Sequence< OUString > SAL_CALL \
+Class::getSupportedServiceNames() \
+ throw( com::sun::star::uno::RuntimeException ) \
+{ \
+ return getSupportedServiceNames_Static(); \
+}
+
+#define XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
+static com::sun::star::uno::Reference< \
+ com::sun::star::uno::XInterface > SAL_CALL \
+Class##_CreateInstance( const com::sun::star::uno::Reference< \
+ com::sun::star::lang::XMultiServiceFactory> & rSMgr ) \
+ throw( com::sun::star::uno::Exception ) \
+{ \
+ com::sun::star::lang::XServiceInfo* pX = \
+ (com::sun::star::lang::XServiceInfo*)new Class( rSMgr ); \
+ return com::sun::star::uno::Reference< \
+ com::sun::star::uno::XInterface >::query( pX ); \
+}
+
+#define XSERVICEINFO_CREATE_INSTANCE_IMPL_CTX( Class ) \
+static com::sun::star::uno::Reference< \
+ com::sun::star::uno::XInterface > SAL_CALL \
+Class##_CreateInstance( const com::sun::star::uno::Reference< \
+ com::sun::star::lang::XMultiServiceFactory> & rSMgr ) \
+ throw( com::sun::star::uno::Exception ) \
+{ \
+ com::sun::star::lang::XServiceInfo* pX = \
+ (com::sun::star::lang::XServiceInfo*)new Class( ucbhelper::getComponentContext(rSMgr) ); \
+ return com::sun::star::uno::Reference< \
+ com::sun::star::uno::XInterface >::query( pX ); \
+}
+
+//=========================================================================
+//
+// XServiceInfo impl.
+//
+//=========================================================================
+
+#define ONE_INSTANCE_SERVICE_FACTORY_IMPL( Class ) \
+com::sun::star::uno::Reference< \
+ com::sun::star::lang::XSingleServiceFactory > \
+Class::createServiceFactory( const com::sun::star::uno::Reference< \
+ com::sun::star::lang::XMultiServiceFactory >& rxServiceMgr ) \
+{ \
+ return com::sun::star::uno::Reference< \
+ com::sun::star::lang::XSingleServiceFactory >( \
+ cppu::createOneInstanceFactory( \
+ rxServiceMgr, \
+ Class::getImplementationName_Static(), \
+ Class##_CreateInstance, \
+ Class::getSupportedServiceNames_Static() ) ); \
+}
+
+// Service without service factory.
+
+// Own implementation of getSupportedServiceNames_Static().
+#define XSERVICEINFO_NOFACTORY_IMPL_0( Class, ImplName ) \
+XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+ \
+com::sun::star::uno::Sequence< OUString > \
+Class::getSupportedServiceNames_Static()
+
+// 1 service name
+#define XSERVICEINFO_NOFACTORY_IMPL_1( Class, ImplName, Service1 ) \
+XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+ \
+com::sun::star::uno::Sequence< OUString > \
+Class::getSupportedServiceNames_Static() \
+{ \
+ com::sun::star::uno::Sequence< OUString > aSNS( 1 ); \
+ aSNS.getArray()[ 0 ] = Service1; \
+ return aSNS; \
+}
+
+// Service with service factory.
+
+// Own implementation of getSupportedServiceNames_Static().
+#define XSERVICEINFO_IMPL_0( Class, ImplName ) \
+XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
+ \
+com::sun::star::uno::Sequence< OUString > \
+Class::getSupportedServiceNames_Static()
+
+// Own implementation of getSupportedServiceNames_Static().
+#define XSERVICEINFO_IMPL_0_CTX( Class, ImplName ) \
+XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+XSERVICEINFO_CREATE_INSTANCE_IMPL_CTX( Class ) \
+ \
+com::sun::star::uno::Sequence< OUString > \
+Class::getSupportedServiceNames_Static()
+
+// 1 service name
+#define XSERVICEINFO_IMPL_1( Class, ImplName, Service1 ) \
+XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
+ \
+com::sun::star::uno::Sequence< OUString > \
+Class::getSupportedServiceNames_Static() \
+{ \
+ com::sun::star::uno::Sequence< OUString > aSNS( 1 ); \
+ aSNS.getArray()[ 0 ] = Service1; \
+ return aSNS; \
+}
+
+// 1 service name
+#define XSERVICEINFO_IMPL_1_CTX( Class, ImplName, Service1 ) \
+XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+XSERVICEINFO_CREATE_INSTANCE_IMPL_CTX( Class ) \
+ \
+com::sun::star::uno::Sequence< OUString > \
+Class::getSupportedServiceNames_Static() \
+{ \
+ com::sun::star::uno::Sequence< OUString > aSNS( 1 ); \
+ aSNS.getArray()[ 0 ] = Service1; \
+ return aSNS; \
+}
+
+#endif /* !_UCBHELPER_MACROS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/propertyvalueset.hxx b/include/ucbhelper/propertyvalueset.hxx
new file mode 100644
index 000000000000..91459e828ef3
--- /dev/null
+++ b/include/ucbhelper/propertyvalueset.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 _UCBHELPER_PROPERTYVALUESET_HXX
+#define _UCBHELPER_PROPERTYVALUESET_HXX
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/sdbc/XColumnLocate.hpp>
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/beans/Property.hpp>
+#include <cppuhelper/weak.hxx>
+
+#include "osl/mutex.hxx"
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace script {
+ class XTypeConverter;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace beans {
+ struct PropertyValue;
+ class XPropertySet;
+} } } }
+
+namespace ucbhelper {
+
+class PropertyValues;
+
+//=========================================================================
+
+/**
+ * This class implements the interface XRow. After construction of a valueset
+ * the user can append properties ( incl. its values ) to the set. This class
+ * is useful when implementing the command "getPropertyValues", because the
+ * values to return can easyly appended to a valueset object. That object can
+ * directly be returned by the implementation of the command.
+ */
+class UCBHELPER_DLLPUBLIC PropertyValueSet :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::sdbc::XRow,
+ public com::sun::star::sdbc::XColumnLocate
+{
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ m_xContext;
+ com::sun::star::uno::Reference< com::sun::star::script::XTypeConverter >
+ m_xTypeConverter;
+ osl::Mutex m_aMutex;
+ PropertyValues* m_pValues;
+ sal_Bool m_bWasNull;
+ sal_Bool m_bTriedToGetTypeConverter;
+
+private:
+ UCBHELPER_DLLPRIVATE const com::sun::star::uno::Reference<
+ com::sun::star::script::XTypeConverter >&
+ getTypeConverter();
+
+public:
+ PropertyValueSet(
+ const com::sun::star::uno::Reference<
+ com::sun::star::uno::XComponentContext >& rxContext );
+ virtual ~PropertyValueSet();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XRow
+ virtual sal_Bool SAL_CALL
+ wasNull()
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL
+ getString( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ getBoolean( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int8 SAL_CALL
+ getByte( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int16 SAL_CALL
+ getShort( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int32 SAL_CALL
+ getInt( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int64 SAL_CALL
+ getLong( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual float SAL_CALL
+ getFloat( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual double SAL_CALL
+ getDouble( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getBytes( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::util::Date SAL_CALL
+ getDate( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::util::Time SAL_CALL
+ getTime( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::util::DateTime SAL_CALL
+ getTimestamp( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream > SAL_CALL
+ getBinaryStream( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream > SAL_CALL
+ getCharacterStream( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Any SAL_CALL
+ getObject( sal_Int32 columnIndex,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameAccess >& typeMap )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::sdbc::XRef > SAL_CALL
+ getRef( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::sdbc::XBlob > SAL_CALL
+ getBlob( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::sdbc::XClob > SAL_CALL
+ getClob( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::sdbc::XArray > SAL_CALL
+ getArray( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+
+ // XColumnLocate
+ virtual sal_Int32 SAL_CALL
+ findColumn( const OUString& columnName )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+
+ //////////////////////////////////////////////////////////////////////
+ // Non-interface methods
+ //////////////////////////////////////////////////////////////////////
+
+ void appendString( const OUString& rPropName, const OUString& rValue );
+ void appendString( const sal_Char* pAsciiPropName, const OUString& rValue )
+ {
+ appendString( OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendString( const ::com::sun::star::beans::Property& rProp, const OUString& rValue )
+ {
+ appendString( rProp.Name, rValue );
+ }
+
+ void appendBoolean( const OUString& rPropName, sal_Bool bValue );
+ void appendBoolean( const sal_Char* pAsciiPropName, sal_Bool bValue )
+ {
+ appendBoolean( OUString::createFromAscii( pAsciiPropName ), bValue );
+ }
+ void appendBoolean( const ::com::sun::star::beans::Property& rProp, sal_Bool bValue )
+ {
+ appendBoolean( rProp.Name, bValue );
+ }
+
+ void appendLong( const OUString& rPropName, sal_Int64 nValue );
+ void appendLong( const sal_Char* pAsciiPropName, sal_Int64 nValue )
+ {
+ appendLong( OUString::createFromAscii( pAsciiPropName ), nValue );
+ }
+ void appendLong( const ::com::sun::star::beans::Property& rProp, sal_Int64 nValue )
+ {
+ appendLong( rProp.Name, nValue );
+ }
+
+ void appendTimestamp( const OUString& rPropName, const ::com::sun::star::util::DateTime& rValue );
+ void appendTimestamp( const sal_Char* pAsciiPropName, const ::com::sun::star::util::DateTime& rValue )
+ {
+ appendTimestamp( OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendTimestamp( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::util::DateTime& rValue )
+ {
+ appendTimestamp( rProp.Name, rValue );
+ }
+
+ void appendObject( const OUString& rPropName, const ::com::sun::star::uno::Any& rValue );
+ void appendObject( const sal_Char* pAsciiPropName, const ::com::sun::star::uno::Any& rValue )
+ {
+ appendObject( OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendObject( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::uno::Any& rValue )
+ {
+ appendObject( rProp.Name, rValue );
+ }
+
+ void appendVoid( const OUString& rPropName );
+ void appendVoid( const sal_Char* pAsciiPropName)
+ {
+ appendVoid( OUString::createFromAscii( pAsciiPropName ) );
+ }
+ void appendVoid( const ::com::sun::star::beans::Property& rProp )
+ {
+ appendVoid( rProp.Name );
+ }
+
+ /**
+ * This method tries to append all property values contained in a
+ * property set to the value set.
+ *
+ * @param rSet is a property set containing the property values.
+ */
+ void appendPropertySet( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& rSet );
+
+ /** This method tries to append a single property value contained in a
+ * property set to the value set.
+ *
+ * @param rSet is a property set containing the property values.
+ * @param rProperty is the property for that the value shall be obtained
+ * from the given property set.
+ * @return False, if the property value cannot be obtained from the
+ * given property pet. True, otherwise.
+ */
+ sal_Bool appendPropertySetValue(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& rSet,
+ const ::com::sun::star::beans::Property& rProperty );
+};
+
+}
+
+#endif /* !_UCBHELPER_PROPERTYVALUESET_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/providerhelper.hxx b/include/ucbhelper/providerhelper.hxx
new file mode 100644
index 000000000000..827d5c8379b2
--- /dev/null
+++ b/include/ucbhelper/providerhelper.hxx
@@ -0,0 +1,278 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UCBHELPER_PROVIDERHELPER_HXX
+#define _UCBHELPER_PROVIDERHELPER_HXX
+
+#ifndef __LIST__
+#include <list>
+#endif
+#include <com/sun/star/ucb/XContentProvider.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <cppuhelper/weak.hxx>
+
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+//=========================================================================
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ class XPropertySetRegistry;
+ class XPersistentPropertySet;
+} } } }
+
+namespace ucbhelper_impl { struct ContentProviderImplHelper_Impl; }
+
+namespace ucbhelper {
+
+//=========================================================================
+
+class ContentImplHelper;
+typedef rtl::Reference< ContentImplHelper > ContentImplHelperRef;
+typedef std::list< ContentImplHelperRef > ContentRefList;
+
+/**
+ * This is an abstract base class for implementations of the service
+ * com.sun.star.ucb.ContentProvider. It provides contents derived from
+ * class ucb::ContentImplHelper.
+ *
+ * Features of the base class implementation:
+ * - standard interfaces ( XInterface, XTypeProvider, XServiceInfo )
+ * - maintains a set of ContentImplHelper objects, which were created by
+ * the provider implementation. So there will be exactly one object for
+ * one Content Identifier.
+ * - Provides access to the Additional Core PropertySet of a content.
+ * ( These set contains the properties added to a content using its
+ * XPropertyContainer interface )
+ */
+class UCBHELPER_DLLPUBLIC ContentProviderImplHelper : public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::lang::XServiceInfo,
+ public com::sun::star::ucb::XContentProvider
+{
+ friend class ContentImplHelper;
+
+ ucbhelper_impl::ContentProviderImplHelper_Impl* m_pImpl;
+
+protected:
+ osl::Mutex m_aMutex;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+
+private:
+ UCBHELPER_DLLPRIVATE void removeContent( ContentImplHelper* pContent );
+
+ UCBHELPER_DLLPRIVATE ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XPropertySetRegistry >
+ getAdditionalPropertySetRegistry();
+
+ UCBHELPER_DLLPRIVATE void cleanupRegisteredContents();
+
+protected:
+ /**
+ * This method returns a content with the given id, if it already exists.
+ * Use this method in your "queryContent" implementation to ensure unique
+ * objects.
+ *
+ * @param Identifier is the content identifier, for that an existing
+ * content object is requested.
+ * @return the content with the given identifier, if it exists or 0, if it
+ * does not exist.
+ */
+ rtl::Reference< ContentImplHelper >
+ queryExistingContent( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentIdentifier >& Identifier );
+
+ /**
+ * This method returns a content with the given URL, if it already exists.
+ *
+ * @param rURL is the URL ( content identifier string ), for that an
+ * existing content object is requested.
+ * @return the content with the given URL, if it exists or 0, if it
+ * does not exist.
+ */
+ rtl::Reference< ContentImplHelper >
+ queryExistingContent( const OUString& rURL );
+
+ /**
+ * This method registers a newly created content instance with the
+ * content provider. It should be called directly after creating a new
+ * content instance. The provider can reuse a registered instance upon
+ * subsedent requests for content instances with an idententifier
+ * of a registered instance.
+ * Note that the provider does not hold a hard reference on the
+ * registered instance. If last external reference is gone, the provider
+ * will remove the instance from its inventory of known instances.
+ * Nothing will happen in case an already registered instance shall
+ * be registered more than once.
+ *
+ * @param the content instance that is to be registered.
+ */
+ void registerNewContent(
+ const com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContent > & xContent );
+
+public:
+
+ //////////////////////////////////////////////////////////////////////
+ // Contsruction/Destruction
+ //////////////////////////////////////////////////////////////////////
+
+ ContentProviderImplHelper(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& rxContext );
+ virtual ~ContentProviderImplHelper();
+
+ //////////////////////////////////////////////////////////////////////
+ // XInterface
+ //////////////////////////////////////////////////////////////////////
+
+ XINTERFACE_DECL()
+
+ //////////////////////////////////////////////////////////////////////
+ // XTypeProvider
+ //////////////////////////////////////////////////////////////////////
+
+ XTYPEPROVIDER_DECL()
+
+ //////////////////////////////////////////////////////////////////////
+ // XServiceInfo
+ //////////////////////////////////////////////////////////////////////
+
+ virtual OUString SAL_CALL
+ getImplementationName()
+ throw( ::com::sun::star::uno::RuntimeException ) = 0;
+ virtual sal_Bool SAL_CALL
+ supportsService( const OUString& ServiceName )
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
+ getSupportedServiceNames()
+ throw( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ //////////////////////////////////////////////////////////////////////
+ // XContentProvider
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns a content with the requested id.
+ *
+ * The implementation should:
+ *
+ * - Check, whether the Identifier is valid ( URL syntax ).
+ * - Use queryExistingContent(...) to determine, whether there exists
+ * already a content with the given id.
+ * - Return the possibly existing content.Create and return a new
+ * content, otherwise
+ */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContent > SAL_CALL
+ queryContent( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentIdentifier >& Identifier )
+ throw( ::com::sun::star::ucb::IllegalIdentifierException,
+ ::com::sun::star::uno::RuntimeException ) = 0;
+ virtual sal_Int32 SAL_CALL
+ compareContentIds( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentIdentifier >& Id1,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentIdentifier >& Id2 )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ //////////////////////////////////////////////////////////////////////
+ // Non-interface methods.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns a mutex, which protects the content list of the
+ * provider. So you can prevent modifications of that list easyly.
+ *
+ * @return the mutex.
+ */
+ osl::Mutex& getContentListMutex() { return m_aMutex; }
+
+ /**
+ * This method fills a list with all contents existing at calling time.
+ * Note: You may prevent modifications of the content list at any time
+ * by acquiring the content list mutex of the provider.
+ *
+ * @param rContents is the list to fill with the children.
+ */
+ void queryExistingContents( ContentRefList& rContents );
+
+ /**
+ * This method returns the propertyset containing the Additional Core
+ * Properties of a content.
+ *
+ * @param rKey is the key for the propertyset.
+ * @param bCreate is a flag indicating whether the propertyset shall
+ * be created in case it does not exist.
+ * @return the propertyset containing the Additional Core Properties.
+ */
+ ::com::sun::star::uno::Reference<
+ com::sun::star::ucb::XPersistentPropertySet >
+ getAdditionalPropertySet( const OUString& rKey, sal_Bool bCreate );
+
+ /**
+ * This method renames the propertyset containing the Additional Core
+ * Properties of a content.
+ *
+ * @param rOldKey is the old key of the propertyset.
+ * @param rNewKey is the new key for the propertyset.
+ * @param bRecursive is a flag indicating whether propertysets for
+ * children described by rOldKey shall be renamed, too.
+ * @return True, if the operation succeeded - False, otherwise.
+ */
+ sal_Bool renameAdditionalPropertySet( const OUString& rOldKey,
+ const OUString& rNewKey,
+ sal_Bool bRecursive );
+
+ /**
+ * This method copies the propertyset containing the Additional Core
+ * Properties of a content.
+ *
+ * @param rSourceKey is the key of the source propertyset.
+ * @param rTargetKey is the key of the target propertyset.
+ * @param bRecursive is a flag indicating whether propertysets for
+ * children described by rSourceKey shall be copied, too.
+ * @return True, if the operation succeeded - False, otherwise.
+ */
+ sal_Bool copyAdditionalPropertySet( const OUString& rSourceKey,
+ const OUString& rTargetKey,
+ sal_Bool bRecursive );
+
+ /**
+ * This method removes the propertyset containing the Additional Core
+ * Properties of a content.
+ *
+ * @param rKey is the key of the propertyset.
+ * @param bRecursive is a flag indicating whether propertysets for
+ * children described by rOldKey shall be removed, too.
+ * @return True, if the operation succeeded - False, otherwise.
+ */
+ sal_Bool removeAdditionalPropertySet( const OUString& rKey,
+ sal_Bool bRecursive );
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_PROVIDERHELPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/proxydecider.hxx b/include/ucbhelper/proxydecider.hxx
new file mode 100644
index 000000000000..e3ec58180a00
--- /dev/null
+++ b/include/ucbhelper/proxydecider.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 _UCBHELPER_PROXYDECIDER_HXX
+#define _UCBHELPER_PROXYDECIDER_HXX
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace lang {
+ class XMultiServiceFactory;
+} } } }
+
+namespace ucbhelper
+{
+
+/**
+ * This struct describes a proxy server.
+ */
+struct InternetProxyServer
+{
+ /**
+ * The name of the proxy server.
+ */
+ OUString aName;
+
+ /**
+ * The port of the proxy server.
+ */
+ sal_Int32 nPort;
+
+ /**
+ * Constructor.
+ */
+ InternetProxyServer() : nPort( -1 ) {}
+};
+
+namespace proxydecider_impl { class InternetProxyDecider_Impl; }
+
+/**
+ * This class is able to decide whether and which internet proxy server is to
+ * be used to access a given URI.
+ *
+ * The implementation reads the internet proxy settings from Office
+ * configuration. It listens for configuration changes and adapts itself
+ * accordingly. Because configuration data can change during runtime clients
+ * should not cache results obtained from InternetProxyDecider instances. One
+ * instance should be kept to be queried multiple times instead.
+ */
+class UCBHELPER_DLLPUBLIC InternetProxyDecider
+{
+public:
+ /**
+ * Constructor.
+ *
+ * Note: Every instance should be held alive as long as possible because
+ * because construction is quite expensive.
+ *
+ * @param rxSMgr is a Service Manager.
+ */
+ InternetProxyDecider( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& rxContext );
+
+ /**
+ * Destructor.
+ */
+ ~InternetProxyDecider();
+
+ /**
+ * Informs whether a proxy server should be used.
+ *
+ * @param rProtocol contains the internet protocol to be used to
+ * access the server (i.e. "ftp", "http"). The protocol string
+ * is handled case-insensitive and must not be empty.
+ * @param rHost contains the name of the server that should be accessed.
+ * This parameter might be left empty. In this case the
+ * implementation will return whether a proxy is configured
+ * for the given protocol.
+ * @param nPort contains the port of the server that should be accessed.
+ * If host is not empty this parameter must always contain a valid
+ * port number, for instance the default port for the requested
+ * protocol(i.e. 80 or http).
+ * @return true if a proxy server should be used, false otherwise.
+ */
+ bool
+ shouldUseProxy( const OUString & rProtocol,
+ const OUString & rHost,
+ sal_Int32 nPort ) const;
+
+ /**
+ * Returns the proxy server to be used.
+ *
+ * @param rProtocol contains the internet protocol to be used to
+ * access the server (i.e. "ftp", "http"). The protocol string
+ * is handled case-insensitive and must not be empty.
+ * @param rHost contains the name of the server that should be accessed.
+ * This parameter might be left empty. In this case the
+ * implementation will return the proxy that is configured
+ * for the given protocol.
+ * @param nPort contains the port of the server that should be accessed.
+ * If host is not empty this parameter must always contain a valid
+ * port number, for instance the default port for the requested
+ * protocol(i.e. 80 or http).
+ * @return a InternetProxyServer reference. If member aName of the
+ * InternetProxyServer is empty no proxy server is to be used.
+ */
+ const InternetProxyServer &
+ getProxy( const OUString & rProtocol,
+ const OUString & rHost,
+ sal_Int32 nPort ) const;
+
+private:
+ proxydecider_impl::InternetProxyDecider_Impl * m_pImpl;
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_PROXYDECIDER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/registerucb.hxx b/include/ucbhelper/registerucb.hxx
new file mode 100644
index 000000000000..ab241a2f9cb4
--- /dev/null
+++ b/include/ucbhelper/registerucb.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UCBHELPER_REGISTERUCB_HXX_
+#define _UCBHELPER_REGISTERUCB_HXX_
+
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/ucb/XContentProvider.hpp>
+#include <com/sun/star/ucb/XContentProviderManager.hpp>
+#include <vector>
+
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace lang { class XMultiServiceFactory; }
+} } }
+
+
+namespace ucbhelper {
+
+//============================================================================
+/** Information about a registered content provider.
+ */
+struct ContentProviderRegistrationInfo
+{
+ /** The registered content provider (or null if registration failed).
+ */
+ com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider >
+ m_xProvider;
+
+ /** The arguments the content provider was instantiated with.
+ */
+ OUString m_aArguments;
+
+ /** The URL template the content provider is registered on.
+ */
+ OUString m_aTemplate;
+};
+
+typedef std::vector< ContentProviderRegistrationInfo >
+ ContentProviderRegistrationInfoList;
+
+//============================================================================
+/** Information about a content provider, passed to
+ <method>configureUcb</method>.
+ */
+struct ContentProviderData
+{
+ /** The UNO service name to use to instanciate the content provider.
+ */
+ OUString ServiceName;
+
+ /** The URL template to use to instanciate the content provider.
+ */
+ OUString URLTemplate;
+
+ /** The arguments to use to instanciate the content provider.
+ */
+ OUString Arguments;
+
+ ContentProviderData() {};
+ ContentProviderData( const OUString & rService,
+ const OUString & rTemplate,
+ const OUString & rArgs )
+ : ServiceName( rService ), URLTemplate( rTemplate ), Arguments( rArgs ) {}
+};
+
+typedef std::vector< ContentProviderData > ContentProviderDataList;
+//============================================================================
+/** Register a content provider at a Universal Content Broker.
+
+ @param rManager A content provider manager (normally, this would be a
+ UCB). May be null, which is only useful if the content provider is an
+ <type>XParamterizedContentProvider</type>s.
+
+ @param rServiceFactory A factory through which to obtain the required
+ services.
+
+ @param rName The service name of the content provider.
+
+ @param rArguments Any arguments to instantiate the content provider with.
+
+ @param rTemplate The URL template to register the content provider on.
+
+ @param pInfo If not null, this output parameter is filled with
+ information about the (atemptively) registered provider.
+ */
+
+UCBHELPER_DLLPUBLIC bool registerAtUcb(
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentProviderManager > const &
+ rManager,
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > const &
+ rServiceFactory,
+ OUString const & rName,
+ OUString const & rArguments,
+ OUString const & rTemplate,
+ ContentProviderRegistrationInfo * pInfo)
+ throw (com::sun::star::uno::RuntimeException);
+
+}
+#endif // _UCBHELPER_REGISTERUCB_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/resultset.hxx b/include/ucbhelper/resultset.hxx
new file mode 100644
index 000000000000..531955124f2b
--- /dev/null
+++ b/include/ucbhelper/resultset.hxx
@@ -0,0 +1,573 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UCBHELPER_RESULTSET_HXX
+#define _UCBHELPER_RESULTSET_HXX
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/ucb/ResultSetException.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/ucb/XContentAccess.hpp>
+#include <com/sun/star/sdbc/XResultSet.hpp>
+#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/sdbc/XCloseable.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include "rtl/ref.hxx"
+#include "salhelper/simplereferenceobject.hxx"
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper {
+
+//=========================================================================
+
+#define RESULTSET_SERVICE_NAME "com.sun.star.ucb.ContentResultSet"
+
+//=========================================================================
+
+class ResultSetDataSupplier;
+struct ResultSet_Impl;
+
+/**
+ * This is an implementation of the service com.sun.star.ucb.ContentResultSet.
+ * It can be used to implement the method XDynamicResultSet::getStaticResultSet,
+ * which needs to be implemented for instance to implement the command "open"
+ * at folder objects. This class uses a user supplied ResultSetDataSupplier
+ * object to request data on demand.
+ *
+ * @see ResultSetDataSupplier
+ */
+class UCBHELPER_DLLPUBLIC ResultSet :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::lang::XServiceInfo,
+ public com::sun::star::lang::XComponent,
+ public com::sun::star::ucb::XContentAccess,
+ public com::sun::star::sdbc::XResultSet,
+ public com::sun::star::sdbc::XResultSetMetaDataSupplier,
+ public com::sun::star::sdbc::XRow,
+ public com::sun::star::sdbc::XCloseable,
+ public com::sun::star::beans::XPropertySet
+{
+ ResultSet_Impl* m_pImpl;
+
+public:
+ /**
+ * Construction.
+ *
+ * @param rxSMgr is a Service Manager.
+ * @param rProperties is a sequence of properties for that the resultset
+ * shall be able to obtain the values.
+ * @param rDataSupplier is a supplier for the resultset data.
+ */
+ ResultSet(
+ const com::sun::star::uno::Reference<
+ com::sun::star::uno::XComponentContext >& rxContext,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::beans::Property >& rProperties,
+ const rtl::Reference< ResultSetDataSupplier >& rDataSupplier );
+ /**
+ * Construction.
+ *
+ * @param rxSMgr is a Service Manager.
+ * @param rProperties is a sequence of properties for that the resultset
+ * shall be able to obtain the values.
+ * @param rDataSupplier is a supplier for the resultset data.
+ * @param rxEnv is the environment for interactions, progress propagation,
+ * ...
+ */
+ ResultSet(
+ const com::sun::star::uno::Reference<
+ com::sun::star::uno::XComponentContext >& rxContext,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::beans::Property >& rProperties,
+ const rtl::Reference< ResultSetDataSupplier >& rDataSupplier,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >& rxEnv );
+ virtual ~ResultSet();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XServiceInfo
+ XSERVICEINFO_NOFACTORY_DECL()
+
+ // XComponent
+ virtual void SAL_CALL
+ dispose()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ addEventListener( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removeEventListener( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XContentAccess
+ virtual OUString SAL_CALL
+ queryContentIdentifierString()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentIdentifier > SAL_CALL
+ queryContentIdentifier()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContent > SAL_CALL
+ queryContent()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XResultSetMetaDataSupplier
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XResultSetMetaData > SAL_CALL
+ getMetaData()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+
+ // XResultSet
+ virtual sal_Bool SAL_CALL
+ next()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ isBeforeFirst()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ isAfterLast()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ isFirst()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ isLast()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ beforeFirst()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ afterLast()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ first()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ last()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Int32 SAL_CALL
+ getRow()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ absolute( sal_Int32 row )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ relative( sal_Int32 rows )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ previous()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ refreshRow()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ rowUpdated()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ rowInserted()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ rowDeleted()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::uno::XInterface > SAL_CALL
+ getStatement()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+
+ // XRow
+ virtual sal_Bool SAL_CALL
+ wasNull()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL
+ getString( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ getBoolean( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Int8 SAL_CALL
+ getByte( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Int16 SAL_CALL
+ getShort( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Int32 SAL_CALL
+ getInt( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Int64 SAL_CALL
+ getLong( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual float SAL_CALL
+ getFloat( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual double SAL_CALL
+ getDouble( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getBytes( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::util::Date SAL_CALL
+ getDate( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::util::Time SAL_CALL
+ getTime( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::util::DateTime SAL_CALL
+ getTimestamp( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::io::XInputStream > SAL_CALL
+ getBinaryStream( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::io::XInputStream > SAL_CALL
+ getCharacterStream( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Any SAL_CALL
+ getObject( sal_Int32 columnIndex,
+ const com::sun::star::uno::Reference<
+ com::sun::star::container::XNameAccess >& typeMap )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XRef > SAL_CALL
+ getRef( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XBlob > SAL_CALL
+ getBlob( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XClob > SAL_CALL
+ getClob( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XArray > SAL_CALL
+ getArray( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+
+ // XCloseable
+ virtual void SAL_CALL
+ close()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+
+ // XPropertySet
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setPropertyValue( const OUString& aPropertyName,
+ const com::sun::star::uno::Any& aValue )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::beans::PropertyVetoException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Any SAL_CALL
+ getPropertyValue( const OUString& PropertyName )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ addPropertyChangeListener( const OUString& aPropertyName,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener >& xListener )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removePropertyChangeListener( const OUString& aPropertyName,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener >& aListener )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ addVetoableChangeListener( const OUString& PropertyName,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removeVetoableChangeListener( const OUString& PropertyName,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+
+ /////////////////////////////////////////////////////////////////////
+ // Non-interface methods.
+ /////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method propagates property value changes to all registered
+ * listeners.
+ *
+ * @param rEvt is a property change event.
+ */
+ void propertyChanged(
+ const com::sun::star::beans::PropertyChangeEvent& rEvt );
+
+ /**
+ * This method should be called by the data supplier for the result set
+ * to indicate that there were new data obtained from the data source.
+ *
+ * @param nOld is the old count of rows; must be non-negative.
+ * @param nnew is the new count of rows; must be non-negative.
+ */
+ void rowCountChanged( sal_uInt32 nOld, sal_uInt32 nNew );
+
+ /**
+ * This method should be called by the data supplier for the result set
+ * to indicate that there were all rows obtained from the data source.
+ */
+ void rowCountFinal();
+
+ /**
+ * This method returns a sequence containing all properties ( not the
+ * values! ) of the result set.
+ *
+ * @return a sequence of properties.
+ */
+ const com::sun::star::uno::Sequence< com::sun::star::beans::Property >&
+ getProperties();
+
+ /**
+ * This method returns the environment to use for interactions, progress
+ * propagation, ... It can by empty.
+ *
+ * @return an environment or an empty reference.
+ */
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >&
+ getEnvironment();
+};
+
+//=========================================================================
+
+/**
+ * This is the base class for an object that supplies data to a result set
+ *
+ * @see ResultSet
+ */
+class ResultSetDataSupplier : public salhelper::SimpleReferenceObject
+{
+ friend class ResultSet;
+
+ // No ref, otherwise we get a cyclic reference between supplier and set!
+ // Will be set from ResultSet ctor.
+ ResultSet* m_pResultSet;
+
+public:
+ ResultSetDataSupplier() : m_pResultSet( 0 ) {}
+
+ /**
+ * This method returns the resultset this supplier belongs to.
+ *
+ * @return the resultset for that the supplier supplies data.
+ */
+ rtl::Reference< ResultSet > getResultSet() const { return m_pResultSet; }
+
+ /**
+ * This method returns the identifier string of the content at the
+ * specified index.
+ *
+ * @param nIndex is the zero-based index within the logical data array
+ * of the supplier; must be non-negative.
+ * @return the content's identifier string.
+ */
+ virtual OUString queryContentIdentifierString( sal_uInt32 nIndex ) = 0;
+
+ /**
+ * This method returns the identifier of the content at the specified index.
+ *
+ * @param nIndex is the zero-based index within the logical data array
+ * of the supplier; must be non-negative.
+ * @return the content's identifier.
+ */
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentIdentifier >
+ queryContentIdentifier( sal_uInt32 nIndex ) = 0;
+
+ /**
+ * This method returns the content at the specified index.
+ *
+ * @param nIndex is the zero-based index within the logical data array
+ * of the supplier; must be non-negative.
+ * @return the content.
+ */
+ virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent >
+ queryContent( sal_uInt32 nIndex ) = 0;
+
+ /**
+ * This method returns whether there is a content at the specified index.
+ *
+ * @param nIndex is the zero-based index within the logical data array
+ * of the supplier; must be non-negative.
+ * @return true, if there is a content at the given index.
+ */
+ virtual sal_Bool getResult( sal_uInt32 nIndex ) = 0;
+
+ /**
+ * This method returns the total count of objects in the logical data array
+ * of the supplier. The implementation of this method may be very
+ * "expensive", because it can be necessary to obtain all data in order
+ * to determine the count. Therefor the ResultSet implementation calls
+ * it very seldom.
+ *
+ * @return the total count of objects; will always be non-negative.
+ */
+ virtual sal_uInt32 totalCount() = 0;
+
+ /**
+ * This method returns the count of objects obtained so far. There is no
+ * for the implemetation to obtain all objects at once. It can obtain
+ * all data on demand.
+ *
+ * The implementation should call m_pResultSet->rowCountChanged(...)
+ * everytime it has inserted a new entry in its logical result array.
+ *
+ * @return the count of objects obtained so far; will always be
+ * non-negative.
+ */
+ virtual sal_uInt32 currentCount() = 0;
+
+ /**
+ * This method returns whether the value returned by currentCount() is
+ * "final". This is the case, if that there was all data obtained by the
+ * supplier and the current count won't increase any more.
+ *
+ * The implementation should call m_pResultSet->rowCountFinal(...) if
+ * it has inserted all entries in its logical result array.
+ *
+ * @return true, if the value returned by currentCount() won't change
+ anymore.
+ */
+ virtual sal_Bool isCountFinal() = 0;
+
+ /**
+ * This method returns an object for accessing the property values at
+ * the specified index. The implementation may use the helper class
+ * ucb::PropertyValueSet to provide the return value.
+ *
+ * @param nIndex is the zero-based index within the logical data array
+ * of the supplier.
+ * @return the object for accessing the property values.
+ */
+ virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRow >
+ queryPropertyValues( sal_uInt32 nIndex ) = 0;
+
+ /**
+ * This method is called to instruct the supplier to release the (possibly
+ * presnt) property values at the given index.
+ *
+ * @param nIndex is the zero-based index within the logical data array
+ * of the supplier.
+ */
+ virtual void releasePropertyValues( sal_uInt32 nIndex ) = 0;
+
+ /**
+ * This method will be called by the resultset implementation in order
+ * to instruct the data supplier to release all resources it has
+ * allocated so far. In case the supplier is collecting data
+ * asynchronously, that process must be stopped.
+ */
+ virtual void close() = 0;
+
+ /**
+ * This method will be called by the resultset implementation in order
+ * check, whether an error has occurred while collecting data. The
+ * implementation of this method must throw an exception in that case.
+ *
+ * Note: An exception thrown to indicate an error must always be thrown
+ * by the thread that created the data supplier. If the supplier collects
+ * data asynchronously ( i.e. in a separate thread ) and an error
+ * occures, throwing of the appropriate exception must be deferred
+ * until validate() is called by the ResultSet implementation from
+ * inside the main thread.
+ * In case data are obtained synchronously, the ResultSetException can
+ * be thrown directly.
+ *
+ * @exception ResultSetException thrown, if an error has occurred
+ */
+ virtual void validate()
+ throw( com::sun::star::ucb::ResultSetException ) = 0;
+};
+
+}
+
+#endif /* !_UCBHELPER_RESULTSET_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/resultsethelper.hxx b/include/ucbhelper/resultsethelper.hxx
new file mode 100644
index 000000000000..80dd0581652d
--- /dev/null
+++ b/include/ucbhelper/resultsethelper.hxx
@@ -0,0 +1,204 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UCBHELPER_RESULTSETHELPER_HXX
+#define _UCBHELPER_RESULTSETHELPER_HXX
+
+#include <osl/mutex.hxx>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/ucb/XDynamicResultSet.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+#include <ucbhelper/contenthelper.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace cppu {
+ class OInterfaceContainerHelper;
+}
+
+namespace ucbhelper {
+
+//=========================================================================
+
+#define DYNAMICRESULTSET_SERVICE_NAME "com.sun.star.ucb.DynamicResultSet"
+
+//=========================================================================
+
+/**
+ * This is an abstract base class for implementations of the service
+ * com.sun.star.ucb.DynamicResultSet, which is the result of the command
+ * "open" executed at a UCB folder content.
+ *
+ * Features of the base class implementation:
+ * - standard interfaces ( XInterface, XTypeProvider, XServiceInfo )
+ * - all required interfaces for service com::sun::star::ucb::DynamicResultSet
+ */
+class UCBHELPER_DLLPUBLIC ResultSetImplHelper :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::lang::XServiceInfo,
+ public com::sun::star::ucb::XDynamicResultSet
+{
+ cppu::OInterfaceContainerHelper* m_pDisposeEventListeners;
+ sal_Bool m_bStatic;
+ sal_Bool m_bInitDone;
+
+protected:
+ osl::Mutex m_aMutex;
+ com::sun::star::ucb::OpenCommandArgument2 m_aCommand;
+ com::sun::star::uno::Reference<
+ com::sun::star::uno::XComponentContext > m_xContext;
+ // Resultset #1
+ com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XResultSet > m_xResultSet1;
+ // Resultset #2
+ com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XResultSet > m_xResultSet2;
+ // Resultset changes listener.
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XDynamicResultSetListener > m_xListener;
+
+private:
+ UCBHELPER_DLLPRIVATE void init( sal_Bool bStatic );
+
+ /**
+ * Your implementation of this method has to fill the protected member
+ * m_xResultSet1. This resultset must implement a complete static
+ * resultset ( service com.sun.star.ucb.ContentResultSet ). This method
+ * will be called at most once in the life of your implementation object.
+ * After this method was called, the type of this resultset will be
+ * "static". There is no way to change the type afterwards.
+ * If this method gets called the client wants to use your resultset
+ * exclusively statically. You may deploy this factum to optimize your
+ * implementation (i.e. "switch off" all changes detection code in
+ * your implementation).
+ * Note that you may use the class ucb::ResultSet to implement the
+ * static resultset, that is required here.
+ */
+ UCBHELPER_DLLPRIVATE virtual void initStatic() = 0;
+
+ /**
+ * Your implementation of this method has to fill the protected members
+ * m_xResultSet1 and m_xResultSet2 of this base class. Each of these
+ * resultsets must implement a complete static resultset
+ * ( service com.sun.star.ucb.ContentResultSet ). This method will be
+ * called at most once in the life of your implementation object.
+ * After this method was called, the type of this resultset will be
+ * "dynamic". There is no way to change the type afterwards.
+ * If this method gets called the client wants to use your resultset
+ * exclusively dynamically. This means, it is interested in getting
+ * notifications on changes of data of the resultset contents. ( These
+ * changes are to propagate by your implementation throw the member
+ * m_xListener of this base class ).
+ * If your implementation cannot detect changes of relevant data, you
+ * may fill m_xResultSet1 and m_xResultSet2 with the same static resultset
+ * implementation object. This normally will be the same instance you put
+ * into m_xResultSet1 when initStatic() is called.
+ */
+ UCBHELPER_DLLPRIVATE virtual void initDynamic() = 0;
+
+public:
+ /**
+ * Construtor.
+ *
+ * @param rxContext is a Service Manager.
+ * @param rCommand is the paramter for the open command that produces
+ * this resultset.
+ */
+ ResultSetImplHelper(
+ const com::sun::star::uno::Reference<
+ com::sun::star::uno::XComponentContext >& rxContext,
+ const com::sun::star::ucb::OpenCommandArgument2& rCommand );
+
+ /**
+ * Destructor.
+ */
+ virtual ~ResultSetImplHelper();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XServiceInfo
+ XSERVICEINFO_NOFACTORY_DECL()
+
+ // XComponent ( base class of XDynamicResultSet )
+ virtual void SAL_CALL
+ dispose()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ addEventListener( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removeEventListener( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XDynamicResultSet
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XResultSet > SAL_CALL
+ getStaticResultSet()
+ throw( com::sun::star::ucb::ListenerAlreadySetException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setListener( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XDynamicResultSetListener >& Listener )
+ throw( com::sun::star::ucb::ListenerAlreadySetException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ connectToCache( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XDynamicResultSet > & xCache )
+ throw( com::sun::star::ucb::ListenerAlreadySetException,
+ com::sun::star::ucb::AlreadyInitializedException,
+ com::sun::star::ucb::ServiceNotFoundException,
+ com::sun::star::uno::RuntimeException );
+
+ /**
+ * The implemetation of this method always returns 0. Override this
+ * method, if necessary.
+ */
+ virtual sal_Int16 SAL_CALL
+ getCapabilities()
+ throw( com::sun::star::uno::RuntimeException );
+
+ //////////////////////////////////////////////////////////////////////
+ // Non-interface methods.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns, whether the resultset is static or dynamic.
+ * If neither getStatic() nor getDynamic() was called, the type
+ * of the resultset is "dynamic".
+ *
+ * @return true, if the resultset type is "static". False, otherwise.
+ */
+ sal_Bool isStatic() const { return m_bStatic; }
+};
+
+}
+
+#endif /* !_UCBHELPER_RESULTSETHELPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/resultsetmetadata.hxx b/include/ucbhelper/resultsetmetadata.hxx
new file mode 100644
index 000000000000..35996657553a
--- /dev/null
+++ b/include/ucbhelper/resultsetmetadata.hxx
@@ -0,0 +1,470 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UCBHELPER_RESULTSETMETADATA_HXX
+#define _UCBHELPER_RESULTSETMETADATA_HXX
+
+#include <vector>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace lang { class XMultiServiceFactory; }
+ namespace beans { struct Property; }
+} } }
+
+namespace ucbhelper_impl {
+ struct ResultSetMetaData_Impl;
+}
+
+namespace ucbhelper
+{
+
+//=========================================================================
+
+/**
+ * This is a structure that holds additional meta data for one column
+ * of a resultset. The default values set in the constructor should be a
+ * good guess for many UCB use cases.
+ */
+struct ResultSetColumnData
+{
+ /** @see ResultSetMetaData::isAutoIncrement */
+ sal_Bool isAutoIncrement;
+
+ /** @see ResultSetMetaData::isCaseSensitive */
+ sal_Bool isCaseSensitive;
+
+ /** @see ResultSetMetaData::isSearchable */
+ sal_Bool isSearchable;
+
+ /** @see ResultSetMetaData::isCurrency */
+ sal_Bool isCurrency;
+
+ /** @see ResultSetMetaData::isNullable */
+ sal_Int32 isNullable;
+
+ /** @see ResultSetMetaData::isSigned */
+ sal_Bool isSigned;
+
+ /** @see ResultSetMetaData::getColumnDisplaySize */
+ sal_Int32 columnDisplaySize;
+
+ /** @see ResultSetMetaData::getColumnLabel */
+ OUString columnLabel;
+
+ /** @see ResultSetMetaData::getSchemaName */
+ OUString schemaName;
+
+ /** @see ResultSetMetaData::getPrecision */
+ sal_Int32 precision;
+
+ /** @see ResultSetMetaData::getScale */
+ sal_Int32 scale;
+
+ /** @see ResultSetMetaData::getTableName */
+ OUString tableName;
+
+ /** @see ResultSetMetaData::getCatalogName */
+ OUString catalogName;
+
+ /** @see ResultSetMetaData::getColumnTypeName */
+ OUString columnTypeName;
+
+ /** @see ResultSetMetaData::isReadOnly */
+ sal_Bool isReadOnly;
+
+ /** @see ResultSetMetaData::isWritable */
+ sal_Bool isWritable;
+
+ /** @see ResultSetMetaData::isDefinitelyWritable */
+ sal_Bool isDefinitelyWritable;
+
+ /** @see ResultSetMetaData::getColumnServiceName */
+ OUString columnServiceName;
+
+ inline ResultSetColumnData();
+};
+
+// Note: Never change the initial values! Implementations using this struct
+// may havily depend on the behaviour of the default constructor.
+
+ResultSetColumnData::ResultSetColumnData()
+: isAutoIncrement( sal_False ),
+ isCaseSensitive( sal_True ),
+ isSearchable( sal_False ),
+ isCurrency( sal_False ),
+ isNullable( ::com::sun::star::sdbc::ColumnValue::NULLABLE ),
+ isSigned( sal_False ),
+ columnDisplaySize( 16 ),
+ precision( -1 ),
+ scale( 0 ),
+ isReadOnly( sal_True ),
+ isWritable( sal_False ),
+ isDefinitelyWritable( sal_False )
+{
+}
+
+//=========================================================================
+
+/**
+ * This is an implementation of the interface XResultSetMetaData. It can be
+ * used to implement the interface
+ * com::sun::star::sdbc::XResultSetMetaDataSupplier, which is required for
+ * implementations of service com.sun.star.ucb.ContentResultSet.
+ */
+class UCBHELPER_DLLPUBLIC ResultSetMetaData :
+ public ::cppu::OWeakObject,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::com::sun::star::sdbc::XResultSetMetaData
+{
+private:
+ ucbhelper_impl::ResultSetMetaData_Impl* m_pImpl;
+
+protected:
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::Property > m_aProps;
+ sal_Bool m_bReadOnly;
+
+public:
+
+ /**
+ * Constructor.
+ *
+ * @param rxSMgr is a Servive Manager.
+ * @param rProps is a sequence of properties (partially) describing the
+ * columns of a resultset.
+ * @param bReadOnly is used to specify whether the whole(!) resultset
+ * is read-only.
+ */
+ ResultSetMetaData(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::Property >& rProps,
+ sal_Bool bReadOnly = sal_True );
+
+ /**
+ * Constructor.
+ *
+ * @param rxSMgr is a Servive Manager.
+ * @param rProps is a sequence of properties (partially) describing the
+ * columns of a resultset.
+ * @param rColumnData contains additional meta data for the columns of
+ * a resultset, which override the default values returned by the
+ * appropriate methods of this class. The length of rColumnData
+ * must be the same as length of rProps.
+ * rColumnData[ 0 ] corresponds to data in rProps[ 0 ],
+ * rColumnData[ 1 ] corresponds to data in rProps[ 1 ], ...
+ */
+ ResultSetMetaData(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::Property >& rProps,
+ const std::vector< ResultSetColumnData >& rColumnData );
+
+ /**
+ * Destructor.
+ */
+ virtual ~ResultSetMetaData();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XResultSetMetaData
+
+ /**
+ * Returns the number of columns of the resultset.
+ *
+ * @return the length of the property sequence.
+ */
+ virtual sal_Int32 SAL_CALL
+ getColumnCount()
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Checks whether column is automatically numbered, which makes it
+ * read-only.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if column is automatically numbered.
+ */
+ virtual sal_Bool SAL_CALL
+ isAutoIncrement( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Checks whether column is case sensitive.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if column is case sensitive.
+ */
+ virtual sal_Bool SAL_CALL
+ isCaseSensitive( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Checks whether the value stored in column can be used in a
+ * WHERE clause.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if the column is searchable.
+ */
+ virtual sal_Bool SAL_CALL
+ isSearchable( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Checks whether column is a cash value.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if the column is a cash value.
+ */
+ virtual sal_Bool SAL_CALL
+ isCurrency( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Checks whether a NULL can be stored in column.
+ *
+ * @see com::sun::star::sdbc::ColumnValue
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return ::com::sun::star::sdbc::ColumnValue::NULLABLE, if a NULL
+ * can be stored in the column.
+ */
+ virtual sal_Int32 SAL_CALL
+ isNullable( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Checks whether the value stored in column is a signed number.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if the value stored in column is a signed number.
+ */
+ virtual sal_Bool SAL_CALL
+ isSigned( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the normal maximum width in characters for column.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the normal maximum width in characters for column.
+ */
+ virtual sal_Int32 SAL_CALL
+ getColumnDisplaySize( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the suggested column title for column, to be used in print-
+ * outs and displays.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the column label.
+ */
+ virtual OUString SAL_CALL
+ getColumnLabel( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the name of column.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the name of the property that corresponds to column.
+ */
+ virtual OUString SAL_CALL
+ getColumnName( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the schema name for the table from which column of this
+ * result set was derived.
+ * Because this feature is not widely supported, the return value
+ * for many DBMSs will be an empty string.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the schema name of column or an empty string.
+ */
+ virtual OUString SAL_CALL
+ getSchemaName( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * For number types, getprecision gets the number of decimal digits
+ * in column.
+ * For character types, it gets the maximum length in characters for
+ * column.
+ * For binary types, it gets the maximum length in bytes for column.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the precision for the column.
+ */
+ virtual sal_Int32 SAL_CALL
+ getPrecision( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the number of digits to the right of the decimal point for
+ * values in column.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the scale of the column.
+ */
+ virtual sal_Int32 SAL_CALL
+ getScale( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the name of the table from which column of this result set
+ * was derived or "" if there is none (for example, for a join).
+ * Because this feature is not widely supported, the return value
+ * for many DBMSs will be an empty string.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the table name for column or an empty string.
+ */
+ virtual OUString SAL_CALL
+ getTableName( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL
+ /**
+ * Gets the catalog name for the table from which column of this
+ * result set was derived.
+ * Because this feature is not widely supported, the return value
+ * for many DBMSs will be an empty string.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the catalog name for column or an empty string.
+ */
+ getCatalogName( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the JDBC type for the value stored in column. ... The STRUCT
+ * and DISTINCT type codes are always returned for structured and
+ * distinct types, regardless of whether the value will be mapped
+ * according to the standard mapping or be a custom mapping.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the type of the property that corresponds to column - mapped
+ * from UNO-Type to SQL-Type.
+ */
+ virtual sal_Int32 SAL_CALL
+ getColumnType( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the type name used by this particular data source for the
+ * values stored in column. If the type code for the type of value
+ * stored in column is STRUCT, DISTINCT or JAVA_OBJECT, this method
+ * returns a fully-qualified SQL type name.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the column type name.
+ */
+ virtual OUString SAL_CALL
+ getColumnTypeName( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Indicates whether a column is definitely not writable.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if the column is definetely not writable.
+ */
+ virtual sal_Bool SAL_CALL
+ isReadOnly( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Indicates whether it is possible for a write on the column to succeed.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if it is possible for a write to succeed.
+ */
+ virtual sal_Bool SAL_CALL
+ isWritable( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Indicates whether a write on the column will definitely succeed.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if a write on the column will definetely succeed.
+ */
+ virtual sal_Bool SAL_CALL
+ isDefinitelyWritable( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Returns the fully-qualified name of the service whose instances
+ * are manufactured if the method
+ * com::sun::star::sdbc::ResultSet::getObject is called to retrieve a
+ * value from the column.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the service name for column or an empty string, if no service
+ * is applicable.
+ */
+ virtual OUString SAL_CALL
+ getColumnServiceName( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_RESULTSETMETADATA_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/simpleauthenticationrequest.hxx b/include/ucbhelper/simpleauthenticationrequest.hxx
new file mode 100644
index 000000000000..7a084265003c
--- /dev/null
+++ b/include/ucbhelper/simpleauthenticationrequest.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 _UCBHELPER_SIMPLEAUTHENTICATIONREQUEST_HXX
+#define _UCBHELPER_SIMPLEAUTHENTICATIONREQUEST_HXX
+
+#include <rtl/ref.hxx>
+#include <ucbhelper/interactionrequest.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ class URLAuthenticationRequest;
+} } } }
+
+namespace ucbhelper {
+
+/**
+ * This class implements a simple authentication interaction request.
+ * Instances can be passed directly to XInteractionHandler::handle(...). Each
+ * instance contains an AuthenticationRequest and three interaction
+ * continuations: "Abort", "Retry" and "SupplyAuthentication". The parameters
+ * for the AuthenticationRequest and the InteractionSupplyAuthentication
+ * objects are partly taken from contructors parameters and partly defaulted
+ * as follows:
+ *
+ * Read-only values : servername, realm
+ * Read-write values: username, password, account
+ * All remember-authentication values: RememberAuthentication_NO
+ *
+ * @see com::sun::star::ucb::AuthenticationRequest
+ * @see com::sun::star::ucb::RememberAuthentication
+ * @see InteractionAbort
+ * @see InteractionRetry
+ * @see InteractionSupplyAuthentication
+ */
+class UCBHELPER_DLLPUBLIC SimpleAuthenticationRequest : public ucbhelper::InteractionRequest
+{
+ rtl::Reference<
+ ucbhelper::InteractionSupplyAuthentication > m_xAuthSupplier;
+
+private:
+ void initialize( const ::com::sun::star::ucb::URLAuthenticationRequest & rRequest,
+ sal_Bool bCanSetRealm,
+ sal_Bool bCanSetUserName,
+ sal_Bool bCanSetPassword,
+ sal_Bool bCanSetAccount,
+ sal_Bool bAllowPersistentStoring,
+ sal_Bool bAllowUseSystemCredentials );
+
+public:
+ /** Specification whether some entity (realm, username, password, account)
+ is either not applicable at all, has a fixed value, or is modifiable.
+ */
+ enum EntityType
+ {
+ ENTITY_NA,
+ ENTITY_FIXED,
+ ENTITY_MODIFY
+ };
+
+ /**
+ * Constructor.
+ *
+ * @param rURL contains a URL for which authentication is requested.
+ * @param rServerName contains a server name.
+ * @param rRealm contains a realm, if applicable.
+ * @param rUserName contains a username, if available (for instance from
+ * a previous try).
+ * @param rPassword contains a password, if available (for instance from
+ * a previous try).
+ * @param rAccount contains an account, if applicable.
+ * @param bAllowPersistentStoring specifies if the credentials should
+ * be stored in the passowrd container persistently
+ * @param bAllowUseSystemCredntials specifies if requesting client is
+ * able to obtain and use system credentials for authentication
+ */
+ SimpleAuthenticationRequest( const OUString & rURL,
+ const OUString & rServerName,
+ const OUString & rRealm,
+ const OUString & rUserName,
+ const OUString & rPassword,
+ const OUString & rAccount,
+ sal_Bool bAllowPersistentStoring,
+ sal_Bool bAllowUseSystemCredentials );
+
+
+ /**
+ * Constructor.
+ *
+ * @param rServerName contains a server name.
+ * @param eRealmType specifies whether a realm is applicable and
+ modifiable.
+ * @param rRealm contains a realm, if applicable.
+ * @param eUserNameType specifies whether a username is applicable and
+ modifiable.
+ * @param rUserName contains a username, if available (for instance from
+ * a previous try).
+ * @param ePasswordType specifies whether a password is applicable and
+ modifiable.
+ * @param rPassword contains a password, if available (for instance from
+ * a previous try).
+ * @param eAccountType specifies whether an account is applicable and
+ modifiable.
+ * @param rAccount contains an account, if applicable.
+ */
+ SimpleAuthenticationRequest( const OUString & rURL,
+ const OUString & rServerName,
+ EntityType eRealmType,
+ const OUString & rRealm,
+ EntityType eUserNameType,
+ const OUString & rUserName,
+ EntityType ePasswordType,
+ const OUString & rPassword,
+ EntityType eAccountType = ENTITY_NA,
+ const OUString & rAccount
+ = OUString() );
+
+ /**
+ * This method returns the supplier for the missing authentication data,
+ * that, for instance can be used to query the password supplied by the
+ * interaction handler.
+ *
+ * @return the supplier for the missing authentication data.
+ */
+ const rtl::Reference< ucbhelper::InteractionSupplyAuthentication > &
+ getAuthenticationSupplier() const { return m_xAuthSupplier; }
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_SIMPLEAUTHENTICATIONREQUEST_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/simplecertificatevalidationrequest.hxx b/include/ucbhelper/simplecertificatevalidationrequest.hxx
new file mode 100644
index 000000000000..3f761153582b
--- /dev/null
+++ b/include/ucbhelper/simplecertificatevalidationrequest.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 _UCBHELPER_SIMPLECERTIFICATEVALIDATIONREQUEST_HXX
+#define _UCBHELPER_SIMPLECERTIFICATEVALIDATIONREQUEST_HXX
+
+#include <rtl/ref.hxx>
+#include <ucbhelper/interactionrequest.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+#include <com/sun/star/security/XCertificate.hpp>
+
+
+namespace ucbhelper {
+
+/**
+ * This class implements a simple validation interaction request of a certificate.
+ * Instances can be passed directly to XInteractionHandler::handle(...). Each
+ * instance contains an CertificateValidationRequest and two interaction
+ * continuations: "Abort" and "Approved". The parameters
+ * for the CertificateValidationRequest object are partly taken from contructors parameters and partly defaulted
+ * as follows:
+ *
+ * Read-write values: certificateValidity, certificate
+ *
+ * @see com::sun::star::ucb::CertificateValidationRequest
+ * @see InteractionApproved
+ * @see InteractionRetry
+ */
+class UCBHELPER_DLLPUBLIC SimpleCertificateValidationRequest : public ucbhelper::InteractionRequest
+{
+public:
+ /**
+ * Constructor.
+ *
+ * @param lCertificateValidity contains a bitmask which validation error occur.
+ * @param pCertificate contaisn the server certificate.
+ */
+ SimpleCertificateValidationRequest( const sal_Int32 & lCertificateValidity,
+ const com::sun::star::uno::Reference<com::sun::star::security::XCertificate> pCertificate,
+ const OUString & hostname );
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_SIMPLECERTIFICATEVALIDATIONREQUEST_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/simpleinteractionrequest.hxx b/include/ucbhelper/simpleinteractionrequest.hxx
new file mode 100644
index 000000000000..746aaf284bd6
--- /dev/null
+++ b/include/ucbhelper/simpleinteractionrequest.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UCBHELPER_SIMPLEINTERACTIONREQUEST_HXX
+#define _UCBHELPER_SIMPLEINTERACTIONREQUEST_HXX
+
+#include <ucbhelper/interactionrequest.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper {
+
+/** These are the constants that can be passed to the constructor of class
+ * SimpleInteractionRequest and that are returned by method
+ * SimpleInteractionRequest::getResponse().
+ */
+
+/** The request was not (yet) handled by the interaction handler. */
+static const sal_Int32 CONTINUATION_UNKNOWN = 0;
+
+/** The interaction handler selected XInteractionAbort. */
+static const sal_Int32 CONTINUATION_ABORT = 1;
+
+/** The interaction handler selected XInteractionRetry. */
+static const sal_Int32 CONTINUATION_RETRY = 2;
+
+/** The interaction handler selected XInteractionApprove. */
+static const sal_Int32 CONTINUATION_APPROVE = 4;
+
+/** The interaction handler selected XInteractionDisapprove. */
+static const sal_Int32 CONTINUATION_DISAPPROVE = 8;
+
+/**
+ * This class implements a simple interaction request. The user must not deal
+ * with XInteractionContinuations directly, but can use constants that are
+ * mapped internally to the according objects. This class encapsulates the
+ * standard Interaction Continuations "Abort", "Retry", "Approve" and
+ * "Disaprrove". Instances can be passed directly to
+ * XInteractionHandler::handle(...).
+ *
+ * @see InteractionRequest
+ * @see InteractionAbort
+ * @see InteractionRetry
+ * @see InteractionApprove
+ * @see InteractionDisapprove
+ */
+class UCBHELPER_DLLPUBLIC SimpleInteractionRequest : public ucbhelper::InteractionRequest
+{
+public:
+ /**
+ * Constructor.
+ *
+ * @param rRequest is the exception describing the error.
+ * @param nContinuations contains the possible "answers" for the request.
+ * This can be any of the CONTINUATION_* constants combinations
+ * listed above.
+ */
+ SimpleInteractionRequest( const com::sun::star::uno::Any & rRequest,
+ const sal_Int32 nContinuations );
+
+ /**
+ * After passing this request to XInteractionHandler::handle, this method
+ * returns the continuation that was choosen by the interaction handler.
+ *
+ * @return the continuation choosen by an interaction handler or
+ * CONTINUATION_UNKNOWN, if the request was not (yet) handled.
+ */
+ sal_Int32 getResponse() const;
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_SIMPLEINTERACTIONREQUEST_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/simpleioerrorrequest.hxx b/include/ucbhelper/simpleioerrorrequest.hxx
new file mode 100644
index 000000000000..d4c9c5277316
--- /dev/null
+++ b/include/ucbhelper/simpleioerrorrequest.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 _UCBHELPER_SIMPLEIOERRORREQUEST_HXX
+#define _UCBHELPER_SIMPLEIOERRORREQUEST_HXX
+
+#include <com/sun/star/ucb/IOErrorCode.hpp>
+#include <ucbhelper/interactionrequest.hxx>
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ class XCommandProcessor;
+} } } }
+
+namespace ucbhelper {
+
+/**
+ * This class implements a simple IO error interaction request. Instances
+ * can be passed directly to XInteractionHandler::handle(...). Each
+ * instance contains an InteractiveIOException and one interaction
+ * continuation: "Abort".
+ *
+ * @see com::sun::star::ucb::InteractiveIOException
+ * @see InteractionAbort
+ */
+class SimpleIOErrorRequest : public ucbhelper::InteractionRequest
+{
+public:
+ /**
+ * Constructor.
+ *
+ * @param xContext contains the command processor that executes the
+ * command related to the request.
+ *
+ * @param eError is the error code to pass along with the request.
+ *
+ * qparam rArgs are additional parameters according to the specification
+ * of the error code. Refer to com/sun/star/ucb/IOErrorCode.idl
+ * for details.
+ */
+ SimpleIOErrorRequest( const com::sun::star::ucb::IOErrorCode eError,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::uno::Any > & rArgs,
+ const OUString & rMessage,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandProcessor > & xContext
+ );
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_SIMPLEIOERRORREQUEST_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/simplenameclashresolverequest.hxx b/include/ucbhelper/simplenameclashresolverequest.hxx
new file mode 100644
index 000000000000..be789fd6a148
--- /dev/null
+++ b/include/ucbhelper/simplenameclashresolverequest.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 _UCBHELPER_SIMPLENAMECLASHRESOLVEREQUEST_HXX
+#define _UCBHELPER_SIMPLENAMECLASHRESOLVEREQUEST_HXX
+
+#include <rtl/ref.hxx>
+#include <ucbhelper/interactionrequest.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper {
+
+/**
+ * This class implements a simple name clash resolve interaction request.
+ * Instances can be passed directly to XInteractionHandler::handle(...). Each
+ * instance contains a NameClashResolveRequest and two interaction
+ * continuations: "Abort" and "SupplyName". Another continuation
+ * ("ReplaceExistingData") may be supplied optionally.
+ *
+ * @see com::sun::star::ucb::NameClashResolveRequest
+ * @see InteractionAbort
+ * @see InteractioneplaceExistingData
+ * @see InteractionSupplyName
+ */
+class UCBHELPER_DLLPUBLIC SimpleNameClashResolveRequest : public ucbhelper::InteractionRequest
+{
+ rtl::Reference< InteractionSupplyName > m_xNameSupplier;
+
+public:
+ /**
+ * Constructor.
+ *
+ * @param rTargetFolderURL contains the URL of the folder that contains
+ * the clashing resource.
+ * @param rClashingName contains the clashing name.
+ * @param rProposedNewName contains a proposal for the new name or is
+ * empty.
+ * @param bSupportsOverwriteData indicates whether an
+ * InteractionReplaceExistingData continuation shall be supplied
+ * with the interaction request.
+ */
+ SimpleNameClashResolveRequest( const OUString & rTargetFolderURL,
+ const OUString & rClashingName,
+ const OUString & rProposedNewName,
+ sal_Bool bSupportsOverwriteData = sal_True );
+ /**
+ * This method returns the new name that was supplied by the interaction
+ * handler.
+ *
+ * @return the new name, if supplied.
+ */
+ const OUString getNewName() const
+ { return m_xNameSupplier->getName(); }
+
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_SIMPLENAMECLASHRESOLVEREQUEST_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/std_inputstream.hxx b/include/ucbhelper/std_inputstream.hxx
new file mode 100644
index 000000000000..92c9577519bc
--- /dev/null
+++ b/include/ucbhelper/std_inputstream.hxx
@@ -0,0 +1,115 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 _UCBHELPER_STD_INPUTSTREAM_HXX_
+#define _UCBHELPER_STD_INPUTSTREAM_HXX_
+
+#include <boost/shared_ptr.hpp>
+#include <istream>
+
+#include <rtl/ustring.hxx>
+#include <osl/mutex.hxx>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/queryinterface.hxx>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper
+{
+ /** Implements a seekable InputStream
+ * working on an std::istream
+ */
+ class UCBHELPER_DLLPUBLIC StdInputStream
+ : public cppu::OWeakObject,
+ public com::sun::star::io::XInputStream,
+ public com::sun::star::io::XSeekable
+ {
+ public:
+
+ StdInputStream( boost::shared_ptr< std::istream > pStream );
+
+ ~StdInputStream();
+
+ virtual css::uno::Any SAL_CALL queryInterface ( const css::uno::Type& rType )
+ throw ( css::uno::RuntimeException );
+
+ virtual void SAL_CALL acquire( ) throw ( );
+
+ virtual void SAL_CALL release( ) throw ( );
+
+ virtual sal_Int32 SAL_CALL
+ readBytes ( css::uno::Sequence< sal_Int8 >& aData,
+ sal_Int32 nBytesToRead )
+ throw ( css::io::NotConnectedException,
+ css::io::BufferSizeExceededException,
+ css::io::IOException,
+ css::uno::RuntimeException );
+
+ virtual sal_Int32 SAL_CALL
+ readSomeBytes ( css::uno::Sequence< sal_Int8 >& aData,
+ sal_Int32 nMaxBytesToRead )
+ throw ( css::io::NotConnectedException,
+ css::io::BufferSizeExceededException,
+ css::io::IOException,
+ css::uno::RuntimeException );
+
+ virtual void SAL_CALL
+ skipBytes ( sal_Int32 nBytesToSkip )
+ throw ( css::io::NotConnectedException,
+ css::io::BufferSizeExceededException,
+ css::io::IOException,
+ css::uno::RuntimeException );
+
+ virtual sal_Int32 SAL_CALL
+ available ( )
+ throw ( css::io::NotConnectedException,
+ css::io::IOException,
+ css::uno::RuntimeException );
+
+ virtual void SAL_CALL
+ closeInput ( )
+ throw ( css::io::NotConnectedException,
+ css::io::IOException,
+ css::uno::RuntimeException );
+
+
+ /** XSeekable
+ */
+
+ virtual void SAL_CALL
+ seek ( sal_Int64 location )
+ throw ( css::lang::IllegalArgumentException,
+ css::io::IOException,
+ css::uno::RuntimeException );
+
+
+ virtual sal_Int64 SAL_CALL
+ getPosition ( )
+ throw ( css::io::IOException, css::uno::RuntimeException );
+
+
+ virtual sal_Int64 SAL_CALL
+ getLength ( )
+ throw ( css::io::IOException,
+ css::uno::RuntimeException );
+
+ private:
+
+ osl::Mutex m_aMutex;
+ boost::shared_ptr< std::istream > m_pStream;
+ sal_Int64 m_nLength;
+ };
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/std_outputstream.hxx b/include/ucbhelper/std_outputstream.hxx
new file mode 100644
index 000000000000..d0ad4a660248
--- /dev/null
+++ b/include/ucbhelper/std_outputstream.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 _UCBHELPER_STD_OUTPUTSTREAM_HXX_
+#define _UCBHELPER_STD_OUTPUTSTREAM_HXX_
+
+#include <boost/shared_ptr.hpp>
+#include <ostream>
+
+#include <osl/mutex.hxx>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/queryinterface.hxx>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper
+{
+ /** Implements a OutputStream
+ * working on an std::ostream
+ */
+ class UCBHELPER_DLLPUBLIC StdOutputStream :
+ public cppu::OWeakObject,
+ public css::io::XOutputStream
+ {
+ public:
+
+ StdOutputStream( boost::shared_ptr< std::ostream > pStream );
+
+ ~StdOutputStream( );
+
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType )
+ throw ( css::uno::RuntimeException );
+
+ virtual void SAL_CALL acquire ( ) throw ( );
+
+ virtual void SAL_CALL release ( ) throw ( );
+
+ virtual void SAL_CALL writeBytes ( const css::uno::Sequence< sal_Int8 >& aData )
+ throw ( css::io::NotConnectedException,
+ css::io::BufferSizeExceededException,
+ css::io::IOException,
+ css::uno::RuntimeException );
+
+ virtual void SAL_CALL flush ( )
+ throw ( css::io::NotConnectedException,
+ css::io::BufferSizeExceededException,
+ css::io::IOException,
+ css::uno::RuntimeException );
+
+ virtual void SAL_CALL closeOutput ( )
+ throw ( css::io::NotConnectedException,
+ css::io::BufferSizeExceededException,
+ css::io::IOException,
+ css::uno::RuntimeException );
+
+ private:
+
+ osl::Mutex m_aMutex;
+ boost::shared_ptr< std::ostream > m_pStream;
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/ucbhelperdllapi.h b/include/ucbhelper/ucbhelperdllapi.h
new file mode 100644
index 000000000000..b129f163de8f
--- /dev/null
+++ b/include/ucbhelper/ucbhelperdllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_UCBHELPERDLLAPI_H
+#define INCLUDED_UCBHELPERDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(UCBHELPER_DLLIMPLEMENTATION)
+#define UCBHELPER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define UCBHELPER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define UCBHELPER_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_UCBHELPERDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/udm/html/htmlitem.hxx b/include/udm/html/htmlitem.hxx
new file mode 100644
index 000000000000..1750f5f0cb6a
--- /dev/null
+++ b/include/udm/html/htmlitem.hxx
@@ -0,0 +1,342 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CSI_HTML_HTMLITEM_HXX
+#define CSI_HTML_HTMLITEM_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+#include <udm/xml/xmlitem.hxx>
+ // COMPONENTS
+ // PARAMETERS
+
+
+namespace csi
+{
+namespace html
+{
+
+/** <BODY>
+*/
+class Body : public csi::xml::AnElement
+{
+ public:
+ Body()
+ : csi::xml::AnElement( "body" ) {}
+ private:
+ virtual bool LineBreakAfterBeginTag() const;
+};
+
+/** <BR>
+*/
+class HorizontalLine : public xml::XmlCode
+{
+ public:
+ HorizontalLine()
+ : xml::XmlCode("<hr>\n") {}
+};
+
+/** <A name="">
+*/
+class Label : public csi::xml::AnElement
+{
+ public:
+ Label(
+ const ::csv::String & i_sLabel )
+ : csi::xml::AnElement("a")
+ { *this << new csi::xml::AnAttribute(String("name"), i_sLabel); }
+};
+
+/** <p>
+*/
+class Paragraph : public csi::xml::AnElement
+{
+ public:
+ Paragraph()
+ : csi::xml::AnElement("p") {}
+ private:
+ virtual bool LineBreakAfterEndTag() const;
+};
+
+/** <H1-6>
+*/
+class Headline : public csi::xml::APureElement
+{
+ public:
+ Headline(
+ int i_nNr )
+ : csi::xml::APureElement(sTags[i_nNr-1]) { csv_assert(1 <= i_nNr AND i_nNr < 7); }
+ private:
+ static const char * sTags[6];
+ virtual bool LineBreakAfterEndTag() const;
+};
+
+/** <BR>
+*/
+class LineBreak : public xml::XmlCode
+{
+ public:
+ LineBreak()
+ : xml::XmlCode("<br>\n") {}
+};
+
+/** <b>
+*/
+class Bold : public csi::xml::APureElement
+{
+ public:
+ Bold()
+ : csi::xml::APureElement("b") {}
+};
+
+/** <i>
+*/
+class Italic : public csi::xml::APureElement
+{
+ public:
+ Italic()
+ : csi::xml::APureElement("i") {}
+};
+
+/** <strong>
+*/
+class Strong : public csi::xml::APureElement
+{
+ public:
+ Strong()
+ : csi::xml::APureElement("strong") {}
+};
+
+/** <em>
+*/
+class Emphasized : public csi::xml::APureElement
+{
+ public:
+ Emphasized()
+ : csi::xml::APureElement("em") {}
+};
+
+/** <font>
+*/
+class Font : public csi::xml::AnElement
+{
+ public:
+ Font()
+ : csi::xml::AnElement("font") {}
+};
+
+
+/** <A href="">
+*/
+class Link : public csi::xml::AnElement
+{
+ public:
+ Link(
+ const ::csv::String &i_sDestinaton )
+ : csi::xml::AnElement("a")
+ { *this << new csi::xml::AnAttribute(String("href"), i_sDestinaton); }
+};
+
+class TableCell : public csi::xml::AnElement
+{
+ public:
+ TableCell()
+ : csi::xml::AnElement("td") {}
+ private:
+ virtual bool LineBreakAfterEndTag() const;
+};
+
+class TableRow : public csi::xml::AnElement
+{
+ public:
+ TableRow()
+ : csi::xml::AnElement("tr") {}
+
+ private:
+ virtual bool LineBreakAfterBeginTag() const;
+};
+
+/** <table ....>
+*/
+class Table : public csi::xml::AnElement
+{
+ public:
+ Table()
+ : csi::xml::AnElement("table") {}
+ Table(
+ const ::csv::String & i_sBorder,
+ const ::csv::String & i_sWidth,
+ const ::csv::String & i_sCellPadding,
+ const ::csv::String & i_sCellSpacing );
+ TableRow & AddRow();
+ private:
+ virtual bool FinishEmptyTag_XmlStyle() const;
+ virtual bool LineBreakAfterBeginTag() const;
+};
+
+
+
+class DefListTerm : public csi::xml::AnElement
+{
+ public:
+ DefListTerm()
+ : csi::xml::AnElement("dt") {}
+ private:
+ virtual bool LineBreakAfterEndTag() const;
+};
+
+class DefListDefinition : public csi::xml::AnElement
+{
+ public:
+ DefListDefinition()
+ : csi::xml::AnElement("dd") {}
+ private:
+ virtual bool LineBreakAfterEndTag() const;
+};
+
+/** <DL>
+*/
+class DefList : public csi::xml::AnElement
+{
+ public:
+ DefList()
+ : csi::xml::AnElement("dl") {}
+
+ private:
+ virtual bool LineBreakAfterBeginTag() const;
+ virtual bool FinishEmptyTag_XmlStyle() const;
+};
+
+
+class ListItem : public csi::xml::AnElement
+{
+ public:
+ ListItem()
+ : csi::xml::AnElement("li") {}
+ private:
+ virtual bool LineBreakAfterEndTag() const;
+};
+
+/** <OL>
+*/
+class NumeratedList : public csi::xml::AnElement
+{
+ public:
+ NumeratedList()
+ : csi::xml::AnElement("ol") {}
+ private:
+ virtual bool LineBreakAfterBeginTag() const;
+};
+
+/** <UL>
+*/
+class SimpleList : public csi::xml::AnElement
+{
+ public:
+ SimpleList()
+ : csi::xml::AnElement("ul") {}
+
+ private:
+ virtual bool LineBreakAfterBeginTag() const;
+};
+
+
+class ClassAttr : public csi::xml::AnAttribute
+{
+ public:
+ ClassAttr(
+ const ::csv::String & i_sValue )
+ : csi::xml::AnAttribute( String("class"), i_sValue ) {}
+};
+
+class StyleAttr : public csi::xml::AnAttribute
+{
+ public:
+ StyleAttr(
+ const ::csv::String & i_sValue )
+ : csi::xml::AnAttribute( String("style"), i_sValue ) {}
+};
+
+class SizeAttr : public csi::xml::AnAttribute
+{
+ public:
+ SizeAttr(
+ const ::csv::String & i_sValue )
+ : csi::xml::AnAttribute( String("size"), i_sValue ) {}
+};
+
+class ColorAttr : public csi::xml::AnAttribute
+{
+ public:
+ ColorAttr(
+ const ::csv::String & i_sValue )
+ : csi::xml::AnAttribute( String("color"), i_sValue ) {}
+};
+
+class BgColorAttr : public csi::xml::AnAttribute
+{
+ public:
+ BgColorAttr(
+ const ::csv::String & i_sValue )
+ : csi::xml::AnAttribute( String("bgcolor"), i_sValue ) {}
+};
+
+class AlignAttr : public csi::xml::AnAttribute
+{
+ public:
+ AlignAttr(
+ const ::csv::String & i_sValue )
+ : csi::xml::AnAttribute( String("align"), i_sValue ) {}
+};
+
+class VAlignAttr : public csi::xml::AnAttribute
+{
+ public:
+ VAlignAttr(
+ const ::csv::String & i_sValue )
+ : csi::xml::AnAttribute( String("valign"), i_sValue ) {}
+};
+
+class WidthAttr : public csi::xml::AnAttribute
+{
+ public:
+ WidthAttr(
+ const ::csv::String & i_sValue )
+ : csi::xml::AnAttribute( String("width"), i_sValue ) {}
+};
+
+
+
+class Sbr : public csi::xml::XmlCode // Sourcefile lineBreak
+{
+ public:
+ Sbr()
+ : csi::xml::XmlCode("\n") {}
+};
+
+
+} // namespace html
+} // namespace csi
+
+namespace Html = csi::html;
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/udm/xml/xmlitem.hxx b/include/udm/xml/xmlitem.hxx
new file mode 100644
index 000000000000..eab5798feca0
--- /dev/null
+++ b/include/udm/xml/xmlitem.hxx
@@ -0,0 +1,339 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef CSI_XML_XMLITEM_HXX
+#define CSI_XML_XMLITEM_HXX
+
+// USED SERVICES
+ // BASE CLASSES
+ // COMPONENTS
+#include <cosv/tpl/swelist.hxx>
+#include <cosv/tpl/dyn.hxx>
+ // PARAMETERS
+
+namespace csv
+{
+ class bostream;
+}
+
+
+namespace csi
+{
+namespace xml
+{
+
+
+/* Basics:
+ Item, Attribute, Element, TextContext
+*/
+
+class Item
+{
+ public:
+ virtual ~Item() {}
+ void WriteOut(
+ csv::bostream & io_aFile ) const;
+ private:
+ virtual void do_WriteOut(
+ csv::bostream & io_aFile ) const = 0;
+};
+
+typedef csv::SweList_dyn< Item > ItemList;
+
+class Attribute
+{
+ public:
+ virtual ~Attribute() {}
+
+ void WriteOut(
+ csv::bostream & io_aFile ) const;
+
+ const ::csv::String& Name() const;
+ const ::csv::String& Value() const;
+
+ private:
+ virtual const ::csv::String &
+ inq_Name() const = 0;
+ virtual const ::csv::String &
+ inq_Value() const = 0;
+};
+
+typedef csv::SweList_dyn< Attribute > AttrList;
+
+
+class Element : public Item
+{
+ public:
+ Element & operator<<( /// For multiple content items.
+ DYN Item * let_dpItem );
+ Element & operator<<( /// For multiple content items.
+ const ::csv::String& let_drText );
+ Element & operator<<( /// For multiple content items.
+ const char * let_dpText );
+ Element & operator<<(
+ DYN Attribute * let_dpAttr );
+
+ Element & operator>>( /// For multiple content items. @return the child Element.
+ DYN Element & let_drElement );
+
+
+ Item * SetContent( /// For only one content item.
+ DYN Item * let_dpItem ); /// Replaces previous content. May be 0, then all content is deleted.
+ private:
+ // Interface Item:
+ virtual void do_WriteOut(
+ csv::bostream & io_aFile ) const;
+ // Local
+ virtual void op_streamout(
+ DYN Item * let_dpItem ) = 0;
+ virtual void op_streamout(
+ DYN Attribute * let_dpAttr ) = 0;
+
+ virtual void do_SetContent(
+ DYN Item * let_dpItem ) = 0;
+ // Helpers
+ virtual const ::csv::String &
+ inq_TagName() const = 0;
+ virtual const Item *
+ inq_Content() const = 0;
+ virtual const AttrList *
+ inq_Attrs() const = 0;
+
+ virtual bool FinishEmptyTag_XmlStyle() const; /// Defaulted to: true
+
+ virtual bool LineBreakAfterBeginTag() const; /// Defaulted to: false
+ virtual bool LineBreakAfterEndTag() const; /// Defaulted to: true, if LineBreakAfterBeginTag()
+};
+
+class TextContent : public Item
+{
+};
+
+
+/* Implementation simplifiers:
+ EmptyElement, PureElement, SglTag
+*/
+
+class EmptyElement : public Element
+{
+ private:
+ // Interface Element:
+ virtual void op_streamout( /// does nothing
+ DYN Item * let_dpItem );
+ virtual void op_streamout(
+ DYN Attribute * let_dpAttr );
+ virtual void do_SetContent( /// does nothing
+ DYN Item * let_dpItem );
+ virtual const Item *
+ inq_Content() const; /// @return 0
+ virtual const AttrList *
+ inq_Attrs() const;
+
+ // Local
+ virtual AttrList & inq_RefAttrs() = 0;
+};
+
+class PureElement : public Element
+{
+ private:
+ // Interface Element:
+ virtual void op_streamout(
+ DYN Item * let_dpItem );
+ virtual void op_streamout( /// does nothing
+ DYN Attribute * let_dpAttr );
+ virtual void do_SetContent(
+ DYN Item * let_dpItem );
+ virtual const Item *
+ inq_Content() const;
+ virtual const AttrList *
+ inq_Attrs() const; /// @return 0
+ // Local
+ virtual Dyn< Item > &
+ inq_RefContent() = 0;
+};
+
+class SglTag : public Element
+{
+ private:
+ // Interface Element:
+ virtual void op_streamout( /// does nothing
+ DYN Item * let_dpItem );
+ virtual void op_streamout( /// does nothing
+ DYN Attribute * let_dpAttr );
+ virtual void do_SetContent( /// does nothing
+ DYN Item * let_dpItem );
+ virtual const Item *
+ inq_Content() const; /// @return 0
+ virtual const AttrList *
+ inq_Attrs() const; /// @return 0
+};
+
+
+
+/* Standard Element implementations, if there are not any
+ specialized ones.
+*/
+
+class AnElement : public Element
+{
+ public:
+ AnElement(
+ const char * i_sTagName );
+ ~AnElement();
+ private:
+ // Interface Element
+ virtual void op_streamout(
+ DYN Item * let_dpItem );
+ virtual void op_streamout(
+ DYN Attribute * let_dpAttr );
+ virtual void do_SetContent(
+ DYN Item * let_dpItem );
+ virtual const ::csv::String &
+ inq_TagName() const;
+ virtual const Item *
+ inq_Content() const;
+ virtual const AttrList *
+ inq_Attrs() const;
+ // DATA
+ ::csv::String sTagName;
+ Dyn< Item > pContent;
+ AttrList aAttrs;
+};
+
+class APureElement : public PureElement
+{
+ public:
+ APureElement(
+ const char * i_sTagName );
+ ~APureElement();
+ private:
+ // Interface Element:
+ virtual const ::csv::String &
+ inq_TagName() const;
+ // Interface PureElement:
+ virtual Dyn< Item > &
+ inq_RefContent();
+ // DATA
+ ::csv::String sTagName;
+ Dyn< Item > pContent;
+};
+
+/* Standard Attribute implementation
+*/
+class AnAttribute : public Attribute
+{
+ public:
+ AnAttribute(
+ const ::csv::String & i_sName,
+ const ::csv::String & i_sValue );
+ AnAttribute(
+ const char * i_sName,
+ const char * i_sValue );
+ ~AnAttribute();
+ private:
+ // Interface Attribute:
+ virtual const ::csv::String &
+ inq_Name() const;
+ virtual const ::csv::String &
+ inq_Value() const;
+ // DATA
+ ::csv::String sName;
+ ::csv::String sValue;
+};
+
+
+
+/* Implementations of TextContent:
+
+ Text ( reserved characters will be replaced and appear unchanged )
+ XmlCode ( reserved characters stay and are interpreted
+ by the XML-viewer )
+*/
+class Text : public TextContent
+{
+ public:
+ Text(
+ const ::csv::String & i_sText );
+ Text(
+ const char * i_sText );
+ ~Text();
+ private:
+ virtual void do_WriteOut(
+ csv::bostream & io_aFile ) const;
+ // DATA
+ ::csv::String sText;
+};
+
+
+class XmlCode : public TextContent
+{
+ public:
+ XmlCode(
+ const ::csv::String & i_sText );
+ XmlCode(
+ const char * i_sText );
+ ~XmlCode();
+ private:
+ virtual void do_WriteOut(
+ csv::bostream & io_aFile ) const;
+ // DATA
+ ::csv::String sText;
+};
+
+
+
+// IMPLEMENTATION
+
+inline void
+Item::WriteOut( csv::bostream & io_aFile ) const
+ { do_WriteOut(io_aFile); }
+
+inline const ::csv::String &
+Attribute::Name() const
+ { return inq_Name(); }
+inline const ::csv::String &
+Attribute::Value() const
+ { return inq_Value(); }
+
+inline Element &
+Element::operator<<( DYN Item * let_dpItem )
+ { op_streamout(let_dpItem); return *this; }
+inline Element &
+Element::operator<<( const ::csv::String & let_drText )
+ { op_streamout( new Text(let_drText) ); return *this; }
+inline Element &
+Element::operator<<( const char * let_drText )
+ { op_streamout( new Text(let_drText) ); return *this; }
+inline Element &
+Element::operator<<( DYN Attribute * let_dpAttr )
+ { op_streamout(let_dpAttr); return *this; }
+inline Element &
+Element::operator>>( DYN Element & let_drElement )
+ { op_streamout(&let_drElement); return let_drElement; }
+inline Item *
+Element::SetContent( DYN Item * let_dpItem )
+ { do_SetContent(let_dpItem); return let_dpItem; }
+
+
+} // namespace xml
+} // namespace csi
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unoidl/detail/dllapi.hxx b/include/unoidl/detail/dllapi.hxx
new file mode 100644
index 000000000000..ad011ad4eb77
--- /dev/null
+++ b/include/unoidl/detail/dllapi.hxx
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_UNOIDL_DETAIL_DLLAPI_HXX
+#define INCLUDED_UNOIDL_DETAIL_DLLAPI_HXX
+
+#include "sal/config.h"
+
+#include "sal/types.h"
+
+#if defined LO_DLLIMPLEMENTATION_UNOIDL
+#define LO_DLLPUBLIC_UNOIDL SAL_DLLPUBLIC_EXPORT
+#else
+#define LO_DLLPUBLIC_UNOIDL SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unoidl/detail/unoidldllapi.hxx b/include/unoidl/detail/unoidldllapi.hxx
new file mode 100644
index 000000000000..cfb1e90fd488
--- /dev/null
+++ b/include/unoidl/detail/unoidldllapi.hxx
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_UNOIDL_DETAIL_UNOIDLDLLAPI_HXX
+#define INCLUDED_UNOIDL_DETAIL_UNOIDLDLLAPI_HXX
+
+#include "sal/config.h"
+
+#include "sal/types.h"
+
+#if defined LO_DLLIMPLEMENTATION_UNOIDL
+#define LO_DLLPUBLIC_UNOIDL SAL_DLLPUBLIC_EXPORT
+#else
+#define LO_DLLPUBLIC_UNOIDL SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unoidl/legacyprovider.hxx b/include/unoidl/legacyprovider.hxx
new file mode 100644
index 000000000000..cebdc1f764ea
--- /dev/null
+++ b/include/unoidl/legacyprovider.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/.
+ */
+
+#ifndef INCLUDED_UNOIDL_LEGACYPROVIDER_HXX
+#define INCLUDED_UNOIDL_LEGACYPROVIDER_HXX
+
+#include "sal/config.h"
+
+#include "registry/registry.hxx"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+#include "unoidl/detail/dllapi.hxx"
+#include "unoidl/unoidl.hxx"
+
+
+namespace unoidl {
+
+class LO_DLLPUBLIC_UNOIDL LegacyProvider: public Provider {
+public:
+ // throws FileFormatException, NoSuchFileException:
+ LegacyProvider(
+ rtl::Reference< Manager > const & manager, OUString const & uri);
+
+ // throws FileFormatException:
+ virtual rtl::Reference< MapCursor > createRootCursor() const;
+
+ // throws FileFormatException:
+ virtual rtl::Reference< Entity > findEntity(OUString const & name)
+ const;
+
+private:
+ virtual SAL_DLLPRIVATE ~LegacyProvider() throw ();
+
+ rtl::Reference< Manager > manager_;
+ mutable RegistryKey ucr_;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unoidl/unoidl.hxx b/include/unoidl/unoidl.hxx
new file mode 100644
index 000000000000..9d774473c7ee
--- /dev/null
+++ b/include/unoidl/unoidl.hxx
@@ -0,0 +1,642 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_UNOIDL_UNOIDL_HXX
+#define INCLUDED_UNOIDL_UNOIDL_HXX
+
+#include "sal/config.h"
+
+#include <cassert>
+#include <vector>
+
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "salhelper/simplereferenceobject.hxx"
+#include "unoidl/detail/dllapi.hxx"
+
+namespace unoidl {
+
+class LO_DLLPUBLIC_UNOIDL NoSuchFileException {
+public:
+ SAL_DLLPRIVATE NoSuchFileException(rtl::OUString const & uri): uri_(uri) {}
+
+ SAL_DLLPRIVATE NoSuchFileException(NoSuchFileException const & other):
+ uri_(other.uri_) {}
+
+ virtual SAL_DLLPRIVATE ~NoSuchFileException() throw ();
+
+ rtl::OUString getUri() const { return uri_; }
+
+private:
+ void operator =(NoSuchFileException) SAL_DELETED_FUNCTION;
+
+ rtl::OUString uri_;
+};
+
+class LO_DLLPUBLIC_UNOIDL FileFormatException {
+public:
+ SAL_DLLPRIVATE FileFormatException(
+ rtl::OUString const & uri, rtl::OUString const & detail):
+ uri_(uri), detail_(detail)
+ {}
+
+ SAL_DLLPRIVATE FileFormatException(FileFormatException const & other):
+ uri_(other.uri_), detail_(other.detail_)
+ {}
+
+ virtual SAL_DLLPRIVATE ~FileFormatException() throw ();
+
+ rtl::OUString getUri() const { return uri_; }
+
+ rtl::OUString getDetail() const { return detail_; }
+
+private:
+ void operator =(FileFormatException) SAL_DELETED_FUNCTION;
+
+ rtl::OUString uri_;
+ rtl::OUString detail_;
+};
+
+class LO_DLLPUBLIC_UNOIDL Entity: public salhelper::SimpleReferenceObject {
+public:
+ enum Sort {
+ SORT_MODULE, SORT_ENUM_TYPE, SORT_PLAIN_STRUCT_TYPE,
+ SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE, SORT_EXCEPTION_TYPE,
+ SORT_INTERFACE_TYPE, SORT_TYPEDEF, SORT_CONSTANT_GROUP,
+ SORT_SINGLE_INTERFACE_BASED_SERVICE, SORT_ACCUMULATION_BASED_SERVICE,
+ SORT_INTERFACE_BASED_SINGLETON, SORT_SERVICE_BASED_SINGLETON
+ };
+
+ Sort getSort() const { return sort_; }
+
+protected:
+ explicit SAL_DLLPRIVATE Entity(Sort sort): sort_(sort) {}
+
+ virtual SAL_DLLPRIVATE ~Entity() throw ();
+
+private:
+ Sort sort_;
+};
+
+class LO_DLLPUBLIC_UNOIDL MapCursor: public salhelper::SimpleReferenceObject {
+public:
+ // throws FileFormatException:
+ virtual rtl::Reference< Entity > getNext(rtl::OUString * name) = 0;
+
+protected:
+ SAL_DLLPRIVATE MapCursor() {}
+
+ virtual SAL_DLLPRIVATE ~MapCursor() throw();
+};
+
+class LO_DLLPUBLIC_UNOIDL ModuleEntity: public Entity {
+public:
+ // throws FileFormatException:
+ virtual std::vector< rtl::OUString > getMemberNames() const = 0;
+
+ // throws FileFormatException:
+ virtual rtl::Reference< MapCursor > createCursor() const = 0;
+
+protected:
+ SAL_DLLPRIVATE ModuleEntity(): Entity(SORT_MODULE) {}
+
+ virtual SAL_DLLPRIVATE ~ModuleEntity() throw ();
+};
+
+class LO_DLLPUBLIC_UNOIDL PublishableEntity: public Entity {
+public:
+ bool isPublished() const { return published_; }
+
+protected:
+ SAL_DLLPRIVATE PublishableEntity(Sort sort, bool published):
+ Entity(sort), published_(published)
+ {}
+
+ virtual SAL_DLLPRIVATE ~PublishableEntity() throw ();
+
+private:
+ bool published_;
+};
+
+class LO_DLLPUBLIC_UNOIDL EnumTypeEntity: public PublishableEntity {
+public:
+ struct Member {
+ Member(rtl::OUString const & theName, sal_Int32 theValue):
+ name(theName), value(theValue)
+ {}
+
+ rtl::OUString name;
+
+ sal_Int32 value;
+ };
+
+ SAL_DLLPRIVATE EnumTypeEntity(
+ bool published, std::vector< Member > const & members):
+ PublishableEntity(SORT_ENUM_TYPE, published), members_(members)
+ { assert(!members.empty()); }
+
+ std::vector< Member > const & getMembers() const { return members_; }
+
+private:
+ virtual SAL_DLLPRIVATE ~EnumTypeEntity() throw ();
+
+ std::vector< Member > members_;
+};
+
+class LO_DLLPUBLIC_UNOIDL PlainStructTypeEntity: public PublishableEntity {
+public:
+ struct Member {
+ Member(rtl::OUString const & theName, rtl::OUString const & theType):
+ name(theName), type(theType)
+ {}
+
+ rtl::OUString name;
+
+ rtl::OUString type;
+ };
+
+ SAL_DLLPRIVATE PlainStructTypeEntity(
+ bool published, rtl::OUString const & directBase,
+ std::vector< Member > const & directMembers):
+ PublishableEntity(SORT_PLAIN_STRUCT_TYPE, published),
+ directBase_(directBase), directMembers_(directMembers)
+ {}
+
+ rtl::OUString getDirectBase() const { return directBase_; }
+
+ std::vector< Member > const & getDirectMembers() const
+ { return directMembers_; }
+
+private:
+ virtual SAL_DLLPRIVATE ~PlainStructTypeEntity() throw ();
+
+ rtl::OUString directBase_;
+ std::vector< Member > directMembers_;
+};
+
+class LO_DLLPUBLIC_UNOIDL PolymorphicStructTypeTemplateEntity:
+ public PublishableEntity
+{
+public:
+ struct Member {
+ Member(
+ rtl::OUString const & theName, rtl::OUString const & theType,
+ bool theParameterized):
+ name(theName), type(theType), parameterized(theParameterized)
+ {}
+
+ rtl::OUString name;
+
+ rtl::OUString type;
+
+ bool parameterized;
+ };
+
+ SAL_DLLPRIVATE PolymorphicStructTypeTemplateEntity(
+ bool published, std::vector< rtl::OUString > const & typeParameters,
+ std::vector< Member > const & members):
+ PublishableEntity(SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE, published),
+ typeParameters_(typeParameters), members_(members)
+ {}
+
+ std::vector< rtl::OUString > const & getTypeParameters() const
+ { return typeParameters_; }
+
+ std::vector< Member > const & getMembers() const { return members_; }
+
+private:
+ virtual SAL_DLLPRIVATE ~PolymorphicStructTypeTemplateEntity() throw ();
+
+ std::vector< rtl::OUString > typeParameters_;
+ std::vector< Member > members_;
+};
+
+class LO_DLLPUBLIC_UNOIDL ExceptionTypeEntity: public PublishableEntity {
+public:
+ struct Member {
+ Member(rtl::OUString const & theName, rtl::OUString const & theType):
+ name(theName), type(theType)
+ {}
+
+ rtl::OUString name;
+
+ rtl::OUString type;
+ };
+
+ SAL_DLLPRIVATE ExceptionTypeEntity(
+ bool published, rtl::OUString const & directBase,
+ std::vector< Member > const & directMembers):
+ PublishableEntity(SORT_EXCEPTION_TYPE, published),
+ directBase_(directBase), directMembers_(directMembers)
+ {}
+
+ rtl::OUString getDirectBase() const { return directBase_; }
+
+ std::vector< Member > const & getDirectMembers() const
+ { return directMembers_; }
+
+private:
+ virtual SAL_DLLPRIVATE ~ExceptionTypeEntity() throw ();
+
+ rtl::OUString directBase_;
+ std::vector< Member > directMembers_;
+};
+
+class LO_DLLPUBLIC_UNOIDL InterfaceTypeEntity: public PublishableEntity {
+public:
+ struct Attribute {
+ Attribute(
+ rtl::OUString const & theName, rtl::OUString const & theType,
+ bool theBound, bool theReadOnly,
+ std::vector< rtl::OUString > const & theGetExceptions,
+ std::vector< rtl::OUString > const & theSetExceptions):
+ name(theName), type(theType), bound(theBound),
+ readOnly(theReadOnly), getExceptions(theGetExceptions),
+ setExceptions(theSetExceptions)
+ { assert(!theReadOnly || theSetExceptions.empty()); }
+
+ rtl::OUString name;
+
+ rtl::OUString type;
+
+ bool bound;
+
+ bool readOnly;
+
+ std::vector< rtl::OUString > getExceptions;
+
+ std::vector< rtl::OUString > setExceptions;
+ };
+
+ struct Method {
+ struct Parameter {
+ enum Direction { DIRECTION_IN, DIRECTION_OUT, DIRECTION_IN_OUT };
+
+ Parameter(
+ rtl::OUString const & theName, rtl::OUString const & theType,
+ Direction theDirection):
+ name(theName), type(theType), direction(theDirection)
+ {}
+
+ rtl::OUString name;
+
+ rtl::OUString type;
+
+ Direction direction;
+ };
+
+ Method(
+ rtl::OUString const & theName, rtl::OUString const & theReturnType,
+ std::vector< Parameter > const & theParameters,
+ std::vector< rtl::OUString > const & theExceptions):
+ name(theName), returnType(theReturnType), parameters(theParameters),
+ exceptions(theExceptions)
+ {}
+
+ rtl::OUString name;
+
+ rtl::OUString returnType;
+
+ std::vector< Parameter > parameters;
+
+ std::vector< rtl::OUString > exceptions;
+ };
+
+ SAL_DLLPRIVATE InterfaceTypeEntity(
+ bool published,
+ std::vector< rtl::OUString > const & directMandatoryBases,
+ std::vector< rtl::OUString > const & directOptionalBases,
+ std::vector< Attribute > const & directAttributes,
+ std::vector< Method > const & directMethods):
+ PublishableEntity(SORT_INTERFACE_TYPE, published),
+ directMandatoryBases_(directMandatoryBases),
+ directOptionalBases_(directOptionalBases),
+ directAttributes_(directAttributes), directMethods_(directMethods)
+ {}
+
+ std::vector< rtl::OUString > const & getDirectMandatoryBases() const
+ { return directMandatoryBases_; }
+
+ std::vector< rtl::OUString > const & getDirectOptionalBases() const
+ { return directOptionalBases_; }
+
+ std::vector< Attribute > const & getDirectAttributes() const
+ { return directAttributes_; }
+
+ std::vector< Method > const & getDirectMethods() const
+ { return directMethods_; }
+
+private:
+ virtual SAL_DLLPRIVATE ~InterfaceTypeEntity() throw ();
+
+ std::vector< rtl::OUString > directMandatoryBases_;
+ std::vector< rtl::OUString > directOptionalBases_;
+ std::vector< Attribute > directAttributes_;
+ std::vector< Method > directMethods_;
+};
+
+class LO_DLLPUBLIC_UNOIDL TypedefEntity: public PublishableEntity {
+public:
+ SAL_DLLPRIVATE TypedefEntity(bool published, rtl::OUString const & type):
+ PublishableEntity(SORT_TYPEDEF, published), type_(type)
+ {}
+
+ rtl::OUString getType() const { return type_; }
+
+private:
+ virtual SAL_DLLPRIVATE ~TypedefEntity() throw ();
+
+ rtl::OUString type_;
+};
+
+struct LO_DLLPUBLIC_UNOIDL ConstantValue {
+ enum Type {
+ TYPE_BOOLEAN, TYPE_BYTE, TYPE_SHORT, TYPE_UNSIGNED_SHORT, TYPE_LONG,
+ TYPE_UNSIGNED_LONG, TYPE_HYPER, TYPE_UNSIGNED_HYPER, TYPE_FLOAT,
+ TYPE_DOUBLE };
+
+ explicit ConstantValue(bool value): type(TYPE_BOOLEAN), booleanValue(value)
+ {}
+
+ explicit ConstantValue(sal_Int8 value): type(TYPE_BYTE), byteValue(value) {}
+
+ explicit ConstantValue(sal_Int16 value): type(TYPE_SHORT), shortValue(value)
+ {}
+
+ explicit ConstantValue(sal_uInt16 value):
+ type(TYPE_UNSIGNED_SHORT), unsignedShortValue(value)
+ {}
+
+ explicit ConstantValue(sal_Int32 value): type(TYPE_LONG), longValue(value)
+ {}
+
+ explicit ConstantValue(sal_uInt32 value):
+ type(TYPE_UNSIGNED_LONG), unsignedLongValue(value)
+ {}
+
+ explicit ConstantValue(sal_Int64 value): type(TYPE_HYPER), hyperValue(value)
+ {}
+
+ explicit ConstantValue(sal_uInt64 value):
+ type(TYPE_UNSIGNED_HYPER), unsignedHyperValue(value)
+ {}
+
+ explicit ConstantValue(float value): type(TYPE_FLOAT), floatValue(value) {}
+
+ explicit ConstantValue(double value): type(TYPE_DOUBLE), doubleValue(value)
+ {}
+
+ Type type;
+
+ union {
+ bool booleanValue;
+ sal_Int8 byteValue;
+ sal_Int16 shortValue;
+ sal_uInt16 unsignedShortValue;
+ sal_Int32 longValue;
+ sal_uInt32 unsignedLongValue;
+ sal_Int64 hyperValue;
+ sal_uInt64 unsignedHyperValue;
+ float floatValue;
+ double doubleValue;
+ };
+};
+
+class LO_DLLPUBLIC_UNOIDL ConstantGroupEntity: public PublishableEntity {
+public:
+ struct Member {
+ Member(rtl::OUString const & theName, ConstantValue const & theValue):
+ name(theName), value(theValue)
+ {}
+
+ rtl::OUString name;
+
+ ConstantValue value;
+ };
+
+ SAL_DLLPRIVATE ConstantGroupEntity(
+ bool published, std::vector< Member > const & members):
+ PublishableEntity(SORT_CONSTANT_GROUP, published), members_(members)
+ {}
+
+ std::vector< Member > const & getMembers() const { return members_; }
+
+private:
+ virtual SAL_DLLPRIVATE ~ConstantGroupEntity() throw ();
+
+ std::vector< Member > members_;
+};
+
+class LO_DLLPUBLIC_UNOIDL SingleInterfaceBasedServiceEntity:
+ public PublishableEntity
+{
+public:
+ struct Constructor {
+ struct Parameter {
+ Parameter(
+ rtl::OUString const & theName, rtl::OUString const & theType,
+ bool theRest):
+ name(theName), type(theType), rest(theRest)
+ {}
+
+ rtl::OUString name;
+
+ rtl::OUString type;
+
+ bool rest;
+ };
+
+ Constructor(): defaultConstructor(true) {}
+
+ Constructor(
+ rtl::OUString const & theName,
+ std::vector< Parameter > const & theParameters,
+ std::vector< rtl::OUString > const & theExceptions):
+ name(theName), parameters(theParameters), exceptions(theExceptions),
+ defaultConstructor(false)
+ {}
+
+ rtl::OUString name;
+
+ std::vector< Parameter > parameters;
+
+ std::vector< rtl::OUString > exceptions;
+
+ bool defaultConstructor;
+ };
+
+ SAL_DLLPRIVATE SingleInterfaceBasedServiceEntity(
+ bool published, rtl::OUString const & base,
+ std::vector< Constructor > const & constructors):
+ PublishableEntity(SORT_SINGLE_INTERFACE_BASED_SERVICE, published),
+ base_(base), constructors_(constructors)
+ {}
+
+ rtl::OUString getBase() const { return base_; }
+
+ std::vector< Constructor > const & getConstructors() const
+ { return constructors_; }
+
+private:
+ virtual SAL_DLLPRIVATE ~SingleInterfaceBasedServiceEntity() throw ();
+
+ rtl::OUString base_;
+ std::vector< Constructor > constructors_;
+};
+
+class LO_DLLPUBLIC_UNOIDL AccumulationBasedServiceEntity:
+ public PublishableEntity
+{
+public:
+ struct Property {
+ enum Attributes {
+ ATTRIBUTE_MAYBE_VOID = 0x001,
+ ATTRIBUTE_BOUND = 0x002,
+ ATTRIBUTE_CONSTRAINED = 0x004,
+ ATTRIBUTE_TRANSIENT = 0x008,
+ ATTRIBUTE_READ_ONLY = 0x010,
+ ATTRIBUTE_MAYBE_AMBIGUOUS = 0x020,
+ ATTRIBUTE_MAYBE_DEFAULT = 0x040,
+ ATTRIBUTE_REMOVABLE = 0x080,
+ ATTRIBUTE_OPTIONAL = 0x100
+ };
+
+ Property(
+ rtl::OUString const & theName, rtl::OUString const & theType,
+ Attributes theAttributes):
+ name(theName), type(theType), attributes(theAttributes)
+ {}
+
+ rtl::OUString name;
+
+ rtl::OUString type;
+
+ Attributes attributes;
+ };
+
+ SAL_DLLPRIVATE AccumulationBasedServiceEntity(
+ bool published,
+ std::vector< rtl::OUString > const & directMandatoryBaseServices,
+ std::vector< rtl::OUString > const & directOptionalBaseServices,
+ std::vector< rtl::OUString > const & directMandatoryBaseInterfaces,
+ std::vector< rtl::OUString > const & directOptionalBaseInterfaces,
+ std::vector< Property > const & directProperties):
+ PublishableEntity(SORT_ACCUMULATION_BASED_SERVICE, published),
+ directMandatoryBaseServices_(directMandatoryBaseServices),
+ directOptionalBaseServices_(directOptionalBaseServices),
+ directMandatoryBaseInterfaces_(directMandatoryBaseInterfaces),
+ directOptionalBaseInterfaces_(directOptionalBaseInterfaces),
+ directProperties_(directProperties)
+ {}
+
+ std::vector< rtl::OUString > const & getDirectMandatoryBaseServices() const
+ { return directMandatoryBaseServices_; }
+
+ std::vector< rtl::OUString > const & getDirectOptionalBaseServices() const
+ { return directOptionalBaseServices_; }
+
+ std::vector< rtl::OUString > const & getDirectMandatoryBaseInterfaces()
+ const
+ { return directMandatoryBaseInterfaces_; }
+
+ std::vector< rtl::OUString > const & getDirectOptionalBaseInterfaces() const
+ { return directOptionalBaseInterfaces_; }
+
+ std::vector< Property > const & getDirectProperties() const
+ { return directProperties_; }
+
+private:
+ virtual SAL_DLLPRIVATE ~AccumulationBasedServiceEntity() throw ();
+
+ std::vector< rtl::OUString > directMandatoryBaseServices_;
+ std::vector< rtl::OUString > directOptionalBaseServices_;
+ std::vector< rtl::OUString > directMandatoryBaseInterfaces_;
+ std::vector< rtl::OUString > directOptionalBaseInterfaces_;
+ std::vector< Property > directProperties_;
+};
+
+class LO_DLLPUBLIC_UNOIDL InterfaceBasedSingletonEntity:
+ public PublishableEntity
+{
+public:
+ SAL_DLLPRIVATE InterfaceBasedSingletonEntity(
+ bool published, rtl::OUString const & base):
+ PublishableEntity(SORT_INTERFACE_BASED_SINGLETON, published),
+ base_(base)
+ {}
+
+ rtl::OUString getBase() const { return base_; }
+
+private:
+ virtual SAL_DLLPRIVATE ~InterfaceBasedSingletonEntity() throw ();
+
+ rtl::OUString base_;
+};
+
+class LO_DLLPUBLIC_UNOIDL ServiceBasedSingletonEntity: public PublishableEntity
+{
+public:
+ SAL_DLLPRIVATE ServiceBasedSingletonEntity(
+ bool published, rtl::OUString const & base):
+ PublishableEntity(SORT_SERVICE_BASED_SINGLETON, published), base_(base)
+ {}
+
+ rtl::OUString getBase() const { return base_; }
+
+private:
+ virtual SAL_DLLPRIVATE ~ServiceBasedSingletonEntity() throw ();
+
+ rtl::OUString base_;
+};
+
+class LO_DLLPUBLIC_UNOIDL Provider: public salhelper::SimpleReferenceObject {
+public:
+ // throws FileFormatException:
+ virtual rtl::Reference< MapCursor > createRootCursor() const = 0;
+
+ // throws FileFormatException:
+ virtual rtl::Reference< Entity > findEntity(rtl::OUString const & name)
+ const = 0;
+
+protected:
+ SAL_DLLPRIVATE Provider() {}
+
+ virtual SAL_DLLPRIVATE ~Provider() throw ();
+};
+
+class LO_DLLPUBLIC_UNOIDL Manager: public salhelper::SimpleReferenceObject {
+public:
+ Manager() {}
+
+ void addProvider(rtl::Reference< Provider > const & provider);
+
+ // throws FileFormatException:
+ rtl::Reference< Entity > findEntity(rtl::OUString const & name) const;
+
+ // throws FileFormatException:
+ rtl::Reference< MapCursor > createCursor(rtl::OUString const & name) const;
+
+private:
+ virtual SAL_DLLPRIVATE ~Manager() throw ();
+
+ mutable osl::Mutex mutex_;
+ std::vector< rtl::Reference< Provider > > providers_;
+};
+
+// throws FileFormatException, NoSuchFileException:
+LO_DLLPUBLIC_UNOIDL rtl::Reference< Provider > loadProvider(
+ rtl::Reference< Manager > const & manager, rtl::OUString const & uri);
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unoidl/unoidlprovider.hxx b/include/unoidl/unoidlprovider.hxx
new file mode 100644
index 000000000000..d7d4fbb97f8c
--- /dev/null
+++ b/include/unoidl/unoidlprovider.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/.
+ */
+
+#ifndef INCLUDED_UNOIDL_UNOIDLPROVIDER_HXX
+#define INCLUDED_UNOIDL_UNOIDLPROVIDER_HXX
+
+#include "sal/config.h"
+
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+#include "unoidl/detail/dllapi.hxx"
+#include "unoidl/unoidl.hxx"
+
+namespace unoidl { namespace detail {
+ class MappedFile;
+ struct MapEntry;
+} }
+
+namespace unoidl {
+
+class LO_DLLPUBLIC_UNOIDL UnoidlProvider: public Provider {
+public:
+ // throws FileFormatException, NoSuchFileException:
+ explicit UnoidlProvider(OUString const & uri);
+
+ // throws FileFormatException:
+ virtual rtl::Reference< MapCursor > createRootCursor() const;
+
+ // throws FileFormatException:
+ virtual rtl::Reference< Entity > findEntity(OUString const & name)
+ const;
+
+ // throws FileFormatException:
+ sal_uInt32 find(OUString const & name, bool * constant = 0) const;
+
+ // throws FileFormatException:
+ rtl::Reference< Entity > getEntity(sal_uInt32 offset) const;
+
+ // throws FileFormatException:
+ ConstantValue getConstant(sal_uInt32 offset) const;
+
+private:
+ virtual SAL_DLLPRIVATE ~UnoidlProvider() throw ();
+
+ rtl::Reference< detail::MappedFile > file_;
+ detail::MapEntry const * mapBegin_;
+ sal_uInt32 mapSize_;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotest/bootstrapfixturebase.hxx b/include/unotest/bootstrapfixturebase.hxx
new file mode 100644
index 000000000000..3753350f7e21
--- /dev/null
+++ b/include/unotest/bootstrapfixturebase.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_UNOUNOTEST_BOOTSTRAPFIXTUREBASE_HXX
+#define INCLUDED_UNOUNOTEST_BOOTSTRAPFIXTUREBASE_HXX
+
+#include <sal/config.h>
+
+#include <rtl/string.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+
+#include "cppunit/TestAssert.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/extensions/HelperMacros.h"
+#include "cppunit/plugin/TestPlugIn.h"
+#include "unotest/detail/unotestdllapi.hxx"
+
+namespace test {
+
+// Class to do lots of heavy-lifting UNO & environment
+// bootstrapping for unit tests, such that we can use
+// almost an entire LibreOffice during compile - so
+// that we can get pieces of code alone to beat them up.
+
+// NB. this class is instantiated multiple times during a
+// run of unit tests ...
+class OOO_DLLPUBLIC_UNOTEST BootstrapFixtureBase : public CppUnit::TestFixture
+{
+protected:
+ OUString m_aSrcRootURL;
+ OUString m_aSrcRootPath;
+ OUString m_aSolverRootURL;
+ OUString m_aSolverRootPath;
+ OUString m_aWorkdirRootURL;
+ OUString m_aWorkdirRootPath;
+
+ com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> m_xContext;
+ com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> m_xSFactory;
+ com::sun::star::uno::Reference<com::sun::star::lang::XMultiComponentFactory> m_xFactory;
+
+public:
+ BootstrapFixtureBase();
+ virtual ~BootstrapFixtureBase();
+
+ com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
+ getComponentContext() { return m_xContext; }
+ com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>
+ getMultiServiceFactory() { return m_xSFactory; }
+
+ OUString getSrcRootURL() { return m_aSrcRootURL; }
+ OUString getSrcRootPath() { return m_aSrcRootPath; }
+
+ // return a URL to a given c-str path from the source directory
+ OUString getURLFromSrc( const char *pPath );
+
+ // return a Path to a given c-str path from the source directory
+ OUString getPathFromSrc( const char *pPath );
+
+
+ // return a URL to a given c-str path from the workdir directory
+ OUString getURLFromWorkdir( const char *pPath );
+
+ // return a Path to a given c-str path from the workdir directory
+ OUString getPathFromWorkdir( const char *pPath );
+ virtual void setUp();
+ virtual void tearDown();
+
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotest/detail/unotestdllapi.hxx b/include/unotest/detail/unotestdllapi.hxx
new file mode 100644
index 000000000000..fb850650713f
--- /dev/null
+++ b/include/unotest/detail/unotestdllapi.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_UNOTEST_DETAIL_UNOTESTDLLAPI_HXX
+#define INCLUDED_UNOTEST_DETAIL_UNOTESTDLLAPI_HXX
+
+#include "sal/config.h"
+#include "sal/types.h"
+
+#if defined OOO_DLLIMPLEMENTATION_UNOTEST
+#define OOO_DLLPUBLIC_UNOTEST SAL_DLLPUBLIC_EXPORT
+#else
+#define OOO_DLLPUBLIC_UNOTEST SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotest/filters-test.hxx b/include/unotest/filters-test.hxx
new file mode 100644
index 000000000000..7b080c223a11
--- /dev/null
+++ b/include/unotest/filters-test.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:
+ *
+ */
+
+#include <comphelper/documentconstants.hxx>
+#include <rtl/ustring.hxx>
+#include "unotest/detail/unotestdllapi.hxx"
+
+namespace test {
+
+enum filterStatus
+{
+ fail = 0,
+ pass = 1,
+ indeterminate = 2
+};
+
+/*
+ * NOTE, any files beginning with CVE-, BID- or EDB- will be assumed to be
+ * encrypted using arcfour with key 0x435645, this is to silence panicky
+ * virus/malware-checkers
+ *
+ * e.g. m[de]crypt --bare -a arcfour -o hex -k 435645 -s 3
+ */
+/* Implementation of Filters test */
+class OOO_DLLPUBLIC_UNOTEST FiltersTest
+{
+public:
+ void testDir(
+ //filter name
+ const OUString &rFilter,
+ //root dir of test files, must contain pass, fail, indeterminate
+ const OUString &rURL,
+ //additional filter data for SfxFilter
+ const OUString &rUserData = OUString(),
+ //SfxFilterFlags for SfxFilter
+ unsigned int nFilterFlags = SFX_FILTER_IMPORT,
+ //Clipboard id for SfxFilter
+ unsigned int nClipboardID = 0,
+ //additional filter version for SfxFilter
+ unsigned int nFilterVersion = 0);
+
+ virtual bool load(
+ const OUString &rFilter,
+ const OUString &rURL,
+ const OUString &rUserData,
+ unsigned int nFilterFlags,
+ unsigned int nClipboardID,
+ unsigned int nFilterVersion) = 0;
+
+protected:
+ ~FiltersTest() {}
+
+ void recursiveScan(
+ filterStatus nExpected,
+ const OUString &rFilter,
+ const OUString &rURL,
+ const OUString &rUserData,
+ unsigned int nFilterFlags,
+ unsigned int nClipboardID,
+ unsigned int nFilterVersion);
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotest/gettestargument.hxx b/include/unotest/gettestargument.hxx
new file mode 100644
index 000000000000..3364c5666600
--- /dev/null
+++ b/include/unotest/gettestargument.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_TEST_GETTESTARGUMENT_HXX
+#define INCLUDED_TEST_GETTESTARGUMENT_HXX
+
+#include "sal/config.h"
+
+#include "unotest/detail/unotestdllapi.hxx"
+
+
+namespace test {
+
+// Obtain the value of a test argument (tunneled in via an "arg-testarg.<name>"
+// bootstrap variable):
+OOO_DLLPUBLIC_UNOTEST bool getTestArgument(
+ OUString const & name, OUString * value);
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotest/macros_test.hxx b/include/unotest/macros_test.hxx
new file mode 100644
index 000000000000..f771a6f33634
--- /dev/null
+++ b/include/unotest/macros_test.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/.
+ */
+
+#ifndef INCLUDED_UNOTEST_MACROS_TEST_HXX
+#define INCLUDED_UNOTEST_MACROS_TEST_HXX
+
+#include <rtl/ustring.hxx>
+#include "unotest/detail/unotestdllapi.hxx"
+
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/frame/XDesktop2.hpp>
+
+struct TestMacroInfo
+{
+ OUString sFileBaseName;
+ OUString sMacroUrl;
+};
+
+namespace unotest {
+
+class OOO_DLLPUBLIC_UNOTEST MacrosTest
+{
+public:
+ com::sun::star::uno::Reference< com::sun::star::lang::XComponent > loadFromDesktop(const OUString& rURL, const char* pDocService = NULL);
+
+protected:
+ com::sun::star::uno::Reference< com::sun::star::frame::XDesktop2> mxDesktop;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotest/officeconnection.hxx b/include/unotest/officeconnection.hxx
new file mode 100644
index 000000000000..edef6628ab3a
--- /dev/null
+++ b/include/unotest/officeconnection.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_TEST_OFFICECONNECTION_HXX
+#define INCLUDED_TEST_OFFICECONNECTION_HXX
+
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "osl/process.h"
+#include "unotest/detail/unotestdllapi.hxx"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class XComponentContext;
+} } } }
+
+namespace test {
+
+// Start up and shut down an OOo instance (details about the OOo instance are
+// tunneled in via "arg-..." bootstrap variables):
+class OOO_DLLPUBLIC_UNOTEST OfficeConnection: private boost::noncopyable {
+public:
+ OfficeConnection();
+
+ ~OfficeConnection();
+
+ void setUp();
+
+ void tearDown();
+
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ getComponentContext() const;
+
+ // Must not be called before setUp or after tearDown:
+ bool isStillAlive() const;
+
+private:
+ oslProcess process_;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ context_;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotest/toabsolutefileurl.hxx b/include/unotest/toabsolutefileurl.hxx
new file mode 100644
index 000000000000..1f68c665ed33
--- /dev/null
+++ b/include/unotest/toabsolutefileurl.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_TEST_TOABSOLUTEFILEURL_HXX
+#define INCLUDED_TEST_TOABSOLUTEFILEURL_HXX
+
+#include "sal/config.h"
+
+#include "unotest/detail/unotestdllapi.hxx"
+
+
+namespace test {
+
+// Convert a pathname in system notation, potentially relative to the process's
+// current working directory, to an absolute file URL:
+OOO_DLLPUBLIC_UNOTEST OUString toAbsoluteFileUrl(
+ OUString const & relativePathname);
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotest/uniquepipename.hxx b/include/unotest/uniquepipename.hxx
new file mode 100644
index 000000000000..732856228d6a
--- /dev/null
+++ b/include/unotest/uniquepipename.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_TEST_UNIQUEPIPENAME_HXX
+#define INCLUDED_TEST_UNIQUEPIPENAME_HXX
+
+#include "sal/config.h"
+
+#include "unotest/detail/unotestdllapi.hxx"
+
+
+namespace test {
+
+// Create a system-wide unique name (for use with osl::Pipe):
+OOO_DLLPUBLIC_UNOTEST OUString uniquePipeName(OUString const & name);
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/accessiblerelationsethelper.hxx b/include/unotools/accessiblerelationsethelper.hxx
new file mode 100644
index 000000000000..18e9a80a639a
--- /dev/null
+++ b/include/unotools/accessiblerelationsethelper.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 _UTL_ACCESSIBLERELATIONSETHELPER_HXX_
+#define _UTL_ACCESSIBLERELATIONSETHELPER_HXX_
+
+#include "unotools/unotoolsdllapi.h"
+
+#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <cppuhelper/weak.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XServiceName.hpp>
+#include <osl/mutex.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/servicehelper.hxx>
+
+class AccessibleRelationSetHelperImpl;
+
+//=========================================================================
+//= XAccessibleRelationSet helper classes
+//=========================================================================
+
+//... namespace utl .......................................................
+namespace utl
+{
+//.........................................................................
+
+/** @descr
+ This base class provides an implementation of the
+ <code>AccessibleRelationSet</code> service.
+*/
+class UNOTOOLS_DLLPUBLIC AccessibleRelationSetHelper
+ : public cppu::WeakImplHelper1<
+ ::com::sun::star::accessibility::XAccessibleRelationSet
+ >
+{
+public:
+ //===== internal ========================================================
+ AccessibleRelationSetHelper ();
+ AccessibleRelationSetHelper (const AccessibleRelationSetHelper& rHelper);
+protected:
+ virtual ~AccessibleRelationSetHelper (void);
+public:
+
+ //===== XAccessibleRelationSet ==========================================
+
+ /** Returns the number of relations in this relation set.
+
+ @return
+ Returns the number of relations or zero if there are none.
+ */
+ virtual sal_Int32 SAL_CALL getRelationCount( )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Returns the relation of this relation set that is specified by
+ the given index.
+
+ @param nIndex
+ This index specifies the relatio to return.
+
+ @return
+ For a valid index, i.e. inside the range 0 to the number of
+ relations minus one, the returned value is the requested
+ relation. If the index is invalid then the returned relation
+ has the type INVALID.
+
+ */
+ virtual ::com::sun::star::accessibility::AccessibleRelation SAL_CALL
+ getRelation( sal_Int32 nIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+
+ /** Tests whether the relation set contains a relation matching the
+ specified key.
+
+ @param aRelationType
+ The type of relation to look for in this set of relations. This
+ has to be one of the constants of
+ <type>AccessibleRelationType</type>.
+
+ @return
+ Returns <TRUE/> if there is a (at least one) relation of the
+ given type and <FALSE/> if there is no such relation in the set.
+ */
+ virtual sal_Bool SAL_CALL containsRelation( sal_Int16 aRelationType )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Retrieve and return the relation with the given relation type.
+
+ @param aRelationType
+ The type of the relation to return. This has to be one of the
+ constants of <type>AccessibleRelationType</type>.
+
+ @return
+ If a relation with the given type could be found than (a copy
+ of) this relation is returned. Otherwise a relation with the
+ type INVALID is returned.
+ */
+ virtual ::com::sun::star::accessibility::AccessibleRelation SAL_CALL
+ getRelationByType( sal_Int16 aRelationType )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ void AddRelation(
+ const ::com::sun::star::accessibility::AccessibleRelation& rRelation)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== XTypeProvider ===================================================
+
+ /** Returns a sequence of all supported interfaces.
+ */
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL
+ getTypes (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Returns a implementation id.
+ */
+ virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
+ getImplementationId (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ /// Mutex guarding this object.
+ ::osl::Mutex maMutex;
+
+private:
+ /// The implementation of this helper interface.
+ AccessibleRelationSetHelperImpl* mpHelperImpl;
+};
+
+//.........................................................................
+}
+//... namespace utl .......................................................
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/accessiblestatesethelper.hxx b/include/unotools/accessiblestatesethelper.hxx
new file mode 100644
index 000000000000..7652a03cc47c
--- /dev/null
+++ b/include/unotools/accessiblestatesethelper.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 _UTL_ACCESSIBLESTATESETHELPER_HXX_
+#define _UTL_ACCESSIBLESTATESETHELPER_HXX_
+
+#include "unotools/unotoolsdllapi.h"
+
+#include <com/sun/star/accessibility/XAccessibleStateSet.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <cppuhelper/weak.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XServiceName.hpp>
+#include <osl/mutex.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/servicehelper.hxx>
+
+class AccessibleStateSetHelperImpl;
+
+//=========================================================================
+//= XAccessibleStateSet helper classes
+//=========================================================================
+
+//... namespace utl .......................................................
+namespace utl
+{
+//.........................................................................
+
+/** @descr
+ This base class provides an implementation of the
+ <code>AccessibleStateSet</code> service.
+*/
+class UNOTOOLS_DLLPUBLIC AccessibleStateSetHelper
+ : public cppu::WeakImplHelper1<
+ ::com::sun::star::accessibility::XAccessibleStateSet
+ >
+{
+public:
+ //===== internal ========================================================
+
+ AccessibleStateSetHelper ();
+ /** constructs an object with some states initially set
+
+ <p>This ctor is compatible with
+ <method scope="comphelper">OAccessibleImplementationAccess::implGetForeignControlledStates</method></p>
+
+ @param _nInitialStates
+ is a bit mask. Every bit 2^n means that the state number n (as got from the
+ AccessibleStateType constants) should be set initially.
+ */
+ AccessibleStateSetHelper ( const sal_Int64 _nInitialStates );
+
+ AccessibleStateSetHelper ( const AccessibleStateSetHelper& rHelper );
+protected:
+ virtual ~AccessibleStateSetHelper (void);
+public:
+
+ //===== XAccessibleStateSet ==============================================
+
+ /** Checks whether the current state set is empty.
+
+ @return
+ Returns <TRUE/> if there is no state in this state set and
+ <FALSE/> if there is at least one state set in it.
+ */
+ virtual sal_Bool SAL_CALL isEmpty ()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Checks if the given state is a member of the state set of this
+ object.
+
+ @param aState
+ The state for which to check membership. This has to be one of
+ the constants of <type>AccessibleStateType</type>.
+
+ @return
+ Returns <TRUE/> if the given state is a member of this object's
+ state set and <FALSE/> otherwise.
+ */
+ virtual sal_Bool SAL_CALL contains (sal_Int16 aState)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Checks if all of the given states are in this object's state
+ set.
+
+ @param aStateSet
+ This sequence of states is interpreted as set and every of its
+ members, duplicates are ignored, is checked for membership in
+ this object's state set. Each state has to be one of the
+ constants of <type>AccessibleStateType</type>.
+
+ @return
+ Returns <TRUE/> if all states of the given state set are members
+ of this object's state set. <FALSE/> is returned if at least
+ one of the states in the given state is not a member of this
+ object's state set.
+ */
+ virtual sal_Bool SAL_CALL containsAll (
+ const ::com::sun::star::uno::Sequence<sal_Int16>& rStateSet)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Returns a sequence of all states.
+ */
+ virtual com::sun::star::uno::Sequence<sal_Int16> SAL_CALL getStates()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Adds a state to the set.
+ */
+ void AddState(sal_Int16 aState)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Removes a state from the set if the set contains the state, otherwise nothing is done.
+ */
+ void RemoveState(sal_Int16 aState)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== XTypeProvider ===================================================
+
+ /** Returns a sequence of all supported interfaces.
+ */
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL
+ getTypes (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Returns a implementation id.
+ */
+ virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
+ getImplementationId (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ /// Mutex guarding this object.
+ ::osl::Mutex maMutex;
+
+private:
+ /// The implementation of this helper interface.
+ AccessibleStateSetHelperImpl* mpHelperImpl;
+};
+
+//.........................................................................
+}
+//... namespace utl .......................................................
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/atom.hxx b/include/unotools/atom.hxx
new file mode 100644
index 000000000000..5b8f193d604f
--- /dev/null
+++ b/include/unotools/atom.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 _UTL_ATOM_HXX_
+#define _UTL_ATOM_HXX_
+
+#include "unotools/unotoolsdllapi.h"
+#include <rtl/ustring.hxx>
+#include <osl/mutex.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+#include <boost/unordered_map.hpp>
+#include <list>
+#include <com/sun/star/util/XAtomServer.hpp>
+
+#define INVALID_ATOM 0
+
+namespace utl {
+
+ struct AtomDescription
+ {
+ int atom;
+ OUString description;
+ };
+
+ class AtomProvider
+ {
+ int m_nAtoms;
+ ::boost::unordered_map< int, OUString, ::boost::hash< int > > m_aStringMap;
+ ::boost::unordered_map< OUString, int, OUStringHash > m_aAtomMap;
+ public:
+ AtomProvider();
+ ~AtomProvider();
+
+ int getAtom( const OUString&, sal_Bool bCreate = sal_False );
+ const OUString& getString( int ) const;
+ };
+
+
+ class UNOTOOLS_DLLPUBLIC MultiAtomProvider
+ {
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > > m_aAtomLists;
+ public:
+ MultiAtomProvider();
+ ~MultiAtomProvider();
+
+ int getAtom( int atomClass, const OUString& rString, sal_Bool bCreate = sal_False );
+
+ const OUString& getString( int atomClass, int atom ) const;
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/bootstrap.hxx b/include/unotools/bootstrap.hxx
new file mode 100644
index 000000000000..530fa3173b73
--- /dev/null
+++ b/include/unotools/bootstrap.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 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UTL_BOOTSTRAP_HXX
+#define _UTL_BOOTSTRAP_HXX
+
+#include <rtl/ustring.hxx>
+
+namespace utl
+{
+//-----------------------------------------------------------------------------
+ /** provides configuration information needed for application startup.
+ <p>This class handles the startup information for the office application.
+ It encapsulates knowledge of how to retriev such information and how
+ to diagnose failures to retriev required data.
+ </p>
+ */
+ class UNOTOOLS_DLLPUBLIC Bootstrap
+ {
+ // the static interface
+ public: // some common information items
+
+ /// retrieve the product key; defaults to executable name (without extension)
+ static OUString getProductKey();
+
+ /// retrieve the product key; uses the given default, if not found
+ static OUString getProductKey(OUString const& _sDefault);
+
+ /// retrieve the BUILDID information item; uses the given default, if not found
+ static OUString getBuildIdData(OUString const& _sDefault);
+
+ /// retrieve the BuildVersion information item; uses the given default, if not found
+ static OUString getBuildVersion(OUString const& _sDefault);
+
+ /// reload cached data
+ static void reloadData();
+
+ public: // retrieve path information about the installatíon location
+ enum PathStatus
+ {
+ PATH_EXISTS, // Success: Found a path to an existing file or directory
+ PATH_VALID, // Found a valid path, but the file or directory does not exist
+ DATA_INVALID, // Retrieved a string for this path, that is not a valid file url or system path
+ DATA_MISSING, // Could not retrieve any data for this path
+ DATA_UNKNOWN // No attempt to retrieve data for this path was made
+ };
+
+ /// get a file URL to the common base installation [${insturl}]
+ static PathStatus locateBaseInstallation(OUString& _rURL);
+
+ /// get a file URL to the user installation [${userurl}]
+ static PathStatus locateUserInstallation(OUString& _rURL);
+
+ /// get a file URL to the user data directory [default is ${userurl}/user]
+ static PathStatus locateUserData(OUString& _rURL);
+
+ // the next two items are mainly supported for diagnostic purposes. both items may be unused
+ /// get a file URL to the bootstrap INI file used [e.g. ${insturl}/program/bootraprc]
+ static PathStatus locateBootstrapFile(OUString& _rURL);
+ /// get a file URL to the version locator INI file used [e.g. ${SYSUSERCONFIG}/sversion.ini]
+ static PathStatus locateVersionFile(OUString& _rURL);
+
+ public: // evaluate the validity of the installation
+ /// high-level status of bootstrap success
+ enum Status
+ {
+ DATA_OK, /// user-dir and share-dir do exist, product key found or can be defaulted to exe-name
+ MISSING_USER_INSTALL, /// ${userurl} does not exist; or version-file cannot be found or is invalid
+ INVALID_USER_INSTALL, /// can locate ${userurl}, but user-dir is missing
+ INVALID_BASE_INSTALL /// other failure: e.g. cannot locate share-dir; bootstraprc missing or invalid; no product key
+ };
+
+ /// error code for detailed diagnostics of bootstrap failures
+ enum FailureCode
+ {
+ NO_FAILURE, /// bootstrap was successful
+ MISSING_INSTALL_DIRECTORY, /// the shared installation directory could not be located
+ MISSING_BOOTSTRAP_FILE, /// the bootstrap INI file could not be found or read
+ MISSING_BOOTSTRAP_FILE_ENTRY, /// the bootstrap INI is missing a required entry
+ INVALID_BOOTSTRAP_FILE_ENTRY, /// the bootstrap INI contains invalid data
+ MISSING_VERSION_FILE, /// the version locator INI file could not be found or read
+ MISSING_VERSION_FILE_ENTRY, /// the version locator INI has no entry for this version
+ INVALID_VERSION_FILE_ENTRY, /// the version locator INI entry is not a valid directory URL
+ MISSING_USER_DIRECTORY, /// the user installation directory does not exist
+ INVALID_BOOTSTRAP_DATA /// some bootstrap data was invalid in unexpected ways
+ };
+
+ /** Evaluates the status of the installation and returns a diagnostic
+ message and error code corresponding to this status
+ */
+ static Status checkBootstrapStatus(OUString& _rDiagnosticMessage, FailureCode& _rErrCode);
+
+ public:
+ // singleton impl-class
+ class Impl;
+ static const Impl& data(); // the data related to the bootstrap.ini file
+ };
+//-----------------------------------------------------------------------------
+} // namespace utl
+
+#endif // _UTL_BOOTSTRAP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/calendarwrapper.hxx b/include/unotools/calendarwrapper.hxx
new file mode 100644
index 000000000000..d7e66dea0f33
--- /dev/null
+++ b/include/unotools/calendarwrapper.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 _UNOTOOLS_CALENDARWRAPPER_HXX
+#define _UNOTOOLS_CALENDARWRAPPER_HXX
+
+#include <tools/datetime.hxx>
+#include <tools/string.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/i18n/Calendar2.hpp>
+#include <com/sun/star/lang/Locale.hpp>
+#include "unotools/unotoolsdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+}}}
+
+namespace com { namespace sun { namespace star {
+ namespace i18n {
+ class XCalendar3;
+ }
+}}}
+
+
+class UNOTOOLS_DLLPUBLIC CalendarWrapper
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCalendar3 > xC;
+
+ DateTime aEpochStart; // 1Jan1970
+
+public:
+ CalendarWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext
+ );
+ ~CalendarWrapper();
+
+
+ // wrapper implementations of XCalendar
+
+ void loadDefaultCalendar( const ::com::sun::star::lang::Locale& rLocale );
+ void loadCalendar( const OUString& rUniqueID, const ::com::sun::star::lang::Locale& rLocale );
+ ::com::sun::star::uno::Sequence< OUString > getAllCalendars( const ::com::sun::star::lang::Locale& rLocale ) const;
+ OUString getUniqueID() const;
+ /// set UTC date/time
+ void setDateTime( double nTimeInDays );
+ /// get UTC date/time
+ double getDateTime() const;
+ /// convenience method to set local date/time
+ void setLocalDateTime( double nTimeInDays );
+ /// convenience method to get local date/time
+ double getLocalDateTime() const;
+
+
+ // wrapper implementations of XCalendar
+
+ void setValue( sal_Int16 nFieldIndex, sal_Int16 nValue );
+ sal_Bool isValid() const;
+ sal_Int16 getValue( sal_Int16 nFieldIndex ) const;
+ void addValue( sal_Int16 nFieldIndex, sal_Int32 nAmount );
+ sal_Int16 getFirstDayOfWeek() const;
+ sal_Int16 getNumberOfMonthsInYear() const;
+ sal_Int16 getNumberOfDaysInWeek() const;
+ String getDisplayName( sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType ) const;
+
+ /** Convenience method to get timezone offset in milliseconds, taking both
+ fields ZONE_OFFSET and ZONE_OFFSET_SECOND_MILLIS into account. */
+ sal_Int32 getZoneOffsetInMillis() const;
+ /** Convenience method to get DST offset in milliseconds, taking both
+ fields DST_OFFSET and DST_OFFSET_SECOND_MILLIS into account. */
+ sal_Int32 getDSTOffsetInMillis() const;
+
+
+ // wrapper implementations of XExtendedCalendar
+
+ String getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode ) const;
+
+
+ // wrapper implementations of XCalendar3
+
+ ::com::sun::star::i18n::Calendar2 getLoadedCalendar() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > getDays() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > getMonths() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > getGenitiveMonths() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > getPartitiveMonths() const;
+
+
+ // convenience methods
+
+ /// get epoch start (should be 01Jan1970)
+ inline const DateTime& getEpochStart() const
+ { return aEpochStart; }
+
+ /// set a local (!) Gregorian DateTime
+ inline void setGregorianDateTime( const DateTime& rDateTime )
+ { setLocalDateTime( rDateTime - aEpochStart ); }
+
+ /// get the DateTime as a local (!) Gregorian DateTime
+ inline DateTime getGregorianDateTime() const
+ { return aEpochStart + getLocalDateTime(); }
+
+private:
+
+ /** get timezone or DST offset in milliseconds, fields are
+ CalendarFieldIndex ZONE_OFFSET and ZONE_OFFSET_SECOND_MILLIS
+ respectively DST_OFFSET and DST_OFFSET_SECOND_MILLIS.
+ */
+ sal_Int32 getCombinedOffsetInMillis( sal_Int16 nParentFieldIndex, sal_Int16 nChildFieldIndex ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/caserotate.hxx b/include/unotools/caserotate.hxx
new file mode 100644
index 000000000000..d62878db2592
--- /dev/null
+++ b/include/unotools/caserotate.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ */
+#ifndef INCLUDED_UNOTOOLS_CASEROTATE_HXX
+#define INCLUDED_UNOTOOLS_CASEROTATE_HXX
+
+#include <sal/config.h>
+
+#include "unotools/unotoolsdllapi.h"
+
+//TODO Use XCharacterClassification::getStringType to determine the current
+//(possibly mixed) case type and rotate to the next one
+
+class UNOTOOLS_DLLPUBLIC RotateTransliteration
+{
+private:
+ int nF3ShiftCounter;
+public:
+ RotateTransliteration() : nF3ShiftCounter(0)
+ {
+ }
+ sal_uInt32 getNextMode();
+};
+
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx
new file mode 100644
index 000000000000..6ea11f62063d
--- /dev/null
+++ b/include/unotools/charclass.hxx
@@ -0,0 +1,225 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UNOTOOLS_CHARCLASS_HXX
+#define _UNOTOOLS_CHARCLASS_HXX
+
+#include <ctype.h> // isdigit(), isalpha()
+#include <boost/noncopyable.hpp>
+#include <i18nlangtag/languagetag.hxx>
+#include <tools/string.hxx>
+#include <tools/solar.h>
+#include <com/sun/star/i18n/KCharacterType.hpp>
+#include <com/sun/star/i18n/KParseTokens.hpp>
+#include <com/sun/star/i18n/KParseType.hpp>
+#include <com/sun/star/i18n/ParseResult.hpp>
+#include <com/sun/star/i18n/XCharacterClassification.hpp>
+#include <osl/mutex.hxx>
+
+class String;
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+}}}
+
+const sal_Int32 nCharClassAlphaType =
+ ::com::sun::star::i18n::KCharacterType::UPPER |
+ ::com::sun::star::i18n::KCharacterType::LOWER |
+ ::com::sun::star::i18n::KCharacterType::TITLE_CASE;
+
+const sal_Int32 nCharClassAlphaTypeMask =
+ nCharClassAlphaType |
+ ::com::sun::star::i18n::KCharacterType::PRINTABLE |
+ ::com::sun::star::i18n::KCharacterType::BASE_FORM;
+
+const sal_Int32 nCharClassLetterType =
+ nCharClassAlphaType |
+ ::com::sun::star::i18n::KCharacterType::LETTER;
+
+const sal_Int32 nCharClassLetterTypeMask =
+ nCharClassAlphaTypeMask |
+ ::com::sun::star::i18n::KCharacterType::LETTER;
+
+const sal_Int32 nCharClassNumericType =
+ ::com::sun::star::i18n::KCharacterType::DIGIT;
+
+const sal_Int32 nCharClassNumericTypeMask =
+ nCharClassNumericType |
+ ::com::sun::star::i18n::KCharacterType::PRINTABLE |
+ ::com::sun::star::i18n::KCharacterType::BASE_FORM;
+
+
+class UNOTOOLS_DLLPUBLIC CharClass : private boost::noncopyable
+{
+ LanguageTag maLanguageTag;
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > xCC;
+ mutable ::osl::Mutex aMutex;
+
+public:
+ /// Preferred ctor with service manager specified
+ CharClass(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
+ const LanguageTag& rLanguageTag );
+
+ /// Depricated ctor, tries to get a process service manager or to load the
+ /// library directly.
+ CharClass( const LanguageTag& rLanguageTag );
+
+ ~CharClass();
+
+ /// set a new Locale
+ void setLanguageTag( const LanguageTag& rLanguageTag );
+
+ /// get current Locale
+ const LanguageTag& getLanguageTag() const;
+
+
+ /// isdigit() on ascii values
+ static inline sal_Bool isAsciiDigit( sal_Unicode c )
+ {
+ return c < 128 ? sal_Bool(isdigit( (unsigned char) c ) != 0) : sal_False;
+ }
+
+ /// isalpha() on ascii values
+ static inline sal_Bool isAsciiAlpha( sal_Unicode c )
+ {
+ return c < 128 ? sal_Bool(isalpha( (unsigned char) c ) != 0) : sal_False;
+ }
+
+ /// isalnum() on ascii values
+ static inline sal_Bool isAsciiAlphaNumeric( sal_Unicode c )
+ {
+ return c < 128 ? sal_Bool(isalnum( (unsigned char) c ) != 0) : sal_False;
+ }
+
+ /// isdigit() on ascii values of entire string
+ static sal_Bool isAsciiNumeric( const String& rStr );
+
+ /// isalpha() on ascii values of entire string
+ static sal_Bool isAsciiAlpha( const String& rStr );
+
+ /// isalnum() on ascii values of entire string
+ static sal_Bool isAsciiAlphaNumeric( const String& rStr );
+
+ /// whether type is pure alpha or not, e.g. return of getStringType
+ static inline sal_Bool isAlphaType( sal_Int32 nType )
+ {
+ return ((nType & nCharClassAlphaType) != 0) &&
+ ((nType & ~(nCharClassAlphaTypeMask)) == 0);
+ }
+
+ /// whether type is pure numeric or not, e.g. return of getStringType
+ static inline sal_Bool isNumericType( sal_Int32 nType )
+ {
+ return ((nType & nCharClassNumericType) != 0) &&
+ ((nType & ~(nCharClassNumericTypeMask)) == 0);
+ }
+
+ /// whether type is pure alphanumeric or not, e.g. return of getStringType
+ static inline sal_Bool isAlphaNumericType( sal_Int32 nType )
+ {
+ return ((nType & (nCharClassAlphaType |
+ nCharClassNumericType)) != 0) &&
+ ((nType & ~(nCharClassAlphaTypeMask |
+ nCharClassNumericTypeMask)) == 0);
+ }
+
+ /// whether type is pure letter or not, e.g. return of getStringType
+ static inline sal_Bool isLetterType( sal_Int32 nType )
+ {
+ return ((nType & nCharClassLetterType) != 0) &&
+ ((nType & ~(nCharClassLetterTypeMask)) == 0);
+ }
+
+ /// whether type is pure letternumeric or not, e.g. return of getStringType
+ static inline sal_Bool isLetterNumericType( sal_Int32 nType )
+ {
+ return ((nType & (nCharClassLetterType |
+ nCharClassNumericType)) != 0) &&
+ ((nType & ~(nCharClassLetterTypeMask |
+ nCharClassNumericTypeMask)) == 0);
+ }
+
+
+ // Wrapper implementations of class CharacterClassification
+
+ OUString uppercase( const OUString& rStr, sal_Int32 nPos, sal_Int32 nCount ) const;
+ OUString lowercase( const OUString& rStr, sal_Int32 nPos, sal_Int32 nCount ) const;
+ OUString titlecase( const OUString& rStr, sal_Int32 nPos, sal_Int32 nCount ) const;
+
+ OUString uppercase( const OUString& _rStr ) const
+ {
+ return uppercase(_rStr, 0, _rStr.getLength());
+ }
+ OUString lowercase( const OUString& _rStr ) const
+ {
+ return lowercase(_rStr, 0, _rStr.getLength());
+ }
+ OUString titlecase( const OUString& _rStr ) const
+ {
+ return titlecase(_rStr, 0, _rStr.getLength());
+ }
+
+ sal_Int16 getType( const String& rStr, xub_StrLen nPos ) const;
+ sal_Int16 getCharacterDirection( const String& rStr, xub_StrLen nPos ) const;
+ sal_Int16 getScript( const String& rStr, xub_StrLen nPos ) const;
+ sal_Int32 getCharacterType( const String& rStr, xub_StrLen nPos ) const;
+ sal_Int32 getStringType( const String& rStr, xub_StrLen nPos, xub_StrLen nCount ) const;
+
+ ::com::sun::star::i18n::ParseResult parseAnyToken(
+ const String& rStr,
+ sal_Int32 nPos,
+ sal_Int32 nStartCharFlags,
+ const String& userDefinedCharactersStart,
+ sal_Int32 nContCharFlags,
+ const String& userDefinedCharactersCont ) const;
+
+ ::com::sun::star::i18n::ParseResult parsePredefinedToken(
+ sal_Int32 nTokenType,
+ const String& rStr,
+ sal_Int32 nPos,
+ sal_Int32 nStartCharFlags,
+ const String& userDefinedCharactersStart,
+ sal_Int32 nContCharFlags,
+ const String& userDefinedCharactersCont ) const;
+
+
+ // Functionality of class International methods
+
+ sal_Bool isAlpha( const String& rStr, xub_StrLen nPos ) const;
+ sal_Bool isLetter( const String& rStr, xub_StrLen nPos ) const;
+ sal_Bool isDigit( const String& rStr, xub_StrLen nPos ) const;
+ sal_Bool isAlphaNumeric( const String& rStr, xub_StrLen nPos ) const;
+ sal_Bool isLetterNumeric( const String& rStr, xub_StrLen nPos ) const;
+ sal_Bool isAlpha( const String& rStr ) const;
+ sal_Bool isLetter( const String& rStr ) const;
+ sal_Bool isNumeric( const String& rStr ) const;
+ sal_Bool isAlphaNumeric( const String& rStr ) const;
+ sal_Bool isLetterNumeric( const String& rStr ) const;
+
+private:
+
+ const ::com::sun::star::lang::Locale & getMyLocale() const;
+};
+
+#endif // _UNOTOOLS_CHARCLASS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/closeveto.hxx b/include/unotools/closeveto.hxx
new file mode 100644
index 000000000000..21d381c5094b
--- /dev/null
+++ b/include/unotools/closeveto.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 UNOTOOLS_CLOSEVETO_HXX
+#define UNOTOOLS_CLOSEVETO_HXX
+
+#include "unotools/unotoolsdllapi.h"
+
+#include <com/sun/star/uno/XInterface.hpp>
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace utl
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= CloseVeto
+ //==================================================================================================================
+ struct CloseVeto_Data;
+ /** will add a XCloseListener to a given component, and veto its closing as long as the <code>CloseVeto</code>
+ instance is alive.
+
+ If closing has been requested and vetoed while the <code>CloseVeto</code> instance is alive, and the ownership
+ went to the <code>CloseVeto</code> instance, then it will close the component in its dtor.
+ */
+ class UNOTOOLS_DLLPUBLIC CloseVeto
+ {
+ public:
+ CloseVeto( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_closeable );
+ ~CloseVeto();
+
+ private:
+ ::boost::scoped_ptr< CloseVeto_Data > m_pData;
+ };
+
+//......................................................................................................................
+} // namespace dbaui
+//......................................................................................................................
+
+#endif // UNOTOOLS_CLOSEVETO_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/cmdoptions.hxx b/include/unotools/cmdoptions.hxx
new file mode 100644
index 000000000000..173b7b585643
--- /dev/null
+++ b/include/unotools/cmdoptions.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_unotools_CMDOPTIONS_HXX
+#define INCLUDED_unotools_CMDOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+/*-************************************************************************************************************//**
+ @descr The method GetList() returns a list of property values.
+ Use follow defines to seperate values by names.
+*//*-*************************************************************************************************************/
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtCommandOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about dynamic menus
+ @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtCommandOptions : public utl::detail::Options
+{
+ friend class SvtCommandOptions_Impl;
+
+ public:
+
+ enum CmdOption
+ {
+ CMDOPTION_DISABLED,
+ CMDOPTION_NONE
+ };
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtCommandOptions();
+ virtual ~SvtCommandOptions();
+
+ /*-****************************************************************************************************//**
+ @short return complete specified list
+ @descr Call it to get all entries of an dynamic menu.
+ We return a list of all nodes with his names and properties.
+
+ @seealso -
+
+ @param "eOption" select the list to retrieve.
+ @return A list of command strings is returned.
+
+ @onerror We return an empty list.
+ *//*-*****************************************************************************************************/
+
+ sal_Bool HasEntries( CmdOption eOption ) const;
+
+ /*-****************************************************************************************************//**
+ @short Lookup if a command URL is inside a given list
+ @descr Lookup if a command URL is inside a given lst
+
+ @seealso -
+
+ @param "eOption" select right command list
+ @param "aCommandURL" a command URL that is used for the look up
+ @return "sal_True" if the command is inside the list otherwise "sal_False"
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ sal_Bool Lookup( CmdOption eOption, const OUString& aCommandURL ) const;
+
+ /*-****************************************************************************************************//**
+ @short register an office frame, which must update its dispatches if
+ the underlying configuration was changed.
+
+ @descr To avoid using of "dead" frame objects or implementing
+ deregistration mechanism too, we use weak references to
+ the given frames.
+
+ @param "xFrame" points to the frame, which wish to be
+ notified, if configuration was changed.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void EstablisFrameCallback(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtCommandOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtCmdOptions
+
+#endif // #ifndef INCLUDED_unotools_CMDOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/collatorwrapper.hxx b/include/unotools/collatorwrapper.hxx
new file mode 100644
index 000000000000..c73be3518569
--- /dev/null
+++ b/include/unotools/collatorwrapper.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 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UNOTOOLS_COLLATORWRAPPER_HXX
+#define _UNOTOOLS_COLLATORWRAPPER_HXX
+
+#include <com/sun/star/i18n/XCollator.hpp>
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class XComponentContext;
+}}}}
+
+class UNOTOOLS_DLLPUBLIC CollatorWrapper
+{
+ private:
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext
+ > mxServiceFactory;
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::i18n::XCollator
+ > mxInternationalCollator;
+
+ public:
+
+ CollatorWrapper (
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > &rxContext);
+
+ ~CollatorWrapper();
+
+ sal_Int32
+ compareString (
+ const OUString& s1, const OUString& s2) const;
+
+ ::com::sun::star::uno::Sequence< OUString >
+ listCollatorAlgorithms (
+ const ::com::sun::star::lang::Locale& rLocale) const;
+
+ sal_Int32
+ loadDefaultCollator (
+ const ::com::sun::star::lang::Locale& rLocale, sal_Int32 nOption);
+
+ sal_Int32
+ loadCollatorAlgorithm (
+ const OUString& rAlgorithm,
+ const ::com::sun::star::lang::Locale& rLocale, sal_Int32 nOption);
+
+ protected:
+
+ CollatorWrapper();
+};
+
+#endif /* _UNOTOOLS_COLLATORWRAPPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/compatibility.hxx b/include/unotools/compatibility.hxx
new file mode 100644
index 000000000000..16c73dbc3215
--- /dev/null
+++ b/include/unotools/compatibility.hxx
@@ -0,0 +1,240 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_unotools_COMPATIBILITY_HXX
+#define INCLUDED_unotools_COMPATIBILITY_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <unotools/options.hxx>
+
+//_________________________________________________________________________________________________________________
+// types, enums, ...
+//_________________________________________________________________________________________________________________
+
+enum CompatibilityOptions
+{
+ COPT_USE_PRINTERDEVICE = 0,
+ COPT_ADD_SPACING,
+ COPT_ADD_SPACING_AT_PAGES,
+ COPT_USE_OUR_TABSTOPS,
+ COPT_NO_EXTLEADING,
+ COPT_USE_LINESPACING,
+ COPT_ADD_TABLESPACING,
+ COPT_USE_OBJECTPOSITIONING,
+ COPT_USE_OUR_TEXTWRAPPING,
+ COPT_CONSIDER_WRAPPINGSTYLE,
+ COPT_EXPAND_WORDSPACE
+};
+
+/*-************************************************************************************************************//**
+ @descr The method GetList() returns a list of property values.
+ Use follow defines to seperate values by names.
+*//*-*************************************************************************************************************/
+#define COMPATIBILITY_PROPERTYNAME_NAME OUString( "Name" )
+#define COMPATIBILITY_PROPERTYNAME_MODULE OUString( "Module" )
+#define COMPATIBILITY_PROPERTYNAME_USEPRTMETRICS OUString( "UsePrinterMetrics" )
+#define COMPATIBILITY_PROPERTYNAME_ADDSPACING OUString( "AddSpacing" )
+#define COMPATIBILITY_PROPERTYNAME_ADDSPACINGATPAGES OUString( "AddSpacingAtPages" )
+#define COMPATIBILITY_PROPERTYNAME_USEOURTABSTOPS OUString( "UseOurTabStopFormat" )
+#define COMPATIBILITY_PROPERTYNAME_NOEXTLEADING OUString( "NoExternalLeading" )
+#define COMPATIBILITY_PROPERTYNAME_USELINESPACING OUString( "UseLineSpacing" )
+#define COMPATIBILITY_PROPERTYNAME_ADDTABLESPACING OUString( "AddTableSpacing" )
+#define COMPATIBILITY_PROPERTYNAME_USEOBJECTPOSITIONING OUString( "UseObjectPositioning" )
+#define COMPATIBILITY_PROPERTYNAME_USEOURTEXTWRAPPING OUString( "UseOurTextWrapping" )
+#define COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE OUString( "ConsiderWrappingStyle" )
+#define COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE OUString( "ExpandWordSpace" )
+
+#define COMPATIBILITY_DEFAULT_NAME OUString( "_default" )
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtCompatibilityOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about dynamic menus
+ @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtCompatibilityOptions();
+ virtual ~SvtCompatibilityOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short clear complete specified list
+ @descr Call this methods to clear the whole list.
+
+ @seealso -
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void Clear();
+
+ void SetDefault( OUString sName, bool bValue );
+
+ /*-****************************************************************************************************//**
+ @short return complete specified list
+ @descr Call it to get all entries of compatibility options.
+ We return a list of all nodes with its names and properties.
+
+ @seealso -
+
+ @param -
+ @return A list of compatibility options is returned.
+
+ @onerror We return an empty list.
+ *//*-*****************************************************************************************************/
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > GetList() const;
+
+ /*-****************************************************************************************************//**
+ @short append a new item
+ @descr
+
+ @seealso method Clear()
+
+ @param "sName" Name
+ @param "sModule" Module
+
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void AppendItem( const OUString& sName,
+ const OUString& sModule,
+ bool bUsePrtMetrics,
+ bool bAddSpacing,
+ bool bAddSpacingAtPages,
+ bool bUseOurTabStops,
+ bool bNoExtLeading,
+ bool bUseLineSpacing,
+ bool bAddTableSpacing,
+ bool bUseObjectPositioning,
+ bool bUseOurTextWrapping,
+ bool bConsiderWrappingStyle,
+ bool bExpandWordSpace );
+
+ bool IsUsePrtDevice() const;
+ bool IsAddSpacing() const;
+ bool IsAddSpacingAtPages() const;
+ bool IsUseOurTabStops() const;
+ bool IsNoExtLeading() const;
+ bool IsUseLineSpacing() const;
+ bool IsAddTableSpacing() const;
+ bool IsUseObjectPositioning() const;
+ bool IsUseOurTextWrapping() const;
+ bool IsConsiderWrappingStyle() const;
+ bool IsExpandWordSpace() const;
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtCompatibilityOptions_Impl* m_pDataContainer; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtCompatibilityOptions
+
+#endif // #ifndef INCLUDED_unotools_COMPATIBILITY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/componentresmodule.hxx b/include/unotools/componentresmodule.hxx
new file mode 100644
index 000000000000..0014794f3584
--- /dev/null
+++ b/include/unotools/componentresmodule.hxx
@@ -0,0 +1,180 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef UNOTOOLS_INC_UNOTOOLS_COMPONENTRESMODULE_HXX
+#define UNOTOOLS_INC_UNOTOOLS_COMPONENTRESMODULE_HXX
+
+#include <comphelper/componentmodule.hxx>
+#include <unotools/unotoolsdllapi.h>
+
+#include <tools/resid.hxx>
+
+#include <memory>
+
+class ResMgr;
+
+//........................................................................
+namespace utl
+{
+//........................................................................
+
+ class OComponentResModuleImpl;
+
+ //====================================================================
+ //= OComponentResourceModule
+ //====================================================================
+ /** extends the <type scope="comphelper">OModule</type> implementation with
+ simply resource access
+ */
+ class UNOTOOLS_DLLPUBLIC OComponentResourceModule : public ::comphelper::OModule
+ {
+ private:
+ typedef ::comphelper::OModule BaseClass;
+
+ private:
+ ::std::auto_ptr< OComponentResModuleImpl > m_pImpl;
+
+ public:
+ OComponentResourceModule( const OString& _rResFilePrefix );
+ ~OComponentResourceModule();
+
+ /// get the vcl res manager of the module
+ ResMgr* getResManager();
+
+ protected:
+ // OModule overridables
+ virtual void onFirstClient();
+ virtual void onLastClient();
+ };
+
+ //=========================================================================
+ //= ModuleRes
+ //=========================================================================
+ /** specialized ResId, using the resource manager provided by a given <type>OModule</type>
+ */
+ class UNOTOOLS_DLLPUBLIC ModuleRes : public ::ResId
+ {
+ public:
+ ModuleRes( sal_uInt16 _nId, OComponentResourceModule& _rModule ) : ResId( _nId, *_rModule.getResManager() ) { }
+ };
+
+ //====================================================================
+ //= defining a concrete module
+ //====================================================================
+#define DEFINE_MODULE( ModuleClass, ClientClass, ResClass ) \
+ /* -------------------------------------------------------------------- */ \
+ class ModuleClass : public ::utl::OComponentResourceModule \
+ { \
+ friend struct CreateModuleClass; \
+ typedef ::utl::OComponentResourceModule BaseClass; \
+ \
+ public: \
+ static ModuleClass& getInstance(); \
+ \
+ private: \
+ ModuleClass(); \
+ }; \
+ \
+ /* -------------------------------------------------------------------- */ \
+ class ClientClass : public ::comphelper::OModuleClient \
+ { \
+ private: \
+ typedef ::comphelper::OModuleClient BaseClass; \
+ \
+ public: \
+ ClientClass() : BaseClass( ModuleClass::getInstance() ) \
+ { \
+ } \
+ }; \
+ \
+ /* -------------------------------------------------------------------- */ \
+ class ResClass : public ::utl::ModuleRes \
+ { \
+ private: \
+ typedef ::utl::ModuleRes BaseClass; \
+ \
+ public: \
+ ResClass( sal_uInt16 _nId ) : BaseClass( _nId, ModuleClass::getInstance() ) \
+ { \
+ } \
+ }; \
+ \
+ /* -------------------------------------------------------------------- */ \
+ template < class TYPE > \
+ class OAutoRegistration : public ::comphelper::OAutoRegistration< TYPE > \
+ { \
+ private: \
+ typedef ::comphelper::OAutoRegistration< TYPE > BaseClass; \
+ \
+ public: \
+ OAutoRegistration() : BaseClass( ModuleClass::getInstance() ) \
+ { \
+ } \
+ }; \
+ \
+ /* -------------------------------------------------------------------- */ \
+ template < class TYPE > \
+ class OSingletonRegistration : public ::comphelper::OSingletonRegistration< TYPE > \
+ { \
+ private: \
+ typedef ::comphelper::OSingletonRegistration< TYPE > BaseClass; \
+ \
+ public: \
+ OSingletonRegistration() : BaseClass( ModuleClass::getInstance() ) \
+ { \
+ } \
+ };
+
+ //====================================================================
+ //= implementing a concrete module
+ //====================================================================
+#define IMPLEMENT_MODULE( ModuleClass, resprefix ) \
+ struct CreateModuleClass \
+ { \
+ ModuleClass* operator()() \
+ { \
+ static ModuleClass* pModule = new ModuleClass; \
+ return pModule; \
+ /* yes, in theory, this is a resource leak, since the ModuleClass \
+ will never be cleaned up. However, using a non-heap instance of ModuleClass \
+ would not work: It would be cleaned up when the module is unloaded. \
+ This might happen (and is likely to happen) *after* the tools-library \
+ has been unloaded. However, the module's dtor is where we would delete \
+ our resource manager (in case not all our clients de-registered) - which \
+ would call into the already-unloaded tools-library. */ \
+ } \
+ }; \
+ \
+ ModuleClass::ModuleClass() \
+ :BaseClass( OString( resprefix ) ) \
+ { \
+ } \
+ \
+ ModuleClass& ModuleClass::getInstance() \
+ { \
+ return *rtl_Instance< ModuleClass, CreateModuleClass, ::osl::MutexGuard, ::osl::GetGlobalMutex >:: \
+ create( CreateModuleClass(), ::osl::GetGlobalMutex() ); \
+ } \
+
+//........................................................................
+} // namespace utl
+//........................................................................
+
+#endif // UNOTOOLS_INC_UNOTOOLS_COMPONENTRESMODULE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/configitem.hxx b/include/unotools/configitem.hxx
new file mode 100644
index 000000000000..d9f7675a185e
--- /dev/null
+++ b/include/unotools/configitem.hxx
@@ -0,0 +1,195 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UTL_CONFIGITEM_HXX_
+#define _UTL_CONFIGITEM_HXX_
+
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/uno/Reference.h>
+#include "unotools/unotoolsdllapi.h"
+#include "unotools/options.hxx"
+
+//-----------------------------------------------------------------------------
+namespace com{ namespace sun{ namespace star{
+ namespace uno{
+ class Any;
+ }
+ namespace beans{
+ struct PropertyValue;
+ }
+ namespace container{
+ class XHierarchicalNameAccess;
+ }
+ namespace util{
+ class XChangesListener;
+ }
+}}}
+//-----------------------------------------------------------------------------
+namespace utl
+{
+#define CONFIG_MODE_IMMEDIATE_UPDATE 0x00
+#define CONFIG_MODE_DELAYED_UPDATE 0x01
+#define CONFIG_MODE_ALL_LOCALES 0x02
+#define CONFIG_MODE_RELEASE_TREE 0x04
+
+ enum ConfigNameFormat
+ {
+ CONFIG_NAME_PLAINTEXT_NAME, // unescaped local node name, for user display etc.
+ CONFIG_NAME_LOCAL_NAME, // local node name, for use in XNameAccess etc. ("Item", "Q & A")
+ CONFIG_NAME_LOCAL_PATH, // one-level relative path, for use when building paths etc. ("Item", "Typ['Q &amp; A']")
+ CONFIG_NAME_FULL_PATH, // full absolute path. ("/org.openoffice.Sample/Group/Item", "/org.openoffice.Sample/Set/Typ['Q &amp; A']")
+
+ CONFIG_NAME_DEFAULT = CONFIG_NAME_LOCAL_PATH // default format
+ };
+
+ class ConfigChangeListener_Impl;
+ class ConfigManager;
+ struct ConfigItem_Impl;
+
+ class UNOTOOLS_DLLPUBLIC ConfigItem : public ConfigurationBroadcaster
+ {
+ friend class ConfigChangeListener_Impl;
+ friend class ConfigManager;
+
+ const OUString sSubTree;
+ com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess>
+ m_xHierarchyAccess;
+ com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
+ xChangeLstnr;
+ ConfigItem_Impl* pImpl;
+
+ ConfigItem();//
+ void RemoveChangesListener();
+ void CallNotify(
+ const com::sun::star::uno::Sequence<OUString>& aPropertyNames);
+
+ //***********************************************************************************************************************
+ // In special mode ALL_LOCALES we must support reading/writing of localized cfg entries as Sequence< PropertyValue >.
+ // These methods are helper to convert given lists of names and Any-values.
+ // format: PropertyValue.Name = <locale as ISO string>
+ // PropertyValue.Value = <value; type depends from cfg entry!>
+ // e.g.
+ // LOCALIZED NODE
+ // "UIName"
+ // LOCALE VALUE
+ // "de" "Mein Name"
+ // "en-US" "my name"
+ void impl_packLocalizedProperties ( const com::sun::star::uno::Sequence< OUString >& lInNames ,
+ const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& lInValues ,
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any >& lOutValues );
+ void impl_unpackLocalizedProperties ( const com::sun::star::uno::Sequence< OUString >& lInNames ,
+ const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& lInValues ,
+ com::sun::star::uno::Sequence< OUString >& lOutNames ,
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any >& lOutValues );
+
+ com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess>
+ GetTree();
+
+ protected:
+ explicit ConfigItem(const OUString &rSubTree,
+ sal_Int16 nMode = CONFIG_MODE_DELAYED_UPDATE);
+
+ void SetModified (); // mark item as modified
+ void ClearModified(); // reset state after commit!
+
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any>
+ GetProperties(const com::sun::star::uno::Sequence< OUString >& rNames);
+
+ com::sun::star::uno::Sequence< sal_Bool >
+ GetReadOnlyStates(const com::sun::star::uno::Sequence< OUString >& rNames);
+
+ sal_Bool PutProperties(
+ const com::sun::star::uno::Sequence< OUString >& rNames,
+ const com::sun::star::uno::Sequence< com::sun::star::uno::Any>& rValues);
+
+ /** enables notifications about changes on selected sub nodes/values
+
+ Before calling this method a second time for a possibly changed node/value set,
+ you must disable the current notifications by calling DisableNotification.
+
+ @see Notify
+ @see DisableNotification
+ */
+ sal_Bool EnableNotification(const com::sun::star::uno::Sequence< OUString >& rNames,
+ sal_Bool bEnableInternalNotification = sal_False);
+ /** disables notifications about changes on sub nodes/values, which previosly had
+ been enabled with EnableNotification
+ @see Notify
+ @see EnableNotification
+ */
+ void DisableNotification();
+ sal_Bool IsInternalNotification()const {return IsInValueChange();}
+
+ //returns all members of a node in a specific format
+ com::sun::star::uno::Sequence< OUString >
+ GetNodeNames(const OUString& rNode);
+ //returns all members of a node in a specific format
+ com::sun::star::uno::Sequence< OUString >
+ GetNodeNames(const OUString& rNode, ConfigNameFormat eFormat);
+ // remove all members of a set
+ sal_Bool ClearNodeSet(const OUString& rNode);
+ // remove selected members of a set
+ sal_Bool ClearNodeElements(const OUString& rNode,
+ com::sun::star::uno::Sequence< OUString >& rElements);
+ // change or add members to a set
+ sal_Bool SetSetProperties(const OUString& rNode, com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > rValues);
+ // remove, change or add members of a set
+ sal_Bool ReplaceSetProperties(const OUString& rNode, com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > rValues);
+ // add a new node without setting any properties
+ sal_Bool AddNode(const OUString& rNode, const OUString& rNewNode);
+
+ /** get a name for a new element of a set node
+ @param _rSetNode
+ relative path to the set node
+ @param _rBaseName
+ <ul><li><b>in</b>: the base to use when calculating a new name</li>
+ <li><b>out</b>: an unused element name</li>
+ </ul>
+ @return <TRUE/> if a free name could be generated
+ */
+ sal_Bool getUniqueSetElementName( const OUString& _rSetNode, OUString& _rBaseName);
+
+ public:
+ virtual ~ConfigItem();
+
+ /** is called from the ConfigManager before application ends of from the
+ PropertyChangeListener if the sub tree broadcasts changes. */
+ virtual void Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames)=0;
+
+ const OUString& GetSubTreeName() const {return sSubTree;}
+
+ sal_Bool IsModified() const;
+
+ /** writes the changed values into the sub tree. Always called in the Dtor of the derived class. */
+ virtual void Commit()=0;
+
+ sal_Bool IsInValueChange() const;
+
+ sal_Int16 GetMode() const;
+
+ /** checks if the configuration manager used by this item is valid.
+ */
+ sal_Bool IsValidConfigMgr() const;
+ };
+}//namespace utl
+#endif //_UTL_CONFIGITEM_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/configmgr.hxx b/include/unotools/configmgr.hxx
new file mode 100644
index 000000000000..f5964a505cf4
--- /dev/null
+++ b/include/unotools/configmgr.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_UNOTOOLS_CONFIGMGR_HXX
+#define INCLUDED_UNOTOOLS_CONFIGMGR_HXX
+
+#include "sal/config.h"
+
+#include <list>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "sal/types.h"
+#include "unotools/unotoolsdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace container{ class XHierarchicalNameAccess; }
+} } }
+namespace utl { class ConfigItem; }
+
+namespace utl {
+
+class UNOTOOLS_DLLPUBLIC ConfigManager: private boost::noncopyable {
+public:
+ static OUString getAboutBoxProductVersion();
+
+ static OUString getAboutBoxProductVersionSuffix();
+
+ static OUString getDefaultCurrency();
+
+ static OUString getLocale();
+
+ static OUString getProductExtension();
+
+ static OUString getProductName();
+
+ static OUString getProductXmlFileFormat();
+
+ static OUString getProductXmlFileFormatVersion();
+
+ static OUString getProductVersion();
+
+ static OUString getVendor();
+
+ static OUString getWriterCompatibilityVersionOOo_1_1();
+
+ static void storeConfigItems();
+
+ SAL_DLLPRIVATE static ConfigManager & getConfigManager();
+
+ SAL_DLLPRIVATE static com::sun::star::uno::Reference<
+ com::sun::star::container::XHierarchicalNameAccess>
+ acquireTree(utl::ConfigItem & item);
+
+ SAL_DLLPRIVATE ConfigManager();
+
+ SAL_DLLPRIVATE ~ConfigManager();
+
+ SAL_DLLPRIVATE com::sun::star::uno::Reference<
+ com::sun::star::container::XHierarchicalNameAccess >
+ addConfigItem(utl::ConfigItem & item);
+
+ SAL_DLLPRIVATE void removeConfigItem(utl::ConfigItem & item);
+
+ SAL_DLLPRIVATE void registerConfigItem(utl::ConfigItem * item);
+
+private:
+ void doStoreConfigItems();
+
+ std::list< ConfigItem * > items_;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/confignode.hxx b/include/unotools/confignode.hxx
new file mode 100644
index 000000000000..4e663dd25bbb
--- /dev/null
+++ b/include/unotools/confignode.hxx
@@ -0,0 +1,325 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _UNOTOOLS_CONFIGNODE_HXX_
+#define _UNOTOOLS_CONFIGNODE_HXX_
+
+#include "unotools/unotoolsdllapi.h"
+#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/util/XChangesBatch.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <unotools/eventlisteneradapter.hxx>
+
+namespace comphelper
+{
+ class ComponentContext;
+}
+
+//........................................................................
+namespace utl
+{
+//........................................................................
+
+ //========================================================================
+ //= OConfigurationNode
+ //========================================================================
+ class OConfigurationTreeRoot;
+ /** a small wrapper around a configuration node.<p/>
+ Nodes in the terminology used herein are <em>inner</em> nodes of a configuration
+ tree, which means <em>no leafs</em>.
+ */
+ class UNOTOOLS_DLLPUBLIC OConfigurationNode : public ::utl::OEventListenerAdapter
+ {
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XHierarchicalNameAccess >
+ m_xHierarchyAccess; /// accessing children grandchildren (mandatory interface of our UNO object)
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
+ m_xDirectAccess; /// accessing children (mandatory interface of our UNO object)
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace >
+ m_xReplaceAccess; /// replacing child values
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ m_xContainerAccess; /// modifying set nodes (optional interface of our UNO object)
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ m_xDummy;
+ sal_Bool m_bEscapeNames; /// escape names before accessing children ?
+
+ OUString
+ m_sCompletePath;
+
+ OConfigurationNode insertNode(const OUString& _rName,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xNode) const throw();
+
+ protected:
+ /// constructs a node object with an interface representing a node
+ OConfigurationNode(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxNode
+ );
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >&
+ getUNONode() const { return m_xDirectAccess; }
+
+ public:
+ /// constructs an empty and invalid node object
+ OConfigurationNode() :m_bEscapeNames(sal_False) { }
+ /// copy ctor
+ OConfigurationNode(const OConfigurationNode& _rSource);
+
+ /// assigment
+ const OConfigurationNode& operator=(const OConfigurationNode& _rSource);
+
+ /// dtor
+ ~OConfigurationNode() {}
+
+ /// returns the local name of the node
+ OUString getLocalName() const;
+
+ /// returns the fully qualified path of the node
+ OUString getNodePath() const;
+
+ /** open a sub node
+ @param _rPath access path of the to-be-opened sub node. May be a hierarchical path.
+ */
+ OConfigurationNode openNode(const OUString& _rPath) const throw();
+
+ OConfigurationNode openNode( const sal_Char* _pAsciiPath ) const
+ {
+ return openNode( OUString::createFromAscii( _pAsciiPath ) );
+ }
+
+ /** create a new child node
+
+ If the object represents a set node, this method may be used to create a new child. For non-set-nodes, the
+ method will fail.<br/>
+ Unless the respective operations on the pure configuration API, the to-be-created node immediately
+ becomes a part of it's hierarchy, no explicit insertion is necessary.
+ @param _rName name for the new child. Must be level-1-depth.
+ */
+ OConfigurationNode createNode(const OUString& _rName) const throw();
+
+ OConfigurationNode createNode( const sal_Char* _pAsciiName ) const
+ {
+ return createNode( OUString::createFromAscii( _pAsciiName ) );
+ }
+
+ /** remove an existent child nod
+
+ If the object represents a set node, this method may be used to delete an existent child. For non-set-nodes,
+ the method will fail.
+ */
+ sal_Bool removeNode(const OUString& _rName) const throw();
+
+ sal_Bool removeNode( const sal_Char* _pAsciiName ) const
+ {
+ return removeNode( OUString::createFromAscii( _pAsciiName ) );
+ }
+
+ /** retrieves the content of a descendant
+
+ the returned value may contain anything from an interface (if <arg>_rPath</arg> refers to inner node of
+ the configuration tree) to any explicit value (e.g. string, integer) or even void.<br/>
+ Unfortunately, this implies that if a void value is returned, you won't have a clue if this means
+ "the path does not exist" (besides the assertion made :), or if the value is really void.
+ */
+ ::com::sun::star::uno::Any
+ getNodeValue(const OUString& _rPath) const throw();
+
+ ::com::sun::star::uno::Any
+ getNodeValue( const sal_Char* _pAsciiPath ) const
+ {
+ return getNodeValue( OUString::createFromAscii( _pAsciiPath ) );
+ }
+
+ /** write a node value<p/>
+ The value given is written into the node specified by the given relative path.<br/>
+ In opposite to <method>getNodeValue</method>, _rName must refer to a leaf in the configuration tree, not an inner
+ node.
+ @return sal_True if and only if the write was successful.
+ */
+ sal_Bool setNodeValue(const OUString& _rPath, const ::com::sun::star::uno::Any& _rValue) const throw();
+
+ sal_Bool setNodeValue( const sal_Char* _pAsciiPath, const ::com::sun::star::uno::Any& _rValue ) const
+ {
+ return setNodeValue( OUString::createFromAscii( _pAsciiPath ), _rValue );
+ }
+
+ /// return the names of the existing children
+ ::com::sun::star::uno::Sequence< OUString >
+ getNodeNames() const throw();
+
+ /** enables or disables name escaping when accessing direct children<p/>
+ Escaping is disabled by default, usually you enable it for set nodes (e.g. with calling setEscape(isSetNode)).
+ Once escaping is enabled, you should not access indirect children (e.g. openNode("child/grandchild"), 'cause
+ escaping for such names may not be supported by the underlying API objects.
+ @see getEscape
+ */
+ void setEscape(sal_Bool _bEnable = sal_True);
+ /** get the flag specifying the current escape behaviour
+ @see setEscape
+ */
+ sal_Bool getEscape() const { return m_bEscapeNames; }
+
+ /// invalidate the object
+ virtual void clear() throw();
+
+ // -----------------------
+ // meta information about the node
+
+ /// checks whether or not the object represents a set node.
+ sal_Bool isSetNode() const;
+
+ /// checks whether or not a direct child with a given name exists
+ sal_Bool hasByName(const OUString& _rName) const throw();
+ sal_Bool hasByName( const sal_Char* _pAsciiName ) const { return hasByName( OUString::createFromAscii( _pAsciiName ) ); }
+
+ /// checks whether or not a descendent (no matter if direct or indirect) with the given name exists
+ sal_Bool hasByHierarchicalName( const OUString& _rName ) const throw();
+ sal_Bool hasByHierarchicalName( const sal_Char* _pAsciiName ) const { return hasByHierarchicalName( OUString::createFromAscii( _pAsciiName ) ); }
+
+ /// check if the objects represents a valid configuration node
+ sal_Bool isValid() const { return m_xHierarchyAccess.is(); }
+
+ /// check whether the object is read-only of updatable
+ sal_Bool isReadonly() const { return !m_xReplaceAccess.is(); }
+
+ protected:
+ // OEventListenerAdapter
+ virtual void _disposing( const ::com::sun::star::lang::EventObject& _rSource );
+
+ protected:
+ enum NAMEORIGIN
+ {
+ NO_CONFIGURATION, /// the name came from a configuration node
+ NO_CALLER /// the name came from a client of this class
+ };
+ OUString normalizeName(const OUString& _rName, NAMEORIGIN _eOrigin) const;
+ };
+
+ //========================================================================
+ //= OConfigurationTreeRoot
+ //========================================================================
+ /** a specialized version of a OConfigurationNode, representing the root
+ of a configuration sub tree<p/>
+ Only this class is able to commit any changes made any any OConfigurationNode
+ objects.
+ */
+ class UNOTOOLS_DLLPUBLIC OConfigurationTreeRoot : public OConfigurationNode
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesBatch >
+ m_xCommitter;
+ protected:
+ /** ctor for a readonly node
+ */
+ OConfigurationTreeRoot(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxRootNode
+ );
+
+ public:
+ /// modes to use when creating a top-level node object
+ enum CREATION_MODE
+ {
+ /// open the node (i.e. sub tree) for read access only
+ CM_READONLY,
+ /// open the node (i.e. sub tree) for read and write access, fall back to read-only if write access is not possible
+ CM_UPDATABLE
+ };
+
+ public:
+ /** default ctor<p/>
+ The object constructed here is invalid (i.e. <method>isValid</method> will return sal_False).
+ */
+ OConfigurationTreeRoot() :OConfigurationNode() { }
+
+ /** creates a configuration tree for the given path in the given mode
+ */
+ OConfigurationTreeRoot(
+ const css::uno::Reference<css::uno::XComponentContext> & i_rContext,
+ const OUString& i_rNodePath,
+ const bool i_bUpdatable
+ );
+
+ /// copy ctor
+ OConfigurationTreeRoot(const OConfigurationTreeRoot& _rSource)
+ :OConfigurationNode(_rSource), m_xCommitter(_rSource.m_xCommitter) { }
+
+ /** open a new top-level configuration node
+
+ opens a new node which is the root if an own configuration sub tree. This is what "top level" means: The
+ node does not have a parent. It does not mean that the node represents a module tree (like org.openoffice.Office.Writer
+ or such).<br/>
+ In opposite to <method>createWithServiceFactory</method>, createWithProvider expects a configuration provider
+ to work with.
+
+ @param _rxConfProvider configuration provider to use when retrieving the node.
+ @param _rPath path to the node the object should represent
+ @param _nDepth depth for node retrieval
+ @param _eMode specifies which privileges should be applied when retrieving the node
+
+ @see createWithServiceFactory
+ */
+ static OConfigurationTreeRoot createWithProvider(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxConfProvider,
+ const OUString& _rPath,
+ sal_Int32 _nDepth = -1,
+ CREATION_MODE _eMode = CM_UPDATABLE,
+ sal_Bool _bLazyWrite = sal_True
+ );
+
+ /** open a new top-level configuration node<p/>
+ opens a new node which is the root if an own configuration sub tree. This is what "top level" means: The
+ node does not have a parent. It does not mean that the node represents a module tree (like org.openoffice.Office.Writer
+ or such).<br/>
+ In opposite to <method>createWithProvider</method>, createWithProvider expects a service factory. This factory
+ is used to create a configuration provider, and this provider is used to retrieve the node
+ @see createWithProvider
+ @param _rxContext service factory to use to create the configuration provider.
+ @param _rPath path to the node the object should represent
+ @param _nDepth depth for node retrieval
+ @param _eMode specifies which privileges should be applied when retrieving the node
+ */
+ static OConfigurationTreeRoot createWithComponentContext(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ const OUString& _rPath, sal_Int32 _nDepth = -1, CREATION_MODE _eMode = CM_UPDATABLE, sal_Bool _bLazyWrite = sal_True);
+
+ /** tolerant version of the <member>createWithServiceFactory</member>
+
+ <p>No assertions are thrown in case of an failure to initialize the configuration service, but once
+ the configuration could be initialized, errors in the creation of the specific node (e.g. because the
+ given node path does not exist) are still asserted.</p>
+ */
+ static OConfigurationTreeRoot tryCreateWithComponentContext( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const OUString& _rPath, sal_Int32 _nDepth = -1, CREATION_MODE _eMode = CM_UPDATABLE, sal_Bool _bLazyWrite = sal_True );
+
+ /** commit all changes made on the subtree the object is the root for<p/>
+ All changes made on any <type>OConfigurationNode</type> object retrieved (maybe indirect) from this root
+ object are committed when calling this method.
+ @return sal_True if and only if the commit was successful
+ */
+ sal_Bool commit() const throw();
+
+ /// invalidate the object
+ virtual void clear() throw();
+ };
+
+//........................................................................
+} // namespace utl
+//........................................................................
+
+#endif // _UNOTOOLS_CONFIGNODE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/configpaths.hxx b/include/unotools/configpaths.hxx
new file mode 100644
index 000000000000..d3e400ae1158
--- /dev/null
+++ b/include/unotools/configpaths.hxx
@@ -0,0 +1,170 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef UNOTOOLS_CONFIGPATHS_HXX_INCLUDED
+#define UNOTOOLS_CONFIGPATHS_HXX_INCLUDED
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+
+//----------------------------------------------------------------------------
+namespace utl
+{
+//----------------------------------------------------------------------------
+ /** extract the local nodename and the parent nodepath
+ from a configuration path.
+
+ @param _sInPath
+ A configuration path that is not an empty or root path.<BR/>
+ If this is not a valid configuration path, it is interpreted as
+ local name of a node.
+
+ @param _rsOutPath
+ On exit: The configuration path obtained by dropping
+ the last level off <var>_sInPath</var>.<BR/>
+ If <var>_sInPath</var> could not be parsed as a valid
+ configuration path, this is set to an empty string.
+
+ @param _rsLocalName
+ On exit: The plain (non-escaped) name of the node identified by
+ <var>_sInPath</var>. <BR/>
+ If <var>_sInPath</var> could not be parsed as a valid
+ configuration path, this is set to <var>_sInPath</var>.
+
+ @returns
+ <TRUE/>, if a parent path could be set
+ <FALSE/>, if the path was a one-level path or an invalid path
+
+ */
+ UNOTOOLS_DLLPUBLIC sal_Bool splitLastFromConfigurationPath(OUString const& _sInPath,
+ OUString& _rsOutPath,
+ OUString& _rsLocalName);
+
+//----------------------------------------------------------------------------
+ /** extract the first nodename from a configuration path.
+
+ @param _sInPath
+ A relative configuration path that is not empty.<BR/>
+ If this is not a valid configuration path, it is interpreted as
+ a single name of a node.
+
+ @param _sOutPath
+ If non-null, contains the remainder of the path upon return.
+
+ @returns
+ The plain (non-escaped) name of the node that is the first step
+ when traversing <var>_sInPath</var>.<BR/>
+ If <var>_sInPath</var> could not be parsed as a valid
+ configuration path, it is returned unaltered.
+
+ */
+ UNOTOOLS_DLLPUBLIC OUString extractFirstFromConfigurationPath(
+ OUString const& _sInPath, OUString* _sOutPath = 0);
+
+//----------------------------------------------------------------------------
+ /** check whether a path is to a nested node with respect to a parent path.
+
+ @param _sNestedPath
+ A configuration path that maybe points to a descendant of the node
+ identified by <var>_sPrefixPath</var>, with both paths starting
+ from the same node (or both being absolute).
+
+ @param _sPrefixPath
+ A configuration path.<BR/>
+ If this path is absolute, <var>_sNestedPath</var> should be absolute;
+ If this path is relative, <var>_sNestedPath</var> should be relative;
+ If this path is empty, <var>_sNestedPath</var> may start with a '/',
+ which is disregarded.
+
+ @returns
+ <TRUE/>, if <var>_sPrefixPath</var> is a prefix of <var>_sNestedPath</var>;
+ <FALSE/> otherwise.<BR/>
+ If both paths are equal <TRUE/> is returned.
+
+ */
+ sal_Bool isPrefixOfConfigurationPath(OUString const& _sNestedPath,
+ OUString const& _sPrefixPath);
+
+//----------------------------------------------------------------------------
+ /** get the relative path to a nested node with respect to a parent path.
+
+ @param _sNestedPath
+ A configuration path that points to a descendant of the node
+ identified by <var>_sPrefixPath</var>, with both paths starting
+ from the same node (or both being absolute).
+
+ @param _sPrefixPath
+ A configuration path.<BR/>
+ If this path is absolute, <var>_sNestedPath</var> must be absolute;
+ If this path is relative, <var>_sNestedPath</var> must be relative;
+ If this path is empty, <var>_sNestedPath</var> may start with a '/',
+ which is stripped.
+
+ @returns
+ The remaining relative path from the target of <var>_sPrefixPath</var>
+ to the target of <var>_sNestedPath</var>.<BR/>
+ If <var>_sPrefixPath</var> is not a prefix of <var>_sNestedPath</var>,
+ <var>_sNestedPath</var> is returned unaltered.
+
+ */
+ UNOTOOLS_DLLPUBLIC OUString dropPrefixFromConfigurationPath(OUString const& _sNestedPath,
+ OUString const& _sPrefixPath);
+
+//----------------------------------------------------------------------------
+ /** Create a one-level relative configuration path from a set element name
+ without a known set element type.
+
+ @param _sElementName
+ An arbitrary string that is to be interpreted as
+ name of a configuration set element.
+
+ @returns
+ A one-level relative path to the element, of the form
+ "*['<Name>']", where <Name> is properly escaped.
+
+ */
+ UNOTOOLS_DLLPUBLIC OUString wrapConfigurationElementName(OUString const& _sElementName);
+
+//----------------------------------------------------------------------------
+ /** Create a one-level relative configuration path from a set element name
+ and a known set element type.
+
+ @param _sElementName
+ An arbitrary string that is to be interpreted as
+ name of a configuration set element.
+
+ @param _sTypeName
+ An string identifying the type of the element. Usually this is be
+ the name of the element-template of the set.<BR/>
+
+ @returns
+ A one-level relative path to the element, of the form
+ "<Type>['<Name>']", where <Name> is properly escaped.
+
+ */
+ OUString wrapConfigurationElementName(OUString const& _sElementName,
+ OUString const& _sTypeName);
+
+//----------------------------------------------------------------------------
+} // namespace utl
+//----------------------------------------------------------------------------
+
+#endif // UNOTOOLS_CONFIGPATHS_HXX_INCLUDED
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/configvaluecontainer.hxx b/include/unotools/configvaluecontainer.hxx
new file mode 100644
index 000000000000..2fa95c337bd0
--- /dev/null
+++ b/include/unotools/configvaluecontainer.hxx
@@ -0,0 +1,183 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef UNOTOOLS_CONFIGVALUECONTAINER_HXX
+#define UNOTOOLS_CONFIGVALUECONTAINER_HXX
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <osl/mutex.hxx>
+
+//.........................................................................
+namespace utl
+{
+//.........................................................................
+
+#define CVC_READONLY_ACCESS 0x0000
+#define CVC_UPDATE_ACCESS 0x0001
+
+#define CVC_LAZY_UPDATE 0x0000
+#define CVC_IMMEDIATE_UPDATE 0x0002
+
+ struct OConfigurationValueContainerImpl;
+ struct NodeValueAccessor;
+ //=====================================================================
+ //= OConfigurationValueContainer
+ //=====================================================================
+ /** allows simple access to static configuration structures.
+
+ <p>The basic idea of this class is that it's clients (usually derived classes) simply register an
+ address in memory and a node path, and upon explicit request, the configuration value and the memory
+ are syncronized.<br/>
+ This means that when calling <method>read</method>, the current configuration values are copied into
+ the memory registered for them, and upon calling <method>write</method> the current values in memory
+ are set in the configuration nodes.</p>
+
+ <p>This way, the usage of this class is pretty straight forward: derive your own class, spend some members
+ to it, and bind these members to configuration node (usually done in the ctor of the derived class).<br/>
+ In the dtor, simply call <method>write</method> and <method>commit</method>.</p>
+
+ <p>There is no auto-commit mechanism in the dtor: In the usual scenario, when you derive from this class
+ and bind some members of your derived class to config nodes, this means that your members will be destroyed
+ before your base class' dtor is called, so accessing the memory during such a theoretical auto-commit would
+ yield undefined behaviour.</p>
+ */
+ class UNOTOOLS_DLLPUBLIC OConfigurationValueContainer
+ {
+ private:
+ OConfigurationValueContainerImpl*
+ m_pImpl;
+
+ protected:
+ //-----------------------------------------------------------------
+ // construction/destruction
+
+ /** constructs the object
+
+ @param _rxORB
+ specifies the service factory which should be used to access the configuration
+ @param _rAccessSafety
+ As this class is intented to manipulate objects it does not hold itself (see the various
+ registerXXX methods), it needs to guard these access for muti threading safety.<br/>
+ The mutex given here is locked whenever such an access occurs.
+ @param _pConfigLocation
+ is an ASCII string describing the configurations node path
+ @param _nAccessFlags
+ specifies different aspects of the configuration aspect to be created, e.g. it's update mode etc.<br/>
+ See the CVC_xxx constants for what you can use here.
+ @param _nLevels
+ specifies the number of levels to access under the node given by <arg>_pConfigLocation</arg>
+ */
+ OConfigurationValueContainer(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB,
+ ::osl::Mutex& _rAccessSafety,
+ const sal_Char* _pConfigLocation,
+ const sal_uInt16 _nAccessFlags = CVC_UPDATE_ACCESS | CVC_LAZY_UPDATE,
+ const sal_Int32 _nLevels = -1
+ );
+
+ /// dtor
+ ~OConfigurationValueContainer();
+
+ //-----------------------------------------------------------------
+ // registering data containers
+
+ /** registers a data accessor of an arbitrary type.
+
+ <p>Usually, in your derived class you simply add a member of the correct type of the configuration
+ value, and then call this method with the address of this member.</p>
+
+ @param _pRelativePathAscii
+ is a relative (ASCII) path of the node which should be "mirrored" into the accessor.
+ @param _pContainer
+ points to the accessors location in memory. Usually, this is simply an address of your derived class
+ @param _rValueType
+ is the type of your accessort. This type must be supported by the configuration.
+ */
+ void registerExchangeLocation(
+ const sal_Char* _pRelativePathAscii,
+ void* _pContainer,
+ const ::com::sun::star::uno::Type& _rValueType
+ );
+
+ public:
+ /** reads the configuration data
+
+ <p>The current values of the nodes bound (using the registerXXX methods) is copied into their
+ respective exchange locations.</p>
+
+ <p>Please note that any changes done to your exchange locations are overridden with the current config
+ values.</p>
+
+ @see write
+ */
+ void read( );
+
+ /** updates the configuration data
+
+ <p>The current values in memory (your exchange locations registered using the registerXXX methods) is
+ forwarded to their respective configuration nodes.</p>
+
+ <p>Note that calling <method>write</method>(<sal_True/) is the same as calling <method>commit</method>(<TRUE/>).</p>
+
+ @precond
+ The access must have been created for update access
+
+ @param _bCommit
+ If set to <TRUE/>, an automatic commit is done after the values have been synchronized.<br/>
+ If set to <FALSE/>, you must explicitly call <method>commit</method> to make your changes persistent.
+
+ @see read
+ @see commit
+ */
+ void write( sal_Bool _bCommit = sal_True );
+
+ /** commits any changes done
+
+ <p>Note that calling <method>write</method>(<sal_True/) is the same as calling <method>commit</method>(<TRUE/>).</p>
+
+ @precond
+ The access must have been created for update access
+
+ @param _bWrite
+ If <TRUE/>, the current values in the exchange locations are written to the configuration nodes
+ before the changes are committed.<br/>
+ If <FALSE/>, only the current values in the config nodes (as present since the last call to
+ <method>write</method>) are committed.
+ */
+ void commit( sal_Bool _bWrite = sal_True );
+
+ private:
+ /// implements the ctors
+ void implConstruct(
+ const OUString& _rConfigLocation,
+ const sal_uInt16 _nAccessFlags,
+ const sal_Int32 _nLevels
+ );
+
+ /// registers a value container
+ void implRegisterExchangeLocation( const NodeValueAccessor& _rAccessor );
+ };
+
+//.........................................................................
+} // namespace utl
+//.........................................................................
+
+#endif // UNOTOOLS_CONFIGVALUECONTAINER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/datetime.hxx b/include/unotools/datetime.hxx
new file mode 100644
index 000000000000..dfc0ab139825
--- /dev/null
+++ b/include/unotools/datetime.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 .
+ */
+
+//= conversions UNO3.TimeClass <-> Tools.TimeClass (Date/Time/DateTime)
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UNOTOOLS_DATETIME_HXX_
+#define _UNOTOOLS_DATETIME_HXX_
+
+#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/util/Time.hpp>
+#include <com/sun/star/util/DateTime.hpp>
+
+class Date;
+class Time;
+class DateTime;
+
+//.........................................................................
+namespace utl
+{
+//.........................................................................
+
+ namespace starutil = ::com::sun::star::util;
+
+ UNOTOOLS_DLLPUBLIC void typeConvert(const Date& _rDate, starutil::Date& _rOut);
+ UNOTOOLS_DLLPUBLIC void typeConvert(const starutil::Date& _rDate, Date& _rOut);
+
+ UNOTOOLS_DLLPUBLIC void typeConvert(const DateTime& _rDateTime, starutil::DateTime& _rOut);
+ UNOTOOLS_DLLPUBLIC void typeConvert(const starutil::DateTime& _rDateTime, DateTime& _rOut);
+
+ UNOTOOLS_DLLPUBLIC ::rtl::OUString toISO8601(const starutil::DateTime& _rDateTime);
+ UNOTOOLS_DLLPUBLIC ::rtl::OUString toISO8601(const starutil::Time& _rTime);
+ UNOTOOLS_DLLPUBLIC bool ISO8601parseDateTime(const ::rtl::OUString &i_rIn, starutil::DateTime& o_rDateTime);
+ UNOTOOLS_DLLPUBLIC bool ISO8601parseDate(const ::rtl::OUString &i_rIn, starutil::Date& o_rDate);
+ UNOTOOLS_DLLPUBLIC bool ISO8601parseTime(const ::rtl::OUString &i_rIn, starutil::Time& o_Time);
+
+//.........................................................................
+} // namespace utl
+//.........................................................................
+
+#endif // _UNOTOOLS_DATETIME_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/defaultoptions.hxx b/include/unotools/defaultoptions.hxx
new file mode 100644
index 000000000000..175fd3239f7a
--- /dev/null
+++ b/include/unotools/defaultoptions.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_unotools_DEFAULTOPTIONS_HXX
+#define INCLUDED_unotools_DEFAULTOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include "tools/solar.h"
+#include <unotools/options.hxx>
+
+class String;
+class SvtDefaultOptions_Impl;
+
+// class SvtDefaultOptions -----------------------------------------------
+
+class SvtDefaultOptions_Impl;
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtDefaultOptions : public utl::detail::Options
+{
+private:
+ SvtDefaultOptions_Impl* pImp;
+
+public:
+
+ SvtDefaultOptions();
+ virtual ~SvtDefaultOptions();
+
+ String GetDefaultPath( sal_uInt16 nId ) const;
+};
+
+#endif // #ifndef INCLUDED_unotools_DEFAULTOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/desktopterminationobserver.hxx b/include/unotools/desktopterminationobserver.hxx
new file mode 100644
index 000000000000..0f771669a485
--- /dev/null
+++ b/include/unotools/desktopterminationobserver.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 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef UNOTOOLS_INC_UNOTOOLS_DESKTOPTERMINATIONOBSERVER_HXX
+#define UNOTOOLS_INC_UNOTOOLS_DESKTOPTERMINATIONOBSERVER_HXX
+
+//........................................................................
+namespace utl
+{
+//........................................................................
+
+ //====================================================================
+ //= ITerminationListener
+ //====================================================================
+ /** non-UNO version of the <type scope="com.sun.star.frame">XTerminateListener</type>
+ */
+ class ITerminationListener
+ {
+ public:
+ virtual bool queryTermination() const = 0;
+ virtual void notifyTermination() = 0;
+
+ protected:
+ ~ITerminationListener() {}
+ };
+
+ //====================================================================
+ //= DesktopTerminationObserver
+ //====================================================================
+ /** a class which allows non-UNO components to observe the desktop (aka application)
+ for it's shutdown
+ */
+ class UNOTOOLS_DLLPUBLIC DesktopTerminationObserver
+ {
+ public:
+ /** registers a listener which should be notified when the desktop terminates
+ (which means the application is shutting down)
+ */
+ static void registerTerminationListener( ITerminationListener* _pListener );
+
+ /** revokes a termination listener
+ */
+ static void revokeTerminationListener( ITerminationListener* _pListener );
+
+ private:
+ DesktopTerminationObserver(); // never implemented, only static methods
+ };
+
+//........................................................................
+} // namespace utl
+//........................................................................
+
+#endif // UNOTOOLS_INC_UNOTOOLS_DESKTOPTERMINATIONOBSERVER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/digitgroupingiterator.hxx b/include/unotools/digitgroupingiterator.hxx
new file mode 100644
index 000000000000..d7bca117756b
--- /dev/null
+++ b/include/unotools/digitgroupingiterator.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_UNOTOOLS_DIGITGROUPINGITERATOR_HXX
+#define INCLUDED_UNOTOOLS_DIGITGROUPINGITERATOR_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+
+namespace utl {
+
+/** Iterator to be used with a digit grouping as obtained through
+ LocaleDataWrapper::getDigitGrouping().
+
+ The iterator advances over the digit groupings, returning the number of
+ digits per group. If the last group was encountered the iterator will
+ always return the last grouping.
+
+ Grouping values are sanitized to be 0 <= value <= SAL_MAX_UINT16, even if
+ originally Int32, to be able to easily cast it down to String's xub_StrLen.
+ This shouldn't make any difference in practice.
+
+ Usage example with a string buffer containing a decimal representation of
+ an integer number. Note that of course this loop could be optimized to not
+ count single characters but hunks of groups instead using the get() method,
+ this is just for illustrating usage. Anyway, for double values it is highly
+ more efficient to use ::rtl::math::doubleToString() and pass the grouping
+ sequence, instead of using this iterator and inserting characters into
+ strings.
+
+ DigitGroupingIterator aGrouping(...)
+ sal_Int32 nCount = 0;
+ sal_Int32 n = aBuffer.getLength();
+ // >1 because we don't want to insert a separator if there is no leading digit.
+ while (n-- > 1)
+ {
+ if (++nCount >= aGrouping.getPos())
+ {
+ aBuffer.insert( n, cSeparator);
+ nGroupDigits = aGrouping.advance();
+ }
+ }
+
+ */
+
+class DigitGroupingIterator
+{
+ const ::com::sun::star::uno::Sequence< sal_Int32 > maGroupings;
+
+ sal_Int32 mnGroup; // current active grouping
+ sal_Int32 mnDigits; // current active digits per group
+ sal_Int32 mnNextPos; // position (in digits) of next grouping
+
+ void setInfinite()
+ {
+ mnGroup = maGroupings.getLength();
+ }
+
+ bool isInfinite() const
+ {
+ return mnGroup >= maGroupings.getLength();
+ }
+
+ sal_Int32 getGrouping() const
+ {
+ if (mnGroup < maGroupings.getLength())
+ {
+ sal_Int32 n = maGroupings[mnGroup];
+ OSL_ENSURE( 0 <= n && n <= SAL_MAX_UINT16, "DigitGroupingIterator::getGrouping: far out");
+ if (n < 0)
+ n = 0; // sanitize ...
+ else if (n > SAL_MAX_UINT16)
+ n = SAL_MAX_UINT16; // limit for use with xub_StrLen
+ return n;
+ }
+ return 0;
+ }
+
+ void setPos()
+ {
+ // someone might be playing jokes on us, so check for overflow
+ if (mnNextPos <= SAL_MAX_INT32 - mnDigits)
+ mnNextPos += mnDigits;
+ }
+
+ void setDigits()
+ {
+ sal_Int32 nPrev = mnDigits;
+ mnDigits = getGrouping();
+ if (!mnDigits)
+ {
+ mnDigits = nPrev;
+ setInfinite();
+ }
+ setPos();
+ }
+
+ void initGrouping()
+ {
+ mnDigits = 3; // just in case of constructed with empty grouping
+ mnGroup = 0;
+ mnNextPos = 0;
+ setDigits();
+ }
+
+ // not implemented, prevent usage
+ DigitGroupingIterator();
+ DigitGroupingIterator( const DigitGroupingIterator & );
+ DigitGroupingIterator & operator=( const DigitGroupingIterator & );
+
+public:
+
+ explicit DigitGroupingIterator( const ::com::sun::star::uno::Sequence< sal_Int32 > & rGroupings )
+ : maGroupings( rGroupings)
+ {
+ initGrouping();
+ }
+
+ /** Advance iterator to next grouping. */
+ DigitGroupingIterator & advance()
+ {
+ if (isInfinite())
+ setPos();
+ else
+ {
+ ++mnGroup;
+ setDigits();
+ }
+ return *this;
+ }
+
+ /** Obtain current grouping. Always > 0. */
+ sal_Int32 get() const
+ {
+ return mnDigits;
+ }
+
+ /** The next position (in integer digits) from the right where to insert a
+ group separator. */
+ sal_Int32 getPos()
+ {
+ return mnNextPos;
+ }
+
+ /** Reset iterator to start again from the right beginning. */
+ void reset()
+ {
+ initGrouping();
+ }
+
+ /** Create a sequence of bool values containing positions where to add a
+ separator when iterating forward over a string and copying digit per
+ digit. For example, for grouping in thousands and nIntegerDigits==7 the
+ sequence returned would be {1,0,0,1,0,0,0} so the caller would add a
+ separator after the 1st and the 4th digit. */
+ static ::com::sun::star::uno::Sequence< sal_Bool > createForwardSequence(
+ sal_Int32 nIntegerDigits,
+ const ::com::sun::star::uno::Sequence< sal_Int32 > & rGroupings )
+ {
+ if (nIntegerDigits <= 0)
+ return ::com::sun::star::uno::Sequence< sal_Bool >();
+ DigitGroupingIterator aIterator( rGroupings);
+ ::com::sun::star::uno::Sequence< sal_Bool > aSeq( nIntegerDigits);
+ sal_Bool* pArr = aSeq.getArray();
+ for (sal_Int32 j = 0; --nIntegerDigits >= 0; ++j)
+ {
+ if (j == aIterator.getPos())
+ {
+ pArr[nIntegerDigits] = sal_True;
+ aIterator.advance();
+ }
+ else
+ pArr[nIntegerDigits] = sal_False;
+ }
+ return aSeq;
+ }
+};
+
+} // namespace utl
+
+#endif // INCLUDED_UNOTOOLS_DIGITGROUPINGITERATOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/docinfohelper.hxx b/include/unotools/docinfohelper.hxx
new file mode 100644
index 000000000000..be32c3bfc7c9
--- /dev/null
+++ b/include/unotools/docinfohelper.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 _UNOTOOLS_DOCINFOHELPER_HXX_
+#define _UNOTOOLS_DOCINFOHELPER_HXX_
+
+#include <unotools/unotoolsdllapi.h>
+#include <rtl/ustring.hxx>
+
+namespace utl
+{
+class UNOTOOLS_DLLPUBLIC DocInfoHelper
+{
+public:
+ static OUString GetGeneratorString();
+
+};
+
+} // namespace utl
+
+
+#endif // _UNOTOOLS_DOCINFOHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/dynamicmenuoptions.hxx b/include/unotools/dynamicmenuoptions.hxx
new file mode 100644
index 000000000000..46a8a211531c
--- /dev/null
+++ b/include/unotools/dynamicmenuoptions.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_unotools_DYNAMICMENUOPTIONS_HXX
+#define INCLUDED_unotools_DYNAMICMENUOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <unotools/options.hxx>
+
+/*-************************************************************************************************************//**
+ @descr The method GetList() returns a list of property values.
+ Use follow defines to seperate values by names.
+*//*-*************************************************************************************************************/
+#define DYNAMICMENU_PROPERTYNAME_URL OUString("URL")
+#define DYNAMICMENU_PROPERTYNAME_TITLE OUString("Title")
+#define DYNAMICMENU_PROPERTYNAME_IMAGEIDENTIFIER OUString("ImageIdentifier")
+#define DYNAMICMENU_PROPERTYNAME_TARGETNAME OUString("TargetName")
+
+/*-************************************************************************************************************//**
+ @descr You can use these enum values to specify right menu if you call our interface methods.
+*//*-*************************************************************************************************************/
+enum EDynamicMenuType
+{
+ E_NEWMENU = 0,
+ E_WIZARDMENU = 1,
+ E_HELPBOOKMARKS = 2
+};
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtDynamicMenuOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about dynamic menus
+ @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtDynamicMenuOptions : public utl::detail::Options
+{
+ public:
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtDynamicMenuOptions();
+ virtual ~SvtDynamicMenuOptions();
+
+ /*-****************************************************************************************************//**
+ @short return complete specified list
+ @descr Call it to get all entries of an dynamic menu.
+ We return a list of all nodes with his names and properties.
+
+ @seealso -
+
+ @param "eMenu" select right menu.
+ @return A list of menu items is returned.
+
+ @onerror We return an empty list.
+ *//*-*****************************************************************************************************/
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > GetMenu( EDynamicMenuType eMenu ) const;
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtDynamicMenuOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtDynamicMenuOptions
+
+#endif // #ifndef INCLUDED_unotools_DYNAMICMENUOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/eventcfg.hxx b/include/unotools/eventcfg.hxx
new file mode 100644
index 000000000000..2ea72642805a
--- /dev/null
+++ b/include/unotools/eventcfg.hxx
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _EVENTCFG_HXX
+#define _EVENTCFG_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <unotools/configitem.hxx>
+#include <com/sun/star/document/XEventsSupplier.hpp>
+#include <com/sun/star/container/XNameReplace.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <cppuhelper/weakref.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <boost/unordered_map.hpp>
+#include <vector>
+
+#define STR_EVENT_STARTAPP 0
+#define STR_EVENT_CLOSEAPP 1
+#define STR_EVENT_DOCCREATED 2
+#define STR_EVENT_CREATEDOC 3
+#define STR_EVENT_LOADFINISHED 4
+#define STR_EVENT_OPENDOC 5
+#define STR_EVENT_PREPARECLOSEDOC 6
+#define STR_EVENT_CLOSEDOC 7
+#define STR_EVENT_SAVEDOC 8
+#define STR_EVENT_SAVEDOCDONE 9
+#define STR_EVENT_SAVEDOCFAILED 10
+#define STR_EVENT_SAVEASDOC 11
+#define STR_EVENT_SAVEASDOCDONE 12
+#define STR_EVENT_SAVEASDOCFAILED 13
+#define STR_EVENT_SAVETODOC 14
+#define STR_EVENT_SAVETODOCDONE 15
+#define STR_EVENT_SAVETODOCFAILED 16
+#define STR_EVENT_ACTIVATEDOC 17
+#define STR_EVENT_DEACTIVATEDOC 18
+#define STR_EVENT_PRINTDOC 19
+#define STR_EVENT_VIEWCREATED 20
+#define STR_EVENT_PREPARECLOSEVIEW 21
+#define STR_EVENT_CLOSEVIEW 22
+#define STR_EVENT_MODIFYCHANGED 23
+#define STR_EVENT_TITLECHANGED 24
+#define STR_EVENT_VISAREACHANGED 25
+#define STR_EVENT_MODECHANGED 26
+#define STR_EVENT_STORAGECHANGED 27
+
+typedef ::boost::unordered_map< OUString, OUString, OUStringHash, ::std::equal_to< OUString > > EventBindingHash;
+typedef ::std::vector< ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XFrame > > FrameVector;
+typedef ::std::vector< OUString > SupportedEventsVector;
+
+class GlobalEventConfig_Impl : public utl::ConfigItem
+{
+ EventBindingHash m_eventBindingHash;
+ FrameVector m_lFrames;
+ SupportedEventsVector m_supportedEvents;
+
+ void initBindingInfo();
+
+public:
+ GlobalEventConfig_Impl( );
+ ~GlobalEventConfig_Impl( );
+
+ void Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames);
+ void Commit();
+
+ void SAL_CALL replaceByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException);
+ ::sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException);
+ ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException);
+ OUString GetEventName( sal_Int32 nID );
+};
+
+class UNOTOOLS_DLLPUBLIC GlobalEventConfig:
+ public ::cppu::WeakImplHelper2 < ::com::sun::star::document::XEventsSupplier, ::com::sun::star::container::XNameReplace >
+{
+ public:
+ GlobalEventConfig( );
+ ~GlobalEventConfig( );
+ static ::osl::Mutex& GetOwnStaticMutex();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents( ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL replaceByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException);
+ ::sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException);
+ ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException);
+ static OUString GetEventName( sal_Int32 nID );
+
+ private:
+ static GlobalEventConfig_Impl* m_pImpl;
+ static sal_Int32 m_nRefCount;
+};
+
+#endif // _EVENTCFG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/eventlisteneradapter.hxx b/include/unotools/eventlisteneradapter.hxx
new file mode 100644
index 000000000000..89fe74782e34
--- /dev/null
+++ b/include/unotools/eventlisteneradapter.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 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UNOTOOLS_EVENTLISTENERADAPTER_HXX_
+#define _UNOTOOLS_EVENTLISTENERADAPTER_HXX_
+#include <com/sun/star/lang/XComponent.hpp>
+
+//.........................................................................
+namespace utl
+{
+//.........................................................................
+
+ struct OEventListenerAdapterImpl;
+ //=====================================================================
+ //= OEventListenerAdapter
+ //=====================================================================
+ /** base class for non-UNO dispose listeners
+ */
+ class UNOTOOLS_DLLPUBLIC OEventListenerAdapter
+ {
+ friend class OEventListenerImpl;
+
+ private:
+ UNOTOOLS_DLLPRIVATE OEventListenerAdapter( const OEventListenerAdapter& _rSource ); // never implemented
+ UNOTOOLS_DLLPRIVATE const OEventListenerAdapter& operator=( const OEventListenerAdapter& _rSource ); // never implemented
+
+ protected:
+ OEventListenerAdapterImpl* m_pImpl;
+
+ protected:
+ OEventListenerAdapter();
+ virtual ~OEventListenerAdapter();
+
+ void startComponentListening( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxComp );
+ void stopComponentListening( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxComp );
+ void stopAllComponentListening( );
+
+ virtual void _disposing( const ::com::sun::star::lang::EventObject& _rSource ) = 0;
+ };
+
+//.........................................................................
+} // namespace utl
+//.........................................................................
+
+#endif // _UNOTOOLS_EVENTLISTENERADAPTER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/extendedsecurityoptions.hxx b/include/unotools/extendedsecurityoptions.hxx
new file mode 100644
index 000000000000..245f87e0d50f
--- /dev/null
+++ b/include/unotools/extendedsecurityoptions.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_unotools_EXTENDEDSECURITYOPTIONS_HXX
+#define INCLUDED_unotools_EXTENDEDSECURITYOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtExtendedSecurityOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about security features
+ @descr -
+
+ @implements -
+ @base -
+
+ @ATTENTION This class is partially threadsafe.
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtExtendedSecurityOptions : public utl::detail::Options
+{
+ public:
+ // Must be zero based!
+ enum OpenHyperlinkMode
+ {
+ OPEN_NEVER = 0,
+ OPEN_WITHSECURITYCHECK,
+ OPEN_ALWAYS
+ };
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtExtendedSecurityOptions();
+ virtual ~SvtExtendedSecurityOptions();
+
+ OpenHyperlinkMode GetOpenHyperlinkMode();
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetInitMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtExtendedSecurityOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtExtendedSecurityOptions
+
+#endif // #ifndef INCLUDED_unotools_EXTENDEDSECURITYOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/fltrcfg.hxx b/include/unotools/fltrcfg.hxx
new file mode 100644
index 000000000000..0356aeeb5d12
--- /dev/null
+++ b/include/unotools/fltrcfg.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 _SVT_FLTRCFG_HXX
+#define _SVT_FLTRCFG_HXX
+
+// -----------------------------------------------------------------------
+
+#include "unotools/unotoolsdllapi.h"
+#include <unotools/configitem.hxx>
+
+struct SvtFilterOptions_Impl;
+class UNOTOOLS_DLLPUBLIC SvtFilterOptions : public utl::ConfigItem
+{
+ SvtFilterOptions_Impl* pImp;
+
+ const com::sun::star::uno::Sequence<OUString>& GetPropertyNames();
+public:
+ SvtFilterOptions();
+ virtual ~SvtFilterOptions();
+
+ virtual void Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames);
+ virtual void Commit();
+ void Load();
+
+ void SetLoadWordBasicCode( sal_Bool bFlag );
+ sal_Bool IsLoadWordBasicCode() const;
+ void SetLoadWordBasicExecutable( sal_Bool bFlag );
+ sal_Bool IsLoadWordBasicExecutable() const;
+ void SetLoadWordBasicStorage( sal_Bool bFlag );
+ sal_Bool IsLoadWordBasicStorage() const;
+
+ void SetLoadExcelBasicCode( sal_Bool bFlag );
+ sal_Bool IsLoadExcelBasicCode() const;
+ void SetLoadExcelBasicExecutable( sal_Bool bFlag );
+ sal_Bool IsLoadExcelBasicExecutable() const;
+ void SetLoadExcelBasicStorage( sal_Bool bFlag );
+ sal_Bool IsLoadExcelBasicStorage() const;
+
+ void SetLoadPPointBasicCode( sal_Bool bFlag );
+ sal_Bool IsLoadPPointBasicCode() const;
+ void SetLoadPPointBasicStorage( sal_Bool bFlag );
+ sal_Bool IsLoadPPointBasicStorage() const;
+
+ sal_Bool IsMathType2Math() const;
+ void SetMathType2Math( sal_Bool bFlag );
+ sal_Bool IsMath2MathType() const;
+ void SetMath2MathType( sal_Bool bFlag );
+
+ sal_Bool IsWinWord2Writer() const;
+ void SetWinWord2Writer( sal_Bool bFlag );
+ sal_Bool IsWriter2WinWord() const;
+ void SetWriter2WinWord( sal_Bool bFlag );
+
+ sal_Bool IsUseEnhancedFields() const;
+
+ sal_Bool IsExcel2Calc() const;
+ void SetExcel2Calc( sal_Bool bFlag );
+ sal_Bool IsCalc2Excel() const;
+ void SetCalc2Excel( sal_Bool bFlag );
+
+ sal_Bool IsPowerPoint2Impress() const;
+ void SetPowerPoint2Impress( sal_Bool bFlag );
+ sal_Bool IsImpress2PowerPoint() const;
+ void SetImpress2PowerPoint( sal_Bool bFlag );
+
+ sal_Bool IsEnablePPTPreview() const;
+ sal_Bool IsEnableCalcPreview() const;
+ sal_Bool IsEnableWordPreview() const;
+
+ static SvtFilterOptions& Get();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/fontcfg.hxx b/include/unotools/fontcfg.hxx
new file mode 100644
index 000000000000..23ea55140655
--- /dev/null
+++ b/include/unotools/fontcfg.hxx
@@ -0,0 +1,221 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _UNOTOOLS_FONTCFG_HXX
+#define _UNOTOOLS_FONTCFG_HXX
+
+#include <unotools/unotoolsdllapi.h>
+#include <tools/string.hxx>
+#include <tools/fontenum.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+
+#include <boost/unordered_map.hpp>
+#include <boost/unordered_set.hpp>
+#include <vector>
+
+namespace com {
+namespace sun {
+namespace star {
+namespace lang {
+
+// equality operator needed for hash_map;
+// (-> why does this need to be in the namespace of Locale ? g++ fails to compile else)
+inline bool operator==( const com::sun::star::lang::Locale& rLeft, const com::sun::star::lang::Locale& rRight )
+{
+ return
+ rLeft.Language.equals( rRight.Language ) &&
+ rLeft.Country.equals( rRight.Country ) &&
+ rLeft.Variant.equals( rRight.Variant )
+ ;
+}
+}}}}
+
+namespace utl
+{
+
+struct LocaleHash
+{
+ size_t operator()( const com::sun::star::lang::Locale& rLocale ) const
+ {
+ return
+ (size_t)rLocale.Language.hashCode() ^
+ (size_t)rLocale.Country.hashCode() ^
+ (size_t)rLocale.Variant.hashCode();
+ }
+};
+
+class UNOTOOLS_DLLPUBLIC DefaultFontConfiguration
+{
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ m_xConfigProvider;
+ com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >
+ m_xConfigAccess;
+
+ struct LocaleAccess
+ {
+ // the real string used in the configuration
+ // used to get rid of upper/lower case problems
+ OUString aConfigLocaleString;
+ // xAccess is mutable to be able to be filled on demand
+ mutable com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xAccess;
+ };
+
+ boost::unordered_map< com::sun::star::lang::Locale,
+ LocaleAccess,
+ utl::LocaleHash >
+ m_aConfig;
+
+ OUString tryLocale( const com::sun::star::lang::Locale& rLocale, const OUString& rType ) const;
+
+ public:
+ DefaultFontConfiguration();
+ ~DefaultFontConfiguration();
+
+ static DefaultFontConfiguration& get();
+
+ OUString getDefaultFont( const com::sun::star::lang::Locale& rLocale, int nType ) const;
+ OUString getUserInterfaceFont( const com::sun::star::lang::Locale& rLocale ) const;
+};
+
+// IMPL_FONT_ATTR_DEFAULT - Default-Font like Andale Sans UI, Palace Script, Albany, Thorndale, Cumberland, ...
+// IMPL_FONT_ATTR_STANDARD - Standard-Font like Arial, Times, Courier, ...
+// IMPL_FONT_ATTR_NORMAL - normal Font for writing text like Arial, Verdana, Arial Narrow, Trebuchet, Times, Courier, ...
+// IMPL_FONT_ATTR_SYMBOL - Font with symbols
+// IMPL_FONT_ATTR_DECORATIVE - Readable and normally used for drawings
+// IMPL_FONT_ATTR_SPECIAL - very special design
+// IMPL_FONT_ATTR_TITLING - only uppercase characters
+// IMPL_FONT_ATTR_FULL - Font with normally all characters
+// IMPL_FONT_ATTR_CAPITALS - only uppercase characters, but lowercase characters smaller as the uppercase characters
+// IMPL_FONT_ATTR_TYPEWRITER - like a typewriter: Courier, ...
+// IMPL_FONT_ATTR_SCRIPT - Handwriting or Script
+// IMPL_FONT_ATTR_HANDWRITING - More Handwriting with normal letters
+// IMPL_FONT_ATTR_CHANCERY - Like Zapf Chancery
+// IMPL_FONT_ATTR_COMIC - Like Comic Sans MS
+// IMPL_FONT_ATTR_BRUSHSCRIPT - More Script
+// IMPL_FONT_ATTR_OTHERSTYLE - OldStyle, ... so negativ points
+#define IMPL_FONT_ATTR_DEFAULT ((sal_uLong)0x00000001)
+#define IMPL_FONT_ATTR_STANDARD ((sal_uLong)0x00000002)
+#define IMPL_FONT_ATTR_NORMAL ((sal_uLong)0x00000004)
+#define IMPL_FONT_ATTR_SYMBOL ((sal_uLong)0x00000008)
+#define IMPL_FONT_ATTR_FIXED ((sal_uLong)0x00000010)
+#define IMPL_FONT_ATTR_SANSSERIF ((sal_uLong)0x00000020)
+#define IMPL_FONT_ATTR_SERIF ((sal_uLong)0x00000040)
+#define IMPL_FONT_ATTR_DECORATIVE ((sal_uLong)0x00000080)
+#define IMPL_FONT_ATTR_SPECIAL ((sal_uLong)0x00000100)
+#define IMPL_FONT_ATTR_ITALIC ((sal_uLong)0x00000200)
+#define IMPL_FONT_ATTR_TITLING ((sal_uLong)0x00000400)
+#define IMPL_FONT_ATTR_CAPITALS ((sal_uLong)0x00000800)
+#define IMPL_FONT_ATTR_CJK ((sal_uLong)0x00001000)
+#define IMPL_FONT_ATTR_CJK_JP ((sal_uLong)0x00002000)
+#define IMPL_FONT_ATTR_CJK_SC ((sal_uLong)0x00004000)
+#define IMPL_FONT_ATTR_CJK_TC ((sal_uLong)0x00008000)
+#define IMPL_FONT_ATTR_CJK_KR ((sal_uLong)0x00010000)
+#define IMPL_FONT_ATTR_CTL ((sal_uLong)0x00020000)
+#define IMPL_FONT_ATTR_NONELATIN ((sal_uLong)0x00040000)
+#define IMPL_FONT_ATTR_FULL ((sal_uLong)0x00080000)
+#define IMPL_FONT_ATTR_OUTLINE ((sal_uLong)0x00100000)
+#define IMPL_FONT_ATTR_SHADOW ((sal_uLong)0x00200000)
+#define IMPL_FONT_ATTR_ROUNDED ((sal_uLong)0x00400000)
+#define IMPL_FONT_ATTR_TYPEWRITER ((sal_uLong)0x00800000)
+#define IMPL_FONT_ATTR_SCRIPT ((sal_uLong)0x01000000)
+#define IMPL_FONT_ATTR_HANDWRITING ((sal_uLong)0x02000000)
+#define IMPL_FONT_ATTR_CHANCERY ((sal_uLong)0x04000000)
+#define IMPL_FONT_ATTR_COMIC ((sal_uLong)0x08000000)
+#define IMPL_FONT_ATTR_BRUSHSCRIPT ((sal_uLong)0x10000000)
+#define IMPL_FONT_ATTR_GOTHIC ((sal_uLong)0x20000000)
+#define IMPL_FONT_ATTR_SCHOOLBOOK ((sal_uLong)0x40000000)
+#define IMPL_FONT_ATTR_OTHERSTYLE ((sal_uLong)0x80000000)
+
+#define IMPL_FONT_ATTR_CJK_ALLLANG (IMPL_FONT_ATTR_CJK_JP | IMPL_FONT_ATTR_CJK_SC | IMPL_FONT_ATTR_CJK_TC | IMPL_FONT_ATTR_CJK_KR)
+#define IMPL_FONT_ATTR_ALLSCRIPT (IMPL_FONT_ATTR_SCRIPT | IMPL_FONT_ATTR_HANDWRITING | IMPL_FONT_ATTR_CHANCERY | IMPL_FONT_ATTR_COMIC | IMPL_FONT_ATTR_BRUSHSCRIPT)
+#define IMPL_FONT_ATTR_ALLSUBSCRIPT (IMPL_FONT_ATTR_HANDWRITING | IMPL_FONT_ATTR_CHANCERY | IMPL_FONT_ATTR_COMIC | IMPL_FONT_ATTR_BRUSHSCRIPT)
+#define IMPL_FONT_ATTR_ALLSERIFSTYLE (IMPL_FONT_ATTR_ALLSCRIPT |\
+ IMPL_FONT_ATTR_SANSSERIF | IMPL_FONT_ATTR_SERIF |\
+ IMPL_FONT_ATTR_FIXED | IMPL_FONT_ATTR_ITALIC |\
+ IMPL_FONT_ATTR_GOTHIC | IMPL_FONT_ATTR_SCHOOLBOOK |\
+ IMPL_FONT_ATTR_SHADOW | IMPL_FONT_ATTR_OUTLINE)
+
+struct UNOTOOLS_DLLPUBLIC FontNameAttr
+{
+ String Name;
+ ::std::vector< String > Substitutions;
+ ::std::vector< String > MSSubstitutions;
+ ::std::vector< String > PSSubstitutions;
+ ::std::vector< String > HTMLSubstitutions;
+ FontWeight Weight;
+ FontWidth Width;
+ unsigned long Type; // bitfield of IMPL_FONT_ATTR_*
+};
+
+class UNOTOOLS_DLLPUBLIC FontSubstConfiguration
+{
+private:
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ m_xConfigProvider;
+ com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >
+ m_xConfigAccess;
+ struct LocaleSubst
+ {
+ OUString aConfigLocaleString;
+ mutable bool bConfigRead;
+ // note: aSubstAttributes must be sorted alphabetically by Name
+ // searches on the substitutes are done with Name as key, where
+ // a minimal match is sufficient (that is e.g. "Thorndale" will match
+ // "Thorndale BlaBlub"). Also names must be lower case.
+ mutable std::vector< FontNameAttr > aSubstAttributes;
+
+ LocaleSubst() : bConfigRead( false ) {}
+ };
+ boost::unordered_map< com::sun::star::lang::Locale, LocaleSubst, utl::LocaleHash > m_aSubst;
+ typedef boost::unordered_set< OUString, OUStringHash > UniqueSubstHash;
+ mutable UniqueSubstHash maSubstHash;
+
+
+ void fillSubstVector( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
+ const OUString& rType,
+ std::vector< String >& rSubstVector ) const;
+ FontWeight getSubstWeight( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
+ const OUString& rType ) const;
+ FontWidth getSubstWidth( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
+ const OUString& rType ) const;
+ unsigned long getSubstType( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
+ const OUString& rType ) const;
+ void readLocaleSubst( const com::sun::star::lang::Locale& rLocale ) const;
+public:
+ FontSubstConfiguration();
+ ~FontSubstConfiguration();
+
+ static FontSubstConfiguration& get();
+
+ const FontNameAttr* getSubstInfo(
+ const String& rFontName,
+ const com::sun::star::lang::Locale& rLocale =
+ com::sun::star::lang::Locale( OUString( "en" ),
+ OUString(),
+ OUString() )
+ ) const;
+ static void getMapName( const String& rOrgName, String& rShortName, String& rFamilyName, FontWeight& rWeight, FontWidth& rWidth, sal_uLong& rType );
+};
+
+} // namespace utl
+
+#endif // _UNOTOOLS_FONTCFG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/fontcvt.hxx b/include/unotools/fontcvt.hxx
new file mode 100644
index 000000000000..05564f974a79
--- /dev/null
+++ b/include/unotools/fontcvt.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 _UNOTOOLS_FONTCVT_HXX
+#define _UNOTOOLS_FONTCVT_HXX
+
+#include <unotools/unotoolsdllapi.h>
+#include <tools/string.hxx>
+
+// ------------------
+// - FontToSubsFont -
+// ------------------
+
+#define FONTTOSUBSFONT_IMPORT ((sal_uLong)0x00000001)
+#define FONTTOSUBSFONT_EXPORT ((sal_uLong)0x00000002)
+#define FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ((sal_uLong)0x00000004)
+
+typedef void* FontToSubsFontConverter;
+UNOTOOLS_DLLPUBLIC FontToSubsFontConverter CreateFontToSubsFontConverter( const String& rFontName, sal_uLong nFlags );
+UNOTOOLS_DLLPUBLIC void DestroyFontToSubsFontConverter( FontToSubsFontConverter hConverter );
+UNOTOOLS_DLLPUBLIC sal_Unicode ConvertFontToSubsFontChar( FontToSubsFontConverter hConverter, sal_Unicode c );
+UNOTOOLS_DLLPUBLIC String GetFontToSubsFontName( FontToSubsFontConverter hConverter );
+
+// ---------------------------
+// - StarSymbolToMSMultiFont -
+// ---------------------------
+
+class UNOTOOLS_DLLPUBLIC StarSymbolToMSMultiFont
+{
+public:
+ //Returns the name of the best windows symbol font which this char can be
+ //mapped to. Sets rChar to the correct position for that font. If no
+ //match found, then no name is returned, and rChar is unchanged. If you
+ //want to convert a string, you don't want to use this.
+ virtual String ConvertChar(sal_Unicode &rChar) = 0;
+
+ //Starts converting the string at position rIndex. It converts as much of
+ //the string that can be converted to the same symbol font and returns the
+ //name of that font. rIndex is modified to the last index that was
+ //converted. Typically you call if continously until rIndex ==
+ //rString.Len() and handle each section as seperate 8bit strings using
+ //seperate fonts. Will return an empty string for a continous section
+ //that has no possible mapping.
+ virtual String ConvertString(String &rString, xub_StrLen &rIndex) = 0;
+ virtual ~StarSymbolToMSMultiFont() {}
+};
+
+//with bPerfect set the converter will only try and convert symbols which have
+//perfect mappings to the windows symbols fonts. With it not set, it will
+//allow somewhat more dubious transformations that are nevertheless
+//recognizably similar. Even in this mode there will be characters that fail.
+//The users of this might want to make a distinction between failed characters
+//which were inside and those outside the unicode private area.
+UNOTOOLS_DLLPUBLIC StarSymbolToMSMultiFont *CreateStarSymbolToMSMultiFont(bool bPerfectOnly=false);
+#endif // _UNOTOOLS_FONTCVT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/fontdefs.hxx b/include/unotools/fontdefs.hxx
new file mode 100644
index 000000000000..60c37d498045
--- /dev/null
+++ b/include/unotools/fontdefs.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 _UNOTOOLS_FONTDEFS_HXX
+#define _UNOTOOLS_FONTDEFS_HXX
+
+#include <unotools/unotoolsdllapi.h>
+#include <sal/types.h>
+#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
+
+namespace utl {
+ class FontSubstConfiguration;
+ struct FontNameAttr;
+}
+
+// ----------------
+// - SubsFontName -
+// ----------------
+
+#define SUBSFONT_ONLYONE ((sal_uLong)0x00000001)
+#define SUBSFONT_MS ((sal_uLong)0x00000002)
+#define SUBSFONT_PS ((sal_uLong)0x00000004)
+#define SUBSFONT_HTML ((sal_uLong)0x00000008)
+
+UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( const OUString& rName, sal_uLong nFlags );
+
+UNOTOOLS_DLLPUBLIC void AddTokenFontName( OUString& rName, const OUString& rNewToken );
+
+struct UNOTOOLS_DLLPUBLIC FontNameHash { int operator()(const String&) const; };
+
+// ---------------
+// - ConvertChar -
+// ---------------
+
+class UNOTOOLS_DLLPUBLIC ConvertChar
+{
+public:
+ const sal_Unicode* mpCvtTab;
+ const char* mpSubsFontName;
+ sal_Unicode (*mpCvtFunc)( sal_Unicode );
+ sal_Unicode RecodeChar( sal_Unicode c ) const;
+ void RecodeString( OUString& rStra, sal_Int32 nIndex, sal_Int32 nLen ) const;
+ static const ConvertChar* GetRecodeData( const String& rOrgFontName, const String& rMapFontName );
+};
+
+
+// Default-Font
+#define DEFAULTFONT_SANS_UNICODE ((sal_uInt16)1)
+#define DEFAULTFONT_SANS ((sal_uInt16)2)
+#define DEFAULTFONT_SERIF ((sal_uInt16)3)
+#define DEFAULTFONT_FIXED ((sal_uInt16)4)
+#define DEFAULTFONT_SYMBOL ((sal_uInt16)5)
+#define DEFAULTFONT_UI_SANS ((sal_uInt16)1000)
+#define DEFAULTFONT_UI_FIXED ((sal_uInt16)1001)
+#define DEFAULTFONT_LATIN_TEXT ((sal_uInt16)2000)
+#define DEFAULTFONT_LATIN_PRESENTATION ((sal_uInt16)2001)
+#define DEFAULTFONT_LATIN_SPREADSHEET ((sal_uInt16)2002)
+#define DEFAULTFONT_LATIN_HEADING ((sal_uInt16)2003)
+#define DEFAULTFONT_LATIN_DISPLAY ((sal_uInt16)2004)
+#define DEFAULTFONT_LATIN_FIXED ((sal_uInt16)2005)
+#define DEFAULTFONT_CJK_TEXT ((sal_uInt16)3000)
+#define DEFAULTFONT_CJK_PRESENTATION ((sal_uInt16)3001)
+#define DEFAULTFONT_CJK_SPREADSHEET ((sal_uInt16)3002)
+#define DEFAULTFONT_CJK_HEADING ((sal_uInt16)3003)
+#define DEFAULTFONT_CJK_DISPLAY ((sal_uInt16)3004)
+#define DEFAULTFONT_CTL_TEXT ((sal_uInt16)4000)
+#define DEFAULTFONT_CTL_PRESENTATION ((sal_uInt16)4001)
+#define DEFAULTFONT_CTL_SPREADSHEET ((sal_uInt16)4002)
+#define DEFAULTFONT_CTL_HEADING ((sal_uInt16)4003)
+#define DEFAULTFONT_CTL_DISPLAY ((sal_uInt16)4004)
+
+UNOTOOLS_DLLPUBLIC OUString GetNextFontToken( const OUString& rTokenStr, sal_Int32& rIndex );
+
+UNOTOOLS_DLLPUBLIC void GetEnglishSearchFontName( OUString& rName );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/fontoptions.hxx b/include/unotools/fontoptions.hxx
new file mode 100644
index 000000000000..d37423138e00
--- /dev/null
+++ b/include/unotools/fontoptions.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_unotools_FONTOPTIONS_HXX
+#define INCLUDED_unotools_FONTOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtFontOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about font features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtFontOptions : public utl::detail::Options
+{
+ public:
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtFontOptions();
+ virtual ~SvtFontOptions();
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Font"
+ @descr These values defines different states of font handling.
+
+ ..ReplacementTable..() => Determines if the list of font replacements is applied or not.
+
+ ..FontHistory..() => The last 5 fonts will be shown and the last one will be the
+ first name on the list. These will be displayed in the Font name
+ combo box on the Object bar.
+
+ ..FontWYSIWYG..() => With this option the names of the selectable fonts
+ (for example, the fonts in the Font field in the object bar)
+ will be formatted as the current font.
+
+ @seealso -
+
+ @param -
+ @return -
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsFontHistoryEnabled ( ) const ;
+ void EnableFontHistory ( sal_Bool bState ) ;
+
+ sal_Bool IsFontWYSIWYGEnabled ( ) const ;
+ void EnableFontWYSIWYG ( sal_Bool bState ) ;
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class use his own static mutex to be threadsafe.
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& impl_GetOwnStaticMutex();
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtFontOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtFontOptions
+
+#endif // #ifndef INCLUDED_unotools_FONTOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/historyoptions.hxx b/include/unotools/historyoptions.hxx
new file mode 100644
index 000000000000..3e1431544049
--- /dev/null
+++ b/include/unotools/historyoptions.hxx
@@ -0,0 +1,204 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX
+#define INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+/*-************************************************************************************************************//**
+ @descr The method GetList() returns a list of property values.
+ Use follow defines to seperate values by names.
+*//*-*************************************************************************************************************/
+
+#define HISTORY_PROPERTYNAME_URL OUString("URL")
+#define HISTORY_PROPERTYNAME_FILTER OUString("Filter")
+#define HISTORY_PROPERTYNAME_TITLE OUString("Title")
+#define HISTORY_PROPERTYNAME_PASSWORD OUString("Password")
+
+/*-************************************************************************************************************//**
+ @descr You can use these enum values to specify right history if you call ouer interface methods.
+*//*-*************************************************************************************************************/
+
+enum EHistoryType
+{
+ ePICKLIST = 0,
+ eHISTORY = 1,
+ eHELPBOOKMARKS = 2
+};
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtHistoryOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about history features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtHistoryOptions : public utl::detail::Options
+{
+ public:
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtHistoryOptions();
+ virtual ~SvtHistoryOptions();
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/History/..."
+ @descr key "PickList" : The last used documents displayed in the file menu.
+ key "History" : The last opened documents general.
+ *//*-*****************************************************************************************************/
+
+ /*-****************************************************************************************************//**
+ @short set/get max size of specified history
+ @descr Call this methods to get information about max. size of specified list.
+ These value lay down the max count of items in these history. If a new one
+ is add to it the oldest one is deleted automaticly!
+
+ @seealso -
+
+ @param "eHistory" select right history.
+ @param "nSize" is the new max size of specified list. If new size smaller then the old one
+ some oldest entries will be destroyed automaticly!
+ @return Current max size of specified list.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ sal_uInt32 GetSize( EHistoryType eHistory ) const ;
+
+ /*-****************************************************************************************************//**
+ @short clear complete sepcified list
+ @descr Call this methods to clear the whole list. After that GetItemCount() will return 0 ...
+ but GetSize() will return the old value!
+
+ @seealso -
+
+ @param "eHistory" select right history.
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void Clear( EHistoryType eHistory );
+
+ /*-****************************************************************************************************//**
+ @short return complete sepcified list
+ @descr If you will show the whole list call this method to get it completely.
+
+ @seealso -
+
+ @param "eHistory" select right history.
+ @return A list of history items is returned.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > GetList( EHistoryType eHistory ) const ;
+
+ /*-****************************************************************************************************//**
+ @short append a new item to specified list
+ @descr You can append items to a list only - removing isn't allowed for a special item!
+ The oldest entry is deleted automaticly if max size arrived or you can call Clear() ...
+ It exist two different overload methods to do this.
+ One for user which have an complete history item and another one for uncompletly data sets!
+
+ @seealso method SetSize()
+ @seealso method Clear()
+
+ @param "eHistory" select right history.
+ @param "sURL" URL to save in history
+ @param "sFilter" filter name to save in history
+ @param "sTitle" document title to save in history
+ @param "sPassword" password to save in history
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ void AppendItem( EHistoryType eHistory ,
+ const OUString& sURL ,
+ const OUString& sFilter ,
+ const OUString& sTitle ,
+ const OUString& sPassword );
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr Make these class threadsafe.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtHistoryOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtHistoryOptions
+
+#endif // #ifndef INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/idhelper.hxx b/include/unotools/idhelper.hxx
new file mode 100644
index 000000000000..b96c27e8ac0d
--- /dev/null
+++ b/include/unotools/idhelper.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 _UNOTOOLS_ID_HELPER_HXX_
+#define _UNOTOOLS_ID_HELPER_HXX_
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <osl/mutex.hxx>
+#include <comphelper/stl_types.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <tools/debug.hxx>
+
+//.........................................................................
+namespace utl
+{
+//.........................................................................
+
+//=========================================================================
+// to shorten some lines ...
+typedef ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > TypeSequence;
+
+// compare to Sequences of Types
+struct TypeSequenceLess : public ::std::binary_function<TypeSequence, TypeSequence, bool>
+{
+public:
+ inline bool operator() (const TypeSequence& lhs, const TypeSequence& rhs) const
+ {
+ sal_Int32 nLengthLeft = lhs.getLength();
+ sal_Int32 nLengthRight = rhs.getLength();
+
+ // first check the two lengths
+ if (nLengthLeft < nLengthRight)
+ return sal_True;
+ if (nLengthLeft > nLengthRight)
+ return sal_False;
+
+ // both sequences have the same length -> check the type names
+ const ::com::sun::star::uno::Type* pTypesLeft = lhs.getConstArray();
+ const ::com::sun::star::uno::Type* pTypesRight = rhs.getConstArray();
+ for (sal_Int32 i=0; i<nLengthLeft; ++i, ++pTypesLeft, ++pTypesRight)
+ {
+ sal_Int32 nTypeNameCompare = pTypesLeft->getTypeName().compareTo(pTypesRight->getTypeName());
+ if (nTypeNameCompare < 0)
+ return sal_True;
+ if (nTypeNameCompare > 0)
+ return sal_False;
+ }
+
+ // both sequences are equal ...
+ return sal_False;
+ }
+};
+
+// declare the map
+DECLARE_STL_MAP ( TypeSequence,
+ ::cppu::OImplementationId,
+ TypeSequenceLess,
+ MapType2Id
+ );
+
+//.........................................................................
+} // namespace utl
+//.........................................................................
+
+//=========================================================================
+/** defines a helper class for implementing the XTypeProvider::getImplementationId.
+ it maps sequences of ::com::sun::star::uno::Type to implementation ids
+ (which means sequences of bytes).<BR>
+ As there is no possibility to determine the time where the id's are no longer
+ needed (e.g. because the last instance of the class using this mechanism died)
+ the helper is "refcounted", i.e. there are acquire and release methods.
+ To simplify this there is a class classname##Ref which you may want to
+ use as an member of your classes.
+ <BR><BR>
+ As we don't want a global helper class which handles implementation id's
+ of components from all over the office (supposing somebody want's to use this :)
+ this is only a define. Wherever you have a "closed" area (which is small enough
+ and large enough :), see below) where diffenrent components want to use an id helper,
+ define your own one with this macro.<BR>
+ The more classes use this helper, the later redundant map entries will be
+ cleared. The less classes use it, the earlier map entries which may have
+ been reused will be cleared.
+*/
+#define DECLARE_IMPLEMENTATIONID_HELPER(_namespace, classname) \
+namespace _namespace { \
+class classname \
+{ \
+ friend class classname##Ref; \
+ \
+ static sal_Int32 s_nReferenced; \
+ static void* s_pMap; \
+ \
+ static ::osl::Mutex s_aMutex; \
+ \
+public: \
+ static void acquire(); \
+ static void release(); \
+ \
+ static ::com::sun::star::uno::Sequence< sal_Int8 > getImplementationId( \
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >& _rTypes); \
+ \
+private: \
+ static void implCreateMap(); \
+ \
+ classname() { } \
+}; \
+ \
+/*=======================================================================*/ \
+class classname##Ref \
+{ \
+public: \
+ classname##Ref() { classname::acquire(); } \
+ ~classname##Ref() { classname::release(); } \
+}; \
+ \
+} /* _namespace */ \
+ \
+
+/** implement an id helper
+*/
+#define IMPLEMENT_IMPLEMENTATIONID_HELPER(_namespace, classname) \
+namespace _namespace { \
+ \
+/*=======================================================================*/ \
+ \
+sal_Int32 classname::s_nReferenced(0); \
+void* classname::s_pMap = NULL; \
+::osl::Mutex classname::s_aMutex; \
+ \
+/*-----------------------------------------------------------------------*/ \
+void classname::acquire() \
+{ \
+ ::osl::MutexGuard aGuard(s_aMutex); \
+ ++s_nReferenced; \
+} \
+ \
+/*-----------------------------------------------------------------------*/ \
+void classname::release() \
+{ \
+ ::osl::MutexGuard aGuard(s_aMutex); \
+ if (!--s_nReferenced) \
+ { \
+ delete static_cast< ::utl::MapType2Id *>( s_pMap ); \
+ s_pMap = NULL; \
+ } \
+} \
+ \
+/*-----------------------------------------------------------------------*/ \
+::com::sun::star::uno::Sequence< sal_Int8 > classname::getImplementationId( \
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >& _rTypes) \
+{ \
+ ::osl::MutexGuard aGuard(s_aMutex); \
+ DBG_ASSERT(s_nReferenced, \
+ "classname::getImplementationId : you need to hold a reference to this class in order to use it !"); \
+ /* give the calling class a member of type classname##Ref and all is fine .... */ \
+ \
+ implCreateMap(); \
+ \
+ ::utl::MapType2Id* pMap = static_cast< ::utl::MapType2Id *>(s_pMap); \
+ \
+ ::cppu::OImplementationId& rId = (*pMap)[_rTypes]; \
+ /* this will create an entry for the given type sequence, if necessary */ \
+ \
+ return rId.getImplementationId(); \
+} \
+ \
+/*-----------------------------------------------------------------------*/ \
+void classname::implCreateMap() \
+{ \
+ if (s_pMap) \
+ return; \
+ s_pMap = new ::utl::MapType2Id(); \
+} \
+ \
+ \
+} /* _namespace */ \
+ \
+
+
+#endif // _UNOTOOLS_ID_HELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/intlwrapper.hxx b/include/unotools/intlwrapper.hxx
new file mode 100644
index 000000000000..9165be22b414
--- /dev/null
+++ b/include/unotools/intlwrapper.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 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UNOTOOLS_INTLWRAPPER_HXX
+#define _UNOTOOLS_INTLWRAPPER_HXX
+#include <unotools/charclass.hxx>
+#include <unotools/localedatawrapper.hxx>
+#include <unotools/calendarwrapper.hxx>
+#include <unotools/collatorwrapper.hxx>
+#include <i18nlangtag/lang.h>
+#include <i18nlangtag/languagetag.hxx>
+
+
+/**
+ A wrapper of I18N wrappers. Using this is more expensive than using some
+ single wrapper classes so use it only if you must pass a single pointer
+ without knowing in advance what is needed, e.g. for
+ SfxPoolItem::GetPresentation(). Remember that this wrapper was only created
+ for convenience to bypass some oddities, if possible don't use it. <p>
+
+ Implemented are only the const get...() methods of the wrappers, which are
+ loaded on demand, for consistency reasons no change of locale is possible.
+ Only default calendar and default collator are supported. <p>
+
+ One exception though is the calendar wrapper: to be able to set a value and
+ retrieve calendar values it is not const, so methods using this should
+ reset the calendar to the previous value if it isn't sure where the
+ IntlWrapper did come from. <p>
+ */
+class UNOTOOLS_DLLPUBLIC IntlWrapper
+{
+private:
+
+ LanguageTag maLanguageTag;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+
+ LocaleDataWrapper* pLocaleData;
+ CollatorWrapper* pCollator;
+ CollatorWrapper* pCaseCollator;
+
+ void ImplNewLocaleData() const;
+ void ImplNewCollator( sal_Bool bCaseSensitive ) const;
+
+
+public:
+ IntlWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
+ const LanguageTag& rLanguageTag
+ );
+ IntlWrapper(
+ const LanguageTag& rLanguageTag
+ );
+ ~IntlWrapper();
+
+ const LanguageTag& getLanguageTag() const { return maLanguageTag; }
+
+ const LocaleDataWrapper* getLocaleData() const
+ {
+ if ( !pLocaleData )
+ ImplNewLocaleData();
+ return pLocaleData;
+ }
+ /// case insensitive collator, simple IGNORE_CASE
+ const CollatorWrapper* getCollator() const
+ {
+ if ( !pCollator )
+ ImplNewCollator( sal_False );
+ return pCollator;
+ }
+ /// case sensitive collator
+ const CollatorWrapper* getCaseCollator() const
+ {
+ if ( !pCaseCollator )
+ ImplNewCollator( sal_True );
+ return pCaseCollator;
+ }
+};
+
+#endif // _UNOTOOLS_INTLWRAPPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/itemholderbase.hxx b/include/unotools/itemholderbase.hxx
new file mode 100644
index 000000000000..831cba4a4a72
--- /dev/null
+++ b/include/unotools/itemholderbase.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_unotools_ITEMHOLDERBASE_HXX_
+#define INCLUDED_unotools_ITEMHOLDERBASE_HXX_
+
+#include <vector>
+#include <osl/mutex.hxx>
+
+namespace utl { namespace detail { class Options; } }
+
+
+struct ItemHolderMutexBase
+{
+ ::osl::Mutex m_aLock;
+};
+
+enum EItem
+{
+ E_ACCESSIBILITYOPTIONS , // 2
+ E_ADDXMLTOSTORAGEOPTIONS , //
+ E_APEARCFG , // 2
+
+ E_CJKOPTIONS , // 2
+ E_CMDOPTIONS , //
+ E_COLORCFG , // 2
+ E_COMPATIBILITY , //
+ E_CTLOPTIONS , // 2
+
+ E_DEFAULTOPTIONS , //
+ E_DYNAMICMENUOPTIONS , //
+
+ E_EVENTCFG , //
+ E_EXTENDEDSECURITYOPTIONS , //
+
+ E_FLTRCFG , //
+ E_FONTOPTIONS , //
+ E_FONTSUBSTCONFIG , // 2
+
+ E_HELPOPTIONS , // 2
+ E_HISTORYOPTIONS , //
+
+ E_LANGUAGEOPTIONS , // 2
+ E_LINGUCFG , //
+ E_LOCALISATIONOPTIONS , //
+
+ E_MENUOPTIONS , //
+ E_MISCCFG , // 2
+ E_MISCOPTIONS , //
+ E_MODULEOPTIONS , //
+
+ E_OPTIONSDLGOPTIONS , //
+
+ E_PATHOPTIONS , //
+ E_PRINTOPTIONS , // 2
+ E_PRINTFILEOPTIONS , // 2
+ E_PRINTWARNINGOPTIONS , //
+
+ E_REGOPTIONS , //
+
+ E_SAVEOPTIONS , //
+ E_SEARCHOPT , //
+ E_SECURITYOPTIONS , //
+ E_SYSLOCALEOPTIONS , // 2
+
+ E_USEROPTIONS , // 2
+
+ E_VIEWOPTIONS_DIALOG , //
+ E_VIEWOPTIONS_TABDIALOG , //
+ E_VIEWOPTIONS_TABPAGE , //
+ E_VIEWOPTIONS_WINDOW //
+};
+
+struct TItemInfo
+{
+ TItemInfo()
+ : pItem(0)
+ {}
+
+ utl::detail::Options * pItem;
+ EItem eItem;
+};
+
+typedef ::std::vector< TItemInfo > TItems;
+
+#endif // INCLUDED_unotools_ITEMHOLDERBASE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/lingucfg.hxx b/include/unotools/lingucfg.hxx
new file mode 100644
index 000000000000..1dc24c605702
--- /dev/null
+++ b/include/unotools/lingucfg.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 _unotools_LINGUCFG_HXX_
+#define _unotools_LINGUCFG_HXX_
+
+#include "unotools/unotoolsdllapi.h"
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Any.h>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/util/XChangesBatch.hpp>
+#include <tools/solar.h>
+#include <rtl/ustring.hxx>
+#include <unotools/configitem.hxx>
+#include <osl/mutex.hxx>
+#include <unotools/options.hxx>
+#include <i18nlangtag/lang.h>
+
+#include <vector>
+
+class SvtLinguConfigItem;
+
+//////////////////////////////////////////////////////////////////////
+
+struct UNOTOOLS_DLLPUBLIC SvtLinguOptions
+{
+ ::com::sun::star::uno::Sequence< OUString > aActiveDics;
+ ::com::sun::star::uno::Sequence< OUString > aActiveConvDics;
+
+ sal_Bool bROActiveDics;
+ sal_Bool bROActiveConvDics;
+
+ // Hyphenator service specific options
+ sal_Int16 nHyphMinLeading,
+ nHyphMinTrailing,
+ nHyphMinWordLength;
+
+ sal_Bool bROHyphMinLeading,
+ bROHyphMinTrailing,
+ bROHyphMinWordLength;
+
+ // misc options (non-service specific)
+ sal_Int16 nDefaultLanguage;
+ sal_Int16 nDefaultLanguage_CJK;
+ sal_Int16 nDefaultLanguage_CTL;
+
+ sal_Bool bRODefaultLanguage;
+ sal_Bool bRODefaultLanguage_CJK;
+ sal_Bool bRODefaultLanguage_CTL;
+
+ // spelling options (non-service specific)
+ sal_Bool bIsSpellSpecial;
+ sal_Bool bIsSpellAuto;
+ sal_Bool bIsSpellReverse;
+
+ sal_Bool bROIsSpellSpecial;
+ sal_Bool bROIsSpellAuto;
+ sal_Bool bROIsSpellReverse;
+
+ // hyphenation options (non-service specific)
+ sal_Bool bIsHyphSpecial;
+ sal_Bool bIsHyphAuto;
+
+ sal_Bool bROIsHyphSpecial;
+ sal_Bool bROIsHyphAuto;
+
+ // common to SpellChecker, Hyphenator and Thesaurus service
+ sal_Bool bIsUseDictionaryList;
+ sal_Bool bIsIgnoreControlCharacters;
+
+ sal_Bool bROIsUseDictionaryList;
+ sal_Bool bROIsIgnoreControlCharacters;
+
+ // SpellChecker service specific options
+ sal_Bool bIsSpellWithDigits,
+ bIsSpellUpperCase,
+ bIsSpellCapitalization;
+
+ sal_Bool bROIsSpellWithDigits,
+ bROIsSpellUpperCase,
+ bROIsSpellCapitalization;
+
+ // text conversion specific options
+ sal_Bool bIsIgnorePostPositionalWord;
+ sal_Bool bIsAutoCloseDialog;
+ sal_Bool bIsShowEntriesRecentlyUsedFirst;
+ sal_Bool bIsAutoReplaceUniqueEntries;
+ sal_Bool bIsDirectionToSimplified;
+ sal_Bool bIsUseCharacterVariants;
+ sal_Bool bIsTranslateCommonTerms;
+ sal_Bool bIsReverseMapping;
+
+ sal_Bool bROIsIgnorePostPositionalWord;
+ sal_Bool bROIsAutoCloseDialog;
+ sal_Bool bROIsShowEntriesRecentlyUsedFirst;
+ sal_Bool bROIsAutoReplaceUniqueEntries;
+ sal_Bool bROIsDirectionToSimplified;
+ sal_Bool bROIsUseCharacterVariants;
+ sal_Bool bROIsTranslateCommonTerms;
+ sal_Bool bROIsReverseMapping;
+
+ // check value need to determine if the configuration needs to updatet
+ // or not (used for a quick check if data files have been changed/added
+ // or deleted
+ sal_Int32 nDataFilesChangedCheckValue;
+ sal_Bool bRODataFilesChangedCheckValue;
+
+ sal_Bool bIsGrammarAuto;
+ sal_Bool bIsGrammarInteractive;
+
+ sal_Bool bROIsGrammarAuto;
+ sal_Bool bROIsGrammarInteractive;
+
+ SvtLinguOptions();
+};
+
+//////////////////////////////////////////////////////////////////////
+
+struct UNOTOOLS_DLLPUBLIC SvtLinguConfigDictionaryEntry
+{
+ // the URL's pointing to the location of the files the dictionary consists of
+ com::sun::star::uno::Sequence< OUString > aLocations;
+ // the name of the dictionary format implement
+ OUString aFormatName;
+ // the list of languages (ISO names) the dictionary can be used for
+ com::sun::star::uno::Sequence< OUString > aLocaleNames;
+};
+
+//////////////////////////////////////////////////////////////////////
+
+class UNOTOOLS_DLLPUBLIC SvtLinguConfig: public utl::detail::Options
+{
+ // returns static object
+ UNOTOOLS_DLLPRIVATE SvtLinguConfigItem & GetConfigItem();
+
+ SvtLinguConfigItem & GetConfigItem() const { return const_cast< SvtLinguConfig * >( this )->GetConfigItem(); }
+
+ // configuration update access for the 'Linguistic' main node
+ mutable com::sun::star::uno::Reference< com::sun::star::util::XChangesBatch > m_xMainUpdateAccess;
+
+ com::sun::star::uno::Reference< com::sun::star::util::XChangesBatch > GetMainUpdateAccess() const;
+
+ com::sun::star::uno::Sequence< OUString > GetCurrentOrLastActiveDicts_Impl( const OUString &rPropName ) const;
+ void SetCurrentOrLastActiveDicts_Impl( const OUString &rPropName, const com::sun::star::uno::Sequence< OUString > &rDictionaries ) const;
+
+ OUString GetVendorImageUrl_Impl( const OUString &rServiceImplName, const OUString &rImageName ) const;
+
+ // disallow copy-constructor and assignment-operator for now
+ SvtLinguConfig( const SvtLinguConfig & );
+ SvtLinguConfig & operator = ( const SvtLinguConfig & );
+
+public:
+ SvtLinguConfig();
+ virtual ~SvtLinguConfig();
+
+ //
+ // borrowed from utl::ConfigItem
+ //
+ com::sun::star::uno::Sequence< OUString >
+ GetNodeNames( const OUString &rNode );
+ //
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any >
+ GetProperties(
+ const com::sun::star::uno::Sequence< OUString > &rNames );
+ //
+ sal_Bool
+ ReplaceSetProperties(
+ const OUString &rNode,
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > rValues );
+
+ com::sun::star::uno::Any
+ GetProperty( const OUString &rPropertyName ) const;
+ com::sun::star::uno::Any
+ GetProperty( sal_Int32 nPropertyHandle ) const;
+
+ sal_Bool SetProperty( const OUString &rPropertyName,
+ const com::sun::star::uno::Any &rValue );
+ sal_Bool SetProperty( sal_Int32 nPropertyHandle,
+ const com::sun::star::uno::Any &rValue );
+
+ sal_Bool GetOptions( SvtLinguOptions &rOptions ) const;
+
+ sal_Bool IsReadOnly( const OUString &rPropertyName ) const;
+
+ //!
+ //! the following functions work on the 'ServiceManager' sub node of the
+ //! linguistic configuration only
+ //!
+ sal_Bool GetElementNamesFor( const OUString &rNodeName, com::sun::star::uno::Sequence< OUString > &rElementNames ) const;
+ //
+ sal_Bool GetSupportedDictionaryFormatsFor( const OUString &rSetName, const OUString &rSetEntry, com::sun::star::uno::Sequence< OUString > &rFormatList ) const;
+
+ sal_Bool GetDictionaryEntry( const OUString &rNodeName, SvtLinguConfigDictionaryEntry &rDicEntry ) const;
+
+ com::sun::star::uno::Sequence< OUString > GetDisabledDictionaries() const;
+
+ std::vector< SvtLinguConfigDictionaryEntry > GetActiveDictionariesByFormat( const OUString &rFormatName );
+
+ // functions returning file URLs to the respective images (if found) and empty string otherwise
+ OUString GetSpellAndGrammarContextSuggestionImage( const OUString &rServiceImplName ) const;
+ OUString GetSpellAndGrammarContextDictionaryImage( const OUString &rServiceImplName ) const;
+ OUString GetSynonymsContextImage( const OUString &rServiceImplName ) const;
+
+ bool HasGrammarChecker() const;
+};
+
+//////////////////////////////////////////////////////////////////////
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/linguprops.hxx b/include/unotools/linguprops.hxx
new file mode 100644
index 000000000000..85cf64b3d31c
--- /dev/null
+++ b/include/unotools/linguprops.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 _unotools_LINGUPROPS_HXX_
+#define _unotools_LINGUPROPS_HXX_
+
+
+// UNO property names for general options
+#define UPN_IS_GERMAN_PRE_REFORM "IsGermanPreReform" /*! deprecated #i91949 !*/
+#define UPN_IS_USE_DICTIONARY_LIST "IsUseDictionaryList"
+#define UPN_IS_IGNORE_CONTROL_CHARACTERS "IsIgnoreControlCharacters"
+#define UPN_ACTIVE_DICTIONARIES "ActiveDictionaries"
+
+// UNO property names for SpellChecker
+#define UPN_IS_SPELL_UPPER_CASE "IsSpellUpperCase"
+#define UPN_IS_SPELL_WITH_DIGITS "IsSpellWithDigits"
+#define UPN_IS_SPELL_CAPITALIZATION "IsSpellCapitalization"
+
+// UNO property names for Hyphenator
+#define UPN_HYPH_MIN_LEADING "HyphMinLeading"
+#define UPN_HYPH_MIN_TRAILING "HyphMinTrailing"
+#define UPN_HYPH_MIN_WORD_LENGTH "HyphMinWordLength"
+
+// UNO property names for Lingu
+// (those not covered by the SpellChecker and Hyphenator
+// properties and more likely to be used in other modules only)
+#define UPN_DEFAULT_LANGUAGE "DefaultLanguage"
+#define UPN_DEFAULT_LOCALE "DefaultLocale"
+#define UPN_DEFAULT_LOCALE_CJK "DefaultLocale_CJK"
+#define UPN_DEFAULT_LOCALE_CTL "DefaultLocale_CTL"
+#define UPN_IS_HYPH_AUTO "IsHyphAuto"
+#define UPN_IS_HYPH_SPECIAL "IsHyphSpecial"
+#define UPN_IS_SPELL_AUTO "IsSpellAuto"
+#define UPN_IS_SPELL_HIDE "IsSpellHide" /*! deprecated #i91949 !*/
+#define UPN_IS_SPELL_IN_ALL_LANGUAGES "IsSpellInAllLanguages" /*! deprecated #i91949 !*/
+#define UPN_IS_SPELL_SPECIAL "IsSpellSpecial"
+#define UPN_IS_WRAP_REVERSE "IsWrapReverse"
+#define UPN_DATA_FILES_CHANGED_CHECK_VALUE "DataFilesChangedCheckValue"
+
+// UNO property names for text conversion options
+#define UPN_ACTIVE_CONVERSION_DICTIONARIES "ActiveConversionDictionaries"
+#define UPN_IS_IGNORE_POST_POSITIONAL_WORD "IsIgnorePostPositionalWord"
+#define UPN_IS_AUTO_CLOSE_DIALOG "IsAutoCloseDialog"
+#define UPN_IS_SHOW_ENTRIES_RECENTLY_USED_FIRST "IsShowEntriesRecentlyUsedFirst"
+#define UPN_IS_AUTO_REPLACE_UNIQUE_ENTRIES "IsAutoReplaceUniqueEntries"
+#define UPN_IS_DIRECTION_TO_SIMPLIFIED "IsDirectionToSimplified"
+#define UPN_IS_USE_CHARACTER_VARIANTS "IsUseCharacterVariants"
+#define UPN_IS_TRANSLATE_COMMON_TERMS "IsTranslateCommonTerms"
+#define UPN_IS_REVERSE_MAPPING "IsReverseMapping"
+
+// new UNO propertynames to be used with 'dictionaries as extensions'
+#define UPN_DICTIONARIES "Dictionaries"
+#define UPN_SPELL_CHECKERS "SpellCheckers"
+#define UPN_HYPHENATORS "Hyphenators"
+#define UPN_THESAURI "Thesauri"
+#define UPN_CURRENT_ACTIVE_DICTIONARIES "CurrentActiveDictionaries"
+#define UPN_LAST_ACTIVE_DICTIONARIES "LastActiveDictionaries"
+
+#define UPN_IS_GRAMMAR_AUTO "IsAutoGrammarCheck"
+#define UPN_IS_GRAMMAR_INTERACTIVE "IsInteractiveGrammarCheck"
+
+// uno property handles
+#define UPH_IS_GERMAN_PRE_REFORM 0
+#define UPH_IS_USE_DICTIONARY_LIST 1
+#define UPH_IS_IGNORE_CONTROL_CHARACTERS 2
+#define UPH_IS_SPELL_UPPER_CASE 3
+#define UPH_IS_SPELL_WITH_DIGITS 4
+#define UPH_IS_SPELL_CAPITALIZATION 5
+#define UPH_HYPH_MIN_LEADING 6
+#define UPH_HYPH_MIN_TRAILING 7
+#define UPH_HYPH_MIN_WORD_LENGTH 8
+#define UPH_DEFAULT_LOCALE 9
+#define UPH_IS_SPELL_AUTO 10
+#define UPH_IS_SPELL_HIDE 11
+#define UPH_IS_SPELL_IN_ALL_LANGUAGES 12
+#define UPH_IS_SPELL_SPECIAL 13
+#define UPH_IS_HYPH_AUTO 14
+#define UPH_IS_HYPH_SPECIAL 15
+#define UPH_IS_WRAP_REVERSE 16
+#define UPH_DATA_FILES_CHANGED_CHECK_VALUE 17
+#define UPH_DEFAULT_LANGUAGE 21
+#define UPH_DEFAULT_LOCALE_CJK 22
+#define UPH_DEFAULT_LOCALE_CTL 23
+#define UPH_ACTIVE_DICTIONARIES 24
+#define UPH_ACTIVE_CONVERSION_DICTIONARIES 25
+#define UPH_IS_IGNORE_POST_POSITIONAL_WORD 26
+#define UPH_IS_AUTO_CLOSE_DIALOG 27
+#define UPH_IS_SHOW_ENTRIES_RECENTLY_USED_FIRST 28
+#define UPH_IS_AUTO_REPLACE_UNIQUE_ENTRIES 29
+#define UPH_IS_DIRECTION_TO_SIMPLIFIED 30
+#define UPH_IS_USE_CHARACTER_VARIANTS 31
+#define UPH_IS_TRANSLATE_COMMON_TERMS 32
+#define UPH_IS_REVERSE_MAPPING 33
+#define UPH_IS_GRAMMAR_AUTO 34
+#define UPH_IS_GRAMMAR_INTERACTIVE 35
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/localedatawrapper.hxx b/include/unotools/localedatawrapper.hxx
new file mode 100644
index 000000000000..a198163831f7
--- /dev/null
+++ b/include/unotools/localedatawrapper.hxx
@@ -0,0 +1,362 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX
+#define _UNOTOOLS_LOCALEDATAWRAPPER_HXX
+
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+#include <com/sun/star/i18n/XLocaleData4.hpp>
+#include <com/sun/star/i18n/LocaleItem.hpp>
+#include <com/sun/star/i18n/reservedWords.hpp>
+#include <rtl/ustring.hxx>
+#include <i18nlangtag/languagetag.hxx>
+#include <unotools/readwritemutexguard.hxx>
+#include "unotools/unotoolsdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+}}}
+class Date;
+class Time;
+class CalendarWrapper;
+
+
+enum DateFormat {
+ MDY,
+ DMY,
+ YMD
+};
+
+
+enum MeasurementSystem {
+ MEASURE_METRIC,
+ MEASURE_US
+};
+
+
+class UNOTOOLS_DLLPUBLIC LocaleDataWrapper : private boost::noncopyable
+{
+ static sal_uInt8 nLocaleDataChecking; // 0:=dontknow, 1:=yes, 2:=no
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData4 > xLD;
+ LanguageTag maLanguageTag;
+ ::boost::shared_ptr< ::com::sun::star::i18n::Calendar2 > xDefaultCalendar;
+ ::com::sun::star::i18n::LocaleDataItem aLocaleDataItem;
+ ::com::sun::star::uno::Sequence< OUString > aReservedWordSeq;
+ ::com::sun::star::uno::Sequence< OUString > aDateAcceptancePatterns;
+ ::com::sun::star::uno::Sequence< sal_Int32 > aGrouping;
+ // cached items
+ OUString aLocaleItem[::com::sun::star::i18n::LocaleItem::COUNT];
+ OUString aReservedWord[::com::sun::star::i18n::reservedWords::COUNT];
+ OUString aCurrSymbol;
+ OUString aCurrBankSymbol;
+ int nDateFormat;
+ int nLongDateFormat;
+ sal_uInt16 nCurrPositiveFormat;
+ sal_uInt16 nCurrNegativeFormat;
+ sal_uInt16 nCurrDigits;
+ sal_Bool bLocaleDataItemValid;
+ sal_Bool bReservedWordValid;
+ mutable ::utl::ReadWriteMutex aMutex;
+
+ // dummies, to be implemented or provided by XML locale data
+ sal_Unicode cCurrZeroChar;
+
+ // whenever Locale changes
+ void invalidateData();
+
+ void getOneLocaleItemImpl( sal_Int16 nItem );
+ const OUString& getOneLocaleItem( sal_Int16 nItem ) const;
+
+ void getOneReservedWordImpl( sal_Int16 nWord );
+ const OUString& getOneReservedWord( sal_Int16 nWord ) const;
+
+ void getCurrSymbolsImpl();
+ void getCurrFormatsImpl();
+
+ void scanCurrFormatImpl( const OUString& rCode,
+ sal_Int32 nStart, sal_Int32& nSign,
+ sal_Int32& nPar, sal_Int32& nNum,
+ sal_Int32& nBlank, sal_Int32& nSym );
+
+ void getDateFormatsImpl();
+ DateFormat scanDateFormatImpl( const OUString& rCode );
+
+ void getDefaultCalendarImpl();
+
+ sal_Unicode* ImplAddFormatNum( sal_Unicode* pBuf,
+ sal_Int64 nNumber, sal_uInt16 nDecimals,
+ sal_Bool bUseThousandSep, sal_Bool bTrailingZeros ) const;
+
+ void getDigitGroupingImpl();
+
+public:
+ LocaleDataWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
+ const LanguageTag& rLanguageTag
+ );
+ LocaleDataWrapper(
+ const LanguageTag& rLanguageTag
+ );
+ ~LocaleDataWrapper();
+
+ /** Get the service factory, meant to be able to create a CalendarWrapper
+ from a LocaleDataWrapper. Note that the service factory may be
+ non-existent if this LocaleDataWrapper was created without one and
+ lives "on the grassland". The CalendarWrapper ctor can handle that
+ though. */
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > & getComponentContext()
+ const { return m_xContext; }
+
+ /// set a new Locale to request
+ void setLanguageTag( const LanguageTag& rLanguageTag );
+
+ /// get current requested Locale
+ const LanguageTag& getLanguageTag() const;
+
+ /// get current loaded Locale, which might differ from the requested Locale
+ LanguageTag getLoadedLanguageTag() const;
+
+
+ // Wrapper implementations of service LocaleData
+
+ ::com::sun::star::i18n::LanguageCountryInfo getLanguageCountryInfo() const;
+ ::com::sun::star::i18n::LocaleDataItem getLocaleItem() const;
+ /// NOTE: this wraps XLocaleData3::getAllCalendars2() in fact.
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::Calendar2 > getAllCalendars() const;
+ /// NOTE: this wraps XLocaleData2::getAllCurrencies2() in fact.
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::Currency2 > getAllCurrencies() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::FormatElement > getAllFormats() const;
+ ::com::sun::star::i18n::ForbiddenCharacters getForbiddenCharacters() const;
+ ::com::sun::star::uno::Sequence< OUString > getReservedWord() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > getAllInstalledLocaleNames() const;
+ ::com::sun::star::uno::Sequence< OUString > getDateAcceptancePatterns() const;
+
+ /** Override locale's date acceptance patterns.
+ An empty sequence resets the patterns to the locale's pattern sequence.
+ */
+ void setDateAcceptancePatterns( const ::com::sun::star::uno::Sequence< OUString > & rPatterns );
+
+ /// same as the wrapper implementation but static
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > getInstalledLocaleNames();
+
+ /** Get LanguageTypes for all installed locales which are unambiguous
+ convertible back and forth between locale ISO strings and MS-LCID
+ LanguageType. Upon the first time the function is called when
+ locale data checking is enabled, messages are shown for locales not
+ matching, excluding already known problems.
+ (e.g. used in number formatter dialog init)
+ */
+ static ::com::sun::star::uno::Sequence< sal_uInt16 > getInstalledLanguageTypes();
+
+ /// maps the LocaleData string to the International enum
+ MeasurementSystem mapMeasurementStringToEnum( const OUString& rMS ) const;
+
+ /// Convenience method to obtain the default calendar.
+ const ::boost::shared_ptr< ::com::sun::star::i18n::Calendar2 > getDefaultCalendar() const;
+
+ /// Convenience method to obtain the day names of the default calendar.
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > getDefaultCalendarDays() const;
+
+ /// Convenience method to obtain the month names of the default calendar.
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > getDefaultCalendarMonths() const;
+
+ /** Obtain digit grouping. The usually known grouping by thousands (#,###)
+ is actually only one of possible groupings. Another one, for example,
+ used in India is group by 3 and then by 2 indefinitely (#,##,###). The
+ integer sequence returned here specifies grouping from right to left
+ (!), with a 0 entry designating the end of rules and the previous value
+ to be repeated indefinitely. Hence the sequence {3,0} specifies the
+ usual grouping by thousands, whereas the sequence {3,2,0} specifies
+ Indian grouping. The sal_Int32* getConstArray() can be passed directly
+ to the ::rtl::math::doubleToString() methods as argument for the
+ pGroups parameter. */
+ const ::com::sun::star::uno::Sequence< sal_Int32 > getDigitGrouping() const;
+
+ // Functionality of class International methods, LocaleItem
+
+ const OUString& getDateSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::DATE_SEPARATOR ); }
+ const OUString& getNumThousandSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::THOUSAND_SEPARATOR ); }
+ const OUString& getNumDecimalSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::DECIMAL_SEPARATOR ); }
+ const OUString& getTimeSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::TIME_SEPARATOR ); }
+ const OUString& getTime100SecSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::TIME_100SEC_SEPARATOR ); }
+ const OUString& getListSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LIST_SEPARATOR ); }
+ const OUString& getQuotationMarkStart() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::SINGLE_QUOTATION_START ); }
+ const OUString& getQuotationMarkEnd() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::SINGLE_QUOTATION_END ); }
+ const OUString& getDoubleQuotationMarkStart() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::DOUBLE_QUOTATION_START ); }
+ const OUString& getDoubleQuotationMarkEnd() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::DOUBLE_QUOTATION_END ); }
+ const OUString& getMeasurementSystem() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::MEASUREMENT_SYSTEM ); }
+ MeasurementSystem getMeasurementSystemEnum() const
+ { return mapMeasurementStringToEnum( getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::MEASUREMENT_SYSTEM ) ); }
+ const OUString& getTimeAM() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::TIME_AM ); }
+ const OUString& getTimePM() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::TIME_PM ); }
+ const OUString& getLongDateDayOfWeekSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LONG_DATE_DAY_OF_WEEK_SEPARATOR ); }
+ const OUString& getLongDateDaySep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LONG_DATE_DAY_SEPARATOR ); }
+ const OUString& getLongDateMonthSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LONG_DATE_MONTH_SEPARATOR ); }
+ const OUString& getLongDateYearSep() const
+ { return getOneLocaleItem( ::com::sun::star::i18n::LocaleItem::LONG_DATE_YEAR_SEPARATOR ); }
+
+ // currency
+ const OUString& getCurrSymbol() const;
+ const OUString& getCurrBankSymbol() const;
+ sal_uInt16 getCurrPositiveFormat() const;
+ sal_uInt16 getCurrNegativeFormat() const;
+ sal_uInt16 getCurrDigits() const;
+
+ // simple date and time formatting
+ DateFormat getDateFormat() const;
+ DateFormat getLongDateFormat() const;
+ /// only numerical values of Gregorian calendar
+ OUString getDate( const Date& rDate ) const;
+ OUString getTime( const Time& rTime, sal_Bool bSec = sal_True,
+ sal_Bool b100Sec = sal_False ) const;
+ OUString getDuration( const Time& rTime,
+ sal_Bool bSec = sal_True, sal_Bool b100Sec = sal_False ) const;
+
+ /** The CalendarWrapper already <b>MUST</b>
+ have loaded a calendar.
+ @param nDisplayDayOfWeek
+ 0 := abbreviated name
+ 1 := full name
+ @param bDayOfMonthWithLeadingZero
+ <FALSE/> := without leading zero
+ <TRUE/> := with leading zero if <10
+ @param nDisplayMonth
+ 0 := abbreviated name
+ 1 := full name
+ @param bTwoDigitYear
+ <FALSE/> := full year
+ <TRUE/> := year % 100
+ */
+ OUString getLongDate( const Date& rDate,
+ CalendarWrapper& rCal,
+ sal_Int16 nDisplayDayOfWeek = 1,
+ sal_Bool bDayOfMonthWithLeadingZero = sal_False,
+ sal_Int16 nDisplayMonth = 1,
+ sal_Bool bTwoDigitYear = sal_False
+ ) const;
+
+ /** Simple number formatting
+ @param nNumber
+ value * 10**nDecimals
+ @param bTrailingZeros
+ </sal_True> := always display trailing zeros in
+ decimal places, even if integer value.
+ </sal_False> := trailing zeros are only displayed
+ if the value is not an integer value.
+ */
+ OUString getNum( sal_Int64 nNumber, sal_uInt16 nDecimals,
+ sal_Bool bUseThousandSep = sal_True,
+ sal_Bool bTrailingZeros = sal_True ) const;
+
+ /// "Secure" currency formatted string.
+ OUString getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
+ const OUString& rCurrencySymbol,
+ sal_Bool bUseThousandSep = sal_True ) const;
+ /** Default currency formatted string, use with
+ care as default currency may change in any
+ locale, for example, DEM -> EUR */
+ OUString getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
+ sal_Bool bUseThousandSep = sal_True ) const
+ { return getCurr( nNumber, nDecimals,
+ getCurrSymbol(), bUseThousandSep ); }
+
+ // dummy returns, to be implemented
+ inline sal_Unicode getCurrZeroChar() const
+ { return cCurrZeroChar; }
+ inline sal_Bool isNumLeadingZero() const
+ { return sal_True; }
+ /// standard decimal places
+ inline sal_uInt16 getNumDigits() const
+ { return 2; }
+ inline sal_Bool isNumTrailingZeros() const
+ { return sal_True; }
+
+
+ // reserved words
+
+ const OUString& getTrueWord() const
+ { return getOneReservedWord( ::com::sun::star::i18n::reservedWords::TRUE_WORD ); }
+ const OUString& getFalseWord() const
+ { return getOneReservedWord( ::com::sun::star::i18n::reservedWords::FALSE_WORD ); }
+ /// return a quarter string matching nQuarter (0..3) => "1st quarter" .. "4th quarter"
+ const OUString& getQuarterWord( sal_Int16 nQuarter ) const
+ { return getOneReservedWord( ::com::sun::star::i18n::reservedWords::QUARTER1_WORD + nQuarter ); }
+ const OUString& getAboveWord() const
+ { return getOneReservedWord( ::com::sun::star::i18n::reservedWords::ABOVE_WORD ); }
+ const OUString& getBelowWord() const
+ { return getOneReservedWord( ::com::sun::star::i18n::reservedWords::BELOW_WORD ); }
+ /// return a quarter abbreviation string matching nQuarter (0..3) => "Q1" .. "Q2"
+ const OUString& getQuarterAbbreviation( sal_Int16 nQuarter ) const
+ { return getOneReservedWord( ::com::sun::star::i18n::reservedWords::QUARTER1_ABBREVIATION + nQuarter ); }
+
+ /** Return whether locale data checks are enabled.
+ Checks are enabled if the environment variable
+ OOO_ENABLE_LOCALE_DATA_CHECKS is set to 'Y' or 'Yes' (or any other
+ string starting with 'Y') or '1'.
+ Also used in conjunction with the number formatter. */
+ static inline bool areChecksEnabled()
+ {
+ if (nLocaleDataChecking == 0)
+ evaluateLocaleDataChecking();
+ return nLocaleDataChecking == 1;
+ }
+
+ /** Append locale info to string, used with locale data checking.
+ A string similar to "de_DE requested\n en_US loaded" is appended. */
+ OUString appendLocaleInfo(const OUString& rDebugMsg) const;
+
+ /** Ouput a message during locale data checking. The (UTF-8) string is
+ written to stderr and in a non-product build or if DBG_UTIL is enabled
+ also raised as an assertion message box. */
+ static void outputCheckMessage( const OUString& rMsg );
+ static void outputCheckMessage( const char* pStr);
+
+private:
+
+ const ::com::sun::star::lang::Locale & getMyLocale() const;
+
+ static void evaluateLocaleDataChecking();
+};
+
+
+#endif // _UNOTOOLS_LOCALEDATAWRAPPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/localfilehelper.hxx b/include/unotools/localfilehelper.hxx
new file mode 100644
index 000000000000..4a1864b2f44f
--- /dev/null
+++ b/include/unotools/localfilehelper.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 _UNOTOOLS_LOCALFILEHELPER_HXX
+#define _UNOTOOLS_LOCALFILEHELPER_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include "unotools/unotoolsdllapi.h"
+
+#include <rtl/ustring.hxx>
+#include <tools/string.hxx>
+
+namespace utl
+{
+ class UNOTOOLS_DLLPUBLIC LocalFileHelper
+ {
+ public:
+ /**
+ Converts a "physical" file name into a "UCB compatible" URL ( if possible ).
+ If no UCP is available for the local file system, sal_False and an empty URL is returned.
+ Returning sal_True and an empty URL means that the URL doesn't point to a local file.
+ */
+ static bool ConvertPhysicalNameToURL(const OUString& rName, OUString& rReturn);
+ static sal_Bool ConvertSystemPathToURL( const OUString& rName, const OUString& rBaseURL, OUString& rReturn );
+
+ /**
+ Converts a "UCB compatible" URL into a "physical" file name.
+ If no UCP is available for the local file system, sal_False and an empty file name is returned,
+ otherwise sal_True and a valid URL, because a file name can always be converted if a UCP for the local
+ file system is present ( watch: this doesn't mean that this file really exists! )
+ */
+ static bool ConvertURLToPhysicalName( const OUString& rName, OUString& rReturn );
+ static sal_Bool ConvertURLToSystemPath( const OUString& rName, OUString& rReturn );
+
+ static sal_Bool IsLocalFile(const OUString& rName);
+ static sal_Bool IsFileContent(const OUString& rName);
+
+ static ::com::sun::star::uno::Sequence< OUString >
+ GetFolderContents( const OUString& rFolder, sal_Bool bFolder );
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/localisationoptions.hxx b/include/unotools/localisationoptions.hxx
new file mode 100644
index 000000000000..931d59f1980d
--- /dev/null
+++ b/include/unotools/localisationoptions.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_unotools_LOCALISATIONOPTIONS_HXX
+#define INCLUDED_unotools_LOCALISATIONOPTIONS_HXX
+
+#include <sal/types.h>
+#include "unotools/unotoolsdllapi.h"
+#include <osl/mutex.hxx>
+#include <unotools/options.hxx>
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtLocalisationOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about localisation features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtLocalisationOptions : public utl::detail::Options
+{
+ public:
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtLocalisationOptions();
+ virtual ~SvtLocalisationOptions();
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/View/Localisation/AutoMnemonic"
+ @descr These value specifies if shortcuts should be assigned automatically.
+
+ @seealso -
+
+ @param "bState", new value to set it in configuration.
+ @return The value which represent current state of internal variable.
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsAutoMnemonic ( ) const ;
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/View/Localisation/DialogScale"
+ @descr These value specifies the factor for increasing controls.
+ Value from [0..100] are allowed.
+
+ @ATTENTION These methods don't check for valid or invalid values!
+ Our configuration server can do it ... but these implementation don't get any notifications
+ about wrong commits ...!
+ => If you set an invalid value - nothing will be changed. The information will lost.
+
+ @seealso baseclass ConfigItem
+
+ @param "nScale" new value to set it in configuration.
+ @return The value which represent current state of internal variable.
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ sal_Int32 GetDialogScale( ) const ;
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtLocalisationOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtLocalisationOptions
+
+#endif // #ifndef INCLUDED_unotools_LOCALISATIONOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/misccfg.hxx b/include/unotools/misccfg.hxx
new file mode 100644
index 000000000000..7759b31ed24a
--- /dev/null
+++ b/include/unotools/misccfg.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 _UTL_MISCCFG_HXX
+#define _UTL_MISCCFG_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include "tools/solar.h"
+#include "unotools/options.hxx"
+
+namespace utl
+{
+ class SfxMiscCfg;
+
+class UNOTOOLS_DLLPUBLIC MiscCfg : public detail::Options
+{
+ SfxMiscCfg* pImpl;
+
+public:
+ MiscCfg( );
+ virtual ~MiscCfg( );
+
+ sal_Bool IsNotFoundWarning() const;
+ void SetNotFoundWarning( sal_Bool bSet);
+
+ sal_Bool IsPaperSizeWarning() const;
+ void SetPaperSizeWarning(sal_Bool bSet);
+
+ sal_Bool IsPaperOrientationWarning() const;
+ void SetPaperOrientationWarning( sal_Bool bSet);
+
+ // 0 ... 99
+ sal_Int32 GetYear2000() const;
+ void SetYear2000( sal_Int32 nSet );
+};
+
+}
+
+#endif // _MISCCFG_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/moduleoptions.hxx b/include/unotools/moduleoptions.hxx
new file mode 100644
index 000000000000..75b83b1c0988
--- /dev/null
+++ b/include/unotools/moduleoptions.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_SVTOOLS_MODULEOPTIONS_HXX
+#define INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <salhelper/singletonref.hxx>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <rtl/ustring.hxx>
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <unotools/options.hxx>
+
+#define FEATUREFLAG_BASICIDE 0x00000020
+#define FEATUREFLAG_MATH 0x00000100
+#define FEATUREFLAG_CHART 0x00000200
+#define FEATUREFLAG_CALC 0x00000800
+#define FEATUREFLAG_DRAW 0x00001000
+#define FEATUREFLAG_WRITER 0x00002000
+#define FEATUREFLAG_IMPRESS 0x00008000
+#define FEATUREFLAG_INSIGHT 0x00010000
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+class SvtModuleOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about installation state of modules
+ @descr Use these class to get installation state of different office modules like writer, calc etc
+ Further you can ask for additional information; e.g. name of standard template file, which
+ should be used by corresponding module; or short/long name of these module factory.
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+ @threadsafe yes
+*//*-*************************************************************************************************************/
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtModuleOptions : public utl::detail::Options
+{
+ public:
+
+ enum EModule
+ {
+ E_SWRITER = 0,
+ E_SCALC = 1,
+ E_SDRAW = 2,
+ E_SIMPRESS = 3,
+ E_SMATH = 4,
+ E_SCHART = 5,
+ E_SSTARTMODULE = 6,
+ E_SBASIC = 7,
+ E_SDATABASE = 8,
+ E_SWEB = 9,
+ E_SGLOBAL = 10
+ };
+
+ /*ATTENTION:
+ If you change these enum ... don't forget to change reading/writing and order of configuration values too!
+ See "SvtModuleOptions_Impl::impl_GetSetNames()" and his ctor for further information.
+ */
+ enum EFactory
+ {
+ E_UNKNOWN_FACTORY = -1,
+ E_WRITER = 0,
+ E_WRITERWEB = 1,
+ E_WRITERGLOBAL = 2,
+ E_CALC = 3,
+ E_DRAW = 4,
+ E_IMPRESS = 5,
+ E_MATH = 6,
+ E_CHART = 7,
+ E_STARTMODULE = 8,
+ E_DATABASE = 9,
+ E_BASIC = 10
+
+ };
+
+ public:
+
+ SvtModuleOptions();
+ virtual ~SvtModuleOptions();
+
+ sal_Bool IsModuleInstalled ( EModule eModule ) const;
+ OUString GetModuleName ( EModule eModule ) const;
+ OUString GetFactoryName ( EFactory eFactory ) const;
+ OUString GetFactoryStandardTemplate( EFactory eFactory ) const;
+ OUString GetFactoryEmptyDocumentURL( EFactory eFactory ) const;
+ OUString GetFactoryDefaultFilter ( EFactory eFactory ) const;
+ sal_Bool IsDefaultFilterReadonly ( EFactory eFactory ) const;
+ sal_Int32 GetFactoryIcon ( EFactory eFactory ) const;
+ static sal_Bool ClassifyFactoryByName ( const OUString& sName ,
+ EFactory& eFactory );
+ void SetFactoryStandardTemplate( EFactory eFactory ,
+ const OUString& sTemplate );
+ void SetFactoryDefaultFilter ( EFactory eFactory ,
+ const OUString& sFilter );
+
+ //_______________________________________
+
+ /** @short return the corresponding application ID for the given
+ document service name.
+ */
+ static EFactory ClassifyFactoryByServiceName(const OUString& sName);
+
+ //_______________________________________
+
+ /** @short return the corresponding application ID for the given
+ short name.
+ */
+ static EFactory ClassifyFactoryByShortName(const OUString& sName);
+
+ //_______________________________________
+
+ /** @short return the corresponding application ID for the given properties.
+
+ @descr Because this search base on filters currently (till we have a better solution)
+ a result is not guaranteed everytimes. May a filter does not exists for the specified
+ content (but a FrameLoader which is not bound to any application!) ... or
+ the given properties describe a stream (and we make no deep detection inside here!).
+
+ @attention The module BASIC cant be detected here. Because it does not
+ has an own URL schema.
+
+ @param sURL
+ the complete URL!
+
+ @param lMediaDescriptor
+ additional information
+
+ @return A suitable enum value. See EFactory above.
+ */
+ static EFactory ClassifyFactoryByURL(const OUString& sURL ,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lMediaDescriptor);
+
+ //_______________________________________
+
+ /** @short return the corresponding application ID for the given properties.
+
+ @descr Here we try to use the list of supported service names of the given model
+ to find out the right application module.
+
+ @attention The module BASIC cant be detected here. Because it does not
+ support any model/ctrl/view paradigm.
+
+ @param xModel
+ the document model
+
+ @return A suitable enum value. See EFactory above.
+ */
+ static EFactory ClassifyFactoryByModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel);
+
+ OUString GetDefaultModuleName();
+
+ sal_Bool IsMath () const;
+ sal_Bool IsChart () const;
+ sal_Bool IsCalc () const;
+ sal_Bool IsDraw () const;
+ sal_Bool IsWriter () const;
+ sal_Bool IsImpress () const;
+ sal_Bool IsBasicIDE () const;
+ sal_Bool IsDataBase () const;
+
+ ::com::sun::star::uno::Sequence < OUString > GetAllServiceNames();
+
+ private:
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& impl_GetOwnStaticMutex();
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double defined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtModuleOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtModuleOptions
+
+#endif // #ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/nativenumberwrapper.hxx b/include/unotools/nativenumberwrapper.hxx
new file mode 100644
index 000000000000..252a48d85a13
--- /dev/null
+++ b/include/unotools/nativenumberwrapper.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 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UNOTOOLS_NATIVENUMBERWRAPPER_HXX
+#define _UNOTOOLS_NATIVENUMBERWRAPPER_HXX
+#include <com/sun/star/i18n/XNativeNumberSupplier.hpp>
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+}}}
+
+
+class UNOTOOLS_DLLPUBLIC NativeNumberWrapper
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XNativeNumberSupplier > xNNS;
+ // not implemented, prevent usage
+ NativeNumberWrapper( const NativeNumberWrapper& );
+ NativeNumberWrapper& operator=( const NativeNumberWrapper& );
+
+public:
+ NativeNumberWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext
+ );
+
+ ~NativeNumberWrapper();
+
+ // Wrapper implementations of XNativeNumberSupplier
+
+ OUString getNativeNumberString(
+ const OUString& rNumberString,
+ const ::com::sun::star::lang::Locale& rLocale,
+ sal_Int16 nNativeNumberMode ) const;
+
+ ::com::sun::star::i18n::NativeNumberXmlAttributes convertToXmlAttributes(
+ const ::com::sun::star::lang::Locale& rLocale,
+ sal_Int16 nNativeNumberMode ) const;
+
+ sal_Int16 convertFromXmlAttributes(
+ const ::com::sun::star::i18n::NativeNumberXmlAttributes& rAttr ) const;
+
+};
+
+#endif // _UNOTOOLS_NATIVENUMBERWRAPPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/numberformatcodewrapper.hxx b/include/unotools/numberformatcodewrapper.hxx
new file mode 100644
index 000000000000..82e254e7ea1d
--- /dev/null
+++ b/include/unotools/numberformatcodewrapper.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 _UNOTOOLS_NUMBERFORMATCODEWRAPPER_HXX
+#define _UNOTOOLS_NUMBERFORMATCODEWRAPPER_HXX
+
+#include <com/sun/star/i18n/XNumberFormatCode.hpp>
+#include "unotools/unotoolsdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+}}}
+
+
+class UNOTOOLS_DLLPUBLIC NumberFormatCodeWrapper
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XNumberFormatCode > xNFC;
+ ::com::sun::star::lang::Locale aLocale;
+
+ // not implemented, prevent usage
+ NumberFormatCodeWrapper( const NumberFormatCodeWrapper& );
+ NumberFormatCodeWrapper& operator=( const NumberFormatCodeWrapper& );
+
+public:
+ NumberFormatCodeWrapper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
+ const ::com::sun::star::lang::Locale& rLocale
+ );
+
+ ~NumberFormatCodeWrapper();
+
+
+ /// set a new Locale
+ void setLocale( const ::com::sun::star::lang::Locale& rLocale );
+
+ /// get current Locale
+ const ::com::sun::star::lang::Locale& getLocale() const { return aLocale; }
+
+
+ // Wrapper implementations of class NumberFormatCodeMapper
+
+ ::com::sun::star::i18n::NumberFormatCode getFormatCode( sal_Int16 nFormatIndex ) const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::NumberFormatCode > getAllFormatCode( sal_Int16 nFormatUsage ) const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::NumberFormatCode > getAllFormatCodes() const;
+
+};
+
+#endif // _UNOTOOLS_NUMBERFORMATCODEWRAPPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/options.hxx b/include/unotools/options.hxx
new file mode 100644
index 000000000000..5a37b026fb63
--- /dev/null
+++ b/include/unotools/options.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_unotools_OPTIONS_HXX
+#define INCLUDED_unotools_OPTIONS_HXX
+
+#include "sal/config.h"
+#include "unotools/unotoolsdllapi.h"
+#include <vector>
+
+/*
+ The class utl::detail::Options provides a kind of multiplexer. It implements a ConfigurationListener
+ that is usually registered at a ConfigItem class. At the same time it implements a ConfigurationBroadcaster
+ that allows further ("external") listeners to register.
+ Once the class deriving from Options is notified about
+ configuration changes by the ConfigItem if its content has been changed by calling some of its methods,
+ a call of the Options::NotifyListeners() method will send out notifications to all external listeners.
+*/
+
+namespace utl {
+
+ class ConfigurationBroadcaster;
+
+ // interface for configuration listener
+ class UNOTOOLS_DLLPUBLIC ConfigurationListener
+ {
+ public:
+ virtual ~ConfigurationListener();
+
+ virtual void ConfigurationChanged( ConfigurationBroadcaster* p, sal_uInt32 nHint=0 ) = 0;
+ };
+ typedef ::std::vector< ConfigurationListener* > IMPL_ConfigurationListenerList;
+
+ // complete broadcasting implementation
+ class UNOTOOLS_DLLPUBLIC ConfigurationBroadcaster
+ {
+ IMPL_ConfigurationListenerList* mpList;
+ sal_Int32 m_nBroadcastBlocked; // broadcast only if this is 0
+ sal_uInt32 m_nBlockedHint;
+
+ public:
+ void AddListener( utl::ConfigurationListener* pListener );
+ void RemoveListener( utl::ConfigurationListener* pListener );
+
+ // notify listeners; nHint is an implementation detail of the particular class deriving from ConfigurationBroadcaster
+ void NotifyListeners( sal_uInt32 nHint );
+ ConfigurationBroadcaster();
+ virtual ~ConfigurationBroadcaster();
+ virtual void BlockBroadcasts( bool bBlock );
+ };
+
+namespace detail {
+
+// A base class for the various option classes supported by
+// unotools/source/config/itemholderbase.hxx (which must be public, as it is
+// shared between unotools, svl and svt)
+// It also provides an implementation for a Configuration Listener and inherits a broadcaster implementation
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED Options
+ : public utl::ConfigurationBroadcaster, public utl::ConfigurationListener
+{
+public:
+ Options();
+
+ virtual ~Options() = 0;
+
+private:
+ UNOTOOLS_DLLPRIVATE Options(Options &); // not defined
+ UNOTOOLS_DLLPRIVATE void operator =(Options &); // not defined
+
+protected:
+ virtual void ConfigurationChanged( ::utl::ConfigurationBroadcaster* p, sal_uInt32 nHint=0 );
+};
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/optionsdlg.hxx b/include/unotools/optionsdlg.hxx
new file mode 100644
index 000000000000..ba28032a49ea
--- /dev/null
+++ b/include/unotools/optionsdlg.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_unotools_OPTIONSDLG_HXX
+#define INCLUDED_unotools_OPTIONSDLG_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+class SvtOptionsDlgOptions_Impl;
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtOptionsDialogOptions : public utl::detail::Options
+{
+private:
+ SvtOptionsDlgOptions_Impl* m_pImp;
+
+public:
+ SvtOptionsDialogOptions();
+ virtual ~SvtOptionsDialogOptions();
+
+ sal_Bool IsGroupHidden ( const OUString& _rGroup ) const;
+ sal_Bool IsPageHidden ( const OUString& _rPage,
+ const OUString& _rGroup ) const;
+ sal_Bool IsOptionHidden ( const OUString& _rOption,
+ const OUString& _rPage,
+ const OUString& _rGroup ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/pathoptions.hxx b/include/unotools/pathoptions.hxx
new file mode 100644
index 000000000000..ad1d16d19c79
--- /dev/null
+++ b/include/unotools/pathoptions.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_unotools_PATHOPTIONS_HXX
+#define INCLUDED_unotools_PATHOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <tools/string.hxx>
+#include <i18nlangtag/languagetag.hxx>
+#include <unotools/options.hxx>
+
+#define SVT_SEARCHPATH_DELIMITER ';'
+
+// class SvtPathOptions --------------------------------------------------
+
+class SvtPathOptions_Impl;
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtPathOptions : public utl::detail::Options
+{
+private:
+ SvtPathOptions_Impl* pImp;
+
+public:
+ enum Paths
+ {
+ PATH_ADDIN,
+ PATH_AUTOCORRECT,
+ PATH_AUTOTEXT,
+ PATH_BACKUP,
+ PATH_BASIC,
+ PATH_BITMAP,
+ PATH_CONFIG,
+ PATH_DICTIONARY,
+ PATH_FAVORITES,
+ PATH_FILTER,
+ PATH_GALLERY,
+ PATH_GRAPHIC,
+ PATH_HELP,
+ PATH_LINGUISTIC,
+ PATH_MODULE,
+ PATH_PALETTE,
+ PATH_PLUGIN,
+ PATH_STORAGE,
+ PATH_TEMP,
+ PATH_TEMPLATE,
+ PATH_USERCONFIG,
+ PATH_WORK,
+ PATH_UICONFIG,
+ PATH_FINGERPRINT,
+ PATH_COUNT // should always be the last element
+ };
+
+ SvtPathOptions();
+ virtual ~SvtPathOptions();
+
+ // get the paths, not const because of using a mutex
+ const String& GetAddinPath() const;
+ const String& GetAutoCorrectPath() const;
+ const String& GetAutoTextPath() const;
+ const String& GetBackupPath() const;
+ const String& GetBasicPath() const;
+ const String& GetBitmapPath() const;
+ const String& GetConfigPath() const;
+ const String& GetDictionaryPath() const;
+ const String& GetFavoritesPath() const;
+ const String& GetFilterPath() const;
+ const String& GetGalleryPath() const;
+ const String& GetGraphicPath() const;
+ const String& GetHelpPath() const;
+ const String& GetLinguisticPath() const;
+ const String& GetModulePath() const;
+ const String& GetPalettePath() const;
+ const String& GetPluginPath() const;
+ const String& GetStoragePath() const;
+ const String& GetTempPath() const;
+ const String& GetTemplatePath() const;
+ const String& GetUserConfigPath() const;
+ const String& GetWorkPath() const;
+ const String& GetUIConfigPath() const;
+ const String& GetFingerprintPath() const;
+
+ // set the paths
+ void SetAddinPath( const String& rPath );
+ void SetAutoCorrectPath( const String& rPath );
+ void SetAutoTextPath( const String& rPath );
+ void SetBackupPath( const String& rPath );
+ void SetBasicPath( const String& rPath );
+ void SetBitmapPath( const String& rPath );
+ void SetConfigPath( const String& rPath );
+ void SetDictionaryPath( const String& rPath );
+ void SetFavoritesPath( const String& rPath );
+ void SetFilterPath( const String& rPath );
+ void SetGalleryPath( const String& rPath );
+ void SetGraphicPath( const String& rPath );
+ void SetHelpPath( const String& rPath );
+ void SetLinguisticPath( const String& rPath );
+ void SetModulePath( const String& rPath );
+ void SetPalettePath( const String& rPath );
+ void SetPluginPath( const String& rPath );
+ void SetStoragePath( const String& rPath );
+ void SetTempPath( const String& rPath );
+ void SetTemplatePath( const String& rPath );
+ void SetUserConfigPath( const String& rPath );
+ void SetWorkPath( const String& rPath );
+
+ String SubstituteVariable( const String& rVar ) const;
+ String ExpandMacros( const String& rPath ) const;
+ String UseVariable( const String& rVar ) const;
+ sal_Bool SearchFile( String& rIniFile, Paths ePath = PATH_USERCONFIG );
+ const LanguageTag& GetLanguageTag() const;
+ sal_Bool IsReadonly() const;
+};
+
+#endif // #ifndef INCLUDED_unotools_PATHOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/printwarningoptions.hxx b/include/unotools/printwarningoptions.hxx
new file mode 100644
index 000000000000..61b79ee2eb45
--- /dev/null
+++ b/include/unotools/printwarningoptions.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_unotools_PRINTWARNINGOPTIONS_HXX
+#define INCLUDED_unotools_PRINTWARNINGOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtPrintWarningOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about startup features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtPrintWarningOptions : public utl::detail::Options
+{
+ public:
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtPrintWarningOptions();
+ virtual ~SvtPrintWarningOptions();
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Print/Warning..."
+ @descr These options describe internal states to enable/disable features of installed office.
+
+ @seealso configuration package "org.openoffice.Office.Common/_3D-Engine"
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsPaperSize() const;
+ sal_Bool IsPaperOrientation() const;
+ sal_Bool IsTransparency() const;
+ sal_Bool IsModifyDocumentOnPrintingAllowed() const;
+
+ void SetPaperSize( sal_Bool bState );
+ void SetPaperOrientation( sal_Bool bState );
+ void SetTransparency( sal_Bool bState );
+ void SetModifyDocumentOnPrintingAllowed( sal_Bool bState );
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class use his own static mutex to be threadsafe.
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtPrintWarningOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtPrintWarningOptions
+
+#endif // #ifndef INCLUDED_unotools_PRINTWARNINGOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/progresshandlerwrap.hxx b/include/unotools/progresshandlerwrap.hxx
new file mode 100644
index 000000000000..fc640dc4c4a9
--- /dev/null
+++ b/include/unotools/progresshandlerwrap.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 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UTL_PROGRESSHANDLERWRAP_HXX_
+#define _UTL_PROGRESSHANDLERWRAP_HXX_
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#include <com/sun/star/ucb/XProgressHandler.hpp>
+
+namespace utl
+{
+
+class UNOTOOLS_DLLPUBLIC ProgressHandlerWrap : public ::cppu::WeakImplHelper1< ::com::sun::star::ucb::XProgressHandler >
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > m_xStatusIndicator;
+
+public:
+ ProgressHandlerWrap( ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > xSI );
+
+ // XProgressHandler
+ virtual void SAL_CALL push( const ::com::sun::star::uno::Any& Status )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL update( const ::com::sun::star::uno::Any& Status )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL pop()
+ throw (::com::sun::star::uno::RuntimeException);
+};
+
+} // namespace utl
+
+#endif // _UTL_PROGRESSHANDLERWRAP_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/readwritemutexguard.hxx b/include/unotools/readwritemutexguard.hxx
new file mode 100644
index 000000000000..dd182d1e9a67
--- /dev/null
+++ b/include/unotools/readwritemutexguard.hxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_UNOTOOLS_READWRITEMUTEXGUARD_HXX
+#define INCLUDED_UNOTOOLS_READWRITEMUTEXGUARD_HXX
+
+#include <osl/mutex.hxx>
+
+namespace utl {
+
+class ReadWriteGuard;
+class ReadWriteMutex
+{
+ friend class ReadWriteGuard;
+
+ sal_uInt32 nReadCount;
+ sal_uInt32 nBlockCriticalCount;
+ ::osl::Mutex* pMutex;
+ ::osl::Mutex* pWriteMutex;
+
+public:
+ ReadWriteMutex()
+ : nReadCount(0)
+ , nBlockCriticalCount(0)
+ , pMutex( new ::osl::Mutex )
+ , pWriteMutex( new ::osl::Mutex )
+ {}
+ ~ReadWriteMutex()
+ {
+ delete pMutex;
+ delete pWriteMutex;
+ }
+};
+
+
+namespace ReadWriteGuardMode {
+const sal_Int32 nWrite = 0x01;
+const sal_Int32 nCriticalChange = 0x02 | nWrite;
+const sal_Int32 nBlockCritical = 0x04; // only a block, not a read, exclusive flag!
+}
+
+/** Enable multiple threads to read simultaneously, but a write blocks all
+ other reads and writes, and a read blocks any write.
+ Used in I18N wrappers to be able to maintain a single instance of a wrapper
+ for the standard Office locale.
+ NEVER construct a writing guard if there is already a reading guard in the
+ same context, the following will dead lock EVEN IN THE SAME THREAD!
+ void foo()
+ {
+ ReadWriteGuard aGuard1( aMutex );
+ bar();
+ }
+ void bar()
+ {
+ // waits forever for aGuard1
+ ReadWriteGuard aGuard2( aMutex, ReadWriteGuardMode::nWrite );
+ }
+ */
+class ReadWriteGuard
+{
+ ReadWriteMutex& rMutex;
+ sal_Int32 nMode;
+public:
+ ReadWriteGuard(
+ ReadWriteMutex& rMutex,
+ sal_Int32 nRequestMode = 0 // read only
+ );
+ ~ReadWriteGuard();
+
+ /** Be careful with this, it does wait for ANY read to complete.
+ The following will dead lock EVEN IN THE SAME THREAD!
+ void foo()
+ {
+ ReadWriteGuard aGuard1( aMutex );
+ bar();
+ }
+ void bar()
+ {
+ ReadWriteGuard aGuard2( aMutex );
+ aGuard2.changeReadToWrite(); // waits forever for aGuard1
+ }
+ */
+ void changeReadToWrite();
+};
+
+} // namespace utl
+
+#endif // INCLUDED_UNOTOOLS_READWRITEMUTEXGUARD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
new file mode 100644
index 000000000000..771c7210d09c
--- /dev/null
+++ b/include/unotools/saveopt.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_unotools_SAVEOPT_HXX
+#define INCLUDED_unotools_SAVEOPT_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <unotools/options.hxx>
+
+struct SvtLoadSaveOptions_Impl;
+class UNOTOOLS_DLLPUBLIC SvtSaveOptions: public utl::detail::Options
+{
+ SvtLoadSaveOptions_Impl* pImp;
+
+public:
+
+ enum EOption
+ {
+ E_AUTOSAVETIME,
+ E_USEUSERDATA,
+ E_BACKUP,
+ E_AUTOSAVE,
+ E_AUTOSAVEPROMPT,
+ E_DOCINFSAVE,
+ E_SAVEWORKINGSET,
+ E_SAVEDOCVIEW,
+ E_SAVERELINET,
+ E_SAVERELFSYS,
+ E_SAVEUNPACKED,
+ E_DOPRETTYPRINTING,
+ E_WARNALIENFORMAT,
+ E_LOADDOCPRINTER,
+ E_ODFDEFAULTVERSION,
+ E_USESHA1INODF12,
+ E_USEBLOWFISHINODF12,
+ E_USERAUTOSAVE,
+ };
+
+ // keep enum values sorted that a less or greater compare maps to older and newer versions!
+ enum ODFDefaultVersion
+ {
+ ODFVER_UNKNOWN = 0, // unknown
+ ODFVER_010 = 1, // ODF 1.0
+ ODFVER_011 = 2, // ODF 1.1
+ DO_NOT_USE = 3, // Do not use this, only here for compatibility with pre OOo 3.2 configuration
+ ODFVER_012 = 4, // ODF 1.2
+ ODFVER_012_EXT_COMPAT = 8, // ODF 1.2 extended, but with compatibility fallbacks
+
+ ODFVER_LATEST = SAL_MAX_ENUM, // ODF latest version with enhancements
+ };
+
+ SvtSaveOptions();
+ virtual ~SvtSaveOptions();
+
+ void SetAutoSaveTime( sal_Int32 n );
+ sal_Int32 GetAutoSaveTime() const;
+
+ void SetUseUserData( sal_Bool b );
+ sal_Bool IsUseUserData() const;
+
+ void SetBackup( sal_Bool b );
+ sal_Bool IsBackup() const;
+
+ void SetAutoSave( sal_Bool b );
+ sal_Bool IsAutoSave() const;
+
+ void SetAutoSavePrompt( sal_Bool b );
+ sal_Bool IsAutoSavePrompt() const;
+
+ void SetUserAutoSave( sal_Bool b );
+ sal_Bool IsUserAutoSave() const;
+
+ void SetDocInfoSave(sal_Bool b);
+ sal_Bool IsDocInfoSave() const;
+
+ void SetSaveWorkingSet( sal_Bool b );
+ sal_Bool IsSaveWorkingSet() const;
+
+ void SetSaveDocView( sal_Bool b );
+ sal_Bool IsSaveDocView() const;
+
+ void SetSaveRelINet( sal_Bool b );
+ sal_Bool IsSaveRelINet() const;
+
+ void SetSaveRelFSys( sal_Bool b );
+ sal_Bool IsSaveRelFSys() const;
+
+ sal_Bool IsSaveUnpacked() const;
+
+ void SetLoadUserSettings(sal_Bool b);
+ sal_Bool IsLoadUserSettings() const;
+
+ void SetPrettyPrinting( sal_Bool _bEnable );
+ sal_Bool IsPrettyPrinting( ) const;
+
+ void SetWarnAlienFormat( sal_Bool _bEnable );
+ sal_Bool IsWarnAlienFormat( ) const;
+
+ void SetLoadDocumentPrinter( sal_Bool _bEnable );
+ sal_Bool IsLoadDocumentPrinter( ) const;
+
+ void SetODFDefaultVersion( ODFDefaultVersion eVersion );
+ ODFDefaultVersion GetODFDefaultVersion() const;
+
+ sal_Bool IsUseSHA1InODF12() const;
+
+ sal_Bool IsUseBlowfishInODF12() const;
+
+ sal_Bool IsReadOnly( EOption eOption ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/searchopt.hxx b/include/unotools/searchopt.hxx
new file mode 100644
index 000000000000..0ce76a846024
--- /dev/null
+++ b/include/unotools/searchopt.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 _SVT_SEARCHOPT_HXX_
+#define _SVT_SEARCHOPT_HXX_
+
+#include "unotools/unotoolsdllapi.h"
+#include "tools/solar.h"
+
+class SvtSearchOptions_Impl;
+
+class UNOTOOLS_DLLPUBLIC SvtSearchOptions
+{
+ SvtSearchOptions_Impl *pImpl;
+
+ // disallow copy-constructor and assignment-operator for now
+ SvtSearchOptions( const SvtSearchOptions & );
+ SvtSearchOptions & operator = ( const SvtSearchOptions & );
+
+protected:
+
+public:
+ SvtSearchOptions();
+ ~SvtSearchOptions();
+
+ sal_Int32 GetTransliterationFlags() const;
+
+ //
+ // General Options
+ //
+
+ sal_Bool IsWholeWordsOnly() const;
+ sal_Bool IsBackwards() const;
+ sal_Bool IsUseRegularExpression() const;
+ sal_Bool IsSimilaritySearch() const;
+ sal_Bool IsUseAsianOptions() const;
+ sal_Bool IsMatchCase() const; // also Japanese search option
+ sal_Bool IsNotes() const;
+
+ void SetWholeWordsOnly( sal_Bool bVal );
+ void SetBackwards( sal_Bool bVal );
+ void SetUseRegularExpression( sal_Bool bVal );
+ void SetSearchForStyles( sal_Bool bVal );
+ void SetSimilaritySearch( sal_Bool bVal );
+ void SetUseAsianOptions( sal_Bool bVal );
+ void SetMatchCase( sal_Bool bVal ); // also Japanese search option
+ void SetNotes( sal_Bool bVal);
+
+ //
+ // Japanese search options
+ //
+
+ sal_Bool IsMatchFullHalfWidthForms() const;
+ sal_Bool IsMatchHiraganaKatakana() const;
+ sal_Bool IsMatchContractions() const;
+ sal_Bool IsMatchMinusDashChoon() const;
+ sal_Bool IsMatchRepeatCharMarks() const;
+ sal_Bool IsMatchVariantFormKanji() const;
+ sal_Bool IsMatchOldKanaForms() const;
+ sal_Bool IsMatchDiziDuzu() const;
+ sal_Bool IsMatchBavaHafa() const;
+ sal_Bool IsMatchTsithichiDhizi() const;
+ sal_Bool IsMatchHyuiyuByuvyu() const;
+ sal_Bool IsMatchSesheZeje() const;
+ sal_Bool IsMatchIaiya() const;
+ sal_Bool IsMatchKiku() const;
+ sal_Bool IsIgnorePunctuation() const;
+ sal_Bool IsIgnoreWhitespace() const;
+ sal_Bool IsIgnoreProlongedSoundMark() const;
+ sal_Bool IsIgnoreMiddleDot() const;
+
+ void SetMatchFullHalfWidthForms( sal_Bool bVal );
+ void SetMatchHiraganaKatakana( sal_Bool bVal );
+ void SetMatchContractions( sal_Bool bVal );
+ void SetMatchMinusDashChoon( sal_Bool bVal );
+ void SetMatchRepeatCharMarks( sal_Bool bVal );
+ void SetMatchVariantFormKanji( sal_Bool bVal );
+ void SetMatchOldKanaForms( sal_Bool bVal );
+ void SetMatchDiziDuzu( sal_Bool bVal );
+ void SetMatchBavaHafa( sal_Bool bVal );
+ void SetMatchTsithichiDhizi( sal_Bool bVal );
+ void SetMatchHyuiyuByuvyu( sal_Bool bVal );
+ void SetMatchSesheZeje( sal_Bool bVal );
+ void SetMatchIaiya( sal_Bool bVal );
+ void SetMatchKiku( sal_Bool bVal );
+ void SetIgnorePunctuation( sal_Bool bVal );
+ void SetIgnoreWhitespace( sal_Bool bVal );
+ void SetIgnoreProlongedSoundMark( sal_Bool bVal );
+ void SetIgnoreMiddleDot( sal_Bool bVal );
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/securityoptions.hxx b/include/unotools/securityoptions.hxx
new file mode 100644
index 000000000000..2156cb5ec3e5
--- /dev/null
+++ b/include/unotools/securityoptions.hxx
@@ -0,0 +1,261 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_unotools_SECURITYOPTIONS_HXX
+#define INCLUDED_unotools_SECURITYOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+/*-************************************************************************************************************//**
+ @short forward declaration to our private date container implementation
+ @descr We use these class as internal member to support small memory requirements.
+ You can create the container if it is neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtSecurityOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @descr These values present modes to handle StarOffice basic scripts.
+ see GetBasicMode/SetBasicMode() for further information
+*//*-*************************************************************************************************************/
+
+enum EBasicSecurityMode
+{
+ eNEVER_EXECUTE = 0,
+ eFROM_LIST = 1,
+ eALWAYS_EXECUTE = 2
+};
+
+/*-************************************************************************************************************//**
+ @short collect information about security features
+ @descr -
+
+ @implements -
+ @base -
+
+ @ATTENTION This class is partially threadsafe.
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtSecurityOptions : public utl::detail::Options
+{
+ public:
+
+ enum EOption
+ {
+ E_SECUREURLS,
+ E_BASICMODE, // xmlsec05 depricated
+ E_EXECUTEPLUGINS, // xmlsec05 depricated
+ E_WARNING, // xmlsec05 depricated
+ E_CONFIRMATION, // xmlsec05 depricated
+ E_DOCWARN_SAVEORSEND,
+ E_DOCWARN_SIGNING,
+ E_DOCWARN_PRINT,
+ E_DOCWARN_CREATEPDF,
+ E_DOCWARN_REMOVEPERSONALINFO,
+ E_DOCWARN_RECOMMENDPASSWORD,
+ E_MACRO_SECLEVEL,
+ E_MACRO_TRUSTEDAUTHORS,
+ E_MACRO_DISABLE,
+ E_CTRLCLICK_HYPERLINK
+ };
+
+ enum MacroAction
+ {
+ MA_DONTRUN = 0,
+ MA_CONFIRM,
+ MA_RUN
+ };
+
+ typedef ::com::sun::star::uno::Sequence< OUString > Certificate;
+
+ /*
+ // MT: Doesn't work for sequence...
+ struct Certificate
+ {
+ OUString SubjectName;
+ OUString SerialNumber;
+ OUString RawData;
+ };
+ */
+
+ public:
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtSecurityOptions();
+ virtual ~SvtSecurityOptions();
+
+ /*-****************************************************************************************************//**
+ @short returns readonly state
+ @descr It can be called to get information about the readonly state of a provided item.
+ @seealso -
+
+ @param "eOption", specify, which item is queried
+ @return <TRUE/> if item is readonly; <FALSE/> otherwise
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsReadOnly( EOption eOption ) const ;
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Security/Scripting/SecureURL"
+ @descr These value displays the list of all trustworthy URLs.
+ zB.: file:/ => All scripts from the local file system including a LAN;
+ private:explorer => Scripts from the Explorer;
+ private:help => Scripts in the help system;
+ private:newmenu => Scripts that are executed by the commands File-New and AutoPilot;
+ private:schedule => Scripts of the scheduler;
+ private:searchfolder => Scripts of the searchfolder;
+ private:user => Scripts that are entered in the URL field.
+ @seealso -
+
+ @param "seqURLList", new values to set it in configuration.
+ @return The values which represent current state of internal variable.
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ ::com::sun::star::uno::Sequence< OUString > GetSecureURLs( ) const ;
+ void SetSecureURLs( const ::com::sun::star::uno::Sequence< OUString >& seqURLList ) ;
+
+ /*-****************************************************************************************************//**
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Security/Scripting/StarOfficeBasic"
+ @descr These value determines how StarOffice Basic scripts should be handled.
+ It exist 3 different modes:
+ 0 = never execute
+ 1 = from list
+ 2 = always execute
+
+ @ATTENTION These methods don't check for valid or invalid values!
+ Our configuration server can do it ... but these implementation don't get any notifications
+ about wrong commits ...!
+ => If you set an invalid value - nothing will be changed. The information will lost.
+
+ @seealso enum EBasicSecurityMode
+
+ @param "eMode" to set new mode ... Value must defined as an enum of type EBasicSecurityMode!
+ @return An enum value, which present current mode.
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ sal_Int32 GetMacroSecurityLevel ( ) const ;
+ void SetMacroSecurityLevel ( sal_Int32 _nLevel ) ;
+
+ sal_Bool IsMacroDisabled ( ) const ;
+
+ /*-****************************************************************************************************//**
+ @short special method to check an URL and his referer corresponding to ouer internal security cessation
+ @descr Give us an URL and his referer and we will say you if these url can be scripted or not!
+
+ @seealso -
+
+ @param "sURL" reference to URL for checking
+ @param "sReferer" reference to referer which whish to run script by given URL
+ @return sal_True if URL is secure or security is obsolete(!) or sal_False otherwise.
+
+ @onerror No error should occurre!
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsSecureURL( const OUString& sURL ,
+ const OUString& sReferer ) const ;
+
+ ::com::sun::star::uno::Sequence< Certificate > GetTrustedAuthors ( ) const ;
+ void SetTrustedAuthors ( const ::com::sun::star::uno::Sequence< Certificate >& rAuthors ) ;
+
+ // for bool options only!
+ bool IsOptionSet ( EOption eOption ) const ;
+ bool SetOption ( EOption eOption, bool bValue ) ;
+ bool IsOptionEnabled ( EOption eOption ) const ;
+
+ // xmlsec05 depricated methods
+ sal_Bool IsExecutePlugins() const;
+ void SetExecutePlugins( sal_Bool bSet );
+ EBasicSecurityMode GetBasicMode( ) const ;
+ void SetBasicMode( EBasicSecurityMode eMode ) ;
+ sal_Bool IsWarningEnabled() const;
+ void SetWarningEnabled( sal_Bool bSet );
+ sal_Bool IsConfirmationEnabled() const;
+ void SetConfirmationEnabled( sal_Bool bSet );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetInitMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtSecurityOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtSecurityOptions
+
+#endif // #ifndef INCLUDED_unotools_SECURITYOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/sharedunocomponent.hxx b/include/unotools/sharedunocomponent.hxx
new file mode 100644
index 000000000000..5fa399dbc417
--- /dev/null
+++ b/include/unotools/sharedunocomponent.hxx
@@ -0,0 +1,364 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX
+#define UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX
+
+#include "unotoolsdllapi.h"
+
+#include <boost/shared_ptr.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <rtl/ref.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace lang {
+ class XComponent;
+ }
+} } }
+//............................................................................
+namespace utl
+{
+//............................................................................
+
+ //========================================================================
+ //= DisposableComponent
+ //========================================================================
+ /** is a class which controls lifetime of an UNO component via ->XComponent::dispose
+
+ You'll usually never use this class directly, but only as parameter for a
+ ->SharedUNOComponent class.
+ */
+ class UNOTOOLS_DLLPUBLIC DisposableComponent
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
+ m_xComponent;
+
+ public:
+ /** constructs a ->DisposableComponent instance
+
+ @param _rxComponent
+ the component whose life time should be controlled by the instance. Must not be <NULL/>.
+ */
+ DisposableComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
+
+ /** disposes the component represented by the instance
+
+ The component is queried for ->XComponent(which <em>must</em> be supported),
+ and ->XComponent::dispose is invoked. A failure of this invocation (e.g. a thrown
+ exception) is silenced in release builds, and reported in debug builds.
+ */
+ ~DisposableComponent();
+
+ private:
+ DisposableComponent(); // never implemented
+ DisposableComponent( const DisposableComponent& ); // never implemented
+ DisposableComponent& operator=( const DisposableComponent& ); // never implemented
+ };
+
+ //========================================================================
+ //= CloseableComponent
+ //========================================================================
+ class CloseableComponentImpl;
+ /** is a class which controls lifetime of an UNO component via ->XCloseable::close
+
+ You'll usually never use this class directly, but only as parameter for a
+ ->SharedUNOComponent class.
+ */
+ class UNOTOOLS_DLLPUBLIC CloseableComponent
+ {
+ private:
+ /** Our IMPL class.
+ */
+ ::rtl::Reference< CloseableComponentImpl > m_pImpl;
+
+ public:
+ /** constructs a ->CloseableComponent instance
+
+ @param _rxComponent
+ the component whose life time should be controlled by the instance. Must not be <NULL/>.
+ */
+ CloseableComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
+
+ /** destroys resources associated with this instance, and disposes the component
+
+ The component is queried for ->XCloseable (which <em>must</em> be supported),
+ and ->XCloseable::close is invoked, with delivering the ownership.
+ If the invocation fails with a ->CloseVetoException, this is ignored, since in
+ this case the vetoing instance took the ownership.
+
+ Any other failure will be reported in a debug version via assertion mechanisms,
+ and silenced in release builds.
+ */
+ ~CloseableComponent();
+
+ private:
+ CloseableComponent(); // never implemented
+ CloseableComponent( const CloseableComponent& ); // never implemented
+ CloseableComponent& operator=( const CloseableComponent& ); // never implemented
+ };
+
+ //========================================================================
+ //= SharedUNOComponent
+ //========================================================================
+ /** is a helper class for sharing ownership of a UNO component
+
+ If you need to share an UNO component, which normally needs a dedicated owner,
+ and is lifetime controlled by an explicit disposal action (not necessarily ->XComponent::dispose,
+ but <em>any</em> explicit method call, after which the object is considered
+ to be disposed), between different classes, ->SharedUNOComponent is what you need.
+
+ Instead of passing around a <code>Reference&lt; XFoo &gt;</code>, and bothering
+ with ownership and disposal, you just use a <code>SharedUNOComponent&lt; XFoo &gt;</code>.
+ This instance can be passed around, including copying, and in nearly all respects behaves
+ like the original <code>Reference&lt; XFoo &gt;</code>. However, when the last
+ ->SharedUNOComponent referencing a certain <code>Reference&lt; XFoo &gt;</code> dies, it
+ will automatically get rid of the object held by this reference.
+
+ @param INTERFACE
+ the UNO interface type as which the component should be held
+
+ @param COMPONENT_HOLDER
+ a class which can be used to represent and dispose a UNO component.
+ The class must support (maybe explicit only) construction from a
+ <code>Reference&lt; INTERFACE &gt;</code>, and destruction. Upon destruction,
+ the class must dispose (by any suitable means) the component instance it was
+ constructed with.
+ */
+ template < class INTERFACE, class COMPONENT = DisposableComponent >
+ class SharedUNOComponent
+ {
+ private:
+ typedef COMPONENT Component;
+ typedef ::boost::shared_ptr< Component > ComponentPointer;
+
+ private:
+ ComponentPointer m_pComponent;
+ ::com::sun::star::uno::Reference< INTERFACE > m_xTypedComponent;
+
+ public:
+ enum AssignmentMode
+ {
+ TakeOwnership,
+ NoTakeOwnership
+ };
+
+ public:
+ inline SharedUNOComponent()
+ {
+ }
+
+ explicit inline SharedUNOComponent( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent, AssignmentMode eMode = TakeOwnership )
+ {
+ reset( _rxComponent, eMode );
+ }
+
+#ifndef EXCEPTIONS_OFF
+ inline SharedUNOComponent( const ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow )
+ {
+ set( _pInterface, _queryThrow );
+ }
+
+ inline SharedUNOComponent( const ::com::sun::star::uno::BaseReference & _rRef, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow )
+ {
+ set( _rRef, _queryThrow );
+ }
+
+ inline SharedUNOComponent( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow )
+ {
+ set( _rAny, _queryThrow );
+ }
+
+ inline SharedUNOComponent( const SharedUNOComponent& _rxComponent, ::com::sun::star::uno::UnoReference_SetThrow _setThrow )
+ {
+ set( _rxComponent, _setThrow );
+ }
+#endif
+
+// SharedUNOComponent& operator=( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent );
+ // This operator is intentionally not implemented. There is no canonic ownership after this operator
+ // would have been applied: Should the SharedUNOComponent have the ownership of the component,
+ // or shouldn't it? Hard to guess, and probably wrong in 50 percent of all cases, anyway. So,
+ // instead of tempting clients of this class to use such a dangerous operator, we do
+ // not offer it at all. If you need to assign a Reference< INTERFACE > to your SharedUNOComponent,
+ // use the ->reset method.
+
+ /** assigns a new component, and releases the old one
+ */
+ void reset( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent, AssignmentMode _eMode = TakeOwnership );
+
+ inline bool set( ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_Query _query );
+ inline bool set( const ::com::sun::star::uno::BaseReference& _rRef, ::com::sun::star::uno::UnoReference_Query _query );
+ inline bool set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_Query _query );
+
+#ifndef EXCEPTIONS_OFF
+ inline void set( const ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow );
+ inline void set( const ::com::sun::star::uno::BaseReference & _rRef, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow );
+ inline void set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow );
+
+ inline void set( const INTERFACE* _pInterface, ::com::sun::star::uno::UnoReference_SetThrow _setThrow );
+ inline void set( const ::com::sun::star::uno::Reference< INTERFACE >& _rRef, ::com::sun::star::uno::UnoReference_SetThrow _setThrow );
+ inline void set( const SharedUNOComponent& _rComp, ::com::sun::star::uno::UnoReference_SetThrow _setThrow );
+#endif
+
+ INTERFACE* SAL_CALL operator->() const;
+
+ inline operator const ::com::sun::star::uno::Reference< INTERFACE >&() const
+ {
+ return m_xTypedComponent;
+ }
+
+ inline const ::com::sun::star::uno::Reference< INTERFACE >& getTyped() const
+ {
+ return m_xTypedComponent;
+ }
+
+ inline bool is() const
+ {
+ return m_xTypedComponent.is();
+ }
+
+ inline void clear()
+ {
+ m_pComponent.reset();
+ m_xTypedComponent.clear();
+ }
+ };
+
+ //-------------------------------------------------------------------------
+ template < class INTERFACE, class COMPONENT >
+ INTERFACE* SAL_CALL SharedUNOComponent< INTERFACE, COMPONENT >::operator->() const
+ {
+ return m_xTypedComponent.operator->();
+ }
+
+ //-------------------------------------------------------------------------
+ // assignments
+ template < class INTERFACE, class COMPONENT >
+ void SharedUNOComponent< INTERFACE, COMPONENT >::reset( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent, AssignmentMode _eMode )
+ {
+ m_pComponent.reset( _eMode == TakeOwnership ? new COMPONENT( _rxComponent ) : NULL );
+ m_xTypedComponent = _rxComponent;
+ }
+
+ //-------------------------------------------------------------------------
+ // comparison operators
+ template < class INTERFACE, class COMPONENT >
+ bool operator==( const ::com::sun::star::uno::Reference< INTERFACE >& _rLHS, const SharedUNOComponent< INTERFACE, COMPONENT >& _rRHS )
+ {
+ return _rLHS == _rRHS.getTyped();
+ }
+
+ template < class INTERFACE, class COMPONENT >
+ bool operator==( const SharedUNOComponent< INTERFACE, COMPONENT >& _rLHS, const ::com::sun::star::uno::Reference< INTERFACE >& _rRHS )
+ {
+ return _rLHS.getTyped() == _rRHS;
+ }
+
+ //-------------------------------------------------------------------------
+ // conversion to Any
+ template < class INTERFACE, class COMPONENT >
+ inline void SAL_CALL operator <<= ( ::com::sun::star::uno::Any & rAny, const SharedUNOComponent< INTERFACE, COMPONENT >& value ) SAL_THROW(())
+ {
+ rAny <<= value.getTyped();
+ }
+
+ //-------------------------------------------------------------------------
+ template < class INTERFACE, class COMPONENT >
+ inline ::com::sun::star::uno::Any SAL_CALL makeAny( const SharedUNOComponent< INTERFACE, COMPONENT >& value ) SAL_THROW(())
+ {
+ return makeAny( value.getTyped() );
+ }
+
+#ifndef EXCEPTIONS_OFF
+ //-------------------------------------------------------------------------
+ template < class INTERFACE, class COMPONENT >
+ void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow )
+ {
+ reset( ::com::sun::star::uno::Reference< INTERFACE >( _pInterface, _queryThrow ), TakeOwnership );
+ }
+
+ //-------------------------------------------------------------------------
+ template < class INTERFACE, class COMPONENT >
+ void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::BaseReference & _rRef, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow )
+ {
+ reset( ::com::sun::star::uno::Reference< INTERFACE >( _rRef, _queryThrow ), TakeOwnership );
+ }
+
+ //-------------------------------------------------------------------------
+ template < class INTERFACE, class COMPONENT >
+ void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow )
+ {
+ reset( ::com::sun::star::uno::Reference< INTERFACE >( _rAny, _queryThrow ), TakeOwnership );
+ }
+
+ //-------------------------------------------------------------------------
+ template < class INTERFACE, class COMPONENT >
+ void SharedUNOComponent< INTERFACE, COMPONENT >::set( const INTERFACE* _pInterface, ::com::sun::star::uno::UnoReference_SetThrow _setThrow )
+ {
+ reset( ::com::sun::star::uno::Reference< INTERFACE >( _pInterface, _setThrow ), TakeOwnership );
+ }
+
+ //-------------------------------------------------------------------------
+ template < class INTERFACE, class COMPONENT >
+ void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::Reference< INTERFACE >& _rRef, ::com::sun::star::uno::UnoReference_SetThrow _setThrow )
+ {
+ reset( ::com::sun::star::uno::Reference< INTERFACE >( _rRef, _setThrow ), TakeOwnership );
+ }
+
+ //-------------------------------------------------------------------------
+ template < class INTERFACE, class COMPONENT >
+ void SharedUNOComponent< INTERFACE, COMPONENT >::set( const SharedUNOComponent& _rComp, ::com::sun::star::uno::UnoReference_SetThrow _setThrow )
+ {
+ *this = _rComp;
+ // provoke an exception in case the component is NULL
+ m_xTypedComponent.set( m_xTypedComponent, _setThrow );
+ }
+#endif
+
+ //-------------------------------------------------------------------------
+ template < class INTERFACE, class COMPONENT >
+ bool SharedUNOComponent< INTERFACE, COMPONENT >::set( ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_Query _query )
+ {
+ reset( ::com::sun::star::uno::Reference< INTERFACE >( _pInterface, _query ) );
+ return is();
+ }
+
+ //-------------------------------------------------------------------------
+ template < class INTERFACE, class COMPONENT >
+ bool SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::BaseReference& _rRef, ::com::sun::star::uno::UnoReference_Query _query )
+ {
+ reset( ::com::sun::star::uno::Reference< INTERFACE >( _rRef, _query ) );
+ return is();
+ }
+
+ //-------------------------------------------------------------------------
+ template < class INTERFACE, class COMPONENT >
+ bool SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_Query _query )
+ {
+ reset( ::com::sun::star::uno::Reference< INTERFACE >( _rAny, _query ) );
+ return is();
+ }
+
+//............................................................................
+} // namespace utl
+//............................................................................
+
+#endif // UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/streamhelper.hxx b/include/unotools/streamhelper.hxx
new file mode 100644
index 000000000000..60e16a28767a
--- /dev/null
+++ b/include/unotools/streamhelper.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 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UNOTOOLS_STREAMHELPER_HXX_
+#define _UNOTOOLS_STREAMHELPER_HXX_
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <osl/mutex.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <tools/stream.hxx>
+
+namespace utl
+{
+ namespace stario = ::com::sun::star::io;
+ namespace staruno = ::com::sun::star::uno;
+
+/**
+ * The helper implementation for a using input streams based on SvLockBytes.
+ *
+ * @author Dirk Grobler
+ * @since 00/28/03
+ */
+ typedef ::cppu::WeakImplHelper2<stario::XInputStream, stario::XSeekable> InputStreamHelper_Base;
+ // needed for some compilers
+class UNOTOOLS_DLLPUBLIC OInputStreamHelper : public InputStreamHelper_Base
+{
+ ::osl::Mutex m_aMutex;
+ SvLockBytesRef m_xLockBytes;
+ sal_uInt32 m_nActPos;
+ sal_Int32 m_nAvailable; // this is typically the chunk(buffer) size
+
+public:
+ OInputStreamHelper(const SvLockBytesRef& _xLockBytes,
+ sal_uInt32 _nAvailable,
+ sal_uInt32 _nPos = 0)
+ :m_xLockBytes(_xLockBytes)
+ ,m_nActPos(_nPos)
+ ,m_nAvailable(_nAvailable){}
+
+// staruno::XInterface
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+// stario::XInputStream
+ virtual sal_Int32 SAL_CALL readBytes( staruno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(stario::NotConnectedException, stario::BufferSizeExceededException, stario::IOException, staruno::RuntimeException);
+ virtual sal_Int32 SAL_CALL readSomeBytes( staruno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(stario::NotConnectedException, stario::BufferSizeExceededException, stario::IOException, staruno::RuntimeException);
+ virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw(stario::NotConnectedException, stario::BufferSizeExceededException, stario::IOException, staruno::RuntimeException);
+ virtual sal_Int32 SAL_CALL available( ) throw(stario::NotConnectedException, stario::IOException, staruno::RuntimeException);
+ virtual void SAL_CALL closeInput( ) throw (stario::NotConnectedException, stario::IOException, staruno::RuntimeException);
+
+ virtual void SAL_CALL seek( sal_Int64 location ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int64 SAL_CALL getPosition( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int64 SAL_CALL getLength( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+};
+
+} // namespace utl
+
+
+#endif // _UNOTOOLS_STREAM_WRAPPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/streamsection.hxx b/include/unotools/streamsection.hxx
new file mode 100644
index 000000000000..8e347eec5d4e
--- /dev/null
+++ b/include/unotools/streamsection.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 _UNOTOOLS_STREAMSECTION_HXX_
+#define _UNOTOOLS_STREAMSECTION_HXX_
+
+#include <com/sun/star/io/XMarkableStream.hpp>
+#include <com/sun/star/io/XDataInputStream.hpp>
+#include <com/sun/star/io/XDataOutputStream.hpp>
+
+namespace utl
+{
+
+ namespace stario = ::com::sun::star::io;
+ namespace staruno = ::com::sun::star::uno;
+
+/** implements handling for compatibly reading/writing data from/into an input/output stream.
+ data written in a block secured by this class should be readable by older versions which
+ use the same mechanism.
+
+ @author Frank Schoenheit
+ @since 00/26/05
+*/
+
+class OStreamSection
+{
+ staruno::Reference< stario::XMarkableStream > m_xMarkStream;
+ staruno::Reference< stario::XDataInputStream > m_xInStream;
+ staruno::Reference< stario::XDataOutputStream > m_xOutStream;
+
+ sal_Int32 m_nBlockStart;
+ sal_Int32 m_nBlockLen;
+
+public:
+ /** starts reading of a "skippable" section of data within the given input stream<BR>
+ @param _rxInput the stream to read from. Must support the
+ <type scope="com::sun::star::io">XMarkableStream</type> interface
+ */
+ OStreamSection(const staruno::Reference< stario::XDataInputStream >& _rxInput);
+
+ /** starts writing of a "skippable" section of data into the given output stream
+ @param _rxOutput the stream the stream to write to. Must support the
+ <type scope="com::sun::star::io">XMarkableStream</type> interface
+ @param _nPresumedLength estimation for the length of the upcoming section. If greater 0, this
+ value will be written as section length and corrected (in the dtor) only if
+ needed. If you know how much bytes you are about to write, you may
+ want to use this param, saving some stream operations this way.
+ */
+ OStreamSection(const staruno::Reference< stario::XDataOutputStream >& _rxOutput, sal_Int32 _nPresumedLength = 0);
+
+ /** dtor. <BR>If constructed for writing, the section "opened" by this object will be "closed".<BR>
+ If constructed for reading, any remaining bytes 'til the end of the section will be skipped.
+ */
+ ~OStreamSection();
+};
+
+} // namespace utl
+
+#endif // _UNOTOOLS_STREAMSECTION_HXX_
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/streamwrap.hxx b/include/unotools/streamwrap.hxx
new file mode 100644
index 000000000000..097b3dee94e3
--- /dev/null
+++ b/include/unotools/streamwrap.hxx
@@ -0,0 +1,173 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UTL_STREAM_WRAPPER_HXX_
+#define _UTL_STREAM_WRAPPER_HXX_
+#include <osl/mutex.hxx>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <com/sun/star/io/XTruncate.hpp>
+#include <com/sun/star/io/XStream.hpp>
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+class SvStream;
+
+namespace utl
+{
+ namespace stario = ::com::sun::star::io;
+ namespace staruno = ::com::sun::star::uno;
+
+//==================================================================
+//= OInputStreamWrapper
+//==================================================================
+typedef ::cppu::WeakImplHelper1 < stario::XInputStream
+ > InputStreamWrapper_Base;
+// needed for some compilers
+/// helper class for wrapping an SvStream into an <type scope="com.sun.star.io">XInputStream</type>
+class UNOTOOLS_DLLPUBLIC OInputStreamWrapper : public InputStreamWrapper_Base
+{
+protected:
+ ::osl::Mutex m_aMutex;
+ SvStream* m_pSvStream;
+ sal_Bool m_bSvStreamOwner : 1;
+ OInputStreamWrapper()
+ { m_pSvStream = 0; m_bSvStreamOwner = sal_False; }
+ void SetStream(SvStream* _pStream, sal_Bool bOwner )
+ { m_pSvStream = _pStream; m_bSvStreamOwner = bOwner; }
+
+public:
+ OInputStreamWrapper(SvStream& _rStream);
+ OInputStreamWrapper(SvStream* pStream, sal_Bool bOwner=sal_False);
+ virtual ~OInputStreamWrapper();
+
+// stario::XInputStream
+ virtual sal_Int32 SAL_CALL readBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual sal_Int32 SAL_CALL readSomeBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual sal_Int32 SAL_CALL available() throw(stario::NotConnectedException, staruno::RuntimeException);
+ virtual void SAL_CALL closeInput() throw(stario::NotConnectedException, staruno::RuntimeException);
+
+protected:
+ /// throws a NotConnectedException if the object is not connected anymore
+ void checkConnected() const;
+ /// throws an exception according to the error flag of m_pSvStream
+ void checkError() const;
+};
+
+//==================================================================
+//= OSeekableInputStreamWrapper
+//==================================================================
+typedef ::cppu::ImplHelper1 < ::com::sun::star::io::XSeekable
+ > OSeekableInputStreamWrapper_Base;
+/** helper class for wrapping an SvStream into an <type scope="com.sun.star.io">XInputStream</type>
+ which is seekable (i.e. supports the <type scope="com.sun.star.io">XSeekable</type> interface).
+*/
+class UNOTOOLS_DLLPUBLIC OSeekableInputStreamWrapper : public ::cppu::ImplInheritanceHelper1 < OInputStreamWrapper, com::sun::star::io::XSeekable >
+{
+protected:
+ OSeekableInputStreamWrapper() {}
+public:
+ OSeekableInputStreamWrapper(SvStream& _rStream);
+ OSeekableInputStreamWrapper(SvStream* _pStream, sal_Bool _bOwner = sal_False);
+
+ // XSeekable
+ virtual void SAL_CALL seek( sal_Int64 _nLocation ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int64 SAL_CALL getPosition( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int64 SAL_CALL getLength( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+};
+
+//==================================================================
+//= OOutputStreamWrapper
+//==================================================================
+typedef ::cppu::WeakImplHelper1<stario::XOutputStream> OutputStreamWrapper_Base;
+ // needed for some compilers
+class OOutputStreamWrapper : public OutputStreamWrapper_Base
+{
+public:
+ UNOTOOLS_DLLPUBLIC OOutputStreamWrapper(SvStream& _rStream);
+
+protected:
+ virtual ~OOutputStreamWrapper();
+
+// stario::XOutputStream
+ virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual void SAL_CALL flush() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual void SAL_CALL closeOutput() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+
+ /// throws an exception according to the error flag of m_pSvStream
+ void checkError() const;
+
+ // TODO: thread safety!
+ SvStream& rStream;
+};
+
+//==================================================================
+//= OSeekableOutputStreamWrapper
+//==================================================================
+typedef ::cppu::ImplHelper1 < ::com::sun::star::io::XSeekable
+ > OSeekableOutputStreamWrapper_Base;
+/** helper class for wrapping an SvStream into an <type scope="com.sun.star.io">XOutputStream</type>
+ which is seekable (i.e. supports the <type scope="com.sun.star.io">XSeekable</type> interface).
+*/
+class OSeekableOutputStreamWrapper
+ :public OOutputStreamWrapper
+ ,public OSeekableOutputStreamWrapper_Base
+{
+public:
+ UNOTOOLS_DLLPUBLIC OSeekableOutputStreamWrapper(SvStream& _rStream);
+
+private:
+ virtual ~OSeekableOutputStreamWrapper();
+
+ // disambiguate XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
+ // XSeekable
+ virtual void SAL_CALL seek( sal_Int64 _nLocation ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int64 SAL_CALL getPosition( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int64 SAL_CALL getLength( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+};
+
+class UNOTOOLS_DLLPUBLIC OStreamWrapper : public ::cppu::ImplInheritanceHelper3 < OSeekableInputStreamWrapper, com::sun::star::io::XStream, com::sun::star::io::XOutputStream, com::sun::star::io::XTruncate >
+{
+public:
+ OStreamWrapper(SvStream& _rStream);
+
+// stario::XStream
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( ) throw (::com::sun::star::uno::RuntimeException);
+
+// stario::XOutputStream
+ virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual void SAL_CALL flush() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual void SAL_CALL closeOutput() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
+ virtual void SAL_CALL truncate() throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+};
+
+}
+// namespace utl
+
+#endif // _UTL_STREAM_WRAPPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/syslocale.hxx b/include/unotools/syslocale.hxx
new file mode 100644
index 000000000000..d32a22139129
--- /dev/null
+++ b/include/unotools/syslocale.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_UNOTOOLS_SYSLOCALE_HXX
+#define INCLUDED_UNOTOOLS_SYSLOCALE_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <unotools/localedatawrapper.hxx>
+#include <unotools/charclass.hxx>
+#include <i18nlangtag/languagetag.hxx>
+#include <sal/types.h>
+#include <rtl/textenc.h>
+
+class SvtSysLocale_Impl;
+class SvtSysLocaleOptions;
+
+namespace osl { class Mutex; }
+
+/**
+ SvtSysLocale provides a refcounted single instance of an application wide
+ <type>LocaleDataWrapper</type> and <type>CharClass</type> which always
+ follow the locale as it is currently configured by the user. You may use
+ it anywhere to access the locale data elements like decimal separator and
+ simple date formatting and so on. Contructing and destructing a
+ SvtSysLocale is not expensive as long as there is at least one instance
+ left.
+ */
+class UNOTOOLS_DLLPUBLIC SvtSysLocale
+{
+ friend class SvtSysLocale_Impl; // access to mutex
+
+ static SvtSysLocale_Impl* pImpl;
+ static sal_Int32 nRefCount;
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetMutex();
+
+public:
+ SvtSysLocale();
+ ~SvtSysLocale();
+
+ const LocaleDataWrapper& GetLocaleData() const;
+ const CharClass& GetCharClass() const;
+
+ /** It is safe to store the pointers locally and use them AS LONG AS THE
+ INSTANCE OF SvtSysLocale LIVES!
+ It is a faster access but be sure what you do!
+ */
+ const LocaleDataWrapper* GetLocaleDataPtr() const;
+ const CharClass* GetCharClassPtr() const;
+ SvtSysLocaleOptions& GetOptions() const;
+ const LanguageTag& GetLanguageTag() const;
+ const LanguageTag& GetUILanguageTag() const;
+
+ /** Get the best MIME encoding matching the system locale, or if that isn't
+ determinable one that matches the UI locale, or UTF8 if everything else
+ fails.
+ */
+ static rtl_TextEncoding GetBestMimeEncoding();
+};
+
+#endif // INCLUDED_SVTOOLS_SYSLOCALE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/syslocaleoptions.hxx b/include/unotools/syslocaleoptions.hxx
new file mode 100644
index 000000000000..8c9378938ce0
--- /dev/null
+++ b/include/unotools/syslocaleoptions.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_SVTOOLS_SYSLOCALEOPTIONS_HXX
+#define INCLUDED_SVTOOLS_SYSLOCALEOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+#include <tools/solar.h>
+#include <tools/link.hxx>
+#include <i18nlangtag/lang.h>
+#include <i18nlangtag/languagetag.hxx>
+#include <tools/string.hxx>
+#include <unotools/options.hxx>
+
+// bits for broadcasting hints of changes in a SfxSimpleHint, may be combined
+const sal_uLong SYSLOCALEOPTIONS_HINT_LOCALE = 0x00000001;
+const sal_uLong SYSLOCALEOPTIONS_HINT_CURRENCY = 0x00000002;
+const sal_uLong SYSLOCALEOPTIONS_HINT_UILOCALE = 0x00000004;
+const sal_uLong SYSLOCALEOPTIONS_HINT_DECSEP = 0x00000008;
+const sal_uLong SYSLOCALEOPTIONS_HINT_DATEPATTERNS = 0x00000010;
+const sal_uLong SYSLOCALEOPTIONS_HINT_IGNORELANG = 0x00000020;
+
+class SvtSysLocaleOptions_Impl;
+class SvtListener;
+namespace osl { class Mutex; }
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtSysLocaleOptions : public utl::detail::Options
+{
+ static SvtSysLocaleOptions_Impl* pOptions;
+ static sal_Int32 nRefCount;
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetMutex();
+ virtual void ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt32 nHint );
+
+public:
+
+ enum EOption
+ {
+ E_LOCALE,
+ E_UILOCALE,
+ E_CURRENCY,
+ E_DATEPATTERNS
+ };
+ SvtSysLocaleOptions();
+ virtual ~SvtSysLocaleOptions();
+
+ // ConfigItem methods
+
+ sal_Bool IsModified();
+ void Commit();
+
+ /** Add a listener to react on config changes
+ which are broadcasted in a SfxSimpleHint
+ @return
+ <TRUE/> if added
+ <FALSE/> if not added
+ */
+
+ /** Block broadcasts and accumulate hints. This may be useful if, for
+ example, the locale and currency are changed and the currency was
+ empty before, since changing the locale with an empty currency does
+ also broadcast a change hint for the currency which would result in
+ two currency changes broadcasted.
+
+ @param bBlock
+ <TRUE/>: broadcasts are blocked until reversed.
+ <FALSE/>: broadcasts are not blocked anymore. Pending hints are
+ broadcasted if no other instance blocks the broadcast.
+
+ @ATTENTION
+ All SvtSysLocaleOptions instances point to exactly one refcounted
+ internal representation instance and broadcast blocks are counted.
+ Thus if you issue a BlockBroadcasts(sal_True) you MUST issue a matching
+ BlockBroadcasts(sal_False) or otherwise pending hints would never be
+ broadcasted again.
+ */
+ virtual void BlockBroadcasts( bool bBlock );
+
+ // config value access methods
+
+ /// The config string may be empty to denote the SYSTEM locale
+ const OUString& GetLocaleConfigString() const;
+ void SetLocaleConfigString( const OUString& rStr );
+ /** Get locale set, if empty denotes SYSTEM locale, not resolved
+ to the real locale. */
+ LanguageTag GetLanguageTag() const;
+ /** Get locale set, always resolved to the real locale. */
+ const LanguageTag& GetRealLanguageTag() const;
+
+ /// The config string may be empty to denote the SYSTEM locale
+ void SetUILocaleConfigString( const OUString& rStr );
+ /** Get UI locale set, always resolved to the real locale. */
+ const LanguageTag& GetRealUILanguageTag() const;
+
+ /// The config string may be empty to denote the default currency of the locale
+ const OUString& GetCurrencyConfigString() const;
+ void SetCurrencyConfigString( const OUString& rStr );
+
+ /** The config string may be empty to denote the default
+ DateAcceptancePatterns of the locale */
+ const OUString& GetDatePatternsConfigString() const;
+ void SetDatePatternsConfigString( const OUString& rStr );
+
+ // determine whether the decimal separator defined in the keyboard layout is used
+ // or the one approriate to the locale
+ sal_Bool IsDecimalSeparatorAsLocale() const;
+ void SetDecimalSeparatorAsLocale( sal_Bool bSet);
+
+ // determine whether to ignore changes to the system keyboard/locale/language when
+ // determining the language for newly entered text
+ sal_Bool IsIgnoreLanguageChange() const;
+ void SetIgnoreLanguageChange( sal_Bool bSet);
+
+ // convenience methods
+
+ /// Get currency abbreviation and locale from an USD-en-US or EUR-de-DE string
+ static void GetCurrencyAbbrevAndLanguage(
+ String& rAbbrev,
+ LanguageType& eLang,
+ const OUString& rConfigString );
+
+ /// Create an USD-en-US or EUR-de-DE string
+ static OUString CreateCurrencyConfigString(
+ const String& rAbbrev,
+ LanguageType eLang );
+
+ void GetCurrencyAbbrevAndLanguage(
+ String& rAbbrev,
+ LanguageType& eLang ) const
+ {
+ GetCurrencyAbbrevAndLanguage( rAbbrev,
+ eLang, GetCurrencyConfigString() );
+ }
+
+ void SetCurrencyAbbrevAndLanguage(
+ const String& rAbbrev,
+ LanguageType eLang )
+ {
+ SetCurrencyConfigString(
+ CreateCurrencyConfigString(
+ rAbbrev, eLang ) );
+ }
+
+ /** Set a link to a method to be called whenever the default currency
+ changes. This can be only one method, and normally it is the static
+ link method which calls SvNumberFormatter::SetDefaultSystemCurrency().
+ This is needed because the number formatter isn't part of the svl light
+ library, otherwise we could call SetDefaultSystemCurrency() directly.
+ */
+ static void SetCurrencyChangeLink( const Link& rLink );
+ static const Link& GetCurrencyChangeLink();
+
+ /** return the readonly state of the queried option. */
+ sal_Bool IsReadOnly( EOption eOption ) const;
+};
+
+#endif // INCLUDED_SVTOOLS_SYSLOCALEOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx
new file mode 100644
index 000000000000..6cf2cb0cd98c
--- /dev/null
+++ b/include/unotools/tempfile.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 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UNOTOOLS_TEMPFILE_HXX
+#define _UNOTOOLS_TEMPFILE_HXX
+
+#include <tools/string.hxx>
+#include <tools/stream.hxx>
+
+namespace utl
+{
+
+struct TempFile_Impl;
+
+/**
+ The class TempFile gives access to temporary files in the local file system. Sometimes they are needed because a 3rd party
+ code has a file name based interface, or some file access has to be done locally without transferring tons of bytes to or
+ from a remote system.
+ Creating a UCB content on a TempFile is only possible if a UCP for the local file system is present.
+ TempFiles can always be accessed by SvFileStreams or Sot/SvStorages using the "physical" file name ( not the URL, because
+ this may be a non-file URL, see below ), but if a UCB content can be created, it is also possible to take the URL and use
+ the UCB helper classes for streams. For convenience use UcbStreamHelper.
+ A Tempfile always has a "physical" file name ( a file name in the local computers host notation ) but it has a
+ "UCB compatible" URL only if a UCP for the local file system exists. This URL may have its own URL scheme
+ ( not necessarily "file://" ! ). The TempFile class methods take this into account, but other simple conversions like
+ the osl functions do not.
+ So it is a potential error to convert between the filename and the URL of a TempFile object using functions or methods
+ outside this class.
+*/
+
+class UNOTOOLS_DLLPUBLIC TempFile
+{
+ TempFile_Impl* pImp;
+ sal_Bool bKillingFileEnabled;
+
+protected:
+
+public:
+ /**
+ Create a temporary file or directory, in the default tempfile folder or if possible in a given folder.
+ This given folder ( the "parent" parameter ( if not NULL ) ) must be a "UCB compatible" URL.
+ The temporary object is created in the local file system, even if there is no UCB that can access it.
+ If the given folder is part of the local file system, the TempFile is created in this folder.
+ */
+ TempFile( const String* pParent=NULL, sal_Bool bDirectory=sal_False );
+
+ /**
+ Same as above; additionally the name starts with some given characters followed by a counter ( example:
+ rLeadingChars="abc" means "abc0","abc1" and so on, depending on existing files in the folder ).
+ The extension string may be f.e. ".txt" or "", if no extension string is given, ".tmp" is used
+ */
+ TempFile( const String& rLeadingChars, const String* pExtension=NULL, const String* pParent=NULL,
+ sal_Bool bDirectory=sal_False);
+
+ /**
+ Same as above; additionally the name starts with some given characters followed by a counter ( example:
+ rLeadingChars="abc" means "abc0","abc1" and so on, depending on existing files in the folder ).
+ The extension string may be f.e. ".txt" or "", if no extension string is given, ".tmp" is used
+ @param _bStartWithZero If set to false names will be generated like "abc","abc0","abc1"
+ */
+ TempFile( const String& rLeadingChars,sal_Bool _bStartWithZero, const String* pExtension=NULL, const String* pParent=NULL,sal_Bool bDirectory=sal_False);
+
+ /**
+ TempFile will be removed from disk in dtor if EnableKillingTempFile was called before.
+ Temporary directories will be removed recursively in that case.
+ */
+ ~TempFile();
+
+ /**
+ Returns sal_True if it has a valid file name.
+ */
+ sal_Bool IsValid() const;
+
+ /**
+ Returns the "UCB compatible" URL of the tempfile object.
+ If you want to have the "physical" file name, use the GetFileName() method of this object, because these
+ method uses the UCB for the conversion, but never use any external conversion functions for URLs into
+ "physical" names.
+ If no UCP is available for the local file system, an empty URL is returned. In this case you can't access
+ the file as a UCB content !
+ */
+ String GetURL() const;
+
+ /**
+ Returns the "physical" name of the tempfile in host notation ( should only be used for 3rd party code
+ with file name interfaces ).
+ If you want to have the URL, use the GetURL() method of this object, but never use any external
+ conversion functions for "physical" names into URLs.
+ */
+ String GetFileName() const;
+
+ /**
+ Returns a stream to the tempfiles data; the stream is owned by the tempfile object, so you have to keep this
+ alive as long as you want to use the stream. If the TempFile object is destroyed, it also destroys the
+ stream object, the underlying file is only deleted if EnableKillingFile( sal_True ) has been called before!
+ */
+ SvStream* GetStream( StreamMode eMode );
+
+ /**
+ Let the TempFile object close and destroy the owned stream object if any.
+ */
+ void CloseStream();
+
+ /**
+ If enabled the file will be removed from disk when the dtor is called ( default is not enabled )
+ */
+ void EnableKillingFile( sal_Bool bEnable=sal_True )
+ { bKillingFileEnabled = bEnable; }
+
+ sal_Bool IsKillingFileEnabled() const
+ { return bKillingFileEnabled; }
+
+ /**
+ Only create a "physical" file name for a temporary file that would be valid at that moment.
+ Should only be used for 3rd party code with a file name interface that wants to create the file by itself.
+ If you want to convert file name into a URL, always use class LocalFileHelper, but never use any
+ conversion functions of osl.
+ */
+ static String CreateTempName( const String* pParent=NULL );
+
+ /**
+ The TempNameBaseDirectory is a subfolder in the folder that is passed as a "physical" file name in the
+ SetTempNameBaseDirectory method.
+ This subfolder will be used if a TempFile or TempName is created without a parent name or a parent name
+ that does not belong to the local file system.
+ The caller of the SetTempNameBase is responsible for deleting this folder and all temporary files in it.
+ The return value of both methods is the complete "physical" name of the tempname base folder.
+ It is not a URL because alle URLs must be "UCB compatible", so there may be no suitable URL at all.
+ */
+ static String SetTempNameBaseDirectory( const String &rBaseName );
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/textsearch.hxx b/include/unotools/textsearch.hxx
new file mode 100644
index 000000000000..0b826102cb91
--- /dev/null
+++ b/include/unotools/textsearch.hxx
@@ -0,0 +1,186 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UNOTOOLS_TEXTSEARCH_HXX
+#define _UNOTOOLS_TEXTSEARCH_HXX
+#include <i18nlangtag/lang.h>
+#include <rtl/ustring.hxx>
+#include <tools/string.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/util/XTextSearch.hpp>
+#include <com/sun/star/util/SearchOptions.hpp>
+
+class CharClass;
+
+namespace com {
+ namespace sun {
+ namespace star {
+ namespace util {
+ struct SearchResult;
+ }
+ }
+ }
+}
+
+// ............................................................................
+namespace utl
+{
+// ............................................................................
+
+// Utility class for searching
+class UNOTOOLS_DLLPUBLIC SearchParam
+{
+public:
+ enum SearchType{ SRCH_NORMAL, SRCH_REGEXP, SRCH_LEVDIST };
+
+private:
+ String sSrchStr; // the search string
+ String sReplaceStr; // the replace string
+
+ SearchType m_eSrchType; // search normal/regular/LevDist
+
+ int m_bWordOnly : 1; // used by normal search
+ int m_bSrchInSel : 1; // search only in the selection
+ int m_bCaseSense : 1; //
+
+ // values for the "weight Levenshtein-Distance"
+ int bLEV_Relaxed : 1;
+ int nLEV_OtherX;
+ int nLEV_ShorterY;
+ int nLEV_LongerZ;
+
+ // asian flags - used for the transliteration
+ long nTransliterationFlags;
+
+public:
+ SearchParam( const OUString &rText,
+ SearchType eSrchType = SearchParam::SRCH_NORMAL,
+ sal_Bool bCaseSensitive = sal_True,
+ sal_Bool bWordOnly = sal_False,
+ sal_Bool bSearchInSelection = sal_False );
+
+ SearchParam( const SearchParam& );
+
+ ~SearchParam();
+
+ const String& GetSrchStr() const { return sSrchStr; }
+ const String& GetReplaceStr() const { return sReplaceStr; }
+ SearchType GetSrchType() const { return m_eSrchType; }
+
+ int IsCaseSensitive() const { return m_bCaseSense; }
+ int IsSrchInSelection() const { return m_bSrchInSel; }
+ int IsSrchWordOnly() const { return m_bWordOnly; }
+
+
+ void SetSrchStr( const String& rStr ) { sSrchStr = rStr; }
+ void SetReplaceStr( const String& rStr ) { sReplaceStr = rStr; }
+ void SetSrchType( SearchType eType ) { m_eSrchType = eType; }
+
+ void SetCaseSensitive( int bFlag ) { m_bCaseSense = bFlag; }
+ void SetSrchInSelection( int bFlag ) { m_bSrchInSel = bFlag; }
+ void SetSrchWordOnly( int bFlag ) { m_bWordOnly = bFlag; }
+
+ int IsSrchRelaxed() const { return bLEV_Relaxed; }
+ int GetLEVOther() const { return nLEV_OtherX; }
+ int GetLEVShorter() const { return nLEV_ShorterY; }
+ int GetLEVLonger() const { return nLEV_LongerZ; }
+
+ void SetSrchRelaxed( int bFlag ) { bLEV_Relaxed = bFlag; }
+ void SetLEVOther( int nValue ) { nLEV_OtherX = nValue; }
+ void SetLEVShorter( int nValue ) { nLEV_ShorterY = nValue; }
+ void SetLEVLonger( int nValue ) { nLEV_LongerZ = nValue; }
+
+ long GetTransliterationFlags() const { return nTransliterationFlags; }
+ void SetTransliterationFlags( long nValue ) { nTransliterationFlags = nValue; }
+};
+
+// Utility class for searching a substring in a string.
+// The following metrics are supported
+// - ordinary text (Bayer/Moore)
+// - regular expressions
+// - weighted Levenshtein distance
+//
+// This class allows forward and backward searching!
+
+class UNOTOOLS_DLLPUBLIC TextSearch
+{
+ static ::com::sun::star::uno::Reference< ::com::sun::star::util::XTextSearch >
+ getXTextSearch( const ::com::sun::star::util::SearchOptions& rPara );
+
+ com::sun::star::uno::Reference < com::sun::star::util::XTextSearch >
+ xTextSearch;
+
+ void Init( const SearchParam & rParam,
+ const ::com::sun::star::lang::Locale& rLocale );
+
+public:
+ // rText is the string being searched for
+ // this first two CTORs are deprecated!
+ TextSearch( const SearchParam & rPara, LanguageType nLanguage );
+ TextSearch( const SearchParam & rPara, const CharClass& rCClass );
+
+ TextSearch( const ::com::sun::star::util::SearchOptions& rPara );
+ ~TextSearch();
+
+ /* search in the (selected) text the search string:
+ rScrTxt - the text, in in which we search
+ pStart - start position for the search
+ pEnde - end position for the search
+
+ RETURN values == sal_True: something is found
+ - pStart start pos of the found text,
+ - pStart end pos of the found text,
+ - pSrchResult - the search result with all found
+ positions. Is only filled with more positions
+ if the regular expression handles groups.
+
+ == sal_False: nothing found, pStart,pEnde unchanged.
+
+ Definitions: start pos always inclusive, end pos always exclusive!
+ The position must always in the right direction!
+ search forward: start <= end
+ search backward: end <= start
+ */
+ int SearchFrwrd( const String &rStr,
+ xub_StrLen* pStart, xub_StrLen* pEnde,
+ ::com::sun::star::util::SearchResult* pSrchResult = 0 );
+ sal_Bool SearchForward( const OUString &rStr,
+ sal_Int32* pStart, sal_Int32* pEnd,
+ ::com::sun::star::util::SearchResult* pRes = 0 );
+ int SearchBkwrd( const String &rStr,
+ xub_StrLen* pStart, xub_StrLen* pEnde,
+ ::com::sun::star::util::SearchResult* pSrchResult = 0 );
+
+ void SetLocale( const ::com::sun::star::util::SearchOptions& rOpt,
+ const ::com::sun::star::lang::Locale& rLocale );
+
+ /* replace back references in the replace string by the sub expressions from the search result */
+ void ReplaceBackReferences( String& rReplaceStr, const String &rStr, const ::com::sun::star::util::SearchResult& rResult );
+
+};
+
+// ............................................................................
+} // namespace utl
+// ............................................................................
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/transliterationwrapper.hxx b/include/unotools/transliterationwrapper.hxx
new file mode 100644
index 000000000000..6d64d40a92f1
--- /dev/null
+++ b/include/unotools/transliterationwrapper.hxx
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#include "unotools/unotoolsdllapi.h"
+
+#ifndef _UNOTOOLS_TRANSLITERATIONWRAPPER_HXX
+#define _UNOTOOLS_TRANSLITERATIONWRAPPER_HXX
+#include <tools/string.hxx>
+#include <tools/solar.h>
+#include <i18nlangtag/languagetag.hxx>
+#include <com/sun/star/i18n/XExtendedTransliteration.hpp>
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+}}}
+
+namespace utl
+{
+
+class UNOTOOLS_DLLPUBLIC TransliterationWrapper
+{
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::i18n::XExtendedTransliteration > xTrans;
+ LanguageTag aLanguageTag;
+ sal_uInt32 nType;
+ mutable sal_Bool bFirstCall;
+
+ // not implemented, prevent usage
+ TransliterationWrapper( const TransliterationWrapper& );
+ TransliterationWrapper& operator=( const TransliterationWrapper& );
+
+ void loadModuleImpl() const;
+ void setLanguageLocaleImpl( sal_uInt16 nLang );
+
+public:
+ TransliterationWrapper( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > & rxContext,
+ sal_uInt32 nType );
+
+ ~TransliterationWrapper();
+
+ // get current Locale / Language
+ const ::com::sun::star::lang::Locale& getLocale() const { return aLanguageTag.getLocale();}
+ sal_uInt16 getLanguage() const { return aLanguageTag.getLanguageType(); }
+
+ sal_uInt32 getType() const { return nType; }
+
+ sal_Bool needLanguageForTheMode() const;
+
+ /** set a new language and load the corresponding transliteration module if
+ needed for the mode set with nType in the ctor */
+ void loadModuleIfNeeded( sal_uInt16 nLang );
+
+ /** Load the transliteration module specified by rModuleName, which has to
+ be the UNO service implementation name that is expanded to the full UNO
+ service implementation name, for example, "NumToCharKanjiShort_ja_JP"
+ expands to
+ "com.sun.star.i18n.Transliteration.NumToCharKanjiShort_ja_JP".
+ @ATTENTION!
+ This method ignores the mode type set with the constructor and
+ interferes with the loadModuleIfNeeded() method and the transliterate()
+ method that gets a LanguageType passed as parameter. Using one of
+ those may load a different module and overwrite this setting. Only the
+ transliterate() method that takes no LanguageType parameter may be used
+ for a specific module loaded with this method. */
+ void loadModuleByImplName( const String& rModuleName, sal_uInt16 nLang );
+
+ /** This transliteration method corresponds with the loadModuleByImplName()
+ method. It relies on a module being loaded and does not try load one.
+ If for any reason the string can't be transliterated the original
+ string is returned. */
+ String transliterate( const String& rStr,
+ xub_StrLen nStart, xub_StrLen nLen,
+ ::com::sun::star::uno::Sequence <sal_Int32>* pOffset ) const;
+
+ // Wrapper implementations of class Transliteration
+ String transliterate( const String& rStr, sal_uInt16 nLanguage,
+ xub_StrLen nStart, xub_StrLen nLen,
+ ::com::sun::star::uno::Sequence <sal_Int32>* pOffset );
+
+ /** If two strings are equal per this transliteration.
+ Returns the number of matched code points in any case, even if strings
+ are not equal, for example:
+ equals( "a", 0, 1, nMatch1, "aaa", 0, 3, nMatch2 )
+ returns false and nMatch:=1 and nMatch2:=1
+ equals( "aab", 0, 3, nMatch1, "aaa", 0, 3, nMatch2 )
+ returns false and nMatch:=2 and nMatch2:=2
+ */
+ sal_Bool equals(
+ const String& rStr1, sal_Int32 nPos1, sal_Int32 nCount1, sal_Int32& nMatch1,
+ const String& rStr2, sal_Int32 nPos2, sal_Int32 nCount2, sal_Int32& nMatch2 ) const;
+
+ sal_Int32 compareString( const String& rStr1, const String& rStr2 ) const;
+
+
+ // helpers
+
+ /** If two strings are really equal as per this translation, and not just
+ one string is matching the start of the other. Use this method instead
+ of compareString()==0 because it is much faster.
+ */
+ sal_Bool isEqual( const String& rStr1, const String& rStr2 ) const;
+
+ /** If string rStr1 matches the start of string rStr2, i.e. "a" in "aaa"
+ */
+ sal_Bool isMatch( const String& rStr1, const String& rStr2 ) const;
+
+};
+
+// ............................................................................
+} // namespace utl
+// ............................................................................
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/ucbhelper.hxx b/include/unotools/ucbhelper.hxx
new file mode 100644
index 000000000000..fad06ced5e2d
--- /dev/null
+++ b/include/unotools/ucbhelper.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 _UNOTOOLS_UCBHELPER_HXX
+#define _UNOTOOLS_UCBHELPER_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Sequence.hxx"
+#include "sal/types.h"
+#include "unotools/unotoolsdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+namespace ucbhelper { class Content; }
+
+namespace utl { namespace UCBContentHelper {
+
+UNOTOOLS_DLLPUBLIC bool IsDocument(OUString const & url);
+
+UNOTOOLS_DLLPUBLIC bool IsFolder(OUString const & url);
+
+/// @param title must not be null
+/// @return true iff title has been set (i.e., if obtaining the "Title" property
+/// of the given content yields a non-void value without raising a
+/// non-RuntimeException; RuntimeExceptions are passed through)
+UNOTOOLS_DLLPUBLIC bool GetTitle(
+ OUString const & url, OUString * title);
+
+UNOTOOLS_DLLPUBLIC bool Kill(OUString const & url);
+
+UNOTOOLS_DLLPUBLIC com::sun::star::uno::Any GetProperty(
+ OUString const & url, OUString const & property);
+
+UNOTOOLS_DLLPUBLIC bool MakeFolder(
+ ucbhelper::Content & parent, OUString const & title,
+ ucbhelper::Content & result, bool exclusive = false);
+
+/// @return the value of the "Size" property of the given content, or zero if
+/// obtaining the property yields a void value or raises a
+/// non-RuntimeException (RuntimeExceptions are passed through)
+UNOTOOLS_DLLPUBLIC sal_Int64 GetSize(OUString const & url);
+
+UNOTOOLS_DLLPUBLIC bool IsYounger(
+ OUString const & younger, OUString const & older);
+
+UNOTOOLS_DLLPUBLIC bool Exists(OUString const & url);
+
+UNOTOOLS_DLLPUBLIC bool IsSubPath(
+ OUString const & parent, OUString const & child);
+
+UNOTOOLS_DLLPUBLIC bool EqualURLs(
+ OUString const & url1, OUString const & url2);
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/ucblockbytes.hxx b/include/unotools/ucblockbytes.hxx
new file mode 100644
index 000000000000..cf5d98b93583
--- /dev/null
+++ b/include/unotools/ucblockbytes.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 _UNTOOLS_UCBLOCKBYTES_HXX
+#define _UNTOOLS_UCBLOCKBYTES_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/ucb/XContent.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include "unotools/unotoolsdllapi.h"
+
+#include <osl/thread.hxx>
+#include <osl/conditn.hxx>
+#include <osl/mutex.hxx>
+#include <tools/stream.hxx>
+#include <tools/link.hxx>
+#include <tools/errcode.hxx>
+#include <tools/datetime.hxx>
+
+namespace com
+{
+ namespace sun
+ {
+ namespace star
+ {
+ namespace task
+ {
+ class XInteractionHandler;
+ }
+ namespace io
+ {
+ class XStream;
+ class XInputStream;
+ class XOutputStream;
+ class XSeekable;
+ }
+ namespace ucb
+ {
+ class XContent;
+ }
+ namespace beans
+ {
+ struct PropertyValue;
+ }
+ }
+ }
+}
+
+namespace utl
+{
+SV_DECL_REF( UcbLockBytes )
+
+class UcbLockBytesHandler : public SvRefBase
+{
+ sal_Bool m_bActive;
+public:
+ enum LoadHandlerItem
+ {
+ DATA_AVAILABLE,
+ DONE,
+ CANCEL
+ };
+
+ UcbLockBytesHandler()
+ : m_bActive( sal_True )
+ {}
+
+ virtual void Handle( LoadHandlerItem nWhich, UcbLockBytesRef xLockBytes ) = 0;
+ void Activate( sal_Bool bActivate = sal_True ) { m_bActive = bActivate; }
+ sal_Bool IsActive() const { return m_bActive; }
+};
+
+SV_DECL_IMPL_REF( UcbLockBytesHandler )
+
+class UNOTOOLS_DLLPUBLIC UcbLockBytes : public virtual SvLockBytes
+{
+ osl::Condition m_aInitialized;
+ osl::Condition m_aTerminated;
+ osl::Mutex m_aMutex;
+
+ String m_aContentType;
+ String m_aRealURL;
+ DateTime m_aExpireDate;
+
+ ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > m_xInputStream;
+ ::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > m_xOutputStream;
+ ::com::sun::star::uno::Reference < ::com::sun::star::io::XSeekable > m_xSeekable;
+ void* m_pCommandThread; // is alive only for compatibility reasons
+ UcbLockBytesHandlerRef m_xHandler;
+
+ sal_uInt32 m_nRead;
+ sal_uInt32 m_nSize;
+ ErrCode m_nError;
+
+ sal_Bool m_bTerminated : 1;
+ sal_Bool m_bDontClose : 1;
+ sal_Bool m_bStreamValid : 1;
+
+ DECL_LINK( DataAvailHdl, void * );
+
+ UcbLockBytes( UcbLockBytesHandler* pHandler=NULL );
+protected:
+ virtual ~UcbLockBytes (void);
+
+public:
+ // properties: Referer, PostMimeType
+ static UcbLockBytesRef CreateLockBytes( const ::com::sun::star::uno::Reference < ::com::sun::star::ucb::XContent >& xContent,
+ const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rProps,
+ StreamMode eMode,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionHandler >& xInter,
+ UcbLockBytesHandler* pHandler=0 );
+
+ static UcbLockBytesRef CreateInputLockBytes( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream >& xContent );
+ static UcbLockBytesRef CreateLockBytes( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream >& xContent );
+
+ // SvLockBytes
+ virtual void SetSynchronMode (sal_Bool bSynchron);
+ virtual ErrCode ReadAt ( sal_uLong nPos, void *pBuffer, sal_uLong nCount, sal_uLong *pRead) const;
+ virtual ErrCode WriteAt ( sal_uLong, const void*, sal_uLong, sal_uLong *pWritten);
+ virtual ErrCode Flush (void) const;
+ virtual ErrCode SetSize (sal_uLong);
+ virtual ErrCode Stat ( SvLockBytesStat *pStat, SvLockBytesStatFlag) const;
+
+ void SetError( ErrCode nError )
+ { m_nError = nError; }
+
+ ErrCode GetError() const
+ { return m_nError; }
+
+ // the following properties are available when and after the first DataAvailable callback has been executed
+ String GetContentType() const;
+ String GetRealURL() const;
+ DateTime GetExpireDate() const;
+
+ // calling this method delegates the responsibility to call closeinput to the caller!
+ ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > getInputStream();
+
+ sal_Bool setInputStream_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > &rxInputStream,
+ sal_Bool bSetXSeekable = sal_True );
+ sal_Bool setStream_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream > &rxStream );
+ void terminate_Impl (void);
+
+ ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > getInputStream_Impl() const
+ {
+ osl::MutexGuard aGuard( (const_cast< UcbLockBytes* >(this))->m_aMutex );
+ return m_xInputStream;
+ }
+
+ ::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > getOutputStream_Impl() const
+ {
+ osl::MutexGuard aGuard( (const_cast< UcbLockBytes* >(this))->m_aMutex );
+ return m_xOutputStream;
+ }
+
+ ::com::sun::star::uno::Reference < ::com::sun::star::io::XSeekable > getSeekable_Impl() const
+ {
+ osl::MutexGuard aGuard( (const_cast< UcbLockBytes* >(this))->m_aMutex );
+ return m_xSeekable;
+ }
+
+ sal_Bool hasInputStream_Impl() const
+ {
+ osl::MutexGuard aGuard( (const_cast< UcbLockBytes* >(this))->m_aMutex );
+ return m_xInputStream.is();
+ }
+
+ void setDontClose_Impl()
+ { m_bDontClose = sal_True; }
+
+ void SetContentType_Impl( const String& rType ) { m_aContentType = rType; }
+ void SetRealURL_Impl( const String& rURL ) { m_aRealURL = rURL; }
+ void SetExpireDate_Impl( const DateTime& rDateTime ) { m_aExpireDate = rDateTime; }
+ void SetStreamValid_Impl();
+};
+
+SV_IMPL_REF( UcbLockBytes );
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/ucbstreamhelper.hxx b/include/unotools/ucbstreamhelper.hxx
new file mode 100644
index 000000000000..85de1f36c741
--- /dev/null
+++ b/include/unotools/ucbstreamhelper.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 _UNTOOLS_UCBSTREAMHELPER_HXX
+#define _UNTOOLS_UCBSTREAMHELPER_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XStream.hpp>
+#include "unotools/unotoolsdllapi.h"
+
+#include <tools/stream.hxx>
+
+namespace com
+{
+ namespace sun
+ {
+ namespace star
+ {
+ namespace task
+ {
+ class XInteractionHandler;
+ }
+ namespace io
+ {
+ class XStream;
+ class XInputStream;
+ }
+ }
+ }
+}
+
+class String;
+namespace utl
+{
+ class UcbLockBytesHandler;
+
+ class UNOTOOLS_DLLPUBLIC UcbStreamHelper : public SvStream
+ {
+ public:
+ static SvStream* CreateStream( const String& rFileName, StreamMode eOpenMode,
+ UcbLockBytesHandler* pHandler=0 );
+ static SvStream* CreateStream( const String& rFileName, StreamMode eOpenMode,
+ ::com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionHandler >,
+ UcbLockBytesHandler* pHandler=0 );
+ static SvStream* CreateStream( const String& rFileName, StreamMode eOpenMode,
+ sal_Bool bFileExists,
+ UcbLockBytesHandler* pHandler=0 );
+ static SvStream* CreateStream( ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xStream );
+ static SvStream* CreateStream( ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream > xStream );
+ static SvStream* CreateStream( ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xStream, sal_Bool bCloseStream );
+ static SvStream* CreateStream( ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream > xStream, sal_Bool bCloseStream );
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/unotoolsdllapi.h b/include/unotools/unotoolsdllapi.h
new file mode 100644
index 000000000000..a08f54ce8a5a
--- /dev/null
+++ b/include/unotools/unotoolsdllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_UNOTOOLSDLLAPI_H
+#define INCLUDED_UNOTOOLSDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(UNOTOOLS_DLLIMPLEMENTATION)
+#define UNOTOOLS_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define UNOTOOLS_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define UNOTOOLS_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_UNOTOOLSDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/useroptions.hxx b/include/unotools/useroptions.hxx
new file mode 100644
index 000000000000..77b71ee90bd1
--- /dev/null
+++ b/include/unotools/useroptions.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_unotools_USEROPTIONS_HXX
+#define INCLUDED_unotools_USEROPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <unotools/configitem.hxx>
+#include <osl/mutex.hxx>
+#include <unotools/options.hxx>
+#include <boost/shared_ptr.hpp>
+#include <boost/weak_ptr.hpp>
+
+// define ----------------------------------------------------------------
+
+#define USER_OPT_CITY ((sal_uInt16)0)
+#define USER_OPT_COMPANY ((sal_uInt16)1)
+#define USER_OPT_COUNTRY ((sal_uInt16)2)
+#define USER_OPT_EMAIL ((sal_uInt16)3)
+#define USER_OPT_FAX ((sal_uInt16)4)
+#define USER_OPT_FIRSTNAME ((sal_uInt16)5)
+#define USER_OPT_LASTNAME ((sal_uInt16)6)
+#define USER_OPT_POSITION ((sal_uInt16)7)
+#define USER_OPT_STATE ((sal_uInt16)8)
+#define USER_OPT_STREET ((sal_uInt16)9)
+#define USER_OPT_TELEPHONEHOME ((sal_uInt16)10)
+#define USER_OPT_TELEPHONEWORK ((sal_uInt16)11)
+#define USER_OPT_TITLE ((sal_uInt16)12)
+#define USER_OPT_ID ((sal_uInt16)13)
+#define USER_OPT_ZIP ((sal_uInt16)14)
+#define USER_OPT_FATHERSNAME ((sal_uInt16)15)
+#define USER_OPT_APARTMENT ((sal_uInt16)16)
+#define USER_OPT_CUSTOMERNUMBER ((sal_uInt16)17)
+
+// class SvtUserOptions --------------------------------------------------
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtUserOptions : public utl::detail::Options
+{
+public:
+ SvtUserOptions ();
+ virtual ~SvtUserOptions ();
+
+ static osl::Mutex& GetInitMutex ();
+
+ // get the address token
+ OUString GetCompany () const;
+ OUString GetFirstName () const;
+ OUString GetLastName () const;
+ OUString GetID () const;
+ OUString GetStreet () const;
+ OUString GetCity () const;
+ OUString GetState () const;
+ OUString GetZip () const;
+ OUString GetCountry () const;
+ OUString GetPosition () const;
+ OUString GetTitle () const;
+ OUString GetTelephoneHome () const;
+ OUString GetTelephoneWork () const;
+ OUString GetFax () const;
+ OUString GetEmail () const;
+ OUString GetCustomerNumber () const;
+
+ OUString GetFullName () const;
+
+ // set the address token
+ void SetCustomerNumber (OUString const&);
+
+ sal_Bool IsTokenReadonly (sal_uInt16 nToken) const;
+ OUString GetToken (sal_uInt16 nToken) const;
+ void SetToken (sal_uInt16 nToken, OUString const& rNewToken);
+
+private:
+ class Impl;
+ boost::shared_ptr<Impl> pImpl;
+ static boost::weak_ptr<Impl> pSharedImpl;
+private:
+ class ChangeListener;
+};
+
+#endif // #ifndef INCLUDED_unotools_USEROPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/viewoptions.hxx b/include/unotools/viewoptions.hxx
new file mode 100644
index 000000000000..8c8986dd4b99
--- /dev/null
+++ b/include/unotools/viewoptions.hxx
@@ -0,0 +1,318 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_unotools_VIEWOPTIONS_HXX
+#define INCLUDED_unotools_VIEWOPTIONS_HXX
+
+#include "unotools/unotoolsdllapi.h"
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <unotools/configmgr.hxx>
+#include <unotools/configitem.hxx>
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+class SvtViewOptionsBase_Impl;
+
+/*-************************************************************************************************************//**
+ @descr Use these enum values to specify right list in configuration in which your view data are saved.
+*//*-*************************************************************************************************************/
+
+enum EViewType
+{
+ E_DIALOG = 0,
+ E_TABDIALOG = 1,
+ E_TABPAGE = 2,
+ E_WINDOW = 3
+};
+
+/*-************************************************************************************************************//**
+ @short collect information about view features
+ @descr We support different basetypes of views like dialogs, tab-dialogs, tab-pages and normal windows.
+ You must specify your basetype by using right enum value and must give us a valid name for your
+ subkey in registry! We support some fix features for some bastypes and user data as string for all!
+ see also configuration package "org.openoffice.Office.Views/..." for further information.
+
+ template of configuration:
+ DialogType
+ /WindowState [string]
+ /UserData [set of any scalar types]
+ TabDialogType
+ /WindowState [string]
+ /UserData [set of any scalar types]
+ /PageID [int]
+ TabPageType
+ /WindowState [string]
+ /UserData [set of any scalar types]
+ WindowType
+ /WindowState [string]
+ /UserData [set of any scalar types]
+ /Visible [boolean]
+
+ structure of configuration:
+
+ org.openoffice.Office.Views [package]
+ /Dialogs [set]
+ /Dialog_FileOpen [DialogType]
+ /Dialog_ImportGraphics [DialogType]
+ ...
+ /Dialog_<YourName> [DialogType]
+
+ /TabDialogs [set]
+ /TabDialog_001 [TabDialogType]
+ /TabDialog_Blubber [TabDialogType]
+ ...
+ /TabDialog_<YourName> [TabDialogType]
+
+ /TabPages [set]
+ /TabPage_XXX [TabPageType]
+ /TabPage_Date [TabPageType]
+ ...
+ /TabPage_<YourName> [TabPageType]
+
+ /Windows [set]
+ /Window_User [WindowType]
+ /Window_Options [WindowType]
+ ...
+ /Window_<YourName> [WindowType]
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtViewOptions : public utl::detail::Options
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will de-/initialize an instance with default values.
+ You must give us the basic type of your view and a name which specify right entry
+ in dynamical configuration list. If entry not exist, we create a new one!
+
+ @seealso enum EViewType
+
+ @param "eType" specify type of your view and is used to use right data container!
+ @param "sViewName" specify the name of your view and is the key name in data list too.
+ @return -
+
+ @onerror An assertion is thrown in debug version. Otherwise we do nothing!
+ *//*-*****************************************************************************************************/
+
+ SvtViewOptions( EViewType eType ,
+ const OUString& sViewName );
+ virtual ~SvtViewOptions();
+
+ /*-****************************************************************************************************//**
+ @short support preload of these config item
+ @descr Sometimes we need preloading of these configuration data without real using of it.
+
+ @seealso -
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ static void AcquireOptions();
+ static void ReleaseOptions();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short use it to get information about existing entries in configuration
+ @descr The methods to set/get the position or size will create a new entry automaticly if
+ it not already exist and work with default values!
+ If this a problem for you - you MUST call these method before and
+ you must make up your own mind about that.
+
+ @seealso -
+
+ @onerror No error should occure.
+ *//*-*****************************************************************************************************/
+
+ sal_Bool Exists() const;
+
+ /*-****************************************************************************************************//**
+ @short use it to delete an entry of dynamic view set
+ @descr You can use this method to delete anexisting node in configuration.
+ But if you call a Set- or Get- method again on this instance
+ the item is created again! If you do nothing after this call
+ your view will die relay in configuration ...
+
+ @seealso method Exist()
+
+ @return True if delete OK, False otherwise.
+
+ @onerror We return sal_False.
+ *//*-*****************************************************************************************************/
+
+ sal_Bool Delete();
+
+ /*-****************************************************************************************************//**
+ @short use it to set/get the window state of your view
+ @descr These value describe position/size and some other states of a window.
+ Use it with right vcl methods directly. Normaly it's not neccessary to
+ parse given string!
+
+ @seealso vcl methods
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ OUString GetWindowState( ) const;
+ void SetWindowState( const OUString& sState );
+
+ /*-****************************************************************************************************//**
+ @short use it to set/get the page number which was the last active one
+ @descr It's only supported for: - tab-dialogs
+ If you call it for other ones you will get an assertion in debug version.
+ In a product version we do nothing!
+
+ @seealso -
+
+ @onerror An assertion is thrown in debug version. Otherwise we do nothing!
+ *//*-*****************************************************************************************************/
+
+ sal_Int32 GetPageID( ) const;
+ void SetPageID( sal_Int32 nID );
+
+ /*-****************************************************************************************************//**
+ @short use it to set/get the visual state of a window
+ @descr It's only supported for: - windows
+ If you call it for other ones you will get an assertion in debug version.
+ In a product version we do nothing!
+
+ @seealso -
+
+ @onerror An assertion is thrown in debug version. Otherwise we do nothing!
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsVisible ( ) const;
+ void SetVisible( sal_Bool bState );
+
+ /** Return true if the "Visible" property actually has a non-nil value
+
+ (IsVisible will somewhat arbitrarily return false if the property is
+ nil.)
+ */
+ bool HasVisible() const;
+
+ /*-****************************************************************************************************//**
+ @short use it to set/get the extended user data (consisting of a set of named scalar values)
+ @descr It's supported for ALL types!
+ Every view can handle its own user defined data set.
+
+ @seealso -
+
+ @onerror In the non-product version, an assertion is made. In a product version, errors are silently ignored.
+ *//*-*****************************************************************************************************/
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetUserData( ) const;
+ void SetUserData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& lData );
+
+ /*-****************************************************************************************************//**
+ @short use it to set/get ONE special user data item directly
+ @descr Normaly you can work on full user data list by using "Set/GetUserData()".
+ With this function you have an access on special list entries directly without any
+
+ @seealso -
+
+ @onerror In the non-product version, an assertion is made. In a product version, errors are silently ignored.
+ *//*-*****************************************************************************************************/
+
+ ::com::sun::star::uno::Any GetUserItem( const OUString& sName ) const;
+ void SetUserItem( const OUString& sName ,
+ const ::com::sun::star::uno::Any& aValue );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is threadsafe.
+ We create a static mutex only for one time and use it to protect our refcount and container
+ member!
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /// specify which list of views in configuration is used! This can't be a static value!!!
+ /// ... because we need this value to work with right static data container.
+ EViewType m_eViewType ;
+ OUString m_sViewName ;
+
+ /// - impl. data container as dynamic pointer for smaller memory requirements!
+ /// - internal ref count mechanism
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double defined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtViewOptionsBase_Impl* m_pDataContainer_Dialogs ; /// hold data for all dialogs
+ static sal_Int32 m_nRefCount_Dialogs ;
+ static SvtViewOptionsBase_Impl* m_pDataContainer_TabDialogs ; /// hold data for all tab-dialogs
+ static sal_Int32 m_nRefCount_TabDialogs ;
+ static SvtViewOptionsBase_Impl* m_pDataContainer_TabPages ; /// hold data for all tab-pages
+ static sal_Int32 m_nRefCount_TabPages ;
+ static SvtViewOptionsBase_Impl* m_pDataContainer_Windows ; /// hold data for all windows
+ static sal_Int32 m_nRefCount_Windows ;
+
+}; // class SvtViewOptions
+
+#endif // #ifndef INCLUDED_unotools_VIEWOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/xmlaccelcfg.hxx b/include/unotools/xmlaccelcfg.hxx
new file mode 100644
index 000000000000..d0e15dcfdbec
--- /dev/null
+++ b/include/unotools/xmlaccelcfg.hxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_unotools_XMLACCELCFG_HXX
+#define INCLUDED_unotools_XMLACCELCFG_HXX
+
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <cppuhelper/weak.hxx>
+
+struct SvtAcceleratorConfigItem
+{
+ sal_uInt16 nCode;
+ sal_uInt16 nModifier;
+ OUString aCommand;
+};
+
+#include <list>
+typedef ::std::list < SvtAcceleratorConfigItem > SvtAcceleratorItemList;
+
+
+class OReadAccelatorDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
+ public ::cppu::OWeakObject
+{
+ public:
+ OReadAccelatorDocumentHandler( SvtAcceleratorItemList& aNewAcceleratorItemList ) :
+ m_nElementDepth( 0 ),
+ m_bAcceleratorMode( sal_False ),
+ m_bItemCloseExpected( sal_False ),
+ m_xLocator( 0 ),
+ m_aReadAcceleratorList( aNewAcceleratorItemList ) {}
+ virtual ~OReadAccelatorDocumentHandler() {}
+
+ // XInterface
+ virtual void SAL_CALL acquire() throw()
+ { OWeakObject::acquire(); }
+ virtual void SAL_CALL release() throw()
+ { OWeakObject::release(); }
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
+ const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XDocumentHandler
+ virtual void SAL_CALL startDocument(void)
+ throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL endDocument(void)
+ throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL startElement(
+ const OUString& aName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &xAttribs )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL endElement(const OUString& aName) throw
+ ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL characters(const OUString& aChars)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL ignorableWhitespace(const OUString& aWhitespaces)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setDocumentLocator(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > &xLocator)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+ private:
+ OUString getErrorLineString();
+
+ int m_nElementDepth;
+ sal_Bool m_bAcceleratorMode;
+ sal_Bool m_bItemCloseExpected;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
+ SvtAcceleratorItemList& m_aReadAcceleratorList;
+};
+
+
+class OWriteAccelatorDocumentHandler
+{
+ public:
+ OWriteAccelatorDocumentHandler(
+ const SvtAcceleratorItemList& aWriteAcceleratorList,
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > );
+ virtual ~OWriteAccelatorDocumentHandler();
+
+ void WriteAcceleratorDocument() throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+ private:
+ void WriteAcceleratorItem( const SvtAcceleratorConfigItem& aAcceleratorItem ) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xWriteDocumentHandler;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > m_xEmptyList;
+ OUString m_aAttributeType;
+ const SvtAcceleratorItemList& m_aWriteAcceleratorList;
+};
+
+#endif // INCLUDED_unotools_XMLACCELCFG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/helperdecl.hxx b/include/vbahelper/helperdecl.hxx
new file mode 100644
index 000000000000..a8a3d75142e0
--- /dev/null
+++ b/include/vbahelper/helperdecl.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 OOVBAAPI_SERV_DECL
+#define OOVBAAPI_SERV_DECL
+#include <comphelper/servicedecl.hxx>
+#include <ooo/vba/XHelperInterface.hpp>
+
+namespace comphelper {
+namespace service_decl {
+template <typename ImplT_, typename WithArgsT = with_args<false> >
+struct vba_service_class_ : public serviceimpl_base< detail::OwnServiceImpl<ImplT_>, WithArgsT >
+{
+ typedef serviceimpl_base< detail::OwnServiceImpl<ImplT_>, WithArgsT > baseT;
+ /** Default ctor. Implementation class without args, expecting
+ component context as single argument.
+ */
+ vba_service_class_() : baseT() {}
+ template <typename PostProcessFuncT>
+ /** Ctor to pass a post processing function/functor.
+
+ @tpl PostProcessDefaultT let your compiler deduce this
+ @param postProcessFunc function/functor that gets the yet unacquired
+ ImplT_ pointer returning a
+ uno::Reference<uno::XInterface>
+ */
+ explicit vba_service_class_( PostProcessFuncT const& postProcessFunc ) : baseT( postProcessFunc ) {}
+};
+
+} // namespace service_decl
+} // namespace comphelper
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbaaccesshelper.hxx b/include/vbahelper/vbaaccesshelper.hxx
new file mode 100644
index 000000000000..11bbff2426a9
--- /dev/null
+++ b/include/vbahelper/vbaaccesshelper.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 OOVBAAPI_VBA_ACCESS_HELPER_HXX
+#define OOVBAAPI_VBA_ACCESS_HELPER_HXX
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <basic/basmgr.hxx>
+#include <sfx2/objsh.hxx>
+#include <sfx2/docfilt.hxx>
+#include <sfx2/docfile.hxx>
+//#define VBAHELPER_DLLIMPLEMENTATION
+#include <vbahelper/vbadllapi.h>
+#include <memory>
+
+namespace ooo
+{
+ namespace vba
+ {
+
+ VBAHELPER_DLLPRIVATE inline css::uno::Reference< css::lang::XMultiServiceFactory > getVBAServiceFactory( SfxObjectShell* pShell )
+ {
+ css::uno::Any aUnoVar;
+ if ( !pShell || ! pShell->GetBasicManager()->GetGlobalUNOConstant( "VBAGlobals", aUnoVar ) )
+ throw css::lang::IllegalArgumentException();
+ css::uno::Reference< css::lang::XMultiServiceFactory > xVBAFactory( aUnoVar, css::uno::UNO_QUERY_THROW );
+ return xVBAFactory;
+ }
+
+ VBAHELPER_DLLPRIVATE inline css::uno::Reference< css::uno::XInterface > createVBAUnoAPIServiceWithArgs( SfxObjectShell* pShell, const sal_Char* _pAsciiName, const css::uno::Sequence< css::uno::Any >& aArgs ) throw (css::uno::Exception)
+ {
+ OSL_PRECOND( pShell, "createVBAUnoAPIService: no shell!" );
+ OUString sVarName( OUString::createFromAscii( _pAsciiName ) );
+ css::uno::Reference< css::uno::XInterface > xIf = getVBAServiceFactory( pShell )->createInstanceWithArguments( sVarName, aArgs );
+ return xIf;
+ }
+
+
+ VBAHELPER_DLLPRIVATE inline bool isAlienDoc( SfxObjectShell& rDocShell, const char* pMimeType )
+ {
+ bool bRes( false );
+ const SfxMedium *pMedium = rDocShell.GetMedium();
+ const SfxFilter *pFilt = pMedium ? pMedium->GetFilter() : NULL;
+ if ( pFilt && pFilt->IsAlienFormat() )
+ bRes = ( pFilt->GetMimeType().compareToAscii( pMimeType ) == 0 );
+ return bRes;
+ }
+ VBAHELPER_DLLPRIVATE inline bool isAlienExcelDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/vnd.ms-excel" ); }
+ //VBAHELPER_DLLPRIVATE inline bool isAlienWordDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/vnd.ms-word" ); }
+ // word seems to return an erroneous mime type :-/ "application/msword" not consistent with the excel one
+ VBAHELPER_DLLPRIVATE inline bool isAlienWordDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/msword" ); }
+
+ } // openoffice
+} // org
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbaapplicationbase.hxx b/include/vbahelper/vbaapplicationbase.hxx
new file mode 100644
index 000000000000..c63bce52c263
--- /dev/null
+++ b/include/vbahelper/vbaapplicationbase.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 VBA_APPLICATION_BASE_HXX
+#define VBA_APPLICATION_BASE_HXX
+
+#include <ooo/vba/XHelperInterface.hpp>
+#include <ooo/vba/XApplicationBase.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <sfx2/objsh.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::XApplicationBase > ApplicationBase_BASE;
+
+struct VbaApplicationBase_Impl;
+
+class VBAHELPER_DLLPUBLIC VbaApplicationBase : public ApplicationBase_BASE
+{
+ VbaApplicationBase_Impl* m_pImpl;
+
+protected:
+ VbaApplicationBase( const css::uno::Reference< css::uno::XComponentContext >& xContext );
+ virtual ~VbaApplicationBase();
+
+ virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() throw (css::uno::RuntimeException) = 0;
+public:
+ // XHelperInterface ( parent is itself )
+ virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return this; }
+
+ virtual sal_Bool SAL_CALL getScreenUpdating() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setScreenUpdating(sal_Bool bUpdate) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getDisplayStatusBar() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getInteractive() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setInteractive( ::sal_Bool bInteractive ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( ::sal_Bool bVisible ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL OnKey( const OUString& Key, const ::com::sun::star::uno::Any& Procedure ) throw (::com::sun::star::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getVersion() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getVBE() throw (css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL Run( const OUString& MacroName, const css::uno::Any& varg1, const css::uno::Any& varg2, const css::uno::Any& varg3, const css::uno::Any& varg4, const css::uno::Any& varg5, const css::uno::Any& varg6, const css::uno::Any& varg7, const css::uno::Any& varg8, const css::uno::Any& varg9, const css::uno::Any& varg10, const css::uno::Any& varg11, const css::uno::Any& varg12, const css::uno::Any& varg13, const css::uno::Any& varg14, const css::uno::Any& varg15, const css::uno::Any& varg16, const css::uno::Any& varg17, const css::uno::Any& varg18, const css::uno::Any& varg19, const css::uno::Any& varg20, const css::uno::Any& varg21, const css::uno::Any& varg22, const css::uno::Any& varg23, const css::uno::Any& varg24, const css::uno::Any& varg25, const css::uno::Any& varg26, const css::uno::Any& varg27, const css::uno::Any& varg28, const css::uno::Any& varg29, const css::uno::Any& varg30 ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL OnTime( const css::uno::Any& aEarliestTime, const OUString& aFunction, const css::uno::Any& aLatestTime, const css::uno::Any& aSchedule ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL CentimetersToPoints( float _Centimeters ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Undo() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Quit() throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual OUString getServiceImplName();
+ virtual css::uno::Sequence<OUString> getServiceNames();
+};
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbacollectionimpl.hxx b/include/vbahelper/vbacollectionimpl.hxx
new file mode 100644
index 000000000000..780741e06a62
--- /dev/null
+++ b/include/vbahelper/vbacollectionimpl.hxx
@@ -0,0 +1,352 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef OOVBAAPI_VBA_COLLECTION_IMPL_HXX
+#define OOVBAAPI_VBA_COLLECTION_IMPL_HXX
+
+#include <ooo/vba/XCollection.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/script/XDefaultMethod.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+#include "vbahelper/vbahelper.hxx"
+#include "vbahelper/vbahelperinterface.hxx"
+
+#include <vector>
+
+// ============================================================================
+
+typedef ::cppu::WeakImplHelper1< css::container::XEnumeration > EnumerationHelper_BASE;
+
+// ============================================================================
+
+/** A wrapper that holds a com.sun.star.container.XIndexAccess and provides a
+ com.sun.star.container.XEnumeration.
+
+ Can be used to provide an enumeration from an index container that contains
+ completely constructed/initialized VBA implementation objects. CANNOT be
+ used to provide an enumeration from an index container with other objects
+ (e.g. UNO objects) where construction of the VBA objects is needed first.
+ */
+class VBAHELPER_DLLPUBLIC SimpleIndexAccessToEnumeration : public EnumerationHelper_BASE
+{
+public:
+ explicit SimpleIndexAccessToEnumeration(
+ const css::uno::Reference< css::container::XIndexAccess >& rxIndexAccess ) throw (css::uno::RuntimeException) :
+ mxIndexAccess( rxIndexAccess ), mnIndex( 0 ) {}
+
+ virtual sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException)
+ {
+ return mnIndex < mxIndexAccess->getCount();
+ }
+
+ virtual css::uno::Any SAL_CALL nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {
+ if( !hasMoreElements() )
+ throw css::container::NoSuchElementException();
+ return mxIndexAccess->getByIndex( mnIndex++ );
+ }
+
+private:
+ css::uno::Reference< css::container::XIndexAccess > mxIndexAccess;
+ sal_Int32 mnIndex;
+};
+
+// ============================================================================
+
+/** A wrapper that holds a com.sun.star.container.XEnumeration or a
+ com.sun.star.container.XIndexAccess and provides an enumeration of VBA objects.
+
+ The method createCollectionObject() needs to be implemented by the derived
+ class. This class can be used to convert an enumeration or an index container
+ containing UNO objects to an enumeration providing the related VBA objects.
+ */
+class VBAHELPER_DLLPUBLIC SimpleEnumerationBase : public EnumerationHelper_BASE
+{
+public:
+ explicit SimpleEnumerationBase(
+ const css::uno::Reference< ov::XHelperInterface >& rxParent,
+ const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+ const css::uno::Reference< css::container::XEnumeration >& rxEnumeration ) throw (css::uno::RuntimeException) :
+ mxParent( rxParent ), mxContext( rxContext ), mxEnumeration( rxEnumeration ) {}
+
+ explicit SimpleEnumerationBase(
+ const css::uno::Reference< ov::XHelperInterface >& rxParent,
+ const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+ const css::uno::Reference< css::container::XIndexAccess >& rxIndexAccess ) throw (css::uno::RuntimeException) :
+ mxParent( rxParent ), mxContext( rxContext ), mxEnumeration( new SimpleIndexAccessToEnumeration( rxIndexAccess ) ) {}
+
+ virtual sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException)
+ {
+ return mxEnumeration->hasMoreElements();
+ }
+
+ virtual css::uno::Any SAL_CALL nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {
+ return createCollectionObject( mxEnumeration->nextElement() );
+ }
+
+ /** Derived classes implement creation of a VBA implementation object from
+ the passed container element. */
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& rSource ) = 0;
+
+protected:
+ css::uno::Reference< ov::XHelperInterface > mxParent;
+ css::uno::Reference< css::uno::XComponentContext > mxContext;
+ css::uno::Reference< css::container::XEnumeration > mxEnumeration;
+};
+
+// ============================================================================
+
+// deprecated, use SimpleEnumerationBase instead!
+class VBAHELPER_DLLPUBLIC EnumerationHelperImpl : public EnumerationHelper_BASE
+{
+protected:
+ css::uno::WeakReference< ov::XHelperInterface > m_xParent;
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+ css::uno::Reference< css::container::XEnumeration > m_xEnumeration;
+public:
+
+ EnumerationHelperImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XEnumeration >& xEnumeration ) throw ( css::uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration ) { }
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException) { return m_xEnumeration->hasMoreElements(); }
+};
+
+// a wrapper class for a providing a XIndexAccess, XNameAccess, XEnumerationAccess impl based on providing a vector of interfaces
+// only requirement is the object needs to implement XName
+
+
+
+typedef ::cppu::WeakImplHelper3< css::container::XNameAccess, css::container::XIndexAccess, css::container::XEnumerationAccess > XNamedCollectionHelper_BASE;
+
+template< typename Ifc1 >
+class XNamedObjectCollectionHelper : public XNamedCollectionHelper_BASE
+{
+public:
+typedef std::vector< css::uno::Reference< Ifc1 > > XNamedVec;
+private:
+
+ class XNamedEnumerationHelper : public EnumerationHelper_BASE
+ {
+ XNamedVec mXNamedVec;
+ typename XNamedVec::iterator mIt;
+ public:
+ XNamedEnumerationHelper( const XNamedVec& sMap ) : mXNamedVec( sMap ), mIt( mXNamedVec.begin() ) {}
+
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException)
+ {
+ return ( mIt != mXNamedVec.end() );
+ }
+
+ virtual css::uno::Any SAL_CALL nextElement( ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {
+ if ( hasMoreElements() )
+ return css::uno::makeAny( *mIt++ );
+ throw css::container::NoSuchElementException();
+ }
+ };
+
+protected:
+ XNamedVec mXNamedVec;
+ typename XNamedVec::iterator cachePos;
+public:
+ XNamedObjectCollectionHelper( const XNamedVec& sMap ) : mXNamedVec( sMap ), cachePos(mXNamedVec.begin()) {}
+ // XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType( ) throw (css::uno::RuntimeException) { return Ifc1::static_type(0); }
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (css::uno::RuntimeException) { return ( mXNamedVec.size() > 0 ); }
+ // XNameAcess
+ virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {
+ if ( !hasByName(aName) )
+ throw css::container::NoSuchElementException();
+ return css::uno::makeAny( *cachePos );
+ }
+ virtual css::uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< OUString > sNames( mXNamedVec.size() );
+ OUString* pString = sNames.getArray();
+ typename XNamedVec::iterator it = mXNamedVec.begin();
+ typename XNamedVec::iterator it_end = mXNamedVec.end();
+
+ for ( ; it != it_end; ++it, ++pString )
+ {
+ css::uno::Reference< css::container::XNamed > xName( *it, css::uno::UNO_QUERY_THROW );
+ *pString = xName->getName();
+ }
+ return sNames;
+ }
+ virtual ::sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (css::uno::RuntimeException)
+ {
+ cachePos = mXNamedVec.begin();
+ typename XNamedVec::iterator it_end = mXNamedVec.end();
+ for ( ; cachePos != it_end; ++cachePos )
+ {
+ css::uno::Reference< css::container::XNamed > xName( *cachePos, css::uno::UNO_QUERY_THROW );
+ if ( aName.equals( xName->getName() ) )
+ break;
+ }
+ return ( cachePos != it_end );
+ }
+
+ // XElementAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (css::uno::RuntimeException) { return mXNamedVec.size(); }
+ virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException )
+ {
+ if ( Index < 0 || Index >= getCount() )
+ throw css::lang::IndexOutOfBoundsException();
+
+ return css::uno::makeAny( mXNamedVec[ Index ] );
+
+ }
+ // XEnumerationAccess
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration( ) throw (css::uno::RuntimeException)
+ {
+ return new XNamedEnumerationHelper( mXNamedVec );
+ }
+};
+
+// including a HelperInterface implementation
+template< typename Ifc1 >
+class ScVbaCollectionBase : public InheritedHelperInterfaceImpl< Ifc1 >
+{
+typedef InheritedHelperInterfaceImpl< Ifc1 > BaseColBase;
+protected:
+ css::uno::Reference< css::container::XIndexAccess > m_xIndexAccess;
+ css::uno::Reference< css::container::XNameAccess > m_xNameAccess;
+ sal_Bool mbIgnoreCase;
+
+ virtual css::uno::Any getItemByStringIndex( const OUString& sIndex ) throw (css::uno::RuntimeException)
+ {
+ if ( !m_xNameAccess.is() )
+ throw css::uno::RuntimeException( OUString( "ScVbaCollectionBase string index access not supported by this object" ), css::uno::Reference< css::uno::XInterface >() );
+
+ if( mbIgnoreCase )
+ {
+ css::uno::Sequence< OUString > sElementNames = m_xNameAccess->getElementNames();
+ for( sal_Int32 i = 0; i < sElementNames.getLength(); i++ )
+ {
+ OUString aName = sElementNames[i];
+ if( aName.equalsIgnoreAsciiCase( sIndex ) )
+ {
+ return createCollectionObject( m_xNameAccess->getByName( aName ) );
+ }
+ }
+ }
+ return createCollectionObject( m_xNameAccess->getByName( sIndex ) );
+ }
+
+ virtual css::uno::Any getItemByIntIndex( const sal_Int32 nIndex ) throw (css::uno::RuntimeException)
+ {
+ if ( !m_xIndexAccess.is() )
+ throw css::uno::RuntimeException( OUString( "ScVbaCollectionBase numeric index access not supported by this object" ), css::uno::Reference< css::uno::XInterface >() );
+ if ( nIndex <= 0 )
+ {
+ throw css::lang::IndexOutOfBoundsException(
+ OUString( "index is 0 or negative" ),
+ css::uno::Reference< css::uno::XInterface >() );
+ }
+ // need to adjust for vba index ( for which first element is 1 )
+ return createCollectionObject( m_xIndexAccess->getByIndex( nIndex - 1 ) );
+ }
+
+ virtual void UpdateCollectionIndex( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess )
+ {
+ css::uno::Reference< css::container::XNameAccess > xNameAccess( xIndexAccess, css::uno::UNO_QUERY_THROW );
+ m_xIndexAccess = xIndexAccess;
+ m_xNameAccess = xNameAccess;
+ }
+
+public:
+ ScVbaCollectionBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, sal_Bool bIgnoreCase = sal_False ) : BaseColBase( xParent, xContext ), m_xIndexAccess( xIndexAccess ), mbIgnoreCase( bIgnoreCase ) { m_xNameAccess.set(m_xIndexAccess, css::uno::UNO_QUERY); }
+ //XCollection
+ virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException)
+ {
+ return m_xIndexAccess->getCount();
+ }
+
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw (css::uno::RuntimeException)
+ {
+ if ( Index1.getValueTypeClass() != css::uno::TypeClass_STRING )
+ {
+ sal_Int32 nIndex = 0;
+
+ if ( ( Index1 >>= nIndex ) != sal_True )
+ {
+ OUString message;
+ message = OUString( "Couldn't convert index to Int32");
+ throw css::lang::IndexOutOfBoundsException( message,
+ css::uno::Reference< css::uno::XInterface >() );
+ }
+ return getItemByIntIndex( nIndex );
+ }
+ OUString aStringSheet;
+
+ Index1 >>= aStringSheet;
+ return getItemByStringIndex( aStringSheet );
+ }
+ // XDefaultMethod
+ OUString SAL_CALL getDefaultMethodName( ) throw (css::uno::RuntimeException)
+ {
+ const static OUString sName( "Item" );
+ return sName;
+ }
+ // XEnumerationAccess
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException) = 0;
+
+ // XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) = 0;
+ // XElementAccess
+ virtual ::sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException)
+ {
+ return ( m_xIndexAccess->getCount() > 0 );
+ }
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) = 0;
+
+};
+
+typedef ::cppu::WeakImplHelper1<ov::XCollection> XCollection_InterfacesBASE;
+
+typedef ScVbaCollectionBase< XCollection_InterfacesBASE > CollImplBase1;
+// compatible with the old collections ( pre XHelperInterface base class ) ( some internal objects still use this )
+class VBAHELPER_DLLPUBLIC ScVbaCollectionBaseImpl : public CollImplBase1
+{
+public:
+ ScVbaCollectionBaseImpl( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ) throw( css::uno::RuntimeException ) : CollImplBase1( xParent, xContext, xIndexAccess){}
+
+};
+
+template <typename Ifc> // where Ifc must implement XCollectionTest
+class CollTestImplHelper : public ScVbaCollectionBase< ::cppu::WeakImplHelper1< Ifc > >
+{
+typedef ScVbaCollectionBase< ::cppu::WeakImplHelper1< Ifc > > ImplBase1;
+
+public:
+ CollTestImplHelper( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, sal_Bool bIgnoreCase = sal_False ) throw( css::uno::RuntimeException ) : ImplBase1( xParent, xContext, xIndexAccess, bIgnoreCase ) {}
+};
+
+
+#endif //SC_VBA_COLLECTION_IMPL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbadialogbase.hxx b/include/vbahelper/vbadialogbase.hxx
new file mode 100644
index 000000000000..bb706cbaf17a
--- /dev/null
+++ b/include/vbahelper/vbadialogbase.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 VBA_DIALOG_BASE_HXX
+#define VBA_DIALOG_BASE_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/XDialogBase.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/frame/XModel.hpp>
+
+typedef InheritedHelperInterfaceImpl1< ov::XDialogBase > VbaDialogBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaDialogBase : public VbaDialogBase_BASE
+{
+protected:
+ sal_Int32 mnIndex;
+ css::uno::Reference< css::frame::XModel > m_xModel;
+public:
+ VbaDialogBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel, sal_Int32 nIndex ):VbaDialogBase_BASE( xParent, xContext ), mnIndex( nIndex ), m_xModel( xModel ) {}
+ virtual ~VbaDialogBase() {}
+
+ // Methods
+ virtual void SAL_CALL Show() throw (css::uno::RuntimeException);
+ virtual OUString mapIndexToName( sal_Int32 nIndex ) = 0;
+};
+
+#endif /* VBA_DIALOG_BASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbadialogsbase.hxx b/include/vbahelper/vbadialogsbase.hxx
new file mode 100644
index 000000000000..54c1fd33f107
--- /dev/null
+++ b/include/vbahelper/vbadialogsbase.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 VBA_DIALOGS_BASE_HXX
+#define VBA_DIALOGS_BASE_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/XHelperInterface.hpp>
+#include <ooo/vba/XDialogsBase.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <com/sun/star/frame/XModel.hpp>
+
+typedef InheritedHelperInterfaceImpl1< ov::XDialogsBase > VbaDialogsBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaDialogsBase : public VbaDialogsBase_BASE
+{
+protected:
+ css::uno::Reference< css::frame::XModel > m_xModel;
+public:
+ VbaDialogsBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel ): VbaDialogsBase_BASE( xParent, xContext ), m_xModel( xModel ) {}
+ virtual ~VbaDialogsBase() {}
+
+ // XCollection
+ virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
+};
+
+#endif /* VBA_DIALOGS_BASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbadllapi.h b/include/vbahelper/vbadllapi.h
new file mode 100644
index 000000000000..43beae86b676
--- /dev/null
+++ b/include/vbahelper/vbadllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_VBADLLAPI_H
+#define INCLUDED_VBADLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(VBAHELPER_DLLIMPLEMENTATION)
+#define VBAHELPER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define VBAHELPER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define VBAHELPER_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_SVLDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbadocumentbase.hxx b/include/vbahelper/vbadocumentbase.hxx
new file mode 100644
index 000000000000..77e799078a97
--- /dev/null
+++ b/include/vbahelper/vbadocumentbase.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 VBA_DOCUMENTBASE_HXX
+#define VBA_DOCUMENTBASE_HXX
+
+#include <com/sun/star/frame/XModel.hpp>
+#include <ooo/vba/XDocumentBase.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::XDocumentBase > VbaDocumentBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaDocumentBase : public VbaDocumentBase_BASE
+{
+protected:
+ css::uno::Reference< css::frame::XModel > mxModel;
+ css::uno::Reference< css::uno::XInterface > mxVBProject;
+protected:
+ virtual css::uno::Reference< css::frame::XModel > getModel() { return mxModel; }
+public:
+ VbaDocumentBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ css::uno::Reference< css::frame::XModel > xModel );
+ VbaDocumentBase( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext );
+ virtual ~VbaDocumentBase() {}
+
+ // Attributes
+ virtual OUString SAL_CALL getName() throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getPath() throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getFullName() throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getSaved() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSaved( sal_Bool bSave ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getVBProject() throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL Close( const css::uno::Any &bSaveChanges,
+ const css::uno::Any &aFileName,
+ const css::uno::Any &bRouteWorkbook ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Protect( const css::uno::Any &aPassword ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Unprotect( const css::uno::Any &aPassword ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Save() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual OUString getServiceImplName();
+ virtual css::uno::Sequence<OUString> getServiceNames();
+};
+
+#endif /* VBA_DOCUMENTBASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbadocumentsbase.hxx b/include/vbahelper/vbadocumentsbase.hxx
new file mode 100644
index 000000000000..b8386d6e291e
--- /dev/null
+++ b/include/vbahelper/vbadocumentsbase.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 VBA_WORKBOOKS_HXX
+#define VBA_WORKBOOKS_HXX
+
+
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/XDocumentsBase.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+
+typedef CollTestImplHelper< ooo::vba::XDocumentsBase > VbaDocumentsBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaDocumentsBase : public VbaDocumentsBase_BASE
+{
+public:
+ enum DOCUMENT_TYPE
+ {
+ WORD_DOCUMENT = 1,
+ EXCEL_DOCUMENT
+ };
+
+private:
+ DOCUMENT_TYPE meDocType;
+
+public:
+ VbaDocumentsBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, DOCUMENT_TYPE eDocType ) throw (css::uno::RuntimeException);
+ virtual ~VbaDocumentsBase() {}
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) = 0;
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException) = 0;
+
+ // VbaDocumentsBase_BASE
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) = 0;
+
+protected:
+ css::uno::Any createDocument() throw (css::uno::RuntimeException);
+ void closeDocuments() throw (css::uno::RuntimeException);
+ css::uno::Any openDocument( const OUString& Filename, const css::uno::Any& ReadOnly, const css::uno::Sequence< css::beans::PropertyValue >& rProps ) throw (css::uno::RuntimeException);
+};
+
+#endif /* SC_VBA_WORKBOOKS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbaeventshelperbase.hxx b/include/vbahelper/vbaeventshelperbase.hxx
new file mode 100644
index 000000000000..627970f9f623
--- /dev/null
+++ b/include/vbahelper/vbaeventshelperbase.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 VBAHELPER_VBAEVENTSHELPERBASE_HXX
+#define VBAHELPER_VBAEVENTSHELPERBASE_HXX
+
+#include <deque>
+#include <map>
+#include <boost/unordered_map.hpp>
+#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
+#include <com/sun/star/util/XChangesListener.hpp>
+#include <cppuhelper/implbase3.hxx>
+#include "vbahelper/vbahelper.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace script { namespace vba { class XVBAModuleInfo; } }
+ namespace uno { class XComponentContext; }
+} } }
+
+// ============================================================================
+
+typedef ::cppu::WeakImplHelper3<
+ css::script::vba::XVBAEventProcessor,
+ css::document::XEventListener,
+ css::util::XChangesListener > VbaEventsHelperBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaEventsHelperBase : public VbaEventsHelperBase_BASE
+{
+public:
+ VbaEventsHelperBase(
+ const css::uno::Sequence< css::uno::Any >& rArgs,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext );
+ virtual ~VbaEventsHelperBase();
+
+ // script::vba::XVBAEventProcessor
+ virtual sal_Bool SAL_CALL hasVbaEventHandler( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL processVbaEvent( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException, css::util::VetoException, css::uno::RuntimeException);
+
+ // document::XEventListener
+ virtual void SAL_CALL notifyEvent( const css::document::EventObject& rEvent ) throw (css::uno::RuntimeException);
+
+ // util::XChangesListener
+ virtual void SAL_CALL changesOccurred( const css::util::ChangesEvent& rEvent ) throw (css::uno::RuntimeException);
+
+ // lang::XEventListener
+ virtual void SAL_CALL disposing( const css::lang::EventObject& rEvent ) throw (css::uno::RuntimeException);
+
+ // little helpers ---------------------------------------------------------
+
+ /** Helper to execute event handlers without throwing any exceptions. */
+ void processVbaEventNoThrow( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs );
+
+ /** Throws, if the passed sequence does not contain a value at the specified index. */
+ static inline void checkArgument( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) throw (css::lang::IllegalArgumentException)
+ { if( (nIndex < 0) || (nIndex >= rArgs.getLength()) ) throw css::lang::IllegalArgumentException(); }
+
+ /** Throws, if the passed sequence does not contain a value of a specific at the specified index. */
+ template< typename Type >
+ static inline void checkArgumentType( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) throw (css::lang::IllegalArgumentException)
+ { checkArgument( rArgs, nIndex ); if( !rArgs[ nIndex ].has< Type >() ) throw css::lang::IllegalArgumentException(); }
+
+protected:
+ // ------------------------------------------------------------------------
+
+ struct EventHandlerInfo
+ {
+ sal_Int32 mnEventId;
+ sal_Int32 mnModuleType;
+ OUString maMacroName;
+ sal_Int32 mnCancelIndex;
+ css::uno::Any maUserData;
+ };
+
+ /** Registers a supported event handler.
+
+ @param nEventId Event identifier from com.sun.star.script.vba.VBAEventId.
+ @param nModuleType Type of the module containing the event handler.
+ @param pcMacroName Name of the associated VBA event handler macro.
+ @param nCancelIndex 0-based index of Cancel parameter, or -1.
+ @param rUserData User data for free usage in derived implementations. */
+ void registerEventHandler(
+ sal_Int32 nEventId,
+ sal_Int32 nModuleType,
+ const sal_Char* pcMacroName,
+ sal_Int32 nCancelIndex = -1,
+ const css::uno::Any& rUserData = css::uno::Any() );
+
+ // ------------------------------------------------------------------------
+
+ struct EventQueueEntry
+ {
+ sal_Int32 mnEventId;
+ css::uno::Sequence< css::uno::Any > maArgs;
+ inline /*implicit*/ EventQueueEntry( sal_Int32 nEventId ) : mnEventId( nEventId ) {}
+ inline EventQueueEntry( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs ) : mnEventId( nEventId ), maArgs( rArgs ) {}
+ };
+ typedef ::std::deque< EventQueueEntry > EventQueue;
+
+ /** Derived classes do additional prpeparations and return whether the
+ event handler has to be called. */
+ virtual bool implPrepareEvent(
+ EventQueue& rEventQueue,
+ const EventHandlerInfo& rInfo,
+ const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::uno::RuntimeException) = 0;
+
+ /** Derived classes have to return the argument list for the specified VBA event handler. */
+ virtual css::uno::Sequence< css::uno::Any > implBuildArgumentList(
+ const EventHandlerInfo& rInfo,
+ const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException) = 0;
+
+ /** Derived classes may do additional postprocessing. Called even if the
+ event handler does not exist, or if an error occurred during execution. */
+ virtual void implPostProcessEvent(
+ EventQueue& rEventQueue,
+ const EventHandlerInfo& rInfo,
+ bool bCancel ) throw (css::uno::RuntimeException) = 0;
+
+ /** Derived classes have to return the name of the Basic document module. */
+ virtual OUString implGetDocumentModuleName(
+ const EventHandlerInfo& rInfo,
+ const css::uno::Sequence< css::uno::Any >& rArgs ) const throw (css::lang::IllegalArgumentException) = 0;
+
+private:
+ typedef ::std::map< sal_Int32, OUString > ModulePathMap;
+
+ /** Starts listening at the document model. */
+ void startListening();
+ /** Stops listening at the document model. */
+ void stopListening();
+
+ /** Returns the event handler info struct for the specified event, or throws. */
+ const EventHandlerInfo& getEventHandlerInfo( sal_Int32 nEventId ) const throw (css::lang::IllegalArgumentException);
+
+ /** Searches the event handler in the document and returns its full script path. */
+ OUString getEventHandlerPath(
+ const EventHandlerInfo& rInfo,
+ const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
+
+ /** On first call, accesses the Basic library containing the VBA source code. */
+ void ensureVBALibrary() throw (css::uno::RuntimeException);
+
+ /** Returns the type of the Basic module with the specified name. */
+ sal_Int32 getModuleType( const OUString& rModuleName ) throw (css::uno::RuntimeException);
+
+ /** Updates the map containing paths to event handlers for a Basic module. */
+ ModulePathMap& updateModulePathMap( const OUString& rModuleName ) throw (css::uno::RuntimeException);
+
+protected:
+ css::uno::Reference< css::frame::XModel > mxModel;
+ SfxObjectShell* mpShell;
+
+private:
+ typedef ::std::map< sal_Int32, EventHandlerInfo > EventHandlerInfoMap;
+ typedef boost::unordered_map< OUString, ModulePathMap, OUStringHash > EventHandlerPathMap;
+
+ EventHandlerInfoMap maEventInfos;
+ EventHandlerPathMap maEventPaths;
+ css::uno::Reference< css::script::vba::XVBAModuleInfo > mxModuleInfos;
+ OUString maLibraryName;
+ bool mbDisposed;
+};
+
+// ============================================================================
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbafontbase.hxx b/include/vbahelper/vbafontbase.hxx
new file mode 100644
index 000000000000..ddfb30899f82
--- /dev/null
+++ b/include/vbahelper/vbafontbase.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef VBAHELPER_FONTBASE_HXX
+#define VBAHELPER_FONTBASE_HXX
+
+#include <cppuhelper/implbase1.hxx>
+
+#include <ooo/vba/XFontBase.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+// use local constants there is no need to expose these constants
+// externally. Looking at the Format->Character dialog it seem that
+// these may infact be even be calculated. Leave hardcoded for now
+// #FIXEME #TBD investigate the code for dialog mentioned above
+
+// The font baseline is not specified.
+const short NORMAL = 0;
+
+// specifies a superscripted.
+const short SUPERSCRIPT = 33;
+
+// specifies a subscripted.
+const short SUBSCRIPT = -33;
+
+// specifies a hight of superscripted font
+ const sal_Int8 SUPERSCRIPTHEIGHT = 58;
+
+// specifies a hight of subscripted font
+const sal_Int8 SUBSCRIPTHEIGHT = 58;
+
+// specifies a hight of normal font
+const short NORMALHEIGHT = 100;
+
+typedef InheritedHelperInterfaceImpl1< ov::XFontBase > VbaFontBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaFontBase : public VbaFontBase_BASE
+{
+protected:
+ css::uno::Reference< css::beans::XPropertySet > mxFont;
+ css::uno::Reference< css::container::XIndexAccess > mxPalette;
+ bool mbFormControl;
+
+public:
+ VbaFontBase(
+ const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::container::XIndexAccess >& xPalette,
+ const css::uno::Reference< css::beans::XPropertySet >& xPropertySet,
+ bool bFormControl = false ) throw ( css::uno::RuntimeException );
+ virtual ~VbaFontBase();// {}
+
+ // Attributes
+ virtual css::uno::Any SAL_CALL getSize() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSize( const css::uno::Any& _size ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getColorIndex() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setColorIndex( const css::uno::Any& _colorindex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getBold() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setBold( const css::uno::Any& _bold ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getUnderline() throw (css::uno::RuntimeException) = 0;
+ virtual void SAL_CALL setUnderline( const css::uno::Any& _underline ) throw (css::uno::RuntimeException) = 0;
+ virtual css::uno::Any SAL_CALL getStrikethrough() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setStrikethrough( const css::uno::Any& _strikethrough ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getShadow() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setShadow( const css::uno::Any& _shadow ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getItalic() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setItalic( const css::uno::Any& _italic ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getSubscript() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSubscript( const css::uno::Any& _subscript ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getSuperscript() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSuperscript( const css::uno::Any& _superscript ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getName() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setName( const css::uno::Any& _name ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getColor() throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL setColor( const css::uno::Any& _color ) throw (css::uno::RuntimeException) ;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbaglobalbase.hxx b/include/vbahelper/vbaglobalbase.hxx
new file mode 100644
index 000000000000..4c30a26c95c0
--- /dev/null
+++ b/include/vbahelper/vbaglobalbase.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 VBA_GLOBAL_BASE_HXX
+#define VBA_GLOBAL_BASE_HXX
+
+#include "vbahelperinterface.hxx"
+#include <ooo/vba/XGlobalsBase.hpp>
+
+typedef InheritedHelperInterfaceImpl1< ov::XGlobalsBase > Globals_BASE;
+class VBAHELPER_DLLPUBLIC VbaGlobalsBase : public Globals_BASE
+{
+protected:
+ OUString msDocCtxName;
+ OUString msApplication;
+
+ bool hasServiceName( const OUString& serviceName );
+ void init( const css::uno::Sequence< css::beans::PropertyValue >& aInitArgs );
+
+public:
+ VbaGlobalsBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const OUString& sDocCtxName );
+ virtual ~VbaGlobalsBase();
+ // XMultiServiceFactory
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) throw (css::uno::Exception, css::uno::RuntimeException);
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString& ServiceSpecifier, const css::uno::Sequence< css::uno::Any >& Arguments ) throw (css::uno::Exception, css::uno::RuntimeException);
+ virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames( ) throw (css::uno::RuntimeException);
+};
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbahelper.hxx b/include/vbahelper/vbahelper.hxx
new file mode 100644
index 000000000000..be5d73906c53
--- /dev/null
+++ b/include/vbahelper/vbahelper.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 OOVBAAPI_VBA_HELPER_HXX
+#define OOVBAAPI_VBA_HELPER_HXX
+
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/beans/XIntrospectionAccess.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/script/BasicErrorException.hpp>
+#include <com/sun/star/script/XTypeConverter.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/XDevice.hpp>
+#include <com/sun/star/awt/XUnitConversion.hpp>
+#include <basic/basmgr.hxx>
+#include <basic/sberrors.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/frame/XModel.hpp>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/objsh.hxx>
+#include <sfx2/docfilt.hxx>
+#include <sfx2/docfile.hxx>
+#include <vcl/pointr.hxx>
+#include <memory>
+#include "vbaaccesshelper.hxx"
+
+namespace ooo
+{
+ namespace vba
+ {
+ template < class T >
+ css::uno::Reference< T > getXSomethingFromArgs( css::uno::Sequence< css::uno::Any > const & args, sal_Int32 nPos, bool bCanBeNull = true ) throw (css::lang::IllegalArgumentException)
+ {
+ if ( args.getLength() < ( nPos + 1) )
+ throw css::lang::IllegalArgumentException();
+ css::uno::Reference< T > aSomething( args[ nPos ], css::uno::UNO_QUERY );
+ if ( !bCanBeNull && !aSomething.is() )
+ throw css::lang::IllegalArgumentException();
+ return aSomething;
+ }
+
+ class XHelperInterface;
+
+ /** Returns the VBA document implementation object representing the passed UNO document model. */
+ VBAHELPER_DLLPUBLIC css::uno::Reference< XHelperInterface > getVBADocument( const css::uno::Reference< css::frame::XModel >& xModel );
+ VBAHELPER_DLLPUBLIC css::uno::Reference< XHelperInterface > getUnoDocModule( const String& aModName, SfxObjectShell* pShell );
+ VBAHELPER_DLLPUBLIC SfxObjectShell* getSfxObjShell( const css::uno::Reference< css::frame::XModel >& xModel ) throw ( css::uno::RuntimeException);
+
+ css::uno::Reference< css::frame::XModel > getCurrentDoc( const OUString& sKey ) throw (css::uno::RuntimeException);
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getThisExcelDoc( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getThisWordDoc( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getCurrentExcelDoc( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getCurrentWordDoc( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::beans::XIntrospectionAccess > getIntrospectionAccess( const css::uno::Any& aObject ) throw (css::uno::RuntimeException);
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::script::XTypeConverter > getTypeConverter( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+
+ VBAHELPER_DLLPUBLIC void dispatchRequests( const css::uno::Reference< css::frame::XModel>& xModel, const OUString& aUrl );
+ VBAHELPER_DLLPUBLIC void dispatchRequests (const css::uno::Reference< css::frame::XModel>& xModel, const OUString & aUrl, const css::uno::Sequence< css::beans::PropertyValue >& sProps );
+ VBAHELPER_DLLPUBLIC void dispatchExecute(SfxViewShell* pView, sal_uInt16 nSlot, SfxCallMode nCall = SFX_CALLMODE_SYNCHRON );
+ VBAHELPER_DLLPUBLIC sal_Int32 OORGBToXLRGB( sal_Int32 );
+ VBAHELPER_DLLPUBLIC sal_Int32 XLRGBToOORGB( sal_Int32 );
+ VBAHELPER_DLLPUBLIC css::uno::Any OORGBToXLRGB( const css::uno::Any& );
+ VBAHELPER_DLLPUBLIC css::uno::Any XLRGBToOORGB( const css::uno::Any& );
+ // provide a NULL object that can be passed as variant so that
+ // the object when passed to IsNull will return true. aNULL
+ // contains an empty object reference
+ VBAHELPER_DLLPUBLIC const css::uno::Any& aNULL();
+ VBAHELPER_DLLPUBLIC void PrintOutHelper( SfxViewShell* pViewShell, const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, sal_Bool bSelection );
+ VBAHELPER_DLLPUBLIC void PrintPreviewHelper( const css::uno::Any& EnableChanges, SfxViewShell* );
+ VBAHELPER_DLLPUBLIC void WaitUntilPreviewIsClosed( SfxViewFrame* );
+
+ /** Extracts a boolean value from the passed Any, which may contain a Boolean or an integer or floating-point value.
+ Throws, if the Any is empty or contains an incompatible type. */
+ VBAHELPER_DLLPUBLIC bool extractBoolFromAny( const css::uno::Any& rAny ) throw (css::uno::RuntimeException);
+
+ /** Extracts a string from the passed Any, which may contain a Boolean, a value, or a string.
+ Throws, if the Any is empty or contains an incompatible type. */
+ VBAHELPER_DLLPUBLIC OUString extractStringFromAny( const css::uno::Any& rAny, bool bUppercaseBool = false ) throw (css::uno::RuntimeException);
+ /** Extracts a string from the passed Any, which may contain a Boolean, a value, or a string.
+ Returns rDefault, if rAny is empty. Throws, if the Any contains an incompatible type. */
+ VBAHELPER_DLLPUBLIC OUString extractStringFromAny( const css::uno::Any& rAny, const OUString& rDefault, bool bUppercaseBool = false ) throw (css::uno::RuntimeException);
+
+ VBAHELPER_DLLPUBLIC OUString getAnyAsString( const css::uno::Any& pvargItem ) throw ( css::uno::RuntimeException );
+ VBAHELPER_DLLPUBLIC OUString VBAToRegexp(const OUString &rIn, bool bForLike = false); // needs to be in an uno service ( already this code is duplicated in basic )
+ VBAHELPER_DLLPUBLIC double getPixelTo100thMillimeterConversionFactor( const css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical);
+ VBAHELPER_DLLPUBLIC double PointsToPixels( const css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical);
+ VBAHELPER_DLLPUBLIC double PixelsToPoints( const css::uno::Reference< css::awt::XDevice >& xDevice, double fPixels, sal_Bool bVertical);
+ VBAHELPER_DLLPUBLIC sal_Int32 PointsToHmm( double fPoints );
+ VBAHELPER_DLLPUBLIC double HmmToPoints( sal_Int32 nHmm );
+ VBAHELPER_DLLPUBLIC sal_Int32 getPointerStyle( const css::uno::Reference< css::frame::XModel >& );
+ VBAHELPER_DLLPUBLIC void setCursorHelper( const css::uno::Reference< css::frame::XModel >& xModel, const Pointer& rPointer, sal_Bool bOverWrite );
+ VBAHELPER_DLLPUBLIC void setDefaultPropByIntrospection( const css::uno::Any& aObj, const css::uno::Any& aValue ) throw ( css::uno::RuntimeException );
+ VBAHELPER_DLLPUBLIC css::uno::Any getPropertyValue( const css::uno::Sequence< css::beans::PropertyValue >& aProp, const OUString& aName );
+ VBAHELPER_DLLPUBLIC sal_Bool setPropertyValue( css::uno::Sequence< css::beans::PropertyValue >& aProp, const OUString& aName, const css::uno::Any& aValue );
+ VBAHELPER_DLLPUBLIC void setOrAppendPropertyValue( css::uno::Sequence< css::beans::PropertyValue >& aProp, const OUString& aName, const css::uno::Any& aValue );
+
+class VBAHELPER_DLLPUBLIC Millimeter
+{
+//Factor to translate between points and hundredths of millimeters:
+private:
+ double m_nMillimeter;
+
+public:
+ Millimeter();
+
+ Millimeter(double mm);
+
+ void setInPoints(double points) ;
+ double getInHundredthsOfOneMillimeter();
+ static sal_Int32 getInHundredthsOfOneMillimeter(double points);
+ static double getInPoints(int _hmm);
+};
+
+class VBAHELPER_DLLPUBLIC AbstractGeometryAttributes // probably should replace the ShapeHelper below
+{
+public:
+ virtual ~AbstractGeometryAttributes() {}
+ virtual double getLeft() const = 0;
+ virtual void setLeft( double ) = 0;
+ virtual double getTop() const = 0;
+ virtual void setTop( double ) = 0;
+ virtual double getHeight() const = 0;
+ virtual void setHeight( double ) = 0;
+ virtual double getWidth() const = 0;
+ virtual void setWidth( double ) = 0;
+
+ virtual double getInnerHeight() const { return 0.0; }
+ virtual void setInnerHeight( double ) {}
+ virtual double getInnerWidth() const { return 0.0; }
+ virtual void setInnerWidth( double ) {}
+ virtual double getOffsetX() const { return 0.0; }
+ virtual double getOffsetY() const { return 0.0; }
+};
+
+namespace msforms {
+ class XShape;
+}
+
+class VBAHELPER_DLLPUBLIC ShapeHelper
+{
+protected:
+ css::uno::Reference< css::drawing::XShape > xShape;
+public:
+ ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xShape) throw (css::script::BasicErrorException );
+
+ double getHeight() const;
+ void setHeight(double _fheight) throw ( css::script::BasicErrorException );
+ double getWidth() const;
+ void setWidth(double _fWidth) throw ( css::script::BasicErrorException );
+ double getLeft() const;
+ void setLeft(double _fLeft);
+ double getTop() const;
+ void setTop(double _fTop);
+};
+
+class VBAHELPER_DLLPUBLIC ConcreteXShapeGeometryAttributes : public AbstractGeometryAttributes
+{
+ std::auto_ptr< ShapeHelper > m_pShapeHelper;
+public:
+ ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape );
+ virtual double getLeft() const;
+ virtual void setLeft( double nLeft );
+ virtual double getTop() const;
+ virtual void setTop( double nTop );
+ virtual double getHeight() const;
+ virtual void setHeight( double nHeight );
+ virtual double getWidth() const;
+ virtual void setWidth( double nWidth);
+ virtual ~ConcreteXShapeGeometryAttributes();
+};
+
+#define VBA_LEFT "PositionX"
+#define VBA_TOP "PositionY"
+class VBAHELPER_DLLPUBLIC UserFormGeometryHelper : public AbstractGeometryAttributes
+{
+public:
+ UserFormGeometryHelper(
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::awt::XControl >& xControl,
+ double fOffsetX, double fOffsetY );
+ virtual double getLeft() const;
+ virtual void setLeft( double fLeft );
+ virtual double getTop() const;
+ virtual void setTop( double fTop );
+ virtual double getWidth() const;
+ virtual void setWidth( double fWidth );
+ virtual double getHeight() const;
+ virtual void setHeight( double fHeight );
+ virtual double getInnerWidth() const;
+ virtual void setInnerWidth( double fWidth );
+ virtual double getInnerHeight() const;
+ virtual void setInnerHeight( double fHeight );
+ virtual double getOffsetX() const;
+ virtual double getOffsetY() const;
+
+private:
+ double implGetPos( bool bPosY ) const;
+ void implSetPos( double fPos, bool bPosY );
+ double implGetSize( bool bHeight, bool bOuter ) const;
+ void implSetSize( double fSize, bool bHeight, bool bOuter );
+
+private:
+ css::uno::Reference< css::awt::XWindow > mxWindow;
+ css::uno::Reference< css::beans::XPropertySet > mxModelProps;
+ css::uno::Reference< css::awt::XUnitConversion > mxUnitConv;
+ double mfOffsetX;
+ double mfOffsetY;
+ sal_Bool mbDialog;
+};
+
+class VBAHELPER_DLLPUBLIC ContainerUtilities
+{
+
+public:
+ static OUString getUniqueName( const css::uno::Sequence< OUString >& _slist, const OUString& _sElementName, const OUString& _sSuffixSeparator);
+ static OUString getUniqueName( const css::uno::Sequence< OUString >& _slist, const OUString _sElementName, const OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix );
+
+ static sal_Int32 FieldInList( const css::uno::Sequence< OUString >& SearchList, const OUString& SearchString );
+};
+
+// really just a a place holder to ease the porting pain
+class VBAHELPER_DLLPUBLIC DebugHelper
+{
+public:
+ static void exception( const OUString& DetailedMessage, const css::uno::Exception& ex, int err, const OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException );
+
+ static void exception( int err, const OUString& additionalArgument ) throw( css::script::BasicErrorException );
+
+ static void exception( const css::uno::Exception& ex ) throw( css::script::BasicErrorException );
+};
+
+ } // vba
+} // ooo
+
+namespace ov = ooo::vba;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbahelperinterface.hxx b/include/vbahelper/vbahelperinterface.hxx
new file mode 100644
index 000000000000..a37bb59dc129
--- /dev/null
+++ b/include/vbahelper/vbahelperinterface.hxx
@@ -0,0 +1,185 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef OOVBAAPI_VBA_HELPERINTERFACE_HXX
+#define OOVBAAPI_VBA_HELPERINTERFACE_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <ooo/vba/XHelperInterface.hpp>
+#include <vbahelper/vbahelper.hxx>
+#include <com/sun/star/container/XNameAccess.hpp>
+
+// use this class when you have an a object like
+// interface XAnInterface which contains XHelperInterface in its inheritance hierarchy
+// interface XAnInterface
+// {
+// interface XHelperInterface;
+// [attribute, string] name;
+// }
+// or
+// interface XAnInterface : XHelperInterface;
+// {
+// [attribute, string] name;
+// }
+//
+// then this class can provide a default implementation of XHelperInterface,
+// you can use it like this
+// typedef InheritedHelperInterfaceImpl< XAnInterface > > AnInterfaceImpl_BASE;
+// class AnInterfaceImpl : public AnInterfaceImpl_BASE
+// {
+// public:
+// AnInterface( const Reference< HelperInterface >& xParent ) : AnInterfaceImpl_BASE( xParent ) {}
+// // implement XAnInterface methods only, no need to implement the XHelperInterface
+// // methods
+// virtual void setName( const OUString& );
+// virtual OUString getName();
+// }
+//
+
+template< typename Ifc1 >
+class SAL_DLLPUBLIC_TEMPLATE InheritedHelperInterfaceImpl : public Ifc1
+{
+protected:
+ css::uno::WeakReference< ov::XHelperInterface > mxParent;
+ css::uno::Reference< css::uno::XComponentContext > mxContext;
+public:
+ InheritedHelperInterfaceImpl() {}
+ InheritedHelperInterfaceImpl( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : mxContext( xContext ) {}
+ InheritedHelperInterfaceImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : mxParent( xParent ), mxContext( xContext ) {}
+ virtual OUString getServiceImplName() = 0;
+ virtual css::uno::Sequence<OUString> getServiceNames() = 0;
+
+ // XHelperInterface Methods
+ virtual ::sal_Int32 SAL_CALL getCreator() throw (css::script::BasicErrorException, css::uno::RuntimeException)
+ {
+ return 0x53756E4F;
+ }
+ virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return mxParent; }
+
+ virtual css::uno::Any SAL_CALL Application( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) {
+ // The application could certainly be passed around in the context - seems
+ // to make sense
+ css::uno::Reference< css::container::XNameAccess > xNameAccess( mxContext, css::uno::UNO_QUERY_THROW );
+ return xNameAccess->getByName( "Application" );
+ }
+
+ // XServiceInfo Methods
+ virtual OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException) { return getServiceImplName(); }
+ virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< OUString > sServices = getSupportedServiceNames();
+ const OUString* pStart = sServices.getConstArray();
+ const OUString* pEnd = pStart + sServices.getLength();
+ for ( ; pStart != pEnd ; ++pStart )
+ if ( (*pStart).equals( ServiceName ) )
+ return sal_True;
+ return sal_False;
+ }
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< OUString > aNames = getServiceNames();
+ return aNames;
+ }
+ };
+
+template< typename Ifc1 >
+class SAL_DLLPUBLIC_TEMPLATE InheritedHelperInterfaceImpl1 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > >
+{
+ typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > > Base;
+public:
+ InheritedHelperInterfaceImpl1< Ifc1 >() {}
+ InheritedHelperInterfaceImpl1< Ifc1 >( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xContext ) {}
+ InheritedHelperInterfaceImpl1< Ifc1 >( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {}
+};
+
+template< typename Ifc1, typename Ifc2 >
+class SAL_DLLPUBLIC_TEMPLATE InheritedHelperInterfaceImpl2 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper2< Ifc1, Ifc2 > >
+{
+ typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper2< Ifc1, Ifc2 > > Base;
+public:
+ InheritedHelperInterfaceImpl2< Ifc1, Ifc2 >() {}
+ InheritedHelperInterfaceImpl2< Ifc1, Ifc2 >( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xContext ) {}
+ InheritedHelperInterfaceImpl2< Ifc1, Ifc2 >( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {}
+};
+
+template< typename Ifc1, typename Ifc2, typename Ifc3 >
+class SAL_DLLPUBLIC_TEMPLATE InheritedHelperInterfaceImpl3 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper3< Ifc1, Ifc2, Ifc3 > >
+{
+ typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper3< Ifc1, Ifc2, Ifc3 > > Base;
+public:
+ InheritedHelperInterfaceImpl3< Ifc1, Ifc2, Ifc3 >() {}
+ InheritedHelperInterfaceImpl3< Ifc1, Ifc2, Ifc3 >( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xContext ) {}
+ InheritedHelperInterfaceImpl3< Ifc1, Ifc2, Ifc3 >( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {}
+};
+
+// ============================================================================
+
+/** Helper macro to implement the method 'getServiceImplName()' of the
+ 'ooo.vba.XHelperInterface' interface. Will return the class name as service
+ implementation name.
+ */
+#define VBAHELPER_IMPL_GETSERVICEIMPLNAME( classname ) \
+OUString classname::getServiceImplName() \
+{ \
+ return OUString( #classname ); \
+}
+
+// ----------------------------------------------------------------------------
+
+/** Helper macro to implement the method 'getServiceNames()' for a single
+ service name.
+ */
+#define VBAHELPER_IMPL_GETSERVICENAMES( classname, servicename ) \
+css::uno::Sequence< OUString > classname::getServiceNames() \
+{ \
+ static css::uno::Sequence< OUString > saServiceNames; \
+ if( saServiceNames.getLength() == 0 ) \
+ { \
+ saServiceNames.realloc( 1 ); \
+ saServiceNames[ 0 ] = servicename; \
+ } \
+ return saServiceNames; \
+}
+
+// ----------------------------------------------------------------------------
+
+/** Helper macro to declare the methods 'getServiceImplName()' and
+ 'getServiceNames()' of the 'ooo.vba.XHelperInterface' interface in a class
+ declaration.
+ */
+#define VBAHELPER_DECL_XHELPERINTERFACE \
+ virtual OUString getServiceImplName(); \
+ virtual css::uno::Sequence< OUString > getServiceNames();
+
+// ----------------------------------------------------------------------------
+
+/** Helper macro to implement the methods 'getServiceImplName()' and
+ 'getServiceNames()' of the 'ooo.vba.XHelperInterface' interface. Will
+ return the class name as service implementation name.
+ */
+#define VBAHELPER_IMPL_XHELPERINTERFACE( classname, servicename ) \
+VBAHELPER_IMPL_GETSERVICEIMPLNAME( classname ) \
+VBAHELPER_IMPL_GETSERVICENAMES( classname, servicename )
+
+// ============================================================================
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbapagesetupbase.hxx b/include/vbahelper/vbapagesetupbase.hxx
new file mode 100644
index 000000000000..b063353af36a
--- /dev/null
+++ b/include/vbahelper/vbapagesetupbase.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 VBA_PAGESETUPBASE_HXX
+#define VBA_PAGESETUPBASE_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <ooo/vba/XPageSetupBase.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::XPageSetupBase > VbaPageSetupBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaPageSetupBase : public VbaPageSetupBase_BASE
+{
+protected:
+ css::uno::Reference< css::frame::XModel > mxModel;
+ css::uno::Reference< css::beans::XPropertySet > mxPageProps;
+ sal_Int32 mnOrientLandscape;
+ sal_Int32 mnOrientPortrait;
+
+ VbaPageSetupBase( const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+public:
+ virtual ~VbaPageSetupBase(){}
+
+ // Attribute
+ virtual double SAL_CALL getTopMargin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTopMargin( double margin ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getBottomMargin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setBottomMargin( double margin ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getRightMargin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRightMargin( double margin ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getLeftMargin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLeftMargin( double margin ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getHeaderMargin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeaderMargin( double margin ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getFooterMargin() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setFooterMargin( double margin ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getOrientation() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setOrientation( sal_Int32 orientation ) throw (css::uno::RuntimeException);
+};
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbapropvalue.hxx b/include/vbahelper/vbapropvalue.hxx
new file mode 100644
index 000000000000..816f93f8c445
--- /dev/null
+++ b/include/vbahelper/vbapropvalue.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 SC_VBA_PROPVALULE_HXX
+#define SC_VBA_PROPVALULE_HXX
+#include <ooo/vba/XPropValue.hpp>
+#include <cppuhelper/implbase1.hxx>
+
+#include <vbahelper/vbahelper.hxx>
+
+typedef ::cppu::WeakImplHelper1< ov::XPropValue > PropValueImpl_BASE;
+
+class VBAHELPER_DLLPUBLIC PropListener
+{
+public:
+ virtual void setValueEvent( const css::uno::Any& value ) = 0;
+ virtual css::uno::Any getValueEvent() = 0;
+
+protected:
+ ~PropListener() {}
+};
+
+
+class VBAHELPER_DLLPUBLIC ScVbaPropValue : public PropValueImpl_BASE
+{
+ PropListener* m_pListener;
+public:
+ ScVbaPropValue( PropListener* pListener );
+
+ // Attributes
+ virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+
+ OUString SAL_CALL getDefaultPropertyName() throw (css::uno::RuntimeException) { return OUString("Value"); }
+
+};
+#endif //SC_VBA_PROPVALULE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbashape.hxx b/include/vbahelper/vbashape.hxx
new file mode 100644
index 000000000000..58e4f2865545
--- /dev/null
+++ b/include/vbahelper/vbashape.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 SC_VBA_SHAPE_HXX
+#define SC_VBA_SHAPE_HXX
+
+#include <ooo/vba/office/MsoShapeType.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <ooo/vba/msforms/XShape.hpp>
+#include <ooo/vba/msforms/XLineFormat.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef ::cppu::WeakImplHelper2< ov::msforms::XShape, css::lang::XEventListener > ListeningShape;
+
+typedef InheritedHelperInterfaceImpl< ListeningShape > ScVbaShape_BASE;
+
+class VBAHELPER_DLLPUBLIC ScVbaShape : public ScVbaShape_BASE
+{
+protected:
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ std::auto_ptr< ov::ShapeHelper > m_pShapeHelper;
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+ css::uno::Reference< css::drawing::XShape > m_xShape;
+ css::uno::Reference< css::drawing::XShapes > m_xShapes;
+ css::uno::Reference< css::beans::XPropertySet > m_xPropertySet;
+ sal_Int32 m_nType;
+ css::uno::Reference< css::frame::XModel > m_xModel;
+ css::uno::Any m_aRange;
+ virtual void addListeners();
+ virtual void removeShapeListener() throw( css::uno::RuntimeException );
+ virtual void removeShapesListener() throw( css::uno::RuntimeException );
+ virtual OUString getServiceImplName();
+ virtual css::uno::Sequence<OUString> getServiceNames();
+public:
+ ScVbaShape( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::drawing::XShapes >& xShapes, const css::uno::Reference< css::frame::XModel >& xModel, sal_Int32 nType ) throw ( css::lang::IllegalArgumentException );
+ virtual ~ScVbaShape();
+ css::uno::Any getRange() { return m_aRange; };
+ void setRange( css::uno::Any aRange ) { m_aRange = aRange; };
+
+ static sal_Int32 getType( const css::uno::Reference< css::drawing::XShape > xShape ) throw (css::uno::RuntimeException);
+
+ // Attributes
+ virtual OUString SAL_CALL getName() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setName( const OUString& _name ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getHeight() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setWidth( double _width ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getLeft() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLeft( double _left ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getTop() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTop( double _top ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getZOrderPosition() throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getRotation() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRotation( double _rotation ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XLineFormat > SAL_CALL getLine() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XFillFormat > SAL_CALL getFill() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XPictureFormat > SAL_CALL getPictureFormat() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getLockAspectRatio() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLockAspectRatio( ::sal_Bool _lockaspectratio ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getLockAnchor() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLockAnchor( ::sal_Bool _lockanchor ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getRelativeHorizontalPosition() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRelativeHorizontalPosition( ::sal_Int32 _relativehorizontalposition ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getRelativeVerticalPosition() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRelativeVerticalPosition( ::sal_Int32 _relativeverticalposition ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual css::uno::Any SAL_CALL SAL_CALL TextFrame( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL SAL_CALL WrapFormat( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Delete() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL ZOrder( sal_Int32 ZOrderCmd ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL IncrementRotation( double Increment ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL IncrementLeft( double Increment ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL IncrementTop( double Increment ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL ScaleHeight( double Factor, sal_Bool RelativeToOriginalSize, sal_Int32 Scale ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL ScaleWidth( double Factor, sal_Bool RelativeToOriginalSize, sal_Int32 Scale ) throw (css::uno::RuntimeException);
+ // Replace??
+ virtual void SAL_CALL Select( const css::uno::Any& Replace ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL ShapeRange( const css::uno::Any& index ) throw ( css::uno::RuntimeException );
+ // XEventListener
+ virtual void SAL_CALL disposing( const css::lang::EventObject& rEventObject ) throw( css::uno::RuntimeException );
+};
+#endif//SC_VBA_SHAPE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbashaperange.hxx b/include/vbahelper/vbashaperange.hxx
new file mode 100644
index 000000000000..e1a447ee3dbf
--- /dev/null
+++ b/include/vbahelper/vbashaperange.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 SC_VBA_SHAPERANGE_HXX
+#define SC_VBA_SHAPERANGE_HXX
+
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <ooo/vba/msforms/XShapeRange.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <ooo/vba/msforms/XLineFormat.hpp>
+#include <ooo/vba/msforms/XFillFormat.hpp>
+
+typedef CollTestImplHelper< ov::msforms::XShapeRange > ScVbaShapeRange_BASE;
+
+class VBAHELPER_DLLPUBLIC ScVbaShapeRange : public ScVbaShapeRange_BASE
+{
+private:
+ css::uno::Reference< css::drawing::XDrawPage > m_xDrawPage;
+ css::uno::Reference< css::drawing::XShapes > m_xShapes;
+protected:
+ css::uno::Reference< css::frame::XModel > m_xModel;
+ virtual OUString getServiceImplName();
+ virtual css::uno::Sequence<OUString> getServiceNames();
+ css::uno::Reference< css::drawing::XShapes > getShapes() throw (css::uno::RuntimeException) ;
+public:
+ ScVbaShapeRange( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xShapes, const css::uno::Reference< css::drawing::XDrawPage>& xDrawShape, const css::uno::Reference< css::frame::XModel >& xModel );
+
+ // Methods
+ virtual void SAL_CALL Select( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ::ooo::vba::msforms::XShape > SAL_CALL Group() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL IncrementRotation( double Increment ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL IncrementLeft( double Increment ) throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL IncrementTop( double Increment ) throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getName() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setName( const OUString& _name ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getHeight() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setWidth( double _width ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getLeft() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLeft( double _left ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getTop() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setTop( double _top ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XLineFormat > SAL_CALL getLine() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XFillFormat > SAL_CALL getFill() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getLockAspectRatio() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLockAspectRatio( ::sal_Bool _lockaspectratio ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getLockAnchor() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLockAnchor( ::sal_Bool _lockanchor ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getRelativeHorizontalPosition() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRelativeHorizontalPosition( ::sal_Int32 _relativehorizontalposition ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getRelativeVerticalPosition() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setRelativeVerticalPosition( ::sal_Int32 _relativeverticalposition ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL SAL_CALL TextFrame( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL SAL_CALL WrapFormat( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL ZOrder( sal_Int32 ZOrderCmd ) throw (css::uno::RuntimeException);
+ //XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+ // ScVbaCollectionBaseImpl
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+};
+
+#endif//SC_VBA_SHAPERANGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbashapes.hxx b/include/vbahelper/vbashapes.hxx
new file mode 100644
index 000000000000..4c4b7c3e5a49
--- /dev/null
+++ b/include/vbahelper/vbashapes.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 SC_VBA_SHAPES_HXX
+#define SC_VBA_SHAPES_HXX
+
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <ooo/vba/msforms/XShapes.hpp>
+
+#include <vbahelper/vbahelperinterface.hxx>
+
+#include <vbahelper/vbacollectionimpl.hxx>
+
+typedef CollTestImplHelper< ov::msforms::XShapes > ScVbaShapes_BASE;
+
+class VBAHELPER_DLLPUBLIC ScVbaShapes : public ScVbaShapes_BASE
+{
+private:
+ css::uno::Reference< css::drawing::XShapes > m_xShapes;
+ css::uno::Reference< css::drawing::XDrawPage > m_xDrawPage;
+ sal_Int32 m_nNewShapeCount;
+ void initBaseCollection();
+protected:
+ css::uno::Reference< css::frame::XModel > m_xModel;
+ virtual OUString getServiceImplName();
+ virtual css::uno::Sequence<OUString> getServiceNames();
+ virtual css::uno::Reference< css::container::XIndexAccess > getShapesByArrayIndices( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
+ css::uno::Reference< css::drawing::XShape > createShape( OUString service ) throw (css::uno::RuntimeException);
+ css::uno::Any AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, css::uno::Any aRange ) throw (css::uno::RuntimeException);
+ css::uno::Any AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, css::uno::Any aRange ) throw (css::uno::RuntimeException);
+ css::uno::Any AddTextboxInWriter( sal_Int32 _nOrientation, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (css::uno::RuntimeException);
+ OUString createName( OUString sName );
+ //TODO helperapi using a writer document
+ //css::awt::Point calculateTopLeftMargin( css::uno::Reference< ov::XHelperInterface > xDocument );
+
+public:
+ ScVbaShapes( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess > xShapes, const css::uno::Reference< css::frame::XModel >& xModel );
+ static void setDefaultShapeProperties( css::uno::Reference< css::drawing::XShape > xShape ) throw (css::uno::RuntimeException);
+ static void setShape_NameProperty( css::uno::Reference< css::drawing::XShape > xShape, OUString sName );
+ //XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL SelectAll() throw (css::uno::RuntimeException);
+ //helper::calc
+ virtual css::uno::Any SAL_CALL AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, sal_Int32 endY ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL AddShape( sal_Int32 _nType, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL AddTextbox( sal_Int32 _nOrientation, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::msforms::XShapeRange > SAL_CALL Range( const css::uno::Any& shapes ) throw (css::uno::RuntimeException);
+ // ScVbaCollectionBaseImpl
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& Index2 ) throw (css::uno::RuntimeException);
+};
+
+#endif//SC_VBA_SHAPES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbatextframe.hxx b/include/vbahelper/vbatextframe.hxx
new file mode 100644
index 000000000000..d8f44e32c826
--- /dev/null
+++ b/include/vbahelper/vbatextframe.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 VBA_TEXTFRAME_HXX
+#define VBA_TEXTFRAME_HXX
+#include <ooo/vba/msforms/XTextFrame.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::msforms::XTextFrame > VbaTextFrame_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaTextFrame : public VbaTextFrame_BASE
+{
+protected:
+ css::uno::Reference< css::drawing::XShape > m_xShape;
+ css::uno::Reference< css::beans::XPropertySet > m_xPropertySet;
+protected:
+ virtual OUString getServiceImplName();
+ virtual css::uno::Sequence<OUString> getServiceNames();
+ virtual void setAsMSObehavior();
+ sal_Int32 getMargin( OUString sMarginType );
+ void setMargin( OUString sMarginType, float fMargin );
+public:
+ VbaTextFrame( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext , css::uno::Reference< css::drawing::XShape > xShape);
+ virtual ~VbaTextFrame() {}
+ // Attributes
+ virtual sal_Bool SAL_CALL getAutoSize() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setAutoSize( sal_Bool _autosize ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL getMarginBottom() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMarginBottom( float _marginbottom ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL getMarginTop() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMarginTop( float _margintop ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL getMarginLeft() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMarginLeft( float _marginleft ) throw (css::uno::RuntimeException);
+ virtual float SAL_CALL getMarginRight() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMarginRight( float _marginright ) throw (css::uno::RuntimeException);
+
+ // Methods
+ virtual css::uno::Any SAL_CALL Characters( ) throw (css::uno::RuntimeException);
+
+};
+
+#endif//SC_VBA_TEXTFRAME_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vbahelper/vbawindowbase.hxx b/include/vbahelper/vbawindowbase.hxx
new file mode 100644
index 000000000000..33ef793eecd8
--- /dev/null
+++ b/include/vbahelper/vbawindowbase.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 VBA_WINDOWBASE_HXX
+#define VBA_WINDOWBASE_HXX
+
+#include <ooo/vba/XWindowBase.hpp>
+#include <com/sun/star/awt/XWindow2.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::XWindowBase > WindowBaseImpl_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaWindowBase : public WindowBaseImpl_BASE
+{
+public:
+ VbaWindowBase(
+ const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::frame::XModel >& xModel,
+ const css::uno::Reference< css::frame::XController >& xController )
+ throw (css::uno::RuntimeException);
+ VbaWindowBase(
+ css::uno::Sequence< css::uno::Any > const& aArgs,
+ css::uno::Reference< css::uno::XComponentContext > const& xContext )
+ throw (css::uno::RuntimeException);
+
+ // XWindowBase
+ virtual sal_Int32 SAL_CALL getHeight() throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL setHeight( sal_Int32 _height ) throw (css::uno::RuntimeException) ;
+ virtual sal_Int32 SAL_CALL getLeft() throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL setLeft( sal_Int32 _left ) throw (css::uno::RuntimeException) ;
+ virtual sal_Int32 SAL_CALL getTop() throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL setTop( sal_Int32 _top ) throw (css::uno::RuntimeException) ;
+ virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getWidth() throw (css::uno::RuntimeException) ;
+ virtual void SAL_CALL setWidth( sal_Int32 _width ) throw (css::uno::RuntimeException) ;
+
+ // XHelperInterface
+ virtual OUString getServiceImplName();
+ virtual css::uno::Sequence<OUString> getServiceNames();
+
+protected:
+ css::uno::Reference< css::frame::XController > getController() throw (css::uno::RuntimeException);
+ css::uno::Reference< css::awt::XWindow > getWindow() throw (css::uno::RuntimeException);
+ css::uno::Reference< css::awt::XWindow2 > getWindow2() throw (css::uno::RuntimeException);
+
+ css::uno::Reference< css::frame::XModel > m_xModel;
+
+private:
+ void construct( const css::uno::Reference< css::frame::XController >& xController ) throw (css::uno::RuntimeException);
+
+ css::uno::WeakReference< css::frame::XController > m_xController;
+ css::uno::WeakReference< css::awt::XWindow > m_xWindow;
+};
+
+#endif //VBA_WINDOWBASE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/FilterConfigItem.hxx b/include/vcl/FilterConfigItem.hxx
new file mode 100644
index 000000000000..b13f37a19680
--- /dev/null
+++ b/include/vcl/FilterConfigItem.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 _FILTER_CONFIG_ITEM_HXX_
+#define _FILTER_CONFIG_ITEM_HXX_
+
+#include <vcl/dllapi.h>
+
+#include <tools/string.hxx>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/uno/Any.h>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyAccess.hpp>
+#include <com/sun/star/task/XStatusIndicator.hpp>
+
+class VCL_DLLPUBLIC FilterConfigItem
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xUpdatableView;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropSet;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aFilterData;
+
+ sal_Bool bModified;
+
+ sal_Bool ImplGetPropertyValue( ::com::sun::star::uno::Any& rAny,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet,
+ const OUString& rPropName,
+ sal_Bool bTestPropertyAvailability );
+
+ void ImpInitTree( const String& rTree );
+
+
+ static ::com::sun::star::beans::PropertyValue* GetPropertyValue(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rPropSeq,
+ const OUString& rName );
+ static sal_Bool WritePropertyValue(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rPropSeq,
+ const ::com::sun::star::beans::PropertyValue& rPropValue );
+
+public :
+
+ FilterConfigItem( const OUString& rSubTree );
+ FilterConfigItem( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData );
+ FilterConfigItem( const OUString& rSubTree, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData );
+ ~FilterConfigItem();
+
+ // all read methods are trying to return values in following order:
+ // 1. FilterData PropertySequence
+ // 2. configuration
+ // 3. given default
+ sal_Bool ReadBool( const OUString& rKey, sal_Bool bDefault );
+ sal_Int32 ReadInt32( const OUString& rKey, sal_Int32 nDefault );
+ OUString
+ ReadString( const OUString& rKey, const OUString& rDefault );
+
+ // try to store to configuration
+ // and always stores into the FilterData sequence
+ void WriteBool( const OUString& rKey, sal_Bool bValue );
+ void WriteInt32( const OUString& rKey, sal_Int32 nValue );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetFilterData() const;
+
+ // GetStatusIndicator is returning the "StatusIndicator" property of the FilterData sequence
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > GetStatusIndicator() const;
+};
+
+#endif // _FILTER_CONFIG_ITEM_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/GraphicNativeMetadata.hxx b/include/vcl/GraphicNativeMetadata.hxx
new file mode 100644
index 000000000000..ab5b767ceb15
--- /dev/null
+++ b/include/vcl/GraphicNativeMetadata.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 _GRAPHICNATIVEMETADATA_HXX
+#define _GRAPHICNATIVEMETADATA_HXX
+
+#include <vcl/graph.hxx>
+
+class VCL_DLLPUBLIC GraphicNativeMetadata
+{
+ sal_uInt16 mRotation;
+
+public:
+ GraphicNativeMetadata();
+ virtual ~GraphicNativeMetadata();
+
+ bool read(Graphic& rGraphic);
+ sal_uInt16 getRotation();
+};
+
+#endif //_GRAPHICNATIVEMETADATA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/GraphicNativeTransform.hxx b/include/vcl/GraphicNativeTransform.hxx
new file mode 100644
index 000000000000..db727a22c5ff
--- /dev/null
+++ b/include/vcl/GraphicNativeTransform.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 _GRAPHICNATIVETRANSFORM_HXX
+#define _GRAPHICNATIVETRANSFORM_HXX
+
+#include <vcl/graph.hxx>
+
+class VCL_DLLPUBLIC GraphicNativeTransform
+{
+ Graphic& mrGraphic;
+
+ bool rotateJPEG (sal_uInt16 aRotation);
+ bool rotateGeneric (sal_uInt16 aRotation, OUString aType);
+
+public:
+ GraphicNativeTransform(Graphic& rGraphic);
+ virtual ~GraphicNativeTransform();
+
+ bool canBeRotated();
+ bool rotate(sal_uInt16 aRotation);
+};
+
+#endif //_GRAPHICNATIVETRANSFORM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/ImageListProvider.hxx b/include/vcl/ImageListProvider.hxx
new file mode 100644
index 000000000000..cfbba790850c
--- /dev/null
+++ b/include/vcl/ImageListProvider.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 _SV_IMAGELISTPROVIDER_HXX
+#define _SV_IMAGELISTPROVIDER_HXX
+
+#include <sal/types.h>
+
+namespace com { namespace sun { namespace star { namespace lang { class IllegalArgumentException; }}}}
+
+class ImageList;
+
+
+namespace vcl
+{
+ enum ImageListType
+ {
+ IMAGELISTTYPE_UNKNOWN = 0,
+ HIGHCONTRAST_NO = 1,
+ HIGHCONTRAST_YES = 2
+ };
+
+ /* abstract */ class IImageListProvider
+ {
+ public:
+ virtual ImageList getImageList(ImageListType) SAL_THROW (( com::sun::star::lang::IllegalArgumentException )) = 0;
+
+ protected:
+ ~IImageListProvider() {}
+ };
+} /* vcl */
+
+#endif /* _SV_IMAGELISTPROVIDER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx
new file mode 100644
index 000000000000..5f92c74d5c08
--- /dev/null
+++ b/include/vcl/abstdlg.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 _VCL_ABSTDLG_HXX
+#define _VCL_ABSTDLG_HXX
+
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <vcl/dllapi.h>
+
+class Window;
+class ResId;
+class Link;
+
+class VCL_DLLPUBLIC VclAbstractDialog
+{
+public:
+ virtual short Execute() = 0;
+ //virtual void Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 ) = 0;
+ virtual ~VclAbstractDialog();
+};
+
+class VCL_DLLPUBLIC VclAbstractDialog2
+{
+public:
+ virtual void StartExecuteModal( const Link& rEndDialogHdl ) = 0;
+ virtual long GetResult() = 0;
+ virtual ~VclAbstractDialog2();
+};
+
+class VCL_DLLPUBLIC VclAbstractTerminatedDialog : public VclAbstractDialog
+{
+public:
+ virtual void EndDialog(long nResult =0) = 0;
+};
+
+class VCL_DLLPUBLIC VclAbstractRefreshableDialog : public VclAbstractDialog
+{
+public:
+ virtual void Update() = 0;
+ virtual void Sync() = 0;
+};
+
+class VCL_DLLPUBLIC AbstractPasswordToOpenModifyDialog : public VclAbstractDialog
+{
+public:
+ virtual String GetPasswordToOpen() const = 0;
+ virtual String GetPasswordToModify() const = 0;
+ virtual bool IsRecommendToOpenReadonly() const = 0;
+};
+
+//-------------------------------------------------------------
+
+class VCL_DLLPUBLIC VclAbstractDialogFactory
+{
+public:
+ virtual ~VclAbstractDialogFactory(); // needed for export of vtable
+ static VclAbstractDialogFactory* Create();
+ // nDialogId was previously a ResId without ResMgr; the ResourceId is now
+ // an implementation detail of the factory
+ virtual VclAbstractDialog* CreateVclDialog( Window* pParent, sal_uInt32 nResId ) = 0;
+
+ // creates instance of PasswordToOpenModifyDialog from cui
+ virtual AbstractPasswordToOpenModifyDialog * CreatePasswordToOpenModifyDialog( Window * pParent, sal_uInt16 nMinPasswdLen, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify ) = 0;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/accel.hxx b/include/vcl/accel.hxx
new file mode 100644
index 000000000000..79136b15b1f8
--- /dev/null
+++ b/include/vcl/accel.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 _SV_ACCEL_HXX
+#define _SV_ACCEL_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <tools/link.hxx>
+#include <tools/resid.hxx>
+#include <tools/rc.hxx>
+#include <vcl/keycod.hxx>
+
+class ImplAccelData;
+class ImplAccelEntry;
+
+// ---------------
+// - Accelerator -
+// ---------------
+
+class VCL_DLLPUBLIC Accelerator : public Resource
+{
+ friend class ImplAccelManager;
+
+private:
+ ImplAccelData* mpData;
+ XubString maHelpStr;
+ Link maActivateHdl;
+ Link maDeactivateHdl;
+ Link maSelectHdl;
+
+ // Will be set by AcceleratorManager
+ KeyCode maCurKeyCode;
+ sal_uInt16 mnCurId;
+ sal_uInt16 mnCurRepeat;
+ sal_Bool mbIsCancel;
+ sal_Bool* mpDel;
+
+ SAL_DLLPRIVATE void ImplInit();
+ SAL_DLLPRIVATE void ImplCopyData( ImplAccelData& rAccelData );
+ SAL_DLLPRIVATE void ImplDeleteData();
+ SAL_DLLPRIVATE void ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode,
+ sal_Bool bEnable, Accelerator* pAutoAccel );
+
+ SAL_DLLPRIVATE ImplAccelEntry* ImplGetAccelData( const KeyCode& rKeyCode ) const;
+
+protected:
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+ Accelerator();
+ Accelerator( const Accelerator& rAccel );
+ Accelerator( const ResId& rResId );
+ virtual ~Accelerator();
+
+ virtual void Activate();
+ virtual void Deactivate();
+ virtual void Select();
+
+ void InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode );
+ void InsertItem( const ResId& rResId );
+
+ sal_uInt16 GetCurItemId() const { return mnCurId; }
+ const KeyCode& GetCurKeyCode() const { return maCurKeyCode; }
+ sal_uInt16 GetCurRepeat() const { return mnCurRepeat; }
+ sal_Bool IsCancel() const { return mbIsCancel; }
+
+ sal_uInt16 GetItemCount() const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ KeyCode GetKeyCode( sal_uInt16 nItemId ) const;
+
+ Accelerator* GetAccel( sal_uInt16 nItemId ) const;
+
+ void SetHelpText( const XubString& rHelpText ) { maHelpStr = rHelpText; }
+ const XubString& GetHelpText() const { return maHelpStr; }
+
+ void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; }
+ const Link& GetActivateHdl() const { return maActivateHdl; }
+ void SetDeactivateHdl( const Link& rLink ) { maDeactivateHdl = rLink; }
+ const Link& GetDeactivateHdl() const { return maDeactivateHdl; }
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+
+ Accelerator& operator=( const Accelerator& rAccel );
+};
+
+#endif // _SV_ACCEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx
new file mode 100644
index 000000000000..95bb0ea29de2
--- /dev/null
+++ b/include/vcl/alpha.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 _SV_ALPHA_HXX
+#define _SV_ALPHA_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/bitmap.hxx>
+
+// -------------
+// - AlphaMask -
+// -------------
+
+class ImageList;
+class BitmapEx;
+
+class VCL_DLLPUBLIC AlphaMask : private Bitmap
+{
+ friend class BitmapEx;
+ friend class OutputDevice;
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream&, const ImageList& );
+
+private:
+
+ SAL_DLLPRIVATE const Bitmap& ImplGetBitmap() const;
+ SAL_DLLPRIVATE void ImplSetBitmap( const Bitmap& rBitmap );
+
+public:
+
+ AlphaMask();
+ AlphaMask( const Bitmap& rBitmap );
+ AlphaMask( const AlphaMask& rAlphaMask );
+ AlphaMask( const Size& rSizePixel, sal_uInt8* pEraseTransparency = NULL );
+ virtual ~AlphaMask();
+
+ AlphaMask& operator=( const Bitmap& rBitmap );
+ AlphaMask& operator=( const AlphaMask& rAlphaMask )
+ {
+ return (AlphaMask&) Bitmap::operator=( rAlphaMask );
+ }
+
+ sal_Bool operator!() const
+ {
+ return Bitmap::operator!();
+ }
+
+ sal_Bool operator==( const AlphaMask& rAlphaMask ) const
+ {
+ return Bitmap::operator==( rAlphaMask );
+ }
+
+ sal_Bool operator!=( const AlphaMask& rAlphaMask ) const
+ {
+ return Bitmap::operator!=( rAlphaMask );
+ }
+
+ const MapMode& GetPrefMapMode() const
+ {
+ return Bitmap::GetPrefMapMode();
+ }
+
+ void SetPrefMapMode( const MapMode& rMapMode )
+ {
+ Bitmap::SetPrefMapMode( rMapMode );
+ }
+
+ const Size& GetPrefSize() const
+ {
+ return Bitmap::GetPrefSize();
+ }
+
+ void SetPrefSize( const Size& rSize )
+ {
+ Bitmap::SetPrefSize( rSize );
+ }
+
+ Size GetSizePixel() const
+ {
+ return Bitmap::GetSizePixel();
+ }
+
+ sal_uLong GetSizeBytes() const
+ {
+ return Bitmap::GetSizeBytes();
+ }
+ sal_uLong GetChecksum() const
+ {
+ return Bitmap::GetChecksum();
+ }
+
+ Bitmap GetBitmap() const;
+
+ sal_Bool CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
+ const AlphaMask* pAlphaSrc = NULL);
+
+ sal_Bool Erase( sal_uInt8 cTransparency );
+ sal_Bool Replace( const Bitmap& rMask, sal_uInt8 rReplaceTransparency );
+ sal_Bool Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency,
+ sal_uLong nTol = 0UL );
+
+ BitmapReadAccess* AcquireReadAccess()
+ {
+ return Bitmap::AcquireReadAccess();
+ }
+
+ BitmapWriteAccess* AcquireWriteAccess()
+ {
+ return Bitmap::AcquireWriteAccess();
+ }
+
+ void ReleaseAccess( BitmapReadAccess* pAccess );
+
+ typedef vcl::ScopedBitmapAccess< BitmapReadAccess, AlphaMask, &AlphaMask::AcquireReadAccess >
+ ScopedReadAccess;
+ typedef vcl::ScopedBitmapAccess< BitmapWriteAccess, AlphaMask, &AlphaMask::AcquireWriteAccess >
+ ScopedWriteAccess;
+
+ sal_Bool Read( SvStream& rIStm, sal_Bool bFileHeader = sal_True )
+ {
+ return Bitmap::Read( rIStm, bFileHeader );
+ }
+ sal_Bool Write( SvStream& rOStm, sal_Bool bCompressed = sal_True, sal_Bool bFileHeader = sal_True ) const
+ {
+ return Bitmap::Write( rOStm, bCompressed, bFileHeader );
+ }
+
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx );
+};
+
+#endif // _SV_ALPHA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/animate.hxx b/include/vcl/animate.hxx
new file mode 100644
index 000000000000..dd374e8aed51
--- /dev/null
+++ b/include/vcl/animate.hxx
@@ -0,0 +1,238 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_ANIMATE_HXX
+#define _SV_ANIMATE_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/timer.hxx>
+#include <vcl/bitmapex.hxx>
+
+#define ANIMATION_TIMEOUT_ON_CLICK 2147483647L
+
+enum Disposal
+{
+ DISPOSE_NOT,
+ DISPOSE_BACK,
+ DISPOSE_FULL,
+ DISPOSE_PREVIOUS
+};
+
+enum CycleMode
+{
+ CYCLE_NOT,
+ CYCLE_NORMAL,
+ CYCLE_FALLBACK,
+ CYCLE_REVERS,
+ CYCLE_REVERS_FALLBACK
+};
+
+struct VCL_DLLPUBLIC AnimationBitmap
+{
+ BitmapEx aBmpEx;
+ Point aPosPix;
+ Size aSizePix;
+ long nWait;
+ Disposal eDisposal;
+ sal_Bool bUserInput;
+
+ AnimationBitmap() {}
+ AnimationBitmap(
+ const BitmapEx& rBmpEx,
+ const Point& rPosPix,
+ const Size& rSizePix,
+ long _nWait = 0L,
+ Disposal _eDisposal = DISPOSE_NOT
+ ) :
+ aBmpEx ( rBmpEx ),
+ aPosPix ( rPosPix ),
+ aSizePix ( rSizePix ),
+ nWait ( _nWait ),
+ eDisposal ( _eDisposal ),
+ bUserInput ( sal_False )
+ {}
+
+ sal_Bool operator==( const AnimationBitmap& rAnimBmp ) const
+ {
+ return( rAnimBmp.aBmpEx == aBmpEx &&
+ rAnimBmp.aPosPix == aPosPix &&
+ rAnimBmp.aSizePix == aSizePix &&
+ rAnimBmp.nWait == nWait &&
+ rAnimBmp.eDisposal == eDisposal &&
+ rAnimBmp.bUserInput == bUserInput );
+ }
+
+ sal_Bool operator!=( const AnimationBitmap& rAnimBmp ) const
+ { return !( *this == rAnimBmp ); }
+
+ sal_Bool IsEqual( const AnimationBitmap& rAnimBmp ) const
+ {
+ return( rAnimBmp.aPosPix == aPosPix &&
+ rAnimBmp.aSizePix == aSizePix &&
+ rAnimBmp.nWait == nWait &&
+ rAnimBmp.eDisposal == eDisposal &&
+ rAnimBmp.bUserInput == bUserInput &&
+ rAnimBmp.aBmpEx.IsEqual( aBmpEx ) );
+ }
+
+ sal_uLong GetChecksum() const;
+};
+
+struct AInfo
+{
+ Bitmap aLastSaveBitmap;
+ Bitmap aBackBitmap;
+ Rectangle aClipRect;
+ Size aLastSaveSize;
+ Point aLastSavePoint;
+ Point aStartOrg;
+ Size aStartSize;
+ OutputDevice* pOutDev;
+ void* pViewData;
+ long nExtraData;
+ sal_Bool bWithSize;
+ sal_Bool bPause;
+
+ AInfo() : pOutDev( NULL ),
+ pViewData( NULL ),
+ nExtraData( 0L ),
+ bWithSize( sal_False ),
+ bPause( sal_False ) {}
+};
+
+class ImplAnimView;
+typedef ::std::vector< AnimationBitmap* > AnimationBitmapList_impl;
+typedef ::std::vector< ImplAnimView* > AnimViewList_impl;
+
+class VCL_DLLPUBLIC Animation
+{
+ SAL_DLLPRIVATE static sal_uLong mnAnimCount;
+
+ AnimationBitmapList_impl maList;
+ AnimViewList_impl maViewList;
+ Link maNotifyLink;
+ BitmapEx maBitmapEx;
+ Timer maTimer;
+ Size maGlobalSize;
+ void* mpExtraData;
+ long mnLoopCount;
+ long mnLoops;
+ size_t mnPos;
+ Disposal meLastDisposal;
+ CycleMode meCycleMode;
+ sal_Bool mbFirst;
+ sal_Bool mbIsInAnimation;
+ sal_Bool mbWithSize;
+ sal_Bool mbLoopTerminated;
+ sal_Bool mbIsWaiting;
+
+
+ SAL_DLLPRIVATE void ImplRestartTimer( sal_uLong nTimeout );
+ DECL_DLLPRIVATE_LINK( ImplTimeoutHdl, void* );
+
+public:
+
+ SAL_DLLPRIVATE static void ImplIncAnimCount() { mnAnimCount++; }
+ SAL_DLLPRIVATE static void ImplDecAnimCount() { mnAnimCount--; }
+ SAL_DLLPRIVATE sal_uLong ImplGetCurPos() const { return mnPos; }
+
+
+public:
+ Animation();
+ Animation( const Animation& rAnimation );
+ ~Animation();
+
+ Animation& operator=( const Animation& rAnimation );
+ sal_Bool operator==( const Animation& rAnimation ) const;
+ sal_Bool operator!=( const Animation& rAnimation ) const
+ { return !(*this==rAnimation); }
+
+ void Clear();
+
+ sal_Bool Start(
+ OutputDevice* pOutDev,
+ const Point& rDestPt,
+ const Size& rDestSz,
+ long nExtraData = 0,
+ OutputDevice* pFirstFrameOutDev = NULL
+ );
+ void Stop( OutputDevice* pOutDev = NULL, long nExtraData = 0 );
+
+ void Draw( OutputDevice* pOutDev, const Point& rDestPt ) const;
+ void Draw( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz ) const;
+
+ sal_Bool IsInAnimation() const { return mbIsInAnimation; }
+ sal_Bool IsTransparent() const;
+ sal_Bool IsTerminated() const { return mbLoopTerminated; }
+
+ const Size& GetDisplaySizePixel() const { return maGlobalSize; }
+ void SetDisplaySizePixel( const Size& rSize ) { maGlobalSize = rSize; }
+
+ const BitmapEx& GetBitmapEx() const { return maBitmapEx; }
+ void SetBitmapEx( const BitmapEx& rBmpEx ) { maBitmapEx = rBmpEx; }
+
+ sal_uLong GetLoopCount() const { return mnLoopCount; }
+ void SetLoopCount( const sal_uLong nLoopCount );
+ void ResetLoopCount();
+
+ void SetCycleMode( CycleMode eMode );
+ CycleMode GetCycleMode() const { return meCycleMode; }
+
+ void SetNotifyHdl( const Link& rLink ) { maNotifyLink = rLink; }
+ const Link& GetNotifyHdl() const { return maNotifyLink; }
+
+ size_t Count() const { return maList.size(); }
+ sal_Bool Insert( const AnimationBitmap& rAnimationBitmap );
+ const AnimationBitmap& Get( sal_uInt16 nAnimation ) const;
+ void Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation );
+
+ sal_uLong GetSizeBytes() const;
+ sal_uLong GetChecksum() const;
+
+public:
+
+ sal_Bool Convert( BmpConversion eConversion );
+ sal_Bool ReduceColors(
+ sal_uInt16 nNewColorCount,
+ BmpReduce eReduce = BMP_REDUCE_SIMPLE
+ );
+ sal_Bool Invert();
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
+ sal_Bool Adjust(
+ short nLuminancePercent = 0,
+ short nContrastPercent = 0,
+ short nChannelRPercent = 0,
+ short nChannelGPercent = 0,
+ short nChannelBPercent = 0,
+ double fGamma = 1.0,
+ sal_Bool bInvert = sal_False
+ );
+ sal_Bool Filter(
+ BmpFilter eFilter,
+ const BmpFilterParam* pFilterParam = NULL,
+ const Link* pProgress = NULL
+ );
+
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, Animation& rAnimation );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const Animation& rAnimation );
+};
+
+#endif // _SV_ANIMATE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/apptypes.hxx b/include/vcl/apptypes.hxx
new file mode 100644
index 000000000000..ebb1eb703212
--- /dev/null
+++ b/include/vcl/apptypes.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 _VCL_APPTYPES_HXX
+#define _VCL_APPTYPES_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <tools/rtti.hxx>
+
+// ---------------------
+// - Application-Types -
+// ---------------------
+
+#define EXC_RSCNOTLOADED ((sal_uInt16)0x0100)
+#define EXC_SYSOBJNOTCREATED ((sal_uInt16)0x0200)
+#define EXC_SYSTEM ((sal_uInt16)0x0300)
+#define EXC_DISPLAY ((sal_uInt16)0x0400)
+#define EXC_REMOTE ((sal_uInt16)0x0500)
+#define EXC_USER ((sal_uInt16)0x1000)
+#define EXC_MAJORTYPE ((sal_uInt16)0xFF00)
+#define EXC_MINORTYPE ((sal_uInt16)0x00FF)
+
+#define VCL_INPUT_MOUSE 0x0001
+#define VCL_INPUT_KEYBOARD 0x0002
+#define VCL_INPUT_PAINT 0x0004
+#define VCL_INPUT_TIMER 0x0008
+#define VCL_INPUT_OTHER 0x0010
+#define VCL_INPUT_APPEVENT 0x0020
+#define VCL_INPUT_MOUSEANDKEYBOARD (VCL_INPUT_MOUSE | VCL_INPUT_KEYBOARD)
+#define VCL_INPUT_ANY (VCL_INPUT_MOUSEANDKEYBOARD | VCL_INPUT_PAINT | VCL_INPUT_TIMER | VCL_INPUT_OTHER | VCL_INPUT_APPEVENT)
+
+#endif // _VCL_APPTYPES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
new file mode 100644
index 000000000000..c0ec5b17870c
--- /dev/null
+++ b/include/vcl/bitmap.hxx
@@ -0,0 +1,896 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_BITMAP_HXX
+#define _SV_BITMAP_HXX
+
+#include <tools/link.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/mapmod.hxx>
+#include <vcl/region.hxx>
+#include <vcl/scopedbitmapaccess.hxx>
+
+#define BMP_MIRROR_NONE 0x00000000UL
+#define BMP_MIRROR_HORZ 0x00000001UL
+#define BMP_MIRROR_VERT 0x00000002UL
+
+
+#define BMP_SCALE_NONE 0x00000000UL
+#define BMP_SCALE_FAST 0x00000001UL
+#define BMP_SCALE_INTERPOLATE 0x00000002UL
+#define BMP_SCALE_LANCZOS 0x00000003UL
+#define BMP_SCALE_BICUBIC 0x00000004UL
+#define BMP_SCALE_BILINEAR 0x00000005UL
+#define BMP_SCALE_BOX 0x00000006UL
+
+// Aliases, try to use these two (or BMP_SCALE_FAST/BMP_SCALE_NONE),
+// use a specific algorithm only if you really need to.
+#define BMP_SCALE_BEST BMP_SCALE_LANCZOS
+#define BMP_SCALE_DEFAULT BMP_SCALE_BOX
+
+#define BMP_DITHER_NONE 0x00000000UL
+#define BMP_DITHER_MATRIX 0x00000001UL
+#define BMP_DITHER_FLOYD 0x00000002UL
+#define BMP_DITHER_FLOYD_16 0x00000004UL
+
+#define BMP_VECTORIZE_NONE BMP_VECTORIZE_OUTER
+#define BMP_VECTORIZE_INNER 0x00000001UL
+#define BMP_VECTORIZE_OUTER 0x00000002UL
+#define BMP_VECTORIZE_BOUND_ONLY 0x00000004UL
+#define BMP_VECTORIZE_REDUCE_EDGES 0x00000008UL
+
+#define BMP_COL_TRANS Color( 252, 3, 251 )
+
+enum BmpConversion
+{
+ BMP_CONVERSION_NONE = 0,
+ BMP_CONVERSION_1BIT_THRESHOLD = 1,
+ BMP_CONVERSION_1BIT_MATRIX = 2,
+ BMP_CONVERSION_4BIT_GREYS = 3,
+ BMP_CONVERSION_4BIT_COLORS = 4,
+ BMP_CONVERSION_8BIT_GREYS = 5,
+ BMP_CONVERSION_8BIT_COLORS = 6,
+ BMP_CONVERSION_24BIT = 7,
+ BMP_CONVERSION_4BIT_TRANS = 8,
+ BMP_CONVERSION_8BIT_TRANS = 9,
+ BMP_CONVERSION_GHOSTED = 10
+};
+
+enum BmpCombine
+{
+ BMP_COMBINE_COPY = 0,
+ BMP_COMBINE_INVERT = 1,
+ BMP_COMBINE_AND = 2,
+ BMP_COMBINE_NAND = 3,
+ BMP_COMBINE_OR = 4,
+ BMP_COMBINE_NOR = 5,
+ BMP_COMBINE_XOR = 6,
+ BMP_COMBINE_NXOR = 7
+};
+
+enum BmpReduce
+{
+ BMP_REDUCE_SIMPLE = 0,
+ BMP_REDUCE_POPULAR = 1,
+ BMP_REDUCE_MEDIAN = 2
+};
+
+enum BmpEmboss
+{
+ BMP_EMBOSS_TOPLEFT = 0,
+ BMP_EMBOSS_TOP = 1,
+ BMP_EMBOSS_TOPRIGHT = 2,
+ BMP_EMBOSS_LEFT = 3,
+ BMP_EMBOSS_MIDDLE = 4,
+ BMP_EMBOSS_RIGHT = 5,
+ BMP_EMBOSS_BOTTOMLEFT = 6,
+ BMP_EMBOSS_BOTTOM = 7,
+ BMP_EMBOSS_BOTTOMRIGHT = 8
+};
+
+enum BmpFilter
+{
+ BMP_FILTER_SMOOTH = 0,
+ BMP_FILTER_SHARPEN = 1,
+ BMP_FILTER_REMOVENOISE = 2,
+ BMP_FILTER_SOBEL_GREY = 3,
+ BMP_FILTER_EMBOSS_GREY = 4,
+ BMP_FILTER_SOLARIZE = 5,
+ BMP_FILTER_SEPIA = 6,
+ BMP_FILTER_MOSAIC = 7,
+ BMP_FILTER_POPART = 8,
+
+ BMP_FILTER_UNKNOWN = 65535
+};
+
+class VCL_DLLPUBLIC BmpFilterParam
+{
+ friend class Bitmap;
+ friend class BitmapEx;
+ friend class Animation;
+
+private:
+ BmpFilter meFilter;
+ sal_uLong mnProgressStart;
+ sal_uLong mnProgressEnd;
+
+public:
+ struct MosaicTileSize
+ {
+ sal_uLong mnTileWidth;
+ sal_uLong mnTileHeight;
+ };
+
+ struct EmbossAngles
+ {
+ sal_uInt16 mnAzimuthAngle100;
+ sal_uInt16 mnElevationAngle100;
+ };
+
+private:
+ union
+ {
+ sal_uInt16 mnSepiaPercent;
+ sal_uInt8 mcSolarGreyThreshold;
+ double mnRadius;
+
+ MosaicTileSize maMosaicTileSize;
+ EmbossAngles maEmbossAngles;
+ };
+
+public:
+
+ BmpFilterParam( sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
+ meFilter( BMP_FILTER_UNKNOWN ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ) {}
+
+ BmpFilterParam( sal_uInt8 cSolarGreyThreshold, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
+ meFilter( BMP_FILTER_SOLARIZE ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
+ mcSolarGreyThreshold( cSolarGreyThreshold ) {}
+
+ BmpFilterParam( double nRadius, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
+ meFilter( BMP_FILTER_SMOOTH ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
+ mnRadius( nRadius ) {}
+
+ BmpFilterParam( sal_uInt16 nSepiaPercent, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
+ meFilter( BMP_FILTER_SEPIA ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
+ mnSepiaPercent( nSepiaPercent ) {}
+
+ BmpFilterParam( const Size& rMosaicTileSize, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
+ meFilter( BMP_FILTER_MOSAIC ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd )
+ {
+ maMosaicTileSize.mnTileWidth = rMosaicTileSize.Width();
+ maMosaicTileSize.mnTileHeight= rMosaicTileSize.Height();
+ }
+ BmpFilterParam( sal_uInt16 nEmbossAzimuthAngle100, sal_uInt16 nEmbossElevationAngle100,
+ sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
+ meFilter( BMP_FILTER_EMBOSS_GREY ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd )
+ {
+ maEmbossAngles.mnAzimuthAngle100 = nEmbossAzimuthAngle100;
+ maEmbossAngles.mnElevationAngle100 = nEmbossElevationAngle100;
+ }
+};
+
+// --------------------
+// Resample kernels
+// --------------------
+
+class Kernel
+{
+
+public:
+ Kernel () {}
+ virtual ~Kernel() {}
+
+ virtual double GetWidth() = 0;
+ virtual double Calculate( double x ) = 0;
+};
+
+class Lanczos3Kernel : public Kernel
+{
+
+public:
+ virtual double GetWidth() { return 3.0; }
+ virtual double Calculate (double x)
+ {
+ return (-3.0 <= x && x < 3.0) ? SincFilter(x) * SincFilter( x / 3.0 ) : 0.0;
+ }
+
+ inline double SincFilter(double x)
+ {
+ if (x == 0.0)
+ {
+ return 1.0;
+ }
+ x = x * M_PI;
+ return sin(x) / x;
+ }
+};
+
+class BicubicKernel : public Kernel {
+ virtual double GetWidth() { return 2.0; }
+ virtual double Calculate (double x)
+ {
+ if (x < 0.0)
+ {
+ x = -x;
+ }
+
+ if (x <= 1.0)
+ {
+ return (1.5 * x - 2.5) * x * x + 1.0;
+ }
+ else if (x < 2.0)
+ {
+ return ((-0.5 * x + 2.5) * x - 4) * x + 2;
+ }
+ return 0.0;
+ }
+};
+
+class BilinearKernel : public Kernel {
+ virtual double GetWidth() { return 1.0; }
+ virtual double Calculate (double x)
+ {
+ if (x < 0.0)
+ {
+ x = -x;
+ }
+ if (x < 1.0)
+ {
+ return 1.0-x;
+ }
+ return 0.0;
+ }
+};
+
+class BoxKernel : public Kernel {
+ virtual double GetWidth() { return 0.5; }
+ virtual double Calculate (double x)
+ {
+ if (-0.5 <= x && x < 0.5)
+ return 1.0;
+ return 0.0;
+ }
+};
+
+class BitmapReadAccess;
+class BitmapWriteAccess;
+class BitmapPalette;
+class ImpBitmap;
+class Color;
+class SvStream;
+struct DIBInfoHeader;
+class ResId;
+class GDIMetaFile;
+class AlphaMask;
+class OutputDevice;
+class SalBitmap;
+
+struct BitmapSystemData
+{
+ #if defined( WNT )
+ void* pDIB; // device independent byte buffer
+ void* pDDB; // if not NULL then this is actually an HBITMAP
+ #elif defined( MACOSX ) || defined( IOS )
+ void* rImageContext; //Image context (CGContextRef)
+ #else
+ void* aPixmap;
+ void* aVisual;
+ #endif
+ int mnWidth;
+ int mnHeight;
+};
+
+class VCL_DLLPUBLIC Bitmap
+{
+private:
+
+ ImpBitmap* mpImpBmp;
+ MapMode maPrefMapMode;
+ Size maPrefSize;
+
+public:
+
+ SAL_DLLPRIVATE void ImplReleaseRef();
+ SAL_DLLPRIVATE void ImplMakeUnique();
+ ImpBitmap* ImplGetImpBitmap() const;
+ SAL_DLLPRIVATE void ImplSetImpBitmap( ImpBitmap* pImpBmp );
+ SAL_DLLPRIVATE void ImplAssignWithSize( const Bitmap& rBitmap );
+
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset, sal_Bool bMSOFormat = sal_False );
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIBFileHeader( SvStream& rIStm, sal_uLong& rOffset );
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, sal_Bool bMSOFormat = sal_False );
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, sal_Bool bQuad );
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown );
+ SAL_DLLPRIVATE sal_Bool ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bCompressed ) const;
+ SAL_DLLPRIVATE static sal_Bool ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc );
+ SAL_DLLPRIVATE static sal_Bool ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc );
+ SAL_DLLPRIVATE static sal_Bool ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
+ sal_uLong nCompression, sal_uInt32& rImageSize );
+ SAL_DLLPRIVATE static void ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
+ BitmapWriteAccess& rAcc, sal_Bool bRLE4 );
+ SAL_DLLPRIVATE static sal_Bool ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bRLE4 );
+
+ SAL_DLLPRIVATE sal_Bool ImplScaleFast( const double& rScaleX, const double& rScaleY );
+ SAL_DLLPRIVATE sal_Bool ImplScaleInterpolate( const double& rScaleX, const double& rScaleY );
+ SAL_DLLPRIVATE bool ImplScaleConvolution( const double& rScaleX, const double& rScaleY, Kernel& aKernel);
+ SAL_DLLPRIVATE bool ImplTransformAveraging( const double& rScaleX, const double& rScaleY,
+ const Rectangle& rRotatedRectangle, const long nAngle10, const Color& rFillColor );
+ SAL_DLLPRIVATE bool ImplTransformBilinearFiltering( const double& rScaleX, const double& rScaleY,
+ const Rectangle& rRotatedRectangle, const long nAngle10, const Color& rFillColor );
+
+ SAL_DLLPRIVATE static void ImplCalculateContributions( const int aSourceSize, const int aDestinationSize,
+ int& aNumberOfContributions, double*& pWeights, int*& pPixels, int*& pCount,
+ Kernel& aKernel );
+
+ SAL_DLLPRIVATE bool ImplConvolutionPass( Bitmap& aNewBitmap, const int nNewSize, BitmapReadAccess* pReadAcc,
+ int aNumberOfContributions, double* pWeights, int* pPixels, int* pCount );
+
+ SAL_DLLPRIVATE sal_Bool ImplMakeMono( sal_uInt8 cThreshold );
+ SAL_DLLPRIVATE sal_Bool ImplMakeMonoDither();
+ SAL_DLLPRIVATE sal_Bool ImplMakeGreyscales( sal_uInt16 nGreyscales );
+ SAL_DLLPRIVATE sal_Bool ImplConvertUp( sal_uInt16 nBitCount, Color* pExtColor = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplConvertGhosted();
+ SAL_DLLPRIVATE sal_Bool ImplDitherMatrix();
+ SAL_DLLPRIVATE sal_Bool ImplDitherFloyd();
+ SAL_DLLPRIVATE sal_Bool ImplDitherFloyd16();
+ SAL_DLLPRIVATE sal_Bool ImplReduceSimple( sal_uInt16 nColorCount );
+ SAL_DLLPRIVATE sal_Bool ImplReducePopular( sal_uInt16 nColorCount );
+ SAL_DLLPRIVATE sal_Bool ImplReduceMedian( sal_uInt16 nColorCount );
+ SAL_DLLPRIVATE void ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal,
+ long nR1, long nR2, long nG1, long nG2, long nB1, long nB2,
+ long nColors, long nPixels, long& rIndex );
+ SAL_DLLPRIVATE sal_Bool ImplConvolute3( const long* pMatrix, long nDivisor,
+ const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplMedianFilter( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplSobelGrey( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplSolarize( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplSepia( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplMosaic( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplPopArt( const BmpFilterParam* pFilterParam, const Link* pProgress );
+
+ SAL_DLLPRIVATE bool ImplSeparableBlurFilter( const double aRadius = 0.7 );
+ SAL_DLLPRIVATE bool ImplSeparableUnsharpenFilter( const double aRadius = 0.7 );
+ SAL_DLLPRIVATE void ImplBlurContributions( const int aSize, const int aNumberOfContributions,
+ double* pBlurVector, double*& pWeights, int*& pPixels, int*& pCount );
+public:
+
+ Bitmap();
+ Bitmap( const Bitmap& rBitmap );
+ Bitmap( const Size& rSizePixel, sal_uInt16 nBitCount, const BitmapPalette* pPal = NULL );
+ Bitmap( const ResId& rResId );
+ Bitmap( SalBitmap* pSalBitmap );
+ virtual ~Bitmap();
+
+ Bitmap& operator=( const Bitmap& rBitmap );
+ inline sal_Bool operator!() const;
+ inline sal_Bool operator==( const Bitmap& rBitmap ) const;
+ inline sal_Bool operator!=( const Bitmap& rBitmap ) const;
+
+ inline sal_Bool IsSameInstance( const Bitmap& rBmp ) const;
+ sal_Bool IsEqual( const Bitmap& rBmp ) const;
+
+ inline sal_Bool IsEmpty() const;
+ void SetEmpty();
+
+ inline const MapMode& GetPrefMapMode() const;
+ inline void SetPrefMapMode( const MapMode& rMapMode );
+
+ inline const Size& GetPrefSize() const;
+ inline void SetPrefSize( const Size& rSize );
+
+ Size GetSizePixel() const;
+
+ /**
+ * The pixel size of a bitmap's source (e.g. an image file)
+ * and the pixel size of its resulting bitmap can differ,
+ * e.g. when the image reader has its preview mode enabled.
+ */
+ void SetSourceSizePixel( const Size& );
+
+ sal_uInt16 GetBitCount() const;
+ inline sal_uLong GetColorCount() const;
+ inline sal_uLong GetSizeBytes() const;
+ sal_Bool HasGreyPalette() const;
+ /** get system dependent bitmap data
+
+ @param rData
+ The system dependent BitmapSystemData structure to be filled
+
+ @return sal_True if the bitmap has a valid system object (e.g. not empty)
+ */
+ bool GetSystemData( BitmapSystemData& rData ) const;
+
+ sal_uLong GetChecksum() const;
+
+ Bitmap CreateDisplayBitmap( OutputDevice* pDisplay );
+ Bitmap GetColorTransformedBitmap() const;
+
+ static const BitmapPalette& GetGreyPalette( int nEntries );
+
+public:
+
+ sal_Bool MakeMono( sal_uInt8 cThreshold );
+
+
+ /** Convert bitmap format
+
+ @param eConversion
+ The format this bitmap should be converted to.
+
+ @return sal_True, if the conversion was completed successfully.
+ */
+ sal_Bool Convert( BmpConversion eConversion );
+
+ /** Reduce number of colors for the bitmap
+
+ @param nNewColorCount
+ Maximal number of bitmap colors after the reduce operation
+
+ @param eReduce
+ Algorithm to use for color reduction
+
+ @return sal_True, if the color reduction operation was completed successfully.
+ */
+ sal_Bool ReduceColors( sal_uInt16 nNewColorCount,
+ BmpReduce eReduce = BMP_REDUCE_SIMPLE );
+
+ /** Apply a dither algorithm to the bitmap
+
+ This method dithers the bitmap inplace, i.e. a true color
+ bitmap is converted to a paletted bitmap, reducing the color
+ deviation by error diffusion.
+
+ @param nDitherFlags
+ The algorithm to be used for dithering
+
+ @param pDitherPal
+ A custom palette to be used when dithering (not yet implemented, leave NULL)
+ */
+ sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX );
+
+ /** Crop the bitmap
+
+ @param rRectPixel
+ A rectangle specifying the crop amounts on all four sides of
+ the bitmap. If the upper left corner of the bitmap is assigned
+ (0,0), then this method cuts out the given rectangle from the
+ bitmap. Note that the rectangle is clipped to the bitmap's
+ dimension, i.e. negative left,top rectangle coordinates or
+ exceeding width or height is ignored.
+
+ @return sal_True, if cropping was performed successfully. If
+ nothing had to be cropped, because e.g. the crop rectangle
+ included the bitmap, sal_False is returned, too!
+ */
+ sal_Bool Crop( const Rectangle& rRectPixel );
+
+ /** Expand the bitmap by pixel padding
+
+ @param nDX
+ Number of pixel to pad at the right border of the bitmap
+
+ @param nDY
+ Number of scanlines to pad at the bottom border of the bitmap
+
+ @param pInitColor
+ Color to use for padded pixel
+
+ @return sal_True, if padding was performed successfully. sal_False is
+ not only returned when the operation failed, but also if
+ nothing had to be done, e.g. because nDX and nDY were zero.
+ */
+ sal_Bool Expand( sal_uLong nDX, sal_uLong nDY,
+ const Color* pInitColor = NULL );
+
+ /** Copy a rectangular area from another bitmap
+
+ @param rRectDst
+ Destination rectangle in this bitmap. This is clipped to the
+ bitmap dimensions.
+
+ @param rRectSrc
+ Source rectangle in pBmpSrc. This is clipped to the source
+ bitmap dimensions. Note further that no scaling takes place
+ during this copy operation, i.e. only the minimum of source
+ and destination rectangle's width and height are used.
+
+ @param pBmpSrc
+ The source bitmap to copy from. If this argument is NULL, or
+ equal to the object this method is called on, copying takes
+ place within the same bitmap.
+
+ @return sal_True, if the operation completed successfully. sal_False
+ is not only returned when the operation failed, but also if
+ nothing had to be done, e.g. because one of the rectangles are
+ empty.
+ */
+ sal_Bool CopyPixel( const Rectangle& rRectDst,
+ const Rectangle& rRectSrc,
+ const Bitmap* pBmpSrc = NULL );
+
+ /** Perform boolean operations with another bitmap
+
+ @param rMask
+ The mask bitmap in the selected combine operation
+
+ @param eCombine
+ The combine operation to perform on the bitmap
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool CombineSimple( const Bitmap& rMask,
+ BmpCombine eCombine );
+
+ /** Alpha-blend the given bitmap against a specified uniform
+ background color.
+
+ @attention This method might convert paletted bitmaps to
+ truecolor, to be able to represent every necessary color. Note
+ that during alpha blending, lots of colors not originally
+ included in the bitmap can be generated.
+
+ @param rAlpha
+ Alpha mask to blend with
+
+ @param rBackgroundColor
+ Background color to use for every pixel during alpha blending
+
+ @return sal_True, if blending was successful, sal_False otherwise
+ */
+ sal_Bool Blend( const AlphaMask& rAlpha,
+ const Color& rBackgroundColor );
+
+ /** Fill the entire bitmap with the given color
+
+ @param rFillColor
+ Color value to use for filling
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Erase( const Color& rFillColor );
+
+ /** Perform the Invert operation on every pixel
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Invert();
+
+ /** Mirror the bitmap
+
+ @param nMirrorFlags
+ About which axis (horizontal, vertical, or both) to mirror
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
+
+ /** Scale the bitmap
+
+ @param rNewSize
+ The resulting size of the scaled bitmap
+
+ @param nScaleFlag
+ The algorithm to be used for scaling
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Scale( const Size& rNewSize, sal_uLong nScaleFlag = BMP_SCALE_DEFAULT );
+
+ /** Scale the bitmap
+
+ @param rScaleX
+ The scale factor in x direction.
+
+ @param rScaleY
+ The scale factor in y direction.
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag = BMP_SCALE_DEFAULT );
+
+ /** Rotate bitmap by the specified angle
+
+ @param nAngle10
+ The rotation angle in tenth of a degree. The bitmap is always rotated around its center.
+
+ @param rFillColor
+ The color to use for filling blank areas. During rotation, the
+ bitmap is enlarged such that the whole rotation result fits
+ in. The empty spaces around that rotated original bitmap are
+ then filled with this color.
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Rotate( long nAngle10, const Color& rFillColor );
+
+ /** Create on-off mask from bitmap
+
+ This method creates a bitmask from the bitmap, where every
+ pixel that equals rTransColor is set transparent, the rest
+ opaque.
+
+ @param rTransColor
+ Color value where the bitmask should be transparent
+
+ @param nTol
+ Tolerance value. Specifies the maximal difference between
+ rTransColor and the individual pixel values, such that the
+ corresponding pixel is still regarded transparent.
+
+ @return the resulting bitmask.
+ */
+ Bitmap CreateMask( const Color& rTransColor, sal_uLong nTol = 0UL ) const;
+
+ /** Create region of similar colors in a given rectangle
+
+ @param rColor
+ All pixel which have this color are included in the calculated region
+
+ @param rRect
+ The rectangle within which matching pixel are looked for. This
+ rectangle is always clipped to the bitmap dimensions.
+
+ @return the generated region.
+ */
+ Region CreateRegion( const Color& rColor, const Rectangle& rRect ) const;
+
+ /** Replace all pixel where the given mask is on with the specified color
+
+ @param rMask
+ Mask specifying which pixel should be replaced
+
+ @param rReplaceColor
+ Color to be placed in all changed pixel
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Replace( const Bitmap& rMask, const Color& rReplaceColor );
+
+ /** Merge bitmap with given background color according to specified alpha mask
+
+ @param rAlpha
+ Alpha mask specifying the amount of background color to merge in
+
+ @param rMergeColor
+ Background color to be used for merging
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Replace( const AlphaMask& rAlpha, const Color& rMergeColor );
+
+ /** Replace all pixel having the search color with the specified color
+
+ @param rSearchColor
+ Color specifying which pixel should be replaced
+
+ @param rReplaceColor
+ Color to be placed in all changed pixel
+
+ @param nTol
+ Tolerance value. Specifies the maximal difference between
+ rSearchColor and the individual pixel values, such that the
+ corresponding pixel is still regarded a match.
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol = 0 );
+
+ /** Replace all pixel having one the search colors with the corresponding replace color
+
+ @param pSearchColor
+ Array of colors specifying which pixel should be replaced
+
+ @param pReplaceColor
+ Array of colors to be placed in all changed pixel
+
+ @param nColorCount
+ Size of the aforementioned color arrays
+
+ @param nTol
+ Tolerance value. Specifies the maximal difference between
+ pSearchColor colors and the individual pixel values, such that
+ the corresponding pixel is still regarded a match.
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Replace( const Color* pSearchColors, const Color* rReplaceColors,
+ sal_uLong nColorCount, sal_uLong* pTols = NULL );
+
+ /** Convert the bitmap to a PolyPolygon
+
+ This works by putting continuous areas of the same color into
+ a polygon, by tracing its bounding line.
+
+ @param rPolyPoly
+ The resulting PolyPolygon
+
+ @param nFlags
+ Whether the inline or the outline of the color areas should be
+ represented by the polygon
+
+ @param pProgress
+ A callback for showing the progress of the vectorization
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Vectorize( PolyPolygon& rPolyPoly,
+ sal_uLong nFlags = BMP_VECTORIZE_OUTER,
+ const Link* pProgress = NULL );
+
+ /** Convert the bitmap to a meta file
+
+ This works by putting continuous areas of the same color into
+ polygons painted in this color, by tracing the area's bounding
+ line.
+
+ @param rMtf
+ The resulting meta file
+
+ @param cReduce
+ If non-null, minimal size of bound rects for individual polygons. Smaller ones are ignored.
+
+ @param nFlags
+ Whether the inline or the outline of the color areas should be
+ represented by the polygon
+
+ @param pProgress
+ A callback for showing the progress of the vectorization
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce = 0,
+ sal_uLong nFlags = BMP_VECTORIZE_INNER,
+ const Link* pProgress = NULL );
+
+ /** Change various global color characteristics
+
+ @param nLuminancePercent
+ Percent of luminance change, valid range [-100,100]. Values outside this range are clipped to the valid range.
+
+ @param nContrastPercent
+ Percent of contrast change, valid range [-100,100]. Values outside this range are clipped to the valid range.
+
+ @param nChannelRPercent
+ Percent of red channel change, valid range [-100,100]. Values outside this range are clipped to the valid range.
+
+ @param nChannelGPercent
+ Percent of green channel change, valid range [-100,100]. Values outside this range are clipped to the valid range.
+
+ @param nChannelBPercent
+ Percent of blue channel change, valid range [-100,100]. Values outside this range are clipped to the valid range.
+
+ @param fGamma
+ Exponent of the gamma function applied to the bitmap. The
+ value 1.0 results in no change, the valid range is
+ (0.0,10.0]. Values outside this range are regarded as 1.0.
+
+ @param bInvert
+ If sal_True, invert the channel values with the logical 'not' operator
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Adjust( short nLuminancePercent = 0,
+ short nContrastPercent = 0,
+ short nChannelRPercent = 0,
+ short nChannelGPercent = 0,
+ short nChannelBPercent = 0,
+ double fGamma = 1.0,
+ sal_Bool bInvert = sal_False );
+
+ /** Apply specified filter to the bitmap
+
+ @param eFilter
+ The filter algorithm to apply
+
+ @param pFilterParam
+ Various parameter for the different bitmap filter algorithms
+
+ @param pProgress
+ A callback for showing the progress of the vectorization
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Filter( BmpFilter eFilter,
+ const BmpFilterParam* pFilterParam = NULL,
+ const Link* pProgress = NULL );
+
+ bool HasAlpha();
+
+public:
+ BitmapReadAccess* AcquireReadAccess();
+ BitmapWriteAccess* AcquireWriteAccess();
+ void ReleaseAccess( BitmapReadAccess* pAccess );
+
+ typedef vcl::ScopedBitmapAccess< BitmapReadAccess, Bitmap, &Bitmap::AcquireReadAccess >
+ ScopedReadAccess;
+ typedef vcl::ScopedBitmapAccess< BitmapWriteAccess, Bitmap, &Bitmap::AcquireWriteAccess >
+ ScopedWriteAccess;
+
+public:
+
+ sal_Bool Read( SvStream& rIStm, sal_Bool bFileHeader = sal_True, sal_Bool bMSOFormat = sal_False );
+ sal_Bool Write( SvStream& rOStm, sal_Bool bCompressed = sal_True, sal_Bool bFileHeader = sal_True ) const;
+
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Bitmap& rBitmap );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Bitmap& rBitmap );
+};
+
+inline sal_Bool Bitmap::operator!() const
+{
+ return( mpImpBmp == NULL );
+}
+
+inline sal_Bool Bitmap::operator==( const Bitmap& rBitmap ) const
+{
+ return( rBitmap.mpImpBmp == mpImpBmp );
+}
+
+inline sal_Bool Bitmap::operator!=( const Bitmap& rBitmap ) const
+{
+ return( rBitmap.mpImpBmp != mpImpBmp );
+}
+
+inline sal_Bool Bitmap::IsSameInstance( const Bitmap& rBitmap ) const
+{
+ return( rBitmap.mpImpBmp == mpImpBmp );
+}
+
+inline sal_Bool Bitmap::IsEmpty() const
+{
+ return( mpImpBmp == NULL );
+}
+
+inline const MapMode& Bitmap::GetPrefMapMode() const
+{
+ return maPrefMapMode;
+}
+
+inline void Bitmap::SetPrefMapMode( const MapMode& rMapMode )
+{
+ maPrefMapMode = rMapMode;
+}
+
+inline const Size& Bitmap::GetPrefSize() const
+{
+ return maPrefSize;
+}
+
+inline void Bitmap::SetPrefSize( const Size& rSize )
+{
+ maPrefSize = rSize;
+}
+
+inline sal_uLong Bitmap::GetColorCount() const
+{
+ return( 1UL << (sal_uLong) GetBitCount() );
+}
+
+inline sal_uLong Bitmap::GetSizeBytes() const
+{
+ const Size aSizePix( GetSizePixel() );
+ return( ( (sal_uLong) aSizePix.Width() * aSizePix.Height() * GetBitCount() ) >> 3UL );
+}
+
+#endif // _SV_BITMAP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
new file mode 100644
index 000000000000..9eaaf618200c
--- /dev/null
+++ b/include/vcl/bitmapex.hxx
@@ -0,0 +1,389 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_BITMAPEX_HXX
+#define _SV_BITMAPEX_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/bitmap.hxx>
+#include <vcl/alpha.hxx>
+#include <tools/color.hxx>
+
+// -------------------
+// - TransparentType -
+// -------------------
+
+enum TransparentType
+{
+ TRANSPARENT_NONE,
+ TRANSPARENT_COLOR,
+ TRANSPARENT_BITMAP
+};
+
+// ------------
+// - BitmapEx -
+// ------------
+
+class VCL_DLLPUBLIC BitmapEx
+{
+ friend class ImpGraphic;
+
+private:
+
+ Bitmap aBitmap;
+ Bitmap aMask;
+ Size aBitmapSize;
+ Color aTransparentColor;
+ TransparentType eTransparent;
+ sal_Bool bAlpha;
+
+public:
+
+
+ SAL_DLLPRIVATE ImpBitmap* ImplGetBitmapImpBitmap() const { return aBitmap.ImplGetImpBitmap(); }
+ SAL_DLLPRIVATE ImpBitmap* ImplGetMaskImpBitmap() const { return aMask.ImplGetImpBitmap(); }
+
+public:
+
+ BitmapEx();
+ BitmapEx( const ResId& rResId );
+ BitmapEx( const BitmapEx& rBitmapEx );
+ BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize );
+ BitmapEx( const Bitmap& rBmp );
+ BitmapEx( const Bitmap& rBmp, const Bitmap& rMask );
+ BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask );
+ BitmapEx( const Bitmap& rBmp, const Color& rTransparentColor );
+ ~BitmapEx();
+
+ BitmapEx& operator=( const BitmapEx& rBitmapEx );
+ sal_Bool operator==( const BitmapEx& rBitmapEx ) const;
+ sal_Bool operator!=( const BitmapEx& rBitmapEx ) const { return !(*this==rBitmapEx); }
+ sal_Bool operator!() const { return !aBitmap; }
+
+ sal_Bool IsEqual( const BitmapEx& rBmpEx ) const;
+
+ sal_Bool IsEmpty() const;
+ void SetEmpty();
+ void Clear();
+
+ void Draw( OutputDevice* pOutDev,
+ const Point& rDestPt ) const;
+ void Draw( OutputDevice* pOutDev,
+ const Point& rDestPt, const Size& rDestSize ) const;
+
+ sal_Bool IsTransparent() const;
+ TransparentType GetTransparentType() const { return eTransparent; }
+
+ Bitmap GetBitmap( const Color* pTransReplaceColor = NULL ) const;
+ Bitmap GetMask() const;
+
+ BitmapEx GetColorTransformedBitmapEx() const;
+
+ sal_Bool IsAlpha() const;
+ AlphaMask GetAlpha() const;
+
+ const Size& GetSizePixel() const { return aBitmapSize; }
+ void SetSizePixel( const Size& rNewSize );
+
+ const Size& GetPrefSize() const { return aBitmap.GetPrefSize(); }
+ void SetPrefSize( const Size& rPrefSize ) { aBitmap.SetPrefSize( rPrefSize ); }
+
+ const MapMode& GetPrefMapMode() const { return aBitmap.GetPrefMapMode(); }
+ void SetPrefMapMode( const MapMode& rPrefMapMode ) { aBitmap.SetPrefMapMode( rPrefMapMode ); }
+
+ const Color& GetTransparentColor() const { return aTransparentColor; }
+ void SetTransparentColor( const Color& rColor ) { aTransparentColor = rColor; }
+
+ sal_uInt16 GetBitCount() const { return aBitmap.GetBitCount(); }
+ sal_uLong GetSizeBytes() const;
+ sal_uLong GetChecksum() const;
+
+public:
+
+ /** Convert bitmap format
+
+ @param eConversion
+ The format this bitmap should be converted to.
+
+ @return sal_True, if the conversion was completed successfully.
+ */
+ sal_Bool Convert( BmpConversion eConversion );
+
+ /** Reduce number of colors for the bitmap
+
+ @param nNewColorCount
+ Maximal number of bitmap colors after the reduce operation
+
+ @param eReduce
+ Algorithm to use for color reduction
+
+ @return sal_True, if the color reduction operation was completed successfully.
+ */
+ sal_Bool ReduceColors( sal_uInt16 nNewColorCount,
+ BmpReduce eReduce = BMP_REDUCE_SIMPLE );
+
+ /** Apply a dither algorithm to the bitmap
+
+ This method dithers the bitmap inplace, i.e. a true color
+ bitmap is converted to a paletted bitmap, reducing the color
+ deviation by error diffusion.
+
+ @param nDitherFlags
+ The algorithm to be used for dithering
+ */
+ sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX );
+
+ /** Crop the bitmap
+
+ @param rRectPixel
+ A rectangle specifying the crop amounts on all four sides of
+ the bitmap. If the upper left corner of the bitmap is assigned
+ (0,0), then this method cuts out the given rectangle from the
+ bitmap. Note that the rectangle is clipped to the bitmap's
+ dimension, i.e. negative left,top rectangle coordinates or
+ exceeding width or height is ignored.
+
+ @return sal_True, if cropping was performed successfully. If
+ nothing had to be cropped, because e.g. the crop rectangle
+ included the bitmap, sal_False is returned, too!
+ */
+ sal_Bool Crop( const Rectangle& rRectPixel );
+
+ /** Expand the bitmap by pixel padding
+
+ @param nDX
+ Number of pixel to pad at the right border of the bitmap
+
+ @param nDY
+ Number of scanlines to pad at the bottom border of the bitmap
+
+ @param pInitColor
+ Color to use for padded pixel
+
+ @return sal_True, if padding was performed successfully. sal_False is
+ not only returned when the operation failed, but also if
+ nothing had to be done, e.g. because nDX and nDY were zero.
+ */
+ sal_Bool Expand( sal_uLong nDX, sal_uLong nDY,
+ const Color* pInitColor = NULL,
+ sal_Bool bExpandTransparent = sal_False );
+
+ /** Copy a rectangular area from another bitmap
+
+ @param rRectDst
+ Destination rectangle in this bitmap. This is clipped to the
+ bitmap dimensions.
+
+ @param rRectSrc
+ Source rectangle in pBmpSrc. This is clipped to the source
+ bitmap dimensions. Note further that no scaling takes place
+ during this copy operation, i.e. only the minimum of source
+ and destination rectangle's width and height are used.
+
+ @param pBmpSrc
+ The source bitmap to copy from. If this argument is NULL, or
+ equal to the object this method is called on, copying takes
+ place within the same bitmap.
+
+ @return sal_True, if the operation completed successfully. sal_False
+ is not only returned when the operation failed, but also if
+ nothing had to be done, e.g. because one of the rectangles are
+ empty.
+ */
+ sal_Bool CopyPixel( const Rectangle& rRectDst,
+ const Rectangle& rRectSrc,
+ const BitmapEx* pBmpExSrc = NULL );
+
+ /** Fill the entire bitmap with the given color
+
+ @param rFillColor
+ Color value to use for filling. Set the transparency part of
+ the color to fill the mask.
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Erase( const Color& rFillColor );
+
+ /** Perform the Invert operation on every pixel
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Invert();
+
+ /** Mirror the bitmap
+
+ @param nMirrorFlags
+ About which axis (horizontal, vertical, or both) to mirror
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
+
+ /** Scale the bitmap
+
+ @param rNewSize
+ The resulting size of the scaled bitmap
+
+ @param nScaleFlag
+ The algorithm to be used for scaling
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Scale( const Size& rNewSize, sal_uLong nScaleFlag = BMP_SCALE_DEFAULT );
+
+ /** Scale the bitmap
+
+ @param rScaleX
+ The scale factor in x direction.
+
+ @param rScaleY
+ The scale factor in y direction.
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag = BMP_SCALE_DEFAULT );
+
+ /** Rotate bitmap by the specified angle
+
+ @param nAngle10
+ The rotation angle in tenth of a degree. The bitmap is always rotated around its center.
+
+ @param rFillColor
+ The color to use for filling blank areas. During rotation, the
+ bitmap is enlarged such that the whole rotation result fits
+ in. The empty spaces around that rotated original bitmap are
+ then filled with this color.
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Rotate( long nAngle10, const Color& rFillColor );
+
+ /** Replace all pixel having the search color with the specified color
+
+ @param rSearchColor
+ Color specifying which pixel should be replaced
+
+ @param rReplaceColor
+ Color to be placed in all changed pixel
+
+ @param nTol
+ Tolerance value. Specifies the maximal difference between
+ rSearchColor and the individual pixel values, such that the
+ corresponding pixel is still regarded a match.
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol = 0 );
+
+ /** Replace all pixel having one the search colors with the corresponding replace color
+
+ @param pSearchColor
+ Array of colors specifying which pixel should be replaced
+
+ @param pReplaceColor
+ Array of colors to be placed in all changed pixel
+
+ @param nColorCount
+ Size of the aforementioned color arrays
+
+ @param nTol
+ Tolerance value. Specifies the maximal difference between
+ pSearchColor colors and the individual pixel values, such that
+ the corresponding pixel is still regarded a match.
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Replace( const Color* pSearchColors, const Color* pReplaceColors,
+ sal_uLong nColorCount, const sal_uLong* pTols = NULL );
+
+ /** Change various global color characteristics
+
+ @param nLuminancePercent
+ Percent of luminance change, valid range [-100,100]. Values outside this range are clipped to the valid range.
+
+ @param nContrastPercent
+ Percent of contrast change, valid range [-100,100]. Values outside this range are clipped to the valid range.
+
+ @param nChannelRPercent
+ Percent of red channel change, valid range [-100,100]. Values outside this range are clipped to the valid range.
+
+ @param nChannelGPercent
+ Percent of green channel change, valid range [-100,100]. Values outside this range are clipped to the valid range.
+
+ @param nChannelBPercent
+ Percent of blue channel change, valid range [-100,100]. Values outside this range are clipped to the valid range.
+
+ @param fGamma
+ Exponent of the gamma function applied to the bitmap. The
+ value 1.0 results in no change, the valid range is
+ (0.0,10.0]. Values outside this range are regarded as 1.0.
+
+ @param bInvert
+ If sal_True, invert the channel values with the logical 'not' operator
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Adjust( short nLuminancePercent = 0,
+ short nContrastPercent = 0,
+ short nChannelRPercent = 0,
+ short nChannelGPercent = 0,
+ short nChannelBPercent = 0,
+ double fGamma = 1.0,
+ sal_Bool bInvert = sal_False );
+
+ /** Apply specified filter to the bitmap
+
+ @param eFilter
+ The filter algorithm to apply
+
+ @param pFilterParam
+ Various parameter for the different bitmap filter algorithms
+
+ @param pProgress
+ A callback for showing the progress of the vectorization
+
+ @return sal_True, if the operation was completed successfully.
+ */
+ sal_Bool Filter( BmpFilter eFilter,
+ const BmpFilterParam* pFilterParam = NULL,
+ const Link* pProgress = NULL );
+
+ /** Get transparency at given position
+
+ @param nX
+ integer X-Position in Bitmap
+
+ @param nY
+ integer Y-Position in Bitmap
+
+ @return transparency value in the range of [0 .. 255] where
+ 0 is not transparent, 255 is fully transparent
+ */
+ sal_uInt8 GetTransparency(sal_Int32 nX, sal_Int32 nY) const;
+
+public:
+
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx );
+ static BitmapEx AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize);
+};
+
+#endif // _SV_BITMAPEX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/bmpacc.hxx b/include/vcl/bmpacc.hxx
new file mode 100644
index 000000000000..097fd7cf57e3
--- /dev/null
+++ b/include/vcl/bmpacc.hxx
@@ -0,0 +1,454 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_BMPACC_HXX
+#define _SV_BMPACC_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/salbtype.hxx>
+#include <vcl/bitmap.hxx>
+
+// --------------------
+// - Access defines -
+// --------------------
+
+#define DECL_FORMAT_GETPIXEL( Format ) \
+static BitmapColor GetPixelFor##Format( ConstScanline pScanline, long nX, const ColorMask& rMask );
+
+#define DECL_FORMAT_SETPIXEL( Format ) \
+static void SetPixelFor##Format( Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask );
+
+#define DECL_FORMAT( Format ) \
+DECL_FORMAT_GETPIXEL( Format ) \
+DECL_FORMAT_SETPIXEL( Format )
+
+#define IMPL_FORMAT_GETPIXEL( Format ) \
+BitmapColor BitmapReadAccess::GetPixelFor##Format( ConstScanline pScanline, long nX, const ColorMask& rMask )
+
+#define IMPL_FORMAT_GETPIXEL_NOMASK( Format ) \
+BitmapColor BitmapReadAccess::GetPixelFor##Format( ConstScanline pScanline, long nX, const ColorMask& )
+
+#define IMPL_FORMAT_SETPIXEL( Format ) \
+void BitmapReadAccess::SetPixelFor##Format( Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask )
+
+#define IMPL_FORMAT_SETPIXEL_NOMASK( Format ) \
+void BitmapReadAccess::SetPixelFor##Format( Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& )
+
+#define CASE_FORMAT( Format ) \
+case( BMP_FORMAT##Format ): \
+{ \
+ mFncGetPixel = GetPixelFor##Format;\
+ mFncSetPixel = SetPixelFor##Format;\
+} \
+break;
+
+
+// --------------------
+// - Access functions -
+// --------------------
+
+typedef BitmapColor (*FncGetPixel)( ConstScanline pScanline, long nX, const ColorMask& rMask );
+typedef void (*FncSetPixel)( Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask );
+
+// --------------------
+// - BitmapReadAccess -
+// --------------------
+
+class VCL_DLLPUBLIC BitmapReadAccess
+{
+ friend class BitmapWriteAccess;
+
+private:
+
+ BitmapReadAccess() {}
+ BitmapReadAccess( const BitmapReadAccess& ) {}
+ BitmapReadAccess& operator=( const BitmapReadAccess& ) { return *this; }
+
+protected:
+ Bitmap maBitmap;
+ BitmapBuffer* mpBuffer;
+ Scanline* mpScanBuf;
+ ColorMask maColorMask;
+ FncGetPixel mFncGetPixel;
+ FncSetPixel mFncSetPixel;
+ sal_Bool mbModify;
+
+
+SAL_DLLPRIVATE void ImplCreate( Bitmap& rBitmap );
+SAL_DLLPRIVATE void ImplDestroy();
+SAL_DLLPRIVATE sal_Bool ImplSetAccessPointers( sal_uLong nFormat );
+
+public:
+
+SAL_DLLPRIVATE void ImplZeroInitUnusedBits();
+SAL_DLLPRIVATE BitmapBuffer* ImplGetBitmapBuffer() const { return mpBuffer; }
+
+ DECL_FORMAT( _1BIT_MSB_PAL )
+ DECL_FORMAT( _1BIT_LSB_PAL )
+ DECL_FORMAT( _4BIT_MSN_PAL )
+ DECL_FORMAT( _4BIT_LSN_PAL )
+ DECL_FORMAT( _8BIT_PAL )
+ DECL_FORMAT( _8BIT_TC_MASK )
+ DECL_FORMAT( _16BIT_TC_MSB_MASK )
+ DECL_FORMAT( _16BIT_TC_LSB_MASK )
+ DECL_FORMAT( _24BIT_TC_BGR )
+ DECL_FORMAT( _24BIT_TC_RGB )
+ DECL_FORMAT( _24BIT_TC_MASK )
+ DECL_FORMAT( _32BIT_TC_ABGR )
+ DECL_FORMAT( _32BIT_TC_ARGB )
+ DECL_FORMAT( _32BIT_TC_BGRA )
+ DECL_FORMAT( _32BIT_TC_RGBA )
+ DECL_FORMAT( _32BIT_TC_MASK )
+protected:
+ BitmapReadAccess( Bitmap& rBitmap, sal_Bool bModify );
+
+public:
+ BitmapReadAccess( Bitmap& rBitmap );
+ virtual ~BitmapReadAccess();
+
+ inline sal_Bool operator!() const;
+
+ inline long Width() const;
+ inline long Height() const;
+ inline Point TopLeft() const;
+ inline Point BottomRight() const;
+
+ inline sal_Bool IsTopDown() const;
+ inline sal_Bool IsBottomUp() const;
+
+ inline sal_uLong GetScanlineFormat() const;
+ inline sal_uLong GetScanlineSize() const;
+
+ inline sal_uInt16 GetBitCount() const;
+ inline BitmapColor GetBestMatchingColor( const BitmapColor& rBitmapColor );
+
+ inline Scanline GetBuffer() const;
+ inline Scanline GetScanline( long nY ) const;
+
+ inline sal_Bool HasPalette() const;
+ inline const BitmapPalette& GetPalette() const;
+ inline sal_uInt16 GetPaletteEntryCount() const;
+ inline const BitmapColor& GetPaletteColor( sal_uInt16 nColor ) const;
+ inline const BitmapColor& GetBestPaletteColor( const BitmapColor& rBitmapColor ) const;
+ sal_uInt16 GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const;
+
+ inline sal_Bool HasColorMask() const;
+ inline ColorMask& GetColorMask() const;
+
+ inline BitmapColor GetPixelFromData( const sal_uInt8* pData, long nX ) const;
+ inline void SetPixelOnData( sal_uInt8* pData, long nX, const BitmapColor& rBitmapColor );
+ inline BitmapColor GetPixel( long nY, long nX ) const;
+ inline BitmapColor GetColor( long nY, long nX ) const;
+ inline sal_uInt8 GetLuminance( long nY, long nX ) const;
+};
+
+// ---------------------
+// - BitmapWriteAccess -
+// ---------------------
+
+class VCL_DLLPUBLIC BitmapWriteAccess : public BitmapReadAccess
+{
+public:
+
+ BitmapWriteAccess( Bitmap& rBitmap );
+ virtual ~BitmapWriteAccess();
+
+ void CopyScanline( long nY, const BitmapReadAccess& rReadAcc );
+ void CopyScanline( long nY, ConstScanline aSrcScanline,
+ sal_uLong nSrcScanlineFormat, sal_uLong nSrcScanlineSize );
+
+ void CopyBuffer( const BitmapReadAccess& rReadAcc );
+
+ inline void SetPalette( const BitmapPalette& rPalette );
+ inline void SetPaletteEntryCount( sal_uInt16 nCount );
+ inline void SetPaletteColor( sal_uInt16 nColor, const BitmapColor& rBitmapColor );
+
+ inline void SetPixel( long nY, long nX, const BitmapColor& rBitmapColor );
+
+ void SetLineColor( const Color& rColor );
+
+ void SetFillColor( const Color& rColor );
+
+ void Erase( const Color& rColor );
+
+ void DrawLine( const Point& rStart, const Point& rEnd );
+
+ void FillRect( const Rectangle& rRect );
+ void DrawRect( const Rectangle& rRect );
+
+private:
+
+ BitmapColor* mpLineColor;
+ BitmapColor* mpFillColor;
+
+ BitmapWriteAccess() {}
+ BitmapWriteAccess( const BitmapWriteAccess& ) : BitmapReadAccess() {}
+ BitmapWriteAccess& operator=( const BitmapWriteAccess& ) { return *this; }
+};
+
+// -----------
+// - Inlines -
+// -----------
+
+inline sal_Bool BitmapReadAccess::operator!() const
+{
+ return( mpBuffer == NULL );
+}
+
+// ------------------------------------------------------------------
+
+inline long BitmapReadAccess::Width() const
+{
+ return( mpBuffer ? mpBuffer->mnWidth : 0L );
+}
+
+// ------------------------------------------------------------------
+
+inline long BitmapReadAccess::Height() const
+{
+ return( mpBuffer ? mpBuffer->mnHeight : 0L );
+}
+
+// ------------------------------------------------------------------
+
+inline Point BitmapReadAccess::TopLeft() const
+{
+ return Point();
+}
+
+// ------------------------------------------------------------------
+
+inline Point BitmapReadAccess::BottomRight() const
+{
+ return Point( Width() - 1L, Height() - 1L );
+}
+
+// ------------------------------------------------------------------
+
+inline sal_Bool BitmapReadAccess::IsTopDown() const
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ return( mpBuffer ? sal::static_int_cast<sal_Bool>( BMP_SCANLINE_ADJUSTMENT( mpBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) : sal_False );
+}
+
+// ------------------------------------------------------------------
+
+inline sal_Bool BitmapReadAccess::IsBottomUp() const
+{
+ return !IsTopDown();
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uLong BitmapReadAccess::GetScanlineFormat() const
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ return( mpBuffer ? BMP_SCANLINE_FORMAT( mpBuffer->mnFormat ) : 0UL );
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uLong BitmapReadAccess::GetScanlineSize() const
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ return( mpBuffer ? mpBuffer->mnScanlineSize : 0UL );
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uInt16 BitmapReadAccess::GetBitCount() const
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ return( mpBuffer ? mpBuffer->mnBitCount : 0 );
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor BitmapReadAccess::GetBestMatchingColor( const BitmapColor& rBitmapColor )
+{
+ if( HasPalette() )
+ return BitmapColor( (sal_uInt8) GetBestPaletteIndex( rBitmapColor ) );
+ else
+ return rBitmapColor;
+}
+
+// ------------------------------------------------------------------
+
+inline Scanline BitmapReadAccess::GetBuffer() const
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ return( mpBuffer ? mpBuffer->mpBits : NULL );
+}
+
+// ------------------------------------------------------------------
+
+inline Scanline BitmapReadAccess::GetScanline( long nY ) const
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ DBG_ASSERT( nY < mpBuffer->mnHeight, "y-coordinate out of range!" );
+ return( mpBuffer ? mpScanBuf[ nY ] : NULL );
+}
+
+// ------------------------------------------------------------------
+
+inline sal_Bool BitmapReadAccess::HasPalette() const
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ return( mpBuffer && !!mpBuffer->maPalette );
+}
+
+// ------------------------------------------------------------------
+
+inline const BitmapPalette& BitmapReadAccess::GetPalette() const
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ return mpBuffer->maPalette;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uInt16 BitmapReadAccess::GetPaletteEntryCount() const
+{
+ DBG_ASSERT( HasPalette(), "Bitmap has no palette!" );
+ return( HasPalette() ? mpBuffer->maPalette.GetEntryCount() : 0 );
+}
+
+// ------------------------------------------------------------------
+
+inline const BitmapColor& BitmapReadAccess::GetPaletteColor( sal_uInt16 nColor ) const
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ DBG_ASSERT( HasPalette(), "Bitmap has no palette!" );
+ return mpBuffer->maPalette[ nColor ];
+}
+
+// ------------------------------------------------------------------
+
+inline const BitmapColor& BitmapReadAccess::GetBestPaletteColor( const BitmapColor& rBitmapColor ) const
+{
+ return GetPaletteColor( GetBestPaletteIndex( rBitmapColor ) );
+}
+
+// ------------------------------------------------------------------
+
+inline sal_Bool BitmapReadAccess::HasColorMask() const
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ const sal_uLong nFormat = BMP_SCANLINE_FORMAT( mpBuffer->mnFormat );
+
+ return( nFormat == BMP_FORMAT_8BIT_TC_MASK ||
+ nFormat == BMP_FORMAT_16BIT_TC_MSB_MASK ||
+ nFormat == BMP_FORMAT_16BIT_TC_LSB_MASK ||
+ nFormat == BMP_FORMAT_24BIT_TC_MASK ||
+ nFormat == BMP_FORMAT_32BIT_TC_MASK );
+}
+
+// ------------------------------------------------------------------
+
+inline ColorMask& BitmapReadAccess::GetColorMask() const
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ return mpBuffer->maColorMask;
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor BitmapReadAccess::GetPixel( long nY, long nX ) const
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ DBG_ASSERT( nX < mpBuffer->mnWidth, "x-coordinate out of range!" );
+ DBG_ASSERT( nY < mpBuffer->mnHeight, "y-coordinate out of range!" );
+ return mFncGetPixel( mpScanBuf[ nY ], nX, maColorMask );
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor BitmapReadAccess::GetPixelFromData( const sal_uInt8* pData, long nX ) const
+{
+ DBG_ASSERT( pData, "Access is not valid!" );
+ return mFncGetPixel( pData, nX, maColorMask );
+}
+
+// ------------------------------------------------------------------
+
+inline void BitmapReadAccess::SetPixelOnData( sal_uInt8* pData, long nX, const BitmapColor& rBitmapColor )
+{
+ DBG_ASSERT( pData, "Access is not valid!" );
+ mFncSetPixel( pData, nX, rBitmapColor, maColorMask );
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor BitmapReadAccess::GetColor( long nY, long nX ) const
+{
+ if( !!mpBuffer->maPalette )
+ {
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ return mpBuffer->maPalette[ GetPixel( nY, nX ).GetIndex() ];
+ }
+ else
+ return GetPixel( nY, nX );
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uInt8 BitmapReadAccess::GetLuminance( long nY, long nX ) const
+{
+ return GetColor( nY, nX ).GetLuminance();
+}
+
+// ------------------------------------------------------------------
+
+inline void BitmapWriteAccess::SetPalette( const BitmapPalette& rPalette )
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ mpBuffer->maPalette = rPalette;
+}
+
+// ------------------------------------------------------------------
+
+inline void BitmapWriteAccess::SetPaletteEntryCount( sal_uInt16 nCount )
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ mpBuffer->maPalette.SetEntryCount( nCount );
+}
+
+// ------------------------------------------------------------------
+
+inline void BitmapWriteAccess::SetPaletteColor( sal_uInt16 nColor, const BitmapColor& rBitmapColor )
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ DBG_ASSERT( HasPalette(), "Bitmap has no palette!" );
+ mpBuffer->maPalette[ nColor ] = rBitmapColor;
+}
+
+// ------------------------------------------------------------------
+
+inline void BitmapWriteAccess::SetPixel( long nY, long nX, const BitmapColor& rBitmapColor )
+{
+ DBG_ASSERT( mpBuffer, "Access is not valid!" );
+ DBG_ASSERT( nX < mpBuffer->mnWidth, "x-coordinate out of range!" );
+ DBG_ASSERT( nY < mpBuffer->mnHeight, "y-coordinate out of range!" );
+ mFncSetPixel( mpScanBuf[ nY ], nX, rBitmapColor, maColorMask );
+}
+
+#endif // _SV_BMPACC_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/btndlg.hxx b/include/vcl/btndlg.hxx
new file mode 100644
index 000000000000..541109885079
--- /dev/null
+++ b/include/vcl/btndlg.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 _SV_BTNDLG_HXX
+#define _SV_BTNDLG_HXX
+
+#include <boost/ptr_container/ptr_vector.hpp>
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/dialog.hxx>
+
+struct ImplBtnDlgItem;
+class PushButton;
+
+// ----------------------
+// - ButtonDialog-Types -
+// ----------------------
+
+#define BUTTONDIALOG_BUTTON_NOTFOUND ((sal_uInt16)0xFFFF)
+
+#define BUTTONDIALOG_DEFBUTTON ((sal_uInt16)0x0001)
+#define BUTTONDIALOG_OKBUTTON ((sal_uInt16)0x0002)
+#define BUTTONDIALOG_CANCELBUTTON ((sal_uInt16)0x0004)
+#define BUTTONDIALOG_HELPBUTTON ((sal_uInt16)0x0008)
+#define BUTTONDIALOG_FOCUSBUTTON ((sal_uInt16)0x0010)
+
+// ----------------
+// - ButtonDialog -
+// ----------------
+
+class VCL_DLLPUBLIC ButtonDialog : public Dialog
+{
+private:
+ boost::ptr_vector<ImplBtnDlgItem> maItemList;
+ Size maPageSize;
+ Size maCtrlSize;
+ long mnButtonSize;
+ sal_uInt16 mnCurButtonId;
+ sal_uInt16 mnFocusButtonId;
+ sal_Bool mbFormat;
+ Link maClickHdl;
+
+ SAL_DLLPRIVATE void ImplInitButtonDialogData();
+ SAL_DLLPRIVATE PushButton* ImplCreatePushButton( sal_uInt16 nBtnFlags );
+ SAL_DLLPRIVATE ImplBtnDlgItem* ImplGetItem( sal_uInt16 nId ) const;
+ DECL_DLLPRIVATE_LINK( ImplClickHdl, PushButton* pBtn );
+ SAL_DLLPRIVATE void ImplPosControls();
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE ButtonDialog( const ButtonDialog & );
+ SAL_DLLPRIVATE ButtonDialog& operator=( const ButtonDialog& );
+protected:
+ ButtonDialog( WindowType nType );
+ SAL_DLLPRIVATE long ImplGetButtonSize();
+
+public:
+ ButtonDialog( Window* pParent, WinBits nStyle = WB_STDDIALOG );
+ ~ButtonDialog();
+
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+
+ virtual void Click();
+
+ void SetPageSizePixel( const Size& rSize ) { maPageSize = rSize; }
+ const Size& GetPageSizePixel() const { return maPageSize; }
+
+ sal_uInt16 GetCurButtonId() const { return mnCurButtonId; }
+
+ void AddButton( const XubString& rText, sal_uInt16 nId, sal_uInt16 nBtnFlags, long nSepPixel = 0 );
+ void AddButton( StandardButtonType eType, sal_uInt16 nId, sal_uInt16 nBtnFlags, long nSepPixel = 0 );
+ void RemoveButton( sal_uInt16 nId );
+ void Clear();
+ sal_uInt16 GetButtonId( sal_uInt16 nButton ) const;
+ PushButton* GetPushButton( sal_uInt16 nId ) const;
+ void SetButtonText( sal_uInt16 nId, const XubString& rText );
+ void SetButtonHelpText( sal_uInt16 nId, const XubString& rText );
+
+ void SetFocusButton( sal_uInt16 nId = BUTTONDIALOG_BUTTON_NOTFOUND ) { mnFocusButtonId = nId; }
+ sal_uInt16 GetFocusButton() const { return mnFocusButtonId; }
+
+ void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
+ const Link& GetClickHdl() const { return maClickHdl; }
+};
+
+#endif // _SV_BTNDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
new file mode 100644
index 000000000000..5de792aaab5e
--- /dev/null
+++ b/include/vcl/builder.hxx
@@ -0,0 +1,365 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 _VCLBUILDER_HXX
+#define _VCLBUILDER_HXX
+
+#include <typeinfo>
+#include <tools/resmgr.hxx> //for poxy ResHookProc typedef
+#include <vcl/dllapi.h>
+#include <vcl/window.hxx>
+#include <xmlreader/xmlreader.hxx>
+#include <map>
+#include <set>
+#include <stack>
+#include <vector>
+
+class ListBox;
+class NumericFormatter;
+class PopupMenu;
+class ScrollBar;
+class DateField;
+class TimeField;
+class VclMultiLineEdit;
+
+class VCL_DLLPUBLIC VclBuilder
+{
+public:
+ typedef std::map<OString, OString> stringmap;
+ typedef Window* (*customMakeWidget)(Window *pParent, stringmap &rVec);
+private:
+
+ struct PackingData
+ {
+ bool m_bVerticalOrient;
+ sal_Int32 m_nPosition;
+ PackingData(bool bVerticalOrient = false, sal_Int32 nPosition = -1)
+ : m_bVerticalOrient(bVerticalOrient)
+ , m_nPosition(nPosition)
+ {
+ }
+ };
+
+ struct WinAndId
+ {
+ OString m_sID;
+ Window *m_pWindow;
+ PackingData m_aPackingData;
+ WinAndId(const OString &rId, Window *pWindow, bool bVertical)
+ : m_sID(rId)
+ , m_pWindow(pWindow)
+ , m_aPackingData(bVertical)
+ {
+ }
+ };
+ std::vector<WinAndId> m_aChildren;
+
+ struct MenuAndId
+ {
+ OString m_sID;
+ PopupMenu *m_pMenu;
+ MenuAndId(const OString &rId, PopupMenu *pMenu)
+ : m_sID(rId)
+ , m_pMenu(pMenu)
+ {
+ }
+ };
+ std::vector<MenuAndId> m_aMenus;
+
+ struct StringPair
+ {
+ OString m_sID;
+ OString m_sValue;
+ StringPair(const OString &rId, const OString &rValue)
+ : m_sID(rId)
+ , m_sValue(rValue)
+ {
+ }
+ };
+
+ typedef StringPair RadioButtonGroupMap;
+
+ struct ButtonImageWidgetMap
+ {
+ OString m_sID;
+ OString m_sValue;
+ bool m_bRadio;
+ ButtonImageWidgetMap(const OString &rId, const OString &rValue, bool bRadio)
+ : m_sID(rId)
+ , m_sValue(rValue)
+ , m_bRadio(bRadio)
+ {
+ }
+ };
+
+ typedef StringPair TextBufferMap;
+ typedef StringPair WidgetAdjustmentMap;
+ typedef StringPair ButtonMenuMap;
+ typedef StringPair MnemonicWidgetMap;
+
+ struct ComboBoxModelMap
+ {
+ OString m_sID;
+ OString m_sValue;
+ sal_Int32 m_nActiveId;
+ ComboBoxModelMap(const OString &rId, const OString &rValue, sal_Int32 nActiveId)
+ : m_sID(rId)
+ , m_sValue(rValue)
+ , m_nActiveId(nActiveId)
+ {
+ }
+ };
+
+ struct ListStore
+ {
+ typedef std::vector<OString> row;
+ std::vector<row> m_aEntries;
+ };
+ const ListStore* get_model_by_name(OString sID) const;
+ static void mungeModel(ListBox &rTarget, const ListStore &rStore, sal_uInt16 nActiveId);
+
+ typedef stringmap TextBuffer;
+ const TextBuffer* get_buffer_by_name(OString sID) const;
+ static void mungeTextBuffer(VclMultiLineEdit &rTarget, const TextBuffer &rTextBuffer);
+
+ typedef stringmap Adjustment;
+ const Adjustment *get_adjustment_by_name(OString sID) const;
+ static void mungeAdjustment(NumericFormatter &rTarget, const Adjustment &rAdjustment);
+ static void mungeAdjustment(DateField &rTarget, const Adjustment &rAdjustment);
+ static void mungeAdjustment(TimeField &rTarget, const Adjustment &rAdjustment);
+ static void mungeAdjustment(ScrollBar &rTarget, const Adjustment &rAdjustment);
+
+ typedef std::map<OString, OString> WidgetTranslations;
+ typedef std::map<OString, WidgetTranslations> Translations;
+
+ struct stockinfo
+ {
+ OString m_sStock;
+ int m_nSize;
+ stockinfo() : m_nSize(4) {}
+ };
+
+ typedef std::map<OString, stockinfo> StockMap;
+
+ struct SizeGroup
+ {
+ OString m_sID;
+ std::vector<OString> m_aWidgets;
+ stringmap m_aProperties;
+ SizeGroup(const OString &rId)
+ : m_sID(rId)
+ {
+ }
+ };
+
+ typedef std::map<Window*, stringmap> AtkMap;
+
+ struct ParserState
+ {
+ std::vector<RadioButtonGroupMap> m_aGroupMaps;
+
+ std::vector<ComboBoxModelMap> m_aModelMaps;
+ std::map<OString, ListStore> m_aModels;
+
+ std::vector<TextBufferMap> m_aTextBufferMaps;
+ std::map<OString, TextBuffer> m_aTextBuffers;
+
+ std::vector<WidgetAdjustmentMap> m_aNumericFormatterAdjustmentMaps;
+ std::vector<WidgetAdjustmentMap> m_aTimeFormatterAdjustmentMaps;
+ std::vector<WidgetAdjustmentMap> m_aDateFormatterAdjustmentMaps;
+ std::vector<WidgetAdjustmentMap> m_aScrollAdjustmentMaps;
+ std::map<OString, Adjustment> m_aAdjustments;
+
+ std::vector<ButtonImageWidgetMap> m_aButtonImageWidgetMaps;
+ StockMap m_aStockMap;
+
+ std::vector<ButtonMenuMap> m_aButtonMenuMaps;
+
+ Translations m_aTranslations;
+
+ std::map<Window*, Window*> m_aRedundantParentWidgets;
+
+ std::vector<SizeGroup> m_aSizeGroups;
+
+ AtkMap m_aAtkInfo;
+
+ std::vector<MnemonicWidgetMap> m_aMnemonicWidgetMaps;
+ };
+
+ void loadTranslations(const com::sun::star::lang::Locale &rLocale, const OUString &rUri);
+ OString getTranslation(const OString &rId, const OString &rProperty) const;
+
+ OString m_sID;
+ OString m_sHelpRoot;
+ ResHookProc m_pStringReplace;
+ Window *m_pParent;
+ bool m_bToplevelHasDeferredInit;
+ bool m_bToplevelParentFound;
+ ParserState *m_pParserState;
+
+ Window *get_by_name(OString sID);
+ void delete_by_name(OString sID);
+
+ class sortIntoBestTabTraversalOrder
+ : public std::binary_function<const Window*, const Window*, bool>
+ {
+ VclBuilder *m_pBuilder;
+ public:
+ sortIntoBestTabTraversalOrder(VclBuilder *pBuilder)
+ : m_pBuilder(pBuilder)
+ {
+ }
+ bool operator()(const Window *pA, const Window *pB) const;
+ };
+public:
+ VclBuilder(Window *pParent, OUString sUIRootDir, OUString sUIFile, OString sID = OString());
+ ~VclBuilder();
+ Window *get_widget_root();
+ //sID must exist and be of type T
+ template <typename T> T* get(T*& ret, OString sID)
+ {
+ Window *w = get_by_name(sID);
+ SAL_WARN_IF(!w, "vcl.layout", "widget \"" << sID.getStr() << "\" not found in .ui");
+ SAL_WARN_IF(!dynamic_cast<T*>(w),
+ "vcl.layout", ".ui widget \"" << sID.getStr() << "\" needs to correspond to vcl type " << typeid(T).name());
+ assert(w && dynamic_cast<T*>(w));
+ ret = static_cast<T*>(w);
+ return ret;
+ }
+ PopupMenu* get_menu(PopupMenu*& ret, OString sID)
+ {
+ ret = get_menu(sID);
+ SAL_WARN_IF(!ret, "vcl.layout", "menu \"" << sID.getStr() << "\" not found in .ui");
+ assert(ret);
+ return ret;
+ }
+ //sID may not exist, but must be of type T if it does
+ template <typename T /*=Window if we had c++11*/> T* get(OString sID)
+ {
+ Window *w = get_by_name(sID);
+ SAL_WARN_IF(w && !dynamic_cast<T*>(w),
+ "vcl.layout", ".ui widget \"" << sID.getStr() << "\" needs to correspond to vcl type " << typeid(T).name());
+ assert(!w || dynamic_cast<T*>(w));
+ return static_cast<T*>(w);
+ }
+ //sID may not exist
+ PopupMenu* get_menu(OString sID);
+
+ OString get_by_window(const Window *pWindow) const;
+ void delete_by_window(const Window *pWindow);
+
+ //Convert _ gtk markup to ~ vcl markup
+ static OString convertMnemonicMarkup(const OString &rIn);
+
+ static OString extractCustomProperty(stringmap &rMap);
+
+private:
+ Window *insertObject(Window *pParent, const OString &rClass, const OString &rID,
+ stringmap &rProps, stringmap &rPangoAttributes,
+ stringmap &rAtkProps, std::vector<OString> &rItems);
+
+ Window *makeObject(Window *pParent, const OString &rClass, const OString &rID,
+ stringmap &rVec, const std::vector<OString> &rItems);
+
+ void connectNumericFormatterAdjustment(const OString &id, const OString &rAdjustment);
+ void connectTimeFormatterAdjustment(const OString &id, const OString &rAdjustment);
+ void connectDateFormatterAdjustment(const OString &id, const OString &rAdjustment);
+
+ bool extractGroup(const OString &id, stringmap &rVec);
+ bool extractModel(const OString &id, stringmap &rVec);
+ bool extractBuffer(const OString &id, stringmap &rVec);
+ bool extractScrollAdjustment(const OString &id, stringmap &rVec);
+ bool extractButtonImage(const OString &id, stringmap &rMap, bool bRadio);
+ bool extractStock(const OString &id, stringmap &rMap);
+ void extractMnemonicWidget(const OString &id, stringmap &rMap);
+
+ void handleTranslations(xmlreader::XmlReader &reader);
+
+ void handleChild(Window *pParent, xmlreader::XmlReader &reader);
+ Window* handleObject(Window *pParent, xmlreader::XmlReader &reader);
+ void handlePacking(Window *pCurrent, xmlreader::XmlReader &reader);
+ void applyPackingProperty(Window *pCurrent, xmlreader::XmlReader &reader);
+ void collectProperty(xmlreader::XmlReader &reader, const OString &rID, stringmap &rVec);
+ void collectPangoAttribute(xmlreader::XmlReader &reader, stringmap &rMap);
+ void collectAtkAttribute(xmlreader::XmlReader &reader, stringmap &rMap);
+ void collectAccelerator(xmlreader::XmlReader &reader, stringmap &rMap);
+
+ void insertMenuObject(PopupMenu *pParent, const OString &rClass, const OString &rID,
+ stringmap &rProps, stringmap &rAccels);
+ void handleMenuChild(PopupMenu *pParent, xmlreader::XmlReader &reader);
+ void handleMenuObject(PopupMenu *pParent, xmlreader::XmlReader &reader);
+
+ void handleListStore(xmlreader::XmlReader &reader, const OString &rID);
+ void handleRow(xmlreader::XmlReader &reader, const OString &rID, sal_Int32 nRowIndex);
+ void handleAdjustment(const OString &rID, stringmap &rProperties);
+ void handleTextBuffer(const OString &rID, stringmap &rProperties);
+ void handleTabChild(Window *pParent, xmlreader::XmlReader &reader);
+ void handleMenu(xmlreader::XmlReader &reader, const OString &rID);
+ std::vector<OString> handleItems(xmlreader::XmlReader &reader, const OString &rID);
+
+ void handleSizeGroup(xmlreader::XmlReader &reader, const OString &rID);
+
+ void handleAtkObject(xmlreader::XmlReader &reader, const OString &rID, Window *pWindow);
+
+ PackingData get_window_packing_data(const Window *pWindow) const;
+ void set_window_packing_position(const Window *pWindow, sal_Int32 nPosition);
+
+ Window* prepareWidgetOwnScrolling(Window *pParent, WinBits &rWinStyle);
+ void cleanupWidgetOwnScrolling(Window *pScrollParent, Window *pWindow, stringmap &rMap);
+
+ //Helpers to retrofit all the existing code to the builder
+ static void reorderWithinParent(Window &rWindow, sal_uInt16 nNewPosition);
+};
+
+
+//helper baseclass to ease retro fitting dialogs/tabpages that load a resource
+//to load a .ui file instead
+//
+//vcl requires the Window Children of a Parent Window to be destroyed before
+//the Parent Window. VclBuilderContainer owns the VclBuilder which owns the
+//Children Window. So the VclBuilderContainer dtor must be called before
+//the Parent Window dtor.
+//
+//i.e. class Dialog : public SystemWindow, public VclBuilderContainer
+//not class Dialog : public VclBuilderContainer, public SystemWindow
+
+class VCL_DLLPUBLIC VclBuilderContainer
+{
+protected:
+ VclBuilder *m_pUIBuilder;
+public:
+ VclBuilderContainer();
+ virtual ~VclBuilderContainer();
+ static OUString getUIRootDir();
+ template <typename T> T* get(T*& ret, OString sID)
+ {
+ return m_pUIBuilder->get<T>(ret, sID);
+ }
+ template <typename T /*=Window if we had c++11*/> T* get(OString sID)
+ {
+ return m_pUIBuilder->get<T>(sID);
+ }
+ PopupMenu* get_menu(PopupMenu*& ret, OString sID)
+ {
+ return m_pUIBuilder->get_menu(ret, sID);
+ }
+ PopupMenu* get_menu(OString sID)
+ {
+ return m_pUIBuilder->get_menu(sID);
+ }
+};
+
+/*
+ * @return true if rValue is "True", "true", "1", etc.
+ */
+bool VCL_DLLPUBLIC toBool(const OString &rValue);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
new file mode 100644
index 000000000000..8c116b0644dd
--- /dev/null
+++ b/include/vcl/button.hxx
@@ -0,0 +1,574 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_BUTTON_HXX
+#define _SV_BUTTON_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/image.hxx>
+#include <vcl/ctrl.hxx>
+#include <vcl/bitmap.hxx>
+#include <vcl/salnativewidgets.hxx>
+#include <rsc/rsc-vcl-shared-types.hxx>
+
+#include <vector>
+
+class UserDrawEvent;
+class ImplCommonButtonData;
+
+// ----------
+// - Button -
+// ----------
+
+class VCL_DLLPUBLIC Button : public Control
+{
+private:
+ ImplCommonButtonData *mpButtonData;
+ Link maClickHdl;
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE Button (const Button &);
+ SAL_DLLPRIVATE Button & operator= (const Button &);
+public:
+ SAL_DLLPRIVATE sal_uInt16 ImplGetButtonState() const;
+ SAL_DLLPRIVATE sal_uInt16& ImplGetButtonState();
+ SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( OUString& rText, WinBits nWinStyle, sal_uLong nDrawFlags );
+ SAL_DLLPRIVATE void ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos, Size& rSize,
+ sal_Bool bLayout, sal_uLong nImageSep, sal_uLong nDrawFlags,
+ sal_uInt16 nTextStyle, Rectangle *pSymbolRect=NULL, bool bAddImageSep = false );
+ SAL_DLLPRIVATE void ImplSetFocusRect( const Rectangle &rFocusRect );
+ SAL_DLLPRIVATE const Rectangle& ImplGetFocusRect() const;
+ SAL_DLLPRIVATE void ImplSetSymbolAlign( SymbolAlign eAlign );
+ /// The x-coordinate of the vertical separator line, use in MenuButton subclass only.
+ SAL_DLLPRIVATE long ImplGetSeparatorX() const;
+ SAL_DLLPRIVATE void ImplSetSeparatorX( long nX );
+
+protected:
+ Button( WindowType nType );
+
+public:
+ ~Button();
+
+ virtual void Click();
+
+ void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
+ const Link& GetClickHdl() const { return maClickHdl; }
+
+ static OUString GetStandardText( StandardButtonType eButton );
+ static XubString GetStandardHelpText( StandardButtonType eButton );
+
+ sal_Bool SetModeImage( const Image& rImage );
+ const Image GetModeImage( ) const;
+ sal_Bool HasImage() const;
+ void SetImageAlign( ImageAlign eAlign );
+ ImageAlign GetImageAlign() const;
+
+ void EnableImageDisplay( sal_Bool bEnable );
+ void EnableTextDisplay( sal_Bool bEnable );
+
+ void SetFocusRect( const Rectangle& rFocusRect );
+ bool IsSmallSymbol() const;
+ void SetSmallSymbol(bool bSmall = true);
+};
+
+// --------------------
+// - PushButton-Types -
+// --------------------
+
+#define PUSHBUTTON_DROPDOWN_TOOLBOX ((sal_uInt16)0x0001)
+#define PUSHBUTTON_DROPDOWN_MENUBUTTON ((sal_uInt16)0x0002)
+
+// --------------
+// - PushButton -
+// --------------
+
+class VCL_DLLPUBLIC PushButton : public Button
+{
+protected:
+ SymbolType meSymbol;
+ TriState meState;
+ TriState meSaveValue;
+ sal_uInt16 mnDDStyle;
+ sal_Bool mbPressed;
+ sal_Bool mbInUserDraw;
+ Link maToggleHdl;
+
+ SAL_DLLPRIVATE void ImplInitPushButtonData();
+ SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawFlags,
+ const Rectangle& rRect, bool bLayout, bool bMenuBtnSep );
+ SAL_DLLPRIVATE void ImplDrawPushButton( bool bLayout = false );
+ using Button::ImplGetTextStyle;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( sal_uLong nDrawFlags ) const;
+ SAL_DLLPRIVATE sal_Bool IsSymbol() const { return ( (meSymbol != SYMBOL_NOSYMBOL) && (meSymbol != SYMBOL_IMAGE) ); }
+ SAL_DLLPRIVATE sal_Bool IsImage() const { return Button::HasImage(); }
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE PushButton( const PushButton & );
+ SAL_DLLPRIVATE PushButton& operator=( const PushButton & );
+
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+public:
+ SAL_DLLPRIVATE void ImplSetDefButton( sal_Bool bSet );
+ SAL_DLLPRIVATE static void ImplDrawPushButtonFrame( Window* pDev, Rectangle& rRect, sal_uInt16 nStyle );
+ SAL_DLLPRIVATE static sal_Bool ImplHitTestPushButton( Window* pDev, const Point& rPos );
+ SAL_DLLPRIVATE sal_Bool ImplIsDefButton() const;
+
+protected:
+ PushButton( WindowType nType );
+
+ virtual void FillLayoutData() const;
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
+public:
+ PushButton( Window* pParent, WinBits nStyle = 0 );
+ PushButton( Window* pParent, const ResId& rResId );
+ ~PushButton();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void KeyUp( const KeyEvent& rKEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ virtual void Toggle();
+
+ void SetSymbol( SymbolType eSymbol );
+ SymbolType GetSymbol() const { return meSymbol; }
+ void SetSymbolAlign( SymbolAlign eAlign );
+
+ void SetDropDown( sal_uInt16 nStyle );
+ sal_uInt16 GetDropDown() const { return mnDDStyle; }
+
+ void SetState( TriState eState );
+ TriState GetState() const { return meState; }
+
+ void Check( sal_Bool bCheck = sal_True );
+ sal_Bool IsChecked() const;
+
+ void SetPressed( sal_Bool bPressed );
+ sal_Bool IsPressed() const { return mbPressed; }
+
+ void EndSelection();
+
+ void SaveValue() { meSaveValue = GetState(); }
+ TriState GetSavedValue() const { return meSaveValue; }
+
+ Size CalcMinimumSize( long nMaxWidth = 0 ) const;
+ virtual Size GetOptimalSize() const;
+
+ void SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
+ const Link& GetToggleHdl() const { return maToggleHdl; }
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+};
+
+inline void PushButton::Check( sal_Bool bCheck )
+{
+ SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK );
+}
+
+inline sal_Bool PushButton::IsChecked() const
+{
+ return (GetState() == STATE_CHECK);
+}
+
+// ------------
+// - OKButton -
+// ------------
+
+class VCL_DLLPUBLIC OKButton : public PushButton
+{
+protected:
+ using PushButton::ImplInit;
+private:
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE OKButton (const OKButton &);
+ SAL_DLLPRIVATE OKButton & operator= (const OKButton &);
+
+public:
+ OKButton( Window* pParent, WinBits nStyle = WB_DEFBUTTON );
+ OKButton( Window* pParent, const ResId& rResId );
+
+ virtual void Click();
+};
+
+// ----------------
+// - CancelButton -
+// ----------------
+
+class VCL_DLLPUBLIC CancelButton : public PushButton
+{
+protected:
+ using PushButton::ImplInit;
+private:
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE CancelButton (const CancelButton &);
+ SAL_DLLPRIVATE CancelButton & operator= (const CancelButton &);
+
+public:
+ CancelButton( Window* pParent, WinBits nStyle = 0 );
+ CancelButton( Window* pParent, const ResId& rResId );
+
+ virtual void Click();
+};
+
+class VCL_DLLPUBLIC CloseButton : public CancelButton
+{
+public:
+ CloseButton(Window* pParent, WinBits nStyle = 0);
+};
+
+
+// --------------
+// - HelpButton -
+// --------------
+
+class VCL_DLLPUBLIC HelpButton : public PushButton
+{
+protected:
+ using PushButton::ImplInit;
+private:
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE HelpButton( const HelpButton & );
+ SAL_DLLPRIVATE HelpButton & operator= ( const HelpButton & );
+
+public:
+ HelpButton( Window* pParent, WinBits nStyle = 0 );
+ HelpButton( Window* pParent, const ResId& rResId );
+
+ virtual void Click();
+};
+
+// ---------------
+// - RadioButton -
+// ---------------
+
+class VCL_DLLPUBLIC RadioButton : public Button
+{
+private:
+ boost::shared_ptr< std::vector<RadioButton*> > m_xGroup;
+ Rectangle maStateRect;
+ Rectangle maMouseRect;
+ Image maImage;
+ sal_Bool mbChecked;
+ sal_Bool mbSaveValue;
+ sal_Bool mbRadioCheck;
+ sal_Bool mbStateChanged;
+ Link maToggleHdl;
+ // when mbLegacyNoTextAlign is set then the old behaviour where
+ // the WB_LEFT, WB_RIGHT & WB_CENTER affect the image placement
+ // occurs, otherwise the image ( radiobutton circle ) is placed
+ // to the left or right ( depending on RTL or LTR settings )
+ bool mbLegacyNoTextAlign;
+ SAL_DLLPRIVATE void ImplInitRadioButtonData();
+ SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDrawRadioButtonState();
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ const Point& rPos, const Size& rSize,
+ const Size& rImageSize, Rectangle& rStateRect,
+ Rectangle& rMouseRect, bool bLayout = false );
+ SAL_DLLPRIVATE void ImplDrawRadioButton( bool bLayout = false );
+ SAL_DLLPRIVATE void ImplInvalidateOrDrawRadioButtonState();
+ SAL_DLLPRIVATE void ImplUncheckAllOther();
+ SAL_DLLPRIVATE Size ImplGetRadioImageSize() const;
+ SAL_DLLPRIVATE long ImplGetImageToTextDistance() const;
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE RadioButton(const RadioButton &);
+ SAL_DLLPRIVATE RadioButton& operator= (const RadioButton &);
+
+protected:
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+ SAL_DLLPRIVATE void ImplCallClick( sal_Bool bGrabFocus = sal_False, sal_uInt16 nFocusFlags = 0 );
+ SAL_DLLPRIVATE void ImplSetMinimumNWFSize();
+
+protected:
+ virtual void FillLayoutData() const;
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
+
+ inline void SetMouseRect( const Rectangle& _rMouseRect ) { maMouseRect = _rMouseRect; }
+ inline const Rectangle& GetMouseRect( ) const { return maMouseRect; }
+ inline void SetStateRect( const Rectangle& _rStateRect ) { maStateRect = _rStateRect; }
+ inline const Rectangle& GetStateRect( ) const { return maStateRect; }
+
+ // draws the radio button (the knob image), in it's current state (pressed/checked)
+ // at the usual location, which can be overridden with SetStateRect
+ void DrawRadioButtonState( );
+
+public:
+ RadioButton( Window* pParent, WinBits nWinStyle = 0 );
+ RadioButton( Window* pParent, const ResId& rResId );
+ ~RadioButton();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void KeyUp( const KeyEvent& rKEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ virtual void Toggle();
+
+ sal_Bool IsStateChanged() const { return mbStateChanged; }
+
+ void EnableRadioCheck( sal_Bool bRadioCheck = sal_True ) { mbRadioCheck = bRadioCheck; }
+ sal_Bool IsRadioCheckEnabled() const { return mbRadioCheck; }
+
+ sal_Bool SetModeRadioImage( const Image& rImage );
+ const Image& GetModeRadioImage( ) const;
+
+ void SetState( sal_Bool bCheck );
+ void Check( sal_Bool bCheck = sal_True );
+ sal_Bool IsChecked() const { return mbChecked; }
+
+ void SaveValue() { mbSaveValue = IsChecked(); }
+ sal_Bool GetSavedValue() const { return mbSaveValue; }
+
+ static Image GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlags );
+
+ Size CalcMinimumSize( long nMaxWidth = 0 ) const;
+ virtual Size GetOptimalSize() const;
+
+ void SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
+ const Link& GetToggleHdl() const { return maToggleHdl; }
+
+ /** GetRadioButtonGroup returns a list of pointers to <code>RadioButton</code>s in the same group.
+
+ The pointers in the returned list are valid at the time call returns. However rescheduling
+ or giving up the SolarMutex may mean events get executed that lead to the pointers getting
+ invalid.
+
+ @param bIncludeThis
+ defines whether <code>this</code> is contained in the returned list
+
+ @return
+ on return contains the <code>RadioButton</code>s
+ in the same group as this <code>RadioButton</code>.
+ */
+ std::vector<RadioButton*> GetRadioButtonGroup(bool bIncludeThis = true) const;
+
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+
+ /*
+ * Group this RadioButton with another
+ */
+ void group(RadioButton &rOther);
+};
+
+// ------------
+// - CheckBox -
+// ------------
+
+class VCL_DLLPUBLIC CheckBox : public Button
+{
+private:
+ Rectangle maStateRect;
+ Rectangle maMouseRect;
+ TriState meState;
+ TriState meSaveValue;
+ sal_Bool mbTriState;
+ Link maToggleHdl;
+ // when mbLegacyNoTextAlign is set then the old behaviour where
+ // the WB_LEFT, WB_RIGHT & WB_CENTER affect the image placement
+ // occurs, otherwise the image ( checkbox box ) is placed
+ // to the left or right ( depending on RTL or LTR settings )
+ bool mbLegacyNoTextAlign;
+ SAL_DLLPRIVATE void ImplInitCheckBoxData();
+ SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplInvalidateOrDrawCheckBoxState();
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ const Point& rPos, const Size& rSize,
+ const Size& rImageSize, Rectangle& rStateRect,
+ Rectangle& rMouseRect, bool bLayout );
+ SAL_DLLPRIVATE void ImplDrawCheckBox( bool bLayout = false );
+ SAL_DLLPRIVATE long ImplGetImageToTextDistance() const;
+ SAL_DLLPRIVATE Size ImplGetCheckImageSize() const;
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE CheckBox(const CheckBox &);
+ SAL_DLLPRIVATE CheckBox& operator= (const CheckBox &);
+
+protected:
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE virtual void FillLayoutData() const;
+ SAL_DLLPRIVATE virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ SAL_DLLPRIVATE virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
+
+ SAL_DLLPRIVATE virtual void ImplDrawCheckBoxState();
+ SAL_DLLPRIVATE const Rectangle& GetStateRect() const { return maStateRect; }
+ SAL_DLLPRIVATE const Rectangle& GetMouseRect() const { return maMouseRect; }
+
+public:
+ SAL_DLLPRIVATE void ImplCheck();
+ SAL_DLLPRIVATE void ImplSetMinimumNWFSize();
+public:
+ CheckBox( Window* pParent, WinBits nStyle = 0 );
+ CheckBox( Window* pParent, const ResId& rResId );
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void KeyUp( const KeyEvent& rKEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ virtual void Toggle();
+
+ void SetState( TriState eState );
+ TriState GetState() const { return meState; }
+
+ void Check( sal_Bool bCheck = sal_True );
+ sal_Bool IsChecked() const;
+
+ void EnableTriState( sal_Bool bTriState = sal_True );
+ sal_Bool IsTriStateEnabled() const { return mbTriState; }
+
+ void SaveValue() { meSaveValue = GetState(); }
+ TriState GetSavedValue() const { return meSaveValue; }
+
+ static Image GetCheckImage( const AllSettings& rSettings, sal_uInt16 nFlags );
+
+ Size CalcMinimumSize( long nMaxWidth = 0 ) const;
+ virtual Size GetOptimalSize() const;
+
+ void SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
+ const Link& GetToggleHdl() const { return maToggleHdl; }
+ bool IsLegacyNoTextAlign() { return mbLegacyNoTextAlign; }
+ void SetLegacyNoTextAlign( bool bVal ) { mbLegacyNoTextAlign = bVal; }
+
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+};
+
+inline void CheckBox::Check( sal_Bool bCheck )
+{
+ SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK );
+}
+
+inline sal_Bool CheckBox::IsChecked() const
+{
+ return (GetState() == STATE_CHECK);
+}
+
+// ---------------------------------
+// - Control-Layer fuer alten Code -
+// ---------------------------------
+
+class VCL_DLLPUBLIC ImageButton : public PushButton
+{
+protected:
+ using PushButton::ImplInitStyle;
+private:
+ SAL_DLLPRIVATE void ImplInitStyle();
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE ImageButton( const ImageButton & );
+ SAL_DLLPRIVATE ImageButton & operator= ( const ImageButton & );
+
+public:
+ ImageButton( Window* pParent, WinBits nStyle = 0 );
+ ImageButton( Window* pParent, const ResId& rResId );
+ ~ImageButton();
+};
+
+class VCL_DLLPUBLIC ImageRadioButton : public RadioButton
+{
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE ImageRadioButton( const ImageRadioButton & );
+ SAL_DLLPRIVATE ImageRadioButton & operator= ( const ImageRadioButton & );
+
+public:
+ ImageRadioButton( Window* pParent, WinBits nStyle = 0 );
+ ImageRadioButton( Window* pParent, const ResId& rResId );
+ ~ImageRadioButton();
+};
+
+class VCL_DLLPUBLIC TriStateBox : public CheckBox
+{
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE TriStateBox( const TriStateBox & );
+ SAL_DLLPRIVATE TriStateBox & operator= ( const TriStateBox & );
+
+public:
+ TriStateBox( Window* pParent, WinBits nStyle = 0 );
+ TriStateBox( Window* pParent, const ResId& rResId );
+ ~TriStateBox();
+};
+
+class VCL_DLLPUBLIC DisclosureButton : public CheckBox
+{
+protected:
+ SAL_DLLPRIVATE virtual void ImplDrawCheckBoxState();
+public:
+ DisclosureButton( Window* pParent, WinBits nStyle = 0 );
+ DisclosureButton( Window* pParent, const ResId& rResId );
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+};
+
+#endif // _SV_BUTTON_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/canvastools.hxx b/include/vcl/canvastools.hxx
new file mode 100644
index 000000000000..d4c2246e2544
--- /dev/null
+++ b/include/vcl/canvastools.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 _VCL_CANVASTOOLS_HXX
+#define _VCL_CANVASTOOLS_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/rendering/XColorSpace.hpp>
+#include <basegfx/numeric/ftools.hxx>
+
+#include <vcl/dllapi.h>
+
+class Point;
+class Size;
+class Rectangle;
+class Polygon;
+class PolyPolygon;
+class Bitmap;
+class BitmapEx;
+class Color;
+
+namespace basegfx
+{
+ class B2DVector;
+ class B2DPoint;
+ class B2DRange;
+ class B2IVector;
+ class B2IPoint;
+ class B2IRange;
+ class B2DPolygon;
+ class B2DPolyPolygon;
+}
+
+namespace com { namespace sun { namespace star { namespace geometry
+{
+ struct RealPoint2D;
+ struct RealSize2D;
+ struct RealRectangle2D;
+ struct IntegerPoint2D;
+ struct IntegerSize2D;
+ struct IntegerRectangle2D;
+ struct RealBezierSegment2D;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace rendering
+{
+ class XGraphicDevice;
+ class XBitmap;
+ class XIntegerBitmap;
+ class XIntegerReadOnlyBitmap;
+ class XPolyPolygon2D;
+} } } }
+
+namespace vcl
+{
+ namespace unotools
+ {
+ // Bitmap conversions
+ // ===================================================================
+
+ /** Create an XBitmap from VCL BitmapEx
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >
+ VCL_DLLPUBLIC xBitmapFromBitmapEx( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice,
+ const ::BitmapEx& inputBitmap );
+
+ /** Create a BitmapEx from an XBitmap
+ */
+ ::BitmapEx VCL_DLLPUBLIC bitmapExFromXBitmap( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XIntegerReadOnlyBitmap >& xInputBitmap );
+
+ // Color conversions (vcl/tools Color <-> canvas standard color space)
+ // ===================================================================
+
+ /** Convert color to device color sequence
+
+ @param rColor
+ Color to convert
+
+ @param xColorSpace
+ Color space to convert into
+ */
+ ::com::sun::star::uno::Sequence< double >
+ VCL_DLLPUBLIC colorToDoubleSequence( const Color& rColor,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XColorSpace >& xColorSpace );
+
+ /** Convert from standard device color space to VCL/Tools color
+
+ Note that this method assumes a color space equivalent to
+ the one returned from createStandardColorSpace()
+ */
+ Color VCL_DLLPUBLIC stdColorSpaceSequenceToColor(
+ const ::com::sun::star::uno::Sequence< double >& rColor );
+
+ /** Convert color to device color sequence
+
+ @param rColor
+ Color sequence to convert from
+
+ @param xColorSpace
+ Color space to convert from
+ */
+ Color VCL_DLLPUBLIC doubleSequenceToColor( const ::com::sun::star::uno::Sequence< double > rColor,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XColorSpace >& xColorSpace );
+
+ /// Convert [0,1] double value to [0,255] int
+ inline sal_Int8 toByteColor( double val )
+ {
+ return sal::static_int_cast<sal_Int8>(
+ basegfx::fround(val*255.0));
+ }
+
+ /// Convert [0,255] int value to [0,1] double value
+ inline double toDoubleColor( sal_uInt8 val )
+ {
+ return val / 255.0;
+ }
+
+ /// Create a standard color space suitable for VCL RGB color
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XColorSpace> VCL_DLLPUBLIC createStandardColorSpace();
+
+ // Geometry conversions (vcl/tools <-> x)
+ // ===================================================================
+
+ // geometry::Real
+ ::com::sun::star::geometry::RealSize2D VCL_DLLPUBLIC size2DFromSize( const Size& );
+
+ Size VCL_DLLPUBLIC sizeFromRealSize2D( const ::com::sun::star::geometry::RealSize2D& );
+
+ // geometry::Integer
+ ::com::sun::star::geometry::IntegerSize2D VCL_DLLPUBLIC integerSize2DFromSize( const Size& );
+
+ Size VCL_DLLPUBLIC sizeFromIntegerSize2D( const ::com::sun::star::geometry::IntegerSize2D& );
+ Point VCL_DLLPUBLIC pointFromIntegerPoint2D( const ::com::sun::star::geometry::IntegerPoint2D& );
+ Rectangle VCL_DLLPUBLIC rectangleFromIntegerRectangle2D( const ::com::sun::star::geometry::IntegerRectangle2D& );
+
+ // basegfx::B2D
+ Size VCL_DLLPUBLIC sizeFromB2DSize( const ::basegfx::B2DVector& );
+ Point VCL_DLLPUBLIC pointFromB2DPoint( const ::basegfx::B2DPoint& );
+ Rectangle VCL_DLLPUBLIC rectangleFromB2DRectangle( const ::basegfx::B2DRange& );
+
+ basegfx::B2DVector VCL_DLLPUBLIC b2DSizeFromSize( const Size& );
+ basegfx::B2DPoint VCL_DLLPUBLIC b2DPointFromPoint( const Point& );
+ basegfx::B2DRange VCL_DLLPUBLIC b2DRectangleFromRectangle( const Rectangle& );
+
+ // basegfx::B2I
+ Point VCL_DLLPUBLIC pointFromB2IPoint( const ::basegfx::B2IPoint& );
+ Rectangle VCL_DLLPUBLIC rectangleFromB2IRectangle( const ::basegfx::B2IRange& );
+ }
+}
+
+#endif /* _VCL_CANVASTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/cmdevt.hxx b/include/vcl/cmdevt.hxx
new file mode 100644
index 000000000000..03876e52e5a3
--- /dev/null
+++ b/include/vcl/cmdevt.hxx
@@ -0,0 +1,466 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _VCL_CMDEVT_HXX
+#define _VCL_CMDEVT_HXX
+
+#include <tools/gen.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/keycod.hxx>
+#include <vcl/font.hxx>
+
+// ---------------------------
+// - CommandExtTextInputData -
+// ---------------------------
+
+#define EXTTEXTINPUT_ATTR_GRAYWAVELINE ((sal_uInt16)0x0100)
+#define EXTTEXTINPUT_ATTR_UNDERLINE ((sal_uInt16)0x0200)
+#define EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((sal_uInt16)0x0400)
+#define EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((sal_uInt16)0x0800)
+#define EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((sal_uInt16)0x1000)
+#define EXTTEXTINPUT_ATTR_HIGHLIGHT ((sal_uInt16)0x2000)
+#define EXTTEXTINPUT_ATTR_REDTEXT ((sal_uInt16)0x4000)
+#define EXTTEXTINPUT_ATTR_HALFTONETEXT ((sal_uInt16)0x8000)
+
+#define EXTTEXTINPUT_CURSOR_INVISIBLE ((sal_uInt16)0x0001)
+#define EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002)
+
+class VCL_DLLPUBLIC CommandExtTextInputData
+{
+private:
+ XubString maText;
+ sal_uInt16* mpTextAttr;
+ xub_StrLen mnCursorPos;
+ xub_StrLen mnDeltaStart;
+ xub_StrLen mnOldTextLen;
+ sal_uInt16 mnCursorFlags;
+ sal_Bool mbOnlyCursor;
+
+public:
+ CommandExtTextInputData( const XubString& rText,
+ const sal_uInt16* pTextAttr,
+ xub_StrLen nCursorPos,
+ sal_uInt16 nCursorFlags,
+ xub_StrLen nDeltaStart,
+ xub_StrLen nOldTextLen,
+ sal_Bool bOnlyCursor );
+ CommandExtTextInputData( const CommandExtTextInputData& rData );
+ ~CommandExtTextInputData();
+
+ const XubString& GetText() const { return maText; }
+ const sal_uInt16* GetTextAttr() const { return mpTextAttr; }
+ sal_uInt16 GetCharTextAttr( sal_uInt16 nIndex ) const;
+ xub_StrLen GetCursorPos() const { return mnCursorPos; }
+ sal_Bool IsCursorVisible() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_INVISIBLE) == 0; }
+ sal_Bool IsCursorOverwrite() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_OVERWRITE) != 0; }
+ sal_uInt16 GetCursorFlags() const { return mnCursorFlags; }
+ xub_StrLen GetDeltaStart() const { return mnDeltaStart; }
+ xub_StrLen GetOldTextLen() const { return mnOldTextLen; }
+ sal_Bool IsOnlyCursorChanged() const { return mbOnlyCursor; }
+};
+
+inline sal_uInt16 CommandExtTextInputData::GetCharTextAttr( sal_uInt16 nIndex ) const
+{
+ if ( mpTextAttr && (nIndex < maText.Len()) )
+ return mpTextAttr[nIndex];
+ else
+ return 0;
+}
+
+// ---------------------------
+// - CommandInputContextData -
+// ---------------------------
+
+class VCL_DLLPUBLIC CommandInputContextData
+{
+private:
+ LanguageType meLanguage;
+
+public:
+ CommandInputContextData();
+ CommandInputContextData( LanguageType eLang );
+
+ LanguageType GetLanguage() const { return meLanguage; }
+};
+
+inline CommandInputContextData::CommandInputContextData()
+{
+ meLanguage = LANGUAGE_DONTKNOW;
+}
+
+inline CommandInputContextData::CommandInputContextData( LanguageType eLang )
+{
+ meLanguage = eLang;
+}
+
+// --------------------
+// - CommandWheelData -
+// --------------------
+
+#define COMMAND_WHEEL_SCROLL ((sal_uInt16)0x0001)
+#define COMMAND_WHEEL_ZOOM ((sal_uInt16)0x0002)
+#define COMMAND_WHEEL_ZOOM_SCALE ((sal_uInt16)0x0003)
+#define COMMAND_WHEEL_DATAZOOM ((sal_uInt16)0x0004)
+
+#define COMMAND_WHEEL_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
+
+class VCL_DLLPUBLIC CommandWheelData
+{
+private:
+ long mnDelta;
+ long mnNotchDelta;
+ sal_uLong mnLines;
+ sal_uInt16 mnMode;
+ sal_uInt16 mnCode;
+ sal_Bool mbHorz;
+ sal_Bool mbDeltaIsPixel;
+
+public:
+ CommandWheelData();
+ CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
+ sal_uLong nScrollLines,
+ sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
+ sal_Bool bHorz = sal_False, sal_Bool bDeltaIsPixel = sal_False );
+
+ long GetDelta() const { return mnDelta; }
+ long GetNotchDelta() const { return mnNotchDelta; }
+ sal_uLong GetScrollLines() const { return mnLines; }
+ sal_Bool IsHorz() const { return mbHorz; }
+ sal_Bool IsDeltaPixel() const { return mbDeltaIsPixel; }
+
+ sal_uInt16 GetMode() const { return mnMode; }
+
+ sal_uInt16 GetModifier() const
+ { return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
+ bool IsShift() const
+ { return ((mnCode & KEY_SHIFT) != 0); }
+ sal_Bool IsMod1() const
+ { return ((mnCode & KEY_MOD1) != 0); }
+ sal_Bool IsMod2() const
+ { return ((mnCode & KEY_MOD2) != 0); }
+ sal_Bool IsMod3() const
+ { return ((mnCode & KEY_MOD3) != 0); }
+};
+
+inline CommandWheelData::CommandWheelData()
+{
+ mnDelta = 0;
+ mnNotchDelta = 0;
+ mnLines = 0;
+ mnMode = 0;
+ mnCode = 0;
+ mbHorz = sal_False;
+ mbDeltaIsPixel = sal_False;
+}
+
+inline CommandWheelData::CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
+ sal_uLong nScrollLines,
+ sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
+ sal_Bool bHorz, sal_Bool bDeltaIsPixel )
+{
+ mnDelta = nWheelDelta;
+ mnNotchDelta = nWheelNotchDelta;
+ mnLines = nScrollLines;
+ mnMode = nWheelMode;
+ mnCode = nKeyModifier;
+ mbHorz = bHorz;
+ mbDeltaIsPixel = bDeltaIsPixel;
+}
+
+// ---------------------
+// - CommandScrollData -
+// ---------------------
+
+class VCL_DLLPUBLIC CommandScrollData
+{
+private:
+ long mnDeltaX;
+ long mnDeltaY;
+
+public:
+ CommandScrollData();
+ CommandScrollData( long nDeltaX, long nDeltaY );
+
+ long GetDeltaX() const { return mnDeltaX; }
+ long GetDeltaY() const { return mnDeltaY; }
+};
+
+inline CommandScrollData::CommandScrollData()
+{
+ mnDeltaX = 0;
+ mnDeltaY = 0;
+}
+
+inline CommandScrollData::CommandScrollData( long nDeltaX, long nDeltaY )
+{
+ mnDeltaX = nDeltaX;
+ mnDeltaY = nDeltaY;
+}
+
+// ---------------------
+// - CommandModKeyData -
+// ---------------------
+
+class VCL_DLLPUBLIC CommandModKeyData
+{
+private:
+ sal_uInt16 mnCode;
+
+public:
+ CommandModKeyData();
+ CommandModKeyData( sal_uInt16 nCode );
+
+ bool IsShift() const { return (mnCode & MODKEY_SHIFT) ? true : false; }
+ sal_Bool IsMod1() const { return (mnCode & MODKEY_MOD1) ? sal_True : sal_False; }
+ sal_Bool IsMod2() const { return (mnCode & MODKEY_MOD2) ? sal_True : sal_False; }
+ sal_Bool IsMod3() const { return (mnCode & MODKEY_MOD3) ? sal_True : sal_False; }
+
+ sal_Bool IsLeftShift() const { return (mnCode & MODKEY_LSHIFT) ? sal_True : sal_False; }
+ sal_Bool IsLeftMod1() const { return (mnCode & MODKEY_LMOD1) ? sal_True : sal_False; }
+ sal_Bool IsLeftMod2() const { return (mnCode & MODKEY_LMOD2) ? sal_True : sal_False; }
+ sal_Bool IsLeftMod3() const { return (mnCode & MODKEY_LMOD3) ? sal_True : sal_False; }
+
+ sal_Bool IsRightShift() const { return (mnCode & MODKEY_RSHIFT) ? sal_True : sal_False; }
+ sal_Bool IsRightMod1() const { return (mnCode & MODKEY_RMOD1) ? sal_True : sal_False; }
+ sal_Bool IsRightMod2() const { return (mnCode & MODKEY_RMOD2) ? sal_True : sal_False; }
+ sal_Bool IsRightMod3() const { return (mnCode & MODKEY_RMOD3) ? sal_True : sal_False; }
+};
+
+inline CommandModKeyData::CommandModKeyData()
+{
+ mnCode = 0L;
+}
+
+inline CommandModKeyData::CommandModKeyData( sal_uInt16 nCode )
+{
+ mnCode = nCode;
+}
+
+// --------------------
+// - CommanDialogData -
+// --------------------
+
+#define SHOWDIALOG_ID_PREFERENCES 1
+#define SHOWDIALOG_ID_ABOUT 2
+
+class VCL_DLLPUBLIC CommandDialogData
+{
+ int m_nDialogId;
+ public:
+ CommandDialogData( int nDialogId = SHOWDIALOG_ID_PREFERENCES )
+ : m_nDialogId( nDialogId )
+ {}
+
+ int GetDialogId() const { return m_nDialogId; }
+};
+
+// --------------
+// Media Commands
+// --------------
+
+#define MEDIA_COMMAND_CHANNEL_DOWN ((sal_Int16)1) // Decrement the channel value, for example, for a TV or radio tuner.
+#define MEDIA_COMMAND_CHANNEL_UP ((sal_Int16)2) // Increment the channel value, for example, for a TV or radio tuner.
+#define MEDIA_COMMAND_NEXTTRACK ((sal_Int16)3) // Go to next media track/slide.
+#define MEDIA_COMMAND_PAUSE ((sal_Int16)4) // Pause. If already paused, take no further action. This is a direct PAUSE command that has no state.
+#define MEDIA_COMMAND_PLAY ((sal_Int16)5) // Begin playing at the current position. If already paused, it will resume. This is a direct PLAY command that has no state.
+#define MEDIA_COMMAND_PLAY_PAUSE ((sal_Int16)6) // Play or pause playback.
+#define MEDIA_COMMAND_PREVIOUSTRACK ((sal_Int16)7) // Go to previous media track/slide.
+#define MEDIA_COMMAND_RECORD ((sal_Int16)8) // Begin recording the current stream.
+#define MEDIA_COMMAND_REWIND ((sal_Int16)9)// Go backward in a stream at a higher rate of speed.
+#define MEDIA_COMMAND_STOP ((sal_Int16)10)// Stop playback.
+#define MEDIA_COMMAND_MIC_ON_OFF_TOGGLE ((sal_Int16)11)// Toggle the microphone.
+#define MEDIA_COMMAND_MICROPHONE_VOLUME_DOWN ((sal_Int16)12)// Increase microphone volume.
+#define MEDIA_COMMAND_MICROPHONE_VOLUME_MUTE ((sal_Int16)13)// Mute the microphone.
+#define MEDIA_COMMAND_MICROPHONE_VOLUME_UP ((sal_Int16)14)// Decrease microphone volume.
+#define MEDIA_COMMAND_VOLUME_DOWN ((sal_Int16)15)// Lower the volume.
+#define MEDIA_COMMAND_VOLUME_MUTE ((sal_Int16)16)// Mute the volume.
+#define MEDIA_COMMAND_VOLUME_UP ((sal_Int16)17)// Raise the volume.
+#define MEDIA_COMMAND_MENU ((sal_Int16)18)// Button Menu pressed.
+#define MEDIA_COMMAND_MENU_HOLD ((sal_Int16)19)// Button Menu (long) pressed.
+#define MEDIA_COMMAND_PLAY_HOLD ((sal_Int16)20)// Button Play (long) pressed.
+#define MEDIA_COMMAND_NEXTTRACK_HOLD ((sal_Int16)21)// Button Right holding pressed.
+#define MEDIA_COMMAND_PREVIOUSTRACK_HOLD ((sal_Int16)22)// Button Left holding pressed.
+
+
+// ------------------------------
+// - CommandSelectionChangeData -
+// ------------------------------
+
+class VCL_DLLPUBLIC CommandSelectionChangeData
+{
+private:
+ sal_uLong mnStart;
+ sal_uLong mnEnd;
+
+public:
+ CommandSelectionChangeData();
+ CommandSelectionChangeData( sal_uLong nStart, sal_uLong nEnd );
+
+ sal_uLong GetStart() const { return mnStart; }
+ sal_uLong GetEnd() const { return mnEnd; }
+};
+
+inline CommandSelectionChangeData::CommandSelectionChangeData()
+{
+ mnStart = mnEnd = 0;
+}
+
+inline CommandSelectionChangeData::CommandSelectionChangeData( sal_uLong nStart,
+ sal_uLong nEnd )
+{
+ mnStart = nStart;
+ mnEnd = nEnd;
+}
+
+// ----------------
+// - CommandEvent -
+// ----------------
+
+#define COMMAND_CONTEXTMENU ((sal_uInt16)1)
+#define COMMAND_STARTDRAG ((sal_uInt16)2)
+#define COMMAND_WHEEL ((sal_uInt16)3)
+#define COMMAND_STARTAUTOSCROLL ((sal_uInt16)4)
+#define COMMAND_AUTOSCROLL ((sal_uInt16)5)
+#define COMMAND_STARTEXTTEXTINPUT ((sal_uInt16)7)
+#define COMMAND_EXTTEXTINPUT ((sal_uInt16)8)
+#define COMMAND_ENDEXTTEXTINPUT ((sal_uInt16)9)
+#define COMMAND_INPUTCONTEXTCHANGE ((sal_uInt16)10)
+#define COMMAND_CURSORPOS ((sal_uInt16)11)
+#define COMMAND_PASTESELECTION ((sal_uInt16)12)
+#define COMMAND_MODKEYCHANGE ((sal_uInt16)13)
+#define COMMAND_HANGUL_HANJA_CONVERSION ((sal_uInt16)14)
+#define COMMAND_INPUTLANGUAGECHANGE ((sal_uInt16)15)
+#define COMMAND_SHOWDIALOG ((sal_uInt16)16)
+#define COMMAND_MEDIA ((sal_uInt16)17)
+#define COMMAND_SELECTIONCHANGE ((sal_uInt16)18)
+#define COMMAND_PREPARERECONVERSION ((sal_uInt16)19)
+
+class VCL_DLLPUBLIC CommandEvent
+{
+private:
+ Point maPos;
+ void* mpData;
+ sal_uInt16 mnCommand;
+ sal_Bool mbMouseEvent;
+
+public:
+ CommandEvent();
+ CommandEvent( const Point& rMousePos, sal_uInt16 nCmd,
+ sal_Bool bMEvt = sal_False, const void* pCmdData = NULL );
+
+ sal_uInt16 GetCommand() const { return mnCommand; }
+ const Point& GetMousePosPixel() const { return maPos; }
+ sal_Bool IsMouseEvent() const { return mbMouseEvent; }
+ void* GetData() const { return mpData; }
+
+ const CommandExtTextInputData* GetExtTextInputData() const;
+ const CommandInputContextData* GetInputContextChangeData() const;
+ const CommandWheelData* GetWheelData() const;
+ const CommandScrollData* GetAutoScrollData() const;
+ const CommandModKeyData* GetModKeyData() const;
+ const CommandDialogData* GetDialogData() const;
+ sal_Int16 GetMediaCommand() const;
+ const CommandSelectionChangeData* GetSelectionChangeData() const;
+};
+
+inline CommandEvent::CommandEvent()
+{
+ mpData = NULL;
+ mnCommand = 0;
+ mbMouseEvent = sal_False;
+}
+
+inline CommandEvent::CommandEvent( const Point& rMousePos,
+ sal_uInt16 nCmd, sal_Bool bMEvt, const void* pCmdData ) :
+ maPos( rMousePos )
+{
+ mpData = (void*)pCmdData;
+ mnCommand = nCmd;
+ mbMouseEvent = bMEvt;
+}
+
+inline const CommandExtTextInputData* CommandEvent::GetExtTextInputData() const
+{
+ if ( mnCommand == COMMAND_EXTTEXTINPUT )
+ return (const CommandExtTextInputData*)mpData;
+ else
+ return NULL;
+}
+
+inline const CommandInputContextData* CommandEvent::GetInputContextChangeData() const
+{
+ if ( mnCommand == COMMAND_INPUTCONTEXTCHANGE )
+ return (const CommandInputContextData*)mpData;
+ else
+ return NULL;
+}
+
+inline const CommandWheelData* CommandEvent::GetWheelData() const
+{
+ if ( mnCommand == COMMAND_WHEEL )
+ return (const CommandWheelData*)mpData;
+ else
+ return NULL;
+}
+
+inline const CommandScrollData* CommandEvent::GetAutoScrollData() const
+{
+ if ( mnCommand == COMMAND_AUTOSCROLL )
+ return (const CommandScrollData*)mpData;
+ else
+ return NULL;
+}
+
+inline const CommandModKeyData* CommandEvent::GetModKeyData() const
+{
+ if( mnCommand == COMMAND_MODKEYCHANGE )
+ return (const CommandModKeyData*)mpData;
+ else
+ return NULL;
+}
+
+inline const CommandDialogData* CommandEvent::GetDialogData() const
+{
+ if( mnCommand == COMMAND_SHOWDIALOG )
+ return (const CommandDialogData*)mpData;
+ else
+ return NULL;
+}
+
+inline sal_Int16 CommandEvent::GetMediaCommand() const
+{
+ if( mnCommand == COMMAND_MEDIA )
+ return *(const sal_Int16*)(mpData);
+ else
+ return 0;
+}
+
+inline const CommandSelectionChangeData* CommandEvent::GetSelectionChangeData() const
+{
+ if( mnCommand == COMMAND_SELECTIONCHANGE )
+ return (const CommandSelectionChangeData*)mpData;
+ else
+ return NULL;
+}
+
+
+#endif // _VCL_CMDEVT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/combobox.h b/include/vcl/combobox.h
new file mode 100644
index 000000000000..4cb8c964ee2e
--- /dev/null
+++ b/include/vcl/combobox.h
@@ -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 _SV_COMBOBOX_H
+#define _SV_COMBOBOX_H
+
+#include <vcl/lstbox.h>
+
+#define COMBOBOX_APPEND ((sal_uInt16)0xFFFF)
+#define COMBOBOX_ENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
+#define COMBOBOX_ERROR ((sal_uInt16)0xFFFF)
+
+#endif // _SV_COMBOBOX_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
new file mode 100644
index 000000000000..f0637109716a
--- /dev/null
+++ b/include/vcl/combobox.hxx
@@ -0,0 +1,227 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_COMBOBOX_HXX
+#define _SV_COMBOBOX_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/ctrl.hxx>
+#include <vcl/combobox.h>
+#include <vcl/edit.hxx>
+
+class UserDrawEvent;
+
+class ImplListBoxFloatingWindow;
+class ImplListBox;
+class ImplBtn;
+
+// ------------
+// - ComboBox -
+// ------------
+
+class VCL_DLLPUBLIC ComboBox : public Edit
+{
+private:
+ Edit* mpSubEdit;
+ ImplListBox* mpImplLB;
+ ImplBtn* mpBtn;
+ ImplListBoxFloatingWindow* mpFloatWin;
+ sal_uInt16 mnDDHeight;
+ sal_Unicode mcMultiSep;
+ sal_Bool mbDDAutoSize : 1;
+ sal_Bool mbSyntheticModify : 1;
+ sal_Bool mbMatchCase : 1;
+ sal_Int32 m_nMaxWidthChars;
+ Link maSelectHdl;
+ Link maDoubleClickHdl;
+
+ struct ComboBoxBounds
+ {
+ Point aSubEditPos;
+ Size aSubEditSize;
+
+ Point aButtonPos;
+ Size aButtonSize;
+ };
+
+private:
+ SAL_DLLPRIVATE void ImplInitComboBoxData();
+ SAL_DLLPRIVATE void ImplUpdateFloatSelection();
+ SAL_DLLPRIVATE ComboBoxBounds calcComboBoxDropDownComponentBounds(
+ const Size &rOutSize, const Size &rBorderOutSize) const;
+
+ DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplCancelHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplDoubleClickHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplClickBtnHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplPopupModeEndHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplSelectionChangedHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplUserDrawHdl, UserDrawEvent* );
+ DECL_DLLPRIVATE_LINK( ImplAutocompleteHdl, Edit* );
+
+protected:
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE void ImplCalcEditHeight();
+ SAL_DLLPRIVATE long getMaxWidthScrollBarAndDownButton() const;
+
+protected:
+ ComboBox( WindowType nType );
+ sal_Bool IsDropDownBox() const { return mpFloatWin ? sal_True : sal_False; }
+
+ virtual void FillLayoutData() const;
+public:
+ ComboBox( Window* pParent, WinBits nStyle = 0 );
+ ComboBox( Window* pParent, const ResId& rResId );
+ ~ComboBox();
+
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+ virtual void Select();
+ virtual void DoubleClick();
+
+ virtual void Modify();
+
+ virtual const Wallpaper& GetDisplayBackground() const;
+
+ virtual void setPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+ void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
+ { Edit::SetPosSizePixel( rNewPos, rNewSize ); }
+ void SetDropDownSizePixel( const Size& rNewSize )
+ { if( IsDropDownBox() ) setPosSizePixel( 0, 0, rNewSize.Width(), rNewSize.Height(), WINDOW_POSSIZE_SIZE | WINDOW_POSSIZE_DROPDOWN ); }
+
+ Rectangle GetDropDownPosSizePixel() const;
+
+ void SetDropDownLineCount( sal_uInt16 nLines );
+ sal_uInt16 GetDropDownLineCount() const;
+
+ void EnableAutoSize( sal_Bool bAuto );
+ sal_Bool IsAutoSizeEnabled() const { return mbDDAutoSize; }
+
+ void EnableDDAutoWidth( sal_Bool b );
+
+ virtual void SetText( const OUString& rStr );
+ virtual void SetText( const OUString& rStr, const Selection& rNewSelection );
+
+ sal_uInt16 InsertEntry( const OUString& rStr, sal_uInt16 nPos = COMBOBOX_APPEND );
+ sal_uInt16 InsertEntry( const OUString& rStr, const Image& rImage, sal_uInt16 nPos = COMBOBOX_APPEND );
+
+ void RemoveEntry( const OUString& rStr );
+ void RemoveEntry( sal_uInt16 nPos );
+
+ void Clear();
+
+ sal_uInt16 GetEntryPos( const OUString& rStr ) const;
+ Image GetEntryImage( sal_uInt16 nPos ) const;
+ OUString GetEntry( sal_uInt16 nPos ) const;
+ sal_uInt16 GetEntryCount() const;
+
+ sal_Bool IsTravelSelect() const;
+ sal_Bool IsInDropDown() const;
+ void ToggleDropDown();
+
+ long CalcWindowSizePixel( sal_uInt16 nLines ) const;
+
+ void SetUserItemSize( const Size& rSz );
+ void EnableUserDraw( sal_Bool bUserDraw );
+
+ void DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False );
+ void SetBorderStyle( sal_uInt16 nBorderStyle );
+
+ void SetSeparatorPos( sal_uInt16 n = LISTBOX_ENTRY_NOTFOUND );
+
+ void EnableAutocomplete( sal_Bool bEnable, sal_Bool bMatchCase = sal_False );
+ sal_Bool IsAutocompleteEnabled() const;
+
+ void EnableMultiSelection( sal_Bool bMulti );
+ sal_Bool IsMultiSelectionEnabled() const;
+ void SetMultiSelectionSeparator( sal_Unicode cSep ) { mcMultiSep = cSep; }
+ sal_Unicode GetMultiSelectionSeparator() const { return mcMultiSep; }
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+
+ Size CalcMinimumSize() const;
+ virtual Size GetOptimalSize() const;
+ Size CalcAdjustedSize( const Size& rPrefSize ) const;
+ using Edit::CalcSize;
+ Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
+ void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
+
+ void SetMRUEntries( const OUString& rEntries, sal_Unicode cSep = ';' );
+ OUString GetMRUEntries( sal_Unicode cSep = ';' ) const;
+ void SetMaxMRUCount( sal_uInt16 n );
+ sal_uInt16 GetMaxMRUCount() const;
+
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
+
+ sal_uInt16 GetTopEntry() const;
+
+ void SetProminentEntryType( ProminentEntry eType );
+
+ sal_uInt16 GetDisplayLineCount() const;
+
+ sal_uInt16 GetSelectEntryCount() const;
+ sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex = 0 ) const;
+ sal_Bool IsEntryPosSelected( sal_uInt16 nPos ) const;
+ void SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect = sal_True );
+ void SetNoSelection();
+ Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const;
+
+ /** checks whether a certain point lies within the bounds of
+ a list item and returns the item as well as the character position
+ the point is at.
+
+ <p>If the point is inside an item the item pos is put into <code>rPos</code> and
+ the item-relative character index is returned. If the point is not inside
+ an item -1 is returned and rPos is unchanged.</p>
+
+ @param rPoint
+ tells the point for which an item is requested.
+
+ @param rPos
+ gets the item at the specified point <code>rPoint</code>
+
+ @returns
+ the item-relative character index at point <code>rPos</code> or -1
+ if no item is at that point.
+ */
+ using Control::GetIndexForPoint;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const;
+
+ sal_Int32 getMaxWidthChars() const { return m_nMaxWidthChars; }
+ void setMaxWidthChars(sal_Int32 nWidth);
+
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+};
+
+#endif // _COMBOBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/configsettings.hxx b/include/vcl/configsettings.hxx
new file mode 100644
index 000000000000..47c96facd472
--- /dev/null
+++ b/include/vcl/configsettings.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 VCL_INC_CONFIGSETTINGS_HXX
+#define VCL_INC_CONFIGSETTINGS_HXX
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <unotools/configitem.hxx>
+#include <vcl/dllapi.h>
+
+#include <boost/unordered_map.hpp>
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ typedef boost::unordered_map< OUString, OUString, OUStringHash > OUStrMap;
+ class SmallOUStrMap : public OUStrMap { public: SmallOUStrMap() : OUStrMap(1) {} };
+
+ //====================================================================
+ //= SettingsConfigItem
+ //====================================================================
+ class VCL_DLLPUBLIC SettingsConfigItem : public ::utl::ConfigItem
+ {
+
+ boost::unordered_map< OUString, SmallOUStrMap, OUStringHash > m_aSettings;
+
+ virtual void Notify( const com::sun::star::uno::Sequence< OUString >& rPropertyNames );
+
+ void getValues();
+ SettingsConfigItem();
+ public:
+ virtual ~SettingsConfigItem();
+
+ static SettingsConfigItem* get();
+
+ const OUString& getValue( const OUString& rGroup, const OUString& rKey ) const;
+ void setValue( const OUString& rGroup, const OUString& rKey, const OUString& rValue );
+
+ virtual void Commit();
+ };
+
+//........................................................................
+} // namespace vcl
+//........................................................................
+
+#endif // VCL_INC_CONFIGSETTINGS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/controllayout.hxx b/include/vcl/controllayout.hxx
new file mode 100644
index 000000000000..5d1d13355718
--- /dev/null
+++ b/include/vcl/controllayout.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 _VCL_CONTROLLAYOUT_HXX
+#define _VCL_CONTROLLAYOUT_HXX
+
+#include <vector>
+#include <tools/gen.hxx>
+#include <tools/string.hxx>
+#include <vcl/dllapi.h>
+
+class Control;
+
+namespace vcl
+{
+
+struct VCL_DLLPUBLIC ControlLayoutData
+{
+ // contains the string really displayed
+ // there must be exactly one bounding rectangle in m_aUnicodeBoundRects
+ // for every character in m_aDisplayText
+ OUString m_aDisplayText;
+ // the bounding rectangle of every character
+ // where one character may consist of many glyphs
+ std::vector< Rectangle > m_aUnicodeBoundRects;
+ // start indices of lines
+ std::vector< long > m_aLineIndices;
+ // notify parent control on destruction
+ const Control* m_pParent;
+
+ ControlLayoutData() : m_pParent( NULL ) {}
+ ~ControlLayoutData();
+
+ Rectangle GetCharacterBounds( long nIndex ) const;
+ // returns the character index for corresponding to rPoint (in control coordinates)
+ // -1 is returned if no character is at that point
+ long GetIndexForPoint( const Point& rPoint ) const;
+ // returns the number of lines in the result of GetDisplayText()
+ long GetLineCount() const;
+ // returns the interval [start,end] of line nLine
+ // returns [-1,-1] for an invalid line
+ Pair GetLineStartEnd( long nLine ) const;
+ /** ToRelativeLineIndex changes a layout data index to a count relative to its line.
+
+ <p>This is equivalent to getting the line start/end pairs with
+ <member>GetLineStartEnd</member> until the index lies within [start,end] of a line
+ </p>
+
+ @param nIndex
+ the absolute index inside the display text to be changed to a relative index
+
+ @returns
+ the relative index inside the displayed line or -1 if the absolute index does
+ not match any line
+ */
+ long ToRelativeLineIndex( long nIndex ) const;
+};
+
+} // namespace vcl
+
+#endif // _VCL_CONTROLLAYOUT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
new file mode 100644
index 000000000000..390f416ae142
--- /dev/null
+++ b/include/vcl/ctrl.hxx
@@ -0,0 +1,195 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_CTRL_HXX
+#define _SV_CTRL_HXX
+
+#include <tools/link.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/window.hxx>
+#include <vcl/salnativewidgets.hxx>
+
+// forward
+namespace vcl { struct ImplControlData; struct ControlLayoutData; }
+
+// -----------
+// - Control -
+// -----------
+
+class VCL_DLLPUBLIC Control : public Window
+{
+protected:
+ ::vcl::ImplControlData* mpControlData;
+
+private:
+ bool mbHasControlFocus;
+ Link maGetFocusHdl;
+ Link maLoseFocusHdl;
+
+ SAL_DLLPRIVATE void ImplInitControlData();
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE Control (const Control &);
+ SAL_DLLPRIVATE Control & operator= (const Control &);
+
+protected:
+ Control( WindowType nType );
+ virtual void FillLayoutData() const;
+
+ // helper method for composite controls
+ void AppendLayoutData( const Control& rSubControl ) const;
+
+ /// creates the mpData->mpLayoutData structure
+ void CreateLayoutData() const;
+ /// determines whether we currently have layout data
+ bool HasLayoutData() const;
+ /// returns the current layout data
+ ::vcl::ControlLayoutData*
+ GetLayoutData() const;
+
+ /** this calls both our event listeners, and a specified handler
+
+ If the Control instance is destroyed during any of those calls, the
+ method properly handles this (in particular, it doesn't crash :)
+
+ @param nEvent
+ the event to notify to our event listeners
+ @param rHandler
+ the handler to call
+ @param pCaller
+ the parameter to pass to the handler call
+ @return
+ if the Control instance has been destroyed in any of the call
+ */
+ sal_Bool ImplCallEventListenersAndHandler(
+ sal_uLong nEvent, const Link& rHandler, void* pCaller
+ );
+
+ /** draws the given text onto the given device
+
+ If no reference device is set, the draw request will simply be forwarded to OutputDevice::DrawText. Otherwise,
+ the text will be rendered according to the metrics at the reference device.
+
+ Note that the given rectangle might be modified, it will contain the result of a GetTextRect call (either
+ directly at the target device, or taking the reference device into account) when returning.
+ */
+ void DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect,
+ const OUString& _rStr, sal_uInt16 _nStyle,
+ MetricVector* _pVector, OUString* _pDisplayText ) const;
+
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
+
+ void ImplInitSettings( const sal_Bool _bFont, const sal_Bool _bForeground );
+
+public:
+ SAL_DLLPRIVATE void ImplClearLayoutData() const;
+ /** draws a frame around the give rectangle, onto the given device
+
+ only to be used from within the <member>Window::Draw</member> method of your sub class.
+
+ The frame is always drawn with a single line (without 3D effects). In addition, any mono
+ color set at the control's settings is respected. Yet more additionally, if we're living
+ in a themed desktop, this theming is ignored.
+
+ Note that this makes sense, since the *only known* clients of <member>Window::Draw</member>
+ are form controls, when printed or print-previewed. For form controls embedded in office documents,
+ you don't want to have the theme look.
+
+ @param pDev
+ the device to draw onto
+ @param rRect
+ the rect for drawing the frame. Upon returning from the call, the rect will be inflated
+ by the space occupied by the drawn pixels.
+ */
+ SAL_DLLPRIVATE void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect );
+
+public:
+ Control( Window* pParent, WinBits nWinStyle = 0 );
+ Control( Window* pParent, const ResId& rResId );
+ ~Control();
+
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void Resize();
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ // invalidates layout data
+ virtual void SetText( const OUString& rStr );
+ // gets the displayed text
+ virtual OUString GetDisplayText() const;
+ // returns the bounding box for the character at index nIndex (in control coordinates)
+ Rectangle GetCharacterBounds( long nIndex ) const;
+ // returns the character index for corresponding to rPoint (in control coordinates)
+ // -1 is returned if no character is at that point
+ long GetIndexForPoint( const Point& rPoint ) const;
+ // returns the interval [start,end] of line nLine
+ // returns [-1,-1] for an invalid line
+ Pair GetLineStartEnd( long nLine ) const;
+ /** ToRelativeLineIndex changes a layout data index to a count relative to its line.
+
+ <p>This is equivalent to getting the line start/end pairs with
+ <member>GetLineStartEnd</member> until the index lies within [start,end] of a line
+ </p>
+
+ @param nIndex
+ the absolute index inside the display text to be changed to a relative index
+
+ @returns
+ the relative index inside the displayed line or -1 if the absolute index does
+ not match any line
+ */
+ long ToRelativeLineIndex( long nIndex ) const;
+
+ void SetGetFocusHdl( const Link& rLink ) { maGetFocusHdl = rLink; }
+ const Link& GetGetFocusHdl() const { return maGetFocusHdl; }
+ void SetLoseFocusHdl( const Link& rLink ) { maLoseFocusHdl = rLink; }
+ const Link& GetLoseFocusHdl() const { return maLoseFocusHdl; }
+
+ /** determines whether the control currently has the focus
+ */
+ bool HasControlFocus() const { return mbHasControlFocus; }
+
+ void SetLayoutDataParent( const Control* pParent ) const;
+
+ virtual Size GetOptimalSize() const;
+
+ /** sets a reference device used for rendering control text
+ @seealso DrawControlText
+ */
+ void SetReferenceDevice( OutputDevice* _referenceDevice );
+ OutputDevice* GetReferenceDevice() const;
+
+ Font GetUnzoomedControlPointFont() const
+ {
+ Font aFont( GetCanonicalFont( GetSettings().GetStyleSettings() ) );
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+ return aFont;
+ }
+};
+
+#endif // _SV_CTRL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/cursor.hxx b/include/vcl/cursor.hxx
new file mode 100644
index 000000000000..d0433858c3b3
--- /dev/null
+++ b/include/vcl/cursor.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 _SV_CURSOR_HXX
+#define _SV_CURSOR_HXX
+
+#include <tools/gen.hxx>
+#include <tools/link.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+
+class AutoTimer;
+struct ImplCursorData;
+class Window;
+
+// -----------------
+// - Cursor-Styles -
+// -----------------
+
+#define CURSOR_SHADOW ((sal_uInt16)0x0001)
+#define CURSOR_DIRECTION_NONE ((unsigned char)0x00)
+#define CURSOR_DIRECTION_LTR ((unsigned char)0x01)
+#define CURSOR_DIRECTION_RTL ((unsigned char)0x02)
+
+// ----------
+// - Cursor -
+// ----------
+
+class VCL_DLLPUBLIC Cursor
+{
+private:
+ ImplCursorData* mpData; // Interne Daten
+ Window* mpWindow; // Window (only for shadow cursor)
+ long mnSlant; // Schraegstellung
+ long mnOffsetY; // Offset fuer Rotation
+ Size maSize; // Groesse
+ Point maPos; // Position
+ short mnOrientation; // Rotation
+ sal_uInt16 mnStyle; // Style
+ bool mbVisible; // Ist Cursor sichtbar
+ unsigned char mnDirection; // indicates direction
+
+public:
+ SAL_DLLPRIVATE void ImplDraw();
+ SAL_DLLPRIVATE void ImplRestore();
+ DECL_DLLPRIVATE_LINK( ImplTimerHdl, void* );
+ SAL_DLLPRIVATE void ImplShow( bool bDrawDirect = true );
+ SAL_DLLPRIVATE void ImplHide( bool bStopTimer );
+ SAL_DLLPRIVATE void ImplResume( bool bRestore = false );
+ SAL_DLLPRIVATE bool ImplSuspend();
+ SAL_DLLPRIVATE void ImplNew();
+
+public:
+ Cursor();
+ Cursor( const Cursor& rCursor );
+ ~Cursor();
+
+ void SetStyle( sal_uInt16 nStyle );
+ sal_uInt16 GetStyle() const { return mnStyle; }
+
+ void Show();
+ void Hide();
+ bool IsVisible() const { return mbVisible; }
+
+ void SetWindow( Window* pWindow );
+ Window* GetWindow() const { return mpWindow; }
+
+ void SetPos( const Point& rNewPos );
+ const Point& GetPos() const { return maPos; }
+ long GetOffsetY() const { return mnOffsetY; }
+
+ void SetSize( const Size& rNewSize );
+ const Size& GetSize() const { return maSize; }
+ void SetWidth( long nNewWidth );
+ long GetWidth() const { return maSize.Width(); }
+ long GetHeight() const { return maSize.Height(); }
+
+ long GetSlant() const { return mnSlant; }
+
+ void SetOrientation( short nOrientation = 0 );
+ short GetOrientation() const { return mnOrientation; }
+
+ void SetDirection( unsigned char nDirection = 0 );
+ unsigned char GetDirection() const { return mnDirection; }
+
+ Cursor& operator=( const Cursor& rCursor );
+ bool operator==( const Cursor& rCursor ) const;
+ bool operator!=( const Cursor& rCursor ) const
+ { return !(Cursor::operator==( rCursor )); }
+
+private:
+ void ImplDoShow( bool bDrawDirect, bool bRestore );
+ bool ImplDoHide( bool bStop );
+};
+
+#endif // _SV_CURSOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/cvtgrf.hxx b/include/vcl/cvtgrf.hxx
new file mode 100644
index 000000000000..ee9f21870010
--- /dev/null
+++ b/include/vcl/cvtgrf.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 _SV_CVTGRF_HXX
+#define _SV_CVTGRF_HXX
+
+#include <vcl/dllapi.h>
+#include <tools/link.hxx>
+#include <vcl/salctype.hxx>
+
+// --------------------
+// - GraphicConverter -
+// --------------------
+
+struct ConvertData;
+class Graphic;
+
+class VCL_DLLPUBLIC GraphicConverter
+{
+private:
+
+ Link maFilterHdl;
+ ConvertData* mpConvertData;
+
+public:
+
+ GraphicConverter();
+ ~GraphicConverter();
+
+ static sal_uLong Import( SvStream& rIStm, Graphic& rGraphic, sal_uLong nFormat = CVT_UNKNOWN );
+ static sal_uLong Export( SvStream& rOStm, const Graphic& rGraphic, sal_uLong nFormat );
+
+ ConvertData* GetConvertData() { return mpConvertData; }
+
+ void SetFilterHdl( const Link& rLink ) { maFilterHdl = rLink; }
+ const Link& GetFilterHdl() const { return maFilterHdl; }
+};
+
+#endif // _SV_CVTGRF_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/cvtsvm.hxx b/include/vcl/cvtsvm.hxx
new file mode 100644
index 000000000000..2dc9435cdfa9
--- /dev/null
+++ b/include/vcl/cvtsvm.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 _SV_CVTMTF_HXX
+#define _SV_CVTMTF_HXX
+
+#include <stack>
+#include <vcl/dllapi.h>
+#include <vcl/metaact.hxx>
+#include <vcl/gdimtf.hxx>
+
+#define CONVERT_TO_SVM1 0x00000001UL
+#define CONVERT_FROM_SVM1 0x00000002UL
+
+#define GDI_PIXEL_ACTION 1
+#define GDI_POINT_ACTION 2
+#define GDI_LINE_ACTION 3
+#define GDI_RECT_ACTION 4
+#define GDI_ELLIPSE_ACTION 5
+#define GDI_ARC_ACTION 6
+#define GDI_PIE_ACTION 7
+#define GDI_INVERTRECT_ACTION 8
+#define GDI_HIGHLIGHTRECT_ACTION 9
+#define GDI_POLYLINE_ACTION 10
+#define GDI_POLYGON_ACTION 11
+#define GDI_POLYPOLYGON_ACTION 12
+#define GDI_TEXT_ACTION 13
+#define GDI_TEXTARRAY_ACTION 14
+#define GDI_STRETCHTEXT_ACTION 15
+#define GDI_ICON_ACTION 16
+#define GDI_BITMAP_ACTION 17
+#define GDI_BITMAPSCALE_ACTION 18
+#define GDI_PEN_ACTION 19
+#define GDI_FONT_ACTION 20
+#define GDI_BACKBRUSH_ACTION 21
+#define GDI_FILLBRUSH_ACTION 22
+#define GDI_MAPMODE_ACTION 23
+#define GDI_CLIPREGION_ACTION 24
+#define GDI_RASTEROP_ACTION 25
+#define GDI_PUSH_ACTION 26
+#define GDI_POP_ACTION 27
+#define GDI_MOVECLIPREGION_ACTION 28
+#define GDI_ISECTCLIPREGION_ACTION 29
+#define GDI_MTF_ACTION 30
+#define GDI_BITMAPSCALEPART_ACTION 32
+#define GDI_GRADIENT_ACTION 33
+
+#define GDI_TRANSPARENT_COMMENT 1024
+#define GDI_HATCH_COMMENT 1025
+#define GDI_REFPOINT_COMMENT 1026
+#define GDI_TEXTLINECOLOR_COMMENT 1027
+#define GDI_TEXTLINE_COMMENT 1028
+#define GDI_FLOATTRANSPARENT_COMMENT 1029
+#define GDI_GRADIENTEX_COMMENT 1030
+#define GDI_COMMENT_COMMENT 1031
+#define GDI_UNICODE_COMMENT 1032
+
+#define GDI_LINEJOIN_ACTION 1033
+#define GDI_EXTENDEDPOLYGON_ACTION 1034
+#define GDI_LINEDASHDOT_ACTION 1035
+
+#define GDI_LINECAP_ACTION 1036
+
+class VCL_PLUGIN_PUBLIC SVMConverter
+{
+private:
+ SAL_DLLPRIVATE void ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf );
+ SAL_DLLPRIVATE void ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf );
+ SAL_DLLPRIVATE sal_uLong ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
+ VirtualDevice& rSaveVDev, sal_Bool& rRop_0_1,
+ Color& rLineCol, ::std::stack<Color*>& rLineColStack,
+ rtl_TextEncoding& rActualCharSet );
+
+public:
+ SVMConverter( SvStream& rIStm, GDIMetaFile& rMtf, sal_uLong nConvertMode );
+ ~SVMConverter() {}
+
+private:
+ // Not implemented
+ SVMConverter( const SVMConverter& );
+ SVMConverter& operator=( const SVMConverter& );
+};
+
+#endif // _SV_CVTMTF_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/decoview.hxx b/include/vcl/decoview.hxx
new file mode 100644
index 000000000000..31e6529c5e55
--- /dev/null
+++ b/include/vcl/decoview.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 _SV_DECOVIEW_HXX
+#define _SV_DECOVIEW_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <rsc/rsc-vcl-shared-types.hxx>
+
+class Rectangle;
+class Point;
+class Color;
+class OutputDevice;
+
+// ------------------------
+// - DecorationView-Types -
+// ------------------------
+
+// Flags for DrawSymbol()
+#define SYMBOL_DRAW_MONO ((sal_uInt16)0x0001)
+#define SYMBOL_DRAW_DISABLE ((sal_uInt16)0x0002)
+
+// Flags for DrawFrame()
+#define FRAME_DRAW_IN ((sal_uInt16)0x0001)
+#define FRAME_DRAW_OUT ((sal_uInt16)0x0002)
+#define FRAME_DRAW_GROUP ((sal_uInt16)0x0003)
+#define FRAME_DRAW_DOUBLEIN ((sal_uInt16)0x0004)
+#define FRAME_DRAW_DOUBLEOUT ((sal_uInt16)0x0005)
+#define FRAME_DRAW_NWF ((sal_uInt16)0x0006)
+#define FRAME_DRAW_MENU ((sal_uInt16)0x0010)
+#define FRAME_DRAW_WINDOWBORDER ((sal_uInt16)0x0020)
+#define FRAME_DRAW_BORDERWINDOWBORDER ((sal_uInt16)0x0040)
+#define FRAME_DRAW_MONO ((sal_uInt16)0x1000)
+#define FRAME_DRAW_NODRAW ((sal_uInt16)0x8000)
+#define FRAME_DRAW_STYLE ((sal_uInt16)0x000F)
+
+// Flags for DrawHighlightFrame()
+#define FRAME_HIGHLIGHT_IN ((sal_uInt16)0x0001)
+#define FRAME_HIGHLIGHT_OUT ((sal_uInt16)0x0002)
+#define FRAME_HIGHLIGHT_TESTBACKGROUND ((sal_uInt16)0x4000)
+#define FRAME_HIGHLIGHT_STYLE ((sal_uInt16)0x000F)
+
+// Flags for DrawButton()
+#define BUTTON_DRAW_DEFAULT ((sal_uInt16)0x0001)
+#define BUTTON_DRAW_NOLIGHTBORDER ((sal_uInt16)0x0002)
+#define BUTTON_DRAW_PRESSED ((sal_uInt16)0x0004)
+#define BUTTON_DRAW_CHECKED ((sal_uInt16)0x0008)
+#define BUTTON_DRAW_DONTKNOW ((sal_uInt16)0x0010)
+#define BUTTON_DRAW_MONO ((sal_uInt16)0x0020)
+#define BUTTON_DRAW_NOFILL ((sal_uInt16)0x0040)
+#define BUTTON_DRAW_DISABLED ((sal_uInt16)0x0080)
+#define BUTTON_DRAW_HIGHLIGHT ((sal_uInt16)0x0100)
+#define BUTTON_DRAW_FLAT ((sal_uInt16)0x0200)
+#define BUTTON_DRAW_NOLEFTLIGHTBORDER ((sal_uInt16)0x1000)
+#define BUTTON_DRAW_NOTEXT ((sal_uInt16)0x2000)
+#define BUTTON_DRAW_NOIMAGE ((sal_uInt16)0x4000)
+
+// ------------------
+// - DecorationView -
+// ------------------
+
+class VCL_DLLPUBLIC DecorationView
+{
+private:
+ OutputDevice* mpOutDev;
+
+public:
+ DecorationView( OutputDevice* pOutDev )
+ { mpOutDev = pOutDev; }
+
+ void DrawSymbol( const Rectangle& rRect, SymbolType eType,
+ const Color& rColor, sal_uInt16 nStyle = 0 );
+ void DrawFrame( const Rectangle& rRect,
+ const Color& rLeftTopColor,
+ const Color& rRightBottomColor );
+ void DrawHighlightFrame( const Rectangle& rRect,
+ sal_uInt16 nStyle = FRAME_HIGHLIGHT_OUT );
+ Rectangle DrawFrame( const Rectangle& rRect, sal_uInt16 nStyle = FRAME_DRAW_OUT );
+ Rectangle DrawButton( const Rectangle& rRect, sal_uInt16 nStyle );
+ void DrawSeparator( const Point& rStart, const Point& rStop, bool bVertical = true );
+};
+
+#endif // _SV_DECOVIEW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
new file mode 100644
index 000000000000..d7994c61580e
--- /dev/null
+++ b/include/vcl/dialog.hxx
@@ -0,0 +1,185 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_DIALOG_HXX
+#define _SV_DIALOG_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/builder.hxx>
+#include <vcl/syswin.hxx>
+#include <vcl/timer.hxx>
+
+// parameter to pass to the dialog constructor if really no parent is wanted
+// whereas NULL chooses the default dialog parent
+#define DIALOG_NO_PARENT ((Window*)0xffffffff)
+
+// ----------
+// - Dialog -
+// ----------
+struct DialogImpl;
+class VclBox;
+class VclButtonBox;
+class VclContainer;
+
+class VCL_DLLPUBLIC Dialog
+ : public SystemWindow
+ , public VclBuilderContainer
+{
+private:
+ Window* mpDialogParent;
+ Dialog* mpPrevExecuteDlg;
+ DialogImpl* mpDialogImpl;
+ long mnMousePositioned;
+ sal_Bool mbInExecute;
+ sal_Bool mbOldSaveBack;
+ sal_Bool mbInClose;
+ sal_Bool mbModalMode;
+ bool mbIsDefferedInit;
+ bool mbIsCalculatingInitialLayoutSize;
+ Timer maLayoutTimer;
+ VclButtonBox* mpActionArea;
+ VclBox* mpContentArea;
+
+ SAL_DLLPRIVATE void ImplInitDialogData();
+ SAL_DLLPRIVATE void ImplInitSettings();
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE Dialog (const Dialog &);
+ SAL_DLLPRIVATE Dialog & operator= (const Dialog &);
+
+ DECL_DLLPRIVATE_LINK( ImplAsyncCloseHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplHandleLayoutTimerHdl, void* );
+
+protected:
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplDialogRes( const ResId& rResId );
+ SAL_DLLPRIVATE WinBits init(Window *pParent, const ResId& rResId);
+
+ SAL_DLLPRIVATE void setPosSizeOnContainee(Size aSize, VclContainer &rBox);
+public:
+ SAL_DLLPRIVATE sal_Bool IsInClose() const { return mbInClose; }
+ SAL_DLLPRIVATE bool hasPendingLayout() const { return maLayoutTimer.IsActive(); }
+ SAL_DLLPRIVATE void doDeferredInit(bool bResizable);
+ SAL_DLLPRIVATE bool isDeferredInit() const { return mbIsDefferedInit; }
+
+protected:
+ Dialog( WindowType nType );
+ Dialog( Window* pParent, const OString& rID, const OUString& rUIXMLDescription, WindowType nType );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+
+protected:
+ friend class VclBuilder;
+ void set_action_area(VclButtonBox *pBox);
+ void set_content_area(VclBox *pBox);
+
+public:
+ Dialog( Window* pParent, WinBits nStyle = WB_STDDIALOG );
+ Dialog( Window* pParent, const OString& rID, const OUString& rUIXMLDescription );
+ virtual ~Dialog();
+
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual Size GetOptimalSize() const;
+ virtual void Resize();
+ bool isLayoutEnabled() const;
+ void setOptimalLayoutSize();
+ bool isCalculatingInitialLayoutSize() const { return mbIsCalculatingInitialLayoutSize; }
+ virtual void queue_layout();
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+ VclButtonBox* get_action_area();
+ VclBox* get_content_area();
+
+ virtual sal_Bool Close();
+
+ virtual short Execute();
+ sal_Bool IsInExecute() const { return mbInExecute; }
+
+ ////////////////////////////////////////
+ // Dialog::Execute replacement API
+public:
+ // Link impl: DECL_LINK( MyEndDialogHdl, Dialog* ); <= param is dialog just ended
+ virtual void StartExecuteModal( const Link& rEndDialogHdl );
+ long GetResult() const;
+private:
+ sal_Bool ImplStartExecuteModal();
+ void ImplEndExecuteModal();
+public:
+
+ // Dialog::Execute replacement API
+ ////////////////////////////////////////
+
+ void EndDialog( long nResult = 0 );
+ static void EndAllDialogs( Window* pParent=NULL );
+
+ void GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+ sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
+
+ void SetModalInputMode( sal_Bool bModal );
+ void SetModalInputMode( sal_Bool bModal, sal_Bool bSubModalDialogs );
+ sal_Bool IsModalInputMode() const { return mbModalMode; }
+
+ void GrabFocusToFirstControl();
+};
+
+// ------------------
+// - ModelessDialog -
+// ------------------
+
+class VCL_DLLPUBLIC ModelessDialog : public Dialog
+{
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE ModelessDialog (const ModelessDialog &);
+ SAL_DLLPRIVATE ModelessDialog & operator= (const ModelessDialog &);
+
+public:
+ ModelessDialog( Window* pParent, const ResId& rResId );
+ ModelessDialog( Window* pParent, const OString& rID, const OUString& rUIXMLDescription );
+};
+
+// ---------------
+// - ModalDialog -
+// ---------------
+
+class VCL_DLLPUBLIC ModalDialog : public Dialog
+{
+public:
+ ModalDialog( Window* pParent, WinBits nStyle = WB_STDMODAL );
+ ModalDialog( Window* pParent, const OString& rID, const OUString& rUIXMLDescription );
+ ModalDialog( Window* pParent, const ResId& rResId );
+
+protected:
+ using Window::Show;
+ void Show( sal_Bool bVisible = sal_True );
+ using Window::Hide;
+ void Hide();
+
+private:
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE ModalDialog (const ModalDialog &);
+ SAL_DLLPRIVATE ModalDialog & operator= (const ModalDialog &);
+};
+
+#endif // _SV_DIALOG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/displayconnectiondispatch.hxx b/include/vcl/displayconnectiondispatch.hxx
new file mode 100644
index 000000000000..06009c15867a
--- /dev/null
+++ b/include/vcl/displayconnectiondispatch.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_VCL_DISPLAYCONNECTIONDISPATCH_HXX
+#define INCLUDED_VCL_DISPLAYCONNECTIONDISPATCH_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/awt/XDisplayConnection.hpp"
+#include "cppuhelper/implbase1.hxx"
+
+namespace vcl {
+
+class DisplayConnectionDispatch:
+ public cppu::WeakImplHelper1< com::sun::star::awt::XDisplayConnection >
+{
+public:
+ virtual bool dispatchEvent(void * pData, int nBytes) = 0;
+
+ virtual bool dispatchErrorEvent(void * pData, int nBytes) = 0;
+
+protected:
+ virtual ~DisplayConnectionDispatch() {}
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/dllapi.h b/include/vcl/dllapi.h
new file mode 100644
index 000000000000..f501125e72f9
--- /dev/null
+++ b/include/vcl/dllapi.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 _VCL_DLLAPI_H
+#define _VCL_DLLAPI_H
+
+#include "sal/config.h"
+#include "sal/types.h"
+
+#if defined VCL_DLLIMPLEMENTATION
+#define VCL_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define VCL_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#if defined UNX && ! defined MACOS
+#define VCL_PLUGIN_PUBLIC VCL_DLLPUBLIC
+#else
+#define VCL_PLUGIN_PUBLIC SAL_DLLPRIVATE
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/dndhelp.hxx b/include/vcl/dndhelp.hxx
new file mode 100644
index 000000000000..2504f697f2d7
--- /dev/null
+++ b/include/vcl/dndhelp.hxx
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _VCL_DNDHELP_HXX
+#define _VCL_DNDHELP_HXX
+
+#include <vcl/dllapi.h>
+#include <cppuhelper/weak.hxx>
+#include <com/sun/star/datatransfer/dnd/XDragGestureListener.hpp>
+#include <com/sun/star/datatransfer/dnd/XDragSourceListener.hpp>
+#include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
+
+namespace com {
+namespace sun {
+namespace star {
+
+namespace datatransfer {
+namespace dnd {
+ struct DragGestureEvent;
+ struct DragSourceDragEvent;
+ struct DragSourceDropEvent;
+ struct DragSourceEvent;
+ struct DropTargetDragEvent;
+ struct DropTargetDragEnterEvent;
+ struct DropTargetDropEvent;
+ struct DropTargetEvent;
+}}
+
+}}}
+
+namespace vcl
+{
+
+namespace unohelper
+{
+
+class VCL_DLLPUBLIC DragAndDropClient
+{
+public:
+ virtual ~DragAndDropClient();
+
+ // ::com::sun::star::datatransfer::dnd::XDragGestureListener
+ virtual void dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::datatransfer::dnd::XDragSourceListener
+ virtual void dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& dsde ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent& dse ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::datatransfer::dnd::XDropTargetListener
+ virtual void drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
+};
+
+class VCL_DLLPUBLIC DragAndDropWrapper :
+ public ::com::sun::star::datatransfer::dnd::XDragGestureListener,
+ public ::com::sun::star::datatransfer::dnd::XDragSourceListener,
+ public ::com::sun::star::datatransfer::dnd::XDropTargetListener,
+ public ::cppu::OWeakObject
+{
+private:
+ DragAndDropClient* mpClient;
+
+public:
+ DragAndDropWrapper( DragAndDropClient* pClient );
+ ~DragAndDropWrapper();
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::lang::XEventListener
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::datatransfer::dnd::XDragGestureListener
+ void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::datatransfer::dnd::XDragSourceListener
+ void SAL_CALL dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& dsde ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent& dse ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::datatransfer::dnd::XDropTargetListener
+ void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
+};
+
+}} // namespace vcl::unohelper
+
+#endif // _VCL_DNDHELP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/dockingarea.hxx b/include/vcl/dockingarea.hxx
new file mode 100644
index 000000000000..a5778519e3ae
--- /dev/null
+++ b/include/vcl/dockingarea.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 _SV_DOCKINGAREA_HXX
+#define _SV_DOCKINGAREA_HXX
+
+#include <tools/solar.h>
+#include <vcl/window.hxx>
+
+// ------------------------------------------
+// A simple container for docked toolbars
+// - its main purpose is theming support
+// ------------------------------------------
+
+class VCL_DLLPUBLIC DockingAreaWindow : public Window
+{
+ class ImplData;
+
+private:
+ ImplData* mpImplData;
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE DockingAreaWindow (const DockingAreaWindow &);
+ SAL_DLLPRIVATE DockingAreaWindow & operator= (const DockingAreaWindow &);
+
+public:
+ DockingAreaWindow( Window *pParent );
+ ~DockingAreaWindow();
+
+ void SetAlign( WindowAlign eNewAlign );
+ WindowAlign GetAlign() const;
+ sal_Bool IsHorizontal() const;
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void StateChanged( StateChangedType nType );
+
+};
+
+#endif // _SV_SYSWIN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx
new file mode 100644
index 000000000000..19b516b004a3
--- /dev/null
+++ b/include/vcl/dockwin.hxx
@@ -0,0 +1,420 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_DOCKWIN_HXX
+#define _SV_DOCKWIN_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/floatwin.hxx>
+#include <vector>
+
+// data to be sent with docking events
+struct DockingData
+{
+ Point maMousePos; // in
+ Rectangle maTrackRect; // in/out
+ sal_Bool mbFloating; // out
+ sal_Bool mbLivemode; // in
+ sal_Bool mbInteractive; // in
+
+ DockingData() {};
+ DockingData( const Point& rPt, const Rectangle& rRect, sal_Bool b) :
+ maMousePos( rPt ), maTrackRect( rRect ), mbFloating( b ), mbLivemode( sal_False ), mbInteractive( sal_True )
+ {};
+};
+
+struct EndDockingData
+{
+ Rectangle maWindowRect; // in
+ sal_Bool mbFloating; // in
+ sal_Bool mbCancelled; // in
+
+ EndDockingData() {};
+ EndDockingData( const Rectangle& rRect, sal_Bool b, sal_Bool bCancelled ) :
+ maWindowRect( rRect ), mbFloating( b ), mbCancelled( bCancelled )
+ {};
+};
+
+struct EndPopupModeData
+{
+ Point maFloatingPos; // in
+ sal_Bool mbTearoff; // in
+
+ EndPopupModeData() {};
+ EndPopupModeData( const Point& rPos, sal_Bool bTearoff ) :
+ maFloatingPos( rPos ), mbTearoff( bTearoff )
+ {};
+};
+
+/** ImplDockingWindowWrapper
+ *
+ * ImplDockingWindowWrapper obsoletes the DockingWindow class.
+ * It is better because it can make a "normal window" dockable.
+ * All DockingWindows should be converted the new class.
+ */
+
+class ImplDockingWindowWrapper
+{
+ friend class Window;
+ friend class DockingManager;
+ friend class DockingWindow;
+
+private:
+
+ // the original 'Docking'window
+ Window *mpDockingWindow;
+
+ // the original DockingWindow members
+ FloatingWindow* mpFloatWin;
+ Window* mpOldBorderWin;
+ Window* mpParent;
+ Point maFloatPos;
+ Point maDockPos;
+ Point maMouseOff;
+ Point maMouseStart;
+ Size maRollUpOutSize;
+ Size maMinOutSize;
+ Size maMaxOutSize;
+ Rectangle maDragArea;
+ long mnTrackX;
+ long mnTrackY;
+ long mnTrackWidth;
+ long mnTrackHeight;
+ sal_Int32 mnDockLeft;
+ sal_Int32 mnDockTop;
+ sal_Int32 mnDockRight;
+ sal_Int32 mnDockBottom;
+ WinBits mnFloatBits;
+ sal_Bool mbDockCanceled:1,
+ mbFloatPrevented:1,
+ mbDockable:1,
+ mbDocking:1,
+ mbDragFull:1,
+ mbLastFloatMode:1,
+ mbStartFloat:1,
+ mbTrackDock:1,
+ mbPined:1,
+ mbRollUp:1,
+ mbDockBtn:1,
+ mbHideBtn:1,
+ mbStartDockingEnabled:1,
+ mbLocked:1;
+
+ void ImplInitData();
+
+ DECL_LINK( PopupModeEnd, void* );
+ void ImplEnableStartDocking( sal_Bool bEnable = sal_True ) { mbStartDockingEnabled = bEnable; }
+ sal_Bool ImplStartDockingEnabled() { return mbStartDockingEnabled; }
+
+public:
+ ImplDockingWindowWrapper( const Window *pWindow );
+ virtual ~ImplDockingWindowWrapper();
+
+ Window* GetWindow() { return mpDockingWindow; }
+ sal_Bool ImplStartDocking( const Point& rPos );
+
+ // those methods actually call the corresponding handlers
+ void StartDocking( const Point& rPos, Rectangle& rRect );
+ sal_Bool Docking( const Point& rPos, Rectangle& rRect );
+ void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
+ sal_Bool PrepareToggleFloatingMode();
+ void ToggleFloatingMode();
+
+ void SetDragArea( const Rectangle& rRect );
+ Rectangle GetDragArea() const;
+
+ void Lock();
+ void Unlock();
+ sal_Bool IsLocked() const;
+
+ void StartPopupMode( ToolBox* pParentToolBox, sal_uLong nPopupModeFlags );
+ sal_Bool IsInPopupMode() const;
+
+ void TitleButtonClick( sal_uInt16 nButton );
+ void Pin();
+ void Roll();
+ void PopupModeEnd();
+ void Resizing( Size& rSize );
+ sal_Bool Close();
+ void Tracking( const TrackingEvent& rTEvt );
+ long Notify( NotifyEvent& rNEvt );
+
+ void ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible = sal_True );
+
+ void SetMinOutputSizePixel( const Size& rSize );
+
+ void SetMaxOutputSizePixel( const Size& rSize );
+
+ sal_Bool IsDocking() const { return mbDocking; }
+ sal_Bool IsDockable() const { return mbDockable; }
+ sal_Bool IsDockingCanceled() const { return mbDockCanceled; }
+ sal_Bool IsFloatingPrevented() const { return mbFloatPrevented; }
+
+ void SetFloatingMode( sal_Bool bFloatMode = sal_False );
+ sal_Bool IsFloatingMode() const;
+ FloatingWindow* GetFloatingWindow() const { return mpFloatWin; }
+
+ void SetFloatStyle( WinBits nWinStyle );
+ WinBits GetFloatStyle() const;
+
+ virtual void setPosSizePixel( long nX, long nY,
+ long nWidth, long nHeight,
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+ void SetPosSizePixel( const Point& rNewPos,
+ const Size& rNewSize )
+ { mpDockingWindow->SetPosSizePixel( rNewPos, rNewSize ); }
+ Point GetPosPixel() const;
+ Size GetSizePixel() const;
+};
+
+class VCL_DLLPUBLIC DockingManager
+{
+protected:
+ ::std::vector<ImplDockingWindowWrapper *> mDockingWindows;
+
+public:
+ DockingManager();
+ ~DockingManager();
+
+ void AddWindow( const Window *pWin );
+ void RemoveWindow( const Window *pWin );
+
+ ImplDockingWindowWrapper* GetDockingWindowWrapper( const Window *pWin );
+ sal_Bool IsDockable( const Window *pWin );
+
+ sal_Bool IsFloating( const Window *pWin );
+ void SetFloatingMode( const Window *pWin, sal_Bool bFloating );
+
+ void Lock( const Window *pWin );
+ void Unlock( const Window *pWin );
+ sal_Bool IsLocked( const Window *pWin );
+
+ void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin );
+ void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin, sal_uLong nPopupModeFlags );
+
+ sal_Bool IsInPopupMode( const Window *pWin );
+ void EndPopupMode( const Window *pWin );
+
+ // required because those methods are not virtual in Window (!!!) and must
+ // be availbale from the toolkit
+ void SetPosSizePixel( Window *pWin, long nX, long nY,
+ long nWidth, long nHeight,
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+ Rectangle GetPosSizePixel( const Window *pWin );
+};
+
+// -----------------
+// - DockingWindow -
+// -----------------
+
+class VCL_DLLPUBLIC DockingWindow : public Window
+{
+ class ImplData;
+private:
+ FloatingWindow* mpFloatWin;
+ Window* mpOldBorderWin;
+ ImplData* mpImplData;
+ Point maFloatPos;
+ Point maDockPos;
+ Point maMouseOff;
+ Point maMouseStart;
+ Size maRollUpOutSize;
+ Size maMinOutSize;
+ long mnTrackX;
+ long mnTrackY;
+ long mnTrackWidth;
+ long mnTrackHeight;
+ sal_Int32 mnDockLeft;
+ sal_Int32 mnDockTop;
+ sal_Int32 mnDockRight;
+ sal_Int32 mnDockBottom;
+ WinBits mnFloatBits;
+ sal_Bool mbDockCanceled:1,
+ mbDockPrevented:1,
+ mbFloatPrevented:1,
+ mbDockable:1,
+ mbDocking:1,
+ mbDragFull:1,
+ mbLastFloatMode:1,
+ mbStartFloat:1,
+ mbTrackDock:1,
+ mbPined:1,
+ mbRollUp:1,
+ mbDockBtn:1,
+ mbHideBtn:1;
+
+ SAL_DLLPRIVATE void ImplInitDockingWindowData();
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE DockingWindow (const DockingWindow &);
+ SAL_DLLPRIVATE DockingWindow & operator= (const DockingWindow &);
+
+protected:
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings();
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+ SAL_DLLPRIVATE sal_Bool ImplStartDocking( const Point& rPos );
+
+protected:
+ DockingWindow( WindowType nType );
+
+public:
+ DockingWindow( Window* pParent, WinBits nStyle = WB_STDDOCKWIN );
+ DockingWindow( Window* pParent, const ResId& rResId );
+ ~DockingWindow();
+
+ virtual void StartDocking();
+ virtual sal_Bool Docking( const Point& rPos, Rectangle& rRect );
+ virtual void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
+ virtual sal_Bool PrepareToggleFloatingMode();
+ virtual void ToggleFloatingMode();
+
+ virtual void TitleButtonClick( sal_uInt16 nButton );
+ virtual void Pin();
+ virtual void Roll();
+ virtual void PopupModeEnd();
+ virtual void Resizing( Size& rSize );
+ virtual sal_Bool Close();
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void SetPin( sal_Bool bPin );
+ sal_Bool IsPined() const;
+
+ void RollUp();
+ void RollDown();
+ sal_Bool IsRollUp() const;
+
+ void SetRollUpOutputSizePixel( const Size& rSize );
+ Size GetRollUpOutputSizePixel() const;
+
+ void SetMinOutputSizePixel( const Size& rSize );
+ const Size& GetMinOutputSizePixel() const;
+
+ void SetMaxOutputSizePixel( const Size& rSize );
+
+ sal_Bool IsDocking() const { return mbDocking; }
+ sal_Bool IsDockable() const { return mbDockable; }
+ sal_Bool IsDockingCanceled() const { return mbDockCanceled; }
+ sal_Bool IsDockingPrevented() const { return mbDockPrevented; }
+ sal_Bool IsFloatingPrevented() const { return mbFloatPrevented; }
+
+ void SetFloatingMode( sal_Bool bFloatMode = sal_False );
+ sal_Bool IsFloatingMode() const;
+ FloatingWindow* GetFloatingWindow() const { return mpFloatWin; }
+
+ void SetFloatingPos( const Point& rNewPos );
+ Point GetFloatingPos() const;
+
+ void SetFloatStyle( WinBits nWinStyle );
+ WinBits GetFloatStyle() const;
+
+ virtual void setPosSizePixel( long nX, long nY,
+ long nWidth, long nHeight,
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+ void SetPosSizePixel( const Point& rNewPos,
+ const Size& rNewSize )
+ { Window::SetPosSizePixel( rNewPos, rNewSize ); }
+ Point GetPosPixel() const;
+ Size GetSizePixel() const;
+ void SetOutputSizePixel( const Size& rNewSize );
+ Size GetOutputSizePixel() const;
+};
+
+inline void DockingWindow::SetPin( sal_Bool bPin )
+{
+ if ( mpFloatWin )
+ mpFloatWin->SetPin( bPin );
+ mbPined = bPin;
+}
+
+inline sal_Bool DockingWindow::IsPined() const
+{
+ if ( mpFloatWin )
+ return mpFloatWin->IsPined();
+ return mbPined;
+}
+
+inline void DockingWindow::RollUp()
+{
+ if ( mpFloatWin )
+ mpFloatWin->RollUp();
+ mbRollUp = sal_True;
+}
+
+inline void DockingWindow::RollDown()
+{
+ if ( mpFloatWin )
+ mpFloatWin->RollDown();
+ mbRollUp = sal_False;
+}
+
+inline sal_Bool DockingWindow::IsRollUp() const
+{
+ if ( mpFloatWin )
+ return mpFloatWin->IsRollUp();
+ return mbRollUp;
+}
+
+inline void DockingWindow::SetRollUpOutputSizePixel( const Size& rSize )
+{
+ if ( mpFloatWin )
+ mpFloatWin->SetRollUpOutputSizePixel( rSize );
+ maRollUpOutSize = rSize;
+}
+
+inline Size DockingWindow::GetRollUpOutputSizePixel() const
+{
+ if ( mpFloatWin )
+ return mpFloatWin->GetRollUpOutputSizePixel();
+ return maRollUpOutSize;
+}
+
+inline void DockingWindow::SetMinOutputSizePixel( const Size& rSize )
+{
+ if ( mpFloatWin )
+ mpFloatWin->SetMinOutputSizePixel( rSize );
+ maMinOutSize = rSize;
+}
+
+inline const Size& DockingWindow::GetMinOutputSizePixel() const
+{
+ if ( mpFloatWin )
+ return mpFloatWin->GetMinOutputSizePixel();
+ return maMinOutSize;
+}
+
+inline void DockingWindow::SetFloatingPos( const Point& rNewPos )
+{
+ if ( mpFloatWin )
+ mpFloatWin->SetPosPixel( rNewPos );
+ else
+ maFloatPos = rNewPos;
+}
+
+
+#endif // _SV_DOCKWIN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
new file mode 100644
index 000000000000..488758ab7d4a
--- /dev/null
+++ b/include/vcl/edit.hxx
@@ -0,0 +1,265 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_EDIT_HXX
+#define _SV_EDIT_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/timer.hxx>
+#include <vcl/ctrl.hxx>
+#include <vcl/menu.hxx>
+#include <vcl/dndhelp.hxx>
+#include <com/sun/star/uno/Reference.h>
+
+namespace com {
+namespace sun {
+namespace star {
+namespace i18n {
+ class XBreakIterator;
+ class XExtendedInputSequenceChecker;
+}}}}
+
+struct DDInfo;
+struct Impl_IMEInfos;
+
+// --------------
+// - Edit-Types -
+// --------------
+
+#define EDIT_NOLIMIT STRING_LEN
+#define EDIT_UPDATEDATA_TIMEOUT 350
+
+typedef XubString (*FncGetSpecialChars)( Window* pWin, const Font& rFont );
+
+// --------
+// - Edit -
+// --------
+
+enum AutocompleteAction{ AUTOCOMPLETE_KEYINPUT, AUTOCOMPLETE_TABFORWARD, AUTOCOMPLETE_TABBACKWARD };
+
+class VCL_DLLPUBLIC Edit : public Control, public vcl::unohelper::DragAndDropClient
+{
+private:
+ Edit* mpSubEdit;
+ Timer* mpUpdateDataTimer;
+ DDInfo* mpDDInfo;
+ Impl_IMEInfos* mpIMEInfos;
+ OUStringBuffer maText;
+ OUString maPlaceholderText;
+ OUString maSaveValue;
+ OUString maUndoText;
+ OUString maRedoText;
+ long mnXOffset;
+ Selection maSelection;
+ sal_uInt16 mnAlign;
+ xub_StrLen mnMaxTextLen;
+ sal_Int32 mnWidthInChars;
+ AutocompleteAction meAutocompleteAction;
+ sal_Unicode mcEchoChar;
+ sal_Bool mbModified:1,
+ mbInternModified:1,
+ mbReadOnly:1,
+ mbInsertMode:1,
+ mbClickedInSelection:1,
+ mbIsSubEdit:1,
+ mbInMBDown:1,
+ mbActivePopup:1;
+ Link maModifyHdl;
+ Link maUpdateDataHdl;
+ Link maAutocompleteHdl;
+
+ DECL_DLLPRIVATE_LINK( ImplUpdateDataHdl, void* );
+
+ SAL_DLLPRIVATE bool ImplTruncateToMaxLen( OUString&, sal_uInt32 nSelectionLen ) const;
+ SAL_DLLPRIVATE void ImplInitEditData();
+ SAL_DLLPRIVATE void ImplModified();
+ SAL_DLLPRIVATE OUString ImplGetText() const;
+ SAL_DLLPRIVATE void ImplRepaint( xub_StrLen nStart = 0, xub_StrLen nEnd = STRING_LEN, bool bLayout = false );
+ SAL_DLLPRIVATE void ImplInvalidateOrRepaint( xub_StrLen nStart = 0, xub_StrLen nEnd = STRING_LEN );
+ SAL_DLLPRIVATE void ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode );
+ SAL_DLLPRIVATE void ImplSetText( const OUString& rStr, const Selection* pNewSelection = 0 );
+ SAL_DLLPRIVATE void ImplInsertText( const OUString& rStr, const Selection* pNewSelection = 0, sal_Bool bIsUserInput = sal_False );
+ SAL_DLLPRIVATE OUString ImplGetValidString( const OUString& rString ) const;
+ SAL_DLLPRIVATE void ImplClearBackground( long nXStart, long nXEnd );
+ SAL_DLLPRIVATE void ImplPaintBorder( long nXStart, long nXEnd );
+ SAL_DLLPRIVATE void ImplShowCursor( sal_Bool bOnlyIfVisible = sal_True );
+ SAL_DLLPRIVATE void ImplAlign();
+ SAL_DLLPRIVATE void ImplAlignAndPaint();
+ SAL_DLLPRIVATE xub_StrLen ImplGetCharPos( const Point& rWindowPos ) const;
+ SAL_DLLPRIVATE void ImplSetCursorPos( xub_StrLen nChar, sal_Bool bSelect );
+ SAL_DLLPRIVATE void ImplShowDDCursor();
+ SAL_DLLPRIVATE void ImplHideDDCursor();
+ SAL_DLLPRIVATE sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvt );
+ SAL_DLLPRIVATE void ImplCopyToSelectionClipboard();
+ SAL_DLLPRIVATE void ImplCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
+ SAL_DLLPRIVATE void ImplPaste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
+ SAL_DLLPRIVATE long ImplGetTextYPosition() const;
+ SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > ImplGetInputSequenceChecker() const;
+ SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > ImplGetBreakIterator() const;
+
+protected:
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE void ImplSetSelection( const Selection& rSelection, sal_Bool bPaint = sal_True );
+ SAL_DLLPRIVATE int ImplGetNativeControlType();
+ SAL_DLLPRIVATE long ImplGetExtraOffset() const;
+ static SAL_DLLPRIVATE void ImplInvalidateOutermostBorder( Window* pWin );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener > mxDnDListener;
+
+ // DragAndDropClient
+ using vcl::unohelper::DragAndDropClient::dragEnter;
+ using vcl::unohelper::DragAndDropClient::dragExit;
+ using vcl::unohelper::DragAndDropClient::dragOver;
+ virtual void dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& dsde ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ virtual void FillLayoutData() const;
+ Edit( WindowType nType );
+
+public:
+ // public because needed in button.cxx
+ SAL_DLLPRIVATE bool ImplUseNativeBorder( WinBits nStyle );
+
+ Edit( Window* pParent, WinBits nStyle = WB_BORDER );
+ Edit( Window* pParent, const ResId& rResId );
+ virtual ~Edit();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual Window* GetPreferredKeyInputWindow();
+
+ virtual void Modify();
+ virtual void UpdateData();
+
+ static sal_Bool IsCharInput( const KeyEvent& rKEvt );
+
+ virtual void SetModifyFlag();
+ virtual void ClearModifyFlag();
+ virtual sal_Bool IsModified() const { return mpSubEdit ? mpSubEdit->mbModified : mbModified; }
+
+ virtual void EnableUpdateData( sal_uLong nTimeout = EDIT_UPDATEDATA_TIMEOUT );
+ virtual void DisableUpdateData() { delete mpUpdateDataTimer; mpUpdateDataTimer = NULL; }
+ virtual sal_uLong IsUpdateDataEnabled() const;
+
+ void SetEchoChar( sal_Unicode c );
+ sal_Unicode GetEchoChar() const { return mcEchoChar; }
+
+ virtual void SetReadOnly( sal_Bool bReadOnly = sal_True );
+ virtual sal_Bool IsReadOnly() const { return mbReadOnly; }
+
+ void SetInsertMode( sal_Bool bInsert );
+ sal_Bool IsInsertMode() const;
+
+ virtual void SetMaxTextLen( xub_StrLen nMaxLen = EDIT_NOLIMIT );
+ virtual xub_StrLen GetMaxTextLen() const { return mnMaxTextLen; }
+
+ void SetWidthInChars(sal_Int32 nWidthInChars);
+ sal_Int32 GetWidthInChars() const { return mnWidthInChars; }
+
+ virtual void SetSelection( const Selection& rSelection );
+ virtual const Selection& GetSelection() const;
+
+ virtual void ReplaceSelected( const OUString& rStr );
+ virtual void DeleteSelected();
+ virtual OUString GetSelected() const;
+
+ virtual void Cut();
+ virtual void Copy();
+ virtual void Paste();
+ void Undo();
+
+ virtual void SetText( const OUString& rStr );
+ virtual void SetText( const OUString& rStr, const Selection& rNewSelection );
+ virtual OUString GetText() const;
+
+ virtual void SetPlaceholderText( const OUString& rStr );
+ virtual OUString GetPlaceholderText() const;
+
+ void SaveValue() { maSaveValue = GetText(); }
+ const OUString& GetSavedValue() const { return maSaveValue; }
+
+ virtual void SetModifyHdl( const Link& rLink ) { maModifyHdl = rLink; }
+ virtual const Link& GetModifyHdl() const { return maModifyHdl; }
+ virtual void SetUpdateDataHdl( const Link& rLink ) { maUpdateDataHdl = rLink; }
+
+ void SetSubEdit( Edit* pEdit );
+ Edit* GetSubEdit() const { return mpSubEdit; }
+
+ void SetAutocompleteHdl( const Link& rHdl );
+ const Link& GetAutocompleteHdl() const { return maAutocompleteHdl; }
+ AutocompleteAction GetAutocompleteAction() const { return meAutocompleteAction; }
+
+ virtual Size CalcMinimumSize() const;
+ virtual Size CalcMinimumSizeForText(const OUString &rString) const;
+ virtual Size GetOptimalSize() const;
+ virtual Size CalcSize( sal_uInt16 nChars ) const;
+ virtual xub_StrLen GetMaxVisChars() const;
+
+ xub_StrLen GetCharPos( const Point& rWindowPos ) const;
+
+ // shows a warning box saying "text too long, truncated"
+ static void ShowTruncationWarning( Window* pParent );
+
+ static void SetGetSpecialCharsFunction( FncGetSpecialChars fn );
+ static FncGetSpecialChars GetGetSpecialCharsFunction();
+
+ static PopupMenu* CreatePopupMenu();
+ static void DeletePopupMenu( PopupMenu* pMenu );
+
+ virtual OUString GetSurroundingText() const;
+ virtual Selection GetSurroundingTextSelection() const;
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+
+ // returns the minimum size a bordered Edit should have given the current
+ // global style settings (needed by sc's inputwin.cxx)
+ static Size GetMinimumEditSize();
+};
+
+inline sal_uLong Edit::IsUpdateDataEnabled() const
+{
+ if ( mpUpdateDataTimer )
+ return mpUpdateDataTimer->GetTimeout();
+ else
+ return sal_False;
+}
+
+#endif // _SV_EDIT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/embeddedfontshelper.hxx b/include/vcl/embeddedfontshelper.hxx
new file mode 100644
index 000000000000..0b66e8ab157a
--- /dev/null
+++ b/include/vcl/embeddedfontshelper.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 VCL_EMBEDDEDFONTSHELPER_HXX
+#define VCL_EMBEDDEDFONTSHELPER_HXX
+
+#include <vcl/dllapi.h>
+
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <rtl/ustring.hxx>
+#include <tools/fontenum.hxx>
+#include <vector>
+
+/**
+ Helper functions for handling embedded fonts in documents.
+
+*/
+class VCL_DLLPUBLIC EmbeddedFontsHelper
+{
+public:
+ /// Specification of what kind of operation is allowed when embedding a font
+ enum FontRights
+ {
+ ViewingAllowed, ///< Font may be embedded for viewing the document (but not editing)
+ EditingAllowed ///< Font may be embedded for editing document (implies viewing)
+ };
+
+ /**
+ Returns URL for a font file for the given font, or empty if it does not exist.
+ */
+ static OUString fontFileUrl( const OUString& familyName, FontFamily family, FontItalic italic,
+ FontWeight weight, FontPitch pitch, rtl_TextEncoding encoding, FontRights rights );
+
+ /**
+ Reads a font from the input stream, saves it to a temporary font file and activates the font.
+ @param stream stream of font data
+ @param fontName name of the font (e.g. 'Times New Roman')
+ @param extra additional text to use for name (e.g. to distinguish regular from bold, italic,...), "?" for unique
+ @param key key to xor the data with, from the start until the key's length (not repeated)
+ */
+ static bool addEmbeddedFont( com::sun::star::uno::Reference< com::sun::star::io::XInputStream > stream,
+ const OUString& fontName, const char* extra,
+ std::vector< unsigned char > key = std::vector< unsigned char >());
+
+ /**
+ Returns an URL for a file where to store contents of a given temporary font.
+ The file may or not may not exist yet, and will be cleaned up automatically as appropriate.
+ Use activateTemporaryFont() to actually enable usage of the font.
+
+ @param fontName name of the font (e.g. 'Times New Roman')
+ @param extra additional text to use for name (e.g. to distinguish regular from bold, italic,...), "?" for unique
+ */
+ static OUString fileUrlForTemporaryFont( const OUString& fontName, const char* extra );
+
+ /**
+ Adds the given font to the list of known fonts. The font is used only until application
+ exit.
+
+ @param fontName name of the font (e.g. 'Times New Roman')
+ @param fileUrl URL of the font file
+ */
+ static void activateFont( const OUString& fontName, const OUString& fileUrl );
+
+ /**
+ Returns if the restrictions specified in the font (if present) allow embedding
+ the font for a particular purpose.
+ @param data font data
+ @param size size of the font data
+ @param rights type of operation to be allowed for the font
+ */
+ static bool sufficientFontRights( const void* data, long size, FontRights rights );
+
+ /**
+ Removes all temporary fonts in the path used by fileUrlForTemporaryFont().
+ @internal
+ */
+ static void clearTemporaryFontFiles();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/event.hxx b/include/vcl/event.hxx
new file mode 100644
index 000000000000..e89d52ad1e9a
--- /dev/null
+++ b/include/vcl/event.hxx
@@ -0,0 +1,522 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_EVENT_HXX
+#define _SV_EVENT_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <tools/gen.hxx>
+#include <vcl/keycod.hxx>
+#include <vcl/cmdevt.hxx>
+
+class AllSettings;
+class OutputDevice;
+class Window;
+struct IDataObject;
+
+namespace com { namespace sun { namespace star { namespace awt {
+ struct KeyEvent;
+ struct MouseEvent;
+} } } }
+
+enum TextDirectionality {
+ TextDirectionality_LeftToRight_TopToBottom,
+ TextDirectionality_RightToLeft_TopToBottom,
+ TextDirectionality_TopToBottom_RightToLeft
+};
+
+// ------------
+// - KeyEvent -
+// ------------
+class VCL_DLLPUBLIC KeyEvent
+{
+private:
+ KeyCode maKeyCode;
+ sal_uInt16 mnRepeat;
+ sal_Unicode mnCharCode;
+
+public:
+ KeyEvent();
+ KeyEvent( sal_Unicode nChar, const KeyCode& rKeyCode,
+ sal_uInt16 nRepeat = 0 );
+
+ sal_Unicode GetCharCode() const { return mnCharCode; }
+ const KeyCode& GetKeyCode() const { return maKeyCode; }
+ sal_uInt16 GetRepeat() const { return mnRepeat; }
+
+ KeyEvent LogicalTextDirectionality (TextDirectionality eMode) const;
+ KeyEvent (const KeyEvent& rKeyEvent);
+
+};
+
+inline KeyEvent::KeyEvent()
+{
+ mnCharCode = 0;
+ mnRepeat = 0;
+}
+
+inline KeyEvent::KeyEvent( sal_Unicode nChar, const KeyCode& rKeyCode,
+ sal_uInt16 nRepeat ) :
+ maKeyCode( rKeyCode )
+
+{
+ mnCharCode = nChar;
+ mnRepeat = nRepeat;
+}
+
+// --------------------
+// - MouseEvent-Types -
+// --------------------
+
+// Maus-Move-Modi
+#define MOUSE_SIMPLEMOVE ((sal_uInt16)0x0001)
+#define MOUSE_DRAGMOVE ((sal_uInt16)0x0002)
+#define MOUSE_DRAGCOPY ((sal_uInt16)0x0004)
+#define MOUSE_ENTERWINDOW ((sal_uInt16)0x0010)
+#define MOUSE_LEAVEWINDOW ((sal_uInt16)0x0020)
+#define MOUSE_SYNTHETIC ((sal_uInt16)0x0040)
+#define MOUSE_MODIFIERCHANGED ((sal_uInt16)0x0080)
+
+// Maus-Button-Down/Up-Modi
+#define MOUSE_SIMPLECLICK ((sal_uInt16)0x0001)
+#define MOUSE_SELECT ((sal_uInt16)0x0002)
+#define MOUSE_MULTISELECT ((sal_uInt16)0x0004)
+#define MOUSE_RANGESELECT ((sal_uInt16)0x0008)
+
+// Maus-Buttons
+#define MOUSE_LEFT ((sal_uInt16)0x0001)
+#define MOUSE_MIDDLE ((sal_uInt16)0x0002)
+#define MOUSE_RIGHT ((sal_uInt16)0x0004)
+
+// --------------
+// - MouseEvent -
+// --------------
+
+class VCL_DLLPUBLIC MouseEvent
+{
+private:
+ Point maPos;
+ sal_uInt16 mnMode;
+ sal_uInt16 mnClicks;
+ sal_uInt16 mnCode;
+
+public:
+ MouseEvent();
+ MouseEvent( const Point& rPos, sal_uInt16 nClicks = 1,
+ sal_uInt16 nMode = 0, sal_uInt16 nButtons = 0,
+ sal_uInt16 nModifier = 0 );
+
+ const Point& GetPosPixel() const { return maPos; }
+ sal_uInt16 GetMode() const { return mnMode; }
+ /** inits this vcl KeyEvent with all settings from the given awt event **/
+ MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent );
+
+ sal_uInt16 GetClicks() const { return mnClicks; }
+
+ sal_Bool IsEnterWindow() const
+ { return ((mnMode & MOUSE_ENTERWINDOW) != 0); }
+ sal_Bool IsLeaveWindow() const
+ { return ((mnMode & MOUSE_LEAVEWINDOW) != 0); }
+ sal_Bool IsSynthetic() const
+ { return ((mnMode & MOUSE_SYNTHETIC) != 0); }
+ sal_Bool IsModifierChanged() const
+ { return ((mnMode & MOUSE_MODIFIERCHANGED) != 0); }
+
+ sal_uInt16 GetButtons() const
+ { return (mnCode & (MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)); }
+ sal_Bool IsLeft() const
+ { return ((mnCode & MOUSE_LEFT) != 0); }
+ sal_Bool IsMiddle() const
+ { return ((mnCode & MOUSE_MIDDLE) != 0); }
+ sal_Bool IsRight() const
+ { return ((mnCode & MOUSE_RIGHT) != 0); }
+
+ sal_uInt16 GetModifier() const
+ { return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
+ bool IsShift() const
+ { return ((mnCode & KEY_SHIFT) != 0); }
+ sal_Bool IsMod1() const
+ { return ((mnCode & KEY_MOD1) != 0); }
+ sal_Bool IsMod2() const
+ { return ((mnCode & KEY_MOD2) != 0); }
+ sal_Bool IsMod3() const
+ { return ((mnCode & KEY_MOD3) != 0); }
+};
+
+inline MouseEvent::MouseEvent()
+{
+ mnMode = 0;
+ mnClicks = 0;
+ mnCode = 0;
+}
+
+inline MouseEvent::MouseEvent( const Point& rPos, sal_uInt16 nClicks,
+ sal_uInt16 nMode,
+ sal_uInt16 nButtons, sal_uInt16 nModifier ) :
+ maPos( rPos )
+{
+ mnClicks = nClicks;
+ mnMode = nMode;
+ mnCode = nButtons | nModifier;
+}
+
+class VCL_DLLPUBLIC ZoomEvent
+{
+private:
+ Point maCenter;
+ float mfScale;
+
+public:
+ ZoomEvent() :
+ mfScale( 1 )
+ {
+ }
+
+ ZoomEvent( const Point& rCenter,
+ float fScale ) :
+ maCenter( rCenter ),
+ mfScale( fScale )
+ {
+ }
+
+ const Point& GetCenter() const
+ {
+ return maCenter;
+ }
+
+ float GetScale() const
+ {
+ return mfScale;
+ }
+};
+
+class VCL_DLLPUBLIC ScrollEvent
+{
+private:
+ int mnXOffset;
+ int mnYOffset;
+
+public:
+ ScrollEvent() :
+ mnXOffset( 0 ),
+ mnYOffset( 0 )
+ {
+ }
+
+ ScrollEvent( int xOffset, int yOffset ) :
+ mnXOffset( xOffset ),
+ mnYOffset( yOffset )
+ {
+ }
+
+ int GetXOffset() const
+ {
+ return mnXOffset;
+ }
+
+ int GetYOffset() const
+ {
+ return mnYOffset;
+ }
+};
+
+// -------------
+// - HelpEvent -
+// -------------
+
+#define HELPMODE_CONTEXT ((sal_uInt16)0x0001)
+#define HELPMODE_EXTENDED ((sal_uInt16)0x0002)
+#define HELPMODE_BALLOON ((sal_uInt16)0x0004)
+#define HELPMODE_QUICK ((sal_uInt16)0x0008)
+
+class VCL_DLLPUBLIC HelpEvent
+{
+private:
+ Point maPos;
+ sal_uInt16 mnMode;
+ sal_Bool mbKeyboardActivated;
+
+public:
+ HelpEvent();
+ HelpEvent( sal_uInt16 nHelpMode );
+ HelpEvent( const Point& rMousePos, sal_uInt16 nHelpMode );
+
+ const Point& GetMousePosPixel() const;
+ sal_uInt16 GetMode() const { return mnMode; }
+ sal_Bool KeyboardActivated() const { return mbKeyboardActivated; }
+ void SetKeyboardActivated( sal_Bool bKeyboard ) { mbKeyboardActivated = bKeyboard; }
+};
+
+inline HelpEvent::HelpEvent()
+{
+ mnMode = HELPMODE_CONTEXT;
+ mbKeyboardActivated = sal_True;
+}
+
+inline HelpEvent::HelpEvent( const Point& rMousePos, sal_uInt16 nHelpMode ) :
+ maPos( rMousePos )
+{
+ mnMode = nHelpMode;
+ mbKeyboardActivated = sal_False;
+}
+
+inline HelpEvent::HelpEvent( sal_uInt16 nHelpMode )
+{
+ mnMode = nHelpMode;
+ mbKeyboardActivated = sal_True;
+}
+
+// -----------------
+// - UserDrawEvent -
+// -----------------
+
+class VCL_DLLPUBLIC UserDrawEvent
+{
+private:
+ OutputDevice* mpOutDev;
+ Rectangle maOutRect;
+ sal_uInt16 mnItemId;
+ sal_uInt16 mnStyle;
+
+public:
+ UserDrawEvent();
+ UserDrawEvent( OutputDevice* pOut,
+ const Rectangle& rOutRect,
+ sal_uInt16 nId, sal_uInt16 nStyle = 0 );
+
+ OutputDevice* GetDevice() const { return mpOutDev; }
+ const Rectangle& GetRect() const { return maOutRect; }
+ sal_uInt16 GetItemId() const { return mnItemId; }
+ sal_uInt16 GetStyle() const { return mnStyle; }
+};
+
+inline UserDrawEvent::UserDrawEvent()
+{
+ mpOutDev = NULL;
+ mnItemId = 0;
+ mnStyle = 0;
+}
+
+inline UserDrawEvent::UserDrawEvent( OutputDevice* pOut,
+ const Rectangle& rOutRect,
+ sal_uInt16 nId, sal_uInt16 nStyle ) :
+ maOutRect( rOutRect )
+{
+ mpOutDev = pOut;
+ mnItemId = nId;
+ mnStyle = nStyle;
+}
+
+// ------------------
+// - Tracking-Types -
+// ------------------
+
+#define ENDTRACK_CANCEL ((sal_uInt16)0x0001)
+#define ENDTRACK_KEY ((sal_uInt16)0x0002)
+#define ENDTRACK_FOCUS ((sal_uInt16)0x0004)
+#define ENDTRACK_END ((sal_uInt16)0x1000)
+#define ENDTRACK_DONTCALLHDL ((sal_uInt16)0x8000)
+
+#define TRACKING_REPEAT ((sal_uInt16)0x0100)
+
+// -----------------
+// - TrackingEvent -
+// -----------------
+
+class VCL_DLLPUBLIC TrackingEvent
+{
+private:
+ MouseEvent maMEvt;
+ sal_uInt16 mnFlags;
+
+public:
+ TrackingEvent();
+ TrackingEvent( const MouseEvent& rMEvt,
+ sal_uInt16 nTrackFlags = 0 );
+
+ const MouseEvent& GetMouseEvent() const { return maMEvt; }
+
+ sal_Bool IsTrackingRepeat() const
+ { return ((mnFlags & TRACKING_REPEAT) != 0); }
+
+ sal_Bool IsTrackingEnded() const
+ { return ((mnFlags & ENDTRACK_END) != 0); }
+ sal_Bool IsTrackingCanceled() const
+ { return ((mnFlags & ENDTRACK_CANCEL) != 0); }
+ sal_uInt16 GetTrackingFlags() const { return mnFlags; }
+};
+
+inline TrackingEvent::TrackingEvent()
+{
+ mnFlags = 0;
+}
+
+inline TrackingEvent::TrackingEvent( const MouseEvent& rMEvt,
+ sal_uInt16 nTrackFlags ) :
+ maMEvt( rMEvt )
+{
+ mnFlags = nTrackFlags;
+}
+
+// ---------------
+// - NotifyEvent -
+// ---------------
+
+#define EVENT_MOUSEBUTTONDOWN 1
+#define EVENT_MOUSEBUTTONUP 2
+#define EVENT_MOUSEMOVE 3
+#define EVENT_KEYINPUT 4
+#define EVENT_KEYUP 5
+#define EVENT_GETFOCUS 6
+#define EVENT_LOSEFOCUS 7
+#define EVENT_COMMAND 8
+#define EVENT_DESTROY 9
+#define EVENT_INPUTENABLE 10
+#define EVENT_INPUTDISABLE 11
+#define EVENT_EXECUTEDIALOG 100
+#define EVENT_ENDEXECUTEDIALOG 101
+
+class VCL_DLLPUBLIC NotifyEvent
+{
+private:
+ Window* mpWindow;
+ void* mpData;
+ sal_uInt16 mnType;
+ long mnRetValue;
+
+public:
+ NotifyEvent();
+ NotifyEvent( sal_uInt16 nType,
+ Window* pWindow,
+ const void* pEvent = NULL,
+ long nRet = 0 );
+
+ sal_uInt16 GetType() const { return mnType; }
+ Window* GetWindow() const { return mpWindow; }
+ void* GetData() const { return mpData; }
+
+ void SetReturnValue( long nRet ) { mnRetValue = nRet; }
+ long GetReturnValue() const { return mnRetValue; }
+
+ const KeyEvent* GetKeyEvent() const;
+ const MouseEvent* GetMouseEvent() const;
+ const CommandEvent* GetCommandEvent() const;
+};
+
+inline NotifyEvent::NotifyEvent()
+{
+ mpWindow = NULL;
+ mpData = NULL;
+ mnType = 0;
+ mnRetValue = 0;
+}
+
+inline NotifyEvent::NotifyEvent( sal_uInt16 nType, Window* pWindow,
+ const void* pEvent, long nRet )
+{
+ mpWindow = pWindow;
+ mpData = (void*)pEvent;
+ mnType = nType;
+ mnRetValue = nRet;
+}
+
+inline const KeyEvent* NotifyEvent::GetKeyEvent() const
+{
+ if ( (mnType == EVENT_KEYINPUT) || (mnType == EVENT_KEYUP) )
+ return (const KeyEvent*)mpData;
+ else
+ return NULL;
+}
+
+inline const MouseEvent* NotifyEvent::GetMouseEvent() const
+{
+ if ( (mnType >= EVENT_MOUSEBUTTONDOWN) && (mnType <= EVENT_MOUSEMOVE) )
+ return (const MouseEvent*)mpData;
+ else
+ return NULL;
+}
+
+inline const CommandEvent* NotifyEvent::GetCommandEvent() const
+{
+ if ( mnType == EVENT_COMMAND )
+ return (const CommandEvent*)mpData;
+ else
+ return NULL;
+}
+
+// --------------------
+// - DataChangedEvent -
+// --------------------
+
+#define DATACHANGED_SETTINGS ((sal_uInt16)1)
+#define DATACHANGED_DISPLAY ((sal_uInt16)2)
+#define DATACHANGED_DATETIME ((sal_uInt16)3)
+#define DATACHANGED_FONTS ((sal_uInt16)4)
+#define DATACHANGED_PRINTER ((sal_uInt16)5)
+#define DATACHANGED_FONTSUBSTITUTION ((sal_uInt16)6)
+#define DATACHANGED_USER ((sal_uInt16)10000)
+
+class VCL_DLLPUBLIC DataChangedEvent
+{
+private:
+ void* mpData;
+ sal_uLong mnFlags;
+ sal_uInt16 mnType;
+
+public:
+ DataChangedEvent();
+ DataChangedEvent( sal_uInt16 nType,
+ const void* pData = NULL,
+ sal_uLong nFlags = 0 );
+
+ sal_uInt16 GetType() const { return mnType; }
+ void* GetData() const { return mpData; }
+ sal_uLong GetFlags() const { return mnFlags; }
+
+ const AllSettings* GetOldSettings() const;
+};
+
+inline DataChangedEvent::DataChangedEvent()
+{
+ mpData = NULL;
+ mnFlags = 0;
+ mnType = 0;
+}
+
+inline DataChangedEvent::DataChangedEvent( sal_uInt16 nType,
+ const void* pData,
+ sal_uLong nChangeFlags )
+{
+ mpData = (void*)pData;
+ mnFlags = nChangeFlags;
+ mnType = nType;
+}
+
+inline const AllSettings* DataChangedEvent::GetOldSettings() const
+{
+ if ( mnType == DATACHANGED_SETTINGS )
+ return (const AllSettings*)mpData;
+ else
+ return NULL;
+}
+
+#endif // _SV_EVENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/evntpost.hxx b/include/vcl/evntpost.hxx
new file mode 100644
index 000000000000..3116ab7c58b7
--- /dev/null
+++ b/include/vcl/evntpost.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 _VCL_EVNTPOST_HXX
+#define _VCL_EVNTPOST_HXX
+
+#include <tools/link.hxx>
+#include <vcl/dllapi.h>
+
+//===================================================================
+
+namespace vcl
+{
+ struct UserEvent
+ {
+ sal_uLong m_nWhich;
+ void* m_pData;
+ };
+
+ class VCL_DLLPUBLIC EventPoster
+ {
+ sal_uLong m_nId;
+ Link m_aLink;
+
+ DECL_DLLPRIVATE_LINK( DoEvent_Impl, UserEvent* );
+
+ public:
+ EventPoster( const Link& rLink );
+ ~EventPoster();
+ void Post( UserEvent* pEvent );
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/extoutdevdata.hxx b/include/vcl/extoutdevdata.hxx
new file mode 100644
index 000000000000..2ee5967c473d
--- /dev/null
+++ b/include/vcl/extoutdevdata.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 _VCL_EXTOUTDEVDATA_HXX
+#define _VCL_EXTOUTDEVDATA_HXX
+
+#include <tools/rtti.hxx>
+#include <vcl/dllapi.h>
+
+namespace vcl
+{
+
+class VCL_DLLPUBLIC ExtOutDevData
+{
+public:
+
+ TYPEINFO();
+ virtual ~ExtOutDevData();
+};
+
+}
+
+#endif // _VCL_PDFWRITER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
new file mode 100644
index 000000000000..babab8da29d2
--- /dev/null
+++ b/include/vcl/field.hxx
@@ -0,0 +1,832 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_FIELD_HXX
+#define _SV_FIELD_HXX
+
+#include <vcl/dllapi.h>
+#include <tools/link.hxx>
+#include <tools/date.hxx>
+#include <tools/time.hxx>
+#include <vcl/spinfld.hxx>
+#include <vcl/combobox.hxx>
+#include <tools/fldunit.hxx>
+
+namespace com { namespace sun { namespace star { namespace lang { struct Locale; } } } }
+
+class CalendarWrapper;
+class LocaleDataWrapper;
+class LanguageTag;
+
+// -----------------
+// - FormatterBase -
+// -----------------
+
+class VCL_DLLPUBLIC FormatterBase
+{
+private:
+ Edit* mpField;
+ LocaleDataWrapper* mpLocaleDataWrapper;
+ Link maErrorLink;
+ sal_Bool mbReformat;
+ sal_Bool mbStrictFormat;
+ sal_Bool mbEmptyFieldValue;
+ sal_Bool mbEmptyFieldValueEnabled;
+ sal_Bool mbDefaultLocale;
+
+protected:
+ SAL_DLLPRIVATE void ImplSetText( const OUString& rText, Selection* pNewSel = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplGetEmptyFieldValue() const { return mbEmptyFieldValue; }
+
+ void SetEmptyFieldValueData( sal_Bool bValue ) { mbEmptyFieldValue = bValue; }
+
+ SAL_DLLPRIVATE LocaleDataWrapper& ImplGetLocaleDataWrapper() const;
+ sal_Bool IsDefaultLocale() const { return mbDefaultLocale; }
+
+public:
+ FormatterBase( Edit* pField = NULL );
+ virtual ~FormatterBase();
+
+ const LocaleDataWrapper& GetLocaleDataWrapper() const;
+
+ void SetField( Edit* pField ) { mpField = pField; }
+ Edit* GetField() const { return mpField; }
+
+ sal_Bool MustBeReformatted() const { return mbReformat; }
+ void MarkToBeReformatted( sal_Bool b ) { mbReformat = b; }
+
+ void SetStrictFormat( sal_Bool bStrict );
+ sal_Bool IsStrictFormat() const { return mbStrictFormat; }
+
+ virtual void Reformat();
+ virtual void ReformatAll();
+
+ virtual void SetLocale( const ::com::sun::star::lang::Locale& rLocale );
+ const ::com::sun::star::lang::Locale& GetLocale() const;
+ const LanguageTag& GetLanguageTag() const;
+
+ const AllSettings& GetFieldSettings() const;
+
+ void SetErrorHdl( const Link& rLink ) { maErrorLink = rLink; }
+ const Link& GetErrorHdl() const { return maErrorLink; }
+
+ void SetEmptyFieldValue();
+ sal_Bool IsEmptyFieldValue() const;
+
+ void EnableEmptyFieldValue( sal_Bool bEnable ) { mbEmptyFieldValueEnabled = bEnable; }
+ sal_Bool IsEmptyFieldValueEnabled() const { return mbEmptyFieldValueEnabled; }
+};
+
+
+// --------------------
+// - PatternFormatter -
+// --------------------
+
+#define PATTERN_FORMAT_EMPTYLITERALS ((sal_uInt16)0x0001)
+
+class VCL_DLLPUBLIC PatternFormatter : public FormatterBase
+{
+private:
+ OString m_aEditMask;
+ OUString maFieldString;
+ OUString maLiteralMask;
+ sal_uInt16 mnFormatFlags;
+ sal_Bool mbSameMask;
+ sal_Bool mbInPattKeyInput;
+
+protected:
+ PatternFormatter();
+
+ SAL_DLLPRIVATE void ImplSetMask(const OString& rEditMask,
+ const OUString& rLiteralMask);
+ SAL_DLLPRIVATE sal_Bool ImplIsSameMask() const { return mbSameMask; }
+ SAL_DLLPRIVATE sal_Bool& ImplGetInPattKeyInput() { return mbInPattKeyInput; }
+
+public:
+ ~PatternFormatter();
+
+ virtual void Reformat();
+
+ void SetMask(const OString& rEditMask, const OUString& rLiteralMask );
+ const OString& GetEditMask() const { return m_aEditMask; }
+ const OUString& GetLiteralMask() const { return maLiteralMask; }
+
+ void SetFormatFlags( sal_uInt16 nFlags ) { mnFormatFlags = nFlags; }
+ sal_uInt16 GetFormatFlags() const { return mnFormatFlags; }
+
+ void SetString( const OUString& rStr );
+ OUString GetString() const;
+ sal_Bool IsStringModified() const { return !(GetString() == maFieldString ); }
+};
+
+// --------------------
+// - NumericFormatter -
+// --------------------
+
+class VCL_DLLPUBLIC NumericFormatter : public FormatterBase
+{
+private:
+ SAL_DLLPRIVATE void ImplInit();
+
+protected:
+ sal_Int64 mnFieldValue;
+ sal_Int64 mnLastValue;
+ sal_Int64 mnMin;
+ sal_Int64 mnMax;
+ sal_Int64 mnCorrectedValue;
+ sal_uInt16 mnType;
+ sal_uInt16 mnDecimalDigits;
+ sal_Bool mbThousandSep;
+ sal_Bool mbShowTrailingZeros;
+
+ // the members below are used in all derivatives of NumericFormatter
+ // not in NumericFormatter itself.
+ sal_Int64 mnSpinSize;
+ sal_Int64 mnFirst;
+ sal_Int64 mnLast;
+
+protected:
+ NumericFormatter();
+
+ void FieldUp();
+ void FieldDown();
+ void FieldFirst();
+ void FieldLast();
+
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE sal_Bool ImplNumericReformat( const OUString& rStr, sal_Int64& rValue, OUString& rOutStr );
+ SAL_DLLPRIVATE void ImplNewFieldValue( sal_Int64 nNewValue );
+ SAL_DLLPRIVATE void ImplSetUserValue( sal_Int64 nNewValue, Selection* pNewSelection = NULL );
+
+public:
+ ~NumericFormatter();
+
+ virtual void Reformat();
+
+ void SetMin( sal_Int64 nNewMin );
+ sal_Int64 GetMin() const { return mnMin; }
+ void SetMax( sal_Int64 nNewMax );
+ sal_Int64 GetMax() const { return mnMax; }
+
+ void SetFirst( sal_Int64 nNewFirst ) { mnFirst = nNewFirst; }
+ sal_Int64 GetFirst() const { return mnFirst; }
+ void SetLast( sal_Int64 nNewLast ) { mnLast = nNewLast; }
+ sal_Int64 GetLast() const { return mnLast; }
+ void SetSpinSize( sal_Int64 nNewSize ) { mnSpinSize = nNewSize; }
+ sal_Int64 GetSpinSize() const { return mnSpinSize; }
+
+ void SetDecimalDigits( sal_uInt16 nDigits );
+ sal_uInt16 GetDecimalDigits() const;
+
+ void SetUseThousandSep( sal_Bool b );
+ sal_Bool IsUseThousandSep() const { return mbThousandSep; }
+
+ void SetShowTrailingZeros( sal_Bool bShowTrailingZeros );
+ sal_Bool IsShowTrailingZeros() const { return mbShowTrailingZeros; }
+
+
+ void SetUserValue( sal_Int64 nNewValue );
+ virtual void SetValue( sal_Int64 nNewValue );
+ virtual sal_Int64 GetValue() const;
+ virtual OUString CreateFieldText( sal_Int64 nValue ) const;
+ sal_Bool IsValueModified() const;
+ sal_Int64 GetCorrectedValue() const { return mnCorrectedValue; }
+
+ sal_Int64 Normalize( sal_Int64 nValue ) const;
+ sal_Int64 Denormalize( sal_Int64 nValue ) const;
+};
+
+// -------------------
+// - MetricFormatter -
+// -------------------
+
+class VCL_DLLPUBLIC MetricFormatter : public NumericFormatter
+{
+private:
+ SAL_DLLPRIVATE void ImplInit();
+
+protected:
+ OUString maCustomUnitText;
+ OUString maCurUnitText;
+ sal_Int64 mnBaseValue;
+ FieldUnit meUnit;
+ Link maCustomConvertLink;
+
+protected:
+ MetricFormatter();
+
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE sal_Bool ImplMetricReformat( const OUString& rStr, double& rValue, OUString& rOutStr );
+
+public:
+ ~MetricFormatter();
+
+ virtual void CustomConvert() = 0;
+ virtual void Reformat();
+
+ virtual void SetUnit( FieldUnit meUnit );
+ FieldUnit GetUnit() const { return meUnit; }
+ void SetCustomUnitText( const OUString& rStr );
+ const OUString& GetCustomUnitText() const { return maCustomUnitText; }
+ const OUString& GetCurUnitText() const { return maCurUnitText; }
+
+ using NumericFormatter::SetMax;
+ void SetMax( sal_Int64 nNewMax, FieldUnit eInUnit );
+ using NumericFormatter::GetMax;
+ sal_Int64 GetMax( FieldUnit eOutUnit ) const;
+ using NumericFormatter::SetMin;
+ void SetMin( sal_Int64 nNewMin, FieldUnit eInUnit );
+ using NumericFormatter::GetMin;
+ sal_Int64 GetMin( FieldUnit eOutUnit ) const;
+ void SetBaseValue( sal_Int64 nNewBase, FieldUnit eInUnit = FUNIT_NONE );
+ sal_Int64 GetBaseValue( FieldUnit eOutUnit = FUNIT_NONE ) const;
+
+ virtual void SetValue( sal_Int64 nNewValue, FieldUnit eInUnit );
+ virtual void SetValue( sal_Int64 nValue );
+ using NumericFormatter::SetUserValue;
+ void SetUserValue( sal_Int64 nNewValue, FieldUnit eInUnit );
+ virtual sal_Int64 GetValue( FieldUnit eOutUnit ) const;
+ virtual sal_Int64 GetValue() const;
+ virtual OUString CreateFieldText( sal_Int64 nValue ) const;
+ using NumericFormatter::GetCorrectedValue;
+ sal_Int64 GetCorrectedValue( FieldUnit eOutUnit ) const;
+
+ void SetCustomConvertHdl( const Link& rLink ) { maCustomConvertLink = rLink; }
+ const Link& GetCustomConvertHdl() const { return maCustomConvertLink; }
+};
+
+
+// ---------------------
+// - CurrencyFormatter -
+// ---------------------
+
+class VCL_DLLPUBLIC CurrencyFormatter : public NumericFormatter
+{
+private:
+ SAL_DLLPRIVATE void ImplInit();
+
+protected:
+ CurrencyFormatter();
+ SAL_DLLPRIVATE sal_Bool ImplCurrencyReformat( const OUString& rStr, OUString& rOutStr );
+
+public:
+ ~CurrencyFormatter();
+
+ virtual void Reformat();
+
+ String GetCurrencySymbol() const;
+
+ virtual void SetValue( sal_Int64 nNewValue );
+ virtual sal_Int64 GetValue() const;
+ virtual OUString CreateFieldText( sal_Int64 nValue ) const;
+};
+
+
+// -----------------
+// - DateFormatter -
+// -----------------
+
+class VCL_DLLPUBLIC DateFormatter : public FormatterBase
+{
+private:
+ CalendarWrapper* mpCalendarWrapper;
+ Date maFieldDate;
+ Date maLastDate;
+ Date maMin;
+ Date maMax;
+ Date maCorrectedDate;
+ sal_Bool mbLongFormat;
+ sal_Bool mbShowDateCentury;
+ sal_uInt16 mnDateFormat;
+ sal_uLong mnExtDateFormat;
+ sal_Bool mbEnforceValidValue;
+
+ SAL_DLLPRIVATE void ImplInit();
+
+protected:
+ DateFormatter();
+
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE const Date& ImplGetFieldDate() const { return maFieldDate; }
+ SAL_DLLPRIVATE sal_Bool ImplDateReformat( const OUString& rStr, OUString& rOutStr,
+ const AllSettings& rSettings );
+ SAL_DLLPRIVATE void ImplSetUserDate( const Date& rNewDate,
+ Selection* pNewSelection = NULL );
+ SAL_DLLPRIVATE OUString ImplGetDateAsText( const Date& rDate,
+ const AllSettings& rSettings ) const;
+ SAL_DLLPRIVATE void ImplNewFieldValue( const Date& rDate );
+ CalendarWrapper& GetCalendarWrapper() const;
+
+ SAL_DLLPRIVATE sal_Bool ImplAllowMalformedInput() const;
+
+public:
+ ~DateFormatter();
+
+ virtual void Reformat();
+ virtual void ReformatAll();
+
+ virtual void SetLocale( const ::com::sun::star::lang::Locale& rLocale );
+
+
+ void SetExtDateFormat( ExtDateFieldFormat eFormat );
+ ExtDateFieldFormat GetExtDateFormat( sal_Bool bResolveSystemFormat = sal_False ) const;
+
+ void SetMin( const Date& rNewMin );
+ const Date& GetMin() const { return maMin; }
+
+ void SetMax( const Date& rNewMax );
+ const Date& GetMax() const { return maMax; }
+
+
+ // --------------------------------------------------------------
+ // MT: Remove these methods too, ExtDateFormat should be enough!
+ // What should happen if using DDMMYYYY, but ShowCentury=sal_False?
+ // --------------------------------------------------------------
+ void SetLongFormat( sal_Bool bLong );
+ sal_Bool IsLongFormat() const { return mbLongFormat; }
+ void SetShowDateCentury( sal_Bool bShowCentury );
+ sal_Bool IsShowDateCentury() const { return mbShowDateCentury; }
+ // --------------------------------------------------------------
+
+ void SetDate( const Date& rNewDate );
+ void SetUserDate( const Date& rNewDate );
+ Date GetDate() const;
+ void SetEmptyDate();
+ sal_Bool IsEmptyDate() const;
+ Date GetCorrectedDate() const { return maCorrectedDate; }
+
+ void ResetLastDate() { maLastDate = Date( 0, 0, 0 ); }
+
+ static void ExpandCentury( Date& rDate );
+ static void ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart );
+
+ static Date GetInvalidDate() { return Date( 0, 0, 0 ); }
+
+ /** enables or disables the enforcement of valid values
+
+ If this is set to <TRUE/> (which is the default), then GetDate will always return a valid
+ date, no matter whether the current text can really be interpreted as date. (Note: this
+ is the compatible bahavior).
+
+ If this is set to <FALSE/>, the GetDate will return GetInvalidDate, in case the current text
+ cannot be interpreted as date.
+
+ In addition, if this is set to <FALSE/>, the text in the field will <em>not</em> be corrected
+ when the control loses the focus - instead, the invalid input will be preserved.
+ */
+ void EnforceValidValue( sal_Bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
+ inline sal_Bool IsEnforceValidValue( ) const { return mbEnforceValidValue; }
+};
+
+
+// -----------------
+// - TimeFormatter -
+// -----------------
+
+class VCL_DLLPUBLIC TimeFormatter : public FormatterBase
+{
+private:
+ Time maLastTime;
+ Time maMin;
+ Time maMax;
+ Time maCorrectedTime;
+ TimeFieldFormat meFormat;
+ sal_uInt16 mnTimeFormat;
+ sal_Bool mbDuration;
+ sal_Bool mbEnforceValidValue;
+
+ SAL_DLLPRIVATE void ImplInit();
+
+protected:
+ Time maFieldTime;
+
+ TimeFormatter();
+
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE sal_Bool ImplTimeReformat( const OUString& rStr, OUString& rOutStr );
+ SAL_DLLPRIVATE void ImplNewFieldValue( const Time& rTime );
+ SAL_DLLPRIVATE void ImplSetUserTime( const Time& rNewTime, Selection* pNewSelection = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplAllowMalformedInput() const;
+
+public:
+
+ enum TimeFormat {
+ HOUR_12,
+ HOUR_24
+ };
+
+ ~TimeFormatter();
+
+ virtual void Reformat();
+ virtual void ReformatAll();
+
+ void SetMin( const Time& rNewMin );
+ const Time& GetMin() const { return maMin; }
+ void SetMax( const Time& rNewMax );
+ const Time& GetMax() const { return maMax; }
+
+ void SetTimeFormat( TimeFormat eNewFormat );
+ TimeFormat GetTimeFormat() const;
+
+ void SetFormat( TimeFieldFormat eNewFormat );
+ TimeFieldFormat GetFormat() const { return meFormat; }
+
+ void SetDuration( sal_Bool mbDuration );
+ sal_Bool IsDuration() const { return mbDuration; }
+
+ void SetTime( const Time& rNewTime );
+ void SetUserTime( const Time& rNewTime );
+ Time GetTime() const;
+ void SetEmptyTime() { FormatterBase::SetEmptyFieldValue(); }
+ sal_Bool IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); }
+ Time GetCorrectedTime() const { return maCorrectedTime; }
+
+ static Time GetInvalidTime() { return Time( 99, 99, 99 ); }
+
+ /** enables or disables the enforcement of valid values
+
+ If this is set to <TRUE/> (which is the default), then GetTime will always return a valid
+ time, no matter whether the current text can really be interpreted as time. (Note: this
+ is the compatible bahavior).
+
+ If this is set to <FALSE/>, the GetTime will return GetInvalidTime, in case the current text
+ cannot be interpreted as time.
+
+ In addition, if this is set to <FALSE/>, the text in the field will <em>not</em> be corrected
+ when the control loses the focus - instead, the invalid input will be preserved.
+ */
+ void EnforceValidValue( sal_Bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
+ inline sal_Bool IsEnforceValidValue( ) const { return mbEnforceValidValue; }
+};
+
+
+// ----------------
+// - PatternField -
+// ----------------
+
+class VCL_DLLPUBLIC PatternField : public SpinField, public PatternFormatter
+{
+public:
+ PatternField( Window* pParent, WinBits nWinStyle );
+ ~PatternField();
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void Modify();
+};
+
+
+// ----------------
+// - NumericField -
+// ----------------
+
+class VCL_DLLPUBLIC NumericField : public SpinField, public NumericFormatter
+{
+protected:
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+ NumericField( Window* pParent, WinBits nWinStyle );
+ NumericField( Window* pParent, const ResId& rResId );
+ ~NumericField();
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual Size CalcMinimumSize() const;
+
+ virtual void Modify();
+
+ virtual void Up();
+ virtual void Down();
+ virtual void First();
+ virtual void Last();
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+};
+
+
+// ----------------
+// - MetricField -
+// ----------------
+
+class VCL_DLLPUBLIC MetricField : public SpinField, public MetricFormatter
+{
+protected:
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+ MetricField( Window* pParent, WinBits nWinStyle );
+ MetricField( Window* pParent, const ResId& rResId );
+ ~MetricField();
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual Size CalcMinimumSize() const;
+
+ virtual void Modify();
+
+ virtual void Up();
+ virtual void Down();
+ virtual void First();
+ virtual void Last();
+ virtual void CustomConvert();
+
+ virtual void SetUnit( FieldUnit meUnit );
+
+ void SetFirst( sal_Int64 nNewFirst, FieldUnit eInUnit );
+ inline void SetFirst(sal_Int64 first) { SetFirst(first, FUNIT_NONE); }
+ sal_Int64 GetFirst( FieldUnit eOutUnit ) const;
+ inline sal_Int64 GetFirst() const { return GetFirst(FUNIT_NONE); }
+ void SetLast( sal_Int64 nNewLast, FieldUnit eInUnit );
+ inline void SetLast(sal_Int64 last) { SetLast(last, FUNIT_NONE); }
+ sal_Int64 GetLast( FieldUnit eOutUnit ) const;
+ inline sal_Int64 GetLast() const { return GetLast(FUNIT_NONE); }
+
+ static void SetDefaultUnit( FieldUnit eDefaultUnit );
+ static FieldUnit GetDefaultUnit();
+ static sal_Int64 ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
+ FieldUnit eInUnit, FieldUnit eOutUnit );
+ static sal_Int64 ConvertValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
+ MapUnit eInUnit, FieldUnit eOutUnit );
+
+ // for backwards compatibility
+ // caution: conversion to double loses precision
+ static double ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
+ FieldUnit eInUnit, FieldUnit eOutUnit );
+ static double ConvertDoubleValue( double nValue, sal_uInt16 nDecDigits,
+ FieldUnit eInUnit, MapUnit eOutUnit );
+ static double ConvertDoubleValue( double nValue, sal_uInt16 nDecDigits,
+ MapUnit eInUnit, FieldUnit eOutUnit );
+
+ // for backwards compatibility
+ // caution: conversion to double loses precision
+ static double ConvertDoubleValue( sal_Int64 nValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits,
+ FieldUnit eInUnit, FieldUnit eOutUnit )
+ { return ConvertDoubleValue( static_cast<double>(nValue), nBaseValue, nDecDigits, eInUnit, eOutUnit ); }
+ static double ConvertDoubleValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
+ FieldUnit eInUnit, MapUnit eOutUnit )
+ { return ConvertDoubleValue( static_cast<double>(nValue), nDecDigits, eInUnit, eOutUnit ); }
+ static double ConvertDoubleValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
+ MapUnit eInUnit, FieldUnit eOutUnit )
+ { return ConvertDoubleValue( static_cast<double>(nValue), nDecDigits, eInUnit, eOutUnit ); }
+
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+};
+
+
+// -----------------
+// - CurrencyField -
+// -----------------
+
+class VCL_DLLPUBLIC CurrencyField : public SpinField, public CurrencyFormatter
+{
+public:
+ CurrencyField( Window* pParent, WinBits nWinStyle );
+
+ ~CurrencyField();
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Modify();
+
+ virtual void Up();
+ virtual void Down();
+ virtual void First();
+ virtual void Last();
+};
+
+
+// -------------
+// - DateField -
+// -------------
+
+class VCL_DLLPUBLIC DateField : public SpinField, public DateFormatter
+{
+private:
+ Date maFirst;
+ Date maLast;
+
+protected:
+ SAL_DLLPRIVATE void ImplDateSpinArea( sal_Bool bUp );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+ DateField( Window* pParent, WinBits nWinStyle );
+ DateField( Window* pParent, const ResId& rResId );
+ ~DateField();
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Modify();
+
+ virtual void Up();
+ virtual void Down();
+ virtual void First();
+ virtual void Last();
+
+ void SetFirst( const Date& rNewFirst ) { maFirst = rNewFirst; }
+ Date GetFirst() const { return maFirst; }
+ void SetLast( const Date& rNewLast ) { maLast = rNewLast; }
+ Date GetLast() const { return maLast; }
+};
+
+// -------------
+// - TimeField -
+// -------------
+
+class VCL_DLLPUBLIC TimeField : public SpinField, public TimeFormatter
+{
+private:
+ Time maFirst;
+ Time maLast;
+
+protected:
+ SAL_DLLPRIVATE void ImplTimeSpinArea( sal_Bool bUp );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+ TimeField( Window* pParent, WinBits nWinStyle );
+ TimeField( Window* pParent, const ResId& rResId );
+ ~TimeField();
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Modify();
+
+ virtual void Up();
+ virtual void Down();
+ virtual void First();
+ virtual void Last();
+
+ void SetFirst( const Time& rNewFirst ) { maFirst = rNewFirst; }
+ Time GetFirst() const { return maFirst; }
+ void SetLast( const Time& rNewLast ) { maLast = rNewLast; }
+ Time GetLast() const { return maLast; }
+
+ void SetExtFormat( ExtTimeFieldFormat eFormat );
+};
+
+
+// --------------
+// - PatternBox -
+// --------------
+
+class VCL_DLLPUBLIC PatternBox : public ComboBox, public PatternFormatter
+{
+public:
+ PatternBox( Window* pParent, WinBits nWinStyle );
+ ~PatternBox();
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ virtual void Modify();
+
+ virtual void ReformatAll();
+};
+
+
+// --------------
+// - NumericBox -
+// --------------
+
+class VCL_DLLPUBLIC NumericBox : public ComboBox, public NumericFormatter
+{
+public:
+ NumericBox( Window* pParent, WinBits nWinStyle );
+ NumericBox( Window* pParent, const ResId& rResId );
+ ~NumericBox();
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Modify();
+
+ virtual void ReformatAll();
+
+ void InsertValue( sal_Int64 nValue, sal_uInt16 nPos = COMBOBOX_APPEND );
+};
+
+
+// -------------
+// - MetricBox -
+// -------------
+
+class VCL_DLLPUBLIC MetricBox : public ComboBox, public MetricFormatter
+{
+public:
+ MetricBox( Window* pParent, WinBits nWinStyle );
+ MetricBox( Window* pParent, const ResId& rResId );
+ ~MetricBox();
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Modify();
+
+ virtual void CustomConvert();
+ virtual void ReformatAll();
+
+ void InsertValue( sal_Int64 nValue, FieldUnit eInUnit = FUNIT_NONE,
+ sal_uInt16 nPos = COMBOBOX_APPEND );
+ sal_Int64 GetValue( sal_uInt16 nPos, FieldUnit eOutUnit = FUNIT_NONE ) const;
+ sal_uInt16 GetValuePos( sal_Int64 nValue,
+ FieldUnit eInUnit = FUNIT_NONE ) const;
+
+ // Needed, because GetValue() with nPos hide these functions
+ virtual sal_Int64 GetValue( FieldUnit eOutUnit ) const;
+ virtual sal_Int64 GetValue() const;
+};
+
+
+// ---------------
+// - CurrencyBox -
+// ---------------
+
+class VCL_DLLPUBLIC CurrencyBox : public ComboBox, public CurrencyFormatter
+{
+public:
+ CurrencyBox( Window* pParent, WinBits nWinStyle );
+ CurrencyBox( Window* pParent, const ResId& rResId );
+ ~CurrencyBox();
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Modify();
+
+ virtual void ReformatAll();
+
+ virtual sal_Int64 GetValue() const;
+};
+
+// -----------
+// - DateBox -
+// -----------
+
+class VCL_DLLPUBLIC DateBox : public ComboBox, public DateFormatter
+{
+public:
+ DateBox( Window* pParent, WinBits nWinStyle );
+ ~DateBox();
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Modify();
+
+ virtual void ReformatAll();
+};
+
+
+// -----------
+// - TimeBox -
+// -----------
+
+class VCL_DLLPUBLIC TimeBox : public ComboBox, public TimeFormatter
+{
+public:
+ TimeBox( Window* pParent, WinBits nWinStyle );
+ ~TimeBox();
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Modify();
+
+ virtual void ReformatAll();
+};
+
+#endif // _SV_FIELD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx
new file mode 100644
index 000000000000..b592d98a48d2
--- /dev/null
+++ b/include/vcl/fixed.hxx
@@ -0,0 +1,208 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_FIXED_HXX
+#define _SV_FIXED_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/bitmap.hxx>
+#include <vcl/ctrl.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/image.hxx>
+
+class UserDrawEvent;
+
+// -------------
+// - FixedText -
+// -------------
+
+class VCL_DLLPUBLIC FixedText : public Control
+{
+private:
+ sal_Int32 m_nMaxWidthChars;
+ sal_Int32 m_nMinWidthChars;
+ Window *m_pMnemonicWindow;
+
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ const Point& rPos, const Size& rSize, bool bFillLayout = false ) const;
+public:
+ SAL_DLLPRIVATE static sal_uInt16 ImplGetTextStyle( WinBits nWinBits );
+protected:
+ virtual void FillLayoutData() const;
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
+
+ virtual Window* getAccessibleRelationLabelFor() const;
+
+public:
+ FixedText( Window* pParent, WinBits nStyle = 0 );
+ FixedText( Window* pParent, const ResId& rResId );
+ ~FixedText();
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void setMaxWidthChars(sal_Int32 nWidth);
+ sal_Int32 getMaxWidthChars() const { return m_nMaxWidthChars; }
+ void setMinWidthChars(sal_Int32 nWidth);
+ sal_Int32 getMinWidthChars() const { return m_nMinWidthChars; }
+ static Size CalcMinimumTextSize(Control const* pControl, long nMaxWidth = 0x7fffffff);
+ static Size getTextDimensions(Control const *pControl, const OUString &rTxt, long nMaxWidth);
+ Size CalcMinimumSize(long nMaxWidth = 0x7fffffff) const;
+ virtual Size GetOptimalSize() const;
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+ void set_mnemonic_widget(Window *pWindow);
+ Window* get_mnemonic_widget() const { return m_pMnemonicWindow; }
+};
+
+class VCL_DLLPUBLIC SelectableFixedText : public Edit
+{
+public:
+ SelectableFixedText( Window* pParent, WinBits nStyle = 0 );
+
+ virtual void LoseFocus();
+};
+
+// -------------
+// - FixedLine -
+// -------------
+
+class VCL_DLLPUBLIC FixedLine : public Control
+{
+private:
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDraw( bool bLayout = false );
+
+protected:
+ virtual void FillLayoutData() const;
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
+
+public:
+ FixedLine( Window* pParent, WinBits nStyle = WB_HORZ );
+ FixedLine( Window* pParent, const ResId& rResId );
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual Size GetOptimalSize() const;
+};
+
+// ---------------
+// - FixedBitmap -
+// ---------------
+
+class VCL_DLLPUBLIC FixedBitmap : public Control
+{
+private:
+ Bitmap maBitmap;
+
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings();
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ const Point& rPos, const Size& rSize );
+
+protected:
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+ FixedBitmap( Window* pParent, WinBits nStyle = 0 );
+ FixedBitmap( Window* pParent, const ResId& rResId );
+ ~FixedBitmap();
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void SetBitmap( const Bitmap& rBitmap );
+ using OutputDevice::GetBitmap;
+ const Bitmap& GetBitmap() const { return maBitmap; }
+};
+
+// --------------
+// - FixedImage -
+// --------------
+
+class VCL_DLLPUBLIC FixedImage : public Control
+{
+private:
+ Image maImage;
+ sal_Bool mbInUserDraw;
+
+private:
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings();
+
+protected:
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ const Point& rPos, const Size& rSize );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+ FixedImage( Window* pParent, WinBits nStyle = 0 );
+ FixedImage( Window* pParent, const ResId& rResId );
+ ~FixedImage();
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+ virtual Size GetOptimalSize() const;
+
+ void SetImage( const Image& rImage );
+ const Image& GetImage() const { return maImage; }
+
+ sal_Bool SetModeImage( const Image& rImage );
+ const Image& GetModeImage( ) const;
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+};
+
+#endif // _SV_FIXED_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/fixedhyper.hxx b/include/vcl/fixedhyper.hxx
new file mode 100644
index 000000000000..b43e4bd7fd6e
--- /dev/null
+++ b/include/vcl/fixedhyper.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 VCL_FIXEDHYPER_HXX
+#define VCL_FIXEDHYPER_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/fixed.hxx>
+
+ //=====================================================================
+ //= FixedHyperlink
+ //=====================================================================
+ class VCL_DLLPUBLIC FixedHyperlink : public FixedText
+ {
+ private:
+ long m_nTextLen;
+ Pointer m_aOldPointer;
+ Link m_aClickHdl;
+ OUString m_sURL;
+
+ /** initializes the font (link color and underline).
+
+ Called by the Ctors.
+ */
+ void Initialize();
+
+ protected:
+ /** overwrites Window::MouseMove().
+
+ Changes the pointer only over the text.
+ */
+ virtual void MouseMove( const MouseEvent& rMEvt );
+
+ /** overwrites Window::MouseButtonUp().
+
+ Calls the set link if the mouse is over the text.
+ */
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+
+ /** overwrites Window::RequestHelp().
+
+ Shows tooltip only if the mouse is over the text.
+ */
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+
+ public:
+ /** ctors
+
+ With ResId or WinBits.
+ */
+ FixedHyperlink( Window* pParent, const ResId& rId );
+ FixedHyperlink( Window* pParent, WinBits nWinStyle = 0 );
+
+ /** dtor
+
+ */
+ virtual ~FixedHyperlink();
+
+ /** overwrites Window::GetFocus().
+
+ Changes the color of the text and shows a focus rectangle.
+ */
+ virtual void GetFocus();
+
+ /** overwrites Window::LoseFocus().
+
+ Changes the color of the text and hides the focus rectangle.
+ */
+ virtual void LoseFocus();
+
+ /** overwrites Window::KeyInput().
+
+ KEY_RETURN and KEY_SPACE calls the link handler.
+ */
+ virtual void KeyInput( const KeyEvent& rKEvt );
+
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+
+
+ /** sets <member>m_aClickHdl</member> with <arg>rLink</arg>.
+
+ <member>m_aClickHdl</member> is called if the text is clicked.
+ */
+ inline void SetClickHdl( const Link& rLink ) { m_aClickHdl = rLink; }
+
+ /** returns <member>m_aClickHdl</member>.
+
+ @return
+ <member>m_aClickHdl</member>
+ */
+ inline const Link& GetClickHdl() const { return m_aClickHdl; }
+
+ // ::FixedHyperbaseLink
+
+ /** sets the URL of the hyperlink and uses it as tooltip. */
+ void SetURL(const OUString& rNewURL);
+
+ /** returns the URL of the hyperlink.
+
+ @return
+ <member>m_sURL</member>
+ */
+ OUString GetURL() const;
+
+ /** sets new text and recalculates the text length. */
+ virtual void SetText(const OUString& rNewDescription);
+ };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
new file mode 100644
index 000000000000..4f29b40e01a5
--- /dev/null
+++ b/include/vcl/floatwin.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 _SV_FLOATWIN_HXX
+#define _SV_FLOATWIN_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/syswin.hxx>
+
+class ToolBox;
+
+// ------------------------
+// - FloatingWindow-Types -
+// ------------------------
+
+#define FLOATWIN_POPUPMODE_ALLOWTEAROFF ((sal_uLong)0x00000001)
+#define FLOATWIN_POPUPMODE_ANIMATIONSLIDE ((sal_uLong)0x00000002)
+#define FLOATWIN_POPUPMODE_NOAUTOARRANGE ((sal_uLong)0x00000004)
+#define FLOATWIN_POPUPMODE_NOANIMATION ((sal_uLong)0x00000008)
+#define FLOATWIN_POPUPMODE_DOWN ((sal_uLong)0x00000010)
+#define FLOATWIN_POPUPMODE_UP ((sal_uLong)0x00000020)
+#define FLOATWIN_POPUPMODE_LEFT ((sal_uLong)0x00000040)
+#define FLOATWIN_POPUPMODE_RIGHT ((sal_uLong)0x00000080)
+#define FLOATWIN_POPUPMODE_NOFOCUSCLOSE ((sal_uLong)0x00000100)
+#define FLOATWIN_POPUPMODE_NOKEYCLOSE ((sal_uLong)0x00000200)
+#define FLOATWIN_POPUPMODE_NOMOUSECLOSE ((sal_uLong)0x00000400)
+#define FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE ((sal_uLong)0x00000800)
+#define FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE ((sal_uLong)0x00001000)
+#define FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ((sal_uLong)0x00002000)
+#define FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK ((sal_uLong)0x00004000)
+#define FLOATWIN_POPUPMODE_NEWLEVEL ((sal_uLong)0x00008000)
+#define FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE ((sal_uLong)0x00010000)
+#define FLOATWIN_POPUPMODE_GRABFOCUS ((sal_uLong)0x00020000)
+
+#define FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0001)
+#define FLOATWIN_POPUPMODEEND_TEAROFF ((sal_uInt16)0x0002)
+#define FLOATWIN_POPUPMODEEND_DONTCALLHDL ((sal_uInt16)0x0004)
+#define FLOATWIN_POPUPMODEEND_CLOSEALL ((sal_uInt16)0x0008)
+
+#define FLOATWIN_TITLE_NORMAL ((sal_uInt16)0x0001)
+#define FLOATWIN_TITLE_TEAROFF ((sal_uInt16)0x0002)
+#define FLOATWIN_TITLE_POPUP ((sal_uInt16)0x0004)
+#define FLOATWIN_TITLE_NONE ((sal_uInt16)0x0008)
+
+// ------------------
+// - FloatingWindow -
+// ------------------
+
+class VCL_DLLPUBLIC FloatingWindow : public SystemWindow
+{
+ class ImplData;
+private:
+ FloatingWindow* mpNextFloat;
+ Window* mpFirstPopupModeWin;
+ ImplData* mpImplData;
+ Rectangle maFloatRect;
+ sal_uLong mnPostId;
+ sal_uLong mnPopupModeFlags;
+ sal_uInt16 mnTitle;
+ sal_uInt16 mnOldTitle;
+ sal_Bool mbInPopupMode;
+ sal_Bool mbPopupMode;
+ sal_Bool mbPopupModeCanceled;
+ sal_Bool mbPopupModeTearOff;
+ sal_Bool mbMouseDown;
+ sal_Bool mbOldSaveBackMode;
+ sal_Bool mbGrabFocus; // act as key input window, although focus is not set
+ sal_Bool mbInCleanUp;
+ Link maPopupModeEndHdl;
+
+ SAL_DLLPRIVATE void ImplCallPopupModeEnd();
+ DECL_DLLPRIVATE_LINK( ImplEndPopupModeHdl, void* );
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE FloatingWindow (const FloatingWindow &);
+ SAL_DLLPRIVATE FloatingWindow & operator= (const FloatingWindow &);
+
+protected:
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings();
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+#define IMPL_FLOATWIN_HITTEST_OUTSIDE ((sal_uInt16)0x0001)
+#define IMPL_FLOATWIN_HITTEST_WINDOW ((sal_uInt16)0x0002)
+#define IMPL_FLOATWIN_HITTEST_RECT ((sal_uInt16)0x0004)
+ SAL_DLLPRIVATE FloatingWindow* ImplFloatHitTest( Window* pReference, const Point& rPos, sal_uInt16& rHitTest );
+ SAL_DLLPRIVATE FloatingWindow* ImplFindLastLevelFloat();
+ SAL_DLLPRIVATE sal_Bool ImplIsFloatPopupModeWindow( const Window* pWindow );
+ SAL_DLLPRIVATE void ImplSetMouseDown() { mbMouseDown = sal_True; }
+ SAL_DLLPRIVATE sal_Bool ImplIsMouseDown() const { return mbMouseDown; }
+ SAL_DLLPRIVATE static Point ImplCalcPos( Window* pWindow,
+ const Rectangle& rRect, sal_uLong nFlags,
+ sal_uInt16& rArrangeIndex );
+ SAL_DLLPRIVATE void ImplEndPopupMode( sal_uInt16 nFlags = 0, sal_uLong nFocusId = 0 );
+ SAL_DLLPRIVATE Rectangle& ImplGetItemEdgeClipRect();
+ SAL_DLLPRIVATE sal_Bool ImplIsInPrivatePopupMode() const { return mbInPopupMode; }
+
+public:
+ FloatingWindow( Window* pParent, WinBits nStyle = WB_STDFLOATWIN );
+ FloatingWindow( Window* pParent, const ResId& rResId );
+ ~FloatingWindow();
+
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void PopupModeEnd();
+
+ void SetTitleType( sal_uInt16 nTitle );
+ sal_uInt16 GetTitleType() const { return mnTitle; }
+
+ void StartPopupMode( const Rectangle& rRect, sal_uLong nFlags = 0 );
+ void StartPopupMode( ToolBox* pBox, sal_uLong nFlags = 0 );
+ void EndPopupMode( sal_uInt16 nFlags = 0 );
+ void AddPopupModeWindow( Window* pWindow );
+ sal_uLong GetPopupModeFlags() const { return mnPopupModeFlags; }
+ void SetPopupModeFlags( sal_uLong nFlags ) { mnPopupModeFlags = nFlags; }
+ sal_Bool IsInPopupMode() const { return mbPopupMode; }
+ sal_Bool IsInCleanUp() const { return mbInCleanUp; }
+ sal_Bool IsPopupModeCanceled() const { return mbPopupModeCanceled; }
+ sal_Bool IsPopupModeTearOff() const { return mbPopupModeTearOff; }
+
+ void SetPopupModeEndHdl( const Link& rLink ) { maPopupModeEndHdl = rLink; }
+ const Link& GetPopupModeEndHdl() const { return maPopupModeEndHdl; }
+
+ sal_Bool GrabsFocus() const { return mbGrabFocus; }
+
+ static Point CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, sal_uLong nFlags, sal_uInt16& rArrangeIndex );
+};
+
+#endif // _SV_FLOATWIN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/fltcall.hxx b/include/vcl/fltcall.hxx
new file mode 100644
index 000000000000..03a634073d95
--- /dev/null
+++ b/include/vcl/fltcall.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 _FLTCALL_HXX
+#define _FLTCALL_HXX
+#include <sal/types.h>
+#include <vcl/field.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <vcl/FilterConfigItem.hxx>
+
+class FilterConfigItem;
+class SvStream;
+class Graphic;
+class Window;
+
+struct FltCallDialogParameter
+{
+
+ Window* pWindow;
+ ResMgr* pResMgr;
+ FieldUnit eFieldUnit;
+ String aFilterExt;
+
+ // In and Out PropertySequence for all filter dialogs
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aFilterData;
+
+ FltCallDialogParameter( Window* pW, ResMgr* pRsMgr, FieldUnit eFiUni ) :
+ pWindow ( pW ),
+ pResMgr ( pRsMgr ),
+ eFieldUnit ( eFiUni ) {};
+};
+
+typedef sal_Bool (*PFilterCall)(SvStream & rStream, Graphic & rGraphic,
+ FilterConfigItem* pConfigItem, sal_Bool bPrefDialog);
+ // Of this type are both export-filter and import-filter functions
+ // rFileName is the complete path to the file to be imported or exported
+ // pCallBack can be NULL. pCallerData is handed to the callback function
+ // pOptionsConfig can be NULL; if not, the group of the config is already set
+ // and may not be changed by this filter!
+ // If bPrefDialog==sal_True, a Preferences-Dialog might be called
+
+typedef sal_Bool ( *PFilterDlgCall )( FltCallDialogParameter& );
+ // Of this type are both export-filter and import-filter functions
+ // hands a pointer to the parent window and to the options config
+ // pOptions and pWindow can be NULL; in this case sal_False is returned,
+ // otherwise the group of the config is already set
+ // and may not be changed by this filter!
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/fntstyle.hxx b/include/vcl/fntstyle.hxx
new file mode 100644
index 000000000000..5e877b3f28fc
--- /dev/null
+++ b/include/vcl/fntstyle.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 _VCL_FNTSTYLE_HXX
+#define _VCL_FNTSTYLE_HXX
+
+#include <tools/solar.h>
+#include <sal/types.h>
+
+// --------------
+// - Font enums -
+// --------------
+
+#ifndef ENUM_FONTRELIEF_DECLARED
+#define ENUM_FONTRELIEF_DECLARED
+
+enum FontRelief { RELIEF_NONE, RELIEF_EMBOSSED, RELIEF_ENGRAVED, FontRelief_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+#endif
+
+// --------------
+// - Font types -
+// --------------
+
+typedef sal_uInt8 FontKerning;
+#define KERNING_FONTSPECIFIC ((FontKerning)0x01)
+#define KERNING_ASIAN ((FontKerning)0x02)
+
+#endif // _VCL_FNTSTYLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx
new file mode 100644
index 000000000000..d886d48b9854
--- /dev/null
+++ b/include/vcl/font.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 _SV_FONT_HXX
+#define _SV_FONT_HXX
+
+#include <sal/types.h>
+#include <vcl/dllapi.h>
+#include <tools/string.hxx>
+#include <i18nlangtag/lang.h>
+#include <tools/color.hxx>
+#include <vcl/vclenum.hxx>
+#include <vcl/fntstyle.hxx>
+
+class SvStream;
+#define FontAlign TextAlign
+
+class Impl_Font;
+class ImplFontAttributes;
+class Size;
+
+// --------
+// - Font -
+// --------
+
+class VCL_DLLPUBLIC Font
+{
+private:
+ Impl_Font* mpImplFont;
+ void MakeUnique();
+
+public:
+ Font();
+ Font( const Font& );
+ Font( const String& rFamilyName, const Size& );
+ Font( const String& rFamilyName, const String& rStyleName, const Size& );
+ Font( FontFamily eFamily, const Size& );
+ ~Font();
+
+ // setting the color on the font is obsolete, the only remaining
+ // valid use is for keeping backward compatibility with old MetaFiles
+ void SetColor( const Color& );
+ const Color& GetColor() const;
+ void SetFillColor( const Color& );
+ const Color& GetFillColor() const;
+ void SetTransparent( sal_Bool bTransparent );
+ sal_Bool IsTransparent() const;
+ void SetAlign( FontAlign );
+ FontAlign GetAlign() const;
+
+ void SetName( const OUString& rFamilyName );
+ const String& GetName() const;
+ void SetStyleName( const String& rStyleName );
+ const String& GetStyleName() const;
+ void SetSize( const Size& );
+ const Size& GetSize() const;
+ void SetHeight( long nHeight );
+ long GetHeight() const;
+ void SetWidth( long nWidth );
+ long GetWidth() const;
+
+ void SetFamily( FontFamily );
+ FontFamily GetFamily() const;
+ void SetCharSet( rtl_TextEncoding );
+ rtl_TextEncoding GetCharSet() const;
+ void SetLanguage( LanguageType );
+ LanguageType GetLanguage() const;
+ void SetCJKContextLanguage( LanguageType );
+ LanguageType GetCJKContextLanguage() const;
+ void SetPitch( FontPitch ePitch );
+ FontPitch GetPitch() const;
+
+ void SetOrientation( short nLineOrientation );
+ short GetOrientation() const;
+ void SetVertical( sal_Bool bVertical );
+ sal_Bool IsVertical() const;
+ void SetKerning( FontKerning nKerning );
+ FontKerning GetKerning() const;
+ sal_Bool IsKerning() const;
+
+ void SetWeight( FontWeight );
+ FontWeight GetWeight() const;
+ void SetWidthType( FontWidth );
+ FontWidth GetWidthType() const;
+ void SetItalic( FontItalic );
+ FontItalic GetItalic() const;
+ void SetOutline( sal_Bool bOutline );
+ sal_Bool IsOutline() const;
+ void SetShadow( sal_Bool bShadow );
+ sal_Bool IsShadow() const;
+ void SetRelief( FontRelief );
+ FontRelief GetRelief() const;
+ void SetUnderline( FontUnderline );
+ FontUnderline GetUnderline() const;
+ void SetOverline( FontUnderline );
+ FontUnderline GetOverline() const;
+ void SetStrikeout( FontStrikeout );
+ FontStrikeout GetStrikeout() const;
+ void SetEmphasisMark( FontEmphasisMark );
+ FontEmphasisMark GetEmphasisMark() const;
+ void SetWordLineMode( sal_Bool bWordLine );
+ sal_Bool IsWordLineMode() const;
+
+ void Merge( const Font& rFont );
+ void GetFontAttributes( ImplFontAttributes& rAttrs ) const;
+
+ Font& operator=( const Font& );
+ sal_Bool operator==( const Font& ) const;
+ sal_Bool operator!=( const Font& rFont ) const
+ { return !(Font::operator==( rFont )); }
+ sal_Bool IsSameInstance( const Font& ) const;
+
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Font& );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Font& );
+
+ static Font identifyFont( const void* pBuffer, sal_uInt32 nLen );
+};
+
+#endif // _VCL_FONT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/fontcapabilities.hxx b/include/vcl/fontcapabilities.hxx
new file mode 100644
index 000000000000..5740b96c3411
--- /dev/null
+++ b/include/vcl/fontcapabilities.hxx
@@ -0,0 +1,204 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 _VCLFONTCAPABILITIES_HXX
+#define _VCLFONTCAPABILITIES_HXX
+
+#include <boost/dynamic_bitset.hpp>
+#include <vector>
+
+//See OS/2 table, i.e. http://www.microsoft.com/typography/otspec/os2.htm#ur
+namespace vcl
+{
+ namespace UnicodeCoverage
+ {
+ enum UnicodeCoverageEnum
+ {
+ BASIC_LATIN = 0,
+ LATIN_1_SUPPLEMENT = 1,
+ LATIN_EXTENDED_A = 2,
+ LATIN_EXTENDED_B = 3,
+ IPA_EXTENSIONS = 4,
+ SPACING_MODIFIER_LETTERS = 5,
+ COMBINING_DIACRITICAL_MARKS = 6,
+ GREEK_AND_COPTIC = 7,
+ COPTIC = 8,
+ CYRILLIC = 9,
+ ARMENIAN = 10,
+ HEBREW = 11,
+ VAI = 12,
+ ARABIC = 13,
+ NKO = 14,
+ DEVANAGARI = 15,
+ BENGALI = 16,
+ GURMUKHI = 17,
+ GUJARATI = 18,
+ ORIYA = 19,
+ TAMIL = 20,
+ TELUGU = 21,
+ KANNADA = 22,
+ MALAYALAM = 23,
+ THAI = 24,
+ LAO = 25,
+ GEORGIAN = 26,
+ BALINESE = 27,
+ HANGUL_JAMO = 28,
+ LATIN_EXTENDED_ADDITIONAL = 29,
+ GREEK_EXTENDED = 30,
+ GENERAL_PUNCTUATION = 31,
+ SUPERSCRIPTS_AND_SUBSCRIPTS = 32,
+ CURRENCY_SYMBOLS = 33,
+ COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS = 34,
+ LETTERLIKE_SYMBOLS = 35,
+ NUMBER_FORMS = 36,
+ ARROWS = 37,
+ MATHEMATICAL_OPERATORS = 38,
+ MISCELLANEOUS_TECHNICAL = 39,
+ CONTROL_PICTURES = 40,
+ OPTICAL_CHARACTER_RECOGNITION = 41,
+ ENCLOSED_ALPHANUMERICS = 42,
+ BOX_DRAWING = 43,
+ BLOCK_ELEMENTS = 44,
+ GEOMETRIC_SHAPES = 45,
+ MISCELLANEOUS_SYMBOLS = 46,
+ DINGBATS = 47,
+ CJK_SYMBOLS_AND_PUNCTUATION = 48,
+ HIRAGANA = 49,
+ KATAKANA = 50,
+ BOPOMOFO = 51,
+ HANGUL_COMPATIBILITY_JAMO = 52,
+ PHAGS_PA = 53,
+ ENCLOSED_CJK_LETTERS_AND_MONTHS = 54,
+ CJK_COMPATIBILITY = 55,
+ HANGUL_SYLLABLES = 56,
+ NONPLANE_0 = 57,
+ PHOENICIAN = 58,
+ CJK_UNIFIED_IDEOGRAPHS = 59,
+ PRIVATE_USE_AREA_PLANE_0 = 60,
+ CJK_STROKES = 61,
+ ALPHABETIC_PRESENTATION_FORMS = 62,
+ ARABIC_PRESENTATION_FORMS_A = 63,
+ COMBINING_HALF_MARKS = 64,
+ VERTICAL_FORMS = 65,
+ SMALL_FORM_VARIANTS = 66,
+ ARABIC_PRESENTATION_FORMS_B = 67,
+ HALFWIDTH_AND_FULLWIDTH_FORMS = 68,
+ SPECIALS = 69,
+ TIBETAN = 70,
+ SYRIAC = 71,
+ THAANA = 72,
+ SINHALA = 73,
+ MYANMAR = 74,
+ ETHIOPIC = 75,
+ CHEROKEE = 76,
+ UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS = 77,
+ OGHAM = 78,
+ RUNIC = 79,
+ KHMER = 80,
+ MONGOLIAN = 81,
+ BRAILLE_PATTERNS = 82,
+ YI_SYLLABLES = 83,
+ TAGALOG = 84,
+ OLD_ITALIC = 85,
+ GOTHIC = 86,
+ DESERET = 87,
+ BYZANTINE_MUSICAL_SYMBOLS = 88,
+ MATHEMATICAL_ALPHANUMERIC_SYMBOLS = 89,
+ PRIVATE_USE_PLANE_15 = 90,
+ VARIATION_SELECTORS = 91,
+ TAGS = 92,
+ LIMBU = 93,
+ TAI_LE = 94,
+ NEW_TAI_LUE = 95,
+ BUGINESE = 96,
+ GLAGOLITIC = 97,
+ TIFINAGH = 98,
+ YIJING_HEXAGRAM_SYMBOLS = 99,
+ SYLOTI_NAGRI = 100,
+ LINEAR_B_SYLLABARY = 101,
+ ANCIENT_GREEK_NUMBERS = 102,
+ UGARITIC = 103,
+ OLD_PERSIAN = 104,
+ SHAVIAN = 105,
+ OSMANYA = 106,
+ CYPRIOT_SYLLABARY = 107,
+ KHAROSHTHI = 108,
+ TAI_XUAN_JING_SYMBOLS = 109,
+ CUNEIFORM = 110,
+ COUNTING_ROD_NUMERALS = 111,
+ SUNDANESE = 112,
+ LEPCHA = 113,
+ OL_CHIKI = 114,
+ SAURASHTRA = 115,
+ KAYAH_LI = 116,
+ REJANG = 117,
+ CHAM = 118,
+ ANCIENT_SYMBOLS = 119,
+ PHAISTOS_DISC = 120,
+ CARIAN = 121,
+ DOMINO_TILES = 122,
+ RESERVED1 = 123,
+ RESERVED2 = 124,
+ RESERVED3 = 125,
+ RESERVED4 = 126,
+ RESERVED5 = 127,
+ MAX_UC_ENUM = 128
+ };
+ };
+
+ namespace CodePageCoverage
+ {
+ enum CodePageCoverageEnum
+ {
+ CP1252 = 0,
+ CP1250 = 1,
+ CP1251 = 2,
+ CP1253 = 3,
+ CP1254 = 4,
+ CP1255 = 5,
+ CP1256 = 6,
+ CP1257 = 7,
+ CP1258 = 8,
+ CP874 = 16,
+ CP932 = 17,
+ CP936 = 18,
+ CP949 = 19,
+ CP950 = 20,
+ CP1361 = 21,
+ CP869 = 48,
+ CP866 = 49,
+ CP865 = 50,
+ CP864 = 51,
+ CP863 = 52,
+ CP862 = 53,
+ CP861 = 54,
+ CP860 = 55,
+ CP857 = 56,
+ CP855 = 57,
+ CP852 = 58,
+ CP775 = 59,
+ CP737 = 60,
+ CP780 = 61,
+ CP850 = 62,
+ CP437 = 63,
+ MAX_CP_ENUM = 64
+ };
+ };
+
+ struct FontCapabilities
+ {
+ boost::dynamic_bitset<sal_uInt32> maUnicodeRange;
+ boost::dynamic_bitset<sal_uInt32> maCodePageRange;
+ std::vector< sal_uInt32 > maGSUBScriptTags;
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/fontmanager.hxx b/include/vcl/fontmanager.hxx
new file mode 100644
index 000000000000..05955f984710
--- /dev/null
+++ b/include/vcl/fontmanager.hxx
@@ -0,0 +1,578 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _PSPRINT_FONTMANAGER_HXX_
+#define _PSPRINT_FONTMANAGER_HXX_
+
+#include <boost/unordered_map.hpp>
+#include <map>
+#include <list>
+#include <set>
+
+#include "vcl/dllapi.h"
+#include "vcl/helper.hxx"
+#include "vcl/timer.hxx"
+#include "vcl/vclenum.hxx"
+#include "com/sun/star/lang/Locale.hpp"
+
+#include <vector>
+
+#define ATOM_FAMILYNAME 2
+#define ATOM_PSNAME 3
+
+/*
+ * some words on metrics: every length returned by PrintFontManager and
+ * friends are PostScript afm style, that is they are 1/1000 font height
+ */
+
+// forward declarations
+namespace utl { class MultiAtomProvider; } // see unotools/atom.hxx
+class FontSubsetInfo;
+class ImplFontOptions;
+class FontSelectPattern;
+
+namespace psp {
+class PPDParser; // see ppdparser.hxx
+
+namespace fonttype
+{
+enum type {
+ Unknown = 0,
+ Type1 = 1,
+ TrueType = 2,
+ Builtin = 3
+};
+}
+
+/*
+ * the difference between FastPrintFontInfo and PrintFontInfo
+ * is that the information in FastPrintFontInfo can usually
+ * be gathered without openening either the font file or
+ * an afm metric file. they are gathered from fonts.dir alone.
+ * if only FastPrintFontInfo is gathered and PrintFontInfo
+ * on demand and for less fonts, then performance in startup
+ * increases considerably
+ */
+
+struct FastPrintFontInfo
+{
+ fontID m_nID; // FontID
+ fonttype::type m_eType;
+
+ // font attributes
+ OUString m_aFamilyName;
+ OUString m_aStyleName;
+ std::list< OUString > m_aAliases;
+ FontFamily m_eFamilyStyle;
+ FontItalic m_eItalic;
+ FontWidth m_eWidth;
+ FontWeight m_eWeight;
+ FontPitch m_ePitch;
+ rtl_TextEncoding m_aEncoding;
+ bool m_bSubsettable;
+ bool m_bEmbeddable;
+
+ FastPrintFontInfo() :
+ m_nID( 0 ),
+ m_eType( fonttype::Unknown ),
+ m_eFamilyStyle( FAMILY_DONTKNOW ),
+ m_eItalic( ITALIC_DONTKNOW ),
+ m_eWidth( WIDTH_DONTKNOW ),
+ m_eWeight( WEIGHT_DONTKNOW ),
+ m_ePitch( PITCH_DONTKNOW ),
+ m_aEncoding( RTL_TEXTENCODING_DONTKNOW )
+ {}
+};
+
+struct PrintFontInfo : public FastPrintFontInfo
+{
+ int m_nAscend;
+ int m_nDescend;
+ int m_nLeading;
+ int m_nWidth;
+
+ PrintFontInfo() :
+ FastPrintFontInfo(),
+ m_nAscend( 0 ),
+ m_nDescend( 0 ),
+ m_nLeading( 0 ),
+ m_nWidth( 0 )
+ {}
+};
+
+// the values are per thousand of the font size
+// note: width, height contain advances, not bounding box
+struct CharacterMetric
+{
+ short int width, height;
+
+ CharacterMetric() : width( 0 ), height( 0 ) {}
+ bool operator==( const CharacterMetric& rOther ) const
+ { return rOther.width == width && rOther.height == height; }
+ bool operator!=( const CharacterMetric& rOther ) const
+ { return rOther.width != width || rOther.height != height; }
+};
+
+struct KernPair
+{
+ sal_Unicode first, second;
+ short int kern_x, kern_y;
+
+ KernPair() : first( 0 ), second( 0 ), kern_x( 0 ), kern_y( 0 ) {}
+};
+
+class FontCache;
+
+// a class to manage printable fonts
+// aims are type1 and truetype fonts
+
+class FontCache;
+
+class VCL_PLUGIN_PUBLIC PrintFontManager
+{
+ struct PrintFont;
+ struct TrueTypeFontFile;
+ struct Type1FontFile;
+ struct BuiltinFont;
+ friend struct PrintFont;
+ friend struct TrueTypeFontFile;
+ friend struct Type1FontFile;
+ friend struct BuiltinFont;
+ friend class FontCache;
+
+ struct PrintFontMetrics
+ {
+ // character metrics are stored by the following keys:
+ // lower two bytes contain a sal_Unicode (a UCS2 character)
+ // upper byte contains: 0 for horizontal metric
+ // 1 for vertical metric
+ // highest byte: 0 for now
+ boost::unordered_map< int, CharacterMetric > m_aMetrics;
+ // contains the unicode blocks for which metrics were queried
+ // this implies that metrics should be queried in terms of
+ // unicode blocks. here a unicode block is identified
+ // by the upper byte of the UCS2 encoding.
+ // note that the corresponding bit should be set even
+ // if the font does not support a single character of that page
+ // this map shows, which pages were queried already
+ // if (like in AFM metrics) all metrics are queried in
+ // a single pass, then all bits should be set
+ char m_aPages[32];
+
+ bool m_bKernPairsQueried;
+ std::list< KernPair > m_aXKernPairs;
+ std::list< KernPair > m_aYKernPairs;
+ boost::unordered_map< sal_Unicode, bool > m_bVerticalSubstitutions;
+
+ PrintFontMetrics() : m_bKernPairsQueried( false ) {}
+
+ bool isEmpty() const { return m_aMetrics.empty(); }
+ };
+
+ struct PrintFont
+ {
+ fonttype::type m_eType;
+
+ // font attributes
+ int m_nFamilyName; // atom
+ std::list< int > m_aAliases;
+ int m_nPSName; // atom
+ OUString m_aStyleName;
+ FontItalic m_eItalic;
+ FontWidth m_eWidth;
+ FontWeight m_eWeight;
+ FontPitch m_ePitch;
+ rtl_TextEncoding m_aEncoding;
+ bool m_bFontEncodingOnly; // set if font should be only accessed by builtin encoding
+ CharacterMetric m_aGlobalMetricX;
+ CharacterMetric m_aGlobalMetricY;
+ PrintFontMetrics* m_pMetrics;
+ int m_nAscend;
+ int m_nDescend;
+ int m_nLeading;
+ int m_nXMin; // font bounding box
+ int m_nYMin;
+ int m_nXMax;
+ int m_nYMax;
+ bool m_bHaveVerticalSubstitutedGlyphs;
+ bool m_bUserOverride;
+
+ std::map< sal_Unicode, sal_Int32 > m_aEncodingVector;
+ std::map< sal_Unicode, OString > m_aNonEncoded;
+
+ PrintFont( fonttype::type eType );
+ virtual ~PrintFont();
+ virtual bool queryMetricPage( int nPage, utl::MultiAtomProvider* pProvider ) = 0;
+
+ bool readAfmMetrics( utl::MultiAtomProvider* pProvider, bool bFillEncodingvector, bool bOnlyGlobalAttributes );
+ };
+
+ struct Type1FontFile : public PrintFont
+ {
+ int m_nDirectory; // atom containing system dependent path
+ OString m_aFontFile; // relative to directory
+ OString m_aMetricFile; // dito
+
+ /* note: m_aFontFile and Metric file are not atoms
+ because they should be fairly unique */
+
+ Type1FontFile() : PrintFont( fonttype::Type1 ), m_nDirectory( 0 ) {}
+ virtual ~Type1FontFile();
+ virtual bool queryMetricPage( int nPage, utl::MultiAtomProvider* pProvider );
+ };
+
+ struct TrueTypeFontFile : public PrintFont
+ {
+ int m_nDirectory; // atom containing system dependent path
+ OString m_aFontFile; // relative to directory
+ int m_nCollectionEntry; // 0 for regular fonts, 0 to ... for fonts stemming from collections
+ unsigned int m_nTypeFlags; // copyright bits and PS-OpenType flag
+
+ TrueTypeFontFile();
+ virtual ~TrueTypeFontFile();
+ virtual bool queryMetricPage( int nPage, utl::MultiAtomProvider* pProvider );
+ };
+
+ struct BuiltinFont : public PrintFont
+ {
+ int m_nDirectory; // atom containing system dependent path
+ OString m_aMetricFile;
+
+ BuiltinFont() : PrintFont( fonttype::Builtin ) {}
+ virtual ~BuiltinFont();
+ virtual bool queryMetricPage( int nPage, utl::MultiAtomProvider* pProvider );
+ };
+
+ fontID m_nNextFontID;
+ boost::unordered_map< fontID, PrintFont* > m_aFonts;
+ boost::unordered_map< int, FontFamily > m_aFamilyTypes;
+ std::list< OUString > m_aPrinterDrivers;
+ std::list< OString > m_aFontDirectories;
+ std::list< int > m_aPrivateFontDirectories;
+ utl::MultiAtomProvider* m_pAtoms;
+ // for speeding up findFontFileID
+ boost::unordered_map< OString, std::set< fontID >, OStringHash >
+ m_aFontFileToFontID;
+
+ boost::unordered_map< OString, int, OStringHash >
+ m_aDirToAtom;
+ boost::unordered_map< int, OString > m_aAtomToDir;
+ int m_nNextDirAtom;
+
+ boost::unordered_multimap< OString, sal_Unicode, OStringHash >
+ m_aAdobenameToUnicode;
+ boost::unordered_multimap< sal_Unicode, OString >
+ m_aUnicodeToAdobename;
+ boost::unordered_multimap< sal_Unicode, sal_uInt8 > m_aUnicodeToAdobecode;
+ boost::unordered_multimap< sal_uInt8, sal_Unicode > m_aAdobecodeToUnicode;
+
+ mutable FontCache* m_pFontCache;
+
+ mutable std::vector< fontID > m_aOverrideFonts;
+
+ OString getAfmFile( PrintFont* pFont ) const;
+ OString getFontFile( PrintFont* pFont ) const;
+
+ bool analyzeFontFile( int nDirID, const OString& rFileName, std::list< PrintFont* >& rNewFonts, const char *pFormat=NULL ) const;
+ OUString convertTrueTypeName( void* pNameRecord ) const; // actually a NameRecord* formt font subsetting code
+ void analyzeTrueTypeFamilyName( void* pTTFont, std::list< OUString >& rnames ) const; // actually a TrueTypeFont* from font subsetting code
+ bool analyzeTrueTypeFile( PrintFont* pFont ) const;
+ // finds the font id for the nFaceIndex face in this font file
+ // There may be multiple font ids for TrueType collections
+ fontID findFontFileID( int nDirID, const OString& rFile, int nFaceIndex ) const;
+
+ // There may be multiple font ids for TrueType collections
+ std::vector<fontID> findFontFileIDs( int nDirID, const OString& rFile ) const;
+
+ bool knownFontFile( int nDirID, const OString& rFile ) const
+ {
+ return findFontFileID(nDirID, rFile, 0) != 0;
+ }
+
+ fontID findFontBuiltinID( int nPSNameAtom ) const;
+
+ FontFamily matchFamilyName( const OUString& rFamily ) const;
+
+ PrintFont* getFont( fontID nID ) const
+ {
+ boost::unordered_map< fontID, PrintFont* >::const_iterator it;
+ it = m_aFonts.find( nID );
+ return it == m_aFonts.end() ? NULL : it->second;
+ }
+ void fillPrintFontInfo( PrintFont* pFont, FastPrintFontInfo& rInfo ) const;
+ void fillPrintFontInfo( PrintFont* pFont, PrintFontInfo& rInfo ) const;
+
+ OString getDirectory( int nAtom ) const;
+ int getDirectoryAtom( const OString& rDirectory, bool bCreate = false );
+
+ /* try to initialize fonts from libfontconfig
+
+ called from <code>initialize()</code>
+ */
+ void initFontconfig();
+ void countFontconfigFonts( boost::unordered_map<OString, int, OStringHash>& o_rVisitedPaths );
+ /* deinitialize fontconfig
+ */
+ void deinitFontconfig();
+
+ /* register an application specific font directory for libfontconfig
+
+ since fontconfig is asked for font substitutes before OOo will check for font availability
+ and fontconfig will happily substitute fonts it doesn't know (e.g. "Arial Narrow" -> "DejaVu Sans Book"!)
+ it becomes necessary to tell the library about all the hidden font treasures
+
+ @returns
+ true if libfontconfig accepted the directory
+ false else (e.g. no libfontconfig found)
+ */
+ bool addFontconfigDir(const OString& rDirectory);
+
+ bool readOverrideMetrics();
+
+ std::set<OString> m_aPreviousLangSupportRequests;
+ std::vector<OString> m_aCurrentRequests;
+ Timer m_aFontInstallerTimer;
+
+ DECL_LINK( autoInstallFontLangSupport, void* );
+
+ PrintFontManager();
+ ~PrintFontManager();
+public:
+ static PrintFontManager& get(); // one instance only
+
+ // There may be multiple font ids for TrueType collections
+ std::vector<fontID> addFontFile( const OString& rFileName );
+
+ void initialize();
+
+ // returns the number of managed fonts
+ int getFontCount() const { return m_aFonts.size(); }
+
+ // caution: the getFontList* methods can change the font list on demand
+ // depending on the pParser argument. That is getFontCount() may
+ // return a larger value after getFontList()
+
+ // returns the ids of all managed fonts. on pParser != NULL
+ // all fonttype::Builtin type fonts are not listed
+ // which do not occur in the PPD of pParser
+ void getFontList( std::list< fontID >& rFontIDs, const PPDParser* pParser = NULL, bool bUseOverrideMetrics = false );
+ // get the font list and fast font info. see getFontList for pParser
+ void getFontListWithFastInfo( std::list< FastPrintFontInfo >& rFonts, const PPDParser* pParser = NULL, bool bUseOverrideMetrics = false );
+
+ // get font info for a specific font
+ bool getFontInfo( fontID nFontID, PrintFontInfo& rInfo ) const;
+ // get fast font info for a specific font
+ bool getFontFastInfo( fontID nFontID, FastPrintFontInfo& rInfo ) const;
+
+ // routines to get font info in small pieces
+
+ // get a specific fonts PSName name
+ const OUString& getPSName( fontID nFontID ) const;
+
+ // get a specific fonts family name aliases
+ void getFontFamilyAliases( fontID nFontID ) const;
+
+ // get a specific fonts type
+ fonttype::type getFontType( fontID nFontID ) const
+ {
+ PrintFont* pFont = getFont( nFontID );
+ return pFont ? pFont->m_eType : fonttype::Unknown;
+ }
+
+ // get a specific fonts italic type
+ FontItalic getFontItalic( fontID nFontID ) const
+ {
+ PrintFont* pFont = getFont( nFontID );
+ return pFont ? pFont->m_eItalic : ITALIC_DONTKNOW;
+ }
+
+ // get a specific fonts width type
+ FontWidth getFontWidth( fontID nFontID ) const
+ {
+ PrintFont* pFont = getFont( nFontID );
+ return pFont ? pFont->m_eWidth : WIDTH_DONTKNOW;
+ }
+
+ // get a specific fonts weight type
+ FontWeight getFontWeight( fontID nFontID ) const
+ {
+ PrintFont* pFont = getFont( nFontID );
+ return pFont ? pFont->m_eWeight : WEIGHT_DONTKNOW;
+ }
+
+ // get a specific fonts pitch type
+ FontPitch getFontPitch( fontID nFontID ) const
+ {
+ PrintFont* pFont = getFont( nFontID );
+ return pFont ? pFont->m_ePitch : PITCH_DONTKNOW;
+ }
+
+ // get a specific fonts encoding
+ rtl_TextEncoding getFontEncoding( fontID nFontID ) const
+ {
+ PrintFont* pFont = getFont( nFontID );
+ return pFont ? pFont->m_aEncoding : RTL_TEXTENCODING_DONTKNOW;
+ }
+
+ // should i only use font's builtin encoding ?
+ bool getUseOnlyFontEncoding( fontID nFontID ) const
+ {
+ PrintFont* pFont = getFont( nFontID );
+ return pFont ? pFont->m_bFontEncodingOnly : false;
+ }
+
+ // get a specific fonts system dependent filename
+ OString getFontFileSysPath( fontID nFontID ) const
+ {
+ return getFontFile( getFont( nFontID ) );
+ }
+
+ // get the ttc face number
+ int getFontFaceNumber( fontID nFontID ) const;
+
+ // get a specific fonts ascend
+ int getFontAscend( fontID nFontID ) const;
+
+ // get a specific fonts descent
+ int getFontDescend( fontID nFontID ) const;
+
+ // get a fonts glyph bounding box
+ bool getFontBoundingBox( fontID nFont, int& xMin, int& yMin, int& xMax, int& yMax );
+
+ // info whether an array of glyphs has vertical substitutions
+ void hasVerticalSubstitutions( fontID nFontID, const sal_Unicode* pCharacters,
+ int nCharacters, bool* pHasSubst ) const;
+
+ // get a specific fonts metrics
+
+ // get metrics for a sal_Unicode range
+ // the user is responsible to allocate pArray large enough
+ bool getMetrics( fontID nFontID, sal_Unicode minCharacter, sal_Unicode maxCharacter, CharacterMetric* pArray, bool bVertical = false ) const;
+ // get metrics for an array of sal_Unicode characters
+ // the user is responsible to allocate pArray large enough
+ bool getMetrics( fontID nFontID, const sal_Unicode* pString, int nLen, CharacterMetric* pArray, bool bVertical = false ) const;
+
+ // get encoding vector of font, currently only for Type1 and Builtin fonts
+ // returns NULL if encoding vector is empty or font is neither type1 or
+ // builtin; if ppNonEncoded is set and non encoded type1 glyphs exist
+ // then *ppNonEncoded is set to the mapping for nonencoded glyphs.
+ // the encoding vector contains -1 for non encoded glyphs
+ const std::map< sal_Unicode, sal_Int32 >* getEncodingMap( fontID nFontID, const std::map< sal_Unicode, OString >** ppNonEncoded ) const;
+
+ // to get font substitution transparently use the
+ // getKernPairs method of PrinterGfx
+ const std::list< KernPair >& getKernPairs( fontID nFontID, bool bVertical = false ) const;
+
+ // evaluates copyright flags for TrueType fonts for printing/viewing
+ // type1 fonts do not have such a feature, so return for them is true
+ // returns true for builtin fonts (surprise!)
+ bool isFontDownloadingAllowedForPrinting( fontID nFont ) const;
+
+ // helper for type 1 fonts
+ std::list< OString > getAdobeNameFromUnicode( sal_Unicode aChar ) const;
+
+ std::pair< boost::unordered_multimap< sal_Unicode, sal_uInt8 >::const_iterator,
+ boost::unordered_multimap< sal_Unicode, sal_uInt8 >::const_iterator >
+ getAdobeCodeFromUnicode( sal_Unicode aChar ) const
+ {
+ return m_aUnicodeToAdobecode.equal_range( aChar );
+ }
+ std::list< sal_Unicode > getUnicodeFromAdobeName( const OString& rName ) const;
+ std::pair< boost::unordered_multimap< sal_uInt8, sal_Unicode >::const_iterator,
+ boost::unordered_multimap< sal_uInt8, sal_Unicode >::const_iterator >
+ getUnicodeFromAdobeCode( sal_uInt8 aChar ) const
+ {
+ return m_aAdobecodeToUnicode.equal_range( aChar );
+ }
+
+ // creates a new font subset of an existing TrueType font
+ // returns true in case of success, else false
+ // nFont: the font to be subsetted
+ // rOutFile: the file to put the new subset into;
+ // must be a valid osl file URL
+ // pGlyphIDs: input array of glyph ids for new font
+ // pNewEncoding: the corresponding encoding in the new font
+ // pWidths: output array of widths of requested glyphs
+ // nGlyphs: number of glyphs in arrays
+ // pCapHeight:: capital height of the produced font
+ // pXMin, pYMin, pXMax, pYMax: outgoing font bounding box
+ // TODO: callers of this method should use its FontSubsetInfo counterpart directly
+ bool createFontSubset( FontSubsetInfo&,
+ fontID nFont,
+ const OUString& rOutFile,
+ sal_Int32* pGlyphIDs,
+ sal_uInt8* pNewEncoding,
+ sal_Int32* pWidths,
+ int nGlyphs,
+ bool bVertical = false
+ );
+ void getGlyphWidths( fontID nFont,
+ bool bVertical,
+ std::vector< sal_Int32 >& rWidths,
+ std::map< sal_Unicode, sal_uInt32 >& rUnicodeEnc );
+
+
+ // font administration functions
+
+ /* system dependendent font matching
+
+ <p>
+ <code>matchFont</code> matches a pattern of font characteristics
+ and returns the closest match if possibe. If a match was found
+ the <code>FastPrintFontInfo</code> passed in as parameter
+ will be update to the found matching font.
+ </p>
+ <p>
+ implementation note: currently the function is only implemented
+ for fontconfig.
+ </p>
+
+ @param rInfo
+ out of the FastPrintFontInfo structure the following
+ fields will be used for the match:
+ <ul>
+ <li>family name</li>
+ <li>italic</li>
+ <li>width</li>
+ <li>weight</li>
+ <li>pitch</li>
+ </ul>
+
+ @param rLocale
+ if <code>rLocal</code> contains non empty strings the corresponding
+ locale will be used for font matching also; e.g. "Sans" can result
+ in different fonts in e.g. english and japanese
+
+ @returns
+ true if a match was found
+ false else
+ */
+ bool matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale );
+ ImplFontOptions* getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*)) const;
+
+ bool Substitute( FontSelectPattern &rPattern, OUString& rMissingCodes );
+
+ int FreeTypeCharIndex( void *pFace, sal_uInt32 aChar );
+};
+
+} // namespace
+
+#endif // _PSPRINT_FONTMANAGER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/fpicker.hrc b/include/vcl/fpicker.hrc
new file mode 100644
index 000000000000..827d24069101
--- /dev/null
+++ b/include/vcl/fpicker.hrc
@@ -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:
+ *
+ */
+#ifndef _FPICKER_HRC
+#define _FPICKER_HRC
+
+#include <svl/solar.hrc>
+
+#define STR_SVT_FILEPICKER_START (RID_FPICKER_START+1)
+#define STR_SVT_FILEPICKER_AUTO_EXTENSION (STR_SVT_FILEPICKER_START+ 0)
+#define STR_SVT_FILEPICKER_PASSWORD (STR_SVT_FILEPICKER_START+ 1)
+#define STR_SVT_FILEPICKER_FILTER_OPTIONS (STR_SVT_FILEPICKER_START+ 2)
+#define STR_SVT_FILEPICKER_READONLY (STR_SVT_FILEPICKER_START+ 3)
+#define STR_SVT_FILEPICKER_INSERT_AS_LINK (STR_SVT_FILEPICKER_START+ 4)
+#define STR_SVT_FILEPICKER_SHOW_PREVIEW (STR_SVT_FILEPICKER_START+ 5)
+#define STR_SVT_FILEPICKER_PLAY (STR_SVT_FILEPICKER_START+ 6)
+#define STR_SVT_FILEPICKER_VERSION (STR_SVT_FILEPICKER_START+ 7)
+#define STR_SVT_FILEPICKER_TEMPLATES (STR_SVT_FILEPICKER_START+ 8)
+#define STR_SVT_FILEPICKER_IMAGE_TEMPLATE (STR_SVT_FILEPICKER_START+ 9)
+#define STR_SVT_FILEPICKER_SELECTION (STR_SVT_FILEPICKER_START+10)
+#define STR_SVT_FILEPICKER_FILTER_TITLE (STR_SVT_FILEPICKER_START+11)
+#define STR_SVT_FOLDERPICKER_DEFAULT_TITLE (STR_SVT_FILEPICKER_START+12)
+#define STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION (STR_SVT_FILEPICKER_START+13)
+#define STR_SVT_ALREADYEXISTOVERWRITE (STR_SVT_FILEPICKER_START+14)
+
+
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
new file mode 100644
index 000000000000..bbdf14177b3b
--- /dev/null
+++ b/include/vcl/gdimtf.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 _SV_GDIMTF_HXX
+#define _SV_GDIMTF_HXX
+
+#include <vcl/dllapi.h>
+#include <tools/gen.hxx>
+#include <tools/link.hxx>
+#include <vcl/mapmod.hxx>
+#include <vector>
+
+class OutputDevice;
+class MetaAction;
+class MetaCommentAction;
+class SvStream;
+class Color;
+class BitmapEx;
+class Polygon;
+class PolyPolygon;
+class Gradient;
+
+// ---------------------
+// - GDIMetaFile-Types -
+// ---------------------
+
+#define GDI_METAFILE_END ((size_t)0xFFFFFFFF)
+#define GDI_METAFILE_LABEL_NOTFOUND ((size_t)0xFFFFFFFF)
+
+#ifndef METAFILE_END
+#define METAFILE_END GDI_METAFILE_END
+#endif
+
+#ifndef METAFILE_LABEL_NOTFOUND
+#define METAFILE_LABEL_NOTFOUND GDI_METAFILE_LABEL_NOTFOUND
+#endif
+
+#define MTF_MIRROR_NONE 0x00000000UL
+#define MTF_MIRROR_HORZ 0x00000001UL
+#define MTF_MIRROR_VERT 0x00000002UL
+
+enum MtfConversion
+{
+ MTF_CONVERSION_NONE = 0,
+ MTF_CONVERSION_1BIT_THRESHOLD = 1,
+ MTF_CONVERSION_8BIT_GREYS = 2
+};
+
+// -----------------------------
+// - Color conversion routines -
+// -----------------------------
+
+typedef Color (*ColorExchangeFnc)( const Color& rColor, const void* pColParam );
+typedef BitmapEx (*BmpExchangeFnc)( const BitmapEx& rBmpEx, const void* pBmpParam );
+
+class VCL_DLLPUBLIC GDIMetaFile
+{
+private:
+ ::std::vector< MetaAction* > aList;
+ size_t nCurrentActionElement;
+
+ MapMode aPrefMapMode;
+ Size aPrefSize;
+ Link aHookHdlLink;
+ GDIMetaFile* pPrev;
+ GDIMetaFile* pNext;
+ OutputDevice* pOutDev;
+ sal_Bool bPause;
+ sal_Bool bRecord;
+ sal_Bool bUseCanvas;
+
+
+ SAL_DLLPRIVATE static Color ImplColAdjustFnc( const Color& rColor, const void* pColParam );
+ SAL_DLLPRIVATE static BitmapEx ImplBmpAdjustFnc( const BitmapEx& rBmpEx, const void* pBmpParam );
+
+ SAL_DLLPRIVATE static Color ImplColConvertFnc( const Color& rColor, const void* pColParam );
+ SAL_DLLPRIVATE static BitmapEx ImplBmpConvertFnc( const BitmapEx& rBmpEx, const void* pBmpParam );
+
+ SAL_DLLPRIVATE static Color ImplColMonoFnc( const Color& rColor, const void* pColParam );
+ SAL_DLLPRIVATE static BitmapEx ImplBmpMonoFnc( const BitmapEx& rBmpEx, const void* pBmpParam );
+
+ SAL_DLLPRIVATE static Color ImplColReplaceFnc( const Color& rColor, const void* pColParam );
+ SAL_DLLPRIVATE static BitmapEx ImplBmpReplaceFnc( const BitmapEx& rBmpEx, const void* pBmpParam );
+
+ SAL_DLLPRIVATE void ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pColParam,
+ BmpExchangeFnc pFncBmp, const void* pBmpParam );
+
+ SAL_DLLPRIVATE Point ImplGetRotatedPoint( const Point& rPt, const Point& rRotatePt,
+ const Size& rOffset, double fSin, double fCos );
+ SAL_DLLPRIVATE Polygon ImplGetRotatedPolygon( const Polygon& rPoly, const Point& rRotatePt,
+ const Size& rOffset, double fSin, double fCos );
+ SAL_DLLPRIVATE PolyPolygon ImplGetRotatedPolyPolygon( const PolyPolygon& rPoly, const Point& rRotatePt,
+ const Size& rOffset, double fSin, double fCos );
+ SAL_DLLPRIVATE void ImplAddGradientEx( GDIMetaFile& rMtf,
+ const OutputDevice& rMapDev,
+ const PolyPolygon& rPolyPoly,
+ const Gradient& rGrad );
+ SAL_DLLPRIVATE bool ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize );
+ SAL_DLLPRIVATE void ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, OutputDevice* pOut );
+
+
+protected:
+
+ virtual void Linker( OutputDevice* pOut, sal_Bool bLink );
+ virtual long Hook();
+
+public:
+ GDIMetaFile();
+ GDIMetaFile( const GDIMetaFile& rMtf );
+ virtual ~GDIMetaFile();
+
+ GDIMetaFile& operator=( const GDIMetaFile& rMtf );
+ sal_Bool operator==( const GDIMetaFile& rMtf ) const;
+ sal_Bool operator!=( const GDIMetaFile& rMtf ) const { return !( *this == rMtf ); }
+
+ void Clear();
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
+ void Move( long nX, long nY );
+ // additional Move method getting specifics how to handle MapMode( MAP_PIXEL )
+ void Move( long nX, long nY, long nDPIX, long nDPIY );
+ void Scale( double fScaleX, double fScaleY );
+ void Scale( const Fraction& rScaleX, const Fraction& rScaleY );
+ void Rotate( long nAngle10 );
+ void Clip( const Rectangle& );
+ /* get the bound rect of the contained actions
+ * caveats:
+ * - clip actions will limit the contained actions,
+ * but the current clipregion of the passed OutputDevice will not
+ * - coordinates of actions will be transformed to preferred mapmode
+ * - the returned rectangle is relative to the preferred mapmode of the metafile
+ */
+ Rectangle GetBoundRect( OutputDevice& i_rReference, Rectangle* pHairline = 0 ) const;
+
+ void Adjust( short nLuminancePercent = 0, short nContrastPercent = 0,
+ short nChannelRPercent = 0, short nChannelGPercent = 0,
+ short nChannelBPercent = 0, double fGamma = 1.0,
+ sal_Bool bInvert = sal_False
+ );
+
+ void Convert( MtfConversion eConversion );
+ void ReplaceColors( const Color* pSearchColors, const Color* rReplaceColors,
+ sal_uLong nColorCount, sal_uLong* pTols = NULL );
+
+ GDIMetaFile GetMonochromeMtf( const Color& rCol ) const;
+
+ void Record( OutputDevice* pOutDev );
+ sal_Bool IsRecord() const { return bRecord; }
+
+ void Play( GDIMetaFile& rMtf, size_t nPos = GDI_METAFILE_END );
+ void Play( OutputDevice* pOutDev, size_t nPos = GDI_METAFILE_END );
+ void Play( OutputDevice* pOutDev, const Point& rPos,
+ const Size& rSize, size_t nPos = GDI_METAFILE_END );
+
+ void Pause( sal_Bool bPause );
+ sal_Bool IsPause() const { return bPause; }
+
+ void Stop();
+
+ void WindStart();
+ void WindPrev();
+
+ size_t GetActionSize() const;
+
+ void AddAction( MetaAction* pAction );
+ void AddAction( MetaAction* pAction, size_t nPos );
+ void RemoveAction( size_t nPos );
+ void push_back( MetaAction* pAction );
+
+ MetaAction* FirstAction();
+ MetaAction* NextAction();
+ MetaAction* GetAction( size_t nAction ) const;
+ MetaAction* GetCurAction() const { return GetAction( nCurrentActionElement ); }
+ /**
+ * @param pAction takes ownership
+ */
+ MetaAction* ReplaceAction( MetaAction* pAction, size_t nAction );
+
+ const Size& GetPrefSize() const { return aPrefSize; }
+ void SetPrefSize( const Size& rSize ) { aPrefSize = rSize; }
+
+ const MapMode& GetPrefMapMode() const { return aPrefMapMode; }
+ void SetPrefMapMode( const MapMode& rMapMode ) { aPrefMapMode = rMapMode; }
+
+ void SetHookHdl( const Link& rLink ) { aHookHdlLink = rLink; }
+ const Link& GetHookHdl() const { return aHookHdlLink; }
+
+ sal_uLong GetChecksum() const;
+ sal_uLong GetSizeBytes() const;
+
+ // Methods for reading and writing the new formats;
+ // the Read method also reads the old format
+ SvStream& Read( SvStream& rIStm );
+ SvStream& Write( SvStream& rOStm );
+
+ // Stream-operators write (still) the old format
+ // and read both the old and the new format
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const GDIMetaFile& rGDIMetaFile );
+
+ sal_Bool CreateThumbnail( sal_uInt32 nMaximumExtent, BitmapEx& rBmpEx, const BitmapEx* pOverlay = NULL, const Rectangle* pOverlayRect = NULL ) const;
+
+ void UseCanvas( sal_Bool _bUseCanvas );
+ sal_Bool GetUseCanvas() const { return bUseCanvas; }
+};
+
+/** Create a special metaaction that delegates rendering to specified
+ service.
+
+ This factory function creates a MetaCommentAction that delegates
+ rendering to the specified services, once played back in the
+ metafile.
+
+ @param rRendererServiceName
+ Renderer service. Gets an awt::XGraphic on instantiation
+
+ @param rGraphicServiceName
+ Graphic service. Gets the raw data on instantiation
+
+ @param pData
+ Raw data. Gets copied
+
+ @param nDataSize
+ Length, in byte, of raw data
+ */
+MetaCommentAction* makePluggableRendererAction( const OUString& rRendererServiceName,
+ const OUString& rGraphicServiceName,
+ const void* pData,
+ sal_uInt32 nDataSize );
+
+#endif // _SV_GDIMTF_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/gfxlink.hxx b/include/vcl/gfxlink.hxx
new file mode 100644
index 000000000000..380298b500b8
--- /dev/null
+++ b/include/vcl/gfxlink.hxx
@@ -0,0 +1,180 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_GFXLINK_HXX
+#define _SV_GFXLINK_HXX
+
+#include <vcl/dllapi.h>
+#include <tools/solar.h>
+#include <vcl/mapmod.hxx>
+#include <tools/stream.hxx>
+
+// -------------
+// - ImpBuffer -
+// -------------
+
+struct ImpBuffer
+{
+ sal_uLong mnRefCount;
+ sal_uInt8* mpBuffer;
+
+ ImpBuffer( sal_uLong nSize )
+ {
+ mnRefCount = 1UL;
+ mpBuffer = nSize ? new sal_uInt8[ nSize ] : NULL;
+ }
+
+ ImpBuffer( sal_uInt8* pBuf ) { mnRefCount = 1UL; mpBuffer = pBuf; }
+
+ ~ImpBuffer() { delete[] mpBuffer; }
+};
+
+// -----------
+// - ImpSwap -
+// -----------
+
+struct ImpSwap
+{
+ OUString maURL;
+ sal_uLong mnDataSize;
+ sal_uLong mnRefCount;
+
+ ImpSwap( sal_uInt8* pData, sal_uLong nDataSize );
+ ~ImpSwap();
+
+ sal_uInt8* GetData() const;
+
+ sal_Bool IsSwapped() const { return maURL.getLength() > 0; }
+
+ void WriteTo( SvStream& rOStm ) const;
+};
+
+// --------------
+// - ImpGfxLink -
+// --------------
+
+struct ImpGfxLink
+{
+ MapMode maPrefMapMode;
+ Size maPrefSize;
+ bool mbPrefMapModeValid;
+ bool mbPrefSizeValid;
+
+ ImpGfxLink() :
+ maPrefMapMode(),
+ maPrefSize(),
+ mbPrefMapModeValid( false ),
+ mbPrefSizeValid( false )
+ {}
+};
+
+//#endif // __PRIVATE
+
+// ---------------
+// - GfxLinkType -
+// ---------------
+
+enum GfxLinkType
+{
+ GFX_LINK_TYPE_NONE = 0,
+ GFX_LINK_TYPE_EPS_BUFFER = 1,
+ GFX_LINK_TYPE_NATIVE_GIF = 2, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_JPG = 3, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_PNG = 4, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_TIF = 5, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_WMF = 6, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_MET = 7, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_PCT = 8, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_SVG = 9, // Don't forget to update the following defines
+ GFX_LINK_TYPE_USER = 0xffff
+};
+
+#define GFX_LINK_FIRST_NATIVE_ID GFX_LINK_TYPE_NATIVE_GIF
+#define GFX_LINK_LAST_NATIVE_ID GFX_LINK_TYPE_NATIVE_SVG
+
+// -----------
+// - GfxLink -
+// -----------
+
+struct ImpBuffer;
+struct ImpSwap;
+struct ImpGfxLink;
+class Graphic;
+
+class VCL_DLLPUBLIC GfxLink
+{
+private:
+
+ GfxLinkType meType;
+ ImpBuffer* mpBuf;
+ ImpSwap* mpSwap;
+ sal_uInt32 mnBufSize;
+ sal_uInt32 mnUserId;
+ ImpGfxLink* mpImpData;
+ sal_uLong mnExtra2;
+
+ SAL_DLLPRIVATE void ImplCopy( const GfxLink& rGfxLink );
+
+public:
+ GfxLink();
+ GfxLink( const GfxLink& );
+ GfxLink( const String& rPath, GfxLinkType nType );
+ GfxLink( sal_uInt8* pBuf, sal_uInt32 nBufSize, GfxLinkType nType, sal_Bool bOwns );
+ ~GfxLink();
+
+ GfxLink& operator=( const GfxLink& );
+ sal_Bool IsEqual( const GfxLink& ) const;
+
+ GfxLinkType GetType() const;
+
+ void SetUserId( sal_uInt32 nUserId ) { mnUserId = nUserId; }
+ sal_uInt32 GetUserId() const { return mnUserId; }
+
+ sal_uInt32 GetDataSize() const;
+ void SetData( sal_uInt8* pBuf, sal_uInt32 nSize, GfxLinkType nType, sal_Bool bOwns );
+ const sal_uInt8* GetData() const;
+
+ const Size& GetPrefSize() const;
+ void SetPrefSize( const Size& rPrefSize );
+ bool IsPrefSizeValid();
+
+ const MapMode& GetPrefMapMode() const;
+ void SetPrefMapMode( const MapMode& rPrefMapMode );
+ bool IsPrefMapModeValid();
+
+ sal_Bool IsNative() const;
+ sal_Bool IsUser() const { return( GFX_LINK_TYPE_USER == meType ); }
+
+ sal_Bool LoadNative( Graphic& rGraphic );
+
+ sal_Bool ExportNative( SvStream& rOStream ) const;
+
+ void SwapOut();
+ void SwapIn();
+ sal_Bool IsSwappedOut() const { return( mpSwap != NULL ); }
+
+public:
+
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const GfxLink& rGfxLink );
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/gradient.hxx b/include/vcl/gradient.hxx
new file mode 100644
index 000000000000..d9bbf7aea1ad
--- /dev/null
+++ b/include/vcl/gradient.hxx
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_GRADIENT_HXX
+#define _SV_GRADIENT_HXX
+
+#include <sal/types.h>
+#include <vcl/dllapi.h>
+#include <tools/color.hxx>
+
+#include <vcl/vclenum.hxx>
+
+// ----------------
+// - Impl_Gradient -
+// ----------------
+
+class Rectangle;
+class Point;
+class SvStream;
+
+class Impl_Gradient
+{
+public:
+ sal_uLong mnRefCount;
+ GradientStyle meStyle;
+ Color maStartColor;
+ Color maEndColor;
+ sal_uInt16 mnAngle;
+ sal_uInt16 mnBorder;
+ sal_uInt16 mnOfsX;
+ sal_uInt16 mnOfsY;
+ sal_uInt16 mnIntensityStart;
+ sal_uInt16 mnIntensityEnd;
+ sal_uInt16 mnStepCount;
+
+ friend SvStream& operator>>( SvStream& rIStm, Impl_Gradient& rImplGradient );
+ friend SvStream& operator<<( SvStream& rOStm, const Impl_Gradient& rImplGradient );
+
+ Impl_Gradient();
+ Impl_Gradient( const Impl_Gradient& rImplGradient );
+};
+
+// ------------
+// - Gradient -
+// ------------
+
+class VCL_DLLPUBLIC Gradient
+{
+private:
+ Impl_Gradient* mpImplGradient;
+ void MakeUnique();
+
+public:
+ Gradient();
+ Gradient( const Gradient& rGradient );
+ Gradient( GradientStyle eStyle,
+ const Color& rStartColor,
+ const Color& rEndColor );
+ ~Gradient();
+
+ void SetStyle( GradientStyle eStyle );
+ GradientStyle GetStyle() const { return mpImplGradient->meStyle; }
+
+ void SetStartColor( const Color& rColor );
+ const Color& GetStartColor() const { return mpImplGradient->maStartColor; }
+ void SetEndColor( const Color& rColor );
+ const Color& GetEndColor() const { return mpImplGradient->maEndColor; }
+
+ void SetAngle( sal_uInt16 nAngle );
+ sal_uInt16 GetAngle() const { return mpImplGradient->mnAngle; }
+
+ void SetBorder( sal_uInt16 nBorder );
+ sal_uInt16 GetBorder() const { return mpImplGradient->mnBorder; }
+ void SetOfsX( sal_uInt16 nOfsX );
+ sal_uInt16 GetOfsX() const { return mpImplGradient->mnOfsX; }
+ void SetOfsY( sal_uInt16 nOfsY );
+ sal_uInt16 GetOfsY() const { return mpImplGradient->mnOfsY; }
+
+ void SetStartIntensity( sal_uInt16 nIntens );
+ sal_uInt16 GetStartIntensity() const { return mpImplGradient->mnIntensityStart; }
+ void SetEndIntensity( sal_uInt16 nIntens );
+ sal_uInt16 GetEndIntensity() const { return mpImplGradient->mnIntensityEnd; }
+
+ void SetSteps( sal_uInt16 nSteps );
+ sal_uInt16 GetSteps() const { return mpImplGradient->mnStepCount; }
+
+ void GetBoundRect( const Rectangle& rRect, Rectangle &rBoundRect, Point& rCenter ) const;
+
+ Gradient& operator=( const Gradient& rGradient );
+ sal_Bool operator==( const Gradient& rGradient ) const;
+ sal_Bool operator!=( const Gradient& rGradient ) const
+ { return !(Gradient::operator==( rGradient )); }
+ sal_Bool IsSameInstance( const Gradient& rGradient ) const
+ { return (mpImplGradient == rGradient.mpImplGradient); }
+
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Gradient& rGradient );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Gradient& rGradient );
+};
+
+#endif // _SV_GRADIENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/graph.h b/include/vcl/graph.h
new file mode 100644
index 000000000000..94224b780d93
--- /dev/null
+++ b/include/vcl/graph.h
@@ -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 _SV_GRAPH_H
+#define _SV_GRAPH_H
+
+#include <vcl/dllapi.h>
+#include <tools/string.hxx>
+#include <tools/solar.h>
+
+// ---------------
+// - GraphicType -
+// ---------------
+
+enum GraphicType
+{
+ GRAPHIC_NONE,
+ GRAPHIC_BITMAP,
+ GRAPHIC_GDIMETAFILE,
+ GRAPHIC_DEFAULT
+};
+
+// -----------------
+// - GraphicReader -
+// -----------------
+
+class ReaderData;
+
+class VCL_DLLPUBLIC GraphicReader
+{
+protected:
+
+ String maUpperName;
+ ReaderData* mpReaderData;
+ sal_Bool mbIsReading;
+
+ GraphicReader() :
+ mpReaderData( NULL ),
+ mbIsReading( sal_False ) {}
+
+public:
+
+ virtual ~GraphicReader();
+
+ const String& GetUpperFilterName() const { return maUpperName; }
+ ReaderData* GetReaderData() const { return mpReaderData; }
+ sal_Bool IsReading() const { return mbIsReading; }
+
+ // TODO: when incompatible changes are possible again
+ // the preview size hint should be redone
+ void DisablePreviewMode();
+ void SetPreviewSize( const Size& );
+ Size GetPreviewSize() const;
+};
+
+#endif // _SV_GRAPH_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
new file mode 100644
index 000000000000..4f1facae5395
--- /dev/null
+++ b/include/vcl/graph.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 _SV_GRAPH_HXX
+#define _SV_GRAPH_HXX
+
+#include <tools/stream.hxx>
+#include <vcl/dllapi.h>
+#include <tools/solar.h>
+#include <vcl/bitmap.hxx>
+#include <vcl/bitmapex.hxx>
+#include <vcl/animate.hxx>
+#include <vcl/gdimtf.hxx>
+#include <vcl/graph.h>
+#include <vcl/gfxlink.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <vcl/svgdata.hxx>
+
+namespace com { namespace sun { namespace star { namespace graphic { class XGraphic;} } } }
+
+// -----------
+// - Graphic -
+// -----------
+
+class ImpGraphic;
+class OutputDevice;
+class Font;
+class GfxLink;
+
+class VCL_DLLPUBLIC GraphicConversionParameters
+{
+private:
+ Size maSizePixel; // default is (0,0)
+
+ // bitfield
+ unsigned mbUnlimitedSize : 1; // default is false
+ unsigned mbAntiAliase : 1; // default is false
+ unsigned mbSnapHorVerLines : 1; // default is false
+
+public:
+ GraphicConversionParameters(
+ const Size& rSizePixel = Size(),
+ bool bUnlimitedSize = false,
+ bool bAntiAliase = false,
+ bool bSnapHorVerLines = false)
+ : maSizePixel(rSizePixel),
+ mbUnlimitedSize(bUnlimitedSize),
+ mbAntiAliase(bAntiAliase),
+ mbSnapHorVerLines(bSnapHorVerLines)
+ {
+ }
+
+ // data read access
+ const Size getSizePixel() const { return maSizePixel; }
+ bool getUnlimitedSize() const { return mbUnlimitedSize; }
+ bool getAntiAliase() const { return mbAntiAliase; }
+ bool getSnapHorVerLines() const { return mbSnapHorVerLines; }
+};
+
+class VCL_DLLPUBLIC Graphic : public SvDataCopyStream
+{
+private:
+
+ ImpGraphic* mpImpGraphic;
+
+public:
+
+ SAL_DLLPRIVATE void ImplTestRefCount();
+ SAL_DLLPRIVATE ImpGraphic* ImplGetImpGraphic() const { return mpImpGraphic; }
+
+public:
+
+ TYPEINFO();
+
+ Graphic();
+ Graphic( const Graphic& rGraphic );
+ Graphic( const Bitmap& rBmp );
+ Graphic( const BitmapEx& rBmpEx );
+ Graphic( const SvgDataPtr& rSvgDataPtr );
+ Graphic( const Animation& rAnimation );
+ Graphic( const GDIMetaFile& rMtf );
+ Graphic( const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic );
+ virtual ~Graphic();
+
+ Graphic& operator=( const Graphic& rGraphic );
+ sal_Bool operator==( const Graphic& rGraphic ) const;
+ sal_Bool operator!=( const Graphic& rGraphic ) const;
+ sal_Bool operator!() const;
+
+ void Clear();
+
+ GraphicType GetType() const;
+ void SetDefaultType();
+ sal_Bool IsSupportedGraphic() const;
+
+ sal_Bool IsTransparent() const;
+ sal_Bool IsAlpha() const;
+ sal_Bool IsAnimated() const;
+ sal_Bool IsEPS() const;
+
+ // #i102089# Access of Bitmap potentially will have to rasterconvert the Graphic
+ // if it is a MetaFile. To be able to control this conversion it is necessary to
+ // allow giving parameters which control AntiAliasing and LineSnapping of the
+ // MetaFile when played. Defaults will use a no-AAed, not snapped conversion as
+ // before.
+ Bitmap GetBitmap(const GraphicConversionParameters& rParameters = GraphicConversionParameters()) const;
+ BitmapEx GetBitmapEx(const GraphicConversionParameters& rParameters = GraphicConversionParameters()) const;
+
+ Animation GetAnimation() const;
+ const GDIMetaFile& GetGDIMetaFile() const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > GetXGraphic() const;
+
+ Size GetPrefSize() const;
+ void SetPrefSize( const Size& rPrefSize );
+
+ MapMode GetPrefMapMode() const;
+ void SetPrefMapMode( const MapMode& rPrefMapMode );
+
+ Size GetSizePixel( const OutputDevice* pRefDevice = NULL ) const;
+
+ sal_uLong GetSizeBytes() const;
+
+ void Draw( OutputDevice* pOutDev,
+ const Point& rDestPt ) const;
+ void Draw( OutputDevice* pOutDev,
+ const Point& rDestPt,
+ const Size& rDestSize ) const;
+ static void DrawEx( OutputDevice* pOutDev, const OUString& rText,
+ Font& rFont, const BitmapEx& rBitmap,
+ const Point& rDestPt, const Size& rDestSize );
+
+ void StartAnimation( OutputDevice* pOutDev,
+ const Point& rDestPt,
+ const Size& rDestSize,
+ long nExtraData = 0L,
+ OutputDevice* pFirstFrameOutDev = NULL );
+ void StopAnimation( OutputDevice* pOutputDevice = NULL,
+ long nExtraData = 0L );
+
+ void SetAnimationNotifyHdl( const Link& rLink );
+ Link GetAnimationNotifyHdl() const;
+
+ sal_uLong GetAnimationLoopCount() const;
+
+ sal_uLong GetChecksum() const;
+
+public:
+
+ GraphicReader* GetContext();
+ void SetContext( GraphicReader* pReader );
+
+public:
+
+ void SetDocFileName( const String& rName, sal_uLong nFilePos );
+ const String& GetDocFileName() const;
+ sal_uLong GetDocFilePos() const;
+
+ sal_Bool SwapOut();
+ sal_Bool SwapOut( SvStream* pOStm );
+ sal_Bool SwapIn();
+ sal_Bool SwapIn( SvStream* pIStm );
+ sal_Bool IsSwapOut() const;
+
+ void SetLink( const GfxLink& );
+ GfxLink GetLink() const;
+ sal_Bool IsLink() const;
+
+ sal_Bool ExportNative( SvStream& rOStream ) const;
+
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const Graphic& rGraphic );
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, Graphic& rGraphic );
+
+public:
+
+ virtual void Load( SvStream& );
+ virtual void Save( SvStream& );
+ virtual void Assign( const SvDataCopyStream& );
+
+ const SvgDataPtr& getSvgData() const;
+};
+
+#endif // _SV_GRAPH_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
new file mode 100644
index 000000000000..8f42119360d1
--- /dev/null
+++ b/include/vcl/graphicfilter.hxx
@@ -0,0 +1,325 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _FILTER_HXX
+#define _FILTER_HXX
+
+#include <tools/gen.hxx>
+#include <tools/stream.hxx>
+#include <tools/urlobj.hxx>
+#include <vcl/dllapi.h>
+#include <vcl/field.hxx>
+#include <vcl/graph.hxx>
+
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+
+class FilterConfigCache;
+struct WMF_EXTERNALHEADER;
+struct ConvertData;
+
+#define GRFILTER_OK 0
+#define GRFILTER_OPENERROR 1
+#define GRFILTER_IOERROR 2
+#define GRFILTER_FORMATERROR 3
+#define GRFILTER_VERSIONERROR 4
+#define GRFILTER_FILTERERROR 5
+#define GRFILTER_ABORT 6
+#define GRFILTER_TOOBIG 7
+
+#define GRFILTER_OUTHINT_GREY 1
+
+#define GRFILTER_FORMAT_NOTFOUND ((sal_uInt16)0xFFFF)
+#define GRFILTER_FORMAT_DONTKNOW ((sal_uInt16)0xFFFF)
+
+#define GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG 00000001
+#define GRFILTER_I_FLAGS_DONT_SET_LOGSIZE_FOR_JPEG 00000002
+#define GRFILTER_I_FLAGS_FOR_PREVIEW 00000004
+#define GRFILTER_I_FLAGS_ALLOW_PARTIAL_STREAMREAD 00000010
+
+#define IMP_BMP "SVBMP"
+#define IMP_SVMETAFILE "SVMETAFILE"
+#define IMP_WMF "SVWMF"
+#define IMP_EMF "SVEMF"
+#define IMP_SVSGF "SVSGF"
+#define IMP_SVSGV "SVSGV"
+#define IMP_GIF "SVIGIF"
+#define IMP_PNG "SVIPNG"
+#define IMP_JPEG "SVIJPEG"
+#define IMP_XBM "SVIXBM"
+#define IMP_XPM "SVIXPM"
+#define IMP_SVG "SVISVG"
+#define EXP_BMP "SVBMP"
+#define EXP_SVMETAFILE "SVMETAFILE"
+#define EXP_WMF "SVWMF"
+#define EXP_EMF "SVEMF"
+#define EXP_JPEG "SVEJPEG"
+#define EXP_SVG "SVESVG"
+#define EXP_PNG "SVEPNG"
+
+#define BMP_SHORTNAME "BMP"
+#define GIF_SHORTNAME "GIF"
+#define JPG_SHORTNAME "JPG"
+#define MET_SHORTNAME "MET"
+#define PCT_SHORTNAME "PCT"
+#define PNG_SHORTNAME "PNG"
+#define SVM_SHORTNAME "SVM"
+#define TIF_SHORTNAME "TIF"
+#define WMF_SHORTNAME "WMF"
+#define EMF_SHORTNAME "EMF"
+#define SVG_SHORTNAME "SVG"
+
+// Info class for all supported file formats
+
+#define GFF_NOT ( (sal_uInt16)0x0000 )
+#define GFF_BMP ( (sal_uInt16)0x0001 )
+#define GFF_GIF ( (sal_uInt16)0x0002 )
+#define GFF_JPG ( (sal_uInt16)0x0003 )
+#define GFF_PCD ( (sal_uInt16)0x0004 )
+#define GFF_PCX ( (sal_uInt16)0x0005 )
+#define GFF_PNG ( (sal_uInt16)0x0006 )
+#define GFF_TIF ( (sal_uInt16)0x0007 )
+#define GFF_XBM ( (sal_uInt16)0x0008 )
+#define GFF_XPM ( (sal_uInt16)0x0009 )
+#define GFF_PBM ( (sal_uInt16)0x000a )
+#define GFF_PGM ( (sal_uInt16)0x000b )
+#define GFF_PPM ( (sal_uInt16)0x000c )
+#define GFF_RAS ( (sal_uInt16)0x000d )
+#define GFF_TGA ( (sal_uInt16)0x000e )
+#define GFF_PSD ( (sal_uInt16)0x000f )
+#define GFF_EPS ( (sal_uInt16)0x0010 )
+#define GFF_DXF ( (sal_uInt16)0x00f1 )
+#define GFF_MET ( (sal_uInt16)0x00f2 )
+#define GFF_PCT ( (sal_uInt16)0x00f3 )
+#define GFF_SGF ( (sal_uInt16)0x00f4 )
+#define GFF_SVM ( (sal_uInt16)0x00f5 )
+#define GFF_WMF ( (sal_uInt16)0x00f6 )
+#define GFF_SGV ( (sal_uInt16)0x00f7 )
+#define GFF_EMF ( (sal_uInt16)0x00f8 )
+#define GFF_SVG ( (sal_uInt16)0x00f9 )
+#define GFF_XXX ( (sal_uInt16)0xffff )
+
+// ---------------------
+// - GraphicDescriptor -
+// ---------------------
+
+class VCL_DLLPUBLIC GraphicDescriptor
+{
+ SvStream* pFileStm;
+
+ String aPathExt;
+ Size aPixSize;
+ Size aLogSize;
+ sal_uInt16 nBitsPerPixel;
+ sal_uInt16 nPlanes;
+ sal_uInt16 nFormat;
+ sal_Bool bCompressed;
+ sal_Bool bOwnStream;
+
+ void ImpConstruct();
+
+ sal_Bool ImpDetectBMP( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectGIF( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectJPG( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPCD( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPCX( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPNG( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectTIF( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectXBM( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectXPM( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPBM( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPGM( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPPM( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectRAS( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectTGA( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPSD( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectEPS( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectDXF( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectMET( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPCT( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectSGF( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectSVM( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectWMF( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectSGV( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectEMF( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectSVG( SvStream& rStm, sal_Bool bExtendedInfo );
+ GraphicDescriptor( const GraphicDescriptor& );
+ GraphicDescriptor& operator=( const GraphicDescriptor& );
+
+public:
+
+ /** Ctor to set a filename
+
+ ::Detect() must be called to identify the file
+ If the file has no unique header (Mtf's), the format
+ is determined from the extension */
+ GraphicDescriptor( const INetURLObject& rPath );
+
+ /** Ctor using a stream
+
+ ::Detect() must be called to identify the file
+ As some formats (Mtf's) do not have a unique header, it makes sense
+ to supply the file name (incl. ext.), so that the format can be
+ derived from the extension */
+ GraphicDescriptor( SvStream& rInStream, const String* pPath = NULL );
+
+ virtual ~GraphicDescriptor();
+
+ /** starts the detection
+
+ if bExtendedInfo == sal_True the file header is used to derive
+ as many properties as possible (size, color, etc.) */
+ virtual sal_Bool Detect( sal_Bool bExtendedInfo = sal_False );
+
+ /** @return the file format, GFF_NOT if no format was recognized */
+ sal_uInt16 GetFileFormat() const { return nFormat; }
+
+ /** @return graphic size in pixels or 0 size */
+ const Size& GetSizePixel() const { return (Size&) aPixSize; }
+
+ /** @return the logical graphic size in 1/100mm or 0 size */
+ const Size& GetSize_100TH_MM() const { return (Size&) aLogSize; }
+
+ /** @return bits/pixel or 0 **/
+ sal_uInt16 GetBitsPerPixel() const { return nBitsPerPixel; }
+
+ /** return number of planes or 0 */
+ sal_uInt16 GetPlanes() const { return nPlanes; }
+
+ /** @return true if the graphic is compressed */
+ sal_Bool IsCompressed() const { return bCompressed; }
+
+ /** @return filter number that is needed by the GraphFilter to read this format */
+ static String GetImportFormatShortName( sal_uInt16 nFormat );
+};
+
+/** Information about errors during the GraphicFilter operation. */
+struct FilterErrorEx
+{
+ sal_uLong nFilterError;
+ sal_uLong nStreamError;
+
+ FilterErrorEx() : nFilterError( 0UL ), nStreamError( 0UL ) {}
+};
+
+/** Class to import and export graphic formats. */
+class VCL_DLLPUBLIC GraphicFilter
+{
+ friend class SvFilterOptionsDialog;
+
+private:
+
+ void ImplInit();
+ sal_uLong ImplSetError( sal_uLong nError, const SvStream* pStm = NULL );
+ sal_uInt16 ImpTestOrFindFormat( const String& rPath, SvStream& rStream, sal_uInt16& rFormat );
+
+ DECL_LINK( FilterCallback, ConvertData* pData );
+
+protected:
+
+ OUString aFilterPath;
+ FilterConfigCache* pConfig;
+ FilterErrorEx* pErrorEx;
+ sal_Bool bAbort;
+ sal_Bool bUseConfig;
+ long nExpGraphHint;
+
+public:
+
+ GraphicFilter( sal_Bool bUseConfig = sal_True );
+ ~GraphicFilter();
+
+ void SetFilterPath( const OUString& rFilterPath ) { aFilterPath = rFilterPath; };
+
+ sal_uInt16 GetImportFormatCount();
+ sal_uInt16 GetImportFormatNumber( const String& rFormatName );
+ sal_uInt16 GetImportFormatNumberForMediaType( const String& rMediaType );
+ sal_uInt16 GetImportFormatNumberForShortName( const String& rShortName );
+ sal_uInt16 GetImportFormatNumberForTypeName( const String& rType );
+ String GetImportFormatName( sal_uInt16 nFormat );
+ String GetImportFormatTypeName( sal_uInt16 nFormat );
+ String GetImportFormatMediaType( sal_uInt16 nFormat );
+ String GetImportFormatShortName( sal_uInt16 nFormat );
+ String GetImportOSFileType( sal_uInt16 nFormat );
+ String GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry = 0 );
+ sal_Bool IsImportPixelFormat( sal_uInt16 nFormat );
+
+ sal_uInt16 GetExportFormatCount();
+ sal_uInt16 GetExportFormatNumber( const String& rFormatName );
+ sal_uInt16 GetExportFormatNumberForMediaType( const String& rShortName );
+ sal_uInt16 GetExportFormatNumberForShortName( const String& rShortName );
+ String GetExportInternalFilterName( sal_uInt16 nFormat );
+ sal_uInt16 GetExportFormatNumberForTypeName( const String& rType );
+ String GetExportFormatName( sal_uInt16 nFormat );
+ String GetExportFormatTypeName( sal_uInt16 nFormat );
+ String GetExportFormatMediaType( sal_uInt16 nFormat );
+ String GetExportFormatShortName( sal_uInt16 nFormat );
+ String GetExportOSFileType( sal_uInt16 nFormat );
+ String GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry = 0 );
+ sal_Bool IsExportPixelFormat( sal_uInt16 nFormat );
+
+ sal_uInt16 ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath,
+ sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW,
+ const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData = NULL );
+ sal_uInt16 ExportGraphic( const Graphic& rGraphic, const String& rPath,
+ SvStream& rOStm, sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW,
+ const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData = NULL );
+ long GetExportGraphicHint() const { return nExpGraphHint; }
+
+ sal_uInt16 CanImportGraphic( const INetURLObject& rPath,
+ sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW,
+ sal_uInt16 * pDeterminedFormat = NULL);
+
+ sal_uInt16 ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath,
+ sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW,
+ sal_uInt16 * pDeterminedFormat = NULL, sal_uInt32 nImportFlags = 0 );
+
+ sal_uInt16 CanImportGraphic( const String& rPath, SvStream& rStream,
+ sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW,
+ sal_uInt16 * pDeterminedFormat = NULL);
+
+ sal_uInt16 ImportGraphic( Graphic& rGraphic, const String& rPath,
+ SvStream& rStream,
+ sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW,
+ sal_uInt16 * pDeterminedFormat = NULL, sal_uInt32 nImportFlags = 0,
+ WMF_EXTERNALHEADER *pExtHeader = NULL );
+
+ sal_uInt16 ImportGraphic( Graphic& rGraphic, const String& rPath,
+ SvStream& rStream,
+ sal_uInt16 nFormat,
+ sal_uInt16 * pDeterminedFormat, sal_uInt32 nImportFlags,
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData,
+ WMF_EXTERNALHEADER *pExtHeader = NULL );
+
+ void Abort() { bAbort = sal_True; }
+
+ const FilterErrorEx& GetLastError() const;
+ void ResetLastError();
+
+ const Link GetFilterCallback() const;
+ static GraphicFilter& GetGraphicFilter();
+ static int LoadGraphic( const String& rPath, const String& rFilter,
+ Graphic& rGraphic,
+ GraphicFilter* pFilter = NULL,
+ sal_uInt16* pDeterminedFormat = NULL );
+};
+
+#endif //_FILTER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/graphictools.hxx b/include/vcl/graphictools.hxx
new file mode 100644
index 000000000000..3600f1a364fc
--- /dev/null
+++ b/include/vcl/graphictools.hxx
@@ -0,0 +1,348 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _VCL_GRAPHICTOOLS_HXX_
+#define _VCL_GRAPHICTOOLS_HXX_
+
+#include <vcl/dllapi.h>
+#include <sal/types.h>
+#include <rtl/string.hxx>
+#include <tools/color.hxx>
+#include <tools/poly.hxx>
+#include <tools/stream.hxx>
+#include <vcl/graph.hxx>
+
+#include <memory>
+#include <vector>
+
+/** Encapsulates geometry and associated attributes of a graphical 'pen stroke'
+
+ @attention Widespread use is deprecated. See declarations above
+ for the way to go. Especially the copied enums from svx/xenum.hxx
+ are troublesome.
+
+ Use this class to store geometry and attributes of a graphical
+ 'pen stroke', such as pen width, dashing etc. The geometry is the
+ so-called 'path' along which the stroke is traced, with the given
+ pen width. The cap type determines how the open ends of the path
+ should be drawn. If the geometry consists of more than one
+ segment, the join type determines in which way the segments are
+ joined.
+ */
+class VCL_DLLPUBLIC SvtGraphicStroke
+{
+public:
+ /// Style for open stroke ends
+ enum CapType
+ {
+ /// No additional cap
+ capButt=0,
+ /// Half-round cap at the line end, the center lying at the end point
+ capRound,
+ /// Half-square cap at the line end, the center lying at the end point
+ capSquare
+ };
+ /// Style for joins of individual stroke segments
+ enum JoinType
+ {
+ /// Extend segment edges, until they cross
+ joinMiter=0,
+ /// Connect segments by a filled round arc
+ joinRound,
+ /// Connect segments by a direct straight line
+ joinBevel,
+ /// Perform no join, leads to visible gaps between thick line segments
+ joinNone
+ };
+ enum
+ {
+ /// Width of stroke start/end arrow to exactly fit the joining stroke
+ normalizedArrowWidth=65536
+ };
+ typedef ::std::vector< double > DashArray;
+
+ SvtGraphicStroke();
+ /** All in one constructor
+
+ See accessor method descriptions for argument description
+ */
+ SvtGraphicStroke( const Polygon& rPath,
+ const PolyPolygon& rStartArrow,
+ const PolyPolygon& rEndArrow,
+ double fTransparency,
+ double fStrokeWidth,
+ CapType aCap,
+ JoinType aJoin,
+ double fMiterLimit,
+ const DashArray& rDashArray ); // TODO: Dash array offset (position where to start, see PS)
+
+ // accessors
+ /// Query path to stroke
+ void getPath ( Polygon& ) const;
+ /** Get the polygon that is put at the start of the line
+
+ The polygon is in a special normalized position: the center of
+ the stroked path will meet the given polygon at (0,0) from
+ negative y values. Thus, an arrow would have its baseline on
+ the x axis, going upwards to positive y values. Furthermore,
+ the polygon is also scaled in a special way: the width of the
+ joining stroke is defined to be
+ SvtGraphicStroke::normalizedArrowWidth (0x10000), i.e. ranging
+ from x=-0x8000 to x=0x8000. So, if the arrow does have this
+ width, it has to fit every stroke with every stroke width
+ exactly.
+ */
+ void getStartArrow ( PolyPolygon& ) const;
+ /** Get the polygon that is put at the end of the line
+
+ The polygon is in a special normalized position, and already
+ scaled to the desired size: the center of the stroked path
+ will meet the given polygon at (0,0) from negative y
+ values. Thus, an arrow would have its baseline on the x axis,
+ going upwards to positive y values. Furthermore, the polygon
+ is also scaled in a special way: the width of the joining
+ stroke is defined to be SvtGraphicStroke::normalizedArrowWidth
+ (0x10000), i.e. ranging from x=-0x8000 to x=0x8000. So, if the
+ arrow does have this width, it has to fit every stroke with
+ every stroke width exactly.
+ */
+ void getEndArrow ( PolyPolygon& ) const;
+ /** Get stroke transparency
+
+ @return the transparency, ranging from 0.0 (opaque) to 1.0 (fully translucent)
+ */
+ double getTransparency () const;
+ /// Get width of the stroke
+ double getStrokeWidth () const;
+ /// Get the style in which open stroke ends are drawn
+ CapType getCapType () const;
+ /// Get the style in which the stroke segments are joined
+ JoinType getJoinType () const;
+ /// Get the maximum length of mitered joins
+ double getMiterLimit () const;
+ /// Get an array of "on" and "off" lengths for stroke dashing
+ void getDashArray ( DashArray& ) const;
+
+ // mutators
+ /// Set path to stroke
+ void setPath ( const Polygon& );
+ /// Affine scaling in both X and Y dimensions
+ void scale ( double fScaleX, double fScaleY );
+
+private:
+ // friends
+ VCL_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const SvtGraphicStroke& rClass );
+ VCL_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, SvtGraphicStroke& rClass );
+
+ Polygon maPath;
+ PolyPolygon maStartArrow;
+ PolyPolygon maEndArrow;
+ double mfTransparency;
+ double mfStrokeWidth;
+ CapType maCapType;
+ JoinType maJoinType;
+ double mfMiterLimit;
+ DashArray maDashArray;
+};
+
+/** Encapsulates geometry and associated attributes of a filled area
+
+ @attention Widespread use is deprecated. See declarations above
+ for the way to go. Especially the copied enums from svx/xenum.hxx
+ is troublesome.
+
+ Use this class to store geometry and attributes of a filled area,
+ such as fill color, transparency, texture or hatch. The geometry
+ is the so-called 'path', whose inner area will get filled
+ according to the attributes set. If the path is intersecting, or
+ one part of the path is lying fully within another part, then the
+ fill rule determines which parts are filled and which are not.
+ */
+class VCL_DLLPUBLIC SvtGraphicFill
+{
+public:
+ /// Type of fill algorithm used
+ enum FillRule
+ {
+ /** Non-zero winding rule
+
+ Fill shape scanline-wise. Starting at the left, determine
+ the winding number as follows: every segment crossed that
+ runs counter-clockwise adds one to the winding number,
+ every segment crossed that runs clockwise subtracts
+ one. The part of the scanline where the winding number is
+ non-zero gets filled.
+ */
+ fillNonZero=0,
+ /** Even-odd fill rule
+
+ Fill shape scanline-wise. Starting at the left, count the
+ number of segments crossed. If this number is odd, the
+ part of the scanline is filled, otherwise not.
+ */
+ fillEvenOdd
+ };
+ /// Type of filling used
+ enum FillType
+ {
+ /// Fill with a specified solid color
+ fillSolid=0,
+ /// Fill with the specified gradient
+ fillGradient,
+ /// Fill with the specified hatch
+ fillHatch,
+ /// Fill with the specified texture (a Graphic object)
+ fillTexture
+ };
+ /// Type of hatching used
+ enum HatchType
+ {
+ /// horizontal parallel lines, one unit apart
+ hatchSingle=0,
+ /// horizontal and verticall orthogonally crossing lines, one unit apart
+ hatchDouble,
+ /// three crossing lines, like HatchType::hatchDouble, but
+ /// with an additional diagonal line, rising to the upper
+ /// right corner. The first diagonal line goes through the
+ /// upper left corner, the other are each spaced a unit apart.
+ hatchTriple
+ };
+ /// Type of gradient used
+ enum GradientType {gradientLinear=0, gradientRadial, gradientRectangular};
+ /// Special values for gradient step count
+ enum { gradientStepsInfinite=0 };
+ /** Homogeneous 2D transformation matrix
+
+ This is a 2x3 matrix representing an affine transformation on
+ the R^2, in the usual C/C++ row major form. It is structured as follows:
+ <pre>
+ a b t_x
+ c d t_y
+ 0 0 1
+ </pre>
+ where the lowest line is not stored in the matrix, since it is
+ constant. Variables t_x and t_y contain translational
+ components, a to d rotation, scale and shear (for details,
+ look up your favorite linear algebra/computer graphics book).
+ */
+ struct VCL_DLLPUBLIC Transform
+ {
+ enum { MatrixSize=6 };
+ Transform();
+ double matrix[MatrixSize];
+ };
+
+ SvtGraphicFill();
+ /** All in one constructor
+
+ See accessor method descriptions for argument description
+ */
+ SvtGraphicFill( const PolyPolygon& rPath,
+ Color aFillColor,
+ double fTransparency,
+ FillRule aFillRule,
+ FillType aFillType, // TODO: Multitexturing
+ const Transform& aFillTransform,
+ bool bTiling,
+ HatchType aHatchType, // TODO: vector of directions and start points
+ Color aHatchColor,
+ GradientType aGradientType, // TODO: Transparent gradients (orthogonal to normal ones)
+ Color aGradient1stColor, // TODO: vector of colors and offsets
+ Color aGradient2ndColor,
+ sal_Int32 aGradientStepCount, // numbers of steps to render the gradient. gradientStepsInfinite means infinitely many.
+ const Graphic& aFillGraphic );
+
+ // accessors
+ /// Query path to fill
+ void getPath ( PolyPolygon& ) const;
+ /// Get color used for solid fills
+ Color getFillColor () const;
+ /** Get stroke transparency
+
+ @return the transparency, ranging from 0.0 (opaque) to 1.0 (fully translucent)
+ */
+ double getTransparency () const;
+ /// Get fill rule used
+ FillRule getFillRule () const;
+ /** Get fill type used
+
+ Currently, only one of the fill types can be used
+ simultaneously. If you specify e.g. FillRule::fillGradient,
+ hatching, texture and solid fill color are ignored.
+ */
+ FillType getFillType () const;
+ /** Get transformation applied to hatch, gradient or texture during fill
+
+ A fill operation generally starts at the top left position of
+ the object's bounding box. At that position (if tiling is on,
+ also all successive positions), the specified fill graphic is
+ rendered, after applying the fill transformation to it. For
+ example, if the fill transformation contains a translation,
+ the fill graphic is rendered at the object's bounding box's
+ top left corner plus the translation components.
+
+ */
+ void getTransform ( Transform& ) const;
+ /// deprecated
+ bool IsTiling () const;
+ /** Query state of texture tiling
+
+ @return true, if texture is tiled, false, if output only once.
+ */
+ bool isTiling () const;
+ /// Get type of gradient used
+ GradientType getGradientType () const;
+
+ /** Get the texture graphic used
+
+ The Graphic object returned is used to fill the geometry, if
+ the FillType is fillTexture. The Graphic object is always
+ assumed to be of size 1x1, the transformation is used to scale
+ it to the appropriate size.
+ */
+ void getGraphic ( Graphic& ) const;
+
+ // mutators
+ /// Set path to fill
+ void setPath ( const PolyPolygon& rPath );
+
+private:
+ // friends
+ VCL_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const SvtGraphicFill& rClass );
+ VCL_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, SvtGraphicFill& rClass );
+
+ PolyPolygon maPath;
+ Color maFillColor;
+ double mfTransparency;
+ FillRule maFillRule;
+ FillType maFillType;
+ Transform maFillTransform;
+ bool mbTiling;
+ HatchType maHatchType;
+ Color maHatchColor;
+ GradientType maGradientType;
+ Color maGradient1stColor;
+ Color maGradient2ndColor;
+ sal_Int32 maGradientStepCount;
+ Graphic maFillGraphic;
+};
+
+#endif /* _VCL_GRAPHICTOOLS_HXX_ */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/group.hxx b/include/vcl/group.hxx
new file mode 100644
index 000000000000..647aabe66570
--- /dev/null
+++ b/include/vcl/group.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 _SV_GROUP_HXX
+#define _SV_GROUP_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/ctrl.hxx>
+
+// ------------
+// - GroupBox -
+// ------------
+
+class VCL_DLLPUBLIC GroupBox : public Control
+{
+private:
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ const Point& rPos, const Size& rSize, bool bLayout = false );
+
+ virtual void FillLayoutData() const;
+ virtual const Font&
+ GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color&
+ GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
+
+public:
+ GroupBox( Window* pParent, WinBits nStyle = 0 );
+ GroupBox( Window* pParent, const ResId& rResId );
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+};
+
+#endif // _SV_GROUP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/hatch.hxx b/include/vcl/hatch.hxx
new file mode 100644
index 000000000000..8112fe5d4718
--- /dev/null
+++ b/include/vcl/hatch.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 _SV_HATCH_HXX
+#define _SV_HATCH_HXX
+
+#include <tools/color.hxx>
+#include <vcl/dllapi.h>
+
+#include <vcl/vclenum.hxx>
+
+// --------------
+// - Impl_Hatch -
+// --------------
+
+class SvStream;
+
+struct ImplHatch
+{
+ sal_uLong mnRefCount;
+ Color maColor;
+ HatchStyle meStyle;
+ long mnDistance;
+ sal_uInt16 mnAngle;
+
+ ImplHatch();
+ ImplHatch( const ImplHatch& rImplHatch );
+
+ friend SvStream& operator>>( SvStream& rIStm, ImplHatch& rImplHatch );
+ friend SvStream& operator<<( SvStream& rOStm, const ImplHatch& rImplHatch );
+};
+
+// ---------
+// - Hatch -
+// ---------
+
+class VCL_DLLPUBLIC Hatch
+{
+private:
+
+ ImplHatch* mpImplHatch;
+ SAL_DLLPRIVATE void ImplMakeUnique();
+
+public:
+
+ Hatch();
+ Hatch( const Hatch& rHatch );
+ Hatch( HatchStyle eStyle, const Color& rHatchColor, long nDistance, sal_uInt16 nAngle10 = 0 );
+ ~Hatch();
+
+ Hatch& operator=( const Hatch& rHatch );
+ sal_Bool operator==( const Hatch& rHatch ) const;
+ sal_Bool operator!=( const Hatch& rHatch ) const { return !(Hatch::operator==( rHatch ) ); }
+ sal_Bool IsSameInstance( const Hatch& rHatch ) const { return( mpImplHatch == rHatch.mpImplHatch ); }
+
+ HatchStyle GetStyle() const { return mpImplHatch->meStyle; }
+
+ void SetColor( const Color& rColor );
+ const Color& GetColor() const { return mpImplHatch->maColor; }
+
+ void SetDistance( long nDistance );
+ long GetDistance() const { return mpImplHatch->mnDistance; }
+
+ void SetAngle( sal_uInt16 nAngle10 );
+ sal_uInt16 GetAngle() const { return mpImplHatch->mnAngle; }
+
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Hatch& rHatch );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Hatch& rHatch );
+};
+
+#endif // _SV_HATCH_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/help.hxx b/include/vcl/help.hxx
new file mode 100644
index 000000000000..b74d8023f75c
--- /dev/null
+++ b/include/vcl/help.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 _SV_HELP_HXX
+#define _SV_HELP_HXX
+
+#include <rtl/ustring.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+
+class Point;
+class Rectangle;
+class Window;
+
+// --------------
+// - Help-Types -
+// --------------
+
+#define QUICKHELP_LEFT ((sal_uInt16)0x0001)
+#define QUICKHELP_CENTER ((sal_uInt16)0x0002)
+#define QUICKHELP_RIGHT ((sal_uInt16)0x0004)
+#define QUICKHELP_TOP ((sal_uInt16)0x0008)
+#define QUICKHELP_VCENTER ((sal_uInt16)0x0010)
+#define QUICKHELP_BOTTOM ((sal_uInt16)0x0020)
+#define QUICKHELP_NOAUTOPOS (QUICKHELP_LEFT | QUICKHELP_CENTER | QUICKHELP_RIGHT | QUICKHELP_TOP | QUICKHELP_VCENTER | QUICKHELP_BOTTOM)
+#define QUICKHELP_CTRLTEXT ((sal_uInt16)0x0040)
+/// force the existent tip window to be re-positioned, even if the previous incarnation has the same text. Applies to ShowBallon and ShowQuickHelp.
+#define QUICKHELP_FORCE_REPOSITION ((sal_uInt16)0x0080)
+/// no delay when opening the quick help. Applies to ShowBallon and ShowQuickHelp
+#define QUICKHELP_NO_DELAY ((sal_uInt16)0x0100)
+/// force balloon-style in ShowTip
+#define QUICKHELP_TIP_STYLE_BALLOON ((sal_uInt16)0x0200)
+#define QUICKHELP_NOEVADEPOINTER ((sal_uInt16)0x4000)
+#define QUICKHELP_BIDI_RTL ((sal_uInt16)0x8000)
+
+// By changes you must also change: rsc/vclrsc.hxx
+#define OOO_HELP_INDEX ".help:index"
+#define OOO_HELP_HELPONHELP ".help:helponhelp"
+
+// --------
+// - Help -
+// --------
+
+class VCL_DLLPUBLIC Help
+{
+public:
+ Help();
+ virtual ~Help();
+
+ virtual sal_Bool Start( const OUString& rHelpId, const Window* pWindow );
+ virtual sal_Bool SearchKeyword( const OUString& rKeyWord );
+ virtual void OpenHelpAgent( const OString& rHelpId );
+ virtual OUString GetHelpText( const OUString& aHelpURL, const Window* pWindow );
+
+ static void EnableContextHelp();
+ static void DisableContextHelp();
+ static sal_Bool IsContextHelpEnabled();
+
+ static void EnableExtHelp();
+ static void DisableExtHelp();
+ static sal_Bool IsExtHelpEnabled();
+ static sal_Bool StartExtHelp();
+ static sal_Bool EndExtHelp();
+
+ static void EnableBalloonHelp();
+ static void DisableBalloonHelp();
+ static sal_Bool IsBalloonHelpEnabled();
+ static sal_Bool ShowBalloon( Window* pParent,
+ const Point& rScreenPos,
+ const OUString& rHelpText );
+ static sal_Bool ShowBalloon( Window* pParent,
+ const Point& rScreenPos,
+ const Rectangle&,
+ const OUString& rHelpText );
+
+ static void EnableQuickHelp();
+ static void DisableQuickHelp();
+ static sal_Bool IsQuickHelpEnabled();
+ static sal_Bool ShowQuickHelp( Window* pParent,
+ const Rectangle& rScreenRect,
+ const OUString& rHelpText,
+ const OUString& rLongHelpText,
+ sal_uInt16 nStyle = 0 );
+ static sal_Bool ShowQuickHelp( Window* pParent,
+ const Rectangle& rScreenRect,
+ const OUString& rHelpText,
+ sal_uInt16 nStyle = 0 )
+ { return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, OUString(), nStyle ); }
+
+ static void HideBalloonAndQuickHelp();
+
+ static sal_uLong ShowTip( Window* pParent,
+ const Rectangle& rScreenRect,
+ const OUString& rText, sal_uInt16 nStyle = 0 );
+ static void UpdateTip( sal_uLong nId,
+ Window* pParent,
+ const Rectangle& rScreenRect,
+ const OUString& rText );
+ static void HideTip( sal_uLong nId );
+};
+
+#endif // _SV_HELP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/helper.hxx b/include/vcl/helper.hxx
new file mode 100644
index 000000000000..295df4a1a5e7
--- /dev/null
+++ b/include/vcl/helper.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 _PSPRINT_HELPER_HXX_
+#define _PSPRINT_HELPER_HXX_
+
+#include <list>
+
+#include "vcl/dllapi.h"
+
+#include "rtl/ustring.hxx"
+
+
+// forwards
+namespace osl { class File; }
+
+namespace psp {
+typedef int fontID;
+
+void VCL_DLLPUBLIC getPrinterPathList( std::list< OUString >& rPathList, const char* pSubDir );
+
+// note: gcc 3.4.1 warns about visibility if we retunr a const OUString& here
+// seems to be a bug in gcc, now we return an object instead of a reference
+OUString VCL_DLLPUBLIC getFontPath();
+
+bool VCL_DLLPUBLIC convertPfbToPfa( osl::File& rInFile, osl::File& rOutFile );
+
+// normalized path (equivalent to realpath)
+void VCL_DLLPUBLIC normPath( OString& rPath );
+
+// splits rOrgPath into dirname and basename
+// rOrgPath will be subject to normPath
+void VCL_DLLPUBLIC splitPath( OString& rOrgPath, OString& rDir, OString& rBase );
+
+enum whichOfficePath { InstallationRootPath, UserPath, ConfigPath };
+// note: gcc 3.4.1 warns about visibility if we retunr a const OUString& here
+// seems to be a bug in gcc, now we return an object instead of a reference
+OUString VCL_DLLPUBLIC getOfficePath( enum whichOfficePath ePath );
+} // namespace
+
+#endif // _PSPRINT_HELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/i18nhelp.hxx b/include/vcl/i18nhelp.hxx
new file mode 100644
index 000000000000..8ece881a9b03
--- /dev/null
+++ b/include/vcl/i18nhelp.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 _VCL_I18NHELP_HXX
+#define _VCL_I18NHELP_HXX
+
+#include <com/sun/star/uno/Reference.h>
+#include <osl/mutex.hxx>
+#include <i18nlangtag/languagetag.hxx>
+#include <tools/string.hxx>
+#include <vcl/dllapi.h>
+
+namespace com {
+namespace sun {
+namespace star {
+namespace uno {
+ class XComponentContext;
+}
+}}}
+
+namespace utl {
+ class TransliterationWrapper;
+}
+
+class LocaleDataWrapper;
+
+class Date;
+
+namespace vcl
+{
+
+class VCL_DLLPUBLIC I18nHelper
+{
+private:
+ ::osl::Mutex maMutex;
+ LanguageTag maLanguageTag;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+
+ LocaleDataWrapper* mpLocaleDataWrapper;
+ utl::TransliterationWrapper* mpTransliterationWrapper;
+
+ sal_Bool mbTransliterateIgnoreCase;
+
+ SAL_DLLPRIVATE void ImplDestroyWrappers();
+
+protected:
+ ::osl::Mutex& GetMutex() { return maMutex; }
+
+ SAL_DLLPRIVATE utl::TransliterationWrapper& ImplGetTransliterationWrapper() const;
+ SAL_DLLPRIVATE LocaleDataWrapper& ImplGetLocaleDataWrapper() const;
+
+public:
+
+ I18nHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const LanguageTag& rLanguageTag );
+ ~I18nHelper();
+
+ sal_Int32 CompareString( const OUString& rStr1, const OUString& rStr2 ) const;
+
+ sal_Bool MatchString( const OUString& rStr1, const OUString& rStr2 ) const;
+ sal_Bool MatchMnemonic( const String& rString, sal_Unicode cMnemonicChar ) const;
+
+ String GetNum( long nNumber, sal_uInt16 nDecimals, sal_Bool bUseThousandSep = sal_True, sal_Bool bTrailingZeros = sal_True ) const;
+
+ static String filterFormattingChars( const String& );
+};
+
+} // namespace vcl
+
+#endif // _VCL_I18NHELP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx
new file mode 100644
index 000000000000..0d28bc030abd
--- /dev/null
+++ b/include/vcl/image.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 _SV_IMAGE_HXX
+#define _SV_IMAGE_HXX
+
+#include <vcl/dllapi.h>
+#include <tools/gen.hxx>
+#include <tools/resid.hxx>
+#include <tools/solar.h>
+#include <vcl/bitmapex.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <vector>
+
+struct ImplImage;
+struct ImplImageList;
+namespace com { namespace sun { namespace star { namespace graphic { class XGraphic;} } } }
+
+#define IMAGE_STDBTN_COLOR Color( 0xC0, 0xC0, 0xC0 )
+#define IMAGELIST_IMAGE_NOTFOUND ((sal_uInt16)0xFFFF)
+
+enum ImageColorTransform
+{
+ IMAGECOLORTRANSFORM_NONE = 0,
+ IMAGECOLORTRANSFORM_HIGHCONTRAST = 1,
+ IMAGECOLORTRANSFORM_MONOCHROME_BLACK = 2,
+ IMAGECOLORTRANSFORM_MONOCHROME_WHITE = 3
+};
+
+class VCL_DLLPUBLIC Image
+{
+ friend class ImageList;
+ friend class OutputDevice;
+
+public:
+ Image();
+ Image( const ResId& rResId );
+ Image( const Image& rImage );
+ Image( const BitmapEx& rBitmapEx );
+ Image( const Bitmap& rBitmap );
+ Image( const Bitmap& rBitmap, const Bitmap& rMaskBitmap );
+ Image( const Bitmap& rBitmap, const Color& rColor );
+ Image( const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic );
+ ~Image();
+
+ Size GetSizePixel() const;
+
+ BitmapEx GetBitmapEx() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > GetXGraphic() const;
+
+ Image GetColorTransformedImage( ImageColorTransform eColorTransform ) const;
+
+ sal_Bool operator!() const { return( !mpImplData ? true : false ); }
+ Image& operator=( const Image& rImage );
+ sal_Bool operator==( const Image& rImage ) const;
+ sal_Bool operator!=( const Image& rImage ) const { return !(Image::operator==( rImage )); }
+
+private:
+
+ ImplImage* mpImplData;
+
+ SAL_DLLPRIVATE void ImplInit( const BitmapEx& rBmpEx );
+};
+
+class VCL_DLLPUBLIC ImageList
+{
+public:
+ ImageList( sal_uInt16 nInit = 8, sal_uInt16 nGrow = 4 );
+ ImageList( const ResId& rResId );
+ ImageList( const ::std::vector< OUString >& rNameVector,
+ const OUString& rPrefix,
+ const Color* pMaskColor = NULL );
+ ImageList( const ImageList& rImageList );
+ ~ImageList();
+
+ void InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
+ const std::vector< OUString > &rNameVector );
+ void InsertFromHorizontalBitmap( const ResId& rResId,
+ sal_uInt16 nCount,
+ const Color *pNonAlphaMaskColor,
+ const Color *pSearchColors = NULL,
+ const Color *pReplaceColors = NULL,
+ sal_uLong nColorCount = 0);
+ BitmapEx GetAsHorizontalStrip() const;
+ sal_uInt16 GetImageCount() const;
+ Size GetImageSize() const;
+
+ void AddImage( const OUString& rImageName, const Image& rImage );
+ void AddImage( sal_uInt16 nNewId, const Image& rImage );
+
+ void ReplaceImage( const OUString& rImageName, const Image& rImage );
+
+ void RemoveImage( sal_uInt16 nId );
+
+ Image GetImage( sal_uInt16 nId ) const;
+ Image GetImage( const OUString& rImageName ) const;
+
+ sal_uInt16 GetImagePos( sal_uInt16 nId ) const;
+ bool HasImageAtPos( sal_uInt16 nId ) const;
+ sal_uInt16 GetImagePos( const OUString& rImageName ) const;
+
+ sal_uInt16 GetImageId( sal_uInt16 nPos ) const;
+
+ OUString GetImageName( sal_uInt16 nPos ) const;
+ void GetImageNames( ::std::vector< OUString >& rNames ) const;
+
+ ImageList& operator=( const ImageList& rImageList );
+ sal_Bool operator==( const ImageList& rImageList ) const;
+ sal_Bool operator!=( const ImageList& rImageList ) const { return !(ImageList::operator==( rImageList )); }
+
+private:
+
+ ImplImageList* mpImplData;
+ sal_uInt16 mnInitSize;
+ sal_uInt16 mnGrowSize;
+
+ SAL_DLLPRIVATE void ImplInitBitmapEx( const OUString& rUserImageName,
+ const ::std::vector< OUString >& rImageNames,
+ const OUString& rSymbolsStyle,
+ BitmapEx& rBmpEx,
+ const Color* pMaskColor ) const;
+ SAL_DLLPRIVATE void ImplInit( sal_uInt16 nItems, const Size &rSize );
+ SAL_DLLPRIVATE sal_uInt16 ImplGetImageId( const OUString& rImageName ) const;
+};
+
+#endif // _SV_IMAGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/imagerepository.hxx b/include/vcl/imagerepository.hxx
new file mode 100644
index 000000000000..45ee445edcd6
--- /dev/null
+++ b/include/vcl/imagerepository.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 VCL_IMAGEREPOSITORY_HXX
+#define VCL_IMAGEREPOSITORY_HXX
+
+#include <vcl/dllapi.h>
+#include <rtl/ustring.hxx>
+
+class BitmapEx;
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ //====================================================================
+ //= ImageRepository
+ //====================================================================
+ // provides access to the application's image repository (image.zip)
+ class VCL_DLLPUBLIC ImageRepository
+ {
+ public:
+ /** loads an image from the application's image repository
+ @param _rName
+ the name of the image to load.
+ @param _out_rImage
+ will take the image upon successful return.
+ @param bSearchLanguageDependent
+ determines whether a language-dependent image is to be searched.
+ @return
+ whether or not the image could be loaded successfully.
+ */
+ static bool loadImage(
+ const OUString& _rName,
+ BitmapEx& _out_rImage,
+ bool bSearchLanguageDependent,
+ bool loadMissing = false
+ );
+
+ static bool loadDefaultImage(
+ BitmapEx& _out_rImage
+ );
+ };
+
+//........................................................................
+} // namespace vcl
+//........................................................................
+
+#endif // VCL_IMAGEREPOSITORY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/imgctrl.hxx b/include/vcl/imgctrl.hxx
new file mode 100644
index 000000000000..d0da64cbe6fa
--- /dev/null
+++ b/include/vcl/imgctrl.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 _SV_IMGCTRL_HXX
+#define _SV_IMGCTRL_HXX
+
+#include <vcl/dllapi.h>
+
+#include <vcl/fixed.hxx>
+#include <vcl/bitmapex.hxx>
+
+// ----------------
+// - ImageControl -
+// ----------------
+
+class VCL_DLLPUBLIC ImageControl : public FixedImage
+{
+private:
+ ::sal_Int16 mnScaleMode;
+
+public:
+ ImageControl( Window* pParent, WinBits nStyle = 0 );
+ ImageControl( Window* pParent, const ResId& rResId );
+
+ // set/get the scale mode. This is one of the css.awt.ImageScaleMode constants
+ void SetScaleMode( const ::sal_Int16 _nMode );
+ ::sal_Int16 GetScaleMode() const { return mnScaleMode; }
+
+ virtual void Resize();
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+protected:
+ void ImplDraw( OutputDevice& rDev, sal_uLong nDrawFlags, const Point& rPos, const Size& rSize ) const;
+};
+
+#endif // _SV_IMGCTRL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/impdel.hxx b/include/vcl/impdel.hxx
new file mode 100644
index 000000000000..df6e2713196e
--- /dev/null
+++ b/include/vcl/impdel.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+ #ifndef _VCL_IMPDEL_HXX
+ #define _VCL_IMPDEL_HXX
+
+ #include <list>
+
+ namespace vcl
+ {
+
+ class DeletionListener;
+
+ class DeletionNotifier
+ {
+ std::list< DeletionListener* > m_aListeners;
+ protected:
+ DeletionNotifier() {}
+
+ ~DeletionNotifier()
+ { notifyDelete(); }
+
+ inline void notifyDelete();
+
+ public:
+ void addDel( DeletionListener* pListener )
+ { m_aListeners.push_back( pListener ); }
+
+ void removeDel( DeletionListener* pListener )
+ { m_aListeners.remove( pListener ); }
+ };
+
+ class DeletionListener
+ {
+ DeletionNotifier* m_pNotifier;
+ public:
+ DeletionListener( DeletionNotifier* pNotifier )
+ : m_pNotifier( pNotifier )
+ {
+ if( m_pNotifier )
+ m_pNotifier->addDel( this );
+ }
+ ~DeletionListener()
+ {
+ if( m_pNotifier )
+ m_pNotifier->removeDel( this );
+ }
+ void deleted() { m_pNotifier = NULL; }
+ bool isDeleted() const { return (m_pNotifier == NULL); }
+ };
+
+ inline void DeletionNotifier::notifyDelete()
+ {
+ for( std::list< DeletionListener* >::const_iterator it =
+ m_aListeners.begin(); it != m_aListeners.end(); ++it )
+ (*it)->deleted();
+
+ m_aListeners.clear();
+ }
+
+ } // namespace vcl
+
+ #endif // _VCL_IMPDEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/inputctx.hxx b/include/vcl/inputctx.hxx
new file mode 100644
index 000000000000..7072f88ab404
--- /dev/null
+++ b/include/vcl/inputctx.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 _VCL_INPUTCTX_HXX
+#define _VCL_INPUTCTX_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/font.hxx>
+
+// ----------------------
+// - InputContext-Flags -
+// ----------------------
+
+#define INPUTCONTEXT_TEXT ((sal_uLong)0x00000001)
+#define INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002)
+#define INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004)
+#define INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008)
+
+// ----------------
+// - InputContext -
+// ----------------
+
+class VCL_DLLPUBLIC InputContext
+{
+private:
+ Font maFont;
+ sal_uLong mnOptions;
+
+public:
+ InputContext() { mnOptions = 0; }
+ InputContext( const InputContext& rInputContext ) :
+ maFont( rInputContext.maFont )
+ { mnOptions = rInputContext.mnOptions; }
+ InputContext( const Font& rFont, sal_uLong nOptions = 0 ) :
+ maFont( rFont )
+ { mnOptions = nOptions; }
+
+ void SetFont( const Font& rFont ) { maFont = rFont; }
+ const Font& GetFont() const { return maFont; }
+
+ void SetOptions( sal_uLong nOptions ) { mnOptions = nOptions; }
+ sal_uLong GetOptions() const { return mnOptions; }
+
+ InputContext& operator=( const InputContext& rInputContext );
+ sal_Bool operator==( const InputContext& rInputContext ) const;
+ sal_Bool operator!=( const InputContext& rInputContext ) const
+ { return !(InputContext::operator==( rInputContext )); }
+};
+
+inline InputContext& InputContext::operator=( const InputContext& rInputContext )
+{
+ maFont = rInputContext.maFont;
+ mnOptions = rInputContext.mnOptions;
+ return *this;
+}
+
+inline sal_Bool InputContext::operator==( const InputContext& rInputContext ) const
+{
+ return ((mnOptions == rInputContext.mnOptions) &&
+ (maFont == rInputContext.maFont));
+}
+
+#endif // _VCL_INPUTCTX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/introwin.hxx b/include/vcl/introwin.hxx
new file mode 100644
index 000000000000..d78648cd7ef5
--- /dev/null
+++ b/include/vcl/introwin.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 _SV_INTROWIN_HXX
+#define _SV_INTROWIN_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/wrkwin.hxx>
+#include <vcl/bitmapex.hxx>
+
+// --------------
+// - IntroWindow -
+// --------------
+
+class VCL_DLLPUBLIC IntroWindow : public WorkWindow
+{
+private:
+ SAL_DLLPRIVATE void ImplInitIntroWindowData();
+
+public:
+ IntroWindow();
+ ~IntroWindow();
+};
+
+#endif // _SV_INTROWIN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/jobdata.hxx b/include/vcl/jobdata.hxx
new file mode 100644
index 000000000000..f6fb94fccab2
--- /dev/null
+++ b/include/vcl/jobdata.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 _PSPRINT_JOBDATA_HXX_
+#define _PSPRINT_JOBDATA_HXX_
+
+#include "vcl/ppdparser.hxx"
+
+namespace psp {
+
+namespace orientation {
+enum type {
+ Portrait,
+ Landscape
+};
+}
+
+struct VCL_DLLPUBLIC JobData
+{
+ int m_nCopies;
+ int m_nLeftMarginAdjust;
+ int m_nRightMarginAdjust;
+ int m_nTopMarginAdjust;
+ int m_nBottomMarginAdjust;
+ // user overrides for PPD
+ int m_nColorDepth;
+ int m_nPSLevel; // 0: no override, else languagelevel to use
+ int m_nColorDevice; // 0: no override, -1 grey scale, +1 color
+ int m_nPDFDevice; // 0: no override, -1 PostScript, +1: Automatically PDF, +2: Explicitly PDF
+ orientation::type m_eOrientation;
+ OUString m_aPrinterName;
+ const PPDParser* m_pParser;
+ PPDContext m_aContext;
+
+ JobData() :
+ m_nCopies( 1 ),
+ m_nLeftMarginAdjust( 0 ),
+ m_nRightMarginAdjust( 0 ),
+ m_nTopMarginAdjust( 0 ),
+ m_nBottomMarginAdjust( 0 ),
+ m_nColorDepth( 24 ),
+ m_nPSLevel( 0 ),
+ m_nColorDevice( 0 ),
+ m_nPDFDevice( 0 ),
+ m_eOrientation( orientation::Portrait ),
+ m_pParser( NULL ) {}
+
+ JobData& operator=(const psp::JobData& rRight);
+
+ JobData( const JobData& rData ) { *this = rData; }
+
+ void setCollate( bool bCollate );
+ bool setPaper( int nWidth, int nHeight ); // dimensions in pt
+ bool setPaperBin( int nPaperBin ); // dimensions in pt
+ void resolveDefaultBackend();
+ void setDefaultBackend(bool bUsePDF);
+
+ // creates a new buffer using new
+ // it is up to the user to delete it again
+ bool getStreamBuffer( void*& pData, int& bytes );
+ static bool constructFromStreamBuffer( void* pData, int bytes, JobData& rJobData );
+};
+
+} // namespace
+
+
+#endif // PSPRINT_JOBDATA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/jobset.hxx b/include/vcl/jobset.hxx
new file mode 100644
index 000000000000..15f418cbda3a
--- /dev/null
+++ b/include/vcl/jobset.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 _SV_JOBSET_HXX
+#define _SV_JOBSET_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/prntypes.hxx>
+
+
+class SvStream;
+struct ImplJobSetup;
+
+// ------------
+// - JobSetup -
+// ------------
+
+class VCL_DLLPUBLIC JobSetup
+{
+ friend class Printer;
+
+private:
+ ImplJobSetup* mpData;
+
+public:
+ SAL_DLLPRIVATE ImplJobSetup* ImplGetData();
+ SAL_DLLPRIVATE ImplJobSetup* ImplGetConstData();
+ SAL_DLLPRIVATE const ImplJobSetup* ImplGetConstData() const;
+
+public:
+ JobSetup();
+ JobSetup( const JobSetup& rJob );
+ ~JobSetup();
+
+ OUString GetPrinterName() const;
+ OUString GetDriverName() const;
+
+ /* Get/SetValue are used to read/store additional
+ * Parameters in the job setup that may be used
+ * by the printer driver. One possible use are phone
+ * numbers for faxes (which disguise as printers)
+ */
+ void SetValue( const OUString& rKey, const OUString& rValue );
+
+ JobSetup& operator=( const JobSetup& rJob );
+
+ sal_Bool operator==( const JobSetup& rJobSetup ) const;
+ sal_Bool operator!=( const JobSetup& rJobSetup ) const
+ { return !(JobSetup::operator==( rJobSetup )); }
+
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup );
+};
+
+#endif // _SV_JOBSET_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/keycod.hxx b/include/vcl/keycod.hxx
new file mode 100644
index 000000000000..70df7583bcca
--- /dev/null
+++ b/include/vcl/keycod.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 _SV_KEYCODE_HXX
+#define _SV_KEYCODE_HXX
+
+#include <tools/string.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <tools/resid.hxx>
+#include <vcl/keycodes.hxx>
+
+#include <vcl/vclenum.hxx>
+
+class Window;
+
+// -----------
+// - KeyCode -
+// -----------
+
+class VCL_DLLPUBLIC KeyCode
+{
+private:
+ sal_uInt16 nCode;
+ KeyFuncType eFunc;
+
+public:
+ KeyCode() { nCode = 0; eFunc = KEYFUNC_DONTKNOW; }
+ KeyCode( const ResId& rResId );
+ KeyCode( sal_uInt16 nKey, sal_uInt16 nModifier = 0 )
+ { nCode = nKey | nModifier; eFunc = KEYFUNC_DONTKNOW; }
+ KeyCode( sal_uInt16 nKey, sal_Bool bShift, sal_Bool bMod1, sal_Bool bMod2, sal_Bool bMod3 );
+ KeyCode( KeyFuncType eFunction );
+
+ sal_uInt16 GetFullCode() const { return nCode; }
+ KeyFuncType GetFullFunction() const { return eFunc; }
+ sal_Bool IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const;
+
+ sal_uInt16 GetCode() const
+ { return (nCode & KEY_CODE); }
+
+ sal_uInt16 GetModifier() const
+ { return (nCode & KEY_MODTYPE); }
+ sal_uInt16 GetAllModifier() const
+ { return (nCode & KEY_ALLMODTYPE); }
+ sal_Bool IsShift() const
+ { return ((nCode & KEY_SHIFT) != 0); }
+ sal_Bool IsMod1() const
+ { return ((nCode & KEY_MOD1) != 0); }
+ sal_Bool IsMod2() const
+ { return ((nCode & KEY_MOD2) != 0); }
+ sal_Bool IsMod3() const
+ { return ((nCode & KEY_MOD3) != 0); }
+ sal_uInt16 GetGroup() const
+ { return (nCode & KEYGROUP_TYPE); }
+
+ XubString GetName( Window* pWindow = NULL ) const;
+
+ sal_Bool IsFunction() const
+ { return ((eFunc != KEYFUNC_DONTKNOW) ? sal_True : sal_False); }
+
+ KeyFuncType GetFunction() const;
+
+ KeyCode& operator = ( const KeyCode& rKeyCode );
+ sal_Bool operator ==( const KeyCode& rKeyCode ) const;
+ sal_Bool operator !=( const KeyCode& rKeyCode ) const;
+};
+
+inline KeyCode::KeyCode( sal_uInt16 nKey, sal_Bool bShift, sal_Bool bMod1, sal_Bool bMod2, sal_Bool bMod3 )
+{
+ nCode = nKey;
+ if( bShift )
+ nCode |= KEY_SHIFT;
+ if( bMod1 )
+ nCode |= KEY_MOD1;
+ if( bMod2 )
+ nCode |= KEY_MOD2;
+ if( bMod3 )
+ nCode |= KEY_MOD3;
+ eFunc = KEYFUNC_DONTKNOW;
+}
+
+inline sal_Bool KeyCode::operator ==( const KeyCode& rKeyCode ) const
+{
+ if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
+ return (nCode == rKeyCode.nCode);
+ else
+ return (GetFunction() == rKeyCode.GetFunction());
+}
+
+inline sal_Bool KeyCode::operator !=( const KeyCode& rKeyCode ) const
+{
+ if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
+ return (nCode != rKeyCode.nCode);
+ else
+ return (GetFunction() != rKeyCode.GetFunction());
+}
+
+inline sal_Bool KeyCode::IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const
+{
+ if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
+ return (GetFullCode() == rKeyCode.GetFullCode());
+ return (GetFunction() == rKeyCode.GetFunction());
+}
+
+inline KeyCode& KeyCode::operator = ( const KeyCode& rKeyCode )
+{
+ nCode = rKeyCode.nCode;
+ eFunc = rKeyCode.eFunc;
+
+ return *this;
+}
+
+#endif // _SV_KEYCODE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/keycodes.hxx b/include/vcl/keycodes.hxx
new file mode 100644
index 000000000000..cfa23649e194
--- /dev/null
+++ b/include/vcl/keycodes.hxx
@@ -0,0 +1,186 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_KEYCODES_HXX
+#define _SV_KEYCODES_HXX
+
+#include <tools/solar.h>
+#include <rsc/rsc-vcl-shared-types.hxx>
+#undef DELETE
+#include <com/sun/star/awt/Key.hpp>
+#include <com/sun/star/awt/KeyGroup.hpp>
+
+// Key-Gruppen
+#define KEYGROUP_NUM ((sal_uInt16)::com::sun::star::awt::KeyGroup::NUM)
+#define KEYGROUP_ALPHA ((sal_uInt16)::com::sun::star::awt::KeyGroup::ALPHA)
+#define KEYGROUP_FKEYS ((sal_uInt16)::com::sun::star::awt::KeyGroup::FKEYS)
+#define KEYGROUP_CURSOR ((sal_uInt16)::com::sun::star::awt::KeyGroup::CURSOR)
+#define KEYGROUP_MISC ((sal_uInt16)::com::sun::star::awt::KeyGroup::MISC)
+#define KEYGROUP_TYPE ((sal_uInt16)::com::sun::star::awt::KeyGroup::TYPE)
+
+// Key-Codes
+#define KEY_0 ((sal_uInt16)::com::sun::star::awt::Key::NUM0)
+#define KEY_1 ((sal_uInt16)::com::sun::star::awt::Key::NUM1)
+#define KEY_2 ((sal_uInt16)::com::sun::star::awt::Key::NUM2)
+#define KEY_3 ((sal_uInt16)::com::sun::star::awt::Key::NUM3)
+#define KEY_4 ((sal_uInt16)::com::sun::star::awt::Key::NUM4)
+#define KEY_5 ((sal_uInt16)::com::sun::star::awt::Key::NUM5)
+#define KEY_6 ((sal_uInt16)::com::sun::star::awt::Key::NUM6)
+#define KEY_7 ((sal_uInt16)::com::sun::star::awt::Key::NUM7)
+#define KEY_8 ((sal_uInt16)::com::sun::star::awt::Key::NUM8)
+#define KEY_9 ((sal_uInt16)::com::sun::star::awt::Key::NUM9)
+
+#define KEY_A ((sal_uInt16)::com::sun::star::awt::Key::A)
+#define KEY_B ((sal_uInt16)::com::sun::star::awt::Key::B)
+#define KEY_C ((sal_uInt16)::com::sun::star::awt::Key::C)
+#define KEY_D ((sal_uInt16)::com::sun::star::awt::Key::D)
+#define KEY_E ((sal_uInt16)::com::sun::star::awt::Key::E)
+#define KEY_F ((sal_uInt16)::com::sun::star::awt::Key::F)
+#define KEY_G ((sal_uInt16)::com::sun::star::awt::Key::G)
+#define KEY_H ((sal_uInt16)::com::sun::star::awt::Key::H)
+#define KEY_I ((sal_uInt16)::com::sun::star::awt::Key::I)
+#define KEY_J ((sal_uInt16)::com::sun::star::awt::Key::J)
+#define KEY_K ((sal_uInt16)::com::sun::star::awt::Key::K)
+#define KEY_L ((sal_uInt16)::com::sun::star::awt::Key::L)
+#define KEY_M ((sal_uInt16)::com::sun::star::awt::Key::M)
+#define KEY_N ((sal_uInt16)::com::sun::star::awt::Key::N)
+#define KEY_O ((sal_uInt16)::com::sun::star::awt::Key::O)
+#define KEY_P ((sal_uInt16)::com::sun::star::awt::Key::P)
+#define KEY_Q ((sal_uInt16)::com::sun::star::awt::Key::Q)
+#define KEY_R ((sal_uInt16)::com::sun::star::awt::Key::R)
+#define KEY_S ((sal_uInt16)::com::sun::star::awt::Key::S)
+#define KEY_T ((sal_uInt16)::com::sun::star::awt::Key::T)
+#define KEY_U ((sal_uInt16)::com::sun::star::awt::Key::U)
+#define KEY_V ((sal_uInt16)::com::sun::star::awt::Key::V)
+#define KEY_W ((sal_uInt16)::com::sun::star::awt::Key::W)
+#define KEY_X ((sal_uInt16)::com::sun::star::awt::Key::X)
+#define KEY_Y ((sal_uInt16)::com::sun::star::awt::Key::Y)
+#define KEY_Z ((sal_uInt16)::com::sun::star::awt::Key::Z)
+
+#define KEY_F1 ((sal_uInt16)::com::sun::star::awt::Key::F1)
+#define KEY_F2 ((sal_uInt16)::com::sun::star::awt::Key::F2)
+#define KEY_F3 ((sal_uInt16)::com::sun::star::awt::Key::F3)
+#define KEY_F4 ((sal_uInt16)::com::sun::star::awt::Key::F4)
+#define KEY_F5 ((sal_uInt16)::com::sun::star::awt::Key::F5)
+#define KEY_F6 ((sal_uInt16)::com::sun::star::awt::Key::F6)
+#define KEY_F7 ((sal_uInt16)::com::sun::star::awt::Key::F7)
+#define KEY_F8 ((sal_uInt16)::com::sun::star::awt::Key::F8)
+#define KEY_F9 ((sal_uInt16)::com::sun::star::awt::Key::F9)
+#define KEY_F10 ((sal_uInt16)::com::sun::star::awt::Key::F10)
+#define KEY_F11 ((sal_uInt16)::com::sun::star::awt::Key::F11)
+#define KEY_F12 ((sal_uInt16)::com::sun::star::awt::Key::F12)
+#define KEY_F13 ((sal_uInt16)::com::sun::star::awt::Key::F13)
+#define KEY_F14 ((sal_uInt16)::com::sun::star::awt::Key::F14)
+#define KEY_F15 ((sal_uInt16)::com::sun::star::awt::Key::F15)
+#define KEY_F16 ((sal_uInt16)::com::sun::star::awt::Key::F16)
+#define KEY_F17 ((sal_uInt16)::com::sun::star::awt::Key::F17)
+#define KEY_F18 ((sal_uInt16)::com::sun::star::awt::Key::F18)
+#define KEY_F19 ((sal_uInt16)::com::sun::star::awt::Key::F19)
+#define KEY_F20 ((sal_uInt16)::com::sun::star::awt::Key::F20)
+#define KEY_F21 ((sal_uInt16)::com::sun::star::awt::Key::F21)
+#define KEY_F22 ((sal_uInt16)::com::sun::star::awt::Key::F22)
+#define KEY_F23 ((sal_uInt16)::com::sun::star::awt::Key::F23)
+#define KEY_F24 ((sal_uInt16)::com::sun::star::awt::Key::F24)
+#define KEY_F25 ((sal_uInt16)::com::sun::star::awt::Key::F25)
+#define KEY_F26 ((sal_uInt16)::com::sun::star::awt::Key::F26)
+
+#define KEY_DOWN ((sal_uInt16)::com::sun::star::awt::Key::DOWN)
+#define KEY_UP ((sal_uInt16)::com::sun::star::awt::Key::UP)
+#define KEY_LEFT ((sal_uInt16)::com::sun::star::awt::Key::LEFT)
+#define KEY_RIGHT ((sal_uInt16)::com::sun::star::awt::Key::RIGHT)
+#define KEY_HOME ((sal_uInt16)::com::sun::star::awt::Key::HOME)
+#define KEY_END ((sal_uInt16)::com::sun::star::awt::Key::END)
+#define KEY_PAGEUP ((sal_uInt16)::com::sun::star::awt::Key::PAGEUP)
+#define KEY_PAGEDOWN ((sal_uInt16)::com::sun::star::awt::Key::PAGEDOWN)
+
+#define KEY_RETURN ((sal_uInt16)::com::sun::star::awt::Key::RETURN)
+#define KEY_ESCAPE ((sal_uInt16)::com::sun::star::awt::Key::ESCAPE)
+#define KEY_TAB ((sal_uInt16)::com::sun::star::awt::Key::TAB)
+#define KEY_BACKSPACE ((sal_uInt16)::com::sun::star::awt::Key::BACKSPACE)
+#define KEY_SPACE ((sal_uInt16)::com::sun::star::awt::Key::SPACE)
+#define KEY_INSERT ((sal_uInt16)::com::sun::star::awt::Key::INSERT)
+#define KEY_DELETE ((sal_uInt16)::com::sun::star::awt::Key::DELETE)
+
+#define KEY_ADD ((sal_uInt16)::com::sun::star::awt::Key::ADD)
+#define KEY_SUBTRACT ((sal_uInt16)::com::sun::star::awt::Key::SUBTRACT)
+#define KEY_MULTIPLY ((sal_uInt16)::com::sun::star::awt::Key::MULTIPLY)
+#define KEY_DIVIDE ((sal_uInt16)::com::sun::star::awt::Key::DIVIDE)
+#define KEY_POINT ((sal_uInt16)::com::sun::star::awt::Key::POINT)
+#define KEY_COMMA ((sal_uInt16)::com::sun::star::awt::Key::COMMA)
+#define KEY_LESS ((sal_uInt16)::com::sun::star::awt::Key::LESS)
+#define KEY_GREATER ((sal_uInt16)::com::sun::star::awt::Key::GREATER)
+#define KEY_EQUAL ((sal_uInt16)::com::sun::star::awt::Key::EQUAL)
+
+#define KEY_OPEN ((sal_uInt16)::com::sun::star::awt::Key::OPEN)
+#define KEY_CUT ((sal_uInt16)::com::sun::star::awt::Key::CUT)
+#define KEY_COPY ((sal_uInt16)::com::sun::star::awt::Key::COPY)
+#define KEY_PASTE ((sal_uInt16)::com::sun::star::awt::Key::PASTE)
+#define KEY_UNDO ((sal_uInt16)::com::sun::star::awt::Key::UNDO)
+#define KEY_REPEAT ((sal_uInt16)::com::sun::star::awt::Key::REPEAT)
+#define KEY_FIND ((sal_uInt16)::com::sun::star::awt::Key::FIND)
+#define KEY_PROPERTIES ((sal_uInt16)::com::sun::star::awt::Key::PROPERTIES)
+#define KEY_FRONT ((sal_uInt16)::com::sun::star::awt::Key::FRONT)
+#define KEY_CONTEXTMENU ((sal_uInt16)::com::sun::star::awt::Key::CONTEXTMENU)
+#define KEY_MENU ((sal_uInt16)::com::sun::star::awt::Key::MENU)
+#define KEY_HELP ((sal_uInt16)::com::sun::star::awt::Key::HELP)
+#define KEY_HANGUL_HANJA ((sal_uInt16)::com::sun::star::awt::Key::HANGUL_HANJA)
+#define KEY_DECIMAL ((sal_uInt16)::com::sun::star::awt::Key::DECIMAL)
+#define KEY_TILDE ((sal_uInt16)::com::sun::star::awt::Key::TILDE)
+#define KEY_QUOTELEFT ((sal_uInt16)::com::sun::star::awt::Key::QUOTELEFT)
+#define KEY_BRACKETLEFT ((sal_uInt16)::com::sun::star::awt::Key::BRACKETLEFT)
+#define KEY_BRACKETRIGHT ((sal_uInt16)::com::sun::star::awt::Key::BRACKETRIGHT)
+#define KEY_SEMICOLON ((sal_uInt16)::com::sun::star::awt::Key::SEMICOLON)
+
+#define KEY_CAPSLOCK ((sal_uInt16)::com::sun::star::awt::Key::CAPSLOCK)
+#define KEY_NUMLOCK ((sal_uInt16)::com::sun::star::awt::Key::NUMLOCK)
+#define KEY_SCROLLLOCK ((sal_uInt16)::com::sun::star::awt::Key::SCROLLLOCK)
+
+// extended Modifier-Keys (only used for modkey events)
+#define MODKEY_LSHIFT 0x0001
+#define MODKEY_RSHIFT 0x0002
+#define MODKEY_LMOD1 0x0004
+#define MODKEY_RMOD1 0x0008
+#define MODKEY_LMOD2 0x0010
+#define MODKEY_RMOD2 0x0020
+#define MODKEY_LMOD3 0x0040
+#define MODKEY_RMOD3 0x0080
+#define MODKEY_SHIFT (MODKEY_LSHIFT|MODKEY_RSHIFT)
+#define MODKEY_MOD1 (MODKEY_LMOD1|MODKEY_RMOD1)
+#define MODKEY_MOD2 (MODKEY_LMOD2|MODKEY_RMOD2)
+#define MODKEY_MOD3 (MODKEY_LMOD3|MODKEY_RMOD3)
+
+// ---------------
+// - Mouse-Types -
+// ---------------
+
+#define MOUSE_LEFT ((sal_uInt16)0x0001)
+#define MOUSE_MIDDLE ((sal_uInt16)0x0002)
+#define MOUSE_RIGHT ((sal_uInt16)0x0004)
+
+// -------------------
+// - Indicator-Types -
+// -------------------
+
+#define INDICATOR_CAPSLOCK 0x0001
+#define INDICATOR_NUMLOCK 0x0002
+#define INDICATOR_SCROLLLOCK 0x0004
+
+#endif // _SV_KEYCODES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
new file mode 100644
index 000000000000..c6b6a1274fa7
--- /dev/null
+++ b/include/vcl/layout.hxx
@@ -0,0 +1,702 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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 _VCLLAYOUT_HXX
+#define _VCLLAYOUT_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/button.hxx>
+#include <vcl/scrbar.hxx>
+#include <vcl/window.hxx>
+#include <boost/multi_array.hpp>
+#include <set>
+
+class VCL_DLLPUBLIC VclContainer : public Window
+{
+public:
+ VclContainer(Window *pParent, WinBits nStyle = WB_HIDE);
+
+ //These take into account the external margins of the rWindow widget
+ //while GetOptimalSize/get_preferred_size and SetPosSizePixel are
+ //oblivious to them
+ static Size getLayoutRequisition(const Window &rWindow);
+ static void setLayoutPosSize(Window &rWindow, const Point &rPos, const Size &rSize);
+
+ //applies the allocation pos and size onto rWindow via setLayoutPosSize taking into account
+ //the rWindows alignment desires within that allocation
+ static void setLayoutAllocation(Window &rWindow, const Point &rPos, const Size &rSize);
+
+ void markLayoutDirty()
+ {
+ m_bLayoutDirty = true;
+ }
+protected:
+ //these are the two that need to be implemented by
+ //containers, figure out how much space you want...
+ virtual Size calculateRequisition() const = 0;
+ //..and decide what to do when set to this size
+ virtual void setAllocation(const Size &rAllocation) = 0;
+
+ virtual sal_uInt16 getDefaultAccessibleRole() const;
+public:
+ //you don't want to override these
+ virtual Size GetOptimalSize() const;
+ virtual void SetPosSizePixel(const Point& rNewPos, const Size& rNewSize);
+ virtual void SetPosPixel(const Point& rAllocPos);
+ virtual void SetSizePixel(const Size& rAllocation);
+private:
+ bool m_bLayoutDirty;
+};
+
+class VCL_DLLPUBLIC VclBox : public VclContainer
+{
+protected:
+ bool m_bHomogeneous;
+ int m_nSpacing;
+public:
+ VclBox(Window *pParent, bool bHomogeneous, int nSpacing)
+ : VclContainer(pParent)
+ , m_bHomogeneous(bHomogeneous)
+ , m_nSpacing(nSpacing)
+ {
+ }
+ void set_spacing(int nSpacing)
+ {
+ m_nSpacing = nSpacing;
+ }
+ int get_spacing() const
+ {
+ return m_nSpacing;
+ }
+ void set_homogeneous(bool bHomogeneous)
+ {
+ m_bHomogeneous = bHomogeneous;
+ }
+ bool get_homogeneous() const
+ {
+ return m_bHomogeneous;
+ }
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+protected:
+ virtual sal_uInt16 getDefaultAccessibleRole() const;
+ void accumulateMaxes(const Size &rChildSize, Size &rSize) const;
+ Size finalizeMaxes(const Size &rSize, sal_uInt16 nVisibleChildren) const;
+
+ virtual Size calculateRequisition() const;
+ virtual void setAllocation(const Size &rAllocation);
+
+ virtual long getPrimaryDimension(const Size &rSize) const = 0;
+ virtual void setPrimaryDimension(Size &rSize, long) const = 0;
+ virtual long getPrimaryCoordinate(const Point &rPos) const = 0;
+ virtual void setPrimaryCoordinate(Point &rPos, long) const = 0;
+ virtual long getSecondaryDimension(const Size &rSize) const = 0;
+ virtual void setSecondaryDimension(Size &rSize, long) const = 0;
+ virtual long getSecondaryCoordinate(const Point &rPos) const = 0;
+ virtual void setSecondaryCoordinate(Point &rPos, long) const = 0;
+
+ virtual bool getPrimaryDimensionChildExpand(const Window &rWindow) const = 0;
+};
+
+class VCL_DLLPUBLIC VclVBox : public VclBox
+{
+public:
+ VclVBox(Window *pParent, bool bHomogeneous = false, int nSpacing = 0)
+ : VclBox(pParent, bHomogeneous, nSpacing)
+ {
+ }
+protected:
+ virtual long getPrimaryDimension(const Size &rSize) const
+ {
+ return rSize.getHeight();
+ }
+ virtual void setPrimaryDimension(Size &rSize, long nHeight) const
+ {
+ rSize.setHeight(nHeight);
+ }
+ virtual long getPrimaryCoordinate(const Point &rPos) const
+ {
+ return rPos.getY();
+ }
+ virtual void setPrimaryCoordinate(Point &rPos, long nPos) const
+ {
+ rPos.setY(nPos);
+ }
+ virtual long getSecondaryDimension(const Size &rSize) const
+ {
+ return rSize.getWidth();
+ }
+ virtual void setSecondaryDimension(Size &rSize, long nWidth) const
+ {
+ rSize.setWidth(nWidth);
+ }
+ virtual long getSecondaryCoordinate(const Point &rPos) const
+ {
+ return rPos.getX();
+ }
+ virtual void setSecondaryCoordinate(Point &rPos, long nPos) const
+ {
+ rPos.setX(nPos);
+ }
+ virtual bool getPrimaryDimensionChildExpand(const Window &rWindow) const
+ {
+ return rWindow.get_expand() || rWindow.get_vexpand();
+ }
+};
+
+class VCL_DLLPUBLIC VclHBox : public VclBox
+{
+public:
+ VclHBox(Window *pParent, bool bHomogeneous = false, int nSpacing = 0)
+ : VclBox(pParent, bHomogeneous, nSpacing)
+ {
+ }
+protected:
+ virtual long getPrimaryDimension(const Size &rSize) const
+ {
+ return rSize.getWidth();
+ }
+ virtual void setPrimaryDimension(Size &rSize, long nWidth) const
+ {
+ rSize.setWidth(nWidth);
+ }
+ virtual long getPrimaryCoordinate(const Point &rPos) const
+ {
+ return rPos.getX();
+ }
+ virtual void setPrimaryCoordinate(Point &rPos, long nPos) const
+ {
+ rPos.setX(nPos);
+ }
+ virtual long getSecondaryDimension(const Size &rSize) const
+ {
+ return rSize.getHeight();
+ }
+ virtual void setSecondaryDimension(Size &rSize, long nHeight) const
+ {
+ rSize.setHeight(nHeight);
+ }
+ virtual long getSecondaryCoordinate(const Point &rPos) const
+ {
+ return rPos.getY();
+ }
+ virtual void setSecondaryCoordinate(Point &rPos, long nPos) const
+ {
+ rPos.setY(nPos);
+ }
+ virtual bool getPrimaryDimensionChildExpand(const Window &rWindow) const
+ {
+ return rWindow.get_expand() || rWindow.get_hexpand();
+ }
+};
+
+enum VclButtonBoxStyle
+{
+ VCL_BUTTONBOX_DEFAULT_STYLE,
+ VCL_BUTTONBOX_SPREAD,
+ VCL_BUTTONBOX_EDGE,
+ VCL_BUTTONBOX_START,
+ VCL_BUTTONBOX_END,
+ VCL_BUTTONBOX_CENTER
+};
+
+class VCL_DLLPUBLIC VclButtonBox : public VclBox
+{
+public:
+ VclButtonBox(Window *pParent, int nSpacing)
+ : VclBox(pParent, false, nSpacing)
+ , m_eLayoutStyle(VCL_BUTTONBOX_DEFAULT_STYLE)
+ {
+ }
+ void set_layout(VclButtonBoxStyle eStyle)
+ {
+ m_eLayoutStyle = eStyle;
+ }
+ VclButtonBoxStyle get_layout() const
+ {
+ return m_eLayoutStyle;
+ }
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+protected:
+ virtual Size calculateRequisition() const;
+ virtual void setAllocation(const Size &rAllocation);
+ Size addSpacing(const Size &rSize, sal_uInt16 nVisibleChildren) const;
+private:
+ VclButtonBoxStyle m_eLayoutStyle;
+ struct Requisition
+ {
+ std::vector<long> m_aMainGroupDimensions;
+ std::vector<long> m_aSubGroupDimensions;
+ Size m_aMainGroupSize;
+ Size m_aSubGroupSize;
+ };
+ Requisition calculatePrimarySecondaryRequisitions() const;
+ Size addReqGroups(const VclButtonBox::Requisition &rReq) const;
+};
+
+class VCL_DLLPUBLIC VclVButtonBox : public VclButtonBox
+{
+public:
+ VclVButtonBox(Window *pParent, int nSpacing = 0)
+ : VclButtonBox(pParent, nSpacing)
+ {
+ }
+protected:
+ virtual long getPrimaryDimension(const Size &rSize) const
+ {
+ return rSize.getHeight();
+ }
+ virtual void setPrimaryDimension(Size &rSize, long nHeight) const
+ {
+ rSize.setHeight(nHeight);
+ }
+ virtual long getPrimaryCoordinate(const Point &rPos) const
+ {
+ return rPos.getY();
+ }
+ virtual void setPrimaryCoordinate(Point &rPos, long nPos) const
+ {
+ rPos.setY(nPos);
+ }
+ virtual long getSecondaryDimension(const Size &rSize) const
+ {
+ return rSize.getWidth();
+ }
+ virtual void setSecondaryDimension(Size &rSize, long nWidth) const
+ {
+ rSize.setWidth(nWidth);
+ }
+ virtual long getSecondaryCoordinate(const Point &rPos) const
+ {
+ return rPos.getX();
+ }
+ virtual void setSecondaryCoordinate(Point &rPos, long nPos) const
+ {
+ rPos.setX(nPos);
+ }
+ virtual bool getPrimaryDimensionChildExpand(const Window &rWindow) const
+ {
+ return rWindow.get_expand() || rWindow.get_vexpand();
+ }
+};
+
+class VCL_DLLPUBLIC VclHButtonBox : public VclButtonBox
+{
+public:
+ VclHButtonBox(Window *pParent, int nSpacing = 0)
+ : VclButtonBox(pParent, nSpacing)
+ {
+ }
+protected:
+ virtual long getPrimaryDimension(const Size &rSize) const
+ {
+ return rSize.getWidth();
+ }
+ virtual void setPrimaryDimension(Size &rSize, long nWidth) const
+ {
+ rSize.setWidth(nWidth);
+ }
+ virtual long getPrimaryCoordinate(const Point &rPos) const
+ {
+ return rPos.getX();
+ }
+ virtual void setPrimaryCoordinate(Point &rPos, long nPos) const
+ {
+ rPos.setX(nPos);
+ }
+ virtual long getSecondaryDimension(const Size &rSize) const
+ {
+ return rSize.getHeight();
+ }
+ virtual void setSecondaryDimension(Size &rSize, long nHeight) const
+ {
+ rSize.setHeight(nHeight);
+ }
+ virtual long getSecondaryCoordinate(const Point &rPos) const
+ {
+ return rPos.getY();
+ }
+ virtual void setSecondaryCoordinate(Point &rPos, long nPos) const
+ {
+ rPos.setY(nPos);
+ }
+ virtual bool getPrimaryDimensionChildExpand(const Window &rWindow) const
+ {
+ return rWindow.get_expand() || rWindow.get_hexpand();
+ }
+};
+
+class VCL_DLLPUBLIC VclGrid : public VclContainer
+{
+private:
+ bool m_bRowHomogeneous;
+ bool m_bColumnHomogeneous;
+ int m_nRowSpacing;
+ int m_nColumnSpacing;
+
+ struct GridEntry
+ {
+ Window *pChild;
+ sal_Int32 nSpanWidth;
+ sal_Int32 nSpanHeight;
+ GridEntry()
+ : pChild(0)
+ , nSpanWidth(0)
+ , nSpanHeight(0)
+ {
+ }
+ };
+
+ typedef boost::multi_array<GridEntry, 2> array_type;
+
+ struct ExtendedGridEntry : GridEntry
+ {
+ int x;
+ int y;
+ ExtendedGridEntry()
+ : x(-1)
+ , y(-1)
+ {
+ }
+ };
+
+ typedef boost::multi_array<ExtendedGridEntry, 2> ext_array_type;
+
+ array_type assembleGrid() const;
+ bool isNullGrid(const array_type& A) const;
+public:
+ struct Value
+ {
+ long m_nValue;
+ bool m_bExpand;
+ Value() : m_nValue(0), m_bExpand(false) {}
+ };
+private:
+ void calcMaxs(const array_type &A, std::vector<Value> &rWidths, std::vector<Value> &rHeights) const;
+
+ virtual Size calculateRequisition() const;
+ virtual void setAllocation(const Size &rAllocation);
+public:
+ VclGrid(Window *pParent)
+ : VclContainer(pParent)
+ , m_bRowHomogeneous(false), m_bColumnHomogeneous(false)
+ , m_nRowSpacing(0), m_nColumnSpacing(0)
+ {
+ }
+ void set_row_homogeneous(bool bHomogeneous)
+ {
+ m_bRowHomogeneous = bHomogeneous;
+ }
+ void set_column_homogeneous(bool bHomogeneous)
+ {
+ m_bColumnHomogeneous = bHomogeneous;
+ }
+ bool get_row_homogeneous() const
+ {
+ return m_bRowHomogeneous;
+ }
+ bool get_column_homogeneous() const
+ {
+ return m_bColumnHomogeneous;
+ }
+ void set_row_spacing(int nSpacing)
+ {
+ m_nRowSpacing = nSpacing;
+ }
+ void set_column_spacing(int nSpacing)
+ {
+ m_nColumnSpacing = nSpacing;
+ }
+ int get_row_spacing() const
+ {
+ return m_nRowSpacing;
+ }
+ int get_column_spacing() const
+ {
+ return m_nColumnSpacing;
+ }
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+};
+
+VCL_DLLPUBLIC void setGridAttach(Window &rWidget, sal_Int32 nLeft, sal_Int32 nTop,
+ sal_Int32 nWidth = 1, sal_Int32 nHeight = 1);
+
+class VCL_DLLPUBLIC VclBin : public VclContainer
+{
+public:
+ VclBin(Window *pParent, WinBits nStyle = WB_HIDE)
+ : VclContainer(pParent, nStyle)
+ {
+ }
+ virtual Window *get_child();
+ virtual const Window *get_child() const;
+ virtual Size calculateRequisition() const;
+ virtual void setAllocation(const Size &rAllocation);
+};
+
+class VCL_DLLPUBLIC VclFrame : public VclBin
+{
+private:
+ Window *m_pLabel;
+private:
+ friend class VclBuilder;
+ void designate_label(Window *pWindow);
+public:
+ VclFrame(Window *pParent)
+ : VclBin(pParent)
+ , m_pLabel(NULL)
+ {
+ }
+ void set_label(const OUString &rLabel);
+ virtual Window *get_child();
+ virtual const Window *get_child() const;
+ Window *get_label_widget();
+ const Window *get_label_widget() const;
+protected:
+ virtual Size calculateRequisition() const;
+ virtual void setAllocation(const Size &rAllocation);
+ virtual OUString getDefaultAccessibleName() const;
+};
+
+class VCL_DLLPUBLIC VclAlignment : public VclBin
+{
+public:
+ VclAlignment(Window *pParent)
+ : VclBin(pParent)
+ , m_nBottomPadding(0)
+ , m_nLeftPadding(0)
+ , m_nRightPadding(0)
+ , m_nTopPadding(0)
+ , m_fXAlign(0.0)
+ , m_fXScale(1.0)
+ , m_fYAlign(0.0)
+ , m_fYScale(1.0)
+ {
+ }
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+protected:
+ virtual Size calculateRequisition() const;
+ virtual void setAllocation(const Size &rAllocation);
+private:
+ sal_Int32 m_nBottomPadding;
+ sal_Int32 m_nLeftPadding;
+ sal_Int32 m_nRightPadding;
+ sal_Int32 m_nTopPadding;
+ float m_fXAlign;
+ float m_fXScale;
+ float m_fYAlign;
+ float m_fYScale;
+};
+
+class VCL_DLLPUBLIC VclExpander : public VclBin
+{
+public:
+ VclExpander(Window *pParent)
+ : VclBin(pParent)
+ , m_bResizeTopLevel(true)
+ , m_aDisclosureButton(this)
+ {
+ m_aDisclosureButton.SetToggleHdl(LINK(this, VclExpander, ClickHdl));
+ m_aDisclosureButton.Show();
+ }
+ virtual Window *get_child();
+ virtual const Window *get_child() const;
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+protected:
+ virtual Size calculateRequisition() const;
+ virtual void setAllocation(const Size &rAllocation);
+private:
+ bool m_bResizeTopLevel;
+ DisclosureButton m_aDisclosureButton;
+ DECL_DLLPRIVATE_LINK(ClickHdl, DisclosureButton* pBtn);
+};
+
+//This is a work in progress, so if you want to put something inside a
+//scrolled window that doesn't handle its own scrolling, then you may need to
+//implement this fully
+class VCL_DLLPUBLIC VclScrolledWindow : public VclBin
+{
+public:
+ VclScrolledWindow(Window *pParent, WinBits nStyle = WB_HIDE | WB_AUTOHSCROLL | WB_AUTOVSCROLL)
+ : VclBin(pParent, nStyle)
+ , m_aVScroll(this, WB_HIDE | WB_VERT)
+ , m_aHScroll(this, WB_HIDE | WB_HORZ)
+ {
+ SetType(WINDOW_SCROLLWINDOW);
+ }
+ virtual Window *get_child();
+ virtual const Window *get_child() const;
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+ ScrollBar& getVertScrollBar() { return m_aVScroll; }
+ ScrollBar& getHorzScrollBar() { return m_aHScroll; }
+ Size getVisibleChildSize() const;
+protected:
+ virtual Size calculateRequisition() const;
+ virtual void setAllocation(const Size &rAllocation);
+private:
+ ScrollBar m_aVScroll;
+ ScrollBar m_aHScroll;
+};
+
+//Enforces that its children are always the same size as itself.
+//Intercepts any Commands intended for its children.
+//
+//by default the Commands are discarded, inherit from this
+//and implement "Command" to get them
+class VCL_DLLPUBLIC VclEventBox : public VclBin
+{
+private:
+ //Any Commands an EventBoxHelper receives are forwarded to its parent
+ //The VclEventBox ensures that m_aEventBoxHelper is the
+ //first child and is transparent, but covers the rest of the children
+ class EventBoxHelper : public Window
+ {
+ public:
+ EventBoxHelper(Window* pParent)
+ : Window(pParent, 0)
+ {
+ SetSizePixel(pParent->GetSizePixel());
+ EnableChildTransparentMode();
+ SetPaintTransparent(true);
+ SetBackground();
+ }
+ virtual void Command(const CommandEvent& rCEvt)
+ {
+ GetParent()->Command(rCEvt);
+ }
+ };
+
+ EventBoxHelper m_aEventBoxHelper;
+public:
+ VclEventBox(Window* pParent)
+ : VclBin(pParent)
+ , m_aEventBoxHelper(this)
+ {
+ m_aEventBoxHelper.Show();
+ }
+ virtual Window *get_child();
+ virtual const Window *get_child() const;
+ virtual Size calculateRequisition() const;
+ virtual void setAllocation(const Size &rAllocation);
+
+ virtual void Command(const CommandEvent& rCEvt);
+};
+
+enum VclSizeGroupMode
+{
+ VCL_SIZE_GROUP_NONE,
+ VCL_SIZE_GROUP_HORIZONTAL,
+ VCL_SIZE_GROUP_VERTICAL,
+ VCL_SIZE_GROUP_BOTH
+};
+
+class VCL_DLLPUBLIC VclSizeGroup
+{
+private:
+ std::set<Window*> m_aWindows;
+ bool m_bIgnoreHidden;
+ VclSizeGroupMode m_eMode;
+
+ void trigger_queue_resize();
+public:
+ VclSizeGroup()
+ : m_bIgnoreHidden(false)
+ , m_eMode(VCL_SIZE_GROUP_HORIZONTAL)
+ {
+ }
+ void insert(Window *pWindow)
+ {
+ m_aWindows.insert(pWindow);
+ }
+ void erase(Window *pWindow)
+ {
+ m_aWindows.erase(pWindow);
+ }
+ const std::set<Window*>& get_widgets() const
+ {
+ return m_aWindows;
+ }
+ std::set<Window*>& get_widgets()
+ {
+ return m_aWindows;
+ }
+ void set_ignore_hidden(bool bIgnoreHidden);
+ bool get_ignore_hidden() const
+ {
+ return m_bIgnoreHidden;
+ }
+ void set_mode(VclSizeGroupMode eMode);
+ VclSizeGroupMode get_mode() const
+ {
+ return m_eMode;
+ }
+ bool set_property(const OString &rKey, const OString &rValue);
+};
+
+VCL_DLLPUBLIC Size bestmaxFrameSizeForScreenSize(const Size &rScreenSize);
+
+//Get first window of a pTopLevel window as
+//if any intermediate layout widgets didn't exist
+//i.e. acts like pChild = pChild->GetWindow(WINDOW_FIRSTCHILD);
+//in a flat hierarchy where dialogs only have one layer
+//of children
+VCL_DLLPUBLIC Window* firstLogicalChildOfParent(Window *pTopLevel);
+
+//Get next window after pChild of a pTopLevel window as
+//if any intermediate layout widgets didn't exist
+//i.e. acts like pChild = pChild->GetWindow(WINDOW_NEXT);
+//in a flat hierarchy where dialogs only have one layer
+//of children
+VCL_DLLPUBLIC Window* nextLogicalChildOfParent(Window *pTopLevel, Window *pChild);
+
+//Get previous window before pChild of a pTopLevel window as
+//if any intermediate layout widgets didn't exist
+//i.e. acts like pChild = pChild->GetWindow(WINDOW_PREV);
+//in a flat hierarchy where dialogs only have one layer
+//of children
+VCL_DLLPUBLIC Window* prevLogicalChildOfParent(Window *pTopLevel, Window *pChild);
+
+//Returns true is the Window has a single child which is a container
+VCL_DLLPUBLIC bool isLayoutEnabled(const Window *pWindow);
+
+VCL_DLLPUBLIC inline bool isContainerWindow(const Window &rWindow)
+{
+ WindowType eType = rWindow.GetType();
+ return (eType == WINDOW_CONTAINER || eType == WINDOW_SCROLLWINDOW);
+}
+
+VCL_DLLPUBLIC inline bool isContainerWindow(const Window *pWindow)
+{
+ return pWindow && isContainerWindow(*pWindow);
+}
+
+//Returns true if the containing dialog is doing its initial
+//layout and isn't visible yet
+VCL_DLLPUBLIC bool isInitialLayout(const Window *pWindow);
+
+// retro-fitting utilities //
+
+//Get a Size which is large enough to contain all children with
+//an equal amount of space at top left and bottom right
+Size getLegacyBestSizeForChildren(const Window &rWindow);
+
+//Get first parent which is not a layout widget
+Window* getNonLayoutParent(Window *pParent);
+
+//Get first real parent which is not a layout widget
+Window* getNonLayoutRealParent(Window *pParent);
+
+//return true if this window and its stack of containers are all shown
+bool isVisibleInLayout(const Window *pWindow);
+
+//return true if this window and its stack of containers are all enabled
+bool isEnabledInLayout(const Window *pWindow);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/lazydelete.hxx b/include/vcl/lazydelete.hxx
new file mode 100644
index 000000000000..ee818eef8df8
--- /dev/null
+++ b/include/vcl/lazydelete.hxx
@@ -0,0 +1,299 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _VCL_LAZYDELETE_HXX
+#define _VCL_LAZYDELETE_HXX
+
+#include "dllapi.h"
+
+#include <vector>
+#include <boost/unordered_map.hpp>
+#include <algorithm>
+
+#if OSL_DEBUG_LEVEL > 2
+#include <typeinfo>
+#include <stdio.h>
+#endif
+
+#include <com/sun/star/lang/XComponent.hpp>
+
+namespace vcl
+{
+ /* Helpers for lazy object deletion
+
+ With vcl it is often necessary to delete objects (especially Windows)
+ in the right order as well as in a way ensuring that the deleted objects
+ are not still on the stack (e.g. deleting a Window in its key handler). To
+ make this easier a helper class is given here which takes care of both
+ sorting as well as lazy deletion.
+
+ The grisly details:
+ LazyDelete is a class that LazyDeletor register to. When vcl's event
+ loop (that is Application::Yield or Application::Reschedule) comes out
+ of the last level, the LazyDelete::flush is called. This will cause
+ LazyDelete to delete all registered LazyDeletor objects.
+
+ LazyDeletor<T> is a one instance object that contains a list of
+ <T> objects to be deleted in sorted order. It is derived from
+ LazyDeletorBase as to be able to register itself in LazyDelete.
+
+ The user calls the static method LazyDeletor<T>::Delete( T* ) with the
+ object to be destroyed lazy. The static method creates the LazyDeletor<T>
+ (which in turn registers itself in LazyDelete) if this is the first time
+ a T* is to be destroyed lazy. It then inserts the object. When the LazyDeletor<T>
+ gets delte it will delete the stored objects in a fashion
+ that will ensure the correct order of deletion via the specialized is_less method
+ (e.g. if a Window is a child of another Window and therefore should be destroyed
+ first it is "less" in this sense)
+
+ LazyDelete::flush will be called when the top of the nested event loop is
+ reached again and will then destroy each registered LazyDeletor<T> which
+ in turn destroys the objects needed to be destroyed lazily. After this
+ the state is as before entering the event loop.
+
+ Preconditions:
+ - The class <T> of which objects are to be destroyed needs a virtual
+ destructor or must be final, else the wrong type will be destroyed.
+ - The destructor of <T> should call LazyDeletor<T>::Undelete( this ). This
+ prevents duplicate deletionin case someone destroys the object prematurely.
+ */
+
+ class LazyDeletorBase;
+ class VCL_DLLPUBLIC LazyDelete
+ {
+ public:
+ /** flush all registered object lists
+ */
+ static void flush();
+ /** register an object list to be destroyed
+ */
+ static void addDeletor( LazyDeletorBase* pDeletor );
+ };
+
+ class VCL_DLLPUBLIC LazyDeletorBase
+ {
+ friend void LazyDelete::flush();
+ protected:
+ LazyDeletorBase();
+ virtual ~LazyDeletorBase();
+ };
+
+ template < typename T >
+ class VCL_DLLPUBLIC LazyDeletor : public LazyDeletorBase
+ {
+ static LazyDeletor< T >* s_pOneInstance;
+
+ struct DeleteObjectEntry
+ {
+ T* m_pObject;
+ bool m_bDeleted;
+
+ DeleteObjectEntry() :
+ m_pObject( NULL ),
+ m_bDeleted( false )
+ {}
+
+ DeleteObjectEntry( T* i_pObject ) :
+ m_pObject( i_pObject ),
+ m_bDeleted( false )
+ {}
+ };
+
+ std::vector< DeleteObjectEntry > m_aObjects;
+ typedef boost::unordered_map< sal_IntPtr, unsigned int > PtrToIndexMap;
+ PtrToIndexMap m_aPtrToIndex;
+
+ /** strict weak ordering funtion to bring objects to be destroyed lazily
+ in correct order, e.g. for Window objects children before parents
+ */
+ static bool is_less( T* left, T* right );
+
+ LazyDeletor() { LazyDelete::addDeletor( this ); }
+ virtual ~LazyDeletor()
+ {
+ #if OSL_DEBUG_LEVEL > 2
+ fprintf( stderr, "%s %p deleted\n",
+ typeid(*this).name(), this );
+ #endif
+ if( s_pOneInstance == this ) // sanity check
+ s_pOneInstance = NULL;
+
+ // do the actual work
+ unsigned int nCount = m_aObjects.size();
+ std::vector<T*> aRealDelete;
+ aRealDelete.reserve( nCount );
+ for( unsigned int i = 0; i < nCount; i++ )
+ {
+ if( ! m_aObjects[i].m_bDeleted )
+ {
+ aRealDelete.push_back( m_aObjects[i].m_pObject );
+ }
+ }
+ // sort the vector of objects to be destroyed
+ std::sort( aRealDelete.begin(), aRealDelete.end(), is_less );
+ nCount = aRealDelete.size();
+ for( unsigned int n = 0; n < nCount; n++ )
+ {
+ #if OSL_DEBUG_LEVEL > 2
+ fprintf( stderr, "%s deletes object %p of type %s\n",
+ typeid(*this).name(),
+ aRealDelete[n],
+ typeid(*aRealDelete[n]).name() );
+ #endif
+ // check if the object to be deleted is not already destroyed
+ // as a side effect of a previous lazily destroyed object
+ if( ! m_aObjects[ m_aPtrToIndex[ reinterpret_cast<sal_IntPtr>(aRealDelete[n]) ] ].m_bDeleted )
+ delete aRealDelete[n];
+ }
+ }
+
+ public:
+ /** mark an object for lazy deletion
+ */
+ static void Delete( T* i_pObject )
+ {
+ if( s_pOneInstance == NULL )
+ s_pOneInstance = new LazyDeletor<T>();
+
+ // is this object already in the list ?
+ // if so mark it as not to be deleted; else insert it
+ PtrToIndexMap::const_iterator dup = s_pOneInstance->m_aPtrToIndex.find( reinterpret_cast<sal_IntPtr>(i_pObject) );
+ if( dup != s_pOneInstance->m_aPtrToIndex.end() )
+ {
+ s_pOneInstance->m_aObjects[ dup->second ].m_bDeleted = false;
+ }
+ else
+ {
+ s_pOneInstance->m_aPtrToIndex[ reinterpret_cast<sal_IntPtr>(i_pObject) ] = s_pOneInstance->m_aObjects.size();
+ s_pOneInstance->m_aObjects.push_back( DeleteObjectEntry( i_pObject ) );
+ }
+ }
+ /** unmark an object already marked for lazy deletion
+ */
+ static void Undelete( T* i_pObject )
+ {
+ if( s_pOneInstance )
+ {
+ PtrToIndexMap::const_iterator it = s_pOneInstance->m_aPtrToIndex.find( reinterpret_cast<sal_IntPtr>(i_pObject) );
+ if( it != s_pOneInstance->m_aPtrToIndex.end() )
+ s_pOneInstance->m_aObjects[ it->second ].m_bDeleted = true;
+ }
+ }
+ };
+
+ /*
+ class DeleteOnDeinit matches a similar need as LazyDelete for static objects:
+ you may not access vcl objects after DeInitVCL has been called this includes their destruction
+ therefore disallowing the existance of static vcl object like e.g. a static BitmapEx
+ To work around this use DeleteOnDeinit<BitmapEx> which will allow you to have a static object container,
+ that will have its contents destroyed on DeinitVCL. The single drawback is that you need to check on the
+ container object whether it still contains content before actually accessing it.
+
+ caveat: when constructing a vcl object, you certainly want to ensure that InitVCL has run already.
+ However this is not necessarily the case when using a class static member or a file level static variable.
+ In these cases make judicious use of the set() method of DeleteOnDeinit, but beware of the changing
+ ownership.
+
+ example use case: use a lazy initialized on call BitmapEx in a paint method. Of course a paint method
+ would not normally be called after DeInitVCL anyway, so the check might not be necessary in a
+ Window::Paint implementation, but always checking is a good idea.
+
+ SomeWindow::Paint()
+ {
+ static vcl::DeleteOnDeinit< BitmapEx > aBmp( new BitmapEx( ResId( 1000, myResMgr ) ) );
+
+ if( aBmp.get() ) // check whether DeInitVCL has been called already
+ DrawBitmapEx( Point( 10, 10 ), *aBmp.get() );
+ }
+ */
+
+ class VCL_DLLPUBLIC DeleteOnDeinitBase
+ {
+ public:
+ static void SAL_DLLPRIVATE ImplDeleteOnDeInit();
+ virtual ~DeleteOnDeinitBase();
+ protected:
+ static void addDeinitContainer( DeleteOnDeinitBase* i_pContainer );
+
+ virtual void doCleanup() = 0;
+ };
+
+ template < typename T >
+ class DeleteOnDeinit : public DeleteOnDeinitBase
+ {
+ T* m_pT;
+ virtual void doCleanup() { delete m_pT; m_pT = NULL; }
+ public:
+ DeleteOnDeinit( T* i_pT ) : m_pT( i_pT ) { addDeinitContainer( this ); }
+ virtual ~DeleteOnDeinit() {}
+
+ // get contents
+ T* get() { return m_pT; }
+
+ // set contents, returning old contents
+ // ownership is transferred !
+ T* set( T* i_pNew ) { T* pOld = m_pT; m_pT = i_pNew; return pOld; }
+
+ // set contents, deleting old contents
+ // ownership is transferred !
+ void reset( T* i_pNew = NULL )
+ { OSL_ASSERT( i_pNew != m_pT || i_pNew == NULL ); T* pOld = m_pT; m_pT = i_pNew; delete pOld; }
+ };
+
+ /** Similar to DeleteOnDeinit, the DeleteUnoReferenceOnDeinit
+ template class makes sure that a static UNO object is disposed
+ and released at the right time.
+
+ Use like
+ static DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory>
+ xStaticFactory (<create factory object>);
+ Reference<lang::XMultiServiceFactory> xFactory (xStaticFactory.get());
+ if (xFactory.is())
+ <do something with xFactory>
+ */
+ template <typename I>
+ class DeleteUnoReferenceOnDeinit : public ::vcl::DeleteOnDeinitBase
+ {
+ ::com::sun::star::uno::Reference<I> m_xI;
+ virtual void doCleanup() { set(NULL); }
+ public:
+ DeleteUnoReferenceOnDeinit(const ::com::sun::star::uno::Reference<I>& r_xI ) : m_xI( r_xI ) {
+ addDeinitContainer( this ); }
+ virtual ~DeleteUnoReferenceOnDeinit() {}
+
+ ::com::sun::star::uno::Reference<I> get (void) { return m_xI; }
+
+ void set (const ::com::sun::star::uno::Reference<I>& r_xNew )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> xComponent (m_xI, ::com::sun::star::uno::UNO_QUERY);
+ m_xI = r_xNew;
+ if (xComponent.is()) try
+ {
+ xComponent->dispose();
+ }
+ catch( ::com::sun::star::uno::Exception& )
+ {
+ }
+ }
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/lineinfo.hxx b/include/vcl/lineinfo.hxx
new file mode 100644
index 000000000000..d5165a63e016
--- /dev/null
+++ b/include/vcl/lineinfo.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 _SV_LINEINFO_HXX
+#define _SV_LINEINFO_HXX
+
+#include <sal/types.h>
+#include <vcl/dllapi.h>
+#include <vcl/vclenum.hxx>
+#include <basegfx/vector/b2enums.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
+
+// ----------------
+// - ImplLineInfo -
+// ----------------
+
+class SvStream;
+namespace basegfx { class B2DPolyPolygon; }
+
+struct ImplLineInfo
+{
+ sal_uLong mnRefCount;
+ LineStyle meStyle;
+ long mnWidth;
+ sal_uInt16 mnDashCount;
+ long mnDashLen;
+ sal_uInt16 mnDotCount;
+ long mnDotLen;
+ long mnDistance;
+
+ basegfx::B2DLineJoin meLineJoin;
+ com::sun::star::drawing::LineCap meLineCap;
+
+ ImplLineInfo();
+ ImplLineInfo( const ImplLineInfo& rImplLineInfo );
+
+ bool operator==( const ImplLineInfo& ) const;
+
+ friend SvStream& operator>>( SvStream& rIStm, ImplLineInfo& rImplLineInfo );
+ friend SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo );
+};
+
+// ------------
+// - LineInfo -
+// ------------
+
+class VCL_DLLPUBLIC LineInfo
+{
+private:
+
+ ImplLineInfo* mpImplLineInfo;
+
+ SAL_DLLPRIVATE void ImplMakeUnique();
+
+public:
+
+ LineInfo( LineStyle eLineStyle = LINE_SOLID, long nWidth = 0L );
+ LineInfo( const LineInfo& rLineInfo );
+ ~LineInfo();
+
+ LineInfo& operator=( const LineInfo& rLineInfo );
+ sal_Bool operator==( const LineInfo& rLineInfo ) const;
+ sal_Bool operator!=( const LineInfo& rLineInfo ) const { return !(LineInfo::operator==( rLineInfo ) ); }
+ sal_Bool IsSameInstance( const LineInfo& rLineInfo ) const { return( mpImplLineInfo == rLineInfo.mpImplLineInfo ); }
+
+ void SetStyle( LineStyle eStyle );
+ LineStyle GetStyle() const { return mpImplLineInfo->meStyle; }
+
+ void SetWidth( long nWidth );
+ long GetWidth() const { return mpImplLineInfo->mnWidth; }
+
+ void SetDashCount( sal_uInt16 nDashCount );
+ sal_uInt16 GetDashCount() const { return mpImplLineInfo->mnDashCount; }
+
+ void SetDashLen( long nDashLen );
+ long GetDashLen() const { return mpImplLineInfo->mnDashLen; }
+
+ void SetDotCount( sal_uInt16 nDotCount );
+ sal_uInt16 GetDotCount() const { return mpImplLineInfo->mnDotCount; }
+
+ void SetDotLen( long nDotLen );
+ long GetDotLen() const { return mpImplLineInfo->mnDotLen; }
+
+ void SetDistance( long nDistance );
+ long GetDistance() const { return mpImplLineInfo->mnDistance; }
+
+ void SetLineJoin(basegfx::B2DLineJoin eLineJoin);
+ basegfx::B2DLineJoin GetLineJoin() const { return mpImplLineInfo->meLineJoin; }
+
+ void SetLineCap(com::sun::star::drawing::LineCap eLineCap);
+ com::sun::star::drawing::LineCap GetLineCap() const { return mpImplLineInfo->meLineCap; }
+
+ sal_Bool IsDefault() const;
+
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, LineInfo& rLineInfo );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const LineInfo& rLineInfo );
+
+ // helper to get decomposed polygon data with the LineInfo applied. The source
+ // hairline polygon is given in io_rLinePolyPolygon. Both given polygons may
+ // contain results; e.g. when no fat line but DasDot is defined, the resut will
+ // be in io_rLinePolyPolygon while o_rFillPolyPolygon will be empty. When fat line
+ // is defined, it will be vice-versa. If none is defined, io_rLinePolyPolygon will
+ // not be changed (but o_rFillPolyPolygon will be freed)
+ void applyToB2DPolyPolygon(
+ basegfx::B2DPolyPolygon& io_rLinePolyPolygon,
+ basegfx::B2DPolyPolygon& o_rFillPolyPolygon) const;
+};
+
+#endif // _SV_LINEINFO_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/longcurr.hxx b/include/vcl/longcurr.hxx
new file mode 100644
index 000000000000..b0d57c392ab7
--- /dev/null
+++ b/include/vcl/longcurr.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 _LONGCURR_HXX
+#define _LONGCURR_HXX
+
+#include <vcl/dllapi.h>
+#include <tools/bigint.hxx>
+#include <vcl/field.hxx>
+
+class LocaleDataWrapper;
+
+// -------------------------
+// - LongCurrencyFormatter -
+// -------------------------
+
+class VCL_DLLPUBLIC LongCurrencyFormatter : public FormatterBase
+{
+private:
+ SAL_DLLPRIVATE friend sal_Bool ImplLongCurrencyReformat( const XubString&, BigInt, BigInt, sal_uInt16, const LocaleDataWrapper&, XubString&, LongCurrencyFormatter& );
+ SAL_DLLPRIVATE void ImpInit();
+
+protected:
+ BigInt mnFieldValue;
+ BigInt mnLastValue;
+ BigInt mnMin;
+ BigInt mnMax;
+ BigInt mnCorrectedValue;
+ OUString maCurrencySymbol;
+ sal_uInt16 mnType;
+ sal_uInt16 mnDecimalDigits;
+ sal_Bool mbThousandSep;
+
+ LongCurrencyFormatter();
+public:
+ ~LongCurrencyFormatter();
+
+ virtual void Reformat();
+ virtual void ReformatAll();
+
+ void SetUseThousandSep( sal_Bool b );
+ sal_Bool IsUseThousandSep() const { return mbThousandSep; }
+
+ void SetCurrencySymbol( const String& rStr );
+ String GetCurrencySymbol() const;
+
+ void SetMin( BigInt nNewMin );
+ BigInt GetMin() const { return mnMin; }
+ void SetMax( BigInt nNewMax );
+ BigInt GetMax() const { return mnMax; }
+
+ void SetDecimalDigits( sal_uInt16 nDigits );
+ sal_uInt16 GetDecimalDigits() const;
+ void SetValue( BigInt nNewValue );
+ void SetUserValue( BigInt nNewValue );
+ BigInt GetValue() const;
+ sal_Bool IsEmptyValue() const { return GetField()->GetText().isEmpty(); }
+
+ BigInt GetCorrectedValue() const { return mnCorrectedValue; }
+};
+
+// ---------------------
+// - LongCurrencyField -
+// ---------------------
+
+class VCL_DLLPUBLIC LongCurrencyField : public SpinField, public LongCurrencyFormatter
+{
+ friend void ImplNewLongCurrencyFieldValue( LongCurrencyField*, BigInt );
+
+private:
+ BigInt mnSpinSize;
+ BigInt mnFirst;
+ BigInt mnLast;
+
+public:
+ LongCurrencyField( Window* pParent, WinBits nWinStyle );
+ ~LongCurrencyField();
+
+ long PreNotify( NotifyEvent& rNEvt );
+ long Notify( NotifyEvent& rNEvt );
+
+ void Modify();
+ void Up();
+ void Down();
+ void First();
+ void Last();
+
+ void SetFirst( BigInt nNewFirst ) { mnFirst = nNewFirst; }
+ BigInt GetFirst() const { return mnFirst; }
+ void SetLast( BigInt nNewLast ) { mnLast = nNewLast; }
+ BigInt GetLast() const { return mnLast; }
+ void SetSpinSize( BigInt nNewSize ) { mnSpinSize = nNewSize; }
+ BigInt GetSpinSize() const { return mnSpinSize; }
+};
+
+// -------------------
+// - LongCurrencyBox -
+// -------------------
+
+class VCL_DLLPUBLIC LongCurrencyBox : public ComboBox, public LongCurrencyFormatter
+{
+public:
+ LongCurrencyBox( Window* pParent, WinBits nWinStyle );
+ ~LongCurrencyBox();
+
+ long PreNotify( NotifyEvent& rNEvt );
+ long Notify( NotifyEvent& rNEvt );
+
+ void Modify();
+ void ReformatAll();
+
+ BigInt GetValue() const
+ { return LongCurrencyFormatter::GetValue(); }
+};
+
+#endif // _LONGCURR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/lstbox.h b/include/vcl/lstbox.h
new file mode 100644
index 000000000000..1d9dd30c809b
--- /dev/null
+++ b/include/vcl/lstbox.h
@@ -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 _SV_LSTBOX_H
+#define _SV_LSTBOX_H
+
+#define LISTBOX_APPEND ((sal_uInt16)0xFFFF)
+#define LISTBOX_ENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
+#define LISTBOX_ERROR ((sal_uInt16)0xFFFF)
+
+// --------------------------------------------------------------------
+
+// the following defines can be used for the SetEntryFlags()
+// and GetEntryFlags() methods
+
+// !! Do not use these flags for user data as they are reserved !!
+// !! to change the internal behaviour of the ListBox implementation !!
+// !! for specific entries. !!
+
+/** this flag disables a selection of an entry completely. It is not
+ possible to select such entries either from the user interface
+ nor from the ListBox methods. Cursor traveling is handled correctly.
+ This flag can be used to add titles to a ListBox.
+*/
+#define LISTBOX_ENTRY_FLAG_DISABLE_SELECTION 0x0000001
+
+/** this flag can be used to make an entry multine capable
+ A normal entry is single line and will therefore be clipped
+ at the right listbox border. Setting this flag enables
+ word breaks for the entry text.
+*/
+#define LISTBOX_ENTRY_FLAG_MULTILINE 0x0000002
+
+/** this flags lets the item be drawn disabled (e.g. in grey text)
+ usage only guaranteed with LISTBOX_ENTRY_FLAG_DISABLE_SELECTION
+*/
+#define LISTBOX_ENTRY_FLAG_DRAW_DISABLED 0x0000004
+
+#endif // _SV_LSTBOX_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx
new file mode 100644
index 000000000000..79026116c473
--- /dev/null
+++ b/include/vcl/lstbox.hxx
@@ -0,0 +1,250 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_LSTBOX_HXX
+#define _SV_LSTBOX_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/ctrl.hxx>
+#include <vcl/lstbox.h>
+
+class Image;
+class ImplListBox;
+class ImplListBoxFloatingWindow;
+class ImplBtn;
+class ImplWin;
+
+// --------------------------------------------------------------------
+// - ListBox -
+// --------------------------------------------------------------------
+
+class VCL_DLLPUBLIC ListBox : public Control
+{
+private:
+ ImplListBox* mpImplLB;
+ ImplListBoxFloatingWindow* mpFloatWin;
+ ImplWin* mpImplWin;
+ ImplBtn* mpBtn;
+ sal_uInt16 mnDDHeight;
+ sal_uInt16 mnSaveValue;
+ sal_Bool mbDDAutoSize;
+ sal_Int32 m_nMaxWidthChars;
+ Link maSelectHdl;
+ Link maDoubleClickHdl;
+ sal_uInt16 mnLineCount;
+
+private:
+ SAL_DLLPRIVATE void ImplInitListBoxData();
+
+ DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplScrollHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplCancelHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplDoubleClickHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplClickBtnHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplPopupModeEndHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplSelectionChangedHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplUserDrawHdl, UserDrawEvent* );
+
+protected:
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ sal_Bool IsDropDownBox() const { return mpFloatWin ? sal_True : sal_False; }
+
+protected:
+ ListBox( WindowType nType );
+
+ virtual void FillLayoutData() const;
+
+public:
+ ListBox( Window* pParent, WinBits nStyle = WB_BORDER );
+ ListBox( Window* pParent, const ResId& rResId );
+ ~ListBox();
+
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ virtual void Select();
+ virtual void DoubleClick();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual Window* GetPreferredKeyInputWindow();
+
+ virtual const Wallpaper& GetDisplayBackground() const;
+
+ virtual void setPosSizePixel( long nX, long nY,
+ long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+ void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
+ { Control::SetPosSizePixel( rNewPos, rNewSize ); }
+ void SetDropDownSizePixel( const Size& rNewSize )
+ { if( IsDropDownBox() ) setPosSizePixel( 0, 0, rNewSize.Width(), rNewSize.Height(), WINDOW_POSSIZE_SIZE | WINDOW_POSSIZE_DROPDOWN ); }
+
+ Rectangle GetDropDownPosSizePixel() const;
+
+ void SetDropDownLineCount( sal_uInt16 nLines );
+ sal_uInt16 GetDropDownLineCount() const;
+
+ void EnableAutoSize( sal_Bool bAuto );
+ sal_Bool IsAutoSizeEnabled() const { return mbDDAutoSize; }
+
+ void EnableDDAutoWidth( sal_Bool b );
+
+ virtual sal_uInt16 InsertEntry( const XubString& rStr, sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const Image& rImage, sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual void RemoveEntry( const XubString& rStr );
+ virtual void RemoveEntry( sal_uInt16 nPos );
+
+ virtual void Clear();
+
+ virtual sal_uInt16 GetEntryPos( const XubString& rStr ) const;
+ virtual sal_uInt16 GetEntryPos( const void* pData ) const;
+ Image GetEntryImage( sal_uInt16 nPos ) const;
+ virtual XubString GetEntry( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetEntryCount() const;
+
+ virtual void SelectEntry( const XubString& rStr, sal_Bool bSelect = sal_True );
+ virtual void SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect = sal_True );
+
+ virtual sal_uInt16 GetSelectEntryCount() const;
+ virtual XubString GetSelectEntry( sal_uInt16 nSelIndex = 0 ) const;
+ virtual sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex = 0 ) const;
+
+ virtual sal_Bool IsEntrySelected( const XubString& rStr ) const;
+ virtual sal_Bool IsEntryPosSelected( sal_uInt16 nPos ) const;
+ virtual void SetNoSelection();
+
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
+
+ /** this methods stores a combination of flags from the
+ LISTBOX_ENTRY_FLAG_* defines at the given entry.
+ See description of the possible LISTBOX_ENTRY_FLAG_* flags
+ for details.
+ Do not use these flags for user data as they are reserved
+ to change the internal behaviour of the ListBox implementation
+ for specific entries.
+ */
+ void SetEntryFlags( sal_uInt16 nPos, long nFlags );
+
+ /** this methods gets the current combination of flags from the
+ LISTBOX_ENTRY_FLAG_* defines from the given entry.
+ See description of the possible LISTBOX_ENTRY_FLAG_* flags
+ for details.
+ */
+ long GetEntryFlags( sal_uInt16 nPos ) const;
+
+ void SetTopEntry( sal_uInt16 nPos );
+ sal_uInt16 GetTopEntry() const;
+
+ void SaveValue() { mnSaveValue = GetSelectEntryPos(); }
+ sal_uInt16 GetSavedValue() const { return mnSaveValue; }
+
+ void SetSeparatorPos( sal_uInt16 n = LISTBOX_ENTRY_NOTFOUND );
+ sal_uInt16 GetSeparatorPos() const;
+
+ sal_Bool IsTravelSelect() const;
+ sal_Bool IsInDropDown() const;
+ void ToggleDropDown();
+
+ void EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackSelection );
+ void EnableMultiSelection( sal_Bool bMulti );
+ sal_Bool IsMultiSelectionEnabled() const;
+
+ void SetReadOnly( sal_Bool bReadOnly = sal_True );
+ sal_Bool IsReadOnly() const;
+
+ Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const;
+
+ void SetUserItemSize( const Size& rSz );
+
+ void EnableUserDraw( sal_Bool bUserDraw );
+
+ void DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False );
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+
+ Size CalcSubEditSize() const; //size of area inside lstbox, i.e. no scrollbar/dropdown
+ Size CalcMinimumSize() const; //size of lstbox area, i.e. including scrollbar/dropdown
+ virtual Size GetOptimalSize() const;
+ Size CalcAdjustedSize( const Size& rPrefSize ) const;
+ Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
+ void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
+
+ sal_uInt16 GetDisplayLineCount() const;
+
+ void EnableMirroring();
+
+ /** checks whether a certain point lies within the bounds of
+ a listbox item and returns the item as well as the character position
+ the point is at.
+
+ <p>If the point is inside an item the item pos is put into <code>rPos</code> and
+ the item-relative character index is returned. If the point is not inside
+ an item -1 is returned and rPos is unchanged.</p>
+
+ @param rPoint
+ tells the point for which an item is requested.
+
+ @param rPos
+ gets the item at the specified point <code>rPoint</code>
+
+ @returns
+ the item-relative character index at point <code>rPos</code> or -1
+ if no item is at that point.
+ */
+ using Control::GetIndexForPoint;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const;
+
+ sal_Int32 getMaxWidthChars() const { return m_nMaxWidthChars; }
+ void setMaxWidthChars(sal_Int32 nWidth);
+
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+};
+
+// ----------------
+// - MultiListBox -
+// ----------------
+
+class VCL_DLLPUBLIC MultiListBox : public ListBox
+{
+public:
+ using ListBox::SaveValue;
+ using ListBox::GetSavedValue;
+private:
+ // Bei MultiListBox nicht erlaubt...
+ void SaveValue();
+ sal_uInt16 GetSavedValue();
+
+public:
+ MultiListBox( Window* pParent, WinBits nStyle = 0 );
+ MultiListBox( Window* pParent, const ResId& rResId );
+};
+
+#endif // _SV_LSTBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/mapmod.hxx b/include/vcl/mapmod.hxx
new file mode 100644
index 000000000000..e6f30cf5089e
--- /dev/null
+++ b/include/vcl/mapmod.hxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_MAPMOD_HXX
+#define _SV_MAPMOD_HXX
+
+#include <tools/gen.hxx>
+#include <tools/fract.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <tools/resid.hxx>
+#include <tools/mapunit.hxx>
+
+class SvStream;
+
+// --------------
+// - ImplMapMode -
+// --------------
+
+class OutputDevice;
+
+class ImplMapMode
+{
+ friend class MapMode;
+ friend class OutputDevice;
+
+private:
+ sal_uLong mnRefCount;
+ MapUnit meUnit;
+ Point maOrigin;
+ Fraction maScaleX;
+ Fraction maScaleY;
+ sal_Bool mbSimple;
+
+ friend SvStream& operator>>( SvStream& rIStm, ImplMapMode& rMapMode );
+ friend SvStream& operator<<( SvStream& rOStm, const ImplMapMode& rMapMode );
+
+ static ImplMapMode* ImplGetStaticMapMode( MapUnit eUnit );
+public:
+ ImplMapMode();
+ ImplMapMode( const ImplMapMode& rImpMapMode );
+};
+
+// -----------
+// - MapMode -
+// -----------
+
+class VCL_DLLPUBLIC MapMode
+{
+ friend class OutputDevice;
+
+private:
+ ImplMapMode* mpImplMapMode;
+
+ SAL_DLLPRIVATE void ImplMakeUnique();
+
+public:
+ MapMode();
+ MapMode( const MapMode& rMapMode );
+ MapMode( MapUnit eUnit );
+ MapMode( MapUnit eUnit, const Point& rLogicOrg,
+ const Fraction& rScaleX, const Fraction& rScaleY );
+ ~MapMode();
+
+ void SetMapUnit( MapUnit eUnit );
+ MapUnit GetMapUnit() const
+ { return mpImplMapMode->meUnit; }
+
+ void SetOrigin( const Point& rOrigin );
+ const Point& GetOrigin() const
+ { return mpImplMapMode->maOrigin; }
+
+ void SetScaleX( const Fraction& rScaleX );
+ const Fraction& GetScaleX() const
+ { return mpImplMapMode->maScaleX; }
+ void SetScaleY( const Fraction& rScaleY );
+ const Fraction& GetScaleY() const
+ { return mpImplMapMode->maScaleY; }
+
+ MapMode& operator=( const MapMode& rMapMode );
+ sal_Bool operator==( const MapMode& rMapMode ) const;
+ sal_Bool operator!=( const MapMode& rMapMode ) const
+ { return !(MapMode::operator==( rMapMode )); }
+ sal_Bool IsDefault() const;
+ sal_Bool IsSameInstance( const MapMode& rMapMode ) const
+ { return (mpImplMapMode == rMapMode.mpImplMapMode); }
+
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, MapMode& rMapMode );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const MapMode& rMapMode );
+};
+
+#endif // _SV_MAPMOD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
new file mode 100644
index 000000000000..c9bc3b538711
--- /dev/null
+++ b/include/vcl/menu.hxx
@@ -0,0 +1,494 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_MENU_HXX
+#define _SV_MENU_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <tools/rc.hxx>
+#include <tools/resid.hxx>
+#include <rsc/rsc-vcl-shared-types.hxx>
+#include <vcl/bitmapex.hxx>
+#include <tools/color.hxx>
+#include <vcl/vclevent.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+
+struct MenuItemData;
+class Point;
+class Size;
+class Rectangle;
+class Menu;
+class MenuItemList;
+class HelpEvent;
+class Image;
+class PopupMenu;
+class KeyCode;
+class KeyEvent;
+class MenuFloatingWindow;
+class Window;
+class SalMenu;
+struct SystemMenuData;
+
+namespace com {
+namespace sun {
+namespace star {
+namespace accessibility {
+ class XAccessible;
+}}}}
+
+namespace vcl { struct MenuLayoutData; }
+
+// --------------
+// - Menu-Types -
+// --------------
+
+#define MENU_APPEND ((sal_uInt16)0xFFFF)
+#define MENU_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
+
+#define POPUPMENU_EXECUTE_DOWN ((sal_uInt16)0x0001)
+#define POPUPMENU_EXECUTE_UP ((sal_uInt16)0x0002)
+#define POPUPMENU_EXECUTE_LEFT ((sal_uInt16)0x0004)
+#define POPUPMENU_EXECUTE_RIGHT ((sal_uInt16)0x0008)
+
+#define POPUPMENU_NOMOUSEUPCLOSE ((sal_uInt16)0x0010)
+
+#define MENU_FLAG_NOAUTOMNEMONICS 0x0001
+#define MENU_FLAG_HIDEDISABLEDENTRIES 0x0002
+
+// overrides default hiding of disabled entries in popup menus
+#define MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES 0x0004
+
+struct ImplMenuDelData
+{
+ ImplMenuDelData* mpNext;
+ const Menu* mpMenu;
+
+ ImplMenuDelData( const Menu* pMenu );
+ ~ImplMenuDelData();
+
+ bool isDeleted() const { return mpMenu == 0; }
+};
+
+// --------
+// - Menu -
+// --------
+
+struct MenuLogo
+{
+ BitmapEx aBitmap;
+ Color aStartColor;
+ Color aEndColor;
+};
+
+class VCL_DLLPUBLIC Menu : public Resource
+{
+ friend class MenuBar;
+ friend class MenuBarWindow;
+ friend class MenuButton;
+ friend class MenuFloatingWindow;
+ friend class PopupMenu;
+ friend class SystemWindow;
+ friend struct ImplMenuDelData;
+private:
+ ImplMenuDelData* mpFirstDel;
+ MenuItemList* pItemList; // Liste mit den MenuItems
+ MenuLogo* pLogo;
+ Menu* pStartedFrom;
+ Window* pWindow;
+
+ Link aActivateHdl; // Active-Handler
+ Link aDeactivateHdl; // Deactivate-Handler
+ Link aHighlightHdl; // Highlight-Handler
+ Link aSelectHdl; // Highlight-Handler
+
+ VclEventListeners maEventListeners;
+ VclEventListeners maChildEventListeners;
+
+ OUString aTitleText; // PopupMenu text
+
+ sal_uLong nEventId;
+ sal_uInt16 mnHighlightedItemPos; // for native menus: keeps track of the highlighted item
+ sal_uInt16 nMenuFlags;
+ sal_uInt16 nDefaultItem; // Id of default item
+ sal_uInt16 nSelectedId;
+
+ // for output:
+ sal_uInt16 nImgOrChkPos;
+ sal_uInt16 nTextPos;
+
+ sal_Bool bIsMenuBar : 1, // Is this a menubar?
+ bCanceled : 1, // Terminated during a callback
+ bInCallback : 1, // In Activate/Deactivate
+ bKilled : 1; // Killed...
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxAccessible;
+ mutable vcl::MenuLayoutData* mpLayoutData;
+ SalMenu* mpSalMenu;
+
+protected:
+ SAL_DLLPRIVATE void ImplInit();
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE Menu* ImplGetStartMenu();
+ SAL_DLLPRIVATE Menu* ImplFindSelectMenu();
+ SAL_DLLPRIVATE Menu* ImplFindMenu( sal_uInt16 nId );
+ SAL_DLLPRIVATE Size ImplCalcSize( Window* pWin );
+ SAL_DLLPRIVATE sal_Bool ImplIsVisible( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsSelectable( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisible() const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetPrevVisible( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetNextVisible( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE void ImplPaint( Window* pWin, sal_uInt16 nBorder, long nOffY = 0, MenuItemData* pThisDataOnly = 0, sal_Bool bHighlighted = sal_False, bool bLayout = false ) const;
+ SAL_DLLPRIVATE void ImplSelect();
+ SAL_DLLPRIVATE void ImplCallHighlight( sal_uInt16 nHighlightItem );
+ SAL_DLLPRIVATE void ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos );
+ DECL_DLLPRIVATE_LINK( ImplCallSelect, void* );
+
+ SAL_DLLPRIVATE void ImplFillLayoutData() const;
+ SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu; }
+ SAL_DLLPRIVATE void ImplSetSalMenu( SalMenu *pMenu );
+ SAL_DLLPRIVATE const XubString& ImplGetHelpText( sal_uInt16 nItemId ) const;
+
+ // returns native check and option menu symbol height in rCheckHeight and rRadioHeight
+ // return value is maximum width and height of checkboxes and radiobuttons
+ SAL_DLLPRIVATE Size ImplGetNativeCheckAndRadioSize( Window*, long& rCheckHeight, long& rRadioHeight ) const;
+
+ // returns native submenu arrow size and spacing from right border
+ // return value is whether it's supported natively
+ SAL_DLLPRIVATE sal_Bool ImplGetNativeSubmenuArrowSize( Window* pWin, Size& rArrowSize, long& rArrowSpacing ) const;
+
+ SAL_DLLPRIVATE void ImplAddDel( ImplMenuDelData &rDel );
+ SAL_DLLPRIVATE void ImplRemoveDel( ImplMenuDelData &rDel );
+public:
+ SAL_DLLPRIVATE void ImplKillLayoutData() const;
+ SAL_DLLPRIVATE Menu* ImplGetStartedFrom() const { return pStartedFrom; }
+
+ Menu();
+ Menu( sal_Bool bMenuBar );
+ SAL_DLLPRIVATE Window* ImplGetWindow() const { return pWindow; }
+ void ImplSelectWithStart( Menu* pStartMenu = NULL );
+
+ public:
+ virtual ~Menu();
+
+ virtual void Activate();
+ virtual void Deactivate();
+ virtual void Highlight();
+ virtual void Select();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+
+ void InsertItem( sal_uInt16 nItemId, const XubString& rStr,
+ MenuItemBits nItemBits = 0,
+ const OString &rIdent = OString(),
+ sal_uInt16 nPos = MENU_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ MenuItemBits nItemBits = 0,
+ const OString &rIdent = OString(),
+ sal_uInt16 nPos = MENU_APPEND );
+ void InsertItem( sal_uInt16 nItemId,
+ const XubString& rString, const Image& rImage,
+ MenuItemBits nItemBits = 0,
+ const OString &rIdent = OString(),
+ sal_uInt16 nPos = MENU_APPEND );
+ void InsertItem( const ResId& rResId, sal_uInt16 nPos = MENU_APPEND );
+ void InsertSeparator( const OString &rIdent = OString(),
+ sal_uInt16 nPos = MENU_APPEND );
+ void RemoveItem( sal_uInt16 nPos );
+ void CopyItem( const Menu& rMenu, sal_uInt16 nPos,
+ sal_uInt16 nNewPos = MENU_APPEND );
+ void Clear();
+
+ void CreateAutoMnemonics();
+
+ void SetMenuFlags( sal_uInt16 nFlags ) { nMenuFlags = nFlags; }
+ sal_uInt16 GetMenuFlags() const { return nMenuFlags; }
+
+ sal_uInt16 GetItemCount() const;
+ sal_uInt16 GetItemId(sal_uInt16 nPos) const;
+ sal_uInt16 GetItemId(const OString &rIdent) const;
+ sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
+ OString GetItemIdent(sal_uInt16 nItemId) const;
+ MenuItemType GetItemType( sal_uInt16 nPos ) const;
+ sal_uInt16 GetCurItemId() const;
+ OString GetCurItemIdent() const;
+
+ void SetDefaultItem( sal_uInt16 nItemId ) { nDefaultItem = nItemId; }
+ sal_uInt16 GetDefaultItem() const { return nDefaultItem; }
+
+ void SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits );
+ MenuItemBits GetItemBits( sal_uInt16 nItemId ) const;
+
+ void SetUserValue( sal_uInt16 nItemId, sal_uLong nValue );
+ sal_uLong GetUserValue( sal_uInt16 nItemId ) const;
+
+ void SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu );
+ PopupMenu* GetPopupMenu( sal_uInt16 nItemId ) const;
+
+ void SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode );
+ KeyCode GetAccelKey( sal_uInt16 nItemId ) const;
+
+ void CheckItem( sal_uInt16 nItemId, sal_Bool bCheck = sal_True );
+ sal_Bool IsItemChecked( sal_uInt16 nItemId ) const;
+
+ void SelectItem( sal_uInt16 nItemId );
+ void DeSelect() { SelectItem( 0xFFFF ); } // MENUITEMPOS_INVALID
+
+ void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True );
+ void EnableItem(const OString &rIdent, bool bEnable = true)
+ {
+ EnableItem(GetItemId(rIdent), bEnable);
+ }
+ sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
+
+ void ShowItem( sal_uInt16 nItemId, sal_Bool bVisible = sal_True );
+ void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, sal_False ); }
+
+ sal_Bool IsItemPosVisible( sal_uInt16 nItemPos ) const;
+ sal_Bool IsMenuVisible() const;
+ sal_Bool IsMenuBar() const { return bIsMenuBar; }
+
+ void RemoveDisabledEntries( sal_Bool bCheckPopups = sal_True, sal_Bool bRemoveEmptyPopups = sal_False );
+ sal_Bool HasValidEntries( sal_Bool bCheckPopups = sal_True );
+
+ void SetItemText( sal_uInt16 nItemId, const XubString& rStr );
+ XubString GetItemText( sal_uInt16 nItemId ) const;
+
+ void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
+ Image GetItemImage( sal_uInt16 nItemId ) const;
+ void SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 );
+ long GetItemImageAngle( sal_uInt16 nItemId ) const;
+ void SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror );
+ sal_Bool GetItemImageMirrorMode( sal_uInt16 ) const;
+
+ void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
+ const XubString& GetItemCommand( sal_uInt16 nItemId ) const;
+
+ void SetHelpText( sal_uInt16 nItemId, const XubString& rString );
+ const XubString& GetHelpText( sal_uInt16 nItemId ) const;
+
+ void SetTipHelpText( sal_uInt16 nItemId, const XubString& rString );
+ const XubString& GetTipHelpText( sal_uInt16 nItemId ) const;
+
+ void SetHelpCommand( sal_uInt16 nItemId, const XubString& rString );
+ const XubString& GetHelpCommand( sal_uInt16 nItemId ) const;
+
+ void SetHelpId( sal_uInt16 nItemId, const OString& rHelpId );
+ OString GetHelpId( sal_uInt16 nItemId ) const;
+
+ void SetActivateHdl( const Link& rLink ) { aActivateHdl = rLink; }
+ const Link& GetActivateHdl() const { return aActivateHdl; }
+
+ void SetDeactivateHdl( const Link& rLink ) { aDeactivateHdl = rLink; }
+ const Link& GetDeactivateHdl() const { return aDeactivateHdl; }
+
+ void SetHighlightHdl( const Link& rLink ) { aHighlightHdl = rLink; }
+ const Link& GetHighlightHdl() const { return aHighlightHdl; }
+
+ void SetSelectHdl( const Link& rLink ) { aSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return aSelectHdl; }
+
+ void SetLogo( const MenuLogo& rLogo );
+ void SetLogo();
+ sal_Bool HasLogo() const { return pLogo ? sal_True : sal_False; }
+ MenuLogo GetLogo() const;
+
+ void AddEventListener( const Link& rEventListener );
+ void RemoveEventListener( const Link& rEventListener );
+ void AddChildEventListener( const Link& rEventListener );
+ void RemoveChildEventListener( const Link& rEventListener );
+
+ Menu& operator =( const Menu& rMenu );
+
+ // Fuer Menu-'Funktionen'
+ MenuItemList* GetItemList() const { return pItemList; }
+
+ // returns the system's menu handle if native menus are supported
+ // pData must point to a SystemMenuData structure
+ sal_Bool GetSystemMenuData( SystemMenuData* pData ) const;
+
+ // accessibility helpers
+
+ // returns the bounding box for the character at index nIndex
+ // where nIndex is relative to the starting index of the item
+ // with id nItemId (in coordinates of the displaying window)
+ Rectangle GetCharacterBounds( sal_uInt16 nItemId, long nIndex ) const;
+ // -1 is returned if no character is at that point
+ // if an index is found the corresponding item id is filled in (else 0)
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
+ // returns the bounding rectangle for an item at pos nItemPos
+ Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible();
+ void SetAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
+
+ // gets the activation key of the specified item
+ KeyEvent GetActivationKey( sal_uInt16 nItemId ) const;
+
+ Window* GetWindow() const { return pWindow; }
+
+ void SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr );
+ XubString GetAccessibleName( sal_uInt16 nItemId ) const;
+
+ // returns whether the item a position nItemPos is highlighted or not.
+ bool IsHighlighted( sal_uInt16 nItemPos ) const;
+
+ void HighlightItem( sal_uInt16 nItemPos );
+ void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
+};
+
+// -----------
+// - MenuBar -
+// -----------
+
+class VCL_DLLPUBLIC MenuBar : public Menu
+{
+ Link maCloserHdl;
+ Link maFloatHdl;
+ Link maHideHdl;
+ sal_Bool mbCloserVisible;
+ sal_Bool mbFloatBtnVisible;
+ sal_Bool mbHideBtnVisible;
+ sal_Bool mbDisplayable;
+
+ friend class Application;
+ friend class Menu;
+ friend class MenuBarWindow;
+ friend class MenuFloatingWindow;
+ friend class SystemWindow;
+
+ SAL_DLLPRIVATE static Window* ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu );
+ SAL_DLLPRIVATE static void ImplDestroy( MenuBar* pMenu, sal_Bool bDelete );
+ SAL_DLLPRIVATE sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu = sal_True );
+
+public:
+ MenuBar();
+ MenuBar( const MenuBar& rMenu );
+ ~MenuBar();
+
+ MenuBar& operator =( const MenuBar& rMenu );
+
+ void ShowCloser( sal_Bool bShow = sal_True );
+ sal_Bool HasCloser() const { return mbCloserVisible; }
+ sal_Bool HasFloatButton() const { return mbFloatBtnVisible; }
+ sal_Bool HasHideButton() const { return mbHideBtnVisible; }
+ void ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide );
+
+ void SelectEntry( sal_uInt16 nId );
+ sal_Bool HandleMenuActivateEvent( Menu *pMenu ) const;
+ sal_Bool HandleMenuDeActivateEvent( Menu *pMenu ) const;
+ sal_Bool HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
+ sal_Bool HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
+ sal_Bool HandleMenuButtonEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
+
+ void SetCloserHdl( const Link& rLink ) { maCloserHdl = rLink; }
+ const Link& GetCloserHdl() const { return maCloserHdl; }
+ void SetFloatButtonClickHdl( const Link& rLink ) { maFloatHdl = rLink; }
+ const Link& GetFloatButtonClickHdl() const { return maFloatHdl; }
+ void SetHideButtonClickHdl( const Link& rLink ) { maHideHdl = rLink; }
+ const Link& GetHideButtonClickHdl() const { return maHideHdl; }
+
+ // - by default a menubar is displayable
+ // - if a menubar is not displayable, its MenuBarWindow will never be shown
+ // and it will be hidden if it was visible before
+ // - note: if a menubar is diplayable, this does not necessarily mean that it is currently visible
+ void SetDisplayable( sal_Bool bDisplayable );
+ sal_Bool IsDisplayable() const { return mbDisplayable; }
+
+ struct MenuBarButtonCallbackArg
+ {
+ sal_uInt16 nId; // Id of the button
+ bool bHighlight; // highlight on/off
+ MenuBar* pMenuBar; // menubar the button belongs to
+ };
+ // add an arbitrary button to the menubar (will appear next to closer)
+ // passed link will be call with a MenuBarButtonCallbackArg on press
+ // passed string will be set as tooltip
+ sal_uInt16 AddMenuBarButton( const Image&, const Link&, const String&, sal_uInt16 nPos = 0 );
+ // set the highlight link for additional button with ID nId
+ // highlight link will be called with a MenuBarButtonHighlightArg
+ // the bHighlight member of that struct shall contain the new state
+ void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& );
+ // returns the rectangle occupied by the additional button named nId
+ // coordinates are relative to the systemwindiow the menubar is attached to
+ // if the menubar is unattached an empty rectangle is returned
+ Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId );
+ void RemoveMenuBarButton( sal_uInt16 nId );
+};
+
+inline MenuBar& MenuBar::operator =( const MenuBar& rMenu )
+{
+ Menu::operator =( rMenu );
+ return *this;
+}
+
+
+// -------------
+// - PopupMenu -
+// -------------
+
+class VCL_DLLPUBLIC PopupMenu : public Menu
+{
+ friend class Menu;
+ friend class MenuFloatingWindow;
+ friend class MenuBarWindow;
+ friend struct MenuItemData;
+
+private:
+ Menu** pRefAutoSubMenu; // keeps track if a pointer to this Menu is stored in the MenuItemData
+
+ SAL_DLLPRIVATE MenuFloatingWindow* ImplGetFloatingWindow() const { return (MenuFloatingWindow*)Menu::ImplGetWindow(); }
+
+protected:
+ SAL_DLLPRIVATE sal_uInt16 ImplExecute( Window* pWindow, const Rectangle& rRect, sal_uLong nPopupFlags, Menu* pStaredFrom, sal_Bool bPreSelectFirst );
+ SAL_DLLPRIVATE long ImplCalcHeight( sal_uInt16 nEntries ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry = 0, sal_uInt16* pLastVisible = NULL ) const;
+
+public:
+ PopupMenu();
+ PopupMenu( const PopupMenu& rMenu );
+ PopupMenu( const ResId& rResId );
+ ~PopupMenu();
+
+ void SetText( const OUString& rTitle ) { aTitleText = rTitle; }
+ const OUString& GetText() const { return aTitleText; }
+
+ sal_uInt16 Execute( Window* pWindow, const Point& rPopupPos );
+ sal_uInt16 Execute( Window* pWindow, const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+
+ // Fuer das TestTool
+ void EndExecute( sal_uInt16 nSelect = 0 );
+ void SelectEntry( sal_uInt16 nId );
+ void SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only
+
+ static sal_Bool IsInExecute();
+ static PopupMenu* GetActivePopupMenu();
+
+ PopupMenu& operator =( const PopupMenu& rMenu );
+};
+
+inline PopupMenu& PopupMenu::operator =( const PopupMenu& rMenu )
+{
+ Menu::operator =( rMenu );
+ return *this;
+}
+
+#endif // _SV_MENU_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/menubtn.hxx b/include/vcl/menubtn.hxx
new file mode 100644
index 000000000000..4036ee9059b1
--- /dev/null
+++ b/include/vcl/menubtn.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 _SV_MENUBTN_HXX
+#define _SV_MENUBTN_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/button.hxx>
+
+class Timer;
+class PopupMenu;
+class VclBuilder;
+class VclSimpleEvent;
+
+// --------------------
+// - MenuButton-Types -
+// --------------------
+
+#define MENUBUTTON_MENUMODE_TIMED ((sal_uInt16)0x0001)
+
+// --------------
+// - MenuButton -
+// --------------
+
+class VCL_DLLPUBLIC MenuButton : public PushButton
+{
+private:
+ friend class VclBuilder;
+
+ Rectangle maFocusRect;
+ Timer* mpMenuTimer;
+ PopupMenu* mpOwnMenu;
+ PopupMenu* mpMenu;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnMenuMode;
+ Link maActivateHdl;
+ Link maSelectHdl;
+
+ SAL_DLLPRIVATE void ImplInitMenuButtonData();
+ SAL_DLLPRIVATE void ImplExecuteMenu();
+ DECL_DLLPRIVATE_LINK( ImplMenuTimeoutHdl, void* );
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE MenuButton( const MenuButton & );
+ SAL_DLLPRIVATE MenuButton& operator=( const MenuButton & );
+
+protected:
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+ MenuButton( Window* pParent, WinBits nStyle = 0 );
+ MenuButton( Window* pParent, const ResId& rResId );
+ ~MenuButton();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+
+ virtual void Activate();
+ virtual void Select();
+
+ void SetMenuMode( sal_uInt16 nMode );
+ sal_uInt16 GetMenuMode() const { return mnMenuMode; }
+
+ void SetPopupMenu( PopupMenu* pNewMenu );
+ PopupMenu* GetPopupMenu() const { return mpMenu; }
+
+ sal_uInt16 GetCurItemId() const { return mnCurItemId; }
+ OString GetCurItemIdent() const;
+ void SetCurItemId( sal_uInt16 nItemId ) { mnCurItemId = nItemId; }
+
+ void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; }
+ const Link& GetActivateHdl() const { return maActivateHdl; }
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+};
+
+#endif // _SV_MENUBTN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
new file mode 100644
index 000000000000..961baaecd1ff
--- /dev/null
+++ b/include/vcl/metaact.hxx
@@ -0,0 +1,1319 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_METAACT_HXX
+#define _SV_METAACT_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/gradient.hxx>
+#include <vcl/hatch.hxx>
+#include <vcl/wall.hxx>
+#include <vcl/font.hxx>
+#include <tools/poly.hxx>
+#include <vcl/bitmap.hxx>
+#include <vcl/bitmapex.hxx>
+#include <vcl/region.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/outdev.hxx>
+#include <vcl/gdimtf.hxx>
+#include <vcl/gfxlink.hxx>
+#include <vcl/lineinfo.hxx>
+
+class SvStream;
+
+#define META_NULL_ACTION (0)
+#define META_PIXEL_ACTION (100)
+#define META_POINT_ACTION (101)
+#define META_LINE_ACTION (102)
+#define META_RECT_ACTION (103)
+#define META_ROUNDRECT_ACTION (104)
+#define META_ELLIPSE_ACTION (105)
+#define META_ARC_ACTION (106)
+#define META_PIE_ACTION (107)
+#define META_CHORD_ACTION (108)
+#define META_POLYLINE_ACTION (109)
+#define META_POLYGON_ACTION (110)
+#define META_POLYPOLYGON_ACTION (111)
+#define META_TEXT_ACTION (112)
+#define META_TEXTARRAY_ACTION (113)
+#define META_STRETCHTEXT_ACTION (114)
+#define META_TEXTRECT_ACTION (115)
+#define META_BMP_ACTION (116)
+#define META_BMPSCALE_ACTION (117)
+#define META_BMPSCALEPART_ACTION (118)
+#define META_BMPEX_ACTION (119)
+#define META_BMPEXSCALE_ACTION (120)
+#define META_BMPEXSCALEPART_ACTION (121)
+#define META_MASK_ACTION (122)
+#define META_MASKSCALE_ACTION (123)
+#define META_MASKSCALEPART_ACTION (124)
+#define META_GRADIENT_ACTION (125)
+#define META_HATCH_ACTION (126)
+#define META_WALLPAPER_ACTION (127)
+#define META_CLIPREGION_ACTION (128)
+#define META_ISECTRECTCLIPREGION_ACTION (129)
+#define META_ISECTREGIONCLIPREGION_ACTION (130)
+#define META_MOVECLIPREGION_ACTION (131)
+#define META_LINECOLOR_ACTION (132)
+#define META_FILLCOLOR_ACTION (133)
+#define META_TEXTCOLOR_ACTION (134)
+#define META_TEXTFILLCOLOR_ACTION (135)
+#define META_TEXTALIGN_ACTION (136)
+#define META_MAPMODE_ACTION (137)
+#define META_FONT_ACTION (138)
+#define META_PUSH_ACTION (139)
+#define META_POP_ACTION (140)
+#define META_RASTEROP_ACTION (141)
+#define META_TRANSPARENT_ACTION (142)
+#define META_EPS_ACTION (143)
+#define META_REFPOINT_ACTION (144)
+#define META_TEXTLINECOLOR_ACTION (145)
+#define META_TEXTLINE_ACTION (146)
+#define META_FLOATTRANSPARENT_ACTION (147)
+#define META_GRADIENTEX_ACTION (148)
+#define META_LAYOUTMODE_ACTION (149)
+#define META_TEXTLANGUAGE_ACTION (150)
+#define META_OVERLINECOLOR_ACTION (151)
+
+#define META_COMMENT_ACTION (512)
+
+struct ImplMetaReadData
+{
+ rtl_TextEncoding meActualCharSet;
+
+ ImplMetaReadData() :
+ meActualCharSet( RTL_TEXTENCODING_ASCII_US )
+ {
+ }
+};
+
+struct ImplMetaWriteData
+{
+ rtl_TextEncoding meActualCharSet;
+
+ ImplMetaWriteData() :
+ meActualCharSet( RTL_TEXTENCODING_ASCII_US )
+ {
+ }
+};
+
+#define DECL_META_ACTION( Name, nType ) \
+ Meta##Name##Action(); \
+protected: \
+ virtual ~Meta##Name##Action(); \
+public: \
+ virtual void Execute( OutputDevice* pOut ); \
+ virtual MetaAction* Clone(); \
+ virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData ); \
+ virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
+
+#define IMPL_META_ACTION( Name, nType ) \
+Meta##Name##Action::Meta##Name##Action() : \
+ MetaAction( nType ) {} \
+Meta##Name##Action::~Meta##Name##Action() {}
+
+class VCL_DLLPUBLIC MetaAction
+{
+private:
+ sal_uLong mnRefCount;
+ sal_uInt16 mnType;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+protected:
+ virtual ~MetaAction();
+
+public:
+ MetaAction();
+ MetaAction( sal_uInt16 nType );
+
+ virtual void Execute( OutputDevice* pOut );
+
+ virtual MetaAction* Clone();
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData );
+ virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
+
+ sal_uInt16 GetType() const { return mnType; }
+ sal_uLong GetRefCount() const { return mnRefCount; }
+ void ResetRefCount() { mnRefCount = 1; }
+ void Duplicate() { mnRefCount++; }
+ void Delete() { if ( 0 == --mnRefCount ) delete this; }
+
+public:
+ static MetaAction* ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData );
+};
+
+class VCL_DLLPUBLIC MetaPixelAction : public MetaAction
+{
+private:
+ Point maPt;
+ Color maColor;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Pixel, META_PIXEL_ACTION )
+
+ MetaPixelAction( const Point& rPt, const Color& rColor );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Point& GetPoint() const { return maPt; }
+ const Color& GetColor() const { return maColor; }
+};
+
+class VCL_DLLPUBLIC MetaPointAction : public MetaAction
+{
+private:
+ Point maPt;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Point, META_POINT_ACTION )
+
+ MetaPointAction( const Point& rPt );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Point& GetPoint() const { return maPt; }
+};
+
+class VCL_DLLPUBLIC MetaLineAction : public MetaAction
+{
+private:
+
+ LineInfo maLineInfo;
+ Point maStartPt;
+ Point maEndPt;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Line, META_LINE_ACTION )
+
+ MetaLineAction( const Point& rStart, const Point& rEnd );
+ MetaLineAction( const Point& rStart, const Point& rEnd,
+ const LineInfo& rLineInfo );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Point& GetStartPoint() const { return maStartPt; }
+ const Point& GetEndPoint() const { return maEndPt; }
+ const LineInfo& GetLineInfo() const { return maLineInfo; }
+};
+
+class VCL_DLLPUBLIC MetaRectAction : public MetaAction
+{
+private:
+
+ Rectangle maRect;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+public:
+ DECL_META_ACTION( Rect, META_RECT_ACTION )
+
+ MetaRectAction( const Rectangle& rRect );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Rectangle& GetRect() const { return maRect; }
+};
+
+class VCL_DLLPUBLIC MetaRoundRectAction : public MetaAction
+{
+private:
+
+ Rectangle maRect;
+ sal_uInt32 mnHorzRound;
+ sal_uInt32 mnVertRound;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( RoundRect, META_ROUNDRECT_ACTION )
+
+ MetaRoundRectAction( const Rectangle& rRect,
+ sal_uInt32 nHorzRound, sal_uInt32 nVertRound );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Rectangle& GetRect() const { return maRect; }
+ sal_uInt32 GetHorzRound() const { return mnHorzRound; }
+ sal_uInt32 GetVertRound() const { return mnVertRound; }
+};
+
+class VCL_DLLPUBLIC MetaEllipseAction : public MetaAction
+{
+private:
+
+ Rectangle maRect;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Ellipse, META_ELLIPSE_ACTION )
+
+ MetaEllipseAction( const Rectangle& rRect );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Rectangle& GetRect() const { return maRect; }
+};
+
+class VCL_DLLPUBLIC MetaArcAction : public MetaAction
+{
+private:
+
+ Rectangle maRect;
+ Point maStartPt;
+ Point maEndPt;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Arc, META_ARC_ACTION )
+
+ MetaArcAction( const Rectangle& rRect,
+ const Point& rStart, const Point& rEnd );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Rectangle& GetRect() const { return maRect; }
+ const Point& GetStartPoint() const { return maStartPt; }
+ const Point& GetEndPoint() const { return maEndPt; }
+};
+
+class VCL_DLLPUBLIC MetaPieAction : public MetaAction
+{
+private:
+
+ Rectangle maRect;
+ Point maStartPt;
+ Point maEndPt;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Pie, META_PIE_ACTION )
+
+ MetaPieAction( const Rectangle& rRect,
+ const Point& rStart, const Point& rEnd );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Rectangle& GetRect() const { return maRect; }
+ const Point& GetStartPoint() const { return maStartPt; }
+ const Point& GetEndPoint() const { return maEndPt; }
+};
+
+class VCL_DLLPUBLIC MetaChordAction : public MetaAction
+{
+private:
+
+ Rectangle maRect;
+ Point maStartPt;
+ Point maEndPt;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Chord, META_CHORD_ACTION )
+
+ MetaChordAction( const Rectangle& rRect,
+ const Point& rStart, const Point& rEnd );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Rectangle& GetRect() const { return maRect; }
+ const Point& GetStartPoint() const { return maStartPt; }
+ const Point& GetEndPoint() const { return maEndPt; }
+};
+
+class VCL_DLLPUBLIC MetaPolyLineAction : public MetaAction
+{
+private:
+
+ LineInfo maLineInfo;
+ Polygon maPoly;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( PolyLine, META_POLYLINE_ACTION )
+
+ MetaPolyLineAction( const Polygon& rPoly );
+ MetaPolyLineAction( const Polygon& rPoly, const LineInfo& rLineInfo );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Polygon& GetPolygon() const { return maPoly; }
+ const LineInfo& GetLineInfo() const { return maLineInfo; }
+};
+
+class VCL_DLLPUBLIC MetaPolygonAction : public MetaAction
+{
+private:
+
+ Polygon maPoly;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Polygon, META_POLYGON_ACTION )
+
+ MetaPolygonAction( const Polygon& rPoly );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Polygon& GetPolygon() const { return maPoly; }
+};
+
+class VCL_DLLPUBLIC MetaPolyPolygonAction : public MetaAction
+{
+private:
+
+ PolyPolygon maPolyPoly;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( PolyPolygon, META_POLYPOLYGON_ACTION )
+
+ MetaPolyPolygonAction( const PolyPolygon& rPolyPoly );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
+};
+
+class VCL_DLLPUBLIC MetaTextAction : public MetaAction
+{
+private:
+
+ Point maPt;
+ OUString maStr;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Text, META_TEXT_ACTION )
+
+ MetaTextAction( const Point& rPt, const OUString& rStr,
+ sal_uInt16 nIndex, sal_uInt16 nLen );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Point& GetPoint() const { return maPt; }
+ const OUString& GetText() const { return maStr; }
+ sal_uInt16 GetIndex() const { return mnIndex; }
+ sal_uInt16 GetLen() const { return mnLen; }
+};
+
+class VCL_DLLPUBLIC MetaTextArrayAction : public MetaAction
+{
+private:
+
+ Point maStartPt;
+ OUString maStr;
+ sal_Int32* mpDXAry;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+protected:
+ virtual ~MetaTextArrayAction();
+
+public:
+ MetaTextArrayAction();
+ MetaTextArrayAction( const MetaTextArrayAction& rAction );
+ MetaTextArrayAction( const Point& rStartPt, const OUString& rStr,
+ const sal_Int32* pDXAry, sal_uInt16 nIndex,
+ sal_uInt16 nLen );
+
+ virtual void Execute( OutputDevice* pOut );
+
+ virtual MetaAction* Clone();
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData );
+ virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
+
+ const Point& GetPoint() const { return maStartPt; }
+ const OUString& GetText() const { return maStr; }
+ sal_uInt16 GetIndex() const { return mnIndex; }
+ sal_uInt16 GetLen() const { return mnLen; }
+ sal_Int32* GetDXArray() const { return mpDXAry; }
+};
+
+class VCL_DLLPUBLIC MetaStretchTextAction : public MetaAction
+{
+private:
+
+ Point maPt;
+ OUString maStr;
+ sal_uInt32 mnWidth;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( StretchText, META_STRETCHTEXT_ACTION )
+
+ MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth,
+ const OUString& rStr,
+ sal_uInt16 nIndex, sal_uInt16 nLen );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Point& GetPoint() const { return maPt; }
+ const OUString& GetText() const { return maStr; }
+ sal_uInt32 GetWidth() const { return mnWidth; }
+ sal_uInt16 GetIndex() const { return mnIndex; }
+ sal_uInt16 GetLen() const { return mnLen; }
+};
+
+class VCL_DLLPUBLIC MetaTextRectAction : public MetaAction
+{
+private:
+
+ Rectangle maRect;
+ OUString maStr;
+ sal_uInt16 mnStyle;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( TextRect, META_TEXTRECT_ACTION )
+
+ MetaTextRectAction( const Rectangle& rRect,
+ const OUString& rStr, sal_uInt16 nStyle );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Rectangle& GetRect() const { return maRect; }
+ const OUString& GetText() const { return maStr; }
+ sal_uInt16 GetStyle() const { return mnStyle; }
+};
+
+class VCL_DLLPUBLIC MetaTextLineAction : public MetaAction
+{
+private:
+
+ Point maPos;
+ long mnWidth;
+ FontStrikeout meStrikeout;
+ FontUnderline meUnderline;
+ FontUnderline meOverline;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( TextLine, META_TEXTLINE_ACTION )
+
+ MetaTextLineAction( const Point& rPos, long nWidth,
+ FontStrikeout eStrikeout,
+ FontUnderline eUnderline,
+ FontUnderline eOverline );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Point& GetStartPoint() const { return maPos; }
+ long GetWidth() const { return mnWidth; }
+ FontStrikeout GetStrikeout() const { return meStrikeout; }
+ FontUnderline GetUnderline() const { return meUnderline; }
+ FontUnderline GetOverline() const { return meOverline; }
+};
+
+class VCL_DLLPUBLIC MetaBmpAction : public MetaAction
+{
+private:
+
+ Bitmap maBmp;
+ Point maPt;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Bmp, META_BMP_ACTION )
+
+ MetaBmpAction( const Point& rPt, const Bitmap& rBmp );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Bitmap& GetBitmap() const { return maBmp; }
+ const Point& GetPoint() const { return maPt; }
+};
+
+class VCL_DLLPUBLIC MetaBmpScaleAction : public MetaAction
+{
+private:
+
+ Bitmap maBmp;
+ Point maPt;
+ Size maSz;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( BmpScale, META_BMPSCALE_ACTION )
+
+ MetaBmpScaleAction( const Point& rPt, const Size& rSz,
+ const Bitmap& rBmp );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Bitmap& GetBitmap() const { return maBmp; }
+ const Point& GetPoint() const { return maPt; }
+ const Size& GetSize() const { return maSz; }
+};
+
+class VCL_DLLPUBLIC MetaBmpScalePartAction : public MetaAction
+{
+private:
+
+ Bitmap maBmp;
+ Point maDstPt;
+ Size maDstSz;
+ Point maSrcPt;
+ Size maSrcSz;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( BmpScalePart, META_BMPSCALEPART_ACTION )
+
+ MetaBmpScalePartAction( const Point& rDstPt, const Size& rDstSz,
+ const Point& rSrcPt, const Size& rSrcSz,
+ const Bitmap& rBmp );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Bitmap& GetBitmap() const { return maBmp; }
+ const Point& GetDestPoint() const { return maDstPt; }
+ const Size& GetDestSize() const { return maDstSz; }
+ const Point& GetSrcPoint() const { return maSrcPt; }
+ const Size& GetSrcSize() const { return maSrcSz; }
+};
+
+class VCL_DLLPUBLIC MetaBmpExAction : public MetaAction
+{
+private:
+
+ BitmapEx maBmpEx;
+ Point maPt;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( BmpEx, META_BMPEX_ACTION )
+
+ MetaBmpExAction( const Point& rPt, const BitmapEx& rBmpEx );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const BitmapEx& GetBitmapEx() const { return maBmpEx; }
+ const Point& GetPoint() const { return maPt; }
+};
+
+class VCL_DLLPUBLIC MetaBmpExScaleAction : public MetaAction
+{
+private:
+
+ BitmapEx maBmpEx;
+ Point maPt;
+ Size maSz;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( BmpExScale, META_BMPEXSCALE_ACTION )
+
+ MetaBmpExScaleAction( const Point& rPt, const Size& rSz,
+ const BitmapEx& rBmpEx ) ;
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const BitmapEx& GetBitmapEx() const { return maBmpEx; }
+ const Point& GetPoint() const { return maPt; }
+ const Size& GetSize() const { return maSz; }
+};
+
+class VCL_DLLPUBLIC MetaBmpExScalePartAction : public MetaAction
+{
+private:
+
+ BitmapEx maBmpEx;
+ Point maDstPt;
+ Size maDstSz;
+ Point maSrcPt;
+ Size maSrcSz;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( BmpExScalePart, META_BMPEXSCALEPART_ACTION )
+
+ MetaBmpExScalePartAction( const Point& rDstPt, const Size& rDstSz,
+ const Point& rSrcPt, const Size& rSrcSz,
+ const BitmapEx& rBmpEx );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const BitmapEx& GetBitmapEx() const { return maBmpEx; }
+ const Point& GetDestPoint() const { return maDstPt; }
+ const Size& GetDestSize() const { return maDstSz; }
+ const Point& GetSrcPoint() const { return maSrcPt; }
+ const Size& GetSrcSize() const { return maSrcSz; }
+};
+
+class VCL_DLLPUBLIC MetaMaskAction : public MetaAction
+{
+private:
+
+ Bitmap maBmp;
+ Color maColor;
+ Point maPt;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Mask, META_MASK_ACTION )
+
+ MetaMaskAction( const Point& rPt,
+ const Bitmap& rBmp,
+ const Color& rColor );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Bitmap& GetBitmap() const { return maBmp; }
+ const Color& GetColor() const { return maColor; }
+ const Point& GetPoint() const { return maPt; }
+};
+
+class VCL_DLLPUBLIC MetaMaskScaleAction : public MetaAction
+{
+private:
+
+ Bitmap maBmp;
+ Color maColor;
+ Point maPt;
+ Size maSz;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( MaskScale, META_MASKSCALE_ACTION )
+
+ MetaMaskScaleAction( const Point& rPt, const Size& rSz,
+ const Bitmap& rBmp,
+ const Color& rColor );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Bitmap& GetBitmap() const { return maBmp; }
+ const Color& GetColor() const { return maColor; }
+ const Point& GetPoint() const { return maPt; }
+ const Size& GetSize() const { return maSz; }
+};
+
+class VCL_DLLPUBLIC MetaMaskScalePartAction : public MetaAction
+{
+private:
+
+ Bitmap maBmp;
+ Color maColor;
+ Point maDstPt;
+ Size maDstSz;
+ Point maSrcPt;
+ Size maSrcSz;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( MaskScalePart, META_MASKSCALEPART_ACTION )
+
+ MetaMaskScalePartAction( const Point& rDstPt, const Size& rDstSz,
+ const Point& rSrcPt, const Size& rSrcSz,
+ const Bitmap& rBmp,
+ const Color& rColor );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Bitmap& GetBitmap() const { return maBmp; }
+ const Color& GetColor() const { return maColor; }
+ const Point& GetDestPoint() const { return maDstPt; }
+ const Size& GetDestSize() const { return maDstSz; }
+ const Point& GetSrcPoint() const { return maSrcPt; }
+ const Size& GetSrcSize() const { return maSrcSz; }
+};
+
+class VCL_DLLPUBLIC MetaGradientAction : public MetaAction
+{
+private:
+
+ Rectangle maRect;
+ Gradient maGradient;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Gradient, META_GRADIENT_ACTION )
+
+ MetaGradientAction( const Rectangle& rRect, const Gradient& rGradient );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Rectangle& GetRect() const { return maRect; }
+ const Gradient& GetGradient() const { return maGradient; }
+};
+
+class VCL_DLLPUBLIC MetaGradientExAction : public MetaAction
+{
+private:
+
+ PolyPolygon maPolyPoly;
+ Gradient maGradient;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( GradientEx, META_GRADIENTEX_ACTION )
+
+ MetaGradientExAction( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
+ const Gradient& GetGradient() const { return maGradient; }
+};
+
+class VCL_DLLPUBLIC MetaHatchAction : public MetaAction
+{
+private:
+
+ PolyPolygon maPolyPoly;
+ Hatch maHatch;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Hatch, META_HATCH_ACTION )
+
+ MetaHatchAction( const PolyPolygon& rPolyPoly, const Hatch& rHatch );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
+ const Hatch& GetHatch() const { return maHatch; }
+};
+
+class VCL_DLLPUBLIC MetaWallpaperAction : public MetaAction
+{
+private:
+
+ Rectangle maRect;
+ Wallpaper maWallpaper;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Wallpaper, META_WALLPAPER_ACTION )
+
+ MetaWallpaperAction( const Rectangle& rRect,
+ const Wallpaper& rPaper );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Rectangle& GetRect() const { return maRect; }
+ const Wallpaper& GetWallpaper() const { return maWallpaper; }
+};
+
+class VCL_DLLPUBLIC MetaClipRegionAction : public MetaAction
+{
+private:
+
+ Region maRegion;
+ sal_Bool mbClip;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( ClipRegion, META_CLIPREGION_ACTION )
+
+ MetaClipRegionAction( const Region& rRegion, sal_Bool bClip );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Region& GetRegion() const { return maRegion; }
+ sal_Bool IsClipping() const { return mbClip; }
+};
+
+class VCL_DLLPUBLIC MetaISectRectClipRegionAction : public MetaAction
+{
+private:
+
+ Rectangle maRect;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( ISectRectClipRegion, META_ISECTRECTCLIPREGION_ACTION )
+
+ MetaISectRectClipRegionAction( const Rectangle& rRect );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Rectangle& GetRect() const { return maRect; }
+};
+
+class VCL_DLLPUBLIC MetaISectRegionClipRegionAction : public MetaAction
+{
+private:
+
+ Region maRegion;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( ISectRegionClipRegion, META_ISECTREGIONCLIPREGION_ACTION )
+
+ MetaISectRegionClipRegionAction( const Region& rRegion );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Region& GetRegion() const { return maRegion; }
+};
+
+class VCL_DLLPUBLIC MetaMoveClipRegionAction : public MetaAction
+{
+private:
+
+ long mnHorzMove;
+ long mnVertMove;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( MoveClipRegion, META_MOVECLIPREGION_ACTION )
+
+ MetaMoveClipRegionAction( long nHorzMove, long nVertMove );
+
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ long GetHorzMove() const { return mnHorzMove; }
+ long GetVertMove() const { return mnVertMove; }
+};
+
+class VCL_DLLPUBLIC MetaLineColorAction : public MetaAction
+{
+private:
+
+ Color maColor;
+ sal_Bool mbSet;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( LineColor, META_LINECOLOR_ACTION )
+
+ MetaLineColorAction( const Color& rColor, sal_Bool bSet );
+
+ const Color& GetColor() const { return maColor; }
+ sal_Bool IsSetting() const { return mbSet; }
+};
+
+class VCL_DLLPUBLIC MetaFillColorAction : public MetaAction
+{
+private:
+
+ Color maColor;
+ sal_Bool mbSet;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( FillColor, META_FILLCOLOR_ACTION )
+
+ MetaFillColorAction( const Color& rColor, sal_Bool bSet );
+
+ const Color& GetColor() const { return maColor; }
+ sal_Bool IsSetting() const { return mbSet; }
+};
+
+class VCL_DLLPUBLIC MetaTextColorAction : public MetaAction
+{
+private:
+
+ Color maColor;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( TextColor, META_TEXTCOLOR_ACTION )
+
+ MetaTextColorAction( const Color& rColor );
+
+ const Color& GetColor() const { return maColor; }
+};
+
+class VCL_DLLPUBLIC MetaTextFillColorAction : public MetaAction
+{
+private:
+
+ Color maColor;
+ sal_Bool mbSet;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( TextFillColor, META_TEXTFILLCOLOR_ACTION )
+
+ MetaTextFillColorAction( const Color& rColor, sal_Bool bSet );
+
+ const Color& GetColor() const { return maColor; }
+ sal_Bool IsSetting() const { return mbSet; }
+};
+
+class VCL_DLLPUBLIC MetaTextLineColorAction : public MetaAction
+{
+private:
+
+ Color maColor;
+ sal_Bool mbSet;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( TextLineColor, META_TEXTLINECOLOR_ACTION )
+
+ MetaTextLineColorAction( const Color& rColor, sal_Bool bSet );
+
+ const Color& GetColor() const { return maColor; }
+ sal_Bool IsSetting() const { return mbSet; }
+};
+
+class VCL_DLLPUBLIC MetaOverlineColorAction : public MetaAction
+{
+private:
+
+ Color maColor;
+ sal_Bool mbSet;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( OverlineColor, META_OVERLINECOLOR_ACTION )
+
+ MetaOverlineColorAction( const Color& rColor, sal_Bool bSet );
+
+ const Color& GetColor() const { return maColor; }
+ sal_Bool IsSetting() const { return mbSet; }
+};
+
+class VCL_DLLPUBLIC MetaTextAlignAction : public MetaAction
+{
+private:
+
+ TextAlign maAlign;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( TextAlign, META_TEXTALIGN_ACTION )
+
+ MetaTextAlignAction( TextAlign aAlign );
+
+ TextAlign GetTextAlign() const { return maAlign; }
+};
+
+class VCL_DLLPUBLIC MetaMapModeAction : public MetaAction
+{
+private:
+
+ MapMode maMapMode;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( MapMode, META_MAPMODE_ACTION )
+
+ MetaMapModeAction( const MapMode& rMapMode );
+
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const MapMode& GetMapMode() const { return maMapMode; }
+};
+
+class VCL_DLLPUBLIC MetaFontAction : public MetaAction
+{
+private:
+
+ Font maFont;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Font, META_FONT_ACTION )
+
+ MetaFontAction( const Font& rFont );
+
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Font& GetFont() const { return maFont; }
+};
+
+class VCL_DLLPUBLIC MetaPushAction : public MetaAction
+{
+private:
+
+ sal_uInt16 mnFlags;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Push, META_PUSH_ACTION )
+
+ MetaPushAction( sal_uInt16 nFlags );
+
+ sal_uInt16 GetFlags() const { return mnFlags; }
+};
+
+class VCL_DLLPUBLIC MetaPopAction : public MetaAction
+{
+public:
+
+ DECL_META_ACTION( Pop, META_POP_ACTION )
+};
+
+class VCL_DLLPUBLIC MetaRasterOpAction : public MetaAction
+{
+private:
+
+ RasterOp meRasterOp;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( RasterOp, META_RASTEROP_ACTION )
+
+ MetaRasterOpAction( RasterOp eRasterOp );
+
+ RasterOp GetRasterOp() const { return meRasterOp; }
+};
+
+class VCL_DLLPUBLIC MetaTransparentAction : public MetaAction
+{
+private:
+
+ PolyPolygon maPolyPoly;
+ sal_uInt16 mnTransPercent;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( Transparent, META_TRANSPARENT_ACTION )
+
+ MetaTransparentAction( const PolyPolygon& rPolyPoly, sal_uInt16 nTransPercent );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
+ sal_uInt16 GetTransparence() const { return mnTransPercent; }
+};
+
+class VCL_DLLPUBLIC MetaFloatTransparentAction : public MetaAction
+{
+private:
+
+ GDIMetaFile maMtf;
+ Point maPoint;
+ Size maSize;
+ Gradient maGradient;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( FloatTransparent, META_FLOATTRANSPARENT_ACTION )
+
+ MetaFloatTransparentAction( const GDIMetaFile& rMtf, const Point& rPos,
+ const Size& rSize, const Gradient& rGradient );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const GDIMetaFile& GetGDIMetaFile() const { return maMtf; }
+ const Point& GetPoint() const { return maPoint; }
+ const Size& GetSize() const { return maSize; }
+ const Gradient& GetGradient() const { return maGradient; }
+};
+
+class VCL_DLLPUBLIC MetaEPSAction : public MetaAction
+{
+private:
+
+ GfxLink maGfxLink;
+ GDIMetaFile maSubst;
+ Point maPoint;
+ Size maSize;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( EPS, META_EPS_ACTION )
+
+ MetaEPSAction( const Point& rPoint, const Size& rSize,
+ const GfxLink& rGfxLink, const GDIMetaFile& rSubst );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const GfxLink& GetLink() const { return maGfxLink; }
+ const GDIMetaFile& GetSubstitute() const { return maSubst; }
+ const Point& GetPoint() const { return maPoint; }
+ const Size& GetSize() const { return maSize; }
+};
+
+class VCL_DLLPUBLIC MetaRefPointAction : public MetaAction
+{
+private:
+
+ Point maRefPoint;
+ sal_Bool mbSet;
+
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( RefPoint, META_REFPOINT_ACTION )
+
+ MetaRefPointAction( const Point& rRefPoint, sal_Bool bSet );
+
+ const Point& GetRefPoint() const { return maRefPoint; }
+ sal_Bool IsSetting() const { return mbSet; }
+};
+
+class VCL_DLLPUBLIC MetaCommentAction : public MetaAction
+{
+private:
+
+ OString maComment;
+ sal_Int32 mnValue;
+ sal_uInt32 mnDataSize;
+ sal_uInt8* mpData;
+
+ SAL_DLLPRIVATE void ImplInitDynamicData( const sal_uInt8* pData, sal_uInt32 nDataSize );
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+protected:
+ ~MetaCommentAction();
+
+public:
+ MetaCommentAction( sal_Int32 nValue = 0L );
+ MetaCommentAction( const MetaCommentAction& rAct );
+ MetaCommentAction( const OString& rComment, sal_Int32 nValue = 0L, const sal_uInt8* pData = NULL, sal_uInt32 nDataSize = 0UL );
+
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ virtual void Execute( OutputDevice* pOut );
+ virtual MetaAction* Clone();
+ virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData );
+ virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
+
+ const OString& GetComment() const { return maComment; }
+ sal_Int32 GetValue() const { return mnValue; }
+ sal_uInt32 GetDataSize() const { return mnDataSize; }
+ const sal_uInt8* GetData() const { return mpData; }
+};
+
+class VCL_DLLPUBLIC MetaLayoutModeAction : public MetaAction
+{
+private:
+
+ sal_uInt32 mnLayoutMode;
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( LayoutMode, META_LAYOUTMODE_ACTION )
+
+ MetaLayoutModeAction( sal_uInt32 nLayoutMode );
+
+ sal_uInt32 GetLayoutMode() const { return mnLayoutMode; }
+};
+
+class VCL_DLLPUBLIC MetaTextLanguageAction : public MetaAction
+{
+private:
+
+ LanguageType meTextLanguage;
+ virtual sal_Bool Compare( const MetaAction& ) const;
+
+public:
+ DECL_META_ACTION( TextLanguage, META_TEXTLANGUAGE_ACTION )
+
+ MetaTextLanguageAction( LanguageType );
+
+ LanguageType GetTextLanguage() const { return meTextLanguage; }
+};
+
+#endif // _SV_METAACT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx
new file mode 100644
index 000000000000..27108d756d2f
--- /dev/null
+++ b/include/vcl/metric.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 _SV_METRIC_HXX
+#define _SV_METRIC_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/font.hxx>
+
+class ImplFontMetric;
+class ImplFontCharMap;
+
+typedef sal_uInt32 sal_UCS4;
+
+// ------------
+// - FontInfo -
+// ------------
+
+class VCL_DLLPUBLIC FontInfo : public Font
+{
+ friend class OutputDevice;
+
+protected:
+ ImplFontMetric* mpImplMetric; // Implementation
+
+public:
+ FontInfo();
+ FontInfo( const FontInfo& );
+ ~FontInfo();
+
+ FontType GetType() const;
+
+ FontInfo& operator=( const FontInfo& );
+ sal_Bool operator==( const FontInfo& ) const;
+ sal_Bool operator!=( const FontInfo& rInfo ) const
+ { return !operator==( rInfo ); }
+};
+
+// --------------
+// - FontMetric -
+// --------------
+
+class VCL_DLLPUBLIC FontMetric : public FontInfo
+{
+public:
+ FontMetric() {}
+ FontMetric( const FontMetric& );
+ ~FontMetric() {}
+
+ long GetAscent() const;
+ long GetDescent() const;
+ long GetIntLeading() const;
+ long GetExtLeading() const;
+ long GetLineHeight() const;
+ long GetSlant() const;
+
+ FontMetric& operator=( const FontMetric& rMetric );
+ sal_Bool operator==( const FontMetric& rMetric ) const;
+ sal_Bool operator!=( const FontMetric& rMetric ) const
+ { return !operator==( rMetric ); }
+};
+
+// ---------------
+// - FontCharMap -
+// ---------------
+
+class VCL_DLLPUBLIC FontCharMap
+{
+private:
+ const ImplFontCharMap* mpImpl;
+
+public:
+ FontCharMap();
+ ~FontCharMap();
+
+ sal_Bool IsDefaultMap() const;
+ sal_Bool HasChar( sal_uInt32 ) const;
+ int CountCharsInRange( sal_uInt32 cMin, sal_uInt32 cMax ) const;
+ int GetCharCount() const;
+
+ sal_uInt32 GetFirstChar() const;
+
+ sal_uInt32 GetNextChar( sal_uInt32 ) const;
+ sal_uInt32 GetPrevChar( sal_uInt32 ) const;
+
+ int GetIndexFromChar( sal_uInt32 ) const;
+ sal_uInt32 GetCharFromIndex( int ) const;
+
+
+private:
+ friend class OutputDevice;
+ void Reset( const ImplFontCharMap* pNewMap = NULL );
+
+ // prevent assignment and copy construction
+ FontCharMap( const FontCharMap& );
+ void operator=( const FontCharMap& );
+};
+
+// ----------------
+// - TextRectInfo -
+// ----------------
+
+class VCL_DLLPUBLIC TextRectInfo
+{
+ friend class OutputDevice;
+
+private:
+ long mnMaxWidth;
+ sal_uInt16 mnLineCount;
+ sal_Bool mbEllipsis;
+
+public:
+ TextRectInfo();
+
+ sal_uInt16 GetLineCount() const { return mnLineCount; }
+ long GetMaxLineWidth() const { return mnMaxWidth; }
+ sal_Bool IsEllipses() const { return mbEllipsis; }
+
+ sal_Bool operator ==( const TextRectInfo& rInfo ) const
+ { return ((mnMaxWidth == rInfo.mnMaxWidth) &&
+ (mnLineCount == rInfo.mnLineCount) &&
+ (mbEllipsis == rInfo.mbEllipsis)); }
+ sal_Bool operator !=( const TextRectInfo& rInfo ) const
+ { return !(TextRectInfo::operator==( rInfo )); }
+};
+
+inline TextRectInfo::TextRectInfo()
+{
+ mnMaxWidth = 0;
+ mnLineCount = 0;
+ mbEllipsis = sal_False;
+}
+
+#endif // _SV_METRIC_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/mnemonic.hxx b/include/vcl/mnemonic.hxx
new file mode 100644
index 000000000000..4ec22b5522a2
--- /dev/null
+++ b/include/vcl/mnemonic.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 _SV_MNEMONIC_HXX
+#define _SV_MNEMONIC_HXX
+
+#include <vcl/dllapi.h>
+#include <tools/string.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/i18n/XCharacterClassification.hpp>
+
+// ---------------------
+// - ImplMnemonicTypes -
+// ---------------------
+
+// Mnemonic Chars, which we want support
+// Latin 0-9
+#define MNEMONIC_RANGE_1_START 0x30
+#define MNEMONIC_RANGE_1_END 0x39
+// Latin A-Z
+#define MNEMONIC_RANGE_2_START 0x41
+#define MNEMONIC_RANGE_2_END 0x5A
+// Cyrillic
+#define MNEMONIC_RANGE_3_START 0x0410
+#define MNEMONIC_RANGE_3_END 0x042F
+// Greek
+#define MNEMONIC_RANGE_4_START 0x0391
+#define MNEMONIC_RANGE_4_END 0x03AB
+#define MNEMONIC_RANGES 4
+#define MAX_MNEMONICS ((MNEMONIC_RANGE_1_END-MNEMONIC_RANGE_1_START+1)+\
+ (MNEMONIC_RANGE_2_END-MNEMONIC_RANGE_2_START+1)+\
+ (MNEMONIC_RANGE_3_END-MNEMONIC_RANGE_3_START+1)+\
+ (MNEMONIC_RANGE_4_END-MNEMONIC_RANGE_4_START+1))
+
+#define MNEMONIC_CHAR ((sal_Unicode)'~')
+#define MNEMONIC_INDEX_NOTFOUND ((sal_uInt16)0xFFFF)
+
+// -------------------------
+// - MnemonicGenerator -
+// -------------------------
+
+class VCL_DLLPUBLIC MnemonicGenerator
+{
+private:
+ // 0 == Mnemonic; >0 == count of characters
+ sal_uInt8 maMnemonics[MAX_MNEMONICS];
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > mxCharClass;
+
+protected:
+ SAL_DLLPRIVATE sal_uInt16 ImplGetMnemonicIndex( sal_Unicode c );
+ SAL_DLLPRIVATE sal_Unicode ImplFindMnemonic( const XubString& rKey );
+
+public:
+ MnemonicGenerator();
+
+ void RegisterMnemonic( const XubString& rKey );
+ sal_Bool CreateMnemonic( XubString& rKey );
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > GetCharClass();
+
+ // returns a string where all '~'-characters and CJK mnemonics of the form (~A) are completely removed
+ static String EraseAllMnemonicChars( const String& rStr );
+};
+
+#endif // _SV_MNEMONIC_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/mnemonicengine.hxx b/include/vcl/mnemonicengine.hxx
new file mode 100644
index 000000000000..e1def2d8d98e
--- /dev/null
+++ b/include/vcl/mnemonicengine.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 VCL_MNEMONICENGINE_HXX
+#define VCL_MNEMONICENGINE_HXX
+
+#include "dllapi.h"
+
+#include <sal/config.h>
+#include <sal/types.h>
+
+#include <memory>
+
+class String;
+class KeyEvent;
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ //====================================================================
+ //= IMnemonicEntryList
+ //====================================================================
+ /// callback for a MnemonicEngine
+ class SAL_NO_VTABLE VCL_DLLPUBLIC IMnemonicEntryList
+ {
+ public:
+ /** returns the first list entry for the mnemonic search
+
+ @return
+ a pointer which can be used to unuquely identify the entry.
+ The MenomonicEngine itself does not use this value, it
+ is only passed to other methods of this callback interface.
+
+ If this value is <NULL/>, searching stops.
+ */
+ virtual const void* FirstSearchEntry( String& _rEntryText ) const = 0;
+
+ /** returns the next list entry for the mnemonic search
+
+ @return
+ a pointer which can be used to unuquely identify the entry.
+ The MenomonicEngine itself does not use this value, it
+ is only passed to other methods of this callback interface.
+
+ If this value is <NULL/>, searching stops.
+
+ If this value is the same as returned by the previous call
+ to <member>FirstSearchEntry</member> (i.e. you cycled
+ around), then searching stops, too.
+ */
+ virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const = 0;
+
+ /** "selects" a given entry.
+
+ Note: The semantics of "select" depends on your implementation. You
+ might actually really select the entry (in the sense of a selected
+ list box entry, for example), you might make it the current entry,
+ if your implementation supports this - whatever.
+
+ @param _pEntry
+ the entry to select. This is the return value of a previous call
+ to <member>FirstSearchEntry</member> or <member>NextSearchEntry</member>.
+ */
+ virtual void SelectSearchEntry( const void* _pEntry ) = 0;
+
+ /** "executes" the current search entry, i.e. the one returned
+ in the previous <member>NextSearchEntry</member> call.
+
+ Note: The semantics of "execute" depends on your implementation. You
+ might even have a list of entries which cannot be executed at all.
+
+ This method is called after <member>SelectSearchEntry</member>,
+ if and only if the current entry's mnemonic is unambiguous.
+
+ For instance, imagine a list which has two entries with the same mnemonic
+ character, say "c". Now if the user presses <code>Alt-C</code>, the MnemonicEngine
+ will call <member>SelectCurrentEntry</member> as soon as it encounters
+ the first entry, but it'll never call <member>ExecuteSearchEntry</member>.
+
+ If, however, "c" is a unique mnemonic character in your entry list, then the
+ call of <member>SelectSearchEntry</member> will be followed by a
+ call to <member>ExecuteSearchEntry</member>.
+
+ This way, you can implement cyclic selection of entries: In
+ <member>FirstSearchEntry</member>, return the entry which was previously
+ selected, and in <member>NextSearchEntry</member>, interlly cycle around
+ in your list. Then, multiple user inputs of <code>Alt-C</code> will
+ cycle through all entries with the mnemonic being "c".
+
+ @param _pEntry
+ the entry to select. This is the return value of a previous call
+ to <member>FirstSearchEntry</member> or <member>NextSearchEntry</member>.
+ */
+ virtual void ExecuteSearchEntry( const void* _pEntry ) const = 0;
+
+ protected:
+ ~IMnemonicEntryList() {}
+ };
+
+ //====================================================================
+ //= MnemonicEngine
+ //====================================================================
+ struct MnemonicEngine_Data;
+ class VCL_DLLPUBLIC MnemonicEngine
+ {
+ ::std::auto_ptr< MnemonicEngine_Data > m_pData;
+
+ public:
+ MnemonicEngine( IMnemonicEntryList& _rEntryList );
+ ~MnemonicEngine();
+
+ /** handles a key event
+
+ If the key event denotes pressing an accelerator key, then the
+ entry list is searched for a matching entry. If such an entry is
+ found, <member>IMnemonicEntryList::SelectSearchEntry</member>
+ is called.
+
+ If the entry is the only one with the given mnemonic character, then
+ also <member>IMnemonicEntryList::ExecuteSearchEntry</member>
+ is called.
+
+ @return
+ if the key event has been handled, and should thus not be processed
+ further.
+ */
+ bool HandleKeyEvent( const KeyEvent& _rKEvt );
+ };
+
+//........................................................................
+} // namespace vcl
+//........................................................................
+
+#endif // VCL_MNEMONICENGINE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/morebtn.hxx b/include/vcl/morebtn.hxx
new file mode 100644
index 000000000000..a715f37357d7
--- /dev/null
+++ b/include/vcl/morebtn.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_MOREBTN_HXX
+#define _SV_MOREBTN_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/mapmod.hxx>
+#include <vcl/button.hxx>
+
+struct ImplMoreButtonData;
+
+// --------------
+// - MoreButton -
+// --------------
+
+class VCL_DLLPUBLIC MoreButton : public PushButton
+{
+private:
+ ImplMoreButtonData* mpMBData;
+ sal_uLong mnDelta;
+ MapUnit meUnit;
+ sal_Bool mbState;
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE MoreButton( const MoreButton & );
+ SAL_DLLPRIVATE MoreButton& operator=( const MoreButton & );
+ SAL_DLLPRIVATE void ShowState();
+
+protected:
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+ MoreButton( Window* pParent, WinBits nStyle = 0 );
+ MoreButton( Window* pParent, const ResId& rResId );
+ ~MoreButton();
+
+ void Click();
+
+ void AddWindow( Window* pWindow );
+
+ void SetDelta( sal_uLong nNewDelta ) { mnDelta = nNewDelta; }
+ sal_uLong GetDelta() const { return mnDelta; }
+
+ void SetMapUnit( MapUnit eNewUnit = MAP_PIXEL ) { meUnit = eNewUnit; }
+ MapUnit GetMapUnit() const { return meUnit; }
+
+ using PushButton::SetState;
+ void SetState( sal_Bool bNewState = sal_True );
+ sal_Bool GetState() const { return mbState; }
+
+ void SetText( const OUString& rNewText );
+ OUString GetText() const;
+
+ void SetMoreText( const OUString& rNewText );
+ void SetLessText( const OUString& rNewText );
+ OUString GetMoreText() const;
+ OUString GetLessText() const;
+};
+
+inline void MoreButton::SetState( sal_Bool bNewState )
+{
+ if ( mbState != bNewState )
+ Click();
+}
+
+#endif // _SV_MOREBTN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/msgbox.hxx b/include/vcl/msgbox.hxx
new file mode 100644
index 000000000000..594d248a6acd
--- /dev/null
+++ b/include/vcl/msgbox.hxx
@@ -0,0 +1,172 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_MSGBOX_HXX
+#define _SV_MSGBOX_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/btndlg.hxx>
+#include <vcl/image.hxx>
+#include <vcl/bitmap.hxx>
+class VclMultiLineEdit;
+class FixedImage;
+class CheckBox;
+
+// -----------------
+// - MessBox-Types -
+// -----------------
+
+// Return-Werte von Execute
+//!!! bei Aenderungen \basic\source\runtime\methods.cxx msgbox anpassen
+
+#define RET_CANCEL 0
+#define RET_OK 1
+#define RET_YES 2
+#define RET_NO 3
+#define RET_RETRY 4
+#define RET_IGNORE 5
+
+#define BUTTONID_OK RET_OK
+#define BUTTONID_CANCEL RET_CANCEL
+#define BUTTONID_YES RET_YES
+#define BUTTONID_NO RET_NO
+#define BUTTONID_RETRY RET_RETRY
+#define BUTTONID_IGNORE RET_IGNORE
+#define BUTTONID_HELP 10
+
+// -----------
+// - MessBox -
+// -----------
+
+class VCL_DLLPUBLIC MessBox : public ButtonDialog
+{
+protected:
+ VclMultiLineEdit* mpVCLMultiLineEdit;
+ FixedImage* mpFixedImage;
+ XubString maMessText;
+ Image maImage;
+ sal_Bool mbHelpBtn;
+ CheckBox* mpCheckBox;
+ XubString maCheckBoxText;
+ sal_Bool mbCheck;
+
+ SAL_DLLPRIVATE void ImplInitMessBoxData();
+ SAL_DLLPRIVATE void ImplInitButtons();
+ SAL_DLLPRIVATE void ImplPosControls();
+
+protected:
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+public:
+ MessBox( Window* pParent, WinBits nStyle,
+ const XubString& rTitle, const XubString& rMessage );
+ MessBox( Window* pParent, const ResId& rResId );
+ ~MessBox();
+
+ virtual void StateChanged( StateChangedType nStateChange );
+
+ void SetMessText( const XubString& rText ) { maMessText = rText; }
+ const XubString& GetMessText() const { return maMessText; }
+
+ void SetImage( const Image& rImage ) { maImage = rImage; }
+ const Image& GetImage() const { return maImage; }
+
+ void SetCheckBoxText( const XubString& rText ) { maCheckBoxText = rText;}
+ const XubString& GetCheckBoxText() const { return maCheckBoxText;}
+ void SetCheckBoxState( sal_Bool bCheck );
+ sal_Bool GetCheckBoxState() const;
+
+ virtual Size GetOptimalSize() const;
+};
+
+// -----------
+// - InfoBox -
+// -----------
+
+class VCL_DLLPUBLIC InfoBox : public MessBox
+{
+private:
+ SAL_DLLPRIVATE void ImplInitInfoBoxData();
+
+public:
+ InfoBox( Window* pParent, const OUString& rMessage );
+ InfoBox( Window* pParent, const ResId & rResId );
+
+ static Image GetStandardImage();
+};
+
+// --------------
+// - WarningBox -
+// --------------
+
+class VCL_DLLPUBLIC WarningBox : public MessBox
+{
+private:
+ SAL_DLLPRIVATE void ImplInitWarningBoxData();
+
+public:
+ WarningBox( Window* pParent, WinBits nStyle,
+ const XubString& rMessage );
+ WarningBox( Window* pParent, const ResId& rResId );
+
+ void SetDefaultCheckBoxText();
+
+ static Image GetStandardImage();
+};
+
+// ------------
+// - ErrorBox -
+// ------------
+
+class VCL_DLLPUBLIC ErrorBox : public MessBox
+{
+private:
+ SAL_DLLPRIVATE void ImplInitErrorBoxData();
+
+public:
+ ErrorBox( Window* pParent, WinBits nStyle,
+ const XubString& rMessage );
+ ErrorBox( Window* pParent, const ResId& rResId );
+
+ static Image GetStandardImage();
+};
+
+// ------------
+// - QueryBox -
+// ------------
+
+class VCL_DLLPUBLIC QueryBox : public MessBox
+{
+private:
+ SAL_DLLPRIVATE void ImplInitQueryBoxData();
+
+public:
+ QueryBox( Window* pParent, WinBits nStyle,
+ const XubString& rMessage );
+ QueryBox( Window* pParent, const ResId& rResId );
+
+ void SetDefaultCheckBoxText();
+
+ static Image GetStandardImage();
+};
+
+#endif // _SV_MSGBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/octree.hxx b/include/vcl/octree.hxx
new file mode 100644
index 000000000000..7d1054db8156
--- /dev/null
+++ b/include/vcl/octree.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 _SV_OCTREE_HXX
+#define _SV_OCTREE_HXX
+
+#include <vcl/salbtype.hxx>
+#include <vcl/dllapi.h>
+
+#define OCTREE_BITS 5
+#define OCTREE_BITS_1 10
+
+typedef struct OctreeNode
+{
+ sal_uLong nCount;
+ sal_uLong nRed;
+ sal_uLong nGreen;
+ sal_uLong nBlue;
+ OctreeNode* pChild[ 8 ];
+ OctreeNode* pNext;
+ OctreeNode* pNextInCache;
+ sal_uInt16 nPalIndex;
+ sal_Bool bLeaf;
+} NODE;
+
+typedef NODE* PNODE;
+typedef PNODE* PPNODE;
+
+class ImpNodeCache;
+class BitmapReadAccess;
+
+class VCL_PLUGIN_PUBLIC Octree
+{
+private:
+
+ BitmapPalette aPal;
+ sal_uLong nMax;
+ sal_uLong nLeafCount;
+ sal_uLong nLevel;
+ PNODE pTree;
+ PNODE pReduce[ OCTREE_BITS + 1 ];
+ BitmapColor* pColor;
+ ImpNodeCache* pNodeCache;
+ const BitmapReadAccess* pAcc;
+ sal_uInt16 nPalIndex;
+
+ Octree() {}
+
+ void CreatePalette( PNODE pNode );
+ void GetPalIndex( PNODE pNode );
+
+ SAL_DLLPRIVATE void ImplCreateOctree();
+ SAL_DLLPRIVATE void ImplDeleteOctree( PPNODE ppNode );
+ SAL_DLLPRIVATE void ImplAdd( PPNODE ppNode );
+ SAL_DLLPRIVATE void ImplReduce();
+
+public:
+
+ Octree( const BitmapReadAccess& rReadAcc, sal_uLong nColors );
+ ~Octree();
+
+ inline const BitmapPalette& GetPalette();
+ inline sal_uInt16 GetBestPaletteIndex( const BitmapColor& rColor );
+};
+
+inline const BitmapPalette& Octree::GetPalette()
+{
+ aPal.SetEntryCount( (sal_uInt16) nLeafCount );
+ nPalIndex = 0;
+ CreatePalette( pTree );
+ return aPal;
+}
+
+inline sal_uInt16 Octree::GetBestPaletteIndex( const BitmapColor& rColor )
+{
+ pColor = &(BitmapColor&) rColor;
+ nPalIndex = 65535;
+ nLevel = 0L;
+ GetPalIndex( pTree );
+ return nPalIndex;
+}
+
+class VCL_PLUGIN_PUBLIC InverseColorMap
+{
+private:
+
+ sal_uInt8* pBuffer;
+ sal_uInt8* pMap;
+ const sal_uLong nBits;
+
+
+ SAL_DLLPRIVATE void ImplCreateBuffers( const sal_uLong nMax );
+
+public:
+
+ explicit InverseColorMap( const BitmapPalette& rPal );
+ ~InverseColorMap();
+
+ inline sal_uInt16 GetBestPaletteIndex( const BitmapColor& rColor );
+};
+
+inline sal_uInt16 InverseColorMap::GetBestPaletteIndex( const BitmapColor& rColor )
+{
+ return pMap[ ( ( (sal_uLong) rColor.GetRed() >> nBits ) << OCTREE_BITS_1 ) |
+ ( ( (sal_uLong) rColor.GetGreen() >> nBits ) << OCTREE_BITS ) |
+ ( (sal_uLong) rColor.GetBlue() >> nBits ) ];
+}
+
+#endif // _SV_OCTREE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/oldprintadaptor.hxx b/include/vcl/oldprintadaptor.hxx
new file mode 100644
index 000000000000..adbf49c2dcad
--- /dev/null
+++ b/include/vcl/oldprintadaptor.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 _VCL_OLDPRINTADAPTOR
+#define _VCL_OLDPRINTADAPTOR
+
+#include "vcl/print.hxx"
+
+namespace vcl
+{
+ struct ImplOldStyleAdaptorData;
+ class VCL_DLLPUBLIC OldStylePrintAdaptor : public PrinterController
+ {
+ ImplOldStyleAdaptorData* mpData;
+ public:
+ OldStylePrintAdaptor( const boost::shared_ptr< Printer >& );
+ virtual ~OldStylePrintAdaptor();
+
+ void StartPage();
+ void EndPage();
+
+ virtual int getPageCount() const;
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getPageParameters( int i_nPage ) const;
+ virtual void printPage( int i_nPage ) const;
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
new file mode 100644
index 000000000000..b0bb8e5c9389
--- /dev/null
+++ b/include/vcl/outdev.hxx
@@ -0,0 +1,1170 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_OUTDEV_HXX
+#define _SV_OUTDEV_HXX
+
+#include <tools/gen.hxx>
+#include <tools/string.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <tools/rc.hxx>
+#include <tools/color.hxx>
+#include <vcl/font.hxx>
+#include <vcl/region.hxx>
+#include <vcl/mapmod.hxx>
+#include <vcl/wall.hxx>
+#include <vcl/settings.hxx>
+#include <vcl/salnativewidgets.hxx>
+#include <tools/poly.hxx>
+#include <basegfx/vector/b2enums.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include <unotools/fontdefs.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
+#include <vector>
+
+struct ImplOutDevData;
+class ImplFontEntry;
+struct ImplObjStack;
+struct ImplKernPairData;
+struct SystemGraphicsData;
+struct SystemFontData;
+struct SystemTextLayoutData;
+class ImplFontCache;
+class ImplDevFontList;
+class ImplGetDevFontList;
+class ImplGetDevSizeList;
+class ImplMultiTextLineInfo;
+class SalGraphics;
+class Gradient;
+class Hatch;
+class Bitmap;
+class BitmapReadAccess;
+class BitmapEx;
+class Image;
+class TextRectInfo;
+class FontInfo;
+class FontMetric;
+class GDIMetaFile;
+class GfxLink;
+class Line;
+class LineInfo;
+class AlphaMask;
+class FontCharMap;
+class SalLayout;
+class ImplLayoutArgs;
+class ImplFontAttributes;
+class VirtualDevice;
+
+namespace com {
+namespace sun {
+namespace star {
+namespace rendering {
+ class XCanvas;
+}}}}
+namespace basegfx {
+ class B2DHomMatrix;
+ class B2DPolygon;
+ class B2DPolyPolygon;
+}
+
+namespace com {
+namespace sun {
+namespace star {
+namespace awt {
+ class XGraphics;
+} } } }
+
+typedef std::vector< Rectangle > MetricVector;
+
+namespace vcl
+{
+ class PDFWriterImpl;
+ class ExtOutDevData;
+ class ITextLayout;
+ struct FontCapabilities;
+}
+
+// ---------------------
+// - OutputDevice-Data -
+// ---------------------
+
+struct ImplMapRes
+{
+ long mnMapOfsX; // Offset in X Richtung
+ long mnMapOfsY; // Offset in Y Richtung
+ long mnMapScNumX; // Skal.-faktor Zaehler X Richtung
+ long mnMapScNumY; // Skal.-faktor Zaehler Y Richtung
+ long mnMapScDenomX; // Skal.-faktor Nenner X Richtung
+ long mnMapScDenomY; // Skal.-faktor Nenner Y Richtung
+};
+
+struct ImplThresholdRes
+{
+ long mnThresLogToPixX; // Schwellenwerte fuer Berechnung
+ long mnThresLogToPixY; // mit BigInts
+ long mnThresPixToLogX; // ""
+ long mnThresPixToLogY; // ""
+};
+
+// ----------------------
+// - OutputDevice-Types -
+// ----------------------
+
+// Flags for Push()
+#define PUSH_LINECOLOR ((sal_uInt16)0x0001)
+#define PUSH_FILLCOLOR ((sal_uInt16)0x0002)
+#define PUSH_FONT ((sal_uInt16)0x0004)
+#define PUSH_TEXTCOLOR ((sal_uInt16)0x0008)
+#define PUSH_MAPMODE ((sal_uInt16)0x0010)
+#define PUSH_CLIPREGION ((sal_uInt16)0x0020)
+#define PUSH_RASTEROP ((sal_uInt16)0x0040)
+#define PUSH_TEXTFILLCOLOR ((sal_uInt16)0x0080)
+#define PUSH_TEXTALIGN ((sal_uInt16)0x0100)
+#define PUSH_REFPOINT ((sal_uInt16)0x0200)
+#define PUSH_TEXTLINECOLOR ((sal_uInt16)0x0400)
+#define PUSH_TEXTLAYOUTMODE ((sal_uInt16)0x0800)
+#define PUSH_TEXTLANGUAGE ((sal_uInt16)0x1000)
+#define PUSH_OVERLINECOLOR ((sal_uInt16)0x2000)
+#define PUSH_ALLTEXT (PUSH_TEXTCOLOR | PUSH_TEXTFILLCOLOR | PUSH_TEXTLINECOLOR | PUSH_OVERLINECOLOR | PUSH_TEXTALIGN | PUSH_TEXTLAYOUTMODE | PUSH_TEXTLANGUAGE)
+#define PUSH_ALLFONT (PUSH_ALLTEXT | PUSH_FONT)
+#define PUSH_ALL ((sal_uInt16)0xFFFF)
+
+// Flags for DrawText()
+#define TEXT_DRAW_DISABLE ((sal_uInt16)0x0001)
+#define TEXT_DRAW_MNEMONIC ((sal_uInt16)0x0002)
+#define TEXT_DRAW_MONO ((sal_uInt16)0x0004)
+#define TEXT_DRAW_CLIP ((sal_uInt16)0x0008)
+#define TEXT_DRAW_LEFT ((sal_uInt16)0x0010)
+#define TEXT_DRAW_CENTER ((sal_uInt16)0x0020)
+#define TEXT_DRAW_RIGHT ((sal_uInt16)0x0040)
+#define TEXT_DRAW_TOP ((sal_uInt16)0x0080)
+#define TEXT_DRAW_VCENTER ((sal_uInt16)0x0100)
+#define TEXT_DRAW_BOTTOM ((sal_uInt16)0x0200)
+#define TEXT_DRAW_ENDELLIPSIS ((sal_uInt16)0x0400)
+#define TEXT_DRAW_PATHELLIPSIS ((sal_uInt16)0x0800)
+#define TEXT_DRAW_MULTILINE ((sal_uInt16)0x1000)
+#define TEXT_DRAW_WORDBREAK ((sal_uInt16)0x2000)
+#define TEXT_DRAW_NEWSELLIPSIS ((sal_uInt16)0x4000)
+// in the long run we should make text style flags longer
+// but at the moment we can get away with this 2 bit field for ellipsis style
+#define TEXT_DRAW_CENTERELLIPSIS (TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_PATHELLIPSIS)
+
+#define TEXT_DRAW_WORDBREAK_HYPHENATION (((sal_uInt16)0x8000) | TEXT_DRAW_WORDBREAK)
+
+// Flags for CopyArea()
+#define COPYAREA_WINDOWINVALIDATE ((sal_uInt16)0x0001)
+
+// Flags for DrawImage()
+#define IMAGE_DRAW_DISABLE ((sal_uInt16)0x0001)
+#define IMAGE_DRAW_HIGHLIGHT ((sal_uInt16)0x0002)
+#define IMAGE_DRAW_DEACTIVE ((sal_uInt16)0x0004)
+#define IMAGE_DRAW_COLORTRANSFORM ((sal_uInt16)0x0008)
+#define IMAGE_DRAW_SEMITRANSPARENT ((sal_uInt16)0x0010)
+
+// WaveLine
+#define WAVE_FLAT 1
+#define WAVE_SMALL 2
+#define WAVE_NORMAL 3
+
+// Grid
+#define GRID_DOTS ((sal_uLong)0x00000001)
+#define GRID_HORZLINES ((sal_uLong)0x00000002)
+#define GRID_VERTLINES ((sal_uLong)0x00000004)
+#define GRID_LINES (GRID_HORZLINES | GRID_VERTLINES)
+
+// LayoutModes for Complex Text Layout
+#define TEXT_LAYOUT_DEFAULT ((sal_uLong)0x00000000)
+#define TEXT_LAYOUT_BIDI_LTR ((sal_uLong)0x00000000)
+#define TEXT_LAYOUT_BIDI_RTL ((sal_uLong)0x00000001)
+#define TEXT_LAYOUT_BIDI_STRONG ((sal_uLong)0x00000002)
+#define TEXT_LAYOUT_TEXTORIGIN_LEFT ((sal_uLong)0x00000004)
+#define TEXT_LAYOUT_TEXTORIGIN_RIGHT ((sal_uLong)0x00000008)
+#define TEXT_LAYOUT_COMPLEX_DISABLED ((sal_uLong)0x00000100)
+#define TEXT_LAYOUT_ENABLE_LIGATURES ((sal_uLong)0x00000200)
+#define TEXT_LAYOUT_SUBSTITUTE_DIGITS ((sal_uLong)0x00000400)
+
+// DrawModes
+#define DRAWMODE_DEFAULT ((sal_uLong)0x00000000)
+#define DRAWMODE_BLACKLINE ((sal_uLong)0x00000001)
+#define DRAWMODE_BLACKFILL ((sal_uLong)0x00000002)
+#define DRAWMODE_BLACKTEXT ((sal_uLong)0x00000004)
+#define DRAWMODE_BLACKBITMAP ((sal_uLong)0x00000008)
+#define DRAWMODE_BLACKGRADIENT ((sal_uLong)0x00000010)
+#define DRAWMODE_GRAYLINE ((sal_uLong)0x00000020)
+#define DRAWMODE_GRAYFILL ((sal_uLong)0x00000040)
+#define DRAWMODE_GRAYTEXT ((sal_uLong)0x00000080)
+#define DRAWMODE_GRAYBITMAP ((sal_uLong)0x00000100)
+#define DRAWMODE_GRAYGRADIENT ((sal_uLong)0x00000200)
+#define DRAWMODE_NOFILL ((sal_uLong)0x00000400)
+#define DRAWMODE_NOBITMAP ((sal_uLong)0x00000800)
+#define DRAWMODE_NOGRADIENT ((sal_uLong)0x00001000)
+#define DRAWMODE_GHOSTEDLINE ((sal_uLong)0x00002000)
+#define DRAWMODE_GHOSTEDFILL ((sal_uLong)0x00004000)
+#define DRAWMODE_GHOSTEDTEXT ((sal_uLong)0x00008000)
+#define DRAWMODE_GHOSTEDBITMAP ((sal_uLong)0x00010000)
+#define DRAWMODE_GHOSTEDGRADIENT ((sal_uLong)0x00020000)
+#define DRAWMODE_WHITELINE ((sal_uLong)0x00100000)
+#define DRAWMODE_WHITEFILL ((sal_uLong)0x00200000)
+#define DRAWMODE_WHITETEXT ((sal_uLong)0x00400000)
+#define DRAWMODE_WHITEBITMAP ((sal_uLong)0x00800000)
+#define DRAWMODE_WHITEGRADIENT ((sal_uLong)0x01000000)
+#define DRAWMODE_SETTINGSLINE ((sal_uLong)0x02000000)
+#define DRAWMODE_SETTINGSFILL ((sal_uLong)0x04000000)
+#define DRAWMODE_SETTINGSTEXT ((sal_uLong)0x08000000)
+#define DRAWMODE_SETTINGSGRADIENT ((sal_uLong)0x10000000)
+#define DRAWMODE_NOTRANSPARENCY ((sal_uLong)0x80000000)
+
+// Antialiasing
+#define ANTIALIASING_DISABLE_TEXT ((sal_uInt16)0x0001)
+#define ANTIALIASING_ENABLE_B2DDRAW ((sal_uInt16)0x0002)
+#define ANTIALIASING_PIXELSNAPHAIRLINE ((sal_uInt16)0x0004)
+
+// AddFontSubstitute
+#define FONT_SUBSTITUTE_ALWAYS ((sal_uInt16)0x0001)
+#define FONT_SUBSTITUTE_SCREENONLY ((sal_uInt16)0x0002)
+
+#define DEFAULTFONT_FLAGS_ONLYONE ((sal_uLong)0x00000001)
+
+enum OutDevType { OUTDEV_DONTKNOW, OUTDEV_WINDOW, OUTDEV_PRINTER, OUTDEV_VIRDEV };
+
+enum OutDevViewType { OUTDEV_VIEWTYPE_DONTKNOW, OUTDEV_VIEWTYPE_PRINTPREVIEW, OUTDEV_VIEWTYPE_SLIDESHOW };
+
+// ----------------
+// - OutputDevice -
+// ----------------
+
+class VirtualDevice;
+class Printer;
+class FontSelectPattern;
+class ImplFontMetricData;
+class VCLXGraphics;
+
+typedef ::std::vector< VCLXGraphics* > VCLXGraphicsList_impl;
+
+const char* ImplDbgCheckOutputDevice( const void* pObj );
+
+class VCL_DLLPUBLIC OutputDevice : public Resource
+{
+ friend class Application;
+ friend class Bitmap;
+ friend class ImplImageBmp;
+ friend class Printer;
+ friend class System;
+ friend class VirtualDevice;
+ friend class Window;
+ friend class WorkWindow;
+ friend class vcl::PDFWriterImpl;
+ friend const char* ImplDbgCheckOutputDevice( const void* pObj );
+ friend void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight );
+
+private:
+ mutable SalGraphics* mpGraphics;
+ mutable OutputDevice* mpPrevGraphics;
+ mutable OutputDevice* mpNextGraphics;
+ GDIMetaFile* mpMetaFile;
+ mutable ImplFontEntry* mpFontEntry;
+ mutable ImplFontCache* mpFontCache;
+ mutable ImplDevFontList* mpFontList;
+ mutable ImplGetDevFontList* mpGetDevFontList;
+ mutable ImplGetDevSizeList* mpGetDevSizeList;
+ ImplObjStack* mpObjStack;
+ ImplOutDevData* mpOutDevData;
+ VCLXGraphicsList_impl* mpUnoGraphicsList;
+ vcl::PDFWriterImpl* mpPDFWriter;
+ vcl::ExtOutDevData* mpExtOutDevData;
+
+ // TEMP TEMP TEMP
+ VirtualDevice* mpAlphaVDev;
+
+ /// Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset)
+ long mnOutOffOrigX;
+ /// Additional output offset in _logical_ coordinates, applied in PixelToLogic (used by SetPixelOffset/GetPixelOffset)
+ long mnOutOffLogicX;
+ /// Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset)
+ long mnOutOffOrigY;
+ /// Additional output offset in _logical_ coordinates, applied in PixelToLogic (used by SetPixelOffset/GetPixelOffset)
+ long mnOutOffLogicY;
+ /// Output offset for device output in pixel (pseudo window offset within window system's frames)
+ long mnOutOffX;
+ /// Output offset for device output in pixel (pseudo window offset within window system's frames)
+ long mnOutOffY;
+ long mnOutWidth;
+ long mnOutHeight;
+ sal_Int32 mnDPIX;
+ sal_Int32 mnDPIY;
+ /// font specific text alignment offsets in pixel units
+ mutable long mnTextOffX;
+ mutable long mnTextOffY;
+ mutable long mnEmphasisAscent;
+ mutable long mnEmphasisDescent;
+ sal_uLong mnDrawMode;
+ sal_uLong mnTextLayoutMode;
+ ImplMapRes maMapRes;
+ ImplThresholdRes maThresRes;
+ OutDevType meOutDevType;
+ OutDevViewType meOutDevViewType;
+ Region maRegion; // contains the clip region, see SetClipRegion(...)
+ Color maLineColor;
+ Color maFillColor;
+ Font maFont;
+ Color maTextColor;
+ Color maTextLineColor;
+ Color maOverlineColor;
+ TextAlign meTextAlign;
+ RasterOp meRasterOp;
+ Wallpaper maBackground;
+ AllSettings maSettings;
+ MapMode maMapMode;
+ Point maRefPoint;
+ sal_uInt16 mnAntialiasing;
+ LanguageType meTextLanguage;
+ mutable sal_Bool mbMap:1,
+ mbMapIsDefault:1,
+ mbClipRegion:1,
+ mbBackground:1,
+ mbOutput:1,
+ mbDevOutput:1,
+ mbOutputClipped:1,
+ mbLineColor:1,
+ mbFillColor:1,
+ mbInitLineColor:1,
+ mbInitFillColor:1,
+ mbInitFont:1,
+ mbInitTextColor:1,
+ mbInitClipRegion:1,
+ mbClipRegionSet:1,
+ mbKerning:1,
+ mbNewFont:1,
+ mbTextLines:1,
+ mbTextSpecial:1,
+ mbRefPoint:1,
+ mbEnableRTL:1;
+
+public:
+ SAL_DLLPRIVATE sal_Int32 ImplGetDPIX() const { return mnDPIX; }
+ SAL_DLLPRIVATE sal_Int32 ImplGetDPIY() const { return mnDPIY; }
+ SAL_DLLPRIVATE SalGraphics* ImplGetGraphics() const;
+ SAL_DLLPRIVATE void ImplReleaseGraphics( sal_Bool bRelease = sal_True );
+ SAL_DLLPRIVATE sal_Bool ImplHasMirroredGraphics();
+ SAL_DLLPRIVATE void ImplReMirror( Point &rPoint ) const;
+ SAL_DLLPRIVATE void ImplReMirror( Rectangle &rRect ) const;
+ SAL_DLLPRIVATE void ImplReMirror( Region &rRegion ) const;
+ SAL_DLLPRIVATE void ImplInitOutDevData();
+ SAL_DLLPRIVATE void ImplDeInitOutDevData();
+ SAL_DLLPRIVATE void ImplInitLineColor();
+ SAL_DLLPRIVATE void ImplInitFillColor();
+ SAL_DLLPRIVATE bool ImplNewFont() const;
+ SAL_DLLPRIVATE void ImplInitFont() const;
+ SAL_DLLPRIVATE void ImplInitTextColor();
+ SAL_DLLPRIVATE void ImplInitClipRegion();
+ SAL_DLLPRIVATE bool ImplSelectClipRegion( const Region&, SalGraphics* pGraphics = NULL );
+ SAL_DLLPRIVATE void ImplSetClipRegion( const Region* pRegion );
+
+ SAL_DLLPRIVATE SalLayout* ImplLayout( const OUString&, sal_Int32 nIndex, sal_Int32 nLen,
+ const Point& rLogicPos = Point(0,0), long nLogicWidth=0,
+ const sal_Int32* pLogicDXArray=NULL, bool bFilter = false ) const;
+ SAL_DLLPRIVATE ImplLayoutArgs ImplPrepareLayoutArgs( OUString&, const sal_Int32 nIndex, const sal_Int32 nLen,
+ long nPixelWidth, const sal_Int32* pPixelDXArray ) const;
+ SAL_DLLPRIVATE SalLayout* ImplGlyphFallbackLayout( SalLayout*, ImplLayoutArgs& ) const;
+
+ static
+ SAL_DLLPRIVATE OUString ImplGetEllipsisString( const OutputDevice& rTargetDevice, const OUString& rStr,
+ long nMaxWidth, sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout );
+ static
+ SAL_DLLPRIVATE void ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
+ const String& rOrigStr, sal_uInt16 nStyle,
+ MetricVector* pVector, OUString* pDisplayText, ::vcl::ITextLayout& _rLayout );
+ SAL_DLLPRIVATE void ImplDrawTextBackground( const SalLayout& );
+ SAL_DLLPRIVATE void ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, sal_Bool bWordLine, sal_Bool bUnderlineAbove );
+ SAL_DLLPRIVATE bool ImplDrawRotateText( SalLayout& );
+ SAL_DLLPRIVATE void ImplDrawTextDirect( SalLayout&, sal_Bool bTextLines );
+ SAL_DLLPRIVATE void ImplDrawSpecialText( SalLayout& );
+ SAL_DLLPRIVATE void ImplDrawText( SalLayout& );
+ SAL_DLLPRIVATE Rectangle ImplGetTextBoundRect( const SalLayout& );
+ SAL_DLLPRIVATE void ImplDrawEmphasisMarks( SalLayout& );
+
+ SAL_DLLPRIVATE void ImplDrawTextRect( long nBaseX, long nBaseY, long nX, long nY, long nWidth, long nHeight );
+
+ SAL_DLLPRIVATE void ImplInitTextLineSize();
+ SAL_DLLPRIVATE void ImplInitAboveTextLineSize();
+ SAL_DLLPRIVATE void ImplDrawWaveLine( long nBaseX, long nBaseY, long nStartX, long nStartY, long nWidth, long nHeight, long nLineWidth, short nOrientation, const Color& rColor );
+ SAL_DLLPRIVATE void ImplDrawWaveTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontUnderline eTextLine, Color aColor, sal_Bool bIsAbove );
+ SAL_DLLPRIVATE void ImplDrawStraightTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontUnderline eTextLine, Color aColor, sal_Bool bIsAbove );
+ SAL_DLLPRIVATE void ImplDrawStrikeoutLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontStrikeout eStrikeout, Color aColor );
+ SAL_DLLPRIVATE void ImplDrawStrikeoutChar( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontStrikeout eStrikeout, Color aColor );
+ SAL_DLLPRIVATE void ImplDrawTextLine( long nBaseX, long nX, long nY, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, sal_Bool bUnderlineAbove );
+ SAL_DLLPRIVATE void ImplDrawMnemonicLine( long nX, long nY, long nWidth );
+ SAL_DLLPRIVATE void ImplGetEmphasisMark( PolyPolygon& rPolyPoly, sal_Bool& rPolyLine, Rectangle& rRect1, Rectangle& rRect2, long& rYOff, long& rWidth, FontEmphasisMark eEmphasis, long nHeight, short nOrient );
+ SAL_DLLPRIVATE void ImplDrawEmphasisMark( long nBaseX, long nX, long nY, const PolyPolygon& rPolyPoly, sal_Bool bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
+ static
+ SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const OUString& rStr, sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout );
+ SAL_DLLPRIVATE void ImplInitFontList() const;
+ SAL_DLLPRIVATE void ImplUpdateFontData( bool bNewFontLists );
+ SAL_DLLPRIVATE static void ImplUpdateAllFontData( bool bNewFontLists );
+
+ SAL_DLLPRIVATE long ImplLogicXToDevicePixel( long nX ) const;
+ SAL_DLLPRIVATE long ImplLogicYToDevicePixel( long nY ) const;
+ SAL_DLLPRIVATE long ImplLogicWidthToDevicePixel( long nWidth ) const;
+ SAL_DLLPRIVATE long ImplLogicHeightToDevicePixel( long nHeight ) const;
+ SAL_DLLPRIVATE long ImplDevicePixelToLogicWidth( long nWidth ) const;
+ SAL_DLLPRIVATE long ImplDevicePixelToLogicHeight( long nHeight ) const;
+ SAL_DLLPRIVATE float ImplFloatLogicHeightToDevicePixel( float ) const;
+ SAL_DLLPRIVATE Point ImplLogicToDevicePixel( const Point& rLogicPt ) const;
+ SAL_DLLPRIVATE Size ImplLogicToDevicePixel( const Size& rLogicSize ) const;
+ SAL_DLLPRIVATE Rectangle ImplLogicToDevicePixel( const Rectangle& rLogicRect ) const;
+ SAL_DLLPRIVATE ::basegfx::B2DPolygon ImplLogicToDevicePixel( const ::basegfx::B2DPolygon& ) const;
+ SAL_DLLPRIVATE ::basegfx::B2DPolyPolygon ImplLogicToDevicePixel( const ::basegfx::B2DPolyPolygon& ) const;
+ SAL_DLLPRIVATE Polygon ImplLogicToDevicePixel( const Polygon& rLogicPoly ) const;
+ SAL_DLLPRIVATE PolyPolygon ImplLogicToDevicePixel( const PolyPolygon& rLogicPolyPoly ) const;
+ SAL_DLLPRIVATE LineInfo ImplLogicToDevicePixel( const LineInfo& rLineInfo ) const;
+ SAL_DLLPRIVATE Rectangle ImplDevicePixelToLogic( const Rectangle& rLogicRect ) const;
+ SAL_DLLPRIVATE Region ImplPixelToDevicePixel( const Region& rRegion ) const;
+ SAL_DLLPRIVATE void ImplInvalidateViewTransform();
+ SAL_DLLPRIVATE basegfx::B2DHomMatrix ImplGetDeviceTransformation() const;
+
+ SAL_DLLPRIVATE void ImplDrawPolygon( const Polygon& rPoly, const PolyPolygon* pClipPolyPoly = NULL );
+ SAL_DLLPRIVATE void ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const PolyPolygon* pClipPolyPoly = NULL );
+ SAL_DLLPRIVATE void ImplDrawPolyPolygon( sal_uInt16 nPoly, const PolyPolygon& rPolyPoly );
+ SAL_DLLPRIVATE void ImplDrawLinearGradient( const Rectangle& rRect, const Gradient& rGradient, sal_Bool bMtf, const PolyPolygon* pClipPolyPoly );
+ SAL_DLLPRIVATE void ImplDrawComplexGradient( const Rectangle& rRect, const Gradient& rGradient, sal_Bool bMtf, const PolyPolygon* pClipPolyPoly );
+
+ SAL_DLLPRIVATE void ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, sal_Bool bMtf );
+ SAL_DLLPRIVATE void ImplCalcHatchValues( const Rectangle& rRect, long nDist, sal_uInt16 nAngle10, Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 );
+ SAL_DLLPRIVATE void ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPolyPoly, Point* pPtBuffer, sal_Bool bMtf );
+
+ SAL_DLLPRIVATE void ImplDrawWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+ SAL_DLLPRIVATE void ImplDrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+ SAL_DLLPRIVATE void ImplDrawBitmapWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+ SAL_DLLPRIVATE void ImplDrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+
+ SAL_DLLPRIVATE void ImplDrawOutDevDirect( const OutputDevice* pSrcDev, void* pPosAry );
+ SAL_DLLPRIVATE void ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+ const Bitmap& rBitmap, const sal_uLong nAction );
+ SAL_DLLPRIVATE void ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+ const BitmapEx& rBitmapEx, const sal_uLong nAction );
+ SAL_DLLPRIVATE void ImplDrawMask( const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+ const Bitmap& rBitmap, const Color& rMaskColor,
+ const sal_uLong nAction );
+ SAL_DLLPRIVATE void ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
+ const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel );
+ SAL_DLLPRIVATE Bitmap ImplBlend( Bitmap aBmp,
+ BitmapReadAccess* pP,
+ BitmapReadAccess* pA,
+ const sal_Int32 nOffY,
+ const sal_Int32 nDstHeight,
+ const sal_Int32 nOffX,
+ const sal_Int32 nDstWidth,
+ const Rectangle& aBmpRect,
+ const Size& aOutSz,
+ const bool bHMirr,
+ const bool bVMirr,
+ const long* pMapX,
+ const long* pMapY );
+ SAL_DLLPRIVATE Bitmap ImplBlendWithAlpha( Bitmap aBmp,
+ BitmapReadAccess* pP,
+ BitmapReadAccess* pA,
+ const Rectangle& aDstRect,
+ const sal_Int32 nOffY,
+ const sal_Int32 nDstHeight,
+ const sal_Int32 nOffX,
+ const sal_Int32 nDstWidth,
+ const long* pMapX,
+ const long* pMapY );
+ SAL_DLLPRIVATE void ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask,
+ const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel );
+ SAL_DLLPRIVATE void ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
+ const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel );
+ SAL_DLLPRIVATE void ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize,
+ const OutputDevice& rOutDev, const Region& rRegion );
+ SAL_DLLPRIVATE void ImplGetFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize,
+ OutputDevice& rOutDev );
+
+ SAL_DLLPRIVATE sal_Bool ImplIsRecordLayout() const;
+
+ void ImplAddDevFontSubstitute( const OUString& rFontName,
+ const OUString& rReplaceFontName,
+ sal_uInt16 nFlags = 0 );
+
+ SAL_DLLPRIVATE static FontEmphasisMark ImplGetEmphasisMarkStyle( const Font& rFont );
+ SAL_DLLPRIVATE static sal_Bool ImplIsUnderlineAbove( const Font& );
+
+ // tells whether this output device is RTL in an LTR UI or LTR in a RTL UI
+ SAL_DLLPRIVATE bool ImplIsAntiparallel() const ;
+ SAL_DLLPRIVATE Color ImplDrawModeToColor( const Color& rColor ) const;
+
+ // #i101491#
+ // Helper which holds the old line geometry creation and is extended to use AA when
+ // switched on. Advantage is that line geometry is only temporarily used for paint
+ SAL_DLLPRIVATE void ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineInfo& rLineInfo);
+
+ // #i101491#
+ // Helper who implements the DrawPolyPolygon functionality for basegfx::B2DPolyPolygon
+ // without MetaFile processing
+ SAL_DLLPRIVATE void ImpDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPolygon& rB2DPolyPoly);
+
+ // #i101491#
+ // Helper who tries to use SalGDI's DrawPolyLine direct and returns it's bool. Contains no AA check.
+ SAL_DLLPRIVATE bool ImpTryDrawPolyLineDirect(
+ const basegfx::B2DPolygon& rB2DPolygon,
+ double fLineWidth = 0.0,
+ basegfx::B2DLineJoin eLineJoin = basegfx::B2DLINEJOIN_NONE,
+ com::sun::star::drawing::LineCap eLineCap = com::sun::star::drawing::LineCap_BUTT);
+
+ // Helper for line geometry paint with support for graphic expansion (pattern and fat_to_area)
+ void impPaintLineGeometryWithEvtlExpand(const LineInfo& rInfo, basegfx::B2DPolyPolygon aLinePolyPolygon);
+
+ SAL_DLLPRIVATE SalLayout* getFallbackFontThatFits(ImplFontEntry &rFallbackFont,
+ FontSelectPattern &rFontSelData, int nFallbackLevel,
+ ImplLayoutArgs& rLayoutArgs, const ImplFontMetricData& rOrigMetric) const;
+protected:
+ OutputDevice();
+
+private:
+ SAL_DLLPRIVATE OutputDevice( const OutputDevice& rOutDev );
+ SAL_DLLPRIVATE OutputDevice& operator =( const OutputDevice& rOutDev );
+
+public:
+ virtual ~OutputDevice();
+
+ OutDevType GetOutDevType() const { return meOutDevType; }
+
+ /** query an <code>OutputDevice</code> whether it spports a specific operation
+
+ @return
+ true if operation supported, else false
+ */
+ bool supportsOperation( OutDevSupportType ) const;
+
+ vcl::PDFWriterImpl* GetPDFWriter() const { return mpPDFWriter; }
+
+ void SetExtOutDevData( vcl::ExtOutDevData* pExtOutDevData ) { mpExtOutDevData = pExtOutDevData; }
+ vcl::ExtOutDevData* GetExtOutDevData() const { return mpExtOutDevData; }
+
+ void DrawTextLine( const Point& rPos, long nWidth,
+ FontStrikeout eStrikeout,
+ FontUnderline eUnderline,
+ FontUnderline eOverline,
+ sal_Bool bUnderlineAbove = sal_False );
+
+ void DrawText( const Point& rStartPt, const XubString& rStr,
+ xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
+ MetricVector* pVector = NULL, OUString* pDisplayText = NULL );
+ long GetTextWidth( const OUString& rStr, sal_Int32 nIndex = 0, sal_Int32 nLen = -1 ) const;
+ /// Height where any character of the current font fits; in logic coordinates.
+ long GetTextHeight() const;
+ float approximate_char_width() const;
+ void DrawTextArray( const Point& rStartPt, const XubString& rStr,
+ const sal_Int32* pDXAry = NULL,
+ xub_StrLen nIndex = 0,
+ xub_StrLen nLen = STRING_LEN );
+ long GetTextArray( const OUString& rStr, sal_Int32* pDXAry = NULL,
+ sal_Int32 nIndex = 0, sal_Int32 nLen = -1 ) const;
+ bool GetCaretPositions( const OUString&, sal_Int32* pCaretXArray,
+ sal_Int32 nIndex, sal_Int32 nLen,
+ sal_Int32* pDXAry = NULL, long nWidth = 0,
+ sal_Bool bCellBreaking = sal_True ) const;
+ void DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
+ const XubString& rStr,
+ xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN );
+ xub_StrLen GetTextBreak( const OUString& rStr, long nTextWidth,
+ sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
+ long nCharExtra = 0, sal_Bool bCellBreaking = sal_True ) const;
+ xub_StrLen GetTextBreak( const OUString& rStr, long nTextWidth,
+ sal_Unicode nExtraChar, sal_Int32& rExtraCharPos,
+ sal_Int32 nIndex, sal_Int32 nLen,
+ long nCharExtra = 0 ) const;
+ /** Generate MetaTextActions for the text rect
+
+ This method splits up the text rect into multiple
+ MetaTextActions, one for each line of text. This is comparable
+ to AddGradientActions(), which splits up a gradient into its
+ constituing polygons. Parameter semantics fully compatible to
+ DrawText().
+ */
+ void AddTextRectActions( const Rectangle& rRect,
+ const String& rOrigStr,
+ sal_uInt16 nStyle,
+ GDIMetaFile& rMtf );
+ void DrawText( const Rectangle& rRect,
+ const XubString& rStr, sal_uInt16 nStyle = 0,
+ MetricVector* pVector = NULL, OUString* pDisplayText = NULL,
+ ::vcl::ITextLayout* _pTextLayout = NULL );
+ Rectangle GetTextRect( const Rectangle& rRect,
+ const XubString& rStr, sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK,
+ TextRectInfo* pInfo = NULL,
+ const ::vcl::ITextLayout* _pTextLayout = NULL ) const;
+ OUString GetEllipsisString( const OUString& rStr, long nMaxWidth,
+ sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS ) const;
+ void DrawCtrlText( const Point& rPos, const XubString& rStr,
+ xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
+ sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC, MetricVector* pVector = NULL, OUString* pDisplayText = NULL );
+ long GetCtrlTextWidth( const XubString& rStr, xub_StrLen nIndex = 0,
+ xub_StrLen nLen = STRING_LEN,
+ sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC ) const;
+ static XubString GetNonMnemonicString( const XubString& rStr, xub_StrLen& rMnemonicPos );
+ static XubString GetNonMnemonicString( const XubString& rStr )
+ { xub_StrLen nDummy; return GetNonMnemonicString( rStr, nDummy ); }
+
+ sal_Bool GetTextBoundRect( Rectangle& rRect,
+ const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
+ sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ sal_Bool GetTextOutline( PolyPolygon&,
+ const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
+ xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
+ sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ sal_Bool GetTextOutlines( PolyPolyVector&,
+ const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
+ xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
+ sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ sal_Bool GetTextOutlines( ::basegfx::B2DPolyPolygonVector&,
+ const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
+ xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
+ sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ sal_Bool GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex,
+ int nLen, int nBase, MetricVector& rVector );
+
+ void DrawPixel( const Point& rPt );
+ void DrawPixel( const Point& rPt, const Color& rColor );
+ void DrawPixel( const Polygon& rPts, const Color* pColors = NULL );
+ void DrawPixel( const Polygon& rPts, const Color& rColor );
+
+ void DrawLine( const Point& rStartPt, const Point& rEndPt );
+ void DrawLine( const Point& rStartPt, const Point& rEndPt,
+ const LineInfo& rLineInfo );
+
+ /** Render the given polygon as a line stroke
+
+ The given polygon is stroked with the current LineColor, start
+ and end point are not automatically connected
+
+ @see DrawPolygon
+ @see DrawPolyPolygon
+ */
+ void DrawPolyLine( const Polygon& rPoly );
+ void DrawPolyLine(
+ const basegfx::B2DPolygon&,
+ double fLineWidth = 0.0,
+ basegfx::B2DLineJoin = basegfx::B2DLINEJOIN_ROUND,
+ com::sun::star::drawing::LineCap = com::sun::star::drawing::LineCap_BUTT);
+
+ /** Render the given polygon as a line stroke
+
+ The given polygon is stroked with the current LineColor, start
+ and end point are not automatically connected. The line is
+ rendered according to the specified LineInfo, e.g. supplying a
+ dash pattern, or a line thickness.
+
+ @see DrawPolygon
+ @see DrawPolyPolygon
+ */
+ void DrawPolyLine( const Polygon& rPoly,
+ const LineInfo& rLineInfo );
+
+ /** Render the given polygon
+
+ The given polygon is stroked with the current LineColor, and
+ filled with the current FillColor. If one of these colors are
+ transparent, the corresponding stroke or fill stays
+ invisible. Start and end point of the polygon are
+ automatically connected.
+
+ @see DrawPolyLine
+ */
+ void DrawPolygon( const Polygon& rPoly );
+ void DrawPolygon( const basegfx::B2DPolygon& );
+
+ /** Render the given poly-polygon
+
+ The given poly-polygon is stroked with the current LineColor,
+ and filled with the current FillColor. If one of these colors
+ are transparent, the corresponding stroke or fill stays
+ invisible. Start and end points of the contained polygons are
+ automatically connected.
+
+ @see DrawPolyLine
+ */
+ void DrawPolyPolygon( const PolyPolygon& rPolyPoly );
+ void DrawPolyPolygon( const basegfx::B2DPolyPolygon& );
+
+ void DrawRect( const Rectangle& rRect );
+ void DrawRect( const Rectangle& rRect,
+ sal_uLong nHorzRount, sal_uLong nVertRound );
+ void DrawEllipse( const Rectangle& rRect );
+ void DrawArc( const Rectangle& rRect,
+ const Point& rStartPt, const Point& rEndPt );
+ void DrawPie( const Rectangle& rRect,
+ const Point& rStartPt, const Point& rEndPt );
+ void DrawChord( const Rectangle& rRect,
+ const Point& rStartPt, const Point& rEndPt );
+
+ void DrawOutDev( const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPt, const Size& rSrcSize );
+ void DrawOutDev( const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPt, const Size& rSrcSize,
+ const OutputDevice& rOutDev );
+ void CopyArea( const Point& rDestPt,
+ const Point& rSrcPt, const Size& rSrcSize,
+ sal_uInt16 nFlags = 0 );
+
+ void DrawBitmap( const Point& rDestPt,
+ const Bitmap& rBitmap );
+ void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
+ const Bitmap& rBitmap );
+ void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+ const Bitmap& rBitmap );
+
+ void DrawBitmapEx( const Point& rDestPt,
+ const BitmapEx& rBitmapEx );
+ void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
+ const BitmapEx& rBitmapEx );
+ void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+ const BitmapEx& rBitmapEx );
+
+ void DrawMask( const Point& rDestPt,
+ const Bitmap& rBitmap, const Color& rMaskColor );
+ void DrawMask( const Point& rDestPt, const Size& rDestSize,
+ const Bitmap& rBitmap, const Color& rMaskColor );
+ void DrawMask( const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+ const Bitmap& rBitmap, const Color& rMaskColor );
+
+ void DrawImage( const Point& rPos,
+ const Image& rImage, sal_uInt16 nStyle = 0 );
+ void DrawImage( const Point& rPos, const Size& rSize,
+ const Image& rImage, sal_uInt16 nStyle = 0 );
+
+ void DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
+ void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
+ void AddGradientActions( const Rectangle& rRect,
+ const Gradient& rGradient,
+ GDIMetaFile& rMtf );
+
+#ifdef _MSC_VER
+ void DrawHatch( const PolyPolygon& rPolyPoly, const ::Hatch& rHatch );
+ void AddHatchActions( const PolyPolygon& rPolyPoly,
+ const ::Hatch& rHatch,
+ GDIMetaFile& rMtf );
+#else
+ void DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch );
+ void AddHatchActions( const PolyPolygon& rPolyPoly,
+ const Hatch& rHatch,
+ GDIMetaFile& rMtf );
+#endif
+
+ void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
+ void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, sal_uInt16 nStyle );
+ void DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags );
+
+ void DrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent );
+ void DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, double fTransparency);
+ void DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, const Size& rSize,
+ const Gradient& rTransparenceGradient );
+
+ /** Added return value to see if EPS could be painted directly.
+ Theoreticaly, handing over a matrix would be needed to handle
+ painting rotated EPS files (e.g. contained in Metafiles). This
+ would then need to be supported for Mac and PS printers, but
+ that's too much for now, wrote #i107046# for this */
+ bool DrawEPS( const Point& rPt, const Size& rSz,
+ const GfxLink& rGfxLink, GDIMetaFile* pSubst = NULL );
+
+ Color GetPixel( const Point& rPt ) const;
+
+ Bitmap GetBitmap( const Point& rSrcPt, const Size& rSize ) const;
+
+ /** Query extended bitmap (with alpha channel, if available).
+ */
+ BitmapEx GetBitmapEx( const Point& rSrcPt, const Size& rSize ) const;
+
+ void EnableMapMode( sal_Bool bEnable = sal_True );
+ sal_Bool IsMapModeEnabled() const { return mbMap; }
+
+ // Enabling/disabling RTL only makes sense for OutputDevices that use a mirroring SalGraphisLayout
+ void EnableRTL( sal_Bool bEnable = sal_True);
+ sal_Bool IsRTLEnabled() const { return mbEnableRTL; }
+
+ void SetConnectMetaFile( GDIMetaFile* pMtf );
+ GDIMetaFile* GetConnectMetaFile() const { return mpMetaFile; }
+
+ void EnableOutput( sal_Bool bEnable = sal_True );
+ sal_Bool IsOutputEnabled() const { return mbOutput; }
+ sal_Bool IsDeviceOutput() const { return mbDevOutput; }
+ sal_Bool IsDeviceOutputNecessary() const { return (mbOutput && mbDevOutput); }
+ sal_Bool IsOutputNecessary() const { return ((mbOutput && mbDevOutput) || (mpMetaFile != NULL)); }
+
+ void SetClipRegion();
+ void SetClipRegion( const Region& rRegion );
+ Region GetClipRegion() const;
+ sal_Bool IsClipRegion() const { return mbClipRegion; }
+ Region GetActiveClipRegion() const;
+
+ void MoveClipRegion( long nHorzMove, long nVertMove );
+ void IntersectClipRegion( const Rectangle& rRect );
+ void IntersectClipRegion( const Region& rRegion );
+
+ void SetAntialiasing( sal_uInt16 nMode = 0 );
+ sal_uInt16 GetAntialiasing() const { return mnAntialiasing; }
+
+ void SetDrawMode( sal_uLong nDrawMode );
+ sal_uLong GetDrawMode() const { return mnDrawMode; }
+
+ void SetLayoutMode( sal_uLong nTextLayoutMode );
+ sal_uLong GetLayoutMode() const { return mnTextLayoutMode; }
+
+ void SetDigitLanguage( LanguageType );
+ LanguageType GetDigitLanguage() const { return meTextLanguage; }
+
+ void SetRasterOp( RasterOp eRasterOp );
+ RasterOp GetRasterOp() const { return meRasterOp; }
+
+ /**
+ If this OutputDevice is used for displaying a Print Preview
+ the OutDevViewType should be set to 'OUTDEV_VIEWTYPE_PRINTPREVIEW'.
+
+ A View than can make painting decisions dependent on this OutDevViewType.
+ E.g. text colors need to be handled different, dependent on whether it's a PrintPreview or not. (see #106611# for more)
+ */
+ void SetOutDevViewType( OutDevViewType eOutDevViewType ) { meOutDevViewType=eOutDevViewType; }
+ OutDevViewType GetOutDevViewType() const { return meOutDevViewType; }
+
+ void SetLineColor();
+ void SetLineColor( const Color& rColor );
+ const Color& GetLineColor() const { return maLineColor; }
+ sal_Bool IsLineColor() const { return mbLineColor; }
+
+ void SetFillColor();
+ void SetFillColor( const Color& rColor );
+ const Color& GetFillColor() const { return maFillColor; }
+ sal_Bool IsFillColor() const { return mbFillColor; }
+
+ void SetBackground();
+ void SetBackground( const Wallpaper& rBackground );
+
+ const Wallpaper& GetBackground() const { return maBackground; }
+ sal_Bool IsBackground() const { return mbBackground; }
+
+ void SetFont( const Font& rNewFont );
+ const Font& GetFont() const { return maFont; }
+
+ SystemFontData GetSysFontData( int nFallbacklevel ) const;
+ SystemTextLayoutData GetSysTextLayoutData( const Point& rStartPt, const XubString& rStr,
+ xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
+ const sal_Int32* pDXAry = NULL ) const;
+
+ void SetTextColor( const Color& rColor );
+ const Color& GetTextColor() const { return maTextColor; }
+ void SetTextFillColor();
+ void SetTextFillColor( const Color& rColor );
+
+ Color GetTextFillColor() const;
+ sal_Bool IsTextFillColor() const { return !maFont.IsTransparent(); }
+ void SetTextLineColor();
+ void SetTextLineColor( const Color& rColor );
+ const Color& GetTextLineColor() const { return maTextLineColor; }
+ sal_Bool IsTextLineColor() const { return (maTextLineColor.GetTransparency() == 0); }
+ void SetOverlineColor();
+ void SetOverlineColor( const Color& rColor );
+ const Color& GetOverlineColor() const { return maOverlineColor; }
+ sal_Bool IsOverlineColor() const { return (maOverlineColor.GetTransparency() == 0); }
+ void SetTextAlign( TextAlign eAlign );
+ TextAlign GetTextAlign() const { return maFont.GetAlign(); }
+
+ virtual void SetSettings( const AllSettings& rSettings );
+ const AllSettings& GetSettings() const { return maSettings; }
+
+ SystemGraphicsData GetSystemGfxData() const;
+ ::com::sun::star::uno::Any GetSystemGfxDataAny() const;
+
+ virtual void SetMapMode();
+ virtual void SetMapMode( const MapMode& rNewMapMode );
+ virtual void SetRelativeMapMode( const MapMode& rNewMapMode );
+ const MapMode& GetMapMode() const { return maMapMode; }
+ sal_Bool IsMapMode() const { return mbMap; }
+
+ void SetRefPoint();
+ void SetRefPoint( const Point& rRefPoint );
+ const Point& GetRefPoint() const { return maRefPoint; }
+ sal_Bool IsRefPoint() const { return mbRefPoint; }
+
+ // #i75163#
+ basegfx::B2DHomMatrix GetViewTransformation() const;
+ basegfx::B2DHomMatrix GetInverseViewTransformation() const;
+
+ basegfx::B2DHomMatrix GetViewTransformation( const MapMode& rMapMode ) const;
+ basegfx::B2DHomMatrix GetInverseViewTransformation( const MapMode& rMapMode ) const;
+
+
+ /** Set an offset in pixel
+
+ This method offsets every drawing operation that converts its
+ coordinates to pixel by the given value. Normally, the effect
+ can be achieved by setting a MapMode with a different
+ origin. Unfortunately, this origin is in logical coordinates
+ and can lead to rounding errors (see #102532# for details).
+
+ @attention This offset is only applied when converting to
+ pixel, i.e. some output modes such as metafile recordings
+ might be completely unaffected by this method! Use with
+ care. Furthermore, if the OutputDevice's MapMode is the
+ default (that's MAP_PIXEL), then, too, any pixel offset set is
+ ignored. This might be unintuitive for cases, but would have
+ been far more fragile to implement. What's more, the reason
+ why the pixel offset was introduced (avoiding rounding errors)
+ does not apply for MAP_PIXEL, because one can always use the
+ MapMode origin then.
+
+ @param rOffset
+ The offset in pixel
+ */
+ void SetPixelOffset( const Size& rOffset );
+
+ /** Get the offset in pixel
+
+ @see OutputDevice::SetPixelOffset for details
+
+ @return the current offset in pixel
+ */
+ Size GetPixelOffset() const;
+
+ Point LogicToPixel( const Point& rLogicPt ) const;
+ Size LogicToPixel( const Size& rLogicSize ) const;
+ Rectangle LogicToPixel( const Rectangle& rLogicRect ) const;
+ Polygon LogicToPixel( const Polygon& rLogicPoly ) const;
+ PolyPolygon LogicToPixel( const PolyPolygon& rLogicPolyPoly ) const;
+ Region LogicToPixel( const Region& rLogicRegion )const;
+ Point LogicToPixel( const Point& rLogicPt,
+ const MapMode& rMapMode ) const;
+ Size LogicToPixel( const Size& rLogicSize,
+ const MapMode& rMapMode ) const;
+ Rectangle LogicToPixel( const Rectangle& rLogicRect,
+ const MapMode& rMapMode ) const;
+ Polygon LogicToPixel( const Polygon& rLogicPoly,
+ const MapMode& rMapMode ) const;
+ basegfx::B2DPolyPolygon LogicToPixel( const basegfx::B2DPolyPolygon& rLogicPolyPoly,
+ const MapMode& rMapMode ) const;
+ Point PixelToLogic( const Point& rDevicePt ) const;
+ Size PixelToLogic( const Size& rDeviceSize ) const;
+ Rectangle PixelToLogic( const Rectangle& rDeviceRect ) const;
+ Polygon PixelToLogic( const Polygon& rDevicePoly ) const;
+ PolyPolygon PixelToLogic( const PolyPolygon& rDevicePolyPoly ) const;
+ basegfx::B2DPolyPolygon PixelToLogic( const basegfx::B2DPolyPolygon& rDevicePolyPoly ) const;
+ Region PixelToLogic( const Region& rDeviceRegion ) const;
+ Point PixelToLogic( const Point& rDevicePt,
+ const MapMode& rMapMode ) const;
+ Size PixelToLogic( const Size& rDeviceSize,
+ const MapMode& rMapMode ) const;
+ Rectangle PixelToLogic( const Rectangle& rDeviceRect,
+ const MapMode& rMapMode ) const;
+ Polygon PixelToLogic( const Polygon& rDevicePoly,
+ const MapMode& rMapMode ) const;
+ basegfx::B2DPolygon PixelToLogic( const basegfx::B2DPolygon& rDevicePoly,
+ const MapMode& rMapMode ) const;
+ basegfx::B2DPolyPolygon PixelToLogic( const basegfx::B2DPolyPolygon& rDevicePolyPoly,
+ const MapMode& rMapMode ) const;
+ Point LogicToLogic( const Point& rPtSource,
+ const MapMode* pMapModeSource,
+ const MapMode* pMapModeDest ) const;
+ Size LogicToLogic( const Size& rSzSource,
+ const MapMode* pMapModeSource,
+ const MapMode* pMapModeDest ) const;
+ Rectangle LogicToLogic( const Rectangle& rRectSource,
+ const MapMode* pMapModeSource,
+ const MapMode* pMapModeDest ) const;
+ static Point LogicToLogic( const Point& rPtSource,
+ const MapMode& rMapModeSource,
+ const MapMode& rMapModeDest );
+ static Size LogicToLogic( const Size& rSzSource,
+ const MapMode& rMapModeSource,
+ const MapMode& rMapModeDest );
+ static Rectangle LogicToLogic( const Rectangle& rRectSource,
+ const MapMode& rMapModeSource,
+ const MapMode& rMapModeDest );
+ static long LogicToLogic( long nLongSource,
+ MapUnit eUnitSource,
+ MapUnit eUnitDest );
+
+ static basegfx::B2DPolygon LogicToLogic( const basegfx::B2DPolygon& rPoly,
+ const MapMode& rMapModeSource,
+ const MapMode& rMapModeDest );
+
+ Size GetOutputSizePixel() const
+ { return Size( mnOutWidth, mnOutHeight ); }
+ long GetOutputWidthPixel() const { return mnOutWidth; }
+ long GetOutputHeightPixel() const { return mnOutHeight; }
+ long GetOutOffXPixel() const { return mnOutOffX; }
+ long GetOutOffYPixel() const { return mnOutOffY; }
+
+ Size GetOutputSize() const
+ { return PixelToLogic( GetOutputSizePixel() ); }
+
+ void Erase();
+ void Erase( const Rectangle& rRect ) { DrawWallpaper( rRect, GetBackground() ); }
+
+ sal_Bool AddTempDevFont( const String& rFileURL, const String& rFontName );
+ int GetDevFontCount() const;
+ FontInfo GetDevFont( int nDevFontIndex ) const;
+ int GetDevFontSizeCount( const Font& ) const;
+ Size GetDevFontSize( const Font& rFont, int nSizeIndex ) const;
+ sal_Bool IsFontAvailable( const String& rFontName ) const;
+
+ FontMetric GetFontMetric() const;
+ FontMetric GetFontMetric( const Font& rFont ) const;
+ sal_Bool GetFontCharMap( FontCharMap& rFontCharMap ) const;
+ bool GetFontCapabilities( vcl::FontCapabilities& rFontCapabilities ) const;
+
+ xub_StrLen HasGlyphs( const Font& rFont, const String& rStr,
+ xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN ) const;
+
+ long GetMinKashida() const;
+
+ // i60594
+ // validate kashida positions against the current font
+ // returns count of invalid kashida positions
+ xub_StrLen ValidateKashidas ( const String& rTxt,
+ xub_StrLen nIdx, xub_StrLen nLen,
+ xub_StrLen nKashCount, // number of suggested kashida positions (in)
+ const xub_StrLen* pKashidaPos, // suggested kashida positions (in)
+ xub_StrLen* pKashidaPosDropped // invalid kashida positions (out)
+ ) const;
+
+ sal_uInt16 GetBitCount() const;
+
+ sal_Bool GetTextIsRTL( const OUString&, sal_Int32 nIndex, sal_Int32 nLen ) const;
+
+ /** Query the existence and depth of the alpha channel
+
+ @return 0, if no alpha channel available, and the bit depth of
+ the alpha channel otherwise.
+ */
+ sal_uInt16 GetAlphaBitCount() const;
+ sal_uLong GetColorCount() const;
+
+ void Push( sal_uInt16 nFlags = PUSH_ALL );
+ void Pop();
+ // returns the curren stack depth; that is the number of Push() calls minus the number of Pop() calls
+ // this should not normally be used since Push and Pop must always be used symmetrically
+ // however this may be e.g. a help when debugging code in which this somehow is not the case
+ sal_uInt32 GetGCStackDepth() const;
+
+ /** Query availability of alpha channel
+
+ @return sal_True, if this device has an alpha channel.
+ */
+ sal_Bool HasAlpha();
+
+ /// request XCanvas render interface for this OutputDevice
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XCanvas > GetCanvas() const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > CreateUnoGraphics();
+ VCLXGraphicsList_impl* GetUnoGraphicsList() const { return mpUnoGraphicsList; }
+ VCLXGraphicsList_impl* CreateUnoGraphicsList()
+ {
+ mpUnoGraphicsList = new VCLXGraphicsList_impl();
+ return mpUnoGraphicsList;
+ }
+
+ static void BeginFontSubstitution();
+ static void EndFontSubstitution();
+ static void AddFontSubstitute( const OUString& rFontName,
+ const OUString& rReplaceFontName,
+ sal_uInt16 nFlags = 0 );
+ static void RemoveFontSubstitute( sal_uInt16 n );
+ static sal_uInt16 GetFontSubstituteCount();
+
+ static Font GetDefaultFont( sal_uInt16 nType,
+ LanguageType eLang,
+ sal_uLong nFlags,
+ const OutputDevice* pOutDev = NULL );
+
+ /** helper method removing transparencies from a metafile (e.g. for printing)
+
+ @returns
+ true: transparencies were removed
+ false: output metafile is unchanged input metafile
+
+ @attention this is a member method, so current state can influence the result !
+ @attention the output metafile is prepared in pixel mode for the currentOutputDevice
+ state. It can not be moved or rotated reliably anymore.
+ */
+ bool RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, GDIMetaFile& rOutMtf,
+ long nMaxBmpDPIX, long nMaxBmpDPIY,
+ bool bReduceTransparency,
+ bool bTransparencyAutoMode,
+ bool bDownsampleBitmaps,
+ const Color& rBackground = Color( COL_TRANSPARENT )
+ );
+ /** Retrieve downsampled and cropped bitmap
+
+ @attention This method ignores negative rDstSz values, thus
+ mirroring must happen outside this method (e.g. in DrawBitmap)
+ */
+ Bitmap GetDownsampledBitmap( const Size& rDstSz,
+ const Point& rSrcPt, const Size& rSrcSz,
+ const Bitmap& rBmp, long nMaxBmpDPIX, long nMaxBmpDPIY );
+
+ //-------------------------------------
+ // Native Widget Rendering functions
+ //-------------------------------------
+
+ // These all just call through to the private mpGraphics functions of the same name.
+
+ // Query the platform layer for control support
+ sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
+
+ // Query the native control to determine if it was acted upon
+ sal_Bool HitTestNativeControl( ControlType nType,
+ ControlPart nPart,
+ const Rectangle& rControlRegion,
+ const Point& aPos,
+ sal_Bool& rIsInside );
+
+ // Request rendering of a particular control and/or part
+ sal_Bool DrawNativeControl( ControlType nType,
+ ControlPart nPart,
+ const Rectangle& rControlRegion,
+ ControlState nState,
+ const ImplControlValue& aValue,
+ OUString aCaption );
+
+ // Query the native control's actual drawing region (including adornment)
+ sal_Bool GetNativeControlRegion( ControlType nType,
+ ControlPart nPart,
+ const Rectangle& rControlRegion,
+ ControlState nState,
+ const ImplControlValue& aValue,
+ OUString aCaption,
+ Rectangle &rNativeBoundingRegion,
+ Rectangle &rNativeContentRegion ) const;
+
+};
+
+#endif // _SV_OUTDEV_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/pdfextoutdevdata.hxx b/include/vcl/pdfextoutdevdata.hxx
new file mode 100644
index 000000000000..59a118945cd4
--- /dev/null
+++ b/include/vcl/pdfextoutdevdata.hxx
@@ -0,0 +1,492 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _VCL_PDFEXTOUTDEVDATA_HXX
+#define _VCL_PDFEXTOUTDEVDATA_HXX
+
+#include <vcl/dllapi.h>
+
+#include <vcl/pdfwriter.hxx>
+#include <vcl/extoutdevdata.hxx>
+#include <vcl/gdimtf.hxx>
+#include <vcl/mapmod.hxx>
+#include <tools/rtti.hxx>
+#include <vector>
+#include <deque>
+
+class Graphic;
+
+namespace vcl { class PDFWriter; }
+
+namespace vcl
+{
+
+/*
+ A PDFExtOutDevBookmarkEntry is being created by the EditEngine if
+ a bookmark URL has been parsed. The Application is requested to take
+ care of each bookmark entry by emptying out the bookmark vector.
+*/
+struct PDFExtOutDevBookmarkEntry
+{
+ /** ID of the link pointing to the bookmark, or -1 if the entry denotes a destination instead of a link.
+ */
+ sal_Int32 nLinkId;
+
+ /** ID of the named destination denoted by the bookmark, or -1 if the entry denotes a link instead of a named destination.
+ */
+ sal_Int32 nDestId;
+
+ /** link target name, respectively destination name
+ */
+ OUString aBookmark;
+
+ PDFExtOutDevBookmarkEntry()
+ :nLinkId( -1 )
+ ,nDestId( -1 )
+ ,aBookmark()
+ {
+ }
+};
+
+/*
+ Class that is being set at the OutputDevice allowing the
+ application to send enhanced PDF commands like CreateLink
+*/
+struct PageSyncData;
+struct GlobalSyncData;
+class VCL_DLLPUBLIC PDFExtOutDevData : public ExtOutDevData
+{
+
+ const OutputDevice& mrOutDev;
+
+ sal_Bool mbTaggedPDF;
+ sal_Bool mbExportNotes;
+ sal_Bool mbExportNotesPages;
+ sal_Bool mbTransitionEffects;
+ sal_Bool mbUseLosslessCompression;
+ sal_Bool mbReduceImageResolution;
+ sal_Bool mbExportFormFields;
+ sal_Bool mbExportBookmarks;
+ sal_Bool mbExportHiddenSlides;
+ sal_Bool mbExportNDests; //i56629
+ sal_Int32 mnFormsFormat;
+ sal_Int32 mnPage;
+ com::sun::star::lang::Locale maDocLocale;
+
+ PageSyncData* mpPageSyncData;
+ GlobalSyncData* mpGlobalSyncData;
+
+ std::vector< PDFExtOutDevBookmarkEntry > maBookmarks;
+
+public :
+
+ TYPEINFO();
+ PDFExtOutDevData( const OutputDevice& rOutDev );
+ virtual ~PDFExtOutDevData();
+
+ sal_Bool PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction );
+ void ResetSyncData();
+
+ void PlayGlobalActions( PDFWriter& rWriter );
+
+
+
+ sal_Bool GetIsExportNotes() const;
+ void SetIsExportNotes( const sal_Bool bExportNotes );
+
+ sal_Bool GetIsExportNotesPages() const;
+ void SetIsExportNotesPages( const sal_Bool bExportNotesPages );
+
+ sal_Bool GetIsExportTaggedPDF() const;
+ void SetIsExportTaggedPDF( const sal_Bool bTaggedPDF );
+
+ sal_Bool GetIsExportTransitionEffects() const;
+ void SetIsExportTransitionEffects( const sal_Bool bTransitionalEffects );
+
+ sal_Bool GetIsExportFormFields() const;
+ void SetIsExportFormFields( const sal_Bool bExportFormFields );
+
+ void SetFormsFormat( const sal_Int32 nFormsFormat );
+
+ sal_Bool GetIsExportBookmarks() const;
+ void SetIsExportBookmarks( const sal_Bool bExportBookmarks );
+
+ sal_Bool GetIsExportHiddenSlides() const;
+ void SetIsExportHiddenSlides( const sal_Bool bExportHiddenSlides );
+
+ sal_Bool GetIsExportNamedDestinations() const; //i56629
+ void SetIsExportNamedDestinations( const sal_Bool bExportNDests ); //i56629
+
+ // PageNumber, Compression is being set by the PDFExport
+ sal_Int32 GetCurrentPageNumber() const;
+ void SetCurrentPageNumber( const sal_Int32 nPage );
+
+ sal_Bool GetIsLosslessCompression() const;
+ void SetIsLosslessCompression( const sal_Bool bLosslessCompression );
+
+ sal_Bool GetIsReduceImageResolution() const;
+ void SetIsReduceImageResolution( const sal_Bool bReduceImageResolution );
+
+ const com::sun::star::lang::Locale& GetDocumentLocale() const;
+ void SetDocumentLocale( const com::sun::star::lang::Locale& rLoc );
+
+ std::vector< PDFExtOutDevBookmarkEntry >& GetBookmarks();
+
+ /** Start a new group of render output
+
+ Use this method to group render output.
+ */
+ void BeginGroup();
+
+ /** End render output
+
+ This method ends grouped render output, that can be
+ represented by a GfxLink. This is typically used for
+ external graphic files, such as JPEGs, EPS files etc.
+ The BeginGroup/EndGroup calls must exactly enclose the
+ relevant OutputDevice calls issued to render the
+ graphic the normal way.
+
+ @param rGraphic
+ The link to the original graphic
+
+ @param nTransparency
+ Eight bit transparency value, with 0 denoting full opacity,
+ and 255 full transparency.
+
+ @param rOutputRect
+ The output rectangle of the graphic.
+
+ @param rVisibleOutputRect
+ The visible part of the output. This might be less than
+ rOutputRect, e.g. for cropped graphics.
+ */
+ void EndGroup( const Graphic& rGraphic,
+ sal_uInt8 nTransparency,
+ const Rectangle& rOutputRect,
+ const Rectangle& rVisibleOutputRect );
+//--->i56629
+ /** Create a new named destination to be used in a link to this document from another PDF document
+ (see PDF spec 1.4, 8.2.1)
+
+ @parm sDestName
+ the name this destination will be addressed with from others PDF document
+
+ @param rRect
+ target rectangle on page to be displayed if dest is jumped to
+
+ @param nPageNr
+ number of page the dest is on (as returned by NewPage)
+ or -1 in which case the current page is used
+
+ @param eType
+ what dest type to use
+
+ @returns
+ the destination id (to be used in SetLinkDest) or
+ -1 if page id does not exist
+ */
+ sal_Int32 CreateNamedDest( const String& sDestName, const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ );
+
+ /** registers a destination for which a destinatin ID needs to be known immediately, instead of later on setting it via
+ SetLinkDest.
+
+ This is used in contexts where a destination is referenced by means other than a link.
+
+ Later in the export process, a call to DescribeRegisteredDest must be made, providing the information about
+ the destination.
+
+ @return
+ the unique Id of the destination
+ */
+ sal_Int32 RegisterDest();
+
+ /** provides detailed information about a destination range which previously has been registered using RegisterDest.
+ */
+ void DescribeRegisteredDest( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ );
+
+//<---i56629
+
+ /** Create a new destination to be used in a link
+
+ @param rRect
+ target rectangle on page to be displayed if dest is jumped to
+
+ @param nPageNr
+ number of page the dest is on (as returned by NewPage)
+ or -1 in which case the current page is used
+
+ @param eType
+ what dest type to use
+
+ @returns
+ the destination id (to be used in SetLinkDest) or
+ -1 if page id does not exist
+ */
+ sal_Int32 CreateDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ );
+ /** Create a new link on a page
+
+ @param rRect
+ active rectangle of the link (that is the area that has to be
+ hit to activate the link)
+
+ @param nPageNr
+ number of page the link is on (as returned by NewPage)
+ or -1 in which case the current page is used
+
+ @returns
+ the link id (to be used in SetLinkDest, SetLinkURL) or
+ -1 if page id does not exist
+ */
+ sal_Int32 CreateLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 );
+ /** Set the destination for a link
+ <p>will change a URL type link to a dest link if necessary</p>
+
+ @param nLinkId
+ the link to be changed
+
+ @param nDestId
+ the dest the link shall point to
+ @returns
+ 0 for success
+ -1 in case the link id does not exist
+ -2 in case the dest id does not exist
+ */
+ sal_Int32 SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
+ /** Set the URL for a link
+ <p>will change a dest type link to an URL type link if necessary</p>
+ @param nLinkId
+ the link to be changed
+
+ @param rURL
+ the URL the link shall point to.
+ there will be no error checking or any kind of
+ conversion done to this parameter execept this:
+ it will be output as 7bit Ascii. The URL
+ will appear literally in the PDF file produced
+
+ @returns
+ 0 for success
+ -1 in case the link id does not exist
+ */
+ sal_Int32 SetLinkURL( sal_Int32 nLinkId, const OUString& rURL );
+ /** Create a new outline item
+
+ @param nParent
+ declares the parent of the new item in the outline hierarchy.
+ An invalid value will result in a new toplevel item.
+
+ @param rText
+ sets the title text of the item
+
+ @param nDestId
+ declares which Dest (created with CreateDest) the outline item
+ will point to
+
+ @returns
+ the outline item id of the new item
+ */
+ sal_Int32 CreateOutlineItem( sal_Int32 nParent = 0, const OUString& rText = OUString(), sal_Int32 nDestID = -1 );
+
+ /** Create a new note on a page
+
+ @param rRect
+ active rectangle of the note (that is the area that has to be
+ hit to popup the annotation)
+
+ @param rNote
+ specifies the contents of the note
+
+ @param nPageNr
+ number of page the note is on (as returned by NewPage)
+ or -1 in which case the current page is used
+ */
+ void CreateNote( const Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr = -1 );
+
+ /** begin a new logical structure element
+
+ BeginStructureElement/EndStructureElement calls build the logical structure
+ of the PDF - the basis for tagged PDF. Structural elements are implemented
+ using marked content tags. Each structural element can contain sub elements
+ (e.g. a section can contain a heading and a paragraph). The structure hierarchy
+ is build automatically from the Begin/EndStructureElement calls.
+
+ A structural element need not be contained on one page; e.g. paragraphs often
+ run from one page to the next. In this case the corresponding EndStructureElement
+ must be called while drawing the next page.
+
+ BeginStructureElement and EndStructureElement must be called only after
+ <member scope="vcl">PDFWriter::NewPage</member> has been called and before
+ <member scope="vcl">PDFWriter::Emit</member>gets called. The current page
+ number is an implicit context parameter for Begin/EndStructureElement.
+
+ For pagination artifacts that are not part of the logical structure
+ of the document (like header, footer or page number) the special
+ StructElement <code>NonStructElement</code> exists. To place content
+ outside of the struture tree simply call
+ <code>BeginStructureElement( NonStructElement )</code> then draw your
+ content and then call <code>EndStructureElement()</code>. Any children
+ of a <code>NonStructElement</code> will not be part of the structure as well.
+
+ @param eType
+ denotes what kind of element to begin (e.g. a heading or paragraph)
+
+ @param rAlias
+ the specified alias will be used as structure tag. Also an entry in the PDF's
+ role map will be created mapping alias to regular structure type.
+
+ @returns
+ the id of the newly created structural element
+ */
+ sal_Int32 BeginStructureElement( PDFWriter::StructElement eType, const OUString& rAlias = OUString() );
+ /** end a logical structure element
+
+ @see BeginStructureElement
+ */
+ void EndStructureElement();
+ /** set the current structure element
+
+ <p>
+ For different purposes it may be useful to paint a structure element's
+ content discontinously. In that case an already existing structure element
+ can be appended to by using <code>SetCurrentStructureElement</code>. The
+ refenrenced structure element becomes the current structure element with
+ all consequences: all following structure elements are appended as children
+ of the current element.
+ </p>
+
+ @param nElement
+ the id of the new current structure element
+
+ @returns
+ <true/> if the current structure element could be set successfully
+ <false/> if the current structure element could not be changed
+ (e.g. if the passed element id is invalid)
+ */
+ bool SetCurrentStructureElement( sal_Int32 nElement );
+ /** get the current structure element id
+
+ @returns
+ the id of the current structure element
+ */
+ sal_Int32 GetCurrentStructureElement();
+
+ /** set a structure attribute on the current structural element
+
+ SetStructureAttribute sets an attribute of the current structural element to a
+ new value. A consistency check is performed before actually setting the value;
+ if the check fails, the function returns <FALSE/> and the attribute remains
+ unchanged.
+
+ @param eAttr
+ denotes what attribute to change
+
+ @param eVal
+ the value to set the attribute to
+
+ @returns
+ <TRUE/> if the value was valid and the change has been performed,
+ <FALSE/> if the attribute or value was invalid; attribute remains unchanged
+ */
+ bool SetStructureAttribute( PDFWriter::StructAttribute eAttr, PDFWriter::StructAttributeValue eVal );
+ /** set a structure attribute on the current structural element
+
+ SetStructureAttributeNumerical sets an attribute of the current structural element
+ to a new numerical value. A consistency check is performed before actually setting
+ the value; if the check fails, the function returns <FALSE/> and the attribute
+ remains unchanged.
+
+ @param eAttr
+ denotes what attribute to change
+
+ @param nValue
+ the value to set the attribute to
+
+ @returns
+ <TRUE/> if the value was valid and the change has been performed,
+ <FALSE/> if the attribute or value was invalid; attribute remains unchanged
+ */
+ bool SetStructureAttributeNumerical( PDFWriter::StructAttribute eAttr, sal_Int32 nValue );
+ /** set the bounding box of a structural element
+
+ SetStructureBoundingBox sets the BBox attribute to a new value. Since the BBox
+ attribute can only be applied to <code>Table</code>, <code>Figure</code>,
+ <code>Form</code> and <code>Formula</code> elements, a call of this function
+ for other element types will be ignored and the BBox attribute not be set.
+
+ @param rRect
+ the new bounding box for the structural element
+ */
+ void SetStructureBoundingBox( const Rectangle& rRect );
+
+ /** set the ActualText attribute of a structural element
+
+ ActualText contains the Unicode text without layout artifacts that is shown by
+ a structural element. For example if a line is ended prematurely with a break in
+ a word and continued on the next line (e.g. "happen-<newline>stance") the
+ corresponding ActualText would contain the unbroken line (e.g. "happenstance").
+
+ @param rText
+ contains the complete logical text the structural element displays.
+ */
+ void SetActualText( const String& rText );
+
+ /** set the Alt attribute of a strutural element
+
+ Alt is s replacement text describing the contents of a structural element. This
+ is mainly used by accessibility applications; e.g. a screen reader would read
+ the Alt replacement text for an image to a visually impaired user.
+
+ @param rText
+ contains the replacement text for the structural element
+ */
+ void SetAlternateText( const String& rText );
+
+ /** Sets the transitional effect to be applied when the current page gets shown.
+
+ @param eType
+ the kind of effect to be used; use Regular to disable transitional effects
+ for this page
+
+ @param nMilliSec
+ the duration of the transitional effect in milliseconds;
+ set 0 to disable transitional effects
+
+ @param nPageNr
+ the page number to apply the effect to; -1 denotes the current page
+ */
+ void SetPageTransition( PDFWriter::PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr = -1 );
+
+ /** create a new form control
+
+ This function creates a new form control in the PDF and sets its various
+ properties. Do not pass an actual AnyWidget as <code>rControlType</code>
+ will be cast to the type described by the type member.
+
+ @param rControlType
+ a descendant of <code>AnyWidget</code> determing the control's properties
+ */
+ void CreateControl( const PDFWriter::AnyWidget& rControlType, sal_Int32 nPageNr = -1 );
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
new file mode 100644
index 000000000000..3bfd5ed2f66f
--- /dev/null
+++ b/include/vcl/pdfwriter.hxx
@@ -0,0 +1,1310 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _VCL_PDFWRITER_HXX
+#define _VCL_PDFWRITER_HXX
+
+#include <sal/types.h>
+
+#include <tools/gen.hxx>
+#include <tools/string.hxx>
+#include <tools/color.hxx>
+
+#include <vcl/dllapi.h>
+#include <vcl/vclenum.hxx>
+#include <vcl/font.hxx>
+#include <vcl/graphictools.hxx>
+
+#include "com/sun/star/io/XOutputStream.hpp"
+#include "com/sun/star/beans/XMaterialHolder.hpp"
+#include "com/sun/star/security/XCertificate.hpp"
+#include "com/sun/star/lang/Locale.hpp"
+
+#include <boost/scoped_ptr.hpp>
+
+#include <list>
+#include <vector>
+#include <set>
+
+class Font;
+class Point;
+class OutputDevice;
+class GDIMetaFile;
+class MapMode;
+class Polygon;
+class LineInfo;
+class PolyPolygon;
+class Bitmap;
+class BitmapEx;
+class Image;
+class Gradient;
+class Hatch;
+class Wallpaper;
+
+namespace vcl
+{
+
+class PDFExtOutDevData;
+class PDFWriterImpl;
+
+struct PDFNote
+{
+ String Title; // optional title for the popup containing the note
+ String Contents; // contents of the note
+};
+
+class VCL_DLLPUBLIC PDFOutputStream
+{
+ public:
+ virtual ~PDFOutputStream();
+ virtual void write( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xStream ) = 0;
+};
+
+class VCL_DLLPUBLIC PDFWriter
+{
+ boost::scoped_ptr<PDFWriterImpl> pImplementation;
+public:
+ // extended line info
+ enum CapType { capButt, capRound, capSquare };
+ enum JoinType { joinMiter, joinRound, joinBevel };
+ struct ExtLineInfo
+ {
+ double m_fLineWidth;
+ double m_fTransparency;
+ CapType m_eCap;
+ JoinType m_eJoin;
+ double m_fMiterLimit;
+ std::vector< double > m_aDashArray;
+
+ ExtLineInfo() : m_fLineWidth( 0.0 ),
+ m_fTransparency( 0.0 ),
+ m_eCap( capButt ),
+ m_eJoin( joinMiter ),
+ m_fMiterLimit( 10.0 )
+ {}
+ };
+
+ enum Orientation { Portrait, Landscape, Seascape, Inherit };
+
+ // in case the below enum is added PDF_1_6 PDF_1_7, please add them just after PDF_1_5
+ enum PDFVersion { PDF_1_2, PDF_1_3, PDF_1_4, PDF_1_5, PDF_A_1 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
+ // for the meaning of DestAreaType please look at PDF Reference Manual
+ // version 1.4 section 8.2.1, page 475
+ enum DestAreaType { XYZ, Fit, FitHorizontal, FitVertical,
+ FitRectangle, FitPageBoundingBox, FitPageBoundingBoxHorizontal,
+ FitPageBoundingBoxVertical
+ };
+
+ // for a definition of structural element types please refer to
+ // PDF Reference, 3rd ed. section 9.7.4
+ enum StructElement
+ {
+ // special element to place outside the structure hierarchy
+ NonStructElement,
+ // Grouping elements
+ Document, Part, Article, Section, Division, BlockQuote,
+ Caption, TOC, TOCI, Index,
+
+ // block level elements
+ Paragraph, Heading, H1, H2, H3, H4, H5, H6,
+ List, ListItem, LILabel, LIBody,
+ Table, TableRow, TableHeader, TableData,
+
+ // inline level elements
+ Span, Quote, Note, Reference, BibEntry, Code, Link,
+
+ // illustration elements
+ Figure, Formula, Form
+ };
+
+ enum StructAttribute
+ {
+ Placement, WritingMode, SpaceBefore, SpaceAfter, StartIndent, EndIndent,
+ TextIndent, TextAlign, Width, Height, BlockAlign, InlineAlign,
+ LineHeight, BaselineShift, TextDecorationType, ListNumbering,
+ RowSpan, ColSpan,
+
+ // link destination is an artificial attribute that sets
+ // the link annotation ID of a Link element
+ // further note: since structure attributes can only be
+ // set during content creation, but links can be
+ // created after the fact, it is possible to set
+ // an arbitrary id as structure attribute here. In this
+ // case the arbitrary id has to be passed again when the
+ // actual link annotation is created via SetLinkPropertyID
+ LinkAnnotation,
+ // Language currently sets a LanguageType (see i18nlangtag/lang.h)
+ // which will be internally changed to a corresponding locale
+ Language
+ };
+
+ enum StructAttributeValue
+ {
+ Invalid,
+ NONE,
+ // Placement
+ Block, Inline, Before, After, Start, End,
+ // WritingMode
+ LrTb, RlTb, TbRl,
+ // TextAlign
+ Center, Justify,
+ // Width, Height,
+ Auto,
+ // BlockAlign
+ Middle,
+ // LineHeight
+ Normal,
+ // TextDecorationType
+ Underline, Overline, LineThrough,
+ // ListNumbering
+ Disc, Circle, Square, Decimal, UpperRoman, LowerRoman, UpperAlpha, LowerAlpha
+ };
+
+ enum PageTransition
+ {
+ Regular,
+ SplitHorizontalInward, SplitHorizontalOutward,
+ SplitVerticalInward, SplitVerticalOutward,
+ BlindsHorizontal, BlindsVertical,
+ BoxInward, BoxOutward,
+ WipeLeftToRight, WipeBottomToTop, WipeRightToLeft, WipeTopToBottom,
+ Dissolve,
+ GlitterLeftToRight, GlitterTopToBottom, GlitterTopLeftToBottomRight
+ };
+
+ enum WidgetType
+ {
+ PushButton, RadioButton, CheckBox, Edit, ListBox, ComboBox, Hierarchy,
+ Signature
+ };
+
+ enum WidgetState
+ {
+ // PushButton, RadioButton, CheckBox; Down means selected for
+ // RadioButton and CheckBox
+ Up, Down
+ };
+
+ enum ErrorCode
+ {
+ // transparent object occurred and was draw opaque because
+ // PDF/A does not allow transparency
+ Warning_Transparency_Omitted_PDFA,
+
+ // transparent object occurred but is only supported since
+ // PDF 1.4
+ Warning_Transparency_Omitted_PDF13,
+
+ // a form action was exported that is not suitable for PDF/A
+ // the action was skipped
+ Warning_FormAction_Omitted_PDFA,
+
+ // transparent objects were converted to a bitmap in order
+ // to removetransparencies from the output
+ Warning_Transparency_Converted
+ };
+
+ struct VCL_DLLPUBLIC AnyWidget
+ {
+ protected:
+ WidgetType Type; // primitive RTTI
+ public:
+ OUString Name; // a distinct name to identify the control
+ OUString Description;// descriptive text for the contro (e.g. for tool tip)
+ OUString Text; // user text to appear on the control
+ sal_uInt16 TextStyle; // style flags
+ bool ReadOnly;
+ Rectangle Location; // describes the area filled by the control
+ bool Border; // true: widget should have a border, false: no border
+ Color BorderColor;// COL_TRANSPARENT and Border=true means get color from application settings
+ bool Background; // true: widget shall draw its background, false: no background
+ Color BackgroundColor; // COL_TRANSPARENT and Background=true means get color from application settings
+ Font TextFont; // an empty font will be replaced by the
+ // appropriate font from the user settings
+ Color TextColor; // COL_TRANSPARENT will be replaced by the appropriate color from application settings
+ sal_Int32 TabOrder; // lowest number is first in tab order
+
+ /* style flags for text are those for OutputDevice::DrawText
+ allowed values are:
+ TEXT_DRAW_LEFT, TEXT_DRAW_CENTER, TEXT_DRAW_RIGHT, TEXT_DRAW_TOP,
+ TEXT_DRAW_VCENTER, TEXT_DRAW_BOTTOM,
+ TEXT_DRAW_MULTILINE, TEXT_DRAW_WORDBREAK
+
+ if TextStyle is 0, then each control will fill in default values
+ */
+
+ // note: the Name member comprises the field name of the resulting
+ // PDF field names need to be globally unique. Therefore if any
+ // Widget with an already used name is created, the name will be
+ // made unique by adding an underscore ('_') and an ascending number
+ // to the name.
+
+ AnyWidget( WidgetType eType ) :
+ Type( eType ),
+ TextStyle( 0 ),
+ ReadOnly( false ),
+ Border( false ),
+ BorderColor( COL_TRANSPARENT ),
+ Background( false ),
+ BackgroundColor( COL_TRANSPARENT ),
+ TextColor( COL_TRANSPARENT ),
+ TabOrder( -1 )
+ {}
+ virtual ~AnyWidget();
+
+ WidgetType getType() const { return Type; }
+
+ virtual AnyWidget* Clone() const = 0;
+
+ protected:
+ // note that this equals the default compiler-generated copy-ctor, but we want to have it
+ // protected, to only allow sub classes to access it
+ AnyWidget( const AnyWidget& rSource )
+ :Type( rSource.Type )
+ ,Name( rSource.Name )
+ ,Description( rSource.Description )
+ ,Text( rSource.Text )
+ ,TextStyle( rSource.TextStyle )
+ ,ReadOnly( rSource.ReadOnly )
+ ,Location( rSource.Location )
+ ,Border( rSource.Border )
+ ,BorderColor( rSource.BorderColor )
+ ,Background( rSource.Background )
+ ,BackgroundColor( rSource.BackgroundColor )
+ ,TextFont( rSource.TextFont )
+ ,TextColor( rSource.TextColor )
+ ,TabOrder( rSource.TabOrder )
+ {
+ }
+ AnyWidget& operator=( const AnyWidget& ); // never implemented
+ };
+
+ struct PushButtonWidget : public AnyWidget
+ {
+ /* If Dest is set to a valid link destination,
+ Then pressing the button will act as a goto
+ action within the document.
+
+ Else:
+ An empty URL means this button will reset the form.
+
+ If URL is not empty and Submit is set, then the URL
+ contained will be set as the URL to submit the
+ form to. In this case the submit method will be
+ either GET if SubmitGet is true or POST if
+ SubmitGet is false.
+
+ If URL is not empty and Submit is clear, then
+ the URL contained will be interpreted as a
+ hyperlink to be executed on pushing the button.
+
+ There will be no error checking or any kind of
+ conversion done to the URL parameter execept this:
+ it will be output as 7bit Ascii. The URL
+ will appear literally in the PDF file produced
+ */
+ sal_Int32 Dest;
+ OUString URL;
+ bool Submit;
+ bool SubmitGet;
+
+ PushButtonWidget()
+ : AnyWidget( vcl::PDFWriter::PushButton ),
+ Dest( -1 ), Submit( false ), SubmitGet( false )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new PushButtonWidget( *this );
+ }
+ };
+
+ struct CheckBoxWidget : public AnyWidget
+ {
+ bool Checked;
+ bool ButtonIsLeft;
+
+ CheckBoxWidget()
+ : AnyWidget( vcl::PDFWriter::CheckBox ),
+ Checked( false ),
+ ButtonIsLeft( true )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new CheckBoxWidget( *this );
+ }
+ };
+
+ struct RadioButtonWidget : public AnyWidget
+ {
+ bool Selected;
+ sal_Int32 RadioGroup;
+ bool ButtonIsLeft;
+ OUString OnValue; // the value of the radio button if it is selected
+
+ RadioButtonWidget()
+ : AnyWidget( vcl::PDFWriter::RadioButton ),
+ Selected( false ),
+ RadioGroup( 0 ),
+ ButtonIsLeft( true )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new RadioButtonWidget( *this );
+ }
+ // radio buttons having the same RadioGroup id comprise one
+ // logical radio button group, that is at most one of the RadioButtons
+ // in a group can be checked at any time
+ //
+ // note: a PDF radio button field consists of a named field
+ // containing unnamed checkbox child fields. The name of the
+ // radio button field is taken from the first RadioButtonWidget created
+ // in the group
+ };
+
+ struct EditWidget : public AnyWidget
+ {
+ bool MultiLine; // whether multiple lines are allowed
+ bool Password; // visible echo off
+ bool FileSelect; // field is a file selector
+ sal_Int32 MaxLen; // maximum field length in characters, 0 means unlimited
+
+ EditWidget()
+ : AnyWidget( vcl::PDFWriter::Edit ),
+ MultiLine( false ),
+ Password( false ),
+ FileSelect( false ),
+ MaxLen( 0 )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new EditWidget( *this );
+ }
+ };
+
+ struct ListBoxWidget : public AnyWidget
+ {
+ bool DropDown;
+ bool Sort;
+ bool MultiSelect;
+ std::vector<OUString> Entries;
+ std::vector<sal_Int32> SelectedEntries;
+ // if MultiSelect is false only the first entry of SelectedEntries
+ // will be taken into account. the same is implicit for PDF < 1.4
+ // since multiselect is a 1.4+ feature
+
+ ListBoxWidget()
+ : AnyWidget( vcl::PDFWriter::ListBox ),
+ DropDown( false ),
+ Sort( false ),
+ MultiSelect( false )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new ListBoxWidget( *this );
+ }
+ };
+
+ // note: PDF only supports dropdown comboboxes
+ struct ComboBoxWidget : public AnyWidget
+ {
+ bool Sort;
+ std::vector<OUString> Entries;
+ // set the current value in AnyWidget::Text
+
+ ComboBoxWidget()
+ : AnyWidget( vcl::PDFWriter::ComboBox ),
+ Sort( false )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new ComboBoxWidget( *this );
+ }
+ };
+
+ struct SignatureWidget: public AnyWidget
+ {
+ // Use Sig prefix for members to avoid conflict with
+ // the Location member of the AnyWidget which spcifies the coordinates
+ // of the signature
+
+ OUString SigLocation;
+ OUString SigReason;
+ OUString SigContactInfo;
+ bool SigHidden;
+
+ SignatureWidget()
+ : AnyWidget( vcl::PDFWriter::Signature ),
+ SigHidden( true )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new SignatureWidget( *this );
+ }
+ };
+
+ enum ExportDataFormat { HTML, XML, FDF, PDF };
+// see 3.6.1 of PDF 1.4 ref for details, used for 8.1 PDF v 1.4 ref also
+// These emuns are treated as integer while reading/writing to configuration
+ enum PDFViewerPageMode
+ {
+ ModeDefault,
+ UseOutlines,
+ UseThumbs
+ };
+// These emuns are treated as integer while reading/writing to configuration
+ enum PDFViewerAction
+ {
+ ActionDefault,
+ FitInWindow,
+ FitWidth,
+ FitVisible,
+ ActionZoom
+ };
+// These enums are treated as integer while reading/writing to configuration
+ enum PDFPageLayout
+ {
+ DefaultLayout,
+ SinglePage,
+ Continuous,
+ ContinuousFacing
+ };
+
+ // These emuns are treated as integer while reading/writing to configuration
+ //what default action to generate in a PDF hyperlink to external document/site
+ enum PDFLinkDefaultAction
+ {
+ URIAction,
+ URIActionDestination,
+ LaunchAction
+ };
+
+/*
+The following structure describes the permissions used in PDF security
+ */
+ struct PDFEncryptionProperties
+ {
+
+ bool Security128bit; // true to select 128 bit encryption, false for 40 bit
+ //for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20.
+ bool CanPrintTheDocument;
+ bool CanModifyTheContent;
+ bool CanCopyOrExtract;
+ bool CanAddOrModify;
+ //for revision 3 (bit 128 security) only
+ bool CanFillInteractive;
+ bool CanExtractForAccessibility;
+ bool CanAssemble;
+ bool CanPrintFull;
+
+ // encryption will only happen if EncryptionKey is not empty
+ // EncryptionKey is actually a construct out of OValue, UValue and DocumentIdentifier
+ // if these do not match, behavior is undefined, most likely an invalid PDF will be produced
+ // OValue, UValue, EncryptionKey and DocumentIdentifier can be computed from
+ // PDFDocInfo, Owner password and User password used the InitEncryption method which
+ // implements the algorithms described in the PDF reference chapter 3.5: Encryption
+ std::vector<sal_uInt8> OValue;
+ std::vector<sal_uInt8> UValue;
+ std::vector<sal_uInt8> EncryptionKey;
+ std::vector<sal_uInt8> DocumentIdentifier;
+
+ //permission default set for 128 bit, accessibility only
+ PDFEncryptionProperties() :
+ Security128bit ( true ),
+ CanPrintTheDocument ( false ),
+ CanModifyTheContent ( false ),
+ CanCopyOrExtract ( false ),
+ CanAddOrModify ( false ),
+ CanFillInteractive ( false ),
+ CanExtractForAccessibility ( true ),
+ CanAssemble ( false ),
+ CanPrintFull ( false )
+ {}
+
+
+ bool Encrypt() const
+ { return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
+ };
+
+ struct PDFDocInfo
+ {
+ String Title; // document title
+ String Author; // document author
+ String Subject; // subject
+ String Keywords; // keywords
+ String Creator; // application that created the original document
+ String Producer; // OpenOffice
+ };
+
+ enum ColorMode
+ {
+ DrawColor, DrawGreyscale
+ };
+
+ struct PDFWriterContext
+ {
+ /* must be a valid file: URL usable by osl */
+ OUString URL;
+ /* the URL of the document being exported, used for relative links*/
+ OUString BaseURL;
+ /*if relative to file system should be formed*/
+ bool RelFsys;//i56629, i49415?, i64585?
+ /*the action to set the PDF hyperlink to*/
+ PDFWriter::PDFLinkDefaultAction DefaultLinkAction;
+ //convert the .od? target file type in a link to a .pdf type
+ //this is examined before doing anything else
+ bool ConvertOOoTargetToPDFTarget;
+ //when the file type is .pdf, force the GoToR action
+ bool ForcePDFAction;
+
+ /* decides the PDF language level to be produced */
+ PDFVersion Version;
+ /* valid for PDF >= 1.4
+ causes the MarkInfo entry in the document catalog to be set
+ */
+ bool Tagged;
+ /* forces the embedding of PDF standard fonts */
+ bool EmbedStandardFonts;
+ /* determines in which format a form
+ will be submitted.
+ */
+ PDFWriter::ExportDataFormat SubmitFormat;
+ bool AllowDuplicateFieldNames;
+ bool FieldsUseSystemFonts;
+ /* the following data members are used to customize the PDF viewer
+ preferences
+ */
+ /* see 3.6.1 PDF v 1.4 ref*/
+ PDFWriter::PDFViewerPageMode PDFDocumentMode;
+ PDFWriter::PDFViewerAction PDFDocumentAction;
+ // in percent, valid only if PDFDocumentAction == ActionZoom
+ sal_Int32 Zoom;
+
+ /* see 8.6 PDF v 1.4 ref
+ specifies whether to hide the viewer tool
+ bars when the document is active.
+ */
+ bool HideViewerToolbar;
+ bool HideViewerMenubar;
+ bool HideViewerWindowControls;
+ bool FitWindow;
+ bool OpenInFullScreenMode;
+ bool CenterWindow;
+ bool DisplayPDFDocumentTitle;
+ PDFPageLayout PageLayout;
+ bool FirstPageLeft;
+ // intially visible page in viewer (starting with 0 for first page)
+ sal_Int32 InitialPage;
+ sal_Int32 OpenBookmarkLevels; // -1 means all levels
+
+ PDFWriter::PDFEncryptionProperties Encryption;
+ PDFWriter::PDFDocInfo DocumentInfo;
+
+ bool SignPDF;
+ OUString SignLocation;
+ OUString SignPassword;
+ OUString SignReason;
+ OUString SignContact;
+ com::sun::star::lang::Locale DocumentLocale; // defines the document default language
+ sal_uInt32 DPIx, DPIy; // how to handle MapMode( MAP_PIXEL )
+ // 0 here specifies a default handling
+ PDFWriter::ColorMode ColorMode;
+ com::sun::star::uno::Reference< com::sun::star::security::XCertificate> SignCertificate;
+
+ PDFWriterContext() :
+ RelFsys( false ), //i56629, i49415?, i64585?
+ DefaultLinkAction( PDFWriter::URIAction ),
+ ConvertOOoTargetToPDFTarget( false ),
+ ForcePDFAction( false ),
+ Version( PDFWriter::PDF_1_4 ),
+ Tagged( false ),
+ EmbedStandardFonts( false ),
+ SubmitFormat( PDFWriter::FDF ),
+ AllowDuplicateFieldNames( false ),
+ FieldsUseSystemFonts( true ),
+ PDFDocumentMode( PDFWriter::ModeDefault ),
+ PDFDocumentAction( PDFWriter::ActionDefault ),
+ Zoom( 100 ),
+ HideViewerToolbar( false ),
+ HideViewerMenubar( false ),
+ HideViewerWindowControls( false ),
+ FitWindow( false ),
+ OpenInFullScreenMode( false ),
+ CenterWindow( false ),
+ DisplayPDFDocumentTitle( true ),
+ PageLayout( PDFWriter::DefaultLayout ),
+ FirstPageLeft( false ),
+ InitialPage( 1 ),
+ OpenBookmarkLevels( -1 ),
+ Encryption(),
+ SignPDF( false ),
+ DPIx( 0 ),
+ DPIy( 0 ),
+ ColorMode( PDFWriter::DrawColor ),
+ SignCertificate( 0 )
+ {}
+ };
+
+ PDFWriter( const PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
+ ~PDFWriter();
+
+ /** Returns an OutputDevice for formatting
+ <p>This Output device is guaranteed to use the same
+ font metrics as the resulting PDF file.</p>
+
+ @returns
+ the reference output device
+ */
+ OutputDevice* GetReferenceDevice();
+
+ /** Creates a new page to fill
+ <p>If width and height are not set the page size
+ is inherited from the page tree</p>
+ <p>other effects:
+ resets the graphics state: MapMode, Font
+ Colors and other state information MUST
+ be set again or are undefined.
+ </p>
+
+ @returns
+ returns the page id of the new page
+ */
+ sal_Int32 NewPage( sal_Int32 nPageWidth = 0, sal_Int32 nPageHeight = 0, Orientation eOrientation = Inherit );
+ /** Play a metafile like an outputdevice would do
+ */
+ struct PlayMetafileContext
+ {
+ int m_nMaxImageResolution;
+ bool m_bOnlyLosslessCompression;
+ int m_nJPEGQuality;
+ bool m_bTransparenciesWereRemoved;
+
+ PlayMetafileContext()
+ : m_nMaxImageResolution( 0 )
+ , m_bOnlyLosslessCompression( false )
+ , m_nJPEGQuality( 90 )
+ , m_bTransparenciesWereRemoved( false )
+ {}
+
+ };
+ void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = NULL );
+
+ /* sets the document locale originally passed with the context to a new value
+ * only affects the output if used before calling <code>Emit/code>.
+ */
+ void SetDocumentLocale( const com::sun::star::lang::Locale& rDocLocale );
+
+ /* finishes the file */
+ bool Emit();
+
+ /*
+ * Get a list of errors that occurred during processing
+ * this should enable the producer to give feedback about
+ * any anomalies that might have occurred
+ */
+ std::set< ErrorCode > GetErrors();
+
+ static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+ InitEncryption( const OUString& i_rOwnerPassword,
+ const OUString& i_rUserPassword,
+ bool b128Bit
+ );
+
+ /* functions for graphics state */
+ /* flag values: see vcl/outdev.hxx */
+ void Push( sal_uInt16 nFlags = 0xffff );
+ void Pop();
+
+ void SetClipRegion();
+ void SetClipRegion( const basegfx::B2DPolyPolygon& rRegion );
+ void MoveClipRegion( long nHorzMove, long nVertMove );
+ void IntersectClipRegion( const Rectangle& rRect );
+ void IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
+
+ void SetLayoutMode( sal_uLong nMode );
+ void SetDigitLanguage( LanguageType eLang );
+
+ void SetLineColor( const Color& rColor );
+ void SetLineColor() { SetLineColor( Color( COL_TRANSPARENT ) ); }
+
+ void SetFillColor( const Color& rColor );
+ void SetFillColor() { SetFillColor( Color( COL_TRANSPARENT ) ); }
+
+ void SetFont( const Font& rNewFont );
+ void SetTextColor( const Color& rColor );
+ void SetTextFillColor();
+ void SetTextFillColor( const Color& rColor );
+
+ void SetTextLineColor();
+ void SetTextLineColor( const Color& rColor );
+ void SetOverlineColor();
+ void SetOverlineColor( const Color& rColor );
+ void SetTextAlign( ::TextAlign eAlign );
+
+ void SetMapMode( const MapMode& rNewMapMode );
+
+
+ /* actual drawing functions */
+ void DrawText( const Point& rPos, const String& rText );
+
+ void DrawTextLine( const Point& rPos, long nWidth,
+ FontStrikeout eStrikeout,
+ FontUnderline eUnderline,
+ FontUnderline eOverline,
+ sal_Bool bUnderlineAbove = sal_False );
+ void DrawTextArray( const Point& rStartPt, const XubString& rStr,
+ const sal_Int32* pDXAry = NULL,
+ xub_StrLen nIndex = 0,
+ xub_StrLen nLen = STRING_LEN );
+ void DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
+ const XubString& rStr,
+ xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN );
+ void DrawText( const Rectangle& rRect,
+ const XubString& rStr, sal_uInt16 nStyle = 0 );
+
+ void DrawPixel( const Point& rPt, const Color& rColor );
+ void DrawPixel( const Point& rPt )
+ { DrawPixel( rPt, Color( COL_TRANSPARENT ) ); }
+
+ void DrawLine( const Point& rStartPt, const Point& rEndPt );
+ void DrawLine( const Point& rStartPt, const Point& rEndPt,
+ const LineInfo& rLineInfo );
+ void DrawPolyLine( const Polygon& rPoly );
+ void DrawPolyLine( const Polygon& rPoly,
+ const LineInfo& rLineInfo );
+ void DrawPolyLine( const Polygon& rPoly, const ExtLineInfo& rInfo );
+ void DrawPolygon( const Polygon& rPoly );
+ void DrawPolyPolygon( const PolyPolygon& rPolyPoly );
+ void DrawRect( const Rectangle& rRect );
+ void DrawRect( const Rectangle& rRect,
+ sal_uLong nHorzRount, sal_uLong nVertRound );
+ void DrawEllipse( const Rectangle& rRect );
+ void DrawArc( const Rectangle& rRect,
+ const Point& rStartPt, const Point& rEndPt );
+ void DrawPie( const Rectangle& rRect,
+ const Point& rStartPt, const Point& rEndPt );
+ void DrawChord( const Rectangle& rRect,
+ const Point& rStartPt, const Point& rEndPt );
+
+ void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
+ const Bitmap& rBitmap );
+
+ void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
+ const BitmapEx& rBitmapEx );
+
+ void DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
+ void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
+
+ void DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch );
+
+ void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
+ void DrawTransparent( const PolyPolygon& rPolyPoly,
+ sal_uInt16 nTransparencePercent );
+
+ /** Start a transparency group
+
+ Drawing operations can be grouped together to acquire a common transparency
+ behaviour; after calling <code>BeginTransparencyGroup</code> all drawing
+ operations will be grouped together into a transparent object.
+
+ The transparency behaviour is set with ond of the <code>EndTransparencyGroup</code>
+ calls and can be either a constant transparency factor or a transparent
+ soft mask in form of an 8 bit gray scale bitmap.
+
+ It is permissible to nest transparency group.
+
+ Transparency groups MUST NOT span multiple pages
+
+ Transparency is a feature introduced in PDF1.4, so transparency group
+ will be ignored if the produced PDF has a lower version. The drawing
+ operations will be emitted normally.
+ */
+ void BeginTransparencyGroup();
+
+ /** End a transparency group with constant transparency factor
+
+ This ends a transparency group and inserts it on the current page. The
+ coordinates of the group result out of the grouped drawing operations.
+
+ @param rBoundRect
+ The bounding rectangle of the group
+
+ @param nTransparencePercent
+ The transparency factor
+ */
+ void EndTransparencyGroup( const Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
+
+ /** Insert a JPG encoded image (optionally with mask)
+
+ @param rJPGData
+ a Stream containing the encoded image
+
+ @param bIsTrueColor
+ true: jpeg is 24 bit true color, false: jpeg is 8 bit greyscale
+
+ @param rSrcSizePixel
+ size in pixel of the image
+
+ @param rTargetArea
+ where to put the image
+
+ @param rMask
+ optional mask; if not empty it must have
+ the same pixel size as the image and
+ be either 1 bit black&white or 8 bit grey
+ */
+ void DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask );
+
+ /** Create a new named destination to be used in a link from another PDF document
+
+ @parm sDestName
+ the name (label) of the bookmark, to be used to jump to
+
+ @param rRect
+ target rectangle on page to be displayed if dest is jumped to
+
+ @param nPageNr
+ number of page the dest is on (as returned by NewPage)
+ or -1 in which case the current page is used
+
+ @param eType
+ what dest type to use
+
+ @returns
+ the destination id (to be used in SetLinkDest) or
+ -1 if page id does not exist
+ */
+ sal_Int32 CreateNamedDest( const OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
+ /** Create a new destination to be used in a link
+
+ @param rRect
+ target rectangle on page to be displayed if dest is jumped to
+
+ @param nPageNr
+ number of page the dest is on (as returned by NewPage)
+ or -1 in which case the current page is used
+
+ @param eType
+ what dest type to use
+
+ @returns
+ the destination id (to be used in SetLinkDest) or
+ -1 if page id does not exist
+ */
+ sal_Int32 CreateDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
+ /** Create a new link on a page
+
+ @param rRect
+ active rectangle of the link (that is the area that has to be
+ hit to activate the link)
+
+ @param nPageNr
+ number of page the link is on (as returned by NewPage)
+ or -1 in which case the current page is used
+
+ @returns
+ the link id (to be used in SetLinkDest, SetLinkURL) or
+ -1 if page id does not exist
+ */
+ sal_Int32 CreateLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 );
+
+ /** creates a destination which is not intended to be referred to by a link, but by a public destination Id.
+
+ Form widgets, for instance, might refer to a destination, without ever actually creating a source link to
+ point to this destination. In such cases, a public destination Id will be assigned to the form widget,
+ and later on, the concrete destination data for this public Id will be registered using RegisterDestReference.
+
+ @param rRect
+ target rectangle on page to be displayed if dest is jumped to
+
+ @param nPageNr
+ number of page the dest is on (as returned by NewPage)
+ or -1 in which case the current page is used
+
+ @param eType
+ what dest type to use
+
+ @returns
+ the internal destination Id.
+ */
+ sal_Int32 RegisterDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
+
+
+ /** Set the destination for a link
+ <p>will change a URL type link to a dest link if necessary</p>
+
+ @param nLinkId
+ the link to be changed
+
+ @param nDestId
+ the dest the link shall point to
+ @returns
+ 0 for success
+ -1 in case the link id does not exist
+ -2 in case the dest id does not exist
+ */
+ sal_Int32 SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
+ /** Set the URL for a link
+ <p>will change a dest type link to an URL type link if necessary</p>
+ @param nLinkId
+ the link to be changed
+
+ @param rURL
+ the URL the link shall point to.
+ The URL will be parsed (and corrected) by the <code>com.sun.star.util.URLTransformer</code>
+ service; the result will then appear literally in the PDF file produced
+
+ @returns
+ 0 for success
+ -1 in case the link id does not exist
+ */
+ sal_Int32 SetLinkURL( sal_Int32 nLinkId, const OUString& rURL );
+ /** Resolve link in logical structure
+ <p>
+ If a link is created after the corresponding visual appearance was drawn
+ it is not possible to set the link id as a property attribute to the
+ link structure item that should be created in tagged PDF around the
+ visual appearance of a link.
+ </p>
+ <p>
+ For this reason an arbitrary id can be given to
+ <code>SetStructureAttributeNumerical</code> at the time the text for
+ the link is drawn. To resolve this arbitrary id again when the actual
+ link annotation is created use SetLinkPropertyID. When <code>Emit</code>
+ finally gets called all <code>LinkAnnotation</code> type structure attributes
+ will be replaced with the correct link id.
+ </p>
+ <p>
+ CAUTION: this technique must be used either for all or none of the links
+ in a document since the link id space and arbitrary property id space
+ could overlap and it would be impossible to resolve whether a <code>Link</code>
+ structure attribute value was arbitrary or already a real id.
+ </p>
+
+ @param nLinkId
+ the link to be mapped
+
+ @param nPropertyID
+ the arbitrary id set in a <code>Link</code> structure element to address
+ the link with real id <code>nLinkId</code>
+ */
+ void SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
+ /** Create a new outline item
+
+ @param nParent
+ declares the parent of the new item in the outline hierarchy.
+ An invalid value will result in a new toplevel item.
+
+ @param rText
+ sets the title text of the item
+
+ @param nDestId
+ declares which Dest (created with CreateDest) the outline item
+ will point to
+
+ @returns
+ the outline item id of the new item
+ */
+ sal_Int32 CreateOutlineItem( sal_Int32 nParent = 0, const OUString& rText = OUString(), sal_Int32 nDestID = -1 );
+
+ /** Set an outline item's parent
+
+ @param nItem
+ specififies which item should be reparented.
+
+ @param nNewParent
+ specifies which outline item will be the item's new parent.
+ Use 0 for reparenting to top level.
+
+ @returns
+ -1 if the item does not exist
+ -2 if the new parent does not exist, item will be reparented to top level.
+ */
+ sal_Int32 SetOutlineItemParent( sal_Int32 nItem, sal_Int32 nNewParent );
+
+ /** Set an outline item's title text
+
+ @param nItem
+ specififies which item should get a new text
+
+ @param rText
+ sets the title text of the item
+
+ @returns
+ 0 if the item exists and the text was changed
+ -1 if the item does not exist
+ */
+ sal_Int32 SetOutlineItemText( sal_Int32 nItem, const OUString& rText );
+
+ /** Set an outline item's destination
+
+ @param nItem
+ specififies which item should get a new dest
+
+ @param nDestID
+ specifies the item's new destination
+
+ @returns
+ -1 if the item does not exist
+ -2 if the new dest does not exist, dest will remain unchanged
+ */
+ sal_Int32 SetOutlineItemDest( sal_Int32 nItem, sal_Int32 nDestID );
+
+ /** Create a new note on a page
+
+ @param rRect
+ active rectangle of the note (that is the area that has to be
+ hit to popup the annotation)
+
+ @param rNote
+ specifies the contents of the note
+
+ @param nPageNr
+ number of page the note is on (as returned by NewPage)
+ or -1 in which case the current page is used
+ */
+ void CreateNote( const Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr = -1 );
+
+ /** begin a new logical structure element
+
+ <p>
+ BeginStructureElement/EndStructureElement calls build the logical structure
+ of the PDF - the basis for tagged PDF. Structural elements are implemented
+ using marked content tags. Each structural element can contain sub elements
+ (e.g. a section can contain a heading and a paragraph). The structure hierarchy
+ is build automatically from the Begin/EndStructureElement calls.
+
+ A structural element need not be contained on one page; e.g. paragraphs often
+ run from one page to the next. In this case the corresponding EndStructureElement
+ must be called while drawing the next page.
+ </p>
+
+ <p>
+ BeginStructureElement and EndStructureElement must be called only after
+ <member scope="vcl">PDFWriter::NewPage</member> has been called and before
+ <member scope="vcl">PDFWriter::Emit</member>gets called. The current page
+ number is an implicit context parameter for Begin/EndStructureElement.
+ </p>
+
+ <p>
+ For pagination artifacts that are not part of the logical structure
+ of the document (like header, footer or page number) the special
+ StructElement <code>NonStructElement</code> exists. To place content
+ outside of the struture tree simply call
+ <code>BeginStructureElement( NonStructElement )</code> then draw your
+ content and then call <code>EndStructureElement()</code>. All children
+ of a <code>NonStructElement</code> will not be part of the structure.
+ Nonetheless if you add a child structural element to a
+ <code>NonStructElement</code> you will still have to call
+ <code>EndStructureElement</code> for it. Best think of the structure
+ tree as a stack.
+ </p>
+
+ <p>
+ Note: there is always one structural element in existance without having
+ called <code>BeginStructureElement</code>; this is the root of the structure
+ tree (called StructTreeRoot). The StructTreeRoot has always the id 0.
+ </p>
+
+ @param eType
+ denotes what kind of element to begin (e.g. a heading or paragraph)
+
+ @param rAlias
+ the specified alias will be used as structure tag. Also an entry in the PDF's
+ role map will be created mapping alias to regular structure type.
+
+ @returns
+ the new structure element's id for use in <code>SetCurrentStructureElement</code>
+ */
+ sal_Int32 BeginStructureElement( enum StructElement eType, const OUString& rAlias = OUString() );
+ /** end the current logical structure element
+
+ <p>
+ Close the current structure element. The current element's
+ parent becomes the current structure element again.
+ </p>
+
+ @see BeginStructureElement
+ */
+ void EndStructureElement();
+ /** set the current structure element
+
+ <p>
+ For different purposes it may be useful to paint a structure element's
+ content discontinously. In that case an already existing structure element
+ can be appended to by using <code>SetCurrentStructureElement</code>. The
+ refenrenced structure element becomes the current structure element with
+ all consequences: all following structure elements are appended as children
+ of the current element.
+ </p>
+
+ @param nElement
+ the id of the new current structure element
+
+ @returns
+ <true/> if the current structure element could be set successfully
+ <false/> if the current structure element could not be changed
+ (e.g. if the passed element id is invalid)
+ */
+ bool SetCurrentStructureElement( sal_Int32 nElement );
+
+ /** set a structure attribute on the current structural element
+
+ SetStructureAttribute sets an attribute of the current structural element to a
+ new value. A consistency check is performed before actually setting the value;
+ if the check fails, the function returns <FALSE/> and the attribute remains
+ unchanged.
+
+ @param eAttr
+ denotes what attribute to change
+
+ @param eVal
+ the value to set the attribute to
+
+ @returns
+ <TRUE/> if the value was valid and the change has been performed,
+ <FALSE/> if the attribute or value was invalid; attribute remains unchanged
+ */
+ bool SetStructureAttribute( enum StructAttribute eAttr, enum StructAttributeValue eVal );
+ /** set a structure attribute on the current structural element
+
+ SetStructureAttributeNumerical sets an attribute of the current structural element
+ to a new numerical value. A consistency check is performed before actually setting
+ the value; if the check fails, the function returns <FALSE/> and the attribute
+ remains unchanged.
+
+ @param eAttr
+ denotes what attribute to change
+
+ @param nValue
+ the value to set the attribute to
+
+ @returns
+ <TRUE/> if the value was valid and the change has been performed,
+ <FALSE/> if the attribute or value was invalid; attribute remains unchanged
+ */
+ bool SetStructureAttributeNumerical( enum StructAttribute eAttr, sal_Int32 nValue );
+ /** set the bounding box of a structural element
+
+ SetStructureBoundingBox sets the BBox attribute to a new value. Since the BBox
+ attribute can only be applied to <code>Table</code>, <code>Figure</code>,
+ <code>Form</code> and <code>Formula</code> elements, a call of this function
+ for other element types will be ignored and the BBox attribute not be set.
+
+ @param rRect
+ the new bounding box for the structural element
+ */
+ void SetStructureBoundingBox( const Rectangle& rRect );
+
+ /** set the ActualText attribute of a structural element
+
+ ActualText contains the Unicode text without layout artifacts that is shown by
+ a structural element. For example if a line is ended prematurely with a break in
+ a word and continued on the next line (e.g. "happen-<newline>stance") the
+ corresponding ActualText would contain the unbroken line (e.g. "happenstance").
+
+ @param rText
+ contains the complete logical text the structural element displays.
+ */
+ void SetActualText( const String& rText );
+
+ /** set the Alt attribute of a strutural element
+
+ Alt is s replacement text describing the contents of a structural element. This
+ is mainly used by accessibility applications; e.g. a screen reader would read
+ the Alt replacement text for an image to a visually impaired user.
+
+ @param rText
+ contains the replacement text for the structural element
+ */
+ void SetAlternateText( const String& rText );
+
+ /** Sets the time in seconds a page will appear before the next
+ page is shown automatically
+
+ @param nSeconds
+ time in seconds the current page will be shown; pass 0 for manual advancement
+
+ @param nPageNr
+ the page number to apply the autoadvance time to; -1 denotes the current page
+ */
+ void SetAutoAdvanceTime( sal_uInt32 nSeconds, sal_Int32 nPageNr = -1 );
+
+ /** Sets the transitional effect to be applied when the current page gets shown.
+
+ @param eType
+ the kind of effect to be used; use Regular to disable transitional effects
+ for this page
+
+ @param nMilliSec
+ the duration of the transitional effect in milliseconds;
+ set 0 to disable transitional effects
+
+ @param nPageNr
+ the page number to apply the effect to; -1 denotes the current page
+ */
+ void SetPageTransition( PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr = -1 );
+
+ /** create a new form control
+
+ This function creates a new form control in the PDF and sets its various
+ properties. Do not pass an actual AnyWidget as <code>rControlType</code>
+ will be cast to the type described by the type member.
+
+ @param rControlType
+ a descendant of <code>AnyWidget</code> determing the control's properties
+
+ @returns
+ the new control's id for reference purposes
+ */
+ sal_Int32 CreateControl( const AnyWidget& rControlType, sal_Int32 nPageNr = -1 );
+
+ /** Inserts an additional stream to the PDF file
+
+ This function adds an arbitrary stream to the produced PDF file. May be called
+ any time before <code>Emit()</code>. The stream will be written during
+ <code>Emit</code> by calling the <code>PDFOutputStream</code> Object's <code>write</code>
+ method. After the call the <code>PDFOutputStream</code> will be deleted.
+
+ All additional streams and their mimetypes will be entered into an array
+ in the trailer dictionary.
+
+ @param rMimeType
+ the mimetype of the stream
+
+ @param rStream
+ the interface to the additional stream
+
+ @param bCompress
+ specifies whether the stream should be flate encoded by PDFWriter or not
+ */
+ void AddStream( const String& rMimeType, PDFOutputStream* pStream, bool bCompress );
+
+};
+
+}
+
+#endif // _VCL_PDFWRITER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/pngread.hxx b/include/vcl/pngread.hxx
new file mode 100644
index 000000000000..b36a0ee6106a
--- /dev/null
+++ b/include/vcl/pngread.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 _SV_PNGREAD_HXX
+#define _SV_PNGREAD_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/bitmapex.hxx>
+#include <vector>
+
+// -------------
+// - PNGReader -
+// -------------
+
+namespace vcl
+{
+ class PNGReaderImpl;
+
+ class VCL_DLLPUBLIC PNGReader
+ {
+ PNGReaderImpl* mpImpl;
+
+ public:
+
+ /* the PNG chunks are read within the c'tor, so the stream will
+ be positioned at the end of the PNG */
+ PNGReader( SvStream& rStm );
+ ~PNGReader();
+
+ /* an empty preview size hint (=default) will read the whole image
+ */
+ BitmapEx Read( const Size& i_rPreviewHint = Size() );
+
+ // retrieve every chunk that resides inside the PNG
+ struct ChunkData
+ {
+ sal_uInt32 nType;
+ std::vector< sal_uInt8 > aData;
+ };
+ const std::vector< ChunkData >& GetChunks() const;
+
+ void SetIgnoreGammaChunk( sal_Bool b );
+ };
+}
+
+#endif // _SV_PNGREAD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/pngwrite.hxx b/include/vcl/pngwrite.hxx
new file mode 100644
index 000000000000..921ad45ddf4d
--- /dev/null
+++ b/include/vcl/pngwrite.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 _SV_PNGWRITE_HXX
+#define _SV_PNGWRITE_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <vcl/dllapi.h>
+#include <vcl/bitmapex.hxx>
+#include <vector>
+
+// -------------
+// - PNGWriter -
+// -------------
+
+namespace vcl
+{
+ class PNGWriterImpl;
+
+ class VCL_DLLPUBLIC PNGWriter
+ {
+ PNGWriterImpl* mpImpl;
+
+ public:
+
+ PNGWriter( const BitmapEx& BmpEx,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData = NULL );
+ ~PNGWriter();
+
+ sal_Bool Write( SvStream& rStm );
+
+ // additional method to be able to modify all chunk before they are stored
+ struct ChunkData
+ {
+ sal_uInt32 nType;
+ std::vector< sal_uInt8 > aData;
+ };
+ std::vector< vcl::PNGWriter::ChunkData >& GetChunks();
+ };
+}
+
+#endif // _SV_PNGWRITE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/pointr.hxx b/include/vcl/pointr.hxx
new file mode 100644
index 000000000000..9cfdd6000371
--- /dev/null
+++ b/include/vcl/pointr.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 _VCL_POINTR_HXX
+#define _VCL_POINTR_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/ptrstyle.hxx>
+
+class Point;
+
+// -----------
+// - Pointer -
+// -----------
+
+class VCL_DLLPUBLIC Pointer
+{
+ PointerStyle meStyle;
+
+public:
+ Pointer()
+ { meStyle = POINTER_ARROW; }
+ Pointer( PointerStyle eStyle )
+ { meStyle = eStyle; }
+
+ PointerStyle GetStyle() const { return meStyle; }
+
+ sal_Bool operator==( const Pointer& rPointer ) const
+ { return (meStyle == rPointer.meStyle); }
+ sal_Bool operator!=( const Pointer& rPointer ) const
+ { return !(Pointer::operator==( rPointer )); }
+};
+
+#endif // _VCL_POINTR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/popupmenuwindow.hxx b/include/vcl/popupmenuwindow.hxx
new file mode 100644
index 000000000000..a5856dca4bf9
--- /dev/null
+++ b/include/vcl/popupmenuwindow.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 __POPUPMENUWINDOW_HXX__
+#define __POPUPMENUWINDOW_HXX__
+
+#include "vcl/floatwin.hxx"
+
+class VCL_DLLPUBLIC PopupMenuFloatingWindow : public FloatingWindow
+{
+private:
+ struct ImplData;
+ ImplData* mpImplData;
+public:
+ PopupMenuFloatingWindow( Window* pParent, WinBits nStyle = (WB_SYSTEMFLOATWIN|WB_SYSTEMWINDOW|WB_NOBORDER) );
+ ~PopupMenuFloatingWindow();
+
+ sal_uInt16 GetMenuStackLevel() const;
+ void SetMenuStackLevel( sal_uInt16 nLevel );
+ bool IsPopupMenu() const;
+
+ //determine if a given window is an activated PopupMenuFloatingWindow
+ static bool isPopupMenu(const Window *pWindow);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/ppdparser.hxx b/include/vcl/ppdparser.hxx
new file mode 100644
index 000000000000..80fbeaf4728a
--- /dev/null
+++ b/include/vcl/ppdparser.hxx
@@ -0,0 +1,311 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _PSPRINT_PPDPARSER_HXX_
+#define _PSPRINT_PPDPARSER_HXX_
+
+#include <list>
+#include <vector>
+#include <boost/unordered_map.hpp>
+
+#include "tools/string.hxx"
+#include "tools/stream.hxx"
+#include "rtl/string.hxx"
+
+#include "vcl/dllapi.h"
+
+#include "com/sun/star/lang/Locale.hpp"
+
+#define PRINTER_PPDDIR "driver"
+
+namespace psp {
+
+class PPDParser;
+class PPDTranslator;
+
+enum PPDValueType { eInvocation, eQuoted, eSymbol, eString, eNo };
+
+struct VCL_DLLPUBLIC PPDValue
+{
+ PPDValueType m_eType;
+ String m_aOption;
+ String m_aValue;
+};
+
+// ----------------------------------------------------------------------
+
+/*
+ * PPDKey - a container for the available options (=values) of a PPD keyword
+ */
+
+class VCL_DLLPUBLIC PPDKey
+{
+ friend class PPDParser;
+
+ typedef ::boost::unordered_map< OUString, PPDValue, OUStringHash > hash_type;
+ typedef ::std::vector< PPDValue* > value_type;
+
+ String m_aKey;
+ hash_type m_aValues;
+ value_type m_aOrderedValues;
+ const PPDValue* m_pDefaultValue;
+ bool m_bQueryValue;
+ PPDValue m_aQueryValue;
+
+public:
+ enum UIType { PickOne, PickMany, Boolean };
+ enum SetupType { ExitServer, Prolog, DocumentSetup, PageSetup, JCLSetup, AnySetup };
+private:
+
+ bool m_bUIOption;
+ UIType m_eUIType;
+ int m_nOrderDependency;
+ SetupType m_eSetupType;
+
+ void eraseValue( const String& rOption );
+public:
+ PPDKey( const String& rKey );
+ ~PPDKey();
+
+ PPDValue* insertValue( const String& rOption );
+ int countValues() const
+ { return m_aValues.size(); }
+ // neither getValue will return the query option
+ const PPDValue* getValue( int n ) const;
+ const PPDValue* getValue( const String& rOption ) const;
+ const PPDValue* getValueCaseInsensitive( const String& rOption ) const;
+ const PPDValue* getDefaultValue() const { return m_pDefaultValue; }
+ const PPDValue* getQueryValue() const { return m_bQueryValue ? &m_aQueryValue : NULL; }
+
+ const String& getKey() const { return m_aKey; }
+ bool isUIKey() const { return m_bUIOption; }
+ UIType getUIType() const { return m_eUIType; }
+ SetupType getSetupType() const { return m_eSetupType; }
+ int getOrderDependency() const { return m_nOrderDependency; }
+};
+
+// define a hash for PPDKey
+struct PPDKeyhash
+{
+ size_t operator()( const PPDKey * pKey) const
+ { return (size_t)pKey; }
+};
+
+// ----------------------------------------------------------------------
+
+/*
+ * PPDParser - parses a PPD file and contains all available keys from it
+ */
+
+class PPDContext;
+class CUPSManager;
+
+class VCL_DLLPUBLIC PPDParser
+{
+ friend class PPDContext;
+ friend class CUPSManager;
+ friend class PPDCache;
+
+ typedef ::boost::unordered_map< OUString, PPDKey*, OUStringHash > hash_type;
+ typedef ::std::vector< PPDKey* > value_type;
+
+ void insertKey( const String& rKey, PPDKey* pKey );
+public:
+ struct PPDConstraint
+ {
+ const PPDKey* m_pKey1;
+ const PPDValue* m_pOption1;
+ const PPDKey* m_pKey2;
+ const PPDValue* m_pOption2;
+
+ PPDConstraint() : m_pKey1( NULL ), m_pOption1( NULL ), m_pKey2( NULL ), m_pOption2( NULL ) {}
+ };
+private:
+ hash_type m_aKeys;
+ value_type m_aOrderedKeys;
+ ::std::list< PPDConstraint > m_aConstraints;
+
+ // some identifying fields
+ String m_aPrinterName;
+ String m_aNickName;
+ // the full path of the PPD file
+ String m_aFile;
+ // some basic attributes
+ bool m_bColorDevice;
+ bool m_bType42Capable;
+ sal_uLong m_nLanguageLevel;
+ rtl_TextEncoding m_aFileEncoding;
+
+
+ // shortcuts to important keys and their default values
+ // imageable area
+ const PPDValue* m_pDefaultImageableArea;
+ const PPDKey* m_pImageableAreas;
+ // paper dimensions
+ const PPDValue* m_pDefaultPaperDimension;
+ const PPDKey* m_pPaperDimensions;
+ // paper trays
+ const PPDValue* m_pDefaultInputSlot;
+ const PPDKey* m_pInputSlots;
+ // resolutions
+ const PPDValue* m_pDefaultResolution;
+ const PPDKey* m_pResolutions;
+ // duplex commands
+ const PPDValue* m_pDefaultDuplexType;
+ const PPDKey* m_pDuplexTypes;
+
+ // fonts
+ const PPDKey* m_pFontList;
+
+ // translations
+ PPDTranslator* m_pTranslator;
+
+ PPDParser( const String& rFile );
+ ~PPDParser();
+
+ void parseOrderDependency(const OString& rLine);
+ void parseOpenUI(const OString& rLine);
+ void parseConstraint(const OString& rLine);
+ void parse( std::list< OString >& rLines );
+
+ String handleTranslation(const OString& i_rString, bool i_bIsGlobalized);
+
+ static void scanPPDDir( const String& rDir );
+ static void initPPDFiles();
+ static String getPPDFile( const String& rFile );
+public:
+ static const PPDParser* getParser( const String& rFile );
+ static String getPPDPrinterName( const String& rFile );
+ static void freeAll();
+ static void getKnownPPDDrivers( std::list< OUString >& o_rDrivers, bool bRefresh = false );
+
+ const String& getFilename() const { return m_aFile; }
+
+ const PPDKey* getKey( int n ) const;
+ const PPDKey* getKey( const String& rKey ) const;
+ int getKeys() const { return m_aKeys.size(); }
+ bool hasKey( const PPDKey* ) const;
+
+ const ::std::list< PPDConstraint >& getConstraints() const { return m_aConstraints; }
+
+ const String& getPrinterName() const
+ { return m_aPrinterName.Len() ? m_aPrinterName : m_aNickName; }
+ const String& getNickName() const
+ { return m_aNickName.Len() ? m_aNickName : m_aPrinterName; }
+
+ bool isColorDevice() const { return m_bColorDevice; }
+ bool isType42Capable() const { return m_bType42Capable; }
+ sal_uLong getLanguageLevel() const { return m_nLanguageLevel; }
+
+ String getDefaultPaperDimension() const;
+ void getDefaultPaperDimension( int& rWidth, int& rHeight ) const
+ { getPaperDimension( getDefaultPaperDimension(), rWidth, rHeight ); }
+ bool getPaperDimension( const String& rPaperName,
+ int& rWidth, int& rHeight ) const;
+ // width and height in pt
+ // returns false if paper not found
+ int getPaperDimensions() const
+ { return m_pPaperDimensions ? m_pPaperDimensions->countValues() : 0; }
+
+ // match the best paper for width and height
+ String matchPaper( int nWidth, int nHeight ) const;
+
+ bool getMargins( const String& rPaperName,
+ int &rLeft, int& rRight,
+ int &rUpper, int& rLower ) const;
+ // values in pt
+ // returns true if paper found
+
+ // values int pt
+
+ String getDefaultInputSlot() const;
+ int getInputSlots() const
+ { return m_pInputSlots ? m_pInputSlots->countValues() : 0; }
+
+ void getDefaultResolution( int& rXRes, int& rYRes ) const;
+ // values in dpi
+ void getResolutionFromString( const String&, int&, int& ) const;
+ // helper function
+
+ int getDuplexTypes() const
+ { return m_pDuplexTypes ? m_pDuplexTypes->countValues() : 0; }
+
+ int getFonts() const
+ { return m_pFontList ? m_pFontList->countValues() : 0; }
+ String getFont( int ) const;
+
+
+ OUString translateKey( const OUString& i_rKey,
+ const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) const;
+ OUString translateOption( const OUString& i_rKey,
+ const OUString& i_rOption,
+ const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) const;
+};
+
+// ----------------------------------------------------------------------
+
+/*
+ * PPDContext - a class to manage user definable states based on the
+ * contents of a PPDParser.
+ */
+
+class VCL_DLLPUBLIC PPDContext
+{
+ typedef ::boost::unordered_map< const PPDKey*, const PPDValue*, PPDKeyhash > hash_type;
+ hash_type m_aCurrentValues;
+ const PPDParser* m_pParser;
+
+ // returns false: check failed, new value is constrained
+ // true: check succeded, new value can be set
+ bool checkConstraints( const PPDKey*, const PPDValue*, bool bDoReset );
+ bool resetValue( const PPDKey*, bool bDefaultable = false );
+public:
+ PPDContext( const PPDParser* pParser = NULL );
+ PPDContext( const PPDContext& rContext ) { operator=( rContext ); }
+ PPDContext& operator=( const PPDContext& rContext );
+ ~PPDContext();
+
+ void setParser( const PPDParser* );
+ const PPDParser* getParser() const { return m_pParser; }
+
+ const PPDValue* getValue( const PPDKey* ) const;
+ const PPDValue* setValue( const PPDKey*, const PPDValue*, bool bDontCareForConstraints = false );
+
+ int countValuesModified() const { return m_aCurrentValues.size(); }
+ const PPDKey* getModifiedKey( int n ) const;
+
+ // public wrapper for the private method
+ bool checkConstraints( const PPDKey*, const PPDValue* );
+
+ // for printer setup
+ char* getStreamableBuffer( sal_uLong& rBytes ) const;
+ void rebuildFromStreamBuffer( char* pBuffer, sal_uLong nBytes );
+
+ // convenience
+ int getRenderResolution() const;
+
+ // width, height in points, paper will contain the name of the selected
+ // paper after the call
+ void getPageSize( OUString& rPaper, int& rWidth, int& rHeight ) const;
+};
+
+} // namespace
+
+#endif // _PSPRINT_PPDPARSER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/prgsbar.hxx b/include/vcl/prgsbar.hxx
new file mode 100644
index 000000000000..9f22df47c7a8
--- /dev/null
+++ b/include/vcl/prgsbar.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 _PRGSBAR_HXX
+#define _PRGSBAR_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/window.hxx>
+
+/*************************************************************************
+ *
+ * class ProgressBar
+ *
+ * this class is used to display the ProgressBar
+ *
+ * -----------------------------------------------------------------------
+ *
+ * WinBits
+ *
+ * WB_BORDER border around the window
+ * WB_3DLOOK 3D representation
+ *
+ * -----------------------------------------------------------------------
+ *
+ * Methodes
+ *
+ * Use SetValue() to set a percentage between 0 and 100. A value larger
+ * than 100 will cause the last rectangle to start flashing
+ *
+ ************************************************************************/
+
+// -----------
+// - WinBits -
+// -----------
+
+#define WB_STDPROGRESSBAR WB_BORDER
+
+// ---------------
+// - ProgressBar -
+// ---------------
+
+class VCL_DLLPUBLIC ProgressBar : public Window
+{
+private:
+ Point maPos;
+ long mnPrgsWidth;
+ long mnPrgsHeight;
+ sal_uInt16 mnPercent;
+ sal_uInt16 mnPercentCount;
+ sal_Bool mbCalcNew;
+
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit();
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc );
+
+public:
+ ProgressBar( Window* pParent, WinBits nWinBits = WB_STDPROGRESSBAR );
+ ProgressBar( Window* pParent, const ResId& rResId );
+ ~ProgressBar();
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void SetValue( sal_uInt16 nNewPercent );
+ sal_uInt16 GetValue() const { return mnPercent; }
+};
+
+#endif // _PRGSBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
new file mode 100644
index 000000000000..c40e8bc4ab4d
--- /dev/null
+++ b/include/vcl/print.hxx
@@ -0,0 +1,688 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_PRINT_HXX
+#define _SV_PRINT_HXX
+
+#include <rtl/ustring.hxx>
+
+#include "tools/errcode.hxx"
+#include "tools/solar.h"
+#include "vcl/dllapi.h"
+#include "vcl/outdev.hxx"
+#include "vcl/prntypes.hxx"
+#include "vcl/jobset.hxx"
+#include "vcl/gdimtf.hxx"
+#include "tools/stream.hxx"
+#include "tools/multisel.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/view/PrintableState.hpp"
+
+#include <boost/shared_ptr.hpp>
+#include <boost/unordered_map.hpp>
+#include <set>
+
+class SalInfoPrinter;
+struct SalPrinterQueueInfo;
+class SalPrinter;
+class VirtualDevice;
+class Window;
+
+namespace vcl {
+ class PrinterController;
+ class PrintDialog;
+}
+
+// -----------------
+// - Printer-Types -
+// -----------------
+
+#define PAGEQUEUE_ALLPAGES 0xFFFF
+
+enum PrinterSupport { SUPPORT_SET_ORIENTATION, SUPPORT_SET_PAPERBIN,
+ SUPPORT_SET_PAPERSIZE, SUPPORT_SET_PAPER,
+ SUPPORT_COPY, SUPPORT_COLLATECOPY,
+ SUPPORT_SETUPDIALOG, SUPPORT_FAX, SUPPORT_PDF };
+
+// ---------------
+// - PrinterPage -
+// ---------------
+
+class VCL_DLLPUBLIC PrinterPage
+{
+ GDIMetaFile* mpMtf;
+ JobSetup maJobSetup;
+ sal_uInt16 mbNewJobSetup;
+
+public:
+
+ PrinterPage() : mpMtf( new GDIMetaFile() ) {}
+ PrinterPage( GDIMetaFile* pMtf, sal_Bool bNewJobSetup, const JobSetup& rSetup ) :
+ mpMtf( pMtf ), maJobSetup( rSetup ), mbNewJobSetup( bNewJobSetup ) {}
+ ~PrinterPage() { delete mpMtf; }
+
+ GDIMetaFile* GetGDIMetaFile() const { return mpMtf; }
+ const JobSetup& GetJobSetup() const { return maJobSetup; }
+ sal_Bool IsNewJobSetup() const { return (mbNewJobSetup != 0); }
+};
+
+
+// -------------
+// - QueueInfo -
+// -------------
+
+class VCL_DLLPUBLIC QueueInfo
+{
+ friend class Printer;
+
+private:
+ OUString maPrinterName;
+ OUString maDriver;
+ OUString maLocation;
+ OUString maComment;
+ sal_uInt32 mnStatus;
+ sal_uInt32 mnJobs;
+
+public:
+ QueueInfo();
+ QueueInfo( const QueueInfo& rInfo );
+ ~QueueInfo();
+
+ const OUString& GetPrinterName() const { return maPrinterName; }
+ const OUString& GetDriver() const { return maDriver; }
+ const OUString& GetLocation() const { return maLocation; }
+ const OUString& GetComment() const { return maComment; }
+ sal_uInt32 GetStatus() const { return mnStatus; }
+ sal_uInt32 GetJobs() const { return mnJobs; }
+
+ bool operator==( const QueueInfo& rInfo ) const;
+
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, QueueInfo& rInfo );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const QueueInfo& rInfo );
+};
+
+// ------------------
+// - PrinterOptions -
+// ------------------
+
+enum PrinterTransparencyMode
+{
+ PRINTER_TRANSPARENCY_AUTO = 0,
+ PRINTER_TRANSPARENCY_NONE = 1
+};
+
+// -----------------------------------------------------------------------------
+
+enum PrinterGradientMode
+{
+ PRINTER_GRADIENT_STRIPES = 0,
+ PRINTER_GRADIENT_COLOR = 1
+};
+
+// -----------------------------------------------------------------------------
+
+enum PrinterBitmapMode
+{
+ PRINTER_BITMAP_OPTIMAL = 0,
+ PRINTER_BITMAP_NORMAL = 1,
+ PRINTER_BITMAP_RESOLUTION = 2
+};
+
+// -----------------------------------------------------------------------------
+
+class VCL_DLLPUBLIC PrinterOptions
+{
+private:
+
+ sal_Bool mbReduceTransparency;
+ PrinterTransparencyMode meReducedTransparencyMode;
+ sal_Bool mbReduceGradients;
+ PrinterGradientMode meReducedGradientsMode;
+ sal_uInt16 mnReducedGradientStepCount;
+ sal_Bool mbReduceBitmaps;
+ PrinterBitmapMode meReducedBitmapMode;
+ sal_uInt16 mnReducedBitmapResolution;
+ sal_Bool mbReducedBitmapsIncludeTransparency;
+ sal_Bool mbConvertToGreyscales;
+ sal_Bool mbPDFAsStandardPrintJobFormat;
+
+public:
+
+ PrinterOptions();
+ ~PrinterOptions();
+
+ sal_Bool IsReduceTransparency() const { return mbReduceTransparency; }
+ void SetReduceTransparency( sal_Bool bSet ) { mbReduceTransparency = bSet; }
+
+ PrinterTransparencyMode GetReducedTransparencyMode() const { return meReducedTransparencyMode; }
+ void SetReducedTransparencyMode( PrinterTransparencyMode eMode ) { meReducedTransparencyMode = eMode; }
+
+ sal_Bool IsReduceGradients() const { return mbReduceGradients; }
+ void SetReduceGradients( sal_Bool bSet ) { mbReduceGradients = bSet; }
+
+ PrinterGradientMode GetReducedGradientMode() const { return meReducedGradientsMode; }
+ void SetReducedGradientMode( PrinterGradientMode eMode ) { meReducedGradientsMode = eMode; }
+
+ sal_uInt16 GetReducedGradientStepCount() const { return mnReducedGradientStepCount; }
+ void SetReducedGradientStepCount( sal_uInt16 nStepCount ) { mnReducedGradientStepCount = nStepCount; }
+
+ sal_Bool IsReduceBitmaps() const { return mbReduceBitmaps; }
+ void SetReduceBitmaps( sal_Bool bSet ) { mbReduceBitmaps = bSet; }
+
+ PrinterBitmapMode GetReducedBitmapMode() const { return meReducedBitmapMode; }
+ void SetReducedBitmapMode( PrinterBitmapMode eMode ) { meReducedBitmapMode = eMode; }
+
+ sal_uInt16 GetReducedBitmapResolution() const { return mnReducedBitmapResolution; }
+ void SetReducedBitmapResolution( sal_uInt16 nResolution ) { mnReducedBitmapResolution = nResolution; }
+
+ sal_Bool IsReducedBitmapIncludesTransparency() const { return mbReducedBitmapsIncludeTransparency; }
+ void SetReducedBitmapIncludesTransparency( sal_Bool bSet ) { mbReducedBitmapsIncludeTransparency = bSet; }
+
+ sal_Bool IsConvertToGreyscales() const { return mbConvertToGreyscales; }
+ void SetConvertToGreyscales( sal_Bool bSet ) { mbConvertToGreyscales = bSet; }
+
+ sal_Bool IsPDFAsStandardPrintJobFormat() const { return mbPDFAsStandardPrintJobFormat; }
+ void SetPDFAsStandardPrintJobFormat( sal_Bool bSet ) { mbPDFAsStandardPrintJobFormat = bSet; }
+
+ // read printer options from configuration, parameter decides whether the set for
+ // print "to printer" or "to file" should be read.
+ // returns true if config was read, false if an error occurred
+ bool ReadFromConfig( bool bFile );
+};
+
+// -----------
+// - Printer -
+// -----------
+
+class VCL_DLLPUBLIC Printer : public OutputDevice
+{
+ friend class OutputDevice;
+
+private:
+ SalInfoPrinter* mpInfoPrinter;
+ SalPrinter* mpPrinter;
+ SalGraphics* mpJobGraphics;
+ Printer* mpPrev;
+ Printer* mpNext;
+ VirtualDevice* mpDisplayDev;
+ PrinterOptions* mpPrinterOptions;
+ OUString maPrinterName;
+ OUString maDriver;
+ OUString maPrintFile;
+ OUString maJobName;
+ JobSetup maJobSetup;
+ Point maPageOffset;
+ Size maPaperSize;
+ sal_uLong mnError;
+ sal_uInt16 mnCurPage;
+ sal_uInt16 mnCurPrintPage;
+ sal_uInt16 mnPageQueueSize;
+ sal_uInt16 mnCopyCount;
+ sal_Bool mbDefPrinter;
+ sal_Bool mbPrinting;
+ sal_Bool mbJobActive;
+ sal_Bool mbCollateCopy;
+ sal_Bool mbPrintFile;
+ sal_Bool mbInPrintPage;
+ sal_Bool mbNewJobSetup;
+ sal_Bool mbIsQueuePrinter;
+ sal_Bool mbUserSetupCompleted;
+ sal_Bool mbUserSetupResult;
+ Link maErrorHdl;
+
+ SAL_DLLPRIVATE void ImplInitData();
+ SAL_DLLPRIVATE void ImplInit( SalPrinterQueueInfo* pInfo );
+ SAL_DLLPRIVATE void ImplInitDisplay( const Window* pWindow );
+ SAL_DLLPRIVATE static SalPrinterQueueInfo* ImplGetQueueInfo( const OUString& rPrinterName,
+ const OUString* pDriver );
+ SAL_DLLPRIVATE void ImplUpdatePageData();
+ SAL_DLLPRIVATE void ImplUpdateFontList();
+ SAL_DLLPRIVATE void ImplFindPaperFormatForUserSize( JobSetup&, bool bMatchNearest );
+
+ SAL_DLLPRIVATE bool StartJob( const OUString& rJobName, boost::shared_ptr<vcl::PrinterController>& );
+
+ static SAL_DLLPRIVATE sal_uLong ImplSalPrinterErrorCodeToVCL( sal_uLong nError );
+
+private:
+ SAL_DLLPRIVATE sal_Bool EndJob();
+ SAL_DLLPRIVATE Printer( const Printer& rPrinter );
+ SAL_DLLPRIVATE Printer& operator =( const Printer& rPrinter );
+public:
+ SAL_DLLPRIVATE void ImplStartPage();
+ SAL_DLLPRIVATE void ImplEndPage();
+public:
+ void DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const Gradient& rGradient );
+
+protected:
+
+ void SetSelfAsQueuePrinter( sal_Bool bQueuePrinter ) { mbIsQueuePrinter = bQueuePrinter; }
+ sal_Bool IsQueuePrinter() const { return mbIsQueuePrinter; }
+
+public:
+ Printer();
+ Printer( const JobSetup& rJobSetup );
+ Printer( const QueueInfo& rQueueInfo );
+ Printer( const OUString& rPrinterName );
+ virtual ~Printer();
+
+ static const std::vector< OUString >& GetPrinterQueues();
+ static const QueueInfo* GetQueueInfo( const OUString& rPrinterName, bool bStatusUpdate );
+ static OUString GetDefaultPrinterName();
+
+ virtual void Error();
+
+ const OUString& GetName() const { return maPrinterName; }
+ const OUString& GetDriverName() const { return maDriver; }
+ sal_Bool IsDefPrinter() const { return mbDefPrinter; }
+ sal_Bool IsDisplayPrinter() const { return mpDisplayDev != NULL; }
+ sal_Bool IsValid() const { return !IsDisplayPrinter(); }
+
+ sal_uLong GetCapabilities( sal_uInt16 nType ) const;
+ sal_Bool HasSupport( PrinterSupport eFeature ) const;
+
+ sal_Bool SetJobSetup( const JobSetup& rSetup );
+ const JobSetup& GetJobSetup() const { return maJobSetup; }
+ void SetJobValue( const OUString& rKey, const OUString& rValue ) { maJobSetup.SetValue( rKey, rValue ); }
+
+ sal_Bool Setup( Window* pWindow = NULL );
+ sal_Bool SetPrinterProps( const Printer* pPrinter );
+
+ // SetPrinterOptions is used internally only now
+ // in earlier times it was used only to set the options loaded directly from the configuration
+ // in SfxPrinter::InitJob, this is now handled internally
+ // should the need arise to set the printer options outside vcl, also a method would have to be devised
+ // to not override these again internally
+ SAL_DLLPRIVATE void SetPrinterOptions( const PrinterOptions& rOptions );
+ const PrinterOptions& GetPrinterOptions() const { return( *mpPrinterOptions ); }
+
+ sal_Bool SetOrientation( Orientation eOrient );
+ Orientation GetOrientation() const;
+ sal_Bool SetDuplexMode( DuplexMode );
+ // returns the angle that a landscape page will be turned counterclockwise
+ // wrt to portrait. The return value may be only valid for
+ // the current paper
+ int GetLandscapeAngle() const;
+ sal_Bool SetPaperBin( sal_uInt16 nPaperBin );
+ sal_uInt16 GetPaperBin() const;
+ sal_Bool SetPaper( Paper ePaper );
+ sal_Bool SetPaperSizeUser( const Size& rSize );
+ sal_Bool SetPaperSizeUser( const Size& rSize, bool bMatchNearest );
+ Paper GetPaper() const;
+ static OUString GetPaperName( Paper ePaper );
+ // return a UI string for the current paper; i_bPaperUser == false means an empty string for PAPER_USER
+ OUString GetPaperName( bool i_bPaperUser = true ) const;
+
+ // returns number of available paper formats
+ int GetPaperInfoCount() const;
+ // returns info about paper format nPaper
+ const PaperInfo& GetPaperInfo( int nPaper ) const;
+ sal_uInt16 GetPaperBinCount() const;
+ OUString GetPaperBinName( sal_uInt16 nPaperBin ) const;
+
+ const Size& GetPaperSizePixel() const { return maPaperSize; }
+ Size GetPaperSize() const { return PixelToLogic( maPaperSize ); }
+ const Point& GetPageOffsetPixel() const { return maPageOffset; }
+ Point GetPageOffset() const { return PixelToLogic( maPageOffset ); }
+
+ sal_Bool SetCopyCount( sal_uInt16 nCopy, sal_Bool bCollate = sal_False );
+ sal_uInt16 GetCopyCount() const { return mnCopyCount; }
+ sal_Bool IsCollateCopy() const { return mbCollateCopy; }
+
+ sal_Bool IsPrinting() const { return mbPrinting; }
+
+ const OUString& GetCurJobName() const { return maJobName; }
+ sal_uInt16 GetCurPage() const { return mnCurPage; }
+ sal_Bool IsJobActive() const { return mbJobActive; }
+
+ sal_uLong GetError() const { return ERRCODE_TOERROR(mnError); }
+ sal_uLong GetErrorCode() const { return mnError; }
+
+ void SetErrorHdl( const Link& rLink ) { maErrorHdl = rLink; }
+ const Link& GetErrorHdl() const { return maErrorHdl; }
+
+ void Compat_OldPrinterMetrics( bool bSet );
+
+ /** checks the printer list and updates it necessary
+ *
+ * sends a DataChanged event of type DATACHANGED_PRINTER
+ * if the printer list changed
+ */
+ static void updatePrinters();
+
+ /** execute a print job
+
+ starts a print job asynchronously (that is will return
+
+ */
+ static void PrintJob( const boost::shared_ptr<vcl::PrinterController>& i_pController,
+ const JobSetup& i_rInitSetup
+ );
+
+ // implementation detail of PrintJob being asynchronous
+ // not exported, not usable outside vcl
+ static void SAL_DLLPRIVATE ImplPrintJob( const boost::shared_ptr<vcl::PrinterController>& i_pController,
+ const JobSetup& i_rInitSetup
+ );
+};
+
+namespace vcl
+{
+class ImplPrinterControllerData;
+
+class VCL_DLLPUBLIC PrinterController
+{
+ ImplPrinterControllerData* mpImplData;
+protected:
+ PrinterController( const boost::shared_ptr<Printer>& );
+public:
+ enum NupOrderType
+ { LRTB, TBLR, TBRL, RLTB };
+ struct MultiPageSetup
+ {
+ // all metrics in 100th mm
+ int nRows;
+ int nColumns;
+ int nRepeat;
+ Size aPaperSize;
+ long nLeftMargin;
+ long nTopMargin;
+ long nRightMargin;
+ long nBottomMargin;
+ long nHorizontalSpacing;
+ long nVerticalSpacing;
+ bool bDrawBorder;
+ PrinterController::NupOrderType nOrder;
+
+ MultiPageSetup()
+ : nRows( 1 ), nColumns( 1 ), nRepeat( 1 ), aPaperSize( 21000, 29700 )
+ , nLeftMargin( 0 ), nTopMargin( 0 )
+ , nRightMargin( 0 ), nBottomMargin( 0 )
+ , nHorizontalSpacing( 0 ), nVerticalSpacing( 0 )
+ , bDrawBorder( false )
+ , nOrder( LRTB )
+ {
+ }
+ };
+
+ struct PageSize
+ {
+ Size aSize; // in 100th mm
+ bool bFullPaper; // full paper, not only imageable area is printed
+
+ PageSize( const Size& i_rSize = Size( 21000, 29700 ),
+ bool i_bFullPaper = false
+ ) : aSize( i_rSize ), bFullPaper( i_bFullPaper ) {}
+ };
+
+ virtual ~PrinterController();
+
+ const boost::shared_ptr<Printer>& getPrinter() const;
+ /* for implementations: get current job properties as changed by e.g. print dialog
+ this gets the current set of properties initially told to Printer::PrintJob
+
+ For convenience a second sequence will be merged in to get a combined sequence.
+ In case of duplicate property names, the value of i_MergeList wins.
+ */
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >
+ getJobProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rMergeList ) const;
+
+ /* get the PropertyValue of a Property
+ */
+ com::sun::star::beans::PropertyValue* getValue( const OUString& i_rPropertyName );
+ const com::sun::star::beans::PropertyValue* getValue( const OUString& i_rPropertyName ) const;
+ /* get a bool property
+ in case the property is unknown or not convertible to bool, i_bFallback is returned
+ */
+ sal_Bool getBoolProperty( const OUString& i_rPropertyName, sal_Bool i_bFallback ) const;
+ /* get an int property
+ in case the property is unknown or not convertible to bool, i_nFallback is returned
+ */
+ sal_Int32 getIntProperty( const OUString& i_rPropertyName, sal_Int32 i_nFallback ) const;
+
+ /* set a property value - can also be used to add another UI property
+ */
+ void setValue( const OUString& i_rPropertyName, const com::sun::star::uno::Any& i_rValue );
+ void setValue( const com::sun::star::beans::PropertyValue& i_rValue );
+
+ /* return the currently active UI options. These are the same that were passed to setUIOptions.
+ */
+ const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& getUIOptions() const;
+ /* set possible UI options. should only be done once before passing the PrinterListener
+ to Printer::PrintJob
+ */
+ void setUIOptions( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
+ /* enable/disable an option; this can be used to implement dialog logic.
+ */
+ bool isUIOptionEnabled( const OUString& rPropName ) const;
+ bool isUIChoiceEnabled( const OUString& rPropName, sal_Int32 nChoice ) const;
+ /* returns the property name rPropName depends on or an empty string
+ if no dependency exists.
+ */
+ OUString getDependency( const OUString& rPropName ) const;
+ /* makeEnabled will chage the property rPropName depends on to the value
+ that makes rPropName enabled. If the dependency itself is also disabled,
+ no action will be performed.
+
+ returns the property name rPropName depends on or an empty string
+ if no change was made.
+ */
+ OUString makeEnabled( const OUString& rPropName );
+
+ virtual int getPageCount() const = 0; // must be overloaded by the app
+ /* get the page parameters, namely the jobsetup that should be active for the page
+ (describing among others the physical page size) and the "page size". In writer
+ case this would probably be the same as the JobSetup since writer sets the page size
+ draw/impress for example print their page on the paper set on the printer,
+ possibly adjusting the page size to fit. That means the page size can be different from
+ the paper size.
+ */
+ // must be overloaded by the app, return page size in 1/100th mm
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getPageParameters( int i_nPage ) const = 0;
+ virtual void printPage( int i_nPage ) const = 0; // must be overloaded by the app
+ virtual void jobStarted(); // will be called after a possible dialog has been shown and the real printjob starts
+ virtual void jobFinished( com::sun::star::view::PrintableState );
+
+ com::sun::star::view::PrintableState getJobState() const;
+
+ void abortJob();
+
+ bool isShowDialogs() const;
+ bool isDirectPrint() const;
+
+ // implementation details, not usable outside vcl
+ // don't use outside vcl. Some of these are exported for
+ // the benefit of vcl's plugins.
+ // Still: DO NOT USE OUTSIDE VCL
+ VCL_PLUGIN_PUBLIC int getFilteredPageCount();
+ SAL_DLLPRIVATE PageSize getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf, bool i_bMayUseCache = false );
+ VCL_PLUGIN_PUBLIC PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
+ VCL_PLUGIN_PUBLIC void printFilteredPage( int i_nPage );
+ SAL_DLLPRIVATE void setPrinter( const boost::shared_ptr<Printer>& );
+ SAL_DLLPRIVATE void setOptionChangeHdl( const Link& );
+ VCL_PLUGIN_PUBLIC void createProgressDialog();
+ VCL_PLUGIN_PUBLIC bool isProgressCanceled() const;
+ SAL_DLLPRIVATE void setMultipage( const MultiPageSetup& );
+ SAL_DLLPRIVATE const MultiPageSetup& getMultipage() const;
+ VCL_PLUGIN_PUBLIC void setLastPage( sal_Bool i_bLastPage );
+ SAL_DLLPRIVATE void setReversePrint( sal_Bool i_bReverse );
+ SAL_DLLPRIVATE bool getReversePrint() const;
+ SAL_DLLPRIVATE void pushPropertiesToPrinter();
+ VCL_PLUGIN_PUBLIC void setJobState( com::sun::star::view::PrintableState );
+ SAL_DLLPRIVATE bool setupPrinter( Window* i_pDlgParent );
+
+ SAL_DLLPRIVATE int getPageCountProtected() const;
+ SAL_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getPageParametersProtected( int i_nPage ) const;
+
+ SAL_DLLPRIVATE sal_uLong removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut );
+ SAL_DLLPRIVATE void resetPrinterOptions( bool i_bFileOutput );
+};
+
+class VCL_DLLPUBLIC PrinterOptionsHelper
+{
+ protected:
+ boost::unordered_map< OUString, com::sun::star::uno::Any, OUStringHash > m_aPropertyMap;
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > m_aUIProperties;
+
+ public:
+ PrinterOptionsHelper() {} // create without ui properties
+ PrinterOptionsHelper( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rUIProperties )
+ : m_aUIProperties( i_rUIProperties )
+ {}
+ ~PrinterOptionsHelper()
+ {}
+
+ /* process a new set of properties
+ * merges changed properties and returns "true" if any occurred
+ * if the optional output set is not NULL then the names of the changed properties are returned
+ **/
+ bool processProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp,
+ std::set< OUString >* o_pChangeProp = NULL );
+ /* append to a sequence of property values the ui property sequence passed at creation
+ * as the "ExtraPrintUIOptions" property. if that sequence was empty, no "ExtraPrintUIOptions" property
+ * will be appended.
+ **/
+ void appendPrintUIOptions( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& io_rProps ) const;
+
+ // returns an empty Any for not existing properties
+ com::sun::star::uno::Any getValue( const OUString& i_rPropertyName ) const;
+
+ sal_Bool getBoolValue( const OUString& i_rPropertyName, sal_Bool i_bDefault = sal_False ) const;
+ // convenience for fixed strings
+ sal_Bool getBoolValue( const char* i_pPropName, sal_Bool i_bDefault = sal_False ) const
+ { return getBoolValue( OUString::createFromAscii( i_pPropName ), i_bDefault ); }
+
+ sal_Int64 getIntValue( const OUString& i_rPropertyName, sal_Int64 i_nDefault = 0 ) const;
+ // convenience for fixed strings
+ sal_Int64 getIntValue( const char* i_pPropName, sal_Int64 i_nDefault = 0 ) const
+ { return getIntValue( OUString::createFromAscii( i_pPropName ), i_nDefault ); }
+
+ OUString getStringValue( const OUString& i_rPropertyName, const OUString& i_rDefault = OUString() ) const;
+ // convenience for fixed strings
+ OUString getStringValue( const char* i_pPropName, const OUString& i_rDefault = OUString() ) const
+ { return getStringValue( OUString::createFromAscii( i_pPropName ), i_rDefault ); }
+
+ // helper functions for user to create a single control
+ struct UIControlOptions
+ {
+ OUString maDependsOnName;
+ sal_Int32 mnDependsOnEntry;
+ sal_Bool mbAttachToDependency;
+ OUString maGroupHint;
+ sal_Bool mbInternalOnly;
+ sal_Bool mbEnabled;
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > maAddProps;
+
+ UIControlOptions( const OUString& i_rDependsOnName = OUString(),
+ sal_Int32 i_nDependsOnEntry = -1,
+ sal_Bool i_bAttachToDependency = sal_False,
+ const OUString& i_rGroupHint = OUString(),
+ sal_Bool i_bInternalOnly = sal_False,
+ sal_Bool i_bEnabled = sal_True
+ )
+ : maDependsOnName( i_rDependsOnName )
+ , mnDependsOnEntry( i_nDependsOnEntry )
+ , mbAttachToDependency( i_bAttachToDependency )
+ , maGroupHint( i_rGroupHint )
+ , mbInternalOnly( i_bInternalOnly )
+ , mbEnabled( i_bEnabled ) {}
+ };
+
+ // note: in the following helper functions HelpIds are expected as an OUString
+ // the normal HelpId form is OString (byte string instead of UTF16 string)
+ // this is because the whole interface is base on UNO properties; in fact the structures
+ // are passed over UNO interfaces. UNO does not know a byte string, hence the string is
+ // transported via UTF16 strings.
+
+ // Show general control
+ static com::sun::star::uno::Any setUIControlOpt( const com::sun::star::uno::Sequence< OUString >& i_rIDs,
+ const OUString& i_rTitle,
+ const com::sun::star::uno::Sequence< OUString >& i_rHelpId,
+ const OUString& i_rType,
+ const com::sun::star::beans::PropertyValue* i_pValue = NULL,
+ const UIControlOptions& i_rControlOptions = UIControlOptions()
+ );
+
+ // Show and set the title of a TagPage of id i_rID
+ static com::sun::star::uno::Any setGroupControlOpt(const OUString& i_rID,
+ const OUString& i_rTitle,
+ const OUString& i_rHelpId);
+
+ // Show and set the label of a VclFrame of id i_rID
+ static com::sun::star::uno::Any setSubgroupControlOpt(const OUString& i_rID,
+ const OUString& i_rTitle,
+ const OUString& i_rHelpId,
+ const UIControlOptions& i_rControlOptions = UIControlOptions());
+
+ // Show a bool option as a checkbox
+ static com::sun::star::uno::Any setBoolControlOpt(const OUString& i_rID,
+ const OUString& i_rTitle,
+ const OUString& i_rHelpId,
+ const OUString& i_rProperty,
+ sal_Bool i_bValue,
+ const UIControlOptions& i_rControlOptions = UIControlOptions());
+
+ // Show a set of choices in a list box
+ static com::sun::star::uno::Any setChoiceListControlOpt(const OUString& i_rID,
+ const OUString& i_rTitle,
+ const com::sun::star::uno::Sequence< OUString >& i_rHelpId,
+ const OUString& i_rProperty,
+ const com::sun::star::uno::Sequence< OUString >& i_rChoices,
+ sal_Int32 i_nValue,
+ const com::sun::star::uno::Sequence< sal_Bool >& i_rDisabledChoices = com::sun::star::uno::Sequence< sal_Bool >(),
+ const UIControlOptions& i_rControlOptions = UIControlOptions());
+
+ // show a set of choices as radio buttons
+ static com::sun::star::uno::Any setChoiceRadiosControlOpt(const com::sun::star::uno::Sequence< OUString >& i_rIDs,
+ const OUString& i_rTitle,
+ const com::sun::star::uno::Sequence< OUString >& i_rHelpId,
+ const OUString& i_rProperty,
+ const com::sun::star::uno::Sequence< OUString >& i_rChoices,
+ sal_Int32 i_nValue,
+ const com::sun::star::uno::Sequence< sal_Bool >& i_rDisabledChoices = com::sun::star::uno::Sequence< sal_Bool >(),
+ const UIControlOptions& i_rControlOptions = UIControlOptions());
+
+
+ // show an integer range (e.g. a spin field)
+ // note: max value < min value means do not apply min/max values
+ static com::sun::star::uno::Any setRangeControlOpt(const OUString& i_rID,
+ const OUString& i_rTitle,
+ const OUString& i_rHelpId,
+ const OUString& i_rProperty,
+ sal_Int32 i_nValue,
+ sal_Int32 i_nMinValue = -1,
+ sal_Int32 i_nMaxValue = -2,
+ const UIControlOptions& i_rControlOptions = UIControlOptions());
+
+ // show a string field
+ // note: max value < min value means do not apply min/max values
+ static com::sun::star::uno::Any setEditControlOpt(const OUString& i_rID,
+ const OUString& i_rTitle,
+ const OUString& i_rHelpId,
+ const OUString& i_rProperty,
+ const OUString& i_rValue,
+ const UIControlOptions& i_rControlOptions = UIControlOptions());
+};
+
+}
+
+
+#endif // _SV_PRINT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/printerinfomanager.hxx b/include/vcl/printerinfomanager.hxx
new file mode 100644
index 000000000000..108b31504de1
--- /dev/null
+++ b/include/vcl/printerinfomanager.hxx
@@ -0,0 +1,239 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _PSPRINT_PRINTERINFOMANAGER_HXX_
+#define _PSPRINT_PRINTERINFOMANAGER_HXX_
+
+#include <boost/unordered_map.hpp>
+#include <list>
+
+#include "vcl/dllapi.h"
+#include "vcl/helper.hxx"
+#include "vcl/jobdata.hxx"
+#include "osl/file.hxx"
+
+#include <cstdio>
+
+namespace psp
+{
+
+class SystemQueueInfo;
+
+struct PrinterInfo : JobData
+{
+ // basename of PPD
+ OUString m_aDriverName;
+ // can be the queue
+ OUString m_aLocation;
+ // a user defined comment
+ OUString m_aComment;
+ // a command line to pipe a PS-file to
+ OUString m_aCommand;
+ // a command line to pipe a PS-file to in case of direct print
+ OUString m_aQuickCommand;
+ // a list of special features separated by ',' not used by psprint
+ // but assigned from the outside (currently for "fax","pdf=","autoqueue","external_dialog")
+ OUString m_aFeatures;
+ // a mapping of fonts to other fonts.
+ // this provides a method for the user
+ // to replace arbitrary fonts by printer builtin fonts
+ // currently this is only a mapping between font names
+ // assuming that only adbobe standard encoding fonts are
+ // built into the printer. in future it may be necessary
+ // to map to a font name and UCS2 vector which should be mapped
+ // this vector is currently implicitly given by the adobe
+ // standard encoding
+ bool m_bPerformFontSubstitution;
+ boost::unordered_map< OUString, OUString, OUStringHash >
+ m_aFontSubstitutes;
+ boost::unordered_map< fontID, fontID >
+ m_aFontSubstitutions;
+
+ PrinterInfo() :
+ JobData(),
+ m_bPerformFontSubstitution( false )
+ {}
+};
+
+class VCL_DLLPUBLIC PrinterInfoManager
+{
+public:
+ enum Type { Default = 0, CUPS = 1 };
+
+ struct SystemPrintQueue
+ {
+ OUString m_aQueue;
+ OUString m_aLocation;
+ OUString m_aComment;
+ };
+protected:
+ // needed for checkPrintersChanged: files (not necessarily existant)
+ // and their last known modification time
+ struct WatchFile
+ {
+ // the file in question
+ OUString m_aFilePath;
+ // the last know modification time or 0, if file did not exist
+ TimeValue m_aModified;
+ };
+
+ // internal data to describe a printer
+ struct Printer
+ {
+ // configuration file containing this printer
+ // empty means a freshly added printer that has to be saved yet
+ OUString m_aFile;
+ // details other config files that have this printer
+ // in case of removal all have to be removed
+ std::list< OUString > m_aAlternateFiles;
+ // group in m_aFile containing the printer
+ // this must be unique over all configuration files
+ // it usually should be the printer name
+ OString m_aGroup;
+ // whether changes need to be saved
+ bool m_bModified;
+ // the corresponding info and job data
+ PrinterInfo m_aInfo;
+ };
+
+ boost::unordered_map< OUString, Printer, OUStringHash > m_aPrinters;
+ PrinterInfo m_aGlobalDefaults;
+ std::list< WatchFile > m_aWatchFiles;
+ OUString m_aDefaultPrinter;
+ OUString m_aSystemPrintCommand;
+
+ std::list< SystemPrintQueue > m_aSystemPrintQueues;
+
+ SystemQueueInfo* m_pQueueInfo;
+
+ Type m_eType;
+ bool m_bUseIncludeFeature;
+ bool m_bUseJobPatch;
+ OUString m_aSystemDefaultPaper;
+
+ bool m_bDisableCUPS;
+
+ PrinterInfoManager( Type eType = Default );
+
+ virtual void initialize();
+
+ // fill in font substitutions
+ // the resulting boost::unordered_map maps from source to target font ids
+ void fillFontSubstitutions( PrinterInfo& rInfo ) const;
+
+ // fill default paper if not configured in config file
+ // default paper is e.g. locale dependent
+ // if a paper is already set it will not be overwritten
+ void setDefaultPaper( PPDContext& rInfo ) const;
+
+ void initSystemDefaultPaper();
+public:
+
+ // there can only be one
+ static PrinterInfoManager& get();
+ // only called by SalData destructor, frees the global instance
+ static void release();
+
+ // get PrinterInfoManager type
+ Type getType() const { return m_eType; }
+
+ // lists the names of all known printers
+ void listPrinters( std::list< OUString >& rList ) const;
+
+ // gets the number of known printers
+ int countPrinters() const { return m_aPrinters.size(); }
+
+ // gets info about a named printer
+ const PrinterInfo& getPrinterInfo( const OUString& rPrinter ) const;
+
+ // gets the name of the default printer
+ const OUString& getDefaultPrinter() const { return m_aDefaultPrinter; }
+
+ virtual void setupJobContextData( JobData& rData );
+
+ // changes the info about a named printer
+ virtual void changePrinterInfo( const OUString& rPrinter, const PrinterInfo& rNewInfo );
+
+ // check if the printer configuration has changed
+ // if bwait is true, then this method waits for eventual asynchronous
+ // printer discovery to finish
+ virtual bool checkPrintersChanged( bool bWait );
+
+ // members for administration (->padmin)
+
+ // add a named printer
+ // addPrinter fails if a printer with the same name already exists
+ // or the driver does not exist
+ virtual bool addPrinter( const OUString& rPrinterName, const OUString& rDriverName );
+
+ // remove a named printer
+ // this fails if the config file belonging to this printer
+ // is not writeable
+ // if bCheckOnly is true, the printer is not really removed;
+ // this is for checking if the removal would fail
+ virtual bool removePrinter( const OUString& rPrinterName, bool bCheckOnly = false );
+
+ // save the changes to all printers. this fails if there
+ // is no writable config file at all
+ virtual bool writePrinterConfig();
+
+ // set a new default printer
+ // fails if the specified printer does not exist
+ virtual bool setDefaultPrinter( const OUString& rPrinterName );
+
+ // primarily used internally but also by padmin
+ // returns the printer queue names
+ virtual const std::list< SystemPrintQueue >& getSystemPrintQueues();
+
+ // similar but returnse whole commandlines
+ virtual void getSystemPrintCommands( std::list< OUString >& rCommands );
+
+ // abstract print command
+ // returns a stdio FILE* that a postscript file may be written to
+ // this may either be a regular file or the result of popen()
+ virtual FILE* startSpool( const OUString& rPrinterName, bool bQuickCommand );
+ // close the FILE* returned by startSpool and does the actual spooling
+ // set bBanner to "false" will attempt to suppress banner printing
+ // set bBanner to "true" will rely on the system default
+ // returns a numerical job id
+ virtual int endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
+
+ // for spadmin: whether adding or removing a printer is possible
+ virtual bool addOrRemovePossible() const;
+
+ bool getUseIncludeFeature() const { return m_bUseIncludeFeature; }
+ bool getUseJobPatch() const { return m_bUseJobPatch; }
+
+ // check whether a printer's feature string contains a subfeature
+ bool checkFeatureToken( const OUString& rPrinterName, const char* pToken ) const;
+
+ // set m_bDisableCUPS and update printer config
+ void setCUPSDisabled( bool );
+
+ // gets m_bDisableCUPS, initialized from printer config
+ bool isCUPSDisabled() const;
+
+ virtual ~PrinterInfoManager();
+};
+
+} // namespace
+
+#endif // _PSPRINT_PRINTERINFOMANAGER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/prntypes.hxx b/include/vcl/prntypes.hxx
new file mode 100644
index 000000000000..4fdaaf794f08
--- /dev/null
+++ b/include/vcl/prntypes.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 _SV_PRNTYPES_HXX
+#define _SV_PRNTYPES_HXX
+
+#include <tools/solar.h>
+#include <i18nutil/paper.hxx>
+
+// ---------------
+// - Duplex Mode -
+// ---------------
+
+enum DuplexMode { DUPLEX_UNKNOWN, DUPLEX_OFF, DUPLEX_LONGEDGE, DUPLEX_SHORTEDGE };
+
+// ---------------
+// - Orientation -
+// ---------------
+
+enum Orientation { ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE };
+
+// -------------------
+// - QueueInfo-Types -
+// -------------------
+
+#define QUEUE_STATUS_READY ((sal_uLong)0x00000001)
+#define QUEUE_STATUS_PAUSED ((sal_uLong)0x00000002)
+#define QUEUE_STATUS_PENDING_DELETION ((sal_uLong)0x00000004)
+#define QUEUE_STATUS_BUSY ((sal_uLong)0x00000008)
+#define QUEUE_STATUS_INITIALIZING ((sal_uLong)0x00000010)
+#define QUEUE_STATUS_WAITING ((sal_uLong)0x00000020)
+#define QUEUE_STATUS_WARMING_UP ((sal_uLong)0x00000040)
+#define QUEUE_STATUS_PROCESSING ((sal_uLong)0x00000080)
+#define QUEUE_STATUS_PRINTING ((sal_uLong)0x00000100)
+#define QUEUE_STATUS_OFFLINE ((sal_uLong)0x00000200)
+#define QUEUE_STATUS_ERROR ((sal_uLong)0x00000400)
+#define QUEUE_STATUS_SERVER_UNKNOWN ((sal_uLong)0x00000800)
+#define QUEUE_STATUS_PAPER_JAM ((sal_uLong)0x00001000)
+#define QUEUE_STATUS_PAPER_OUT ((sal_uLong)0x00002000)
+#define QUEUE_STATUS_MANUAL_FEED ((sal_uLong)0x00004000)
+#define QUEUE_STATUS_PAPER_PROBLEM ((sal_uLong)0x00008000)
+#define QUEUE_STATUS_IO_ACTIVE ((sal_uLong)0x00010000)
+#define QUEUE_STATUS_OUTPUT_BIN_FULL ((sal_uLong)0x00020000)
+#define QUEUE_STATUS_TONER_LOW ((sal_uLong)0x00040000)
+#define QUEUE_STATUS_NO_TONER ((sal_uLong)0x00080000)
+#define QUEUE_STATUS_PAGE_PUNT ((sal_uLong)0x00100000)
+#define QUEUE_STATUS_USER_INTERVENTION ((sal_uLong)0x00200000)
+#define QUEUE_STATUS_OUT_OF_MEMORY ((sal_uLong)0x00400000)
+#define QUEUE_STATUS_DOOR_OPEN ((sal_uLong)0x00800000)
+#define QUEUE_STATUS_POWER_SAVE ((sal_uLong)0x01000000)
+
+#define QUEUE_JOBS_DONTKNOW ((sal_uLong)0xFFFFFFFF)
+
+// -----------------
+// - Printer-Types -
+// -----------------
+
+#define PRINTER_CAPABILITIES_SUPPORTDIALOG ((sal_uInt16)1)
+#define PRINTER_CAPABILITIES_COPIES ((sal_uInt16)2)
+#define PRINTER_CAPABILITIES_COLLATECOPIES ((sal_uInt16)3)
+#define PRINTER_CAPABILITIES_SETORIENTATION ((sal_uInt16)4)
+#define PRINTER_CAPABILITIES_SETPAPERBIN ((sal_uInt16)5)
+#define PRINTER_CAPABILITIES_SETPAPERSIZE ((sal_uInt16)6)
+#define PRINTER_CAPABILITIES_SETPAPER ((sal_uInt16)7)
+#define PRINTER_CAPABILITIES_FAX ((sal_uInt16)8)
+#define PRINTER_CAPABILITIES_PDF ((sal_uInt16)9)
+#define PRINTER_CAPABILITIES_EXTERNALDIALOG ((sal_uInt16)10)
+#define PRINTER_CAPABILITIES_SETDUPLEX ((sal_uInt16)11)
+#define PRINTER_CAPABILITIES_USEPULLMODEL ((sal_uInt16)12)
+
+#endif // _SV_PRNTYPES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/ptrstyle.hxx b/include/vcl/ptrstyle.hxx
new file mode 100644
index 000000000000..c3f567e26036
--- /dev/null
+++ b/include/vcl/ptrstyle.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 _VCL_PTRSTYLE_HXX
+#define _VCL_PTRSTYLE_HXX
+
+#include <tools/solar.h>
+
+// -----------------
+// - Pointer-Types -
+// -----------------
+
+typedef sal_uInt16 PointerStyle;
+
+#define POINTER_ARROW ((PointerStyle)0)
+#define POINTER_NULL ((PointerStyle)1)
+#define POINTER_WAIT ((PointerStyle)2)
+#define POINTER_TEXT ((PointerStyle)3)
+#define POINTER_HELP ((PointerStyle)4)
+#define POINTER_CROSS ((PointerStyle)5)
+#define POINTER_MOVE ((PointerStyle)6)
+#define POINTER_NSIZE ((PointerStyle)7)
+#define POINTER_SSIZE ((PointerStyle)8)
+#define POINTER_WSIZE ((PointerStyle)9)
+#define POINTER_ESIZE ((PointerStyle)10)
+#define POINTER_NWSIZE ((PointerStyle)11)
+#define POINTER_NESIZE ((PointerStyle)12)
+#define POINTER_SWSIZE ((PointerStyle)13)
+#define POINTER_SESIZE ((PointerStyle)14)
+#define POINTER_WINDOW_NSIZE ((PointerStyle)15)
+#define POINTER_WINDOW_SSIZE ((PointerStyle)16)
+#define POINTER_WINDOW_WSIZE ((PointerStyle)17)
+#define POINTER_WINDOW_ESIZE ((PointerStyle)18)
+#define POINTER_WINDOW_NWSIZE ((PointerStyle)19)
+#define POINTER_WINDOW_NESIZE ((PointerStyle)20)
+#define POINTER_WINDOW_SWSIZE ((PointerStyle)21)
+#define POINTER_WINDOW_SESIZE ((PointerStyle)22)
+#define POINTER_HSPLIT ((PointerStyle)23)
+#define POINTER_VSPLIT ((PointerStyle)24)
+#define POINTER_HSIZEBAR ((PointerStyle)25)
+#define POINTER_VSIZEBAR ((PointerStyle)26)
+#define POINTER_HAND ((PointerStyle)27)
+#define POINTER_REFHAND ((PointerStyle)28)
+#define POINTER_PEN ((PointerStyle)29)
+#define POINTER_MAGNIFY ((PointerStyle)30)
+#define POINTER_FILL ((PointerStyle)31)
+#define POINTER_ROTATE ((PointerStyle)32)
+#define POINTER_HSHEAR ((PointerStyle)33)
+#define POINTER_VSHEAR ((PointerStyle)34)
+#define POINTER_MIRROR ((PointerStyle)35)
+#define POINTER_CROOK ((PointerStyle)36)
+#define POINTER_CROP ((PointerStyle)37)
+#define POINTER_MOVEPOINT ((PointerStyle)38)
+#define POINTER_MOVEBEZIERWEIGHT ((PointerStyle)39)
+#define POINTER_MOVEDATA ((PointerStyle)40)
+#define POINTER_COPYDATA ((PointerStyle)41)
+#define POINTER_LINKDATA ((PointerStyle)42)
+#define POINTER_MOVEDATALINK ((PointerStyle)43)
+#define POINTER_COPYDATALINK ((PointerStyle)44)
+#define POINTER_MOVEFILE ((PointerStyle)45)
+#define POINTER_COPYFILE ((PointerStyle)46)
+#define POINTER_LINKFILE ((PointerStyle)47)
+#define POINTER_MOVEFILELINK ((PointerStyle)48)
+#define POINTER_COPYFILELINK ((PointerStyle)49)
+#define POINTER_MOVEFILES ((PointerStyle)50)
+#define POINTER_COPYFILES ((PointerStyle)51)
+#define POINTER_NOTALLOWED ((PointerStyle)52)
+#define POINTER_DRAW_LINE ((PointerStyle)53)
+#define POINTER_DRAW_RECT ((PointerStyle)54)
+#define POINTER_DRAW_POLYGON ((PointerStyle)55)
+#define POINTER_DRAW_BEZIER ((PointerStyle)56)
+#define POINTER_DRAW_ARC ((PointerStyle)57)
+#define POINTER_DRAW_PIE ((PointerStyle)58)
+#define POINTER_DRAW_CIRCLECUT ((PointerStyle)59)
+#define POINTER_DRAW_ELLIPSE ((PointerStyle)60)
+#define POINTER_DRAW_FREEHAND ((PointerStyle)61)
+#define POINTER_DRAW_CONNECT ((PointerStyle)62)
+#define POINTER_DRAW_TEXT ((PointerStyle)63)
+#define POINTER_DRAW_CAPTION ((PointerStyle)64)
+#define POINTER_CHART ((PointerStyle)65)
+#define POINTER_DETECTIVE ((PointerStyle)66)
+#define POINTER_PIVOT_COL ((PointerStyle)67)
+#define POINTER_PIVOT_ROW ((PointerStyle)68)
+#define POINTER_PIVOT_FIELD ((PointerStyle)69)
+#define POINTER_CHAIN ((PointerStyle)70)
+#define POINTER_CHAIN_NOTALLOWED ((PointerStyle)71)
+#define POINTER_TIMEEVENT_MOVE ((PointerStyle)72)
+#define POINTER_TIMEEVENT_SIZE ((PointerStyle)73)
+#define POINTER_AUTOSCROLL_N ((PointerStyle)74)
+#define POINTER_AUTOSCROLL_S ((PointerStyle)75)
+#define POINTER_AUTOSCROLL_W ((PointerStyle)76)
+#define POINTER_AUTOSCROLL_E ((PointerStyle)77)
+#define POINTER_AUTOSCROLL_NW ((PointerStyle)78)
+#define POINTER_AUTOSCROLL_NE ((PointerStyle)79)
+#define POINTER_AUTOSCROLL_SW ((PointerStyle)80)
+#define POINTER_AUTOSCROLL_SE ((PointerStyle)81)
+#define POINTER_AUTOSCROLL_NS ((PointerStyle)82)
+#define POINTER_AUTOSCROLL_WE ((PointerStyle)83)
+#define POINTER_AUTOSCROLL_NSWE ((PointerStyle)84)
+#define POINTER_AIRBRUSH ((PointerStyle)85)
+#define POINTER_TEXT_VERTICAL ((PointerStyle)86)
+#define POINTER_PIVOT_DELETE ((PointerStyle)87)
+
+// #i32329#
+#define POINTER_TAB_SELECT_S ((PointerStyle)88)
+#define POINTER_TAB_SELECT_E ((PointerStyle)89)
+#define POINTER_TAB_SELECT_SE ((PointerStyle)90)
+#define POINTER_TAB_SELECT_W ((PointerStyle)91)
+#define POINTER_TAB_SELECT_SW ((PointerStyle)92)
+
+// #i20119#
+#define POINTER_PAINTBRUSH ((PointerStyle)93)
+
+#define POINTER_COUNT 94
+
+#endif // _VCL_PTRSTYLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/quickselectionengine.hxx b/include/vcl/quickselectionengine.hxx
new file mode 100644
index 000000000000..631f0c40aa95
--- /dev/null
+++ b/include/vcl/quickselectionengine.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 VCL_QUICKSELECTIONENGINE_HXX
+#define VCL_QUICKSELECTIONENGINE_HXX
+
+#include "dllapi.h"
+
+#include <tools/string.hxx>
+
+#include <memory>
+
+class KeyEvent;
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ typedef const void* StringEntryIdentifier;
+
+ //====================================================================
+ //= ISearchableStringList
+ //====================================================================
+ // TODO: consolidate this with ::vcl::IMnemonicEntryList
+ class SAL_NO_VTABLE VCL_DLLPUBLIC ISearchableStringList
+ {
+ public:
+ /** returns the current entry in the list of searchable strings.
+
+ Search operations will start with this entry.
+ */
+ virtual StringEntryIdentifier CurrentEntry( String& _out_entryText ) const = 0;
+
+ /** returns the next entry in the list.
+
+ The implementation is expected to wrap around. That is, if the given entry denotes the last
+ entry in the list, then NextEntry should return the first entry.
+ */
+ virtual StringEntryIdentifier NextEntry( StringEntryIdentifier _currentEntry, String& _out_entryText ) const = 0;
+
+ /** selects a given entry
+ */
+ virtual void SelectEntry( StringEntryIdentifier _entry ) = 0;
+
+ protected:
+ ~ISearchableStringList() {}
+ };
+
+ //====================================================================
+ //= QuickSelectionEngine
+ //====================================================================
+ struct QuickSelectionEngine_Data;
+ class VCL_DLLPUBLIC QuickSelectionEngine
+ {
+ public:
+ QuickSelectionEngine( ISearchableStringList& _entryList );
+ ~QuickSelectionEngine();
+
+ bool HandleKeyEvent( const KeyEvent& _rKEvt );
+ void Reset();
+
+ private:
+ ::std::auto_ptr< QuickSelectionEngine_Data > m_pData;
+
+ private:
+ QuickSelectionEngine(); // never implemented
+ QuickSelectionEngine( const QuickSelectionEngine& ); // never implemented
+ QuickSelectionEngine& operator=( const QuickSelectionEngine& ); // never implemented
+ };
+
+//........................................................................
+} // namespace vcl
+//........................................................................
+
+#endif // VCL_QUICKSELECTIONENGINE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/regband.hxx b/include/vcl/regband.hxx
new file mode 100644
index 000000000000..0b60a801d83e
--- /dev/null
+++ b/include/vcl/regband.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 _SV_REGBAND_HXX
+#define _SV_REGBAND_HXX
+
+#include <tools/solar.h>
+#include <tools/poly.hxx>
+
+/* =======================================================================
+
+class ImplRegionBand
+
+This class handles one y-band of the region. In this band may contain one
+or more seprarations in x-direction. The y-Band do not contain any
+separation after creation.
+
+The separations are modified with basic clipping functions like Union and
+Intersection - the Class will process the clipping for the actual band.
+
+The actual separations may be checked by functions like IsInside or
+IsOver.
+
+======================================================================= */
+
+// ------------------------
+// - ImplRegionBand-Types -
+// ------------------------
+
+// element for the list with x-separations
+struct ImplRegionBandSep
+{
+ ImplRegionBandSep* mpNextSep;
+ long mnXLeft;
+ long mnXRight;
+ sal_Bool mbRemoved;
+};
+
+enum LineType { LINE_ASCENDING, LINE_DESCENDING, LINE_HORIZONTAL };
+
+// element for the list with x-separations
+struct ImplRegionBandPoint
+{
+ ImplRegionBandPoint* mpNextBandPoint;
+ long mnX;
+ long mnLineId;
+ sal_Bool mbEndPoint;
+ LineType meLineType;
+};
+
+// ------------------
+// - ImplRegionBand -
+// ------------------
+
+class ImplRegionBand
+{
+public:
+ ImplRegionBand* mpNextBand; // pointer to the next element of the list
+ ImplRegionBand* mpPrevBand; // pointer to the previous element of the list (only used temporaery)
+ ImplRegionBandSep* mpFirstSep; // root of the list with x-separations
+ ImplRegionBandPoint* mpFirstBandPoint; // root of the list with lines
+ long mnYTop; // actual boundary of the band
+ long mnYBottom;
+ sal_Bool mbTouched;
+
+ // create y-band with boundaries
+ ImplRegionBand( long nYTop, long nYBottom );
+ /** copy y-band with with all data
+ @param theSourceBand
+ The new ImplRegionBand object will
+ be a copy of this band.
+ @param bIgnorePoints
+ When <TRUE/> (the default) the
+ band points pointed to by
+ mpFirstBandPoint are not copied.
+ When <FALSE/> they are copied.
+ You need the points when you are
+ planning to call ProcessPoints()
+ later on.
+ */
+ ImplRegionBand( const ImplRegionBand & theSourceBand,
+ const bool bIgnorePoints = true);
+ ~ImplRegionBand();
+
+ long GetXLeftBoundary() const;
+ long GetXRightBoundary() const;
+
+ // combine overlapping bands
+ sal_Bool OptimizeBand();
+
+ // generate separations from lines and process
+ // union with existing separations
+ void ProcessPoints();
+ // insert point in the list for later processing
+ sal_Bool InsertPoint( long nX, long nLineID,
+ sal_Bool bEndPoint, LineType eLineType );
+
+ void Union( long nXLeft, long nXRight );
+ void Intersect( long nXLeft, long nXRight );
+ void Exclude( long nXLeft, long nXRight );
+ void XOr( long nXLeft, long nXRight );
+
+ void MoveX( long nHorzMove );
+ void ScaleX( double fHorzScale );
+
+ sal_Bool IsInside( long nX );
+
+ sal_Bool IsEmpty() const { return ((!mpFirstSep) && (!mpFirstBandPoint)); }
+
+ sal_Bool operator==( const ImplRegionBand& rRegionBand ) const;
+
+ /** Split the called band at the given vertical coordinate. After the
+ split the called band will cover the upper part not including nY.
+ The new band will cover the lower part including nY.
+ @param nY
+ The band is split at this y coordinate. The new, lower band
+ will include this very value.
+ @return
+ Returns the new, lower band.
+ */
+ ImplRegionBand* SplitBand (const sal_Int32 nY);
+};
+
+#endif // _SV_REGBAND_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/region.hxx b/include/vcl/region.hxx
new file mode 100644
index 000000000000..02eebc7ec50e
--- /dev/null
+++ b/include/vcl/region.hxx
@@ -0,0 +1,155 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_REGION_HXX
+#define _SV_REGION_HXX
+
+#include <tools/gen.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+class ImplRegion;
+class ImplRegionBand;
+class Polygon;
+class PolyPolygon;
+struct ImplRegionInfo;
+
+// --------------
+// - RegionType -
+// --------------
+
+enum RegionType { REGION_NULL, REGION_EMPTY, REGION_RECTANGLE, REGION_COMPLEX };
+enum RegionOverlapType { REGION_INSIDE, REGION_OVER, REGION_OUTSIDE };
+
+typedef long RegionHandle;
+
+// ----------
+// - Region -
+// ----------
+
+class VCL_DLLPUBLIC Region
+{
+ friend class OutputDevice;
+ friend class Window;
+ friend class Bitmap;
+
+private:
+ ImplRegion* mpImplRegion;
+
+ SAL_DLLPRIVATE void ImplCopyData();
+ SAL_DLLPRIVATE void ImplCreateRectRegion( const Rectangle& rRect );
+ SAL_DLLPRIVATE void ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly );
+ SAL_DLLPRIVATE void ImplCreatePolyPolyRegion( const basegfx::B2DPolyPolygon& rPolyPoly );
+ SAL_DLLPRIVATE void ImplPolyPolyRegionToBandRegionFunc();
+ SAL_DLLPRIVATE inline void ImplPolyPolyRegionToBandRegion();
+ SAL_DLLPRIVATE const ImplRegion* ImplGetImplRegion() const { return mpImplRegion; }
+ SAL_DLLPRIVATE ImplRegion* ImplGetImplRegion() { return mpImplRegion; }
+ SAL_DLLPRIVATE void ImplBeginAddRect( );
+ SAL_DLLPRIVATE sal_Bool ImplAddRect( const Rectangle& rRect );
+ SAL_DLLPRIVATE void ImplEndAddRect( );
+ SAL_DLLPRIVATE void ImplIntersectWithPolyPolygon( const Region& );
+ SAL_DLLPRIVATE void ImplExcludePolyPolygon( const Region& );
+ SAL_DLLPRIVATE void ImplUnionPolyPolygon( const Region& );
+ SAL_DLLPRIVATE void ImplXOrPolyPolygon( const Region& );
+
+public: // public within vcl
+ VCL_PLUGIN_PUBLIC bool ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
+ long& nX, long& nY, long& nWidth, long& nHeight ) const;
+ VCL_PLUGIN_PUBLIC bool ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
+ long& nX, long& nY, long& nWidth, long& nHeight ) const;
+#ifdef DBG_UTIL
+ friend const char* ImplDbgTestRegion( const void* pObj );
+#endif
+
+public:
+ explicit Region();
+ explicit Region( RegionType eType );
+ explicit Region( const Rectangle& rRect );
+ explicit Region( const Polygon& rPolygon );
+ explicit Region( const PolyPolygon& rPolyPoly );
+ explicit Region( const basegfx::B2DPolyPolygon& );
+ Region( const Region& rRegion );
+ ~Region();
+
+ void Move( long nHorzMove, long nVertMove );
+ void Scale( double fScaleX, double fScaleY );
+ void Union( const Rectangle& rRegion );
+ void Intersect( const Rectangle& rRegion );
+ void Exclude( const Rectangle& rRegion );
+ void XOr( const Rectangle& rRegion );
+ void Union( const Region& rRegion );
+ void Intersect( const Region& rRegion );
+ void Exclude( const Region& rRegion );
+ void XOr( const Region& rRegion );
+
+ RegionType GetType() const;
+ sal_Bool IsEmpty() const { return GetType() == REGION_EMPTY; };
+ sal_Bool IsNull() const { return GetType() == REGION_NULL; };
+
+ void SetEmpty();
+ void SetNull();
+
+ Rectangle GetBoundRect() const;
+
+ sal_Bool HasPolyPolygon() const;
+ PolyPolygon GetPolyPolygon() const;
+ // returns an empty polypolygon in case HasPolyPolygon is sal_False
+ const basegfx::B2DPolyPolygon GetB2DPolyPolygon() const;
+ // returns a PolyPolygon either copied from the set PolyPolygon region
+ // or created from the constituent rectangles
+ basegfx::B2DPolyPolygon ConvertToB2DPolyPolygon();
+
+ sal_uLong GetRectCount() const;
+ RegionHandle BeginEnumRects();
+ sal_Bool GetEnumRects( RegionHandle hRegionHandle, Rectangle& rRect );
+ sal_Bool GetNextEnumRect( RegionHandle hRegionHandle, Rectangle& rRect )
+ { return GetEnumRects( hRegionHandle, rRect ); }
+ void EndEnumRects( RegionHandle hRegionHandle );
+
+ sal_Bool IsInside( const Point& rPoint ) const;
+ sal_Bool IsInside( const Rectangle& rRect ) const;
+ sal_Bool IsOver( const Rectangle& rRect ) const;
+
+ Region& operator=( const Region& rRegion );
+ Region& operator=( const Rectangle& rRect );
+
+ sal_Bool operator==( const Region& rRegion ) const;
+ sal_Bool operator!=( const Region& rRegion ) const
+ { return !(Region::operator==( rRegion )); }
+
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Region& rRegion );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Region& rRegion );
+
+ /* workaround: faster conversion for PolyPolygons
+ * if half of the Polygons contained in rPolyPoly are actually
+ * rectangles, then the returned Region will be constructed by
+ * XOr'ing the contained Polygons together; in the case of
+ * only Rectangles this can be up to eight times faster than
+ * Region( const PolyPolygon& ).
+ * Caution: this is only useful if the Region is known to be
+ * changed to rectangles; e.g. if being set as clip region
+ */
+ static Region GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly );
+};
+
+#endif // _SV_REGION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
new file mode 100644
index 000000000000..85a00a197f96
--- /dev/null
+++ b/include/vcl/salbtype.hxx
@@ -0,0 +1,887 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_SALBTYPE_HXX
+#define _SV_SALBTYPE_HXX
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <osl/endian.h>
+#include <tools/debug.hxx>
+#include <vcl/salgtype.hxx>
+#include <tools/color.hxx>
+#include <tools/helpers.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+
+// ----------
+// - Memory -
+// ----------
+
+typedef sal_uInt8* HPBYTE;
+typedef HPBYTE Scanline;
+typedef const sal_uInt8* ConstHPBYTE;
+typedef ConstHPBYTE ConstScanline;
+
+// ------------------
+// - Bitmap formats -
+// ------------------
+
+#define BMP_FORMAT_BOTTOM_UP 0x00000000UL
+#define BMP_FORMAT_TOP_DOWN 0x80000000UL
+
+#define BMP_FORMAT_1BIT_MSB_PAL 0x00000001UL
+#define BMP_FORMAT_1BIT_LSB_PAL 0x00000002UL
+
+#define BMP_FORMAT_4BIT_MSN_PAL 0x00000004UL
+#define BMP_FORMAT_4BIT_LSN_PAL 0x00000008UL
+
+#define BMP_FORMAT_8BIT_PAL 0x00000010UL
+#define BMP_FORMAT_8BIT_TC_MASK 0x00000020UL
+
+// #define BMP_FORMAT_16BIT_TC_MASK 0x00000040UL
+
+#define BMP_FORMAT_24BIT_TC_BGR 0x00000080UL
+#define BMP_FORMAT_24BIT_TC_RGB 0x00000100UL
+#define BMP_FORMAT_24BIT_TC_MASK 0x00000200UL
+
+#define BMP_FORMAT_32BIT_TC_ABGR 0x00000400UL
+#define BMP_FORMAT_32BIT_TC_ARGB 0x00000800UL
+#define BMP_FORMAT_32BIT_TC_BGRA 0x00001000UL
+#define BMP_FORMAT_32BIT_TC_RGBA 0x00002000UL
+#define BMP_FORMAT_32BIT_TC_MASK 0x00004000UL
+
+#define BMP_FORMAT_16BIT_TC_MSB_MASK 0x00008000UL
+#define BMP_FORMAT_16BIT_TC_LSB_MASK 0x00010000UL
+
+#define BMP_SCANLINE_ADJUSTMENT( Mac_nBmpFormat ) ( (Mac_nBmpFormat) & 0x80000000UL )
+#define BMP_SCANLINE_FORMAT( Mac_nBmpFormat ) ( (Mac_nBmpFormat) & 0x7FFFFFFFUL )
+
+// ------------------------------------------------------------------
+
+#define MASK_TO_COLOR( d_nVal, d_RM, d_GM, d_BM, d_RS, d_GS, d_BS, d_Col ) \
+sal_uLong _def_cR = (sal_uInt8) ( d_RS < 0L ? ( (d_nVal) & d_RM ) << -d_RS : ( (d_nVal) & d_RM ) >> d_RS ); \
+sal_uLong _def_cG = (sal_uInt8) ( d_GS < 0L ? ( (d_nVal) & d_GM ) << -d_GS : ( (d_nVal) & d_GM ) >> d_GS ); \
+sal_uLong _def_cB = (sal_uInt8) ( d_BS < 0L ? ( (d_nVal) & d_BM ) << -d_BS : ( (d_nVal) & d_BM ) >> d_BS ); \
+d_Col = BitmapColor( (sal_uInt8) ( _def_cR | ( ( _def_cR & mnROr ) >> mnROrShift ) ), \
+ (sal_uInt8) ( _def_cG | ( ( _def_cG & mnGOr ) >> mnGOrShift ) ), \
+ (sal_uInt8) ( _def_cB | ( ( _def_cB & mnBOr ) >> mnBOrShift ) ) );
+
+// ------------------------------------------------------------------
+
+#define COLOR_TO_MASK( d_rCol, d_RM, d_GM, d_BM, d_RS, d_GS, d_BS ) \
+( ( ( ( d_RS < 0L ) ? ( (sal_uInt32) (d_rCol).GetRed() >> -d_RS ) : \
+ ( (sal_uInt32) (d_rCol).GetRed() << d_RS ) ) & d_RM ) | \
+ ( ( ( d_GS < 0L ) ? ( (sal_uInt32) (d_rCol).GetGreen() >> -d_GS ) : \
+ ( (sal_uInt32) (d_rCol).GetGreen() << d_GS ) ) & d_GM ) | \
+ ( ( ( d_BS < 0L ) ? ( (sal_uInt32) (d_rCol).GetBlue() >> -d_BS ) : \
+ ( (sal_uInt32) (d_rCol).GetBlue() << d_BS ) ) & d_BM ) )
+
+// ---------------
+// - BitmapColor -
+// ---------------
+
+class Color;
+
+class VCL_DLLPUBLIC BitmapColor
+{
+private:
+
+// ATTENTION:
+// Because the members of this class are accessed via memcpy,
+// you MUST NOT CHANGE the order of the members or the size of this class!
+ sal_uInt8 mcBlueOrIndex;
+ sal_uInt8 mcGreen;
+ sal_uInt8 mcRed;
+ sal_uInt8 mbIndex;
+
+public:
+
+ inline BitmapColor();
+ inline BitmapColor( const BitmapColor& rBitmapColor );
+ inline BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue );
+ inline BitmapColor( const Color& rColor );
+ inline BitmapColor( sal_uInt8 cIndex );
+ inline ~BitmapColor() {};
+
+ inline sal_Bool operator==( const BitmapColor& rBitmapColor ) const;
+ inline sal_Bool operator!=( const BitmapColor& rBitmapColor ) const;
+ inline BitmapColor& operator=( const BitmapColor& rBitmapColor );
+
+ inline sal_Bool IsIndex() const;
+
+ inline sal_uInt8 GetRed() const;
+ inline void SetRed( sal_uInt8 cRed );
+
+ inline sal_uInt8 GetGreen() const;
+ inline void SetGreen( sal_uInt8 cGreen );
+
+ inline sal_uInt8 GetBlue() const;
+ inline void SetBlue( sal_uInt8 cBlue );
+
+ inline sal_uInt8 GetIndex() const;
+ inline void SetIndex( sal_uInt8 cIndex );
+
+ operator Color() const;
+ inline operator sal_uInt8() const;
+
+ inline sal_uInt8 GetBlueOrIndex() const;
+
+ inline BitmapColor& Invert();
+
+ inline sal_uInt8 GetLuminance() const;
+ inline BitmapColor& IncreaseLuminance( sal_uInt8 cGreyInc );
+ inline BitmapColor& DecreaseLuminance( sal_uInt8 cGreyDec );
+
+ inline BitmapColor& Merge( const BitmapColor& rColor, sal_uInt8 cTransparency );
+ inline BitmapColor& Merge( sal_uInt8 cR, sal_uInt8 cG, sal_uInt8 cB, sal_uInt8 cTransparency );
+
+ inline sal_uLong GetColorError( const BitmapColor& rBitmapColor ) const;
+};
+
+// ---------------
+// - BitmapPalette -
+// ---------------
+
+class Palette;
+
+class VCL_DLLPUBLIC BitmapPalette
+{
+ friend class SalBitmap;
+ friend class BitmapAccess;
+
+private:
+
+ BitmapColor* mpBitmapColor;
+ sal_uInt16 mnCount;
+
+public:
+
+ SAL_DLLPRIVATE inline BitmapColor* ImplGetColorBuffer() const;
+
+
+public:
+
+ inline BitmapPalette();
+ inline BitmapPalette( const BitmapPalette& rBitmapPalette );
+ inline BitmapPalette( sal_uInt16 nCount );
+ inline ~BitmapPalette();
+
+ inline BitmapPalette& operator=( const BitmapPalette& rBitmapPalette );
+ inline sal_Bool operator==( const BitmapPalette& rBitmapPalette ) const;
+ inline sal_Bool operator!=( const BitmapPalette& rBitmapPalette ) const;
+ inline sal_Bool operator!();
+
+ inline sal_uInt16 GetEntryCount() const;
+ inline void SetEntryCount( sal_uInt16 nCount );
+
+ inline const BitmapColor& operator[]( sal_uInt16 nIndex ) const;
+ inline BitmapColor& operator[]( sal_uInt16 nIndex );
+
+ inline sal_uInt16 GetBestIndex( const BitmapColor& rCol ) const;
+ bool IsGreyPalette() const;
+};
+
+// ---------------
+// - ColorMask -
+// ---------------
+
+class VCL_DLLPUBLIC ColorMask
+{
+ sal_uLong mnRMask;
+ sal_uLong mnGMask;
+ sal_uLong mnBMask;
+ long mnRShift;
+ long mnGShift;
+ long mnBShift;
+ sal_uLong mnROrShift;
+ sal_uLong mnGOrShift;
+ sal_uLong mnBOrShift;
+ sal_uLong mnROr;
+ sal_uLong mnGOr;
+ sal_uLong mnBOr;
+
+ SAL_DLLPRIVATE inline long ImplCalcMaskShift( sal_uLong nMask, sal_uLong& rOr, sal_uLong& rOrShift ) const;
+
+public:
+
+ inline ColorMask( sal_uLong nRedMask = 0UL, sal_uLong nGreenMask = 0UL, sal_uLong nBlueMask = 0UL );
+ inline ~ColorMask() {}
+
+ inline sal_uLong GetRedMask() const;
+ inline sal_uLong GetGreenMask() const;
+ inline sal_uLong GetBlueMask() const;
+
+ inline void GetColorFor8Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
+ inline void SetColorFor8Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
+
+ inline void GetColorFor16BitMSB( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
+ inline void SetColorFor16BitMSB( const BitmapColor& rColor, HPBYTE pPixel ) const;
+ inline void GetColorFor16BitLSB( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
+ inline void SetColorFor16BitLSB( const BitmapColor& rColor, HPBYTE pPixel ) const;
+
+ inline void GetColorFor24Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
+ inline void SetColorFor24Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
+
+ inline void GetColorFor32Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
+ inline void SetColorFor32Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
+};
+
+// ---------------
+// - BitmapBuffer -
+// ---------------
+
+struct VCL_DLLPUBLIC BitmapBuffer
+{
+ sal_uLong mnFormat;
+ long mnWidth;
+ long mnHeight;
+ long mnScanlineSize;
+ sal_uInt16 mnBitCount;
+ ColorMask maColorMask;
+ BitmapPalette maPalette;
+ sal_uInt8* mpBits;
+
+ BitmapBuffer(){}
+ ~BitmapBuffer() {}
+};
+
+// ---------------------
+// - StretchAndConvert -
+// ---------------------
+
+VCL_DLLPUBLIC BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
+ sal_uLong nDstBitmapFormat, BitmapPalette* pDstPal = NULL, ColorMask* pDstMask = NULL );
+
+// ------------------------------------------------------------------
+
+inline BitmapColor::BitmapColor() :
+ mcBlueOrIndex ( 0 ),
+ mcGreen ( 0 ),
+ mcRed ( 0 ),
+ mbIndex ( sal_False )
+{
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor::BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue ) :
+ mcBlueOrIndex ( cBlue ),
+ mcGreen ( cGreen ),
+ mcRed ( cRed ),
+ mbIndex ( sal_False )
+{
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor::BitmapColor( const BitmapColor& rBitmapColor ) :
+ mcBlueOrIndex ( rBitmapColor.mcBlueOrIndex ),
+ mcGreen ( rBitmapColor.mcGreen ),
+ mcRed ( rBitmapColor.mcRed ),
+ mbIndex ( rBitmapColor.mbIndex )
+{
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor::BitmapColor( const Color& rColor ) :
+ mcBlueOrIndex ( rColor.GetBlue() ),
+ mcGreen ( rColor.GetGreen() ),
+ mcRed ( rColor.GetRed() ),
+ mbIndex ( 0 )
+{
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor::BitmapColor( sal_uInt8 cIndex ) :
+ mcBlueOrIndex ( cIndex ),
+ mcGreen ( 0 ),
+ mcRed ( 0 ),
+ mbIndex ( sal_True )
+{
+}
+
+// ------------------------------------------------------------------
+
+inline sal_Bool BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
+{
+ return( ( mcBlueOrIndex == rBitmapColor.mcBlueOrIndex ) &&
+ ( mbIndex ? rBitmapColor.mbIndex :
+ ( mcGreen == rBitmapColor.mcGreen && mcRed == rBitmapColor.mcRed ) ) );
+}
+
+// ------------------------------------------------------------------
+
+inline sal_Bool BitmapColor::operator!=( const BitmapColor& rBitmapColor ) const
+{
+ return !( *this == rBitmapColor );
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor& BitmapColor::operator=( const BitmapColor& rBitmapColor )
+{
+ mcBlueOrIndex = rBitmapColor.mcBlueOrIndex;
+ mcGreen = rBitmapColor.mcGreen;
+ mcRed = rBitmapColor.mcRed;
+ mbIndex = rBitmapColor.mbIndex;
+
+ return *this;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_Bool BitmapColor::IsIndex() const
+{
+ return mbIndex;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uInt8 BitmapColor::GetRed() const
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ return mcRed;
+}
+
+// ------------------------------------------------------------------
+
+inline void BitmapColor::SetRed( sal_uInt8 cRed )
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ mcRed = cRed;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uInt8 BitmapColor::GetGreen() const
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ return mcGreen;
+}
+
+// ------------------------------------------------------------------
+
+inline void BitmapColor::SetGreen( sal_uInt8 cGreen )
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ mcGreen = cGreen;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uInt8 BitmapColor::GetBlue() const
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ return mcBlueOrIndex;
+}
+
+// ------------------------------------------------------------------
+
+inline void BitmapColor::SetBlue( sal_uInt8 cBlue )
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ mcBlueOrIndex = cBlue;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uInt8 BitmapColor::GetIndex() const
+{
+ DBG_ASSERT( mbIndex, "Pixel represents color values!" );
+ return mcBlueOrIndex;
+}
+
+// ------------------------------------------------------------------
+
+inline void BitmapColor::SetIndex( sal_uInt8 cIndex )
+{
+ DBG_ASSERT( mbIndex, "Pixel represents color values!" );
+ mcBlueOrIndex = cIndex;
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor::operator Color() const
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ return Color( mcRed, mcGreen, mcBlueOrIndex );
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor::operator sal_uInt8() const
+{
+ DBG_ASSERT( mbIndex, "Pixel represents color values!" );
+ return mcBlueOrIndex;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uInt8 BitmapColor::GetBlueOrIndex() const
+{
+ // #i47518# Yield a value regardless of mbIndex
+ return mcBlueOrIndex;
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor& BitmapColor::Invert()
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ mcBlueOrIndex = ~mcBlueOrIndex, mcGreen = ~mcGreen, mcRed = ~mcRed;
+
+ return *this;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uInt8 BitmapColor::GetLuminance() const
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ return( (sal_uInt8) ( ( mcBlueOrIndex * 28UL + mcGreen * 151UL + mcRed * 77UL ) >> 8UL ) );
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor& BitmapColor::IncreaseLuminance( sal_uInt8 cGreyInc )
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ mcBlueOrIndex = (sal_uInt8) MinMax( (long) mcBlueOrIndex + cGreyInc, 0L, 255L );
+ mcGreen = (sal_uInt8) MinMax( (long) mcGreen + cGreyInc, 0L, 255L );
+ mcRed = (sal_uInt8) MinMax( (long) mcRed + cGreyInc, 0L, 255L );
+
+ return *this;
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor& BitmapColor::DecreaseLuminance( sal_uInt8 cGreyDec )
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ mcBlueOrIndex = (sal_uInt8) MinMax( (long) mcBlueOrIndex - cGreyDec, 0L, 255L );
+ mcGreen = (sal_uInt8) MinMax( (long) mcGreen - cGreyDec, 0L, 255L );
+ mcRed = (sal_uInt8) MinMax( (long) mcRed - cGreyDec, 0L, 255L );
+
+ return *this;
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor& BitmapColor::Merge( const BitmapColor& rBitmapColor, sal_uInt8 cTransparency )
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ DBG_ASSERT( !rBitmapColor.mbIndex, "Pixel represents index into colortable!" );
+ mcBlueOrIndex = COLOR_CHANNEL_MERGE( mcBlueOrIndex, rBitmapColor.mcBlueOrIndex, cTransparency );
+ mcGreen = COLOR_CHANNEL_MERGE( mcGreen, rBitmapColor.mcGreen, cTransparency );
+ mcRed = COLOR_CHANNEL_MERGE( mcRed, rBitmapColor.mcRed, cTransparency );
+
+ return *this;
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor& BitmapColor::Merge( sal_uInt8 cR, sal_uInt8 cG, sal_uInt8 cB, sal_uInt8 cTransparency )
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ mcBlueOrIndex = COLOR_CHANNEL_MERGE( mcBlueOrIndex, cB, cTransparency );
+ mcGreen = COLOR_CHANNEL_MERGE( mcGreen, cG, cTransparency );
+ mcRed = COLOR_CHANNEL_MERGE( mcRed, cR, cTransparency );
+
+ return *this;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uLong BitmapColor::GetColorError( const BitmapColor& rBitmapColor ) const
+{
+ DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
+ DBG_ASSERT( !rBitmapColor.mbIndex, "Pixel represents index into colortable!" );
+ return( (sal_uLong) ( labs( mcBlueOrIndex - rBitmapColor.mcBlueOrIndex ) +
+ labs( mcGreen - rBitmapColor.mcGreen ) +
+ labs( mcRed - rBitmapColor.mcRed ) ) );
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapPalette::BitmapPalette() :
+ mpBitmapColor ( NULL ),
+ mnCount ( 0 )
+{
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapPalette::BitmapPalette( const BitmapPalette& rBitmapPalette ) :
+ mnCount( rBitmapPalette.mnCount )
+{
+ if( mnCount )
+ {
+ const sal_uLong nSize = mnCount * sizeof( BitmapColor );
+ mpBitmapColor = (BitmapColor*) new sal_uInt8[ nSize ];
+ memcpy( mpBitmapColor, rBitmapPalette.mpBitmapColor, nSize );
+ }
+ else
+ mpBitmapColor = NULL;
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapPalette::BitmapPalette( sal_uInt16 nCount ) :
+ mnCount( nCount )
+{
+ if( mnCount )
+ {
+ const sal_uLong nSize = mnCount * sizeof( BitmapColor );
+ mpBitmapColor = (BitmapColor*) new sal_uInt8[ nSize ];
+ memset( mpBitmapColor, 0, nSize );
+ }
+ else
+ mpBitmapColor = NULL;
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapPalette::~BitmapPalette()
+{
+ delete[] (sal_uInt8*) mpBitmapColor;
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapPalette& BitmapPalette::operator=( const BitmapPalette& rBitmapPalette )
+{
+ delete[] (sal_uInt8*) mpBitmapColor;
+ mnCount = rBitmapPalette.mnCount;
+
+ if( mnCount )
+ {
+ const sal_uLong nSize = mnCount * sizeof( BitmapColor );
+ mpBitmapColor = (BitmapColor*) new sal_uInt8[ nSize ];
+ memcpy( mpBitmapColor, rBitmapPalette.mpBitmapColor, nSize );
+ }
+ else
+ mpBitmapColor = NULL;
+
+ return *this;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_Bool BitmapPalette::operator==( const BitmapPalette& rBitmapPalette ) const
+{
+ sal_Bool bRet = sal_False;
+
+ if( rBitmapPalette.mnCount == mnCount )
+ {
+ bRet = sal_True;
+
+ for( sal_uInt16 i = 0; i < mnCount; i++ )
+ {
+ if( mpBitmapColor[ i ] != rBitmapPalette.mpBitmapColor[ i ] )
+ {
+ bRet = sal_False;
+ break;
+ }
+ }
+ }
+
+ return bRet;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_Bool BitmapPalette::operator!=( const BitmapPalette& rBitmapPalette ) const
+{
+ return !( *this == rBitmapPalette );
+}
+
+// ------------------------------------------------------------------
+
+inline sal_Bool BitmapPalette::operator!()
+{
+ return( !mnCount || !mpBitmapColor );
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uInt16 BitmapPalette::GetEntryCount() const
+{
+ return mnCount;
+}
+
+// ------------------------------------------------------------------
+
+inline void BitmapPalette::SetEntryCount( sal_uInt16 nCount )
+{
+ if( !nCount )
+ {
+ delete[] (sal_uInt8*) mpBitmapColor;
+ mpBitmapColor = NULL;
+ mnCount = 0;
+ }
+ else if( nCount != mnCount )
+ {
+ const sal_uLong nNewSize = nCount * sizeof( BitmapColor );
+ const sal_uLong nMinSize = std::min( mnCount, nCount ) * sizeof( BitmapColor );
+ sal_uInt8* pNewColor = new sal_uInt8[ nNewSize ];
+
+ if ( nMinSize && mpBitmapColor )
+ memcpy( pNewColor, mpBitmapColor, nMinSize );
+ delete[] (sal_uInt8*) mpBitmapColor;
+ memset( pNewColor + nMinSize, 0, nNewSize - nMinSize );
+ mpBitmapColor = (BitmapColor*) pNewColor;
+ mnCount = nCount;
+ }
+}
+
+// ------------------------------------------------------------------
+
+inline const BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex ) const
+{
+ DBG_ASSERT( nIndex < mnCount, "Palette index is out of range!" );
+ return mpBitmapColor[ nIndex ];
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex )
+{
+ DBG_ASSERT( nIndex < mnCount, "Palette index is out of range!" );
+ return mpBitmapColor[ nIndex ];
+}
+
+// ------------------------------------------------------------------
+
+inline BitmapColor* BitmapPalette::ImplGetColorBuffer() const
+{
+ DBG_ASSERT( mpBitmapColor, "No color buffer available!" );
+ return mpBitmapColor;
+}
+// ------------------------------------------------------------------
+
+inline sal_uInt16 BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
+{
+ sal_uInt16 nRetIndex = 0;
+
+ if( mpBitmapColor && mnCount )
+ {
+ sal_Bool bFound = sal_False;
+
+ for( long j = 0L; ( j < mnCount ) && !bFound; j++ )
+ if( rCol == mpBitmapColor[ j ] )
+ nRetIndex = ( (sal_uInt16) j ), bFound = sal_True;
+
+ if( !bFound )
+ {
+ long nActErr, nLastErr = rCol.GetColorError( mpBitmapColor[ nRetIndex = mnCount - 1 ] );
+
+ for( long i = nRetIndex - 1; i >= 0L; i-- )
+ if ( ( nActErr = rCol.GetColorError( mpBitmapColor[ i ] ) ) < nLastErr )
+ nLastErr = nActErr, nRetIndex = (sal_uInt16) i;
+ }
+ }
+
+ return nRetIndex;
+}
+
+// ------------------------------------------------------------------
+
+inline ColorMask::ColorMask( sal_uLong nRedMask, sal_uLong nGreenMask, sal_uLong nBlueMask ) :
+ mnRMask( nRedMask ),
+ mnGMask( nGreenMask ),
+ mnBMask( nBlueMask ),
+ mnROrShift( 0L ),
+ mnGOrShift( 0L ),
+ mnBOrShift( 0L ),
+ mnROr( 0L ),
+ mnGOr( 0L ),
+ mnBOr( 0L )
+{
+ mnRShift = ( mnRMask ? ImplCalcMaskShift( mnRMask, mnROr, mnROrShift ) : 0L );
+ mnGShift = ( mnGMask ? ImplCalcMaskShift( mnGMask, mnGOr, mnGOrShift ) : 0L );
+ mnBShift = ( mnBMask ? ImplCalcMaskShift( mnBMask, mnBOr, mnBOrShift ) : 0L );
+}
+
+// ------------------------------------------------------------------
+
+inline long ColorMask::ImplCalcMaskShift( sal_uLong nMask, sal_uLong& rOr, sal_uLong& rOrShift ) const
+{
+ long nShift;
+ long nRet;
+ sal_uLong nLen = 0UL;
+
+ // from which bit starts the mask?
+ for( nShift = 31L; ( nShift >= 0L ) && !( nMask & ( 1 << (sal_uLong) nShift ) ); nShift-- )
+ {}
+
+ nRet = nShift;
+
+ // XXX determine number of bits set => walk right until null
+ while( ( nShift >= 0L ) && ( nMask & ( 1 << (sal_uLong) nShift ) ) )
+ {
+ nShift--;
+ nLen++;
+ }
+
+ rOrShift = 8L - nLen;
+ rOr = (sal_uInt8) ( ( 0xffUL >> nLen ) << rOrShift );
+
+ return( nRet -= 7 );
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uLong ColorMask::GetRedMask() const
+{
+ return mnRMask;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uLong ColorMask::GetGreenMask() const
+{
+ return mnGMask;
+}
+
+// ------------------------------------------------------------------
+
+inline sal_uLong ColorMask::GetBlueMask() const
+{
+ return mnBMask;
+}
+
+// ------------------------------------------------------------------
+
+inline void ColorMask::GetColorFor8Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const
+{
+ const sal_uInt32 nVal = *pPixel;
+ MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
+}
+
+// ------------------------------------------------------------------
+
+inline void ColorMask::SetColorFor8Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
+{
+ *pPixel = (sal_uInt8) COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+}
+
+// ------------------------------------------------------------------
+
+inline void ColorMask::GetColorFor16BitMSB( BitmapColor& rColor, ConstHPBYTE pPixel ) const
+{
+#ifdef OSL_BIGENDIAN
+ const sal_uInt32 nVal = *(sal_uInt16*) pPixel;
+#else
+ const sal_uInt32 nVal = pPixel[ 1 ] | ( (sal_uInt32) pPixel[ 0 ] << 8UL );
+#endif
+
+ MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
+}
+
+// ------------------------------------------------------------------
+
+inline void ColorMask::SetColorFor16BitMSB( const BitmapColor& rColor, HPBYTE pPixel ) const
+{
+ const sal_uInt16 nVal = (sal_uInt16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+
+#ifdef OSL_BIGENDIAN
+ *(sal_uInt16*) pPixel = nVal;
+#else
+ pPixel[ 0 ] = (sal_uInt8)(nVal >> 8U);
+ pPixel[ 1 ] = (sal_uInt8) nVal;
+#endif
+}
+
+// ------------------------------------------------------------------
+
+inline void ColorMask::GetColorFor16BitLSB( BitmapColor& rColor, ConstHPBYTE pPixel ) const
+{
+#ifdef OSL_BIGENDIAN
+ const sal_uInt32 nVal = pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL );
+#else
+ const sal_uInt32 nVal = *(sal_uInt16*) pPixel;
+#endif
+
+ MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
+}
+
+// ------------------------------------------------------------------
+
+inline void ColorMask::SetColorFor16BitLSB( const BitmapColor& rColor, HPBYTE pPixel ) const
+{
+ const sal_uInt16 nVal = (sal_uInt16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+
+#ifdef OSL_BIGENDIAN
+ pPixel[ 0 ] = (sal_uInt8) nVal;
+ pPixel[ 1 ] = (sal_uInt8)(nVal >> 8U);
+#else
+ *(sal_uInt16*) pPixel = nVal;
+#endif
+}
+
+
+// ------------------------------------------------------------------
+
+inline void ColorMask::GetColorFor24Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const
+{
+ const sal_uInt32 nVal = pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL ) | ( (sal_uInt32) pPixel[ 2 ] << 16UL );
+ MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
+}
+
+// ------------------------------------------------------------------
+
+inline void ColorMask::SetColorFor24Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
+{
+ const sal_uInt32 nVal = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ pPixel[ 0 ] = (sal_uInt8) nVal; pPixel[ 1 ] = (sal_uInt8) ( nVal >> 8UL ); pPixel[ 2 ] = (sal_uInt8) ( nVal >> 16UL );
+}
+
+// ------------------------------------------------------------------
+
+inline void ColorMask::GetColorFor32Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const
+{
+#ifdef OSL_BIGENDIAN
+ const sal_uInt32 nVal = (sal_uInt32) pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL ) |
+ ( (sal_uInt32) pPixel[ 2 ] << 16UL ) | ( (sal_uInt32) pPixel[ 3 ] << 24UL );
+#else
+ const sal_uInt32 nVal = *(sal_uInt32*) pPixel;
+#endif
+
+ MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
+}
+
+// ------------------------------------------------------------------
+
+inline void ColorMask::SetColorFor32Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
+{
+#ifdef OSL_BIGENDIAN
+ const sal_uInt32 nVal = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ pPixel[ 0 ] = (sal_uInt8) nVal; pPixel[ 1 ] = (sal_uInt8) ( nVal >> 8UL );
+ pPixel[ 2 ] = (sal_uInt8) ( nVal >> 16UL ); pPixel[ 3 ] = (sal_uInt8) ( nVal >> 24UL );
+#else
+ *(sal_uInt32*) pPixel = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+#endif
+}
+
+#endif // _SV_SALBTYPE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/salctype.hxx b/include/vcl/salctype.hxx
new file mode 100644
index 000000000000..4fbb65d2a49a
--- /dev/null
+++ b/include/vcl/salctype.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 _SV_SALCTYPE_HXX
+#define _SV_SALCTYPE_HXX
+
+#include <com/sun/star/script/XInvocation.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <vcl/graph.hxx>
+
+#define CVT_UNKNOWN (0x00000000UL)
+#define CVT_BMP (0x00000001UL)
+#define CVT_GIF (0x00000002UL)
+#define CVT_JPG (0x00000003UL)
+#define CVT_MET (0x00000004UL)
+#define CVT_PCT (0x00000005UL)
+#define CVT_PNG (0x00000006UL)
+#define CVT_SVM (0x00000007UL)
+#define CVT_TIF (0x00000008UL)
+#define CVT_WMF (0x00000009UL)
+#define CVT_EMF (0x0000000aUL)
+#define CVT_SVG (0x0000000bUL)
+
+class SvStream;
+
+struct ConvertData
+{
+private:
+
+ ConvertData();
+
+public:
+
+ Graphic maGraphic;
+ SvStream& mrStm;
+ sal_uLong mnFormat;
+
+ ConvertData( const Graphic& rGraphic, SvStream& rStm, sal_uLong nFormat ) :
+ maGraphic( rGraphic ), mrStm( rStm ), mnFormat( nFormat ) {}
+ ~ConvertData() {}
+};
+
+typedef sal_uLong (*SALGRFCVTPROC)( void* pInst,
+ sal_uLong nInFormat, void* pInBuffer, sal_uLong nInBufSize,
+ sal_uLong nOutFormat, void** ppOutBuffer );
+
+namespace vcl
+{
+com::sun::star::uno::Reference< com::sun::star::script::XInvocation > createBmpConverter();
+}
+
+#endif // _SV_SALCTYPE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/salgtype.hxx b/include/vcl/salgtype.hxx
new file mode 100644
index 000000000000..25836f508771
--- /dev/null
+++ b/include/vcl/salgtype.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 _SV_SALGTYPE_HXX
+#define _SV_SALGTYPE_HXX
+
+#include <tools/solar.h>
+
+// ------------
+// - SalColor -
+// ------------
+
+typedef sal_uInt32 SalColor;
+#define MAKE_SALCOLOR( r, g, b ) ((SalColor)(((sal_uInt32)((sal_uInt8)(b))))|(((sal_uInt32)((sal_uInt8)(g)))<<8)|(((sal_uInt32)((sal_uInt8)(r)))<<16))
+#define SALCOLOR_RED( n ) ((sal_uInt8)((n)>>16))
+#define SALCOLOR_GREEN( n ) ((sal_uInt8)(((sal_uInt16)(n)) >> 8))
+#define SALCOLOR_BLUE( n ) ((sal_uInt8)(n))
+#define SALCOLOR_NONE (~(SalColor)0)
+// ------------
+// - SalPoint -
+// ------------
+
+// must equal to class Point
+struct SalPoint
+{
+ long mnX;
+ long mnY;
+};
+
+typedef const SalPoint* PCONSTSALPOINT;
+
+// --------------
+// - SalTwoRect -
+// --------------
+
+struct SalTwoRect
+{
+ long mnSrcX;
+ long mnSrcY;
+ long mnSrcWidth;
+ long mnSrcHeight;
+ long mnDestX;
+ long mnDestY;
+ long mnDestWidth;
+ long mnDestHeight;
+};
+
+// ---------------
+// - SalROPColor -
+// ---------------
+
+typedef sal_uInt16 SalROPColor;
+#define SAL_ROP_0 ((SalROPColor)0)
+#define SAL_ROP_1 ((SalROPColor)1)
+#define SAL_ROP_INVERT ((SalROPColor)2)
+
+// -------------
+// - SalInvert -
+// -------------
+
+typedef sal_uInt16 SalInvert;
+#define SAL_INVERT_HIGHLIGHT ((SalInvert)0x0001)
+#define SAL_INVERT_50 ((SalInvert)0x0002)
+#define SAL_INVERT_TRACKFRAME ((SalInvert)0x0004)
+
+#endif // _SV_SALGTYPE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx
new file mode 100644
index 000000000000..775503e29da4
--- /dev/null
+++ b/include/vcl/salnativewidgets.hxx
@@ -0,0 +1,476 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_NATIVEWIDGETS_HXX
+#define _SV_NATIVEWIDGETS_HXX
+
+#include <rtl/ustring.hxx>
+#include <vcl/dllapi.h>
+#include <tools/gen.hxx>
+
+/* Control Types:
+ *
+ * Specify the overall, whole control
+ * type (as opposed to parts of the
+ * control if it were composite).
+ */
+
+typedef sal_uInt32 ControlType;
+
+// for use in general purpose ImplControlValue
+#define CTRL_GENERIC 0
+
+// Normal PushButton/Command Button
+#define CTRL_PUSHBUTTON 1
+
+// Normal single radio button
+#define CTRL_RADIOBUTTON 2
+
+// Normal single checkbox
+#define CTRL_CHECKBOX 10
+
+// Combobox, i.e. a ListBox
+// that allows data entry by user
+#define CTRL_COMBOBOX 20
+
+// Control that allows text entry
+#define CTRL_EDITBOX 30
+
+// Control that allows text entry, but without the usual border
+// Has to be handled separately, because this one cannot handle
+// HAS_BACKGROUND_TEXTURE, which is drawn in the edit box'es
+// border window.
+#define CTRL_EDITBOX_NOBORDER 31
+
+// Control that allows text entry
+// ( some systems distingish between single and multi line edit boxes )
+#define CTRL_MULTILINE_EDITBOX 32
+
+// Control that pops up a menu,
+// but does NOT allow data entry
+#define CTRL_LISTBOX 35
+
+// An edit field together with two little
+// buttons on the side (aka spin field)
+#define CTRL_SPINBOX 40
+
+// Two standalone spin buttons
+// without an edit field
+#define CTRL_SPINBUTTONS 45
+
+// A single tab
+#define CTRL_TAB_ITEM 50
+
+// The border around a tab area,
+// but without the tabs themselves.
+// May have a gap at the top for
+// the active tab
+#define CTRL_TAB_PANE 55
+
+// Background of a Tab Pane
+#define CTRL_TAB_BODY 56
+
+// Normal scrollbar, including
+// all parts like slider, buttons
+#define CTRL_SCROLLBAR 60
+
+#define CTRL_SLIDER 65
+
+// Border around a group of related
+// items, perhaps also displaying
+// a label of identification
+#define CTRL_GROUPBOX 70
+
+// A separator line
+#define CTRL_FIXEDLINE 80
+
+// A toolbar control with buttons and a grip
+#define CTRL_TOOLBAR 100
+
+// The menubar
+#define CTRL_MENUBAR 120
+// popup menu
+#define CTRL_MENU_POPUP 121
+
+// The statusbar
+#define CTRL_STATUSBAR 130
+#define CTRL_PROGRESS 131
+// Progress bar for the intro window
+// (aka splash screen), in case some
+// wants native progress bar in the
+// application but not for the splash
+// screen (used in desktop/)
+#define CTRL_INTROPROGRESS 132
+
+// tool tips
+#define CTRL_TOOLTIP 140
+
+// to draw the implemented theme
+#define CTRL_WINDOW_BACKGROUND 150
+
+//to draw border of frames natively
+#define CTRL_FRAME 160
+
+// for nodes in listviews
+// used in svtools/source/contnr/svtreebx.cxx
+#define CTRL_LISTNODE 170
+// nets between elements of listviews
+// with nodes
+#define CTRL_LISTNET 171
+// for list headers
+#define CTRL_LISTHEADER 172
+
+
+/* Control Parts:
+ *
+ * Uniquely identify a part of a control,
+ * for example the slider of a scroll bar.
+ */
+
+typedef sal_uInt32 ControlPart;
+
+#define PART_ENTIRE_CONTROL 1
+#define PART_WINDOW 5 // the static listbox window containing the list
+#define PART_BUTTON 100
+#define PART_BUTTON_UP 101
+#define PART_BUTTON_DOWN 102 // Also for ComboBoxes/ListBoxes
+#define PART_BUTTON_LEFT 103
+#define PART_BUTTON_RIGHT 104
+#define PART_ALL_BUTTONS 105
+#define PART_SEPARATOR_HORZ 106
+#define PART_SEPARATOR_VERT 107
+#define PART_TRACK_HORZ_LEFT 200
+#define PART_TRACK_VERT_UPPER 201
+#define PART_TRACK_HORZ_RIGHT 202
+#define PART_TRACK_VERT_LOWER 203
+#define PART_TRACK_HORZ_AREA 204
+#define PART_TRACK_VERT_AREA 205
+#define PART_THUMB_HORZ 210 // Also used as toolbar grip
+#define PART_THUMB_VERT 211 // Also used as toolbar grip
+#define PART_ARROW 220
+#define PART_MENU_ITEM 250
+#define PART_MENU_ITEM_CHECK_MARK 251
+#define PART_MENU_ITEM_RADIO_MARK 252
+#define PART_MENU_SEPARATOR 253
+#define PART_MENU_SUBMENU_ARROW 254
+
+/* #i77549#
+ HACK: for scrollbars in case of thumb rect, page up and page down rect we
+ abuse the HitTestNativeControl interface. All theming engines but aqua
+ are actually able to draw the thumb according to our internal representation.
+ However aqua draws a little outside. The canonical way would be to enhance the
+ HitTestNativeControl passing a ScrollbarValue additionally so all necessary
+ information is available in the call.
+ .
+ However since there is only this one small exception we will deviate a little and
+ instead pass the respective rect as control region to allow for a small correction.
+
+ So all places using HitTestNativeControl on PART_THUMB_HORZ, PART_THUMB_VERT,
+ PART_TRACK_HORZ_LEFT, PART_TRACK_HORZ_RIGHT, PART_TRACK_VERT_UPPER, PART_TRACK_VERT_LOWER
+ do not use the control rectangle as region but the actuall part rectangle, making
+ only small deviations feasible.
+*/
+
+/** The edit field part of a control, e.g. of the combo box.
+
+ Currently used just for combo boxes and just for GetNativeControlRegion().
+ It is valid only if GetNativeControlRegion() supports PART_BUTTON_DOWN as
+ well.
+*/
+#define PART_SUB_EDIT 300
+
+// For controls that require the entire background
+// to be drawn first, and then other pieces over top.
+// (GTK+ scrollbars for example). Control region passed
+// in to draw this part is expected to be the entire
+// area of the control.
+// A control may respond to one or both.
+#define PART_DRAW_BACKGROUND_HORZ 1000
+#define PART_DRAW_BACKGROUND_VERT 1001
+
+// GTK+ also draws tabs right->left since there is a
+// hardcoded 2 pixel overlap between adjacent tabs
+#define PART_TABS_DRAW_RTL 3000
+
+// For themes that do not want to have the focus
+// rectangle part drawn by VCL but take care of the
+// whole inner control part by themselves
+// eg, listboxes or comboboxes or spinbuttons
+#define HAS_BACKGROUND_TEXTURE 4000
+
+// For scrollbars that have 3 buttons (most KDE themes)
+#define HAS_THREE_BUTTONS 5000
+
+#define PART_BACKGROUND_WINDOW 6000
+#define PART_BACKGROUND_DIALOG 6001
+
+//to draw natively the border of frames
+#define PART_BORDER 7000
+
+/* Control State:
+ *
+ * Specify how a particular part of the control
+ * is to be drawn. Constants are bitwise OR-ed
+ * together to compose a final drawing state.
+ * A _disabled_ state is assumed by the drawing
+ * functions until an ENABLED or HIDDEN is passed
+ * in the ControlState.
+ */
+
+typedef sal_uInt32 ControlState;
+
+#define CTRL_STATE_ENABLED 0x0001
+#define CTRL_STATE_FOCUSED 0x0002
+#define CTRL_STATE_PRESSED 0x0004
+#define CTRL_STATE_ROLLOVER 0x0008
+#define CTRL_STATE_HIDDEN 0x0010
+#define CTRL_STATE_DEFAULT 0x0020
+#define CTRL_STATE_SELECTED 0x0040
+#define CTRL_CACHING_ALLOWED 0x8000 // set when the control is completely visible (i.e. not clipped)
+
+/* ButtonValue:
+ *
+ * Identifies the tri-state value options
+ * that buttons allow
+ */
+
+enum ButtonValue {
+ BUTTONVALUE_DONTKNOW,
+ BUTTONVALUE_ON,
+ BUTTONVALUE_OFF,
+ BUTTONVALUE_MIXED
+};
+
+/* ImplControlValue:
+ *
+ * Generic value container for all control parts.
+ */
+
+class VCL_DLLPUBLIC ImplControlValue
+{
+ friend class SalFrame;
+
+ private:
+ ControlType mType;
+ ButtonValue mTristate; // Tristate value: on, off, mixed
+ long mNumber; // numeric value
+ protected:
+ ImplControlValue( ControlType i_eType, ButtonValue i_eTriState, long i_nNumber )
+ : mType( i_eType )
+ , mTristate( i_eTriState )
+ , mNumber( i_nNumber )
+ {}
+
+ public:
+ explicit ImplControlValue( ButtonValue nTristate )
+ : mType( CTRL_GENERIC ), mTristate(nTristate), mNumber(0) {}
+ explicit ImplControlValue( long nNumeric )
+ : mType( CTRL_GENERIC ), mTristate(BUTTONVALUE_DONTKNOW), mNumber( nNumeric) {}
+ inline ImplControlValue()
+ : mType( CTRL_GENERIC ), mTristate(BUTTONVALUE_DONTKNOW), mNumber(0) {}
+
+ virtual ~ImplControlValue();
+
+ virtual ImplControlValue* clone() const;
+
+ ControlType getType() const { return mType; }
+
+ inline ButtonValue getTristateVal( void ) const { return mTristate; }
+ inline void setTristateVal( ButtonValue nTristate ) { mTristate = nTristate; }
+
+ inline long getNumericVal( void ) const { return mNumber; }
+ inline void setNumericVal( long nNumeric ) { mNumber = nNumeric; }
+};
+
+/* ScrollbarValue:
+ *
+ * Value container for scrollbars.
+ */
+class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
+{
+ public:
+ long mnMin;
+ long mnMax;
+ long mnCur;
+ long mnVisibleSize;
+ Rectangle maThumbRect;
+ Rectangle maButton1Rect;
+ Rectangle maButton2Rect;
+ ControlState mnButton1State;
+ ControlState mnButton2State;
+ ControlState mnThumbState;
+ ControlState mnPage1State;
+ ControlState mnPage2State;
+
+ inline ScrollbarValue()
+ : ImplControlValue( CTRL_SCROLLBAR, BUTTONVALUE_DONTKNOW, 0 )
+ {
+ mnMin = 0; mnMax = 0; mnCur = 0; mnVisibleSize = 0;
+ mnButton1State = 0; mnButton2State = 0;
+ mnThumbState = 0; mnPage1State = 0; mnPage2State = 0;
+ };
+ virtual ~ScrollbarValue();
+ virtual ScrollbarValue* clone() const;
+};
+
+class VCL_DLLPUBLIC SliderValue : public ImplControlValue
+{
+ public:
+ long mnMin;
+ long mnMax;
+ long mnCur;
+ Rectangle maThumbRect;
+ ControlState mnThumbState;
+
+ SliderValue()
+ : ImplControlValue( CTRL_SLIDER, BUTTONVALUE_DONTKNOW, 0 )
+ , mnMin( 0 ), mnMax( 0 ), mnCur( 0 ), mnThumbState( 0 )
+ {}
+ virtual ~SliderValue();
+ virtual SliderValue* clone() const;
+};
+
+/* TabitemValue:
+ *
+ * Value container for tabitems.
+ */
+
+/* TABITEM constants are OR-ed together */
+#define TABITEM_NOTALIGNED 0x000 // the tabitem is an inner item
+#define TABITEM_LEFTALIGNED 0x001 // the tabitem is aligned with the left border of the TabControl
+#define TABITEM_RIGHTALIGNED 0x002 // the tabitem is aligned with the right border of the TabControl
+#define TABITEM_FIRST_IN_GROUP 0x004 // the tabitem is the first in group of tabitems
+#define TABITEM_LAST_IN_GROUP 0x008 // the tabitem is the last in group of tabitems
+
+class VCL_DLLPUBLIC TabitemValue : public ImplControlValue
+{
+ public:
+ unsigned int mnAlignment;
+
+ inline TabitemValue()
+ : ImplControlValue( CTRL_TAB_ITEM, BUTTONVALUE_DONTKNOW, 0 )
+ {
+ mnAlignment = 0;
+ };
+ virtual ~TabitemValue();
+ virtual TabitemValue* clone() const;
+
+ sal_Bool isLeftAligned() const { return (mnAlignment & TABITEM_LEFTALIGNED) != 0; }
+ sal_Bool isRightAligned() const { return (mnAlignment & TABITEM_RIGHTALIGNED) != 0; }
+ sal_Bool isBothAligned() const { return isLeftAligned() && isRightAligned(); }
+ sal_Bool isNotAligned() const { return (mnAlignment & (TABITEM_LEFTALIGNED | TABITEM_RIGHTALIGNED)) == 0; }
+ sal_Bool isFirst() const { return (mnAlignment & TABITEM_FIRST_IN_GROUP) != 0; }
+ sal_Bool isLast() const { return (mnAlignment & TABITEM_LAST_IN_GROUP) != 0; }
+};
+
+/* SpinbuttonValue:
+ *
+ * Value container for spinbuttons to paint both buttons at once.
+ * Note: the other parameters of DrawNativeControl will have no meaning
+ * all parameters for spinbuttons are carried here
+ */
+class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue
+{
+ public:
+ Rectangle maUpperRect;
+ Rectangle maLowerRect;
+ ControlState mnUpperState;
+ ControlState mnLowerState;
+ int mnUpperPart;
+ int mnLowerPart;
+
+ inline SpinbuttonValue()
+ : ImplControlValue( CTRL_SPINBUTTONS, BUTTONVALUE_DONTKNOW, 0 )
+ {
+ mnUpperState = mnLowerState = 0;
+ };
+ virtual ~SpinbuttonValue();
+ virtual SpinbuttonValue* clone() const;
+};
+
+/* Toolbarvalue:
+ *
+ * Value container for toolbars detailing the grip position
+ */
+class VCL_DLLPUBLIC ToolbarValue : public ImplControlValue
+{
+public:
+ ToolbarValue() : ImplControlValue( CTRL_TOOLBAR, BUTTONVALUE_DONTKNOW, 0 )
+ { mbIsTopDockingArea = sal_False; }
+ virtual ~ToolbarValue();
+ virtual ToolbarValue* clone() const;
+ Rectangle maGripRect;
+ sal_Bool mbIsTopDockingArea; // indicates that this is the top aligned dockingarea
+ // adjacent to the menubar
+};
+
+/* MenubarValue:
+ *
+ * Value container for menubars specifying height of adjacent docking area
+ */
+class VCL_DLLPUBLIC MenubarValue : public ImplControlValue
+{
+public:
+ MenubarValue() : ImplControlValue( CTRL_MENUBAR, BUTTONVALUE_DONTKNOW, 0 )
+ { maTopDockingAreaHeight=0; }
+ virtual ~MenubarValue();
+ virtual MenubarValue* clone() const;
+ int maTopDockingAreaHeight;
+};
+
+/* MenupopupValue:
+ *
+ * Value container for menu items; specifies the rectangle for the whole item which
+ * may be useful when drawing parts with a smaller rectangle.
+ */
+class VCL_DLLPUBLIC MenupopupValue : public ImplControlValue
+{
+public:
+ MenupopupValue() : ImplControlValue( CTRL_MENU_POPUP, BUTTONVALUE_DONTKNOW, 0 )
+ {}
+ MenupopupValue( long i_nGutterWidth, const Rectangle& i_rItemRect )
+ : ImplControlValue( CTRL_MENU_POPUP, BUTTONVALUE_DONTKNOW, i_nGutterWidth )
+ , maItemRect( i_rItemRect )
+ {}
+ virtual ~MenupopupValue();
+ virtual MenupopupValue* clone() const;
+ Rectangle maItemRect;
+};
+
+/* PushButtonValue:
+ *
+ * Value container for pushbuttons specifying additional drawing hints
+ */
+class VCL_DLLPUBLIC PushButtonValue : public ImplControlValue
+{
+public:
+ PushButtonValue()
+ : ImplControlValue( CTRL_PUSHBUTTON, BUTTONVALUE_DONTKNOW, 0 )
+ , mbBevelButton( false ), mbSingleLine( true ) {}
+ virtual ~PushButtonValue();
+ virtual PushButtonValue* clone() const;
+
+ bool mbBevelButton:1;
+ bool mbSingleLine:1;
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/scopedbitmapaccess.hxx b/include/vcl/scopedbitmapaccess.hxx
new file mode 100644
index 000000000000..834f827e14aa
--- /dev/null
+++ b/include/vcl/scopedbitmapaccess.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 VCL_SCOPEDBITMAPACCESS_HXX_INCLUDED
+#define VCL_SCOPEDBITMAPACCESS_HXX_INCLUDED
+
+namespace vcl
+{
+
+/** This template handles BitmapAccess the RAII way.
+
+ Please don't use directly, but through the ready-made typedefs
+ ScopedReadAccess and ScopedWriteAccess in classes Bitmap and
+ AlphaMask.
+
+ Use as follows:
+ Bitmap aBitmap;
+ Bitmap::ScopedReadAccess pReadAccess( aBitmap );
+ pReadAccess->SetPixel()...
+
+ Bitmap aBitmap2;
+ Bitmap::ScopedWriteAccess pWriteAccess( bCond ? aBitmap2.AcquireWriteAccess() : 0, aBitmap2 );
+ if ( pWriteAccess )...
+
+ @attention for practical reasons, ScopedBitmapAccess stores a
+ reference to the provided bitmap, thus, make sure that the bitmap
+ specified at construction time lives at least as long as the
+ ScopedBitmapAccess.
+ */
+template < class Access, class Bitmap, Access* (Bitmap::* Acquire)() > class ScopedBitmapAccess
+{
+ typedef ScopedBitmapAccess< Access, Bitmap, Acquire > self_type;
+ typedef bool (self_type::* unspecified_bool_type)() const;
+
+public:
+ explicit ScopedBitmapAccess( Bitmap& rBitmap ) :
+ mpAccess( 0 ),
+ mrBitmap( rBitmap )
+ {
+ mpAccess = (mrBitmap.*Acquire)();
+ }
+
+ ScopedBitmapAccess( Access* pAccess, Bitmap& rBitmap ) :
+ mpAccess( pAccess ),
+ mrBitmap( rBitmap )
+ {
+ }
+
+ ~ScopedBitmapAccess()
+ {
+ mrBitmap.ReleaseAccess( mpAccess );
+ }
+
+ bool operator!() const { return !mpAccess; }
+ operator unspecified_bool_type() const
+ {
+ return mpAccess ? &self_type::operator! : 0;
+ }
+
+ Access* get() { return mpAccess; }
+ const Access* get() const { return mpAccess; }
+
+ Access* operator->() { return mpAccess; }
+ const Access* operator->() const { return mpAccess; }
+
+ Access& operator*() { return *mpAccess; }
+ const Access& operator*() const { return *mpAccess; }
+
+private:
+ Access* mpAccess;
+ Bitmap& mrBitmap;
+};
+
+}
+
+#endif // VCL_SCOPEDBITMAPACCESS_HXX_INCLUDED
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/scrbar.hxx b/include/vcl/scrbar.hxx
new file mode 100644
index 000000000000..4a1a164121be
--- /dev/null
+++ b/include/vcl/scrbar.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 _SV_SCRBAR_HXX
+#define _SV_SCRBAR_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/ctrl.hxx>
+
+class AutoTimer;
+
+// -------------------
+// - ScrollBar-Types -
+// -------------------
+
+enum ScrollType { SCROLL_DONTKNOW, SCROLL_LINEUP, SCROLL_LINEDOWN,
+ SCROLL_PAGEUP, SCROLL_PAGEDOWN, SCROLL_DRAG, SCROLL_SET };
+
+// -------------
+// - ScrollBar -
+// -------------
+struct ImplScrollBarData;
+
+class VCL_DLLPUBLIC ScrollBar : public Control
+{
+private:
+ Rectangle maBtn1Rect;
+ Rectangle maBtn2Rect;
+ Rectangle maPage1Rect;
+ Rectangle maPage2Rect;
+ Rectangle maThumbRect;
+ ImplScrollBarData* mpData;
+ long mnStartPos;
+ long mnMouseOff;
+ long mnThumbPixRange;
+ long mnThumbPixPos;
+ long mnThumbPixSize;
+ long mnMinRange;
+ long mnMaxRange;
+ long mnThumbPos;
+ long mnVisibleSize;
+ long mnLineSize;
+ long mnPageSize;
+ long mnDelta;
+ sal_uInt16 mnDragDraw;
+ sal_uInt16 mnStateFlags;
+ ScrollType meScrollType;
+ ScrollType meDDScrollType;
+ sal_Bool mbCalcSize;
+ sal_Bool mbFullDrag;
+ Link maScrollHdl;
+ Link maEndScrollHdl;
+
+ SAL_DLLPRIVATE Rectangle* ImplFindPartRect( const Point& rPt );
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitStyle( WinBits nStyle );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE void ImplUpdateRects( sal_Bool bUpdate = sal_True );
+ SAL_DLLPRIVATE long ImplCalcThumbPos( long nPixPos );
+ SAL_DLLPRIVATE long ImplCalcThumbPosPix( long nPos );
+ SAL_DLLPRIVATE void ImplCalc( sal_Bool bUpdate = sal_True );
+ SAL_DLLPRIVATE void ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev );
+ using Window::ImplScroll;
+ SAL_DLLPRIVATE long ImplScroll( long nNewPos, sal_Bool bCallEndScroll );
+ SAL_DLLPRIVATE long ImplDoAction( sal_Bool bCallEndScroll );
+ SAL_DLLPRIVATE void ImplDoMouseAction( const Point& rPos, sal_Bool bCallAction = sal_True );
+ SAL_DLLPRIVATE void ImplInvert();
+ SAL_DLLPRIVATE sal_Bool ImplDrawNative( sal_uInt16 nDrawFlags );
+ SAL_DLLPRIVATE void ImplDragThumb( const Point& rMousePos );
+ SAL_DLLPRIVATE Size getCurrentCalcSize() const;
+ DECL_DLLPRIVATE_LINK( ImplTimerHdl, Timer* );
+ DECL_DLLPRIVATE_LINK( ImplAutoTimerHdl, void* );
+
+public:
+ ScrollBar( Window* pParent, WinBits nStyle = WB_VERT );
+ ScrollBar( Window* pParent, const ResId& rResId );
+ ~ScrollBar();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+ using Window::Scroll;
+ virtual void Scroll();
+ virtual void EndScroll();
+
+ long DoScroll( long nNewPos );
+ long DoScrollAction( ScrollType eScrollType );
+
+ void EnableDrag( sal_Bool bEnable = sal_True )
+ { mbFullDrag = bEnable; }
+ sal_Bool IsDragEnabled() const { return mbFullDrag; }
+
+ void SetRangeMin( long nNewRange );
+ long GetRangeMin() const { return mnMinRange; }
+ void SetRangeMax( long nNewRange );
+ long GetRangeMax() const { return mnMaxRange; }
+ void SetRange( const Range& rRange );
+ Range GetRange() const { return Range( GetRangeMin(), GetRangeMax() ); }
+ void SetThumbPos( long nThumbPos );
+ long GetThumbPos() const { return mnThumbPos; }
+ void SetLineSize( long nNewSize ) { mnLineSize = nNewSize; }
+ long GetLineSize() const { return mnLineSize; }
+ void SetPageSize( long nNewSize ) { mnPageSize = nNewSize; }
+ long GetPageSize() const { return mnPageSize; }
+ void SetVisibleSize( long nNewSize );
+ long GetVisibleSize() const { return mnVisibleSize; }
+
+ long GetDelta() const { return mnDelta; }
+ ScrollType GetType() const { return meScrollType; }
+
+ void SetScrollHdl( const Link& rLink ) { maScrollHdl = rLink; }
+ const Link& GetScrollHdl() const { return maScrollHdl; }
+ void SetEndScrollHdl( const Link& rLink ) { maEndScrollHdl = rLink; }
+ const Link& GetEndScrollHdl() const { return maEndScrollHdl; }
+
+ virtual Size GetOptimalSize() const;
+};
+
+// ----------------
+// - ScrollBarBox -
+// ----------------
+
+class VCL_DLLPUBLIC ScrollBarBox : public Window
+{
+private:
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings();
+
+public:
+ ScrollBarBox( Window* pParent, WinBits nStyle = 0 );
+
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+};
+
+#endif // _SV_SCRBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/seleng.hxx b/include/vcl/seleng.hxx
new file mode 100644
index 000000000000..f93e74a3ebf4
--- /dev/null
+++ b/include/vcl/seleng.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 _SV_SELENG_HXX
+#define _SV_SELENG_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/timer.hxx>
+#include <vcl/event.hxx>
+
+class Window;
+class CommandEvent;
+
+// Timerticks
+#define SELENG_DRAGDROP_TIMEOUT 400
+#define SELENG_AUTOREPEAT_INTERVAL 50
+#define SELENG_AUTOREPEAT_INTERVAL_MIN 25
+#define SELENG_AUTOREPEAT_INTERVAL_MAX 300
+
+enum SelectionMode { NO_SELECTION, SINGLE_SELECTION, RANGE_SELECTION, MULTIPLE_SELECTION };
+
+// ---------------
+// - FunctionSet -
+// ---------------
+
+class VCL_DLLPUBLIC FunctionSet
+{
+public:
+ virtual ~FunctionSet() = 0;
+
+ virtual void BeginDrag() = 0;
+
+ virtual void CreateAnchor() = 0; // Anker-Pos := Cursor-Pos
+ virtual void DestroyAnchor() = 0;
+
+ // move cursor, at the same time match cursor position to the selection
+ // starting at anchor. sal_True == Ok
+ virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel,
+ sal_Bool bDontSelectAtCursor = sal_False ) = 0;
+
+ virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel ) = 0;
+ virtual void DeselectAtPoint( const Point& rPointPixel ) = 0;
+ // delete anchor & deselect all
+ virtual void DeselectAll() = 0;
+};
+
+// -------------------
+// - SelectionEngine -
+// -------------------
+
+#define SELENG_DRG_ENAB 0x0001
+#define SELENG_IN_SEL 0x0002
+#define SELENG_IN_ADD 0x0004
+#define SELENG_ADD_ALW 0x0008
+#define SELENG_HAS_ANCH 0x0020
+#define SELENG_CMDEVT 0x0040
+#define SELENG_WAIT_UPEVT 0x0080
+#define SELENG_EXPANDONMOVE 0x0100
+
+class VCL_DLLPUBLIC SelectionEngine
+{
+private:
+ FunctionSet* pFunctionSet;
+ Window* pWin;
+ Rectangle aArea;
+ Timer aWTimer; // generate fake mouse moves
+ MouseEvent aLastMove;
+ SelectionMode eSelMode;
+ sal_uLong nUpdateInterval;
+ // sensitivity of mouse moves during a selection
+ sal_uInt16 nMouseSensitivity;
+ sal_uInt16 nLockedMods;
+ sal_uInt16 nFlags;
+ DECL_DLLPRIVATE_LINK( ImpWatchDog, void* );
+
+ inline sal_Bool ShouldDeselect( sal_Bool bModifierKey1 ) const;
+ // determines to deselect or not when Ctrl-key is pressed on CursorPosChanging
+public:
+
+ SelectionEngine( Window* pWindow,
+ FunctionSet* pFunctions = NULL,
+ sal_uLong nAutoRepeatInterval = SELENG_AUTOREPEAT_INTERVAL );
+ ~SelectionEngine();
+
+ // sal_True: Event was processed by Selection Engine
+ sal_Bool SelMouseButtonDown( const MouseEvent& rMEvt );
+ sal_Bool SelMouseButtonUp( const MouseEvent& rMEvt );
+ sal_Bool SelMouseMove( const MouseEvent& rMEvt );
+
+ // Keyboard
+ void CursorPosChanging( sal_Bool bShift, sal_Bool bMod1 );
+
+ // is needed to generate a Move event via a Timer
+ // when the mouse is outside the area
+ void SetVisibleArea( const Rectangle rNewArea )
+ { aArea = rNewArea; }
+ const Rectangle& GetVisibleArea() const { return aArea; }
+
+ void SetAddMode( sal_Bool);
+ sal_Bool IsAddMode() const;
+
+ void AddAlways( sal_Bool bOn );
+ sal_Bool IsAlwaysAdding() const;
+
+ void EnableDrag( sal_Bool bOn );
+
+ void SetSelectionMode( SelectionMode eMode );
+ SelectionMode GetSelectionMode() const { return eSelMode; }
+
+ void SetFunctionSet( FunctionSet* pFuncs )
+ { pFunctionSet = pFuncs; }
+ const FunctionSet* GetFunctionSet() const { return pFunctionSet; }
+
+ void SetMouseSensitivity( sal_uInt16 nSensitivity )
+ { nMouseSensitivity = nSensitivity; }
+ sal_uInt16 GetMouseSensitivity() const
+ { return nMouseSensitivity; }
+
+ const Point& GetMousePosPixel() const
+ { return aLastMove.GetPosPixel(); }
+ const MouseEvent& GetMouseEvent() const { return aLastMove; }
+
+ void SetWindow( Window*);
+ Window* GetWindow() const { return pWin; }
+
+ void LockModifiers( sal_uInt16 nModifiers )
+ { nLockedMods = nModifiers; }
+ sal_uInt16 GetLockedModifiers() const { return nLockedMods; }
+
+ sal_Bool IsInSelection() const;
+ void Reset();
+
+ void Command( const CommandEvent& rCEvt );
+
+ sal_Bool HasAnchor() const;
+ void SetAnchor( sal_Bool bAnchor );
+
+ void SetUpdateInterval( sal_uLong nInterval );
+
+ // wird im Ctor eingeschaltet
+ void ExpandSelectionOnMouseMove( sal_Bool bExpand = sal_True )
+ {
+ if( bExpand )
+ nFlags |= SELENG_EXPANDONMOVE;
+ else
+ nFlags &= ~SELENG_EXPANDONMOVE;
+ }
+};
+
+inline sal_Bool SelectionEngine::IsAddMode() const
+{
+ if ( nFlags & (SELENG_IN_ADD | SELENG_ADD_ALW) )
+ return sal_True;
+ else
+ return sal_False;
+}
+
+inline void SelectionEngine::SetAddMode( sal_Bool bNewMode )
+{
+ if ( bNewMode )
+ nFlags |= SELENG_IN_ADD;
+ else
+ nFlags &= (~SELENG_IN_ADD);
+}
+
+inline void SelectionEngine::EnableDrag( sal_Bool bOn )
+{
+ if ( bOn )
+ nFlags |= SELENG_DRG_ENAB;
+ else
+ nFlags &= (~SELENG_DRG_ENAB);
+}
+
+inline void SelectionEngine::AddAlways( sal_Bool bOn )
+{
+ if( bOn )
+ nFlags |= SELENG_ADD_ALW;
+ else
+ nFlags &= (~SELENG_ADD_ALW);
+}
+
+inline sal_Bool SelectionEngine::IsAlwaysAdding() const
+{
+ if ( nFlags & SELENG_ADD_ALW )
+ return sal_True;
+ else
+ return sal_False;
+}
+
+inline sal_Bool SelectionEngine::IsInSelection() const
+{
+ if ( nFlags & SELENG_IN_SEL )
+ return sal_True;
+ else
+ return sal_False;
+}
+
+inline sal_Bool SelectionEngine::HasAnchor() const
+{
+ if ( nFlags & SELENG_HAS_ANCH )
+ return sal_True;
+ else
+ return sal_False;
+}
+
+inline void SelectionEngine::SetAnchor( sal_Bool bAnchor )
+{
+ if ( bAnchor )
+ nFlags |= SELENG_HAS_ANCH;
+ else
+ nFlags &= (~SELENG_HAS_ANCH);
+}
+
+#endif // _SV_SELENG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
new file mode 100644
index 000000000000..19dc20f3ba12
--- /dev/null
+++ b/include/vcl/settings.hxx
@@ -0,0 +1,1104 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_SETTINGS_HXX
+#define _SV_SETTINGS_HXX
+
+#include "tools/solar.h"
+#include "vcl/dllapi.h"
+#include "tools/color.hxx"
+#include "vcl/bitmapex.hxx"
+#include "vcl/font.hxx"
+#include "vcl/accel.hxx"
+#include "vcl/wall.hxx"
+#include <i18nlangtag/languagetag.hxx>
+#include <unotools/syslocale.hxx>
+
+class CollatorWrapper;
+class LocaleDataWrapper;
+
+namespace vcl {
+ class I18nHelper;
+}
+
+// -----------------
+// - ImplMouseData -
+// -----------------
+
+class ImplMouseData
+{
+ friend class MouseSettings;
+
+ ImplMouseData();
+ ImplMouseData( const ImplMouseData& rData );
+
+private:
+ sal_uLong mnRefCount;
+ sal_uLong mnOptions;
+ sal_uLong mnDoubleClkTime;
+ long mnDoubleClkWidth;
+ long mnDoubleClkHeight;
+ long mnStartDragWidth;
+ long mnStartDragHeight;
+ sal_uInt16 mnStartDragCode;
+ sal_uInt16 mnDragMoveCode;
+ sal_uInt16 mnDragCopyCode;
+ sal_uInt16 mnDragLinkCode;
+ sal_uInt16 mnContextMenuCode;
+ sal_uInt16 mnContextMenuClicks;
+ sal_Bool mbContextMenuDown;
+ sal_uLong mnScrollRepeat;
+ sal_uLong mnButtonStartRepeat;
+ sal_uLong mnButtonRepeat;
+ sal_uLong mnActionDelay;
+ sal_uLong mnMenuDelay;
+ sal_uLong mnFollow;
+ sal_uInt16 mnMiddleButtonAction;
+ sal_uInt16 mnWheelBehavior;
+};
+
+// -----------------
+// - MouseSettings -
+// -----------------
+
+#define MOUSE_OPTION_AUTOFOCUS ((sal_uLong)0x00000001)
+#define MOUSE_OPTION_AUTOCENTERPOS ((sal_uLong)0x00000002)
+#define MOUSE_OPTION_AUTODEFBTNPOS ((sal_uLong)0x00000004)
+
+#define MOUSE_FOLLOW_MENU ((sal_uLong)0x00000001)
+#define MOUSE_FOLLOW_DDLIST ((sal_uLong)0x00000002)
+
+#define MOUSE_MIDDLE_NOTHING ((sal_uInt16)0)
+#define MOUSE_MIDDLE_AUTOSCROLL ((sal_uInt16)1)
+#define MOUSE_MIDDLE_PASTESELECTION ((sal_uInt16)2)
+
+#define MOUSE_WHEEL_DISABLE ((sal_uInt16)0)
+#define MOUSE_WHEEL_FOCUS_ONLY ((sal_uInt16)1)
+#define MOUSE_WHEEL_ALWAYS ((sal_uInt16)2)
+
+class VCL_DLLPUBLIC MouseSettings
+{
+ void CopyData();
+
+private:
+ ImplMouseData* mpData;
+
+public:
+ MouseSettings();
+ MouseSettings( const MouseSettings& rSet );
+ ~MouseSettings();
+
+ void SetOptions( sal_uLong nOptions )
+ { CopyData(); mpData->mnOptions = nOptions; }
+ sal_uLong GetOptions() const
+ { return mpData->mnOptions; }
+
+ void SetDoubleClickTime( sal_uLong nDoubleClkTime )
+ { CopyData(); mpData->mnDoubleClkTime = nDoubleClkTime; }
+ sal_uLong GetDoubleClickTime() const
+ { return mpData->mnDoubleClkTime; }
+ void SetDoubleClickWidth( long nDoubleClkWidth )
+ { CopyData(); mpData->mnDoubleClkWidth = nDoubleClkWidth; }
+ long GetDoubleClickWidth() const
+ { return mpData->mnDoubleClkWidth; }
+ void SetDoubleClickHeight( long nDoubleClkHeight )
+ { CopyData(); mpData->mnDoubleClkHeight = nDoubleClkHeight; }
+ long GetDoubleClickHeight() const
+ { return mpData->mnDoubleClkHeight; }
+
+ void SetStartDragWidth( long nDragWidth )
+ { CopyData(); mpData->mnStartDragWidth = nDragWidth; }
+ long GetStartDragWidth() const
+ { return mpData->mnStartDragWidth; }
+ void SetStartDragHeight( long nDragHeight )
+ { CopyData(); mpData->mnStartDragHeight = nDragHeight; }
+ long GetStartDragHeight() const
+ { return mpData->mnStartDragHeight; }
+ void SetStartDragCode( sal_uInt16 nCode )
+ { CopyData(); mpData->mnStartDragCode = nCode; }
+ sal_uInt16 GetStartDragCode() const
+ { return mpData->mnStartDragCode; }
+ void SetDragMoveCode( sal_uInt16 nCode )
+ { CopyData(); mpData->mnDragMoveCode = nCode; }
+ sal_uInt16 GetDragMoveCode() const
+ { return mpData->mnDragMoveCode; }
+ void SetDragCopyCode( sal_uInt16 nCode )
+ { CopyData(); mpData->mnDragCopyCode = nCode; }
+ sal_uInt16 GetDragCopyCode() const
+ { return mpData->mnDragCopyCode; }
+ void SetDragLinkCode( sal_uInt16 nCode )
+ { CopyData(); mpData->mnDragLinkCode = nCode; }
+ sal_uInt16 GetDragLinkCode() const
+ { return mpData->mnDragLinkCode; }
+
+ void SetContextMenuCode( sal_uInt16 nCode )
+ { CopyData(); mpData->mnContextMenuCode = nCode; }
+ sal_uInt16 GetContextMenuCode() const
+ { return mpData->mnContextMenuCode; }
+ void SetContextMenuClicks( sal_uInt16 nClicks )
+ { CopyData(); mpData->mnContextMenuClicks = nClicks; }
+ sal_uInt16 GetContextMenuClicks() const
+ { return mpData->mnContextMenuClicks; }
+ void SetContextMenuDown( sal_Bool bDown )
+ { CopyData(); mpData->mbContextMenuDown = bDown; }
+ sal_Bool GetContextMenuDown() const
+ { return mpData->mbContextMenuDown; }
+
+ void SetScrollRepeat( sal_uLong nRepeat )
+ { CopyData(); mpData->mnScrollRepeat = nRepeat; }
+ sal_uLong GetScrollRepeat() const
+ { return mpData->mnScrollRepeat; }
+ void SetButtonStartRepeat( sal_uLong nRepeat )
+ { CopyData(); mpData->mnButtonStartRepeat = nRepeat; }
+ sal_uLong GetButtonStartRepeat() const
+ { return mpData->mnButtonStartRepeat; }
+ void SetButtonRepeat( sal_uLong nRepeat )
+ { CopyData(); mpData->mnButtonRepeat = nRepeat; }
+ sal_uLong GetButtonRepeat() const
+ { return mpData->mnButtonRepeat; }
+ void SetActionDelay( sal_uLong nDelay )
+ { CopyData(); mpData->mnActionDelay = nDelay; }
+ sal_uLong GetActionDelay() const
+ { return mpData->mnActionDelay; }
+ void SetMenuDelay( sal_uLong nDelay )
+ { CopyData(); mpData->mnMenuDelay = nDelay; }
+ sal_uLong GetMenuDelay() const
+ { return mpData->mnMenuDelay; }
+
+ void SetFollow( sal_uLong nFollow )
+ { CopyData(); mpData->mnFollow = nFollow; }
+ sal_uLong GetFollow() const
+ { return mpData->mnFollow; }
+
+ void SetMiddleButtonAction( sal_uInt16 nAction )
+ { CopyData(); mpData->mnMiddleButtonAction = nAction; }
+ sal_uInt16 GetMiddleButtonAction() const
+ { return mpData->mnMiddleButtonAction; }
+
+ void SetWheelBehavior( sal_uInt16 nBehavior )
+ { CopyData(); mpData->mnWheelBehavior = nBehavior; }
+ sal_uInt16 GetWheelBehavior() const
+ { return mpData->mnWheelBehavior; }
+
+ const MouseSettings& operator =( const MouseSettings& rSet );
+
+ sal_Bool operator ==( const MouseSettings& rSet ) const;
+ sal_Bool operator !=( const MouseSettings& rSet ) const
+ { return !(*this == rSet); }
+};
+
+struct DialogStyle
+{
+ int content_area_border;
+ int content_area_spacing;
+ int button_spacing;
+ int action_area_border;
+ DialogStyle()
+ : content_area_border(2)
+ , content_area_spacing(0)
+ , button_spacing(6)
+ , action_area_border(5)
+ {}
+};
+
+struct FrameStyle
+{
+ int left;
+ int right;
+ int top;
+ int bottom;
+ FrameStyle()
+ : left(2)
+ , right(2)
+ , top(2)
+ , bottom(2)
+ {}
+};
+
+// -----------------
+// - ImplStyleData -
+// -----------------
+
+class ImplStyleData
+{
+ friend class StyleSettings;
+
+ ImplStyleData();
+ ImplStyleData( const ImplStyleData& rData );
+ void SetStandardStyles();
+
+private:
+ sal_uLong mnRefCount;
+
+ Color maActiveBorderColor;
+ Color maActiveColor;
+ Color maActiveColor2;
+ Color maActiveTextColor;
+ Color maButtonTextColor;
+ Color maButtonRolloverTextColor;
+ Color maCheckedColor;
+ Color maDarkShadowColor;
+ Color maDeactiveBorderColor;
+ Color maDeactiveColor;
+ Color maDeactiveColor2;
+ Color maDeactiveTextColor;
+ Color maDialogColor;
+ Color maDialogTextColor;
+ Color maDisableColor;
+ Color maFaceColor;
+ Color maFieldColor;
+ Color maFieldTextColor;
+ Color maFieldRolloverTextColor;
+ Color maFontColor;
+ Color maGroupTextColor;
+ Color maHelpColor;
+ Color maHelpTextColor;
+ Color maHighlightColor;
+ Color maHighlightLinkColor;
+ Color maHighlightTextColor;
+ Color maInfoTextColor;
+ Color maLabelTextColor;
+ Color maLightBorderColor;
+ Color maLightColor;
+ Color maLinkColor;
+ Color maMenuBarColor;
+ Color maMenuBorderColor;
+ Color maMenuColor;
+ Color maMenuHighlightColor;
+ Color maMenuHighlightTextColor;
+ Color maMenuTextColor;
+ Color maMenuBarTextColor;
+ Color maMonoColor;
+ Color maRadioCheckTextColor;
+ Color maShadowColor;
+ Color maVisitedLinkColor;
+ Color maWindowColor;
+ Color maWindowTextColor;
+ Color maWorkspaceColor;
+ Color maActiveTabColor;
+ Color maInactiveTabColor;
+ Font maAppFont;
+ Font maHelpFont;
+ Font maTitleFont;
+ Font maFloatTitleFont;
+ Font maMenuFont;
+ Font maToolFont;
+ Font maLabelFont;
+ Font maInfoFont;
+ Font maRadioCheckFont;
+ Font maPushButtonFont;
+ Font maFieldFont;
+ Font maIconFont;
+ Font maGroupFont;
+ long mnBorderSize;
+ long mnTitleHeight;
+ long mnFloatTitleHeight;
+ long mnTearOffTitleHeight;
+ long mnScrollBarSize;
+ long mnSplitSize;
+ long mnSpinSize;
+ long mnCursorSize;
+ long mnMenuBarHeight;
+ long mnIconHorzSpace;
+ long mnIconVertSpace;
+ long mnAntialiasedMin;
+ sal_uLong mnCursorBlinkTime;
+ sal_uLong mnDragFullOptions;
+ sal_uLong mnAnimationOptions;
+ sal_uLong mnSelectionOptions;
+ sal_uLong mnLogoDisplayTime;
+ sal_uLong mnDisplayOptions;
+ sal_uLong mnToolbarIconSize;
+ sal_uLong mnUseFlatMenus;
+ sal_uLong mnOptions;
+ sal_uInt16 mnScreenZoom;
+ sal_uInt16 mnScreenFontZoom;
+ sal_uInt16 mnHighContrast;
+ sal_uInt16 mnUseSystemUIFonts;
+ sal_uInt16 mnAutoMnemonic;
+ sal_uInt16 mnUseImagesInMenus;
+ sal_uLong mnUseFlatBorders;
+ sal_Bool mbPreferredUseImagesInMenus;
+ long mnMinThumbSize;
+ sal_uLong mnSymbolsStyle;
+ sal_uLong mnPreferredSymbolsStyle;
+ sal_uInt16 mnSkipDisabledInMenus;
+ sal_Bool mbHideDisabledMenuItems;
+ sal_Bool mbAcceleratorsInContextMenus;
+ //mbPrimaryButtonWarpsSlider == true for "jump to here" behavior for primary button, otherwise
+ //primary means scroll by single page. Secondary button takes the alternative behaviour
+ sal_Bool mbPrimaryButtonWarpsSlider;
+ Wallpaper maWorkspaceGradient;
+ DialogStyle maDialogStyle;
+ FrameStyle maFrameStyle;
+ const void* mpFontOptions;
+
+ OUString maPersonaHeaderFooter; ///< Cache the settings to detect changes.
+
+ BitmapEx maPersonaHeaderBitmap; ///< Cache the header bitmap.
+ BitmapEx maPersonaFooterBitmap; ///< Cache the footer bitmap.
+};
+
+#define DEFAULT_WORKSPACE_GRADIENT_START_COLOR Color( 0xa3, 0xae, 0xb8 )
+#define DEFAULT_WORKSPACE_GRADIENT_END_COLOR Color( 0x73, 0x7e, 0x88 )
+
+// -----------------
+// - StyleSettings -
+// -----------------
+
+#define STYLE_OPTION_MONO ((sal_uLong)0x00000001)
+#define STYLE_OPTION_COLOR ((sal_uLong)0x00000002)
+#define STYLE_OPTION_FLAT ((sal_uLong)0x00000004)
+#define STYLE_OPTION_GREAT ((sal_uLong)0x00000008)
+#define STYLE_OPTION_HIGHLIGHT ((sal_uLong)0x00000010)
+#define STYLE_OPTION_ADVANCEDUSER ((sal_uLong)0x00000020)
+#define STYLE_OPTION_SCROLLARROW ((sal_uLong)0x00000040)
+#define STYLE_OPTION_SPINARROW ((sal_uLong)0x00000080)
+#define STYLE_OPTION_SPINUPDOWN ((sal_uLong)0x00000100)
+#define STYLE_OPTION_NOMNEMONICS ((sal_uLong)0x00000200)
+
+#define DRAGFULL_OPTION_WINDOWMOVE ((sal_uLong)0x00000001)
+#define DRAGFULL_OPTION_WINDOWSIZE ((sal_uLong)0x00000002)
+#define DRAGFULL_OPTION_OBJECTMOVE ((sal_uLong)0x00000004)
+#define DRAGFULL_OPTION_OBJECTSIZE ((sal_uLong)0x00000008)
+#define DRAGFULL_OPTION_DOCKING ((sal_uLong)0x00000010)
+#define DRAGFULL_OPTION_SPLIT ((sal_uLong)0x00000020)
+#define DRAGFULL_OPTION_SCROLL ((sal_uLong)0x00000040)
+
+#define LOGO_DISPLAYTIME_STARTTIME ((sal_uLong)0xFFFFFFFF)
+
+#define SELECTION_OPTION_WORD ((sal_uLong)0x00000001)
+#define SELECTION_OPTION_FOCUS ((sal_uLong)0x00000002)
+#define SELECTION_OPTION_INVERT ((sal_uLong)0x00000004)
+#define SELECTION_OPTION_SHOWFIRST ((sal_uLong)0x00000008)
+
+#define DISPLAY_OPTION_AA_DISABLE ((sal_uLong)0x00000001)
+
+#define STYLE_RADIOBUTTON_MONO ((sal_uInt16)0x0001) // legacy
+#define STYLE_CHECKBOX_MONO ((sal_uInt16)0x0001) // legacy
+
+#define STYLE_TOOLBAR_ICONSIZE_UNKNOWN ((sal_uLong)0)
+#define STYLE_TOOLBAR_ICONSIZE_SMALL ((sal_uLong)1)
+#define STYLE_TOOLBAR_ICONSIZE_LARGE ((sal_uLong)2)
+
+#define STYLE_SYMBOLS_AUTO ((sal_uLong)0)
+#define STYLE_SYMBOLS_DEFAULT ((sal_uLong)1)
+#define STYLE_SYMBOLS_HICONTRAST ((sal_uLong)2)
+#define STYLE_SYMBOLS_INDUSTRIAL ((sal_uLong)3)
+#define STYLE_SYMBOLS_CRYSTAL ((sal_uLong)4)
+#define STYLE_SYMBOLS_TANGO ((sal_uLong)5)
+#define STYLE_SYMBOLS_OXYGEN ((sal_uLong)6)
+#define STYLE_SYMBOLS_CLASSIC ((sal_uLong)7)
+#define STYLE_SYMBOLS_HUMAN ((sal_uLong)8)
+#define STYLE_SYMBOLS_TANGO_TESTING ((sal_uLong)9)
+#define STYLE_SYMBOLS_THEMES_MAX ((sal_uLong)10)
+
+#define STYLE_MENUIMAGES_OFF ((sal_uInt16)0)
+#define STYLE_MENUIMAGES_ON ((sal_uInt16)1)
+#define STYLE_MENUIMAGES_AUTO ((sal_uInt16)2)
+
+#define STYLE_CURSOR_NOBLINKTIME ((sal_uLong)0xFFFFFFFF)
+
+class VCL_DLLPUBLIC StyleSettings
+{
+ void CopyData();
+
+private:
+ ImplStyleData* mpData;
+
+public:
+ StyleSettings();
+ StyleSettings( const StyleSettings& rSet );
+ ~StyleSettings();
+
+ void Set3DColors( const Color& rColor );
+ void SetFaceColor( const Color& rColor )
+ { CopyData(); mpData->maFaceColor = rColor; }
+ const Color& GetFaceColor() const
+ { return mpData->maFaceColor; }
+ Color GetFaceGradientColor() const;
+ Color GetSeparatorColor() const;
+ void SetCheckedColor( const Color& rColor )
+ { CopyData(); mpData->maCheckedColor = rColor; }
+ void SetCheckedColorSpecialCase( );
+ const Color& GetCheckedColor() const
+ { return mpData->maCheckedColor; }
+ void SetLightColor( const Color& rColor )
+ { CopyData(); mpData->maLightColor = rColor; }
+ const Color& GetLightColor() const
+ { return mpData->maLightColor; }
+ void SetLightBorderColor( const Color& rColor )
+ { CopyData(); mpData->maLightBorderColor = rColor; }
+ const Color& GetLightBorderColor() const
+ { return mpData->maLightBorderColor; }
+ void SetShadowColor( const Color& rColor )
+ { CopyData(); mpData->maShadowColor = rColor; }
+ const Color& GetShadowColor() const
+ { return mpData->maShadowColor; }
+ void SetDarkShadowColor( const Color& rColor )
+ { CopyData(); mpData->maDarkShadowColor = rColor; }
+ const Color& GetDarkShadowColor() const
+ { return mpData->maDarkShadowColor; }
+ void SetButtonTextColor( const Color& rColor )
+ { CopyData(); mpData->maButtonTextColor = rColor; }
+ const Color& GetButtonTextColor() const
+ { return mpData->maButtonTextColor; }
+ void SetButtonRolloverTextColor( const Color& rColor )
+ { CopyData(); mpData->maButtonRolloverTextColor = rColor; }
+ const Color& GetButtonRolloverTextColor() const
+ { return mpData->maButtonRolloverTextColor; }
+ void SetRadioCheckTextColor( const Color& rColor )
+ { CopyData(); mpData->maRadioCheckTextColor = rColor; }
+ const Color& GetRadioCheckTextColor() const
+ { return mpData->maRadioCheckTextColor; }
+ void SetGroupTextColor( const Color& rColor )
+ { CopyData(); mpData->maGroupTextColor = rColor; }
+ const Color& GetGroupTextColor() const
+ { return mpData->maGroupTextColor; }
+ void SetLabelTextColor( const Color& rColor )
+ { CopyData(); mpData->maLabelTextColor = rColor; }
+ const Color& GetLabelTextColor() const
+ { return mpData->maLabelTextColor; }
+ void SetInfoTextColor( const Color& rColor )
+ { CopyData(); mpData->maInfoTextColor = rColor; }
+ const Color& GetInfoTextColor() const
+ { return mpData->maInfoTextColor; }
+ void SetWindowColor( const Color& rColor )
+ { CopyData(); mpData->maWindowColor = rColor; }
+ const Color& GetWindowColor() const
+ { return mpData->maWindowColor; }
+ void SetWindowTextColor( const Color& rColor )
+ { CopyData(); mpData->maWindowTextColor = rColor; }
+ const Color& GetWindowTextColor() const
+ { return mpData->maWindowTextColor; }
+ void SetDialogColor( const Color& rColor )
+ { CopyData(); mpData->maDialogColor = rColor; }
+ const Color& GetDialogColor() const
+ { return mpData->maDialogColor; }
+ void SetDialogTextColor( const Color& rColor )
+ { CopyData(); mpData->maDialogTextColor = rColor; }
+ const Color& GetDialogTextColor() const
+ { return mpData->maDialogTextColor; }
+ void SetWorkspaceColor( const Color& rColor )
+ { CopyData(); mpData->maWorkspaceColor = rColor; }
+ const Color& GetWorkspaceColor() const
+ { return mpData->maWorkspaceColor; }
+ void SetFieldColor( const Color& rColor )
+ { CopyData(); mpData->maFieldColor = rColor; }
+ const Color& GetFieldColor() const
+ { return mpData->maFieldColor; }
+ void SetFieldTextColor( const Color& rColor )
+ { CopyData(); mpData->maFieldTextColor = rColor; }
+ const Color& GetFieldTextColor() const
+ { return mpData->maFieldTextColor; }
+ void SetFieldRolloverTextColor( const Color& rColor )
+ { CopyData(); mpData->maFieldRolloverTextColor = rColor; }
+ const Color& GetFieldRolloverTextColor() const
+ { return mpData->maFieldRolloverTextColor; }
+ void SetActiveColor( const Color& rColor )
+ { CopyData(); mpData->maActiveColor = rColor; }
+ const Color& GetActiveColor() const
+ { return mpData->maActiveColor; }
+ void SetActiveColor2( const Color& rColor )
+ { CopyData(); mpData->maActiveColor2 = rColor; }
+ const Color& GetActiveColor2() const
+ { return mpData->maActiveColor2; }
+ void SetActiveTextColor( const Color& rColor )
+ { CopyData(); mpData->maActiveTextColor = rColor; }
+ const Color& GetActiveTextColor() const
+ { return mpData->maActiveTextColor; }
+ void SetActiveBorderColor( const Color& rColor )
+ { CopyData(); mpData->maActiveBorderColor = rColor; }
+ const Color& GetActiveBorderColor() const
+ { return mpData->maActiveBorderColor; }
+ void SetDeactiveColor( const Color& rColor )
+ { CopyData(); mpData->maDeactiveColor = rColor; }
+ const Color& GetDeactiveColor() const
+ { return mpData->maDeactiveColor; }
+ void SetDeactiveColor2( const Color& rColor )
+ { CopyData(); mpData->maDeactiveColor2 = rColor; }
+ const Color& GetDeactiveColor2() const
+ { return mpData->maDeactiveColor2; }
+ void SetDeactiveTextColor( const Color& rColor )
+ { CopyData(); mpData->maDeactiveTextColor = rColor; }
+ const Color& GetDeactiveTextColor() const
+ { return mpData->maDeactiveTextColor; }
+ void SetDeactiveBorderColor( const Color& rColor )
+ { CopyData(); mpData->maDeactiveBorderColor = rColor; }
+ const Color& GetDeactiveBorderColor() const
+ { return mpData->maDeactiveBorderColor; }
+ void SetHighlightColor( const Color& rColor )
+ { CopyData(); mpData->maHighlightColor = rColor; }
+ const Color& GetHighlightColor() const
+ { return mpData->maHighlightColor; }
+ void SetHighlightTextColor( const Color& rColor )
+ { CopyData(); mpData->maHighlightTextColor = rColor; }
+ const Color& GetHighlightTextColor() const
+ { return mpData->maHighlightTextColor; }
+ void SetDisableColor( const Color& rColor )
+ { CopyData(); mpData->maDisableColor = rColor; }
+ const Color& GetDisableColor() const
+ { return mpData->maDisableColor; }
+ void SetHelpColor( const Color& rColor )
+ { CopyData(); mpData->maHelpColor = rColor; }
+ const Color& GetHelpColor() const
+ { return mpData->maHelpColor; }
+ void SetHelpTextColor( const Color& rColor )
+ { CopyData(); mpData->maHelpTextColor = rColor; }
+ const Color& GetHelpTextColor() const
+ { return mpData->maHelpTextColor; }
+ void SetMenuColor( const Color& rColor )
+ { CopyData(); mpData->maMenuColor = rColor; }
+ const Color& GetMenuColor() const
+ { return mpData->maMenuColor; }
+ void SetMenuBarColor( const Color& rColor )
+ { CopyData(); mpData->maMenuBarColor = rColor; }
+ const Color& GetMenuBarColor() const
+ { return mpData->maMenuBarColor; }
+ void SetMenuBorderColor( const Color& rColor )
+ { CopyData(); mpData->maMenuBorderColor = rColor; }
+ const Color& GetMenuBorderColor() const
+ { return mpData->maMenuBorderColor; }
+ void SetMenuTextColor( const Color& rColor )
+ { CopyData(); mpData->maMenuTextColor = rColor; }
+ const Color& GetMenuTextColor() const
+ { return mpData->maMenuTextColor; }
+ void SetMenuBarTextColor( const Color& rColor )
+ { CopyData(); mpData->maMenuBarTextColor = rColor; }
+ const Color& GetMenuBarTextColor() const
+ { return mpData->maMenuBarTextColor; }
+ void SetMenuHighlightColor( const Color& rColor )
+ { CopyData(); mpData->maMenuHighlightColor = rColor; }
+ const Color& GetMenuHighlightColor() const
+ { return mpData->maMenuHighlightColor; }
+ void SetMenuHighlightTextColor( const Color& rColor )
+ { CopyData(); mpData->maMenuHighlightTextColor = rColor; }
+ const Color& GetMenuHighlightTextColor() const
+ { return mpData->maMenuHighlightTextColor; }
+ void SetLinkColor( const Color& rColor )
+ { CopyData(); mpData->maLinkColor = rColor; }
+ const Color& GetLinkColor() const
+ { return mpData->maLinkColor; }
+ void SetVisitedLinkColor( const Color& rColor )
+ { CopyData(); mpData->maVisitedLinkColor = rColor; }
+ const Color& GetVisitedLinkColor() const
+ { return mpData->maVisitedLinkColor; }
+ void SetHighlightLinkColor( const Color& rColor )
+ { CopyData(); mpData->maHighlightLinkColor = rColor; }
+ const Color& GetHighlightLinkColor() const
+ { return mpData->maHighlightLinkColor; }
+
+ void SetMonoColor( const Color& rColor )
+ { CopyData(); mpData->maMonoColor = rColor; }
+ const Color& GetMonoColor() const
+ { return mpData->maMonoColor; }
+
+ void SetActiveTabColor( const Color& rColor )
+ { CopyData(); mpData->maActiveTabColor = rColor; }
+ const Color& GetActiveTabColor() const
+ { return mpData->maActiveTabColor; }
+ void SetInactiveTabColor( const Color& rColor )
+ { CopyData(); mpData->maInactiveTabColor = rColor; }
+ const Color& GetInactiveTabColor() const
+ { return mpData->maInactiveTabColor; }
+
+ void SetHighContrastMode( sal_Bool bHighContrast )
+ { CopyData(); mpData->mnHighContrast = bHighContrast; }
+ sal_Bool GetHighContrastMode() const
+ { return (sal_Bool) mpData->mnHighContrast; }
+ void SetUseSystemUIFonts( sal_Bool bUseSystemUIFonts )
+ { CopyData(); mpData->mnUseSystemUIFonts = bUseSystemUIFonts; }
+ sal_Bool GetUseSystemUIFonts() const
+ { return (sal_Bool) mpData->mnUseSystemUIFonts; }
+ void SetUseFlatBorders( sal_Bool bUseFlatBorders )
+ { CopyData(); mpData->mnUseFlatBorders = bUseFlatBorders; }
+ sal_Bool GetUseFlatBorders() const
+ { return (sal_Bool) mpData->mnUseFlatBorders; }
+ void SetUseFlatMenus( sal_Bool bUseFlatMenus )
+ { CopyData(); mpData->mnUseFlatMenus = bUseFlatMenus; }
+ sal_Bool GetUseFlatMenus() const
+ { return (sal_Bool) mpData->mnUseFlatMenus; }
+ void SetUseImagesInMenus( sal_Bool bUseImagesInMenus )
+ { CopyData(); mpData->mnUseImagesInMenus = bUseImagesInMenus; }
+ sal_Bool GetUseImagesInMenus() const;
+ void SetPreferredUseImagesInMenus( sal_Bool bPreferredUseImagesInMenus )
+ { CopyData(); mpData->mbPreferredUseImagesInMenus = bPreferredUseImagesInMenus; }
+ sal_Bool GetPreferredUseImagesInMenus() const
+ { return mpData->mbPreferredUseImagesInMenus; }
+ void SetSkipDisabledInMenus( sal_Bool bSkipDisabledInMenus )
+ { CopyData(); mpData->mnSkipDisabledInMenus = bSkipDisabledInMenus; }
+ sal_Bool GetSkipDisabledInMenus() const
+ { return (sal_Bool) mpData->mnSkipDisabledInMenus; }
+ void SetHideDisabledMenuItems( sal_Bool bHideDisabledMenuItems )
+ { CopyData(); mpData->mbHideDisabledMenuItems = bHideDisabledMenuItems; }
+ sal_Bool GetHideDisabledMenuItems() const
+ { return mpData->mbHideDisabledMenuItems; }
+ void SetAcceleratorsInContextMenus( sal_Bool bAcceleratorsInContextMenus )
+ { CopyData(); mpData->mbAcceleratorsInContextMenus = bAcceleratorsInContextMenus; }
+ sal_Bool GetAcceleratorsInContextMenus() const
+ { return mpData->mbAcceleratorsInContextMenus; }
+ void SetPrimaryButtonWarpsSlider( sal_Bool bPrimaryButtonWarpsSlider )
+ { CopyData(); mpData->mbPrimaryButtonWarpsSlider = bPrimaryButtonWarpsSlider; }
+ sal_Bool GetPrimaryButtonWarpsSlider() const
+ { return mpData->mbPrimaryButtonWarpsSlider; }
+
+ void SetCairoFontOptions( const void *pOptions )
+ { CopyData(); mpData->mpFontOptions = pOptions; }
+ const void* GetCairoFontOptions() const
+ { return mpData->mpFontOptions; }
+
+ void SetAppFont( const Font& rFont )
+ { CopyData(); mpData->maAppFont = rFont; }
+ const Font& GetAppFont() const
+ { return mpData->maAppFont; }
+ void SetHelpFont( const Font& rFont )
+ { CopyData(); mpData->maHelpFont = rFont; }
+ const Font& GetHelpFont() const
+ { return mpData->maHelpFont; }
+ void SetTitleFont( const Font& rFont )
+ { CopyData(); mpData->maTitleFont = rFont; }
+ const Font& GetTitleFont() const
+ { return mpData->maTitleFont; }
+ void SetFloatTitleFont( const Font& rFont )
+ { CopyData(); mpData->maFloatTitleFont = rFont; }
+ const Font& GetFloatTitleFont() const
+ { return mpData->maFloatTitleFont; }
+ void SetMenuFont( const Font& rFont )
+ { CopyData(); mpData->maMenuFont = rFont; }
+ const Font& GetMenuFont() const
+ { return mpData->maMenuFont; }
+ void SetToolFont( const Font& rFont )
+ { CopyData(); mpData->maToolFont = rFont; }
+ const Font& GetToolFont() const
+ { return mpData->maToolFont; }
+ void SetGroupFont( const Font& rFont )
+ { CopyData(); mpData->maGroupFont = rFont; }
+ const Font& GetGroupFont() const
+ { return mpData->maGroupFont; }
+ void SetLabelFont( const Font& rFont )
+ { CopyData(); mpData->maLabelFont = rFont; }
+ const Font& GetLabelFont() const
+ { return mpData->maLabelFont; }
+ void SetInfoFont( const Font& rFont )
+ { CopyData(); mpData->maInfoFont = rFont; }
+ const Font& GetInfoFont() const
+ { return mpData->maInfoFont; }
+ void SetRadioCheckFont( const Font& rFont )
+ { CopyData(); mpData->maRadioCheckFont = rFont; }
+ const Font& GetRadioCheckFont() const
+ { return mpData->maRadioCheckFont; }
+ void SetPushButtonFont( const Font& rFont )
+ { CopyData(); mpData->maPushButtonFont = rFont; }
+ const Font& GetPushButtonFont() const
+ { return mpData->maPushButtonFont; }
+ void SetFieldFont( const Font& rFont )
+ { CopyData(); mpData->maFieldFont = rFont; }
+ const Font& GetFieldFont() const
+ { return mpData->maFieldFont; }
+ void SetIconFont( const Font& rFont )
+ { CopyData(); mpData->maIconFont = rFont; }
+ const Font& GetIconFont() const
+ { return mpData->maIconFont; }
+
+ void SetBorderSize( long nSize )
+ { CopyData(); mpData->mnBorderSize = nSize; }
+ long GetBorderSize() const
+ { return mpData->mnBorderSize; }
+ void SetTitleHeight( long nSize )
+ { CopyData(); mpData->mnTitleHeight = nSize; }
+ long GetTitleHeight() const
+ { return mpData->mnTitleHeight; }
+ void SetFloatTitleHeight( long nSize )
+ { CopyData(); mpData->mnFloatTitleHeight = nSize; }
+ long GetFloatTitleHeight() const
+ { return mpData->mnFloatTitleHeight; }
+ void SetTearOffTitleHeight( long nSize )
+ { CopyData(); mpData->mnTearOffTitleHeight = nSize; }
+ long GetTearOffTitleHeight() const
+ { return mpData->mnTearOffTitleHeight; }
+ void SetMenuBarHeight( long nSize )
+ { CopyData(); mpData->mnMenuBarHeight = nSize; }
+ long GetMenuBarHeight() const
+ { return mpData->mnMenuBarHeight; }
+ void SetScrollBarSize( long nSize )
+ { CopyData(); mpData->mnScrollBarSize = nSize; }
+ long GetScrollBarSize() const
+ { return mpData->mnScrollBarSize; }
+ void SetMinThumbSize( long nSize )
+ { CopyData(); mpData->mnMinThumbSize = nSize; }
+ long GetMinThumbSize() const
+ { return mpData->mnMinThumbSize; }
+ void SetSpinSize( long nSize )
+ { CopyData(); mpData->mnSpinSize = nSize; }
+ long GetSpinSize() const
+ { return mpData->mnSpinSize; }
+ void SetSplitSize( long nSize )
+ { CopyData(); mpData->mnSplitSize = nSize; }
+ long GetSplitSize() const
+ { return mpData->mnSplitSize; }
+
+ void SetIconHorzSpace( long nSpace )
+ { CopyData(); mpData->mnIconHorzSpace = nSpace; }
+ long GetIconHorzSpace() const
+ { return mpData->mnIconHorzSpace; }
+ void SetIconVertSpace( long nSpace )
+ { CopyData(); mpData->mnIconVertSpace = nSpace; }
+ long GetIconVertSpace() const
+ { return mpData->mnIconVertSpace; }
+
+ void SetCursorSize( long nSize )
+ { CopyData(); mpData->mnCursorSize = nSize; }
+ long GetCursorSize() const
+ { return mpData->mnCursorSize; }
+ void SetCursorBlinkTime( long nBlinkTime )
+ { CopyData(); mpData->mnCursorBlinkTime = nBlinkTime; }
+ long GetCursorBlinkTime() const
+ { return (long) mpData->mnCursorBlinkTime; }
+
+ void SetScreenZoom( sal_uInt16 nPercent )
+ { CopyData(); mpData->mnScreenZoom = nPercent; }
+ sal_uInt16 GetScreenZoom() const
+ { return mpData->mnScreenZoom; }
+ void SetScreenFontZoom( sal_uInt16 nPercent )
+ { CopyData(); mpData->mnScreenFontZoom = nPercent; }
+ sal_uInt16 GetScreenFontZoom() const
+ { return mpData->mnScreenFontZoom; }
+
+ void SetLogoDisplayTime( sal_uLong nDisplayTime )
+ { CopyData(); mpData->mnLogoDisplayTime = nDisplayTime; }
+ sal_uLong GetLogoDisplayTime() const
+ { return mpData->mnLogoDisplayTime; }
+
+ void SetDragFullOptions( sal_uLong nOptions )
+ { CopyData(); mpData->mnDragFullOptions = nOptions; }
+ sal_uLong GetDragFullOptions() const
+ { return mpData->mnDragFullOptions; }
+
+ void SetAnimationOptions( sal_uLong nOptions )
+ { CopyData(); mpData->mnAnimationOptions = nOptions; }
+ sal_uLong GetAnimationOptions() const
+ { return mpData->mnAnimationOptions; }
+
+ void SetSelectionOptions( sal_uLong nOptions )
+ { CopyData(); mpData->mnSelectionOptions = nOptions; }
+ sal_uLong GetSelectionOptions() const
+ { return mpData->mnSelectionOptions; }
+
+ void SetDisplayOptions( sal_uLong nOptions )
+ { CopyData(); mpData->mnDisplayOptions = nOptions; }
+ sal_uLong GetDisplayOptions() const
+ { return mpData->mnDisplayOptions; }
+ void SetAntialiasingMinPixelHeight( long nMinPixel )
+ { CopyData(); mpData->mnAntialiasedMin = nMinPixel; }
+ sal_uLong GetAntialiasingMinPixelHeight() const
+ { return mpData->mnAntialiasedMin; }
+
+ void SetOptions( sal_uLong nOptions )
+ { CopyData(); mpData->mnOptions = nOptions; }
+ sal_uLong GetOptions() const
+ { return mpData->mnOptions; }
+ void SetAutoMnemonic( sal_Bool bAutoMnemonic )
+ { CopyData(); mpData->mnAutoMnemonic = (sal_uInt16)bAutoMnemonic; }
+ sal_Bool GetAutoMnemonic() const
+ { return mpData->mnAutoMnemonic ? sal_True : sal_False; }
+
+ void SetFontColor( const Color& rColor )
+ { CopyData(); mpData->maFontColor = rColor; }
+ const Color& GetFontColor() const
+ { return mpData->maFontColor; }
+
+ void SetToolbarIconSize( sal_uLong nSize )
+ { CopyData(); mpData->mnToolbarIconSize = nSize; }
+ sal_uLong GetToolbarIconSize() const
+ { return mpData->mnToolbarIconSize; }
+
+ void SetSymbolsStyle( sal_uLong nStyle )
+ { CopyData(); mpData->mnSymbolsStyle = nStyle; }
+ sal_uLong GetSymbolsStyle() const
+ { return mpData->mnSymbolsStyle; }
+
+ void SetPreferredSymbolsStyle( sal_uLong nStyle )
+ { CopyData(); mpData->mnPreferredSymbolsStyle = nStyle; }
+ void SetPreferredSymbolsStyleName( const OUString &rName );
+ sal_uLong GetPreferredSymbolsStyle() const
+ { return mpData->mnPreferredSymbolsStyle; }
+ // check whether the symbols style is supported (icons are installed)
+ bool CheckSymbolStyle( sal_uLong nStyle ) const;
+ sal_uLong GetAutoSymbolsStyle() const;
+
+ sal_uLong GetCurrentSymbolsStyle() const;
+
+ void SetSymbolsStyleName( const OUString &rName )
+ { return SetSymbolsStyle( ImplNameToSymbolsStyle( rName ) ); }
+ OUString GetSymbolsStyleName() const
+ { return ImplSymbolsStyleToName( GetSymbolsStyle() ); }
+ OUString GetCurrentSymbolsStyleName() const
+ { return ImplSymbolsStyleToName( GetCurrentSymbolsStyle() ); }
+
+ const Wallpaper& GetWorkspaceGradient() const
+ { return mpData->maWorkspaceGradient; }
+ void SetWorkspaceGradient( const Wallpaper& rWall )
+ { CopyData(); mpData->maWorkspaceGradient = rWall; }
+
+ const DialogStyle& GetDialogStyle() const
+ { return mpData->maDialogStyle; }
+ void SetDialogStyle( const DialogStyle& rStyle )
+ { CopyData(); mpData->maDialogStyle = rStyle; }
+
+ const FrameStyle& GetFrameStyle() const
+ { return mpData->maFrameStyle; }
+ void SetFrameStyle( const FrameStyle& rStyle )
+ { CopyData(); mpData->maFrameStyle = rStyle; }
+
+ const BitmapEx GetPersonaHeader() const;
+
+ void SetStandardStyles();
+
+ const StyleSettings& operator =( const StyleSettings& rSet );
+
+ sal_Bool operator ==( const StyleSettings& rSet ) const;
+ sal_Bool operator !=( const StyleSettings& rSet ) const
+ { return !(*this == rSet); }
+
+protected:
+ OUString ImplSymbolsStyleToName( sal_uLong nStyle ) const;
+ sal_uLong ImplNameToSymbolsStyle( const OUString &rName ) const;
+};
+
+// ----------------
+// - ImplMiscData -
+// ----------------
+
+class ImplMiscData
+{
+ friend class MiscSettings;
+
+ ImplMiscData();
+ ImplMiscData( const ImplMiscData& rData );
+
+private:
+ sal_uLong mnRefCount;
+ sal_uInt16 mnEnableATT;
+ sal_Bool mbEnableLocalizedDecimalSep;
+ sal_uInt16 mnDisablePrinting;
+};
+
+// ----------------
+// - MiscSettings -
+// ----------------
+
+class VCL_DLLPUBLIC MiscSettings
+{
+ void CopyData();
+
+private:
+ ImplMiscData* mpData;
+
+public:
+ MiscSettings();
+ MiscSettings( const MiscSettings& rSet );
+ ~MiscSettings();
+
+#ifdef WNT
+ void SetEnableATToolSupport( sal_Bool bEnable );
+#endif
+ sal_Bool GetEnableATToolSupport() const;
+ sal_Bool GetDisablePrinting() const;
+ void SetEnableLocalizedDecimalSep( sal_Bool bEnable );
+ sal_Bool GetEnableLocalizedDecimalSep() const;
+ const MiscSettings& operator =( const MiscSettings& rSet );
+
+ sal_Bool operator ==( const MiscSettings& rSet ) const;
+ sal_Bool operator !=( const MiscSettings& rSet ) const
+ { return !(*this == rSet); }
+};
+
+// ----------------
+// - ImplHelpData -
+// ----------------
+
+class ImplHelpData
+{
+ friend class HelpSettings;
+
+ ImplHelpData();
+ ImplHelpData( const ImplHelpData& rData );
+
+private:
+ sal_uLong mnRefCount;
+ sal_uLong mnOptions;
+ sal_uLong mnTipDelay;
+ sal_uLong mnTipTimeout;
+ sal_uLong mnBalloonDelay;
+};
+
+// ----------------
+// - HelpSettings -
+// ----------------
+
+class VCL_DLLPUBLIC HelpSettings
+{
+ void CopyData();
+
+private:
+ ImplHelpData* mpData;
+
+public:
+ HelpSettings();
+ HelpSettings( const HelpSettings& rSet );
+ ~HelpSettings();
+
+ void SetOptions( sal_uLong nOptions )
+ { CopyData(); mpData->mnOptions = nOptions; }
+ sal_uLong GetOptions() const
+ { return mpData->mnOptions; }
+ void SetTipDelay( sal_uLong nTipDelay )
+ { CopyData(); mpData->mnTipDelay = nTipDelay; }
+ sal_uLong GetTipDelay() const
+ { return mpData->mnTipDelay; }
+ void SetTipTimeout( sal_uLong nTipTimeout )
+ { CopyData(); mpData->mnTipTimeout = nTipTimeout; }
+ sal_uLong GetTipTimeout() const
+ { return mpData->mnTipTimeout; }
+ void SetBalloonDelay( sal_uLong nBalloonDelay )
+ { CopyData(); mpData->mnBalloonDelay = nBalloonDelay; }
+ sal_uLong GetBalloonDelay() const
+ { return mpData->mnBalloonDelay; }
+
+ const HelpSettings& operator =( const HelpSettings& rSet );
+
+ sal_Bool operator ==( const HelpSettings& rSet ) const;
+ sal_Bool operator !=( const HelpSettings& rSet ) const
+ { return !(*this == rSet); }
+};
+
+// -----------------------
+// - ImplAllSettingsData -
+// -----------------------
+class ImplAllSettingsData
+{
+ friend class AllSettings;
+
+ ImplAllSettingsData();
+ ImplAllSettingsData( const ImplAllSettingsData& rData );
+ ~ImplAllSettingsData();
+
+private:
+ sal_uLong mnRefCount;
+ MouseSettings maMouseSettings;
+ StyleSettings maStyleSettings;
+ MiscSettings maMiscSettings;
+ HelpSettings maHelpSettings;
+ LanguageTag maLocale;
+ sal_uLong mnSystemUpdate;
+ sal_uLong mnWindowUpdate;
+ LanguageTag maUILocale;
+ LocaleDataWrapper* mpLocaleDataWrapper;
+ LocaleDataWrapper* mpUILocaleDataWrapper;
+ vcl::I18nHelper* mpI18nHelper;
+ vcl::I18nHelper* mpUII18nHelper;
+ SvtSysLocale maSysLocale;
+};
+
+// ---------------
+// - AllSettings -
+// ---------------
+
+const int SETTINGS_MOUSE = 0x00000001;
+const int SETTINGS_STYLE = 0x00000002;
+const int SETTINGS_MISC = 0x00000004;
+const int SETTINGS_SOUND = 0x00000008;
+const int SETTINGS_HELP = 0x00000010;
+const int SETTINGS_LOCALE = 0x00000020;
+const int SETTINGS_UILOCALE = 0x00000040;
+const int SETTINGS_ALLSETTINGS = ( SETTINGS_MOUSE |
+ SETTINGS_STYLE | SETTINGS_MISC |
+ SETTINGS_SOUND |
+ SETTINGS_HELP |
+ SETTINGS_LOCALE | SETTINGS_UILOCALE );
+const int SETTINGS_IN_UPDATE_SETTINGS = 0x00000800; // this flag indicates that the data changed event was created
+ // in Windows::UpdateSettings probably because of a global
+ // settings changed
+
+class VCL_DLLPUBLIC AllSettings
+{
+ void CopyData();
+
+private:
+ ImplAllSettingsData* mpData;
+
+public:
+ AllSettings();
+ AllSettings( const AllSettings& rSet );
+ ~AllSettings();
+
+ void SetMouseSettings( const MouseSettings& rSet )
+ { CopyData(); mpData->maMouseSettings = rSet; }
+ const MouseSettings& GetMouseSettings() const
+ { return mpData->maMouseSettings; }
+
+ void SetStyleSettings( const StyleSettings& rSet )
+ { CopyData(); mpData->maStyleSettings = rSet; }
+ const StyleSettings& GetStyleSettings() const
+ { return mpData->maStyleSettings; }
+
+ void SetMiscSettings( const MiscSettings& rSet )
+ { CopyData(); mpData->maMiscSettings = rSet; }
+ const MiscSettings& GetMiscSettings() const
+ { return mpData->maMiscSettings; }
+
+ void SetHelpSettings( const HelpSettings& rSet )
+ { CopyData(); mpData->maHelpSettings = rSet; }
+ const HelpSettings& GetHelpSettings() const
+ { return mpData->maHelpSettings; }
+
+ void SetLanguageTag( const LanguageTag& rLanguageTag );
+ const LanguageTag& GetLanguageTag() const;
+ void SetUILanguageTag( const LanguageTag& rLanguageTag );
+ const LanguageTag& GetUILanguageTag() const;
+ bool GetLayoutRTL() const; // returns true if UI language requires right-to-left UI
+ const LocaleDataWrapper& GetLocaleDataWrapper() const;
+ const LocaleDataWrapper& GetUILocaleDataWrapper() const;
+ const vcl::I18nHelper& GetLocaleI18nHelper() const;
+ const vcl::I18nHelper& GetUILocaleI18nHelper() const;
+
+ void SetSystemUpdate( sal_uLong nUpdate )
+ { CopyData(); mpData->mnSystemUpdate = nUpdate; }
+ sal_uLong GetSystemUpdate() const
+ { return mpData->mnSystemUpdate; }
+ void SetWindowUpdate( sal_uLong nUpdate )
+ { CopyData(); mpData->mnWindowUpdate = nUpdate; }
+ sal_uLong GetWindowUpdate() const
+ { return mpData->mnWindowUpdate; }
+
+ sal_uLong Update( sal_uLong nFlags, const AllSettings& rSettings );
+ sal_uLong GetChangeFlags( const AllSettings& rSettings ) const;
+
+ const AllSettings& operator =( const AllSettings& rSet );
+
+ sal_Bool operator ==( const AllSettings& rSet ) const;
+ sal_Bool operator !=( const AllSettings& rSet ) const
+ { return !(*this == rSet); }
+ static void LocaleSettingsChanged( sal_uInt32 nHint );
+ SvtSysLocale& GetSysLocale() { return mpData->maSysLocale; }
+};
+
+#endif // _SV_SETTINGS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/slider.hxx b/include/vcl/slider.hxx
new file mode 100644
index 000000000000..5d02217040b6
--- /dev/null
+++ b/include/vcl/slider.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_SLIDER_HXX
+#define _SV_SLIDER_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/ctrl.hxx>
+// for enum ScrollType
+#include <vcl/scrbar.hxx>
+
+// ----------
+// - Slider -
+// ----------
+
+class VCL_DLLPUBLIC Slider : public Control
+{
+private:
+ Rectangle maChannel1Rect;
+ Rectangle maChannel2Rect;
+ Rectangle maThumbRect;
+ long mnStartPos;
+ long mnMouseOff;
+ long mnThumbPixOffset;
+ long mnThumbPixRange;
+ long mnThumbPixPos;
+ long mnChannelPixOffset;
+ long mnChannelPixRange;
+ long mnChannelPixTop;
+ long mnChannelPixBottom;
+ long mnMinRange;
+ long mnMaxRange;
+ long mnThumbPos;
+ long mnLineSize;
+ long mnPageSize;
+ long mnDelta;
+ sal_uInt16 mnDragDraw;
+ sal_uInt16 mnStateFlags;
+ ScrollType meScrollType;
+ sal_Bool mbCalcSize;
+ sal_Bool mbFullDrag;
+ Link maSlideHdl;
+ Link maEndSlideHdl;
+
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings();
+ SAL_DLLPRIVATE void ImplUpdateRects( sal_Bool bUpdate = sal_True );
+ SAL_DLLPRIVATE long ImplCalcThumbPos( long nPixPos );
+ SAL_DLLPRIVATE long ImplCalcThumbPosPix( long nPos );
+ SAL_DLLPRIVATE void ImplCalc( sal_Bool bUpdate = sal_True );
+ SAL_DLLPRIVATE void ImplDraw( sal_uInt16 nDrawFlags );
+ SAL_DLLPRIVATE sal_Bool ImplIsPageUp( const Point& rPos );
+ SAL_DLLPRIVATE sal_Bool ImplIsPageDown( const Point& rPos );
+ SAL_DLLPRIVATE long ImplSlide( long nNewPos, sal_Bool bCallEndSlide );
+ SAL_DLLPRIVATE long ImplDoAction( sal_Bool bCallEndSlide );
+ SAL_DLLPRIVATE void ImplDoMouseAction( const Point& rPos, sal_Bool bCallAction = sal_True );
+ SAL_DLLPRIVATE long ImplDoSlide( long nNewPos );
+ SAL_DLLPRIVATE long ImplDoSlideAction( ScrollType eScrollType );
+
+public:
+ Slider( Window* pParent, WinBits nStyle = WB_HORZ );
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Slide();
+ virtual void EndSlide();
+
+ void EnableDrag( sal_Bool bEnable = sal_True )
+ { mbFullDrag = bEnable; }
+ sal_Bool IsDragEnabled() const { return mbFullDrag; }
+
+ long GetRangeMin() const { return mnMinRange; }
+ long GetRangeMax() const { return mnMaxRange; }
+ void SetRange( const Range& rRange );
+ Range GetRange() const { return Range( GetRangeMin(), GetRangeMax() ); }
+ void SetThumbPos( long nThumbPos );
+ long GetThumbPos() const { return mnThumbPos; }
+ void SetLineSize( long nNewSize ) { mnLineSize = nNewSize; }
+ long GetLineSize() const { return mnLineSize; }
+ void SetPageSize( long nNewSize ) { mnPageSize = nNewSize; }
+ long GetPageSize() const { return mnPageSize; }
+
+ long GetDelta() const { return mnDelta; }
+
+ Size CalcWindowSizePixel();
+
+ void SetSlideHdl( const Link& rLink ) { maSlideHdl = rLink; }
+ const Link& GetSlideHdl() const { return maSlideHdl; }
+ void SetEndSlideHdl( const Link& rLink ) { maEndSlideHdl = rLink; }
+ const Link& GetEndSlideHdl() const { return maEndSlideHdl; }
+};
+
+#endif // _SV_SLIDER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/solarmutex.hxx b/include/vcl/solarmutex.hxx
new file mode 100644
index 000000000000..a6880a62995a
--- /dev/null
+++ b/include/vcl/solarmutex.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 _VCL_SOLARMUTEX_HXX_
+#define _VCL_SOLARMUTEX_HXX_
+
+#include <osl/mutex.hxx>
+#include <vcl/dllapi.h>
+
+namespace vcl
+{
+
+/** Implementation of the SolarMutex interface.
+ */
+class VCL_DLLPUBLIC SolarMutexObject : public osl::SolarMutex
+{
+public:
+ //static SolarMutex& SAL_CALL getGlobalMutex();
+
+ /** Creates mutex
+ */
+ SolarMutexObject();
+
+ /** Implicitly destroys mutex
+ */
+ virtual ~SolarMutexObject();
+
+ /** Blocks if Mutex is already in use
+ */
+ virtual void SAL_CALL acquire();
+
+ /** Tries to get the mutex without blocking.
+ @return True if mutex could be obtained, otherwise False
+ */
+ virtual sal_Bool SAL_CALL tryToAcquire();
+
+ /** Releases the mutex.
+ */
+ virtual void SAL_CALL release();
+
+protected:
+ oslMutex m_solarMutex;
+
+private:
+ /* Disable copy/assignment
+ */
+ SolarMutexObject( const SolarMutexObject& );
+ SolarMutexObject& SAL_CALL operator=( const SolarMutexObject& );
+};
+
+}
+
+#endif // _VCL_SOLARMUTEX_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/sound.hxx b/include/vcl/sound.hxx
new file mode 100644
index 000000000000..7be53a0944ee
--- /dev/null
+++ b/include/vcl/sound.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 _SV_SOUND_HXX
+#define _SV_SOUND_HXX
+
+#include <vcl/dllapi.h>
+
+class Window;
+
+// ---------
+// - Sound -
+// ---------
+
+class VCL_DLLPUBLIC Sound
+{
+public:
+ static void Beep( Window* pWindow = NULL );
+};
+
+#endif // _SV_SOUND_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/spin.h b/include/vcl/spin.h
new file mode 100644
index 000000000000..0760b94ee2a5
--- /dev/null
+++ b/include/vcl/spin.h
@@ -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 _SV_SPIN_H
+#define _SV_SPIN_H
+
+#include <tools/solar.h>
+
+class Rectangle;
+class OutputDevice;
+
+void ImplDrawSpinButton( OutputDevice* pOutDev,
+ const Rectangle& rUpperRect,
+ const Rectangle& rLowerRect,
+ sal_Bool bUpperIn, sal_Bool bLowerIn,
+ sal_Bool bUpperEnabled = sal_True,
+ sal_Bool bLowerEnabled = sal_True,
+ sal_Bool bHorz = sal_False, sal_Bool bMirrorHorz = sal_False );
+
+#endif // _SV_SPIN_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/spin.hxx b/include/vcl/spin.hxx
new file mode 100644
index 000000000000..3966034c0938
--- /dev/null
+++ b/include/vcl/spin.hxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_SPIN_HXX
+#define _SV_SPIN_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/ctrl.hxx>
+#include <vcl/timer.hxx>
+
+// --------------
+// - SpinButton -
+// --------------
+
+class VCL_DLLPUBLIC SpinButton : public Control
+{
+private:
+ AutoTimer maRepeatTimer;
+ Rectangle maUpperRect;
+ Rectangle maLowerRect;
+ Rectangle maFocusRect;
+ sal_Bool mbRepeat : 1;
+ sal_Bool mbUpperIn : 1;
+ sal_Bool mbLowerIn : 1;
+ sal_Bool mbInitialUp : 1;
+ sal_Bool mbInitialDown : 1;
+ sal_Bool mbHorz : 1;
+ sal_Bool mbUpperIsFocused : 1;
+ Link maUpHdlLink;
+ Link maDownHdlLink;
+ long mnMinRange;
+ long mnMaxRange;
+ long mnValue;
+ long mnValueStep;
+
+ SAL_DLLPRIVATE Rectangle* ImplFindPartRect( const Point& rPt );
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ DECL_DLLPRIVATE_LINK( ImplTimeout, Timer* );
+
+public:
+ SpinButton( Window* pParent, WinBits nStyle = 0 );
+ ~SpinButton();
+
+ virtual void Up();
+ virtual void Down();
+
+ virtual void Resize();
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+ void SetRangeMin( long nNewRange );
+ long GetRangeMin() const { return mnMinRange; }
+ void SetRangeMax( long nNewRange );
+ long GetRangeMax() const { return mnMaxRange; }
+ void SetRange( const Range& rRange );
+ Range GetRange() const { return Range( GetRangeMin(), GetRangeMax() ); }
+ void SetValue( long nValue );
+ long GetValue() const { return mnValue; }
+ void SetValueStep( long nNewStep ) { mnValueStep = nNewStep; }
+ long GetValueStep() const { return mnValueStep; }
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ void SetUpHdl( const Link& rLink ) { maUpHdlLink = rLink; }
+ const Link& GetUpHdl() const { return maUpHdlLink; }
+ void SetDownHdl( const Link& rLink ) { maDownHdlLink = rLink; }
+ const Link& GetDownHdl() const { return maDownHdlLink; }
+
+private:
+ // moves the focus to the upper or lower rect. Return sal_True if the focus rect actually changed.
+ SAL_DLLPRIVATE sal_Bool ImplMoveFocus( sal_Bool _bUpper );
+ SAL_DLLPRIVATE void ImplCalcFocusRect( sal_Bool _bUpper );
+
+ SAL_DLLPRIVATE inline sal_Bool ImplIsUpperEnabled( ) const
+ {
+ return mnValue + mnValueStep <= mnMaxRange;
+ }
+ SAL_DLLPRIVATE inline sal_Bool ImplIsLowerEnabled( ) const
+ {
+ return mnValue >= mnMinRange + mnValueStep;
+ }
+};
+
+#endif // _SV_SPIN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/spinfld.hxx b/include/vcl/spinfld.hxx
new file mode 100644
index 000000000000..4a902d17aeaa
--- /dev/null
+++ b/include/vcl/spinfld.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 _SV_SPINFLD_HXX
+#define _SV_SPINFLD_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/edit.hxx>
+#include <vcl/timer.hxx>
+
+// -------------
+// - SpinField -
+// -------------
+
+class VCL_DLLPUBLIC SpinField : public Edit
+{
+protected:
+ Edit* mpEdit;
+ AutoTimer maRepeatTimer;
+ Rectangle maUpperRect;
+ Rectangle maLowerRect;
+ Rectangle maDropDownRect; // noch nicht angebunden...
+ Link maUpHdlLink;
+ Link maDownHdlLink;
+ Link maFirstHdlLink;
+ Link maLastHdlLink;
+ sal_Bool mbRepeat:1,
+ mbSpin:1,
+ mbInitialUp:1,
+ mbInitialDown:1,
+ mbNoSelect:1,
+ mbUpperIn:1,
+ mbLowerIn:1,
+ mbInDropDown:1;
+
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+
+private:
+ DECL_DLLPRIVATE_LINK( ImplTimeout, Timer* );
+ SAL_DLLPRIVATE void ImplInitSpinFieldData();
+ SAL_DLLPRIVATE void ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rectangle& rDDArea, Rectangle& rSpinUpArea, Rectangle& rSpinDownArea );
+
+protected:
+ SpinField( WindowType nTyp );
+
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+
+ void EndDropDown();
+
+ virtual void FillLayoutData() const;
+ Rectangle * ImplFindPartRect( const Point& rPt );
+
+public:
+ SpinField( Window* pParent, WinBits nWinStyle = 0 );
+ SpinField( Window* pParent, const ResId& rResId );
+ ~SpinField();
+
+ virtual sal_Bool ShowDropDown( sal_Bool bShow );
+
+ virtual void Up();
+ virtual void Down();
+ virtual void First();
+ virtual void Last();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ void SetUpHdl( const Link& rLink ) { maUpHdlLink = rLink; }
+ const Link& GetUpHdl() const { return maUpHdlLink; }
+ void SetDownHdl( const Link& rLink ) { maDownHdlLink = rLink; }
+ const Link& GetDownHdl() const { return maDownHdlLink; }
+ void SetFirstHdl( const Link& rLink ) { maFirstHdlLink = rLink; }
+ const Link& GetFirstHdl() const { return maFirstHdlLink; }
+ void SetLastHdl( const Link& rLink ) { maLastHdlLink = rLink; }
+ const Link& GetLastHdl() const { return maLastHdlLink; }
+
+ virtual Size CalcMinimumSize() const;
+ virtual Size CalcMinimumSizeForText(const OUString &rString) const;
+ virtual Size GetOptimalSize() const;
+ virtual Size CalcSize( sal_uInt16 nChars ) const;
+};
+
+#endif // _SV_SPINFLD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/split.hxx b/include/vcl/split.hxx
new file mode 100644
index 000000000000..1710ea62f5eb
--- /dev/null
+++ b/include/vcl/split.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 _SV_SPLIT_HXX
+#define _SV_SPLIT_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/window.hxx>
+
+#define SPLITTER_DEFAULTSTEPSIZE 0xFFFF
+
+// ------------
+// - Splitter -
+// ------------
+
+class VCL_DLLPUBLIC Splitter : public Window
+{
+private:
+ Window* mpRefWin;
+ long mnSplitPos;
+ long mnLastSplitPos;
+ long mnStartSplitPos;
+ Point maDragPos;
+ Rectangle maDragRect;
+ sal_Bool mbHorzSplit;
+ sal_Bool mbDragFull;
+ sal_Bool mbKbdSplitting;
+ long mbInKeyEvent;
+ long mnKeyboardStepSize;
+ Link maStartSplitHdl;
+ Link maSplitHdl;
+ Link maEndSplitHdl;
+
+ SAL_DLLPRIVATE void ImplInitSplitterData();
+ SAL_DLLPRIVATE void ImplDrawSplitter();
+ SAL_DLLPRIVATE void ImplSplitMousePos( Point& rPos );
+ SAL_DLLPRIVATE void ImplStartKbdSplitting();
+ SAL_DLLPRIVATE void ImplKbdTracking( KeyCode aKeyCode );
+ SAL_DLLPRIVATE sal_Bool ImplSplitterActive();
+ SAL_DLLPRIVATE Splitter* ImplFindSibling();
+ SAL_DLLPRIVATE void ImplRestoreSplitter();
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE Splitter (const Splitter &);
+ SAL_DLLPRIVATE Splitter& operator= (const Splitter &);
+
+protected:
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nWinStyle );
+
+public:
+ Splitter( Window* pParent, WinBits nStyle = WB_VSCROLL );
+ Splitter( Window* pParent, const ResId& rResId );
+ ~Splitter();
+
+ virtual void StartSplit();
+ virtual void EndSplit();
+ virtual void Split();
+ virtual void Splitting( Point& rSplitPos );
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Paint( const Rectangle& rPaintRect );
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void StartDrag();
+
+ void SetDragRectPixel( const Rectangle& rDragRect,
+ Window* pRefWin = NULL );
+ const Rectangle& GetDragRectPixel() const { return maDragRect; }
+ Window* GetDragWindow() const { return mpRefWin; }
+
+ virtual void SetSplitPosPixel( long nPos );
+ long GetSplitPosPixel() const { return mnSplitPos; }
+
+ sal_Bool IsHorizontal() const { return mbHorzSplit; }
+
+ // set the stepsize of the splitter for cursor movement
+ // the default is 10% of the reference window's width/height
+ void SetKeyboardStepSize( long nStepSize );
+
+ void SetStartSplitHdl( const Link& rLink ) { maStartSplitHdl = rLink; }
+ const Link& GetStartSplitHdl() const { return maStartSplitHdl; }
+ void SetSplitHdl( const Link& rLink ) { maSplitHdl = rLink; }
+ void SetEndSplitHdl( const Link& rLink ) { maEndSplitHdl = rLink; }
+ const Link& GetEndSplitHdl() const { return maEndSplitHdl; }
+ const Link& GetSplitHdl() const { return maSplitHdl; }
+};
+
+#endif // _SV_SPLIT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/splitwin.hxx b/include/vcl/splitwin.hxx
new file mode 100644
index 000000000000..b723a449f727
--- /dev/null
+++ b/include/vcl/splitwin.hxx
@@ -0,0 +1,241 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_SPLITWIN_HXX
+#define _SV_SPLITWIN_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/dockwin.hxx>
+
+class Wallpaper;
+struct ImplSplitSet;
+
+// -----------------------
+// - SplitWindowItemBits -
+// -----------------------
+
+typedef sal_uInt16 SplitWindowItemBits;
+
+// -------------------------------
+// - Bits fuer SplitWindow-Items -
+// -------------------------------
+
+#define SWIB_FIXED ((SplitWindowItemBits)0x0001)
+#define SWIB_RELATIVESIZE ((SplitWindowItemBits)0x0002)
+#define SWIB_PERCENTSIZE ((SplitWindowItemBits)0x0004)
+#define SWIB_COLSET ((SplitWindowItemBits)0x0008)
+#define SWIB_INVISIBLE ((SplitWindowItemBits)0x0010)
+
+// ---------------------
+// - SplitWindow-Types -
+// ---------------------
+
+#define SPLITWINDOW_APPEND ((sal_uInt16)0xFFFF)
+#define SPLITWINDOW_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
+
+// ---------------
+// - SplitWindow -
+// ---------------
+
+class VCL_DLLPUBLIC SplitWindow : public DockingWindow
+{
+private:
+ ImplSplitSet* mpMainSet;
+ ImplSplitSet* mpBaseSet;
+ ImplSplitSet* mpSplitSet;
+ long* mpLastSizes;
+ Rectangle maDragRect;
+ long mnDX;
+ long mnDY;
+ long mnLeftBorder;
+ long mnTopBorder;
+ long mnRightBorder;
+ long mnBottomBorder;
+ long mnMaxSize;
+ long mnMouseOff;
+ long mnMStartPos;
+ long mnMSplitPos;
+ WinBits mnWinStyle;
+ WindowAlign meAlign;
+ sal_uInt16 mnSplitTest;
+ sal_uInt16 mnSplitPos;
+ sal_uInt16 mnMouseModifier;
+ sal_Bool mbDragFull:1,
+ mbHorz:1,
+ mbBottomRight:1,
+ mbCalc:1,
+ mbRecalc:1,
+ mbInvalidate:1,
+ mbSizeable:1,
+ mbBorder:1,
+ mbAutoHide:1,
+ mbFadeIn:1,
+ mbFadeOut:1,
+ mbAutoHideIn:1,
+ mbAutoHideDown:1,
+ mbFadeInDown:1,
+ mbFadeOutDown:1,
+ mbAutoHidePressed:1,
+ mbFadeInPressed:1,
+ mbFadeOutPressed:1,
+ mbFadeNoButtonMode:1,
+ mbNoAlign:1;
+ Link maStartSplitHdl;
+ Link maSplitHdl;
+ Link maSplitResizeHdl;
+ Link maAutoHideHdl;
+ Link maFadeInHdl;
+ Link maFadeOutHdl;
+
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings();
+ SAL_DLLPRIVATE void ImplCalcLayout();
+ SAL_DLLPRIVATE void ImplUpdate();
+ SAL_DLLPRIVATE void ImplSetWindowSize( long nDelta );
+ SAL_DLLPRIVATE void ImplSplitMousePos( Point& rMousePos );
+ SAL_DLLPRIVATE void ImplGetButtonRect( Rectangle& rRect, long nEx, sal_Bool bTest ) const;
+ SAL_DLLPRIVATE void ImplGetAutoHideRect( Rectangle& rRect, sal_Bool bTest = sal_False ) const;
+ SAL_DLLPRIVATE void ImplGetFadeInRect( Rectangle& rRect, sal_Bool bTest = sal_False ) const;
+ SAL_DLLPRIVATE void ImplGetFadeOutRect( Rectangle& rRect, sal_Bool bTest = sal_False ) const;
+ SAL_DLLPRIVATE void ImplDrawButtonRect( const Rectangle& rRect, long nSize );
+ SAL_DLLPRIVATE void ImplDrawAutoHide( sal_Bool bInPaint );
+ SAL_DLLPRIVATE void ImplDrawFadeIn( sal_Bool bInPaint );
+ SAL_DLLPRIVATE void ImplDrawFadeOut( sal_Bool bInPaint );
+ SAL_DLLPRIVATE void ImplNewAlign();
+ SAL_DLLPRIVATE void ImplDrawGrip( const Rectangle& rRect, sal_Bool bHorz, sal_Bool bLeft );
+ SAL_DLLPRIVATE void ImplDrawFadeArrow( const Point& rPt, sal_Bool bHorz, sal_Bool bLeft );
+ SAL_DLLPRIVATE void ImplStartSplit( const MouseEvent& rMEvt );
+
+ static SAL_DLLPRIVATE void ImplDrawBorder( SplitWindow* pWin );
+ static SAL_DLLPRIVATE void ImplDrawBorderLine( SplitWindow* pWin );
+ static SAL_DLLPRIVATE void ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, sal_Bool bHide,
+ sal_Bool bRows, sal_Bool bDown = sal_True );
+ static SAL_DLLPRIVATE void ImplDrawBack( SplitWindow* pWindow, ImplSplitSet* pSet );
+ static SAL_DLLPRIVATE void ImplDrawBack( SplitWindow* pWindow, const Rectangle& rRect,
+ const Wallpaper* pWall, const Bitmap* pBitmap );
+ static SAL_DLLPRIVATE sal_uInt16 ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
+ long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos,
+ sal_Bool bRows, sal_Bool bDown = sal_True );
+ static SAL_DLLPRIVATE sal_uInt16 ImplTestSplit( SplitWindow* pWindow, const Point& rPos,
+ long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos );
+ static SAL_DLLPRIVATE void ImplDrawSplitTracking( SplitWindow* pThis, const Point& rPos );
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE SplitWindow (const SplitWindow &);
+ SAL_DLLPRIVATE SplitWindow & operator= (const SplitWindow &);
+public:
+ SplitWindow( Window* pParent, WinBits nStyle = 0 );
+ ~SplitWindow();
+
+ virtual void StartSplit();
+ virtual void Split();
+ virtual void SplitResize();
+ virtual void AutoHide();
+ virtual void FadeIn();
+ virtual void FadeOut();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Move();
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ void InsertItem( sal_uInt16 nId, Window* pWindow, long nSize,
+ sal_uInt16 nPos = SPLITWINDOW_APPEND, sal_uInt16 nSetId = 0,
+ SplitWindowItemBits nBits = 0 );
+ void InsertItem( sal_uInt16 nId, long nSize,
+ sal_uInt16 nPos = SPLITWINDOW_APPEND, sal_uInt16 nSetId = 0,
+ SplitWindowItemBits nBits = 0 );
+ void RemoveItem( sal_uInt16 nId, sal_Bool bHide = sal_True );
+ void Clear();
+
+ void SplitItem( sal_uInt16 nId, long nNewSize,
+ sal_Bool bPropSmall = sal_False,
+ sal_Bool bPropGreat = sal_False );
+ void SetItemSize( sal_uInt16 nId, long nNewSize );
+ long GetItemSize( sal_uInt16 nId ) const;
+ /** Set a range that limits the (variable part of the) size with an
+ upper and a lower bound (both are valid values themselves.)
+ @param nId
+ Id of the item for which the size limits are set.
+ @param aRange
+ Values of -1 define missing bounds, thus setting a range (-1,-1)
+ (the default) removes the size limitiation.
+ */
+ void SetItemSizeRange (sal_uInt16 nId, const Range aRange);
+ /** Return the current size limits for the specified item.
+ */
+ long GetItemSize( sal_uInt16 nId, SplitWindowItemBits nBits ) const;
+ sal_uInt16 GetSet( sal_uInt16 nId ) const;
+ sal_uInt16 GetItemId( Window* pWindow ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ sal_uInt16 GetItemPos( sal_uInt16 nId, sal_uInt16 nSetId = 0 ) const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos, sal_uInt16 nSetId = 0 ) const;
+ sal_uInt16 GetItemCount( sal_uInt16 nSetId = 0 ) const;
+ sal_Bool IsItemValid( sal_uInt16 nId ) const;
+
+ sal_Bool IsNoAlign() const { return mbNoAlign; }
+ void SetAlign( WindowAlign eNewAlign = WINDOWALIGN_TOP );
+ WindowAlign GetAlign() const { return meAlign; }
+ sal_Bool IsHorizontal() const { return mbHorz; }
+
+ sal_Bool IsSplitting() const { return IsTracking(); }
+
+ void SetMaxSizePixel( long nNewMaxSize ) { mnMaxSize = nNewMaxSize; }
+ long GetMaxSizePixel() const { return mnMaxSize; }
+
+ Size CalcLayoutSizePixel( const Size& aNewSize );
+
+ void ShowAutoHideButton( sal_Bool bShow = sal_True );
+ sal_Bool IsAutoHideButtonVisible() const { return mbAutoHide; }
+ void ShowFadeInHideButton( sal_Bool bShow = sal_True );
+ void ShowFadeInButton( sal_Bool bShow = sal_True ) { ShowFadeInHideButton( bShow ); }
+ sal_Bool IsFadeInButtonVisible() const { return mbFadeIn; }
+ void ShowFadeOutButton( sal_Bool bShow = sal_True );
+ sal_Bool IsFadeOutButtonVisible() const { return mbFadeOut; }
+ long GetFadeInSize() const;
+ sal_Bool IsFadeNoButtonMode() const { return mbFadeNoButtonMode; }
+
+ void SetAutoHideState( sal_Bool bAutoHide );
+ sal_Bool GetAutoHideState() const { return mbAutoHideIn; }
+
+ void SetStartSplitHdl( const Link& rLink ) { maStartSplitHdl = rLink; }
+ const Link& GetStartSplitHdl() const { return maStartSplitHdl; }
+ void SetSplitHdl( const Link& rLink ) { maSplitHdl = rLink; }
+ const Link& GetSplitHdl() const { return maSplitHdl; }
+ void SetSplitResizeHdl( const Link& rLink ) { maSplitResizeHdl = rLink; }
+ const Link& GetSplitResizeHdl() const { return maSplitResizeHdl; }
+ void SetAutoHideHdl( const Link& rLink ) { maAutoHideHdl = rLink; }
+ const Link& GetAutoHideHdl() const { return maAutoHideHdl; }
+ void SetFadeInHdl( const Link& rLink ) { maFadeInHdl = rLink; }
+ const Link& GetFadeInHdl() const { return maFadeInHdl; }
+ void SetFadeOutHdl( const Link& rLink ) { maFadeOutHdl = rLink; }
+ const Link& GetFadeOutHdl() const { return maFadeOutHdl; }
+};
+
+#endif // _SV_SPLITWIN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/status.hxx b/include/vcl/status.hxx
new file mode 100644
index 000000000000..91aa97113179
--- /dev/null
+++ b/include/vcl/status.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 _SV_STATUS_HXX
+#define _SV_STATUS_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/window.hxx>
+#include <vector>
+
+struct ImplStatusItem;
+typedef ::std::vector< ImplStatusItem* > ImplStatusItemList;
+
+// --------------------
+// - Progress-Ausgabe -
+// --------------------
+
+void VCL_DLLPUBLIC DrawProgress( Window* pWindow, const Point& rPos,
+ long nOffset, long nPrgsWidth, long nPrgsHeight,
+ sal_uInt16 nPercent1, sal_uInt16 nPercent2, sal_uInt16 nPercentCount,
+ const Rectangle& rFramePosSize
+ );
+
+// ---------------------
+// - StatusBarItemBits -
+// ---------------------
+
+typedef sal_uInt16 StatusBarItemBits;
+
+// ----------------------------
+// - Bits fuer StatusBarItems -
+// ----------------------------
+
+#define SIB_LEFT ((StatusBarItemBits)0x0001)
+#define SIB_CENTER ((StatusBarItemBits)0x0002)
+#define SIB_RIGHT ((StatusBarItemBits)0x0004)
+#define SIB_IN ((StatusBarItemBits)0x0008)
+#define SIB_OUT ((StatusBarItemBits)0x0010)
+#define SIB_FLAT ((StatusBarItemBits)0x0020)
+#define SIB_AUTOSIZE ((StatusBarItemBits)0x0040)
+#define SIB_USERDRAW ((StatusBarItemBits)0x0080)
+
+// -------------------
+// - StatusBar-Types -
+// -------------------
+
+#define STATUSBAR_APPEND ((sal_uInt16)0xFFFF)
+#define STATUSBAR_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
+#define STATUSBAR_OFFSET ((long)5)
+
+// -------------
+// - StatusBar -
+// -------------
+
+class VCL_DLLPUBLIC StatusBar : public Window
+{
+ class ImplData;
+private:
+ ImplStatusItemList* mpItemList;
+ ImplData* mpImplData;
+ XubString maPrgsTxt;
+ Point maPrgsTxtPos;
+ Rectangle maPrgsFrameRect;
+ long mnPrgsSize;
+ long mnItemsWidth;
+ long mnDX;
+ long mnDY;
+ long mnCalcHeight;
+ long mnTextY;
+ long mnItemY;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnPercent;
+ sal_uInt16 mnPercentCount;
+ sal_Bool mbVisibleItems;
+ sal_Bool mbFormat;
+ sal_Bool mbProgressMode;
+ sal_Bool mbInUserDraw;
+ Link maClickHdl;
+ Link maDoubleClickHdl;
+
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplFormat();
+ SAL_DLLPRIVATE sal_Bool ImplIsItemUpdate();
+ using OutputDevice::ImplDrawText;
+ SAL_DLLPRIVATE void ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth );
+ SAL_DLLPRIVATE void ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDrawText, sal_Bool bDrawFrame );
+ SAL_DLLPRIVATE void ImplDrawProgress( sal_Bool bPaint,
+ sal_uInt16 nOldPerc, sal_uInt16 nNewPerc );
+ SAL_DLLPRIVATE void ImplCalcProgressRect();
+ SAL_DLLPRIVATE Rectangle ImplGetItemRectPos( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisiblePos() const;
+
+public:
+ StatusBar( Window* pParent,
+ WinBits nWinStyle = WB_BORDER | WB_RIGHT );
+ ~StatusBar();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Move();
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Click();
+ virtual void DoubleClick();
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ void InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
+ StatusBarItemBits nBits = SIB_CENTER | SIB_IN,
+ long nOffset = STATUSBAR_OFFSET,
+ sal_uInt16 nPos = STATUSBAR_APPEND );
+
+ sal_Bool IsItemVisible( sal_uInt16 nItemId ) const;
+ sal_Bool AreItemsVisible() const { return mbVisibleItems; }
+
+ void Clear();
+
+ sal_uInt16 GetItemCount() const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
+ Rectangle GetItemRect( sal_uInt16 nItemId ) const;
+ Point GetItemTextPos( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetCurItemId() const { return mnCurItemId; }
+
+ void SetItemText( sal_uInt16 nItemId, const XubString& rText );
+ const XubString& GetItemText( sal_uInt16 nItemId ) const;
+
+ void SetItemData( sal_uInt16 nItemId, void* pNewData );
+
+ void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
+ const XubString& GetItemCommand( sal_uInt16 nItemId );
+
+ void SetHelpText( sal_uInt16 nItemId, const XubString& rText );
+ const XubString& GetHelpText( sal_uInt16 nItemId ) const;
+
+ using Window::SetQuickHelpText;
+ void SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText );
+ using Window::GetQuickHelpText;
+ const XubString& GetQuickHelpText( sal_uInt16 nItemId ) const;
+
+ void SetHelpId( sal_uInt16 nItemId, const OString& rHelpId );
+ OString GetHelpId( sal_uInt16 nItemId ) const;
+
+ void StartProgressMode( const XubString& rText );
+ void SetProgressValue( sal_uInt16 nPercent );
+ void EndProgressMode();
+ sal_Bool IsProgressMode() const { return mbProgressMode; }
+
+ void SetText( const OUString& rText );
+
+ void SetHelpText( const XubString& rText )
+ { Window::SetHelpText( rText ); }
+ const XubString& GetHelpText() const
+ { return Window::GetHelpText(); }
+
+ void SetHelpId( const OString& rId )
+ { Window::SetHelpId( rId ); }
+ const OString& GetHelpId() const
+ { return Window::GetHelpId(); }
+
+ Size CalcWindowSizePixel() const;
+
+ void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
+ const Link& GetClickHdl() const { return maClickHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+
+ using Window::SetAccessibleName;
+ void SetAccessibleName( sal_uInt16 nItemId, const XubString& rName );
+ using Window::GetAccessibleName;
+ const XubString& GetAccessibleName( sal_uInt16 nItemId ) const;
+};
+
+#endif // _SV_STATUS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/stdtext.hxx b/include/vcl/stdtext.hxx
new file mode 100644
index 000000000000..ab48231d23c2
--- /dev/null
+++ b/include/vcl/stdtext.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 _VCL_STDTEXT_HXX
+#define _VCL_STDTEXT_HXX
+
+#include <tools/string.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+
+class Window;
+
+// ------------------
+// - Standard-Texte -
+// ------------------
+
+#define STANDARD_TEXT_FIRST STANDARD_TEXT_SERVICE_NOT_AVAILABLE
+#define STANDARD_TEXT_SERVICE_NOT_AVAILABLE ((sal_uInt16)0)
+#define STANDARD_TEXT_LAST STANDARD_TEXT_SERVICE_NOT_AVAILABLE
+
+OUString VCL_DLLPUBLIC GetStandardText(sal_uInt16 nStdText);
+
+// -------------------------------------
+// - Hilfsmethoden fuer Standard-Texte -
+// -------------------------------------
+
+void VCL_DLLPUBLIC ShowServiceNotAvailableError(Window* pParent, const OUString& rServiceName, bool bError);
+
+#endif // _VCL_STDTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/strhelper.hxx b/include/vcl/strhelper.hxx
new file mode 100644
index 000000000000..0d0949a3515f
--- /dev/null
+++ b/include/vcl/strhelper.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 _PSPRINT_STRHELPER_HXX_
+#define _PSPRINT_STRHELPER_HXX_
+
+#include "vcl/dllapi.h"
+
+#include <tools/string.hxx>
+#include <rtl/math.hxx>
+
+#include <cstring>
+
+namespace psp
+{
+ VCL_DLLPUBLIC String GetCommandLineToken( int, const String& );
+ VCL_DLLPUBLIC OString GetCommandLineToken(int, const OString&);
+ // gets one token of a unix command line style string
+ // doublequote, singlequote and singleleftquote protect their respective
+ // contents
+
+ VCL_DLLPUBLIC int GetCommandLineTokenCount(const OUString&);
+ // returns number of tokens (zero if empty or whitespace only)
+
+ VCL_DLLPUBLIC String WhitespaceToSpace( const String&, sal_Bool bProtect = sal_True );
+ VCL_DLLPUBLIC OString WhitespaceToSpace(const OString&, sal_Bool bProtect = sal_True);
+ // returns a string with multiple adjacent occurrences of whitespace
+ // converted to a single space. if bProtect is sal_True (nonzero), then
+ // doublequote, singlequote and singleleftquote protect their respective
+ // contents
+
+
+ // parses the first double in the string; decimal is '.' only
+ VCL_DLLPUBLIC inline double StringToDouble( const String& rStr )
+ {
+ return rtl::math::stringToDouble(rStr, sal_Unicode('.'), sal_Unicode(0));
+ }
+
+ VCL_DLLPUBLIC inline double StringToDouble(const OString& rStr)
+ {
+ return rtl::math::stringToDouble(rStr, '.', static_cast<sal_Char>(0));
+ }
+
+ // fills a character buffer with the string representation of a double
+ // the buffer has to be long enough (e.g. 128 bytes)
+ // returns the string len
+ VCL_DLLPUBLIC inline int getValueOfDouble( char* pBuffer, double f, int nPrecision = 0)
+ {
+ OString aStr( rtl::math::doubleToString( f, rtl_math_StringFormat_G, nPrecision, '.', true ) );
+ int nLen = aStr.getLength();
+ std::strncpy( pBuffer, aStr.getStr(), nLen+1 ); // copy string including terminating zero
+ return nLen;
+ }
+
+} // namespace
+
+#endif // _PSPRINT_STRHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
new file mode 100644
index 000000000000..b4acc579ad94
--- /dev/null
+++ b/include/vcl/svapp.hxx
@@ -0,0 +1,538 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_SVAPP_HXX
+#define _SV_SVAPP_HXX
+
+#include <config_features.h>
+
+#include <sal/config.h>
+
+#include <stdexcept>
+
+#include <osl/thread.hxx>
+#include <osl/mutex.hxx>
+#include <tools/string.hxx>
+#include <tools/link.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/apptypes.hxx>
+#include <vcl/settings.hxx>
+#include <vcl/vclevent.hxx>
+
+class BitmapEx;
+class Link;
+class AllSettings;
+class DataChangedEvent;
+class Accelerator;
+class Help;
+class OutputDevice;
+class Window;
+class WorkWindow;
+class MenuBar;
+class UnoWrapperBase;
+class Reflection;
+class KeyCode;
+class NotifyEvent;
+class KeyEvent;
+class MouseEvent;
+class ZoomEvent;
+class ScrollEvent;
+
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/connection/XConnection.hpp>
+
+namespace com {
+namespace sun {
+namespace star {
+namespace uno {
+ class XComponentContext;
+}
+namespace ui {
+ namespace dialogs {
+ class XFilePicker2;
+ class XFolderPicker2;
+ }
+}
+namespace awt {
+ class XToolkit;
+ class XDisplayConnection;
+}
+} } }
+
+// helper needed by SalLayout implementations as well as svx/source/dialog/svxbmpnumbalueset.cxx
+VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 );
+VCL_DLLPUBLIC sal_UCS4 GetLocalizedChar( sal_UCS4, LanguageType );
+
+#define SYSTEMWINDOW_MODE_NOAUTOMODE ((sal_uInt16)0x0001)
+#define SYSTEMWINDOW_MODE_DIALOG ((sal_uInt16)0x0002)
+
+typedef long (*VCLEventHookProc)( NotifyEvent& rEvt, void* pData );
+
+// ATTENTION: ENUM duplicate in daemon.cxx under Unix!
+
+#ifdef UNX
+enum Service { SERVICE_OLE, SERVICE_APPEVENT, SERVICE_IPC };
+#endif
+
+class VCL_DLLPUBLIC ApplicationEvent
+{
+public:
+ enum Type {
+ TYPE_ACCEPT, TYPE_APPEAR, TYPE_HELP, TYPE_VERSION, TYPE_OPEN,
+ TYPE_OPENHELPURL, TYPE_PRINT, TYPE_PRIVATE_DOSHUTDOWN, TYPE_QUICKSTART,
+ TYPE_SHOWDIALOG, TYPE_UNACCEPT
+ };
+
+ ApplicationEvent() {}
+
+ explicit ApplicationEvent(
+ Type rEvent, const OUString& rData = OUString()):
+ aEvent(rEvent),
+ aData(rData)
+ {}
+
+ Type GetEvent() const { return aEvent; }
+ const OUString& GetData() const { return aData; }
+
+private:
+ Type aEvent;
+ OUString aData;
+};
+
+
+class VCL_DLLPUBLIC Application
+{
+public:
+ enum DialogCancelMode {
+ DIALOG_CANCEL_OFF, ///< do not automatically cancel dialogs
+ DIALOG_CANCEL_SILENT, ///< silently cancel any dialogs
+ DIALOG_CANCEL_FATAL
+ ///< cancel any dialogs by throwing a DialogCancelledException
+ };
+
+ class VCL_DLLPUBLIC DialogCancelledException:
+ virtual public std::runtime_error
+ {
+ public:
+ explicit DialogCancelledException(char const * what_arg):
+ runtime_error(what_arg) {}
+
+ virtual ~DialogCancelledException() throw ();
+ };
+
+ Application();
+ virtual ~Application();
+
+ virtual int Main() = 0;
+
+ virtual sal_Bool QueryExit();
+
+ virtual void UserEvent( sal_uLong nEvent, void* pEventData );
+
+ virtual void FocusChanged();
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Init();
+ virtual void InitFinished();
+ virtual void DeInit();
+
+ static sal_uInt16 GetCommandLineParamCount();
+ static XubString GetCommandLineParam( sal_uInt16 nParam );
+ static const XubString& GetAppFileName();
+
+ virtual sal_uInt16 Exception( sal_uInt16 nError );
+ static void Abort( const XubString& rErrorText );
+
+ static void Execute();
+ static void Quit();
+ static void Reschedule( bool bAllEvents = false );
+ static void Yield( bool bAllEvents = false );
+ static void EndYield();
+ static osl::SolarMutex& GetSolarMutex();
+ static oslThreadIdentifier GetMainThreadIdentifier();
+ static sal_uLong ReleaseSolarMutex();
+ static void AcquireSolarMutex( sal_uLong nCount );
+ static void EnableNoYieldMode( bool i_bNoYield );
+ static void AddPostYieldListener( const Link& i_rListener );
+ static void RemovePostYieldListener( const Link& i_rListener );
+
+ static sal_Bool IsInMain();
+ static sal_Bool IsInExecute();
+ static sal_Bool IsInModalMode();
+
+ static sal_uInt16 GetDispatchLevel();
+ static bool AnyInput( sal_uInt16 nType = VCL_INPUT_ANY );
+ static sal_uLong GetLastInputInterval();
+ static sal_Bool IsUICaptured();
+
+ virtual void SystemSettingsChanging( AllSettings& rSettings,
+ Window* pFrame );
+ static void MergeSystemSettings( AllSettings& rSettings );
+ /** validate that the currently selected system UI font is suitable
+ to display the application's UI.
+
+ A localized test string will be checked if it can be displayed
+ in the currently selected system UI font. If no glyphs are
+ missing it can be assumed that the font is proper for display
+ of the application's UI.
+
+ @returns
+ <TRUE/> if the system font is suitable for our UI
+ <FALSE/> if the test string could not be displayed with the system font
+ */
+ static bool ValidateSystemFont();
+
+ static void SetSettings( const AllSettings& rSettings );
+ static const AllSettings& GetSettings();
+ static void NotifyAllWindows( DataChangedEvent& rDCEvt );
+
+ static void AddEventListener( const Link& rEventListener );
+ static void RemoveEventListener( const Link& rEventListener );
+ static void AddKeyListener( const Link& rKeyListener );
+ static void RemoveKeyListener( const Link& rKeyListener );
+ static void ImplCallEventListeners( sal_uLong nEvent, Window* pWin, void* pData );
+ static void ImplCallEventListeners( VclSimpleEvent* pEvent );
+ static sal_Bool HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent );
+
+ static sal_uLong PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent );
+ static sal_uLong PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent );
+#if !HAVE_FEATURE_DESKTOP
+ static sal_uLong PostZoomEvent( sal_uLong nEvent, Window *pWin, ZoomEvent* pZoomEvent );
+ static sal_uLong PostScrollEvent( sal_uLong nEvent, Window *pWin, ScrollEvent* pScrollEvent );
+#endif
+ static void RemoveMouseAndKeyEvents( Window *pWin );
+
+ static sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL );
+ static sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL );
+ static void RemoveUserEvent( sal_uLong nUserEvent );
+
+ static sal_Bool InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority );
+ static void RemoveIdleHdl( const Link& rLink );
+
+ virtual void AppEvent( const ApplicationEvent& rAppEvent );
+
+#ifndef NO_GETAPPWINDOW
+ static WorkWindow* GetAppWindow();
+#endif
+
+ static Window* GetFocusWindow();
+ static OutputDevice* GetDefaultDevice();
+
+ static Window* GetFirstTopLevelWindow();
+ static Window* GetNextTopLevelWindow( Window* pWindow );
+
+ static long GetTopWindowCount();
+ static Window* GetTopWindow( long nIndex );
+ static Window* GetActiveTopWindow();
+
+ static void SetAppName( const String& rUniqueName );
+ static String GetAppName();
+ static bool LoadBrandBitmap (const char* pName, BitmapEx &rBitmap);
+
+ // default name of the application for message dialogs and printing
+ static void SetDisplayName( const OUString& rDisplayName );
+ static OUString GetDisplayName();
+
+
+ static unsigned int GetScreenCount();
+ static Rectangle GetScreenPosSizePixel( unsigned int nScreen );
+
+ // IsUnifiedDisplay returns:
+ // true: screens form up one large display area
+ // windows can be moved between single screens
+ // (e.g. Xserver with Xinerama, Windows)
+ // false: different screens are separate and windows cannot be moved
+ // between them (e.g. Xserver with multiple screens)
+ static bool IsUnifiedDisplay();
+ // if IsUnifiedDisplay() == true the return value will be
+ // nearest screen of the target rectangle
+ // in case of IsUnifiedDisplay() == false the return value
+ // will always be GetDisplayDefaultScreen()
+ SAL_DLLPRIVATE static unsigned int GetBestScreen( const Rectangle& );
+ static Rectangle GetWorkAreaPosSizePixel( unsigned int nScreen );
+ // This returns the LCD screen number for a laptop, or the primary
+ // external VGA display for a desktop machine - it is where a presenter
+ // console should be rendered if there are other (non-built-in) screens
+ // present.
+ static unsigned int GetDisplayBuiltInScreen();
+ // Practically, this means - Get the screen we should run a presentation on.
+ static unsigned int GetDisplayExternalScreen();
+
+ static const LocaleDataWrapper& GetAppLocaleDataWrapper();
+
+ static sal_Bool InsertAccel( Accelerator* pAccel );
+ static void RemoveAccel( Accelerator* pAccel );
+
+ static long CallEventHooks( NotifyEvent& rEvt );
+
+ static void SetHelp( Help* pHelp = NULL );
+ static Help* GetHelp();
+
+ static void EnableAutoHelpId( sal_Bool bEnabled = sal_True );
+ static sal_Bool IsAutoHelpIdEnabled();
+
+ static void EnableAutoMnemonic( sal_Bool bEnabled = sal_True );
+ static sal_Bool IsAutoMnemonicEnabled();
+
+ static sal_uLong GetReservedKeyCodeCount();
+ static const KeyCode* GetReservedKeyCode( sal_uLong i );
+
+ static void SetDefDialogParent( Window* pWindow );
+ static Window* GetDefDialogParent();
+
+ static DialogCancelMode GetDialogCancelMode();
+ static void SetDialogCancelMode( DialogCancelMode mode );
+ static sal_Bool IsDialogCancelEnabled();
+
+ static void SetSystemWindowMode( sal_uInt16 nMode );
+ static sal_uInt16 GetSystemWindowMode();
+
+ static void SetDialogScaleX( short nScale );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayConnection > GetDisplayConnection();
+
+ // The global service manager has to be created before!
+ static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > GetVCLToolkit();
+ static UnoWrapperBase* GetUnoWrapper( sal_Bool bCreateIfNotExists = sal_True );
+ static void SetUnoWrapper( UnoWrapperBase* pWrapper );
+
+ static void SetFilterHdl( const Link& rLink );
+ static const Link& GetFilterHdl();
+
+ static void EnableHeadlessMode( bool dialogsAreFatal );
+ static sal_Bool IsHeadlessModeEnabled();
+ static bool IsHeadlessModeRequested();
+ ///< check command line arguments for --headless
+
+ static void ShowNativeErrorBox(const String& sTitle ,
+ const String& sMessage);
+
+ // IME Status Window Control:
+
+ /** Return true if any IME status window can be toggled on and off
+ externally.
+
+ Must only be called with the Solar mutex locked.
+ */
+ static bool CanToggleImeStatusWindow();
+
+ /** Toggle any IME status window on and off.
+
+ This only works if CanToggleImeStatusWinodw returns true (otherwise,
+ any calls of this method are ignored).
+
+ Must only be called with the Solar mutex locked.
+ */
+ static void ShowImeStatusWindow(bool bShow);
+
+ /** Return true if any IME status window should be turned on by default
+ (this decision can be locale dependent, for example).
+
+ Can be called without the Solar mutex locked.
+ */
+ static bool GetShowImeStatusWindowDefault();
+
+ /** Returns a string representing the desktop environment
+ the process is currently running in.
+ */
+ static const OUString& GetDesktopEnvironment();
+
+ /** Add a file to the system shells recent document list if there is any.
+ This function may have no effect under Unix because there is no
+ standard API among the different desktop managers.
+
+ @param rFileUrl
+ The file url of the document.
+
+ @param rMimeType
+ The mime content type of the document specified by aFileUrl.
+ If an empty string will be provided "application/octet-stream"
+ will be used.
+ */
+ static void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType);
+
+ /** Do we have a native / system file selector available ?
+ */
+ static bool hasNativeFileSelection();
+
+ /** Create a platform specific file picker, if one is available,
+ otherwise return an empty reference
+ */
+ static com::sun::star::uno::Reference< com::sun::star::ui::dialogs::XFilePicker2 >
+ createFilePicker( const com::sun::star::uno::Reference<
+ com::sun::star::uno::XComponentContext >& rServiceManager );
+
+ /** Create a platform specific folder picker, if one is available,
+ otherwise return an empty reference
+ */
+ static com::sun::star::uno::Reference< com::sun::star::ui::dialogs::XFolderPicker2 >
+ createFolderPicker( const com::sun::star::uno::Reference<
+ com::sun::star::uno::XComponentContext >& rServiceManager );
+
+private:
+
+ DECL_STATIC_LINK( Application, PostEventHandler, void* );
+};
+
+
+class VCL_DLLPUBLIC SolarMutexGuard
+{
+ private:
+ SolarMutexGuard( const SolarMutexGuard& );
+ const SolarMutexGuard& operator = ( const SolarMutexGuard& );
+ ::osl::SolarMutex& m_solarMutex;
+
+ public:
+
+ /** Acquires the object specified as parameter.
+ */
+ SolarMutexGuard() :
+ m_solarMutex(Application::GetSolarMutex())
+ {
+ m_solarMutex.acquire();
+ }
+
+ /** Releases the mutex or interface. */
+ ~SolarMutexGuard()
+ {
+ m_solarMutex.release();
+ }
+};
+
+class VCL_DLLPUBLIC SolarMutexClearableGuard
+{
+ SolarMutexClearableGuard( const SolarMutexClearableGuard& );
+ const SolarMutexClearableGuard& operator = ( const SolarMutexClearableGuard& );
+ bool m_bCleared;
+public:
+ /** Acquires mutex
+ @param pMutex pointer to mutex which is to be acquired */
+ SolarMutexClearableGuard()
+ : m_bCleared(false)
+ , m_solarMutex( Application::GetSolarMutex() )
+ {
+ m_solarMutex.acquire();
+ }
+
+ /** Releases mutex. */
+ virtual ~SolarMutexClearableGuard()
+ {
+ if( !m_bCleared )
+ {
+ m_solarMutex.release();
+ }
+ }
+
+ /** Releases mutex. */
+ void SAL_CALL clear()
+ {
+ if( !m_bCleared )
+ {
+ m_solarMutex.release();
+ m_bCleared = true;
+ }
+ }
+protected:
+ osl::SolarMutex& m_solarMutex;
+};
+
+class VCL_DLLPUBLIC SolarMutexResettableGuard
+{
+ SolarMutexResettableGuard( const SolarMutexResettableGuard& );
+ const SolarMutexResettableGuard& operator = ( const SolarMutexResettableGuard& );
+ bool m_bCleared;
+public:
+ /** Acquires mutex
+ @param pMutex pointer to mutex which is to be acquired */
+ SolarMutexResettableGuard()
+ : m_bCleared(false)
+ , m_solarMutex( Application::GetSolarMutex() )
+ {
+ m_solarMutex.acquire();
+ }
+
+ /** Releases mutex. */
+ virtual ~SolarMutexResettableGuard()
+ {
+ if( !m_bCleared )
+ {
+ m_solarMutex.release();
+ }
+ }
+
+ /** Releases mutex. */
+ void SAL_CALL clear()
+ {
+ if( !m_bCleared)
+ {
+ m_solarMutex.release();
+ m_bCleared = true;
+ }
+ }
+ /** Releases mutex. */
+ void SAL_CALL reset()
+ {
+ if( m_bCleared)
+ {
+ m_solarMutex.acquire();
+ m_bCleared = false;
+ }
+ }
+protected:
+ osl::SolarMutex& m_solarMutex;
+};
+
+
+/**
+ A helper class that calls Application::ReleaseSolarMutex() in its constructor
+ and restores the mutex in its destructor.
+*/
+class SolarMutexReleaser
+{
+ sal_uLong mnReleased;
+
+public:
+ SolarMutexReleaser(): mnReleased(Application::ReleaseSolarMutex()) {}
+
+ ~SolarMutexReleaser()
+ {
+ Application::AcquireSolarMutex( mnReleased );
+ }
+};
+
+VCL_DLLPUBLIC Application* GetpApp();
+
+VCL_DLLPUBLIC sal_Bool InitVCL();
+VCL_DLLPUBLIC void DeInitVCL();
+
+VCL_DLLPUBLIC bool InitAccessBridge( bool bAllowCancel, bool &rCancelled );
+
+// only allowed to call, if no thread is running. You must call JoinMainLoopThread to free all memory.
+VCL_DLLPUBLIC void CreateMainLoopThread( oslWorkerFunction pWorker, void * pThreadData );
+VCL_DLLPUBLIC void JoinMainLoopThread();
+
+inline void Application::EndYield()
+{
+ PostUserEvent( Link() );
+}
+
+#endif // _APP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/svgdata.hxx b/include/vcl/svgdata.hxx
new file mode 100644
index 000000000000..dccb08f8c579
--- /dev/null
+++ b/include/vcl/svgdata.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 _SV_SVGDATA_HXX
+#define _SV_SVGDATA_HXX
+
+#include <basegfx/range/b2drange.hxx>
+#include <boost/shared_array.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/utility.hpp>
+#include <com/sun/star/graphic/XPrimitive2D.hpp>
+#include <vcl/bitmapex.hxx>
+#include <rtl/ustring.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+typedef boost::shared_array< sal_uInt8 > SvgDataArray;
+typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > Primitive2DReference;
+typedef ::com::sun::star::uno::Sequence< Primitive2DReference > Primitive2DSequence;
+
+//////////////////////////////////////////////////////////////////////////////
+// helper to convert any Primitive2DSequence to a good quality BitmapEx,
+// using default parameters and graphic::XPrimitive2DRenderer
+
+BitmapEx VCL_DLLPUBLIC convertPrimitive2DSequenceToBitmapEx(
+ const Primitive2DSequence& rSequence,
+ const basegfx::B2DRange& rTargetRange,
+ const sal_uInt32 nMaximumQuadraticPixels = 500000);
+
+//////////////////////////////////////////////////////////////////////////////
+
+class VCL_DLLPUBLIC SvgData : private boost::noncopyable
+{
+private:
+ // the file and length
+ SvgDataArray maSvgDataArray;
+ sal_uInt32 mnSvgDataArrayLength;
+
+ // The absolute Path if available
+ OUString maPath;
+
+ // on demand created content
+ basegfx::B2DRange maRange;
+ Primitive2DSequence maSequence;
+ BitmapEx maReplacement;
+
+ // on demand creators
+ void ensureReplacement();
+ void ensureSequenceAndRange();
+
+public:
+ SvgData(const SvgDataArray& rSvgDataArray, sal_uInt32 nSvgDataArrayLength, const OUString& rPath);
+ SvgData(const OUString& rPath);
+
+ /// data read
+ const SvgDataArray& getSvgDataArray() const { return maSvgDataArray; }
+ sal_uInt32 getSvgDataArrayLength() const { return mnSvgDataArrayLength; }
+ const OUString& getPath() const { return maPath; }
+
+ /// data read and evtl. on demand creation
+ const basegfx::B2DRange& getRange() const;
+ const Primitive2DSequence& getPrimitive2DSequence() const;
+ const BitmapEx& getReplacement() const;
+};
+
+typedef boost::shared_ptr< SvgData > SvgDataPtr;
+
+#endif // _SV_SVGDATA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/syschild.hxx b/include/vcl/syschild.hxx
new file mode 100644
index 000000000000..66875e8979b5
--- /dev/null
+++ b/include/vcl/syschild.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 _SV_SYSCHILD_HXX
+#define _SV_SYSCHILD_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/window.hxx>
+
+struct SystemEnvData;
+struct SystemWindowData;
+
+// ---------------------
+// - SystemChildWindow -
+// ---------------------
+
+class VCL_DLLPUBLIC SystemChildWindow : public Window
+{
+private:
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow = sal_False );
+ SAL_DLLPRIVATE void ImplTestJavaException( void* pEnv );
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE SystemChildWindow (const SystemChildWindow &);
+ SAL_DLLPRIVATE SystemChildWindow & operator= (const SystemChildWindow &);
+
+public:
+ SystemChildWindow( Window* pParent, WinBits nStyle = 0 );
+ // create a SystemChildWindow using the given SystemWindowData
+ SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow = sal_True );
+ ~SystemChildWindow();
+
+ const SystemEnvData* GetSystemData() const;
+
+ // per default systemchildwindows erase their background for better plugin support
+ // however, this might not always be required
+ void EnableEraseBackground( sal_Bool bEnable = sal_True );
+ void SetForwardKey( sal_Bool bEnable );
+ // return the platform specific handle/id of this window;
+ // in case the flag bUseJava is set, a java compatible overlay window
+ // is created on which other java windows can be created (plugin interface)
+ sal_IntPtr GetParentWindowHandle( sal_Bool bUseJava = sal_False );
+};
+
+#endif // _SV_SYSCHILD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx
new file mode 100644
index 000000000000..d06e72aee22f
--- /dev/null
+++ b/include/vcl/sysdata.hxx
@@ -0,0 +1,272 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_SYSDATA_HXX
+#define _SV_SYSDATA_HXX
+
+#include <vector>
+#include <cstddef>
+
+#ifdef MACOSX
+// predeclare the native classes to avoid header/include problems
+typedef struct CGContext *CGContextRef;
+typedef struct CGLayer *CGLayerRef;
+#ifdef ENABLE_CORETEXT
+typedef const struct __CTFont * CTFontRef;
+#endif
+#ifdef __OBJC__
+@class NSView;
+#else
+class NSView;
+#endif
+#endif
+
+#ifdef IOS
+typedef const struct __CTFont * CTFontRef;
+typedef struct CGContext *CGContextRef;
+#endif
+
+#if defined( WNT )
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4201)
+#endif
+#include <windef.h>
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+#endif
+
+// -----------------
+// - SystemEnvData -
+// -----------------
+
+struct SystemEnvData
+{
+ unsigned long nSize; // size in bytes of this structure
+#if defined( WNT )
+ HWND hWnd; // the window hwnd
+#elif defined( MACOSX )
+ NSView* pView; // the cocoa (NSView *) implementing this object
+#elif defined( ANDROID )
+ // Nothing
+#elif defined( IOS )
+ // Nothing
+#elif defined( UNX )
+ void* pDisplay; // the relevant display connection
+ long aWindow; // the window of the object
+ void* pSalFrame; // contains a salframe, if object has one
+ void* pWidget; // the corresponding widget
+ void* pVisual; // the visual in use
+ int nScreen; // the current screen of the window
+ int nDepth; // depth of said visual
+ long aColormap; // the colormap being used
+ void* pAppContext; // the application context in use
+ long aShellWindow; // the window of the frame's shell
+ void* pShellWidget; // the frame's shell widget
+#endif
+};
+
+#define SystemChildData SystemEnvData
+
+// --------------------
+// - SystemParentData -
+// --------------------
+
+struct SystemParentData
+{
+ unsigned long nSize; // size in bytes of this structure
+#if defined( WNT )
+ HWND hWnd; // the window hwnd
+#elif defined( MACOSX )
+ NSView* pView; // the cocoa (NSView *) implementing this object
+#elif defined( ANDROID )
+ // Nothing
+#elif defined( IOS )
+ // Nothing
+#elif defined( UNX )
+ long aWindow; // the window of the object
+ bool bXEmbedSupport:1; // decides whether the object in question
+ // should support the XEmbed protocol
+#endif
+};
+
+// --------------------
+// - SystemMenuData -
+// --------------------
+
+struct SystemMenuData
+{
+ unsigned long nSize; // size in bytes of this structure
+#if defined( WNT )
+ HMENU hMenu; // the menu handle of the menu bar
+#elif defined( MACOSX )
+ // Nothing
+#elif defined( ANDROID )
+ // Nothing
+#elif defined( IOS )
+ // Nothing
+#elif defined( UNX )
+ long aMenu; // ???
+#endif
+};
+
+// --------------------
+// - SystemGraphicsData -
+// --------------------
+
+struct SystemGraphicsData
+{
+ unsigned long nSize; // size in bytes of this structure
+#if defined( WNT )
+ HDC hDC; // handle to a device context
+#elif defined( MACOSX )
+ CGContextRef rCGContext; // CoreGraphics graphic context
+#elif defined( ANDROID )
+ // Nothing
+#elif defined( IOS )
+ // Nothing
+#elif defined( UNX )
+ void* pDisplay; // the relevant display connection
+ long hDrawable; // a drawable
+ void* pVisual; // the visual in use
+ int nScreen; // the current screen of the drawable
+ int nDepth; // depth of said visual
+ long aColormap; // the colormap being used
+ void* pXRenderFormat; // render format for drawable
+#endif
+ SystemGraphicsData()
+ : nSize( sizeof( SystemGraphicsData ) )
+#if defined( WNT )
+ , hDC( 0 )
+#elif defined( MACOSX )
+ // Nothing
+#elif defined( ANDROID )
+ // Nothing
+#elif defined( IOS )
+ // Nothing
+#elif defined( UNX )
+ , pDisplay( NULL )
+ , hDrawable( 0 )
+ , pVisual( NULL )
+ , nScreen( 0 )
+ , nDepth( 0 )
+ , aColormap( 0 )
+ , pXRenderFormat( NULL )
+#endif
+ { }
+};
+
+
+// --------------------
+// - SystemWindowData -
+// --------------------
+
+struct SystemWindowData
+{
+ unsigned long nSize; // size in bytes of this structure
+#if defined( WNT ) // meaningless on Windows
+#elif defined( MACOSX ) // meaningless on Mac OS X
+ // Nothing
+#elif defined( ANDROID )
+ // Nothing
+#elif defined( IOS )
+ // Nothing
+#elif defined( UNX )
+ void* pVisual; // the visual to be used
+#endif
+};
+
+
+// --------------------
+// - SystemGlyphData -
+// --------------------
+
+struct SystemGlyphData
+{
+ unsigned long index;
+ double x;
+ double y;
+ int fallbacklevel;
+};
+
+
+// --------------------
+// - SystemFontData -
+// --------------------
+struct SystemFontData
+{
+ unsigned long nSize; // size in bytes of this structure
+#if defined( WNT )
+ HFONT hFont; // native font object
+#elif defined( MACOSX )
+#ifdef ENABLE_CORETEXT
+ CTFontRef rCTFont; // native font object
+#else
+ void* aATSUFontID; // native font object
+#endif
+#elif defined( IOS )
+ CTFontRef rCTFont; // native font object
+#elif defined( UNX )
+ void* nFontId; // native font id
+ int nFontFlags; // native font flags
+#endif
+ bool bFakeBold; // Does this font need faking the bold style
+ bool bFakeItalic; // Does this font need faking the italic style
+ bool bAntialias; // Should this font be antialiased
+ bool bVerticalCharacterType; // Is the font using vertical character type
+
+ SystemFontData()
+ : nSize( sizeof( SystemFontData ) )
+#if defined( WNT )
+ , hFont( 0 )
+#elif defined( MACOSX )
+#ifdef ENABLE_CORETEXT
+#else
+ , aATSUFontID( NULL )
+#endif
+#elif defined( IOS )
+#elif defined( UNX )
+ , nFontId( NULL )
+ , nFontFlags( 0 )
+#endif
+ , bFakeBold( false )
+ , bFakeItalic( false )
+ , bAntialias( true )
+ , bVerticalCharacterType( false )
+ {
+ }
+};
+
+// --------------------
+// - SystemTextLayoutData -
+// --------------------
+
+typedef std::vector<SystemGlyphData> SystemGlyphDataVector;
+
+struct SystemTextLayoutData
+{
+ unsigned long nSize; // size in bytes of this structure
+ SystemGlyphDataVector rGlyphData; // glyph data
+ int orientation; // Text orientation
+};
+
+#endif // _SV_SYSDATA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
new file mode 100644
index 000000000000..07661431a94a
--- /dev/null
+++ b/include/vcl/syswin.hxx
@@ -0,0 +1,270 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_SYSWIN_HXX
+#define _SV_SYSWIN_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/window.hxx>
+
+class ModalDialog;
+class MenuBar;
+class TaskPaneList;
+
+// --------------
+// - Icon-Types -
+// --------------
+
+#define ICON_LO_DEFAULT 1
+#define ICON_TEXT_DOCUMENT 2
+#define ICON_TEXT_TEMPLATE 3
+#define ICON_SPREADSHEET_DOCUMENT 4
+#define ICON_SPREADSHEET_TEMPLATE 5
+#define ICON_DRAWING_DOCUMENT 6
+#define ICON_DRAWING_TEMPLATE 7
+#define ICON_PRESENTATION_DOCUMENT 8
+#define ICON_PRESENTATION_TEMPLATE 9
+#define ICON_MASTER_DOCUMENT 10
+#define ICON_TEMPLATE 11
+#define ICON_DATABASE_DOCUMENT 12
+#define ICON_MATH_DOCUMENT 13
+#define ICON_MACROLIBRARY 1
+#define ICON_SETUP 500
+
+// -------------------
+// - WindowStateData -
+// -------------------
+
+#define WINDOWSTATE_MASK_X ((sal_uLong)0x00000001)
+#define WINDOWSTATE_MASK_Y ((sal_uLong)0x00000002)
+#define WINDOWSTATE_MASK_WIDTH ((sal_uLong)0x00000004)
+#define WINDOWSTATE_MASK_HEIGHT ((sal_uLong)0x00000008)
+#define WINDOWSTATE_MASK_STATE ((sal_uLong)0x00000010)
+#define WINDOWSTATE_MASK_MINIMIZED ((sal_uLong)0x00000020)
+#define WINDOWSTATE_MASK_MAXIMIZED_X ((sal_uLong)0x00000100)
+#define WINDOWSTATE_MASK_MAXIMIZED_Y ((sal_uLong)0x00000200)
+#define WINDOWSTATE_MASK_MAXIMIZED_WIDTH ((sal_uLong)0x00000400)
+#define WINDOWSTATE_MASK_MAXIMIZED_HEIGHT ((sal_uLong)0x00000800)
+#define WINDOWSTATE_MASK_POS (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y)
+#define WINDOWSTATE_MASK_ALL (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT | WINDOWSTATE_MASK_MAXIMIZED_X | WINDOWSTATE_MASK_MAXIMIZED_Y | WINDOWSTATE_MASK_MAXIMIZED_WIDTH | WINDOWSTATE_MASK_MAXIMIZED_HEIGHT | WINDOWSTATE_MASK_STATE | WINDOWSTATE_MASK_MINIMIZED)
+
+#define WINDOWSTATE_STATE_NORMAL ((sal_uLong)0x00000001)
+#define WINDOWSTATE_STATE_MINIMIZED ((sal_uLong)0x00000002)
+#define WINDOWSTATE_STATE_MAXIMIZED ((sal_uLong)0x00000004)
+#define WINDOWSTATE_STATE_ROLLUP ((sal_uLong)0x00000008)
+#define WINDOWSTATE_STATE_MAXIMIZED_HORZ ((sal_uLong)0x00000010)
+#define WINDOWSTATE_STATE_MAXIMIZED_VERT ((sal_uLong)0x00000020)
+#define WINDOWSTATE_STATE_SYSTEMMASK ((sal_uLong)0x0000FFFF)
+
+class VCL_PLUGIN_PUBLIC WindowStateData
+{
+private:
+ sal_uInt32 mnValidMask;
+ int mnX;
+ int mnY;
+ unsigned int mnWidth;
+ unsigned int mnHeight;
+ int mnMaximizedX;
+ int mnMaximizedY;
+ unsigned int mnMaximizedWidth;
+ unsigned int mnMaximizedHeight;
+ sal_uInt32 mnState;
+
+public:
+ WindowStateData()
+ {
+ mnValidMask = mnX = mnY = mnWidth = mnHeight = mnState = 0;
+ mnMaximizedX = mnMaximizedY = mnMaximizedWidth = mnMaximizedHeight = 0;
+ }
+
+ void SetMask( sal_uLong nValidMask ) { mnValidMask = nValidMask; }
+ sal_uInt32 GetMask() const { return mnValidMask; }
+
+ void SetX( int nX ) { mnX = nX; }
+ int GetX() const { return mnX; }
+ void SetY( int nY ) { mnY = nY; }
+ int GetY() const { return mnY; }
+ void SetWidth( unsigned int nWidth ) { mnWidth = nWidth; }
+ unsigned int GetWidth() const { return mnWidth; }
+ void SetHeight( unsigned int nHeight ) { mnHeight = nHeight; }
+ unsigned int GetHeight() const { return mnHeight; }
+ void SetState( sal_uInt32 nState ) { mnState = nState; }
+ sal_uInt32 GetState() const { return mnState; }
+ void SetMaximizedX( int nRX ) { mnMaximizedX = nRX; }
+ int GetMaximizedX() const { return mnMaximizedX; }
+ void SetMaximizedY( int nRY ) { mnMaximizedY = nRY; }
+ int GetMaximizedY() const { return mnMaximizedY; }
+ void SetMaximizedWidth( unsigned int nRWidth ) { mnMaximizedWidth = nRWidth; }
+ unsigned int GetMaximizedWidth() const { return mnMaximizedWidth; }
+ void SetMaximizedHeight( unsigned int nRHeight ) { mnMaximizedHeight = nRHeight; }
+ unsigned int GetMaximizedHeight() const { return mnMaximizedHeight; }
+};
+
+// ----------------------
+// - SystemWindow-Types -
+// ----------------------
+
+#define MENUBAR_MODE_NORMAL ((sal_uInt16)0)
+#define MENUBAR_MODE_HIDE ((sal_uInt16)1)
+
+#define TITLE_BUTTON_DOCKING ((sal_uInt16)1)
+#define TITLE_BUTTON_HIDE ((sal_uInt16)2)
+#define TITLE_BUTTON_MENU ((sal_uInt16)4)
+
+// ----------------
+// - SystemWindow -
+// ----------------
+
+
+class VCL_DLLPUBLIC SystemWindow : public Window
+{
+ friend class WorkWindow;
+ class ImplData;
+
+private:
+ MenuBar* mpMenuBar;
+ Size maOrgSize;
+ Size maRollUpOutSize;
+ Size maMinOutSize;
+ sal_Bool mbPined;
+ sal_Bool mbRollUp;
+ sal_Bool mbRollFunc;
+ sal_Bool mbDockBtn;
+ sal_Bool mbHideBtn;
+ sal_Bool mbSysChild;
+ sal_uInt16 mnMenuBarMode;
+ sal_uInt16 mnIcon;
+ ImplData* mpImplData;
+
+public:
+ using Window::ImplIsInTaskPaneList;
+ SAL_DLLPRIVATE sal_Bool ImplIsInTaskPaneList( Window* pWin );
+
+private:
+ // Default construction is forbidden and not implemented.
+ SystemWindow();
+
+ // Copy assignment is forbidden and not implemented.
+ SystemWindow (const SystemWindow &);
+ SystemWindow & operator= (const SystemWindow &);
+
+ SAL_DLLPRIVATE void ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, long i_nHeight, Window* i_pConfigureWin );
+
+protected:
+ // Single argument ctors shall be explicit.
+ explicit SystemWindow( WindowType nType );
+
+ void SetWindowStateData( const WindowStateData& rData );
+
+public:
+ ~SystemWindow();
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ virtual sal_Bool Close();
+ virtual void TitleButtonClick( sal_uInt16 nButton );
+ virtual void Pin();
+ virtual void Roll();
+ virtual void Resizing( Size& rSize );
+
+ void SetIcon( sal_uInt16 nIcon );
+ sal_uInt16 GetIcon() const { return mnIcon; }
+ // for systems like MacOSX which can display the URL a document is loaded from
+ // separately from the window title
+ void SetRepresentedURL( const OUString& );
+
+ void EnableSaveBackground( sal_Bool bSave = sal_True );
+ sal_Bool IsSaveBackgroundEnabled() const;
+
+ void ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible = sal_True );
+ sal_Bool IsTitleButtonVisible( sal_uInt16 nButton ) const;
+
+ void SetPin( sal_Bool bPin );
+ sal_Bool IsPined() const { return mbPined; }
+
+ void RollUp();
+ void RollDown();
+ sal_Bool IsRollUp() const { return mbRollUp; }
+
+ void SetRollUpOutputSizePixel( const Size& rSize ) { maRollUpOutSize = rSize; }
+ Size GetRollUpOutputSizePixel() const { return maRollUpOutSize; }
+
+ void SetMinOutputSizePixel( const Size& rSize );
+ const Size& GetMinOutputSizePixel() const { return maMinOutSize; }
+ void SetMaxOutputSizePixel( const Size& rSize );
+ const Size& GetMaxOutputSizePixel() const;
+ Size GetResizeOutputSizePixel() const;
+
+ void SetWindowState(const OString& rStr);
+ OString GetWindowState(sal_uLong nMask = WINDOWSTATE_MASK_ALL) const;
+
+ void SetMenuBar( MenuBar* pMenuBar );
+ MenuBar* GetMenuBar() const { return mpMenuBar; }
+ void SetMenuBarMode( sal_uInt16 nMode );
+ sal_uInt16 GetMenuBarMode() const { return mnMenuBarMode; }
+
+ TaskPaneList* GetTaskPaneList();
+ void GetWindowStateData( WindowStateData& rData ) const;
+
+ /**
+ Returns the screen number the window is on
+
+ The Display Screen number is counted the same way that
+ <code>Application::GetScreenPosSizePixel</code>,
+ <code>Application::GetWorkAreaPosSizePixel</code>,
+ <code>Application::GetDisplayScreenName</code>
+ and of course <code>SystemWindow::SetScreenNumber</code>
+ are counted in.
+
+ In case the window is positioned on multiple screens the
+ screen number returned will be of the screen containing the
+ upper left pixel of the frame area (that is of the client
+ area on system decorated windows, or the frame area of
+ undecorated resp. owner decorated windows.
+
+ @returns the screen number
+
+ @see SystemWindow::SetScreenNumber
+ */
+ unsigned int GetScreenNumber() const;
+ /**
+ Move the Window to a new screen. The same rules for
+ positioning apply as in <code>SystemWindow::GetScreenNumber</code>
+
+ The Display Screen number is counted the same way that
+ <code>Application::GetScreenPosSizePixel</code>,
+ <code>Application::GetWorkAreaPosSizePixel</code>,
+ <code>Application::GetDisplayScreenName</code>
+ and of course <code>SystemWindow::GetScreenNumber</code>
+ are counted in.
+
+ @see GetScreenNumber
+ */
+ void SetScreenNumber( unsigned int nNewScreen );
+
+ void SetApplicationID( const OUString &rApplicationID );
+
+ void SetCloseHdl(const Link& rLink);
+ const Link& GetCloseHdl() const;
+};
+
+#endif // _SV_SYSWIN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx
new file mode 100644
index 000000000000..05b8313b537b
--- /dev/null
+++ b/include/vcl/tabctrl.hxx
@@ -0,0 +1,208 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_TABCTRL_HXX
+#define _SV_TABCTRL_HXX
+
+#include "tools/solar.h"
+#include "vcl/dllapi.h"
+#include "vcl/ctrl.hxx"
+
+struct ImplTabItem;
+struct ImplTabCtrlData;
+class TabPage;
+class PushButton;
+class ListBox;
+
+// --------------------
+// - TabControl-Types -
+// --------------------
+
+#ifndef TAB_APPEND
+#define TAB_APPEND ((sal_uInt16)0xFFFF)
+#define TAB_PAGE_NOTFOUND ((sal_uInt16)0xFFFF)
+#endif /* !TAB_APPEND */
+
+// --------------
+// - TabControl -
+// --------------
+
+class VCL_DLLPUBLIC TabControl : public Control
+{
+private:
+ ImplTabCtrlData* mpTabCtrlData;
+ long mnLastWidth;
+ long mnLastHeight;
+ long mnBtnSize;
+ long mnMaxPageWidth;
+ sal_uInt16 mnActPageId;
+ sal_uInt16 mnCurPageId;
+ sal_Bool mbFormat;
+ sal_Bool mbRestoreHelpId;
+ sal_Bool mbRestoreUnqId;
+ sal_Bool mbSmallInvalidate;
+ bool mbLayoutDirty;
+ Link maActivateHdl;
+ Link maDeactivateHdl;
+
+ using Control::ImplInitSettings;
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE ImplTabItem* ImplGetItem( sal_uInt16 nId ) const;
+ SAL_DLLPRIVATE Size ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth );
+ SAL_DLLPRIVATE Rectangle ImplGetTabRect( sal_uInt16 nPos, long nWidth = -1, long nHeight = -1 );
+ SAL_DLLPRIVATE void ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId );
+ SAL_DLLPRIVATE sal_Bool ImplPosCurTabPage();
+ SAL_DLLPRIVATE void ImplActivateTabPage( sal_Bool bNext );
+ SAL_DLLPRIVATE void ImplShowFocus();
+ SAL_DLLPRIVATE void ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bool bLayout = false, bool bFirstInGroup = false, bool bLastInGroup = false, bool bIsCurrentItem = false );
+ SAL_DLLPRIVATE void ImplPaint( const Rectangle& rRect, bool bLayout = false );
+ SAL_DLLPRIVATE void ImplFreeLayoutData();
+ SAL_DLLPRIVATE long ImplHandleKeyEvent( const KeyEvent& rKeyEvent );
+
+ DECL_DLLPRIVATE_LINK( ImplListBoxSelectHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplWindowEventListener, VclSimpleEvent* );
+
+
+protected:
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+
+ virtual void FillLayoutData() const;
+ virtual const Font& GetCanonicalFont( const StyleSettings& _rStyle ) const;
+ virtual const Color& GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
+ SAL_DLLPRIVATE Rectangle* ImplFindPartRect( const Point& rPt );
+
+public:
+ TabControl( Window* pParent,
+ WinBits nStyle = WB_STDTABCONTROL );
+ TabControl( Window* pParent, const ResId& rResId );
+ ~TabControl();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ virtual void ActivatePage();
+ virtual long DeactivatePage();
+
+ virtual Size GetOptimalSize() const;
+
+ void SetTabPageSizePixel( const Size& rSize );
+ Size GetTabPageSizePixel() const;
+
+ // pixel offset for the tab items, default is (0,0)
+ void SetItemsOffset( const Point& rOffs );
+ Point GetItemsOffset() const;
+
+ void InsertPage( const ResId& rResId,
+ sal_uInt16 nPos = TAB_APPEND );
+ void InsertPage( sal_uInt16 nPageId, const XubString& rText,
+ sal_uInt16 nPos = TAB_APPEND );
+ void RemovePage( sal_uInt16 nPageId );
+ void Clear();
+ void EnablePage( sal_uInt16 nPageId, bool bEnable = true );
+
+ sal_uInt16 GetPagePos( sal_uInt16 nPageId ) const;
+ sal_uInt16 GetPageCount() const;
+ sal_uInt16 GetPageId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetPageId( const Point& rPos ) const;
+ sal_uInt16 GetPageId( const TabPage& rPage ) const;
+ sal_uInt16 GetPageId( const OString& rName ) const;
+
+ void SetCurPageId( sal_uInt16 nPageId );
+ sal_uInt16 GetCurPageId() const;
+
+ void SelectTabPage( sal_uInt16 nPageId );
+
+ void SetMaxPageWidth( long nMaxWidth ) { mnMaxPageWidth = nMaxWidth; }
+ long GetMaxPageWidth() const { return mnMaxPageWidth; }
+ void ResetMaxPageWidth() { SetMaxPageWidth( 0 ); }
+ sal_Bool IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
+
+ void SetTabPage( sal_uInt16 nPageId, TabPage* pPage );
+ TabPage* GetTabPage( sal_uInt16 nPageId ) const;
+
+ void SetPageText( sal_uInt16 nPageId, const XubString& rText );
+ XubString GetPageText( sal_uInt16 nPageId ) const;
+
+ void SetHelpText( sal_uInt16 nPageId, const XubString& rText );
+ const XubString& GetHelpText( sal_uInt16 nPageId ) const;
+
+ void SetHelpId( sal_uInt16 nPageId, const OString& rId ) const;
+ OString GetHelpId( sal_uInt16 nPageId ) const;
+
+ void SetPageName( sal_uInt16 nPageId, const OString& rName ) const;
+ OString GetPageName( sal_uInt16 nPageId ) const;
+
+ void SetPageImage( sal_uInt16 nPageId, const Image& rImage );
+
+ void SetHelpText( const XubString& rText )
+ { Control::SetHelpText( rText ); }
+ const XubString& GetHelpText() const
+ { return Control::GetHelpText(); }
+
+ void SetHelpId( const OString& rId )
+ { Control::SetHelpId( rId ); }
+ const OString& GetHelpId() const
+ { return Control::GetHelpId(); }
+
+ void SetActivatePageHdl( const Link& rLink ) { maActivateHdl = rLink; }
+ const Link& GetActivatePageHdl() const { return maActivateHdl; }
+ void SetDeactivatePageHdl( const Link& rLink ) { maDeactivateHdl = rLink; }
+ const Link& GetDeactivatePageHdl() const { return maDeactivateHdl; }
+
+ // returns (control relative) bounding rectangle for the
+ // character at index nIndex relative to the text of page nPageId
+ using Control::GetCharacterBounds;
+ Rectangle GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) const;
+
+ // returns the index relative to the text of page nPageId (also returned)
+ // at position rPoint (control relative)
+ using Control::GetIndexForPoint;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rPageId ) const;
+
+ // returns the rectangle of the tab for page nPageId
+ Rectangle GetTabBounds( sal_uInt16 nPageId ) const;
+
+ virtual void SetPosPixel(const Point& rPos);
+ virtual void SetSizePixel(const Size& rNewSize);
+ virtual void SetPosSizePixel(const Point& rNewPos, const Size& rNewSize);
+
+ Size calculateRequisition() const;
+ void setAllocation(const Size &rAllocation);
+
+ void markLayoutDirty()
+ {
+ mbLayoutDirty = true;
+ }
+};
+
+#endif // _SV_TABCTRL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/tabdlg.hxx b/include/vcl/tabdlg.hxx
new file mode 100644
index 000000000000..7555f3f01701
--- /dev/null
+++ b/include/vcl/tabdlg.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 _SV_TABDLG_HXX
+#define _SV_TABDLG_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/dialog.hxx>
+
+class FixedLine;
+class TabControl;
+
+// ----------------------
+// - TabDialog -
+// ----------------------
+
+class VCL_DLLPUBLIC TabDialog : public Dialog
+{
+private:
+ FixedLine* mpFixedLine;
+ Window* mpViewWindow;
+ WindowAlign meViewAlign;
+ sal_Bool mbPosControls;
+
+ SAL_DLLPRIVATE void ImplInitTabDialogData();
+ SAL_DLLPRIVATE void ImplPosControls();
+
+public:
+ TabDialog( Window* pParent,
+ WinBits nStyle = WB_STDTABDIALOG );
+ TabDialog( Window* pParent, const ResId& rResId );
+ TabDialog( Window* pParent, const OString& rID, const OUString& rUIXMLDescription );
+ ~TabDialog();
+
+ virtual void StateChanged( StateChangedType nStateChange );
+
+ void AdjustLayout();
+
+ void SetViewWindow( Window* pWindow ) { mpViewWindow = pWindow; }
+ Window* GetViewWindow() const { return mpViewWindow; }
+ void SetViewAlign( WindowAlign eAlign ) { meViewAlign = eAlign; }
+ WindowAlign GetViewAlign() const { return meViewAlign; }
+};
+
+#endif // _SV_TABDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/tabpage.hxx b/include/vcl/tabpage.hxx
new file mode 100644
index 000000000000..3414ec76e834
--- /dev/null
+++ b/include/vcl/tabpage.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 _SV_TABPAGE_HXX
+#define _SV_TABPAGE_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/builder.hxx>
+#include <vcl/window.hxx>
+
+// -----------
+// - TabPage -
+// -----------
+
+class VCL_DLLPUBLIC TabPage
+ : public Window
+ , public VclBuilderContainer
+{
+private:
+ using Window::ImplInit;
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings();
+
+public:
+ TabPage( Window* pParent, WinBits nStyle = 0 );
+ TabPage(Window *pParent, const OString& rID, const OUString& rUIXMLDescription);
+
+ TabPage( Window* pParent, const ResId& rResId );
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void ActivatePage();
+ virtual void DeactivatePage();
+
+ //To-Do, consider inheriting from VclContainer
+ virtual void SetPosSizePixel(const Point& rNewPos, const Size& rNewSize);
+ virtual void SetPosPixel(const Point& rNewPos);
+ virtual void SetSizePixel(const Size& rNewSize);
+ virtual Size GetOptimalSize() const;
+};
+
+#endif // _SV_TABPAGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/taskpanelist.hxx b/include/vcl/taskpanelist.hxx
new file mode 100644
index 000000000000..9a9621b77e88
--- /dev/null
+++ b/include/vcl/taskpanelist.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 _SV_TASKPANELIST_HXX
+#define _SV_TASKPANELIST_HXX
+
+#include <vcl/dllapi.h>
+
+#include <vector>
+#include <vcl/window.hxx>
+
+class VCL_DLLPUBLIC TaskPaneList
+{
+ ::std::vector<Window *> mTaskPanes;
+ Window *FindNextFloat( Window *pWindow, sal_Bool bForward = sal_True );
+ Window *FindNextSplitter( Window *pWindow, sal_Bool bForward = sal_True );
+
+public:
+ sal_Bool IsInList( Window *pWindow );
+
+public:
+ TaskPaneList();
+ ~TaskPaneList();
+
+ void AddWindow( Window *pWindow );
+ void RemoveWindow( Window *pWindow );
+ sal_Bool HandleKeyEvent( KeyEvent aKeyEvent );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/textdata.hxx b/include/vcl/textdata.hxx
new file mode 100644
index 000000000000..476ba00279df
--- /dev/null
+++ b/include/vcl/textdata.hxx
@@ -0,0 +1,172 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TEXTDATA_HXX
+#define _TEXTDATA_HXX
+
+#include <vcl/dllapi.h>
+#include <svl/brdcst.hxx>
+#include <svl/smplhint.hxx>
+#include <tools/string.hxx>
+
+// for Notify, if all paragraphs were deleted
+#define TEXT_PARA_ALL 0xFFFFFFFF
+
+class TextPaM
+{
+private:
+ sal_uLong mnPara;
+ sal_uInt16 mnIndex;
+
+public:
+ TextPaM() { mnPara = 0, mnIndex = 0; }
+ TextPaM( sal_uLong nPara, sal_uInt16 nIndex ) { mnPara = nPara, mnIndex = nIndex; }
+
+ sal_uLong GetPara() const { return mnPara; }
+ sal_uLong& GetPara() { return mnPara; }
+
+ sal_uInt16 GetIndex() const { return mnIndex; }
+ sal_uInt16& GetIndex() { return mnIndex; }
+
+ inline sal_Bool operator == ( const TextPaM& rPaM ) const;
+ inline sal_Bool operator != ( const TextPaM& rPaM ) const;
+ inline sal_Bool operator < ( const TextPaM& rPaM ) const;
+ inline sal_Bool operator > ( const TextPaM& rPaM ) const;
+};
+
+inline sal_Bool TextPaM::operator == ( const TextPaM& rPaM ) const
+{
+ return ( ( mnPara == rPaM.mnPara ) && ( mnIndex == rPaM.mnIndex ) ) ? sal_True : sal_False;
+}
+
+inline sal_Bool TextPaM::operator != ( const TextPaM& rPaM ) const
+{
+ return !( *this == rPaM );
+}
+
+inline sal_Bool TextPaM::operator < ( const TextPaM& rPaM ) const
+{
+ return ( ( mnPara < rPaM.mnPara ) ||
+ ( ( mnPara == rPaM.mnPara ) && mnIndex < rPaM.mnIndex ) ) ? sal_True : sal_False;
+}
+
+inline sal_Bool TextPaM::operator > ( const TextPaM& rPaM ) const
+{
+ return ( ( mnPara > rPaM.mnPara ) ||
+ ( ( mnPara == rPaM.mnPara ) && mnIndex > rPaM.mnIndex ) ) ? sal_True : sal_False;
+}
+
+class VCL_DLLPUBLIC TextSelection
+{
+private:
+ TextPaM maStartPaM;
+ TextPaM maEndPaM;
+
+public:
+ TextSelection();
+ TextSelection( const TextPaM& rPaM );
+ TextSelection( const TextPaM& rStart, const TextPaM& rEnd );
+
+ const TextPaM& GetStart() const { return maStartPaM; }
+ TextPaM& GetStart() { return maStartPaM; }
+
+ const TextPaM& GetEnd() const { return maEndPaM; }
+ TextPaM& GetEnd() { return maEndPaM; }
+
+ void Justify();
+
+ sal_Bool HasRange() const { return maStartPaM != maEndPaM; }
+
+ inline sal_Bool operator == ( const TextSelection& rSel ) const;
+ inline sal_Bool operator != ( const TextSelection& rSel ) const;
+};
+
+inline sal_Bool TextSelection::operator == ( const TextSelection& rSel ) const
+{
+ return ( ( maStartPaM == rSel.maStartPaM ) && ( maEndPaM == rSel.maEndPaM ) );
+}
+
+inline sal_Bool TextSelection::operator != ( const TextSelection& rSel ) const
+{
+ return !( *this == rSel );
+}
+
+#define TEXT_HINT_PARAINSERTED 1
+#define TEXT_HINT_PARAREMOVED 2
+#define TEXT_HINT_PARACONTENTCHANGED 3
+#define TEXT_HINT_TEXTHEIGHTCHANGED 4
+#define TEXT_HINT_FORMATPARA 5
+#define TEXT_HINT_TEXTFORMATTED 6
+#define TEXT_HINT_MODIFIED 7
+#define TEXT_HINT_BLOCKNOTIFICATION_START 8
+#define TEXT_HINT_BLOCKNOTIFICATION_END 9
+#define TEXT_HINT_INPUT_START 10
+#define TEXT_HINT_INPUT_END 11
+
+#define TEXT_HINT_VIEWSCROLLED 100
+#define TEXT_HINT_VIEWSELECTIONCHANGED 101
+
+class VCL_DLLPUBLIC TextHint : public SfxSimpleHint
+{
+private:
+ sal_uLong mnValue;
+
+public:
+ TYPEINFO();
+ TextHint( sal_uLong nId );
+ TextHint( sal_uLong nId, sal_uLong nValue );
+
+ sal_uLong GetValue() const { return mnValue; }
+ void SetValue( sal_uLong n ) { mnValue = n; }
+};
+
+struct TEIMEInfos
+{
+ String aOldTextAfterStartPos;
+ sal_uInt16* pAttribs;
+ TextPaM aPos;
+ sal_uInt16 nLen;
+ sal_Bool bCursor;
+ sal_Bool bWasCursorOverwrite;
+
+ TEIMEInfos( const TextPaM& rPos, const String& rOldTextAfterStartPos );
+ ~TEIMEInfos();
+
+ void CopyAttribs( const sal_uInt16* pA, sal_uInt16 nL );
+ void DestroyAttribs();
+};
+
+// ----------------- Wrapper for old Tools List -------------------
+
+#include <vector>
+#include <algorithm>
+
+template <class T> class ToolsList : public ::std::vector< T >
+{
+public:
+ sal_uLong Count() const { return static_cast<sal_uLong>(::std::vector< T >::size()); }
+ sal_uLong GetPos( T pObject ) const { return ( ::std::find( this->begin(), this->end(), pObject ) ) - this->begin(); }
+ T GetObject( sal_uLong nIndex ) const { return (*this)[nIndex]; }
+ void Insert( T pObject, sal_uLong nPos ) { ::std::vector< T >::insert( this->begin()+nPos, pObject ); }
+ void Remove( sal_uLong nPos ) { ::std::vector< T >::erase( this->begin()+nPos ); }
+};
+
+#endif // _TEXTDATA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/texteng.hxx b/include/vcl/texteng.hxx
new file mode 100644
index 000000000000..85b5a7b59a25
--- /dev/null
+++ b/include/vcl/texteng.hxx
@@ -0,0 +1,322 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _TEXTENG_HXX
+#define _TEXTENG_HXX
+
+#include <vcl/dllapi.h>
+
+class TextDoc;
+class TextView;
+class TextPaM;
+class TextSelection;
+class TEParaPortions;
+class TextAttrib;
+class TextCharAttrib;
+class TextUndo;
+class TextUndoManager;
+class EditSelFunctionSet;
+class IdleFormatter;
+class TextNode;
+class OutputDevice;
+class SfxUndoAction;
+class KeyEvent;
+class Timer;
+
+namespace svl
+{
+ class IUndoManager;
+}
+
+class TextLine;
+class TETextPortion;
+#include <svl/brdcst.hxx>
+#include <tools/link.hxx>
+#include <vcl/font.hxx>
+#include <tools/string.hxx>
+#include <tools/gen.hxx>
+
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
+struct TEIMEInfos;
+class SvtCTLOptions;
+
+namespace com {
+namespace sun {
+namespace star {
+namespace i18n {
+ class XBreakIterator;
+ class XExtendedInputSequenceChecker;
+}}}}
+
+class LocaleDataWrapper;
+
+enum TxtAlign { TXTALIGN_LEFT, TXTALIGN_CENTER, TXTALIGN_RIGHT };
+
+typedef std::vector<TextView*> TextViews;
+
+class VCL_DLLPUBLIC TextEngine : public SfxBroadcaster
+{
+ friend class TextView;
+ friend class TextSelFunctionSet;
+ friend class ExtTextEngine;
+ friend class ExtTextView;
+
+ friend class TextUndo;
+ friend class TextUndoManager;
+ friend class TextUndoDelPara;
+ friend class TextUndoConnectParas;
+ friend class TextUndoSplitPara;
+ friend class TextUndoInsertChars;
+ friend class TextUndoRemoveChars;
+ friend class TextUndoSetAttribs;
+
+private:
+ TextDoc* mpDoc;
+ TEParaPortions* mpTEParaPortions;
+ OutputDevice* mpRefDev;
+
+ TextViews* mpViews;
+ TextView* mpActiveView;
+
+ TextUndoManager* mpUndoManager;
+
+ IdleFormatter* mpIdleFormatter;
+
+ TEIMEInfos* mpIMEInfos;
+
+ ::com::sun::star::lang::Locale maLocale;
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > mxBreakIterator;
+
+ Rectangle maInvalidRect;
+ Range maInvalidRange;
+
+ LocaleDataWrapper* mpLocaleDataWrapper;
+
+ Font maFont;
+ Color maTextColor;
+ sal_uInt16 mnCharHeight;
+ sal_uInt16 mnFixCharWidth100;
+
+ sal_uLong mnMaxTextLen;
+ sal_uLong mnMaxTextWidth;
+ sal_uLong mnCurTextWidth;
+ sal_uLong mnCurTextHeight;
+ sal_uLong mnDefTab;
+
+ TxtAlign meAlign;
+
+ sal_Bool mbIsFormatting : 1; // semaphore for the Hook's
+ sal_Bool mbFormatted : 1;
+ sal_Bool mbUpdate : 1;
+ sal_Bool mbModified : 1;
+ sal_Bool mbUndoEnabled : 1;
+ sal_Bool mbIsInUndo : 1;
+ sal_Bool mbDowning : 1;
+ sal_Bool mbRightToLeft : 1;
+ sal_Bool mbHasMultiLineParas : 1;
+
+ TextEngine( const TextEngine& ) : SfxBroadcaster() {}
+ TextEngine& operator=( const TextEngine& ) { return *this; }
+
+protected:
+
+ void CursorMoved( sal_uLong nNode );
+ void TextModified();
+
+ void ImpInitDoc();
+ void ImpRemoveText();
+ TextPaM ImpDeleteText( const TextSelection& rSel );
+ TextPaM ImpInsertText( const TextSelection& rSel, sal_Unicode c, sal_Bool bOverwrite = sal_False );
+ TextPaM ImpInsertText( const TextSelection& rSel, const String& rText );
+ TextPaM ImpInsertParaBreak( const TextSelection& rTextSelection, sal_Bool bKeepEndingAttribs = sal_True );
+ TextPaM ImpInsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs = sal_True );
+ void ImpRemoveChars( const TextPaM& rPaM, sal_uInt16 nChars, SfxUndoAction* pCurUndo = 0 );
+ TextPaM ImpConnectParagraphs( sal_uLong nLeft, sal_uLong nRight );
+ void ImpRemoveParagraph( sal_uLong nPara );
+ void ImpInitWritingDirections( sal_uLong nPara );
+ LocaleDataWrapper* ImpGetLocaleDataWrapper();
+
+ // to remain compatible in the minor release we copy the above ImpInsertText
+ // function and add the extra parameter we need but make sure this function
+ // gets not exported. First and seconf parameter swapped to have a different signatur.
+ SAL_DLLPRIVATE TextPaM ImpInsertText( sal_Unicode c, const TextSelection& rSel, sal_Bool bOverwrite = sal_False, sal_Bool bIsUserInput = sal_False );
+ // some other new functions needed that must not be exported to remain compatible
+ SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > GetInputSequenceChecker() const;
+ SAL_DLLPRIVATE sal_Bool IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const;
+
+ // broadcast or adjust selections
+ void ImpParagraphInserted( sal_uLong nPara );
+ void ImpParagraphRemoved( sal_uLong nPara );
+ void ImpCharsRemoved( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars );
+ void ImpCharsInserted( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars );
+ void ImpFormattingParagraph( sal_uLong nPara );
+ void ImpTextHeightChanged();
+ void ImpTextFormatted();
+
+ DECL_LINK( IdleFormatHdl, void * );
+ void CheckIdleFormatter();
+ void IdleFormatAndUpdate( TextView* pCurView = 0, sal_uInt16 nMaxTimerRestarts = 5 );
+
+ sal_Bool CreateLines( sal_uLong nPara );
+ void CreateAndInsertEmptyLine( sal_uLong nPara );
+ void ImpBreakLine( sal_uLong nPara, TextLine* pLine, TETextPortion* pPortion, sal_uInt16 nPortionStart, long nRemainingWidth );
+ sal_uInt16 SplitTextPortion( sal_uLong nPara, sal_uInt16 nPos );
+ void CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos );
+ void RecalcTextPortion( sal_uLong nPara, sal_uInt16 nStartPos, short nNewChars );
+ void SeekCursor( sal_uLong nNode, sal_uInt16 nPos, Font& rFont, OutputDevice* pOutDev );
+
+ void FormatDoc();
+ void FormatFullDoc();
+ void FormatAndUpdate( TextView* pCurView = 0 );
+ sal_Bool IsFormatting() const { return mbIsFormatting; }
+ void UpdateViews( TextView* pCurView = 0 );
+
+ void ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange = 0, TextSelection const* pSelection = 0 );
+
+ void UpdateSelections();
+
+ sal_Bool IsFormatted() const { return mbFormatted; }
+
+ sal_uInt16 GetCharPos( sal_uLong nPara, sal_uInt16 nLine, long nDocPosX, sal_Bool bSmart = sal_False );
+ Rectangle GetEditCursor( const TextPaM& rPaM, sal_Bool bSpecial, sal_Bool bPreferPortionStart = sal_False );
+ sal_uInt16 ImpFindIndex( sal_uLong nPortion, const Point& rPosInPara, sal_Bool bSmart );
+ long ImpGetPortionXOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nTextPortion );
+ long ImpGetXPos( sal_uLong nPara, TextLine* pLine, sal_uInt16 nIndex, sal_Bool bPreferPortionStart = sal_False );
+ long ImpGetOutputOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nIndex, sal_uInt16 nIndex2 );
+ sal_uInt8 ImpGetRightToLeft( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16* pStart = NULL, sal_uInt16* pEnd = NULL );
+ void ImpInitLayoutMode( OutputDevice* pOutDev, sal_Bool bDrawingR2LPortion = sal_False );
+ TxtAlign ImpGetAlign() const;
+
+ sal_uLong CalcTextHeight();
+ sal_uLong CalcParaHeight( sal_uLong nParagraph ) const;
+ sal_uLong CalcTextWidth( sal_uLong nPara );
+ sal_uLong CalcTextWidth( sal_uLong nPara, sal_uInt16 nPortionStart, sal_uInt16 nPortionLen, const Font* pFont = 0 );
+ Range GetInvalidYOffsets( sal_uLong nPortion );
+
+ // for Undo/Redo
+ void InsertContent( TextNode* pNode, sal_uLong nPara );
+ TextPaM SplitContent( sal_uLong nNode, sal_uInt16 nSepPos );
+ TextPaM ConnectContents( sal_uLong nLeftNode );
+
+ // adjust PaM's and selections that were transfered to the API to a valid range
+ void ValidateSelection( TextSelection& rSel ) const;
+ void ValidatePaM( TextPaM& rPaM ) const;
+
+public:
+ TextEngine();
+ ~TextEngine();
+
+ void SetText( const OUString& rStr );
+ String GetText( LineEnd aSeparator = LINEEND_LF ) const;
+ String GetText( const TextSelection& rSel, LineEnd aSeparator = LINEEND_LF ) const;
+ String GetTextLines( LineEnd aSeparator = LINEEND_LF ) const;
+ void ReplaceText(const TextSelection& rSel, const String& rText);
+
+ sal_uLong GetTextLen( LineEnd aSeparator = LINEEND_LF ) const;
+ sal_uLong GetTextLen( const TextSelection& rSel, LineEnd aSeparator = LINEEND_LF ) const;
+
+ void SetFont( const Font& rFont );
+ const Font& GetFont() const { return maFont; }
+
+ sal_uInt16 GetDefTab() const;
+
+ void SetLeftMargin( sal_uInt16 n );
+ sal_uInt16 GetLeftMargin() const;
+
+ void SetUpdateMode( sal_Bool bUpdate );
+ sal_Bool GetUpdateMode() const { return mbUpdate; }
+
+ sal_uInt16 GetViewCount() const;
+ TextView* GetView( sal_uInt16 nView ) const;
+ void InsertView( TextView* pTextView );
+ void RemoveView( TextView* pTextView );
+ TextView* GetActiveView() const;
+ void SetActiveView( TextView* pView );
+
+ void SetMaxTextLen( sal_uLong nLen );
+ sal_uLong GetMaxTextLen() const { return mnMaxTextLen; }
+
+ void SetMaxTextWidth( sal_uLong nWidth );
+ sal_uLong GetMaxTextWidth() const { return mnMaxTextWidth; }
+
+ sal_uLong GetTextHeight() const;
+ sal_uLong CalcTextWidth();
+ sal_uInt16 GetCharHeight() const { return mnCharHeight; }
+
+ sal_uLong GetParagraphCount() const;
+ String GetText( sal_uLong nParagraph ) const;
+ sal_uInt16 GetTextLen( sal_uLong nParagraph ) const;
+ sal_uLong GetTextHeight( sal_uLong nParagraph ) const;
+
+ sal_uInt16 GetLineCount( sal_uLong nParagraph ) const;
+ sal_uInt16 GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const;
+
+ void SetRightToLeft( sal_Bool bR2L );
+ sal_Bool IsRightToLeft() const { return mbRightToLeft; }
+
+ sal_Bool HasUndoManager() const { return mpUndoManager ? sal_True : sal_False; }
+ ::svl::IUndoManager&
+ GetUndoManager();
+ void UndoActionStart( sal_uInt16 nId = 0 );
+ void UndoActionEnd();
+ void InsertUndo( TextUndo* pUndo, sal_Bool bTryMerge = sal_False );
+ sal_Bool IsInUndo() { return mbIsInUndo; }
+ void SetIsInUndo( sal_Bool bInUndo ) { mbIsInUndo = bInUndo; }
+ void ResetUndo();
+
+ void EnableUndo( sal_Bool bEnable );
+ sal_Bool IsUndoEnabled() { return mbUndoEnabled; }
+
+ void SetModified( sal_Bool bModified ) { mbModified = bModified; }
+ sal_Bool IsModified() const { return mbModified; }
+
+ sal_Bool Read( SvStream& rInput, const TextSelection* pSel = NULL );
+
+ sal_Bool Write( SvStream& rOutput, const TextSelection* pSel = NULL, sal_Bool bHTML = sal_False );
+
+ TextPaM GetPaM( const Point& rDocPos, sal_Bool bSmart = sal_True );
+ Rectangle PaMtoEditCursor( const TextPaM& rPaM, sal_Bool bSpecial = sal_False );
+ String GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord = 0 );
+
+ sal_Bool HasAttrib( sal_uInt16 nWhich ) const;
+ const TextAttrib* FindAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const;
+ const TextCharAttrib* FindCharAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const;
+
+ void RemoveAttribs( sal_uLong nPara, sal_uInt16 nWhich, sal_Bool bIdleFormatAndUpdate );
+ void RemoveAttrib( sal_uLong nPara, const TextCharAttrib& rAttrib );
+ void RemoveAttribs( sal_uLong nPara, sal_Bool bIdleFormatAndUpdate = sal_True );
+ void SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_Bool bIdleFormatAndUpdate = sal_True );
+
+ TxtAlign GetTextAlign() const { return meAlign; }
+ void SetTextAlign( TxtAlign eAlign );
+
+ void Draw( OutputDevice* pDev, const Point& rPos );
+
+ void SetLocale( const ::com::sun::star::lang::Locale& rLocale );
+ ::com::sun::star::lang::Locale GetLocale();
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > GetBreakIterator();
+
+ static sal_Bool DoesKeyChangeText( const KeyEvent& rKeyEvent );
+ static sal_Bool IsSimpleCharInput( const KeyEvent& rKeyEvent );
+};
+
+#endif // _TEXTENG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/textview.hxx b/include/vcl/textview.hxx
new file mode 100644
index 000000000000..314e30fa4f1e
--- /dev/null
+++ b/include/vcl/textview.hxx
@@ -0,0 +1,208 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TEXTVIEW_HXX
+#define _TEXTVIEW_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/textdata.hxx>
+#include <tools/gen.hxx>
+#include <vcl/dndhelp.hxx>
+
+class TextEngine;
+class OutputDevice;
+class Window;
+class Cursor;
+class KeyEvent;
+class MouseEvent;
+class CommandEvent;
+class TextSelFunctionSet;
+class SelectionEngine;
+class VirtualDevice;
+struct TextDDInfo;
+
+namespace com {
+namespace sun {
+namespace star {
+namespace datatransfer {
+namespace clipboard {
+ class XClipboard;
+}}}}}
+
+struct ImpTextView;
+
+class VCL_DLLPUBLIC TextView : public vcl::unohelper::DragAndDropClient
+{
+ friend class TextEngine;
+ friend class TextUndo;
+ friend class TextUndoManager;
+ friend class TextSelFunctionSet;
+ friend class ExtTextView;
+
+private:
+ ImpTextView* mpImpl;
+
+ TextView( const TextView& ) : vcl::unohelper::DragAndDropClient() {}
+ TextView& operator=( const TextView& ) { return *this; }
+
+protected:
+ void ShowSelection();
+ void HideSelection();
+ void ShowSelection( const TextSelection& rSel );
+ void ImpShowHideSelection( sal_Bool bShow, const TextSelection* pRange = NULL );
+
+ TextSelection ImpMoveCursor( const KeyEvent& rKeyEvent );
+ TextPaM ImpDelete( sal_uInt8 nMode, sal_uInt8 nDelMode );
+ void ImpSetSelection( const TextSelection& rNewSel, sal_Bool bUI );
+ sal_Bool IsInSelection( const TextPaM& rPaM );
+
+ void ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange = 0, TextSelection const* pSelection = 0 );
+ void ImpPaint( const Rectangle& rRect, sal_Bool bUseVirtDev );
+ void ImpShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_Bool bEndKey );
+ void ImpHighlight( const TextSelection& rSel );
+ void ImpSetSelection( const TextSelection& rSelection );
+ Point ImpGetOutputStartPos( const Point& rStartDocPos ) const;
+
+ void ImpHideDDCursor();
+ void ImpShowDDCursor();
+
+ bool ImplTruncateNewText( OUString& rNewText ) const;
+ sal_Bool ImplCheckTextLen( const String& rNewText );
+
+ VirtualDevice* GetVirtualDevice();
+
+ // DragAndDropClient
+ virtual void dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& dsde ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
+
+ using DragAndDropClient::dragEnter;
+ using DragAndDropClient::dragExit;
+ using DragAndDropClient::dragOver;
+
+public:
+ TextView( TextEngine* pEng, Window* pWindow );
+ virtual ~TextView();
+
+ TextEngine* GetTextEngine() const;
+ Window* GetWindow() const;
+
+ void Invalidate();
+ void Scroll( long nHorzScroll, long nVertScroll );
+
+ void ShowCursor( sal_Bool bGotoCursor = sal_True, sal_Bool bForceVisCursor = sal_True );
+ void HideCursor();
+
+ void EnableCursor( sal_Bool bEnable );
+ sal_Bool IsCursorEnabled() const;
+
+ const TextSelection& GetSelection() const;
+ TextSelection& GetSelection();
+ void SetSelection( const TextSelection& rNewSel );
+ void SetSelection( const TextSelection& rNewSel, sal_Bool bGotoCursor );
+ sal_Bool HasSelection() const;
+
+ String GetSelected();
+ String GetSelected( LineEnd aSeparator );
+ void DeleteSelected();
+
+ void InsertNewText( const OUString& rNew, sal_Bool bSelect = sal_False );
+ // deprecated: use InsertNewText instead
+ void InsertText( const String& rNew, sal_Bool bSelect = sal_False );
+
+ sal_Bool KeyInput( const KeyEvent& rKeyEvent );
+ void Paint( const Rectangle& rRect );
+ void MouseButtonUp( const MouseEvent& rMouseEvent );
+ void MouseButtonDown( const MouseEvent& rMouseEvent );
+ void MouseMove( const MouseEvent& rMouseEvent );
+ void Command( const CommandEvent& rCEvt );
+
+ void Cut();
+ void Copy();
+ void Paste();
+
+ void Copy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
+ void Paste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
+
+ void Undo();
+ void Redo();
+
+ sal_Bool Read( SvStream& rInput );
+
+ void SetStartDocPos( const Point& rPos );
+ const Point& GetStartDocPos() const;
+
+ Point GetDocPos( const Point& rWindowPos ) const;
+ Point GetWindowPos( const Point& rDocPos ) const;
+
+ void SetInsertMode( sal_Bool bInsert );
+ sal_Bool IsInsertMode() const;
+
+ void SetAutoIndentMode( sal_Bool bAutoIndent );
+
+ void SetReadOnly( sal_Bool bReadOnly );
+ sal_Bool IsReadOnly() const;
+
+ void SetAutoScroll( sal_Bool bAutoScroll );
+ sal_Bool IsAutoScroll() const;
+
+ sal_Bool SetCursorAtPoint( const Point& rPointPixel );
+ sal_Bool IsSelectionAtPoint( const Point& rPointPixel );
+
+ void SetPaintSelection( sal_Bool bPaint);
+
+ void EraseVirtualDevice();
+
+ // aus dem protected Teil hierher verschoben
+ // F�r 'SvtXECTextCursor' (TL). Mu� ggf nochmal anders gel�st werden.
+ TextPaM PageUp( const TextPaM& rPaM );
+ TextPaM PageDown( const TextPaM& rPaM );
+ TextPaM CursorUp( const TextPaM& rPaM );
+ TextPaM CursorDown( const TextPaM& rPaM );
+ TextPaM CursorLeft( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode );
+ TextPaM CursorRight( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode );
+ TextPaM CursorWordLeft( const TextPaM& rPaM );
+ TextPaM CursorWordRight( const TextPaM& rPaM );
+ TextPaM CursorStartOfLine( const TextPaM& rPaM );
+ TextPaM CursorEndOfLine( const TextPaM& rPaM );
+ TextPaM CursorStartOfParagraph( const TextPaM& rPaM );
+ TextPaM CursorEndOfParagraph( const TextPaM& rPaM );
+ TextPaM CursorStartOfDoc();
+ TextPaM CursorEndOfDoc();
+
+ /**
+ Drag and Drop, deleting and selection regards all text that has an attribute
+ TEXTATTR_PROTECTED set as one entitity. Drag and dropped text is automatically
+ attibuted as protected.
+ */
+ void SupportProtectAttribute(sal_Bool bSupport);
+
+ /**
+ Returns the number in paragraph of the line in which the cursor is blinking
+ if enabled, -1 otherwise.
+ */
+ sal_Int32 GetLineNumberOfCursorInSelection() const;
+};
+
+#endif // _TEXTVIEW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/threadex.hxx b/include/vcl/threadex.hxx
new file mode 100644
index 000000000000..83198187ce1c
--- /dev/null
+++ b/include/vcl/threadex.hxx
@@ -0,0 +1,261 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <osl/conditn.h>
+#include <osl/thread.h>
+#include <tools/link.hxx>
+#include <vcl/dllapi.h>
+
+#include "cppuhelper/exc_hlp.hxx"
+#include "boost/optional.hpp"
+#include <memory>
+
+namespace vcl
+{
+ class VCL_DLLPUBLIC SolarThreadExecutor
+ {
+ oslCondition m_aStart;
+ oslCondition m_aFinish;
+ long m_nReturn;
+ bool m_bTimeout;
+
+ DECL_DLLPRIVATE_LINK( worker, void* );
+
+ public:
+ SolarThreadExecutor();
+ virtual ~SolarThreadExecutor();
+
+ virtual long doIt() = 0;
+ long execute() { return impl_execute( NULL ); }
+ // caution: timeout for getting the solar mutex, not for ending
+ // the operation of doIt(). If doIt actually gets called within
+ // the specified timeout, execute will only return after
+ // doIt() completed
+ long execute( const TimeValue& _rTimeout ) { return impl_execute( &_rTimeout ); }
+
+ public:
+ bool didTimeout() const { return m_bTimeout; }
+
+ private:
+ long impl_execute( const TimeValue* _pTimeout );
+ };
+
+namespace solarthread {
+
+/// @internal
+namespace detail {
+
+template <typename FuncT, typename ResultT>
+class GenericSolarThreadExecutor : public SolarThreadExecutor
+{
+public:
+ static ResultT exec( FuncT const& func )
+ {
+ typedef GenericSolarThreadExecutor<FuncT, ResultT> ExecutorT;
+ ::std::auto_ptr<ExecutorT> const pExecutor( new ExecutorT(func) );
+ pExecutor->execute();
+#if ! defined(EXCEPTIONS_OFF)
+ if (pExecutor->m_exc.hasValue())
+ ::cppu::throwException( pExecutor->m_exc );
+#endif
+ return *pExecutor->m_result;
+ }
+
+private:
+ explicit GenericSolarThreadExecutor( FuncT const& func )
+ : m_exc(), m_func(func), m_result() {}
+
+ virtual long doIt()
+ {
+#if defined(EXCEPTIONS_OFF)
+ m_result.reset( m_func() );
+#else
+ try {
+ m_result.reset( m_func() );
+ }
+ catch (::com::sun::star::uno::Exception &) {
+ // only UNO exceptions can be dispatched:
+ m_exc = ::cppu::getCaughtException();
+ }
+#endif
+ return 0;
+ }
+
+ ::com::sun::star::uno::Any m_exc;
+ FuncT const m_func;
+ // using boost::optional here omits the need that ResultT is default
+ // constructable:
+ ::boost::optional<ResultT> m_result;
+};
+
+template <typename FuncT>
+class GenericSolarThreadExecutor<FuncT, void> : public SolarThreadExecutor
+{
+public:
+ static void exec( FuncT const& func )
+ {
+ typedef GenericSolarThreadExecutor<FuncT, void> ExecutorT;
+ ::std::auto_ptr<ExecutorT> const pExecutor( new ExecutorT(func) );
+ pExecutor->execute();
+#if ! defined(EXCEPTIONS_OFF)
+ if (pExecutor->m_exc.hasValue())
+ ::cppu::throwException( pExecutor->m_exc );
+#endif
+ }
+
+private:
+ explicit GenericSolarThreadExecutor( FuncT const& func )
+ : m_exc(), m_func(func) {}
+
+ virtual long doIt()
+ {
+#if defined(EXCEPTIONS_OFF)
+ m_func();
+#else
+ try {
+ m_func();
+ }
+ catch (::com::sun::star::uno::Exception &) {
+ // only UNO exceptions can be dispatched:
+ m_exc = ::cppu::getCaughtException();
+ }
+#endif
+ return 0;
+ }
+
+ ::com::sun::star::uno::Any m_exc;
+ FuncT const m_func;
+};
+
+template <typename T>
+class copy_back_wrapper
+{
+public:
+ operator T *() const { return &m_holder->m_value; }
+ operator T &() const { return m_holder->m_value; }
+
+ explicit copy_back_wrapper( T * p ) : m_holder( new data_holder(p) ) {}
+
+ // no thread-safe counting needed here, because calling thread blocks
+ // until solar thread has executed the functor.
+ copy_back_wrapper( copy_back_wrapper<T> const& r )
+ : m_holder(r.m_holder) { ++m_holder->m_refCount; }
+ ~copy_back_wrapper() {
+ --m_holder->m_refCount;
+ if (m_holder->m_refCount == 0) {
+ delete m_holder;
+ }
+ }
+private:
+ struct data_holder {
+ T m_value;
+ T * const m_ptr;
+ sal_Int32 m_refCount;
+ data_holder( T * p ) : m_value(*p), m_ptr(p), m_refCount(1) {}
+ ~data_holder() { *m_ptr = m_value; }
+ };
+ data_holder * const m_holder;
+};
+
+} // namespace detail
+
+/** Makes a copy back reference wrapper to be used for inout parameters.
+ Only use for syncExecute(), the returned wrapper relies on its
+ implemenation, i.e. the function object is stored in free store.
+ Type T needs to be copy constructable assignable.
+
+ @see syncExecute()
+ @param r reference to a stack variable
+ @return reference wrapper
+*/
+template <typename T>
+inline detail::copy_back_wrapper<T> inout_by_ref( T & r )
+{
+ return detail::copy_back_wrapper<T>(&r);
+}
+
+/** Makes a copy back ptr wrapper to be used for inout parameters.
+ Only use for syncExecute(), the returned wrapper relies on its
+ implemenation, i.e. the function object is stored in free store.
+ Type T needs to be copy constructable assignable.
+
+ @see syncExecute()
+ @param p pointer to a stack variable
+ @return ptr wrapper
+*/
+template <typename T>
+inline detail::copy_back_wrapper<T> inout_by_ptr( T * p )
+{
+ return detail::copy_back_wrapper<T>(p);
+}
+
+/** This function will execute the passed functor synchronously in the
+ solar thread, thus the calling thread will (eventually) be blocked until
+ the functor has been called.
+ Any UNO exception that came up calling the functor in the solar thread
+ will be caught and rethrown in the calling thread. Any non-UNO
+ exception needs to be handled by the called functor.
+ The result type of this function needs to be default constructable.
+ Please keep in mind not to pass addresses to stack variables
+ (e.g. for out parameters) to foreign threads, use inout_by_ref()
+ for this purpose. For in parameters, this may not affect you, because
+ the functor object is copy constructed into free store. This way
+ you must not use boost::cref()/boost::ref() or similar for objects on
+ your thread's stack.
+ Use inout_by_ref() or inout_by_ptr() for this purpose, e.g.
+
+ <pre>
+ using namespace vcl::solarthread;
+
+ long n = 3;
+ // calling foo( long & r ):
+ syncExecute( boost::bind( &foo, inout_by_ref(n) ) );
+ // calling foo( long * p ):
+ syncExecute( boost::bind( &foo, inout_by_ptr(&n) ) );
+
+ char const* pc = "default";
+ // calling foo( char const** ppc ):
+ syncExecute( boost::bind( &foo, inout_by_ptr(&pc) ) );
+ // calling foo( char const*& rpc ):
+ syncExecute( boost::bind( &foo, inout_by_ref(pc) ) );
+ </pre>
+
+ @tpl ResultT result type, defaults to FuncT::result_type to seamlessly
+ support mem_fn and bind
+ @tpl FuncT functor type, let your compiler deduce this type
+ @param func functor object to be executed in solar thread
+ @return return value of functor
+*/
+template <typename ResultT, typename FuncT>
+inline ResultT syncExecute( FuncT const& func )
+{
+ return detail::GenericSolarThreadExecutor<FuncT, ResultT>::exec(func);
+}
+
+template <typename FuncT>
+inline typename FuncT::result_type syncExecute( FuncT const& func )
+{
+ return detail::GenericSolarThreadExecutor<
+ FuncT, typename FuncT::result_type>::exec(func);
+}
+
+} // namespace solarthread
+} // namespace vcl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/throbber.hxx b/include/vcl/throbber.hxx
new file mode 100644
index 000000000000..f2995d7555bc
--- /dev/null
+++ b/include/vcl/throbber.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 VCL_THROBBER_HXX
+#define VCL_THROBBER_HXX
+
+#include "vcl/dllapi.h"
+#include "vcl/imgctrl.hxx"
+#include "vcl/timer.hxx"
+
+#include <com/sun/star/graphic/XGraphic.hpp>
+
+#include <vector>
+
+class VCL_DLLPUBLIC Throbber : public ImageControl
+{
+public:
+ enum ImageSet
+ {
+ /// no (default) images at all
+ IMAGES_NONE,
+ /// automatically decide between different image sets, depending on what fits best the actual size
+ IMAGES_AUTO,
+ /// default images, 16x16 pixels
+ IMAGES_16_PX,
+ /// default images, 32x32 pixels
+ IMAGES_32_PX,
+ /// default images, 64x64 pixels
+ IMAGES_64_PX,
+ };
+
+public:
+ Throbber( Window* i_parentWindow, WinBits i_style, const ImageSet i_imageSet = IMAGES_AUTO );
+ Throbber( Window* i_parentWindow, const ResId& i_resId, const ImageSet i_imageSet = IMAGES_AUTO );
+ ~Throbber();
+
+ // Properties
+ void setStepTime( sal_Int32 nStepTime ) { mnStepTime = nStepTime; }
+ sal_Int32 getStepTime() const { return mnStepTime; }
+
+ void setRepeat( sal_Bool bRepeat ) { mbRepeat = bRepeat; }
+ sal_Bool getRepeat() const { return mbRepeat; }
+
+ // animation control
+ void start();
+ void stop();
+ bool isRunning() const;
+
+ void setImageList( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& ImageList );
+ void setImageList( ::std::vector< Image > const& i_images );
+
+ // default images
+ static ::std::vector< OUString >
+ getDefaultImageURLs( const ImageSet i_imageSet );
+
+protected:
+ // Window overridables
+ virtual void Resize();
+
+private:
+ SAL_DLLPRIVATE void initImages();
+
+private:
+ ::std::vector< Image > maImageList;
+
+ sal_Bool mbRepeat;
+ sal_Int32 mnStepTime;
+ sal_Int32 mnCurStep;
+ sal_Int32 mnStepCount;
+ AutoTimer maWaitTimer;
+ ImageSet meImageSet;
+
+ DECL_LINK( TimeOutHdl, void* );
+};
+
+#endif // VCL_THROBBER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/timer.hxx b/include/vcl/timer.hxx
new file mode 100644
index 000000000000..606367277a27
--- /dev/null
+++ b/include/vcl/timer.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_TIMER_HXX
+#define _SV_TIMER_HXX
+
+#include <tools/link.hxx>
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+
+struct ImplTimerData;
+struct ImplSVData;
+
+// ---------
+// - Timer -
+// ---------
+
+class VCL_DLLPUBLIC Timer
+{
+protected:
+ ImplTimerData* mpTimerData;
+ sal_uLong mnTimeout;
+ sal_Bool mbActive;
+ sal_Bool mbAuto;
+ Link maTimeoutHdl;
+
+public:
+ Timer();
+ Timer( const Timer& rTimer );
+ virtual ~Timer();
+
+ virtual void Timeout();
+
+ void Start();
+ void Stop();
+
+ void SetTimeout( sal_uLong nTimeout );
+ sal_uLong GetTimeout() const { return mnTimeout; }
+ sal_Bool IsActive() const { return mbActive; }
+
+ void SetTimeoutHdl( const Link& rLink ) { maTimeoutHdl = rLink; }
+ const Link& GetTimeoutHdl() const { return maTimeoutHdl; }
+
+ Timer& operator=( const Timer& rTimer );
+
+ static void ImplDeInitTimer();
+ static void ImplTimerCallbackProc();
+};
+
+// -------------
+// - AutoTimer -
+// -------------
+
+class VCL_DLLPUBLIC AutoTimer : public Timer
+{
+public:
+ AutoTimer();
+ AutoTimer( const AutoTimer& rTimer );
+
+ AutoTimer& operator=( const AutoTimer& rTimer );
+};
+
+#endif // _SV_TIMER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
new file mode 100644
index 000000000000..3b1f69e36477
--- /dev/null
+++ b/include/vcl/toolbox.hxx
@@ -0,0 +1,606 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_TOOLBOX_HXX
+#define _SV_TOOLBOX_HXX
+
+#include <tools/solar.h>
+#include <rsc/rsc-vcl-shared-types.hxx>
+#include <vcl/dllapi.h>
+#include <vcl/dockwin.hxx>
+#include <vcl/image.hxx>
+#include <vcl/timer.hxx>
+#include <vector>
+
+class UserDrawEvent;
+
+struct ImplToolItem;
+struct ImplToolSize;
+struct ImplToolBoxPrivateData;
+class ImplTrackRect;
+class PopupMenu;
+
+namespace vcl
+{
+ class IImageListProvider;
+}
+
+// -------------------------
+// - ToolBoxCustomizeEvent -
+// -------------------------
+
+#define TOOLBOX_CUSTOMIZE_RESIZE ((sal_uInt16)0xFFFE)
+
+class VCL_DLLPUBLIC ToolBoxCustomizeEvent
+{
+private:
+ ToolBox* mpTargetBox;
+ void* mpData;
+ sal_uInt16 mnIdFrom;
+ sal_uInt16 mnPosTo;
+
+public:
+ ToolBoxCustomizeEvent();
+ ToolBoxCustomizeEvent( ToolBox* pDropBox,
+ sal_uInt16 nId, sal_uInt16 nPos = 0,
+ void* pUserData = NULL );
+
+ ToolBox* GetTargetBox() const { return mpTargetBox; }
+ sal_uInt16 GetTargetPos() const { return mnPosTo; }
+ sal_uInt16 GetSourceId() const { return mnIdFrom; }
+ void* GetData() const { return mpData; }
+ sal_Bool IsResized() const;
+};
+
+inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent()
+{
+ mpTargetBox = NULL;
+ mnIdFrom = 0;
+ mnPosTo = 0;
+ mpData = NULL;
+}
+
+inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent( ToolBox* pDropBox,
+ sal_uInt16 nId, sal_uInt16 nPos,
+ void* pUserData )
+{
+ mpTargetBox = pDropBox;
+ mnIdFrom = nId;
+ mnPosTo = nPos;
+ mpData = pUserData;
+}
+
+inline sal_Bool ToolBoxCustomizeEvent::IsResized() const
+{
+ if ( mnPosTo == TOOLBOX_CUSTOMIZE_RESIZE )
+ return sal_True;
+ else
+ return sal_False;
+}
+
+// -----------------
+// - ToolBox-Types -
+// -----------------
+
+#define TOOLBOX_STYLE_FLAT ((sal_uInt16)0x0004)
+
+#define TOOLBOX_APPEND ((sal_uInt16)0xFFFF)
+#define TOOLBOX_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
+
+// item ids in the custom menu may not exceed this constant
+#define TOOLBOX_MENUITEM_START ((sal_uInt16)0xE000)
+
+// defines for the menubutton
+#define TOOLBOX_MENUTYPE_NONE ((sal_uInt16)0x0000) // no menu at all, scrolling by spin buttons
+#define TOOLBOX_MENUTYPE_CLIPPEDITEMS ((sal_uInt16)0x0001) // menu will contain "more" indicator
+#define TOOLBOX_MENUTYPE_CUSTOMIZE ((sal_uInt16)0x0002) // menu will contain "customization" and "more" indicator
+
+// small or large force an exact toolbox size for proper alignemnt
+// dontcare will let the toolbox decide about its size
+enum ToolBoxButtonSize { TOOLBOX_BUTTONSIZE_DONTCARE, TOOLBOX_BUTTONSIZE_SMALL, TOOLBOX_BUTTONSIZE_LARGE };
+
+// TBX_LAYOUT_NORMAL - traditional layout, items are centered in the toolbar
+// TBX_LAYOUT_LOCKVERT - special mode (currently used for calc input/formula
+// bar) where item's vertical position is locked, e.g.
+// toolbox is prevented from centering the items
+enum ToolBoxLayoutMode { TBX_LAYOUT_NORMAL, TBX_LAYOUT_LOCKVERT };
+
+struct ImplToolSize
+{
+ long mnWidth;
+ long mnHeight;
+ sal_uInt16 mnLines;
+};
+
+// -----------
+// - ToolBox -
+// -----------
+
+class VCL_DLLPUBLIC ToolBox : public DockingWindow
+{
+ friend class FloatingWindow;
+ friend class ImplTBDragMgr;
+
+private:
+ ImplToolBoxPrivateData* mpData;
+ std::vector<ImplToolSize> maFloatSizes;
+ ImageList maImageList;
+ Timer maTimer;
+ Rectangle maUpperRect;
+ Rectangle maLowerRect;
+ Rectangle maOutDockRect;
+ Rectangle maInDockRect;
+ Rectangle maPaintRect;
+ FloatingWindow* mpFloatWin;
+ sal_uInt16 mnKeyModifier;
+ long mnDX;
+ long mnDY;
+ long mnMaxItemWidth; // max item width
+ long mnMaxItemHeight; // max item height (for standard items)
+ long mnWinHeight; // max window height (for window items)
+ long mnLeftBorder; // inner border
+ long mnTopBorder;
+ long mnRightBorder;
+ long mnBottomBorder;
+ long mnLastResizeDY;
+ long mnActivateCount;
+ sal_uInt16 mnLastFocusItemId;
+ sal_uInt16 mnFocusPos;
+ sal_uInt16 mnOutStyle;
+ sal_uInt16 mnHighItemId;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnDownItemId;
+ sal_uInt16 mnCurPos;
+ sal_uInt16 mnLines; // total number of toolbox lines
+ sal_uInt16 mnCurLine; // the currently visible line
+ sal_uInt16 mnCurLines; // number of lines due to line breaking
+ sal_uInt16 mnVisLines; // number of visible lines (for scrolling)
+ sal_uInt16 mnFloatLines; // number of lines during floating mode
+ sal_uInt16 mnDockLines;
+ sal_uInt16 mnConfigItem;
+ sal_uInt16 mnMouseClicks;
+ sal_uInt16 mnMouseModifier;
+ unsigned int mbDrag:1,
+ mbSelection:1,
+ mbCommandDrag:1,
+ mbUpper:1,
+ mbLower:1,
+ mbIn:1,
+ mbCalc:1,
+ mbFormat:1,
+ mbFullPaint:1,
+ mbHorz:1,
+ mbScroll:1,
+ mbLastFloatMode:1,
+ mbCustomize:1,
+ mbCustomizeMode:1,
+ mbDragging:1,
+ mbMenuStrings:1,
+ mbIsShift:1,
+ mbIsKeyEvent:1,
+ mbChangingHighlight:1;
+ WindowAlign meAlign;
+ WindowAlign meDockAlign;
+ ButtonType meButtonType;
+ PointerStyle meLastStyle;
+ WinBits mnWinStyle;
+ ToolBoxLayoutMode meLayoutMode;
+ Link maClickHdl;
+ Link maDoubleClickHdl;
+ Link maActivateHdl;
+ Link maDeactivateHdl;
+ Link maHighlightHdl;
+ Link maSelectHdl;
+ Link maCommandHandler;
+ Link maStateChangedHandler;
+ Link maDataChangedHandler;
+
+ public:
+ using Window::ImplInit;
+ private:
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ using DockingWindow::ImplInitSettings;
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE ImplToolItem* ImplGetItem( sal_uInt16 nId ) const;
+ SAL_DLLPRIVATE sal_Bool ImplCalcItem();
+ SAL_DLLPRIVATE sal_uInt16 ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool bCalcHorz );
+ SAL_DLLPRIVATE void ImplFormat( sal_Bool bResize = sal_False );
+ SAL_DLLPRIVATE void ImplDrawSpin( sal_Bool bUpperIn, sal_Bool bLowerIn );
+ SAL_DLLPRIVATE void ImplDrawSeparator( sal_uInt16 nPos, Rectangle rRect );
+ SAL_DLLPRIVATE void ImplDrawItem( sal_uInt16 nPos, sal_uInt16 nHighlight = 0, sal_Bool bPaint = sal_False, sal_Bool bLayout = sal_False );
+ using Window::ImplInvalidate;
+ SAL_DLLPRIVATE void ImplInvalidate( sal_Bool bNewCalc = sal_False, sal_Bool bFullPaint = sal_False );
+ SAL_DLLPRIVATE void ImplUpdateItem( sal_uInt16 nIndex = 0xFFFF );
+ SAL_DLLPRIVATE const OUString ImplConvertMenuString( const XubString& rStr );
+ SAL_DLLPRIVATE sal_Bool ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat = sal_False );
+ SAL_DLLPRIVATE sal_Bool ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCancel = sal_False );
+ SAL_DLLPRIVATE void ImplChangeHighlight( ImplToolItem* pItem, sal_Bool bNoGrabFocus = sal_False );
+ SAL_DLLPRIVATE sal_Bool ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle = sal_False );
+ SAL_DLLPRIVATE sal_uInt16 ImplGetItemLine( ImplToolItem* pCurrentItem );
+ SAL_DLLPRIVATE ImplToolItem* ImplGetFirstValidItem( sal_uInt16 nLine );
+ SAL_DLLPRIVATE sal_Bool ImplOpenItem( KeyCode aKeyCode );
+ SAL_DLLPRIVATE sal_Bool ImplActivateItem( KeyCode aKeyCode );
+ SAL_DLLPRIVATE void ImplShowFocus();
+ SAL_DLLPRIVATE void ImplHideFocus();
+ SAL_DLLPRIVATE void ImplUpdateInputEnable();
+ SAL_DLLPRIVATE void ImplFillLayoutData() const;
+ SAL_DLLPRIVATE sal_Bool ImplHasClippedItems();
+ SAL_DLLPRIVATE Point ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize ) const;
+ SAL_DLLPRIVATE void ImplExecuteCustomMenu();
+ SAL_DLLPRIVATE sal_Bool ImplIsFloatingMode() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsInPopupMode() const;
+ SAL_DLLPRIVATE const XubString& ImplGetHelpText( sal_uInt16 nItemId ) const;
+ SAL_DLLPRIVATE Size ImplGetOptimalFloatingSize();
+ SAL_DLLPRIVATE sal_Bool ImplHasExternalMenubutton();
+ SAL_DLLPRIVATE void ImplDrawFloatwinBorder( ImplToolItem* pItem );
+
+ DECL_DLLPRIVATE_LINK( ImplCallExecuteCustomMenu, void* );
+ DECL_DLLPRIVATE_LINK( ImplUpdateHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplResetAutoSizeTriesHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplCustomMenuListener, VclMenuEvent* );
+ DECL_DLLPRIVATE_LINK( ImplDropdownLongClickHdl, void* );
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE ToolBox (const ToolBox &);
+ SAL_DLLPRIVATE ToolBox& operator= (const ToolBox &);
+
+ SAL_DLLPRIVATE void ImplUpdateImageList(); // called if StateChanged
+public:
+ SAL_DLLPRIVATE void ImplFloatControl( sal_Bool bStart, FloatingWindow* pWindow = NULL );
+ SAL_DLLPRIVATE void ImplDisableFlatButtons();
+
+ static SAL_DLLPRIVATE int ImplGetDragWidth( ToolBox* pThis );
+ static SAL_DLLPRIVATE void ImplUpdateDragArea( ToolBox *pThis );
+ static SAL_DLLPRIVATE void ImplCalcBorder( WindowAlign eAlign, long& rLeft, long& rTop,
+ long& rRight, long& rBottom, const ToolBox *pThis );
+ static SAL_DLLPRIVATE void ImplDrawGrip( ToolBox* pThis );
+ static SAL_DLLPRIVATE void ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapper *pWrapper );
+ static SAL_DLLPRIVATE sal_Bool ImplDrawNativeBackground( ToolBox* pThis, const Region &rRegion );
+ static SAL_DLLPRIVATE void ImplDrawTransparentBackground( ToolBox* pThis, const Region &rRegion );
+ static SAL_DLLPRIVATE void ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, sal_Bool bIsInPopupMode );
+ static SAL_DLLPRIVATE void ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect );
+ static SAL_DLLPRIVATE void ImplErase( ToolBox* pThis, const Rectangle &rRect, sal_Bool bHighlight = sal_False, sal_Bool bHasOpenPopup = sal_False );
+ static SAL_DLLPRIVATE void ImplDrawBorder( ToolBox* pWin );
+ static SAL_DLLPRIVATE const ImplToolItem *ImplGetFirstClippedItem( const ToolBox* pThis );
+ static SAL_DLLPRIVATE Size ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uInt16 nCalcMode = 0 );
+ static SAL_DLLPRIVATE void ImplCalcFloatSizes( ToolBox* pThis );
+ static SAL_DLLPRIVATE Size ImplCalcFloatSize( ToolBox* pThis, sal_uInt16& rLines );
+ static SAL_DLLPRIVATE void ImplCalcMinMaxFloatSize( ToolBox* pThis, Size& rMinSize, Size& rMaxSize );
+ static SAL_DLLPRIVATE void ImplSetMinMaxFloatSize( ToolBox *pThis );
+ static SAL_DLLPRIVATE sal_uInt16 ImplCalcLines( ToolBox* pThis, long nToolSize );
+ static SAL_DLLPRIVATE sal_uInt16 ImplTestLineSize( ToolBox* pThis, const Point& rPos );
+ static SAL_DLLPRIVATE void ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRect, sal_uInt16 nLineMode );
+ static SAL_DLLPRIVATE sal_uInt16 ImplFindItemPos( ToolBox* pBox, const Point& rPos );
+ static SAL_DLLPRIVATE sal_uInt16 ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList );
+ static SAL_DLLPRIVATE void ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight );
+ static SAL_DLLPRIVATE sal_uInt16 ImplCountLineBreaks( const ToolBox *pThis );
+ SAL_DLLPRIVATE ImplToolBoxPrivateData* ImplGetToolBoxPrivateData() const { return mpData; }
+
+protected:
+ void SetCurItemId(sal_uInt16 nSet) { mnCurItemId = nSet; }
+
+public:
+ ToolBox( Window* pParent, WinBits nStyle = 0 );
+ ToolBox( Window* pParent, const ResId& rResId );
+ ~ToolBox();
+
+ virtual void Click();
+ virtual void DoubleClick();
+ virtual void Activate();
+ virtual void Deactivate();
+ virtual void Highlight();
+ virtual void Select();
+ virtual void Customize( const ToolBoxCustomizeEvent& rCEvt );
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Move();
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void KeyInput( const KeyEvent& rKEvt );
+
+ virtual sal_Bool PrepareToggleFloatingMode();
+ virtual void ToggleFloatingMode();
+ virtual void StartDocking();
+ virtual sal_Bool Docking( const Point& rPos, Rectangle& rRect );
+ virtual void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
+ virtual void Resizing( Size& rSize );
+
+ void InsertItem( const ResId& rResId,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ ToolBoxItemBits nBits = 0,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ const XubString& rText,
+ ToolBoxItemBits nBits = 0,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const XubString& rText,
+ ToolBoxItemBits nBits = 0,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertWindow( sal_uInt16 nItemId, Window* pWindow,
+ ToolBoxItemBits nBits = 0,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertSpace( sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertSeparator( sal_uInt16 nPos = TOOLBOX_APPEND,
+ sal_uInt16 nPixSize = 0 );
+ void InsertBreak( sal_uInt16 nPos = TOOLBOX_APPEND );
+ void RemoveItem( sal_uInt16 nPos );
+ void CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId,
+ sal_uInt16 nNewPos = TOOLBOX_APPEND );
+ void Clear();
+
+ const ImageList& GetImageList() const { return maImageList; }
+ void SetImageList( const ImageList& rImageList );
+
+ void SetButtonType( ButtonType eNewType = BUTTON_SYMBOL );
+ ButtonType GetButtonType() const { return meButtonType; }
+
+ // sets a fixed button size (small, large or dontcare (==autosize))
+ void SetToolboxButtonSize( ToolBoxButtonSize eSize );
+ ToolBoxButtonSize GetToolboxButtonSize() const;
+
+ void SetAlign( WindowAlign eNewAlign = WINDOWALIGN_TOP );
+ WindowAlign GetAlign() const { return meAlign; }
+ sal_Bool IsHorizontal() const { return mbHorz; }
+
+ void SetLineCount( sal_uInt16 nNewLines );
+ sal_uInt16 GetLineCount() const { return mnLines; }
+ sal_uInt16 GetCurLine() const { return mnCurLine; }
+ void ShowLine( sal_Bool bNext );
+
+ // Used to enable/disable scrolling one page at a time for toolbar
+ void SetPageScroll( sal_Bool b );
+
+ sal_uInt16 GetItemCount() const;
+ ToolBoxItemType GetItemType( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetItemPos( const Point& rPos ) const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ Rectangle GetItemRect( sal_uInt16 nItemId ) const;
+ Rectangle GetItemPosRect( sal_uInt16 nPos ) const;
+
+ // retrieves the optimal position to place a popup window for this item (subtoolbar or dropdown)
+ Point GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const;
+
+ Rectangle GetScrollRect() const;
+ sal_uInt16 GetCurItemId() const { return mnCurItemId; }
+ sal_uInt16 GetDownItemId() const { return mnDownItemId; }
+ sal_uInt16 GetClicks() const { return mnMouseClicks; }
+ sal_uInt16 GetModifier() const { return mnMouseModifier; }
+ sal_uInt16 GetKeyModifier() const { return mnKeyModifier; }
+
+ void SetItemBits( sal_uInt16 nItemId, ToolBoxItemBits nBits );
+ ToolBoxItemBits GetItemBits( sal_uInt16 nItemId ) const;
+
+ void SetItemData( sal_uInt16 nItemId, void* pNewData );
+ void* GetItemData( sal_uInt16 nItemId ) const;
+ void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
+ Image GetItemImage( sal_uInt16 nItemId ) const;
+ void SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 );
+ void SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror );
+ void SetItemText( sal_uInt16 nItemId, const XubString& rText );
+ const XubString& GetItemText( sal_uInt16 nItemId ) const;
+ void SetItemWindow( sal_uInt16 nItemId, Window* pNewWindow );
+ Window* GetItemWindow( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetHighlightItemId() const { return mnHighItemId; }
+
+ void StartSelection();
+ void EndSelection();
+
+ void SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease = sal_True );
+
+ void SetItemState( sal_uInt16 nItemId, TriState eState );
+ TriState GetItemState( sal_uInt16 nItemId ) const;
+
+ void CheckItem( sal_uInt16 nItemId, sal_Bool bCheck = sal_True );
+ sal_Bool IsItemChecked( sal_uInt16 nItemId ) const;
+
+ void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True );
+ sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
+
+ void TriggerItem( sal_uInt16 nItemId, sal_Bool bShift = sal_False, sal_Bool bCtrl = sal_False );
+ void ShowItem( sal_uInt16 nItemId, sal_Bool bVisible = sal_True );
+ void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, sal_False ); }
+ sal_Bool IsItemVisible( sal_uInt16 nItemId ) const;
+ sal_Bool IsItemReallyVisible( sal_uInt16 nItemId ) const;
+
+ void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
+ const XubString& GetItemCommand( sal_uInt16 nItemId ) const;
+
+ using Window::SetQuickHelpText;
+ void SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText );
+ using Window::GetQuickHelpText;
+ const XubString& GetQuickHelpText( sal_uInt16 nItemId ) const;
+
+ void SetHelpText( sal_uInt16 nItemId, const XubString& rText );
+ const XubString& GetHelpText( sal_uInt16 nItemId ) const;
+
+ void SetHelpId( sal_uInt16 nItemId, const OString& rHelpId );
+ OString GetHelpId( sal_uInt16 nItemId ) const;
+
+ // window size according to current alignment, floating state and number of lines
+ Size CalcWindowSizePixel() const;
+ // window size according to current alignment, floating state and a given number of lines
+ Size CalcWindowSizePixel( sal_uInt16 nCalcLines ) const;
+ // window size according to current floating state and a given number of lines and a given alignment
+ Size CalcWindowSizePixel( sal_uInt16 nCalcLines, WindowAlign eAlign ) const;
+ // floating window size according to number of lines (uses the number of line breaks)
+ Size CalcFloatingWindowSizePixel() const;
+ // floating window size with a given number of lines
+ Size CalcFloatingWindowSizePixel( sal_uInt16 nCalcLines ) const;
+ // automatic window size for popoup mode
+ Size CalcPopupWindowSizePixel() const;
+
+ // computes the smallest useful size when docked, ie with the first item visible only (+drag area and menu button)
+ Size CalcMinimumWindowSizePixel() const;
+
+ void SetDockingRects( const Rectangle& rOutRect,
+ const Rectangle& rInRect );
+ void SetFloatingLines( sal_uInt16 nFloatLines );
+ sal_uInt16 GetFloatingLines() const;
+
+ void SetStyle( WinBits nNewStyle ) { mnWinStyle = nNewStyle; }
+ WinBits GetStyle() const { return mnWinStyle; }
+
+ // enable/disable undocking
+ void Lock( sal_Bool bLock = sal_True );
+
+ // read configuration to determine locking behaviour
+ static sal_Bool AlwaysLocked();
+
+ void EnableMenuStrings( sal_Bool bEnable = sal_True ) { mbMenuStrings = (bEnable != 0); }
+ sal_Bool IsMenuStringsEnabled() const { return mbMenuStrings; }
+
+ void SetOutStyle( sal_uInt16 nNewStyle );
+ sal_uInt16 GetOutStyle() const { return mnOutStyle; }
+
+ void EnableCustomize( sal_Bool bEnable = sal_True );
+ sal_Bool IsCustomize() { return mbCustomize; }
+ sal_Bool IsInCustomizeMode() const { return mbCustomizeMode; }
+
+ void SetHelpText( const XubString& rText )
+ { DockingWindow::SetHelpText( rText ); }
+ const XubString& GetHelpText() const
+ { return DockingWindow::GetHelpText(); }
+
+ void SetHelpId( const OString& rId )
+ { DockingWindow::SetHelpId( rId ); }
+ const OString& GetHelpId() const
+ { return DockingWindow::GetHelpId(); }
+
+ void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
+ const Link& GetClickHdl() const { return maClickHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetDropdownClickHdl( const Link& rLink );
+ const Link& GetDropdownClickHdl() const;
+ void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; }
+ const Link& GetActivateHdl() const { return maActivateHdl; }
+ void SetDeactivateHdl( const Link& rLink ) { maDeactivateHdl = rLink; }
+ const Link& GetDeactivateHdl() const { return maDeactivateHdl; }
+ void SetHighlightHdl( const Link& rLink ) { maHighlightHdl = rLink; }
+ const Link& GetHighlightHdl() const { return maHighlightHdl; }
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetCommandHdl( const Link& aLink ) { maCommandHandler = aLink; }
+ const Link& GetCommandHdl() const { return maCommandHandler; }
+ void SetStateChangedHdl( const Link& aLink ) { maStateChangedHandler = aLink; }
+ const Link& GetStateChangedHdl() const { return maStateChangedHandler; }
+ void SetDataChangedHdl( const Link& aLink ) { maDataChangedHandler = aLink; }
+ const Link& GetDataChangedHdl() { return maDataChangedHandler; }
+
+ // support for custom menu (eg for configuration)
+ // note: this menu will also be used to display currently
+ // clipped toolbox items, so you should only touch
+ // items that you added by yourself
+ // the private toolbox items will only use item ids starting from TOOLBOX_MENUITEM_START
+ // to allow for customization of the menu the coresponding handler is called
+ // when the menu button was clicked and before the menu is executed
+ void SetMenuType( sal_uInt16 aType = TOOLBOX_MENUTYPE_CUSTOMIZE );
+ sal_uInt16 GetMenuType() const;
+ sal_Bool IsMenuEnabled() const;
+ PopupMenu* GetMenu() const;
+ void UpdateCustomMenu();
+ void SetMenuButtonHdl( const Link& rLink );
+
+ // open custommenu
+ void ExecuteCustomMenu();
+
+ // allow Click Handler to detect special key
+ bool IsShift() const { return mbIsShift; }
+ // allow Click Handler to distinguish between mouse and key input
+ sal_Bool IsKeyEvent() const { return mbIsKeyEvent; }
+
+ // allows framework to set/query the planned popupmode
+ sal_Bool WillUsePopupMode() const;
+ void WillUsePopupMode( sal_Bool b);
+
+ // accessibility helpers
+
+ // gets the displayed text
+ OUString GetDisplayText() const;
+ // returns the bounding box for the character at index nIndex
+ // where nIndex is relative to the starting index of the item
+ // with id nItemId (in coordinates of the displaying window)
+ Rectangle GetCharacterBounds( sal_uInt16 nItemId, long nIndex ) const;
+ // -1 is returned if no character is at that point
+ // if an index is found the corresponding item id is filled in (else 0)
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
+
+ const Size& GetDefaultImageSize() const;
+ void ChangeHighlight( sal_uInt16 nPos );
+
+ void SetImageListProvider(vcl::IImageListProvider* _pProvider);
+ void SetToolbarLayoutMode( ToolBoxLayoutMode eLayout );
+};
+
+inline void ToolBox::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck )
+{
+ SetItemState( nItemId, (bCheck) ? STATE_CHECK : STATE_NOCHECK );
+}
+
+inline sal_Bool ToolBox::IsItemChecked( sal_uInt16 nItemId ) const
+{
+ return (GetItemState( nItemId ) == STATE_CHECK);
+}
+
+inline Size ToolBox::CalcWindowSizePixel() const
+{
+ return CalcWindowSizePixel( mnLines );
+}
+
+inline Rectangle ToolBox::GetScrollRect() const
+{
+ return maUpperRect.GetUnion( maLowerRect );
+}
+
+inline void ToolBox::SetDockingRects( const Rectangle& rOutRect,
+ const Rectangle& rInRect )
+{
+ maOutDockRect = rOutRect;
+ maInDockRect = rInRect;
+}
+
+inline void ToolBox::SetFloatingLines( sal_uInt16 nNewLines )
+{
+ mnFloatLines = nNewLines;
+}
+
+inline sal_uInt16 ToolBox::GetFloatingLines() const
+{
+ return mnFloatLines;
+}
+
+#endif // _SV_TOOLBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/txtattr.hxx b/include/vcl/txtattr.hxx
new file mode 100644
index 000000000000..feb6131d12ee
--- /dev/null
+++ b/include/vcl/txtattr.hxx
@@ -0,0 +1,227 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _TXTATTR_HXX
+#define _TXTATTR_HXX
+
+#include <vcl/dllapi.h>
+#include <tools/color.hxx>
+#include <vcl/vclenum.hxx>
+#include <tools/string.hxx>
+#include <tools/debug.hxx>
+
+class Font;
+
+#define TEXTATTR_INVALID 0
+#define TEXTATTR_FONTCOLOR 1
+#define TEXTATTR_HYPERLINK 2
+#define TEXTATTR_FONTWEIGHT 3
+
+#define TEXTATTR_USER_START 1000 //start id for user defined text attributes
+#define TEXTATTR_PROTECTED 4
+
+
+class VCL_DLLPUBLIC TextAttrib
+{
+private:
+ sal_uInt16 mnWhich;
+
+protected:
+ TextAttrib( sal_uInt16 nWhich ) { mnWhich = nWhich; }
+ TextAttrib( const TextAttrib& rAttr ) { mnWhich = rAttr.mnWhich; }
+
+public:
+
+ virtual ~TextAttrib();
+
+ sal_uInt16 Which() const { return mnWhich; }
+ virtual void SetFont( Font& rFont ) const = 0;
+ virtual TextAttrib* Clone() const = 0;
+
+ virtual int operator==( const TextAttrib& rAttr ) const = 0;
+ int operator!=( const TextAttrib& rAttr ) const
+ { return !(*this == rAttr ); }
+};
+
+
+
+class VCL_DLLPUBLIC TextAttribFontColor : public TextAttrib
+{
+private:
+ Color maColor;
+
+public:
+ TextAttribFontColor( const Color& rColor );
+ TextAttribFontColor( const TextAttribFontColor& rAttr );
+ ~TextAttribFontColor();
+
+ const Color& GetColor() const { return maColor; }
+
+ virtual void SetFont( Font& rFont ) const;
+ virtual TextAttrib* Clone() const;
+ virtual int operator==( const TextAttrib& rAttr ) const;
+
+};
+
+class VCL_DLLPUBLIC TextAttribFontWeight : public TextAttrib
+{
+private:
+ FontWeight meWeight;
+
+public:
+ TextAttribFontWeight( FontWeight eWeight );
+ TextAttribFontWeight( const TextAttribFontWeight& rAttr );
+ ~TextAttribFontWeight();
+
+ virtual void SetFont( Font& rFont ) const;
+ virtual TextAttrib* Clone() const;
+ virtual int operator==( const TextAttrib& rAttr ) const;
+
+ inline FontWeight getFontWeight() const { return meWeight; }
+};
+
+
+class TextAttribHyperLink : public TextAttrib
+{
+private:
+ XubString maURL;
+ XubString maDescription;
+ Color maColor;
+
+public:
+ TextAttribHyperLink( const TextAttribHyperLink& rAttr );
+ ~TextAttribHyperLink();
+
+ void SetURL( const XubString& rURL ) { maURL = rURL; }
+ const XubString& GetURL() const { return maURL; }
+
+ void SetDescription( const XubString& rDescr ) { maDescription = rDescr; }
+ const XubString& GetDescription() const { return maDescription; }
+
+ void SetColor( const Color& rColor ) { maColor = rColor; }
+ const Color& GetColor() const { return maColor; }
+
+ virtual void SetFont( Font& rFont ) const;
+ virtual TextAttrib* Clone() const;
+ virtual int operator==( const TextAttrib& rAttr ) const;
+};
+
+class VCL_DLLPUBLIC TextAttribProtect : public TextAttrib
+{
+public:
+ TextAttribProtect();
+ TextAttribProtect( const TextAttribProtect& rAttr );
+ ~TextAttribProtect();
+
+ virtual void SetFont( Font& rFont ) const;
+ virtual TextAttrib* Clone() const;
+ virtual int operator==( const TextAttrib& rAttr ) const;
+
+};
+
+
+class TextCharAttrib
+{
+private:
+ TextAttrib* mpAttr;
+ sal_uInt16 mnStart;
+ sal_uInt16 mnEnd;
+
+protected:
+
+public:
+
+ TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd );
+ TextCharAttrib( const TextCharAttrib& rTextCharAttrib );
+ ~TextCharAttrib();
+
+ const TextAttrib& GetAttr() const { return *mpAttr; }
+
+ sal_uInt16 Which() const { return mpAttr->Which(); }
+
+ sal_uInt16 GetStart() const { return mnStart; }
+ sal_uInt16& GetStart() { return mnStart; }
+
+ sal_uInt16 GetEnd() const { return mnEnd; }
+ sal_uInt16& GetEnd() { return mnEnd; }
+
+ inline sal_uInt16 GetLen() const;
+
+ inline void MoveForward( sal_uInt16 nDiff );
+ inline void MoveBackward( sal_uInt16 nDiff );
+
+ inline void Expand( sal_uInt16 nDiff );
+ inline void Collaps( sal_uInt16 nDiff );
+
+ inline sal_Bool IsIn( sal_uInt16 nIndex );
+ inline sal_Bool IsInside( sal_uInt16 nIndex );
+ inline sal_Bool IsEmpty();
+
+};
+
+inline sal_uInt16 TextCharAttrib::GetLen() const
+{
+ DBG_ASSERT( mnEnd >= mnStart, "TextCharAttrib: nEnd < nStart!" );
+ return mnEnd-mnStart;
+}
+
+inline void TextCharAttrib::MoveForward( sal_uInt16 nDiff )
+{
+ DBG_ASSERT( ((long)mnEnd + nDiff) <= 0xFFFF, "TextCharAttrib: MoveForward?!" );
+ mnStart = mnStart + nDiff;
+ mnEnd = mnEnd + nDiff;
+}
+
+inline void TextCharAttrib::MoveBackward( sal_uInt16 nDiff )
+{
+ DBG_ASSERT( ((long)mnStart - nDiff) >= 0, "TextCharAttrib: MoveBackward?!" );
+ mnStart = mnStart - nDiff;
+ mnEnd = mnEnd - nDiff;
+}
+
+inline void TextCharAttrib::Expand( sal_uInt16 nDiff )
+{
+ DBG_ASSERT( ( ((long)mnEnd + nDiff) <= (long)0xFFFF ), "TextCharAttrib: Expand?!" );
+ mnEnd = mnEnd + nDiff;
+}
+
+inline void TextCharAttrib::Collaps( sal_uInt16 nDiff )
+{
+ DBG_ASSERT( (long)mnEnd - nDiff >= (long)mnStart, "TextCharAttrib: Collaps?!" );
+ mnEnd = mnEnd - nDiff;
+}
+
+inline sal_Bool TextCharAttrib::IsIn( sal_uInt16 nIndex )
+{
+ return ( ( mnStart <= nIndex ) && ( mnEnd >= nIndex ) );
+}
+
+inline sal_Bool TextCharAttrib::IsInside( sal_uInt16 nIndex )
+{
+ return ( ( mnStart < nIndex ) && ( mnEnd > nIndex ) );
+}
+
+inline sal_Bool TextCharAttrib::IsEmpty()
+{
+ return mnStart == mnEnd;
+}
+
+#endif // _TXTATTR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/unohelp.hxx b/include/vcl/unohelp.hxx
new file mode 100644
index 000000000000..91168436c3ad
--- /dev/null
+++ b/include/vcl/unohelp.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 _VCL_UNOHELP_HXX
+#define _VCL_UNOHELP_HXX
+
+#include <com/sun/star/uno/Reference.h>
+#include <rtl/ustring.hxx>
+#include <vcl/dllapi.h>
+
+namespace com {
+namespace sun {
+namespace star {
+namespace i18n {
+ class XBreakIterator;
+ class XCharacterClassification;
+ class XCollator;
+}}}}
+
+namespace com {
+namespace sun {
+namespace star {
+namespace accessibility {
+ struct AccessibleEventObject;
+}
+}}}
+
+namespace comphelper {
+ namespace string {
+ class NaturalStringSorter;
+}}
+
+namespace vcl
+{
+namespace unohelper
+{
+VCL_DLLPUBLIC ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > CreateBreakIterator();
+VCL_DLLPUBLIC ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XCharacterClassification> CreateCharacterClassification();
+//Get access to singleton Natural String Sorter collating for Application::GetLocale
+VCL_DLLPUBLIC const comphelper::string::NaturalStringSorter& getNaturalStringSorterForAppLocale();
+VCL_DLLPUBLIC OUString CreateLibraryName( const sal_Char* pModName, sal_Bool bSUPD );
+VCL_DLLPUBLIC void NotifyAccessibleStateEventGlobally( const ::com::sun::star::accessibility::AccessibleEventObject& rEventObject );
+}} // namespace vcl::unohelper
+
+#endif // _VCL_UNOHELP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/unohelp2.hxx b/include/vcl/unohelp2.hxx
new file mode 100644
index 000000000000..138ad507d656
--- /dev/null
+++ b/include/vcl/unohelp2.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 _VCL_UNOHELP2_HXX
+#define _VCL_UNOHELP2_HXX
+
+#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <cppuhelper/weak.hxx>
+#include <tools/string.hxx>
+#include <osl/mutex.hxx>
+
+namespace com { namespace sun { namespace star { namespace datatransfer { namespace clipboard {
+ class XClipboard;
+} } } } }
+#include <vcl/dllapi.h>
+
+namespace vcl { namespace unohelper {
+
+ class VCL_DLLPUBLIC TextDataObject :
+ public ::com::sun::star::datatransfer::XTransferable,
+ public ::cppu::OWeakObject
+ {
+ private:
+ String maText;
+
+ public:
+ TextDataObject( const String& rText );
+ ~TextDataObject();
+
+ String& GetString() { return maText; }
+
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
+
+ // ::com::sun::star::datatransfer::XTransferable
+ ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) throw(::com::sun::star::datatransfer::UnsupportedFlavorException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) throw(::com::sun::star::uno::RuntimeException);
+
+ /// copies a given string to a given clipboard
+ static void CopyStringTo(
+ const String& rContent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard
+ );
+ };
+
+ struct MutexHelper
+ {
+ private:
+ ::osl::Mutex maMutex;
+ public:
+ ::osl::Mutex& GetMutex() { return maMutex; }
+ };
+
+}} // namespace vcl::unohelper
+
+#endif // _VCL_UNOHELP2_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/unowrap.hxx b/include/vcl/unowrap.hxx
new file mode 100644
index 000000000000..9632728eac6a
--- /dev/null
+++ b/include/vcl/unowrap.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 _VCL_UNOWRAP_HXX
+#define _VCL_UNOWRAP_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <com/sun/star/uno/Reference.h>
+
+class XWindowPeer;
+class XToolkit;
+class EventList;
+class Window;
+class OutputDevice;
+class MouseEvent;
+class CommandEvent;
+class KeyEvent;
+class Rectangle;
+class Menu;
+
+namespace com {
+namespace sun {
+namespace star {
+namespace awt {
+ class XGraphics;
+ class XToolkit;
+ class XWindowPeer;
+}
+namespace lang {
+ class XMultiServiceFactory;
+}
+} } }
+
+namespace com {
+namespace sun {
+namespace star {
+namespace accessibility {
+ class XAccessible;
+}}}}
+
+class VCL_DLLPUBLIC UnoWrapperBase
+{
+public:
+ virtual void Destroy() = 0;
+
+ // Toolkit
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > GetVCLToolkit() = 0;
+
+ // Graphics
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > CreateGraphics( OutputDevice* pOutDev ) = 0;
+ virtual void ReleaseAllGraphics( OutputDevice* pOutDev ) = 0;
+
+ // Window
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer> GetWindowInterface( Window* pWindow, sal_Bool bCreate ) = 0;
+ virtual void SetWindowInterface( Window* pWindow, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xIFace ) = 0;
+
+ virtual void WindowDestroyed( Window* pWindow ) = 0;
+
+ // Accessibility
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ CreateAccessible( Menu* pMenu, sal_Bool bIsMenuBar ) = 0;
+
+protected:
+ ~UnoWrapperBase() {}
+};
+
+#endif // _VCL_UNOWRAP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx
new file mode 100644
index 000000000000..e0760b131c01
--- /dev/null
+++ b/include/vcl/vclenum.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 _VCL_VCLENUM_HXX
+#define _VCL_VCLENUM_HXX
+
+#include <sal/types.h>
+#include <tools/solar.h>
+#include <tools/fontenum.hxx>
+#include <rsc/rsc-vcl-shared-types.hxx>
+
+// ------------------------------------------------------------
+
+enum ExtTimeFieldFormat { EXTTIMEF_24H_SHORT, EXTTIMEF_24H_LONG,
+ EXTTIMEF_12H_SHORT, EXTTIMEF_12H_LONG,
+ EXTTIMEF_DURATION_SHORT, EXTTIMEF_DURATION_LONG };
+
+// ------------------------------------------------------------
+
+enum ExtDateFieldFormat { XTDATEF_SYSTEM_SHORT, XTDATEF_SYSTEM_SHORT_YY, XTDATEF_SYSTEM_SHORT_YYYY,
+ XTDATEF_SYSTEM_LONG,
+ XTDATEF_SHORT_DDMMYY, XTDATEF_SHORT_MMDDYY, XTDATEF_SHORT_YYMMDD,
+ XTDATEF_SHORT_DDMMYYYY, XTDATEF_SHORT_MMDDYYYY, XTDATEF_SHORT_YYYYMMDD,
+ XTDATEF_SHORT_YYMMDD_DIN5008, XTDATEF_SHORT_YYYYMMDD_DIN5008, ExtDateFieldFormat_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+// ------------------------------------------------------------
+
+enum GradientStyle
+{
+ GradientStyle_LINEAR = 0,
+ GradientStyle_AXIAL = 1,
+ GradientStyle_RADIAL = 2,
+ GradientStyle_ELLIPTICAL = 3,
+ GradientStyle_SQUARE = 4,
+ GradientStyle_RECT = 5,
+ GradientStyle_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
+};
+
+// ------------------------------------------------------------
+
+// to avoid conflicts with enum's declared otherwise
+#define HATCH_SINGLE HatchStyle_SINGLE
+#define HATCH_DOUBLE HatchStyle_DOUBLE
+#define HATCH_TRIPLE HatchStyle_TRIPLE
+#define HATCH_FORCE_EQUAL_SIZE HatchStyle_FORCE_EQUAL_SIZE
+
+enum HatchStyle
+{
+ HATCH_SINGLE = 0,
+ HATCH_DOUBLE = 1,
+ HATCH_TRIPLE = 2,
+ HatchStyle_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
+};
+
+// ------------------------------------------------------------
+
+// to avoid conflicts with enum's declared otherwise
+#define LINE_NONE LineStyle_NONE
+#define LINE_SOLID LineStyle_SOLID
+#define LINE_DASH LineStyle_DASH
+#define LINE_FORCE_EQUAL_SIZE LineStyle_FORCE_EQUAL_SIZE
+
+enum LineStyle
+{
+ LINE_NONE = 0,
+ LINE_SOLID = 1,
+ LINE_DASH = 2,
+ LineStyle_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
+};
+
+// ------------------------------------------------------------
+
+enum RasterOp { ROP_OVERPAINT, ROP_XOR, ROP_0, ROP_1, ROP_INVERT };
+
+// ------------------------------------------------------------
+
+enum FontAutoHint { AUTOHINT_DONTKNOW, AUTOHINT_FALSE, AUTOHINT_TRUE };
+
+enum FontHinting { HINTING_DONTKNOW, HINTING_FALSE, HINTING_TRUE };
+
+enum FontHintStyle { HINT_NONE, HINT_SLIGHT, HINT_MEDIUM, HINT_FULL };
+
+// ------------------------------------------------------------
+
+typedef sal_uInt32 sal_UCS4; // TODO: this should be moved to rtl
+
+enum OutDevSupportType { OutDevSupport_TransparentRect, OutDevSupport_B2DClip, OutDevSupport_B2DDraw };
+
+struct ItalicMatrix
+{
+ double xx, xy, yx, yy;
+ ItalicMatrix() : xx(1), xy(0), yx(0), yy(1) {}
+};
+
+inline bool operator ==(const ItalicMatrix& a, const ItalicMatrix& b)
+{
+ return a.xx == b.xx && a.xy == b.xy && a.yx == b.yx && a.yy == b.yy;
+}
+
+inline bool operator !=(const ItalicMatrix& a, const ItalicMatrix& b)
+{
+ return a.xx != b.xx || a.xy != b.xy || a.yx != b.yx || a.yy != b.yy;
+}
+
+enum VclAlign
+{
+ VCL_ALIGN_FILL,
+ VCL_ALIGN_START,
+ VCL_ALIGN_END,
+ VCL_ALIGN_CENTER
+};
+
+enum VclPackType
+{
+ VCL_PACK_START = 0,
+ VCL_PACK_END = 1
+};
+
+#endif // _VCL_VCLENUM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/vclevent.hxx b/include/vcl/vclevent.hxx
new file mode 100644
index 000000000000..bc4fa01362c2
--- /dev/null
+++ b/include/vcl/vclevent.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 _VCL_VCLEVENT_HXX
+#define _VCL_VCLEVENT_HXX
+
+#include "tools/link.hxx"
+#include "tools/rtti.hxx"
+#include "vcl/dllapi.h"
+#include "vcl/impdel.hxx"
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <list>
+#include <vector>
+
+class Window;
+class Menu;
+
+namespace com { namespace sun { namespace star {
+ namespace accessibility {
+ class XAccessible;
+ }
+}}}
+
+#define VCLEVENT_OBJECT_DYING 1
+
+// VclWindowEvent:
+#define VCLEVENT_WINDOW_CHILDCREATED 500 // pData = Window*
+#define VCLEVENT_WINDOW_CHILDDESTROYED 501 // pData = Window*
+#define VCLEVENT_WINDOW_PAINT 1000 // pData = Rectangle*
+#define VCLEVENT_WINDOW_MOVE 1001
+#define VCLEVENT_WINDOW_RESIZE 1002
+#define VCLEVENT_WINDOW_SHOW 1003
+#define VCLEVENT_WINDOW_HIDE 1004
+#define VCLEVENT_WINDOW_ACTIVATE 1005
+#define VCLEVENT_WINDOW_DEACTIVATE 1006 // pData = Window* = pPrevActiveWindow
+#define VCLEVENT_WINDOW_CLOSE 1007
+#define VCLEVENT_WINDOW_GETFOCUS 1008
+#define VCLEVENT_WINDOW_LOSEFOCUS 1009
+#define VCLEVENT_WINDOW_MINIMIZE 1010
+#define VCLEVENT_WINDOW_NORMALIZE 1011
+#define VCLEVENT_WINDOW_KEYINPUT 1012 // pData = KeyEvent*
+#define VCLEVENT_WINDOW_KEYUP 1013 // pData = KeyEvent*
+#define VCLEVENT_WINDOW_COMMAND 1014 // pData = CommandEvent*
+#define VCLEVENT_WINDOW_MOUSEMOVE 1015 // pData = MouseEvent*
+#define VCLEVENT_WINDOW_MOUSEBUTTONDOWN 1016 // pData = MouseEvent*
+#define VCLEVENT_WINDOW_MOUSEBUTTONUP 1017 // pData = MouseEvent*
+#define VCLEVENT_WINDOW_FRAMETITLECHANGED 1018 // pData = XubString* = oldTitle
+#define VCLEVENT_APPLICATION_DATACHANGED 1019 // pData = DataChangedEvent*
+#define VCLEVENT_WINDOW_ENABLED 1020
+#define VCLEVENT_WINDOW_DISABLED 1021
+#define VCLEVENT_WINDOW_DATACHANGED 1022 // pData = DataChangedEvent*
+#define VCLEVENT_WINDOW_ZOOM 1023 // pData = ZoomEvent*
+#define VCLEVENT_WINDOW_SCROLL 1024 // pData = ScrollEvent*
+
+// VclWindowEvent
+#define VCLEVENT_CONTROL_GETFOCUS 1100
+#define VCLEVENT_CONTROL_LOSEFOCUS 1101
+#define VCLEVENT_BUTTON_CLICK 1102
+#define VCLEVENT_PUSHBUTTON_TOGGLE 1103
+#define VCLEVENT_RADIOBUTTON_TOGGLE 1104
+#define VCLEVENT_CHECKBOX_TOGGLE 1105
+#define VCLEVENT_COMBOBOX_SELECT 1106
+#define VCLEVENT_COMBOBOX_DOUBLECLICK 1107
+#define VCLEVENT_LISTBOX_SELECT 1108
+#define VCLEVENT_LISTBOX_DOUBLECLICK 1109
+#define VCLEVENT_EDIT_MODIFY 1110
+#define VCLEVENT_SCROLLBAR_SCROLL 1111
+#define VCLEVENT_SCROLLBAR_ENDSCROLL 1112
+#define VCLEVENT_SPINBUTTON_UP 1113
+#define VCLEVENT_SPINBUTTON_DOWN 1114
+#define VCLEVENT_SPINFIELD_UP 1115
+#define VCLEVENT_SPINFIELD_DOWN 1116
+#define VCLEVENT_SPINFIELD_FIRST 1117
+#define VCLEVENT_SPINFIELD_LAST 1118
+#define VCLEVENT_STATUSBAR_CLICK 1119
+#define VCLEVENT_STATUSBAR_DOUBLECLICK 1120
+#define VCLEVENT_TOOLBOX_CLICK 1121
+#define VCLEVENT_TOOLBOX_DOUBLECLICK 1122
+#define VCLEVENT_TOOLBOX_ACTIVATE 1123
+#define VCLEVENT_TOOLBOX_DEACTIVATE 1124
+#define VCLEVENT_TOOLBOX_HIGHLIGHT 1125
+#define VCLEVENT_TOOLBOX_SELECT 1126
+// Resort later...
+#define VCLEVENT_LISTBOX_SCROLLED 1127
+#define VCLEVENT_COMBOBOX_SCROLLED 1128
+#define VCLEVENT_EDIT_SELECTIONCHANGED 1129
+#define VCLEVENT_DROPDOWN_OPEN 1130
+#define VCLEVENT_DROPDOWN_CLOSE 1131
+
+#define VCLEVENT_TOOLBOX_ITEMADDED 1132 // pData = itempos
+#define VCLEVENT_TOOLBOX_ITEMREMOVED 1133 // pData = itempos
+#define VCLEVENT_TOOLBOX_ALLITEMSCHANGED 1134
+#define VCLEVENT_TOOLBOX_HIGHLIGHTOFF 1135 // pData = itempos
+#define VCLEVENT_WINDOW_MENUBARADDED 1136 // pData = pMenuBar
+#define VCLEVENT_TABPAGE_ACTIVATE 1137 // pData = pageid
+#define VCLEVENT_TABPAGE_DEACTIVATE 1138 // pData = pageid
+#define VCLEVENT_TABBAR_PAGEENABLED 1139 // pData = pageid
+#define VCLEVENT_TABBAR_PAGEDISABLED 1140 // pData = pageid
+#define VCLEVENT_TABBAR_PAGESELECTED 1141 // pData = pageid
+#define VCLEVENT_TABBAR_PAGEACTIVATED 1142 // pData = pageid
+#define VCLEVENT_TABBAR_PAGEDEACTIVATED 1143 // pData = pageid
+#define VCLEVENT_TABBAR_PAGEINSERTED 1144 // pData = pageid
+#define VCLEVENT_TABBAR_PAGEREMOVED 1145 // pData = pageid
+#define VCLEVENT_TABBAR_PAGEMOVED 1146 // pData = Pair( pagepos_old, pagepos_new )
+#define VCLEVENT_TABBAR_PAGETEXTCHANGED 1147 // pData = pageid
+#define VCLEVENT_COMBOBOX_DESELECT 1148
+#define VCLEVENT_TOOLBOX_ITEMTEXTCHANGED 1149 // pData = itempos
+#define VCLEVENT_TABPAGE_INSERTED 1150 // pData = pageid
+#define VCLEVENT_TABPAGE_REMOVED 1151 // pData = pageid
+#define VCLEVENT_TABPAGE_REMOVEDALL 1152
+#define VCLEVENT_LISTBOX_ITEMADDED 1153 // pData = itempos
+#define VCLEVENT_LISTBOX_ITEMREMOVED 1154 // pData = itempos, -1=ALL
+#define VCLEVENT_COMBOBOX_ITEMADDED 1155 // pData = itempos
+#define VCLEVENT_COMBOBOX_ITEMREMOVED 1156 // pData = itempos, -1=ALL
+// free 1157
+#define VCLEVENT_WINDOW_MENUBARREMOVED 1158 // pData = pMenuBar
+#define VCLEVENT_STATUSBAR_ITEMADDED 1159 // pData = itemid
+#define VCLEVENT_STATUSBAR_ITEMREMOVED 1160 // pData = itemid
+#define VCLEVENT_STATUSBAR_ALLITEMSREMOVED 1161
+#define VCLEVENT_STATUSBAR_SHOWITEM 1162 // pData = itemid
+#define VCLEVENT_STATUSBAR_HIDEITEM 1163 // pData = itemid
+#define VCLEVENT_STATUSBAR_SHOWALLITEMS 1164
+#define VCLEVENT_STATUSBAR_HIDEALLITEMS 1165
+#define VCLEVENT_STATUSBAR_DRAWITEM 1166 // pData = itemid
+#define VCLEVENT_STATUSBAR_NAMECHANGED 1167 // pData = itemid
+#define VCLEVENT_TOOLBOX_ITEMENABLED 1168 // pData = itempos
+#define VCLEVENT_TOOLBOX_ITEMDISABLED 1169 // pData = itempos
+#define VCLEVENT_TABPAGE_PAGETEXTCHANGED 1170 // pData = pageid
+#define VCLEVENT_ROADMAP_ITEMSELECTED 1171
+#define VCLEVENT_TOOLBOX_FORMATCHANGED 1172 // request new layout
+#define VCLEVENT_COMBOBOX_SETTEXT 1173
+// #i92103#
+#define VCLEVENT_ITEM_EXPANDED 1174
+#define VCLEVENT_ITEM_COLLAPSED 1175
+#define VCLEVENT_DROPDOWN_PRE_OPEN 1176
+
+// VclMenuEvent
+#define VCLEVENT_MENU_ACTIVATE 1200
+#define VCLEVENT_MENU_DEACTIVATE 1201
+#define VCLEVENT_MENU_HIGHLIGHT 1202
+#define VCLEVENT_MENU_SELECT 1203
+#define VCLEVENT_MENU_ENABLE 1204
+#define VCLEVENT_MENU_INSERTITEM 1205
+#define VCLEVENT_MENU_REMOVEITEM 1206
+#define VCLEVENT_MENU_SUBMENUACTIVATE 1207
+#define VCLEVENT_MENU_SUBMENUDEACTIVATE 1208
+#define VCLEVENT_MENU_SUBMENUCHANGED 1209
+#define VCLEVENT_MENU_DEHIGHLIGHT 1210
+#define VCLEVENT_MENU_DISABLE 1211
+#define VCLEVENT_MENU_ITEMTEXTCHANGED 1212
+#define VCLEVENT_MENU_ITEMCHECKED 1213
+#define VCLEVENT_MENU_ITEMUNCHECKED 1214
+#define VCLEVENT_MENU_ACCESSIBLENAMECHANGED 1215
+
+#define VCLEVENT_MENU_SHOW 1250
+#define VCLEVENT_MENU_HIDE 1251
+
+#define VCLEVENT_TOOLBOX_ITEMWINDOWCHANGED 1216
+
+// DockingWindow
+#define VCLEVENT_WINDOW_STARTDOCKING 1217 // pData = DockingData
+#define VCLEVENT_WINDOW_DOCKING 1218
+#define VCLEVENT_WINDOW_ENDDOCKING 1219 // pData = EndDockingData
+#define VCLEVENT_WINDOW_PREPARETOGGLEFLOATING 1220 // pData = sal_Bool
+#define VCLEVENT_WINDOW_TOGGLEFLOATING 1221
+#define VCLEVENT_WINDOW_ENDPOPUPMODE 1222 // pData = EndPopupModeData
+
+#define VCLEVENT_TOOLBOX_BUTTONSTATECHANGED 1223 // pData = itempos
+#define VCLEVENT_TABLECELL_NAMECHANGED 1224 // pData = struct(Entry, Column, oldText)
+#define VCLEVENT_TABLEROW_SELECT 1225
+
+class VCL_DLLPUBLIC VclSimpleEvent
+{
+private:
+ sal_uLong nId;
+
+public:
+ VclSimpleEvent( sal_uLong n ) { nId = n; }
+ virtual ~VclSimpleEvent() {}
+ TYPEINFO();
+
+ sal_uLong GetId() const { return nId; }
+};
+
+class VCL_DLLPUBLIC VclWindowEvent : public VclSimpleEvent
+{
+private:
+ Window* pWindow;
+ void* pData;
+
+public:
+ VclWindowEvent( Window* pWin, sal_uLong n, void* pDat = NULL ) : VclSimpleEvent(n) { pWindow = pWin; pData = pDat; }
+ virtual ~VclWindowEvent() {}
+ TYPEINFO();
+
+ Window* GetWindow() const { return pWindow; }
+ void* GetData() const { return pData; }
+};
+
+class VCL_DLLPUBLIC VclMenuEvent : public VclSimpleEvent
+{
+private:
+ Menu* pMenu;
+ sal_uInt16 mnPos;
+
+public:
+ VclMenuEvent( Menu* pM, sal_uLong n, sal_uInt16 nPos ) : VclSimpleEvent(n) { pMenu = pM; mnPos = nPos; }
+ virtual ~VclMenuEvent() {}
+ TYPEINFO();
+
+ Menu* GetMenu() const { return pMenu; }
+ sal_uInt16 GetItemPos() const { return mnPos; }
+};
+
+class VCL_DLLPUBLIC VclAccessibleEvent: public VclSimpleEvent
+{
+public:
+ VclAccessibleEvent( sal_uLong n, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
+ virtual ~VclAccessibleEvent();
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible() const;
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxAccessible;
+};
+
+class VCL_DLLPUBLIC VclEventListeners
+{
+public:
+ void Call( VclSimpleEvent* pEvent ) const;
+
+ // stops notifying when any handler has processed the event
+ // and returns sal_True in that case
+ // a handler must return sal_True to signal that it has processed the event
+ sal_Bool Process( VclSimpleEvent* pEvent ) const;
+ void addListener( const Link& rListener );
+ void removeListener( const Link& rListener );
+private:
+ std::list<Link> m_aListeners;
+};
+
+class VCL_DLLPUBLIC VclEventListeners2 : public vcl::DeletionNotifier
+{
+ std::list< Link > m_aListeners;
+
+ struct ListenerIt
+ {
+ std::list< Link >::iterator m_aIt;
+ bool m_bWasInvalidated;
+
+ ListenerIt(const std::list<Link>::iterator& rIt)
+ : m_aIt(rIt)
+ , m_bWasInvalidated( false )
+ {}
+ };
+
+ std::vector< ListenerIt > m_aIterators;
+
+
+public:
+ VclEventListeners2();
+ ~VclEventListeners2();
+
+ void addListener( const Link& );
+ void removeListener( const Link& );
+
+ void callListeners( VclSimpleEvent* );
+};
+
+#endif // _VCL_VCLEVENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/vclmain.hxx b/include/vcl/vclmain.hxx
new file mode 100644
index 000000000000..1b60cfba42ce
--- /dev/null
+++ b/include/vcl/vclmain.hxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.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_VCL_VCLMAIN_HXX
+#define INCLUDED_VCL_VCLMAIN_HXX
+
+#include "sal/config.h"
+
+namespace vclmain {
+
+// Function called from vclmain's implementation of main, needs to be
+// implemented by the application and needs to instantiate a (static, derived)
+// instance of Application (where the Application constructor takes care to link
+// that instance to ImplSVData.mpApp):
+void createApplication();
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/vclmedit.hxx b/include/vcl/vclmedit.hxx
new file mode 100644
index 000000000000..63caa3b4c352
--- /dev/null
+++ b/include/vcl/vclmedit.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 _VCLMEDIT_HXX
+#define _VCLMEDIT_HXX
+
+#include <tools/wintypes.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/dllapi.h>
+
+
+class ImpVclMEdit;
+class Timer;
+class ExtTextEngine;
+class ExtTextView;
+
+class VCL_DLLPUBLIC VclMultiLineEdit : public Edit
+{
+private:
+ ImpVclMEdit* pImpVclMEdit;
+
+ OUString aSaveValue;
+ Link aModifyHdlLink;
+
+ Timer* pUpdateDataTimer;
+ Link aUpdateDataHdlLink;
+
+protected:
+
+ DECL_LINK( ImpUpdateDataHdl, void* );
+ void StateChanged( StateChangedType nType );
+ void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ long Notify( NotifyEvent& rNEvt );
+ using Control::ImplInitSettings;
+ void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ WinBits ImplInitStyle( WinBits nStyle );
+
+ ExtTextEngine* GetTextEngine() const;
+ ExtTextView* GetTextView() const;
+ ScrollBar* GetVScrollBar() const;
+
+public:
+ VclMultiLineEdit( Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER );
+ VclMultiLineEdit( Window* pParent, const ResId& rResId );
+ virtual ~VclMultiLineEdit();
+
+
+ virtual void Modify();
+ virtual void UpdateData();
+
+ virtual void SetModifyFlag();
+ virtual void ClearModifyFlag();
+ virtual sal_Bool IsModified() const;
+
+ virtual void EnableUpdateData( sal_uLong nTimeout = EDIT_UPDATEDATA_TIMEOUT );
+ virtual void DisableUpdateData() { delete pUpdateDataTimer; pUpdateDataTimer = NULL; }
+ virtual sal_uLong IsUpdateDataEnabled() const;
+
+ virtual void SetReadOnly( sal_Bool bReadOnly = sal_True );
+ virtual sal_Bool IsReadOnly() const;
+
+ void EnableFocusSelectionHide( sal_Bool bHide );
+
+ virtual void SetMaxTextLen( xub_StrLen nMaxLen = 0 );
+ virtual xub_StrLen GetMaxTextLen() const;
+
+ virtual void SetSelection( const Selection& rSelection );
+ virtual const Selection& GetSelection() const;
+
+ virtual void ReplaceSelected( const OUString& rStr );
+ virtual void DeleteSelected();
+ virtual OUString GetSelected() const;
+ virtual OUString GetSelected( LineEnd aSeparator ) const;
+
+ virtual void Cut();
+ virtual void Copy();
+ virtual void Paste();
+
+ virtual void SetText( const OUString& rStr );
+ virtual void SetText( const OUString& rStr, const Selection& rNewSelection )
+ { SetText( rStr ); SetSelection( rNewSelection ); }
+ OUString GetText() const;
+ OUString GetText( LineEnd aSeparator ) const;
+ String GetTextLines( LineEnd aSeparator ) const;
+
+ void SetRightToLeft( sal_Bool bRightToLeft );
+ sal_Bool IsRightToLeft() const;
+
+ void SaveValue() { aSaveValue = GetText(); }
+ const OUString& GetSavedValue() const { return aSaveValue; }
+
+ void SetModifyHdl( const Link& rLink ) { aModifyHdlLink = rLink; }
+ const Link& GetModifyHdl() const { return aModifyHdlLink; }
+
+ void SetUpdateDataHdl( const Link& rLink ) { aUpdateDataHdlLink = rLink; }
+
+ virtual void Resize();
+ virtual void GetFocus();
+
+ Size CalcMinimumSize() const;
+ Size CalcAdjustedSize( const Size& rPrefSize ) const;
+ using Edit::CalcSize;
+ Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
+ void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
+
+ void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+
+ void SetLeftMargin( sal_uInt16 n );
+
+ void DisableSelectionOnFocus();
+
+ void SetTextSelectable( sal_Bool bTextSelectable );
+ void EnableCursor( sal_Bool bEnable );
+
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+};
+
+inline sal_uLong VclMultiLineEdit::IsUpdateDataEnabled() const
+{
+ return pUpdateDataTimer ? pUpdateDataTimer->GetTimeout() : 0;
+}
+
+#endif //_VCLMEDIT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx
new file mode 100644
index 000000000000..5d8a70e8f3dc
--- /dev/null
+++ b/include/vcl/virdev.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 _SV_VIRDEV_HXX
+#define _SV_VIRDEV_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/outdev.hxx>
+#include <basebmp/bitmapdevice.hxx>
+
+// -----------------
+// - VirtualDevice -
+// -----------------
+
+class SalVirtualDevice;
+struct SystemGraphicsData;
+
+class VCL_DLLPUBLIC VirtualDevice : public OutputDevice
+{
+ friend class Application;
+ friend class OutputDevice;
+
+private:
+ SalVirtualDevice* mpVirDev;
+ VirtualDevice* mpPrev;
+ VirtualDevice* mpNext;
+ sal_uInt16 mnBitCount;
+ sal_Bool mbScreenComp;
+ sal_Int8 mnAlphaDepth;
+ sal_uInt8 meRefDevMode;
+
+ SAL_DLLPRIVATE void ImplInitVirDev( const OutputDevice* pOutDev, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
+ SAL_DLLPRIVATE sal_Bool InnerImplSetOutputSizePixel( const Size& rNewSize, sal_Bool bErase, const basebmp::RawMemorySharedArray &pBuffer );
+ SAL_DLLPRIVATE sal_Bool ImplSetOutputSizePixel( const Size& rNewSize, sal_Bool bErase, const basebmp::RawMemorySharedArray &pBuffer );
+
+ // Copy assignment is forbidden and not implemented.
+ VirtualDevice (const VirtualDevice &);
+ VirtualDevice & operator= (const VirtualDevice &);
+
+ /** Used for alpha VDev, to set areas to opaque
+
+ @since #i32109#
+ */
+ SAL_DLLPRIVATE void ImplFillOpaqueRectangle( const Rectangle& rRect );
+
+ // TODO: add extra member for refdev backward compatibility options
+ #define REFDEV_FORCE_ZERO_EXTLEAD 0x80
+ SAL_DLLPRIVATE bool ForceZeroExtleadBug() const
+ { return ((meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD) != 0); }
+public:
+ /** Create a virtual device of size 1x1
+
+ @param nBitCount
+ Bit depth of the generated virtual device. Use 0 here, to
+ indicate: take default screen depth. Only 0, 1 and 8
+ are allowed here, with 1 denoting binary mask and 8 a graylevel mask.
+ */
+ VirtualDevice( sal_uInt16 nBitCount = 0 );
+
+ /** Create a virtual device of size 1x1
+
+ @param rCompDev
+ The generated vdev will be compatible to this device.
+
+ @param nBitCount
+ Bit depth of the generated virtual device. Use 0 here, to
+ indicate: take default screen depth. Only 0 and 1
+ are allowed here, with 1 denoting binary mask.
+ */
+ VirtualDevice( const OutputDevice& rCompDev,
+ sal_uInt16 nBitCount = 0 );
+
+ /** Create a virtual device of size 1x1 with alpha channel
+
+ @param rCompDev
+ The generated vdev will be compatible to this device.
+
+ @param nBitCount
+ Bit depth of the generated virtual device. Use 0 here, to
+ indicate: take default screen depth. Only 0 and 1
+ are allowed here, with 1 denoting binary mask.
+
+ @param nAlphaBitCount
+ Bit depth of the generated virtual device. Use 0 here, to
+ indicate: take default screen depth. Only 0 and 1
+ are allowed here, with 1 denoting binary mask.
+ */
+ VirtualDevice( const OutputDevice& rCompDev,
+ sal_uInt16 nBitCount, sal_uInt16 nAlphaBitCount );
+
+ /** Create a virtual device using an existing system dependent device or graphics context
+ Any rendering will happen directly on the context and not on any intermediate bitmap.
+ Note: This might not be suported on all platforms !
+ */
+ VirtualDevice( const SystemGraphicsData *pData, sal_uInt16 nBitCount );
+
+ virtual ~VirtualDevice();
+
+ sal_Bool SetOutputSizePixel( const Size& rNewSize, sal_Bool bErase = sal_True );
+ sal_Bool SetOutputSizePixelScaleOffsetAndBuffer( const Size& rNewSize, const Fraction& rScale, const Point& rNewOffset, const basebmp::RawMemorySharedArray &pBuffer );
+ sal_Bool SetOutputSize( const Size& rNewSize, sal_Bool bErase = sal_True )
+ { return SetOutputSizePixel( LogicToPixel( rNewSize ), bErase ); }
+
+ // reference device modes for different compatibility levels
+ enum RefDevMode { REFDEV_NONE = 0,
+ REFDEV_MODE06 = 1, // 600 dpi
+ REFDEV_MODE_MSO1 = 3,
+ REFDEV_MODE_PDF1 = 4,
+ REFDEV_CUSTOM = 5
+ };
+
+ void SetReferenceDevice( RefDevMode );
+
+ void Compat_ZeroExtleadBug(); // enable workaround for #i60495#
+
+ void SetReferenceDevice( sal_Int32 i_nDPIX, sal_Int32 i_nDPIY );
+
+private:
+ SAL_DLLPRIVATE void ImplSetReferenceDevice( RefDevMode, sal_Int32 i_nDPIX, sal_Int32 i_nDPIY );
+
+};
+
+#endif // _SV_VIRDEV_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/waitobj.hxx b/include/vcl/waitobj.hxx
new file mode 100644
index 000000000000..d9164a9a61b0
--- /dev/null
+++ b/include/vcl/waitobj.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 _SV_WAITOBJ_HXX
+#define _SV_WAITOBJ_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/window.hxx>
+
+// --------------
+// - WaitObject -
+// --------------
+
+class VCL_DLLPUBLIC WaitObject
+{
+private:
+ Window* mpWindow;
+public:
+ WaitObject( Window* pWindow )
+ {
+ mpWindow = pWindow;
+ if ( mpWindow )
+ mpWindow->EnterWait();
+ }
+ ~WaitObject();
+};
+
+#endif // _SV_WAITOBJ_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/wall.hxx b/include/vcl/wall.hxx
new file mode 100644
index 000000000000..e18adf78f60b
--- /dev/null
+++ b/include/vcl/wall.hxx
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_WALL_HXX
+#define _SV_WALL_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <tools/color.hxx>
+#include <tools/gen.hxx>
+
+class Gradient;
+class BitmapEx;
+class ImplWallpaper;
+
+// -------------------
+// - Wallpaper-Types -
+// -------------------
+
+#define WALLPAPER_NULL WallpaperStyle_NULL
+#define WALLPAPER_TILE WallpaperStyle_TILE
+#define WALLPAPER_CENTER WallpaperStyle_CENTER
+#define WALLPAPER_SCALE WallpaperStyle_SCALE
+#define WALLPAPER_TOPLEFT WallpaperStyle_TOPLEFT
+#define WALLPAPER_TOP WallpaperStyle_TOP
+#define WALLPAPER_TOPRIGHT WallpaperStyle_TOPRIGHT
+#define WALLPAPER_LEFT WallpaperStyle_LEFT
+#define WALLPAPER_RIGHT WallpaperStyle_RIGHT
+#define WALLPAPER_BOTTOMLEFT WallpaperStyle_BOTTOMLEFT
+#define WALLPAPER_BOTTOM WallpaperStyle_BOTTOM
+#define WALLPAPER_BOTTOMRIGHT WallpaperStyle_BOTTOMRIGHT
+#define WALLPAPER_APPLICATIONGRADIENT WallpaperStyle_APPLICATIONGRADIENT
+#define WALLPAPER_FORCE_EQUAL_SIZE WallpaperStyle_FORCE_EQUAL_SIZE
+
+#ifndef ENUM_WALLPAPERSTYLE_DECLARED
+#define ENUM_WALLPAPERSTYLE_DECLARED
+
+enum WallpaperStyle
+{
+ WALLPAPER_NULL,
+ WALLPAPER_TILE,
+ WALLPAPER_CENTER,
+ WALLPAPER_SCALE,
+ WALLPAPER_TOPLEFT,
+ WALLPAPER_TOP,
+ WALLPAPER_TOPRIGHT,
+ WALLPAPER_LEFT,
+ WALLPAPER_RIGHT,
+ WALLPAPER_BOTTOMLEFT,
+ WALLPAPER_BOTTOM,
+ WALLPAPER_BOTTOMRIGHT,
+ WALLPAPER_APPLICATIONGRADIENT, // defines a gradient that internally covers the whole application
+ // and uses a color derived from the face color
+ WALLPAPER_FORCE_EQUAL_SIZE = 0x7fffffff
+};
+
+#endif
+
+// -------------
+// - Wallpaper -
+// -------------
+
+class VCL_DLLPUBLIC Wallpaper
+{
+private:
+ ImplWallpaper* mpImplWallpaper;
+
+ SAL_DLLPRIVATE void ImplMakeUnique( sal_Bool bReleaseCache = sal_True );
+ SAL_DLLPRIVATE Gradient ImplGetApplicationGradient() const;
+
+public:
+ SAL_DLLPRIVATE ImplWallpaper* ImplGetImpWallpaper() const { return mpImplWallpaper; }
+
+
+public:
+ Wallpaper();
+ Wallpaper( const Wallpaper& rWallpaper );
+ Wallpaper( const Color& rColor );
+ Wallpaper( const BitmapEx& rBmpEx );
+ Wallpaper( const Gradient& rGradient );
+ ~Wallpaper();
+
+ void SetColor( const Color& rColor );
+ const Color& GetColor() const;
+
+ void SetStyle( WallpaperStyle eStyle );
+ WallpaperStyle GetStyle() const;
+
+ void SetBitmap( const BitmapEx& rBitmap );
+ BitmapEx GetBitmap() const;
+ sal_Bool IsBitmap() const;
+
+ void SetGradient( const Gradient& rGradient );
+ Gradient GetGradient() const;
+ sal_Bool IsGradient() const;
+
+ void SetRect( const Rectangle& rRect );
+ Rectangle GetRect() const;
+ sal_Bool IsRect() const;
+
+ sal_Bool IsFixed() const;
+ sal_Bool IsScrollable() const;
+
+ Wallpaper& operator=( const Wallpaper& rWallpaper );
+ sal_Bool operator==( const Wallpaper& rWallpaper ) const;
+ sal_Bool operator!=( const Wallpaper& rWallpaper ) const
+ { return !(Wallpaper::operator==( rWallpaper )); }
+ sal_Bool IsSameInstance( const Wallpaper& rWallpaper ) const
+ { return (mpImplWallpaper == rWallpaper.mpImplWallpaper); }
+
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Wallpaper& rWallpaper );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Wallpaper& rWallpaper );
+};
+
+#endif // _SV_WALL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
new file mode 100644
index 000000000000..43e232dab55c
--- /dev/null
+++ b/include/vcl/window.hxx
@@ -0,0 +1,1279 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _SV_WINDOW_HXX
+#define _SV_WINDOW_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/outdev.hxx>
+#include <tools/resid.hxx>
+#include <vcl/pointr.hxx>
+#include <tools/wintypes.hxx>
+#include <rsc/rsc-vcl-shared-types.hxx>
+#include <vcl/apptypes.hxx>
+#include <vcl/inputctx.hxx>
+#include <vcl/vclevent.hxx>
+// Only for compatibility - because many people outside haven't included event.hxx
+#include <vcl/event.hxx>
+#include <vcl/region.hxx>
+#include <vcl/salnativewidgets.hxx>
+#include <rtl/ustring.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <boost/shared_ptr.hpp>
+
+class VirtualDevice;
+struct ImplDelData;
+struct ImplWinData;
+struct ImplOverlapData;
+struct ImplFrameData;
+struct ImplCalcToTopData;
+struct SystemEnvData;
+struct SystemParentData;
+class ImplBorderWindow;
+class VirtualDevice;
+class Timer;
+class Cursor;
+class DockingManager;
+class ScrollBar;
+class Bitmap;
+class FixedText;
+class Image;
+class MouseEvent;
+class KeyEvent;
+class CommandEvent;
+class TrackingEvent;
+class HelpEvent;
+class DataChangedEvent;
+class NotifyEvent;
+class SystemWindow;
+class SalFrame;
+class SalObject;
+class MenuFloatingWindow;
+class UNOWindowData;
+// Nur fuer ExecuteDrag:
+struct IDataObject;
+class VCLXWindow;
+struct ImplAccessibleInfos;
+
+namespace com {
+namespace sun {
+namespace star {
+namespace accessibility {
+ class XAccessible;
+}}}}
+
+namespace com {
+namespace sun {
+namespace star {
+namespace beans {
+ struct PropertyValue;
+}}}}
+
+namespace com {
+namespace sun {
+namespace star {
+namespace rendering {
+ class XCanvas;
+ class XSpriteCanvas;
+}}}}
+
+namespace com {
+namespace sun {
+namespace star {
+namespace awt {
+ class XWindowPeer;
+ class XWindow;
+}
+namespace uno {
+ class Any;
+ class XInterface;
+}
+namespace datatransfer {
+namespace clipboard {
+ class XClipboard;
+}
+
+namespace dnd {
+ class XDragGestureRecognizer;
+ class XDragSource;
+ class XDropTarget;
+} } } } }
+
+namespace vcl {
+ struct ControlLayoutData;
+}
+
+namespace svt { class PopupWindowControllerImpl; }
+
+// ---------------
+// - WindowTypes -
+// ---------------
+
+// Type fuer GetWindow()
+#define WINDOW_PARENT ((sal_uInt16)0)
+#define WINDOW_FIRSTCHILD ((sal_uInt16)1)
+#define WINDOW_LASTCHILD ((sal_uInt16)2)
+#define WINDOW_PREV ((sal_uInt16)3)
+#define WINDOW_NEXT ((sal_uInt16)4)
+#define WINDOW_FIRSTOVERLAP ((sal_uInt16)5)
+#define WINDOW_LASTOVERLAP ((sal_uInt16)6)
+#define WINDOW_OVERLAP ((sal_uInt16)7)
+#define WINDOW_PARENTOVERLAP ((sal_uInt16)8)
+#define WINDOW_CLIENT ((sal_uInt16)9)
+#define WINDOW_REALPARENT ((sal_uInt16)10)
+#define WINDOW_FRAME ((sal_uInt16)11)
+#define WINDOW_BORDER ((sal_uInt16)12)
+#define WINDOW_FIRSTTOPWINDOWCHILD ((sal_uInt16)13)
+#define WINDOW_LASTTOPWINDOWCHILD ((sal_uInt16)14)
+#define WINDOW_PREVTOPWINDOWSIBLING ((sal_uInt16)15)
+#define WINDOW_NEXTTOPWINDOWSIBLING ((sal_uInt16)16)
+
+// Flags for setPosSizePixel()
+#define WINDOW_POSSIZE_X ((sal_uInt16)0x0001)
+#define WINDOW_POSSIZE_Y ((sal_uInt16)0x0002)
+#define WINDOW_POSSIZE_WIDTH ((sal_uInt16)0x0004)
+#define WINDOW_POSSIZE_HEIGHT ((sal_uInt16)0x0008)
+#define WINDOW_POSSIZE_POS (WINDOW_POSSIZE_X | WINDOW_POSSIZE_Y)
+#define WINDOW_POSSIZE_SIZE (WINDOW_POSSIZE_WIDTH | WINDOW_POSSIZE_HEIGHT)
+#define WINDOW_POSSIZE_POSSIZE (WINDOW_POSSIZE_POS | WINDOW_POSSIZE_SIZE)
+#define WINDOW_POSSIZE_ALL (WINDOW_POSSIZE_POSSIZE)
+#define WINDOW_POSSIZE_DROPDOWN ((sal_uInt16)0x0010)
+
+// Flags for Show()
+#define SHOW_NOPARENTUPDATE ((sal_uInt16)0x0001)
+#define SHOW_NOFOCUSCHANGE ((sal_uInt16)0x0002)
+#define SHOW_NOACTIVATE ((sal_uInt16)0x0004)
+#define SHOW_FOREGROUNDTASK ((sal_uInt16)0x0008)
+
+// Flags for SetZOrder()
+#define WINDOW_ZORDER_BEFOR ((sal_uInt16)0x0001)
+#define WINDOW_ZORDER_BEHIND ((sal_uInt16)0x0002)
+#define WINDOW_ZORDER_FIRST ((sal_uInt16)0x0004)
+#define WINDOW_ZORDER_LAST ((sal_uInt16)0x0008)
+
+// Activate-Flags
+#define ACTIVATE_MODE_GRABFOCUS ((sal_uInt16)0x0001)
+
+// ToTop-Flags
+#define TOTOP_RESTOREWHENMIN ((sal_uInt16)0x0001)
+#define TOTOP_FOREGROUNDTASK ((sal_uInt16)0x0002)
+#define TOTOP_NOGRABFOCUS ((sal_uInt16)0x0004)
+#define TOTOP_GRABFOCUSONLY ((sal_uInt16)0x0008)
+
+// Flags for Invalidate
+#define INVALIDATE_CHILDREN ((sal_uInt16)0x0001)
+#define INVALIDATE_NOCHILDREN ((sal_uInt16)0x0002)
+#define INVALIDATE_NOERASE ((sal_uInt16)0x0004)
+#define INVALIDATE_UPDATE ((sal_uInt16)0x0008)
+#define INVALIDATE_TRANSPARENT ((sal_uInt16)0x0010)
+#define INVALIDATE_NOTRANSPARENT ((sal_uInt16)0x0020)
+#define INVALIDATE_NOCLIPCHILDREN ((sal_uInt16)0x4000)
+// Temporaer fuer Kompatibilitaet
+#define INVALIDATE_BACKGROUND INVALIDATE_TRANSPARENT
+
+// Flags for Validate
+#define VALIDATE_CHILDREN ((sal_uInt16)0x0001)
+#define VALIDATE_NOCHILDREN ((sal_uInt16)0x0002)
+
+// Flags for Scroll
+#define SCROLL_CLIP ((sal_uInt16)0x0001)
+#define SCROLL_CHILDREN ((sal_uInt16)0x0002)
+#define SCROLL_NOCHILDREN ((sal_uInt16)0x0004)
+#define SCROLL_NOERASE ((sal_uInt16)0x0008)
+#define SCROLL_NOINVALIDATE ((sal_uInt16)0x0010)
+#define SCROLL_NOWINDOWINVALIDATE ((sal_uInt16)0x0020)
+#define SCROLL_USECLIPREGION ((sal_uInt16)0x0040)
+#define SCROLL_UPDATE ((sal_uInt16)0x0080)
+
+// Flags for ParentClipMode
+#define PARENTCLIPMODE_CLIP ((sal_uInt16)0x0001)
+#define PARENTCLIPMODE_NOCLIP ((sal_uInt16)0x0002)
+
+// Flags for Invert()
+#define INVERT_HIGHLIGHT ((sal_uInt16)0x0001)
+#define INVERT_50 ((sal_uInt16)0x0002)
+
+// Flags for ShowTracking()
+#define SHOWTRACK_SMALL ((sal_uInt16)0x0001)
+#define SHOWTRACK_BIG ((sal_uInt16)0x0002)
+#define SHOWTRACK_SPLIT ((sal_uInt16)0x0003)
+#define SHOWTRACK_OBJECT ((sal_uInt16)0x0004)
+#define SHOWTRACK_WINDOW ((sal_uInt16)0x1000)
+#define SHOWTRACK_CLIP ((sal_uInt16)0x2000)
+#define SHOWTRACK_STYLE ((sal_uInt16)0x000F)
+
+// Flags for StartTracking()
+#define STARTTRACK_KEYINPUT ((sal_uInt16)0x0001)
+#define STARTTRACK_KEYMOD ((sal_uInt16)0x0002)
+#define STARTTRACK_NOKEYCANCEL ((sal_uInt16)0x0004)
+#define STARTTRACK_SCROLLREPEAT ((sal_uInt16)0x0008)
+#define STARTTRACK_BUTTONREPEAT ((sal_uInt16)0x0010)
+#define STARTTRACK_MOUSEBUTTONDOWN ((sal_uInt16)0x0020)
+#define STARTTRACK_FOCUSCANCEL ((sal_uInt16)0x0040)
+
+// Flags for StartAutoScroll()
+#define AUTOSCROLL_VERT ((sal_uInt16)0x0001)
+#define AUTOSCROLL_HORZ ((sal_uInt16)0x0002)
+
+// Flags for StateChanged()
+typedef sal_uInt16 StateChangedType;
+#define STATE_CHANGE_INITSHOW ((StateChangedType)1)
+#define STATE_CHANGE_VISIBLE ((StateChangedType)2)
+#define STATE_CHANGE_UPDATEMODE ((StateChangedType)3)
+#define STATE_CHANGE_ENABLE ((StateChangedType)4)
+#define STATE_CHANGE_TEXT ((StateChangedType)5)
+#define STATE_CHANGE_IMAGE ((StateChangedType)6)
+#define STATE_CHANGE_DATA ((StateChangedType)7)
+#define STATE_CHANGE_STATE ((StateChangedType)8)
+#define STATE_CHANGE_STYLE ((StateChangedType)9)
+#define STATE_CHANGE_ZOOM ((StateChangedType)10)
+#define STATE_CHANGE_BORDER ((StateChangedType)11)
+#define STATE_CHANGE_TRANSPARENT ((StateChangedType)12)
+#define STATE_CHANGE_CONTROLFONT ((StateChangedType)13)
+#define STATE_CHANGE_CONTROLFOREGROUND ((StateChangedType)14)
+#define STATE_CHANGE_CONTROLBACKGROUND ((StateChangedType)15)
+#define STATE_CHANGE_READONLY ((StateChangedType)16)
+#define STATE_CHANGE_EXTENDEDSTYLE ((StateChangedType)17)
+#define STATE_CHANGE_MIRRORING ((StateChangedType)18)
+#define STATE_CHANGE_CONTROL_FOCUS ((StateChangedType)20)
+#define STATE_CHANGE_USER ((StateChangedType)10000)
+
+// GetFocusFlags
+#define GETFOCUS_TAB ((sal_uInt16)0x0001)
+#define GETFOCUS_CURSOR ((sal_uInt16)0x0002)
+#define GETFOCUS_MNEMONIC ((sal_uInt16)0x0004)
+#define GETFOCUS_FORWARD ((sal_uInt16)0x0010)
+#define GETFOCUS_BACKWARD ((sal_uInt16)0x0020)
+#define GETFOCUS_AROUND ((sal_uInt16)0x0040)
+#define GETFOCUS_UNIQUEMNEMONIC ((sal_uInt16)0x0100)
+#define GETFOCUS_INIT ((sal_uInt16)0x0200)
+#define GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0400)
+
+// Draw-Flags fuer Draw()
+#define WINDOW_DRAW_MONO ((sal_uLong)0x00000001)
+#define WINDOW_DRAW_NOBORDER ((sal_uLong)0x00000002)
+#define WINDOW_DRAW_NOCONTROLS ((sal_uLong)0x00000004)
+#define WINDOW_DRAW_NODISABLE ((sal_uLong)0x00000008)
+#define WINDOW_DRAW_NOMNEMONIC ((sal_uLong)0x00000010)
+#define WINDOW_DRAW_NOSELECTION ((sal_uLong)0x00000020)
+#define WINDOW_DRAW_NOFOCUS ((sal_uLong)0x00000040)
+#define WINDOW_DRAW_NOBACKGROUND ((sal_uLong)0x00000080)
+#define WINDOW_DRAW_ROLLOVER ((sal_uLong)0x00000100)
+
+// DialogControl-Flags
+#define WINDOW_DLGCTRL_RETURN ((sal_uInt16)0x0001)
+#define WINDOW_DLGCTRL_WANTFOCUS ((sal_uInt16)0x0002)
+#define WINDOW_DLGCTRL_MOD1TAB ((sal_uInt16)0x0004)
+#define WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0008)
+
+// GetWindowClipRegionPixel-Flags
+#define WINDOW_GETCLIPREGION_NULL ((sal_uInt16)0x0001)
+#define WINDOW_GETCLIPREGION_NOCHILDREN ((sal_uInt16)0x0002)
+
+// EndExtTextInput-Flags
+#define EXTTEXTINPUT_END_COMPLETE ((sal_uInt16)0x0001)
+#define EXTTEXTINPUT_END_CANCEL ((sal_uInt16)0x0002)
+
+#define IMPL_MINSIZE_BUTTON_WIDTH 70
+#define IMPL_MINSIZE_BUTTON_HEIGHT 22
+#define IMPL_EXTRA_BUTTON_WIDTH 18
+#define IMPL_EXTRA_BUTTON_HEIGHT 10
+#define IMPL_SEP_BUTTON_X 5
+#define IMPL_SEP_BUTTON_Y 5
+#define IMPL_MINSIZE_MSGBOX_WIDTH 150
+#define IMPL_MINSIZE_MSGBOX_HEIGHT 80
+#define IMPL_DIALOG_OFFSET 5
+#define IMPL_DIALOG_BAR_OFFSET 3
+#define IMPL_MSGBOX_OFFSET_EXTRA_X 0
+#define IMPL_MSGBOX_OFFSET_EXTRA_Y 2
+#define IMPL_SEP_MSGBOX_IMAGE 8
+
+#define DLGWINDOW_PREV 0
+#define DLGWINDOW_NEXT 1
+#define DLGWINDOW_FIRST 2
+
+// ----------
+// - Window -
+// ----------
+
+#ifdef DBG_UTIL
+const char* ImplDbgCheckWindow( const void* pObj );
+#endif
+
+class Dialog;
+class WindowImpl;
+class VclBuilder;
+class VclSizeGroup;
+
+struct WindowResHeader
+{
+ sal_uLong nObjMask;
+ OString aHelpId;
+ sal_uLong nRSStyle;
+};
+
+class VCL_DLLPUBLIC Window : public OutputDevice
+{
+ friend class Cursor;
+ friend class OutputDevice;
+ friend class Application;
+ friend class SystemWindow;
+ friend class WorkWindow;
+ friend class Dialog;
+ friend class MessBox;
+ friend class DockingWindow;
+ friend class FloatingWindow;
+ friend class GroupBox;
+ friend class PushButton;
+ friend class RadioButton;
+ friend class SystemChildWindow;
+ friend class ImplBorderWindow;
+ friend class VclBuilder;
+
+ // TODO: improve missing functionality
+ // only required because of SetFloatingMode()
+ friend class ImplDockingWindowWrapper;
+ friend class ImplPopupFloatWin;
+ friend class MenuFloatingWindow;
+
+ friend class svt::PopupWindowControllerImpl;
+
+private:
+ // NOTE: to remove many dependencies of other modules
+ // to this central file, all members are now hidden
+ // in the WindowImpl class and all inline functions
+ // were removed
+ //
+ // Please do *not* add new members or inline functions to class Window,
+ // but use class WindowImpl instead
+ //
+ WindowImpl* mpWindowImpl;
+
+ SAL_DLLPRIVATE void ImplInitWindowData( WindowType nType );
+
+#ifdef DBG_UTIL
+ friend const char* ImplDbgCheckWindow( const void* pObj );
+#endif
+ friend Window* ImplFindWindow( const SalFrame* pFrame, Point& rSalFramePos );
+public:
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData );
+ SAL_DLLPRIVATE WinBits ImplInitRes( const ResId& rResId );
+ SAL_DLLPRIVATE WindowResHeader ImplLoadResHeader( const ResId& rResId );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE void ImplSetFrameParent( const Window* pParent );
+ SAL_DLLPRIVATE void ImplInsertWindow( Window* pParent );
+ SAL_DLLPRIVATE void ImplRemoveWindow( sal_Bool bRemoveFrameData );
+ SAL_DLLPRIVATE Window* ImplGetWindow();
+ SAL_DLLPRIVATE ImplFrameData* ImplGetFrameData();
+ SalFrame* ImplGetFrame() const;
+ SAL_DLLPRIVATE ImplWinData* ImplGetWinData() const;
+ SAL_DLLPRIVATE SalGraphics* ImplGetFrameGraphics() const;
+ SAL_DLLPRIVATE void ImplCallFocusChangeActivate( Window* pNewOverlapWindow, Window* pOldOverlapWindow );
+ SAL_DLLPRIVATE Window* ImplFindWindow( const Point& rFramePos );
+ SAL_DLLPRIVATE sal_uInt16 ImplHitTest( const Point& rFramePos );
+ SAL_DLLPRIVATE Window* ImplGetParent() const;
+ SAL_DLLPRIVATE Window* ImplGetClientWindow() const;
+ SAL_DLLPRIVATE Window* ImplGetBorderWindow() const;
+ SAL_DLLPRIVATE Window* ImplGetFirstOverlapWindow();
+ SAL_DLLPRIVATE const Window* ImplGetFirstOverlapWindow() const;
+ SAL_DLLPRIVATE Window* ImplGetFrameWindow() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsRealParentPath( const Window* pWindow ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsDockingWindow() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsFloatingWindow() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsSplitter() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsPushButton() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsOverlapWindow() const;
+ SAL_DLLPRIVATE void ImplSetMouseTransparent( sal_Bool bTransparent );
+ SAL_DLLPRIVATE int ImplTestMousePointerSet();
+ SAL_DLLPRIVATE PointerStyle ImplGetMousePointer() const;
+ SAL_DLLPRIVATE void ImplResetReallyVisible();
+ SAL_DLLPRIVATE void ImplSetReallyVisible();
+ SAL_DLLPRIVATE void ImplCallInitShow();
+ SAL_DLLPRIVATE void ImplAddDel( ImplDelData* pDel );
+ SAL_DLLPRIVATE void ImplRemoveDel( ImplDelData* pDel );
+ SAL_DLLPRIVATE void ImplInitResolutionSettings();
+ SAL_DLLPRIVATE void ImplPointToLogic( Font& rFont ) const;
+ SAL_DLLPRIVATE void ImplLogicToPoint( Font& rFont ) const;
+ SAL_DLLPRIVATE Point ImplOutputToFrame( const Point& rPos );
+ SAL_DLLPRIVATE Point ImplFrameToOutput( const Point& rPos );
+ SAL_DLLPRIVATE sal_Bool ImplSysObjClip( const Region* pOldRegion );
+ SAL_DLLPRIVATE void ImplUpdateSysObjChildrenClip();
+ SAL_DLLPRIVATE void ImplUpdateSysObjOverlapsClip();
+ SAL_DLLPRIVATE void ImplUpdateSysObjClip();
+ SAL_DLLPRIVATE sal_Bool ImplSetClipFlagChildren( sal_Bool bSysObjOnlySmaller = sal_False );
+ SAL_DLLPRIVATE sal_Bool ImplSetClipFlagOverlapWindows( sal_Bool bSysObjOnlySmaller = sal_False );
+ SAL_DLLPRIVATE sal_Bool ImplSetClipFlag( sal_Bool bSysObjOnlySmaller = sal_False );
+ SAL_DLLPRIVATE void ImplIntersectWindowClipRegion( Region& rRegion );
+ SAL_DLLPRIVATE void ImplIntersectWindowRegion( Region& rRegion );
+ SAL_DLLPRIVATE void ImplExcludeWindowRegion( Region& rRegion );
+ SAL_DLLPRIVATE void ImplExcludeOverlapWindows( Region& rRegion );
+ SAL_DLLPRIVATE void ImplExcludeOverlapWindows2( Region& rRegion );
+ SAL_DLLPRIVATE void ImplClipBoundaries( Region& rRegion, sal_Bool bThis, sal_Bool bOverlaps );
+ SAL_DLLPRIVATE sal_Bool ImplClipChildren( Region& rRegion );
+ SAL_DLLPRIVATE void ImplClipAllChildren( Region& rRegion );
+ SAL_DLLPRIVATE void ImplClipSiblings( Region& rRegion );
+ SAL_DLLPRIVATE void ImplInitWinClipRegion();
+ SAL_DLLPRIVATE void ImplInitWinChildClipRegion();
+ SAL_DLLPRIVATE Region* ImplGetWinChildClipRegion();
+ SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows( const Region& rInterRegion, Region& rRegion );
+ SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows2( const Region& rInterRegion, Region& rRegion );
+ SAL_DLLPRIVATE void ImplCalcOverlapRegionOverlaps( const Region& rInterRegion, Region& rRegion );
+ SAL_DLLPRIVATE void ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegion,
+ sal_Bool bChildren, sal_Bool bParent, sal_Bool bSiblings );
+ SAL_DLLPRIVATE void ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags );
+ SAL_DLLPRIVATE void ImplCallOverlapPaint();
+ SAL_DLLPRIVATE void ImplPostPaint();
+ SAL_DLLPRIVATE void ImplInvalidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplInvalidateOverlapFrameRegion( const Region& rRegion );
+ SAL_DLLPRIVATE void ImplInvalidateParentFrameRegion( Region& rRegion );
+ SAL_DLLPRIVATE void ImplInvalidate( const Region* rRegion, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplValidateFrameRegion( const Region* rRegion, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplValidate( const Region* rRegion, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplMoveInvalidateRegion( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_Bool bChildren );
+ SAL_DLLPRIVATE void ImplMoveAllInvalidateRegions( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_Bool bChildren );
+ SAL_DLLPRIVATE void ImplScroll( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplUpdateAll( sal_Bool bOverlapWindows = sal_True );
+ SAL_DLLPRIVATE void ImplUpdateWindowPtr( Window* pWindow );
+ SAL_DLLPRIVATE void ImplUpdateWindowPtr();
+ SAL_DLLPRIVATE void ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame );
+ SAL_DLLPRIVATE sal_Bool ImplUpdatePos();
+ SAL_DLLPRIVATE void ImplUpdateSysObjPos();
+ SAL_DLLPRIVATE WindowImpl* ImplGetWindowImpl() const { return mpWindowImpl; }
+
+ /** check whether a font is suitable for UI
+
+ The font to be tested will be checked whether it could display a
+ localized test string. If this is not the case, then the font
+ is deemed unsuitable as UI font.
+
+ @param rFont
+ the font to be tested
+
+ @returns
+ <TRUE/> if the font can be used as UI font
+ <FALSE/> if the font is unsuitable as UI font
+ */
+ SAL_DLLPRIVATE bool ImplCheckUIFont( const Font& rFont );
+ SAL_DLLPRIVATE void ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl = sal_True );
+ SAL_DLLPRIVATE void ImplAlignChildren();
+ SAL_DLLPRIVATE void ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplToBottomChild();
+ SAL_DLLPRIVATE void ImplCalcToTop( ImplCalcToTopData* pPrevData );
+ SAL_DLLPRIVATE void ImplToTop( sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplStartToTop( sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplFocusToTop( sal_uInt16 nFlags, sal_Bool bReallyVisible );
+ SAL_DLLPRIVATE void ImplShowAllOverlaps();
+ SAL_DLLPRIVATE void ImplHideAllOverlaps();
+ SAL_DLLPRIVATE void ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt );
+ SAL_DLLPRIVATE void ImplCallMouseMove( sal_uInt16 nMouseCode, sal_Bool bModChanged = sal_False );
+ SAL_DLLPRIVATE void ImplGenerateMouseMove();
+ SAL_DLLPRIVATE void ImplGrabFocus( sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplInvertFocus( const Rectangle& rRect );
+ SAL_DLLPRIVATE void ImplControlFocus( sal_uInt16 nFlags = 0 );
+ SAL_DLLPRIVATE Window* ImplGetDlgWindow( sal_uInt16 n, sal_uInt16 nType, sal_uInt16 nStart = 0, sal_uInt16 nEnd = 0xFFFF, sal_uInt16* pIndex = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput );
+ SAL_DLLPRIVATE sal_Bool ImplHasDlgCtrl();
+ SAL_DLLPRIVATE void ImplDlgCtrlNextWindow();
+ SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged( Window* pWindow, sal_Bool bGetFocus );
+ SAL_DLLPRIVATE Window* ImplFindDlgCtrlWindow( Window* pWindow );
+ SAL_DLLPRIVATE long ImplLogicUnitToPixelX( long nX, MapUnit eUnit );
+ SAL_DLLPRIVATE long ImplLogicUnitToPixelY( long nY, MapUnit eUnit );
+ SAL_DLLPRIVATE sal_Bool ImplIsWindowInFront( const Window* pTestWindow ) const;
+ SAL_DLLPRIVATE void ImplSaveOverlapBackground();
+ SAL_DLLPRIVATE sal_Bool ImplRestoreOverlapBackground( Region& rInvRegion );
+ SAL_DLLPRIVATE void ImplDeleteOverlapBackground();
+ SAL_DLLPRIVATE void ImplInvalidateAllOverlapBackgrounds();
+ SAL_DLLPRIVATE static void ImplNewInputContext();
+ SAL_DLLPRIVATE void ImplCallActivateListeners(Window*);
+ SAL_DLLPRIVATE void ImplCallDeactivateListeners(Window*);
+ DECL_DLLPRIVATE_LINK( ImplHandlePaintHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplGenerateMouseMoveHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplTrackTimerHdl, Timer* );
+ DECL_DLLPRIVATE_LINK( ImplAsyncFocusHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplHideOwnerDrawWindowsHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplHandleResizeTimerHdl, void* );
+
+ SAL_DLLPRIVATE static void ImplCalcSymbolRect( Rectangle& rRect );
+ SAL_DLLPRIVATE void ImplHandleScroll( ScrollBar* pHScrl, long nX, ScrollBar* pVScrl, long nY );
+ SAL_DLLPRIVATE sal_Bool ImplIsAccessibleCandidate() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsAccessibleNativeFrame() const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetAccessibleCandidateChildWindowCount( sal_uInt16 nFirstWindowType ) const;
+ SAL_DLLPRIVATE Window* ImplGetAccessibleCandidateChild( sal_uInt16 nChild, sal_uInt16& rChildCount, sal_uInt16 nFirstWindowType, sal_Bool bTopLevel = sal_True ) const;
+ SAL_DLLPRIVATE sal_Bool ImplRegisterAccessibleNativeFrame();
+ SAL_DLLPRIVATE void ImplRevokeAccessibleNativeFrame();
+ SAL_DLLPRIVATE void ImplCallResize();
+ SAL_DLLPRIVATE void ImplCallMove();
+ SAL_DLLPRIVATE Rectangle ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle& rRect ) const;
+ SAL_DLLPRIVATE void ImplMirrorFramePos( Point &pt ) const;
+ SAL_DLLPRIVATE long ImplGetUnmirroredOutOffX();
+ SAL_DLLPRIVATE void ImplIncModalCount();
+ SAL_DLLPRIVATE void ImplDecModalCount();
+
+ // retrieves the list of owner draw decorated windows for this window hiearchy
+ SAL_DLLPRIVATE ::std::vector<Window *>& ImplGetOwnerDrawList();
+ SAL_DLLPRIVATE Window* ImplGetTopmostFrameWindow();
+
+ SAL_DLLPRIVATE Rectangle ImplGetWindowExtentsRelative( Window *pRelativeWindow, sal_Bool bClientOnly ) const;
+ SAL_DLLPRIVATE void ImplNotifyIconifiedState( sal_Bool bIconified );
+ SAL_DLLPRIVATE bool ImplStopDnd();
+ SAL_DLLPRIVATE void ImplStartDnd();
+
+ SAL_DLLPRIVATE static void ImplInitAppFontData( Window* pWindow );
+ SAL_DLLPRIVATE void ImplPaintToDevice( OutputDevice* pTargetOutDev, const Point& rPos );
+
+ SAL_DLLPRIVATE void ImplIsInTaskPaneList( sal_Bool mbIsInTaskList );
+ SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas >
+ ImplGetCanvas( const Size& rFullscreenSize, bool bFullscreen, bool bSpriteCanvas ) const;
+
+private:
+ // Default construction is forbidden and not implemented.
+ SAL_DLLPRIVATE Window();
+
+ // Copy assignment is forbidden and not implemented.
+ SAL_DLLPRIVATE Window (const Window &);
+ SAL_DLLPRIVATE Window & operator= (const Window &);
+
+protected:
+ // Single argument ctors shall be explicit.
+ explicit Window( WindowType nType );
+
+ void SetCompoundControl( sal_Bool bCompound );
+
+ void ImplCallEventListeners( sal_uLong nEvent, void* pData = NULL );
+ void CallEventListeners( sal_uLong nEvent, void* pData = NULL );
+ void FireVclEvent( VclSimpleEvent* pEvent );
+
+ // FIXME: this is a hack to workaround missing layout functionality
+ SAL_DLLPRIVATE void ImplAdjustNWFSizes();
+
+ // These eventually are supposed to go when everything is converted to .ui
+ SAL_DLLPRIVATE Window* getLegacyNonLayoutAccessibleRelationMemberOf() const;
+ SAL_DLLPRIVATE Window* getLegacyNonLayoutAccessibleRelationLabeledBy() const;
+ SAL_DLLPRIVATE Window* getLegacyNonLayoutAccessibleRelationLabelFor() const;
+
+ // Let Label override the code part of GetAccessibleRelationLabelFor
+ virtual Window* getAccessibleRelationLabelFor() const;
+ virtual sal_uInt16 getDefaultAccessibleRole() const;
+ virtual OUString getDefaultAccessibleName() const;
+public:
+ // Single argument ctors shall be explicit.
+ explicit Window( Window* pParent, WinBits nStyle = 0 );
+
+ Window( Window* pParent, const ResId& rResId );
+ virtual ~Window();
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void KeyUp( const KeyEvent& rKEvt );
+ virtual void PrePaint();
+ virtual void Paint( const Rectangle& rRect );
+
+ virtual void PostPaint();
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Move();
+ virtual void Resize();
+ virtual void Activate();
+ virtual void Deactivate();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void UserEvent( sal_uLong nEvent, void* pEventData );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual Window* GetPreferredKeyInputWindow();
+
+ /*virtual*/ void AddEventListener( const Link& rEventListener );
+ /*virtual*/ void RemoveEventListener( const Link& rEventListener );
+ /*virtual*/ void AddChildEventListener( const Link& rEventListener );
+ /*virtual*/ void RemoveChildEventListener( const Link& rEventListener );
+
+ sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL );
+ sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL );
+ void RemoveUserEvent( sal_uLong nUserEvent );
+
+ void IncrementLockCount();
+ void DecrementLockCount();
+ sal_Bool IsLocked( sal_Bool bChildren = sal_False ) const;
+
+ // returns the input language used for the last key stroke
+ // may be LANGUAGE_DONTKNOW if not supported by the OS
+ LanguageType GetInputLanguage() const;
+
+ void SetStyle( WinBits nStyle );
+ WinBits GetStyle() const;
+ WinBits GetPrevStyle() const;
+ void SetExtendedStyle( WinBits nExtendedStyle );
+ WinBits GetExtendedStyle() const;
+ void SetType( WindowType nType );
+ WindowType GetType() const;
+ sal_Bool IsSystemWindow() const;
+ sal_Bool IsDialog() const;
+ sal_Bool IsMenuFloatingWindow() const;
+ sal_Bool IsToolbarFloatingWindow() const;
+ sal_Bool IsTopWindow() const;
+ SystemWindow* GetSystemWindow() const;
+
+ void EnableAllResize( sal_Bool bEnable = sal_True );
+
+ void SetBorderStyle( sal_uInt16 nBorderStyle );
+ sal_uInt16 GetBorderStyle() const;
+ void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+ sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
+ Size CalcWindowSize( const Size& rOutSz ) const;
+ Size CalcOutputSize( const Size& rWinSz ) const;
+ long CalcTitleWidth() const;
+
+ void EnableClipSiblings( sal_Bool bClipSiblings = sal_True );
+
+ void EnableChildTransparentMode( sal_Bool bEnable = sal_True );
+ sal_Bool IsChildTransparentModeEnabled() const;
+
+ void SetMouseTransparent( sal_Bool bTransparent );
+ sal_Bool IsMouseTransparent() const;
+ void SetPaintTransparent( sal_Bool bTransparent );
+ sal_Bool IsPaintTransparent() const;
+ void SetDialogControlStart( sal_Bool bStart );
+ sal_Bool IsDialogControlStart() const;
+ void SetDialogControlFlags( sal_uInt16 nFlags );
+ sal_uInt16 GetDialogControlFlags() const;
+
+ struct PointerState
+ {
+ sal_uLong mnState; // the button state
+ Point maPos; // mouse position in output coordinates
+ };
+ PointerState GetPointerState();
+ sal_Bool IsMouseOver();
+
+ sal_uLong GetCurrentModButtons();
+
+ void SetInputContext( const InputContext& rInputContext );
+ const InputContext& GetInputContext() const;
+ void EndExtTextInput( sal_uInt16 nFlags );
+ void SetCursorRect( const Rectangle* pRect = NULL, long nExtTextInputWidth = 0 );
+ const Rectangle* GetCursorRect() const;
+ long GetCursorExtTextInputWidth() const;
+
+ using OutputDevice::SetSettings;
+ virtual void SetSettings( const AllSettings& rSettings );
+ virtual void SetSettings( const AllSettings& rSettings, sal_Bool bChild );
+ void UpdateSettings( const AllSettings& rSettings, sal_Bool bChild = sal_False );
+ void NotifyAllChildren( DataChangedEvent& rDCEvt );
+
+ void SetPointFont( const Font& rFont );
+ Font GetPointFont() const;
+ void SetZoomedPointFont( const Font& rFont );
+ long GetDrawPixel( OutputDevice* pDev, long nPixels ) const;
+ Font GetDrawPixelFont( OutputDevice* pDev ) const;
+
+ void SetControlFont();
+ void SetControlFont( const Font& rFont );
+ Font GetControlFont() const;
+ sal_Bool IsControlFont() const;
+ void SetControlForeground();
+ void SetControlForeground( const Color& rColor );
+ Color GetControlForeground() const;
+ sal_Bool IsControlForeground() const;
+ void SetControlBackground();
+ void SetControlBackground( const Color& rColor );
+ Color GetControlBackground() const;
+ sal_Bool IsControlBackground() const;
+
+ void SetParentClipMode( sal_uInt16 nMode = 0 );
+ sal_uInt16 GetParentClipMode() const;
+
+ void SetWindowRegionPixel();
+ void SetWindowRegionPixel( const Region& rRegion );
+ const Region& GetWindowRegionPixel() const;
+ sal_Bool IsWindowRegionPixel() const;
+ Region GetWindowClipRegionPixel( sal_uInt16 nFlags = 0 ) const;
+ Region GetPaintRegion() const;
+ sal_Bool IsInPaint() const;
+ // while IsInPaint returns true ExpandPaintClipRegion adds the
+ // submitted region to the paint clip region so you can
+ // paint additional parts of your window if necessary
+ void ExpandPaintClipRegion( const Region& rRegion );
+
+ void SetParent( Window* pNewParent );
+ Window* GetParent() const;
+ // return the dialog we are contained in or NULL if un-contained
+ Dialog* GetParentDialog() const;
+
+ void Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 );
+ void Hide( sal_uInt16 nFlags = 0 ) { Show( sal_False, nFlags ); }
+ sal_Bool IsVisible() const;
+ sal_Bool IsReallyVisible() const;
+ sal_Bool IsReallyShown() const;
+ sal_Bool IsInInitShow() const;
+
+ void Enable( bool bEnable = true, bool bChild = true );
+ void Disable( bool bChild = true ) { Enable( false, bChild ); }
+ sal_Bool IsEnabled() const;
+
+ void EnableInput( sal_Bool bEnable = sal_True, sal_Bool bChild = sal_True );
+ void EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin,
+ const Window* pExcludeWindow = NULL );
+ sal_Bool IsInputEnabled() const;
+
+ /** Override <code>EnableInput</code>. This can be necessary due to other people
+ using EnableInput for whole window hierarchies.
+
+
+ <code>AlwaysEnableInput</code> and <code>AlwaysDisableInput</code> are
+ mutually exclusive; the last setter wins.
+ @param bAlways
+ sets always enabled flag
+
+ @param bChild
+ if true children are recursively set to AlwaysEnableInput
+ */
+ void AlwaysEnableInput( sal_Bool bAlways, sal_Bool bChild = sal_True );
+ /** returns the current AlwaysEnableInput state
+ @return
+ true if window is in AlwaysEnableInput state
+ */
+ sal_Bool IsAlwaysEnableInput() const;
+ /** Override <code>EnableInput</code>, counterpart to AlwaysEnableInput.
+ Windows with AlwaysDisableInput will not get key events even if enabled
+ and input enabled.This can be necessary due to other people using EnableInput
+ for whole window hierarchies.
+
+ <code>AlwaysEnableInput</code> and <code>AlwaysDisableInput</code> are
+ mutually exclusive; the last setter wins.
+
+ @param bAlways
+ sets always disable flag
+
+ @param bChild
+ if true children are recursively set to AlwaysDisableInput
+ */
+ void AlwaysDisableInput( sal_Bool bAlways, sal_Bool bChild = sal_True );
+
+ /** usually event handlers (see AddEventListener and AddChildEventListener)
+ are not called on disabled, modal or input disabled windows. There are however rare cases
+ in which one wants a Window or rather one of its Control subclasses to
+ not evaluate events but still react to those events externally. In these
+ rare cases call SetCallHandlersOnInputDisabled( true ) to have your handler
+ called anyway.
+
+ Currently only mouse events get this special treatment.
+
+ Use this sparingly, chances are if you want to use it you're working around
+ the real problem.
+
+ @param bCall
+ Enable/Disable calling event handlers for this disabled, modal or input disabled window.
+ This call is implicity done recursively for possible child windows.
+ */
+ void SetCallHandlersOnInputDisabled( bool bCall );
+ /** get state of SetCallHandlersOnInputDisabled
+
+ @returns whether handlers are called regardless of input enabled state
+ */
+ bool IsCallHandlersOnInputDisabled() const;
+ /** A window is in modal mode if one of its children or subchildren
+ is a running modal window (a modal dialog)
+
+ @returns sal_True if a child or subchild is a running modal window
+ */
+ sal_Bool IsInModalMode() const;
+
+ /**
+ * Necessary for calc ref input handling from modal dialogs
+ */
+ bool IsInModalNonRefMode() const;
+
+ void SetActivateMode( sal_uInt16 nMode );
+ sal_uInt16 GetActivateMode() const;
+
+ void ToTop( sal_uInt16 nFlags = 0 );
+ void SetZOrder( Window* pRefWindow, sal_uInt16 nFlags );
+ void EnableAlwaysOnTop( sal_Bool bEnable = sal_True );
+ sal_Bool IsAlwaysOnTopEnabled() const;
+
+ virtual void setPosSizePixel( long nX, long nY,
+ long nWidth, long nHeight,
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+ virtual void SetPosPixel( const Point& rNewPos );
+ virtual Point GetPosPixel() const;
+ virtual void SetSizePixel( const Size& rNewSize );
+ virtual Size GetSizePixel() const;
+ virtual void SetPosSizePixel( const Point& rNewPos,
+ const Size& rNewSize );
+ virtual void SetOutputSizePixel( const Size& rNewSize );
+ sal_Bool IsDefaultPos() const;
+ sal_Bool IsDefaultSize() const;
+
+ // those conversion routines might deliver different results during UI mirroring
+ Point OutputToScreenPixel( const Point& rPos ) const;
+ Point ScreenToOutputPixel( const Point& rPos ) const;
+ // the normalized screen methods work independent from UI mirroring
+ Point OutputToNormalizedScreenPixel( const Point& rPos ) const;
+ Point NormalizedScreenToOutputPixel( const Point& rPos ) const;
+ Point OutputToAbsoluteScreenPixel( const Point& rPos ) const;
+ Point AbsoluteScreenToOutputPixel( const Point& rPos ) const;
+ Rectangle GetDesktopRectPixel() const;
+ // window extents including border and decoratrion
+ Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ // window extents of the client window, coordinates to be used in SetPosPixel
+ Rectangle GetClientWindowExtentsRelative( Window *pRelativeWindow ) const;
+
+ virtual sal_Bool IsScrollable() const;
+ virtual void Scroll( long nHorzScroll, long nVertScroll,
+ sal_uInt16 nFlags = 0 );
+ virtual void Scroll( long nHorzScroll, long nVertScroll,
+ const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ virtual void Invalidate( sal_uInt16 nFlags = 0 );
+ virtual void Invalidate( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ virtual void Invalidate( const Region& rRegion, sal_uInt16 nFlags = 0 );
+ void Validate( sal_uInt16 nFlags = 0 );
+ sal_Bool HasPaintEvent() const;
+ void Update();
+ void Flush();
+ void Sync();
+
+ // toggles new docking support, enabled via toolkit
+ void EnableDocking( sal_Bool bEnable = sal_True );
+ // retrieves the single dockingmanager instance
+ static DockingManager* GetDockingManager();
+
+ void EnablePaint( sal_Bool bEnable );
+ sal_Bool IsPaintEnabled() const;
+ void SetUpdateMode( sal_Bool bUpdate );
+ sal_Bool IsUpdateMode() const;
+ void SetParentUpdateMode( sal_Bool bUpdate );
+
+ void GrabFocus();
+ sal_Bool HasFocus() const;
+ sal_Bool HasChildPathFocus( sal_Bool bSystemWindow = sal_False ) const;
+ sal_Bool IsActive() const;
+ sal_Bool HasActiveChildFrame();
+ sal_uInt16 GetGetFocusFlags() const;
+ void GrabFocusToDocument();
+
+ /**
+ * Set this when you need to act as if the window has focus even if it
+ * doesn't. This is necessary for implementing tab stops inside floating
+ * windows, but floating windows don't get focus from the system.
+ */
+ void SetFakeFocus( bool bFocus );
+
+ sal_Bool IsCompoundControl() const;
+
+ static sal_uIntPtr SaveFocus();
+ static sal_Bool EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore = sal_True );
+
+ void CaptureMouse();
+ void ReleaseMouse();
+ sal_Bool IsMouseCaptured() const;
+
+ void SetPointer( const Pointer& rPointer );
+ const Pointer& GetPointer() const;
+ void EnableChildPointerOverwrite( sal_Bool bOverwrite = sal_True );
+ void SetPointerPosPixel( const Point& rPos );
+ Point GetPointerPosPixel();
+ Point GetLastPointerPosPixel();
+ void ShowPointer( sal_Bool bVisible );
+ void EnterWait();
+ void LeaveWait();
+ sal_Bool IsWait() const;
+
+ void SetCursor( Cursor* pCursor );
+ Cursor* GetCursor() const;
+
+ void SetZoom( const Fraction& rZoom );
+ const Fraction& GetZoom() const;
+ sal_Bool IsZoom() const;
+ long CalcZoom( long n ) const;
+
+ virtual void SetText( const OUString& rStr );
+ virtual OUString GetText() const;
+ // return the actual text displayed
+ // this may have e.g. accellerators removed or portions
+ // replaced by ellipsis
+ virtual OUString GetDisplayText() const;
+ // gets the visible background color. for transparent windows
+ // this may be the parent's background color; for controls
+ // this may be a child's background color (e.g. ListBox)
+ virtual const Wallpaper& GetDisplayBackground() const;
+
+ void SetHelpText( const XubString& rHelpText );
+ const XubString& GetHelpText() const;
+
+ void SetQuickHelpText( const XubString& rHelpText );
+ const XubString& GetQuickHelpText() const;
+
+ void SetHelpId( const OString& );
+ const OString& GetHelpId() const;
+
+ void SetUniqueId( const OString& );
+ const OString& GetUniqueId() const;
+
+ Window* FindWindow( const Point& rPos ) const;
+
+ sal_uInt16 GetChildCount() const;
+ Window* GetChild( sal_uInt16 nChild ) const;
+ Window* GetWindow( sal_uInt16 nType ) const;
+ sal_Bool IsChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
+ sal_Bool IsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
+
+ void SetData( void* pNewData );
+ void* GetData() const;
+
+ void ShowFocus( const Rectangle& rRect );
+ void HideFocus();
+
+ void Invert( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ void Invert( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
+
+ // transparent background for selected or checked items in toolboxes etc.
+ void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly );
+ // the same, but fills a passed Color with a text color complementing the selection background
+ void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, Color* pSelectionTextColor );
+ // support rounded edges in the selection rect
+ void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, long nCornerRadius, Color* pSelectionTextColor, Color* pPaintColor );
+
+ void ShowTracking( const Rectangle& rRect,
+ sal_uInt16 nFlags = SHOWTRACK_SMALL );
+ void HideTracking();
+ void InvertTracking( const Rectangle& rRect,
+ sal_uInt16 nFlags = SHOWTRACK_SMALL );
+ void InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
+
+ void StartTracking( sal_uInt16 nFlags = 0 );
+ void EndTracking( sal_uInt16 nFlags = 0 );
+ sal_Bool IsTracking() const;
+
+ void StartAutoScroll( sal_uInt16 nFlags );
+ void EndAutoScroll();
+
+ sal_Bool HandleScrollCommand( const CommandEvent& rCmd,
+ ScrollBar* pHScrl = NULL,
+ ScrollBar* pVScrl = NULL );
+
+ void SaveBackground( const Point& rPos, const Size& rSize,
+ const Point& rDestOff, VirtualDevice& rSaveDevice );
+
+ const SystemEnvData* GetSystemData() const;
+ ::com::sun::star::uno::Any GetSystemDataAny() const;
+
+ // API to set/query the component interfaces
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > GetComponentInterface( sal_Bool bCreate = sal_True );
+ virtual void SetComponentInterface( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xIFace );
+
+ // Accessibility
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+ void SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > );
+
+ Window* GetAccessibleParentWindow() const;
+ sal_uInt16 GetAccessibleChildWindowCount();
+ Window* GetAccessibleChildWindow( sal_uInt16 n );
+
+ void SetAccessibleRole( sal_uInt16 nRole );
+ sal_uInt16 GetAccessibleRole() const;
+
+ void SetAccessibleName( const String& rName );
+ String GetAccessibleName() const;
+
+ void SetAccessibleDescription( const String& rDescr );
+ String GetAccessibleDescription() const;
+
+ void SetAccessibleRelationLabeledBy( Window* pLabeledBy );
+ Window* GetAccessibleRelationLabeledBy() const;
+
+ void SetAccessibleRelationLabelFor( Window* pLabelFor );
+ Window* GetAccessibleRelationLabelFor() const;
+
+ void SetAccessibleRelationMemberOf( Window* pMemberOf );
+ Window* GetAccessibleRelationMemberOf() const;
+
+
+ // to avoid sending accessibility events in cases like closing dialogs
+ // by default checks complete parent path
+ sal_Bool IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath = sal_True );
+ void SetAccessibilityEventsSuppressed(sal_Bool bSuppressed);
+
+ /// request XCanvas render interface for this window
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XCanvas > GetCanvas() const;
+ /// request XSpriteCanvas render interface for this window
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XSpriteCanvas > GetSpriteCanvas() const;
+
+ /* records all DrawText operations within the passed rectangle;
+ * a synchronous paint is sent to achieve this
+ */
+ void RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect );
+
+ // set and retrieve for Toolkit
+ VCLXWindow* GetWindowPeer() const;
+ void SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer, VCLXWindow* pVCLXWindow );
+
+ // remember if it was generated by Toolkit
+ sal_Bool IsCreatedWithToolkit() const;
+ void SetCreatedWithToolkit( sal_Bool b );
+
+ // Deprecated - can use SetAccessibleRelationLabelFor/By nowadys
+ virtual Window* GetParentLabelFor( const Window* pLabel ) const;
+ virtual Window* GetParentLabeledBy( const Window* pLabeled ) const;
+ KeyEvent GetActivationKey() const;
+
+ // Drag and Drop interfaces
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > GetDropTarget();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > GetDragSource();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > GetDragGestureRecognizer();
+
+ // Clipboard/Selection interfaces
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetClipboard();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetPrimarySelection();
+
+ /*
+ * Advisory Sizing - what is a good size for this widget
+ *
+ * Retrieves the preferred size of a widget ignoring
+ * "width-request" and "height-request" properties.
+ *
+ * Implement this in sub-classes to tell layout
+ * the preferred widget size.
+ */
+ virtual Size GetOptimalSize() const;
+
+ /*
+ * Widgets call this to inform their owner container that the widget wants
+ * to renegotiate its size. Should be called when a widget has a new size
+ * request. e.g. a FixedText Control gets a new label.
+ *
+ * akin to gtk_widget_queue_resize
+ */
+ void queue_resize();
+
+ /*
+ * Sets the "width-request" property
+ *
+ * Override for width request of the widget, or -1 if natural request
+ * should be used.
+ *
+ * @see get_preferred_size, set_width_request
+ */
+ void set_height_request(sal_Int32 nHeightRequest);
+ sal_Int32 get_height_request() const;
+
+ /*
+ * Sets the "height-request" property
+ *
+ * Override for height request of the widget, or -1 if natural request
+ * should be used.
+ *
+ * @see get_preferred_size, set_height_request
+ */
+ void set_width_request(sal_Int32 nWidthRequest);
+ sal_Int32 get_width_request() const;
+
+ /*
+ * Retrieves the preferred size of a widget taking
+ * into account the "width-request" and "height-request" properties.
+ *
+ * Overrides the result of GetOptimalSize to honor the
+ * width-request and height-request properties.
+ *
+ * @see GetOptimalSize
+ *
+ * akin to gtk_widget_get_preferred_size
+ */
+ Size get_preferred_size() const;
+
+ /*
+ * How to horizontally align this widget
+ */
+ VclAlign get_halign() const;
+ void set_halign(VclAlign eAlign);
+
+ /*
+ * How to vertically align this widget
+ */
+ VclAlign get_valign() const;
+ void set_valign(VclAlign eAlign);
+
+ /*
+ * Whether the widget would like to use any available extra horizontal
+ * space.
+ */
+ bool get_hexpand() const;
+ void set_hexpand(bool bExpand);
+
+ /*
+ * Whether the widget would like to use any available extra vertical
+ * space.
+ */
+ bool get_vexpand() const;
+ void set_vexpand(bool bExpand);
+
+ /*
+ * Whether the widget would like to use any available extra space.
+ */
+ bool get_expand() const;
+ void set_expand(bool bExpand);
+
+ /*
+ * Whether the widget should receive extra space when the parent grows
+ */
+ bool get_fill() const;
+ void set_fill(bool bFill);
+
+ void set_border_width(sal_Int32 nBorderWidth);
+ sal_Int32 get_border_width() const;
+
+ void set_margin_left(sal_Int32 nWidth);
+ sal_Int32 get_margin_left() const;
+
+ void set_margin_right(sal_Int32 nWidth);
+ sal_Int32 get_margin_right() const;
+
+ void set_margin_top(sal_Int32 nWidth);
+ sal_Int32 get_margin_top() const;
+
+ void set_margin_bottom(sal_Int32 nWidth);
+ sal_Int32 get_margin_bottom() const;
+
+ /*
+ * How the widget is packed with reference to the start or end of the parent
+ */
+ VclPackType get_pack_type() const;
+ void set_pack_type(VclPackType ePackType);
+
+ /*
+ * The extra space to put between the widget and its neighbors
+ */
+ sal_Int32 get_padding() const;
+ void set_padding(sal_Int32 nPadding);
+
+ /*
+ * The number of columns that the widget spans
+ */
+ sal_Int32 get_grid_width() const;
+ void set_grid_width(sal_Int32 nCols);
+
+ /*
+ * The column number to attach the left side of the widget to
+ */
+ sal_Int32 get_grid_left_attach() const;
+ void set_grid_left_attach(sal_Int32 nAttach);
+
+ /*
+ * The number of row that the widget spans
+ */
+ sal_Int32 get_grid_height() const;
+ void set_grid_height(sal_Int32 nRows);
+
+ /*
+ * The row number to attach the top side of the widget to
+ */
+ sal_Int32 get_grid_top_attach() const;
+ void set_grid_top_attach(sal_Int32 nAttach);
+
+ /*
+ * If true this child appears in a secondary layout group of children
+ * e.g. help buttons in a buttonbox
+ */
+ bool get_secondary() const;
+ void set_secondary(bool bSecondary);
+
+ /*
+ * Sets a widget property
+ *
+ * @return false if property is unknown
+ */
+ virtual bool set_property(const OString &rKey, const OString &rValue);
+
+ /*
+ * Sets a font attribute
+ *
+ * @return false if attribute is unknown
+ */
+ bool set_font_attribute(const OString &rKey, const OString &rValue);
+
+ /*
+ * Adds this widget to the xGroup VclSizeGroup
+ *
+ */
+ void add_to_size_group(boost::shared_ptr< VclSizeGroup > xGroup);
+ void remove_from_all_size_groups();
+
+ /*
+ * add/remove mnemonic label
+ */
+ void add_mnemonic_label(FixedText *pLabel);
+ void remove_mnemonic_label(FixedText *pLabel);
+ std::vector<FixedText*> list_mnemonic_labels() const;
+
+ /*
+ * Move this widget to be the nNewPosition'd child of its parent
+ */
+ void reorderWithinParent(sal_uInt16 nNewPosition);
+
+ //-------------------------------------
+ // Native Widget Rendering functions
+ //-------------------------------------
+
+ // form controls must never use native widgets, this can be toggled here
+ void EnableNativeWidget( sal_Bool bEnable = sal_True );
+ sal_Bool IsNativeWidgetEnabled() const;
+
+ // a helper method for a Control's Draw method
+ void PaintToDevice( OutputDevice* pDevice, const Point& rPos, const Size& rSize );
+
+ /* mark Window for deletion in top of event queue
+ */
+ void doLazyDelete();
+
+ //-------------------------------------
+ // Keyboard access functions
+ //-------------------------------------
+
+ /** Query the states of keyboard indicators - Caps Lock, Num Lock and
+ Scroll Lock. Use the following mask to retrieve the state of each
+ indicator:
+
+ INDICATOR_CAPS_LOCK
+ INDICATOR_NUM_LOCK
+ INDICATOR_SCROLL_LOCK
+ */
+ sal_uInt16 GetIndicatorState() const;
+
+ void SimulateKeyPress( sal_uInt16 nKeyCode ) const;
+
+ virtual OUString GetSurroundingText() const;
+ virtual Selection GetSurroundingTextSelection() const;
+};
+
+
+#endif // _SV_WINDOW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/wmf.hxx b/include/vcl/wmf.hxx
new file mode 100644
index 000000000000..ed0b5e27fd50
--- /dev/null
+++ b/include/vcl/wmf.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 _WMF_HXX
+#define _WMF_HXX
+
+#include <vcl/dllapi.h>
+
+class FilterConfigItem;
+class GDIMetaFile;
+class SvStream;
+
+struct WMF_EXTERNALHEADER
+{
+ sal_uInt16 xExt;
+ sal_uInt16 yExt;
+
+ /** One of the following values:
+ <ul>
+ <li>MM_TEXT</li>
+ <li>MM_LOMETRIC</li>
+ <li>MM_HIMETRIC</li>
+ <li>MM_LOENGLISH</li>
+ <li>MM_HIENGLISH</li>
+ <li>MM_TWIPS</li>
+ <li>MM_ISOTROPIC</li>
+ <li>MM_ANISOTROPIC</li>
+ </ul>
+ If this value is 0, then no external mapmode has been defined,
+ the internal one should then be used.
+ */
+ sal_uInt16 mapMode;
+
+ WMF_EXTERNALHEADER() :
+ xExt( 0 ),
+ yExt( 0 ),
+ mapMode( 0 )
+ {
+ }
+};
+
+sal_Bool ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem = NULL, WMF_EXTERNALHEADER *pExtHeader = NULL );
+
+VCL_DLLPUBLIC sal_Bool ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pConfigItem );
+
+VCL_DLLPUBLIC sal_Bool ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem = NULL, sal_Bool bPlaceable = sal_True );
+
+sal_Bool ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem = NULL );
+
+VCL_DLLPUBLIC sal_Bool WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/wrkwin.hxx b/include/vcl/wrkwin.hxx
new file mode 100644
index 000000000000..d151d1f12232
--- /dev/null
+++ b/include/vcl/wrkwin.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 _SV_WRKWIN_HXX
+#define _SV_WRKWIN_HXX
+
+#include <tools/solar.h>
+#include <vcl/dllapi.h>
+#include <vcl/syswin.hxx>
+
+namespace com { namespace sun { namespace star { namespace uno { class Any; }}}}
+struct SystemParentData;
+
+// ----------------------
+// - WorkWindow - Types -
+// ----------------------
+
+// Presentation Flags
+#define PRESENTATION_HIDEALLAPPS ((sal_uInt16)0x0001)
+#define PRESENTATION_NOFULLSCREEN ((sal_uInt16)0x0002)
+#define PRESENTATION_NOAUTOSHOW ((sal_uInt16)0x0004)
+
+// --------------
+// - WorkWindow -
+// --------------
+
+class VCL_DLLPUBLIC WorkWindow : public SystemWindow
+{
+private:
+ sal_uInt16 mnPresentationFlags;
+ sal_Bool mbPresentationMode:1,
+ mbPresentationVisible:1,
+ mbPresentationFull:1,
+ mbFullScreenMode:1;
+
+ SAL_DLLPRIVATE void ImplInitWorkWindowData();
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle, const ::com::sun::star::uno::Any& aSystemWorkWindowToken );
+
+private:
+ SAL_DLLPRIVATE WorkWindow( const WorkWindow& rWin );
+ SAL_DLLPRIVATE WorkWindow& operator =( const WorkWindow& rWin );
+
+protected:
+ WorkWindow( WindowType nType );
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData = NULL );
+ SAL_DLLPRIVATE void ImplSetFrameState( sal_uLong aFrameState );
+
+public:
+ WorkWindow( Window* pParent, WinBits nStyle = WB_STDWORK );
+ WorkWindow( Window* pParent, const ::com::sun::star::uno::Any& aSystemWorkWindowToken, WinBits nStyle = WB_STDWORK );
+ WorkWindow( SystemParentData* pParent ); // Not in the REMOTE-Version
+ ~WorkWindow();
+
+ virtual sal_Bool Close();
+
+ void ShowFullScreenMode( sal_Bool bFullScreenMode,
+ sal_Int32 nDisplayScreen );
+ /**
+ @overload Calls ShowFullScreenMode( bFullScreenMode, GetScreenNumber()).
+ */
+ void ShowFullScreenMode( sal_Bool bFullScreenMode = sal_True );
+ void EndFullScreenMode() { ShowFullScreenMode( sal_False ); }
+ sal_Bool IsFullScreenMode() const { return mbFullScreenMode; }
+
+ void StartPresentationMode( sal_Bool bPresentation,
+ sal_uInt16 nFlags,
+ sal_Int32 nDisplayScreen );
+ /**
+ @overload Calls StartPresentationMode( bFullScreenMode, nFlags, GetScreenNumber()).
+ */
+ void StartPresentationMode( sal_Bool bPresentation = sal_True,
+ sal_uInt16 nFlags = 0 );
+ void EndPresentationMode() { StartPresentationMode( sal_False ); }
+ sal_Bool IsPresentationMode() const { return mbPresentationMode; }
+
+ sal_Bool IsMinimized() const;
+
+ sal_Bool SetPluginParent( SystemParentData* pParent );
+
+ void Minimize();
+ void Restore();
+
+ void Maximize( sal_Bool bMaximize = sal_True );
+ sal_Bool IsMaximized() const;
+};
+
+#endif // _SV_WRKWIN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/xtextedt.hxx b/include/vcl/xtextedt.hxx
new file mode 100644
index 000000000000..b763e37102c7
--- /dev/null
+++ b/include/vcl/xtextedt.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 _XTEXTEDT_HXX
+#define _XTEXTEDT_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/texteng.hxx>
+#include <vcl/textview.hxx>
+
+namespace com {
+namespace sun {
+namespace star {
+namespace util {
+ struct SearchOptions;
+}}}}
+
+class VCL_DLLPUBLIC ExtTextEngine : public TextEngine
+{
+private:
+ String maGroupChars;
+
+public:
+ ExtTextEngine();
+ ~ExtTextEngine();
+
+ const String& GetGroupChars() const { return maGroupChars; }
+ void SetGroupChars( const String& r ) { maGroupChars = r; }
+ TextSelection MatchGroup( const TextPaM& rCursor ) const;
+
+ sal_Bool Search( TextSelection& rSel, const ::com::sun::star::util::SearchOptions& rSearchOptions, sal_Bool bForward = sal_True );
+};
+
+class VCL_DLLPUBLIC ExtTextView : public TextView
+{
+protected:
+ sal_Bool ImpIndentBlock( sal_Bool bRight );
+
+public:
+ ExtTextView( ExtTextEngine* pEng, Window* pWindow );
+ ~ExtTextView();
+
+ sal_Bool MatchGroup();
+
+ sal_Bool Search( const ::com::sun::star::util::SearchOptions& rSearchOptions, sal_Bool bForward );
+ sal_uInt16 Replace( const ::com::sun::star::util::SearchOptions& rSearchOptions, sal_Bool bAll, sal_Bool bForward );
+
+ sal_Bool IndentBlock();
+ sal_Bool UnindentBlock();
+};
+
+#endif // _XTEXTEDT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/DashStyle.hxx b/include/xmloff/DashStyle.hxx
new file mode 100644
index 000000000000..576414bb7135
--- /dev/null
+++ b/include/xmloff/DashStyle.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 _XMLOFF_DASHSTYLE_HXX
+#define _XMLOFF_DASHSTYLE_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <sal/types.h>
+
+class SvXMLImport;
+class SvXMLExport;
+namespace com { namespace sun { namespace star {
+ namespace uno { template<class A> class Reference; }
+ namespace xml { namespace sax { class XAttributeList; } }
+ namespace uno { class Any; }
+} } }
+
+
+class XMLOFF_DLLPUBLIC XMLDashStyleImport
+{
+ SvXMLImport& rImport;
+
+public:
+ XMLDashStyleImport( SvXMLImport& rImport );
+ ~XMLDashStyleImport();
+
+ sal_Bool importXML(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ ::com::sun::star::uno::Any& rValue,
+ OUString& rStrName );
+};
+
+
+class XMLOFF_DLLPUBLIC XMLDashStyleExport
+{
+ SvXMLExport& rExport;
+
+public:
+ XMLDashStyleExport( SvXMLExport& rExport );
+ ~XMLDashStyleExport();
+
+ sal_Bool exportXML( const OUString& rStrName,
+ const ::com::sun::star::uno::Any& rValue );
+};
+
+#endif // _XMLOFF_DASHSTYLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/DocumentSettingsContext.hxx b/include/xmloff/DocumentSettingsContext.hxx
new file mode 100644
index 000000000000..a9277946ca9a
--- /dev/null
+++ b/include/xmloff/DocumentSettingsContext.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 _XMLOFF_DOCUMENTSETTINGSCONTEXT_HXX
+#define _XMLOFF_DOCUMENTSETTINGSCONTEXT_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+
+#include <memory>
+
+struct XMLDocumentSettingsContext_Data;
+
+class XMLOFF_DLLPUBLIC XMLDocumentSettingsContext : public SvXMLImportContext
+{
+ ::std::auto_ptr< XMLDocumentSettingsContext_Data > m_pData;
+
+public:
+ XMLDocumentSettingsContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
+ virtual ~XMLDocumentSettingsContext();
+
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
+ virtual void EndElement();
+
+private:
+ XMLDocumentSettingsContext(); // never implemented
+ XMLDocumentSettingsContext( const XMLDocumentSettingsContext& ); // never implemented
+ XMLDocumentSettingsContext& operator=( const XMLDocumentSettingsContext& ); // never implemented
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/EnumPropertyHdl.hxx b/include/xmloff/EnumPropertyHdl.hxx
new file mode 100644
index 000000000000..f2ef26d4c974
--- /dev/null
+++ b/include/xmloff/EnumPropertyHdl.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 _XMLOFF_ENUMPROPERTYHANDLER_HXX
+#define _XMLOFF_ENUMPROPERTYHANDLER_HXX
+
+#include <xmloff/xmlprhdl.hxx>
+#include <com/sun/star/uno/Type.h>
+#include <xmloff/xmlement.hxx>
+
+/**
+ PropertyHandler for a generic xml enumeration type:
+*/
+class XMLOFF_DLLPUBLIC XMLEnumPropertyHdl : public XMLPropertyHandler
+{
+private:
+ const SvXMLEnumMapEntry* mpEnumMap;
+ const ::com::sun::star::uno::Type & mrType;
+
+public:
+ XMLEnumPropertyHdl( const SvXMLEnumMapEntry* pEnumMap, const ::com::sun::star::uno::Type & rType ) : mpEnumMap( pEnumMap ), mrType( rType ) {}
+ virtual ~XMLEnumPropertyHdl();
+
+ virtual sal_Bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
+ virtual sal_Bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
+};
+
+#endif // _XMLOFF_ENUMPROPERTYHANDLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/GradientStyle.hxx b/include/xmloff/GradientStyle.hxx
new file mode 100644
index 000000000000..145ba554505d
--- /dev/null
+++ b/include/xmloff/GradientStyle.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 _XMLOFF_GRADIENTSTYLE_HXX
+#define _XMLOFF_GRADIENTSTYLE_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+
+class SvXMLImport;
+class SvXMLExport;
+namespace com { namespace sun { namespace star {
+ namespace uno { template<class A> class Reference; }
+ namespace xml { namespace sax { class XAttributeList; } }
+ namespace uno { class Any; }
+} } }
+
+
+class XMLOFF_DLLPUBLIC XMLGradientStyleImport
+{
+ SvXMLImport& rImport;
+
+public:
+ XMLGradientStyleImport( SvXMLImport& rImport );
+ ~XMLGradientStyleImport();
+
+ sal_Bool importXML(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ ::com::sun::star::uno::Any& rValue,
+ OUString& rStrName );
+};
+
+
+class XMLOFF_DLLPUBLIC XMLGradientStyleExport
+{
+ SvXMLExport& rExport;
+
+public:
+ XMLGradientStyleExport( SvXMLExport& rExport );
+ ~XMLGradientStyleExport();
+
+ sal_Bool exportXML(
+ const OUString& rStrName,
+ const ::com::sun::star::uno::Any& rValue );
+};
+
+#endif // _XMLOFF_GRADIENTSTYLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/HatchStyle.hxx b/include/xmloff/HatchStyle.hxx
new file mode 100644
index 000000000000..6cdceb618f10
--- /dev/null
+++ b/include/xmloff/HatchStyle.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 _XMLOFF_HATCHSTYLE_HXX
+#define _XMLOFF_HATCHSTYLE_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+
+class SvXMLImport;
+class SvXMLExport;
+namespace com { namespace sun { namespace star {
+ namespace uno { template<class A> class Reference; }
+ namespace xml { namespace sax { class XAttributeList; } }
+ namespace uno { class Any; }
+} } }
+
+
+class XMLOFF_DLLPUBLIC XMLHatchStyleImport
+{
+ SvXMLImport& rImport;
+
+public:
+ XMLHatchStyleImport( SvXMLImport& rImport );
+ ~XMLHatchStyleImport();
+
+ sal_Bool importXML(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ ::com::sun::star::uno::Any& rValue,
+ OUString& rStrName );
+};
+
+class XMLOFF_DLLPUBLIC XMLHatchStyleExport
+{
+ SvXMLExport& rExport;
+
+public:
+ XMLHatchStyleExport( SvXMLExport& rExport );
+ ~XMLHatchStyleExport();
+
+ sal_Bool exportXML( const OUString& rStrName, const ::com::sun::star::uno::Any& rValue );
+};
+
+#endif // _XMLOFF_HATCHELEMENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/ImageStyle.hxx b/include/xmloff/ImageStyle.hxx
new file mode 100644
index 000000000000..5c0dfd6ff820
--- /dev/null
+++ b/include/xmloff/ImageStyle.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 _XMLOFF_IMAGESTYLE_HXX
+#define _XMLOFF_IMAGESTYLE_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+
+class SvXMLNamespaceMap;
+class SvXMLAttributeList;
+class SvXMLUnitConverter;
+class SvXMLExport;
+class SvXMLImport;
+
+class XMLOFF_DLLPUBLIC XMLImageStyle
+{
+public:
+ XMLImageStyle();
+ ~XMLImageStyle();
+
+ sal_Bool exportXML( const OUString& rStrName, const ::com::sun::star::uno::Any& rValue, SvXMLExport& rExport );
+ sal_Bool importXML( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList, ::com::sun::star::uno::Any& rValue, OUString& rStrName, SvXMLImport& rImport );
+
+private:
+
+ SAL_DLLPRIVATE sal_Bool ImpExportXML( const OUString& rStrName, const ::com::sun::star::uno::Any& rValue,
+ SvXMLExport& rExport );
+ SAL_DLLPRIVATE sal_Bool ImpImportXML( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ ::com::sun::star::uno::Any& rValue, OUString& rStrName,
+ SvXMLImport& rImport );
+};
+
+#endif // _XMLOFF_IMAGESTYLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/MarkerStyle.hxx b/include/xmloff/MarkerStyle.hxx
new file mode 100644
index 000000000000..5cff7cb23745
--- /dev/null
+++ b/include/xmloff/MarkerStyle.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 _XMLOFF_MARKERSTYLE_HXX
+#define _XMLOFF_MARKERSTYLE_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+
+class SvXMLImport;
+class SvXMLExport;
+namespace com { namespace sun { namespace star {
+ namespace uno { template<class A> class Reference; }
+ namespace xml { namespace sax { class XAttributeList; } }
+ namespace uno { class Any; }
+} } }
+
+
+class XMLOFF_DLLPUBLIC XMLMarkerStyleImport
+{
+ SvXMLImport& rImport;
+
+public:
+ XMLMarkerStyleImport( SvXMLImport& rImport );
+ ~XMLMarkerStyleImport();
+
+ sal_Bool importXML(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ ::com::sun::star::uno::Any& rValue,
+ OUString& rStrName );
+};
+
+class XMLOFF_DLLPUBLIC XMLMarkerStyleExport
+{
+ SvXMLExport& rExport;
+
+public:
+ XMLMarkerStyleExport( SvXMLExport& rExport );
+ ~XMLMarkerStyleExport();
+
+ sal_Bool exportXML(
+ const OUString& rStrName,
+ const ::com::sun::star::uno::Any& rValue );
+};
+
+#endif // _XMLOFF_MARKERSTYLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/NamedBoolPropertyHdl.hxx b/include/xmloff/NamedBoolPropertyHdl.hxx
new file mode 100644
index 000000000000..e6dc49c20fff
--- /dev/null
+++ b/include/xmloff/NamedBoolPropertyHdl.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 _XMLOFF_NAMEDBOOLPROPERTYHANDLER_HXX
+#define _XMLOFF_NAMEDBOOLPROPERTYHANDLER_HXX
+
+#include <xmloff/xmlprhdl.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <com/sun/star/uno/Type.h>
+#include <xmloff/xmlement.hxx>
+
+/**
+ PropertyHandler for a named xml bool type:
+*/
+class XMLNamedBoolPropertyHdl : public XMLPropertyHandler
+{
+private:
+ const OUString maTrueStr;
+ const OUString maFalseStr;
+
+public:
+ XMLNamedBoolPropertyHdl( const OUString& rTrueStr, const OUString& rFalseStr ) : maTrueStr( rTrueStr ), maFalseStr( rFalseStr ) {}
+
+ XMLNamedBoolPropertyHdl(
+ ::xmloff::token::XMLTokenEnum eTrue,
+ ::xmloff::token::XMLTokenEnum eFalse
+ ) :
+ maTrueStr( ::xmloff::token::GetXMLToken( eTrue ) ),
+ maFalseStr( ::xmloff::token::GetXMLToken( eFalse ) )
+ {}
+
+ virtual ~XMLNamedBoolPropertyHdl();
+
+ virtual sal_Bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
+ virtual sal_Bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
+};
+
+#endif // _XMLOFF_NAMEDBOOLPROPERTYHANDLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/PageMasterStyleMap.hxx b/include/xmloff/PageMasterStyleMap.hxx
new file mode 100644
index 000000000000..c3a83922ec14
--- /dev/null
+++ b/include/xmloff/PageMasterStyleMap.hxx
@@ -0,0 +1,168 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX_
+#define _XMLOFF_PAGEMASTERSTYLEMAP_HXX_
+
+#include <xmloff/maptype.hxx>
+#include <xmloff/xmltypes.hxx>
+#include <xmloff/contextid.hxx>
+
+//______________________________________________________________________________
+
+#define XML_PM_TYPE_PAGESTYLELAYOUT (XML_PM_TYPES_START + 0)
+#define XML_PM_TYPE_NUMFORMAT (XML_PM_TYPES_START + 1)
+#define XML_PM_TYPE_NUMLETTERSYNC (XML_PM_TYPES_START + 2)
+#define XML_PM_TYPE_PAPERTRAYNUMBER (XML_PM_TYPES_START + 3)
+#define XML_PM_TYPE_PRINTORIENTATION (XML_PM_TYPES_START + 4)
+#define XML_PM_TYPE_PRINTANNOTATIONS (XML_PM_TYPES_START + 5)
+#define XML_PM_TYPE_PRINTCHARTS (XML_PM_TYPES_START + 6)
+#define XML_PM_TYPE_PRINTDRAWING (XML_PM_TYPES_START + 7)
+#define XML_PM_TYPE_PRINTFORMULAS (XML_PM_TYPES_START + 8)
+#define XML_PM_TYPE_PRINTGRID (XML_PM_TYPES_START + 9)
+#define XML_PM_TYPE_PRINTHEADERS (XML_PM_TYPES_START + 10)
+#define XML_PM_TYPE_PRINTOBJECTS (XML_PM_TYPES_START + 11)
+#define XML_PM_TYPE_PRINTZEROVALUES (XML_PM_TYPES_START + 12)
+#define XML_PM_TYPE_PRINTPAGEORDER (XML_PM_TYPES_START + 13)
+#define XML_PM_TYPE_FIRSTPAGENUMBER (XML_PM_TYPES_START + 14)
+#define XML_PM_TYPE_CENTER_HORIZONTAL (XML_PM_TYPES_START + 15)
+#define XML_PM_TYPE_CENTER_VERTICAL (XML_PM_TYPES_START + 16)
+
+// control flags
+#define CTF_PM_FLAGMASK (XML_PM_CTF_START + 0x0F00)
+#define CTF_PM_HEADERFLAG (XML_PM_CTF_START + 0x0100)
+#define CTF_PM_FOOTERFLAG (XML_PM_CTF_START + 0x0200)
+#define CTF_PM_PRINTMASK (XML_PM_CTF_START + 0x1000)
+// page master
+#define CTF_PM_BORDERALL (XML_PM_CTF_START + 0x0001)
+#define CTF_PM_BORDERTOP (XML_PM_CTF_START + 0x0002)
+#define CTF_PM_BORDERBOTTOM (XML_PM_CTF_START + 0x0003)
+#define CTF_PM_BORDERLEFT (XML_PM_CTF_START + 0x0004)
+#define CTF_PM_BORDERRIGHT (XML_PM_CTF_START + 0x0005)
+#define CTF_PM_BORDERWIDTHALL (XML_PM_CTF_START + 0x0006)
+#define CTF_PM_BORDERWIDTHTOP (XML_PM_CTF_START + 0x0007)
+#define CTF_PM_BORDERWIDTHBOTTOM (XML_PM_CTF_START + 0x0008)
+#define CTF_PM_BORDERWIDTHLEFT (XML_PM_CTF_START + 0x0009)
+#define CTF_PM_BORDERWIDTHRIGHT (XML_PM_CTF_START + 0x000A)
+#define CTF_PM_PADDINGALL (XML_PM_CTF_START + 0x000B)
+#define CTF_PM_PADDINGTOP (XML_PM_CTF_START + 0x000C)
+#define CTF_PM_PADDINGBOTTOM (XML_PM_CTF_START + 0x000D)
+#define CTF_PM_PADDINGLEFT (XML_PM_CTF_START + 0x000E)
+#define CTF_PM_PADDINGRIGHT (XML_PM_CTF_START + 0x000F)
+#define CTF_PM_TEXTCOLUMNS (XML_PM_CTF_START + 0x0010)
+#define CTF_PM_REGISTER_STYLE (XML_PM_CTF_START + 0x0011)
+#define CTF_PM_PRINT_ANNOTATIONS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0012))
+#define CTF_PM_PRINT_CHARTS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0013))
+#define CTF_PM_PRINT_DRAWING (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0014))
+#define CTF_PM_PRINT_FORMULAS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0015))
+#define CTF_PM_PRINT_GRID (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0016))
+#define CTF_PM_PRINT_HEADERS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0017))
+#define CTF_PM_PRINT_OBJECTS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0018))
+#define CTF_PM_PRINT_ZEROVALUES (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0019))
+#define CTF_PM_MARGINALL (XML_PM_CTF_START + 0x001A)
+#define CTF_PM_MARGINTOP (XML_PM_CTF_START + 0x001B)
+#define CTF_PM_MARGINBOTTOM (XML_PM_CTF_START + 0x001C)
+#define CTF_PM_MARGINLEFT (XML_PM_CTF_START + 0x001D)
+#define CTF_PM_MARGINRIGHT (XML_PM_CTF_START + 0x001E)
+
+#define CTF_PM_PAGEUSAGE (XML_PM_CTF_START + 0x0031)
+#define CTF_PM_GRAPHICPOSITION (XML_PM_CTF_START + 0x0032)
+#define CTF_PM_GRAPHICFILTER (XML_PM_CTF_START + 0x0033)
+#define CTF_PM_GRAPHICURL (XML_PM_CTF_START + 0x0034)
+
+#define CTF_PM_SCALETO (XML_PM_CTF_START + 0x0051) // calc specific
+#define CTF_PM_SCALETOPAGES (XML_PM_CTF_START + 0x0052)
+#define CTF_PM_SCALETOX (XML_PM_CTF_START + 0x0053)
+#define CTF_PM_SCALETOY (XML_PM_CTF_START + 0x0054)
+#define CTF_PM_STANDARD_MODE (XML_PM_CTF_START + 0x0055)
+#define CTP_PM_GRID_BASE_WIDTH (XML_PM_CTF_START + 0x0056)
+#define CTP_PM_GRID_SNAP_TO_CHARS (XML_PM_CTF_START + 0x0057)
+#define CTP_PM_GRID_SNAP_TO (XML_PM_CTF_START + 0x0058)
+// header
+#define CTF_PM_HEADERBORDERALL (CTF_PM_HEADERFLAG|CTF_PM_BORDERALL)
+#define CTF_PM_HEADERBORDERTOP (CTF_PM_HEADERFLAG|CTF_PM_BORDERTOP)
+#define CTF_PM_HEADERBORDERBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_BORDERBOTTOM)
+#define CTF_PM_HEADERBORDERLEFT (CTF_PM_HEADERFLAG|CTF_PM_BORDERLEFT)
+#define CTF_PM_HEADERBORDERRIGHT (CTF_PM_HEADERFLAG|CTF_PM_BORDERRIGHT)
+#define CTF_PM_HEADERBORDERWIDTHALL (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHALL)
+#define CTF_PM_HEADERBORDERWIDTHTOP (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHTOP)
+#define CTF_PM_HEADERBORDERWIDTHBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHBOTTOM)
+#define CTF_PM_HEADERBORDERWIDTHLEFT (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHLEFT)
+#define CTF_PM_HEADERBORDERWIDTHRIGHT (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHRIGHT)
+#define CTF_PM_HEADERPADDINGALL (CTF_PM_HEADERFLAG|CTF_PM_PADDINGALL)
+#define CTF_PM_HEADERPADDINGTOP (CTF_PM_HEADERFLAG|CTF_PM_PADDINGTOP)
+#define CTF_PM_HEADERPADDINGBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_PADDINGBOTTOM)
+#define CTF_PM_HEADERPADDINGLEFT (CTF_PM_HEADERFLAG|CTF_PM_PADDINGLEFT)
+#define CTF_PM_HEADERPADDINGRIGHT (CTF_PM_HEADERFLAG|CTF_PM_PADDINGRIGHT)
+#define CTF_PM_HEADERHEIGHT (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0031))
+#define CTF_PM_HEADERMINHEIGHT (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0032))
+#define CTF_PM_HEADERDYNAMIC (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0033))
+#define CTF_PM_HEADERGRAPHICPOSITION (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0034))
+#define CTF_PM_HEADERGRAPHICFILTER (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0035))
+#define CTF_PM_HEADERGRAPHICURL (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0036))
+#define CTF_PM_HEADERMARGINALL (CTF_PM_HEADERFLAG|CTF_PM_MARGINALL)
+#define CTF_PM_HEADERMARGINTOP (CTF_PM_HEADERFLAG|CTF_PM_MARGINTOP)
+#define CTF_PM_HEADERMARGINBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_MARGINBOTTOM)
+#define CTF_PM_HEADERMARGINLEFT (CTF_PM_HEADERFLAG|CTF_PM_MARGINLEFT)
+#define CTF_PM_HEADERMARGINRIGHT (CTF_PM_HEADERFLAG|CTF_PM_MARGINRIGHT)
+
+// footer
+#define CTF_PM_FOOTERBORDERALL (CTF_PM_FOOTERFLAG|CTF_PM_BORDERALL)
+#define CTF_PM_FOOTERBORDERTOP (CTF_PM_FOOTERFLAG|CTF_PM_BORDERTOP)
+#define CTF_PM_FOOTERBORDERBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_BORDERBOTTOM)
+#define CTF_PM_FOOTERBORDERLEFT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERLEFT)
+#define CTF_PM_FOOTERBORDERRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERRIGHT)
+#define CTF_PM_FOOTERBORDERWIDTHALL (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHALL)
+#define CTF_PM_FOOTERBORDERWIDTHTOP (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHTOP)
+#define CTF_PM_FOOTERBORDERWIDTHBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHBOTTOM)
+#define CTF_PM_FOOTERBORDERWIDTHLEFT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHLEFT)
+#define CTF_PM_FOOTERBORDERWIDTHRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHRIGHT)
+#define CTF_PM_FOOTERPADDINGALL (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGALL)
+#define CTF_PM_FOOTERPADDINGTOP (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGTOP)
+#define CTF_PM_FOOTERPADDINGBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGBOTTOM)
+#define CTF_PM_FOOTERPADDINGLEFT (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGLEFT)
+#define CTF_PM_FOOTERPADDINGRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGRIGHT)
+#define CTF_PM_FOOTERHEIGHT (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0031))
+#define CTF_PM_FOOTERMINHEIGHT (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0032))
+#define CTF_PM_FOOTERDYNAMIC (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0033))
+#define CTF_PM_FOOTERGRAPHICPOSITION (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0034))
+#define CTF_PM_FOOTERGRAPHICFILTER (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0035))
+#define CTF_PM_FOOTERGRAPHICURL (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0036))
+#define CTF_PM_FOOTERMARGINALL (CTF_PM_FOOTERFLAG|CTF_PM_MARGINALL)
+#define CTF_PM_FOOTERMARGINTOP (CTF_PM_FOOTERFLAG|CTF_PM_MARGINTOP)
+#define CTF_PM_FOOTERMARGINBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_MARGINBOTTOM)
+#define CTF_PM_FOOTERMARGINLEFT (CTF_PM_FOOTERFLAG|CTF_PM_MARGINLEFT)
+#define CTF_PM_FOOTERMARGINRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_MARGINRIGHT)
+
+#define CTF_PM_FTN_HEIGHT (XML_PM_CTF_START + 0x0060)
+#define CTF_PM_FTN_LINE_WEIGHT (XML_PM_CTF_START + 0x0061)
+#define CTF_PM_FTN_LINE_COLOR (XML_PM_CTF_START + 0x0062)
+#define CTF_PM_FTN_LINE_WIDTH (XML_PM_CTF_START + 0x0063)
+#define CTF_PM_FTN_LINE_ADJUST (XML_PM_CTF_START + 0x0064)
+#define CTF_PM_FTN_LINE_DISTANCE (XML_PM_CTF_START + 0x0065)
+#define CTF_PM_FTN_DISTANCE (XML_PM_CTF_START + 0x0066)
+#define CTF_PM_FTN_LINE_STYLE (XML_PM_CTF_START + 0x0067)
+
+extern const XMLPropertyMapEntry aXMLPageMasterStyleMap[];
+extern const XMLPropertyMapEntry aXMLPageMasterHeaderImportStyleMap[];
+extern const XMLPropertyMapEntry aXMLPageMasterFooterImportStyleMap[];
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/ProgressBarHelper.hxx b/include/xmloff/ProgressBarHelper.hxx
new file mode 100644
index 000000000000..e34e6a07919d
--- /dev/null
+++ b/include/xmloff/ProgressBarHelper.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 _XMLOFF_PROGRESSBARHELPER_HXX
+#define _XMLOFF_PROGRESSBARHELPER_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+
+#define XML_PROGRESSRANGE "ProgressRange"
+#define XML_PROGRESSMAX "ProgressMax"
+#define XML_PROGRESSCURRENT "ProgressCurrent"
+#define XML_PROGRESSREPEAT "ProgressRepeat"
+
+class XMLOFF_DLLPUBLIC ProgressBarHelper
+{
+ ::com::sun::star::uno::Reference < ::com::sun::star::task::XStatusIndicator > xStatusIndicator;
+ sal_Int32 nRange;
+ sal_Int32 nReference;
+ sal_Int32 nValue;
+ sal_Bool bStrict;
+ // #96469#; if the value goes over the Range the progressbar starts again
+ sal_Bool bRepeat;
+
+#ifdef DBG_UTIL
+ sal_Bool bFailure;
+#endif
+public:
+ ProgressBarHelper(const ::com::sun::star::uno::Reference < ::com::sun::star::task::XStatusIndicator>& xStatusIndicator,
+ const sal_Bool bStrict);
+ ~ProgressBarHelper();
+
+ void SetText(OUString& rText) { if (xStatusIndicator.is()) xStatusIndicator->setText(rText); }
+ void SetRange(sal_Int32 nVal) { nRange = nVal; }
+ void SetReference(sal_Int32 nVal) { nReference = nVal; }
+ void SetValue(sal_Int32 nValue);
+ void SetRepeat(sal_Bool bValue) { bRepeat = bValue; }
+ inline void Increment(sal_Int32 nInc = 1) { SetValue( nValue+nInc ); }
+ void End() { if (xStatusIndicator.is()) xStatusIndicator->end(); }
+
+ // set the new reference and returns the new value which gives the
+ // Progress Bar the sam position as before
+ sal_Int32 ChangeReference(sal_Int32 nNewReference);
+
+ sal_Int32 GetReference() { return nReference; }
+ sal_Int32 GetValue() { return nValue; }
+ sal_Bool GetRepeat() { return bRepeat; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/PropertySetInfoHash.hxx b/include/xmloff/PropertySetInfoHash.hxx
new file mode 100644
index 000000000000..8d9705b68afb
--- /dev/null
+++ b/include/xmloff/PropertySetInfoHash.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 _XMLOFF_PROPERTYSETINFOHASH_HXX
+#define _XMLOFF_PROPERTYSETINFOHASH_HXX
+
+#include <xmloff/PropertySetInfoKey.hxx>
+
+#include <string.h>
+#include <memory>
+
+struct PropertySetInfoHash
+{
+ inline size_t operator()( const PropertySetInfoKey& r ) const;
+ inline bool operator()( const PropertySetInfoKey& r1,
+ const PropertySetInfoKey& r2 ) const;
+};
+
+inline size_t PropertySetInfoHash::operator()(
+ const PropertySetInfoKey& r ) const
+{
+ const sal_Int32* pBytesAsInt32Array =
+ (const sal_Int32*)r.aImplementationId.getConstArray();
+ sal_Int32 nId32 = pBytesAsInt32Array[0] ^
+ pBytesAsInt32Array[1] ^
+ pBytesAsInt32Array[2] ^
+ pBytesAsInt32Array[3];
+ return (size_t)nId32 ^ (size_t)r.xPropInfo.get();
+}
+
+inline bool PropertySetInfoHash::operator()(
+ const PropertySetInfoKey& r1,
+ const PropertySetInfoKey& r2 ) const
+{
+ if( r1.xPropInfo != r2.xPropInfo )
+ return sal_False;
+
+ const sal_Int8* pId1 = r1.aImplementationId.getConstArray();
+ const sal_Int8* pId2 = r2.aImplementationId.getConstArray();
+ return memcmp( pId1, pId2, 16 * sizeof( sal_Int8 ) ) == 0;
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/PropertySetInfoKey.hxx b/include/xmloff/PropertySetInfoKey.hxx
new file mode 100644
index 000000000000..79e49d8568aa
--- /dev/null
+++ b/include/xmloff/PropertySetInfoKey.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 _XMLOFF_PROPERTYSETINFOKEY_HXX
+#define _XMLOFF_PROPERTYSETINFOKEY_HXX
+
+#include <osl/diagnose.h>
+#include <com/sun/star/uno/Sequence.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace beans { class XPropertySetInfo; }
+} } }
+
+
+struct PropertySetInfoKey
+{
+ ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySetInfo > xPropInfo;
+ ::com::sun::star::uno::Sequence < sal_Int8 > aImplementationId;
+
+ inline PropertySetInfoKey();
+ inline PropertySetInfoKey(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySetInfo >& rPropInfo,
+ const ::com::sun::star::uno::Sequence < sal_Int8 >& rImplId );
+};
+
+inline PropertySetInfoKey::PropertySetInfoKey()
+{
+ OSL_ENSURE( aImplementationId.getLength()==16, "illegal constructor call" );
+}
+
+inline PropertySetInfoKey::PropertySetInfoKey(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySetInfo >& rPropInfo,
+ const ::com::sun::star::uno::Sequence < sal_Int8 >& rImplId ) :
+ xPropInfo( rPropInfo ),
+ aImplementationId( rImplId )
+{
+ OSL_ENSURE( rPropInfo.is(), "prop info missing" );
+ OSL_ENSURE( aImplementationId.getLength()==16, "invalid implementation id" );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/SchXMLExportHelper.hxx b/include/xmloff/SchXMLExportHelper.hxx
new file mode 100644
index 000000000000..7413438fe8f7
--- /dev/null
+++ b/include/xmloff/SchXMLExportHelper.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 _XMLOFF_SCH_XMLEXPORTHELPER_HXX_
+#define _XMLOFF_SCH_XMLEXPORTHELPER_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <xmloff/uniref.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <com/sun/star/util/XStringMapping.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/awt/Point.hpp>
+#include <xmloff/xmlprmap.hxx>
+
+#include <queue>
+#include <vector>
+
+class SvXMLAutoStylePoolP;
+class SvXMLExport;
+class SchXMLExportHelper_Impl;
+
+/** With this class you can export a <chart:chart> element containing
+ its data as <table:table> element or without internal table. In
+ the latter case you have to provide a table address mapper if the
+ cell addressing set at the document is not in XML format.
+ */
+class XMLOFF_DLLPUBLIC SchXMLExportHelper : public UniRefBase
+{
+public:
+ SchXMLExportHelper( SvXMLExport& rExport,
+ SvXMLAutoStylePoolP& rASPool );
+
+ virtual ~SchXMLExportHelper();
+
+ /// returns the string corresponding to the current FileFormat CLSID for Chart
+ const OUString& getChartCLSID();
+
+private:
+ SchXMLExportHelper(); // not defined
+ SchXMLExportHelper(SchXMLExportHelper &); // not defined
+ void operator =(SchXMLExportHelper &); // not defined
+
+private:
+ SchXMLExportHelper_Impl* m_pImpl;
+ friend class SchXMLExport;
+};
+
+#endif // _XMLOFF_SCH_XMLEXPORTHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/SchXMLImportHelper.hxx b/include/xmloff/SchXMLImportHelper.hxx
new file mode 100644
index 000000000000..5981597c68bd
--- /dev/null
+++ b/include/xmloff/SchXMLImportHelper.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 _XMLOFF_SCH_XMLIMPORTHELPER_HXX_
+#define _XMLOFF_SCH_XMLIMPORTHELPER_HXX_
+
+#include <xmloff/uniref.hxx>
+#include <xmloff/families.hxx>
+#include <com/sun/star/util/XStringMapping.hpp>
+#include <com/sun/star/chart/XChartDocument.hpp>
+
+namespace com { namespace sun { namespace star {
+ namespace frame {
+ class XModel;
+ }
+ namespace task {
+ class XStatusIndicator;
+ }
+ namespace xml {
+ namespace sax {
+ class XAttributeList;
+ }
+ }
+ namespace chart2 {
+ namespace data {
+ class XDataProvider;
+ class XLabeledDataSequence;
+ }
+ class XChartDocument;
+ class XDataSeries;
+ }
+}}}
+
+class SvXMLUnitConverter;
+class SvXMLStylesContext;
+class XMLChartImportPropertyMapper;
+class SvXMLTokenMap;
+class SvXMLImportContext;
+class SvXMLImport;
+
+// ========================================
+
+/** With this class you can import a <chart:chart> element containing
+ its data as <table:table> element or without internal table. In
+ the latter case you have to provide a table address mapper that
+ converts table addresses in XML format to the appropriate application
+ format.
+ */
+class SchXMLImportHelper : public UniRefBase
+{
+private:
+ com::sun::star::uno::Reference< com::sun::star::chart::XChartDocument > mxChartDoc;
+ SvXMLStylesContext* mpAutoStyles;
+
+ SvXMLTokenMap* mpChartDocElemTokenMap;
+ SvXMLTokenMap* mpTableElemTokenMap;
+ SvXMLTokenMap* mpChartElemTokenMap;
+ SvXMLTokenMap* mpPlotAreaElemTokenMap;
+ SvXMLTokenMap* mpSeriesElemTokenMap;
+
+ SvXMLTokenMap* mpChartAttrTokenMap;
+ SvXMLTokenMap* mpPlotAreaAttrTokenMap;
+ SvXMLTokenMap* mpAutoStyleAttrTokenMap;
+ SvXMLTokenMap* mpCellAttrTokenMap;
+ SvXMLTokenMap* mpSeriesAttrTokenMap;
+ SvXMLTokenMap* mpRegEquationAttrTokenMap;
+
+public:
+
+ SchXMLImportHelper();
+ ~SchXMLImportHelper();
+
+ /** get the context for reading the <chart:chart> element with subelements.
+ The result is stored in the XModel given if it also implements
+ XChartDocument
+ */
+ SvXMLImportContext* CreateChartContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrefix, const OUString& rLocalName,
+ const com::sun::star::uno::Reference<
+ com::sun::star::frame::XModel > xChartModel,
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ /** set the auto-style context that will be used to retrieve auto-styles
+ used inside the following <chart:chart> element to parse
+ */
+ void SetAutoStylesContext( SvXMLStylesContext* pAutoStyles ) { mpAutoStyles = pAutoStyles; }
+ SvXMLStylesContext* GetAutoStylesContext() const { return mpAutoStyles; }
+
+ const com::sun::star::uno::Reference<
+ com::sun::star::chart::XChartDocument >& GetChartDocument()
+ { return mxChartDoc; }
+
+ const SvXMLTokenMap& GetDocElemTokenMap();
+ const SvXMLTokenMap& GetTableElemTokenMap();
+ const SvXMLTokenMap& GetChartElemTokenMap();
+ const SvXMLTokenMap& GetPlotAreaElemTokenMap();
+ const SvXMLTokenMap& GetSeriesElemTokenMap();
+
+ const SvXMLTokenMap& GetChartAttrTokenMap();
+ const SvXMLTokenMap& GetPlotAreaAttrTokenMap();
+ const SvXMLTokenMap& GetCellAttrTokenMap();
+ const SvXMLTokenMap& GetSeriesAttrTokenMap();
+ const SvXMLTokenMap& GetRegEquationAttrTokenMap();
+
+ static sal_uInt16 GetChartFamilyID() { return XML_STYLE_FAMILY_SCH_CHART_ID; }
+
+ /** @param bPushLastChartType If </sal_False>, in case a new chart type has to
+ be added (because it does not exist yet), it is appended at the
+ end of the chart-type container. When </sal_True>, a new chart type
+ is added at one position before the last one, i.e. the formerly
+ last chart type is pushed back, so that it remains the last one.
+
+ This is needed when the global chart type is set to type A, but
+ the first series has type B. Then B should appear before A (done
+ by passing true). Once a series of type A has been read,
+ following new chart types are again be added at the end (by
+ passing false).
+ */
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries > GetNewDataSeries(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument > & xDoc,
+ sal_Int32 nCoordinateSystemIndex,
+ const OUString & rChartTypeName,
+ bool bPushLastChartType = false );
+
+ static void DeleteDataSeries(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries >& xSeries,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument > & xDoc );
+};
+
+#endif // _XMLOFF_SCH_XMLIMPORTHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/SchXMLSeriesHelper.hxx b/include/xmloff/SchXMLSeriesHelper.hxx
new file mode 100644
index 000000000000..7f47295eb71c
--- /dev/null
+++ b/include/xmloff/SchXMLSeriesHelper.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 _XMLOFF_SCH_XML_SERIESHELPER_HXX
+#define _XMLOFF_SCH_XML_SERIESHELPER_HXX
+
+#include <com/sun/star/chart2/data/XDataSequence.hpp>
+#include <com/sun/star/chart2/data/XDataSource.hpp>
+#include <com/sun/star/chart2/XDataSeries.hpp>
+#include <com/sun/star/chart2/XDiagram.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+
+#include "xmloff/dllapi.h"
+
+#include <vector>
+#include <map>
+#include <iterator>
+
+class XMLOFF_DLLPUBLIC SchXMLSeriesHelper
+{
+public:
+ static ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > >
+ getDataSeriesFromDiagram(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDiagram > & xDiagram );
+ static ::std::map< ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries >, sal_Int32 >
+ getDataSeriesIndexMapFromDiagram(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDiagram > & xDiagram );
+
+ static bool isCandleStickSeries(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries >& xSeries
+ , const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel >& xChartModel );
+
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > createOldAPISeriesPropertySet(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries >& xSeries
+ , const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel >& xChartModel );
+
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > createOldAPIDataPointPropertySet(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries >& xSeries
+ , sal_Int32 nPointIndex
+ , const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel >& xChartModel );
+};
+
+// _XMLOFF_SCH_XML_SERIESHELPER_HXX
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/SettingsExportHelper.hxx b/include/xmloff/SettingsExportHelper.hxx
new file mode 100644
index 000000000000..e790e09860da
--- /dev/null
+++ b/include/xmloff/SettingsExportHelper.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 _XMLOFF_SETTINGSEXPORTHELPER_HXX
+#define _XMLOFF_SETTINGSEXPORTHELPER_HXX
+
+#include "xmloff/dllapi.h"
+
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/formula/SymbolDescriptor.hpp>
+#include <com/sun/star/util/XStringSubstitution.hpp>
+#include <xmloff/xmlexp.hxx>
+
+namespace com
+{
+ namespace sun { namespace star {
+ namespace container { class XNameAccess; class XIndexAccess; }
+ namespace util { struct DateTime; }
+ } }
+}
+
+namespace xmloff
+{
+ class XMLSettingsExportContext;
+}
+
+class XMLOFF_DLLPUBLIC XMLSettingsExportHelper
+{
+ ::xmloff::XMLSettingsExportContext& m_rContext;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XStringSubstitution > mxStringSubsitution;
+
+ const OUString msPrinterIndependentLayout;
+ const OUString msColorTableURL;
+ const OUString msLineEndTableURL;
+ const OUString msHatchTableURL;
+ const OUString msDashTableURL;
+ const OUString msGradientTableURL;
+ const OUString msBitmapTableURL;
+
+ void ManipulateSetting( com::sun::star::uno::Any& rAny, const OUString& rName ) const;
+
+ void CallTypeFunction(const com::sun::star::uno::Any& rAny,
+ const OUString& rName) const;
+
+ void exportBool(const sal_Bool bValue, const OUString& rName) const;
+ void exportByte(const sal_Int8 nValue, const OUString& rName) const;
+ void exportShort(const sal_Int16 nValue, const OUString& rName) const;
+ void exportInt(const sal_Int32 nValue, const OUString& rName) const;
+ void exportLong(const sal_Int64 nValue, const OUString& rName) const;
+ void exportDouble(const double fValue, const OUString& rName) const;
+ void exportString(const OUString& sValue, const OUString& rName) const;
+ void exportDateTime(const com::sun::star::util::DateTime& aValue, const OUString& rName) const;
+ void exportSequencePropertyValue(
+ const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps,
+ const OUString& rName) const;
+ void exportbase64Binary(
+ const com::sun::star::uno::Sequence<sal_Int8>& aProps,
+ const OUString& rName) const;
+ void exportMapEntry(const com::sun::star::uno::Any& rAny,
+ const OUString& rName,
+ const sal_Bool bNameAccess) const;
+ void exportNameAccess(
+ const com::sun::star::uno::Reference<com::sun::star::container::XNameAccess>& aNamed,
+ const OUString& rName) const;
+ void exportIndexAccess(
+ const com::sun::star::uno::Reference<com::sun::star::container::XIndexAccess> aIndexed,
+ const OUString rName) const;
+
+ void exportSymbolDescriptors(
+ const com::sun::star::uno::Sequence < com::sun::star::formula::SymbolDescriptor > &rProps,
+ const OUString rName) const;
+ void exportForbiddenCharacters(
+ const com::sun::star::uno::Any &rAny,
+ const OUString rName) const;
+
+public:
+ XMLSettingsExportHelper( ::xmloff::XMLSettingsExportContext& i_rContext );
+ ~XMLSettingsExportHelper();
+
+ void exportAllSettings(
+ const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps,
+ const OUString& rName) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/SinglePropertySetInfoCache.hxx b/include/xmloff/SinglePropertySetInfoCache.hxx
new file mode 100644
index 000000000000..576339d9c9de
--- /dev/null
+++ b/include/xmloff/SinglePropertySetInfoCache.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 _XMLOFF_SINGEPROPERTYSETINFOCACHE_HXX
+#define _XMLOFF_SINGEPROPERTYSETINFOCACHE_HXX
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include <boost/unordered_map.hpp>
+#include <xmloff/PropertySetInfoHash.hxx>
+
+typedef boost::unordered_map
+<
+ PropertySetInfoKey,
+ sal_Bool,
+ PropertySetInfoHash,
+ PropertySetInfoHash
+>
+SinglePropertySetInfoMap_Impl;
+
+class SinglePropertySetInfoCache : private SinglePropertySetInfoMap_Impl
+{
+ OUString sName;
+
+public:
+
+ inline SinglePropertySetInfoCache( const OUString& rName );
+ ~SinglePropertySetInfoCache() {};
+
+ sal_Bool hasProperty(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& rPropSet,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySetInfo >& rPropSetInfo );
+ inline sal_Bool hasProperty(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet>& rPropSet );
+};
+
+inline SinglePropertySetInfoCache::SinglePropertySetInfoCache(
+ const OUString& rName ) :
+ sName( rName )
+{
+}
+
+inline sal_Bool SinglePropertySetInfoCache::hasProperty(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet>& rPropSet )
+{
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySetInfo > xInfo;
+ return hasProperty( rPropSet, xInfo );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/WordWrapPropertyHdl.hxx b/include/xmloff/WordWrapPropertyHdl.hxx
new file mode 100644
index 000000000000..6430b8258c6e
--- /dev/null
+++ b/include/xmloff/WordWrapPropertyHdl.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 _XMLOFF_WORDWRAPPROPERTYHANDLER_HXX
+#define _XMLOFF_WORDWRAPPROPERTYHANDLER_HXX
+
+#include <xmloff/xmlprhdl.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <com/sun/star/uno/Type.h>
+#include <xmloff/xmlement.hxx>
+
+/**
+ PropertyHandler for a named xml bool type:
+*/
+class SvXMLImport;
+class XMLWordWrapPropertyHdl : public XMLPropertyHandler
+{
+private:
+ SvXMLImport* mpImport;
+
+public:
+ XMLWordWrapPropertyHdl( SvXMLImport* pImport );
+ virtual ~XMLWordWrapPropertyHdl();
+
+ virtual sal_Bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
+ virtual sal_Bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
+};
+
+#endif // _XMLOFF_NAMEDBOOLPROPERTYHANDLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLBase64ImportContext.hxx b/include/xmloff/XMLBase64ImportContext.hxx
new file mode 100644
index 000000000000..d2804928a324
--- /dev/null
+++ b/include/xmloff/XMLBase64ImportContext.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 _XMLOFF_XMLBASE64IMPORTCONTEXT_HXX
+#define _XMLOFF_XMLBASE64IMPORTCONTEXT_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <xmloff/xmlictxt.hxx>
+
+namespace com { namespace sun { namespace star { namespace io {
+ class XOutputStream; } } } }
+
+class XMLOFF_DLLPUBLIC XMLBase64ImportContext : public SvXMLImportContext
+{
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XOutputStream > xOut;
+ OUString sBase64CharsLeft;
+
+public:
+ TYPEINFO();
+
+ XMLBase64ImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XOutputStream >& rOut );
+
+ virtual ~XMLBase64ImportContext();
+
+ virtual void EndElement();
+
+ virtual void Characters( const OUString& rChars );
+
+};
+
+#endif // _XMLOFF_XMLBASE64IMPORTCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLCharContext.hxx b/include/xmloff/XMLCharContext.hxx
new file mode 100644
index 000000000000..644b03877d64
--- /dev/null
+++ b/include/xmloff/XMLCharContext.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__XMLOFF_CHARCONTEXT_HXX
+#define INCLUDED__XMLOFF_CHARCONTEXT_HXX
+
+#include "xmloff/dllapi.h"
+#include <com/sun/star/uno/Reference.h>
+#include "xmlictxt.hxx"
+
+class XMLOFF_DLLPUBLIC XMLCharContext : public SvXMLImportContext
+{
+ XMLCharContext(const XMLCharContext&);
+ void operator =(const XMLCharContext&);
+protected:
+ sal_Int16 m_nControl;
+ sal_uInt16 m_nCount;
+ sal_Unicode m_c;
+public:
+
+ TYPEINFO();
+
+ XMLCharContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
+ sal_Unicode c,
+ sal_Bool bCount );
+ XMLCharContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
+ sal_Int16 nControl );
+
+ virtual ~XMLCharContext();
+
+ // EndElement is called before a context will be destructed, but
+ // after a elements context has been parsed. It may be used for actions
+ // that require virtual methods. The default is to do nothing.
+ virtual void EndElement();
+
+ virtual void InsertControlCharacter(sal_Int16 _nControl);
+ virtual void InsertString(const OUString& _sString);
+};
+// ---------------------------------------------------------------------
+#endif // INCLUDED__XMLOFF_CHARCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLConstantsPropertyHandler.hxx b/include/xmloff/XMLConstantsPropertyHandler.hxx
new file mode 100644
index 000000000000..cad125159d11
--- /dev/null
+++ b/include/xmloff/XMLConstantsPropertyHandler.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 _XMLOFF_XMLCONSTANTSPROPERTYHANDLER_HXX
+#define _XMLOFF_XMLCONSTANTSPROPERTYHANDLER_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/xmlprhdl.hxx>
+#include <xmloff/xmltoken.hxx>
+
+struct SvXMLEnumMapEntry;
+
+///////////////////////////////////////////////////////////////////////////
+//
+/** Abstract base-class for different XML-types. Derivations of this class
+ knows how to compare, im/export a special XML-type
+*/
+class XMLOFF_DLLPUBLIC XMLConstantsPropertyHandler: public XMLPropertyHandler
+{
+ const SvXMLEnumMapEntry *pMap;
+ const enum ::xmloff::token::XMLTokenEnum eDefault;
+
+public:
+
+ XMLConstantsPropertyHandler( const SvXMLEnumMapEntry *pM,
+ enum ::xmloff::token::XMLTokenEnum eDflt);
+
+ // Just needed for virtual destruction
+ virtual ~XMLConstantsPropertyHandler();
+
+ /// Imports the given value in cas of the given XML-data-type
+ virtual sal_Bool importXML(
+ const OUString& rStrImpValue,
+ ::com::sun::star::uno::Any& rValue,
+ const SvXMLUnitConverter& rUnitConverter ) const;
+
+ /// Exports the given value in cas of the given XML-data-type
+ virtual sal_Bool exportXML(
+ OUString& rStrExpValue,
+ const ::com::sun::star::uno::Any& rValue,
+ const SvXMLUnitConverter& rUnitConverter ) const;
+};
+
+#endif // _XMLOFF_XMLCONSTANTSPROPERTYHANDLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLEmbeddedObjectExportFilter.hxx b/include/xmloff/XMLEmbeddedObjectExportFilter.hxx
new file mode 100644
index 000000000000..40f42b6be202
--- /dev/null
+++ b/include/xmloff/XMLEmbeddedObjectExportFilter.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 _XMLOFF_XMLEMBEDDEDOBJECTEXPORTFILTER_HXX
+#define _XMLOFF_XMLEMBEDDEDOBJECTEXPORTFILTER_HXX
+
+#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/implbase3.hxx>
+
+class XMLEmbeddedObjectExportFilter : public ::cppu::WeakImplHelper3<
+ ::com::sun::star::xml::sax::XExtendedDocumentHandler,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XInitialization>
+{
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XDocumentHandler > xHandler;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XExtendedDocumentHandler > xExtHandler;
+
+public:
+ XMLEmbeddedObjectExportFilter( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XDocumentHandler > & rHandler ) throw();
+ virtual ~XMLEmbeddedObjectExportFilter () throw();
+
+ // ::com::sun::star::xml::sax::XDocumentHandler
+ virtual void SAL_CALL startDocument(void)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL endDocument(void)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL startElement(const OUString& aName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL endElement(const OUString& aName)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL characters(const OUString& aChars)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL ignorableWhitespace(const OUString& aWhitespaces)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL processingInstruction(const OUString& aTarget,
+ const OUString& aData)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::xml::sax::XExtendedDocumentHandler
+ virtual void SAL_CALL startCDATA(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL endCDATA(void) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL comment(const OUString& sComment)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL allowLineBreak(void)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL unknown(const OUString& sString)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+};
+
+#endif // _XMLOFF_XMLEMBEDDEDOBJECTEXPORTFILTER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLEventExport.hxx b/include/xmloff/XMLEventExport.hxx
new file mode 100644
index 000000000000..52b77daa8764
--- /dev/null
+++ b/include/xmloff/XMLEventExport.hxx
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_XMLEVENTEXPORT_HXX
+#define _XMLOFF_XMLEVENTEXPORT_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <rtl/ustring.hxx>
+#include <xmloff/xmlevent.hxx>
+
+#include <map>
+
+class SvXMLExport;
+namespace com { namespace sun { namespace star {
+ namespace document { class XEventsSupplier; }
+ namespace container { class XNameReplace; }
+ namespace container { class XNameAccess; }
+ namespace beans { struct PropertyValue; }
+} } }
+
+typedef ::std::map< OUString, XMLEventExportHandler* > HandlerMap;
+typedef ::std::map< OUString, XMLEventName > NameMap;
+
+/**
+ * Export instances of EventsSupplier services. To use this class you
+ * must fulfill two conditions:
+ *
+ * 1) provide a translation from the API event names to XML event
+ * names
+ * 2) Register XMLEventExportHandler instances for all script types
+ * that you would like to export.
+ *
+ * The Export()-Methods all have a bUseWhitespace parameter that
+ * causes the exported elements to be surrounded by whitespace, which
+ * in turn causes the elements to be indented properly. By default,
+ * whitespace is used, but it may not be called for in all cases (e.g
+ * events attached to hyperlink within a paragraph.)
+ */
+class XMLOFF_DLLPUBLIC XMLEventExport
+{
+ const OUString sEventType;
+
+ SvXMLExport& rExport;
+
+ HandlerMap aHandlerMap;
+ NameMap aNameTranslationMap;
+
+ bool bExtNamespace;
+
+public:
+ XMLEventExport(SvXMLExport& rExport,
+ const XMLEventNameTranslation* pTranslationTable = NULL);
+ ~XMLEventExport();
+
+ /// register an EventExportHandler for a particular script type
+ ///
+ /// The handlers will be deleted when the object is destroyed, hence
+ /// no pointers to a handler registered with AddHandler() should be
+ /// held by anyone.
+ void AddHandler( const OUString& rName,
+ XMLEventExportHandler* rHandler );
+
+ /// register additional event names
+ void AddTranslationTable( const XMLEventNameTranslation* pTransTable );
+
+ /// export the events (calls EventExport::Export(Reference<XNameAcess>) )
+ void Export( ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XEventsSupplier> & xAccess,
+ sal_Bool bUseWhitespace = sal_True);
+
+ /// export the events (calls EventExport::Export(Reference<XNameAcess>) )
+ void Export( ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameReplace> & xAccess,
+ sal_Bool bUseWhitespace = sal_True);
+
+ /// export the events (writes <office:events> element)
+ void Export( ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameAccess> & xAccess,
+ sal_Bool bUseWhitespace = sal_True);
+
+ /// export the events, but write <officeooo:events> element
+ /// (for new file format additions)
+ void ExportExt( ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameAccess> & xAccess,
+ sal_Bool bUseWhitespace = sal_True);
+
+ /// export a single event (writes <office:events> element)
+ void ExportSingleEvent(
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue>& rEventValues,
+ const OUString& rApiEventName,
+ sal_Bool bUseWhitespace = sal_True );
+
+private:
+
+ /// export one event (start container-element if necessary)
+ SAL_DLLPRIVATE void ExportEvent(
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue>& rEventValues,
+ const XMLEventName& rXmlEventName,
+ sal_Bool bUseWhitespace,
+ sal_Bool& rExported);
+
+ /// export the start element
+ SAL_DLLPRIVATE void StartElement(sal_Bool bUseWhitespace);
+
+ /// export the end element
+ SAL_DLLPRIVATE void EndElement(sal_Bool bUseWhitespace);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLEventsImportContext.hxx b/include/xmloff/XMLEventsImportContext.hxx
new file mode 100644
index 000000000000..8f7da79b4fb8
--- /dev/null
+++ b/include/xmloff/XMLEventsImportContext.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 _XMLOFF_XMLEVENTSIMPORTCONTEXT_HXX
+#define _XMLOFF_XMLEVENTSIMPORTCONTEXT_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <xmloff/xmlictxt.hxx>
+#include <xmloff/xmlevent.hxx>
+
+#include <map>
+#include <vector>
+
+namespace com { namespace sun { namespace star {
+ namespace xml { namespace sax { class XAttributeList; } }
+ namespace beans { struct PropertyValue; }
+ namespace container { class XNameReplace; }
+ namespace document { class XEventsSupplier; }
+} } }
+
+typedef ::std::pair<
+ OUString,
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue> > EventNameValuesPair;
+
+typedef ::std::vector< EventNameValuesPair > EventsVector;
+
+/**
+ * Import <script:events> element.
+ *
+ * The import context usually sets the events immediately at the event
+ * XNameReplace. If none was given on construction, it operates in
+ * delayed mode: All events are collected and may then be set
+ * with the setEvents() method.
+ */
+class XMLOFF_DLLPUBLIC XMLEventsImportContext : public SvXMLImportContext
+{
+protected:
+ // the event XNameReplace; may be empty
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameReplace> xEvents;
+
+ // if no XNameReplace is given, use this vector to collect events
+ EventsVector aCollectEvents;
+
+public:
+
+ TYPEINFO();
+
+ XMLEventsImportContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const OUString& rLocalName);
+
+ XMLEventsImportContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XEventsSupplier> & xEventsSupplier);
+
+ XMLEventsImportContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameReplace> & xNameRepl);
+
+ ~XMLEventsImportContext();
+
+ void AddEventValues(
+ const OUString& rEventName,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue> & rValues);
+
+ /// if the import operates in delayed mode, you can use this method
+ /// to set all events that have been read on the XEventsSupplier
+ void SetEvents(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XEventsSupplier> & xEventsSupplier);
+
+ /// if the import operates in delayed mode, you can use this method
+ /// to set all events that have been read on the XNameReplace
+ void SetEvents(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameReplace> & xNameRepl);
+
+ /// if the import operates indelayed mode, you can use this method
+ /// to obtain the value sequence for a specific event
+ sal_Bool GetEventSequence(
+ const OUString& rName,
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue> & rSequence );
+
+protected:
+
+ virtual void StartElement(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
+
+ virtual void EndElement();
+
+ virtual SvXMLImportContext *CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLFilterServiceNames.h b/include/xmloff/XMLFilterServiceNames.h
new file mode 100644
index 000000000000..332935228e08
--- /dev/null
+++ b/include/xmloff/XMLFilterServiceNames.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 _XMLOFF_XMLFILTERSERVICENAMES_H
+#define _XMLOFF_XMLFILTERSERVICENAMES_H
+
+
+#define XML_IMPORT_FILTER_WRITER "com.sun.star.comp.Writer.XMLOasisImporter"
+#define XML_IMPORT_FILTER_CALC "com.sun.star.comp.Calc.XMLOasisImporter"
+#define XML_IMPORT_FILTER_DRAW "com.sun.star.comp.Draw.XMLOasisImporter"
+#define XML_IMPORT_FILTER_IMPRESS "com.sun.star.comp.Impress.XMLOasisImporter"
+#define XML_IMPORT_FILTER_MATH "com.sun.star.comp.Math.XMLImporter"
+#define XML_IMPORT_FILTER_CHART "com.sun.star.comp.Chart.XMLOasisImporter"
+
+#define XML_EXPORT_FILTER_WRITER "com.sun.star.comp.Writer.XMLOasisExporter"
+#define XML_EXPORT_FILTER_CALC "com.sun.star.comp.Calc.XMLOasisExporter"
+#define XML_EXPORT_FILTER_DRAW "com.sun.star.comp.Draw.XMLOasisExporter"
+#define XML_EXPORT_FILTER_IMPRESS "com.sun.star.comp.Impress.XMLOasisExporter"
+#define XML_EXPORT_FILTER_MATH "com.sun.star.comp.Math.XMLExporter"
+#define XML_EXPORT_FILTER_CHART "com.sun.star.comp.Chart.XMLOasisExporter"
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLFontAutoStylePool.hxx b/include/xmloff/XMLFontAutoStylePool.hxx
new file mode 100644
index 000000000000..8ee84d8686df
--- /dev/null
+++ b/include/xmloff/XMLFontAutoStylePool.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 _XMLOFF_XMLFONTAUTOSTYLEPOOL_HXX
+#define _XMLOFF_XMLFONTAUTOSTYLEPOOL_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <rtl/ustring.hxx>
+#include <tools/fontenum.hxx>
+#include <xmloff/uniref.hxx>
+#include <set>
+
+class XMLFontAutoStylePool_Impl;
+typedef std::set<OUString> XMLFontAutoStylePoolNames_Impl;
+class SvXMLExport;
+
+class XMLOFF_DLLPUBLIC XMLFontAutoStylePool : public UniRefBase
+{
+ SvXMLExport& rExport;
+
+ XMLFontAutoStylePool_Impl *pPool;
+ XMLFontAutoStylePoolNames_Impl m_aNames;
+ bool tryToEmbedFonts;
+
+ OUString embedFontFile( const OUString& fontUrl );
+
+protected:
+
+ SvXMLExport& GetExport() { return rExport; }
+
+public:
+
+ XMLFontAutoStylePool( SvXMLExport& rExport, bool tryToEmbedFonts = false );
+ ~XMLFontAutoStylePool();
+
+ OUString Add(
+ const OUString& rFamilyName,
+ const OUString& rStyleName,
+ FontFamily nFamily,
+ FontPitch nPitch,
+ rtl_TextEncoding eEnc );
+
+ OUString Find(
+ const OUString& rFamilyName,
+ const OUString& rStyleName,
+ FontFamily nFamily,
+ FontPitch nPitch,
+ rtl_TextEncoding eEnc )const;
+ OUString Find( const OUString& rInternalName ) const;
+
+ void exportXML();
+};
+
+#endif // _XMLOFF_XMLFONTAUTOSTYLEPOOL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLFontStylesContext.hxx b/include/xmloff/XMLFontStylesContext.hxx
new file mode 100644
index 000000000000..c04d5c12230a
--- /dev/null
+++ b/include/xmloff/XMLFontStylesContext.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 _XMLOFF_XMLFONTSTYLESCONTEXT_HXX_
+#define _XMLOFF_XMLFONTSTYLESCONTEXT_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+
+#include <vector>
+
+#include <xmloff/xmlstyle.hxx>
+
+struct XMLPropertyState;
+class SvXMLTokenMap;
+class XMLFontFamilyNamePropHdl;
+class XMLFontFamilyPropHdl;
+class XMLFontPitchPropHdl;
+class XMLFontEncodingPropHdl;
+
+class XMLOFF_DLLPUBLIC XMLFontStylesContext : public SvXMLStylesContext
+{
+ XMLFontFamilyNamePropHdl *pFamilyNameHdl;
+ XMLFontFamilyPropHdl *pFamilyHdl;
+ XMLFontPitchPropHdl *pPitchHdl;
+ XMLFontEncodingPropHdl *pEncHdl;
+
+ SvXMLTokenMap *pFontStyleAttrTokenMap;
+
+ rtl_TextEncoding eDfltEncoding;
+
+protected:
+
+ virtual SvXMLStyleContext *CreateStyleChildContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+public:
+
+ TYPEINFO();
+
+ XMLFontStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
+ rtl_TextEncoding eDfltEnc );
+ virtual ~XMLFontStylesContext();
+
+ const SvXMLTokenMap& GetFontStyleAttrTokenMap() const
+ {
+ return *pFontStyleAttrTokenMap;
+ }
+
+ sal_Bool FillProperties( const OUString& rName,
+ ::std::vector< XMLPropertyState > &rProps,
+ sal_Int32 nFamilyNameIdx,
+ sal_Int32 nStyleNameIdx,
+ sal_Int32 nFamilyIdx,
+ sal_Int32 nPitchIdx,
+ sal_Int32 nCharsetIdx ) const;
+
+ rtl_TextEncoding GetDfltCharset() const { return eDfltEncoding; }
+
+ XMLFontFamilyNamePropHdl& GetFamilyNameHdl() const { return *pFamilyNameHdl; }
+ XMLFontFamilyPropHdl& GetFamilyHdl() const { return *pFamilyHdl; }
+ XMLFontPitchPropHdl& GetPitchHdl() const { return *pPitchHdl; }
+ XMLFontEncodingPropHdl& GetEncodingHdl() const { return *pEncHdl; }
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLGraphicsDefaultStyle.hxx b/include/xmloff/XMLGraphicsDefaultStyle.hxx
new file mode 100644
index 000000000000..06fee705d04d
--- /dev/null
+++ b/include/xmloff/XMLGraphicsDefaultStyle.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 _XMLOFF_XMLGRAPHICSDEFAULTSTYLE_HXX
+#define _XMLOFF_XMLGRAPHICSDEFAULTSTYLE_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/prstylei.hxx>
+
+namespace com { namespace sun { namespace star { namespace container
+{
+ class XNameContainer;
+} } } }
+
+class XMLOFF_DLLPUBLIC XMLGraphicsDefaultStyle : public XMLPropStyleContext
+{
+public:
+ TYPEINFO();
+
+ XMLGraphicsDefaultStyle( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ SvXMLStylesContext& rStyles);
+
+ virtual ~XMLGraphicsDefaultStyle();
+
+ virtual SvXMLImportContext *CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ // This method is called for every default style
+ virtual void SetDefaults();
+};
+
+#endif // _XMLOFF_XMLGRAPHICSDEFAULTSTYLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLPageExport.hxx b/include/xmloff/XMLPageExport.hxx
new file mode 100644
index 000000000000..c30dbe43d786
--- /dev/null
+++ b/include/xmloff/XMLPageExport.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 _XMLOFF_XMLPAGEEXPORT_HXX
+#define _XMLOFF_XMLPAGEEXPORT_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <rtl/ustring.hxx>
+#include <vector>
+#include <xmloff/attrlist.hxx>
+#include <xmloff/uniref.hxx>
+#include <com/sun/star/container/XIndexAccess.hpp>
+
+namespace com { namespace sun { namespace star {
+ namespace style { class XStyle; }
+ namespace container { class XIndexReplace; class XNameAccess;}
+ namespace beans { class XPropertySet; }
+} } }
+
+class SvXMLExport;
+class XMLPropertyHandlerFactory;
+class XMLPropertySetMapper;
+class SvXMLExportPropertyMapper;
+
+//______________________________________________________________________________
+
+struct XMLPageExportNameEntry
+{
+ OUString sPageMasterName;
+ OUString sStyleName;
+};
+
+//______________________________________________________________________________
+
+class XMLOFF_DLLPUBLIC XMLPageExport : public UniRefBase
+{
+ SvXMLExport& rExport;
+
+ const OUString sIsPhysical;
+ const OUString sFollowStyle;
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameAccess > xPageStyles;
+
+ ::std::vector< XMLPageExportNameEntry > aNameVector;
+ SAL_DLLPRIVATE sal_Bool findPageMasterName( const OUString& rStyleName, OUString& rPMName ) const;
+
+ UniReference < XMLPropertyHandlerFactory > xPageMasterPropHdlFactory;
+ UniReference < XMLPropertySetMapper > xPageMasterPropSetMapper;
+ UniReference < SvXMLExportPropertyMapper > xPageMasterExportPropMapper;
+
+protected:
+
+ SvXMLExport& GetExport() { return rExport; }
+
+ virtual void collectPageMasterAutoStyle(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ OUString& rPageMasterName );
+
+ virtual void exportMasterPageContent(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ sal_Bool bAutoStyles );
+
+ sal_Bool exportStyle(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::style::XStyle >& rStyle,
+ sal_Bool bAutoStyles );
+
+ void exportStyles( sal_Bool bUsed, sal_Bool bAutoStyles );
+
+public:
+ XMLPageExport( SvXMLExport& rExp );
+ ~XMLPageExport();
+
+ void collectAutoStyles( sal_Bool bUsed ) { exportStyles( bUsed, sal_True ); }
+ void exportAutoStyles();
+ void exportMasterStyles( sal_Bool bUsed ) { exportStyles( bUsed, sal_False ); }
+
+ //text grid enhancement for better CJK support
+ void exportDefaultStyle();
+};
+
+#endif // _XMLOFF_XMLTEXTMASTERPAGEEXPORT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLSettingsExportContext.hxx b/include/xmloff/XMLSettingsExportContext.hxx
new file mode 100644
index 000000000000..819da2b41d77
--- /dev/null
+++ b/include/xmloff/XMLSettingsExportContext.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 XML_SETTINGS_EXPORT_CONTEXT_HXX
+#define XML_SETTINGS_EXPORT_CONTEXT_HXX
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include "xmloff/xmltoken.hxx"
+
+//........................................................................
+namespace xmloff
+{
+//........................................................................
+
+ //====================================================================
+ //= XMLExporter
+ //====================================================================
+ class SAL_NO_VTABLE XMLSettingsExportContext
+ {
+ public:
+ virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName,
+ const OUString& i_rValue ) = 0;
+ virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName,
+ enum ::xmloff::token::XMLTokenEnum i_eValue ) = 0;
+
+ virtual void StartElement( enum ::xmloff::token::XMLTokenEnum i_eName,
+ const sal_Bool i_bIgnoreWhitespace ) = 0;
+ virtual void EndElement( const sal_Bool i_bIgnoreWhitespace ) = 0;
+
+ virtual void Characters( const OUString& i_rCharacters ) = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ GetComponentContext() const = 0;
+
+ protected:
+ ~XMLSettingsExportContext() {}
+ };
+
+//........................................................................
+} // namespace xmloff
+//........................................................................
+
+#endif // XML_SETTINGS_EXPORT_CONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLShapeStyleContext.hxx b/include/xmloff/XMLShapeStyleContext.hxx
new file mode 100644
index 000000000000..2f39eee0e08f
--- /dev/null
+++ b/include/xmloff/XMLShapeStyleContext.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 _XMLOFF_XMLSHAPESTYLECONTEXT_HXX
+#define _XMLOFF_XMLSHAPESTYLECONTEXT_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/prstylei.hxx>
+#include <xmloff/families.hxx>
+
+class SvXMLImport;
+
+//////////////////////////////////////////////////////////////////////////////
+// style:style context
+
+class XMLOFF_DLLPUBLIC XMLShapeStyleContext: public XMLPropStyleContext
+{
+protected:
+ OUString m_sControlDataStyleName;
+ OUString m_sListStyleName;
+ sal_Bool m_bIsNumRuleAlreadyConverted;
+
+protected:
+ virtual void SetAttribute( sal_uInt16 nPrefixKey,
+ const OUString& rLocalName,
+ const OUString& rValue );
+public:
+ TYPEINFO();
+
+ XMLShapeStyleContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ SvXMLStylesContext& rStyles,
+ sal_uInt16 nFamily = XML_STYLE_FAMILY_SD_GRAPHICS_ID);
+ virtual ~XMLShapeStyleContext();
+
+ SvXMLImportContext * CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ virtual void Finish( sal_Bool bOverwrite );
+
+ virtual void FillPropertySet(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > & rPropSet );
+};
+
+#endif // _XMLOFF_XMLSHAPESTYLECONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLStringVector.hxx b/include/xmloff/XMLStringVector.hxx
new file mode 100644
index 000000000000..863ec7aa4d3e
--- /dev/null
+++ b/include/xmloff/XMLStringVector.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 _XMLOFF_XMLSTRINGVECTOR_HXX
+#define _XMLOFF_XMLSTRINGVECTOR_HXX
+
+#include <rtl/ustring.hxx>
+
+#include <vector>
+
+typedef ::std::vector < OUString> XMLStringVector;
+
+
+#endif // _XMLOFF_XMLSTRINGVECTOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLTextListAutoStylePool.hxx b/include/xmloff/XMLTextListAutoStylePool.hxx
new file mode 100644
index 000000000000..f3768da8ab40
--- /dev/null
+++ b/include/xmloff/XMLTextListAutoStylePool.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 _XMLOFF_XMLTEXTLISTAUTOSTYLEPOOL_HXX
+#define _XMLOFF_XMLTEXTLISTAUTOSTYLEPOOL_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <rtl/ustring.hxx>
+#include <com/sun/star/ucb/XAnyCompare.hpp>
+#include <set>
+
+namespace com { namespace sun { namespace star { namespace container {
+ class XIndexReplace; } } } }
+
+
+class XMLTextListAutoStylePool_Impl;
+typedef std::set<OUString> XMLTextListAutoStylePoolNames_Impl;
+class XMLTextListAutoStylePoolEntry_Impl;
+class SvXMLExport;
+
+class XMLOFF_DLLPUBLIC XMLTextListAutoStylePool
+{
+ SvXMLExport& rExport;
+
+ OUString sPrefix;
+
+ XMLTextListAutoStylePool_Impl *pPool;
+ XMLTextListAutoStylePoolNames_Impl m_aNames;
+ sal_uInt32 nName;
+
+ /** this is an optional NumRule compare component for applications where
+ the NumRules don't have names */
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompare > mxNumRuleCompare;
+
+ SAL_DLLPRIVATE sal_uInt32 Find( XMLTextListAutoStylePoolEntry_Impl* pEntry )
+ const;
+public:
+
+ XMLTextListAutoStylePool( SvXMLExport& rExport );
+ ~XMLTextListAutoStylePool();
+
+ void RegisterName( const OUString& rName );
+
+ OUString Add(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XIndexReplace > & rNumRules );
+
+ OUString Find(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XIndexReplace > & rNumRules ) const;
+ OUString Find( const OUString& rInternalName ) const;
+
+ void exportXML() const;
+};
+
+
+#endif // _XMLOFF_XMLTEXTLISTAUTOSTYLEPOOL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLTextMasterPageContext.hxx b/include/xmloff/XMLTextMasterPageContext.hxx
new file mode 100644
index 000000000000..c0965e7564f9
--- /dev/null
+++ b/include/xmloff/XMLTextMasterPageContext.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 _XMLOFF_TEXTMASTERPAGECONTEXT_HXX_
+#define _XMLOFF_TEXTMASTERPAGECONTEXT_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+
+#include <xmloff/xmlstyle.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace style { class XStyle; }
+} } }
+
+class XMLOFF_DLLPUBLIC XMLTextMasterPageContext : public SvXMLStyleContext
+{
+ const OUString sIsPhysical;
+ const OUString sPageStyleLayout;
+ const OUString sFollowStyle;
+ OUString sFollow;
+ OUString sPageMasterName;
+
+ ::com::sun::star::uno::Reference < ::com::sun::star::style::XStyle > xStyle;
+
+ sal_Bool bInsertHeader;
+ sal_Bool bInsertFooter;
+ sal_Bool bInsertHeaderLeft;
+ sal_Bool bInsertFooterLeft;
+ sal_Bool bInsertHeaderFirst;
+ sal_Bool bInsertFooterFirst;
+ sal_Bool bHeaderInserted;
+ sal_Bool bFooterInserted;
+ sal_Bool bHeaderLeftInserted;
+ sal_Bool bFooterLeftInserted;
+ sal_Bool bHeaderFirstInserted;
+ sal_Bool bFooterFirstInserted;
+
+ SAL_DLLPRIVATE ::com::sun::star::uno::Reference <
+ ::com::sun::star::style::XStyle > Create();
+protected:
+ ::com::sun::star::uno::Reference <
+ ::com::sun::star::style::XStyle > GetStyle() { return xStyle; }
+public:
+
+ TYPEINFO();
+
+ XMLTextMasterPageContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
+ sal_Bool bOverwrite );
+ virtual ~XMLTextMasterPageContext();
+
+ virtual SvXMLImportContext *CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ virtual SvXMLImportContext *CreateHeaderFooterContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
+ const sal_Bool bFooter,
+ const sal_Bool bLeft,
+ const sal_Bool bFirst );
+
+ virtual void Finish( sal_Bool bOverwrite );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLTextMasterPageExport.hxx b/include/xmloff/XMLTextMasterPageExport.hxx
new file mode 100644
index 000000000000..8ef0dcaef6a6
--- /dev/null
+++ b/include/xmloff/XMLTextMasterPageExport.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 _XMLOFF_XMLTEXTMASTERPAGEEXPORT_HXX
+#define _XMLOFF_XMLTEXTMASTERPAGEEXPORT_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <rtl/ustring.hxx>
+#include <xmloff/attrlist.hxx>
+#include <xmloff/XMLPageExport.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace text { class XText; }
+} } }
+
+class XMLOFF_DLLPUBLIC XMLTextMasterPageExport : public XMLPageExport
+{
+ const OUString sHeaderText;
+ const OUString sHeaderOn;
+ const OUString sHeaderShareContent;
+ const OUString sHeaderTextFirst;
+ const OUString sHeaderTextLeft;
+
+ const OUString sFirstShareContent;
+
+ const OUString sFooterText;
+ const OUString sFooterOn;
+ const OUString sFooterShareContent;
+ const OUString sFooterTextFirst;
+ const OUString sFooterTextLeft;
+
+protected:
+
+ virtual void exportHeaderFooterContent(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XText >& rText,
+ sal_Bool bAutoStyles, sal_Bool bExportParagraph = sal_True );
+
+ virtual void exportMasterPageContent(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ sal_Bool bAutoStyles );
+
+public:
+ XMLTextMasterPageExport( SvXMLExport& rExp );
+ ~XMLTextMasterPageExport();
+};
+
+#endif // _XMLOFF_XMLTEXTMASTERPAGEEXPORT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLTextMasterStylesContext.hxx b/include/xmloff/XMLTextMasterStylesContext.hxx
new file mode 100644
index 000000000000..9d03c401b900
--- /dev/null
+++ b/include/xmloff/XMLTextMasterStylesContext.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 _XMLOFF_XMLTEXTMASTERSTYLESCONTEXT_HXX
+#define _XMLOFF_XMLTEXTMASTERSTYLESCONTEXT_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/xmlstyle.hxx>
+
+class XMLOFF_DLLPUBLIC XMLTextMasterStylesContext : public SvXMLStylesContext
+{
+protected:
+ virtual SvXMLStyleContext *CreateStyleChildContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ virtual SvXMLStyleContext *CreateStyleStyleChildContext( sal_uInt16 nFamily,
+ sal_uInt16 nPrefix, const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ virtual sal_Bool InsertStyleFamily( sal_uInt16 nFamily ) const;
+
+public:
+ TYPEINFO();
+
+ XMLTextMasterStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList);
+
+ virtual ~XMLTextMasterStylesContext();
+};
+
+#endif // _XMLOFF_XMLTEXTMASTERSTYLECONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLTextShapeImportHelper.hxx b/include/xmloff/XMLTextShapeImportHelper.hxx
new file mode 100644
index 000000000000..46d77a487297
--- /dev/null
+++ b/include/xmloff/XMLTextShapeImportHelper.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 _XMLTEXTSHAPEIMPORTHELPER_HXX
+#define _XMLTEXTSHAPEIMPORTHELPER_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/shapeimport.hxx>
+
+class XMLOFF_DLLPUBLIC XMLTextShapeImportHelper : public XMLShapeImportHelper
+{
+ SvXMLImport& rImport;
+
+ const OUString sAnchorType;
+ const OUString sAnchorPageNo;
+ const OUString sVertOrientPosition;
+
+public:
+
+ XMLTextShapeImportHelper( SvXMLImport& rImp );
+ ~XMLTextShapeImportHelper();
+
+ virtual void addShape(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape >& rShape,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShapes >& rShapes );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLTextShapeStyleContext.hxx b/include/xmloff/XMLTextShapeStyleContext.hxx
new file mode 100644
index 000000000000..922153a9188a
--- /dev/null
+++ b/include/xmloff/XMLTextShapeStyleContext.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 _XMLOFF_XMLTEXTSHAPESTYLECONTEXT_HXX_
+#define _XMLOFF_XMLTEXTSHAPESTYLECONTEXT_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/XMLShapeStyleContext.hxx>
+
+class XMLOFF_DLLPUBLIC XMLTextShapeStyleContext : public XMLShapeStyleContext
+{
+ const OUString sIsAutoUpdate;
+
+ sal_Bool bAutoUpdate : 1;
+
+ SvXMLImportContextRef xEventContext;
+
+protected:
+
+ virtual void SetAttribute( sal_uInt16 nPrefixKey,
+ const OUString& rLocalName,
+ const OUString& rValue );
+
+public:
+
+ TYPEINFO();
+
+ XMLTextShapeStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
+ SvXMLStylesContext& rStyles, sal_uInt16 nFamily,
+ sal_Bool bDefaultStyle = sal_False );
+ virtual ~XMLTextShapeStyleContext();
+
+ virtual SvXMLImportContext *CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ sal_Bool IsAutoUpdate() const { return bAutoUpdate; }
+
+ virtual void CreateAndInsert( sal_Bool bOverwrite );
+
+ virtual void Finish( sal_Bool bOverwrite );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLTextTableContext.hxx b/include/xmloff/XMLTextTableContext.hxx
new file mode 100644
index 000000000000..c0a3df1aa88c
--- /dev/null
+++ b/include/xmloff/XMLTextTableContext.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 _XMLTEXTTABLECONTEXT_HXX
+#define _XMLTEXTTABLECONTEXT_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/uno/Reference.h>
+
+namespace com { namespace sun { namespace star {
+ namespace text { class XTextContent; }
+} } }
+
+#define XML_TEXT_FRAME_TEXTBOX 1
+#define XML_TEXT_FRAME_GRAPHIC 2
+
+class XMLOFF_DLLPUBLIC XMLTextTableContext : public SvXMLImportContext
+{
+
+public:
+
+ TYPEINFO();
+
+ XMLTextTableContext( SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const OUString& rLName );
+ virtual ~XMLTextTableContext();
+
+ virtual ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > GetXTextContent() const = 0;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/animationexport.hxx b/include/xmloff/animationexport.hxx
new file mode 100644
index 000000000000..1ab8e0f9dcd6
--- /dev/null
+++ b/include/xmloff/animationexport.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 _XMLOFF_ANIMATIONEXPORT_HXX
+#define _XMLOFF_ANIMATIONEXPORT_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+
+#include <com/sun/star/animations/XAnimationNode.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <xmloff/uniref.hxx>
+
+class SvXMLExport;
+
+namespace xmloff
+{
+class AnimationsExporterImpl;
+
+class XMLOFF_DLLPUBLIC AnimationsExporter : public UniRefBase
+{
+ AnimationsExporterImpl* mpImpl;
+
+public:
+ AnimationsExporter( SvXMLExport& rExport, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xPageProps );
+ virtual ~AnimationsExporter();
+
+ void prepare( ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > xRootNode );
+ void exportAnimations( ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > xRootNode );
+};
+
+}
+
+#endif // _XMLOFF_ANIMATIONEXPORT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/animexp.hxx b/include/xmloff/animexp.hxx
new file mode 100644
index 000000000000..694433780c5f
--- /dev/null
+++ b/include/xmloff/animexp.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 _XMLOFF_ANIMEXP_HXX
+#define _XMLOFF_ANIMEXP_HXX
+
+#include <com/sun/star/drawing/XShape.hpp>
+#include <xmloff/uniref.hxx>
+
+class AnimExpImpl;
+class SvXMLExport;
+class XMLShapeExport;
+
+class XMLAnimationsExporter : public UniRefBase
+{
+ AnimExpImpl* mpImpl;
+
+public:
+ XMLAnimationsExporter( XMLShapeExport* pShapeExp );
+ virtual ~XMLAnimationsExporter();
+
+ void prepare( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape, SvXMLExport& rExport );
+ void collect( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape, SvXMLExport& rExport );
+ void exportAnimations( SvXMLExport& rExport );
+};
+
+#endif // _XMLOFF_ANIMEXP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/attrlist.hxx b/include/xmloff/attrlist.hxx
new file mode 100644
index 000000000000..cc0d6aa14f65
--- /dev/null
+++ b/include/xmloff/attrlist.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 _XMLOFF_ATTRLIST_HXX
+#define _XMLOFF_ATTRLIST_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <com/sun/star/util/XCloneable.hpp>
+#include <com/sun/star/xml/sax/SAXParseException.hpp>
+#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/SAXException.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/xml/sax/XLocator.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+
+#include <cppuhelper/implbase3.hxx>
+
+struct SvXMLAttributeList_Impl;
+
+class XMLOFF_DLLPUBLIC SvXMLAttributeList : public ::cppu::WeakImplHelper3<
+ ::com::sun::star::xml::sax::XAttributeList,
+ ::com::sun::star::util::XCloneable,
+ ::com::sun::star::lang::XUnoTunnel>
+{
+ SvXMLAttributeList_Impl *m_pImpl;
+
+public:
+ SvXMLAttributeList();
+ SvXMLAttributeList( const SvXMLAttributeList& );
+ SvXMLAttributeList( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList> & rAttrList );
+ ~SvXMLAttributeList();
+
+ static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
+ static SvXMLAttributeList* getImplementation( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ) throw();
+
+ // XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::xml::sax::XAttributeList
+ virtual sal_Int16 SAL_CALL getLength(void) throw( ::com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL getNameByIndex(sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL getTypeByIndex(sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL getTypeByName(const OUString& aName) throw( ::com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL getValueByIndex(sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException );
+ virtual OUString SAL_CALL getValueByName(const OUString& aName) throw( ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::util::XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() throw( ::com::sun::star::uno::RuntimeException );
+
+ // methods that are not contained in any interface
+ void AddAttribute( const OUString &sName , const OUString &sValue );
+ void Clear();
+ void RemoveAttribute( const OUString sName );
+ void AppendAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & );
+ void SetValueByIndex( sal_Int16 i, const OUString& rValue );
+ void RemoveAttributeByIndex( sal_Int16 i );
+ void RenameAttributeByIndex( sal_Int16 i, const OUString& rNewName );
+ sal_Int16 GetIndexByName( const OUString& rName ) const;
+
+ private:
+ const OUString sType; // "CDATA"
+};
+
+
+#endif // _XMLOFF_ATTRLIST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/contextid.hxx b/include/xmloff/contextid.hxx
new file mode 100644
index 000000000000..fd0123d33ac3
--- /dev/null
+++ b/include/xmloff/contextid.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 _XMLOFF_CONTEXTID_HXX_
+#define _XMLOFF_CONTEXTID_HXX_
+
+/** These defines determine the unique ids for XML style-context-id's
+ used in the SvXMLAutoStylePoolP.
+ */
+
+#define XML_SC_CTF_START 0x00001000
+#define XML_SD_CTF_START 0x00002000
+#define XML_TEXT_CTF_START 0x00003000
+#define XML_SCH_CTF_START 0x00004000
+#define XML_PM_CTF_START 0x00005000 // page master
+#define XML_FORM_CTF_START 0x00006000
+#define XML_DB_CTF_START 0x00007000
+
+
+#define CTF_SD_CONTROL_SHAPE_DATA_STYLE ( XML_SD_CTF_START + 1 )
+#define CTF_SD_NUMBERINGRULES_NAME ( XML_SD_CTF_START + 2 )
+#define CTF_SD_SHAPE_PARA_ADJUST ( XML_SD_CTF_START + 3 )
+
+#define CTF_FORMS_DATA_STYLE ( XML_FORM_CTF_START + 0 )
+
+/** use together with MID_FLAG_NO_PROPERTY to import the specified
+ attribute into the alien attribute container */
+
+#define CTF_ALIEN_ATTRIBUTE_IMPORT 0x00007fff
+
+#endif // _XMLOFF_CONTEXTID_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/controlpropertyhdl.hxx b/include/xmloff/controlpropertyhdl.hxx
new file mode 100644
index 000000000000..3e2cbfd51e23
--- /dev/null
+++ b/include/xmloff/controlpropertyhdl.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 _XMLOFF_FORMS_CONTROLPROPERTYHDL_HXX_
+#define _XMLOFF_FORMS_CONTROLPROPERTYHDL_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/prhdlfac.hxx>
+#include <rtl/ref.hxx>
+#include <rtl/ustring.hxx>
+#include <xmloff/xmlexppr.hxx>
+#include <xmloff/XMLConstantsPropertyHandler.hxx>
+
+struct SvXMLEnumMapEntry;
+class Color;
+//.........................................................................
+namespace xmloff
+{
+//.........................................................................
+
+ class IFormsExportContext;
+ class OFormLayerXMLImport_Impl;
+
+ //=====================================================================
+ //= ORotationAngleHandler
+ //=====================================================================
+ class ORotationAngleHandler : public XMLPropertyHandler
+ {
+ public:
+ ORotationAngleHandler();
+
+ virtual sal_Bool importXML( const OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
+ virtual sal_Bool exportXML( OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
+ };
+
+ //=====================================================================
+ //= OFontWidthHandler
+ //=====================================================================
+ class OFontWidthHandler : public XMLPropertyHandler
+ {
+ public:
+ OFontWidthHandler();
+
+ virtual sal_Bool importXML( const OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
+ virtual sal_Bool exportXML( OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
+ };
+
+ //=====================================================================
+ //= OControlBorderHandlerBase
+ //=====================================================================
+ class OControlBorderHandler : public XMLPropertyHandler
+ {
+ public:
+ enum BorderFacet
+ {
+ STYLE,
+ COLOR
+ };
+
+ OControlBorderHandler( const BorderFacet _eFacet );
+
+ virtual sal_Bool importXML( const OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
+ virtual sal_Bool exportXML( OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
+
+ private:
+ BorderFacet m_eFacet;
+ };
+
+ //=====================================================================
+ //= OControlTextEmphasisHandler
+ //=====================================================================
+ class OControlTextEmphasisHandler : public XMLPropertyHandler
+ {
+ public:
+ OControlTextEmphasisHandler();
+
+ virtual sal_Bool importXML( const OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
+ virtual sal_Bool exportXML( OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
+ };
+
+ //=====================================================================
+ //= ImageScaleModeHandler
+ //=====================================================================
+ class XMLOFF_DLLPUBLIC ImageScaleModeHandler : public XMLConstantsPropertyHandler
+ {
+ public:
+ ImageScaleModeHandler();
+ };
+
+ //=====================================================================
+ //= OControlPropertyHandlerFactory
+ //=====================================================================
+ class XMLOFF_DLLPUBLIC OControlPropertyHandlerFactory : public XMLPropertyHandlerFactory
+ {
+ protected:
+ mutable XMLConstantsPropertyHandler* m_pTextAlignHandler;
+ mutable OControlBorderHandler* m_pControlBorderStyleHandler;
+ mutable OControlBorderHandler* m_pControlBorderColorHandler;
+ mutable ORotationAngleHandler* m_pRotationAngleHandler;
+ mutable OFontWidthHandler* m_pFontWidthHandler;
+ mutable XMLConstantsPropertyHandler* m_pFontEmphasisHandler;
+ mutable XMLConstantsPropertyHandler* m_pFontReliefHandler;
+
+ protected:
+ virtual ~OControlPropertyHandlerFactory();
+
+ public:
+ OControlPropertyHandlerFactory();
+
+ virtual const XMLPropertyHandler* GetPropertyHandler(sal_Int32 _nType) const;
+ };
+
+//.........................................................................
+} // namespace xmloff
+//.........................................................................
+
+#endif // _XMLOFF_FORMS_CONTROLPROPERTYHDL_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/dllapi.h b/include/xmloff/dllapi.h
new file mode 100644
index 000000000000..3fcc7b6d1ef2
--- /dev/null
+++ b/include/xmloff/dllapi.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_XMLOFF_DLLAPI_H
+#define INCLUDED_XMLOFF_DLLAPI_H
+
+#include "sal/config.h"
+#include "sal/types.h"
+
+#if defined XMLOFF_DLLIMPLEMENTATION
+#define XMLOFF_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define XMLOFF_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/families.hxx b/include/xmloff/families.hxx
new file mode 100644
index 000000000000..1a16eaa98c62
--- /dev/null
+++ b/include/xmloff/families.hxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _XMLOFF_FAMILIES_HXX_
+#define _XMLOFF_FAMILIES_HXX_
+
+/** These defines determine the unique ids for XML style-families
+ used in the SvXMLAutoStylePoolP.
+ */
+
+// Misc (Pool)
+// reserved: 0..99
+#define XML_STYLE_FAMILY_DATA_STYLE 0
+#define XML_STYLE_FAMILY_DATA_STYLE_NAME "data-style"
+#define XML_STYLE_FAMILY_PAGE_MASTER 1
+#define XML_STYLE_FAMILY_PAGE_MASTER_NAME "page-layout"
+#define XML_STYLE_FAMILY_PAGE_MASTER_PREFIX "pm"
+#define XML_STYLE_FAMILY_MASTER_PAGE 2
+
+// Text
+// reserved: 100..199
+#define XML_STYLE_FAMILY_TEXT_PARAGRAPH 100
+#define XML_STYLE_FAMILY_TEXT_TEXT 101
+#define XML_STYLE_FAMILY_TEXT_LIST 102
+#define XML_STYLE_FAMILY_TEXT_OUTLINE 103
+#define XML_STYLE_FAMILY_TEXT_FOOTNOTECONFIG 105
+#define XML_STYLE_FAMILY_TEXT_ENDNOTECONFIG 106
+#define XML_STYLE_FAMILY_TEXT_SECTION 107
+#define XML_STYLE_FAMILY_TEXT_FRAME 108 // export only
+#define XML_STYLE_FAMILY_TEXT_RUBY 109
+#define XML_STYLE_FAMILY_TEXT_BIBLIOGRAPHYCONFIG 110
+#define XML_STYLE_FAMILY_TEXT_LINENUMBERINGCONFIG 111
+
+// Table
+// reserved: 200..299
+#define XML_STYLE_FAMILY_TABLE_TABLE 200
+#define XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME "table"
+#define XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX "ta"
+#define XML_STYLE_FAMILY_TABLE_COLUMN 202
+#define XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME "table-column"
+#define XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX "co"
+#define XML_STYLE_FAMILY_TABLE_ROW 203
+#define XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME "table-row"
+#define XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX "ro"
+#define XML_STYLE_FAMILY_TABLE_CELL 204
+#define XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME "table-cell"
+#define XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX "ce"
+#define XML_STYLE_FAMILY_TABLE_TEMPLATE_ID 205
+
+// Impress/Draw
+// reserved: 300..399
+#define XML_STYLE_FAMILY_SD_GRAPHICS_ID 300
+#define XML_STYLE_FAMILY_SD_GRAPHICS_NAME "graphic"
+#define XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX "gr"
+
+#define XML_STYLE_FAMILY_SD_PRESENTATION_ID 301
+#define XML_STYLE_FAMILY_SD_PRESENTATION_NAME "presentation"
+#define XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX "pr"
+// families for derived from SvXMLStyleContext
+#define XML_STYLE_FAMILY_SD_PAGEMASTERCONEXT_ID 302
+#define XML_STYLE_FAMILY_SD_PAGEMASTERSTYLECONEXT_ID 306
+#define XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID 303
+// family for draw pool
+#define XML_STYLE_FAMILY_SD_POOL_ID 304
+#define XML_STYLE_FAMILY_SD_POOL_NAME "default"
+// family for presentation drawpage properties
+#define XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID 305
+#define XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME "drawing-page"
+#define XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX "dp"
+
+#define XML_STYLE_FAMILY_SD_GRADIENT_ID 306
+#define XML_STYLE_FAMILY_SD_HATCH_ID 307
+#define XML_STYLE_FAMILY_SD_FILL_IMAGE_ID 308
+#define XML_STYLE_FAMILY_SD_MARKER_ID 309
+#define XML_STYLE_FAMILY_SD_STROKE_DASH_ID 310
+
+// Chart
+// reserved: 400..499
+#define XML_STYLE_FAMILY_SCH_CHART_ID 400
+#define XML_STYLE_FAMILY_SCH_CHART_NAME "chart"
+#define XML_STYLE_FAMILY_SCH_CHART_PREFIX "ch"
+
+// Math
+// reserved: 500..599
+
+
+// Forms/Controls
+// reserved 600..649
+#define XML_STYLE_FAMILY_CONTROL_ID 600
+#define XML_STYLE_FAMILY_CONTROL_NAME "control"
+#define XML_STYLE_FAMILY_CONTROL_PREFIX "ctrl"
+
+#endif // _XMLOFF_FAMILIES_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/formlayerexport.hxx b/include/xmloff/formlayerexport.hxx
new file mode 100644
index 000000000000..5774988f42d8
--- /dev/null
+++ b/include/xmloff/formlayerexport.hxx
@@ -0,0 +1,189 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_FORMLAYEREXPORT_HXX_
+#define _XMLOFF_FORMLAYEREXPORT_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <rtl/ref.hxx>
+#include <salhelper/simplereferenceobject.hxx>
+#include <xmloff/xmlexppr.hxx>
+
+namespace com { namespace sun { namespace star { namespace awt {
+ class XControlModel;
+} } } }
+
+class SvXMLExport;
+//.........................................................................
+namespace xmloff
+{
+//.........................................................................
+
+ class OFormLayerXMLExport_Impl;
+ class OFormsRootExport;
+
+ //=====================================================================
+ //= OFormLayerXMLExport
+ //=====================================================================
+ /** provides functionallity for exporting a complete form layer.
+ */
+ class XMLOFF_DLLPUBLIC OFormLayerXMLExport
+ :public ::salhelper::SimpleReferenceObject
+ {
+ protected:
+ /// our export context
+ SvXMLExport& m_rContext;
+ // impl class
+ OFormLayerXMLExport_Impl* m_pImpl;
+
+ protected:
+ ~OFormLayerXMLExport();
+
+ public:
+ OFormLayerXMLExport(SvXMLExport& _rContext);
+
+ /** initializes some internal structures for fast access to the given page
+
+ <p>This method has to be called before you use getControlId for controls on the given page.
+ This way a performance optimization can be done for faster access to the control ids</p>
+
+ @return
+ <TRUE/> if the page has been examined before. If <FALSE/> is returned, this is a serious error.
+
+ @see getControlId
+ @see examineForms
+ */
+ sal_Bool seekPage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage);
+
+ /** get the id for the given control
+
+ <p>The page the control belongs to must have been examined and sought to.</p>
+
+ @param _rxControl
+ the control which's id should be retrieved. Must not be <NULL/>.
+
+ @see examineForms
+ @see seekPage
+
+ */
+ OUString getControlId(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl);
+
+ /** retrieves the style name for the control's number style.
+
+ <p>For performance reasons, this method is allowed to be called for any controls, even those which
+ do not have a number style. In this case, an empty string is returned.</p>
+
+ @param _rxControl
+ the control which's id should be retrieved. Must not be <NULL/>.
+
+ @see examineForms
+ @see seekPage
+ */
+ OUString getControlNumberStyle(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl );
+
+ /** examines the forms collection given.
+
+ <p>This method will collect all form layer related data of the given draw page</p>
+
+ @param _rxDrawPage
+ the draw page to examine. The object will be queried for a <type scope="com.sun.star.form">XFormsSupplier</type>
+ interface to obtain the forms container.
+ */
+ void examineForms(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage);
+
+ /** exports the structure of a form layer
+
+ <p>This method does not export styles (e.g. font properties of the controls), or any references
+ external instances may have to the control models contained in the form layer (e.g. uno control
+ shapes in the drawing layer may have such references)</p>
+
+ <p>No top level element describing the whole collection is inserted. I.e. if within your document, you
+ expect the forms collection to be stored like
+ <listing>
+ &lt;Forms&gt;
+ .... // all the forms stuff here
+ &lt;/Forms&gt;
+ </listing>
+ you have to start the Forms element yourself.</p>
+
+ @param _rxDrawPage
+ the draw page to examine. The object will be queried for a <type scope="com.sun.star.form">XFormsSupplier</type>
+ interface to obtain the forms container.
+ */
+ void exportForms(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage);
+
+ /** exports the XForms model data
+ */
+ void exportXForms() const;
+
+ /** determines whether the given page contains logical forms
+ */
+ bool pageContainsForms( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage ) const;
+
+ /** determines whether the given page contains XForm instances
+ */
+ bool documentContainsXForms() const;
+
+ /** exports the automatic controls number styles
+ */
+ void exportAutoControlNumberStyles();
+
+ /** exports the auto-styles collected during the examineForms calls
+ */
+ void exportAutoStyles();
+
+ /** exclude the given control (model) from export.
+
+ <p>If your document contains form controls which are not to be exported for whatever reason,
+ you need to announce the models of these controls (can be retrieved from XControlShape::getControl)
+ to the form layer exporter.<br/>
+ Of course you have to do this before calling <member>exportForms</member></p>
+ */
+ void excludeFromExport( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > _rxControl );
+ };
+
+ //=========================================================================
+ //= OOfficeFormsExport
+ //=========================================================================
+ /// export helper for the office::forms element
+ class XMLOFF_DLLPUBLIC OOfficeFormsExport
+ {
+ private:
+ OFormsRootExport* m_pImpl;
+
+ public:
+ OOfficeFormsExport( SvXMLExport& _rExp );
+ ~OOfficeFormsExport();
+ };
+
+//.........................................................................
+} // namespace xmloff
+//.........................................................................
+
+#endif // _XMLOFF_FORMLAYEREXPORT_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/formlayerimport.hxx b/include/xmloff/formlayerimport.hxx
new file mode 100644
index 000000000000..9a05b73c9ec0
--- /dev/null
+++ b/include/xmloff/formlayerimport.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 _XMLOFF_FORMLAYERIMPORT_HXX_
+#define _XMLOFF_FORMLAYERIMPORT_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <rtl/ref.hxx>
+#include <salhelper/simplereferenceobject.hxx>
+#include <xmloff/xmlimppr.hxx>
+
+class SvXMLImport;
+class SvXMLImportContext;
+class SvXMLStylesContext;
+class XMLPropStyleContext;
+
+//.........................................................................
+namespace xmloff
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OFormLayerXMLImport
+ //=====================================================================
+ class OFormLayerXMLImport_Impl;
+ /** allows you to import a &lt;form:form&gt; element
+ */
+ class XMLOFF_DLLPUBLIC OFormLayerXMLImport
+ :public ::salhelper::SimpleReferenceObject
+ {
+ OFormLayerXMLImport_Impl* m_pImpl;
+
+ public:
+ OFormLayerXMLImport(SvXMLImport& _rImporter);
+ ~OFormLayerXMLImport();
+
+ /** start importing the forms of the given page
+
+ <p>starting the import of a new page (by using this method) invalidates the current page position.</p>
+
+ @see endPage
+ */
+ void startPage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage);
+
+ /** creates an import context for the office:forms element
+ */
+ SvXMLImportContext* createOfficeFormsContext(
+ SvXMLImport& _rImport,
+ sal_uInt16 _nPrefix,
+ const OUString& _rLocalName);
+
+ /** create an <type>SvXMLImportContext</type> instance which is able to import the &lt;form:form&gt;
+ element.
+
+ <p>You must have called <method>startPage</method> before you can create such an import context.</p>
+
+ @see startPage
+ @see endPage
+ */
+ SvXMLImportContext* createContext(
+ const sal_uInt16 _nPrefix,
+ const OUString& _rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttribs);
+
+ /** lookup a control given by id.
+
+ <p>The control must be part of the page which is currently beeing imported.</p>
+
+ <p>(And, of course, the control must have been imported already at the moment you call this.)</p>
+
+ @see startPage
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+ lookupControl(const OUString& _rId);
+
+ /** end importing the forms of the current page
+
+ <p>You must call this method if you want the import to be finished correctly. Without calling
+ it, you will lose information.</p>
+
+ @see startPage
+ */
+ void endPage();
+
+ /** announces the auto-style context to the form importer
+ */
+ void setAutoStyleContext(SvXMLStylesContext* _pNewContext);
+
+ /** sets the given number style on the given control
+ @param _rxControlModel
+ the control model which's style is to be set
+ @param _rControlNumerStyleName
+ the style name for the control's number style
+ */
+ void applyControlNumberStyle(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
+ const OUString& _rControlNumerStyleName
+ );
+
+ /** to be called when the document has been completely imported
+
+ <p>For some documents (currently: only some spreadsheet documents) it's necessary
+ do to a post processing, since not all information from the file can be processed
+ if the document is not completed, yet.</p>
+ */
+ void documentDone( );
+ };
+
+//.........................................................................
+} // namespace xmloff
+//.........................................................................
+
+#endif // _XMLOFF_FORMLAYERIMPORT_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/i18nmap.hxx b/include/xmloff/i18nmap.hxx
new file mode 100644
index 000000000000..22b8ad862a29
--- /dev/null
+++ b/include/xmloff/i18nmap.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 _XMLOFF_I18NMAP_HXX
+#define _XMLOFF_I18NMAP_HXX
+
+#include <sal/config.h>
+#include "xmloff/dllapi.h"
+#include <rtl/ustring.hxx>
+#include <tools/solar.h>
+#include <map>
+
+class SvI18NMapEntry_Key
+{
+ sal_uInt16 nKind;
+ OUString aName;
+public:
+ SvI18NMapEntry_Key( sal_uInt16 nKnd, const OUString& rName ) :
+ nKind( nKnd ),
+ aName( rName )
+ {
+ }
+
+ sal_Bool operator==( const SvI18NMapEntry_Key& r ) const
+ {
+ return nKind == r.nKind &&
+ aName == r.aName;
+ }
+
+ sal_Bool operator<( const SvI18NMapEntry_Key& r ) const
+ {
+ return nKind < r.nKind ||
+ ( nKind == r.nKind &&
+ aName < r.aName);
+ }
+};
+
+typedef std::map<SvI18NMapEntry_Key, OUString> SvI18NMap_Impl;
+
+class XMLOFF_DLLPUBLIC SvI18NMap
+{
+ SvI18NMap_Impl m_aMap;
+
+public:
+ // Add a name mapping
+ bool Add( sal_uInt16 nKind, const OUString& rName,
+ const OUString& rNewName );
+
+ // Return a mapped name. If the name could not be found, return the
+ // original name.
+ const OUString& Get( sal_uInt16 nKind,
+ const OUString& rName ) const;
+};
+
+#endif // _XMLOFF_I18NMAP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/maptype.hxx b/include/xmloff/maptype.hxx
new file mode 100644
index 000000000000..1f19ad464d60
--- /dev/null
+++ b/include/xmloff/maptype.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 _XMLOFF_PROPMAPPINGTYPES_HXX
+#define _XMLOFF_PROPMAPPINGTYPES_HXX
+
+#include <tools/solar.h>
+#include <com/sun/star/uno/Any.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <unotools/saveopt.hxx>
+
+///////////////////////////////////////////////////////////////////////////
+//
+/** Represents a property with its API-name, its XML-name and the type of
+ its value.
+*/
+struct XMLPropertyMapEntry
+{
+ const sal_Char* msApiName; /// Property-Name
+ sal_Int32 nApiNameLength; /// length of property name
+ sal_uInt16 mnNameSpace; /** declares the Namespace in wich this
+ property exists */
+ enum ::xmloff::token::XMLTokenEnum meXMLName; /// XML-Name
+ sal_uInt32 mnType; /** Bit 0..23 : XML-Type of its value
+ Bit 24..31: The flags specifies
+ additional rules how
+ to im/export the porperty */
+ sal_Int16 mnContextId; /// User defined id for context filtering
+ SvtSaveOptions::ODFDefaultVersion mnEarliestODFVersionForExport;// no export when the used ODF version is lower than this
+};
+
+///////////////////////////////////////////////////////////////////////////
+//
+/** Smart struct to transport an Any with an index to the appropriate
+ property-name
+*/
+struct XMLPropertyState
+{
+ sal_Int32 mnIndex;
+ ::com::sun::star::uno::Any maValue;
+
+ XMLPropertyState( sal_Int32 nIndex )
+ : mnIndex( nIndex ) {}
+ XMLPropertyState( sal_Int32 nIndex, const ::com::sun::star::uno::Any& rValue )
+ : mnIndex( nIndex ), maValue( rValue ) {}
+ XMLPropertyState( const XMLPropertyState& rPropState )
+ : mnIndex( rPropState.mnIndex ), maValue( rPropState.maValue ) {}
+};
+
+#endif // _XMLOFF_PROPMAPPINGTYPES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/nmspmap.hxx b/include/xmloff/nmspmap.hxx
new file mode 100644
index 000000000000..fe7492cf5e75
--- /dev/null
+++ b/include/xmloff/nmspmap.hxx
@@ -0,0 +1,170 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_NMSPMAP_HXX
+#define _XMLOFF_NMSPMAP_HXX
+
+#include "sal/config.h"
+
+#include <map>
+#include <utility>
+
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <rtl/ustring.hxx>
+#include <boost/unordered_map.hpp>
+#include <rtl/ref.hxx>
+#include <cppuhelper/weak.hxx>
+
+#include <limits.h>
+
+const sal_uInt16 XML_NAMESPACE_XMLNS = (USHRT_MAX-2);
+const sal_uInt16 XML_NAMESPACE_NONE = (USHRT_MAX-1);
+const sal_uInt16 XML_NAMESPACE_UNKNOWN = (USHRT_MAX);
+const sal_uInt16 XML_NAMESPACE_UNKNOWN_FLAG = 0x8000;
+
+class NameSpaceEntry : public cppu::OWeakObject
+{
+public:
+ // sName refers to the full namespace name
+ OUString sName;
+ // sPrefix is the prefix used to declare a given item to be from a given namespace
+ OUString sPrefix;
+ // nKey is the unique identifier of a namespace
+ sal_uInt16 nKey;
+};
+
+struct OUStringEqFunc
+{
+ sal_Bool operator()( const OUString &r1,
+ const OUString &r2) const
+ {
+ return r1 == r2;
+ }
+};
+
+struct uInt32lt
+{
+ sal_Bool operator()( const sal_uInt32 &r1,
+ const sal_uInt32 &r2) const
+ {
+ return r1 < r2;
+ }
+};
+typedef ::std::pair < sal_uInt16, OUString > QNamePair;
+
+struct QNamePairHash
+{
+ size_t operator()( const QNamePair &r1 ) const
+ {
+ return (size_t) r1.second.hashCode() + r1.first;
+ }
+};
+
+typedef ::boost::unordered_map < QNamePair, OUString, QNamePairHash > QNameCache;
+typedef ::boost::unordered_map < OUString, ::rtl::Reference <NameSpaceEntry >, OUStringHash, OUStringEqFunc > NameSpaceHash;
+typedef ::std::map < sal_uInt16, ::rtl::Reference < NameSpaceEntry >, uInt32lt > NameSpaceMap;
+
+class XMLOFF_DLLPUBLIC SvXMLNamespaceMap
+{
+ const OUString sXMLNS;
+ const OUString sEmpty;
+
+ NameSpaceHash aNameHash;
+ mutable NameSpaceHash aNameCache;
+ NameSpaceMap aNameMap;
+ mutable QNameCache aQNameCache;
+ SAL_DLLPRIVATE sal_uInt16 _Add( const OUString& rPrefix, const OUString &rName, sal_uInt16 nKey );
+
+public:
+
+ SvXMLNamespaceMap();
+ ~SvXMLNamespaceMap();
+
+ SvXMLNamespaceMap( const SvXMLNamespaceMap& );
+
+ void operator =( const SvXMLNamespaceMap& rCmp );
+ int operator ==( const SvXMLNamespaceMap& rCmp ) const;
+
+ sal_uInt16 Add( const OUString& rPrefix,
+ const OUString& rName,
+ sal_uInt16 nKey = XML_NAMESPACE_UNKNOWN );
+ sal_uInt16 AddIfKnown( const OUString& rPrefix,
+ const OUString& rName );
+
+ sal_uInt16 GetKeyByName( const OUString& rName ) const;
+ const OUString& GetNameByKey( sal_uInt16 nKey ) const;
+
+ sal_uInt16 GetKeyByPrefix( const OUString& rPrefix ) const;
+ const OUString& GetPrefixByKey( sal_uInt16 nKey ) const;
+
+ OUString GetQNameByKey( sal_uInt16 nKey,
+ const OUString& rLocalName,
+ sal_Bool bCache = sal_True) const;
+
+ OUString GetAttrNameByKey( sal_uInt16 nKey ) const;
+
+ /* This will replace the version with the unused 5th default parameter */
+ sal_uInt16 _GetKeyByAttrName( const OUString& rAttrName,
+ OUString *pPrefix,
+ OUString *pLocalName,
+ OUString *pNamespace = 0,
+ sal_Bool bCache = sal_True) const;
+
+ /* This will replace the version with the unused 3rd default parameter */
+ sal_uInt16 _GetKeyByAttrName( const OUString& rAttrName,
+ OUString *pLocalName = 0,
+ sal_Bool bCache = sal_True) const;
+
+ sal_uInt16 GetFirstKey() const;
+ sal_uInt16 GetNextKey( sal_uInt16 nOldKey ) const;
+
+ /* Give access to all namespace definitions, including multiple entries
+ for the same key (needed for saving sheets separately in Calc).
+ This might be replaced by a better interface later. */
+ const NameSpaceHash& GetAllEntries() const { return aNameHash; }
+
+ static sal_Bool NormalizeOasisURN( OUString& rName );
+ static sal_Bool NormalizeW3URI( OUString& rName );
+ static sal_Bool NormalizeURI( OUString& rName );
+
+/* deprecated */ sal_Bool AddAtIndex( sal_uInt16 nIdx, const OUString& rPrefix,
+ const OUString& rName, sal_uInt16 nKey = XML_NAMESPACE_UNKNOWN );
+/* deprecated */ sal_uInt16 GetIndexByKey( sal_uInt16 nKey ) const;
+/* deprecated */ sal_uInt16 GetIndexByPrefix( const OUString& rPrefix ) const;
+/* deprecated */ sal_uInt16 GetFirstIndex() const;
+/* deprecated */ sal_uInt16 GetNextIndex( sal_uInt16 nOldIdx ) const;
+/* deprecated */ const OUString& GetPrefixByIndex( sal_uInt16 nIdx ) const;
+/* deprecated */ const OUString& GetNameByIndex( sal_uInt16 nIdx ) const;
+/* deprecated */ OUString GetAttrNameByIndex( sal_uInt16 nIdx ) const;
+/* deprecated */ OUString GetQNameByIndex( sal_uInt16 nIdx,
+ const OUString& rLocalName ) const;
+/* deprecated */ sal_uInt16 GetKeyByAttrName( const OUString& rAttrName,
+ OUString *pPrefix,
+ OUString *pLocalName,
+ OUString *pNamespace=0,
+ sal_uInt16 nIdxGuess = USHRT_MAX ) const;
+/* deprecated */ sal_uInt16 GetKeyByAttrName( const OUString& rAttrName,
+ OUString *pLocalName = 0,
+ sal_uInt16 nIdxGuess = USHRT_MAX ) const;
+};
+
+#endif // _XMLOFF_NMSPMAP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/numehelp.hxx b/include/xmloff/numehelp.hxx
new file mode 100644
index 000000000000..9f0bac4f9e4b
--- /dev/null
+++ b/include/xmloff/numehelp.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 XMLOFF_NUMEHELP_HXX
+#define XMLOFF_NUMEHELP_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <sal/types.h>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+
+#include <set>
+
+class SvXMLExport;
+
+struct XMLNumberFormat
+{
+ OUString sCurrency;
+ sal_Int32 nNumberFormat;
+ sal_Int16 nType;
+ sal_Bool bIsStandard : 1;
+ XMLNumberFormat() : nNumberFormat(0), nType(0) {}
+ XMLNumberFormat(const OUString& sTempCurrency, sal_Int32 nTempFormat,
+ sal_Int16 nTempType) : sCurrency(sTempCurrency), nNumberFormat(nTempFormat),
+ nType(nTempType) {}
+};
+
+struct LessNumberFormat
+{
+ sal_Bool operator() (const XMLNumberFormat& rValue1, const XMLNumberFormat& rValue2) const
+ {
+ return rValue1.nNumberFormat < rValue2.nNumberFormat;
+ }
+};
+
+typedef std::set<XMLNumberFormat, LessNumberFormat> XMLNumberFormatSet;
+
+class XMLOFF_DLLPUBLIC XMLNumberFormatAttributesExportHelper
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > xNumberFormats;
+ SvXMLExport* pExport;
+ const OUString sEmpty;
+ const OUString sStandardFormat;
+ const OUString sType;
+ const OUString sAttrValueType;
+ const OUString sAttrValue;
+ const OUString sAttrDateValue;
+ const OUString sAttrTimeValue;
+ const OUString sAttrBooleanValue;
+ const OUString sAttrStringValue;
+ const OUString sAttrCurrency;
+ const OUString msCurrencySymbol;
+ const OUString msCurrencyAbbreviation;
+ XMLNumberFormatSet aNumberFormats;
+public :
+ XMLNumberFormatAttributesExportHelper(::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier);
+ XMLNumberFormatAttributesExportHelper(::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier,
+ SvXMLExport& rExport );
+ ~XMLNumberFormatAttributesExportHelper();
+ void SetExport(SvXMLExport* pExp) { this->pExport = pExp; }
+
+ sal_Int16 GetCellType(const sal_Int32 nNumberFormat, OUString& sCurrency, bool& bIsStandard);
+ static void WriteAttributes(SvXMLExport& rXMLExport,
+ const sal_Int16 nTypeKey,
+ const double& rValue,
+ const OUString& rCurrencySymbol,
+ sal_Bool bExportValue = sal_True);
+ static sal_Bool GetCurrencySymbol(const sal_Int32 nNumberFormat, OUString& rCurrencySymbol,
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & xNumberFormatsSupplier);
+ static sal_Int16 GetCellType(const sal_Int32 nNumberFormat, sal_Bool& bIsStandard,
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & xNumberFormatsSupplier);
+ static void SetNumberFormatAttributes(SvXMLExport& rXMLExport,
+ const sal_Int32 nNumberFormat,
+ const double& rValue,
+ sal_Bool bExportValue = sal_True);
+ static void SetNumberFormatAttributes(SvXMLExport& rXMLExport,
+ const OUString& rValue,
+ const OUString& rCharacters,
+ sal_Bool bExportValue = sal_True,
+ sal_Bool bExportTypeAttribute = sal_True);
+
+ sal_Bool GetCurrencySymbol(const sal_Int32 nNumberFormat, OUString& rCurrencySymbol);
+ sal_Int16 GetCellType(const sal_Int32 nNumberFormat, bool& bIsStandard);
+ void WriteAttributes(const sal_Int16 nTypeKey,
+ const double& rValue,
+ const OUString& rCurrencySymbol,
+ sal_Bool bExportValue = sal_True);
+ void SetNumberFormatAttributes(const sal_Int32 nNumberFormat,
+ const double& rValue,
+ sal_Bool bExportValue = sal_True);
+ void SetNumberFormatAttributes(const OUString& rValue,
+ const OUString& rCharacters,
+ sal_Bool bExportValue = sal_True,
+ sal_Bool bExportTypeAttribute = sal_True);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/odffields.hxx b/include/xmloff/odffields.hxx
new file mode 100644
index 000000000000..a116350db999
--- /dev/null
+++ b/include/xmloff/odffields.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 .
+ */
+
+/*
+ * Copyright 2008 by Novell, Inc.
+ */
+
+#ifndef _ODFFIELDS_HXX
+#define _ODFFIELDS_HXX
+
+
+#define ODF_FORMTEXT "vnd.oasis.opendocument.field.FORMTEXT"
+
+#define ODF_FORMCHECKBOX "vnd.oasis.opendocument.field.FORMCHECKBOX"
+#define ODF_FORMCHECKBOX_HELPTEXT "Checkbox_HelpText"
+#define ODF_FORMCHECKBOX_NAME "Checkbox_Name"
+#define ODF_FORMCHECKBOX_RESULT "Checkbox_Checked"
+
+#define ODF_FORMDROPDOWN "vnd.oasis.opendocument.field.FORMDROPDOWN"
+#define ODF_FORMDROPDOWN_LISTENTRY "Dropdown_ListEntry"
+#define ODF_FORMDROPDOWN_RESULT "Dropdown_Selected"
+
+#define ODF_TOC "vnd.oasis.opendocument.field.TOC"
+
+#define ODF_HYPERLINK "vnd.oasis.opendocument.field.HYPERLINK"
+
+#define ODF_PAGEREF "vnd.oasis.opendocument.field.PAGEREF"
+
+#define ODF_UNHANDLED "vnd.oasis.opendocument.field.UNHANDLED"
+#define ODF_OLE_PARAM "vnd.oasis.opendocument.field.ole"
+#define ODF_ID_PARAM "vnd.oasis.opendocument.field.id"
+#define ODF_CODE_PARAM "vnd.oasis.opendocument.field.code"
+#define ODF_COMMENTRANGE "vnd.oasis.opendocument.field.COMMENTRANGE"
+
+#endif /* _ODFFIELDS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/prhdlfac.hxx b/include/xmloff/prhdlfac.hxx
new file mode 100644
index 000000000000..afd3472d111c
--- /dev/null
+++ b/include/xmloff/prhdlfac.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 _XMLOFF_PROPERTYHANDLERFACTORY_HXX
+#define _XMLOFF_PROPERTYHANDLERFACTORY_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+
+#include <map>
+#include <xmloff/uniref.hxx>
+#include <xmloff/xmlprhdl.hxx>
+
+/**
+ This class is a base-class to create XMLPropertyHandler.
+ It creates PropertyHandler for given XML-types and store
+ them in an internal cache. They'll be deleted at destruction-
+ time.
+ For create your own PropertyHandler for specific XML-types
+ you have to override the virtual method GetPropertyHandler
+ ( see below ).
+*/
+class XMLOFF_DLLPUBLIC XMLPropertyHandlerFactory : public UniRefBase
+{
+public:
+ virtual ~XMLPropertyHandlerFactory();
+
+ /**
+ This method retrieves a PropertyHandler for the given XML-type.
+ To extend this method for more XML-types override this method
+ like the example below. If you call the method of the base-class
+ you get propertyhandler for basic-XML-types ( e.g. for color, percent, ... ).
+ Afetr that you could create your new XML-types. After creating a new type
+ you have to put the pointer into the cache via the method
+ PutHdlCache( sal_Int32 , XMLPropertyHandler* ).
+
+ virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const
+ {
+ XMLPropertyHandler* pHdl = XMLPropertyHandlerFactory::GetPropertyHandler( nType );
+
+ if( !pHdl )
+ {
+ switch( nType )
+ {
+ case XML_TYPE_XYZ :
+ pHdl = new XML_xyz_PropHdl;
+ break;
+ case ...
+ :
+ :
+ }
+
+ if( pHdl )
+ PutHdlCache( nType, pHdl );
+ }
+
+ return pHdl;
+ }
+ */
+ virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const;
+
+ /** helper method to statically create a property handler; this will not
+ * use the handler cache. This method should only be called in special
+ * circumstances; calling GetPropertyHandler is almost always
+ * preferable. */
+ static const XMLPropertyHandler* CreatePropertyHandler( sal_Int32 nType );
+
+protected:
+ /** Retrieves a PropertyHandler from the internal cache */
+ XMLPropertyHandler* GetHdlCache( sal_Int32 nType ) const;
+ /** Puts a PropertyHandler into the internal cache */
+ void PutHdlCache( sal_Int32 nType, const XMLPropertyHandler* pHdl ) const;
+
+private:
+ /** Retrieves ( creates if necessary ) PropertyHandler for
+ basic XML-types */
+ SAL_DLLPRIVATE const XMLPropertyHandler* GetBasicHandler( sal_Int32 nType )
+ const;
+
+ typedef ::std::map< sal_Int32, XMLPropertyHandler* > CacheMap;
+ CacheMap maHandlerCache;
+};
+
+#endif // _XMLOFF_PROPERTYHANDLERFACTORY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/prstylei.hxx b/include/xmloff/prstylei.hxx
new file mode 100644
index 000000000000..3ec8114c6507
--- /dev/null
+++ b/include/xmloff/prstylei.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 _XMLOFF_PRSTYLEI_HXX_
+#define _XMLOFF_PRSTYLEI_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/style/XStyle.hpp>
+#include <vector>
+#include <xmloff/xmlstyle.hxx>
+
+struct XMLPropertyState;
+class SvXMLStylesContext;
+
+namespace com { namespace sun { namespace star {
+ namespace beans { class XPropertySet; }
+} } }
+
+class XMLOFF_DLLPUBLIC XMLPropStyleContext : public SvXMLStyleContext
+{
+ const OUString msIsPhysical;
+ const OUString msFollowStyle;
+ ::std::vector< XMLPropertyState > maProperties;
+ ::com::sun::star::uno::Reference < ::com::sun::star::style::XStyle > mxStyle;
+ SvXMLImportContextRef mxStyles;
+
+ SAL_DLLPRIVATE XMLPropStyleContext(XMLPropStyleContext &); // not defined
+ SAL_DLLPRIVATE void operator =(XMLPropStyleContext &); // not defined
+
+protected:
+
+ virtual void SetAttribute( sal_uInt16 nPrefixKey,
+ const OUString& rLocalName,
+ const OUString& rValue );
+ SvXMLStylesContext *GetStyles() { return (SvXMLStylesContext *)&mxStyles; }
+ ::std::vector< XMLPropertyState > & GetProperties() { return maProperties; }
+
+ // This methos my be overloaded to create a new style. Its called by
+ // CreateInsert to create a style if a style with the requested family and
+ // name couldn't be found. The st
+ virtual ::com::sun::star::uno::Reference <
+ ::com::sun::star::style::XStyle > Create();
+
+public:
+
+ TYPEINFO();
+
+ XMLPropStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
+ SvXMLStylesContext& rStyles, sal_uInt16 nFamily = 0,
+ sal_Bool bDefaultStyle=sal_False );
+ virtual ~XMLPropStyleContext();
+
+ virtual SvXMLImportContext *CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ virtual void FillPropertySet(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > & rPropSet );
+
+ const SvXMLStylesContext *GetStyles() const { return (const SvXMLStylesContext *)&mxStyles; }
+ const ::std::vector< XMLPropertyState > & GetProperties() const { return maProperties; }
+
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::style::XStyle >&
+ GetStyle() const { return mxStyle; }
+ void SetStyle(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::style::XStyle >& xStl) { mxStyle = xStl; }
+
+ virtual void SetDefaults();
+
+ virtual void CreateAndInsert( sal_Bool bOverwrite );
+ virtual void Finish( sal_Bool bOverwrite );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/settingsstore.hxx b/include/xmloff/settingsstore.hxx
new file mode 100644
index 000000000000..b9f5f04c45bd
--- /dev/null
+++ b/include/xmloff/settingsstore.hxx
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2011 Novell, Inc. <michael.meeks@novell.com> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+// Simple interface to allow serialization of document settings
+
+#ifndef _XMLOFF_SETTINGS_STORE_HXX
+#define _XMLOFF_SETTINGS_STORE_HXX
+
+#include <vector>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+
+// Scans list of properties for certain URL properties that could refer
+// to internal objects, and initializes from these.
+class DocumentSettingsSerializer {
+public:
+ // Import objects and update properties (eliding URLs)
+ virtual com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
+ filterStreamsFromStorage(
+ const com::sun::star::uno::Reference< com::sun::star::embed::XStorage > &xStorage,
+ const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aConfigProps ) = 0;
+ // Export objects and update properties with relative URLs into this storage
+ virtual com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
+ filterStreamsToStorage(
+ const com::sun::star::uno::Reference< com::sun::star::embed::XStorage > &xStorage,
+ const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aConfigProps ) = 0;
+
+protected:
+ ~DocumentSettingsSerializer() {}
+};
+
+#endif // _XMLOFF_SETTINGS_STORE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/shapeexport.hxx b/include/xmloff/shapeexport.hxx
new file mode 100644
index 000000000000..8dfaa0f89d5e
--- /dev/null
+++ b/include/xmloff/shapeexport.hxx
@@ -0,0 +1,331 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _XMLOFF_SHAPEEXPORT_HXX_
+#define _XMLOFF_SHAPEEXPORT_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+
+#include <rtl/ref.hxx>
+#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <xmloff/uniref.hxx>
+
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+
+#include <map>
+#include <xmloff/xmlprmap.hxx>
+#include <xmloff/xmlexppr.hxx>
+#include <xmloff/animexp.hxx>
+#include <xmloff/families.hxx>
+
+#include "xmloff/table/XMLTableExport.hxx"
+
+// shape export features are bits used for the nFeature
+// parameter of XMLShapeExport::exportShape
+
+#define SEF_EXPORT_X 0x0001
+#define SEF_EXPORT_Y 0x0002
+#define SEF_EXPORT_POSITION 0x0003
+
+#define SEF_EXPORT_WIDTH 0x0004
+#define SEF_EXPORT_HEIGHT 0x0008
+#define SEF_EXPORT_SIZE 0x000c
+
+// when you set this flag a chart does NOT export its own data as table element
+#define SEF_EXPORT_NO_CHART_DATA 0x0010
+
+// When setting the flag below no ignorableWhiteSpace will be called around
+// the drawing object elements
+#define SEF_EXPORT_NO_WS 0x0020
+
+// When setting the flag below a callout shape is exported as office:annotation
+#define SEF_EXPORT_ANNOTATION 0x0040
+
+#define SEF_DEFAULT SEF_EXPORT_POSITION|SEF_EXPORT_SIZE
+
+enum XmlShapeType
+{
+ XmlShapeTypeUnknown, // not known
+
+ XmlShapeTypeDrawRectangleShape, // "com.sun.star.drawing.RectangleShape"
+ XmlShapeTypeDrawEllipseShape, // "com.sun.star.drawing.EllipseShape"
+ XmlShapeTypeDrawControlShape, // "com.sun.star.drawing.ControlShape"
+ XmlShapeTypeDrawConnectorShape, // "com.sun.star.drawing.ConnectorShape"
+ XmlShapeTypeDrawMeasureShape, // "com.sun.star.drawing.MeasureShape"
+ XmlShapeTypeDrawLineShape, // "com.sun.star.drawing.LineShape"
+ XmlShapeTypeDrawPolyPolygonShape, // "com.sun.star.drawing.PolyPolygonShape"
+ XmlShapeTypeDrawPolyLineShape, // "com.sun.star.drawing.PolyLineShape"
+ XmlShapeTypeDrawOpenBezierShape, // "com.sun.star.drawing.OpenBezierShape"
+ XmlShapeTypeDrawClosedBezierShape, // "com.sun.star.drawing.ClosedBezierShape"
+ XmlShapeTypeDrawGraphicObjectShape, // "com.sun.star.drawing.GraphicObjectShape"
+ XmlShapeTypeDrawGroupShape, // "com.sun.star.drawing.GroupShape"
+ XmlShapeTypeDrawTextShape, // "com.sun.star.drawing.TextShape"
+ XmlShapeTypeDrawOLE2Shape, // "com.sun.star.drawing.OLE2Shape"
+ XmlShapeTypeDrawChartShape, // embedded com.sun.star.chart
+ XmlShapeTypeDrawSheetShape, // embedded com.sun.star.sheet
+ XmlShapeTypeDrawPageShape, // "com.sun.star.drawing.PageShape"
+ XmlShapeTypeDrawFrameShape, // "com.sun.star.drawing.FrameShape"
+ XmlShapeTypeDrawCaptionShape, // "com.sun.star.drawing.CaptionShape"
+ XmlShapeTypeDrawAppletShape, // "com.sun.star.drawing.AppletShape"
+ XmlShapeTypeDrawPluginShape, // "com.sun.star.drawing.PlugginShape"
+
+ XmlShapeTypeDraw3DSceneObject, // "com.sun.star.drawing.Shape3DSceneObject"
+ XmlShapeTypeDraw3DCubeObject, // "com.sun.star.drawing.Shape3DCubeObject"
+ XmlShapeTypeDraw3DSphereObject, // "com.sun.star.drawing.Shape3DSphereObject"
+ XmlShapeTypeDraw3DLatheObject, // "com.sun.star.drawing.Shape3DLatheObject"
+ XmlShapeTypeDraw3DExtrudeObject, // "com.sun.star.drawing.Shape3DExtrudeObject"
+
+ XmlShapeTypePresTitleTextShape, // "com.sun.star.presentation.TitleTextShape"
+ XmlShapeTypePresOutlinerShape, // "com.sun.star.presentation.OutlinerShape"
+ XmlShapeTypePresSubtitleShape, // "com.sun.star.presentation.SubtitleShape"
+ XmlShapeTypePresGraphicObjectShape, // "com.sun.star.presentation.GraphicObjectShape"
+ XmlShapeTypePresPageShape, // "com.sun.star.presentation.PageShape"
+ XmlShapeTypePresOLE2Shape, // "com.sun.star.presentation.OLE2Shape"
+ XmlShapeTypePresChartShape, // "com.sun.star.presentation.ChartShape"
+ XmlShapeTypePresSheetShape, // "com.sun.star.presentation.CalcShape"
+ XmlShapeTypePresTableShape, // "com.sun.star.presentation.TableShape"
+ XmlShapeTypePresOrgChartShape, // "com.sun.star.presentation.OrgChartShape"
+ XmlShapeTypePresNotesShape, // "com.sun.star.presentation.NotesShape"
+ XmlShapeTypeHandoutShape, // "com.sun.star.presentation.HandoutShape"
+
+ XmlShapeTypePresHeaderShape, // "com.sun.star.presentation.HeaderShape"
+ XmlShapeTypePresFooterShape, // "com.sun.star.presentation.FooterShape"
+ XmlShapeTypePresSlideNumberShape, // "com.sun.star.presentation.SlideNumberShape"
+ XmlShapeTypePresDateTimeShape, // "com.sun.star.presentation.DateTimeShape"
+
+ XmlShapeTypeDrawCustomShape, // "com.sun.star.drawing.CustomShape"
+ XmlShapeTypeDrawMediaShape, // "com.sun.star.drawing.MediaShape"
+ XmlShapeTypePresMediaShape, // "com.sun.star.presentation.MediaShape"
+
+ XmlShapeTypeDrawTableShape, // "com.sun.star.drawing.TableShape"
+
+ XmlShapeTypeNotYetSet
+};
+
+/** caches style and type info after a collectShapeAutostyle for later use in exportShape */
+struct ImplXMLShapeExportInfo
+{
+ OUString msStyleName;
+ OUString msTextStyleName;
+ sal_Int32 mnFamily;
+ XmlShapeType meShapeType;
+
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xCustomShapeReplacement;
+
+ ImplXMLShapeExportInfo() : mnFamily( XML_STYLE_FAMILY_SD_GRAPHICS_ID ), meShapeType( XmlShapeTypeNotYetSet ) {}
+};
+
+/** a vector for shape style and type cache information */
+typedef std::vector< ImplXMLShapeExportInfo > ImplXMLShapeExportInfoVector;
+
+/** a map to store all cache data for already collected XShapes */
+typedef std::map< com::sun::star::uno::Reference < com::sun::star::drawing::XShapes >, ImplXMLShapeExportInfoVector > ShapesInfos;
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SvXMLExport;
+class SvXMLExportPropertyMapper;
+
+namespace basegfx
+{
+ class B2DTuple;
+ class B2DHomMatrix;
+} // end of namespace basegfx
+
+class XMLOFF_DLLPUBLIC XMLShapeExport : public UniRefBase
+{
+private:
+
+ SvXMLExport& mrExport;
+ UniReference< XMLPropertyHandlerFactory > mxSdPropHdlFactory;
+ UniReference< SvXMLExportPropertyMapper > mxPropertySetMapper;
+ UniReference< XMLAnimationsExporter > mxAnimationsExporter;
+ sal_Int32 mnNextUniqueShapeId;
+ ShapesInfos maShapesInfos;
+ ShapesInfos::iterator maCurrentShapesIter;
+ sal_Bool mbExportLayer;
+ ImplXMLShapeExportInfoVector maShapeInfos;
+ ImplXMLShapeExportInfoVector::iterator maCurrentInfo;
+ OUString msPresentationStylePrefix;
+
+ // #88546# possibility to swich progress bar handling on/off
+ sal_Bool mbHandleProgressBar;
+
+ rtl::Reference< XMLTableExport > mxShapeTableExport;
+
+protected:
+ SvXMLExport& GetExport() { return mrExport; }
+ const SvXMLExport& GetExport() const { return mrExport; }
+private:
+
+ SAL_DLLPRIVATE UniReference< SvXMLExportPropertyMapper > GetPropertySetMapper() const { return mxPropertySetMapper; }
+
+ const OUString msZIndex;
+ const OUString msPrintable;
+ const OUString msVisible;
+
+ const OUString msEmptyPres;
+ const OUString msModel;
+ const OUString msStartShape;
+ const OUString msEndShape;
+ const OUString msOnClick;
+ const OUString msEventType;
+ const OUString msPresentation;
+ const OUString msMacroName;
+ const OUString msScript;
+ const OUString msLibrary;
+ const OUString msClickAction;
+ const OUString msBookmark;
+ const OUString msEffect;
+ const OUString msPlayFull;
+ const OUString msVerb;
+ const OUString msSoundURL;
+ const OUString msSpeed;
+ const OUString msStarBasic;
+
+ OUStringBuffer msBuffer;
+
+ SAL_DLLPRIVATE void ImpCalcShapeType(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType& eShapeType);
+
+ SAL_DLLPRIVATE void ImpExportNewTrans(const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint);
+ SAL_DLLPRIVATE void ImpExportNewTrans_GetB2DHomMatrix(::basegfx::B2DHomMatrix& rMatrix, const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet);
+ SAL_DLLPRIVATE void ImpExportNewTrans_DecomposeAndRefPoint(const ::basegfx::B2DHomMatrix& rMat, ::basegfx::B2DTuple& rTRScale, double& fTRShear, double& fTRRotate, ::basegfx::B2DTuple& rTRTranslate, com::sun::star::awt::Point* pRefPoint);
+ SAL_DLLPRIVATE void ImpExportNewTrans_FeaturesAndWrite(::basegfx::B2DTuple& rTRScale, double fTRShear, double fTRRotate, ::basegfx::B2DTuple& rTRTranslate, const sal_Int32 nFeatures);
+ SAL_DLLPRIVATE sal_Bool ImpExportPresentationAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet, const OUString& rClass );
+ SAL_DLLPRIVATE void ImpExportText( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
+ SAL_DLLPRIVATE void ImpExportEvents( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
+ SAL_DLLPRIVATE void ImpExportDescription( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape ); // #i68101#
+ SAL_DLLPRIVATE void ImpExportGluePoints( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
+
+ // single shape exporters
+ SAL_DLLPRIVATE void ImpExportGroupShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExport3DSceneShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportRectangleShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportLineShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportEllipseShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportPolygonShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportTextBoxShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportGraphicObjectShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportChartShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL, SvXMLAttributeList* pAttrList = NULL );
+ SAL_DLLPRIVATE void ImpExportControlShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportConnectorShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportMeasureShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportOLE2Shape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL, SvXMLAttributeList* pAttrList = NULL );
+ SAL_DLLPRIVATE void ImpExportPageShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportCaptionShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExport3DShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportFrameShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportPluginShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportAppletShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportCustomShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportMediaShape( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ SAL_DLLPRIVATE void ImpExportTableShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+public:
+ XMLShapeExport(SvXMLExport& rExp, SvXMLExportPropertyMapper *pExtMapper=0 );
+ virtual ~XMLShapeExport();
+
+ // This method collects all automatic styles for the given XShape
+ void collectShapeAutoStyles(
+ const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape);
+
+ // This method exports the given XShape
+ void exportShape(
+ const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape,
+ sal_Int32 nFeatures = SEF_DEFAULT,
+ com::sun::star::awt::Point* pRefPoint = NULL,
+ SvXMLAttributeList* pAttrList = NULL
+ );
+
+ // This method collects all automatic styles for the shapes inside the given XShapes collection
+ void collectShapesAutoStyles(
+ const com::sun::star::uno::Reference < com::sun::star::drawing::XShapes >& xShapes);
+
+ // This method exports all XShape inside the given XShapes collection
+ void exportShapes(
+ const com::sun::star::uno::Reference < com::sun::star::drawing::XShapes >& xShapes,
+ sal_Int32 nFeatures = SEF_DEFAULT,
+ com::sun::star::awt::Point* pRefPoint = NULL
+ );
+
+ /** initializes some internal structures for fast access to the given XShapes collection
+
+ <p>This method has to be called before you use exportShape or collectShapeAutoStyles.
+ It is automaticly called if you use collectShapesAutoStyles and exportShapes.
+
+ @see collectShapeAutoStyles
+ @see exportShape
+ @see collectShapesAutoStyles
+ @see exportShapes
+ */
+ void seekShapes(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes ) throw();
+
+ void exportAutoStyles();
+
+ /** sets a new reference to an XMLAnimationExporter.
+ If this is a non NULL reference, the animation information from all shapes given to exportShape()
+ from now on are collected.
+ */
+ void setAnimationsExporter( UniReference< XMLAnimationsExporter > xAnimExport ) { mxAnimationsExporter = xAnimExport; }
+
+ /** returns the last set XMLAnimationExport */
+ UniReference< XMLAnimationsExporter > getAnimationsExporter() const { return mxAnimationsExporter; }
+
+ /// returns the export property mapper for external chaining
+ static SvXMLExportPropertyMapper* CreateShapePropMapper( SvXMLExport& rExport );
+
+ void enableLayerExport( sal_Bool bEnable = sal_True ) { mbExportLayer = bEnable; }
+ sal_Bool IsLayerExportEnabled() const { return mbExportLayer; }
+
+ // #88546#
+ /** defines if the export should increment the progress bar or not */
+ void enableHandleProgressBar( sal_Bool bEnable = sal_True ) { mbHandleProgressBar = bEnable; }
+ sal_Bool IsHandleProgressBarEnabled() const { return mbHandleProgressBar; }
+
+ void setPresentationStylePrefix( const OUString& rPrefix ) { msPresentationStylePrefix = rPrefix; }
+
+ /** helper for chart that adds all attributes of a 3d scene element to the export */
+ void export3DSceneAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet );
+
+ /** helper for chart that exports all lamps from the propertyset */
+ void export3DLamps( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet );
+
+ /** sj: replacing CustomShapes with standard objects that are also supported in OpenOffice.org format */
+ com::sun::star::uno::Reference < com::sun::star::drawing::XShape > checkForCustomShapeReplacement(
+ const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& );
+
+ /** helper to export the style for graphic defaults */
+ void ExportGraphicDefaults();
+
+ /** is called before a shape element for the given XShape is exported */
+ virtual void onExport( const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape );
+
+ const rtl::Reference< XMLTableExport >& GetShapeTableExport();
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/shapeimport.hxx b/include/xmloff/shapeimport.hxx
new file mode 100644
index 000000000000..6de02130f243
--- /dev/null
+++ b/include/xmloff/shapeimport.hxx
@@ -0,0 +1,426 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_SHAPEIMPORT_HXX_
+#define _XMLOFF_SHAPEIMPORT_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/drawing/HomogenMatrix.hpp>
+#include <com/sun/star/drawing/ProjectionMode.hpp>
+#include <com/sun/star/drawing/ShadeMode.hpp>
+#include <xmloff/uniref.hxx>
+#include <xmloff/xmlictxt.hxx>
+
+#include "xmloff/table/XMLTableImport.hxx"
+#include <basegfx/vector/b3dvector.hxx>
+#include <vector>
+
+class SvXMLImport;
+class SvXMLImportContext;
+class SvXMLTokenMap;
+class SvXMLStylesContext;
+class XMLSdPropHdlFactory;
+class XMLPropertySetMapper;
+class SvXMLImportPropertyMapper;
+
+//////////////////////////////////////////////////////////////////////////////
+
+enum SdXMLGroupShapeElemTokenMap
+{
+ XML_TOK_GROUP_GROUP,
+ XML_TOK_GROUP_RECT,
+ XML_TOK_GROUP_LINE,
+ XML_TOK_GROUP_CIRCLE,
+ XML_TOK_GROUP_ELLIPSE,
+ XML_TOK_GROUP_POLYGON,
+ XML_TOK_GROUP_POLYLINE,
+ XML_TOK_GROUP_PATH,
+
+ XML_TOK_GROUP_CONTROL,
+ XML_TOK_GROUP_CONNECTOR,
+ XML_TOK_GROUP_MEASURE,
+ XML_TOK_GROUP_PAGE,
+ XML_TOK_GROUP_CAPTION,
+
+ XML_TOK_GROUP_CHART,
+ XML_TOK_GROUP_3DSCENE,
+
+ XML_TOK_GROUP_FRAME,
+
+ XML_TOK_GROUP_CUSTOM_SHAPE,
+
+ XML_TOK_GROUP_ANNOTATION,
+
+ XML_TOK_GROUP_A,
+
+ XML_TOK_GROUP_LAST
+};
+
+enum SdXMLFrameShapeElemTokenMap
+{
+ XML_TOK_FRAME_TEXT_BOX,
+ XML_TOK_FRAME_IMAGE,
+ XML_TOK_FRAME_OBJECT,
+ XML_TOK_FRAME_OBJECT_OLE,
+ XML_TOK_FRAME_PLUGIN,
+ XML_TOK_FRAME_FRAME,
+ XML_TOK_FRAME_FLOATING_FRAME,
+ XML_TOK_FRAME_APPLET,
+ XML_TOK_FRAME_TABLE,
+
+ XML_TOK_FRAME_LAST
+};
+
+enum SdXML3DSceneShapeElemTokenMap
+{
+ XML_TOK_3DSCENE_3DSCENE,
+ XML_TOK_3DSCENE_3DCUBE,
+ XML_TOK_3DSCENE_3DSPHERE,
+ XML_TOK_3DSCENE_3DLATHE,
+ XML_TOK_3DSCENE_3DEXTRUDE,
+
+ XML_TOK_3DSCENE_LAST
+};
+
+enum SdXMLShapeAttrTokenMap
+{
+ XML_TOK_SHAPE_NAME,
+ XML_TOK_SHAPE_DRAWSTYLE_NAME_GRAPHICS,
+ XML_TOK_SHAPE_PRESENTATION_CLASS,
+ XML_TOK_SHAPE_DRAWSTYLE_NAME_PRESENTATION,
+ XML_TOK_SHAPE_TRANSFORM,
+ XML_TOK_SHAPE_IS_PLACEHOLDER,
+ XML_TOK_SHAPE_IS_USER_TRANSFORMED
+};
+
+enum SdXML3DObjectAttrTokenMap
+{
+ XML_TOK_3DOBJECT_DRAWSTYLE_NAME,
+ XML_TOK_3DOBJECT_TRANSFORM
+};
+
+enum SdXML3DPolygonBasedAttrTokenMap
+{
+ XML_TOK_3DPOLYGONBASED_VIEWBOX,
+ XML_TOK_3DPOLYGONBASED_D
+};
+
+enum SdXML3DCubeObjectAttrTokenMap
+{
+ XML_TOK_3DCUBEOBJ_MINEDGE,
+ XML_TOK_3DCUBEOBJ_MAXEDGE
+};
+
+enum SdXML3DSphereObjectAttrTokenMap
+{
+ XML_TOK_3DSPHEREOBJ_CENTER,
+ XML_TOK_3DSPHEREOBJ_SIZE
+};
+
+enum SdXMLPolygonShapeAttrTokenMap
+{
+ XML_TOK_POLYGONSHAPE_VIEWBOX,
+ XML_TOK_POLYGONSHAPE_POINTS
+};
+
+enum SdXMLPathShapeAttrTokenMap
+{
+ XML_TOK_PATHSHAPE_VIEWBOX,
+ XML_TOK_PATHSHAPE_D
+};
+
+enum SdXML3DSceneShapeAttrTokenMap
+{
+ XML_TOK_3DSCENESHAPE_TRANSFORM,
+ XML_TOK_3DSCENESHAPE_VRP,
+ XML_TOK_3DSCENESHAPE_VPN,
+ XML_TOK_3DSCENESHAPE_VUP,
+ XML_TOK_3DSCENESHAPE_PROJECTION,
+ XML_TOK_3DSCENESHAPE_DISTANCE,
+ XML_TOK_3DSCENESHAPE_FOCAL_LENGTH,
+ XML_TOK_3DSCENESHAPE_SHADOW_SLANT,
+ XML_TOK_3DSCENESHAPE_SHADE_MODE,
+ XML_TOK_3DSCENESHAPE_AMBIENT_COLOR,
+ XML_TOK_3DSCENESHAPE_LIGHTING_MODE
+};
+
+enum SdXML3DLightAttrTokenMap
+{
+ XML_TOK_3DLIGHT_DIFFUSE_COLOR,
+ XML_TOK_3DLIGHT_DIRECTION,
+ XML_TOK_3DLIGHT_ENABLED,
+ XML_TOK_3DLIGHT_SPECULAR
+};
+
+//////////////////////////////////////////////////////////////////////////////
+// dr3d:3dlight context
+
+class SdXML3DLightContext: public SvXMLImportContext
+{
+ // local parameters which need to be read
+ sal_Int32 maDiffuseColor;
+ ::basegfx::B3DVector maDirection;
+ bool mbEnabled;
+ bool mbSpecular;
+
+public:
+ SdXML3DLightContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
+ virtual ~SdXML3DLightContext();
+
+ sal_Int32 GetDiffuseColor() { return maDiffuseColor; }
+ const ::basegfx::B3DVector& GetDirection() { return maDirection; }
+ sal_Bool GetEnabled() { return mbEnabled; }
+ sal_Bool GetSpecular() { return mbSpecular; }
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+typedef ::std::vector< SdXML3DLightContext* > Imp3DLightList;
+
+class SdXML3DSceneAttributesHelper
+{
+protected:
+ SvXMLImport& mrImport;
+
+ // list for local light contexts
+ Imp3DLightList maList;
+
+ // local parameters which need to be read
+ com::sun::star::drawing::HomogenMatrix mxHomMat;
+ sal_Bool mbSetTransform;
+
+ com::sun::star::drawing::ProjectionMode mxPrjMode;
+ sal_Int32 mnDistance;
+ sal_Int32 mnFocalLength;
+ sal_Int32 mnShadowSlant;
+ com::sun::star::drawing::ShadeMode mxShadeMode;
+ sal_Int32 maAmbientColor;
+ bool mbLightingMode;
+
+ ::basegfx::B3DVector maVRP;
+ ::basegfx::B3DVector maVPN;
+ ::basegfx::B3DVector maVUP;
+ sal_Bool mbVRPUsed;
+ sal_Bool mbVPNUsed;
+ sal_Bool mbVUPUsed;
+
+public:
+ SdXML3DSceneAttributesHelper( SvXMLImport& rImporter );
+ ~SdXML3DSceneAttributesHelper();
+
+ /** creates a 3d ligth context and adds it to the internal list for later processing */
+ SvXMLImportContext * create3DLightContext( sal_uInt16 nPrfx, const OUString& rLName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
+
+ /** this should be called for each scene attribute */
+ void processSceneAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue );
+
+ /** this sets the scene attributes at this propertyset */
+ void setSceneAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet );
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SvXMLShapeContext : public SvXMLImportContext
+{
+protected:
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape;
+ sal_Bool mbTemporaryShape;
+ OUString msHyperlink;
+
+public:
+ SvXMLShapeContext( SvXMLImport& rImp, sal_uInt16 nPrfx,
+ const OUString& rLName, sal_Bool bTemporaryShape ) : SvXMLImportContext( rImp, nPrfx, rLName ), mbTemporaryShape(bTemporaryShape) {}
+
+ TYPEINFO();
+
+ const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& getShape() const { return mxShape; }
+
+ void setHyperlink( const OUString& rHyperlink );
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+class ShapeSortContext;
+struct XMLShapeImportHelperImpl;
+struct XMLShapeImportPageContextImpl;
+
+class XMLOFF_DLLPUBLIC XMLShapeImportHelper : public UniRefBase
+{
+ XMLShapeImportHelperImpl* mpImpl;
+
+ XMLShapeImportPageContextImpl* mpPageContext;
+
+ com::sun::star::uno::Reference< com::sun::star::frame::XModel > mxModel;
+
+ // PropertySetMappers and factory
+ XMLSdPropHdlFactory* mpSdPropHdlFactory;
+ SvXMLImportPropertyMapper* mpPropertySetMapper;
+ SvXMLImportPropertyMapper* mpPresPagePropsMapper;
+
+ // contexts for Style and AutoStyle import
+ SvXMLStylesContext* mpStylesContext;
+ SvXMLStylesContext* mpAutoStylesContext;
+
+ // contexts for xShape contents TokenMaps
+ SvXMLTokenMap* mpGroupShapeElemTokenMap;
+ SvXMLTokenMap* mpFrameShapeElemTokenMap;
+ SvXMLTokenMap* mp3DSceneShapeElemTokenMap;
+ SvXMLTokenMap* mp3DObjectAttrTokenMap;
+ SvXMLTokenMap* mp3DPolygonBasedAttrTokenMap;
+ SvXMLTokenMap* mp3DCubeObjectAttrTokenMap;
+ SvXMLTokenMap* mp3DSphereObjectAttrTokenMap;
+ SvXMLTokenMap* mp3DSceneShapeAttrTokenMap;
+ SvXMLTokenMap* mp3DLightAttrTokenMap;
+ SvXMLTokenMap* mpPathShapeAttrTokenMap;
+ SvXMLTokenMap* mpPolygonShapeAttrTokenMap;
+
+ const OUString msStartShape;
+ const OUString msEndShape;
+ const OUString msStartGluePointIndex;
+ const OUString msEndGluePointIndex;
+
+ rtl::Reference< XMLTableImport > mxShapeTableImport;
+
+protected:
+ SvXMLImport& mrImporter;
+
+public:
+ XMLShapeImportHelper( SvXMLImport& rImporter,
+ const com::sun::star::uno::Reference< com::sun::star::frame::XModel>& rModel,
+ SvXMLImportPropertyMapper *pExtMapper=0 );
+
+ ~XMLShapeImportHelper();
+
+ SvXMLShapeContext* CreateGroupChildContext(
+ SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
+ sal_Bool bTemporaryShape = sal_False);
+
+ SvXMLShapeContext* CreateFrameChildContext(
+ SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xFrameAttrList);
+ SvXMLImportContext* CreateFrameChildContext(
+ SvXMLImportContext *pThisContext, sal_uInt16 nPrefix, const OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ SvXMLShapeContext* Create3DSceneChildContext(
+ SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
+
+ const SvXMLTokenMap& GetGroupShapeElemTokenMap();
+ const SvXMLTokenMap& GetFrameShapeElemTokenMap();
+ const SvXMLTokenMap& Get3DSceneShapeElemTokenMap();
+ const SvXMLTokenMap& Get3DObjectAttrTokenMap();
+ const SvXMLTokenMap& Get3DPolygonBasedAttrTokenMap();
+ const SvXMLTokenMap& Get3DCubeObjectAttrTokenMap();
+ const SvXMLTokenMap& Get3DSphereObjectAttrTokenMap();
+ const SvXMLTokenMap& Get3DLightAttrTokenMap();
+
+ // Styles and AutoStyles contexts
+ SvXMLStylesContext* GetStylesContext() const { return mpStylesContext; }
+ void SetStylesContext(SvXMLStylesContext* pNew);
+ SvXMLStylesContext* GetAutoStylesContext() const { return mpAutoStylesContext; }
+ void SetAutoStylesContext(SvXMLStylesContext* pNew);
+
+ // get factories and mappers
+ SvXMLImportPropertyMapper* GetPropertySetMapper() const { return mpPropertySetMapper; }
+ SvXMLImportPropertyMapper* GetPresPagePropsMapper() const { return mpPresPagePropsMapper; }
+
+ // this function is called whenever the implementation classes like to add this new
+ // shape to the given XShapes.
+ virtual void addShape(
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
+
+ // this function is called whenever the implementation classes have finished importing
+ // a shape to the given XShapes. The shape is already inserted into its XShapes and
+ // all properties and styles are set.
+ virtual void finishShape(
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
+
+ // helper functions for z-order sorting
+ void pushGroupForSorting( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes );
+ void popGroupAndSort();
+
+ void shapeWithZIndexAdded( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape,
+ sal_Int32 nZIndex );
+
+ void addShapeConnection( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rConnectorShape,
+ sal_Bool bStart,
+ const OUString& rDestShapeId,
+ sal_Int32 nDestGlueId );
+
+ /** adds a mapping for a glue point identifier from an xml file to the identifier created after inserting
+ the new glue point into the core. The saved mappings can be retrieved by getGluePointId() */
+ void addGluePointMapping( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape,
+ sal_Int32 nSourceId, sal_Int32 nDestinnationId );
+
+ /** moves all current DestinationId's for rXShape by n */
+ void moveGluePointMapping( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, const sal_Int32 n );
+
+ /** retrieves a mapping for a glue point identifier from the current xml file to the identifier created after
+ inserting the new glue point into the core. The mapping must be initialized first with addGluePointMapping() */
+ sal_Int32 getGluePointId( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, sal_Int32 nSourceId );
+
+ /** this method must be calling before the first shape is imported for the given page.
+ Calls to this method can be nested */
+ void startPage( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes );
+
+ /** this method must be calling after the last shape is imported for the given page
+ Calls to this method can be nested */
+ void endPage( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes );
+
+ void restoreConnections();
+
+ /** creates a property mapper for external chaining */
+ static SvXMLImportPropertyMapper* CreateShapePropMapper(
+ const com::sun::star::uno::Reference< com::sun::star::frame::XModel>& rModel, SvXMLImport& rImport );
+
+ // #88546#
+ /** defines if the import should increment the progress bar or not */
+ void enableHandleProgressBar( sal_Bool bEnable = sal_True );
+ sal_Bool IsHandleProgressBarEnabled() const;
+
+ /** queries the capability of the current model to create presentation shapes */
+ sal_Bool IsPresentationShapesSupported();
+
+ XMLSdPropHdlFactory* GetSdPropHdlFactory() const { return mpSdPropHdlFactory; }
+
+ const rtl::Reference< XMLTableImport >& GetShapeTableImport();
+};
+
+#endif // _XMLOFF_SHAPEIMPORT_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/styleexp.hxx b/include/xmloff/styleexp.hxx
new file mode 100644
index 000000000000..367c6d44b402
--- /dev/null
+++ b/include/xmloff/styleexp.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 _XMLOFF_STYLEEXP_HXX_
+#define _XMLOFF_STYLEEXP_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Reference.h>
+
+#include <xmloff/uniref.hxx>
+
+namespace com { namespace sun { namespace star
+{
+ namespace style
+ {
+ class XStyle;
+ }
+ namespace beans
+ {
+ class XPropertySet;
+ }
+ namespace container
+ {
+ class XNameAccess;
+ }
+
+} } }
+
+class XMLPropertySetMapper;
+class SvXMLExportPropertyMapper;
+class SvXMLAutoStylePoolP;
+class SvXMLExport;
+
+class XMLOFF_DLLPUBLIC XMLStyleExport : public UniRefBase
+{
+ SvXMLExport& rExport;
+protected:
+ const OUString sIsPhysical;
+ const OUString sIsAutoUpdate;
+ const OUString sFollowStyle;
+ const OUString sNumberingStyleName;
+ const OUString sOutlineLevel;
+
+ SvXMLExport& GetExport() { return rExport; }
+ const SvXMLExport& GetExport() const { return rExport; }
+
+private:
+
+ const OUString sPoolStyleName;
+
+ SvXMLAutoStylePoolP *pAutoStylePool;
+
+protected:
+
+ virtual sal_Bool exportStyle(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::style::XStyle > & rStyle,
+ const OUString& rXMLFamily,
+ const UniReference < SvXMLExportPropertyMapper >& rPropMapper,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xStyles,
+ const OUString* pPrefix = 0L );
+
+ virtual void exportStyleAttributes(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::style::XStyle > & rStyle );
+
+ virtual void exportStyleContent(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::style::XStyle > & rStyle );
+public:
+ XMLStyleExport(
+ SvXMLExport& rExp,
+ const OUString& rPoolStyleName,
+ SvXMLAutoStylePoolP *pAutoStyleP=0 );
+ virtual ~XMLStyleExport();
+
+// void exportStyleFamily(
+// const OUString& rFamily, const OUString& rXMLFamily,
+// const UniReference < XMLPropertySetMapper >& rPropMapper,
+// sal_Bool bUsed, sal_uInt16 nFamily = 0,
+// const OUString* pPrefix = 0L);
+
+// void exportStyleFamily(
+// const sal_Char *pFamily, const OUString& rXMLFamily,
+// const UniReference < XMLPropertySetMapper >& rPropMapper,
+// sal_Bool bUsed, sal_uInt16 nFamily = 0,
+// const OUString* pPrefix = 0L);
+
+ virtual sal_Bool exportDefaultStyle(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > & xPropSet,
+ const OUString& rXMLFamily,
+ const UniReference < SvXMLExportPropertyMapper >& rPropMapper );
+
+ void exportStyleFamily(
+ const OUString& rFamily, const OUString& rXMLFamily,
+ const UniReference < SvXMLExportPropertyMapper >& rPropMapper,
+ sal_Bool bUsed, sal_uInt16 nFamily = 0,
+ const OUString* pPrefix = 0L);
+
+ void exportStyleFamily(
+ const sal_Char *pFamily, const OUString& rXMLFamily,
+ const UniReference < SvXMLExportPropertyMapper >& rPropMapper,
+ sal_Bool bUsed, sal_uInt16 nFamily = 0,
+ const OUString* pPrefix = 0L);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/table/XMLTableExport.hxx b/include/xmloff/table/XMLTableExport.hxx
new file mode 100644
index 000000000000..e93c0a244a51
--- /dev/null
+++ b/include/xmloff/table/XMLTableExport.hxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _XMLOFF_XMLTABLEEXPORT_HXX
+#define _XMLOFF_XMLTABLEEXPORT_HXX
+
+#include "sal/config.h"
+
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <map>
+#include <vector>
+
+#include <com/sun/star/table/XTableColumns.hpp>
+#include <com/sun/star/table/XColumnRowRange.hpp>
+#include <com/sun/star/table/XCell.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+
+#include <rtl/ref.hxx>
+
+#include "xmloff/dllapi.h"
+#include "xmloff/uniref.hxx"
+#include "xmloff/xmlprmap.hxx"
+#include "xmloff/xmlexppr.hxx"
+
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class SvXMLExport;
+class SvXMLExportPropertyMapper;
+
+typedef ::std::map< const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >, OUString > TableStyleMap;
+
+struct XMLTableInfo
+{
+ TableStyleMap maColumnStyleMap;
+ TableStyleMap maRowStyleMap;
+ TableStyleMap maCellStyleMap;
+ std::vector< OUString > maDefaultRowCellStyles;
+};
+
+typedef ::std::map< const ::com::sun::star::uno::Reference< com::sun::star::table::XColumnRowRange >, boost::shared_ptr< XMLTableInfo > > TableInfoMap;
+
+class XMLOFF_DLLPUBLIC XMLTableExport : public UniRefBase
+{
+public:
+ XMLTableExport(SvXMLExport& rExp, const rtl::Reference< SvXMLExportPropertyMapper >& xCellExportPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef );
+ virtual ~XMLTableExport();
+
+ // This method collects all automatic styles for the given table
+ void collectTableAutoStyles(const com::sun::star::uno::Reference < com::sun::star::table::XColumnRowRange >& xColumnRowRange);
+
+ // This method exports the given table
+ void exportTable(const com::sun::star::uno::Reference < com::sun::star::table::XColumnRowRange >& xColumnRowRange);
+
+ // export the styles from the cell style family
+ void exportTableStyles();
+
+ // Export the collected automatic styles
+ void exportAutoStyles();
+
+private:
+ void exportTableTemplates();
+
+ SvXMLExport& mrExport;
+ rtl::Reference< SvXMLExportPropertyMapper > mxCellExportPropertySetMapper;
+ rtl::Reference< SvXMLExportPropertyMapper > mxRowExportPropertySetMapper;
+ rtl::Reference< SvXMLExportPropertyMapper > mxColumnExportPropertySetMapper;
+ TableInfoMap maTableInfoMap;
+ bool mbExportTables;
+
+protected:
+ SvXMLExport& GetExport() { return mrExport; }
+ const SvXMLExport& GetExport() const { return mrExport; }
+private:
+
+ SAL_DLLPRIVATE void ImpExportText( const com::sun::star::uno::Reference < com::sun::star::table::XCell >& xCell );
+
+ void ExportCell( const com::sun::star::uno::Reference < com::sun::star::table::XCell >& xCell, const boost::shared_ptr< XMLTableInfo >& pTableInfo, const OUString& sDefaultCellStyle );
+ void ExportTableColumns( const com::sun::star::uno::Reference < com::sun::star::container::XIndexAccess >& xtableColumns, const boost::shared_ptr< XMLTableInfo >& pTableInfo );
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/table/XMLTableImport.hxx b/include/xmloff/table/XMLTableImport.hxx
new file mode 100644
index 000000000000..fec6b37e0eaa
--- /dev/null
+++ b/include/xmloff/table/XMLTableImport.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 XMLTABLEIMPORT_HXX_
+#define XMLTABLEIMPORT_HXX_
+
+#include <com/sun/star/table/XColumnRowRange.hpp>
+
+#include "xmloff/dllapi.h"
+#include "xmloff/xmlictxt.hxx"
+#include "xmloff/uniref.hxx"
+#include "xmloff/xmlimppr.hxx"
+#include "xmloff/prhdlfac.hxx"
+
+#include <rtl/ref.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <map>
+
+class SvXMLStyleContext;
+
+typedef std::map< OUString, OUString > XMLTableTemplate;
+typedef std::map < OUString, boost::shared_ptr< XMLTableTemplate > > XMLTableTemplateMap;
+
+class XMLTableImport : public UniRefBase
+{
+ friend class XMLTableImportContext;
+
+public:
+ XMLTableImport( SvXMLImport& rImport, const rtl::Reference< XMLPropertySetMapper >& xCellPropertySetMapper, const rtl::Reference< XMLPropertyHandlerFactory >& xFactoryRef );
+ virtual ~XMLTableImport();
+
+ SvXMLImportContext* CreateTableContext( sal_uInt16 nPrfx, const OUString& rLName,
+ ::com::sun::star::uno::Reference< ::com::sun::star::table::XColumnRowRange >& xColumnRowRange );
+
+ SvXMLStyleContext* CreateTableTemplateContext( sal_uInt16 nPrfx, const OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ rtl::Reference< SvXMLImportPropertyMapper > GetCellImportPropertySetMapper() const { return mxCellImportPropertySetMapper; }
+ rtl::Reference< SvXMLImportPropertyMapper > GetRowImportPropertySetMapper() const { return mxRowImportPropertySetMapper; }
+ rtl::Reference< SvXMLImportPropertyMapper > GetColumnImportPropertySetMapper() const { return mxColumnImportPropertySetMapper; }
+
+ void addTableTemplate( const OUString& rsStyleName, XMLTableTemplate& xTableTemplate );
+ void finishStyles();
+
+private:
+ SvXMLImport& mrImport;
+ rtl::Reference< SvXMLImportPropertyMapper > mxCellImportPropertySetMapper;
+ rtl::Reference< SvXMLImportPropertyMapper > mxRowImportPropertySetMapper;
+ rtl::Reference< SvXMLImportPropertyMapper > mxColumnImportPropertySetMapper;
+
+ XMLTableTemplateMap maTableTemplates;
+};
+
+#endif /*XMLTABLEIMPORT_HXX_*/
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx
new file mode 100644
index 000000000000..2ac668de2d5a
--- /dev/null
+++ b/include/xmloff/txtimp.hxx
@@ -0,0 +1,725 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef XMLOFF_TEXTIMP_HXX
+#define XMLOFF_TEXTIMP_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/uno/Reference.h>
+
+#include <map>
+#include <boost/utility.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
+
+#include <xmloff/xmltkmap.hxx>
+#include <comphelper/stl_types.hxx>
+#include <xmloff/uniref.hxx>
+
+class XMLTextListsHelper;
+class SvXMLImportContext;
+class SvXMLTokenMap;
+class SvXMLImportPropertyMapper;
+class SvXMLNamespaceMap;
+class SvXMLImport;
+class SvXMLStylesContext;
+class XMLTextListBlockContext;
+class SvxXMLListStyleContext;
+class XMLPropStyleContext;
+class SvI18NMap;
+class XMLSectionImportContext;
+class XMLFontStylesContext;
+template<class A> class XMLPropertyBackpatcher;
+class XMLEventsImportContext;
+
+namespace xmloff {
+ struct ParsedRDFaAttributes;
+}
+
+namespace com { namespace sun { namespace star {
+namespace text {
+ class XText;
+ class XTextCursor;
+ class XTextRange;
+ class XTextContent;
+ class XFormField;
+}
+namespace frame { class XModel; }
+namespace container { class XNameContainer; class XIndexReplace; class XNameAccess; }
+namespace beans { class XPropertySet; }
+namespace xml { namespace sax { class XAttributeList; } }
+namespace util { struct DateTime; }
+namespace lang { class XMultiServiceFactory; }
+} } }
+
+enum SwXMLTextElemTokens
+{
+ XML_TOK_TEXT_P,
+ XML_TOK_TEXT_H,
+ XML_TOK_TEXT_LIST,
+ XML_TOK_TEXT_FRAME_PAGE,
+ XML_TOK_TABLE_TABLE,
+ XML_TOK_TEXT_VARFIELD_DECLS,
+ XML_TOK_TEXT_USERFIELD_DECLS,
+ XML_TOK_TEXT_SEQUENCE_DECLS,
+ XML_TOK_TEXT_DDE_DECLS,
+ XML_TOK_DRAW_A_PAGE,
+ XML_TOK_TEXT_SECTION,
+ XML_TOK_TEXT_TOC,
+ XML_TOK_TEXT_OBJECT_INDEX,
+ XML_TOK_TEXT_TABLE_INDEX,
+ XML_TOK_TEXT_ILLUSTRATION_INDEX,
+ XML_TOK_TEXT_USER_INDEX,
+ XML_TOK_TEXT_ALPHABETICAL_INDEX,
+ XML_TOK_TEXT_BIBLIOGRAPHY_INDEX,
+ XML_TOK_TEXT_INDEX_TITLE,
+ XML_TOK_TEXT_TRACKED_CHANGES,
+ XML_TOK_TEXT_CHANGE_START,
+ XML_TOK_TEXT_CHANGE_END,
+ XML_TOK_TEXT_CHANGE,
+ XML_TOK_TEXT_FORMS,
+ XML_TOK_TEXT_CALCULATION_SETTINGS,
+ XML_TOK_TEXT_AUTOMARK,
+ XML_TOK_TEXT_NUMBERED_PARAGRAPH,
+ XML_TOK_TEXT_ELEM_END=XML_TOK_UNKNOWN
+};
+
+enum XMLTextPElemTokens
+{
+ XML_TOK_TEXT_SPAN,
+ XML_TOK_TEXT_TAB_STOP,
+ XML_TOK_TEXT_LINE_BREAK,
+ XML_TOK_TEXT_SOFT_PAGE_BREAK,
+ XML_TOK_TEXT_S,
+ XML_TOK_TEXT_FRAME,
+ XML_TOK_TEXT_HYPERLINK,
+ XML_TOK_TEXT_RUBY,
+
+ XML_TOK_TEXT_NOTE,
+ XML_TOK_TEXT_BOOKMARK,
+ XML_TOK_TEXT_BOOKMARK_START,
+ XML_TOK_TEXT_BOOKMARK_END,
+ XML_TOK_TEXT_REFERENCE,
+ XML_TOK_TEXT_REFERENCE_START,
+ XML_TOK_TEXT_REFERENCE_END,
+
+ XML_TOK_TEXT_TOC_MARK, // index marks
+ XML_TOK_TEXT_TOC_MARK_START,
+ XML_TOK_TEXT_TOC_MARK_END,
+ XML_TOK_TEXT_USER_INDEX_MARK,
+ XML_TOK_TEXT_USER_INDEX_MARK_START,
+ XML_TOK_TEXT_USER_INDEX_MARK_END,
+ XML_TOK_TEXT_ALPHA_INDEX_MARK,
+ XML_TOK_TEXT_ALPHA_INDEX_MARK_START,
+ XML_TOK_TEXT_ALPHA_INDEX_MARK_END,
+
+ XML_TOK_TEXT_SENDER_FIRSTNAME, // sender fields
+ XML_TOK_TEXT_SENDER_LASTNAME,
+ XML_TOK_TEXT_SENDER_INITIALS,
+ XML_TOK_TEXT_SENDER_TITLE,
+ XML_TOK_TEXT_SENDER_POSITION,
+ XML_TOK_TEXT_SENDER_EMAIL,
+ XML_TOK_TEXT_SENDER_PHONE_PRIVATE,
+ XML_TOK_TEXT_SENDER_FAX,
+ XML_TOK_TEXT_SENDER_COMPANY,
+ XML_TOK_TEXT_SENDER_PHONE_WORK,
+ XML_TOK_TEXT_SENDER_STREET,
+ XML_TOK_TEXT_SENDER_CITY,
+ XML_TOK_TEXT_SENDER_POSTAL_CODE,
+ XML_TOK_TEXT_SENDER_COUNTRY,
+ XML_TOK_TEXT_SENDER_STATE_OR_PROVINCE,
+
+ XML_TOK_TEXT_AUTHOR_NAME, // author fields
+ XML_TOK_TEXT_AUTHOR_INITIALS,
+
+ XML_TOK_TEXT_DATE, // date & time fields
+ XML_TOK_TEXT_TIME,
+
+ XML_TOK_TEXT_PAGE_NUMBER, // page number fields
+ XML_TOK_TEXT_PAGE_CONTINUATION_STRING,
+
+ XML_TOK_TEXT_VARIABLE_SET, // variable fields
+ XML_TOK_TEXT_VARIABLE_GET,
+ XML_TOK_TEXT_VARIABLE_INPUT,
+ XML_TOK_TEXT_USER_FIELD_GET,
+ XML_TOK_TEXT_USER_FIELD_INPUT,
+ XML_TOK_TEXT_SEQUENCE,
+ XML_TOK_TEXT_EXPRESSION,
+ XML_TOK_TEXT_TEXT_INPUT,
+
+ XML_TOK_TEXT_DATABASE_DISPLAY, // database fields
+ XML_TOK_TEXT_DATABASE_NEXT,
+ XML_TOK_TEXT_DATABASE_SELECT,
+ XML_TOK_TEXT_DATABASE_ROW_NUMBER,
+ XML_TOK_TEXT_DATABASE_NAME,
+
+ XML_TOK_TEXT_DOCUMENT_CREATION_AUTHOR, //document info fields
+ XML_TOK_TEXT_DOCUMENT_CREATION_DATE,
+ XML_TOK_TEXT_DOCUMENT_CREATION_TIME,
+ XML_TOK_TEXT_DOCUMENT_DESCRIPTION,
+ XML_TOK_TEXT_DOCUMENT_PRINT_AUTHOR,
+ XML_TOK_TEXT_DOCUMENT_PRINT_DATE,
+ XML_TOK_TEXT_DOCUMENT_PRINT_TIME,
+ XML_TOK_TEXT_DOCUMENT_TITLE,
+ XML_TOK_TEXT_DOCUMENT_SUBJECT,
+ XML_TOK_TEXT_DOCUMENT_KEYWORDS,
+ XML_TOK_TEXT_DOCUMENT_REVISION,
+ XML_TOK_TEXT_DOCUMENT_EDIT_DURATION,
+ XML_TOK_TEXT_DOCUMENT_SAVE_AUTHOR,
+ XML_TOK_TEXT_DOCUMENT_SAVE_DATE,
+ XML_TOK_TEXT_DOCUMENT_SAVE_TIME,
+ XML_TOK_TEXT_DOCUMENT_USER_DEFINED,
+
+ XML_TOK_TEXT_PLACEHOLDER, // misc. fields
+ XML_TOK_TEXT_CONDITIONAL_TEXT,
+ XML_TOK_TEXT_HIDDEN_TEXT,
+ XML_TOK_TEXT_HIDDEN_PARAGRAPH,
+ XML_TOK_TEXT_FILENAME,
+ XML_TOK_TEXT_CHAPTER,
+ XML_TOK_TEXT_TEMPLATENAME,
+ XML_TOK_TEXT_WORD_COUNT, // statistics/count fields
+ XML_TOK_TEXT_PARAGRAPH_COUNT,
+ XML_TOK_TEXT_TABLE_COUNT,
+ XML_TOK_TEXT_CHARACTER_COUNT,
+ XML_TOK_TEXT_IMAGE_COUNT,
+ XML_TOK_TEXT_OBJECT_COUNT,
+ XML_TOK_TEXT_PAGE_COUNT,
+ XML_TOK_TEXT_GET_PAGE_VAR,
+ XML_TOK_TEXT_SET_PAGE_VAR,
+ XML_TOK_TEXT_MACRO,
+ XML_TOK_TEXT_DDE,
+ XML_TOK_TEXT_REFERENCE_REF,
+ XML_TOK_TEXT_BOOKMARK_REF,
+ XML_TOK_TEXT_SEQUENCE_REF,
+ XML_TOK_TEXT_NOTE_REF,
+ XML_TOK_TEXT_SHEET_NAME,
+ XML_TOK_TEXT_BIBLIOGRAPHY_MARK,
+ XML_TOK_TEXT_ANNOTATION,
+ XML_TOK_TEXT_ANNOTATION_END,
+ XML_TOK_TEXT_NAME,
+ XML_TOK_TEXT_SCRIPT,
+ XML_TOK_TEXT_TABLE_FORMULA,
+ XML_TOK_TEXT_DROPDOWN,
+
+ // RDF metadata
+ XML_TOK_TEXT_META,
+ XML_TOK_TEXT_META_FIELD,
+
+ // misc
+ XML_TOK_TEXTP_CHANGE_START, // TEXTP avoids clash with SwXMLTextElemTokens
+ XML_TOK_TEXTP_CHANGE_END,
+ XML_TOK_TEXTP_CHANGE,
+ XML_TOK_DRAW_A,
+ XML_TOK_TEXT_MEASURE,
+
+ XML_TOK_DRAW_HEADER,
+ XML_TOK_DRAW_FOOTER,
+ XML_TOK_DRAW_DATE_TIME,
+ XML_TOK_TEXT_PAGE_CONTINUATION,
+
+ XML_TOK_TEXT_FIELDMARK,
+ XML_TOK_TEXT_FIELDMARK_START,
+ XML_TOK_TEXT_FIELDMARK_END,
+
+ XML_TOK_TEXT_P_ELEM_END=XML_TOK_UNKNOWN
+};
+
+enum XMLTextPAttrTokens
+{
+ XML_TOK_TEXT_P_XMLID,
+ XML_TOK_TEXT_P_ABOUT,
+ XML_TOK_TEXT_P_PROPERTY,
+ XML_TOK_TEXT_P_CONTENT,
+ XML_TOK_TEXT_P_DATATYPE,
+ XML_TOK_TEXT_P_TEXTID,
+ XML_TOK_TEXT_P_STYLE_NAME,
+ XML_TOK_TEXT_P_COND_STYLE_NAME,
+ XML_TOK_TEXT_P_LEVEL,
+ XML_TOK_TEXT_P_CLASS_NAMES,
+ XML_TOK_TEXT_P_IS_LIST_HEADER,
+ XML_TOK_TEXT_P_RESTART_NUMBERING,
+ XML_TOK_TEXT_P_START_VALUE,
+ XML_TOK_TEXT_P_END=XML_TOK_UNKNOWN
+};
+
+enum XMLTextNumberedParagraphAttrTokens
+{
+ XML_TOK_TEXT_NUMBERED_PARAGRAPH_XMLID,
+ XML_TOK_TEXT_NUMBERED_PARAGRAPH_LIST_ID,
+ XML_TOK_TEXT_NUMBERED_PARAGRAPH_LEVEL,
+ XML_TOK_TEXT_NUMBERED_PARAGRAPH_STYLE_NAME,
+ XML_TOK_TEXT_NUMBERED_PARAGRAPH_CONTINUE_NUMBERING,
+ XML_TOK_TEXT_NUMBERED_PARAGRAPH_START_VALUE,
+ XML_TOK_TEXT_NUMBERED_PARAGRAPH_END=XML_TOK_UNKNOWN
+};
+
+enum XMLTextListBlockAttrTokens
+{
+ XML_TOK_TEXT_LIST_BLOCK_XMLID,
+ XML_TOK_TEXT_LIST_BLOCK_STYLE_NAME,
+ XML_TOK_TEXT_LIST_BLOCK_CONTINUE_NUMBERING,
+ XML_TOK_TEXT_LIST_BLOCK_ID,
+ XML_TOK_TEXT_LIST_BLOCK_CONTINUE_LIST,
+ XML_TOK_TEXT_LIST_BLOCK_END=XML_TOK_UNKNOWN
+};
+
+enum XMLTextListBlockElemTokens
+{
+ XML_TOK_TEXT_LIST_HEADER,
+ XML_TOK_TEXT_LIST_ITEM,
+ XML_TOK_TEXT_LIST_BLOCK_ELEM_END=XML_TOK_UNKNOWN
+};
+
+enum XMLTextFrameAttrTokens
+{
+ XML_TOK_TEXT_FRAME_STYLE_NAME,
+ XML_TOK_TEXT_FRAME_NAME,
+ XML_TOK_TEXT_FRAME_ANCHOR_TYPE,
+ XML_TOK_TEXT_FRAME_ANCHOR_PAGE_NUMBER,
+ XML_TOK_TEXT_FRAME_X,
+ XML_TOK_TEXT_FRAME_Y,
+ XML_TOK_TEXT_FRAME_WIDTH,
+ XML_TOK_TEXT_FRAME_REL_WIDTH,
+ XML_TOK_TEXT_FRAME_HEIGHT,
+ XML_TOK_TEXT_FRAME_MIN_HEIGHT,
+ XML_TOK_TEXT_FRAME_REL_HEIGHT,
+ XML_TOK_TEXT_FRAME_NEXT_CHAIN_NAME,
+ XML_TOK_TEXT_FRAME_HREF,
+ XML_TOK_TEXT_FRAME_FILTER_NAME,
+ XML_TOK_TEXT_FRAME_Z_INDEX,
+ XML_TOK_TEXT_FRAME_TRANSFORM,
+ XML_TOK_TEXT_FRAME_CLASS_ID,
+ XML_TOK_TEXT_FRAME_CODE,
+ XML_TOK_TEXT_FRAME_OBJECT,
+ XML_TOK_TEXT_FRAME_ARCHIVE,
+ XML_TOK_TEXT_FRAME_MAY_SCRIPT,
+ XML_TOK_TEXT_FRAME_MIME_TYPE,
+ XML_TOK_TEXT_FRAME_APPLET_NAME,
+ XML_TOK_TEXT_FRAME_FRAME_NAME,
+ XML_TOK_TEXT_FRAME_NOTIFY_ON_UPDATE,
+ XML_TOK_TEXT_FRAME_MIN_WIDTH,
+ XML_TOK_TEXT_FRAME_END=XML_TOK_UNKNOWN
+};
+
+enum XMLTextHyperlinkAttrTokens
+{
+ XML_TOK_TEXT_HYPERLINK_HREF,
+ XML_TOK_TEXT_HYPERLINK_NAME,
+ XML_TOK_TEXT_HYPERLINK_TARGET_FRAME,
+ XML_TOK_TEXT_HYPERLINK_SHOW,
+ XML_TOK_TEXT_HYPERLINK_STYLE_NAME,
+ XML_TOK_TEXT_HYPERLINK_VIS_STYLE_NAME,
+ XML_TOK_TEXT_HYPERLINK_SERVER_MAP,
+ XML_TOK_TEXT_HYPERLINK_END=XML_TOK_UNKNOWN
+};
+
+enum XMLTextPageMasterElemTokens
+{
+ XML_TOK_TEXT_MP_HEADER,
+ XML_TOK_TEXT_MP_FOOTER,
+ XML_TOK_TEXT_MP_HEADER_LEFT,
+ XML_TOK_TEXT_MP_FOOTER_LEFT,
+ XML_TOK_TEXT_MP_HEADER_FIRST,
+ XML_TOK_TEXT_MP_FOOTER_FIRST,
+ XML_TOK_TEXT_MP_END=XML_TOK_UNKNOWN
+};
+
+enum XMLTextContourAttrTokens
+{
+ XML_TOK_TEXT_CONTOUR_WIDTH,
+ XML_TOK_TEXT_CONTOUR_HEIGHT,
+ XML_TOK_TEXT_CONTOUR_VIEWBOX,
+ XML_TOK_TEXT_CONTOUR_POINTS,
+ XML_TOK_TEXT_CONTOUR_D,
+ XML_TOK_TEXT_CONTOUR_AUTO,
+ XML_TOK_TEXT_CONTOUR_END=XML_TOK_UNKNOWN
+};
+enum XMLTextType
+{
+ XML_TEXT_TYPE_BODY,
+ XML_TEXT_TYPE_CELL,
+ XML_TEXT_TYPE_SHAPE,
+ XML_TEXT_TYPE_TEXTBOX,
+ XML_TEXT_TYPE_HEADER_FOOTER,
+ XML_TEXT_TYPE_SECTION,
+ XML_TEXT_TYPE_FOOTNOTE,
+ XML_TEXT_TYPE_CHANGED_REGION
+};
+
+#define XML_TEXT_RENAME_TYPE_FRAME 10
+#define XML_TEXT_RENAME_TYPE_TABLE 20
+
+class XMLOFF_DLLPUBLIC XMLTextImportHelper : public UniRefBase,
+ private boost::noncopyable
+{
+private:
+ struct Impl;
+ boost::scoped_ptr<Impl> m_pImpl;
+ /// ugly, but implementation of this is in XMLPropertyBackpatcher.cxx
+ struct BackpatcherImpl;
+ ::boost::shared_ptr<BackpatcherImpl> m_pBackpatcherImpl;
+ ::boost::shared_ptr<BackpatcherImpl> MakeBackpatcherImpl();
+
+protected:
+ virtual SvXMLImportContext *CreateTableChildContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrefix, const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ // access, lazy initialization and destruction of backpatchers
+ // Code is implemented in XMLPropertyBackpatcher.cxx
+ inline XMLPropertyBackpatcher<sal_Int16>& GetFootnoteBP();
+ inline XMLPropertyBackpatcher<sal_Int16>& GetSequenceIdBP();
+ inline XMLPropertyBackpatcher< OUString> & GetSequenceNameBP();
+
+public:
+
+ XMLTextImportHelper(
+ ::com::sun::star::uno::Reference <
+ ::com::sun::star::frame::XModel> const& rModel,
+ SvXMLImport& rImport,
+ bool const bInsertMode = false, bool const bStylesOnlyMode = false,
+ bool const bProgress = false, bool const bBlockMode = false,
+ bool const bOrganizerMode = false);
+
+ ~XMLTextImportHelper();
+
+ void SetCursor(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextCursor >& rCursor );
+ void ResetCursor();
+
+ void SetAutoStyles( SvXMLStylesContext *pStyles );
+
+ void SetFontDecls( XMLFontStylesContext *pFontDecls );
+ const XMLFontStylesContext *GetFontDecls() const;
+
+ SvXMLImportContext *CreateTextChildContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrefix, const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
+ XMLTextType eType = XML_TEXT_TYPE_SHAPE );
+
+ SvXMLTokenMap const& GetTextElemTokenMap();
+ SvXMLTokenMap const& GetTextPElemTokenMap();
+ SvXMLTokenMap const& GetTextPAttrTokenMap();
+ SvXMLTokenMap const& GetTextFrameAttrTokenMap();
+ SvXMLTokenMap const& GetTextContourAttrTokenMap();
+ SvXMLTokenMap const& GetTextHyperlinkAttrTokenMap();
+ SvXMLTokenMap const& GetTextMasterPageElemTokenMap();
+
+ const SvXMLTokenMap& GetTextNumberedParagraphAttrTokenMap();
+ const SvXMLTokenMap& GetTextListBlockAttrTokenMap();
+ const SvXMLTokenMap& GetTextListBlockElemTokenMap();
+ const SvXMLTokenMap& GetTextFieldAttrTokenMap(); // impl: txtfldi.cxx
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XText > & GetText();
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextCursor > & GetCursor();
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextRange > & GetCursorAsRange();
+
+ bool IsInsertMode() const;
+ bool IsStylesOnlyMode() const;
+ bool IsBlockMode() const;
+ bool IsOrganizerMode() const;
+ bool IsProgress() const;
+
+ OUString ConvertStarFonts( const OUString& rChars,
+ const OUString& rStyleName,
+ sal_uInt8& rFlags,
+ sal_Bool bPara,
+ SvXMLImport& rImport ) const;
+ // insert a string without special whitespace processing enabled
+ void InsertString( const OUString& rChars );
+ // insert a string with special whitespace processing enabled
+ void InsertString( const OUString& rChars,
+ sal_Bool& rIgnoreLeadingSpace );
+ // Delete current paragraph
+ void DeleteParagraph();
+
+ void InsertControlCharacter( sal_Int16 nControl );
+ void InsertTextContent( ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & xContent);
+
+ // Add parameter <bOutlineLevelAttrFound> (#i73509#)
+ // Add parameter <bSetListAttrs> in order to suppress the handling of the list attributes (#i80724#)
+ OUString SetStyleAndAttrs(
+ SvXMLImport& rImport,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextCursor >& rCursor,
+ const OUString& rStyleName,
+ sal_Bool bPara,
+ sal_Bool bOutlineLevelAttrFound = sal_False,
+ sal_Int8 nOutlineLevel = -1,
+ sal_Bool bSetListAttrs = sal_True );
+
+ /** Find a suitable name for the given outline level.
+ * If rStyleName is empty, change it to a previously used or default style
+ * name for that level. Otherwise, leave rStyleName unmodified.
+ */
+ // Adjust 2nd parameter (#i69629#)
+ void FindOutlineStyleName( OUString& rStyleName,
+ sal_Int8 nOutlineLevel );
+
+ // Change method name to reflect change of data structure (#i69629#)
+ void AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel,
+ const OUString& rStyleName );
+
+ void SetOutlineStyles( sal_Bool bSetEmpty );
+
+ void SetHyperlink(
+ SvXMLImport& rImport,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextCursor >& rCursor,
+ const OUString& rHRef,
+ const OUString& rName,
+ const OUString& rTargetFrameName,
+ const OUString& rStyleName,
+ const OUString& rVisitedStyleName,
+ XMLEventsImportContext* pEvents = NULL);
+ void SetRuby(
+ SvXMLImport& rImport,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextCursor >& rCursor,
+ const OUString& rStyleName,
+ const OUString& rTextStyleName,
+ const OUString& rText );
+
+ /// return key appropriate for use with NumberFormat property
+ /// return -1 if style is not found
+ /// (may return whether data style uses the system language)
+ sal_Int32 GetDataStyleKey( const OUString& sStyleName,
+ sal_Bool* pIsSystemLanguage = NULL );
+
+ const SvxXMLListStyleContext *FindAutoListStyle(
+ const OUString& rName ) const;
+ XMLPropStyleContext *FindAutoFrameStyle(
+ const OUString& rName ) const;
+ XMLPropStyleContext* FindSectionStyle(
+ const OUString& rName ) const;
+ XMLPropStyleContext* FindPageMaster(
+ const OUString& rName ) const;
+
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer> & GetParaStyles() const;
+
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer> & GetTextStyles() const;
+
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer> &
+ GetNumberingStyles() const;
+
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer> & GetFrameStyles() const;
+
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer> & GetPageStyles() const;
+
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XIndexReplace > &
+ GetChapterNumbering() const;
+
+ sal_Bool HasFrameByName( const OUString& rName ) const;
+ void ConnectFrameChains( const OUString& rFrmName,
+ const OUString& rNextFrmName,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet >& rFrmPropSet );
+
+ UniReference< SvXMLImportPropertyMapper > const&
+ GetParaImportPropertySetMapper() const;
+ UniReference< SvXMLImportPropertyMapper > const&
+ GetTextImportPropertySetMapper() const;
+ UniReference< SvXMLImportPropertyMapper > const&
+ GetSectionImportPropertySetMapper() const;
+ UniReference< SvXMLImportPropertyMapper > const&
+ GetRubyImportPropertySetMapper() const;
+
+ static SvXMLImportPropertyMapper *CreateShapeExtPropMapper(SvXMLImport&);
+ static SvXMLImportPropertyMapper *CreateParaExtPropMapper(SvXMLImport&, XMLFontStylesContext *pFontDecls = NULL);
+ static SvXMLImportPropertyMapper* CreateParaDefaultExtPropMapper(SvXMLImport&, XMLFontStylesContext* pFontDecls = NULL);
+ static SvXMLImportPropertyMapper* CreateTableDefaultExtPropMapper(SvXMLImport&, XMLFontStylesContext* pFontDecls = NULL);
+ static SvXMLImportPropertyMapper* CreateTableRowDefaultExtPropMapper(SvXMLImport&, XMLFontStylesContext* pFontDecls = NULL);
+
+ SvI18NMap& GetRenameMap();
+
+ /// save the start of a range reference
+ void InsertBookmarkStartRange(
+ const OUString & sName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextRange> & rRange,
+ OUString const& i_rXmlId,
+ ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > &
+ i_rpRDFaAttributes);
+
+ /// process the start of a range reference
+ sal_Bool FindAndRemoveBookmarkStartRange(
+ const OUString & sName,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextRange> & o_rRange,
+ OUString & o_rXmlId,
+ ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > &
+ o_rpRDFaAttributes);
+
+ OUString FindActiveBookmarkName();
+
+ void pushFieldCtx( OUString name, OUString type );
+ void popFieldCtx();
+ void addFieldParam( OUString name, OUString value );
+ void setCurrentFieldParamsTo(::com::sun::star::uno::Reference< ::com::sun::star::text::XFormField> &xFormField);
+ OUString getCurrentFieldType();
+ bool hasCurrentFieldCtx();
+
+
+ /// insert new footnote ID.
+ /// Also fixup open references from the backpatch list to this ID.
+ // Code is implemented in XMLPropertyBackpatcher.cxx
+ void InsertFootnoteID(const OUString& sXMLId, sal_Int16 nAPIId);
+
+ /// set the proper footnote reference ID,
+ /// or put into backpatch list if ID is unknown
+ // Code is implemented in XMLPropertyBackpatcher.cxx
+ void ProcessFootnoteReference(
+ const OUString& sXMLId,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & xPropSet);
+
+ /// insert new sequence ID
+ /// Also fixup open references from backpatch list to this ID.
+ // Code is implemented in XMLPropertyBackpatcher.cxx
+ void InsertSequenceID(const OUString& sXMLId,
+ const OUString& sName,
+ sal_Int16 nAPIId);
+
+ /// set sequence ID or insert into backpatch list
+ // Code is implemented in XMLPropertyBackpatcher.cxx
+ void ProcessSequenceReference(
+ const OUString& sXMLId,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & xPropSet);
+
+ sal_Bool IsInFrame() const;
+ virtual sal_Bool IsInHeaderFooter() const;
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet>
+ createAndInsertOLEObject( SvXMLImport& rImport,
+ const OUString& rHRef,
+ const OUString &rStyleName,
+ const OUString &rTblName,
+ sal_Int32 nWidth, sal_Int32 nHeight );
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet>
+ createAndInsertOOoLink( SvXMLImport& rImport,
+ const OUString& rHRef,
+ const OUString &rStyleName,
+ const OUString &rTblName,
+ sal_Int32 nWidth, sal_Int32 nHeight );
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet>
+ createAndInsertApplet(
+ const OUString &rName,
+ const OUString &rCode,
+ sal_Bool bMayScript,
+ const OUString& rHRef,
+ sal_Int32 nWidth, sal_Int32 nHeight );
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet>
+ createAndInsertPlugin(
+ const OUString &rMimeType,
+ const OUString& rHRef,
+ sal_Int32 nWidth, sal_Int32 nHeight );
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet>
+ createAndInsertFloatingFrame(
+ const OUString &rName,
+ const OUString &rHRef,
+ const OUString &rStyleName,
+ sal_Int32 nWidth, sal_Int32 nHeight );
+
+ virtual void endAppletOrPlugin(
+ const com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> &rPropSet,
+ ::std::map < const OUString, OUString, ::comphelper::UStringLess > &rParamMap );
+
+ // applet helper methods
+ // implemented in sw/filter/xml/txtparai.hxx
+
+ // redlining helper methods
+ // (to be implemented in sw/filter/xml/txtparai.hxx)
+
+ virtual void RedlineAdd(
+ const OUString& rType, /// redline type (insert, del,... )
+ const OUString& rId, /// use to identify this redline
+ const OUString& rAuthor, /// name of the author
+ const OUString& rComment, /// redline comment
+ const ::com::sun::star::util::DateTime& rDateTime, /// date+time
+ sal_Bool bMergeLastParagraph); /// merge last paras
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextCursor> RedlineCreateText(
+ ::com::sun::star::uno::Reference< /// needed to get the document
+ ::com::sun::star::text::XTextCursor> & rOldCursor,
+ const OUString& rId); /// ID used to RedlineAdd() call
+ virtual void RedlineSetCursor(
+ const OUString& rId, /// ID used to RedlineAdd() call
+ sal_Bool bStart, /// start or end Cursor
+ sal_Bool bIsOutsideOfParagraph); /// range is not within <text:p>
+ virtual void RedlineAdjustStartNodeCursor(
+ sal_Bool bStart);
+ virtual void SetShowChanges( sal_Bool bShowChanges );
+ virtual void SetRecordChanges( sal_Bool bRecordChanges );
+ virtual void SetChangesProtectionKey(
+ const ::com::sun::star::uno::Sequence<sal_Int8> & rProtectionKey );
+
+ // access to the last open redline ID:
+ OUString GetOpenRedlineId();
+ void SetOpenRedlineId( OUString& rId);
+ void ResetOpenRedlineId();
+
+ // #107848#
+ // Access methods to the inside_deleted_section flag (redlining)
+ void SetInsideDeleteContext(bool const bNew);
+ bool IsInsideDeleteContext() const;
+
+ SvXMLImport & GetXMLImport();
+
+ XMLTextListsHelper & GetTextListHelper();
+
+ // forwards to TextListHelper; these are used in many places
+ /// push a list context on the list context stack
+ void PushListContext(XMLTextListBlockContext *i_pListBlock = 0);
+ /// pop the list context stack
+ void PopListContext();
+
+ void SetCellParaStyleDefault(OUString const& rNewValue);
+ OUString const& GetCellParaStyleDefault();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/txtimppr.hxx b/include/xmloff/txtimppr.hxx
new file mode 100644
index 000000000000..ae58bdd9f55e
--- /dev/null
+++ b/include/xmloff/txtimppr.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 _XMLOFF_TXTIMPPR_HXX
+#define _XMLOFF_TXTIMPPR_HXX
+
+#include "xmloff/dllapi.h"
+#include <xmloff/xmlimppr.hxx>
+
+class XMLFontStylesContext;
+
+class XMLOFF_DLLPUBLIC XMLTextImportPropertyMapper : public SvXMLImportPropertyMapper
+{
+ sal_Int32 nSizeTypeIndex;
+ sal_Int32 nWidthTypeIndex;
+ SvXMLImportContextRef xFontDecls;
+
+ void FontFinished(
+ XMLPropertyState *pFontFamilyNameState,
+ XMLPropertyState *pFontStyleNameState,
+ XMLPropertyState *pFontFamilyState,
+ XMLPropertyState *pFontPitchState,
+ XMLPropertyState *pFontCharsetState ) const;
+
+ void FontDefaultsCheck(
+ XMLPropertyState*pFontFamilyName,
+ XMLPropertyState* pFontStyleName,
+ XMLPropertyState* pFontFamily,
+ XMLPropertyState* pFontPitch,
+ XMLPropertyState* pFontCharSet,
+ XMLPropertyState** ppNewFontStyleName,
+ XMLPropertyState** ppNewFontFamily,
+ XMLPropertyState** ppNewFontPitch,
+ XMLPropertyState** ppNewFontCharSet ) const;
+
+protected:
+ virtual bool handleSpecialItem(
+ XMLPropertyState& rProperty,
+ ::std::vector< XMLPropertyState >& rProperties,
+ const OUString& rValue,
+ const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap ) const;
+public:
+ XMLTextImportPropertyMapper(
+ const UniReference< XMLPropertySetMapper >& rMapper,
+ SvXMLImport& rImport,
+ XMLFontStylesContext *pFontDecls = 0 );
+ virtual ~XMLTextImportPropertyMapper();
+
+ void SetFontDecls( XMLFontStylesContext *pFontDecls );
+
+ /** This method is called when all attributes have benn processed. It may be used to remove items that are incomplete */
+ virtual void finished(
+ ::std::vector< XMLPropertyState >& rProperties,
+ sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const;
+};
+
+#endif // _XMLOFF_XMLIMPPR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx
new file mode 100644
index 000000000000..8e432e8cf7d7
--- /dev/null
+++ b/include/xmloff/txtparae.hxx
@@ -0,0 +1,728 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_TEXTPARAE_HXX_
+#define _XMLOFF_TEXTPARAE_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <xmloff/uniref.hxx>
+#include <xmloff/xmlexppr.hxx>
+#include <xmloff/styleexp.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/SinglePropertySetInfoCache.hxx>
+#include <xmloff/XMLStringVector.hxx>
+#include <vector>
+#include <boost/scoped_ptr.hpp>
+
+class XMLTextListsHelper;
+class SvXMLExport;
+class SvXMLAutoStylePoolP;
+class XMLTextFieldExport;
+class XMLTextNumRuleInfo;
+class XMLTextListAutoStylePool;
+class XMLSectionExport;
+class XMLIndexMarkExport;
+class XMLRedlineExport;
+struct XMLPropertyState;
+class MultiPropertySetHelper;
+
+namespace com { namespace sun { namespace star
+{
+ namespace beans { class XPropertySet; class XPropertyState;
+ class XPropertySetInfo; }
+ namespace container { class XEnumerationAccess; class XEnumeration; class XIndexAccess; }
+ namespace text { class XTextContent; class XTextRange; class XText;
+ class XFootnote; class XTextFrame; class XTextSection;
+ class XTextField;
+ class XDocumentIndex; class XTextShapesSupplier; }
+} } }
+
+namespace xmloff
+{
+ class OFormLayerXMLExport;
+ class BoundFrameSets;
+}
+
+class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport
+{
+ struct Impl;
+ ::boost::scoped_ptr<Impl> m_pImpl;
+
+// SvXMLExport& rExport;
+ SvXMLAutoStylePoolP& rAutoStylePool;
+ UniReference < SvXMLExportPropertyMapper > xParaPropMapper;
+ UniReference < SvXMLExportPropertyMapper > xTextPropMapper;
+ UniReference < SvXMLExportPropertyMapper > xFramePropMapper;
+ UniReference < SvXMLExportPropertyMapper > xAutoFramePropMapper;
+ UniReference < SvXMLExportPropertyMapper > xSectionPropMapper;
+ UniReference < SvXMLExportPropertyMapper > xRubyPropMapper;
+
+ const ::std::auto_ptr< ::xmloff::BoundFrameSets > pBoundFrameSets;
+ XMLTextFieldExport *pFieldExport;
+ std::vector<OUString> *pListElements;
+ XMLTextListAutoStylePool *pListAutoPool;
+ XMLSectionExport *pSectionExport;
+ XMLIndexMarkExport *pIndexMarkExport;
+
+ /// may be NULL (if no redlines should be exported; e.g. in block mode)
+ XMLRedlineExport *pRedlineExport;
+ XMLStringVector *pHeadingStyles;
+
+ sal_Bool bProgress;
+
+ sal_Bool bBlock;
+
+ // keep track of open rubies
+ OUString sOpenRubyText;
+ OUString sOpenRubyCharStyle;
+ sal_Bool bOpenRuby;
+
+ XMLTextListsHelper* mpTextListsHelper;
+ ::std::vector< XMLTextListsHelper* > maTextListsHelperStack;
+
+ enum FrameType { FT_TEXT, FT_GRAPHIC, FT_EMBEDDED, FT_SHAPE };
+public:
+
+ enum FieldmarkType { NONE, TEXT, CHECK }; // Used for simulating fieldmarks in OpenDocument 1.n Strict (for n <= 2). CHECK currently ignored.
+
+protected:
+
+ const OUString sActualSize;
+ // Implement Title/Description Elements UI (#i73249#)
+ const OUString sTitle;
+ const OUString sDescription;
+ const OUString sAnchorCharStyleName;
+ const OUString sAnchorPageNo;
+ const OUString sAnchorType;
+ const OUString sBeginNotice;
+ const OUString sBookmark;
+ const OUString sCategory;
+ const OUString sChainNextName;
+ const OUString sCharStyleName;
+ const OUString sCharStyleNames;
+ const OUString sContourPolyPolygon;
+ const OUString sDocumentIndex;
+ const OUString sDocumentIndexMark;
+ const OUString sEndNotice;
+ const OUString sFootnote;
+ const OUString sFootnoteCounting;
+ const OUString sFrame;
+ const OUString sFrameHeightAbsolute;
+ const OUString sFrameHeightPercent;
+ const OUString sFrameStyleName;
+ const OUString sFrameWidthAbsolute;
+ const OUString sFrameWidthPercent;
+ const OUString sGraphicFilter;
+ const OUString sGraphicRotation;
+ const OUString sGraphicURL;
+ const OUString sReplacementGraphicURL;
+ const OUString sHeight;
+ const OUString sHoriOrient;
+ const OUString sHoriOrientPosition;
+ const OUString sHyperLinkName;
+ const OUString sHyperLinkTarget;
+ const OUString sHyperLinkURL;
+ const OUString sIsAutomaticContour;
+ const OUString sIsCollapsed;
+ const OUString sIsPixelContour;
+ const OUString sIsStart;
+ const OUString sIsSyncHeightToWidth;
+ const OUString sIsSyncWidthToHeight;
+ const OUString sNumberingRules;
+ const OUString sNumberingType;
+ const OUString sPageDescName;
+ const OUString sPageStyleName;
+ const OUString sParaChapterNumberingLevel;
+ const OUString sParaConditionalStyleName;
+ const OUString sParagraphService;
+ const OUString sParaStyleName;
+ const OUString sPositionEndOfDoc;
+ const OUString sPrefix;
+ const OUString sRedline;
+ const OUString sReferenceId;
+ const OUString sReferenceMark;
+ const OUString sRelativeHeight;
+ const OUString sRelativeWidth;
+ const OUString sRuby;
+ const OUString sRubyAdjust;
+ const OUString sRubyCharStyleName;
+ const OUString sRubyText;
+ const OUString sServerMap;
+ const OUString sShapeService;
+ const OUString sSizeType;
+ const OUString sSoftPageBreak;
+ const OUString sStartAt;
+ const OUString sSuffix;
+ const OUString sTableService;
+ const OUString sText;
+ const OUString sTextContentService;
+ const OUString sTextEmbeddedService;
+ const OUString sTextEndnoteService;
+ const OUString sTextField;
+ const OUString sTextFieldService;
+ const OUString sTextFrameService;
+ const OUString sTextGraphicService;
+ const OUString sTextPortionType;
+ const OUString sTextSection;
+ const OUString sUnvisitedCharStyleName;
+ const OUString sVertOrient;
+ const OUString sVertOrientPosition;
+ const OUString sVisitedCharStyleName;
+ const OUString sWidth;
+ const OUString sWidthType;
+ const OUString sTextFieldStart;
+ const OUString sTextFieldEnd;
+ const OUString sTextFieldStartEnd;
+
+ SinglePropertySetInfoCache aCharStyleNamesPropInfoCache;
+
+// SvXMLExport& GetExport() { return rExport; }
+// const SvXMLExport& GetExport() const { return rExport; }
+
+ UniReference < SvXMLExportPropertyMapper > GetParaPropMapper() const
+ {
+ return xParaPropMapper;
+ }
+
+ UniReference < SvXMLExportPropertyMapper > GetTextPropMapper() const
+ {
+ return xTextPropMapper;
+ }
+
+ UniReference < SvXMLExportPropertyMapper > GetFramePropMapper() const
+ {
+ return xFramePropMapper;
+ }
+ UniReference < SvXMLExportPropertyMapper > GetAutoFramePropMapper() const
+ {
+ return xAutoFramePropMapper;
+ }
+ UniReference < SvXMLExportPropertyMapper > GetSectionPropMapper() const
+ {
+ return xSectionPropMapper;
+ }
+ UniReference < SvXMLExportPropertyMapper > GetRubyPropMapper() const
+ {
+ return xRubyPropMapper;
+ }
+
+
+ SvXMLAutoStylePoolP& GetAutoStylePool() { return rAutoStylePool; }
+ const SvXMLAutoStylePoolP& GetAutoStylePool() const { return rAutoStylePool; }
+
+public:
+ OUString FindTextStyleAndHyperlink(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ sal_Bool& rbHyperlink,
+ sal_Bool& rbHasCharStyle,
+ sal_Bool& rbHasAutoStyle,
+ const XMLPropertyState** pAddState = NULL) const;
+ sal_Bool addHyperlinkAttributes(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertyState > & rPropState,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+
+ void exportTextRangeEnumeration(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XEnumeration > & rRangeEnum,
+ sal_Bool bAutoStyles, sal_Bool bProgress,
+ sal_Bool bPrvChrIsSpc = sal_True );
+
+protected:
+
+ sal_Int32 addTextFrameAttributes(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet >& rPropSet,
+ sal_Bool bShape,
+ OUString *pMinHeightValue = 0,
+ OUString *pMinWidthValue = 0 );
+
+ virtual void exportStyleAttributes(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::style::XStyle > & rStyle );
+
+ void exportPageFrames( sal_Bool bAutoStyles, sal_Bool bProgress );
+ void exportFrameFrames( sal_Bool bAutoStyles, sal_Bool bProgress,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextFrame > *pParentTxtFrame = 0 );
+
+ void exportNumStyles( sal_Bool bUsed );
+
+ void exportText(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XText > & rText,
+ sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportParagraph );
+
+ void exportText(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XText > & rText,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextSection > & rBaseSection,
+ sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportParagraph );
+
+ sal_Bool exportTextContentEnumeration(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XEnumeration > & rContentEnum,
+ sal_Bool bAutoStyles,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextSection > & rBaseSection,
+ sal_Bool bProgress,
+ sal_Bool bExportParagraph = sal_True,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0,
+ sal_Bool bExportLevels = sal_True );
+ void exportParagraph(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rTextContent,
+ sal_Bool bAutoStyles, sal_Bool bProgress,
+ sal_Bool bExportParagraph,
+ MultiPropertySetHelper& rPropSetHelper);
+ virtual void exportTable(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rTextContent,
+ sal_Bool bAutoStyles, sal_Bool bProgress );
+
+ void exportTextField(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextRange > & rTextRange,
+ sal_Bool bAutoStyles, sal_Bool bProgress );
+
+ void exportTextField(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextField> & xTextField,
+ const sal_Bool bAutoStyles, const sal_Bool bProgress,
+ const sal_Bool bRecursive );
+
+ void exportAnyTextFrame(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rTextContent,
+ FrameType eTxpe,
+ sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportContent,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
+ void _exportTextFrame(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo,
+ sal_Bool bProgress );
+ inline void exportTextFrame(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rTextContent,
+ sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportContent,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
+ inline void exportShape(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rTextContent,
+ sal_Bool bAutoStyles,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
+
+ void exportContour(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ void _exportTextGraphic(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ inline void exportTextGraphic(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rTextContent,
+ sal_Bool bAutoStyles,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
+
+ virtual void _collectTextEmbeddedAutoStyles(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet );
+ virtual void _exportTextEmbedded(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+ inline void exportTextEmbedded(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rTextContent,
+ sal_Bool bAutoStyles,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
+ virtual void setTextEmbeddedGraphicURL(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet >& rPropSet,
+ OUString& rStreamName ) const;
+
+ /// export a footnote and styles
+ void exportTextFootnote(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const OUString& sString,
+ sal_Bool bAutoStyles, sal_Bool bProgress );
+
+ /// helper for exportTextFootnote
+ void exportTextFootnoteHelper(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XFootnote > & rPropSet,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XText> & rText,
+ const OUString& sString,
+ sal_Bool bAutoStyles,
+ sal_Bool bIsEndnote, sal_Bool bProgress );
+
+ /// export footnote and endnote configuration elements
+ void exportTextFootnoteConfiguration();
+
+ void exportTextFootnoteConfigurationHelper(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & rFootnoteSupplier,
+ sal_Bool bIsEndnote);
+
+ void exportTextMark(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & xPropSet,
+ const OUString& rProperty,
+ const enum ::xmloff::token::XMLTokenEnum pElements[],
+ sal_Bool bAutoStyles);
+
+ void exportIndexMark(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & rPropSet,
+ sal_Bool bAutoStyles);
+
+ void exportSoftPageBreak(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & rPropSet,
+ sal_Bool bAutoStyles);
+
+ void exportTextRange(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextRange > & rTextRange,
+ sal_Bool bAutoStyles,
+ bool& rPrevCharWasSpace,
+ FieldmarkType& openFieldmarkType );
+
+ void exportListChange( const XMLTextNumRuleInfo& rPrvInfo,
+ const XMLTextNumRuleInfo& rNextInfo );
+
+ /// check if current section or current list has changed;
+ /// calls exortListChange as appropriate
+ void exportListAndSectionChange(
+ ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextSection > & rOldSection,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextSection > & rNewSection,
+ const XMLTextNumRuleInfo& rOldList,
+ const XMLTextNumRuleInfo& rNewList,
+ sal_Bool bAutoStyles );
+
+ /// overload for exportListAndSectionChange;
+ /// takes new content rather than new section.
+ void exportListAndSectionChange(
+ ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextSection > & rOldSection,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rNewContent,
+ const XMLTextNumRuleInfo& rOldList,
+ const XMLTextNumRuleInfo& rNewList,
+ sal_Bool bAutoStyles );
+ void exportListAndSectionChange(
+ ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextSection > & rOldSection,
+ MultiPropertySetHelper& rPropSetHelper,
+ sal_Int16 nTextSectionId,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rNewContent,
+ const XMLTextNumRuleInfo& rOldList,
+ const XMLTextNumRuleInfo& rNewList,
+ sal_Bool bAutoStyles );
+
+ /// export a redline text portion
+ void exportChange(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ sal_Bool bAutoStyle);
+
+ /// export a ruby
+ void exportRuby(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & rPortionPropSet,
+ sal_Bool bAutoStyles );
+
+ /// export a text:meta
+ void exportMeta(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & i_xPortion,
+ sal_Bool i_bAutoStyles, sal_Bool i_isProgress );
+
+public:
+
+ XMLTextParagraphExport(
+ SvXMLExport& rExp,
+ SvXMLAutoStylePoolP & rASP
+ );
+ virtual ~XMLTextParagraphExport();
+
+ /// add autostyle for specified family
+ void Add(
+ sal_uInt16 nFamily,
+ MultiPropertySetHelper& rPropSetHelper,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const XMLPropertyState** pAddState = NULL );
+ void Add(
+ sal_uInt16 nFamily,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const XMLPropertyState** pAddState = NULL, bool bDontSeek = false );
+
+ /// find style name for specified family and parent
+ OUString Find(
+ sal_uInt16 nFamily,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const OUString& rParent,
+ const XMLPropertyState** pAddState = NULL ) const;
+
+ static SvXMLExportPropertyMapper *CreateShapeExtPropMapper(
+ SvXMLExport& rExport );
+ static SvXMLExportPropertyMapper *CreateCharExtPropMapper(
+ SvXMLExport& rExport);
+ static SvXMLExportPropertyMapper *CreateParaExtPropMapper(
+ SvXMLExport& rExport);
+ static SvXMLExportPropertyMapper *CreateParaDefaultExtPropMapper(
+ SvXMLExport& rExport);
+
+ // This methods exports all (or all used) styles
+ void exportTextStyles( sal_Bool bUsed
+ , sal_Bool bProg = sal_False
+ );
+
+ /// This method exports (text field) declarations etc.
+ void exportTextDeclarations();
+
+ /// export the (text field) declarations for a particular XText
+ void exportTextDeclarations(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XText > & rText );
+
+ /// true: export only those declarations that are used;
+ /// false: export all declarations
+ void exportUsedDeclarations( sal_Bool bOnlyUsed );
+
+ /// Export the list of change information (enclosed by <tracked-changes>)
+ /// (or the necessary automatic styles)
+ void exportTrackedChanges(sal_Bool bAutoStyle);
+
+ /// Export the list of change information (enclosed by <tracked-changes>)
+ /// (or the necessary automatic styles)
+ void exportTrackedChanges(const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XText > & rText,
+ sal_Bool bAutoStyle );
+
+ /// Record tracked changes for this particular XText
+ /// (empty reference stop recording)
+ /// This should be used if tracked changes for e.g. footers are to
+ /// be exported seperately via the exportTrackedChanges(sal_Bool,
+ /// Reference<XText>) method.
+ void recordTrackedChangesForXText(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XText > & rText );
+
+
+ /// Stop recording tracked changes.
+ /// This is the same as calling recordTrackedChanges(...) with an
+ /// empty reference.
+ void recordTrackedChangesNoXText();
+
+
+ // This method exports the given OUString
+ void exportText(
+ const OUString& rText,
+ bool& rPrevCharWasSpace );
+
+ // This method collects all automatic styles for the given XText
+ void collectTextAutoStyles(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XText > & rText,
+ sal_Bool bIsProgress = sal_False,
+ sal_Bool bExportParagraph = sal_True )
+ {
+ exportText( rText, sal_True, bIsProgress, bExportParagraph );
+ }
+
+ void collectTextAutoStyles(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XText > & rText,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextSection > & rBaseSection,
+ sal_Bool bIsProgress = sal_False,
+ sal_Bool bExportParagraph = sal_True )
+ {
+ exportText( rText, rBaseSection, sal_True, bIsProgress, bExportParagraph );
+ }
+
+ // It the model implements the xAutoStylesSupplier interface, the automatic
+ // styles can exported without iterating over the text portions
+ bool collectTextAutoStylesOptimized(
+ sal_Bool bIsProgress = sal_False );
+
+ // This method exports all automatic styles that have been collected.
+ virtual void exportTextAutoStyles();
+
+ void exportEvents( const ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > & rPropSet );
+
+ // Implement Title/Description Elements UI (#i73249#)
+ void exportTitleAndDescription( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
+
+ // This method exports the given XText
+ void exportText(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XText > & rText,
+ sal_Bool bIsProgress = sal_False,
+ sal_Bool bExportParagraph = sal_True)
+ {
+ exportText( rText, sal_False, bIsProgress, bExportParagraph );
+ }
+
+ void exportText(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XText > & rText,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextSection > & rBaseSection,
+ sal_Bool bIsProgress = sal_False,
+ sal_Bool bExportParagraph = sal_True)
+ {
+ exportText( rText, rBaseSection, sal_False, bIsProgress, bExportParagraph );
+ }
+
+ void exportFramesBoundToPage( sal_Bool bIsProgress = sal_False )
+ {
+ exportPageFrames( sal_False, bIsProgress );
+ }
+ void exportFramesBoundToFrame(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextFrame >& rParentTxtFrame,
+ sal_Bool bIsProgress = sal_False )
+ {
+ exportFrameFrames( sal_False, bIsProgress, &rParentTxtFrame );
+ }
+ inline const XMLTextListAutoStylePool& GetListAutoStylePool() const;
+
+ void SetBlockMode( sal_Bool bSet ) { bBlock = bSet; }
+ sal_Bool IsBlockMode() const { return bBlock; }
+
+
+ UniReference < SvXMLExportPropertyMapper > GetParagraphPropertyMapper() const
+ {
+ return xParaPropMapper;
+ }
+
+
+ /** exclude form controls which are in mute sections.
+ *
+ * This method is necessary to prevent the form layer export from exporting
+ * control models whose controls are not represented in the document. To
+ * achieve this, this method iterates over all shapes, checks to see if
+ * they are control shapes, and if so, whether they should be exported or
+ * not. If not, the form layer export will be notified accordingly.
+ *
+ * The reason this method is located here is tha it needs to access the
+ * XMLSectionExport, which is only available here.
+ */
+ void PreventExportOfControlsInMuteSections(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XIndexAccess> & rShapes,
+ UniReference<xmloff::OFormLayerXMLExport> xFormExport );
+
+ SinglePropertySetInfoCache& GetCharStyleNamesPropInfoCache() { return aCharStyleNamesPropInfoCache; }
+
+ void PushNewTextListsHelper();
+
+ void PopTextListsHelper();
+
+private:
+ XMLTextParagraphExport(XMLTextParagraphExport &); // private copy-ctor because of explicit copy-ctor of auto_ptr
+};
+
+inline const XMLTextListAutoStylePool&
+ XMLTextParagraphExport::GetListAutoStylePool() const
+{
+ return *pListAutoPool;
+}
+
+inline void XMLTextParagraphExport::exportTextFrame(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rTextContent,
+ sal_Bool bAutoStyles, sal_Bool bIsProgress, sal_Bool bExportContent,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > *pRangePropSet)
+{
+ exportAnyTextFrame( rTextContent, FT_TEXT, bAutoStyles, bIsProgress,
+ bExportContent, pRangePropSet );
+}
+
+inline void XMLTextParagraphExport::exportTextGraphic(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rTextContent,
+ sal_Bool bAutoStyles,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > *pRangePropSet )
+{
+ exportAnyTextFrame( rTextContent, FT_GRAPHIC, bAutoStyles, sal_False,
+ sal_True, pRangePropSet );
+}
+
+inline void XMLTextParagraphExport::exportTextEmbedded(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rTextContent,
+ sal_Bool bAutoStyles,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > *pRangePropSet )
+{
+ exportAnyTextFrame( rTextContent, FT_EMBEDDED, bAutoStyles, sal_False,
+ sal_True, pRangePropSet );
+}
+
+inline void XMLTextParagraphExport::exportShape(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::text::XTextContent > & rTextContent,
+ sal_Bool bAutoStyles,
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet > *pRangePropSet )
+{
+ exportAnyTextFrame( rTextContent, FT_SHAPE, bAutoStyles, sal_False,
+ sal_True, pRangePropSet );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/txtprmap.hxx b/include/xmloff/txtprmap.hxx
new file mode 100644
index 000000000000..9228591152be
--- /dev/null
+++ b/include/xmloff/txtprmap.hxx
@@ -0,0 +1,204 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _XMLOFF_TEXTPRMAP_HXX_
+#define _XMLOFF_TEXTPRMAP_HXX_
+
+#include <xmloff/contextid.hxx>
+#include <xmloff/xmlprmap.hxx>
+
+#define CTF_CHARHEIGHT (XML_TEXT_CTF_START + 1)
+#define CTF_CHARHEIGHT_REL (XML_TEXT_CTF_START + 2)
+#define CTF_PARALEFTMARGIN (XML_TEXT_CTF_START + 3)
+#define CTF_PARALEFTMARGIN_REL (XML_TEXT_CTF_START + 4)
+#define CTF_PARARIGHTMARGIN (XML_TEXT_CTF_START + 5)
+#define CTF_PARARIGHTMARGIN_REL (XML_TEXT_CTF_START + 6)
+#define CTF_PARAFIRSTLINE (XML_TEXT_CTF_START + 7)
+#define CTF_PARAFIRSTLINE_REL (XML_TEXT_CTF_START + 8)
+#define CTF_PARATOPMARGIN (XML_TEXT_CTF_START + 9)
+#define CTF_PARATOPMARGIN_REL (XML_TEXT_CTF_START + 10)
+#define CTF_PARABOTTOMMARGIN (XML_TEXT_CTF_START + 11)
+#define CTF_PARABOTTOMMARGIN_REL (XML_TEXT_CTF_START + 12)
+#define CTF_ALLBORDERWIDTH (XML_TEXT_CTF_START + 13)
+#define CTF_LEFTBORDERWIDTH (XML_TEXT_CTF_START + 14)
+#define CTF_RIGHTBORDERWIDTH (XML_TEXT_CTF_START + 15)
+#define CTF_TOPBORDERWIDTH (XML_TEXT_CTF_START + 16)
+#define CTF_BOTTOMBORDERWIDTH (XML_TEXT_CTF_START + 17)
+#define CTF_ALLBORDERDISTANCE (XML_TEXT_CTF_START + 18)
+#define CTF_LEFTBORDERDISTANCE (XML_TEXT_CTF_START + 19)
+#define CTF_RIGHTBORDERDISTANCE (XML_TEXT_CTF_START + 20)
+#define CTF_TOPBORDERDISTANCE (XML_TEXT_CTF_START + 21)
+#define CTF_BOTTOMBORDERDISTANCE (XML_TEXT_CTF_START + 22)
+#define CTF_ALLBORDER (XML_TEXT_CTF_START + 23)
+#define CTF_LEFTBORDER (XML_TEXT_CTF_START + 24)
+#define CTF_RIGHTBORDER (XML_TEXT_CTF_START + 25)
+#define CTF_TOPBORDER (XML_TEXT_CTF_START + 26)
+#define CTF_BOTTOMBORDER (XML_TEXT_CTF_START + 27)
+#define CTF_DROPCAPWHOLEWORD (XML_TEXT_CTF_START + 28)
+#define CTF_DROPCAPFORMAT (XML_TEXT_CTF_START + 29)
+#define CTF_DROPCAPCHARSTYLE (XML_TEXT_CTF_START + 30)
+#define CTF_TABSTOP (XML_TEXT_CTF_START + 31)
+#define CTF_NUMBERINGSTYLENAME (XML_TEXT_CTF_START + 32)
+#define CTF_OLDTEXTBACKGROUND (XML_TEXT_CTF_START + 33)
+#define CTF_FONTFAMILYNAME (XML_TEXT_CTF_START + 34)
+#define CTF_FONTSTYLENAME (XML_TEXT_CTF_START + 35)
+#define CTF_FONTFAMILY (XML_TEXT_CTF_START + 36)
+#define CTF_FONTPITCH (XML_TEXT_CTF_START + 37)
+#define CTF_FONTCHARSET (XML_TEXT_CTF_START + 38)
+#define CTF_TEXTWRITINGMODE (XML_TEXT_CTF_START + 39)
+#define CTF_SYNCHEIGHT_MIN (XML_TEXT_CTF_START + 40)
+#define CTF_FRAMEHEIGHT_ABS (XML_TEXT_CTF_START + 41)
+#define CTF_FRAMEHEIGHT_REL (XML_TEXT_CTF_START + 42)
+#define CTF_FRAMEHEIGHT_MIN_ABS (XML_TEXT_CTF_START + 43)
+#define CTF_FRAMEHEIGHT_MIN_REL (XML_TEXT_CTF_START + 44)
+#define CTF_SIZETYPE (XML_TEXT_CTF_START + 45)
+#define CTF_SYNCHEIGHT (XML_TEXT_CTF_START + 46)
+#define CTF_WRAP (XML_TEXT_CTF_START + 47)
+#define CTF_WRAP_CONTOUR (XML_TEXT_CTF_START + 48)
+#define CTF_WRAP_CONTOUR_MODE (XML_TEXT_CTF_START + 49)
+#define CTF_WRAP_PARAGRAPH_ONLY (XML_TEXT_CTF_START + 50)
+#define CTF_ANCHORTYPE (XML_TEXT_CTF_START + 51)
+#define CTF_ANCHORPAGENUMBER (XML_TEXT_CTF_START + 52)
+#define CTF_TEXTCOLUMNS (XML_TEXT_CTF_START + 53)
+#define CTF_HORIZONTALPOS (XML_TEXT_CTF_START + 54)
+#define CTF_HORIZONTALPOS_MIRRORED (XML_TEXT_CTF_START + 55)
+#define CTF_HORIZONTALREL (XML_TEXT_CTF_START + 56)
+#define CTF_HORIZONTALREL_FRAME (XML_TEXT_CTF_START + 57)
+#define CTF_HORIZONTALMIRROR (XML_TEXT_CTF_START + 58)
+#define CTF_VERTICALPOS (XML_TEXT_CTF_START + 59)
+#define CTF_VERTICALREL (XML_TEXT_CTF_START + 60)
+#define CTF_VERTICALREL_PAGE (XML_TEXT_CTF_START + 61)
+#define CTF_VERTICALREL_FRAME (XML_TEXT_CTF_START + 62)
+#define CTF_VERTICALREL_ASCHAR (XML_TEXT_CTF_START + 63)
+#define CTF_PAGEDESCNAME (XML_TEXT_CTF_START + 64)
+#define CTF_BACKGROUND_URL (XML_TEXT_CTF_START + 66)
+#define CTF_BACKGROUND_POS (XML_TEXT_CTF_START + 67)
+#define CTF_BACKGROUND_FILTER (XML_TEXT_CTF_START + 68)
+#define CTF_CHARHEIGHT_DIFF (XML_TEXT_CTF_START + 69)
+#define CTF_FONTNAME (XML_TEXT_CTF_START + 70)
+#define CTF_FONTNAME_CJK (XML_TEXT_CTF_START + 71)
+#define CTF_FONTFAMILYNAME_CJK (XML_TEXT_CTF_START + 72)
+#define CTF_FONTSTYLENAME_CJK (XML_TEXT_CTF_START + 73)
+#define CTF_FONTFAMILY_CJK (XML_TEXT_CTF_START + 74)
+#define CTF_FONTPITCH_CJK (XML_TEXT_CTF_START + 75)
+#define CTF_FONTCHARSET_CJK (XML_TEXT_CTF_START + 76)
+#define CTF_CHARHEIGHT_CJK (XML_TEXT_CTF_START + 77)
+#define CTF_CHARHEIGHT_REL_CJK (XML_TEXT_CTF_START + 78)
+#define CTF_CHARHEIGHT_DIFF_CJK (XML_TEXT_CTF_START + 79)
+#define CTF_FONTNAME_CTL (XML_TEXT_CTF_START + 80)
+#define CTF_FONTFAMILYNAME_CTL (XML_TEXT_CTF_START + 81)
+#define CTF_FONTSTYLENAME_CTL (XML_TEXT_CTF_START + 82)
+#define CTF_FONTFAMILY_CTL (XML_TEXT_CTF_START + 83)
+#define CTF_FONTPITCH_CTL (XML_TEXT_CTF_START + 84)
+#define CTF_FONTCHARSET_CTL (XML_TEXT_CTF_START + 85)
+#define CTF_CHARHEIGHT_CTL (XML_TEXT_CTF_START + 86)
+#define CTF_CHARHEIGHT_REL_CTL (XML_TEXT_CTF_START + 87)
+#define CTF_CHARHEIGHT_DIFF_CTL (XML_TEXT_CTF_START + 88)
+#define CTF_UNDERLINE (XML_TEXT_CTF_START + 89)
+#define CTF_UNDERLINE_COLOR (XML_TEXT_CTF_START + 90)
+#define CTF_UNDERLINE_HASCOLOR (XML_TEXT_CTF_START + 91)
+#define CTF_SECTION_FOOTNOTE_END (XML_TEXT_CTF_START + 92)
+#define CTF_SECTION_FOOTNOTE_NUM_RESTART (XML_TEXT_CTF_START + 93)
+#define CTF_SECTION_FOOTNOTE_NUM_RESTART_AT (XML_TEXT_CTF_START + 94)
+#define CTF_SECTION_FOOTNOTE_NUM_TYPE (XML_TEXT_CTF_START + 95)
+#define CTF_SECTION_FOOTNOTE_NUM_PREFIX (XML_TEXT_CTF_START + 96)
+#define CTF_SECTION_FOOTNOTE_NUM_SUFFIX (XML_TEXT_CTF_START + 97)
+#define CTF_SECTION_FOOTNOTE_NUM_OWN (XML_TEXT_CTF_START + 98)
+#define CTF_SECTION_ENDNOTE_END (XML_TEXT_CTF_START + 99)
+#define CTF_SECTION_ENDNOTE_NUM_RESTART (XML_TEXT_CTF_START + 100)
+#define CTF_SECTION_ENDNOTE_NUM_RESTART_AT (XML_TEXT_CTF_START + 101)
+#define CTF_SECTION_ENDNOTE_NUM_TYPE (XML_TEXT_CTF_START + 102)
+#define CTF_SECTION_ENDNOTE_NUM_PREFIX (XML_TEXT_CTF_START + 103)
+#define CTF_SECTION_ENDNOTE_NUM_SUFFIX (XML_TEXT_CTF_START + 104)
+#define CTF_SECTION_ENDNOTE_NUM_OWN (XML_TEXT_CTF_START + 105)
+#define CTF_PAGE_FOOTNOTE (XML_TEXT_CTF_START + 106)
+#define CTF_FRAME_DISPLAY_SCROLLBAR (XML_TEXT_CTF_START + 107)
+#define CTF_FRAME_DISPLAY_BORDER (XML_TEXT_CTF_START + 108)
+#define CTF_FRAME_MARGIN_HORI (XML_TEXT_CTF_START + 109)
+#define CTF_FRAME_MARGIN_VERT (XML_TEXT_CTF_START + 110)
+#define CTF_COMBINED_CHARACTERS_FIELD (XML_TEXT_CTF_START + 111)
+#define CTF_OLE_VIS_AREA_TOP (XML_TEXT_CTF_START + 112)
+#define CTF_OLE_VIS_AREA_LEFT (XML_TEXT_CTF_START + 113)
+#define CTF_OLE_VIS_AREA_WIDTH (XML_TEXT_CTF_START + 114)
+#define CTF_OLE_VIS_AREA_HEIGHT (XML_TEXT_CTF_START + 115)
+#define CTF_OLE_DRAW_ASPECT (XML_TEXT_CTF_START + 116)
+#define CTF_HYPERLINK_URL (XML_TEXT_CTF_START + 117)
+#define CTF_CHAR_STYLE_NAME (XML_TEXT_CTF_START + 118)
+#define CTF_VERTICALPOS_ATCHAR (XML_TEXT_CTF_START + 119)
+#define CTF_BACKGROUND_TRANSPARENCY (XML_TEXT_CTF_START + 120)
+#define CTF_BACKGROUND_TRANSPARENT (XML_TEXT_CTF_START + 121)
+#define CTF_KEEP_TOGETHER (XML_TEXT_CTF_START + 122)
+#define CTF_FRAMEWIDTH_ABS (XML_TEXT_CTF_START + 123)
+#define CTF_FRAMEWIDTH_MIN_ABS (XML_TEXT_CTF_START + 124)
+#define CTF_FRAMEWIDTH_MIN_REL (XML_TEXT_CTF_START + 125)
+#define CTF_FRAMEWIDTH_REL (XML_TEXT_CTF_START + 126)
+#define CTF_FRAMEWIDTH_TYPE (XML_TEXT_CTF_START + 127)
+#define CTF_BORDER_MODEL (XML_TEXT_CTF_START + 128)
+/* Define CTF ids for positioning properties of
+ shapes, because on export to OpenOffice.org file format these have to
+ be handled special, if shape isn't anchored as-character. (#i28749#)
+*/
+#define CTF_SHAPE_HORIZONTALPOS (XML_TEXT_CTF_START + 129)
+#define CTF_SHAPE_HORIZONTALPOS_MIRRORED (XML_TEXT_CTF_START + 130)
+#define CTF_SHAPE_HORIZONTALREL (XML_TEXT_CTF_START + 131)
+#define CTF_SHAPE_HORIZONTALREL_FRAME (XML_TEXT_CTF_START + 132)
+#define CTF_SHAPE_HORIZONTALMIRROR (XML_TEXT_CTF_START + 133)
+#define CTF_SHAPE_VERTICALPOS (XML_TEXT_CTF_START + 134)
+#define CTF_SHAPE_VERTICALPOS_ATCHAR (XML_TEXT_CTF_START + 135)
+#define CTF_SHAPE_VERTICALREL (XML_TEXT_CTF_START + 136)
+#define CTF_SHAPE_VERTICALREL_PAGE (XML_TEXT_CTF_START + 137)
+#define CTF_SHAPE_VERTICALREL_FRAME (XML_TEXT_CTF_START + 138)
+#define CTF_PARA_ADJUSTLAST (XML_TEXT_CTF_START + 139)
+#define CTF_DEFAULT_OUTLINE_LEVEL (XML_TEXT_CTF_START + 140)
+#define CTF_OLD_FLOW_WITH_TEXT (XML_TEXT_CTF_START + 141)
+#define CTF_ISNUMBERING (XML_TEXT_CTF_START + 142)
+#define CTF_TEXT_DISPLAY (XML_TEXT_CTF_START + 143)
+#define CTF_TEXT_CLIP (XML_TEXT_CTF_START + 144)
+#define CTF_TEXT_CLIP11 (XML_TEXT_CTF_START + 145)
+#define CTF_PARAMARGINALL (XML_TEXT_CTF_START + 146)
+#define CTF_PARAMARGINALL_REL (XML_TEXT_CTF_START + 147)
+#define CTF_MARGINALL (XML_TEXT_CTF_START + 148)
+#define CTF_MARGINLEFT (XML_TEXT_CTF_START + 149)
+#define CTF_MARGINRIGHT (XML_TEXT_CTF_START + 150)
+#define CTF_MARGINTOP (XML_TEXT_CTF_START + 151)
+#define CTF_MARGINBOTTOM (XML_TEXT_CTF_START + 152)
+
+#define TEXT_PROP_MAP_TEXT 0
+#define TEXT_PROP_MAP_PARA 1
+#define TEXT_PROP_MAP_FRAME 2
+#define TEXT_PROP_MAP_AUTO_FRAME 3
+#define TEXT_PROP_MAP_SECTION 4
+#define TEXT_PROP_MAP_SHAPE 5
+#define TEXT_PROP_MAP_RUBY 6
+#define TEXT_PROP_MAP_SHAPE_PARA 7
+#define TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS 8
+#define TEXT_PROP_MAP_TABLE_DEFAULTS 9
+#define TEXT_PROP_MAP_TABLE_ROW_DEFAULTS 10
+
+class XMLOFF_DLLPUBLIC XMLTextPropertySetMapper : public XMLPropertySetMapper
+{
+public:
+ XMLTextPropertySetMapper( sal_uInt16 nType );
+ virtual ~XMLTextPropertySetMapper();
+
+ static const XMLPropertyMapEntry* getPropertyMapForType( sal_uInt16 _nType );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/txtstyli.hxx b/include/xmloff/txtstyli.hxx
new file mode 100644
index 000000000000..d645cfc11281
--- /dev/null
+++ b/include/xmloff/txtstyli.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 _XMLOFF_TXTSTYLI_HXX_
+#define _XMLOFF_TXTSTYLI_HXX_
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/prstylei.hxx>
+
+class SvXMLTokenMap;
+class XMLEventsImportContext;
+
+class XMLOFF_DLLPUBLIC XMLTextStyleContext : public XMLPropStyleContext
+{
+ OUString sListStyleName;
+ OUString sCategoryVal;
+ OUString sDropCapTextStyleName;
+ OUString sMasterPageName;
+ OUString sDataStyleName; // for grid columns only
+ const OUString sIsAutoUpdate;
+ const OUString sCategory;
+ const OUString sNumberingStyleName;
+ const OUString sOutlineLevel;
+
+public:
+ const OUString sDropCapCharStyleName;
+private:
+ const OUString sPageDescName;
+
+ sal_Int8 nOutlineLevel;
+
+ sal_Bool bAutoUpdate : 1;
+ sal_Bool bHasMasterPageName : 1;
+
+ sal_Bool bHasCombinedCharactersLetter : 1;
+
+ // Introduce import of empty list style (#i69523#)
+ sal_Bool mbListStyleSet : 1;
+
+ XMLEventsImportContext* pEventContext;
+
+protected:
+
+ virtual void SetAttribute( sal_uInt16 nPrefixKey,
+ const OUString& rLocalName,
+ const OUString& rValue );
+
+public:
+
+ TYPEINFO();
+
+ XMLTextStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
+ SvXMLStylesContext& rStyles, sal_uInt16 nFamily,
+ sal_Bool bDefaultStyle = sal_False );
+ virtual ~XMLTextStyleContext();
+
+ virtual SvXMLImportContext *CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ sal_Bool IsAutoUpdate() const { return bAutoUpdate; }
+
+ const OUString& GetListStyle() const { return sListStyleName; }
+ // XML import: reconstrution of assignment of paragraph style to outline levels (#i69629#)
+ sal_Bool IsListStyleSet() const
+ {
+ return mbListStyleSet;
+ }
+
+ const OUString& GetMasterPageName() const { return sMasterPageName; }
+ sal_Bool HasMasterPageName() const { return bHasMasterPageName; }
+ const OUString& GetDropCapStyleName() const { return sDropCapTextStyleName; }
+ const OUString& GetDataStyleName() const { return sDataStyleName; }
+
+ virtual void CreateAndInsert( sal_Bool bOverwrite );
+ virtual void Finish( sal_Bool bOverwrite );
+ virtual void SetDefaults();
+
+ // overload FillPropertySet, so we can get at the combined characters
+ virtual void FillPropertySet(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > & rPropSet );
+
+ inline sal_Bool HasCombinedCharactersLetter()
+ { return bHasCombinedCharactersLetter; }
+
+ const ::std::vector< XMLPropertyState > & _GetProperties() { return GetProperties(); }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/uniref.hxx b/include/xmloff/uniref.hxx
new file mode 100644
index 000000000000..808ed8212b97
--- /dev/null
+++ b/include/xmloff/uniref.hxx
@@ -0,0 +1,224 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _UNIVERSALL_REFERENCE_HXX
+#define _UNIVERSALL_REFERENCE_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <sal/types.h>
+#include <osl/interlck.h>
+
+/**
+ * An instance of this class holds a pointer to an object. The lifetime of
+ * the object is controled by the instance. The constructor calls
+ * acquire() and the destructor calls release().
+ * You could delive your class from the baseclass UniRefBase wich implements
+ * the methods acquire and release, yet.
+ */
+template< class T > class UniReference
+{
+private:
+ T* mpElement;
+
+public:
+ /** Create an empty reference.*/
+ UniReference()
+ : mpElement( NULL )
+ {}
+
+ /** Destroy the reference and releases the element.*/
+ inline ~UniReference();
+
+ /** Create a new reference with the same element as in rRef and acquire this one.*/
+ inline UniReference( const UniReference< T > & rRef );
+
+ /**
+ * Create a new reference with the given element pElement and acquire this one.
+ */
+ inline UniReference( T * pElement );
+
+ /**
+ * Release the reference and set the new one pObj.
+ */
+ inline UniReference< T > & operator = ( T * pElement );
+
+ /**
+ * Release the reference and set the new one from rObj.
+ */
+ inline UniReference< T > & operator = ( const UniReference< T > & rRef );
+
+ /**
+ * Return the pointer to the element, may be null.
+ */
+ inline T* operator -> () const;
+
+ /**
+ * Returns true if the pointer to the element is valid.
+ */
+ inline sal_Bool is() const;
+
+ /**
+ * Return true if both elements refer to the same object.
+ */
+ inline sal_Bool operator == ( const UniReference & rRef ) const;
+
+ /**
+ * Return true if both elements does not refer to the same object.
+ */
+ inline sal_Bool operator != ( const UniReference & rRef ) const;
+
+ /** Gets implementation pointer.
+ This call does <b>not</b> acquire the implementation.
+ <br>
+ @return <b>un</b>acquired implementation pointer
+ */
+ inline T* get() const;
+};
+
+class XMLOFF_DLLPUBLIC UniRefBase
+{
+private:
+ /**
+ * The reference counter.
+ */
+ oslInterlockedCount m_refCount;
+
+public:
+ UniRefBase() : m_refCount( 0 )
+ {}
+ virtual ~UniRefBase();
+
+ void acquire() { osl_atomic_increment( &m_refCount ); }
+ void release();
+
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// Inline-implementations of UniReference
+//
+
+/** Create a new reference with the same element as in rRef and acquire this one.*/
+template< class T >
+inline UniReference< T >::UniReference( const UniReference< T > & rRef )
+ : mpElement( rRef.mpElement )
+{
+ if( mpElement )
+ mpElement->acquire();
+}
+
+template< class T >
+inline UniReference< T >::~UniReference()
+{
+ if( mpElement )
+ mpElement->release();
+}
+
+/**
+ * Create a new reference with the given element pElement and acquire this one.
+ * @param pInterface the interface, pointer may be null.
+ */
+template< class T >
+inline UniReference< T >::UniReference( T * pElement )
+ : mpElement( pElement )
+{
+ if( mpElement )
+ mpElement->acquire();
+}
+
+/**
+ * Release the reference and set the new one pObj.<BR>
+ * <B>The operation is not thread save. You must protect all assigns to a reference class.</B>
+ */
+template< class T >
+inline UniReference< T > & UniReference< T >::operator = ( T * pElement )
+{
+ if( pElement )
+ pElement->acquire();
+ if( mpElement )
+ mpElement->release();
+
+ mpElement = pElement;
+
+ return *this;
+}
+
+/**
+ * Release the reference and set the new one from rObj.<BR>
+ * <B>The operation is not thread save. You must protect all assigns to a reference class.</B>
+ */
+template< class T >
+inline UniReference< T > & UniReference< T >::operator = ( const UniReference< T > & rRef )
+{
+ return operator = ( rRef.mpElement );
+}
+
+/**
+ * Return the pointer to the interface, may be null.
+ */
+template< class T >
+inline T* UniReference< T >::operator -> () const
+{
+ return get();
+}
+
+/**
+ * Return the pointer to the interface, may be null.
+ */
+template< class T >
+inline T* UniReference< T >::get () const
+{
+ return static_cast< T * >( mpElement );
+}
+
+/**
+ * Returns true if the pointer to the interface is valid.
+ */
+template< class T >
+inline sal_Bool UniReference< T >::is() const
+{
+ return (mpElement != 0);
+}
+/**
+ * Return true if both interfaces refer to the same object. The operation can be
+ * much more expensive than a pointer comparision.<BR>
+ *
+ * @param rRef another interface reference
+ */
+template< class T >
+inline sal_Bool UniReference< T >::operator == ( const UniReference & rRef ) const
+{
+ return ( mpElement == rRef.mpElement );
+}
+/**
+ * Return true if both interfaces does not refer to the same object. The operation can be
+ * much more expensive than a pointer comparision.<BR>
+ *
+ * @param rRef another interface reference
+ */
+template< class T >
+inline sal_Bool UniReference< T >::operator != ( const UniReference & rRef ) const
+{
+ return ( ! operator == ( rRef ) );
+}
+
+#endif // _UNIVERSALL_REFERENCE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/unoatrcn.hxx b/include/xmloff/unoatrcn.hxx
new file mode 100644
index 000000000000..616d1db4f740
--- /dev/null
+++ b/include/xmloff/unoatrcn.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 .
+ */
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+
+#include <cppuhelper/implbase3.hxx>
+
+extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SvUnoAttributeContainer_CreateInstance();
+
+class SvXMLAttrContainerData;
+
+class XMLOFF_DLLPUBLIC SvUnoAttributeContainer:
+ public ::cppu::WeakAggImplHelper3<
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XUnoTunnel,
+ ::com::sun::star::container::XNameContainer >
+{
+private:
+ SvXMLAttrContainerData* mpContainer;
+
+ SAL_DLLPRIVATE sal_uInt16 getIndexByName(const OUString& aName )
+ const;
+
+public:
+ SvUnoAttributeContainer( SvXMLAttrContainerData* pContainer = NULL );
+ virtual ~SvUnoAttributeContainer();
+
+ SvXMLAttrContainerData* GetContainerImpl() const { return mpContainer; }
+
+ static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType(void) throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL hasElements(void) throw( ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::container::XNameAccess
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName(const OUString& aName) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL hasByName(const OUString& aName) throw( ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::container::XNameReplace
+ virtual void SAL_CALL replaceByName(const OUString& aName, const ::com::sun::star::uno::Any& aElement) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::container::XNameContainer
+ virtual void SAL_CALL insertByName(const OUString& aName, const ::com::sun::star::uno::Any& aElement) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL removeByName(const OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::lang::XServiceInfo
+ virtual OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
+
+ friend ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SvUnoAttributeContainer_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr ) throw( ::com::sun::star::uno::Exception );
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/unointerfacetouniqueidentifiermapper.hxx b/include/xmloff/unointerfacetouniqueidentifiermapper.hxx
new file mode 100644
index 000000000000..e538cbe176e0
--- /dev/null
+++ b/include/xmloff/unointerfacetouniqueidentifiermapper.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 __COMPHELPER_UNOINTERFACETOUNIQUEIDENTIFIERMAPPER__
+#define __COMPHELPER_UNOINTERFACETOUNIQUEIDENTIFIERMAPPER__
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+
+#include <map>
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/XInterface.hpp>
+
+namespace comphelper
+{
+
+typedef ::std::map< OUString, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > IdMap_t;
+
+class XMLOFF_DLLPUBLIC UnoInterfaceToUniqueIdentifierMapper
+{
+public:
+ UnoInterfaceToUniqueIdentifierMapper();
+
+ /** returns a unique identifier for the given uno object. IF a uno object is
+ registered more than once, the returned identifier is always the same.
+ */
+ const OUString& registerReference( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rInterface );
+
+ /** registers the given uno object with the given identifier.
+
+ @returns
+ false, if the given identifier already exists and is not associated with the given interface
+ */
+ bool registerReference( const OUString& rIdentifier, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rInterface );
+
+ /** @returns
+ the identifier for the given uno object. If this uno object is not already
+ registered, an empty string is returned
+ */
+ const OUString& getIdentifier( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rInterface ) const;
+
+ /** @returns
+ the uno object that is registered with the given identifier. If no uno object
+ is registered with the given identifier, an empty reference is returned.
+ */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& getReference( const OUString& rIdentifier ) const;
+
+private:
+ bool findReference( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rInterface, IdMap_t::const_iterator& rIter ) const;
+ bool findIdentifier( const OUString& rIdentifier, IdMap_t::const_iterator& rIter ) const;
+
+ IdMap_t maEntries;
+ sal_Int32 mnNextId;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xformsexport.hxx b/include/xmloff/xformsexport.hxx
new file mode 100644
index 000000000000..802180126f1b
--- /dev/null
+++ b/include/xmloff/xformsexport.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 _XMLOFF_XFORMSEXPORT_HXX
+#define _XMLOFF_XFORMSEXPORT_HXX
+
+#include "xmloff/dllapi.h"
+#include <rtl/ustring.hxx>
+
+class SvXMLExport;
+namespace com { namespace sun { namespace star {
+ namespace uno { template<typename T> class Reference; }
+ namespace uno { template<typename T> class Sequence; }
+ namespace frame { class XModel; }
+ namespace beans { class XPropertySet; struct PropertyValue; }
+ namespace container { class XNameAccess; }
+} } }
+
+
+/** export an XForms model. */
+void SAL_DLLPRIVATE exportXForms( SvXMLExport& );
+
+OUString SAL_DLLPRIVATE getXFormsBindName( const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& xBinding );
+
+OUString SAL_DLLPRIVATE getXFormsListBindName( const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& xBinding );
+
+OUString SAL_DLLPRIVATE getXFormsSubmissionName( const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& xBinding );
+
+
+/** returns the settings of the given XForms container, to be exported as document specific settings
+*/
+void XMLOFF_DLLPUBLIC getXFormsSettings(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rXForms,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _out_rSettings
+ );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xformsimport.hxx b/include/xmloff/xformsimport.hxx
new file mode 100644
index 000000000000..b6770320dbd3
--- /dev/null
+++ b/include/xmloff/xformsimport.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 _XMLOFF_XFORMSIMPORT_HXX
+#define _XMLOFF_XFORMSIMPORT_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+
+#include <tools/solar.h> // for sal_uInt16
+#include <com/sun/star/uno/Reference.hxx>
+
+class SvXMLImport;
+class SvXMLImportContext;
+
+namespace com { namespace sun { namespace star {
+ namespace uno { template<typename T> class Reference; }
+ namespace beans { class XPropertySet; struct PropertyValue; }
+ namespace frame { class XModel; }
+ namespace container { class XNameAccess; }
+} } }
+
+/** create import context for xforms:model element. */
+XMLOFF_DLLPUBLIC SvXMLImportContext* createXFormsModelContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName );
+
+/** perform the actual binding of an XForms-binding with the suitable control
+ * @param document which contains the XForms-model(s)
+ * @param pair<XForms binding ID, reference to control>
+ */
+void bindXFormsValueBinding(
+ com::sun::star::uno::Reference<com::sun::star::frame::XModel>,
+ std::pair<com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>,OUString> );
+
+
+/** perform the actual binding of an XForms-binding as list source with a list control
+ * @param document which contains the XForms-model(s)
+ * @param pair<XForms binding ID, reference to control>
+ */
+void bindXFormsListBinding(
+ com::sun::star::uno::Reference<com::sun::star::frame::XModel>,
+ std::pair<com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>,OUString> );
+
+/** perform the actual binding of an XForms submission with the suitable control
+ * @param document which contains the XForms-model(s)
+ * @param pair<XForms submission ID, reference to control>
+ */
+void bindXFormsSubmission(
+ com::sun::star::uno::Reference<com::sun::star::frame::XModel>,
+ std::pair<com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>,OUString> );
+
+/** applies the given settings to the given XForms container
+*/
+void XMLOFF_DLLPUBLIC applyXFormsSettings(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rXForms,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rSettings
+ );
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlaustp.hxx b/include/xmloff/xmlaustp.hxx
new file mode 100644
index 000000000000..e08b027ddb0f
--- /dev/null
+++ b/include/xmloff/xmlaustp.hxx
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_XMLASTPLP_HXX
+#define _XMLOFF_XMLASTPLP_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <xmloff/xmlprmap.hxx>
+#include <xmloff/uniref.hxx>
+
+class SvXMLExportPropertyMapper;
+class SvXMLNamespaceMap;
+class SvXMLAutoStylePoolP_Impl;
+class SvXMLAttributeList;
+class SvXMLExport;
+namespace com { namespace sun { namespace star { namespace uno
+ { template<typename A> class Sequence; }
+} } }
+
+class XMLOFF_DLLPUBLIC SvXMLAutoStylePoolP : public UniRefBase
+{
+ friend class Test;
+ friend class SvXMLAutoStylePoolP_Impl;
+
+ SvXMLAutoStylePoolP_Impl *pImpl;
+
+protected:
+
+ virtual void exportStyleAttributes(
+ SvXMLAttributeList& rAttrList,
+ sal_Int32 nFamily,
+ const ::std::vector< XMLPropertyState >& rProperties,
+ const SvXMLExportPropertyMapper& rPropExp
+ , const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap
+ ) const;
+
+// this methode is executed after Properties Export, so you can e.g. export a map or so on
+ virtual void exportStyleContent(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
+ sal_Int32 nFamily,
+ const ::std::vector< XMLPropertyState >& rProperties,
+ const SvXMLExportPropertyMapper& rPropExp
+ , const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap
+ ) const;
+
+
+public:
+
+ SvXMLAutoStylePoolP( SvXMLExport& rExport);
+
+ virtual ~SvXMLAutoStylePoolP();
+
+ SvXMLExport& GetExport() const;
+
+ /** register a new family with its appropriate instance of a derivation of XMLPropertySetMapper
+ for family numbers see families.hxx
+ if bAsFamily is sal_False, the family name is used as element name
+ */
+ // TODO: Remove this ugly method as soon as possible
+ void AddFamily( sal_Int32 nFamily, const OUString& rStrName, SvXMLExportPropertyMapper* pMapper, OUString aStrPrefix, sal_Bool bAsFamily = sal_True );
+ void AddFamily( sal_Int32 nFamily, const OUString& rStrName,
+ const UniReference< SvXMLExportPropertyMapper >& rMapper,
+ const OUString& rStrPrefix, sal_Bool bAsFamily = sal_True );
+ void SetFamilyPropSetMapper( sal_Int32 nFamily,
+ const UniReference< SvXMLExportPropertyMapper >& rMapper );
+
+ /// Register a name that must not be used as a generated name.
+ void RegisterName( sal_Int32 nFamily, const OUString& rName );
+
+ /// retrieve the registered names (names + families)
+ void GetRegisteredNames(
+ com::sun::star::uno::Sequence<sal_Int32>& aFamilies,
+ com::sun::star::uno::Sequence<OUString>& aNames );
+
+ /// register (families + names)
+ void RegisterNames(
+ com::sun::star::uno::Sequence<sal_Int32>& aFamilies,
+ com::sun::star::uno::Sequence<OUString>& aNames );
+
+ /// Add an item set to the pool and return its generated name.
+ OUString Add( sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties );
+ OUString Add( sal_Int32 nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties, bool bDontSeek = false );
+ sal_Bool Add( OUString& rName, sal_Int32 nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties );
+
+ /// Add an item set with a pre-defined name (needed for saving sheets separately in Calc).
+ sal_Bool AddNamed( const OUString& rName, sal_Int32 nFamily, const OUString& rParent,
+ const ::std::vector< XMLPropertyState >& rProperties );
+
+ /// Find an item set's name.
+ OUString Find( sal_Int32 nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) const;
+
+ /** Export all item sets ofs a certain class in the order in that they have been added. */
+ void exportXML( sal_Int32 nFamily
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
+ const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap
+ ) const;
+
+ void ClearEntries();
+};
+
+#endif // _XMLOFF_XMLASTPLP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlcnimp.hxx b/include/xmloff/xmlcnimp.hxx
new file mode 100644
index 000000000000..f99c0a55ad73
--- /dev/null
+++ b/include/xmloff/xmlcnimp.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 _XMLOFF_XMLCNIMP_HXX
+#define _XMLOFF_XMLCNIMP_HXX
+
+#include "xmloff/dllapi.h" //XMLOFF_DLLPUBLIC
+#include <sal/types.h> //sal_uInt16 and sal_Bool
+#include <boost/scoped_ptr.hpp>
+
+class SvXMLAttrCollection; //Forward declaration only.
+
+class XMLOFF_DLLPUBLIC SvXMLAttrContainerData
+{
+private:
+ boost::scoped_ptr<SvXMLAttrCollection> pimpl;
+
+public:
+ SvXMLAttrContainerData();
+ SvXMLAttrContainerData(const SvXMLAttrContainerData &rCopy);
+ ~SvXMLAttrContainerData();
+
+ int operator ==( const SvXMLAttrContainerData& rCmp ) const;
+
+ sal_Bool AddAttr( const OUString& rLName, const OUString& rValue );
+ sal_Bool AddAttr( const OUString& rPrefix, const OUString& rNamespace,
+ const OUString& rLName, const OUString& rValue );
+ sal_Bool AddAttr( const OUString& rPrefix,
+ const OUString& rLName,
+ const OUString& rValue );
+
+ size_t GetAttrCount() const;
+ const OUString GetAttrNamespace( size_t i ) const;
+ const OUString GetAttrPrefix( size_t i ) const;
+ const OUString& GetAttrLName( size_t i ) const;
+ const OUString& GetAttrValue( size_t i ) const;
+
+ sal_uInt16 GetFirstNamespaceIndex() const;
+ sal_uInt16 GetNextNamespaceIndex( sal_uInt16 nIdx ) const;
+ const OUString& GetNamespace( sal_uInt16 i ) const;
+ const OUString& GetPrefix( sal_uInt16 i ) const;
+
+ sal_Bool SetAt( size_t i,
+ const OUString& rLName, const OUString& rValue );
+ sal_Bool SetAt( size_t i,
+ const OUString& rPrefix, const OUString& rNamespace,
+ const OUString& rLName, const OUString& rValue );
+ sal_Bool SetAt( size_t i,
+ const OUString& rPrefix,
+ const OUString& rLName,
+ const OUString& rValue );
+
+ void Remove( size_t i );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlement.hxx b/include/xmloff/xmlement.hxx
new file mode 100644
index 000000000000..ecf90373f30a
--- /dev/null
+++ b/include/xmloff/xmlement.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 _XMLOFF_XMLEMENT_HXX
+#define _XMLOFF_XMLEMENT_HXX
+
+#include <sal/types.h>
+#include <xmloff/xmltoken.hxx>
+
+/** Map an XMLTokenEnum to a sal_uInt16 value.
+ * To be used with SvXMLUnitConverter::convertEnum(...)
+ */
+struct SvXMLEnumMapEntry
+{
+ ::xmloff::token::XMLTokenEnum eToken;
+ sal_uInt16 nValue;
+};
+
+#define ENUM_STRING_MAP_ENTRY(name,tok) { name, sizeof(name)-1, tok }
+
+#define ENUM_STRING_MAP_END() { NULL, 0, 0 }
+
+/** Map a const sal_Char* (with length) to a sal_uInt16 value.
+ * To be used with SvXMLUnitConverter::convertEnum(...)
+ */
+struct SvXMLEnumStringMapEntry
+{
+ const sal_Char * pName;
+ sal_Int32 nNameLength;
+ sal_uInt16 nValue;
+};
+
+#endif // _XMLOFF_XMLEMENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlerror.hxx b/include/xmloff/xmlerror.hxx
new file mode 100644
index 000000000000..78ecbe914850
--- /dev/null
+++ b/include/xmloff/xmlerror.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 _XMLOFF_XMLERROR_HXX
+#define _XMLOFF_XMLERROR_HXX
+
+#include <com/sun/star/xml/sax/SAXParseException.hpp>
+#include <sal/types.h>
+
+// STL includes
+#include <vector>
+
+
+
+// masks for the error ID fields
+#define XMLERROR_MASK_FLAG 0xF0000000
+#define XMLERROR_MASK_CLASS 0x00FF0000
+#define XMLERROR_MASK_NUMBER 0x0000FFFF
+
+// error flags:
+#define XMLERROR_FLAG_WARNING 0x10000000
+#define XMLERROR_FLAG_ERROR 0x20000000
+#define XMLERROR_FLAG_SEVERE 0x40000000
+
+// error classes: Error ID
+#define XMLERROR_CLASS_IO 0x00010000
+#define XMLERROR_CLASS_FORMAT 0x00020000
+#define XMLERROR_CLASS_API 0x00040000
+#define XMLERROR_CLASS_OTHER 0x00080000
+
+
+// error numbers, listed by error class
+// Within each class, errors should be numbered consecutively. Please
+// always add to error code below the appropriate comment.
+
+// I/O errors:
+
+// format errors:
+#define XMLERROR_SAX ( XMLERROR_CLASS_FORMAT | 0x00000001 )
+#define XMLERROR_STYLE_ATTR_VALUE ( XMLERROR_CLASS_FORMAT | 0x00000002 )
+#define XMLERROR_NO_INDEX_ALLOWED_HERE ( XMLERROR_CLASS_FORMAT | 0x00000003 )
+#define XMLERROR_PARENT_STYLE_NOT_ALLOWED ( XMLERROR_CLASS_FORMAT | 0x00000004 )
+#define XMLERROR_ILLEGAL_EVENT (XMLERROR_CLASS_FORMAT | 0x00000005 )
+#define XMLERROR_NAMESPACE_TROUBLE (XMLERROR_CLASS_FORMAT | 0x00000006 )
+
+#define XMLERROR_XFORMS_NO_SCHEMA_SUPPORT ( XMLERROR_CLASS_FORMAT | XMLERROR_FLAG_WARNING | 0x00000007 )
+#define XMLERROR_XFORMS_UNKNOWN ( XMLERROR_CLASS_FORMAT | XMLERROR_FLAG_WARNING | 0x00000008 )
+#define XMLERROR_XFORMS_ONLY_ONE_INSTANCE_ELEMENT ( XMLERROR_CLASS_FORMAT | XMLERROR_FLAG_WARNING | 0x00000009 )
+#define XMLERROR_UNKNOWN_ATTRIBUTE ( XMLERROR_CLASS_FORMAT | XMLERROR_FLAG_WARNING | 0x0000000a )
+#define XMLERROR_UNKNOWN_ELEMENT ( XMLERROR_CLASS_FORMAT | XMLERROR_FLAG_WARNING | 0x0000000b )
+#define XMLERROR_UNKNOWN_CHARACTERS ( XMLERROR_CLASS_FORMAT | XMLERROR_FLAG_WARNING | 0x0000000c )
+#define XMLERROR_UNKNOWN_ROOT (XMLERROR_CLASS_FORMAT | 0x0000000d )
+
+// API errors:
+#define XMLERROR_STYLE_PROP_VALUE ( XMLERROR_CLASS_API | 0x00000001 )
+#define XMLERROR_STYLE_PROP_UNKNOWN ( XMLERROR_CLASS_API | 0x00000002 )
+#define XMLERROR_STYLE_PROP_OTHER ( XMLERROR_CLASS_API | 0x00000003 )
+#define XMLERROR_API ( XMLERROR_CLASS_API | 0x00000004 )
+
+// other errors:
+#define XMLERROR_CANCEL ( XMLERROR_CLASS_OTHER | 0x00000001 )
+
+
+
+// 16bit error flag constants for use in the
+// SvXMLExport/SvXMLImport error flags
+#define ERROR_NO 0x0000
+#define ERROR_DO_NOTHING 0x0001
+#define ERROR_ERROR_OCCURRED 0x0002
+#define ERROR_WARNING_OCCURRED 0x0004
+
+
+
+
+// forward declarations
+namespace com { namespace sun { namespace star {
+ namespace uno { template<class X> class Sequence; }
+ namespace uno { template<class X> class Reference; }
+ namespace xml { namespace sax { class XLocator; } }
+} } }
+class ErrorRecord;
+
+
+
+/**
+ * The XMLErrors is used to collect all errors and warnings that occur
+ * for appropriate processing.
+ */
+class XMLErrors
+{
+ /// definition of type for error list
+ typedef ::std::vector<ErrorRecord> ErrorList;
+
+ ErrorList aErrors; /// list of error records
+
+public:
+
+ XMLErrors();
+ ~XMLErrors();
+
+ /// add a new entry to the list of error messages
+ void AddRecord(
+ sal_Int32 nId, /// error ID == error flags + error class + error number
+ const ::com::sun::star::uno::Sequence<
+ OUString> & rParams, /// parameters for error message
+ const OUString& rExceptionMessage, /// original exception string
+ sal_Int32 nRow, /// XLocator: file row number
+ sal_Int32 nColumn, /// XLocator: file column number
+ const OUString& rPublicId, /// XLocator: file public ID
+ const OUString& rSystemId ); /// XLocator: file system ID
+
+ void AddRecord(
+ sal_Int32 nId, /// error ID == error flags + error class + error number
+ const ::com::sun::star::uno::Sequence<
+ OUString> & rParams, /// parameters for error message
+ const OUString& rExceptionMessage, /// original exception string
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XLocator> & rLocator); /// location
+
+ /**
+ * throw a SAXParseException that describes the first error that matches
+ * the given mask
+ */
+ void ThrowErrorAsSAXException( sal_Int32 nIdMask )
+ throw( ::com::sun::star::xml::sax::SAXParseException );
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlevent.hxx b/include/xmloff/xmlevent.hxx
new file mode 100644
index 000000000000..9738a58fc30f
--- /dev/null
+++ b/include/xmloff/xmlevent.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 _XMLOFF_XMLEVENT_HXX
+#define _XMLOFF_XMLEVENT_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+
+
+/**
+ * @#file
+ *
+ * Several definition used in im- and export of events
+ */
+
+namespace com { namespace sun { namespace star {
+ namespace xml { namespace sax { class XAttributeList; } }
+ namespace beans { struct PropertyValue; }
+} } }
+
+class SvXMLExport;
+class SvXMLImportContext;
+class SvXMLImport;
+class XMLEventsImportContext;
+
+
+struct XMLEventName
+{
+ sal_uInt16 m_nPrefix;
+ OUString m_aName;
+
+ XMLEventName() : m_nPrefix( 0 ) {}
+ XMLEventName( sal_uInt16 n, const sal_Char *p ) :
+ m_nPrefix( n ),
+ m_aName( OUString::createFromAscii(p) )
+ {}
+
+ XMLEventName( sal_uInt16 n, const OUString& r ) :
+ m_nPrefix( n ),
+ m_aName( r )
+ {}
+
+ bool operator<( const XMLEventName& r ) const
+ {
+ return m_nPrefix < r.m_nPrefix ||
+ (m_nPrefix == r.m_nPrefix && m_aName < r.m_aName );
+ }
+
+};
+
+/**
+ * XMLEventNameTranslation: define tables that translate between event names
+ * as used in the XML file format and in the StarOffice API.
+ * The last entry in the table must be { NULL, 0, NULL }.
+ */
+struct XMLEventNameTranslation
+{
+ const sal_Char* sAPIName;
+ sal_uInt16 nPrefix; // namespace prefix
+ const sal_Char* sXMLName;
+};
+
+/// a translation table for the events defined in the XEventsSupplier service
+/// (implemented in XMLEventExport.cxx)
+extern const XMLEventNameTranslation aStandardEventTable[];
+
+
+/**
+ * Handle export of an event for a certain event type (event type as
+ * defined by the PropertyValue "EventType" in API).
+ *
+ * The Handler has to generate the full <script:event> element.
+ */
+class XMLEventExportHandler
+{
+public:
+ virtual ~XMLEventExportHandler() {};
+
+ virtual void Export(
+ SvXMLExport& rExport, /// the current XML export
+ const OUString& rEventQName, /// the XML name of the event
+ ::com::sun::star::uno::Sequence< /// the values for the event
+ ::com::sun::star::beans::PropertyValue> & rValues,
+ sal_Bool bUseWhitespace) = 0; /// create whitespace around elements?
+};
+
+
+/**
+ * Handle import of an event for a certain event type (as defined by
+ * the PropertyValue "EventType" in the API).
+ *
+ * EventContextFactories must be registered with the EventImportHelper
+ * that is attached to the SvXMLImport.
+ *
+ * The factory has to create an import context for a <script:event>
+ * element. The context has to call the
+ * EventsImportContext::AddEventValues() method to fave its event
+ * registered with the enclosing element. For events consisting only
+ * of attributes (and an empty element) an easy solution is to handle
+ * all attributes in the CreateContext()-method and return a default
+ * context.
+ *
+ * EventContextFactory objects have to be registered with the
+ * EventsImportHelper.
+ */
+class XMLEventContextFactory
+{
+public:
+ virtual ~XMLEventContextFactory() {};
+
+ virtual SvXMLImportContext* CreateContext(
+ SvXMLImport& rImport, /// import context
+ sal_uInt16 nPrefix, /// element: namespace prefix
+ const OUString& rLocalName, /// element: local name
+ const ::com::sun::star::uno::Reference< /// attribute list
+ ::com::sun::star::xml::sax::XAttributeList> & xAttrList,
+ /// the context for the enclosing <script:events> element
+ XMLEventsImportContext* rEvents,
+ /// the event name (as understood by the API)
+ const OUString& rApiEventName,
+ /// the event type name (as registered)
+ const OUString& rApiLanguage) = 0;
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx
new file mode 100644
index 000000000000..148f73692158
--- /dev/null
+++ b/include/xmloff/xmlexp.hxx
@@ -0,0 +1,659 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_XMLEXP_HXX
+#define _XMLOFF_XMLEXP_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/xml/sax/SAXParseException.hpp>
+#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/SAXException.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/xml/sax/XLocator.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <rtl/ustring.hxx>
+#include <xmloff/txtparae.hxx>
+#include <xmloff/formlayerexport.hxx>
+#include <xmloff/xmlnumfe.hxx>
+#include <xmloff/xmlaustp.hxx>
+#include <xmloff/shapeexport.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/SchXMLExportHelper.hxx>
+#include <xmloff/XMLFontAutoStylePool.hxx>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/document/XGraphicObjectResolver.hpp>
+#include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+
+#include <unotools/saveopt.hxx>
+
+#include <xmloff/XMLPageExport.hxx>
+#include <xmloff/ProgressBarHelper.hxx>
+#include <cppuhelper/implbase6.hxx>
+
+#include <list>
+
+class SvXMLNamespaceMap;
+class SvXMLAttributeList;
+class SvXMLExport_Impl;
+class SvXMLUnitConverter;
+class ProgressBarHelper;
+class XMLEventExport;
+class XMLSettingsExportHelper;
+class XMLImageMapExport;
+class XMLErrors;
+
+// Shapes in Writer cannot be named via context menu (#i51726#)
+#include <unotools/moduleoptions.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace frame { class XModel; }
+ namespace container { class XIndexContainer; }
+} } }
+namespace comphelper { class UnoInterfaceToUniqueIdentifierMapper; }
+
+#define EXPORT_META 0x0001
+#define EXPORT_STYLES 0x0002
+#define EXPORT_MASTERSTYLES 0x0004
+#define EXPORT_AUTOSTYLES 0x0008
+#define EXPORT_CONTENT 0x0010
+#define EXPORT_SCRIPTS 0x0020
+#define EXPORT_SETTINGS 0x0040
+#define EXPORT_FONTDECLS 0x0080
+#define EXPORT_EMBEDDED 0x0100
+#define EXPORT_NODOCTYPE 0x0200
+#define EXPORT_PRETTY 0x0400
+#define EXPORT_SAVEBACKWARDCOMPATIBLE 0x0800
+#define EXPORT_OASIS 0x8000
+#define EXPORT_ALL 0x7fff
+
+class XMLOFF_DLLPUBLIC SvXMLExport : public ::cppu::WeakImplHelper6<
+ ::com::sun::star::document::XFilter,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::document::XExporter,
+ ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::container::XNamed,
+ ::com::sun::star::lang::XUnoTunnel>
+{
+ SvXMLExport_Impl *mpImpl; // dummy
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler; // the handlers
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > mxExtHandler;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > mxNumberFormatsSupplier;
+ ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver > mxGraphicResolver;
+ ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver > mxEmbeddedResolver;
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > mxStatusIndicator;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxExportInfo;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > mxEventListener;
+
+ SvXMLAttributeList *mpAttrList; // a common attribute list
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > mxAttrList; // and an interface of it
+
+ OUString msOrigFileName; // the original URL
+ OUString msGraphicObjectProtocol;
+ OUString msEmbeddedObjectProtocol;
+ OUString msFilterName;
+ SvXMLNamespaceMap *mpNamespaceMap; // the namepspace map
+ SvXMLUnitConverter *mpUnitConv; // the unit converter
+ SvXMLNumFmtExport *mpNumExport;
+ ProgressBarHelper *mpProgressBarHelper;
+
+ UniReference< XMLTextParagraphExport > mxTextParagraphExport;
+ UniReference< XMLShapeExport > mxShapeExport;
+ UniReference< SvXMLAutoStylePoolP > mxAutoStylePool;
+ UniReference< SchXMLExportHelper > mxChartExport;
+ UniReference< XMLPageExport > mxPageExport;
+ UniReference< XMLFontAutoStylePool > mxFontAutoStylePool;
+ UniReference< xmloff::OFormLayerXMLExport > mxFormExport;
+ XMLEventExport* mpEventExport;
+ XMLImageMapExport* mpImageMapExport;
+ XMLErrors* mpXMLErrors;
+
+ sal_Bool mbExtended; // Does document contain extens.
+
+ const enum ::xmloff::token::XMLTokenEnum meClass;
+ SAL_DLLPRIVATE void _InitCtor();
+
+ sal_uInt16 mnExportFlags;
+ sal_uInt16 mnErrorFlags;
+ bool mbEnableExperimentalOdfExport;
+
+public:
+
+ const OUString msWS; // " "
+
+private:
+
+ // Shapes in Writer cannot be named via context menu (#i51726#)
+ SvtModuleOptions::EFactory meModelType;
+ SAL_DLLPRIVATE void _DetermineModelType();
+
+ SAL_DLLPRIVATE void ImplExportMeta(); // <office:meta>
+ SAL_DLLPRIVATE void ImplExportSettings(); // <office:settings>
+ SAL_DLLPRIVATE void ImplExportStyles( sal_Bool bUsed ); // <office:styles>
+ SAL_DLLPRIVATE void ImplExportAutoStyles( sal_Bool bUsed );
+ // <office:automatic-styles>
+ SAL_DLLPRIVATE void ImplExportMasterStyles( sal_Bool bUsed );
+ // <office:master-styles>
+ SAL_DLLPRIVATE void ImplExportContent(); // <office:body>
+ virtual void SetBodyAttributes();
+ void GetViewSettingsAndViews(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rProps);
+
+protected:
+ void setExportFlags( sal_uInt16 nExportFlags ) { mnExportFlags = nExportFlags; }
+
+ // Get (modifyable) namespace map
+ SvXMLNamespaceMap& _GetNamespaceMap() { return *mpNamespaceMap; }
+
+ // get a new namespave map (used in starmath to have a default namespace)
+ void ResetNamespaceMap();
+
+ // This method can be overloaded to export the content of <office:meta>.
+ // There is a default implementation.
+ virtual void _ExportMeta();
+
+ // This method can be overloaded to export the content of <office:scripts>.
+ // There is a default implementation.
+ virtual void _ExportScripts();
+
+ // This method can be overloaded to export the font declarations
+ // The default implementation will export the contents of the
+ // XMLFontAutoStylePool if it has been created.
+ virtual void _ExportFontDecls();
+
+ // This method should be overloaded to export the content of <style:styles>.
+ // If bUsed is set, used styles should be exported only.
+ // Overloaded Methods must call this method !
+ virtual void _ExportStyles( sal_Bool bUsed ) ;
+
+ // This method must be overloaded to export the contents of
+ // <style:auto-styles>
+ virtual void _ExportAutoStyles() = 0;
+
+ // This method must be overloaded to export the contents of
+ // <style:master-styles>
+ virtual void _ExportMasterStyles() = 0;
+
+ // This method must be overloaded to export the content of <office:body>.
+ virtual void _ExportContent() = 0;
+
+ void SetExtended( sal_Bool bSet=sal_True ) { mbExtended = bSet; }
+
+ // save linked sections? (may be false in global documents)
+ sal_Bool mbSaveLinkedSections;
+
+ virtual XMLTextParagraphExport* CreateTextParagraphExport();
+ virtual XMLShapeExport* CreateShapeExport();
+ virtual SvXMLAutoStylePoolP* CreateAutoStylePool();
+ virtual SchXMLExportHelper* CreateChartExport();
+ virtual XMLPageExport* CreatePageExport();
+ virtual XMLFontAutoStylePool* CreateFontAutoStylePool();
+ virtual xmloff::OFormLayerXMLExport* CreateFormExport();
+ virtual void GetViewSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
+ virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
+
+ struct SettingsGroup
+ {
+ ::xmloff::token::XMLTokenEnum eGroupName;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSettings;
+
+ SettingsGroup()
+ :eGroupName( ::xmloff::token::XML_TOKEN_INVALID )
+ ,aSettings()
+ {
+ }
+
+ SettingsGroup(
+ const ::xmloff::token::XMLTokenEnum _eGroupName,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rSettings )
+ :eGroupName( _eGroupName )
+ ,aSettings( _rSettings )
+ {
+ }
+ };
+ /** returns the current document settings
+
+ The default implementation will obtain the view settings by calling GetViewSettingsAndViews, and the
+ configuration settings by calling GetConfigurationSettings, and return them together with the proper XML token.
+
+ @return
+ the accumulated count of all settings in all groups
+ */
+ virtual sal_Int32 GetDocumentSpecificSettings( ::std::list< SettingsGroup >& _out_rSettings );
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; }
+ inline void SetEmbeddedResolver( com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver );
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver >& GetGraphicResolver() const { return mxGraphicResolver; }
+ void SetGraphicResolver( com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver >& _xGraphicResolver );
+
+ void SetDocHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > &rHandler );
+
+public:
+
+ SvXMLExport(
+ sal_Int16 const eDefaultMeasureUnit /*css::util::MeasureUnit*/,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
+ const enum ::xmloff::token::XMLTokenEnum eClass = xmloff::token::XML_TOKEN_INVALID,
+ sal_uInt16 nExportFlag = EXPORT_ALL );
+
+ SvXMLExport(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
+ const OUString& rFileName,
+ sal_Int16 const eDefaultMeasureUnit /*css::util::MeasureUnit*/,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler);
+
+ SvXMLExport(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
+ const OUString& rFileName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &,
+ sal_Int16 const eDefaultFieldUnit );
+
+ virtual ~SvXMLExport();
+
+ static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
+ static SvXMLExport* getImplementation( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ) throw();
+
+ // XExporter
+ virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ // XFilter
+ virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL cancel() throw(::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XNamed
+ virtual OUString SAL_CALL getName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ /** ensures that the given namespace is in scope at the next started
+ element.
+
+ <p>If the namespace is not yet declared, the necessary attribute will
+ be added, as well.</p>
+
+ @param i_rNamespace the namespace to be declared
+ @param i_rPreferredPrefix (opt.) preferred prefix for the namespace
+
+ @returns the actual prefix that the namespace is associated with
+ */
+ OUString EnsureNamespace(OUString const & i_rNamespace,
+ OUString const & i_rPreferredPrefix = OUString("gen") );
+
+ // Check if common attribute list is empty.
+#ifndef DBG_UTIL
+ void CheckAttrList() {}
+#else
+ void CheckAttrList();
+#endif
+
+ // Clear common attribute list.
+ void ClearAttrList();
+
+ // Add an attribute to the common attribute list.
+ void AddAttributeASCII( sal_uInt16 nPrefix, const sal_Char *pName,
+ const sal_Char *pValue );
+ void AddAttribute( sal_uInt16 nPrefix, const sal_Char *pName,
+ const OUString& rValue );
+ void AddAttribute( sal_uInt16 nPrefix, const OUString& rName,
+ const OUString& rValue );
+ void AddAttribute( sal_uInt16 nPrefix,
+ enum ::xmloff::token::XMLTokenEnum eName,
+ const OUString& rValue );
+ void AddAttribute( sal_uInt16 nPrefix,
+ enum ::xmloff::token::XMLTokenEnum eName,
+ enum ::xmloff::token::XMLTokenEnum eValue );
+ void AddAttribute( const OUString& rQName,
+ const OUString& rValue );
+ void AddAttribute( const OUString& rQName,
+ enum ::xmloff::token::XMLTokenEnum eValue );
+ // add several attributes to the common attribute list
+ void AddAttributeList( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ // Get common attribute list as implementation or interface.
+ SvXMLAttributeList &GetAttrList() { return *mpAttrList; }
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & GetXAttrList() { return mxAttrList; }
+
+ // Get document handler. This methods are not const, because the
+ // reference allowes modifications through the handler.
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & GetDocHandler() { return mxHandler; }
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > & GetExtDocHandler()
+ {
+ return mxExtHandler;
+ }
+
+ // Get original ::com::sun::star::util::URL.
+ const OUString& GetOrigFileName() const { return msOrigFileName; }
+
+ // Get (const) namespace map.
+ const SvXMLNamespaceMap& GetNamespaceMap() const { return *mpNamespaceMap; }
+
+ // Get unit converter
+ const SvXMLUnitConverter& GetMM100UnitConverter() const { return *mpUnitConv; }
+
+ SvXMLUnitConverter& GetMM100UnitConverter() { return *mpUnitConv; }
+
+ void addChaffWhenEncryptedStorage();
+
+ // Export the document.
+ virtual sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID );
+
+ virtual void addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False );
+ virtual void exportDataStyles();
+ virtual void exportAutoDataStyles();
+ virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False ) const;
+ sal_Int32 dataStyleForceSystemLanguage(sal_Int32 nFormat) const;
+
+ virtual void exportAnnotationMeta( const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape);
+
+ // Get XModel
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &
+ GetModel() const { return mxModel; }
+ // Get XNumberFormatsSupplier
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & GetNumberFormatsSupplier() { return mxNumberFormatsSupplier; }
+ inline void SetNumberFormatsSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& _xNumberFormatSupplier)
+ {
+ mxNumberFormatsSupplier = _xNumberFormatSupplier;
+ if ( mxNumberFormatsSupplier.is() && mxHandler.is() )
+ mpNumExport = new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier);
+ }
+
+ // get export helper for text
+ inline UniReference< XMLTextParagraphExport > GetTextParagraphExport();
+
+ // get export helper for shapes
+ inline UniReference< XMLShapeExport > GetShapeExport();
+
+ // get auto style pool
+ inline UniReference< SvXMLAutoStylePoolP > GetAutoStylePool();
+
+ // get Page Export
+ inline UniReference< XMLPageExport > GetPageExport();
+
+ // get chart export helper
+ inline UniReference< SchXMLExportHelper > GetChartExport();
+
+ // get font auto style pool
+ inline UniReference< XMLFontAutoStylePool > GetFontAutoStylePool();
+
+ ProgressBarHelper* GetProgressBarHelper();
+
+ // get Formlayer Export
+ inline UniReference< xmloff::OFormLayerXMLExport > GetFormExport();
+ inline bool HasFormExport();
+
+ // get XPropertySet with export information
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getExportInfo() const { return mxExportInfo; }
+
+ com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > GetStatusIndicator() { return mxStatusIndicator; }
+
+ /// get Event export, with handlers for script types "None" and
+ /// "StarBasic" already registered; other handlers may be registered, too.
+ XMLEventExport& GetEventExport();
+
+ /// get the export for image maps
+ XMLImageMapExport& GetImageMapExport();
+
+ OUString AddEmbeddedGraphicObject(
+ const OUString& rGraphicObjectURL );
+ sal_Bool AddEmbeddedGraphicObjectAsBase64(
+ const OUString& rGraphicObjectURL );
+
+ OUString AddEmbeddedObject(
+ const OUString& rEmbeddedObjectURL );
+ sal_Bool AddEmbeddedObjectAsBase64(
+ const OUString& rEmbeddedObjectURL );
+
+ OUString EncodeStyleName( const OUString& rName,
+ sal_Bool *pEncoded=0 ) const;
+
+ // save linked sections?
+ inline sal_Bool IsSaveLinkedSections() { return mbSaveLinkedSections; }
+
+ // get export flags
+ sal_uInt16 getExportFlags() const { return mnExportFlags; }
+
+ sal_Bool ExportEmbeddedOwnObject(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XComponent >& rComp );
+
+ OUString GetRelativeReference(const OUString& rValue);
+
+ // methods for accessing the document handler and handling SAX errors
+ void StartElement(sal_uInt16 nPrefix,
+ enum ::xmloff::token::XMLTokenEnum eName,
+ sal_Bool bIgnWSOutside );
+ void StartElement(const OUString& rName,
+ sal_Bool bIgnWSOutside );
+ void Characters(const OUString& rChars);
+ void EndElement(sal_uInt16 nPrefix,
+ enum ::xmloff::token::XMLTokenEnum eName,
+ sal_Bool bIgnWSInside );
+ void EndElement(const OUString& rName,
+ sal_Bool bIgnWSInside );
+ void IgnorableWhitespace();
+
+ /**
+ * Record an error condition that occurred during export. The
+ * behavior of SetError can be modified using the error flag
+ * constants.
+ */
+ void SetError(
+ /// error ID, may contain an error flag
+ sal_Int32 nId,
+ /// string parameters for the error message
+ const ::com::sun::star::uno::Sequence< OUString> & rMsgParams,
+ /// original exception message (if applicable)
+ const OUString& rExceptionMessage,
+ /// error location (if applicable)
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XLocator> & rLocator );
+
+ void SetError(
+ sal_Int32 nId,
+ const ::com::sun::star::uno::Sequence< OUString> & rMsgParams);
+
+ /** return current error flags (logical 'or' of all error flags so far) */
+ sal_uInt16 GetErrorFlags() { return mnErrorFlags; }
+
+ virtual void DisposingModel();
+
+ ::comphelper::UnoInterfaceToUniqueIdentifierMapper& getInterfaceToIdentifierMapper();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getComponentContext();
+
+ // Shapes in Writer cannot be named via context menu (#i51726#)
+ SvtModuleOptions::EFactory GetModelType() const
+ {
+ return meModelType;
+ }
+
+ // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
+ sal_Bool writeOutlineStyleAsNormalListStyle() const;
+ bool isExperimentalOdfExportEnabled() const { return mbEnableExperimentalOdfExport; }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetTargetStorage();
+
+ /// returns the currently configured default version for odf export
+ SvtSaveOptions::ODFDefaultVersion getDefaultVersion() const;
+
+ /// name of stream in package, e.g., "content.xml"
+ OUString GetStreamName() const;
+
+ // FIXME: this is only for legacy stuff that has not yet been adapted
+ // to implement XMetadatable; this can write duplicate IDs!
+ /// add xml:id and legacy namespace id
+ void SAL_DLLPRIVATE AddAttributeIdLegacy(
+ sal_uInt16 const nLegacyPrefix, OUString const& rValue);
+
+ /// add xml:id attribute (for RDF metadata)
+ void AddAttributeXmlId(::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface> const & i_xIfc);
+
+ /// add RDFa attributes for a metadatable text content
+ void AddAttributesRDFa( ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextContent> const & i_xTextContent);
+
+ sal_Bool exportTextNumberElement() const;
+
+ /// set null date from model to unit converter, if not already done
+ sal_Bool SetNullDateOnUnitConverter();
+};
+
+inline UniReference< XMLTextParagraphExport > SvXMLExport::GetTextParagraphExport()
+{
+ if( !mxTextParagraphExport.is() )
+ mxTextParagraphExport = CreateTextParagraphExport();
+
+ return mxTextParagraphExport;
+}
+
+inline UniReference< XMLShapeExport > SvXMLExport::GetShapeExport()
+{
+ if( !mxShapeExport.is() )
+ mxShapeExport = CreateShapeExport();
+
+ return mxShapeExport;
+}
+
+inline UniReference< SvXMLAutoStylePoolP > SvXMLExport::GetAutoStylePool()
+{
+ if( !mxAutoStylePool.is() )
+ mxAutoStylePool = CreateAutoStylePool();
+
+ return mxAutoStylePool;
+}
+
+inline UniReference< SchXMLExportHelper > SvXMLExport::GetChartExport()
+{
+ if( !mxChartExport.is() )
+ mxChartExport = CreateChartExport();
+
+ return mxChartExport;
+}
+
+inline UniReference< XMLPageExport > SvXMLExport::GetPageExport()
+{
+ if( !mxPageExport.is() )
+ mxPageExport = CreatePageExport();
+
+ return mxPageExport;
+}
+
+inline UniReference< XMLFontAutoStylePool > SvXMLExport::GetFontAutoStylePool()
+{
+ if( !mxFontAutoStylePool.is() )
+ mxFontAutoStylePool = CreateFontAutoStylePool();
+
+ return mxFontAutoStylePool;
+}
+
+inline UniReference< xmloff::OFormLayerXMLExport > SvXMLExport::GetFormExport()
+{
+ if( !mxFormExport.is() )
+ mxFormExport = CreateFormExport();
+
+ return mxFormExport;
+}
+
+inline bool SvXMLExport::HasFormExport()
+{
+ return mxFormExport.is();
+}
+
+inline void SvXMLExport::SetEmbeddedResolver(
+ com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver )
+{
+ mxEmbeddedResolver = _xEmbeddedResolver;
+}
+
+inline void SvXMLExport::SetGraphicResolver(
+ com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver >& _xGraphicResolver )
+{
+ mxGraphicResolver = _xGraphicResolver;
+}
+
+// Helper class to export an element.
+class XMLOFF_DLLPUBLIC SvXMLElementExport
+{
+ SvXMLExport& rExport;
+ OUString aName;
+ sal_Bool bIgnWS : 1;
+ sal_Bool bDoSomething : 1;
+
+ SAL_DLLPRIVATE void StartElement( SvXMLExport& rExp, sal_uInt16 nPrefix,
+ const OUString& rName,
+ sal_Bool bIgnWSOutside );
+
+public:
+
+ // The constructor prints a start tag that has the common attributes
+ // of the XMLExport instance attached.
+ SvXMLElementExport( SvXMLExport& rExp, sal_uInt16 nPrefix,
+ const sal_Char *pName,
+ sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside );
+ SvXMLElementExport( SvXMLExport& rExp, sal_uInt16 nPrefix,
+ const OUString& rName,
+ sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside );
+ SvXMLElementExport( SvXMLExport& rExp, sal_uInt16 nPrefix,
+ enum ::xmloff::token::XMLTokenEnum eName,
+ sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside );
+ SvXMLElementExport( SvXMLExport& rExp, const OUString& rQName,
+ sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside );
+
+ // Thes constructors do nothing if bDoSomething is not set
+ SvXMLElementExport( SvXMLExport& rExp, sal_Bool bDoSomething,
+ sal_uInt16 nPrefix,
+ enum ::xmloff::token::XMLTokenEnum eName,
+ sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside );
+
+ // The destructor prints an end tag.
+ ~SvXMLElementExport();
+};
+
+#endif // _XMLOFF_SVXMLEXP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlexppr.hxx b/include/xmloff/xmlexppr.hxx
new file mode 100644
index 000000000000..7e7bb7658903
--- /dev/null
+++ b/include/xmloff/xmlexppr.hxx
@@ -0,0 +1,188 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_XMLEXPPR_HXX
+#define _XMLOFF_XMLEXPPR_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/xmlprmap.hxx>
+#include <xmloff/uniref.hxx>
+
+
+class SvXMLUnitConverter;
+class SvXMLAttributeList;
+class SvXMLNamespaceMap;
+class FilterPropertiesInfos_Impl;
+class SvXMLExport;
+
+#define XML_EXPORT_FLAG_DEFAULTS 0x0001 // export also default items
+#define XML_EXPORT_FLAG_DEEP 0x0002 // export also items from
+ // parent item sets
+#define XML_EXPORT_FLAG_EMPTY 0x0004 // export attribs element
+ // even if its empty
+#define XML_EXPORT_FLAG_IGN_WS 0x0008
+
+class XMLOFF_DLLPUBLIC SvXMLExportPropertyMapper : public UniRefBase
+{
+ UniReference< SvXMLExportPropertyMapper> mxNextMapper;
+
+ FilterPropertiesInfos_Impl *pCache;
+
+protected:
+ UniReference< XMLPropertySetMapper > maPropMapper;
+
+ OUString maStyleName;
+
+ /** Filter all properties we don't want to export:
+ Take all properties of the XPropertySet which are also found in the
+ XMLPropertyMapEntry-array and which are not set directly (so, the value isn't
+ default and isn't inherited, apart from bDefault is true)
+ After this process It'll called 'Contextfilter' for application-specific
+ filter-processes. */
+ ::std::vector< XMLPropertyState > _Filter(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > rPropSet,
+ const sal_Bool bDefault ) const;
+
+ /** Application-specific filter. By default do nothing. */
+ virtual void ContextFilter(
+ ::std::vector< XMLPropertyState >& rProperties,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > rPropSet ) const;
+
+ /** fills the given attribute list with the items in the given set */
+ void _exportXML( sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags,
+ SvXMLAttributeList& rAttrList,
+ const ::std::vector< XMLPropertyState >& rProperties,
+ const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap,
+ sal_uInt16 nFlags,
+ std::vector<sal_uInt16>* pIndexArray,
+ sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const;
+
+ void _exportXML( SvXMLAttributeList& rAttrList,
+ const XMLPropertyState& rProperty,
+ const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap,
+ sal_uInt16 nFlags,
+ const ::std::vector< XMLPropertyState > *pProperties = 0,
+ sal_uInt32 nIdx = 0 ) const;
+
+ void exportElementItems(
+ SvXMLExport& rExport,
+ const ::std::vector< XMLPropertyState >& rProperties,
+ sal_uInt16 nFlags,
+ const std::vector<sal_uInt16>& rIndexArray ) const;
+
+public:
+
+ SvXMLExportPropertyMapper(
+ const UniReference< XMLPropertySetMapper >& rMapper );
+ virtual ~SvXMLExportPropertyMapper();
+
+ // Add a ExportPropertyMapper at the end of the import mapper chain.
+ // The added mapper MUST not be used outside the Mapper chain any longer,
+ // because its PropertyMapper will be replaced.
+ void ChainExportMapper(
+ const UniReference< SvXMLExportPropertyMapper>& rMapper );
+
+ /** Filter all properties we don't want to export:
+ Take all properties of the XPropertySet which are also found in the
+ XMLPropertyMapEntry-array and which are not set directly (so, the value isn't
+ default and isn't inherited)
+ After this process It'll called 'Contextfilter' for application-specific
+ filter-processes. */
+ ::std::vector< XMLPropertyState > Filter(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > rPropSet ) const
+ { return _Filter(rPropSet, sal_False); }
+
+ /** Like Filter(), except that:
+ * - only properties that have the map flag MID_FLAG_DEFAULT_ITEM_EXPORT
+ * set are exported,
+ * - instead of the property's value, its default value is exported.
+ */
+ ::std::vector< XMLPropertyState > FilterDefaults(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > rPropSet ) const
+ { return _Filter(rPropSet, sal_True); }
+
+ /** Compare to arrays of XMLPropertyState */
+ sal_Bool Equals( const ::std::vector< XMLPropertyState >& aProperties1,
+ const ::std::vector< XMLPropertyState >& aProperties2 ) const;
+
+ /** fills the given attribute list with the items in the given set */
+ void exportXML(
+ SvXMLAttributeList& rAttrList,
+ const ::std::vector< XMLPropertyState >& rProperties,
+ const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap,
+ sal_uInt16 nFlags = 0 ) const;
+ /** like above but only properties whose property map index is within the
+ specified range are exported */
+ void exportXML(
+ SvXMLAttributeList& rAttrList,
+ const ::std::vector< XMLPropertyState >& rProperties,
+ const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap,
+ sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
+ sal_uInt16 nFlags = 0 ) const;
+
+ void exportXML(
+ SvXMLExport& rExport,
+ const ::std::vector< XMLPropertyState >& rProperties,
+ sal_uInt16 nFlags = 0 ) const;
+
+ /** like above but only properties whose property map index is within the
+ specified range are exported */
+ void exportXML(
+ SvXMLExport& rExport,
+ const ::std::vector< XMLPropertyState >& rProperties,
+ sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
+ sal_uInt16 nFlags = 0 ) const;
+
+ /** this method is called for every item that has the
+ MID_FLAG_ELEMENT_EXPORT flag set */
+ virtual void handleElementItem(
+ SvXMLExport& rExport,
+ const XMLPropertyState& rProperty,
+ sal_uInt16 nFlags,
+ const ::std::vector< XMLPropertyState > *pProperties = 0,
+ sal_uInt32 nIdx = 0 ) const;
+
+ /** this method is called for every item that has the
+ MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
+ virtual void handleSpecialItem(
+ SvXMLAttributeList& rAttrList,
+ const XMLPropertyState& rProperty,
+ const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap,
+ const ::std::vector< XMLPropertyState > *pProperties = 0,
+ sal_uInt32 nIdx = 0 ) const;
+
+ inline const UniReference< XMLPropertySetMapper >&
+ getPropertySetMapper() const { return maPropMapper; }
+
+ void SetStyleName( const OUString& rStyleName ) { maStyleName = rStyleName; }
+};
+
+#endif // _XMLOFF_XMLEXPPR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx
new file mode 100644
index 000000000000..37903e4b4f8a
--- /dev/null
+++ b/include/xmloff/xmlictxt.hxx
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#define _XMLOFF_XMLICTXT_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <tools/solar.h>
+#include <tools/ref.hxx>
+#include <rtl/ustring.hxx>
+#include <tools/rtti.hxx>
+
+class SvXMLNamespaceMap;
+class SvXMLImport;
+
+class XMLOFF_DLLPUBLIC SvXMLImportContext : public SvRefBase
+{
+ friend class SvXMLImport;
+
+ SvXMLImport& mrImport;
+
+ sal_uInt16 mnPrefix;
+ OUString maLocalName;
+
+ SvXMLNamespaceMap *mpRewindMap;
+
+ SAL_DLLPRIVATE SvXMLNamespaceMap *GetRewindMap() const
+ { return mpRewindMap; }
+ SAL_DLLPRIVATE void SetRewindMap( SvXMLNamespaceMap *p ) { mpRewindMap = p; }
+
+protected:
+
+ SvXMLImport& GetImport() { return mrImport; }
+ const SvXMLImport& GetImport() const { return mrImport; }
+
+public:
+ TYPEINFO();
+
+ sal_uInt16 GetPrefix() const { return mnPrefix; }
+ const OUString& GetLocalName() const { return maLocalName; }
+
+ // A contexts constructor does anything that is required if an element
+ // starts. Namespace processing has been done already.
+ // Note that virtual methods cannot be used inside constructors. Use
+ // StartElement instead if this is required.
+ SvXMLImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName );
+
+ // A contexts destructor does anything that is required if an element
+ // ends. By default, nothing is done.
+ // Note that virtual methods cannot be used inside destructors. Use
+ // EndElement instead if this is required.
+ virtual ~SvXMLImportContext();
+
+ // Create a children element context. By default, the import's
+ // CreateContext method is called to create a new default context.
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ // StartElement is called after a context has been constructed and
+ // before a elements context is parsed. It may be used for actions that
+ // require virtual methods. The default is to do nothing.
+ virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ // EndElement is called before a context will be destructed, but
+ // after a elements context has been parsed. It may be used for actions
+ // that require virtual methods. The default is to do nothing.
+ virtual void EndElement();
+
+ // This method is called for all characters that are contained in the
+ // current element. The default is to ignore them.
+ virtual void Characters( const OUString& rChars );
+};
+
+SV_DECL_REF( SvXMLImportContext )
+SV_IMPL_REF( SvXMLImportContext )
+
+
+#endif // _XMLOFF_XMLICTXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
new file mode 100644
index 000000000000..750f56725aaf
--- /dev/null
+++ b/include/xmloff/xmlimp.hxx
@@ -0,0 +1,525 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_XMLIMP_HXX
+#define _XMLOFF_XMLIMP_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/xml/sax/SAXParseException.hpp>
+#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/SAXException.hpp>
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/xml/sax/XLocator.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XGraphicObjectResolver.hpp>
+#include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <cppuhelper/weak.hxx>
+#include <xmloff/txtimp.hxx>
+#include <xmloff/shapeimport.hxx>
+#include <xmloff/SchXMLImportHelper.hxx>
+#include <xmloff/ProgressBarHelper.hxx>
+#include <cppuhelper/implbase6.hxx>
+#include <xmloff/formlayerimport.hxx>
+
+#include <com/sun/star/beans/NamedValue.hpp>
+
+namespace com { namespace sun { namespace star {
+ namespace frame { class XModel; }
+ namespace io { class XOutputStream; }
+ namespace rdf { class XMetadatable; }
+} } }
+namespace comphelper { class UnoInterfaceToUniqueIdentifierMapper; }
+
+class SvXMLNamespaceMap;
+class SvXMLImportContext;
+class SvXMLImportContexts_Impl;
+class SvXMLImport_Impl;
+class SvXMLUnitConverter;
+class SvXMLNumFmtHelper;
+class XMLFontStylesContext;
+class XMLEventImportHelper;
+class XMLErrors;
+class StyleMap;
+
+namespace xmloff {
+ class RDFaImportHelper;
+}
+
+#define IMPORT_META 0x0001
+#define IMPORT_STYLES 0x0002
+#define IMPORT_MASTERSTYLES 0x0004
+#define IMPORT_AUTOSTYLES 0x0008
+#define IMPORT_CONTENT 0x0010
+#define IMPORT_SCRIPTS 0x0020
+#define IMPORT_SETTINGS 0x0040
+#define IMPORT_FONTDECLS 0x0080
+#define IMPORT_EMBEDDED 0x0100
+#define IMPORT_OOO_NAMESPACES 0x0100
+#define IMPORT_ALL 0xffff
+
+
+
+class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper6<
+ ::com::sun::star::xml::sax::XExtendedDocumentHandler,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::document::XImporter,
+ ::com::sun::star::document::XFilter,
+ ::com::sun::star::lang::XUnoTunnel>
+{
+ friend class SvXMLImportContext;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > mxLocator;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > mxNumberFormatsSupplier;
+ ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver > mxGraphicResolver;
+ ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver > mxEmbeddedResolver;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxImportInfo;
+
+ UniReference< XMLTextImportHelper > mxTextImport;
+ UniReference< XMLShapeImportHelper > mxShapeImport;
+ UniReference< SchXMLImportHelper > mxChartImport;
+ UniReference< ::xmloff::OFormLayerXMLImport > mxFormImport;
+
+ SvXMLImportContextRef mxFontDecls;
+ SvXMLImportContextRef mxStyles;
+ SvXMLImportContextRef mxAutoStyles;
+ SvXMLImportContextRef mxMasterStyles;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxGradientHelper;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxHatchHelper;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxBitmapHelper;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxTransGradientHelper;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxMarkerHelper;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxDashHelper;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxNumberStyles;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > mxEventListener;
+
+ SvXMLImport_Impl *mpImpl; // dummy
+
+ SvXMLNamespaceMap *mpNamespaceMap;
+ SvXMLUnitConverter *mpUnitConv;
+ SvXMLImportContexts_Impl *mpContexts;
+ SvXMLNumFmtHelper *mpNumImport;
+ ProgressBarHelper *mpProgressBarHelper;
+ XMLEventImportHelper *mpEventImportHelper;
+ XMLErrors *mpXMLErrors;
+ StyleMap *mpStyleMap;
+ OUString msPackageProtocol;
+
+ SAL_DLLPRIVATE void _InitCtor();
+
+ sal_uInt16 mnImportFlags;
+ sal_uInt16 mnErrorFlags;
+ std::set< OUString > embeddedFontUrlsKnown;
+
+protected:
+
+ ::com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > mxStatusIndicator;
+ sal_Bool mbIsFormsSupported;
+ bool mbIsTableShapeSupported;
+ bool mbIsGraphicLoadOnDemandSupported;
+
+ // This method is called after the namespace map has been updated, but
+ // before a context for the current element has been pushed.
+ virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ virtual XMLTextImportHelper* CreateTextImport();
+ inline void ClearTextImport() { mxTextImport = 0; }
+ virtual XMLShapeImportHelper* CreateShapeImport();
+ inline sal_Bool HasShapeImport() const { return mxShapeImport.is(); }
+ inline void ClearShapeImport() { mxShapeImport = 0; }
+
+ virtual SchXMLImportHelper* CreateChartImport();
+ virtual ::xmloff::OFormLayerXMLImport* CreateFormImport();
+
+ void SetFontDecls( XMLFontStylesContext *pFontDecls );
+ void SetStyles( SvXMLStylesContext *pStyles );
+ void SetAutoStyles( SvXMLStylesContext *pAutoStyles );
+ void SetMasterStyles( SvXMLStylesContext *pMasterStyles );
+
+ sal_Bool IsODFVersionConsistent( const OUString& aODFVersion );
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; }
+ inline void SetEmbeddedResolver( com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver );
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver >& GetGraphicResolver() const { return mxGraphicResolver; }
+ void SetGraphicResolver( com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver >& _xGraphicResolver );
+
+
+ void _CreateNumberFormatsSupplier();
+ void _CreateDataStylesImport();
+
+public:
+ // #110680#
+ // SvXMLImport( sal_uInt16 nImportFlags = IMPORT_ALL ) throw();
+ SvXMLImport(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
+ sal_uInt16 nImportFlags = IMPORT_ALL ) throw();
+
+ virtual ~SvXMLImport() throw();
+
+ static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
+
+ // ::com::sun::star::xml::sax::XDocumentHandler
+ virtual void SAL_CALL startDocument(void)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL endDocument(void)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL startElement(const OUString& aName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL endElement(const OUString& aName)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL characters(const OUString& aChars)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL ignorableWhitespace(const OUString& aWhitespaces)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL processingInstruction(const OUString& aTarget,
+ const OUString& aData)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::xml::sax::XExtendedDocumentHandler
+ virtual void SAL_CALL startCDATA(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL endCDATA(void) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL comment(const OUString& sComment)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL allowLineBreak(void)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL unknown(const OUString& sString)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+ // XImporter
+ virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ // XFilter
+ virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL cancel( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // may be called by certain subclasses that handle document meta-data
+ // override to provide customized handling of document statistics
+ // the base class implementation initializes the progress bar and should
+ // be called by overriding methods
+ virtual void SetStatistics(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > & i_rStats);
+
+ // get import helper for text
+ inline UniReference< XMLTextImportHelper > GetTextImport();
+ sal_Bool HasTextImport() const { return mxTextImport.is(); }
+ inline SvXMLNumFmtHelper* GetDataStylesImport();
+
+ // get import helper for shapes
+ inline UniReference< XMLShapeImportHelper > GetShapeImport();
+
+ // get import helper for charts
+ inline UniReference< SchXMLImportHelper > GetChartImport();
+
+ // get import helper for form layer
+ inline UniReference< ::xmloff::OFormLayerXMLImport > GetFormImport();
+
+ // get XPropertySet with import information
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getImportInfo() const { return mxImportInfo; }
+
+ // get import helper for events
+ XMLEventImportHelper& GetEventImport();
+
+ SvXMLNamespaceMap& GetNamespaceMap() { return *mpNamespaceMap; }
+ const SvXMLNamespaceMap& GetNamespaceMap() const { return *mpNamespaceMap; }
+ const SvXMLUnitConverter& GetMM100UnitConverter() const { return *mpUnitConv; }
+ SvXMLUnitConverter& GetMM100UnitConverter() { return *mpUnitConv; }
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & GetLocator() const { return mxLocator; }
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &
+ GetModel() const { return mxModel; }
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetGradientHelper();
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetHatchHelper();
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetBitmapHelper();
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetTransGradientHelper();
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetMarkerHelper();
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetDashHelper();
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & GetNumberFormatsSupplier();
+ inline void SetNumberFormatsSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& _xNumberFormatSupplier)
+ {
+ mxNumberFormatsSupplier = _xNumberFormatSupplier;
+ }
+
+ // Convert a local packe URL into either a graphic manager or a
+ // internal package URL. The later one happens only if bLoadURL is true
+ OUString ResolveGraphicObjectURL( const OUString& rURL, sal_Bool bLoadOnDemand );
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+ GetStreamForGraphicObjectURLFromBase64();
+ OUString ResolveGraphicObjectURLFromBase64(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOut );
+
+ sal_Bool IsPackageURL( const OUString& rURL ) const;
+ OUString ResolveEmbeddedObjectURL( const OUString& rURL,
+ const OUString& rClassId );
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+ GetStreamForEmbeddedObjectURLFromBase64();
+ OUString ResolveEmbeddedObjectURLFromBase64();
+
+ // get source storage we're importing from (if available)
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ GetSourceStorage();
+
+ void AddStyleDisplayName( sal_uInt16 nFamily,
+ const OUString& rName,
+ const OUString& rDisplayName );
+ OUString GetStyleDisplayName( sal_uInt16 nFamily,
+ const OUString& rName ) const;
+
+ ProgressBarHelper* GetProgressBarHelper();
+
+ void AddNumberStyle(sal_Int32 nKey, const OUString& sName);
+
+ virtual void SetViewSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aViewProps);
+ virtual void SetConfigurationSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aConfigProps);
+ virtual void SetDocumentSpecificSettings(const OUString& _rSettingsGroupName,
+ const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& _rSettings);
+
+ XMLFontStylesContext *GetFontDecls();
+ SvXMLStylesContext *GetStyles();
+ SvXMLStylesContext *GetAutoStyles();
+ const XMLFontStylesContext *GetFontDecls() const;
+ const SvXMLStylesContext *GetStyles() const;
+ const SvXMLStylesContext *GetAutoStyles() const;
+
+ sal_uInt16 getImportFlags() const { return mnImportFlags; }
+ sal_Bool IsFormsSupported() const { return mbIsFormsSupported; }
+ OUString GetAbsoluteReference(const OUString& rValue) const;
+
+ sal_Unicode ConvStarBatsCharToStarSymbol( sal_Unicode c );
+ sal_Unicode ConvStarMathCharToStarSymbol( sal_Unicode c );
+
+ bool IsTableShapeSupported() const { return mbIsTableShapeSupported; }
+
+ OUString GetODFVersion() const;
+
+ /**
+ * Record an error condition that occurred during import. The
+ * behavior of SetError can be modified using the error flag
+ * constants.
+ */
+ void SetError(
+ /// error ID, may contain an error flag
+ sal_Int32 nId,
+ /// string parameters for the error message
+ const ::com::sun::star::uno::Sequence< OUString > & rMsgParams,
+ /// original exception message (if applicable)
+ const OUString& rExceptionMessage,
+ /// error location (if applicable)
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XLocator> & rLocator );
+
+ void SetError(
+ sal_Int32 nId,
+ const ::com::sun::star::uno::Sequence< OUString> & rMsgParams);
+
+ void SetError( sal_Int32 nId );
+ void SetError( sal_Int32 nId, const OUString& rMsg1 );
+ void SetError( sal_Int32 nId, const OUString& rMsg1,
+ const OUString& rMsg2 );
+
+ /** return current error flags */
+ sal_uInt16 GetErrorFlags() { return mnErrorFlags; }
+
+ virtual void DisposingModel();
+
+ ::comphelper::UnoInterfaceToUniqueIdentifierMapper& getInterfaceToIdentifierMapper();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ GetComponentContext() const;
+
+ // Convert drawing object positions from OOo file format to OASIS file format and vice versa (#i28749#)
+ sal_Bool IsShapePositionInHoriL2R() const;
+
+ sal_Bool IsTextDocInOOoFileFormat() const;
+
+ OUString GetBaseURL() const;
+ OUString GetDocumentBase() const;
+
+ /// name of stream in package, e.g., "content.xml"
+ OUString GetStreamName() const;
+
+ /// set the XmlId attribute of given UNO object (for RDF metadata)
+ void SetXmlId(::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface> const & i_xIfc,
+ OUString const & i_rXmlId);
+
+ /// Add a RDFa statement; parameters are XML attribute values
+ void AddRDFa( ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable> i_xObject,
+ OUString const & i_rAbout,
+ OUString const & i_rProperty,
+ OUString const & i_rContent,
+ OUString const & i_rDatatype);
+
+ /// do not dllexport this; only for advanced cases (bookmark-start)
+ SAL_DLLPRIVATE ::xmloff::RDFaImportHelper & GetRDFaImportHelper();
+
+ // #i31958# XForms helper method
+ // (to be implemented by applications suporting XForms)
+ virtual void initXForms();
+
+ /** returns the upd and build id (f.e. "680m124$Build-8964" gives rMaster = 680 and rBuild = 8964)
+ from the metafile.
+ this only works if the meta.xml was already imported and the
+ import propertyset contains the string property "BuildId".
+ If false is returned the build ids are not available (yet).
+ **/
+ bool getBuildIds( sal_Int32& rUPD, sal_Int32& rBuild ) const;
+
+ static const sal_uInt16 OOo_1x = 10;
+ static const sal_uInt16 OOo_2x = 20;
+ static const sal_uInt16 OOo_30x = 30;
+ static const sal_uInt16 OOo_31x = 31;
+ static const sal_uInt16 OOo_32x = 32;
+ static const sal_uInt16 OOo_33x = 33;
+ static const sal_uInt16 OOo_34x = 34;
+ static const sal_uInt16 LO_flag = 0x100;
+ static const sal_uInt16 LO_3x = 30 | LO_flag;
+ static const sal_uInt16 LO_4x = 40 | LO_flag;
+ static const sal_uInt16 ProductVersionUnknown = SAL_MAX_UINT16;
+
+ /** depending on whether the generator version indicates LO, compare
+ against either the given LO or given OOo version */
+ bool isGeneratorVersionOlderThan(
+ sal_uInt16 const nOOoVersion, sal_uInt16 const nLOVersion);
+
+ /** this checks the build ID and returns
+
+ * OOo_1x for files created with OpenOffice.org 1.x or StarOffice 7 (this also includes binary import over binfilter)
+ * OOo_2x for files created with OpenOffice.org 2.x or StarOffice 8
+ * OOo_30x for files created with OpenOffice.org 3.0/3.0.1 or StarOffice 9/9 PU01
+ * OOo_31x for files created with OpenOffice.org 3.1/3.1.1 or StarOffice 9 PU02/9 PU03
+ * OOo_32x for files created with OpenOffice.org 3.2/3.2.1 or StarOffice 9 PU04 or Oracle Open Office 3.2.1
+ * OOo_33x for files created with OpenOffice.org 3.3 (and minors) or Oracle Open Office 3.3 (and minors)
+ * OOo_34x for files created with OpenOffice.org 3.4 Beta or Oracle Open Office 3.4 Beta
+ * ProductVersionUnknown for files not created with OpenOffice.org, StarOffice or Oracle Open Office
+ */
+ sal_uInt16 getGeneratorVersion() const;
+
+ /** If true, the URL for graphic shapes may be stored as a package URL and
+ loaded later (on demand) by the application. Otherwise graphics are
+ loaded immediately and the graphic shape gets the graphic manager URL.
+
+ @see <member>mbIsGraphicLoadOnDemandSupported</member>
+ */
+ bool isGraphicLoadOnDemandSupported() const;
+
+ /**
+ Returns true if the embedded font document URL has already been processed.
+ Otherwise returns false and consequent calls with the same URL will return true.
+ */
+ bool embeddedFontAlreadyProcessed( const OUString& url );
+
+ virtual void NotifyEmbeddedFontRead() {};
+};
+
+inline UniReference< XMLTextImportHelper > SvXMLImport::GetTextImport()
+{
+ if( !mxTextImport.is() )
+ mxTextImport = CreateTextImport();
+
+ return mxTextImport;
+}
+
+inline UniReference< XMLShapeImportHelper > SvXMLImport::GetShapeImport()
+{
+ if( !mxShapeImport.is() )
+ mxShapeImport = CreateShapeImport();
+
+ return mxShapeImport;
+}
+
+inline UniReference< SchXMLImportHelper > SvXMLImport::GetChartImport()
+{
+ if( !mxChartImport.is() )
+ mxChartImport = CreateChartImport();
+
+ return mxChartImport;
+}
+
+inline UniReference< ::xmloff::OFormLayerXMLImport > SvXMLImport::GetFormImport()
+{
+ if( !mxFormImport.is() )
+ mxFormImport = CreateFormImport();
+
+ return mxFormImport;
+}
+
+inline void SvXMLImport::SetEmbeddedResolver(
+ com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver )
+{
+ mxEmbeddedResolver = _xEmbeddedResolver;
+}
+
+inline void SvXMLImport::SetGraphicResolver(
+ com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver >& _xGraphicResolver )
+{
+ mxGraphicResolver = _xGraphicResolver;
+}
+
+inline ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & SvXMLImport::GetNumberFormatsSupplier()
+{
+ if ( ! mxNumberFormatsSupplier.is() && mxModel.is() )
+ _CreateNumberFormatsSupplier();
+
+ return mxNumberFormatsSupplier;
+}
+
+inline SvXMLNumFmtHelper* SvXMLImport::GetDataStylesImport()
+{
+ if ( mpNumImport == NULL)
+ _CreateDataStylesImport();
+
+ return mpNumImport;
+}
+
+
+#endif // _XMLOFF_XMLIMP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlimppr.hxx b/include/xmloff/xmlimppr.hxx
new file mode 100644
index 000000000000..642e898aa3bb
--- /dev/null
+++ b/include/xmloff/xmlimppr.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 _XMLOFF_XMLIMPPR_HXX
+#define _XMLOFF_XMLIMPPR_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <tools/solar.h>
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
+
+#include <vector>
+#include <xmloff/uniref.hxx>
+
+struct XMLPropertyState;
+class XMLPropertySetMapper;
+
+
+class SvXMLUnitConverter;
+class SvXMLNamespaceMap;
+class SvXMLImport;
+
+/** This struct is used as an optional parameter to the static
+ * _FillPropertySet() methods.
+ *
+ * It should not be used in any other context.
+ */
+struct _ContextID_Index_Pair
+{
+ sal_Int16 nContextID;
+ sal_Int32 nIndex;
+};
+
+class XMLOFF_DLLPUBLIC SvXMLImportPropertyMapper : public UniRefBase
+{
+ UniReference< SvXMLImportPropertyMapper> mxNextMapper;
+
+ SvXMLImport& rImport; // access to error handling
+
+ SAL_DLLPRIVATE SvXMLImportPropertyMapper(SvXMLImportPropertyMapper &);
+ // not defined
+ SAL_DLLPRIVATE void operator =(SvXMLImportPropertyMapper &); // not defined
+
+protected:
+
+ UniReference< XMLPropertySetMapper > maPropMapper;
+ SvXMLImport& GetImport() const { return rImport;}
+
+public:
+
+ SvXMLImportPropertyMapper(
+ const UniReference< XMLPropertySetMapper >& rMapper,
+ SvXMLImport& rImport);
+ virtual ~SvXMLImportPropertyMapper();
+
+ // Add a ImportPropertyMapper at the end of the import mapper chain.
+ // The added mapper MUST not be used outside the Mapper chain any longer,
+ // because its PropertyMapper will be replaced.
+ void ChainImportMapper(
+ const UniReference< SvXMLImportPropertyMapper>& rMapper );
+
+ /** fills the given itemset with the attributes in the given list
+ * the map is only searched within the range
+ * [nStartIdx, nEndIdx[
+ */
+ void importXML(
+ ::std::vector< XMLPropertyState >& rProperties,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > xAttrList,
+ const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap,
+ sal_uInt32 nPropType,
+ sal_Int32 nStartIdx, sal_Int32 nEndIdx ) const;
+
+ /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_IMPORT flag set */
+ virtual bool handleSpecialItem(
+ XMLPropertyState& rProperty,
+ ::std::vector< XMLPropertyState >& rProperties,
+ const OUString& rValue,
+ const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap ) const;
+
+ /** This method is called when all attributes have benn processed. It may be used to remove items that are incomplete */
+ virtual void finished(
+ ::std::vector< XMLPropertyState >& rProperties,
+ sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const;
+
+ void CheckSpecialContext(
+ const ::std::vector< XMLPropertyState >& aProperties,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > rPropSet,
+ _ContextID_Index_Pair* pSpecialContextIds ) const;
+
+ sal_Bool FillPropertySet(
+ const ::std::vector< XMLPropertyState >& aProperties,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > rPropSet,
+ _ContextID_Index_Pair* pSpecialContextIds = NULL ) const;
+
+ void FillPropertySequence(
+ const ::std::vector< XMLPropertyState >& aProperties,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rValues )
+ const;
+
+ inline const UniReference< XMLPropertySetMapper >&
+ getPropertySetMapper() const;
+
+
+
+ /** implementation helper for FillPropertySet: fill an XPropertySet.
+ * Exceptions will be asserted. */
+ static sal_Bool _FillPropertySet(
+ const ::std::vector<XMLPropertyState> & rProperties,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & rPropSet,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySetInfo> & rPropSetInfo,
+ const UniReference<XMLPropertySetMapper> & rPropMapper,
+ SvXMLImport& rImport,
+
+ // parameter for use by txtstyli.cxx; allows efficient
+ // catching the combined characters property
+ _ContextID_Index_Pair* pSpecialContextIds = NULL );
+
+ /** implementation helper for FillPropertySet: fill an XMultiPropertySet.
+ * If unsuccessul, set return value. */
+ static sal_Bool _FillMultiPropertySet(
+ const ::std::vector<XMLPropertyState> & rProperties,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XMultiPropertySet> & rMultiPropSet,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySetInfo> & rPropSetInfo,
+ const UniReference<XMLPropertySetMapper> & rPropMapper,
+
+ // parameters for use by txtstyli.cxx; allows efficient
+ // catching the combined characters property
+ _ContextID_Index_Pair* pSpecialContextIds = NULL );
+
+ /** implementation helper for FillPropertySet: fill an XTolerantMultiPropertySet.
+ * If unsuccessul, set return value. */
+ static sal_Bool _FillTolerantMultiPropertySet(
+ const ::std::vector<XMLPropertyState> & rProperties,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XTolerantMultiPropertySet> & rTolPropSet,
+ const UniReference<XMLPropertySetMapper> & rPropMapper,
+ SvXMLImport& rImport,
+
+ // parameters for use by txtstyli.cxx; allows efficient
+ // catching the combined characters property
+ _ContextID_Index_Pair* pSpecialContextIds = NULL );
+
+
+ static void _PrepareForMultiPropertySet(
+ const ::std::vector<XMLPropertyState> & rProperties,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySetInfo> & rPropSetInfo,
+ const UniReference<XMLPropertySetMapper> & rPropMapper,
+ _ContextID_Index_Pair* pSpecialContextIds,
+ ::com::sun::star::uno::Sequence< OUString >& rNames,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rValues);
+};
+
+
+inline const UniReference< XMLPropertySetMapper >&
+ SvXMLImportPropertyMapper::getPropertySetMapper() const
+{
+ return maPropMapper;
+}
+
+#endif // _XMLOFF_XMLIMPPR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlmetae.hxx b/include/xmloff/xmlmetae.hxx
new file mode 100644
index 000000000000..3b99cbfabfdf
--- /dev/null
+++ b/include/xmloff/xmlmetae.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 _XMLOFF_XMLMETAE_HXX
+#define _XMLOFF_XMLMETAE_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+
+#include <cppuhelper/implbase1.hxx>
+#include <xmloff/xmltoken.hxx>
+
+#include <vector>
+
+#include <com/sun/star/beans/StringPair.hpp>
+#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
+
+
+class SvXMLExport;
+
+/** export meta data from an <type>XDocumentProperties</type> instance.
+
+ <p>
+ This class will start the export at the office:meta element,
+ not at the root element. This means that when <method>Export</method>
+ is called here, the document root element must already be written, but
+ office:meta must <em>not</em> be written.
+ </p>
+ */
+class XMLOFF_DLLPUBLIC SvXMLMetaExport : public ::cppu::WeakImplHelper1<
+ ::com::sun::star::xml::sax::XDocumentHandler >
+{
+private:
+ SvXMLExport& mrExport;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties> mxDocProps;
+ /// counts levels of the xml document. necessary for special handling.
+ int m_level;
+ /// preserved namespaces. necessary because we do not write the root node.
+ std::vector< ::com::sun::star::beans::StringPair > m_preservedNSs;
+
+ SAL_DLLPRIVATE void SimpleStringElement(
+ const OUString& rText, sal_uInt16 nNamespace,
+ enum ::xmloff::token::XMLTokenEnum eElementName );
+ SAL_DLLPRIVATE void SimpleDateTimeElement(
+ const ::com::sun::star::util::DateTime & rDate, sal_uInt16 nNamespace,
+ enum ::xmloff::token::XMLTokenEnum eElementName );
+
+ /// currently unused; for exporting via the XDocumentProperties interface
+ SAL_DLLPRIVATE void _MExport();
+
+public:
+ SvXMLMetaExport( SvXMLExport& i_rExport,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>& i_rDocProps);
+
+ virtual ~SvXMLMetaExport();
+
+ /// export via XSAXWriter interface, with fallback to _MExport
+ void Export();
+
+ static OUString GetISODateTimeString(
+ const ::com::sun::star::util::DateTime& rDateTime );
+
+ // ::com::sun::star::xml::sax::XDocumentHandler:
+ virtual void SAL_CALL startDocument()
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL endDocument()
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL startElement(const OUString & i_rName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & i_xAttribs)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL endElement(const OUString & i_rName)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL characters(const OUString & i_rChars)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL ignorableWhitespace(
+ const OUString & i_rWhitespaces)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL processingInstruction(
+ const OUString & i_rTarget, const OUString & i_rData)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL setDocumentLocator(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XLocator > & i_xLocator)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::xml::sax::SAXException);
+
+};
+
+#endif // _XMLOFF_XMLMETAE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlmetai.hxx b/include/xmloff/xmlmetai.hxx
new file mode 100644
index 000000000000..061bd78e6df0
--- /dev/null
+++ b/include/xmloff/xmlmetai.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 XMLOFF_XMLMETAI_HXX
+#define XMLOFF_XMLMETAI_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/xmlictxt.hxx>
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/xml/dom/XSAXDocumentBuilder2.hpp>
+
+
+/// handles the top-level office:document-meta element of meta.xml documents
+// NB: virtual inheritance is needed so that the context that handles the
+// flat xml file format can multiply inherit properly
+class XMLOFF_DLLPUBLIC SvXMLMetaDocumentContext
+ : public virtual SvXMLImportContext
+{
+private:
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties> mxDocProps;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::dom::XSAXDocumentBuilder2> mxDocBuilder;
+
+public:
+ SvXMLMetaDocumentContext(SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>& xDocProps);
+
+ virtual ~SvXMLMetaDocumentContext();
+
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
+
+ virtual void StartElement( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ virtual void EndElement();
+
+public:
+ static void setBuildId(const OUString & rGenerator,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xImportInfo );
+};
+
+#endif // _XMLOFF_XMLMETAI_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlmultiimagehelper.hxx b/include/xmloff/xmlmultiimagehelper.hxx
new file mode 100644
index 000000000000..cb0a290b1bbd
--- /dev/null
+++ b/include/xmloff/xmlmultiimagehelper.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 _XMLOFF_XMLMULTIIMAGEHELPER_HXX
+#define _XMLOFF_XMLMULTIIMAGEHELPER_HXX
+
+#include <sal/types.h>
+#include <xmloff/xmlimp.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+class multiImageImportHelper
+{
+private:
+ std::vector< SvXMLImportContextRef* > maImplContextVector;
+ bool mbSupportsMultipleContents;
+
+protected:
+ /// helper to get the created xShape instance, needs to be overloaded
+ virtual OUString getGraphicURLFromImportContext(const SvXMLImportContext& rContext) const = 0;
+ virtual void removeGraphicFromImportContext(const SvXMLImportContext& rContext) const = 0;
+
+public:
+ multiImageImportHelper();
+ virtual ~multiImageImportHelper();
+
+ /// solve multiple imported images. The most valuable one is choosen,
+ /// see imlementation for evtl. changing weights and/or adding filetypes
+ void solveMultipleImages();
+
+ /// add a content to the remembered image import contexts
+ void addContent(const SvXMLImportContext& rSvXMLImportContext);
+
+ /// read/write access to boolean switch
+ bool getSupportsMultipleContents() const { return mbSupportsMultipleContents; }
+ void setSupportsMultipleContents(bool bNew) { mbSupportsMultipleContents = bNew; }
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _XMLOFF_XMLMULTIIMAGEHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlnmspe.hxx b/include/xmloff/xmlnmspe.hxx
new file mode 100644
index 000000000000..b1646c307b63
--- /dev/null
+++ b/include/xmloff/xmlnmspe.hxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#define _XMLOFF_XMLNMSPE_HXX
+
+#include <sal/types.h>
+
+#define XML_NAMESPACE( prefix, key ) \
+const sal_uInt16 XML_NAMESPACE_##prefix = key; \
+const sal_uInt16 XML_NAMESPACE_##prefix##_IDX = key;
+
+#define XML_OLD_NAMESPACE( prefix, index ) \
+const sal_uInt16 XML_OLD_NAMESPACE_##prefix##_IDX = \
+ (_XML_OLD_NAMESPACE_BASE+index);
+
+// current namespaces
+// These namespaces have the same index in the namespace table as prefix used.
+// If a namespace is added, _XML_OLD_NAMESPACE_BASE has to be adjusted!
+XML_NAMESPACE( OFFICE, 0U )
+XML_NAMESPACE( STYLE, 1U )
+XML_NAMESPACE( TEXT , 2U )
+XML_NAMESPACE( TABLE, 3U )
+XML_NAMESPACE( DRAW , 4U )
+XML_NAMESPACE( FO , 5U )
+XML_NAMESPACE( XLINK, 6U )
+XML_NAMESPACE( DC , 7U )
+XML_NAMESPACE( META , 8U )
+XML_NAMESPACE( NUMBER, 9U )
+XML_NAMESPACE( PRESENTATION, 10U )
+XML_NAMESPACE( SVG, 11U )
+XML_NAMESPACE( CHART, 12U )
+XML_NAMESPACE( DR3D, 13U )
+XML_NAMESPACE( MATH, 14U )
+XML_NAMESPACE( FORM, 15U )
+XML_NAMESPACE( SCRIPT, 16U )
+XML_NAMESPACE( BLOCKLIST, 17U )
+XML_NAMESPACE( FRAMEWORK, 18U )
+XML_NAMESPACE( CONFIG, 19U )
+XML_NAMESPACE( OOO, 20U )
+XML_NAMESPACE( OOOW, 21U )
+XML_NAMESPACE( OOOC, 22U )
+XML_NAMESPACE( DOM, 23U )
+XML_NAMESPACE( TCD, 24U ) // text conversion dictionary
+XML_NAMESPACE( DB, 25U )
+XML_NAMESPACE( DLG, 26U )
+XML_NAMESPACE( XFORMS, 27U )
+XML_NAMESPACE( XSD, 28U )
+XML_NAMESPACE( XSI, 29U )
+XML_NAMESPACE( SMIL, 30U )
+XML_NAMESPACE( ANIMATION, 31U )
+XML_NAMESPACE( XML, 32U )
+XML_NAMESPACE( REPORT, 33U )
+XML_NAMESPACE( OF, 34U ) // OpenFormula aka ODFF
+XML_NAMESPACE( XHTML, 35U )
+XML_NAMESPACE( GRDDL, 36U )
+
+// namespaces for odf extended formats
+
+#define XML_NAMESPACE_EXT( prefix, key ) \
+const sal_uInt16 XML_NAMESPACE_##prefix##_EXT = key; \
+const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX = key;
+
+XML_NAMESPACE_EXT( OFFICE, 37U )
+XML_NAMESPACE_EXT( TABLE, 38U )
+XML_NAMESPACE_EXT( CHART, 39U )
+XML_NAMESPACE_EXT( DRAW, 40U )
+XML_NAMESPACE_EXT( CALC, 41U )
+
+#define _XML_OLD_NAMESPACE_BASE 42U
+
+// namespaces used in the technical preview (SO 5.2)
+XML_OLD_NAMESPACE( FO, 0U )
+XML_OLD_NAMESPACE( XLINK, 1U )
+
+XML_OLD_NAMESPACE( OFFICE, 2U )
+XML_OLD_NAMESPACE( STYLE, 3U )
+XML_OLD_NAMESPACE( TEXT, 4U )
+XML_OLD_NAMESPACE( TABLE, 5U )
+XML_OLD_NAMESPACE( META, 6U )
+
+// experimental namespaces
+XML_NAMESPACE( FIELD, 100U )
+XML_NAMESPACE( CSS3TEXT, 103U ) // CSS Text Level 3
+XML_NAMESPACE( FORMX, 101U ) // form interop extensions
+
+
+#endif // _XMLOFF_XMLNMSPE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlnume.hxx b/include/xmloff/xmlnume.hxx
new file mode 100644
index 000000000000..78e7cbfdd191
--- /dev/null
+++ b/include/xmloff/xmlnume.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 _XMLOFF_XMLNUME_HXX
+#define _XMLOFF_XMLNUME_HXX
+
+#include <rtl/ustring.hxx>
+#include <tools/mapunit.hxx>
+#include <xmloff/XMLStringVector.hxx>
+#include <xmloff/attrlist.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace frame { class XModel; }
+ namespace style { class XStyle; }
+ namespace container { class XIndexReplace; }
+ namespace beans { struct PropertyValue; }
+} } }
+
+class SvXMLNamespaceMap;
+class SvXMLUnitConverter;
+class SvXMLExportItemMapper;
+class SvXMLExport;
+class XMLTextListAutoStylePool;
+
+class SvxXMLNumRuleExport
+{
+ SvXMLExport& rExport;
+ const OUString sCDATA;
+ const OUString sWS;
+ const OUString sNumberingRules;
+ const OUString sIsPhysical;
+ const OUString sIsContinuousNumbering;
+ // Boolean indicating, if properties for position-and-space-mode LABEL_ALIGNEMNT
+ // are exported or not. (#i89178#)
+ // These properties have been introduced in ODF 1.2. Thus, its export have
+ // to be suppressed on writing ODF 1.0 respectively ODF 1.1
+ bool mbExportPositionAndSpaceModeLabelAlignment;
+
+ void exportLevelStyles(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XIndexReplace > & xNumRule,
+ sal_Bool bOutline=sal_False );
+
+ void exportLevelStyle(
+ sal_Int32 nLevel,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue>& rProps,
+ sal_Bool bOutline=sal_False );
+
+protected:
+
+ // This method may be overloaded to add attributes to the <list-style>
+ // element.
+ virtual void AddListStyleAttributes();
+
+ sal_Bool exportStyle( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::style::XStyle >& rStyle );
+ void exportOutline();
+
+ SvXMLExport& GetExport() { return rExport; }
+
+public:
+
+ SvxXMLNumRuleExport( SvXMLExport& rExport );
+ virtual ~SvxXMLNumRuleExport();
+
+ void exportStyles( sal_Bool bUsed,
+ XMLTextListAutoStylePool *pPool,
+ sal_Bool bExportChapterNumbering = sal_True );
+ void exportNumberingRule(
+ const OUString& rName, sal_Bool bIsHidden,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XIndexReplace > & xNumRule );
+};
+
+#endif // _XMLOFF_XMLNUME_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlnumfe.hxx b/include/xmloff/xmlnumfe.hxx
new file mode 100644
index 000000000000..20029a6f99b7
--- /dev/null
+++ b/include/xmloff/xmlnumfe.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 _XMLOFF_XMLNUMFE_HXX
+#define _XMLOFF_XMLNUMFE_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ustrbuf.hxx>
+
+#define XML_WRITTENNUMBERSTYLES "WrittenNumberStyles"
+
+class Color;
+class LocaleDataWrapper;
+class CharClass;
+class SvXMLExport;
+class SvXMLNamespaceMap;
+class SvXMLAttributeList;
+class SvNumberFormatter;
+class SvNumberformat;
+class SvXMLNumUsedList_Impl;
+class SvXMLEmbeddedTextEntryArr;
+
+class XMLOFF_DLLPUBLIC SvXMLNumFmtExport
+{
+private:
+ SvXMLExport& rExport;
+ OUString sPrefix;
+ SvNumberFormatter* pFormatter;
+ OUStringBuffer sTextContent;
+ SvXMLNumUsedList_Impl* pUsedList;
+ CharClass* pCharClass;
+ LocaleDataWrapper* pLocaleData;
+
+ SAL_DLLPRIVATE void AddCalendarAttr_Impl( const OUString& rCalendar );
+ SAL_DLLPRIVATE void AddStyleAttr_Impl( sal_Bool bLong );
+ SAL_DLLPRIVATE void AddTextualAttr_Impl( sal_Bool bText );
+ SAL_DLLPRIVATE void AddLanguageAttr_Impl( sal_Int32 nLang );
+
+ SAL_DLLPRIVATE void AddToTextElement_Impl( const OUString& rString );
+ SAL_DLLPRIVATE void FinishTextElement_Impl();
+
+ SAL_DLLPRIVATE void WriteColorElement_Impl( const Color& rColor );
+ SAL_DLLPRIVATE void WriteNumberElement_Impl( sal_Int32 nDecimals, sal_Int32 nInteger,
+ const OUString& rDashStr, sal_Bool bVarDecimals,
+ sal_Bool bGrouping, sal_Int32 nTrailingThousands,
+ const SvXMLEmbeddedTextEntryArr& rEmbeddedEntries );
+ SAL_DLLPRIVATE void WriteScientificElement_Impl( sal_Int32 nDecimals, sal_Int32 nInteger,
+ sal_Bool bGrouping, sal_Int32 nExp );
+ SAL_DLLPRIVATE void WriteFractionElement_Impl( sal_Int32 nInteger, sal_Bool bGrouping,
+ sal_Int32 nNumeratorDigits, sal_Int32 nDenominatorDigits, sal_Int32 nDenominator );
+ SAL_DLLPRIVATE void WriteCurrencyElement_Impl( const OUString& rString,
+ const OUString& rExt );
+ SAL_DLLPRIVATE void WriteBooleanElement_Impl();
+ SAL_DLLPRIVATE void WriteTextContentElement_Impl();
+ SAL_DLLPRIVATE void WriteDayElement_Impl( const OUString& rCalendar, sal_Bool bLong );
+ SAL_DLLPRIVATE void WriteMonthElement_Impl( const OUString& rCalendar, sal_Bool bLong, sal_Bool bText );
+ SAL_DLLPRIVATE void WriteYearElement_Impl( const OUString& rCalendar, sal_Bool bLong );
+ SAL_DLLPRIVATE void WriteEraElement_Impl( const OUString& rCalendar, sal_Bool bLong );
+ SAL_DLLPRIVATE void WriteDayOfWeekElement_Impl( const OUString& rCalendar, sal_Bool bLong );
+ SAL_DLLPRIVATE void WriteWeekElement_Impl( const OUString& rCalendar );
+ SAL_DLLPRIVATE void WriteQuarterElement_Impl( const OUString& rCalendar, sal_Bool bLong );
+ SAL_DLLPRIVATE void WriteHoursElement_Impl( sal_Bool bLong );
+ SAL_DLLPRIVATE void WriteMinutesElement_Impl( sal_Bool bLong );
+ SAL_DLLPRIVATE void WriteSecondsElement_Impl( sal_Bool bLong, sal_uInt16 nDecimals );
+ SAL_DLLPRIVATE void WriteAMPMElement_Impl();
+ SAL_DLLPRIVATE void WriteMapElement_Impl( sal_Int32 nOp, double fLimit,
+ sal_Int32 nKey, sal_Int32 nPart );
+
+ SAL_DLLPRIVATE void WriteRepeatedElement_Impl( sal_Unicode ch );
+ SAL_DLLPRIVATE sal_Bool WriteTextWithCurrency_Impl( const OUString& rString,
+ const ::com::sun::star::lang::Locale& rLocale );
+ SAL_DLLPRIVATE void ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt32 nKey,
+ sal_uInt16 nPart, sal_Bool bDefPart );
+
+ SAL_DLLPRIVATE void ExportFormat_Impl( const SvNumberformat& rFormat, sal_uInt32 nKey );
+
+public:
+ SvXMLNumFmtExport( SvXMLExport& rExport,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::util::XNumberFormatsSupplier >& rSupp );
+ SvXMLNumFmtExport( SvXMLExport& rExport,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::util::XNumberFormatsSupplier >& rSupp,
+ const OUString& rPrefix );
+
+ virtual ~SvXMLNumFmtExport();
+
+ // core API
+ void Export( sal_Bool bIsAutoStyle);
+
+ // mark number format as used
+ void SetUsed( sal_uInt32 nKey );
+
+ // get the style name that was generated for a key
+ OUString GetStyleName( sal_uInt32 nKey );
+
+ void GetWasUsed(com::sun::star::uno::Sequence<sal_Int32>& rWasUsed);
+ void SetWasUsed(const com::sun::star::uno::Sequence<sal_Int32>& rWasUsed);
+
+
+
+ // two methods to allow the field import/export to treat system languages
+ // properly:
+
+ /// obtain number format with system languange for a given key
+ sal_uInt32 ForceSystemLanguage( sal_uInt32 nKey );
+
+ /// determine whether number format uses system language
+ bool IsSystemLanguage( sal_uInt32 nKey );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlnumfi.hxx b/include/xmloff/xmlnumfi.hxx
new file mode 100644
index 000000000000..34bb91cbe9fe
--- /dev/null
+++ b/include/xmloff/xmlnumfi.hxx
@@ -0,0 +1,214 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_XMLNUMFI_HXX
+#define _XMLOFF_XMLNUMFI_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <xmloff/xmlstyle.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <i18nlangtag/lang.h>
+#include <vector>
+#include <unotools/localedatawrapper.hxx>
+
+#define XML_NUMBERSTYLES "NumberStyles"
+
+enum SvXMLStylesTokens
+{
+ XML_TOK_STYLES_NUMBER_STYLE,
+ XML_TOK_STYLES_CURRENCY_STYLE,
+ XML_TOK_STYLES_PERCENTAGE_STYLE,
+ XML_TOK_STYLES_DATE_STYLE,
+ XML_TOK_STYLES_TIME_STYLE,
+ XML_TOK_STYLES_BOOLEAN_STYLE,
+ XML_TOK_STYLES_TEXT_STYLE
+};
+
+enum SvXMLDateElementAttributes
+{
+ XML_DEA_NONE,
+ XML_DEA_ANY,
+ XML_DEA_SHORT,
+ XML_DEA_LONG,
+ XML_DEA_TEXTSHORT,
+ XML_DEA_TEXTLONG
+};
+
+class Color;
+class SvXMLNumImpData;
+class SvXMLImport;
+class SvXMLStyleContext;
+class SvXMLStylesContext;
+struct SvXMLNumberInfo;
+class SvNumberFormatter;
+class SvtSysLocale;
+namespace com { namespace sun { namespace star { namespace lang {
+ class XMultiServiceFactory;
+}}}}
+
+
+// use SvXMLNumFmtHelper in the context for <office:styles> to create
+// child contexts for data styles
+
+class SvXMLNumFmtHelper
+{
+ SvXMLNumImpData* pData;
+
+public:
+ SvXMLNumFmtHelper(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& rSupp,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+
+ SvXMLNumFmtHelper(
+ SvNumberFormatter* pNumberFormatter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
+
+ ~SvXMLNumFmtHelper();
+
+ SvXMLStyleContext* CreateChildContext( SvXMLImport& rImport,
+ sal_uInt16 nPrefix, const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ SvXMLStylesContext& rStyles);
+
+ SvXMLNumImpData* getData() { return pData; }
+
+ const SvXMLTokenMap& GetStylesElemTokenMap();
+
+// sal_uInt32 GetKeyForName( const OUString& rName );
+};
+
+// SvXMLNumFmtDefaults is used in import and export
+
+class SvXMLNumFmtDefaults
+{
+public:
+ // return value is NfIndexTableOffset
+ static sal_uInt16 GetDefaultDateFormat( SvXMLDateElementAttributes eDOW,
+ SvXMLDateElementAttributes eDay, SvXMLDateElementAttributes eMonth,
+ SvXMLDateElementAttributes eYear, SvXMLDateElementAttributes eHours,
+ SvXMLDateElementAttributes eMins, SvXMLDateElementAttributes eSecs,
+ sal_Bool bSystem );
+};
+
+struct MyCondition
+{
+ OUString sCondition;
+ OUString sMapName;
+};
+
+class XMLOFF_DLLPUBLIC SvXMLNumFormatContext : public SvXMLStyleContext
+{
+ SvXMLNumImpData* pData;
+ SvXMLStylesContext* pStyles;
+ std::vector <MyCondition> aMyConditions;
+ sal_uInt16 nType;
+ sal_Int32 nKey;
+// OUString sFormatName;
+ OUString sFormatTitle;
+// OUString sMapName;
+ OUString sCalendar;
+ OUString sFormatString;
+ LanguageType nFormatLang;
+ com::sun::star::lang::Locale aLocale;
+ sal_Bool bAutoOrder;
+ sal_Bool bFromSystem;
+ sal_Bool bTruncate;
+ sal_Bool bAutoDec; // set in AddNumber
+ sal_Bool bAutoInt; // set in AddNumber
+ sal_Bool bHasExtraText;
+ OUStringBuffer aFormatCode;
+ OUStringBuffer aConditions;
+ sal_Bool bHasLongDoW;
+ sal_Bool bHasEra;
+ sal_Bool bHasDateTime;
+ sal_Bool bRemoveAfterUse;
+
+ // contained date elements, used to recognize default date formats
+ SvXMLDateElementAttributes eDateDOW;
+ SvXMLDateElementAttributes eDateDay;
+ SvXMLDateElementAttributes eDateMonth;
+ SvXMLDateElementAttributes eDateYear;
+ SvXMLDateElementAttributes eDateHours;
+ SvXMLDateElementAttributes eDateMins;
+ SvXMLDateElementAttributes eDateSecs;
+ sal_Bool bDateNoDefault;
+
+ SAL_DLLPRIVATE sal_Int32 PrivateGetKey();
+
+public:
+ SvXMLNumFormatContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ SvXMLNumImpData* pNewData, sal_uInt16 nNewType,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ SvXMLStylesContext& rStyles );
+ SvXMLNumFormatContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ const sal_Int32 nKey,
+ SvXMLStylesContext& rStyles );
+ virtual ~SvXMLNumFormatContext();
+
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
+ virtual void CreateAndInsert(sal_Bool bOverwrite);
+ virtual void Finish(sal_Bool bOverwrite);
+
+ SvXMLNumImpData* GetData() const { return pData; }
+ sal_Int32 GetKey();
+ sal_Int32 CreateAndInsert( SvNumberFormatter* pFormatter );
+ sal_Int32 CreateAndInsert( com::sun::star::uno::Reference< com::sun::star::util::XNumberFormatsSupplier >& xFormatsSupplier );
+ sal_uInt16 GetType() const { return nType; } // SvXMLStylesTokens
+
+ sal_Bool IsFromSystem() const { return bFromSystem; }
+ sal_Bool HasLongDoW() const { return bHasLongDoW; }
+ void SetHasLongDoW(sal_Bool bSet) { bHasLongDoW = bSet; }
+ sal_Bool HasEra() const { return bHasEra; }
+ void SetHasEra(sal_Bool bSet) { bHasEra = bSet; }
+
+ void UpdateCalendar( const OUString& rNewCalendar );
+
+ const LocaleDataWrapper& GetLocaleData() const;
+
+ void AddToCode( const OUString& rString );
+ void AddToCode( sal_Unicode c );
+ void AddNumber( const SvXMLNumberInfo& rInfo );
+ void AddCurrency( const OUString& rContent, LanguageType nLang );
+
+ void AddNfKeyword( sal_uInt16 nIndex );
+ sal_Bool ReplaceNfKeyword( sal_uInt16 nOld, sal_uInt16 nNew );
+ void AddCondition( const sal_Int32 nIndex );
+ void AddCondition( const OUString& rCondition, const OUString& rApplyName );
+ void AddColor( sal_uInt32 const nColor );
+
+ /// determine whether number format uses the system language
+ sal_Bool IsSystemLanguage();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlnumi.hxx b/include/xmloff/xmlnumi.hxx
new file mode 100644
index 000000000000..ea547379f261
--- /dev/null
+++ b/include/xmloff/xmlnumi.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 _XMLOFF_XMLNUMI_HXX
+#define _XMLOFF_XMLNUMI_HXX
+
+#include <com/sun/star/container/XIndexReplace.hpp>
+
+#include <xmloff/xmlstyle.hxx>
+#include <com/sun/star/style/NumberingType.hpp>
+
+namespace com { namespace sun { namespace star { namespace frame { class XModel; } } } }
+class SvI18NMap;
+class SvxXMLListStyle_Impl;
+
+class SvxXMLListStyleContext : public SvXMLStyleContext
+{
+ const OUString sIsPhysical;
+ const OUString sNumberingRules;
+ const OUString sName;
+ const OUString sIsContinuousNumbering;
+
+ ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XIndexReplace > xNumRules;
+
+ SvxXMLListStyle_Impl *pLevelStyles;
+
+ sal_Int32 nLevels;
+ sal_Bool bConsecutive : 1;
+ sal_Bool bOutline : 1;
+
+protected:
+
+ virtual void SetAttribute( sal_uInt16 nPrefixKey,
+ const OUString& rLocalName,
+ const OUString& rValue );
+
+public:
+
+ TYPEINFO();
+
+ SvxXMLListStyleContext(
+ SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ sal_Bool bOutl=sal_False );
+
+ virtual ~SvxXMLListStyleContext();
+
+ virtual SvXMLImportContext *CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ void FillUnoNumRule(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XIndexReplace > & rNumRule,
+ const SvI18NMap *pI18NMap ) const;
+
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XIndexReplace >& GetNumRules() const
+ { return xNumRules; }
+ sal_Bool IsOutline() const { return bOutline; }
+ sal_Bool IsConsecutive() const { return bConsecutive; }
+ sal_Int32 GetLevels() const { return nLevels; }
+
+ static ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XIndexReplace >
+ CreateNumRule(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::frame::XModel > & rModel );
+
+ static void SetDefaultStyle(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XIndexReplace > & rNumRule,
+ sal_Int16 nLevel,
+ sal_Bool bOrdered );
+
+ virtual void CreateAndInsertLate( sal_Bool bOverwrite );
+
+ void CreateAndInsertAuto() const;
+};
+
+#endif // _XMLOFF_XMLNUMI_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlprcon.hxx b/include/xmloff/xmlprcon.hxx
new file mode 100644
index 000000000000..3ed1af78e736
--- /dev/null
+++ b/include/xmloff/xmlprcon.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 _XMLOFF_XMLPROPERTYSETCONTEXT_HXX
+#define _XMLOFF_XMLPROPERTYSETCONTEXT_HXX
+
+#include <xmloff/xmlictxt.hxx>
+#include <xmloff/xmlimppr.hxx>
+#include <xmloff/xmlprmap.hxx>
+#include <xmloff/uniref.hxx>
+
+
+class SvXMLImportPropertyMapper;
+
+class XMLOFF_DLLPUBLIC SvXMLPropertySetContext : public SvXMLImportContext
+{
+protected:
+ sal_Int32 mnStartIdx;
+ sal_Int32 mnEndIdx;
+ sal_uInt32 mnFamily;
+ ::std::vector< XMLPropertyState > &mrProperties;
+ UniReference < SvXMLImportPropertyMapper > mxMapper;
+
+public:
+
+ SvXMLPropertySetContext(
+ SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ sal_uInt32 nFamily,
+ ::std::vector< XMLPropertyState > &rProps,
+ const UniReference < SvXMLImportPropertyMapper > &rMap,
+ sal_Int32 nStartIdx = -1, sal_Int32 nEndIdx = -1 );
+
+ virtual ~SvXMLPropertySetContext();
+
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ // This method is called from this instance implementation of
+ // CreateChildContext if the element matches an entry in the
+ // SvXMLImportItemMapper with the mid flag MID_FLAG_ELEMENT_ITEM_IMPORT
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ ::std::vector< XMLPropertyState > &rProperties,
+ const XMLPropertyState& rProp );
+
+};
+
+#endif // _XMLOFF_XMLPROPERTYSETCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlprhdl.hxx b/include/xmloff/xmlprhdl.hxx
new file mode 100644
index 000000000000..746e9e39d3e7
--- /dev/null
+++ b/include/xmloff/xmlprhdl.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 _XMLOFF_PROPERTYHANDLERBASE_HXX
+#define _XMLOFF_PROPERTYHANDLERBASE_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+
+namespace com{ namespace sun{ namespace star{ namespace uno{ class Any; } } } }
+
+class SvXMLUnitConverter;
+struct XMLPropertyState;
+
+///////////////////////////////////////////////////////////////////////////
+//
+/** Abstract base-class for different XML-types. Derivations of this class
+ knows how to compare, im/export a special XML-type
+*/
+class XMLOFF_DLLPUBLIC XMLPropertyHandler
+{
+ // ??? const SvXMLUnitConverter& rUnitConverter Do we need this ?
+
+public:
+ // Just needed for virtual destruction
+ virtual ~XMLPropertyHandler();
+
+ /** Compares two Any's in case of the given XML-data-type.
+ By default the Any-equal-operator is called. */
+ virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
+
+ /// Imports the given value in cas of the given XML-data-type
+ virtual sal_Bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const =0;
+ /// Exports the given value in cas of the given XML-data-type
+ virtual sal_Bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const =0;
+};
+
+#endif // _XMLOFF_PROPERTYHANDLERBASE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlprmap.hxx b/include/xmloff/xmlprmap.hxx
new file mode 100644
index 000000000000..0da806ea6768
--- /dev/null
+++ b/include/xmloff/xmlprmap.hxx
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_PROPERTYSETMAPPER_HXX
+#define _XMLOFF_PROPERTYSETMAPPER_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include <vector>
+#include <xmloff/uniref.hxx>
+#include <xmloff/maptype.hxx>
+#include <xmloff/xmltypes.hxx>
+#include <xmloff/prhdlfac.hxx>
+
+#include <tools/debug.hxx>
+
+class SvXMLUnitConverter;
+class XMLPropertyHandler;
+
+///////////////////////////////////////////////////////////////////////////
+//
+/** Helper-class for XML-im/export:
+ - Holds a pointer to a given array of XMLPropertyMapEntry
+ - Provides several methods to access data from this array
+ - Holds a Sequence of XML-names (for properties)
+ - The filter takes all properties of the XPropertySet which are also
+ in the XMLPropertyMapEntry and which are have not a default value
+ and put them into a vector of XMLPropertyStae
+ - this class knows how to compare, im/export properties
+
+ Attention: At all methods, which get an index as parameter, there is no
+ range validation to save runtime !!
+*/
+struct XMLPropertySetMapperEntry_Impl
+{
+ OUString sXMLAttributeName;
+ OUString sAPIPropertyName;
+ sal_uInt16 nXMLNameSpace;
+ sal_Int32 nType;
+ sal_Int16 nContextId;
+ SvtSaveOptions::ODFDefaultVersion nEarliestODFVersionForExport;
+ const XMLPropertyHandler *pHdl;
+
+ XMLPropertySetMapperEntry_Impl(
+ const XMLPropertyMapEntry& rMapEntry,
+ const UniReference< XMLPropertyHandlerFactory >& rFactory );
+
+ XMLPropertySetMapperEntry_Impl(
+ const XMLPropertySetMapperEntry_Impl& rEntry );
+
+ sal_uInt32 GetPropType() const { return nType & XML_TYPE_PROP_MASK; }
+};
+
+class XMLOFF_DLLPUBLIC XMLPropertySetMapper : public UniRefBase
+{
+ ::std::vector< XMLPropertySetMapperEntry_Impl > aMapEntries;
+ ::std::vector< UniReference < XMLPropertyHandlerFactory > > aHdlFactories;
+
+public:
+ /** The last element of the XMLPropertyMapEntry-array must contain NULL-values */
+ XMLPropertySetMapper(
+ const XMLPropertyMapEntry* pEntries,
+ const UniReference< XMLPropertyHandlerFactory >& rFactory );
+ virtual ~XMLPropertySetMapper();
+
+ void AddMapperEntry( const UniReference < XMLPropertySetMapper >& rMapper );
+
+ /** Return number of entries in input-array */
+ sal_Int32 GetEntryCount() const { return aMapEntries.size(); }
+
+ /** Returns the flags of an entry */
+ sal_uInt32 GetEntryFlags( sal_Int32 nIndex ) const
+ {
+ DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" );
+ return aMapEntries[nIndex].nType & ~MID_FLAG_MASK;
+ }
+
+ /** Returns the type of an entry */
+ sal_uInt32 GetEntryType( sal_Int32 nIndex,
+ sal_Bool bWithFlags = sal_True ) const
+ {
+ DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" );
+ sal_uInt32 nType = aMapEntries[nIndex].nType;
+ if( !bWithFlags )
+ nType = nType & MID_FLAG_MASK;
+ return nType;
+ }
+
+ /** Returns the namespace-key of an entry */
+ sal_uInt16 GetEntryNameSpace( sal_Int32 nIndex ) const
+ {
+ DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" );
+ return aMapEntries[nIndex].nXMLNameSpace;
+ }
+
+ /** Returns the 'local' XML-name of the entry */
+ const OUString& GetEntryXMLName( sal_Int32 nIndex ) const
+ {
+ DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" );
+ return aMapEntries[nIndex].sXMLAttributeName;
+ }
+
+ /** Returns the entry API name */
+ const OUString& GetEntryAPIName( sal_Int32 nIndex ) const
+ {
+ DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" );
+ return aMapEntries[nIndex].sAPIPropertyName;
+ }
+
+ /** returns the entry context id. -1 is a valid index here. */
+ sal_Int16 GetEntryContextId( sal_Int32 nIndex ) const
+ {
+ DBG_ASSERT( (nIndex >= -1) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" );
+ return nIndex == -1 ? 0 : aMapEntries[nIndex].nContextId;
+ }
+
+ /** returns the earliest odf version for which this property should be exported. */
+ SvtSaveOptions::ODFDefaultVersion GetEarliestODFVersionForExport( sal_Int32 nIndex ) const
+ {
+ DBG_ASSERT( (nIndex >= -1) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" );
+ return nIndex == -1 ? SvtSaveOptions::ODFVER_UNKNOWN : aMapEntries[nIndex].nEarliestODFVersionForExport;
+ }
+
+ /** Returns the index of an entry with the given XML-name and namespace
+ If there is no matching entry the method returns -1 */
+ sal_Int32 GetEntryIndex( sal_uInt16 nNamespace,
+ const OUString& rStrName,
+ sal_uInt32 nPropType,
+ sal_Int32 nStartAt = -1 ) const;
+
+ /** Retrieves a PropertyHandler for that property wich placed at nIndex in the XMLPropertyMapEntry-array */
+ const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nIndex ) const
+ {
+ DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" );
+ return aMapEntries[nIndex].pHdl;
+ }
+
+ /** import/export
+ This methods calls the respective im/export-method of the respective PropertyHandler. */
+ virtual sal_Bool exportXML( OUString& rStrExpValue,
+ const XMLPropertyState& rProperty,
+ const SvXMLUnitConverter& rUnitConverter ) const;
+ virtual sal_Bool importXML( const OUString& rStrImpValue,
+ XMLPropertyState& rProperty,
+ const SvXMLUnitConverter& rUnitConverter ) const;
+
+ /** searches for an entry that matches the given api name, namespace and local name or -1 if nothing found */
+ sal_Int32 FindEntryIndex( const sal_Char* sApiName,
+ sal_uInt16 nNameSpace,
+ const OUString& sXMLName ) const;
+
+ /** searches for an entry that matches the given ContextId or gives -1 if nothing found */
+ sal_Int32 FindEntryIndex( const sal_Int16 nContextId ) const;
+
+ /** Remove an entry */
+ void RemoveEntry( sal_Int32 nIndex );
+};
+
+#endif // _XMLOFF_PROPERTYSETMAPPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlreg.hxx b/include/xmloff/xmlreg.hxx
new file mode 100644
index 000000000000..1095e4861a88
--- /dev/null
+++ b/include/xmloff/xmlreg.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 _XMLOFF_XMLREG_HXX
+#define _XMLOFF_XMLREG_HXX
+
+#include <rtl/ref.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
+/**
+ * Register subset of UNO services from XML Office library. This is necessary when
+ * linking against the static "xol.lib".
+ *
+ * @return returns sal_False if at least one component could not be registered.
+ */
+sal_Bool XMLRegisterServices( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > ); /// [all] ServiceProvider to register in.
+
+#endif // _XMLOFF_XMLREG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlscripti.hxx b/include/xmloff/xmlscripti.hxx
new file mode 100644
index 000000000000..031e33511a91
--- /dev/null
+++ b/include/xmloff/xmlscripti.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 _XMLOFF_XMLSCRIPTI_HXX
+#define _XMLOFF_XMLSCRIPTI_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <xmloff/xmlictxt.hxx>
+
+namespace com { namespace sun { namespace star { namespace frame {
+ class XModel;
+}}}}
+
+class XMLOFF_DLLPUBLIC XMLScriptContext : public SvXMLImportContext
+{
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel;
+
+public:
+ XMLScriptContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel>& rDocModel );
+ virtual ~XMLScriptContext();
+
+ // Create child element.
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
+
+ virtual void EndElement();
+};
+
+#endif // _XMLOFF_XMLSCRIPTI_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlstyle.hxx b/include/xmloff/xmlstyle.hxx
new file mode 100644
index 000000000000..86641f067982
--- /dev/null
+++ b/include/xmloff/xmlstyle.hxx
@@ -0,0 +1,265 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_XMLSTYLE_HXX
+#define _XMLOFF_XMLSTYLE_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+#include <rsc/rscsfx.hxx>
+#include <tools/rtti.hxx>
+#include <xmloff/uniref.hxx>
+#include <xmloff/xmltkmap.hxx>
+#include <xmloff/xmlictxt.hxx>
+
+class SvXMLStylesContext_Impl;
+class SvXMLUnitConverter;
+class SvXMLImportPropertyMapper;
+
+namespace com { namespace sun { namespace star {
+namespace container { class XNameContainer; }
+namespace style { class XAutoStyleFamily; }
+} } }
+
+enum XMLStyleStylesElemTokens
+{
+ XML_TOK_STYLE_STYLE,
+ XML_TOK_STYLE_PAGE_MASTER,
+ XML_TOK_TEXT_LIST_STYLE,
+ XML_TOK_TEXT_OUTLINE,
+ XML_TOK_STYLES_GRADIENTSTYLES,
+ XML_TOK_STYLES_HATCHSTYLES,
+ XML_TOK_STYLES_BITMAPSTYLES,
+ XML_TOK_STYLES_TRANSGRADIENTSTYLES,
+ XML_TOK_STYLES_MARKERSTYLES,
+ XML_TOK_STYLES_DASHSTYLES,
+ XML_TOK_TEXT_NOTE_CONFIG,
+ XML_TOK_TEXT_BIBLIOGRAPHY_CONFIG,
+ XML_TOK_TEXT_LINENUMBERING_CONFIG,
+ XML_TOK_STYLE_DEFAULT_STYLE,
+ XML_TOK_STYLE_DEFAULT_PAGE_LAYOUT, //text grid enhancement
+ XML_TOK_STYLE_STYLES_ELEM_END=XML_TOK_UNKNOWN
+};
+
+class XMLOFF_DLLPUBLIC SvXMLStyleContext : public SvXMLImportContext
+{
+ OUString maName;
+ OUString maDisplayName;
+ OUString maAutoName;
+ OUString maParentName;// Will be moved to XMLPropStyle soon!!!!
+ OUString maFollow; // Will be moved to XMLPropStyle soon!!!!
+ sal_Bool mbHidden;
+
+ OUString maHelpFile; // Will be removed very soon!!!!
+
+ sal_uInt32 mnHelpId; // Will be removed very soon!!!!
+ sal_uInt16 mnFamily;
+
+ sal_Bool mbValid : 1; // Set this to false in CreateAndInsert
+ // if the style shouldn't be processed
+ // by Finish() or si somehow invalid.
+ sal_Bool mbNew : 1; // Set this to false in CreateAnsInsert
+ // if the style is already existing.
+ sal_Bool mbDefaultStyle : 1;
+
+protected:
+
+ virtual void SetAttribute( sal_uInt16 nPrefixKey,
+ const OUString& rLocalName,
+ const OUString& rValue );
+
+ void SetFamily( sal_uInt16 nSet ) { mnFamily = nSet; }
+ void SetAutoName( const OUString& rName ) { maAutoName = rName; }
+
+public:
+
+ TYPEINFO();
+
+ SvXMLStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
+ sal_uInt16 nFamily=0, sal_Bool bDefaultStyle = sal_False );
+
+ virtual ~SvXMLStyleContext();
+
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ virtual void StartElement(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ const OUString& GetName() const { return maName; }
+ const OUString& GetDisplayName() const { return maDisplayName.getLength() ? maDisplayName : maName; }
+ const OUString& GetAutoName() const { return maAutoName; }
+ const OUString& GetParentName() const { return maParentName; }
+ const OUString& GetFollow() const { return maFollow; }
+
+ const OUString& GetHelpFile() const { return maHelpFile; }
+ sal_uInt32 GetHelpId() const { return mnHelpId; }
+
+ sal_uInt16 GetFamily() const { return mnFamily; }
+
+ sal_Bool IsValid() const { return mbValid; }
+ void SetValid( sal_Bool b ) { mbValid = b; }
+
+ sal_Bool IsNew() const { return mbNew; }
+ void SetNew( sal_Bool b ) { mbNew = b; }
+
+ sal_Bool IsHidden() const { return mbHidden; }
+
+ // This method is called for every default style
+ virtual void SetDefaults();
+
+ // This method is called for every style. It must create it and insert
+ // it into the document.
+ virtual void CreateAndInsert( sal_Bool bOverwrite );
+
+ // This method is called for every style. It must create it and insert
+ // it into the document if this hasn't happened already in CreateAndInsert().
+ virtual void CreateAndInsertLate( sal_Bool bOverwrite );
+
+ // This method is called fpr every style after all styles have been
+ // inserted into the document.
+ virtual void Finish( sal_Bool bOverwrite );
+
+ sal_Bool IsDefaultStyle() const { return mbDefaultStyle; }
+
+ /** if this method returns true, its parent styles context
+ should not add it to its container.<br>
+ Transient styles can't be accessed from its
+ parent SvXMLStylesContext after theyre imported and
+ the methods CreateAndInsert(), CreateAndInsertLate()
+ and Finish() will not be called.
+ The default return value is false
+ */
+ virtual sal_Bool IsTransient() const;
+};
+
+class XMLOFF_DLLPUBLIC SvXMLStylesContext : public SvXMLImportContext
+{
+ const OUString msParaStyleServiceName;
+ const OUString msTextStyleServiceName;
+
+ SvXMLStylesContext_Impl *mpImpl;
+ SvXMLTokenMap *mpStyleStylesElemTokenMap;
+
+
+ ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XNameContainer > mxParaStyles;
+
+ ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XNameContainer > mxTextStyles;
+
+ ::com::sun::star::uno::Reference <
+ ::com::sun::star::style::XAutoStyleFamily > mxParaAutoStyles;
+
+ ::com::sun::star::uno::Reference <
+ ::com::sun::star::style::XAutoStyleFamily > mxTextAutoStyles;
+
+ UniReference < SvXMLImportPropertyMapper > mxParaImpPropMapper;
+ UniReference < SvXMLImportPropertyMapper > mxTextImpPropMapper;
+ UniReference < SvXMLImportPropertyMapper > mxShapeImpPropMapper;
+ mutable UniReference < SvXMLImportPropertyMapper > mxChartImpPropMapper;
+ mutable UniReference < SvXMLImportPropertyMapper > mxPageImpPropMapper;
+
+ SAL_DLLPRIVATE const SvXMLTokenMap& GetStyleStylesElemTokenMap();
+
+ SAL_DLLPRIVATE SvXMLStylesContext(SvXMLStylesContext &); // not defined
+ SAL_DLLPRIVATE void operator =(SvXMLStylesContext &); // not defined
+
+protected:
+
+ sal_uInt32 GetStyleCount() const;
+ SvXMLStyleContext *GetStyle( sal_uInt32 i );
+ const SvXMLStyleContext *GetStyle( sal_uInt32 i ) const;
+
+ virtual SvXMLStyleContext *CreateStyleChildContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ virtual SvXMLStyleContext *CreateStyleStyleChildContext( sal_uInt16 nFamily,
+ sal_uInt16 nPrefix, const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext(
+ sal_uInt16 nFamily, sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ virtual sal_Bool InsertStyleFamily( sal_uInt16 nFamily ) const;
+
+public:
+ TYPEINFO();
+
+ SvXMLStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
+ sal_Bool bAutomatic = sal_False );
+
+ virtual ~SvXMLStylesContext();
+
+ // Create child element.
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ // This method must be overloaded to insert styles into the document.
+ virtual void EndElement();
+
+ // This allows to add an SvXMLStyleContext to this context from extern
+ void AddStyle(SvXMLStyleContext& rNew);
+
+ const SvXMLStyleContext *FindStyleChildContext(
+ sal_uInt16 nFamily,
+ const OUString& rName,
+ sal_Bool bCreateIndex=sal_False ) const;
+ virtual sal_uInt16 GetFamily( const OUString& rFamily ) const;
+ virtual UniReference < SvXMLImportPropertyMapper > GetImportPropertyMapper(
+ sal_uInt16 nFamily ) const;
+
+ virtual ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XNameContainer >
+ GetStylesContainer( sal_uInt16 nFamily ) const;
+ virtual OUString GetServiceName( sal_uInt16 nFamily ) const;
+
+ virtual ::com::sun::star::uno::Reference < ::com::sun::star::style::XAutoStyleFamily >
+ GetAutoStyles( sal_uInt16 nFamily ) const;
+ void CopyAutoStylesToDoc();
+ void CopyStylesToDoc( sal_Bool bOverwrite, sal_Bool bFinish=sal_True );
+ void FinishStyles( sal_Bool bOverwrite );
+
+ // This method must be called to release the references to all styles
+ // that are stored in the context.
+ void Clear();
+ sal_Bool IsAutomaticStyle() const;
+};
+
+#endif // _XMLOFF_XMLSTYLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmltabe.hxx b/include/xmloff/xmltabe.hxx
new file mode 100644
index 000000000000..114624d1a15a
--- /dev/null
+++ b/include/xmloff/xmltabe.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 _XMLOFF_XMLTABE_HXX
+#define _XMLOFF_XMLTABE_HXX
+
+// prevent funny things like "#define sun 1" from the compiler
+#include <sal/config.h>
+
+class SvXMLExport;
+namespace com { namespace sun { namespace star {
+ namespace style { struct TabStop; }
+ namespace uno { class Any; }
+} } }
+
+
+class SvxXMLTabStopExport
+{
+ SvXMLExport& rExport; // for access to document handler
+
+protected:
+
+ void exportTabStop( const ::com::sun::star::style::TabStop* pTabStop );
+
+public:
+
+ SvxXMLTabStopExport( SvXMLExport& rExport );
+ virtual ~SvxXMLTabStopExport();
+
+ // core API
+ void Export( const ::com::sun::star::uno::Any& rAny );
+};
+
+
+#endif // _XMLOFF_XMLTABE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmltkmap.hxx b/include/xmloff/xmltkmap.hxx
new file mode 100644
index 000000000000..9df059f6da9a
--- /dev/null
+++ b/include/xmloff/xmltkmap.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 _XMLOFF_XMLTKMAP_HXX
+#define _XMLOFF_XMLTKMAP_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <sal/types.h>
+#include <xmloff/xmltoken.hxx>
+
+
+class SvXMLTokenMap_Impl;
+class SvXMLTokenMapEntry_Impl;
+
+#define XML_TOK_UNKNOWN 0xffffU
+#define XML_TOKEN_MAP_END { 0xffffU, ::xmloff::token::XML_TOKEN_INVALID, 0U }
+
+struct SvXMLTokenMapEntry
+{
+ sal_uInt16 nPrefixKey;
+ enum ::xmloff::token::XMLTokenEnum eLocalName;
+ sal_uInt16 nToken;
+};
+
+class XMLOFF_DLLPUBLIC SvXMLTokenMap
+{
+ SvXMLTokenMap_Impl *pImpl;
+
+ SAL_DLLPRIVATE SvXMLTokenMapEntry_Impl *_Find(
+ sal_uInt16 nKind, const OUString& rName ) const;
+
+public:
+
+ SvXMLTokenMap( const SvXMLTokenMapEntry* pMap );
+ ~SvXMLTokenMap();
+
+ sal_uInt16 Get( sal_uInt16 nPrefix, const OUString& rLName ) const;
+};
+
+#endif // _XMLOFF_XMLTKMAP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
new file mode 100644
index 000000000000..a40da2c19b5c
--- /dev/null
+++ b/include/xmloff/xmltoken.hxx
@@ -0,0 +1,3212 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#define _XMLOFF_XMLTOKEN_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+
+/**
+ * Handling of tokens in XML:
+ *
+ * This header defines te enum ::xmloff::token::XMLTokenEnum containing one
+ * value for every fixed string used in our XML files.
+ *
+ * Usage:
+ * To obtain an OUString for a token, use the GetXMLToken() function.
+ * To test equality of an OUString and a token, use IsXMLToken().
+ * Additionally, XMLTokenEnum values may be passed to SvXMLExport::AddAttribute
+ * methods and the SvXMLElementExport constructor.
+ */
+
+namespace xmloff { namespace token {
+
+
+ /**
+ * The enumeration of all XML tokens.
+ */
+ enum XMLTokenEnum
+ {
+ XML_TOKEN_START = 0,
+ XML_TOKEN_INVALID = XML_TOKEN_START,
+
+ // common xml
+ XML_CDATA,
+ XML_WS,
+ XML_XML,
+ XML_XMLNS,
+ XML_XML_PI,
+ XML_XML_DOCTYPE_PREFIX,
+ XML_XML_DOCTYPE_SUFFIX,
+
+ // namespace prefixes and names
+ XML_N_XML,
+ XML_NP_OFFICE,
+ XML_N_OFFICE,
+ XML_N_OFFICE_OLD,
+ XML_NP_META,
+ XML_N_META,
+ XML_N_META_OLD,
+ XML_NP_STYLE,
+ XML_N_STYLE,
+ XML_N_STYLE_OLD,
+ XML_NP_NUMBER,
+ XML_N_NUMBER,
+ XML_N_NUMBER_OLD,
+ XML_NP_TEXT,
+ XML_N_TEXT,
+ XML_N_TEXT_OLD,
+ XML_NP_TABLE,
+ XML_N_TABLE,
+ XML_N_TABLE_OLD,
+ XML_NP_DRAW,
+ XML_N_DRAW,
+ XML_NP_DR3D,
+ XML_N_DR3D,
+ XML_N_DRAW_OLD,
+ XML_NP_PRESENTATION,
+ XML_N_PRESENTATION,
+ XML_N_PRESENTATION_OLD,
+ XML_NP_CHART,
+ XML_N_CHART,
+ XML_NP_CONFIG,
+ XML_N_CONFIG,
+ XML_N_CHART_OLD,
+ XML_NP_FO,
+ XML_N_FO_OLD,
+ XML_N_FO,
+ XML_NP_XLINK,
+ XML_N_XLINK,
+ XML_N_XLINK_OLD,
+ XML_NP_DC,
+ XML_N_DC,
+ XML_NP_SVG,
+ XML_N_SVG,
+ XML_NP_FORM,
+ XML_N_FORM,
+ XML_NP_SCRIPT,
+ XML_N_SCRIPT,
+ XML_NP_XFORMS_1_0,
+ XML_N_XFORMS_1_0,
+ XML_NP_XSD,
+ XML_N_XSD,
+ XML_NP_XSI,
+ XML_N_XSI,
+
+ XML_NP_BLOCK_LIST,
+ XML_N_BLOCK_LIST,
+
+ XML_NP_MATH,
+ XML_N_MATH,
+
+ XML_NP_VERSIONS_LIST,
+ XML_N_VERSIONS_LIST,
+
+ // erAck: 2008-04-09T20:02+0200 OpenFormula aka ODFF
+ XML_NP_OF,
+ XML_N_OF,
+
+ // ODF 1.2 metadata: RDFa and GRDDL
+ XML_NP_XHTML,
+ XML_N_XHTML,
+ XML_NP_GRDDL,
+ XML_N_GRDDL,
+
+ // ODF Enhanced namespaces
+ XML_NP_OFFICE_EXT,
+ XML_N_OFFICE_EXT,
+
+ // jonp: 2008-09-24 Excel Interop
+ XML_NP_FORMX,
+ XML_N_FORMX,
+
+ XML_NP_TABLE_EXT,
+ XML_N_TABLE_EXT,
+
+ XML_NP_DRAW_EXT,
+ XML_N_DRAW_EXT,
+
+ // css text level 3
+ XML_NP_CSS3TEXT,
+ XML_N_CSS3TEXT,
+
+ // calc extensions
+ XML_NP_CALC_EXT,
+ XML_N_CALC_EXT,
+
+ // units
+ XML_UNIT_MM,
+ XML_UNIT_M,
+ XML_UNIT_KM,
+ XML_UNIT_CM,
+ XML_UNIT_PT,
+ XML_UNIT_PC,
+ XML_UNIT_FOOT,
+ XML_UNIT_MILES,
+ XML_UNIT_INCH,
+
+ // any other
+ XML_1,
+ XML_10,
+ XML_2,
+ XML_3,
+ XML_4,
+ XML_5,
+ XML_6,
+ XML_7,
+ XML_8,
+ XML_9,
+ XML_A_UPCASE,
+ XML_I_UPCASE,
+ XML_IBM437,
+ XML_IBM850,
+ XML_IBM860,
+ XML_IBM861,
+ XML_IBM863,
+ XML_IBM865,
+ XML_ISO_8859_1,
+ XML_OLE2,
+ XML__COLON,
+ XML__EMPTY,
+ XML__UNKNOWN_,
+
+ XML_A,
+ XML_ABBREVIATED_NAME,
+ XML_ABOVE,
+ XML_ABS,
+ XML_ACCENT,
+ XML_ACCENTUNDER,
+ XML_ACCEPTANCE_STATE,
+ XML_ACCEPTED,
+ XML_ACTION,
+ XML_ACTIVE,
+ XML_ACTIVE_SPLIT_RANGE,
+ XML_ACTIVE_TABLE,
+ XML_ACTUATE,
+ XML_ADD_IN,
+ XML_ADD_IN_NAME,
+ XML_ADDRESS,
+ XML_ADJUSTMENT,
+ XML_ALGORITHM,
+ XML_ALIGN,
+ XML_ALL,
+ XML_ALLOW_EMPTY_CELL,
+ XML_ALPHABETICAL_INDEX,
+ XML_ALPHABETICAL_INDEX_AUTO_MARK_FILE,
+ XML_ALPHABETICAL_INDEX_ENTRY_TEMPLATE,
+ XML_ALPHABETICAL_INDEX_MARK,
+ XML_ALPHABETICAL_INDEX_MARK_END,
+ XML_ALPHABETICAL_INDEX_MARK_START,
+ XML_ALPHABETICAL_INDEX_SOURCE,
+ XML_ALPHABETICAL_SEPARATORS,
+ XML_ALTERNATE,
+ XML_AM_PM,
+ XML_AMBIENT_COLOR,
+ XML_ANCHOR_PAGE_NUMBER,
+ XML_ANCHOR_TYPE,
+ XML_AND,
+ XML_ANIMATION,
+ XML_ANIMATION_DELAY,
+ XML_ANIMATION_DIRECTION,
+ XML_ANIMATION_REPEAT,
+ XML_ANIMATION_START_INSIDE,
+ XML_ANIMATION_STEPS,
+ XML_ANIMATION_STOP_INSIDE,
+ XML_ANIMATIONS,
+ XML_ANNOTATION,
+ XML_ANNOTATION_END,
+ XML_ANNOTATIONS,
+ XML_ANNOTE,
+ XML_APPEAR,
+ XML_APPLET,
+ XML_APPLET_NAME,
+ XML_APPLICATION_DATA,
+ XML_APPLICATION_XML,
+ XML_APPLY,
+ XML_APPLY_STYLE_NAME,
+ XML_AQUA,
+ XML_ARC,
+ XML_ARCCOS,
+ XML_ARCHIVE,
+ XML_ARCSIN,
+ XML_ARCTAN,
+ XML_AREA,
+ XML_AREA_CIRCLE,
+ XML_AREA_POLYGON,
+ XML_AREA_RECTANGLE,
+ XML_ARTICLE,
+ XML_AS_CHAR,
+ XML_ASCENDING,
+ XML_ATTACHED_AXIS,
+ XML_ATTRACTIVE,
+ XML_AUTHOR,
+ XML_AUTHOR_INITIALS,
+ XML_AUTHOR_NAME,
+ XML_AUTO,
+ XML_AUTO_GROW_HEIGHT,
+ XML_AUTO_GROW_WIDTH,
+ XML_AUTO_RELOAD,
+ XML_AUTO_TEXT,
+ XML_AUTO_TEXT_EVENTS,
+ XML_AUTO_TEXT_GROUP,
+ XML_AUTO_TEXT_INDENT,
+ XML_AUTO_UPDATE,
+ XML_AUTOMATIC,
+ XML_AUTOMATIC_FIND_LABELS,
+ XML_AUTOMATIC_ORDER,
+ XML_AUTOMATIC_STYLES,
+ XML_AUTOMATIC_UPDATE,
+ XML_AUTOSIZE,
+ XML_AVERAGE,
+ XML_AXIS,
+ XML_AXIS_COLOR,
+ XML_BACK_SCALE,
+ XML_BACKFACE_CULLING,
+ XML_BACKGROUND,
+ XML_BACKGROUND_COLOR,
+ XML_BACKGROUND_IMAGE,
+ XML_BACKGROUND_NO_REPEAT,
+ XML_BACKGROUND_REPEAT,
+ XML_BACKGROUND_STRETCH,
+ XML_BAR,
+ XML_BASE64BINARY,
+ XML_BASE_CELL_ADDRESS,
+ XML_BASELINE,
+ XML_BEFORE_DATE_TIME,
+ XML_BELOW,
+ XML_BETWEEN_DATE_TIMES,
+ XML_BEVEL,
+ XML_BIBILIOGRAPHIC_TYPE,
+ XML_BIBLIOGRAPHY,
+ XML_BIBLIOGRAPHY_CONFIGURATION,
+ XML_BIBLIOGRAPHY_DATA_FIELD,
+ XML_BIBLIOGRAPHY_ENTRY_TEMPLATE,
+ XML_BIBLIOGRAPHY_MARK,
+ XML_BIBLIOGRAPHY_SOURCE,
+ XML_BIBLIOGRAPHY_TYPE,
+ XML_BIND_STYLES_TO_CONTENT,
+ XML_BITMAP,
+ XML_BLACK,
+ XML_BLEND,
+ XML_BLINKING,
+ XML_BLOCK,
+ XML_BLOCK_LIST,
+ XML_BLUE,
+ XML_BODY,
+ XML_BOLD,
+ XML_BOOK,
+ XML_BOOKLET,
+ XML_BOOKMARK,
+ XML_BOOKMARK_END,
+ XML_BOOKMARK_REF,
+ XML_BOOKMARK_START,
+ XML_BOOKTITLE,
+ XML_BOOLEAN,
+ XML_BOOLEAN_STYLE,
+ XML_BOOLEAN_VALUE,
+ XML_BORDER,
+ XML_BORDER_BOTTOM,
+ XML_BORDER_COLOR,
+ XML_BORDER_LEFT,
+ XML_BORDER_LINE_WIDTH,
+ XML_BORDER_LINE_WIDTH_BOTTOM,
+ XML_BORDER_LINE_WIDTH_LEFT,
+ XML_BORDER_LINE_WIDTH_RIGHT,
+ XML_BORDER_LINE_WIDTH_TOP,
+ XML_BORDER_RIGHT,
+ XML_BORDER_TOP,
+ XML_BOTH,
+ XML_BOTTOM,
+ XML_BOTTOM_LEFT,
+ XML_BOTTOM_PERCENT,
+ XML_BOTTOM_RIGHT,
+ XML_BOTTOM_VALUES,
+ XML_BOTTOMARC,
+ XML_BOTTOMCIRCLE,
+ XML_BREAK_AFTER,
+ XML_BREAK_BEFORE,
+ XML_BREAK_INSIDE,
+ XML_BUBBLE,
+ XML_BULLET_CHAR,
+ XML_BULLET_RELATIVE_SIZE,
+ XML_BUTT,
+ XML_BUTTON1,
+ XML_BUTTON2,
+ XML_BUTTON3,
+ XML_BUTTON4,
+ XML_BUTTONS,
+ XML_BVAR,
+ XML_C,
+ XML_CALCULATION_SETTINGS,
+ XML_CALENDAR,
+ XML_CAPITALIZE_ENTRIES,
+ XML_CAPTION,
+ XML_CAPTION_POINT_X,
+ XML_CAPTION_POINT_Y,
+ XML_CAPTION_SEQUENCE_FORMAT,
+ XML_CAPTION_SEQUENCE_NAME,
+ XML_CASE_SENSITIVE,
+ XML_CASEMAP_CAPITALIZE,
+ XML_CASEMAP_LOWERCASE,
+ XML_CASEMAP_NORMAL,
+ XML_CASEMAP_SMALL_CAPS,
+ XML_CASEMAP_UPPERCASE,
+ XML_CATEGORIES,
+ XML_CATEGORY,
+ XML_CATEGORY_AND_VALUE,
+ XML_CELL_ADDRESS,
+ XML_CELL_CONTENT_CHANGE,
+ XML_CELL_CONTENT_DELETION,
+ XML_CELL_COUNT,
+ XML_CELL_PROTECT,
+ XML_CELL_RANGE_ADDRESS,
+ XML_CELL_RANGE_ADDRESS_LIST,
+ XML_CELL_RANGE_SOURCE,
+ XML_CENTER,
+ XML_CHAIN_NEXT_NAME,
+ XML_CHANGE,
+ XML_CHANGE_DELETION,
+ XML_CHANGE_END,
+ XML_CHANGE_ID,
+ XML_CHANGE_INFO,
+ XML_CHANGE_START,
+ XML_CHANGE_TRACK_TABLE_CELL,
+ XML_CHANGE_VIEW_CONDITIONS,
+ XML_CHANGE_VIEW_SETTINGS,
+ XML_CHANGED_REGION,
+ XML_CHAPTER,
+ XML_CHAR,
+ XML_CHARACTER_COUNT,
+ XML_CHART,
+ XML_CHARTS,
+ XML_CHECKERBOARD,
+ XML_CHG_AUTHOR,
+ XML_CHG_COMMENT,
+ XML_CHG_DATE_TIME,
+ XML_CI,
+ XML_CIRCLE,
+ XML_CITATION_BODY_STYLE_NAME,
+ XML_CITATION_STYLE_NAME,
+ XML_CLASS,
+ XML_CLASS_ID,
+ XML_CLIP,
+ XML_CLOCKWISE,
+ XML_CLOSE,
+ XML_CLOSE_HORIZONTAL,
+ XML_CLOSE_VERTICAL,
+ XML_CM,
+ XML_CN,
+ XML_CODE,
+ XML_CODEBASE,
+ XML_COLLAPSE,
+ XML_COLOR,
+ XML_COLOR_INVERSION,
+ XML_COLOR_MODE,
+ XML_COLOR_SCALE,
+ XML_COLOR_SCALE_ENTRY,
+ XML_COLUMN,
+ XML_COLUMN_COUNT,
+ XML_COLUMN_GAP,
+ XML_COLUMN_NAME,
+ XML_COLUMN_SEP,
+ XML_COLUMN_WIDTH,
+ XML_COLUMNS,
+ XML_COLUMNSPLIT_AUTO,
+ XML_COLUMNSPLIT_AVOID,
+ XML_COMBINE_ENTRIES,
+ XML_COMBINE_ENTRIES_WITH_DASH,
+ XML_COMBINE_ENTRIES_WITH_PP,
+ XML_COMMA_SEPARATED,
+ XML_COMMAND,
+ XML_COMMENT,
+ XML_COMPOSE,
+ XML_COND_STYLE_NAME,
+ XML_CONDITION,
+ XML_CONDITION_SOURCE,
+ XML_CONDITION_SOURCE_RANGE_ADDRESS,
+ XML_CONDITIONAL_TEXT,
+ XML_CONDITIONAL_FORMAT,
+ XML_CONDITIONAL_FORMATS,
+ XML_CONE,
+ XML_CONFERENCE,
+ XML_CONFIG_ITEM,
+ XML_CONFIG_ITEM_MAP_ENTRY,
+ XML_CONFIG_ITEM_MAP_INDEXED,
+ XML_CONFIG_ITEM_MAP_NAMED,
+ XML_CONFIG_ITEM_SET,
+ XML_CONFIGURATION_SETTINGS,
+ XML_CONJUGATE,
+ XML_CONNECT_BARS,
+ XML_CONNECTION_NAME,
+ XML_CONNECTOR,
+ XML_CONSECUTIVE_NUMBERING,
+ XML_CONSOLIDATION,
+ XML_CONSTANT,
+ XML_CONTAINS_ERROR,
+ XML_CONTAINS_HEADER,
+ XML_CONTENT,
+ XML_CONTENT_VALIDATION,
+ XML_CONTENT_VALIDATION_NAME,
+ XML_CONTENT_VALIDATIONS,
+ XML_CONTEXTUAL_SPACING,
+ XML_CONTINUE,
+ XML_CONTINUE_NUMBERING,
+ XML_CONTOUR_PATH,
+ XML_CONTOUR_POLYGON,
+ XML_CONTRAST,
+ XML_CONTROL,
+ XML_CONVERSION_MODE,
+ XML_COPY_BACK,
+ XML_COPY_FORMULAS,
+ XML_COPY_OUTLINE_LEVELS,
+ XML_COPY_RESULTS_ONLY,
+ XML_COPY_STYLES,
+ XML_CORNER_RADIUS,
+ XML_CORRECT,
+ XML_COS,
+ XML_COSH,
+ XML_COT,
+ XML_COTH,
+ XML_COUNT,
+ XML_COUNT_EMPTY_LINES,
+ XML_COUNT_IN_FLOATING_FRAMES,
+ XML_COUNTER_CLOCKWISE,
+ XML_COUNTERCLOCKWISE,
+ XML_COUNTNUMS,
+ XML_COUNTRY,
+ XML_COUNTRY_ASIAN,
+ XML_COUNTRY_COMPLEX,
+ XML_COVERED_TABLE_CELL,
+ XML_CREATE_DATE,
+ XML_CREATE_DATE_STRING,
+ XML_CREATION_DATE,
+ XML_CREATION_TIME,
+ XML_CREATOR,
+ XML_CSC,
+ XML_CSCH,
+ XML_CUBE,
+ XML_CUBOID,
+ XML_CURRENCY,
+ XML_CURRENCY_STYLE,
+ XML_CURRENCY_SYMBOL,
+ XML_CURRENT,
+ XML_CURRENT_VALUE,
+ XML_CURSOR_POSITION,
+ XML_CURSOR_POSITION_X,
+ XML_CURSOR_POSITION_Y,
+ XML_CURVE,
+ XML_CUSTOM1,
+ XML_CUSTOM2,
+ XML_CUSTOM3,
+ XML_CUSTOM4,
+ XML_CUSTOM5,
+ XML_CUT,
+ XML_CUT_OFFS,
+ XML_CX,
+ XML_CY,
+ XML_CYLINDER,
+ XML_D,
+ XML_DASH,
+ XML_DASHED,
+ XML_DATA,
+ XML_DATA_BAR,
+ XML_DATA_BAR_ENTRY,
+ XML_DATA_CELL_RANGE_ADDRESS,
+ XML_DATA_LABEL_NUMBER,
+ XML_DATA_LABEL_SYMBOL,
+ XML_DATA_LABEL_TEXT,
+ XML_DATA_PILOT_FIELD,
+ XML_DATA_PILOT_GRAND_TOTAL,
+ XML_DATA_PILOT_LEVEL,
+ XML_DATA_PILOT_MEMBER,
+ XML_DATA_PILOT_MEMBERS,
+ XML_DATA_PILOT_SUBTOTAL,
+ XML_DATA_PILOT_SUBTOTALS,
+ XML_DATA_PILOT_TABLE,
+ XML_DATA_PILOT_TABLES,
+ XML_DATA_POINT,
+ XML_DATA_STYLE,
+ XML_DATA_STYLE_NAME,
+ XML_DATA_TYPE,
+ XML_DATABASE_DISPLAY,
+ XML_DATABASE_NAME,
+ XML_DATABASE_NEXT,
+ XML_DATABASE_RANGE,
+ XML_DATABASE_RANGES,
+ XML_DATABASE_ROW_NUMBER,
+ XML_DATABASE_SELECT,
+ XML_DATABASE_SOURCE_QUERY,
+ XML_DATABASE_SOURCE_SQL,
+ XML_DATABASE_SOURCE_TABLE,
+ XML_DATE,
+ XML_DATE_IS,
+ XML_DATE_ADJUST,
+ XML_DATE_STYLE,
+ XML_DATE_TIME,
+ XML_DATE_VALUE,
+ XML_DATETIME,
+ XML_DAY,
+ XML_DAY_OF_WEEK,
+ XML_DDE_APPLICATION,
+ XML_DDE_CONNECTION,
+ XML_DDE_CONNECTION_DECL,
+ XML_DDE_CONNECTION_DECLS,
+ XML_DDE_ITEM,
+ XML_DDE_LINK,
+ XML_DDE_LINKS,
+ XML_DDE_SOURCE,
+ XML_DDE_TOPIC,
+ XML_DECIMAL_PLACES,
+ XML_DECIMAL_REPLACEMENT,
+ XML_DECLARE,
+ XML_DECORATE_WORDS_ONLY,
+ XML_DECORATIVE,
+ XML_DEEP,
+ XML_DEFAULT,
+ XML_DEFAULT_CELL_STYLE_NAME,
+ XML_DEFAULT_STYLE,
+ XML_DEFAULT_STYLE_NAME,
+ XML_DEGREE,
+ XML_DELAY,
+ XML_DELETION,
+ XML_DELETIONS,
+ XML_DENOMINATOR_VALUE,
+ XML_DEPENDENCE,
+ XML_DEPENDENCES,
+ XML_DEPENDENCIES,
+ XML_DEPTH,
+ XML_DESC,
+ XML_DESCENDING,
+ XML_DESCRIPTION,
+ XML_DETECTIVE,
+ XML_DETERMINANT,
+ XML_DIFF,
+ XML_DIFFUSE_COLOR,
+ XML_DIM,
+ XML_DIRECTION,
+ XML_DISABLED,
+ XML_DISC,
+ XML_DISPLAY,
+ XML_DISPLAY_BORDER,
+ XML_DISPLAY_DETAILS,
+ XML_DISPLAY_DUPLICATES,
+ XML_DISPLAY_EMPTY,
+ XML_DISPLAY_FILTER_BUTTONS,
+ XML_DISPLAY_FORMULA,
+ XML_DISPLAY_LABEL,
+ XML_DISPLAY_LEVELS,
+ XML_DISPLAY_NAME,
+ XML_DISPLAY_OUTLINE_LEVEL,
+ XML_DISSOLVE,
+ XML_DISTANCE,
+ XML_DISTANCE_AFTER_SEP,
+ XML_DISTANCE_BEFORE_SEP,
+ XML_DISTRIBUTE,
+ XML_DISTRIBUTE_LETTER,
+ XML_DISTRIBUTE_SPACE,
+ XML_DIVIDE,
+ XML_DOCUMENT,
+ XML_DOCUMENT_CONTENT,
+ XML_DOCUMENT_META,
+ XML_DOCUMENT_SETTINGS,
+ XML_DOCUMENT_STATISTIC,
+ XML_DOCUMENT_STYLES,
+ XML_DOMAIN,
+ XML_DOT,
+ XML_DOTS1,
+ XML_DOTS1_LENGTH,
+ XML_DOTS2,
+ XML_DOTS2_LENGTH,
+ XML_DOTTED,
+ XML_DOUBLE,
+ XML_DOUBLE_SIDED,
+ XML_DOWN,
+ XML_DRAFT,
+ XML_DRAW,
+ XML_DRAW_ASPECT,
+ XML_DRAWING,
+ XML_DRAWINGS,
+ XML_DRAWPOOL,
+ XML_DROP_CAP,
+ XML_DYNAMIC,
+ XML_EDGE_ROUNDING,
+ XML_EDITABLE,
+ XML_EDITING_CYCLES,
+ XML_EDITING_DURATION,
+ XML_EDITION,
+ XML_EDITOR,
+ XML_EFFECT,
+ XML_ELLIPSE,
+ XML_EMAIL,
+ XML_EMBED,
+ XML_EMBEDDED_VISIBLE_AREA,
+ XML_EMBOSSED,
+ XML_EMISSIVE_COLOR,
+ XML_EMPTY,
+ XML_ENABLE_NUMBERING,
+ XML_ENABLED,
+ XML_ENCODING,
+ XML_END,
+ XML_END_ANGLE,
+ XML_END_CELL_ADDRESS,
+ XML_END_COLOR,
+ XML_END_COLUMN,
+ XML_END_GLUE_POINT,
+ XML_END_GUIDE,
+ XML_END_INTENSITY,
+ XML_END_LINE_SPACING_HORIZONTAL,
+ XML_END_LINE_SPACING_VERTICAL,
+ XML_END_POSITION,
+ XML_END_ROW,
+ XML_END_SHAPE,
+ XML_END_TABLE,
+ XML_END_X,
+ XML_END_Y,
+ XML_ENDLESS,
+ XML_ENDNOTE,
+ XML_ENDNOTE_BODY,
+ XML_ENDNOTE_CITATION,
+ XML_ENDNOTE_REF,
+ XML_ENDNOTES_CONFIGURATION,
+ XML_ENGRAVED,
+ XML_EQ,
+ XML_EQUAL_AUTHOR,
+ XML_EQUAL_COMMENT,
+ XML_EQUAL_DATE,
+ XML_ERA,
+ XML_ERGO_SUM,
+ XML_ERROR_CATEGORY,
+ XML_ERROR_LOWER_INDICATOR,
+ XML_ERROR_LOWER_LIMIT,
+ XML_ERROR_MACRO,
+ XML_ERROR_MARGIN,
+ XML_ERROR_MESSAGE,
+ XML_ERROR_PERCENTAGE,
+ XML_ERROR_UPPER_INDICATOR,
+ XML_ERROR_UPPER_LIMIT,
+ XML_ESCAPEMENT_SUB,
+ XML_ESCAPEMENT_SUPER,
+ XML_EVEN_PAGE,
+ XML_EVENT,
+ XML_EVENT_NAME,
+ XML_EVENTS,
+ XML_EXECUTE,
+ XML_EXECUTE_MACRO,
+ XML_EXISTS,
+ XML_EXP,
+ XML_EXPONENTIAL,
+ XML_EXPRESSION,
+ XML_EXTRA,
+ XML_EXTRUDE,
+ XML_FACTORIAL,
+ XML_FADE,
+ XML_FADE_FROM_BOTTOM,
+ XML_FADE_FROM_CENTER,
+ XML_FADE_FROM_LEFT,
+ XML_FADE_FROM_LOWERLEFT,
+ XML_FADE_FROM_LOWERRIGHT,
+ XML_FADE_FROM_RIGHT,
+ XML_FADE_FROM_TOP,
+ XML_FADE_FROM_UPPERLEFT,
+ XML_FADE_FROM_UPPERRIGHT,
+ XML_FADE_OUT,
+ XML_FADE_TO_CENTER,
+ XML_FALSE,
+ XML_FAMILY,
+ XML_FAST,
+ XML_FIELD_NUMBER,
+ XML_FILE_NAME,
+ XML_FILL,
+ XML_FILL_CHARACTER,
+ XML_FILL_COLOR,
+ XML_FILL_GRADIENT_NAME,
+ XML_FILL_HATCH_NAME,
+ XML_FILL_HATCH_SOLID,
+ XML_FILL_IMAGE,
+ XML_FILL_IMAGE_HEIGHT,
+ XML_FILL_IMAGE_NAME,
+ XML_FILL_IMAGE_REF_POINT,
+ XML_FILL_IMAGE_REF_POINT_X,
+ XML_FILL_IMAGE_REF_POINT_Y,
+ XML_FILL_IMAGE_WIDTH,
+ XML_FILTER,
+ XML_FILTER_AND,
+ XML_FILTER_CONDITION,
+ XML_FILTER_NAME,
+ XML_FILTER_OPTIONS,
+ XML_FILTER_OR,
+ XML_FILTER_SET_ITEM,
+ XML_FIRST_DATE_TIME,
+ XML_FIRST_PAGE,
+ XML_FIRST_PAGE_NUMBER,
+ XML_FIT_TO_CONTOUR,
+ XML_FIT_TO_SIZE,
+ XML_FIX,
+ XML_FIXED,
+ XML_FLAT,
+ XML_FLOAT,
+ XML_FLOATING_FRAME,
+ XML_FLOOR,
+ XML_FN,
+ XML_FOCAL_LENGTH,
+ XML_FONT_CHAR_WIDTH,
+ XML_FONT_CHARSET,
+ XML_FONT_CHARSET_ASIAN,
+ XML_FONT_CHARSET_COMPLEX,
+ XML_FONT_COLOR,
+ XML_FONT_DECL,
+ XML_FONT_DECLS,
+ XML_FONT_FAMILY,
+ XML_FONT_FAMILY_ASIAN,
+ XML_FONT_FAMILY_COMPLEX,
+ XML_FONT_FAMILY_GENERIC,
+ XML_FONT_FAMILY_GENERIC_ASIAN,
+ XML_FONT_FAMILY_GENERIC_COMPLEX,
+ XML_FONT_KERNING,
+ XML_FONT_NAME,
+ XML_FONT_NAME_ASIAN,
+ XML_FONT_NAME_COMPLEX,
+ XML_FONT_PITCH,
+ XML_FONT_PITCH_ASIAN,
+ XML_FONT_PITCH_COMPLEX,
+ XML_FONT_RELIEF,
+ XML_FONT_SIZE,
+ XML_FONT_SIZE_ASIAN,
+ XML_FONT_SIZE_COMPLEX,
+ XML_FONT_SIZE_REL,
+ XML_FONT_SIZE_REL_ASIAN,
+ XML_FONT_SIZE_REL_COMPLEX,
+ XML_FONT_STYLE,
+ XML_FONT_STYLE_ASIAN,
+ XML_FONT_STYLE_COMPLEX,
+ XML_FONT_STYLE_NAME,
+ XML_FONT_STYLE_NAME_ASIAN,
+ XML_FONT_STYLE_NAME_COMPLEX,
+ XML_FONT_VARIANT,
+ XML_FONT_WEIGHT,
+ XML_FONT_WEIGHT_ASIAN,
+ XML_FONT_WEIGHT_COMPLEX,
+ XML_FONT_WIDTH,
+ XML_FONT_WORD_LINE_MODE,
+ XML_FONTFAMILY,
+ XML_FONTSIZE,
+ XML_FONTSTYLE,
+ XML_FONTWEIGHT,
+ XML_FONTWORK_ADJUST,
+ XML_FONTWORK_DISTANCE,
+ XML_FONTWORK_FORM,
+ XML_FONTWORK_HIDE_FORM,
+ XML_FONTWORK_MIRROR,
+ XML_FONTWORK_OUTLINE,
+ XML_FONTWORK_SHADOW,
+ XML_FONTWORK_SHADOW_COLOR,
+ XML_FONTWORK_SHADOW_OFFSET_X,
+ XML_FONTWORK_SHADOW_OFFSET_Y,
+ XML_FONTWORK_SHADOW_TRANSPARENCE,
+ XML_FONTWORK_START,
+ XML_FONTWORK_STYLE,
+ XML_FOOTER,
+ XML_FOOTER_FIRST,
+ XML_FOOTER_LEFT,
+ XML_FOOTER_STYLE,
+ XML_FOOTNOTE,
+ XML_FOOTNOTE_BODY,
+ XML_FOOTNOTE_CITATION,
+ XML_FOOTNOTE_CONTINUATION_NOTICE_BACKWARD,
+ XML_FOOTNOTE_CONTINUATION_NOTICE_FORWARD,
+ XML_FOOTNOTE_MAX_HEIGHT,
+ XML_FOOTNOTE_REF,
+ XML_FOOTNOTE_SEP,
+ XML_FOOTNOTES_CONFIGURATION,
+ XML_FOOTNOTES_POSITION,
+ XML_FORALL,
+ XML_FORCE_MANUAL,
+ XML_FOREGROUND,
+ XML_FOREIGN_OBJECT,
+ XML_FORMAT_CHANGE,
+ XML_FORMAT_SOURCE,
+ XML_FORMATTING_ENTRY,
+ XML_FORMS,
+ XML_FORMULA,
+ XML_FORMULA_HIDDEN,
+ XML_FORMULAS,
+ XML_FRACTION,
+ XML_FRAME,
+ XML_FRAME_CONTENT,
+ XML_FRAME_DISPLAY_BORDER,
+ XML_FRAME_DISPLAY_SCROLLBAR,
+ XML_FRAME_END_MARGIN,
+ XML_FRAME_MARGIN_HORIZONTAL,
+ XML_FRAME_MARGIN_VERTICAL,
+ XML_FRAME_NAME,
+ XML_FRAME_START_MARGIN,
+ XML_FREEZE,
+ XML_FREEZE_POSITION,
+ XML_FROM_ANOTHER_TABLE,
+ XML_FROM_BOTTOM,
+ XML_FROM_CENTER,
+ XML_FROM_INSIDE,
+ XML_FROM_LEFT,
+ XML_FROM_LOWER_LEFT,
+ XML_FROM_LOWER_RIGHT,
+ XML_FROM_RIGHT,
+ XML_FROM_SAME_TABLE,
+ XML_FROM_TOP,
+ XML_FROM_UPPER_LEFT,
+ XML_FROM_UPPER_RIGHT,
+ XML_FUCHSIA,
+ XML_FULL,
+ XML_FULL_SCREEN,
+ XML_FUNCTION,
+ XML_FX,
+ XML_FY,
+ XML_G,
+ XML_GAMMA,
+ XML_GAP,
+ XML_GAP_WIDTH,
+ XML_GCD,
+ XML_GENERATOR,
+ XML_GEQ,
+ XML_GOURAUD,
+ XML_GRADIENT,
+ XML_GRADIENT_ANGLE,
+ XML_GRADIENT_BORDER,
+ XML_GRADIENT_STEP_COUNT,
+ XML_GRADIENT_STYLE,
+ XML_GRADIENTSTYLE_AXIAL,
+ XML_GRADIENTSTYLE_ELLIPSOID,
+ XML_GRADIENTSTYLE_LINEAR,
+ XML_GRADIENTSTYLE_RADIAL,
+ XML_GRADIENTSTYLE_RECTANGULAR,
+ XML_GRADIENTSTYLE_SQUARE,
+ XML_GRADIENTTRANSFORM,
+ XML_GRAND_TOTAL,
+ XML_GRAPHIC,
+ XML_GRAY,
+ XML_GREEN,
+ XML_GREYSCALE,
+ XML_GRID,
+ XML_GROOVE,
+ XML_GROUP_BY_FIELD_NUMBER,
+ XML_GROUP_NAME,
+ XML_GROUPING,
+ XML_GT,
+ XML_GUIDE_DISTANCE,
+ XML_GUIDE_OVERHANG,
+ XML_H,
+ XML_HANGING,
+ XML_HAS_PERSISTENT_DATA,
+ XML_HATCH,
+ XML_HATCH_DISTANCE,
+ XML_HATCH_STYLE,
+ XML_HATCHSTYLE_DOUBLE,
+ XML_HATCHSTYLE_SINGLE,
+ XML_HATCHSTYLE_TRIPLE,
+ XML_HEADER,
+ XML_HEADER_FIRST,
+ XML_HEADER_LEFT,
+ XML_HEADER_STYLE,
+ XML_HEADERS,
+ XML_HEIGHT,
+ XML_HELP,
+ XML_HELP_FILE_NAME,
+ XML_HELP_ID,
+ XML_HELP_MESSAGE,
+ XML_HIDDEN,
+ XML_HIDDEN_AND_PROTECTED,
+ XML_HIDDEN_PARAGRAPH,
+ XML_HIDDEN_TEXT,
+ XML_HIDE,
+ XML_HIDE_SHAPE,
+ XML_HIDE_TEXT,
+ XML_HIGHLIGHTED_RANGE,
+ XML_HINT,
+ XML_HORIZONTAL,
+ XML_HORIZONTAL_LINES,
+ // XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
+ // are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD.
+ // Usage is deprecated, but the old token are needed for the
+ // OpenOffice.org file format import/export filter for the renaming (#i49139#)
+ XML_HORIZONTAL_ON_LEFT_PAGES,
+ XML_HORIZONTAL_ON_RIGHT_PAGES,
+ XML_HORIZONTAL_POS,
+ XML_HORIZONTAL_REL,
+ XML_HORIZONTAL_SCROLLBAR_WIDTH,
+ XML_HORIZONTAL_SEGMENTS,
+ XML_HORIZONTAL_SPLIT_MODE,
+ XML_HORIZONTAL_SPLIT_POSITION,
+ XML_HORIZONTAL_STRIPES,
+ XML_HOURS,
+ XML_HOWPUBLISHED,
+ XML_HREF,
+ XML_HTML,
+ XML_HYPERLINK,
+ XML_HYPERLINK_BEHAVIOUR,
+ XML_HYPHENATE,
+ XML_HYPHENATION_KEEP,
+ XML_HYPHENATION_LADDER_COUNT,
+ XML_HYPHENATION_PUSH_CHAR_COUNT,
+ XML_HYPHENATION_REMAIN_CHAR_COUNT,
+ XML_I,
+ XML_ICON,
+ XML_ICON_SET,
+ XML_ICON_SET_TYPE,
+ XML_ID,
+ XML_IDENT,
+ XML_IDENTIFIER,
+ XML_IDENTIFY_CATEGORIES,
+ XML_IDEOGRAPH_ALPHA,
+ XML_IGNORE_CASE,
+ XML_IGNORE_EMPTY_ROWS,
+ XML_ILLUSTRATION_INDEX,
+ XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE,
+ XML_ILLUSTRATION_INDEX_SOURCE,
+ XML_IMAGE,
+ XML_IMAGE_COUNT,
+ XML_IMAGE_MAP,
+ XML_IMPLIES,
+ XML_IN,
+ XML_IN_RANGE,
+ XML_INBOOK,
+ XML_INCOLLECTION,
+ XML_INCREMENT,
+ XML_INDEX,
+ XML_INDEX_BODY,
+ XML_INDEX_ENTRY_BIBLIOGRAPHY,
+ XML_INDEX_ENTRY_CHAPTER,
+ XML_INDEX_ENTRY_CHAPTER_NUMBER,
+ XML_INDEX_ENTRY_LINK_END,
+ XML_INDEX_ENTRY_LINK_START,
+ XML_INDEX_ENTRY_PAGE_NUMBER,
+ XML_INDEX_ENTRY_SPAN,
+ XML_INDEX_ENTRY_TAB_STOP,
+ XML_INDEX_ENTRY_TEMPLATE,
+ XML_INDEX_ENTRY_TEXT,
+ XML_INDEX_NAME,
+ XML_INDEX_SCOPE,
+ XML_INDEX_SOURCE_STYLE,
+ XML_INDEX_SOURCE_STYLES,
+ XML_INDEX_TITLE,
+ XML_INDEX_TITLE_TEMPLATE,
+ XML_INFORMATION,
+ XML_INITIAL_CREATOR,
+ XML_INPROCEEDINGS,
+ XML_INSERTION,
+ XML_INSERTION_CUT_OFF,
+ XML_INSET,
+ XML_INSIDE,
+ XML_INSTITUTION,
+ XML_INT,
+ XML_INTENSITY,
+ XML_INTERSECT,
+ XML_INTERVAL,
+ XML_INTERVAL_MAJOR,
+ XML_INTERVAL_MINOR,
+ XML_INTO_ENGLISH_NUMBER,
+ XML_INVERSE,
+ XML_IS_ACTIVE,
+ XML_IS_DATA_LAYOUT_FIELD,
+ XML_IS_HIDDEN,
+ XML_IS_SELECTION,
+ XML_ISBN,
+ XML_ITALIC,
+ XML_ITERATION,
+ XML_JOURNAL,
+ XML_JUSTIFIED,
+ XML_JUSTIFY,
+ XML_JUSTIFY_SINGLE_WORD,
+ XML_KEEP_WITH_NEXT,
+ XML_KERNING_NORMAL,
+ XML_KEY,
+ XML_KEY1,
+ XML_KEY2,
+ XML_KEYWORD,
+ XML_KEYWORDS,
+ XML_KIND,
+ XML_KM,
+ XML_LABEL,
+ XML_LABEL_ARRANGEMENT,
+ XML_LABEL_CELL_ADDRESS,
+ XML_LABEL_CELL_RANGE_ADDRESS,
+ XML_LABEL_RANGE,
+ XML_LABEL_RANGES,
+ XML_LAMBDA,
+ XML_LANDSCAPE,
+ XML_LANGUAGE,
+ XML_LANGUAGE_ASIAN,
+ XML_LANGUAGE_COMPLEX,
+ XML_LASER,
+ XML_LAST_COLUMN_SPANNED,
+ XML_LAST_PAGE,
+ XML_LAST_ROW_SPANNED,
+ XML_LAYER,
+ XML_LAYER_SET,
+ XML_LEADER_CHAR,
+ XML_LEFT,
+ XML_LEFT_OUTSIDE,
+ XML_LEFT_TOP_POSITION,
+ XML_LEFTARC,
+ XML_LEFTCIRCLE,
+ XML_LEGEND,
+ XML_LEGEND_POSITION,
+ XML_LENGTH,
+ XML_LEQ,
+ XML_LET_TEXT,
+ XML_KEEP_TEXT,
+ XML_LETTER_KERNING,
+ XML_LETTER_SPACING,
+ XML_LETTERS,
+ XML_LEVEL,
+ XML_LIBRARY,
+ XML_LIBRARY_EMBEDDED,
+ XML_LIBRARY_LINKED,
+ XML_LIGHT,
+ XML_LIGHTING_MODE,
+ XML_LIME,
+ XML_LIMIT,
+ XML_LINE,
+ XML_LINE_BREAK,
+ XML_LINE_DISTANCE,
+ XML_LINE_HEIGHT,
+ XML_LINE_HEIGHT_AT_LEAST,
+ XML_LINE_NUMBER,
+ XML_LINE_SKEW,
+ XML_LINE_SPACING,
+ XML_LINE_STYLE,
+ XML_LINEAR,
+ XML_LINENUMBERING_CONFIGURATION,
+ XML_LINENUMBERING_SEPARATOR,
+ XML_LINES,
+ XML_LINES_USED,
+ XML_LINK_TO_SOURCE_DATA,
+ XML_LIST,
+ XML_LIST_BLOCK,
+ XML_LIST_HEADER,
+ XML_LIST_INFO,
+ XML_LIST_ITEM,
+ XML_LIST_LEVEL,
+ XML_LIST_LEVEL_STYLE_BULLET,
+ XML_LIST_LEVEL_STYLE_IMAGE,
+ XML_LIST_LEVEL_STYLE_NUMBER,
+ XML_LIST_NAME,
+ XML_LIST_STYLE,
+ XML_LIST_STYLE_NAME,
+ XML_LN,
+ XML_LOCKED,
+ XML_LOG,
+ XML_LOGARITHMIC,
+ XML_LOGBASE,
+ XML_LONG,
+ XML_LOWLIMIT,
+ XML_LR_TB,
+ XML_LT,
+ XML_LTR,
+ XML_LUMINANCE,
+ XML_MACRO_NAME,
+ XML_MACTION,
+ XML_MAIN_ENTRY_STYLE_NAME,
+ XML_MAJOR,
+ XML_MALIGNGROUP,
+ XML_MALIGNMARK,
+ XML_MANUAL,
+ XML_MAP,
+ XML_MARGIN_BOTTOM,
+ XML_MARGIN_LEFT,
+ XML_MARGIN_RIGHT,
+ XML_MARGIN_TOP,
+ XML_MARGINS,
+ XML_MARKER,
+ XML_MARKER_END,
+ XML_MARKER_END_CENTER,
+ XML_MARKER_END_WIDTH,
+ XML_MARKER_START,
+ XML_MARKER_START_CENTER,
+ XML_MARKER_START_WIDTH,
+ XML_MAROON,
+ XML_MASTER_PAGE,
+ XML_MASTER_PAGE_NAME,
+ XML_MASTER_STYLES,
+ XML_MASTERSTHESIS,
+ XML_MATCH,
+ XML_MATH,
+ XML_MATRIX,
+ XML_MATRIX_COVERED,
+ XML_MATRIXROW,
+ XML_MAX,
+ XML_MAX_EDGE,
+ XML_MAX_HEIGHT,
+ XML_MAX_WIDTH,
+ XML_MAXIMUM,
+ XML_MAXIMUM_DIFFERENCE,
+ XML_MAY_BREAK_BETWEEN_ROWS,
+ XML_MAY_SCRIPT,
+ XML_MEAN,
+ XML_MEAN_VALUE,
+ XML_MEASURE,
+ XML_MEASURE_ALIGN,
+ XML_MEASURE_VERTICAL_ALIGN,
+ XML_MEDIAN,
+ XML_MEDIUM,
+ XML_MERROR,
+ XML_MESSAGE_TYPE,
+ XML_META,
+ XML_MFENCED,
+ XML_MFRAC,
+ XML_MI,
+ XML_MIDDLE,
+ XML_MIME_TYPE,
+ XML_MIN,
+ XML_MIN_DENOMINATOR_DIGITS,
+ XML_MIN_EDGE,
+ XML_MIN_EXPONENT_DIGITS,
+ XML_MIN_HEIGHT,
+ XML_MIN_INTEGER_DIGITS,
+ XML_MIN_LABEL_DISTANCE,
+ XML_MIN_LABEL_WIDTH,
+ XML_MIN_LINE_HEIGHT,
+ XML_MIN_NUMERATOR_DIGITS,
+ XML_MIN_ROW_HEIGHT,
+ XML_MIN_WIDTH,
+ XML_MINIMUM,
+ XML_MINOR,
+ XML_MINUS,
+ XML_MINUTES,
+ XML_MIRROR,
+ XML_MIRRORED,
+ XML_MISC,
+ XML_MITER,
+ XML_MM,
+ XML_MMULTISCRIPTS,
+ XML_MN,
+ XML_MO,
+ XML_MODE,
+ XML_MODERN,
+ XML_MODIFICATION_DATE,
+ XML_MODIFICATION_TIME,
+ XML_MODULATE,
+ XML_MODULE,
+ XML_MOMENT,
+ XML_MONO,
+ XML_MONTH,
+ XML_MOUSE_AS_PEN,
+ XML_MOUSE_VISIBLE,
+ XML_MOVE,
+ XML_MOVE_FROM_BOTTOM,
+ XML_MOVE_FROM_LEFT,
+ XML_MOVE_FROM_RIGHT,
+ XML_MOVE_FROM_TOP,
+ XML_MOVE_PROTECT,
+ XML_MOVE_SHORT,
+ XML_MOVEMENT,
+ XML_MOVEMENT_CUT_OFF,
+ XML_MOVER,
+ XML_MPADDED,
+ XML_MPHANTOM,
+ XML_MPRESCRIPTS,
+ XML_MROOT,
+ XML_MROW,
+ XML_MS,
+ XML_MSPACE,
+ XML_MSQRT,
+ XML_MSTYLE,
+ XML_MSUB,
+ XML_MSUBSUP,
+ XML_MSUP,
+ XML_MTABLE,
+ XML_MTD,
+ XML_MTEXT,
+ XML_MTR,
+ XML_MULTI_DELETION_SPANNED,
+ XML_MUNDER,
+ XML_MUNDEROVER,
+ XML_NAME,
+ XML_NAME_AND_EXTENSION,
+ XML_NAMED_EXPRESSION,
+ XML_NAMED_EXPRESSIONS,
+ XML_NAMED_RANGE,
+ XML_NAVY,
+ XML_NEGATIVE_COLOR,
+ XML_NEQ,
+ XML_NEW,
+ XML_NEXT,
+ XML_NEXT_PAGE,
+ XML_NEXT_STYLE_NAME,
+ XML_NO_LIMIT,
+ XML_NO_WRAP,
+ XML_NOEMPTY,
+ XML_NOHREF,
+ XML_NOMATCH,
+ XML_NONE,
+ XML_NOPRTSUBSET,
+ XML_NORMAL,
+ XML_NORMALS_DIRECTION,
+ XML_NORMALS_KIND,
+ XML_NOT,
+ XML_NOT_EQUAL_DATE,
+ XML_NOTE,
+ XML_NOTES,
+ XML_NOTIN,
+ XML_NOTSUBSET,
+ XML_NULL_DATE,
+ XML_NULL_YEAR,
+ XML_NUM_FORMAT,
+ XML_NUM_LETTER_SYNC,
+ XML_NUM_PREFIX,
+ XML_NUM_SUFFIX,
+ XML_NUMBER,
+ XML_NUMBER_AND_NAME,
+ XML_NUMBER_COLUMNS_REPEATED,
+ XML_NUMBER_COLUMNS_SPANNED,
+ XML_NUMBER_LINES,
+ XML_NUMBER_MATRIX_COLUMNS_SPANNED,
+ XML_NUMBER_MATRIX_ROWS_SPANNED,
+ XML_NUMBER_POSITION,
+ XML_NUMBER_ROWS_REPEATED,
+ XML_NUMBER_ROWS_SPANNED,
+ XML_NUMBER_STYLE,
+ XML_NUMBER_WRAPPED_PARAGRAPHS,
+ XML_NUMBERED_ENTRIES,
+ XML_OBJECT,
+ XML_OBJECT_COUNT,
+ XML_OBJECT_INDEX,
+ XML_OBJECT_INDEX_ENTRY_TEMPLATE,
+ XML_OBJECT_INDEX_SOURCE,
+ XML_OBJECT_NAME,
+ XML_OBJECT_OLE,
+ XML_OBJECTS,
+ XML_ODD_PAGE,
+ XML_OFFSET,
+ XML_OLIVE,
+ XML_ONLOAD,
+ XML_ONREQUEST,
+ XML_ON_UPDATE_KEEP_SIZE,
+ XML_ON_UPDATE_KEEP_STYLES,
+ XML_ONLINE,
+ XML_ONLINE_TEXT,
+ XML_OPAQUE_BACKGROUND,
+ XML_OPAQUE_FOREGROUND,
+ XML_OPEN,
+ XML_OPEN_HORIZONTAL,
+ XML_OPEN_VERTICAL,
+ XML_OPERATION,
+ XML_OPERATOR,
+ XML_OPTIMAL,
+ XML_OR,
+ XML_ORDER,
+ XML_ORDERED_LIST,
+ XML_ORGANIZATIONS,
+ XML_ORIENTATION,
+ XML_ORIENTATION_LANDSCAPE,
+ XML_ORIENTATION_PORTRAIT,
+ XML_ORIGIN,
+ XML_ORPHANS,
+ XML_OUTLINE_LEVEL,
+ XML_OUTLINE_LEVEL_STYLE,
+ XML_OUTLINE_STYLE,
+ XML_OUTSET,
+ XML_OUTSIDE,
+ XML_OVERLAP,
+ XML_P,
+ XML_PACKAGE_NAME,
+ XML_PADDING,
+ XML_PADDING_BOTTOM,
+ XML_PADDING_LEFT,
+ XML_PADDING_RIGHT,
+ XML_PADDING_TOP,
+ XML_PAGE,
+ XML_PAGE_ADJUST,
+ XML_PAGE_BREAKS_ON_GROUP_CHANGE,
+ XML_PAGE_CONTENT,
+ XML_PAGE_CONTINUATION_STRING,
+ XML_PAGE_COUNT,
+ XML_PAGE_END_MARGIN,
+ XML_PAGE_HEIGHT,
+ XML_PAGE_MASTER,
+ XML_PAGE_MASTER_NAME,
+ XML_PAGE_NUMBER,
+ XML_PAGE_START_MARGIN,
+ XML_PAGE_STYLE_NAME,
+ XML_PAGE_THUMBNAIL,
+ XML_PAGE_USAGE,
+ XML_PAGE_VARIABLE_GET,
+ XML_PAGE_VARIABLE_SET,
+ XML_PAGE_VIEW_ZOOM_VALUE,
+ XML_PAGE_WIDTH,
+ XML_PAGES,
+ XML_PAPER_TRAY_NUMBER,
+ XML_PARAGRAPH,
+ XML_PARAGRAPH_CONTENT,
+ XML_PARAGRAPH_COUNT,
+ XML_PARAGRAPH_END_MARGIN,
+ XML_PARAGRAPH_START_MARGIN,
+ XML_PARALLEL,
+ XML_PARAM,
+ XML_PARENT_STYLE_NAME,
+ XML_PARSE_SQL_STATEMENT,
+ XML_PARSED,
+ XML_PARTIALDIFF,
+ XML_PASSWORD,
+ XML_PASSWORT,
+ XML_PATH,
+ XML_PATH_ID,
+ XML_PAUSE,
+ XML_PENDING,
+ XML_PERCENTAGE,
+ XML_PERCENTAGE_STYLE,
+ XML_PERSPECTIVE,
+ XML_PHDTHESIS,
+ XML_PHONG,
+ XML_PIE_OFFSET,
+ XML_PLACEHOLDER,
+ XML_PLACEHOLDER_TYPE,
+ XML_PLACING,
+ XML_PLAIN_NUMBER,
+ XML_PLAIN_NUMBER_AND_NAME,
+ XML_PLAY_FULL,
+ XML_PLOT_AREA,
+ XML_PLUGIN,
+ XML_PLUS,
+ XML_POINTS,
+ XML_POLYGON,
+ XML_POLYLINE,
+ XML_POLYNOMIAL,
+ XML_POOL_ID,
+ XML_PORTRAIT,
+ XML_POSITION,
+ XML_POSITION_BOTTOM,
+ XML_POSITION_LEFT,
+ XML_POSITION_RIGHT,
+ XML_POSITION_TOP,
+ XML_POSITIVE_COLOR,
+ XML_POSTURE_ITALIC,
+ XML_POSTURE_NORMAL,
+ XML_POSTURE_OBLIQUE,
+ XML_POWER,
+ XML_PRECISION_AS_SHOWN,
+ XML_PREFIX,
+ XML_PRESENTATION,
+ XML_PRESENTATION_CHART,
+ XML_PRESENTATION_GRAPHIC,
+ XML_PRESENTATION_NOTES,
+ XML_PRESENTATION_OBJECT,
+ XML_PRESENTATION_ORGCHART,
+ XML_PRESENTATION_OUTLINE,
+ XML_PRESENTATION_PAGE,
+ XML_PRESENTATION_PAGE_LAYOUT,
+ XML_PRESENTATION_PAGE_LAYOUT_NAME,
+ XML_PRESENTATION_SUBTITLE,
+ XML_PRESENTATION_TABLE,
+ XML_PRESENTATION_TITLE,
+ XML_PREVIOUS,
+ XML_PREVIOUS_PAGE,
+ XML_PRINT,
+ XML_PRINT_CONTENT,
+ XML_PRINT_DATE,
+ XML_PRINT_ORIENTATION,
+ XML_PRINT_PAGE_ORDER,
+ XML_PRINT_RANGE,
+ XML_PRINT_RANGES,
+ XML_PRINT_TIME,
+ XML_PRINTABLE,
+ XML_PRINTED_BY,
+ XML_PROCEEDINGS,
+ XML_PRODUCT,
+ XML_PROJECTION,
+ XML_PROPERTIES,
+ XML_PROTECT,
+ XML_PROTECT_CONTENT,
+ XML_PROTECT_POSITION,
+ XML_PROTECT_SIZE,
+ XML_PROTECTED,
+ XML_PROTECTION_KEY,
+ XML_PROTECTION_KEY_DIGEST_ALGORITHM,
+ XML_PROTECTION_KEY_DIGEST_ALGORITHM_2,
+ XML_PRSUBSET,
+ XML_PUBLISHER,
+ XML_PUNCTUATION_WRAP,
+ XML_PURPLE,
+ XML_PYRAMID,
+ XML_QUARTER,
+ XML_QUERY_NAME,
+ XML_QUO_VADIS,
+ XML_QUOTIENT,
+ XML_R,
+ XML_RADAR,
+ XML_RANDOM,
+ XML_RANGE_ADDRESS,
+ XML_RANGE_USABLE_AS,
+ XML_RECREATE_ON_EDIT,
+ XML_RECT,
+ XML_RED,
+ XML_REF_NAME,
+ XML_REFERENCE,
+ XML_REFERENCE_END,
+ XML_REFERENCE_FORMAT,
+ XML_REFERENCE_MARK,
+ XML_REFERENCE_MARK_END,
+ XML_REFERENCE_MARK_START,
+ XML_REFERENCE_REF,
+ XML_REFERENCE_START,
+ XML_REFERENCE_TYPE,
+ XML_REFRESH_DELAY,
+ XML_REGION_CENTER,
+ XML_REGION_LEFT,
+ XML_REGION_RIGHT,
+ XML_REGISTER_TRUE,
+ XML_REGISTER_TRUTH_REF_STYLE_NAME,
+ XML_REGRESSION_TYPE,
+ XML_REJECTED,
+ XML_REJECTING_CHANGE_ID,
+ XML_REJECTION,
+ XML_REL_COLUMN_WIDTH,
+ XML_REL_HEIGHT,
+ XML_REL_WIDTH,
+ XML_RELATIVE,
+ XML_RELATIVE_TAB_STOP_POSITION,
+ XML_RELN,
+ XML_REM,
+ XML_REMOVE_DEPENDENTS,
+ XML_REMOVE_PRECEDENTS,
+ XML_REPEAT,
+ XML_REPEAT_COLUMN,
+ XML_REPEAT_ROW,
+ XML_REPEATED,
+ XML_REPLACE,
+ XML_REPORT_TYPE,
+ XML_RESTART_ON_PAGE,
+ XML_REVISION,
+ XML_RIDGE,
+ XML_RIGHT,
+ XML_RIGHT_OUTSIDE,
+ XML_RIGHTARC,
+ XML_RIGHTCIRCLE,
+ XML_RING,
+ XML_ROLE,
+ XML_ROLL_FROM_BOTTOM,
+ XML_ROLL_FROM_LEFT,
+ XML_ROLL_FROM_RIGHT,
+ XML_ROMAN,
+ XML_ROOT,
+ XML_ROTATE,
+ XML_ROTATION,
+ XML_ROTATION_ALIGN,
+ XML_ROTATION_ANGLE,
+ XML_ROUND,
+ XML_ROW,
+ XML_ROW_HEIGHT,
+ XML_ROW_NUMBER,
+ XML_ROWS,
+ XML_RSID,
+ XML_PARRSID,
+ XML_RUBY,
+ XML_RUBY_ALIGN,
+ XML_RUBY_BASE,
+ XML_RUBY_POSITION,
+ XML_RUBY_TEXT,
+ XML_RUN_THROUGH,
+ XML_RX,
+ XML_RY,
+ XML_S,
+ XML_SCALE,
+ XML_SCALE_MIN,
+ XML_SCALE_TEXT,
+ XML_SCALE_TO,
+ XML_SCALE_TO_PAGES,
+ XML_SCATTER,
+ XML_SCENARIO,
+ XML_SCENARIO_RANGES,
+ XML_SCENE,
+ XML_SCHOOL,
+ XML_SCIENTIFIC_NUMBER,
+ XML_SCORE_SPACES,
+ XML_SCRIPT,
+ XML_SCROLL,
+ XML_SDEV,
+ XML_SEARCH_CRITERIA_MUST_APPLY_TO_WHOLE_CELL,
+ XML_SEC,
+ XML_SECH,
+ XML_SECOND_DATE_TIME,
+ XML_SECONDS,
+ XML_SECTION,
+ XML_SECTION_DESC,
+ XML_SECTION_NAME,
+ XML_SECTION_SOURCE,
+ XML_SELECT_PAGE,
+ XML_SELECT_PROTECTED_CELLS,
+ XML_SELECT_UNPROTECTED_CELLS,
+ XML_SELECTOR,
+ XML_SEMANTICS,
+ XML_SEMI_AUTOMATIC,
+ XML_SENDER_CITY,
+ XML_SENDER_COMPANY,
+ XML_SENDER_COUNTRY,
+ XML_SENDER_EMAIL,
+ XML_SENDER_FAX,
+ XML_SENDER_FIRSTNAME,
+ XML_SENDER_INITIALS,
+ XML_SENDER_LASTNAME,
+ XML_SENDER_PHONE_PRIVATE,
+ XML_SENDER_PHONE_WORK,
+ XML_SENDER_POSITION,
+ XML_SENDER_POSTAL_CODE,
+ XML_SENDER_STATE_OR_PROVINCE,
+ XML_SENDER_STREET,
+ XML_SENDER_TITLE,
+ XML_SEP,
+ XML_SEPARATION_CHARACTER,
+ XML_SEPARATOR,
+ XML_SEQUENCE,
+ XML_SEQUENCE_DECL,
+ XML_SEQUENCE_DECLS,
+ XML_SEQUENCE_REF,
+ XML_SERIES,
+ XML_SERIES_SOURCE,
+ XML_SERVER_MAP,
+ XML_SET,
+ XML_SETDIFF,
+ XML_SETTINGS,
+ XML_SHADE_MODE,
+ XML_SHADOW,
+ XML_SHADOW_COLOR,
+ XML_SHADOW_OFFSET_X,
+ XML_SHADOW_OFFSET_Y,
+ XML_SHADOW_SLANT,
+ XML_SHADOW_TRANSPARENCY,
+ XML_SHAPE,
+ XML_SHAPE_ID,
+ XML_SHAPES,
+ XML_SHEET_NAME,
+ XML_SHININESS,
+ XML_SHORT,
+ XML_SHOW,
+ XML_SHOW_ACCEPTED_CHANGES,
+ XML_SHOW_CHANGES,
+ XML_SHOW_CHANGES_BY_AUTHOR,
+ XML_SHOW_CHANGES_BY_AUTHOR_NAME,
+ XML_SHOW_CHANGES_BY_COMMENT,
+ XML_SHOW_CHANGES_BY_COMMENT_TEXT,
+ XML_SHOW_CHANGES_BY_DATETIME,
+ XML_SHOW_CHANGES_BY_DATETIME_FIRST_DATETIME,
+ XML_SHOW_CHANGES_BY_DATETIME_MODE,
+ XML_SHOW_CHANGES_BY_DATETIME_SECOND_DATETIME,
+ XML_SHOW_CHANGES_BY_RANGES,
+ XML_SHOW_CHANGES_BY_RANGES_LIST,
+ XML_SHOW_LOGO,
+ XML_SHOW_REJECTED_CHANGES,
+ XML_SHOW_SHAPE,
+ XML_SHOW_TEXT,
+ XML_SHOW_UNIT,
+ XML_SHOW_VALUE,
+ XML_SHOWS,
+ XML_SIDE_BY_SIDE,
+ XML_SILVER,
+ XML_SIMPLE,
+ XML_SIN,
+ XML_SINCE_DATE_TIME,
+ XML_SINCE_SAVE,
+ XML_SINH,
+ XML_SIZE,
+ XML_SIZE_PROTECT,
+ XML_SLANT,
+ XML_SLANT_X,
+ XML_SLANT_Y,
+ XML_SLIDE,
+ XML_SLOW,
+ XML_SOLID,
+ XML_SOLID_TYPE,
+ XML_SORT,
+ XML_SORT_ASCENDING,
+ XML_SORT_BY,
+ XML_SORT_BY_POSITION,
+ XML_SORT_GROUPS,
+ XML_SORT_KEY,
+ XML_SOUND,
+ XML_SOURCE_CELL_RANGE,
+ XML_SOURCE_CELL_RANGE_ADDRESSES,
+ XML_SOURCE_FIELD_NAME,
+ XML_SOURCE_NAME,
+ XML_SOURCE_RANGE_ADDRESS,
+ XML_SOURCE_SERVICE,
+ XML_SPACE_BEFORE,
+ XML_SPAN,
+ XML_SPECULAR,
+ XML_SPECULAR_COLOR,
+ XML_SPEED,
+ XML_SPHERE,
+ XML_SPIRAL,
+ XML_SPIRAL_IN,
+ XML_SPIRAL_INWARD_LEFT,
+ XML_SPIRAL_INWARD_RIGHT,
+ XML_SPIRAL_OUT,
+ XML_SPIRAL_OUTWARD_LEFT,
+ XML_SPIRAL_OUTWARD_RIGHT,
+ XML_SPIRALIN_LEFT,
+ XML_SPIRALIN_RIGHT,
+ XML_SPIRALOUT_LEFT,
+ XML_SPIRALOUT_RIGHT,
+ XML_SPLINES,
+ XML_SPLIT,
+ XML_SPLIT_COLUMN,
+ XML_SPLIT_POSITION,
+ XML_SPLIT_ROW,
+ XML_SPREADSHEET,
+ XML_SPREADMETHOD,
+ XML_SQL_STATEMENT,
+ XML_STACKED,
+ XML_STAGGER_EVEN,
+ XML_STAGGER_ODD,
+ XML_STANDARD,
+ XML_STANDARD_DEVIATION,
+ XML_STARBASIC,
+ XML_START,
+ XML_START_ANGLE,
+ XML_START_COLOR,
+ XML_START_COLUMN,
+ XML_START_GLUE_POINT,
+ XML_START_GUIDE,
+ XML_START_INTENSITY,
+ XML_START_LINE_SPACING_HORIZONTAL,
+ XML_START_LINE_SPACING_VERTICAL,
+ XML_START_NUMBERING_AT,
+ XML_START_PAGE,
+ XML_START_POSITION,
+ XML_START_ROW,
+ XML_START_SCALE,
+ XML_START_SHAPE,
+ XML_START_TABLE,
+ XML_START_VALUE,
+ XML_START_WITH_NAVIGATOR,
+ XML_STATISTICS,
+ XML_STATUS,
+ XML_STAY_ON_TOP,
+ XML_STDEV,
+ XML_STDEVP,
+ XML_STEPS,
+ XML_STOCK,
+ XML_STOCK_UPDOWN_BARS,
+ XML_STOCK_WITH_VOLUME,
+ XML_STOP,
+ XML_STOPCOLOR,
+ XML_STOPOPACITY,
+ XML_STRETCH,
+ XML_STRETCH_FROM_BOTTOM,
+ XML_STRETCH_FROM_LEFT,
+ XML_STRETCH_FROM_RIGHT,
+ XML_STRETCH_FROM_TOP,
+ XML_STRETCHY,
+ XML_STRICT,
+ XML_STRING,
+ XML_STRING_VALUE,
+ XML_STRING_VALUE_IF_FALSE,
+ XML_STRING_VALUE_IF_TRUE,
+ XML_STRIPES,
+ XML_STROKE,
+ XML_STROKE_COLOR,
+ XML_STROKE_DASH,
+ XML_STROKE_LINECAP,
+ XML_STROKE_LINEJOIN,
+ XML_STROKE_OPACITY,
+ XML_STROKE_WIDTH,
+ XML_STRUCTURE_PROTECTED,
+ XML_STYLE,
+ XML_STYLE_NAME,
+ XML_STYLES,
+ XML_STYLESHEET,
+ XML_SUB_TABLE,
+ XML_SUBJECT,
+ XML_SUBSET,
+ XML_SUBTITLE,
+ XML_SUBTOTAL_FIELD,
+ XML_SUBTOTAL_RULE,
+ XML_SUBTOTAL_RULES,
+ XML_SUB_VIEW_SIZE,
+ XML_SUFFIX,
+ XML_SUM,
+ XML_SVGLINEARGRADIENT,
+ XML_SWISS,
+ XML_SYMBOL,
+ XML_SYMBOL_HEIGHT,
+ XML_SYMBOL_IMAGE_NAME,
+ XML_SYMBOL_WIDTH,
+ XML_SYSTEM,
+ XML_TAB_COLOR,
+ XML_TAB_STOP,
+ XML_TAB_STOP_DISTANCE,
+ XML_TAB_STOPS,
+ XML_TABLE,
+ XML_TABLE_BACKGROUND,
+ XML_TABLE_CELL,
+ XML_TABLE_CENTERING,
+ XML_TABLE_COLUMN,
+ XML_TABLE_COLUMN_GROUP,
+ XML_TABLE_COLUMNS,
+ XML_TABLE_COUNT,
+ XML_TABLE_HEADER,
+ XML_TABLE_HEADER_COLUMNS,
+ XML_TABLE_HEADER_ROWS,
+ XML_TABLE_INDEX,
+ XML_TABLE_INDEX_ENTRY_TEMPLATE,
+ XML_TABLE_INDEX_SOURCE,
+ XML_TABLE_NAME,
+ XML_TABLE_NUMBER_LIST,
+ XML_TABLE_OF_CONTENT,
+ XML_TABLE_OF_CONTENT_ENTRY_TEMPLATE,
+ XML_TABLE_OF_CONTENT_SOURCE,
+ XML_TABLE_PAGE,
+ XML_TABLE_PROTECTION,
+ XML_TABLE_ROW,
+ XML_TABLE_ROW_GROUP,
+ XML_TABLE_ROWS,
+ XML_TABLE_SOURCE,
+ XML_TABLE_VIEW,
+ XML_TABLES,
+ XML_TAN,
+ XML_TANH,
+ XML_TARGET_CELL_ADDRESS,
+ XML_TARGET_FRAME_NAME,
+ XML_TARGET_RANGE_ADDRESS,
+ XML_TB_RL,
+ XML_TEAL,
+ XML_TECHREPORT,
+ XML_TEMPLATE,
+ XML_TEMPLATE_NAME,
+ XML_TENDSTO,
+ XML_TEX_FILTER,
+ XML_TEX_GENERATION_MODE_X,
+ XML_TEX_GENERATION_MODE_Y,
+ XML_TEX_KIND,
+ XML_TEX_MODE,
+ XML_TEXT,
+ XML_TEXT_ALIGN,
+ XML_TEXT_ALIGN_LAST,
+ XML_TEXT_ALIGN_SOURCE,
+ XML_TEXT_AUTOSPACE,
+ XML_TEXT_BACKGROUND_COLOR,
+ XML_TEXT_BLINKING,
+ XML_TEXT_BOX,
+ XML_TEXT_COMBINE,
+ XML_TEXT_COMBINE_END_CHAR,
+ XML_TEXT_COMBINE_START_CHAR,
+ XML_TEXT_CONTENT,
+ XML_TEXT_CROSSING_OUT,
+ XML_TEXT_EMPHASIZE,
+ XML_TEXT_GLOBAL,
+ XML_TEXT_INDENT,
+ XML_TEXT_INPUT,
+ XML_TEXT_JUSTIFY,
+ XML_TEXT_OUTLINE,
+ XML_TEXT_POSITION,
+ XML_TEXT_ROTATION_ANGLE,
+ XML_TEXT_ROTATION_SCALE,
+ XML_TEXT_SCALE,
+ XML_TEXT_SHADOW,
+ XML_TEXT_STYLE,
+ XML_TEXT_TRANSFORM,
+ XML_TEXT_UNDERLINE,
+ XML_TEXT_UNDERLINE_COLOR,
+ XML_TEXTAREA_HORIZONTAL_ALIGN,
+ XML_TEXTAREA_VERTICAL_ALIGN,
+ XML_TEXTUAL,
+ XML_THICK,
+ XML_THIN,
+ XML_THREE_DIMENSIONAL,
+ XML_THUMBNAIL,
+ XML_TICK_MARKS_MAJOR_INNER,
+ XML_TICK_MARKS_MAJOR_OUTER,
+ XML_TICK_MARKS_MINOR_INNER,
+ XML_TICK_MARKS_MINOR_OUTER,
+ XML_TILE_REPEAT_OFFSET,
+ XML_TIME,
+ XML_TIME_ADJUST,
+ XML_TIME_STYLE,
+ XML_TIME_VALUE,
+ XML_TIMES,
+ XML_TITLE,
+ XML_TO_ANOTHER_TABLE,
+ XML_TO_BOTTOM,
+ XML_TO_CENTER,
+ XML_TO_LEFT,
+ XML_TO_LOWER_LEFT,
+ XML_TO_LOWER_RIGHT,
+ XML_TO_RIGHT,
+ XML_TO_TOP,
+ XML_TO_UPPER_LEFT,
+ XML_TO_UPPER_RIGHT,
+ XML_TOC_MARK,
+ XML_TOC_MARK_END,
+ XML_TOC_MARK_START,
+ XML_TOP,
+ XML_TOP_LEFT,
+ XML_TOP_PERCENT,
+ XML_TOP_RIGHT,
+ XML_TOP_VALUES,
+ XML_TOPARC,
+ XML_TOPCIRCLE,
+ XML_TRACE_DEPENDENTS,
+ XML_TRACE_ERRORS,
+ XML_TRACE_PRECEDENTS,
+ XML_TRACK_CHANGES,
+ XML_TRACKED_CHANGES,
+ XML_TRACKED_CHANGES_VIEW_SETTINGS,
+ XML_TRANSFORM,
+ XML_TRANSITION_ON_CLICK,
+ XML_TRANSPARENCY,
+ XML_TRANSPARENCY_NAME,
+ XML_TRANSPARENT,
+ XML_TRANSPOSE,
+ XML_TRUE,
+ XML_TRUNCATE_ON_OVERFLOW,
+ XML_TTB,
+ XML_TYPE,
+ XML_DOT_DASH,
+ XML_DOT_DOT_DASH,
+ XML_LONG_DASH,
+ XML_SINGLE,
+ XML_SMALL_WAVE,
+ XML_WAVE,
+ XML_UNFORMATTED_TEXT,
+ XML_UNION,
+ XML_UNIT,
+ XML_UNORDERED_LIST,
+ XML_UNPUBLISHED,
+ XML_UP,
+ XML_UPLIMIT,
+ XML_UPRIGHT,
+ XML_URL,
+ XML_USE_CAPTION,
+ XML_USE_CELL_PROTECTION,
+ XML_USE_CHART_OBJECTS,
+ XML_USE_CONDITION,
+ XML_USE_DRAW_OBJECTS,
+ XML_USE_FLOATING_FRAMES,
+ XML_USE_GRAPHICS,
+ XML_USE_IMAGE_OBJECTS,
+ XML_USE_INDEX_MARKS,
+ XML_USE_INDEX_SOURCE_STYLES,
+ XML_USE_KEYS_AS_ENTRIES,
+ XML_USE_LABEL,
+ XML_USE_MATH_OBJECTS,
+ XML_USE_OBJECTS,
+ XML_USE_OPTIMAL_COLUMN_WIDTH,
+ XML_USE_OPTIMAL_ROW_HEIGHT,
+ XML_USE_OTHER_OBJECTS,
+ XML_USE_SPREADSHEET_OBJECTS,
+ XML_USE_STYLES,
+ XML_USE_TABLES,
+ XML_USE_WINDOW_FONT_COLOR,
+ XML_USED_HIERARCHY,
+ XML_USER_DEFINED,
+ XML_USER_FIELD_DECL,
+ XML_USER_FIELD_DECLS,
+ XML_USER_FIELD_GET,
+ XML_USER_FIELD_INPUT,
+ XML_USER_INDEX,
+ XML_USER_INDEX_ENTRY_TEMPLATE,
+ XML_USER_INDEX_MARK,
+ XML_USER_INDEX_MARK_END,
+ XML_USER_INDEX_MARK_START,
+ XML_USER_INDEX_SOURCE,
+ XML_USER_TRANSFORMED,
+ XML_USERNAME,
+ XML_VALUE,
+ XML_VALUE_TYPE,
+ XML_VALUES_CELL_RANGE_ADDRESS,
+ XML_VAR,
+ XML_VARIABLE,
+ XML_VARIABLE_DECL,
+ XML_VARIABLE_DECLS,
+ XML_VARIABLE_GET,
+ XML_VARIABLE_INPUT,
+ XML_VARIABLE_SET,
+ XML_VARIANCE,
+ XML_VARP,
+ XML_VECTOR,
+ XML_VERB,
+ XML_VERSION,
+ XML_VERSION_ENTRY,
+ XML_VERSION_LIST,
+ XML_VERTICAL,
+ XML_VERTICAL_ALIGN,
+ XML_VERTICAL_JUSTIFY,
+ XML_VERTICAL_LINES,
+ XML_VERTICAL_POS,
+ XML_VERTICAL_REL,
+ XML_VERTICAL_SEGMENTS,
+ XML_VERTICAL_SPLIT_MODE,
+ XML_VERTICAL_SPLIT_POSITION,
+ XML_VERTICAL_STRIPES,
+ XML_VIEW,
+ XML_VIEWBOX,
+ XML_VIEW_ID,
+ XML_VIEW_SETTINGS,
+ XML_VISIBILITY,
+ XML_VISIBLE,
+ XML_VISIBLE_AREA,
+ XML_VISIBLE_AREA_HEIGHT,
+ XML_VISIBLE_AREA_LEFT,
+ XML_VISIBLE_AREA_TOP,
+ XML_VISIBLE_AREA_WIDTH,
+ XML_VISITED_STYLE_NAME,
+ XML_VOLATILE,
+ XML_VOLUME,
+ XML_VPN,
+ XML_VRP,
+ XML_VUP,
+ XML_WALL,
+ XML_WARNING,
+ XML_WATERMARK,
+ XML_WAVYLINE,
+ XML_WAVYLINE_FROM_BOTTOM,
+ XML_WAVYLINE_FROM_LEFT,
+ XML_WAVYLINE_FROM_RIGHT,
+ XML_WAVYLINE_FROM_TOP,
+ XML_WEEK_OF_YEAR,
+ XML_WEIGHT_BOLD,
+ XML_WEIGHT_NORMAL,
+ XML_WHITE,
+ XML_WHOLE_PAGE,
+ XML_WIDOWS,
+ XML_WIDTH,
+ XML_WORD,
+ XML_WORD_COUNT,
+ XML_WRAP,
+ XML_WRAP_CONTOUR,
+ XML_WRAP_CONTOUR_MODE,
+ XML_WRAP_OPTION,
+ XML_WRITING_MODE,
+ XML_WWW,
+ XML_X,
+ XML_X1,
+ XML_X2,
+ XML_X_MAC_ROMAN,
+ XML_X_SYMBOL,
+ XML_X_SYSTEM,
+ XML_XOR,
+ XML_Y,
+ XML_Y1,
+ XML_Y2,
+ XML_YEAR,
+ XML_YELLOW,
+ XML_ZERO_VALUES,
+ XML_ZINDEX,
+ XML_ZOOM_TYPE,
+ XML_ZOOM_VALUE,
+
+ XML_ENABLE,
+ XML_USE_REGULAR_EXPRESSIONS,
+ XML_DATA_SOURCE_HAS_LABELS,
+ XML_LINK_DATA_STYLE_TO_SOURCE,
+ XML_SORT_ALGORITHM,
+ XML_STRAIGHT_LINE,
+ XML_ANGLED_LINE,
+ XML_ANGLED_CONNECTOR_LINE,
+ XML_APPLICATION_X_WWW_FORM_URLENCODED,
+ XML_MULTIPART_FORMDATA,
+ XML_APPLICATION_TEXT,
+ XML_GET,
+ XML_POST,
+ XML_QUERY,
+ XML_PARENT,
+ XML_RECORDS,
+ XML_PUSH,
+ XML_SUBMIT,
+ XML_RESET,
+ XML_VALUE_LIST,
+ XML_SQL,
+ XML_SQL_PASS_THROUGH,
+ XML_TABLE_FIELDS,
+ XML_UNCHECKED,
+ XML_CHECKED,
+ XML_UNKNOWN,
+
+ XML_ROLL_FROM_TOP,
+
+ XML_BINARY_DATA,
+ XML_NOTIFY_ON_UPDATE_OF_TABLE,
+
+ XML_0,
+ XML_PLAY,
+ XML_HANDOUT_MASTER,
+ XML_TEXT_STYLE_NAME,
+ XML_ESCAPE_DIRECTION,
+ XML_GLUE_POINT,
+ XML_PRIMARY_X,
+ XML_SECONDARY_X,
+ XML_PRIMARY_Y,
+ XML_SECONDARY_Y,
+ XML_PRIMARY_Z,
+
+ XML_CAPTION_TYPE,
+ XML_CAPTION_ANGLE_TYPE,
+ XML_CAPTION_ANGLE,
+ XML_CAPTION_GAP,
+ XML_CAPTION_ESCAPE_DIRECTION,
+ XML_CAPTION_ESCAPE,
+ XML_CAPTION_LINE_LENGTH,
+ XML_CAPTION_FIT_LINE_LENGTH,
+ XML_FREE,
+
+ XML_TRANSITION_TYPE,
+ XML_TRANSITION_STYLE,
+ XML_TRANSITION_SPEED,
+ XML_DURATION,
+ XML_BACKGROUND_SIZE,
+ XML_BACKGROUND_OBJECTS_VISIBLE,
+ XML_BACKGROUND_VISIBLE,
+
+ XML_MOVE_FROM_UPPERLEFT,
+ XML_MOVE_FROM_UPPERRIGHT,
+ XML_MOVE_FROM_LOWERRIGHT,
+ XML_MOVE_FROM_LOWERLEFT,
+ XML_UNCOVER_TO_LEFT,
+ XML_UNCOVER_TO_UPPERLEFT,
+ XML_UNCOVER_TO_TOP,
+ XML_UNCOVER_TO_UPPERRIGHT,
+ XML_UNCOVER_TO_RIGHT,
+ XML_UNCOVER_TO_LOWERRIGHT,
+ XML_UNCOVER_TO_BOTTOM,
+ XML_UNCOVER_TO_LOWERLEFT,
+ XML_VERTICAL_CHECKERBOARD,
+ XML_HORIZONTAL_CHECKERBOARD,
+ XML_NOTIFY_ON_UPDATE_OF_RANGES,
+ XML_BYTE,
+ XML_MACRO,
+ XML_LOCATION,
+ XML_APPLICATION,
+ XML_SYMBOL_IMAGE,
+ XML_TEXT_OVERLAP,
+ XML_SPLINE_ORDER,
+ XML_SPLINE_RESOLUTION,
+
+ XML_PAPER_TRAY_NAME,
+
+ XML_COLUMN_MAPPING,
+ XML_ROW_MAPPING,
+
+ XML_TABLE_FORMULA,
+
+ XML_EMBEDDED_TEXT,
+
+ XML_MERGE_LAST_PARAGRAPH,
+
+ XML_STOCK_LOSS_MARKER,
+ XML_STOCK_GAIN_MARKER,
+ XML_STOCK_RANGE_LINE,
+
+ XML_RL_TB,
+ XML_TB_LR,
+ XML_LR,
+ XML_RL,
+ XML_TB,
+
+ XML_LAYOUT_GRID_COLOR,
+ XML_LAYOUT_GRID_LINES,
+ XML_LAYOUT_GRID_BASE_HEIGHT,
+ XML_LAYOUT_GRID_RUBY_HEIGHT,
+ XML_LAYOUT_GRID_MODE,
+ XML_LAYOUT_GRID_RUBY_BELOW,
+ XML_LAYOUT_GRID_PRINT,
+ XML_LAYOUT_GRID_DISPLAY,
+
+ //text grid enhancement for better CJK support
+ XML_DEFAULT_PAGE_LAYOUT,
+ XML_LAYOUT_GRID_STANDARD_MODE,
+ XML_LAYOUT_GRID_BASE_WIDTH,
+ XML_LAYOUT_GRID_SNAP_TO_CHARS,
+ XML_LAYOUT_GRID_SNAP_TO,
+
+ XML_SNAP_TO_LAYOUT_GRID,
+ XML_DONT_BALANCE_TEXT_COLUMNS,
+
+ XML_GLYPH_ORIENTATION_VERTICAL,
+
+ XML_MARKED_INVALID,
+
+ XML_REGRESSION_CURVE,
+ XML_ERROR_INDICATOR,
+
+ XML_TABLE_TYPE,
+
+ XML_DISPLAY_FACTOR,
+
+ XML_TRANSLITERATION_FORMAT,
+ XML_TRANSLITERATION_LANGUAGE,
+ XML_TRANSLITERATION_COUNTRY,
+ XML_TRANSLITERATION_STYLE,
+
+ XML_KEY1_PHONETIC,
+ XML_KEY2_PHONETIC,
+ XML_STRING_VALUE_PHONETIC,
+
+ XML_BACKGROUND_TRANSPARENCY,
+ XML_BACKGROUND_IMAGE_TRANSPARENCY,
+
+ XML_DYNAMIC_SPACING,
+ XML_MAIN_ENTRY,
+
+ XML_USE_OUTLINE_LEVEL,
+
+ // #107245# New 3D properties which are possible for lathe and extrude 3d objects
+ XML_CLOSE_FRONT,
+ XML_CLOSE_BACK,
+
+ XML_DROPDOWN,
+ XML_CURRENT_SELECTED,
+
+ XML_JOIN_BORDER,
+
+ XML_DISPLAY_LIST,
+ XML_NO,
+ XML_UNSORTED,
+ XML_SORTED_ASCENDING,
+ XML_FONT_INDEPENDENT_LINE_SPACING,
+
+ XML_DATABASE,
+ XML_DATASOURCE,
+ XML_QUERIES,
+ XML_REPORTS,
+ XML_REPORT,
+ XML_AS_TEMPLATE,
+
+ XML_CONNECTION_RESOURCE,
+ XML_SUPPRESS_VERSION_COLUMNS,
+ XML_JAVA_DRIVER_CLASS,
+ XML_EXTENSION,
+ XML_IS_FIRST_ROW_HEADER_LINE,
+ XML_SHOW_DELETED,
+ XML_IS_TABLE_NAME_LENGTH_LIMITED,
+ XML_SYSTEM_DRIVER_SETTINGS,
+ XML_ENABLE_SQL92_CHECK,
+ XML_APPEND_TABLE_ALIAS_NAME,
+ XML_PARAMETER_NAME_SUBSTITUTION,
+ XML_IGNORE_DRIVER_PRIVILEGES,
+ XML_BOOLEAN_COMPARISON_MODE,
+ XML_USE_CATALOG,
+ XML_BASE_DN,
+ XML_MAX_ROW_COUNT,
+ XML_LOGIN,
+ XML_USER_NAME,
+ XML_IS_PASSWORD_REQUIRED,
+ XML_LOGIN_TIMEOUT,
+ XML_DELIMITER,
+ XML_FIELD,
+ XML_DECIMAL,
+ XML_THOUSAND,
+ XML_TABLE_FILTER,
+ XML_TABLE_FILTER_PATTERN,
+ XML_TABLE_TYPE_FILTER,
+ XML_AUTO_INCREMENT,
+ XML_ADDITIONAL_COLUMN_STATEMENT,
+ XML_ROW_RETRIEVING_STATEMENT,
+ XML_DATA_SOURCE_SETTINGS,
+ XML_DATA_SOURCE_SETTING,
+ XML_DATA_SOURCE_SETTING_VALUE,
+ XML_DATA_SOURCE_SETTING_IS_LIST,
+ XML_DATA_SOURCE_SETTING_TYPE,
+ XML_DATA_SOURCE_SETTING_NAME,
+ XML_COMPONENT,
+ XML_COMPONENT_COLLECTION,
+ XML_QUERY_COLLECTION,
+ XML_UPDATE_TABLE,
+ XML_FILTER_STATEMENT,
+ XML_ORDER_STATEMENT,
+ XML_ESCAPE_PROCESSING,
+ XML_KEYS,
+ XML_INDICES,
+ XML_TYPE_NAME,
+ XML_PRECISION,
+ XML_IS_NULLABLE,
+ XML_IS_AUTOINCREMENT,
+ XML_DEFAULT_VALUE,
+ XML_REFERENCED_TABLE_NAME,
+ XML_UPDATE_RULE,
+ XML_DELETE_RULE,
+ XML_KEY_COLUMNS,
+ XML_KEY_COLUMN,
+ XML_RELATED_COLUMN_NAME,
+ XML_CATALOG_NAME,
+ XML_IS_UNIQUE,
+ XML_IS_CLUSTERED,
+ XML_INDEX_COLUMNS,
+ XML_INDEX_COLUMN,
+ XML_IS_ASCENDING,
+ XML_SCHEMA_NAME,
+ XML_NP_DB,
+ XML_N_DB,
+ XML_APPLY_FILTER,
+ XML_APPLY_ORDER,
+ XML_AUTOMATIC_PRINT_RANGE,
+
+ XML_SELECTION,
+ XML_SELECTION_INDEXES,
+
+ XML_SCALE_TO_X,
+ XML_SCALE_TO_Y,
+
+ XML_KEEP_TOGETHER,
+
+ XML_USE_HEADER_NAME,
+ XML_USE_FOOTER_NAME,
+ XML_USE_DATE_TIME_NAME,
+ XML_DISPLAY_HEADER,
+ XML_DISPLAY_FOOTER,
+ XML_DISPLAY_PAGE_NUMBER,
+ XML_DISPLAY_DATE_TIME,
+ XML_SOURCE,
+ XML_CURRENT_DATE,
+
+ XML_HEADER_DECL,
+ XML_FOOTER_DECL,
+ XML_DATE_TIME_DECL,
+
+ XML_SELECTED_PAGE,
+
+ // DVO, OD 01.10.2003 #i18732
+ XML_FLOW_WITH_TEXT,
+
+ XML_WITH_TAB, // #i21237#
+
+ XML_CUSTOM_SHAPE,
+ XML_ENGINE,
+ XML_ENHANCED_GEOMETRY,
+ XML_TEXT_ROTATE_ANGLE,
+ XML_MIRROR_VERTICAL,
+ XML_MIRROR_HORIZONTAL,
+ XML_EXTRUSION_ALLOWED,
+ XML_TEXT_PATH_ALLOWED,
+ XML_CONCENTRIC_GRADIENT_FILL_ALLOWED,
+ XML_EXTRUSION,
+ XML_EXTRUSION_BRIGHTNESS,
+ XML_EXTRUSION_DEPTH,
+ XML_EXTRUSION_DIFFUSION,
+ XML_EXTRUSION_NUMBER_OF_LINE_SEGMENTS,
+ XML_EXTRUSION_LIGHT_FACE,
+ XML_EXTRUSION_FIRST_LIGHT_HARSH,
+ XML_EXTRUSION_SECOND_LIGHT_HARSH,
+ XML_EXTRUSION_FIRST_LIGHT_LEVEL,
+ XML_EXTRUSION_SECOND_LIGHT_LEVEL,
+ XML_EXTRUSION_FIRST_LIGHT_DIRECTION,
+ XML_EXTRUSION_SECOND_LIGHT_DIRECTION,
+ XML_EXTRUSION_METAL,
+ XML_EXTRUSION_ROTATION_ANGLE,
+ XML_EXTRUSION_ROTATION_CENTER,
+ XML_EXTRUSION_SHININESS,
+ XML_EXTRUSION_SKEW,
+ XML_EXTRUSION_SPECULARITY,
+ XML_EXTRUSION_PROJECTION_MODE,
+ XML_EXTRUSION_VIEWPOINT,
+ XML_EXTRUSION_ORIGIN,
+ XML_EXTRUSION_COLOR,
+ XML_SECONDARY_FILL_COLOR,
+ XML_ENHANCED_PATH,
+ XML_PATH_STRETCHPOINT_X,
+ XML_PATH_STRETCHPOINT_Y,
+ XML_TEXT_AREAS,
+ XML_GLUE_POINTS,
+ XML_GLUE_POINT_TYPE,
+ XML_GLUE_POINT_LEAVING_DIRECTIONS,
+ XML_TEXT_PATH,
+ XML_TEXT_PATH_MODE,
+ XML_TEXT_PATH_SCALE,
+ XML_TEXT_PATH_SAME_LETTER_HEIGHTS,
+ XML_MODIFIERS,
+ XML_EQUATION,
+ XML_XSTRETCH,
+ XML_YSTRETCH,
+ XML_HASSTROKE,
+ XML_HASFILL,
+ XML_LOGWIDTH,
+ XML_LOGHEIGHT,
+ XML_HANDLE,
+ XML_HANDLE_MIRROR_VERTICAL,
+ XML_HANDLE_MIRROR_HORIZONTAL,
+ XML_HANDLE_SWITCHED,
+ XML_HANDLE_POSITION,
+ XML_HANDLE_RANGE_X_MINIMUM,
+ XML_HANDLE_RANGE_X_MAXIMUM,
+ XML_HANDLE_RANGE_Y_MINIMUM,
+ XML_HANDLE_RANGE_Y_MAXIMUM,
+ XML_HANDLE_POLAR,
+ XML_HANDLE_RADIUS_RANGE_MINIMUM,
+ XML_HANDLE_RADIUS_RANGE_MAXIMUM,
+ XML_RECTANGLE,
+ XML_ROUNDRECTANGLE,
+ XML_OVAL,
+ XML_CLOUD,
+ XML_BOUNDINGCUBE,
+ XML_WIREFRAME,
+ XML_SEGMENTS,
+ XML_WORD_WRAP,
+
+ XML_COLLAPSING,
+ XML_SEPARATING,
+ XML_BORDER_MODEL,
+
+ XML_DATA_PILOT_FIELD_REFERENCE,
+ XML_MEMBER_DIFFERENCE,
+ XML_MEMBER_PERCENTAGE,
+ XML_MEMBER_PERCENTAGE_DIFFERENCE,
+ XML_RUNNING_TOTAL,
+ XML_ROW_PERCENTAGE,
+ XML_COLUMN_PERCENTAGE,
+ XML_TOTAL_PERCENTAGE,
+ XML_FIELD_NAME,
+ XML_MEMBER_TYPE,
+ XML_NAMED,
+ XML_MEMBER_NAME,
+ XML_DISPLAY_MEMBER_MODE,
+ XML_MEMBER_COUNT,
+ XML_DATA_FIELD,
+ XML_DATA_PILOT_DISPLAY_INFO,
+ XML_SORT_MODE,
+ XML_DATA_PILOT_SORT_INFO,
+ XML_ADD_EMPTY_LINES,
+ XML_TABULAR_LAYOUT,
+ XML_OUTLINE_SUBTOTALS_TOP,
+ XML_OUTLINE_SUBTOTALS_BOTTOM,
+ XML_LAYOUT_MODE,
+ XML_DATA_PILOT_LAYOUT_INFO,
+
+ XML_SYMBOL_COLOR,
+
+ XML_3D,
+ XML_IMAGE_POSITION,
+ XML_IMAGE_ALIGN,
+
+ XML_DIAGONAL_BL_TR,
+ XML_DIAGONAL_BL_TR_WIDTH,
+ XML_DIAGONAL_TL_BR,
+ XML_DIAGONAL_TL_BR_WIDTH,
+ XML_REPEAT_CONTENT,
+ XML_SHRINK_TO_FIT,
+
+ /* Core impl. of the positioning of floating screen objects without
+ considering its wrapping style (#i28701#)
+ */
+ XML_WRAP_INFLUENCE_ON_POSITION,
+ // Tokens have been renamed and <XML_ITERATIVE> has been added (#i35017#)
+ XML_ONCE_SUCCESSIVE,
+ XML_ONCE_CONCURRENT,
+
+ // Names for OOo format only
+ XML_N_OFFICE_OOO,
+ XML_N_META_OOO,
+ XML_N_STYLE_OOO,
+ XML_N_NUMBER_OOO,
+ XML_N_TEXT_OOO,
+ XML_N_TABLE_OOO,
+ XML_N_DRAW_OOO,
+ XML_N_DR3D_OOO,
+ XML_N_PRESENTATION_OOO,
+ XML_N_CHART_OOO,
+ XML_N_CONFIG_OOO,
+ XML_N_FORM_OOO,
+ XML_N_SCRIPT_OOO,
+
+ XML_GLOBAL,
+ XML_NOTE_CLASS,
+ XML_NOTE_CITATION,
+ XML_NOTE_BODY,
+ XML_NOTES_CONFIGURATION,
+ XML_NOTE_REF,
+ XML_IS_SUB_TABLE,
+ XML_PAGE_LAYOUT,
+ XML_PAGE_LAYOUT_NAME,
+ XML_GRAPHIC_PROPERTIES,
+ XML_DRAWING_PAGE_PROPERTIES,
+ XML_PAGE_LAYOUT_PROPERTIES,
+ XML_HEADER_FOOTER_PROPERTIES,
+ XML_TEXT_PROPERTIES,
+ XML_PARAGRAPH_PROPERTIES,
+ XML_RUBY_PROPERTIES,
+ XML_SECTION_PROPERTIES,
+ XML_TABLE_PROPERTIES,
+ XML_TABLE_COLUMN_PROPERTIES,
+ XML_TABLE_ROW_PROPERTIES,
+ XML_TABLE_CELL_PROPERTIES,
+ XML_LIST_LEVEL_PROPERTIES,
+ XML_CHART_PROPERTIES,
+ XML_DRAWING_PAGE,
+ XML_GRAPHICS,
+ XML_TAB,
+ XML_TEXT_UNDERLINE_MODE,
+ XML_TEXT_LINE_THROUGH_MODE,
+ XML_CONTINUOUS,
+ XML_SKIP_WHITE_SPACE,
+ XML_SCRIPTS,
+ XML_FONT_FACE_DECLS,
+ XML_FONT_FACE,
+ XML_FONT_FACE_SRC,
+ XML_FONT_FACE_URI,
+ XML_FONT_ADORNMENTS,
+ XML_INCH,
+ XML_SPACE_AFTER,
+ XML_START_INDENT,
+ XML_END_INDENT,
+
+ // chart Oasis format additions
+ XML_INTERVAL_MINOR_DIVISOR,
+ XML_DATE_STRING,
+
+ XML_TEXT_UNDERLINE_STYLE,
+ XML_TEXT_UNDERLINE_TYPE,
+ XML_TEXT_UNDERLINE_WIDTH,
+
+ XML_TEXT_OVERLINE_TYPE,
+ XML_TEXT_OVERLINE_STYLE,
+ XML_TEXT_OVERLINE_WIDTH,
+ XML_TEXT_OVERLINE_COLOR,
+ XML_TEXT_OVERLINE_MODE,
+
+ XML_TEXT_LINE_THROUGH_STYLE,
+ XML_TEXT_LINE_THROUGH_TYPE,
+ XML_TEXT_LINE_THROUGH_WIDTH,
+ XML_TEXT_LINE_THROUGH_TEXT,
+
+ XML_LEADER_STYLE,
+ XML_LEADER_TEXT,
+
+ XML_BOLD_DOTTED,
+ XML_BOLD_DASH,
+ XML_BOLD_LONG_DASH,
+ XML_BOLD_DOT_DASH,
+ XML_BOLD_DOT_DOT_DASH,
+ XML_BOLD_WAVE,
+ XML_DOUBLE_WAVE,
+ XML_DOUBLE_LINE,
+ XML_THICK_LINE,
+ XML_SINGLE_LINE,
+ XML_SLASH,
+ XML_TEXT_LINE_THROUGH_COLOR,
+ XML_TEXT_LINE_THROUGH_TEXT_STYLE,
+ XML_LEADER_COLOR,
+ XML_LEADER_TYPE,
+ XML_LEADER_WIDTH,
+ XML_LEADER_TEXT_STYLE,
+
+ XML_OPACITY,
+ XML_OPACITY_NAME,
+ XML_SHADOW_OPACITY,
+ XML_ALWAYS,
+ XML_COUNT_IN_TEXT_BOXES,
+
+ XML_NP_OOO,
+ XML_N_OOO,
+ XML_NP_OOOW,
+ XML_N_OOOW,
+ XML_NP_OOOC,
+ XML_N_OOOC,
+ XML_NP_DOM,
+ XML_N_DOM,
+
+ XML_EVENT_LISTENERS,
+ XML_EVENT_LISTENER,
+
+ XML_FORM,
+ XML_VOID,
+ XML_PROPERTY,
+ XML_PROPERTY_NAME,
+ XML_LIST_PROPERTY,
+ XML_LIST_VALUE,
+ XML_COLUMN_STYLE_NAME,
+
+ XML_TEXTAREA,
+ XML_FIXED_TEXT,
+ XML_FILE,
+ XML_FORMATTED_TEXT,
+ XML_BUTTON,
+ XML_CHECKBOX,
+ XML_RADIO,
+ XML_LISTBOX,
+ XML_COMBOBOX,
+ XML_IMAGE_FRAME,
+ XML_VALUE_RANGE,
+ XML_GENERIC_CONTROL,
+ XML_SERVICE_NAME,
+ XML_PROPERTY_TYPE,
+ XML_INTEGER,
+ XML_PROPERTY_IS_VOID,
+ XML_PROPERTY_IS_LIST,
+ XML_PROPERTY_VALUE,
+ XML_MIMETYPE,
+ XML_DATABASE_ROW_SELECT,
+ XML_CONTROL_IMPLEMENTATION,
+ XML_INTERPOLATION,
+ XML_CUBIC_SPLINE,
+ XML_B_SPLINE,
+ XML_STEP_START,
+ XML_STEP_END,
+ XML_STEP_CENTER_X,
+ XML_STEP_CENTER_Y,
+ XML_GNM_STEP_START,
+ XML_GNM_STEP_END,
+ XML_GNM_STEP_CENTER_X,
+ XML_GNM_STEP_CENTER_Y,
+ XML_N_DB_OASIS,
+
+ XML_SHOW_FILTER_BUTTON,
+ XML_DRILL_DOWN_ON_DOUBLE_CLICK,
+ XML_HEADER_GRID_LAYOUT,
+ XML_GROUPED_BY,
+ XML_DAYS,
+ XML_MONTHS,
+ XML_QUARTERS,
+ XML_YEARS,
+ XML_DATE_START,
+ XML_DATE_END,
+ XML_STEP,
+ XML_IS_GROUP_FIELD,
+ XML_DATA_PILOT_GROUPS,
+ XML_DATA_PILOT_GROUP,
+
+ XML_JAPANESE_CANDLE_STICK,
+ XML_NAMED_SYMBOL,
+ XML_DIAMOND,
+ XML_ARROW_DOWN,
+ XML_ARROW_UP,
+ XML_ARROW_RIGHT,
+ XML_ARROW_LEFT,
+ XML_BOW_TIE,
+ XML_HOURGLASS,
+ XML_SYMBOL_NAME,
+ XML_SYMBOL_TYPE,
+ XML_IMAGE_OPACITY, // #i25616#
+
+ XML_DEFAULT_OUTLINE_LEVEL,
+ XML_SHOW_DETAILS,
+ XML_SHOW_EMPTY,
+ XML_ITERATIVE,
+ XML_uX,
+ XML_NP_DLG,
+ XML_N_DLG,
+ XML_SCRIPT_DATA,
+ XML_LIBRARIES,
+ XML_SOURCE_CODE,
+ XML_READONLY,
+
+ XML_Z,
+ XML_DIMENSION,
+ XML_VALIDATION_NAME,
+
+ XML_SCREEN,
+ XML_PRINTER,
+
+ // XForms tokens
+ // already defined: XML_ACTION, XML_VERSION, XML_ENCODING,
+ // XML_REPLACE, XML_SEPARATOR, XML_TYPE, XML_ID
+ XML_MODEL,
+ XML_SCHEMA,
+ XML_BIND,
+ XML_INSTANCE,
+ XML_SUBMISSION,
+ XML_REF,
+ XML_SRC,
+ XML_METHOD,
+ XML_NODESET,
+ XML_INDENT,
+ XML_OMIT_XML_DECLARATION,
+ XML_STANDALONE,
+ XML_CDATA_SECTION_ELEMENTS,
+ XML_REQUIRED,
+ XML_RELEVANT,
+ XML_CALCULATE,
+ XML_CONSTRAINT,
+ XML_MAXOCCURS, // maxOccurs
+ XML_MINOCCURS, // minOccurs
+ XML_P3PTYPE,
+ XML_MEDIATYPE,
+ XML_INCLUDENAMESPACEPREFIXES,
+
+ // XForms/XSD Schema; these tokens use innerWordCapitalization
+ // (already defined: XML_SCHEMA, XML_LENGTH, XML_ID)
+ XML_BASE,
+ XML_TARGETNAMESPACE, // targetNamespace
+ XML_SIMPLETYPE, // simpleType
+ XML_RESTRICTION,
+ XML_MAXLENGTH, // maxLength
+ XML_MINLENGTH, // minLength
+ XML_MININCLUSIVE, // minInclusive
+ XML_MINEXCLUSIVE, // minExclusive
+ XML_MAXINCLUSIVE, // maxInclusive
+ XML_MAXEXCLUSIVE, // maxExclusive
+ XML_PATTERN,
+ XML_ENUMERATION,
+ XML_WHITESPACE, // whiteSpace
+ XML_TOTALDIGITS, // totalDigits
+ XML_FRACTIONDIGITS, // fractionDigits
+ XML_PRESERVE,
+ XML_ANYURI, // anyURI
+ XML_DATETIME_XSD, // dateTime
+ XML_MAIN_ETRY, // #i28755#
+
+ // SMIL
+ XML_REMOVE,
+ XML_HOLD,
+ XML_TRANSITION,
+ XML_INHERIT,
+ XML_FILLDEFAULT,
+ XML_RESTART,
+ XML_RESTARTDEFAULT,
+ XML_WHENNOTACTIVE,
+ XML_NEVER,
+ XML_ACCELERATE,
+ XML_DECELERATE,
+ XML_AUTOREVERSE,
+ XML_INDEFINITE,
+ XML_REPEATCOUNT,
+ XML_REPEATDUR,
+ XML_ENDSYNC,
+ XML_FIRST,
+ XML_LAST,
+ XML_MEDIA,
+ XML_DUR,
+ XML_BEGIN,
+ XML_WHOLE,
+ XML_FROM,
+ XML_TO,
+ XML_BY,
+ XML_VALUES,
+ XML_KEYTIMES,
+ XML_KEYSPLINES,
+ XML_CALCMODE,
+ XML_DISCRETE,
+ XML_PACED,
+ XML_SPLINE,
+ XML_ACCUMULATE,
+ XML_ADDITIVE,
+ XML_MULTIPLY,
+ XML_ANIMATE,
+ XML_ANIMATEMOTION,
+ XML_ANIMATETRANSFORM,
+ XML_ANIMATECOLOR,
+ XML_TRANSITIONFILTER,
+ XML_ATTRIBUTENAME,
+
+ XML_NP_SMIL,
+ XML_N_SMIL,
+
+ XML_NP_ANIMATION,
+ XML_N_ANIMATION,
+
+ XML_PAR,
+ XML_SEQ,
+
+ XML_TRANSLATE,
+ XML_SKEWX,
+ XML_SKEWY,
+
+ XML_AUDIO,
+
+ XML_COLOR_INTERPOLATION,
+ XML_COLOR_INTERPOLATION_DIRECTION,
+ XML_HSL,
+ XML_RGB,
+
+ XML_BARWIPE,
+ XML_BOXWIPE,
+ XML_FOURBOXWIPE,
+ XML_BARNDOORWIPE,
+ XML_DIAGONALWIPE,
+ XML_BOWTIEWIPE,
+ XML_MISCDIAGONALWIPE,
+ XML_VEEWIPE,
+ XML_BARNVEEWIPE,
+ XML_ZIGZAGWIPE,
+ XML_BARNZIGZAGWIPE,
+ XML_IRISWIPE,
+ XML_TRIANGLEWIPE,
+ XML_ARROWHEADWIPE,
+ XML_PENTAGONWIPE,
+ XML_HEXAGONWIPE,
+ XML_ELLIPSEWIPE,
+ XML_EYEWIPE,
+ XML_ROUNDRECTWIPE,
+ XML_STARWIPE,
+ XML_MISCSHAPEWIPE,
+ XML_CLOCKWIPE,
+ XML_PINWHEELWIPE,
+ XML_SINGLESWEEPWIPE,
+ XML_FANWIPE,
+ XML_DOUBLEFANWIPE,
+ XML_DOUBLESWEEPWIPE,
+ XML_SALOONDOORWIPE,
+ XML_WINDSHIELDWIPE,
+ XML_SNAKEWIPE,
+ XML_SPIRALWIPE,
+ XML_PARALLELSNAKESWIPE,
+ XML_BOXSNAKESWIPE,
+ XML_WATERFALLWIPE,
+ XML_PUSHWIPE,
+ XML_SLIDEWIPE,
+ XML_BLINDSWIPE,
+ XML_RANDOMBARWIPE,
+ XML_CHECKERBOARDWIPE,
+ XML_ZOOM,
+
+ XML_LEFTTORIGHT,
+ XML_TOPTOBOTTOM,
+ XML_TOPLEFT,
+ XML_TOPRIGHT,
+ XML_BOTTOMRIGHT,
+ XML_BOTTOMLEFT,
+ XML_TOPCENTER,
+ XML_RIGHTCENTER,
+ XML_BOTTOMCENTER,
+ XML_LEFTCENTER,
+ XML_CORNERSIN,
+ XML_CORNERSOUT,
+ XML_DIAGONALBOTTOMLEFT,
+ XML_DIAGONALTOPLEFT,
+ XML_DOUBLEBARNDOOR,
+ XML_DOUBLEDIAMOND,
+ XML_FOURPOINT,
+ XML_FIVEPOINT,
+ XML_SIXPOINT,
+ XML_HEART,
+ XML_KEYHOLE,
+ XML_CLOCKWISETWELVE,
+ XML_CLOCKWISETHREE,
+ XML_CLOCKWISESIX,
+ XML_CLOCKWISENINE,
+ XML_TWOBLADEVERTICAL,
+ XML_TWOBLADEHORIZONTAL,
+ XML_FOURBLADE,
+ XML_CLOCKWISETOP,
+ XML_CLOCKWISERIGHT,
+ XML_CLOCKWISEBOTTOM,
+ XML_CLOCKWISELEFT,
+ XML_CLOCKWISETOPLEFT,
+ XML_COUNTERCLOCKWISEBOTTOMLEFT,
+ XML_CLOCKWISEBOTTOMRIGHT,
+ XML_COUNTERCLOCKWISETOPRIGHT,
+ XML_CENTERTOP,
+ XML_CENTERRIGHT,
+ XML_FANOUTVERTICAL,
+ XML_FANOUTHORIZONTAL,
+ XML_FANINVERTICAL,
+ XML_FANINHORIZONTAL,
+ XML_PARALLELVERTICAL,
+ XML_PARALLELDIAGONAL,
+ XML_OPPOSITEVERTICAL,
+ XML_OPPOSITEHORIZONTAL,
+ XML_PARALLELDIAGONALTOPLEFT,
+ XML_PARALLELDIAGONALBOTTOMLEFT,
+ XML_TOPLEFTHORIZONTAL,
+ XML_TOPLEFTDIAGONAL,
+ XML_TOPLEFTVERTICAL,
+ XML_TOPRIGHTDIAGONAL,
+ XML_BOTTOMRIGHTDIAGONAL,
+ XML_BOTTOMLEFTDIAGONAL,
+ XML_TOPLEFTCLOCKWISE,
+ XML_TOPRIGHTCLOCKWISE,
+ XML_BOTTOMRIGHTCLOCKWISE,
+ XML_BOTTOMLEFTCLOCKWISE,
+ XML_TOPLEFTCOUNTERCLOCKWISE,
+ XML_TOPRIGHTCOUNTERCLOCKWISE,
+ XML_BOTTOMRIGHTCOUNTERCLOCKWISE,
+ XML_BOTTOMLEFTCOUNTERCLOCKWISE,
+ XML_VERTICALTOPSAME,
+ XML_VERTICALBOTTOMSAME,
+ XML_VERTICALTOPLEFTOPPOSITE,
+ XML_VERTICALBOTTOMLEFTOPPOSITE,
+ XML_HORIZONTALLEFTSAME,
+ XML_HORIZONTALRIGHTSAME,
+ XML_HORIZONTALTOPLEFTOPPOSITE,
+ XML_HORIZONTALTOPRIGHTOPPOSITE,
+ XML_DIAGONALBOTTOMLEFTOPPOSITE,
+ XML_DIAGONALTOPLEFTOPPOSITE,
+ XML_TWOBOXTOP,
+ XML_TWOBOXBOTTOM,
+ XML_TWOBOXLEFT,
+ XML_TWOBOXRIGHT,
+ XML_FOURBOXVERTICAL,
+ XML_FOURBOXHORIZONTAL,
+ XML_VERTICALLEFT,
+ XML_VERTICALRIGHT,
+ XML_HORIZONTALLEFT,
+ XML_HORIZONTALRIGHT,
+ XML_FROMLEFT,
+ XML_FROMTOP,
+ XML_FROMRIGHT,
+ XML_FROMBOTTOM,
+ XML_CROSSFADE,
+ XML_FADETOCOLOR,
+ XML_FADEFROMCOLOR,
+ XML_FADEOVERCOLOR,
+ XML_THREEBLADE,
+ XML_EIGHTBLADE,
+ XML_ONEBLADE,
+ XML_ACROSS,
+ XML_COMBHORIZONTAL,
+ XML_COMBVERTICAL,
+ XML_ROTATEIN,
+ XML_ROTATEOUT,
+ XML_FROMTOPLEFT,
+ XML_FROMTOPRIGHT,
+ XML_FROMBOTTOMLEFT,
+ XML_FROMBOTTOMRIGHT,
+
+ XML_SUBTYPE,
+ XML_OUT,
+
+ XML_FORWARD,
+ XML_REVERSE,
+
+ XML_FADECOLOR,
+
+ XML_ONBEGIN,
+ XML_ONEND,
+ XML_CLICK,
+ XML_DOUBLECLICK,
+ XML_MOUSEOVER,
+ XML_MOUSEOUT,
+
+ XML_NODE_TYPE,
+ XML_PRESET_ID,
+ XML_PRESET_SUB_TYPE,
+ XML_PRESET_CLASS,
+ XML_CUSTOM,
+ XML_ENTRANCE,
+ XML_EXIT,
+ XML_EMPHASIS,
+ XML_MOTION_PATH,
+ XML_OLE_ACTION,
+ XML_MEDIA_CALL,
+ XML_ON_CLICK,
+ XML_WITH_PREVIOUS,
+ XML_AFTER_PREVIOUS,
+ XML_MAIN_SEQUENCE,
+ XML_TIMING_ROOT,
+ XML_INTERACTIVE_SEQUENCE,
+
+ XML_SUB_ITEM,
+ XML_ITERATE_TYPE,
+ XML_ITERATE_INTERVAL,
+ XML_ITERATE,
+ XML_BY_PARAGRAPH,
+ XML_BY_WORD,
+ XML_BY_LETTER,
+
+ XML_AFTER_EFFECT,
+ XML_MASTER,
+
+ XML_GROUP_ID,
+ XML_TARGETELEMENT,
+ XML_TOGGLE_PAUSE,
+ XML_MASTER_ELEMENT,
+ XML_STOP_AUDIO,
+
+ XML_AUDIO_LEVEL,
+
+ XML_URN_OASIS_NAMES_TC,
+ XML_OPENDOCUMENT,
+ XML_1_0,
+
+ XML_IS_LIST_HEADER,
+ XML_N_SVG_COMPAT,
+ XML_N_FO_COMPAT,
+ XML_N_SMIL_COMPAT,
+ XML_N_SMIL_OLD,
+ XML_XFORMS_SUBMISSION,
+ XML_XFORMS_LIST_SOURCE,
+
+ XML_URI_W3_PREFIX,
+ XML_URI_XFORMS_SUFFIX,
+
+ // XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
+ // are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD. (#i49139#)
+ XML_HORIZONTAL_ON_EVEN,
+ XML_N_RPT_OASIS,
+ XML_N_RPT,
+ XML_GROUP,
+ XML_GROUPS ,
+ XML_REPORT_HEADER,
+ XML_PAGE_HEADER ,
+ XML_DETAIL ,
+ XML_PAGE_FOOTER ,
+ XML_REPORT_FOOTER,
+ XML_START_NEW_COLUMN ,
+ XML_RESET_PAGE_NUMBER ,
+ XML_PRINT_HEADER_ON_EACH_PAGE ,
+ XML_SORT_EXPRESSION ,
+ XML_GROUP_EXPRESSION ,
+ XML_GROUP_HEADER ,
+ XML_GROUP_FOOTER ,
+ XML_HEADER_ON_NEW_PAGE,
+ XML_FOOTER_ON_NEW_PAGE,
+ XML_PAGE_PRINT_OPTION,
+ XML_PRE_EVALUATED,
+ XML_COMMAND_TYPE,
+ XML_MASTER_FIELDS,
+ XML_DETAIL_FIELDS,
+ XML_CONDITIONAL_PRINT_EXPRESSION,
+ XML_REPORT_COMPONENT,
+ XML_PRINT_REPEATED_VALUES,
+ XML_REPEAT_SECTION,
+ XML_FORCE_NEW_COLUMN,
+ XML_GROUP_ON,
+ XML_FORCE_NEW_PAGE,
+ XML_GROUP_INTERVAL,
+ XML_PRINT_WHEN_GROUP_CHANGE,
+ XML_REPORT_ELEMENT,
+ XML_LIST_SOURCE,
+ XML_LIST_SOURCE_TYPE,
+ XML_IMAGE_DATA,
+ XML_SELECTED,
+ XML_CURRENT_STATE,
+ XML_IS_TRISTATE,
+ XML_ALL_PAGES,
+ XML_NOT_WITH_REPORT_HEADER,
+ XML_NOT_WITH_REPORT_FOOTER,
+ XML_NOT_WITH_REPORT_HEADER_NOR_FOOTER,
+ XML_BEFORE_SECTION,
+ XML_AFTER_SECTION,
+ XML_BEFORE_AFTER_SECTION,
+ XML_PREFIX_CHARACTERS,
+ XML_QUARTAL,
+ XML_WEEK,
+ XML_WHOLE_GROUP,
+ XML_WITH_FIRST_DETAIL,
+ XML_TOP_DOWN,
+ XML_BOTTOM_UP,
+ XML_HOUR,
+ XML_MINUTE,
+ XML_NP_RPT,
+ XML_FORMAT_CONDITION,
+ XML_EXPRESSION1,
+ XML_EXPRESSION2,
+ XML_EQUAL,
+ XML_NOT_EQUAL,
+ XML_LESS,
+ XML_GREATER,
+ XML_LESS_EQUAL,
+ XML_GREATER_EQUAL,
+ XML_BETWEEN,
+ XML_NOT_BETWEEN,
+ XML_TABLE_TEMPLATE,
+ XML_FIRST_ROW,
+ XML_LAST_ROW,
+ XML_FIRST_COLUMN,
+ XML_LAST_COLUMN,
+ XML_EVEN_ROWS,
+ XML_ODD_ROWS,
+ XML_EVEN_COLUMNS,
+ XML_ODD_COLUMNS,
+ XML_HORIZONTAL_ON_ODD,
+ // Password error from 1.4 to 2.0 Beta (#i45874#)
+ XML_RESTART_NUMBERING,
+ // OpenDocument <text:numbered-paragraph> element not supported on OpenDocument import (#i52127#)
+ XML_NUMBERED_PARAGRAPH,
+ XML_MASTER_DETAIL_FIELDS,
+ XML_MASTER_DETAIL_FIELD,
+ XML_SUB_DOCUMENT,
+ XML_FIXED_CONTENT,
+ XML_INITIAL_FORMULA,
+ XML_DEEP_TRAVERSING,
+ XML_PRESERVE_IRI,
+ XML_SORT_BY_X_VALUES,
+ XML_PAGE_CONTINUATION,
+ XML_RIGHT_ANGLED_AXES,
+ XML_SOFT_PAGE_BREAK,
+ XML_USE_SOFT_PAGE_BREAKS,
+ XML_PERCENTAGE_DATA_STYLE_NAME,
+ XML_VALUE_AND_PERCENTAGE,
+ XML_GROUP_BARS_PER_AXIS,
+ XML_INCLUDE_HIDDEN_CELLS,
+ XML_AUTOMATIC_POSITION,
+ XML_AUTOMATIC_SIZE,
+ XML_REVERSE_DIRECTION,
+ XML_LABEL_SEPARATOR,
+ XML_LABEL_POSITION,
+ XML_AVOID_OVERLAP,
+ XML_NEAR_ORIGIN,
+ XML_DEPENDENCY,
+ XML_NAV_ORDER,
+
+ XML_USE_FIRST_ROW_STYLES,
+ XML_USE_LAST_ROW_STYLES,
+ XML_USE_FIRST_COLUMN_STYLES,
+ XML_USE_LAST_COLUMN_STYLES,
+ XML_USE_BANDING_ROWS_STYLES,
+ XML_USE_BANDING_COLUMNS_STYLES,
+
+ XML_AUTOMATIC_CONTENT,
+ XML_DISPLAY_R_SQUARE,
+ XML_DISPLAY_EQUATION,
+ // db odf 12
+ XML_TABLE_REPRESENTATIONS,
+ XML_TABLE_REPRESENTATION,
+ XML_SCHEMA_DEFINITION,
+ XML_CONNECTION_DATA,
+ XML_DATABASE_DESCRIPTION,
+ XML_COMPOUND_DATABASE,
+ XML_FILE_BASED_DATABASE,
+ XML_SERVER_DATABASE,
+ XML_MEDIA_TYPE,
+ XML_HOSTNAME,
+ XML_PORT,
+ XML_LOCAL_SOCKET,
+ XML_USE_SYSTEM_USER,
+ XML_DRIVER_SETTINGS,
+ XML_JAVA_CLASSPATH,
+ XML_CHARACTER_SET,
+ XML_APPLICATION_CONNECTION_SETTINGS,
+ XML_TABLE_INCLUDE_FILTER,
+ XML_DEFAULT_ROW_STYLE_NAME,
+ XML_ANGLE_OFFSET,
+ // Core implementation for direct cross-references (#i81002#)
+ XML_NUMBER_NO_SUPERIOR,
+ XML_NUMBER_ALL_SUPERIOR,
+ XML_LIST_LEVEL_POSITION_AND_SPACE_MODE,
+ XML_LABEL_WIDTH_AND_POSITION,
+ XML_LABEL_ALIGNMENT,
+ XML_LIST_LEVEL_LABEL_ALIGNMENT,
+ XML_LABEL_FOLLOWED_BY,
+ XML_LISTTAB,
+ XML_SPACE,
+ XML_NOTHING,
+ XML_LIST_TAB_STOP_POSITION,
+ XML_STANDARD_ERROR,
+ XML_CELL_RANGE,
+ XML_ERROR_LOWER_RANGE,
+ XML_ERROR_UPPER_RANGE,
+
+ XML_CONTINUE_LIST,
+ XML_STYLE_OVERRIDE,
+
+ // fs: #i90243#
+ XML_XFORM_MODEL_SETTINGS,
+
+ // ODF 1.2 metadata
+ XML_META_FIELD,
+ XML_ABOUT,
+ XML_DATATYPE,
+ XML_TRANSFORMATION,
+
+ // ODF 1.2 numbered-paragraph
+ XML_LIST_ID,
+
+ XML_TREAT_EMPTY_CELLS,
+ XML_LEAVE_GAP,
+ XML_USE_ZERO,
+ XML_IGNORE,
+
+ // enhanced fields
+ XML_FIELDMARK,
+ XML_FIELDMARK_START,
+ XML_FIELDMARK_END,
+ XML_N_FIELD,
+ XML_NP_FIELD,
+
+ XML_IMAGE_SCALE,
+ XML_ISOTROPIC,
+ XML_ANISOTROPIC,
+
+ XML_AXIS_POSITION,
+ XML_AXIS_LABEL_POSITION,
+ XML_NEAR_AXIS,
+ XML_NEAR_AXIS_OTHER_SIDE,
+ XML_OUTSIDE_START,
+ XML_OUTSIDE_END,
+ XML_TICK_MARK_POSITION,
+ XML_AT_LABELS,
+ XML_AT_AXIS,
+ XML_AT_LABELS_AND_AXIS,
+ XML_FILLED_RADAR,
+ XML_SURFACE,
+
+ // MathML only
+ XML_MATHVARIANT,
+ XML_MATHSIZE,
+ XML_MATHWEIGHT,
+ XML_MATHCOLOR,
+
+ XML_CONTAINS,
+ XML_DOES_NOT_CONTAIN,
+ XML_BEGINS_WITH,
+ XML_DOES_NOT_BEGIN_WITH,
+ XML_ENDS_WITH,
+ XML_DOES_NOT_END_WITH,
+
+ //chart
+ XML_NP_CHART_EXT,
+ XML_N_CHART_EXT,
+ XML_COORDINATE_REGION,
+
+ XML_DIAGONAL_BL_TR_WIDTHS,
+ XML_DIAGONAL_TL_BR_WIDTHS,
+
+ XML_OUTSIDE_MINIMUM,//#i114142#
+ XML_OUTSIDE_MAXIMUM,//#i114142#
+
+ XML_LEGEND_EXPANSION, //#i28760#
+ XML_LEGEND_EXPANSION_ASPECT_RATIO, //#i28760#
+ XML_BALANCED, //#i28760#
+ XML_HIGH, //#i28760#
+ XML_WIDE, //#i28760#
+
+ XML_AXIS_TYPE, //#i25706#
+ XML_DATE_SCALE,
+ XML_BASE_TIME_UNIT,
+ XML_MAJOR_INTERVAL_VALUE,
+ XML_MINOR_INTERVAL_VALUE,
+ XML_MAJOR_INTERVAL_UNIT,
+ XML_MINOR_INTERVAL_UNIT,
+
+ XML_MIN_VALUE,
+ XML_MAX_VALUE,
+
+ XML_MARGIN, // #i117001#
+
+ // regina, ODF1.2 additional symbols in charts
+ XML_STAR,
+ XML_ASTERISK,
+ XML_HORIZONTAL_BAR,
+ XML_VERTICAL_BAR,
+
+ XML_ERROR_STANDARD_WEIGHT, // errorbar standard deviation error weight
+ XML_TOKEN_END
+ };
+
+
+ /// return the OUString representation for eToken
+ XMLOFF_DLLPUBLIC const OUString& GetXMLToken(
+ enum XMLTokenEnum eToken );
+
+ /// compare eToken to the string
+ XMLOFF_DLLPUBLIC sal_Bool IsXMLToken(
+ const OUString& rString,
+ enum XMLTokenEnum eToken );
+
+ // gives all allocated memory for OUString* back
+ XMLOFF_DLLPUBLIC void ResetTokens();
+
+ XMLOFF_DLLPUBLIC void IncRescheduleCount();
+
+ XMLOFF_DLLPUBLIC void DecRescheduleCount();
+
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmltypes.hxx b/include/xmloff/xmltypes.hxx
new file mode 100644
index 000000000000..c20394fd934e
--- /dev/null
+++ b/include/xmloff/xmltypes.hxx
@@ -0,0 +1,283 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _XMLOFF_XMLTYPES_HXX
+#define _XMLOFF_XMLTYPES_HXX
+
+///////////////////////////////////////////////////////////////////////////////
+// Flags to specify how to im/export the property
+//
+// OLD:
+// 8421.8421.8421.8421.8421.8421.8421.8421
+// n n m mmmd m baaa tttt.tttt.tttt
+// spsp eep paef e ppp tttt.tttt.tttt
+// iiee iei ieie i ppp tttt.tttt.tttt
+// NOW:
+// n n mm mmdm pp ppba aatt.tttt.tttt
+// spsp eepp aefe p pptt.tttt.tttt
+// iiee ieii eiei p pptt.tttt.tttt
+
+#define MID_FLAG_MASK 0x00003fff
+
+// Import only: the xml attribute's value is evaluated by a call to
+// handleSpecialItem instead of calling the property handler's importXML method
+#define MID_FLAG_SPECIAL_ITEM_IMPORT 0x80000000
+
+// Export only: the property's value is exported by a call to handleSpecialItem
+// instead of calling the property handler's exportXML method
+#define MID_FLAG_SPECIAL_ITEM_EXPORT 0x20000000
+#define MID_FLAG_SPECIAL_ITEM 0xa0000000 // both import and export
+
+// the map entry denotes the name of an element item
+#define MID_FLAG_ELEMENT_ITEM_IMPORT 0x08000000
+#define MID_FLAG_ELEMENT_ITEM_EXPORT 0x04000000
+#define MID_FLAG_ELEMENT_ITEM 0x0c000000 // both import and export
+
+// the attribute is ignored (not yet implemented)
+#define MID_FLAG_NO_PROPERTY_IMPORT 0x40000000
+
+// the property is ignored
+#define MID_FLAG_NO_PROPERTY_EXPORT 0x10000000
+#define MID_FLAG_NO_PROPERTY 0x50000000 // both import and export
+
+// Import only: there are more entries for the same xml attribute existing
+#define MID_FLAG_MULTI_PROPERTY 0x02000000 //
+
+// Import only: If a property with the same name has been set already, supply
+// the current value to the importXML call.
+#define MID_FLAG_MERGE_PROPERTY 0x01000000
+
+// Export only: If an xml attribute with the same name has been exported
+// already, supply its value to the exportXML call and delete the existing
+// atribute afterwards.
+#define MID_FLAG_MERGE_ATTRIBUTE 0x00800000
+
+// Import and Export: The property in question must exist. No call to
+// hasPropertyByName is required.
+#define MID_FLAG_MUST_EXIST 0x00400000
+
+// Export only: When exporting defaults, export this property even if it is
+// not set
+#define MID_FLAG_DEFAULT_ITEM_EXPORT 0x00200000
+
+// Import only: In general, properties may not throw exception, but
+// this one may. If it throws an IllegalArgumentException, it will be
+// silently ignored. This should be used for properties whose values
+// cannot be checked. (E.g., the printer paper tray: The tray names
+// are different for all printers, and we don't know ahead whether a
+// printer supports the trays in the current document.)
+#define MID_FLAG_PROPERTY_MAY_EXCEPT 0x00100000
+
+#define XML_TYPE_PROP_SHIFT 14
+#define XML_TYPE_PROP_MASK (0xf << XML_TYPE_PROP_SHIFT)
+
+#define XML_TYPE_PROP_START (0x1 << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_GRAPHIC (0x1 << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_DRAWING_PAGE (0x2 << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_PAGE_LAYOUT (0x3 << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_HEADER_FOOTER (0x4 << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_TEXT (0x5 << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_PARAGRAPH (0x6 << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_RUBY (0x7 << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_SECTION (0x8 << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_TABLE (0x9 << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_TABLE_COLUMN (0xa << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_TABLE_ROW (0xb << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_TABLE_CELL (0xc << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_LIST_LEVEL (0xd << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_CHART (0xe << XML_TYPE_PROP_SHIFT)
+#define XML_TYPE_PROP_END (0xf << XML_TYPE_PROP_SHIFT)
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// XML-data-type-ID's
+//
+
+// simple types, no special compare necessary
+#define XML_TYPE_BUILDIN_CMP 0x00002000
+
+// basic types (all also XML_TYPE_BUILDIN_CMP)
+#define XML_TYPE_BOOL 0x00002001 // true/false
+#define XML_TYPE_MEASURE 0x00002002 // 1cm
+#define XML_TYPE_MEASURE8 0x00002003 // 1cm
+#define XML_TYPE_MEASURE16 0x00002004 // 1cm
+#define XML_TYPE_PERCENT 0x00002005 // 50%
+#define XML_TYPE_PERCENT8 0x00002006 // 50%
+#define XML_TYPE_PERCENT16 0x00002007 // 50%
+#define XML_TYPE_STRING 0x00002008 // "blablabla"
+#define XML_TYPE_COLOR 0x00002009 // Colors
+#define XML_TYPE_NUMBER 0x0000200a // 123
+#define XML_TYPE_NUMBER8 0x0000200b // 123
+#define XML_TYPE_NUMBER16 0x0000200c // 123
+#define XML_TYPE_NUMBER_NONE 0x0000200d // 123 and "no-limit" for 0
+#define XML_TYPE_DOUBLE 0x0000200e // for doubles
+#define XML_TYPE_NBOOL 0x0000200f // !true/false
+#define XML_TYPE_COLORTRANSPARENT 0x00002010 // Colors or "transparent"
+#define XML_TYPE_ISTRANSPARENT 0x00002011 // "transparent"
+#define XML_TYPE_BUILDIN_CMP_ONLY 0x00002012 // Only buildin comparison is required, so no handler exists
+#define XML_TYPE_NUMBER8_NONE 0x00002013 // 123 and "no-limit" for 0
+#define XML_TYPE_NUMBER16_NONE 0x00002014 // 123 and "no-limit" for 0
+#define XML_TYPE_COLOR_MODE 0x00002015
+#define XML_TYPE_DURATION16_MS 0x00002016 // PT00H00M01S to ms in sal_Int16
+#define XML_TYPE_MEASURE_PX 0x00002017 // 1px
+#define XML_TYPE_COLORAUTO 0x00002018 // color if not -1
+#define XML_TYPE_ISAUTOCOLOR 0x00002019 // true if -1
+#define XML_TYPE_STYLENAME 0x00002020 // "blablabla"
+#define XML_TYPE_NEG_PERCENT 0x00002021 // (100-x)%
+#define XML_TYPE_NEG_PERCENT8 0x00002022 // (100-x)%
+#define XML_TYPE_NEG_PERCENT16 0x00002023 // (100-x)
+#define XML_TYPE_DOUBLE_PERCENT 0x00002024 // 50% (source is a double from 0.0 to 1.0)
+#define XML_TYPE_HEX 0x00002025 // 00544F1B
+
+// special basic types
+#define XML_TYPE_RECTANGLE_LEFT 0x00000100 // the Left member of a awt::Rectangle as a measure
+#define XML_TYPE_RECTANGLE_TOP 0x00000101 // the Top member of a awt::Rectangle as a measure
+#define XML_TYPE_RECTANGLE_WIDTH 0x00000102 // the Width member of a awt::Rectangle as a measure
+#define XML_TYPE_RECTANGLE_HEIGHT 0x00000103 // the Height member of a awt::Rectangle as a measure
+
+#define XML_TYPE_APP_SHIFT 10
+#define XML_SC_TYPES_START (0x1 << XML_TYPE_APP_SHIFT)
+#define XML_SD_TYPES_START (0x2 << XML_TYPE_APP_SHIFT)
+
+#define XML_TEXT_TYPES_START (0x3 << XML_TYPE_APP_SHIFT)
+#define XML_TYPE_TEXT_CROSSEDOUT_STYLE (XML_TEXT_TYPES_START + 0)
+#define XML_TYPE_TEXT_CASEMAP (XML_TEXT_TYPES_START + 1)
+#define XML_TYPE_TEXT_FONTFAMILYNAME (XML_TEXT_TYPES_START + 2)
+#define XML_TYPE_TEXT_FONTFAMILY (XML_TEXT_TYPES_START + 3)
+#define XML_TYPE_TEXT_FONTENCODING (XML_TEXT_TYPES_START + 4)
+#define XML_TYPE_TEXT_FONTPITCH (XML_TEXT_TYPES_START + 5)
+#define XML_TYPE_TEXT_KERNING (XML_TEXT_TYPES_START + 6)
+#define XML_TYPE_TEXT_POSTURE (XML_TEXT_TYPES_START + 7)
+#define XML_TYPE_TEXT_SHADOWED (XML_TEXT_TYPES_START + 8)
+#define XML_TYPE_TEXT_UNDERLINE_STYLE (XML_TEXT_TYPES_START + 9)
+#define XML_TYPE_TEXT_WEIGHT (XML_TEXT_TYPES_START + 10)
+#define XML_TYPE_TEXT_SPLIT (XML_TEXT_TYPES_START + 11)
+#define XML_TYPE_TEXT_BREAKBEFORE (XML_TEXT_TYPES_START + 12)
+#define XML_TYPE_TEXT_BREAKAFTER (XML_TEXT_TYPES_START + 13)
+#define XML_TYPE_TEXT_SHADOW (XML_TEXT_TYPES_START + 14)
+#define XML_TYPE_TEXT_ADJUST (XML_TEXT_TYPES_START + 15)
+#define XML_TYPE_TEXT_ADJUSTLAST (XML_TEXT_TYPES_START + 16)
+#define XML_TYPE_TEXT_CASEMAP_VAR (XML_TEXT_TYPES_START + 17)
+#define XML_TYPE_TEXT_ESCAPEMENT (XML_TEXT_TYPES_START + 18)
+#define XML_TYPE_TEXT_ESCAPEMENT_HEIGHT (XML_TEXT_TYPES_START + 19)
+#define XML_TYPE_CHAR_HEIGHT (XML_TEXT_TYPES_START + 20)
+#define XML_TYPE_CHAR_HEIGHT_PROP (XML_TEXT_TYPES_START + 21)
+#define XML_TYPE_CHAR_LANGUAGE (XML_TEXT_TYPES_START + 22)
+#define XML_TYPE_CHAR_COUNTRY (XML_TEXT_TYPES_START + 23)
+#define XML_TYPE_LINE_SPACE_FIXED (XML_TEXT_TYPES_START + 24)
+#define XML_TYPE_LINE_SPACE_MINIMUM (XML_TEXT_TYPES_START + 25)
+#define XML_TYPE_LINE_SPACE_DISTANCE (XML_TEXT_TYPES_START + 26)
+#define XML_TYPE_BORDER (XML_TEXT_TYPES_START + 27)
+#define XML_TYPE_BORDER_WIDTH (XML_TEXT_TYPES_START + 28)
+#define XML_TYPE_TEXT_DROPCAP (XML_TEXT_TYPES_START + 29)
+#define XML_TYPE_TEXT_TABSTOP (XML_TEXT_TYPES_START + 30)
+#define XML_TYPE_TEXT_BOOLCROSSEDOUT (XML_TEXT_TYPES_START + 31)
+#define XML_TYPE_TEXT_WRAP (XML_TEXT_TYPES_START + 32)
+#define XML_TYPE_TEXT_PARAGRAPH_ONLY (XML_TEXT_TYPES_START + 33)
+#define XML_TYPE_TEXT_WRAP_OUTSIDE (XML_TEXT_TYPES_START + 34)
+#define XML_TYPE_TEXT_OPAQUE (XML_TEXT_TYPES_START + 35)
+#define XML_TYPE_TEXT_PROTECT_CONTENT (XML_TEXT_TYPES_START + 36)
+#define XML_TYPE_TEXT_PROTECT_SIZE (XML_TEXT_TYPES_START + 37)
+#define XML_TYPE_TEXT_PROTECT_POSITION (XML_TEXT_TYPES_START + 38)
+#define XML_TYPE_TEXT_ANCHOR_TYPE (XML_TEXT_TYPES_START + 39)
+#define XML_TYPE_TEXT_COLUMNS (XML_TEXT_TYPES_START + 40)
+#define XML_TYPE_TEXT_HORIZONTAL_POS (XML_TEXT_TYPES_START + 41)
+#define XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED (XML_TEXT_TYPES_START + 42)
+#define XML_TYPE_TEXT_HORIZONTAL_REL (XML_TEXT_TYPES_START + 43)
+#define XML_TYPE_TEXT_HORIZONTAL_REL_FRAME (XML_TEXT_TYPES_START + 44)
+#define XML_TYPE_TEXT_HORIZONTAL_MIRROR (XML_TEXT_TYPES_START + 45)
+#define XML_TYPE_TEXT_VERTICAL_POS (XML_TEXT_TYPES_START + 46)
+#define XML_TYPE_TEXT_VERTICAL_REL (XML_TEXT_TYPES_START + 47)
+#define XML_TYPE_TEXT_VERTICAL_REL_PAGE (XML_TEXT_TYPES_START + 48)
+#define XML_TYPE_TEXT_VERTICAL_REL_FRAME (XML_TEXT_TYPES_START + 49)
+#define XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR (XML_TEXT_TYPES_START + 50)
+#define XML_TYPE_TEXT_MIRROR_VERTICAL (XML_TEXT_TYPES_START + 51)
+#define XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT (XML_TEXT_TYPES_START + 52)
+#define XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT (XML_TEXT_TYPES_START + 53)
+#define XML_TYPE_TEXT_CLIP11 (XML_TEXT_TYPES_START + 54)
+#define XML_TYPE_ATTRIBUTE_CONTAINER (XML_TEXT_TYPES_START + 55 )
+#define XML_TYPE_CHAR_HEIGHT_DIFF (XML_TEXT_TYPES_START + 56)
+#define XML_TYPE_TEXT_EMPHASIZE (XML_TEXT_TYPES_START + 57)
+#define XML_TYPE_TEXT_COMBINE (XML_TEXT_TYPES_START + 58)
+#define XML_TYPE_TEXT_COMBINECHAR (XML_TEXT_TYPES_START + 59)
+#define XML_TYPE_TEXT_UNDERLINE_COLOR (XML_TEXT_TYPES_START + 60)
+#define XML_TYPE_TEXT_UNDERLINE_HASCOLOR (XML_TEXT_TYPES_START + 61)
+#define XML_TYPE_TEXT_AUTOSPACE (XML_TEXT_TYPES_START + 62)
+#define XML_TYPE_TEXT_PUNCTUATION_WRAP (XML_TEXT_TYPES_START + 63)
+#define XML_TYPE_TEXT_LINE_BREAK (XML_TEXT_TYPES_START + 64)
+
+#define XML_TYPE_TEXT_ALIGN (XML_TEXT_TYPES_START + 65)
+#define XML_TYPE_FONT_WIDTH (XML_TEXT_TYPES_START + 66)
+#define XML_TYPE_ROTATION_ANGLE (XML_TEXT_TYPES_START + 67)
+#define XML_TYPE_CONTROL_BORDER (XML_TEXT_TYPES_START + 68)
+#define XML_TYPE_TEXT_REL_WIDTH_HEIGHT (XML_TEXT_TYPES_START + 69)
+#define XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT (XML_TEXT_TYPES_START + 70)
+#define XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN (XML_TEXT_TYPES_START + 71)
+#define XML_TYPE_TEXT_COMBINE_CHARACTERS (XML_TEXT_TYPES_START + 72)
+#define XML_TYPE_TEXT_ANIMATION (XML_TEXT_TYPES_START + 73)
+#define XML_TYPE_TEXT_ANIMATION_DIRECTION (XML_TEXT_TYPES_START + 74)
+#define XML_TYPE_TEXT_HORIZONTAL_ADJUST (XML_TEXT_TYPES_START + 75)
+#define XML_TYPE_TEXT_RUBY_ADJUST (XML_TEXT_TYPES_START + 76)
+#define XML_TYPE_TEXT_FONT_RELIEF (XML_TEXT_TYPES_START + 77)
+#define XML_TYPE_TEXT_ROTATION_ANGLE (XML_TEXT_TYPES_START + 78)
+#define XML_TYPE_TEXT_ROTATION_SCALE (XML_TEXT_TYPES_START + 79)
+#define XML_TYPE_TEXT_VERTICAL_ALIGN (XML_TEXT_TYPES_START + 80)
+#define XML_TYPE_TEXT_DRAW_ASPECT (XML_TEXT_TYPES_START + 81)
+#define XML_TYPE_CONTROL_TEXT_EMPHASIZE (XML_TEXT_TYPES_START + 82)
+#define XML_TYPE_TEXT_RUBY_POSITION (XML_TEXT_TYPES_START + 83)
+#define XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR (XML_TEXT_TYPES_START + 84)
+#define XML_TYPE_TEXT_WRITING_MODE (XML_TEXT_TYPES_START + 85)
+#define XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT (XML_TEXT_TYPES_START + 86)
+#define XML_TYPE_LAYOUT_GRID_MODE (XML_TEXT_TYPES_START + 87)
+#define XML_TYPE_TEXT_HIDDEN_AS_DISPLAY (XML_TEXT_TYPES_START + 88)
+#define XML_TYPE_CONTROL_BORDER_COLOR (XML_TEXT_TYPES_START + 89)
+#define XML_TYPE_BORDER_MODEL (XML_TEXT_TYPES_START + 90)
+#define XML_TYPE_TEXT_LINE_MODE (XML_TEXT_TYPES_START + 91)
+#define XML_TYPE_TEXT_UNDERLINE_TYPE (XML_TEXT_TYPES_START + 92)
+#define XML_TYPE_TEXT_UNDERLINE_WIDTH (XML_TEXT_TYPES_START + 93)
+#define XML_TYPE_TEXT_CROSSEDOUT_TYPE (XML_TEXT_TYPES_START + 94)
+#define XML_TYPE_TEXT_CROSSEDOUT_WIDTH (XML_TEXT_TYPES_START + 95)
+#define XML_TYPE_TEXT_CROSSEDOUT_TEXT (XML_TEXT_TYPES_START + 96)
+#define XML_TYPE_TEXT_KEEP (XML_TEXT_TYPES_START + 97)
+#define XML_TYPE_TEXT_NKEEP (XML_TEXT_TYPES_START + 98)
+#define XML_TYPE_WRAP_INFLUENCE_ON_POSITION (XML_TEXT_TYPES_START + 99)
+#define XML_TYPE_WRAP_OPTION (XML_TEXT_TYPES_START + 100)
+#define XML_TYPE_TEXT_NUMBER8_ONE_BASED (XML_TEXT_TYPES_START + 101)
+#define XML_TYPE_NUMBER_NO_ZERO (XML_TEXT_TYPES_START + 102)
+#define XML_TYPE_NUMBER8_NO_ZERO (XML_TEXT_TYPES_START + 103)
+#define XML_TYPE_NUMBER16_NO_ZERO (XML_TEXT_TYPES_START + 104)
+#define XML_TYPE_NUMBER16_AUTO (XML_TEXT_TYPES_START + 105)
+#define XML_TYPE_TEXT_SOFT_PAGE_BREAK (XML_TEXT_TYPES_START + 106)
+#define XML_TYPE_TEXT_USE_SOFT_PAGE_BREAKS (XML_TEXT_TYPES_START + 107)
+#define XML_TYPE_TEXT_CLIP (XML_TEXT_TYPES_START + 108)
+#define XML_TYPE_TEXT_OVERLINE_TYPE (XML_TEXT_TYPES_START + 109)
+#define XML_TYPE_TEXT_OVERLINE_STYLE (XML_TEXT_TYPES_START + 110)
+#define XML_TYPE_TEXT_OVERLINE_WIDTH (XML_TEXT_TYPES_START + 111)
+#define XML_TYPE_TEXT_OVERLINE_COLOR (XML_TEXT_TYPES_START + 112)
+#define XML_TYPE_TEXT_OVERLINE_HASCOLOR (XML_TEXT_TYPES_START + 113)
+#define XML_TYPE_BOOL_FALSE (XML_TEXT_TYPES_START + 114)
+#define XML_TYPE_FILLSTYLE (XML_TEXT_TYPES_START + 115)
+
+#define XML_SCH_TYPES_START (0x4 << XML_TYPE_APP_SHIFT)
+#define XML_PM_TYPES_START (0x5 << XML_TYPE_APP_SHIFT) // page master
+#define XML_DB_TYPES_START (0x6 << XML_TYPE_APP_SHIFT)
+
+#endif // _XMLOFF_XMLTYPES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmluconv.hxx b/include/xmloff/xmluconv.hxx
new file mode 100644
index 000000000000..bc4ddb6b6dbd
--- /dev/null
+++ b/include/xmloff/xmluconv.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 _XMLOFF_XMLUCONV_HXX
+#define _XMLOFF_XMLUCONV_HXX
+
+#include "sal/config.h"
+#include "xmloff/dllapi.h"
+#include "sal/types.h"
+
+#include <memory>
+#include <limits.h>
+#include <boost/utility.hpp>
+
+#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <tools/solar.h>
+#include <xmloff/xmlement.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/drawing/Position3D.hpp>
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class Time;
+
+namespace com { namespace sun { namespace star {
+ namespace util { struct DateTime; }
+ namespace text { class XNumberingTypeInfo; }
+}}}
+
+namespace basegfx
+{
+ class B3DVector;
+} // end of namespace basegfx
+
+class XMLOFF_DLLPUBLIC SvXMLTokenEnumerator
+{
+private:
+ const OUString& maTokenString;
+ sal_Int32 mnNextTokenPos;
+ sal_Unicode mcSeperator;
+
+public:
+ SvXMLTokenEnumerator( const OUString& rString, sal_Unicode cSeperator = sal_Unicode(' ') );
+
+ sal_Bool getNextToken( OUString& rToken );
+};
+
+/** the SvXMLTypeConverter converts values of various types from
+ their internal represantation to the textual form used in xml
+ and back.
+ Most of the methods are static but the SvXMLTypeConverter can
+ also store default units for both numerical and textual measures.
+
+ @attention:
+ a lot of the methods here have been moved to <sax/tools/converter.hxx>!
+*/
+
+class XMLOFF_DLLPUBLIC SvXMLUnitConverter
+ : private ::boost::noncopyable
+{
+private:
+ struct Impl;
+ ::std::auto_ptr<Impl> m_pImpl;
+
+public:
+ /** constructs a SvXMLUnitConverter. The core measure unit is the
+ default unit for numerical measures, the XML measure unit is
+ the default unit for textual measures */
+ SvXMLUnitConverter(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& xContext,
+ sal_Int16 eCoreMeasureUnit,
+ sal_Int16 eXMLMeasureUnit);
+
+ virtual ~SvXMLUnitConverter();
+
+ static sal_Int16 GetMeasureUnit(sal_Int16 const nFieldUnit);
+
+ /** sets the default unit for numerical measures */
+ void SetCoreMeasureUnit( sal_Int16 const eCoreMeasureUnit );
+
+ /** sets the default unit for textual measures */
+ void SetXMLMeasureUnit( sal_Int16 const eXMLMeasureUnit );
+
+ /** gets the default unit for textual measures */
+ sal_Int16 GetXMLMeasureUnit() const;
+
+ /** gets XNumberingTypeInfo */
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XNumberingTypeInfo >& getNumTypeInfo() const;
+
+ /** convert string to measure with meCoreMeasureUnit,
+ using optional min and max values*/
+ bool convertMeasureToCore( sal_Int32& rValue,
+ const OUString& rString,
+ sal_Int32 nMin = SAL_MIN_INT32,
+ sal_Int32 nMax = SAL_MAX_INT32) const;
+
+ /** convert measure to string: from meCoreMeasureUnit to meXMLMeasureUnit */
+ void convertMeasureToXML( OUStringBuffer& rBuffer,
+ sal_Int32 nMeasure ) const;
+
+ /** convert string to enum using given enum map, if the enum is
+ not found in the map, this method will return false */
+ static sal_Bool convertEnum( sal_uInt16& rEnum,
+ const OUString& rValue,
+ const SvXMLEnumMapEntry *pMap );
+
+ /** convert string to enum using given token map, if the enum is
+ not found in the map, this method will return false */
+ static sal_Bool convertEnum( sal_uInt16& rEnum,
+ const OUString& rValue,
+ const SvXMLEnumStringMapEntry *pMap );
+
+ /** convert enum to string using given enum map with an optional
+ default token. If the enum is not found in the map,
+ this method will either use the given default or return
+ false if not default is set */
+ static sal_Bool convertEnum( OUStringBuffer& rBuffer,
+ unsigned int nValue,
+ const SvXMLEnumMapEntry *pMap,
+ enum ::xmloff::token::XMLTokenEnum eDefault =
+ ::xmloff::token::XML_TOKEN_INVALID );
+
+ /** convert double number to string (using ::rtl::math) and DO
+ convert to export MapUnit using meCoreMeasureUnit/meXMLMeasureUnit */
+ void convertDouble(OUStringBuffer& rBuffer,
+ double fNumber, sal_Bool bWriteUnits) const;
+
+ /** convert string to double number (using ::rtl::math) and DO convert. */
+ sal_Bool convertDouble(double& rValue, const OUString& rString, sal_Bool bLookForUnits) const;
+
+ /** get the Null Date of the XModel and set it to the UnitConverter */
+ sal_Bool setNullDate (
+ const com::sun::star::uno::Reference <com::sun::star::frame::XModel>& xModel);
+
+ /** convert double to ISO Date Time String */
+ void convertDateTime( OUStringBuffer& rBuffer,
+ const double& fDateTime,
+ bool const bAddTimeIf0AM = false);
+
+ /** convert ISO Date Time String to double */
+ bool convertDateTime(double& fDateTime,
+ const OUString& rString);
+
+ /// these 2 functions use tools Date, so they're not yet moved to sax
+
+ /** convert double to ISO Date Time String */
+ static void convertDateTime( OUStringBuffer& rBuffer,
+ const double& fDateTime,
+ const com::sun::star::util::Date& aNullDate,
+ sal_Bool bAddTimeIf0AM=sal_False);
+ /** convert ISO Date Time String to double */
+ static sal_Bool convertDateTime( double& fDateTime,
+ const OUString& rString,
+ const com::sun::star::util::Date& aNullDate);
+
+
+ /** convert string to ::basegfx::B3DVector */
+ static sal_Bool convertB3DVector( ::basegfx::B3DVector& rVector,
+ const OUString& rValue );
+
+ /** convert B3DVector to string */
+ static void convertB3DVector( OUStringBuffer &rBuffer,
+ const ::basegfx::B3DVector& rVector );
+
+ /** convert string to Position3D */
+ sal_Bool convertPosition3D( com::sun::star::drawing::Position3D& rPosition,
+ const OUString& rValue );
+
+ /** convert Position3D to string */
+ void convertPosition3D( OUStringBuffer &rBuffer,
+ const com::sun::star::drawing::Position3D& rVector );
+
+
+ /** convert num-forat and num-letter-sync values to NumberingType */
+ sal_Bool convertNumFormat( sal_Int16& rType,
+ const OUString& rNumFormat,
+ const OUString& rNumLetterSync,
+ sal_Bool bNumberNone = sal_False ) const;
+
+ /** convert NumberingType to num-forat and num-letter-sync values */
+ void convertNumFormat( OUStringBuffer& rBuffer,
+ sal_Int16 nType ) const;
+ void convertNumLetterSync( OUStringBuffer& rBuffer,
+ sal_Int16 nType ) const;
+
+ static void convertPropertySet(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rProps,
+ const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& aProperties);
+ static void convertPropertySet(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& rProperties,
+ const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
+
+ OUString encodeStyleName( const OUString& rName,
+ sal_Bool *pEncoded=0 ) const;
+ /** convert string (hex) to number (sal_uInt32) */
+ static sal_Bool convertHex( sal_uInt32& nVal,
+ const OUString& rValue );
+
+ /** convert number (sal_uInt32) to string (hex) */
+ static void convertHex( OUStringBuffer& rBuffer,
+ sal_uInt32 nVal );
+
+};
+
+#endif // _XMLOFF_XMLUCONV_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmlreader/README b/include/xmlreader/README
new file mode 100644
index 000000000000..41b43e7e8882
--- /dev/null
+++ b/include/xmlreader/README
@@ -0,0 +1,28 @@
+#**************************************************************
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#**************************************************************
+
+<http://qa.openoffice.org/issues/show_bug.cgi?id=115203>: "Issue 113189
+extracted xmlreader from configmgr, to make the former available within URE.
+The xmlreader library is for now considered a private part of URE (cf.
+ure/source/README), for simplicity uses OOO_DLLPUBLIC_XMLREADER-based symbol
+visibility (and thus no symbol versioning), but is of course used from outside
+URE in configmgr. This works as long as its ABI does not change. If it ever
+changes, symbol versioning will have to be added (in some form or other)."
diff --git a/include/xmlreader/detail/xmlreaderdllapi.hxx b/include/xmlreader/detail/xmlreaderdllapi.hxx
new file mode 100644
index 000000000000..6325bdbe71bd
--- /dev/null
+++ b/include/xmlreader/detail/xmlreaderdllapi.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_XMLREADER_DETAIL_XMLREADERDLLAPI_HXX
+#define INCLUDED_XMLREADER_DETAIL_XMLREADERDLLAPI_HXX
+
+#include "sal/config.h"
+
+#include "sal/types.h"
+
+#if defined OOO_DLLIMPLEMENTATION_XMLREADER
+#define OOO_DLLPUBLIC_XMLREADER SAL_DLLPUBLIC_EXPORT
+#else
+#define OOO_DLLPUBLIC_XMLREADER SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmlreader/pad.hxx b/include/xmlreader/pad.hxx
new file mode 100644
index 000000000000..0b8e1f3b7453
--- /dev/null
+++ b/include/xmlreader/pad.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_XMLREADER_PAD_HXX
+#define INCLUDED_XMLREADER_PAD_HXX
+
+#include "sal/config.h"
+
+#include "rtl/strbuf.hxx"
+#include "sal/types.h"
+#include "xmlreader/detail/xmlreaderdllapi.hxx"
+#include "xmlreader/span.hxx"
+
+namespace xmlreader {
+
+class OOO_DLLPUBLIC_XMLREADER Pad {
+public:
+ void add(char const * begin, sal_Int32 length);
+
+ void addEphemeral(char const * begin, sal_Int32 length);
+
+ void clear();
+
+ Span get() const;
+
+private:
+ SAL_DLLPRIVATE void flushSpan();
+
+ Span span_;
+ OStringBuffer buffer_;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmlreader/span.hxx b/include/xmlreader/span.hxx
new file mode 100644
index 000000000000..4f3e4d1c285d
--- /dev/null
+++ b/include/xmlreader/span.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_XMLREADER_SPAN_HXX
+#define INCLUDED_XMLREADER_SPAN_HXX
+
+#include "sal/config.h"
+
+#include "rtl/string.hxx"
+#include "rtl/stringutils.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "xmlreader/detail/xmlreaderdllapi.hxx"
+
+namespace xmlreader {
+
+struct OOO_DLLPUBLIC_XMLREADER Span {
+ char const * begin;
+ sal_Int32 length;
+
+ inline Span(): begin(0), length(0) {}
+ // init length to avoid compiler warnings
+
+ inline Span(char const * theBegin, sal_Int32 theLength):
+ begin(theBegin), length(theLength) {}
+
+ inline void clear() throw() { begin = 0; }
+
+ inline bool is() const { return begin != 0; }
+
+ inline bool equals(Span const & text) const {
+ return rtl_str_compare_WithLength(
+ begin, length, text.begin, text.length) == 0;
+ }
+
+ inline bool equals(char const * textBegin, sal_Int32 textLength) const {
+ return equals(Span(textBegin, textLength));
+ }
+
+ inline bool equals(OString const & text) const {
+ return rtl_str_compare_WithLength(
+ begin, length, text.getStr(), text.getLength()) == 0;
+ }
+
+ /**
+ @overload
+ This function accepts an ASCII string literal as its argument.
+ */
+ template< typename T > bool
+ equals( T& literal, typename rtl::internal::ConstCharArrayDetector< T, rtl::internal::Dummy >::Type = rtl::internal::Dummy() ) SAL_THROW(())
+ {
+ assert( strlen( literal ) == rtl::internal::ConstCharArrayDetector< T >::size - 1 );
+ return rtl_str_compare_WithLength( begin, length, literal, rtl::internal::ConstCharArrayDetector< T, void >::size - 1 ) == 0;
+ }
+
+ OUString convertFromUtf8() const;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmlreader/xmlreader.hxx b/include/xmlreader/xmlreader.hxx
new file mode 100644
index 000000000000..90770a9432da
--- /dev/null
+++ b/include/xmlreader/xmlreader.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_XMLREADER_XMLREADER_HXX
+#define INCLUDED_XMLREADER_XMLREADER_HXX
+
+#include "sal/config.h"
+
+#include <stack>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "osl/file.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "xmlreader/detail/xmlreaderdllapi.hxx"
+#include "xmlreader/pad.hxx"
+#include "xmlreader/span.hxx"
+
+namespace xmlreader {
+
+class OOO_DLLPUBLIC_XMLREADER XmlReader: private boost::noncopyable {
+public:
+ explicit XmlReader(OUString const & fileUrl)
+ SAL_THROW((
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::uno::RuntimeException));
+
+ ~XmlReader();
+
+ enum { NAMESPACE_NONE = -2, NAMESPACE_UNKNOWN = -1, NAMESPACE_XML = 0 };
+
+ enum Text { TEXT_NONE, TEXT_RAW, TEXT_NORMALIZED };
+
+ enum Result { RESULT_BEGIN, RESULT_END, RESULT_TEXT, RESULT_DONE };
+
+ int registerNamespaceIri(Span const & iri);
+
+ // RESULT_BEGIN: data = localName, ns = ns
+ // RESULT_END: data, ns unused
+ // RESULT_TEXT: data = text, ns unused
+ Result nextItem(Text reportText, Span * data, int * nsId);
+
+ bool nextAttribute(int * nsId, Span * localName);
+
+ // the span returned by getAttributeValue is only valid until the next call
+ // to nextItem or getAttributeValue
+ Span getAttributeValue(bool fullyNormalize);
+
+ int getNamespaceId(Span const & prefix) const;
+
+ OUString getUrl() const;
+
+private:
+ typedef std::vector< Span > NamespaceIris;
+
+ // If NamespaceData (and similarly ElementData and AttributeData) is made
+ // SAL_DLLPRIVATE, at least gcc 4.2.3 erroneously warns about
+ // "'xmlreader::XmlReader' declared with greater visibility than the type of
+ // its field 'xmlreader::XmlReader::namespaces_'" (and similarly for
+ // elements_ and attributes_):
+
+ struct NamespaceData {
+ Span prefix;
+ int nsId;
+
+ NamespaceData() {}
+
+ NamespaceData(Span const & thePrefix, int theNsId):
+ prefix(thePrefix), nsId(theNsId) {}
+ };
+
+ typedef std::vector< NamespaceData > NamespaceList;
+
+ struct ElementData {
+ Span name;
+ NamespaceList::size_type inheritedNamespaces;
+ int defaultNamespaceId;
+
+ ElementData(
+ Span const & theName,
+ NamespaceList::size_type theInheritedNamespaces,
+ int theDefaultNamespaceId):
+ name(theName), inheritedNamespaces(theInheritedNamespaces),
+ defaultNamespaceId(theDefaultNamespaceId)
+ {}
+ };
+
+ typedef std::stack< ElementData > ElementStack;
+
+ struct AttributeData {
+ char const * nameBegin;
+ char const * nameEnd;
+ char const * nameColon;
+ char const * valueBegin;
+ char const * valueEnd;
+
+ AttributeData(
+ char const * theNameBegin, char const * theNameEnd,
+ char const * theNameColon, char const * theValueBegin,
+ char const * theValueEnd):
+ nameBegin(theNameBegin), nameEnd(theNameEnd),
+ nameColon(theNameColon), valueBegin(theValueBegin),
+ valueEnd(theValueEnd)
+ {}
+ };
+
+ typedef std::vector< AttributeData > Attributes;
+
+ enum State {
+ STATE_CONTENT, STATE_START_TAG, STATE_END_TAG, STATE_EMPTY_ELEMENT_TAG,
+ STATE_DONE };
+
+ SAL_DLLPRIVATE inline char read() { return pos_ == end_ ? '\0' : *pos_++; }
+
+ SAL_DLLPRIVATE inline char peek() { return pos_ == end_ ? '\0' : *pos_; }
+
+ SAL_DLLPRIVATE void normalizeLineEnds(Span const & text);
+
+ SAL_DLLPRIVATE void skipSpace();
+
+ SAL_DLLPRIVATE bool skipComment();
+
+ SAL_DLLPRIVATE void skipProcessingInstruction();
+
+ SAL_DLLPRIVATE void skipDocumentTypeDeclaration();
+
+ SAL_DLLPRIVATE Span scanCdataSection();
+
+ SAL_DLLPRIVATE bool scanName(char const ** nameColon);
+
+ SAL_DLLPRIVATE int scanNamespaceIri(
+ char const * begin, char const * end);
+
+ SAL_DLLPRIVATE char const * handleReference(
+ char const * position, char const * end);
+
+ SAL_DLLPRIVATE Span handleAttributeValue(
+ char const * begin, char const * end, bool fullyNormalize);
+
+ SAL_DLLPRIVATE Result handleStartTag(int * nsId, Span * localName);
+
+ SAL_DLLPRIVATE Result handleEndTag();
+
+ SAL_DLLPRIVATE void handleElementEnd();
+
+ SAL_DLLPRIVATE Result handleSkippedText(Span * data, int * nsId);
+
+ SAL_DLLPRIVATE Result handleRawText(Span * text);
+
+ SAL_DLLPRIVATE Result handleNormalizedText(Span * text);
+
+ SAL_DLLPRIVATE int toNamespaceId(NamespaceIris::size_type pos);
+
+ OUString fileUrl_;
+ oslFileHandle fileHandle_;
+ sal_uInt64 fileSize_;
+ void * fileAddress_;
+ NamespaceIris namespaceIris_;
+ NamespaceList namespaces_;
+ ElementStack elements_;
+ char const * pos_;
+ char const * end_;
+ State state_;
+ Attributes attributes_;
+ Attributes::iterator currentAttribute_;
+ bool firstAttribute_;
+ Pad pad_;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmlscript/xml_helper.hxx b/include/xmlscript/xml_helper.hxx
new file mode 100644
index 000000000000..5d3c747452ae
--- /dev/null
+++ b/include/xmlscript/xml_helper.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 _XMLSCRIPT_XML_HELPER_HXX_
+#define _XMLSCRIPT_XML_HELPER_HXX_
+
+#include <vector>
+#include <rtl/byteseq.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+
+#include "xmlscript/xmlscriptdllapi.h"
+
+namespace xmlscript
+{
+
+/*##################################################################################################
+
+ EXPORTING
+
+##################################################################################################*/
+
+//==================================================================================================
+class XMLSCRIPT_DLLPUBLIC XMLElement
+ : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XAttributeList >
+{
+public:
+ inline XMLElement( OUString const & name )
+ SAL_THROW(())
+ : _name( name )
+ {}
+
+ /** Adds a sub element of element.
+
+ @param xElem element reference
+ */
+ void SAL_CALL addSubElement(
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > const & xElem )
+ SAL_THROW(());
+
+ /** Gets sub element of given index. The index follows order in which sub elements were added.
+
+ @param nIndex index of sub element
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > SAL_CALL getSubElement( sal_Int32 nIndex )
+ SAL_THROW(());
+
+ /** Adds an attribute to elements.
+
+ @param rAttrName qname of attribute
+ @param rValue value string of element
+ */
+ void SAL_CALL addAttribute( OUString const & rAttrName, OUString const & rValue )
+ SAL_THROW(());
+
+ /** Gets the tag name (qname) of element.
+
+ @return
+ qname of element
+ */
+ inline OUString SAL_CALL getName() SAL_THROW(())
+ { return _name; }
+
+ /** Dumps out element (and all sub elements).
+
+ @param xOut document handler to be written to
+ */
+ void SAL_CALL dump(
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > const & xOut );
+ /** Dumps out sub elements (and all further sub elements).
+
+ @param xOut document handler to be written to
+ */
+ void SAL_CALL dumpSubElements(
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > const & xOut );
+
+ // XAttributeList
+ virtual sal_Int16 SAL_CALL getLength()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getNameByIndex( sal_Int16 nPos )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getTypeByIndex( sal_Int16 nPos )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getTypeByName( OUString const & rName )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getValueByIndex( sal_Int16 nPos )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getValueByName( OUString const & rName )
+ throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ OUString _name;
+
+ ::std::vector< OUString > _attrNames;
+ ::std::vector< OUString > _attrValues;
+
+ ::std::vector< ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > > _subElems;
+};
+
+
+/*##################################################################################################
+
+ STREAMING
+
+##################################################################################################*/
+
+XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+SAL_CALL createInputStream(
+ ::rtl::ByteSequence const & rInData )
+ SAL_THROW(());
+
+XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+SAL_CALL createOutputStream(
+ ::rtl::ByteSequence * pOutData )
+ SAL_THROW(());
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmlscript/xmldlg_imexp.hxx b/include/xmlscript/xmldlg_imexp.hxx
new file mode 100644
index 000000000000..28f726d57109
--- /dev/null
+++ b/include/xmlscript/xmldlg_imexp.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _XMLSCRIPT_XMLDLG_IMEXP_HXX_
+#define _XMLSCRIPT_XMLDLG_IMEXP_HXX_
+
+#include <com/sun/star/frame/XModel.hpp>
+
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/io/XInputStreamProvider.hpp>
+#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include "xmlscript/xmlns.h"
+#include "xmlscript/xmlscriptdllapi.h"
+
+namespace xmlscript
+{
+
+XMLSCRIPT_DLLPUBLIC void SAL_CALL exportDialogModel(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer > const & xDialogModel,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel > const & xDocument )
+ SAL_THROW( (::com::sun::star::uno::Exception) );
+
+XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >
+SAL_CALL importDialogModel(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer > const & xDialogModel,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & xContext,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel > const & xDocument )
+ SAL_THROW( (::com::sun::star::uno::Exception) );
+
+// additional functions for convenience
+
+XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStreamProvider >
+SAL_CALL exportDialogModel(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer > const & xDialogModel,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & xContext,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel > const & xDocument )
+ SAL_THROW( (::com::sun::star::uno::Exception) );
+
+XMLSCRIPT_DLLPUBLIC void SAL_CALL importDialogModel(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream > const & xInput,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer > const & xDialogModel,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & xContext,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel > const & xDocument )
+ SAL_THROW( (::com::sun::star::uno::Exception) );
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmlscript/xmllib_imexp.hxx b/include/xmlscript/xmllib_imexp.hxx
new file mode 100644
index 000000000000..08f58c5e6049
--- /dev/null
+++ b/include/xmlscript/xmllib_imexp.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _XMLSCRIPT_XMLLIB_IMEXP_HXX_
+#define _XMLSCRIPT_XMLLIB_IMEXP_HXX_
+
+#include <com/sun/star/xml/sax/XWriter.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include "xmlscript/xmlns.h"
+#include "xmlscript/xmlscriptdllapi.h"
+
+namespace xmlscript
+{
+
+//==============================================================================
+// Library container export
+// HACK C++ struct to transport info. Later the container
+// itself should do the export/import and use exportet XML
+// functionality from xmlscript
+struct XMLSCRIPT_DLLPUBLIC LibDescriptor
+{
+ OUString aName;
+ OUString aStorageURL;
+ sal_Bool bLink;
+ sal_Bool bReadOnly;
+ sal_Bool bPasswordProtected;
+ ::com::sun::star::uno::Sequence< OUString > aElementNames;
+ sal_Bool bPreload;
+};
+
+struct XMLSCRIPT_DLLPUBLIC LibDescriptorArray
+{
+ LibDescriptor* mpLibs;
+ sal_Int32 mnLibCount;
+
+ LibDescriptorArray( void ) { mpLibs = NULL; mnLibCount = 0; }
+ LibDescriptorArray( sal_Int32 nLibCount );
+
+ ~LibDescriptorArray();
+
+};
+
+XMLSCRIPT_DLLPUBLIC void
+SAL_CALL exportLibraryContainer(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XWriter > const & xOut,
+ const LibDescriptorArray* pLibArray )
+ SAL_THROW( (::com::sun::star::uno::Exception) );
+
+XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XDocumentHandler >
+SAL_CALL importLibraryContainer( LibDescriptorArray* pLibArray )
+ SAL_THROW( (::com::sun::star::uno::Exception) );
+
+
+XMLSCRIPT_DLLPUBLIC void
+SAL_CALL exportLibrary(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XWriter > const & xOut,
+ const LibDescriptor& rLib )
+ SAL_THROW( (::com::sun::star::uno::Exception) );
+
+XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XDocumentHandler >
+SAL_CALL importLibrary( LibDescriptor& rLib )
+ SAL_THROW( (::com::sun::star::uno::Exception) );
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmlscript/xmlmod_imexp.hxx b/include/xmlscript/xmlmod_imexp.hxx
new file mode 100644
index 000000000000..2898d8a5fc20
--- /dev/null
+++ b/include/xmlscript/xmlmod_imexp.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 _XMLSCRIPT_XMLMOD_IMEXP_HXX_
+#define _XMLSCRIPT_XMLMOD_IMEXP_HXX_
+
+#include <com/sun/star/xml/sax/XWriter.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <xmlscript/xmlns.h>
+#include "xmlscript/xmlscriptdllapi.h"
+
+namespace xmlscript
+{
+
+//==============================================================================
+// Script module import/export
+// HACK C++ struct to transport info. Later the container
+// itself should do the export/import and use exportet XML
+// functionality from xmlscript
+struct XMLSCRIPT_DLLPUBLIC ModuleDescriptor
+{
+ OUString aName;
+ OUString aLanguage;
+ OUString aCode;
+ OUString aModuleType; // VBA
+};
+
+XMLSCRIPT_DLLPUBLIC void
+SAL_CALL exportScriptModule(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XWriter > const & xOut,
+ const ModuleDescriptor& rMod )
+ SAL_THROW( (::com::sun::star::uno::Exception) );
+
+XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XDocumentHandler >
+SAL_CALL importScriptModule( ModuleDescriptor& rMod )
+ SAL_THROW( (::com::sun::star::uno::Exception) );
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmlscript/xmlns.h b/include/xmlscript/xmlns.h
new file mode 100644
index 000000000000..cb0e37af0b07
--- /dev/null
+++ b/include/xmlscript/xmlns.h
@@ -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 _XMLSCRIPT_XMLNS_H_
+#define _XMLSCRIPT_XMLNS_H_
+
+#define XMLNS_DIALOGS_URI "http://openoffice.org/2000/dialog"
+#define XMLNS_DIALOGS_PREFIX "dlg"
+
+#define XMLNS_SCRIPT_URI "http://openoffice.org/2000/script"
+#define XMLNS_SCRIPT_PREFIX "script"
+
+#define XMLNS_OOO_URI "http://openoffice.org/2004/office"
+#define XMLNS_OOO_PREFIX "ooo"
+
+#define XMLNS_LIBRARY_URI "http://openoffice.org/2000/library"
+#define XMLNS_LIBRARY_PREFIX "library"
+
+#define XMLNS_XLINK_URI "http://www.w3.org/1999/xlink"
+#define XMLNS_XLINK_PREFIX "xlink"
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmlscript/xmlscriptdllapi.h b/include/xmlscript/xmlscriptdllapi.h
new file mode 100644
index 000000000000..b9634d57ee36
--- /dev/null
+++ b/include/xmlscript/xmlscriptdllapi.h
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_XMLSCRIPT_DLL_API_H
+#define INCLUDED_XMLSCRIPT_DLL_API_H
+
+#include <sal/types.h>
+
+#if defined(XMLSCRIPT_DLLIMPLEMENTATION)
+#define XMLSCRIPT_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define XMLSCRIPT_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define XMLSCRIPT_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */